summaryrefslogtreecommitdiff
path: root/Build/source/libs/gmp
diff options
context:
space:
mode:
authorPeter Breitenlohner <peb@mppmu.mpg.de>2014-06-18 11:12:01 +0000
committerPeter Breitenlohner <peb@mppmu.mpg.de>2014-06-18 11:12:01 +0000
commit0c2f0333a4e539325da80cdf3fb182cd17134665 (patch)
treede5daa66b5595292a33c25110aa58ff8bff75543 /Build/source/libs/gmp
parentdb612d5045ef55da386a2c3350d4811d1da1a858 (diff)
Add libs/gmp and libs/mpfr in preparation for MetaPost 2.0
git-svn-id: svn://tug.org/texlive/trunk@34274 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/libs/gmp')
-rw-r--r--Build/source/libs/gmp/ChangeLog15
-rw-r--r--Build/source/libs/gmp/Makefile.am486
-rw-r--r--Build/source/libs/gmp/Makefile.in2474
-rw-r--r--Build/source/libs/gmp/README17
-rw-r--r--Build/source/libs/gmp/ac/gmp.ac9
-rw-r--r--Build/source/libs/gmp/ac/withenable.ac10
-rw-r--r--Build/source/libs/gmp/aclocal.m41190
-rw-r--r--Build/source/libs/gmp/config.h.in118
-rwxr-xr-xBuild/source/libs/gmp/configure7954
-rw-r--r--Build/source/libs/gmp/configure.ac112
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0-PATCHES/ChangeLog4
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0-PATCHES/TL-Changes37
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0-PATCHES/patch-01-const12
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/AUTHORS100
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/ChangeLog32941
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/INSTALL80
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/Makefile.am445
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/NEWS891
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/README116
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/acinclude.m43984
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/assert.c59
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/bootstrap.c146
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/compat.c60
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/config.in640
-rwxr-xr-xBuild/source/libs/gmp/gmp-6.0.0/configgmp.guess1021
-rwxr-xr-xBuild/source/libs/gmp/gmp-6.0.0/configgmp.sub165
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/configure.ac3816
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/errno.c70
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/extract-dbl.c311
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/gen-bases.c251
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/gen-fac.c285
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/gen-fib.c156
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/gen-jacobitab.c128
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/gen-psqr.c586
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/gen-trialdivtab.c300
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/gmp-h.in2301
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/gmp-impl.h5203
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/gmpxx.h3336
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/invalid.c83
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/longlong.h2183
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/memory.c146
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mini-gmp/README77
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mini-gmp/mini-gmp.c4386
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mini-gmp/mini-gmp.h294
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mp_bpl.c35
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mp_clz_tab.c49
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mp_dv_tab.c78
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mp_get_fns.c48
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mp_minv_tab.c59
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mp_set_fns.c50
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpf/Makefile.am47
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpf/abs.c59
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpf/add.c184
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpf/add_ui.c153
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpf/ceilfloor.c126
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpf/clear.c39
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpf/clears.c49
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpf/cmp.c117
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpf/cmp_d.c60
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpf/cmp_si.c118
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpf/cmp_ui.c100
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpf/div.c138
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpf/div_2exp.c139
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpf/div_ui.c111
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpf/dump.c53
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpf/eq.c150
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpf/fits_s.h75
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpf/fits_sint.c36
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpf/fits_slong.c36
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpf/fits_sshort.c36
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpf/fits_u.h74
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpf/fits_uint.c35
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpf/fits_ulong.c35
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpf/fits_ushort.c35
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpf/get_d.c47
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpf/get_d_2exp.c61
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpf/get_dfl_prec.c39
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpf/get_prc.c38
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpf/get_si.c87
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpf/get_str.c330
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpf/get_ui.c102
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpf/init.c42
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpf/init2.c44
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpf/inits.c49
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpf/inp_str.c93
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpf/int_p.c59
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpf/iset.c62
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpf/iset_d.c42
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpf/iset_si.c58
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpf/iset_str.c44
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpf/iset_ui.c53
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpf/mul.c96
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpf/mul_2exp.c133
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpf/mul_ui.c182
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpf/neg.c62
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpf/out_str.c117
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpf/pow_ui.c54
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpf/random2.c67
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpf/reldiff.c65
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpf/set.c56
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpf/set_d.c60
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpf/set_dfl_prec.c40
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpf/set_prc.c69
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpf/set_prc_raw.c40
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpf/set_q.c155
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpf/set_si.c53
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpf/set_str.c402
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpf/set_ui.c49
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpf/set_z.c57
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpf/size.c39
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpf/sqrt.c113
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpf/sqrt_ui.c109
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpf/sub.c419
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpf/sub_ui.c51
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpf/swap.c57
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpf/trunc.c75
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpf/ui_div.c128
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpf/ui_sub.c336
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpf/urandomb.c69
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/Makeasm.am118
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/Makefile.am59
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/README44
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/README208
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/add_n.asm164
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/addmul_1.asm99
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/alpha-defs.m4107
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/aorslsh1_n.asm164
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/aorslsh2_n.asm167
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/bdiv_dbm1c.asm282
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/cntlz.asm55
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/com.asm176
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/copyd.asm88
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/copyi.asm86
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/default.m4127
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/dive_1.c115
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/divrem_2.asm177
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/ev5/diveby3.asm332
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/ev5/gmp-mparam.h187
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/ev6/add_n.asm283
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/ev6/aorslsh1_n.asm172
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/ev6/aorsmul_1.asm398
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/ev6/gmp-mparam.h209
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/ev6/mod_1_4.asm337
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/ev6/mul_1.asm496
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/ev6/nails/README65
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/ev6/nails/addmul_1.asm396
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/ev6/nails/addmul_2.asm146
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/ev6/nails/addmul_3.asm169
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/ev6/nails/addmul_4.asm210
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/ev6/nails/aors_n.asm233
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/ev6/nails/gmp-mparam.h72
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/ev6/nails/mul_1.asm364
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/ev6/nails/submul_1.asm396
-rwxr-xr-xBuild/source/libs/gmp/gmp-6.0.0/mpn/alpha/ev6/slot.pl318
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/ev6/sub_n.asm283
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/ev67/gcd_1.asm145
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/ev67/hamdist.asm111
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/ev67/popcount.asm101
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/gmp-mparam.h86
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/invert_limb.asm95
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/lshift.asm182
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/mod_34lsub1.asm164
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/mode1o.asm209
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/mul_1.asm102
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/rshift.asm180
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/sec_tabselect.asm137
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/sqr_diag_addlsh1.asm93
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/sub_n.asm164
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/submul_1.asm99
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/umul.asm44
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/unicos.m4131
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/arm/README35
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/arm/aors_n.asm112
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/arm/aorslsh1_n.asm167
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/arm/aorsmul_1.asm135
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/arm/arm-defs.m491
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/arm/bdiv_dbm1c.asm113
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/arm/cnd_aors_n.asm134
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/arm/com.asm75
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/arm/copyd.asm84
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/arm/copyi.asm79
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/arm/dive_1.asm151
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/arm/gmp-mparam.h127
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/arm/invert_limb.asm93
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/arm/logops_n.asm139
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/arm/lshift.asm88
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/arm/lshiftc.asm95
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/arm/mod_34lsub1.asm121
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/arm/mode1o.asm92
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/arm/mul_1.asm94
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/arm/neon/README2
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/arm/neon/hamdist.asm194
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/arm/neon/lorrshift.asm279
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/arm/neon/lshiftc.asm257
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/arm/neon/popcount.asm166
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/arm/neon/sec_tabselect.asm140
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/arm/rsh1aors_n.asm124
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/arm/rshift.asm86
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/arm/sec_tabselect.asm131
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/arm/udiv.asm104
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/arm/v5/gcd_1.asm120
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/arm/v5/mod_1_1.asm129
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/arm/v5/mod_1_2.asm156
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/arm/v6/addmul_1.asm111
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/arm/v6/addmul_2.asm138
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/arm/v6/addmul_3.asm187
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/arm/v6/dive_1.asm149
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/arm/v6/gmp-mparam.h157
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/arm/v6/mode1o.asm95
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/arm/v6/mul_1.asm114
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/arm/v6/mul_2.asm131
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/arm/v6/popham.asm138
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/arm/v6/sqr_basecase.asm518
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/arm/v6/submul_1.asm125
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/arm/v6t2/divrem_1.asm212
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/arm/v6t2/gcd_1.asm115
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/arm/v7a/cora15/addmul_1.asm145
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/arm/v7a/cora15/aors_n.asm162
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/arm/v7a/cora15/cnd_aors_n.asm158
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/arm/v7a/cora15/com.asm180
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/arm/v7a/cora15/gmp-mparam.h197
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/arm/v7a/cora15/logops_n.asm253
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/arm/v7a/cora15/mul_1.asm104
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/arm/v7a/cora15/neon/aorsorrlsh1_n.asm43
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/arm/v7a/cora15/neon/aorsorrlsh2_n.asm43
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/arm/v7a/cora15/neon/aorsorrlshC_n.asm144
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/arm/v7a/cora15/neon/com.asm97
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/arm/v7a/cora15/neon/copyd.asm110
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/arm/v7a/cora15/neon/copyi.asm90
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/arm/v7a/cora15/neon/rsh1aors_n.asm177
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/arm/v7a/cora15/submul_1.asm159
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/arm/v7a/cora9/gmp-mparam.h209
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/arm64/aors_n.asm98
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/arm64/aorsmul_1.asm122
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/arm64/cnd_aors_n.asm99
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/arm64/copyd.asm93
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/arm64/copyi.asm77
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/arm64/gcd_1.asm125
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/arm64/invert_limb.asm83
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/arm64/logops_n.asm106
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/arm64/mul_1.asm98
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/asm-defs.m41761
-rwxr-xr-xBuild/source/libs/gmp/gmp-6.0.0/mpn/cpp-ccas118
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/cray/README121
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/cray/add_n.c91
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/cray/cfp/addmul_1.c49
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/cray/cfp/mul_1.c48
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/cray/cfp/mulwwc90.s254
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/cray/cfp/mulwwj90.s253
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/cray/cfp/submul_1.c49
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/cray/gmp-mparam.h79
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/cray/hamdist.c43
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/cray/ieee/addmul_1.c112
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/cray/ieee/gmp-mparam.h73
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/cray/ieee/invert_limb.c128
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/cray/ieee/mul_1.c104
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/cray/ieee/mul_basecase.c108
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/cray/ieee/sqr_basecase.c106
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/cray/ieee/submul_1.c112
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/cray/lshift.c59
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/cray/mulww.f63
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/cray/popcount.c43
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/cray/rshift.c59
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/cray/sub_n.c91
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/add.c34
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/add_1.c34
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/add_err1_n.c101
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/add_err2_n.c117
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/add_err3_n.c132
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/add_n.c90
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/add_n_sub_n.c173
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/addmul_1.c139
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/bdiv_dbm1c.c59
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/bdiv_q.c77
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/bdiv_q_1.c126
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/bdiv_qr.c85
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/binvert.c102
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/broot.c196
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/brootinv.c140
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/bsqrt.c48
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/bsqrtinv.c105
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/cmp.c34
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/cnd_add_n.c70
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/cnd_sub_n.c70
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/com.c45
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/comb_tables.c48
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/copyd.c41
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/copyi.c43
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/dcpi1_bdiv_q.c160
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/dcpi1_bdiv_qr.c177
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/dcpi1_div_q.c87
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/dcpi1_div_qr.c249
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/dcpi1_divappr_q.c257
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/div_q.c323
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/div_qr_1.c126
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/div_qr_1n_pi1.c277
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/div_qr_1n_pi2.c195
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/div_qr_1u_pi2.c228
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/div_qr_2.c332
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/div_qr_2n_pi1.c85
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/div_qr_2u_pi1.c77
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/dive_1.c148
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/diveby3.c174
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/divexact.c294
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/divis.c201
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/divrem.c108
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/divrem_1.c255
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/divrem_2.c119
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/dump.c100
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/fib2_ui.c189
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/gcd.c310
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/gcd_1.c199
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/gcd_subdiv_step.c205
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/gcdext.c558
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/gcdext_1.c328
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/gcdext_lehmer.c337
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/get_d.c412
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/get_str.c553
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/gmp-mparam.h33
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/hgcd.c183
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/hgcd2.c447
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/hgcd2_jacobi.c366
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/hgcd_appr.c268
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/hgcd_jacobi.c244
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/hgcd_matrix.c266
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/hgcd_reduce.c247
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/hgcd_step.c128
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/invert.c91
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/invertappr.c314
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/jacbase.c243
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/jacobi.c295
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/jacobi_2.c352
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/logops_n.c78
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/lshift.c73
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/lshiftc.c74
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/matrix22_mul.c322
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/matrix22_mul1_inverse_vector.c65
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/mod_1.c281
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/mod_1_1.c332
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/mod_1_2.c149
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/mod_1_3.c157
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/mod_1_4.c171
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/mod_34lsub1.c131
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/mode1o.c236
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/mu_bdiv_q.c271
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/mu_bdiv_qr.c289
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/mu_div_q.c185
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/mu_div_qr.c416
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/mu_divappr_q.c363
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/mul.c428
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/mul_1.c97
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/mul_basecase.c166
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/mul_fft.c1014
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/mul_n.c97
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/mullo_basecase.c52
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/mullo_n.c256
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/mulmid.c256
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/mulmid_basecase.c83
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/mulmid_n.c62
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/mulmod_bnm1.c355
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/neg.c34
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/nussbaumer_mul.c71
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/perfpow.c417
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/perfsqr.c240
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/popham.c126
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/pow_1.c134
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/powlo.c174
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/powm.c590
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/pre_divrem_1.c146
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/pre_mod_1.c62
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/random.c51
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/random2.c106
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/redc_1.c57
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/redc_2.c110
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/redc_n.c81
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/remove.c172
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/rootrem.c415
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/rshift.c70
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/sbpi1_bdiv_q.c100
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/sbpi1_bdiv_qr.c119
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/sbpi1_div_q.c303
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/sbpi1_div_qr.c110
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/sbpi1_divappr_q.c199
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/scan0.c60
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/scan1.c60
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/sec_aors_1.c60
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/sec_div.c133
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/sec_invert.c195
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/sec_mul.c49
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/sec_pi1_div.c173
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/sec_powm.c438
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/sec_sqr.c48
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/sec_tabselect.c55
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/set_str.c374
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/sizeinbase.c50
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/sqr.c99
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/sqr_basecase.c325
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/sqrmod_bnm1.c313
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/sqrtrem.c357
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/sub.c34
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/sub_1.c34
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/sub_err1_n.c101
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/sub_err2_n.c117
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/sub_err3_n.c132
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/sub_n.c90
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/submul_1.c139
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/tdiv_qr.c389
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/toom22_mul.c210
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/toom2_sqr.c146
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/toom32_mul.c323
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/toom33_mul.c316
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/toom3_sqr.c226
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/toom42_mul.c234
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/toom42_mulmid.c238
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/toom43_mul.c234
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/toom44_mul.c236
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/toom4_sqr.c164
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/toom52_mul.c257
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/toom53_mul.c331
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/toom54_mul.c143
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/toom62_mul.c311
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/toom63_mul.c232
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/toom6_sqr.c182
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/toom6h_mul.c263
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/toom8_sqr.c226
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/toom8h_mul.c306
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/toom_couple_handling.c81
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/toom_eval_dgr3_pm1.c73
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/toom_eval_dgr3_pm2.c98
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/toom_eval_pm1.c90
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/toom_eval_pm2.c131
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/toom_eval_pm2exp.c128
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/toom_eval_pm2rexp.c102
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/toom_interpolate_12pts.c361
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/toom_interpolate_16pts.c527
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/toom_interpolate_5pts.c199
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/toom_interpolate_6pts.c240
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/toom_interpolate_7pts.c266
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/toom_interpolate_8pts.c212
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/trialdiv.c132
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/udiv_w_sdiv.c142
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/generic/zero.c42
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/ia64/README281
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/ia64/add_n_sub_n.asm309
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/ia64/addmul_1.asm602
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/ia64/addmul_2.asm708
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/ia64/aors_n.asm856
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/ia64/aorsorrlsh1_n.asm48
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/ia64/aorsorrlsh2_n.asm48
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/ia64/aorsorrlshC_n.asm397
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/ia64/bdiv_dbm1c.asm516
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/ia64/cnd_aors_n.asm259
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/ia64/copyd.asm186
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/ia64/copyi.asm182
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/ia64/dive_1.asm236
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/ia64/divrem_1.asm477
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/ia64/divrem_2.asm280
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/ia64/gcd_1.asm234
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/ia64/gmp-mparam.h204
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/ia64/hamdist.asm365
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/ia64/ia64-defs.m4147
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/ia64/invert_limb.asm105
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/ia64/logops_n.asm292
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/ia64/lorrshift.asm358
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/ia64/lshiftc.asm463
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/ia64/mod_34lsub1.asm236
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/ia64/mode1o.asm342
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/ia64/mul_1.asm584
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/ia64/mul_2.asm620
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/ia64/popcount.asm200
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/ia64/rsh1aors_n.asm447
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/ia64/sec_tabselect.asm150
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/ia64/sqr_diag_addlsh1.asm144
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/ia64/submul_1.asm647
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/lisp/gmpasm-mode.el385
-rwxr-xr-xBuild/source/libs/gmp/gmp-6.0.0/mpn/m4-ccas107
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/m68k/README138
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/m68k/aors_n.asm99
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/m68k/gmp-mparam.h76
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/m68k/lshift.asm175
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/m68k/m68k-defs.m4230
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/m68k/mc68020/aorsmul_1.asm101
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/m68k/mc68020/mul_1.asm96
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/m68k/mc68020/udiv.asm45
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/m68k/mc68020/umul.asm44
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/m68k/rshift.asm175
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/m68k/t-m68k-defs.pl91
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/m88k/README61
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/m88k/add_n.s113
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/m88k/mc88110/add_n.S209
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/m88k/mc88110/addmul_1.s70
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/m88k/mc88110/mul_1.s68
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/m88k/mc88110/sub_n.S285
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/m88k/mul_1.s136
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/m88k/sub_n.s115
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/minithres/gmp-mparam.h109
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/mips32/add_n.asm124
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/mips32/addmul_1.asm101
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/mips32/gmp-mparam.h72
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/mips32/lshift.asm99
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/mips32/mips-defs.m480
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/mips32/mips.m480
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/mips32/mul_1.asm89
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/mips32/rshift.asm96
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/mips32/sub_n.asm123
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/mips32/submul_1.asm101
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/mips32/umul.asm45
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/mips64/README60
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/mips64/add_n.asm134
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/mips64/addmul_1.asm101
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/mips64/gmp-mparam.h72
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/mips64/lshift.asm99
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/mips64/mul_1.asm92
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/mips64/rshift.asm96
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/mips64/sqr_diagonal.asm77
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/mips64/sub_n.asm134
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/mips64/submul_1.asm101
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/mips64/umul.asm45
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/pa32/README162
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/pa32/add_n.asm63
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/pa32/gmp-mparam.h61
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/pa32/hppa1_1/addmul_1.asm106
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/pa32/hppa1_1/gmp-mparam.h72
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/pa32/hppa1_1/mul_1.asm102
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/pa32/hppa1_1/pa7100/add_n.asm83
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/pa32/hppa1_1/pa7100/addmul_1.asm201
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/pa32/hppa1_1/pa7100/lshift.asm95
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/pa32/hppa1_1/pa7100/rshift.asm92
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/pa32/hppa1_1/pa7100/sub_n.asm84
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/pa32/hppa1_1/pa7100/submul_1.asm207
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/pa32/hppa1_1/sqr_diagonal.asm60
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/pa32/hppa1_1/submul_1.asm115
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/pa32/hppa1_1/udiv.asm102
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/pa32/hppa1_1/umul.asm47
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/pa32/hppa2_0/add_n.asm107
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/pa32/hppa2_0/gmp-mparam.h167
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/pa32/hppa2_0/sqr_diagonal.asm112
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/pa32/hppa2_0/sub_n.asm107
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/pa32/lshift.asm75
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/pa32/pa-defs.m464
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/pa32/rshift.asm72
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/pa32/sub_n.asm64
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/pa32/udiv.asm291
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/pa64/README78
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/pa64/addmul_1.asm693
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/pa64/aors_n.asm130
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/pa64/aorslsh1_n.asm228
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/pa64/gmp-mparam.h247
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/pa64/lshift.asm114
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/pa64/mul_1.asm646
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/pa64/rshift.asm111
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/pa64/sqr_diagonal.asm191
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/pa64/submul_1.asm700
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/pa64/udiv.asm125
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/pa64/umul.asm98
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/power/add_n.asm83
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/power/addmul_1.asm126
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/power/gmp-mparam.h69
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/power/lshift.asm61
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/power/mul_1.asm113
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/power/rshift.asm59
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/power/sdiv.asm39
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/power/sub_n.asm85
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/power/submul_1.asm131
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/power/umul.asm43
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc32/750/com.asm79
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc32/750/gmp-mparam.h192
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc32/750/lshift.asm155
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc32/750/rshift.asm153
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc32/README180
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc32/addlsh1_n.asm100
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc32/addmul_1.asm155
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc32/aix.m482
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc32/aors_n.asm157
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc32/bdiv_dbm1c.asm131
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc32/darwin.m491
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc32/diveby3.asm93
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc32/divrem_2.asm182
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc32/eabi.m486
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc32/elf.m497
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc32/gmp-mparam.h217
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc32/invert_limb.asm142
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc32/lshift.asm166
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc32/lshiftc.asm168
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc32/mod_34lsub1.asm145
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc32/mode1o.asm127
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc32/mul_1.asm101
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc32/p3-p7/aors_n.asm186
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc32/p3/gmp-mparam.h155
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc32/p4/gmp-mparam.h204
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc32/p5/gmp-mparam.h156
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc32/p6/gmp-mparam.h165
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc32/p7/gmp-mparam.h159
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc32/powerpc-defs.m4104
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc32/rshift.asm164
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc32/sec_tabselect.asm141
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc32/sqr_diag_addlsh1.asm80
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc32/sublsh1_n.asm101
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc32/submul_1.asm147
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc32/umul.asm50
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc32/vmx/copyd.asm203
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc32/vmx/copyi.asm198
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc32/vmx/logops_n.asm310
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc32/vmx/mod_34lsub1.asm386
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc32/vmx/popcount.asm34
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/README166
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/aix.m497
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/com.asm136
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/copyd.asm84
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/copyi.asm78
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/darwin.m4119
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/elf.m4123
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/logops_n.asm151
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/lshift.asm207
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/lshiftc.asm210
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/mode32/add_n.asm86
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/mode32/addmul_1.asm79
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/mode32/mul_1.asm73
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/mode32/p4/gmp-mparam.h173
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/mode32/sqr_diagonal.asm117
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/mode32/sub_n.asm88
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/mode32/submul_1.asm82
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/mode64/aors_n.asm189
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/mode64/aorsmul_1.asm225
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/mode64/aorsorrlsh1_n.asm43
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/mode64/aorsorrlsh2_n.asm43
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/mode64/aorsorrlshC_n.asm187
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/mode64/bdiv_dbm1c.asm132
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/mode64/cnd_aors_n.asm196
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/mode64/dive_1.asm132
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/mode64/divrem_1.asm274
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/mode64/divrem_2.asm187
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/mode64/gcd_1.asm122
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/mode64/gmp-mparam.h82
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/mode64/invert_limb.asm88
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/mode64/mod_1_1.asm164
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/mode64/mod_1_4.asm270
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/mode64/mod_34lsub1.asm132
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/mode64/mode1o.asm117
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/mode64/mul_1.asm168
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/mode64/mul_basecase.asm708
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/mode64/p3/gmp-mparam.h179
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/mode64/p4/gmp-mparam.h208
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/mode64/p5/gmp-mparam.h219
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/mode64/p6/aorsmul_1.asm183
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/mode64/p6/gmp-mparam.h160
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/mode64/p6/mul_basecase.asm589
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/mode64/p7/aormul_2.asm135
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/mode64/p7/aors_n.asm128
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/mode64/p7/aorsorrlsh1_n.asm43
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/mode64/p7/aorsorrlsh2_n.asm43
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/mode64/p7/aorsorrlshC_n.asm129
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/mode64/p7/gcd_1.asm110
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/mode64/p7/gmp-mparam.h243
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/mode64/rsh1aors_n.asm172
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/mode64/sqr_basecase.asm863
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/p6/lshift.asm132
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/p6/lshiftc.asm136
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/p6/rshift.asm131
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/p7/copyd.asm128
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/p7/copyi.asm129
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/p7/hamdist.asm110
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/p7/popcount.asm90
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/rshift.asm207
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/sec_tabselect.asm147
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/umul.asm53
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/vmx/popcount.asm230
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/s390_32/README37
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/s390_32/addmul_1.asm93
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/s390_32/copyd.asm145
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/s390_32/copyi.asm69
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/s390_32/esame/addmul_1.asm72
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/s390_32/esame/aors_n.asm137
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/s390_32/esame/aorslsh1_n.asm173
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/s390_32/esame/bdiv_dbm1c.asm65
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/s390_32/esame/gmp-mparam.h207
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/s390_32/esame/mul_1.asm66
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/s390_32/esame/mul_basecase.asm130
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/s390_32/esame/sqr_basecase.asm203
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/s390_32/esame/submul_1.asm70
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/s390_32/gmp-mparam.h138
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/s390_32/logops_n.asm295
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/s390_32/lshift.asm144
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/s390_32/lshiftc.asm156
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/s390_32/mul_1.asm85
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/s390_32/rshift.asm138
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/s390_32/submul_1.asm93
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/s390_64/README88
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/s390_64/addmul_1.asm72
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/s390_64/aorrlsh1_n.asm168
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/s390_64/aors_n.asm136
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/s390_64/bdiv_dbm1c.asm65
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/s390_64/copyd.asm144
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/s390_64/copyi.asm68
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/s390_64/gmp-mparam.h175
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/s390_64/invert_limb.asm94
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/s390_64/logops_n.asm291
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/s390_64/lshift.asm196
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/s390_64/lshiftc.asm207
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/s390_64/mod_34lsub1.asm109
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/s390_64/mul_1.asm66
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/s390_64/mul_basecase.asm130
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/s390_64/rshift.asm195
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/s390_64/sqr_basecase.asm203
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/s390_64/sublsh1_n.asm169
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/s390_64/submul_1.asm70
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/s390_64/z10/gmp-mparam.h231
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/sh/add_n.asm59
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/sh/sh2/addmul_1.asm65
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/sh/sh2/mul_1.asm62
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/sh/sh2/submul_1.asm65
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/sh/sub_n.asm59
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/sparc32/README71
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/sparc32/add_n.asm245
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/sparc32/addmul_1.asm155
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/sparc32/gmp-mparam.h67
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/sparc32/lshift.asm105
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/sparc32/mul_1.asm146
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/sparc32/rshift.asm102
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/sparc32/sparc-defs.m479
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/sparc32/sub_n.asm335
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/sparc32/submul_1.asm155
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/sparc32/udiv.asm167
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/sparc32/udiv_nfp.asm202
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/sparc32/ultrasparct1/add_n.asm70
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/sparc32/ultrasparct1/addmul_1.asm90
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/sparc32/ultrasparct1/gmp-mparam.h153
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/sparc32/ultrasparct1/mul_1.asm83
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/sparc32/ultrasparct1/sqr_diagonal.asm55
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/sparc32/ultrasparct1/sub_n.asm70
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/sparc32/ultrasparct1/submul_1.asm91
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/sparc32/umul.asm77
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/sparc32/v8/addmul_1.asm131
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/sparc32/v8/gmp-mparam.h73
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/sparc32/v8/mul_1.asm112
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/sparc32/v8/submul_1.asm67
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/sparc32/v8/supersparc/gmp-mparam.h73
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/sparc32/v8/supersparc/udiv.asm131
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/sparc32/v8/udiv.asm131
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/sparc32/v8/umul.asm40
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/sparc32/v9/README4
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/sparc32/v9/add_n.asm129
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/sparc32/v9/addmul_1.asm306
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/sparc32/v9/gmp-mparam.h204
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/sparc32/v9/mul_1.asm287
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/sparc32/v9/sqr_diagonal.asm462
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/sparc32/v9/sub_n.asm129
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/sparc32/v9/submul_1.asm316
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/sparc32/v9/udiv.asm52
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/README125
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/copyd.asm89
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/copyi.asm86
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/dive_1.c158
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/divrem_1.c243
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/gcd_1.asm135
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/gmp-mparam.h139
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/lshift.asm140
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/lshiftc.asm147
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/mod_1.c239
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/mod_1_4.c236
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/mode1o.c197
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/rshift.asm142
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/sec_tabselect.asm162
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/sparc64.h219
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/ultrasparc1234/add_n.asm241
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/ultrasparc1234/addmul_1.asm606
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/ultrasparc1234/addmul_2.asm551
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/ultrasparc1234/lshiftc.asm165
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/ultrasparc1234/mul_1.asm580
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/ultrasparc1234/sqr_diagonal.asm342
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/ultrasparc1234/sub_n.asm241
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/ultrasparc1234/submul_1.asm68
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/ultrasparc34/gmp-mparam.h219
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/ultrasparct1/add_n.asm68
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/ultrasparct1/addlsh1_n.asm41
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/ultrasparct1/addlsh2_n.asm41
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/ultrasparct1/addlshC_n.asm69
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/ultrasparct1/addmul_1.asm86
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/ultrasparct1/gmp-mparam.h154
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/ultrasparct1/mul_1.asm82
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/ultrasparct1/rsblsh1_n.asm41
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/ultrasparct1/rsblsh2_n.asm41
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/ultrasparct1/rsblshC_n.asm69
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/ultrasparct1/sub_n.asm68
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/ultrasparct1/sublsh1_n.asm41
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/ultrasparct1/sublsh2_n.asm41
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/ultrasparct1/sublshC_n.asm69
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/ultrasparct1/submul_1.asm86
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/ultrasparct3/add_n.asm126
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/ultrasparct3/addmul_1.asm182
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/ultrasparct3/aormul_2.asm228
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/ultrasparct3/aormul_4.asm219
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/ultrasparct3/aorslsh_n.asm147
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/ultrasparct3/bdiv_dbm1c.asm147
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/ultrasparct3/cnd_aors_n.asm143
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/ultrasparct3/dive_1.asm129
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/ultrasparct3/hamdist.asm78
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/ultrasparct3/invert_limb.asm92
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/ultrasparct3/missing.asm77
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/ultrasparct3/missing.m488
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/ultrasparct3/mod_1_4.asm233
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/ultrasparct3/mod_34lsub1.asm117
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/ultrasparct3/mode1o.asm82
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/ultrasparct3/mul_1.asm174
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/ultrasparct3/popcount.asm70
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/ultrasparct3/sqr_diag_addlsh1.asm93
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/ultrasparct3/sub_n.asm144
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/ultrasparct3/submul_1.asm170
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/thumb/add_n.asm63
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/thumb/sub_n.asm63
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/vax/add_n.asm64
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/vax/addmul_1.asm124
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/vax/elf.m454
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/vax/gmp-mparam.h60
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/vax/lshift.asm59
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/vax/mul_1.asm118
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/vax/rshift.asm57
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/vax/sub_n.asm64
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/vax/submul_1.asm124
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/README525
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/aors_n.asm202
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/aorsmul_1.asm156
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/atom/aorrlsh1_n.asm53
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/atom/aorrlsh2_n.asm53
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/atom/aorrlshC_n.asm156
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/atom/aors_n.asm159
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/atom/aorslshC_n.asm247
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/atom/bdiv_q_1.asm35
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/atom/cnd_add_n.asm113
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/atom/cnd_sub_n.asm124
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/atom/dive_1.asm34
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/atom/gmp-mparam.h201
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/atom/logops_n.asm151
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/atom/lshift.asm218
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/atom/lshiftc.asm159
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/atom/mmx/copyd.asm34
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/atom/mmx/copyi.asm34
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/atom/mmx/hamdist.asm34
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/atom/mod_34lsub1.asm34
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/atom/mode1o.asm34
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/atom/rshift.asm152
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/atom/sse2/aorsmul_1.asm174
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/atom/sse2/bdiv_dbm1c.asm34
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/atom/sse2/divrem_1.asm34
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/atom/sse2/mod_1_1.asm34
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/atom/sse2/mod_1_4.asm34
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/atom/sse2/mul_1.asm124
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/atom/sse2/mul_basecase.asm501
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/atom/sse2/popcount.asm35
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/atom/sse2/sqr_basecase.asm634
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/atom/sublsh1_n.asm34
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/atom/sublsh2_n.asm57
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/bd1/gmp-mparam.h208
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/bd2/gmp-mparam.h209
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/bdiv_dbm1c.asm129
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/bdiv_q_1.asm208
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/bobcat/gmp-mparam.h197
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/cnd_aors_n.asm124
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/copyd.asm91
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/copyi.asm99
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/core2/gmp-mparam.h200
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/coreihwl/gmp-mparam.h210
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/coreinhm/gmp-mparam.h224
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/coreisbr/gmp-mparam.h203
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/darwin.m482
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/dive_1.asm189
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/divrem_1.asm233
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/divrem_2.asm199
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/fat/com.c32
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/fat/fat.c473
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/fat/fat_entry.asm220
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/fat/gcd_1.c32
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/fat/gmp-mparam.h71
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/fat/lshiftc.c32
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/fat/mod_1.c32
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/fat/mod_1_1.c36
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/fat/mod_1_2.c36
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/fat/mod_1_4.c36
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/fat/mode1o.c32
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/fat/mullo_basecase.c32
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/fat/redc_1.c32
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/fat/redc_2.c32
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/geode/gmp-mparam.h141
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/gmp-mparam.h38
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/i486/gmp-mparam.h69
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k10/gmp-mparam.h211
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k6/README251
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k6/aors_n.asm337
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k6/aorsmul_1.asm391
-rwxr-xr-xBuild/source/libs/gmp/gmp-6.0.0/mpn/x86/k6/cross.pl182
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k6/divrem_1.asm203
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k6/gcd_1.asm362
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k6/gmp-mparam.h166
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k6/k62mmx/copyd.asm118
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k6/k62mmx/lshift.asm294
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k6/k62mmx/rshift.asm293
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k6/mmx/com.asm103
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k6/mmx/dive_1.asm281
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k6/mmx/logops_n.asm226
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k6/mmx/lshift.asm130
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k6/mmx/popham.asm236
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k6/mmx/rshift.asm130
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k6/mod_34lsub1.asm190
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k6/mode1o.asm175
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k6/mul_1.asm292
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k6/mul_basecase.asm612
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k6/pre_mod_1.asm146
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k6/sqr_basecase.asm680
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k7/README174
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k7/addlsh1_n.asm196
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k7/aors_n.asm258
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k7/aorsmul_1.asm167
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k7/bdiv_q_1.asm244
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k7/dive_1.asm207
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k7/gcd_1.asm186
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k7/gmp-mparam.h241
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k7/invert_limb.asm193
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k7/mmx/com.asm125
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k7/mmx/copyd.asm144
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k7/mmx/copyi.asm157
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k7/mmx/divrem_1.asm832
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k7/mmx/lshift.asm481
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k7/mmx/popham.asm213
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k7/mmx/rshift.asm480
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k7/mod_1_1.asm221
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k7/mod_1_4.asm260
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k7/mod_34lsub1.asm188
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k7/mode1o.asm180
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k7/mul_1.asm237
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k7/mul_basecase.asm602
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k7/sqr_basecase.asm635
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k7/sublsh1_n.asm173
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k8/gmp-mparam.h198
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/lshift.asm106
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/mmx/sec_tabselect.asm163
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/mod_34lsub1.asm183
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/mul_1.asm140
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/mul_basecase.asm223
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/nano/gmp-mparam.h162
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/p6/README125
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/p6/aors_n.asm156
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/p6/aorsmul_1.asm320
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/p6/bdiv_q_1.asm286
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/p6/copyd.asm178
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/p6/dive_1.asm266
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/p6/gcd_1.asm156
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/p6/gmp-mparam.h194
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/p6/lshsub_n.asm169
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/p6/mmx/divrem_1.asm767
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/p6/mmx/gmp-mparam.h198
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/p6/mmx/lshift.asm38
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/p6/mmx/popham.asm39
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/p6/mmx/rshift.asm38
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/p6/mod_34lsub1.asm190
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/p6/mode1o.asm169
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/p6/mul_basecase.asm607
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/p6/p3mmx/popham.asm42
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/p6/sqr_basecase.asm649
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/p6/sse2/addmul_1.asm37
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/p6/sse2/gmp-mparam.h197
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/p6/sse2/mod_1_1.asm34
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/p6/sse2/mod_1_4.asm34
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/p6/sse2/mul_1.asm38
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/p6/sse2/mul_basecase.asm35
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/p6/sse2/popcount.asm35
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/p6/sse2/sqr_basecase.asm35
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/p6/sse2/submul_1.asm35
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium/README181
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium/aors_n.asm203
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium/aorsmul_1.asm144
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium/bdiv_q_1.asm260
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium/com.asm181
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium/copyd.asm146
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium/copyi.asm164
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium/dive_1.asm272
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium/gmp-mparam.h76
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium/hamdist.asm143
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium/logops_n.asm176
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium/lshift.asm243
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium/mmx/gmp-mparam.h163
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium/mmx/hamdist.asm40
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium/mmx/lshift.asm463
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium/mmx/mul_1.asm371
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium/mmx/rshift.asm468
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium/mod_34lsub1.asm192
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium/mode1o.asm266
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium/mul_1.asm177
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium/mul_2.asm150
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium/mul_basecase.asm143
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium/popcount.asm134
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium/rshift.asm243
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium/sqr_basecase.asm528
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium4/README124
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium4/copyd.asm71
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium4/copyi.asm93
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium4/mmx/lshift.asm39
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium4/mmx/popham.asm203
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium4/mmx/rshift.asm39
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium4/sse2/add_n.asm101
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium4/sse2/addlsh1_n.asm108
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium4/sse2/addmul_1.asm189
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium4/sse2/bdiv_dbm1c.asm141
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium4/sse2/bdiv_q_1.asm233
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium4/sse2/cnd_add_n.asm95
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium4/sse2/cnd_sub_n.asm114
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium4/sse2/dive_1.asm215
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium4/sse2/divrem_1.asm645
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium4/sse2/gmp-mparam.h206
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium4/sse2/mod_1_1.asm166
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium4/sse2/mod_1_4.asm269
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium4/sse2/mod_34lsub1.asm175
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium4/sse2/mode1o.asm174
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium4/sse2/mul_1.asm164
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium4/sse2/mul_basecase.asm662
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium4/sse2/popcount.asm280
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium4/sse2/rsh1add_n.asm126
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium4/sse2/sqr_basecase.asm705
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium4/sse2/sub_n.asm119
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium4/sse2/submul_1.asm182
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/rshift.asm108
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/sec_tabselect.asm115
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/sqr_basecase.asm359
-rwxr-xr-xBuild/source/libs/gmp/gmp-6.0.0/mpn/x86/t-zdisp.sh71
-rwxr-xr-xBuild/source/libs/gmp/gmp-6.0.0/mpn/x86/t-zdisp2.pl147
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/udiv.asm52
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/umul.asm51
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86/x86-defs.m4999
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/README74
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/addaddmul_1msb0.asm170
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/addmul_2.asm184
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/aorrlsh1_n.asm170
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/aorrlsh2_n.asm53
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/aorrlshC_n.asm160
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/aorrlsh_n.asm176
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/aors_err1_n.asm225
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/aors_err2_n.asm172
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/aors_err3_n.asm156
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/aors_n.asm169
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/aorsmul_1.asm180
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/atom/addmul_2.asm186
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/atom/aorrlsh1_n.asm238
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/atom/aorrlsh2_n.asm191
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/atom/aors_n.asm37
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/atom/aorsmul_1.asm190
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/atom/com.asm37
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/atom/copyd.asm37
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/atom/copyi.asm37
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/atom/dive_1.asm37
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/atom/gmp-mparam.h220
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/atom/lshift.asm123
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/atom/lshiftc.asm127
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/atom/mul_1.asm143
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/atom/mul_2.asm186
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/atom/popcount.asm35
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/atom/redc_1.asm574
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/atom/rsh1aors_n.asm287
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/atom/rshift.asm121
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/atom/sublsh1_n.asm242
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/bd1/README11
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/bd1/aorrlsh1_n.asm37
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/bd1/aorsmul_1.asm181
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/bd1/com.asm37
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/bd1/copyd.asm37
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/bd1/copyi.asm37
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/bd1/gcd_1.asm37
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/bd1/gmp-mparam.h236
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/bd1/hamdist.asm38
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/bd1/mul_1.asm184
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/bd1/mul_2.asm192
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/bd1/mul_basecase.asm416
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/bd1/popcount.asm38
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/bd1/sec_tabselect.asm37
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/bd1/sublsh1_n.asm37
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/bd2/gmp-mparam.h237
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/bdiv_dbm1c.asm106
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/bdiv_q_1.asm167
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/bobcat/aors_n.asm150
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/bobcat/aorsmul_1.asm183
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/bobcat/copyd.asm91
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/bobcat/copyi.asm94
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/bobcat/gmp-mparam.h208
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/bobcat/mul_1.asm187
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/bobcat/mul_basecase.asm486
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/bobcat/redc_1.asm502
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/bobcat/sqr_basecase.asm565
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/cnd_aors_n.asm183
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/com.asm95
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/copyd.asm93
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/copyi.asm92
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/core2/aorrlsh1_n.asm53
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/core2/aorrlsh2_n.asm53
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/core2/aorrlsh_n.asm38
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/core2/aors_err1_n.asm225
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/core2/aors_n.asm141
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/core2/aorsmul_1.asm178
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/core2/copyd.asm37
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/core2/copyi.asm37
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/core2/divrem_1.asm237
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/core2/gcd_1.asm144
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/core2/gmp-mparam.h217
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/core2/lshift.asm149
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/core2/lshiftc.asm159
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/core2/mul_basecase.asm975
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/core2/mullo_basecase.asm427
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/core2/popcount.asm35
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/core2/redc_1.asm425
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/core2/rsh1aors_n.asm169
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/core2/rshift.asm147
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/core2/sec_tabselect.asm37
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/core2/sqr_basecase.asm984
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/core2/sublsh1_n.asm47
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/core2/sublsh2_n.asm47
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/core2/sublshC_n.asm158
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/coreihwl/addmul_2.asm238
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/coreihwl/aorsmul_1.asm198
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/coreihwl/gmp-mparam.h237
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/coreihwl/mul_1.asm155
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/coreihwl/mul_2.asm173
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/coreihwl/mul_basecase.asm441
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/coreihwl/mullo_basecase.asm426
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/coreihwl/redc_1.asm433
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/coreihwl/sqr_basecase.asm506
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/coreinhm/aorrlsh_n.asm200
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/coreinhm/aorsmul_1.asm187
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/coreinhm/gmp-mparam.h231
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/coreinhm/hamdist.asm38
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/coreinhm/popcount.asm38
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/coreinhm/redc_1.asm544
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/coreinhm/sec_tabselect.asm37
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/coreisbr/addmul_2.asm224
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/coreisbr/aorrlsh1_n.asm54
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/coreisbr/aorrlsh2_n.asm56
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/coreisbr/aorrlshC_n.asm173
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/coreisbr/aorrlsh_n.asm215
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/coreisbr/aors_n.asm198
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/coreisbr/aorsmul_1.asm209
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/coreisbr/divrem_1.asm37
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/coreisbr/gmp-mparam.h224
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/coreisbr/lshift.asm37
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/coreisbr/lshiftc.asm37
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/coreisbr/mul_1.asm161
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/coreisbr/mul_2.asm163
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/coreisbr/mul_basecase.asm407
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/coreisbr/mullo_basecase.asm384
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/coreisbr/popcount.asm118
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/coreisbr/redc_1.asm541
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/coreisbr/rsh1aors_n.asm193
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/coreisbr/rshift.asm37
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/coreisbr/sec_tabselect.asm37
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/coreisbr/sqr_basecase.asm484
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/darwin.m481
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/div_qr_1n_pi1.asm247
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/div_qr_2n_pi1.asm158
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/div_qr_2u_pi1.asm200
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/dive_1.asm158
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/divrem_1.asm306
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/divrem_2.asm189
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/dos64.m4100
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/fastavx/copyd.asm171
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/fastavx/copyi.asm168
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/fastsse/README21
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/fastsse/com-palignr.asm302
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/fastsse/com.asm161
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/fastsse/copyd-palignr.asm251
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/fastsse/copyd.asm145
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/fastsse/copyi-palignr.asm295
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/fastsse/copyi.asm166
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/fastsse/lshift-movdqu2.asm182
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/fastsse/lshift.asm169
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/fastsse/lshiftc-movdqu2.asm193
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/fastsse/lshiftc.asm179
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/fastsse/rshift-movdqu2.asm201
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/fastsse/sec_tabselect.asm192
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/fat/fat.c368
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/fat/fat_entry.asm204
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/fat/gmp-mparam.h72
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/fat/mod_1.c32
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/fat/mul_basecase.c32
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/fat/mullo_basecase.c32
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/fat/redc_1.c32
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/fat/redc_2.c32
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/fat/sqr_basecase.c32
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/gcd_1.asm163
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/gmp-mparam.h218
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/invert_limb.asm115
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/invert_limb_table.asm50
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/k10/gcd_1.asm37
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/k10/gmp-mparam.h222
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/k10/hamdist.asm103
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/k10/lshift.asm37
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/k10/lshiftc.asm37
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/k10/popcount.asm138
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/k10/rshift.asm37
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/k10/sec_tabselect.asm37
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/k8/aorrlsh_n.asm217
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/k8/div_qr_1n_pi1.asm249
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/k8/gmp-mparam.h236
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/k8/mul_basecase.asm469
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/k8/mullo_basecase.asm436
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/k8/mulmid_basecase.asm559
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/k8/redc_1.asm590
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/k8/sqr_basecase.asm807
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/logops_n.asm244
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/lshift.asm247
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/lshiftc.asm182
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/lshsub_n.asm172
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/missing-call.m453
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/missing-inline.m4100
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/missing.asm130
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/mod_1_1.asm235
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/mod_1_2.asm238
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/mod_1_4.asm269
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/mod_34lsub1.asm205
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/mode1o.asm171
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/mul_1.asm183
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/mul_2.asm192
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/mulx/adx/addmul_1.asm149
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/mulx/aorsmul_1.asm161
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/mulx/mul_1.asm154
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/nano/copyd.asm37
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/nano/copyi.asm37
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/nano/dive_1.asm166
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/nano/gcd_1.asm37
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/nano/gmp-mparam.h243
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/nano/popcount.asm35
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/pentium4/aors_n.asm196
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/pentium4/aorslsh1_n.asm50
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/pentium4/aorslsh2_n.asm50
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/pentium4/aorslshC_n.asm203
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/pentium4/gmp-mparam.h231
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/pentium4/lshift.asm166
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/pentium4/lshiftc.asm179
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/pentium4/mod_34lsub1.asm167
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/pentium4/popcount.asm35
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/pentium4/rsh1aors_n.asm334
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/pentium4/rshift.asm169
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/pentium4/sec_tabselect.asm37
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/popham.asm177
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/rsh1aors_n.asm189
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/rshift.asm176
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/sec_tabselect.asm176
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/sqr_diag_addlsh1.asm116
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/sublsh1_n.asm160
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/x86_64-defs.m4354
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpq/Makefile.am41
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpq/abs.c56
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpq/aors.c113
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpq/canonicalize.c63
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpq/clear.c41
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpq/clears.c52
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpq/cmp.c126
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpq/cmp_si.c67
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpq/cmp_ui.c100
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpq/div.c115
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpq/equal.c69
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpq/get_d.c175
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpq/get_den.c43
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpq/get_num.c45
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpq/get_str.c76
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpq/init.c49
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpq/inits.c49
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpq/inp_str.c76
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpq/inv.c71
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpq/md_2exp.c111
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpq/mul.c103
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpq/neg.c58
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpq/out_str.c54
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpq/set.c51
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpq/set_d.c166
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpq/set_den.c45
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpq/set_f.c107
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpq/set_num.c45
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpq/set_si.c65
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpq/set_str.c69
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpq/set_ui.c61
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpq/set_z.c49
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpq/swap.c71
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpz/2fac_ui.c100
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpz/Makefile.am67
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpz/abs.c55
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpz/add.c33
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpz/add_ui.c33
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpz/and.c244
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpz/aors.h124
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpz/aors_ui.h121
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpz/aorsmul.c164
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpz/aorsmul_i.c255
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpz/array_init.c50
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpz/bin_ui.c143
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpz/bin_uiui.c696
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpz/cdiv_q.c53
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpz/cdiv_q_ui.c103
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpz/cdiv_qr.c65
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpz/cdiv_qr_ui.c119
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpz/cdiv_r.c61
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpz/cdiv_r_ui.c110
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpz/cdiv_ui.c103
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpz/cfdiv_q_2exp.c113
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpz/cfdiv_r_2exp.c164
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpz/clear.c40
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpz/clears.c49
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpz/clrbit.c116
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpz/cmp.c54
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpz/cmp_d.c145
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpz/cmp_si.c70
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpz/cmp_ui.c78
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpz/cmpabs.c54
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpz/cmpabs_d.c130
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpz/cmpabs_ui.c77
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpz/com.c88
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpz/combit.c103
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpz/cong.c183
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpz/cong_2exp.c150
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpz/cong_ui.c116
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpz/dive_ui.c69
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpz/divegcd.c157
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpz/divexact.c91
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpz/divis.c44
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpz/divis_2exp.c61
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpz/divis_ui.c81
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpz/dump.c49
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpz/export.c190
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpz/fac_ui.c108
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpz/fdiv_q.c53
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpz/fdiv_q_ui.c101
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpz/fdiv_qr.c65
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpz/fdiv_qr_ui.c118
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpz/fdiv_r.c60
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpz/fdiv_r_ui.c108
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpz/fdiv_ui.c101
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpz/fib2_ui.c50
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpz/fib_ui.c152
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpz/fits_s.h61
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpz/fits_sint.c36
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpz/fits_slong.c36
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpz/fits_sshort.c36
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpz/fits_uint.c34
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpz/fits_ulong.c34
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpz/fits_ushort.c34
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpz/gcd.c167
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpz/gcd_ui.c85
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpz/gcdext.c124
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpz/get_d.c44
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpz/get_d_2exp.c54
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpz/get_si.c53
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpz/get_str.c119
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpz/get_ui.c34
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpz/getlimbn.c34
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpz/hamdist.c175
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpz/import.c180
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpz/init.c45
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpz/init2.c61
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpz/inits.c49
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpz/inp_raw.c173
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpz/inp_str.c174
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpz/invert.c73
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpz/ior.c230
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpz/iset.c59
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpz/iset_d.c42
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpz/iset_si.c59
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpz/iset_str.c52
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpz/iset_ui.c59
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpz/jacobi.c211
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpz/kronsz.c138
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpz/kronuz.c130
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpz/kronzs.c93
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpz/kronzu.c89
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpz/lcm.c88
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpz/lcm_ui.c79
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpz/limbs_finish.c40
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpz/limbs_modify.c39
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpz/limbs_read.c38
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpz/limbs_write.c39
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpz/lucnum2_ui.c90
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpz/lucnum_ui.c209
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpz/mfac_uiui.c140
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpz/millerrabin.c124
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpz/mod.c68
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpz/mul.c157
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpz/mul_2exp.c73
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpz/mul_i.h107
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpz/mul_si.c34
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpz/mul_ui.c34
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpz/n_pow_ui.c533
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpz/neg.c57
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpz/nextprime.c129
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpz/oddfac_1.c427
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpz/out_raw.c173
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpz/out_str.c112
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpz/perfpow.c39
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpz/perfsqr.c35
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpz/popcount.c35
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpz/pow_ui.c53
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpz/powm.c283
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpz/powm_sec.c104
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpz/powm_ui.c292
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpz/pprime_p.c164
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpz/primorial_ui.c164
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpz/prodlimbs.c109
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpz/random.c40
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpz/random2.c51
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpz/realloc.c71
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpz/realloc2.c60
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpz/remove.c147
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpz/roinit_n.c44
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpz/root.c93
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpz/rootrem.c101
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpz/rrandomb.c103
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpz/scan0.c130
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpz/scan1.c124
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpz/set.c50
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpz/set_d.c117
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpz/set_f.c72
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpz/set_q.c35
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpz/set_si.c55
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpz/set_str.c145
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpz/set_ui.c53
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpz/setbit.c105
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpz/size.c35
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpz/sizeinbase.c43
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpz/sqrt.c77
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpz/sqrtrem.c85
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpz/sub.c33
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpz/sub_ui.c33
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpz/swap.c55
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpz/tdiv_q.c93
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpz/tdiv_q_2exp.c68
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpz/tdiv_q_ui.c84
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpz/tdiv_qr.c107
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpz/tdiv_qr_ui.c103
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpz/tdiv_r.c98
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpz/tdiv_r_2exp.c78
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpz/tdiv_r_ui.c99
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpz/tdiv_ui.c85
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpz/tstbit.c81
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpz/ui_pow_ui.c59
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpz/ui_sub.c96
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpz/urandomb.c48
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpz/urandomm.c105
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/mpz/xor.c194
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/nextprime.c167
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/primesieve.c295
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/printf/Makefile.am41
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/printf/asprintf.c48
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/printf/asprntffuns.c72
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/printf/doprnt.c627
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/printf/doprntf.c390
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/printf/doprnti.c137
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/printf/fprintf.c49
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/printf/obprintf.c59
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/printf/obprntffuns.c72
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/printf/obvprintf.c52
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/printf/printf.c49
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/printf/printffuns.c80
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/printf/repl-vsnprintf.c396
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/printf/snprintf.c54
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/printf/snprntffuns.c160
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/printf/sprintf.c55
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/printf/sprintffuns.c95
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/printf/vasprintf.c117
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/printf/vfprintf.c42
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/printf/vprintf.c42
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/printf/vsnprintf.c48
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/printf/vsprintf.c51
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/rand/Makefile.am38
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/rand/rand.c52
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/rand/randbui.c57
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/rand/randclr.c38
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/rand/randdef.c38
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/rand/randiset.c39
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/rand/randlc2s.c93
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/rand/randlc2x.c333
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/rand/randmt.c416
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/rand/randmt.h51
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/rand/randmts.c165
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/rand/randmui.c86
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/rand/rands.c42
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/rand/randsd.c39
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/rand/randsdui.c44
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/scanf/Makefile.am38
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/scanf/doscan.c768
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/scanf/fscanf.c48
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/scanf/fscanffuns.c62
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/scanf/scanf.c48
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/scanf/sscanf.c53
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/scanf/sscanffuns.c124
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/scanf/vfscanf.c42
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/scanf/vscanf.c43
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/scanf/vsscanf.c61
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/tal-debug.c151
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/tal-notreent.c130
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/tal-reent.c82
-rw-r--r--Build/source/libs/gmp/gmp-6.0.0/version.c34
-rwxr-xr-xBuild/source/libs/gmp/gmp.test7
-rw-r--r--Build/source/libs/gmp/gmptest.c16
-rw-r--r--Build/source/libs/gmp/include/Makefile.am16
-rw-r--r--Build/source/libs/gmp/include/Makefile.in430
-rw-r--r--Build/source/libs/gmp/m4/gmp-alloca.m456
-rw-r--r--Build/source/libs/gmp/m4/gmp-attribute.m475
-rw-r--r--Build/source/libs/gmp/m4/gmp-double-format.m4242
-rw-r--r--Build/source/libs/gmp/native/Makefile.am67
-rw-r--r--Build/source/libs/gmp/native/Makefile.in786
-rw-r--r--Build/source/libs/gmp/native/aclocal.m41188
-rw-r--r--Build/source/libs/gmp/native/config.h.in25
-rwxr-xr-xBuild/source/libs/gmp/native/configure5899
-rw-r--r--Build/source/libs/gmp/native/configure.ac30
-rw-r--r--Build/source/libs/gmp/version.ac11
1507 files changed, 315515 insertions, 0 deletions
diff --git a/Build/source/libs/gmp/ChangeLog b/Build/source/libs/gmp/ChangeLog
new file mode 100644
index 00000000000..b527a756c98
--- /dev/null
+++ b/Build/source/libs/gmp/ChangeLog
@@ -0,0 +1,15 @@
+2014-05-27 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ Converted wrapper => proxy build system.
+
+ * Makefile.am (basic_unused, mpn_unused, mpz_unused):
+ Compile only as needed by mpost (via libmpfr).
+
+2014-05-07 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ Integrated into TeX Live with wrapper build system.
+ Imported gmp-6.0.0.
+
+2014-03-31 Taco Hoekwater <taco@metatex.org>
+
+ Imported gmp-5.1.3.
diff --git a/Build/source/libs/gmp/Makefile.am b/Build/source/libs/gmp/Makefile.am
new file mode 100644
index 00000000000..5f1e5ef8b41
--- /dev/null
+++ b/Build/source/libs/gmp/Makefile.am
@@ -0,0 +1,486 @@
+## Proxy Makefile.am to build GNU MP for TeX Live.
+##
+## Copyright (C) 2014 Taco Hoekwater <taco@metatex.org>
+## Copyright (C) 2014 Peter Breitenlohner <tex-live@tug.org>
+##
+## This file is free software; the copyright holder
+## gives unlimited permission to copy and/or distribute it,
+## with or without modifications, as long as this notice is preserved.
+##
+## We want to re-distribute the whole GNU MP source tree.
+##
+EXTRA_DIST = $(GMP_TREE)
+
+## Changes applied to the original source tree
+##
+EXTRA_DIST += $(GMP_TREE)-PATCHES
+
+# in case of an SVN repository
+dist-hook:
+ rm -rf `find $(distdir) -name .svn -o -name .deps -o -name .dirstamp -o -name '*.$(OBJEXT)'`
+
+SUBDIRS = native . include
+
+AM_CPPFLAGS = -I$(srcdir)/$(GMP_TREE) -I$(srcdir)/$(GMP_TREE)/mpn/generic -DNO_ASM
+AM_CFLAGS = # $(WARNING_CFLAGS)
+
+noinst_LIBRARIES = libgmp.a
+$(libgmp_a_OBJECTS): mp_bases.h fac_table.h fib_table.h
+nodist_libgmp_a_SOURCES = \
+ $(basic_sources) \
+ $(mpn_sources) \
+ $(mpz_sources)
+
+basic_sources = \
+ @GMP_TREE@/assert.c \
+ @GMP_TREE@/compat.c \
+ @GMP_TREE@/errno.c \
+ @GMP_TREE@/extract-dbl.c \
+ @GMP_TREE@/invalid.c \
+ @GMP_TREE@/memory.c \
+ @GMP_TREE@/mp_bpl.c \
+ @GMP_TREE@/mp_clz_tab.c \
+ @GMP_TREE@/mp_dv_tab.c \
+ @GMP_TREE@/mp_get_fns.c \
+ @GMP_TREE@/mp_minv_tab.c \
+ @GMP_TREE@/mp_set_fns.c \
+ @GMP_TREE@/nextprime.c \
+ @GMP_TREE@/primesieve.c \
+ @GMP_TREE@/tal-reent.c \
+ @GMP_TREE@/version.c
+
+basic_unused = \
+ @GMP_TREE@/tal-debug.c \
+ @GMP_TREE@/tal-notreent.c
+
+logops_n_sources = and_n.c andn_n.c ior_n.c iorn_n.c nand_n.c nior_n.c xnor_n.c xor_n.c
+popham_sources = hamdist.c popcount.c
+sec_aors_1_sources = sec_add_1.c sec_sub_1.c
+sec_div_sources = sec_div_qr.c sec_div_r.c
+sec_pi1_div_sources = sec_pi1_div_qr.c sec_pi1_div_r.c
+
+$(logops_n_sources):
+ @echo "#define OPERATION_`echo $@ | sed 's/\.c//'` 1" >$@
+ @echo "#include <logops_n.c>" >>$@
+$(popham_sources):
+ @echo "#define OPERATION_`echo $@ | sed 's/\.c//'` 1" >$@
+ @echo "#include <popham.c>" >>$@
+$(sec_aors_1_sources):
+ @echo "#define OPERATION_`echo $@ | sed 's/\.c//'` 1" >$@
+ @echo "#include <sec_aors_1.c>" >>$@
+$(sec_div_sources):
+ @echo "#define OPERATION_`echo $@ | sed 's/\.c//'` 1" >$@
+ @echo "#include <sec_div.c>" >>$@
+$(sec_pi1_div_sources):
+ @echo "#define OPERATION_`echo $@ | sed 's/\.c//'` 1" >$@
+ @echo "#include <sec_pi1_div.c>" >>$@
+
+mpn_sources = \
+ mp_bases.c \
+ popcount.c \
+ @GMP_TREE@/mpn/generic/add.c \
+ @GMP_TREE@/mpn/generic/add_n.c \
+ @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/binvert.c \
+ @GMP_TREE@/mpn/generic/dcpi1_bdiv_q.c \
+ @GMP_TREE@/mpn/generic/dcpi1_bdiv_qr.c \
+ @GMP_TREE@/mpn/generic/dcpi1_div_q.c \
+ @GMP_TREE@/mpn/generic/dcpi1_div_qr.c \
+ @GMP_TREE@/mpn/generic/dcpi1_divappr_q.c \
+ @GMP_TREE@/mpn/generic/div_q.c \
+ @GMP_TREE@/mpn/generic/div_qr_2n_pi1.c \
+ @GMP_TREE@/mpn/generic/dive_1.c \
+ @GMP_TREE@/mpn/generic/divexact.c \
+ @GMP_TREE@/mpn/generic/divrem.c \
+ @GMP_TREE@/mpn/generic/divrem_1.c \
+ @GMP_TREE@/mpn/generic/divrem_2.c \
+ @GMP_TREE@/mpn/generic/gcd_subdiv_step.c \
+ @GMP_TREE@/mpn/generic/gcdext.c \
+ @GMP_TREE@/mpn/generic/gcdext_1.c \
+ @GMP_TREE@/mpn/generic/gcdext_lehmer.c \
+ @GMP_TREE@/mpn/generic/get_str.c \
+ @GMP_TREE@/mpn/generic/hgcd.c \
+ @GMP_TREE@/mpn/generic/hgcd2.c \
+ @GMP_TREE@/mpn/generic/hgcd_appr.c \
+ @GMP_TREE@/mpn/generic/hgcd_matrix.c \
+ @GMP_TREE@/mpn/generic/hgcd_reduce.c \
+ @GMP_TREE@/mpn/generic/hgcd_step.c \
+ @GMP_TREE@/mpn/generic/invertappr.c \
+ @GMP_TREE@/mpn/generic/lshift.c \
+ @GMP_TREE@/mpn/generic/lshiftc.c \
+ @GMP_TREE@/mpn/generic/matrix22_mul.c \
+ @GMP_TREE@/mpn/generic/matrix22_mul1_inverse_vector.c \
+ @GMP_TREE@/mpn/generic/mu_bdiv_q.c \
+ @GMP_TREE@/mpn/generic/mu_div_q.c \
+ @GMP_TREE@/mpn/generic/mu_div_qr.c \
+ @GMP_TREE@/mpn/generic/mu_divappr_q.c \
+ @GMP_TREE@/mpn/generic/mul.c \
+ @GMP_TREE@/mpn/generic/mul_1.c \
+ @GMP_TREE@/mpn/generic/mul_basecase.c \
+ @GMP_TREE@/mpn/generic/mul_n.c \
+ @GMP_TREE@/mpn/generic/mul_fft.c \
+ @GMP_TREE@/mpn/generic/mullo_basecase.c \
+ @GMP_TREE@/mpn/generic/mullo_n.c \
+ @GMP_TREE@/mpn/generic/mulmod_bnm1.c \
+ @GMP_TREE@/mpn/generic/nussbaumer_mul.c \
+ @GMP_TREE@/mpn/generic/powlo.c \
+ @GMP_TREE@/mpn/generic/powm.c \
+ @GMP_TREE@/mpn/generic/pre_divrem_1.c \
+ @GMP_TREE@/mpn/generic/redc_1.c \
+ @GMP_TREE@/mpn/generic/redc_n.c \
+ @GMP_TREE@/mpn/generic/rshift.c \
+ @GMP_TREE@/mpn/generic/sbpi1_bdiv_q.c \
+ @GMP_TREE@/mpn/generic/sbpi1_bdiv_qr.c \
+ @GMP_TREE@/mpn/generic/sbpi1_div_q.c \
+ @GMP_TREE@/mpn/generic/sbpi1_div_qr.c \
+ @GMP_TREE@/mpn/generic/sbpi1_divappr_q.c \
+ @GMP_TREE@/mpn/generic/scan1.c \
+ @GMP_TREE@/mpn/generic/set_str.c \
+ @GMP_TREE@/mpn/generic/sqr.c \
+ @GMP_TREE@/mpn/generic/sqr_basecase.c \
+ @GMP_TREE@/mpn/generic/sqrmod_bnm1.c \
+ @GMP_TREE@/mpn/generic/sqrtrem.c \
+ @GMP_TREE@/mpn/generic/sub.c \
+ @GMP_TREE@/mpn/generic/sub_n.c \
+ @GMP_TREE@/mpn/generic/submul_1.c \
+ @GMP_TREE@/mpn/generic/tdiv_qr.c \
+ @GMP_TREE@/mpn/generic/toom2_sqr.c \
+ @GMP_TREE@/mpn/generic/toom22_mul.c \
+ @GMP_TREE@/mpn/generic/toom3_sqr.c \
+ @GMP_TREE@/mpn/generic/toom32_mul.c \
+ @GMP_TREE@/mpn/generic/toom33_mul.c \
+ @GMP_TREE@/mpn/generic/toom42_mul.c \
+ @GMP_TREE@/mpn/generic/toom42_mulmid.c \
+ @GMP_TREE@/mpn/generic/toom43_mul.c \
+ @GMP_TREE@/mpn/generic/toom44_mul.c \
+ @GMP_TREE@/mpn/generic/toom53_mul.c \
+ @GMP_TREE@/mpn/generic/toom63_mul.c \
+ @GMP_TREE@/mpn/generic/toom6_sqr.c \
+ @GMP_TREE@/mpn/generic/toom6h_mul.c \
+ @GMP_TREE@/mpn/generic/toom8_sqr.c \
+ @GMP_TREE@/mpn/generic/toom8h_mul.c \
+ @GMP_TREE@/mpn/generic/toom_couple_handling.c \
+ @GMP_TREE@/mpn/generic/toom_eval_dgr3_pm1.c \
+ @GMP_TREE@/mpn/generic/toom_eval_dgr3_pm2.c \
+ @GMP_TREE@/mpn/generic/toom_eval_pm1.c \
+ @GMP_TREE@/mpn/generic/toom_eval_pm2.c \
+ @GMP_TREE@/mpn/generic/toom_eval_pm2exp.c \
+ @GMP_TREE@/mpn/generic/toom_eval_pm2rexp.c \
+ @GMP_TREE@/mpn/generic/toom_interpolate_12pts.c \
+ @GMP_TREE@/mpn/generic/toom_interpolate_16pts.c \
+ @GMP_TREE@/mpn/generic/toom_interpolate_5pts.c \
+ @GMP_TREE@/mpn/generic/toom_interpolate_6pts.c \
+ @GMP_TREE@/mpn/generic/toom_interpolate_7pts.c \
+ @GMP_TREE@/mpn/generic/toom_interpolate_8pts.c
+
+mpn_unused = \
+ $(logops_n_sources) \
+ $(sec_aors_1_sources) \
+ $(sec_div_sources) \
+ $(sec_pi1_div_sources) \
+ fib_table.c \
+ hamdist.c \
+ @GMP_TREE@/mpn/generic/add_1.c \
+ @GMP_TREE@/mpn/generic/add_err1_n.c \
+ @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 \
+ @GMP_TREE@/mpn/generic/bsqrt.c \
+ @GMP_TREE@/mpn/generic/bsqrtinv.c \
+ @GMP_TREE@/mpn/generic/cmp.c \
+ @GMP_TREE@/mpn/generic/cnd_add_n.c \
+ @GMP_TREE@/mpn/generic/cnd_sub_n.c \
+ @GMP_TREE@/mpn/generic/com.c \
+ @GMP_TREE@/mpn/generic/comb_tables.c \
+ @GMP_TREE@/mpn/generic/copyd.c \
+ @GMP_TREE@/mpn/generic/copyi.c \
+ @GMP_TREE@/mpn/generic/div_qr_1.c \
+ @GMP_TREE@/mpn/generic/div_qr_1n_pi1.c \
+ @GMP_TREE@/mpn/generic/div_qr_2.c \
+ @GMP_TREE@/mpn/generic/div_qr_2u_pi1.c \
+ @GMP_TREE@/mpn/generic/diveby3.c \
+ @GMP_TREE@/mpn/generic/divis.c \
+ @GMP_TREE@/mpn/generic/dump.c \
+ @GMP_TREE@/mpn/generic/fib2_ui.c \
+ @GMP_TREE@/mpn/generic/gcd.c \
+ @GMP_TREE@/mpn/generic/gcd_1.c \
+ @GMP_TREE@/mpn/generic/get_d.c \
+ @GMP_TREE@/mpn/generic/hgcd2_jacobi.c \
+ @GMP_TREE@/mpn/generic/hgcd_jacobi.c \
+ @GMP_TREE@/mpn/generic/invert.c \
+ @GMP_TREE@/mpn/generic/jacbase.c \
+ @GMP_TREE@/mpn/generic/jacobi.c \
+ @GMP_TREE@/mpn/generic/jacobi_2.c \
+ @GMP_TREE@/mpn/generic/mod_1.c \
+ @GMP_TREE@/mpn/generic/mod_1_1.c \
+ @GMP_TREE@/mpn/generic/mod_1_2.c \
+ @GMP_TREE@/mpn/generic/mod_1_3.c \
+ @GMP_TREE@/mpn/generic/mod_1_4.c \
+ @GMP_TREE@/mpn/generic/mod_34lsub1.c \
+ @GMP_TREE@/mpn/generic/mode1o.c \
+ @GMP_TREE@/mpn/generic/mu_bdiv_qr.c \
+ @GMP_TREE@/mpn/generic/mulmid.c \
+ @GMP_TREE@/mpn/generic/mulmid_basecase.c \
+ @GMP_TREE@/mpn/generic/mulmid_n.c \
+ @GMP_TREE@/mpn/generic/neg.c \
+ @GMP_TREE@/mpn/generic/perfpow.c \
+ @GMP_TREE@/mpn/generic/perfsqr.c \
+ @GMP_TREE@/mpn/generic/pow_1.c \
+ @GMP_TREE@/mpn/generic/pre_mod_1.c \
+ @GMP_TREE@/mpn/generic/random.c \
+ @GMP_TREE@/mpn/generic/random2.c \
+ @GMP_TREE@/mpn/generic/redc_2.c \
+ @GMP_TREE@/mpn/generic/remove.c \
+ @GMP_TREE@/mpn/generic/rootrem.c \
+ @GMP_TREE@/mpn/generic/scan0.c \
+ @GMP_TREE@/mpn/generic/sec_invert.c \
+ @GMP_TREE@/mpn/generic/sec_mul.c \
+ @GMP_TREE@/mpn/generic/sec_powm.c \
+ @GMP_TREE@/mpn/generic/sec_sqr.c \
+ @GMP_TREE@/mpn/generic/sec_tabselect.c \
+ @GMP_TREE@/mpn/generic/sizeinbase.c \
+ @GMP_TREE@/mpn/generic/sub_1.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 \
+ @GMP_TREE@/mpn/generic/toom4_sqr.c \
+ @GMP_TREE@/mpn/generic/toom52_mul.c \
+ @GMP_TREE@/mpn/generic/toom54_mul.c \
+ @GMP_TREE@/mpn/generic/toom62_mul.c \
+ @GMP_TREE@/mpn/generic/trialdiv.c \
+ @GMP_TREE@/mpn/generic/zero.c
+
+mpz_sources = \
+ @GMP_TREE@/mpz/add.c \
+ @GMP_TREE@/mpz/add_ui.c \
+ @GMP_TREE@/mpz/aorsmul.c \
+ @GMP_TREE@/mpz/aorsmul_i.c \
+ @GMP_TREE@/mpz/cfdiv_q_2exp.c \
+ @GMP_TREE@/mpz/clear.c \
+ @GMP_TREE@/mpz/cmp_ui.c \
+ @GMP_TREE@/mpz/cmpabs.c \
+ @GMP_TREE@/mpz/divexact.c \
+ @GMP_TREE@/mpz/fdiv_q.c \
+ @GMP_TREE@/mpz/fdiv_q_ui.c \
+ @GMP_TREE@/mpz/fdiv_qr.c \
+ @GMP_TREE@/mpz/gcdext.c \
+ @GMP_TREE@/mpz/get_si.c \
+ @GMP_TREE@/mpz/init.c \
+ @GMP_TREE@/mpz/invert.c \
+ @GMP_TREE@/mpz/iset.c \
+ @GMP_TREE@/mpz/iset_ui.c \
+ @GMP_TREE@/mpz/mod.c \
+ @GMP_TREE@/mpz/mul.c \
+ @GMP_TREE@/mpz/mul_2exp.c \
+ @GMP_TREE@/mpz/mul_si.c \
+ @GMP_TREE@/mpz/mul_ui.c \
+ @GMP_TREE@/mpz/n_pow_ui.c \
+ @GMP_TREE@/mpz/powm.c \
+ @GMP_TREE@/mpz/powm_ui.c \
+ @GMP_TREE@/mpz/realloc.c \
+ @GMP_TREE@/mpz/scan1.c \
+ @GMP_TREE@/mpz/set.c \
+ @GMP_TREE@/mpz/set_ui.c \
+ @GMP_TREE@/mpz/sizeinbase.c \
+ @GMP_TREE@/mpz/sqrt.c \
+ @GMP_TREE@/mpz/sub.c \
+ @GMP_TREE@/mpz/sub_ui.c \
+ @GMP_TREE@/mpz/swap.c \
+ @GMP_TREE@/mpz/tdiv_q.c \
+ @GMP_TREE@/mpz/tdiv_q_2exp.c \
+ @GMP_TREE@/mpz/tdiv_qr.c \
+ @GMP_TREE@/mpz/tdiv_r.c \
+ @GMP_TREE@/mpz/tdiv_r_2exp.c \
+ @GMP_TREE@/mpz/tstbit.c \
+ @GMP_TREE@/mpz/ui_pow_ui.c
+
+mpz_unused = \
+ @GMP_TREE@/mpz/2fac_ui.c \
+ @GMP_TREE@/mpz/abs.c \
+ @GMP_TREE@/mpz/and.c \
+ @GMP_TREE@/mpz/array_init.c \
+ @GMP_TREE@/mpz/bin_ui.c \
+ @GMP_TREE@/mpz/bin_uiui.c \
+ @GMP_TREE@/mpz/cdiv_q.c \
+ @GMP_TREE@/mpz/cdiv_q_ui.c \
+ @GMP_TREE@/mpz/cdiv_qr.c \
+ @GMP_TREE@/mpz/cdiv_qr_ui.c \
+ @GMP_TREE@/mpz/cdiv_r.c \
+ @GMP_TREE@/mpz/cdiv_r_ui.c \
+ @GMP_TREE@/mpz/cdiv_ui.c \
+ @GMP_TREE@/mpz/cfdiv_r_2exp.c \
+ @GMP_TREE@/mpz/clears.c \
+ @GMP_TREE@/mpz/clrbit.c \
+ @GMP_TREE@/mpz/cmp.c \
+ @GMP_TREE@/mpz/cmp_d.c \
+ @GMP_TREE@/mpz/cmp_si.c \
+ @GMP_TREE@/mpz/cmpabs_d.c \
+ @GMP_TREE@/mpz/cmpabs_ui.c \
+ @GMP_TREE@/mpz/com.c \
+ @GMP_TREE@/mpz/combit.c \
+ @GMP_TREE@/mpz/cong.c \
+ @GMP_TREE@/mpz/cong_2exp.c \
+ @GMP_TREE@/mpz/cong_ui.c \
+ @GMP_TREE@/mpz/dive_ui.c \
+ @GMP_TREE@/mpz/divegcd.c \
+ @GMP_TREE@/mpz/divis.c \
+ @GMP_TREE@/mpz/divis_2exp.c \
+ @GMP_TREE@/mpz/divis_ui.c \
+ @GMP_TREE@/mpz/dump.c \
+ @GMP_TREE@/mpz/export.c \
+ @GMP_TREE@/mpz/fac_ui.c \
+ @GMP_TREE@/mpz/fdiv_qr_ui.c \
+ @GMP_TREE@/mpz/fdiv_r.c \
+ @GMP_TREE@/mpz/fdiv_r_ui.c \
+ @GMP_TREE@/mpz/fdiv_ui.c \
+ @GMP_TREE@/mpz/fib2_ui.c \
+ @GMP_TREE@/mpz/fib_ui.c \
+ @GMP_TREE@/mpz/fits_sint.c \
+ @GMP_TREE@/mpz/fits_slong.c \
+ @GMP_TREE@/mpz/fits_sshort.c \
+ @GMP_TREE@/mpz/fits_uint.c \
+ @GMP_TREE@/mpz/fits_ulong.c \
+ @GMP_TREE@/mpz/fits_ushort.c \
+ @GMP_TREE@/mpz/gcd.c \
+ @GMP_TREE@/mpz/gcd_ui.c \
+ @GMP_TREE@/mpz/get_d.c \
+ @GMP_TREE@/mpz/get_d_2exp.c \
+ @GMP_TREE@/mpz/get_str.c \
+ @GMP_TREE@/mpz/get_ui.c \
+ @GMP_TREE@/mpz/getlimbn.c \
+ @GMP_TREE@/mpz/hamdist.c \
+ @GMP_TREE@/mpz/import.c \
+ @GMP_TREE@/mpz/init2.c \
+ @GMP_TREE@/mpz/inits.c \
+ @GMP_TREE@/mpz/inp_raw.c \
+ @GMP_TREE@/mpz/inp_str.c \
+ @GMP_TREE@/mpz/ior.c \
+ @GMP_TREE@/mpz/iset_d.c \
+ @GMP_TREE@/mpz/iset_si.c \
+ @GMP_TREE@/mpz/iset_str.c \
+ @GMP_TREE@/mpz/jacobi.c \
+ @GMP_TREE@/mpz/kronsz.c \
+ @GMP_TREE@/mpz/kronuz.c \
+ @GMP_TREE@/mpz/kronzs.c \
+ @GMP_TREE@/mpz/kronzu.c \
+ @GMP_TREE@/mpz/lcm.c \
+ @GMP_TREE@/mpz/lcm_ui.c \
+ @GMP_TREE@/mpz/limbs_finish.c \
+ @GMP_TREE@/mpz/limbs_modify.c \
+ @GMP_TREE@/mpz/limbs_read.c \
+ @GMP_TREE@/mpz/limbs_write.c \
+ @GMP_TREE@/mpz/lucnum2_ui.c \
+ @GMP_TREE@/mpz/lucnum_ui.c \
+ @GMP_TREE@/mpz/mfac_uiui.c \
+ @GMP_TREE@/mpz/millerrabin.c \
+ @GMP_TREE@/mpz/neg.c \
+ @GMP_TREE@/mpz/nextprime.c \
+ @GMP_TREE@/mpz/oddfac_1.c \
+ @GMP_TREE@/mpz/out_raw.c \
+ @GMP_TREE@/mpz/out_str.c \
+ @GMP_TREE@/mpz/perfpow.c \
+ @GMP_TREE@/mpz/perfsqr.c \
+ @GMP_TREE@/mpz/popcount.c \
+ @GMP_TREE@/mpz/pow_ui.c \
+ @GMP_TREE@/mpz/powm_sec.c \
+ @GMP_TREE@/mpz/pprime_p.c \
+ @GMP_TREE@/mpz/primorial_ui.c \
+ @GMP_TREE@/mpz/prodlimbs.c \
+ @GMP_TREE@/mpz/random.c \
+ @GMP_TREE@/mpz/random2.c \
+ @GMP_TREE@/mpz/realloc2.c \
+ @GMP_TREE@/mpz/remove.c \
+ @GMP_TREE@/mpz/roinit_n.c \
+ @GMP_TREE@/mpz/root.c \
+ @GMP_TREE@/mpz/rootrem.c \
+ @GMP_TREE@/mpz/rrandomb.c \
+ @GMP_TREE@/mpz/scan0.c \
+ @GMP_TREE@/mpz/set_d.c \
+ @GMP_TREE@/mpz/set_f.c \
+ @GMP_TREE@/mpz/set_q.c \
+ @GMP_TREE@/mpz/set_si.c \
+ @GMP_TREE@/mpz/set_str.c \
+ @GMP_TREE@/mpz/setbit.c \
+ @GMP_TREE@/mpz/size.c \
+ @GMP_TREE@/mpz/sqrtrem.c \
+ @GMP_TREE@/mpz/tdiv_q_ui.c \
+ @GMP_TREE@/mpz/tdiv_qr_ui.c \
+ @GMP_TREE@/mpz/tdiv_r_ui.c \
+ @GMP_TREE@/mpz/tdiv_ui.c \
+ @GMP_TREE@/mpz/ui_sub.c \
+ @GMP_TREE@/mpz/urandomb.c \
+ @GMP_TREE@/mpz/urandomm.c \
+ @GMP_TREE@/mpz/xor.c
+
+DISTCLEANFILES =
+
+native/stamp-bases:
+ cd native && $(MAKE) $(AM_MAKEFLAGS) stamp-bases
+mp_bases.h: native/stamp-bases
+ $(AM_V_GEN)native/gen-bases header $(GMP_LIMB_BITS) $(GMP_NAIL_BITS) >$@ || (rm -f $@; exit 1)
+mp_bases.c: mp_bases.h
+ $(AM_V_GEN)native/gen-bases table $(GMP_LIMB_BITS) $(GMP_NAIL_BITS) >$@ || (rm -f $@; exit 1)
+DISTCLEANFILES += mp_bases.h mp_bases.c
+
+native/stamp-fac:
+ cd native && $(MAKE) $(AM_MAKEFLAGS) stamp-fac
+fac_table.h: native/stamp-fac
+ $(AM_V_GEN)native/gen-fac $(GMP_LIMB_BITS) $(GMP_NAIL_BITS) >$@ || (rm -f $@; exit 1)
+DISTCLEANFILES += fac_table.h
+
+native/stamp-fib:
+ cd native && $(MAKE) $(AM_MAKEFLAGS) stamp-fib
+fib_table.h: native/stamp-fib
+ $(AM_V_GEN)native/gen-fib header $(GMP_LIMB_BITS) $(GMP_NAIL_BITS) >$@ || (rm -f $@; exit 1)
+fib_table.c: fib_table.h
+ $(AM_V_GEN)native/gen-fib table $(GMP_LIMB_BITS) $(GMP_NAIL_BITS) >$@ || (rm -f $@; exit 1)
+DISTCLEANFILES += fib_table.h fib_table.c
+
+native/stamp-jacobitab:
+ cd native && $(MAKE) $(AM_MAKEFLAGS) stamp-jacobitab
+jacobitab.h: native/stamp-jacobitab
+ $(AM_V_GEN)native/gen-jacobitab >$@ || (rm -f $@; exit 1)
+DISTCLEANFILES += jacobitab.h
+
+native/stamp-psqr:
+ cd native && $(MAKE) $(AM_MAKEFLAGS) stamp-psqr
+perfsqr.h: native/stamp-psqr
+ $(AM_V_GEN)native/gen-psqr $(GMP_LIMB_BITS) $(GMP_NAIL_BITS) >$@ || (rm -f $@; exit 1)
+DISTCLEANFILES += perfsqr.h
+
+native/stamp-trialdivtab:
+ cd native && $(MAKE) $(AM_MAKEFLAGS) stamp-trialdivtab
+trialdivtab.h: native/stamp-trialdivtab
+ $(AM_V_GEN)native/gen-trialdivtab $(GMP_LIMB_BITS) 8000 >$@ || (rm -f $@; exit 1)
+DISTCLEANFILES += trialdivtab.h
+
+if build
+check_PROGRAMS = gmptest
+dist_check_SCRIPTS = gmp.test
+TESTS = gmp.test
+endif build
+
+gmptest_SOURCES = gmptest.c
+
+gmptest_CPPFLAGS = -Iinclude
+
+LDADD = libgmp.a
+
+# Reconfig
+reconfig_prereq =
+
+include $(srcdir)/../../am/reconfig.am
+
+# Rebuild
+rebuild_prereq =
+rebuild_target = all
+CLEANFILES =
+
+include $(srcdir)/../../am/rebuild.am
+
diff --git a/Build/source/libs/gmp/Makefile.in b/Build/source/libs/gmp/Makefile.in
new file mode 100644
index 00000000000..bb4461beaf4
--- /dev/null
+++ b/Build/source/libs/gmp/Makefile.in
@@ -0,0 +1,2474 @@
+# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+VPATH = @srcdir@
+am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__make_running_with_option = \
+ case $${target_option-} in \
+ ?) ;; \
+ *) echo "am__make_running_with_option: internal error: invalid" \
+ "target option '$${target_option-}' specified" >&2; \
+ exit 1;; \
+ esac; \
+ has_opt=no; \
+ sane_makeflags=$$MAKEFLAGS; \
+ if $(am__is_gnu_make); then \
+ sane_makeflags=$$MFLAGS; \
+ else \
+ case $$MAKEFLAGS in \
+ *\\[\ \ ]*) \
+ bs=\\; \
+ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
+ esac; \
+ fi; \
+ skip_next=no; \
+ strip_trailopt () \
+ { \
+ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+ }; \
+ for flg in $$sane_makeflags; do \
+ test $$skip_next = yes && { skip_next=no; continue; }; \
+ case $$flg in \
+ *=*|--*) continue;; \
+ -*I) strip_trailopt 'I'; skip_next=yes;; \
+ -*I?*) strip_trailopt 'I';; \
+ -*O) strip_trailopt 'O'; skip_next=yes;; \
+ -*O?*) strip_trailopt 'O';; \
+ -*l) strip_trailopt 'l'; skip_next=yes;; \
+ -*l?*) strip_trailopt 'l';; \
+ -[dEDm]) skip_next=yes;; \
+ -[JT]) skip_next=yes;; \
+ esac; \
+ case $$flg in \
+ *$$target_option*) has_opt=yes; break;; \
+ esac; \
+ done; \
+ test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+@build_TRUE@check_PROGRAMS = gmptest$(EXEEXT)
+DIST_COMMON = $(srcdir)/../../am/reconfig.am \
+ $(srcdir)/../../am/rebuild.am $(srcdir)/Makefile.in \
+ $(srcdir)/Makefile.am $(top_srcdir)/configure \
+ $(am__configure_deps) $(srcdir)/config.h.in \
+ $(top_srcdir)/gmp-6.0.0/gmp-h.in \
+ $(am__dist_check_SCRIPTS_DIST) \
+ $(top_srcdir)/../../build-aux/depcomp \
+ $(top_srcdir)/../../build-aux/test-driver ChangeLog README \
+ ../../build-aux/compile ../../build-aux/config.guess \
+ ../../build-aux/config.sub ../../build-aux/depcomp \
+ ../../build-aux/install-sh ../../build-aux/missing \
+ ../../build-aux/texinfo.tex ../../build-aux/ylwrap \
+ ../../build-aux/ltmain.sh \
+ $(top_srcdir)/../../build-aux/compile \
+ $(top_srcdir)/../../build-aux/config.guess \
+ $(top_srcdir)/../../build-aux/config.sub \
+ $(top_srcdir)/../../build-aux/install-sh \
+ $(top_srcdir)/../../build-aux/missing
+subdir = .
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/gmp-alloca.m4 \
+ $(top_srcdir)/m4/gmp-attribute.m4 \
+ $(top_srcdir)/m4/gmp-double-format.m4 \
+ $(top_srcdir)/../../m4/kpse-common.m4 \
+ $(top_srcdir)/../../m4/kpse-warnings.m4 \
+ $(top_srcdir)/version.ac $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
+ configure.lineno config.status.lineno
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = config.h
+CONFIG_CLEAN_FILES = gmp.h
+CONFIG_CLEAN_VPATH_FILES =
+LIBRARIES = $(noinst_LIBRARIES)
+AR = ar
+ARFLAGS = cru
+AM_V_AR = $(am__v_AR_@AM_V@)
+am__v_AR_ = $(am__v_AR_@AM_DEFAULT_V@)
+am__v_AR_0 = @echo " AR " $@;
+am__v_AR_1 =
+libgmp_a_AR = $(AR) $(ARFLAGS)
+libgmp_a_LIBADD =
+am__dirstamp = $(am__leading_dot)dirstamp
+am__objects_1 = @GMP_TREE@/assert.$(OBJEXT) \
+ @GMP_TREE@/compat.$(OBJEXT) @GMP_TREE@/errno.$(OBJEXT) \
+ @GMP_TREE@/extract-dbl.$(OBJEXT) @GMP_TREE@/invalid.$(OBJEXT) \
+ @GMP_TREE@/memory.$(OBJEXT) @GMP_TREE@/mp_bpl.$(OBJEXT) \
+ @GMP_TREE@/mp_clz_tab.$(OBJEXT) @GMP_TREE@/mp_dv_tab.$(OBJEXT) \
+ @GMP_TREE@/mp_get_fns.$(OBJEXT) \
+ @GMP_TREE@/mp_minv_tab.$(OBJEXT) \
+ @GMP_TREE@/mp_set_fns.$(OBJEXT) @GMP_TREE@/nextprime.$(OBJEXT) \
+ @GMP_TREE@/primesieve.$(OBJEXT) @GMP_TREE@/tal-reent.$(OBJEXT) \
+ @GMP_TREE@/version.$(OBJEXT)
+am__objects_2 = mp_bases.$(OBJEXT) popcount.$(OBJEXT) \
+ @GMP_TREE@/mpn/generic/add.$(OBJEXT) \
+ @GMP_TREE@/mpn/generic/add_n.$(OBJEXT) \
+ @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/binvert.$(OBJEXT) \
+ @GMP_TREE@/mpn/generic/dcpi1_bdiv_q.$(OBJEXT) \
+ @GMP_TREE@/mpn/generic/dcpi1_bdiv_qr.$(OBJEXT) \
+ @GMP_TREE@/mpn/generic/dcpi1_div_q.$(OBJEXT) \
+ @GMP_TREE@/mpn/generic/dcpi1_div_qr.$(OBJEXT) \
+ @GMP_TREE@/mpn/generic/dcpi1_divappr_q.$(OBJEXT) \
+ @GMP_TREE@/mpn/generic/div_q.$(OBJEXT) \
+ @GMP_TREE@/mpn/generic/div_qr_2n_pi1.$(OBJEXT) \
+ @GMP_TREE@/mpn/generic/dive_1.$(OBJEXT) \
+ @GMP_TREE@/mpn/generic/divexact.$(OBJEXT) \
+ @GMP_TREE@/mpn/generic/divrem.$(OBJEXT) \
+ @GMP_TREE@/mpn/generic/divrem_1.$(OBJEXT) \
+ @GMP_TREE@/mpn/generic/divrem_2.$(OBJEXT) \
+ @GMP_TREE@/mpn/generic/gcd_subdiv_step.$(OBJEXT) \
+ @GMP_TREE@/mpn/generic/gcdext.$(OBJEXT) \
+ @GMP_TREE@/mpn/generic/gcdext_1.$(OBJEXT) \
+ @GMP_TREE@/mpn/generic/gcdext_lehmer.$(OBJEXT) \
+ @GMP_TREE@/mpn/generic/get_str.$(OBJEXT) \
+ @GMP_TREE@/mpn/generic/hgcd.$(OBJEXT) \
+ @GMP_TREE@/mpn/generic/hgcd2.$(OBJEXT) \
+ @GMP_TREE@/mpn/generic/hgcd_appr.$(OBJEXT) \
+ @GMP_TREE@/mpn/generic/hgcd_matrix.$(OBJEXT) \
+ @GMP_TREE@/mpn/generic/hgcd_reduce.$(OBJEXT) \
+ @GMP_TREE@/mpn/generic/hgcd_step.$(OBJEXT) \
+ @GMP_TREE@/mpn/generic/invertappr.$(OBJEXT) \
+ @GMP_TREE@/mpn/generic/lshift.$(OBJEXT) \
+ @GMP_TREE@/mpn/generic/lshiftc.$(OBJEXT) \
+ @GMP_TREE@/mpn/generic/matrix22_mul.$(OBJEXT) \
+ @GMP_TREE@/mpn/generic/matrix22_mul1_inverse_vector.$(OBJEXT) \
+ @GMP_TREE@/mpn/generic/mu_bdiv_q.$(OBJEXT) \
+ @GMP_TREE@/mpn/generic/mu_div_q.$(OBJEXT) \
+ @GMP_TREE@/mpn/generic/mu_div_qr.$(OBJEXT) \
+ @GMP_TREE@/mpn/generic/mu_divappr_q.$(OBJEXT) \
+ @GMP_TREE@/mpn/generic/mul.$(OBJEXT) \
+ @GMP_TREE@/mpn/generic/mul_1.$(OBJEXT) \
+ @GMP_TREE@/mpn/generic/mul_basecase.$(OBJEXT) \
+ @GMP_TREE@/mpn/generic/mul_n.$(OBJEXT) \
+ @GMP_TREE@/mpn/generic/mul_fft.$(OBJEXT) \
+ @GMP_TREE@/mpn/generic/mullo_basecase.$(OBJEXT) \
+ @GMP_TREE@/mpn/generic/mullo_n.$(OBJEXT) \
+ @GMP_TREE@/mpn/generic/mulmod_bnm1.$(OBJEXT) \
+ @GMP_TREE@/mpn/generic/nussbaumer_mul.$(OBJEXT) \
+ @GMP_TREE@/mpn/generic/powlo.$(OBJEXT) \
+ @GMP_TREE@/mpn/generic/powm.$(OBJEXT) \
+ @GMP_TREE@/mpn/generic/pre_divrem_1.$(OBJEXT) \
+ @GMP_TREE@/mpn/generic/redc_1.$(OBJEXT) \
+ @GMP_TREE@/mpn/generic/redc_n.$(OBJEXT) \
+ @GMP_TREE@/mpn/generic/rshift.$(OBJEXT) \
+ @GMP_TREE@/mpn/generic/sbpi1_bdiv_q.$(OBJEXT) \
+ @GMP_TREE@/mpn/generic/sbpi1_bdiv_qr.$(OBJEXT) \
+ @GMP_TREE@/mpn/generic/sbpi1_div_q.$(OBJEXT) \
+ @GMP_TREE@/mpn/generic/sbpi1_div_qr.$(OBJEXT) \
+ @GMP_TREE@/mpn/generic/sbpi1_divappr_q.$(OBJEXT) \
+ @GMP_TREE@/mpn/generic/scan1.$(OBJEXT) \
+ @GMP_TREE@/mpn/generic/set_str.$(OBJEXT) \
+ @GMP_TREE@/mpn/generic/sqr.$(OBJEXT) \
+ @GMP_TREE@/mpn/generic/sqr_basecase.$(OBJEXT) \
+ @GMP_TREE@/mpn/generic/sqrmod_bnm1.$(OBJEXT) \
+ @GMP_TREE@/mpn/generic/sqrtrem.$(OBJEXT) \
+ @GMP_TREE@/mpn/generic/sub.$(OBJEXT) \
+ @GMP_TREE@/mpn/generic/sub_n.$(OBJEXT) \
+ @GMP_TREE@/mpn/generic/submul_1.$(OBJEXT) \
+ @GMP_TREE@/mpn/generic/tdiv_qr.$(OBJEXT) \
+ @GMP_TREE@/mpn/generic/toom2_sqr.$(OBJEXT) \
+ @GMP_TREE@/mpn/generic/toom22_mul.$(OBJEXT) \
+ @GMP_TREE@/mpn/generic/toom3_sqr.$(OBJEXT) \
+ @GMP_TREE@/mpn/generic/toom32_mul.$(OBJEXT) \
+ @GMP_TREE@/mpn/generic/toom33_mul.$(OBJEXT) \
+ @GMP_TREE@/mpn/generic/toom42_mul.$(OBJEXT) \
+ @GMP_TREE@/mpn/generic/toom42_mulmid.$(OBJEXT) \
+ @GMP_TREE@/mpn/generic/toom43_mul.$(OBJEXT) \
+ @GMP_TREE@/mpn/generic/toom44_mul.$(OBJEXT) \
+ @GMP_TREE@/mpn/generic/toom53_mul.$(OBJEXT) \
+ @GMP_TREE@/mpn/generic/toom63_mul.$(OBJEXT) \
+ @GMP_TREE@/mpn/generic/toom6_sqr.$(OBJEXT) \
+ @GMP_TREE@/mpn/generic/toom6h_mul.$(OBJEXT) \
+ @GMP_TREE@/mpn/generic/toom8_sqr.$(OBJEXT) \
+ @GMP_TREE@/mpn/generic/toom8h_mul.$(OBJEXT) \
+ @GMP_TREE@/mpn/generic/toom_couple_handling.$(OBJEXT) \
+ @GMP_TREE@/mpn/generic/toom_eval_dgr3_pm1.$(OBJEXT) \
+ @GMP_TREE@/mpn/generic/toom_eval_dgr3_pm2.$(OBJEXT) \
+ @GMP_TREE@/mpn/generic/toom_eval_pm1.$(OBJEXT) \
+ @GMP_TREE@/mpn/generic/toom_eval_pm2.$(OBJEXT) \
+ @GMP_TREE@/mpn/generic/toom_eval_pm2exp.$(OBJEXT) \
+ @GMP_TREE@/mpn/generic/toom_eval_pm2rexp.$(OBJEXT) \
+ @GMP_TREE@/mpn/generic/toom_interpolate_12pts.$(OBJEXT) \
+ @GMP_TREE@/mpn/generic/toom_interpolate_16pts.$(OBJEXT) \
+ @GMP_TREE@/mpn/generic/toom_interpolate_5pts.$(OBJEXT) \
+ @GMP_TREE@/mpn/generic/toom_interpolate_6pts.$(OBJEXT) \
+ @GMP_TREE@/mpn/generic/toom_interpolate_7pts.$(OBJEXT) \
+ @GMP_TREE@/mpn/generic/toom_interpolate_8pts.$(OBJEXT)
+am__objects_3 = @GMP_TREE@/mpz/add.$(OBJEXT) \
+ @GMP_TREE@/mpz/add_ui.$(OBJEXT) \
+ @GMP_TREE@/mpz/aorsmul.$(OBJEXT) \
+ @GMP_TREE@/mpz/aorsmul_i.$(OBJEXT) \
+ @GMP_TREE@/mpz/cfdiv_q_2exp.$(OBJEXT) \
+ @GMP_TREE@/mpz/clear.$(OBJEXT) @GMP_TREE@/mpz/cmp_ui.$(OBJEXT) \
+ @GMP_TREE@/mpz/cmpabs.$(OBJEXT) \
+ @GMP_TREE@/mpz/divexact.$(OBJEXT) \
+ @GMP_TREE@/mpz/fdiv_q.$(OBJEXT) \
+ @GMP_TREE@/mpz/fdiv_q_ui.$(OBJEXT) \
+ @GMP_TREE@/mpz/fdiv_qr.$(OBJEXT) \
+ @GMP_TREE@/mpz/gcdext.$(OBJEXT) \
+ @GMP_TREE@/mpz/get_si.$(OBJEXT) @GMP_TREE@/mpz/init.$(OBJEXT) \
+ @GMP_TREE@/mpz/invert.$(OBJEXT) @GMP_TREE@/mpz/iset.$(OBJEXT) \
+ @GMP_TREE@/mpz/iset_ui.$(OBJEXT) @GMP_TREE@/mpz/mod.$(OBJEXT) \
+ @GMP_TREE@/mpz/mul.$(OBJEXT) @GMP_TREE@/mpz/mul_2exp.$(OBJEXT) \
+ @GMP_TREE@/mpz/mul_si.$(OBJEXT) \
+ @GMP_TREE@/mpz/mul_ui.$(OBJEXT) \
+ @GMP_TREE@/mpz/n_pow_ui.$(OBJEXT) \
+ @GMP_TREE@/mpz/powm.$(OBJEXT) @GMP_TREE@/mpz/powm_ui.$(OBJEXT) \
+ @GMP_TREE@/mpz/realloc.$(OBJEXT) \
+ @GMP_TREE@/mpz/scan1.$(OBJEXT) @GMP_TREE@/mpz/set.$(OBJEXT) \
+ @GMP_TREE@/mpz/set_ui.$(OBJEXT) \
+ @GMP_TREE@/mpz/sizeinbase.$(OBJEXT) \
+ @GMP_TREE@/mpz/sqrt.$(OBJEXT) @GMP_TREE@/mpz/sub.$(OBJEXT) \
+ @GMP_TREE@/mpz/sub_ui.$(OBJEXT) @GMP_TREE@/mpz/swap.$(OBJEXT) \
+ @GMP_TREE@/mpz/tdiv_q.$(OBJEXT) \
+ @GMP_TREE@/mpz/tdiv_q_2exp.$(OBJEXT) \
+ @GMP_TREE@/mpz/tdiv_qr.$(OBJEXT) \
+ @GMP_TREE@/mpz/tdiv_r.$(OBJEXT) \
+ @GMP_TREE@/mpz/tdiv_r_2exp.$(OBJEXT) \
+ @GMP_TREE@/mpz/tstbit.$(OBJEXT) \
+ @GMP_TREE@/mpz/ui_pow_ui.$(OBJEXT)
+nodist_libgmp_a_OBJECTS = $(am__objects_1) $(am__objects_2) \
+ $(am__objects_3)
+libgmp_a_OBJECTS = $(nodist_libgmp_a_OBJECTS)
+am_gmptest_OBJECTS = gmptest-gmptest.$(OBJEXT)
+gmptest_OBJECTS = $(am_gmptest_OBJECTS)
+gmptest_LDADD = $(LDADD)
+gmptest_DEPENDENCIES = libgmp.a
+am__dist_check_SCRIPTS_DIST = gmp.test
+AM_V_P = $(am__v_P_@AM_V@)
+am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_@AM_V@)
+am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
+am__v_GEN_0 = @echo " GEN " $@;
+am__v_GEN_1 =
+AM_V_at = $(am__v_at_@AM_V@)
+am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
+am__v_at_0 = @
+am__v_at_1 =
+DEFAULT_INCLUDES = -I.@am__isrc@
+depcomp = $(SHELL) $(top_srcdir)/../../build-aux/depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+AM_V_lt = $(am__v_lt_@AM_V@)
+am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
+am__v_lt_0 = --silent
+am__v_lt_1 =
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+AM_V_CC = $(am__v_CC_@AM_V@)
+am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
+am__v_CC_0 = @echo " CC " $@;
+am__v_CC_1 =
+CCLD = $(CC)
+LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_CCLD = $(am__v_CCLD_@AM_V@)
+am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
+am__v_CCLD_0 = @echo " CCLD " $@;
+am__v_CCLD_1 =
+SOURCES = $(nodist_libgmp_a_SOURCES) $(gmptest_SOURCES)
+DIST_SOURCES = $(gmptest_SOURCES)
+RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \
+ ctags-recursive dvi-recursive html-recursive info-recursive \
+ install-data-recursive install-dvi-recursive \
+ install-exec-recursive install-html-recursive \
+ install-info-recursive install-pdf-recursive \
+ install-ps-recursive install-recursive installcheck-recursive \
+ installdirs-recursive pdf-recursive ps-recursive \
+ tags-recursive uninstall-recursive
+am__can_run_installinfo = \
+ case $$AM_UPDATE_INFO_DIR in \
+ n|no|NO) false;; \
+ *) (install-info --version) >/dev/null 2>&1;; \
+ esac
+RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
+ distclean-recursive maintainer-clean-recursive
+am__recursive_targets = \
+ $(RECURSIVE_TARGETS) \
+ $(RECURSIVE_CLEAN_TARGETS) \
+ $(am__extra_recursive_targets)
+AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
+ cscope check recheck distdir dist dist-all distcheck
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \
+ $(LISP)config.h.in
+# Read a list of newline-separated strings from the standard input,
+# and print each of them once, without duplicates. Input order is
+# *not* preserved.
+am__uniquify_input = $(AWK) '\
+ BEGIN { nonempty = 0; } \
+ { items[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in items) print i; }; } \
+'
+# Make sure the list of sources is unique. This is necessary because,
+# e.g., the same source file might be shared among _SOURCES variables
+# for different programs/libraries.
+am__define_uniq_tagged_files = \
+ list='$(am__tagged_files)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | $(am__uniquify_input)`
+ETAGS = etags
+CTAGS = ctags
+CSCOPE = cscope
+am__tty_colors_dummy = \
+ mgn= red= grn= lgn= blu= brg= std=; \
+ am__color_tests=no
+am__tty_colors = { \
+ $(am__tty_colors_dummy); \
+ if test "X$(AM_COLOR_TESTS)" = Xno; then \
+ am__color_tests=no; \
+ elif test "X$(AM_COLOR_TESTS)" = Xalways; then \
+ am__color_tests=yes; \
+ elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \
+ am__color_tests=yes; \
+ fi; \
+ if test $$am__color_tests = yes; then \
+ red=''; \
+ grn=''; \
+ lgn=''; \
+ blu=''; \
+ mgn=''; \
+ brg=''; \
+ std=''; \
+ fi; \
+}
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+ *) f=$$p;; \
+ esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+ for p in $$list; do echo "$$p $$p"; done | \
+ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+ if (++n[$$2] == $(am__install_max)) \
+ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+ END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+ test -z "$$files" \
+ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+ $(am__cd) "$$dir" && rm -f $$files; }; \
+ }
+am__recheck_rx = ^[ ]*:recheck:[ ]*
+am__global_test_result_rx = ^[ ]*:global-test-result:[ ]*
+am__copy_in_global_log_rx = ^[ ]*:copy-in-global-log:[ ]*
+# A command that, given a newline-separated list of test names on the
+# standard input, print the name of the tests that are to be re-run
+# upon "make recheck".
+am__list_recheck_tests = $(AWK) '{ \
+ recheck = 1; \
+ while ((rc = (getline line < ($$0 ".trs"))) != 0) \
+ { \
+ if (rc < 0) \
+ { \
+ if ((getline line2 < ($$0 ".log")) < 0) \
+ recheck = 0; \
+ break; \
+ } \
+ else if (line ~ /$(am__recheck_rx)[nN][Oo]/) \
+ { \
+ recheck = 0; \
+ break; \
+ } \
+ else if (line ~ /$(am__recheck_rx)[yY][eE][sS]/) \
+ { \
+ break; \
+ } \
+ }; \
+ if (recheck) \
+ print $$0; \
+ close ($$0 ".trs"); \
+ close ($$0 ".log"); \
+}'
+# A command that, given a newline-separated list of test names on the
+# standard input, create the global log from their .trs and .log files.
+am__create_global_log = $(AWK) ' \
+function fatal(msg) \
+{ \
+ print "fatal: making $@: " msg | "cat >&2"; \
+ exit 1; \
+} \
+function rst_section(header) \
+{ \
+ print header; \
+ len = length(header); \
+ for (i = 1; i <= len; i = i + 1) \
+ printf "="; \
+ printf "\n\n"; \
+} \
+{ \
+ copy_in_global_log = 1; \
+ global_test_result = "RUN"; \
+ while ((rc = (getline line < ($$0 ".trs"))) != 0) \
+ { \
+ if (rc < 0) \
+ fatal("failed to read from " $$0 ".trs"); \
+ if (line ~ /$(am__global_test_result_rx)/) \
+ { \
+ sub("$(am__global_test_result_rx)", "", line); \
+ sub("[ ]*$$", "", line); \
+ global_test_result = line; \
+ } \
+ else if (line ~ /$(am__copy_in_global_log_rx)[nN][oO]/) \
+ copy_in_global_log = 0; \
+ }; \
+ if (copy_in_global_log) \
+ { \
+ rst_section(global_test_result ": " $$0); \
+ while ((rc = (getline line < ($$0 ".log"))) != 0) \
+ { \
+ if (rc < 0) \
+ fatal("failed to read from " $$0 ".log"); \
+ print line; \
+ }; \
+ printf "\n"; \
+ }; \
+ close ($$0 ".trs"); \
+ close ($$0 ".log"); \
+}'
+# Restructured Text title.
+am__rst_title = { sed 's/.*/ & /;h;s/./=/g;p;x;s/ *$$//;p;g' && echo; }
+# Solaris 10 'make', and several other traditional 'make' implementations,
+# pass "-e" to $(SHELL), and POSIX 2008 even requires this. Work around it
+# by disabling -e (using the XSI extension "set +e") if it's set.
+am__sh_e_setup = case $$- in *e*) set +e;; esac
+# Default flags passed to test drivers.
+am__common_driver_flags = \
+ --color-tests "$$am__color_tests" \
+ --enable-hard-errors "$$am__enable_hard_errors" \
+ --expect-failure "$$am__expect_failure"
+# To be inserted before the command running the test. Creates the
+# directory for the log if needed. Stores in $dir the directory
+# containing $f, in $tst the test, in $log the log. Executes the
+# developer- defined test setup AM_TESTS_ENVIRONMENT (if any), and
+# passes TESTS_ENVIRONMENT. Set up options for the wrapper that
+# will run the test scripts (or their associated LOG_COMPILER, if
+# thy have one).
+am__check_pre = \
+$(am__sh_e_setup); \
+$(am__vpath_adj_setup) $(am__vpath_adj) \
+$(am__tty_colors); \
+srcdir=$(srcdir); export srcdir; \
+case "$@" in \
+ */*) am__odir=`echo "./$@" | sed 's|/[^/]*$$||'`;; \
+ *) am__odir=.;; \
+esac; \
+test "x$$am__odir" = x"." || test -d "$$am__odir" \
+ || $(MKDIR_P) "$$am__odir" || exit $$?; \
+if test -f "./$$f"; then dir=./; \
+elif test -f "$$f"; then dir=; \
+else dir="$(srcdir)/"; fi; \
+tst=$$dir$$f; log='$@'; \
+if test -n '$(DISABLE_HARD_ERRORS)'; then \
+ am__enable_hard_errors=no; \
+else \
+ am__enable_hard_errors=yes; \
+fi; \
+case " $(XFAIL_TESTS) " in \
+ *[\ \ ]$$f[\ \ ]* | *[\ \ ]$$dir$$f[\ \ ]*) \
+ am__expect_failure=yes;; \
+ *) \
+ am__expect_failure=no;; \
+esac; \
+$(AM_TESTS_ENVIRONMENT) $(TESTS_ENVIRONMENT)
+# A shell command to get the names of the tests scripts with any registered
+# extension removed (i.e., equivalently, the names of the test logs, with
+# the '.log' extension removed). The result is saved in the shell variable
+# '$bases'. This honors runtime overriding of TESTS and TEST_LOGS. Sadly,
+# we cannot use something simpler, involving e.g., "$(TEST_LOGS:.log=)",
+# since that might cause problem with VPATH rewrites for suffix-less tests.
+# See also 'test-harness-vpath-rewrite.sh' and 'test-trs-basic.sh'.
+am__set_TESTS_bases = \
+ bases='$(TEST_LOGS)'; \
+ bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \
+ bases=`echo $$bases`
+RECHECK_LOGS = $(TEST_LOGS)
+TEST_SUITE_LOG = test-suite.log
+TEST_EXTENSIONS = @EXEEXT@ .test
+am__test_logs1 = $(TESTS:=.log)
+am__test_logs2 = $(am__test_logs1:@EXEEXT@.log=.log)
+TEST_LOGS = $(am__test_logs2:.test.log=.log)
+TEST_LOG_DRIVER = $(SHELL) $(top_srcdir)/../../build-aux/test-driver
+TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \
+ $(TEST_LOG_FLAGS)
+am__set_b = \
+ case '$@' in \
+ */*) \
+ case '$*' in \
+ */*) b='$*';; \
+ *) b=`echo '$@' | sed 's/\.log$$//'`; \
+ esac;; \
+ *) \
+ b='$*';; \
+ esac
+DIST_SUBDIRS = $(SUBDIRS)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+distdir = $(PACKAGE)-$(VERSION)
+top_distdir = $(distdir)
+am__remove_distdir = \
+ if test -d "$(distdir)"; then \
+ find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \
+ && rm -rf "$(distdir)" \
+ || { sleep 5 && rm -rf "$(distdir)"; }; \
+ else :; fi
+am__post_remove_distdir = $(am__remove_distdir)
+am__relativize = \
+ dir0=`pwd`; \
+ sed_first='s,^\([^/]*\)/.*$$,\1,'; \
+ sed_rest='s,^[^/]*/*,,'; \
+ sed_last='s,^.*/\([^/]*\)$$,\1,'; \
+ sed_butlast='s,/*[^/]*$$,,'; \
+ while test -n "$$dir1"; do \
+ first=`echo "$$dir1" | sed -e "$$sed_first"`; \
+ if test "$$first" != "."; then \
+ if test "$$first" = ".."; then \
+ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
+ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
+ else \
+ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
+ if test "$$first2" = "$$first"; then \
+ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
+ else \
+ dir2="../$$dir2"; \
+ fi; \
+ dir0="$$dir0"/"$$first"; \
+ fi; \
+ fi; \
+ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
+ done; \
+ reldir="$$dir2"
+DIST_ARCHIVES = $(distdir).tar.gz
+GZIP_ENV = --best
+DIST_TARGETS = dist-gzip
+distuninstallcheck_listfiles = find . -type f -print
+am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \
+ | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$'
+distcleancheck_listfiles = find . -type f -print
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFN_LONG_LONG_LIMB = @DEFN_LONG_LONG_LIMB@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+GMP_LIMB_BITS = @GMP_LIMB_BITS@
+GMP_NAIL_BITS = @GMP_NAIL_BITS@
+GMP_TREE = @GMP_TREE@
+GREP = @GREP@
+HAVE_HOST_CPU_FAMILY_power = @HAVE_HOST_CPU_FAMILY_power@
+HAVE_HOST_CPU_FAMILY_powerpc = @HAVE_HOST_CPU_FAMILY_powerpc@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LIBGMP_DLL = @LIBGMP_DLL@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MKDIR_P = @MKDIR_P@
+OBJEXT = @OBJEXT@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+RANLIB = @RANLIB@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+VERSION = @VERSION@
+WARNING_CFLAGS = @WARNING_CFLAGS@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_CC = @ac_ct_CC@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+subdirs = @subdirs@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+EXTRA_DIST = $(GMP_TREE) $(GMP_TREE)-PATCHES
+SUBDIRS = native . include
+AM_CPPFLAGS = -I$(srcdir)/$(GMP_TREE) -I$(srcdir)/$(GMP_TREE)/mpn/generic -DNO_ASM
+AM_CFLAGS = # $(WARNING_CFLAGS)
+noinst_LIBRARIES = libgmp.a
+nodist_libgmp_a_SOURCES = \
+ $(basic_sources) \
+ $(mpn_sources) \
+ $(mpz_sources)
+
+basic_sources = \
+ @GMP_TREE@/assert.c \
+ @GMP_TREE@/compat.c \
+ @GMP_TREE@/errno.c \
+ @GMP_TREE@/extract-dbl.c \
+ @GMP_TREE@/invalid.c \
+ @GMP_TREE@/memory.c \
+ @GMP_TREE@/mp_bpl.c \
+ @GMP_TREE@/mp_clz_tab.c \
+ @GMP_TREE@/mp_dv_tab.c \
+ @GMP_TREE@/mp_get_fns.c \
+ @GMP_TREE@/mp_minv_tab.c \
+ @GMP_TREE@/mp_set_fns.c \
+ @GMP_TREE@/nextprime.c \
+ @GMP_TREE@/primesieve.c \
+ @GMP_TREE@/tal-reent.c \
+ @GMP_TREE@/version.c
+
+basic_unused = \
+ @GMP_TREE@/tal-debug.c \
+ @GMP_TREE@/tal-notreent.c
+
+logops_n_sources = and_n.c andn_n.c ior_n.c iorn_n.c nand_n.c nior_n.c xnor_n.c xor_n.c
+popham_sources = hamdist.c popcount.c
+sec_aors_1_sources = sec_add_1.c sec_sub_1.c
+sec_div_sources = sec_div_qr.c sec_div_r.c
+sec_pi1_div_sources = sec_pi1_div_qr.c sec_pi1_div_r.c
+mpn_sources = \
+ mp_bases.c \
+ popcount.c \
+ @GMP_TREE@/mpn/generic/add.c \
+ @GMP_TREE@/mpn/generic/add_n.c \
+ @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/binvert.c \
+ @GMP_TREE@/mpn/generic/dcpi1_bdiv_q.c \
+ @GMP_TREE@/mpn/generic/dcpi1_bdiv_qr.c \
+ @GMP_TREE@/mpn/generic/dcpi1_div_q.c \
+ @GMP_TREE@/mpn/generic/dcpi1_div_qr.c \
+ @GMP_TREE@/mpn/generic/dcpi1_divappr_q.c \
+ @GMP_TREE@/mpn/generic/div_q.c \
+ @GMP_TREE@/mpn/generic/div_qr_2n_pi1.c \
+ @GMP_TREE@/mpn/generic/dive_1.c \
+ @GMP_TREE@/mpn/generic/divexact.c \
+ @GMP_TREE@/mpn/generic/divrem.c \
+ @GMP_TREE@/mpn/generic/divrem_1.c \
+ @GMP_TREE@/mpn/generic/divrem_2.c \
+ @GMP_TREE@/mpn/generic/gcd_subdiv_step.c \
+ @GMP_TREE@/mpn/generic/gcdext.c \
+ @GMP_TREE@/mpn/generic/gcdext_1.c \
+ @GMP_TREE@/mpn/generic/gcdext_lehmer.c \
+ @GMP_TREE@/mpn/generic/get_str.c \
+ @GMP_TREE@/mpn/generic/hgcd.c \
+ @GMP_TREE@/mpn/generic/hgcd2.c \
+ @GMP_TREE@/mpn/generic/hgcd_appr.c \
+ @GMP_TREE@/mpn/generic/hgcd_matrix.c \
+ @GMP_TREE@/mpn/generic/hgcd_reduce.c \
+ @GMP_TREE@/mpn/generic/hgcd_step.c \
+ @GMP_TREE@/mpn/generic/invertappr.c \
+ @GMP_TREE@/mpn/generic/lshift.c \
+ @GMP_TREE@/mpn/generic/lshiftc.c \
+ @GMP_TREE@/mpn/generic/matrix22_mul.c \
+ @GMP_TREE@/mpn/generic/matrix22_mul1_inverse_vector.c \
+ @GMP_TREE@/mpn/generic/mu_bdiv_q.c \
+ @GMP_TREE@/mpn/generic/mu_div_q.c \
+ @GMP_TREE@/mpn/generic/mu_div_qr.c \
+ @GMP_TREE@/mpn/generic/mu_divappr_q.c \
+ @GMP_TREE@/mpn/generic/mul.c \
+ @GMP_TREE@/mpn/generic/mul_1.c \
+ @GMP_TREE@/mpn/generic/mul_basecase.c \
+ @GMP_TREE@/mpn/generic/mul_n.c \
+ @GMP_TREE@/mpn/generic/mul_fft.c \
+ @GMP_TREE@/mpn/generic/mullo_basecase.c \
+ @GMP_TREE@/mpn/generic/mullo_n.c \
+ @GMP_TREE@/mpn/generic/mulmod_bnm1.c \
+ @GMP_TREE@/mpn/generic/nussbaumer_mul.c \
+ @GMP_TREE@/mpn/generic/powlo.c \
+ @GMP_TREE@/mpn/generic/powm.c \
+ @GMP_TREE@/mpn/generic/pre_divrem_1.c \
+ @GMP_TREE@/mpn/generic/redc_1.c \
+ @GMP_TREE@/mpn/generic/redc_n.c \
+ @GMP_TREE@/mpn/generic/rshift.c \
+ @GMP_TREE@/mpn/generic/sbpi1_bdiv_q.c \
+ @GMP_TREE@/mpn/generic/sbpi1_bdiv_qr.c \
+ @GMP_TREE@/mpn/generic/sbpi1_div_q.c \
+ @GMP_TREE@/mpn/generic/sbpi1_div_qr.c \
+ @GMP_TREE@/mpn/generic/sbpi1_divappr_q.c \
+ @GMP_TREE@/mpn/generic/scan1.c \
+ @GMP_TREE@/mpn/generic/set_str.c \
+ @GMP_TREE@/mpn/generic/sqr.c \
+ @GMP_TREE@/mpn/generic/sqr_basecase.c \
+ @GMP_TREE@/mpn/generic/sqrmod_bnm1.c \
+ @GMP_TREE@/mpn/generic/sqrtrem.c \
+ @GMP_TREE@/mpn/generic/sub.c \
+ @GMP_TREE@/mpn/generic/sub_n.c \
+ @GMP_TREE@/mpn/generic/submul_1.c \
+ @GMP_TREE@/mpn/generic/tdiv_qr.c \
+ @GMP_TREE@/mpn/generic/toom2_sqr.c \
+ @GMP_TREE@/mpn/generic/toom22_mul.c \
+ @GMP_TREE@/mpn/generic/toom3_sqr.c \
+ @GMP_TREE@/mpn/generic/toom32_mul.c \
+ @GMP_TREE@/mpn/generic/toom33_mul.c \
+ @GMP_TREE@/mpn/generic/toom42_mul.c \
+ @GMP_TREE@/mpn/generic/toom42_mulmid.c \
+ @GMP_TREE@/mpn/generic/toom43_mul.c \
+ @GMP_TREE@/mpn/generic/toom44_mul.c \
+ @GMP_TREE@/mpn/generic/toom53_mul.c \
+ @GMP_TREE@/mpn/generic/toom63_mul.c \
+ @GMP_TREE@/mpn/generic/toom6_sqr.c \
+ @GMP_TREE@/mpn/generic/toom6h_mul.c \
+ @GMP_TREE@/mpn/generic/toom8_sqr.c \
+ @GMP_TREE@/mpn/generic/toom8h_mul.c \
+ @GMP_TREE@/mpn/generic/toom_couple_handling.c \
+ @GMP_TREE@/mpn/generic/toom_eval_dgr3_pm1.c \
+ @GMP_TREE@/mpn/generic/toom_eval_dgr3_pm2.c \
+ @GMP_TREE@/mpn/generic/toom_eval_pm1.c \
+ @GMP_TREE@/mpn/generic/toom_eval_pm2.c \
+ @GMP_TREE@/mpn/generic/toom_eval_pm2exp.c \
+ @GMP_TREE@/mpn/generic/toom_eval_pm2rexp.c \
+ @GMP_TREE@/mpn/generic/toom_interpolate_12pts.c \
+ @GMP_TREE@/mpn/generic/toom_interpolate_16pts.c \
+ @GMP_TREE@/mpn/generic/toom_interpolate_5pts.c \
+ @GMP_TREE@/mpn/generic/toom_interpolate_6pts.c \
+ @GMP_TREE@/mpn/generic/toom_interpolate_7pts.c \
+ @GMP_TREE@/mpn/generic/toom_interpolate_8pts.c
+
+mpn_unused = \
+ $(logops_n_sources) \
+ $(sec_aors_1_sources) \
+ $(sec_div_sources) \
+ $(sec_pi1_div_sources) \
+ fib_table.c \
+ hamdist.c \
+ @GMP_TREE@/mpn/generic/add_1.c \
+ @GMP_TREE@/mpn/generic/add_err1_n.c \
+ @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 \
+ @GMP_TREE@/mpn/generic/bsqrt.c \
+ @GMP_TREE@/mpn/generic/bsqrtinv.c \
+ @GMP_TREE@/mpn/generic/cmp.c \
+ @GMP_TREE@/mpn/generic/cnd_add_n.c \
+ @GMP_TREE@/mpn/generic/cnd_sub_n.c \
+ @GMP_TREE@/mpn/generic/com.c \
+ @GMP_TREE@/mpn/generic/comb_tables.c \
+ @GMP_TREE@/mpn/generic/copyd.c \
+ @GMP_TREE@/mpn/generic/copyi.c \
+ @GMP_TREE@/mpn/generic/div_qr_1.c \
+ @GMP_TREE@/mpn/generic/div_qr_1n_pi1.c \
+ @GMP_TREE@/mpn/generic/div_qr_2.c \
+ @GMP_TREE@/mpn/generic/div_qr_2u_pi1.c \
+ @GMP_TREE@/mpn/generic/diveby3.c \
+ @GMP_TREE@/mpn/generic/divis.c \
+ @GMP_TREE@/mpn/generic/dump.c \
+ @GMP_TREE@/mpn/generic/fib2_ui.c \
+ @GMP_TREE@/mpn/generic/gcd.c \
+ @GMP_TREE@/mpn/generic/gcd_1.c \
+ @GMP_TREE@/mpn/generic/get_d.c \
+ @GMP_TREE@/mpn/generic/hgcd2_jacobi.c \
+ @GMP_TREE@/mpn/generic/hgcd_jacobi.c \
+ @GMP_TREE@/mpn/generic/invert.c \
+ @GMP_TREE@/mpn/generic/jacbase.c \
+ @GMP_TREE@/mpn/generic/jacobi.c \
+ @GMP_TREE@/mpn/generic/jacobi_2.c \
+ @GMP_TREE@/mpn/generic/mod_1.c \
+ @GMP_TREE@/mpn/generic/mod_1_1.c \
+ @GMP_TREE@/mpn/generic/mod_1_2.c \
+ @GMP_TREE@/mpn/generic/mod_1_3.c \
+ @GMP_TREE@/mpn/generic/mod_1_4.c \
+ @GMP_TREE@/mpn/generic/mod_34lsub1.c \
+ @GMP_TREE@/mpn/generic/mode1o.c \
+ @GMP_TREE@/mpn/generic/mu_bdiv_qr.c \
+ @GMP_TREE@/mpn/generic/mulmid.c \
+ @GMP_TREE@/mpn/generic/mulmid_basecase.c \
+ @GMP_TREE@/mpn/generic/mulmid_n.c \
+ @GMP_TREE@/mpn/generic/neg.c \
+ @GMP_TREE@/mpn/generic/perfpow.c \
+ @GMP_TREE@/mpn/generic/perfsqr.c \
+ @GMP_TREE@/mpn/generic/pow_1.c \
+ @GMP_TREE@/mpn/generic/pre_mod_1.c \
+ @GMP_TREE@/mpn/generic/random.c \
+ @GMP_TREE@/mpn/generic/random2.c \
+ @GMP_TREE@/mpn/generic/redc_2.c \
+ @GMP_TREE@/mpn/generic/remove.c \
+ @GMP_TREE@/mpn/generic/rootrem.c \
+ @GMP_TREE@/mpn/generic/scan0.c \
+ @GMP_TREE@/mpn/generic/sec_invert.c \
+ @GMP_TREE@/mpn/generic/sec_mul.c \
+ @GMP_TREE@/mpn/generic/sec_powm.c \
+ @GMP_TREE@/mpn/generic/sec_sqr.c \
+ @GMP_TREE@/mpn/generic/sec_tabselect.c \
+ @GMP_TREE@/mpn/generic/sizeinbase.c \
+ @GMP_TREE@/mpn/generic/sub_1.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 \
+ @GMP_TREE@/mpn/generic/toom4_sqr.c \
+ @GMP_TREE@/mpn/generic/toom52_mul.c \
+ @GMP_TREE@/mpn/generic/toom54_mul.c \
+ @GMP_TREE@/mpn/generic/toom62_mul.c \
+ @GMP_TREE@/mpn/generic/trialdiv.c \
+ @GMP_TREE@/mpn/generic/zero.c
+
+mpz_sources = \
+ @GMP_TREE@/mpz/add.c \
+ @GMP_TREE@/mpz/add_ui.c \
+ @GMP_TREE@/mpz/aorsmul.c \
+ @GMP_TREE@/mpz/aorsmul_i.c \
+ @GMP_TREE@/mpz/cfdiv_q_2exp.c \
+ @GMP_TREE@/mpz/clear.c \
+ @GMP_TREE@/mpz/cmp_ui.c \
+ @GMP_TREE@/mpz/cmpabs.c \
+ @GMP_TREE@/mpz/divexact.c \
+ @GMP_TREE@/mpz/fdiv_q.c \
+ @GMP_TREE@/mpz/fdiv_q_ui.c \
+ @GMP_TREE@/mpz/fdiv_qr.c \
+ @GMP_TREE@/mpz/gcdext.c \
+ @GMP_TREE@/mpz/get_si.c \
+ @GMP_TREE@/mpz/init.c \
+ @GMP_TREE@/mpz/invert.c \
+ @GMP_TREE@/mpz/iset.c \
+ @GMP_TREE@/mpz/iset_ui.c \
+ @GMP_TREE@/mpz/mod.c \
+ @GMP_TREE@/mpz/mul.c \
+ @GMP_TREE@/mpz/mul_2exp.c \
+ @GMP_TREE@/mpz/mul_si.c \
+ @GMP_TREE@/mpz/mul_ui.c \
+ @GMP_TREE@/mpz/n_pow_ui.c \
+ @GMP_TREE@/mpz/powm.c \
+ @GMP_TREE@/mpz/powm_ui.c \
+ @GMP_TREE@/mpz/realloc.c \
+ @GMP_TREE@/mpz/scan1.c \
+ @GMP_TREE@/mpz/set.c \
+ @GMP_TREE@/mpz/set_ui.c \
+ @GMP_TREE@/mpz/sizeinbase.c \
+ @GMP_TREE@/mpz/sqrt.c \
+ @GMP_TREE@/mpz/sub.c \
+ @GMP_TREE@/mpz/sub_ui.c \
+ @GMP_TREE@/mpz/swap.c \
+ @GMP_TREE@/mpz/tdiv_q.c \
+ @GMP_TREE@/mpz/tdiv_q_2exp.c \
+ @GMP_TREE@/mpz/tdiv_qr.c \
+ @GMP_TREE@/mpz/tdiv_r.c \
+ @GMP_TREE@/mpz/tdiv_r_2exp.c \
+ @GMP_TREE@/mpz/tstbit.c \
+ @GMP_TREE@/mpz/ui_pow_ui.c
+
+mpz_unused = \
+ @GMP_TREE@/mpz/2fac_ui.c \
+ @GMP_TREE@/mpz/abs.c \
+ @GMP_TREE@/mpz/and.c \
+ @GMP_TREE@/mpz/array_init.c \
+ @GMP_TREE@/mpz/bin_ui.c \
+ @GMP_TREE@/mpz/bin_uiui.c \
+ @GMP_TREE@/mpz/cdiv_q.c \
+ @GMP_TREE@/mpz/cdiv_q_ui.c \
+ @GMP_TREE@/mpz/cdiv_qr.c \
+ @GMP_TREE@/mpz/cdiv_qr_ui.c \
+ @GMP_TREE@/mpz/cdiv_r.c \
+ @GMP_TREE@/mpz/cdiv_r_ui.c \
+ @GMP_TREE@/mpz/cdiv_ui.c \
+ @GMP_TREE@/mpz/cfdiv_r_2exp.c \
+ @GMP_TREE@/mpz/clears.c \
+ @GMP_TREE@/mpz/clrbit.c \
+ @GMP_TREE@/mpz/cmp.c \
+ @GMP_TREE@/mpz/cmp_d.c \
+ @GMP_TREE@/mpz/cmp_si.c \
+ @GMP_TREE@/mpz/cmpabs_d.c \
+ @GMP_TREE@/mpz/cmpabs_ui.c \
+ @GMP_TREE@/mpz/com.c \
+ @GMP_TREE@/mpz/combit.c \
+ @GMP_TREE@/mpz/cong.c \
+ @GMP_TREE@/mpz/cong_2exp.c \
+ @GMP_TREE@/mpz/cong_ui.c \
+ @GMP_TREE@/mpz/dive_ui.c \
+ @GMP_TREE@/mpz/divegcd.c \
+ @GMP_TREE@/mpz/divis.c \
+ @GMP_TREE@/mpz/divis_2exp.c \
+ @GMP_TREE@/mpz/divis_ui.c \
+ @GMP_TREE@/mpz/dump.c \
+ @GMP_TREE@/mpz/export.c \
+ @GMP_TREE@/mpz/fac_ui.c \
+ @GMP_TREE@/mpz/fdiv_qr_ui.c \
+ @GMP_TREE@/mpz/fdiv_r.c \
+ @GMP_TREE@/mpz/fdiv_r_ui.c \
+ @GMP_TREE@/mpz/fdiv_ui.c \
+ @GMP_TREE@/mpz/fib2_ui.c \
+ @GMP_TREE@/mpz/fib_ui.c \
+ @GMP_TREE@/mpz/fits_sint.c \
+ @GMP_TREE@/mpz/fits_slong.c \
+ @GMP_TREE@/mpz/fits_sshort.c \
+ @GMP_TREE@/mpz/fits_uint.c \
+ @GMP_TREE@/mpz/fits_ulong.c \
+ @GMP_TREE@/mpz/fits_ushort.c \
+ @GMP_TREE@/mpz/gcd.c \
+ @GMP_TREE@/mpz/gcd_ui.c \
+ @GMP_TREE@/mpz/get_d.c \
+ @GMP_TREE@/mpz/get_d_2exp.c \
+ @GMP_TREE@/mpz/get_str.c \
+ @GMP_TREE@/mpz/get_ui.c \
+ @GMP_TREE@/mpz/getlimbn.c \
+ @GMP_TREE@/mpz/hamdist.c \
+ @GMP_TREE@/mpz/import.c \
+ @GMP_TREE@/mpz/init2.c \
+ @GMP_TREE@/mpz/inits.c \
+ @GMP_TREE@/mpz/inp_raw.c \
+ @GMP_TREE@/mpz/inp_str.c \
+ @GMP_TREE@/mpz/ior.c \
+ @GMP_TREE@/mpz/iset_d.c \
+ @GMP_TREE@/mpz/iset_si.c \
+ @GMP_TREE@/mpz/iset_str.c \
+ @GMP_TREE@/mpz/jacobi.c \
+ @GMP_TREE@/mpz/kronsz.c \
+ @GMP_TREE@/mpz/kronuz.c \
+ @GMP_TREE@/mpz/kronzs.c \
+ @GMP_TREE@/mpz/kronzu.c \
+ @GMP_TREE@/mpz/lcm.c \
+ @GMP_TREE@/mpz/lcm_ui.c \
+ @GMP_TREE@/mpz/limbs_finish.c \
+ @GMP_TREE@/mpz/limbs_modify.c \
+ @GMP_TREE@/mpz/limbs_read.c \
+ @GMP_TREE@/mpz/limbs_write.c \
+ @GMP_TREE@/mpz/lucnum2_ui.c \
+ @GMP_TREE@/mpz/lucnum_ui.c \
+ @GMP_TREE@/mpz/mfac_uiui.c \
+ @GMP_TREE@/mpz/millerrabin.c \
+ @GMP_TREE@/mpz/neg.c \
+ @GMP_TREE@/mpz/nextprime.c \
+ @GMP_TREE@/mpz/oddfac_1.c \
+ @GMP_TREE@/mpz/out_raw.c \
+ @GMP_TREE@/mpz/out_str.c \
+ @GMP_TREE@/mpz/perfpow.c \
+ @GMP_TREE@/mpz/perfsqr.c \
+ @GMP_TREE@/mpz/popcount.c \
+ @GMP_TREE@/mpz/pow_ui.c \
+ @GMP_TREE@/mpz/powm_sec.c \
+ @GMP_TREE@/mpz/pprime_p.c \
+ @GMP_TREE@/mpz/primorial_ui.c \
+ @GMP_TREE@/mpz/prodlimbs.c \
+ @GMP_TREE@/mpz/random.c \
+ @GMP_TREE@/mpz/random2.c \
+ @GMP_TREE@/mpz/realloc2.c \
+ @GMP_TREE@/mpz/remove.c \
+ @GMP_TREE@/mpz/roinit_n.c \
+ @GMP_TREE@/mpz/root.c \
+ @GMP_TREE@/mpz/rootrem.c \
+ @GMP_TREE@/mpz/rrandomb.c \
+ @GMP_TREE@/mpz/scan0.c \
+ @GMP_TREE@/mpz/set_d.c \
+ @GMP_TREE@/mpz/set_f.c \
+ @GMP_TREE@/mpz/set_q.c \
+ @GMP_TREE@/mpz/set_si.c \
+ @GMP_TREE@/mpz/set_str.c \
+ @GMP_TREE@/mpz/setbit.c \
+ @GMP_TREE@/mpz/size.c \
+ @GMP_TREE@/mpz/sqrtrem.c \
+ @GMP_TREE@/mpz/tdiv_q_ui.c \
+ @GMP_TREE@/mpz/tdiv_qr_ui.c \
+ @GMP_TREE@/mpz/tdiv_r_ui.c \
+ @GMP_TREE@/mpz/tdiv_ui.c \
+ @GMP_TREE@/mpz/ui_sub.c \
+ @GMP_TREE@/mpz/urandomb.c \
+ @GMP_TREE@/mpz/urandomm.c \
+ @GMP_TREE@/mpz/xor.c
+
+DISTCLEANFILES = mp_bases.h mp_bases.c fac_table.h fib_table.h \
+ fib_table.c jacobitab.h perfsqr.h trialdivtab.h config.force
+@build_TRUE@dist_check_SCRIPTS = gmp.test
+@build_TRUE@TESTS = gmp.test
+gmptest_SOURCES = gmptest.c
+gmptest_CPPFLAGS = -Iinclude
+LDADD = libgmp.a
+
+# Reconfig
+reconfig_prereq =
+
+# Rebuild
+rebuild_prereq =
+rebuild_target = all
+CLEANFILES = rebuild.stamp
+all: config.h
+ $(MAKE) $(AM_MAKEFLAGS) all-recursive
+
+.SUFFIXES:
+.SUFFIXES: .c .log .o .obj .test .test$(EXEEXT) .trs
+am--refresh: Makefile
+ @:
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(srcdir)/../../am/reconfig.am $(srcdir)/../../am/rebuild.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \
+ $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \
+ && exit 0; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --foreign Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ echo ' $(SHELL) ./config.status'; \
+ $(SHELL) ./config.status;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
+ esac;
+$(srcdir)/../../am/reconfig.am $(srcdir)/../../am/rebuild.am:
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ $(SHELL) ./config.status --recheck
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+ $(am__cd) $(srcdir) && $(AUTOCONF)
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+ $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
+$(am__aclocal_m4_deps):
+
+config.h: stamp-h1
+ @test -f $@ || rm -f stamp-h1
+ @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1
+
+stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status
+ @rm -f stamp-h1
+ cd $(top_builddir) && $(SHELL) ./config.status config.h
+$(srcdir)/config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+ ($(am__cd) $(top_srcdir) && $(AUTOHEADER))
+ rm -f stamp-h1
+ touch $@
+
+distclean-hdr:
+ -rm -f config.h stamp-h1
+gmp.h: $(top_builddir)/config.status $(top_srcdir)/gmp-6.0.0/gmp-h.in
+ cd $(top_builddir) && $(SHELL) ./config.status $@
+
+clean-noinstLIBRARIES:
+ -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES)
+@GMP_TREE@/$(am__dirstamp):
+ @$(MKDIR_P) @GMP_TREE@
+ @: > @GMP_TREE@/$(am__dirstamp)
+@GMP_TREE@/$(DEPDIR)/$(am__dirstamp):
+ @$(MKDIR_P) @GMP_TREE@/$(DEPDIR)
+ @: > @GMP_TREE@/$(DEPDIR)/$(am__dirstamp)
+@GMP_TREE@/assert.$(OBJEXT): @GMP_TREE@/$(am__dirstamp) \
+ @GMP_TREE@/$(DEPDIR)/$(am__dirstamp)
+@GMP_TREE@/compat.$(OBJEXT): @GMP_TREE@/$(am__dirstamp) \
+ @GMP_TREE@/$(DEPDIR)/$(am__dirstamp)
+@GMP_TREE@/errno.$(OBJEXT): @GMP_TREE@/$(am__dirstamp) \
+ @GMP_TREE@/$(DEPDIR)/$(am__dirstamp)
+@GMP_TREE@/extract-dbl.$(OBJEXT): @GMP_TREE@/$(am__dirstamp) \
+ @GMP_TREE@/$(DEPDIR)/$(am__dirstamp)
+@GMP_TREE@/invalid.$(OBJEXT): @GMP_TREE@/$(am__dirstamp) \
+ @GMP_TREE@/$(DEPDIR)/$(am__dirstamp)
+@GMP_TREE@/memory.$(OBJEXT): @GMP_TREE@/$(am__dirstamp) \
+ @GMP_TREE@/$(DEPDIR)/$(am__dirstamp)
+@GMP_TREE@/mp_bpl.$(OBJEXT): @GMP_TREE@/$(am__dirstamp) \
+ @GMP_TREE@/$(DEPDIR)/$(am__dirstamp)
+@GMP_TREE@/mp_clz_tab.$(OBJEXT): @GMP_TREE@/$(am__dirstamp) \
+ @GMP_TREE@/$(DEPDIR)/$(am__dirstamp)
+@GMP_TREE@/mp_dv_tab.$(OBJEXT): @GMP_TREE@/$(am__dirstamp) \
+ @GMP_TREE@/$(DEPDIR)/$(am__dirstamp)
+@GMP_TREE@/mp_get_fns.$(OBJEXT): @GMP_TREE@/$(am__dirstamp) \
+ @GMP_TREE@/$(DEPDIR)/$(am__dirstamp)
+@GMP_TREE@/mp_minv_tab.$(OBJEXT): @GMP_TREE@/$(am__dirstamp) \
+ @GMP_TREE@/$(DEPDIR)/$(am__dirstamp)
+@GMP_TREE@/mp_set_fns.$(OBJEXT): @GMP_TREE@/$(am__dirstamp) \
+ @GMP_TREE@/$(DEPDIR)/$(am__dirstamp)
+@GMP_TREE@/nextprime.$(OBJEXT): @GMP_TREE@/$(am__dirstamp) \
+ @GMP_TREE@/$(DEPDIR)/$(am__dirstamp)
+@GMP_TREE@/primesieve.$(OBJEXT): @GMP_TREE@/$(am__dirstamp) \
+ @GMP_TREE@/$(DEPDIR)/$(am__dirstamp)
+@GMP_TREE@/tal-reent.$(OBJEXT): @GMP_TREE@/$(am__dirstamp) \
+ @GMP_TREE@/$(DEPDIR)/$(am__dirstamp)
+@GMP_TREE@/version.$(OBJEXT): @GMP_TREE@/$(am__dirstamp) \
+ @GMP_TREE@/$(DEPDIR)/$(am__dirstamp)
+@GMP_TREE@/mpn/generic/$(am__dirstamp):
+ @$(MKDIR_P) @GMP_TREE@/mpn/generic
+ @: > @GMP_TREE@/mpn/generic/$(am__dirstamp)
+@GMP_TREE@/mpn/generic/$(DEPDIR)/$(am__dirstamp):
+ @$(MKDIR_P) @GMP_TREE@/mpn/generic/$(DEPDIR)
+ @: > @GMP_TREE@/mpn/generic/$(DEPDIR)/$(am__dirstamp)
+@GMP_TREE@/mpn/generic/add.$(OBJEXT): \
+ @GMP_TREE@/mpn/generic/$(am__dirstamp) \
+ @GMP_TREE@/mpn/generic/$(DEPDIR)/$(am__dirstamp)
+@GMP_TREE@/mpn/generic/add_n.$(OBJEXT): \
+ @GMP_TREE@/mpn/generic/$(am__dirstamp) \
+ @GMP_TREE@/mpn/generic/$(DEPDIR)/$(am__dirstamp)
+@GMP_TREE@/mpn/generic/addmul_1.$(OBJEXT): \
+ @GMP_TREE@/mpn/generic/$(am__dirstamp) \
+ @GMP_TREE@/mpn/generic/$(DEPDIR)/$(am__dirstamp)
+@GMP_TREE@/mpn/generic/bdiv_dbm1c.$(OBJEXT): \
+ @GMP_TREE@/mpn/generic/$(am__dirstamp) \
+ @GMP_TREE@/mpn/generic/$(DEPDIR)/$(am__dirstamp)
+@GMP_TREE@/mpn/generic/bdiv_q.$(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)
+@GMP_TREE@/mpn/generic/dcpi1_bdiv_q.$(OBJEXT): \
+ @GMP_TREE@/mpn/generic/$(am__dirstamp) \
+ @GMP_TREE@/mpn/generic/$(DEPDIR)/$(am__dirstamp)
+@GMP_TREE@/mpn/generic/dcpi1_bdiv_qr.$(OBJEXT): \
+ @GMP_TREE@/mpn/generic/$(am__dirstamp) \
+ @GMP_TREE@/mpn/generic/$(DEPDIR)/$(am__dirstamp)
+@GMP_TREE@/mpn/generic/dcpi1_div_q.$(OBJEXT): \
+ @GMP_TREE@/mpn/generic/$(am__dirstamp) \
+ @GMP_TREE@/mpn/generic/$(DEPDIR)/$(am__dirstamp)
+@GMP_TREE@/mpn/generic/dcpi1_div_qr.$(OBJEXT): \
+ @GMP_TREE@/mpn/generic/$(am__dirstamp) \
+ @GMP_TREE@/mpn/generic/$(DEPDIR)/$(am__dirstamp)
+@GMP_TREE@/mpn/generic/dcpi1_divappr_q.$(OBJEXT): \
+ @GMP_TREE@/mpn/generic/$(am__dirstamp) \
+ @GMP_TREE@/mpn/generic/$(DEPDIR)/$(am__dirstamp)
+@GMP_TREE@/mpn/generic/div_q.$(OBJEXT): \
+ @GMP_TREE@/mpn/generic/$(am__dirstamp) \
+ @GMP_TREE@/mpn/generic/$(DEPDIR)/$(am__dirstamp)
+@GMP_TREE@/mpn/generic/div_qr_2n_pi1.$(OBJEXT): \
+ @GMP_TREE@/mpn/generic/$(am__dirstamp) \
+ @GMP_TREE@/mpn/generic/$(DEPDIR)/$(am__dirstamp)
+@GMP_TREE@/mpn/generic/dive_1.$(OBJEXT): \
+ @GMP_TREE@/mpn/generic/$(am__dirstamp) \
+ @GMP_TREE@/mpn/generic/$(DEPDIR)/$(am__dirstamp)
+@GMP_TREE@/mpn/generic/divexact.$(OBJEXT): \
+ @GMP_TREE@/mpn/generic/$(am__dirstamp) \
+ @GMP_TREE@/mpn/generic/$(DEPDIR)/$(am__dirstamp)
+@GMP_TREE@/mpn/generic/divrem.$(OBJEXT): \
+ @GMP_TREE@/mpn/generic/$(am__dirstamp) \
+ @GMP_TREE@/mpn/generic/$(DEPDIR)/$(am__dirstamp)
+@GMP_TREE@/mpn/generic/divrem_1.$(OBJEXT): \
+ @GMP_TREE@/mpn/generic/$(am__dirstamp) \
+ @GMP_TREE@/mpn/generic/$(DEPDIR)/$(am__dirstamp)
+@GMP_TREE@/mpn/generic/divrem_2.$(OBJEXT): \
+ @GMP_TREE@/mpn/generic/$(am__dirstamp) \
+ @GMP_TREE@/mpn/generic/$(DEPDIR)/$(am__dirstamp)
+@GMP_TREE@/mpn/generic/gcd_subdiv_step.$(OBJEXT): \
+ @GMP_TREE@/mpn/generic/$(am__dirstamp) \
+ @GMP_TREE@/mpn/generic/$(DEPDIR)/$(am__dirstamp)
+@GMP_TREE@/mpn/generic/gcdext.$(OBJEXT): \
+ @GMP_TREE@/mpn/generic/$(am__dirstamp) \
+ @GMP_TREE@/mpn/generic/$(DEPDIR)/$(am__dirstamp)
+@GMP_TREE@/mpn/generic/gcdext_1.$(OBJEXT): \
+ @GMP_TREE@/mpn/generic/$(am__dirstamp) \
+ @GMP_TREE@/mpn/generic/$(DEPDIR)/$(am__dirstamp)
+@GMP_TREE@/mpn/generic/gcdext_lehmer.$(OBJEXT): \
+ @GMP_TREE@/mpn/generic/$(am__dirstamp) \
+ @GMP_TREE@/mpn/generic/$(DEPDIR)/$(am__dirstamp)
+@GMP_TREE@/mpn/generic/get_str.$(OBJEXT): \
+ @GMP_TREE@/mpn/generic/$(am__dirstamp) \
+ @GMP_TREE@/mpn/generic/$(DEPDIR)/$(am__dirstamp)
+@GMP_TREE@/mpn/generic/hgcd.$(OBJEXT): \
+ @GMP_TREE@/mpn/generic/$(am__dirstamp) \
+ @GMP_TREE@/mpn/generic/$(DEPDIR)/$(am__dirstamp)
+@GMP_TREE@/mpn/generic/hgcd2.$(OBJEXT): \
+ @GMP_TREE@/mpn/generic/$(am__dirstamp) \
+ @GMP_TREE@/mpn/generic/$(DEPDIR)/$(am__dirstamp)
+@GMP_TREE@/mpn/generic/hgcd_appr.$(OBJEXT): \
+ @GMP_TREE@/mpn/generic/$(am__dirstamp) \
+ @GMP_TREE@/mpn/generic/$(DEPDIR)/$(am__dirstamp)
+@GMP_TREE@/mpn/generic/hgcd_matrix.$(OBJEXT): \
+ @GMP_TREE@/mpn/generic/$(am__dirstamp) \
+ @GMP_TREE@/mpn/generic/$(DEPDIR)/$(am__dirstamp)
+@GMP_TREE@/mpn/generic/hgcd_reduce.$(OBJEXT): \
+ @GMP_TREE@/mpn/generic/$(am__dirstamp) \
+ @GMP_TREE@/mpn/generic/$(DEPDIR)/$(am__dirstamp)
+@GMP_TREE@/mpn/generic/hgcd_step.$(OBJEXT): \
+ @GMP_TREE@/mpn/generic/$(am__dirstamp) \
+ @GMP_TREE@/mpn/generic/$(DEPDIR)/$(am__dirstamp)
+@GMP_TREE@/mpn/generic/invertappr.$(OBJEXT): \
+ @GMP_TREE@/mpn/generic/$(am__dirstamp) \
+ @GMP_TREE@/mpn/generic/$(DEPDIR)/$(am__dirstamp)
+@GMP_TREE@/mpn/generic/lshift.$(OBJEXT): \
+ @GMP_TREE@/mpn/generic/$(am__dirstamp) \
+ @GMP_TREE@/mpn/generic/$(DEPDIR)/$(am__dirstamp)
+@GMP_TREE@/mpn/generic/lshiftc.$(OBJEXT): \
+ @GMP_TREE@/mpn/generic/$(am__dirstamp) \
+ @GMP_TREE@/mpn/generic/$(DEPDIR)/$(am__dirstamp)
+@GMP_TREE@/mpn/generic/matrix22_mul.$(OBJEXT): \
+ @GMP_TREE@/mpn/generic/$(am__dirstamp) \
+ @GMP_TREE@/mpn/generic/$(DEPDIR)/$(am__dirstamp)
+@GMP_TREE@/mpn/generic/matrix22_mul1_inverse_vector.$(OBJEXT): \
+ @GMP_TREE@/mpn/generic/$(am__dirstamp) \
+ @GMP_TREE@/mpn/generic/$(DEPDIR)/$(am__dirstamp)
+@GMP_TREE@/mpn/generic/mu_bdiv_q.$(OBJEXT): \
+ @GMP_TREE@/mpn/generic/$(am__dirstamp) \
+ @GMP_TREE@/mpn/generic/$(DEPDIR)/$(am__dirstamp)
+@GMP_TREE@/mpn/generic/mu_div_q.$(OBJEXT): \
+ @GMP_TREE@/mpn/generic/$(am__dirstamp) \
+ @GMP_TREE@/mpn/generic/$(DEPDIR)/$(am__dirstamp)
+@GMP_TREE@/mpn/generic/mu_div_qr.$(OBJEXT): \
+ @GMP_TREE@/mpn/generic/$(am__dirstamp) \
+ @GMP_TREE@/mpn/generic/$(DEPDIR)/$(am__dirstamp)
+@GMP_TREE@/mpn/generic/mu_divappr_q.$(OBJEXT): \
+ @GMP_TREE@/mpn/generic/$(am__dirstamp) \
+ @GMP_TREE@/mpn/generic/$(DEPDIR)/$(am__dirstamp)
+@GMP_TREE@/mpn/generic/mul.$(OBJEXT): \
+ @GMP_TREE@/mpn/generic/$(am__dirstamp) \
+ @GMP_TREE@/mpn/generic/$(DEPDIR)/$(am__dirstamp)
+@GMP_TREE@/mpn/generic/mul_1.$(OBJEXT): \
+ @GMP_TREE@/mpn/generic/$(am__dirstamp) \
+ @GMP_TREE@/mpn/generic/$(DEPDIR)/$(am__dirstamp)
+@GMP_TREE@/mpn/generic/mul_basecase.$(OBJEXT): \
+ @GMP_TREE@/mpn/generic/$(am__dirstamp) \
+ @GMP_TREE@/mpn/generic/$(DEPDIR)/$(am__dirstamp)
+@GMP_TREE@/mpn/generic/mul_n.$(OBJEXT): \
+ @GMP_TREE@/mpn/generic/$(am__dirstamp) \
+ @GMP_TREE@/mpn/generic/$(DEPDIR)/$(am__dirstamp)
+@GMP_TREE@/mpn/generic/mul_fft.$(OBJEXT): \
+ @GMP_TREE@/mpn/generic/$(am__dirstamp) \
+ @GMP_TREE@/mpn/generic/$(DEPDIR)/$(am__dirstamp)
+@GMP_TREE@/mpn/generic/mullo_basecase.$(OBJEXT): \
+ @GMP_TREE@/mpn/generic/$(am__dirstamp) \
+ @GMP_TREE@/mpn/generic/$(DEPDIR)/$(am__dirstamp)
+@GMP_TREE@/mpn/generic/mullo_n.$(OBJEXT): \
+ @GMP_TREE@/mpn/generic/$(am__dirstamp) \
+ @GMP_TREE@/mpn/generic/$(DEPDIR)/$(am__dirstamp)
+@GMP_TREE@/mpn/generic/mulmod_bnm1.$(OBJEXT): \
+ @GMP_TREE@/mpn/generic/$(am__dirstamp) \
+ @GMP_TREE@/mpn/generic/$(DEPDIR)/$(am__dirstamp)
+@GMP_TREE@/mpn/generic/nussbaumer_mul.$(OBJEXT): \
+ @GMP_TREE@/mpn/generic/$(am__dirstamp) \
+ @GMP_TREE@/mpn/generic/$(DEPDIR)/$(am__dirstamp)
+@GMP_TREE@/mpn/generic/powlo.$(OBJEXT): \
+ @GMP_TREE@/mpn/generic/$(am__dirstamp) \
+ @GMP_TREE@/mpn/generic/$(DEPDIR)/$(am__dirstamp)
+@GMP_TREE@/mpn/generic/powm.$(OBJEXT): \
+ @GMP_TREE@/mpn/generic/$(am__dirstamp) \
+ @GMP_TREE@/mpn/generic/$(DEPDIR)/$(am__dirstamp)
+@GMP_TREE@/mpn/generic/pre_divrem_1.$(OBJEXT): \
+ @GMP_TREE@/mpn/generic/$(am__dirstamp) \
+ @GMP_TREE@/mpn/generic/$(DEPDIR)/$(am__dirstamp)
+@GMP_TREE@/mpn/generic/redc_1.$(OBJEXT): \
+ @GMP_TREE@/mpn/generic/$(am__dirstamp) \
+ @GMP_TREE@/mpn/generic/$(DEPDIR)/$(am__dirstamp)
+@GMP_TREE@/mpn/generic/redc_n.$(OBJEXT): \
+ @GMP_TREE@/mpn/generic/$(am__dirstamp) \
+ @GMP_TREE@/mpn/generic/$(DEPDIR)/$(am__dirstamp)
+@GMP_TREE@/mpn/generic/rshift.$(OBJEXT): \
+ @GMP_TREE@/mpn/generic/$(am__dirstamp) \
+ @GMP_TREE@/mpn/generic/$(DEPDIR)/$(am__dirstamp)
+@GMP_TREE@/mpn/generic/sbpi1_bdiv_q.$(OBJEXT): \
+ @GMP_TREE@/mpn/generic/$(am__dirstamp) \
+ @GMP_TREE@/mpn/generic/$(DEPDIR)/$(am__dirstamp)
+@GMP_TREE@/mpn/generic/sbpi1_bdiv_qr.$(OBJEXT): \
+ @GMP_TREE@/mpn/generic/$(am__dirstamp) \
+ @GMP_TREE@/mpn/generic/$(DEPDIR)/$(am__dirstamp)
+@GMP_TREE@/mpn/generic/sbpi1_div_q.$(OBJEXT): \
+ @GMP_TREE@/mpn/generic/$(am__dirstamp) \
+ @GMP_TREE@/mpn/generic/$(DEPDIR)/$(am__dirstamp)
+@GMP_TREE@/mpn/generic/sbpi1_div_qr.$(OBJEXT): \
+ @GMP_TREE@/mpn/generic/$(am__dirstamp) \
+ @GMP_TREE@/mpn/generic/$(DEPDIR)/$(am__dirstamp)
+@GMP_TREE@/mpn/generic/sbpi1_divappr_q.$(OBJEXT): \
+ @GMP_TREE@/mpn/generic/$(am__dirstamp) \
+ @GMP_TREE@/mpn/generic/$(DEPDIR)/$(am__dirstamp)
+@GMP_TREE@/mpn/generic/scan1.$(OBJEXT): \
+ @GMP_TREE@/mpn/generic/$(am__dirstamp) \
+ @GMP_TREE@/mpn/generic/$(DEPDIR)/$(am__dirstamp)
+@GMP_TREE@/mpn/generic/set_str.$(OBJEXT): \
+ @GMP_TREE@/mpn/generic/$(am__dirstamp) \
+ @GMP_TREE@/mpn/generic/$(DEPDIR)/$(am__dirstamp)
+@GMP_TREE@/mpn/generic/sqr.$(OBJEXT): \
+ @GMP_TREE@/mpn/generic/$(am__dirstamp) \
+ @GMP_TREE@/mpn/generic/$(DEPDIR)/$(am__dirstamp)
+@GMP_TREE@/mpn/generic/sqr_basecase.$(OBJEXT): \
+ @GMP_TREE@/mpn/generic/$(am__dirstamp) \
+ @GMP_TREE@/mpn/generic/$(DEPDIR)/$(am__dirstamp)
+@GMP_TREE@/mpn/generic/sqrmod_bnm1.$(OBJEXT): \
+ @GMP_TREE@/mpn/generic/$(am__dirstamp) \
+ @GMP_TREE@/mpn/generic/$(DEPDIR)/$(am__dirstamp)
+@GMP_TREE@/mpn/generic/sqrtrem.$(OBJEXT): \
+ @GMP_TREE@/mpn/generic/$(am__dirstamp) \
+ @GMP_TREE@/mpn/generic/$(DEPDIR)/$(am__dirstamp)
+@GMP_TREE@/mpn/generic/sub.$(OBJEXT): \
+ @GMP_TREE@/mpn/generic/$(am__dirstamp) \
+ @GMP_TREE@/mpn/generic/$(DEPDIR)/$(am__dirstamp)
+@GMP_TREE@/mpn/generic/sub_n.$(OBJEXT): \
+ @GMP_TREE@/mpn/generic/$(am__dirstamp) \
+ @GMP_TREE@/mpn/generic/$(DEPDIR)/$(am__dirstamp)
+@GMP_TREE@/mpn/generic/submul_1.$(OBJEXT): \
+ @GMP_TREE@/mpn/generic/$(am__dirstamp) \
+ @GMP_TREE@/mpn/generic/$(DEPDIR)/$(am__dirstamp)
+@GMP_TREE@/mpn/generic/tdiv_qr.$(OBJEXT): \
+ @GMP_TREE@/mpn/generic/$(am__dirstamp) \
+ @GMP_TREE@/mpn/generic/$(DEPDIR)/$(am__dirstamp)
+@GMP_TREE@/mpn/generic/toom2_sqr.$(OBJEXT): \
+ @GMP_TREE@/mpn/generic/$(am__dirstamp) \
+ @GMP_TREE@/mpn/generic/$(DEPDIR)/$(am__dirstamp)
+@GMP_TREE@/mpn/generic/toom22_mul.$(OBJEXT): \
+ @GMP_TREE@/mpn/generic/$(am__dirstamp) \
+ @GMP_TREE@/mpn/generic/$(DEPDIR)/$(am__dirstamp)
+@GMP_TREE@/mpn/generic/toom3_sqr.$(OBJEXT): \
+ @GMP_TREE@/mpn/generic/$(am__dirstamp) \
+ @GMP_TREE@/mpn/generic/$(DEPDIR)/$(am__dirstamp)
+@GMP_TREE@/mpn/generic/toom32_mul.$(OBJEXT): \
+ @GMP_TREE@/mpn/generic/$(am__dirstamp) \
+ @GMP_TREE@/mpn/generic/$(DEPDIR)/$(am__dirstamp)
+@GMP_TREE@/mpn/generic/toom33_mul.$(OBJEXT): \
+ @GMP_TREE@/mpn/generic/$(am__dirstamp) \
+ @GMP_TREE@/mpn/generic/$(DEPDIR)/$(am__dirstamp)
+@GMP_TREE@/mpn/generic/toom42_mul.$(OBJEXT): \
+ @GMP_TREE@/mpn/generic/$(am__dirstamp) \
+ @GMP_TREE@/mpn/generic/$(DEPDIR)/$(am__dirstamp)
+@GMP_TREE@/mpn/generic/toom42_mulmid.$(OBJEXT): \
+ @GMP_TREE@/mpn/generic/$(am__dirstamp) \
+ @GMP_TREE@/mpn/generic/$(DEPDIR)/$(am__dirstamp)
+@GMP_TREE@/mpn/generic/toom43_mul.$(OBJEXT): \
+ @GMP_TREE@/mpn/generic/$(am__dirstamp) \
+ @GMP_TREE@/mpn/generic/$(DEPDIR)/$(am__dirstamp)
+@GMP_TREE@/mpn/generic/toom44_mul.$(OBJEXT): \
+ @GMP_TREE@/mpn/generic/$(am__dirstamp) \
+ @GMP_TREE@/mpn/generic/$(DEPDIR)/$(am__dirstamp)
+@GMP_TREE@/mpn/generic/toom53_mul.$(OBJEXT): \
+ @GMP_TREE@/mpn/generic/$(am__dirstamp) \
+ @GMP_TREE@/mpn/generic/$(DEPDIR)/$(am__dirstamp)
+@GMP_TREE@/mpn/generic/toom63_mul.$(OBJEXT): \
+ @GMP_TREE@/mpn/generic/$(am__dirstamp) \
+ @GMP_TREE@/mpn/generic/$(DEPDIR)/$(am__dirstamp)
+@GMP_TREE@/mpn/generic/toom6_sqr.$(OBJEXT): \
+ @GMP_TREE@/mpn/generic/$(am__dirstamp) \
+ @GMP_TREE@/mpn/generic/$(DEPDIR)/$(am__dirstamp)
+@GMP_TREE@/mpn/generic/toom6h_mul.$(OBJEXT): \
+ @GMP_TREE@/mpn/generic/$(am__dirstamp) \
+ @GMP_TREE@/mpn/generic/$(DEPDIR)/$(am__dirstamp)
+@GMP_TREE@/mpn/generic/toom8_sqr.$(OBJEXT): \
+ @GMP_TREE@/mpn/generic/$(am__dirstamp) \
+ @GMP_TREE@/mpn/generic/$(DEPDIR)/$(am__dirstamp)
+@GMP_TREE@/mpn/generic/toom8h_mul.$(OBJEXT): \
+ @GMP_TREE@/mpn/generic/$(am__dirstamp) \
+ @GMP_TREE@/mpn/generic/$(DEPDIR)/$(am__dirstamp)
+@GMP_TREE@/mpn/generic/toom_couple_handling.$(OBJEXT): \
+ @GMP_TREE@/mpn/generic/$(am__dirstamp) \
+ @GMP_TREE@/mpn/generic/$(DEPDIR)/$(am__dirstamp)
+@GMP_TREE@/mpn/generic/toom_eval_dgr3_pm1.$(OBJEXT): \
+ @GMP_TREE@/mpn/generic/$(am__dirstamp) \
+ @GMP_TREE@/mpn/generic/$(DEPDIR)/$(am__dirstamp)
+@GMP_TREE@/mpn/generic/toom_eval_dgr3_pm2.$(OBJEXT): \
+ @GMP_TREE@/mpn/generic/$(am__dirstamp) \
+ @GMP_TREE@/mpn/generic/$(DEPDIR)/$(am__dirstamp)
+@GMP_TREE@/mpn/generic/toom_eval_pm1.$(OBJEXT): \
+ @GMP_TREE@/mpn/generic/$(am__dirstamp) \
+ @GMP_TREE@/mpn/generic/$(DEPDIR)/$(am__dirstamp)
+@GMP_TREE@/mpn/generic/toom_eval_pm2.$(OBJEXT): \
+ @GMP_TREE@/mpn/generic/$(am__dirstamp) \
+ @GMP_TREE@/mpn/generic/$(DEPDIR)/$(am__dirstamp)
+@GMP_TREE@/mpn/generic/toom_eval_pm2exp.$(OBJEXT): \
+ @GMP_TREE@/mpn/generic/$(am__dirstamp) \
+ @GMP_TREE@/mpn/generic/$(DEPDIR)/$(am__dirstamp)
+@GMP_TREE@/mpn/generic/toom_eval_pm2rexp.$(OBJEXT): \
+ @GMP_TREE@/mpn/generic/$(am__dirstamp) \
+ @GMP_TREE@/mpn/generic/$(DEPDIR)/$(am__dirstamp)
+@GMP_TREE@/mpn/generic/toom_interpolate_12pts.$(OBJEXT): \
+ @GMP_TREE@/mpn/generic/$(am__dirstamp) \
+ @GMP_TREE@/mpn/generic/$(DEPDIR)/$(am__dirstamp)
+@GMP_TREE@/mpn/generic/toom_interpolate_16pts.$(OBJEXT): \
+ @GMP_TREE@/mpn/generic/$(am__dirstamp) \
+ @GMP_TREE@/mpn/generic/$(DEPDIR)/$(am__dirstamp)
+@GMP_TREE@/mpn/generic/toom_interpolate_5pts.$(OBJEXT): \
+ @GMP_TREE@/mpn/generic/$(am__dirstamp) \
+ @GMP_TREE@/mpn/generic/$(DEPDIR)/$(am__dirstamp)
+@GMP_TREE@/mpn/generic/toom_interpolate_6pts.$(OBJEXT): \
+ @GMP_TREE@/mpn/generic/$(am__dirstamp) \
+ @GMP_TREE@/mpn/generic/$(DEPDIR)/$(am__dirstamp)
+@GMP_TREE@/mpn/generic/toom_interpolate_7pts.$(OBJEXT): \
+ @GMP_TREE@/mpn/generic/$(am__dirstamp) \
+ @GMP_TREE@/mpn/generic/$(DEPDIR)/$(am__dirstamp)
+@GMP_TREE@/mpn/generic/toom_interpolate_8pts.$(OBJEXT): \
+ @GMP_TREE@/mpn/generic/$(am__dirstamp) \
+ @GMP_TREE@/mpn/generic/$(DEPDIR)/$(am__dirstamp)
+@GMP_TREE@/mpz/$(am__dirstamp):
+ @$(MKDIR_P) @GMP_TREE@/mpz
+ @: > @GMP_TREE@/mpz/$(am__dirstamp)
+@GMP_TREE@/mpz/$(DEPDIR)/$(am__dirstamp):
+ @$(MKDIR_P) @GMP_TREE@/mpz/$(DEPDIR)
+ @: > @GMP_TREE@/mpz/$(DEPDIR)/$(am__dirstamp)
+@GMP_TREE@/mpz/add.$(OBJEXT): @GMP_TREE@/mpz/$(am__dirstamp) \
+ @GMP_TREE@/mpz/$(DEPDIR)/$(am__dirstamp)
+@GMP_TREE@/mpz/add_ui.$(OBJEXT): @GMP_TREE@/mpz/$(am__dirstamp) \
+ @GMP_TREE@/mpz/$(DEPDIR)/$(am__dirstamp)
+@GMP_TREE@/mpz/aorsmul.$(OBJEXT): @GMP_TREE@/mpz/$(am__dirstamp) \
+ @GMP_TREE@/mpz/$(DEPDIR)/$(am__dirstamp)
+@GMP_TREE@/mpz/aorsmul_i.$(OBJEXT): @GMP_TREE@/mpz/$(am__dirstamp) \
+ @GMP_TREE@/mpz/$(DEPDIR)/$(am__dirstamp)
+@GMP_TREE@/mpz/cfdiv_q_2exp.$(OBJEXT): @GMP_TREE@/mpz/$(am__dirstamp) \
+ @GMP_TREE@/mpz/$(DEPDIR)/$(am__dirstamp)
+@GMP_TREE@/mpz/clear.$(OBJEXT): @GMP_TREE@/mpz/$(am__dirstamp) \
+ @GMP_TREE@/mpz/$(DEPDIR)/$(am__dirstamp)
+@GMP_TREE@/mpz/cmp_ui.$(OBJEXT): @GMP_TREE@/mpz/$(am__dirstamp) \
+ @GMP_TREE@/mpz/$(DEPDIR)/$(am__dirstamp)
+@GMP_TREE@/mpz/cmpabs.$(OBJEXT): @GMP_TREE@/mpz/$(am__dirstamp) \
+ @GMP_TREE@/mpz/$(DEPDIR)/$(am__dirstamp)
+@GMP_TREE@/mpz/divexact.$(OBJEXT): @GMP_TREE@/mpz/$(am__dirstamp) \
+ @GMP_TREE@/mpz/$(DEPDIR)/$(am__dirstamp)
+@GMP_TREE@/mpz/fdiv_q.$(OBJEXT): @GMP_TREE@/mpz/$(am__dirstamp) \
+ @GMP_TREE@/mpz/$(DEPDIR)/$(am__dirstamp)
+@GMP_TREE@/mpz/fdiv_q_ui.$(OBJEXT): @GMP_TREE@/mpz/$(am__dirstamp) \
+ @GMP_TREE@/mpz/$(DEPDIR)/$(am__dirstamp)
+@GMP_TREE@/mpz/fdiv_qr.$(OBJEXT): @GMP_TREE@/mpz/$(am__dirstamp) \
+ @GMP_TREE@/mpz/$(DEPDIR)/$(am__dirstamp)
+@GMP_TREE@/mpz/gcdext.$(OBJEXT): @GMP_TREE@/mpz/$(am__dirstamp) \
+ @GMP_TREE@/mpz/$(DEPDIR)/$(am__dirstamp)
+@GMP_TREE@/mpz/get_si.$(OBJEXT): @GMP_TREE@/mpz/$(am__dirstamp) \
+ @GMP_TREE@/mpz/$(DEPDIR)/$(am__dirstamp)
+@GMP_TREE@/mpz/init.$(OBJEXT): @GMP_TREE@/mpz/$(am__dirstamp) \
+ @GMP_TREE@/mpz/$(DEPDIR)/$(am__dirstamp)
+@GMP_TREE@/mpz/invert.$(OBJEXT): @GMP_TREE@/mpz/$(am__dirstamp) \
+ @GMP_TREE@/mpz/$(DEPDIR)/$(am__dirstamp)
+@GMP_TREE@/mpz/iset.$(OBJEXT): @GMP_TREE@/mpz/$(am__dirstamp) \
+ @GMP_TREE@/mpz/$(DEPDIR)/$(am__dirstamp)
+@GMP_TREE@/mpz/iset_ui.$(OBJEXT): @GMP_TREE@/mpz/$(am__dirstamp) \
+ @GMP_TREE@/mpz/$(DEPDIR)/$(am__dirstamp)
+@GMP_TREE@/mpz/mod.$(OBJEXT): @GMP_TREE@/mpz/$(am__dirstamp) \
+ @GMP_TREE@/mpz/$(DEPDIR)/$(am__dirstamp)
+@GMP_TREE@/mpz/mul.$(OBJEXT): @GMP_TREE@/mpz/$(am__dirstamp) \
+ @GMP_TREE@/mpz/$(DEPDIR)/$(am__dirstamp)
+@GMP_TREE@/mpz/mul_2exp.$(OBJEXT): @GMP_TREE@/mpz/$(am__dirstamp) \
+ @GMP_TREE@/mpz/$(DEPDIR)/$(am__dirstamp)
+@GMP_TREE@/mpz/mul_si.$(OBJEXT): @GMP_TREE@/mpz/$(am__dirstamp) \
+ @GMP_TREE@/mpz/$(DEPDIR)/$(am__dirstamp)
+@GMP_TREE@/mpz/mul_ui.$(OBJEXT): @GMP_TREE@/mpz/$(am__dirstamp) \
+ @GMP_TREE@/mpz/$(DEPDIR)/$(am__dirstamp)
+@GMP_TREE@/mpz/n_pow_ui.$(OBJEXT): @GMP_TREE@/mpz/$(am__dirstamp) \
+ @GMP_TREE@/mpz/$(DEPDIR)/$(am__dirstamp)
+@GMP_TREE@/mpz/powm.$(OBJEXT): @GMP_TREE@/mpz/$(am__dirstamp) \
+ @GMP_TREE@/mpz/$(DEPDIR)/$(am__dirstamp)
+@GMP_TREE@/mpz/powm_ui.$(OBJEXT): @GMP_TREE@/mpz/$(am__dirstamp) \
+ @GMP_TREE@/mpz/$(DEPDIR)/$(am__dirstamp)
+@GMP_TREE@/mpz/realloc.$(OBJEXT): @GMP_TREE@/mpz/$(am__dirstamp) \
+ @GMP_TREE@/mpz/$(DEPDIR)/$(am__dirstamp)
+@GMP_TREE@/mpz/scan1.$(OBJEXT): @GMP_TREE@/mpz/$(am__dirstamp) \
+ @GMP_TREE@/mpz/$(DEPDIR)/$(am__dirstamp)
+@GMP_TREE@/mpz/set.$(OBJEXT): @GMP_TREE@/mpz/$(am__dirstamp) \
+ @GMP_TREE@/mpz/$(DEPDIR)/$(am__dirstamp)
+@GMP_TREE@/mpz/set_ui.$(OBJEXT): @GMP_TREE@/mpz/$(am__dirstamp) \
+ @GMP_TREE@/mpz/$(DEPDIR)/$(am__dirstamp)
+@GMP_TREE@/mpz/sizeinbase.$(OBJEXT): @GMP_TREE@/mpz/$(am__dirstamp) \
+ @GMP_TREE@/mpz/$(DEPDIR)/$(am__dirstamp)
+@GMP_TREE@/mpz/sqrt.$(OBJEXT): @GMP_TREE@/mpz/$(am__dirstamp) \
+ @GMP_TREE@/mpz/$(DEPDIR)/$(am__dirstamp)
+@GMP_TREE@/mpz/sub.$(OBJEXT): @GMP_TREE@/mpz/$(am__dirstamp) \
+ @GMP_TREE@/mpz/$(DEPDIR)/$(am__dirstamp)
+@GMP_TREE@/mpz/sub_ui.$(OBJEXT): @GMP_TREE@/mpz/$(am__dirstamp) \
+ @GMP_TREE@/mpz/$(DEPDIR)/$(am__dirstamp)
+@GMP_TREE@/mpz/swap.$(OBJEXT): @GMP_TREE@/mpz/$(am__dirstamp) \
+ @GMP_TREE@/mpz/$(DEPDIR)/$(am__dirstamp)
+@GMP_TREE@/mpz/tdiv_q.$(OBJEXT): @GMP_TREE@/mpz/$(am__dirstamp) \
+ @GMP_TREE@/mpz/$(DEPDIR)/$(am__dirstamp)
+@GMP_TREE@/mpz/tdiv_q_2exp.$(OBJEXT): @GMP_TREE@/mpz/$(am__dirstamp) \
+ @GMP_TREE@/mpz/$(DEPDIR)/$(am__dirstamp)
+@GMP_TREE@/mpz/tdiv_qr.$(OBJEXT): @GMP_TREE@/mpz/$(am__dirstamp) \
+ @GMP_TREE@/mpz/$(DEPDIR)/$(am__dirstamp)
+@GMP_TREE@/mpz/tdiv_r.$(OBJEXT): @GMP_TREE@/mpz/$(am__dirstamp) \
+ @GMP_TREE@/mpz/$(DEPDIR)/$(am__dirstamp)
+@GMP_TREE@/mpz/tdiv_r_2exp.$(OBJEXT): @GMP_TREE@/mpz/$(am__dirstamp) \
+ @GMP_TREE@/mpz/$(DEPDIR)/$(am__dirstamp)
+@GMP_TREE@/mpz/tstbit.$(OBJEXT): @GMP_TREE@/mpz/$(am__dirstamp) \
+ @GMP_TREE@/mpz/$(DEPDIR)/$(am__dirstamp)
+@GMP_TREE@/mpz/ui_pow_ui.$(OBJEXT): @GMP_TREE@/mpz/$(am__dirstamp) \
+ @GMP_TREE@/mpz/$(DEPDIR)/$(am__dirstamp)
+
+libgmp.a: $(libgmp_a_OBJECTS) $(libgmp_a_DEPENDENCIES) $(EXTRA_libgmp_a_DEPENDENCIES)
+ $(AM_V_at)-rm -f libgmp.a
+ $(AM_V_AR)$(libgmp_a_AR) libgmp.a $(libgmp_a_OBJECTS) $(libgmp_a_LIBADD)
+ $(AM_V_at)$(RANLIB) libgmp.a
+
+clean-checkPROGRAMS:
+ -test -z "$(check_PROGRAMS)" || rm -f $(check_PROGRAMS)
+
+gmptest$(EXEEXT): $(gmptest_OBJECTS) $(gmptest_DEPENDENCIES) $(EXTRA_gmptest_DEPENDENCIES)
+ @rm -f gmptest$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(gmptest_OBJECTS) $(gmptest_LDADD) $(LIBS)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+ -rm -f @GMP_TREE@/*.$(OBJEXT)
+ -rm -f @GMP_TREE@/mpn/generic/*.$(OBJEXT)
+ -rm -f @GMP_TREE@/mpz/*.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gmptest-gmptest.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mp_bases.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/popcount.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@@GMP_TREE@/$(DEPDIR)/assert.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@@GMP_TREE@/$(DEPDIR)/compat.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@@GMP_TREE@/$(DEPDIR)/errno.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@@GMP_TREE@/$(DEPDIR)/extract-dbl.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@@GMP_TREE@/$(DEPDIR)/invalid.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@@GMP_TREE@/$(DEPDIR)/memory.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@@GMP_TREE@/$(DEPDIR)/mp_bpl.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@@GMP_TREE@/$(DEPDIR)/mp_clz_tab.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@@GMP_TREE@/$(DEPDIR)/mp_dv_tab.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@@GMP_TREE@/$(DEPDIR)/mp_get_fns.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@@GMP_TREE@/$(DEPDIR)/mp_minv_tab.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@@GMP_TREE@/$(DEPDIR)/mp_set_fns.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@@GMP_TREE@/$(DEPDIR)/nextprime.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@@GMP_TREE@/$(DEPDIR)/primesieve.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@@GMP_TREE@/$(DEPDIR)/tal-reent.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@@GMP_TREE@/$(DEPDIR)/version.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@@GMP_TREE@/mpn/generic/$(DEPDIR)/add.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@@GMP_TREE@/mpn/generic/$(DEPDIR)/add_n.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@@GMP_TREE@/mpn/generic/$(DEPDIR)/addmul_1.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@@GMP_TREE@/mpn/generic/$(DEPDIR)/bdiv_dbm1c.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@@GMP_TREE@/mpn/generic/$(DEPDIR)/bdiv_q.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@@GMP_TREE@/mpn/generic/$(DEPDIR)/binvert.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@@GMP_TREE@/mpn/generic/$(DEPDIR)/dcpi1_bdiv_q.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@@GMP_TREE@/mpn/generic/$(DEPDIR)/dcpi1_bdiv_qr.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@@GMP_TREE@/mpn/generic/$(DEPDIR)/dcpi1_div_q.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@@GMP_TREE@/mpn/generic/$(DEPDIR)/dcpi1_div_qr.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@@GMP_TREE@/mpn/generic/$(DEPDIR)/dcpi1_divappr_q.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@@GMP_TREE@/mpn/generic/$(DEPDIR)/div_q.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@@GMP_TREE@/mpn/generic/$(DEPDIR)/div_qr_2n_pi1.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@@GMP_TREE@/mpn/generic/$(DEPDIR)/dive_1.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@@GMP_TREE@/mpn/generic/$(DEPDIR)/divexact.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@@GMP_TREE@/mpn/generic/$(DEPDIR)/divrem.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@@GMP_TREE@/mpn/generic/$(DEPDIR)/divrem_1.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@@GMP_TREE@/mpn/generic/$(DEPDIR)/divrem_2.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@@GMP_TREE@/mpn/generic/$(DEPDIR)/gcd_subdiv_step.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@@GMP_TREE@/mpn/generic/$(DEPDIR)/gcdext.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@@GMP_TREE@/mpn/generic/$(DEPDIR)/gcdext_1.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@@GMP_TREE@/mpn/generic/$(DEPDIR)/gcdext_lehmer.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@@GMP_TREE@/mpn/generic/$(DEPDIR)/get_str.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@@GMP_TREE@/mpn/generic/$(DEPDIR)/hgcd.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@@GMP_TREE@/mpn/generic/$(DEPDIR)/hgcd2.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@@GMP_TREE@/mpn/generic/$(DEPDIR)/hgcd_appr.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@@GMP_TREE@/mpn/generic/$(DEPDIR)/hgcd_matrix.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@@GMP_TREE@/mpn/generic/$(DEPDIR)/hgcd_reduce.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@@GMP_TREE@/mpn/generic/$(DEPDIR)/hgcd_step.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@@GMP_TREE@/mpn/generic/$(DEPDIR)/invertappr.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@@GMP_TREE@/mpn/generic/$(DEPDIR)/lshift.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@@GMP_TREE@/mpn/generic/$(DEPDIR)/lshiftc.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@@GMP_TREE@/mpn/generic/$(DEPDIR)/matrix22_mul.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@@GMP_TREE@/mpn/generic/$(DEPDIR)/matrix22_mul1_inverse_vector.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@@GMP_TREE@/mpn/generic/$(DEPDIR)/mu_bdiv_q.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@@GMP_TREE@/mpn/generic/$(DEPDIR)/mu_div_q.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@@GMP_TREE@/mpn/generic/$(DEPDIR)/mu_div_qr.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@@GMP_TREE@/mpn/generic/$(DEPDIR)/mu_divappr_q.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@@GMP_TREE@/mpn/generic/$(DEPDIR)/mul.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@@GMP_TREE@/mpn/generic/$(DEPDIR)/mul_1.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@@GMP_TREE@/mpn/generic/$(DEPDIR)/mul_basecase.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@@GMP_TREE@/mpn/generic/$(DEPDIR)/mul_fft.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@@GMP_TREE@/mpn/generic/$(DEPDIR)/mul_n.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@@GMP_TREE@/mpn/generic/$(DEPDIR)/mullo_basecase.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@@GMP_TREE@/mpn/generic/$(DEPDIR)/mullo_n.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@@GMP_TREE@/mpn/generic/$(DEPDIR)/mulmod_bnm1.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@@GMP_TREE@/mpn/generic/$(DEPDIR)/nussbaumer_mul.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@@GMP_TREE@/mpn/generic/$(DEPDIR)/powlo.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@@GMP_TREE@/mpn/generic/$(DEPDIR)/powm.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@@GMP_TREE@/mpn/generic/$(DEPDIR)/pre_divrem_1.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@@GMP_TREE@/mpn/generic/$(DEPDIR)/redc_1.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@@GMP_TREE@/mpn/generic/$(DEPDIR)/redc_n.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@@GMP_TREE@/mpn/generic/$(DEPDIR)/rshift.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@@GMP_TREE@/mpn/generic/$(DEPDIR)/sbpi1_bdiv_q.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@@GMP_TREE@/mpn/generic/$(DEPDIR)/sbpi1_bdiv_qr.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@@GMP_TREE@/mpn/generic/$(DEPDIR)/sbpi1_div_q.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@@GMP_TREE@/mpn/generic/$(DEPDIR)/sbpi1_div_qr.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@@GMP_TREE@/mpn/generic/$(DEPDIR)/sbpi1_divappr_q.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@@GMP_TREE@/mpn/generic/$(DEPDIR)/scan1.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@@GMP_TREE@/mpn/generic/$(DEPDIR)/set_str.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@@GMP_TREE@/mpn/generic/$(DEPDIR)/sqr.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@@GMP_TREE@/mpn/generic/$(DEPDIR)/sqr_basecase.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@@GMP_TREE@/mpn/generic/$(DEPDIR)/sqrmod_bnm1.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@@GMP_TREE@/mpn/generic/$(DEPDIR)/sqrtrem.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@@GMP_TREE@/mpn/generic/$(DEPDIR)/sub.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@@GMP_TREE@/mpn/generic/$(DEPDIR)/sub_n.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@@GMP_TREE@/mpn/generic/$(DEPDIR)/submul_1.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@@GMP_TREE@/mpn/generic/$(DEPDIR)/tdiv_qr.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@@GMP_TREE@/mpn/generic/$(DEPDIR)/toom22_mul.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@@GMP_TREE@/mpn/generic/$(DEPDIR)/toom2_sqr.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@@GMP_TREE@/mpn/generic/$(DEPDIR)/toom32_mul.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@@GMP_TREE@/mpn/generic/$(DEPDIR)/toom33_mul.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@@GMP_TREE@/mpn/generic/$(DEPDIR)/toom3_sqr.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@@GMP_TREE@/mpn/generic/$(DEPDIR)/toom42_mul.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@@GMP_TREE@/mpn/generic/$(DEPDIR)/toom42_mulmid.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@@GMP_TREE@/mpn/generic/$(DEPDIR)/toom43_mul.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@@GMP_TREE@/mpn/generic/$(DEPDIR)/toom44_mul.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@@GMP_TREE@/mpn/generic/$(DEPDIR)/toom53_mul.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@@GMP_TREE@/mpn/generic/$(DEPDIR)/toom63_mul.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@@GMP_TREE@/mpn/generic/$(DEPDIR)/toom6_sqr.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@@GMP_TREE@/mpn/generic/$(DEPDIR)/toom6h_mul.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@@GMP_TREE@/mpn/generic/$(DEPDIR)/toom8_sqr.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@@GMP_TREE@/mpn/generic/$(DEPDIR)/toom8h_mul.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@@GMP_TREE@/mpn/generic/$(DEPDIR)/toom_couple_handling.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@@GMP_TREE@/mpn/generic/$(DEPDIR)/toom_eval_dgr3_pm1.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@@GMP_TREE@/mpn/generic/$(DEPDIR)/toom_eval_dgr3_pm2.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@@GMP_TREE@/mpn/generic/$(DEPDIR)/toom_eval_pm1.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@@GMP_TREE@/mpn/generic/$(DEPDIR)/toom_eval_pm2.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@@GMP_TREE@/mpn/generic/$(DEPDIR)/toom_eval_pm2exp.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@@GMP_TREE@/mpn/generic/$(DEPDIR)/toom_eval_pm2rexp.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@@GMP_TREE@/mpn/generic/$(DEPDIR)/toom_interpolate_12pts.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@@GMP_TREE@/mpn/generic/$(DEPDIR)/toom_interpolate_16pts.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@@GMP_TREE@/mpn/generic/$(DEPDIR)/toom_interpolate_5pts.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@@GMP_TREE@/mpn/generic/$(DEPDIR)/toom_interpolate_6pts.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@@GMP_TREE@/mpn/generic/$(DEPDIR)/toom_interpolate_7pts.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@@GMP_TREE@/mpn/generic/$(DEPDIR)/toom_interpolate_8pts.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@@GMP_TREE@/mpz/$(DEPDIR)/add.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@@GMP_TREE@/mpz/$(DEPDIR)/add_ui.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@@GMP_TREE@/mpz/$(DEPDIR)/aorsmul.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@@GMP_TREE@/mpz/$(DEPDIR)/aorsmul_i.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@@GMP_TREE@/mpz/$(DEPDIR)/cfdiv_q_2exp.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@@GMP_TREE@/mpz/$(DEPDIR)/clear.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@@GMP_TREE@/mpz/$(DEPDIR)/cmp_ui.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@@GMP_TREE@/mpz/$(DEPDIR)/cmpabs.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@@GMP_TREE@/mpz/$(DEPDIR)/divexact.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@@GMP_TREE@/mpz/$(DEPDIR)/fdiv_q.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@@GMP_TREE@/mpz/$(DEPDIR)/fdiv_q_ui.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@@GMP_TREE@/mpz/$(DEPDIR)/fdiv_qr.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@@GMP_TREE@/mpz/$(DEPDIR)/gcdext.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@@GMP_TREE@/mpz/$(DEPDIR)/get_si.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@@GMP_TREE@/mpz/$(DEPDIR)/init.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@@GMP_TREE@/mpz/$(DEPDIR)/invert.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@@GMP_TREE@/mpz/$(DEPDIR)/iset.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@@GMP_TREE@/mpz/$(DEPDIR)/iset_ui.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@@GMP_TREE@/mpz/$(DEPDIR)/mod.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@@GMP_TREE@/mpz/$(DEPDIR)/mul.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@@GMP_TREE@/mpz/$(DEPDIR)/mul_2exp.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@@GMP_TREE@/mpz/$(DEPDIR)/mul_si.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@@GMP_TREE@/mpz/$(DEPDIR)/mul_ui.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@@GMP_TREE@/mpz/$(DEPDIR)/n_pow_ui.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@@GMP_TREE@/mpz/$(DEPDIR)/powm.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@@GMP_TREE@/mpz/$(DEPDIR)/powm_ui.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@@GMP_TREE@/mpz/$(DEPDIR)/realloc.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@@GMP_TREE@/mpz/$(DEPDIR)/scan1.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@@GMP_TREE@/mpz/$(DEPDIR)/set.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@@GMP_TREE@/mpz/$(DEPDIR)/set_ui.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@@GMP_TREE@/mpz/$(DEPDIR)/sizeinbase.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@@GMP_TREE@/mpz/$(DEPDIR)/sqrt.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@@GMP_TREE@/mpz/$(DEPDIR)/sub.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@@GMP_TREE@/mpz/$(DEPDIR)/sub_ui.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@@GMP_TREE@/mpz/$(DEPDIR)/swap.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@@GMP_TREE@/mpz/$(DEPDIR)/tdiv_q.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@@GMP_TREE@/mpz/$(DEPDIR)/tdiv_q_2exp.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@@GMP_TREE@/mpz/$(DEPDIR)/tdiv_qr.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@@GMP_TREE@/mpz/$(DEPDIR)/tdiv_r.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@@GMP_TREE@/mpz/$(DEPDIR)/tdiv_r_2exp.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@@GMP_TREE@/mpz/$(DEPDIR)/tstbit.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@@GMP_TREE@/mpz/$(DEPDIR)/ui_pow_ui.Po@am__quote@
+
+.c.o:
+@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
+@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
+@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
+
+.c.obj:
+@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\
+@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\
+@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+gmptest-gmptest.o: gmptest.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gmptest_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT gmptest-gmptest.o -MD -MP -MF $(DEPDIR)/gmptest-gmptest.Tpo -c -o gmptest-gmptest.o `test -f 'gmptest.c' || echo '$(srcdir)/'`gmptest.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/gmptest-gmptest.Tpo $(DEPDIR)/gmptest-gmptest.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gmptest.c' object='gmptest-gmptest.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gmptest_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o gmptest-gmptest.o `test -f 'gmptest.c' || echo '$(srcdir)/'`gmptest.c
+
+gmptest-gmptest.obj: gmptest.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gmptest_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT gmptest-gmptest.obj -MD -MP -MF $(DEPDIR)/gmptest-gmptest.Tpo -c -o gmptest-gmptest.obj `if test -f 'gmptest.c'; then $(CYGPATH_W) 'gmptest.c'; else $(CYGPATH_W) '$(srcdir)/gmptest.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/gmptest-gmptest.Tpo $(DEPDIR)/gmptest-gmptest.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gmptest.c' object='gmptest-gmptest.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gmptest_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o gmptest-gmptest.obj `if test -f 'gmptest.c'; then $(CYGPATH_W) 'gmptest.c'; else $(CYGPATH_W) '$(srcdir)/gmptest.c'; fi`
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run 'make' without going through this Makefile.
+# To change the values of 'make' variables: instead of editing Makefiles,
+# (1) if the variable is set in 'config.status', edit 'config.status'
+# (which will cause the Makefiles to be regenerated when you run 'make');
+# (2) otherwise, pass the desired values on the 'make' command line.
+$(am__recursive_targets):
+ @fail=; \
+ if $(am__make_keepgoing); then \
+ failcom='fail=yes'; \
+ else \
+ failcom='exit 1'; \
+ fi; \
+ dot_seen=no; \
+ target=`echo $@ | sed s/-recursive//`; \
+ case "$@" in \
+ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+ *) list='$(SUBDIRS)' ;; \
+ esac; \
+ for subdir in $$list; do \
+ echo "Making $$target in $$subdir"; \
+ if test "$$subdir" = "."; then \
+ dot_seen=yes; \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ || eval $$failcom; \
+ done; \
+ if test "$$dot_seen" = "no"; then \
+ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+ fi; test -z "$$fail"
+
+ID: $(am__tagged_files)
+ $(am__define_uniq_tagged_files); mkid -fID $$unique
+tags: tags-recursive
+TAGS: tags
+
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+ set x; \
+ here=`pwd`; \
+ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+ include_option=--etags-include; \
+ empty_fix=.; \
+ else \
+ include_option=--include; \
+ empty_fix=; \
+ fi; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ test ! -f $$subdir/TAGS || \
+ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
+ fi; \
+ done; \
+ $(am__define_uniq_tagged_files); \
+ shift; \
+ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ if test $$# -gt 0; then \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ "$$@" $$unique; \
+ else \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$unique; \
+ fi; \
+ fi
+ctags: ctags-recursive
+
+CTAGS: ctags
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+ $(am__define_uniq_tagged_files); \
+ test -z "$(CTAGS_ARGS)$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && $(am__cd) $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) "$$here"
+cscope: cscope.files
+ test ! -s cscope.files \
+ || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS)
+clean-cscope:
+ -rm -f cscope.files
+cscope.files: clean-cscope cscopelist
+cscopelist: cscopelist-recursive
+
+cscopelist-am: $(am__tagged_files)
+ list='$(am__tagged_files)'; \
+ case "$(srcdir)" in \
+ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+ *) sdir=$(subdir)/$(srcdir) ;; \
+ esac; \
+ for i in $$list; do \
+ if test -f "$$i"; then \
+ echo "$(subdir)/$$i"; \
+ else \
+ echo "$$sdir/$$i"; \
+ fi; \
+ done >> $(top_builddir)/cscope.files
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+ -rm -f cscope.out cscope.in.out cscope.po.out cscope.files
+
+# Recover from deleted '.trs' file; this should ensure that
+# "rm -f foo.log; make foo.trs" re-run 'foo.test', and re-create
+# both 'foo.log' and 'foo.trs'. Break the recipe in two subshells
+# to avoid problems with "make -n".
+.log.trs:
+ rm -f $< $@
+ $(MAKE) $(AM_MAKEFLAGS) $<
+
+# Leading 'am--fnord' is there to ensure the list of targets does not
+# expand to empty, as could happen e.g. with make check TESTS=''.
+am--fnord $(TEST_LOGS) $(TEST_LOGS:.log=.trs): $(am__force_recheck)
+am--force-recheck:
+ @:
+
+$(TEST_SUITE_LOG): $(TEST_LOGS)
+ @$(am__set_TESTS_bases); \
+ am__f_ok () { test -f "$$1" && test -r "$$1"; }; \
+ redo_bases=`for i in $$bases; do \
+ am__f_ok $$i.trs && am__f_ok $$i.log || echo $$i; \
+ done`; \
+ if test -n "$$redo_bases"; then \
+ redo_logs=`for i in $$redo_bases; do echo $$i.log; done`; \
+ redo_results=`for i in $$redo_bases; do echo $$i.trs; done`; \
+ if $(am__make_dryrun); then :; else \
+ rm -f $$redo_logs && rm -f $$redo_results || exit 1; \
+ fi; \
+ fi; \
+ if test -n "$$am__remaking_logs"; then \
+ echo "fatal: making $(TEST_SUITE_LOG): possible infinite" \
+ "recursion detected" >&2; \
+ else \
+ am__remaking_logs=yes $(MAKE) $(AM_MAKEFLAGS) $$redo_logs; \
+ fi; \
+ if $(am__make_dryrun); then :; else \
+ st=0; \
+ errmsg="fatal: making $(TEST_SUITE_LOG): failed to create"; \
+ for i in $$redo_bases; do \
+ test -f $$i.trs && test -r $$i.trs \
+ || { echo "$$errmsg $$i.trs" >&2; st=1; }; \
+ test -f $$i.log && test -r $$i.log \
+ || { echo "$$errmsg $$i.log" >&2; st=1; }; \
+ done; \
+ test $$st -eq 0 || exit 1; \
+ fi
+ @$(am__sh_e_setup); $(am__tty_colors); $(am__set_TESTS_bases); \
+ ws='[ ]'; \
+ results=`for b in $$bases; do echo $$b.trs; done`; \
+ test -n "$$results" || results=/dev/null; \
+ all=` grep "^$$ws*:test-result:" $$results | wc -l`; \
+ pass=` grep "^$$ws*:test-result:$$ws*PASS" $$results | wc -l`; \
+ fail=` grep "^$$ws*:test-result:$$ws*FAIL" $$results | wc -l`; \
+ skip=` grep "^$$ws*:test-result:$$ws*SKIP" $$results | wc -l`; \
+ xfail=`grep "^$$ws*:test-result:$$ws*XFAIL" $$results | wc -l`; \
+ xpass=`grep "^$$ws*:test-result:$$ws*XPASS" $$results | wc -l`; \
+ error=`grep "^$$ws*:test-result:$$ws*ERROR" $$results | wc -l`; \
+ if test `expr $$fail + $$xpass + $$error` -eq 0; then \
+ success=true; \
+ else \
+ success=false; \
+ fi; \
+ br='==================='; br=$$br$$br$$br$$br; \
+ result_count () \
+ { \
+ if test x"$$1" = x"--maybe-color"; then \
+ maybe_colorize=yes; \
+ elif test x"$$1" = x"--no-color"; then \
+ maybe_colorize=no; \
+ else \
+ echo "$@: invalid 'result_count' usage" >&2; exit 4; \
+ fi; \
+ shift; \
+ desc=$$1 count=$$2; \
+ if test $$maybe_colorize = yes && test $$count -gt 0; then \
+ color_start=$$3 color_end=$$std; \
+ else \
+ color_start= color_end=; \
+ fi; \
+ echo "$${color_start}# $$desc $$count$${color_end}"; \
+ }; \
+ create_testsuite_report () \
+ { \
+ result_count $$1 "TOTAL:" $$all "$$brg"; \
+ result_count $$1 "PASS: " $$pass "$$grn"; \
+ result_count $$1 "SKIP: " $$skip "$$blu"; \
+ result_count $$1 "XFAIL:" $$xfail "$$lgn"; \
+ result_count $$1 "FAIL: " $$fail "$$red"; \
+ result_count $$1 "XPASS:" $$xpass "$$red"; \
+ result_count $$1 "ERROR:" $$error "$$mgn"; \
+ }; \
+ { \
+ echo "$(PACKAGE_STRING): $(subdir)/$(TEST_SUITE_LOG)" | \
+ $(am__rst_title); \
+ create_testsuite_report --no-color; \
+ echo; \
+ echo ".. contents:: :depth: 2"; \
+ echo; \
+ for b in $$bases; do echo $$b; done \
+ | $(am__create_global_log); \
+ } >$(TEST_SUITE_LOG).tmp || exit 1; \
+ mv $(TEST_SUITE_LOG).tmp $(TEST_SUITE_LOG); \
+ if $$success; then \
+ col="$$grn"; \
+ else \
+ col="$$red"; \
+ test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG); \
+ fi; \
+ echo "$${col}$$br$${std}"; \
+ echo "$${col}Testsuite summary for $(PACKAGE_STRING)$${std}"; \
+ echo "$${col}$$br$${std}"; \
+ create_testsuite_report --maybe-color; \
+ echo "$$col$$br$$std"; \
+ if $$success; then :; else \
+ echo "$${col}See $(subdir)/$(TEST_SUITE_LOG)$${std}"; \
+ if test -n "$(PACKAGE_BUGREPORT)"; then \
+ echo "$${col}Please report to $(PACKAGE_BUGREPORT)$${std}"; \
+ fi; \
+ echo "$$col$$br$$std"; \
+ fi; \
+ $$success || exit 1
+
+check-TESTS:
+ @list='$(RECHECK_LOGS)'; test -z "$$list" || rm -f $$list
+ @list='$(RECHECK_LOGS:.log=.trs)'; test -z "$$list" || rm -f $$list
+ @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG)
+ @set +e; $(am__set_TESTS_bases); \
+ log_list=`for i in $$bases; do echo $$i.log; done`; \
+ trs_list=`for i in $$bases; do echo $$i.trs; done`; \
+ log_list=`echo $$log_list`; trs_list=`echo $$trs_list`; \
+ $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$log_list"; \
+ exit $$?;
+recheck: all $(check_PROGRAMS) $(dist_check_SCRIPTS)
+ @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG)
+ @set +e; $(am__set_TESTS_bases); \
+ bases=`for i in $$bases; do echo $$i; done \
+ | $(am__list_recheck_tests)` || exit 1; \
+ log_list=`for i in $$bases; do echo $$i.log; done`; \
+ log_list=`echo $$log_list`; \
+ $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) \
+ am__force_recheck=am--force-recheck \
+ TEST_LOGS="$$log_list"; \
+ exit $$?
+.test.log:
+ @p='$<'; \
+ $(am__set_b); \
+ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+@am__EXEEXT_TRUE@.test$(EXEEXT).log:
+@am__EXEEXT_TRUE@ @p='$<'; \
+@am__EXEEXT_TRUE@ $(am__set_b); \
+@am__EXEEXT_TRUE@ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \
+@am__EXEEXT_TRUE@ --log-file $$b.log --trs-file $$b.trs \
+@am__EXEEXT_TRUE@ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \
+@am__EXEEXT_TRUE@ "$$tst" $(AM_TESTS_FD_REDIRECT)
+
+distdir: $(DISTFILES)
+ $(am__remove_distdir)
+ test -d "$(distdir)" || mkdir "$(distdir)"
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d "$(distdir)/$$file"; then \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+ else \
+ test -f "$(distdir)/$$file" \
+ || cp -p $$d/$$file "$(distdir)/$$file" \
+ || exit 1; \
+ fi; \
+ done
+ @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ $(am__make_dryrun) \
+ || test -d "$(distdir)/$$subdir" \
+ || $(MKDIR_P) "$(distdir)/$$subdir" \
+ || exit 1; \
+ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
+ $(am__relativize); \
+ new_distdir=$$reldir; \
+ dir1=$$subdir; dir2="$(top_distdir)"; \
+ $(am__relativize); \
+ new_top_distdir=$$reldir; \
+ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
+ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
+ ($(am__cd) $$subdir && \
+ $(MAKE) $(AM_MAKEFLAGS) \
+ top_distdir="$$new_top_distdir" \
+ distdir="$$new_distdir" \
+ am__remove_distdir=: \
+ am__skip_length_check=: \
+ am__skip_mode_fix=: \
+ distdir) \
+ || exit 1; \
+ fi; \
+ done
+ $(MAKE) $(AM_MAKEFLAGS) \
+ top_distdir="$(top_distdir)" distdir="$(distdir)" \
+ dist-hook
+ -test -n "$(am__skip_mode_fix)" \
+ || find "$(distdir)" -type d ! -perm -755 \
+ -exec chmod u+rwx,go+rx {} \; -o \
+ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
+ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \
+ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
+ || chmod -R a+r "$(distdir)"
+dist-gzip: distdir
+ tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
+ $(am__post_remove_distdir)
+
+dist-bzip2: distdir
+ tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2
+ $(am__post_remove_distdir)
+
+dist-lzip: distdir
+ tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz
+ $(am__post_remove_distdir)
+
+dist-xz: distdir
+ tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz
+ $(am__post_remove_distdir)
+
+dist-tarZ: distdir
+ @echo WARNING: "Support for shar distribution archives is" \
+ "deprecated." >&2
+ @echo WARNING: "It will be removed altogether in Automake 2.0" >&2
+ tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
+ $(am__post_remove_distdir)
+
+dist-shar: distdir
+ @echo WARNING: "Support for distribution archives compressed with" \
+ "legacy program 'compress' is deprecated." >&2
+ @echo WARNING: "It will be removed altogether in Automake 2.0" >&2
+ shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
+ $(am__post_remove_distdir)
+
+dist-zip: distdir
+ -rm -f $(distdir).zip
+ zip -rq $(distdir).zip $(distdir)
+ $(am__post_remove_distdir)
+
+dist dist-all:
+ $(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:'
+ $(am__post_remove_distdir)
+
+# This target untars the dist file and tries a VPATH configuration. Then
+# it guarantees that the distribution is self-contained by making another
+# tarfile.
+distcheck: dist
+ case '$(DIST_ARCHIVES)' in \
+ *.tar.gz*) \
+ GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\
+ *.tar.bz2*) \
+ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
+ *.tar.lz*) \
+ lzip -dc $(distdir).tar.lz | $(am__untar) ;;\
+ *.tar.xz*) \
+ xz -dc $(distdir).tar.xz | $(am__untar) ;;\
+ *.tar.Z*) \
+ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
+ *.shar.gz*) \
+ GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\
+ *.zip*) \
+ unzip $(distdir).zip ;;\
+ esac
+ chmod -R a-w $(distdir)
+ chmod u+w $(distdir)
+ mkdir $(distdir)/_build $(distdir)/_inst
+ chmod a-w $(distdir)
+ test -d $(distdir)/_build || exit 0; \
+ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
+ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
+ && am__cwd=`pwd` \
+ && $(am__cd) $(distdir)/_build \
+ && ../configure \
+ $(AM_DISTCHECK_CONFIGURE_FLAGS) \
+ $(DISTCHECK_CONFIGURE_FLAGS) \
+ --srcdir=.. --prefix="$$dc_install_base" \
+ && $(MAKE) $(AM_MAKEFLAGS) \
+ && $(MAKE) $(AM_MAKEFLAGS) dvi \
+ && $(MAKE) $(AM_MAKEFLAGS) check \
+ && $(MAKE) $(AM_MAKEFLAGS) install \
+ && $(MAKE) $(AM_MAKEFLAGS) installcheck \
+ && $(MAKE) $(AM_MAKEFLAGS) uninstall \
+ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \
+ distuninstallcheck \
+ && chmod -R a-w "$$dc_install_base" \
+ && ({ \
+ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \
+ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \
+ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \
+ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \
+ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \
+ } || { rm -rf "$$dc_destdir"; exit 1; }) \
+ && rm -rf "$$dc_destdir" \
+ && $(MAKE) $(AM_MAKEFLAGS) dist \
+ && rm -rf $(DIST_ARCHIVES) \
+ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \
+ && cd "$$am__cwd" \
+ || exit 1
+ $(am__post_remove_distdir)
+ @(echo "$(distdir) archives ready for distribution: "; \
+ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
+ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'
+distuninstallcheck:
+ @test -n '$(distuninstallcheck_dir)' || { \
+ echo 'ERROR: trying to run $@ with an empty' \
+ '$$(distuninstallcheck_dir)' >&2; \
+ exit 1; \
+ }; \
+ $(am__cd) '$(distuninstallcheck_dir)' || { \
+ echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \
+ exit 1; \
+ }; \
+ test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \
+ || { echo "ERROR: files left after uninstall:" ; \
+ if test -n "$(DESTDIR)"; then \
+ echo " (check DESTDIR support)"; \
+ fi ; \
+ $(distuninstallcheck_listfiles) ; \
+ exit 1; } >&2
+distcleancheck: distclean
+ @if test '$(srcdir)' = . ; then \
+ echo "ERROR: distcleancheck can only run from a VPATH build" ; \
+ exit 1 ; \
+ fi
+ @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \
+ || { echo "ERROR: files left in build directory after distclean:" ; \
+ $(distcleancheck_listfiles) ; \
+ exit 1; } >&2
+check-am: all-am
+ $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) \
+ $(dist_check_SCRIPTS)
+ $(MAKE) $(AM_MAKEFLAGS) check-TESTS
+check: check-recursive
+all-am: Makefile $(LIBRARIES) config.h
+installdirs: installdirs-recursive
+installdirs-am:
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+ if test -z '$(STRIP)'; then \
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ install; \
+ else \
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+ fi
+mostlyclean-generic:
+ -test -z "$(TEST_LOGS)" || rm -f $(TEST_LOGS)
+ -test -z "$(TEST_LOGS:.log=.trs)" || rm -f $(TEST_LOGS:.log=.trs)
+ -test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG)
+
+clean-generic:
+ -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+ -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+ -rm -f @GMP_TREE@/$(DEPDIR)/$(am__dirstamp)
+ -rm -f @GMP_TREE@/$(am__dirstamp)
+ -rm -f @GMP_TREE@/mpn/generic/$(DEPDIR)/$(am__dirstamp)
+ -rm -f @GMP_TREE@/mpn/generic/$(am__dirstamp)
+ -rm -f @GMP_TREE@/mpz/$(DEPDIR)/$(am__dirstamp)
+ -rm -f @GMP_TREE@/mpz/$(am__dirstamp)
+ -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-recursive
+
+clean-am: clean-checkPROGRAMS clean-generic clean-noinstLIBRARIES \
+ mostlyclean-am
+
+distclean: distclean-recursive
+ -rm -f $(am__CONFIG_DISTCLEAN_FILES)
+ -rm -rf ./$(DEPDIR) @GMP_TREE@/$(DEPDIR) @GMP_TREE@/mpn/generic/$(DEPDIR) @GMP_TREE@/mpz/$(DEPDIR)
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-hdr distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+html-am:
+
+info: info-recursive
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-recursive
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-recursive
+
+install-html-am:
+
+install-info: install-info-recursive
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-recursive
+
+install-pdf-am:
+
+install-ps: install-ps-recursive
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+ -rm -f $(am__CONFIG_DISTCLEAN_FILES)
+ -rm -rf $(top_srcdir)/autom4te.cache
+ -rm -rf ./$(DEPDIR) @GMP_TREE@/$(DEPDIR) @GMP_TREE@/mpn/generic/$(DEPDIR) @GMP_TREE@/mpz/$(DEPDIR)
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am:
+
+.MAKE: $(am__recursive_targets) all check-am install-am install-strip
+
+.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \
+ am--refresh check check-TESTS check-am clean \
+ clean-checkPROGRAMS clean-cscope clean-generic \
+ clean-noinstLIBRARIES cscope cscopelist-am ctags ctags-am dist \
+ dist-all dist-bzip2 dist-gzip dist-hook dist-lzip dist-shar \
+ dist-tarZ dist-xz dist-zip distcheck distclean \
+ distclean-compile distclean-generic distclean-hdr \
+ distclean-tags distcleancheck distdir distuninstallcheck dvi \
+ dvi-am html html-am info info-am install install-am \
+ install-data install-data-am install-dvi install-dvi-am \
+ install-exec install-exec-am install-html install-html-am \
+ install-info install-info-am install-man install-pdf \
+ install-pdf-am install-ps install-ps-am install-strip \
+ installcheck installcheck-am installdirs installdirs-am \
+ maintainer-clean maintainer-clean-generic mostlyclean \
+ mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \
+ recheck tags tags-am uninstall uninstall-am
+
+
+# in case of an SVN repository
+dist-hook:
+ rm -rf `find $(distdir) -name .svn -o -name .deps -o -name .dirstamp -o -name '*.$(OBJEXT)'`
+$(libgmp_a_OBJECTS): mp_bases.h fac_table.h fib_table.h
+
+$(logops_n_sources):
+ @echo "#define OPERATION_`echo $@ | sed 's/\.c//'` 1" >$@
+ @echo "#include <logops_n.c>" >>$@
+$(popham_sources):
+ @echo "#define OPERATION_`echo $@ | sed 's/\.c//'` 1" >$@
+ @echo "#include <popham.c>" >>$@
+$(sec_aors_1_sources):
+ @echo "#define OPERATION_`echo $@ | sed 's/\.c//'` 1" >$@
+ @echo "#include <sec_aors_1.c>" >>$@
+$(sec_div_sources):
+ @echo "#define OPERATION_`echo $@ | sed 's/\.c//'` 1" >$@
+ @echo "#include <sec_div.c>" >>$@
+$(sec_pi1_div_sources):
+ @echo "#define OPERATION_`echo $@ | sed 's/\.c//'` 1" >$@
+ @echo "#include <sec_pi1_div.c>" >>$@
+
+native/stamp-bases:
+ cd native && $(MAKE) $(AM_MAKEFLAGS) stamp-bases
+mp_bases.h: native/stamp-bases
+ $(AM_V_GEN)native/gen-bases header $(GMP_LIMB_BITS) $(GMP_NAIL_BITS) >$@ || (rm -f $@; exit 1)
+mp_bases.c: mp_bases.h
+ $(AM_V_GEN)native/gen-bases table $(GMP_LIMB_BITS) $(GMP_NAIL_BITS) >$@ || (rm -f $@; exit 1)
+
+native/stamp-fac:
+ cd native && $(MAKE) $(AM_MAKEFLAGS) stamp-fac
+fac_table.h: native/stamp-fac
+ $(AM_V_GEN)native/gen-fac $(GMP_LIMB_BITS) $(GMP_NAIL_BITS) >$@ || (rm -f $@; exit 1)
+
+native/stamp-fib:
+ cd native && $(MAKE) $(AM_MAKEFLAGS) stamp-fib
+fib_table.h: native/stamp-fib
+ $(AM_V_GEN)native/gen-fib header $(GMP_LIMB_BITS) $(GMP_NAIL_BITS) >$@ || (rm -f $@; exit 1)
+fib_table.c: fib_table.h
+ $(AM_V_GEN)native/gen-fib table $(GMP_LIMB_BITS) $(GMP_NAIL_BITS) >$@ || (rm -f $@; exit 1)
+
+native/stamp-jacobitab:
+ cd native && $(MAKE) $(AM_MAKEFLAGS) stamp-jacobitab
+jacobitab.h: native/stamp-jacobitab
+ $(AM_V_GEN)native/gen-jacobitab >$@ || (rm -f $@; exit 1)
+
+native/stamp-psqr:
+ cd native && $(MAKE) $(AM_MAKEFLAGS) stamp-psqr
+perfsqr.h: native/stamp-psqr
+ $(AM_V_GEN)native/gen-psqr $(GMP_LIMB_BITS) $(GMP_NAIL_BITS) >$@ || (rm -f $@; exit 1)
+
+native/stamp-trialdivtab:
+ cd native && $(MAKE) $(AM_MAKEFLAGS) stamp-trialdivtab
+trialdivtab.h: native/stamp-trialdivtab
+ $(AM_V_GEN)native/gen-trialdivtab $(GMP_LIMB_BITS) 8000 >$@ || (rm -f $@; exit 1)
+config.force: $(reconfig_prereq)
+ @if test -f $@; then :; else \
+ trap 'rm -rf reconfig.lock' 1 2 13 15; \
+ if mkdir reconfig.lock 2>/dev/null; then \
+ echo timestamp >$@; \
+ $(SHELL) ./config.status --recheck; \
+ rmdir reconfig.lock; \
+ else \
+ while test -d rebuild.lock && test -z "$$dry"; do sleep 1; done; \
+ test -f $@; \
+ fi; \
+ fi
+rebuild.stamp: $(rebuild_target)
+ echo timestamp >$@
+
+.PHONY: rebuild
+rebuild: $(rebuild_prereq)
+ @dry=; for f in x $$MAKEFLAGS; do \
+ case $$f in \
+ *=*|--*);; \
+ *n*) dry=:;; \
+ esac; \
+ done; \
+ if test -f rebuild.stamp; then :; else \
+ $$dry trap 'rm -rf rebuild.lock' 1 2 13 15; \
+ if $$dry mkdir rebuild.lock 2>/dev/null; then \
+ $(MAKE) $(AM_MAKEFLAGS) rebuild.stamp; \
+ $$dry rmdir rebuild.lock; \
+ else \
+ while test -d rebuild.lock && test -z "$$dry"; do sleep 1; done; \
+ fi; \
+ $$dry test -f rebuild.stamp; exit $$?; \
+ fi
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/Build/source/libs/gmp/README b/Build/source/libs/gmp/README
new file mode 100644
index 00000000000..3d0bf3dcd04
--- /dev/null
+++ b/Build/source/libs/gmp/README
@@ -0,0 +1,17 @@
+ Building GNU MP as part of the TL tree
+ ======================================
+
+This directory libs/gmp/ uses a proxy Makefile.am to build the GNU MP
+library 'libgmp' from the unmodified source tree in
+libs/gmp/gmp-x.y.z/, bypassing the original build system.
+
+As far as applicable, the tests in libs/gmp/gmp-x.y.z/configure have
+been translated into equivalent test in libs/gmp/configure.ac.
+
+=============================
+
+At the moment there is a wrapper Makefile.am and configure.ac.
+
+=============================
+
+2014-03-31 Taco Hoekwater <taco@metatex.org>
diff --git a/Build/source/libs/gmp/ac/gmp.ac b/Build/source/libs/gmp/ac/gmp.ac
new file mode 100644
index 00000000000..69fce384df3
--- /dev/null
+++ b/Build/source/libs/gmp/ac/gmp.ac
@@ -0,0 +1,9 @@
+## libs/gmp/ac/gmp.ac: configure.ac fragment for the TeX Live subdirectory libs/gmp/
+dnl
+dnl Copyright (C) 2014 Taco Hoekwater <taco@metatex.org>
+dnl You may freely use, modify and/or distribute this file.
+dnl
+## basic check of system gmp
+KPSE_TRY_LIB([gmp],
+ [#include <gmp.h>],
+ [const char *s = gmp_version;])
diff --git a/Build/source/libs/gmp/ac/withenable.ac b/Build/source/libs/gmp/ac/withenable.ac
new file mode 100644
index 00000000000..3621d339b23
--- /dev/null
+++ b/Build/source/libs/gmp/ac/withenable.ac
@@ -0,0 +1,10 @@
+## libs/gmp/ac/withenable.ac: configure.ac fragment for the TeX Live subdirectory libs/gmp/
+dnl
+dnl Copyright (C) 2014 Taco Hoekwater <taco@metatex.org>
+dnl Copyright (C) 2014 Peter Breitenlohner <tex-live@tug.org>
+dnl You may freely use, modify and/or distribute this file.
+dnl
+dnl extra_dirs = libs/gmp/native
+dnl
+## configure options and TL libraries required for gmp
+KPSE_WITH_LIB([gmp])
diff --git a/Build/source/libs/gmp/aclocal.m4 b/Build/source/libs/gmp/aclocal.m4
new file mode 100644
index 00000000000..03e96b7b9b3
--- /dev/null
+++ b/Build/source/libs/gmp/aclocal.m4
@@ -0,0 +1,1190 @@
+# generated automatically by aclocal 1.14.1 -*- Autoconf -*-
+
+# Copyright (C) 1996-2013 Free Software Foundation, Inc.
+
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])
+m4_ifndef([AC_AUTOCONF_VERSION],
+ [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
+m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],,
+[m4_warning([this file was generated for autoconf 2.69.
+You have another version of autoconf. It may work, but is not guaranteed to.
+If you have problems, you may need to regenerate the build system entirely.
+To do so, use the procedure documented by the package, typically 'autoreconf'.])])
+
+# Copyright (C) 2002-2013 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_AUTOMAKE_VERSION(VERSION)
+# ----------------------------
+# Automake X.Y traces this macro to ensure aclocal.m4 has been
+# generated from the m4 files accompanying Automake X.Y.
+# (This private macro should not be called outside this file.)
+AC_DEFUN([AM_AUTOMAKE_VERSION],
+[am__api_version='1.14'
+dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
+dnl require some minimum version. Point them to the right macro.
+m4_if([$1], [1.14.1], [],
+ [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
+])
+
+# _AM_AUTOCONF_VERSION(VERSION)
+# -----------------------------
+# aclocal traces this macro to find the Autoconf version.
+# This is a private macro too. Using m4_define simplifies
+# the logic in aclocal, which can simply ignore this definition.
+m4_define([_AM_AUTOCONF_VERSION], [])
+
+# AM_SET_CURRENT_AUTOMAKE_VERSION
+# -------------------------------
+# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
+# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
+AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
+[AM_AUTOMAKE_VERSION([1.14.1])dnl
+m4_ifndef([AC_AUTOCONF_VERSION],
+ [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
+_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
+
+# AM_AUX_DIR_EXPAND -*- Autoconf -*-
+
+# Copyright (C) 2001-2013 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
+# $ac_aux_dir to '$srcdir/foo'. In other projects, it is set to
+# '$srcdir', '$srcdir/..', or '$srcdir/../..'.
+#
+# Of course, Automake must honor this variable whenever it calls a
+# tool from the auxiliary directory. The problem is that $srcdir (and
+# therefore $ac_aux_dir as well) can be either absolute or relative,
+# depending on how configure is run. This is pretty annoying, since
+# it makes $ac_aux_dir quite unusable in subdirectories: in the top
+# source directory, any form will work fine, but in subdirectories a
+# relative path needs to be adjusted first.
+#
+# $ac_aux_dir/missing
+# fails when called from a subdirectory if $ac_aux_dir is relative
+# $top_srcdir/$ac_aux_dir/missing
+# fails if $ac_aux_dir is absolute,
+# fails when called from a subdirectory in a VPATH build with
+# a relative $ac_aux_dir
+#
+# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
+# are both prefixed by $srcdir. In an in-source build this is usually
+# harmless because $srcdir is '.', but things will broke when you
+# start a VPATH build or use an absolute $srcdir.
+#
+# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
+# iff we strip the leading $srcdir from $ac_aux_dir. That would be:
+# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
+# and then we would define $MISSING as
+# MISSING="\${SHELL} $am_aux_dir/missing"
+# This will work as long as MISSING is not called from configure, because
+# unfortunately $(top_srcdir) has no meaning in configure.
+# However there are other variables, like CC, which are often used in
+# configure, and could therefore not use this "fixed" $ac_aux_dir.
+#
+# Another solution, used here, is to always expand $ac_aux_dir to an
+# absolute PATH. The drawback is that using absolute paths prevent a
+# configured tree to be moved without reconfiguration.
+
+AC_DEFUN([AM_AUX_DIR_EXPAND],
+[dnl Rely on autoconf to set up CDPATH properly.
+AC_PREREQ([2.50])dnl
+# expand $ac_aux_dir to an absolute path
+am_aux_dir=`cd $ac_aux_dir && pwd`
+])
+
+# AM_CONDITIONAL -*- Autoconf -*-
+
+# Copyright (C) 1997-2013 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_CONDITIONAL(NAME, SHELL-CONDITION)
+# -------------------------------------
+# Define a conditional.
+AC_DEFUN([AM_CONDITIONAL],
+[AC_PREREQ([2.52])dnl
+ m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])],
+ [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
+AC_SUBST([$1_TRUE])dnl
+AC_SUBST([$1_FALSE])dnl
+_AM_SUBST_NOTMAKE([$1_TRUE])dnl
+_AM_SUBST_NOTMAKE([$1_FALSE])dnl
+m4_define([_AM_COND_VALUE_$1], [$2])dnl
+if $2; then
+ $1_TRUE=
+ $1_FALSE='#'
+else
+ $1_TRUE='#'
+ $1_FALSE=
+fi
+AC_CONFIG_COMMANDS_PRE(
+[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
+ AC_MSG_ERROR([[conditional "$1" was never defined.
+Usually this means the macro was only invoked conditionally.]])
+fi])])
+
+# Copyright (C) 1999-2013 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+
+# There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be
+# written in clear, in which case automake, when reading aclocal.m4,
+# will think it sees a *use*, and therefore will trigger all it's
+# C support machinery. Also note that it means that autoscan, seeing
+# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
+
+
+# _AM_DEPENDENCIES(NAME)
+# ----------------------
+# See how the compiler implements dependency checking.
+# NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC".
+# We try a few techniques and use that to set a single cache variable.
+#
+# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
+# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
+# dependency, and given that the user is not expected to run this macro,
+# just rely on AC_PROG_CC.
+AC_DEFUN([_AM_DEPENDENCIES],
+[AC_REQUIRE([AM_SET_DEPDIR])dnl
+AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
+AC_REQUIRE([AM_MAKE_INCLUDE])dnl
+AC_REQUIRE([AM_DEP_TRACK])dnl
+
+m4_if([$1], [CC], [depcc="$CC" am_compiler_list=],
+ [$1], [CXX], [depcc="$CXX" am_compiler_list=],
+ [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
+ [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'],
+ [$1], [UPC], [depcc="$UPC" am_compiler_list=],
+ [$1], [GCJ], [depcc="$GCJ" am_compiler_list='gcc3 gcc'],
+ [depcc="$$1" am_compiler_list=])
+
+AC_CACHE_CHECK([dependency style of $depcc],
+ [am_cv_$1_dependencies_compiler_type],
+[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+ # We make a subdir and do the tests there. Otherwise we can end up
+ # making bogus files that we don't know about and never remove. For
+ # instance it was reported that on HP-UX the gcc test will end up
+ # making a dummy file named 'D' -- because '-MD' means "put the output
+ # in D".
+ rm -rf conftest.dir
+ mkdir conftest.dir
+ # Copy depcomp to subdir because otherwise we won't find it if we're
+ # using a relative directory.
+ cp "$am_depcomp" conftest.dir
+ cd conftest.dir
+ # We will build objects and dependencies in a subdirectory because
+ # it helps to detect inapplicable dependency modes. For instance
+ # both Tru64's cc and ICC support -MD to output dependencies as a
+ # side effect of compilation, but ICC will put the dependencies in
+ # the current directory while Tru64 will put them in the object
+ # directory.
+ mkdir sub
+
+ am_cv_$1_dependencies_compiler_type=none
+ if test "$am_compiler_list" = ""; then
+ am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
+ fi
+ am__universal=false
+ m4_case([$1], [CC],
+ [case " $depcc " in #(
+ *\ -arch\ *\ -arch\ *) am__universal=true ;;
+ esac],
+ [CXX],
+ [case " $depcc " in #(
+ *\ -arch\ *\ -arch\ *) am__universal=true ;;
+ esac])
+
+ for depmode in $am_compiler_list; do
+ # Setup a source with many dependencies, because some compilers
+ # like to wrap large dependency lists on column 80 (with \), and
+ # we should not choose a depcomp mode which is confused by this.
+ #
+ # We need to recreate these files for each test, as the compiler may
+ # overwrite some of them when testing with obscure command lines.
+ # This happens at least with the AIX C compiler.
+ : > sub/conftest.c
+ for i in 1 2 3 4 5 6; do
+ echo '#include "conftst'$i'.h"' >> sub/conftest.c
+ # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
+ # Solaris 10 /bin/sh.
+ echo '/* dummy */' > sub/conftst$i.h
+ done
+ echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+ # We check with '-c' and '-o' for the sake of the "dashmstdout"
+ # mode. It turns out that the SunPro C++ compiler does not properly
+ # handle '-M -o', and we need to detect this. Also, some Intel
+ # versions had trouble with output in subdirs.
+ am__obj=sub/conftest.${OBJEXT-o}
+ am__minus_obj="-o $am__obj"
+ case $depmode in
+ gcc)
+ # This depmode causes a compiler race in universal mode.
+ test "$am__universal" = false || continue
+ ;;
+ nosideeffect)
+ # After this tag, mechanisms are not by side-effect, so they'll
+ # only be used when explicitly requested.
+ if test "x$enable_dependency_tracking" = xyes; then
+ continue
+ else
+ break
+ fi
+ ;;
+ msvc7 | msvc7msys | msvisualcpp | msvcmsys)
+ # This compiler won't grok '-c -o', but also, the minuso test has
+ # not run yet. These depmodes are late enough in the game, and
+ # so weak that their functioning should not be impacted.
+ am__obj=conftest.${OBJEXT-o}
+ am__minus_obj=
+ ;;
+ none) break ;;
+ esac
+ if depmode=$depmode \
+ source=sub/conftest.c object=$am__obj \
+ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
+ >/dev/null 2>conftest.err &&
+ grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
+ grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+ grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
+ ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+ # icc doesn't choke on unknown options, it will just issue warnings
+ # or remarks (even with -Werror). So we grep stderr for any message
+ # that says an option was ignored or not supported.
+ # When given -MP, icc 7.0 and 7.1 complain thusly:
+ # icc: Command line warning: ignoring option '-M'; no argument required
+ # The diagnosis changed in icc 8.0:
+ # icc: Command line remark: option '-MP' not supported
+ if (grep 'ignoring option' conftest.err ||
+ grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
+ am_cv_$1_dependencies_compiler_type=$depmode
+ break
+ fi
+ fi
+ done
+
+ cd ..
+ rm -rf conftest.dir
+else
+ am_cv_$1_dependencies_compiler_type=none
+fi
+])
+AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
+AM_CONDITIONAL([am__fastdep$1], [
+ test "x$enable_dependency_tracking" != xno \
+ && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
+])
+
+
+# AM_SET_DEPDIR
+# -------------
+# Choose a directory name for dependency files.
+# This macro is AC_REQUIREd in _AM_DEPENDENCIES.
+AC_DEFUN([AM_SET_DEPDIR],
+[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
+AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
+])
+
+
+# AM_DEP_TRACK
+# ------------
+AC_DEFUN([AM_DEP_TRACK],
+[AC_ARG_ENABLE([dependency-tracking], [dnl
+AS_HELP_STRING(
+ [--enable-dependency-tracking],
+ [do not reject slow dependency extractors])
+AS_HELP_STRING(
+ [--disable-dependency-tracking],
+ [speeds up one-time build])])
+if test "x$enable_dependency_tracking" != xno; then
+ am_depcomp="$ac_aux_dir/depcomp"
+ AMDEPBACKSLASH='\'
+ am__nodep='_no'
+fi
+AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
+AC_SUBST([AMDEPBACKSLASH])dnl
+_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
+AC_SUBST([am__nodep])dnl
+_AM_SUBST_NOTMAKE([am__nodep])dnl
+])
+
+# Generate code to set up dependency tracking. -*- Autoconf -*-
+
+# Copyright (C) 1999-2013 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+
+# _AM_OUTPUT_DEPENDENCY_COMMANDS
+# ------------------------------
+AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
+[{
+ # Older Autoconf quotes --file arguments for eval, but not when files
+ # are listed without --file. Let's play safe and only enable the eval
+ # if we detect the quoting.
+ case $CONFIG_FILES in
+ *\'*) eval set x "$CONFIG_FILES" ;;
+ *) set x $CONFIG_FILES ;;
+ esac
+ shift
+ for mf
+ do
+ # Strip MF so we end up with the name of the file.
+ mf=`echo "$mf" | sed -e 's/:.*$//'`
+ # Check whether this is an Automake generated Makefile or not.
+ # We used to match only the files named 'Makefile.in', but
+ # some people rename them; so instead we look at the file content.
+ # Grep'ing the first line is not enough: some people post-process
+ # each Makefile.in and add a new line on top of each file to say so.
+ # Grep'ing the whole file is not good either: AIX grep has a line
+ # limit of 2048, but all sed's we know have understand at least 4000.
+ if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
+ dirpart=`AS_DIRNAME("$mf")`
+ else
+ continue
+ fi
+ # Extract the definition of DEPDIR, am__include, and am__quote
+ # from the Makefile without running 'make'.
+ DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
+ test -z "$DEPDIR" && continue
+ am__include=`sed -n 's/^am__include = //p' < "$mf"`
+ test -z "$am__include" && continue
+ am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
+ # Find all dependency output files, they are included files with
+ # $(DEPDIR) in their names. We invoke sed twice because it is the
+ # simplest approach to changing $(DEPDIR) to its actual value in the
+ # expansion.
+ for file in `sed -n "
+ s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
+ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
+ # Make sure the directory exists.
+ test -f "$dirpart/$file" && continue
+ fdir=`AS_DIRNAME(["$file"])`
+ AS_MKDIR_P([$dirpart/$fdir])
+ # echo "creating $dirpart/$file"
+ echo '# dummy' > "$dirpart/$file"
+ done
+ done
+}
+])# _AM_OUTPUT_DEPENDENCY_COMMANDS
+
+
+# AM_OUTPUT_DEPENDENCY_COMMANDS
+# -----------------------------
+# This macro should only be invoked once -- use via AC_REQUIRE.
+#
+# This code is only required when automatic dependency tracking
+# is enabled. FIXME. This creates each '.P' file that we will
+# need in order to bootstrap the dependency handling code.
+AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
+[AC_CONFIG_COMMANDS([depfiles],
+ [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
+ [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
+])
+
+# Do all the work for Automake. -*- Autoconf -*-
+
+# Copyright (C) 1996-2013 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This macro actually does too much. Some checks are only needed if
+# your package does certain things. But this isn't really a big deal.
+
+dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O.
+m4_define([AC_PROG_CC],
+m4_defn([AC_PROG_CC])
+[_AM_PROG_CC_C_O
+])
+
+# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
+# AM_INIT_AUTOMAKE([OPTIONS])
+# -----------------------------------------------
+# The call with PACKAGE and VERSION arguments is the old style
+# call (pre autoconf-2.50), which is being phased out. PACKAGE
+# and VERSION should now be passed to AC_INIT and removed from
+# the call to AM_INIT_AUTOMAKE.
+# We support both call styles for the transition. After
+# the next Automake release, Autoconf can make the AC_INIT
+# arguments mandatory, and then we can depend on a new Autoconf
+# release and drop the old call support.
+AC_DEFUN([AM_INIT_AUTOMAKE],
+[AC_PREREQ([2.65])dnl
+dnl Autoconf wants to disallow AM_ names. We explicitly allow
+dnl the ones we care about.
+m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
+AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
+AC_REQUIRE([AC_PROG_INSTALL])dnl
+if test "`cd $srcdir && pwd`" != "`pwd`"; then
+ # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
+ # is not polluted with repeated "-I."
+ AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
+ # test to see if srcdir already configured
+ if test -f $srcdir/config.status; then
+ AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
+ fi
+fi
+
+# test whether we have cygpath
+if test -z "$CYGPATH_W"; then
+ if (cygpath --version) >/dev/null 2>/dev/null; then
+ CYGPATH_W='cygpath -w'
+ else
+ CYGPATH_W=echo
+ fi
+fi
+AC_SUBST([CYGPATH_W])
+
+# Define the identity of the package.
+dnl Distinguish between old-style and new-style calls.
+m4_ifval([$2],
+[AC_DIAGNOSE([obsolete],
+ [$0: two- and three-arguments forms are deprecated.])
+m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
+ AC_SUBST([PACKAGE], [$1])dnl
+ AC_SUBST([VERSION], [$2])],
+[_AM_SET_OPTIONS([$1])dnl
+dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
+m4_if(
+ m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]),
+ [ok:ok],,
+ [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
+ AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
+ AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
+
+_AM_IF_OPTION([no-define],,
+[AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package])
+ AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl
+
+# Some tools Automake needs.
+AC_REQUIRE([AM_SANITY_CHECK])dnl
+AC_REQUIRE([AC_ARG_PROGRAM])dnl
+AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}])
+AM_MISSING_PROG([AUTOCONF], [autoconf])
+AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}])
+AM_MISSING_PROG([AUTOHEADER], [autoheader])
+AM_MISSING_PROG([MAKEINFO], [makeinfo])
+AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
+AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
+AC_REQUIRE([AC_PROG_MKDIR_P])dnl
+# For better backward compatibility. To be removed once Automake 1.9.x
+# dies out for good. For more background, see:
+# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
+# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
+AC_SUBST([mkdir_p], ['$(MKDIR_P)'])
+# We need awk for the "check" target. The system "awk" is bad on
+# some platforms.
+AC_REQUIRE([AC_PROG_AWK])dnl
+AC_REQUIRE([AC_PROG_MAKE_SET])dnl
+AC_REQUIRE([AM_SET_LEADING_DOT])dnl
+_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
+ [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
+ [_AM_PROG_TAR([v7])])])
+_AM_IF_OPTION([no-dependencies],,
+[AC_PROVIDE_IFELSE([AC_PROG_CC],
+ [_AM_DEPENDENCIES([CC])],
+ [m4_define([AC_PROG_CC],
+ m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl
+AC_PROVIDE_IFELSE([AC_PROG_CXX],
+ [_AM_DEPENDENCIES([CXX])],
+ [m4_define([AC_PROG_CXX],
+ m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl
+AC_PROVIDE_IFELSE([AC_PROG_OBJC],
+ [_AM_DEPENDENCIES([OBJC])],
+ [m4_define([AC_PROG_OBJC],
+ m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl
+AC_PROVIDE_IFELSE([AC_PROG_OBJCXX],
+ [_AM_DEPENDENCIES([OBJCXX])],
+ [m4_define([AC_PROG_OBJCXX],
+ m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl
+])
+AC_REQUIRE([AM_SILENT_RULES])dnl
+dnl The testsuite driver may need to know about EXEEXT, so add the
+dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This
+dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below.
+AC_CONFIG_COMMANDS_PRE(dnl
+[m4_provide_if([_AM_COMPILER_EXEEXT],
+ [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
+
+# POSIX will say in a future version that running "rm -f" with no argument
+# is OK; and we want to be able to make that assumption in our Makefile
+# recipes. So use an aggressive probe to check that the usage we want is
+# actually supported "in the wild" to an acceptable degree.
+# See automake bug#10828.
+# To make any issue more visible, cause the running configure to be aborted
+# by default if the 'rm' program in use doesn't match our expectations; the
+# user can still override this though.
+if rm -f && rm -fr && rm -rf; then : OK; else
+ cat >&2 <<'END'
+Oops!
+
+Your 'rm' program seems unable to run without file operands specified
+on the command line, even when the '-f' option is present. This is contrary
+to the behaviour of most rm programs out there, and not conforming with
+the upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542>
+
+Please tell bug-automake@gnu.org about your system, including the value
+of your $PATH and any error possibly output before this message. This
+can help us improve future automake versions.
+
+END
+ if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then
+ echo 'Configuration will proceed anyway, since you have set the' >&2
+ echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2
+ echo >&2
+ else
+ cat >&2 <<'END'
+Aborting the configuration process, to ensure you take notice of the issue.
+
+You can download and install GNU coreutils to get an 'rm' implementation
+that behaves properly: <http://www.gnu.org/software/coreutils/>.
+
+If you want to complete the configuration process using your problematic
+'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
+to "yes", and re-run configure.
+
+END
+ AC_MSG_ERROR([Your 'rm' program is bad, sorry.])
+ fi
+fi])
+
+dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not
+dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
+dnl mangled by Autoconf and run in a shell conditional statement.
+m4_define([_AC_COMPILER_EXEEXT],
+m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
+
+# When config.status generates a header, we must update the stamp-h file.
+# This file resides in the same directory as the config header
+# that is generated. The stamp files are numbered to have different names.
+
+# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
+# loop where config.status creates the headers, so we can generate
+# our stamp files there.
+AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
+[# Compute $1's index in $config_headers.
+_am_arg=$1
+_am_stamp_count=1
+for _am_header in $config_headers :; do
+ case $_am_header in
+ $_am_arg | $_am_arg:* )
+ break ;;
+ * )
+ _am_stamp_count=`expr $_am_stamp_count + 1` ;;
+ esac
+done
+echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
+
+# Copyright (C) 2001-2013 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_PROG_INSTALL_SH
+# ------------------
+# Define $install_sh.
+AC_DEFUN([AM_PROG_INSTALL_SH],
+[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+if test x"${install_sh}" != xset; then
+ case $am_aux_dir in
+ *\ * | *\ *)
+ install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
+ *)
+ install_sh="\${SHELL} $am_aux_dir/install-sh"
+ esac
+fi
+AC_SUBST([install_sh])])
+
+# Copyright (C) 2003-2013 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# Check whether the underlying file-system supports filenames
+# with a leading dot. For instance MS-DOS doesn't.
+AC_DEFUN([AM_SET_LEADING_DOT],
+[rm -rf .tst 2>/dev/null
+mkdir .tst 2>/dev/null
+if test -d .tst; then
+ am__leading_dot=.
+else
+ am__leading_dot=_
+fi
+rmdir .tst 2>/dev/null
+AC_SUBST([am__leading_dot])])
+
+# Add --enable-maintainer-mode option to configure. -*- Autoconf -*-
+# From Jim Meyering
+
+# Copyright (C) 1996-2013 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_MAINTAINER_MODE([DEFAULT-MODE])
+# ----------------------------------
+# Control maintainer-specific portions of Makefiles.
+# Default is to disable them, unless 'enable' is passed literally.
+# For symmetry, 'disable' may be passed as well. Anyway, the user
+# can override the default with the --enable/--disable switch.
+AC_DEFUN([AM_MAINTAINER_MODE],
+[m4_case(m4_default([$1], [disable]),
+ [enable], [m4_define([am_maintainer_other], [disable])],
+ [disable], [m4_define([am_maintainer_other], [enable])],
+ [m4_define([am_maintainer_other], [enable])
+ m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])])
+AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
+ dnl maintainer-mode's default is 'disable' unless 'enable' is passed
+ AC_ARG_ENABLE([maintainer-mode],
+ [AS_HELP_STRING([--]am_maintainer_other[-maintainer-mode],
+ am_maintainer_other[ make rules and dependencies not useful
+ (and sometimes confusing) to the casual installer])],
+ [USE_MAINTAINER_MODE=$enableval],
+ [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes]))
+ AC_MSG_RESULT([$USE_MAINTAINER_MODE])
+ AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes])
+ MAINT=$MAINTAINER_MODE_TRUE
+ AC_SUBST([MAINT])dnl
+]
+)
+
+# Check to see how 'make' treats includes. -*- Autoconf -*-
+
+# Copyright (C) 2001-2013 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_MAKE_INCLUDE()
+# -----------------
+# Check to see how make treats includes.
+AC_DEFUN([AM_MAKE_INCLUDE],
+[am_make=${MAKE-make}
+cat > confinc << 'END'
+am__doit:
+ @echo this is the am__doit target
+.PHONY: am__doit
+END
+# If we don't find an include directive, just comment out the code.
+AC_MSG_CHECKING([for style of include used by $am_make])
+am__include="#"
+am__quote=
+_am_result=none
+# First try GNU make style include.
+echo "include confinc" > confmf
+# Ignore all kinds of additional output from 'make'.
+case `$am_make -s -f confmf 2> /dev/null` in #(
+*the\ am__doit\ target*)
+ am__include=include
+ am__quote=
+ _am_result=GNU
+ ;;
+esac
+# Now try BSD make style include.
+if test "$am__include" = "#"; then
+ echo '.include "confinc"' > confmf
+ case `$am_make -s -f confmf 2> /dev/null` in #(
+ *the\ am__doit\ target*)
+ am__include=.include
+ am__quote="\""
+ _am_result=BSD
+ ;;
+ esac
+fi
+AC_SUBST([am__include])
+AC_SUBST([am__quote])
+AC_MSG_RESULT([$_am_result])
+rm -f confinc confmf
+])
+
+# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
+
+# Copyright (C) 1997-2013 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_MISSING_PROG(NAME, PROGRAM)
+# ------------------------------
+AC_DEFUN([AM_MISSING_PROG],
+[AC_REQUIRE([AM_MISSING_HAS_RUN])
+$1=${$1-"${am_missing_run}$2"}
+AC_SUBST($1)])
+
+# AM_MISSING_HAS_RUN
+# ------------------
+# Define MISSING if not defined so far and test if it is modern enough.
+# If it is, set am_missing_run to use it, otherwise, to nothing.
+AC_DEFUN([AM_MISSING_HAS_RUN],
+[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+AC_REQUIRE_AUX_FILE([missing])dnl
+if test x"${MISSING+set}" != xset; then
+ case $am_aux_dir in
+ *\ * | *\ *)
+ MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
+ *)
+ MISSING="\${SHELL} $am_aux_dir/missing" ;;
+ esac
+fi
+# Use eval to expand $SHELL
+if eval "$MISSING --is-lightweight"; then
+ am_missing_run="$MISSING "
+else
+ am_missing_run=
+ AC_MSG_WARN(['missing' script is too old or missing])
+fi
+])
+
+# Helper functions for option handling. -*- Autoconf -*-
+
+# Copyright (C) 2001-2013 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# _AM_MANGLE_OPTION(NAME)
+# -----------------------
+AC_DEFUN([_AM_MANGLE_OPTION],
+[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
+
+# _AM_SET_OPTION(NAME)
+# --------------------
+# Set option NAME. Presently that only means defining a flag for this option.
+AC_DEFUN([_AM_SET_OPTION],
+[m4_define(_AM_MANGLE_OPTION([$1]), [1])])
+
+# _AM_SET_OPTIONS(OPTIONS)
+# ------------------------
+# OPTIONS is a space-separated list of Automake options.
+AC_DEFUN([_AM_SET_OPTIONS],
+[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
+
+# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
+# -------------------------------------------
+# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
+AC_DEFUN([_AM_IF_OPTION],
+[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
+
+# Copyright (C) 1999-2013 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# _AM_PROG_CC_C_O
+# ---------------
+# Like AC_PROG_CC_C_O, but changed for automake. We rewrite AC_PROG_CC
+# to automatically call this.
+AC_DEFUN([_AM_PROG_CC_C_O],
+[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+AC_REQUIRE_AUX_FILE([compile])dnl
+AC_LANG_PUSH([C])dnl
+AC_CACHE_CHECK(
+ [whether $CC understands -c and -o together],
+ [am_cv_prog_cc_c_o],
+ [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])])
+ # Make sure it works both with $CC and with simple cc.
+ # Following AC_PROG_CC_C_O, we do the test twice because some
+ # compilers refuse to overwrite an existing .o file with -o,
+ # though they will create one.
+ am_cv_prog_cc_c_o=yes
+ for am_i in 1 2; do
+ if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \
+ && test -f conftest2.$ac_objext; then
+ : OK
+ else
+ am_cv_prog_cc_c_o=no
+ break
+ fi
+ done
+ rm -f core conftest*
+ unset am_i])
+if test "$am_cv_prog_cc_c_o" != yes; then
+ # Losing compiler, so override with the script.
+ # FIXME: It is wrong to rewrite CC.
+ # But if we don't then we get into trouble of one sort or another.
+ # A longer-term fix would be to have automake use am__CC in this case,
+ # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
+ CC="$am_aux_dir/compile $CC"
+fi
+AC_LANG_POP([C])])
+
+# For backward compatibility.
+AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])])
+
+# Copyright (C) 2001-2013 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_RUN_LOG(COMMAND)
+# -------------------
+# Run COMMAND, save the exit status in ac_status, and log it.
+# (This has been adapted from Autoconf's _AC_RUN_LOG macro.)
+AC_DEFUN([AM_RUN_LOG],
+[{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD
+ ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
+ (exit $ac_status); }])
+
+# Check to make sure that the build environment is sane. -*- Autoconf -*-
+
+# Copyright (C) 1996-2013 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_SANITY_CHECK
+# ---------------
+AC_DEFUN([AM_SANITY_CHECK],
+[AC_MSG_CHECKING([whether build environment is sane])
+# Reject unsafe characters in $srcdir or the absolute working directory
+# name. Accept space and tab only in the latter.
+am_lf='
+'
+case `pwd` in
+ *[[\\\"\#\$\&\'\`$am_lf]]*)
+ AC_MSG_ERROR([unsafe absolute working directory name]);;
+esac
+case $srcdir in
+ *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*)
+ AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);;
+esac
+
+# Do 'set' in a subshell so we don't clobber the current shell's
+# arguments. Must try -L first in case configure is actually a
+# symlink; some systems play weird games with the mod time of symlinks
+# (eg FreeBSD returns the mod time of the symlink's containing
+# directory).
+if (
+ am_has_slept=no
+ for am_try in 1 2; do
+ echo "timestamp, slept: $am_has_slept" > conftest.file
+ set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
+ if test "$[*]" = "X"; then
+ # -L didn't work.
+ set X `ls -t "$srcdir/configure" conftest.file`
+ fi
+ if test "$[*]" != "X $srcdir/configure conftest.file" \
+ && test "$[*]" != "X conftest.file $srcdir/configure"; then
+
+ # If neither matched, then we have a broken ls. This can happen
+ # if, for instance, CONFIG_SHELL is bash and it inherits a
+ # broken ls alias from the environment. This has actually
+ # happened. Such a system could not be considered "sane".
+ AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
+ alias in your environment])
+ fi
+ if test "$[2]" = conftest.file || test $am_try -eq 2; then
+ break
+ fi
+ # Just in case.
+ sleep 1
+ am_has_slept=yes
+ done
+ test "$[2]" = conftest.file
+ )
+then
+ # Ok.
+ :
+else
+ AC_MSG_ERROR([newly created file is older than distributed files!
+Check your system clock])
+fi
+AC_MSG_RESULT([yes])
+# If we didn't sleep, we still need to ensure time stamps of config.status and
+# generated files are strictly newer.
+am_sleep_pid=
+if grep 'slept: no' conftest.file >/dev/null 2>&1; then
+ ( sleep 1 ) &
+ am_sleep_pid=$!
+fi
+AC_CONFIG_COMMANDS_PRE(
+ [AC_MSG_CHECKING([that generated files are newer than configure])
+ if test -n "$am_sleep_pid"; then
+ # Hide warnings about reused PIDs.
+ wait $am_sleep_pid 2>/dev/null
+ fi
+ AC_MSG_RESULT([done])])
+rm -f conftest.file
+])
+
+# Copyright (C) 2009-2013 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_SILENT_RULES([DEFAULT])
+# --------------------------
+# Enable less verbose build rules; with the default set to DEFAULT
+# ("yes" being less verbose, "no" or empty being verbose).
+AC_DEFUN([AM_SILENT_RULES],
+[AC_ARG_ENABLE([silent-rules], [dnl
+AS_HELP_STRING(
+ [--enable-silent-rules],
+ [less verbose build output (undo: "make V=1")])
+AS_HELP_STRING(
+ [--disable-silent-rules],
+ [verbose build output (undo: "make V=0")])dnl
+])
+case $enable_silent_rules in @%:@ (((
+ yes) AM_DEFAULT_VERBOSITY=0;;
+ no) AM_DEFAULT_VERBOSITY=1;;
+ *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
+esac
+dnl
+dnl A few 'make' implementations (e.g., NonStop OS and NextStep)
+dnl do not support nested variable expansions.
+dnl See automake bug#9928 and bug#10237.
+am_make=${MAKE-make}
+AC_CACHE_CHECK([whether $am_make supports nested variables],
+ [am_cv_make_support_nested_variables],
+ [if AS_ECHO([['TRUE=$(BAR$(V))
+BAR0=false
+BAR1=true
+V=1
+am__doit:
+ @$(TRUE)
+.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then
+ am_cv_make_support_nested_variables=yes
+else
+ am_cv_make_support_nested_variables=no
+fi])
+if test $am_cv_make_support_nested_variables = yes; then
+ dnl Using '$V' instead of '$(V)' breaks IRIX make.
+ AM_V='$(V)'
+ AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
+else
+ AM_V=$AM_DEFAULT_VERBOSITY
+ AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
+fi
+AC_SUBST([AM_V])dnl
+AM_SUBST_NOTMAKE([AM_V])dnl
+AC_SUBST([AM_DEFAULT_V])dnl
+AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl
+AC_SUBST([AM_DEFAULT_VERBOSITY])dnl
+AM_BACKSLASH='\'
+AC_SUBST([AM_BACKSLASH])dnl
+_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
+])
+
+# Copyright (C) 2001-2013 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_PROG_INSTALL_STRIP
+# ---------------------
+# One issue with vendor 'install' (even GNU) is that you can't
+# specify the program used to strip binaries. This is especially
+# annoying in cross-compiling environments, where the build's strip
+# is unlikely to handle the host's binaries.
+# Fortunately install-sh will honor a STRIPPROG variable, so we
+# always use install-sh in "make install-strip", and initialize
+# STRIPPROG with the value of the STRIP variable (set by the user).
+AC_DEFUN([AM_PROG_INSTALL_STRIP],
+[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
+# Installed binaries are usually stripped using 'strip' when the user
+# run "make install-strip". However 'strip' might not be the right
+# tool to use in cross-compilation environments, therefore Automake
+# will honor the 'STRIP' environment variable to overrule this program.
+dnl Don't test for $cross_compiling = yes, because it might be 'maybe'.
+if test "$cross_compiling" != no; then
+ AC_CHECK_TOOL([STRIP], [strip], :)
+fi
+INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
+AC_SUBST([INSTALL_STRIP_PROGRAM])])
+
+# Copyright (C) 2006-2013 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# _AM_SUBST_NOTMAKE(VARIABLE)
+# ---------------------------
+# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
+# This macro is traced by Automake.
+AC_DEFUN([_AM_SUBST_NOTMAKE])
+
+# AM_SUBST_NOTMAKE(VARIABLE)
+# --------------------------
+# Public sister of _AM_SUBST_NOTMAKE.
+AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
+
+# Check how to create a tarball. -*- Autoconf -*-
+
+# Copyright (C) 2004-2013 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# _AM_PROG_TAR(FORMAT)
+# --------------------
+# Check how to create a tarball in format FORMAT.
+# FORMAT should be one of 'v7', 'ustar', or 'pax'.
+#
+# Substitute a variable $(am__tar) that is a command
+# writing to stdout a FORMAT-tarball containing the directory
+# $tardir.
+# tardir=directory && $(am__tar) > result.tar
+#
+# Substitute a variable $(am__untar) that extract such
+# a tarball read from stdin.
+# $(am__untar) < result.tar
+#
+AC_DEFUN([_AM_PROG_TAR],
+[# Always define AMTAR for backward compatibility. Yes, it's still used
+# in the wild :-( We should find a proper way to deprecate it ...
+AC_SUBST([AMTAR], ['$${TAR-tar}'])
+
+# We'll loop over all known methods to create a tar archive until one works.
+_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
+
+m4_if([$1], [v7],
+ [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'],
+
+ [m4_case([$1],
+ [ustar],
+ [# The POSIX 1988 'ustar' format is defined with fixed-size fields.
+ # There is notably a 21 bits limit for the UID and the GID. In fact,
+ # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343
+ # and bug#13588).
+ am_max_uid=2097151 # 2^21 - 1
+ am_max_gid=$am_max_uid
+ # The $UID and $GID variables are not portable, so we need to resort
+ # to the POSIX-mandated id(1) utility. Errors in the 'id' calls
+ # below are definitely unexpected, so allow the users to see them
+ # (that is, avoid stderr redirection).
+ am_uid=`id -u || echo unknown`
+ am_gid=`id -g || echo unknown`
+ AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format])
+ if test $am_uid -le $am_max_uid; then
+ AC_MSG_RESULT([yes])
+ else
+ AC_MSG_RESULT([no])
+ _am_tools=none
+ fi
+ AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format])
+ if test $am_gid -le $am_max_gid; then
+ AC_MSG_RESULT([yes])
+ else
+ AC_MSG_RESULT([no])
+ _am_tools=none
+ fi],
+
+ [pax],
+ [],
+
+ [m4_fatal([Unknown tar format])])
+
+ AC_MSG_CHECKING([how to create a $1 tar archive])
+
+ # Go ahead even if we have the value already cached. We do so because we
+ # need to set the values for the 'am__tar' and 'am__untar' variables.
+ _am_tools=${am_cv_prog_tar_$1-$_am_tools}
+
+ for _am_tool in $_am_tools; do
+ case $_am_tool in
+ gnutar)
+ for _am_tar in tar gnutar gtar; do
+ AM_RUN_LOG([$_am_tar --version]) && break
+ done
+ am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
+ am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
+ am__untar="$_am_tar -xf -"
+ ;;
+ plaintar)
+ # Must skip GNU tar: if it does not support --format= it doesn't create
+ # ustar tarball either.
+ (tar --version) >/dev/null 2>&1 && continue
+ am__tar='tar chf - "$$tardir"'
+ am__tar_='tar chf - "$tardir"'
+ am__untar='tar xf -'
+ ;;
+ pax)
+ am__tar='pax -L -x $1 -w "$$tardir"'
+ am__tar_='pax -L -x $1 -w "$tardir"'
+ am__untar='pax -r'
+ ;;
+ cpio)
+ am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
+ am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
+ am__untar='cpio -i -H $1 -d'
+ ;;
+ none)
+ am__tar=false
+ am__tar_=false
+ am__untar=false
+ ;;
+ esac
+
+ # If the value was cached, stop now. We just wanted to have am__tar
+ # and am__untar set.
+ test -n "${am_cv_prog_tar_$1}" && break
+
+ # tar/untar a dummy directory, and stop if the command works.
+ rm -rf conftest.dir
+ mkdir conftest.dir
+ echo GrepMe > conftest.dir/file
+ AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
+ rm -rf conftest.dir
+ if test -s conftest.tar; then
+ AM_RUN_LOG([$am__untar <conftest.tar])
+ AM_RUN_LOG([cat conftest.dir/file])
+ grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
+ fi
+ done
+ rm -rf conftest.dir
+
+ AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
+ AC_MSG_RESULT([$am_cv_prog_tar_$1])])
+
+AC_SUBST([am__tar])
+AC_SUBST([am__untar])
+]) # _AM_PROG_TAR
+
+m4_include([m4/gmp-alloca.m4])
+m4_include([m4/gmp-attribute.m4])
+m4_include([m4/gmp-double-format.m4])
+m4_include([../../m4/kpse-common.m4])
+m4_include([../../m4/kpse-warnings.m4])
diff --git a/Build/source/libs/gmp/config.h.in b/Build/source/libs/gmp/config.h.in
new file mode 100644
index 00000000000..8f962e1eb09
--- /dev/null
+++ b/Build/source/libs/gmp/config.h.in
@@ -0,0 +1,118 @@
+/* config.h.in. Generated from configure.ac by autoheader. */
+
+/* Define to 1 if alloca() works (via gmp-impl.h). */
+#undef HAVE_ALLOCA
+
+/* Define to 1 if you have <alloca.h> and it should be used (not on Ultrix).
+ */
+#undef HAVE_ALLOCA_H
+
+/* Define to 1 if the compiler accepts gcc style __attribute__ ((const)) */
+#undef HAVE_ATTRIBUTE_CONST
+
+/* Define to 1 if the compiler accepts gcc style __attribute__ ((malloc)) */
+#undef HAVE_ATTRIBUTE_MALLOC
+
+/* Define to 1 if the compiler accepts gcc style __attribute__ ((mode (XX)))
+ */
+#undef HAVE_ATTRIBUTE_MODE
+
+/* Define to 1 if the compiler accepts gcc style __attribute__ ((noreturn)) */
+#undef HAVE_ATTRIBUTE_NORETURN
+
+/* Define one of the following to 1 for the format of a `double'.
+ If your format is not among these choices, or you don't know what it is,
+ then leave all undefined.
+ IEEE_LITTLE_SWAPPED means little endian, but with the two 4-byte halves
+ swapped, as used by ARM CPUs in little endian mode. */
+#undef HAVE_DOUBLE_IEEE_BIG_ENDIAN
+#undef HAVE_DOUBLE_IEEE_LITTLE_ENDIAN
+#undef HAVE_DOUBLE_IEEE_LITTLE_SWAPPED
+#undef HAVE_DOUBLE_VAX_D
+#undef HAVE_DOUBLE_VAX_G
+#undef HAVE_DOUBLE_CRAY_CFP
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#undef HAVE_INTTYPES_H
+
+/* Define to 1 if you have the <memory.h> header file. */
+#undef HAVE_MEMORY_H
+
+/* Define to 1 if you have the `memset' function. */
+#undef HAVE_MEMSET
+
+/* Define to 1 if you have the `raise' function. */
+#undef HAVE_RAISE
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#undef HAVE_STDINT_H
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#undef HAVE_STDLIB_H
+
+/* Define to 1 if you have the `strchr' function. */
+#undef HAVE_STRCHR
+
+/* Define to 1 if you have the <strings.h> header file. */
+#undef HAVE_STRINGS_H
+
+/* Define to 1 if you have the <string.h> header file. */
+#undef HAVE_STRING_H
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#undef HAVE_SYS_STAT_H
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#undef HAVE_SYS_TYPES_H
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#undef HAVE_UNISTD_H
+
+/* Name of package */
+#undef PACKAGE
+
+/* Define to the address where bug reports for this package should be sent. */
+#undef PACKAGE_BUGREPORT
+
+/* Define to the full name of this package. */
+#undef PACKAGE_NAME
+
+/* Define to the full name and version of this package. */
+#undef PACKAGE_STRING
+
+/* Define to the one symbol short name of this package. */
+#undef PACKAGE_TARNAME
+
+/* Define to the home page for this package. */
+#undef PACKAGE_URL
+
+/* Define to the version of this package. */
+#undef PACKAGE_VERSION
+
+/* The size of `mp_limb_t', as computed by sizeof. */
+#undef SIZEOF_MP_LIMB_T
+
+/* The size of `unsigned', as computed by sizeof. */
+#undef SIZEOF_UNSIGNED
+
+/* The size of `unsigned long', as computed by sizeof. */
+#undef SIZEOF_UNSIGNED_LONG
+
+/* The size of `unsigned long long', as computed by sizeof. */
+#undef SIZEOF_UNSIGNED_LONG_LONG
+
+/* The size of `unsigned short', as computed by sizeof. */
+#undef SIZEOF_UNSIGNED_SHORT
+
+/* The size of `void *', as computed by sizeof. */
+#undef SIZEOF_VOID_P
+
+/* Define to 1 if you have the ANSI C header files. */
+#undef STDC_HEADERS
+
+/* Version number of package */
+#undef VERSION
+
+/* Define one of these to 1 for the temporary memory allocation method. */
+#undef WANT_TMP_ALLOCA
+#undef WANT_TMP_REENTRANT
diff --git a/Build/source/libs/gmp/configure b/Build/source/libs/gmp/configure
new file mode 100755
index 00000000000..986e461c85f
--- /dev/null
+++ b/Build/source/libs/gmp/configure
@@ -0,0 +1,7954 @@
+#! /bin/sh
+# Guess values for system-dependent variables and create Makefiles.
+# Generated by GNU Autoconf 2.69 for gmp (TeX Live) 6.0.0.
+#
+# Report bugs to <tex-k@tug.org>.
+#
+#
+# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
+#
+#
+# This configure script is free software; the Free Software Foundation
+# gives unlimited permission to copy, distribute and modify it.
+## -------------------- ##
+## M4sh Initialization. ##
+## -------------------- ##
+
+# Be more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
+ emulate sh
+ NULLCMD=:
+ # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '${1+"$@"}'='"$@"'
+ setopt NO_GLOB_SUBST
+else
+ case `(set -o) 2>/dev/null` in #(
+ *posix*) :
+ set -o posix ;; #(
+ *) :
+ ;;
+esac
+fi
+
+
+as_nl='
+'
+export as_nl
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+# Prefer a ksh shell builtin over an external printf program on Solaris,
+# but without wasting forks for bash or zsh.
+if test -z "$BASH_VERSION$ZSH_VERSION" \
+ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
+ as_echo='print -r --'
+ as_echo_n='print -rn --'
+elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+ as_echo='printf %s\n'
+ as_echo_n='printf %s'
+else
+ if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+ as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
+ as_echo_n='/usr/ucb/echo -n'
+ else
+ as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+ as_echo_n_body='eval
+ arg=$1;
+ case $arg in #(
+ *"$as_nl"*)
+ expr "X$arg" : "X\\(.*\\)$as_nl";
+ arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+ esac;
+ expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+ '
+ export as_echo_n_body
+ as_echo_n='sh -c $as_echo_n_body as_echo'
+ fi
+ export as_echo_body
+ as_echo='sh -c $as_echo_body as_echo'
+fi
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+ PATH_SEPARATOR=:
+ (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
+ (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
+ PATH_SEPARATOR=';'
+ }
+fi
+
+
+# IFS
+# We need space, tab and new line, in precisely that order. Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+IFS=" "" $as_nl"
+
+# Find who we are. Look in the path if we contain no directory separator.
+as_myself=
+case $0 in #((
+ *[\\/]* ) as_myself=$0 ;;
+ *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+ done
+IFS=$as_save_IFS
+
+ ;;
+esac
+# We did not find ourselves, most probably we were run as `sh COMMAND'
+# in which case we are not to be found in the path.
+if test "x$as_myself" = x; then
+ as_myself=$0
+fi
+if test ! -f "$as_myself"; then
+ $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+ exit 1
+fi
+
+# Unset variables that we do not need and which cause bugs (e.g. in
+# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1"
+# suppresses any "Segmentation fault" message there. '((' could
+# trigger a bug in pdksh 5.2.14.
+for as_var in BASH_ENV ENV MAIL MAILPATH
+do eval test x\${$as_var+set} = xset \
+ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
+done
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
+
+# CDPATH.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+# Use a proper internal environment variable to ensure we don't fall
+ # into an infinite loop, continuously re-executing ourselves.
+ if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then
+ _as_can_reexec=no; export _as_can_reexec;
+ # We cannot yet assume a decent shell, so we have to provide a
+# neutralization value for shells without unset; and this also
+# works around shells that cannot unset nonexistent variables.
+# Preserve -v and -x to the replacement shell.
+BASH_ENV=/dev/null
+ENV=/dev/null
+(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
+case $- in # ((((
+ *v*x* | *x*v* ) as_opts=-vx ;;
+ *v* ) as_opts=-v ;;
+ *x* ) as_opts=-x ;;
+ * ) as_opts= ;;
+esac
+exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
+# Admittedly, this is quite paranoid, since all the known shells bail
+# out after a failed `exec'.
+$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
+as_fn_exit 255
+ fi
+ # We don't want this to propagate to other subprocesses.
+ { _as_can_reexec=; unset _as_can_reexec;}
+if test "x$CONFIG_SHELL" = x; then
+ as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then :
+ emulate sh
+ NULLCMD=:
+ # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '\${1+\"\$@\"}'='\"\$@\"'
+ setopt NO_GLOB_SUBST
+else
+ case \`(set -o) 2>/dev/null\` in #(
+ *posix*) :
+ set -o posix ;; #(
+ *) :
+ ;;
+esac
+fi
+"
+ as_required="as_fn_return () { (exit \$1); }
+as_fn_success () { as_fn_return 0; }
+as_fn_failure () { as_fn_return 1; }
+as_fn_ret_success () { return 0; }
+as_fn_ret_failure () { return 1; }
+
+exitcode=0
+as_fn_success || { exitcode=1; echo as_fn_success failed.; }
+as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; }
+as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; }
+as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; }
+if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then :
+
+else
+ exitcode=1; echo positional parameters were not saved.
+fi
+test x\$exitcode = x0 || exit 1
+test -x / || exit 1"
+ as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO
+ as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO
+ eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" &&
+ test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1
+test \$(( 1 + 1 )) = 2 || exit 1"
+ if (eval "$as_required") 2>/dev/null; then :
+ as_have_required=yes
+else
+ as_have_required=no
+fi
+ if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then :
+
+else
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+as_found=false
+for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ as_found=:
+ case $as_dir in #(
+ /*)
+ for as_base in sh bash ksh sh5; do
+ # Try only shells that exist, to save several forks.
+ as_shell=$as_dir/$as_base
+ if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
+ { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then :
+ CONFIG_SHELL=$as_shell as_have_required=yes
+ if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then :
+ break 2
+fi
+fi
+ done;;
+ esac
+ as_found=false
+done
+$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } &&
+ { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then :
+ CONFIG_SHELL=$SHELL as_have_required=yes
+fi; }
+IFS=$as_save_IFS
+
+
+ if test "x$CONFIG_SHELL" != x; then :
+ export CONFIG_SHELL
+ # We cannot yet assume a decent shell, so we have to provide a
+# neutralization value for shells without unset; and this also
+# works around shells that cannot unset nonexistent variables.
+# Preserve -v and -x to the replacement shell.
+BASH_ENV=/dev/null
+ENV=/dev/null
+(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
+case $- in # ((((
+ *v*x* | *x*v* ) as_opts=-vx ;;
+ *v* ) as_opts=-v ;;
+ *x* ) as_opts=-x ;;
+ * ) as_opts= ;;
+esac
+exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
+# Admittedly, this is quite paranoid, since all the known shells bail
+# out after a failed `exec'.
+$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
+exit 255
+fi
+
+ if test x$as_have_required = xno; then :
+ $as_echo "$0: This script requires a shell more modern than all"
+ $as_echo "$0: the shells that I found on your system."
+ if test x${ZSH_VERSION+set} = xset ; then
+ $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should"
+ $as_echo "$0: be upgraded to zsh 4.3.4 or later."
+ else
+ $as_echo "$0: Please tell bug-autoconf@gnu.org and tex-k@tug.org
+$0: about your system, including any error possibly output
+$0: before this message. Then install a modern shell, or
+$0: manually run the script under such a shell if you do
+$0: have one."
+ fi
+ exit 1
+fi
+fi
+fi
+SHELL=${CONFIG_SHELL-/bin/sh}
+export SHELL
+# Unset more variables known to interfere with behavior of common tools.
+CLICOLOR_FORCE= GREP_OPTIONS=
+unset CLICOLOR_FORCE GREP_OPTIONS
+
+## --------------------- ##
+## M4sh Shell Functions. ##
+## --------------------- ##
+# as_fn_unset VAR
+# ---------------
+# Portably unset VAR.
+as_fn_unset ()
+{
+ { eval $1=; unset $1;}
+}
+as_unset=as_fn_unset
+
+# as_fn_set_status STATUS
+# -----------------------
+# Set $? to STATUS, without forking.
+as_fn_set_status ()
+{
+ return $1
+} # as_fn_set_status
+
+# as_fn_exit STATUS
+# -----------------
+# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
+as_fn_exit ()
+{
+ set +e
+ as_fn_set_status $1
+ exit $1
+} # as_fn_exit
+
+# as_fn_mkdir_p
+# -------------
+# Create "$as_dir" as a directory, including parents if necessary.
+as_fn_mkdir_p ()
+{
+
+ case $as_dir in #(
+ -*) as_dir=./$as_dir;;
+ esac
+ test -d "$as_dir" || eval $as_mkdir_p || {
+ as_dirs=
+ while :; do
+ case $as_dir in #(
+ *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+ *) as_qdir=$as_dir;;
+ esac
+ as_dirs="'$as_qdir' $as_dirs"
+ as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$as_dir" : 'X\(//\)[^/]' \| \
+ X"$as_dir" : 'X\(//\)$' \| \
+ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_dir" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ test -d "$as_dir" && break
+ done
+ test -z "$as_dirs" || eval "mkdir $as_dirs"
+ } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
+
+
+} # as_fn_mkdir_p
+
+# as_fn_executable_p FILE
+# -----------------------
+# Test if FILE is an executable regular file.
+as_fn_executable_p ()
+{
+ test -f "$1" && test -x "$1"
+} # as_fn_executable_p
+# as_fn_append VAR VALUE
+# ----------------------
+# Append the text in VALUE to the end of the definition contained in VAR. Take
+# advantage of any shell optimizations that allow amortized linear growth over
+# repeated appends, instead of the typical quadratic growth present in naive
+# implementations.
+if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
+ eval 'as_fn_append ()
+ {
+ eval $1+=\$2
+ }'
+else
+ as_fn_append ()
+ {
+ eval $1=\$$1\$2
+ }
+fi # as_fn_append
+
+# as_fn_arith ARG...
+# ------------------
+# Perform arithmetic evaluation on the ARGs, and store the result in the
+# global $as_val. Take advantage of shells that can avoid forks. The arguments
+# must be portable across $(()) and expr.
+if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
+ eval 'as_fn_arith ()
+ {
+ as_val=$(( $* ))
+ }'
+else
+ as_fn_arith ()
+ {
+ as_val=`expr "$@" || test $? -eq 1`
+ }
+fi # as_fn_arith
+
+
+# as_fn_error STATUS ERROR [LINENO LOG_FD]
+# ----------------------------------------
+# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
+# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
+# script with STATUS, using 1 if that was 0.
+as_fn_error ()
+{
+ as_status=$1; test $as_status -eq 0 && as_status=1
+ if test "$4"; then
+ as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
+ fi
+ $as_echo "$as_me: error: $2" >&2
+ as_fn_exit $as_status
+} # as_fn_error
+
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+ test "X`expr 00001 : '.*\(...\)'`" = X001; then
+ as_expr=expr
+else
+ as_expr=false
+fi
+
+if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
+ as_basename=basename
+else
+ as_basename=false
+fi
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+ as_dirname=dirname
+else
+ as_dirname=false
+fi
+
+as_me=`$as_basename -- "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+ X"$0" : 'X\(//\)$' \| \
+ X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X/"$0" |
+ sed '/^.*\/\([^/][^/]*\)\/*$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+
+ as_lineno_1=$LINENO as_lineno_1a=$LINENO
+ as_lineno_2=$LINENO as_lineno_2a=$LINENO
+ eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" &&
+ test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || {
+ # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-)
+ sed -n '
+ p
+ /[$]LINENO/=
+ ' <$as_myself |
+ sed '
+ s/[$]LINENO.*/&-/
+ t lineno
+ b
+ :lineno
+ N
+ :loop
+ s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
+ t loop
+ s/-\n.*//
+ ' >$as_me.lineno &&
+ chmod +x "$as_me.lineno" ||
+ { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }
+
+ # If we had to re-execute with $CONFIG_SHELL, we're ensured to have
+ # already done that, so ensure we don't try to do so again and fall
+ # in an infinite loop. This has already happened in practice.
+ _as_can_reexec=no; export _as_can_reexec
+ # Don't try to exec as it changes $[0], causing all sort of problems
+ # (the dirname of $[0] is not the place where we might find the
+ # original and so on. Autoconf is especially sensitive to this).
+ . "./$as_me.lineno"
+ # Exit status is that of the last command.
+ exit
+}
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in #(((((
+-n*)
+ case `echo 'xy\c'` in
+ *c*) ECHO_T=' ';; # ECHO_T is single tab character.
+ xy) ECHO_C='\c';;
+ *) echo `echo ksh88 bug on AIX 6.1` > /dev/null
+ ECHO_T=' ';;
+ esac;;
+*)
+ ECHO_N='-n';;
+esac
+
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+ rm -f conf$$.dir/conf$$.file
+else
+ rm -f conf$$.dir
+ mkdir conf$$.dir 2>/dev/null
+fi
+if (echo >conf$$.file) 2>/dev/null; then
+ if ln -s conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s='ln -s'
+ # ... but there are two gotchas:
+ # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+ # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+ # In both cases, we have to default to `cp -pR'.
+ ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+ as_ln_s='cp -pR'
+ elif ln conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s=ln
+ else
+ as_ln_s='cp -pR'
+ fi
+else
+ as_ln_s='cp -pR'
+fi
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+if mkdir -p . 2>/dev/null; then
+ as_mkdir_p='mkdir -p "$as_dir"'
+else
+ test -d ./-p && rmdir ./-p
+ as_mkdir_p=false
+fi
+
+as_test_x='test -x'
+as_executable_p=as_fn_executable_p
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+
+test -n "$DJDIR" || exec 7<&0 </dev/null
+exec 6>&1
+
+# Name of the host.
+# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status,
+# so uname gets run too.
+ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
+
+#
+# Initializations.
+#
+ac_default_prefix=/usr/local
+ac_clean_files=
+ac_config_libobj_dir=.
+LIBOBJS=
+cross_compiling=no
+subdirs=
+MFLAGS=
+MAKEFLAGS=
+
+# Identity of this package.
+PACKAGE_NAME='gmp (TeX Live)'
+PACKAGE_TARNAME='gmp--tex-live-'
+PACKAGE_VERSION='6.0.0'
+PACKAGE_STRING='gmp (TeX Live) 6.0.0'
+PACKAGE_BUGREPORT='tex-k@tug.org'
+PACKAGE_URL=''
+
+ac_unique_file="gmp-6.0.0/gmp-impl.h"
+# Factoring default headers for most tests.
+ac_includes_default="\
+#include <stdio.h>
+#ifdef HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_STAT_H
+# include <sys/stat.h>
+#endif
+#ifdef STDC_HEADERS
+# include <stdlib.h>
+# include <stddef.h>
+#else
+# ifdef HAVE_STDLIB_H
+# include <stdlib.h>
+# endif
+#endif
+#ifdef HAVE_STRING_H
+# if !defined STDC_HEADERS && defined HAVE_MEMORY_H
+# include <memory.h>
+# endif
+# include <string.h>
+#endif
+#ifdef HAVE_STRINGS_H
+# include <strings.h>
+#endif
+#ifdef HAVE_INTTYPES_H
+# include <inttypes.h>
+#endif
+#ifdef HAVE_STDINT_H
+# include <stdint.h>
+#endif
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif"
+
+enable_option_checking=no
+ac_subst_vars='am__EXEEXT_FALSE
+am__EXEEXT_TRUE
+LTLIBOBJS
+LIBOBJS
+subdirs
+LIBGMP_DLL
+HAVE_HOST_CPU_FAMILY_powerpc
+HAVE_HOST_CPU_FAMILY_power
+GMP_TREE
+build_FALSE
+build_TRUE
+GMP_NAIL_BITS
+GMP_LIMB_BITS
+DEFN_LONG_LONG_LIMB
+EGREP
+GREP
+CPP
+host_os
+host_vendor
+host_cpu
+host
+build_os
+build_vendor
+build_cpu
+build
+LN_S
+RANLIB
+WARNING_CFLAGS
+am__fastdepCC_FALSE
+am__fastdepCC_TRUE
+CCDEPMODE
+am__nodep
+AMDEPBACKSLASH
+AMDEP_FALSE
+AMDEP_TRUE
+am__quote
+am__include
+DEPDIR
+OBJEXT
+EXEEXT
+ac_ct_CC
+CPPFLAGS
+LDFLAGS
+CFLAGS
+CC
+MAINT
+MAINTAINER_MODE_FALSE
+MAINTAINER_MODE_TRUE
+AM_BACKSLASH
+AM_DEFAULT_VERBOSITY
+AM_DEFAULT_V
+AM_V
+am__untar
+am__tar
+AMTAR
+am__leading_dot
+SET_MAKE
+AWK
+mkdir_p
+MKDIR_P
+INSTALL_STRIP_PROGRAM
+STRIP
+install_sh
+MAKEINFO
+AUTOHEADER
+AUTOMAKE
+AUTOCONF
+ACLOCAL
+VERSION
+PACKAGE
+CYGPATH_W
+am__isrc
+INSTALL_DATA
+INSTALL_SCRIPT
+INSTALL_PROGRAM
+target_alias
+host_alias
+build_alias
+LIBS
+ECHO_T
+ECHO_N
+ECHO_C
+DEFS
+mandir
+localedir
+libdir
+psdir
+pdfdir
+dvidir
+htmldir
+infodir
+docdir
+oldincludedir
+includedir
+localstatedir
+sharedstatedir
+sysconfdir
+datadir
+datarootdir
+libexecdir
+sbindir
+bindir
+program_transform_name
+prefix
+exec_prefix
+PACKAGE_URL
+PACKAGE_BUGREPORT
+PACKAGE_STRING
+PACKAGE_VERSION
+PACKAGE_TARNAME
+PACKAGE_NAME
+PATH_SEPARATOR
+SHELL'
+ac_subst_files=''
+ac_user_opts='
+enable_option_checking
+enable_silent_rules
+enable_maintainer_mode
+enable_dependency_tracking
+enable_compiler_warnings
+'
+ ac_precious_vars='build_alias
+host_alias
+target_alias
+CC
+CFLAGS
+LDFLAGS
+LIBS
+CPPFLAGS
+CPP'
+ac_subdirs_all='native'
+
+# Initialize some variables set by options.
+ac_init_help=
+ac_init_version=false
+ac_unrecognized_opts=
+ac_unrecognized_sep=
+# The variables have the same names as the options, with
+# dashes changed to underlines.
+cache_file=/dev/null
+exec_prefix=NONE
+no_create=
+no_recursion=
+prefix=NONE
+program_prefix=NONE
+program_suffix=NONE
+program_transform_name=s,x,x,
+silent=
+site=
+srcdir=
+verbose=
+x_includes=NONE
+x_libraries=NONE
+
+# Installation directory options.
+# These are left unexpanded so users can "make install exec_prefix=/foo"
+# and all the variables that are supposed to be based on exec_prefix
+# by default will actually change.
+# Use braces instead of parens because sh, perl, etc. also accept them.
+# (The list follows the same order as the GNU Coding Standards.)
+bindir='${exec_prefix}/bin'
+sbindir='${exec_prefix}/sbin'
+libexecdir='${exec_prefix}/libexec'
+datarootdir='${prefix}/share'
+datadir='${datarootdir}'
+sysconfdir='${prefix}/etc'
+sharedstatedir='${prefix}/com'
+localstatedir='${prefix}/var'
+includedir='${prefix}/include'
+oldincludedir='/usr/include'
+docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
+infodir='${datarootdir}/info'
+htmldir='${docdir}'
+dvidir='${docdir}'
+pdfdir='${docdir}'
+psdir='${docdir}'
+libdir='${exec_prefix}/lib'
+localedir='${datarootdir}/locale'
+mandir='${datarootdir}/man'
+
+ac_prev=
+ac_dashdash=
+for ac_option
+do
+ # If the previous option needs an argument, assign it.
+ if test -n "$ac_prev"; then
+ eval $ac_prev=\$ac_option
+ ac_prev=
+ continue
+ fi
+
+ case $ac_option in
+ *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
+ *=) ac_optarg= ;;
+ *) ac_optarg=yes ;;
+ esac
+
+ # Accept the important Cygnus configure options, so we can diagnose typos.
+
+ case $ac_dashdash$ac_option in
+ --)
+ ac_dashdash=yes ;;
+
+ -bindir | --bindir | --bindi | --bind | --bin | --bi)
+ ac_prev=bindir ;;
+ -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
+ bindir=$ac_optarg ;;
+
+ -build | --build | --buil | --bui | --bu)
+ ac_prev=build_alias ;;
+ -build=* | --build=* | --buil=* | --bui=* | --bu=*)
+ build_alias=$ac_optarg ;;
+
+ -cache-file | --cache-file | --cache-fil | --cache-fi \
+ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
+ ac_prev=cache_file ;;
+ -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
+ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
+ cache_file=$ac_optarg ;;
+
+ --config-cache | -C)
+ cache_file=config.cache ;;
+
+ -datadir | --datadir | --datadi | --datad)
+ ac_prev=datadir ;;
+ -datadir=* | --datadir=* | --datadi=* | --datad=*)
+ datadir=$ac_optarg ;;
+
+ -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
+ | --dataroo | --dataro | --datar)
+ ac_prev=datarootdir ;;
+ -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
+ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
+ datarootdir=$ac_optarg ;;
+
+ -disable-* | --disable-*)
+ ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+ as_fn_error $? "invalid feature name: $ac_useropt"
+ ac_useropt_orig=$ac_useropt
+ ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+ case $ac_user_opts in
+ *"
+"enable_$ac_useropt"
+"*) ;;
+ *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig"
+ ac_unrecognized_sep=', ';;
+ esac
+ eval enable_$ac_useropt=no ;;
+
+ -docdir | --docdir | --docdi | --doc | --do)
+ ac_prev=docdir ;;
+ -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)
+ docdir=$ac_optarg ;;
+
+ -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
+ ac_prev=dvidir ;;
+ -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)
+ dvidir=$ac_optarg ;;
+
+ -enable-* | --enable-*)
+ ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+ as_fn_error $? "invalid feature name: $ac_useropt"
+ ac_useropt_orig=$ac_useropt
+ ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+ case $ac_user_opts in
+ *"
+"enable_$ac_useropt"
+"*) ;;
+ *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig"
+ ac_unrecognized_sep=', ';;
+ esac
+ eval enable_$ac_useropt=\$ac_optarg ;;
+
+ -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
+ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
+ | --exec | --exe | --ex)
+ ac_prev=exec_prefix ;;
+ -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
+ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
+ | --exec=* | --exe=* | --ex=*)
+ exec_prefix=$ac_optarg ;;
+
+ -gas | --gas | --ga | --g)
+ # Obsolete; use --with-gas.
+ with_gas=yes ;;
+
+ -help | --help | --hel | --he | -h)
+ ac_init_help=long ;;
+ -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
+ ac_init_help=recursive ;;
+ -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
+ ac_init_help=short ;;
+
+ -host | --host | --hos | --ho)
+ ac_prev=host_alias ;;
+ -host=* | --host=* | --hos=* | --ho=*)
+ host_alias=$ac_optarg ;;
+
+ -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)
+ ac_prev=htmldir ;;
+ -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \
+ | --ht=*)
+ htmldir=$ac_optarg ;;
+
+ -includedir | --includedir | --includedi | --included | --include \
+ | --includ | --inclu | --incl | --inc)
+ ac_prev=includedir ;;
+ -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
+ | --includ=* | --inclu=* | --incl=* | --inc=*)
+ includedir=$ac_optarg ;;
+
+ -infodir | --infodir | --infodi | --infod | --info | --inf)
+ ac_prev=infodir ;;
+ -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
+ infodir=$ac_optarg ;;
+
+ -libdir | --libdir | --libdi | --libd)
+ ac_prev=libdir ;;
+ -libdir=* | --libdir=* | --libdi=* | --libd=*)
+ libdir=$ac_optarg ;;
+
+ -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
+ | --libexe | --libex | --libe)
+ ac_prev=libexecdir ;;
+ -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
+ | --libexe=* | --libex=* | --libe=*)
+ libexecdir=$ac_optarg ;;
+
+ -localedir | --localedir | --localedi | --localed | --locale)
+ ac_prev=localedir ;;
+ -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)
+ localedir=$ac_optarg ;;
+
+ -localstatedir | --localstatedir | --localstatedi | --localstated \
+ | --localstate | --localstat | --localsta | --localst | --locals)
+ ac_prev=localstatedir ;;
+ -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
+ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)
+ localstatedir=$ac_optarg ;;
+
+ -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
+ ac_prev=mandir ;;
+ -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
+ mandir=$ac_optarg ;;
+
+ -nfp | --nfp | --nf)
+ # Obsolete; use --without-fp.
+ with_fp=no ;;
+
+ -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+ | --no-cr | --no-c | -n)
+ no_create=yes ;;
+
+ -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
+ no_recursion=yes ;;
+
+ -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
+ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
+ | --oldin | --oldi | --old | --ol | --o)
+ ac_prev=oldincludedir ;;
+ -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
+ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
+ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
+ oldincludedir=$ac_optarg ;;
+
+ -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
+ ac_prev=prefix ;;
+ -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
+ prefix=$ac_optarg ;;
+
+ -program-prefix | --program-prefix | --program-prefi | --program-pref \
+ | --program-pre | --program-pr | --program-p)
+ ac_prev=program_prefix ;;
+ -program-prefix=* | --program-prefix=* | --program-prefi=* \
+ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
+ program_prefix=$ac_optarg ;;
+
+ -program-suffix | --program-suffix | --program-suffi | --program-suff \
+ | --program-suf | --program-su | --program-s)
+ ac_prev=program_suffix ;;
+ -program-suffix=* | --program-suffix=* | --program-suffi=* \
+ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
+ program_suffix=$ac_optarg ;;
+
+ -program-transform-name | --program-transform-name \
+ | --program-transform-nam | --program-transform-na \
+ | --program-transform-n | --program-transform- \
+ | --program-transform | --program-transfor \
+ | --program-transfo | --program-transf \
+ | --program-trans | --program-tran \
+ | --progr-tra | --program-tr | --program-t)
+ ac_prev=program_transform_name ;;
+ -program-transform-name=* | --program-transform-name=* \
+ | --program-transform-nam=* | --program-transform-na=* \
+ | --program-transform-n=* | --program-transform-=* \
+ | --program-transform=* | --program-transfor=* \
+ | --program-transfo=* | --program-transf=* \
+ | --program-trans=* | --program-tran=* \
+ | --progr-tra=* | --program-tr=* | --program-t=*)
+ program_transform_name=$ac_optarg ;;
+
+ -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)
+ ac_prev=pdfdir ;;
+ -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)
+ pdfdir=$ac_optarg ;;
+
+ -psdir | --psdir | --psdi | --psd | --ps)
+ ac_prev=psdir ;;
+ -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)
+ psdir=$ac_optarg ;;
+
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil)
+ silent=yes ;;
+
+ -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
+ ac_prev=sbindir ;;
+ -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
+ | --sbi=* | --sb=*)
+ sbindir=$ac_optarg ;;
+
+ -sharedstatedir | --sharedstatedir | --sharedstatedi \
+ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
+ | --sharedst | --shareds | --shared | --share | --shar \
+ | --sha | --sh)
+ ac_prev=sharedstatedir ;;
+ -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
+ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
+ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
+ | --sha=* | --sh=*)
+ sharedstatedir=$ac_optarg ;;
+
+ -site | --site | --sit)
+ ac_prev=site ;;
+ -site=* | --site=* | --sit=*)
+ site=$ac_optarg ;;
+
+ -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
+ ac_prev=srcdir ;;
+ -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
+ srcdir=$ac_optarg ;;
+
+ -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
+ | --syscon | --sysco | --sysc | --sys | --sy)
+ ac_prev=sysconfdir ;;
+ -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
+ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
+ sysconfdir=$ac_optarg ;;
+
+ -target | --target | --targe | --targ | --tar | --ta | --t)
+ ac_prev=target_alias ;;
+ -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
+ target_alias=$ac_optarg ;;
+
+ -v | -verbose | --verbose | --verbos | --verbo | --verb)
+ verbose=yes ;;
+
+ -version | --version | --versio | --versi | --vers | -V)
+ ac_init_version=: ;;
+
+ -with-* | --with-*)
+ ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+ as_fn_error $? "invalid package name: $ac_useropt"
+ ac_useropt_orig=$ac_useropt
+ ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+ case $ac_user_opts in
+ *"
+"with_$ac_useropt"
+"*) ;;
+ *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig"
+ ac_unrecognized_sep=', ';;
+ esac
+ eval with_$ac_useropt=\$ac_optarg ;;
+
+ -without-* | --without-*)
+ ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+ as_fn_error $? "invalid package name: $ac_useropt"
+ ac_useropt_orig=$ac_useropt
+ ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+ case $ac_user_opts in
+ *"
+"with_$ac_useropt"
+"*) ;;
+ *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig"
+ ac_unrecognized_sep=', ';;
+ esac
+ eval with_$ac_useropt=no ;;
+
+ --x)
+ # Obsolete; use --with-x.
+ with_x=yes ;;
+
+ -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
+ | --x-incl | --x-inc | --x-in | --x-i)
+ ac_prev=x_includes ;;
+ -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
+ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
+ x_includes=$ac_optarg ;;
+
+ -x-libraries | --x-libraries | --x-librarie | --x-librari \
+ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
+ ac_prev=x_libraries ;;
+ -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
+ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
+ x_libraries=$ac_optarg ;;
+
+ -*) as_fn_error $? "unrecognized option: \`$ac_option'
+Try \`$0 --help' for more information"
+ ;;
+
+ *=*)
+ ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
+ # Reject names that are not valid shell variable names.
+ case $ac_envvar in #(
+ '' | [0-9]* | *[!_$as_cr_alnum]* )
+ as_fn_error $? "invalid variable name: \`$ac_envvar'" ;;
+ esac
+ eval $ac_envvar=\$ac_optarg
+ export $ac_envvar ;;
+
+ *)
+ # FIXME: should be removed in autoconf 3.0.
+ $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2
+ expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
+ $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2
+ : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}"
+ ;;
+
+ esac
+done
+
+if test -n "$ac_prev"; then
+ ac_option=--`echo $ac_prev | sed 's/_/-/g'`
+ as_fn_error $? "missing argument to $ac_option"
+fi
+
+if test -n "$ac_unrecognized_opts"; then
+ case $enable_option_checking in
+ no) ;;
+ fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;;
+ *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;
+ esac
+fi
+
+# Check all directory arguments for consistency.
+for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
+ datadir sysconfdir sharedstatedir localstatedir includedir \
+ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
+ libdir localedir mandir
+do
+ eval ac_val=\$$ac_var
+ # Remove trailing slashes.
+ case $ac_val in
+ */ )
+ ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'`
+ eval $ac_var=\$ac_val;;
+ esac
+ # Be sure to have absolute directory names.
+ case $ac_val in
+ [\\/$]* | ?:[\\/]* ) continue;;
+ NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
+ esac
+ as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val"
+done
+
+# There might be people who depend on the old broken behavior: `$host'
+# used to hold the argument of --host etc.
+# FIXME: To remove some day.
+build=$build_alias
+host=$host_alias
+target=$target_alias
+
+# FIXME: To remove some day.
+if test "x$host_alias" != x; then
+ if test "x$build_alias" = x; then
+ cross_compiling=maybe
+ elif test "x$build_alias" != "x$host_alias"; then
+ cross_compiling=yes
+ fi
+fi
+
+ac_tool_prefix=
+test -n "$host_alias" && ac_tool_prefix=$host_alias-
+
+test "$silent" = yes && exec 6>/dev/null
+
+
+ac_pwd=`pwd` && test -n "$ac_pwd" &&
+ac_ls_di=`ls -di .` &&
+ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
+ as_fn_error $? "working directory cannot be determined"
+test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
+ as_fn_error $? "pwd does not report name of working directory"
+
+
+# Find the source files, if location was not specified.
+if test -z "$srcdir"; then
+ ac_srcdir_defaulted=yes
+ # Try the directory containing this script, then the parent directory.
+ ac_confdir=`$as_dirname -- "$as_myself" ||
+$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$as_myself" : 'X\(//\)[^/]' \| \
+ X"$as_myself" : 'X\(//\)$' \| \
+ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_myself" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ srcdir=$ac_confdir
+ if test ! -r "$srcdir/$ac_unique_file"; then
+ srcdir=..
+ fi
+else
+ ac_srcdir_defaulted=no
+fi
+if test ! -r "$srcdir/$ac_unique_file"; then
+ test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
+ as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir"
+fi
+ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
+ac_abs_confdir=`(
+ cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg"
+ pwd)`
+# When building in place, set srcdir=.
+if test "$ac_abs_confdir" = "$ac_pwd"; then
+ srcdir=.
+fi
+# Remove unnecessary trailing slashes from srcdir.
+# Double slashes in file names in object file debugging info
+# mess up M-x gdb in Emacs.
+case $srcdir in
+*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;;
+esac
+for ac_var in $ac_precious_vars; do
+ eval ac_env_${ac_var}_set=\${${ac_var}+set}
+ eval ac_env_${ac_var}_value=\$${ac_var}
+ eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}
+ eval ac_cv_env_${ac_var}_value=\$${ac_var}
+done
+
+#
+# Report the --help message.
+#
+if test "$ac_init_help" = "long"; then
+ # Omit some internal or obsolete options to make the list less imposing.
+ # This message is too long to be a string in the A/UX 3.1 sh.
+ cat <<_ACEOF
+\`configure' configures gmp (TeX Live) 6.0.0 to adapt to many kinds of systems.
+
+Usage: $0 [OPTION]... [VAR=VALUE]...
+
+To assign environment variables (e.g., CC, CFLAGS...), specify them as
+VAR=VALUE. See below for descriptions of some of the useful variables.
+
+Defaults for the options are specified in brackets.
+
+Configuration:
+ -h, --help display this help and exit
+ --help=short display options specific to this package
+ --help=recursive display the short help of all the included packages
+ -V, --version display version information and exit
+ -q, --quiet, --silent do not print \`checking ...' messages
+ --cache-file=FILE cache test results in FILE [disabled]
+ -C, --config-cache alias for \`--cache-file=config.cache'
+ -n, --no-create do not create output files
+ --srcdir=DIR find the sources in DIR [configure dir or \`..']
+
+Installation directories:
+ --prefix=PREFIX install architecture-independent files in PREFIX
+ [$ac_default_prefix]
+ --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
+ [PREFIX]
+
+By default, \`make install' will install all the files in
+\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify
+an installation prefix other than \`$ac_default_prefix' using \`--prefix',
+for instance \`--prefix=\$HOME'.
+
+For better control, use the options below.
+
+Fine tuning of the installation directories:
+ --bindir=DIR user executables [EPREFIX/bin]
+ --sbindir=DIR system admin executables [EPREFIX/sbin]
+ --libexecdir=DIR program executables [EPREFIX/libexec]
+ --sysconfdir=DIR read-only single-machine data [PREFIX/etc]
+ --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
+ --localstatedir=DIR modifiable single-machine data [PREFIX/var]
+ --libdir=DIR object code libraries [EPREFIX/lib]
+ --includedir=DIR C header files [PREFIX/include]
+ --oldincludedir=DIR C header files for non-gcc [/usr/include]
+ --datarootdir=DIR read-only arch.-independent data root [PREFIX/share]
+ --datadir=DIR read-only architecture-independent data [DATAROOTDIR]
+ --infodir=DIR info documentation [DATAROOTDIR/info]
+ --localedir=DIR locale-dependent data [DATAROOTDIR/locale]
+ --mandir=DIR man documentation [DATAROOTDIR/man]
+ --docdir=DIR documentation root [DATAROOTDIR/doc/gmp--tex-live-]
+ --htmldir=DIR html documentation [DOCDIR]
+ --dvidir=DIR dvi documentation [DOCDIR]
+ --pdfdir=DIR pdf documentation [DOCDIR]
+ --psdir=DIR ps documentation [DOCDIR]
+_ACEOF
+
+ cat <<\_ACEOF
+
+Program names:
+ --program-prefix=PREFIX prepend PREFIX to installed program names
+ --program-suffix=SUFFIX append SUFFIX to installed program names
+ --program-transform-name=PROGRAM run sed PROGRAM on installed program names
+
+System types:
+ --build=BUILD configure for building on BUILD [guessed]
+ --host=HOST cross-compile to build programs to run on HOST [BUILD]
+_ACEOF
+fi
+
+if test -n "$ac_init_help"; then
+ case $ac_init_help in
+ short | recursive ) echo "Configuration of gmp (TeX Live) 6.0.0:";;
+ esac
+ cat <<\_ACEOF
+
+Optional Features:
+ --disable-option-checking ignore unrecognized --enable/--with options
+ --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
+ --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
+ --enable-silent-rules less verbose build output (undo: "make V=1")
+ --disable-silent-rules verbose build output (undo: "make V=0")
+ --enable-maintainer-mode
+ enable make rules and dependencies not useful (and
+ sometimes confusing) to the casual installer
+ --enable-dependency-tracking
+ do not reject slow dependency extractors
+ --disable-dependency-tracking
+ speeds up one-time build
+ --enable-compiler-warnings=[no|min|yes|max|all]
+ Turn on compiler warnings [default: yes if
+ maintainer-mode, min otherwise]
+
+Some influential environment variables:
+ CC C compiler command
+ CFLAGS C compiler flags
+ LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a
+ nonstandard directory <lib dir>
+ LIBS libraries to pass to the linker, e.g. -l<library>
+ CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
+ you have headers in a nonstandard directory <include dir>
+ CPP C preprocessor
+
+Use these variables to override the choices made by `configure' or to help
+it to find libraries and programs with nonstandard names/locations.
+
+Report bugs to <tex-k@tug.org>.
+_ACEOF
+ac_status=$?
+fi
+
+if test "$ac_init_help" = "recursive"; then
+ # If there are subdirs, report their specific --help.
+ for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
+ test -d "$ac_dir" ||
+ { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } ||
+ continue
+ ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+ ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
+ # A ".." for each directory in $ac_dir_suffix.
+ ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
+ case $ac_top_builddir_sub in
+ "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+ *) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+ esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+ .) # We are building in place.
+ ac_srcdir=.
+ ac_top_srcdir=$ac_top_builddir_sub
+ ac_abs_top_srcdir=$ac_pwd ;;
+ [\\/]* | ?:[\\/]* ) # Absolute name.
+ ac_srcdir=$srcdir$ac_dir_suffix;
+ ac_top_srcdir=$srcdir
+ ac_abs_top_srcdir=$srcdir ;;
+ *) # Relative name.
+ ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+ ac_top_srcdir=$ac_top_build_prefix$srcdir
+ ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+ cd "$ac_dir" || { ac_status=$?; continue; }
+ # Check for guested configure.
+ if test -f "$ac_srcdir/configure.gnu"; then
+ echo &&
+ $SHELL "$ac_srcdir/configure.gnu" --help=recursive
+ elif test -f "$ac_srcdir/configure"; then
+ echo &&
+ $SHELL "$ac_srcdir/configure" --help=recursive
+ else
+ $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
+ fi || ac_status=$?
+ cd "$ac_pwd" || { ac_status=$?; break; }
+ done
+fi
+
+test -n "$ac_init_help" && exit $ac_status
+if $ac_init_version; then
+ cat <<\_ACEOF
+gmp (TeX Live) configure 6.0.0
+generated by GNU Autoconf 2.69
+
+Copyright (C) 2012 Free Software Foundation, Inc.
+This configure script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it.
+_ACEOF
+ exit
+fi
+
+## ------------------------ ##
+## Autoconf initialization. ##
+## ------------------------ ##
+
+# ac_fn_c_try_compile LINENO
+# --------------------------
+# Try to compile conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_compile ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ rm -f conftest.$ac_objext
+ if { { ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_compile") 2>conftest.err
+ ac_status=$?
+ if test -s conftest.err; then
+ grep -v '^ *+' conftest.err >conftest.er1
+ cat conftest.er1 >&5
+ mv -f conftest.er1 conftest.err
+ fi
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then :
+ ac_retval=0
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_retval=1
+fi
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+ as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_compile
+
+# ac_fn_c_try_link LINENO
+# -----------------------
+# Try to link conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_link ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ rm -f conftest.$ac_objext conftest$ac_exeext
+ if { { ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_link") 2>conftest.err
+ ac_status=$?
+ if test -s conftest.err; then
+ grep -v '^ *+' conftest.err >conftest.er1
+ cat conftest.er1 >&5
+ mv -f conftest.er1 conftest.err
+ fi
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ test -x conftest$ac_exeext
+ }; then :
+ ac_retval=0
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_retval=1
+fi
+ # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information
+ # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would
+ # interfere with the next link command; also delete a directory that is
+ # left behind by Apple's compiler. We do this before executing the actions.
+ rm -rf conftest.dSYM conftest_ipa8_conftest.oo
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+ as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_link
+
+# ac_fn_c_check_func LINENO FUNC VAR
+# ----------------------------------
+# Tests whether FUNC exists, setting the cache variable VAR accordingly
+ac_fn_c_check_func ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+/* Define $2 to an innocuous variant, in case <limits.h> declares $2.
+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
+#define $2 innocuous_$2
+
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $2 (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef $2
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char $2 ();
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined __stub_$2 || defined __stub___$2
+choke me
+#endif
+
+int
+main ()
+{
+return $2 ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ eval "$3=yes"
+else
+ eval "$3=no"
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_check_func
+
+# ac_fn_c_check_type LINENO TYPE VAR INCLUDES
+# -------------------------------------------
+# Tests whether TYPE exists after having included INCLUDES, setting cache
+# variable VAR accordingly.
+ac_fn_c_check_type ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ eval "$3=no"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+int
+main ()
+{
+if (sizeof ($2))
+ return 0;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+int
+main ()
+{
+if (sizeof (($2)))
+ return 0;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+else
+ eval "$3=yes"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_check_type
+
+# ac_fn_c_try_cpp LINENO
+# ----------------------
+# Try to preprocess conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_cpp ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ if { { ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err
+ ac_status=$?
+ if test -s conftest.err; then
+ grep -v '^ *+' conftest.err >conftest.er1
+ cat conftest.er1 >&5
+ mv -f conftest.er1 conftest.err
+ fi
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } > conftest.i && {
+ test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ }; then :
+ ac_retval=0
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_retval=1
+fi
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+ as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_cpp
+
+# ac_fn_c_try_run LINENO
+# ----------------------
+# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes
+# that executables *can* be run.
+ac_fn_c_try_run ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ if { { ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_link") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && { ac_try='./conftest$ac_exeext'
+ { { case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; }; then :
+ ac_retval=0
+else
+ $as_echo "$as_me: program exited with status $ac_status" >&5
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_retval=$ac_status
+fi
+ rm -rf conftest.dSYM conftest_ipa8_conftest.oo
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+ as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_run
+
+# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES
+# -------------------------------------------------------
+# Tests whether HEADER exists and can be compiled using the include files in
+# INCLUDES, setting the cache variable VAR accordingly.
+ac_fn_c_check_header_compile ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+#include <$2>
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ eval "$3=yes"
+else
+ eval "$3=no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_check_header_compile
+
+# ac_fn_c_compute_int LINENO EXPR VAR INCLUDES
+# --------------------------------------------
+# Tries to find the compile-time value of EXPR in a program that includes
+# INCLUDES, setting VAR accordingly. Returns whether the value could be
+# computed
+ac_fn_c_compute_int ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ if test "$cross_compiling" = yes; then
+ # Depending upon the size, compute the lo and hi bounds.
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+int
+main ()
+{
+static int test_array [1 - 2 * !(($2) >= 0)];
+test_array [0] = 0;
+return test_array [0];
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_lo=0 ac_mid=0
+ while :; do
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+int
+main ()
+{
+static int test_array [1 - 2 * !(($2) <= $ac_mid)];
+test_array [0] = 0;
+return test_array [0];
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_hi=$ac_mid; break
+else
+ as_fn_arith $ac_mid + 1 && ac_lo=$as_val
+ if test $ac_lo -le $ac_mid; then
+ ac_lo= ac_hi=
+ break
+ fi
+ as_fn_arith 2 '*' $ac_mid + 1 && ac_mid=$as_val
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ done
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+int
+main ()
+{
+static int test_array [1 - 2 * !(($2) < 0)];
+test_array [0] = 0;
+return test_array [0];
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_hi=-1 ac_mid=-1
+ while :; do
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+int
+main ()
+{
+static int test_array [1 - 2 * !(($2) >= $ac_mid)];
+test_array [0] = 0;
+return test_array [0];
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_lo=$ac_mid; break
+else
+ as_fn_arith '(' $ac_mid ')' - 1 && ac_hi=$as_val
+ if test $ac_mid -le $ac_hi; then
+ ac_lo= ac_hi=
+ break
+ fi
+ as_fn_arith 2 '*' $ac_mid && ac_mid=$as_val
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ done
+else
+ ac_lo= ac_hi=
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+# Binary search between lo and hi bounds.
+while test "x$ac_lo" != "x$ac_hi"; do
+ as_fn_arith '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo && ac_mid=$as_val
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+int
+main ()
+{
+static int test_array [1 - 2 * !(($2) <= $ac_mid)];
+test_array [0] = 0;
+return test_array [0];
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_hi=$ac_mid
+else
+ as_fn_arith '(' $ac_mid ')' + 1 && ac_lo=$as_val
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+done
+case $ac_lo in #((
+?*) eval "$3=\$ac_lo"; ac_retval=0 ;;
+'') ac_retval=1 ;;
+esac
+ else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+static long int longval () { return $2; }
+static unsigned long int ulongval () { return $2; }
+#include <stdio.h>
+#include <stdlib.h>
+int
+main ()
+{
+
+ FILE *f = fopen ("conftest.val", "w");
+ if (! f)
+ return 1;
+ if (($2) < 0)
+ {
+ long int i = longval ();
+ if (i != ($2))
+ return 1;
+ fprintf (f, "%ld", i);
+ }
+ else
+ {
+ unsigned long int i = ulongval ();
+ if (i != ($2))
+ return 1;
+ fprintf (f, "%lu", i);
+ }
+ /* Do not output a trailing newline, as this causes \r\n confusion
+ on some platforms. */
+ return ferror (f) || fclose (f) != 0;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ echo >>conftest.val; read $3 <conftest.val; ac_retval=0
+else
+ ac_retval=1
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+rm -f conftest.val
+
+ fi
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+ as_fn_set_status $ac_retval
+
+} # ac_fn_c_compute_int
+cat >config.log <<_ACEOF
+This file contains any messages produced by compilers while
+running configure, to aid debugging if configure makes a mistake.
+
+It was created by gmp (TeX Live) $as_me 6.0.0, which was
+generated by GNU Autoconf 2.69. Invocation command line was
+
+ $ $0 $@
+
+_ACEOF
+exec 5>>config.log
+{
+cat <<_ASUNAME
+## --------- ##
+## Platform. ##
+## --------- ##
+
+hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
+uname -m = `(uname -m) 2>/dev/null || echo unknown`
+uname -r = `(uname -r) 2>/dev/null || echo unknown`
+uname -s = `(uname -s) 2>/dev/null || echo unknown`
+uname -v = `(uname -v) 2>/dev/null || echo unknown`
+
+/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
+/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown`
+
+/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown`
+/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown`
+/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
+/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown`
+/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown`
+/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown`
+/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown`
+
+_ASUNAME
+
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ $as_echo "PATH: $as_dir"
+ done
+IFS=$as_save_IFS
+
+} >&5
+
+cat >&5 <<_ACEOF
+
+
+## ----------- ##
+## Core tests. ##
+## ----------- ##
+
+_ACEOF
+
+
+# Keep a trace of the command line.
+# Strip out --no-create and --no-recursion so they do not pile up.
+# Strip out --silent because we don't want to record it for future runs.
+# Also quote any args containing shell meta-characters.
+# Make two passes to allow for proper duplicate-argument suppression.
+ac_configure_args=
+ac_configure_args0=
+ac_configure_args1=
+ac_must_keep_next=false
+for ac_pass in 1 2
+do
+ for ac_arg
+ do
+ case $ac_arg in
+ -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil)
+ continue ;;
+ *\'*)
+ ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+ esac
+ case $ac_pass in
+ 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;;
+ 2)
+ as_fn_append ac_configure_args1 " '$ac_arg'"
+ if test $ac_must_keep_next = true; then
+ ac_must_keep_next=false # Got value, back to normal.
+ else
+ case $ac_arg in
+ *=* | --config-cache | -C | -disable-* | --disable-* \
+ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
+ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
+ | -with-* | --with-* | -without-* | --without-* | --x)
+ case "$ac_configure_args0 " in
+ "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
+ esac
+ ;;
+ -* ) ac_must_keep_next=true ;;
+ esac
+ fi
+ as_fn_append ac_configure_args " '$ac_arg'"
+ ;;
+ esac
+ done
+done
+{ ac_configure_args0=; unset ac_configure_args0;}
+{ ac_configure_args1=; unset ac_configure_args1;}
+
+# When interrupted or exit'd, cleanup temporary files, and complete
+# config.log. We remove comments because anyway the quotes in there
+# would cause problems or look ugly.
+# WARNING: Use '\'' to represent an apostrophe within the trap.
+# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
+trap 'exit_status=$?
+ # Save into config.log some information that might help in debugging.
+ {
+ echo
+
+ $as_echo "## ---------------- ##
+## Cache variables. ##
+## ---------------- ##"
+ echo
+ # The following way of writing the cache mishandles newlines in values,
+(
+ for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do
+ eval ac_val=\$$ac_var
+ case $ac_val in #(
+ *${as_nl}*)
+ case $ac_var in #(
+ *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
+ esac
+ case $ac_var in #(
+ _ | IFS | as_nl) ;; #(
+ BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
+ *) { eval $ac_var=; unset $ac_var;} ;;
+ esac ;;
+ esac
+ done
+ (set) 2>&1 |
+ case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #(
+ *${as_nl}ac_space=\ *)
+ sed -n \
+ "s/'\''/'\''\\\\'\'''\''/g;
+ s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p"
+ ;; #(
+ *)
+ sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+ ;;
+ esac |
+ sort
+)
+ echo
+
+ $as_echo "## ----------------- ##
+## Output variables. ##
+## ----------------- ##"
+ echo
+ for ac_var in $ac_subst_vars
+ do
+ eval ac_val=\$$ac_var
+ case $ac_val in
+ *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+ esac
+ $as_echo "$ac_var='\''$ac_val'\''"
+ done | sort
+ echo
+
+ if test -n "$ac_subst_files"; then
+ $as_echo "## ------------------- ##
+## File substitutions. ##
+## ------------------- ##"
+ echo
+ for ac_var in $ac_subst_files
+ do
+ eval ac_val=\$$ac_var
+ case $ac_val in
+ *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+ esac
+ $as_echo "$ac_var='\''$ac_val'\''"
+ done | sort
+ echo
+ fi
+
+ if test -s confdefs.h; then
+ $as_echo "## ----------- ##
+## confdefs.h. ##
+## ----------- ##"
+ echo
+ cat confdefs.h
+ echo
+ fi
+ test "$ac_signal" != 0 &&
+ $as_echo "$as_me: caught signal $ac_signal"
+ $as_echo "$as_me: exit $exit_status"
+ } >&5
+ rm -f core *.core core.conftest.* &&
+ rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
+ exit $exit_status
+' 0
+for ac_signal in 1 2 13 15; do
+ trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal
+done
+ac_signal=0
+
+# confdefs.h avoids OS command line length limits that DEFS can exceed.
+rm -f -r conftest* confdefs.h
+
+$as_echo "/* confdefs.h */" > confdefs.h
+
+# Predefined preprocessor variables.
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_NAME "$PACKAGE_NAME"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_TARNAME "$PACKAGE_TARNAME"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_VERSION "$PACKAGE_VERSION"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_STRING "$PACKAGE_STRING"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_URL "$PACKAGE_URL"
+_ACEOF
+
+
+# Let the site file select an alternate cache file if it wants to.
+# Prefer an explicitly selected file to automatically selected ones.
+ac_site_file1=NONE
+ac_site_file2=NONE
+if test -n "$CONFIG_SITE"; then
+ # We do not want a PATH search for config.site.
+ case $CONFIG_SITE in #((
+ -*) ac_site_file1=./$CONFIG_SITE;;
+ */*) ac_site_file1=$CONFIG_SITE;;
+ *) ac_site_file1=./$CONFIG_SITE;;
+ esac
+elif test "x$prefix" != xNONE; then
+ ac_site_file1=$prefix/share/config.site
+ ac_site_file2=$prefix/etc/config.site
+else
+ ac_site_file1=$ac_default_prefix/share/config.site
+ ac_site_file2=$ac_default_prefix/etc/config.site
+fi
+for ac_site_file in "$ac_site_file1" "$ac_site_file2"
+do
+ test "x$ac_site_file" = xNONE && continue
+ if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5
+$as_echo "$as_me: loading site script $ac_site_file" >&6;}
+ sed 's/^/| /' "$ac_site_file" >&5
+ . "$ac_site_file" \
+ || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "failed to load site script $ac_site_file
+See \`config.log' for more details" "$LINENO" 5; }
+ fi
+done
+
+if test -r "$cache_file"; then
+ # Some versions of bash will fail to source /dev/null (special files
+ # actually), so we avoid doing that. DJGPP emulates it as a regular file.
+ if test /dev/null != "$cache_file" && test -f "$cache_file"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5
+$as_echo "$as_me: loading cache $cache_file" >&6;}
+ case $cache_file in
+ [\\/]* | ?:[\\/]* ) . "$cache_file";;
+ *) . "./$cache_file";;
+ esac
+ fi
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5
+$as_echo "$as_me: creating cache $cache_file" >&6;}
+ >$cache_file
+fi
+
+# Check that the precious variables saved in the cache have kept the same
+# value.
+ac_cache_corrupted=false
+for ac_var in $ac_precious_vars; do
+ eval ac_old_set=\$ac_cv_env_${ac_var}_set
+ eval ac_new_set=\$ac_env_${ac_var}_set
+ eval ac_old_val=\$ac_cv_env_${ac_var}_value
+ eval ac_new_val=\$ac_env_${ac_var}_value
+ case $ac_old_set,$ac_new_set in
+ set,)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
+$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
+ ac_cache_corrupted=: ;;
+ ,set)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5
+$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
+ ac_cache_corrupted=: ;;
+ ,);;
+ *)
+ if test "x$ac_old_val" != "x$ac_new_val"; then
+ # differences in whitespace do not lead to failure.
+ ac_old_val_w=`echo x $ac_old_val`
+ ac_new_val_w=`echo x $ac_new_val`
+ if test "$ac_old_val_w" != "$ac_new_val_w"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5
+$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
+ ac_cache_corrupted=:
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5
+$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;}
+ eval $ac_var=\$ac_old_val
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5
+$as_echo "$as_me: former value: \`$ac_old_val'" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5
+$as_echo "$as_me: current value: \`$ac_new_val'" >&2;}
+ fi;;
+ esac
+ # Pass precious variables to config.status.
+ if test "$ac_new_set" = set; then
+ case $ac_new_val in
+ *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
+ *) ac_arg=$ac_var=$ac_new_val ;;
+ esac
+ case " $ac_configure_args " in
+ *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy.
+ *) as_fn_append ac_configure_args " '$ac_arg'" ;;
+ esac
+ fi
+done
+if $ac_cache_corrupted; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5
+$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;}
+ as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5
+fi
+## -------------------- ##
+## Main body of script. ##
+## -------------------- ##
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+
+
+ac_aux_dir=
+for ac_dir in ../../build-aux "$srcdir"/../../build-aux; do
+ if test -f "$ac_dir/install-sh"; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/install-sh -c"
+ break
+ elif test -f "$ac_dir/install.sh"; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/install.sh -c"
+ break
+ elif test -f "$ac_dir/shtool"; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/shtool install -c"
+ break
+ fi
+done
+if test -z "$ac_aux_dir"; then
+ as_fn_error $? "cannot find install-sh, install.sh, or shtool in ../../build-aux \"$srcdir\"/../../build-aux" "$LINENO" 5
+fi
+
+# These three variables are undocumented and unsupported,
+# and are intended to be withdrawn in a future Autoconf release.
+# They can cause serious problems if a builder's source tree is in a directory
+# whose full name contains unusual characters.
+ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var.
+ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var.
+ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var.
+
+
+
+
+am__api_version='1.14'
+
+# Find a good install program. We prefer a C program (faster),
+# so one script is as good as another. But avoid the broken or
+# incompatible versions:
+# SysV /etc/install, /usr/sbin/install
+# SunOS /usr/etc/install
+# IRIX /sbin/install
+# AIX /bin/install
+# AmigaOS /C/install, which installs bootblocks on floppy discs
+# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
+# AFS /usr/afsws/bin/install, which mishandles nonexistent args
+# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
+# OS/2's system install, which has a completely different semantic
+# ./install, which can be erroneously created by make from ./install.sh.
+# Reject install programs that cannot install multiple files.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5
+$as_echo_n "checking for a BSD-compatible install... " >&6; }
+if test -z "$INSTALL"; then
+if ${ac_cv_path_install+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ # Account for people who put trailing slashes in PATH elements.
+case $as_dir/ in #((
+ ./ | .// | /[cC]/* | \
+ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
+ ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \
+ /usr/ucb/* ) ;;
+ *)
+ # OSF1 and SCO ODT 3.0 have their own names for install.
+ # Don't use installbsd from OSF since it installs stuff as root
+ # by default.
+ for ac_prog in ginstall scoinst install; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
+ if test $ac_prog = install &&
+ grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+ # AIX install. It has an incompatible calling convention.
+ :
+ elif test $ac_prog = install &&
+ grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+ # program-specific install script used by HP pwplus--don't use.
+ :
+ else
+ rm -rf conftest.one conftest.two conftest.dir
+ echo one > conftest.one
+ echo two > conftest.two
+ mkdir conftest.dir
+ if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" &&
+ test -s conftest.one && test -s conftest.two &&
+ test -s conftest.dir/conftest.one &&
+ test -s conftest.dir/conftest.two
+ then
+ ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
+ break 3
+ fi
+ fi
+ fi
+ done
+ done
+ ;;
+esac
+
+ done
+IFS=$as_save_IFS
+
+rm -rf conftest.one conftest.two conftest.dir
+
+fi
+ if test "${ac_cv_path_install+set}" = set; then
+ INSTALL=$ac_cv_path_install
+ else
+ # As a last resort, use the slow shell script. Don't cache a
+ # value for INSTALL within a source directory, because that will
+ # break other packages using the cache if that directory is
+ # removed, or if the value is a relative name.
+ INSTALL=$ac_install_sh
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5
+$as_echo "$INSTALL" >&6; }
+
+# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
+# It thinks the first close brace ends the variable substitution.
+test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
+
+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
+
+test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5
+$as_echo_n "checking whether build environment is sane... " >&6; }
+# Reject unsafe characters in $srcdir or the absolute working directory
+# name. Accept space and tab only in the latter.
+am_lf='
+'
+case `pwd` in
+ *[\\\"\#\$\&\'\`$am_lf]*)
+ as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;;
+esac
+case $srcdir in
+ *[\\\"\#\$\&\'\`$am_lf\ \ ]*)
+ as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;;
+esac
+
+# Do 'set' in a subshell so we don't clobber the current shell's
+# arguments. Must try -L first in case configure is actually a
+# symlink; some systems play weird games with the mod time of symlinks
+# (eg FreeBSD returns the mod time of the symlink's containing
+# directory).
+if (
+ am_has_slept=no
+ for am_try in 1 2; do
+ echo "timestamp, slept: $am_has_slept" > conftest.file
+ set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
+ if test "$*" = "X"; then
+ # -L didn't work.
+ set X `ls -t "$srcdir/configure" conftest.file`
+ fi
+ if test "$*" != "X $srcdir/configure conftest.file" \
+ && test "$*" != "X conftest.file $srcdir/configure"; then
+
+ # If neither matched, then we have a broken ls. This can happen
+ # if, for instance, CONFIG_SHELL is bash and it inherits a
+ # broken ls alias from the environment. This has actually
+ # happened. Such a system could not be considered "sane".
+ as_fn_error $? "ls -t appears to fail. Make sure there is not a broken
+ alias in your environment" "$LINENO" 5
+ fi
+ if test "$2" = conftest.file || test $am_try -eq 2; then
+ break
+ fi
+ # Just in case.
+ sleep 1
+ am_has_slept=yes
+ done
+ test "$2" = conftest.file
+ )
+then
+ # Ok.
+ :
+else
+ as_fn_error $? "newly created file is older than distributed files!
+Check your system clock" "$LINENO" 5
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+# If we didn't sleep, we still need to ensure time stamps of config.status and
+# generated files are strictly newer.
+am_sleep_pid=
+if grep 'slept: no' conftest.file >/dev/null 2>&1; then
+ ( sleep 1 ) &
+ am_sleep_pid=$!
+fi
+
+rm -f conftest.file
+
+test "$program_prefix" != NONE &&
+ program_transform_name="s&^&$program_prefix&;$program_transform_name"
+# Use a double $ so make ignores it.
+test "$program_suffix" != NONE &&
+ program_transform_name="s&\$&$program_suffix&;$program_transform_name"
+# Double any \ or $.
+# By default was `s,x,x', remove it if useless.
+ac_script='s/[\\$]/&&/g;s/;s,x,x,$//'
+program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"`
+
+# expand $ac_aux_dir to an absolute path
+am_aux_dir=`cd $ac_aux_dir && pwd`
+
+if test x"${MISSING+set}" != xset; then
+ case $am_aux_dir in
+ *\ * | *\ *)
+ MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
+ *)
+ MISSING="\${SHELL} $am_aux_dir/missing" ;;
+ esac
+fi
+# Use eval to expand $SHELL
+if eval "$MISSING --is-lightweight"; then
+ am_missing_run="$MISSING "
+else
+ am_missing_run=
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5
+$as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;}
+fi
+
+if test x"${install_sh}" != xset; then
+ case $am_aux_dir in
+ *\ * | *\ *)
+ install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
+ *)
+ install_sh="\${SHELL} $am_aux_dir/install-sh"
+ esac
+fi
+
+# Installed binaries are usually stripped using 'strip' when the user
+# run "make install-strip". However 'strip' might not be the right
+# tool to use in cross-compilation environments, therefore Automake
+# will honor the 'STRIP' environment variable to overrule this program.
+if test "$cross_compiling" != no; then
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
+set dummy ${ac_tool_prefix}strip; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_STRIP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$STRIP"; then
+ ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_STRIP="${ac_tool_prefix}strip"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+STRIP=$ac_cv_prog_STRIP
+if test -n "$STRIP"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5
+$as_echo "$STRIP" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_STRIP"; then
+ ac_ct_STRIP=$STRIP
+ # Extract the first word of "strip", so it can be a program name with args.
+set dummy strip; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_STRIP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_STRIP"; then
+ ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_STRIP="strip"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
+if test -n "$ac_ct_STRIP"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5
+$as_echo "$ac_ct_STRIP" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_STRIP" = x; then
+ STRIP=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ STRIP=$ac_ct_STRIP
+ fi
+else
+ STRIP="$ac_cv_prog_STRIP"
+fi
+
+fi
+INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5
+$as_echo_n "checking for a thread-safe mkdir -p... " >&6; }
+if test -z "$MKDIR_P"; then
+ if ${ac_cv_path_mkdir+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_prog in mkdir gmkdir; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue
+ case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #(
+ 'mkdir (GNU coreutils) '* | \
+ 'mkdir (coreutils) '* | \
+ 'mkdir (fileutils) '4.1*)
+ ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext
+ break 3;;
+ esac
+ done
+ done
+ done
+IFS=$as_save_IFS
+
+fi
+
+ test -d ./--version && rmdir ./--version
+ if test "${ac_cv_path_mkdir+set}" = set; then
+ MKDIR_P="$ac_cv_path_mkdir -p"
+ else
+ # As a last resort, use the slow shell script. Don't cache a
+ # value for MKDIR_P within a source directory, because that will
+ # break other packages using the cache if that directory is
+ # removed, or if the value is a relative name.
+ MKDIR_P="$ac_install_sh -d"
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5
+$as_echo "$MKDIR_P" >&6; }
+
+for ac_prog in gawk mawk nawk awk
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_AWK+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$AWK"; then
+ ac_cv_prog_AWK="$AWK" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_AWK="$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+AWK=$ac_cv_prog_AWK
+if test -n "$AWK"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5
+$as_echo "$AWK" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$AWK" && break
+done
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5
+$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
+set x ${MAKE-make}
+ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
+if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat >conftest.make <<\_ACEOF
+SHELL = /bin/sh
+all:
+ @echo '@@@%%%=$(MAKE)=@@@%%%'
+_ACEOF
+# GNU make sometimes prints "make[1]: Entering ...", which would confuse us.
+case `${MAKE-make} -f conftest.make 2>/dev/null` in
+ *@@@%%%=?*=@@@%%%*)
+ eval ac_cv_prog_make_${ac_make}_set=yes;;
+ *)
+ eval ac_cv_prog_make_${ac_make}_set=no;;
+esac
+rm -f conftest.make
+fi
+if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+ SET_MAKE=
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ SET_MAKE="MAKE=${MAKE-make}"
+fi
+
+rm -rf .tst 2>/dev/null
+mkdir .tst 2>/dev/null
+if test -d .tst; then
+ am__leading_dot=.
+else
+ am__leading_dot=_
+fi
+rmdir .tst 2>/dev/null
+
+# Check whether --enable-silent-rules was given.
+if test "${enable_silent_rules+set}" = set; then :
+ enableval=$enable_silent_rules;
+fi
+
+case $enable_silent_rules in # (((
+ yes) AM_DEFAULT_VERBOSITY=0;;
+ no) AM_DEFAULT_VERBOSITY=1;;
+ *) AM_DEFAULT_VERBOSITY=1;;
+esac
+am_make=${MAKE-make}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5
+$as_echo_n "checking whether $am_make supports nested variables... " >&6; }
+if ${am_cv_make_support_nested_variables+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if $as_echo 'TRUE=$(BAR$(V))
+BAR0=false
+BAR1=true
+V=1
+am__doit:
+ @$(TRUE)
+.PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then
+ am_cv_make_support_nested_variables=yes
+else
+ am_cv_make_support_nested_variables=no
+fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5
+$as_echo "$am_cv_make_support_nested_variables" >&6; }
+if test $am_cv_make_support_nested_variables = yes; then
+ AM_V='$(V)'
+ AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
+else
+ AM_V=$AM_DEFAULT_VERBOSITY
+ AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
+fi
+AM_BACKSLASH='\'
+
+DEPDIR="${am__leading_dot}deps"
+
+ac_config_commands="$ac_config_commands depfiles"
+
+
+am_make=${MAKE-make}
+cat > confinc << 'END'
+am__doit:
+ @echo this is the am__doit target
+.PHONY: am__doit
+END
+# If we don't find an include directive, just comment out the code.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5
+$as_echo_n "checking for style of include used by $am_make... " >&6; }
+am__include="#"
+am__quote=
+_am_result=none
+# First try GNU make style include.
+echo "include confinc" > confmf
+# Ignore all kinds of additional output from 'make'.
+case `$am_make -s -f confmf 2> /dev/null` in #(
+*the\ am__doit\ target*)
+ am__include=include
+ am__quote=
+ _am_result=GNU
+ ;;
+esac
+# Now try BSD make style include.
+if test "$am__include" = "#"; then
+ echo '.include "confinc"' > confmf
+ case `$am_make -s -f confmf 2> /dev/null` in #(
+ *the\ am__doit\ target*)
+ am__include=.include
+ am__quote="\""
+ _am_result=BSD
+ ;;
+ esac
+fi
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5
+$as_echo "$_am_result" >&6; }
+rm -f confinc confmf
+
+# Check whether --enable-dependency-tracking was given.
+if test "${enable_dependency_tracking+set}" = set; then :
+ enableval=$enable_dependency_tracking;
+fi
+
+if test "x$enable_dependency_tracking" != xno; then
+ am_depcomp="$ac_aux_dir/depcomp"
+ AMDEPBACKSLASH='\'
+ am__nodep='_no'
+fi
+ if test "x$enable_dependency_tracking" != xno; then
+ AMDEP_TRUE=
+ AMDEP_FALSE='#'
+else
+ AMDEP_TRUE='#'
+ AMDEP_FALSE=
+fi
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}gcc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_CC="${ac_tool_prefix}gcc"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_CC"; then
+ ac_ct_CC=$CC
+ # Extract the first word of "gcc", so it can be a program name with args.
+set dummy gcc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_CC"; then
+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_CC="gcc"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_CC" = x; then
+ CC=""
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ CC=$ac_ct_CC
+ fi
+else
+ CC="$ac_cv_prog_CC"
+fi
+
+if test -z "$CC"; then
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}cc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_CC="${ac_tool_prefix}cc"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ fi
+fi
+if test -z "$CC"; then
+ # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+ ac_prog_rejected=no
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
+ ac_prog_rejected=yes
+ continue
+ fi
+ ac_cv_prog_CC="cc"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+if test $ac_prog_rejected = yes; then
+ # We found a bogon in the path, so make sure we never use it.
+ set dummy $ac_cv_prog_CC
+ shift
+ if test $# != 0; then
+ # We chose a different compiler from the bogus one.
+ # However, it has the same basename, so the bogon will be chosen
+ # first if we set CC to just the basename; use the full file name.
+ shift
+ ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
+ fi
+fi
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$CC"; then
+ if test -n "$ac_tool_prefix"; then
+ for ac_prog in cl.exe
+ do
+ # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$CC" && break
+ done
+fi
+if test -z "$CC"; then
+ ac_ct_CC=$CC
+ for ac_prog in cl.exe
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_CC"; then
+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_CC="$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$ac_ct_CC" && break
+done
+
+ if test "x$ac_ct_CC" = x; then
+ CC=""
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ CC=$ac_ct_CC
+ fi
+fi
+
+fi
+
+
+test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "no acceptable C compiler found in \$PATH
+See \`config.log' for more details" "$LINENO" 5; }
+
+# Provide some information about the compiler.
+$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
+set X $ac_compile
+ac_compiler=$2
+for ac_option in --version -v -V -qversion; do
+ { { ac_try="$ac_compiler $ac_option >&5"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_compiler $ac_option >&5") 2>conftest.err
+ ac_status=$?
+ if test -s conftest.err; then
+ sed '10a\
+... rest of stderr output deleted ...
+ 10q' conftest.err >conftest.er1
+ cat conftest.er1 >&5
+ fi
+ rm -f conftest.er1 conftest.err
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }
+done
+
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out"
+# Try to create an executable without -o first, disregard a.out.
+# It will help us diagnose broken compilers, and finding out an intuition
+# of exeext.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5
+$as_echo_n "checking whether the C compiler works... " >&6; }
+ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
+
+# The possible output files:
+ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*"
+
+ac_rmfiles=
+for ac_file in $ac_files
+do
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
+ * ) ac_rmfiles="$ac_rmfiles $ac_file";;
+ esac
+done
+rm -f $ac_rmfiles
+
+if { { ac_try="$ac_link_default"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_link_default") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then :
+ # Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
+# So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
+# in a Makefile. We should not override ac_cv_exeext if it was cached,
+# so that the user can short-circuit this test for compilers unknown to
+# Autoconf.
+for ac_file in $ac_files ''
+do
+ test -f "$ac_file" || continue
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj )
+ ;;
+ [ab].out )
+ # We found the default executable, but exeext='' is most
+ # certainly right.
+ break;;
+ *.* )
+ if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
+ then :; else
+ ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+ fi
+ # We set ac_cv_exeext here because the later test for it is not
+ # safe: cross compilers may not add the suffix if given an `-o'
+ # argument, so we may need to know it at that point already.
+ # Even if this section looks crufty: it has the advantage of
+ # actually working.
+ break;;
+ * )
+ break;;
+ esac
+done
+test "$ac_cv_exeext" = no && ac_cv_exeext=
+
+else
+ ac_file=''
+fi
+if test -z "$ac_file"; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+$as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "C compiler cannot create executables
+See \`config.log' for more details" "$LINENO" 5; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5
+$as_echo_n "checking for C compiler default output file name... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5
+$as_echo "$ac_file" >&6; }
+ac_exeext=$ac_cv_exeext
+
+rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out
+ac_clean_files=$ac_clean_files_save
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5
+$as_echo_n "checking for suffix of executables... " >&6; }
+if { { ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_link") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then :
+ # If both `conftest.exe' and `conftest' are `present' (well, observable)
+# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will
+# work properly (i.e., refer to `conftest.exe'), while it won't with
+# `rm'.
+for ac_file in conftest.exe conftest conftest.*; do
+ test -f "$ac_file" || continue
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
+ *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+ break;;
+ * ) break;;
+ esac
+done
+else
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details" "$LINENO" 5; }
+fi
+rm -f conftest conftest$ac_cv_exeext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5
+$as_echo "$ac_cv_exeext" >&6; }
+
+rm -f conftest.$ac_ext
+EXEEXT=$ac_cv_exeext
+ac_exeext=$EXEEXT
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdio.h>
+int
+main ()
+{
+FILE *f = fopen ("conftest.out", "w");
+ return ferror (f) || fclose (f) != 0;
+
+ ;
+ return 0;
+}
+_ACEOF
+ac_clean_files="$ac_clean_files conftest.out"
+# Check that the compiler produces executables we can run. If not, either
+# the compiler is broken, or we cross compile.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5
+$as_echo_n "checking whether we are cross compiling... " >&6; }
+if test "$cross_compiling" != yes; then
+ { { ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_link") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }
+ if { ac_try='./conftest$ac_cv_exeext'
+ { { case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; }; then
+ cross_compiling=no
+ else
+ if test "$cross_compiling" = maybe; then
+ cross_compiling=yes
+ else
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot run C compiled programs.
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details" "$LINENO" 5; }
+ fi
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5
+$as_echo "$cross_compiling" >&6; }
+
+rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out
+ac_clean_files=$ac_clean_files_save
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5
+$as_echo_n "checking for suffix of object files... " >&6; }
+if ${ac_cv_objext+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.o conftest.obj
+if { { ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_compile") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then :
+ for ac_file in conftest.o conftest.obj conftest.*; do
+ test -f "$ac_file" || continue;
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;;
+ *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
+ break;;
+ esac
+done
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot compute suffix of object files: cannot compile
+See \`config.log' for more details" "$LINENO" 5; }
+fi
+rm -f conftest.$ac_cv_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5
+$as_echo "$ac_cv_objext" >&6; }
+OBJEXT=$ac_cv_objext
+ac_objext=$OBJEXT
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5
+$as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
+if ${ac_cv_c_compiler_gnu+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+#ifndef __GNUC__
+ choke me
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_compiler_gnu=yes
+else
+ ac_compiler_gnu=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_c_compiler_gnu=$ac_compiler_gnu
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5
+$as_echo "$ac_cv_c_compiler_gnu" >&6; }
+if test $ac_compiler_gnu = yes; then
+ GCC=yes
+else
+ GCC=
+fi
+ac_test_CFLAGS=${CFLAGS+set}
+ac_save_CFLAGS=$CFLAGS
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
+$as_echo_n "checking whether $CC accepts -g... " >&6; }
+if ${ac_cv_prog_cc_g+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_save_c_werror_flag=$ac_c_werror_flag
+ ac_c_werror_flag=yes
+ ac_cv_prog_cc_g=no
+ CFLAGS="-g"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_prog_cc_g=yes
+else
+ CFLAGS=""
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+else
+ ac_c_werror_flag=$ac_save_c_werror_flag
+ CFLAGS="-g"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_prog_cc_g=yes
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ ac_c_werror_flag=$ac_save_c_werror_flag
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5
+$as_echo "$ac_cv_prog_cc_g" >&6; }
+if test "$ac_test_CFLAGS" = set; then
+ CFLAGS=$ac_save_CFLAGS
+elif test $ac_cv_prog_cc_g = yes; then
+ if test "$GCC" = yes; then
+ CFLAGS="-g -O2"
+ else
+ CFLAGS="-g"
+ fi
+else
+ if test "$GCC" = yes; then
+ CFLAGS="-O2"
+ else
+ CFLAGS=
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
+$as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
+if ${ac_cv_prog_cc_c89+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_cv_prog_cc_c89=no
+ac_save_CC=$CC
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdarg.h>
+#include <stdio.h>
+struct stat;
+/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
+struct buf { int x; };
+FILE * (*rcsopen) (struct buf *, struct stat *, int);
+static char *e (p, i)
+ char **p;
+ int i;
+{
+ return p[i];
+}
+static char *f (char * (*g) (char **, int), char **p, ...)
+{
+ char *s;
+ va_list v;
+ va_start (v,p);
+ s = g (p, va_arg (v,int));
+ va_end (v);
+ return s;
+}
+
+/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has
+ function prototypes and stuff, but not '\xHH' hex character constants.
+ These don't provoke an error unfortunately, instead are silently treated
+ as 'x'. The following induces an error, until -std is added to get
+ proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an
+ array size at least. It's necessary to write '\x00'==0 to get something
+ that's true only with -std. */
+int osf4_cc_array ['\x00' == 0 ? 1 : -1];
+
+/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
+ inside strings and character constants. */
+#define FOO(x) 'x'
+int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
+
+int test (int i, double x);
+struct s1 {int (*f) (int a);};
+struct s2 {int (*f) (double a);};
+int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
+int argc;
+char **argv;
+int
+main ()
+{
+return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
+ ;
+ return 0;
+}
+_ACEOF
+for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
+ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+do
+ CC="$ac_save_CC $ac_arg"
+ if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_prog_cc_c89=$ac_arg
+fi
+rm -f core conftest.err conftest.$ac_objext
+ test "x$ac_cv_prog_cc_c89" != "xno" && break
+done
+rm -f conftest.$ac_ext
+CC=$ac_save_CC
+
+fi
+# AC_CACHE_VAL
+case "x$ac_cv_prog_cc_c89" in
+ x)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
+$as_echo "none needed" >&6; } ;;
+ xno)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
+$as_echo "unsupported" >&6; } ;;
+ *)
+ CC="$CC $ac_cv_prog_cc_c89"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
+$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
+esac
+if test "x$ac_cv_prog_cc_c89" != xno; then :
+
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5
+$as_echo_n "checking whether $CC understands -c and -o together... " >&6; }
+if ${am_cv_prog_cc_c_o+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+ # Make sure it works both with $CC and with simple cc.
+ # Following AC_PROG_CC_C_O, we do the test twice because some
+ # compilers refuse to overwrite an existing .o file with -o,
+ # though they will create one.
+ am_cv_prog_cc_c_o=yes
+ for am_i in 1 2; do
+ if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5
+ ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } \
+ && test -f conftest2.$ac_objext; then
+ : OK
+ else
+ am_cv_prog_cc_c_o=no
+ break
+ fi
+ done
+ rm -f core conftest*
+ unset am_i
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5
+$as_echo "$am_cv_prog_cc_c_o" >&6; }
+if test "$am_cv_prog_cc_c_o" != yes; then
+ # Losing compiler, so override with the script.
+ # FIXME: It is wrong to rewrite CC.
+ # But if we don't then we get into trouble of one sort or another.
+ # A longer-term fix would be to have automake use am__CC in this case,
+ # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
+ CC="$am_aux_dir/compile $CC"
+fi
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+depcc="$CC" am_compiler_list=
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
+$as_echo_n "checking dependency style of $depcc... " >&6; }
+if ${am_cv_CC_dependencies_compiler_type+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+ # We make a subdir and do the tests there. Otherwise we can end up
+ # making bogus files that we don't know about and never remove. For
+ # instance it was reported that on HP-UX the gcc test will end up
+ # making a dummy file named 'D' -- because '-MD' means "put the output
+ # in D".
+ rm -rf conftest.dir
+ mkdir conftest.dir
+ # Copy depcomp to subdir because otherwise we won't find it if we're
+ # using a relative directory.
+ cp "$am_depcomp" conftest.dir
+ cd conftest.dir
+ # We will build objects and dependencies in a subdirectory because
+ # it helps to detect inapplicable dependency modes. For instance
+ # both Tru64's cc and ICC support -MD to output dependencies as a
+ # side effect of compilation, but ICC will put the dependencies in
+ # the current directory while Tru64 will put them in the object
+ # directory.
+ mkdir sub
+
+ am_cv_CC_dependencies_compiler_type=none
+ if test "$am_compiler_list" = ""; then
+ am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
+ fi
+ am__universal=false
+ case " $depcc " in #(
+ *\ -arch\ *\ -arch\ *) am__universal=true ;;
+ esac
+
+ for depmode in $am_compiler_list; do
+ # Setup a source with many dependencies, because some compilers
+ # like to wrap large dependency lists on column 80 (with \), and
+ # we should not choose a depcomp mode which is confused by this.
+ #
+ # We need to recreate these files for each test, as the compiler may
+ # overwrite some of them when testing with obscure command lines.
+ # This happens at least with the AIX C compiler.
+ : > sub/conftest.c
+ for i in 1 2 3 4 5 6; do
+ echo '#include "conftst'$i'.h"' >> sub/conftest.c
+ # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
+ # Solaris 10 /bin/sh.
+ echo '/* dummy */' > sub/conftst$i.h
+ done
+ echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+ # We check with '-c' and '-o' for the sake of the "dashmstdout"
+ # mode. It turns out that the SunPro C++ compiler does not properly
+ # handle '-M -o', and we need to detect this. Also, some Intel
+ # versions had trouble with output in subdirs.
+ am__obj=sub/conftest.${OBJEXT-o}
+ am__minus_obj="-o $am__obj"
+ case $depmode in
+ gcc)
+ # This depmode causes a compiler race in universal mode.
+ test "$am__universal" = false || continue
+ ;;
+ nosideeffect)
+ # After this tag, mechanisms are not by side-effect, so they'll
+ # only be used when explicitly requested.
+ if test "x$enable_dependency_tracking" = xyes; then
+ continue
+ else
+ break
+ fi
+ ;;
+ msvc7 | msvc7msys | msvisualcpp | msvcmsys)
+ # This compiler won't grok '-c -o', but also, the minuso test has
+ # not run yet. These depmodes are late enough in the game, and
+ # so weak that their functioning should not be impacted.
+ am__obj=conftest.${OBJEXT-o}
+ am__minus_obj=
+ ;;
+ none) break ;;
+ esac
+ if depmode=$depmode \
+ source=sub/conftest.c object=$am__obj \
+ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
+ >/dev/null 2>conftest.err &&
+ grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
+ grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+ grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
+ ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+ # icc doesn't choke on unknown options, it will just issue warnings
+ # or remarks (even with -Werror). So we grep stderr for any message
+ # that says an option was ignored or not supported.
+ # When given -MP, icc 7.0 and 7.1 complain thusly:
+ # icc: Command line warning: ignoring option '-M'; no argument required
+ # The diagnosis changed in icc 8.0:
+ # icc: Command line remark: option '-MP' not supported
+ if (grep 'ignoring option' conftest.err ||
+ grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
+ am_cv_CC_dependencies_compiler_type=$depmode
+ break
+ fi
+ fi
+ done
+
+ cd ..
+ rm -rf conftest.dir
+else
+ am_cv_CC_dependencies_compiler_type=none
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5
+$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; }
+CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
+
+ if
+ test "x$enable_dependency_tracking" != xno \
+ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then
+ am__fastdepCC_TRUE=
+ am__fastdepCC_FALSE='#'
+else
+ am__fastdepCC_TRUE='#'
+ am__fastdepCC_FALSE=
+fi
+
+
+
+# Check whether --enable-compiler-warnings was given.
+if test "${enable_compiler_warnings+set}" = set; then :
+ enableval=$enable_compiler_warnings;
+fi
+case $enable_compiler_warnings in #(
+ no | min | yes | max | all) :
+ ;; #(
+ *) :
+ if test "x$enable_maintainer_mode" = xyes; then :
+ enable_compiler_warnings=yes
+else
+ enable_compiler_warnings=min
+fi ;;
+esac
+
+
+if test "`cd $srcdir && pwd`" != "`pwd`"; then
+ # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
+ # is not polluted with repeated "-I."
+ am__isrc=' -I$(srcdir)'
+ # test to see if srcdir already configured
+ if test -f $srcdir/config.status; then
+ as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5
+ fi
+fi
+
+# test whether we have cygpath
+if test -z "$CYGPATH_W"; then
+ if (cygpath --version) >/dev/null 2>/dev/null; then
+ CYGPATH_W='cygpath -w'
+ else
+ CYGPATH_W=echo
+ fi
+fi
+
+
+# Define the identity of the package.
+ PACKAGE='gmp--tex-live-'
+ VERSION='6.0.0'
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE "$PACKAGE"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define VERSION "$VERSION"
+_ACEOF
+
+# Some tools Automake needs.
+
+ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"}
+
+
+AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"}
+
+
+AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"}
+
+
+AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"}
+
+
+MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
+
+# For better backward compatibility. To be removed once Automake 1.9.x
+# dies out for good. For more background, see:
+# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
+# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
+mkdir_p='$(MKDIR_P)'
+
+# We need awk for the "check" target. The system "awk" is bad on
+# some platforms.
+# Always define AMTAR for backward compatibility. Yes, it's still used
+# in the wild :-( We should find a proper way to deprecate it ...
+AMTAR='$${TAR-tar}'
+
+
+# We'll loop over all known methods to create a tar archive until one works.
+_am_tools='gnutar pax cpio none'
+
+am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'
+
+
+
+
+
+
+# POSIX will say in a future version that running "rm -f" with no argument
+# is OK; and we want to be able to make that assumption in our Makefile
+# recipes. So use an aggressive probe to check that the usage we want is
+# actually supported "in the wild" to an acceptable degree.
+# See automake bug#10828.
+# To make any issue more visible, cause the running configure to be aborted
+# by default if the 'rm' program in use doesn't match our expectations; the
+# user can still override this though.
+if rm -f && rm -fr && rm -rf; then : OK; else
+ cat >&2 <<'END'
+Oops!
+
+Your 'rm' program seems unable to run without file operands specified
+on the command line, even when the '-f' option is present. This is contrary
+to the behaviour of most rm programs out there, and not conforming with
+the upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542>
+
+Please tell bug-automake@gnu.org about your system, including the value
+of your $PATH and any error possibly output before this message. This
+can help us improve future automake versions.
+
+END
+ if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then
+ echo 'Configuration will proceed anyway, since you have set the' >&2
+ echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2
+ echo >&2
+ else
+ cat >&2 <<'END'
+Aborting the configuration process, to ensure you take notice of the issue.
+
+You can download and install GNU coreutils to get an 'rm' implementation
+that behaves properly: <http://www.gnu.org/software/coreutils/>.
+
+If you want to complete the configuration process using your problematic
+'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
+to "yes", and re-run configure.
+
+END
+ as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5
+ fi
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5
+$as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; }
+ # Check whether --enable-maintainer-mode was given.
+if test "${enable_maintainer_mode+set}" = set; then :
+ enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval
+else
+ USE_MAINTAINER_MODE=no
+fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5
+$as_echo "$USE_MAINTAINER_MODE" >&6; }
+ if test $USE_MAINTAINER_MODE = yes; then
+ MAINTAINER_MODE_TRUE=
+ MAINTAINER_MODE_FALSE='#'
+else
+ MAINTAINER_MODE_TRUE='#'
+ MAINTAINER_MODE_FALSE=
+fi
+
+ MAINT=$MAINTAINER_MODE_TRUE
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler accepts prototypes" >&5
+$as_echo_n "checking whether the compiler accepts prototypes... " >&6; }
+if ${kb_cv_c_prototypes+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdarg.h>
+int
+main ()
+{
+extern void foo(int i,...);
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ kb_cv_c_prototypes=yes
+else
+ kb_cv_c_prototypes=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $kb_cv_c_prototypes" >&5
+$as_echo "$kb_cv_c_prototypes" >&6; }
+if test "x$kb_cv_c_prototypes" = xno; then
+ as_fn_error $? "Sorry, your compiler does not understand prototypes." "$LINENO" 5
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking what warning flags to pass to the C compiler" >&5
+$as_echo_n "checking what warning flags to pass to the C compiler... " >&6; }
+if ${kpse_cv_warning_cflags+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test "x$GCC" = xyes; then
+ kpse_cv_warning_cflags=
+if test "x$enable_compiler_warnings" != xno; then
+ kpse_cv_warning_cflags="-Wimplicit -Wreturn-type"
+ case `$CC -dumpversion` in #(
+ 3.4.* | 4.*) :
+ kpse_cv_warning_cflags="$kpse_cv_warning_cflags -Wdeclaration-after-statement" ;; #(
+ *) :
+ ;;
+esac
+ case `$CC -dumpversion` in #(
+ 3.[234].* | 4.*) :
+ kpse_cv_warning_cflags="$kpse_cv_warning_cflags -Wno-unknown-pragmas" ;; #(
+ *) :
+ ;;
+esac
+ if test "x$enable_compiler_warnings" != xmin; then
+ kpse_cv_warning_cflags="-Wall -Wunused $kpse_cv_warning_cflags"
+ kpse_cv_warning_cflags="$kpse_cv_warning_cflags -Wmissing-prototypes -Wmissing-declarations"
+ if test "x$enable_compiler_warnings" != xyes; then
+ kpse_cv_warning_cflags="$kpse_cv_warning_cflags -Wparentheses -Wswitch -Wtrigraphs -Wpointer-arith"
+ kpse_cv_warning_cflags="$kpse_cv_warning_cflags -Wcast-qual -Wcast-align -Wwrite-strings"
+ case `$CC -dumpversion` in #(
+ 3.4.* | 4.*) :
+ kpse_cv_warning_cflags="$kpse_cv_warning_cflags -Wold-style-definition" ;; #(
+ *) :
+ ;;
+esac
+ if test "x$enable_compiler_warnings" != xmax; then
+ kpse_cv_warning_cflags="$kpse_cv_warning_cflags -Wshadow"
+ fi
+ fi
+ fi
+fi
+elif test "x$enable_compiler_warnings" = xno; then
+ kpse_cv_warning_cflags=
+else
+ kpse_cv_warning_cflags= # FIXME: warning flags for non-GNU C compilers
+fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $kpse_cv_warning_cflags" >&5
+$as_echo "$kpse_cv_warning_cflags" >&6; }
+WARNING_CFLAGS=$kpse_cv_warning_cflags
+
+
+
+
+
+
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}gcc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_CC="${ac_tool_prefix}gcc"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_CC"; then
+ ac_ct_CC=$CC
+ # Extract the first word of "gcc", so it can be a program name with args.
+set dummy gcc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_CC"; then
+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_CC="gcc"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_CC" = x; then
+ CC=""
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ CC=$ac_ct_CC
+ fi
+else
+ CC="$ac_cv_prog_CC"
+fi
+
+if test -z "$CC"; then
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}cc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_CC="${ac_tool_prefix}cc"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ fi
+fi
+if test -z "$CC"; then
+ # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+ ac_prog_rejected=no
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
+ ac_prog_rejected=yes
+ continue
+ fi
+ ac_cv_prog_CC="cc"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+if test $ac_prog_rejected = yes; then
+ # We found a bogon in the path, so make sure we never use it.
+ set dummy $ac_cv_prog_CC
+ shift
+ if test $# != 0; then
+ # We chose a different compiler from the bogus one.
+ # However, it has the same basename, so the bogon will be chosen
+ # first if we set CC to just the basename; use the full file name.
+ shift
+ ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
+ fi
+fi
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$CC"; then
+ if test -n "$ac_tool_prefix"; then
+ for ac_prog in cl.exe
+ do
+ # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$CC" && break
+ done
+fi
+if test -z "$CC"; then
+ ac_ct_CC=$CC
+ for ac_prog in cl.exe
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_CC"; then
+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_CC="$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$ac_ct_CC" && break
+done
+
+ if test "x$ac_ct_CC" = x; then
+ CC=""
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ CC=$ac_ct_CC
+ fi
+fi
+
+fi
+
+
+test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "no acceptable C compiler found in \$PATH
+See \`config.log' for more details" "$LINENO" 5; }
+
+# Provide some information about the compiler.
+$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
+set X $ac_compile
+ac_compiler=$2
+for ac_option in --version -v -V -qversion; do
+ { { ac_try="$ac_compiler $ac_option >&5"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_compiler $ac_option >&5") 2>conftest.err
+ ac_status=$?
+ if test -s conftest.err; then
+ sed '10a\
+... rest of stderr output deleted ...
+ 10q' conftest.err >conftest.er1
+ cat conftest.er1 >&5
+ fi
+ rm -f conftest.er1 conftest.err
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }
+done
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5
+$as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
+if ${ac_cv_c_compiler_gnu+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+#ifndef __GNUC__
+ choke me
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_compiler_gnu=yes
+else
+ ac_compiler_gnu=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_c_compiler_gnu=$ac_compiler_gnu
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5
+$as_echo "$ac_cv_c_compiler_gnu" >&6; }
+if test $ac_compiler_gnu = yes; then
+ GCC=yes
+else
+ GCC=
+fi
+ac_test_CFLAGS=${CFLAGS+set}
+ac_save_CFLAGS=$CFLAGS
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
+$as_echo_n "checking whether $CC accepts -g... " >&6; }
+if ${ac_cv_prog_cc_g+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_save_c_werror_flag=$ac_c_werror_flag
+ ac_c_werror_flag=yes
+ ac_cv_prog_cc_g=no
+ CFLAGS="-g"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_prog_cc_g=yes
+else
+ CFLAGS=""
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+else
+ ac_c_werror_flag=$ac_save_c_werror_flag
+ CFLAGS="-g"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_prog_cc_g=yes
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ ac_c_werror_flag=$ac_save_c_werror_flag
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5
+$as_echo "$ac_cv_prog_cc_g" >&6; }
+if test "$ac_test_CFLAGS" = set; then
+ CFLAGS=$ac_save_CFLAGS
+elif test $ac_cv_prog_cc_g = yes; then
+ if test "$GCC" = yes; then
+ CFLAGS="-g -O2"
+ else
+ CFLAGS="-g"
+ fi
+else
+ if test "$GCC" = yes; then
+ CFLAGS="-O2"
+ else
+ CFLAGS=
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
+$as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
+if ${ac_cv_prog_cc_c89+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_cv_prog_cc_c89=no
+ac_save_CC=$CC
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdarg.h>
+#include <stdio.h>
+struct stat;
+/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
+struct buf { int x; };
+FILE * (*rcsopen) (struct buf *, struct stat *, int);
+static char *e (p, i)
+ char **p;
+ int i;
+{
+ return p[i];
+}
+static char *f (char * (*g) (char **, int), char **p, ...)
+{
+ char *s;
+ va_list v;
+ va_start (v,p);
+ s = g (p, va_arg (v,int));
+ va_end (v);
+ return s;
+}
+
+/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has
+ function prototypes and stuff, but not '\xHH' hex character constants.
+ These don't provoke an error unfortunately, instead are silently treated
+ as 'x'. The following induces an error, until -std is added to get
+ proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an
+ array size at least. It's necessary to write '\x00'==0 to get something
+ that's true only with -std. */
+int osf4_cc_array ['\x00' == 0 ? 1 : -1];
+
+/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
+ inside strings and character constants. */
+#define FOO(x) 'x'
+int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
+
+int test (int i, double x);
+struct s1 {int (*f) (int a);};
+struct s2 {int (*f) (double a);};
+int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
+int argc;
+char **argv;
+int
+main ()
+{
+return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
+ ;
+ return 0;
+}
+_ACEOF
+for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
+ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+do
+ CC="$ac_save_CC $ac_arg"
+ if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_prog_cc_c89=$ac_arg
+fi
+rm -f core conftest.err conftest.$ac_objext
+ test "x$ac_cv_prog_cc_c89" != "xno" && break
+done
+rm -f conftest.$ac_ext
+CC=$ac_save_CC
+
+fi
+# AC_CACHE_VAL
+case "x$ac_cv_prog_cc_c89" in
+ x)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
+$as_echo "none needed" >&6; } ;;
+ xno)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
+$as_echo "unsupported" >&6; } ;;
+ *)
+ CC="$CC $ac_cv_prog_cc_c89"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
+$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
+esac
+if test "x$ac_cv_prog_cc_c89" != xno; then :
+
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5
+$as_echo_n "checking whether $CC understands -c and -o together... " >&6; }
+if ${am_cv_prog_cc_c_o+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+ # Make sure it works both with $CC and with simple cc.
+ # Following AC_PROG_CC_C_O, we do the test twice because some
+ # compilers refuse to overwrite an existing .o file with -o,
+ # though they will create one.
+ am_cv_prog_cc_c_o=yes
+ for am_i in 1 2; do
+ if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5
+ ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } \
+ && test -f conftest2.$ac_objext; then
+ : OK
+ else
+ am_cv_prog_cc_c_o=no
+ break
+ fi
+ done
+ rm -f core conftest*
+ unset am_i
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5
+$as_echo "$am_cv_prog_cc_c_o" >&6; }
+if test "$am_cv_prog_cc_c_o" != yes; then
+ # Losing compiler, so override with the script.
+ # FIXME: It is wrong to rewrite CC.
+ # But if we don't then we get into trouble of one sort or another.
+ # A longer-term fix would be to have automake use am__CC in this case,
+ # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
+ CC="$am_aux_dir/compile $CC"
+fi
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+depcc="$CC" am_compiler_list=
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
+$as_echo_n "checking dependency style of $depcc... " >&6; }
+if ${am_cv_CC_dependencies_compiler_type+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+ # We make a subdir and do the tests there. Otherwise we can end up
+ # making bogus files that we don't know about and never remove. For
+ # instance it was reported that on HP-UX the gcc test will end up
+ # making a dummy file named 'D' -- because '-MD' means "put the output
+ # in D".
+ rm -rf conftest.dir
+ mkdir conftest.dir
+ # Copy depcomp to subdir because otherwise we won't find it if we're
+ # using a relative directory.
+ cp "$am_depcomp" conftest.dir
+ cd conftest.dir
+ # We will build objects and dependencies in a subdirectory because
+ # it helps to detect inapplicable dependency modes. For instance
+ # both Tru64's cc and ICC support -MD to output dependencies as a
+ # side effect of compilation, but ICC will put the dependencies in
+ # the current directory while Tru64 will put them in the object
+ # directory.
+ mkdir sub
+
+ am_cv_CC_dependencies_compiler_type=none
+ if test "$am_compiler_list" = ""; then
+ am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
+ fi
+ am__universal=false
+ case " $depcc " in #(
+ *\ -arch\ *\ -arch\ *) am__universal=true ;;
+ esac
+
+ for depmode in $am_compiler_list; do
+ # Setup a source with many dependencies, because some compilers
+ # like to wrap large dependency lists on column 80 (with \), and
+ # we should not choose a depcomp mode which is confused by this.
+ #
+ # We need to recreate these files for each test, as the compiler may
+ # overwrite some of them when testing with obscure command lines.
+ # This happens at least with the AIX C compiler.
+ : > sub/conftest.c
+ for i in 1 2 3 4 5 6; do
+ echo '#include "conftst'$i'.h"' >> sub/conftest.c
+ # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
+ # Solaris 10 /bin/sh.
+ echo '/* dummy */' > sub/conftst$i.h
+ done
+ echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+ # We check with '-c' and '-o' for the sake of the "dashmstdout"
+ # mode. It turns out that the SunPro C++ compiler does not properly
+ # handle '-M -o', and we need to detect this. Also, some Intel
+ # versions had trouble with output in subdirs.
+ am__obj=sub/conftest.${OBJEXT-o}
+ am__minus_obj="-o $am__obj"
+ case $depmode in
+ gcc)
+ # This depmode causes a compiler race in universal mode.
+ test "$am__universal" = false || continue
+ ;;
+ nosideeffect)
+ # After this tag, mechanisms are not by side-effect, so they'll
+ # only be used when explicitly requested.
+ if test "x$enable_dependency_tracking" = xyes; then
+ continue
+ else
+ break
+ fi
+ ;;
+ msvc7 | msvc7msys | msvisualcpp | msvcmsys)
+ # This compiler won't grok '-c -o', but also, the minuso test has
+ # not run yet. These depmodes are late enough in the game, and
+ # so weak that their functioning should not be impacted.
+ am__obj=conftest.${OBJEXT-o}
+ am__minus_obj=
+ ;;
+ none) break ;;
+ esac
+ if depmode=$depmode \
+ source=sub/conftest.c object=$am__obj \
+ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
+ >/dev/null 2>conftest.err &&
+ grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
+ grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+ grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
+ ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+ # icc doesn't choke on unknown options, it will just issue warnings
+ # or remarks (even with -Werror). So we grep stderr for any message
+ # that says an option was ignored or not supported.
+ # When given -MP, icc 7.0 and 7.1 complain thusly:
+ # icc: Command line warning: ignoring option '-M'; no argument required
+ # The diagnosis changed in icc 8.0:
+ # icc: Command line remark: option '-MP' not supported
+ if (grep 'ignoring option' conftest.err ||
+ grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
+ am_cv_CC_dependencies_compiler_type=$depmode
+ break
+ fi
+ fi
+ done
+
+ cd ..
+ rm -rf conftest.dir
+else
+ am_cv_CC_dependencies_compiler_type=none
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5
+$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; }
+CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
+
+ if
+ test "x$enable_dependency_tracking" != xno \
+ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then
+ am__fastdepCC_TRUE=
+ am__fastdepCC_FALSE='#'
+else
+ am__fastdepCC_TRUE='#'
+ am__fastdepCC_FALSE=
+fi
+
+
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ranlib; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_RANLIB+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$RANLIB"; then
+ ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+RANLIB=$ac_cv_prog_RANLIB
+if test -n "$RANLIB"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5
+$as_echo "$RANLIB" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_RANLIB"; then
+ ac_ct_RANLIB=$RANLIB
+ # Extract the first word of "ranlib", so it can be a program name with args.
+set dummy ranlib; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_RANLIB+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_RANLIB"; then
+ ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_RANLIB="ranlib"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
+if test -n "$ac_ct_RANLIB"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5
+$as_echo "$ac_ct_RANLIB" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_RANLIB" = x; then
+ RANLIB=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ RANLIB=$ac_ct_RANLIB
+ fi
+else
+ RANLIB="$ac_cv_prog_RANLIB"
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5
+$as_echo_n "checking whether ln -s works... " >&6; }
+LN_S=$as_ln_s
+if test "$LN_S" = "ln -s"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5
+$as_echo "no, using $LN_S" >&6; }
+fi
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C99" >&5
+$as_echo_n "checking for $CC option to accept ISO C99... " >&6; }
+if ${ac_cv_prog_cc_c99+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_cv_prog_cc_c99=no
+ac_save_CC=$CC
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdarg.h>
+#include <stdbool.h>
+#include <stdlib.h>
+#include <wchar.h>
+#include <stdio.h>
+
+// Check varargs macros. These examples are taken from C99 6.10.3.5.
+#define debug(...) fprintf (stderr, __VA_ARGS__)
+#define showlist(...) puts (#__VA_ARGS__)
+#define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__))
+static void
+test_varargs_macros (void)
+{
+ int x = 1234;
+ int y = 5678;
+ debug ("Flag");
+ debug ("X = %d\n", x);
+ showlist (The first, second, and third items.);
+ report (x>y, "x is %d but y is %d", x, y);
+}
+
+// Check long long types.
+#define BIG64 18446744073709551615ull
+#define BIG32 4294967295ul
+#define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0)
+#if !BIG_OK
+ your preprocessor is broken;
+#endif
+#if BIG_OK
+#else
+ your preprocessor is broken;
+#endif
+static long long int bignum = -9223372036854775807LL;
+static unsigned long long int ubignum = BIG64;
+
+struct incomplete_array
+{
+ int datasize;
+ double data[];
+};
+
+struct named_init {
+ int number;
+ const wchar_t *name;
+ double average;
+};
+
+typedef const char *ccp;
+
+static inline int
+test_restrict (ccp restrict text)
+{
+ // See if C++-style comments work.
+ // Iterate through items via the restricted pointer.
+ // Also check for declarations in for loops.
+ for (unsigned int i = 0; *(text+i) != '\0'; ++i)
+ continue;
+ return 0;
+}
+
+// Check varargs and va_copy.
+static void
+test_varargs (const char *format, ...)
+{
+ va_list args;
+ va_start (args, format);
+ va_list args_copy;
+ va_copy (args_copy, args);
+
+ const char *str;
+ int number;
+ float fnumber;
+
+ while (*format)
+ {
+ switch (*format++)
+ {
+ case 's': // string
+ str = va_arg (args_copy, const char *);
+ break;
+ case 'd': // int
+ number = va_arg (args_copy, int);
+ break;
+ case 'f': // float
+ fnumber = va_arg (args_copy, double);
+ break;
+ default:
+ break;
+ }
+ }
+ va_end (args_copy);
+ va_end (args);
+}
+
+int
+main ()
+{
+
+ // Check bool.
+ _Bool success = false;
+
+ // Check restrict.
+ if (test_restrict ("String literal") == 0)
+ success = true;
+ char *restrict newvar = "Another string";
+
+ // Check varargs.
+ test_varargs ("s, d' f .", "string", 65, 34.234);
+ test_varargs_macros ();
+
+ // Check flexible array members.
+ struct incomplete_array *ia =
+ malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10));
+ ia->datasize = 10;
+ for (int i = 0; i < ia->datasize; ++i)
+ ia->data[i] = i * 1.234;
+
+ // Check named initializers.
+ struct named_init ni = {
+ .number = 34,
+ .name = L"Test wide string",
+ .average = 543.34343,
+ };
+
+ ni.number = 58;
+
+ int dynamic_array[ni.number];
+ dynamic_array[ni.number - 1] = 543;
+
+ // work around unused variable warnings
+ return (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == 'x'
+ || dynamic_array[ni.number - 1] != 543);
+
+ ;
+ return 0;
+}
+_ACEOF
+for ac_arg in '' -std=gnu99 -std=c99 -c99 -AC99 -D_STDC_C99= -qlanglvl=extc99
+do
+ CC="$ac_save_CC $ac_arg"
+ if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_prog_cc_c99=$ac_arg
+fi
+rm -f core conftest.err conftest.$ac_objext
+ test "x$ac_cv_prog_cc_c99" != "xno" && break
+done
+rm -f conftest.$ac_ext
+CC=$ac_save_CC
+
+fi
+# AC_CACHE_VAL
+case "x$ac_cv_prog_cc_c99" in
+ x)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
+$as_echo "none needed" >&6; } ;;
+ xno)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
+$as_echo "unsupported" >&6; } ;;
+ *)
+ CC="$CC $ac_cv_prog_cc_c99"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5
+$as_echo "$ac_cv_prog_cc_c99" >&6; } ;;
+esac
+if test "x$ac_cv_prog_cc_c99" != xno; then :
+
+fi
+
+
+CFLAGS="$CFLAGS -DNO_ASM"
+
+ac_config_headers="$ac_config_headers config.h"
+
+
+# Make sure we can run config.sub.
+$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
+ as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5
+$as_echo_n "checking build system type... " >&6; }
+if ${ac_cv_build+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_build_alias=$build_alias
+test "x$ac_build_alias" = x &&
+ ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
+test "x$ac_build_alias" = x &&
+ as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5
+ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
+ as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5
+$as_echo "$ac_cv_build" >&6; }
+case $ac_cv_build in
+*-*-*) ;;
+*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;;
+esac
+build=$ac_cv_build
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_build
+shift
+build_cpu=$1
+build_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+build_os=$*
+IFS=$ac_save_IFS
+case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5
+$as_echo_n "checking host system type... " >&6; }
+if ${ac_cv_host+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test "x$host_alias" = x; then
+ ac_cv_host=$ac_cv_build
+else
+ ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
+ as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5
+$as_echo "$ac_cv_host" >&6; }
+case $ac_cv_host in
+*-*-*) ;;
+*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;;
+esac
+host=$ac_cv_host
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_host
+shift
+host_cpu=$1
+host_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+host_os=$*
+IFS=$ac_save_IFS
+case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
+
+
+if test "x$host_alias" != x && test "x$build_alias" = x; then :
+ as_fn_error $? "when cross-compiling you must specify both --host and --build." "$LINENO" 5
+fi
+eval kpse_build_alias=\${build_alias-$build}
+
+
+for ac_func in memset raise strchr
+do :
+ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether gcc __attribute__ ((const)) works" >&5
+$as_echo_n "checking whether gcc __attribute__ ((const)) works... " >&6; }
+if ${gmp_cv_c_attribute_const+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int foo (int x) __attribute__ ((const));
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ gmp_cv_c_attribute_const=yes
+else
+ gmp_cv_c_attribute_const=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gmp_cv_c_attribute_const" >&5
+$as_echo "$gmp_cv_c_attribute_const" >&6; }
+if test $gmp_cv_c_attribute_const = yes; then
+
+$as_echo "#define HAVE_ATTRIBUTE_CONST 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether gcc __attribute__ ((malloc)) works" >&5
+$as_echo_n "checking whether gcc __attribute__ ((malloc)) works... " >&6; }
+if ${gmp_cv_c_attribute_malloc+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ gmp_cv_c_attribute_malloc=no
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+void *foo (int x) __attribute__ ((malloc));
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ if grep "attribute directive ignored" conftest.err >/dev/null; then :
+
+else
+ gmp_cv_c_attribute_malloc=yes
+fi
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gmp_cv_c_attribute_malloc" >&5
+$as_echo "$gmp_cv_c_attribute_malloc" >&6; }
+if test $gmp_cv_c_attribute_malloc = yes; then
+
+$as_echo "#define HAVE_ATTRIBUTE_MALLOC 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether gcc __attribute__ ((mode (XX))) works" >&5
+$as_echo_n "checking whether gcc __attribute__ ((mode (XX))) works... " >&6; }
+if ${gmp_cv_c_attribute_mode+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+typedef int SItype __attribute__ ((mode (SI)));
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ gmp_cv_c_attribute_mode=yes
+else
+ gmp_cv_c_attribute_mode=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gmp_cv_c_attribute_mode" >&5
+$as_echo "$gmp_cv_c_attribute_mode" >&6; }
+if test $gmp_cv_c_attribute_mode = yes; then
+
+$as_echo "#define HAVE_ATTRIBUTE_MODE 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether gcc __attribute__ ((noreturn)) works" >&5
+$as_echo_n "checking whether gcc __attribute__ ((noreturn)) works... " >&6; }
+if ${gmp_cv_c_attribute_noreturn+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+void foo (int x) __attribute__ ((noreturn));
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ gmp_cv_c_attribute_noreturn=yes
+else
+ gmp_cv_c_attribute_noreturn=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gmp_cv_c_attribute_noreturn" >&5
+$as_echo "$gmp_cv_c_attribute_noreturn" >&6; }
+if test $gmp_cv_c_attribute_noreturn = yes; then
+
+$as_echo "#define HAVE_ATTRIBUTE_NORETURN 1" >>confdefs.h
+
+fi
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5
+$as_echo_n "checking how to run the C preprocessor... " >&6; }
+# On Suns, sometimes $CPP names a directory.
+if test -n "$CPP" && test -d "$CPP"; then
+ CPP=
+fi
+if test -z "$CPP"; then
+ if ${ac_cv_prog_CPP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ # Double quotes because CPP needs to be expanded
+ for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
+ do
+ ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+ # Use a header file that comes with gcc, so configuring glibc
+ # with a fresh cross-compiler works.
+ # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ # <limits.h> exists even on freestanding compilers.
+ # On the NeXT, cc -E runs the code through the compiler's parser,
+ # not just through cpp. "Syntax error" is here to catch this case.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+ Syntax error
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+
+else
+ # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+ # OK, works on sane cases. Now check whether nonexistent headers
+ # can be detected and how.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <ac_nonexistent.h>
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+ # Broken: success on invalid input.
+continue
+else
+ # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.i conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then :
+ break
+fi
+
+ done
+ ac_cv_prog_CPP=$CPP
+
+fi
+ CPP=$ac_cv_prog_CPP
+else
+ ac_cv_prog_CPP=$CPP
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5
+$as_echo "$CPP" >&6; }
+ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+ # Use a header file that comes with gcc, so configuring glibc
+ # with a fresh cross-compiler works.
+ # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ # <limits.h> exists even on freestanding compilers.
+ # On the NeXT, cc -E runs the code through the compiler's parser,
+ # not just through cpp. "Syntax error" is here to catch this case.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+ Syntax error
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+
+else
+ # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+ # OK, works on sane cases. Now check whether nonexistent headers
+ # can be detected and how.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <ac_nonexistent.h>
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+ # Broken: success on invalid input.
+continue
+else
+ # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.i conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then :
+
+else
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details" "$LINENO" 5; }
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
+$as_echo_n "checking for grep that handles long lines and -e... " >&6; }
+if ${ac_cv_path_GREP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -z "$GREP"; then
+ ac_path_GREP_found=false
+ # Loop through the user's path and test for each of PROGNAME-LIST
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_prog in grep ggrep; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
+ as_fn_executable_p "$ac_path_GREP" || continue
+# Check for GNU ac_path_GREP and select it if it is found.
+ # Check for GNU $ac_path_GREP
+case `"$ac_path_GREP" --version 2>&1` in
+*GNU*)
+ ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
+*)
+ ac_count=0
+ $as_echo_n 0123456789 >"conftest.in"
+ while :
+ do
+ cat "conftest.in" "conftest.in" >"conftest.tmp"
+ mv "conftest.tmp" "conftest.in"
+ cp "conftest.in" "conftest.nl"
+ $as_echo 'GREP' >> "conftest.nl"
+ "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+ diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+ as_fn_arith $ac_count + 1 && ac_count=$as_val
+ if test $ac_count -gt ${ac_path_GREP_max-0}; then
+ # Best one so far, save it but keep looking for a better one
+ ac_cv_path_GREP="$ac_path_GREP"
+ ac_path_GREP_max=$ac_count
+ fi
+ # 10*(2^10) chars as input seems more than enough
+ test $ac_count -gt 10 && break
+ done
+ rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+ $ac_path_GREP_found && break 3
+ done
+ done
+ done
+IFS=$as_save_IFS
+ if test -z "$ac_cv_path_GREP"; then
+ as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+ fi
+else
+ ac_cv_path_GREP=$GREP
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5
+$as_echo "$ac_cv_path_GREP" >&6; }
+ GREP="$ac_cv_path_GREP"
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
+$as_echo_n "checking for egrep... " >&6; }
+if ${ac_cv_path_EGREP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
+ then ac_cv_path_EGREP="$GREP -E"
+ else
+ if test -z "$EGREP"; then
+ ac_path_EGREP_found=false
+ # Loop through the user's path and test for each of PROGNAME-LIST
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_prog in egrep; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
+ as_fn_executable_p "$ac_path_EGREP" || continue
+# Check for GNU ac_path_EGREP and select it if it is found.
+ # Check for GNU $ac_path_EGREP
+case `"$ac_path_EGREP" --version 2>&1` in
+*GNU*)
+ ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
+*)
+ ac_count=0
+ $as_echo_n 0123456789 >"conftest.in"
+ while :
+ do
+ cat "conftest.in" "conftest.in" >"conftest.tmp"
+ mv "conftest.tmp" "conftest.in"
+ cp "conftest.in" "conftest.nl"
+ $as_echo 'EGREP' >> "conftest.nl"
+ "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+ diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+ as_fn_arith $ac_count + 1 && ac_count=$as_val
+ if test $ac_count -gt ${ac_path_EGREP_max-0}; then
+ # Best one so far, save it but keep looking for a better one
+ ac_cv_path_EGREP="$ac_path_EGREP"
+ ac_path_EGREP_max=$ac_count
+ fi
+ # 10*(2^10) chars as input seems more than enough
+ test $ac_count -gt 10 && break
+ done
+ rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+ $ac_path_EGREP_found && break 3
+ done
+ done
+ done
+IFS=$as_save_IFS
+ if test -z "$ac_cv_path_EGREP"; then
+ as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+ fi
+else
+ ac_cv_path_EGREP=$EGREP
+fi
+
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5
+$as_echo "$ac_cv_path_EGREP" >&6; }
+ EGREP="$ac_cv_path_EGREP"
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
+$as_echo_n "checking for ANSI C header files... " >&6; }
+if ${ac_cv_header_stdc+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <float.h>
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_header_stdc=yes
+else
+ ac_cv_header_stdc=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+if test $ac_cv_header_stdc = yes; then
+ # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <string.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "memchr" >/dev/null 2>&1; then :
+
+else
+ ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+ # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdlib.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "free" >/dev/null 2>&1; then :
+
+else
+ ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+ # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
+ if test "$cross_compiling" = yes; then :
+ :
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <ctype.h>
+#include <stdlib.h>
+#if ((' ' & 0x0FF) == 0x020)
+# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
+# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
+#else
+# define ISLOWER(c) \
+ (('a' <= (c) && (c) <= 'i') \
+ || ('j' <= (c) && (c) <= 'r') \
+ || ('s' <= (c) && (c) <= 'z'))
+# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
+#endif
+
+#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
+int
+main ()
+{
+ int i;
+ for (i = 0; i < 256; i++)
+ if (XOR (islower (i), ISLOWER (i))
+ || toupper (i) != TOUPPER (i))
+ return 2;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+
+else
+ ac_cv_header_stdc=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5
+$as_echo "$ac_cv_header_stdc" >&6; }
+if test $ac_cv_header_stdc = yes; then
+
+$as_echo "#define STDC_HEADERS 1" >>confdefs.h
+
+fi
+
+# On IRIX 5.3, sys/types and inttypes.h are conflicting.
+for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
+ inttypes.h stdint.h unistd.h
+do :
+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
+"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+ac_fn_c_check_type "$LINENO" "long long" "ac_cv_type_long_long" "$ac_includes_default"
+if test "x$ac_cv_type_long_long" = xyes; then :
+
+fi
+
+
+# The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of void *" >&5
+$as_echo_n "checking size of void *... " >&6; }
+if ${ac_cv_sizeof_void_p+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (void *))" "ac_cv_sizeof_void_p" "$ac_includes_default"; then :
+
+else
+ if test "$ac_cv_type_void_p" = yes; then
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "cannot compute sizeof (void *)
+See \`config.log' for more details" "$LINENO" 5; }
+ else
+ ac_cv_sizeof_void_p=0
+ fi
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_void_p" >&5
+$as_echo "$ac_cv_sizeof_void_p" >&6; }
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_VOID_P $ac_cv_sizeof_void_p
+_ACEOF
+
+
+# The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of unsigned short" >&5
+$as_echo_n "checking size of unsigned short... " >&6; }
+if ${ac_cv_sizeof_unsigned_short+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (unsigned short))" "ac_cv_sizeof_unsigned_short" "$ac_includes_default"; then :
+
+else
+ if test "$ac_cv_type_unsigned_short" = yes; then
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "cannot compute sizeof (unsigned short)
+See \`config.log' for more details" "$LINENO" 5; }
+ else
+ ac_cv_sizeof_unsigned_short=0
+ fi
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_unsigned_short" >&5
+$as_echo "$ac_cv_sizeof_unsigned_short" >&6; }
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_UNSIGNED_SHORT $ac_cv_sizeof_unsigned_short
+_ACEOF
+
+
+# The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of unsigned" >&5
+$as_echo_n "checking size of unsigned... " >&6; }
+if ${ac_cv_sizeof_unsigned+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (unsigned))" "ac_cv_sizeof_unsigned" "$ac_includes_default"; then :
+
+else
+ if test "$ac_cv_type_unsigned" = yes; then
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "cannot compute sizeof (unsigned)
+See \`config.log' for more details" "$LINENO" 5; }
+ else
+ ac_cv_sizeof_unsigned=0
+ fi
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_unsigned" >&5
+$as_echo "$ac_cv_sizeof_unsigned" >&6; }
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_UNSIGNED $ac_cv_sizeof_unsigned
+_ACEOF
+
+
+# The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of unsigned long" >&5
+$as_echo_n "checking size of unsigned long... " >&6; }
+if ${ac_cv_sizeof_unsigned_long+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (unsigned long))" "ac_cv_sizeof_unsigned_long" "$ac_includes_default"; then :
+
+else
+ if test "$ac_cv_type_unsigned_long" = yes; then
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "cannot compute sizeof (unsigned long)
+See \`config.log' for more details" "$LINENO" 5; }
+ else
+ ac_cv_sizeof_unsigned_long=0
+ fi
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_unsigned_long" >&5
+$as_echo "$ac_cv_sizeof_unsigned_long" >&6; }
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_UNSIGNED_LONG $ac_cv_sizeof_unsigned_long
+_ACEOF
+
+
+# The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of unsigned long long" >&5
+$as_echo_n "checking size of unsigned long long... " >&6; }
+if ${ac_cv_sizeof_unsigned_long_long+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (unsigned long long))" "ac_cv_sizeof_unsigned_long_long" "$ac_includes_default"; then :
+
+else
+ if test "$ac_cv_type_unsigned_long_long" = yes; then
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "cannot compute sizeof (unsigned long long)
+See \`config.log' for more details" "$LINENO" 5; }
+ else
+ ac_cv_sizeof_unsigned_long_long=0
+ fi
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_unsigned_long_long" >&5
+$as_echo "$ac_cv_sizeof_unsigned_long_long" >&6; }
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_UNSIGNED_LONG_LONG $ac_cv_sizeof_unsigned_long_long
+_ACEOF
+
+
+
+case $host in #(
+ x86_64-*-cygwin) :
+ gmp_limb=longlong ;; #(
+ *) :
+ if test $ac_cv_sizeof_void_p -gt $ac_cv_sizeof_unsigned_long; then :
+ if test $ac_cv_sizeof_void_p -le $ac_cv_sizeof_unsigned_long_long; then :
+ gmp_limb=longlong
+else
+ gmp_limb=unknown
+fi
+
+fi
+ ;;
+esac
+case $gmp_limb in #(
+ longlong) :
+ DEFN_LONG_LONG_LIMB="#define _LONG_LONG_LIMB 1"
+ gmp_limb_size=$ac_cv_sizeof_unsigned_long_long ;; #(
+ *) :
+ DEFN_LONG_LONG_LIMB="/* #undef _LONG_LONG_LIMB */"
+ gmp_limb_size=$ac_cv_sizeof_unsigned_long ;;
+esac
+
+GMP_LIMB_BITS=`expr 8 \* $gmp_limb_size`
+
+
+GMP_NAIL_BITS=0
+
+
+ # KPSE_GMP_H
+cat >gmp-tmp.h <<KPSE_EOF
+#define __GMP_WITHIN_CONFIGURE 1 /* ignore template stuff */
+#define GMP_NAIL_BITS $GMP_NAIL_BITS
+#define GMP_LIMB_BITS 123
+$DEFN_LONG_LONG_LIMB
+#include "$srcdir/gmp-6.0.0/gmp-h.in"
+KPSE_EOF
+
+
+
+# The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of mp_limb_t" >&5
+$as_echo_n "checking size of mp_limb_t... " >&6; }
+if ${ac_cv_sizeof_mp_limb_t+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (mp_limb_t))" "ac_cv_sizeof_mp_limb_t" "#include \"gmp-tmp.h\"
+"; then :
+
+else
+ if test "$ac_cv_type_mp_limb_t" = yes; then
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "cannot compute sizeof (mp_limb_t)
+See \`config.log' for more details" "$LINENO" 5; }
+ else
+ ac_cv_sizeof_mp_limb_t=0
+ fi
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_mp_limb_t" >&5
+$as_echo "$ac_cv_sizeof_mp_limb_t" >&6; }
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_MP_LIMB_T $ac_cv_sizeof_mp_limb_t
+_ACEOF
+
+
+
+
+# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
+# for constant arguments. Useless!
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working alloca.h" >&5
+$as_echo_n "checking for working alloca.h... " >&6; }
+if ${gmp_cv_header_alloca+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <alloca.h>
+int
+main ()
+{
+char *p = (char *) alloca (2 * sizeof (int));
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ gmp_cv_header_alloca=yes
+else
+ gmp_cv_header_alloca=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gmp_cv_header_alloca" >&5
+$as_echo "$gmp_cv_header_alloca" >&6; }
+if test "x$gmp_cv_header_alloca" = xyes; then
+
+$as_echo "#define HAVE_ALLOCA_H 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for alloca (via gmp-impl.h)" >&5
+$as_echo_n "checking for alloca (via gmp-impl.h)... " >&6; }
+if ${gmp_cv_func_alloca+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include "gmp-tmp.h"
+#include "$srcdir/gmp-6.0.0/gmp-impl.h"
+int
+main ()
+{
+char *p = (char *) alloca (1);
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ gmp_cv_func_alloca=yes
+else
+ gmp_cv_func_alloca=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gmp_cv_func_alloca" >&5
+$as_echo "$gmp_cv_func_alloca" >&6; }
+if test "x$gmp_cv_func_alloca" = xyes; then
+
+$as_echo "#define HAVE_ALLOCA 1" >>confdefs.h
+
+ $as_echo "#define WANT_TMP_ALLOCA 1" >>confdefs.h
+
+else
+ $as_echo "#define WANT_TMP_REENTRANT 1" >>confdefs.h
+
+fi
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking format of \`double' floating point" >&5
+$as_echo_n "checking format of \`double' floating point... " >&6; }
+if ${gmp_cv_c_double_format+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ gmp_cv_c_double_format=unknown
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+struct foo {
+ char before[8];
+ double x;
+ char after[8];
+};
+extern struct foo foo;
+struct foo foo = {
+ { '\001', '\043', '\105', '\147', '\211', '\253', '\315', '\357' },
+ -123456789.0,
+ { '\376', '\334', '\272', '\230', '\166', '\124', '\062', '\020' },
+};
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ cat >conftest.awk <<\EOF
+
+BEGIN {
+ found = 0
+}
+
+{
+ for (f = 2; f <= NF; f++)
+ {
+ for (i = 0; i < 23; i++)
+ got[i] = got[i+1];
+ got[23] = $f;
+
+ # match the special begin and end sequences
+ if (got[0] != "001") continue
+ if (got[1] != "043") continue
+ if (got[2] != "105") continue
+ if (got[3] != "147") continue
+ if (got[4] != "211") continue
+ if (got[5] != "253") continue
+ if (got[6] != "315") continue
+ if (got[7] != "357") continue
+ if (got[16] != "376") continue
+ if (got[17] != "334") continue
+ if (got[18] != "272") continue
+ if (got[19] != "230") continue
+ if (got[20] != "166") continue
+ if (got[21] != "124") continue
+ if (got[22] != "062") continue
+ if (got[23] != "020") continue
+
+ saw = " (" got[8] " " got[9] " " got[10] " " got[11] " " got[12] " " got[13] " " got[14] " " got[15] ")"
+
+ if (got[8] == "000" && \
+ got[9] == "000" && \
+ got[10] == "000" && \
+ got[11] == "124" && \
+ got[12] == "064" && \
+ got[13] == "157" && \
+ got[14] == "235" && \
+ got[15] == "301")
+ {
+ print "IEEE little endian"
+ found = 1
+ exit
+ }
+
+ # Little endian with the two 4-byte halves swapped, as used by ARM
+ # when the chip is in little endian mode.
+ #
+ if (got[8] == "064" && \
+ got[9] == "157" && \
+ got[10] == "235" && \
+ got[11] == "301" && \
+ got[12] == "000" && \
+ got[13] == "000" && \
+ got[14] == "000" && \
+ got[15] == "124")
+ {
+ print "IEEE little endian, swapped halves"
+ found = 1
+ exit
+ }
+
+ # gcc 2.95.4 on one GNU/Linux ARM system was seen generating 000 in
+ # the last byte, whereas 124 is correct. Not sure where the bug
+ # actually lies, but a running program didn't seem to get a full
+ # mantissa worth of working bits.
+ #
+ # We match this case explicitly so we can give a nice result message,
+ # but we deliberately exclude it from the normal IEEE double setups
+ # since it's too broken.
+ #
+ if (got[8] == "064" && \
+ got[9] == "157" && \
+ got[10] == "235" && \
+ got[11] == "301" && \
+ got[12] == "000" && \
+ got[13] == "000" && \
+ got[14] == "000" && \
+ got[15] == "000")
+ {
+ print "bad ARM software floats"
+ found = 1
+ exit
+ }
+
+ if (got[8] == "301" && \
+ got[9] == "235" && \
+ got[10] == "157" && \
+ got[11] == "064" && \
+ got[12] == "124" && \
+ got[13] == "000" && \
+ got[14] == "000" && \
+ got[15] == "000")
+ {
+ print "IEEE big endian"
+ found = 1
+ exit
+ }
+
+ if (got[8] == "353" && \
+ got[9] == "315" && \
+ got[10] == "242" && \
+ got[11] == "171" && \
+ got[12] == "000" && \
+ got[13] == "240" && \
+ got[14] == "000" && \
+ got[15] == "000")
+ {
+ print "VAX D"
+ found = 1
+ exit
+ }
+
+ if (got[8] == "275" && \
+ got[9] == "301" && \
+ got[10] == "064" && \
+ got[11] == "157" && \
+ got[12] == "000" && \
+ got[13] == "124" && \
+ got[14] == "000" && \
+ got[15] == "000")
+ {
+ print "VAX G"
+ found = 1
+ exit
+ }
+
+ if (got[8] == "300" && \
+ got[9] == "033" && \
+ got[10] == "353" && \
+ got[11] == "171" && \
+ got[12] == "242" && \
+ got[13] == "240" && \
+ got[14] == "000" && \
+ got[15] == "000")
+ {
+ print "Cray CFP"
+ found = 1
+ exit
+ }
+ }
+}
+
+END {
+ if (! found)
+ print "unknown", saw
+}
+
+EOF
+ gmp_cv_c_double_format=`od -b conftest.$ac_objext | $AWK -f conftest.awk`
+ case $gmp_cv_c_double_format in #(
+ unknown*) :
+ echo "cannot match anything, conftest.$ac_objext contains" >&5
+ od -b conftest.$ac_objext >&5 ;; #(
+ *) :
+ ;;
+esac
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: oops, cannot compile test program" >&5
+$as_echo "$as_me: WARNING: oops, cannot compile test program" >&2;}
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.awk
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gmp_cv_c_double_format" >&5
+$as_echo "$gmp_cv_c_double_format" >&6; }
+
+
+
+case $gmp_cv_c_double_format in #(
+ "IEEE big endian") :
+ $as_echo "#define HAVE_DOUBLE_IEEE_BIG_ENDIAN 1" >>confdefs.h
+ ;; #(
+ "IEEE little endian") :
+ $as_echo "#define HAVE_DOUBLE_IEEE_LITTLE_ENDIAN 1" >>confdefs.h
+ ;; #(
+ "IEEE little endian, swapped halves") :
+ $as_echo "#define HAVE_DOUBLE_IEEE_LITTLE_SWAPPED 1" >>confdefs.h
+ ;; #(
+ "VAX D") :
+ $as_echo "#define HAVE_DOUBLE_VAX_D 1" >>confdefs.h
+ ;; #(
+ "VAX G") :
+ $as_echo "#define HAVE_DOUBLE_VAX_G 1" >>confdefs.h
+ ;; #(
+ "Cray CFP") :
+ $as_echo "#define HAVE_DOUBLE_CRAY_CFP 1" >>confdefs.h
+ ;; #(
+ "bad ARM software floats") :
+ ;; #(
+ unknown*) :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Could not determine float format." >&5
+$as_echo "$as_me: WARNING: Could not determine float format." >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Conversions to and from \"double\" may be slow." >&5
+$as_echo "$as_me: WARNING: Conversions to and from \"double\" may be slow." >&2;} ;; #(
+ *) :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: oops, unrecognised float format: $gmp_cv_c_double_format" >&5
+$as_echo "$as_me: WARNING: oops, unrecognised float format: $gmp_cv_c_double_format" >&2;} ;;
+esac
+
+
+if test "x$enable_build" != xno || test -f config.force; then
+
+case $gmp_limb in #(
+ unknown) :
+ as_fn_error $? "Sorry, no suitable limb size" "$LINENO" 5 ;; #(
+ *) :
+ ;;
+esac
+
+if test "x$ac_cv_sizeof_mp_limb_t" != "x$gmp_limb_size"; then
+ as_fn_error $? "Oops, mp_limb_t doesn't seem to work" "$LINENO" 5
+fi
+
+echo timestamp >config.force
+fi
+
+ if test "x$enable_build" != xno; then
+ build_TRUE=
+ build_FALSE='#'
+else
+ build_TRUE='#'
+ build_FALSE=
+fi
+
+
+GMP_TREE=gmp-6.0.0
+
+
+HAVE_HOST_CPU_FAMILY_power=0
+
+HAVE_HOST_CPU_FAMILY_powerpc=0
+
+
+LIBGMP_DLL=0
+
+
+ac_config_files="$ac_config_files Makefile include/Makefile gmp.h:gmp-6.0.0/gmp-h.in"
+
+
+
+
+subdirs="$subdirs native"
+
+
+
+
+cat >confcache <<\_ACEOF
+# This file is a shell script that caches the results of configure
+# tests run on this system so they can be shared between configure
+# scripts and configure runs, see configure's option --config-cache.
+# It is not useful on other systems. If it contains results you don't
+# want to keep, you may remove or edit it.
+#
+# config.status only pays attention to the cache file if you give it
+# the --recheck option to rerun configure.
+#
+# `ac_cv_env_foo' variables (set or unset) will be overridden when
+# loading this file, other *unset* `ac_cv_foo' will be assigned the
+# following values.
+
+_ACEOF
+
+# The following way of writing the cache mishandles newlines in values,
+# but we know of no workaround that is simple, portable, and efficient.
+# So, we kill variables containing newlines.
+# Ultrix sh set writes to stderr and can't be redirected directly,
+# and sets the high bit in the cache file unless we assign to the vars.
+(
+ for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
+ eval ac_val=\$$ac_var
+ case $ac_val in #(
+ *${as_nl}*)
+ case $ac_var in #(
+ *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
+ esac
+ case $ac_var in #(
+ _ | IFS | as_nl) ;; #(
+ BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
+ *) { eval $ac_var=; unset $ac_var;} ;;
+ esac ;;
+ esac
+ done
+
+ (set) 2>&1 |
+ case $as_nl`(ac_space=' '; set) 2>&1` in #(
+ *${as_nl}ac_space=\ *)
+ # `set' does not quote correctly, so add quotes: double-quote
+ # substitution turns \\\\ into \\, and sed turns \\ into \.
+ sed -n \
+ "s/'/'\\\\''/g;
+ s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
+ ;; #(
+ *)
+ # `set' quotes correctly as required by POSIX, so do not add quotes.
+ sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+ ;;
+ esac |
+ sort
+) |
+ sed '
+ /^ac_cv_env_/b end
+ t clear
+ :clear
+ s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
+ t end
+ s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
+ :end' >>confcache
+if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
+ if test -w "$cache_file"; then
+ if test "x$cache_file" != "x/dev/null"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5
+$as_echo "$as_me: updating cache $cache_file" >&6;}
+ if test ! -f "$cache_file" || test -h "$cache_file"; then
+ cat confcache >"$cache_file"
+ else
+ case $cache_file in #(
+ */* | ?:*)
+ mv -f confcache "$cache_file"$$ &&
+ mv -f "$cache_file"$$ "$cache_file" ;; #(
+ *)
+ mv -f confcache "$cache_file" ;;
+ esac
+ fi
+ fi
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5
+$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
+ fi
+fi
+rm -f confcache
+
+test "x$prefix" = xNONE && prefix=$ac_default_prefix
+# Let make expand exec_prefix.
+test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
+
+DEFS=-DHAVE_CONFIG_H
+
+ac_libobjs=
+ac_ltlibobjs=
+U=
+for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
+ # 1. Remove the extension, and $U if already installed.
+ ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
+ ac_i=`$as_echo "$ac_i" | sed "$ac_script"`
+ # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR
+ # will be set to the directory where LIBOBJS objects are built.
+ as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext"
+ as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo'
+done
+LIBOBJS=$ac_libobjs
+
+LTLIBOBJS=$ac_ltlibobjs
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5
+$as_echo_n "checking that generated files are newer than configure... " >&6; }
+ if test -n "$am_sleep_pid"; then
+ # Hide warnings about reused PIDs.
+ wait $am_sleep_pid 2>/dev/null
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5
+$as_echo "done" >&6; }
+ if test -n "$EXEEXT"; then
+ am__EXEEXT_TRUE=
+ am__EXEEXT_FALSE='#'
+else
+ am__EXEEXT_TRUE='#'
+ am__EXEEXT_FALSE=
+fi
+
+if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then
+ as_fn_error $? "conditional \"MAINTAINER_MODE\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then
+ as_fn_error $? "conditional \"AMDEP\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
+ as_fn_error $? "conditional \"am__fastdepCC\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
+ as_fn_error $? "conditional \"am__fastdepCC\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${build_TRUE}" && test -z "${build_FALSE}"; then
+ as_fn_error $? "conditional \"build\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+
+: "${CONFIG_STATUS=./config.status}"
+ac_write_fail=0
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files $CONFIG_STATUS"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5
+$as_echo "$as_me: creating $CONFIG_STATUS" >&6;}
+as_write_fail=0
+cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1
+#! $SHELL
+# Generated by $as_me.
+# Run this file to recreate the current configuration.
+# Compiler output produced by configure, useful for debugging
+# configure, is in config.log if it exists.
+
+debug=false
+ac_cs_recheck=false
+ac_cs_silent=false
+
+SHELL=\${CONFIG_SHELL-$SHELL}
+export SHELL
+_ASEOF
+cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1
+## -------------------- ##
+## M4sh Initialization. ##
+## -------------------- ##
+
+# Be more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
+ emulate sh
+ NULLCMD=:
+ # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '${1+"$@"}'='"$@"'
+ setopt NO_GLOB_SUBST
+else
+ case `(set -o) 2>/dev/null` in #(
+ *posix*) :
+ set -o posix ;; #(
+ *) :
+ ;;
+esac
+fi
+
+
+as_nl='
+'
+export as_nl
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+# Prefer a ksh shell builtin over an external printf program on Solaris,
+# but without wasting forks for bash or zsh.
+if test -z "$BASH_VERSION$ZSH_VERSION" \
+ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
+ as_echo='print -r --'
+ as_echo_n='print -rn --'
+elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+ as_echo='printf %s\n'
+ as_echo_n='printf %s'
+else
+ if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+ as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
+ as_echo_n='/usr/ucb/echo -n'
+ else
+ as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+ as_echo_n_body='eval
+ arg=$1;
+ case $arg in #(
+ *"$as_nl"*)
+ expr "X$arg" : "X\\(.*\\)$as_nl";
+ arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+ esac;
+ expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+ '
+ export as_echo_n_body
+ as_echo_n='sh -c $as_echo_n_body as_echo'
+ fi
+ export as_echo_body
+ as_echo='sh -c $as_echo_body as_echo'
+fi
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+ PATH_SEPARATOR=:
+ (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
+ (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
+ PATH_SEPARATOR=';'
+ }
+fi
+
+
+# IFS
+# We need space, tab and new line, in precisely that order. Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+IFS=" "" $as_nl"
+
+# Find who we are. Look in the path if we contain no directory separator.
+as_myself=
+case $0 in #((
+ *[\\/]* ) as_myself=$0 ;;
+ *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+ done
+IFS=$as_save_IFS
+
+ ;;
+esac
+# We did not find ourselves, most probably we were run as `sh COMMAND'
+# in which case we are not to be found in the path.
+if test "x$as_myself" = x; then
+ as_myself=$0
+fi
+if test ! -f "$as_myself"; then
+ $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+ exit 1
+fi
+
+# Unset variables that we do not need and which cause bugs (e.g. in
+# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1"
+# suppresses any "Segmentation fault" message there. '((' could
+# trigger a bug in pdksh 5.2.14.
+for as_var in BASH_ENV ENV MAIL MAILPATH
+do eval test x\${$as_var+set} = xset \
+ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
+done
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
+
+# CDPATH.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+
+# as_fn_error STATUS ERROR [LINENO LOG_FD]
+# ----------------------------------------
+# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
+# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
+# script with STATUS, using 1 if that was 0.
+as_fn_error ()
+{
+ as_status=$1; test $as_status -eq 0 && as_status=1
+ if test "$4"; then
+ as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
+ fi
+ $as_echo "$as_me: error: $2" >&2
+ as_fn_exit $as_status
+} # as_fn_error
+
+
+# as_fn_set_status STATUS
+# -----------------------
+# Set $? to STATUS, without forking.
+as_fn_set_status ()
+{
+ return $1
+} # as_fn_set_status
+
+# as_fn_exit STATUS
+# -----------------
+# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
+as_fn_exit ()
+{
+ set +e
+ as_fn_set_status $1
+ exit $1
+} # as_fn_exit
+
+# as_fn_unset VAR
+# ---------------
+# Portably unset VAR.
+as_fn_unset ()
+{
+ { eval $1=; unset $1;}
+}
+as_unset=as_fn_unset
+# as_fn_append VAR VALUE
+# ----------------------
+# Append the text in VALUE to the end of the definition contained in VAR. Take
+# advantage of any shell optimizations that allow amortized linear growth over
+# repeated appends, instead of the typical quadratic growth present in naive
+# implementations.
+if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
+ eval 'as_fn_append ()
+ {
+ eval $1+=\$2
+ }'
+else
+ as_fn_append ()
+ {
+ eval $1=\$$1\$2
+ }
+fi # as_fn_append
+
+# as_fn_arith ARG...
+# ------------------
+# Perform arithmetic evaluation on the ARGs, and store the result in the
+# global $as_val. Take advantage of shells that can avoid forks. The arguments
+# must be portable across $(()) and expr.
+if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
+ eval 'as_fn_arith ()
+ {
+ as_val=$(( $* ))
+ }'
+else
+ as_fn_arith ()
+ {
+ as_val=`expr "$@" || test $? -eq 1`
+ }
+fi # as_fn_arith
+
+
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+ test "X`expr 00001 : '.*\(...\)'`" = X001; then
+ as_expr=expr
+else
+ as_expr=false
+fi
+
+if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
+ as_basename=basename
+else
+ as_basename=false
+fi
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+ as_dirname=dirname
+else
+ as_dirname=false
+fi
+
+as_me=`$as_basename -- "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+ X"$0" : 'X\(//\)$' \| \
+ X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X/"$0" |
+ sed '/^.*\/\([^/][^/]*\)\/*$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in #(((((
+-n*)
+ case `echo 'xy\c'` in
+ *c*) ECHO_T=' ';; # ECHO_T is single tab character.
+ xy) ECHO_C='\c';;
+ *) echo `echo ksh88 bug on AIX 6.1` > /dev/null
+ ECHO_T=' ';;
+ esac;;
+*)
+ ECHO_N='-n';;
+esac
+
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+ rm -f conf$$.dir/conf$$.file
+else
+ rm -f conf$$.dir
+ mkdir conf$$.dir 2>/dev/null
+fi
+if (echo >conf$$.file) 2>/dev/null; then
+ if ln -s conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s='ln -s'
+ # ... but there are two gotchas:
+ # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+ # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+ # In both cases, we have to default to `cp -pR'.
+ ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+ as_ln_s='cp -pR'
+ elif ln conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s=ln
+ else
+ as_ln_s='cp -pR'
+ fi
+else
+ as_ln_s='cp -pR'
+fi
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+
+# as_fn_mkdir_p
+# -------------
+# Create "$as_dir" as a directory, including parents if necessary.
+as_fn_mkdir_p ()
+{
+
+ case $as_dir in #(
+ -*) as_dir=./$as_dir;;
+ esac
+ test -d "$as_dir" || eval $as_mkdir_p || {
+ as_dirs=
+ while :; do
+ case $as_dir in #(
+ *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+ *) as_qdir=$as_dir;;
+ esac
+ as_dirs="'$as_qdir' $as_dirs"
+ as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$as_dir" : 'X\(//\)[^/]' \| \
+ X"$as_dir" : 'X\(//\)$' \| \
+ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_dir" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ test -d "$as_dir" && break
+ done
+ test -z "$as_dirs" || eval "mkdir $as_dirs"
+ } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
+
+
+} # as_fn_mkdir_p
+if mkdir -p . 2>/dev/null; then
+ as_mkdir_p='mkdir -p "$as_dir"'
+else
+ test -d ./-p && rmdir ./-p
+ as_mkdir_p=false
+fi
+
+
+# as_fn_executable_p FILE
+# -----------------------
+# Test if FILE is an executable regular file.
+as_fn_executable_p ()
+{
+ test -f "$1" && test -x "$1"
+} # as_fn_executable_p
+as_test_x='test -x'
+as_executable_p=as_fn_executable_p
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+
+exec 6>&1
+## ----------------------------------- ##
+## Main body of $CONFIG_STATUS script. ##
+## ----------------------------------- ##
+_ASEOF
+test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# Save the log message, to keep $0 and so on meaningful, and to
+# 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.0.0, which was
+generated by GNU Autoconf 2.69. Invocation command line was
+
+ CONFIG_FILES = $CONFIG_FILES
+ CONFIG_HEADERS = $CONFIG_HEADERS
+ CONFIG_LINKS = $CONFIG_LINKS
+ CONFIG_COMMANDS = $CONFIG_COMMANDS
+ $ $0 $@
+
+on `(hostname || uname -n) 2>/dev/null | sed 1q`
+"
+
+_ACEOF
+
+case $ac_config_files in *"
+"*) set x $ac_config_files; shift; ac_config_files=$*;;
+esac
+
+case $ac_config_headers in *"
+"*) set x $ac_config_headers; shift; ac_config_headers=$*;;
+esac
+
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+# Files that config.status was made for.
+config_files="$ac_config_files"
+config_headers="$ac_config_headers"
+config_commands="$ac_config_commands"
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+ac_cs_usage="\
+\`$as_me' instantiates files and other configuration actions
+from templates according to the current configuration. Unless the files
+and actions are specified as TAGs, all are instantiated by default.
+
+Usage: $0 [OPTION]... [TAG]...
+
+ -h, --help print this help, then exit
+ -V, --version print version number and configuration settings, then exit
+ --config print configuration, then exit
+ -q, --quiet, --silent
+ do not print progress messages
+ -d, --debug don't remove temporary files
+ --recheck update $as_me by reconfiguring in the same conditions
+ --file=FILE[:TEMPLATE]
+ instantiate the configuration file FILE
+ --header=FILE[:TEMPLATE]
+ instantiate the configuration header FILE
+
+Configuration files:
+$config_files
+
+Configuration headers:
+$config_headers
+
+Configuration commands:
+$config_commands
+
+Report bugs to <tex-k@tug.org>."
+
+_ACEOF
+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.0.0
+configured by $0, generated by GNU Autoconf 2.69,
+ with options \\"\$ac_cs_config\\"
+
+Copyright (C) 2012 Free Software Foundation, Inc.
+This config.status script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it."
+
+ac_pwd='$ac_pwd'
+srcdir='$srcdir'
+INSTALL='$INSTALL'
+MKDIR_P='$MKDIR_P'
+AWK='$AWK'
+test -n "\$AWK" || AWK=awk
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# The default lists apply if the user does not specify any file.
+ac_need_defaults=:
+while test $# != 0
+do
+ case $1 in
+ --*=?*)
+ ac_option=`expr "X$1" : 'X\([^=]*\)='`
+ ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
+ ac_shift=:
+ ;;
+ --*=)
+ ac_option=`expr "X$1" : 'X\([^=]*\)='`
+ ac_optarg=
+ ac_shift=:
+ ;;
+ *)
+ ac_option=$1
+ ac_optarg=$2
+ ac_shift=shift
+ ;;
+ esac
+
+ case $ac_option in
+ # Handling of the options.
+ -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+ ac_cs_recheck=: ;;
+ --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
+ $as_echo "$ac_cs_version"; exit ;;
+ --config | --confi | --conf | --con | --co | --c )
+ $as_echo "$ac_cs_config"; exit ;;
+ --debug | --debu | --deb | --de | --d | -d )
+ debug=: ;;
+ --file | --fil | --fi | --f )
+ $ac_shift
+ case $ac_optarg in
+ *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
+ '') as_fn_error $? "missing file argument" ;;
+ esac
+ as_fn_append CONFIG_FILES " '$ac_optarg'"
+ ac_need_defaults=false;;
+ --header | --heade | --head | --hea )
+ $ac_shift
+ case $ac_optarg in
+ *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
+ esac
+ as_fn_append CONFIG_HEADERS " '$ac_optarg'"
+ ac_need_defaults=false;;
+ --he | --h)
+ # Conflict between --help and --header
+ as_fn_error $? "ambiguous option: \`$1'
+Try \`$0 --help' for more information.";;
+ --help | --hel | -h )
+ $as_echo "$ac_cs_usage"; exit ;;
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil | --si | --s)
+ ac_cs_silent=: ;;
+
+ # This is an error.
+ -*) as_fn_error $? "unrecognized option: \`$1'
+Try \`$0 --help' for more information." ;;
+
+ *) as_fn_append ac_config_targets " $1"
+ ac_need_defaults=false ;;
+
+ esac
+ shift
+done
+
+ac_configure_extra_args=
+
+if $ac_cs_silent; then
+ exec 6>/dev/null
+ ac_configure_extra_args="$ac_configure_extra_args --silent"
+fi
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+if \$ac_cs_recheck; then
+ set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+ shift
+ \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
+ CONFIG_SHELL='$SHELL'
+ export CONFIG_SHELL
+ exec "\$@"
+fi
+
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+exec 5>>config.log
+{
+ echo
+ sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
+## Running $as_me. ##
+_ASBOX
+ $as_echo "$ac_log"
+} >&5
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+#
+# INIT-COMMANDS
+#
+AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+
+# Handling of arguments.
+for ac_config_target in $ac_config_targets
+do
+ case $ac_config_target in
+ "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
+ "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
+ "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
+ "include/Makefile") CONFIG_FILES="$CONFIG_FILES include/Makefile" ;;
+ "gmp.h") CONFIG_FILES="$CONFIG_FILES gmp.h:gmp-6.0.0/gmp-h.in" ;;
+
+ *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
+ esac
+done
+
+
+# If the user did not use the arguments to specify the items to instantiate,
+# then the envvar interface is used. Set only those that are not.
+# We use the long form for the default assignment because of an extremely
+# bizarre bug on SunOS 4.1.3.
+if $ac_need_defaults; then
+ test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
+ test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
+ test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
+fi
+
+# Have a temporary directory for convenience. Make it in the build tree
+# simply because there is no reason against having it here, and in addition,
+# creating and moving files from /tmp can sometimes cause problems.
+# Hook for its removal unless debugging.
+# Note that there is a small window in which the directory will not be cleaned:
+# after its creation but before its name has been assigned to `$tmp'.
+$debug ||
+{
+ tmp= ac_tmp=
+ trap 'exit_status=$?
+ : "${ac_tmp:=$tmp}"
+ { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status
+' 0
+ trap 'as_fn_exit 1' 1 2 13 15
+}
+# Create a (secure) tmp directory for tmp files.
+
+{
+ tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
+ test -d "$tmp"
+} ||
+{
+ tmp=./conf$$-$RANDOM
+ (umask 077 && mkdir "$tmp")
+} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5
+ac_tmp=$tmp
+
+# Set up the scripts for CONFIG_FILES section.
+# No need to generate them if there are no CONFIG_FILES.
+# This happens for instance with `./config.status config.h'.
+if test -n "$CONFIG_FILES"; then
+
+
+ac_cr=`echo X | tr X '\015'`
+# On cygwin, bash can eat \r inside `` if the user requested igncr.
+# But we know of no other shell where ac_cr would be empty at this
+# point, so we can use a bashism as a fallback.
+if test "x$ac_cr" = x; then
+ eval ac_cr=\$\'\\r\'
+fi
+ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`
+if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
+ ac_cs_awk_cr='\\r'
+else
+ ac_cs_awk_cr=$ac_cr
+fi
+
+echo 'BEGIN {' >"$ac_tmp/subs1.awk" &&
+_ACEOF
+
+
+{
+ echo "cat >conf$$subs.awk <<_ACEOF" &&
+ echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' &&
+ echo "_ACEOF"
+} >conf$$subs.sh ||
+ as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
+ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'`
+ac_delim='%!_!# '
+for ac_last_try in false false false false false :; do
+ . ./conf$$subs.sh ||
+ as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
+
+ ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X`
+ if test $ac_delim_n = $ac_delim_num; then
+ break
+ elif $ac_last_try; then
+ as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
+ else
+ ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+ fi
+done
+rm -f conf$$subs.sh
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK &&
+_ACEOF
+sed -n '
+h
+s/^/S["/; s/!.*/"]=/
+p
+g
+s/^[^!]*!//
+:repl
+t repl
+s/'"$ac_delim"'$//
+t delim
+:nl
+h
+s/\(.\{148\}\)..*/\1/
+t more1
+s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/
+p
+n
+b repl
+:more1
+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
+p
+g
+s/.\{148\}//
+t nl
+:delim
+h
+s/\(.\{148\}\)..*/\1/
+t more2
+s/["\\]/\\&/g; s/^/"/; s/$/"/
+p
+b
+:more2
+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
+p
+g
+s/.\{148\}//
+t delim
+' <conf$$subs.awk | sed '
+/^[^""]/{
+ N
+ s/\n//
+}
+' >>$CONFIG_STATUS || ac_write_fail=1
+rm -f conf$$subs.awk
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+_ACAWK
+cat >>"\$ac_tmp/subs1.awk" <<_ACAWK &&
+ for (key in S) S_is_set[key] = 1
+ FS = ""
+
+}
+{
+ line = $ 0
+ nfields = split(line, field, "@")
+ substed = 0
+ len = length(field[1])
+ for (i = 2; i < nfields; i++) {
+ key = field[i]
+ keylen = length(key)
+ if (S_is_set[key]) {
+ value = S[key]
+ line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3)
+ len += length(value) + length(field[++i])
+ substed = 1
+ } else
+ len += 1 + keylen
+ }
+
+ print line
+}
+
+_ACAWK
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then
+ sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
+else
+ cat
+fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \
+ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5
+_ACEOF
+
+# VPATH may cause trouble with some makes, so we remove sole $(srcdir),
+# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and
+# trailing colons and then remove the whole line if VPATH becomes empty
+# (actually we leave an empty line to preserve line numbers).
+if test "x$srcdir" = x.; then
+ ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{
+h
+s///
+s/^/:/
+s/[ ]*$/:/
+s/:\$(srcdir):/:/g
+s/:\${srcdir}:/:/g
+s/:@srcdir@:/:/g
+s/^:*//
+s/:*$//
+x
+s/\(=[ ]*\).*/\1/
+G
+s/\n//
+s/^[^=]*=[ ]*$//
+}'
+fi
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+fi # test -n "$CONFIG_FILES"
+
+# Set up the scripts for CONFIG_HEADERS section.
+# No need to generate them if there are no CONFIG_HEADERS.
+# This happens for instance with `./config.status Makefile'.
+if test -n "$CONFIG_HEADERS"; then
+cat >"$ac_tmp/defines.awk" <<\_ACAWK ||
+BEGIN {
+_ACEOF
+
+# Transform confdefs.h into an awk script `defines.awk', embedded as
+# here-document in config.status, that substitutes the proper values into
+# config.h.in to produce config.h.
+
+# Create a delimiter string that does not exist in confdefs.h, to ease
+# handling of long lines.
+ac_delim='%!_!# '
+for ac_last_try in false false :; do
+ ac_tt=`sed -n "/$ac_delim/p" confdefs.h`
+ if test -z "$ac_tt"; then
+ break
+ elif $ac_last_try; then
+ as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5
+ else
+ ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+ fi
+done
+
+# For the awk script, D is an array of macro values keyed by name,
+# likewise P contains macro parameters if any. Preserve backslash
+# newline sequences.
+
+ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]*
+sed -n '
+s/.\{148\}/&'"$ac_delim"'/g
+t rset
+:rset
+s/^[ ]*#[ ]*define[ ][ ]*/ /
+t def
+d
+:def
+s/\\$//
+t bsnl
+s/["\\]/\\&/g
+s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\
+D["\1"]=" \3"/p
+s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p
+d
+:bsnl
+s/["\\]/\\&/g
+s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\
+D["\1"]=" \3\\\\\\n"\\/p
+t cont
+s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p
+t cont
+d
+:cont
+n
+s/.\{148\}/&'"$ac_delim"'/g
+t clear
+:clear
+s/\\$//
+t bsnlc
+s/["\\]/\\&/g; s/^/"/; s/$/"/p
+d
+:bsnlc
+s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p
+b cont
+' <confdefs.h | sed '
+s/'"$ac_delim"'/"\\\
+"/g' >>$CONFIG_STATUS || ac_write_fail=1
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ for (key in D) D_is_set[key] = 1
+ FS = ""
+}
+/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ {
+ line = \$ 0
+ split(line, arg, " ")
+ if (arg[1] == "#") {
+ defundef = arg[2]
+ mac1 = arg[3]
+ } else {
+ defundef = substr(arg[1], 2)
+ mac1 = arg[2]
+ }
+ split(mac1, mac2, "(") #)
+ macro = mac2[1]
+ prefix = substr(line, 1, index(line, defundef) - 1)
+ if (D_is_set[macro]) {
+ # Preserve the white space surrounding the "#".
+ print prefix "define", macro P[macro] D[macro]
+ next
+ } else {
+ # Replace #undef with comments. This is necessary, for example,
+ # in the case of _POSIX_SOURCE, which is predefined and required
+ # on some systems where configure will not decide to define it.
+ if (defundef == "undef") {
+ print "/*", prefix defundef, macro, "*/"
+ next
+ }
+ }
+}
+{ print }
+_ACAWK
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+ as_fn_error $? "could not setup config headers machinery" "$LINENO" 5
+fi # test -n "$CONFIG_HEADERS"
+
+
+eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS"
+shift
+for ac_tag
+do
+ case $ac_tag in
+ :[FHLC]) ac_mode=$ac_tag; continue;;
+ esac
+ case $ac_mode$ac_tag in
+ :[FHL]*:*);;
+ :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;;
+ :[FH]-) ac_tag=-:-;;
+ :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
+ esac
+ ac_save_IFS=$IFS
+ IFS=:
+ set x $ac_tag
+ IFS=$ac_save_IFS
+ shift
+ ac_file=$1
+ shift
+
+ case $ac_mode in
+ :L) ac_source=$1;;
+ :[FH])
+ ac_file_inputs=
+ for ac_f
+ do
+ case $ac_f in
+ -) ac_f="$ac_tmp/stdin";;
+ *) # Look for the file first in the build tree, then in the source tree
+ # (if the path is not absolute). The absolute path cannot be DOS-style,
+ # because $ac_f cannot contain `:'.
+ test -f "$ac_f" ||
+ case $ac_f in
+ [\\/$]*) false;;
+ *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
+ esac ||
+ as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;;
+ esac
+ case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
+ as_fn_append ac_file_inputs " '$ac_f'"
+ done
+
+ # Let's still pretend it is `configure' which instantiates (i.e., don't
+ # use $as_me), people would be surprised to read:
+ # /* config.h. Generated by config.status. */
+ configure_input='Generated from '`
+ $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g'
+ `' by configure.'
+ if test x"$ac_file" != x-; then
+ configure_input="$ac_file. $configure_input"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5
+$as_echo "$as_me: creating $ac_file" >&6;}
+ fi
+ # Neutralize special characters interpreted by sed in replacement strings.
+ case $configure_input in #(
+ *\&* | *\|* | *\\* )
+ ac_sed_conf_input=`$as_echo "$configure_input" |
+ sed 's/[\\\\&|]/\\\\&/g'`;; #(
+ *) ac_sed_conf_input=$configure_input;;
+ esac
+
+ case $ac_tag in
+ *:-:* | *:-) cat >"$ac_tmp/stdin" \
+ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;;
+ esac
+ ;;
+ esac
+
+ ac_dir=`$as_dirname -- "$ac_file" ||
+$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$ac_file" : 'X\(//\)[^/]' \| \
+ X"$ac_file" : 'X\(//\)$' \| \
+ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$ac_file" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ as_dir="$ac_dir"; as_fn_mkdir_p
+ ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+ ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
+ # A ".." for each directory in $ac_dir_suffix.
+ ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
+ case $ac_top_builddir_sub in
+ "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+ *) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+ esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+ .) # We are building in place.
+ ac_srcdir=.
+ ac_top_srcdir=$ac_top_builddir_sub
+ ac_abs_top_srcdir=$ac_pwd ;;
+ [\\/]* | ?:[\\/]* ) # Absolute name.
+ ac_srcdir=$srcdir$ac_dir_suffix;
+ ac_top_srcdir=$srcdir
+ ac_abs_top_srcdir=$srcdir ;;
+ *) # Relative name.
+ ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+ ac_top_srcdir=$ac_top_build_prefix$srcdir
+ ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+
+ case $ac_mode in
+ :F)
+ #
+ # CONFIG_FILE
+ #
+
+ case $INSTALL in
+ [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
+ *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;;
+ esac
+ ac_MKDIR_P=$MKDIR_P
+ case $MKDIR_P in
+ [\\/$]* | ?:[\\/]* ) ;;
+ */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;;
+ esac
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# If the template does not know about datarootdir, expand it.
+# FIXME: This hack should be removed a few years after 2.60.
+ac_datarootdir_hack=; ac_datarootdir_seen=
+ac_sed_dataroot='
+/datarootdir/ {
+ p
+ q
+}
+/@datadir@/p
+/@docdir@/p
+/@infodir@/p
+/@localedir@/p
+/@mandir@/p'
+case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in
+*datarootdir*) ac_datarootdir_seen=yes;;
+*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
+$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ ac_datarootdir_hack='
+ s&@datadir@&$datadir&g
+ s&@docdir@&$docdir&g
+ s&@infodir@&$infodir&g
+ s&@localedir@&$localedir&g
+ s&@mandir@&$mandir&g
+ s&\\\${datarootdir}&$datarootdir&g' ;;
+esac
+_ACEOF
+
+# Neutralize VPATH when `$srcdir' = `.'.
+# Shell code in configure.ac might set extrasub.
+# FIXME: do we really want to maintain this feature?
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ac_sed_extra="$ac_vpsub
+$extrasub
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+:t
+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
+s|@configure_input@|$ac_sed_conf_input|;t t
+s&@top_builddir@&$ac_top_builddir_sub&;t t
+s&@top_build_prefix@&$ac_top_build_prefix&;t t
+s&@srcdir@&$ac_srcdir&;t t
+s&@abs_srcdir@&$ac_abs_srcdir&;t t
+s&@top_srcdir@&$ac_top_srcdir&;t t
+s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t
+s&@builddir@&$ac_builddir&;t t
+s&@abs_builddir@&$ac_abs_builddir&;t t
+s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
+s&@INSTALL@&$ac_INSTALL&;t t
+s&@MKDIR_P@&$ac_MKDIR_P&;t t
+$ac_datarootdir_hack
+"
+eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \
+ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+
+test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
+ { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } &&
+ { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \
+ "$ac_tmp/out"`; test -z "$ac_out"; } &&
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined. Please make sure it is defined" >&5
+$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined. Please make sure it is defined" >&2;}
+
+ rm -f "$ac_tmp/stdin"
+ case $ac_file in
+ -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";;
+ *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";;
+ esac \
+ || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+ ;;
+ :H)
+ #
+ # CONFIG_HEADER
+ #
+ if test x"$ac_file" != x-; then
+ {
+ $as_echo "/* $configure_input */" \
+ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs"
+ } >"$ac_tmp/config.h" \
+ || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+ if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5
+$as_echo "$as_me: $ac_file is unchanged" >&6;}
+ else
+ rm -f "$ac_file"
+ mv "$ac_tmp/config.h" "$ac_file" \
+ || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+ fi
+ else
+ $as_echo "/* $configure_input */" \
+ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \
+ || as_fn_error $? "could not create -" "$LINENO" 5
+ fi
+# Compute "$ac_file"'s index in $config_headers.
+_am_arg="$ac_file"
+_am_stamp_count=1
+for _am_header in $config_headers :; do
+ case $_am_header in
+ $_am_arg | $_am_arg:* )
+ break ;;
+ * )
+ _am_stamp_count=`expr $_am_stamp_count + 1` ;;
+ esac
+done
+echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" ||
+$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$_am_arg" : 'X\(//\)[^/]' \| \
+ X"$_am_arg" : 'X\(//\)$' \| \
+ X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$_am_arg" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`/stamp-h$_am_stamp_count
+ ;;
+
+ :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5
+$as_echo "$as_me: executing $ac_file commands" >&6;}
+ ;;
+ esac
+
+
+ case $ac_file$ac_mode in
+ "depfiles":C) test x"$AMDEP_TRUE" != x"" || {
+ # Older Autoconf quotes --file arguments for eval, but not when files
+ # are listed without --file. Let's play safe and only enable the eval
+ # if we detect the quoting.
+ case $CONFIG_FILES in
+ *\'*) eval set x "$CONFIG_FILES" ;;
+ *) set x $CONFIG_FILES ;;
+ esac
+ shift
+ for mf
+ do
+ # Strip MF so we end up with the name of the file.
+ mf=`echo "$mf" | sed -e 's/:.*$//'`
+ # Check whether this is an Automake generated Makefile or not.
+ # We used to match only the files named 'Makefile.in', but
+ # some people rename them; so instead we look at the file content.
+ # Grep'ing the first line is not enough: some people post-process
+ # each Makefile.in and add a new line on top of each file to say so.
+ # Grep'ing the whole file is not good either: AIX grep has a line
+ # limit of 2048, but all sed's we know have understand at least 4000.
+ if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
+ dirpart=`$as_dirname -- "$mf" ||
+$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$mf" : 'X\(//\)[^/]' \| \
+ X"$mf" : 'X\(//\)$' \| \
+ X"$mf" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$mf" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ else
+ continue
+ fi
+ # Extract the definition of DEPDIR, am__include, and am__quote
+ # from the Makefile without running 'make'.
+ DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
+ test -z "$DEPDIR" && continue
+ am__include=`sed -n 's/^am__include = //p' < "$mf"`
+ test -z "$am__include" && continue
+ am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
+ # Find all dependency output files, they are included files with
+ # $(DEPDIR) in their names. We invoke sed twice because it is the
+ # simplest approach to changing $(DEPDIR) to its actual value in the
+ # expansion.
+ for file in `sed -n "
+ s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
+ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
+ # Make sure the directory exists.
+ test -f "$dirpart/$file" && continue
+ fdir=`$as_dirname -- "$file" ||
+$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$file" : 'X\(//\)[^/]' \| \
+ X"$file" : 'X\(//\)$' \| \
+ X"$file" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$file" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ as_dir=$dirpart/$fdir; as_fn_mkdir_p
+ # echo "creating $dirpart/$file"
+ echo '# dummy' > "$dirpart/$file"
+ done
+ done
+}
+ ;;
+
+ esac
+done # for ac_tag
+
+
+as_fn_exit 0
+_ACEOF
+ac_clean_files=$ac_clean_files_save
+
+test $ac_write_fail = 0 ||
+ as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5
+
+rm -rf gmp-tmp.h
+if test "x$cross_compiling" = xyes; then :
+ if test "x$cache_file" != x/dev/null; then :
+ cache_file=config.cache
+fi
+ac_configure_args="$ac_configure_args --host='$kpse_build_alias' \
+CC='$BUILDCC' CFLAGS='$BUILDCFLAGS' \
+CPPFLAGS='$BUILDCPPFLAGS' LDFLAGS='$BUILDLDFLAGS'"
+fi
+
+# configure is writing to config.log, and then calls config.status.
+# config.status does its own redirection, appending to config.log.
+# Unfortunately, on DOS this fails, as config.log is still kept open
+# by configure, so config.status won't be able to write to it; its
+# output is simply discarded. So we exec the FD to /dev/null,
+# effectively closing config.log, so it can be properly (re)opened and
+# appended to by config.status. When coming back to configure, we
+# need to make the FD available again.
+if test "$no_create" != yes; then
+ ac_cs_success=:
+ ac_config_status_args=
+ test "$silent" = yes &&
+ ac_config_status_args="$ac_config_status_args --quiet"
+ exec 5>/dev/null
+ $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
+ exec 5>>config.log
+ # Use ||, not &&, to avoid exiting from the if with $? = 1, which
+ # would make configure fail if this is the last instruction.
+ $ac_cs_success || as_fn_exit 1
+fi
+
+#
+# CONFIG_SUBDIRS section.
+#
+if test "$no_recursion" != yes; then
+
+ # Remove --cache-file, --srcdir, and --disable-option-checking arguments
+ # so they do not pile up.
+ ac_sub_configure_args=
+ ac_prev=
+ eval "set x $ac_configure_args"
+ shift
+ for ac_arg
+ do
+ if test -n "$ac_prev"; then
+ ac_prev=
+ continue
+ fi
+ case $ac_arg in
+ -cache-file | --cache-file | --cache-fil | --cache-fi \
+ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
+ ac_prev=cache_file ;;
+ -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
+ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* \
+ | --c=*)
+ ;;
+ --config-cache | -C)
+ ;;
+ -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
+ ac_prev=srcdir ;;
+ -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
+ ;;
+ -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
+ ac_prev=prefix ;;
+ -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
+ ;;
+ --disable-option-checking)
+ ;;
+ *)
+ case $ac_arg in
+ *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+ esac
+ as_fn_append ac_sub_configure_args " '$ac_arg'" ;;
+ esac
+ done
+
+ # Always prepend --prefix to ensure using the same prefix
+ # in subdir configurations.
+ ac_arg="--prefix=$prefix"
+ case $ac_arg in
+ *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+ esac
+ ac_sub_configure_args="'$ac_arg' $ac_sub_configure_args"
+
+ # Pass --silent
+ if test "$silent" = yes; then
+ ac_sub_configure_args="--silent $ac_sub_configure_args"
+ fi
+
+ # Always prepend --disable-option-checking to silence warnings, since
+ # different subdirs can have different --enable and --with options.
+ ac_sub_configure_args="--disable-option-checking $ac_sub_configure_args"
+
+ ac_popdir=`pwd`
+ for ac_dir in : $subdirs; do test "x$ac_dir" = x: && continue
+
+ # Do not complain, so a configure script can configure whichever
+ # parts of a large source tree are present.
+ test -d "$srcdir/$ac_dir" || continue
+
+ ac_msg="=== configuring in $ac_dir (`pwd`/$ac_dir)"
+ $as_echo "$as_me:${as_lineno-$LINENO}: $ac_msg" >&5
+ $as_echo "$ac_msg" >&6
+ as_dir="$ac_dir"; as_fn_mkdir_p
+ ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+ ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
+ # A ".." for each directory in $ac_dir_suffix.
+ ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
+ case $ac_top_builddir_sub in
+ "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+ *) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+ esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+ .) # We are building in place.
+ ac_srcdir=.
+ ac_top_srcdir=$ac_top_builddir_sub
+ ac_abs_top_srcdir=$ac_pwd ;;
+ [\\/]* | ?:[\\/]* ) # Absolute name.
+ ac_srcdir=$srcdir$ac_dir_suffix;
+ ac_top_srcdir=$srcdir
+ ac_abs_top_srcdir=$srcdir ;;
+ *) # Relative name.
+ ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+ ac_top_srcdir=$ac_top_build_prefix$srcdir
+ ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+
+ cd "$ac_dir"
+
+ # Check for guested configure; otherwise get Cygnus style configure.
+ if test -f "$ac_srcdir/configure.gnu"; then
+ ac_sub_configure=$ac_srcdir/configure.gnu
+ elif test -f "$ac_srcdir/configure"; then
+ ac_sub_configure=$ac_srcdir/configure
+ elif test -f "$ac_srcdir/configure.in"; then
+ # This should be Cygnus configure.
+ ac_sub_configure=$ac_aux_dir/configure
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: no configuration information is in $ac_dir" >&5
+$as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2;}
+ ac_sub_configure=
+ fi
+
+ # The recursion is here.
+ if test -n "$ac_sub_configure"; then
+ # Make the cache file name correct relative to the subdirectory.
+ case $cache_file in
+ [\\/]* | ?:[\\/]* ) ac_sub_cache_file=$cache_file ;;
+ *) # Relative name.
+ ac_sub_cache_file=$ac_top_build_prefix$cache_file ;;
+ esac
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: running $SHELL $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_srcdir" >&5
+$as_echo "$as_me: running $SHELL $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_srcdir" >&6;}
+ # The eval makes quoting arguments work.
+ eval "\$SHELL \"\$ac_sub_configure\" $ac_sub_configure_args \
+ --cache-file=\"\$ac_sub_cache_file\" --srcdir=\"\$ac_srcdir\"" ||
+ as_fn_error $? "$ac_sub_configure failed for $ac_dir" "$LINENO" 5
+ fi
+
+ cd "$ac_popdir"
+ done
+fi
+if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
+$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
+fi
+
diff --git a/Build/source/libs/gmp/configure.ac b/Build/source/libs/gmp/configure.ac
new file mode 100644
index 00000000000..fd31f005203
--- /dev/null
+++ b/Build/source/libs/gmp/configure.ac
@@ -0,0 +1,112 @@
+dnl Process this file with autoconf to produce a configure script.
+dnl
+dnl Copyright (C) 2014 Taco Hoekwater <taco@metatex.org>
+dnl Copyright (C) 2014 Peter Breitenlohner <tex-live@tug.org>
+dnl
+dnl This file is free software; the copyright holder
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+dnl
+m4_include([version.ac])[] dnl define gmp_version
+AC_INIT([gmp (TeX Live)], gmp_version, [tex-k@tug.org])
+AC_PREREQ([2.65])
+AC_CONFIG_SRCDIR([gmp-]gmp_version[/gmp-impl.h])
+AC_CONFIG_AUX_DIR([../../build-aux])
+AC_CONFIG_MACRO_DIRS([../../m4 m4])
+
+KPSE_BASIC([gmp])
+
+AC_PROG_CC
+AC_PROG_RANLIB
+AC_PROG_LN_S
+
+AC_PROG_CC_C99
+CFLAGS="$CFLAGS -DNO_ASM"
+
+AC_CONFIG_HEADERS([config.h])
+
+KPSE_CANONICAL_HOST
+
+AC_CHECK_FUNCS([memset raise strchr])
+
+GMP_C_ATTRIBUTE_CONST
+GMP_C_ATTRIBUTE_MALLOC
+GMP_C_ATTRIBUTE_MODE
+GMP_C_ATTRIBUTE_NORETURN
+
+AC_CHECK_TYPE([long long])
+
+AC_CHECK_SIZEOF([void *])
+AC_CHECK_SIZEOF([unsigned short])
+AC_CHECK_SIZEOF([unsigned])
+AC_CHECK_SIZEOF([unsigned long])
+AC_CHECK_SIZEOF([unsigned long long])
+
+AS_CASE([$host],
+ [x86_64-*-cygwin], [gmp_limb=longlong], [dnl
+AS_IF([test $ac_cv_sizeof_void_p -gt $ac_cv_sizeof_unsigned_long], [dnl
+AS_IF([test $ac_cv_sizeof_void_p -le $ac_cv_sizeof_unsigned_long_long],
+ [gmp_limb=longlong],
+ [gmp_limb=unknown])
+])
+])
+AS_CASE([$gmp_limb],
+ [longlong],
+ [DEFN_LONG_LONG_LIMB="@%:@define _LONG_LONG_LIMB 1"
+ gmp_limb_size=$ac_cv_sizeof_unsigned_long_long],
+ [DEFN_LONG_LONG_LIMB="/* @%:@undef _LONG_LONG_LIMB */"
+ gmp_limb_size=$ac_cv_sizeof_unsigned_long])
+AC_SUBST([DEFN_LONG_LONG_LIMB])
+AC_SUBST([GMP_LIMB_BITS], [`expr 8 \* $gmp_limb_size`])
+
+AC_SUBST([GMP_NAIL_BITS], 0)
+
+dnl KPSE_GMP_H
+dnl ----------
+dnl Create a temporary file gmp-tmp.h to be used instead of gmp.h, since that
+dnl file isn't generated until the end of the configure.
+AC_DEFUN([KPSE_GMP_H], [dnl
+cat >gmp-tmp.h <<KPSE_EOF
+#define __GMP_WITHIN_CONFIGURE 1 /* ignore template stuff */
+#define GMP_NAIL_BITS $GMP_NAIL_BITS
+#define GMP_LIMB_BITS 123
+$DEFN_LONG_LONG_LIMB
+#include "$srcdir/gmp-]gmp_version[/gmp-h.in"
+KPSE_EOF
+AC_CONFIG_COMMANDS_POST([rm -rf gmp-tmp.h])
+]) # KPSE_GMP_H
+KPSE_GMP_H
+
+AC_CHECK_SIZEOF([mp_limb_t], , [#include "gmp-tmp.h"])
+
+GMP_FUNC_ALLOCA
+
+GMP_C_DOUBLE_FORMAT
+
+if test "x$enable_build" != xno || test -f config.force; then
+
+AS_CASE([$gmp_limb],
+ [unknown], [AC_MSG_ERROR([Sorry, no suitable limb size])])
+
+if test "x$ac_cv_sizeof_mp_limb_t" != "x$gmp_limb_size"; then
+ AC_MSG_ERROR([Oops, mp_limb_t doesn't seem to work])
+fi
+
+echo timestamp >config.force
+fi
+
+AM_CONDITIONAL([build], [test "x$enable_build" != xno])
+
+AC_SUBST([GMP_TREE], [gmp-]gmp_version)
+
+AC_SUBST([HAVE_HOST_CPU_FAMILY_power], 0)
+AC_SUBST([HAVE_HOST_CPU_FAMILY_powerpc], 0)
+AC_SUBST([DEFN_LONG_LONG_LIMB])
+AC_SUBST([LIBGMP_DLL], 0)
+
+AC_CONFIG_FILES([Makefile include/Makefile gmp.h:gmp-]gmp_version[/gmp-h.in])
+
+dnl The subdirectory native must be configured for the build system.
+KPSE_NATIVE_SUBDIRS([native])
+
+AC_OUTPUT
diff --git a/Build/source/libs/gmp/gmp-6.0.0-PATCHES/ChangeLog b/Build/source/libs/gmp/gmp-6.0.0-PATCHES/ChangeLog
new file mode 100644
index 00000000000..c5ccc01f0c4
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0-PATCHES/ChangeLog
@@ -0,0 +1,4 @@
+2014-05-26 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ patch-01-const (new): Avoid incompatible pointer type warning.
+
diff --git a/Build/source/libs/gmp/gmp-6.0.0-PATCHES/TL-Changes b/Build/source/libs/gmp/gmp-6.0.0-PATCHES/TL-Changes
new file mode 100644
index 00000000000..13f45565ee9
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0-PATCHES/TL-Changes
@@ -0,0 +1,37 @@
+Changes applied to the gmp-6.0.6/ tree as obtained from:
+ http://ftp.gnu.org/gnu/gmp/
+
+Removed:
+ .gdbinit
+ COPYING
+ COPYING.LESSERv3
+ COPYINGv2
+ COPYINGv3
+ INSTALL.autoconf
+ Makefile.in
+ aclocal.m4
+ configfsf.guess
+ configfsf.sub
+ configure
+ cxx/
+ demos/
+ doc/
+ install-sh
+ ltmain.sh
+ mini-gmp/tests/
+ missing
+ mpf/Makefile.in
+ mpn/Makefile.in
+ mpq/Makefile.in
+ mpz/Makefile.in
+ printf/Makefile.in
+ rand/Makefile.in
+ scanf/Makefile.in
+ tests/
+ tune/
+ ylwrap
+
+Renamed:
+ config.guess => configgmp.guess
+ config.sub => configgmp.sub
+
diff --git a/Build/source/libs/gmp/gmp-6.0.0-PATCHES/patch-01-const b/Build/source/libs/gmp/gmp-6.0.0-PATCHES/patch-01-const
new file mode 100644
index 00000000000..869a755d548
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0-PATCHES/patch-01-const
@@ -0,0 +1,12 @@
+diff -ur gmp-6.0.0.orig/mpn/generic/sec_tabselect.c gmp-6.0.0/mpn/generic/sec_tabselect.c
+--- gmp-6.0.0.orig/mpn/generic/sec_tabselect.c 2014-03-25 15:37:55.000000000 +0100
++++ gmp-6.0.0/mpn/generic/sec_tabselect.c 2014-05-26 17:17:59.000000000 +0200
+@@ -41,7 +41,7 @@
+ {
+ mp_size_t k, i;
+ mp_limb_t mask;
+- volatile mp_limb_t *tp;
++ volatile const mp_limb_t *tp;
+
+ for (k = 0; k < nents; k++)
+ {
diff --git a/Build/source/libs/gmp/gmp-6.0.0/AUTHORS b/Build/source/libs/gmp/gmp-6.0.0/AUTHORS
new file mode 100644
index 00000000000..fbe298d61bc
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/AUTHORS
@@ -0,0 +1,100 @@
+Authors of GNU MP (in chronological order of initial contribution)
+
+Torbjörn Granlund Main author
+
+John Amanatides Original version of mpz/pprime_p.c
+
+Paul Zimmermann mpn/generic/mul_fft.c, now defunct dc_divrem_n.c,
+ rootrem.c, old mpz/powm.c, old toom3 code.
+
+Ken Weber Now defunct mpn/generic/bdivmod.c, old mpn/generic/gcd.c
+
+Bennet Yee Previous versions of mpz/jacobi.c mpz/legendre.c
+
+Andreas Schwab mpn/m68k/lshift.asm, mpn/m68k/rshift.asm
+
+Robert Harley Old mpn/generic/mul_n.c, previous versions of files in
+ mpn/arm
+
+Linus Nordberg Random number framework, original autoconfery
+
+Kent Boortz MacOS 9 port, now defunct.
+
+Kevin Ryde Most x86 assembly, new autoconfery, and countless other
+ things (please see the GMP manual for complete list)
+
+Gerardo Ballabio gmpxx.h and C++ istream input
+
+Pedro Gimeno Mersenne Twister random generator, other random number
+ revisions
+
+Jason Moxham Previous versions of mpz/fac_ui.c and gen-fac_ui.c
+
+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,
+ 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
+ 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,
+ sec_invert.c,
+ toom_eval_dgr3_pm1.c, toom_eval_dgr3_pm2.c,
+ toom_eval_pm1.c, toom_eval_pm2.c, toom_eval_pm2exp.c,
+ divexact.c, mod_1_1.c, div_qr_2.c,
+ div_qr_2n_pi1.c, div_qr_2u_pi1.c, broot.c,
+ brootinv.c,
+ mpn/x86/k7/invert_limb.asm, mod_1_1.asm,
+ mpn/x86_64/invert_limb.asm,
+ invert_limb_table.asm, mod_1_1.asm,
+ div_qr_2n_pi1.asm, div_qr_2u_pi1.asm,
+ mpn/x86_64/core2/aorsmul_1.asm,
+ mpz/nextprime.c, divexact.c, gcd.c, gcdext.c,
+ jacobi.c, combit.c, mini-gmp/mini-gmp.c.
+
+Marco Bodrato mpn/generic/toom44_mul.c, toom4_sqr.c, toom53_mul.c,
+ toom62_mul.c, toom43_mul.c, toom52_mul.c, toom54_mul.c,
+ toom_interpolate_6pts.c, toom_couple_handling.c,
+ toom63_mul.c, toom_interpolate_8pts.c,
+ toom6h_mul.c, toom6_sqr.c, toom_interpolate_12pts.c,
+ 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,
+ mullo_n.c, invert.c, invertappr.c;
+ mpz/fac_ui.c, 2fac_ui.c, mfac_uiui.c, oddfac_1.c,
+ primorial_ui.c, prodlimbs.c, goetgheluck_bin_uiui.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,
+ sub_err3_n.c, mulmid_basecase.c, mulmid_n.c,
+ toom42_mulmid.c,
+ mpn/x86_64/mul_basecase.asm, aors_err1_n.asm,
+ aors_err2_n.asm, aors_err3_n.asm,
+ mulmid_basecase.asm,
+ mpn/x86_64/core2/aors_err1_n.asm.
+
+Martin Boij mpn/generic/perfpow.c
+
+Marc Glisse gmpxx.h improvements
+
+David Miller mpn/sparc32/ultrasparct1/{addmul_1,mul_1,submul_1}.asm
+ mpn/sparc64/ultrasparct3/{mul_1,addmul_1,submul_1}.asm
+ mpn/sparc64/ultrasparct3/{add_n,sub_n}.asm
+ mpn/sparc64/ultrasparct3/{popcount,hamdist}.asm
+ mpn/sparc64/ultrasparct3/cnd_aors_n.asm
+ mpn/sparc64/{rshift,lshift,lshiftc}.asm
+ mpn/sparc64/tabselect.asm
+
+Mark Sofroniou mpn/generic/mul_fft.c type cleanup.
+
+Ulrich Weigand Changes to support powerpc64le:
+ configure.ac, mpn/powerpc64/{elf,aix,darwin}.m4,
+ mpn/powerpc32/{darwin,elf}.m4,
+ mpn/powerpc64/mode64/{dive_1,divrem_1,divrem_2}.asm,
+ mpn/powerpc64/mode64/{gcd_1,invert_limb,mode1o}.asm,
+ mpn/powerpc64/mode64/{mod_1_1,mod_1_4}.asm,
+ mpn/powerpc64/mode64/p7/gcd_1.asm,
+ mpn/powerpc64/p6/{lshift,lshiftc,rshift}.asm,
+ mpn/powerpc64/vmx/popcount.asm.
diff --git a/Build/source/libs/gmp/gmp-6.0.0/ChangeLog b/Build/source/libs/gmp/gmp-6.0.0/ChangeLog
new file mode 100644
index 00000000000..540c025c51d
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/ChangeLog
@@ -0,0 +1,32941 @@
+2014-03-24 Torbjorn Granlund <tege@gmplib.org>
+
+ * Version 6.0.0 released.
+
+ * mpn: Update countless gmp-mparam.h files.
+
+2014-03-22 Torbjorn Granlund <tege@gmplib.org>
+
+ * Makefile.am (LIBGMP_LT_*, LIBGMPXX_LT_*): Bump version info.
+ * gmp-h.in: Bump version.
+
+2014-03-17 Torbjorn Granlund <tege@gmplib.org>
+
+ * configure.ac: Remove clipper, i960, ns32k, pyr, a29k, z8000.
+ * mpn/clipper: Remove directory and all its files.
+ * mpn/i960: Likewise.
+ * mpn/ns32k: Likewise.
+ * mpn/pyr: Likewise.
+ * mpn/a29k: Likewise.
+ * mpn/z8000: Likewise.
+ * mpn/Makefile.am (TARG_DIST): Purge removed directories.
+ * doc/gmp.texi: Remove special mentions of removed architectures.
+
+2014-03-12 Marco Bodrato <bodrato@mail.dm.unipi.it>
+
+ * mini-gmp/mini-gmp.c (mpz_probab_prime_p): Micro-optimisation.
+
+2014-03-12 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/x86/bd2/gmp-mparam.h: New file.
+ * mpn/x86_64/bd2/gmp-mparam.h: New file.
+
+2014-03-06 Niels Möller <nisse@lysator.liu.se>
+
+ * tests/mpz/t-pprime_p.c (check_composites): New function.
+ (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@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@lysator.liu.se>
+
+ * mpn/generic/sec_powm.c (mpn_sec_powm): Clarify comment and
+ asserts.
+
+2014-02-28 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/x86_64/fat/fat.c (fake_cpuid): Handle id 7, make bold claims.
+
+2014-02-27 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/x86_64/fat/fat_entry.asm: Zero ecx for the benefit of new BMI2
+ feature test.
+
+ * mpn/x86_64/fat/fat.c (__gmpn_cpuvec_init): Run CPUVEC_SETUP_coreihwl
+ conditionally on BMI2 availability.
+
+ * config.guess: Revert "coreihwl" to "coreisbr" if cpuid indicates that
+ BMI2 is missing.
+ (x86 cpuid, 2 variants): Zero ecx for the benefit of new BMI2 feature
+ test.
+
+2014-02-21 Marco Bodrato <bodrato@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@lysator.liu.se>
+
+ * mpn/generic/div_qr_1.c (mpn_div_qr_1): Revert yesterday's fix.
+ Hopefully no longer needed.
+
+ * mpn/s390_64/gmp-mparam.h (DIV_QR_1_NORM_THRESHOLD): Up to 1.
+ * mpn/s390_64/z10/gmp-mparam.h (DIV_QR_1_NORM_THRESHOLD): Up to 1.
+
+ * tune/tuneup.c (tune_div_qr_1): Ensure DIV_QR_1_NORM_THRESHOLD,
+ DIV_QR_1_UNNORM_THRESHOLD >= 1.
+
+2014-02-16 Marco Bodrato <bodrato@mail.dm.unipi.it>
+
+ * mpn/generic/div_qr_1.c: Disallow DIV_QR_1_NORM_THRESHOLD==0.
+
+2014-02-15 Torbjorn Granlund <tege@gmplib.org>
+
+ * tests/mpn/t-div.c: Fix typo.
+
+2014-02-15 Marco Bodrato <bodrato@mail.dm.unipi.it>
+
+ * 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@lysator.liu.se>
+
+ * doc/gmp.texi (Low-level Functions): Update docs for
+ mpn_sec_powm, to specify that left-over exponent bits must be
+ zero.
+
+2014-02-11 Niels Möller <nisse@lysator.liu.se>
+
+ * Makefile.am (EXTRA_DIST): Distribute COPYING.LESSERv3,
+ COPYINGv2, and COPYINGv3.
+
+ * doc/gmp.texi (Low-level Functions): Updated mpn_sec_powm docs.
+
+ * mpn/generic/sec_powm.c (mpn_sec_powm): Replaced exponent limb
+ count argument by bit count. Don't leak high exponent bits, and
+ drop the requirement that the most significant exponent limb is
+ non-zero.
+ (mpn_sec_powm_itch): Analogous interface change.
+ * gmp-h.in: Updated prototypes.
+ * mpz/powm_sec.c (mpz_powm_sec): Update mpn_sec_powm* calls.
+ * tune/tuneup.c (tune_powm_sec): Likewise. Also deleted code
+ fiddling with the high exponent bits.
+
+2014-02-10 Marco Bodrato <bodrato@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@lysator.liu.se>
+
+ * tune/tuneup.c (tune_powm_sec): Avoid timing of the nonsensical
+ parameters nbits = 1, winsize = 2. Decrement tabulated values, to
+ better match the > comparison when the table is used.
+
+ * mpn/generic/sec_powm.c (win_size): Comment why we always get
+ win_size(eb) <= eb. Make the table const.
+ (mpn_sec_powm): Deleted handling of winsize > initial ebi. For
+ now, replaced with an ASSERT_ALWAYS.
+
+2014-02-08 Marco Bodrato <bodrato@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@lysator.liu.se>
+
+ * mpn/generic/sec_invert.c (mpn_cnd_neg_itch): #if:ed out unused
+ function.
+
+ * mpn/generic/sec_div.c: Simplified code for the normalized case.
+
+ * tests/mpn/t-div.c (main): Test mpn_sec_div_qr and mpn_sec_div_r
+ with normalized d.
+
+2014-02-04 Niels Möller <nisse@lysator.liu.se>
+
+ * doc/gmp.texi (Low-level Functions): Document mpn_sec_add_1 and
+ mpn_sec_sub_1.
+
+2014-02-03 Marco Bodrato <bodrato@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@gmplib.org>
+
+ * doc/gmp.texi (Floating-point Functions): Revise.
+
+2014-01-29 Niels Möller <nisse@lysator.liu.se>
+
+ * README: Don't refer to specific COPYING* files, instead refer to
+ manual for details.
+
+ * COPYING.LIB: Renamed, to...
+ * COPYING.LESSERv3: ... new name.
+ * COPYING: Renamed, to...
+ * COPYINGv3: ... new name.
+ * COPYINGv2: New file, GPLv2.
+
+ * doc/gmp.texi (Copying): Document dual licensing.
+
+2014-01-27 Torbjorn Granlund <tege@gmplib.org>
+
+ * Update library files license to use LGPL3+ and GPL2+.
+
+2014-01-27 Marco Bodrato <bodrato@mail.dm.unipi.it>
+
+ * tests/mpn/t-aors_1.c: Check sec_aors_1 red zones (not smart).
+
+ * mpn/generic/sec_aors_1.c: Mark the 2nd argument as const.
+ * gmp-h.in (mpn_sec_add_1, mpn_sec_sub_1): Likewise.
+
+2014-01-24 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/x86_64/fat/fat.c (fake_cpuid_table): Use proper steamroller and
+ excavator values.
+
+ * config.guess: Amend last AMD change.
+
+ * mpn/s390_64/lshift.asm: Align loop.
+ * mpn/s390_64/rshift.asm: Likewise.
+ * mpn/s390_64/lshiftc.asm: Likewise.
+ * mpn/s390_64: Add z10 cycle numbers.
+
+2014-01-23 Marco Bodrato <bodrato@mail.dm.unipi.it>
+
+ * 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@mail.dm.unipi.it>
+
+ * acinclude.m4 (GMP_FUNC_VSNPRINTF): Get rid of varargs.
+
+2014-01-20 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/x86_64/fat/fat.c (__gmpn_cpuvec_init): Fix duplicate entries for
+ AMD "jaguar".
+
+ * demos/expr: Get rid of varargs code and references.
+
+2014-01-19 Torbjorn Granlund <tege@gmplib.org>
+
+ * config.guess: Add new AMD CPUs (piledriver, steamroller, excavator,
+ jaguar).
+ * config.sub: Corresponding updates.
+ * configure.ac: Likewise.
+ * acinclude.m4 (X86_64_PATTERN): Likewise.
+ * mpn/x86_64/fat/fat.c: Likewise.
+
+ * Rename mpn_sec_minvert => mpn_sec_invert, many files affected.
+ * mpn/generic/sec_invert.c: New name for sec_minvert.c.
+
+ * doc/gmp.texi: Undocument mpz_array_init.
+
+ * acinclude.m4 (GMP_C_STDARG): Comment out.
+ * configure.ac: Suppress GMP_C_STDARG invocation.
+
+ * Get rid of varargs code and references, many file affected.
+
+ * Use mpq_t in favour of MP_RAT, many mpq files affected.
+
+ * Get rid of BYTES_PER_MP_LIMB, most files affected.
+
+ * mpz/iset.c: Avoid overflow in allocation computation.
+ * mpz/mul.c: Likewise.
+ * mpf/init.c: Likewise.
+ * mpf/init2.c: Likewise.
+ * mpf/iset.c: Likewise.
+ * mpf/iset_d.c: Likewise.
+ * mpf/iset_si.c: Likewise.
+ * mpf/iset_str.c: Likewise.
+ * mpf/iset_ui.c: Likewise.
+
+ * mpz/array_init.c: Avoid two overflow scenarios in allocation
+ computation.
+
+ * mpn/s390_64/z10/gmp-mparam.h: New file.
+
+ * mpz/clears.c: Call __gmp_free_func ourselves instead of via
+ mpz_clears.
+ * mpf/clears.c: Analogous change.
+ * mpq/clears.c: Analogous change.
+
+ * mpz/clear.c: Add cast to avoid overflow of (later ignored) argument.
+ * mpf/clear.c: Likewise.
+
+2014-01-19 Marco Bodrato <bodrato@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@lysator.liu.se>
+
+ * tests/mpn/t-aors_1.c: Test also mpn_sec_add_1 and mpn_sec_sub_1.
+
+ * tests/mpn/t-minvert.c (main): Pass smallest allowed bit_size
+ argument to mpn_sec_minvert.
+
+2014-01-18 Marc Glisse <marc.glisse@inria.fr>
+
+ * doc/gmp.texi (C++ Interface Limitations): Warn against C++11 auto.
+
+2014-01-18 Marco Bodrato <bodrato@mail.dm.unipi.it>
+
+ * tests/t-parity.c: Use 1UL to generate unsigned constants.
+ * tests/t-constants.c: Disable a non portable (unneeded) check.
+
+2014-01-18 Niels Möller <nisse@lysator.liu.se>
+
+ * mpn/generic/sec_aors_1.c (mpn_sec_add_1, mpn_sec_sub_1): New
+ file.
+
+ * mpn/generic/sec_minvert.c (mpn_sec_add_1_itch, mpn_sec_add_1):
+ Deleted static definitions.
+ (mpn_cnd_swap): Use volatile.
+
+ * configure.ac (gmp_mpn_functions): sec_add_1 and sec_sub_1.
+ (GMP_MULFUNC_CHOICES): Set up for sec_aors_1.
+
+2014-01-16 Niels Möller <nisse@lysator.liu.se>
+
+ * tune/common.c (speed_mpn_sec_minvert): New function.
+ * tune/speed.h: Declare it.
+ (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@inria.fr>
+
+ * demos/expr/expr.h: Add extern "C" for C++.
+
+2014-01-11 Torbjorn Granlund <tege@gmplib.org>
+
+ * doc/gmp.texi (Notes for Particular Systems): Add items about old
+ NetBSD and current FreeBSD m4 problems. Add item about FreeBSD's
+ broken limits.h.
+
+2014-01-05 Marco Bodrato <bodrato@mail.dm.unipi.it>
+
+ * gmp-impl.h: Declare all _itch functions using ATTRIBUTE_CONST.
+
+2014-01-05 Torbjorn Granlund <tege@gmplib.org>
+
+ * configure.ac (alpha): Set extra_functions conditionally.
+
+ * gmp-h.in (mpn_sec_minvert): Remove formal parameters.
+
+ * doc/gmp.texi: Improve doc for several functions.
+
+ * mpn/generic/sec_tabselect.c: Declare input arg using 'const'.
+ * gmp-h.in: Analogous change.
+
+ * gmp-h.in: Declare all itch functions using __GMP_ATTRIBUTE_PURE.
+ * gmp-impl.h: Likewise.
+
+2014-01-05 Marco Bodrato <bodrato@mail.dm.unipi.it>
+
+ * tests/mpn/t-minvert.c: Always compare with mpz_invert results,
+ add red zone to scratch.
+ * tests/mpn/t-sizeinbase.c: New test.
+ * tests/mpn/Makefile.am (check_PROGRAMS): Added t-sizeinbase.c .
+ * tests/mpn/t-div.c: Use mpn_sec_div_*_itch().
+
+ * mpn/generic/pow_1.c: Micro-optimisation.
+
+2014-01-04 Torbjorn Granlund <tege@gmplib.org>
+
+ * acinclude.m4 (GMP_PROG_M4): Avoid hex output, since case varies.
+
+2014-01-03 Torbjorn Granlund <tege@gmplib.org>
+
+ * config.guess: Support newer haswell, broadwell, silvermont.
+ * mpn/x86_64/fat/fat.c (__gmpn_cpuvec_init): Likewise.
+
+ * acinclude.m4 (GMP_PROG_M4): Check that eval's radix argument work.
+
+ * mpz/invert.c: Rely on gcdext for all operands, removing faulty
+ special case.
+ * tests/mpz/t-invert.c: Enforce correct behaviour for |mod| = 1.
+
+2014-01-02 Niels Möller <nisse@lysator.liu.se>
+
+ * doc/gmp.texi (Low-level Functions): Document mpn_sizeinbase.
+
+ Enable previously unused mpn_sizeinbase function.
+ * configure.ac (gmp_mpn_functions): Added sizeinbase.
+ * gmp-h.in (mpn_sizeinbase): New prototype.
+
+2014-01-02 Marc Glisse <marc.glisse@inria.fr>
+
+ * gmp-impl.h: Always include <limits.h>.
+ * tests/mpn/t-get_d.c: Remove comment about <limits.h>
+
+ * gmp-h.in (__GMP_USHRT_MAX): Use the promoted type.
+ * gmp-impl.h (USHRT_HIGHBIT, SHRT_MIN, SHRT_MAX): Likewise.
+ * tests/t-constants.c: Adapt printf strings.
+ * tests/t-gmpmax.c: Likewise.
+
+ * tests/mpn/t-hgcd_appr.c (hgcd_appr_valid_p): Add parentheses.
+
+2014-01-01 Torbjorn Granlund <tege@gmplib.org>
+
+ * doc/gmp.texi (Low-level Functions for cryptography): Update interface
+ for mpn_sec_div_qr and fix typos in mpn_sec_minvert text.
+
+ * mpn/generic/sec_div.c: Rewrite to make mpn_sec_div_qr return high
+ quotient limb.
+ * gmp-h.in (mpn_sec_div_qr): Update declaration.
+ * tests/mpn/t-div.c: Adapt.
+
+2013-12-31 Niels Möller <nisse@lysator.liu.se>
+
+ * doc/gmp.texi (Low-level Functions for cryptography): Document
+ mpn_sec_minvert.
+
+2013-12-30 Marc Glisse <marc.glisse@inria.fr>
+
+ * doc/gmp.texi (C++ interface internals): Break long line.
+
+2013-12-30 Torbjorn Granlund <tege@gmplib.org>
+
+ * doc/gmp.texi (Low-level Functions for cryptography): New section.
+
+2013-12-29 Niels Möller <nisse@lysator.liu.se>
+
+ * tests/mpn/Makefile.am (check_PROGRAMS): Added t-minvert.
+ * tests/mpn/t-minvert.c: New file.
+
+ * configure.ac (gmp_mpn_functions): Added sec_minvert.
+ * gmp-h.in (mpn_sec_minvert, mpn_sec_minvert_itch): New
+ declarations.
+ * mpn/generic/sec_minvert.c (mpn_sec_minvert)
+ (mpn_sec_minvert_itch): New functions.
+ (mpn_sec_add_1, mpn_cnd_neg, mpn_cnd_swap, mpn_sec_eq_ui): New
+ helper functions.
+
+2013-12-28 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/generic/sec_powm.c: Fix an ASSERT.
+
+ * gmp-h.in (mpn_sec_mul, mpn_sec_mul_itch): New declarations.
+ * gmp-h.in (mpn_sec_sqr, mpn_sec_sqr_itch): Likewise.
+ * mpn/generic/sec_mul.c: New file.
+ * mpn/generic/sec_sqr.c: New file.
+
+ * gmp-h.in (mpn_sec_powm, mpn_sec_powm_itch): New declarations.
+ * gmp-h.in (mpn_sec_div_qr, mpn_sec_div_qr_itch): Likewise.
+ * gmp-h.in (mpn_sec_div_r, mpn_sec_div_r_itch): Likewise.
+ * gmp-impl: Remove declarations of above functions.
+
+ * configure.ac (gmp_mpn_functions): Add sec_mul and sec_sqr.
+
+2013-12-26 Marco Bodrato <bodrato@mail.dm.unipi.it>
+
+ * Update many file's encoding to UTF-8.
+ * doc/tasks.html: Update <meta content> accordingly.
+ * doc/projects.html: Likewise.
+
+2013-12-26 Torbjorn Granlund <tege@gmplib.org>
+
+ * configure.ac: Rename mpn_blah_sec to mpn_sec_blah.
+ * gmp-impl.h: Corresponding changes.
+ * mpn/asm-defs.m4: Corresponding changes.
+ * tune/Makefile.am: Corresponding changes.
+ * tune/common.c: Corresponding changes.
+ * tune/speed.c: Corresponding changes.
+ * tune/speed.h: Corresponding changes.
+ * tune/tuneup.c: Corresponding changes.
+ * mpz/powm_sec.c: Update calls.
+ * tests/mpn/t-div.c: Likewise.
+
+ * mpn/generic/sec_powm.c: New name for mpn/generic/powm_sec.c.
+ * mpn/generic/sec_div.c: New name for mpn/generic/sb_div_sec.c.
+ * mpn/generic/sec_pi1_div.c: New name for mpn/generic/sbpi1_div_sec.c.
+ * mpn/generic/sec_tabselect.c: New name for mpn/generic/tabselect.c.
+
+ * mpn/alpha/sec_tabselect.asm: New name for tabselect.asm.
+ * mpn/arm/neon/sec_tabselect.asm: New name for tabselect.asm.
+ * mpn/arm/sec_tabselect.asm: New name for tabselect.asm.
+ * mpn/ia64/sec_tabselect.asm: New name for tabselect.asm
+ * mpn/powerpc32/sec_tabselect.asm: New name for tabselect.asm
+ * mpn/powerpc64/sec_tabselect.asm: New name for tabselect.asm
+ * mpn/sparc64/sec_tabselect.asm: New name for tabselect.asm
+ * mpn/x86/mmx/sec_tabselect.asm: New name for tabselect.asm
+ * mpn/x86/sec_tabselect.asm: New name for tabselect.asm
+ * mpn/x86_64/bd1/sec_tabselect.asm: New name for tabselect.asm
+ * mpn/x86_64/core2/sec_tabselect.asm: New name for tabselect.asm
+ * mpn/x86_64/coreinhm/sec_tabselect.asm: New name for tabselect.asm
+ * mpn/x86_64/coreisbr/sec_tabselect.asm: New name for tabselect.asm
+ * mpn/x86_64/fastsse/sec_tabselect.asm: New name for tabselect.asm
+ * mpn/x86_64/k10/sec_tabselect.asm: New name for tabselect.asm
+ * mpn/x86_64/pentium4/sec_tabselect.asm: New name for tabselect.asm
+ * mpn/x86_64/sec_tabselect.asm: New name for tabselect.asm
+
+2013-12-25 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpz/powm_sec.c: Handle 0^e mod m specially.
+ * mpn/generic/powm_sec.c: ASSERT that the base is non-zero.
+
+2013-12-23 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/generic/powm_sec.c (redcify): Use passed scratch instead of
+ locally allocated.
+ (mpn_powm_sec_itch): Accommodate mpn_sb_div_r_sec's scratch needs.
+
+2013-12-20 Mark Sofroniou <marks@wolfram.com>
+
+ * mpn/generic/mul_fft.c: Major overhaul of types.
+
+2013-12-18 Torbjorn Granlund <tege@gmplib.org>
+
+ * doc/gmp.texi (Low-level Functions): Rewrite mpn_set_str docs.
+
+2013-12-14 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
+
+ * mpn/powerpc32/darwin.m4: Allow (and ignore) optional
+ 'toc' parameter to PROLOGUE_cpu.
+ * mpn/powerpc32/elf.m4: Likewise.
+
+2013-12-09 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
+
+ * configure.ac: Check for ELFv2 ABI on PowerPC.
+ * mpn/powerpc64/elf.m4: Set assembler ABI version for ELFv2
+ and use appropriate PROLOGUE_cpu/EPILOGUE_cpu sequences.
+ Support optional 'toc' parameter to PROLOGUE_cpu.
+ * mpn/powerpc64/aix.m4: Allow (and ignore) optional
+ 'toc' parameter to PROLOGUE_cpu.
+ * mpn/powerpc64/darwin.m4: Likewise.
+
+ * mpn/powerpc64/mode64/dive_1.asm (mpn_divexact_1): Add 'toc'
+ parameter to PROLOGUE.
+ * mpn/powerpc64/mode64/divrem_1.asm (mpn_divrem_1): Likewise.
+ * mpn/powerpc64/mode64/divrem_2.asm (mpn_divrem_2): Likewise.
+ * mpn/powerpc64/mode64/gcd_1.asm (mpn_gcd_1): Likewise.
+ * mpn/powerpc64/mode64/invert_limb.asm (mpn_invert_limb): Likewise.
+ * mpn/powerpc64/mode64/mod_1_1.asm (mpn_mod_1_1p_cps): Likewise.
+ * mpn/powerpc64/mode64/mod_1_4.asm (mpn_mod_1s_4p_cps): Likewise.
+ * mpn/powerpc64/mode64/mode1o.asm (mpn_modexact_1c_odd): Likewise.
+ * mpn/powerpc64/mode64/p7/gcd_1.asm (mpn_gcd_1): Likewise.
+ * mpn/powerpc64/p6/lshift.asm (mpn_lshift): Likewise.
+ * mpn/powerpc64/p6/lshiftc.asm (mpn_lshiftc): Likewise.
+ * mpn/powerpc64/p6/rshift.asm (mpn_rshift): Likewise.
+ * mpn/powerpc64/vmx/popcount.asm (mpn_popcount): Likewise.
+
+2013-12-07 Niels Möller <nisse@lysator.liu.se>
+
+ * configfsf.sub: Updated to version 2013-10-01, from gnulib.
+ * configfsf.guess: Updated to version 2013-11-29, from gnulib.
+
+2013-12-03 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/generic/div_qr_1.c: Make constant args asm inlines become limbs.
+ * mpn/generic/div_qr_1n_pi1.c: Likewise.
+ * mpn/generic/div_qr_2.c: Likewise.
+ * mpn/generic/div_qr_2.c: Likewise.
+ * mpn/generic/mod_1_1.c: Likewise.
+ * mpn/generic/mod_1_2.c: Likewise.
+ * mpn/generic/mod_1_3.c: Likewise.
+ * mpn/generic/mod_1_4.c: Likewise.
+ * mpn/generic/mulmid_basecase.c: Likewise.
+ * mpn/generic/mulmod_bnm1.c: Likewise.
+ * mpn/generic/sqrmod_bnm1.c: Likewise.
+ * mpn/sparc64/divrem_1.c: Likewise.
+ * mpn/sparc64/mod_1_4.c: Likewise.
+
+ * mpn/generic/toom_interpolate_7pts.c (BINVERT_15): Fix typo.
+
+2013-11-11 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/x86_64/dos64.m4 (CALL): Provide to override default.
+
+2013-11-08 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/x86_64/x86_64-defs.m4 (CALL): Swap PIC test and macro defn.
+
+ * mpn/generic/div_qr_2.c: Test HAVE_HOST_CPU_FAMILY_x86, not i386.
+
+ * doc/gmp.texi: Update many URLs.
+
+2013-11-04 Torbjorn Granlund <tege@gmplib.org>
+
+ * configure.ac: Set symbol OPENBSD for x86-openbsd hosts.
+ * mpn/x86_64/fat/fat_entry.asm (PRETEND_PIC): New name for
+ PIC_OR_DARWIN.
+ (PRETEND_PIC): Set also for OPENBSD.
+
+2013-10-29 Torbjorn Granlund <tege@gmplib.org>
+
+ * printf/doprnt.c (__gmp_doprnt): Use memcpy instead of strcpy.
+
+2013-10-24 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/generic/div_qr_1u_pi2.c: New file.
+ * mpn/generic/div_qr_1n_pi2.c: New file.
+
+2013-10-24 Niels Möller <nisse@lysator.liu.se>
+
+ * mpn/x86_64/div_qr_1n_pi1.asm: Bugfixes, for case n == 1 and
+ in-place operation.
+ * mpn/x86_64/k8/div_qr_1n_pi1.asm: Likewise.
+
+ * mpn/generic/div_qr_1n_pi1.c (mpn_div_qr_1n_pi1): Bug fixes,
+ off-by-one MPN_INCR_U, and support for in-place operation.
+
+2013-10-24 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/x86/fat/fat.c (fake_cpuid_table): Add Haswell.
+
+2013-10-23 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/x86_64/x86_64-defs.m4 (oplist): New define, data from `regnum'.
+ (regnum): Use x86_lookup, feed oplist.
+
+2013-10-22 Niels Möller <nisse@lysator.liu.se>
+
+ * tests/devel/try.c: Support mpn_div_qr_1n_pi1.
+
+ * mpn/x86_64/k8/div_qr_1n_pi1.asm: Moved the below k10 file here.
+ Applied tweak from Torbjörn to get it to run well on k8.
+
+ * mpn/x86_64/k10/div_qr_1n_pi1.asm: New file (renamed above).
+ Differs from generic x86_64 version by using cmov.
+
+ * mpn/x86_64/div_qr_1n_pi1.asm: Reordered arguments to second mul.
+ Deleted misleading cycle annotations.
+
+2013-10-21 Niels Möller <nisse@lysator.liu.se>
+
+ * configure.ac: Add HAVE_NATIVE_mpn_div_qr_1n_pi1 to config.in.
+
+ * mpn/generic/div_qr_1n_pi1.c (mpn_div_qr_1n_pi1): Fix typos
+ affecting ASSERT.
+
+2013-10-20 Niels Möller <nisse@lysator.liu.se>
+
+ * mpn/x86_64/div_qr_1n_pi1.asm: New file.
+
+ * tune/div_qr_1_tune.c (__gmpn_div_qr_1n_pi1): Check
+ div_qr_1n_pi1_method only when !HAVE_NATIVE_mpn_div_qr_1n_pi1.
+
+ * mpn/asm-defs.m4 (define_mpn): Add div_qr_1n_pi1.
+
+ * tune/common.c (speed_mpn_div_qr_1): New function, replacing...
+ (speed_mpn_div_qr_1n, speed_mpn_div_qr_1u): ... deleted functions
+ (speed_mpn_div_qr_1n_pi1, speed_mpn_div_qr_1n_pi1_1)
+ (speed_mpn_div_qr_1n_pi1_2): New functions.
+ * gmp-impl.h [TUNE_PROGRAM_BUILD]: Declare div_qr_1-related tuning
+ variables.
+ * tune/tuneup.c (speed_mpn_div_qr_1_tune, tune_div_qr_1): New
+ functions.
+ (div_qr_1n_pi1_method, div_qr_1_norm_threshold)
+ (div_qr_1_unnorm_threshold): New globals.
+ * tune/speed.c (routine): Replaced mpn_div_qr_1n and mpn_div_qr_1u
+ by mpn_div_qr_1, requiring ".r" parameter. Added mpn_div_qr_1n_pi1
+ and variants.
+ * tune/speed.h (SPEED_ROUTINE_MPN_DIV_QR_1): Use the "r" parameter
+ as divisor.
+ * tune/div_qr_1n_pi1_2.c: New file.
+ * tune/div_qr_1n_pi1_1.c: New file.
+ * tune/div_qr_1_tune.c: New file.
+ * tune/Makefile.am (libspeed_la_SOURCES): Added div_qr_1n_pi1_1.c,
+ div_qr_1n_pi1_2.c, and div_qr_1_tune.c.
+
+ * tune/speed.c (routine): Added mpn_div_qr_1n and mpn_div_qr_1u.
+ * tune/speed.h (SPEED_ROUTINE_MPN_DIV_QR_1): New macro.
+ (speed_mpn_div_qr_1n, speed_mpn_div_qr_1u): Declare.
+ * tune/common.c (speed_mpn_div_qr_1n, speed_mpn_div_qr_1u): New
+ functions.
+
+ * gmp-impl.h (mpn_div_qr_1n_pi1): Declare function.
+ * gmp-h.in (mpn_div_qr_1): Declare function.
+ * configure.ac (gmp_mpn_functions): Added div_qr_1 and
+ div_qr_1n_pi1.
+ * mpn/generic/div_qr_1.c (mpn_div_qr_1): New file and function.
+ * mpn/generic/div_qr_1n_pi1.c (mpn_div_qr_1n_pi1): New file and
+ function.
+ * tests/mpn/t-div.c (main): Test mpn_div_qr_1.
+
+2013-10-17 Torbjorn Granlund <tege@gmplib.org>
+
+ * configure.ac (alpha): Pass -mieee via gcc_cflags_maybe.
+
+2013-10-16 Torbjorn Granlund <tege@gmplib.org>
+
+ * config.guess: Let AMD64 cpuid bit override pessimistic cpu guesses.
+
+ * mpn/alpha/unicos.m4 (DATASTART): Accept optional align parameter.
+ * mpn/alpha/divrem_2.asm: Use provided gp mechanisms.
+ * mpn/alpha/default.m4 (PROLOGUE): Provide "..ng" post-gp label.
+ * mpn/alpha/invert_limb.asm: Align table to 8-byte boundary. Make code
+ work if table is not fully aligned. Properly test for BWX.
+
+2013-10-15 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/alpha/default.m4 (DATASTART): Use RODATA instead of DATA;
+ accept optional align parameter.
+ * mpn/alpha/invert_limb.asm: Align table.
+ * mpn/alpha/ev5/diveby3.asm: Likewise.
+
+2013-10-11 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/x86/k7/mod_1_1.asm: Use 'subl' form to avoid ambiguity.
+ * mpn/x86/k7/mod_1_4.asm: Likewise.
+
+ * configure.ac (X86_64_PATTERN): Append "cc" to cclist_64 and
+ cclist_x32.
+
+2013-10-08 Torbjorn Granlund <tege@gmplib.org>
+ Marc Glisse <marc.glisse@inria.fr>
+
+ * tests/mpf/reuse.c (main): Compare addresses instead of names.
+ Use larger numbers for exponents.
+
+2013-10-08 Marc Glisse <marc.glisse@inria.fr>
+
+ * doc/mdate-sh, doc/texinfo.tex, install-sh, missing, ylwrap: Remove.
+ * .bootstrap: Use autoreconf (and in particular automake -a).
+
+ * gmp-h.in: Remove __need_size_t. Include <stddef.h>, not <cstddef>.
+
+ * tests/mpf/reuse.c (main): Use small numbers as exponents.
+
+2013-10-05 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/x86_64/atom/aorsmul_1.asm: Slight tweak.
+
+ * doc/gmp.texi (ABI and ISA): Document x32.
+
+ * mpn/sparc64/ultrasparct3/dive_1.asm: Use our register names.
+
+2013-09-24 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/x86_64/atom/redc_1.asm: New file.
+
+2013-09-23 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/x86_64/bobcat/redc_1.asm: Make the code for 1 <= n <= 3 work.
+
+2013-09-22 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/x86_64/coreisbr/redc_1.asm: Slightly tweak basecase code.
+
+ * mpn/x86_64/core2/redc_1.asm: New file.
+
+ * mpn/x86_64/bobcat/redc_1.asm: New file.
+
+2013-09-21 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/x86_64/coreinhm/redc_1.asm: New file.
+
+2013-09-21 Marc Glisse <marc.glisse@inria.fr>
+
+ * tests/mpn/t-mulmid.c: Cast arguments of printf to int to match %d.
+ * tests/rand/t-urbui.c: Use 1UL for unsigned constant.
+ * mpn/generic/get_str.c: Avoid temporarily pointing outside an array.
+
+2013-09-20 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/x86_64/coreisbr/redc_1.asm: New file.
+
+ * mpn/x86_64/k8/redc_1.asm: Complete rewrite.
+
+ * mpn/x86_64/coreisbr/mullo_basecase.asm: Postpone pushes, short-
+ circuit a branch.
+ * mpn/x86_64/coreihwl/mullo_basecase.asm: Short-circuit a branch.
+
+ * mpn/x86_64/core2/mullo_basecase.asm: New file.
+
+2013-09-19 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/x86_64/fastsse/copyi-palignr.asm: Allocate more stack under DOS.
+
+2013-09-18 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/x86_64/core2/mul_basecase.asm: New file.
+ * mpn/x86_64/core2/sqr_basecase.asm: New file.
+
+ * mpn/x86_64/coreihwl/mullo_basecase.asm: New file.
+ * mpn/x86_64/coreisbr/mullo_basecase.asm: New file.
+
+2013-09-16 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/x86_64/fastsse/copyi-palignr.asm: Preserve xmm6-xmm8 under DOS.
+
+2013-09-15 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/x86_64/tabselect.asm: Use R8 for bit testing.
+
+ * mpn/x86_64/coreihwl/mul_basecase.asm: Replace mul_1 code.
+
+ * mpn/x86_64/coreisbr/aorsmul_1.asm: Rewrite.
+
+2013-09-12 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/ia64/gcd_1.asm: Use dep for combining table base and low bits.
+
+ * mpn/x86_64/fastsse/com-palignr.asm: Implement temp fix to properly
+ handle overlap.
+
+2013-09-10 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/x86_64/fastsse/copyi-palignr.asm: Rewrite rp != up (mod 16) code
+ to make it handle any allowed overlap.
+
+2013-09-09 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/x86_64/atom/com.asm: New file, grabbing fastsse code.
+
+ * mpn/x86_64/bd1/copyi.asm: New file, grabbing fastsse code.
+ * mpn/x86_64/bd1/copyd.asm: Likewise.
+ * mpn/x86_64/bd1/com.asm: Likewise.
+
+ * mpn/x86_64/fastavx/copyi.asm: New file.
+ * mpn/x86_64/fastavx/copyd.asm: New file.
+
+2013-09-05 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/x86_64/coreihwl/aorsmul_1.asm: Streamline.
+
+2013-09-04 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/x86_64/coreihwl/sqr_basecase.asm: Implement larger "corner".
+ Misc tuning.
+
+2013-09-03 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/x86_64/coreihwl/redc_1.asm: New file.
+
+ * mpn/x86_64/x86_64-defs.m4 (mulx): Handle negative offsets.
+
+2013-08-31 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/x86_64/coreisbr/sqr_basecase.asm: New file.
+
+ * mpn/x86_64/sqr_diag_addlsh1.asm: New file.
+
+2013-08-30 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/x86_64/fat/mul_basecase.c: New file.
+ * mpn/x86_64/fat/sqr_basecase.c: New file.
+ * mpn/x86_64/fat/mullo_basecase.c: New file.
+ * mpn/x86_64/fat/redc_1.c: New file.
+
+2013-08-29 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/x86_64/k8/mul_basecase.asm: Move top-level basecase file to k8
+ subdir.
+ * mpn/x86_64/k8/sqr_basecase.asm: Likewise.
+ * mpn/x86_64/k8/redc_1.asm: Likewise.
+ * mpn/x86_64/k8/mullo_basecase.asm: Likewise.
+ * mpn/x86_64/k8/mulmid_basecase.asm: Likewise.
+
+ * mpn/ia64/aors_n.asm: Clean up some bundlings.
+
+ * mpn/x86_64/fat/fat.c (__gmpn_cpuvec_init): Support Haswell.
+ (fake_cpuid_table): Likewise.
+
+ * configure.ac (x86): Remove any mulx paths. Let bwl path = hwl path.
+ (fat_path): Add coreihwl.
+
+ * mpn/x86_64/coreihwl/aorsmul_1.asm: Move from `mulx' directory, use
+ mulx() macro.
+ * mpn/x86_64/coreihwl/mul_1.asm: Likewise.
+ * mpn/x86_64/coreihwl/mul_2.asm: Likewise.
+ * mpn/x86_64/coreihwl/mul_basecase.asm: Likewise.
+ * mpn/x86_64/coreihwl/sqr_basecase.asm: Likewise.
+
+ * mpn/x86_64/x86_64-defs.m4 (mulx): New macro.
+ (regnum, regnumh, ix): Supporting macros.
+
+2013-08-28 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/x86_64/coreisbr/divrem_1.asm: New file.
+
+2013-08-23 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/x86_64/fastsse/com-palignr.asm: New file, closely based on
+ copyi-palignr.asm.
+
+ * mpn/x86_64/fastsse/copyi.asm Use "test R8(reg)" instead of "bt".
+ * mpn/x86_64/fastsse/copyd-palignr.asm: Likewise.
+ * mpn/x86_64/fastsse/copyi-palignr.asm: Likewise.
+ * mpn/x86_64/fastsse/lshift-movdqu2.asm: Likewise.
+ * mpn/x86_64/fastsse/lshiftc-movdqu2.asm: Likewise.
+ * mpn/x86_64/fastsse/rshift-movdqu2.asm: Likewise.
+ * mpn/x86_64/fastsse/tabselect.asm: Likewise.
+
+ * mpn/sparc64/ultrasparct3/sqr_diag_addlsh1.asm: New file.
+
+ * mpn/alpha/aorslsh2_n.asm: New file.
+ * mpn/alpha/aorslsh1_n.asm: Rewrite.
+ * mpn/alpha/ev6/aorslsh1_n.asm: New file.
+
+2013-08-21 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/alpha/sqr_diag_addlsh1.asm: New file.
+ * mpn/alpha/sqr_diagonal.asm: Remove.
+ * mpn/alpha/ev6/sqr_diagonal.asm: Remove.
+
+2013-08-20 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/powerpc32/sqr_diag_addlsh1.asm: New file.
+ * mpn/powerpc32/sqr_diagonal.asm: Remove.
+
+2013-08-15 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/x86_64/coreihwl/mulx/sqr_basecase.asm: New file.
+
+2013-08-05 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/x86_64/coreisbr/aors_n.asm: Complete rewrite.
+
+2013-08-04 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/x86_64/coreihwl/mulx/mul_basecase.asm: New file.
+
+ * mpn/x86_64/bd1/mul_2.asm: New file.
+
+ * mpn/x86_64/coreihwl/gmp-mparam.h: New file.
+
+2013-08-03 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/x86_64/coreihwl/mulx/mul_2.asm: New file.
+ * mpn/x86_64/coreihwl/mulx/addmul_2.asm: New file.
+
+ * mpn/x86_64/coreinhm/aorsmul_1.asm: New file.
+
+ * mpn/x86_64/coreisbr/mul_basecase.asm: Save some O(n) and O(1) cycles.
+
+ * mpn/x86_64/coreisbr/mul_2.asm: New file.
+
+2013-08-02 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/x86_64/coreisbr/addmul_2.asm: Complete rewrite.
+
+2013-08-01 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/x86_64/bd1/mul_basecase.asm: New file.
+
+ * mpn/x86_64/coreisbr/mul_basecase.asm: New file.
+
+ * mpn/x86_64/coreihwl/aorsmul_1.asm: New file.
+
+2013-07-31 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/x86_64/atom/mul_2.asm: New file.
+ * mpn/x86_64/atom/addmul_2.asm: New file.
+ * mpn/x86_64/atom/mul_1.asm: New file.
+ * mpn/x86_64/atom/aorsmul_1.asm: New file.
+
+ * mpn/x86_64/coreihwl/mul_1.asm: New file.
+
+ * configure.ac (x86): Add Haswell-specific path.
+
+ * configure.in (fat_functions): Add cnd_add_n, cnd_sub_n..
+ * gmp-impl.h (struct cpuvec_t): Add fields for new fat functions.
+ * gmp-impl.h: Adjust corresponding declarations.
+
+ * mpn/x86_64/x86_64-defs.m4 (CPUVEC_FUNCS_LIST): Add new fat functions.
+ * mpn/x86/x86-defs.m4 (CPUVEC_FUNCS_LIST): Likewise.
+ * mpn/x86_64/fat/fat.c (__gmpn_cpuvec): Likewise.
+ * mpn/x86/fat/fat.c (__gmpn_cpuvec): Likewise.
+
+2013-07-30 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/x86_64/coreisbr/popcount.asm: New file.
+
+2013-07-23 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/x86_64/bobcat/aors_n.asm: New file.
+
+ * mpn/x86_64/pentium4/aorslshC_n.asm: Remove a spurious emms insn.
+
+ * mpn/x86_64/bd1/aorrlsh1_n.asm: New file.
+ * mpn/x86_64/bd1/sublsh1_n.asm: New file.
+
+2013-07-22 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/powerpc64/mode64/mod_1_1.asm: Handle little-endian mode.
+ * mpn/powerpc64/mode64/mod_1_4.asm: Likewise.
+
+2013-07-16 Torbjorn Granlund <tege@gmplib.org>
+
+ * doc/gmp.texi: Declare countless of function arguments as 'const'.
+
+2013-07-15 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/x86_64/core2/aors_n.asm: Rewrite.
+
+ * mpn/generic/sb_div_sec.c: Compute inverse as floor(B^2/(dh+1)), per
+ Niels' suggestion.
+ * mpn/generic/sbpi1_div_sec.c: Remove inverse rounding-up code.
+
+2013-07-14 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/powerpc64/mode64/divrem_1.asm: Remove explicit nop after CALL.
+ * mpn/powerpc64/mode64/divrem_2.asm: Likewise.
+ * mpn/powerpc64/mode64/mod_1_1.asm: Likewise.
+ * mpn/powerpc64/mode64/mod_1_4.asm: Likewise.
+
+2013-07-13 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/x86/atom/cnd_add_n.asm: New file.
+ * mpn/x86/atom/cnd_sub_n.asm: New file.o
+
+2013-07-12 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/generic/sbpi1_div_sec.c: Partial rewrite.
+
+2013-07-11 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/x86_64/cnd_aors_n.asm: Tweak for better speed on K8, bobcat, bd1,
+ NHM, Atom.
+
+2013-07-05 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/powerpc64/p7/copyi.asm: Handle n = 0.
+ * mpn/powerpc64/p7/copyd.asm: Likewise.
+
+2013-07-04 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/powerpc64/mode64/p7/aormul_2.asm: New file.
+
+ * mpn/powerpc64/darwin.m4 (EXTRA_REGISTER): New define.
+ * mpn/powerpc64/aix.m4: New define (actually undefine).
+ * mpn/powerpc64/elf.m4: Likewise.
+
+2013-07-03 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/powerpc64/com.asm: Rewrite.
+
+ * mpn/powerpc64/p7/copyi.asm: New file.
+ * mpn/powerpc64/p7/copyd.asm: New file.
+
+2013-07-02 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/powerpc64/mode64/gcd_1.asm: New file.
+ * mpn/powerpc64/mode64/p7/gcd_1.asm: New file.
+
+2013-07-01 Torbjorn Granlund <tege@gmplib.org>
+
+ * configure.ac: Comment out AC_PROG_F77.
+
+ * mpn/powerpc64/mode64/rsh1add_n.asm: Remove.
+ * mpn/powerpc64/mode64/rsh1sub_n.asm: Remove.
+ * mpn/powerpc64/mode64/rsh1aors_n.asm: New file, code not based on
+ removed files.
+
+2013-06-28 Marc Glisse <marc.glisse@inria.fr>
+
+ * cxx/ismpf.cc: Use GMP_DECIMAL_POINT.
+ * cxx/osmpf.cc: Likewise.
+ * tests/cxx/t-locale.cc: Likewise.
+
+2013-06-28 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/powerpc64/mode64/p7/aorsorrlshC_n.asm: New file.
+ * mpn/powerpc64/mode64/p7/aorsorrlsh1_n.asm: New file.
+ * mpn/powerpc64/mode64/p7/aorsorrlsh2_n.asm: New file.
+
+ * mpn/powerpc64/mode64/aorsorrlshC_n.asm: Use alias regname.
+
+2013-06-27 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/powerpc64/mode64/p7/aors_n.asm: New file.
+
+2013-06-22 Torbjorn Granlund <tege@gmplib.org>
+
+ * aorslshC_n.asm, aorslsh2_n.asm, aorslsh1_n.asm: Remove.
+ * aorsorrlshC_n.asm, aorsorrlsh1_n.asm, aorsorrlsh2_n.asm: New files.
+
+2013-06-19 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/powerpc64/p6/lshift.asm: Rewrite switching-into-loop code.
+ * mpn/powerpc64/p6/rshift.asm: Likewise.
+ * mpn/powerpc64/p6/lshiftc.asm: Likewise.
+
+2013-06-17 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/powerpc64/p6/lshift.asm: Fix typo in label reference.
+ For 32-bit mode, zero extend `n' argument and split retval.
+ * mpn/powerpc64/p6/rshift.asm: Likewise.
+ * mpn/powerpc64/p6/lshiftc.asm: Likewise.
+
+2013-06-10 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/generic/mu_div_q.c: Remove obsolete comment.
+
+2013-06-09 Marc Glisse <marc.glisse@inria.fr>
+
+ * mpn/generic/get_d.c (mpn_get_d): Avoid signed overflow.
+ * mpz/kronzs.c (mpz_kronecker_si): Use ABS_CAST.
+
+2013-05-31 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/generic/mu_div_q.c: Call mpn_mu_divappr_q for entire division,
+ never just for tail. (This fixes performance issues at the expense of
+ memory needs.)
+
+2013-05-26 Torbjorn Granlund <tege@gmplib.org>
+
+ * configure.ac (*sparc*-*-*): Major overhaul.
+
+2013-05-22 Torbjorn Granlund <tege@gmplib.org>
+
+ * doc/gmp.texi (Reporting Bugs): Ask for configure's output.
+
+ * mpn/ia64/divrem_2.asm: Don't clobber f16-f18.
+
+2013-05-20 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/arm/udiv.asm: Change spacing to work around binutils bug.
+
+2013-05-16 Torbjorn Granlund <tege@gmplib.org>
+
+ * Makefile.am (LIBGMP_LT_*, LIBGMPXX_LT_*): Bump version info.
+
+ * tests/misc.c (tests_hardware_getround, tests_hardware_setround):
+ Avoid assembly dependency unless WANT_ASSEMBLY.
+
+ * configure.ac (WANT_ASSEMBLY): Conditionally define.
+
+2013-05-14 Torbjorn Granlund <tege@gmplib.org>
+
+ * configure.ac (arm1156): Don't fall back to plain v6 compiler option.
+
+2013-05-11 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/x86_64/coreisbr/mul_1.asm: Handle n = 1 for DOS64. Streamline.
+ * mpn/x86_64/coreisbr/aorsmul_1.asm: Streamline.
+
+2013-05-10 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/x86_64/coreisbr/aorsmul_1.asm: Fix, then enable DOS64 support.
+ * mpn/x86_64/coreisbr/mul_1.asm: Enable DOS64 support.
+
+ * mpn/x86/p6/mmx/gmp-mparam.h: Set down SQR_TOOM2_THRESHOLD to parent
+ directory value.
+
+2013-05-09 Torbjorn Granlund <tege@gmplib.org>
+
+ * configure.ac (--enable-fake-cpuid): New option.
+ * mpn/x86_64/fat/fat.c (WANT_FAKE_CPUID): Remove defaulting.
+ * mpn/x86/fat/fat.c (WANT_FAKE_CPUID): Likewise.
+
+ * mpn/x86_64/bd1/mul_1.asm: Fix typo.
+
+2013-05-07 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/x86_64/fat/fat.c (fake_cpuid): Handle 0x80000001 request.
+ (fake_cpuid_available): Remove unused function.
+
+ * mpn/generic/mod_1_1.c: Cast constant udiv_rnnd_preinv arguments.
+ * mpn/generic/mod_1_2.c: Likewise.
+ * mpn/generic/mod_1_3.c: Likewise.
+ * mpn/generic/mod_1_4.c: Likewise.
+ * mpn/generic/divrem_2.c: Likewise.
+
+2013-05-06 Torbjorn Granlund <tege@gmplib.org>
+
+ * config.guess (power*): Handle all ppc970 variants.
+
+2013-05-03 David S. Miller <davem@davemloft.net>
+
+ * tune/common.c (speed_mpn_addlsh1_n, speed_mpn_sublsh1_n,
+ speed_mpn_rsblsh1_n, speed_mpn_addlsh2_n, speed_mpn_sublsh2_n,
+ speed_mpn_rsblsh2_n): Don't define if these routines are macros.
+ * tune/speed.c (routine): Likewise don't table if they are macros.
+
+ * mpn/sparc64/ultrasparct3/addmul_1.asm: Add T4 and T3 timings.
+ * mpn/sparc64/ultrasparct3/aormul_4.asm: Likewise.
+ * mpn/sparc64/ultrasparct3/aorslsh_n.asm: Likewise.
+ * mpn/sparc64/ultrasparct3/cnd_aors_n.asm: Likewise.
+ * mpn/sparc64/ultrasparct3/submul_1.asm: Likewise.
+
+2013-05-03 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/sparc64/ultrasparct3/aorslsh_n.asm: Invoke INITCY where it has
+ effect.
+
+ * gmp-impl.h: Amend last change.
+ * tests/devel/try.c (choice_array): Don't try to table addlsh1_n etc if
+ a macro.
+
+2013-05-02 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/arm/copyd.asm: Suppress dead pointer update.
+ * mpn/arm/copyi.asm: Likewise.
+ * mpn/arm/neon/logops_n.asm: Likewise.
+ * mpn/arm/neon/tabselect.asm: Likewise.
+ * mpn/arm/rshift.asm: Likewise.
+ * mpn/arm/tabselect.asm: Likewise.
+ * mpn/arm/v6/dive_1.asm: Likewise
+ * mpn/arm/v7a/cora15/neon/copyi.asm: Likewise.
+
+ * mpn/arm/v7a/cora15/neon/com.asm: New file.
+
+2013-05-01 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/sparc64/ultrasparct3/aormul_4.asm: New file.
+
+ * configure.ac (GMP_MULFUNC_CHOICES): Support mul_3 + addmul_3 and
+ mul_4 + addmul_4.
+
+ * mpn/sparc64/ultrasparct3/aormul_2.asm: Optimise lead-in code.
+
+ * mpn/sparc64/ultrasparct3/missing.m4 (addxccc): Allow g2 as input.
+ (umulxhi): Save and restore o7 to allow it as in/out parameter.
+
+2013-04-29 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/arm/v7a/cora15/cnd_aors_n.asm: New file, was mis-named.
+
+ * mpn/sparc64/ultrasparct3/addmul_1.asm: Rewrite.
+
+ * mpn/sparc64/ultrasparct3/submul_1.asm: Rewrite.
+
+ * mpn/sparc64/ultrasparct3/cnd_aors_n.asm: New file.
+
+ * gmp-impl.h: 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.
+
+ * mpn/sparc64/ultrasparct3/aorslsh_n.asm: New file.
+
+ * configure.ac (sparc-*-*): Recognise t5 along with t3 and t4.
+ Remove sparc64/ultrasparct1 from path_64 for T3, T3, and T5.
+
+2013-04-27 Mike Frysinger <vapier@gentoo.org>
+
+ * configure.ac (arm*-*-*): Set up path also for plainest CPU variants.
+
+2013-04-27 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/arm/v6/popham.asm: New file.
+
+ * mpn/arm/v7a/cora15/cnd-aors_n.asm: New file.
+
+2013-04-25 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/arm/mod_34lsub1.asm: Clear carry smarter.
+
+ * mpn/arm/v7a/cora15/logops_n.asm: Conditionally suppress conditionally
+ used code.
+
+ * mpn/arm/v7a/cora15/submul_1.asm: New file.
+
+2013-04-24 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/arm/v7a/cora15/com.asm: New file.
+
+ * mpn/arm/v7a/cora15/logops_n.asm: New file.
+
+2013-04-19 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/arm/v7a/cora15/aors_n.asm: New file.
+
+ * mpn/arm/v7a/cora15/addmul_1.asm: Rewrite.
+
+2013-04-18 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/alpha/tabselect.asm: New file.
+
+2013-04-17 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/powerpc32/tabselect.asm: New file.
+
+ * longlong.h (arm64 count_trailing_zeros): New.
+
+ * mpn/arm64/invert_limb.asm: New file.
+
+ * mpn/generic/dive_1.c: Rewrite to use Hensel division also for
+ size = 1.
+
+ * mpn/generic/mod_1_1.c (add_mssaaaa): Provide VIS3 variant.
+
+ * configure.ac: Remove "missing" from extra_functions_64 for coreibwl.
+
+ * mpn/sparc64/ultrasparct3/mul_1.asm: Decrease loop alignment.
+ * mpn/sparc64/ultrasparct3/aormul_2.asm: Likewise.
+
+2013-04-16 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/alpha/invert_limb.asm: Generate table.
+ * mpn/powerpc64/mode64/invert_limb.asm: Likewise.
+ * mpn/s390_64/invert_limb.asm: Likewise.
+ * mpn/sparc64/ultrasparct3/invert_limb.asm: Likewise.
+ * mpn/x86_64/invert_limb_table.asm: Likewise.
+
+2013-04-15 David S. Miller <davem@davemloft.net>
+
+ * mpn/sparc32/sparc-defs.m4 (LEA64): New macro.
+ * mpn/sparc64/gcd_1.asm: Use it.
+ * mpn/sparc64/ultrasparct3/dive_1.asm: Likewise.
+ * mpn/sparc64/ultrasparct3/invert_limb.asm: Likewise.
+ * mpn/sparc64/ultrasparct3/mode1o.asm: Likewise.
+
+ * mpn/sparc64/gcd_1.asm: Use RODATA, TYPE, and SIZE.
+
+2013-04-15 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/sparc64/ultrasparct3/invert_limb.asm: Avoid addend for GOT entry,
+ it is not portable.
+
+ * mpn/sparc64/tabselect.asm: New file.
+
+ * mpn/x86/mmx/tabselect.asm: New file.
+ * configure.ac (x86): Add x86/mmx to path for relevant CPUs.
+
+ * mpn/sparc64/gcd_1.asm: Use rdpc for PIC.
+ * mpn/sparc64/ultrasparct3/mode1o.asm: Use rdpc for PIC.
+ * mpn/sparc64/ultrasparct3/dive_1.asm: Use rdpc for PIC.
+ * mpn/sparc64/ultrasparct3/invert_limb.asm: Handle PIC, use rdpc.
+
+ * Revert remaining parts of recent sparc LEA changes.
+
+2013-04-14 David S. Miller <davem@davemloft.net>
+
+ * mpn/sparc32/v9/sqr_diagonal.asm: Revert LEA and INT32 changes.
+ * mpn/sparc64/gcd_1.asm: Likewise.
+
+2013-04-13 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/x86_64/bd1/tabselect.asm: New file.
+ * mpn/x86_64/coreisbr/tabselect.asm: New file.
+ * mpn/x86_64/k10/tabselect.asm: New file.
+ * mpn/x86_64/coreinhm/tabselect.asm: New file.
+ * mpn/x86_64/core2/tabselect.asm: New file.
+ * mpn/x86_64/pentium4/tabselect.asm: New file.
+
+ * mpn/x86_64/fastsse/tabselect.asm: New file.
+ * mpn/arm/neon/tabselect.asm: Rewrite.
+ * mpn/arm/tabselect.asm: Rewrite.
+ * mpn/powerpc64/tabselect.asm: Rewrite.
+ * mpn/x86_64/tabselect.asm: Rewrite.
+
+ * tune/speed.h (SPEED_ROUTINE_MPN_TABSELECT): Implement special code,
+ making .r argument be table width.
+
+2013-04-11 David S. Miller <davem@davemloft.net>
+
+ * mpn/sparc32/sparc-defs.m4 (LEA): Remove unused local label.
+ (LEA_LEAF): Likewise.
+
+2013-04-11 Niels Möller <nisse@lysator.liu.se>
+
+ * mpn/arm/v6/submul_1.asm: New file, using the corresponding
+ addmul_1 loop + complement trick.
+
+2013-04-10 David S. Miller <davem@davemloft.net>
+
+ * acinclude.m4 (GMP_ASM_SPARC_GOTDATA,
+ GMP_ASM_SPARC_SHARED_THUNKS): New feature tests.
+ * configure.ac: Call GMP_ASM_SPARC_GOTDATA and
+ GMP_ASM_SPARC_SHARED_THUNKS on sparc.
+ * mpn/sparc32/sparc-defs.m4 (LEA, LEA_LEAF, LEA_THUNK): New macros.
+ * mpn/sparc32/udiv.asm: Convert over to LEA, LEA_LEAF, and LEA_THUNK.
+ * mpn/sparc32/v8/addmul_1.asm: Likewise.
+ * mpn/sparc32/v8/mul_1.asm: Likewise.
+ * mpn/sparc32/v8/supersparc/udiv.asm: Likewise.
+ * mpn/sparc32/v8/udiv.asm: Likewise.
+ * mpn/sparc64/gcd_1.asm: Likewise.
+ * mpn/sparc64/ultrasparct3/dive_1.asm: Likewise.
+ * mpn/sparc64/ultrasparct3/invert_limb.asm: Likewise.
+ * mpn/sparc64/ultrasparct3/mode1o.asm: Likewise.
+ * mpn/sparc32/v9/sqr_diagonal.asm: Likewise and use INT32.
+
+2013-04-09 Torbjorn Granlund <tege@gmplib.org>
+
+ * longlong.h (sparc64): Test __VIS__ instead of __sparc_vis3.
+
+ * config.guess (sparc*): Invoke set_cc_for_build to get $dummy.
+
+2013-04-08 Torbjorn Granlund <tege@gmplib.org>
+
+ * config.guess: Rework tmp file names, make sure to remove tmp files.
+
+ * mpn/arm/dive_1.asm: Rewrite count-trailing-zeros code, using private
+ table.
+
+ * mpn/arm: Canonicalise arm assembly to use old style "mov ... lsl" for
+ shift ops.
+
+2013-04-07 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/sparc64/ultrasparct3/mod_34lsub1.asm: New file.
+
+ * longlong.h (sparc64): Define umul_ppmm, add_ssaaaa, and
+ count_leading_zeros conditionally under the symbol __sparc_vis3.
+
+ * mpn/arm/dive_1.asm: New file.
+ * mpn/arm/v6/dive_1.asm: New file.
+
+ * mpn/arm/v6t2/mode1o.asm: Make trivial change to avoid v6t2...
+ * mpn/arm/v6/mode1o.asm: ...instruction, move file accordingly.
+
+ * mpn/powerpc64/mode64/invert_limb.asm: Put all multiplies low-limb first.
+
+2013-04-04 David S. Miller <davem@davemloft.net>
+
+ * mpn/sparc64/ultrasparct3/add_n.asm: Rewrite.
+ * mpn/sparc64/ultrasparct3/sub_n.asm: Rewrite.
+
+ * mpn/sparc64/ultrasparct3/invert_limb.asm: Align table.
+
+2013-04-04 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/sparc32/sparc-defs.m4: Provide dummy lzcnt.
+
+ * tests/mpn/logic.c: Seed using RANDS, then use mpz_rrandomb.
+
+ * tests/mpn/t-div.c (random_word): Remove. Let callers invoke urandom.
+
+ * mpn/sparc64/ultrasparct3/mul_1.asm: Rewrite.
+
+ * mpn/sparc64/ultrasparct3/bdiv_dbm1c.asm: New file.
+ * mpn/sparc64/ultrasparct3/dive_1.asm: New file.
+ * mpn/sparc64/ultrasparct3/invert_limb.asm: New file.
+ * mpn/sparc64/ultrasparct3/mod_1_4.asm: New file.
+ * mpn/sparc64/ultrasparct3/mode1o.asm: New file.
+
+2013-04-03 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/sparc64/ultrasparct3/aormul_2.asm: Reschedule for better speed.
+
+2013-04-02 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/sparc64/ultrasparct3/missing.m4: Misc tweaks.
+ (lzcnt): New.
+ * mpn/sparc64/ultrasparct3/missing.asm (__gmpn_lzcnt): New function.
+
+ * mpn/sparc32/sparc-defs.m4: Put FAKE_T3 stuff here...
+ * mpn/sparc64/ultrasparct3/aormul_2.asm: ...moved from here.
+
+ * mpn/sparc64/ultrasparc1234/lshift.asm: Remove.
+ * mpn/sparc64/ultrasparc1234/rshift.asm: Remove.
+
+2013-04-01 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/sparc64/ultrasparct3/missing.m4 (umulxhi): Don't clobber retaddr,
+ allowing use in functions that does not do save/restore.
+
+ * mpn/sparc64/gcd_1.asm: Tweak for tighter loop.
+
+2013-03-31 David S. Miller <davem@davemloft.net>
+
+ * mpn/sparc64/lshift.asm: New file.
+ * mpn/sparc64/rshift.asm: New file.
+ * mpn/sparc64/lshiftc.asm: New file.
+
+2013-03-31 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/sparc64/ultrasparct1/lshift.asm: Remove.
+ * mpn/sparc64/ultrasparct1/rshift.asm: Remove.
+ * mpn/sparc64/ultrasparct1/lshiftc.asm: Remove.
+
+2013-03-29 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/sparc64/ultrasparct3/aormul_2.asm: Always do mulx before umulxhi.
+
+2013-03-28 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/sparc64/mod_1_4.c (mpn_mod_1s_4p): Make precomputed arg 'const'.
+ (mpn_mod_1s_4p_cps): Update from generic code.
+
+2013-03-27 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/generic/trialdiv.c: Make variables 'const' to match tables.
+
+ * mpn/generic/mod_1_1.c (mpn_mod_1_1p): Make precomputed arg 'const'.
+ * mpn/generic/mod_1_2.c (mpn_mod_1s_2p): Likewise.
+ * mpn/generic/mod_1_3.c (mpn_mod_1s_3p): Likewise.
+ * mpn/generic/mod_1_4.c (mpn_mod_1s_4p): Likewise.
+ * gmp-impl.h: Update prototypes.
+
+ * mpn/x86_64/mulx/aorsmul_1.asm: New file.
+ * mpn/x86_64/mulx/addmul_1.asm: Remove.
+
+2013-03-26 Niels Möller <nisse@lysator.liu.se>
+
+ Make mpn_cnd_add_n and mpn_cnd_sub_n public.
+ * doc/gmp.texi (Low-level Functions): Document mpn_cnd_add_n and
+ mpn_cnd_sub_n.
+ * gmp-h.in (mpn_cnd_add_n, mpn_cnd_sub_n): Moved prototypes
+ here...
+ * gmp-impl.h: ... from here.
+
+2013-03-26 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/x86/pentium4/sse2/cnd_add_n.asm: New file.
+ * mpn/x86/pentium4/sse2/cnd_sub_n.asm: New file.
+ * mpn/x86/cnd_aors_n.asm: New file.
+
+2013-03-25 David S. Miller <davem@davemloft.net>
+
+ * mpn/sparc64/ultrasparct3/hamdist.asm: New file.
+ * mpn/sparc64/ultrasparct3/popcount.asm: New file.
+
+2013-03-25 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/ia64/aorsorrlshC_n.asm: Generalised from aorslshC_n.asm.
+ * mpn/ia64/aorsorrlsh1_n.asm: Generalised from aorslsh1_n.asm.
+ * mpn/ia64/aorsorrlsh2_n.asm: Generalised from aorslsh2_n.asm.
+
+2013-03-24 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/arm/v7a/cora15/neon/aorsorrlshC_n.asm: New file.
+ * mpn/arm/v7a/cora15/neon/aorsorrlsh2_n.asm: New file.
+ * mpn/arm/v7a/cora15/neon/aorsorrlsh1_n.asm: New file.
+ * mpn/arm/v7a/cora15/neon/rsh1aors_n.asm: New file.
+
+ * configure.ac (GMP_MULFUNC_CHOICES): Support add+sub+rsb lsh files.
+
+ * tests/refmpn.c (refmpn_addlsh_nc, refmpn_sublsh_nc): Remove silly
+ assert of mp_limb being non-negative.
+
+2013-03-21 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/arm/neon/lshiftc.asm: New file.
+
+ * mpn/arm/v6/sqr_basecase.asm: Trim 'sqr_diag_addlsh1' loop.
+
+ * gen-trialdivtab.c: Output just raw data, remove actual variables.
+ * mpn/generic/trialdiv.c: Put variables from gen-trialdivtab.c here,
+ and make them 'const'.
+
+2013-03-20 Torbjorn Granlund <tege@gmplib.org>
+
+ * config.guess: Rework arm CPU recognition.
+ * config.sub: Corresponding updates.
+ * configure.ac: Likewise.
+
+ * mpn/x86_64/mulx/adx/addmul_1.asm: Let FAKE_MULXADX be off by default.
+
+ * mpn/arm/v7a/cora15/neon/copyi.asm: Move from "..".
+ * mpn/arm/v7a/cora15/neon/copyd.asm: Likewise.
+
+ * config.guess: Tack on "neon" for appropriate arm CPUs.
+ * configure.ac (arm*-*-*): Recognise neon suffix for a8, a9, and a15.
+
+2013-03-19 Marco Bodrato <bodrato@mail.dm.unipi.it>
+
+ * mpf/fits_u.h: Accept numbers truncating to zero before checking the
+ sign.
+ * tests/mpf/t-fits.c: Check new edges.
+
+2013-03-19 Torbjorn Granlund <tege@gmplib.org>
+
+ * tests/arm32check.c: Get printing of clobbered register right.
+
+ * mpn/arm/neon/popcount.asm: New file.
+ * mpn/arm/neon/hamdist.asm: New file.
+
+ * tests/Makefile.am (EXTRA_libtests_la_SOURCES): Add arm32call.asm and
+ arm32check.c.
+
+2013-03-18 Torbjorn Granlund <tege@gmplib.org>
+
+ * configure.ac (arm*-*-*): Define CALLING_CONVENTIONS_OBJS.
+
+ * tests/arm32call.asm: New file.
+ * tests/arm32check.c: New file.
+
+ * mpn/arm/arm-defs.m4 (LEA): Rewrite to properly handle repeated use.
+ (EPILOGUE_cpu): Define.
+
+ * mpn/arm/v6/addmul_3.asm: Make code work for PIC.
+
+ * tests/x86call.asm: Modernise asm syntax.
+ * tests/amd64call.asm: Likewise.
+
+ * mpn/x86/darwin.m4 (m4append): Move definition from here...
+ * mpn/asm-defs.m4: ...to here.
+
+2013-03-18 Marco Bodrato <bodrato@mail.dm.unipi.it>
+
+ * doc/gmp.texi (--enable-fat): No quote in concept index.
+
+ * mpf/swap.c: Reduce the number of variables.
+
+2012-03-17 Marc Glisse <marc.glisse@inria.fr>
+
+ * tests/cxx/t-do-exceptions-work-at-all-with-this-compiler.cc: New file.
+ * tests/cxx/Makefile.am: Add new file. Reorder the tests.
+
+2013-03-17 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/generic/mul_fft.c: Use TMP_BALLOC*, but combine several areas.
+
+ * mpz/powm_ui.c (mod): Use TMP_BALLOC in mu code.
+
+ * mpn/arm/v6/addmul_3.asm: New file.
+
+ * mpn/arm/v7a/cora15/copyd.asm: Tweak.
+
+ * mpn/arm64/copyi.asm: New file.
+ * mpn/arm64/copyd.asm: New file.
+
+2013-03-16 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/arm/v6/addmul_2.asm: Tweak for better A9 performance.
+
+2013-03-14 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/ia64/cnd_aors_n.asm: New file.
+
+ * mpn/arm64/cnd_aors_n.asm: New file.
+
+ * mpn/arm64/aors_n.asm (ADDSUB): Remove unused definition.
+
+ * mpn/ia64/aors_n.asm: Remove a redundant ASM_START.
+
+ * mpn/arm/cnd_aors_n.asm: Avoid ARM conditional insn execution.
+
+ * mpn/x86_64/missing.asm: Move from mulx/adx since we cannot currently
+ prune missing.asm from path.
+ * mpn/x86_64/mulx/adx/missing-call.m4: Likewise.
+ * mpn/x86_64/mulx/adx/missing-inline.m4: Likewise.
+ * mpn/x86_64/mulx/adx/addmul_1.asm: Update hardwired path.
+
+2013-03-13 Marco Bodrato <bodrato@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@lysator.liu.se>
+
+ New names mpn_cnd_add_n and mpn_cnd_sub_n.
+ * mpn/generic/cnd_add_n.c (mpn_cnd_add_n): Renamed file and
+ function, from addcnd.c:mpn_addcnd_n.
+ * mpn/generic/cnd_sub_n.c (mpn_cnd_sub_n): Renamed, from
+ subcnd.c:mpn_subcnd_n.
+ * mpn/arm/cnd_aors_n.asm: Renamed file, from aorscnd.asm, and
+ renamed functions.
+ * mpn/x86_64/cnd_aors_n.asm: Analogous renaming.
+ * mpn/powerpc64/mode64/cnd_aors_n.asm: Analogous renaming.
+ * gmp-impl.h (mpn_cnd_add_n, mpn_cnd_add_n): Updated prototypes
+ with new names.
+ * configure.ac: Updated for new names.
+ * tests/refmpn.c (refmpn_cnd_add_n): Renamed, from refmpn_addcnd_n.
+ (refmpn_cnd_sub_n): Renamed, from refmpn_subcnd_n.
+ * tests/tests.h (refmpn_cnd_add_n, refmpn_cnd_sub_n): Updated
+ prototypes with new names.
+ * tune/common.c (speed_mpn_cnd_add_n): Renamed, from
+ speed_mpn_addcnd_n, call mpn_cnd_add_n.
+ (speed_mpn_cnd_sub_n): Renamed, from speed_mpn_subcnd_n, call
+ mpn_cnd_sub_n.
+ * tune/speed.h (speed_mpn_cnd_add_n, speed_mpn_cnd_sub_n): Updated
+ prototypes with new names.
+ * tune/speed.c (routine): Updated list with new names.
+ * tests/devel/try.c: Updated for new mpn_cnd_* names.
+ * mpn/generic/sbpi1_div_sec.c: Likewise.
+ * mpn/generic/powm_sec.c: Likewise.
+
+2013-03-12 Torbjorn Granlund <tege@gmplib.org>
+
+ * configure.ac: Add "missing" to extra_functions_64 for coreibwl.
+
+ * mpn/x86_64/mulx/adx/addmul_1.asm: Simplify. Make FAKE_MULXADX the
+ default awaiting proper qemu behaviour.
+
+2013-03-11 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/x86_64/aorscnd_n.asm: Read 32 bits for 'n' arguments on DOS64.
+
+ * tests/mpz/t-powm_ui.c: Test larger arguments. General cleanup.
+
+ * mpz/powm_ui.c (mod): Adhere to mpn_mu_div_qr's overlap requirements.
+
+2013-03-10 Niels Möller <nisse@lysator.liu.se>
+
+ * mpn/generic/sbpi1_div_sec.c: Update calls of mpn_addcnd_n and
+ mpn_subcnd_n.
+ * mpn/generic/powm_sec.c (MPN_REDC_1_SEC, MPN_REDC_2_SEC)
+ (mpn_powm_sec): Update calls of mpn_subcnd_n.
+
+ * tests/tests.h (refmpn_addcnd_n, refmpn_subcnd_n): Update
+ declarations.
+ * tests/refmpn.c (refmpn_addcnd_n, refmpn_subcnd_n): Similar
+ reorder of arguments.
+ * tests/devel/try.c (call): Pass condition first, for
+ TYPE_ADDCND_N and TYPE_SUBCND_N.
+
+ * tune/common.c (speed_mpn_addcnd_n, speed_mpn_subcnd_n): Update
+ to pass condition as first argument.
+
+ * gmp-impl.h (mpn_addcnd_n, mpn_subcnd_n): Updated declarations.
+
+ * mpn/generic/addcnd_n.c (mpn_addcnd_n): Reordered arguments, make
+ condition the first argument.
+ * mpn/generic/subcnd_n.c (mpn_subcnd_n): Likewise.
+ * mpn/arm/aorscnd_n.asm: Likewise.
+ * mpn/x86_64/aorscnd_n.asm: Likewise.
+ * mpn/powerpc64/mode64/aorscnd_n.asm: Likewise.
+
+2013-03-10 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/x86_64/mulx/adx/missing.asm: Simulate some mulx/adx insns.
+ * mpn/x86_64/mulx/adx/missing-call.m4: Call variant.
+ * mpn/x86_64/mulx/adx/missing-inline.m4: Inline variant.
+
+ * mpn/sparc64/ultrasparct3/missing.asm: Simulate some v9-2011 insns.
+ * mpn/sparc64/ultrasparct3/missing.m4: Inline or invoke missing.asm for
+ v9-2011 insn.
+
+ * configure.ac: Strip `haswell' from paths for now.
+
+ * mpn/x86_64/mulx/addmul_1.asm: New.
+ * mpn/x86_64/mulx/mul_1.asm: Rewrite file from `haswell' subdir.
+ * mpn/x86_64/mulx/adx/addmul_1.asm: Likewise.
+ * mpn/x86_64/haswell: Remove.
+
+ * mpn/arm/v7a/cora15/mul_1.asm: New file.
+ * mpn/arm/v7a/cora15/addmul_1.asm: New file.
+
+2013-03-09 Marco Bodrato <bodrato@mail.dm.unipi.it>
+
+ * tests/mpz/t-cong_2exp.c: Improve coverage.
+
+2013-03-09 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/sparc64/ultrasparc1234/add_n.asm: Use g5 instead of g4.
+ * mpn/sparc64/ultrasparc1234/sub_n.asm: Likewise.
+
+ * mpn/sparc64/ultrasparct3/aormul_2.asm: Fix a typo.
+
+2013-03-07 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/arm/v7a/cora9/gmp-mparam.h: New file.
+
+ * configure.ac (GMP_MULFUNC_CHOICES): Support mul_2 + addmul_2.
+
+ * mpn/sparc64/ultrasparct3/aormul_2.asm: New file.
+
+ * mpn/sparc64/ultrasparct3/submul_1.asm: Optimise out two carry
+ propagating adds.
+
+2013-03-06 David Miller <davem@davemloft.net>
+
+ * config.guess: Recognize UltraSparc T4 under Linux.
+ * configure.ac: Add sparc64/ultrasparct3 to path_64 when T3 or T4.
+ Append -xarch=v8plusd or -xarch=v9d to command line, as needed.
+ * mpn/sparc64/ultrasparct3/mul_1.asm: New file.
+ * mpn/sparc64/ultrasparct3/addmul_1.asm: New file.
+ * mpn/sparc64/ultrasparct3/submul_1.asm: New file.
+ * mpn/sparc64/ultrasparct3/add_n.asm: New file.
+ * mpn/sparc64/ultrasparct3/sub_n.asm: New file.
+
+ * mpn/sparc32/ultrasparct1/mul_1.asm: Unroll main loop one time, add
+ T2/T3/T4 timings.
+ * mpn/sparc32/ultrasparct1/addmul_1.asm: Likewise.
+ * mpn/sparc32/ultrasparct1/submul_1.asm: Likewise.
+
+2013-03-04 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/arm/neon/lorrshift.asm: New file.
+
+2013-03-03 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/arm/v7a/cora15/copyd.asm: New file.
+ * mpn/arm/v7a/cora15/copyi.asm: New file.
+
+ * mpn/arm64/logops_n.asm: New file.
+ * mpn/arm64/gcd_1.asm: New file.
+ * mpn/arm64/aorsmul_1.asm: New file.
+ * mpn/arm64/addmul_1.asm: Remove.
+ * mpn/arm64/aors_n.asm: Complete rewrite.
+
+ * mpn/arm/tabselect.asm: New file.
+ * mpn/arm/neon/tabselect.asm: New file.
+
+ * mpn/arm/copyi.asm: Software pipeline.
+ * mpn/arm/copyd.asm: Likewise.
+
+ * config.guess: Rework tmp file handling to resemble configfsf.guess's.
+
+2013-03-03 Niels Möller <nisse@lysator.liu.se>
+
+ * doc/gmp.texi (Integer Special Functions): Document
+ mpz_limbs_read, mpz_limbs_write, mpz_limbs_modify,
+ mpz_limbs_finish, mpz_roinit_n and MPZ_ROINIT_N.
+
+ * mpz/roinit_n.c (mpz_roinit_n): Normalize the input.
+
+2013-02-27 Niels Möller <nisse@lysator.liu.se>
+
+ * tune/common.c (speed_measure): Increase repetition count if we
+ get a zero measurement.
+
+2013-02-27 Marco Bodrato <bodrato@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@lysator.liu.se>
+
+ * tests/mpz/t-limbs.c (check_roinit): Test MPZ_ROINIT_N only if
+ compiler supports c99.
+
+2013-02-25 Niels Möller <nisse@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.
+ * mpz/limbs_write.c (mpz_limbs_write): New file and function.
+ * mpz/roinit_n.c (mpz_roinit_n): New file and function.
+ * gmp-h.in: Declare new functions.
+ (MPZ_ROINIT_N): New macro.
+ * mpz/Makefile.am (libmpz_la_SOURCES): Added new files.
+ * Makefile.am (MPZ_OBJECTS): Added new object files.
+
+ * tests/mpz/t-limbs.c: New testcase.
+ * tests/mpz/Makefile.am (check_PROGRAMS): Added t-limbs.
+
+2013-02-22 Torbjorn Granlund <tege@gmplib.org>
+
+ * configure.ac: Fix typo in adx/mulx path stripping code.
+ * config.sub: Match coreibwl.
+
+2013-02-20 Niels Möller <nisse@lysator.liu.se>
+
+ * tests/mpq/t-get_d.c (check_random): Rewrote to make test less
+ dependent on float operations. Fixes problem with m68k-linux and
+ extended float precision.
+
+2013-02-20 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/x86_64/haswell/mulx/adx/addmul_1.asm: New file.
+
+ * configure.ac: Support coreibwl. Use proper name for ADX extension.
+ * acinclude.m4 (GMP_ASM_X86_ADX): Rename from GMP_ASM_X86_ADOX.
+
+ * tests/tests.h (TESTS_REPS): Keep count >= 1.
+
+2013-02-19 Marco Bodrato <bodrato@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@mail.dm.unipi.it>
+
+ * gmpxx.h (mpq_class, mpf_class) [init_ui, init_si, assign_si]:
+ 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.
+
+2013-02-17 Marc Glisse <marc.glisse@inria.fr>
+
+ * cxx/osdoprnti.cc: Use <stdarg.h> and <string.h> rather than <cstdarg>
+ and <cstring> (revert 2002-12-21).
+
+ * tests/cxx/Makefile.am: Link with libm.
+ * tests/cxx/t-ops2.cc: Comment about more tests. Use <math.h> rather
+ than <cmath> and using namespace. Don't include <iostream>.
+
+ * gmpxx.h (__GMPXX_BITS_TO_LIMBS, __GMPQ_NUM_DBL_LIMBS,
+ __GMPQ_DEN_DBL_LIMBS, __GMPXX_TMPQ_D): New macros.
+ (__gmp_binary_plus, __gmp_binary_minus, __gmp_binary_multiplies,
+ __gmp_binary_divides, __gmp_binary_equal, __gmp_binary_less,
+ __gmp_cmp_function): Use __GMPXX_TMPQ_D.
+ * tests/cxx/t-ops2.cc: Test __GMPXX_TMPQ_D on DBL_MIN, DBL_MAX.
+
+ * gmpxx.h (__gmp_binary_multiplies, __gmp_binary_divides): Use
+ __GMPXX_CONSTANT_TRUE.
+
+2013-02-16 Marc Glisse <marc.glisse@inria.fr>
+
+ * gmpxx.h: Include <algorithm>.
+
+2013-02-16 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/Makefile.am (TARG_DIST): Add arm64.
+
+ * mpn/x86_64/x86_64-defs.m4 (PROTECT): Emit '.hidden' instead of
+ '.protected" to please Sun's assembler, but also for semantic reasons.
+
+2013-02-15 Torbjorn Granlund <tege@gmplib.org>
+
+ * configure.ac (arm64*-*-*): Match this.
+
+ * mpn/arm64/aors_n.asm: New file.
+ * mpn/arm64/addmul_1.asm: New file.
+ * mpn/arm64/mul_1.asm: New file.
+
+2013-02-15 Marc Glisse <marc.glisse@inria.fr>
+
+ * gmpxx.h (__GMPXX_DEFINE_ARITHMETIC_CONSTRUCTORS,
+ __GMPXX_DEFINE_ARITHMETIC_ASSIGNMENTS): New macros.
+ (mpz_class, mpq_class, mpf_class) [init_ui, init_si, init_d,
+ assign_ui, assign_si, assign_d]: New functions.
+ (__gmp_expr::__gmp_expr, __gmp_expr::operator=): Replace with macros.
+ (__GMPXX_CONSTANT_TRUE): New macro.
+
+2013-02-15 Marco Bodrato <bodrato@mail.dm.unipi.it>
+
+ * gmp-impl.h (NEG_CAST, ABS_CAST): Use __GMP_CAST.
+ * mpz/fits_s.h: Use NEG_CAST.
+
+2013-02-14 Marc Glisse <marc.glisse@inria.fr>
+
+ * gmpxx.h (__gmp_binary_greater): Forward to __gmp_binary_less.
+ (__gmp_binary_equal): Forward to itself after swapping operands.
+
+2013-02-14 Marco Bodrato <bodrato@mail.dm.unipi.it>
+
+ * mp_dv_tab.c (__gmp_digit_value_tab): Remove a line of unused values.
+ * mpf/set_str.c: Update offset accordingly.
+ * mpz/inp_str.c: Likewise.
+ * mpz/set_str.c: Likewise.
+
+ * gmp-h.in (mpq_cmp_ui): Optimise comparison with 1/1.
+ * tests/mpq/t-cmp_ui.c: Test special comparisons: 0/1, 1/1.
+
+ * mpz/clrbit.c: Reorganise branches.
+ * mpz/setbit.c: Likewise.
+ * mpz/combit.c: Same micro-optimisations as in set/clr.
+
+ * mpz/aors_ui.h: No realloc if size was zero.
+ * mpz/ior.c: Use macros: MPZ_REALLOC and MPN_INCR_U.
+
+ * gmp-impl.h (NEG_CAST): New macro, used by ABS_CAST.
+ * mpq/cmp_si.c: Use NEG_CAST.
+ * mpz/cmp_si.c: Reorganise branches.
+
+2013-02-13 Torbjorn Granlund <tege@gmplib.org>
+
+ * acinclude.m4 (GMP_ASM_X86_MULX, GMP_ASM_X86_ADOX): New feature tests.
+ * configure.ac: Use new feature tests.
+
+ * mpn/x86_64/haswell/mulx/mul_1.asm: File moved to cope with older
+ assemblers.
+ * configure.ac: Update haswell path to include "mulx".
+
+2013-02-12 Torbjorn Granlund <tege@gmplib.org>
+
+ * configure.ac: Recognise haswell.
+ * config.guess: Recognise haswell.
+ * config.sub: Match haswell.
+
+ * mpn/x86_64/haswell/mul_1.asm: New file, mainly for testing HNI.
+
+2013-02-12 Marco Bodrato <bodrato@mail.dm.unipi.it>
+
+ * 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.
+ * mpz/primorial_ui.c: Use MPZ_NEWALLOC.
+
+ * mpz/import.c: Use BITS_TO_LIMBS and MPZ_NEWALLOC.
+ * mpz/inp_raw.c: Likewise.
+ * mpz/rrandomb.c: Likewise.
+ * mpz/urandomb.c: Likewise.
+ * mpn/generic/random2.c: Likewise.
+
+ * mpn/generic/brootinv.c: Micro-optimisation.
+
+ * mpf/set_str.c: Don't chech base==0 when base is strictly positive.
+
+2013-02-10 Torbjorn Granlund <tege@gmplib.org>
+
+ * Version 5.1.1 released.
+
+2013-02-07 Marco Bodrato <bodrato@mail.dm.unipi.it>
+
+ * tune/speed.h (SPEED_ROUTINE_MPN_MUL): Use operands from struct s.
+ * tune/README: Document new parameter syntax mpn_mul.<#> .
+
+2013-02-06 Niels Möller <nisse@lysator.liu.se>
+
+ * tests/mpz/t-jac.c (check_large_quotients): Rewrote. Now uses a
+ more efficient method for generating the test inputs.
+
+2013-02-05 Torbjorn Granlund <tege@gmplib.org>
+
+ * tests/mpn/t-div.c: Limit random dbits to avoid an infinite loop.
+
+2013-02-03 Torbjorn Granlund <tege@gmplib.org>
+
+ * tests/mpz/reuse.c: Fix typo causing the same negation condition to be
+ applied to all operands. Fix condition for when to invoke mpz_remove.
+ Make different-size random operands.
+
+2013-02-02 Marco Bodrato <bodrato@mail.dm.unipi.it>
+
+ * mpz/remove.c: Correct the sign in case of reuse.
+
+2013-02-01 Torbjorn Granlund <tege@gmplib.org>
+
+ * gmp-impl.h (DIGITS_IN_BASE_PER_LIMB): Add a cast.
+ (LIMBS_PER_DIGIT_IN_BASE): Likewise.
+
+ * tests/refmpn.c (refmpn_mul): Use toom6h instead of toom44 for the
+ largest operands.
+
+2013-01-31 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/generic/toom44_mul.c: Revert last change in favour of a simple
+ change (thanks Marco!).
+ * mpn/generic/toom4_sqr.c: Likewise.
+
+2013-01-30 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/generic/toom44_mul.c (MAYBE_mul_toom44): Take toom6h and toom8h
+ into account, using new macro MUL_NEXTALG_THRESHOLD.
+ * mpn/generic/toom4_sqr.c (MAYBE_sqr_toom4): Likewise.
+
+2013-01-26 Marco Bodrato <bodrato@mail.dm.unipi.it>
+
+ * mpz/remove.c: init+set=init_set, cast before shifting.
+
+ * mpz/cmp_si.c: Use ABS_CAST.
+
+2013-01-26 Torbjorn Granlund <tege@gmplib.org>
+
+ * tests/mpn/logic.c: Set things up to always test library logops, not
+ gmp-impl.h's inlined variants. Test also mpn_com.
+
+ * tests/mpn/t-mod_1.c: Test also mpn_mod_1s_3p.
+
+ * mpn/generic/mod_1_3.c: Swap some lines to make it similar to mod_4.c.
+
+ * tests/mpz/reuse.c: Fix typo in last change.
+
+2013-01-23 Marco Bodrato <bodrato@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@gmplib.org>
+
+ * Makefile.am (LIBGMP_LT_*, LIBGMPXX_LT_*): Bump version info.
+ * gmp-h.in: Bump version.
+
+ * tests/mpz/reuse.c: Delete always zero 'failures' and code depending
+ on it. Replace rotating progress with real measure.
+
+ * Makefile.am (check-mini-gmp): Fix typo in last change.
+
+2013-01-22 Niels Möller <nisse@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@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@gmplib.org>
+
+ * Makefile.am (check-mini-gmp): Set also DYLD_LIBRARY_PATH for the
+ benefit of Darwin.
+
+ * tests/mpn/t-div.c: Test mpn_sb_div_qr_sec and mpn_sb_div_r_sec.
+ (main): Separate divisor into normalised (dnp) and unnormalised (dup),
+ pass appropriate variant to each function.
+ (main): Make negative `test' index value mean divisor bits, for better
+ small operands coverage.
+ (main): Put random junk at qp[] instead of zeroing.
+
+ * 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@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@gmplib.org>
+
+ * tests/memory.c (PTRLIMB): New macro, used for conformant casting.
+
+2013-01-19 Marco Bodrato <bodrato@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@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@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@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@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@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@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@gmplib.org>
+
+ From Mike Frysinger:
+ * configure.ac: Add x32 ABI for x86_64.
+
+2013-01-14 Niels Möller <nisse@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@mail.dm.unipi.it>
+
+ * doc/gmp.texi (gmp_version): Remove "was used" repetition.
+ (Upward compatibility): Mention mpn_bdivmod, GMP 4 -> GMP 5.
+
+2013-01-13 Marc Glisse <marc.glisse@inria.fr>
+
+ * doc/gmp.texi: Let mpn_sqrtrem reference mpn_perfect_square_p instead
+ of mpz_perfect_square_p.
+
+2013-01-11 Marco Bodrato <bodrato@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@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@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@mail.dm.unipi.it>
+
+ * mini-gmp/mini-gmp.c (mpz_export): Support op=0 countp=NULL.
+
+2013-01-08 Niels Möller <nisse@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@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@gmplib.org>
+
+ * longlong.h (aarch64): Make add_ssaaaa and sub_ddmmss actually work.
+
+2013-01-04 Marco Bodrato <bodrato@mail.dm.unipi.it>
+
+ From shuax:
+ * mini-gmp/mini-gmp.c (mpz_import): Reset limb after storing it.
+
+2013-01-04 Torbjorn Granlund <tege@gmplib.org>
+
+ From Marko Lindqvist:
+ * configure.ac: Use AC_CONFIG_HEADERS instead of the obsolete
+ AM_CONFIG_HEADER.
+
+2013-01-02 Marco Bodrato <bodrato@mail.dm.unipi.it>
+
+ * tests/mpz/bit.c: Wider testing for mpz_combit.
+ * tests/mpz/logic.c: Check the -2^n case.
+
+ * mpz/ior.c: Fixed an allocation bug in the -2^n case.
+
+2012-12-31 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/generic/get_d.c: Minor reorg, add vax D code.
+
+ * gmp-impl.h (double_extract): New union type for vax D floats.
+
+ * tests/mpq/t-get_d.c (check_random): Limit exponents on vax.
+
+2012-12-30 Marco Bodrato <bodrato@mail.dm.unipi.it>
+
+ * tests/mpz/bit.c (check_clr_extend): Check _set shrink.
+
+2012-12-29 Torbjorn Granlund <tege@gmplib.org>
+
+ * demos/calc/calc.c: Remove generated file from repo.
+ * demos/calc/calc.h: Likewise.
+ * demos/calc/calclex.c: Likewise.
+
+2012-12-27 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/generic/get_d.c: Complete rewrite of non-IEEE code.
+
+ * tests/mpq/t-get_d.c (main): Suppress check_random for vax.
+
+2012-12-25 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/x86_64/bdiv_q_1.asm: Use LEA for binvert_limb_table.
+
+2012-12-23 Torbjorn Granlund <tege@gmplib.org>
+
+ * tests/mpz/t-get_d.c (check_onebit): Decrease vax limit to avoid
+ overflow in last, unused 'want' value.
+
+ * config.guess: Recognise AMD family 22 as a future bobcat.
+
+2012-12-21 Torbjorn Granlund <tege@gmplib.org>
+
+ * configure.ac: Rename configure.in.
+
+2012-12-17 Torbjorn Granlund <tege@gmplib.org>
+
+ * Version 5.1.0 released.
+
+ * configure.in (none-*-*): Allow this again, but print a warning.
+
+2012-12-17 Marco Bodrato <bodrato@mail.dm.unipi.it>
+
+ * mpz/n_pow_ui.c: Fix typos in an ASSERT.
+
+2012-12-16 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/generic/mu_div_qr.c (mpn_preinv_mu_div_qr): Explicitly use
+ MPN_COPY_INCR for slightly overlapping copy.
+
+2012-12-15 Marco Bodrato <bodrato@mail.dm.unipi.it>
+
+ * tests/mpn/toom-sqr-shared.h: Skip ALLOCs if the test is skipped.
+
+2012-12-13 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/x86_64/dos64.m4 (PIC): Move definition early.
+ (JMPENT): Remove PIC variant.
+
+ * mpn/x86_64/darwin.m4 (JUMPTABSECT): Define to .text, instead of
+ something sensible.
+
+2012-12-12 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/x86_64/x86_64-defs.m4 (JMPENT): New macro.
+ * mpn/x86_64/dos64.m4: Likewise.
+ * mpn/x86_64/darwin.m4: Likewise.
+ * mpn/x86_64/mod_34lsub1.asm: Use JMPENT to properly support PIC.
+ * mpn/x86_64/mullo_basecase.asm: Likewise.
+ * mpn/x86_64/sqr_basecase.asm: Likewise.
+
+2012-12-11 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/x86_64/mod_34lsub1.asm: Try different jump table for the benefit
+ of broken Apple linkers.
+
+2012-12-09 Torbjorn Granlund <tege@gmplib.org>
+
+ * configure.in: Make GMP_NONSTD_ABI ABI specific.
+
+2012-12-08 Torbjorn Granlund <tege@gmplib.org>
+
+ * Makefile.am (LIBGMP_LT_*, LIBGMPXX_LT_*): Bump version info.
+ * gmp-h.in: Bump version.
+
+2012-12-06 Marco Bodrato <bodrato@mail.dm.unipi.it>
+
+ * tests/mpq/reuse.c: New test (adapted from mpf/reuse.c).
+ * tests/mpq/Makefile.am (check_PROGRAMS): Add reuse.
+
+ * mpz/abs.c: Use NEWALLOC.
+ * mpz/neg.c: Likewise.
+ * mpz/com.c: Reduce branches.
+
+2012-12-05 Niels Möller <nisse@lysator.liu.se>
+
+ * mpn/generic/brootinv.c (mpn_brootinv): Make valgrind happier, at
+ the cost of a redundant MPN_ZERO.
+
+ * mpz/jacobi.c (mpz_jacobi): Check for asize == 0 or bsize == 0
+ before using the low limbs.
+
+2012-12-05 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/generic/set_str.c (mpn_dc_set_str): Work around a valgrind issue.
+
+ * mpz/powm_ui.c: Don't assume >= 2 limbs in mod argument.
+
+ * tests/tests.h (TESTS_REPS): Handle float GMP_CHECK_REPFACTOR.
+
+ * longlong.h: Refine cpp test for vax.
+ * tests/mpn/t-get_d.c: Likewise.
+ * tests/mpz/t-get_d.c: Likewise.
+ * tests/mpz/t-cmp_d.c: Likewise.
+ * tests/mpz/t-get_d.c: Likewise.
+ * tests/mpq/t-get_d.c: Likewise.
+ * tests/mpf/t-get_d.c: Likewise.
+
+2012-11-30 Torbjorn Granlund <tege@gmplib.org>
+
+ * gen-fac.c (gen_consts): Correct printf types.
+
+ * mpn/arm/v7a/cora15/gmp-mparam.h: New file.
+
+ * configure.in (arm*-*-*): New compiler optional "tune". Pass value for
+ selected processors. Add more specific path components.
+
+2012-11-29 Torbjorn Granlund <tege@gmplib.org>
+
+ From Andoni Morales Alastruey:
+ * longlong.h: Conditionalise ARM asm on !__thumb__.
+
+2012-11-28 Torbjorn Granlund <tege@gmplib.org>
+
+ * config.guess (arm*-*-*): Support specific ARM processors.
+ * config.sub: Match arm CPUs.
+ * configure.in (arm*-*-*): Likewise.
+
+ * mpz/powm.c: Move new_b out since it lives on through b.
+
+ * configure.in (arm*-*-*): Pass -marm to deal with compilers defaulting
+ to thumb code.
+
+2012-11-26 Torbjorn Granlund <tege@gmplib.org>
+
+ * tests/cxx/t-ops2.cc (checkz): Reduce huge numbers to avoid vax
+ overflow.
+
+2012-11-25 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/generic/get_d.c: Reinsert non-IEEE code.
+
+ * mpn/vax/add_n.asm: New file.
+ * mpn/vax/add_n.s: Remove.
+ * mpn/vax/addmul_1.asm: New file.
+ * mpn/vax/addmul_1.s: Remove.
+ * mpn/vax/lshift.asm: New file.
+ * mpn/vax/lshift.s: Remove.
+ * mpn/vax/mul_1.asm: New file.
+ * mpn/vax/mul_1.s: Remove.
+ * mpn/vax/rshift.asm: New file.
+ * mpn/vax/rshift.s: Remove.
+ * mpn/vax/sub_n.asm: New file.
+ * mpn/vax/sub_n.s: Remove.
+ * mpn/vax/submul_1.asm: New file.
+ * mpn/vax/submul_1.s: Remove.
+
+ * mpn/vax/elf.m4: New file.
+ * configure.in (vax*-*-*elf*): New case, grabbing vax/elf.m4.
+
+ * 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@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@gmplib.org>
+
+ * mpn/generic/powm_sec.c (redcify): Use mpn_sb_div_r_sec.
+
+ * mpn/generic/sb_div_sec.c: New file.
+ * mpn/generic/sbpi1_div_sec.c: New file.
+ * configure.in (gmp_mpn_functions): Add new files.
+ * gmp-impl.h: Declare new functions.
+
+2012-11-12 Torbjorn Granlund <tege@gmplib.org>
+
+ * longlong.h: Add ARM64 support.
+ * longlong.h: Add AVR support.
+
+ * mpn/powerpc64/mode64/divrem_1.asm: Tune, simplify.
+
+ * mpq/md_2exp.c: Use MPN_COPY_INCR, not MPN_COPY_DECR.
+ * tests/mpq/t-md_2exp.c (check_random): New function.
+
+2012-11-10 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/generic/remove.c (mpn_bdiv_qr_wrap): Make static.
+
+2012-11-04 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpz/powm_ui.c: Rewrite.
+
+2012-11-01 Niels Möller <nisse@lysator.liu.se>
+
+ * mpn/generic/brootinv.c (mpn_brootinv): Input size in limbs
+ rather than bits. Use single-precision iterations for the first
+ limb.
+ * mpn/generic/perfpow.c (is_kth_power): Update mpn_brootinv call.
+ * tests/mpn/t-brootinv.c (main): Likewise.
+ * tune/speed.h (SPEED_ROUTINE_MPN_BROOTINV): Likewise.
+ * gmp-impl.h (mpn_brootinv): Updated prototype.
+
+ * mpn/generic/hgcd2.c (mpn_hgcd2): Removed redundant loop exit
+ tests in the single-precision loop.
+
+ * mpz/combit.c (mpz_combit): Rewrite, optimizing for the common
+ case.
+
+2012-10-31 Niels Möller <nisse@lysator.liu.se>
+
+ * tests/mpn/Makefile.am (check_PROGRAMS): Added t-brootinv.
+ * tests/mpn/t-brootinv.c: New file
+
+ * mpn/generic/broot.c (mpn_broot_invm1): Avoid a mullo_n in the
+ loop, and do powering as a plain mpn_sqr followed by mpn_powlo.
+
+ * tune/speed.c (routine): Added mpn_broot, mpn_broot_invm1,
+ mpn_brootinv.
+
+ * tune/common.c (speed_mpn_broot, speed_mpn_broot_invm1)
+ (speed_mpn_brootinv): New functions.
+ * tune/speed.h (SPEED_ROUTINE_MPN_BROOT)
+ (SPEED_ROUTINE_MPN_BROOTINV): New macros.
+
+ * mpn/generic/broot.c (mpn_broot_invm1): Made non-static (mainly
+ for benchmarking).
+ * gmp-impl.h (mpn_broot_invm1): Declare it.
+
+2012-10-28 Torbjorn Granlund <tege@gmplib.org>
+
+ * configure.in (gmp_mpn_functions): Add new files.
+ * gmp-impl.h: Declare new functions.
+ * mpn/generic/perfpow.c: Overhaul.
+ (binv_root, binv_sqroot): Remove.
+ * mpn/generic/brootinv.c: New file, code from overhauled binv_root.
+ * mpn/generic/bsqrtinv.c: New file, code from overhauled binv_sqroot.
+ * mpn/generic/bsqrt.c: New file.
+
+ * tests/mpn/t-broot.c: Add a forgotten TMP_MARK.
+
+2012-10-28 Niels Möller <nisse@lysator.liu.se>
+
+ * mpn/generic/broot.c (mpn_broot): New file and function.
+ * configure.in (gmp_mpn_functions): Add broot.
+ * gmp-impl.h (mpn_broot): Declare.
+ * tests/mpn/t-broot.c: New testcase.
+ * tests/mpn/Makefile.am (check_PROGRAMS): Added t-broot.
+
+2012-10-27 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/generic/remove.c: Get remainder allocation right.
+
+2012-10-25 Torbjorn Granlund <tege@gmplib.org>
+
+ * longlong.h: De-support old POWER asm syntax.
+
+ * tests/mpz/t-remove.c: Run more tests, but use a tad smaller operands.
+
+ * mpn/generic/remove.c (mpn_bdiv_qr_wrap): New function.
+ (mpn_remove): Call mpn_bdiv_qr_wrap.
+ * mpz/remove.c: Enable suppressed mpn_remove call.
+
+2012-10-17 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpz/powm_ui.c (mpz_powm_ui): Deflect to mpz_powm for large exponent.
+
+2012-09-10 Torbjorn Granlund <tege@gmplib.org>
+
+ * demos/factorize.c: Rewrite no more current form. Implement Lucas
+ prime proving, and make its use the default.
+ * demos/primes.h: New file.
+
+2012-08-24 Torbjorn Granlund <tege@gmplib.org>
+
+ * demos/factorize.c: Overhaul.
+
+2012-08-06 Marco Bodrato <bodrato@mail.dm.unipi.it>
+
+ * doc/gmp.texi (mpn_neg): Correctly document returned type.
+
+ * gmp-impl.h (_mpz_newalloc, log_n_max): mark with inline (spotted by Niels).
+
+2012-07-28 Marc Glisse <marc.glisse@inria.fr>
+
+ * gmpxx.h (std::common_type): New partial specializations with builtin
+ types.
+ * tests/cxx/t-cxx11.cc: Test it.
+
+2012-07-21 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/powerpc32/vmx/mod_34lsub1.asm: Fix r0 clobbering issue with
+ "large" code affecting elf+darwin PIC.
+
+2012-07-21 Marc Glisse <marc.glisse@inria.fr>
+
+ * gmpxx.h (__GMPXX_CONSTANT): Disable for g++-3.4.
+
+2012-06-26 Torbjorn Granlund <tege@gmplib.org>
+
+ * Makefile.am (LIBMP_LT_*): Remove these.
+
+2012-06-26 Marc Glisse <marc.glisse@inria.fr>
+
+ * Makefile.am (LIBGMP_LT_*, LIBGMPXX_LT_*): Update comment for 5.1.0.
+
+2012-06-24 Marco Bodrato <bodrato@mail.dm.unipi.it>
+
+ * configure.in (CALLING_CONVENTIONS_OBJS): Disable any use of
+ assembly code with the --disable-assembly option.
+ * mpz/oddfac_1.c: Use the ASSERT_CODE macro.
+ * gen-trialdivtab.c (mpz_log2): Use mpz_sizeinbase (., 2).
+
+ * gmp-impl.h (MPN_SIZEINBASE_16): Replace with MPN_SIZEINBASE_2EXP
+ from mpz/export.c .
+ * mpz/export.c (MPN_SIZEINBASE_2EXP): Removed.
+ * mpn/generic/sizeinbase.c: Use MPN_SIZEINBASE.
+
+ * mpz/nextprime.c: Use MPN_SIZEINBASE_2EXP to count bits.
+ * mpn/generic/perfpow.c: Likewise.
+ * mpn/generic/rootrem.c: Likewise.
+ * mpz/get_d_2exp.c: Likewise.
+ * mpn/generic/powm_sec.c: Likewise, nailify.
+ * 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@inria.fr>
+
+ * gmpxx.h (numeric_limits): Make content public.
+ * cxx/limits.cc: New file, proper declarations.
+ * Makefile.am: List new file.
+ * cxx/Makefile.am: Likewise.
+ * cxx/t-misc.cc: Add minimal test for numeric_limits.
+
+2012-06-09 Marc Glisse <marc.glisse@inria.fr>
+
+ * gmpxx.h (__gmp_resolve_expr::srcptr_type): New typedef.
+ (__gmp_temp): Wrapper for mp*_class, the constructor copies the
+ precision of its second argument for mpf_t.
+ (__gmp_expr::eval(p, prec)): Remove.
+ (__gmp_expr::eval(p)): Use __gmp_temp.
+ (__gmp_set_expr): Never pass prec to eval().
+
+2012-06-08 Marco Bodrato <bodrato@mail.dm.unipi.it>
+
+ * gmp-impl.h (__GMP_WITHIN_CONFIGURE): Use the same #if as in gmp-h.in.
+ (MPN_NORMALIZE_NOT_ZERO): Tighter ASSERT.
+ (MPZ_NEWALLOC): New macro.
+ * mpq: Use the new macro when possible.
+ * mpz/bin_uiui.c: Likewise.
+ * 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@gmplib.org>
+
+ * mpn/powerpc64/aix.m4 (ASM_START): Claim machine type "any".
+
+2012-06-03 Niels Möller <nisse@lysator.liu.se>
+
+ * mpn/generic/gcdext.c (mpn_gcdext): Deleted code for handling
+ impossible case u1 == 0, Simplified test for unlikely case u0 == 0.
+
+2012-06-02 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/arm/lshiftc.asm: New file.
+
+2012-06-01 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/arm/aorslsh1_n.asm: Use cmp/cmn instead of subs/adds in more
+ places.
+
+ * mpz/get_str.c: Don't strip leading zeros since current mpn_get_str
+ won't generate any. Misc streamlining.
+ * mpz/out_str.c: Analogous changes.
+
+ * tests/mpz/io.c: Use a wider range of bases.
+
+ * tests/mpz/t-cong.c (check_random): Rewrite random generation for
+ exponentially distributed operand sizes.
+
+2012-06-01 Marco Bodrato <bodrato@mail.dm.unipi.it>
+
+ * mpq: Use more macros and MPZ_REALLOC return value when possible.
+
+ * gmp-impl.h (LIMBS): Removed, was an alias for PTR.
+ * mpz/combit.c: Use PTR and CNST_LIMB.
+
+ * tests/mpn/t-bdiv.c: Test also mpn_bdiv_qr.
+ * mpn/generic/bdiv_qr.c: Add an ASSERT.
+
+ * mpn/generic/remove.c: Add a zero limb to use bdiv_qr...
+
+2012-05-31 Marc Glisse <marc.glisse@inria.fr>
+
+ * gmpxx.h (mpq_class::mpq_class): Handle mpq_class(0,1).
+ * tests/cxx/t-constr.cc: Test it.
+
+2012-05-30 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/x86_64 (FUNC_ENTRY): New name for DOS64_ENTRY.
+ * mpn/x86_64 (FUNC_EXIT): New name for DOS64_EXIT.
+
+2012-05-29 Marco Bodrato <bodrato@mail.dm.unipi.it>
+
+ * mpz/remove.c: Optimise branches.
+
+ * mpn/generic/toom6h_mul.c: less branches in the LIKELY balanced path.
+ * mpn/generic/toom8h_mul.c: Likewise.
+
+2012-05-29 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/arm/v5/mod_1_1.asm: New file.
+
+2012-05-28 Niels Möller <nisse@lysator.liu.se>
+
+ * mpn/generic/gcdext.c (compute_v): Simplified carry handling a
+ bit, reduced stated scratch need from 2n+1 to 2n. Also comment and
+ ASSERT improvements.
+
+2012-05-27 Torbjorn Granlund <tege@gmplib.org>
+
+ * config.guess: Add new x86 CPUs.
+ * mpn/x86/fat/fat.c: Likewise.
+ * mpn/x86_64/fat/fat.c: Likewise.
+
+2012-05-27 Marco Bodrato <bodrato@mail.dm.unipi.it>
+
+ * mpn/x86_64/fat/fat.c: abort iff longmode-capable-bit is turned off.
+
+ * mpn/generic/toom8h_mul.c: mark UNLIKELY branches.
+
+2012-05-26 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpz: Use MPZ_REALLOC return value when possible.
+
+2012-05-25 Marco Bodrato <bodrato@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@gmplib.org>
+
+ * mpz/n_pow_ui.c: Cast non-limb count_leading_zeros argument.
+
+2012-05-24 Marco Bodrato <bodrato@mail.dm.unipi.it>
+
+ * mpz/remove.c: Support negative divisor.
+ * tests/mpz/t-remove.c: Test negative divisor.
+
+2012-05-23 Torbjorn Granlund <tege@gmplib.org>
+
+ * tests/mpz/reuse.c: Major rewrite.
+
+2012-05-23 Marco Bodrato <bodrato@mail.dm.unipi.it>
+
+ * mpz/sqrt.c: Further simplify.
+ * mpz/sqrtrem.c: Likewise.
+
+ * Mark failing branches with UNLIKELY. Many files affected.
+
+2012-05-22 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpz/sqrt.c: Allocate less for overlapping operands, simplify.
+ * mpz/sqrtrem.c: Likewise.
+
+2012-05-21 Marco Bodrato <bodrato@mail.dm.unipi.it>
+
+ * mpn/generic/toom8_sqr.c: Reduce branches for recursion.
+ * mpn/generic/toom8h_mul.c: Likewise.
+
+ * tests/mpn/t-toom8h.c: Don't use GMP_NUMB_BITS when not yet defined.
+
+2012-05-20 Torbjorn Granlund <tege@gmplib.org>
+
+ * tests/mpz/t-gcd.c: Rewrite.
+
+2012-05-19 Torbjorn Granlund <tege@gmplib.org>
+
+ * tests/mpz/t-gcd.c: Generate larger operands for better gcd code
+ coverage; distribute size exponentially.
+
+2012-05-17 Marco Bodrato <bodrato@mail.dm.unipi.it>
+
+ * mpf/pow_ui.c: Simplify.
+ * tests/mpf/reuse.c (dsi_func): Exercise pow_ui.
+
+ * tests/mpf/t-set_ui.c (check_data): LONG_HIGHBIT -> ULONG_HIGHBIT.
+ * tests/mpf/t-set.c (check_random): New check, both set and init_set.
+
+ * tests/cxx/t-ops.cc (check_mpq): Check squaring.
+ * tests/mpq/t-equal.c (check_various): Check different den-size.
+
+ * mpn/generic/mullo_n.c: Disable MAYBE_ if WANT_FAT_BINARY.
+ * mpz/cmpabs_d.c: Remove an unused branch.
+
+ * tests/mpz/t-get_d_2exp.c (check_zero): New check.
+ * tests/mpz/t-inp_str.c: A few more cases.
+ * tests/mpz/t-cmp_d.c: More bases and symbols, a few cases.
+
+ * mpz/rootrem.c: Correctly handle odd roots of negatives.
+ * tests/mpz/t-root.c: Test it.
+
+2012-05-16 Torbjorn Granlund <tege@gmplib.org>
+
+ * tests/mpf/t-eq.c (check_random): New function, meat from old main().
+ (check_data): New function.
+
+2012-05-13 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/arm/rsh1aors_n.asm: New file.
+ * mpn/arm/v5/mod_1_2.asm: New file.
+
+2012-05-11 Marc Glisse <marc.glisse@inria.fr>
+
+ * gmpxx.h (explicit operator bool): New functions.
+ * tests/cxx/t-cxx11.cc: Test the above.
+
+2012-05-10 Marco Bodrato <bodrato@mail.dm.unipi.it>
+
+ * gmp-impl.h (__gmpn_cpuvec_initialized): Was __gmpn_cpuvec.initialized
+ * mpn/x86/fat/fat.c: Use separated _initialized variable.
+ * mpn/x86_64/fat/fat.c: Likewise.
+ * tests/mpn/t-fat.c: Likewise.
+
+ * mpn/generic/toom2_sqr.c: Override global __gmpn_cpuvec_initialized.
+ * mpn/generic/toom22_mul.c: Likewise.
+ * mpn/generic/toom3_sqr.c: Likewise.
+ * mpn/generic/toom33_mul.c: Likewise.
+
+2012-05-09 Marco Bodrato <bodrato@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.
+ (MAXFACS): Redefine, using the shared (safer) log_n_max.
+
+2012-05-08 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/minithres/gmp-mparam.h (REDC_1_TO_REDC_N_THRESHOLD): Up to 9, for
+ coherency with ASSERT in mpn/generic/redc_n.c.
+
+2012-05-07 Marco Bodrato <bodrato@mail.dm.unipi.it>
+
+ * mpn/minithres/gmp-mparam.h: Updated TOOM6 and FAC_DSC.
+ * tests/mpn/toom-sqr-shared.h: Don't test if no range.
+
+ * mpz/oddfac_1.c: Add ASSERTs to warn about small threshold.
+ * tune/tuneup.c: Update minimal threshold for FAC_DSC.
+
+2012-05-06 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/arm/v6/sqr_basecase.asm: Simplify n=4 code.
+
+2012-05-05 Marco Bodrato <bodrato@mail.dm.unipi.it>
+
+ * mpn/generic/invert.c: Mark a branch UNLIKELY.
+ * tune/tuneup.c (tune_fac_u): Update DSC_THRESHOLD minimum.
+ * gmp-impl.h (FAC_???_THRESHOLD): Update default values.
+ (ABOVE_THRESHOLD): New definition with __builtin_constant_p.
+
+ * mpn/generic/toom22_mul.c: Disable MAYBE_ if WANT_FAT_BINARY.
+ * mpn/generic/toom33_mul.c: Likewise.
+ * mpn/generic/toom2_sqr.c: Likewise.
+ * mpn/generic/toom3_sqr.c: Likewise.
+
+2012-05-04 Torbjorn Granlund <tege@gmplib.org>
+
+ * tune/tuneup.c: Measure POWM_SEC_TABLE after the REDC thresholds.
+
+2012-05-03 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/generic/powm_sec.c: Use redc_2.
+ (INNERLOOP): Use this mechanism, like plain powm.c.
+ (WANT_CACHE_SECURITY): Remove, feature now unconditional.
+
+2012-05-02 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpz/bin_uiui.c: Make use of CNST_LIMB.
+
+2012-05-02 Marco Bodrato <bodrato@mail.dm.unipi.it>
+
+ * mpz/mfac_uiui.c: Support limb != ui.
+
+2012-05-02 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/arm/logops_n.asm: Work around register clobbering issue.
+
+ * mpn/arm/aorscnd_n.asm: New file.
+
+2012-05-01 Torbjorn Granlund <tege@gmplib.org>
+
+ * configure.in: Put arm dirs in path in proper prio order.
+
+ * mpn/arm/logops_n.asm: New file.
+
+ * mpz/2fac_ui.c: Fix assumed typo.
+
+ * mpn/arm/v6/gmp-mparam.h: New file.
+
+ * mpn/arm/v5/gcd_1.asm: Hack for undefined BMOD_1_TO_MOD_1_THRESHOLD.
+ * mpn/arm/v6t2/gcd_1.asm: Likewise.
+
+2012-04-30 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/arm/v6/sqr_basecase.asm: New file.
+
+2012-04-30 Marco Bodrato <bodrato@mail.dm.unipi.it>
+
+ * mpn/generic/comb_tables.c: New file.
+ * configure.in: Add it.
+ * gen-fac.c: Define table limits.
+ * gmp-impl.h: Declare tables.
+ (log_n_max): New static function.
+ * mpz/2fac_ui.c: Use shared tables.
+ * mpz/bin_uiui.c: Likewise.
+ * mpz/oddfac_1.c: Likewise.
+ * mpz/primorial_ui.c: Likewise.
+
+ * mpz/mfac_uiui.c: New file.
+ * Makefile.am: Compile it.
+ * mpz/Makefile.am (libmpz_la_SOURCES): Add mpz_mfac_uiui.c
+ * gmp-h.in (mpz_mfac_uiui): Declare.
+
+ * tests/mpz/t-mfac_uiui.c: New file.
+ * tests/mpz/Makefile.am: Run it.
+
+ * doc/gmp.texi: Document mpz_mfac_uiui, collapsing with other factorial functions.
+
+ * tests/mpz/t-lcm.c: Test zero too.
+
+ * mpz/prodlimbs.c: Simplify threshold (should be tuned, not guessed).
+
+2012-04-29 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/arm/aors_n.asm: Tune for more stable performance.
+
+ * mpn/arm/aorslsh1_n.asm: New file.
+
+ * mpn/arm/mod_34lsub1.asm: New file.
+
+ * mpn/arm/v6t2/divrem_1.asm: New file.
+
+2012-04-28 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/thumb/add_n.asm: New file.
+ * mpn/thumb/sub_n.asm: New file.
+ * mpn/thumb/add_n.s: Remove broken code.
+ * mpn/thumb/sub_n.s: Likewise.
+
+ * mpn/arm/v6/addmul_1.asm: Rewrite for stable speed, smaller size.
+ * mpn/arm/v6/mul_1.asm: Likewise.
+
+2012-04-27 Torbjorn Granlund <tege@gmplib.org>
+
+ * configure.in: Search arm/v6t2 for arm7.
+
+ * mpn/arm/v5/gcd_1.asm: New file.
+ * mpn/arm/v6t2/gcd_1.asm: New file.
+
+ * mpn/arm/mode1o.asm: New file.
+ * mpn/arm/v6t2/mode1o.asm: New file.
+
+ * mpn/arm/arm-defs.m4 (LEA): New define.
+ * mpn/arm/invert_limb.asm: Use LEA.
+
+2012-04-26 Marco Bodrato <bodrato@mail.dm.unipi.it>
+
+ * mpz/bin_uiui.c (bc_bin_uiui): Nail support.
+ * tests/cxx/t-ops2.cc: Test 0/3.
+ * oddfac_1.c: assume n > 26.
+ * tests/mpz/t-jac.c (mpn_jacobi_n): Enlarge tested sizes.
+
+2012-04-24 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/arm/v6/addmul_2.asm: New file.
+ * mpn/arm/v6/mul_2.asm: New file.
+
+2012-04-23 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/arm/aorsmul_1.asm: Tweak loop control for a 6% speed increase.
+
+2012-04-22 Torbjorn Granlund <tege@gmplib.org>
+
+ * configure.in: Recognise ARM sub-architectures.
+
+ * configfsf.guess: Update to current FSF version.
+ * configfsf.sub: Likewise.
+
+ * mpn/arm/bdiv_dbm1c.asm: New file.
+
+ * mpn/arm/v6/mul_1.asm: New file.
+ * mpn/arm/v6/addmul_1.asm: New file.
+
+2012-04-22 Marco Bodrato <bodrato@mail.dm.unipi.it>
+
+ * gen-fac.c: Renamed, was gen-fac_ui.c .
+ * Makefile.am: Renamed gen-fac.c and fac_table.h .
+ * gmp-impl.h: #include "fac_table.h".
+ * mpz/oddfac_1.c: Use generated constant.
+ * mpz/bin_ui.c: Small optimisations.
+
+ * tune/common.c (speed_mpz_bin_ui): New function.
+ * tune/speed.h: Declare it.
+ * tune/speed.c: Use it.
+
+2012-04-21 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/arm/mul_1.asm: Cleanup.
+ * mpn/arm/copyi.asm: Cleanup, assume allocate-on-write cache.
+ * mpn/arm/copyd.asm: Likewise.
+
+ * mpn/arm/add_n.asm: Delete.
+ * mpn/arm/sub_n.asm: Delete.
+ * mpn/arm/aors_n.asm: New file, made from old files.
+
+ * mpn/arm/addmul_1.asm: Delete.
+ * mpn/arm/submul_1.asm: Delete.
+ * mpn/arm/aorsmul_1.asm: New file, made from old files.
+
+ * mpn/arm/com.asm: New file.
+ * mpn/arm/lshift.asm: New file.
+ * mpn/arm/rshift.asm: New file.
+
+2012-04-20 Torbjorn Granlund <tege@gmplib.org>
+
+ * tests/mpq/io.c: New file.
+ * tests/mpq/Makefile.am: Run it.
+
+ * mpz/clrbit.c: Simplify along the lines of setbit.c.
+
+2012-04-20 Marco Bodrato <bodrato@mail.dm.unipi.it>
+
+ * mpz/setbit.c: Simplify.
+
+ * gmp-impl.h (LOG2C): Define.
+ * mpz/fac_ui.c (LOG2C): Remove.
+ * mpz/2fac_ui.c (LOG2C): Remove.
+ * mpz/oddfac_1.c (LOG2C): Remove.
+ * mpn/generic/binvert.c (LOG2C): Remove.
+ * mpn/generic/invertappr.c (LOG2C): Remove.
+
+ * mpz/bin_uiui.c (mpz_goetgheluck_bin_uiui): Move declarations,
+ and assume that n and k are not small.
+
+2012-04-19 Torbjorn Granlund <tege@gmplib.org>
+
+ * tests/mpz/Makefile.am (check_PROGRAMS): Add t-remove.
+
+ * tests/mpz/t-remove.c: Clear out mpz variables.
+
+ * tests/mpz/t-cong.c (check_random): Use much larger numbers.
+ (check_data): Check congruences mod 0.
+
+ * tests/mpz/t-divis.c: Test divisibility by zero.
+
+ * tests/mpz/reuse.c: Test mpz_mod.
+
+ * mpz/setbit.c: Remove dead code. Use CNST_LIMB.
+ * mpz/clrbit.c: Use CNST_LIMB.
+
+2012-04-19 Marco Bodrato <bodrato@mail.dm.unipi.it>
+
+ * primesieve.c: New file, with functions from mpz/oddfac_1.c .
+ * mpz/oddfac_1.c (bitwise_primesieve): Re-moved.
+ * Makefile.am (libgmp_la_SOURCES): Add primesieve.c .
+ * gmp-impl.h (gmp_primesieve): Declare.
+
+ * mpz/bin_uiui.c (mpz_goetgheluck_bin_uiui): New, factor-based
+ implementation.
+ * tests/mpz/t-bin.c: Extend tests, to cover _goetgheluck.
+
+ * mpz/primorial_ui.c: New file.
+ * mpz/Makefile.am (libmpz_la_SOURCES): Add mpz/primorial_ui.c
+ * Makefile.am (MPZ_OBJECTS): Add mpz/primorial_ui$U.lo
+ * gmp-h.in (mpz_primorial_ui): Declare.
+ * tests/mpz/t-primorial_ui.c: New test for the new function.
+ * tests/mpz/Makefile.am (check_PROGRAMS): Add t-primorial_ui.
+ * doc/gmp.texi: Short documentation for the new function.
+
+2012-04-17 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/x86_64/coreisbr/aorsmul_1.asm: Fix some DOS64 issues.
+ * mpn/x86_64/coreisbr/mul_1.asm: Likewise.
+
+ * mpn/x86_64/fastsse/lshiftc-movdqu2.asm: Adhere to DOS64 register
+ partitioning rules.
+
+ * mpn/x86_64/fastsse/copyi-palignr.asm: Implement temporary workaround
+ to overlap issue.
+
+2012-04-17 Marco Bodrato <bodrato@mail.dm.unipi.it>
+
+ * mpz/bin_uiui.c: Support small limbs (fallback on bin_ui).
+
+ * tests/mpn/toom-sqr-shared.h: Use a restricted range.
+ * tests/mpn/t-toom2-sqr.c: Specify correct range.
+ * tests/mpn/t-toom3-sqr.c: Likewise.
+ * tests/mpn/t-toom4-sqr.c: Likewise.
+ * tests/mpn/t-toom6-sqr.c: Likewise.
+ * tests/mpn/t-toom8-sqr.c: Likewise, but extended.
+ * tests/mpn/Makefile.am (check_PROGRAMS): Add t-toom?-sqr tests.
+
+ * mpn/generic/sbpi1_bdiv_q.c: Move ASSERTs, to support qp = np.
+
+2012-04-17 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/x86_64/copyd.asm: Rewrite.
+ * mpn/x86_64/copyi.asm: Rewrite.
+
+2012-04-16 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/x86_64/fastsse/lshift-movdqu2.asm: Add DOS entry/exit sequences.
+ * mpn/x86_64/fastsse/rshift-movdqu2.asm: Likewise.
+ * mpn/x86_64/fastsse/lshiftc-movdqu2.asm: Likewise.
+
+ * mpn/x86_64/x86_64-defs.m4 (palignr): New macro.
+ (x86_opcode_regxmm, x86_opcode_regxmm_list): New, made from x86 mmx
+ counterparts.
+ (x86_lookup): Copy from x86/x86-defs.m4.
+ * mpn/x86_64/fastsse/copyd-palignr.asm: Use palignr macro.
+ * mpn/x86_64/fastsse/copyi-palignr.asm: Likewise.
+
+2012-04-15 Marco Bodrato <bodrato@mail.dm.unipi.it>
+
+ * tests/mpz/t-bin.c: Add more tests on small values.
+ * mpz/bin_uiui.c (mpz_bdiv_bin_uiui): Smaller temporary areas.
+
+2012-04-15 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/x86_64/fastsse/copyd-palignr.asm: New file.
+ * mpn/x86_64/fastsse/copyi-palignr.asm: New file.
+ * mpn/x86_64/core2/copyd.asm: New file.
+ * mpn/x86_64/core2/copyi.asm: New file.
+ * mpn/x86_64/nano/copyd.asm: New file.
+ * mpn/x86_64/nano/copyi.asm: New file.
+ * mpn/x86_64/atom/copyd.asm: New file.
+ * mpn/x86_64/atom/copyi.asm: New file.
+
+2012-04-13 Marco Bodrato <bodrato@mail.dm.unipi.it>
+
+ * 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.
+ * tune/speed.h (SPEED_ROUTINE_MPN_MUPI_DIV_QR): Allocate scratch
+ space for mpn_invert.
+
+ * mpz/mul_i.h: Small clean-up.
+
+ * tests/mpn/toom-sqr-shared.h: New file.
+ * tests/mpn/t-toom2-sqr.c: New file.
+ * tests/mpn/t-toom3-sqr.c: New file.
+ * tests/mpn/t-toom4-sqr.c: New file.
+ * tests/mpn/t-toom6-sqr.c: New file.
+ * tests/mpn/t-toom8-sqr.c: New file.
+ * tests/mpn/Makefile.am (EXTRA_DIST): Add toom-sqr-shared.h .
+
+ * mpn/generic/toom62_mul.c: Use add_n, sub_n, when possible.
+
+2012-04-12 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/x86_64/fastsse/lshift-movdqu2.asm: New file.
+ * mpn/x86_64/fastsse/rshift-movdqu2.asm: New file.
+ * mpn/x86_64/fastsse/lshiftc-movdqu2.asm: New file.
+ * mpn/x86_64/coreisbr/lshift.asm: New file.
+ * mpn/x86_64/coreisbr/rshift.asm: New file.
+ * mpn/x86_64/coreisbr/lshiftc.asm: New file.
+ * mpn/x86_64/k10/lshift.asm: New file.
+ * mpn/x86_64/k10/rshift.asm: New file.
+ * mpn/x86_64/k10/lshiftc.asm: New file.
+
+ * mpn/x86_64/fastsse/lshift.asm: Simplify to very basic form.
+
+2012-04-11 Niels Möller <nisse@lysator.liu.se>
+
+ * Makefile.am (check-mini-gmp): Pass -I../.. in EXTRA_CFLAGS, to
+ locate gmp.h.
+
+2012-04-11 Marco Bodrato <bodrato@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.
+
+ * 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@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@gmplib.org>
+
+ * mpn/ia64/gcd_1.asm: Rewrite inner loop to use ctz table.
+
+2012-04-05 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/powerpc64/p7/popcount.asm: Properly extend arg n for mode32.
+ * mpn/powerpc64/p7/hamdist.asm: Likewise.
+
+2012-04-04 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/powerpc64/p7/popcount.asm: New file.
+ * mpn/powerpc64/p7/hamdist.asm: New file.
+
+ * longlong.h (ARM count_leading_zeros): Enable for more arch versions.
+
+ * mpn/x86_64/gcd_1.asm: Make room for DOS64 regparm shadow area.
+ * mpn/x86_64/core2/gcd_1.asm: Likewise.
+
+2012-04-03 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/x86_64/coreisbr/aorrlsh_n.asm: Make it actually work for DOS64.
+
+2012-04-02 Marco Bodrato <bodrato@mail.dm.unipi.it>
+
+ * mpz/oddfac_1.c: Initialize size for ASSERT.
+
+2012-04-02 Torbjorn Granlund <tege@gmplib.org>
+
+ * gmp-h.in (_GMP_H_HAVE_FILE): Test also __STDIO_LOADED (for VMS).
+
+ * gmp-impl.h (doprnt_format_t, etc): Remove bogus __GMP_DECLSPECs.
+
+2012-03-30 Marco Bodrato <bodrato@mail.dm.unipi.it>
+
+ * mpn/x86_64/sqr_basecase.asm: Speed-up for small cases.
+
+2012-03-29 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/sparc64/gcd_1.asm: New file.
+
+2012-03-27 Torbjorn Granlund <tege@gmplib.org>
+
+ * config.guess: Fix typo in coreisbr recognition.
+
+2012-03-26 Marco Bodrato <bodrato@mail.dm.unipi.it>
+
+ * mpn/x86_64/gcd_1.asm: Reduce latency.
+ * mpn/x86_64/mul_basecase.asm: Save one jump.
+
+ * mpz/iset_ui.c: Don't realloc.
+
+2012-03-20 Marco Bodrato <bodrato@mail.dm.unipi.it>
+
+ * mp_clz_tab.c: Add __clz_tab[128].
+ * longlong.h (count_trailing_zeros): Use it in pure C variant.
+
+2012-03-20 Torbjorn Granlund <tege@gmplib.org>
+
+ * configure.in (x86 fat_path): Add many missing directories.
+ * mpn/x86/fat/fat.c (__gmpn_cpuvec_init): Rewrite.
+ (fake_cpuid_table): Add many more CPUs.
+
+ * mpn/x86_64/fat/fat.c (__gmpn_cpuvec_init): Minor spacing cleanup.
+
+2012-03-19 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/x86/x86-defs.m4 (CALL, PIC_WITH_EBX): New macros.
+ * mpn/x86/darwin.m4: Likewise.
+ * mpn/x86/k7/gcd_1.asm: Use new macros to support PIC.
+ * mpn/x86/p6/gcd_1.asm: Likewise.
+
+2012-03-19 Marco Bodrato <bodrato@mail.dm.unipi.it>
+
+ * gen-fac_ui.c: Generate more constants (possible mini-mpz_root).
+ * mpz/oddfac_1.c: Improve ASSERTs.
+ (log_n_max): Use precomputed table.
+
+ * longlong.h (_PROTO): Remove.
+
+2012-03-18 Torbjorn Granlund <tege@gmplib.org>
+
+ * longlong.h (count_trailing_zeros): Write better pure C default
+ variant.
+
+ * mpn/x86/p6/gcd_1.asm: Remove forgotten x86_64 reference.
+
+ * mpn/x86/p6/gmp-mparam.h: Update, to get BMOD_1_TO_MOD_1_THRESHOLD
+ defined for fat binaries.
+
+2012-03-17 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/x86/k7/gcd_1.asm: Rewrite.
+ * mpn/x86/p6/gcd_1.asm: New file.
+
+ * mpn/x86_64/core2/gcd_1.asm: Conditionally suppress reduction calls.
+ * mpn/x86_64/gcd_1.asm: Rewrite.
+
+2012-03-15 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/generic/gcd_1.c: Parameterise zerotab code.
+
+ * mpn/x86_64/nano/gcd_1.asm: New file, grabbing core2 asm file.
+
+ * mpn/x86_64/core2/gcd_1.asm: Speed up loop code, simplify non-loop
+ code.
+
+2012-03-13 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/x86_64/core2/gcd_1.asm: Add hack to support fat builds.
+
+ * mpn/x86_64/core2/gcd_1.asm: Shorten critical path.
+
+2012-03-12 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/x86_64/core2/gcd_1.asm: New file.
+ * mpn/x86_64/k10/gcd_1.asm: New file, grabbing core2 asm file.
+ * mpn/x86_64/bd1/gcd_1.asm: Likewise.
+
+ * mpn/x86_64/bobcat/sqr_basecase.asm: New file.
+ * mpn/x86_64/bobcat/mul_basecase.asm: Minor tuning.
+
+2012-03-10 Torbjorn Granlund <tege@gmplib.org>
+
+ * configure.in (fat_functions): Add addlsh1_n, addlsh2_n, addmul_2,
+ mullo_basecase, redc_1, redc_2, sublsh1_n.
+
+ * gmp-impl.h (struct cpuvec_t): Add fields for new fat functions.
+ * gmp-impl.h: Adjust corresponding declarations.
+
+ * mpn/generic/redc_2.c (mpn_addmul_2): Make static.
+
+ * mpn/x86_64/fat/fat_entry.asm (FAT_INIT): Expand before fat_init to
+ reduce branch offsets. Pass plain 0,1,3... in %al since we'd else run
+ out of 8-bit range.
+
+ * mpn/x86_64/fat/fat_entry.asm (fat_init): Scale passed index value.
+ * mpn/x86/fat/fat_entry.asm (fat_init): Use movzbl for expanding index
+ value.
+
+ * mpn/x86_64/x86_64-defs.m4 (CPUVEC_FUNCS_LIST): Add new fat functions.
+ * mpn/x86/x86-defs.m4 (CPUVEC_FUNCS_LIST): Likewise.
+ * mpn/x86_64/fat/fat.c (__gmpn_cpuvec): Likewise.
+ * mpn/x86/fat/fat.c (__gmpn_cpuvec): Likewise.
+
+ * mpn/x86_64/fat/redc_2.c: New file.
+ * mpn/x86/fat/mullo_basecase.c: New file.
+ * mpn/x86/fat/redc_1.c: New file.
+ * mpn/x86/fat/redc_2.c: New file.
+
+ * tests/mpn/t-fat.c: Test mullo_basecase.
+
+2012-03-08 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/x86_64/coreisbr/addmul_2.asm: Port to DOS64.
+
+2012-02-29 Marc Glisse <marc.glisse@inria.fr>
+
+ * gmpxx.h: Ignore partial C++11 support in g++-4.6.
+ * tests/cxx/t-cxx11.cc: Likewise.
+
+ * gmpxx.h (operator""): New functions.
+ * tests/cxx/t-cxx11.cc: Test the above.
+ * doc/gmp.texi: Document the above.
+
+2012-03-08 Marco Bodrato <bodrato@mail.dm.unipi.it>
+
+ * acinclude.m4 (GMP_H_ANSI): Remove.
+ * configure.in: Don't use GMP_H_ANSI.
+ * gmp-h.in (__GMP_HAVE_PROTOTYPES): Remove.
+
+2012-03-08 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/x86_64/fat/fat.c (fake_cpuid_table): Recognise "bulldozer".
+ (__gmpn_cpuvec_init): Overhaul to match configure.in.
+
+ * configure.in: Adjust bulldozer path_64.
+
+2012-03-07 Torbjorn Granlund <tege@gmplib.org>
+
+ * configure.in (x86_64 fat_path): List recently added AMD directories.
+
+ * mpn/x86_64/bobcat/copyi.asm: New file.
+ * mpn/x86_64/bobcat/copyd.asm: New file.
+
+ * config.guess: Handle AMD 11h correctly.
+
+ * tune/tuneup.c (tune_redc): Better handle situation where redc_2 is
+ never faster.
+
+2012-03-06 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/x86_64/bobcat/mul_basecase.asm: New file.
+
+2012-03-04 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/x86_64/bobcat/mul_1.asm: New file.
+ * mpn/x86_64/bobcat/aorsmul_1.asm: New file.
+
+2012-03-04 Marco Bodrato <bodrato@mail.dm.unipi.it>
+
+ * mpz/invert.c: Remove mod 0 branch.
+ * tests/mpz/t-invert.c: Avoid testing mod 0.
+ * doc/gmp.texi (mpz_invert): Specify mod 0 is not handled.
+
+ * gmp-h.in (__gmp_signed, __gmp_const): Remove.
+ (__GMP_HAVE_TOKEN_PASTE, __GMP_HAVE_CONST): Remove.
+ * gmp-impl.h: Strip __GMP_HAVE_TOKEN_PASTE and __GMP_HAVE_CONST.
+ * demos/expr/: Strip __gmp_const usage from all files.
+
+ * tests/mpz/t-powm.c (allsizes_seen): Require unsigned*.
+
+2012-03-03 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/x86_64/k8/gmp-mparam.h: New file.
+ * mpn/x86_64/k10/gmp-mparam.h: New file.
+
+ * mpn/generic/hgcd_step.c (mpn_hgcd_step): Remove unused variables.
+ * mpn/generic/hgcd_jacobi.c (hgcd_jacobi_step): Likewise.
+ * mpn/generic/hgcd_reduce.c (hgcd_matrix_apply): Likewise.
+ * mpn/generic/mu_bdiv_qr.c: Likewise.
+ * mpz/jacobi.c: Likewise.
+ * mpz/mod.c: Likewise.
+
+ * mpn/generic/toom42_mul.c: Remove unread variable.
+ * mpn/generic/set_str.c (mpn_set_str_compute_powtab): Likewise.
+ * mpn/generic/rootrem.c (mpn_rootrem_internal): Likewise.
+ * tests/refmpn.c (refmpn_mul): Likewise.
+ * mpn/generic/hgcd_appr.c (mpn_hgcd_appr): Propagate mask computation
+ into ASSERT, remove variable.
+
+ * gmp-h.in (__GMP_PROTO): Remove.
+ * Strip __GMP_PROTO usage from all files.
+ * Strip prototype parameter names from all files.
+
+2012-03-01 Marco Bodrato <bodrato@mail.dm.unipi.it>
+
+ * doc/gmp.texi (mpz_invert): Correctly document result range.
+ * tests/mpz/t-invert.c: Small range correction.
+
+2012-03-01 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/x86_64/mullo_basecase.asm: New file.
+
+2012-02-29 Marc Glisse <marc.glisse@inria.fr>
+
+ * gmpxx.h (std::numeric_limits): New partial specialization.
+
+2012-02-29 Niels Möller <nisse@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
+ clean-mini-gmp.
+
+2012-02-28 Niels Möller <nisse@lysator.liu.se>
+
+ * 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@gmplib.org>
+
+ * mpn/x86_64/fastsse/lshiftc.asm: New file.
+ * mpn/x86_64/fastsse/com.asm: New file.
+
+ * mpn/x86_64/bd1/popcount.asm: New file.
+ * mpn/x86_64/bd1/hamdist.asm: New file.
+
+ * mpn/x86_64/fastsse/copyi.asm: New file.
+ * mpn/x86_64/fastsse/copyd.asm: New file.
+ * mpn/x86_64/fastsse/lshift.asm: New file.
+
+2012-02-26 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/x86_64/coreisbr/addmul_2.asm: New file.
+
+ * tests/devel/try.c (param_init): Don't require addmul_N to handle
+ overlap.
+
+ * mpn/x86_64/bd1/mul_1.asm: New file.
+ * mpn/x86_64/bd1/aorsmul_1.asm: New file.
+
+2012-02-26 Marco Bodrato <bodrato@mail.dm.unipi.it>
+
+ * mpz/2fac_ui.c: New file: implements n!!.
+ * Makefile.am (MPZ_OBJECTS): Add mpz/2fac_ui.
+ * gmp-h.in: Declare mpz_2fac_ui.
+ * tests/mpz/t-fac.c: Test mpz_2fac_ui.
+ * doc/gmp.texi: Document mpz_2fac_ui.
+ * mpz/Makefile.am (libmpz_la_SOURCES): Add 2fac_ui.c.
+
+ * mpz/oddfac_1.c (mpz_oddfac_1): Use umul_ppmm when size = 2.
+
+2012-02-26 Niels Möller <nisse@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.
+ * dumbmp.c: Deleted file. A few functions moved to bootstrap.c.
+
+ * gen-bases.c: Include bootstrap.c, not dumbmp.c.
+ * gen-fac_ui.c: Likewise.
+ * gen-trialdivtab.c: Likewise.
+ * gen-fib.c: Include bootstrap.c, not dumbmp.c. Use assert rather
+ than ASSERT. Deleted casts of xmalloc return value.
+ * gen-psqr.c: Likewise.
+ (COLLAPSE_ELEMENT): Use memmove rather than mem_copyi.
+
+ * Makefile.am: Replaced all uses of dumbmp.c by bootstrap.c.
+ (EXTRA_DIST, dist-hook): Arrange for distribution of the mini-gmp
+ files.
+
+2012-02-24 Marco Bodrato <bodrato@mail.dm.unipi.it>
+
+ * mpz/invert.c: Use ABSIZ, MPZ_EQUAL_1_P.
+ * mpz/abs.c: Collapse MPZ_REALLOC(x,.) and PTR(x).
+ * mpz/aors_ui.h: Likewise.
+ * mpz/com.c: Likewise.
+ * mpz/neg.c: Likewise.
+
+ * mpz/invert.c: Reply "no-inverse" when modulus is zero.
+ * tests/mpz/t-invert.c: Add more checks.
+ * doc/gmp.texi (mpz_invert): Inverse can not be zero.
+
+2012-02-24 Torbjorn Granlund <tege@gmplib.org>
+
+ * tests/mpn/logic.c: New file.
+ * tests/mpn/Makefile.am (check_PROGRAMS): Add logic.
+
+ * tests/mpz/t-invert.c: New file.
+ * tests/mpz/Makefile.am (check_PROGRAMS): Add t-invert.
+
+2012-02-24 Marc Glisse <marc.glisse@inria.fr>
+
+ * tests/mpq/t-cmp.c: Move NUM and DEN macros...
+ * tests/mpq/t-cmp_ui.c: Likewise...
+ * gmp-impl.h: ... to here.
+
+ * mpq/abs.c: Use NUM, DEN, SIZ, ALLOC, PTR, MPZ_REALLOC.
+ * mpq/aors.c: Likewise.
+ * mpq/canonicalize.c: Likewise.
+ * mpq/clear.c: Likewise.
+ * mpq/cmp.c: Likewise.
+ * mpq/cmp_si.c: Likewise.
+ * mpq/cmp_ui.c: Likewise.
+ * mpq/div.c: Likewise.
+ * mpq/equal.c: Likewise.
+ * mpq/get_d.c: Likewise.
+ * mpq/get_den.c: Likewise.
+ * mpq/get_num.c: Likewise.
+ * mpq/get_str.c: Likewise.
+ * mpq/init.c: Likewise.
+ * mpq/inp_str.c: Likewise.
+ * mpq/inv.c: Likewise.
+ * mpq/md_2exp.c: Likewise.
+ * mpq/mul.c: Likewise.
+ * mpq/neg.c: Likewise.
+ * mpq/set.c: Likewise.
+ * mpq/set_d.c: Likewise.
+ * mpq/set_den.c: Likewise.
+ * mpq/set_f.c: Likewise.
+ * mpq/set_num.c: Likewise.
+ * mpq/set_si.c: Likewise.
+ * mpq/set_str.c: Likewise.
+ * mpq/set_ui.c: Likewise.
+ * mpq/set_z.c: Likewise.
+ * mpq/swap.c: Likewise.
+
+ * tests/mpq/t-inv.c: New test file.
+ * tests/mpq/Makefile.am: Add the above.
+
+ * gmpxx.h (__gmp_set_expr): Use mpq_set_z.
+
+ * mpq/md_2exp.c: Collapse MPZ_REALLOC(x,.) and PTR(x).
+ * mpq/set_d.c: Likewise.
+ * mpq/set_f.c: Likewise.
+
+2012-02-24 Niels Möller <nisse@lysator.liu.se>
+
+ * mpn/x86_64/core2/aorsmul_1.asm: Added mpn_addmul_1c and
+ mpn_submul_1c entry points.
+
+2012-02-23 Marc Glisse <marc.glisse@inria.fr>
+
+ * mpz/abs.c: Use ALLOC, SIZ, ABSIZ, PTR, MPZ_REALLOC.
+ * mpz/aors_ui.h: Likewise.
+ * mpz/array_init.c: Likewise.
+ * mpz/cdiv_q.c: Likewise.
+ * mpz/cdiv_qr.c: Likewise.
+ * mpz/cdiv_r.c: Likewise.
+ * mpz/clear.c: Likewise.
+ * mpz/clrbit.c: Likewise.
+ * mpz/cmp_si.c: Likewise.
+ * mpz/com.c: Likewise.
+ * mpz/fdiv_q.c: Likewise.
+ * mpz/fdiv_qr.c: Likewise.
+ * mpz/fdiv_r.c: Likewise.
+ * mpz/get_si.c: Likewise.
+ * mpz/get_str.c: Likewise.
+ * mpz/init.c: Likewise.
+ * mpz/inp_str.c: Likewise.
+ * mpz/iset.c: Likewise.
+ * mpz/iset_d.c: Likewise.
+ * mpz/iset_si.c: Likewise.
+ * mpz/iset_str.c: Likewise.
+ * mpz/iset_ui.c: Likewise.
+ * mpz/mod.c: Likewise.
+ * mpz/neg.c: Likewise.
+ * mpz/out_str.c: Likewise.
+ * mpz/random2.c: Likewise.
+ * mpz/set_si.c: Likewise.
+ * mpz/set_str.c: Likewise.
+ * mpz/set_ui.c: Likewise.
+ * mpz/setbit.c: Likewise.
+ * mpz/sqrt.c: Likewise.
+ * mpz/swap.c: Likewise.
+ * mpz/tdiv_r_2exp.c: Likewise.
+
+ * tests/cxx/t-ops.cc: Test mpz_abs reallocation.
+
+2012-02-23 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/x86_64/core2/rsh1aors_n.asm: Complete rewrite.
+ * mpn/x86_64/coreisbr/rsh1aors_n.asm: Move old core2 code here.
+
+ * mpn/x86_64/redc_1.asm: Make it work for DOS64 (broken in last edit).
+
+2012-02-20 Marco Bodrato <bodrato@mail.dm.unipi.it>
+
+ * mpn/generic/toom_interpolate_8pts.c: Compute carry iif non-trivial.
+
+ * mpz/gcdext.c: Adapt to relaxed mpn_gcdext's input requirements.
+
+ * mpz/and.c: Use mpn_ logic everywhere. Reduce branches.
+ * mpz/ior.c: Likewise.
+ * mpz/xor.c: Likewise.
+
+2012-02-20 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/x86_64/coreisbr/mul_1.asm: New file.
+
+ * mpn/x86_64/coreisbr/aorsmul_1.asm: New file.
+
+ * mpn/x86_64/mod_34lsub1.asm: Avoid ",pt" branch hint since many
+ assemblers don't support it.
+
+2012-02-19 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/generic/redc_1.c: Put back mpn_add_n call, return its carry.
+ Reintroduce previously removed RP argument.
+ * mpn/x86_64/redc_1.asm: Likewise.
+
+ * mpn/generic/redc_2.c: Remove mpn_sub_n call, return carry from
+ mpn_add_n call.
+
+ * gmp-impl.h (mpn_redc_1, mpn_redc_2): Now return an mp_limb_t.
+
+ * tune/speed.h (SPEED_ROUTINE_REDC_1): Adopt to pass RP argument.
+
+ * tests/refmpn.c (refmpn_redc_1): Adopt to new redc_1 interface.
+
+ * mpn/generic/powm.c (MPN_REDC_1): Pass rp parameter to mpn_redc_1.
+ * mpn/generic/powm_sec.c (MPN_REDC_1_SEC): Likewise.
+ * mpn/generic/powm.c (MPN_REDC_2): New macro, use for mpn_redc_2.
+
+2012-02-18 Marc Glisse <marc.glisse@inria.fr>
+
+ * gmpxx.h (std::common_type): New partial specialization in C++11.
+ * tests/cxx/t-cxx11.cc: Test it.
+
+ * gmpxx.h: Don't declare long double functions that are never defined.
+
+ * gmpxx.h (__gmp_binary_expr): Let things happen in place: q=q*q+z*z
+ becomes tmp=z*z, q=q*q, q+=tmp.
+ * tests/cxx/t-binary.cc: More variable reuse tests.
+
+2012-02-17 Marc Glisse <marc.glisse@inria.fr>
+
+ * gmp-h.in (__GMP_WITHIN_GMP): Test with #ifdef instead of #if, for
+ the benefit of applications using gcc -Wundef.
+ (__GMP_WITHIN_GMPXX): Likewise.
+
+2012-02-16 Marc Glisse <marc.glisse@inria.fr>
+
+ * gmpxx.h (__gmp_binary_expr): Let things happen in place: e=a*b-c*d
+ becomes tmp=c*d, e=a*b, e-=tmp.
+ * tests/cxx/t-binary.cc: More variable reuse tests.
+
+2012-02-15 Niels Möller <nisse@lysator.liu.se>
+
+ * tune/tuneup.c (mul_toom43_to_toom54_threshold): New global.
+ (tune_mul): Added tuning of MUL_TOOM43_TO_TOOM54_THRESHOLD.
+ * tune/speed.h (SPEED_ROUTINE_MPN_TOOM43_FOR_TOOM54_MUL): New macro.
+ (SPEED_ROUTINE_MPN_TOOM54_FOR_TOOM43_MUL): New macro.
+ Prototypes for corresponding functions.
+ * tune/common.c (speed_mpn_toom43_for_toom54_mul): New function.
+ (speed_mpn_toom54_for_toom43_mul): New function.
+
+ * gmp-impl.h (MPN_TOOM43_MUL_MINSIZE): Corrected constant.
+ (MPN_TOOM53_MUL_MINSIZE): Likewise.
+ (MPN_TOOM54_MUL_MINSIZE): New constant.
+ (mpn_toom54_mul): Added prototype.
+ (MUL_TOOM43_TO_TOOM54_THRESHOLD): New threshold. Default value and
+ tuning setup.
+
+2012-02-14 Niels Möller <nisse@lysator.liu.se>
+
+ * mpn/generic/toom54_mul.c: New file, originally contributed by
+ Marco.
+ * gmp-impl.h (mpn_toom54_mul_itch): New function.
+ * configure.in (gmp_mpn_functions): Added toom54_mul.
+ * tests/mpn/t-toom54.c: New file.
+ * tests/mpn/Makefile.am (check_PROGRAMS): Added t-toom54.
+
+2012-02-13 Niels Möller <nisse@lysator.liu.se>
+
+ * configure.in: Display summary of options.
+
+2012-02-11 Torbjorn Granlund <tege@gmplib.org>
+
+ * tests/tests.h (TESTS_REPS): Print any non-standard repetitions.
+
+2012-02-11 Marco Bodrato <bodrato@mail.dm.unipi.it>
+
+ * doc/gmp.texi (Factorial): Shortly describe current algorithm.
+ (Multiplication Algorithms): Add Toom[68]'n'half, (too) shortly.
+ * gmp-impl.h (ASSERT_ALWAYS): Consider failures UNLIKELY.
+
+2012-02-10 Niels Möller <nisse@lysator.liu.se>
+
+ * tests/mpz/t-gcd.c (gcdext_valid_p): Enforce slightly stricter
+ bound for cofactors.
+
+ * mpn/generic/gcdext_lehmer.c (mpn_gcdext_hook): Corrected
+ handling of unlikely (maybe impossible?) case u1n < un. Related to
+ the 2012-02-05 bugfix of gcdext_subdiv_step.c in the gmp-5.0 repo.
+
+2012-02-09 Marco Bodrato <bodrato@mail.dm.unipi.it>
+
+ * gmp-impl.h (mpn_toom3*_itch): Support any recursion depth.
+ * tests/refmpn.c (refmpn_mul): Restore tight allocations.
+
+ * mpz/oddfac_1.c (mpz_oddfac_1): Get ready for n!!
+ * gmp-impl.h (mpz_oddfac_1): Update signature.
+ * mpz/fac_ui.c (mpz_fac_ui): Update call to mpz_oddfac_1.
+
+2012-02-09 Marc Glisse <marc.glisse@inria.fr>
+
+ * gmp-impl.h (ABS_CAST): New macro.
+ * mpf/cmp_si.c: Use ABS_CAST.
+ * mpf/get_si.c: Use ABS_CAST.
+ * mpf/iset_si.c: Use ABS_CAST.
+ * mpf/set_si.c: Use ABS_CAST.
+ * mpq/set_si.c: Use ABS_CAST.
+ * mpz/cmp_si.c: Use ABS_CAST.
+ * mpz/get_si.c: Use ABS_CAST.
+ * mpz/iset_si.c: Use ABS_CAST.
+ * mpz/mul_i.h: Use ABS_CAST.
+ * mpz/set_si.c: Use ABS_CAST.
+
+2012-02-08 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/powerpc32/divrem_2.asm: Fix off-by-one condition in invert_limb
+ code.
+
+2012-02-08 Niels Möller <nisse@lysator.liu.se>
+
+ * doc/gmp.texi (mpz_gcdext): Clarified corner cases in cofactor
+ canonicalization.
+
+2012-02-07 Niels Möller <nisse@lysator.liu.se>
+
+ * mpn/generic/gcdext.c (mpn_gcdext): Fixed assert, related to the
+ special case A = (2k+1) G, B = 2 G. Fix copied from gmp-5.0 repo.
+
+2012-02-06 Niels Möller <nisse@lysator.liu.se>
+
+ * mpn/generic/hgcd_matrix.c (hgcd_matrix_update_q): Fixed carry
+ handling bug. Fix copied from gmp-5.0 repo, where the function is
+ found in hgcd.c.
+
+ * tests/mpz/t-gcd.c (main): Use mpz_rrandomb for test operands,
+ not mpz_urandomb. Change copied from gmp-5.0 repo.
+ * tests/mpn/t-hgcd.c (main): Likewise.
+
+2012-02-04 Marco Bodrato <bodrato@mail.dm.unipi.it>
+
+ * tests/refmpn.c (refmpn_mul): More conservative allocations.
+
+2012-02-03 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/x86_64/bd1/gmp-mparam.h: New file.
+
+ * longlong.h (udiv_qrnnd from sdiv_qrnnd): Declare udiv_w_sdiv.
+
+ * mpn/generic/udiv_w_sdiv.c: Use c89 function header.
+
+2012-02-03 Marco Bodrato <bodrato@mail.dm.unipi.it>
+
+ * mpz/fac_ui.c: mpz_oddfac_1 removed, with many related functions.
+ * mpz/oddfac_1.c: New file, mpz_oddfac_1 implementation.
+ * gmp-impl.h: mpz_oddfac_1 declaration.
+ * Makefile.am (MPZ_OBJECTS): add mpz/oddfac_1$U.lo .
+ * mpz/Makefile.am (libmpz_la_SOURCES): add oddfac_1.c .
+ * tune/Makefile.am (fac_ui.c): include mpz/oddfac_1.c .
+
+2012-02-02 Marco Bodrato <bodrato@mail.dm.unipi.it>
+
+ * mpn/generic/toom_interpolate_16pts.c: Correct an unlikely 32-bit bug.
+
+2012-02-02 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/generic/toom63_mul.c: Allow s+t==n by adjusting an ASSERT.
+ * mpn/generic/toom_interpolate_8pts.c: Perform final incr iff s+t!=n.
+
+ * tests/mpn/t-toom6h.c (MIN_BN): Make more consistent with ASSERT in
+ tested function.
+
+2012-02-01 Torbjorn Granlund <tege@gmplib.org>
+
+ * tests/mpn/t-mul.c: New file.
+ * tests/mpn/Makefile.am: Compile it.
+
+2012-02-01 Marc Glisse <marc.glisse@inria.fr>
+
+ * gmpxx.h: Remove check for g++ older than 2.91.
+
+2012-02-01 Niels Möller <nisse@lysator.liu.se>
+
+ * mpn/generic/mul.c: Added diagram on where toom functions can be
+ called.
+
+2012-02-01 Marc Glisse <marc.glisse@inria.fr>
+
+ * gmpxx.h (__gmp_unary_expr): Make the constructor explicit.
+ (__gmp_expr(__gmp_expr&&)): New move constructors.
+ (__gmp_expr::operator=(__gmp_expr&&)): New move assignments.
+ (swap): Mark as noexcept.
+ (__GMPXX_USE_CXX11): New macro.
+ (__GMPXX_NOEXCEPT): New macro.
+ * tests/cxx/t-cxx11.cc: New file.
+ * tests/cxx/Makefile.am: Added t-cxx11.
+
+2012-01-31 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/generic/powm_sec.c (SQR_BASECASE_LIM): New name for
+ SQR_BASECASE_MAX.
+ (SQR_BASECASE_LIM, fat variant): Define to read __gmpn_cpuvec.
+ (SQR_BASECASE_LIM, native variant): Define to SQR_TOOM2_THRESHOLD
+ straight, without arithmetic.
+ (mpn_local_sqr): Use BELOW_THRESHOLD as per Marco's suggestion.
+
+2012-01-30 Torbjorn Granlund <tege@gmplib.org>
+
+ * tests/mpz/t-powm.c: Ensure all sizes are seen.
+
+2012-01-30 Marc Glisse <marc.glisse@inria.fr>
+
+ * gmpxx.h (__gmp_binary_expr): Let things happen in place: d=a+b+c
+ when d != c.
+ * tests/cxx/t-binary.cc: Test variable reuse: c=a+b+c.
+
+2012-01-28 Marc Glisse <marc.glisse@inria.fr>
+
+ * gmpxx.h: Don't compute -LONG_MIN.
+
+ * doc/gmp.texi (gmp_randclass::get_z_bits): Use mp_bitcnt_t.
+ * gmpxx.h: Replace unsigned long with mp_bitcnt_t.
+
+2012-01-27 Torbjorn Granlund <tege@gmplib.org>
+
+ * Upgrade to libtool 2.4.2.
+
+2012-01-26 Marco Bodrato <bodrato@mail.dm.unipi.it>
+
+ * tests/mpz/t-fac_ui.c: Increase default test cases.
+
+ * mpz/prodlimbs.c: New file, mpz_prodlimbs implementation.
+ * gmp-impl.h: mpz_prodlimbs declaration.
+ * Makefile.am (MPZ_OBJECTS): add mpz/prodlimbs$U.lo .
+ * mpz/Makefile.am (libmpz_la_SOURCES): add prodlimbs.c .
+ (fac_ui.h): remove target (moved up one directory).
+ * mpz/fac_ui.c: mpz_prodlimbs removed, micro-optimisations.
+
+2012-01-25 Torbjorn Granlund <tege@gmplib.org>
+
+ * tune/tuneup.c: Remove unused tuneup variables.
+
+2012-01-20 Marco Bodrato <bodrato@mail.dm.unipi.it>
+
+ * mpz/fac_ui.c: Reduce branches in basecases.
+
+2012-01-18 Marc Glisse <marc.glisse@inria.fr>
+
+ * doc/gmp.texi (mpf_class::mpf_class): Use mp_bitcnt_t.
+
+2012-01-17 Torbjorn Granlund <tege@gmplib.org>
+
+ * configure.in: Add ultrasparc T4 support.
+
+ * demos/isprime.c (main): Run 25 millerrabin tests.
+
+2012-01-16 Marco Bodrato <bodrato@mail.dm.unipi.it>
+
+ * mpz/fac_ui.c (SIEVE_SEED): Define value for small limb size.
+ (mpz_oddswing_1): Reduce the number of divisions.
+ (mpz_oddfac_1): Reduce memory usage.
+ * mpn/minithres/gmp-mparam.h: Correct minimum for FAC_DSC_.
+ * tune/tuneup.c (tune_fac_ui): Likewise.
+
+2012-01-15 Niels Möller <nisse@lysator.liu.se>
+
+ * mpz/scan0.c (mpz_scan0): Use ~(mp_bitcnt_t) 0, rather than
+ ULONG_MAX, when returning "infinity".
+ * mpz/scan1.c (mpz_scan1): Likewise.
+
+2012-01-12 Torbjorn Granlund <tege@gmplib.org>
+
+ * tests/t-popc.c: Test longer bit strings.
+
+2012-01-12 Marco Bodrato <bodrato@mail.dm.unipi.it>
+
+ * mpz/divexact.c: Tight realloc, delayed if variables are reused.
+ * mpz/lcm.c: Smaller temp space, avoid goto.
+ * gmp-impl.h (popc_limb): avoid double & (for 8-bits limb).
+
+2012-01-10 Marco Bodrato <bodrato@mail.dm.unipi.it>
+
+ * mpn/minithres/gmp-mparam.h: New FAC_ODD_ and FAC_DSC_ thresholds.
+ * tune/tuneup.c (tune_fac_ui): Correct minimum for FAC_DSC_.
+
+2012-01-07 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpz/mul_2exp.c: Rewrite.
+ * mpz/tdiv_q_2exp.c: Rewrite.
+
+2012-01-05 Marco Bodrato <bodrato@mail.dm.unipi.it>
+
+ * gen-fac_ui.c: Remove currently unused constants; add new odd
+ double factorial table.
+ * mpz/fac_ui.c (RECURSIVE_PROD_THRESHOLD): Increase default.
+ (mpz_oddfac_1): New function: a merge of _bc_odd and _dsc_odd.
+ (mpz_prodlimbs): More in-place computations.
+
+ * tune/tuneup.c (tune_fac_ui): min_is_always for FAC_ODD_.
+
+2012-01-02 Marco Bodrato <bodrato@mail.dm.unipi.it>
+
+ * tune/tuneup.c (tune_fac_ui): Compute FAC_DSC before FAC_ODD.
+
+2011-12-31 Torbjorn Granlund <tege@gmplib.org>
+
+ * Makefile.am (fac_ui.h): Put file in top-level dir, not in mpz.
+
+2011-12-31 Marco Bodrato <bodrato@mail.dm.unipi.it>
+
+ * tune/Makefile.am (fac_ui.c): New target.
+ (nodist_tuneup_SOURCES,CLEANFILES): Add fac_ui.c.
+ * tune/tuneup.c (mpz_fac_ui_tune): Declare prototype.
+ (fac_odd_threshold,fac_dsc_threshold): New global variables.
+ (speed_mpz_fac_ui_tune,tune_fac_ui): New functions.
+ (all): Call tune_fac_ui.
+ * gmp-impl.h (FAC_ODD_THRESHOLD,FAC_DSC_THRESHOLD):
+ New thresholds: default values, and setup for tuning.
+ (FAC_DSC_THRESHOLD_LIMIT): Define (when tuning).
+ * mpz/fac_ui.c (FAC_ODD_THRESHOLD,FAC_DSC_THRESHOLD):
+ Default values removed.
+
+2011-12-30 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpz/hamdist.c: Fix typo in a return statement.
+
+ * mpn/generic/powm_sec.c (SQR_BASECASE_MAX): Set safely from
+ SQR_TOOM2_THRESHOLD.
+
+2011-12-17 Torbjorn Granlund <tege@gmplib.org>
+
+ * tests/mpz/t-perfpow.c: Decrease default # of tests.
+
+2011-12-16 Torbjorn Granlund <tege@gmplib.org>
+
+ * tests/refmpn.c (AORS_1): Fix typo in variable type.
+
+2011-12-10 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/generic/sbpi1_bdiv_q.c: Delay quotient limb stores in order to
+ allow quotient and dividend to completely overlap.
+ * mpn/generic/sbpi1_bdiv_qr.c: Likewise.
+
+2011-12-10 Marco Bodrato <bodrato@mail.dm.unipi.it>
+
+ * mpz/fac_ui.c: fac_bc_ui inlined in fac_ui.
+
+2011-12-08 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/generic/powm_sec.c: Handle fat binaries better.
+
+ * mpz/fac_ui.c (mpz_bc_fac_1): Fix typo in allocation size.
+
+ * mpn/x86/fat/com.c: New file.
+
+ * mpn/x86_64/pentium4/aors_n.asm: Make it actually work for DOS64.
+ * mpn/x86_64/pentium4/rsh1aors_n.asm: Conditionalise jump on DOS64
+ to avoid overhead for standard ABIs.
+
+ * mpn/x86_64/gcd_1.asm: Support DOS64.
+
+2011-12-07 Torbjorn Granlund <tege@gmplib.org>
+
+ * configure.in: Fix typo making HAVE_NATIVE_mpn_X fail for fat
+ functions.
+
+ * mpn/x86_64/fat/fat.c (__gmpn_cpuvec_init): Add a missing break.
+
+2011-12-07 Marco Bodrato <bodrato@mail.dm.unipi.it>
+
+ * gen-fac_ui.c: Generate two more tables: odd factorial, swing.
+
+ * mpz/fac_ui.c: Rewrite.
+
+2011-12-06 Niels Möller <nisse@lysator.liu.se>
+
+ * mpn/generic/hgcd.c (mpn_hgcd): Use hgcd_reduce for first
+ recursive call.
+
+2011-12-06 Torbjorn Granlund <tege@gmplib.org>
+
+ * tune/mod_1_1-1.c: Redefine the mpn_ functions, not __gmpn_ (for the
+ benefit of fat builds).
+ * tune/mod_1_1-2.c: Likewise.
+
+2011-12-05 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/x86/fat/lshiftc.c: New file.
+ * mpn/x86/fat/mod_1_1.c: New file.
+ * mpn/x86/fat/mod_1_2.c: New file.
+ * mpn/x86/fat/mod_1_4.c: New file.
+
+ * mpn/x86/fat/diveby3.c: Remove no longer fat function.
+ * mpn/x86_64/fat/diveby3.c: Likewise.
+
+ * mpn/x86_64/fat/gcd_1.c: Remove since always provided as asm.
+ * mpn/x86_64/fat/mode1o.c: Likewise.
+
+ * configure.in (fat_functions): Update to more relevant function set.
+ Add special handling for mod_1_N_cps functions.
+ * gmp-impl.h (struct cpuvec_t) : Corresponding changes. Also add
+ vrious declarations for new functions.
+ * mpn/x86/x86-defs.m4 (CPUVEC_FUNCS_LIST): Corresponding changes.
+ * mpn/x86_64/x86_64-defs.m4 (CPUVEC_FUNCS_LIST): Corresponding changes.
+ * mpn/x86/fat/fat.c (__gmpn_cpuvec): Corresponding changes.
+ * mpn/x86_64/fat/fat.c (__gmpn_cpuvec): Corresponding changes.
+
+ * mpn/x86_64: Port most remaining x86_64 files to DOS64.
+
+ * mpn/x86_64/coreisbr/aors_n.asm: Add forgotten DOS64_EXIT.
+
+ * mpn/x86_64/x86_64-defs.m4 (LEA): Handle non-PIC code.
+ * mpn/x86_64/darwin.m4 (LEA): Likewise.
+
+2011-12-04 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/x86_64/fat/fat.c (MAKE_FMS): Rewrite to handle modern CPUs.
+ * mpn/x86/fat/fat.c (MAKE_FMS): Likewise.
+
+ * mpn/x86_64/darwin.m4 (PROTECT): Define to potentially useful value.
+
+2011-12-02 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/x86_64/invert_limb_table.asm: Use PROTECT.
+ * mpn/x86_64/invert_limb.asm: Likewise.
+
+ * mpn/x86_64/darwin.m4 (PROTECT, IFELF): New defines.
+ * mpn/x86_64/dos64.m4 (PROTECT, IFELF): New defines.
+ * mpn/x86_64/x86_64-defs.m4 (PROTECT, IFELF): New defines.
+
+2011-12-01 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/x86_64/fat/fat.c: Copy fake cpuid code from x86/fat/fat.c.
+
+ * mpn/x86_64 (STD64, IFSTD): New names for ELF64, IFELF (since these
+ denote all standard calling conventions).
+
+ * mpn/x86_64: Add DOS64 ABI support to more files.
+
+ * mpn/x86_64/mod_1_1.asm: Finish DOS64 support.
+ * mpn/x86_64/mod_1_2.asm: Likewise.
+ * mpn/x86_64/mod_1_4.asm: Likewise.
+
+ * configure.in: Add GMP_NONSTD_ABI also for fat builds.
+
+ * mpn/x86_64/fat/fat_entry.asm: Rewrite to support DOS64.
+
+ * mpn/x86_64/dos64.m4 (IFDOS, IFSTD): New defines.
+ * mpn/x86_64/x86_64-defs (IFDOS, IFSTD): New defines.
+
+ * mpn/x86_64/dive_1.asm: Add DOS64 ABI support.
+ * mpn/x86_64/mode1o.asm: Likewise.
+
+ * mpn/x86_64/mod_34lsub1.asm: Enable for DOS64.
+
+ * mpn/x86_64/invert_limb.asm: Wrap .protected decl.
+
+ * gmp-impl.h (DECL_divexact_1): Fix typo in return type.
+
+ * mpn/x86_64/dos64.m4 (LEA): New define.
+ (PIC): Define.
+
+2011-11-29 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/x86_64: Add DOS64 ABI support to most files.
+
+2011-11-28 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/x86_64/mul_basecase.asm: Support ABI DOS64.
+ * mpn/x86_64/sqr_basecase.asm: Support ABI DOS64.
+ * mpn/x86_64/aorsmul_1.asm: Support ABI DOS64.
+ * mpn/x86_64/mul_1.asm: Support ABI DOS64.
+
+ * mpn/x86_64/x86_64-defs.m4 (DOS64_ENTRY, DOS64_EXIT): New, empty defs.
+
+ * mpn/x86_64/dos64.m4: New file.
+
+ * mpn/asm-defs.m4 (ABI_SUPPORT): New dummy macro.
+
+ * configure.in (64-bit mingw/cygwin): Define HOST_DOS64,GMP_NONSTD_ABI.
+ No longer clear out path_64.
+ (mpn code selection loop): Handle GMP_NONSTD_ABI.
+
+ * mpn/generic/udiv_w_sdiv.c: Use CNST_LIMB for some constants.
+
+2011-11-25 Torbjorn Granlund <tege@gmplib.org>
+
+ * x86/*: Many new gmp-mparam.h file for 64-bit CPUs in 32-bit mode.
+
+ * configure.in: Overhaul x86/x86_64 support, merging three case
+ statements into one.
+
+2011-11-24 Torbjorn Granlund <tege@gmplib.org>
+
+ * doc/gmp.texi (Formatted Output Strings): Clarify rules for mpf_t
+ precision.
+
+ * mpn/powerpc32/p7/gmp-mparam.h: New file.
+
+ * tune/tuneup.c (tune_mu_div, tune_mu_bdiv): Up min_size to karatsuba's
+ threshold.
+
+2011-11-22 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/powerpc64/mode64/p6/aorsmul_1.asm: New file.
+
+ * configure.in: Don't fail fat builds under 64-bit DOS.
+
+ * mpn/powerpc64/mode64/aors_n.asm: Align loop for slightly better
+ power5 performance.
+
+2011-11-21 Torbjorn Granlund <tege@gmplib.org>
+
+ * gmp-h.in (__GNU_MP_RELEASE): Renamed from typo name.
+
+2011-11-20 Torbjorn Granlund <tege@gmplib.org>
+
+ * configure.in: Split x86 CPUs into more subtypes for more accurate
+ passing of gcc flags.
+
+ * mpn/powerpc32/p3-p7/aors_n.asm: New file.
+
+ * configure.in: Pass -m32 for powerpc64 with abi=32, using via _maybe
+ mechanism.
+
+ * configure.in: Support powerpc32/p3-p7 directory for affected CPUs.
+
+2011-11-17 Torbjorn Granlund <tege@gmplib.org>
+
+ * tune/speed.c (routine): Add mpn_tabselect.
+ * tune/common.c (speed_mpn_tabselect): New function.
+ * tune/speed.h (SPEED_ROUTINE_MPN_COPY_CALL): New macro, made from
+ old SPEED_ROUTINE_MPN_COPY.
+ (SPEED_ROUTINE_MPN_COPY): Just invoke SPEED_ROUTINE_MPN_COPY_CALL.
+ (SPEED_ROUTINE_MPN_TABSELECT): New macro.
+
+2011-11-17 Niels Möller <nisse@lysator.liu.se>
+
+ * tune/tuneup.c (tune_hgcd_appr): Increase stop_since_change.
+
+2011-11-16 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/powerpc32/tabselect.asm: New file.
+
+ * mpn/powerpc64/mode64/aorscnd_n.asm: New file.
+
+2011-11-15 Niels Möller <nisse@lysator.liu.se>
+
+ * tune/speed.h (speed_mpn_hgcd_appr_lehmer): New prototype.
+ (mpn_hgcd_lehmer_itch): Likewise.
+ (mpn_hgcd_appr_lehmer): Likewise.
+ (mpn_hgcd_appr_lehmer_itch): Likewise.
+ (MPN_HGCD_LEHMER_ITCH): Deleted macro.
+
+ * tune/speed.c (routine): Added mpn_hgcd_appr_lehmer.
+
+ * tune/common.c (speed_mpn_hgcd_lehmer): Use mpn_hgcd_lehmer_itch
+ rather than similarly named macro.
+ (speed_mpn_hgcd_appr_lehmer): New function.
+
+ * tune/Makefile.am (libspeed_la_SOURCES): Added
+ hgcd_appr_lehmer.c.
+
+ * tune/hgcd_appr_lehmer.c: New file.
+
+ * tune/tuneup.c (tune_hgcd_appr): Increased min_size to 50; some
+ machines got small thresholds which appear to be bogus.
+
+2011-11-15 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/generic/powm_sec.c (mpn_local_sqr): Remove forgotten TMP_* calls.
+ (redcify): Likewise.
+ (mpn_powm_sec): Likewise.
+
+ * mpn/generic/powm_sec.c (mpn_powm_sec): Rework scratch usage
+ (mpn_powm_sec_itch): Rewrite.
+
+ * mpn/generic/powm_sec.c (mpn_powm_sec): Use mpn_tabselect also in
+ initialisation.
+
+ * configure.in: Amend 2011-11-03 gcc_cflags change.
+
+ * mpn/powerpc64/tabselect.asm: New file.
+ * mpn/x86_64/tabselect.asm: New file.
+ * mpn/x86/tabselect.asm: New file.
+ * mpn/ia64/tabselect.asm: New file.
+
+ * mpn/asm-defs.m4 (define_mpn): Add tabselect.
+
+ * configure.in (gmp_mpn_functions): Add tabselect.
+ (HAVE_NATIVE): Add entries for addncd_n, subcnd_n, tabselect.
+
+ * mpn/generic/powm_sec.c: Remove mpn_tabselect implementation.
+ * mpn/generic/tabselect.c: New file with removed code.
+
+2011-11-13 Torbjorn Granlund <tege@gmplib.org>
+
+ * tune/Makefile.am (TUNE_MPN_SRCS_BASIC): Add powm_sec.c.
+
+ * mpn/generic/powm_sec.c (win_size): Use POWM_SEC_TABLE
+ (POWM_SEC_TABLE): Define default.
+
+ * tune/tuneup.c (tune_powm_sec): New function computing POWM_SEC_TABLE.
+ (all): Call new function.
+
+ * mpn/generic/powm_sec.c (win_size): Define only when
+ TUNE_PROGRAM_BUILD is not set.
+
+2011-11-13 Niels Möller <nisse@lysator.liu.se>
+
+ * tune/tuneup.c (tune_hgcd_appr): Use default min_size.
+ (tune_hgcd_reduce): Increase max_size and step_factor, to 7000
+ and 0.04, respectively.
+
+2011-11-11 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/powerpc64/mode64/sqr_diag_addlsh1.asm: Remove.
+
+2011-11-11 Niels Möller <nisse@lysator.liu.se>
+
+ * tune/hgcd_reduce_2.c: New file.
+ * tune/hgcd_reduce_1.c: New file.
+
+ * tune/tuneup.c (hgcd_appr_threshold): New threshold variable.
+ (hgcd_reduce_threshold): Likewise.
+ (tune_hgcd_appr): New function.
+ (tune_hgcd_reduce): New function.
+ (all): Call tune_hgcd_appr and tune_hgcd_reduce.
+
+ * tune/speed.h (speed_mpn_hgcd_reduce): Declaration.
+ (speed_mpn_hgcd_reduce_[12]): Likewise.
+ (mpn_hgcd_reduce_[12]): Likewise.
+ (SPEED_ROUTINE_MPN_HGCD_REDUCE_CALL): New macro.
+
+ * tune/speed.c (routine): Added mpn_hgcd_reduce,
+ mpn_hgcd_reduce_1, and mpn_hgcd_reduce_2.
+
+ * tune/common.c (speed_mpn_hgcd_reduce): New function.
+ (speed_mpn_hgcd_reduce_[12]): Likewise.
+
+ * tune/Makefile.am (libspeed_la_SOURCES): Added hgcd_reduce_1.c
+ hgcd_reduce_2.c.
+ (TUNE_MPN_SRCS_BASIC): Added hgcd_appr.c and hgcd_reduce.c.
+
+ * mpn/generic/hgcd_appr.c (submul, hgcd_matrix_apply): Deleted
+ functions, earlier copied to hgcd_reduce.c.
+ (mpn_hgcd_appr): Use hgcd_reduce.
+
+2011-11-09 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/powerpc64/mode64/sqr_basecase.asm: New file.
+
+ * mpn/x86_64/aorscnd_n.asm: New file.
+
+ * tune/speed.c (routine): Add measuring of mpn_addcnd_n, mpn_subcnd_n.
+ * tune/common.c (speed_mpn_addcnd_n,speed_mpn_subcnd_n): New functions.
+ * tune/speed.h: Declare them.
+
+ * tests/devel/try.c: Add tests for mpn_addcnd_n and mpn_subcnd_n.
+ * tests/refmpn.c (refmpn_addcnd_n, refmpn_subcnd_n): New functions.
+ * tests/tests.h: Declare them.
+
+ * configure.in (gmp_mpn_functions): Add addcnd_n and subcnd_n.
+
+2011-11-07 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/generic/redc_1.c: Just reduce U operand using Hensel norm, but
+ not fully canonically; leave add_n and conditional sub_n to caller.
+ Therefore omit R argument.
+
+ * mpn/generic/redc_1_sec.c: Remove.
+
+ * gmp-impl.h (mpn_redc_1): Update declaration.
+ (mpn_redc_1_sec): Remove declaration.
+
+ * configure.in (gmp_mpn_functions): Remove redc_1.
+
+ * mpn/x86_64/redc_1.asm: Adopt to new defined functionality/interface.
+ * tune/speed.h (SPEED_ROUTINE_REDC_1): Likewise.
+
+ * tests/refmpn.c (refmpn_redc_1): Likewise; also call refmpn_addmul_1
+ instead of mpn_addmul_1.
+
+ * mpn/generic/powm.c (MPN_REDC_1): New macro, use for mpn_redc_1.
+ * mpn/generic/powm_sec.c (MPN_REDC_1_SEC): New macro, use for
+ mpn_redc_1_sec.
+
+2011-11-03 Torbjorn Granlund <tege@gmplib.org>
+
+ * dumbmp.c (mpz_sub): Abort for non-handled case.
+
+ * mpn/powerpc64/mode64/lshiftc.asm: Move file from here...
+ * mpn/powerpc64/lshiftc.asm: ...to here, with trivial modifications.
+
+ * configure.in: Pass -m32 in more cases, using _maybe mechanism.
+ Inherit default gcc_cflags in more places.
+
+ * mpn/powerpc64/mode64/p7/gmp-mparam.h: New file.
+
+2011-11-02 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/s390_64/invert_limb.asm: Slight optimisation.
+
+ * configure.in (s390): Set gcc_32_cflags_maybe.
+
+ * mpn/s390_32/gmp-mparam.h: Put in proper data.
+ * mpn/s390_32/esame/gmp-mparam.h: New file.
+
+ * mpn/x86_64/bobcat/gmp-mparam.h: New file.
+
+ * mpn/s390_32/lshift.asm: New file.
+ * mpn/s390_32/rshift.asm: New file.
+ * mpn/s390_32/lshiftc.asm: New file.
+
+2011-10-31 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/powerpc64/sqr_diagonal.asm: Move from here...
+ * mpn/powerpc64/mode32/sqr_diagonal.asm: ...to here.
+
+ * mpn/powerpc64/mode64/sqr_diag_addlsh1.asm: New file.
+
+ * mpn/s390_64/sqr_basecase.asm: Rewrite sqr_diag_addlsh1 code.
+ * mpn/s390_32/esame/sqr_basecase.asm: Likewise.
+
+2011-10-29 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/s390_64/lshift.asm: Complete rewrite.
+ * mpn/s390_64/rshift.asm: Likewise.
+
+ * mpn/s390_64/lshiftc.asm: New file.
+
+2011-10-28 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/s390_32/esame/aors_n.asm: New file, with rewritten add/sub code.
+
+2011-10-27 Torbjorn Granlund <tege@gmplib.org>
+
+ From Per Olofsson:
+ * gmp-impl.h (BSWAP_LIMB): Rename variable to avoid BSWAP_LIMB_FETCH
+ clash.
+
+ * mpn/s390_32/esame/mul_basecase.asm: New file.
+
+ * mpn/s390_32/esame/sqr_basecase.asm: New file.
+
+ * mpn/s390_32/logops_n.asm: New file.
+
+ * mpn/s390_64/logops_n.asm: Fix rp=up code. Remove a leftover insn.
+
+2011-10-26 Niels Möller <nisse@lysator.liu.se>
+
+ * gmp-impl.h (mpn_hgcd_reduce, mpn_hgcd_reduce_itch): Added
+ prototypes.
+ (HGCD_APPR_THRESHOLD): Set up threshold for tuning.
+ (HGCD_REDUCE_THRESHOLD): Likewise.
+
+ * configure.in (gmp_mpn_functions): Added hgcd_reduce.
+
+ * mpn/generic/hgcd_reduce.c: New file.
+
+2011-10-24 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/x86_64/sqr_basecase.asm: Put intermediate result into R, don't
+ allocate any stack space.
+
+2011-10-23 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/s390_64/logops_n.asm: Use nc, oc, xc when possible.
+
+ * tune/common.c (speed_mpn_and_n, speed_mpn_andn_n, etc):
+ Pass correct input args.
+
+ * mpn/s390_64/mod_34lsub1.asm: Use llgfr for zero extensions.
+
+ * mpn/s390_64/mul_basecase.asm: New file.
+
+ * mpn/s390_64/sqr_basecase.asm: New file.
+ * mpn/s390_64/sqr_diag_addlsh1.asm: Removed, lives on in sqr_basecase.
+
+ * mpn/s390_64/bdiv_dbm1c.asm: Shave off 1 c/l.
+
+ * mpn/s390_64/aorrlsh1_n.asm: New file, developed from aorslsh1_n.asm.
+ * mpn/s390_64/sublsh1_n.asm: New file.
+ * mpn/s390_64/aorslsh1_n.asm: Remove file.
+
+2011-10-22 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/s390_64/logops_n.asm: New file.
+
+ * mpn/s390_64/aors_n.asm: New file, with rewritten add/sub code.
+
+2011-10-20 Torbjorn Granlund <tege@gmplib.org>
+
+ * tune/speed.h (SPEED_ROUTINE_MPN_SQR_DIAL_ADDLSH1_CALL): New macro.
+ * tune/common.c (speed_mpn_sqr_diag_addlsh1): New function.
+ * tune/speed.c (routine): Measure mpn_sqr_diag_addlsh1.
+
+ * mpn/s390_64/sqr_diag_addlsh1.asm: Rewrite like s390_32/esame code.
+
+ * mpn/s390_32/esame/sqr_diag_addlsh1.asm: Save just needed registers.
+
+2011-10-19 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/s390_32/esame/add_n.asm: Rewrite, similar to s390_64 code.
+ * mpn/s390_32/esame/add_n.asm: Likewise.
+
+2011-10-17 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/s390_32/esame/aorslsh1_n.asm: New file.
+
+2011-10-16 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/s390_32/esame/sqr_diag_addlsh1.asm: New file.
+
+ * mpn/s390_32/copyi.asm: New file.
+ * mpn/s390_32/copyd.asm: New file.
+
+ * mpn/s390_64/copyd.asm: Optimise.
+
+ * mpn/s390_64/copyi.asm: Rewrite along the lines of glibc memcpy.
+
+ * mpn/s390_64/aorslsh1_n.asm: New file.
+
+ * mpn/s390_64/mod_34lsub1.asm: New file.
+
+ * mpn/s390_64/sqr_diag_addlsh1.asm: New file.
+
+2011-10-15 Torbjorn Granlund <tege@gmplib.org>
+
+ * configure.in (s390): Rewrite support to handle known CPUs.
+ * config.guess: Recognise s390 CPUs.
+ * config.sub: Match s390 CPUs.
+ * acinclude.m4 (S390_PATTERN, S390X_PATTERN): New defines.
+
+2011-10-14 Torbjorn Granlund <tege@gmplib.org>
+
+ From Per Olofsson:
+ * mpn/generic/popham.c: Add __GMP_NOTHROW to make it match gmp.h.
+ * mpn/generic/gcd_1.c: Separate declarations and initialisers for the
+ benefit of C++.
+
+ * configure.in: AC_DEFINE HAVE_HOST_CPU_s390_zarch.
+ * longlong.h (s390): Use it.
+ (s390 umul_ppmm): Fix typo in pure C variant.
+
+2011-10-13 Torbjorn Granlund <tege@gmplib.org>
+
+ * longlong.h (s390): Put back an accidentally deleted #else.
+
+ * configure.in (s390): Unset extra_functions for s390x.
+
+2011-10-12 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/s390_64/lshift.asm: Reduce register usage.
+ * mpn/s390_64/rshift.asm: Likewise.
+
+ * longlong.h (s390 umul_ppmm): With new-enough gcc, avoid asm.
+
+ From Andreas Krebbel:
+ * longlong.h (s390 umul_ppmm): Support 32-bit limbs with gcc using
+ 64-bit registers.
+ (s390 udiv_qrnnd): Likewise.
+
+2011-10-11 Torbjorn Granlund <tege@gmplib.org>
+
+ * configure.in (s390x): Pass -mzarch to gcc in 32-bit mode.
+
+ * longlong.h (s390x): Add __CLOBBER_CC for relevant asm patterns.
+ * mpn/generic/mod_1_1.c (s390x add_mssaaaa): Likewise.
+
+ * mpn/s390_64/copyd.asm: New file.
+
+2011-10-10 Niels Möller <nisse@lysator.liu.se>
+
+ * mpn/generic/hgcd_appr.c: Deleted debugging code.
+
+ * tests/mpn/t-hgcd_appr.c (main): Added -v flag.
+ (hgcd_appr_valid_p): Increased margin of non-minimality for
+ divide-and-conquer algorithm. Display bit counts only if
+ -v is used.
+
+ * mpn/generic/hgcd_appr.c (submul): New (static) function.
+ (hgcd_matrix_apply): New function.
+ (mpn_hgcd_appr_itch): Account for divide-and-conquer algorithm.
+ (mpn_hgcd_appr): Implemented divide-and-conquer.
+
+2011-10-10 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/generic/mod_1_1.c (add_mssaaaa): Add s390x variant. Put arm code
+ inside __GNUC__.
+
+ * tune/time.c (STCK): Use proper memory constraint.
+
+ From Marco Trudel:
+ * tests/mpz/t-scan.c (check_ref): Fix loop end bound.
+
+2011-10-10 Niels Möller <nisse@lysator.liu.se>
+
+ * gmp-impl.h: (HGCD_APPR_THRESHOLD): New threshold.
+
+ * mpn/generic/hgcd_appr.c (mpn_hgcd_appr): Interface change.
+ Destroy inputs, let caller make working copies if needed.
+ (mpn_hgcd_appr_itch): Reduced scratch need.
+ * gmp-impl.h: Updated mpn_hgcd_appr prototype.
+ * tests/mpn/t-hgcd_appr.c (one_test): Make working copies for
+ hgcd_appr.
+ * tune/common.c (speed_mpn_hgcd_appr): Use SPEED_ROUTINE_MPN_HGCD_CALL.
+ * tune/speed.h (SPEED_ROUTINE_MPN_HGCD_APPR_CALL): Deleted.
+
+2011-10-09 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/s390_64/copyi.asm: New file.
+ * mpn/s390_64/lshift.asm: New file.
+ * mpn/s390_64/rshift.asm: New file.
+
+ * mpn/s390_64/add_n.asm: Rewrite using lmg/stmg.
+ * mpn/s390_64/sub_n.asm: Likewise.
+
+ * mpn/s390_64/invert_limb.asm: Save a callee-saves register less.
+
+ * tune/time.c (getrusage_backwards_p): Properly cast printed values.
+
+ * longlong.h (s390x): Put back UDItype casts to make gcc reloading use
+ right more for constants.
+ (s390x count_leading_zeros): Disable until we support z10 specifically.
+ (s390x add_ssaaaa): Remove algsi/slgsi until we support z10.
+
+2011-10-09 Niels Möller <nisse@lysator.liu.se>
+
+ * mpn/generic/hgcd_matrix.c (mpn_hgcd_matrix_adjust): Declare
+ matrix argument const.
+
+2011-10-08 Niels Möller <nisse@lysator.liu.se>
+
+ * tests/mpn/t-hgcd_appr.c (hgcd_appr_valid_p): Adjusted the
+ allowed margin of non-minimality for hgcd_appr.
+
+ * mpn/generic/hgcd_appr.c (mpn_hgcd_appr): Fixed handling of
+ extra_bits, starting at zero, to ensure that we don't produce too
+ small remainders. Added a final reduction loop when we we
+ otherwise terminate with extra_bits > 0, to make the returned
+ remainders closer to minimal.
+
+2011-10-07 Torbjorn Granlund <tege@gmplib.org>
+
+ * longlong.h (s390): Add 32-bit zarch umul_ppmm and udiv_qrnnd.
+ (s390): Overhaul 32-bit and 64-bit code.
+
+2011-10-07 Niels Möller <nisse@lysator.liu.se>
+
+ * tune/speed.h (speed_mpn_hgcd_appr): New prototype.
+ (SPEED_ROUTINE_MPN_HGCD_APPR_CALL): New macro.
+ * tune/common.c (speed_mpn_hgcd_appr): New function.
+ * tune/speed.c (routine): Added mpn_hgcd_appr.
+
+ * tests/mpn/t-hgcd_appr.c: New file.
+ * tests/mpn/Makefile.am (check_PROGRAMS): Added t-hgcd_appr.
+
+ * configure.in (gmp_mpn_functions): Added hgcd_step and hgcd_appr.
+
+ * gmp-impl.h: Added prototypes for mpn_hgcd_step,
+ mpn_hgcd_appr_itch and mpn_hgcd_appr.
+
+ * mpn/generic/hgcd_appr.c: New file.
+
+ * mpn/generic/hgcd_step.c: New file, extracted from hgcd.c.
+ (mpn_hgcd_step): Renamed, from...
+ * mpn/generic/hgcd.c (hgcd_step): ...old name. Renamed and moved
+ to hgcd_step.c.
+ (hgcd_hook): Also moved to hgcd_step.c.
+ (mpn_hgcd): Updated for hgcd_step renaming.
+
+2011-10-06 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/s390_64/invert_limb.asm: New file.
+
+2011-10-04 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/s390_64/submul_1.asm: New file.
+ * mpn/s390_32/esame/submul_1.asm: New file.
+
+ * mpn/generic/mulmid.c (mpn_mulmid): Move a TMP_DECL to block start.
+
+ * mpn/Makefile.am (TARG_DIST): Add s390_32 and s390_64, remove s390 and
+ z8000x.
+
+ * doc/gmp.texi (Custom Allocation): Rephrase a paragraph.
+
+ * demos/factorize.c: Run 25 Miller-Rabin tests.
+
+ * mpz/nextprime.c: Run 25 mpz_millerrabin tests (was 10).
+
+2011-10-03 Torbjorn Granlund <tege@gmplib.org>
+
+ * configure.in: Support s390x.
+
+ * longlong.h: Add support for 64-bit s390x.
+
+ * mpn/s390_64: New directory.
+ * mpn/s390_64/add_n.asm: New file.
+ * mpn/s390_64/sub_n.asm: New file.
+ * mpn/s390_64/mul_1.asm: New file.
+ * mpn/s390_64/addmul_1.asm: New file.
+ * mpn/s390_64/bdiv_dbm1c.asm: New file.
+ * mpn/s390_64/gmp-mparam.h: New file, taken from x86_64.
+
+ * mpn/s390_32: Directory renamed from mpn/s390.
+ * mpn/s390_32/gmp-mparam.h: New file, taken from x86_64.
+ * mpn/s390_32/esame/add_n.asm: New file.
+ * mpn/s390_32/esame/sub_n.asm: New file.
+ * mpn/s390_32/esame/mul_1.asm: New file.
+ * mpn/s390_32/esame/addmul_1.asm: New file.
+ * mpn/s390_32/esame/bdiv_dbm1c.asm: New file.
+
+2011-10-03 Niels Möller <nisse@lysator.liu.se>
+
+ * tests/mpn/Makefile.am (check_PROGRAMS): Added t-mulmid.
+ * tests/mpn/t-mulmid.c: New file.
+
+ mulmid-related assembly for x86_64, from David Harvey:
+ * mpn/asm-defs.m4 (define_mpn): Added [add,sub]_err[1,2,3]_n and
+ mulmid_basecase. Also use m4_not_for_expansion on the
+ corresponding OPERATION_* symbols.
+ * mpn/x86_64/aors_err1_n.asm: New file.
+ * mpn/x86_64/aors_err2_n.asm: Likewise.
+ * mpn/x86_64/aors_err3_n.asm: Likewise.
+ * mpn/x86_64/mulmid_basecase.asm: Likewise.
+ * mpn/x86_64/core2/aors_err1_n.asm: Likewise.
+ * mpn/x86_64/gmp-mparam.h (MULMID_TOOM42_THRESHOLD): New value.
+ * mpn/x86_64/core2/gmp-mparam.h (MULMID_TOOM42_THRESHOLD): Likewise.
+
+ Tuning of mulmid, from David Harvey:
+ * tune/Makefile.am (TUNE_MPN_SRCS_BASIC): Added mulmid.c
+ mulmid_n.c toom42_mulmid.c.
+ * tune/speed.h: Prototypes for mulmid-related functions.
+ (struct speed_params): Increased max number of sources to 5.
+ (SPEED_ROUTINE_MPN_BINARY_ERR_N_CALL): New macro.
+ (SPEED_ROUTINE_MPN_BINARY_ERR1_N): Likewise.
+ (SPEED_ROUTINE_MPN_BINARY_ERR2_N): Likewise.
+ (SPEED_ROUTINE_MPN_BINARY_ERR3_N): Likewise.
+ (SPEED_ROUTINE_MPN_MULMID): Likewise.
+ (SPEED_ROUTINE_MPN_MULMID_N): Likewise.
+ (SPEED_ROUTINE_MPN_TOOM42_MULMID): Likewise.
+ * tune/common.c (mpn_[add,sub]_err[1,2,3]_n): New functions.
+ (speed_mpn_mulmid_basecase): New function.
+ (speed_mpn_mulmid): New function.
+ (speed_mpn_mulmid_n): New function.
+ (speed_mpn_toom42_mulmid): New function.
+ * tune/speed.c (routine): Added mpn_[add,sub]_err[1,2,3]_n,
+ mpn_mulmid_basecase, mpn_toom42_mulmid, mpn_mulmid_n, and
+ mpn_mulmid.
+ * tune/tuneup.c (mulmid_toom42_threshold): New threshold variable.
+ (tune_mulmid): New function.
+ (all): Call tune_mulmid.
+
+ Testing of mulmid, from David Harvey:
+ * tests/refmpn.c (AORS_ERR1_N): New macro.
+ (refmpn_add_err1_n, refmpn_sub_err1_n): New functions.
+ (AORS_ERR2_N): New macro.
+ (refmpn_add_err2_n, refmpn_sub_err2_n): New functions.
+ (AORS_ERR3_N): New macro.
+ (refmpn_add_err3_n, refmpn_sub_err3_n): New functions.
+ (refmpn_mulmid_basecase): New function.
+ (refmpn_toom42_mulmid): New function, wrapper for
+ refmpn_mulmid_basecase.
+ (refmpn_mulmid_n): Likewise.
+ (refmpn_mulmid): Likewise.
+ * tests/tests.h: Prototypes for new functions.
+ * tests/devel/try.c (NUM_SOURCES): Increased to 5.
+ (struct try_t): Use NUM_SOURCES and NUM_DESTS constants.
+ (SIZE_4, SIZE_6, SIZE_DIFF_PLUS_3, SIZE_ODD): New constants.
+ (OVERLAP_NOT_DST2): New flag.
+ (param_init): New mulmid-related operation types.
+ (mpn_toom42_mulmid_fun): New function.
+ (choice_array): Added mulmid-related entries.
+ (overlap_array): Extended for larger NUM_SOURCES.
+ (OVERLAP_COUNT): Handle OVERLAP_NOT_DST2.
+ (call): Support mulmid-related functions.
+ (pointer_setup): Handle SIZE_4, SIZE_6, and SIZE_DIFF_PLUS_3.
+ (SIZE_ITERATION): Handle SIZE_ODD.
+ (SIZE2_FIRST): Handle SIZE_CEIL_HALF.
+ (SIZE2_LAST): Likewise.
+
+ Implementation of mulmid, from David Harvey:
+ * mpn/generic/add_err1_n.c (mpn_add_err1_n): New file and function.
+ * mpn/generic/add_err2_n.c (mpn_add_err2_n): Likewise.
+ * mpn/generic/add_err3_n.c (mpn_add_err3_n): Likewise.
+ * mpn/generic/sub_err1_n.c (mpn_sub_err1_n): Likewise.
+ * mpn/generic/sub_err2_n.c (mpn_sub_err2_n): Likewise.
+ * mpn/generic/sub_err3_n.c (mpn_sub_err3_n): Likewise.
+ * mpn/generic/mulmid_basecase.c (mpn_mulmid_basecase): Likewise.
+ * mpn/generic/mulmid_n.c (mpn_mulmid_n): Likewise.
+ * mpn/generic/toom42_mulmid.c (mpn_toom42_mulmid): Likewise.
+ * configure.in (gmp_mpn_functions): Added mulmid-related
+ functions.
+ (GMP_MULFUNC_CHOICES): Handle aors_err1_n, aors_err2_n, and
+ aors_err3_n.
+ * gmp-impl.h: Added prototypes for mulmid functions.
+ (MPN_TOOM42_MULMID_MINSIZE): New constant.
+ (MULMID_TOOM42_THRESHOLD): New threshold.
+ (mpn_toom42_mulmid_itch): New macro.
+
+2011-10-03 Niels Möller <nisse@lysator.liu.se>
+
+ * tune/tune-gcd-p.c (main): Fixed broken loop conditions.
+
+2011-09-26 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/sh/sh2/submul_1.asm: Make this old submul_1 implementation
+ actually compute intended function.
+
+ * longlong.h (SH): Recognise predefs for all SH processors as defined
+ by current gcc versions.
+
+2011-09-25 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/sh: Migrate files to '.asm'.
+ * configure.in: Recognise sh3 and sh4.
+
+2011-09-21 Marc Glisse <marc.glisse@inria.fr>
+
+ * gmpxx.h (mpz_class::swap): New function.
+ (mpq_class::swap): Likewise.
+ (mpf_class::swap): Likewise.
+ (swap): New function.
+ * tests/cxx/t-assign.cc: Test the above.
+ * doc/gmp.texi (swap): Document the above.
+
+2011-08-21 Marc Glisse <marc.glisse@inria.fr>
+
+ * tests/cxx/t-ops2.cc: check mul-div by 2.
+
+ * gmpxx.h (__GMPXX_CONSTANT): New macro (__builtin_constant_p).
+ (__gmp_binary_lshift): Move before multiplication. Optimize x << 0.
+ (__gmp_binary_rshift): Move before division. Optimize x >> 0.
+ (__gmp_binary_plus): Optimize x + 0. Rewrite rational + integer.
+ (__gmp_binary_minus): Optimize x - 0 and 0 - x.
+ Rewrite rational - integer.
+ (__gmp_binary_multiplies): Optimize x * 2^n.
+ (__gmp_binary_divides): Optimize x / 2^n.
+ (__gmp_binary_*): Deduplicate code for symmetric operations.
+
+2011-08-18 Torbjorn Granlund <tege@gmplib.org>
+
+ * printf/doprntf.c (__gmp_doprnt_mpf): For DOPRNT_CONV_FIXED, ask for
+ one more digit.
+
+2011-08-17 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpf/sub.c: Fix typo in copy condition. Delay an allocation.
+
+2011-08-12 Torbjorn Granlund <tege@gmplib.org>
+
+ * gmp-impl.h (LIMBS_PER_DIGIT_IN_BASE): Fix typo.
+
+2011-08-10 Torbjorn Granlund <tege@gmplib.org>
+
+ * gmp-impl.h (DIGITS_IN_BASEGT2_FROM_BITS): New.
+ (DIGITS_IN_BASE_FROM_BITS): Compute more accurate result.
+ (MPN_SIZEINBASE): Use DIGITS_IN_BASEGT2_FROM_BITS.
+
+ * tests/rand/t-lc2exp.c (check_bigc): Call abort after reporting error.
+
+2011-08-09 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpz/out_str.c (mpz_out_str): Reinsert accidentally deleted str_size
+ adjustment.
+
+ * gmp-impl.h (DIGITS_IN_BASE_FROM_BITS): Simplify, also avoiding
+ overflow for base 2.
+
+2011-08-07 Torbjorn Granlund <tege@gmplib.org>
+
+ * gmp-impl.h (struct bases): Add log2b and logb2 field, remove
+ chars_per_limb_exactly field.
+ (DIGITS_IN_BASE_FROM_BITS): New.
+ (DIGITS_IN_BASE_PER_LIMB): New.
+ (LIMBS_PER_DIGIT_IN_BASE): New.
+ * gen-bases.c: Generate log2b and logb2 fields; do not generate
+ chars_per_limb_exactly field.
+ * mpf/get_str.c mpf/out_str.c mpf/set_str.c mpn/generic/get_str.c
+ mpn/generic/sizeinbase.c mpq/get_str.c mpz/inp_str.c mpz/out_str.c
+ mpz/set_str.c printf/doprntf.c tune/speed.h tune/tuneup.c:
+ Use new macros.
+
+2011-08-04 Torbjorn Granlund <tege@gmplib.org>
+
+ * dumbmp.c (mpz_root): Reinsert accidentally removed line.
+
+2011-08-03 Torbjorn Granlund <tege@gmplib.org>
+
+ * dumbmp.c (mpz_tdiv_qr): Correctly handle dividend value being equal
+ to divisor value.
+ (mpz_root): Create reasonable starting approximation.
+ (mpz_sqrt): New function.
+ (mpz_mul_2exp): Add faster block shifting code, disabled for now.
+
+2011-07-15 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/arm/invert_limb.asm: Swap around some registers to silence 'as'
+ warnings.
+
+2011-07-14 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/generic/dcpi1_bdiv_q.c (mpn_dcpi1_bdiv_q): Get mpn_sub_1 size
+ argument right.
+
+2011-07-04 Torbjorn Granlund <tege@gmplib.org>
+
+ * tests/misc/t-locale.c: Disable test for mingw.
+
+ * configure.in (x86_64 *-*-mingw*): Handle also cygwin here; clear out
+ extra_functions_64.
+
+2011-07-02 Torbjorn Granlund <tege@gmplib.org>
+
+ * config.guess: Don't print newline in x86 cpuid function.
+ Rewrite x86-64 cpu recognition asm code to work under Windoze.
+
+2011-06-16 Torbjorn Granlund <tege@gmplib.org>
+
+ * acinclude.m4 (GMP_ASM_RODATA): Fix typo in 2011-04-20 change.
+
+ * configure.in: Surround tr ranges with [] for portability.
+
+2011-05-25 Niels Möller <nisse@lysator.liu.se>
+
+ * tune/tune-gcd-p.c (search): New function to search for minimum.
+ (main): Replaced slow linear search.
+
+2011-05-24 Niels Möller <nisse@lysator.liu.se>
+
+ * tune/Makefile.am (EXTRA_PROGRAMS): Added tune-gcd-p. Also added
+ related automake variables.
+
+ * mpn/Makefile.am (tune-gcd-p): Deleted target.
+
+ * tune/tune-gcd-p.c: New file, extracted from mpn/generic/gcd.c
+ and updated.
+ * mpn/generic/gcd.c: Deleted the corresponding code, including
+ main function.
+
+2011-05-23 Niels Möller <nisse@lysator.liu.se>
+
+ * mpz/jacobi.c (mpz_jacobi): Simplified by swapping operands when
+ needed, to get asize >= bsize. Use the reciprocity law generalized
+ to work when one operand is even.
+
+2011-05-22 Niels Möller <nisse@lysator.liu.se>
+
+ * mpz/jacobi.c (mpz_jacobi): Another bugfix for the asize == 1
+ case. Sometimes, powers of two in b were taken into account twice.
+
+2011-05-21 Niels Möller <nisse@lysator.liu.se>
+
+ * mpz/jacobi.c (mpz_jacobi): The handling of asize == 1 was
+ broken. Rewrote it.
+
+ * tests/mpz/t-jac.c (mpz_nextprime_step): Sanity check that prime
+ candidate and step has no common factor.
+ (check_data): Added some test cases related to the asize == 1 case
+ in mpz_jacobi.
+
+2011-05-20 Niels Möller <nisse@lysator.liu.se>
+
+ * gmp-impl.h: Jacobi-related prototypes.
+
+ * configure.in (gmp_mpn_functions): Added jacobi_2, jacobi,
+ hgcd2_jacobi, hgcd_jacobi, and removed jacobi_lehmer.
+
+ * mpz/jacobi.c (STRIP_TWOS): Deleted macro.
+ (mpz_jacobi): Partially rewritten, to no longer makes the A
+ operand odd. Use new mpn_jacobi_n.
+
+ * mpn/generic/jacobi_lehmer.c: Deleted file.
+
+ * mpn/generic/jacobi.c (mpn_jacobi_n): New subquadratic jacobi
+ implementation. Supersedes jacobi_lehmer.c.
+
+ * mpn/generic/hgcd_jacobi.c (mpn_hgcd_jacobi): New file and
+ function. A copy of mpn_hgcd, using mpn_hgcd2_jacobi, and with calls to
+ mpn_jacobi_update when appropriate.
+
+ * mpn/generic/jacobi_2.c (mpn_jacobi_2): New file. Extracted from
+ jacobi_lehmer.c.
+ * mpn/generic/hgcd2_jacobi.c (mpn_hgcd2_jacobi): Likewise.
+
+ * mpn/generic/hgcd.c (hgcd_hook): Avoid using NULL.
+
+2011-05-19 Niels Möller <nisse@lysator.liu.se>
+
+ * tune/hgcd_lehmer.c (__gmpn_hgcd_itch): Don't rename symbols for
+ the functions moved to hgcd_matrix.c.
+
+ * configure.in (gmp_mpn_functions): Added hgcd_matrix.
+
+ * mpn/generic/hgcd.c (hgcd_matrix_update_1): Deleted. Several other
+ helper functions moved to hgcd_matrix.c, see below.
+ (hgcd_hook): New function.
+ (hgcd_step): Simplified, using mpn_gcd_subdiv_step and hgcd_hook.
+
+ * mpn/generic/hgcd_matrix.c: New file.
+ (mpn_hgcd_matrix_init): Moved here, from hgcd.c.
+ (mpn_hgcd_matrix_update_q): Likewise.
+ (mpn_hgcd_matrix_mul_1): Likewise.
+ (mpn_hgcd_matrix_mul): Likewise.
+ (mpn_hgcd_matrix_adjust): Likewise.
+
+ * mpn/generic/gcd_subdiv_step.c (mpn_gcd_subdiv_step): New
+ argument s, for use by hgcd.
+ * gmp-impl.h (mpn_gcd_subdiv_step): Update declaration.
+
+ * mpn/generic/gcd.c (mpn_gcd): Pass s = 0 to mpn_gcd_subdiv_step.
+ * mpn/generic/gcdext.c (mpn_gcdext): Likewise. Also added an ASSERT.
+ * mpn/generic/gcdext_lehmer.c (mpn_gcdext_lehmer_n): Likewise.
+ (mpn_gcdext_hook): Added some ASSERTs.
+ * mpn/generic/jacobi_lehmer.c (mpn_jacobi_lehmer): Likewise.
+
+2011-05-17 Niels Möller <nisse@lysator.liu.se>
+
+ * doc/gmp.texi (mpn_gcd, mpn_gcdext): Document input requirements:
+ Must have un >= vn > 0, and V normalized.
+ * mpn/generic/gcdext.c (mpn_gcdext): Added ASSERT for input
+ normalization.
+ * mpn/generic/gcd.c (mpn_gcd): Added ASSERTs for input
+ requirements.
+
+2011-05-15 Marc Glisse <marc.glisse@inria.fr>
+
+ * gmpxx.h (operator<<): Dedup.
+ * tests/cxx/t-iostream.cc: Test on compound types.
+
+ * gmpxx.h (__gmp_binary_expr): Let things happen in place: c=(a+b)/2.
+
+2011-05-10 Marc Glisse <marc.glisse@inria.fr>
+
+ * gmpxx.h (__gmp_unary_expr): Let things happen in place: c=-(a+b).
+ (operator>>): Clean the commenting out.
+ * tests/cxx/t-iostream.cc: New file.
+ * tests/cxx/Makefile.am: Added t-iostream.
+
+2011-05-10 Niels Möller <nisse@lysator.liu.se>
+
+ * doc/gmp.texi (mpz_gcd): Document that gcd(0,0) = 0.
+ (mpz_gcdext): Document range for cofactors.
+
+2011-05-09 Niels Möller <nisse@lysator.liu.se>
+
+ * mpz/gcdext.c (mpz_gcdext): Increased sp allocation to bsize+1 limbs.
+ * doc/gmp.texi (mpn_gcdext): Fixed documentation of allocation
+ requirements; one extra limb is still needed for S.
+
+2011-05-09 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/x86/fat/gmp-mparam.h (BMOD_1_TO_MOD_1_THRESHOLD): Define.
+ * mpn/x86_64/fat/gmp-mparam.h (BMOD_1_TO_MOD_1_THRESHOLD): Define.
+
+2011-05-08 Marc Glisse <marc.glisse@inria.fr>
+
+ * gmpxx.h: Replace unsigned long with mp_bitcnt_t in many places.
+ * doc/gmp.texi: Likewise.
+
+2011-05-06 Marc Glisse <marc.glisse@inria.fr>
+
+ * gmpxx.h (mpz_class): Make constructor from mp[qf]_class explicit.
+ (mpq_class): Make constructor from mpf_class explicit.
+ * doc/gmp.texi: Document the above.
+ * NEWS: Likewise, and mention the EOF istream fix.
+ * tests/cxx/t-mix.cc: New file.
+ * tests/cxx/Makefile.am: Added t-mix.
+
+ * tests/cxx/t-assign.cc: Minor tweak.
+ * tests/cxx/t-misc.cc: Likewise.
+
+ * gmpxx.h (__gmp_resolve_temp): Remove.
+ (__gmp_set_expr): Remove some overloads.
+ (mpq_class): mpz_init_set the numerator and denominator instead of
+ mpq_init + mpq_set.
+ (mpz_class): Dedup the string constructors.
+ (mpq_class): Likewise.
+
+ * tests/cxx/t-ops3.cc: New file.
+ * tests/cxx/Makefile.am: Added t-ops3.
+
+2011-05-05 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpz/gcdext.c: Correct sgn computation.
+ Use MPZ_REALLOC.
+
+2011-05-05 Marc Glisse <marc.glisse@inria.fr>
+
+ * mpn/x86_64/fat/fat.c: Update for Sandy Bridge.
+ * config.guess: warning to keep it in sync with fat.c.
+
+2011-05-05 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/x86_64/fat/fat_entry.asm (PIC_OR_DARWIN): New symbol. Use it to
+ work around Darwin problems.
+
+2011-05-04 Niels Möller <nisse@lysator.liu.se>
+
+ * mpz/gcdext.c (mpz_gcdext): Reduced temporary allocations. Use
+ mpz_divexact when computing the second cofactor.
+
+2011-05-03 David Harvey <dmharvey@cims.nyu.edu>
+
+ * configure.in: make invert_limb_table work correctly with
+ --disable-assembly (from Niels Möller)
+
+2011-05-02 Marc Glisse <marc.glisse@inria.fr>
+
+ * .bootstrap: libtoolize doesn't need -c.
+
+ * configfsf.guess: Update to version of 2011-02-02.
+ * configfsf.sub: Update to version of 2011-03-23.
+
+2011-05-02 Niels Möller <nisse@lysator.liu.se>
+
+ * mpz/gcdext.c (mpz_gcdext): Don't allocate extra limbs at the end
+ of mpn_gcdext parameters.
+
+ * doc/gmp.texi (mpn_gcdext): Updated doc.
+
+2011-05-01 Niels Möller <nisse@lysator.liu.se>
+
+ * mpn/generic/div_qr_2u_pi1.c (mpn_div_qr_2u_pi1): Fixed ASSERT.
+
+2011-04-30 Marc Glisse <marc.glisse@inria.fr>
+
+ * gmp-h.in (mpz_cdiv_q_2exp): Use mp_bitcnt_t to match the definition
+ and the documentation.
+ (mpz_remove): Likewise.
+ (mpf_eq): Likewise.
+
+ * ltmain.sh: Remove.
+ * .bootstrap: Let libtoolize generate ltmain.sh.
+
+ * tests/cxx/t-ops2.cc: Add a couple tests.
+ * tests/cxx/t-rand.cc: Likewise.
+
+ * doc/gmp.texi (mpf_urandomb): Explicit the fact that it does not
+ change the precision.
+
+ * gmp-h.in (__GMP_EXTERN_INLINE): Recent g++ uses gnu_inline.
+
+2011-04-28 Torbjorn Granlund <tege@gmplib.org>
+
+ * configure.in (x86_64): Support bobcat specifically.
+ (x86): Match bobcat and bulldozer, handle like k10.
+
+2011-04-28 David Harvey <dmharvey@cims.nyu.edu>
+
+ * README.HG: update autotools version numbers.
+
+2011-04-27 Torbjorn Granlund <tege@gmplib.org>
+
+ * tune/speed.h (speed_cyclecounter): Always use PIC variant when
+ compiled with Apple's GCC.
+
+ * mpn/x86/darwin.m4 (LEA): Complete rewrite.
+ (m4append): New macro.
+
+2011-04-26 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/sparc32/sparc-defs.m4 (changecom): Don't redefine '!' as it
+ interferes with expressions.
+
+2011-04-20 Torbjorn Granlund <tege@gmplib.org>
+
+ * acinclude.m4 (GMP_ASM_RODATA): Make 'foo' larger to avoid clang
+ problems.
+
+2011-04-12 Niels Möller <nisse@lysator.liu.se>
+
+ * mpn/x86_64/invert_limb.asm [PIC]: Declare mpn_invert_limb_table
+ as .protected.
+
+2011-04-11 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/x86/k7/invert_limb.asm: Use deflit for Darwin bug workaround.
+ Undo 2011-03-28 change.
+
+ * mpn/asm-defs.m4 (define_mpn): Use deflit.
+
+2011-04-10 Niels Möller <nisse@lysator.liu.se>
+
+ * mpn/asm-defs.m4 (define_mpn): Added invert_limb_table.
+
+ * configure.in: Add invert_limb_table to extra_functions_64 on
+ x86_64.
+
+ * mpn/x86_64/invert_limb.asm: Changed references from approx_tab
+ mpn_invert_limb_table.
+
+ * mpn/x86_64/invert_limb_table.asm (mpn_invert_limb_table): New
+ file. Extracted approximation table from invert_limb.asm, renamed
+ and made global.
+
+2011-03-30 Niels Möller <nisse@lysator.liu.se>
+
+ * mpn/x86_64/div_qr_2u_pi1.asm: New file.
+
+ * configure.in (gmp_mpn_functions): Add div_qr_2u_pi1.
+
+ * gmp-impl.h (mpn_div_qr_2u_pi1): Declare.
+
+ * mpn/generic/div_qr_2u_pi1.c (mpn_div_qr_2u_pi1): Moved to
+ separate file, from...
+ * mpn/generic/div_qr_2.c: ... old location.
+
+ * mpn/generic/div_qr_2n_pi1.c: Renamed file, from...
+ * mpn/generic/div_qr_2_pi1_norm.c: ...old name.
+ * mpn/x86_64/div_qr_2n_pi1.asm: Renamed file, from...
+ * mpn/x86_64/div_qr_2_pi1_norm.asm: ...old name.
+
+ * gmp-impl.h (mpn_div_qr_2n_pi1): Use new name in declaration.
+ * tune/speed.h (speed_mpn_div_qr_2n): Likewise.
+ (speed_mpn_div_qr_2u): Likewise.
+
+ * tune/tuneup.c (tune_div_qr_2): Use new name speed_mpn_div_qr_2n.
+
+ * tune/speed.c (routine): Use new names mpn_div_qr_2n and
+ mpn_div_qr_2u, also on the command line.
+
+ * tune/common.c (speed_mpn_div_qr_2n): Renamed, from...
+ (speed_mpn_div_qr_2_norm): ... old name.
+ (speed_mpn_div_qr_2u): Renamed, from...
+ (speed_mpn_div_qr_2_unnorm): ... old name.
+
+ * mpn/generic/div_qr_2_pi1_norm.c (mpn_div_qr_2n_pi1): Renamed,
+ from...
+ (mpn_div_qr_2_pi1_norm): ...old name.
+ * mpn/x86_64/div_qr_2_pi1_norm.asm: Likewise.
+
+ * mpn/generic/div_qr_2.c (mpn_div_qr_2n_pi2): Renamed, from...
+ (mpn_div_qr_2_pi2_norm): ... old name.
+ (mpn_div_qr_2u_pi1): Renamed, from...
+ (mpn_div_qr_2_pi1_unnorm): ... old name.
+ (mpn_div_qr_2): Call functions using new names.
+
+ * mpn/asm-defs.m4: Renamed div_qr_2-functions to new names.
+
+2011-03-29 Niels Möller <nisse@lysator.liu.se>
+
+ * mpn/x86_64/div_qr_2_pi1_norm.asm: Updated to use a separate rp
+ argument.
+
+ * gmp-impl.h (mpn_div_qr_2_pi1_norm): Updated declaration.
+ * gmp-h.in (mpn_div_qr_2): Likewise.
+
+ * tests/mpn/t-div.c (main): Adapted to new mpn_div_qr2 interface.
+ * tune/speed.h (SPEED_ROUTINE_MPN_DIV_QR_2): Likewise.
+
+ * mpn/generic/div_qr_2.c (mpn_div_qr_2_pi2_norm): Added rp
+ argument. Don't clobber the input dividend.
+ (mpn_div_qr_2_pi1_unnorm): Likewise.
+ (mpn_div_qr_2): Likewise.
+ * mpn/generic/div_qr_2_pi1_norm.c (mpn_div_qr_2_pi1_norm): Likewise.
+
+2011-03-29 Niels Möller <nisse@lysator.liu.se>
+
+ * mpn/x86/k7/invert_limb.asm: Use mov rather than push and pop.
+ Earlier load of divisor from stack.
+
+2011-03-28 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/x86/k7/invert_limb.asm: Protect movzwl register parameters from
+ being interpreted as m4 macro parameters.
+
+2011-03-22 Niels Möller <nisse@lysator.liu.se>
+
+ * mpn/x86_64/div_qr_2_pi1_norm.asm: Copied optimized inner loop
+ from divrem_2.asm.
+
+ * mpn/x86_64/div_qr_2_pi1_norm.asm: First working, but poorly
+ optimized, implementation.
+
+ * mpn/asm-defs.m4 (define_mpn): Added div_qr_2_pi[12]_*norm.
+
+ * mpn/generic/div_qr_2_pi1_norm.c (mpn_div_qr_2_pi1_norm): Moved
+ to separate file, from...
+ * mpn/generic/div_qr_2.c: ... old location.
+
+ * gmp-impl.h (mpn_div_qr_2_pi1_norm): Declare.
+
+ * configure.in (gmp_mpn_functions): Added div_qr_2_pi1_norm.
+
+2011-03-22 Torbjorn Granlund <tege@gmplib.org>
+
+ * configure.in (powerpc): Reinsert lost AIX cpu_path 32-bit handling.
+ Reinsert lost linux/bsd cpu_path handling.
+
+ * mpn/generic/mod_1_1.c: Disable powerpc asm for _LONG_LONG_LIMB.
+ * mpn/generic/div_qr_2.c: Likewise.
+
+ * mpn/generic/div_qr_2.c: Use asm just for gcc.
+ Make powerpc add_sssaaaa work for 32-bit case, and use less strict
+ constraints.
+
+2011-03-21 Niels Möller <nisse@lysator.liu.se>
+
+ * tune/tuneup.c (div_qr_2_pi2_threshold): New global variable.
+ (tune_div_qr_2): New function.
+ (all): Call tune_div_qr_2.
+
+ * tune/Makefile.am (TUNE_MPN_SRCS_BASIC): Added div_qr_2.c.
+
+ * gmp-impl.h (DIV_QR_2_PI2_THRESHOLD): Setup for tuning.
+
+ New 4/2 division loop, based on Torbjörn's work:
+ * mpn/generic/div_qr_2.c (add_sssaaaa, add_csaac): New macros.
+ (udiv_qr_4by2): New macro.
+ (invert_4by2): New function.
+ (mpn_div_qr_2_pi2_norm): New function.
+ (DIV_QR_2_PI2_THRESHOLD): New threshold.
+ (mpn_div_qr_2_pi1_norm): Renamed, from...
+ (mpn_div_qr_2_norm): ... old name.
+ (mpn_div_qr_2_pi1_unnorm): Renamed, from...
+ (mpn_div_qr_2_unnorm): ... old name.
+ (mpn_div_qr_2): Use mpn_div_qr_2_pi2_norm for large enough
+ normalized divisors.
+
+ * gmp-impl.h (udiv_qr_3by2): Avoid a copy.
+
+2011-03-21 Torbjorn Granlund <tege@gmplib.org>
+
+ * configure.in (hppa): Under linux, treat 64-bit processors as if they
+ were 32-bit processors.
+
+ * mpn/generic/addcnd_n.c: New file.
+ * mpn/asm-defs.m4 (define_mpn): Add addcnd_n and subcnd_n.
+ * configure.in (gmp_mpn_functions): Add addcnd_n.
+ * gmp-impl.h (mpn_addcnd_n): Declare.
+
+ * mpn/generic/subcnd_n.c: Combine nails and non-nails functions.
+
+ * gmp-impl.h (invert_pi1): Prepend _ to local variables, protect
+ parameters within () where necessary.
+
+ * mpn/asm-defs.m4 (define_mpn): Add div_qr_2.
+ * configure.in (gmp_mpn_functions): Reinsert mercurial-bug-removed
+ line.
+
+2011-03-20 Torbjorn Granlund <tege@gmplib.org>
+
+ * configure.in (powerpc): Add cpu_path for all three ABIs.
+ Rename "aix64" to "mode64" for consistency.
+
+2011-03-16 Marc Glisse <marc.glisse@inria.fr>
+
+ * gmpxx.h (__gmp_binary_not_equal): Remove, use !__gmp_binary_equal.
+ (__gmp_binary_less_equal): Remove, use !__gmp_binary_greater.
+ (__gmp_binary_greater_equal): Remove, use !__gmp_binary_less.
+ * tests/cxx/t-ops2.cc: Typo.
+
+2011-03-20 Niels Möller <nisse@lysator.liu.se>
+
+ * tune/common.c (speed_mpn_div_qr_2_norm): New function.
+ (speed_mpn_div_qr_2_unnorm): New function.
+ * tune/speed.c (routine): Recognize above functions.
+ * tune/speed.h: Declarations for above functions.
+ (SPEED_ROUTINE_MPN_DIV_QR_2): New macro.
+
+ * tests/mpn/t-div.c (main): Added tests for mpn_divrem_2 and
+ mpn_div_qr_2.
+
+ * mpn/generic/div_qr_2.c (mpn_div_qr_2): New file and function.
+ Intended to eventually replace divrem_2.
+ * configure.in (gmp_mpn_functions): Add div_qr_2.
+
+2011-03-16 Marc Glisse <marc.glisse@inria.fr>
+
+ * gmpxx.h (__gmp_set_expr): Remove broken declarations.
+
+2011-03-19 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpz/fac_ui.c (mpz_fac_ui): Use MPZ_REALLOC for standard, conditional
+ reallocation.
+
+2011-03-19 Niels Möller <nisse@lysator.liu.se>
+
+ * mpn/generic/divrem_2.c (mpn_divrem_2): Fixed comment and assert
+ regarding q and n overlap.
+
+2011-03-16 Marc Glisse <marc.glisse@inria.fr>
+
+ * gmpxx.h (__mpz_set_ui_safe): New inline function.
+ (__mpz_set_si_safe): Likewise.
+ (__GMPXX_TMPZ_UI): Use the new function.
+ (__GMPXX_TMPZ_SI): Likewise.
+ (__GMPXX_TMPQ_UI): Likewise.
+ (__GMPXX_TMPQ_SI): Likewise.
+ * tests/cxx/t-ops2.cc: test converting 0 to stack mpq_t.
+
+2011-03-15 Marc Glisse <marc.glisse@inria.fr>
+
+ * gmpxx.h (__GMPXX_TMPQ_UI): New macro.
+ (__GMPXX_TMPQ_SI): New macro.
+ (struct __gmp_binary_multiplies): Rewrite, using the new macros.
+ (struct __gmp_binary_divides): Likewise.
+
+ * gmpxx.h (__GMPZ_ULI_LIMBS): Rewrite.
+ * tests/cxx/t-ops2.cc: test converting ULONG_MIN to stack mpq_t.
+
+2011-03-15 Marco Bodrato <bodrato@mail.dm.unipi.it>
+
+ * mpn/generic/toom_interpolate_16pts.c: Remove ambiguity.
+
+2011-03-14 Torbjorn Granlund <tege@gmplib.org>
+
+ * tune/tuneup.c (tune_mul): Set tuning min size considering print skew.
+
+ * doc/gmp.texi: Make reference to "Formatted I/O" chapters from type
+ specific I/O sections.
+
+ * mpn/alpha/add_n.asm: Add _nc entry point.
+ * mpn/alpha/sub_n.asm: Likewise.
+ * mpn/mips64/add_n.asm: Likewise.
+ * mpn/mips64/sub_n.asm: Likewise.
+ * mpn/sparc64/ultrasparc1234/add_n.asm: Likewise.
+ * mpn/sparc64/ultrasparc1234/sub_n: Likewise.
+
+2011-03-13 Marc Glisse <marc.glisse@inria.fr>
+
+ * tests/cxx/t-ops2.cc: New file.
+ * tests/cxx/Makefile.am: Added t-ops2.
+
+2011-03-13 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/generic/toom32_mul.c (mpn_toom32_mul): Make 'hi' be limb-sized
+ for better code.
+
+ * gmp-impl.h (MPN_IORD_U): Handle x86_64 as well as x86_32. Generate
+ no code for incrementing by constant 0.
+
+2011-03-12 Marc Glisse <marc.glisse@inria.fr>
+
+ * gmpxx.h: Rename __GMPXX_TMP_* to __GMPXX_TMPZ_*. Use in more places.
+
+2011-03-12 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/powerpc64/rshift.asm: Accept/return values correctly also for
+ 32-bit ABI.
+ * mpn/powerpc64/lshift.asm: Likewise.
+
+ * tune/powerpc.asm: Use powerpc syntax, not power syntax.
+
+ * tune/common.c (speed_udiv_qrnnd_preinv1, etc): Remove.
+ * tune/speed.c (routine): Remove udiv_qrnnd_preinv1, etc.
+
+2011-03-12 Marc Glisse <marc.glisse@inria.fr>
+
+ * tests/cxx/t-istream.cc: Restrict mpq test in t-istream -s.
+
+ * gmpxx.h: Remove leftover #undefs.
+
+2011-03-11 Torbjorn Granlund <tege@gmplib.org>
+
+ * gmp-impl.h (udiv_qrnnd_preinv1, udiv_qrnnd_preinv2,
+ udiv_qrnnd_preinv2gen): Remove obsolete macros.
+ (udiv_qrnnd_preinv): New name for udiv_qrnnd_preinv3.
+
+2011-03-11 Marco Bodrato <bodrato@mail.dm.unipi.it>
+
+ * gmp-impl.h: Declare many mpn_{sub,add}lsh*_n_ip[12] functions/macros.
+ * mpn/generic/toom_interpolate_5pts.c: Use mpn_sublsh1_n_ip1.
+
+ * tests/devel/try.c: Tests for {add,sub}lsh*_n_ip[12].
+ * tests/refmpn.c: New reference for mpn_{add,sub}lsh*_n_ip[12].
+ * tests/tests.h: Declarations for reference functions above.
+
+ * tune/common.c: New speed_mpn_{add,sub}lsh*_n_ip[12] functions.
+ * tune/speed.h: Prototypes for functions above.
+ * tune/speed.c: Support for mpn_{add,sub}lsh*_n_ip[12].
+
+ * mpn/x86/k7/sublsh1_n.asm: Replaced generic sublsh1 code with faster _ip1.
+ * mpn/x86/atom/sublsh1_n.asm: Changed PROLOGUE accordingly.
+
+ * configure.in: Define HAVE_NATIVE_mpn_addlsh*_n*_ip[12].
+ * mpn/asm-defs.m4: Declare mpn_addlsh*_n*_ip[12].
+
+2011-03-10 Marc Glisse <marc.glisse@inria.fr>
+
+ * tests/cxx/t-istream.cc: Explicit conversion to streampos.
+
+2011-03-10 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/x86/atom/sse2/mul_basecase.asm: Suppress wind-down rp updates.
+
+ * Move new aorrlsh_n.asm to new k8 dir. Revert
+ mpn/x86_64/aorrlsh_n.asm.
+ * configure.in: Setup path for new k8 directory.
+
+2011-03-10 Marco Bodrato <bodrato@mail.dm.unipi.it>
+
+ * mpn/x86/pentium4/sse2/bdiv_dbm1c.asm: New file, was in atom.
+ * mpn/x86/atom/sse2/bdiv_dbm1c.asm: Grab file above.
+
+2011-03-09 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/x86_64/aorrlsh_n.asm: Complete rewrite.
+
+ * mpn/x86_64/core2/aorrlsh_n.asm: New file, grabbing another asm file.
+
+2011-03-09 Marc Glisse <marc.glisse@inria.fr>
+
+ * tests/cxx/t-ostream.cc: Use bool instead of int.
+ * tests/cxx/t-istream.cc: Likewise.
+ * tests/cxx/t-misc.cc: Likewise.
+
+ * cxx/ismpznw.cc: Don't clear eofbit.
+ * cxx/ismpq.cc: Likewise.
+ * cxx/ismpf.cc: Likewise.
+ * tests/cxx/t-istream.cc: Test accordingly.
+
+2011-03-09 Marco Bodrato <bodrato@mail.dm.unipi.it>
+
+ * mpn/x86/atom/sse2/bdiv_dbm1c.asm: New file.
+
+2011-03-09 Marc Glisse <marc.glisse@inria.fr>
+
+ * doc/gmp.texi: Remove void return type from constructors. Document
+ explicit constructors. Document mpf_class::mpf_class(mpf_t).
+
+2011-03-07 Marco Bodrato <bodrato@mail.dm.unipi.it>
+
+ * mpn/x86/atom/sse2/sqr_basecase.asm: Postponed pushes. Cleaned
+ outer loop exit.
+
+2011-03-07 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/x86_64/gcd_1.asm: Workaround Oracle assembler bug.
+
+ * mpn/x86/atom/sse2/mul_basecase.asm: Replace addmul_1 loops.
+ Tweak outer loop rp updates.
+
+2011-03-06 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/x86/atom/sse2/sqr_basecase.asm: New file.
+
+2011-03-05 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/x86_64/bdiv_dbm1c.asm: Write proper feed-in code.
+
+2011-03-04 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/x86_64/addmul_2.asm: Rewrite for linear performance.
+
+2011-03-03 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/generic/mod_1_1.c (add_mssaaaa): Canonicalise layout. Add arm
+ variant. Enable sparc64 code and powerpc code (the latter for 32-bit
+ and 64-bit).
+
+ * mpn/generic/sqrtrem.c (mpn_dc_sqrtrem): Use mpn_addlsh1_n.
+
+ * gmp-impl.h (mpn_addlsh_nc, mpn_rsblsh_nc): Declare.
+ * mpn/asm-defs.m4: Likewise.
+
+ * mpn/x86_64/coreisbr/aorrlsh_n.asm: Disable mpn_rsblsh_n due to
+ carry-in issues.
+ * mpn/x86_64/coreinhm/aorrlsh_n.asm: Likewise.
+ * mpn/x86_64/coreisbr/aorrlsh2_n.asm: Likewise.
+
+2011-03-03 Niels Möller <nisse@lysator.liu.se>
+
+ * mpn/generic/mod_1_1.c (add_mssaaaa): For x86 and x86_64, treat m
+ as in output operand only. Added sparc32 implementation. Also
+ added #if:ed out attempts at sparc64 and powerpc64.
+
+ * tune/tuneup.c (tune_mod_1): Record result of MOD_1_1P_METHOD
+ measurement for use by mpn_mod_1_tune. And omit measurement if
+ mpn_mod_1_1p is native assembly code.
+
+ * mpn/generic/mod_1.c (mpn_mod_1_1p) [TUNE_PROGRAM_BUILD]: Macro
+ to check mod_1_1p_method and call the right function.
+ (mpn_mod_1_1p_cps) [TUNE_PROGRAM_BUILD]: Likewise.
+
+ * gmp-impl.h (MOD_1_1P_METHOD) [TUNE_PROGRAM_BUILD]: Define macro.
+ (mod_1_1p_method) [TUNE_PROGRAM_BUILD]: Declare variable.
+
+2011-03-02 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/x86_64/coreinhm/aorrlsh_n.asm: New file.
+ * mpn/x86_64/coreisbr/aorrlsh_n.asm: New file.
+
+2011-03-01 Niels Möller <nisse@lysator.liu.se>
+
+ * mpn/x86_64/mod_1_1.asm (mpn_mod_1_1p_cps): Eliminated a neg and
+ two mov instructions.
+
+ * mpn/x86/k7/mod_1_1.asm (mpn_mod_1_1p_cps): Simplified
+ computation, analogous to recent x86_64/mod_1_1.asm changes.
+ (mpn_mod_1_1p): Corresponding changes. Don't shift b.
+
+ * mpn/sparc64/mod_1_4.c (mpn_mod_1s_4p_cps): Use udiv_rnnd_preinv
+ rather than udiv_rnd_preinv.
+ (mpn_mod_1s_4p): Likewise.
+
+2011-03-01 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/x86/pentium4/sse2/mul_1.asm: Swap entry insns to share more code
+ between entry points.
+ * mpn/x86/pentium4/sse2/addmul_1.asm: Likewise.
+
+ * mpz/divegcd.c: Rewrite, as per Marc Glisse's suggestion. Also fix
+ problem with passing a longlong limb to a _ui function.
+
+ * gmp-impl.h (udiv_qrnnd_preinv3): Cast truth value to mask's type.
+ (udiv_rnnd_preinv): Likewise.
+ * mpn/generic/mod_1_1.c (mpn_mod_1_1p): Likewise.
+
+2011-02-28 Niels Möller <nisse@lysator.liu.se>
+
+ * mpn/generic/mod_1_1.c (add_mssaaaa): Typo fix, define
+ add_mssaaaa, not add_sssaaaa.
+
+ * tune/tuneup.c (tune_mod_1): Measure mpn_mod_1_1_1 and
+ mpn_mod_1_1_2, to set MOD_1_1P_METHOD.
+
+ * tune/speed.c (routine): Added mpn_mod_1_1_1 and mpn_mod_1_1_2.
+
+ * tune/speed.h: Declare speed_mpn_mod_1_1_1, speed_mpn_mod_1_1_2,
+ mpn_mod_1_1p_1, mpn_mod_1_1p_2, mpn_mod_1_1p_cps_1, and
+ mpn_mod_1_1p_cps_2.
+
+ * tune/common.c (speed_mpn_mod_1_1_1): New function.
+ (speed_mpn_mod_1_1_2): New function.
+
+ * tune/Makefile.am (libspeed_la_SOURCES): Added mod_1_1-1.c
+ mod_1_1-2.c.
+
+ * tune/mod_1_1-1.c: New file.
+ * tune/mod_1_1-2.c: New file.
+
+ * mpn/generic/mod_1_1.c: Implemented an algorithm with fewer
+ multiplications, configured via MOD_1_1P_METHOD.
+
+ * mpn/x86_64/mod_1_1.asm (mpn_mod_1_1p_cps): Simplified
+ computation of B2modb, use B^2 mod (normalized b).
+ (mpn_mod_1_1p): Corresponding changes. Don't shift b.
+
+ * mpn/generic/mod_1_1.c (mpn_mod_1_1p_cps): Use udiv_rnnd_preinv rather
+ than udiv_rnd_preinv.
+ (mpn_mod_1_1p): Likewise.
+ * mpn/generic/mod_1_4.c: Analogous changes.
+ * mpn/generic/mod_1_3.c: Analogous changes.
+ * mpn/generic/mod_1_2.c: Analogous changes.
+ * mpn/generic/mod_1.c: Analogous changes.
+ * mpn/generic/pre_mod_1.c: Analogous changes.
+
+ * gmp-impl.h (udiv_qrnnd_preinv3): Eliminated unpredictable branch
+ using masking logic. Further optimization of the nl == constant 0
+ case, similar to udiv_rnd_preinv.
+ (udiv_rnnd_preinv): Likewise.
+ (udiv_rnd_preinv): Deleted, use udiv_rnnd_preinv with nl == 0
+ instead.
+
+ * tests/mpn/t-divrem_1.c (check_data): Added testcase to exercise
+ the nl == constant 0 special case in udiv_qrnnd_preinv3.
+
+2011-02-28 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/generic/rootrem.c (mpn_rootrem): Combine two similar scalar
+ divisions. Misc minor cleanup.
+
+ * mpn/x86/atom/sse2/aorsmul_1.asm: Shorten software pipeline.
+
+ * mpn/x86/atom/mul_basecase.asm: Remove file no longer used.
+
+ * mpn/generic/rootrem.c (mpn_rootrem_internal): Delay O(log(U))
+ allocations until they are known to be needed.
+
+2011-02-27 Marco Bodrato <bodrato@mail.dm.unipi.it>
+
+ * mpn/x86/atom/sse2/mul_1.asm: New code.
+
+2011-02-27 Niels Möller <nisse@lysator.liu.se>
+
+ * gmp-impl.h (udiv_rnnd_preinv): New macro.
+
+2011-02-27 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/x86/atom/sse2/mul_basecase.asm: New file.
+
+2011-02-26 Marco Bodrato <bodrato@mail.dm.unipi.it>
+
+ * mpn/x86/atom/sse2/aorsmul_1.asm: Optimise non-loop code.
+
+2011-02-26 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/powerpc64/mode64/aorsmul_1.asm: Add MULFUNC_PROLOGUE.
+ * mpn/m68k/mc68020/aorsmul_1.asm: Likewise.
+
+ * mpn/powerpc64/mode64/aorsmul_1.asm: Add missing MULFUNC_PROLOGUE.
+ * mpn/m68k/mc68020/aorsmul_1.asm: Likewise.
+
+2011-02-25 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/x86/atom/sse2/aorsmul_1.asm: New file.
+ * mpn/x86/atom/aorsmul_1.asm: File removed.
+
+2011-02-25 Marco Bodrato <bodrato@mail.dm.unipi.it>
+
+ * mpn/x86/atom/sse2/divrem_1.asm: New file (was in x86/atom).
+ * mpn/x86/atom/sse2/mul_1.asm: Likewise.
+ * mpn/x86/atom/sse2/popcount.asm: Likewise.
+ * mpn/x86/atom/divrem_1.asm: ReMoved (in sse2/ now).
+ * mpn/x86/atom/mul_1.asm: Likewise.
+ * mpn/x86/atom/popcount.asm: Likewise.
+
+ * configure.in: Set up mmx path for atom.
+ * mpn/x86/atom/mmx/copyd.asm: New file (was in x86/atom).
+ * mpn/x86/atom/mmx/copyi.asm: Likewise.
+ * mpn/x86/atom/mmx/hamdist.asm: Likewise.
+ * mpn/x86/atom/copyd.asm: ReMoved (in mmx/ now).
+ * mpn/x86/atom/copyi.asm: Likewise.
+ * mpn/x86/atom/hamdist.asm: Likewise.
+
+2011-02-24 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/x86/atom/sse2/mod_1_1.asm: New file.
+ * mpn/x86/atom/sse2/mod_1_4.asm: New file.
+ * configure.in: Set up sse2 path for atom.
+
+ * mpn/x86/p6/sse2/mod_1_1.asm: New file.
+ * mpn/x86/p6/sse2/mod_1_4.asm: Fix typo in MULFUNC_PROLOGUE.
+
+2011-02-24 Niels Möller <nisse@lysator.liu.se>
+
+ * mpn/x86/k7/mod_1_1.asm (mpn_mod_1_1p): Rewrite using the same
+ algorithm as the x86_64 version.
+
+2011-02-23 Marco Bodrato <bodrato@mail.dm.unipi.it>
+
+ * mpn/x86/atom/logops_n.asm: New file (same loop as aors_n).
+
+2011-02-23 Niels Möller <nisse@lysator.liu.se>
+
+ * mpn/x86_64/mod_1_1.asm (mpn_mod_1_1p): Shaved off one
+ instruction and one register in the inner loop. Rearranged
+ registers slightly, and no longer needs the callee-save register
+ %r12.
+
+2011-02-22 Torbjorn Granlund <tege@gmplib.org>
+
+ * configure.in: Export SHLD_SLOW and SHRD_SLOW to config.m4, also
+ fixing typo in exporting code.
+
+ * mpn/x86_64/nano/gmp-mparam.h (SHLD_SLOW, SHRD_SLOW): Define.
+ * mpn/x86_64/atom/gmp-mparam.h (SHLD_SLOW, SHRD_SLOW): Define.
+
+2011-02-22 Niels Möller <nisse@lysator.liu.se>
+
+ * mpn/x86_64/mod_1_1.asm (mpn_mod_1_1p): Rewrite.
+
+2011-02-22 Marco Bodrato <bodrato@mail.dm.unipi.it>
+
+ * mpn/x86/atom/lshiftc.asm: New file (a copy of lshift.asm with a handful of neg added).
+
+2011-02-21 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/x86/aors_n.asm: Move _nc entry to after main code. Align loop
+ and _n entry for claimed performance. Normalise mnemonic usage.
+
+ * mpn/x86/atom/aorrlsh1_n.asm: New file (code from rsblsh_1, slightly
+ slower for addlsh_1 for large operands, but much faster for small).
+ * mpn/x86/atom/addlsh1_n.asm: Remove.
+ * mpn/x86/atom/rsblsh1_n.asm: Remove.
+
+2011-02-20 Marc Glisse <marc.glisse@inria.fr>
+
+ * mpq/aors.c: Rewrite to remove redundant division.
+
+2011-02-20 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/x86/atom/lshift.asm: New file.
+ * mpn/x86/atom/rshift.asm: Normalise mnemonic usage.
+
+ * gmp-impl.h (mpn_divexact_by7): Relax inclusion condition.
+
+ * mpz/divegcd.c (mpz_divexact_by5): New conditionally enabled function.
+ (mpz_divexact_by3): Wrap inside appropriate conditions.
+ (mpz_divexact_gcd): Rewrite.
+
+ * mpn/x86/bdiv_dbm1c.asm: Save a jump.
+
+2011-02-20 Marco Bodrato <bodrato@mail.dm.unipi.it>
+
+ * mpn/x86/atom/aorslshC_n.asm: New file.
+ * mpn/x86/atom/sublsh2_n.asm: New file.
+
+ * mpn/x86/atom/aors_n.asm: New code.
+ * mpn/x86/atom/rshift.asm: Atom64 code adapted to 32-bit.
+ * mpn/x86/atom/lshift.asm: Likewise.
+
+2011-02-19 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/x86_64/atom/rsh1aors_n.asm: New file.
+
+ * mpn/x86_64/atom/lshift.asm: New file.
+ * mpn/x86_64/atom/rshift.asm: New file.
+ * mpn/x86_64/atom/lshiftc.asm: New file.
+
+2011-02-17 Marco Bodrato <bodrato@mail.dm.unipi.it>
+
+ * mpn/x86/atom/aorsmul_1.asm: Small improvements for small sizes.
+ * mpn/x86/atom/aorrlshC_n.asm: Tiny size improvements.
+
+2011-02-16 Torbjorn Granlund <tege@gmplib.org>
+
+ * configure.in: Fix k8/k10 32-bit path setup problem.
+
+2011-02-16 Marco Bodrato <bodrato@mail.dm.unipi.it>
+
+ * mpn/x86/atom/aorsmul_1.asm: Revive an old k7/aorsmul.
+
+2011-02-14 Marco Bodrato <bodrato@mail.dm.unipi.it>
+
+ * gmp-impl.h (mpn_sublsh_n): Declare.
+ * mpn/asm-defs.m4: Likewise.
+
+ * mpn/x86/atom/aorrlshC_n.asm: New file (was k7).
+ * mpn/x86/k7/aorrlshC_n.asm: ReMoved.
+ * mpn/x86/atom/aorrlsh2_n.asm: Grab atom/aorrlshC_n.asm.
+ * mpn/x86/atom/rsblsh1_n.asm: Grab atom/aorrlshC_n.asm.
+
+2011-02-13 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/x86_64/atom/aorrlsh2_n.asm: New file.
+
+2011-02-12 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/x86_64/aorrlsh_n.asm: Minor tweaks, update c/l numbers.
+
+ * mpn/x86_64/atom/sublsh1_n.asm: New file.
+
+ * mpn/x86_64/atom/aorrlsh1_n.asm: New file.
+
+2011-02-11 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/powerpc64/mode64/mod_1_1.asm: Fix Darwin syntax issues.
+
+2011-02-10 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/powerpc64/mode64/mod_1_4.asm: Tune away a cycle for 970.
+
+2011-02-11 Marco Bodrato <bodrato@mail.dm.unipi.it>
+
+ * mpn/x86/k7/addlsh1_n.asm: Faster core loop (Torbjorn's).
+
+ * configure.in: Add HAVE_NATIVE_{add,sub,rsb}lsh{,1,2}_nc.
+ * tests/tests.h: refmpn_{add,sub,rsb}lsh{,1,2}_nc prototypes.
+ * tests/refmpn.c: New refmpn_{add,sub,rsb}lsh{,1,2}_nc.
+ * tests/devel/try.c: Tests for mpn_{add,sub,rsb}lsh{,1,2}_nc.
+
+ * mpn/x86/k7/aorrlshC_n.asm: New file.
+ * mpn/x86/atom/aorrlsh2_n.asm: Grab k7/aorrlshC_n.asm.
+ * mpn/x86/atom/rsblsh1_n.asm: Grab k7/aorrlshC_n.asm.
+
+2011-02-06 Marco Bodrato <bodrato@mail.dm.unipi.it>
+
+ * mpn/x86/k7/addlsh1_n.asm: New file.
+ * mpn/x86/k7/sublsh1_n.asm: New file.
+ * mpn/x86/atom/addlsh1_n.asm: Grab k7/addlsh1_n.asm.
+ * mpn/x86/atom/sublsh1_n.asm: Grab k7/sublsh1_n.asm.
+
+2011-02-05 Torbjorn Granlund <tege@gmplib.org>
+
+ * gmp-impl.h (mpn_addlsh1_nc, mpn_addlsh2_nc, mpn_sublsh1_nc,
+ mpn_sublsh2_nc, mpn_rsblsh1_nc, mpn_rsblsh2_nc): Declare.
+ * mpn/asm-defs.m4: Likewise.
+
+ * mpn/x86_64/coreisbr/aorrlshC_n.asm: New file.
+ * mpn/x86_64/coreisbr/aorrlsh1_n.asm: New file.
+ * mpn/x86_64/coreisbr/aorrlsh2_n.asm: New file.
+
+ * mpn/x86_64/coreisbr/aors_n.asm: New file, based on old
+ atom/aors_n.asm.
+ * mpn/x86_64/atom/aors_n.asm: Grab coreisbr/aors_n.asm.
+
+2011-02-05 Marco Bodrato <bodrato@mail.dm.unipi.it>
+
+ * gmp-impl.h (mpn_toom6_mul_n_itch): Handle threshold == zero.
+ (mpn_toom8_mul_n_itch): Likewise.
+ (MPN_TOOM6H_MIN, MPN_TOOM8H_MIN): Define.
+ * tests/mpn/t-toom6h.c: No tests below MPN_TOOM6H_MIN.
+ * tests/mpn/t-toom8h.c: No tests below MPN_TOOM8H_MIN.
+
+ * mpz/lucnum_ui.c: Use mpn_addlsh2_n.
+
+2011-02-04 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/x86_64/atom/rsh1aors_n.asm: Add a MULFUNC_PROLOGUE.
+ * mpn/x86_64/atom/dive_1.asm: Likewise.
+ * mpn/x86_64/atom/popcount.asm: Likewise.
+ * mpn/x86_64/core2/popcount.asm: Likewise.
+ * mpn/x86_64/coreinhm/hamdist.asm: Likewise.
+ * mpn/x86_64/coreinhm/popcount.asm: Likewise.
+ * mpn/x86_64/nano/popcount.asm: Likewise.
+ * mpn/x86_64/pentium4/popcount.asm: Likewise.
+
+2011-02-04 Marco Bodrato <bodrato@mail.dm.unipi.it>
+
+ * mpn/x86/atom/mode1o.asm: New file, grabbing another asm file.
+ * mpn/x86/atom/mul_1.asm: Claim mul_1c.
+
+2011-02-02 Niels Möller <nisse@lysator.liu.se>
+
+ * tune/speed.h (SPEED_ROUTINE_MPN_HGCD_CALL): Fixed one
+ speed_operand_dst call.
+
+2011-02-01 Torbjorn Granlund <tege@gmplib.org>
+
+ * tune/speed.h (struct speed_params): Allow for 4 dst operands.
+ * tune/common.c (TOLERANCE): Increase from 0.5% to 1%.
+
+ * tune/speed.h (SPEED_ROUTINE_MPN_HGCD_CALL): New macro, mainly based
+ on old speed_mpn_hgcd, but with speed_operand_src calls (as suggested
+ by Niels).
+ * tune/common.c (speed_mpn_hgcd): Invoke SPEED_ROUTINE_MPN_HGCD_CALL.
+ (speed_mpn_hgcd_lehmer): Likewise.
+
+ * configure.in: Set up 32-bit x86 paths for new corei* CPU strings.
+
+2011-01-31 Torbjorn Granlund <tege@gmplib.org>
+
+ * config.guess: Recognise new Intel processors.
+
+ * config.guess: Support 'coreinhm' and 'coreisbr'.
+ * config.sub: Likewise.
+ * configure.in: Likewise.
+
+2011-01-30 Torbjorn Granlund <tege@gmplib.org>
+
+ * configure.in: Support x86/geode.
+ * mpn/x86/geode/gmp-mparam.h: New file.
+
+2011-01-29 Marco Bodrato <bodrato@mail.dm.unipi.it>
+
+ * mpn/x86/atom/addlsh1_n.asm: Removed.
+ * mpn/x86/atom/rsh1add_n.asm: Likewise.
+
+2011-01-28 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/alpha/ev6/slot.pl: Add some missing insns.
+
+2011-01-28 Marco Bodrato <bodrato@mail.dm.unipi.it>
+
+ * mpn/x86/atom/copyd.asm: New file, grabbing another asm file.
+ * mpn/x86/atom/copyi.asm: Likewise.
+ * mpn/x86/atom/aors_n.asm: Likewise.
+ * mpn/x86/atom/addlsh1_n.asm: Likewise.
+ * mpn/x86/atom/aorsmul_1.asm: Likewise.
+ * mpn/x86/atom/bdiv_q_1.asm: Likewise.
+ * mpn/x86/atom/dive_1.asm: Likewise.
+ * mpn/x86/atom/divrem_1.asm: Likewise.
+ * mpn/x86/atom/hamdist.asm: Likewise.
+ * mpn/x86/atom/logops_n.asm: Likewise.
+ * mpn/x86/atom/lshift.asm: Likewise.
+ * mpn/x86/atom/mod_34lsub1.asm: Likewise.
+ * mpn/x86/atom/mul_1.asm: Likewise.
+ * mpn/x86/atom/mul_basecase.asm: Likewise.
+ * mpn/x86/atom/popcount.asm: Likewise.
+ * mpn/x86/atom/rsh1add_n.asm: Likewise.
+ * mpn/x86/atom/rshift.asm: Likewise.
+ * mpn/x86/atom/sqr_basecase.asm: Likewise.
+
+2011-01-27 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/x86_64/atom/rsh1aors_n.asm: New file, grabbing another asm file.
+ * mpn/x86_64/atom/popcount.asm: Likewise.
+ * mpn/x86_64/atom/dive_1.asm: Likewise.
+ * mpn/x86_64/nano/popcount.asm: Likewise.
+
+2011-01-26 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/alpha/invert_limb.asm: Complete rewrite.
+
+2011-01-25 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/powerpc32/invert_limb.asm: New file.
+
+2011-01-25 Marco Bodrato <bodrato@mail.dm.unipi.it>
+
+ * mpn/x86/pentium4/sse2/bdiv_q_1.asm: New file.
+ * mpn/x86/k7/bdiv_q_1.asm: New file.
+
+2011-01-24 Torbjorn Granlund <tege@gmplib.org>
+
+ * tune/tuneup.c (tune_mul_n, tune_sqr): Loop, re-measuring thresholds
+ until no tiny ranges remain.
+
+2011-01-23 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/ia64/mul_2.asm: Tweak to 1.5 c/l, less overhead.
+
+ * mpn/ia64/addmul_2.asm: Rewrite, adding mpn_addmul_2s entry point.
+
+2011-01-22 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/ia64/aors_n.asm: Fix some incorrect bundle types.
+
+ * mpn/ia64/sqr_diagonal.asm: Remove.
+
+ * mpn/ia64/sqr_diag_addlsh1.asm: New file.
+
+ * mpn/ia64/ia64-defs.m4: Define some shorter convenience mnemonics.
+
+ * mpn/generic/sqr_basecase.c (MPN_SQR_DIAG_ADDLSH1): New macro, using
+ new function mpn_sqr_diag_addlsh1 or defining its equivalent.
+
+ * gmp-impl.h (mpn_addmul_2s): Declare.
+ (mpn_sqr_diag_addlsh1): Declare.
+ * mpn/asm-defs.m4 (define_mpn): Add addmul_2s and sqr_diag_addlsh1.
+
+ * configure.in: Add HAVE_NATIVEs for mpn_sqr_diag_addlsh1 and
+ mpn_addmul_2s.
+ (gmp_mpn_functions_optional): Add sqr_diag_addlsh1.
+
+2011-01-21 Marco Bodrato <bodrato@mail.dm.unipi.it>
+
+ * tests/devel/try.c: Initial support for mpn_bdiv_q_1.
+ * mpn/x86/pentium/bdiv_q_1.asm: New file.
+ * mpn/x86/p6/bdiv_q_1.asm: New file.
+
+2011-01-20 Torbjorn Granlund <tege@gmplib.org>
+
+ * tune/speed.c (run_gnuplot): Update to current gnuplot syntax.
+
+ * mpn/powerpc64/mode64/aorsmul_1.asm: Trim away 0.5 c/l for submul_1
+ for POWER5.
+
+2011-01-19 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/x86_64/core2/rsh1aors_n.asm: New file.
+
+2011-01-18 Marco Bodrato <bodrato@mail.dm.unipi.it>
+
+ * mpn/x86/bdiv_q_1.asm: New file (same core alg. as dive_1).
+
+2011-01-15 Marco Bodrato <bodrato@mail.dm.unipi.it>
+
+ * mpn/generic/divexact.c: Avoid COPY if not needed.
+
+2011-01-14 Torbjorn Granlund <tege@gmplib.org>
+
+ * gmp-impl.h (struct cpuvec_t): Add field bmod_1_to_mod_1_threshold.
+ * configure.in (fat_thresholds): Add BMOD_1_TO_MOD_1_THRESHOLD.
+
+2011-01-13 Marco Bodrato <bodrato@mail.dm.unipi.it>
+
+ * mpz/mul.c: Remove redundant size computation.
+
+2011-01-08 Torbjorn Granlund <tege@gmplib.org>
+
+ * tests/devel/try.c (types enum): Add TYPE_MUL_5 and TYPE_MUL_6.
+ (param_init): Support new types.
+ (choice_array): Support testing of mpn_mul_5 and mpn_mul_6.
+ (call): Support new routines.
+
+ * tests/refmpn.c (refmpn_mul_5, refmpn_mul_6): New functions.
+ * tests/tests.h (refmpn_mul_5, refmpn_mul_6): Declare.
+ Remove parameter names from some other functions.
+
+ * gmp-impl.h (mpn_mul_5, mpn_mul_6): Declare.
+ * mpn/asm-defs.m4: Likewise, also declare mpn_addmul_5, mpn_addmul_6,
+ mpn_addmul_7, and mpn_addmul_8.
+
+ * configure.in (gmp_mpn_functions_optional): Add mul_5 and mul_6.
+
+ * tune/speed.c (routine): Add measuring of mpn_mul_5 and mpn_mul_6.
+ * tune/common.c (speed_mpn_mul_5, speed_mpn_mul_6): New functions.
+ * tune/speed.h: Declare new functions.
+
+2011-01-03 Marco Bodrato <bodrato@mail.dm.unipi.it>
+
+ * mpz/aors.h: Remove #ifdef BERKELEY_MP, and cleanup.
+ * mpz/cmp.c: Likewise.
+ * mpz/gcd.c: Likewise.
+ * mpz/mul.c: Likewise.
+ * mpz/powm.c: Likewise.
+ * mpz/set.c: Likewise.
+ * mpz/sqrtrem.c: Likewise.
+ * mpz/tdiv_qr.c: Likewise.
+
+2010-12-28 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/minithres/gmp-mparam.h: Update with several recent thresholds.
+
+2010-12-19 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/x86/k7/mod_1_1.asm: Canonicalise cmov forms.
+ * mpn/x86/k7/mod_1_4.asm: Likewise.
+ * mpn/x86/pentium4/sse2/mod_1_1.asm: Likewise.
+ * mpn/x86/pentium4/sse2/mod_1_4.asm: Likewise.
+ * mpn/x86_64/core2/divrem_1.asm: Likewise.
+ * mpn/x86_64/divrem_1.asm: Likewise.
+ * mpn/x86_64/mod_1_1.asm: Likewise.
+ * mpn/x86_64/mod_1_2.asm: Likewise.
+ * mpn/x86_64/mod_1_4.asm: Likewise.
+
+ * mpn/x86/k7/gcd_1.asm: Rewrite. Remove slow 'div' loop. Call
+ mpn_mod_1 for operands with mode than BMOD_1_TO_MOD_1_THRESHOLD limbs.
+ Misc cleanups.
+
+2010-12-18 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/x86_64/gcd_1.asm: Call mpn_mod_1 for operands with mode than
+ BMOD_1_TO_MOD_1_THRESHOLD limbs.
+
+ * configure.in: Generalise code for putting THRESHOLDs in config.m4.
+ Add BMOD_1_TO_MOD_1_THRESHOLD to list.
+
+ * mpn/x86_64/core2/divrem_1.asm: Tweak slightly, correct cycle counts.
+
+ * mpn/x86_64/addmul_2.asm: Remove constant index.
+ * mpn/x86_64/lshiftc.asm: Likewise.
+ * mpn/x86_64/pentium4/lshift.asm: Likewise.
+ * mpn/x86_64/pentium4/lshiftc.asm: Likewise.
+ * mpn/x86_64/pentium4/rshift.asm: Likewise.
+
+2010-12-16 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/x86_64/mod_34lsub1.asm: Complete rewrite.
+ * mpn/x86_64/pentium4/mod_34lsub1.asm: New file, old
+ mpn/x86_64/mod_34lsub1.asm.
+
+2010-12-15 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/powerpc64/vmx/popcount.asm: Rewrite to use vperm count table.
+
+2010-12-14 Torbjorn Granlund <tege@gmplib.org>
+
+ * mp-h.in: Remove.
+ * configure.in: Remove mp-h.in from AC_OUTPUT invocation.
+
+2010-12-13 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpz/mod.c: Rewrite.
+
+ * mpn/x86_64/corei/popcount.asm: New file.
+ * mpn/x86_64/corei/hamdist.asm: New file.
+
+ * mpn/x86_64/k10/hamdist.asm: New file.
+
+ * configure.in: Amend last change for lame /bin/sh.
+
+2010-12-12 Torbjorn Granlund <tege@gmplib.org>
+
+ * configure.in: Comment out M4=m4-not-needed.
+
+ * mpn/x86_64/k10/popcount.asm: New file.
+ * configure.in: Setup special path for k10 and later AMD CPUs.
+ Remove special x86_64'k8' path, since directory is non-existent.
+
+2010-12-11 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/sparc32/ultrasparct1: New directory.
+ * mpn/sparc32/ultrasparct1/add_n.asm: New file.
+ * mpn/sparc32/ultrasparct1/sub_n.asm: New file.
+ * mpn/sparc32/ultrasparct1/mul_1.asm: New file.
+ * mpn/sparc32/ultrasparct1/addmul_1.asm: New file.
+ * mpn/sparc32/ultrasparct1/submul_1.asm: New file.
+ * mpn/sparc32/ultrasparct1/sqr_diagonal.asm: New file.
+
+ * config.guess: Support Ultrasparc T2 and T3.
+ * config.sub: Likewise.
+ * configure.in: Likewise.
+
+ * config.guess: Generalise BSD Sparc recognition by allowing any
+ caps (needed for OpenBSD which spells things innovatively).
+
+2010-12-01 Torbjorn Granlund <tege@gmplib.org>
+
+ * config.guess: Match new AMD processors, allow finer distinctions
+ among old ones.
+ * acinclude.m4 (X86_64_PATTERN): Likewise.
+ * config.sub: Likewise.
+ * configure.in: Rudimentarily support new AMD processors.
+
+ * configure.in (--enable_assembly): New option.
+ (target none-*-*): Disable, give error.
+
+2010-11-29 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/x86/x86-defs.m4 (LEA): Support non-PIC code.
+ * mpn/x86/darwin.m4 (LEA): Likewise.
+
+ * tests/amd64call.asm: Rewrite for code size, and to match calls and
+ returns.
+
+ * tests/x86call.asm: Rewrite for code size, to support PIC, and to
+ match calls and returns.
+ * tests/x86check.c: Rewrite.
+
+2010-11-22 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpz/get_str.c: Make all bases either work or return an error.
+ * mpz/out_str.c: Likewise.
+ * mpq/get_str.c: Likewise.
+ * mpf/get_str.c: Likewise.
+
+2010-11-14 Torbjorn Granlund <tege@gmplib.org>
+
+ * tests/misc/t-printf.c: Add explicit casts for type conversions.
+ * mpn/generic/toom62_mul.c: Likewise.
+
+2010-11-13 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/generic/get_d.c: Misc cleanup. Fail with a syntax error for
+ non-IEEE fp formats.
+
+ * tests/devel/try.c (malloc_region): Add explicit casts for type
+ conversions.
+
+ * acinclude.m4 (GMP_ASM_RODATA): Make test code snippet C++ compatible.
+ (GMP_C_DOUBLE_FORMAT): Likewise.
+ (GMP_FUNC_VSNPRINTF): Likewise.
+
+ * config.guess (x86): Make test C snippet C++ compatible.
+
+2010-11-12 Torbjorn Granlund <tege@gmplib.org>
+
+ * Makefile.am: Remove mpbsd.
+ * configure.in: Remove mpbsd.
+ * doc/configuration: Remove mpbsd mentions.
+ * doc/gmp.texi: Remove mpbsd docs.
+ * tests/Makefile.am: Remove mpbsd.
+ * libmp.sym: Remove.
+ * mpbsd: Remove directory and files.
+ * tests/mpbsd: Remove directory and files.
+
+2010-11-11 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/x86_64/atom/aors_n.asm: Don't rely on ZF after 'bt' insn.
+ Use 64-bit 'test' to support operands of 2^32 limbs and more.
+
+ * rand: New directory, move rand*.c and randmt.h here.
+ * rand/Makefile.am: New file.
+ * Makefile.am (SUBDIRS): Add rand.
+ (RANDOM_OBJECTS): New variable.
+ (libgmp_la_SOURCES): Remove random objects.
+ (libgmp_la_DEPENDENCIES): Add RANDOM_OBJECTS.
+ * configure.in (AC_OUTPUT): Add rand/Makefile.
+
+ * ansi2knr.1: File removed.
+ * ansi2knr.c: File removed.
+
+2010-11-10 Torbjorn Granlund <tege@gmplib.org>
+
+ Make it possible to compile GMP with g++:
+
+ * gmp-impl.h: Declare __gmp_digit_value_tab here.
+ * mpbsd/min.c: ...not here.
+ * mpbsd/xtom.c: ...nor here.
+ * mpf/set_str.c: ...nor here.
+ * mpz/inp_str.c: ...nor here.
+ * mpz/set_str.c: ...nor here.
+
+ * mpn/generic/toom43_mul.c: Add casts for logical operations on enums.
+ * mpn/generic/toom44_mul.c: Likewise.
+ * mpn/generic/toom4_sqr.c: Likewise.
+ * mpn/generic/toom52_mul.c: Likewise.
+ * mpn/generic/toom53_mul.c: Likewise.
+ * mpn/generic/toom62_mul.c: Likewise.
+
+ * mpz/clrbit.c: Clean up typing using MPZ_REALLOC.
+ * mpz/setbit.c: Likewise.
+
+ * mpz/powm.c: Avoid variable name 'new'.
+
+ * randlc2x.c: Add explicit casts for type conversions.
+ * tests/misc/t-printf.c: Likewise.
+ * tests/misc/t-scanf.c: Likewise.
+ * tests/misc.c: Likewise.
+ * tests/mpz/convert.c: Likewise.
+ * tests/refmpn.c: Likewise.
+
+ * tests/tests.h: Unconditionally use <sstream> for now.
+
+ * tests/memory.c: Include "tests.h.
+
+ * mp_get_fns.c: Add a __GMP_NOTHROW for coherency with prototype.
+ * mp_set_fns.c: Likewise.
+ * mpf/cmp.c: Likewise.
+ * mpf/cmp_si.c: Likewise.
+ * mpf/cmp_ui.c: Likewise.
+ * mpf/fits_s.h: Likewise.
+ * mpf/fits_u.h: Likewise.
+ * mpf/get_dfl_prec.c: Likewise.
+ * mpf/get_prc.c: Likewise.
+ * mpf/get_si.c: Likewise.
+ * mpf/get_ui.c: Likewise.
+ * mpf/int_p.c: Likewise.
+ * mpf/set_dfl_prec.c: Likewise.
+ * mpf/set_prc_raw.c: Likewise.
+ * mpf/size.c: Likewise.
+ * mpf/swap.c: Likewise.
+ * mpq/equal.c: Likewise.
+ * mpq/swap.c: Likewise.
+ * mpz/cmp.c: Likewise.
+ * mpz/cmp_si.c: Likewise.
+ * mpz/cmp_ui.c: Likewise.
+ * mpz/cmpabs.c: Likewise.
+ * mpz/cmpabs_ui.c: Likewise.
+ * mpz/cong_2exp.c: Likewise.
+ * mpz/divis_2exp.c: Likewise.
+ * mpz/fits_s.h: Likewise.
+ * mpz/get_si.c: Likewise.
+ * mpz/hamdist.c: Likewise.
+ * mpz/scan0.c: Likewise.
+ * mpz/scan1.c: Likewise.
+ * mpz/sizeinbase.c: Likewise.
+ * mpz/swap.c: Likewise.
+ * mpz/tstbit.c: Likewise.
+ * tal-reent.c: Likewise.
+
+2010-11-09 Torbjorn Granlund <tege@gmplib.org>
+
+ * configure.in: Get rid of K&R support.
+ * Makefile.am: Likewise.
+ * mpn/Makefile.am: Likewise.
+ * doc/configuration: Update docs wrt K&R support.
+ * doc/gmp.texi: Likewise.
+
+ * configure.in (AC_INIT): Amend bug reporting address with manual
+ reference.
+
+2010-11-06 Torbjorn Granlund <tege@gmplib.org>
+
+ * config.guess: If cpuid says we have 32bit-only x86 but
+ configfsf.guess return x86_64, return the latter.
+
+ * mpn/x86_64/aors_n.asm: Rewrite not to rely on ZF after 'bt' insn.
+
+2010-10-09 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/generic/trialdiv.c: Update documentation.
+
+2010-10-04 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/x86_64/gcd_1.asm: Use m4_lshift to avoid << operator.
+ * mpn/x86_64/aorrlshC_n.asm: Likewise.
+ * mpn/x86_64/pentium4/aorslshC_n.asm: Likewise.
+ * mpn/x86/k7/gcd_1.asm: Likewise.
+
+2010-08-20 Niels Möller <nisse@lysator.liu.se>
+
+ Suggested by Ozkan Sezer:
+ * configure.in: If $M4 is already set in the environment, don't
+ touch it. Fixed the case that no assembler files are used, and
+ GMP_PROG_M4 is omitted.
+
+2010-08-08 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/x86_64/fat/fat.c: Recognise many more processors.
+
+2010-06-30 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/x86_64/divrem_2.asm: Tune.
+
+2010-06-19 Niels Möller <nisse@lysator.liu.se>
+
+ * tune/speed.h (SPEED_ROUTINE_MPN_MOD_1_1): Pass normalized
+ divisor to the benchmarked function.
+
+2010-06-15 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/x86_64/mod_1_1.asm (mpn_mod_1_1p_cps): Rewrite.
+ * mpn/x86_64/mod_1_2.asm (mpn_mod_1s_2p_cps): Rewrite.
+ * mpn/x86_64/mod_1_4.asm (mpn_mod_1s_4p_cps): Rewrite.
+
+ * gmp-impl.h (udiv_rnd_preinv): Simplify.
+
+ * mpn/x86/k7/mod_1_1.asm: New file.
+ * mpn/x86/pentium4/sse2/mod_1_1.asm (mpn_mod_1_1p_cps): Rewrite.
+ * mpn/x86/k7/mod_1_4.asm (mpn_mod_1s_4p_cps): Rewrite.
+ * mpn/x86/pentium4/sse2/mod_1_4.asm (mpn_mod_1s_4p_cps): Rewrite.
+
+ * mpn/generic/mod_1_1.c (mpn_mod_1_1p_cps): Store results as they are
+ computed.
+ * mpn/generic/mod_1_2.c (mpn_mod_1s_2p_cps): Likewise.
+ * mpn/generic/mod_1_4.c (mpn_mod_1s_4p_cps): Likewise.
+
+ * mpn/x86/k7/invert_limb.asm: Moved from mpn/x86/invert_limb.asm.
+
+2010-06-15 Niels Möller <nisse@lysator.liu.se>
+
+ * tests/mpn/Makefile.am (check_PROGRAMS): Added t-mod_1.
+ * tests/mpn/t-mod_1.c: New file.
+
+2010-05-25 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/generic/mu_div_qr.c (mpn_preinv_mu_div_qr_itch): Trim out space
+ for inverse, since that is passed in already.
+
+2010-05-24 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/generic/mu_div_qr.c (mpn_preinv_mu_div_qr_itch): New function.
+ * gmp-impl.h: Declare it.
+ * tune/common.c (speed_mpn_mupi_div_qr): Use new itch function.
+ * tune/speed.h (SPEED_ROUTINE_MPN_MUPI_DIV_QR): Pass parameters right
+ for new itch function.
+
+ * mpn/powerpc32/lshiftc.asm: New file.
+
+2010-05-22 Torbjorn Granlund <tege@gmplib.org>
+
+ * tune/tuneup.c (tune_mod_1): Revert to version of 2010-05-06.
+
+2010-05-17 Torbjorn Granlund <tege@gmplib.org>
+
+ * configure.in (ia64): Get 32-bit sizeof test right.
+
+ * tune/tuneup.c (tune_mod_1): Undo unintensional change to tuning of
+ PREINV_MOD_1_TO_MOD_1_THRESHOLD.
+
+2010-05-16 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/sparc64/mod_1.c: Rewrite.
+ * mpn/sparc64/sparc64.h (umul_ppmm_s): New macro.
+ * mpn/sparc64/mod_1_4.c: New file.
+
+ * mpn/generic/divrem_1.c: Minor cleanup.
+ * mpn/generic/mod_1.c: Likewise.
+ * mpn/generic/mod_1_1.c: Likewise.
+ * mpn/generic/mod_1_2.c: Likewise.
+ * mpn/generic/mod_1_3.c: Likewise.
+ * mpn/generic/mod_1_4.c: Likewise.
+
+ * configure.in (ia64-hpux): Do sizeof tests for 32-bit and 64-bit ABI.
+
+ * tune/tuneup.c (tune_mod_1): Completely finish MOD_1_N tuning before
+ tuning MOD_1U_TO_MOD_1_1_THRESHOLD.
+
+2010-05-14 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/generic/redc_2.c: Use asm code just for GNU C.
+
+2010-05-13 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/sparc64/ultrasparc1234: New directory. Move all code that uses
+ floating-point into this directory.
+ * configure.in: Point to ultrasparc1234 for appropriate CPUs.
+
+ * mpn/sparc64/ultrasparct1/add_n.asm: New file.
+ * mpn/sparc64/ultrasparct1/addlsh2_n.asm: New file.
+ * mpn/sparc64/ultrasparct1/addmul_1.asm: New file.
+ * mpn/sparc64/ultrasparct1/lshift.asm: New file.
+ * mpn/sparc64/ultrasparct1/mul_1.asm: New file.
+ * mpn/sparc64/ultrasparct1/rsblsh2_n.asm: New file.
+ * mpn/sparc64/ultrasparct1/rshift.asm: New file.
+ * mpn/sparc64/ultrasparct1/sublsh1_n.asm: New file.
+ * mpn/sparc64/ultrasparct1/sublshC_n.asm: New file.
+ * mpn/sparc64/ultrasparct1/addlsh1_n.asm: New file.
+ * mpn/sparc64/ultrasparct1/addlshC_n.asm: New file.
+ * mpn/sparc64/ultrasparct1/lshiftc.asm: New file.
+ * mpn/sparc64/ultrasparct1/rsblsh1_n.asm: New file.
+ * mpn/sparc64/ultrasparct1/rsblshC_n.asm: New file.
+ * mpn/sparc64/ultrasparct1/sub_n.asm: New file.
+ * mpn/sparc64/ultrasparct1/sublsh2_n.asm: New file.
+ * mpn/sparc64/ultrasparct1/submul_1.asm: New file.
+ * mpn/sparc64/ultrasparct1/gmp-mparam.h: New file.
+
+ * configure.in: Give ultrasparct1 and ultrasparct2 special code path.
+
+ * mpn/x86_64/pentium4/gmp-mparam.h: Disable mpn_addlsh_n, mpn_rsblsh_n.
+
+2010-05-12 Niels Möller <nisse@lysator.liu.se>
+
+ * mpz/jacobi.c (mpz_jacobi): Fixed off-by-one error in use of
+ scratch space.
+
+ * tune/common.c (speed_mpz_powm_sec): New function.
+ * tune/speed.h: Declare speed_mpz_powm_sec.
+ * tune/speed.c (routine): Added speed_mpz_powm_sec.
+
+ * tune/common.c (speed_mpn_addlsh_n, speed_mpn_sublsh_n)
+ (speed_mpn_rsblsh_n): New functions.
+ * tune/speed.h: Declare new functions.
+ * tune/speed.c (routine): Add new functions.
+
+2010-05-12 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/x86_64/mod_1_4.asm: Tune for more processors.
+
+ * mpn/x86_64/pentium4/lshiftc.asm: New file.
+
+2010-05-11 Niels Möller <nisse@lysator.liu.se>
+
+ * mpz/jacobi.c (mpz_jacobi): Deleted old implementation.
+ Reorganized new implementation, to handle small inputs efficiently.
+
+ * tests/mpz/t-jac.c (check_large_quotients): Reduced test sizes.
+ (check_data): One more input pair related to a fixed bug.
+ (main): Enable check_large_quotients.
+
+2010-05-10 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/x86_64/aorrlsh2_n.asm: Fix typo.
+
+2010-05-09 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/x86_64/aorrlshC_n.asm: New file based on aorrlsh2_n.asm.
+ * mpn/x86_64/aorrlsh2_n.asm: Now just include aorrlshC_n.asm.
+ * mpn/x86_64/core2/aorrlsh1_n.asm: New file, include ../aorrlshC_n.asm.
+ * mpn/x86_64/core2/aorrlsh2_n.asm: Likewise.
+
+ * mpn/x86_64/core2/sublshC_n.asm: New file based on aorslsh1_n.asm.
+ * mpn/x86_64/core2/aorslsh1_n.asm: Remove.
+ * mpn/x86_64/core2/sublsh1_n.asm: Just include sublshC_n.asm.
+ * mpn/x86_64/core2/sublsh2_n.asm: Likewise.
+
+2010-05-08 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/x86_64/atom/gmp-mparam.h: Disable mpn_rsh1add_n, mpn_rsh1sub_n.
+
+ * mpn/x86_64/pentium4/aorslshC_n.asm: New file based on aorslsh1_n.asm.
+ * mpn/x86_64/pentium4/aorslsh1_n.asm: Now just include aorslshC_n.asm.
+ * mpn/x86_64/pentium4/aorslsh2_n.asm: New file.
+
+2010-05-07 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/sparc64: Support operands of >= 2^32 limbs.
+
+ * mpn/sparc64/lshiftc.asm: New file.
+
+ * mpn/ia64/divrem_2.asm: Complete rewrite.
+
+2010-05-06 Torbjorn Granlund <tege@gmplib.org>
+
+ * tune/tuneup.c (all): Don't call tune_divrem_2.
+
+ * mpn/generic/divrem_2.c: Complete rewrite.
+
+ * tune/tuneup.c (tune_mod_1): Fix typo.
+
+2010-05-05 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/x86_64/mod_1_1.asm (mpn_mod_1_1p): Use macro register names.
+ (mpn_mod_1_1p_cps): Rewrite.
+
+ * mpn/generic/mod_1_1.c (mpn_mod_1_1p_cps): Micro-optimise.
+
+ * longlong.h: Undo 2009-03-01 change for powerpc64, it gives poor code.
+
+ * mpn/x86/pentium4/sse2/mod_1_1.asm: New file.
+
+ * mpn/powerpc64/mode64/mod_1_1.asm: New file.
+
+ * tune/tuneup.c (tune_mod_1): Use more typical divisor, for the benefit
+ of machines with early-out multipliers.
+
+2010-05-04 Torbjorn Granlund <tege@gmplib.org>
+
+ * tune/tuneup.c (tune_mod_1): Fix typo.
+
+ * mpn/generic/mod_1_1.c: Undo last change.
+ * mpn/x86_64/mod_1_1.asm: Likewise.
+
+2010-05-03 Niels Möller <nisse@lysator.liu.se>
+
+ * mpn/generic/jacobi_lehmer.c (jacobi_hook): New function.
+ (mpn_jacobi_subdiv_step): Deleted function.
+ (mpn_jacobi_lehmer): Use general mpn_gcd_subdiv_step.
+
+ * mpn/generic/gcd_subdiv_step.c (mpn_gcd_subdiv_step): Reorganized
+ to use a single hook function.
+ * mpn/generic/gcdext.c (mpn_gcdext): Adapted to new hook
+ interface.
+ * mpn/generic/gcdext_lehmer.c (mpn_gcdext_hook): New unified hook
+ function.
+ * mpn/generic/gcd.c (gcd_hook): Renamed from gcd_done, and adapted
+ to new hook interface.
+ * gmp-impl.h (gcd_subdiv_step_hook): New typedef, now a function
+ type, not a struct.
+ (mpn_gcdext_hook): Declare.
+
+2010-05-03 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/generic/mod_1_1.c: Avoid multiply for 2 limb feed-in.
+ * mpn/generic/mod_1_2.c: Likewise.
+ * mpn/generic/mod_1_3.c: Likewise.
+ * mpn/generic/mod_1_4.c: Likewise.
+ * mpn/x86_64/mod_1_1.asm: Likewise.
+ * mpn/x86_64/mod_1_2.asm: Likewise.
+ * mpn/x86_64/mod_1_4.asm: Likewise.
+ * mpn/x86/k7/mod_1_4.asm: Likewise.
+ * mpn/x86/pentium4/sse2/mod_1_4.asm: Likewise.
+ * mpn/alpha/ev6/mod_1_4.asm: Likewise.
+
+ * tune/tuneup.c (tune_mod_1): Measure MOD_1_1_TO_MOD_1_2_THRESHOLD and
+ MOD_1_2_TO_MOD_1_4_THRESHOLD before MOD_1U_TO_MOD_1_1_THRESHOLD for
+ correctness.
+
+ * mpn/powerpc64/sqr_diagonal.asm: Complete rewrite.
+
+ * mpn/powerpc64/mode64/mod_1_4.asm: New file.
+
+2010-05-02 Torbjorn Granlund <tege@gmplib.org>
+
+ * config.guess: Recognise power7.
+
+ * configure.in: Major overhaul of powerpc support.
+
+ * mpn/powerpc64/p6/lshift.asm: New file.
+ * mpn/powerpc64/p6/lshiftc.asm: Likewise.
+ * mpn/powerpc64/p6/rshift.asm: Likewise.
+
+2010-04-30 Torbjorn Granlund <tege@gmplib.org>
+
+ * configure.in (powerpc64): Support CPU specific mode-less subdirs.
+
+ * mpn/powerpc64/aix.m4 (PROLOGUE_cpu): Use "named csect" making
+ requested alignment actually honoured.
+
+2010-04-30 Niels Möller <nisse@lysator.liu.se>
+
+ * mpn/generic/jacobi_lehmer.c (mpn_jacobi_2): Fixed handling of
+ the case bl == 1. Fixed missing application of reciprocity.
+
+2010-04-29 Niels Möller <nisse@lysator.liu.se>
+
+ * configure.in (gmp_mpn_functions): Deleted gcdext_subdiv_step.
+
+ * mpn/generic/gcdext.c (mpn_gcdext): Use new generalized
+ mpn_gcd_subdiv_step.
+
+ * mpn/generic/gcdext_lehmer.c (gcdext_update): New function.
+ (gcdext_done): New function.
+ (gcdext_hook): New const hook struct.
+ (mpn_gcdext_lehmer_n): Use new generalized mpn_gcd_subdiv_step.
+
+ * mpn/generic/gcd.c (gcd_done): New function.
+ (gcd_hook): New const hook struct.
+ (mpn_gcd): Adapted to new mpn_gcd_subdiv_step interface.
+
+ * mpn/generic/gcd_subdiv_step.c (mpn_gcd_subdiv_step): Reorganized
+ function. Added hook function pointers to the argument list, so
+ the same function can be used for gcd, gcdext, and jacobi.
+
+ * gmp-impl.h (struct gcd_subdiv_step_hook): New struct.
+ (mpn_gcdext_subdiv_step): Deleted prototype.
+ (struct gcdext_ctx): New struct.
+ (gcdext_hook): Declare const struct.
+ (mpn_gcd_subdiv_step): Updated prototype.
+
+ * mpn/generic/gcdext_subdiv_step.c: Deleted file.
+
+2010-04-28 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/powerpc64/lshift.asm: Rewrite.
+ * mpn/powerpc64/rshift.asm: Likewise.
+ * mpn/powerpc64/mode64/lshiftc.asm: New file.
+
+ * mpn/powerpc64/aix.m4: Align functions to 32-byte boundary.
+ * mpn/powerpc64/darwin.m4: Likewise.
+ * mpn/powerpc64/elf.m4: Likewise.
+
+2010-04-28 Niels Möller <nisse@lysator.liu.se>
+
+ * tests/mpz/t-jac.c (check_data): Added some more test cases.
+
+ * mpn/generic/jacobi_lehmer.c (mpn_jacobi_2): Bugfix, count
+ trailing zeros, not leading.
+
+2010-04-27 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/powerpc64/mode64/p6/mul_basecase.asm: New file.
+
+2010-04-23 Niels Möller <nisse@lysator.liu.se>
+
+ * gmp-impl.h (MPN_GCD_LEHMER_N_ITCH): Deleted.
+ (mpn_gcd_lehmer_n): Deleted declaration.
+
+ * mpn/generic/gcd.c (gcd_2): Moved from gcd_lehmer.c.
+ (mpn_gcd): Inlined the code from mpn_gcd_lehmer_n. Also use
+ MPN_GCD_SUBDIV_STEP_ITCH rather than MPN_GCD_LEHMER_N_ITCH.
+
+2010-04-22 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/powerpc64/mode64/bdiv_dbm1c.asm: Swap multiply insns to make them
+ consecutive, for the benefit of POWER6.
+
+ * mpn/powerpc64/mode64/p6/gmp-mparam.h: New file.
+
+2010-04-21 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/generic/gcd_lehmer.c: Deleted file.
+
+ * mpn/powerpc64/mode64/divrem_1.asm: Swap multiply insns to make them
+ consecutive, for the benefit of POWER6.
+ * mpn/powerpc64/mode64/dive_1.asm: Likewise.
+ * mpn/powerpc64/mode64/divrem_2.asm: Likewise.
+ * mpn/powerpc64/mode64/mul_1.asm: Likewise.
+ * mpn/powerpc64/mode64/aorsmul_1.asm: Likewise.
+
+ * mpn/powerpc64/mode64/aorslshC_n.asm: Swap ldx operands as a temporary
+ workaround for POWER6 pipeline glitch.
+
+2010-04-19 Niels Möller <nisse@lysator.liu.se>
+
+ * mpz/jacobi.c (mpz_jacobi): New implementation using
+ mpn_jacobi_lehmer. Currently #if:ed out.
+
+ * mpn/generic/jacbase.c (mpn_jacobi_base)
+ [JACOBI_BASE_METHOD < 4]: Support inputs with a >= b.
+
+ * gmp-impl.h (mpn_jacobi_lehmer): Added prototype.
+ (jacobi_table): Declare.
+ (mpn_jacobi_init): New inline function.
+ (mpn_jacobi_finish): Likewise.
+ (mpn_jacobi_update): Likewise.
+
+ * mpn/generic/jacobi_lehmer.c (mpn_jacobi_lehmer): New file, new
+ function.
+
+ * configure.in (gmp_mpn_functions): Added jacobi_lehmer.
+
+2010-04-14 Niels Möller <nisse@lysator.liu.se>
+
+ * configure.in (gmp_mpn_functions): Added
+ matrix22_mul1_inverse_vector.
+ * mpn/Makefile.am (nodist_EXTRA_libmpn_la_SOURCES): Added
+ matrix22_mul1_inverse_vector.c.
+
+ * gmp-impl.h (mpn_matrix22_mul1_inverse_vector): Updated for
+ rename of mpn_matrix22_mul1_inverse_vector.
+ * mpn/generic/gcd_lehmer.c (mpn_gcd_lehmer_n): Likewise.
+ * mpn/generic/gcdext_lehmer.c (mpn_gcdext_lehmer_n): Likewise.
+ * mpn/generic/hgcd.c (hgcd_step): Likewise.
+
+ * mpn/generic/matrix22_mul1_inverse_vector.c
+ (mpn_matrix22_mul1_inverse_vector): New file, function moved and
+ renamed...
+ * mpn/generic/hgcd2.c (mpn_hgcd_mul_matrix1_inverse_vector):
+ ...from here.
+
+2010-04-12 Torbjorn Granlund <tege@gmplib.org>
+
+ * tests/mpn/t-toom6h.c (SIZE_LOG): Define.
+ * tests/mpn/t-toom8h.c (SIZE_LOG): Likewise.
+
+2010-04-10 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/ia64/lorrshift.asm: Rewrite feed-in and wind-down code.
+
+ * mpn/ia64/aorslsh1_n.asm: Adapt to new aorslsh1_n.
+ * mpn/ia64/aorslsh1_n.asm: Likewise.
+
+ * mpn/ia64/aors_n.asm: Complete rewrite.
+ * mpn/ia64/aorslsh1_n.asm: Likewise.
+
+ * mpn/ia64/add_n_sub_n.asm: Misc cleanups. Add slotting comments.
+
+ * mpn/ia64/lshiftc.asm: New file.
+
+ * mpn/x86_64/pentium4/gmp-mparam.h: No longer disable rsh1add_n and
+ rsh1sub_n; instead disable rsblsh1_n, addlsh2_n, rsblsh2_n.
+
+ * mpn/x86/divrem_2.asm: Use "orb" instead of "or" to work around
+ Solaris assembler bug.
+ * mpn/x86_64/mpn/x86_64/divrem_2.asm: Likewise.
+
+ * mpn/x86/aors_n.asm: Use operand-less shift-by-1 insn form.
+ * mpn/x86/pentium/aors_n.asm: Likewise.
+ * mpn/x86_64/invert_limb.asm: Likewise.
+
+ * mpn/x86_64/pentium4/aors_n.asm: Let non-nc code fall into nc code.
+
+ * mpn/x86_64/pentium4/rsh1aors_n.asm: New file.
+
+2010-03-25 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/ia64/add_n_sub_n.asm: New file.
+
+ * mpn/generic/toom33_mul.c: Fix mpn_add_n_sub_n usage.
+ * mpn/generic/toom3_sqr.c: Likewise.
+ * mpn/generic/toom63_mul.c: Likewise.
+
+ * mpn/generic/add_n_sub_n.c: Renamed from addsub_n.c.
+
+2010-03-23 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/x86_64/divrem_2.asm: Use mpn_invert_limb instead of div insn.
+
+ * mpn/ia64/aorslshC_n.asm: New file, generalised from last iteration of
+ aorslsh1_n.asm.
+ * mpn/ia64/aorslsh1_n.asm: Use aorslshC_n.asm.
+ * mpn/ia64/aorslsh1_n.asm: New file, use aorslshC_n.asm.
+
+2010-03-20 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/powerpc64/mode64/invert_limb.asm: Rewrite to exploit cancellation
+ in the Newton iteration.
+
+2010-03-20 Marco Bodrato <bodrato@mail.dm.unipi.it>
+
+ * mpn/generic/toom_interpolate_8pts.c: Use mpn_sublsh2_n.
+
+2010-03-20 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/powerpc64/mode64/aorslshC_n.asm: New file, generalised from
+ last iteration of aorslsh1_n.asm.
+ * mpn/powerpc64/mode64/aorslsh1_n.asm: Use aorslshC_n.asm.
+ * mpn/powerpc64/mode64/aorslsh1_n.asm: New file, use aorslshC_n.asm.
+
+2010-03-19 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/x86_64/nano/dive_1.asm: New file.
+
+ * mpn/x86_64/divrem_1.asm: Avoid shld since it is slow on several CPU
+ types. Unconditionally provide code for normalised and unnormalised
+ divisors. Cleanup labels.
+
+ * mpn/x86_64/core2/divrem_1.asm: Remove special code for normalised
+ divisors. Cleanup labels.
+
+ * mpn/generic/toom_interpolate_6pts.c: Call mpn_sublsh2_n and
+ mpn_sublsh_n with correct args.
+
+ * tests/devel/try.c: Use enum for TYPE_*.
+
+ * tests/devel/try.c: Test mpn_sublsh2_n.
+ * tests/refmpn.c (refmpn_sublsh2_n): New function.
+ * tests/tests.h (refmpn_sublsh2_n): Declare.
+
+ * mpn/powerpc64/mode64/aorslsh1_n.asm: New file, with faster
+ mpn_addlsh1_n and mpn_sublsh1_n.
+ * mpn/powerpc64/mode64/addlsh1_n.asm: Delete.
+ * mpn/powerpc64/mode64/sublsh1_n.asm: Delete.
+
+2010-03-18 Torbjorn Granlund <tege@gmplib.org>
+
+ * configure.in (*-*-aix): Define gcc_32_cflags_maybe, ar_32_flags and
+ nm_32_flags.
+
+ * mpn/x86/pentium4/sse2/addlsh1_n.asm: Tune for slightly better speed.
+ Misc cleanups. Add cycle table.
+
+ * mpn/x86_64/copyi.asm: Update cycle table.
+ * mpn/x86_64/copyd.asm: Likewise.
+ * mpn/x86_64/rsh1aors_n.asm: Likewise.
+ * mpn/x86_64/dive_1.asm: Likewise.
+
+ * mpn/x86/pentium4/sse2/add_n.asm: Misc cleanups. Add cycle table.
+ * mpn/x86/pentium4/sse2/sub_n.asm: Likewise.
+
+2010-03-16 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/x86_64/divrem_1.asm: Use mpn_invert_limb instead of div insn.
+ * mpn/x86_64/core2/divrem_1.asm: Likewise.
+
+ * tune/speed.c (routine): Add FLAG_R_OPTIONAL for many binops.
+
+2010-03-15 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/alpha/ev6/mod_1_4.asm (mpn_mod_1s_4p_cps): Rewrite.
+
+ * mpn/ia64/aors_n.asm: Insert explicitly typed nops to trigger intended
+ bundling.
+ * mpn/ia64/aorslsh1_n.asm: Likewise.
+ * mpn/ia64/dive_1.asm: Likewise.
+
+2010-03-13 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/x86/pentium4/sse2/submul_1.asm: Rewrite.
+
+ * mpn/powerpc64/mode64/aorsmul_1.asm: New file, faster than old code
+ for both mpn_addmul_1 and mpn_submul_1.
+ * mpn/powerpc64/mode64/addmul_1.asm: Remove.
+ * mpn/powerpc64/mode64/submul_1.asm: Remove.
+
+2010-03-11 Niels Möller <nisse@lysator.liu.se>
+
+ * mpn/generic/gcd_lehmer.c (gcd_2): Use sub_ddmmss.
+
+ * mpn/generic/jacbase.c (mpn_jacobi_base): Reorganized the
+ JACOBI_BASE_METHOD 4 slightly. Now requires that b > 1.
+
+2010-03-10 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/x86_64/divrem_1.asm: Make fraction code take documented # of
+ cycles. Annotate code for more CPUs. Misc cleanups.
+ * mpn/x86_64/core2/divrem_1.asm: Annotate code for more CPUs.
+
+ * mpn/alpha/ev6/mod_1_4.asm: New file.
+
+ * mpn/ia64/mod_34lsub1.asm: New file.
+
+ * doc/gmp.texi (Language Bindings): Update Python site, add Ruby.
+
+2010-03-10 Niels Möller <nisse@lysator.liu.se>
+
+ * tune/tuneup.c (tune_jacobi_base): Consider mpn_jacobi_base_4.
+ * tune/speed.c (routine): Added mpn_jacobi_base_4.
+ * tune/common.c (speed_mpn_jacobi_base_4): New function.
+ * tune/speed.h (speed_mpn_jacobi_base_4): Declare it.
+ * tune/Makefile.am (libspeed_la_SOURCES): Added jacbase4.c.
+ * tune/jacbase4.c: New file.
+
+ * mpn/generic/jacbase.c (mpn_jacobi_base): New function, for
+ JACOBI_BASE_METHOD 4.
+
+2010-03-09 Niels Möller <nisse@lysator.liu.se>
+
+ * tests/mpz/t-jac.c (check_large_quotients): Also generate inputs
+ with large quotients and a large gcd.
+
+2010-03-09 Marco Bodrato <bodrato@mail.dm.unipi.it>
+
+ * tests/mpz/t-bin.c (randomwalk): New test-generator function.
+
+2010-03-07 Torbjorn Granlund <tege@gmplib.org>
+
+ * tune/speed.c (routine): Force r argument for several mod_1 calls.
+
+2010-03-06 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/x86_64/divrem_1.asm: Disable SPECIAL_CODE_FOR_NORMALIZED_DIVISOR.
+ Misc clean up.
+
+ * mpn/x86_64/mod_1_1.asm: New file.
+ * mpn/x86_64/mod_1_2.asm: New file.
+ * mpn/x86_64/mod_1_4.asm: Update cycle counts.
+
+ * tests/tests.h (TESTS_REPS): Fix typo.
+
+2010-03-03 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/x86_64/core2/divrem_1.asm: New file.
+
+2010-02-26 Niels Möller <nisse@lysator.liu.se>
+
+ * tune/speed.c (routine): Added udiv_qrnnd_preinv3.
+
+ * tune/common.c (speed_udiv_qrnnd_preinv3): New function.
+ * tune/speed.h: Added prototype for it.
+
+2010-02-26 Niels Möller <nisse@lysator.liu.se>
+
+ * tests/mpz/t-jac.c (check_large_quotients): New test. Currently
+ disabled, since it's quite slow.
+ (mpz_nextprime_step): New function.
+
+2010-02-26 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/pa64/aors_n.asm: Fix typo in last change.
+
+2010-02-25 Niels Möller <nisse@lysator.liu.se>
+
+ * tests/mpz/t-jac.c (ref_jacobi): New reference implementation,
+ using factorization and legendre symbols computed by powm.
+
+ * tests/devel/try.c (param_init, call): Don't pass negative values
+ for the second argument to mpz_jacobi and refmpz_jacobi.
+
+ * tests/refmpz.c (refmpz_jacobi): Require that b is odd and positive.
+
+ * tests/devel/try.c (param_init): Support mpz_legendre.
+ (choice_array): Added mpz_kronecker (apparently forgotten) and
+ mpz_legendre.
+ (call): Added TYPE_MPZ_LEGENDRE.
+ (try_one): Added support for DATA_SRC1_ODD_PRIME.
+
+ * tests/refmpz.c (refmpz_legendre): Rewrote using powm.
+
+2010-02-25 Torbjorn Granlund <tege@gmplib.org>
+
+ * config.guess: Make "corei" default for unrecognised Intel P6 CPUs.
+
+ * tests/mpz/t-perfpow.c (check_random): Use mp_limb_t type for limb
+ variables.
+
+ * tests/mpn/t-toom6h.c (COUNT): Define.
+ * tests/mpn/t-toom8h.c (COUNT): Define.
+
+ * tests/mpn/t-div.c: Cast a switch index to placate HP's cc.
+ * tests/mpn/t-bdiv.c: Likewise.
+
+ * mpn/pa64/aors_n.asm: Fix support of the 2.0n ABI.
+
+2010-02-24 Marco Bodrato <bodrato@mail.dm.unipi.it>
+
+ * tests/mpz/t-bin.c (data): Replace (2k,k), tested by twos ().
+ * tests/mpf/t-inp_str.c (data): Test also "+" in the exponent.
+
+2010-02-23 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/generic/mod_1_3.c: Cast a switch index to placate HP's cc.
+
+ * mpn/generic/sqrtrem.c: Use CNST_LIMB.
+
+2010-02-20 Niels Möller <nisse@lysator.liu.se>
+
+ * tune/speed.h (mpn_gcd_accel): Deleted prototype.
+ (mpn_hgcd_lehmer): New prototype.
+ (MPN_HGCD_LEHMER_ITCH): New macro (previously in gmp-impl.h).
+
+ * tune/Makefile.am (libspeed_la_SOURCES): Added hgcd_lehmer.c.
+ * tune/hgcd_lehmer.c: New file.
+ * tune/gcd_accel.c: Deleted obsolete file.
+
+ * gmp-impl.h (MPN_HGCD_LEHMER_ITCH): Deleted macro.
+
+ * mpn/generic/hgcd.c (mpn_hgcd_lehmer): Deleted function,
+ (mpn_hgcd): Don't call mpn_hgcd_lehmer, instead use inlined loop
+ around hgcd_step.
+ (mpn_hgcd_itch): Substitute n for MPN_HGCD_LEHMER_ITCH (n).
+
+2010-02-19 Niels Möller <nisse@lysator.liu.se>
+
+ * Makefile.am (mpn/jacobitab.h): Added the rules needed to
+ generate this file.
+
+ * gen-jacobitab.c: New file.
+
+2010-02-19 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/generic/powm.c: Honour SQR_BASECASE_THRESHOLD in innerloop
+ expansions.
+
+2010-02-16 Niels Möller <nisse@lysator.liu.se>
+
+ * tune/time.c (cgt_works_p): Added rudimentary sanity check for
+ clock_gettime working.
+
+2010-02-15 Niels Möller <nisse@lysator.liu.se>
+
+ * tune/time.c (speed_time_init): Make use of cycle counter
+ configurable, via the speed_option_cycles_broken flag.
+ * tune/common.c (speed_option_cycles_broken): New global variable.
+ (speed_option_set): Recognize option "cycles-broken".
+
+ * tune/time.c (cycles_works_p): Deleted hack to disable cycle
+ counter on linux. Needs to be replaced by something more
+ selective.
+
+2010-02-11 Niels Möller <nisse@lysator.liu.se>
+
+ * tune/time.c (speed_time_init): Fix speed_time_string when using
+ clock_gettime.
+ (cycles_works_p): On linux, don't use the cycle counter.
+
+ * tune/Makefile.am: Add $(TUNE_LIBS) when linking programs.
+
+ * configure.in: Check if -lrt is needed for clock_gettime, and if
+ so, add that flag to TUNE_LIBS.
+
+2010-02-07 Torbjorn Granlund <tege@gmplib.org>
+
+ * tune/tuneup.c (tune_redc): Set min_size and min_is_always when
+ measuring REDC_1_TO_REDC_2_THRESHOLD.
+ (tune_mod_1): Set min_size for PREINV_MOD_1_TO_MOD_1_THRESHOLD.
+
+ * mpn/x86_64/aorrlsh_n.asm (cnt): Fix a typo.
+ * mpn/x86_64/lshsub_n.asm: Likewise.
+
+2010-02-05 Torbjorn Granlund <tege@gmplib.org>
+
+ * Version 5.0.1 released.
+
+ * mpn/generic/powm.c: Use rp target area for power table computation in
+ order to use less scratch.
+
+ * mpn/generic/binvert.c (mpn_binvert_itch): Enable more economical
+ mpn_mulmod_bnm1_itch call.
+
+ * mpn/generic/mu_div_qr.c: Remove always true #if.
+ * mpn/generic/mu_divappr_q.c: Likewise.
+ * mpn/generic/mu_bdiv_q.c: Likewise.
+ * mpn/generic/mu_bdiv_qr.c: Likewise.
+
+2010-02-01 Torbjorn Granlund <tege@gmplib.org>
+
+ * Makefile.am (LIBGMP_LT_*, LIBGMPXX_LT_*, LIBMP_LT_*):
+ Bump version info.
+
+ * mpn/powerpc64/mode64/gmp-mparam.h: Remove {MUL,SQR}_FFT_TABLE2.
+ * mpn/x86/p6/gmp-mparam.h: Likewise.
+ * mpn/x86/p6/mmx/gmp-mparam.h: Likewise.
+ * mpn/generic/mul_fft.c: Don't depend on FFT_TABLE2, it was broken.
+
+2010-01-29 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/generic/mul_fft.c (mpn_mul_fft_internal): Remove arguments n, m,
+ k and rec; add argument sqr. Don't call mpn_mul_fft_decompose here,
+ instead do that in all callers.
+ (mpn_mul_fft): Trim allocation when squaring, and use TMP_ALLOC*, not
+ explicit alloc/free.
+ (mpn_fft_div_2exp_modF): Avoid a scalar division.
+ (mpn_fft_mul_modF_K): Replace some multiplies by K with shifting by k.
+ (mpn_fft_mul_2exp_modF): Make function more symmetrical.
+
+2010-01-27 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/generic/mu_div_q.c (mpn_mu_div_q_itch): Rewrite.
+ * mpn/generic/mu_div_qr.c (mpn_mu_div_qr_itch): Re-enable
+ better mulmod itch estimate.
+ * mpn/generic/mu_divappr_q.c (mpn_mu_divappr_q_itch): Likewise.
+ * mpn/generic/mu_bdiv_qr.c (mpn_mu_bdiv_qr_itch): Likewise.
+ * mpn/generic/mu_bdiv_q.c (mpn_mu_bdiv_q_itch): Likewise.
+
+2010-01-27 Marco Bodrato <bodrato@mail.dm.unipi.it>
+
+ * mpn/generic/mu_div_qr.c (mpn_mu_div_qr_itch): Disabled guessed
+ estimate, enabled a conservative one.
+ * mpn/generic/mu_divappr_q.c (mpn_mu_divappr_q_itch): Likewise.
+ * mpn/generic/mu_bdiv_qr.c (mpn_mu_bdiv_qr_itch): Likewise.
+ * mpn/generic/mu_bdiv_q.c (mpn_mu_bdiv_q_itch): Likewise.
+
+2010-01-26 Marco Bodrato <bodrato@mail.dm.unipi.it>
+
+ * mpn/generic/mulmod_bnm1.c (mpn_mulmod_bnm1): Partial rewrite to
+ reduce memory usage.
+ * mpn/generic/sqrmod_bnm1.c (mpn_sqrmod_bnm1): Likewise.
+ (mpn_sqrmod_bnm1_next_size): New function.
+
+ * gmp-impl.h (mpn_mulmod_bnm1_itch): Accepts 3 parameters now.
+ (mpn_sqrmod_bnm1_itch): New inline function.
+ (mpn_sqrmod_bnm1_next_size): Declaration and mangling.
+ * mpn/generic/nussbaumer_mul.c: Use the new functions.
+
+ * mpn/generic/invertappr.c (mpn_ni_invertappr): Use new syntax for
+ mpn_mulmod_bnm1_itch.
+ * mpn/generic/mu_divappr_q.c (mpn_mu_divappr_q_itch): Likewise.
+ * mpn/generic/mu_bdiv_qr.c (mpn_mu_bdiv_qr_itch): Likewise.
+ * mpn/generic/mu_bdiv_q.c (mpn_mu_bdiv_q_itch): Likewise.
+ * mpn/generic/mu_div_qr.c (mpn_mu_div_qr_itch): Likewise.
+ * mpn/generic/binvert.c (mpn_binvert_itch): Likewise.
+ * tune/speed.h (SPEED_ROUTINE_MPN_MULMOD_BNM1_CALL): Likewise.
+ (SPEED_ROUTINE_MPN_MULMOD_BNM1_ROUNDED): Likewise.
+
+ * tests/mpn/t-sqrmod_bnm1.c, tests/mpn/t-mulmod_bnm1.c: Test
+ reduced memory usage.
+
+2010-01-25 Torbjorn Granlund <tege@gmplib.org>
+
+ * tune/tuneup.c (INSERT_FFTTAB): New macro, like old insertion code but
+ also inserting a sentinel.
+ (fftmes): Use INSERT_FFTTAB for inserting new measurements.
+ Limit k range to best_k - 4 ... best_k + 4.
+
+2010-01-23 Torbjorn Granlund <tege@gmplib.org>
+
+ * gmp-h.in (__GNU_MP_VERSION_PATCHLEVEL): Bump.
+ (__GMP_MP_RELEASE): New macro.
+
+ * mpf/div.c: Rewrite to use mpn_div_q.
+
+2010-01-21 Torbjorn Granlund <tege@gmplib.org>
+
+ * Add FFT_TABLE3 tables for a basic set of machines.
+
+ * configure.in: Use -mtune=nocona for 64-bit pentium4.
+
+ * config.guess: Recognise many more Intel processors.
+
+ * tune/common.c: Whitespace cleanup.
+ (speed_mpn_matrix22_mul): Rewrite.
+
+2010-01-21 Niels Möller <nisse@lysator.liu.se>
+
+ * mpn/generic/nussbaumer_mul.c (mpn_nussbaumer_mul): Take
+ advantage of new mpn_mulmod_bnm1 interface, to reduce allocation.
+
+ * tests/mpn/t-mulmod_bnm1.c (ref_mulmod_bnm1, main): Adapted to
+ mpn_mulmod_bnm1 interface change.
+
+ * mpn/generic/mulmod_bnm1.c (mpn_mulmod_bnm1): Interface change,
+ in case an + bn < rn, only write an + bn output limbs. New input
+ requirement, an + bn > rn/2.
+ * mpn/generic/sqrmod_bnm1.c (mpn_sqrmod_bnm1): Corresponding
+ changes.
+
+2010-01-19 Torbjorn Granlund <tege@gmplib.org>
+
+ * tune/tuneup.c (fftmes): Round up initial n according to initial k.
+ Limit k to 24 in loop. Remove an obsolete always-true condition.
+ Remove a redundant trace printout.
+
+2010-01-18 Torbjorn Granlund <tege@gmplib.org>
+
+ * tune/tuneup.c (fftmes): New function
+ (fft): Rewrite.
+ (mpn_mul_fft_lcm): New function, copied from mpn/generic/mul_fft.c.
+ (fftfill): New function, code taken from mul_fft.c (mpn_mul_fft).
+ (cached_measure): New function.
+
+ * gmp-impl.h (struct fft_table_nk): Moved from mul_fft.c.
+ (MUL_FFT_TABLE3, SQR_FFT_TABLE3): Provide dummy versions for tuneup
+ builds.
+ (FFT_TABLE3_SIZE): Increase value for tuneup builds.
+
+ * mpn/generic/mul_fft.c: Handle a new FFT threshold table type ("3").
+ Misc cleanups to old table type code.
+
+2010-01-16 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/x86_64/darwin.m4: Fix typo in last change.
+
+2010-01-15 Torbjorn Granlund <tege@gmplib.org>
+
+ * gmp-h.in (__GMP_EXTERN_INLINE): Remove "extern" for newer Sun C.
+
+ * gmp-impl.h (GMP_LIMB_BYTES): New define.
+
+ * mpn/x86_64/darwin.m4 (LEA): New define.
+
+ * mpn/x86/invert_limb.asm (approx_tab): Use DEF_OBJECT.
+ Rename and globalise it to work around Mac OS bug.
+
+ With Philip McLaughlin:
+ * mpn/x86_64/gcd_1.asm (ctz_table): Don't use local prefix, but
+ use DEF_OBJECT...END_OBJECT.
+ Keep stack pointer at ABI mandated alignment over call.
+
+2010-01-12 Torbjorn Granlund <tege@gmplib.org>
+
+ * tune/speed.c (routine): Remove obsolete mpn_dc_tdiv_qr and
+ mpn_dc_div_qr_n.
+ * tune/common.c (speed_mpn_dc_tdiv_qr, speed_mpn_dcpi1_div_qr_n):
+ Remove now unused functions.
+ * tune/speed.h (SPEED_ROUTINE_MPN_DC_DIVREM_N,
+ SPEED_ROUTINE_MPN_DC_DIVREM_SB, SPEED_ROUTINE_MPN_DC_TDIV_QR): Remove
+ now unused macros.
+
+ * mpn/x86_64/fat/fat_entry.asm (mpn_cpuid_available): Remove function.
+
+ * ltmain.sh: Upgrade from 1.5.24 to 2.2.6b.
+ * ylwrap: New file.
+ * .bootstrap: Remove explicit versions.
+
+ * doc/gmp.texi (Block-wise Barrett Division): New node.
+
+ * mpn/generic/powm.c: Change some #if to plain 'if' to avoid fat build
+ problems.
+
+2010-01-11 Torbjorn Granlund <tege@gmplib.org>
+
+ * tune/speed.h (SPEED_ROUTINE_MPN_PI1_DIV): Accept arguments for size
+ restrictions.
+ * tune/common.c (speed_mpn_sbpi1_div_qr, speed_mpn_dcpi1_div_qr,
+ (speed_mpn_sbpi1_divappr_q, speed_mpn_dcpi1_divappr_q): Pass size
+ limits for SPEED_ROUTINE_MPN_PI1_DIV.
+
+ * tune/speed.c (routine): Allow .r argument for mpn_sbpi1_divappr_q and
+ mpn_dcpi1_divappr_q.
+
+2010-01-08 Torbjorn Granlund <tege@gmplib.org>
+
+ * Version 5.0.0 released.
+
+ * mpn/generic/div_q.c: Handle mpn_*_divappr_q returning high limb
+ everywhere.
+
+2010-01-07 Torbjorn Granlund <tege@gmplib.org>
+
+ * Update MUL_FFT_TABLE2 and SQR_FFT_TABLE2 for many machines.
+
+ * mpn/generic/mu_div_q.c: Account for divisor truncation error as well
+ as mpn_mu_divappr_q's error.
+
+ * mpn/generic/mu_div_q.c: Handle mpn_preinv_mu_divappr_q returning a
+ high limb.
+
+ * tests/mpn/t-bdiv.c: Move a random call for debugability.
+ * tests/mpn/t-div.c: Likewise.
+
+ * mpn/generic/mu_divappr_q.c: Rewrite quotient round-up code.
+
+ * mpn/generic/mu_div_qr.c: Handle carry-out from a carry propagation
+ subtract.
+ * mpn/generic/mu_divappr_q.c: Likewise.
+
+ * mpn/generic/mu_divappr_q.c
+ (mpn_preinv_mu_divappr_q, mpn_mu_divappr_q): Declare dividend constant.
+ * gmp-impl.h: Likewise.
+
+ * perfpow.c (mpn_perfect_power_p): Call mpn_divexact instead of
+ mpn_bdiv_q (with too little scratch space!).
+
+ From Niels Möller:
+ * tests/mpn/t-div.c (check_one): Get rid of the poorly managed variable
+ tn.
+
+ * mpn/minithres/gmp-mparam.h: Add all lately defined thresholds.
+
+ * mpn/generic/div_q.c: Use SB division for small quotients as well as
+ small divisors. Fix typo in itch call.
+
+2010-01-06 Niels Möller <nisse@lysator.liu.se>
+
+ * tests/mpn/t-div.c (check_one): Checking based on multiplication,
+ refmpn_mul, rather than refmpn_tdiv_qr.
+
+2010-01-06 Marco Bodrato <bodrato@mail.dm.unipi.it>
+
+ * mpn/generic/toom8h_mul.c: Avoid overflows of mp_size_t.
+
+2010-01-06 Torbjorn Granlund <tege@gmplib.org>
+
+ * gmp-h.in (__GNU_MP__): Bump.
+ (__GNU_MP_VERSION,__GNU_MP_VERSION_MINOR,__GNU_MP_VERSION_PATCHLEVEL):
+ Bump version info.
+ * mp-h.in (__GNU_MP__): Bump.
+ * Makefile.am (LIBGMP_LT_*, LIBGMPXX_LT_*, LIBMP_LT_*):
+ Bump version info.
+
+ * doc/gmp.texi: Rewrite mpn_gcdext text. Remove some out-of-date
+ text in Algorithms chapter.
+
+ * mpn/generic/div_q.c: Properly handle np=scratch. Fix critical typo
+ in final adjustment code. Misc cleanups.
+
+ * mpn/generic/rootrem.c: Use mpn_div_q.
+ * mpz/tdiv_q.c: Likewise.
+
+ * tests/mpn/t-div.c: Test mpn_div_q.
+ (SIZE_LOG): Up to 17.
+
+ * mpn/generic/div_q.c: New file.
+ * configure.in (gmp_mpn_functions): Add div_q.
+
+ * mpn/generic/mu_div_q.c: Actually declare dividend constant.
+
+2010-01-04 Torbjorn Granlund <tege@gmplib.org>
+
+ * tune/tuneup.c (fft): Separate tuning of modf and full products.
+ (struct fft_param_t): New field, mul_modf_function.
+ (tune_fft_sqr): Fix typo.
+ (tune_fft_mul, tune_fft_sqr): Initialise mul_modf_function field.
+ * tune/common.c (speed_mpn_fft_mul, speed_mpn_fft_sqr): New functions.
+
+ * tune/speed.h (SPEED_ROUTINE_MPN_MULMOD_BNM1_ROUNDED): Clean up.
+
+ * mpn/generic/mul.c: Simplify rational expression.
+
+ * gmp-impl.h: Cleanup threshold variables; remove obsolete ones and
+ make all possibly needed definitions for existing ones.
+ * tune/tuneup.c (tune_mul): Write fractions-compensated values to
+ threshold variables.
+
+2010-01-03 Marco Bodrato <bodrato@mail.dm.unipi.it>
+
+ * tune/common.c, tune/speed.c, tune/speed.h: Support measuring
+ mpn_toom43_mul.
+
+ * mpn/generic/toom_interpolate_6pts.c: Small reorganisation.
+
+2010-01-03 Torbjorn Granlund <tege@gmplib.org>
+
+ * gmp-impl.h (MUL_TO_MULMOD_BNM1_FOR_2NXN_THRESHOLD): Default to
+ INV_MULMOD_BNM1_THRESHOLD/2 instead.
+
+ * gmp-impl.h (INV_APPR_THRESHOLD, INV_MULMOD_BNM1_THRESHOLD): Default
+ here...
+ * mpn/generic/invert.c, mpn/generic/invertappr.c: ...not here.
+
+ * tests/mpn/t-div.c: Rewrite operand generation code.
+
+2010-01-02 Torbjorn Granlund <tege@gmplib.org>
+
+ * gmp-impl.h (MUL_TO_MULMOD_BNM1_FOR_2NXN_THRESHOLD): Default to
+ INV_MULMOD_BNM1_THRESHOLD.
+
+2010-01-02 Marco Bodrato <bodrato@mail.dm.unipi.it>
+
+ * mpn/generic/dcpi1_div_q.c: Handle divappr approximation problem more
+ efficiently.
+ * mpn/generic/mu_div_q.c: Likewise.
+
+ * mpn/generic/invert.c: Remove duplicated code.
+
+2010-01-01 Torbjorn Granlund <tege@gmplib.org>
+
+ * gmp-impl.h (MUL_TO_MULMOD_BNM1_FOR_2NXN_THRESHOLD): Default to 0.
+
+ * mpn/generic/mu_div_qr.c: Rewrite to use mpn_mulmod_bnm1. Clean up
+ scratch usage. Improve itch functions.
+ * mpn/generic/mu_divappr_q.c: Likewise.
+ * mpn/generic/mu_bdiv_qr.c: Likewise.
+ * mpn/generic/mu_div_q.c: Likewise.
+
+ * mpn/generic/dcpi1_bdiv_qr.c: Add parameter ASSERTs.
+ * mpn/generic/dcpi1_bdiv_q.c: Likewise.
+
+ * tests/mpn/t-bdiv.c: Replace with unit testing code, based on t-div.c.
+ Increase COUNT to 500.
+
+ * tests/mpn/t-div.c: Avoid generating too small test operands.
+ Move SB suppression limit downwards. Increase COUNT to 200.
+
+2009-12-31 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/generic/tdiv_qr.c: Handle numerator/remainder overlap in MU case.
+
+ * tests/tests.h (TESTS_REPS): New macro.
+ * tests/mpz/dive.c: Use larger operands, decrease default reps, use
+ TESTS_REPS.
+ * tests/mpz/convert.c: Likewise.
+ * tests/mpz/t-sqrtrem.c: Likewise.
+ * tests/mpz/reuse: Likewise.
+ * tests/mpz/t-root.c: Likewise.
+ * tests/mpz/t-tdiv.c: Likewise.
+ * tests/mpz/t-gcd.c: Likewise.
+ * tests/mpz/t-powm.c: Likewise.
+
+2009-12-31 Marco Bodrato <bodrato@mail.dm.unipi.it>
+
+ * mpn/generic/toom8_sqr.c (SQR_TOOM8_MAX): Avoid overflow.
+ * mpn/generic/toom6_sqr.c (SQR_TOOM6_MAX): Likewise.
+
+ * mpn/generic/mulmod_bnm1.c: Don't mention MISUSE any more,
+ simply consider UNLIKELY any unexpected size.
+
+2009-12-31 Torbjorn Granlund <tege@gmplib.org>
+
+ * tune/tuneup.c (speed_mpn_sbordcpi1_div_qr): New function.
+ (tune_mu_div): Use it.
+
+2009-12-30 Torbjorn Granlund <tege@gmplib.org>
+
+ * tune/tuneup.c (tune_mu_bdiv, tune_dc_bdiv, tune_mu_div)
+ (tune_dc_div): Clear global s.r to make speed functions do 2n/n.
+
+ * tune/speed.c (routine): New entries for mpn_mu_div_qr and
+ mpn_mupi_div_qr. Allow .r parameter for mpn_sbpi1_div_qr,
+ mpn_dcpi1_div_qr.
+ * tune/speed.h (SPEED_ROUTINE_MPN_PI1_DIV, SPEED_ROUTINE_MPN_MU_DIV_QR)
+ (SPEED_ROUTINE_MPN_MUPI_DIV_QR): Handle .r parameter.
+
+ * tests/mpz/t-tdiv.c: Increase operands size again.
+
+ * mpn/generic/tdiv_qr.c: Attempt to choose between DC and MU cleverer.
+
+ * mpn/generic/tdiv_qr.c: Don't overwrite rp with unnecessary temporary
+ alloc.
+
+2009-12-29 Torbjorn Granlund <tege@gmplib.org>
+
+ * tune/tuneup.c (tune_mu_div): Tune MUPI_DIV_QR_THRESHOLD.
+ * tune/speed.h (struct speed_params): Allow 3 source operands.
+ (SPEED_ROUTINE_MPN_MUPI_DIV_QR): New macro.
+ * tune/common.c (speed_mpn_mupi_div_qr): New function.
+
+ * mpn/generic/tdiv_qr.c: Call mpn_mu_div_qr.
+
+ * tests/mpz/t-tdiv.c: Use larger test operands.
+
+ * mpn/generic/mu_div_qr.c (mpn_mu_div_qr2): Remove code for dn==1.
+
+ * mpz/mul.c: Call mpn_sqr directly. Use PTR,SIZ,ALLOC.
+
+ * tune/tuneup.c (tune_mu_div): Set min_size to 6, DC functions require
+ this.
+
+ * tests/mpn/t-div.c: Call mu_div functions with operands that generate
+ a high quotient limb.
+
+ * mpn/generic/mu_div_qr.c: Rewrite to return a high quotient limb,
+ to let dividend argument be constant, and as a general cleanup.
+ * mpn/generic/mu_divappr_q.c: Likewise.
+ * mpn/generic/mu_div_q.c: Likewise.
+ * gmp-impl.h: Update declarations of changed functions.
+
+ * mpn/generic/invertappr.c (mpn_invertappr): Allocate scratch space
+ when caller passed NULL.
+
+2009-12-28 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/generic/toom_couple_handling.c: Prefix name with mpn_.
+ * gmp-impl.h: Likewise.
+ * mpn/generic/toom63_mul.c: Likewise.
+ * mpn/generic/toom6_sqr.c: Likewise.
+ * mpn/generic/toom6h_mul.c: Likewise.
+ * mpn/generic/toom8_sqr.c: Likewise.
+ * mpn/generic/toom8h_mul.c: Likewise.
+
+ * configure.in (gmp_mpn_functions_optional) Move "com" from here...
+ (gmp_mpn_functions): ...to here.
+ * mpn/generic/com.c: New file.
+ * (mpn_com): New name for mpn_com_n. Make public.
+ * (mpn_neg): Analogous changes.
+
+ * tune/tuneup.c (tune_mu_div, tune_mu_bdiv): Set step_factor.
+
+ * tune/common.c, tune/speed.c, tune/speed.h: Support measuring
+ mpn_lshiftc.
+
+ * tests/devel/try.c: Test mpn_lshiftc.
+ * tests/refmpn.c (refmpn_com): New function.
+ (refmpn_lshiftc): Likewise.
+
+ * configure.in (gmp_mpn_functions_optional) Move lshiftc from here...
+ (gmp_mpn_functions): ...to here.
+ * mpn/generic/lshiftc.c: New file.
+ * mpn/x86_64/lshiftc.asm: New file.
+ * mpn/x86_64/core2/lshiftc.asm: New file.
+ * mpn/generic/mul_fft.c (mpn_lshiftc): Remove.
+
+ * mpn/x86_64/core2/lshift.asm: Tweak for better Core iN performance.
+ * mpn/x86_64/core2/rshift.asm: Likewise.
+
+2009-12-27 Marco Bodrato <bodrato@mail.dm.unipi.it>
+
+ * mpn/generic/mul.c: Use toom6h and toom8h for almost balanced.
+
+ * mpn/generic/mullo_n.c (mpn_dc_mullo_n): New ratio, to be used in
+ Toom-8 range.
+
+2009-12-27 Torbjorn Granlund <tege@gmplib.org>
+
+ * (mpn_sqr): New name for mpn_sqr_n. Many files affected.
+
+ * tune/tuneup.c (tune_mullo): Up step_factor for MULLO_MUL_N_THRESHOLD.
+ (tune_invertappr, tune_invert, tune_binvert): Let max_size default.
+
+ * tune/tuneup.c (tune_mu_div, tune_mu_bdiv) New functions.
+ * tune/speed.h (SPEED_ROUTINE_MPN_MU_DIV_Q): New macro.
+ (SPEED_ROUTINE_MPN_MU_DIV_QR): Likewise.
+ (SPEED_ROUTINE_MPN_MU_BDIV_Q): Likewise.
+ (SPEED_ROUTINE_MPN_MU_BDIV_QR): Likewise.
+ * tune/Makefile.am (TUNE_MPN_SRCS_BASIC): Add bdiv_q.c and bdiv_qr.c.
+ * tune/common.c (speed_mpn_mu_div_qr): New function.
+ (speed_mpn_mu_divappr_q): Likewise.
+ (speed_mpn_mu_div_q): Likewise.
+ (speed_mpn_mu_bdiv_q): Likewise.
+ (speed_mpn_mu_bdiv_qr): Likewise.
+
+ * mpn/*/gmp-mparam.h: Fix incorrect MOD_1U_TO_MOD_1_1_THRESHOLD 0
+ values.
+
+ * gmp-impl.h (MODEXACT_1_ODD_THRESHOLD): Remove.
+ (BMOD_1_TO_MOD_1_THRESHOLD): New parameter, with the reverse meaning of
+ MODEXACT_1_ODD_THRESHOLD.
+ (MPN_MOD_OR_MODEXACT_1_ODD): Use BMOD_1_TO_MOD_1_THRESHOLD.
+ * mpn/generic/divis.c, mpz/{cong.c,cong_ui.c,divis_ui.c}: Likewise.
+ * tune/tuneup.c (tune_modexact_1_odd): Tune BMOD_1_TO_MOD_1_THRESHOLD;
+ Do not assume native mpn_modexact_1_odd is faster than mpn_mod_1.
+ (tuned_speed_mpn_mod_1): Remove variable.
+ (tune_mod_1): Fix thinkos. Suppress printing of "always" etc.
+ (all): Measure for divrem_1, mod_1, divexact_1, etc first, since Toom
+ depends on some of them.
+
+ * mpn/generic/toom22_mul.c (TOOM22_MUL_REC): New name for
+ TOOM22_MUL_MN_REC.
+
+2009-12-26 Niels Möller <nisse@lysator.liu.se>
+
+ * tests/mpn/t-toom32.c (MIN_AN, MIN_BN, MAX_BN): Relax
+ requirements a bit.
+
+ * mpn/generic/toom32_mul.c (mpn_toom32_mul): Relax requirement on
+ input sizes, to support s+t>=n (used to be s+t>=n+2). Keep high
+ limbs of the evaluated values in scalar variables.
+
+ * mpn/generic/sbpi1_divappr_q.c (mpn_sbpi1_divappr_q): Remove
+ unused variables.
+
+ * mpn/generic/toom32_mul.c (mpn_toom32_mul): Fixed left-over use
+ of mpn_addsub_n which should be mpn_add_n_sub_n.
+
+2009-12-26 Marco Bodrato <bodrato@mail.dm.unipi.it>
+
+ * tune/Makefile.am (TUNE_MPN_SRCS_BASIC): Add new toom files (spotted by Torbjorn).
+
+ * gmp-impl.h (mpn_toom6_sqr_itch): Rename to mpn_toom6_mul_n_itch and redefine.
+ (mpn_toom8_sqr_itch): Rename to mpn_toom8_mul_n_itch and redefine.
+ * mpn/generic/mul_n.c: Use renamed _itch macros.
+
+2009-12-25 Niels Möller <nisse@lysator.liu.se>
+
+ * tests/mpn/t-toom32.c (MIN_AN, MIN_BN, MAX_BN): Tightened requirements.
+ * gmp-impl.h (mpn_toom32_mul_itch): Updated. Less scratch needed
+ by toom32 itself, and also the pointwise multiplications are
+ currently mpn_mul_n with no supplied scratch.
+ * mpn/generic/toom32_mul.c (mpn_toom32_mul): Reorganized
+ interpolation to use less scratch space. No longer supports the
+ most extreme size ratios.
+
+2009-12-25 Torbjorn Granlund <tege@gmplib.org>
+
+ * tune/tuneup.c (tune_preinv_mod_1): Purge.
+ (tune_mod_1): Use speed_mpn_mod_1_tune for
+ PREINV_MOD_1_TO_MOD_1_THRESHOLD
+
+ * mpn/generic/dcpi1_divappr_q.c: Handle 2n/n properly. Don't use full
+ precision in mpn_sbpi1_divappr_q call. Misc cleanup.
+
+ * tune/tuneup.c (tune_mod_1): Add a check_size for
+ PREINV_MOD_1_TO_MOD_1_THRESHOLD.
+
+2009-12-24 Torbjorn Granlund <tege@gmplib.org>
+
+ * tune/mod_1_div.c (MOD_1N_TO_MOD_1_1_THRESHOLD,
+ (MOD_1U_TO_MOD_1_1_THRESHOLD): Set.
+ * tune/mod_1_inv.c (MOD_1N_TO_MOD_1_1_THRESHOLD,
+ (MOD_1U_TO_MOD_1_1_THRESHOLD): Set.
+
+ * gmp-impl.h (USE_PREINV_MOD_1): Remove.
+ (MPN_MOD_OR_PREINV_MOD_1): Define to choose functions dynamically in
+ terms of PREINV_MOD_1_TO_MOD_1_THRESHOLD (used to choose statically
+ using USE_PREINV_MOD_1).
+ * mpn/generic/perfsqr.c (PERFSQR_MOD_PP): Corresponding updates.
+
+ * tune/tuneup.c (tune_mod_1): Rewrite.
+ * gmp-impl.h (MOD_1N_TO_MOD_1_1_THRESHOLD): New.
+ (MOD_1U_TO_MOD_1_1_THRESHOLD): New name for MOD_1_1_THRESHOLD.
+ (MOD_1_1_TO_MOD_1_2_THRESHOLD): Mew name for MOD_1_2_THRESHOLD.
+ (MOD_1_2_TO_MOD_1_4_THRESHOLD): New name for MOD_1_4_THRESHOLD.
+ * mpn/generic/mod_1.c: Corresponding updates.
+
+2009-12-24 Marco Bodrato <bodrato@mail.dm.unipi.it>
+
+ * mpn/generic/mul_n.c: Use also toom6h and toom8h.
+ * mpn/generic/sqr_n.c: Use also toom6 and toom8.
+ * gmp-impl.h: Initial support for tuning of Toom-6half and Toom-8half.
+ * tune/tuneup.c: Tune Toom-6half and Toom-8half thresholds.
+
+2009-12-24 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/generic/mod_1_4.c: Get ASSERT right.
+ * mpn/generic/mod_1_3.c: Likewise.
+ * mpn/generic/mod_1_2.c: Likewise.
+
+ * mpn/generic/powm_sec.c: Use SQR_TOOM2_THRESHOLD as limit for a native
+ mpn_sqr_basecase, not TUNE_SQR_TOOM2_MAX.
+
+2009-12-23 Marco Bodrato <bodrato@mail.dm.unipi.it>
+
+ * tune/common.c, tune/speed.c, tune/speed.h: Support for measuring
+ mpn_toom8h_mul and mpn_toom8_sqr speed.
+
+ * mpn/generic/toom_eval_pm2exp.c: Fix ASSERTs.
+
+ * mpn/generic/toom8h_mul.c: New file.
+ * mpn/generic/toom8_sqr.c: New file.
+ * mpn/generic/toom_interpolate_16pts.c: New file.
+ * gmp-impl.h: Provide corresponding declarations.
+ * configure.in (gmp_mpn_functions): List toom_interpolate_16pts,
+ toom8h_mul, and toom8h_sqr.
+ * tests/mpn/t-toom8h.c: New test program.
+
+ * mpn/generic/toom6_sqr.c: New file, was part of toom6h_mul.
+ * mpn/generic/toom6h_mul.c: Removed _sqr.
+
+ * mpn/generic/mulmod_bnm1.c: Nailify CRT.
+ * mpn/generic/sqrmod_bnm1.c: Likewise.
+
+ * mpn/generic/mullo_n.c: Split dc_mullo_n function;
+ ALLOC memory at once.
+
+ * mpn/Makefile.am (nodist_EXTRA_libmpn_la_SOURCES): Update.
+
+ * mpn/generic/toom6h_mul.c: Add prefix to toom_interpolate_12pts.
+ * mpn/generic/toom_interpolate_12pts.c: Likewise.
+
+ * mpn/generic/invertappr.c (mpn_bc_invertappr): Use mpn_divrem_2.
+ * mpn/generic/invert.c: Faster basecase, use mpn_sbpi1_div_q.
+
+ * mpn/generic/toom_eval_pm2exp.c: Assert support for degree 3.
+ * mpn/generic/toom6h_mul.c: Avoid obsolete _itch function.
+
+2009-12-23 Torbjorn Granlund <tege@gmplib.org>
+
+ * tune/common.c, tune/speed.c, tune/speed.h: Support for measuring
+ mpn_mod_1_1p, mpn_mod_1s_2p, mpn_mod_1s_3p, mpn_mod_1s_4p.
+
+ * tests/mpz/t-powm.c: Test mpz_powm_sec.
+
+ * mpz/powm_sec.c: New file.
+ * gmp-h.in: Declare it.
+ * Makefile.am, mpz/Makefile.am: Compile it.
+ * doc/gmp.texi: Document it.
+
+ * mpn/generic/powm_sec.c (mpn_powm_sec_itch): New function.
+ (mpn_powm_sec): Use passed scratch, no local allocation.
+ Allow exp argument = 1.
+ (win_size): Start loop from 1.
+
+ * mpn/generic/powm.c (win_size): Start loop from 1.
+
+2009-12-22 Torbjorn Granlund <tege@gmplib.org>
+
+ * tests/mpn/t-div.c: New file.
+ * tests/mpn/Makefile.am: Compile it.
+
+ * mpn/generic/mu_divappr_q.c: Handle quotient overflow.
+
+ * mpn/generic/mu_div_q.c (mpn_mu_div_q_itch): New function.
+
+2009-12-22 Niels Möller <nisse@lysator.liu.se>
+
+ * mpn/generic/sbpi1_div_q.c: Use udiv_qr_3by2. Intended to change
+ nothing after preprocessing.
+
+ * mpn/generic/sbpi1_divappr_q.c: For the last call to udiv_qr_3by2,
+ avoid using memory locations as output parameters, and revert to
+ explicitly copying n1 and n0 to memory.
+
+ * gmp-impl.h (udiv_qr_3by2): Tweaked to expand to precisely the
+ same code as was used before the introduction of this macro.
+ Eliminated some local variables, instead do multiple updates to
+ the output parameters.
+
+2009-12-22 Torbjorn Granlund <tege@gmplib.org>
+
+ * tests/mpn/t-toom6h.c (MIN_AN): Set to MUL_TOOM6H_THRESHOLD to avoid
+ invalid recursive sizes.
+
+ * tests/mpn/t-bdiv.c: Get itch function calls right.
+
+ * mpn/generic/mu_bdiv_q.c (mpn_mu_bdiv_q_itch): Rewrite.
+ * mpn/generic/mu_bdiv_qr.c (mpn_mu_bdiv_qr_itch): Simplify.
+
+ * mpn/generic/bdiv_qr.c (mpn_bdiv_qr): Simplify, don't allocate.
+ (mpn_bdiv_qr_itch): Conditionalise on MU_BDIV_QR_THRESHOLD.
+
+2009-12-18 Niels Möller <nisse@lysator.liu.se>
+
+ * tests/mpn/t-bdiv.c: Add red-zones.
+
+2009-12-21 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/generic/sbpi1_div_q.c: Fix fixup code to work for qn = 0.
+
+ * mpn/generic/dcpi1_divappr_q.c: Handle qn = 1 and qn = 2 for initial
+ quotient block (code block copied from dcpi1_div_qr.c).
+
+ * mpn/generic/dcpi1_div_qr.c: Rewrite singular case giving q limb of
+ GMP_NUMB_MAX. Remove an impossible qn = 0 case.
+
+ * mpn/generic/dcpi1_bdiv_q.c: Remove a spurious mpn_sub_1.
+
+ * mpn/generic/mul.c: Put back call to mpn_mul_n.
+
+ * tune/tuneup.c (all): Call tune_mulmod_bnm1 before tuning fft due to
+ dependency on mulmod_bnm1 from both mul_fft_mul and from mullo_n.
+
+ * mpn/generic/dcpi1_divappr_q.c: ASSERT that dn >= 6 and nn > dn.
+ * mpn/generic/dcpi1_div_q.c: ASSERT that dn >= 6 and nn-dn >= 3.
+ * mpn/generic/dcpi1_div_qr.c: ASSERT that dn >= 6 and nn-dn >= 3.
+
+ * mpn/generic/bdiv_q_1.c (mpn_pi1_bdiv_q_1): Renamed from
+ mpn_bdiv_q_1_pi1.
+ * All references changed.
+
+ * configure.in: Add --enable-old-fft-full.
+ * tune/speed.c (routine): Conditionalise mpn_mul_fft_full references on
+ WANT_OLD_FFT_FULL.
+ * tune/common.c (speed_mpn_mul_fft_full)
+ (speed_mpn_mul_fft_full_sqr): Likewise.
+ * mpn/generic/mul_fft.c (mpn_mul_fft_full): Include iff
+ WANT_OLD_FFT_FULL.
+
+2009-12-21 Marco Bodrato <bodrato@mail.dm.unipi.it>
+
+ * gmp-impl.h (mpn_toom6h_mul_itch): New inline function.
+ (MUL_TOOM6H_THRESHOLD): Default value.
+ (SQR_TOOM6_THRESHOLD): Default value.
+ * mpn/generic/toom6h_mul.c: Remove definitions moved to gmp-impl.h.
+ * tune/common.c, tune/speed.c, tune/speed.h: Support for measuring
+ mpn_toom6h_mul and mpn_toom6_sqr speed.
+
+ * mpn/generic/toom63_mul.c: Remove unused TMP_*.
+
+ * mpn/generic/toom_eval_pm2rexp.c: New file.
+ * gmp-impl.h: Provide corresponding declaration.
+ * configure.in (gmp_mpn_functions): List toom_eval_pm2rexp.
+ * mpn/generic/toom6h_mul.c: Use shared toom_eval_pm2rexp.
+
+ * mpn/generic/toom_couple_handling.c: New file, helper function
+ for high degree Toom.
+ * gmp-impl.h: Provide corresponding declaration.
+ * configure.in (gmp_mpn_functions): List toom_couple_handling.
+ * mpn/generic/toom6h_mul.c: Use shared toom_couple_handling.
+ * mpn/generic/toom63_mul.c: Likewise.
+
+ * mpn/generic/toom6h_mul.c: New file.
+ * mpn/generic/toom_interpolate_12pts.c: New file.
+ * gmp-impl.h: Provide corresponding declarations.
+ * configure.in (gmp_mpn_functions): List toom_interpolate_12pts,
+ toom6h_mul.
+ * tests/mpn/t-toom6h.c: New test program.
+
+ * tests/mpn/t-mulmod_bnm1.c (ref_mulmod_bnm1): Use ref_mul.
+ * tests/mpn/t-sqrmod_bnm1.c (ref_sqrmod_bnm1): Likewise.
+
+2009-12-20 Marco Bodrato <bodrato@mail.dm.unipi.it>
+
+ * mpn/generic/mulmod_bnm1.c (mpn_mulmod_bnm1): New CRT.
+ * mpn/generic/sqrmod_bnm1.c (mpn_sqrmod_bnm1): Likewise.
+
+2009-12-20 Torbjorn Granlund <tege@gmplib.org>
+
+ * Change all bit counts for bignums to use mp_bitcnt_t.
+
+ * mpn/generic/bdivmod.c: File removed. All references purged.
+
+ * mpn/generic/mul_fft.c (mpn_mul_fft_full): Disable.
+
+ * gmp-impl.h: Define mpn_fft_mul as an alias for mpn_nussbaumer_mul.
+ * mpn/generic/mul.c: Refer mpn_fft_mul.
+ * mpn/generic/mul_n.c: Likewise.
+ * mpn/generic/sqr_n.c: Likewise.
+ * mpn/generic/mullo_n.c: Likewise.
+
+ * mpn/generic/mul.c: Loop also over mpn_nussbaumer_mul, as suggested by
+ Marco. Use TMP_SALLOC_LIMBS in more places. Clean up ws allocation.
+
+2009-12-19 Marco Bodrato <bodrato@mail.dm.unipi.it>
+
+ * mpn/generic/toom_interpolate_8pts.c: Nailify.
+
+2009-12-19 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/generic/mul.c: Major rewrite. Use toom43, toom53, toom63.
+ Call mpn_nussbaumer_mul for largest operands.
+
+ * tune/speed.h (SPEED_ROUTINE_MPN_TOOM32_FOR_TOOM43_MUL): New macro.
+ (SPEED_ROUTINE_MPN_TOOM43_FOR_TOOM32_MUL): New macro.
+ (SPEED_ROUTINE_MPN_TOOM32_FOR_TOOM53_MUL): New macro.
+ (SPEED_ROUTINE_MPN_TOOM53_FOR_TOOM32_MUL): New macro.
+ (SPEED_ROUTINE_MPN_TOOM42_FOR_TOOM53_MUL): New macro.
+ (SPEED_ROUTINE_MPN_TOOM53_FOR_TOOM42_MUL): New macro.
+ * tune/common.c (speed_mpn_toom63_mul): New function.
+ (speed_mpn_toom32_for_toom43_mul): New function.
+ (speed_mpn_toom43_for_toom32_mul): New function.
+ (speed_mpn_toom32_for_toom53_mul): New function.
+ (speed_mpn_toom53_for_toom32_mul): New function.
+ (speed_mpn_toom42_for_toom53_mul): New function.
+ (speed_mpn_toom53_for_toom42_mul): New function.
+ * tune/tuneup.c (tune_mul_n): New name for old tune_mul.
+ (tune_sqr_n): New name for old tune_sqr.
+ (tune_mul): New function, for unbalanced multiplication.
+ * gmp-impl.h: Provide declarations for corresponding threshold vars.
+
+ * gmp-impl.h (mpn_rsh1add_nc, mpn_rsh1sub_nc): Declare.
+ * mpn/asm-defs.m4: Likewise.
+ * configure.in: Add corresponding HAVE_NATIVEs.
+ * mpn/x86_64/rsh1aors_n.asm: Add _nc entry point.
+
+2009-12-18 Niels Möller <nisse@lysator.liu.se>
+
+ * mpz/divexact.c: Rewrite to use mpn_divexact.
+
+ * mpn/generic/bdiv_q_1.c (mpn_bdiv_q_1): Deleted some unused
+ variables.
+
+ * mpn/generic/toom52_mul.c (mpn_toom52_mul)
+ [HAVE_NATIVE_mpn_add_n_sub_n]: Moved declaration of cy to avoid a
+ compiler warning.
+
+ * gmp-impl.h (gmp_pi1_t): Eliminated inv21 member.
+ (invert_pi1): ...and don't store it here.
+
+ * mpn/generic/toom63_mul.c (mpn_toom63_mul): Simplified
+ calculation of block size n.
+ * gmp-impl.h (mpn_toom63_mul_itch): Likewise.
+
+ * mpn/generic/toom_eval_pm2exp.c (mpn_toom_eval_pm2exp): Fixed
+ output asserts.
+
+2009-12-18 Torbjorn Granlund <tege@gmplib.org>
+
+ * tests/mpn/t-toom63.c: New test program.
+
+2009-12-18 Marco Bodrato <bodrato@mail.dm.unipi.it>
+
+ * mpn/generic/invert.c: Nailify.
+ * mpn/generic/invertappr.c: Nailify.
+ * mpn/generic/mulmod_bnm1.c: Nailify.
+ * mpn/generic/sqrmod_bnm1.c: Nailify.
+
+ * tests/mpn/t-invert.c: New test program.
+
+ * mpn/generic/toom63_mul.c: New file.
+ * mpn/generic/toom_interpolate_8pts.c: New file.
+ * gmp-impl.h: Provide corresponding declarations.
+ * configure.in (gmp_mpn_functions): List toom_interpolate_8pts and
+ toom63_mul.
+
+2009-12-17 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/generic/mul.c: Move allocation of ws to where it is used.
+ Identify toom22, 32, 42, in that order (in two places). Use midline
+ between toom22, 32, 42.
+ * mpn/generic/toom22_mul.c (TOOM22_MUL_MN_REC): Call also
+ mpn_toom32_mul.
+
+ * doc/gmp.texi: Update References section. Update Contributors
+ section. Misc updates.
+
+ * gmp-impl.h: Renew default values for all THRESHOLDs.
+
+2009-12-17 Niels Möller <nisse@lysator.liu.se>
+
+ * mpn/generic/divexact.c (mpn_divexact): Don't require that the
+ dividend is normalized. Use MPN_DIVREM_OR_PREINV_DIVREM_1. When
+ shifting, allocate and process only the low qn+1 limbs. Eliminated
+ code for the impossible case nn < qn.
+
+ * mpn/generic/dcpi1_div_qr.c (mpn_dcpi1_div_qr): Added some input
+ asserts.
+
+ * mpn/generic/dcpi1_div_qr.c (mpn_dcpi1_div_qr): In the case that
+ the initial quotient block is a single limb, use 3/2 division,
+ thereby eliminating the only use of gmp_pi1_t->inv21.
+
+2009-12-17 Marco Bodrato <bodrato@mail.dm.unipi.it>
+
+ * mpn/generic/invert.c: Added some comment.
+ * mpn/generic/invertappr.c: Slightly better threshold handling.
+ * gmp-impl.h (INV_NEWTON_THRESHOLD): Default to 200.
+
+ * mpn/generic/nussbaumer_mul.c: New file.
+ * configure.in (gmp_mpn_functions): Add nussbaumer_mul.
+ * tune/Makefile.am (TUNE_MPN_SRCS_BASIC): Add nussbaumer_mul.
+ * gmp-impl.h (mpn_nussbaumer_mul): Added prototype and name-mangling.
+ * tune/speed.h (speed_mpn_nussbaumer_mul): Declare function.
+ * tune/common.c (speed_mpn_nussbaumer_mul): New function.
+ * tune/speed.c (routine): Add speed_mpn_nussbaumer_mul.
+
+ * mpn/generic/sqrmod_bnm1.c: New file.
+ * configure.in (gmp_mpn_functions): Add sqrmod_bnm1.
+ * tune/Makefile.am (TUNE_MPN_SRCS_BASIC): Add sqrmod_bnm1.
+ * gmp-impl.h (mpn_sqrmod_bnm1): Added prototype and name-mangling.
+ (SQRMOD_BNM1_THRESHOLD): support for the new threshold.
+ * tune/speed.h (speed_mpn_sqrmod_bnm1): Declare function.
+ * tune/common.c (speed_mpn_sqrmod_bnm1): New function.
+ * tune/speed.c (routine): Add speed_mpn_sqrmod_bnm1.
+ * tests/mpn/t-mulmod_bnm1.c: Attribution.
+ * tests/mpn/t-sqrmod_bnm1.c: New test file.
+ * tests/mpn/Makefile.am (check_PROGRAMS): Add t-sqrmod_bnm1.
+
+ * tune/tuneup.c: Tune SQRMOD_BNM1_THRESHOLD.
+
+ * mpn/generic/nussbaumer_mul.c (mpn_nussbaumer_mul): Mimic fft_mul,
+ use squaring if operands coincide.
+ * tune/speed.h (speed_mpn_nussbaumer_mul_sqr): Declare function.
+ * tune/common.c (speed_mpn_nussbaumer_mul_sqr): New function.
+ * tune/speed.c (routine): Add speed_mpn_nussbaumer_mul_sqr.
+
+2009-12-17 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/generic/bdiv_q.c (mpn_bdiv_q_itch): Rewrite.
+
+2009-12-16 Torbjorn Granlund <tege@gmplib.org>
+
+ * tests/mpn/t-bdiv.c (bdiv_q_valid_p, bdiv_qr_valid_p): Call refmpn_mul
+ instead of refmpn_mul_basecase.
+ * tests/mpn/toom-shared.h: Likewise.
+ * tests/refmpn.c (refmpn_mullo_n,refmpn_sqr,refmpn_mul_any): Likewise.
+
+ * minithres/gmp-mparam.h: Add new thresholds, trim old values.
+
+ * mpn/generic/powm.c: Use mp_bitcnt_t for bit counts.
+ Handle REDC_1_TO_REDC_N_THRESHOLD < MUL_TOOM22_THRESHOLD in
+ non-WANT_REDC_2 INNERLOOP expansion code.
+ * mpn/generic/powm_sec.c: Use mp_bitcnt_t for bit counts.
+
+2009-12-16 Niels Möller <nisse@lysator.liu.se>
+
+ * tests/mpz/t-gcd.c (main): Added test case to exercise the
+ unlikely u0 == u1 case in mpn_gcdext_lehmer_n.
+
+ * mpn/generic/gcdext_lehmer.c (mpn_gcdext_lehmer_n): Get ASSERT
+ right.
+
+2009-12-16 Torbjorn Granlund <tege@gmplib.org>
+
+ * tests/mpz/t-mul.c: Misc cleanups.
+ (mul_basecase): Remove.
+ (ref_mpn_mul): Remove.
+ * tests/refmpn.c (refmpn_mul): New function, mainly from t-mul.c's
+ ref_mpn_mul.
+ (refmpn_mullo_n): Add a missing free.
+
+ * tune/speed.c (routine): Measure speed_mpn_{sb,dc}pi1_div_qr,
+ mpn_{sb,dc}pi1_divappr_q, mpn_{sb,dc}pi1_bdiv_qr, and
+ mpn_{sb,dc}pi1_bdiv_q.
+
+ * mpn/generic/invertappr.c: New file, meat from invert.c.
+ * mpn/generic/invert.c: Leave just mpn_invert.c.
+ * configure.in (gmp_mpn_functions): Add invertappr.
+ * tune/Makefile.am (TUNE_MPN_SRCS_BASIC): Add invertappr.c.
+ * gmp-impl.h (mpn_invert_itch, mpn_invertappr_itch): New macros.
+
+2009-12-15 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/generic/gcdext_subdiv_step.c: Get an ASSERT right.
+
+2009-12-15 Niels Möller <nisse@lysator.liu.se>
+
+ * mpn/generic/sbpi1_div_qr.c (mpn_sbpi1_div_qr): A very small step
+ towards nail support.
+
+2009-12-15 Marco Bodrato <bodrato@mail.dm.unipi.it>
+
+ * gmp-impl.h (mpn_ni_invertappr): Added prototype and name-mangling.
+ * mpn/generic/mulmod_bnm1.c: Comment representation of class [0].
+
+2009-12-14 Niels Möller <nisse@lysator.liu.se>
+
+ * mpn/generic/sbpi1_divappr_q.c (mpn_sbpi1_divappr_q): Use
+ udiv_qr_3by2.
+
+2009-12-14 Torbjorn Granlund <tege@gmplib.org>
+
+ * tune/tuneup.c (tune_binvert): Remove BINV_MULMOD_BNM1_THRESHOLD
+ tuning, it was always zero and caused BINV_NEWTON_THRESHOLD to be
+ wrong (as pointed out by Marco).
+ * (BINV_MULMOD_BNM1_THRESHOLD): Clean from other files too.
+
+2009-12-14 Marco Bodrato <bodrato@mail.dm.unipi.it>
+
+ * mpn/generic/invert.c: Improved comments.
+ (mpn_bc_invertappr): Conditionally re-enable mpn_dcpi1_divappr_q.
+
+2009-12-14 Niels Möller <nisse@lysator.liu.se>
+
+ * gmp-impl.h (udiv_qr_3by2): Fix typo in argument list.
+
+2009-12-13 Niels Möller <nisse@lysator.liu.se>
+
+ * gmp-impl.h (udiv_qr_3by2): New macro.
+ * mpn/generic/sbpi1_div_qr.c (mpn_sbpi1_div_qr): Use udiv_qr_3by2.
+
+2009-12-13 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/generic/dcpi1_divappr_q.c (mpn_dcpi1_divappr_q): Avoid a buffer
+ overrun.
+
+ * mpn/generic/mul_fft.c (mpn_mul_fft_full): Handle carry-out from 2nd
+ mpn_mul_fft, add an ASSERT for the 1st mpn_mul_fft. Replace some
+ comments on cc's range with ASSERTs.
+
+ * mpn/generic/gcdext.c (compute_v): Normalise tp[] after mpn_mul.
+
+ * mpz/powm.c: Rework buffer handling.
+
+2009-12-13 Niels Möller <nisse@lysator.liu.se>
+
+ * tests/mpn/toom-shared.h (main): Use refmpn_mul_basecase to check
+ results (slow!). Iteration counts of all toom tests reduced
+ considerably.
+
+2009-12-13 Marco Bodrato <bodrato@mail.dm.unipi.it>
+
+ * mpn/generic/invert.c (mpn_invertapp): Split in _bc and _ni.
+ (mpn_bc_invertappr): New function, the basecase.
+ (mpn_ni_invertapp): New function, Newton iteration.
+ (mpn_invert): Use mpn_ni_invertapp.
+ * tune/tuneup.c (tune_invert): Min for INV_APPR_THRESHOLD.
+ (tune_invertappr): Min for INV_NEWTON_THRESHOLD.
+
+ * tune/speed.h (SPEED_ROUTINE_MPN_NI_INVERTAPPR): New macro.
+ (speed_mpn_ni_invertappr): Declare function.
+ * tune/common.c (speed_mpn_ni_invertappr): New function.
+ * tune/speed.c (routine): Add speed_mpn_ni_invertappr.
+
+ * tune/tuneup.c (tune_invertappr): Use speed_mpn_ni_invertappr to
+ tune INV_MULMOD_BNM1_THRESHOLD.
+
+2009-12-12 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/generic/mu_bdiv_qr.c (mpn_mu_bdiv_qr_itch): Rewrite.
+
+2009-12-12 Marco Bodrato <bodrato@mail.dm.unipi.it>
+
+ * tests/mpn/t-mulmod_bnm1.c (main): Disable B^n+1 stressing test
+ for odd sizes.
+
+ * mpn/generic/invert.c: Complete rewrite. Uses Newton iterations.
+ * gmp-impl.h (mpn_invertappr): Added prototype and name-mangling.
+ (mpn_invertappr_itch): Added prototype and name-mangling.
+ (INV_APPR_THRESHOLD): Support for a new tunable const.
+ * tune/speed.h (SPEED_ROUTINE_MPN_INVERTAPPR): New macro.
+ (speed_mpn_invertappr): Declare function.
+ * tune/common.c (speed_mpn_invertappr): New function.
+ * tune/speed.c (routine): Add speed_mpn_invertappr.
+ * tune/tuneup.c (tune_invertappr): New function: was tune_invert.
+ (tune_invert): Now tune only INV_APPR_THRESHOLD.
+ (all): Enable call to tune_invert and tune_invertappr.
+
+2009-12-11 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/generic/binvert.c: Use mpn_mulmod_bnm1 instead of FFT wrapping.
+ Old, evidently broken wrapping code removed.
+ * tune/tuneup.c (tune_binvert): Tune BINV_MULMOD_BNM1_THRESHOLD.
+ * gmp-impl.h: Provide declarations for corresponding threshold var.
+
+ * tests/mpn/t-bdiv.c (COUNT): Decrease to keep run time reasonable.
+
+ * tune/tuneup.c (tune_invert): Tune INV_MULMOD_BNM1_THRESHOLD.
+ * gmp-impl.h: Provide declarations for corresponding threshold var.
+
+ * tests/mpn/t-mulmod_bnm1.c: Avoid a division by zero.
+
+ * configure.in: Set up different paths for different 64-bit sparc
+ processors.
+ * mpn/sparc64/ultrasparc34/gmp-mparam.h: New file.
+
+2009-12-10 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/*/gmp-mparam.h: Regenerate many of these files.
+
+2009-12-10 Niels Möller <nisse@lysator.liu.se>
+
+ * gmp-impl.h (mpn_divexact): Removed scratch pointer from
+ prototype.
+ * mpn/generic/gcdext.c (divexact): Deleted, moved to...
+ * mpn/generic/divexact.c (mpn_divexact): New implementation (moved
+ from gcdext.c). The bidirectional divexact is kept but #if:ed out.
+ Interface change, since the new code doesn't take a scratch
+ argument.
+
+ * tests/mpn/t-mulmod_bnm1.c (main): Ensure that an >= bn. Lowered
+ MIN_N to 1. Various fixes to handle n == 1 properly.
+
+ * mpn/generic/mulmod_bnm1.c (mpn_mulmod_bnm1): Small interface
+ change, require an >= bn.
+
+ * mpn/generic/mulmod_bnm1.c (mpn_mulmod_bnm1): Fixed non-recursive
+ case to not write beyond end of result area.
+
+2009-12-09 Torbjorn Granlund <tege@gmplib.org>
+
+ * tune/speed.h (SPEED_ROUTINE_MPN_MULMOD_BNM1_CALL): New macro, made
+ from now deleted SPEED_ROUTINE_MPN_MULMOD_BNM1.
+ * tune/common.c (speed_mpn_bc_mulmod_bnm1): New function.
+ (speed_mpn_mulmod_bnm1): Use SPEED_ROUTINE_MPN_MULMOD_BNM1_CALL.
+ * tune/speed.c (routine): Add mpn_bc_mulmod_bnm1.
+
+ * mpn/generic/mulmod_bnm1.c (mpn_mulmod_bnm1_next_size): Rewrite.
+
+ * tune/tuneup.c (tune_mulmod_bnm1): Rewrite.
+
+2009-12-08 Marco Bodrato <bodrato@mail.dm.unipi.it>
+
+ * mpn/generic/mulmod_bnm1.c (mpn_bc_mulmod_bnm1,
+ mpn_bc_mulmod_bnp1): Added a parameter for scratch area, possibly
+ same as result area (as suggested by Niels Möller).
+ (mpn_mulmod_bnm1): Calls changed accordingly.
+
+2009-12-08 Niels Möller <nisse@lysator.liu.se>
+
+ * mpn/generic/gcdext_1.c (mpn_gcdext_1) [GCDEXT_1_USE_BINARY]: Use
+ table lookup for count_trailing_zeros. Binary algorithm still
+ disabled by default.
+
+ * mpn/generic/gcdext.c (divexact): Local definition of divexact,
+ using mpn_bdiv_q.
+ (compute_v): Use it.
+
+ * tests/mpn/Makefile.am (check_PROGRAMS): Added t-bdiv.
+
+ * tests/mpn/t-bdiv.c: New file.
+
+ * mpn/generic/bdiv_q.c (mpn_bdiv_q): Fixed bad quotient length,
+ should have qn == nn.
+
+ * mpn/generic/bdiv_qr.c (mpn_bdiv_qr): Pass correct nn length to
+ the lower-level functions.
+
+2009-12-08 Torbjorn Granlund <tege@gmplib.org>
+
+ * tune/speed.h (SPEED_ROUTINE_MPN_MULMOD_BNM1_ROUNDED): New define.
+ * tune/common.c (speed_mpn_mulmod_bnm1_rounded): New function.
+ * tune/speed.c (routine): Add mpn_mulmod_bnm1_rounded for measuring
+ mpn_mulmod_bnm1 at recommended sizes.
+
+ * mpn/generic/mulmod_bnm1.c (mpn_mulmod_bnm1_next_size): Rewrite.
+ (mpn_bc_mulmod_bnm1): Use mpn_add_n instead of mpn_add.
+
+ * tune/speed.c (routine): Add mpn_invert.
+
+ * tune/tuneup.c (tune_invert): New function.
+ * tune/speed.h (SPEED_ROUTINE_MPN_INVERT): New macro.
+ * tune/common.c (speed_mpn_invert): New function.
+ * gmp-impl.h: Provide declarations for corresponding threshold var.
+ * tune/Makefile.am (TUNE_MPN_SRCS_BASIC): Add invert.c.
+
+2009-12-08 Marco Bodrato <bodrato@mail.dm.unipi.it>
+
+ * tests/devel/try.c: Test mpn_addlsh2_n and mpn_{add,sub}lsh_n;
+ mpn_rsblsh_n now tests all shift values.
+ * tests/refmpn.c (refmpn_addlsh_n, refmpn_sublsh_n): New functions.
+ (refmpn_addlsh1_n): Use generic refmpn_addlsh_n.
+ (refmpn_sublsh1_n): Use generic refmpn_sublsh_n.
+ (refmpn_addlsh2_n): New function.
+ * tests/tests.h: Declare new functions.
+
+2009-12-06 Torbjorn Granlund <tege@gmplib.org>
+
+ * tune/tuneup.c (tune_mulmod_bnm1): Up min_size to 12.
+
+ * Globally: Rename *mullow* to *mullo*, *MULLOW* to *MULLO*.
+
+ * configure.in: Don't include ev5 directory for ev6* and ev7. Misc
+ alpha path cleanups.
+ * mpn/alpha/add_n.asm: Replaced by mpn/alpha/ev5/add_n.asm.
+ * mpn/alpha/sub_n.asm: Replaced by mpn/alpha/ev5/sub_n.asm.
+ * mpn/alpha/lshift.asm: Replaced by mpn/alpha/ev5/lshift.asm.
+ * mpn/alpha/rshift.asm: Replaced by mpn/alpha/ev5/rshift.asm.
+ * mpn/alpha/com_n.asm: New, moved from mpn/alpha/ev5/rshift.asm.
+ * mpn/alpha/ev5/diveby3.asm: New, moved from mpn/alpha/diveby3.asm.
+
+ * mpn/powerpc64/mode64/diveby3.asm: Remove, it is slower than
+ mpn_bdiv_dbm1c on all hardware.
+
+ * mpn/generic/powm_sec.c: Rework logic for mpn_sqr_basecase size limit.
+
+ * gmp-impl.h (mpn_redc_1_sec): Declare.
+ * configure.in (gmp_mpn_functions): Add redc_1_sec.
+
+2009-12-06 Marco Bodrato <bodrato@mail.dm.unipi.it>
+
+ * tests/devel/try.c (try_one): DATA_SRC0_HIGHBIT sets the high bit.
+
+2009-12-05 Marco Bodrato <bodrato@mail.dm.unipi.it>
+
+ * mpn/generic/toom_eval_dgr3_pm1.c: Change return value: 0 or ~0.
+ * mpn/generic/toom_eval_dgr3_pm2.c: Likewise.
+ * mpn/generic/toom_eval_pm1.c: Likewise.
+ * mpn/generic/toom_eval_pm2exp.c: Likewise.
+ * mpn/generic/toom_eval_pm2.c: Rewrite to use mpn_addlsh2_n.
+
+ * mpn/generic/toom_interpolate_5pts.c: Param sa is a flag, not a sign.
+
+ * mpn/generic/toom33_mul.c: Adapt to changes above.
+ * mpn/generic/toom3_sqr.c: Likewise.
+ * mpn/generic/toom42_mul.c: Likewise.
+ * mpn/generic/toom43_mul.c: Reduce branches.
+ * mpn/generic/toom44_mul.c: Likewise.
+ * mpn/generic/toom53_mul.c: Likewise.
+ * mpn/generic/toom62_mul.c: Likewise.
+
+ * mpn/generic/toom52_mul.c: Use toom_eval_ functions.
+
+ * mpn/generic/toom4_sqr.c: Avoid C99 construct.
+ * mpn/generic/toom_interpolate_7pts.c: Likewise.
+
+2009-12-05 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/generic/redc_1_sec.c: New file.
+ * mpn/generic/powm_sec.c: Use redc_1_sec. Use dummy full subtract
+ instead of mpn_cmp since the latter leaks to the side channel.
+ (mpn_local_sqr_n): New function, with associated macros.
+ (mpn_powm_sec): Use mpn_local_sqr_n.
+
+ * configure.in (HAVE_NATIVE): Add missing functions, then sort.
+
+2009-12-04 Torbjorn Granlund <tege@gmplib.org>
+
+ * tune/tuneup.c (tune_dc_div): Up min_size to 6.
+ (tune_mod_1): Set MOD_1_1_THRESHOLD min_size to 2.
+
+ * tune/speed.h: Negate "binvert"-type inverses, as required.
+
+ * mpn/generic/redc_1.c: Add ASSERTs.
+ * mpn/generic/redc_2.c: Likewise.
+
+ * mpn/generic/sbpi1_bdiv_q.c: Simplify loops, indexing.
+
+2009-12-03 Yann Droneaud <yann@droneaud.fr>
+
+ * acinclude.m4 ([long long reliability test 1]): Add a "static" for C99
+ inline semantics compatibility.
+
+2009-12-03 Torbjorn Granlund <tege@gmplib.org>
+
+ * configure.in: Move intptr_t test into common AC_CHECK_TYPES.
+
+ * mpn/generic/gcdext.c: Add a TMP_FREE.
+
+2009-12-03 Niels Möller <nisse@lysator.liu.se>
+
+ * mpn/generic/gcdext_1.c (mpn_gcdext_1) [GCDEXT_1_USE_BINARY]:
+ Added various masking tricks.
+
+ * mpn/generic/gcdext_1.c (mpn_gcdext_1) [GCDEXT_1_USE_BINARY]:
+ Reimplemented binary gcdext, with proper canonicalization.
+
+ * mpn/generic/gcdext_lehmer.c (mpn_gcdext_lehmer_n): Handle v == 0
+ from mpn_gcdext_1.
+ * mpn/generic/gcdext_1.c (mpn_gcdext_1): Allow inputs with a < b,
+ assertions fixed accordingly.
+
+2009-12-03 Torbjorn Granlund <tege@gmplib.org>
+
+ * tune/tuneup.c: Tune DC_DIVAPPR_Q_THRESHOLD. Rewrite
+ DC_DIV_QR_THRESHOLD tuning code.
+ (tune_dc_div): Rewrite.
+ * tune/speed.h (SPEED_ROUTINE_MPN_PI1_DIV): New macro.
+ * tune/common.c (speed_mpn_sbpi1_div_qr, speed_mpn_dcpi1_div_qr,
+ speed_mpn_sbpi1_divappr_q, speed_mpn_sbpi1_bdiv_qr): New functions.
+ * gmp-impl.h: Provide declarations for corresponding threshold vars.
+ * tune/Makefile.am (TUNE_MPN_SRCS_BASIC): Add dcpi1_divappr_q.c.
+
+ * tune/tuneup.c (tune_binvert): Up max_size.
+
+2009-12-02 Marco Bodrato <bodrato@mail.dm.unipi.it>
+
+ * tests/devel/try.c: Test mpn_rsblsh2_n and mpn_rsblsh_n.
+ * tests/refmpn.c (refmpn_rsblsh_n, refmpn_rsblsh2_n): New functions.
+ (refmpn_rsblsh1_n): Use generic refmpn_rsblsh_n.
+ * tests/tests.h: Declare new functions.
+
+2009-12-03 Niels Möller <nisse@lysator.liu.se>
+
+ * mpn/generic/gcdext_subdiv_step.c (mpn_gcdext_subdiv_step):
+ Select the right cofactor in the cases A == B or A == 2B.
+
+ * mpn/generic/gcdext_lehmer.c (mpn_gcdext_lehmer_n): Deleted
+ handling of ap[0] == 0 and bp[0] == 0; these cases don't happen.
+ Select the right cofactor in the case ap[0] == bp[0].
+ * mpn/generic/gcdext.c (mpn_gcdext): Analogous changes.
+
+2009-12-02 Niels Möller <nisse@lysator.liu.se>
+
+ * gmp-h.in (mpn_gcdext_1): Updated prototype.
+ * mpn/generic/gcdext_lehmer.c (mpn_gcdext_lehmer_n): Updated for
+ signed cofactors from gcdext_1.
+ * mpn/generic/gcdext_1.c (mpn_gcdext_1): Use Euclid's algorithm,
+ and return signed cofactors.
+
+2009-12-02 Torbjorn Granlund <tege@gmplib.org>
+
+ * doc/gmp.texi (Low-level Functions): Document mpn_sqr_n.
+
+ * tune/speed.c (routine): Add mpn_binvert.
+
+ * tune/tuneup.c: Tune BINV_NEWTON_THRESHOLD.
+ (tune_binvert): New function.
+ * tune/speed.h (SPEED_ROUTINE_MPN_BINVERT): New macro.
+ * tune/common.c (speed_mpn_binvert): New function.
+ * gmp-impl.h: Provide declarations for corresponding threshold var.
+ * tune/Makefile.am (TUNE_MPN_SRCS_BASIC): Add binvert.c.
+
+ * tune/tuneup.c: Tune DC_BDIV_QR_THRESHOLD and DC_BDIV_Q_THRESHOLD.
+ (tune_dc_bdiv): New function.
+ (tune_dc_div): New name for tune_dc.
+ * tune/speed.h (SPEED_ROUTINE_MPN_PI1_BDIV_QR,
+ SPEED_ROUTINE_MPN_PI1_BDIV_Q): New macros.
+ * tune/common.c (speed_mpn_sbpi1_bdiv_qr, speed_mpn_dcpi1_bdiv_qr,
+ speed_mpn_sbpi1_bdiv_q, speed_mpn_dcpi1_bdiv_q): New functions.
+ * gmp-impl.h: Provide declarations for corresponding threshold vars.
+ * tune/Makefile.am (TUNE_MPN_SRCS_BASIC): Add dcpi1_bdiv_qr.c and
+ dcpi1_bdiv_q.c.
+
+2009-12-01 Marco Bodrato <bodrato@mail.dm.unipi.it>
+
+ * mpn/generic/toom53_mul.c: Removed double computation of vinf.
+
+ * mpn/x86_64/aorrlsh_n.asm: Correct return value for rsblsh_n.
+ * mpn/asm-defs.m4 (define_mpn): Add rsblsh_n.
+ * gmp-impl.h (mpn_rsblsh_n): Added prototype and name-mangling.
+
+ * mpn/generic/fib2_ui.c: Reduce the amount of temporary storage.
+ Use mpn_rsblsh_n.
+
+2009-12-01 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/generic/redc_n.c: Rework temp allocation.
+
+ * mpn/generic/dcpi1_bdiv_qr.c (mpn_dcpi1_bdiv_qr_n_itch): Add pi1 also
+ to this function.
+
+ * mpn/generic/dcpi1_bdiv_q.c: Get the mpn_sbpi1_bdiv_q call right.
+ Misc cleanups.
+
+ * tune/speed.c (routine): Fix typo in last change.
+ Add mpn_redc_2.
+
+ * tune/speed.h (SPEED_ROUTINE_REDC_N): Set min size properly.
+
+2009-12-01 Niels Möller <nisse@lysator.liu.se>
+
+ * tune/speed.c (routine): Added mpn_toom42_mul and mpn_redc_n.
+ * tune/speed.h (SPEED_ROUTINE_MPN_TOOM42_MUL): New macro.
+ (speed_mpn_toom42_mul): Declare function.
+ * tune/common.c (speed_mpn_toom42_mul): New function.
+ * gmp-impl.h (MPN_TOOM42_MUL_MINSIZE): New constant.
+
+2009-11-30 Marco Bodrato <bodrato@mail.dm.unipi.it>
+
+ * mpn/generic/fib2_ui.c: Use mpn_rsblsh2_n.
+
+2009-11-29 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/x86_64/pentium4/gmp-mparam.h
+ (HAVE_NATIVE_mpn_addlsh1_n, HAVE_NATIVE_mpn_sublsh1_n): Don't undef.
+
+ * Makefile.am (EXTRA_DIST): Remove macos.
+
+2009-11-28 Torbjorn Granlund <tege@gmplib.org>
+
+ * tune/tuneup.c (tune_redc): Set min_size to 16 for redc_n tuning.
+
+ * mpn/x86_64/sqr_basecase.asm (SQR_TOOM2_THRESHOLD_MAX): Avoid quoting
+ to allow configure.in parse it more easily. Trim from 120 to 80.
+
+2009-11-28 Marco Bodrato <bodrato@mail.dm.unipi.it>
+
+ * mpn/generic/mulmod_bnm1.c: Basecases made simpler, this also corrects
+ a bug affecting previous version.
+
+2009-11-28 Torbjorn Granlund <tege@gmplib.org>
+
+ * configure.in: Handle atom also in 32-bit mode.
+ * mpn/x86/atom/gmp-mparam.h: New file.
+
+ * gmp-impl.h (MULMOD_BNM1_THRESHOLD): Default.
+
+ * mpn/generic/redc_n.c: Use mpn_mulmod_bnm1 instead of mpn_mul_n.
+
+ * Use TMP_ALLOC_LIMBS consistently.
+ * Finish renaming BITS_PER_MP_LIMB to GMP_LIMB_BITS.
+
+ * macos: Remove entire directory.
+
+2009-11-27 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/x86_64/corei/gmp-mparam.h: New file.
+ * mpn/x86_64/core2/gmp-mparam.h: Now for just core2.
+ * mpn/powerpc64/mode64/p3/gmp-mparam.h: New file.
+ * mpn/powerpc64/mode64/p4/gmp-mparam.h: New file.
+ * mpn/powerpc64/mode64/p5/gmp-mparam.h: New file.
+
+ * config.guess: Return "corei" for core i7 and core i5.
+ * config.sub: Recognise "corei".
+ * acinclude.m4 (X86_64_PATTERN): Add corei.
+ * configure.in (powerpc): Set up more CPU-specific paths.
+ (x86): Handle corei.
+
+ * mpz/powm.c: Allow input operand overlap also when exponent = 1.
+ Misc cleanups.
+
+2009-11-26 Marco Bodrato <bodrato@mail.dm.unipi.it>
+
+ * tests/mpn/t-mulmod_bnm1.c: New test file.
+ * tests/mpn/Makefile.am (check_PROGRAMS): Add t-mulmod_bnm1.
+
+ * mpn/generic/mullow_n.c: Comments on Mulders' trick implementation.
+
+2009-11-26 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/generic/powm.c: Make comments reflect current code state.
+
+ * tests/devel/try.c: Make mpn_mullow_n testing actually work.
+
+2009-11-25 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpz/powm.c: Clean up unused defs.
+
+2009-11-24 Torbjorn Granlund <tege@gmplib.org>
+
+ * tune/tuneup.c (tune_redc): Rewrite.
+ * mpn/generic/powm.c: Use REDC_1_TO_REDC_2_THRESHOLD,
+ REDC_1_TO_REDC_N_THRESHOLD, and REDC_2_TO_REDC_N_THRESHOLD.
+ Get rid of previous REDC params, including LOCAL_REDC_N_THRESHOLD.
+ (WANT_REDC_2): Define.
+ * gmp-impl.h: Corresponding changes.
+
+2009-11-23 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/generic/powm.c: Fix typo.
+ Define LOCAL_REDC_N_THRESHOLD, use in REDC_2_THRESHOLD...
+ REDC_N_THRESHOLD chain.
+
+2009-11-22 Torbjorn Granlund <tege@gmplib.org>
+
+ * tune/tuneup.c (tune_mullow): Set min_size to 1.
+
+ * mpn/generic/powm_sec.c: Use just mpn_mul_basecase and
+ mpn_sqr_basecase for multiplication and squaring.
+
+ * tune/tuneup.c: Tune REDC_2_THRESHOLD and REDC_N_THRESHOLD.
+ (tune_redc): New function.
+ (tune_powm): Remove function.
+ * tune/speed.h (SPEED_ROUTINE_REDC_2, SPEED_ROUTINE_REDC_N): New.
+ * tune/common.c (speed_mpn_redc_2, speed_mpn_redc_n): New.
+
+ * mpz/powm.c: Complete rewrite. Use mpn_powm and mpn_powlo.
+ * mpn/generic/powm.c: Rewrite.
+ * mpn/generic/redc_n.c: New file.
+ * configure.in (gmp_mpn_functions): Add redc_n.
+ * gmp-impl.h (REDC_2_THRESHOLD, REDC_N_THRESHOLD): Default, and define
+ for tuneup.
+
+2009-11-21 Marco Bodrato <bodrato@mail.dm.unipi.it>
+
+ * mpn/generic/mullow_n.c: Disable Mulders' trick for small operands,
+ use fft for bigger ones.
+ * tests/mpn/t-mullo.c: New test file.
+
+2009-11-22 Torbjorn Granlund <tege@gmplib.org>
+
+ * tune/tuneup.c (tune_mullow): Rewrite.
+
+2009-11-21 Marco Bodrato <bodrato@mail.dm.unipi.it>
+
+ * gmp-impl.h: Removed unused macros (CACHED_ABOVE_THRESHOLD and
+ CACHED_BELOW_THRESHOLD).
+
+ * mpn/generic/mullow_n.c: Use Mulders' trick.
+ * tune/tuneup.c (tune_mullow): MULLOW_MUL_N_THRESHOLD range of
+ search depends on FFT tuning;
+ (all): Anticipate tune_fft_{mul,sqr}.
+
+ * tune/speed.c (routine): Add entry related to mpn_mulmod_bnm1.
+
+2009-11-19 Niels Möller <nisse@lysator.liu.se>
+
+ * mpn/generic/toom_eval_dgr3_pm2.c (mpn_toom_eval_dgr3_pm2)
+ [HAVE_NATIVE_mpn_add_n_sub_n]: Fixed typo in mpn_add_n_sub_n call
+ (spotted by Marco Bodrato).
+ * mpn/generic/toom_eval_pm2.c (mpn_toom_eval_pm2): Likewise.
+ * mpn/generic/toom_eval_pm2exp.c (mpn_toom_eval_pm2exp): Likewise.
+
+ * mpn/generic/toom_eval_pm2.c (mpn_toom_eval_pm2) [HAVE_NATIVE_mpn_addlsh_n]:
+ Fixed missing declaration.
+
+ * mpn/asm-defs.m4 (define_mpn): Add addlsh_n.
+ * gmp-impl.h (mpn_addlsh_n): Added prototype and name-mangling.
+
+2009-11-19 Niels Möller <nisse@lysator.liu.se>
+
+ * mpn/generic/toom_eval_pm2.c (mpn_toom_eval_pm2): New file.
+ * mpn/generic/toom53_mul.c (mpn_toom53_mul): Use mpn_toom_eval_pm2.
+ * mpn/generic/toom62_mul.c (mpn_toom62_mul): Likewise.
+ * configure.in (gmp_mpn_functions): Added toom_eval_dgr3_pm2.
+
+2009-11-18 Torbjorn Granlund <tege@gmplib.org>
+
+ * gmp-impl.h (mpn_and_n, etc): Adapt to now-public logic functions.
+
+ * config.guess: Recognise VIA nano.
+ * config.sub: Likewise.
+ * configure.in: Generalise x86_64 support; recognise VIA nano.
+
+2009-11-16 Torbjorn Granlund <tege@gmplib.org>
+
+ * tune/speed.c (routine): Add measurement of mpn_addlsh2_n,
+ mpn_sublsh2_n, mpn_rsblsh2_n.
+ * tune/common.c: Add speed routines for lsh2 functions.
+
+ * mpn/generic/divis.c: Use MU_BDIV_QR_THRESHOLD.
+
+ * configure.in (gmp_mpn_functions_optional): Add *lsh_n functions.
+
+ * mpn/generic/toom_eval_pm2exp.c: Make HAVE_NATIVE_mpn_addlsh_n code
+ work.
+
+ * mpn/x86_64/aorrlsh2_n.asm: Optimise inner loop.
+
+ * configure.in (gmp_mpn_functions_optional): Remove copyi,copyd, they
+ are now in gmp_mpn_functions. Analogously move logical functions.
+
+2009-11-16 Marco Bodrato <bodrato@mail.dm.unipi.it>
+
+ * mpn/generic/toom53_mul.c: Use addlsh2 for evaluation (and fix typo).
+ * mpn/generic/toom_eval_dgr3_pm2.c: Likewise (affects toom44 and 43).
+
+ * mpn/asm-defs.m4: Fix comments for op_lsh2 new functions.
+ * gmp-impl.h: Likewise.
+ * tests/mpz/t-fac_ui.c: Fix a comment.
+
+2009-11-15 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/x86_64/aorrlsh2_n.asm: New file.
+ * configure.in: Add support for addlsh2_n, sublsh2_n, and rsblsh2_n,
+ including mulfuncs.
+ * gmp-impl.h (mpn_addlsh2_n, mpn_sublsh2_n, mpn_rsblsh2_n): Declare.
+ * mpn/asm-defs.m4: Likewise.
+
+ * mpn/generic/copyi.c: New file.
+ * mpn/generic/copyd.c: Likewise.
+ * mpn/generic/zero.c: Likewise.
+ * gmp-h.in: Declare new functions.
+ * configure.in (gmp_mpn_functions): Add new functions.
+
+2009-11-15 Marco Bodrato <bodrato@mail.dm.unipi.it>
+
+ * mpn/generic/mulmod_bnm1.c (mpn_mulmod_bnm1_next_size): fix typo
+
+ * mpn/generic/toom33_mul.c: Use rsblsh1 for evaluation.
+ * mpn/generic/toom3_sqr.c: Likewise.
+
+2009-11-14 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/generic/toom52_mul.c: Use mpn_addlsh1_n.
+
+ * mpn/generic/toom52_mul.c: Toggle the right flag bit in an
+ HAVE_NATIVE_mpn_add_n_sub_n arm.
+
+ * tests/mpz/t-remove.c: New file.
+
+ * mpn/generic/remove.c: Major overhaul. Add parameter 'cap'.
+
+ * mpn/generic/binvert.c: Fix typo in last change.
+
+ * mpn/generic/bdiv_qr.c: Make it actually work. Also use passed-in
+ scratch space.
+
+ * mpn/generic/mu_bdiv_qr.c: Reset FFT parameters for each call.
+
+2009-11-12 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/x86/k7/gcd_1.asm (MASK): Compute from MAXSHIFT.
+
+2009-11-11 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/generic/binvert.c: Simplify, fix comments.
+
+ * tests/devel/try.c: Test mpn_invert and mpn_binvert.
+
+ * tests/refmpn.c (refmpn_invert, refmpn_binvert): New functions.
+ * tests/tests.h: Declare new functions.
+
+2009-11-10 Torbjorn Granlund <tege@gmplib.org>
+
+ * configure.in: Supply compiler options for atom in 32-bit mode.
+
+ * acinclude.m4 (X86_64_PATTERN): New.
+ * configure.in: Setup and use X86_64_PATTERN.
+
+ * mpn/x86_64/fat/fat.c: New file.
+ * mpn/x86_64/fat/fat_entry.asm: New file.
+ * mpn/x86_64/fat: Copy C placeholder files from mpn/x86/fat.
+ * mpn/x86_64/x86_64-defs.m4 (CPUVEC_FUNCS_LIST): New, copied from
+ mpn/x86/x86-defs.m4.
+ * configure.in: Move down x86 fat setup code until after ABI has been
+ determined; generalise to handle x86_64.
+
+2009-11-09 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/x86/fat/mod_1.c: New file.
+
+ * acinclude.m4 (GMP_C_FOR_BUILD_ANSI): Avoid poor quoting.
+
+2009-11-08 Torbjorn Granlund <tege@gmplib.org>
+
+ * gmp-impl.h (MPN_LOGOPS_N_INLINE): Rewrite, update interface. Callers
+ updated.
+ * mpn/generic/logops_n.c: New file.
+ * doc/gmp.texi (Low-level Functions): Document logical mpn functions.
+
+2009-11-07 Torbjorn Granlund <tege@gmplib.org>
+
+ * tune/speed.h (SPEED_ROUTINE_MPN_MULMOD_BNM1): Adapt to new
+ mpn_mulmod_bnm1 interface.
+
+2009-11-07 Marco Bodrato <bodrato@mail.dm.unipi.it>
+
+ * mpn/generic/mulmod_bnm1.c: New interface, with size
+ specified for all operands in mpn_mulmod_bnm1.
+ * gmp-impl.h: Changed mpn_mulmod_bnm1 prototype.
+
+2009-11-05 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/x86/k7/gcd_1.asm: Actually use div-reduced value.
+ Mnemonic cleanup.
+
+ * mpn/x86_64/gcd_1.asm: New file.
+
+2009-11-03 Torbjorn Granlund <tege@gmplib.org>
+
+ * tune/Makefile.am (TUNE_MPN_SRCS_BASIC): Add sqr_n.c.
+
+2009-11-03 Marco Bodrato <bodrato@mail.dm.unipi.it>
+
+ * mpn/generic/toom_interpolate_6pts.c: removed an addmul_1 and cleanup.
+
+2009-11-02 Torbjorn Granlund <tege@gmplib.org>
+
+ * configure.in (gmp_mpn_functions): Remove obsolete functions
+ dc_divrem_n and sb_divrem_mn.
+ * gmp-impl.h: Misc cleanup.
+ (mpn_sb_divrem_mn, mpn_dc_divrem_n): Remove.
+ (DIV_DC_THRESHOLD): Remove.
+ * mpn/generic/dc_divrem_n.c: Remove.
+ * mpn/generic/sb_divrem_mn.c: Remove.
+ * mpn/generic/tdiv_qr.c: Use DC_DIV_QR_THRESHOLD, not DIV_DC_THRESHOLD.
+
+ * tests/devel/try.c: Replace mpn_sb_divrem_mn by mpn_sbpi1_div_qr.
+ * tests/refmpn.c (refmpn_sb_div_qr): New name for refmpn_sb_divrem_mn.
+
+ * tune/Makefile.am (libspeed_la_SOURCES): Remove sb_div.c and sb_inv.c.
+ (TUNE_MPN_SRCS_BASIC): Remove sb_divrem_mn.c.
+ * tune/common.c (speed_mpn_dcpi1_div_qr_n): New function.
+ Remove mpn_sb_divrem_mn related functions.
+ * tune/speed.c (routine): Remove entries related to mpn_dc_divrem and
+ mpn_sb_divrem.
+ (routine): New entry for mpn_dc_div_qr_n.
+ * tune/speed.h (SPEED_ROUTINE_MPN_DC_DIVREM_CALL): Compute inverse
+ needed by pi1 calls.
+ (SPEED_ROUTINE_MPN_SB_DIVREM_M3): Remove.
+ * tune/tuneup.c (tune_sb_preinv): Remove.
+ (tune_dc): Update to measure DC_DIV_QR_THRESHOLD.
+
+ * mpn/generic/sb_divappr_q.c: Remove.
+
+2009-11-01 Torbjorn Granlund <tege@gmplib.org>
+
+ * gmp-impl.h: Misc minor cleanups.
+
+2009-10-31 Torbjorn Granlund <tege@gmplib.org>
+
+ * gmp-impl.h (toom itch functions): Simplify, make some into macros.
+ (MPN_KARA_MUL_N_TSIZE, MPN_KARA_SQR_N_TSIZE): Remove.
+ * mpn/generic/mul_n.c (mpn_toom3_mul_n, mpn_toom3_sqr_n): Remove.
+ * mpn/generic/mul_n.c (mpn_sqr_n): Move from here...
+ * mpn/generic/sqr_n.c: ...to this new file.
+ * configure.in (gmp_mpn_functions): Add sqr_n.
+
+ * Globally change
+ MUL_TOOM3_THRESHOLD => MUL_TOOM33_THRESHOLD,
+ MUL_KARATSUBA_THRESHOLD => MUL_TOOM22_THRESHOLD,
+ SQR_KARATSUBA_THRESHOLD => SQR_TOOM2_THRESHOLD,
+ and associated names analogously.
+
+2009-10-31 Niels Möller <nisse@lysator.liu.se>
+
+ * mpn/generic/toom_interpolate_7pts.c: Changed evaluation points,
+ replacing -1/2 by -2.
+ * mpn/generic/toom44_mul.c: Updated to use new evaluation points,
+ and use mpn_toom_eval_dgr3_pm2.
+ * mpn/generic/toom4_sqr.c (mpn_toom4_sqr): Likewise.
+ * mpn/generic/toom53_mul.c (mpn_toom53_mul): Updated to use new
+ evaluation points, and use mpn_toom_eval_pm1 and
+ mpn_toom_eval_pm2exp.
+ * mpn/generic/toom62_mul.c (mpn_toom62_mul): Likewise.
+
+ * mpn/generic/toom_eval_pm2exp.c: New file.
+ * mpn/generic/toom_eval_pm1.c: New file.
+
+ * mpn/generic/toom43_mul.c (mpn_toom43_mul): Use
+ mpn_toom_eval_dgr3_pm2.
+
+2009-10-30 Torbjorn Granlund <tege@gmplib.org>
+
+ * tune/Makefile.am (TUNE_MPN_SRCS_BASIC): Add toom2* and toom3* files.
+
+2009-10-30 Niels Möller <nisse@lysator.liu.se>
+
+ * configure.in (gmp_mpn_functions): Added toom_eval_dgr3_pm2.
+ * gmp-impl.h: Added prototype for mpn_toom_eval_dgr3_pm2.
+ * mpn/generic/toom_eval_dgr3_pm2.c: New file.
+
+2009-10-29 Niels Möller <nisse@lysator.liu.se>
+
+ * mpn/generic/toom43_mul.c (mpn_toom43_mul): Use
+ mpn_toom_eval_dgr3_pm1.
+ * mpn/generic/toom42_mul.c (mpn_toom42_mul): Likewise.
+
+2009-10-29 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/generic/mulmod_bnm1.c: Replace some add_1 by INCR.
+
+ * gmp-impl.h (mpn_mulmod_bnm1_itch): New macro.
+
+ * mpn/generic/mulmod_bnm1.c (mpn_mulmod_bnm1): Call mpn_mul_fft.
+ (mpn_mulmod_bnm1_next_size): Adopt to SS FFT.
+
+ * mpn/generic/mul_fft.c (mpn_mul_fft): Make it return high limb.
+ (mpn_mul_fft_internal): Likewise.
+
+ * mpn/generic/mulmod_bnm1.c: New file, by Niels Möller.
+ * configure.in (gmp_mpn_functions): Add mulmod_bnm1.
+ * gmp-impl.h: Add related declarations.
+ * tune/tuneup.c: Tune MULMOD_BNM1_THRESHOLD.
+ * tune/speed.h (SPEED_ROUTINE_MPN_MULMOD_BNM1): New macro.
+ * tune/common.c (speed_mpn_mulmod_bnm1): New function.
+ * Makefile.am (TUNE_MPN_SRCS_BASIC): Add mulmod_bnm1.c.
+
+ * gmp-impl.h (mpn_kara_mul_n, mpn_kara_sqr_n): Remove declarations.
+ * tune/common.c: Remove/rename kara functions.
+ * tune/speed.h: Likewise.
+
+ * tests/devel/try.c: Clean up usage of %p printf arguments.
+
+ * gmp-impl.h: Update MUL/SQR MINSIZE macros to reflect new function
+ names and limitations
+ * tune/tuneup.c: Use updated macro names.
+ * tune/speed.h: Likewise.
+ * tests/devel/try.c: Test new mul/sqr functions, remove old tests.
+
+2009-10-29 Niels Möller <nisse@lysator.liu.se>
+
+ * 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.
+ (SPEED_ROUTINE_MPN_TOOM3_MUL_N): Deleted.
+ (SPEED_ROUTINE_MPN_TOOM2_SQR): Use mpn_toom2_sqr_itch.
+
+ * gmp-impl.h (mpn_toom3_mul_n, mpn_toom3_sqr_n): Remove
+ declarations.
+ (mpn_toom2_sqr_itch): Add margin for recursive calls.
+
+2009-10-28 Niels Möller <nisse@lysator.liu.se>
+
+ * mpn/generic/mul_n.c (mpn_kara_mul_n): Deleted old Karatsuba
+ implementation.
+ (mpn_kara_sqr_n): Likewise deleted.
+
+ * mpn/generic/mul_n.c (mpn_sqr_n): Use mpn_toom2_sqr and
+ mpn_toom3_sqr, not the old implementations.
+
+ * gmp-impl.h (MPN_TOOM3_MUL_N_TSIZE): Deleted, replaced by
+ mpn_toom33_mul_itch.
+ (MPN_TOOM3_SQR_N_TSIZE): Deleted, replaced by
+ mpn_toom3_sqr_itch.
+ (mpn_toom33_mul_itch): Needs more scratch.
+ (mpn_toom3_sqr_itch): Likewise.
+ * tune/speed.h (SPEED_ROUTINE_MPN_TOOM3_MUL_N): Use
+ mpn_toom33_mul_itch.
+ (SPEED_ROUTINE_MPN_TOOM3_SQR_N): Use mpn_toom3_sqr_itch.
+ * mpn/generic/mul_n.c (mpn_mul_n): Use mpn_toom33_mul_itch.
+ (mpn_sqr_n): Use mpn_toom3_sqr_itch.
+
+ * mpn/generic/toom33_mul.c (mpn_toom33_mul): Avoid TMP_ALLOC. Needs
+ some more supplied scratch instead.
+ * mpn/generic/toom3_sqr.c (mpn_toom3_sqr): Likewise.
+
+2009-10-26 Torbjorn Granlund <tege@gmplib.org>
+
+ * gmp-impl.h (invert_pi1): Streamline, as suggested by Niels.
+
+2009-10-24 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/generic/bdiv_q.c: Update to call new functions.
+ * mpn/generic/bdiv_qr.c: Likewise.
+ * mpn/generic/binvert.c: Likewise.
+ * mpn/generic/divexact.c: Likewise.
+ * mpn/generic/divis.c: Likewise.
+ * mpn/generic/perfpow.c: Likewise.
+ * mpn/generic/tdiv_qr.c: Likewise.
+ * mpn/generic/dcpi1_bdiv_q.c: New file.
+ * mpn/generic/dcpi1_bdiv_qr.c: New file.
+ * mpn/generic/dcpi1_div_q.c: New file.
+ * mpn/generic/dcpi1_div_qr.c: New file.
+ * mpn/generic/dcpi1_divappr_q.c: New file.
+ * mpn/generic/sbpi1_bdiv_q.c: New file.
+ * mpn/generic/sbpi1_bdiv_qr.c: New file.
+ * mpn/generic/sbpi1_div_q.c: New file.
+ * mpn/generic/sbpi1_div_qr.c: New file.
+ * mpn/generic/sbpi1_divappr_q.c: New file.
+ * mpn/generic/dc_bdiv_q.c: Removed.
+ * mpn/generic/dc_bdiv_qr.c: Removed.
+ * mpn/generic/dc_div_q.c: Removed.
+ * mpn/generic/dc_div_qr.c: Removed.
+ * mpn/generic/dc_divappr_q.c: Removed.
+ * mpn/generic/sb_bdiv_q.c: Removed.
+ * mpn/generic/sb_bdiv_qr.c: Removed.
+ * mpn/generic/sb_div_q.c: Removed.
+ * mpn/generic/sb_div_qr.c: Removed.
+
+ * configure.in (gmp_mpn_functions): Add new division functions, remove
+ obsolete division functions.
+
+ * gmp-impl.h: Add declarations of new division functions, remove
+ corresponding obsolete declarations.
+ (gmp_pi1_t, gmp_pi2_t): New types.
+ (invert_pi1): New macro for computing 2/1 and 3/2 inverses.
+
+2009-10-23 Niels Möller <nisse@lysator.liu.se>
+
+ * gmp-impl.h (mpn_toom62_mul_itch): New function.
+
+ * tests/mpn/t-toom53.c: New test program.
+ * tests/mpn/t-toom62.c: New test program.
+
+2009-10-23 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/generic/get_d.c: Fix code handling denorms for 64-bit machines.
+ * tests/mpf/t-get_d.c (test_denorms): New function.
+
+2009-10-23 Niels Möller <nisse@lysator.liu.se>
+
+ * mpn/generic/toom52_mul.c (mpn_toom52_mul): Use supplied scratch
+ space, not TMP_ALLOC. Interface change, now requires input sizes
+ such that s + t >= 5.
+
+ * gmp-impl.h (mpn_toom52_mul_itch): New function.
+
+ * tests/mpn/t-toom52.c: New test program.
+
+2009-10-22 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/x86_64/sqr_basecase.asm: Tune for speed and a 7% size decrease.
+
+2009-10-22 Niels Möller <nisse@lysator.liu.se>
+
+ * tests/mpn/t-toom44.c: New test program.
+ * tests/mpn/t-toom33.c: New test program.
+
+ * tests/mpn/toom-shared.h (main): Reorganized input generation.
+ Users are now supposed to define macros MAX_AN, MIN_BN and MAX_BN.
+ Updated existing toom test programs.
+
+2009-10-22 Torbjorn Granlund <tege@gmplib.org>
+
+ * tests/devel/try.c: Fix typos in last change.
+
+2009-10-21 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/asm-defs.m4 (define_mpn): Add mullow_basecase.
+
+ * tests/devel/try.c: Test mpn_mullow_n.
+
+ * tests/refmpn.c (refmpn_mullow_n): New function.
+ * tests/tests.h: Declare it.
+
+2009-10-21 Niels Möller <nisse@lysator.liu.se>
+
+ * tests/mpn/toom-shared.h (main): Check for writes outside of the
+ product or scratch area.
+
+ * gmp-impl.h (mpn_toom43_mul_itch): New function.
+
+ * mpn/generic/toom43_mul.c (mpn_toom43_mul): Use supplied scratch
+ space, not TMP_ALLOC. Interface change, now requires input sizes
+ such that s + t >= 5.
+
+2009-10-20 Niels Möller <nisse@lysator.liu.se>
+
+ * tests/mpn/toom-shared.h (MIN_BLOCK): New constant, which can be
+ overridden by users. Needed by t-toom42 and t-toom43.
+
+ * tests/mpn/Makefile.am (check_PROGRAMS): Added t-toom32,
+ t-toom42 and t-toom43.
+ * tests/mpn/t-toom43.c: New test program.
+ * tests/mpn/t-toom42.c: New test program.
+ * tests/mpn/t-toom32.c: New test program.
+
+ * tests/mpn/Makefile.am (check_PROGRAMS): Added t-toom22.
+ * tests/mpn/t-toom22.c: New test file.
+ * tests/mpn/toom-shared.h: New file. Test framework for Toom
+ functions.
+
+2009-10-14 Niels Möller <nisse@lysator.liu.se>
+
+ * mpn/generic/hgcd.c (mpn_hgcd_itch): Thanks to the new
+ mpn_matrix22_mul_strassen, the scratch need is reduced by 16%.
+
+2009-10-14 Marco Bodrato <bodrato@mail.dm.unipi.it>
+
+ * mpn/generic/matrix22_mul.c (mpn_matrix22_mul_strassen): New
+ Strassen-like algorithm, to reduce the amount of temporary
+ storage.
+ (mpn_matrix22_mul_itch): Updated to reflect the reduced storage
+ need.
+
+2009-10-03 Torbjorn Granlund <tege@gmplib.org>
+
+ * Rename mpn_addsub_n to mpn_add_n_sub_n.
+
+2009-10-01 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/generic/tdiv_qr.c: Call mpn_divrem_1 and mpn_dc_div_qr instead of
+ old functions.
+
+ * mpn/generic/mul_n.c: Call toom22 and toom33 instead of old functions.
+
+ * mpn/generic/toom42_mul.c (TOOM42_MUL_N_REC): Renamed from
+ TOOM22_MUL_N_REC. Unconditionally call the generic mpn_mul_n.
+ * mpn/generic/toom32_mul.c: Analogous changes.
+
+2009-09-28 Niels Möller <nisse@lysator.liu.se>
+
+ * mpn/x86_64/invert_limb.asm: Rewrite. Exploit cancellation in the
+ Newton iteration.
+
+2009-09-27 Niels Möller <nisse@lysator.liu.se>
+
+ * mpn/x86/invert_limb.asm: Reduce register usage. Eliminated $1
+ arguments to add, sub and shift.
+
+2009-09-25 Niels Möller <nisse@lysator.liu.se>
+
+ * mpn/x86/invert_limb.asm: New file.
+
+2009-09-24 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/generic/toom33_mul.c: Use new toom functions for all recursive
+ products.
+ * mpn/generic/toom3_sqr.c: Likewise.
+ * mpn/generic/toom44_mul.c: Likewise.
+ * mpn/generic/toom4_sqr.c: Likewise.
+
+ * mpn/generic/add_n.c: Relax operand overlap ASSERTs.
+ * mpn/generic/sub_n.c: Likewise.
+
+2009-09-15 Torbjorn Granlund <tege@gmplib.org>
+
+ Suggested by Uwe Mueller:
+ * printf/doprnt.c: Use "%ld" for exponent printing.
+ * printf/doprntf.c (__gmp_doprnt_mpf): Make expval "long".
+
+2009-09-14 Torbjorn Granlund <tege@gmplib.org>
+
+ * configure.in: Handle mingw64.
+ * gmp-impl.h (gmp_intptr_t): Declare.
+ * tests/amd64check.c (calling_conventions_values): Use CNST_LIMB.
+ * tests/memory.c: Use gmp_intptr_t; print pointers using C90 "%p".
+ * tests/misc.c: Use gmp_intptr_t.
+ * tests/mpq/t-get_str.c: Print pointers using C90 "%p".
+
+2009-08-12 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/generic/mod_1_1.c (mpn_mod_1_1p_cps): Remove silly ASSERT code.
+
+ * mpn/asm-defs.m4 (define_mpn): Remove mod_1s_1p, add mod_1_1p.
+
+ * mpn/arm/invert_limb.asm: Complete rewrite.
+
+ * longlong.h: Document LONGLONG_STANDALONE and NO_ASM.
+
+2009-08-05 Torbjorn Granlund <tege@gmplib.org>
+
+ * tests/mpz/dive_ui.c (check_random): Avoid zero divisors.
+
+2009-07-31 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/generic/mod_1_1.c: Tweak to handle any modulus (possibility
+ pointed out by Per Austrin).
+ (mpn_mod_1_1p): Renamed from mpn_mod_1s_1p.
+ (mpn_mod_1_1p_cps): Renamed from mpn_mod_1s_1p_cps.
+ *mpn/generic/mod_1.c (mpn_mod_1): Reorganise to call mpn_mod_1_1p for
+ any modulus.
+
+2009-07-28 Torbjorn Granlund <tege@gmplib.org>
+
+ * configure.in: Pass arch for x86 also in 64-bit mode.
+
+2009-07-26 Torbjorn Granlund <tege@swox.com>
+
+ * config.guess (_cpuid): Recognise more Intel "Core" processors.
+
+2009-07-13 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpf/eq.c: Rewrite.
+
+ * tests/mpf/t-eq.c: New test.
+
+2009-07-06 Torbjorn Granlund <tege@gmplib.org>
+
+ * gmp-impl.h (__mp_bases): Remove this alias.
+
+ * mpf/get_str.c: Use less overflow prone expression for computing limb
+ allocation.
+ * mpz/inp_str.c: Likewise.
+ * mpf/set_str.c: Likewise.
+ * mpz/set_str.c: Likewise.
+
+2009-07-03 Niels Möller <nisse@lysator.liu.se>
+
+ * mpn/generic/gcd_1.c (mpn_gcd_1): Use masking tricks to reduce
+ the number of branches in the loop.
+
+2009-06-28 Torbjorn Granlund <tege@gmplib.org>
+
+ * demos/factorize.c (factor_using_pollard_rho): Rewrite.
+
+ * mpz/clears.c: New file.
+ * mpq/clears.c: New file.
+ * mpf/clears.c: New file.
+ * gmp-h.in (mpz_clears, mpq_clears, mpf_clears): Declare.
+ * mpz/Makefile.am: Add clears.c.
+ * mpq/Makefile.am: Add clears.c.
+ * mpf/Makefile.am: Add clears.c.
+ * Makefile.am: Add these also to respective OBJECTS variables.
+ * doc/gmp.texi: Document inits function and clears functions.
+
+2009-06-20 Torbjorn Granlund <tege@gmplib.org>
+
+ * mp-h.in (mp_bitcnt_t): Declare here too.
+
+2009-06-19 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpq/inits.c: New file.
+ * mpf/inits.c: New file.
+ * gmp-h.in (mpz_inits, mpq_inits, mpf_inits): Declare .
+
+ * mpn/generic/remove.c: New file.
+ * configure.in (gmp_mpn_functions): Add remove.
+ * gmp-impl.h (mpn_remove): Declare.
+
+ * gmp-h.in (mp_bitcnt_t): New basic type.
+ * mpn/generic/perfpow.c (mp_bitcnt_t): Remove private definition.
+
+ * mpn/generic/bdiv_qr.c: Make it actually work.
+
+ * mpn/x86_64/core2/aorsmul_1.asm: Rewrite to use shorter pipeline and
+ to need fewer registers.
+
+2009-06-17 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/x86_64/rsh1aors_n.asm: New file.
+ * mpn/x86_64/rsh1add_n.asm: Remove.
+ * mpn/x86_64/rsh1sub_n.asm: Remove.
+
+ * mpz/inits.c: New file.
+
+ * gen-trialdivtab.c: Wrap limb constants into CNST_LIMB.
+
+ With Martin Boij:
+ * mpn/generic/perfpow.c (binv_root, binv_sqroot): Change from being
+ recursive to being iterative.
+ (mpn_perfect_power_p): Reorganise temp memory usage to avoid a buffer
+ overrun. Trim allocation of next and prev. Never create oversize
+ products in the multiplicity binary search.
+
+ * mpn/generic/dc_div_q.c: Add missing TMP_FREE.
+
+2009-06-16 Torbjorn Granlund <tege@gmplib.org>
+
+ Revert:
+ * mpn/generic/perfpow.c (perfpow): Test exponents up to ub, inclusive.
+
+2009-06-16 Martin Boij <mboij@kth.se>
+
+ * mpn/generic/perfpow.c (logs): Use more conservative table.
+
+2009-06-15 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/pa64/aors_n.asm: New file.
+ * mpn/pa64/add_n.asm: Remove.
+ * mpn/pa64/sub_n.asm: Remove.
+
+ * mpn/generic/perfpow.c (perfpow): Test exponents up to ub, inclusive.
+
+2009-06-14 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/x86_64/bdiv_q_1.asm: Optimise away a mov insn.
+ * mpn/x86_64/dive_1.asm: Likewise.
+
+ * mpn/generic/perfpow.c (binv_root): Use mpn_bdiv_q_1, not
+ mpn_divexact_itch for 2-adic division.
+ (all functions): Micro optimise.
+
+ * Makefile.am (libmp_la_SOURCES): Add nextprime.c.
+
+2009-06-13 Torbjorn Granlund <tege@gmplib.org>
+
+ * gmp-h.in (mpn_perfect_power_p): Declare.
+ * configure.in (gmp_mpn_functions): Add perfpow.
+ * mpz/perfpow.c: Now trivial, simply calls mpn_perfect_power_p.
+
+2009-06-13 Martin Boij <mboij@kth.se>
+
+ * mpn/generic/perfpow.c: New file.
+ * tests/mpz/t-perfpow.c: Rewrite.
+
+2009-06-12 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/generic/bdiv_qr.c: New file.
+ * mpn/generic/bdiv_q.c: New file.
+ * configure.in (gmp_mpn_functions): Add bdiv_qr and bdiv_q.
+ * gmp-impl.h: Declare new functions.
+
+ * nextprime.c: New file.
+ * gmp-impl.h (gmp_primesieve_t, gmp_init_primesieve, gmp_nextprime):
+ Declare.
+ * Makefile.am (libgmp_la_SOURCES): Add nextprime.c.
+
+2009-06-11 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/generic/trialdiv.c: New file.
+ * gen-trialdivtab.c: New file.
+ * configure.in (gmp_mpn_functions): Add trialdiv.
+ * gmp-impl.h (mpn_trialdiv): Declare
+ * Makefile.am: Add rules for gen-trialdivtab and trialdiv.
+
+ * longlong.h (arm count_leading_zeros): Define for armv5.
+
+ * gmp-impl.h: Move down toom itch functions to after we've #defined
+ all THRESHOLDs.
+
+ * dumbmp.c (isprime): Replace with slightly less inefficient code.
+ (mpz_tdiv_r): New function.
+
+2009-06-11 Niels Möller <nisse@lysator.liu.se>
+
+ Support for mpn_toom32_mul in speed:
+ * tune/speed.c (routine): Added mpn_toom32_mul.
+ * tune/speed.h (SPEED_ROUTINE_MPN_TOOM32_MUL): New macro.
+ * tune/common.c (speed_mpn_toom32_mul): New function.
+
+ * gmp-impl.h (mpn_toom32_mul_itch): Count scratch space needed
+ for the calls to mpn_toom22_mul.
+ (ABOVE_THRESHOLD): Moved this and related macros so it can be used
+ by mpn_toom32_mul_itch.
+ (mpn_toom22_mul_itch): Count scratch space for recursive calls.
+
+2009-06-11 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/x86/k7/mod_1_4.asm: New file, mainly for k7, but perhaps useful
+ also for k6 and non-sse p6.
+
+2009-06-10 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/x86_64/mod_1_4.asm: Minor size reducing tweaks.
+
+ * mpn/x86/mod_1.asm: Remove obsolete file.
+ * mpn/x86/k7/mmx/mod_1.asm: Likewise.
+ * mpn/x86/pentium4/sse2/mod_1.asm: Likewise.
+ * mpn/x86/p6/mod_1.asm: Likewise.
+ * mpn/x86/pentium/mod_1.asm: Likewise.
+
+2009-06-08 Niels Möller <nisse@lysator.liu.se>
+
+ * mpn/generic/toom4_sqr.c (mpn_toom4_sqr): Reorganized, to reduce
+ the need for scratch space, and get rid of TMP_ALLOC. Also use
+ mpn_toom_eval_dgr3_pm1.
+
+ * mpn/generic/toom_interpolate_6pts.c (mpn_toom_interpolate_6pts):
+ Stricter ASSERTs based on maximum size of polynomial coefficients.
+ Improved comments on the signedness of intermediate values.
+
+2009-06-07 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/generic/toom2_sqr.c: Make it actually work.
+
+ * mpn/generic/toom3_sqr.c: Reduce local scratch space.
+
+2009-06-05 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/generic/mul_fft.c (FFT_TABLE2_SIZE): Default to 200.
+ (MUL_FFT_TABLE2_SIZE, SQR_FFT_TABLE2_SIZE): Let these decide
+ FFT_TABLE2_SIZE if they are defined.
+ (struct nk): Use bit field.
+
+2009-06-05 Niels Möller <nisse@lysator.liu.se>
+
+ * mpn/generic/toom44_mul.c (mpn_toom44_mult): Use
+ mpn_toom_eval_dgr3_pm1.
+
+ * mpn/generic/toom_eval_dgr3_pm1.c: New file.
+
+ * mpn/generic/toom_interpolate_7pts.c (mpn_toom_interpolate_7pts):
+ Minor cleanup, use mpn_add rather than mpn_add_n + MPN_INCR_U.
+
+ * mpn/generic/toom44_mul.c (mpn_toom44_mul): Reorganized, to
+ reduce the need for scratch space, and get rid of TMP_ALLOC.
+
+2009-06-05 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/generic/toom_interpolate_7pts.c: Fall back mpn_divexact_byN to
+ mpn_bdiv_q_1_pi1, if the latter is NATIVE.
+
+2009-06-04 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/x86_64/bdiv_q_1.asm: New file.
+
+ * configure.in (HAVE_NATIVE): Add recently added functions.
+ (GMP_MULFUNC_CHOICES): Handle addlsh_n, sublsh_n, rsblsh_n.
+
+ * tune/common.c (speed_mpn_bdiv_q_1, speed_mpn_bdiv_q_1_pi1):
+ New functions.
+ * tune/speed.c (routine): Add mpn_bdiv_q_1 and mpn_bdiv_q_1_pi1.
+ * tune/speed.h (SPEED_ROUTINE_MPN_BDIV_Q_1_PI1): New #define.
+ (SPEED_ROUTINE_MPN_BDIV_Q_1): Mew #define.
+
+ * configure.in (gmp_mpn_functions): Add bdiv_q_1.
+ * mpn/generic/bdiv_q_1.c: New file.
+ * mpn/asm-defs.m4 (define_mpn): Add mpn_bdiv_q_1 and mpn_bdiv_q_1_pi1.
+ * gmp-impl.h (mpn_bdiv_q_1, mpn_bdiv_q_1_pi1): Declare.
+
+ * mpn/x86_64/lshift.asm: Cleanup.
+ * mpn/x86_64/rshift.asm: Cleanup.
+
+ * mpn/x86_64/addlsh1_n.asm: Removed.
+ * mpn/x86_64/aorrlsh1_n.asm: Generalised addlsh1_n.asm to handle
+ addlsh1_n and rsblsh1_n functionality.
+
+ * tests/refmpn.c (refmpn_rsblsh1_n): New function.
+ * tests/devel/try.c: Test mpn_rsblsh1_n.
+ * tests/tests.h: Declare refmpn_rsblsh1_n.
+ * tune/common.c (speed_mpn_rsblsh1_n): New function.
+ * tune/speed.c (routine): Add mpn_rsblsh1_n.
+ * tune/speed.h (mpn_rsblsh1_n): Declare.
+
+ * configure.in (gmp_mpn_functions_optional): Add rsblsh1_n.
+ (GMP_MULFUNC_CHOICES): Handle rsblsh1_n defined with a mulfunc.
+ * mpn/asm-defs.m4 (define_mpn): Add rsblsh1_n.
+ * gmp-impl.h (mpn_rsblsh1_n): Declare.
+
+ * mpn/generic/toom32_mul.c: Consistently use TOOM22_MUL_N_REC.
+
+2009-06-03 Marco Bodrato <bodrato@mail.dm.unipi.it>
+
+ * mpn/generic/toom43_mul.c: New file.
+ * mpn/generic/toom52_mul.c: New file.
+ * mpn/generic/toom_interpolate_6pts.c: New file.
+
+2009-06-03 Torbjorn Granlund <tege@gmplib.org>
+
+ * configure.in (gmp_mpn_functions): Add toom43_mul, toom52_mul, and
+ toom_interpolate_6pts, but also some previously forgotten functions.
+ * mpn/Makefile.am (nodist_EXTRA_libmpn_la_SOURCES): Likewise.
+ * gmp-impl.h: Declare new functions. Sort toom function declarations.
+
+ * gmp-impl.h: Rename toom4_* flags enum to toom7_*. Relevant C files
+ updated.
+
+ * mpn/generic/toom_interpolate_7pts (divexact_2exp): Remove.
+
+2009-06-02 Torbjorn Granlund <tege@gmplib.org>
+
+ * demos/factorize.c: Add -q command line option.
+
+2009-06-02 Marco Bodrato <bodrato@mail.dm.unipi.it>
+
+ * mpn/generic/toom_interpolate_7pts.c: Streamline, resulting in speed
+ improvements.
+
+ * mpn/generic/toom_interpolate_5pts.c: Likewise, but also completely
+ do away with explicit scratch space.
+ * gmp-impl.h (mpn_toom_interpolate_5pts): Update prototype.
+
+ * mpn/generic/mul_n.c (mpn_toom3_sqr_n, mpn_toom3_mul_n):
+ Update toom_interpolate_5pts call without scratch space parameter.
+ * mpn/generic/toom3_sqr.c: Likewise.
+ * mpn/generic/toom42_mul.c: Likewise.
+ * mpn/generic/toom33_mul.c: Likewise.
+
+ * mpn/generic/toom33_mul.c: Reduce local scratch space.
+ * mpn/generic/toom32_mul.c: Rewrite to not use local scratch space.
+
+2009-06-02 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/generic/toom22_mul.c (TOOM22_MUL_MN_REC): New macro, use it for
+ oo point.
+
+2009-06-01 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/generic/mul.c: Loop to avoid excessive recursion in toom33 and
+ toom44 slicing code.
+
+ * mpz/remove.c: Correctly handle multiplicity that does not fit an int.
+
+ * Makefile.am (dist-hook): Check library version consistency.
+
+ * mpn/generic/mul.c: Rewrite.
+
+2009-05-29 Torbjorn Granlund <tege@gmplib.org>
+
+ * tests/mpz/t-divis.c (check_random): Create huge test operands.
+
+ * mpn/generic/toom44_mul.c: Allocate temp space using one TMP_ALLOC
+ call, not multiple TMP_SALLOC.
+ * mpn/generic/toom4_sqr.c: Likewise.
+
+ * gmp-impl.h (mpn_toom22_mul_itch): Replace totally wrong code.
+
+ * mpn/generic/mullow_n.c: Relax overlap requirement implied by ASSERT.
+
+ * mpn/generic/divis.c: Rewrite.
+
+ * gmp-impl.h (mpn_mu_bdiv_qr): Now returns mp_limb_t.
+ (mpn_toom2_sqr_itch): Simplify.
+
+ * mpn/generic/mu_bdiv_qr.c: Implement properly.
+
+2009-05-27 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/generic/mod_1_1.c: Add proper ASSERT functionality cps function.
+ * mpn/generic/mod_1_2.c: Likewise.
+ * mpn/generic/mod_1_3.c: Likewise.
+ * mpn/generic/mod_1_4.c: Likewise.
+
+ * tune: Add speed measuring of toom22, toom33, and toom44.
+
+ * mpn/generic/toom22_mul.c: Handle potentially unbalanced coefficient
+ product better.
+
+2009-05-26 Torbjorn Granlund <tege@gmplib.org>
+
+ * tests/mpz/t-mul.c (ref_mpn_mul): Use mpn_toom44_mul in FFT range for
+ better huge-operands performance.
+
+2009-05-24 Torbjorn Granlund <tege@gmplib.org>
+
+ * acinclude.m4 (GMP_ASM_LSYM_PREFIX): Try "$L" too, before "$".
+
+2009-05-23 Torbjorn Granlund <tege@gmplib.org>
+
+ * gmp-impl.h (mpn_mod_1s_1p,mpn_mod_1s_2p,mpn_mod_1s_3p,mpn_mod_1s_4p):
+ Declare using __GMP_ATTRIBUTE_PURE.
+
+ * tune/tuneup.c (tune_mod_1): Specify check_size for measuring mod_1_N
+ functions.
+ (one): Remove redundant size loop exit condition.
+
+2009-05-20 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/x86/pentium4/sse2/mod_1_4.asm: New file.
+ * mpn/x86/p6/sse2/mod_1_4.asm: New file (grabbing pentium4 code).
+
+2009-05-18 Torbjorn Granlund <tege@gmplib.org>
+
+ * gmp-h.in (__GNU_MP_VERSION_MINOR): Bump to 4.
+ (__GNU_MP_VERSION_PATCHLEVEL): Set to -1.
+
+ * mpn/x86_64/mod_1_4.asm: New file.
+
+ * mpn/asm-defs.m4: Correct names for mod_1_N functions.
+ Add defines for corresponding cps functions.
+
+ * mpn/generic/mod_1_2.c: Support any sizes > 1.
+ * mpn/generic/mod_1_3.c: Likewise.
+ * mpn/generic/mod_1_4.c: Likewise.
+
+2009-05-12 Torbjorn Granlund <tege@gmplib.org>
+
+ * Version 4.3.1 released.
+
+2009-05-11 Torbjorn Granlund <tege@gmplib.org>
+
+ * gmp-h.in (__GNU_MP_VERSION_MINOR): Bump.
+
+ * Makefile.am (LIBGMP_LT_*, LIBGMPXX_LT_*, LIBMP_LT_*):
+ Bump version info.
+
+2009-05-09 Torbjorn Granlund <tege@gmplib.org>
+
+ * tests/mpz: Add MPZ_CHECK_FORMAT to many tests.
+
+2009-05-07 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/x86/pentium4/sse2/mul_basecase.asm: Avoid L(ret), "ret" is
+ defined in x86-defs.m4.
+
+2009-05-06 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/x86/p6/aors_n.asm: Use L() for labels.
+ * mpn/x86/pentium4/sse2/addmul_1.asm: Likewise.
+ * mpn/x86/pentium4/sse2/mul_1.asm: Likewise.
+ * mpn/x86/pentium4/sse2/mul_basecase.asm: Likewise.
+ * mpn/x86/pentium4/sse2/sqr_basecase.asm: Likewise.
+ * mpn/x86_64/lshift.asm: Likewise.
+ * mpn/x86_64/rshift.asm: Likewise.
+
+ * tests/cxx/t-locale.cc (point_string): Declare as extern "C" to
+ placate compilers that mangle variable names.
+
+2009-05-04 Torbjorn Granlund <tege@gmplib.org>
+
+ * tests/mpz/t-gcd.c: Generate operands that are multiple of each other.
+
+2009-05-01 Torbjorn Granlund <tege@gmplib.org>
+
+ * gmp-h.in (__GMP_EXTERN_INLINE): Support for more systems.
+ (gmp_randinit_set): Add missing __GMP_DECLSPEC.
+
+2009-04-28 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/generic/neg_n.c: New file.
+ * configure.in (gmp_mpn_functions): Add neg_n.
+ * mpn/asm-defs.m4 (define_mpn): Add neg_n.
+ * mpn/Makefile.am (nodist_EXTRA_libmpn_la_SOURCES): Add neg_n.c.
+ * gmp-h.in: Handle mpn_neg_n properly.
+
+ * mpn/generic/toom_interpolate_7pts.c (divexact_2exp): Nailify.
+
+ * mpn/generic/gcdext.c: Change some MPN_NORMALIZE to
+ MPN_NORMALIZE_NOT_ZERO.
+ * mpn/generic/gcdext_lehmer.c: Likewise.
+ Add a MPN_NORMALIZE_NOT_ZERO.
+
+ * mpn/generic/binvert.c: Remove own mpn_neg_n.
+
+ * tests/mpz/t-gcd.c: Add some MPZ_CHECK_FORMAT calls.
+
+2009-04-27 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/Makefile.am (TARG_DIST): Add minithres.
+
+ * mpn/generic/bdiv_dbm1c.c: Handle nails.
+
+2009-04-26 Torbjorn Granlund <tege@gmplib.org>
+
+ * config.guess: Recognise more POWER processor types.
+
+2009-04-25 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/x86/pentium4/sse2/popcount.asm: Work around Apple reloc bug.
+ * mpn/x86/darwin.m4: Define symbol "DARWIN".
+
+2009-04-19 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/generic/powm.c (mpn_redc_n): Use ASSERT_ALWAYS, not abort().
+ * mpn/generic/powm_sec.c: Likewise.
+
+ * mpn/powerpc64/aix.m4 (EXTERN_FUNC): New define. Add dummy variants
+ for other m4 files.
+ * mpn/powerpc64/mode64/divrem_1.asm: Use EXTERN_FUNC.
+ * mpn/powerpc64/mode64/divrem_1.asm: Likewise.
+
+2009-04-16 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/x86_64/x86_64-defs.m4 (JUMPTABSECT): New define.
+ * mpn/x86_64/darwin.m4: Likewise.
+ * mpn/x86_64/sqr_basecase.asm: Rework switch code using JUMPTABSECT.
+
+ * tune/common.c (speed_mpn_hgcd, speed_mpn_hgcd_lehmer):
+ Remove an unused variable.
+
+ * mpn/x86/x86-defs.m4 (LEA): Get SIZE arguments right.
+
+2009-04-14 Torbjorn Granlund <tege@gmplib.org>
+
+ * Version 4.3.0 released.
+
+ * scanf/doscan.c (__gmp_doscan): Pad 3-operand scanf call with dummy
+ argument.
+ * scanf/sscanffuns.c (scan): Disable vsscanf variant for now.
+
+2009-04-13 Torbjorn Granlund <tege@gmplib.org>
+
+ * scanf/sscanffuns.c (scan): Rewrite to use stdarg.
+
+ * tests/mpz/t-root.c: Rewrite. Add unconditional gcc 4.3.2 tests.
+
+2009-04-09 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/generic/powm.c: New file.
+ * mpn/generic/powlo.c: New file.
+ * mpn/generic/powm_sec.c: New file.
+ * configure.in (gmp_mpn_functions): List new functions.
+
+2009-04-08 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpz/urandomm.c: Amend last fix.
+
+2009-04-06 Torbjorn Granlund <tege@gmplib.org>
+
+ * configure.in: Support Sun cc for x86_64.
+
+ * mpz/urandomm.c: Handle operand overlap.
+
+2009-03-11 Torbjorn Granlund <tege@gmplib.org>
+
+ * configure.in (powerpc): Brave removing -Wa,-mppc64, in the hope that
+ GCC now passes the proper options.
+
+2009-03-09 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/x86_64/divrem_1.asm: Add a nop to save a cycle in unnormalised
+ case.
+
+2009-03-05 Torbjorn Granlund <tege@gmplib.org>
+
+ * ia64/gmp-mparam.h, arm/gmp-mparam.h, x86/p6/mmx/gmp-mparam.h,
+ pa32/hppa2_0/gmp-mparam.h sparc32/v9/gmp-mparam.h: Update.
+
+2009-03-03 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/ia64/bdiv_dbm1c.asm: Accept/return carry.
+
+2009-03-02 Torbjorn Granlund <tege@gmplib.org>
+
+ * configure.in (64-bit sparc/solaris): Pass -xO3, not -O3 to solaris
+ system compiler.
+
+2009-03-01 Torbjorn Granlund <tege@gmplib.org>
+
+ * longlong.h (mips, powerpc): Provide assembly-free umul_ppmm for newer
+ gcc.
+
+2009-02-04 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/generic/redc_2.c: Remove code for testing and timing. Update
+ to current FSF header.
+ * mpn/generic/redc_1.c: Update to current FSF header.
+
+2009-01-21 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpz/powm.c (redc): Remove.
+ (mpz_powm): Use mpn_redc_1 instead of redc.
+
+ * tests/mpz/t-powm.c: Rewrite reference code.
+
+2009-01-18 Torbjorn Granlund <tege@gmplib.org>
+
+ * tests/mpz: Increase reps for many tests.
+
+ * mpn/generic/rootrem.c (mpn_rootrem_internal): Use MPN_DECR_U instead of
+ mpn_sub_1 (works around gcc 4.3 bugs and is also faster).
+
+2009-01-16 Torbjorn Granlund <tege@gmplib.org>
+
+ * tests/tests.h: Declare refmpn_divrem_2.
+
+2009-01-15 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpz/perfpow.c: Add TMP_FREE before every return statement.
+
+ * mpn/generic/rootrem.c (mpn_rootrem_internal): Add a missing TMP_FREE.
+
+ * configure.in (gcc_cflags, gcc_64_cflags): Revert from -O3 to -O2,
+ the change was accidental and cause too much miscompilation.
+
+2009-01-14 Torbjorn Granlund <tege@gmplib.org>
+
+ * tune/tuneup.c (tune_mod_1): Run MOD_1_x_THRESHOLD tests also when
+ longlong.h specified UDIV_PREINV_ALWAYS.
+
+ * mpn/generic/mod_1.c (mpn_mod_1): Properly check for normalisation
+ divisor.
+
+2009-01-13 Torbjorn Granlund <tege@gmplib.org>
+
+ * tune/tuneup.c (tune_mod_1): Tune for MOD_1_1_THRESHOLD,
+ MOD_1_2_THRESHOLD, and MOD_1_4_THRESHOLD.
+
+ * mpn/generic/mod_1.c: Rewrite.
+ * mpn/generic/mod_1_1.c: New file.
+ * mpn/generic/mod_1_2.c: New file.
+ * mpn/generic/mod_1_3.c: New file.
+ * mpn/generic/mod_1_4.c: New file.
+ * configure.in (gmp_mpn_functions): Add mod_1_*.
+ * mpn/asm-defs.m4 (define_mpn): Add mod_1_*.
+ * mpn/Makefile.am (nodist_EXTRA_libmpn_la_SOURCES): Add mod_1_*.c.
+ * gmp-impl.h: Declare new mpn_mod_1s_* functions and associated
+ THRESHOLD macros.
+ (udiv_rnd_preinv): New macro.
+
+2009-01-12 Torbjorn Granlund <tege@gmplib.org>
+
+ * tune/tuneup.c (tune_gcd_dc,tune_gcdext_dc): Lower step_factor to 0.1.
+
+2009-01-08 Torbjorn Granlund <tege@gmplib.org>
+
+ * tests/mpz/t-nextprime.c: New test file.
+ * tests/mpz/Makefile.am (check_PROGRAMS): Add t-nextprime.
+
+ From Niels Möller:
+ * mpz/nextprime.c: Handle large prime gaps by limiting incr.
+
+2009-01-04 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpz/and.c, mpz/ior.c, mpz/xor.c: Re-read only necessary source
+ pointers after reallocation. Misc cleanup.
+
+ * gmp-impl.h (MPN_TOOM44_MAX_N): New define, replaces MPN_TOOM3_MAX_N.
+
+ * mpn/x86/fat/diveby3.c: New file.
+
+2008-12-30 Niels Möller <nisse@lysator.liu.se>
+
+ * doc/gmp.texi (Greatest Common Divisor Algorithms): Updated
+ section on GCD algorithms.
+
+2008-12-29 Torbjorn Granlund <tege@gmplib.org>
+
+ * doc/gmp.texi (Multiplication Algorithms): Add descriptions of Toom-4
+ and unbalanced multiplication.
+ (Radix to Binary): Add warning that text is outdated,
+ (Contributors): Fix typos.
+
+ * mpn/generic/toom*.c: Use coherent MAYBE_ macros for trimming
+ unreachable recursive functions.
+ * gmp-impl.h: Update toom itch functions.
+
+ * mpn/x86_64/sqr_basecase.asm: Slightly increase stack allocation, to
+ placate tuneup.
+
+2008-12-28 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/x86_64/pentium4/aors_n.asm: Tune prologue code.
+
+ * mpn/x86_64/pentium4/aorslsh1_n.asm: New file.
+
+ * mpn/x86_64/darwin.m4: Define symbol "DARWIN".
+ * mpn/x86_64/invert_limb.asm: Work around darwin quirks.
+
+ * mpn/x86_64/sqr_basecase.asm: Further optimize, support Darwin.
+
+ * mpn/x86_64/invert_limb.asm: New file.
+
+2008-12-27 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/x86_64/core2/aorslsh1_n.asm: New file.
+
+2008-12-26 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpz/perfpow.c: Handle negative arguments properly.
+ * tests/mpz/t-perfpow.c: New file.
+ * tests/mpz/Makefile.am (check_PROGRAMS): Add t-perfpow.
+
+2008-12-23 Torbjorn Granlund <tege@gmplib.org>
+
+ * tests/mpz/t-mul.c (dump_abort): Improve error message.
+
+ * gcd.c gcd_subdiv_step.c gcdext.c gcdext_subdiv_step.c:
+ Remove private mpn_zero_p.
+
+ * tune/tuneup.c (tune_mul): Tune for MUL_TOOM44_THRESHOLD.
+ (tune_sqr): Tune for SQR_TOOM4_THRESHOLD.
+
+ * tune/Makefile.am (TUNE_MPN_SRCS_BASIC): Add toom44_mul.c and
+ toom4_sqr.c.
+
+ * configure.in (gmp_mpn_functions): Toom function updates.
+
+ * Rename mpn/mul_toomMN.c to mpn/toomMN_mul.c. Function names changed
+ accordingly.
+
+ * mpn/toomMN_mul.c: Add scratch parameter. Do recursive multiplies
+ properly. Misc tuning. Remove CHECK and TIMING code.
+
+ * mpn/toom2_sqr.c, mpn/toom3_sqr.c, mpn/toom4_sqr.c: New files.
+
+ * gmp-impl.h (mpn_toomMN_mul_itch): Several new functions.
+ (mpn_zero_p): New functions.
+ Add various TOOM4/TOOM44 related parameters.
+ Update mpn_toomMN_mul prototypes.
+
+ * mpn/generic/mul_n.c (mpn_mul_n): Call mpn_toom44_mul. Use TMP_BALLOC
+ instead of malloc.
+ (mpn_sqr_n): Analogous changes.
+
+ * mpn/generic/mul.c: Update unbalanced toom code to pass scratch space.
+
+2008-12-21 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpz/nextprime.c: Add TMP_SDECL/MARK/FREE.
+
+2008-12-20 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/generic/sqrtrem.c (mpn_sqrtrem1): Rewrite, improve interface.
+ (invsqrttab): New table, remove table approx_tab.
+ (mpn_sqrtrem2): Optimize, update mpn_sqrtrem1 call.
+ (mpn_sqrtrem): Update mpn_sqrtrem1 call.
+
+2008-12-18 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpz/nextprime.c: Run 10 mpz_millerrabin tests (was 5).
+ Give credit to authors.
+
+ * mpn/x86_64/redc_1.asm: Align stack as mandated by ABI.
+
+ * mpn/x86_64/divrem_2.asm: Add some comments.
+
+ * mpn/x86_64/darwin.m4: New file.
+ * configure.in: Use x86_64/darwin.m4.
+
+2008-12-15 Torbjorn Granlund <tege@gmplib.org>
+
+ * doc/projects.html: Remove GCD and division projects, update text on
+ multiplication.
+
+ * doc/tasks.html: Add a caution about that the file is somewhat
+ outdated.
+
+2008-12-14 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/alpha/ev6/aorsmul_1.asm: New file (same code for mpn_addmul_1,
+ much improved for mpn_submul_1).
+ * mpn/alpha/ev6/addmul_1: File removed.
+ * mpn/alpha/ev6/submul_1: File removed.
+
+2008-12-09 Torbjorn Granlund <tege@gmplib.org>
+
+ From David Harvey:
+ * mpn/x86_64/mul_basecase.asm: Further tweaks for code size and speed.
+
+ * mpn/powerpc64/mode64/divrem_1.asm: Rewrite.
+
+ * mpn/powerpc64/mode64/mul_basecase.asm: New file.
+
+2008-12-08 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/powerpc64/mode64/gmp-mparam.h: New file.
+
+ * gmp-impl.h: Additional cleanups.
+ (mpn_set_str_compute_powtab): New prototype.
+ (mpn_powm, mpn_powlo): New prototypes.
+
+ * mpz/pow_ui.c: Handle some small exponents locally.
+
+2008-12-07 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/generic/set_str.c: Remove prototypes (they are in gmp-impl.h).
+
+ * tune/set_strs.c, tune/set_strb.c: Make prototypes effective by moving
+ the #define mpn_set_str* before including gmp-impl.h.
+
+ * All files: Change _PROTO => __GMP_PROTO.
+
+ * tune/speed.c (routine): Remove non-working choice mpn_set_str_subquad.
+ * tune/common.c (speed_mpn_dc_set_str): Remove, it is broken.
+
+ * mpn/generic/toom_interpolate_7pts.c (divexact_2exp): Make this static,
+ and inline it.
+
+ * gmp-impl.h: Major cleanup.
+ (Remove formal parameter names. Use __GMP_PROTO consistently. Move
+ __GMP_PROTO and __MPN use to adjacent lines for declared function.
+ Fix typos. Remove code inside #if 0.)
+
+ * configure.in (gmp_mpn_functions): Add mul_toom33. Reformat.
+
+2008-12-05 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/generic/redc_1.c: New file.
+ * mpn/generic/redc_2.c: New file.
+
+ * configure.in (gmp_mpn_functions): List redc_1 and redc_2.
+ (HAVE_NATIVE): Likewise.
+
+ * tune/common.c (speed_mpn_redc_1): Renamed from speed_redc.
+ * tune/speed.c (routine): Remove "redc", and "mpn_redc_1".
+ * tune/speed.h (SPEED_ROUTINE_REDC_1): Renamed from SPEED_ROUTINE_REDC.
+ Updated call.
+ * tune/tuneup.c (tune_powm): Update redc call.
+
+2008-12-04 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/x86_64/sqr_basecase.asm: Inline a combined diagonal product code
+ and addlsh1 loop. Misc cleanup.
+
+2008-12-02 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/x86_64/sqr_basecase.asm: New file.
+
+2008-11-30 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/generic/sqr_basecase.c: Fix typo in mpn_addmul_2s variant.
+
+2008-11-28 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/x86_64/redc_1.asm: Rewrite.
+
+2008-11-27 Torbjorn Granlund <tege@gmplib.org>
+
+ * tests/refmpn.c (refmpn_redc_1): New function.
+
+2008-11-25 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/x86/k7/aorsmul_1.asm: Actually handle mpn_submul_1.
+
+2008-11-23 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/x86_64/divrem_1.asm: Rewrite.
+
+ * alpha/divrem_2.asm: New file.
+ * powerpc32/divrem_2.asm: New file.
+ * powerpc64/mode64/divrem_2.asm: New file.
+ * x86/divrem_2.asm: New file.
+ * x86_64/divrem_2.asm: New file.
+ * tests/refmpn.c (refmpn_divrem_2): New function.
+
+2008-11-22 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/x86/k7/mul_1.asm: Rewrite for smaller size and better speed.
+ * mpn/x86/k7/aorsmul_1.asm: Likewise.
+
+ * acinclude.m4 (GMP_VERSION): Include last component even when zero.
+
+2008-11-21 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/x86_64/README: Rewrite.
+
+ * tests/devel/try.c (malloc_region, mprotect_maybe): Add casts for
+ printf type correctness.
+
+ * gmp-h.in (__GNU_MP_VERSION_MINOR): Bump.
+
+ * Makefile.am (LIBGMP_LT_*, LIBGMPXX_LT_*, LIBMP_LT_*):
+ Bump version info.
+
+2008-11-20 Torbjorn Granlund <tege@gmplib.org>
+
+ * gmp-impl.h: Rename modlimb_invert to binvert_limb.
+ * tune/speed.h: Likewise.
+ * tune/modlinv.c: Likewise.
+ * tune/common.c: Likewise.
+ * tests/t-modlinv.c: Likewise.
+ * tests/t-constants.c: Likewise.
+ * mpn/sparc64/mode1o.c: Likewise.
+ * mpn/alpha/dive_1.c: Likewise.
+ * mpn/sparc64/dive_1.c: Likewise.
+ * mpn/generic/mode1o.c: Likewise.
+ * mpn/generic/dive_1.c: Likewise.
+ * mpn/generic/bdivmod.c: Likewise.
+ * mpn/alpha/mode1o.asm: Likewise.
+ * mpn/asm-defs.m4: Likewise.
+ * mpn/ia64/mode1o.asm: Likewise.
+ * mpn/powerpc32/README: Likewise.
+ * mpn/powerpc32/mode1o.asm: Likewise.
+ * mpn/powerpc64/mode64/dive_1.asm: Likewise.
+ * mpn/powerpc64/mode64/mode1o.asm: Likewise.
+ * mpn/x86/dive_1.asm: Likewise.
+ * mpn/x86/k6/mmx/dive_1.asm: Likewise.
+ * mpn/x86/k6/mode1o.asm: Likewise.
+ * mpn/x86/k7/dive_1.asm: Likewise.
+ * mpn/x86/k7/mode1o.asm: Likewise.
+ * mpn/x86/p6/dive_1.asm: Likewise.
+ * mpn/x86/p6/mode1o.asm: Likewise.
+ * mpn/x86/pentium/dive_1.asm: Likewise.
+ * mpn/x86/pentium/mode1o.asm: Likewise.
+ * mpn/x86/pentium4/sse2/dive_1.asm: Likewise.
+ * mpn/x86/pentium4/sse2/mode1o.asm: Likewise.
+ * mpn/x86_64/dive_1.asm: Likewise.
+ * mpn/x86_64/mode1o.asm: Likewise.
+
+ * mpn/x86_64/aors_n.asm: Replace with slightly faster, more alignment
+ neutral loop.
+
+2008-11-18 Torbjorn Granlund <tege@gmplib.org>
+
+ * configure.in: Remove gcd_finda related declarations.
+ * gmp-impl.h (mpn_gcd_finda): Remove declaration.
+ * mpn/Makefile.am (nodist_EXTRA_libmpn_la_SOURCES): Remove gcd_finda.
+ * mpn/asm-defs.m4: Remove define_mpn(gcd_finda).
+ * mpn/x86/k6/gcd_finda.asm: Remove file.
+ * tests/devel/try.c (param_init): Remove mpn_gcd_finda.
+ (choice_array): Remove mpn_gcd_finda.
+ * tests/mpn/t-instrument.c (check): Remove testing of mpn_gcd_finda.
+ * tests/refmpn.c (refmpn_gcd_finda): Remove.
+ * tests/tests.h (refmpn_gcd_finda): Remove declaration.
+ * tune/common.c (speed_mpn_gcd_finda): Remove.
+ * tune/gcd_finda_gen.c: Remove file.
+ * tune/speed.h (speed_mpn_gcd_finda): Remove declaration.
+ * tune/speed.c (routine): Remove mpn_gcd_finda entry.
+
+ * tests/mpz/t-powm.c: Print test number when failing a test.
+
+ * mpn/x86_64/redc_1.asm (CALL): Move from here...
+ * mpn/x86_64/x86_64-defs.m4: ...to here.
+
+ * gmp-impl.h (mpn_jacobi_base): Remove parameter names.
+
+2008-11-11 Torbjorn Granlund <tege@gmplib.org>
+
+ * tests/mpf/t-conv.c: Add some specific tests, supplementing the random
+ tests.
+
+2008-11-09 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpf/set_str.c: Default 'base' before letting exp_base inherit it.
+
+ * tests/cxx/t-prec.cc: Use the right precision for all float constants.
+
+2008-11-08 Torbjorn Granlund <tege@gmplib.org>
+
+ * doc/gmp.texi (Float Comparison): Update mpf_eq documentation.
+
+ * mpf/eq.c: Compare the right number of bits.
+
+2008-11-02 Torbjorn Granlund <tege@gmplib.org>
+
+ Undo, it made testing too slow:
+ * tests/mpz/t-mul.c: Use slower geometric progression for operand
+ sizes.
+
+ * mpn/x86/k7/mod_34lsub1.asm: Use movzb for masking low 8 bits.
+
+2008-10-31 Niels Möller <nisse@lysator.liu.se>
+
+ * mpn/generic/hgcd2.c (div1): New function (taken from old gcdext
+ implementation)
+ (mpn_hgcd2): Use single precision for the second half of the work.
+
+2008-10-30 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/x86/p6/sse2/gmp-mparam.h: New file.
+
+2008-10-29 Torbjorn Granlund <tege@gmplib.org>
+
+ * configure.in (x86 fat_path): Add "x86/p6/sse2".
+
+ * mpn/x86/fat/fat.c (__gmpn_cpuvec_init): Recognize sse2 capable p6
+ (pentiumm, core2).
+
+ * mpn/x86/p6/sse2/mul_1.asm: New file.
+ * mpn/x86/p6/sse2/addmul_1.asm: New file.
+ * mpn/x86/p6/sse2/submul_1.asm: New file.
+ * mpn/x86/p6/sse2/mul_basecase.asm: New file.
+ * mpn/x86/p6/sse2/sqr_basecase.asm: New file.
+ * mpn/x86/p6/sse2/popcount.asm: New file.
+
+ * mpn/x86/fat/fat.c (__gmpn_cpuvec_init): Handle "extended" fields for
+ model and family.
+
+2008-10-28 Torbjorn Granlund <tege@gmplib.org>
+
+ From Mickael Gastineau:
+ * gmp-h.in (gmp_urandomm_ui, gmp_urandomb_ui): Add __GMP_DECLSPEC.
+
+2008-10-27 Torbjorn Granlund <tege@gmplib.org>
+
+ * gmp-h.in (mpn_gcdext_1): Remove bogus __GMP_ATTRIBUTE_PURE.
+
+2008-10-27 Niels Möller <nisse@lysator.liu.se>
+
+ * tune/common.c (speed_mpn_hgcd): Call mpn_hgcd_matrix_init once
+ for each call to mpn_hgcd.
+ (speed_mpn_hgcd_lehmer): Likewise.
+
+2008-10-26 Torbjorn Granlund <tege@gmplib.org>
+
+ * configure.in: Point to p6/sse2 for pentiumm and core2.
+
+ * gmp-impl.h (mpn_add_nc, mpn_sub_nc): Move these macros to after fat
+ definitions.
+
+ * tune/common.c, tune/speed.c, tune/speed.h:
+ Add speed measurement of mpn_bdiv_dbm1c.
+
+2008-10-24 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/x86_64/gmp-mparam.h (MUL_FFT_TABLE2, SQR_FFT_TABLE2): Extend.
+
+ * mpz/nextprime.c: Move declarations to function beginning.
+
+2008-10-23 Niels Möller <nisse@lysator.liu.se>
+
+ * gmp-impl.h (DECL_gcdext_1): Deleted.
+
+2008-10-22 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/x86_64/atom/aors_n.asm: New file.
+ * mpn/x86_64/atom/gmp-mparam.h: New file.
+
+2008-10-21 Torbjorn Granlund <tege@gmplib.org>
+
+ With Neils Möller:
+ * mpz/nextprime.c: Rewrite.
+
+ * tests/devel/try.c (main): Use strtol for 's' and 'S' optargs.
+
+ * mpn/x86_64/pentium4/rshift.asm: Misc cleanups.
+ * mpn/x86_64/pentium4/lshift.asm: Likewise.
+
+ * mpn/x86_64/pentium4/aors_n.asm: Use fewer registers.
+
+ * configure.in: Set up specific path for x86_64/atom.
+
+2008-10-21 Niels Möller <nisse@lysator.liu.se>
+
+ * mpn/Makefile.am (nodist_EXTRA_libmpn_la_SOURCES): Removed
+ qstack.c.
+ * mpn/generic/qstack.c: Deleted obsolete file.
+
+2008-10-20 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/x86_64/core2/aorsmul_1.asm: New file.
+
+2008-10-19 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/x86_64/aors_n.asm: Remove redundant MULFUNC_PROLOGUE.
+
+ * gmp-impl.h (popc_limb): Remove redundant checks of GMP_LIMB_BITS
+ inside several of these macros.
+
+2008-10-17 Torbjorn Granlund <tege@gmplib.org>
+
+ * tests/mpz/t-mul.c: Use slower geometric progression for operand
+ sizes. Do every other tests for same size operands.
+
+2008-10-15 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/x86_64/mul_basecase.asm: Simplify addressing in epilogue.
+
+ * mpn/mips64/divrem_1.asm: Remove file, it is n32-only, and uses an old
+ algorithm.
+
+ * config.guess, config.sub, configure.in: Support Intel Atom processor.
+
+2008-10-10 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpq/mul.c: Fix typo in last change.
+
+2008-10-09 Torbjorn Granlund <tege@gmplib.org>
+
+ * tests/refmpn.c (refmpn_sb_divrem_mn): Work around a gcc bug.
+
+2008-10-08 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpq/mul.c: Use TMP_ALLOC. Cleanup.
+ * mpq/div.c: Likewise.
+
+ * mpn/x86_64/mul_basecase.asm: Use lea directly for loading entry point
+ addresses.
+
+2008-10-09 Niels Möller <nisse@lysator.liu.se>
+
+ * mpn/x86/k7/gmp-mparam.h: Updated GCD-related values.
+
+2008-10-05 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/generic/mul_fft.c (mpn_mul_fft_internal): Do store
+ mpn_fft_norm_modF return value, if (rec).
+
+2008-10-04 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/x86_64/aorsmul_1.asm: Replace with faster code.
+ * mpn/x86_64/mul_1.asm: Likewise.
+ * mpn/x86_64/addmul_2.asm: Likewise.
+ * mpn/x86_64/mul_2.asm: Likewise.
+ * mpn/x86_64/mul_basecase.asm: Likewise.
+
+2008-10-02 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/minithres/gmp-mparam.h: Update FFT values.
+
+2008-10-02 Niels Möller <nisse@lysator.liu.se>
+
+ * hgcd.c (mpn_hgcd_matrix_mul): Fixed normalization bug.
+
+2008-09-24 Torbjorn Granlund <tege@gmplib.org>
+
+ * configure.in: Handle --enable-minithres.
+ * mpn/minithres/gmp-mparam.h: Update all values.
+
+2008-09-22 Torbjorn Granlund <tege@gmplib.org>
+
+ * tune/speed.c (routine): New entry for mpn_mul.
+ * tune/speed.h (SPEED_ROUTINE_MPN_MUL): Renamed from
+ SPEED_ROUTINE_MPN_MUL_BASECASE.
+ (speed_mpn_mul): Renamed from speed_mpn_mul_basecase.
+ (SPEED_ROUTINE_MPN_MUL): Allocate our own memory of xp operand.
+
+ * tune/common.c: Corresponding changes.
+
+2008-09-22 Niels Möller <nisse@lysator.liu.se>
+
+ * mpn/generic/gcdext.c (hgcd_mul_matrix_vector): New function,
+ replaces addmul2_n. Needs less copying.
+ (mpn_gcdext): Use hgcd_mul_matrix_vector. Updated for interface
+ change in mpn_gcdext_subdiv_step
+
+ * mpn/generic/hgcd.c (hgcd_matrix_mul_1): Rewritten to use
+ mpn_hgcd_mul_matrix1_vector.
+ (hgcd_step): Updated for interface change in
+ mpn_hgcd_mul_matrix1_inverse_vector.
+
+ * mpn/generic/gcdext_lehmer.c (mpn_gcdext_lehmer_n): Updated for
+ interface changes in mpn_hgcd_mul_matrix1_vector,
+ mpn_hgcd_mul_matrix1_inverse_vector and mpn_gcdext_subdiv_step.
+
+ * mpn/generic/gcd_lehmer.c (mpn_gcd_lehmer_n): Updated for
+ interface change in mpn_hgcd_mul_matrix1_inverse_vector.
+
+ * mpn/generic/gcdext_subdiv_step.c (mpn_gcdext_subdiv_step): Use
+ separate scratch arguments for the quotient and for the cofactor
+ update.
+
+ * mpn/generic/hgcd2.c (mpn_hgcd_mul_matrix1_vector): Interface
+ change. Store first element in rp and leave ap unmodified. No
+ additional scratch space or copying needed. Callers that require
+ modification in place still need to copy one of the inputs.
+ (mpn_hgcd_mul_matrix1_inverse_vector): Likewise.
+
+2008-09-22 Niels Möller <nisse@lysator.liu.se> <nisse@king.swox.se>
+
+ * mpn/generic/hgcd.c (hgcd_matrix_mul_1): Use mpn_addaddmul_1msb0.
+ * mpn/generic/hgcd2.c (mpn_hgcd_mul_matrix1_vector): Likewise.
+
+ * mpn/generic/gcd.c: Use libspeed for timing measurements.
+
+ * gmp-impl.h: Declare mpn_addaddmul_1msb0.
+ * mpn/asm-defs.m4: Added addaddmul_1msb0.
+ * mpn/x86_64/addaddmul_1msb0.asm: New file.
+ * configure.in (gmp_mpn_functions_optional): Added
+ addaddmul_1msb0.
+ (HAVE_NATIVE): List addaddmul_1msb0.
+
+2008-09-21 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/generic/get_str.c (GET_STR_DC_THRESHOLD): Remove default.
+ (GET_STR_PRECOMPUTE_THRESHOLD): Likewise.
+ Misc code cleanups.
+
+ * gmp-impl.h (mpn_dc_set_str_itch): Allocate GMP_LIMB_BITS more limbs.
+
+ Revert:
+ * mpn/generic/set_str.c:
+ (mpn_dc_set_str): Remove impossible case, replace by an ASSERT.
+
+2008-09-18 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/alpha/ev6/gmp-mparam.h (DIVEXACT_BY3_METHOD): Define.
+
+ * mpn/ia64/diveby3.asm: Remove.
+ * mpn/x86/diveby3.asm: Remove.
+ * mpn/x86/k6/diveby3.asm: Remove.
+ * mpn/x86/k7/diveby3.asm: Remove.
+ * mpn/x86/p6/diveby3.asm: Remove.
+ * mpn/x86/pentium/diveby3.asm: Remove.
+ * mpn/x86_64/diveby3.asm: Remove.
+ * mpn/x86/pentium4/sse2/diveby3.asm: Remove.
+
+ * configure.in (HAVE_NATIVE): List divexact_by3c.
+
+ * gmp-impl.h (mpn_divexact_by3c): Override gmp-h.in's definition.
+ (DIVEXACT_BY3_METHOD): Don't default to 0 if
+ HAVE_NATIVE_mpn_divexact_by3c.
+
+2008-09-18 Niels Möller <nisse@lysator.liu.se>
+
+ * mpn/generic/gcd.c (main): Added code for tuning of CHOOSE_P.
+
+ * mpn/generic/hgcd.c (mpn_hgcd_matrix_mul): Assert that inputs are
+ normalized.
+
+2008-09-17 Niels Möller <nisse@lysator.liu.se> <nisse@king.swox.se>
+
+ * mpn/generic/gcdext.c (mpn_gcdext): p = n/5 caused a
+ slowdown for large inputs. As a compromise, use p = n/2 for the
+ first iteration, and p = n/3 for the rest. Handle the first
+ iteration specially, since the initial u0 and u1 are trivial.
+
+ * mpn/x86_64/gmp-mparam.h (GCDEXT_DC_THRESHOLD): Reduced threshold
+ from 409 to 390.
+
+ * mpn/generic/gcdext.c (CHOOSE_P): New macro. Use p = n/5.
+ (mpn_gcdext): Use CHOOSE_P, and generalized the calculation of
+ scratch space.
+
+ * tune/tuneup.c (tune_hgcd): Use default step factor.
+
+ * mpn/x86_64/gmp-mparam.h: (GCD_DC_THRESHOLD): Reduced from 493 to
+ 412.
+
+ * mpn/generic/gcd.c (CHOOSE_P): New macro, to determine the
+ split when calling hgcd. Use p = 2n/3, as that seems better than
+ the more obvious split p = n/2.
+ (mpn_gcd): Use CHOOSE_P, and generalized the calculation of
+ scratch space.
+
+2008-09-16 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/generic/toom_interpolate_7pts.c: Use new mpn_divexact_byN
+ functions.
+
+ * gmp-impl.h (mpn_divexact_by3, mpn_divexact_by5, mpn_divexact_by7,
+ mpn_divexact_by9, mpn_divexact_by11, mpn_divexact_by13,
+ mpn_divexact_by15): New macros, defined in terms of mpn_bdiv_dbm1.
+
+ * configure.in (gmp_mpn_functions): List bdiv_dbm1c.
+ (HAVE_NATIVE): Likewise.
+ * mpn/asm-defs.m4: Define bdiv_dbm1c.
+ * gmp-impl.h (mpn_bdiv_dbm1c): Declare.
+ (mpn_bdiv_dbm1): New macro.
+ * mpn/generic/bdiv_dbm1c.c: New file.
+ * mpn/alpha/bdiv_dbm1c.asm: New file.
+ * mpn/ia64/bdiv_dbm1c.asm: New file.
+ * mpn/powerpc32/bdiv_dbm1c.asm: New file.
+ * mpn/powerpc64/mode64/bdiv_dbm1c.asm: New file.
+ * mpn/x86/bdiv_dbm1c.asm: New file.
+ * mpn/x86_64/bdiv_dbm1c.asm: New file.
+
+ * mpn/generic/diveby3.c: Add mpn_bdiv_dbm1c based function.
+ Choose function depending on DIVEXACT_BY3_METHOD.
+ * gmp-impl.h (DIVEXACT_BY3_METHOD): Provide default.
+
+2008-09-16 Niels Möller <nisse@lysator.liu.se>
+
+ * mpn/generic/hgcd.c (mpn_hgcd_addmul2_n): Moved function to
+ gcdext.c, where it is used.
+ * mpn/generic/gcdext.c (addmul2_n): Moved and renamed, was
+ mpn_hgcd_addmul2_n. Made static. Deleted input normalization.
+ Deleted rn argument.
+ (mpn_gcdext): Updated calls to addmul2_n, and added assertions.
+
+ * gmp-impl.h (MPN_HGCD_MATRIX_INIT_ITCH): Increased storage by 4 limbs.
+ (MPN_HGCD_LEHMER_ITCH): Reduced storage by one limb.
+ (MPN_GCD_SUBDIV_STEP_ITCH): Likewise.
+ (MPN_GCD_LEHMER_N_ITCH): Likewise.
+
+ * mpn/generic/hgcd.c (mpn_hgcd_matrix_init): Use two extra limbs.
+ (hgcd_step): Use overlapping arguments to mpn_tdiv_qr.
+ (mpn_hgcd_matrix_mul): Deleted normalization code. Tighter bounds
+ for the element size of the product. Needs two extra limbs of
+ storage for the elements.
+ (mpn_hgcd_itch): Updated storage calculation.
+
+ * mpn/generic/gcd_subdiv_step.c (mpn_gcd_subdiv_step): Use
+ overlapping arguments to mpn_tdiv_qr. Use mpn_zero_p.
+
+ * mpn/generic/gcd.c (mpn_gcd): Use mpn_zero_p.
+
+2008-09-15 Niels Möller <nisse@lysator.liu.se>
+
+ * mpn/generic/hgcd.c (mpn_hgcd_matrix_init): Updated for deleted
+ tp pointer.
+ (hgcd_matrix_update_q): Likewise.
+ (mpn_hgcd_matrix_mul): Likewise.
+ (mpn_hgcd_itch): Updated calculation of scratch space.
+
+ * gmp-impl.h (struct hgcd_matrix): Deleted tp pointer.
+ (MPN_HGCD_MATRIX_INIT_ITCH): Reduced storage.
+ (mpn_hgcd_step, MPN_HGCD_STEP_ITCH): Deleted declarations.
+
+2008-09-15 Niels Möller <nisse@lysator.liu.se> <nisse@king.swox.se>
+
+ * mpn/x86_64/gmp-mparam.h (MATRIX22_STRASSEN_THRESHOLD): New
+ threshold.
+
+ * mpn/generic/hgcd.c (mpn_hgcd_matrix_mul): Use mpn_matrix22_mul.
+ (mpn_hgcd_itch): Updated calculation of scratch space. Use
+ count_leading_zeros to get the recursion depth.
+
+ * mpn/generic/gcd.c (mpn_gcd): Fixed calculation of scratch space,
+ and use mpn_hgcd_itch.
+
+2008-09-15 Niels Möller <nisse@lysator.liu.se>
+
+ * tune/tuneup.c (tune_matrix22_mul): New function.
+ (all): Use it.
+
+ * tune/common.c (speed_mpn_matrix22_mul): New function.
+
+ * tune/Makefile.am (TUNE_MPN_SRCS_BASIC): Added matrix22_mul.c.
+
+ * tests/mpn/t-matrix22.c: Use MATRIX22_STRASSEN_THRESHOLD to
+ select sizes for tests.
+
+ * gmp-impl.h (MATRIX22_STRASSEN_THRESHOLD): New threshold
+
+ * configure.in (gmp_mpn_functions): Added matrix22_mul.
+ * gmp-impl.h: Added declarations for mpn_matrix22_mul and related
+ functions.
+
+ * mpn/Makefile.am (nodist_EXTRA_libmpn_la_SOURCES): Added
+ matrix22_mul.c.
+ * tests/mpn/Makefile.am (check_PROGRAMS): Added t-matrix22.
+
+ * tests/mpn/t-matrix22.c: New file.
+ * mpn/generic/matrix22_mul.c: New file.
+
+2008-09-11 Niels Möller <nisse@king.swox.se>
+
+ * tune/tuneup.c: Updated tuning of gcdext.
+
+ * mpn/x86_64/gmp-mparam.h (GCDEXT_DC_THRESHOLD): Reduced threshold
+ from 713 to 409.
+
+2008-09-11 Niels Möller <nisse@lysator.liu.se>
+
+ * gmp-impl.h: Updated for gcdext changes.
+ (GCDEXT_DC_THRESHOLD): New constant, renamed from
+ GCDEXT_SCHOENHAGE_THRESHOLD.
+
+ * mpn/generic/gcdext.c (compute_v): Accept non-normalized a and b
+ as inputs.
+ (mpn_gcdext): Rewrote and simplified. Now uses the new mpn_hgcd
+ interface.
+
+ * mpn/generic/hgcd.c (mpn_hgcd_addmul2_n): Renamed from addmul2_n
+ and made non-static. Changed interface to take non-normalized
+ inputs, and only two size arguments.
+ (mpn_hgcd_matrix_mul): Simplified using new mpn_hgcd_addmul2_n.
+
+ * mpn/generic/gcdext_lehmer.c (mpn_gcdext_lehmer_itch): Deleted
+ function.
+ (mpn_gcdext_lehmer_n): Renamed from mpn_gcd_lehmer. Now takes
+ inputs of equal size. Moved the code for the division step to a
+ separate function...
+ * mpn/generic/gcdext_subdiv_step.c (mpn_gcdext_subdiv_step): New
+ file, new function.
+
+ * configure.in (gmp_mpn_functions): Added gcdext_subdiv_step.
+
+2008-09-10 Torbjorn Granlund <tege@gmplib.org>
+
+ * tests/devel/anymul_1.c: Include <string.h>.
+
+ * gmp-h.in: Unconditionally include <cstdio>.
+
+2008-09-10 Niels Möller <nisse@lysator.liu.se>
+
+ * tune/common.c: #if:ed out speed_mpn_gcd_binary and
+ speed_mpn_gcd_accel.
+ * tune/speed.c (routine): #if:ed out mpn_gcd_binary, mpn_gcd_accel
+ and find_a.
+ * tune/Makefile.am (libspeed_la_SOURCES): Removed gcd_bin.c
+ gcd_accel.c gcd_finda_gen.c.
+ * tune/tuneup.c: Enable tuning of GCD_DC_THRESHOLD.
+
+ * mpn/generic/gcd.c (mpn_gcd): Rewrote and simplified. Now uses
+ the new mpn_hgcd interface.
+
+ * */gmp-mparam.h: Renamed GCD_SCHOENHAGE_THRESHOLD to
+ GCD_DC_THRESHOLD.
+
+ * mpn/generic/gcd_lehmer.c (mpn_gcd_lehmer_n): Renamed (was
+ mpn_gcd_lehmer). Now takes inputs of equal size.
+
+ * mpn/generic/gcd_lehmer.c (mpn_gcd_lehmer): Reintroduced gcd_2,
+ to get better performance for small inputs.
+
+ * mpn/generic/hgcd.c: Don't hardcode small HGCD_THRESHOLD.
+ * mpn/x86_64/gmp-mparam.h (HGCD_THRESHOLD): Reduced from 145 to
+ 120.
+ * */gmp-mparam.h: Renamed HGCD_SCHOENHAGE_THRESHOLD to
+ HGCD_THRESHOLD.
+
+2008-09-09 Torbjorn Granlund <tege@gmplib.org>
+
+ * doc/gmp.texi: Fix a typo and clarify mpn_gcdext docs.
+
+2008-09-09 Niels Möller <nisse@lysator.liu.se>
+
+ * tune/common.c (speed_mpn_hgcd, speed_mpn_hgcd_lehmer): Adapted
+ to new hgcd interface.
+
+ * gmp-impl.h (MPN_HGCD_LEHMER_ITCH): New macro.
+
+ * hgcd.c (mpn_hgcd_lehmer): Renamed function, from hgcd_base. Made
+ non-static.
+
+ * gcd_lehmer.c (mpn_gcd_lehmer): Use hgcd2 also for n == 2.
+
+ * gcdext_lehmer.c (mpn_gcdext_lehmer): Simplified code for
+ division step. Added proper book-keeping of swaps, which affect
+ the sign of the returned cofactor.
+
+ * tests/mpz/t-gcd.c (one_test): Display co-factor when mpn_gcdext
+ fails.
+
+ * gcd_lehmer.c (mpn_gcd_lehmer): At end of loop, need to handle
+ the special case n == 1 correctly.
+
+ * gcd_subdiv_step.c (mpn_gcd_subdiv_step): Simplified function.
+ The special cancellation logic is not needed here.
+
+2008-09-08 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/generic/invert.c: Add working but slow code.
+
+ * mpn/x86_64/x86_64-defs.m4 (R32, R8): New macros.
+
+ * mpn/ia64/submul_1.asm: Move some labels for broader assembler
+ compatibility.
+
+ * gmp-impl.h (mpn_mul_3, mpn_mul_4): Declare.
+ * tests/tests.h (refmpn_mul_3, refmpn_mul_4): Declare.
+ * tests/try.c (param_init): Set things up for mpn_mul_3 and mpn_mul_4.
+ (choice_array): Likewise.
+ (call): Likewise.
+ * mpn/Makefile.am (nodist_EXTRA_libmpn_la_SOURCES):
+ Add mul_3.c and mul_4.
+ * mpn/asm-defs.m4: Define mul_3 and mul_4.
+ * tests/refmpn.c (refmpn_mul_N): New function.
+ (refmpn_mul_2): Remove old definition, call refmpn_mul_N.
+ (refmpn_mul_3, refmpn_mul_4): New functions.
+ * tune/common.c (speed_mpn_mul_3, speed_mpn_mul_4): New functions.
+ * tune/speed.h (speed_mpn_mul_3, speed_mpn_mul_4): Declare.
+ * tune/speed.c (routine): New entries for mpn_mul_2 and mpn_mul_3.
+
+ * ltmain.sh: Update to libtool 1.5.24.
+
+ * mpn/generic/mul_toom22.c: Compute s and t more cleverly.
+
+2008-09-08 Niels Möller <nisse@lysator.liu.se>
+
+ * tests/mpn/t-hgcd.c: Updated tests. Rewrite of hgcd_ref.
+
+ * mpn/generic/gcdext_lehmer.c (mpn_gcdext_lehmer_itch): New function.
+ (mpn_gcdext_lehmer): Various bugfixes.
+
+ * gcdext.c (mpn_gcdext): Allocate scratch space for gcdext_lehmer.
+
+ * mpn/generic/gcd_lehmer.c (gcd_2): ASSERT that inputs are odd.
+ (mpn_gcd_lehmer): Added tp argument, for scratch space. Make both
+ arguments odd before calling gcd_2.
+
+ * mpn/generic/hgcd.c (mpn_hgcd): Allow the trivial case n <= 2,
+ and return 0 immediately.
+
+ * gmp-impl.h (MPN_EXTRACT_NUMB): New macro.
+
+ * configure.in (gmp_mpn_functions): Added gcdext_lehmer.
+
+2008-09-05 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/generic/toom_interpolate_7pts.c: Use mpn_divexact_by3c instead of
+ divexact_odd.
+
+ * doc/texinfo.tex: Update to 2007-06-29.13.
+
+ * doc/gmp.texi: Update GMP site URL. Fix some typos.
+
+ * demos/pexpr.c (main): Allow bases up to 62.
+
+ * gmp-impl.h: Remove formal parameter names from function prototypes.
+
+ * config.guess: Recognize recent AMD and Itanium CPUs.
+ Default X86 CPU recognition to configfsf.guess' value.
+
+ * configure.in: Handle core2 separately from athlon64.
+
+2008-09-05 Niels Möller <nisse@lysator.liu.se>
+
+ * */Makefile.in, configure, aclocal.m4, config.in: Removed files
+ from repository. They're instead generated by automake and
+ autoconf before distribution.
+
+2008-08-25 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpf/set_str.c: Allocate mantissa space based on mantissa size,
+ not on destination variable space.
+ * mpf/set_str.c: Accept unary plus before exponent.
+
+2008-08-06 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/generic/mul_toom22.c: Add statistics gathering functionality,
+ triggered by cpp predef STAT.
+
+ From David Harvey:
+ * mpn/generic/mul_toom22.c: Decrease scratch space usage.
+
+2008-08-02 Torbjorn Granlund <tege@gmplib.org>
+
+ * tests/misc/t-scanf.c: Avoid negative arguments to _ui functions.
+ * tests/misc/t-printf.c: Likewise.
+
+ * acinclude.m4 (X86_PATTERN): Add geode.
+
+ * acinclude.m4 (CL_AS_NOEXECSTACK): Avoid -q flag to grep.
+
+2008-08-01 Torbjorn Granlund <tege@gmplib.org>
+
+ * acinclude.m4 (CL_AS_NOEXECSTACK): New.
+ * configure.in: Use CL_AS_NOEXECSTACK.
+ * mpn/Makeasm.am: Use ASM_FLAGS (defined by CL_AS_NOEXECSTACK).
+
+ * gmpxx.h (__GMP_DBL_LIMBS): Use DBL_MAX_EXP instead of
+ std::numeric_limits<double>::max_exponent for better portability.
+
+2008-07-29 Torbjorn Granlund <tege@gmplib.org>
+
+ * gmpxx.h (__GMP_DBL_LIMBS): New #define.
+ (__GMP_ULI_LIMBS): New #define.
+ (__GMPXX_TMP_UI): New macro.
+ (__GMPXX_TMP_SI): New macro.
+ (__GMPXX_TMP_D): New macro.
+ (struct __gmp_binary_and): Rewrite, using the new macros.
+ (struct __gmp_binary_ior): Likewise.
+ (struct __gmp_binary_xor): Likewise.
+
+2008-07-28 Torbjorn Granlund <tege@gmplib.org>
+
+ * tests/cxx/t-binary.cc: Add some tests for logical operations.
+
+2008-07-24 Torbjorn Granlund <tege@gmplib.org>
+
+ * gmpxx.h: Use __GMPZ_* instead of __GMPZZ_* for bitwise ops, remove
+ __GMPZZ_*.
+ Remove repeated #undefs.
+ (__gmp_alloc_cstring): Declare freefunc as extern "C".
+
+2008-07-23 Torbjorn Granlund <tege@gmplib.org>
+
+ * gmp-h.in (__GMP_CC): New define, undocumented for now.
+ (__GMP_CFLAGS): Likewise.
+
+2008-07-21 Torbjorn Granlund <tege@gmplib.org>
+
+ * tests/amd64check.c: Fix a printf type clash.
+
+ * mpz/realloc.c: Amend last fix.
+
+ * gmp-h.in: Include <cstdlib> for C++.
+ * gmp-h.in: Handle new gcc 4.3 inline semantics defaults.
+
+ * configfsf.guess: Update to version of 2008-04-14.
+ * configfsf.sub: Update to version of 2008-06-16.
+
+ * configure.in: Separate core2 and athlon64 flags handling.
+
+2008-06-19 Torbjorn Granlund <tege@gmplib.org>
+
+ * config.guess: Recognize pentiumm and AMD geode.
+ * config.sub: Likewise.
+ * configure.in: Likewise.
+
+2008-06-02 Torbjorn Granlund <tege@gmplib.org>
+
+ * configure.in: Disallow odd nails sizes.
+ * configure.in: Inherit default gcc_cflags/gcc_64_cflags everywhere.
+
+2008-05-23 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpz/init2.c: Rewrite to avoid internal overflow and to detect mpz_t
+ overflow.
+ * mpz/realloc2.c: Likewise.
+ * mpz/realloc.c: Detect mpz_t overflow.
+
+2008-05-22 Torbjorn Granlund <tege@gmplib.org>
+
+ * configure.in (sparc): Remove -fast, it causes documented
+ miscompilation.
+
+ * config.guess: Properly handle the "extended" variants of x86 cpuid.
+
+2008-05-09 Torbjorn Granlund <tege@gmplib.org>
+
+ * gmp-impl.h (mpn_mul_fft): Now void.
+ (udiv_qrnnd_preinv3): Special case for constant (nl).
+
+2008-05-08 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/generic/mul_fft.c: Clean up types in TRACE (printf (...)).
+ (TRACE): Redefine to allow command line control.
+ (mpn_mul_fft_internal): Now void, remove return value.
+ (mpn_mul_fft): Likewise.
+ (MPN_FFT_TABLE2_SIZE): Up size fro 256 to 512.
+ (mpn_fft_fft): Call mpn_fft_mul_2exp_modF just once instead of twice,
+ then add/subtract result. Get rid of temp allocation as a result.
+ Remove some redundant CNST_LIMB.
+ (mpn_fft_fftinv): Analogous changes.
+ (mpn_fft_sub_modF): Re-enable, now needed by mpn_fft_fft and
+ mpn_fft_fftinv.
+
+2008-03-10 Torbjorn Granlund <tege@gmplib.org>
+
+ * tests/mpz/t-mul.c (main): Let GMP_CHECK_FFT mean largest allowed
+ power-of-2 of test operands.
+
+2008-02-28 Torbjorn Granlund <tege@gmplib.org>
+
+ * tests/cxx/t-binary.cc (check_mpz): Expect floor rounding for right
+ shift.
+
+2008-02-27 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpz/mul_i.h: Check sml's size (not the signed small_mult).
+
+ * longlong.h (umul_ppmm) [alpha]: Define using __builtin_alpha_umulh
+ when possible.
+
+ * longlong.h (count_trailing_zeros): Force destination register mode.
+
+ * gmpxx.h (struct __gmp_binary_rshift): Use floor rounding, not
+ truncation.
+
+ * gmpxx.h (__gmp_binary_and, __gmp_binary_ior, __gmp_binary_xor):
+ Add variants with unsigned long int argument.
+
+ * config.sub: Recog geode.
+ * config.guess: Likewise.
+ * acinclude.m4 (X86_PATTERN): Likewise.
+
+2008-02-10 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/x86/p6/aors_n.asm: Use Zdisp to work around GNU as bug.
+ * mpn/x86/x86-defs.m4 (Zdisp): Add more instructions.
+
+2008-02-08 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/x86_64/aors_n.asm: New file.
+ * mpn/x86_64/add_n.asm: Delete.
+ * mpn/x86_64/sub_n.asm: Delete.
+
+2008-02-07 Torbjorn Granlund <tege@gmplib.org>
+
+ * mpn/x86/k6/mmx/dive_1.asm: Fix typo in last change.
+
+2007-12-10 Torbjorn Granlund <tege@swox.com>
+
+ * mpf/set_str.c (mpf_set_str): Write own code for converting the
+ exponent, avoids strtol base < 36 limitation.
+
+2007-10-28 Torbjorn Granlund <tege@swox.com>
+
+ * gmp-impl.h (mpn_dc_get_str_itch): New macro.
+ (mpn_dc_get_str_powtab_alloc): New macro.
+ (struct powers): Add field "shift".
+
+ * mpn/generic/get_str.c: Compute powers without low zero limbs; all
+ functions modified. Correct temporary allocation. Misc cleanups.
+
+ * mpn/generic/set_str.c: Compute powers without low zero limbs; all
+ functions modified.
+ (mpn_dc_set_str): Remove impossible case, replace by an ASSERT.
+
+2007-10-26 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/generic/set_str.c: Remove default thresholds, not in gmp-impl.h.
+ (mpn_dc_set_str): Insert ASSERT_ALWAYS in a presumably dead code arm.
+
+2007-10-22 Torbjorn Granlund <tege@swox.com>
+
+ * gmp-impl.h (mpn_add_nc): Define as inline function, unless NATIVE.
+ (mpn_sub_nc): Likewise.
+
+2007-10-17 Torbjorn Granlund <tege@swox.com>
+
+ * tests/misc/t-printf.c: Fix a printf type clash.
+ * tests/mpq/t-get_str.c: Likewise.
+ * tests/mpz/t-import.c: Likewise.
+
+ * acinclude.m4: Conditionally disable some tests when compiled by a C++
+ compiler.
+
+ * gmp-impl.h (udiv_qrnnd_preinv3): Remove an unused variable.
+
+ * mpn/generic/hgcd.c: Add some WANT_ASSERTs to shut up warnings.
+
+2007-10-08 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/powerpc64/elf.m4 (LEAL): Define as an alias for LEA.
+ * mpn/powerpc32/darwin.m4 (LEAL): Likewise.
+ * mpn/powerpc64/aix.m4: Likewise.
+
+ * mpn/powerpc64/vmx/popcount.asm: Use LEAL.
+
+ * mpn/powerpc64/darwin.m4 (LEAL): New name for LEA, since it is only
+ usable for local symbols.
+ (LEA): Replace with code for external references.
+
+ * mpn/powerpc32/vmx/mod_34lsub1.asm: Use LEAL.
+
+2007-10-07 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/x86/dive_1.asm: Use LEA, remove explicit movl_eip_*.
+ * mpn/x86/k6/mode1o.asm: Likewise.
+ * mpn/x86/k6/mmx/dive_1.asm: Likewise.
+ * mpn/x86/k7/dive_1.asm: Likewise.
+ * mpn/x86/k7/mode1o.asm: Likewise.
+ * mpn/x86/p6/dive_1.asm: Likewise.
+ * mpn/x86/p6/mode1o.asm: Likewise.
+ * mpn/x86/pentium4/sse2/dive_1.asm: Likewise.
+ * mpn/x86/pentium4/sse2/mode1o.asm: Likewise.
+ * mpn/x86/pentium4/sse2/popcount.asm: Likewise.
+
+ * mpn/x86/p6/aors_n.asm: Table cycle counts.
+
+ * mpn/x86/k7/mod_34lsub1.asm: Fix over-optimistic cycle count claims.
+
+ * mpn/x86/x86-defs.m4 (DEF_OBJECT, END_OBJECT): New define's.
+
+ * mpn/x86/darwin.m4 (LEA): Put also movl_eip_XX into EPILOGUE_cpu.
+ Expect target register to have prepended %.
+
+ * mpn/x86_64/add_n.asm: Use L() for labels.
+ * mpn/x86_64/addlsh1_n.asm: Likewise.
+ * mpn/x86_64/addmul_2.asm: Likewise.
+ * mpn/x86_64/aorrlsh_n.asm: Likewise.
+ * mpn/x86_64/aorsmul_1.asm: Likewise.
+ * mpn/x86_64/com_n.asm: Likewise.
+ * mpn/x86_64/copyd.asm: Likewise.
+ * mpn/x86_64/copyi.asm: Likewise.
+ * mpn/x86_64/diveby3.asm: Likewise.
+ * mpn/x86_64/logops_n.asm: Likewise.
+ * mpn/x86_64/lshsub_n.asm: Likewise.
+ * mpn/x86_64/mul_1.asm: Likewise.
+ * mpn/x86_64/mul_2.asm: Likewise.
+ * mpn/x86_64/mul_basecase.asm: Likewise.
+ * mpn/x86_64/popham.asm: Likewise.
+ * mpn/x86_64/redc_1.asm: Likewise.
+ * mpn/x86_64/rsh1add_n.asm: Likewise.
+ * mpn/x86_64/rsh1sub_n.asm: Likewise.
+ * mpn/x86_64/rshift.asm: Likewise.
+ * mpn/x86_64/sub_n.asm: Likewise.
+ * mpn/x86_64/sublsh1_n.asm Likewise.
+ * mpn/x86_64/pentium4/aors_n.asm: Likewise.
+ * mpn/x86_64/pentium4/lshift.asm: Likewise.
+ * mpn/x86_64/pentium4/rshift.asm: Likewise.
+
+ * mpn/x86_64/x86_64-defs.m4: New file, defining LEA, DEF_OBJECT, and
+ END_OBJECT.
+
+ * mpn/generic/mul.c: Put TMP_DECL as last decl.
+
+2007-10-06 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/x86/pentium4/sse2/popcount.asm: New file.
+
+2007-09-26 Torbjorn Granlund <tege@swox.com>
+
+ * mpz/get_str.c: Cast a char index to int to shut up compilers.
+
+ * mpn/generic/dc_div_qr.c: Pass dummy scratch argument to mpn_invert.
+ * mpn/generic/dc_divappr_q.c: Likewise.
+ * mpn/generic/mu_div_qr.c: Likewise.
+ * mpn/generic/mu_divappr_q.c: Likewise.
+ * mpn/generic/mu_div_q.c: Likewise.
+ * mpn/generic/divexact.c: Likewise.
+
+ * mpn/generic/invert.c: New file, placeholder for now.
+
+2007-09-24 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/generic/toom_interpolate_5pts.c: New file, contents from
+ mpn/generic/mul_n.c
+ * mpn/generic/mul_n.c (mpn_toom3_interpolate): Function removed.
+
+ * mpn/generic/toom_interpolate_7pts.c: New file.
+
+ * mpn/x86/k7/mmx/popham.asm: Table cycle counts.
+
+ * mpn/x86/k6/README: Update URLs.
+
+ * mpn/powerpc32/README: Update URL's, company names.
+
+ * mpn/generic/get_d.c: Complete rewrite.
+
+ * mpn/generic/mul_toom33.c: New file.
+
+ * mpn/generic/mul_toom22.c: Make orthogonal with other toomXY files.
+ * mpn/generic/mul_toom32.c: Likewise.
+ * mpn/generic/mul_toom42.c: Likewise.
+
+ * mpn/alpha/invert_limb.asm: Update cycle counts. Fix a comment typo.
+
+ * mpf/get_str.c: Include stdlib.h, not stdio.h for NULL.
+
+ * doc/gmp.texi: Fix a typo.
+
+ * memory.c (__gmp_default_allocate, __gmp_default_reallocate):
+ Cast size operands in error fprintf's.
+
+ * longlong.h (sub_ddmmss) [powerpc 64]: Add more variants for constant
+ args.
+
+ * gmp-impl.h (udiv_qrnnd_preinv3): New define.
+ * gmp-impl.h (ULONG_PARITY): Exclude masquerading __INTEL_COMPILER from
+ ia64 asm.
+
+ * gmp-h.in (mpn_neg_n): New function.
+
+2007-09-18 Torbjorn Granlund <tege@swox.com>
+
+ * demos/pexpr.c (main): Add -v option.
+ (enum op_t): New tag TIMING.
+ (mpz_eval_expr): Execute TIMING.
+ (fns): Add TIMING entry.
+
+ * gmp-impl.h: Add decls and THRESHOLDs for new toom multiplication
+ functions and division functions.
+
+2007-09-10 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/powerpc32/addlsh1_n.asm: Use L() for labels.
+ * mpn/powerpc32/sublsh1_n.asm: Likewise.
+
+2007-09-09 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/x86/x86-defs.m4 (LEA): New define.
+ * mpn/x86/darwin.m4: New file, for now just defining LEA.
+ * configure.in: Pick up x86/darwin.m4.
+ * mpn/x86/*: Use LEA for PIC references.
+
+ * configure.in: For X86/32, treat core2 like pentium3.
+
+2007-09-06 Torbjorn Granlund <tege@swox.com>
+
+ * tests/amd64check.c (calling_conventions_values): Put constants,
+ dynamic values in this array (was in scalars).
+ (calling_conventions_check): Corresponding changes.
+ * tests/amd64call.asm: Rewrite to be PIC, smaller, using amd64check.c's
+ array.
+
+2007-09-04 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/x86/pentium4/sse2/mul_basecase.asm: Misc cleanups.
+ * mpn/x86/pentium4/sse2/sqr_basecase.asm: Likewise.
+
+ * mpn/x86_64/mod_34lsub1.asm: Optimize loop, reduce code size.
+
+ * tests/amd64call.asm: Remove bogus no-op moves.
+
+2007-09-03 Torbjorn Granlund <tege@swox.com>
+
+ From Richard Guenther:
+ * gmp-h.in (__GMP_EXTERN_INLINE): Declare conditionally on
+ __GNUC_STDC_INLINE__.
+
+ * tests/cxx/t-locale.cc: #include <cstdlib>, for abort.
+
+ * mpn/x86_64/core2/popcount.asm: New file.
+ * mpn/x86_64/pentium4/popcount.asm: New file.
+
+ * mpn/x86_64/addmul_2.asm: New file.
+ * mpn/x86_64/mul_2.asm: New file.
+
+ * mpn/x86_64/aorsmul_1.asm: Use 32-bit mov for zeroing registers
+ (saves space).
+
+2007-09-01 Torbjorn Granlund <tege@swox.com>
+
+ * configure.in: Handle athlon64, core2, and pentium4 separately for
+ 64-bit ABI.
+
+ * config.sub: Recog athlon64, core2, and opteron.
+
+ * config.guess: Do two x86 variants, for 32-bit ABI and 64-bit ABI.
+ Return "athlon64" and "core2", not x86_64.
+
+2007-08-31 Torbjorn Granlund <tege@swox.com>
+
+ From Patrick Pelissier:
+ * gmp-h.in: Don't refer to FILE from C++ unless we've seen FILE.
+
+2007-08-30 Torbjorn Granlund <tege@swox.com>
+
+ * demos/isprime.c: Include string.h for strcmp.
+
+ * demos/factorize.c (main): Declare to int.
+
+2007-06-22 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/x86_64/pentium4/lshift.asm: Minor tuning.
+ * mpn/x86_64/pentium4/rshift.asm: Likewise.
+
+2007-05-30 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/powerpc64/mode64/aors_n.asm: Add _nc entry points.
+
+2007-05-22 Torbjorn Granlund <tege@swox.com>
+
+ * tests/memory.c: Cast calls to new mem* calls to avoid unaligned ops.
+
+2007-05-16 Torbjorn Granlund <tege@swox.com>
+
+ * tests/mpz/convert.c: Tweak operand sizes for best coverage.
+
+ * tests/memory.c: Add red zones around allocations.
+
+2007-05-15 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/ia64/mul_1.asm: Make mul_1c entry point actually work.
+
+ * mpn/generic/set_str.c (mpn_dc_set_str): Avoid calling mpn_add_n when
+ ln == 0.
+
+ * tests/mpz/convert.c (string_urandomb): New function.
+ (main): Use it by enabling ifdef'ed out code.
+
+2007-04-30 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/x86_64/mul_basecase.asm: Complete rewrite.
+
+ * mpn/x86_64/copyi.asm: Use short shift-by-one form. Misc cleanups.
+ * mpn/x86_64/copyi.asm: Likewise.
+ * mpn/x86_64/popham.asm: Likewise.
+
+ * mpn/x86_64/aorsmul_1.asm: Cleanup formatting.
+
+2007-04-25 Torbjorn Granlund <tege@swox.com>
+
+ * mpz/divexact.c: Handle undefined case of |N| < |D| to avoid segfaults.
+
+2007-02-24 Torbjorn Granlund <tege@swox.com>
+
+ * doc/gmp.texi (Toom 3-Way Multiplication): Fix typo.
+ (mpz_scan0, mpz_scan1): Fix typos.
+ (Float Internals): Rewrite paragraph about struct types.
+
+2007-02-12 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/x86/pentium4/sse2/sqr_basecase.asm: Complete rewrite (except
+ diagonal code).
+
+2007-02-05 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/generic/mul_fft.c (mpn_fft_fft): New name for mpn_fft_fft_sqr,
+ old mpn_fft_fft removed.
+ (mpn_mul_fft_internal): Call mpn_fft_fft separately for each operand.
+ (mpn_fft_add_modF): Rewrite to avoid random branches.
+ (mpn_fft_sub_modF): Likewise.
+
+ * mpn/x86/pentium4/sse2/addmul_1.asm: Complete rewrite.
+ * mpn/x86/pentium4/sse2/mul_1.asm: Complete rewrite.
+ * mpn/x86/pentium4/sse2/mul_basecase.asm: Complete rewrite, based on
+ new addmul and mul code.
+
+2007-01-31 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/generic/get_str.c (mpn_sb_get_str): Get loop count for frac
+ development right.
+
+ * mpn/powerpc32/vmx/mod_34lsub1.asm: New file.
+
+ * mpn/powerpc32/aors_n.asm: New file, complete rewrite.
+ * mpn/powerpc32/add_n.asm: Remove.
+ * mpn/powerpc32/sub_n.asm: Remove.
+
+2007-01-25 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/x86_64/core2/aors_n.asm: Add _nc entry points, minor cleanups.
+
+ * mpn/x86_64/core2/lshift.asm: Rewrite.
+ * mpn/x86_64/core2/rshift.asm: Rewrite.
+
+ * mpn/x86_64/pentium4/lshift.asm: Swap some loop insns for a small
+ speedup.
+ * mpn/x86_64/pentium4/rshift.asm: New file, based on lshift.asm.
+
+ * mpn/x86_64/pentium4/gmp-mparam.h: New file.
+
+ * mpn/x86_64/pentium4/aors_n.asm: Complete rewrite of add/subtract
+ code.
+ * mpn/x86_64/pentium4/add_n.asm: Remove.
+ * mpn/x86_64/pentium4/sub_n.asm: Remove.
+
+2007-01-20 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/x86_64/lshift.asm: Add special case for cnt=1.
+
+2007-01-19 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/x86_64/aorsmul_1.asm: New file, written from scratch, finally at
+ 3.0 c/l on K8 (addmul_1 was 3.3; submul_1 was 3.5).
+ * mpn/x86_64/addmul_1.asm: Remove.
+ * mpn/x86_64/submul_1.asm: Remove.
+
+2006-12-29 Torbjorn Granlund <tege@swox.com>
+
+ * randmt.c (__gmp_randclear_mt): Initialize ALLOC field, like in
+ __gmp_randinit_mt_noseed.
+ (__gmp_randclear_mt, __gmp_randinit_mt_noseed): Make similar functions
+ look similar.
+ (__gmp_randclear_mt): Pass actually allocated size.
+
+ * mpn/Makefile.am (nodist_EXTRA_libmpn_la_SOURCES): Add mul_toom22.c,
+ mul_toom32.c, mul_toom42.c.
+
+ * configure.in: Recognize athlon64 and core2 as alternatives to x86_64.
+ Provide special settings for core2.
+
+ * configure.in (gmp_mpn_functions): Add mul_toom22, mul_toom32,
+ mul_toom42.
+
+ * mpn/generic/mul_toom22.c: New file.
+ * mpn/generic/mul.c: Use mpn_mul_toom22. Trim cutoff points between
+ the mpn_mul_toomN2 functions. Handle balanced operands at function
+ entry.
+
+2006-12-29 Marco Bodrato <bodrato@mail.dm.unipi.it>
+
+ * mpn/generic/mul_n.c: Rewrite interpolation code.
+
+2006-12-28 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/generic/mul_toom32.c: New file.
+ * mpn/generic/mul_toom42.c: New file.
+ * mpn/generic/mul.c: Use mpn_mul_toom32 and mpn_mul_toom42 for
+ unbalanced operands.
+
+2006-12-17 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/x86_64/aorrlsh_n.asm: New file.
+ * mpn/x86_64/lshsub_n.asm: New file.
+
+ * mpn/x86_64/core2/aors_n.asm: New file.
+ * mpn/x86_64/core2/lshift.asm: New file.
+ * mpn/x86_64/core2/rshift.asm: New file.
+
+ * mpn/x86/p6/aors_n.asm: Replace K7 grabbing code with P6 specific
+ code.
+
+ * mpn/x86/p6/lshsub_n.asm: New file.
+
+2006-11-23 Torbjorn Granlund <tege@swox.com>
+
+ * tune/speed.h (SPEED_ROUTINE_MPN_MUL_BASECASE): Allocate space for xp
+ locally, s->xp might be insufficient.
+
+2006-11-22 Torbjorn Granlund <tege@swox.com>
+
+ * randmt.c (__gmp_randinit_mt_noseed): Initialize ALLOC field of result
+ param.
+
+2006-11-06 Torbjorn Granlund <tege@swox.com>
+
+ * tune/set_strp.c: New file.
+
+2006-11-04 Torbjorn Granlund <tege@swox.com>
+
+ * extract-dbl.c: Rewrite to handle nails better, and for general
+ optimization.
+
+ * mpz/bin_uiui.c: Simplify.
+
+ * longlong.h (umul_ppmm) [mmix]: New.
+
+ * tune/tuneup.c, tune/common.c, tune/speed.c, tune/speed.h,
+ tune/set_strb.c, tune/set_strs.c: Add tuning and speed measurements
+ of separate SET_STR_DC_THRESHOLD and SET_STR_PRECOMPUTE_THRESHOLD.
+ Add tuning and speed measurement of mpn_addsub_n.
+
+2006-10-31 Torbjorn Granlund <tege@swox.com>
+
+ * gmpxx.h: Remove ternary stuff, it is hardly an optimization and it
+ writes to destination before reading all source operands.
+
+2006-10-25 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/generic/set_str.c: Complete rewrite.
+ * mpn/generic/get_str.c: Likewise.
+
+ * gmp-impl.h (struct powers, powers_t): New types.
+ Restructure GET_STR_* and SET_STR_* thresholds.
+
+2006-09-21 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/generic/rootrem.c: Remove some redundant casts.
+
+2006-07-12 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/alpha/ev6/nails/addmul_2.asm: Make it run at claimed speed.
+ * mpn/alpha/ev6/nails/addmul_4.asm: Likewise.
+
+ * mpf/get_str.c: Avoid copying result when not needed. Misc cleanups.
+
+ * tests/amd64call.asm: Use jmp instead of jmpq to placate Solaris.
+
+2006-06-30 Torbjorn Granlund <tege@swox.com>
+
+ * configure.in (powerpc-*): Remove repeated path component.
+
+2006-06-15 Torbjorn Granlund <tege@swox.com>
+
+ * configure.in: (ia64-*-linux*): Don't use -O3.
+
+2006-06-14 Torbjorn Granlund <tege@swox.com>
+
+ * mpq/get_str.c: Fix upper base limit boundary in an ASSERT.
+
+ * tests/refmpn.c (refmpn_sb_divrem_mn): Use ASSERT_CARRY for add-back.
+
+2006-05-31 Torbjorn Granlund <tege@swox.com>
+
+ * tests/mpz/t-set_d.c (check_data): Add more data points.
+
+ * mpz/set_d.c: Handle negative return values from __gmp_extract_double.
+
+2006-05-17 Torbjorn Granlund <tege@swox.com>
+
+ * configure.in: Clear out gcc_cflags_cpu and gcc_cflags_arch for a fat
+ build.
+
+2006-05-16 Torbjorn Granlund <tege@swox.com>
+
+ * 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.
+
+2006-05-12 Torbjorn Granlund <tege@swox.com>
+
+ * config.guess: Recognize more ppc processor types.
+
+2006-05-11 Torbjorn Granlund <tege@swox.com>
+
+ * tune/speed.c (usage): Update URL for gnuplot and quickplot.
+
+2006-05-10 Torbjorn Granlund <tege@swox.com>
+
+ * configure.in (powerpc-*-*): Pass -maltivec to assembler for
+ appropriate CPUs.
+
+2006-05-08 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/powerpc32/aix.m4 (LEA): Remove [RW] attribute.
+
+2006-05-03 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/powerpc64/vmx/popcount.asm: Conditionally zero extend n.
+
+2006-04-27 Torbjorn Granlund <tege@swox.com>
+
+ * mpz/divexact.c: Call mpz_tdiv_q for large operands.
+
+ * configure.in (powerpc-*-darwin): Remove -fast, it affects PIC.
+
+2006-04-26 Torbjorn Granlund <tege@swox.com>
+
+ * config.guess: Try to recognize Ultrasparc T1 (as ultrasparct1).
+ * config.sub: Handle ultrasparct1.
+
+2006-04-25 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/sparc64/gmp-mparam.h: Retune, without separation of GNUC and
+ non-GNUC data.
+
+2006-04-20 Torbjorn Granlund <tege@swox.com>
+
+ * tests/mpz/convert.c: Increase operands range.
+
+2006-04-19 Torbjorn Granlund <tege@swox.com>
+
+ * configure.in: Support powerpc eABI.
+ * mpn/powerpc32/eabi.m4: New file.
+
+ * configure.in: Support powerpc *bsd.
+ * mpn/powerpc64/elf.m4: New name for mpn/powerpc64/linux64.m4.
+ * mpn/powerpc32/elf.m4: New name for mpn/powerpc32/linux.m4.
+
+ * mpn/powerpc64/linux64.m4 (ASM_END): Quote TOC_ENTRY.
+
+2006-04-18 Torbjorn Granlund <tege@swox.com>
+
+ * configure.in (gmp_mpn_functions_optional): Add lshiftc.
+ (HAVE_NATIVE): Add lshiftc.
+
+ * mpn/powerpc64/mode64/invert_limb.asm: Use LEA, not LDSYM.
+ * mpn/powerpc64/mode64/mode1o.asm: Likewise.
+ * mpn/powerpc64/mode64/dive_1.asm: Likewise.
+
+ * mpn/powerpc64/linux64.m4 (TOC_ENTRY): Define to empty.
+ * mpn/powerpc64/aix.m4 (TOC_ENTRY): Likewise.
+ * mpn/powerpc32/aix.m4 (TOC_ENTRY): Likewise.
+
+ * mpn/powerpc32/aix.m4 (EXTERN): New, copied form powerpc64/aix.m4.
+ * mpn/powerpc32/mode1o.asm: Use EXTERN.
+ * mpn/powerpc32/linux.m4 (EXTERN): Provide dummy definition.
+ * mpn/powerpc32/darwin.m4 (EXTERN): Likewise.
+
+2006-04-13 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/generic/mul_fft.c: Use new thresholds mechanism if MUL_FFT_TABLE2
+ is defined.
+ (mpn_lshiftc): New name for mpn_lshift_com (for consistency with some
+ stuff already in 4.1.4.
+ (mpn_fft_mul_2exp_modF): Reorganize initial operand reductions to avoid
+ divisions.
+
+ * tests/devel/try.c (choice_array): Add mpn_addsub_n[c].
+
+2006-04-11 Torbjorn Granlund <tege@swox.com>
+
+ * aclocal.m4: Regenerate with patched libtool.
+
+ * mpn/asm-defs.m4 (ASM_END): Provide (empty) default.
+
+2006-04-08 Torbjorn Granlund <tege@swox.com>
+
+ * configure.in (gmp_mpn_functions_optional): Add addsub.
+
+ * gmpxx.h: Remove missed MPFR references.
+
+ * gmp-impl.h (LIMBS_PER_DOUBLE): Adjust formula to not be pessimistic.
+
+ * gmp-impl.h (TMP_*, WANT_TMP_DEBUG): Don't expect marker argument;
+ define TMP_SALLOC and TMP_BALLOC.
+
+ * mpn/minithres/gmp-mparam.h: New file.
+
+ * tests/mpz/t-io_raw.c: Fix printf type/arg mismatches.
+ * tests/mpz/t-export.c: Likewise.
+ * tests/mpz/io.c: Likewise.
+ * tests/t-constants.c: Likewise.
+
+ * mpn/ia64/popcount.asm: Append "cond.dptk" to conditional branches to
+ placate icc.
+ * mpn/ia64/hamdist.asm: Likewise.
+ * mpn/ia64/lorrshift.asm: Likewise.
+ * mpn/ia64/dive_1.asm: Likewise.
+
+2006-04-05 Torbjorn Granlund <tege@swox.com>
+
+ * tal-notreent.c (__gmp_tmp_mark): Add "struct" tag for tmp_marker.
+ (__gmp_tmp_free): Likewise.
+
+ * mpn/generic/mul_fft.c: Optimize many scalar divisions and mod
+ operations into masks and shifts.
+ (mpn_fft_mul_modF_K): Fix a spurious ASSERT_NOCARRY.
+
+2006-03-26 Torbjorn Granlund <tege@swox.com>
+
+ * Version 4.2 released.
+
+ * mpn/powerpc64/aix.m4 (LEA): Renamed from LDSYM.
+ * mpn/powerpc64/darwin.m4: Likewise.
+ * mpn/powerpc64/linux64.m4: Likewise.
+ * mpn/powerpc64/vmx/popcount.asm: Use LEA, not LDSYM.
+
+2006-03-23 Torbjorn Granlund <tege@swox.com>
+
+ * gmp-impl.h: (class gmp_allocated_string): Prefix strlen with std::.
+
+ * gmpxx.h (__GMP_DEFINE_TERNARY_EXPR2): Remove for now.
+ (struct __gmp_ternary_addmul2): Likewise.
+ (struct __gmp_ternary_submul2): Likewise.
+
+ * gmpxx.h: #include <cstring>.
+ (struct __gmp_alloc_cstring): Prefix strlen with std::.
+
+ * mpn/x86/pentium/com_n.asm: Add TEXT and ALIGN.
+ * mpn/x86/pentium/copyi.asm: Likewise.
+ * mpn/x86/pentium/copyd.asm: Likewise.
+
+2006-03-22 Torbjorn Granlund <tege@swox.com>
+
+ * gmp-h.in: Add a "using std::FILE" for C++.
+ (_GMP_H_HAVE_FILE): Check also _ISO_STDIO_ISO_H.
+
+ * gmpxx.h: Remove mpfr code.
+ * tests/cxx: Likewise.
+
+ * gmp-impl.h (FORCE_DOUBLE): Rename a tempvar to avoid a clash with
+ GNU/Linux public include file.
+
+ * configure.in (powerpc64, darwin): New optional, gcc_cflags_subtype.
+ Grab powerpc32/darwin.m4 for ABI=mode32.
+
+ * configure.in: Use host_cpu whenever just the cpu type is needed.
+
+2006-03-08 Torbjorn Granlund <tege@swox.com>
+
+ * mpz/get_si.c: Fix a typo.
+
+ * tests/mpq/t-get_d.c (check_random): Improve random generation for
+ nails.
+
+2006-02-28 Torbjorn Granlund <tege@swox.com>
+
+ * tests/mpq/t-get_d.c (check_random): New function.
+ (main): Call check_random.
+
+ * mpq/set_d.c: Make choices based on LIMBS_PER_DOUBLE, not
+ BITS_PER_MP_LIMB. Make it work for LIMBS_PER_DOUBLE == 4.
+ Use MPZ_REALLOC.
+
+ * mpz/set_d.c: Make it work for LIMBS_PER_DOUBLE == 4.
+
+ * extract-dbl.c: Make it work for LIMBS_PER_DOUBLE > 3.
+
+2006-02-27 Torbjorn Granlund <tege@swox.com>
+
+ * mpz/cmp_d.c: Declare `i'.
+ * mpz/cmpabs_d.c: Likewise.
+
+2006-02-23 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/powerpc32/vmx/copyd.asm: Set right VRSAVE bits.
+ * mpn/powerpc32/vmx/copyi.asm: Likewise.
+
+2006-02-22 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/powerpc32/vmx/logops_n.asm: New file.
+
+ * mpn/powerpc32/diveby3.asm: Rewrite.
+
+2006-02-21 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/powerpc32/vmx/copyi.asm: New file.
+ * mpn/powerpc32/vmx/copyd.asm: New file.
+
+2006-02-17 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/alpha/ev6/nails/aors_n.asm (CYSH): Import proper setting from
+ deleted mpn_sub_n.
+
+2006-02-16 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/alpha/ev6/addmul_1.asm: Correct slotting comments.
+
+2006-02-15 Torbjorn Granlund <tege@swox.com>
+
+ * tests/devel/anymul_1.c: Copy error reporting code from addmul_N.c.
+
+ * tests/devel/addmul_N.c: New file.
+ * tests/devel/mul_N.c: New file.
+
+ * mpn/alpha/default.m4 (PROLOGUE_cpu): Align functions at 16-byte
+ boundary.
+
+ * mpn/alpha/ev6/nails/aors_n.asm: New file.
+ * mpn/alpha/ev6/nails/add_n.asm: Remove.
+ * mpn/alpha/ev6/nails/sub_n.asm: Remove.
+
+ * mpn/alpha/ev6/nails/addmul_1.asm: Rewrite.
+ * mpn/alpha/ev6/nails/submul_1.asm: Likewise.
+ * mpn/alpha/ev6/nails/mul_1.asm: Likewise.
+
+ * mpn/alpha/ev6/nails/addmul_2.asm: Use L() for labels.
+ * mpn/alpha/ev6/nails/addmul_3.asm: Use L() for labels.
+ * mpn/alpha/ev6/nails/addmul_4.asm: Use L() for labels.
+
+2006-02-13 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/powerpc32/diveby3.asm: Trivially reorder loop insns to save
+ 1 c/l.
+
+ * mpn/x86_64/dive_1.asm: Use movabsq to support large model non-PIC.
+
+ * mpn/x86_64/rsh1add_n.asm: Replace high register with rbx.
+ * mpn/x86_64/rsh1sub_n.asm: Likewise.
+
+2006-02-10 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/powerpc64/sqr_diagonal.asm: Software pipeline.
+
+ * mpn/powerpc64/vmx/popcount.asm: Add prefetching.
+
+2006-02-07 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/powerpc64/mode64/diveby3.asm: Rewrite.
+
+2006-02-04 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/powerpc64/vmx/popcount.asm: Remove mpn_hamdist partial code.
+ Move compare for huge n so that it is always executed.
+
+2006-02-03 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/powerpc32/linux.m4 (LEA): Add support for PIC.
+
+ * configure.in (powerpc): New optional, gcc_cflags_subtype.
+
+ * mpn/x86_64/pentium4/add_n.asm: New file.
+ * mpn/x86_64/pentium4/sub_n.asm: New file.
+ * mpn/x86_64/pentium4/lshift.asm: New file.
+
+ * mpn/powerpc64/linux64.m4 (PROLOGUE_cpu): Align function start to
+ 16-multiple.
+ * mpn/powerpc64/aix.m4: Likewise.
+ * mpn/powerpc64/darwin.m4: Likewise.
+
+ * mpn/powerpc64/copyi.asm: Align loop to 16-multiple.
+ * mpn/powerpc64/copyd.asm: Likewise
+
+ * configure.in (powerpc): Add vmx to relevant paths.
+
+ * mpn/powerpc64/linux64.m4 (DEF_OBJECT): Accept 2nd argument, for
+ alignment.
+ * mpn/powerpc64/aix.m4: Likewise.
+ * mpn/powerpc64/darwin.m4: Likewise.
+
+ * mpn/powerpc32/linux.m4 (DEF_OBJECT, END_OBJECT): New macros,
+ inherited from powerpc64 versions.
+ * mpn/powerpc32/aix.m4: Likewise.
+ * mpn/powerpc32/darwin.m4: Likewise.
+
+ * mpn/powerpc64/vmx/popcount.asm: New file, for ppc32 and ppc64.
+ * mpn/powerpc32/vmx/popcount.asm: New file, grabbing above file.
+
+2006-01-22 Torbjorn Granlund <tege@swox.com>
+
+ * configure.in: Generalize OS-dependent patterns for powerpcs.
+
+2006-01-20 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/x86_64/popham.asm: Optimize.
+
+ * config.guess: Recognize power4 and up under linux-gnu.
+ * config.sub: Generalize power recognition code.
+ * acinclude.m4 (POWERPC64_PATTERN): Add 64-bit powerpc processors.
+ * configure.in: Recognize powerpc processors masquerading as power
+ processors.
+
+2006-01-19 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/x86_64/logops_n.asm: Rewrite for more stable speed and smaller
+ code.
+ * mpn/x86_64/com_n.asm: Likewise.
+
+2006-01-18 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/x86_64/addlsh1_n.asm: Rewrite to use indexed addressing.
+ * mpn/x86_64/sublsh1_n.asm: Likewise.
+
+2006-01-17 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/generic/diveby3.c: Use GMP standard parameter names. Nailify
+ alternative code. Use restrict for params.
+
+ * configure.in: Recognize andn_n as not needing nailification.
+
+ * tests/mpq/t-equal.c (check_various): Disable a test that gives common
+ factors for GMP_NUMB_BITS == 62.
+
+2006-01-16 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/generic/get_str.c (mpn_sb_get_str): Fix digit count computation,
+ was inaccurate for nails.
+
+2006-01-15 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/x86_64/mode1o.asm: Remove unneeded carry register zeroing.
+
+2006-01-08 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/alpha/ev6/sqr_diagonal.asm: New file.
+
+2006-01-06 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/powerpc64/mode64/mod_34lsub1.asm: Tune to 1.5 c/l.
+
+ * mpn/generic/mullow_n.c (MUL_BASECASE_ALLOC): New #define.
+ (mpn_mullow_n): Use it.
+
+ * mpn/powerpc64/mode64/dive_1.asm: Use EXTERN.
+ * mpn/powerpc64/mode64/mode1o.asm: Likewise.
+
+ * mpn/powerpc64/aix.m4 (EXTERN): Define to import symbol.
+ (LDSYM): Remove [RW] attribute.
+ * mpn/powerpc64/linux64.m4 (EXTERN): Dummy definition.
+ * mpn/powerpc64/darwin.m4 (EXTERN): Likewise.
+
+2006-01-05 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/powerpc64/mode64/mode1o.asm: New file.
+
+ * mpn/powerpc64/mode64/dive_1.asm: Use L() for labels. Invoke ASM_END.
+
+ * mpn/powerpc64/mode64/invert_limb.asm: Invoke ASM_END.
+
+ * mpn/powerpc64/linux64.m4: Move toc entry generation from direct at
+ DEF_OBJECT to delayed via LDSYM, define ASM_END to output it.
+ * mpn/powerpc64/aix.m4: Likewise.
+ * mpn/powerpc64/darwin.m4: Define a dummy ASM_END.
+
+ * mpn/powerpc64/mode64/addmul_1.asm: Add POWER5 timings.
+ * mpn/powerpc64/mode64/mul_1.asm: Likewise.
+
+ * mpn/powerpc64/mode64/submul_1.asm: Tweak to save 1.5 c/l for POWER5.
+
+2006-01-04 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/powerpc64/mode64/dive_1.asm: New file.
+
+ * mpn/powerpc64/mode64/invert_limb.asm: Add missing ASM_START.
+
+ * mpn/powerpc64/mode64/addmul_1.asm: Fix a comment typo.
+
+ * mpn/x86_64/diveby3.asm: Rewrite.
+
+2006-01-03 Torbjorn Granlund <tege@swox.com>
+
+ * configure.in: Update bugs reporting address.
+
+ * mpn/powerpc64/mode64/diveby3.asm: Trim a cycle off of POWER4 timing.
+ Misc cleanup.
+
+2006-01-02 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/powerpc64/linux64.m4 (CALL): New macro.
+ * mpn/powerpc64/aix.m4: Likewise.
+ * mpn/powerpc64/darwin.m4: Likewise, also define macro "DARWIN".
+
+2005-12-28 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/powerpc64/mode64/mod_34lsub1.asm: New file.
+
+2005-12-26 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/x86_64/mod_34lsub1.asm: New file.
+
+2005-12-20 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/x86_64/submul_1.asm: Save a push/pop by not using register r12.
+ Use addq instead of leaq for pointer updates; schedule them. (These
+ changes shaves one cycle of overhead and 0.25 c/l.)
+
+2005-12-18 Torbjorn Granlund <tege@swox.com>
+
+ * mpf/ui_div.c: Implement workaround for GCC bug triggered on alpha.
+ * mpf/set_q.c: Likewise.
+
+2005-12-16 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/generic/tdiv_qr.c: Remove statement with no effect.
+ Rename dead variable to `dummy'.
+
+2005-12-15 Torbjorn Granlund <tege@swox.com>
+
+ * demos/pexpr.c (setup_error_handler): Add a missing ";".
+
+2005-11-27 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/generic/mul.c: Crudely call mpn_mul_fft_full before checking
+ for unbalanced operands.
+
+ * mpn/generic/mul_fft.c: Remove many scalar divisions.
+ (mpn_mul_fft_lcm): Simplify.
+ (mpn_mul_fft_decompose): Rewrite to handle arbitrarily unbalanced
+ operands.
+
+2005-11-22 Torbjorn Granlund <tege@swox.com>
+
+ * configure.in: Properly recognize all 32-bit Solaris releases.
+
+2005-11-10 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/generic/mul_fft.c: Inline mpn_fft_mul_2exp_modF,
+ mpn_fft_add_modF and mpn_fft_normalize.
+
+2005-11-02 Torbjorn Granlund <tege@swox.com>
+
+ * tests/mpz/reuse.c: Increase operand size, decrease # of reps.
+
+ * mpz/rootrem.c: Adapt to new mpn_rootrem.
+ * mpz/root.c: Likewise.
+
+ * tests/mpz/reuse.c: Test mpz_rootrem.
+
+ With Paul Zimmermann:
+ * mpn/generic/rootrem.c: Complete rewrite.
+
+2005-10-31 Torbjorn Granlund <tege@swox.com>
+
+ * mpz/pprime_p.c (mpz_probab_prime_p): Considerably limit trial
+ dividing.
+
+ * mpz/perfpow.c (mpz_perfect_power_p): Use mpz_divisible_ui_p instead
+ of mpz_tdiv_ui.
+
+ * mpz/divegcd.c: Correct probability number for GCD == 1.
+
+ * mpn/x86_64/mul_basecase.asm: Remove an obsolete comment.
+
+ * mpn/x86: Add cycle counts for array of x86 processors.
+
+ * mpn/x86/k7/mod_34lsub1.asm: Remove spurious mentions of ebp.
+
+ * mpn/powerpc32: Add POWER5 timings.
+
+ * mpn/powerpc32/README: Describe global reference variations.
+
+ * mpn/ia64/divrem_2.asm: Add some comments.
+
+ * mpn/ia64/divrem_1.asm: Reformat.
+
+ * mpn/ia64/addmul_2.asm: Correct a comment on slotting.
+ * mpn/ia64/logops_n.asm: Likewise.
+
+ * mpn/ia64/addmul_1.asm: Remove a redundant preg mutex decl.
+
+ * mpn/generic/dive_1.c: Whitespace cleanup.
+
+ * mpn/alpha/ev6/nails/addmul_1.asm: Correct comments on slotting.
+ * mpn/alpha/ev6/nails/addmul_2.asm: Likewise.
+ * mpn/alpha/ev6/nails/addmul_4.asm: Likewise.
+
+ * mpf/out_str.c: List some allocation improvement ideas.
+
+ * doc/gmp.texi: Update many URLs and email addresses.
+
+ * gmp-h.in (_GMP_H_HAVE_FILE): Check also _STDIO_H_INCLUDED.
+
+2005-10-26 Torbjorn Granlund <tege@swox.com>
+
+ * tune/tuneup.c (tune_mullow): Update param.max_size for each threshold
+ measurement.
+
+ * configure.in (POWERPC64_PATTERN/*-*-darwin*): Set
+ SPEED_CYCLECOUNTER_OBJ_mode64 and cyclecounter_size_mode64.
+ (POWERPC64_PATTERN/*-*-linux*): Likewise.
+
+2005-10-03 Torbjorn Granlund <tege@swox.com>
+
+ * demos/factorize.c (factor_using_division_2kp): Honor verbose flag.
+ (factor_using_pollard_rho): Divide out new factor before it's
+ clobbered. Don't stop factoring after a composite factor was found.
+
+2005-09-17 Torbjorn Granlund <tege@swox.com>
+
+ * demos/pexpr.c (fns): Add factorial keywords.
+
+2005-08-16 Torbjorn Granlund <tege@swox.com>
+
+ * tune/Makefile.am (EXTRA_DIST): Change "amd64" => "x86_64".
+ * mpn/Makefile.am (TARG_DIST): Change "amd64" => "x86_64".
+
+2005-08-15 Torbjorn Granlund <tege@swox.com>
+
+ * configure.in: Change "amd64" => "x86_64".
+
+2005-06-13 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/generic/pre_mod_1.c: Canonicalize variable names.
+
+ * mpn/generic/divrem.c: Rate qxn test as UNLIKELY.
+
+ * mpn/generic/gcdext.c (sanity_check_row): Invoke TMP_MARK.
+
+ * tune/tuneup.c (tune_mullow): Fix all max_size fields.
+
+ * gmp-impl.h (SQR_TOOM3_THRESHOLD_LIMIT): New #define.
+ * tune/tuneup.c (tune_sqr): Use SQR_TOOM3_THRESHOLD_LIMIT.
+ (sqr_toom3_threshold): Initialize from SQR_TOOM3_THRESHOLD_LIMIT.
+
+ * mpn/generic/mul_n.c (mpn_sqr_n): Use SQR_TOOM3_THRESHOLD_LIMIT.
+
+ * gmp-impl.h (mpn_nand_n, mpn_iorn_n, mpn_nior_n, mpn_xnor_n):
+ Handle nails.
+
+2005-06-13 Niels Möller <nisse@lysator.liu.se>
+
+ * mpn/generic/gcdext.c (gcdext_schoenhage): Check for the
+ (unlikely) case that one of the hgcd/euclid steps results in two
+ remainders of one limb each. Then use gcdext_1.
+
+2005-06-12 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/alpha/ev6/sub_n.asm: Analogous changes as to add_n.asm last.
+
+2005-06-11 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/alpha/ev6/add_n.asm: Rewrite inner loop to load later.
+ Add mpn_add_nc entry.
+
+ * mpn/alpha/ev6/addmul_1.asm: Remove redundant initial loads.
+
+2005-06-09 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/ia64/dive_1.asm: Fix issues with HP-UX.
+
+2005-06-08 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/ia64/diveby3.asm: Update TODO list.
+
+ * mpn/ia64/mode1o.asm: Fix comment typos.
+
+ * mpn/ia64/dive_1.asm: New file.
+
+2005-06-07 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/ia64/mode1o.asm: Add prefetching.
+
+ * mpn/generic/dive_1.c: Use variable h for upper umul_ppmm result.
+
+2005-06-06 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/ia64/hamdist.asm: Complete rewrite.
+ * mpn/ia64/popcount.asm: Rewrite to use multi-pronged feed-in.
+
+ * mpn/ia64/aors_n.asm: Rewrite feed-in code.
+ * mpn/ia64/rsh1aors_n.asm: Likewise.
+ * mpn/ia64/aorslsh1_n.asm: Likewise.
+ * mpn/ia64/lorrshift.asm: Likewise.
+
+2005-06-04 Torbjorn Granlund <tege@swox.com>
+
+ * tests/devel/try.c (choice_array): Exclude mpn_preinv_mod_1 unless
+ USE_PREINV_MOD_1.
+ (choice_array): Exclude mpn_sqr_basecase if SQR_KARATSUBA_THRESHOLD
+ is zero.
+
+2005-06-03 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/alpha/ev6/addmul_1.asm: Prefix all labels with "$".
+ * mpn/alpha/ev6/mul_1.asm: Likewise.
+
+2005-06-02 Torbjorn Granlund <tege@swox.com>
+
+ * tests/refmpn.c (refmpn_divmod_1c_workaround): Implement workaround
+ to gcc 3.4.x bug triggered on powerpc64 with 32-bit ABI.
+
+2005-06-01 Torbjorn Granlund <tege@swox.com>
+
+ * tests/devel/try.c (main): Fix a typo.
+
+2005-05-31 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/alpha/ev6/addmul_1.asm: Rewrite for L1 cache, add prefetch.
+
+2005-05-30 Torbjorn Granlund <tege@swox.com>
+
+ * tests/misc.c (tests_rand_start): Mask random seed to 32 bits.
+
+2005-05-29 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/powerpc64/mode32/mul_1.asm: Handle BROKEN_LONGLONG_PARAM.
+ * mpn/powerpc64/mode32/addmul_1.asm: Likewise.
+ * mpn/powerpc64/mode32/submul_1.asm: Likewise.
+
+ * mpn/powerpc32/mode1o.asm: Rewrite to actually work.
+
+ * mpn/powerpc32/aix.m4 (LEA): New macro.
+ (ASM_END): New macro.
+
+ * mpn/powerpc32/linux.m4: New file.
+ * mpn/powerpc32/darwin.m4: New file.
+ * configure.in: Use linux.m4 and darwin.m4.
+ (powerpc64-linux-gnu): Add support for mode32.
+
+2005-05-25 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/generic/mullow_n.c: Remove FIXME mentioning fixed flaw.
+
+ * tests/mpz/t-cmp_d.c (check_one): Fix printf fmt string typo.
+
+ * demos/isprime.c: #include stdlib.h.
+ * tests/rand/t-urbui.c: Likewise.
+ * tests/rand/t-urmui.c: Likewise.
+
+ * tests/mpz/t-popcount.c (check_random): Remove spurious printf arg.
+
+ * mpn/ia64/lorrshift.asm: Cleanup code layout.
+ * mpn/ia64/popcount.asm: Likewise.
+
+2005-05-24 Torbjorn Granlund <tege@swox.com>
+
+ * tests/devel/try.c (param_init) [TYPE_GET_STR]: Set retval field.
+ (compare): Handle SIZE_GET_STR as SIZE_RETVAL.
+
+ * tests/refmpn.c (refmpn_get_str): Rewrite to make it work.
+
+2005-05-23 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/amd64/add_n.asm: Add mpn_add_nc entry point.
+ * mpn/amd64/sub_n.asm: Add mpn_sub_nc entry point.
+
+ * longlong.h (many places): Remove lvalue casts.
+
+ * gmp-impl.h (MPF_SIGNIFICANT_DIGITS): Cast prec to avoid overflow
+ for > 4G digits.
+
+ * mpn/alpha/ev6/add_n.asm: Prefetch using ldl.
+ * mpn/alpha/ev6/sub_n.asm: Likewise.
+
+ * mpn/alpha/ev6/slot.pl (optable): Recognize negq and ldl.
+
+ * mpn/ia64/aors_n.asm: Prefetch using lfetch.
+ * mpn/ia64/lorrshift.asm: Likewise.
+ * mpn/ia64/popcount.asm: Likewise.
+ * mpn/ia64/diveby3.asm: Likewise.
+
+2005-05-22 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/alpha/ev67/popcount.asm: Prefetch.
+ * mpn/alpha/ev67/hamdist.asm: Prefetch.
+
+ * longlong.h (add_ssaaaa) [x86]: Remove lvalue casts.
+ (sub_ddmmss) [x86]: Likewise.
+
+ * tests/devel/try.c (param_init) [TYPE_MPZ_JACOBI]: Add DATA_SRC1_ODD.
+ (param_init) [TYPE_MPZ_KRONECKER]: Clear inherited DATA_SRC1_ODD.
+ (param_init) [TYPE_DIVEXACT_1]: Use symbolic name DIVISOR_LIMB.
+
+2005-05-21 Torbjorn Granlund <tege@swox.com>
+
+ * tests/devel/try.c (param_init) [TYPE_MPZ_JACOBI]: Initialize divisor
+ field according to UDIV_NEEDS_NORMALIZATION.
+
+ * mpz/mul_i.h: Remove left-over TMP_XXXX marker arguments.
+
+2005-05-20 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/x86/pentium4/sse2/addmul_1.asm (mpn_addmul_1c): Put carry in
+ proper register.
+
+ * mpn/generic/sqr_basecase.c (mpn_sqr_basecase, addmul_2 version):
+ Avoid accesses out-of-bound in MPN_SQR_DIAGONAL applicate code.
+
+2005-05-19 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/alpha/diveby3.asm: Make it actually work.
+
+ * gmp-impl.h (MULLOW_BASECASE_THRESHOLD_LIMIT): New #define.
+ * mpn/generic/mullow_n.c: Use fixed stack allocation for the smallest
+ operands; use TMP_S* allocation for medium operands.
+
+ * gmp-impl.h: Remove nested TUNE_PROGRAM_BUILD test.
+
+2005-05-18 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/generic/mul_n.c: Make squaring and multiplication code more
+ similar. Use TMP_S* functions.
+
+ * gmp-impl.h (TMP_DECL, TMP_MARK, TMP_FREE): Get rid of argument.
+ (TMP_SALLOC): New macro for "small" allocations.
+ (TMP_BALLOC): New macro for "big" allocations.
+ (TMP_SDECL, TMP_SMARK, TMP_SFREE): New macros for functions that use
+ just TMP_SALLOC.
+ (WANT_TMP_ALLOCA): Make default functions choose alloca or reentrant
+ functions, depending on size.
+
+ * *.c: Remove TMP_XXXX marker arguments.
+
+ * acinclude.m4 (WANT_TMP): Want tal-reent.lo also for alloca case.
+
+2005-05-16 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/ia64/gmp-mparam.h: Further extend FFT tables.
+
+2005-05-15 Torbjorn Granlund <tege@swox.com>
+
+ * gmp-impl.h (udiv_qrnnd_preinv2): Pull an add into add_ssaaaa.
+ (udiv_qrnnd_preinv2gen): Likewise.
+
+2005-05-14 Torbjorn Granlund <tege@swox.com>
+
+ * longlong.h (add_ssaaaa) [x86_64]: Restrict allowed immediate
+ operands.
+ * (sub_ddmmss) [x86_64]: Likewise.
+
+2005-05-02 Torbjorn Granlund <tege@swox.com>
+
+ * acinclude.m4 (GMP_HPC_HPPA_2_0): Make gmp_tmp_v1 sed pattern handle
+ version numbers like B.11.X.32509-32512.GP.
+
+ * mpn/m68k/aors_n.asm: Correct MULFUNC_PROLOGUE.
+
+ * mpn/powerpc64/mode64/aors_n.asm: Add a MULFUNC_PROLOGUE.
+
+ * mpf/inp_str.c: Use plain int for mpf_set_str return value (works
+ around gcc 4 bug).
+
+ * acinclude.m4 (GMP_ASM_POWERPC_PIC_ALWAYS): Handle darwin's assembly
+ syntax.
+ (long long reliability test 1): New GMP_PROG_CC_WORKS_PART test.
+ (long long reliability test 2): New GMP_PROG_CC_WORKS_PART test.
+
+ * configure.in: Add mode64 support for darwin. Use darwin.m4.
+ Add cflags_opt flags for mode32 darwin.
+
+ * mpn/powerpc64: Use L() for all asm files.
+
+ * mpn/asm-defs.m4 (PIC_ALWAYS): Define PIC just iff PIC_ALWAYS = "yes".
+
+ * mpn/powerpc64/darwin.m4: New file.
+
+ * mpn/powerpc64/linux64.m4: Remove TOCREF, add LDSYM.
+ Rework DEF_OBJECT to need just one argument.
+ * mpn/powerpc64/aix.m4: Likewise.
+
+ * mpn/powerpc64/mode64/invert_limb.asm: Load approx_tab address with
+ LDSYM. Optimize somewhat. Remove 2nd DEF_OBJECT operand.
+
+2005-05-01 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/generic/popham.c: Compute final summation differently for 64-bit.
+
+ * tests/mpz/t-popcount.c (check_random): New function.
+ (main): Call it.
+
+2005-04-28 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/amd64/add_n.asm: Use r9 instead of rbx to save push/pop.
+ * mpn/amd64/sub_n.asm: Likewise.
+
+2005-04-09 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/powerpc64/copyi.asm: If HAVE_ABI_mode32, ignore upper 32 bits of
+ mp_size_t argument.
+ * mpn/powerpc64/copyd.asm: Likewise.
+ * mpn/powerpc64/sqr_diagonal.asm: Likewise.
+ * mpn/powerpc64/lshift.asm: Likewise.
+ * mpn/powerpc64/rshift.asm: Likewise.
+ * mpn/powerpc64/logops_n.asm: Likewise.
+ * mpn/powerpc64/com_n.asm: Likewise.
+
+2005-04-08 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/generic/rootrem.c: Allocate PP_ALLOC limbs also for qp.
+
+2005-04-07 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/powerpc32/add_n.asm: Add nc entry point.
+ * mpn/powerpc32/sub_n.asm: Likewise.
+
+ * mpn/amd64/*.asm: Add Prescott/Nocona cycle/limb numbers.
+
+ * mpn/alpha/add_n.asm: Add correct cycle/limb numbers.
+ * mpn/alpha/sub_n.asm: Likewise.
+ * mpn/alpha/ev5/add_n.asm: Likewise.
+ * mpn/alpha/ev5/sub_n.asm: Likewise.
+
+2005-03-31 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/x86/k7/gmp-mparam.h: Fix typo in last change.
+
+2005-03-19 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/amd64/gmp-mparam.h: Update.
+
+ * mpn/alpha/gmp-mparam.h: Update.
+ * mpn/alpha/ev5/gmp-mparam.h: Update.
+ * mpn/alpha/ev6/gmp-mparam.h: Update.
+
+ * mpn/ia64/gmp-mparam.h: Update.
+
+ * mpn/x86/p6/mmx/gmp-mparam.h: Update.
+ * mpn/x86/pentium4/sse2/gmp-mparam.h: Update.
+ * mpn/x86/k7/gmp-mparam.h: Update.
+
+ * tests/mpz/t-gcd.c (main): Honor command line reps argument.
+
+ * tune/speed.h (SPEED_ROUTINE_MPN_GCD_CALL): Simplify and correct code
+ for generating test operands.
+
+2005-03-17 Niels Möller <nisse@lysator.liu.se>
+
+ * mpn/generic/hgcd.c (qstack_adjust): New argument d, saying how much
+ to adjust the top quotient.
+ (hgcd_adjust): The quotient can be off by either 1 or 2.
+
+2005-03-16 Torbjorn Granlund <tege@swox.com>
+
+ * tests/mpz/t-gcd.c (MAX_SCHOENHAGE_THRESHOLD): Set to largest of
+ gcd,gcdext thresholds.
+
+2005-03-15 Niels Möller <nisse@lysator.liu.se>
+
+ * mpn/generic/gcdext.c (gcdext_schoenhage): When calling gcdext_lehmer,
+ reuse all temporary limb storage, including the storage used for the
+ qstack.
+
+2005-03-09 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/amd64/logops_n.asm: Add MULFUNC_PROLOGUE.
+
+2005-03-05 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/amd64/gmp-mparam.h: Extend MUL_FFT_TABLE and SQR_FFT_TABLE.
+ * mpn/ia64/gmp-mparam.h: Likewise.
+
+2005-02-17 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/ia64/divrem_1.asm: Add preinv entry point.
+
+2005-01-13 Torbjorn Granlund <tege@swox.com>
+
+ * gmp-impl.h (MPN_SIZEINBASE): Count bits in type size_t.
+ (MPN_SIZEINBASE_16): Likewise.
+
+2004-12-17 Torbjorn Granlund <tege@swox.com>
+
+ * tune/speed.c (run_gnuplot): Use lines, not linespoints.
+ Output a reset gnuplot command initially.
+
+2004-12-04 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/generic/random2.c (gmp_rrandomb): Rework again.
+ * mpz/rrandomb.c (gmp_rrandomb): Likewise.
+
+ * mpn/amd64/redc_1.asm: Call via PLT when PIC.
+
+2004-11-29 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/amd64/divrem_1.asm: Add preinv entry point.
+ * mpn/amd64/gmp-mparam.h: Set USE_PREINV_DIVREM_1 to 1.
+
+2004-11-24 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/alpha/diveby3.asm: Use correct prefetch instruction.
+
+2004-11-19 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/alpha/diveby3.asm: Add ",gp" glue in PROLOGUE.
+ Add r31 dummy operand to `br' instruction.
+
+2004-11-17 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/powerpc64/mode64/addmul_1.asm: Rewrite.
+ * mpn/powerpc64/mode64/mul_1.asm: Rewrite.
+
+ * configure.in: Invoke AC_C_RESTRICT.
+
+2004-11-16 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/alpha/diveby3.asm: New file.
+
+2004-11-13 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/amd64/popham.asm: New file.
+
+2004-11-12 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/amd64/add_n.asm: Correct cycle count.
+ * mpn/amd64/sub_n.asm: Likewise.
+
+ * mpn/amd64/dive_1.asm: Speed divisors with many factors of 2.
+
+2004-11-11 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/amd64/dive_1.asm: New file.
+
+2004-11-10 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/generic/popham.c: Add comment.
+
+2004-11-09 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/amd64/com_n.asm: New file.
+
+ * mpn/amd64/logops_n.asm: New file.
+
+2004-11-08 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/powerpc64/com_n.asm: New file.
+
+2004-11-05 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/amd64/diveby3.asm: New file.
+
+ * config.guess: Strip any PPC string in /proc/cpuinfo.
+ Recognize 970 in that code.
+
+2004-11-01 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/amd64/mul_basecase.asm: New file.
+
+ * mpn/amd64/redc_1.asm: New file.
+
+2004-10-25 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/powerpc64/mode64/addlsh1_n.asm: Correct cycle counts.
+
+ * mpn/powerpc64/README: Update POWER5/PPC970 pipeline information.
+
+ * mpn/generic/mul_basecase.c (MAX_LEFT): Add comment.
+
+ * doc/gmp.texi: Consistently use "x86" denotation.
+ (Assembler SIMD Instructions): Mention SSE2 usage.
+
+ * demos/pexpr.c (main): Handle "negative" base in mpz_sizeinbase call.
+
+2004-10-18 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/powerpc64/mode64/submul_1.asm: Shave 2 cycles/limb with new carry
+ inversion trick.
+
+2004-10-16 Torbjorn Granlund <tege@swox.com>
+
+ * configure.in: Support icc under x86.
+ (ia64-*-linux*): Pass -no-gcc to icc.
+
+2004-10-15 Torbjorn Granlund <tege@swox.com>
+
+ * longlong.h (ia64 umul_ppmm): Add version for icc.
+
+ * configure.in: Support icc under ia64-*-linux*.
+
+ * acinclude.m4: New "compiler works" test for icc 8.1 bug.
+ (GMP_PROG_CC_IS_GNU): Don't let Intel's icc fool us it is GCC.
+
+2004-10-14 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/generic/gcdext.c: Add a few missing TMP_MARK.
+
+2004-10-14 Torbjorn Granlund <tege@swox.com>
+
+ * acinclude.m4 (GMP_ASM_W32): Try also "data4".
+
+ * mpn/ia64/logops_n.asm: Don't use naked "br", rejected by Intel
+ assembler.
+ * mpn/ia64/aors_n.asm: Likewise.
+
+ * mpn/ia64/divrem_2.asm: Add ".prologue".
+
+ * mpn/ia64/hamdist.asm: Put alloc first in bundle, enforced by the
+ Intel assembler.
+
+ * longlong.h: Exclude masquerading __INTEL_COMPILER from ia64 asm.
+ * gmp-impl.h: Likewise.
+
+2004-10-12 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/ia64/mul_2.asm: Rewrite function entry code, write new code for
+ n=2.
+ * mpn/ia64/addmul_2.asm: Likewise.
+
+ * tests/devel/try.c: Handle mpn_mul_2 like mpn_addmul_2.
+
+ * tune/speed.c (routine): Make R parameter optional for mpn_mul_2.
+
+2004-10-11 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/sparc64/addmul_1.asm: Update a comment.
+
+ * tests/devel/aors_n.c: #include tests.h.
+ * tests/devel/anymul_1.c: Likewise.
+ * tests/devel/shift.c: Likewise.
+ * tests/devel/copy.c: Likewise.
+
+ * tests/devel/aors_n.c: Handle also mpn_addlsh1_n, mpn_sublsh1_n,
+ mpn_rsh1add_n, and mpn_rsh1sub_n.
+
+ * mpn/ia64/submul_1.asm: Add TODO item.
+
+ * mpn/ia64/aors_n.asm: Rewrite function entry code (again).
+ * mpn/ia64/aorslsh1_n.asm: Likewise.
+ * mpn/ia64/logops_n.asm: Likewise.
+
+ * mpn/ia64/rsh1aors_n.asm: Tune function entry and feed-in code.
+ * mpn/ia64/lorrshift.asm: Likewise. Remove several spurious loads.
+
+ * tests/devel/Makefile.am (EXTRA_PROGRAMS): Updates for yesterday's
+ file removals and additions.
+
+2004-10-10 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/ia64/copyi.asm: Tune function entry code.
+ * mpn/ia64/copyd.asm: Likewise.
+
+ * mpn/ia64/logops_n.asm: Tune function entry and feed-in code for speed
+ and size.
+ * mpn/ia64/aors_n.asm: Likewise.
+
+ * mpn/powerpc64/logops_n.asm: Correct cycles counts.
+ * mpn/powerpc64/mode64/aors_n.asm: Likewise.
+
+ * tests/devel/copy.c: Handle both MPN_COPY_INCR and MPN_COPY_DECR.
+
+ * tests/devel/logops_n.c: New file, handle all logical operations.
+
+ * tests/devel/anymul_1.c: New file, handle mpn_mul_1, mpn_addmul_1, and
+ mpn_submul_1
+ * tests/devel/mul_1.c: Remove.
+ * tests/devel/addmul_1.c: Remove.
+ * tests/devel/submul_1.c: Remove.
+
+ * tests/devel/shift.c: New file, handle mpn_lshift and mpn_rshift.
+ * tests/devel/lshift.c: Remove.
+ * tests/devel/rshift.c: Remove.
+
+ * tests/devel/aors_n.c: New file, handle mpn_add_n and mpn_sub_n.
+ * tests/devel/add_n.c: Remove.
+ * tests/devel/sub_n.c: Remove.
+
+2004-10-09 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/powerpc64/linux64.m4: Define DEF_OBJECT, END_OBJECT, and TOCREF.
+ * mpn/powerpc64/aix.m4: Likewise.
+ * mpn/powerpc64/mode64/invert_limb.asm: Use DEF_OBJECT, END_OBJECT, and
+ TOCREF for approx_tab.
+
+ * mpn/amd64/mul_1.asm: Add mpn_mul_1c entry point.
+
+2004-10-08 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/powerpc64/copyi.asm: New file.
+ * mpn/powerpc64/copyd.asm: New file.
+ * gmp-h.in: Remove PPC MPN_COPY variants.
+ * gmp-impl.h: Likewise.
+
+ * mpn/powerpc64/logops_n.asm: New file.
+
+ * mpn/powerpc64/mode64/invert_limb.asm: New file.
+
+2004-10-07 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/powerpc64/mode64/aors_n.asm: New file, optimized for POWER4 and
+ its derivatives.
+ * mpn/powerpc64/mode64/add_n.asm: Delete.
+ * mpn/powerpc64/mode64/sub_n.asm: Delete.
+
+ * configfsf.guess: Patch HP-UX code to accommodate HP compiler's new
+ inability to read from stdin.
+
+ * mpn/powerpc64/mode64/addsub_n.asm: Remove accidentally added file.
+
+2004-10-02 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/amd64/README: Update for new developments, fix typos.
+
+ * mpn/amd64/mul_1.asm: Tweak addressing (3.25 => 3.0 cycles/limb).
+
+ * mpn/amd64/addmul_1.asm: Remove unreachable code block.
+
+2004-09-30 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/amd64/addmul_1.asm: Rewrite, now 3.25 cycles/limb.
+
+ * mpn/ia64/addmul_1.asm: Slightly enhance cross-jumping for code
+ density.
+ * mpn/ia64/mul_1.asm: Analogous changes.
+
+2004-09-29 Torbjorn Granlund <tege@swox.com>
+
+ * gmp-impl.h (x86 ULONG_PARITY): Work around GCC change of "q" register
+ flag.
+
+2004-09-28 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/ia64/divrem_1.asm: Add cycle counts to loop.
+
+ * mpn/ia64/divrem_2.asm: New file.
+
+2004-09-28 Paul Zimmermann <Paul.Zimmermann@loria.fr>
+
+ * mpn/generic/mul_fft.c (mpn_mul_fft): Fix a bug in the choice of the
+ recursive fft parameters.
+
+2004-09-20 Torbjorn Granlund <tege@swox.com>
+
+ * tests/misc.c (tests_rand_start): Default to strtoul for re-seeding.
+
+ * tests/mpz/t-mul.c (ref_mpn_mul): Fudge tmp allocation for toom3.
+
+2004-09-19 Torbjorn Granlund <tege@swox.com>
+
+ * tests/misc.c (tests_rand_start): Shift tv_usec for better seeding.
+
+2004-09-18 Torbjorn Granlund <tege@swox.com>
+
+ * tests/misc.c (tests_rand_start): Invoke fflush after printing seed.
+
+ * tests/mpz/t-mul.c (main): Check environment for GMP_CHECK_FFT, run
+ extra FFT tests if set.
+ (ref_mpn_mul): Use library code for kara and toom, but skewded so that
+ we never use the same algorithm that we're testing.
+ (mul_kara): Delete.
+ (debug_mp): Print just one line of large numbers.
+ (ref_mpn_mul): Rework usage of tp temporary space.
+
+2004-09-15 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/ia64/mul_2.asm: For HAVE_ABI_32, convert vp.
+ * mpn/ia64/addmul_2.asm: Likewise.
+
+2004-09-13 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/ia64/invert_limb.asm: Rewrite.
+
+ * mpn/ia64/logops_n.asm: Insert some more stops.
+
+2004-09-12 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/ia64/gmp-mparam.h: Update.
+ * mpn/amd64/gmp-mparam.h: Update.
+
+ * mpn/ia64/sqr_diagonal.asm: Shave off a few cycles.
+
+2004-09-11 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/ia64/mul_2.asm: New file.
+ * mpn/ia64/addmul_2.asm: New file.
+
+ * mpn/ia64/addmul_1.asm: Tune a cycle from prologue.
+
+ * mpn/ia64/lorrshift.asm: Insert stops after several branches.
+ * mpn/ia64/aorslsh1_n.asm: Likewise.
+ * mpn/ia64/rsh1aors_n.asm: Likewise.
+
+ * mpn/generic/sqr_basecase.c: In variant for HAVE_NATIVE_mpn_addmul_2,
+ accumulate carry also for when HAVE_NATIVE_mpn_addlsh1_n.
+
+2004-09-07 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/ia64/submul_1.asm: Rewrite.
+
+ * mpn/ia64/addmul_1.asm: Format to placate HP-UX assembler.
+ * mpn/ia64/mul_1.asm: Likewise.
+
+2004-09-02 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/ia64/mul_1.asm: Optimize feed-in code.
+ * mpn/ia64/addmul_1.asm: Rewrite feed-in code.
+
+2004-08-29 Torbjorn Granlund <tege@swox.com>
+
+ * tests/mpz/t-sizeinbase.c: Disable mpz_fake_bits and check_sample.
+
+2004-07-16 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/ia64/addmul_1.asm: Format to placate HP-UX assembler.
+
+2004-06-17 Kevin Ryde <kevin@swox.se>
+
+ * doc/gmp.texi: Use @. when sentence ends with a capital, for good
+ spacing in tex.
+ (Language Bindings): Add gmp-d, reported by Ben Hinkle. Update SWI
+ Prolog URL, reported by Jan Wielemaker.
+
+2004-06-09 Torbjorn Granlund <tege@swox.com>
+
+ * configure.in: Handle --enable-fat. Use that to enable x86 fat
+ builds, remove magic meaning of i386-*-*.
+
+2004-06-03 Kevin Ryde <kevin@swox.se>
+
+ * gmp-impl.h (memset): Use a local char* pointer, in case parameter is
+ something else (eg. tune/common.c). Reported by Emmanuel Thomé.
+
+2004-06-01 Kevin Ryde <kevin@swox.se>
+
+ * config.guess (i?86-*-*): Avoid "Illegal instruction" message which
+ goes to stdout on 80386 freebsd4.9.
+
+2004-05-23 Niels Möller <nisse@lysator.liu.se>
+
+ * mpn/generic/gcdext.c (gcdext_1_u): New function.
+ (mpn_gcdext): Use it.
+
+2004-05-23 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/generic/gcdext.c (gcdext_1_odd): Use masking to avoid jumps.
+
+2004-05-22 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/x86/pentium4/sse2/addmul_1.asm: Add Prescott cycle numbers.
+
+ * mpn/amd64/divrem_1.asm: Shave a cycle from fraction development code.
+
+ * mpn/powerpc32/lshift.asm: Add more cycle numbers.
+ * mpn/powerpc32/rshift.asm: Likewise.
+
+ * mpn/ia64/addmul_1.asm: Reformat.
+
+2004-05-21 Torbjorn Granlund <tege@swox.com>
+
+ * gmp-impl.h (mpn_mullow_n, mpn_mullow_basecase): Declare.
+
+ * tune/Makefile.am: Compile gcdext.c.
+
+ * gmp-impl.h (GET_STR_THRESHOLD_LIMIT): Lower outrageous value to 150.
+ (GCDEXT_SCHOENHAGE_THRESHOLD): Set reasonable default. Override when
+ TUNE_PROGRAM_BUILD.
+ (GCDEXT_THRESHOLD): Remove.
+
+ * tune/tuneup.c (gcdext_schoenhage_threshold): New variable.
+ (gcdext_threshold): Remove variable.
+ (tune_gcd_schoenhage): Lower step_factor to 0.1.
+ (tune_gcdext_schoenhage): New function, based on tune_gcd_schoenhage.
+ (tune_gcdext): Remove function.
+ (all): Corresponding changes.
+
+2004-05-21 Niels Möller <nisse@lysator.liu.se>
+
+ * mpn/generic/gcdext.c: Complete rewrite. Uses fast Lehmer code for
+ small operands, and Schoenhage code for large operands.
+
+ * tune/speed.h (SPEED_ROUTINE_MPN_GCD_CALL): Ensure first operand is
+ not smaller than 2nd operand.
+
+2004-05-17 Kevin Ryde <kevin@swox.se>
+
+ * gmp-h.in (mpz_get_ui): Use #if instead of plain if, and for nails
+ use ?: same as normal case, to avoid warnings from Borland C++ 6.0.
+ Reported by delta trinity.
+
+2004-05-15 Kevin Ryde <kevin@swox.se>
+
+ * tune/time.c (getrusage_backwards_p): New function
+ (speed_time_init): Use it to exclude broken netbsd1.4.1 getrusage.
+ * configure.in (m68*-*-netbsd1.4*): Remove code pretending getrusage
+ doesn't exist.
+ * tune/README (NetBSD 1.4.1 m68k): Update notes.
+
+ * configure.in (mips*-*-* ABI=n32): Remove gcc_n32_ldflags and
+ cc_n32_ldflags, libtool knows to put the linker in n32 mode.
+
+2004-05-15 Torbjorn Granlund <tege@swox.com>
+
+ * config.guess (powerpc*-*-*): Add more processor types to mfpvr code.
+ * configure.in: Generalize powerpc subtype matching code.
+
+ * mpz/fac_ui.c: Misc cleanups, spelling corrections.
+
+2004-05-14 Kevin Ryde <kevin@swox.se>
+
+ * mpf/sub.c: When one operand cancels high limbs of the other, strip
+ high zeros on the balance before truncating to destination precision.
+ Truncating first loses accuracy and can lead to a result 0 despite
+ operands being not equal. Reported by John Abbott.
+ Also, ensure exponent is zero when result is zero, for instance if
+ operands are exactly equal.
+ * tests/mpf/t-sub.c (check_data): New function, exercising these.
+
+2004-05-12 Kevin Ryde <kevin@swox.se>
+
+ * configure.in (AC_PROG_RANLIB): New macro, supposedly required by
+ automake, though it doesn't complain.
+
+ * demos/expr/Makefile.am (ARFLAGS): Add a default setting, to
+ workaround an automake bug.
+
+2004-05-10 Kevin Ryde <kevin@swox.se>
+
+ * */Makefile.in, install-sh, aclocal.m4: Update to automake 1.8.4.
+
+ * doc/gmp.texi (Demonstration Programs): Add a remark about expression
+ evaluation in the main gmp library.
+
+ * demos/expr/exprfa.c (mpf_expr_a): Correction to mpX_init, use
+ mpf_init2 to follow requested precision.
+ * demos/expr/exprza.c, demos/expr/exprqa.c: Use wrappers for mpX_init,
+ to make parameters match.
+
+ * demos/expr/run-expr.c: Don't use getopt, to avoid needing configury
+ for optarg declaration. Remove TRY macro, rename foo and bar to var_a
+ and var_b, for clarity.
+ * demos/expr/expr-impl.h: Don't use expr-config.h.
+ * configure.in (demos/expr/expr-config.h): Remove.
+ * demos/expr/expr-config.in: Remove file.
+
+2004-05-08 Kevin Ryde <kevin@swox.se>
+
+ * doc/configuration (Configure): Update for current automake not
+ copying acinclude.m4 into aclocal.m4.
+
+ * configure.in, Makefile.am, doc/gmp.texi, doc/configuration,
+ tests/cxx/Makefile.am, demos/expr/Makefile.am, demos/expr/README,
+ demos/expr/expr.c, demos/expr/expr.h, demos/expr/expr-config-h.in,
+ demos/expr/expr-impl.h, demos/expr/run-expr.c, demos/expr/t-expr.c:
+ MPFR now published separately, remove various bits.
+ * mpfr/*, tests/cxx/t-headfr.cc, demos/expr/exprfr.c,
+ demos/expr/exprfra.c: Remove.
+
+2004-05-07 Kevin Ryde <kevin@swox.se>
+
+ * tests/cxx/Makefile.am (TESTS_ENVIRONMENT): Amend c++ shared library
+ path hack, on k62-unknown-dragonfly1.0 /usr/bin/make runs its commands
+ "set -e", so we need an "|| true" in case there's nothing to copy (for
+ instance in a static build).
+
+2004-05-06 Kevin Ryde <kevin@swox.se>
+
+ * mpn/alpha/mode1o.c: Remove, in favour of ...
+ * mpn/alpha/mode1o.asm: New file.
+ * mpn/alpha/alpha-defs.m4 (bwx_available_p): New macro.
+
+ * tune/amd64.asm: Save rbx in r10 rather than on the stack.
+
+ * configure.in (x86_64-*-*): Try also "-march=k8 -mno-sse2", in case
+ we're in ABI=32 on an old OS not supporting xmm regs.
+ (GMP_GCC_PENTIUM4_SSE2, GMP_OS_X86_XMM): Run these tests under
+ -march=k8 too, and not under ABI=64.
+
+ * doc/gmp.texi (Converting Integers): For mpz_get_d, note truncation
+ and overflows. For mpz_get_d_2exp note truncation, note result if
+ OP==0, and cross reference libc frexp.
+ (Rational Conversions): For mpq_get_d, note truncation and overflows.
+ (Converting Floats): For mpf_get_d, note truncation and overflows.
+ For mpf_get_d_2exp, note truncation, note result if OP==0.
+ (Assembler Code Organisation): Note nails subdirectories.
+ Clarification of get_d_2exp OP==0 reported by Sylvain Pion.
+
+2004-05-05 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/generic/mullow_n.c, mpn/generic/mullow_basecase.c: New files
+ (mainly by Niels Möller).
+ * configure.in, mpn/Makefile.am: Add them.
+
+ * gmp-impl.h (MULLOW_BASECASE_THRESHOLD, MULLOW_DC_THRESHOLD,
+ MULLOW_MUL_N_THRESHOLD): Override for TUNE_PROGRAM_BUILD.
+
+ * tune/Makefile.am: Compile mullow_n.c.
+ * tune/common.c (speed_mpn_mullow_n, speed_mpn_mullow_basecase):
+ New functions.
+ * tune/speed.c (routine): Add entries for mpn_mullow_n and
+ mpn_mullow_basecase.
+ * tune/speed.h (SPEED_ROUTINE_MPN_MULLOW_N_CALL,
+ SPEED_ROUTINE_MPN_MULLOW_BASECASE): New #defines.
+ * tune/tuneup.c (tune_mullow): New function.
+
+ * gmp-impl.h (invert_limb): Compute branch-freely.
+
+2004-05-02 Kevin Ryde <kevin@swox.se>
+
+ * mpn/amd64/mode1o.asm: Use movabsq to support large model non-PIC.
+ Use 32-bit insns to save code bytes, and to save a couple of cycles on
+ the initial setup multiplies.
+
+2004-05-01 Kevin Ryde <kevin@swox.se>
+
+ * doc/gmp.texi (References): Update gcc online docs url to
+ gcc.gnu.org.
+
+ * configure.in (mips*-*-irix[6789]*): Correction to m4 quoting of this
+ pattern. (Believe the mips64*-*-* part also used picks up all current
+ irix6 tuples anyway.) Reported by Rainer Orth.
+
+2004-04-30 Kevin Ryde <kevin@swox.se>
+
+ * acinclude.m4 (GMP_PROG_CC_X86_GOT_EAX_EMITTED,
+ GMP_ASM_X86_GOT_EAX_OK): New macros.
+ (GMP_PROG_CC_WORKS): Use them to detect an old gas bug tickled by
+ recent gcc. Reported by David Newman.
+
+ * doc/gmp.texi (Reentrancy): Note also gmp_randinit_default as an
+ alternative to gmp_randinit.
+
+2004-04-29 Torbjorn Granlund <tege@swox.com>
+
+ * configfsf.guess: Update to 2004-03-12.
+ * configfsf.sub: Likewise.
+
+2004-04-27 Torbjorn Granlund <tege@swox.com>
+
+ * mpz/rrandomb.c (gmp_rrandomb): Rework to avoid extra limb allocation
+ and to generate even numbers.
+ * mpn/generic/random2.c (gmp_rrandomb): Likewise.
+
+2004-04-25 Kevin Ryde <kevin@swox.se>
+
+ * gmp-impl.h (FORCE_DOUBLE): Don't use an asm with a match constraint
+ on a memory output, apparently not supported and provokes a warning
+ from gcc 3.4.
+
+2004-04-24 Kevin Ryde <kevin@swox.se>
+
+ * longlong.h (count_leading_zeros_gcc_clz,
+ count_trailing_zeros_gcc_ctz): New macros.
+ (count_leading_zeros, count_trailing_zeros) [x86]: Use them on gcc
+ 3.4.
+
+ * configure.in (x86-*-* gcc_cflags_cpu): Give a -mtune at the start of
+ each option list, for use by gcc 3.4 to avoid deprecation warnings
+ about -mcpu.
+
+ * mpz/aorsmul.c, mpz/aorsmul_i.c, mpz/cfdiv_q_2exp.c,
+ mpz/cfdiv_r_2exp.c, mpq/aors.c, mpf/ceilfloor.c: Give REGPARM_ATTR()
+ on function definition too, as demanded by gcc 3.4.
+
+2004-04-22 Kevin Ryde <kevin@swox.se>
+
+ * tests/rand/t-lc2exp.c (check_bigc1): New test.
+
+ * doc/fdl.texi: Tweak @appendixsubsec -> @appendixsec to match our
+ preference for this in an @appendix, and because texi2pdf doesn't
+ support @appendixsubsec directly within an @appendix.
+
+2004-04-20 Kevin Ryde <kevin@swox.se>
+
+ * doc/texinfo.tex: Update to 2004-04-07.08 from texinfo 4.7.
+ * doc/gmp.texi, mpfr/mpfr.texi (@copying): Don't put a line break in
+ @ref within @copying, recent texinfo.tex doesn't like that.
+
+ * demos/perl/GMP.xs (static_functable): Treat cygwin the same as mingw
+ DLLs.
+
+ * */Makefile.in, install-sh: Update to automake 1.8.3.
+ * ltmain.sh, aclocal.m4, configure: Update to libtool 1.5.6.
+
+ * gmp-impl.h (LIMB_HIGHBIT_TO_MASK): Use a compile-time constant
+ expression, rather than a configure test.
+ * acinclude.m4, configure.in (GMP_C_RIGHT_SHIFT): Remove, no longer
+ needed.
+ * tests/t-hightomask.c: New file.
+ * tests/Makefile.am (check_PROGRAMS): Add it.
+
+ * macos/configure (parse_top_configure): Look for PACKAGE_NAME and
+ PACKAGE_VERSION now used by autoconf.
+ (what_objects): Only demand 9 object files, as for instance occurs in
+ the scanf directory.
+ (asm files): Transform labels L(foo) -> Lfoo. Take func name from
+ PROLOGUE to support empty "EPILOGUE()". Recognise and substitute
+ register name "define()"s.
+ * macos/Makefile.in (CmnObjs): Add tal-notreent.o.
+
+2004-04-19 Torbjorn Granlund <tege@swox.com>
+
+ * tune/speed.h (SPEED_ROUTINE_MPN_ROOTREM): New #define.
+ (speed_mpn_rootrem): Declare.
+ * tune/common.c (speed_mpn_rootrem): New function.
+ * tune/speed.c (routine): Add entry for mpn_rootrem.
+
+2004-04-16 Kevin Ryde <kevin@swox.se>
+
+ * doc/fdl.texi: Update from FSF, just fixing a couple of typos.
+
+ * macos/configure, macos/Makefile.in: Add printf and scanf directories.
+
+ * tests/mpz/t-gcd.c (check_data): New function, exercising K6
+ gcd_finda bug.
+
+2004-04-14 Kevin Ryde <kevin@swox.se>
+
+ * doc/gmp.texi (Reentrancy, Random State Initialization): Note
+ gmp_randinit use of gmp_errno is not thread safe. Reported by Vincent
+ Lefèvre.
+
+ * doc/gmp.texi (Random State Initialization): Add index entries for
+ gmp_errno and constants.
+
+ * mpn/m68k/README: Update _SHORT_LIMB -> __GMP_SHORT_LIMB.
+
+ * configure.in (--enable-mpbsd): Typo Berkley -> Berkeley in help msg.
+
+2004-04-12 Kevin Ryde <kevin@swox.se>
+
+ * demos/perl/GMP.xs (static_functable): New macro, use it for all
+ function tables, to support mingw DLL builds.
+ * demos/perl/INSTALL (NOTES FOR PARTICULAR SYSTEMS): Remove note on
+ DLLs, should be ok now.
+
+ * demos/perl/sample.pl: Print the module and library versions in use.
+
+ * demos/perl/GMP.pm, Makefile.PL (VERSION): Set to '2.00'.
+ * demos/perl/GMP.pm (COPYRIGHT): New in the doc section.
+
+ * Makefile.am: Note 4.1.3 libtool versioning info, and REVISION policy.
+
+ * tal-debug.c: Add <stdlib.h> for abort.
+
+2004-04-07 Torbjorn Granlund <tege@swox.com>
+
+ * tests/refmpf.c (refmpf_add_ulp): Adjust exponent when needed.
+
+ * mpn/generic/random2.c: Rewrite (clone mpz/rrandomb.c).
+
+2004-04-07 Kevin Ryde <kevin@swox.se>
+
+ * mpn/x86/k6/gcd_finda.asm: Correction jbe -> jb in initial setups.
+ Zero flag is wrong here, it relects only the high limb of the compare,
+ leading to n1>=n2 not satisfied and wrong results. cp[1]==0x7FFFFFFF
+ with cp[0]>=0x80000001 provokes this.
+
+ * doc/gmp.texi (BSD Compatible Functions): Note "pow" name clash under
+ the pow function description too.
+ (Language Bindings): Add XEmacs (betas at this stage). Reported by
+ Jerry James.
+
+ * tests/refmpn.c (refmpn_mod2): Correction to ASSERTs, r==a is allowed.
+
+ * gen-psqr.c (generate_mod): Cast mpz_invert_ui_2exp args, for K&R.
+ * gen-bases.c, gen-fib.c, gen-psqr.c: For mpz_out_str, use stdout
+ instead of 0, in case a K&R treats int and FILE* params differently.
+
+2004-04-04 Kevin Ryde <kevin@swox.se>
+
+ * gmp-impl.h (BSWAP_LIMB) [amd64]: New macro.
+ (FORCE_DOUBLE): Use this for amd64 too.
+
+ * tests/amd64check.c, tests/amd64call.asm: New files, derived in part
+ from x86check.c and x86call.asm.
+ * tests/Makefile.am (EXTRA_libtests_la_SOURCES): Add them.
+ * configure.in (x86_64-*-* ABI=64): Use them.
+
+2004-04-03 Kevin Ryde <kevin@swox.se>
+
+ * mpn/amd64/mode1o.asm: New file.
+ * mpn/amd64/amd64-defs.m4 (ASSERT): New macro.
+
+ * mpn/x86/k7/mmx/divrem_1.asm, mpn/x86/pentium4/sse2/divrem_1.asm: Add
+ note on how "dr" part of algorithm is handled.
+
+ * mpn/x86/k7/dive_1.asm, mpn/x86/k7/mod_34lsub1.asm,
+ mpn/x86/k7/mode1o.asm: Note Hammer (32-bit mode) speeds.
+
+2004-03-31 Kevin Ryde <kevin@swox.se>
+
+ * doc/gmp.texi (Language Bindings): Add GOO, MLGMP and Numerix.
+
+ * mpf/mul_2exp.c, mpf/div_2exp.c: Rate u==0 as UNLIKELY.
+
+2004-03-28 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/amd64/divrem_1.asm: Trim a few cycles.
+
+2004-03-27 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/amd64/sublsh1_n.asm: Fix typo.
+
+ * mpn/generic/divrem_1.c: Fix typo.
+
+ * mpn/generic/sqr_basecase.c: Fix typo.
+
+ * mpn/amd64/divrem_1.asm: New file.
+
+2004-03-20 Kevin Ryde <kevin@swox.se>
+
+ * longlong.h (power, powerpc): Add comments on how we select this code.
+
+ * gmp-h.in (mpz_get_ui): Use ?: instead of mask style, gcc treats the
+ two identically but ?: is a bit clearer.
+
+ * insert-dbl.c: Remove file, no longer used, scaling is now integrated
+ in mpn_get_d.
+ * Makefile.am (libgmp_la_SOURCES): Remove insert-dbl.c.
+ * gmp-impl.h (__gmp_scale2): Remove prototype.
+
+2004-03-17 Kevin Ryde <kevin@swox.se>
+
+ * mpn/x86/fat/fat.c (__gmpn_cpuvec_init, fake_cpuid_table): Add x86_64.
+
+ * mpq/get_d.c: Use mpn_tdiv_qr, demand den>0 per canonical form.
+
+2004-03-16 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/generic/sqr_basecase.c: Add versions using mpn_addmul_2 and
+ mpn_addmul_2s.
+
+2004-03-14 Kevin Ryde <kevin@swox.se>
+
+ * mpf/mul_ui.c: Incorporate carry from low limbs, for exactness.
+ * tests/mpf/t-mul_ui.c: New file.
+ * tests/mpf/Makefile.am (check_PROGRAMS): Add it.
+
+ * mpf/div.c: Use mpn_tdiv_qr. Use just one TMP_ALLOC. Use full
+ divisor, since truncating can lose accuracy.
+ * tests/mpf/t-div.c: New file.
+ * tests/mpf/Makefile.am (check_PROGRAMS): Add it.
+
+ * tests/mpf/t-set_q.c, tests/mpf/t-ui_div.c (check_various): Amend
+ bogus 99/4 test.
+ * tests/mpf/t-ui_div.c (check_rand): Exercise r==v overlap.
+
+ * tests/refmpf.c, tests/tests.h (refmpf_set_overlap): New function.
+
+ * mpf/cmp_si.c [nails]: Correction, cast vval in exp comparisons, for
+ when vval=-0x800..00 and limb==longlong.
+
+ * mpf/cmp_si.c [nails]: Correction, return usign instead of 1 when
+ uexp==2 but value bigger than an mp_limb_t.
+ * tests/mpf/t-cmp_si.c (check_data): Add test cases.
+
+ * tests/trace.c (mpf_trace): Use ABS(mp_trace_base) to allow for
+ negative bases used for upper case hex in integer traces.
+
+2004-03-12 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/generic/sb_divrem_mn.c: Correct header comment.
+
+2004-03-11 Kevin Ryde <kevin@swox.se>
+
+ * aclocal.m4, configure, ltmain.sh: Downgrade to libtool 1.5, version
+ 1.5.2 doesn't remove .libs/*.a files when rebuilding, which is bad for
+ development when changing contents or with duplicate named files like
+ we have.
+
+ Revert this, ie restore AR_FLAGS=cq:
+ * acinclude.m4 (GMP_PROG_AR): Remove AR_FLAGS=cq, libtool 1.5.2 now
+ does this itself on detecting duplicate object filenames in piecewise
+ linking mode.
+
+ * randbui.c, randmui.c [longlong+nails]: Correction to conditionals
+ for second limb.
+
+ * mpz/aors_ui.h, mpz/cdiv_q_ui.c, mpz/cdiv_qr_ui.c, mpz/cdiv_r_ui.c,
+ mpz/cdiv_ui.c, mpz/fdiv_q_ui.c, mpz/fdiv_qr_ui.c, mpz/fdiv_r_ui.c,
+ mpz/fdiv_ui.c, mpz/gcd_ui.c, mpz/iset_ui.c, mpz/lcm_ui.c,
+ mpz/set_ui.c, mpz/tdiv_q_ui.c, mpz/tdiv_qr_ui.c, mpz/tdiv_r_ui.c,
+ mpz/tdiv_ui.c, mpz/ui_sub.c, mpf/div_ui.c, mpf/mul_ui.c
+ [longlong+nails]: Amend #if to avoid warnings about shift amount.
+
+2004-03-07 Kevin Ryde <kevin@swox.se>
+
+ * mpf/reldiff.c: Use rprec+ysize limbs for d, to ensure accurate
+ result. Inline mpf_abs(d,d) and mpf_cmp_ui(x,0), and rate the latter
+ UNLIKELY.
+
+ * mpf/ui_div.c: Use mpn_tdiv_qr. Use just one TMP_ALLOC. Use full
+ divisor, since truncating can lose accuracy.
+ * tests/mpf/t-ui_div.c: New file.
+ * tests/mpf/Makefile.am (check_PROGRAMS): Add it.
+
+ * mpf/set_q.c: Expand TMP_ALLOC_LIMBS_2, to make conditional clearer
+ and avoid 1 limb alloc when not wanted.
+
+ * gmp-impl.h (WANT_TMP_DEBUG): Define to 0 if not defined.
+ (TMP_ALLOC_LIMBS_2): Use "if" within macro rather than "#if", for less
+ preprocessor conditionals.
+
+ * mpf/mul_2exp.c, mpf/div_2exp.c: Add some comments.
+
+ * tests/refmpn.c (refmpn_sb_divrem_mn, refmpn_tdiv_qr): Nailify.
+
+2004-03-04 Kevin Ryde <kevin@swox.se>
+
+ * gen-psqr.c (print): Add CNST_LIMB in PERFSQR_MOD_TEST, for benefit
+ of K&R.
+ * tests/mpn/t-perfsqr.c (PERFSQR_MOD_1): Use CNST_LIMB for K&R.
+
+ * doc/configuration (Configure): Remove mkinstalldirs, no longer used.
+
+ * acinclude.m4 (GMP_PROG_AR): Remove AR_FLAGS=cq, libtool 1.5.2 now
+ does this itself on detecting duplicate object filenames in piecewise
+ linking mode.
+
+ * configure.in (hppa2.0*-*-*): Test sizeof(long) == 4 or 8 to verify
+ ABI=2.0n versus ABI=2.0w. In particular this lets CC=cc_bundled
+ correctly fall back to ABI=2.0n (we don't automatically add CC=+DD64
+ to that compiler, currently).
+
+ * doc/gmp.texi (Reentrancy): Note C++ mpf_class constructors using
+ global default precision.
+ (Random State Miscellaneous): Describe gmp_urandomb_ui as giving N
+ bits.
+ (C++ Interface Floats): Describe operator= copying the value, not the
+ precision, and what this can mean about copy constructor versus
+ default constructor plus assignment.
+
+ * mpf/set_q.c: Use mpn_tdiv_qr rather than mpn_divrem, so no shifting.
+ Don't truncate the divisor, it can make the result inaccurate.
+ * tests/mpf/t-set_q.c: New file.
+ * tests/mpf/Makefile.am (check_PROGRAMS): Add it.
+
+ * mpf/set.c: Use MPN_COPY_INCR, in case r==u and ABSIZ(u) > PREC(r)+1.
+ No actual bug here, because MPN_COPY has thusfar been an alias for
+ MPN_COPY_INCR, only an ASSERT failure.
+ * tests/mpf/t-set.c: New file.
+ * tests/mpf/Makefile.am (check_PROGRAMS): Add it.
+
+ * mpf/set.c, mpf/iset.c: Do MPN_COPY last, for possible tail call.
+
+ * mpf/set_d.c: Rate d==0 as UNLIKELY. Store size before extract call,
+ to shorten lifespan of "negative".
+
+ * mpf/init.c, mpf/init2.c, mpf/iset_d.c, mpf/iset_si.c,
+ mpf/iset_str.c, mpf/iset_ui.c: Store prec before alloc call, for one
+ less live quantity across that call.
+ * mpf/init.c, mpf/init2.c, mpf/iset_str.c: Store size and exp before
+ alloc call, to overlap with other operations.
+
+ * tests/refmpf.c, tests/tests.h (refmpf_fill, refmpf_normalize,
+ refmpf_validate, refmpf_validate_division): New functions.
+
+ * tests/refmpn.c, tests/tests.h (refmpn_copy_extend,
+ refmpn_lshift_or_copy_any, refmpn_rshift_or_copy_any): New functions.
+
+ * tal-debug.c: Add <string.h> for strcmp.
+
+ * tests/cxx/t-istream.cc (check_mpz, check_mpq, check_mpf): Use size_t
+ for loop index, to quieten g++ warning.
+
+2004-03-02 Kevin Ryde <kevin@swox.se>
+
+ * tests/mpn/t-hgcd.c: Use __GMP_PROTO on prototypes.
+
+2004-03-01 Torbjorn Granlund <tege@swox.com>
+
+ With Karl Hasselström:
+ * mpn/generic/dc_divrem_n.c (mpn_dc_div_2_by_1): New function, with
+ meat from old mpn_dc_divrem_n. Accept scratch parameter. Rewrite to
+ avoid a recursive call.
+ (mpn_dc_div_3_by_2): New function, with meat from old
+ mpn_dc_div_3_halves_by_2. Accept scratch parameter.
+ (mpn_dc_divrem_n): Now just allocate scratch space and call new
+ mpn_dc_div_2_by_1.
+
+2004-02-29 Kevin Ryde <kevin@swox.se>
+
+ * longlong.h (count_leading_zeros) [alpha gcc]: New version, inlining
+ mpn/alpha/cntlz.asm cmpbge technique.
+
+ * aclocal.m4, configure, install-sh, missing, ltmain.sh,
+ */Makefile.in: Update to automake 1.8.2 and libtool 1.5.2.
+
+ * doc/gmp.texi (C++ Interface Integers): Note / and % rounding follows
+ C99 / and %.
+ (Exact Remainder): Index entries for divisibility testing algorithm.
+
+ * tune/time.c (speed_endtime): Return 0.0 for negative time measured.
+ Revise usage comments for clarity.
+ * tune/common.c (speed_measure): Recognise speed_endtime 0.0 for
+ failed measurement.
+
+ * tests/mpn/t-get_d.c (check_rand): Correction to nhigh_mask setup.
+
+2004-02-27 Torbjorn Granlund <tege@swox.com>
+
+ * tune/tuneup.c (tune_dc, tune_set_str): Up param.step_factor.
+
+ * tests/mpz/t-gcd.c: Decrease # of tests to 50.
+
+2004-02-27 Kevin Ryde <kevin@swox.se>
+
+ * tests/devel/try.c: Add a comment that this is not for Cray systems.
+
+ * mpf/set_q.c: Don't support den(q)<0, demand canonical form in the
+ usual way.
+
+2004-02-24 Torbjorn Granlund <tege@swox.com>
+
+ From Kevin:
+ * mpn/generic/mul_fft.c (mpn_fft_add_modF): Loop until normalization
+ criterion met.
+
+2004-02-22 Kevin Ryde <kevin@swox.se>
+
+ * acinclude.m4 (GMP_PROG_CC_WORKS, GMP_OS_X86_XMM, GMP_PROG_CXX_WORKS):
+ Remove files that might look like compiler output, so our "||"
+ alternatives are not fooled.
+
+ * acinclude.m4 (GMP_PROG_CC_WORKS): Add test for lshift_com code
+ mis-compiled by certain IA-64 HP cc at +O3.
+
+ * gmp-impl.h (USE_LEADING_REGPARM): Disable under prof or gprof, for
+ the benefit of freebsd where .mcount clobbers registers. Spotted by
+ Torbjorn.
+ * configure.in (WANT_PROFILING_PROF, WANT_PROFILING_GPROF): New
+ AC_DEFINEs.
+
+2004-02-21 Kevin Ryde <kevin@swox.se>
+
+ * configure.in (sparc64-*-*bsd*): Amend -m32 setup for ABI=32, so it's
+ not used in ABI=64 on the BSD systems.
+
+2004-02-18 Niels Möller <nisse@lysator.liu.se>
+
+ * tests/mpz/t-gcd.c (gcdext_valid_p): New function.
+ (ref_mpz_gcd): Deleted function.
+ (one_test): Rearranged to call mpz_gcdext first, so that the
+ returned value can be validated.
+ (main): Don't use ref_mpz_gcd.
+
+2004-02-18 Torbjorn Granlund <tege@swox.com>
+
+ * gmp-impl.h (MPN_TOOM3_MAX_N): Move to !WANT_FFT section.
+
+ * tests/mpz/t-mul.c: Exclude special huge operands unless WANT_FFT.
+
+ * mpz/rrandomb.c (gmp_rrandomb): Rewrite.
+
+ * mpn/generic/mul_n.c (mpn_toom3_sqr_n): Remove write-only variable c5.
+
+2004-02-18 Kevin Ryde <kevin@swox.se>
+
+ * mpf/iset_si.c, mpf/iset_ui.c, mpf/set_si.c, mpf/set_ui.c [nails]:
+ Always store second limb, to avoid a conditional.
+
+ * tests/mpf/t-get_ui.c: New file.
+ * tests/mpf/Makefile.am (check_PROGRAMS): Add it.
+ * tests/mpf/t-get_si.c (check_limbdata): Further tests.
+ * gmp-impl.h (MP_EXP_T_MAX, MP_EXP_T_MIN): New defines.
+
+ * mpf/get_ui.c, mpf/get_si.c: Remove size==0 test, it's covered by
+ other conditions. Attempt greater clarity by expressing conditions as
+ based on available data range.
+ * mpf/get_si.c [nails]: Correction, don't bail on exp > abs_size,
+ since may still have second limb above radix point available.
+ * mpf/get_ui.c: Nailify.
+
+2004-02-16 Kevin Ryde <kevin@swox.se>
+
+ * mpz/scan0.c, mpz/scan1.c: Use count_trailing_zeros, instead of
+ count_leading_zeros on limb&-limb.
+
+ * mpf/sqrt.c: Use "/ 2" for exp, avoiding C undefined behaviour on
+ ">>" of negatives. Correction to comment, exp is rounded upwards.
+ SIZ(r) always prec now, no need for tsize expression. Store EXP(r)
+ and SIZ(r) where calculated to reduce variable lifespans. Make tsize
+ mp_size_t not mp_exp_t, though of course those are currently the same.
+
+ * gmp-h.in (GMP_ERROR_ALLOCATE, GMP_ERROR_BAD_STRING,
+ GMP_ERROR_UNUSED_ERROR): Remove, never used or documented, and we
+ don't want to use globals for communicating error information.
+
+ * mpz/gcd_ui.c [nails]: Correction, actually return a value.
+
+ * mpn/generic/addmul_1.c, mpn/generic/submul_1.c [nails==1]: Add code.
+
+2004-02-15 Kevin Ryde <kevin@swox.se>
+
+ * tests/mpz/t-jac.c (check_data): Remove unnecessary variable
+ "answer".
+
+2004-02-14 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/ia64/aors_n.asm: Break a group with a RAW conflict.
+
+2004-02-14 Kevin Ryde <kevin@swox.se>
+
+ * acinclude.m4 (GMP_C_RIGHT_SHIFT): Note that it's "long"s which we're
+ concerned about.
+
+ * mpn/generic/mul_n.c: Add some remarks about toom3 high zero
+ stripping.
+
+ * mpn/generic/scan0.c, mpn/generic/scan1.c: Remove design issue
+ remarks. What to do about going outside `up' space is a problem, but
+ anything to address it would be an incompatible change.
+
+2004-02-12 Torbjorn Granlund <tege@swox.com>
+
+ * tests/mpn/t-hgcd.c: Remove unused variables.
+
+ * mpn/ia64/hamdist.asm: Remove bundling incompatible with HP-UX
+ assembler. Misc HP-UX changes.
+ * mpn/ia64/gcd_1.asm: Add some syntax to placid the HP-UX assembler.
+
+2004-02-11 Kevin Ryde <kevin@swox.se>
+
+ * longlong.h (power, powerpc): Use HAVE_HOST_CPU_FAMILY_power and
+ HAVE_HOST_CPU_FAMILY_powerpc rather than various cpp defines.
+
+ * gmp-impl.h: Add remarks about limits.h and Cray etc.
+
+ * mpn/ia64/mul_1.asm: Don't put .pred directives on labelled lines,
+ hpux 11.23 assembler doesn't like that.
+ * mpn/ia64/README: Add a note on this.
+
+ * dumbmp.c (mpz_mul): Set ALLOC(r) for new data block used. Reported
+ by Jason Moxham.
+
+ * mpn/pa32/README, mpn/pa64/README (REFERENCES): New sections.
+
+2004-02-10 Torbjorn Granlund <tege@swox.com>
+
+ * tests/mpz/t-gcd.c: Decrease # of tests run.
+
+ * mpn/*/gmp-mparam.h: Add HGCD values, update TOOM values.
+
+2004-02-01 Torbjorn Granlund <tege@swox.com>
+
+ From Kevin:
+ * config.guess: Recognize AMD's hammer processors, return x86_64.
+
+2004-01-31 Niels Möller <nisse@lysator.liu.se>
+
+ * mpn/generic/hgcd.c (mpn_cmp_sum3): Declare static.
+
+2004-01-25 Niels Möller <nisse@lysator.liu.se>
+
+ * tests/mpn/Makefile.am (check_PROGRAMS): Add t-hgcd.
+
+ * mpn/generic/hgcd.c (hgcd_jebelean): Simplify, use mpn_cmp_sum3.
+ (mpn_cmp_sum3): New function.
+ (mpn_diff_smaller_p): Remove.
+ (hgcd_final, hgcd_jebelean, hgcd_small_1, hgcd_small_2, euclid_step):
+ Remove tp,talloc arguments. Callers changed.
+
+2004-01-25 Torbjorn Granlund <tege@swox.com>
+
+ * tune/tuneup.c (all): Reenable calls of tune_gcd_schoenhage and
+ tune_hgcd.
+
+ * mpn/generic/gcd.c: Reenable Schoenhage code.
+
+ With Niels Möller:
+ * mpn/generic/hgcd.c: Add const and inline to several functions.
+ (qstack_push_start qstack_push_end qstack_push_quotient): Remove.
+ (euclid_step): Insert removed functions here.
+ (hgcd_adjust): Simplify, don't handle d != 1.
+ (qstack_adjust): Corresponding changes.
+ (mpn_hgcd2_lehmer_step): Remove redundant tests for bh against zero.
+ (hgcd_start_row_p): Tweak.
+ (hgcd_final): Shorten life of ralloc.
+
+2004-01-24 Kevin Ryde <kevin@swox.se>
+
+ * tests/mpf/t-sqrt.c (check_rand1): Further diagnostic printouts.
+
+ * mpn/generic/sqrtrem.c (mpn_sqrtrem): Add ASSERT_MPN.
+ (mpn_dc_sqrtrem): Add casts for K&R.
+
+ * mpf/sqrt_ui.c: Nailify.
+
+ * mpf/set_z.c: Do MPN_COPY last, for possible tail call.
+
+ * doc/gmp.texi (Miscellaneous Float Functions): For mpf_random2, note
+ exponent is in limbs.
+
+ * mpn/ia64/README: Add remark about concentrating on itanium-2.
+
+2004-01-22 Kevin Ryde <kevin@swox.se>
+
+ * mpf/sqrt.c: Change tsize calculation to get prec limbs result
+ always, previously got prec+1 when exp was odd.
+ * tests/mpf/t-sqrt.c (check_rand1): New function, code from main.
+ (check_rand2): New function.
+
+ * mpf/sqrt_ui.c: Change rsize calculation to get prec limbs result,
+ previously got prec+1.
+ * tests/mpf/t-sqrt_ui.c: New file.
+ * tests/mpf/Makefile.am (check_PROGRAMS): Add it.
+
+ * tests/refmpf.c, tests/tests.h (refmpf_add_ulp,
+ refmpf_set_prec_limbs): New functions.
+
+ * mpz/get_d_2exp.c, mpf/get_d_2exp.c: Remove x86+m68k force to double,
+ mpn_get_d now does this. Remove res==1.0 check for round upwards,
+ mpn_get_d now rounds towards zero. Move exp store to make mpn_get_d a
+ tail call.
+
+ * configure.in (x86-*-*): Use ABI=32 rather than ABI=standard.
+ Use gcc -m32 when available, to force mode on bi-arch amd64 gcc.
+ * configure.in, acinclude.m4 (x86_64-*-*): Merge into plain x86 setups
+ as ABI=64. Support ABI=32, using athlon code. Use gcc -mcpu=k8,
+ -march=k8.
+ (amd64-*-*): Remove pattern, config.sub only gives x86_64.
+ * doc/gmp.texi (ABI and ISA): Add x86_64 dual ABIs.
+
+ * mpn/amd64/README: Add reference to ABI spec.
+
+2004-01-17 Niels Möller <nisse@lysator.liu.se>
+
+ * mpn/generic/hgcd.c (hgcd_adjust): Backed out mpn_addlsh1_n
+ change for now.
+
+ * mpn/generic/hgcd.c (hgcd_adjust): Fixed calls of mpn_addlsh1_n.
+
+2004-01-17 Kevin Ryde <kevin@swox.se>
+
+ * tune/README: Remove open/mpn versions of toom3, no longer exist.
+ * tune/powerpc64.asm: Remove unused L(again).
+ * tune/time.c (mftb): Note single mftb possible for powerpc64.
+
+ * mpn/generic/mode1o.c: Use "c<s" to do underflow detection in last
+ step, for better parallelism.
+
+ * mpn/generic/get_d.c: Preserve comments about hppa fcnv,udw,dbl from
+ previous mpz_get_d code.
+
+ * tune/freq.c: Add some comments about systems not covered.
+
+ * gmp-h.in (_GMP_H_HAVE_FILE): Add _MSL_STDIO_H for Metrowerks.
+ Reported by Tomas Zahradnicky.
+
+2004-01-16 Niels Möller <nisse@lysator.liu.se>
+
+ * mpn/generic/hgcd.c (mpn_diff_smaller_p): Use MPN_DECR_U.
+ (hgcd_adjust): Use mpn_addlsh1_n when available.
+
+2004-01-16 Kevin Ryde <kevin@swox.se>
+
+ * configure.in (powerpc64-*-linux*): Try gcc64. Try -m64 with
+ "cflags_maybe" to get it used in all probing. Add sizeof-long-8 test
+ to check the mode is right if -m64 is not applicable.
+
+2004-01-15 Kevin Ryde <kevin@swox.se>
+
+ * configure.in (--with-readline=detect): Check for readline/readline.h
+ and readline/history.h. Report result of detection.
+
+2004-01-14 Niels Möller <nisse@lysator.liu.se>
+
+ * tune/speed.c (routine): Disabled speed_mpn_hgcd_lehmer.
+ * tune/common.c (speed_mpn_hgcd_lehmer): Disabled function.
+
+ * mpn/generic/hgcd.c (mpn_hgcd_lehmer_itch, mpn_hgcd_lehmer)
+ (mpn_hgcd_equal): Deleted functions.
+
+ * mpn/generic/gcd.c (hgcd_start_row_p): Deleted function.
+ (gcd_schoenhage): Deleted assertion code using mpn_hgcd_lehmer.
+
+ * mpn/generic/hgcd.c (hgcd_final): Fixed ASSERT typos.
+ (mpn_hgcd): To use Lehmer's algorithm, call hgcd_final directly,
+ not mpn_hgcd_lehmer.
+
+ * mpn/generic/gcd.c (gcd_schoenhage): Updated for changes to
+ mpn_hgcd and mpn_hgcd_fix. (Schoenhage code is still disabled).
+
+ * gmp-impl.h (mpn_hgcd_fix): Updated prototype.
+
+ * mpn/generic/hgcd.c (mpn_hgcd_fix): Replaced a bunch of arguments
+ by a pointer const struct hgcd_row *s. Updated callers.
+
+ * mpn/generic/hgcd.c (hgcd_start_row_p): Use const for the input.
+ Moved function definition before hgcd_jebelean.
+ (hgcd_jebelean): Interface change, analogous to hgcd2.
+ (mpn_hgcd_fix): Normalize v. Require that v > 0.
+ (hgcd_adjust): Fix bug in carry update.
+ (mpn_hgcd): Reorganized again, to adapt to mpn_hgcd/hgcd_jebelean
+ now sometimes returning 1. Reintroduced hgcd_adjust.
+
+ * mpn/generic/hgcd.c (hgcd_final): Streamlined logic for the first
+ hgcd2 call.
+
+ * mpn/generic/hgcd2.c (mpn_hgcd2): Interface change. Return 1
+ instead of 2, in the no progress case r0=A, r1=B.
+
+ * mpn/generic/hgcd.c (hgcd_adjust): Changed arguments and return
+ value. Now takes a struct hgcd_row * and the uv size, and returns
+ updated uvsize.
+ (hgcd_final): Special handling of the case hgcd2 returning 1. Now
+ uses hgcd_adjust, instead of a full Euclid division.
+
+2004-01-13 Niels Möller <nisse@lysator.liu.se>
+
+ * mpn/generic/hgcd.c (euclid_step, hgcd_case0): Merged into a
+ single function euclid_step.
+ (mpn_hgcd): Reorganized the logic for the second recursive call.
+ Avoid unnecessary Euclid steps.
+
+ * tests/mpn/t-hgcd.c (hgcd_values): One more test value.
+
+ * tests/mpn/t-hgcd.c (hgcd_values): Added values that trigged the
+ hgcd_jebelean bug.
+
+ * mpn/generic/hgcd.c (hgcd_jebelean): Fixed off by one error.
+ (mpn_hgcd): Simplified the logic for the first recursive call. Now
+ it uses only the correct values from the recursive call, and
+ doesn't do tricks with hgcd_adjust (hgcd_adjust will probably be
+ reintroduced later, though).
+
+ * tests/mpn/t-hgcd.c (mpz_mpn_equal, hgcd_ref_equal)
+ (hgcd_ref_init, hgcd_ref_clear): New functions.
+ (hgcd_ref): Reference implementation of hgcd, using mpz.
+ (one_test): Use hgcd_ref. Don't use mpn_hgcd_lehmer.
+ (main): Skip one_step if both input values are zero.
+
+2004-01-12 Niels Möller <nisse@lysator.liu.se>
+
+ * mpn/generic/hgcd.c (hgcd_final): Rewritten, now uses Lehmer
+ steps instead of a division loop.
+ (mpn_hgcd_lehmer): Deleted old Lehmer code, instead just
+ initialize and then call hgcd_final.
+
+ * tests/tests.h: Added refmpn_free_limbs prototype.
+ * tests/refmpn.c (refmpn_free_limbs): New function.
+
+ * tests/mpn/t-hgcd.c: Try the same kind of random inputs as for
+ mpz/t-gcd.
+
+2004-01-11 Niels Möller <nisse@lysator.liu.se>
+
+ * mpn/generic/hgcd.c (mpn_hgcd_lehmer): Rewritten, after some more
+ analysis of the size reduction for one Lehmer step.
+
+ * tests/mpn/t-hgcd.c: New file.
+
+2004-01-11 Torbjorn Granlund <tege@swox.com>
+
+ With Niels Möller:
+ * mpn/generic/hgcd.c (hgcd_normalize): Fix ASSERTs.
+ (hgcd_mul): Normalize R[1].uvp[1]. Add some more ASSERTs.
+ (hgcd_update_uv): Streamline. ASSERT that input and output is
+ normalized.
+
+2004-01-11 Kevin Ryde <kevin@swox.se>
+
+ * mpn/alpha/ev6/slot.pl: New file, derived in part from
+ mpn/x86/k6/cross.pl.
+
+ * mpn/alpha/alpha-defs.m4 (ASSERT): New macro.
+
+ * mpn/asm-defs.m4 (m4_ifdef): New macro, avoiding OSF 4.0 m4 bug.
+ (m4_assert_defined): Use it.
+
+ * mpn/alpha/default.m4, mpn/alpha/unicos.m4 (LDGP): New macro.
+ * mpn/alpha/ev67/gcd_1.asm: Use it to re-establish gp after jsr.
+
+ * configure.in, demos/calc/Makefile.am: Use -lcurses or -lncurses with
+ readline, when available.
+
+ * longlong.h (sub_ddmmss) [generic]: Use al<bl for the borrow rather
+ than __x>al, since the former can be done without waiting for __x,
+ helping superscalar chips, in particular alpha ev5 and ev6.
+
+ * longlong.h (sub_ddmmss) [ia64]: New macro.
+
+ * tests/t-sub.c: New file.
+ * tests/Makefile.am (check_PROGRAMS): Add it.
+ * tests/refmpn.c, tests/tests.h (refmpn_sub_ddmmss): New function.
+
+2004-01-09 Kevin Ryde <kevin@swox.se>
+
+ * mpn/x86/p6/mod_34lsub1.asm: New file, derived in part from
+ mpn/x86/mod_34lsub1.asm.
+
+ * configure.in (IA64_PATTERN): Use -mtune on gcc 3.4.
+
+2004-01-07 Kevin Ryde <kevin@swox.se>
+
+ * gmp-h.in, mp-h.in (__GMP_SHORT_LIMB): Renamed from _SHORT_LIMB, to
+ keep in our namespace. (Not actually used anywhere currently.)
+ Reported by Patrick Pelissier.
+
+ * mp-h.in: Use "! defined (__GMP_WITHIN_CONFIGURE)" in the same style
+ as gmp-h.in (though mp-h.in is not actually used during configure).
+
+ * mp-h.in (__GMP_DECLSPEC_EXPORT, __GMP_DECLSPEC_IMPORT) [__GNUC__]:
+ Use __dllexport__ and __dllimport__ to keep out of application
+ namespace. Same previously done in gmp-h.in.
+
+2004-01-06 Kevin Ryde <kevin@swox.se>
+
+ * configfsf.sub, configfsf.guess: Update to 2004-01-05.
+ * configure.in (amd64-*-* | x86_64-*-*): Update comments on what
+ configfsf.sub does.
+
+2004-01-04 Kevin Ryde <kevin@swox.se>
+
+ * mpn/alpha/README (REFERENCES): Add tru64 assembly manuals.
+ (ASSEMBLY RULES): Note what gcc says about !literal! etc.
+
+2004-01-03 Kevin Ryde <kevin@swox.se>
+
+ * mpn/alpha/ev67/gcd_1.asm: New file.
+
+ * mpn/x86/pentium4/sse2/rsh1add_n.asm: New file, derived in part from
+ mpn/x86/pentium4/sse2/addlsh1_n.asm.
+
+ * mpn/x86/p6/p3mmx/popham.asm: Note measured speeds.
+
+ * mpn/ia64/hamdist.asm: Correction to inputs vs locals in alloc (makes
+ no difference to the generated code). Corrections to a couple of
+ comments.
+
+ * mpn/x86/pentium4/sse2/addlsh1_n.asm (PARAM_CARRY): Remove macro, not
+ used, no such parameter.
+
+ * mpn/generic/gcd.c: Use <stdio.h> for NULL.
+
+ * doc/gmp.texi (Single Limb Division): Correction to tex expression
+ for (1/2)x1. And minor wording tweaks elsewhere.
+
+ * gmp-impl.h (mpn_rsh1add_n, mpn_rsh1sub_n): Correction to comments
+ about how carries returned.
+
+ * longlong.h (umul_ppmm) [generic]: Add comments about squaring
+ (dropped from tasks list)
+
+2003-12-31 Kevin Ryde <kevin@swox.se>
+
+ * demos/perl/GMP.xs (scan0, scan1): Return ~0 for not-found.
+ * demos/perl/GMP.pm: Describe this, remove the note about ULONG_MAX
+ being the same as ~0 (which is not true in old perl).
+ * demos/perl/test.pl: Update tests.
+ * demos/perl/typemap (gmp_UV): New type.
+
+ * demos/perl/test.pl (fits_slong_p): Comment out uv_max test, it won't
+ necessarily exceed a long.
+
+ * demos/perl/GMP.pm: Add a remark about get_str to the bugs section.
+
+ * mpn/generic/sqrtrem.c, mpz/fac_ui.c, tests/mpf/reuse.c: Add casts
+ for K&R.
+ * tests/mpf/t-muldiv.c: Make ulimb, vlimb into ulongs, which is how
+ they're used, for the benefit of K&R calling.
+
+ * doc/gmp.texi (Square Root Algorithm): Add a summary of the algorithm.
+ And add further index entries in various places.
+
+ * mpz/lucnum_ui.c, mpz/lucnum2_ui.c: Use mpn_addlsh1_n when available.
+
+ * gmp-impl.h, mpn/generic/mul_n.c (mpn_addlsh1_n, mpn_sublsh1_n,
+ mpn_rsh1add_n, mpn_rsh1sub_n): Move descriptions to gmp-impl.h with
+ the prototypes, for ease of locating.
+
+2003-12-30 Torbjorn Granlund <tege@swox.com>
+
+ * tune/tuneup.c (all): Disable calls of tune_gcd_schoenhage and
+ tune_hgcd for now.
+
+2003-12-29 Torbjorn Granlund <tege@swox.com>
+
+ * tests/mpz/t-gcd.c: Rewrite, based on suggestions by Kevin.
+
+ * mpn/ia64/mul_1.asm: Amend TODO list.
+
+ * mpn/sparc64/README: Remove mpn_Xmul_2, done.
+ Add blurb about L1 cache conflicts.
+
+ * mpn/generic/gcd.c: Disable Schoenhage code for now.
+
+2003-12-29 Kevin Ryde <kevin@swox.se>
+
+ * mpn/generic/mul_fft.c, mpz/root.c, mpq/cmp_ui.c: Add casts for K&R.
+
+2003-12-27 Kevin Ryde <kevin@swox.se>
+
+ * tests/mpz/t-mul.c (mul_kara, mul_basecase): Use __GMP_PROTO.
+
+ * mpn/generic/gcd.c (NHGCD_SWAP4_2, NHGCD_SWAP3_LEFT),
+ mpn/generic/hgcd.c (HGCD_SWAP4_LEFT, HGCD_SWAP4_RIGHT, HGCD_SWAP4_2,
+ HGCD_SWAP3_LEFT): Aggregate initializers for automatics is an
+ ANSI-ism, avoid.
+
+ * Makefile.am (AUTOMAKE_OPTIONS): Restore this, giving no directory on
+ ansi2knr to avoid a circular build rule.
+ * configure.in (AM_INIT_AUTOMAKE): Note options also in Makefile.am.
+
+ * configure.in (cflags_maybe): Don't loop adding cflags_maybe if the
+ user has set CFLAGS.
+
+2003-12-24 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/generic/gcd.c (gcd_schoenhage_itch): Avoid unary "+".
+ (mpn_gcd): Allocate scratch space on heap for gcd_schoenhage.
+ (mpn_gcd): Don't invoke MPN_NORMALIZE on input operands.
+
+2003-12-23 Kevin Ryde <kevin@swox.se>
+
+ * configure.in (*sparc*-*-*): Test sizeof(long)==4 or 8 for ABIs, to
+ get the right mode when the user sets the CFLAGS.
+ (testlist): Introduce "any_<abi>_testlist" to apply to all compilers.
+
+ * demos/perl/typemap (MPZ_ASSUME, MPQ_ASSUME, MPF_ASSUME): Remove
+ output rules, these are only meant for inputs.
+ (MPZ_MUTATE): Remove, not used since changes for magic.
+
+ * demos/perl/GMP.xs (mpz_class_hv, mpq_class_hv, mpf_class_hv): New
+ variables, initialized in BOOT.
+ * demos/perl/GMP.xs, demos/perl/typemap: Use them and explicit
+ sv_bless, to save a gv_stashpv for every new object.
+
+2003-12-22 Kevin Ryde <kevin@swox.se>
+
+ * mpn/alpha/mode1o.c, mpn/alpha/dive_1.c: Moved from ev5/mode1o.c and
+ ev5/dive_1.c, these are good for ev4, and would like them in a generic
+ alpha build.
+
+2003-12-21 Kevin Ryde <kevin@swox.se>
+
+ * doc/gmp.texi (Integer Logic and Bit Fiddling): Say "bitwise" in
+ mpz_and, mpz_ior and mpz_xor, to avoid any confusion with what C means
+ by "logical". Reported by Rüdiger Schütz.
+
+ * gmp-h.in (_GMP_H_HAVE_FILE): Note why defined(EOF) is not good.
+
+2003-12-20 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/generic/hgcd.c (mpn_diff_smaller_p): Use mpn_cmp instead of
+ mpn_sub_n where possible. Use mp_size_t for relevant variables.
+
+2003-12-20 Kevin Ryde <kevin@swox.se>
+
+ * tune/speed.h (SPEED_TMP_ALLOC_LIMBS): Correction to last change,
+ don't want "- 1" on the TMP_ALLOC_LIMBS.
+
+ * demos/expr/expr.h: Test #ifdef MPFR_VERSION_MAJOR for when mpfr.h is
+ included, not GMP_RNDZ which is now an enum.
+
+ * demos/expr/exprfra.c (e_mpfr_ulong_p): Use mpfr_integer_p and
+ mpfr_fits_ulong_p.
+ (e_mpfr_get_ui_fits): Use mpfr_get_ui.
+
+ * mpfr/*: Update to mpfr cvs head 2003-12-20.
+
+ * configure, config.in: Update to autoconf 2.59.
+ * */Makefile.in, configure, aclocal.m4, ansi2knr.c, install-sh,
+ doc/mdate-sh: Update to automake 1.8.
+
+ * mkinstalldirs: Remove, not required by automake 1.8.
+ * doc/gmp.texi (Build Options): HTML is a usual target in automake 1.8.
+
+ * configure.in (AC_PREREQ): Require autoconf 2.59.
+ (AM_INIT_AUTOMAKE): Require automake 1.8.
+ (AC_C_INLINE): Use rather than GMP_C_INLINE, now has #ifndef
+ __cplusplus we want.
+ (gettimeofday): Use AC_CHECK_FUNCS rather than our workaround code,
+ autoconf now ok.
+
+ * acinclude.m4 (GMP_C_INLINE): Remove.
+ (GMP_H_EXTERN_INLINE): Use AC_C_INLINE.
+ (GMP_PROG_AR): Comment on automake $ARFLAGS.
+
+2003-12-19 Niels Möller <nisse@lysator.liu.se>
+
+ * mpn/generic/hgcd.c (mpn_diff_smaller_p): Rewrote function. Tried
+ to explain how it works.
+ (slow_diff_smaller_p, wrap_mpn_diff_smaller_p) [WANT_ASSERT]: Use
+ CPP to wrap assertion checks around all calls to
+ mpn_diff_smaller_p.
+
+ * mpn/generic/hgcd.c (mpn_addmul2_n_1) [nails]: Fixed carry handling.
+
+ * mpn/generic/hgcd.c (mpn_diff_smaller_p) [nails]: Use
+ GMP_NUMB_MAX, not MP_LIMB_T_MAX.
+ (mpn_hgcd_itch): Improved size calculation.
+ (mpn_hgcd_max_recursion): Moved function from qstack.c. Should to
+ be recompiled when HGCD_SCHOENHAGE_THRESHOLD is tuned.
+
+ * mpn/generic/qstack.c (mpn_hgcd_max_recursion): ... moved from
+ here.
+
+2003-12-19 Torbjorn Granlund <tege@swox.com>
+
+ * tests/mpf/t-get_d.c: Print message before aborting.
+
+ * mpn/generic/hgcd2.c (mpn_hgcd2): Substitute always-zero variable
+ with 0. Remove bogus comment.
+
+ * mpn/generic/get_d.c: Make ONE_LIMB case actually work for nails.
+
+2003-12-18 Niels Möller <niels@lysator.liu.se>
+
+ * mpn/generic/hgcd.c (hgcd_update_r): Assert that the output r2 is
+ smaller than the input r1.
+
+2003-12-18 Torbjorn Granlund <tege@swox.com>
+
+ * mpz/get_d.c: Don't include longlong.h.
+
+ * tests/mpz/t-mul.c (ref_mpn_mul): Handle un == vn specially, to avoid
+ a dummy r/w outside of allocated area.
+
+2003-12-18 Kevin Ryde <kevin@swox.se>
+
+ * mpn/alpha/unicos.m4 (ALIGN): Add comments on what GCC does.
+
+ * configure.in (fat setups), acinclude.m4 (GMP_INIT): Obscure
+ include() from automake 1.8 aclocal.
+ * acinclude.m4: Quote names in AC_DEFUN, for automake 1.8 aclocal.
+
+2003-12-17 Niels Möller <nisse@lysator.liu.se>
+
+ * tune/common.c (speed_mpn_hgcd, speed_mpn_hgcd_lehmer) [nails]:
+ Enabled code also for GMP_NAIL_BITS > 0.
+ * tune/speed.c [nails]: Enable speed_mpn_hgcd and
+ speed_mpn_hgcd_lehmer.
+ * tune/tuneup.c (tune_hgcd) [nails]: Likewise.
+
+ * mpn/generic/gcd.c [nails]: Use Schönhage's algorithm also for
+ GMP_NAIL_BITS > 0.
+
+ * mpn/generic/hgcd.c [nails]: Enable the code for GMP_NAIL_BITS > 0.
+ (MPN_EXTRACT_LIMB) [nails]: Handle nails.
+ (__gmpn_hgcd_sanity): Allocate temporaries on the heap, not on the
+ stack. Also check that r[i] >= r[i+1].
+ (mpn_hgcd2_lehmer_step) [nails]: Handle nails.
+ (mpn_hgcd_lehmer): When we temporarily have r3 > r2, avoid
+ trigging that assert in __gmpn_hgcd_sanity.
+ (mpn_hgcd): Likewise.
+
+ * mpn/generic/hgcd2.c (div2) [nails]: Alternative nail-aware
+ version.
+ (SUB_2): New macro of Kevin's, which reduces do sub_ddmmss in the
+ non-nail case.
+ (HGCD2_STEP): Use SUB_2, not sub_ddmmss. Added alternative version
+ for K&R compilers.
+ (mpn_hgcd2) [nails]: Use SUB_2, not sub_ddmmss. New nail-aware
+ code for checking Jebelean's condition.
+
+2003-12-13 Kevin Ryde <kevin@swox.se>
+
+ * mpq/get_d.c: Amend comments per mpn_get_d change.
+ (limb2dbl): Remove, no longer used.
+
+ * gmp-impl.h (DIVREM_1_NORM_THRESHOLD etc) [nails]: Correction to
+ comments, MP_SIZE_T_MAX means preinv never.
+
+ * gmp-impl.h (DIVEXACT_1_THRESHOLD, MODEXACT_1_ODD_THRESHOLD) [nails]:
+ Remove overrides, divexact_1 and modexact_1 have been nailified.
+
+ * mpz/inp_str.c (mpz_inp_str_nowhite): Use ASSERT_ALWAYS for EOF value
+ requirement.
+
+ * tests/refmpn.c (refmpn_rsh1add_n, refmpn_rsh1sub_n): Parens around
+ GMP_NUMB_BITS - 1 with ">>", to quieten gcc -Wall.
+ * tests/t-constants.c (main), tests/t-count_zeros.c (check_clz),
+ tests/t-modlinv.c (one), tests/mpz/t-jac.c (try_si_zi),
+ tests/mpq/t-get_d.c (check_onebit): : Correction to printfs.
+ * tests/mpn/t-fat.c: Add <string.h> for memcpy.
+ * tests/mpz/t-scan.c (check_ref): Remove unused variable "isigned".
+ * tests/mpq/t-get_d.c (check_onebit): Remove unused variable "limit".
+ * tests/mpf/t-set_si.c, tests/mpf/t-set_ui.c (check_data): Braces for
+ initializers.
+ * tests/devel/try.c (mpn_divexact_by3_fun, mpn_modexact_1_odd_fun):
+ Correction to return values.
+
+ * doc/gmp.texi (Miscellaneous Integer Functions): Note mpz_sizeinbase
+ can be used to locate the most significant bit. Reword a bit for
+ clarity.
+
+2003-12-12 Niels Möller <niels@lysator.liu.se>
+
+ * mpn/generic/hgcd.c (__gmpn_hgcd_sanity): Fixed stack buffer
+ overrun.
+ * mpn/generic/hgcd.c: Improved comments.
+
+2003-12-11 Torbjorn Granlund <tege@swox.com>
+
+ * gmp-impl.h: Change asm => __asm__, tabify.
+ * mpz/get_d_2exp.c: Likewise.
+ * mpf/get_d_2exp.c: Likewise.
+
+ * tests/cxx/t-ops.cc: #if .. #endif out tests that cause ambiguities.
+
+2003-12-10 Torbjorn Granlund <tege@swox.com>
+
+ * tests/mpz/t-gcd.c: Generate operands with sizes as a geometric
+ progression, to allow for larger operands and less varying timing.
+
+ * tune/tuneup.c (tune_gcd_schoenhage): Set param.step_factor.
+ (tune_hgcd): Likewise.
+
+2003-12-10 Kevin Ryde <kevin@swox.se>
+
+ * demos/perl/test.pl: Should be $] for perl version in old perl.
+
+ * configure.in (sparc64-*-*): Single block of gcc configs for all
+ systems, on unknown systems try both ABI 32 and 64.
+
+ * configure.in (LIBGMP_LDFLAGS, LIBGMPXX_LDFLAGS): New AC_SUBSTs with
+ options to generate .def files with windows DLLs.
+ * Makefile.am (libgmp_la_LDFLAGS, libgmpxx_la_LDFLAGS): Use them.
+
+ * mpn/generic/gcd.c: Use ABOVE_THRESHOLD / BELOW_THRESHOLD, to follow
+ convention and cooperate with tune/tuneup.c.
+
+ * tune/tuneup.c (tune_gcd_schoenhage): Increase max_size to 3000, side
+ default 1000 is approx the crossover point on athlon.
+
+ * tune/common.c, tune/speed.c, tune/speed.h, tune/speed-ext.c,
+ tune/tuneup.c (SPEED_TMP_ALLOC_LIMBS): Take variable as parameter
+ rather than returning a value, avoids alloca in a function call.
+ * tune/common.c, tune/speed.h (speed_tmp_alloc_adjust): Remove, now
+ inline in SPEED_TMP_ALLOC_LIMBS, and using ptr-NULL for alignment
+ extraction.
+
+ * gmpxx.h (__gmp_binary_equal, __gmp_binary_not_equal,
+ __gmp_binary_less, __gmp_binary_less_equal, __gmp_binary_greater,
+ __gmp_binary_greater_equal, __gmp_cmp_function): Use mpfr_cmp_si and
+ mpfr_cmp_d.
+ * tests/cxx/t-ops.cc: Exercise this.
+
+ * demos/perl/Makefile.PL: Don't install sample.pl and test2.pl.
+
+ * demos/perl/GMP.xs (use_sv): Prefer PV over IV or NV to avoid any
+ rounding.
+ * demos/perl/test.pl: Exercise this.
+
+ * demos/perl/GMP/Mpf.pm (overload_string): Corrections to $# usage.
+ * demos/perl/test.pl: Exercise this.
+
+2003-12-08 Kevin Ryde <kevin@swox.se>
+
+ * demos/perl/GMP.pm: Correction to canonicalize example.
+
+ * demos/perl/GMP.xs: New type check scheme, support magic scalars,
+ support UV when available. Remove some unused local variables.
+ (coerce_long): Check range of double.
+ (get_d_2exp): Remove stray printf.
+
+ * demos/perl/test.pl: Exercise magic, rearrange to make it clearer
+ what's being tested.
+
+2003-12-07 Kevin Ryde <kevin@swox.se>
+
+ * mpn/generic/hgcd.c (mpn_hgcd): Use BELOW_THRESHOLD, to follow the
+ convention of N<THRESH for the lower algorithm, not <=. Fixes
+ algorithm selection in tuneup.c.
+
+ * tune/common.c (speed_mpn_hgcd, speed_mpn_hgcd_lehmer): Use intended
+ align_xp, align_yp.
+
+ * tune/tuneup.c (mul_toom3_threshold): Use MUL_TOOM3_THRESHOLD_LIMIT,
+ for the benefit of ASSERT in mpn_mul_n.
+
+ * tune/tuneup.c (tune_mul): Correction to toom3 param.min_size, should
+ use MPN_TOOM3_MUL_N_MINSIZE.
+
+ * tune/speed.c (check_align_option): Correction to printf format.
+ * tune/freq.c (freq_sysctl_hw_model): Remove unused "i" variable.
+
+ * scanf/doscan.c: Correction to a couple of trace printfs.
+ Add <stdlib.h> for strtol.
+
+ * tests/misc/t-scanf.c (test_sscanf_eof_ok): New function.
+ (check_misc): Use it to suppress tests broken by libc.
+ And should be EOF rather than -1 in various places.
+
+2003-12-06 Torbjorn Granlund <tege@swox.com>
+
+ * tune/common.c (speed_mpn_hgcd, speed_mpn_hgcd_lehmer):
+ Move SPEED_TMP_ALLOC_LIMBS invocations out from calls.
+
+ * mpn/generic/get_str.c (mpn_get_str, POW2_P case):
+ Don't append extra '\0' byte.
+
+2003-12-05 Niels Möller <niels@lysator.liu.se>
+
+ * tune/common.c (speed_mpn_hgcd_lehmer, speed_mpn_hgcd):
+ Updated for the renaming hgcd_sanity -> ASSERT_HGCD.
+
+ * mpn/generic/gcd.c (gcd_schoenhage): TMP_DECL must be the final
+ declaration in the declaration section of a block.
+
+ * tune/speed.h (mpn_gcd_accel): Added prototype.
+
+2003-12-05 Torbjorn Granlund <tege@swox.com>
+
+ * randmt.c (__gmp_mt_recalc_buffer): Put parens around "&" expressions
+ inside "!=".
+
+ * mpf/get_str.c: Remove unused variable "fracn".
+
+2003-12-03 Kevin Ryde <kevin@swox.se>
+
+ * configure.in, Makefile.am (LIBGMP_LDFLAGS, LIBGMPXX_LDFLAGS): New
+ AC_SUBSTs, use them to create .def files with Windows DLLs.
+ * doc/gmp.texi (Notes for Particular Systems): Update notes on mingw
+ DLL with MS C.
+
+ * mpz/export.c: Allow NULL for countp.
+ * doc/gmp.texi (Integer Import and Export): Describe this.
+ Suggested by Jack Lloyd.
+
+ * mpn/x86/p6/aors_n.asm: New file, grabbing the K7 code.
+ Superiority of this reported by Patrick Pelissier.
+
+2003-11-30 Kevin Ryde <kevin@swox.se>
+
+ * mpn/alpha/ev67/popcount.asm, mpn/alpha/ev67/hamdist.asm: New files.
+
+ * mpn/alpha/ev67: New directory.
+ * configure.in (alphaev67, alphaev68, alphaev7*): Use it.
+
+ * doc/gmp.texi (GMPrefu, GMPpxrefu): Change back to plain ref and
+ pxref, remove macros.
+ (GMPreftopu, GMPpxreftopu): Remove URL parameter, rename to GMPreftop
+ and GMPpxreftop.
+ (Debugging): Remove debauch, seems to have disappeared.
+ (Language Bindings): Corrections to URLs for CLN, Omni F77, Pike.
+
+2003-11-29 Kevin Ryde <kevin@swox.se>
+
+ * demos/perl/GMP/Mpf.pm (overload_string): Use $OFMT to avoid warnings
+ about $#.
+
+ * demos/perl/GMP.xs (fits_slong_p): Use LONG_MAX+1 to avoid possible
+ rounding of 0x7F..FF in a double on 64-bit systems.
+
+ * configure.in (ppc601-*-*): Remove this case, it never matched
+ anything, the name adopted is powerpc601.
+ (powerpc601-*-*): Use gcc -mcpu=601, xlc -qarch=601.
+
+ * configure.in: Introduce ${cc}_cflags_maybe, used if they work.
+ (*sparc*-*-*) [ABI=32]: Add gcc_cflags_maybe=-m32 to force that mode.
+
+ * doc/gmp.texi (Introduction to GMP): Add AMD64 to optimizations list.
+ (Build Options): Add cpu types alphaev7 and amd64. Update texinfo
+ html cross reference.
+
+2003-11-28 Niels Möller <nisse@lysator.liu.se>
+
+ * tune/tuneup.c (tune_hgcd): Disable if GMP_NAIL_BITS > 0.
+ * tune/speed.c (routine): Likewise.
+ * tune/common.c (speed_mpn_hgcd, speed_mpn_hgcd_lehmer): Likewise.
+
+ * mpn/generic/gcd.c, mpn/generic/hgcd.c, mpn/generic/hgcd2.c
+ [GMP_NAIL_BITS]: Disabled new code if we have nails.
+
+ * mpn/generic/gcd.c (MPN_LEQ_P): Copied macro definition (needed
+ for compilation with --enable-assert).
+
+ * tune/tuneup.c (hgcd_schoenhage_threshold,
+ gcd_schoenhage_threshold): New variables.
+ (tune_hgcd, tune_gcd_schoenhage): New functions.
+ (all): Call tune_hgcd and tune_gcd_schoenhage.
+
+ * tune/common.c (speed_mpn_hgcd, speed_mpn_hgcd_lehmer)
+ (speed_mpn_gcd_accel): New functions.
+ * tune/speed.c (routine): Added mpn_hgcd, mpn_hgcd_lehmer and
+ mpn_gcd _accel.
+ * tune/speed.h: Added corresponding prototypes.
+
+ * tune/gcd_accel.c: New file.
+
+ * tune/gcd_bin.c (GCD_SCHOENHAGE_THRESHOLD): Set to MP_SIZE_T_MAX.
+
+ * tune/Makefile.am (libspeed_la_SOURCES): Added gcd_accel.c.
+ (TUNE_MPN_SRCS_BASIC): Added hgcd.c.
+
+ * mpn/x86/k7/gmp-mparam.h (HGCD_SCHOENHAGE_THRESHOLD)
+ (GCD_SCHOENHAGE_THRESHOLD): Tuned values.
+
+ * mpn/generic/gcd.c (mpn_gcd, gcd_binary_odd): Renamed the
+ old mpn_gcd function (which implements accelerated binary gcd) to
+ gcd_binary_odd.
+ (gcd_binary): New function, with the additional book keeping
+ needed when using gcd_binary_odd to compute the gcd of non-odd
+ numbers.
+ (hgcd_tdiv): New function.
+ (gcd_lehmer): New function, currently #if:ed out.
+ (hgcd_start_row_p): New function, duplicated from hgcd.c.
+ (gcd_schoenhage_itch): New function.
+ (gcd_schoenhage): New function.
+ (mpn_gcd): New advertised gcd function, which calls
+ mpn_gcd_binary_odd or mpn_gcd_schoenhage, depending on the size of
+ the input.
+
+ * mpn/generic/hgcd.c (mpn_hgcd2_lehmer_step): Renamed function
+ (was lehmer_step), and made non-static. Updated callers.
+
+ * gmp-impl.h (GCD_LEHMER_THRESHOLD): #if:ed out this macro.
+ (mpn_hgcd2_lehmer_step): Added prototype.
+
+2003-11-27 Niels Möller <nisse@lysator.liu.se>
+
+ * tests/mpz/t-gcd.c (gcd_values): Moved definition, so that we
+ don't need to forward declare the array.
+
+2003-11-26 Niels Möller <nisse@lysator.liu.se>
+
+ * mpn/generic/hgcd.c (mpn_hgcd2_fix): Deleted duplicate definition
+ (the function belongs to hgcd2.c).
+
+2003-11-26 Torbjorn Granlund <tege@swox.com>
+
+ * tests/mpz/t-gcd.c: Generate random operands up to 32767 bits;
+ decrease # of test to 1000.
+ (gcd_values): Remove oversize test case.
+
+2003-11-26 Niels Möller <niels@lysator.liu.se>
+
+ * gmp-impl.h: Added name mangling for hgcd-related functions. Also
+ use __GMP_PROTO.
+ (MPN_LEQ_P, MPN_EXTRACT_LIMB): Moved macros to hgcd.c.
+ * mpn/generic/hgcd.c, mpn/generic/hgcd2.c, mpn/generic/qstack.c:
+ Adapted to name changes.
+
+ * tests/mpz/t-gcd.c (main): Added some tests with non-random
+ input.
+
+2003-11-25 Niels Möller <nisse@lysator.liu.se>
+
+ * gmp-impl.h (MPN_LEQ_P, MPN_EXTRACT_LIMB): New macros.
+ (struct qstack, struct hgcd2_row, struct hgcd2, struct hgcd_row)
+ (struct hgcd): New structs. Also added prototypes for new hgcd,
+ hgcd2, qstack and gcd functions.
+
+ * configure.in (gmp_mpn_functions): Added hgcd2, hgcd and qstack.
+
+ * mpn/Makefile.am (nodist_EXTRA_libmpn_la_SOURCES): Added hgcd2.c,
+ hgcd.c and qstack.c.
+
+ * mpn/generic/hgcd.c, mpn/generic/hgcd2.c, mpn/generic/qstack.c:
+ New files, needed for the sub-quadratic gcd.
+
+2003-11-25 Kevin Ryde <kevin@swox.se>
+
+ * doc/gmp.texi (Language Bindings): Add Axiom.
+
+2003-11-22 Kevin Ryde <kevin@swox.se>
+
+ * mpn/alpha/README: More notes on assembler syntax variations.
+
+ * mpn/alpha/alpha-defs.m4, mpn/alpha/unicos.m4 (unop): Should be ldq_u
+ not bis, and move to alpha-defs.m4 since it can be happily used
+ everywhere.
+
+ * mpn/alpha/alpha-defs.m4, mpn/alpha/default.m4, mpn/alpha/unicos.m4
+ (bigend): Move to alpha-defs.m4 and base it on HAVE_LIMB_BIG_ENDIAN or
+ HAVE_LIMB_LITTLE_ENDIAN, so as not to hard code system endianness.
+
+ * mpn/alpha/alpha-defs.m4: New file.
+ * configure.in (alpha*-*-*): Use it.
+
+2003-11-21 Kevin Ryde <kevin@swox.se>
+
+ * mpfr/*: Update to mpfr-2-0-2-branch 2003-11-21.
+
+ * mpn/alpha/ev5/com_n.asm: Change "not" to "ornot r31", since "not"
+ isn't recognised by on Cray Unicos. Add missing "gp" to PROLOGUE.
+ * mpn/alpha/README: Add a note on "not".
+
+2003-11-19 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/alpha/aorslsh1_n.asm: Slightly rework feed-in code, avoiding
+ spurious reads beyond operand limits.
+
+ * mpn/alpha/ev5/com_n.asm: Add ASM_START/ASM_END.
+
+ * mpn/generic/mul_fft.c (mpn_fft_zero_p): Remove unused function.
+ (mpn_lshift_com): Make static, nailify properly.
+
+2003-11-19 Kevin Ryde <kevin@swox.se>
+
+ * mpn/generic/diveby3.c: Use a "q" variable to make it clearer what
+ the code is doing.
+
+ * mpn/powerpc32/750/lshift.asm, mpn/powerpc32/750/rshift.asm: New
+ files.
+
+ * mpn/alpha/ev5/com_n.asm: New file.
+
+ * doc/gmp.texi (Assembler Functional Units, Assembler Writing Guide):
+ New sections by Torbjorn, tweaked by me.
+
+2003-11-17 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/powerpc32: Add power4/powerpc970 cycle counts.
+ Use cmpwi instead of cmpi to placate darwin.
+
+2003-11-15 Kevin Ryde <kevin@swox.se>
+
+ * config.guess: Add comments on MacOS "machine" command.
+
+ * tests/devel/try.c (main): Use gmp_randinit_default explicitly on
+ __gmp_rands, since RANDS doesn't allow seeding.
+
+ * doc/gmp.texi (Assigning Integers): Remove notes on possible change
+ to disallow whitespace, this would be an incompatible change and
+ really can't be made.
+ (Toom 3-Way Multiplication): Updates for Paul's new code.
+
+ * mpn/generic/mul_n.c (toom3_interpolate, mpn_toom3_mul_n): Put
+ if/else braces around whole of #if code, for readability.
+
+ * tests/refmpn.c (refmpn_addlsh1_n, refmpn_sublsh1_n,
+ refmpn_rsh1add_n, refmpn_rsh1sub_n): Add ASSERTs for operand overlaps
+ etc.
+
+ * mpfr/*: Update to mpfr-2-0-2-branch 2003-11-15.
+
+2003-11-14 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/alpha/aorslsh1_n.asm: Use Cray-friendly syntax for "br".
+
+2003-11-13 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/alpha/aorslsh1_n.asm: New file.
+
+2003-11-12 Kevin Ryde <kevin@swox.se>
+
+ * acinclude.m4 (GMP_PROG_CC_WORKS): Add case provoking AIX power2
+ assembler, test code by Torbjorn.
+ * configure.in (power*-*-*): Add a comment about -mcpu=rios2 fallback.
+
+ * tune/speed.c (main): Use gmp_randinit_default explicitly on
+ __gmp_rands, since RANDS doesn't allow seeding.
+
+ * mpfr/*: Update to mpfr-2-0-2-branch 2003-11-12.
+
+ * gmp-impl.h, randmt.h (__gmp_randinit_mt_noseed): Move prototype to
+ gmp-impl.h, for use by RANDS.
+
+ * mpn/Makeasm.am (.s, .S, .asm): Quote $< in test -f, per automake.
+ (.obj): Use test -f and $(CYGPATH_W) as per automake.
+
+2003-11-11 Kevin Ryde <kevin@swox.se>
+
+ * configure.in: Make umul and udiv standard-optional objects, rather
+ than under various extra_functions.
+
+ * mpn/pa32/hppa1_1/pa7100/add_n.asm,
+ mpn/pa32/hppa1_1/pa7100/addmul_1.asm,
+ mpn/pa32/hppa1_1/pa7100/lshift.asm,
+ mpn/pa32/hppa1_1/pa7100/rshift.asm,
+ mpn/pa32/hppa1_1/pa7100/sub_n.asm,
+ mpn/pa32/hppa1_1/pa7100/submul_1.asm: Use LDEF for labels.
+
+ * mpf/set_str.c: Don't use memcmp for decimal point testing, just a
+ loop is enough and avoids any chance of memcmp reading past the end of
+ the given string.
+
+ * randmts.c, randmt.h: New files.
+ * Makefile.am (libgmp_la_SOURCES): Add them.
+ * randmt.c: Move seeding to randmts.c, common defines in randmt.h.
+ * gmp-impl.h (RANDS): Use __gmp_randinit_mt_noseed.
+ * tests/misc.c (tests_rand_start): Use gmp_randinit_default
+ explicitly, not RANDS.
+
+ * mpn/ia64/ia64-defs.m4 (PROLOGUE_cpu): Use 32-byte alignment, for the
+ benefit of itanium 2.
+ * mpn/ia64/gcd_1.asm: Remove own .align 32.
+
+ * mpn/ia64/ia64-defs.m4 (ALIGN): New define, using IA64_ALIGN_OK.
+ * mpn/ia64/hamdist.asm: Use ALIGN instead of .align.
+
+ * acinclude.m4 (GMP_ASM_IA64_ALIGN_OK): New macro.
+ * configure.in (IA64_PATTERN): Use it.
+ * mpn/ia64/README: Add notes on gas big endian align problem.
+
+2003-11-10 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/ia64/mul_1.asm: Rewrite.
+
+2003-11-08 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/x86/aors_n.asm: Align loop to a multiple of 16. Also align
+ M4_function_n to a multiple of 16, to minimize alignment padding.
+ Update P6 cycle counts reflecting improvements with new alignment.
+
+2003-11-07 Kevin Ryde <kevin@swox.se>
+
+ * gmp-impl.h (HAVE_HOST_CPU_alpha_CIX): New define.
+ (ULONG_PARITY, popc_limb): Use it, to pick up ev7 as well as 67 and 68.
+ * longlong.h (count_leading_zeros, count_trailing_zeros): Ditto.
+
+ * doc/gmp.texi (Notes for Package Builds): Add notes on multi-ABI
+ system packaging.
+ (ABI and ISA): Add GNU/Linux ABI=64.
+ (Binary GCD): Add notes on 1x1 GCD algorithms.
+
+ * mpn/alpha/README: Add some literature references.
+
+ * mpn/ia64/mode1o.asm: Various corrections to initial checkin.
+ * mpn/ia64/ia64-defs.m4 (ASSERT): Correction to arg quoting.
+
+2003-11-05 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/powerpc64/linux64.m4: New file.
+ * configure.in (POWERPC64_PATTERN): Handle *-*-linux*.
+ Use linux64.m4.
+
+ * mpn/ia64/logops_n.asm: New file.
+
+2003-11-05 Kevin Ryde <kevin@swox.se>
+
+ * tune/freq.c (freq_sysctl_hw_model): Relax to just look for "%u MHz",
+ for the benefit of sparc cypress under netbsd 1.6.1.
+
+ * mpfr/*: Update to mpfr-2-0-2-branch 2003-11-05.
+
+ * mpn/alpha/ev5/dive_1.c: New file.
+
+ * configure.in (x86_64-*-*): Accept together with amd64-*-*.
+
+ * tune/speed.c: Check range of -x,-y,-w,-W alignment specifiers.
+ * tune/speed.h (CACHE_LINE_SIZE): Amend comments.
+
+2003-11-04 Torbjorn Granlund <tege@swox.com>
+
+ * tune/speed.c: Fix typo in testing HAVE_NATIVE_mpn_modexact_1_odd.
+
+2003-11-03 Kevin Ryde <kevin@swox.se>
+
+ * mpn/ia64/hamdist.asm: New file.
+ * mpn/ia64/mode1o.asm: New file.
+ * mpn/ia64/ia64-defs.m4 (ASSERT): New macro.
+
+ * tests/mpz/t-set_d.c (check_2n_plus_1): New test.
+
+2003-11-01 Kevin Ryde <kevin@swox.se>
+
+ * mpz/fac_ui.c (BSWAP_ULONG) [limb==2*long]: Remove this case, it
+ provokes code gen problems on HP cc.
+ (BSWAP_ULONG) [generic]: Rename __dst variable to avoid conflicts with
+ BITREV_ULONG.
+ Fix by Jason Moxham.
+
+ * mpn/powerpc32/mode1o.asm: Use 16-bit i*i for early out, no need to
+ truncate divisor. Amend stated 750/7400 speeds, and note operands
+ that give the extremes.
+
+ * mpz/set_d.c: Don't use a special case for d < MP_BASE_AS_DOUBLE, gcc
+ 3.3 -mpowerpc64 on darwin gets ulonglong->double casts wrong.
+
+ * mpn/generic/diveby3.c: Show a better style carry handling in the
+ alternative pipelined sample code.
+
+ Revert this, the longlong.h macros need -mpowerpc64:
+ * acinclude.m4 (GMP_GCC_POWERPC64): New macro.
+ * configure.in (powerpc64-*-darwin*): Use it to exclude -mpowerpc64
+ when bad.
+
+2003-10-31 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/powerpc64/mode64/submul_1.asm: Move an instruction to save a
+ cycle on POWER4.
+
+ * mpn/powerpc64/mode64/divrem_1.asm: Fix several syntax problems
+ revealed on Mac OS X.
+
+ * mpn/powerpc64/mode64/*.asm: Add cycle counts for POWER4.
+
+ * mpn/powerpc64/sqr_diagonal.asm: Rewrite to save a cycle on POWER4.
+
+2003-10-31 Kevin Ryde <kevin@swox.se>
+
+ * mpfr/*: Update to mpfr-2-0-2-branch 2003-10-31.
+
+ * mpn/powerpc64/README: Add subdirectory organisation notes.
+
+ * tests/mpn/t-get_d.c: Don't use limits.h, LONG_MIN is wrong on gcc
+ 2.95 with -mcpu=ultrasparc.
+
+ * acinclude.m4 (GMP_GCC_POWERPC64): New macro.
+ * configure.in (powerpc64-*-darwin*): Use it to exclude -mpowerpc64
+ when bad.
+
+ * configure.in (powerpc64-*-darwin*) [ABI=mode32]: Use gcc -mcpu flags.
+
+ * mpn/ia64/divrem_1.asm, mpn/ia64/gcd_1.asm: Use "C" for comments.
+ * mpn/ia64/README, mpn/ia64/ia64-defs.m4: Note this.
+
+ * mpn/ia64/ia64-defs.m4: Renamed from default.m4, per other defs files.
+ * configure.in (IA64_PATTERN): Update GMP_INCLUDE_MPN.
+
+ * doc/gmp.texi (Notes for Particular Systems): Remove m68k ABI notes
+ for -mshort and PalmOS, now works.
+ (References): Correction, GMP Square Root proof already there, just
+ wanting URL from RRRR 4475.
+
+2003-10-29 Kevin Ryde <kevin@swox.se>
+
+ * configure.in (sparc*-*-*): Use gcc -m32 when that option works, to
+ force 32-bit mode on dual 32/64 configurations like GNU/Linux.
+ (sparc64-*-linux*): Add support for ABI=64.
+
+ * mpn/generic/pre_divrem_1.c: In fraction part, use CNST_LIMB(0) with
+ udiv_qrnnd_preinv to avoid warning about shift > type.
+
+ * mpfr/*: Update to mpfr-2-0-2-branch 2003-10-29.
+
+ * tests/cxx/t-istream.cc: Avoid tellg() checks if putback() doesn't
+ update that, avoids certain g++ 2.96 problems.
+
+ * tests/mpn/t-fat.c: New file.
+ * tests/mpn/Makefile.am (check_PROGRAMS): Add it.
+
+ * configure.in (CPUVEC_INSTALL, ITERATE_FAT_THRESHOLDS): New macros
+ for fat.h.
+ * mpn/x86/fat/fat.c (__gmpn_cpuvec_init): Use CPUVEC_INSTALL instead
+ of memcpy. Correction to location of "initialized" set. Improve
+ various comments.
+
+2003-10-27 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/sparc64/mul_1.asm: Change addcc => add in a few places.
+ * mpn/sparc64/addmul_1.asm: Likewise.
+
+ * mpn/sparc32/v9/mul_1.asm: Apply cross-jumping.
+ * mpn/sparc32/v9/addmul_1.asm: Likewise.
+ * mpn/sparc32/v9/submul_1.asm: Likewise.
+ * mpn/sparc32/v9/sqr_diagonal.asm: Likewise.
+
+2003-10-27 Kevin Ryde <kevin@swox.se>
+
+ * tests/cxx/t-misc.cc: Don't use <climits>, on g++ 2.95.4 (debian 3.0)
+ -mcpu=ultrasparc LONG_MIN is wrong and kills the compile.
+
+ * tests/cxx/t-istream.cc: Correction to tellg tests, don't assume
+ streampos is zero based.
+
+ * configure.in (HAVE_HOST_CPU_FAMILY_alpha): New define for config.h.
+ * mpn/generic/get_d.c: Use it instead of __alpha for alpha workaround,
+ since Cray cc doesn't define __alpha.
+
+ * mpn/x86/README: Revise PIC coding notes a bit, add gcc visibility
+ attribute.
+
+2003-10-25 Kevin Ryde <kevin@swox.se>
+
+ * mpn/ia64/gcd_1.asm: New file.
+
+ * tune/many.pl: Allow for PROLOGUE(fun,...), as used on alpha.
+
+ * doc/gmp.texi (C++ Formatted Input): Describe base indicator handling.
+
+ * tests/cxx/t-istream.cc: New file.
+ * tests/cxx/Makefile.am: Add it.
+
+ * cxx/ismpznw.cc: New file, integer input without whitespace ...
+ * cxx/ismpz.cc: ... from here.
+ * gmp-impl.h (__gmpz_operator_in_nowhite): Add prototype.
+ * cxx/ismpq.cc: Rewrite using mpz input routines. Change to accept a
+ separate base indicator on numerator and denominator. Fix base
+ indicator case where "123/0456" would stop at "123/0".
+ * Makefile.am, cxx/Makefile.am: Add cxx/ismpznw.cc.
+
+ * tests/mpz/t-set_d.c: New file, derived from tests/mpz/t-set_si.c
+ * tests/mpz/Makefile.am (check_PROGRAMS): Add it.
+
+ * mpn/m68k/lshift.asm, mpn/m68k/rshift.asm: Support 16-bit int and
+ stack alignment.
+ * mpn/m68k/README: Add notes on this.
+ * configure.in (SIZEOF_UNSIGNED): New define in config.m4.
+ * mpn/m68k/m68k-defs.m4 (m68k_definsn): Add cmpw, movew.
+ Reported by Patrick Pelissier.
+
+ * mpn/m68k/t-m68k-defs.pl: Don't use -> with hashes, to avoid
+ deprecation warnings from perl 5.8.
+
+ * configure.in (viac3-*-*): Use just x86/pentium in $path not x86/p6.
+ If gcc is to be believed the old C3s don't have cmov.
+
+ * Makefile.am: Amend comments about not building from libtool
+ convenience libraries.
+
+ * mpn/asm-defs.m4 (PROLOGUE): Use m4_file_seen, for correct filename
+ in missing EPILOGUE error messages.
+ (m4_file_seen): Amend comments about where used.
+
+ * Makefile.am (CXX_OBJECTS): Remove $U, C++ files are not subject to
+ ansi2knr rules.
+
+ * gmp-h.in (mpn_divmod_1): Use __GMP_CAST, to avoid warnings in
+ applications using g++ -Wold-style-cast.
+
+ * mpn/z8000/README: New file.
+
+2003-10-22 Kevin Ryde <kevin@swox.se>
+
+ * mpn/generic/get_d.c (CONST_1024, CONST_NEG_1023,
+ CONST_NEG_1022_SUB_53): Replace ALPHA_WORKAROUND with a non-gcc-ism,
+ and use on Cray Unicos alpha too, which has the same problem.
+
+ * configure.in (powerpc64-*-darwin*): Make ABI=32 available as the
+ final fallback, remove mode64 until we know how it will work.
+
+ * doc/gmp.texi (Build Options): Add powerpc970 to available CPUs.
+ (ABI and ISA): Add mode32 for Darwin.
+
+ * configure.in (gettimeofday): Use an explicit AC_TRY_LINK, to avoid
+ known autoconf 2.57 problems with gettimeofday in AC_CHECK_FUNCS on
+ HP-UX.
+
+ * configure.in (powerpc*-*-*): Use ABI=32 instead of ABI=standard for
+ the default 32-bit ABI. Fixes powerpc64-*-aix* which is documented as
+ choices "aix64 32" but had "aix64 standard".
+
+ * mpfr/*: Update to mpfr-2-0-2-branch 2003-10-22.
+
+ * doc/gmp.texi (Notes for Particular Systems): Note m68k gcc -mshort
+ and PalmOS calling conventions not supported. Reported by Patrick
+ Pelissier.
+ (References): Add Paul Zimmermann's Inria 4475 paper.
+
+2003-10-21 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/ia64/submul_1.asm: Slightly reschedule loop to accommodate
+ Itanium 2 getf.sig latency.
+
+2003-10-21 Kevin Ryde <kevin@swox.se>
+
+ * tests/mpn/t-instrument.c: Add mpn_addlsh1_n, mpn_rsh1add_n,
+ mpn_rsh1sub_n, mpn_sub_nc, mpn_sublsh1_n. Typo in mpn_preinv_divrem_1
+ conditional.
+
+2003-10-20 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/powerpc64/mode32/add_n.asm: New file.
+ * mpn/powerpc64/mode32/sub_n.asm: New file.
+ * mpn/powerpc64/mode32/mul_1.asm: New file.
+ * mpn/powerpc64/mode32/addmul_1.asm: New file.
+ * mpn/powerpc64/mode32/submul_1.asm: New file.
+
+2003-10-19 Torbjorn Granlund <tege@swox.com>
+
+ * longlong.h (AMD64): __x86_64__ => __amd64__.
+ (64-bit powerpc): Only define carry-dependent macros if
+ !_LONG_LONG_LIMB.
+
+ * acinclude.m4 (POWERPC64_PATTERN): Add powerpc970-*-*.
+
+ * configure.in (POWERPC64_PATTERN): Handle *-*-darwin*.
+ (POWERPC64_PATTERN, *-*-aix*): Prepend powerpc64/mode64 to path_aix64.
+
+ * mpn/powerpc64/mode64/mul_1.asm: Change cal => addi.
+ * mpn/powerpc64/mode64/addmul_1.asm: Likewise.
+ * mpn/powerpc64/mode64/submul_1.asm: Likewise.
+ * mpn/powerpc64/sqr_diagonal.asm: Likewise.
+
+ * mpn/powerpc64/mode64/mul_1.asm: Move from "..".
+ * mpn/powerpc64/mode64/addmul_1.asm: Likewise.
+ * mpn/powerpc64/mode64/submul_1.asm: Likewise.
+ * mpn/powerpc64/mode64/divrem_1.asm: Likewise.
+ * mpn/powerpc64/mode64/rsh1sub_n.asm: Likewise.
+ * mpn/powerpc64/mode64/add_n.asm: Likewise.
+ * mpn/powerpc64/mode64/addsub_n.asm: Likewise.
+ * mpn/powerpc64/mode64/sub_n.asm: Likewise.
+ * mpn/powerpc64/mode64/addlsh1_n.asm: Likewise.
+ * mpn/powerpc64/mode64/diveby3.asm: Likewise.
+ * mpn/powerpc64/mode64/rsh1add_n.asm: Likewise.
+ * mpn/powerpc64/mode64/sublsh1_n.asm: Likewise.
+
+ * mpn/powerpc64/lshift.asm: Handle mode32 ABI.
+ * mpn/powerpc64/rshift.asm: Likewise.
+ * mpn/powerpc64/umul.asm: Likewise.
+
+ * tune/powerpc64.asm: Make it actually work.
+
+2003-10-19 Kevin Ryde <kevin@swox.se>
+
+ * mpn/generic/get_d.c: Add a workaround for alpha gcc signed constant
+ comparison bug.
+
+ * gmpxx.h (gmp_randclass gmp_randinit_lc_2exp_size constructor): Throw
+ std::length_error if size is too big.
+ * tests/cxx/t-rand.cc (check_randinit): Exercise this.
+
+ * mpn/x86/pentium4/sse2/addlsh1_n.asm: New file, derived in part from
+ mpn/x86/pentium4/sse2/add_n.asm.
+
+ * doc/gmp.texi (C++ Interface Integers, C++ Interface Rationals, C++
+ Interface Floats): Note std::invalid_argument exception for invalid
+ strings to constructors and operator=.
+ (C++ Interface Random Numbers): Note std::length_error exception for
+ size too big in gmp_randinit_lc_2exp_size.
+
+2003-10-18 Kevin Ryde <kevin@swox.se>
+
+ * mpfr/*: Update to mpfr-2-0-2-branch 2003-10-18.
+
+ * gmpxx.h (mpz_class, mpq_class, mpf_class, mpfr_class constructors
+ and operator= taking string or char*): Throw std::invalid_argument if
+ string cannot be converted.
+ * tests/cxx/t-constr.cc, tests/cxx/t-assign.cc: Exercise this.
+
+ * cxx/ismpz.cc, cxx/ismpq.cc, cxx/ismpf.cc: Use istream std::locale
+ ctype facet for isspace when available. Only accept space at the
+ start of the input, same as g++ libstdc++. Use ASSERT_NOCARRY to
+ check result of mpz_set_str etc.
+ * cxx/ismpf.cc: Don't accept "@" for exponent indicator.
+
+ * tune/speed.c, tune/speed.h, tune/common.c, tune/Makefile.am: Remove
+ _open and _mpn variants of mpn_toom3_mul_n, only one style now.
+ * tune/mul_n_open.c, tune/mul_n_mpn.c: Remove files.
+
+ * gmp-impl.h (LIMB_HIGHBIT_TO_MASK): New macro.
+ (udiv_qrnnd_preinv2, udiv_qrnnd_preinv2gen): Use it.
+
+ * tests/mpz/t-import.c, tests/mpz/t-export.c: Use octal for character
+ constants, hex is an ANSI-ism.
+
+ * mpn/alpha/ev5/mode1o.c: Corrections to ASSERTs, as per
+ mpn/generic/mode1o.c.
+
+ * mpn/generic/diveby3.c: Add commented out alternative code and notes
+ for taking the multiply off the dependent chain. Amend/clarify some
+ of the other comments.
+
+ * configure.in (powerpc970-*-*): Use gcc -mcpu=970 when available.
+ (powerpc7400-*-*): Fallback on gcc -mcpu=750 if -mcpu=7400 not
+ available.
+
+ * doc/gmp.texi (C++ Formatted Input): Note locale digit grouping not
+ supported.
+ (C++ Formatted Input, C++ Formatted Output): Cross reference class
+ interface on overloading.
+
+ * mpn/m68k/README: Add various ideas from doc/tasks.html.
+
+ * mpn/m88k/README: New file.
+
+2003-10-16 Torbjorn Granlund <tege@swox.com>
+
+ * config.sub: Recognize powerpc970.
+
+2003-10-15 Torbjorn Granlund <tege@swox.com>
+
+ * config.guess: Recognize powerpc970 under MacOS.
+
+2003-10-15 Kevin Ryde <kevin@swox.se>
+
+ * configure.in, acinclude.m4 (GMP_C_RIGHT_SHIFT): New test.
+ * gmp-impl.h (LIMB_HIGHBIT_TO_MASK): New macro.
+ (udiv_qrnnd_preinv2, udiv_qrnnd_preinv2gen): Use it.
+
+ * mpn/amd64/amd64-defs.m4: New file, with a non-aligning PROLOGUE.
+ * configure.in (amd64-*-*): Use it.
+ * mpn/amd64/addlsh1_n.asm: Add ALIGN(16).
+
+ * mpfr/*: Update to mpfr cvs 2003-10-15.
+
+ * mpn/generic/get_d.c: Rewrite, simplifying and truncating towards
+ zero unconditionally.
+ * tests/mpn/t-get_d.c: Add various further tests.
+ * gmp-impl.h (FORCE_DOUBLE): New macro.
+
+ * gmp-h.in (__mpz_struct): Add comment on __mpz_struct getting into
+ C++ mangled function names.
+
+ * doc/gmp.texi (Build Options): Update notes for new doc subdir.
+ (Low-level Functions): Note mpn functions don't check for zero limbs
+ etc, it's up to an application to strip.
+
+ * doc/configuration (Configure): mdate-sh now in doc subdir, add
+ generated fat.h.
+
+2003-10-14 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/ia64/lorrshift.asm: Rewrite.
+
+ * mpn/ia64/diveby3.asm: Remove explicit bundling; add branch hints.
+
+2003-10-13 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/ia64/diveby3.asm: New file.
+
+2003-10-13 Kevin Ryde <kevin@swox.se>
+
+ * mpn/powerpc32/mod_34lsub1.asm: New file.
+
+ * mpn/powerpc32/diveby3.asm, mpn/powerpc64/diveby3.asm: src[] in
+ second operand of mullw, to allow possible early-out, which the
+ 0xAA..AB inverse cannot give. This improvement noticed by Torbjorn.
+
+ * acinclude.m4 (GMP_ASM_LSYM_PREFIX): Print to config.log whether
+ local label is purely temporary or appears in object files, for
+ development purposes.
+
+ * doc/gmp.texi, doc/fdl.texi, doc/texinfo.tex, doc/mdate-sh: Moved
+ from top-level.
+ * doc/Makefile.am: New file.
+ * configure.in (AC_OUTPUT): Add doc/Makefile.
+ * Makefile.am (SUBDIRS): Move doc subdirectory from EXTRA_DIST.
+ (info_TEXINFOS, gmp_TEXINFOS): Moved to doc/Makefile.am.
+ * mpfr/Makefile.am (mpfr_TEXINFOS): fdl.texi now in doc subdir.
+ (TEXINFO_TEX): texinfo.tex now in doc subdir.
+ (AM_MAKEINFOFLAGS): Set -I to doc subdir.
+
+ * mpz/and.c: For positive/positive, use mpn_and_n, rate a realloc as
+ UNLIKELY.
+
+ * mpn/generic/mul_n.c (mpn_toom3_mul_n, mpn_toom3_sqr_n): Don't test
+ for high zero limbs.
+
+2003-10-12 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/powerpc64/diveby3.asm: New file (trivial edits of
+ powerpc32/diveby3.asm).
+
+ * mpn/powerpc32/diveby3.asm: Update cycle counts with more processors.
+ * mpn/powerpc32/sqr_diagonal.asm: Likewise.
+
+ * mpn/pa64/add_n.asm: Correct PA8500 cycle counts.
+ * mpn/pa64/sub_n.asm: Likewise.
+
+ * mpn/m68k/aors_n.asm (INPUT PARAMETERS): Fix typo.
+ * mpn/m68k/lshift.asm: Likewise.
+ * mpn/m68k/rshift.asm: Likewise.
+
+ * mpn/m68k/README: Correct an URL; add some STATUS comments.
+
+ * mpn/ia64/aorslsh1_n.asm: Avoid shrp when shl/shr works just as well.
+
+ * mpn/powerpc32/addlsh1_n.asm: New file.
+ * mpn/powerpc32/sublsh1_n.asm: New file.
+
+2003-10-12 Kevin Ryde <kevin@swox.se>
+
+ * mpn/sparc64/divrem_1.c, mpn/sparc64/mod_1.c: New files.
+ * mpn/sparc64/sparc64.h (HALF_ENDIAN_ADJ, count_leading_zeros_32,
+ invert_half_limb, udiv_qrnnd_half_preinv): New macros.
+
+ * gmp-impl.h (udiv_qrnnd_preinv2): Use a ? : for getting the n1 bit,
+ so as not to depend on signed right shifts being arithmetic.
+
+ * mpn/powerpc32/diveby3.asm: New file.
+
+ * mpn/generic/divrem_1.c: Use CNST_LIMB(0) to avoid warnings from
+ udiv_qrnnd_preinv about shift count when int<long. Do the same with
+ udiv_qrnnd, for consistency.
+
+ * Makefile.am (install-data-hook): Print a warning recommending "make
+ check" to watch out for compiler bugs. Proposed by Torbjorn.
+
+ * mpn/ia64/README (mpn_lshift, mpn_rshift): Amend prospective itanium2
+ speed, 0.75 c/l with shrp plus shl/shr.
+
+ * mpn/ia64/popcount.asm: Add comment on optimality.
+
+2003-10-11 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/ia64/rsh1aors_n.asm: New file.
+
+ * mpn/asm-defs.m4: Handle rsh1aors_n.
+
+ * configure.in (tmp_mulfunc): Handle rsh1aors_n.
+
+2003-10-11 Kevin Ryde <kevin@swox.se>
+
+ * mpn/x86/pentium4/sse2/diveby3.asm: Remove non-PIC RODATA memory
+ access for 0xAAAAAAAB constant.
+
+ * gmp-impl.h (popc_limb, ULONG_PARITY) [ev67, ev68]: Add gcc asm
+ versions using ctpop.
+
+ * mpn/x86/k6/aorsmul_1.asm: Tweak some comments, remove M4_description
+ and M4_desc_retval used only in comments.
+
+ * mpn/x86/k6/mul_basecase.asm: Add comment on using mpn_mul_1.
+
+2003-10-09 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/powerpc64/addlsh1_n.asm: Tweak for 0.25 c/l better loop speed.
+ * mpn/powerpc64/sublsh1_n.asm: Likewise.
+
+2003-10-09 Kevin Ryde <kevin@swox.se>
+
+ * mpfr/*: Update to mpfr cvs 2003-10-09.
+
+ * tests/devel/try.c (_SC_PAGESIZE): Define from _SC_PAGE_SIZE on
+ systems which use that, eg. hpux 9.
+
+2003-10-07 Kevin Ryde <kevin@swox.se>
+
+ * tune/freq.c (freq_sysctl_hw_model): Correction to last sscanf change.
+
+ * configure.in: Check for psp_iticksperclktick in struct pst_processor.
+ * tune/freq.c (freq_pstat_getprocessor): Use this.
+
+ * tests/devel/try.c (divisor_array): Add a couple of half-limb values.
+
+ * acinclude.m4 (GMP_PROG_CC_WORKS): Correction to last change, need to
+ set result "yes" when cross compiling.
+
+2003-10-06 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/generic/mul_n.c: Use __GMPN_ADD_1/_GMPN_SUB_1 instead of
+ mpn_add_1 and mpn_sub_1.
+
+ * mpn/pa64/aorslsh1_n.asm: Schedule register save and restore code.
+
+2003-10-05 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/pa64/mul_1.asm: Misc comment cleanups.
+ * mpn/pa64/addmul_1.asm: Likewise.
+ * mpn/pa64/submul_1.asm: Likewise.
+
+ * mpn/pa64/README: Correct cycle counts.
+
+ * mpn/pa64/aorslsh1_n.asm: New file.
+
+2003-10-04 Kevin Ryde <kevin@swox.se>
+
+ * tune/freq.c (freq_sysctl_hw_model, freq_sunos_sysinfo,
+ freq_sco_etchw, freq_bsd_dmesg, freq_irix_hinv): Demand matching of
+ MHz etc at end of sscanf format string. In particular need this for
+ freq_bsd_dmesg on i486-pc-freebsd4.7 to avoid the 486 cpu being used
+ for the frequency.
+
+ * tests/misc.c, tests/tests.h (tests_setjmp_sigfpe,
+ tests_sigfpe_handler, tests_sigfpe_done, tests_sigfpe_target,
+ tests_dbl_mant_bits): New.
+
+ * configure.in (viac3*-*-*): Add gcc VIA c3 options.
+
+ * mpfr/*: Update to mpfr cvs 2003-10-04.
+
+ * tests/refmpn.c (refmpn_addlsh1_n, refmpn_sublsh1_n,
+ refmpn_rsh1add_n, refmpn_rsh1sub_n): Add ASSERTs for operand overlaps.
+ * tests/tests.h (refmpn_addlsh1_n, refmpn_sublsh1_n, refmpn_rsh1add_n,
+ refmpn_rsh1sub_n): Add prototypes.
+
+ * tests/devel/try.c, tune/many.pl: Add mpn_addlsh1_n, mpn_sublsh1_n,
+ mpn_rsh1add_n, mpn_rsh1sub_n.
+
+2003-10-03 Torbjorn Granlund <tege@swox.com>
+
+ * tests/refmpn.c (refmpn_addlsh1_n, refmpn_sublsh1_n, refmpn_rsh1add_n,
+ refmpn_rsh1sub_n): New functions.
+
+2003-10-03 Paul Zimmermann <Paul.Zimmermann@loria.fr>
+
+ * mpn/generic/mul_n.c (toom3_interpolate): Use mpn_add_1/mpn_sub_1
+ instead of MPN_INCR_/MPN_DECR_U.
+
+2003-10-02 Torbjorn Granlund <tege@swox.com>
+
+ * configure.in (ia64*-*-hpux*): Fall back to +O1, not +O.
+
+2003-10-02 Kevin Ryde <kevin@swox.se>
+
+ * configure.in (ia64*-*-hpux*): For cc, let +O optimization level
+ fallback if +O3 doesn't work.
+
+ * acinclude.m4 (GMP_PROG_CC_WORKS): Add a test of __builtin_alloca
+ when available, to pick up Itanium HP-UX cc internal errors in +O2.
+ Provoking code by Torbjorn.
+
+2003-10-01 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/ia64/gmp-mparam.h: Retune.
+
+ * mpn/asm-defs.m4: Handle aorslsh1_n.
+
+ * configure.in (tmp_mulfunc): Handle aorslsh1_n.
+
+ * mpn/ia64/aorslsh1_n.asm: New file.
+
+ * mpn/ia64/aors_n.asm: New file, complete rewrite of mpn_add_n and
+ mpn_sub_n.
+ * mpn/ia64/add_n.asm: Replace by aors_n.asm.
+ * mpn/ia64/sub_n.asm: Replace by aors_n.asm.
+
+2003-10-01 Kevin Ryde <kevin@swox.se>
+
+ * acinclude.m4 (GMP_C_DOUBLE_FORMAT): Make bad ARM last byte into a
+ separate case and consider it non-IEEE, since it looks like this is
+ due to some sort of restricted or incorrect software floats.
+
+ * demos/calc/Makefile.am: Use automake yacc/lex support, seems fine in
+ separate objdir now.
+
+ * cxx/dummy.cc: Moved from top-level dummy.cc.
+ * Makefile.am (libgmpxx_la_SOURCES): Update to cxx/dummy.cc,
+ correction to comment about this.
+
+2003-09-30 Torbjorn Granlund <tege@swox.com>
+
+ * demos/pexpr.c: Correct documentation of -split.
+ (TIME): Remove cast of result to double.
+ (main): Change timing variables to int.
+ (main): #ifdef LIMIT_RESOURCE_USAGE, don't convert numbers of more than
+ 100000 digits.
+
+2003-09-28 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/*/*.asm: Clean up spacing, tabify.
+
+ * mpn/alpha/rshift.asm: Table cycle counts.
+ * mpn/alpha/lshift.asm: Likewise.
+ * mpn/alpha/ev5/rshift.asm: Likewise.
+ * mpn/alpha/ev5/lshift.asm: Likewise.
+ * mpn/alpha/ev6/add_n.asm: Likewise.
+ * mpn/alpha/ev6/sub_n.asm: Likewise.
+
+ * mpn/ia64/lorrshift.asm: Amend comments about performance.
+
+ * mpn/pa64/mul_1.asm: Fix comment typo.
+ * mpn/pa64/addmul_1.asm: Likewise.
+ * mpn/pa64/submul_1.asm: Likewise.
+
+ * mpn/amd64/addlsh1_n.asm: Save/restore carry using two insn to break
+ recurrency. Add remarks about possible further speedup.
+ * mpn/amd64/sublsh1_n.asm: Likewise.
+
+ * mpn/amd64/rsh1add_n.asm: Add remarks about possible further speedup.
+ * mpn/amd64/rsh1sub_n.asm: Likewise.
+
+2003-09-27 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/powerpc64/README: Update with POWER4/PPC970 pipeline info.
+
+ * mpn/powerpc64/rsh1add_n.asm: New file.
+ * mpn/powerpc64/rsh1sub_n.asm: New file.
+ * mpn/powerpc64/rshift.asm: Rewrite.
+ * mpn/powerpc64/lshift.asm: Rewrite.
+
+2003-09-26 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/powerpc64/addlsh1_n.asm: New file.
+ * mpn/powerpc64/sublsh1_n.asm: New file.
+
+2003-09-25 Torbjorn Granlund <tege@swox.com>
+
+ * tune/common.c (speed_mpn_addlsh1_n, speed_mpn_sublsh1_n,
+ speed_mpn_rsh1add_n, speed_mpn_rsh1sub_n): Conditionalize on
+ corresponding HAVE_NATIVE_*.
+
+2003-09-25 Kevin Ryde <kevin@swox.se>
+
+ * mpz/combit.c: Use GMP_NUMB_BITS not BITS_PER_MP_LIMB.
+
+ * demos/expr/exprfr.c: Allow for mpfr_inf_p, mpfr_nan_p and
+ mpfr_number_p merely returning non-zero, rather than 1 or 0.
+
+ * demos/expr/exprfr.c, demos/expr/t-expr.c: Add erf, integer_p, zeta.
+
+ * demos/expr/Makefile.am (LDADD): Update comments on $(LIBM).
+
+2003-09-24 Torbjorn Granlund <tege@swox.com>
+
+ * tune/speed.c (routine): Add entries for mpn_addlsh1_n, mpn_sublsh1_n,
+ mpn_rsh1add_n, and mpn_rsh1sub_n.
+
+ * tune/speed.h: Declare speed_mpn_addlsh1_n, speed_mpn_sublsh1_n,
+ speed_mpn_rsh1add_n, and speed_mpn_rsh1sub_n.
+
+ * tune/common.c (speed_mpn_addlsh1_n, speed_mpn_sublsh1_n,
+ speed_mpn_rsh1add_n, speed_mpn_rsh1sub_n): New functions.
+
+ * gmp-impl.h: Declare mpn_addlsh1_n, mpn_sublsh1_n, mpn_rsh1add_n, and
+ mpn_rsh1sub_n.
+
+ * mpn/asm-defs.m4: Add define_mpn's for addlsh1_n, sublsh1_n,
+ rsh1add_n, and rsh1sub_n.
+
+ * mpn/powerpc64/*.asm: Add cycle counts in consistent style. Misc
+ styling edits.
+
+ * mpn/amd64/gmp-mparam.h: Retune.
+
+ * configure.in: Add #undefs for HAVE_NATIVE_mpn_addlsh1_n,
+ HAVE_NATIVE_mpn_sublsh1_n, HAVE_NATIVE_mpn_rsh1add_n,
+ HAVE_NATIVE_mpn_rsh1sub_n.
+ (gmp_mpn_functions_optional): List addlsh1_n, sublsh1_n, rsh1add_n,
+ and rsh1sub_n.
+
+ * mpn/amd64/addlsh1_n.asm: New file.
+ * mpn/amd64/sublsh1_n.asm: New file.
+ * mpn/amd64/rsh1add_n.asm: New file.
+ * mpn/amd64/rsh1sub_n.asm: New file.
+
+2003-09-24 Kevin Ryde <kevin@swox.se>
+
+ * mpfr/*: Update to mpfr cvs 2003-09-24.
+
+ * acinclude.m4 (GMP_C_DOUBLE_FORMAT): Remove conftest* temporary files.
+
+2003-09-23 Torbjorn Granlund <tege@swox.com>
+
+ * gmp-impl.h (MUL_TOOM3_THRESHOLD, SQR_TOOM3_THRESHOLD): Now 128.
+
+2003-09-23 Kevin Ryde <kevin@swox.se>
+
+ * gmp-h.in (gmp_randinit_set): Use __gmp_const rather than const.
+
+2003-09-22 Torbjorn Granlund <tege@swox.com>
+
+ * tune/mul_n_mpn.c: (__gmpn_sqr_n): New #define.
+ * tune/mul_n_open.c (__gmpn_sqr_n): New #define.
+
+ * mpn/generic/mul.c (mpn_sqr_n): Move from here...
+ * mpn/generic/mul_n.c (mpn_sqr_n): ...to here.
+ (mpn_sqr_n): Allocate workspace for toom3 using TMP_* mechanism except
+ for very large operands when !WANT_FFT.
+
+ * mpn/generic/mul_n.c: Add a missing ";". Misc comment fixes.
+
+ * mpn/generic/mul.c: Remove spurious #include <stdio.h>.
+
+ * mpn/x86/k7/gmp-mparam.h: Retune.
+
+ * mpn/generic/mul_n.c (mpn_mul_n): Allocate workspace for toom3 using
+ TMP_* mechanism except for very large operands when !WANT_FFT.
+
+ * gmp-impl.h (MPN_TOOM3_MUL_N_TSIZE, MPN_TOOM3_SQR_N_TSIZE):
+ Define conditionally on WANT_FFT and HAVE_NATIVE_mpn_sublsh1_n.
+ (MPN_TOOM3_MAX_N): New #define.
+
+ * mpn/amd64/gmp-mparam.h: Retune.
+
+ * mpn/Makefile.am (TARG_DIST): Add amd64.
+
+ * mpn/generic/sqr_basecase.c: Use mpn_addlsh1_n when available.
+
+ * mpn/generic/mul_n.c: Use proper form for HAVE_NATIVE macros.
+
+2003-09-22 Kevin Ryde <kevin@swox.se>
+
+ * mpfr/*: Update to mpfr cvs 2003-09-22.
+
+2003-09-21 Kevin Ryde <kevin@swox.se>
+
+ * mpn/x86/pentium4/sse2/gmp-mparam.h (USE_PREINV_DIVREM_1,
+ USE_PREINV_MOD_1): Set to 1 for new asm versions.
+
+ * mpfr/*: Update to mpfr cvs 2003-09-21.
+
+2003-09-21 Paul Zimmermann <Paul.Zimmermann@loria.fr>
+
+ * mpn/generic/mul_n.c (mpn_toom3_mul_n): Conditionally use
+ mpn_sublsh1_n, mpn_rsh1add_n and mpn_rsh1sub_n, in addition to
+ mpn_addlsh1_n. Avoid all copying, at the expense of some additional
+ workspace.
+
+ * gmp-impl.h (MPN_TOOM3_MUL_N_TSIZE, MPN_TOOM3_SQR_N_TSIZE): Accommodate
+ latest toom3 code.
+
+2003-09-19 Kevin Ryde <kevin@swox.se>
+
+ * mpn/x86/pentium4/sse2/divrem_1.asm, mpn/x86/pentium4/sse2/mod_1.asm:
+ New files.
+
+2003-09-16 Kevin Ryde <kevin@swox.se>
+
+ * tune/speed.c (run_one): Don't scale the -1.0 not-available return.
+ Print "n/a" for times not-available.
+
+2003-09-13 Paul Zimmermann <Paul.Zimmermann@loria.fr>
+
+ * mpn/generic/mul_n.c (toom3_interpolate): New function.
+ (mpn_toom3_mul_n, mpn_toom3_sqr_n): Call toom3_interpolate.
+
+2003-09-12 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/generic/mul_n.c (mpn_toom3_mul_n, mpn_toom3_sqr_n): Remove unused
+ variables.
+ (mpn_toom3_mul_n, mpn_toom3_sqr_n): Use offset `+ 1', not `+ 2' in last
+ MPN_DECR_U calls.
+
+2003-09-12 Paul Zimmermann <Paul.Zimmermann@loria.fr>
+
+ * mpn/generic/mul_n.c (mpn_toom3_mul_n, mpn_toom3_sqr_n): Rewrite.
+
+2003-09-12 Torbjorn Granlund <tege@swox.com>
+
+ * gmp-impl.h (MPN_KARA_MUL_N_TSIZE, MPN_KARA_SQR_N_TSIZE): Reformulate
+ to use the same form as MPN_TOOM3_MUL_N_TSIZE.
+ (MPN_TOOM3_MUL_N_TSIZE, MPN_TOOM3_SQR_N_TSIZE): Update for new Toom3
+ code requirements.
+ * mpn/generic/mul_n.c (evaluate3, interpolate3, add2Times): Remove.
+ (USE_MORE_MPN): Remove.
+
+2003-08-31 Kevin Ryde <kevin@swox.se>
+
+ * mpfr/*: Update to mpfr cvs 2003-08-31.
+
+2003-08-30 Kevin Ryde <kevin@swox.se>
+
+ * mpfr/*: Update to mpfr cvs 2003-08-30.
+
+2003-08-29 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/amd64/copyi.asm: New file.
+ * mpn/amd64/copyd.asm: New file.
+ * mpn/amd64/README: New file.
+
+2003-08-28 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/amd64/lshift.asm: New file.
+ * mpn/amd64/rshift.asm: New file.
+ * mpn/amd64/gmp-mparam.h: Retune.
+
+2003-08-23 Kevin Ryde <kevin@swox.se>
+
+ * tune/freq.c (freq_getsysinfo): Correction to speed_cycletime value
+ established.
+
+ * mpz/rootrem.c, gmp-h.in, gmp.texi (mpz_rootrem): Don't return
+ exactness indication, can get that from testing the remainder.
+
+ * mpn/x86/k7/aors_n.asm, mpn/x86/k7/mmx/copyi.asm: Amend to comments
+ about loads and stores and what speed should be possible.
+
+2003-08-22 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/amd64/add_n.asm: New file.
+ * mpn/amd64/sub_n.asm: New file.
+ * mpn/amd64/mul_1.asm: New file.
+ * mpn/amd64/addmul_1.asm: New file.
+ * mpn/amd64/submul_1.asm: New file.
+
+2003-08-19 Kevin Ryde <kevin@swox.se>
+
+ * longlong.h (add_ssaaaa, sub_ddmmss) [hppa 64]: Move down into main
+ __GNUC__ block. Exclude for _LONG_LONG_LIMB (ie. ABI=2.0n) since
+ these forms are only for ABI=2.0w.
+
+ * longlong.h (count_leading_zeros) [__mcpu32__]: Check __mcpu32__ to
+ avoid bfffo on GCC 3.4 in CPU32 mode. Reported by Bernardo Innocenti.
+
+ * longlong.h (count_trailing_zeros) [x86_64]: Use "%q0" to force
+ 64-bit register destination. Pointed out by Torbjorn.
+
+ * mpz/combit.c: Correction to carry handling when extending a
+ negative, and use __GMPN_ADD_1. Correction to complement limb for a
+ negative when there's a non-zero low limb.
+ * tests/mpz/bit.c (check_clr_extend, check_com_negs): Exercise these.
+
+ * demos/perl/GMP.xs, demos/perl/GMP.pm, demos/perl/test.pl: Add
+ get_d_2exp.
+ * demos/perl/GMP.xs, demos/perl/GMP.pm, demos/perl/GMP/Rand.pm,
+ demos/perl/test.pl: Add gmp_urandomb_ui, gmp_urandomm_ui.
+ (GMP::Rand::randstate): Accept a randstate object to copy.
+ * demos/perl/GMP.xs, demos/perl/GMP.pm, demos/perl/GMP/Mpz.pm,
+ demos/perl/test.pl: Add combit, rootrem.
+
+2003-08-19 Torbjorn Granlund <tege@swox.com>
+
+ * tune/Makefile.am (EXTRA_DIST): Add amd64.asm.
+
+2003-08-17 Kevin Ryde <kevin@swox.se>
+
+ * gmpxx.h [__MPFR_H]: Include full <iostream> for inlines.
+ * tests/cxx/t-headfr.cc: New file, exercising this.
+ * tests/cxx/Makefile.am: Add it.
+
+ * tests/cxx/t-constr.cc: Include config.h for WANT_MPFR.
+
+ * gmpxx.h: Correction to temp variable type in mpf -> mpfr assignment.
+ Reported by Derrick Bass.
+ * tests/cxx/t-assign.cc (check_mpfr): Exercise this.
+
+ * configure.in (WANT_MPFR): AC_DEFINE this, for the benefit of
+ tests/cxx/t-*.cc. (Was always meant to have been defined.)
+ * tests/cxx/Makefile.am (INCLUDES): Add -I$(top_srcdir)/mpfr.
+
+ * gmpxx.h: __gmp_default_rounding_mode -> __gmpfr_default_rounding_mode
+ (struct __gmp_hypot_function): Correction to mpfr_hypot addition.
+ * tests/cxx/t-misc.cc (check_mpfr_hypot): Corrections to mpfr/long
+ tests.
+
+2003-08-16 Torbjorn Granlund <tege@swox.com>
+
+ * configure.in (amd64): New.
+
+ * mpn/amd64/gmp-mparam.h: New file.
+
+ * tune/amd64.asm: New file, derived in part from tune/pentium.asm.
+
+2003-08-15 Kevin Ryde <kevin@swox.se>
+
+ * tune/freq.c (freq_irix_hinv): Reinstate, for the benefit of IRIX 6.2.
+ (freq_attr_get_invent): Conditionalize on INFO_LBL_DETAIL_INVENT too.
+
+2003-08-14 Kevin Ryde <kevin@swox.se>
+
+ * mpq/get_d.c: Use mpn_get_d.
+ * tests/mpq/t-get_d.c (check_onebit): New test.
+
+ * gmp.texi (Notes for Particular Systems): Under x86 cpu types, note
+ i386 is a fat binary, remove pentium4 recommendation since i386 is now
+ quite reasonable for p4.
+ (Notes for Particular Systems): Under Windows DLLs, remove caveat
+ about --enable-cxx now ok, update .lib creation for new libtool,
+ remove .exp not needed for MS C.
+ (Notes for Package Builds): i386 is a fat binary.
+ (Reentrancy): Remove SCO ctype.h note, don't want to list every system
+ misfeature, and was quite possibly for non-threading mode anyway.
+ (Autoconf): Remove notes on gmp 2 detection, too old to want to
+ encourage anyone to use.
+ (Karatsuba Multiplication): Correction to threshold increase/decrease
+ for a and b terms. Reported by Richard Brent and Paul Zimmermann.
+ Also add various further index entries.
+
+ * tune/freq.c (freq_attr_get_invent): New function.
+ (freq_irix_hinv): Remove, in favour or freq_attr_get_invent.
+ * configure.in (AC_CHECK_FUNCS): Add attr_get.
+ (AC_CHECK_HEADERS): Add invent.h, sys/attributes.h, sys/iograph.h.
+
+2003-08-03 Kevin Ryde <kevin@swox.se>
+
+ * tune/tuneup.c (tune_mul): Use MUL_KARATSUBA_THRESHOLD_LIMIT.
+
+2003-08-02 Kevin Ryde <kevin@swox.se>
+
+ * mpn/asm-defs.m4: Tweak some comments, add hpux11 to m4wrap 0xFF
+ problem systems.
+
+ * configure.in (*-*-sco3.2v5*): Remove lt_cv_archive_cmds_need_lc=no,
+ since libtool no longer uses it. This was a workaround fixing ctype.h
+ in SCO 5 shared libraries; not sure if libtool now gets it right on
+ its own, let's hope so.
+
+ * configure.in, acinclude.m4 (GMP_PROG_HOST_CC): Remove, libtool no
+ longer demands HOST_CC.
+
+ * configure.in: When C or C++ compiler not found, refer user to
+ config.log.
+
+ * configure.in (i386-*-*): Turn i386 into a fat binary build.
+ * mpn/x86/fat/fat.c, mpn/x86/fat/fat_entry.asm,
+ mpn/x86/fat/gmp-mparam.h, mpn/x86/fat/gcd_1.c, mpn/x86/fat/mode1o.c:
+ New files.
+ * gmp-impl.h (struct cpuvec_t) [x86 fat]: New structure.
+ * longlong.h (COUNT_LEADING_ZEROS_NEED_CLZ_TAB) [x86 fat]: Define.
+ * mpn/asm-defs.m4 (foreach): New macro.
+ * mpn/x86/x86-defs.m4 (CPUVEC_FUNCS_LIST): New define.
+ * mpn/x86/sqr_basecase.asm: New file, primarily as a fallback for fat
+ binaries.
+ * mpn/x86/p6/gmp-mparam.h, mpn/x86/p6/mmx/gmp-mparam.h: Add comments
+ about fat binary SQR_KARATSUBA_THRESHOLD for p6 and p6/mmx.
+
+ * configure.in: Add various supports for fat binaries, via fat_path,
+ fat_functions and fat_thresholds variables.
+ * acinclude.m4 (GMP_STRIP_PATH): Mung $fat_path too.
+ (GMP_FAT_SUFFIX, GMP_REMOVE_FROM_LIST): New macros.
+ * gmp-impl.h: Add various supports for fat binaries.
+ (DECL_add_n etc): New macros.
+ (mpn_mul_basecase etc): Define only if not already defined.
+ * mpn/asm-defs.m4 (m4_config_gmp_mparam): Mention fat binary.
+ (MPN): Use m4_unquote, for the benefit of fat binary name expansion.
+ * doc/configuration: Notes on fat binaries.
+ * gmp-impl.h (MUL_TOOM3_THRESHOLD_LIMIT): Define always.
+ (MUL_KARATSUBA_THRESHOLD_LIMIT): New define.
+ * mpn/generic/mul.c, mpn/generic/mul_n.c: Use these.
+ * tune/divrem1div.c, tune/divrem1inv.c, tune/mod_1_div.c,
+ tune/mod_1_inv.c: Define OPERATION_divrem_1 and OPERATION_mod_1, to
+ tell fat.h what's being done.
+
+ * config.guess (alpha-*-*): Update comments on what configfsf.guess
+ does and doesn't do for us.
+
+2003-07-31 Kevin Ryde <kevin@swox.se>
+
+ * config.guess: Remove $dummy.o files everywhere, in case vendor
+ compilers produce that even when not asked.
+
+ * demos/perl/GMP.xs (class_or_croak): Rename "class" parameter to
+ avoid C++ keyword.
+ (coerce_ulong, coerce_long): Move croaks to stop g++ 3.3 complaining
+ about uninitialized variables.
+
+ * demos/perl/INSTALL: Add notes on building with a DLL.
+
+ * longlong.h (count_trailing_zeros) [x86_64]: Ensure bsfq destination
+ is a 64-bit register. Diagnosed by Francois G. Dorais.
+
+2003-07-31 Torbjorn Granlund <tege@swox.com>
+
+ * longlong.h [ppc]: Remove nested test for vxworks.
+
+2003-07-24 Kevin Ryde <kevin@swox.se>
+
+ * gmpxx.h (struct __gmp_binary_multiplies): Use mpz_mul_si for
+ mpz*long and long*mpz.
+ * tests/cxx/t-ops.cc (check_mpz): Exercise mpz*long and mpz*ulong.
+
+ * cxx/ismpf.cc: Use std::locale decimal point when available. Expect
+ localeconv available always.
+ * tests/cxx/t-locale.cc: Enable check_input tests.
+
+ * gmpxx.h (struct __gmp_hypot_function): Use mpfr_hypot.
+ * tests/cxx/t-misc.cc (check_mpfr_hypot): New tests.
+
+ * tests/cxx/t-assign.cc, tests/cxx/t-binary.cc, tests/cxx/t-ops.cc,
+ tests/cxx/t-prec.cc, tests/cxx/t-ternary.cc, tests/cxx/t-unary.cc:
+ Include config.h for WANT_MPFR.
+
+ * tests/mpz/bit.c (check_single): Correction to a diagnostic print.
+
+2003-07-24 Niels Möller <nisse@lysator.liu.se>
+
+ * mpz/combit.c: New file.
+ * Makefile.am, mpz/Makefile.am: Add it.
+ * gmp-h.in (mpz_combit): Add prototype.
+ * tests/mpz/bit.c (check_single): Exercise mpz_combit.
+
+2003-07-16 Kevin Ryde <kevin@swox.se>
+
+ * mpn/generic/get_d.c: Correction to infinity handling for large exp.
+
+2003-07-14 Kevin Ryde <kevin@swox.se>
+
+ * mpz/get_d.c, mpz/get_d_2exp.c, mpf/get_d.c, mpf/get_d_2exp.c: Use
+ mpn_get_d.
+
+ * mpn/generic/get_d.c: New file, based on mpz/get_d.c and insert-dbl.c.
+ * configure.in, mpn/Makefile.am: Add it.
+ * gmp-impl.h (mpn_get_d): Add prototype.
+
+ * tests/mpn/t-get_d.c: New file.
+ * tests/mpn/Makefile.am: Add it.
+
+ * tests/mpz/t-get_d_2exp.c (check_onebit, check_round): Test negatives.
+ (check_onebit): Add a few more bit sizes.
+
+ * tests/misc.c, tests/tests.h (tests_isinf): New function.
+
+2003-07-12 Kevin Ryde <kevin@swox.se>
+
+ * configure.in (GMP_PROG_CXX_WORKS): Include $CPPFLAGS, same as
+ automake does in the actual build.
+
+ * acinclude.m4 (GMP_PROG_CXX_WORKS): In the namespace test, declare
+ namespace before trying to use. In std iostream test, provoke a
+ failure from Compaq C++ in pre-standard mode.
+
+2003-07-08 Kevin Ryde <kevin@swox.se>
+
+ * acinclude.m4 (GMP_PROG_CC_WORKS): Use separate compiles for various
+ known problems, and indicate to the user the reason for rejecting.
+ (GMP_PROG_CXX_WORKS): Ditto, and insist on being able to execute each
+ compiled program.
+
+2003-07-05 Kevin Ryde <kevin@swox.se>
+
+ * config.sub: Add comments to our alias transformations.
+
+ * configfsf.sub, configfsf.guess: Update to 2003-07-04.
+
+ * acinclude.m4 (GMP_PROG_CC_WORKS, GMP_PROG_CC_WORKS_LONGLONG): Show
+ failing program in config.log, per other autoconf tests.
+
+ * configure.in (i786-*-*): Recognise as pentium4, per configfsf.sub.
+
+2003-06-28 Kevin Ryde <kevin@swox.se>
+
+ * mpz/get_d_2exp.c, mpf/get_d_2exp.c: Avoid res==1.0 when floats round
+ upwards.
+
+ * tests/mpz/t-get_d_2exp.c: New file.
+ * tests/mpz/Makefile.am (check_PROGRAMS): Add it.
+ * tests/mpf/t-get_d_2exp.c: New file.
+ * tests/mpf/Makefile.am (check_PROGRAMS): Add it.
+ * tests/x86call.asm, test/tests.h (x86_fldcw, x86_fstcw): New
+ functions.
+ * tests/misc.c, tests/tests.h (tests_hardware_getround,
+ tests_hardware_setround): New functions.
+
+2003-06-25 Kevin Ryde <kevin@swox.se>
+
+ * mpn/sparc64/dive_1.c: New file.
+
+ * mpn/sparc64/sparc64.h: New file.
+ * mpn/sparc64/mode1o.c: Remove things now in sparc64.h.
+
+ * mpfr/*: Update to mpfr cvs 2003-06-25.
+
+ * acinclude.m4 (GMP_PROG_CC_WORKS): In last change provoking gnupro
+ gcc, don't use ANSI style function definition.
+
+2003-06-22 Kevin Ryde <kevin@swox.se>
+
+ * mpn/pa32/hppa1_1/udiv.asm: Remove .proc, .entry, .exit and .procend,
+ handled by PROLOGUE and EPILOGUE. Comment out .callinfo, per other
+ asm files.
+
+ * gmpxx.h (mpz_class __gmp_binary_divides, __gmp_binary_modulus): Fix
+ long/mpz and long%mpz for dividend==LONG_MIN divisor==-LONG_MIN.
+ (mpz_class __gmp_binary_modulus): Fix mpz%long for negative dividend.
+ * tests/cxx/t-ops.cc (check_mpz): Add test cases for these, merging
+ operator/ and operator% sections for clarity.
+
+2003-06-21 Kevin Ryde <kevin@swox.se>
+
+ * mpfr/*: Update to mpfr cvs 2003-06-21.
+
+ * acinclude.m4 (GMP_PROG_CC_WORKS): Add code by Torbjorn provoking an
+ ICE from gcc 2.9-gnupro-99r1 under -O2 -mcpu=ev6.
+ * configure.in (alpha*-*-* gcc_cflags_cpu): Fallback on -mcpu=ev56 for
+ this compiler.
+
+ * gmpxx.h (get_d): Remove comments about long double, double is
+ correct for get_d, a future long double form would be get_ld.
+
+2003-06-19 Kevin Ryde <kevin@swox.se>
+
+ * mpfr/*: Update to mpfr cvs 2003-06-19.
+
+ * mpn/generic/dive_1.c: Share src[0] fetch among all cases. No need
+ for separate final umul_ppmm in even case, make it part of the loop.
+
+ * mpz/get_d_2exp.c, mpq/set_si.c, mpq/set_ui.c: Nailify.
+
+ * mpf/iset_si.c: Rewrite using mpf/set_si.c code, in particular this
+ nailifies it.
+ * tests/mpf/t-set_si.c: Nailify tests.
+
+ * mpf/iset_ui.c: Nailify, as per mpf/set_ui.c
+ * tests/mpf/t-set_ui.c: New file.
+ * tests/mpf/Makefile.am (check_PROGRAMS): Add it.
+
+2003-06-15 Kevin Ryde <kevin@swox.se>
+
+ * mpfr/*: Update to mpfr cvs 2003-06-15.
+
+ * mpn/x86/k6/mode1o.asm: Remove a bogus ASSERT.
+
+2003-06-12 Kevin Ryde <kevin@swox.se>
+
+ * configure.in (--enable-assert): Emit WANT_ASSERT to config.m4.
+ * mpn/powerpc32/powerpc-defs.m4, mpn/x86/x86-defs.m4 (ASSERT): Check
+ WANT_ASSERT is defined.
+
+ * mpn/sparc32/v9/udiv.asm: Amend heading, this file is for sparc v9.
+
+ * tests/cxx/Makefile.am (TESTS_ENVIRONMENT): In libtool openbsd hack,
+ discard error messages from cp, for the benefit of --disable-shared or
+ systems not using names libgmp.so.*.
+
+ * tests/devel/try.c (try_one): When overlapping, copy source data
+ after filling dst. Previously probably used only DEADVAL in
+ overlapping cases.
+
+2003-06-11 Torbjorn Granlund <tege@swox.com>
+
+ * mpf/random2.c: Rewrite. Ignore sign of exp parameter.
+
+2003-06-10 Kevin Ryde <kevin@swox.se>
+
+ * mpn/sparc64/mode1o.c: New file.
+
+2003-06-09 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/powerpc32/lshift.asm: Add more cycle counts.
+ * mpn/powerpc32/rshift.asm: Add more cycle counts.
+
+ * mpn/ia64/addmul_1.asm: Reformat comments for 80 columns.
+
+ * gmp-impl.h (udiv_qrnnd_preinv1): New name for udiv_qrnnd_preinv.
+ (udiv_qrnnd_preinv2): New name for udiv_qrnnd_preinv2norm.
+ (udiv_qrnnd_preinv): New #define, making udiv_qrnnd_preinv2
+ the default.
+ * tune/speed.c: Corresponding changes.
+ * tune/speed.h: Likewise.
+ * tune/common.c: Likewise.
+
+ * mpf/get_str.c: Simplify `off' computation.
+
+ * longlong.h: Tabify.
+
+2003-06-09 Kevin Ryde <kevin@swox.se>
+
+ * gmp.texi (ABI and ISA): FreeBSD has sparc64 too, just say "BSD" to
+ cover all flavours.
+ * configure.in: Ditto in some comments.
+
+ * mpfr/*: Update to mpfr cvs 2003-06-09.
+
+ * tests/cxx/Makefile.am (LDADD): Add -L$(top_builddir)/$(LIBS), for
+ the benefit of gcc 3.2 on itanium2-hp-hpux11.22.
+
+ * tune/many.pl (mul_2): Add speed routine settings.
+ (MAKEFILE): Close when done, for the benefit of development hackery.
+
+2003-06-08 Kevin Ryde <kevin@swox.se>
+
+ * mpfr/*: Update to mpfr cvs 2003-06-08.
+
+ * mpn/x86/x86-defs.m4 (femms): Remove fallback to emms.
+ (cmovCC, psadbw): Remove simulated versions.
+ (cmov_available_p, psadbw_available_p): Remove.
+ This trickery was only ever for development purposes on machines
+ without those instructions. Removing it simplifies gmp and in
+ particular avoids complications for fat binary builds. Development
+ can be done with a wrapper around "as" if really needed.
+
+ * mpn/x86/divrem_1.asm: Don't use loop_or_decljnz, now K6 has its own
+ mpn/x86/k6/divrem_1.asm. Amend K6 comments now moved to there.
+ * mpn/x86/x86-defs.m4 (loop_or_decljnz): Remove, no longer used.
+
+ * mpn/x86/k6/divrem_1.asm: New file, derived from mpn/x86/divrem_1.asm.
+
+ * mpn/x86/k6/pre_mod_1.asm: Remove comments now in mpn/x86/mod_1.asm.
+
+ * mpn/x86/mod_1.asm: Put mpn_mod_1c after mpn_mod_1 for better branch
+ prediction. Put done_zero at end for less wastage in alignment. Use
+ decl+jnz unconditionally since in fact it's ok on k6. Amend comments.
+
+2003-06-07 Kevin Ryde <kevin@swox.se>
+
+ * mpn/generic/mode1o.c: Fix ASSERTs on return value.
+
+ * gmp.texi (Build Options): Add viac3 and viac32 cpu types.
+ (ABI and ISA): Note on sparcv9 ABI=32 vs ABI=64 speed. More indexing.
+
+ * configfsf.guess, configfsf.sub: Update to 2003-06-06.
+ * config.guess: Remove $RANDOM hack supporting netbsd 1.4, not needed
+ by new configfsf.guess.
+
+2003-06-06 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/ia64/submul_1.asm: Add branch over .align block.
+
+2003-06-05 Torbjorn Granlund <tege@swox.com>
+
+ * longlong.h (add_ssaaaa) [pa64]: Output zero operand as register 0.
+ Allow more immediate operands.
+ (sub_ddmmss) [pa64]: Likewise.
+ (add_ssaaaa) [pa32]: Likewise.
+ (sub_ddmmss) [pa32]: Likewise.
+
+ * mpn/pa64: Change ".level 2.0W" to ".level 2.0w" to please
+ picky GNU assembler.
+
+2003-06-05 Kevin Ryde <kevin@swox.se>
+
+ * gmp.texi (Integer Special Functions): In mpz_array_init, fix type
+ shown for integer_array and give an example use.
+
+2003-06-04 Torbjorn Granlund <tege@swox.com>
+
+ * mpf/set_str.c (mpf_set_str): Work around gcc 2 bug triggered on
+ alpha.
+
+2003-06-03 Kevin Ryde <kevin@swox.se>
+
+ * mpn/x86/pentium/README: Add 7 c/l mmx mul_1, tweak wordings.
+
+ * acinclude.m4 (GMP_C_DOUBLE_FORMAT): Use octal char constants in test
+ program, hex is not supported by K&R.
+
+2003-06-02 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/mips64/divrem_1.asm: New file.
+
+2003-06-01 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/powerpc32/lshift.asm: Reformat code.
+ * mpn/powerpc32/rshift.asm: Reformat code.
+
+2003-05-30 Kevin Ryde <kevin@swox.se>
+
+ * tests/misc.c (tests_start): Set stdout and stderr to unbuffered, to
+ avoid any chance of losing output on segv etc.
+
+2003-05-28 Torbjorn Granlund <tege@swox.com>
+
+ * mpf/get_str.c: Move label `done' to match TMP_MARK and TMP_FREE.
+ Remove redundant variable prec.
+
+2003-05-26 Torbjorn Granlund <tege@swox.com>
+
+ * tests/mpz/convert.c: Test bases up to 62.
+
+ * tests/mpf/t-conv.c: Test bases up to 62.
+
+ * demos/pexpr.c: Don't iterate to get accurate timing.
+
+ * mpf/set_str.c (mpn_pow_1_highpart): Cleanup.
+
+ * mp_dv_tab.c: Fix typo.
+
+ * mpf/get_str.c: Rewrite (now sub-quadratic).
+
+2003-05-22 Kevin Ryde <kevin@swox.se>
+
+ * tests/mpn/t-divrem_1.c: New file.
+ * tests/mpn/Makefile.am: Add it.
+
+2003-05-22 Torbjorn Granlund <tege@swox.com>
+
+ * config.sub: Recognize viac3* processors.
+
+2003-05-20 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/sparc64/addmul_2.asm: New file.
+
+2003-05-19 Torbjorn Granlund <tege@swox.com>
+
+ * configure.in: Recognize alphaev7* as alphaev67.
+
+ * config.guess: Recognize viac3* processors.
+ * configure.in: Set up path for viac3* processors.
+ * acinclude.m4 (X86_PATTERN): Include viac3* processors.
+
+2003-05-19 Kevin Ryde <kevin@swox.se>
+
+ * tune/freq.c (freq_pstat_getprocessor): New function.
+ (freq_all): Use it.
+ * configure.in (AC_CHECK_HEADERS): Add sys/pstat.h.
+ (AC_CHECK_FUNCS): Add pstat_getprocessor.
+
+2003-05-15 Kevin Ryde <kevin@swox.se>
+
+ * mpn/generic/mul_fft.c (mpn_mul_fft_decompose): Remove "inline",
+ since the code is a bit too big. gcc doesn't actually inline when
+ alloca (TMP_ALLOC) is used anyway.
+
+2003-05-13 Kevin Ryde <kevin@swox.se>
+
+ * gmp.texi (Notes for Particular Systems): Libtool directory is .libs
+ not _libs for mingw dll. Reported by Andreas Fabri.
+
+2003-05-07 Kevin Ryde <kevin@swox.se>
+
+ * acinclude.m4 (GMP_PROG_CC_WORKS): Add code to generate sse2/xmm code
+ from gcc -march=pentium4, to check the assembler supports that.
+ (GMP_GCC_PENTIUM4_SSE2, GMP_OS_X86_XMM): New macros.
+ * configure.in (pentium4-*-*): Use them to see if gcc -march=pentium4
+ (with sse2) is ok.
+
+2003-05-06 Kevin Ryde <kevin@swox.se>
+
+ * mpz/com.c: Rate size==0 as UNLIKELY, fix comment to mpn_add_1.
+
+ * tune/freq.c (<sys/sysinfo.h>): Include only when needed for
+ getsysinfo(), to avoid a problem with this file on AIX 5.1.
+
+2003-05-03 Torbjorn Granlund <tege@swox.com>
+
+ * mpf/set_str.c: Do not ignore supposedly superfluous digits (in part
+ reverting last change).
+
+2003-05-03 Kevin Ryde <kevin@swox.se>
+
+ * gmp.texi: Use @code for files in @cindex entries, it looks nicer
+ than @file.
+
+ * Makefile.am: Note gmp 4.1.1 and 4.1.2 version info.
+
+ * configure.in, acinclude.m4 (GMP_CRAY_OPTIONS): New macro for Cray
+ system setups, letting AC_REQUIRE do its job instead of a hard coded
+ AC_PROG_EGREP.
+
+ * config.guess: Amend fake RANDOM to avoid ". configfsf.guess" which
+ segfaults on Debian "ash" 0.4.16.
+
+2003-05-01 Kevin Ryde <kevin@swox.se>
+
+ * configure.in (AC_CHECK_FUNCS): Add getsysinfo.
+ (AC_CHECK_HEADERS): Add sys/sysinfo.h and machine/hal_sysinfo.h.
+ * tune/freq.c (freq_getsysinfo): New function.
+ (freq_all): Use it.
+ (freq_sysctlbyname_i586_freq, freq_sysctlbyname_tsc_freq,
+ freq_sysctl_hw_cpufrequency, freq_sysctl_hw_model): Set
+ speed_cycletime before trying to print it, when verbose.
+
+2003-04-28 Torbjorn Granlund <tege@swox.com>
+
+ * mpf/set_str.c: Major overhaul.
+ (mpn_pow_1_highpart): New helper function, meat extracted from
+ mpf_set_str.
+
+2003-04-24 Kevin Ryde <kevin@swox.se>
+
+ * acinclude.m4 (GMP_GCC_ARM_UMODSI): Quote result string against m4.
+
+ * configure, ltmain.sh, aclocal.m4: Update to libtool 1.5.
+
+ * longlong.h (add_ssaaaa) [all]: Remove first "%" commutative in each,
+ since gcc only supports one per asm.
+
+ * printf/doprnt.c: Add M for mp_limb_t.
+ * tests/misc/t-printf.c: Exercise this.
+
+ * tests/mpz/t-cmp_d.c: Test infinities.
+ * tests/mpf/t-cmp_d.c: New file.
+ * tests/mpf/Makefile.am: Add it.
+
+ * mpz/cmp_d.c, mpz/cmpabs_d.c, mpf/cmp_d.c: NaN invalid, Inf bigger
+ than any value.
+ * mpz/set_d.c, mpq/set_d.c, mpf/set_d.c: Nan or Inf invalid.
+
+ * configure.in (AC_CHECK_FUNCS): Add raise.
+ * invalid.c: New file.
+ * Makefile.am: Add it.
+ * gmp-impl.h (__gmp_invalid_operation): Add prototype.
+ (DOUBLE_NAN_INF_ACTION): New macro.
+
+ * tests/trace.c, tests/tests.h (d_trace): New function.
+ * tests/misc.c, tests/tests.h (tests_infinity_d): New function.
+ * tests/misc.c (mpz_erandomb, mpz_errandomb): Use gmp_urandomm_ui.
+
+ * tune/tuneup.c, tune/common.c, tests/devel/try.c: Cast various
+ mp_size_t values for printf %ld in case mp_size_t==int. Use
+ gmp_printf for mp_limb_t values.
+
+ * gmp.texi (Nomenclature and Types): Add mp_exp_t, mp_size_t,
+ gmp_randstate_t. Note ulong for bit counts and size_t for byte
+ counts. Don't bother with @noindent.
+ (Debugging): New valgrind is getting MMX/SSE.
+ (Integer Comparisons): mpz_cmp_d and mpz_cmpabs_d on NaNs and Infs.
+ (Float Comparison): mpf_cmp_d behaviour on NaNs and Infs.
+ (Low-level Functions): Note with mpn_hamdist what hamming distance is.
+ (Formatted Output Strings): Add type M.
+ (Internals): Remove remarks on ulong bits and size_t bytes. Move int
+ field remarks to ...
+ (Integer Internals, Float Internals): ... here.
+
+2003-04-19 Kevin Ryde <kevin@swox.se>
+
+ * configure.in (*sparc*-*-* ABI=32): Add umul to extra_functions.
+
+ * mpn/x86/p6/mul_basecase.asm: New file.
+
+2003-04-18 Kevin Ryde <kevin@swox.se>
+
+ * configure.in (m68060-*-*): Fallback to gcc -m68000 when -m68060 not
+ available, and don't use mpn/m68k/mc68020 asm routines. (Avoids 32x32
+ mul and 64/32 div which trap to the kernel on 68060. Advice by
+ Richard Zidlicky.)
+ * mpn/m68k/README: Update notes on directory usage.
+
+ * tests/cxx/Makefile.am (TESTS_ENVIRONMENT): Add a hack to let the
+ test programs run with a shared libgmpxx on openbsd 3.2.
+
+ * gmp.texi (Language Bindings): Add Guile.
+
+2003-04-12 Kevin Ryde <kevin@swox.se>
+
+ * configure.in (cygwin*, mingw*, pw32*, os2*): Add
+ -Wl,--export-all-symbols to GMP_LDFLAGS, no longer the default in
+ latest mingw and libtool.
+
+ * acinclude.m4 (GMP_ASM_COFF_TYPE): New macro.
+ * configure.in (x86s): Use it.
+ * mpn/x86/x86-defs.m4 (COFF_TYPE): New macro.
+ (PROLOGUE_cpu): Use it, for the benefit of mingw DLLs.
+
+ * gmp-impl.h (mpn_copyi, mpn_copyd): Add __GMP_DECLSPEC.
+
+ * gmp.texi (Known Build Problems): Remove windows test program .exe
+ repeated built, fixed by new libtool. Remove MacOS C++ shared library
+ creation, fixed by new libtool.
+ (Notes for Package Builds, Known Build Problems): Remove DESTDIR notes
+ on libgmpxx, fixed in new libtool.
+
+2003-04-10 Torbjorn Granlund <tege@swox.com>
+
+ * configure.in: Match turbosparc.
+ * config.guess: Recognize turbosparc (just for *bsd for now).
+
+2003-04-09 Kevin Ryde <kevin@swox.se>
+
+ * mpf/mul_ui.c [nails]: Call mpf_mul to handle v > GMP_NUMB_MAX.
+
+ * tests/mpz/t-mul.c (main): Don't try FFT sizes when FFT disabled via
+ MP_SIZE_T_MAX, eg. for nails.
+
+ * tests/cxx/t-ternary.cc: Split up tests to help compile speed and
+ memory usage.
+
+ * tests/devel/try.c: Print seed under -R, add -E to reseed, use ulong
+ for seed not uint.
+
+ * gmp.texi: Add @: after various abbreviations, more index entries.
+ (leftarrow): New macro, for non-tex.
+ (Random State Initialization): Remove commented gmp_randinit_lc, not
+ going to be implemented.
+ (Random Number Algorithms): New section.
+ (References): Add Matsumoto and Nishimura on Mersenne Twister, add
+ Bertot, Magaud and Zimmermann on GMP Square Root.
+
+2003-04-06 Kevin Ryde <kevin@swox.se>
+
+ * tests/mpz/t-gcd_ui.c: New file.
+ * tests/mpz/Makefile.am: Add it.
+
+ * mpz/gcd_ui.c: Correction to return value on longlong limb systems,
+ limb might not fit a ulong.
+
+2003-04-04 Kevin Ryde <kevin@swox.se>
+
+ * configure, aclocal.m4, ltmain.sh: Update to libtool cvs snapshot
+ 2003-04-02.
+
+2003-04-02 Kevin Ryde <kevin@swox.se>
+
+ * configure.in (*-*-cygwin*): No longer force lt_cv_sys_max_cmd_len,
+ libtool has addressed this now.
+ (AC_PROVIDE_AC_LIBTOOL_WIN32_DLL): Remove this, libtool _LT_AC_LOCK
+ no longer needs it.
+
+ * acinclude.m4 (GMP_PROG_AR): Also set ac_cv_prog_AR and
+ ac_cv_prog_ac_ct_AR when adding flags to AR, so they're not lost by
+ libtool's call to AC_CHECK_TOOL.
+
+2003-04-01 Kevin Ryde <kevin@swox.se>
+
+ * configure, aclocal.m4, ltmain.sh: Update to libtool cvs snapshot
+ 2003-03-31.
+
+ * configure.in (AC_PROG_F77): Add a dummy AC_PROVIDE to stop libtool
+ running F77 probes.
+
+ * randlc2x.c (gmp_rand_lc_struct): Add comments about what exactly is
+ in each field.
+ (randseed_lc): Rename seedp to seedz to avoid confusion with seedp in
+ the lc function. Suggested by Pedro Gimeno.
+ (gmp_randinit_lc_2exp): Use __GMP_ALLOCATE_FUNC_TYPE. No need for
+ "+1" in mpz_init2 of _mp_seed. Don't bother with mpz_init2 for _mp_a.
+
+2003-03-29 Kevin Ryde <kevin@swox.se>
+
+ * configure.in (m68k-*-*): Use -O2, no longer need to fallback to -O.
+ * acinclude.m4 (GMP_GCC_M68K_OPTIMIZE): Remove macro.
+
+ * configure.in (AC_CHECK_TYPES): Add notes on why tested.
+
+ * gmp.texi (GMPrefu, GMPpxrefu, GMPreftopu, GMPpxreftopu): New macros,
+ use them for all external references to get URLs into HTML output.
+ (Random State Initialization): Add gmp_randinit_set.
+ (Random State Miscellaneous): New section.
+
+2003-03-29 Kevin Ryde <kevin@swox.se>
+
+ * randbui.c, randmui.c: New files.
+ * Makefile.am: Add them.
+ * gmp-h.in (gmp_urandomb_ui, gmp_urandomm_ui): Add prototypes.
+ * tests/rand/t-urbui.c, tests/rand/t-urmui.c: New files.
+ * tests/rand/Makefile.am: Add them.
+
+ * gmp-impl.h (gmp_randstate_srcptr): New typedef.
+ (gmp_randfnptr_t): Add randiset_fn.
+ * randiset.c: New file.
+ * Makefile.am: Add it.
+ * gmp-h.in (gmp_randinit_set): Add prototype.
+ * randlc2x.c, randmt.c: Add gmp_randinit_set support.
+ * tests/rand/t-iset.c: New file.
+ * tests/rand/Makefile.am: Add it.
+
+ * tests/misc.c, tests/tests.h (call_rand_algs): New function.
+
+2003-03-27 Kevin Ryde <kevin@swox.se>
+
+ * mpz/bin_uiui.c: Use plain "*" for kacc products rather than
+ umul_ppmm since high not needed, except for an ASSERT now amended.
+
+2003-03-26 Kevin Ryde <kevin@swox.se>
+
+ * demos/expr/exprfr.c (cbrt, cmpabs, exp2, gamma, nextabove,
+ nextbelow, nexttoward): New functions.
+ * demos/expr/t-expr.c: Exercise these.
+
+ * mpfr/*: Update to mpfr cvs 2003-03-26.
+
+ * gmp-impl.h (MPZ_REALLOC): Use UNLIKELY, to expect no realloc.
+
+ * tune/time.c (cycles_works_p): Scope variables down to relevant part
+ to avoid warnings about unused.
+
+ * configfsf.guess, configfsf.sub: Update to 2003-02-22.
+ * config.guess: Fake a $RANDOM variable when running configfsf.guess,
+ to workaround a problem on m68k NetBSD 1.4.1.
+
+ * mpz/fac_ui.c: Remove unused variable "z1".
+
+ * tune/freq.c (freq_irix_hinv): Allow "Processor 0" line from IRIX 6.5.
+
+2003-03-24 Torbjorn Granlund <tege@swox.com>
+
+ * randlc2x.c (randget_lc): Remove write-only variable rn.
+ * mpf/eq.c: Remove write-only variable usign.
+ * gen-psqr.c (main): Remove write-only variable numb_bits.
+
+2003-03-17 Torbjorn Granlund <tege@swox.com>
+
+ * Makefile.am (libgmp_la_SOURCES): Add mp_dv_tab.c.
+ (libmp_la_SOURCES): Add mp_dv_tab.c.
+
+ * mpn/alpha/invert_limb.asm: Add a few comments.
+
+ * mp_dv_tab.c: New file, defining __gmp_digit_value_tab.
+
+ * mpz/set_str.c: Get rid of function digit_value_in_base and use table
+ __gmp_digit_value_tab instead.
+ * mpz/inp_str.c: Likewise.
+ * mpf/set_str.c: Likewise.
+ * mpbsd/min.c: Likewise.
+ * mpbsd/xtom.c: Likewise.
+
+ * mpz/set_str.c: Allow bases <= 62. Return error for invalid bases.
+ * mpz/inp_str.c: Likewise.
+ * mpf/set_str.c: Likewise.
+ * mpz/out_str.c: Likewise.
+ * mpz/get_str.c: Likewise.
+ * mpf/get_str.c: Likewise.
+
+ * mpz/inp_str.c: Restructure to allocate more string space just
+ before needed.
+ * mpbsd/min.c: Likewise.
+
+ * longlong.h (__udiv_qrnnd_c): Remove redundant casts.
+ (32-bit sparc): Test HAVE_HOST_CPU_supersparc in addition to various
+ sparc_v8 spellings.
+
+2003-03-17 Kevin Ryde <kevin@swox.se>
+
+ * mpfr/*: Update to mpfr cvs 2003-03-17.
+
+2003-03-15 Kevin Ryde <kevin@swox.se>
+
+ * Makefile.am (EXTRA_libgmp_la_SOURCES): Use this for TMP_ALLOC
+ sources, instead of a libdummy.la.
+
+2003-03-16 Torbjorn Granlund <tege@swox.com>
+
+ * config.guess: Recognize supersparc and microsparc for *BSD systems.
+ Generalize some superscalar recognition patterns.
+
+2003-03-14 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/sparc64/udiv.asm: New file.
+
+2003-03-13 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/sparc64: Table cycle counts. Update some comments.
+
+ * mpn/powerpc64/divrem_1.asm: New file.
+
+2003-03-10 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/generic/mul.c (mpn_mul): Don't blindly expect
+ MUL_KARATSUBA_THRESHOLD to be a constant.
+
+2003-03-07 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/generic/mul.c (mpn_mul): New operand splitting code for
+ avoiding cache misses when un >> MUL_KARATSUBA_THRESHOLD > vn.
+ (MUL_BASECASE_MAX_UN): New #define, default to 500 for now.
+
+2003-03-07 Kevin Ryde <kevin@swox.se>
+
+ * Makefile.am: Put gmp.h and mp.h under $(exec_prefix)/include.
+ * gmp.texi (Build Options): Add notes on this.
+ Reported by Vincent Lefèvre.
+
+2003-03-06 Kevin Ryde <kevin@swox.se>
+
+ * configure.in (alpha*-*-* gcc): Add asm option before testing -mcpu,
+ for the benefit of gcc 2.9-gnupro-99r1 on alphaev68-dec-osf5.1 which
+ doesn't otherwise put the assembler in the right mode for -mcpu=ev6.
+
+2003-03-05 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/powerpc32/powerpc-defs.m4: Set up renaming for v registers.
+
+ * mpz/powm.c (redc): Instead of repeated mpn_incr_u invocations,
+ accumulate carries and add at the end.
+ (mpz_powm): Trim tp allocation, now as redc doesn't need carry guard.
+
+2003-02-25 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/x86/pentium4/copyd.asm: Correct header comment.
+
+ * mpn/arm/addmul_1.asm: Correct cycle counts.
+ * mpn/arm/submul_1.asm: Likewise.
+
+2003-02-20 Kevin Ryde <kevin@swox.se>
+
+ * demos/factorize.c (factor_using_pollard_rho): Test k>0 to avoid
+ infinite loop if k=0 and gcd!=1 reveals a factor. Reported by John
+ Pongsajapan.
+
+ * gmp.texi, fdl.texi: Update to FDL version 1.2.
+
+2003-02-18 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/arm/mul_1.asm: Fix typo introduced in last change.
+
+2003-02-17 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/ia64/gmp-mparam.h: Retune.
+
+ * mpn/sparc64/copyi.asm: Add some header comments.
+ * mpn/sparc64/copyd.asm: Likewise.
+
+ * mpn/arm/mul_1.asm: Put vl operand last for umull/umlal.
+ Add some header comments.
+ * mpn/arm/addmul_1.asm: Rewrite.
+ * mpn/arm/submul_1.asm: Rewrite.
+ * mpn/arm/gmp-mparam.h: Retune.
+
+2003-02-16 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/arm/copyi.asm: New file.
+ * mpn/arm/copyd.asm: New file.
+
+2003-02-16 Kevin Ryde <kevin@swox.se>
+
+ * acinclude.m4 (GMP_C_DOUBLE_FORMAT): Tolerate incorrect last data
+ byte seen on an arm system.
+
+2003-02-15 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/arm/gmp-mparam.h: Retune.
+
+2003-02-13 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/powerpc32/750/com_n.asm: Add more cycle counts.
+
+2003-02-13 Kevin Ryde <kevin@swox.se>
+
+ * configure.in (AC_PREREQ): Bump to 2.57.
+
+ * configure.in, acinclude.m4 (GMP_GCC_WA_OLDAS): New macro, applying
+ -Wa,-oldas only when necessary.
+
+ * configure.in (powerpc*-*-*): Don't use -Wa,-mppc with gcc, it
+ overrides options recent gcc adds for -mcpu, making generated code
+ fail to assemble.
+
+ * tune/tuneup.c (mpn_fft_table): Remove definition, it's in mul_fft.c.
+
+2003-02-12 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/x86/pentium4/sse2/gmp-mparam.h: Retune.
+ * mpn/x86/k7/gmp-mparam.h: Retune.
+ * mpn/x86/k6/gmp-mparam.h: Retune.
+ * mpn/x86/p6/gmp-mparam.h: Retune.
+ * mpn/x86/p6/mmx/gmp-mparam.h: Retune.
+
+ * tests/mpz/t-mul.c (main): Rewrite FFT testing code.
+
+2003-02-10 Torbjorn Granlund <tege@swox.com>
+
+ * config.guess: Recognize "power2" systems.
+
+ * mpn/powerpc64/gmp-mparam.h: Fix indentation.
+ * mpn/power/gmp-mparam.h: Retune.
+ * mpn/alpha/ev6/nails/gmp-mparam.h: Retune.
+ * mpn/sparc64/gmp-mparam.h: Retune.
+ * mpn/pa64/gmp-mparam.h: Retune.
+ * mpn/sparc32/v8/supersparc/gmp-mparam.h: Retune.
+ * mpn/sparc32/v8/gmp-mparam.h: Retune.
+ * mpn/mips64/gmp-mparam.h: Retune.
+ * mpn/alpha/ev6/gmp-mparam.h: Retune.
+ * mpn/powerpc32/gmp-mparam.h: Retune.
+ * mpn/powerpc32/750/gmp-mparam.h: Retune.
+ * mpn/alpha/ev5/gmp-mparam.h: Retune.
+ * mpn/m68k/gmp-mparam.h: Retune.
+ * mpn/cray/gmp-mparam.h: Set GET_STR_PRECOMPUTE_THRESHOLD.
+
+ * configure.in: Undo this, problem doesn't happen any more:
+ (mips64*-*-*): Pass just -O1 to cc, to work around compiler bug.
+
+2003-02-03 Kevin Ryde <kevin@swox.se>
+
+ * gmp-impl.h (MPN_NORMALIZE, MPN_NORMALIZE_NOT_ZERO): Add parens
+ around macro parameters. Reported by Jason Moxham.
+
+2003-02-01 Kevin Ryde <kevin@swox.se>
+
+ * gmp.texi (Low-level Functions): No overlap permitted by mpn_mul_n.
+ Reported by Jason Moxham.
+ (Formatted Input Strings): Correction to strtoul cross reference
+ formatting.
+ (BSD Compatible Functions): Add index entry for MINT.
+
+2003-01-29 Torbjorn Granlund <tege@swox.com>
+
+ * gmp-impl.h (mpn_mul_fft): Now returns int.
+
+2003-01-29 Paul Zimmermann <Paul.Zimmermann@loria.fr>
+
+ * mpn/generic/mul_fft.c: Major rewrite.
+
+2003-01-25 Kevin Ryde <kevin@swox.se>
+
+ * config.guess (powerpc*-*-*): Remove $dummy.core file when mfpvr
+ fails on NetBSD.
+ (trap): Remove $dummy.core on abnormal termination too.
+
+ * mpfr/*: Update to mpfr cvs 2003-01-25.
+
+2003-01-24 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/ia64/README: Update cycle counts to match current code.
+
+2003-01-18 Kevin Ryde <kevin@swox.se>
+
+ * mpfr/*: Update to mpfr cvs 2003-01-18.
+
+2003-01-17 Torbjorn Granlund <tege@swox.com>
+
+ * gmp.texi: Canonicalize URLs.
+
+2003-01-15 Kevin Ryde <kevin@swox.se>
+
+ * gmp.texi (Notes for Particular Systems): Add hardware floating point
+ precision mode.
+
+ * mpfr/*, configure, aclocal.m4, config.in: Update to mpfr cvs
+ 2003-01-15.
+
+2003-01-11 Kevin Ryde <kevin@swox.se>
+
+ * mpfr/*: Update to mpfr cvs 2003-01-11.
+
+2003-01-09 Kevin Ryde <kevin@swox.se>
+
+ * mpfr/get_str.c: Update to mpfr cvs 2003-01-09.
+
+ * doc/configuration: Various updates.
+
+2003-01-06 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/alpha/copyi.asm: Avoid `nop' mnemonic, unsupported on Cray.
+ * mpn/alpha/copyd.asm: Likewise.
+
+2003-01-05 Kevin Ryde <kevin@swox.se>
+
+ * demos/expr/t-expr.c (check_r): Tolerate mpfr_set_str new return
+ value.
+
+ * configure, aclocal.m4 (*-*-osf4*, *-*-osf5*): Regenerate with
+ libtool patch to avoid bash printf option problem when building shared
+ libraries with cxx.
+
+ * configure.in (pentium4-*-*): Use "-march=pentium4 -mno-sse2" since
+ sse2 causes buggy code from gcc 3.2.1 and is only supported on new
+ enough kernels.
+
+ * acinclude.m4 (GMP_PROG_NM): Add some notes about failures, per
+ report by Krzysztof Kozminski.
+
+ * gmp-h.in (mpz_mdivmod_ui, mpz_mmod_ui): Add parens around "r".
+
+ * gmp-h.in (__GMP_CAST): New macro, clean to g++ -Wold-style-cast.
+ (GMP_NUMB_MASK, mpz_cmp_si, mpq_cmp_si, mpz_odd_p, mpn_divexact_by3,
+ mpn_divmod): Use it. Reported by Krzysztof Kozminski.
+ (mpz_odd_p): No need for the outermost cast to "int".
+ * tests/cxx/t-cast.cc: New file.
+ * tests/cxx/Makefile.am: Add it.
+
+2003-01-04 Kevin Ryde <kevin@swox.se>
+
+ * mpfr/set_str.c: Update to mpfr cvs 2003-01-04.
+
+ * demos/expr/exprfra.c (e_mpfr_number): Tolerate recent mpfr_set_str
+ returning count of characters accepted.
+
+2003-01-03 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/alpha/copyi.asm: New file.
+ * mpn/alpha/copyd.asm: New file.
+
+2003-01-03 Kevin Ryde <kevin@swox.se>
+
+ * demos/expr/t-expr.c: Use __gmpfr on some mpfr internals that have
+ changed.
+
+ * mpfr/*, aclocal.m4, config.in, configure: Update to mpfr cvs
+ 2003-01-03.
+
+ * gmp.texi (Introduction to GMP): Mention release announcements
+ mailing list, and put home page and ftp before mailing lists.
+
+2002-12-28 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/generic/mul_fft.c (mpn_fft_next_size): Simplify.
+
+2002-12-28 Kevin Ryde <kevin@swox.se>
+
+ * acinclude.m4 (M68K_PATTERN): New macro.
+ (GMP_GCC_M68K_OPTIMIZE): Use it to avoid m6811 and friends.
+ * configure.in: Ditto.
+
+ * tests/mpz/t-import.c, tests/mpz/t-export.c: Use '\xHH' to avoid
+ warnings about char overflows.
+ * acinclude.m4 (GMP_C_DOUBLE_FORMAT): Ditto.
+
+2002-12-28 Pedro Gimeno <pggimeno@wanadoo.es>
+
+ * randmt.c (randseed_mt, default_state): Fix off-by-one bug on padding.
+ (randseed_mt): Add ASSERT checking result of mpz_export.
+
+2002-12-24 Kevin Ryde <kevin@swox.se>
+
+ * gmp.texi (Integer Import and Export): Clarify treatment of signs,
+ reported by Kent Boortz.
+
+ * randmt.c: Use gmp_uint_least32_t.
+ (randseed_mt): Add nails to mpz_export in case mt[i] more than 32 bits.
+
+ * gmp-impl.h (gmp_uint_least32_t): New typedef, replacing GMP_UINT32.
+ * configure.in (AC_CHECK_TYPES): Add uint_least32_t.
+ (AC_CHECK_SIZEOF): Add unsigned short.
+
+2002-12-22 Kevin Ryde <kevin@swox.se>
+
+ * gmp-impl.h (ULONG_PARITY) [generic C]: Mask result to a single bit.
+ (ULONG_PARITY) [_CRAY, __ia64]: New macros.
+ * tests/t-parity.c: New test.
+ * tests/Makefile.am (check_PROGRAMS): Add it.
+
+ * longlong.h (count_trailing_zeros) [ia64]: New macro.
+
+ * tests/t-count_zeros.c (check_various): Remove unused variable "n".
+
+ * mpn/x86/README: Revise notes on PIC, PLT and GOT.
+
+ * demos/perl/GMP.xs, demos/perl/GMP.pm, demos/perl/test.pl: Add "mt"
+ to GMP::Rand::randstate.
+
+2002-12-22 Pedro Gimeno <pggimeno@wanadoo.es>
+
+ * randmt.c (randseed_mt): Fix bug that might cause the generator to
+ return all zeros with certain seeds. Fix WARM_UP==0 case.
+ (gmp_randinit_mt): Initialize to a known state by default.
+ (randget_mt): Remove check for uninitialized buffer: no longer needed.
+ (recalc_buffer): Use ?: instead of two-element array.
+
+ * tests/rand/t-mt.c: New test.
+ * tests/rand/Makefile.am (check_PROGRAMS): Add it.
+
+2002-12-21 Kevin Ryde <kevin@swox.se>
+
+ * cxx/osdoprnti.cc: Use <cstdarg> and <cstring> rather than <stdarg.h>
+ and <string.h>. No need for <stdio.h>.
+
+ * demos/expr/expr.c, demos/expr/exprfa.c, demos/expr/exprfra.c,
+ demos/expr/exprza.c: Use mp_get_memory_functions, not
+ __gmp_allocate_func etc.
+ * demos/expr/t-expr.c: Don't use gmp-impl.h.
+ (numberof): New macro.
+
+ * gmp-h.in, gmp-impl.h (__gmp_allocate_func, __gmp_reallocate_func,
+ __gmp_free_func): Move declarations to gmp-impl.h
+
+ * mp_get_fns.c: New file.
+ * Makefile.am (libgmp_la_SOURCES, libmp_la_SOURCES): Add it.
+ * gmp-h.in (mp_get_memory_functions): Add prototype.
+ * gmp.texi (Custom Allocation): Add mp_get_memory_functions, refer to
+ "free" not "deallocate" function.
+ * gmpxx.h (struct __gmp_alloc_cstring): Use mp_get_memory_functions,
+ not __gmp_free_func.
+
+ * gmp-impl.h [__cplusplus]: Add <cstring> for strlen.
+ (gmp_allocated_string): Hold length in a field.
+ * cxx/osdoprnti.cc, cxx/osmpf.cc: Use this.
+
+2002-12-20 Torbjorn Granlund <tege@swox.com>
+
+ * tests/mpz/t-perfsqr.c (check_sqrt): Print more variables upon
+ failure.
+
+ * mpn/generic/rootrem.c: In Newton loop, pad qp with leading zero.
+
+2002-12-19 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/generic/rootrem.c: Allocate 1.585 (log2(3)) times more space
+ for pp temporary to allow for worst case overestimate of root.
+ Add some asserts.
+
+ * tests/mpz/t-root.c: Generalize and speed up.
+
+2002-12-19 Kevin Ryde <kevin@swox.se>
+
+ * tests/cxx/t-rand.cc (check_randinit): Add gmp_randinit_mt test.
+
+ * gmp-h.in: Don't bother trying to support Compaq C++ in pre-standard
+ I/O mode.
+ * gmp.texi (Notes for Particular Systems): Compaq C++ must be used in
+ "standard" iostream mode.
+
+2002-12-18 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/alpha/mod_34lsub1.asm: Add code for big-endian, using existing
+ little-endian code only if HAVE_LIMB_LITTLE_ENDIAN is defined.
+
+2002-12-18 Kevin Ryde <kevin@swox.se>
+
+ * configure.in (HAVE_LIMB_BIG_ENDIAN, HAVE_LIMB_LITTLE_ENDIAN): New
+ defines in config.m4.
+
+2002-12-17 Torbjorn Granlund <tege@swox.com>
+
+ * printf/printffuns.c (gmp_fprintf_reps): Make it actually work
+ for padding > 256.
+
+2002-12-17 Kevin Ryde <kevin@swox.se>
+
+ * tune/freq.c: Add <string.h> for memcmp.
+
+ * mpz/pprime_p.c: Use MPN_MOD_OR_MODEXACT_1_ODD.
+
+ * gmp.texi (Formatted Output Strings): %a and %A are C99 not glibc.
+ (Formatted Input Strings): Type "l" is for double too. Hex floats are
+ accepted for mpf_t.
+ (Formatted Input Functions): Describe tightened parse rule, clarify
+ return value a bit.
+
+ * scanf/doscan.c: Add hex floats, tighten matching to follow C99, for
+ instance "0x" is no longer acceptable to "%Zi".
+ Rename "invalid" label to avoid "invalid" variable, SunOS cc doesn't
+ like them the same.
+ * tests/misc/t-scanf.c: Update tests.
+ * tests/misc/t-locale.c (check_input): Don't let "0x" appear from fake
+ decimal point.
+
+ * config.guess (sparc*-*-*): Look at BSD sysctl hw.model to recognise
+ ultrasparcs.
+
+ * mpfr/tests/dummy.c: New file.
+ * mpfr/tests/Makefile.am (libfrtests_a_SOURCES): Add it.
+
+2002-12-14 Kevin Ryde <kevin@swox.se>
+
+ * mpbsd/Makefile.am (nodist_libmpbsd_la_SOURCES): Move these mpz
+ sources to libmpbsd_la_SOURCES directly, automake 1.7.2 now gets the
+ ansi2knr setups right for sources in other directories.
+
+ * mpfr/tests/Makefile.am: Add libfrtests.a in preparation for new mpfr.
+
+2002-12-13 Kevin Ryde <kevin@swox.se>
+
+ * mpfr/Makefile.am (mpfr_TEXINFOS, AM_MAKEINFOFLAGS): Allow for
+ fdl.texi in recent mpfr.
+
+ * configure.in (AC_PROG_EGREP): Ensure this is run outside the Cray
+ conditional AC_EGREP_CPP.
+
+ * configure.in (alpha*-*-*): Use gcc -Wa,-oldas if it works, to avoid
+ problems with new compaq "as" on OSF 5.1.
+
+ * mpn/Makefile.am (EXTRA_DIST): Remove Makeasm.am, automake 1.7.2 does
+ it automatically.
+
+ * acinclude.m4 (AC_LANG_FUNC_LINK_TRY(C)): Remove this hack, fixed by
+ autoconf 2.57.
+
+ * configure.in (AC_CONFIG_LIBOBJ_DIR): Set to mpfr, for the benefit of
+ new mpfr using LIBOBJ.
+
+ * configure.in: (AM_INIT_AUTOMAKE): Use "gnu no-dependencies
+ $(top_builddir)/ansi2knr".
+ * */Makefile.am (AUTOMAKE_OPTIONS): Remove, now in configure.in.
+
+ * configure, config.in, INSTALL.autoconf: Update to autoconf 2.57.
+ * */Makefile.in, configure, aclocal.m4, install-sh, mkinstalldirs:
+ Update to automake 1.7.2.
+
+ * gmp.texi (Build Options): Add hppa64 to cpu types.
+ (ABI and ISA): Add gcc to hppa 2.0.
+ (Debugging): Add maximum debuggability config options.
+ (Language Bindings): Add Arithmos, reported by Johan Vervloet.
+ (Formatted Output Strings): 128 bits is about 40 digits, ll is only
+ for long long not long double.
+ (Formatted Input Strings): ll is only for long long not long double.
+
+ * mpz/divis.c, mpz/divis_ui.c, mpz/cong.c, mpz/cong_ui.c: Allow d=0,
+ under the rule n==c mod d iff exists q satisfying n=c+q*d.
+ * gmp.texi (Integer Division): Describe this.
+ Suggested by Jason Moxham.
+
+2002-12-13 Pedro Gimeno <pggimeno@wanadoo.es>
+
+ * randlc2x.c (lc): Remove check for seedn < an, which is now
+ superfluous. Add ASSERT to ensure it's correct. Add ASSERT to check
+ precondition of __GMPN_ADD.
+ (gmp_randinit_lc_2exp): Avoid reallocation by allocating one extra bit
+ for both seed and a. Simplify seedn < p->_cn case.
+
+ * tests/rand/t-lc2exp.c (check_bigs): Test negative seeds.
+
+2002-12-12 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/pa32/pa-defs.m4 (PROLOGUE_cpu): Zap spurious argument to `.proc'.
+ Add empty `.callinfo'.
+
+2002-12-11 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/x86/pentium4/sse2/addmul_1.asm: Don't reuse `ret' symbol for a
+ label.
+
+2002-12-11 Kevin Ryde <kevin@swox.se>
+
+ * configure.in (hppa*-*-*): Don't use gcc -mpa-risc-2-0 in ABI=1.0.
+
+ * mpn/pa32/pa-defs.m4: New file, arranging for .proc/.procend.
+ * configure.in (hppa*-*-*): Use it.
+
+ * printf/doprnt.c: Comments on "ll" versus "L".
+
+ * tests/mpz/t-div_2exp.c: Reduce tests, especially the random ones.
+
+2002-12-11 Torbjorn Granlund <tege@swox.com>
+
+ * mpz/get_d.c (limb2dbl): New macro for conversion to `double'.
+ Define it to something non-trivial for 64-bit hppa.
+ * mpq/get_d.c: Likewise.
+ * mpf/get_d.c: Likewise.
+
+ * mpn/x86/pentium4/sse2/addmul_1.asm: Unroll to save one c/l.
+
+2002-12-09 Kevin Ryde <kevin@swox.se>
+
+ * tune/Makefile.am: Don't use -static under --disable-static, it tends
+ not to work.
+ * configure.in (ENABLE_STATIC): New AM_CONDITIONAL.
+
+ * gmp-h.in: Use <iostream> instead of <iosfwd> with Compaq C++ in
+ pre-standard I/O mode.
+
+ * tests/mpz/t-jac.c, tests/mpz/t-scan.c: Reduce tests.
+
+2002-12-08 Kevin Ryde <kevin@swox.se>
+
+ * configure.in (*-*-ultrix*): Remove forcible --disable-shared,
+ believe this was a generic problem with libtool, now gone.
+
+2002-12-08 Torbjorn Granlund <tege@swox.com>
+
+ * gmp-impl.h (USE_LEADING_REGPARM): Disable for PIC code generation.
+
+2002-12-07 Torbjorn Granlund <tege@swox.com>
+
+ * tests/cxx/t-misc.cc (check_mpq): Use 0/1 for canonical 0 in
+ mpq_cmp_ui calls.
+
+ * configure.in (hppa2.0*-*-*): Pass +O2 instead of +O3 to work around
+ compiler bug with mpfr/tests/tdiv.
+
+2002-12-07 Kevin Ryde <kevin@swox.se>
+
+ * configure.in (hppa2.0*-*-* ABI=2.0n): Make -mpa-risc-2-0 optional.
+ New hppa-level-2.0 test using GMP_HPPA_LEVEL_20 to detect assembler
+ support for 2.0n.
+ * acinclude.m4 (GMP_PROG_CC_WORKS): Add code that provokes an error
+ from gcc -mpa-risc-2-0 if the assembler doesn't know 2.0 instructions.
+ (GMP_HPPA_LEVEL_20): New macro.
+
+2002-12-07 Pedro Gimeno <pggimeno@wanadoo.es>
+
+ * gmp-impl.h (gmp_randfnptr_t.randseed_fn) Return void.
+ (LIMBS_PER_ULONG, MPN_SET_UI): New macros.
+ (MPZ_FAKE_UI): Rename couple of parameters.
+
+ * randlc2x.c (gmp_rand_lc_struct): _mp_c and _mp_c_limbs replaced
+ with mpn style _cp and _cn. All callers changed.
+ (randseed_lc): Fix limbs(seed) > bits_to_limbs(m2exp) case.
+ Remove return value.
+ (gmp_randinit_lc_2exp): Attempt to avoid redundant reallocation.
+
+ * randmt.c (mangle_seed): New function by Kevin.
+ (randseed_mt): Use it instead of mpz_powm, for performance. Remove
+ return value. Remove commented out code (an inferior alternative to
+ mpz_export).
+
+ * randsdui.c (gmp_randseed_ui): Use MPZ_FAKE_UI.
+
+ * tests/rand/t-lc2exp.c (check_bigm, check_bigs): New tests.
+ * tests/rand/t-urndmm.c: Add L to constants in calls, for K&R.
+
+2002-12-06 Torbjorn Granlund <tege@swox.com>
+
+ * configure.in: Remove -g.
+ (hppa*-*-*): Pass -Wl,+vnocompatwarnings with +DA2.0.
+
+2002-12-05 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/pa64/sqr_diagonal.asm: Remove .entry, .proc, .procend.
+ * mpn/pa64/udiv.asm: Likewise.
+
+2002-12-05 Kevin Ryde <kevin@swox.se>
+
+ * mpn/pa64/sub_n.asm: Remove space in "sub, db" which gas objects to.
+ * mpn/pa64/*.asm, tune/hppa2.asm: Use ".level 2.0" for 2.0n, since gas
+ doesn't like ".level 2.0N".
+
+ * configure.in (hppa*-*-*): Group path and flags choices, for clarity.
+ (hppa1.0*-*-*): Use gcc -mpa-risc-1-0 when available.
+ (hppa2.0*-*-*): Ditto -mpa-risc-2-0.
+ (*-*-hpux*): Exclude ABI=2.0w for hpux[1-9] and hpux10, rather than
+ the converse of allowing it for hpux1[1-9]; ie. list the bad systems
+ rather than try to guess the good systems.
+ (hppa2.0*-*-*) [ABI=2.0n ABI=2.0w]: Add gcc to likely compilers.
+ (hppa*-*-*) [gcc]: Test sizeof(long) to differentiate a 32-bit or
+ 64-bit build of the compiler.
+ (hppa64-*-*): Add this as equivalent to hppa2.0-*-*.
+ * acinclude.m4 (GMP_C_TEST_SIZEOF): New macro.
+
+ * tests/tests.h (ostringstream::str): Must null-terminate
+ ostrstream::str() for the string constructor.
+
+2002-12-04 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/pa32/hppa1_1/udiv.asm: Don't wrap symbol to INT64 in L() stuff.
+
+ * longlong.h (mpn_udiv_qrnnd_r based udiv_qrnnd): Fix typo.
+
+ * mpn/powerpc32/powerpc-defs.m4: Define float registers with `f'
+ prefix.
+
+2002-12-04 Kevin Ryde <kevin@swox.se>
+
+ * gmp.texi (Floating-point Functions): Note the mantissa is binary and
+ decimal fractions cannot be represented exactly. Suggested by Serge
+ Winitzki.
+ (Known Build Problems): Note libtool stripping options when linking.
+ Reported by Vincent Lefevre.
+
+ * acinclude.m4 (GMP_ASM_LABEL_SUFFIX): Don't make an empty result a
+ failure, that's a valid result.
+ (GMP_ASM_GLOBL): Establish this from the host cpu type.
+ (IA64_PATTERN): New macro.
+ (GMP_PROG_EXEEXT_FOR_BUILD, GMP_C_FOR_BUILD_ANSI,
+ GMP_CHECK_LIBM_FOR_BUILD): Remove temporary files created.
+ * configure.in: Use IA64_PATTERN.
+
+2002-12-03 Torbjorn Granlund <tege@swox.com>
+
+ * tune/hppa.asm: Use config.m4.
+ * tune/hppa2.asm: Likewise.
+ * tune/hppa2w.asm: Likewise.
+
+ * mpn/pa64: Use LDEF.
+
+2002-12-03 Kevin Ryde <kevin@swox.se>
+
+ * INSTALL: Use return rather than exit in the example programs.
+ Suggested by Richard Dawe.
+
+ * gmp.texi (Build Options): Move non-unix notes to ...
+ (Notes for Particular Systems): ... here. Mention MS Interix,
+ reported by Paul Leyland.
+ (C++ Interface Random Numbers): Add gmp_randinit_mt to examples.
+
+ * acinclude.m4 (GMP_ASM_LABEL_SUFFIX): Must test empty suffix first,
+ for the benefit of hppa hp-ux.
+ (GMP_ASM_UNDERSCORE): Grep the output of "nm" instead of trying to
+ construct an asm file, and in case of failure fallback on no
+ underscore and a warning.
+
+ * longlong.h (count_leading_zeros, count_trailing_zeros) [ev67, ev68]:
+ Restrict __asm__ ctlz and cttz to __GNUC__.
+
+ * gen-psqr.c (HAVE_CONST, const): New macros.
+
+ * tests/cxx/t-rand.cc (check_randinit): Add gmp_randinit_mt.
+
+2002-12-02 Torbjorn Granlund <tege@swox.com>
+
+ * gmp-impl.h: Split popc_limb again, combined version gives too many
+ compiler warnings.
+
+2002-12-01 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/generic/gcdext.c (div1): Disable unused function.
+
+ * mpz/root.c: Don't include stdlib.h or longlong.h.
+ * mpz/rootrem.c: Likewise.
+
+ * extract-dbl.c: abort => ASSERT_ALWAYS.
+ * mpz/set_d.c: Likewise.
+ * mpn/generic/tdiv_qr.c: Likewise.
+
+ * gen-psqr.c (f_cmp_fraction, f_cmp_divisor): Change parameter to
+ `const void *', to match qsort spec.
+
+2002-12-01 Kevin Ryde <kevin@swox.se>
+
+ * gmp.texi (Integer Division): Fix a couple of @math's for tex.
+ Use @dots in more places.
+
+ * tests/cxx/t-locale.cc: Test non std::locale systems too.
+ * tests/cxx/clocale.c: New file, reinstating what was localeconv.c,
+ and subverting nl_langinfo too.
+ * tests/cxx/Makefile.am (t_locale_SOURCES): Add it.
+
+ * tests/tests.h (ostringstream, istringstream): Provide fakes of these
+ if <sstream> not available.
+ * tests/cxx/t-locale.cc, tests/cxx/t-ostream.cc: Remove <sstream>.
+ * configure.in (AC_CHECK_HEADERS) [C++]: Add <sstream>.
+
+2002-11-30 Torbjorn Granlund <tege@swox.com>
+
+ * printf/doprnt.c (__gmp_doprnt): Comment out a `break' to shut up
+ compiler warnings.
+
+ * mpn/ia64/invert_limb.asm: Add `many' hints to return insns.
+
+ * mpn/ia64/divrem_1.asm: Allocate more local registers; put b0 in
+ one of them.
+
+ * mpn/ia64/popcount.asm: Properly restore register ar.lc.
+
+ * longlong.h (umul_ppmm) [ia64]: Form both product parts in asm.
+
+ * mpz/bin_uiui.c: Cast umul_ppmm operands.
+
+ * scanf/doscan.c (gmpscan): Remove unused label store_get_digits.
+
+ * gmp-impl.h: #undef MIN and MAX before #defining.
+
+ * mpn/ia64/copyi.asm: Add `;' after bundle declarators.
+ * mpn/ia64/copyd.asm: Likewise.
+
+ * mpn/ia64/divrem_1.asm: Add some syntax to placid the HP-UX assembler.
+
+2002-11-30 Kevin Ryde <kevin@swox.se>
+
+ * configure.in (AC_CHECK_HEADERS): Add nl_types.h.
+ * tests/misc/t-locale.c: Use this, for nl_item on netbsd 1.4.1.
+
+2002-11-29 Torbjorn Granlund <tege@swox.com>
+
+ * tests/devel/addmul_1.c: Provide prototype for mpn_print.
+ (OPS): Account for function overhead.
+ * tests/devel/{submul_1.c,mul_1.c,add_n.c,sub_n.c}: Likewise.
+
+ * mpn/ia64/addmul_1.asm: Rewrite.
+
+2002-11-28 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/ia64/sqr_diagonal.asm: Don't allocate any registers.
+
+ * mpn/ia64/submul_1.asm: Adapt to Itanium 2.
+
+ * mpn/ia64/mul_1.asm: Fix typo in HAVE_ABI_32 code.
+
+ * mpn/ia64/add_n.asm: Rewrite.
+ * mpn/ia64/sub_n.asm: Rewrite.
+
+2002-11-28 Kevin Ryde <kevin@swox.se>
+
+ * mpn/Makefile.am (nodist_EXTRA_libmpn_la_SOURCES): Use this rather
+ than libdummy.
+ * tests/Makefile.am (EXTRA_libtests_la_SOURCES): Use this for
+ x86call.asm and x86check.c rather than libdummy.
+
+2002-11-27 Torbjorn Granlund <tege@swox.com>
+
+ * tests/mpz/t-mul.c: Implement reference Karatsuba multiplication.
+ Rewrite testing scheme to run fewer really huge tests.
+
+2002-11-26 Torbjorn Granlund <tege@swox.com>
+
+ * tests: Decrease repetition count for some of the slowest tests.
+
+ * mpn/ia64/divrem_1.asm: New file.
+
+2002-11-25 Torbjorn Granlund <tege@swox.com>
+
+ * mpfr/tests/tdiv.c: Decrease number of performed tests.
+
+2002-11-23 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/ia64/mul_1.asm: Rewrite.
+
+2002-11-23 Kevin Ryde <kevin@swox.se>
+
+ * mpn/ia64/README: Add some references.
+
+ * gmp.texi (Build Options): Add itanium and itanium2, mention DocBook
+ and XML from makeinfo, add texinfo top level cross reference.
+ (Integer Division): Try to clarify 2exp functions a bit.
+ (C++ Interface Floats): Giving bad string to constructor is undefined.
+ (C++ Interface Integers, C++ Interface Rationals): Ditto, and show
+ default base in prototype, not the description.
+
+ * config.sub, config.guess, configure.in (itanium, itanium2): New cpu
+ types.
+
+ * tests/misc/t-printf.c, tests/misc/t-scanf.c (check_misc): Suppress
+ %zd test on glibc prior to 2.1, it's not supported.
+
+2002-11-22 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/ia64/copyi.asm: Optimize for Itanium 2.
+ * mpn/ia64/copyd.asm: Likewise.
+
+2002-11-20 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/ia64/sqr_diagonal.asm: New file.
+
+ * mpn/ia64/submul_1.asm: Handle vl == 0 specially.
+
+2002-11-20 Kevin Ryde <kevin@swox.se>
+
+ * tests/cxx/t-locale.cc: Test with locales imbued into stream, use
+ <sstream>, eliminated some C-isms. istream tests disabled, not yet
+ locale-ized.
+ * tests/cxx/Makefile.am (t_locale_SOURCES): Remove localeconv.c.
+ * tests/cxx/localeconv.c: Remove file.
+
+ * configure.in (AC_CHECK_TYPES) [C++]: Add std::locale.
+ * printf/doprntf.c: Add decimal point parameter, remove localeconv use.
+ * gmp-impl.h (__gmp_doprnt_mpf): Update prototype, bump symbol to
+ __gmp_doprnt_mpf2 to protect old libgmpxx.
+ * cxx/osmpf.cc: Use this with ostream locale decimal_point facet.
+ * printf/doprnt.c: Ditto, with GMP_DECIMAL_POINT.
+
+ * gmp-h.in: More comments on __declspec for windows DLLs.
+
+ * mpf/set_str.c, scanf/doscan.c: Cast through "unsigned char" for
+ decimal point string, same as input chars.
+
+ * configure.in (AC_CHECK_HEADERS): Add langinfo.h.
+ (AC_CHECK_FUNCS): Add nl_langinfo.
+ * gmp-impl.h (GMP_DECIMAL_POINT): New macro.
+ * mpf/out_str.c, mpf/set_str.c, scanf/doscan.c: Use it, and don't
+ bother with special code for non-locale systems.
+ * tests/misc/t-locale.c: Subvert nl_langinfo too.
+
+ * configure.in, acinclude.m4 (GMP_ASM_X86_GOT_UNDERSCORE): New macro.
+ * mpn/x86/x86-defs.m4 (_GLOBAL_OFFSET_TABLE_): New macro, inserting
+ extra underscore for OpenBSD.
+ * mpn/x86/README (_GLOBAL_OFFSET_TABLE_): Update notes.
+ Reported by Christian Weisgerber.
+
+ * tests/cxx/t-rand.cc (check_randinit): New function, collecting up
+ constructor tests.
+
+ * tests/cxx/t-ostream.cc: Use <sstream> instead of <strstream>, use
+ compare instead of strcmp.
+
+ * gmpxx.h (__gmp_randinit_lc_2exp_size_t): Return type is int.
+
+2002-11-18 Kevin Ryde <kevin@swox.se>
+
+ * tune/speed.c (r_string): Use CNST_LIMB with <N>bits, spotted by
+ Torbjorn.
+
+2002-11-19 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/ia64/mul_1.asm: Remove redundant cmp from prologue code.
+ Streamline prologue.
+ * mpn/ia64/addmul_1.asm: Likewise.
+ * mpn/ia64/submul_1.asm: New file.
+ * mpn/ia64/submul_1.c: Remove.
+
+2002-11-17 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/generic/popham.c: New file, using new faster algorithm.
+ * mpn/generic/popcount.c: Remove.
+ * mpn/generic/hamdist.c: Remove.
+
+ * mpn/ia64/addmul_1.asm: Don't clobber callee-saves register f16.
+ * mpn/ia64/mul_1.asm: Likewise.
+
+ * mpn/ia64/addmul_1.asm: Add pred.rel declarations. Resolve RAW
+ hazards for condition code registers, duplicating code as needed. Add
+ prediction to all branches.
+ * mpn/ia64/mul_1.asm: Likewise.
+ * mpn/ia64/add_n.asm: Likewise.
+ * mpn/ia64/sub_n.asm: Likewise.
+ * mpn/ia64/copyi.asm: Likewise.
+ * mpn/ia64/copyd.asm: Likewise.
+
+ * mpn/generic/random2.c: Add a cast to silence some compilers.
+
+2002-11-16 Torbjorn Granlund <tege@swox.com>
+
+ * mpz/powm.c: Cap allocation by limiting k to 10 (512 precomputed
+ values).
+
+2002-11-16 Kevin Ryde <kevin@swox.se>
+
+ * configure.in, gmp.texi: Remove powerpc64 ABI=32L, doesn't work and
+ is unlikely to ever do so.
+ * configure.in: Allow ABI=32 for powerpc64.
+ Reported by David Edelsohn.
+
+2002-11-14 Kevin Ryde <kevin@swox.se>
+
+ * mpn/Makefile.am (nodist_libdummy_la_SOURCES): Add addmul_2.c
+ addmul_3.c addmul_4.c addmul_5.c addmul_6.c addmul_7.c addmul_8.c.
+
+ * gmp-h.in (__GMP_DECLSPEC_EXPORT, __GMP_DECLSPEC_IMPORT) [__GNUC__]:
+ Use __dllexport__ and __dllimport__ to keep out of application
+ namespace.
+
+2002-11-14 Gerardo Ballabio <gerardo.ballabio@unimib.it>
+
+ * gmpxx.h (__gmp_randinit_default_t, __gmp_randinit_lc_2exp_t,
+ __gmp_randinit_lc_2exp_size_t): Use extern "C" { typedef ... }, for
+ the benefit of g++ prior to 3.2.
+
+2002-11-12 Kevin Ryde <kevin@swox.se>
+
+ * gmpxx.h (gmp_randclass constructors): Patch from Roberto Bagnara to
+ use extern "C" on C function pointer arguments.
+
+2002-11-09 Kevin Ryde <kevin@swox.se>
+
+ * configure.in, Makefile.am, printf/Makefile.am,
+ printf/repl-vsnprintf.c: Handle vsnprintf replacement with C
+ conditionals.
+
+ * acinclude.m4 (AC_LANG_FUNC_LINK_TRY(C)): Workaround troubles recent
+ HP cc +O3 causes for AC_CHECK_FUNCS.
+
+ * gmp.texi (Notes for Particular Systems): Add Sparc app regs.
+ (Debugging): Note gcc -fstack options to detect overflow.
+ (Formatted Output Strings, Formatted Input Strings): Format strings
+ are not multibyte.
+
+2002-11-06 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/generic/tdiv_qr.c: Remove a bogus assert.
+
+2002-11-05 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/generic/tdiv_qr.c: Remove two dead mpn_divrem_2 calls.
+
+2002-11-04 Kevin Ryde <kevin@swox.se>
+
+ * acinclude.m4 (GMP_C_INLINE): Don't define "inline" for C++.
+
+ * demos/expr/expr-impl.h (stdarg.h): Test __DECC same as gmp.h.
+
+ * mpbsd/mtox.c, printf/obprintf.c, printf/obvprintf.c,
+ scanf/vsscanf.c, demos/expr/expr.c, demos/expr/exprf.c,
+ demos/expr/exprfa.c, demos/expr/exprfr.c, demos/expr/exprq.c,
+ demos/expr/exprz.c, demos/expr/exprza.c: Add <string.h> for strlen and
+ memcpy.
+
+2002-11-02 Kevin Ryde <kevin@swox.se>
+
+ * longlong.h: Test __x86_64__ not __x86_64. Reported by Andreas
+ Jaeger.
+
+ * mpz/import.c, mpz/export.c: Use char* subtract from NULL to get
+ pointer alignment, for the benefit of Cray vector systems.
+
+ * cxx/ismpf.cc: Use <clocale>.
+ * tests/cxx/t-locale.cc: No need to conditionalize <clocale>.
+
+ * scanf/doscan.c: Don't use isascii, rely on C99 ctype.h.
+
+ * gmp.texi (Build Options): Describe CC_FOR_BUILD, cross reference
+ texinfo manual.
+ (ABI and ISA): Add powerpc620 and powerpc630 to powerpc64, add NetBSD
+ and OpenBSD sparc64.
+ (Notes for Package Builds): Cross reference libtool manual.
+ (Notes for Particular Systems): Add OpenBSD to non-MMX versions of gas.
+ (Known Build Problems): Add MacOS X C++ shared libraries.
+
+2002-10-31 Kevin Ryde <kevin@swox.se>
+
+ * gmp-impl.h, tune/speed.c, tune/speed.h, tune/common.c, tune/many.pl,
+ tests/devel/try.c, tests/tests.h, tests/refmpn.c (mpn_addmul_5,
+ mpn_addmul_6, mpn_addmul_7, mpn_addmul_8): Add testing and measuring.
+ * configure.in (config.in): Add #undefs of HAVE_NATIVE_mpn_addmul_5,
+ HAVE_NATIVE_mpn_addmul_6, HAVE_NATIVE_mpn_addmul_7,
+ HAVE_NATIVE_mpn_addmul_8.
+ (gmp_mpn_functions_optional): Add addmul_5 addmul_6 addmul_7 addmul_8.
+
+ * tests/devel/try.c (ASSERT_CARRY): Remove, now in gmp-impl.h
+ (try_one): Do dest setups after sources, for benefit of
+ dst0_from_src1.
+
+2002-11-01 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/generic/tdiv_qr.c: Avoid quadratic behaviour for
+ sub-division when numerator is more than twice the size of the
+ denominator. Simplify loop logic for the same case. Clean up a
+ few comments.
+
+2002-10-29 Torbjorn Granlund <tege@swox.com>
+
+ * configure.in (*-cray-unicos*): Pass -hnofastmd again.
+
+2002-10-25 Torbjorn Granlund <tege@swox.com>
+
+ * tests/tadd.c: Disable test of denorms.
+
+2002-10-23 Linus Nordberg <linus@swox.se>
+
+ * gmp.texi (Introduction to GMP): Update section about mailing
+ lists.
+
+2002-10-23 Kevin Ryde <kevin@swox.se>
+
+ * gmp-h.in (__GMP_ATTRIBUTE_PURE): Suppress this when
+ __GMP_NO_ATTRIBUTE_CONST_PURE is defined.
+ * gmp-impl.h (ATTRIBUTE_CONST): Ditto.
+ * tune/common.c: Use __GMP_NO_ATTRIBUTE_CONST_PURE.
+
+ * tune/speed.h, tune/many.pl: Remove ATTRIBUTEs from prototypes.
+ * tune/speed.h: Remove various "dummy" variables attempting to keep
+ "pure" calls live, no longer necessary. They weren't sufficient for
+ recent MacOS cc anyway.
+
+2002-10-21 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/cray/ieee/addmul_1.c: Handle overlap as in mul_1.c.
+ * mpn/cray/ieee/submul_1.c: Likewise.
+
+2002-10-19 Kevin Ryde <kevin@swox.se>
+
+ * configure.in (sparcv9 etc -*-*bsd*): Add support for NetBSD and
+ OpenBSD sparc64. Reported by Christian Weisgerber.
+ (AC_CHECK_HEADERS): Add sys/param.h for sys/sysctl.h on *BSD.
+
+ * demos/calc/calc.y: Change ={ to {, needed for bison 1.50.
+
+ * longlong.h (count_leading_zeros, count_trailing_zeros) [x86_64]:
+ Should be UDItype.
+
+ * mpz/set_str.c, mpf/set_str.c, mpbsd/xtom.c, scanf/sscanffuns.c: Cast
+ chars through "unsigned char" to zero extend, required by C99 ctype.h.
+
+2002-10-18 Torbjorn Granlund <tege@swox.com>
+
+ * tests/mpz/t-root.c: Test also mpz_rootrem.
+
+ * mpn/generic/rootrem.c: Avoid overflow problem when n is huge.
+
+ * mpz/root.c: Avoid overflow problems in allocation computation; also
+ simplify it. Misc cleanups.
+
+ * mpz/rootrem.c: New file.
+ * Makefile.am, mpz/Makefile.am, gmp-h.in: Add them.
+
+2002-10-17 Torbjorn Granlund <tege@swox.com>
+
+ * gmp-impl.h (popc_limb): Combine variants.
+
+2002-10-14 Kevin Ryde <kevin@swox.se>
+
+ * configure.in (AC_CHECK_HEADERS): Add sys/time.h for sys/resource.h
+ test, needed by SunOS, and next autoconf will insist headers actually
+ compile.
+
+2002-10-08 Kevin Ryde <kevin@swox.se>
+
+ * tune/time.c (speed_time_init): Allow for Cray times() apparently
+ being a cycle counter.
+
+ * dumbmp.c (mpz_get_str): Fix buf size allocation.
+
+ * tests/trace.c, tests/tests.h (mp_limb_trace): New function.
+
+ * tune/speed-ext.c (SPEED_EXTRA_PROTOS): Use __GMP_PROTO.
+ * tests/devel/try.c (malloc_region): Add a cast for SunOS cc.
+
+ * configure.in (AC_CHECK_FUNCS): Add strerror.
+ (AC_CHECK_DECLS): Add sys_errlist, sys_nerr.
+ * tune/time.c, tests/devel/try.c: Use them.
+
+2002-10-05 Kevin Ryde <kevin@swox.se>
+
+ * configure.in (AC_CHECK_HEADERS): Test float.h, not in SunOS cc.
+ * printf/repl-vsnprintf.c: Use this.
+
+ * configure.in (*sparc*-*-*): Collect up various options for clarity,
+ use gcc -mcpu=supersparc and ultrasparc3, use cc -xchip, don't use
+ -xtarget=native, use cc configs with acc, merge SunOS bundled cc and
+ SunPRO cc configs.
+
+ * gmp-impl.h (gmp_randfnptr_t): Use __GMP_PROTO.
+ (MPZ_REALLOC): Cast _mpz_realloc return value to mp_ptr, for the
+ benefit of SunOS cc which requires pointers of the same type on the
+ two legs of a ?:.
+
+ * dumbmp.c (mpz_realloc): Add a cast to avoid a warning from SunOS cc.
+
+ * acinclude.m4: Allow for i960 b.out default cc output.
+
+ * gmp.texi (Random State Initialization): Add gmp_randinit_mt.
+ (Perfect Square Algorithm): Describe new mpn_mod_34lsub1 use.
+ (Factorial Algorithm): Describe Jason's new code.
+ (Binomial Coefficients Algorithm): Ideas about improvements
+ moved to doc/projects.html.
+ (Contributors): Add Jason Moxham and Pedro Gimeno.
+
+2002-10-03 Kevin Ryde <kevin@swox.se>
+
+ * gen-psqr.c: New file.
+ * Makefile.am, mpn/Makefile.am: Use it to generate mpn/perfsqr.h.
+ * mpn/generic/perfsqr.c: Use generated data, put mod 256 data into
+ limbs to save space, use mpn_mod_34lsub1 when good.
+ * tests/mpn/t-perfsqr.c: New file.
+ * tests/mpn/Makefile.am (check_PROGRAMS): Add it.
+ * tests/mpz/t-perfsqr.c (check_modulo): New test.
+ (check_sqrt): New function holding current tests.
+
+ * configure.in (AC_INIT): Modernize to package name and version here
+ rather than AM_INIT_AUTOMAKE, add bug report email.
+ (AC_CONFIG_SRCDIR): New macro.
+
+ * gmp-impl.h (ROUND_UP_MULTIPLE): Fix for non-power-of-2 moduli (not
+ normal in current uses), clarify the comments a bit.
+
+2002-09-30 Kevin Ryde <kevin@swox.se>
+
+ * mpn/Makeasm.am (.s.lo): Add --tag=CC for the benefit of CCAS!=CC,
+ same as .S.lo and .asm.lo.
+
+ * Makefile.am (gen-fac_ui, gen-fib, gen-bases): Quote source files in
+ test -f stuff to avoid Sun make rewriting them.
+
+2002-09-28 Kevin Ryde <kevin@swox.se>
+
+ * tests/devel/try.c, tune/speed.c: Avoid strings longer than C99
+ guarantees.
+
+ * tests/refmpn.c, tests/tests.h (refmpn_zero_extend, refmpn_normalize,
+ refmpn_sqrtrem): New functions.
+ * tests/devel/try.c (TYPE_SQRTREM): Use refmpn_sqrtrem.
+ (compare): Correction to tr->dst_size subscripting.
+
+ * dumbmp.c: Add several new functions, allow for initial n<d in
+ mpz_tdiv_q (now in mpz_tdiv_qr actually).
+
+ * gen-bases.c (chars_per_limb): Get GMP_NUMB_BITS for base==2,
+ similarly other powers of 2, which this was in the past.
+ * tests/refmpn.c (refmpn_chars_per_limb): Ditto.
+ * tests/mpn/t-mp_bases.c: Test chars_per_limb for power-of-2 bases too.
+
+ * Makefile.am, mpz/Makefile.am: Setups for gen-fac_ui.c generating
+ mpz/fac_ui.h.
+
+2002-09-28 Jason Moxham <J.L.Moxham@maths.soton.ac.uk>
+
+ * dumbmp.c (mpz_pow_ui, mpz_addmul_ui, mpz_root): New functions.
+ * gen-fac_ui.c: New file.
+ * mpz/fac_ui.c: Rewrite.
+
+2002-09-26 Kevin Ryde <kevin@swox.se>
+
+ * tests/cxx/localeconv.c: New file, split from t-locale.cc.
+ * tests/cxx/t-locale.cc: Use it.
+ * tests/cxx/Makefile.am (t_locale_SOURCES): Add it.
+
+ * tests/cxx/Makefile.am: Updates for Gerardo's new test programs.
+
+2002-09-26 Gerardo Ballabio <gerardo.ballabio@unimib.it>
+
+ * gmpxx.h (__gmp_cmp_function): Bug fixes in double/mpq and
+ double/mpfr comparisons.
+
+ * tests/cxx/t-assign.cc, tests/cxx/t-binary.cc, tests/cxx/t-constr.cc,
+ tests/cxx/t-ternary.cc, tests/cxx/t-unary.cc: Revise and add various
+ tests, including some for mpfr, some split from t-expr.cc.
+ * tests/cxx/t-locale.cc: Modernize include files.
+ * tests/cxx/t-ostream.cc: Modernize include files, use cout rather
+ than printf for diagnostics.
+ * tests/cxx/t-misc.cc, tests/cxx/t-rand.cc: New file, split from
+ t-allfuns.cc.
+ * tests/cxx/t-ops.cc: New file, some split from t-allfuns.cc.
+ * tests/cxx/t-prec.cc: New file.
+ * tests/cxx/t-allfuns.cc, tests/cxx/t-expr.cc: Remove files.
+
+2002-09-25 Torbjorn Granlund <tege@swox.com>
+
+ * configure.in (*-cray-unicos*): Remove -hscalar0, it causes too much
+ performance loss. Let's trust Cray to fix their compilers.
+
+2002-09-24 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/powerpc32/add_n.asm: Rewrite.
+ * mpn/powerpc32/sub_n.asm: Rewrite.
+
+2002-09-24 Pedro Gimeno <pggimeno@wanadoo.es>
+
+ * randlc2x.c: Prepare for nails by changing type of _mp_c to mpz_t,
+ make _mp_seed fixed-size, disallow SIZ(a)==0 to optimize comparisons
+ for mpn_mul.
+ * gmp-impl.h (MPZ_FAKE_UI): New macro.
+
+ * randmt.c: Some constants made long for K&R compliance; remove UL at
+ the end of other constants; use mp_size_t where appropriate; use
+ mpz_export to split the seed.
+
+ * gmp-impl.h: Remove type cast in RNG_FNPTR and RNG_STATE, to allow
+ them to be used as lvalues.
+ * randclr.c, randlc2x.c, randmt.c, randsd.c: All callers changed.
+
+ * mpz/urandomm.c: Replace mpn_cmp with MPN_CMP.
+
+ * tests/rand/gen.c: Get rid of gmp_errno.
+
+2002-09-24 Kevin Ryde <kevin@swox.se>
+
+ * gmp.texi (Custom Allocation): Keep allocate_function etc out of the
+ function index by using @deftypevr.
+ More index entries.
+
+2002-09-24 Gerardo Ballabio <gerardo.ballabio@unimib.it>
+
+ * gmpxx.h (mpfr_class constructors from strings): Precision was set
+ incorrectly, fixed.
+
+2002-09-23 Torbjorn Granlund <tege@swox.com>
+
+ * mpf/urandomb.c: Don't crash for overlarge nbits argument.
+ Let nbits==0 mean to fill number with random bits.
+
+2002-09-21 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/alpha/mod_34lsub1.asm: Add r31 dummy operand to `br' instruction.
+
+2002-09-20 Gerardo Ballabio <gerardo.ballabio@unimib.it>
+
+ * gmpxx.h (__gmp_binary_equal, __gmp_binary_not_equal): Fix broken
+ mpq/double functions.
+
+2002-09-18 Torbjorn Granlund <tege@swox.com>
+
+ * randmt.c (randget_mt): Fix typo.
+
+2002-09-18 Kevin Ryde <kevin@swox.se>
+
+ * gmp-impl.h (_gmp_rand): Avoid evaluating "state" more than once, for
+ the benefit places calling it with RANDS.
+
+ * randmt.c (randseed_mt): Use mpz_init for mod and seed1, for safety.
+
+ * tune/tuneup.c (sqr_karatsuba_threshold): Initialize to
+ TUNE_SQR_KARATSUBA_MAX so mpn_sqr_n works for randmt initialization.
+
+ * gmp.texi (Integer Comparisons): Remove mention of non-existent
+ mpz_cmpabs_si, reported by Conrad Curry.
+
+ * tune/speed.c, tune/speed.h, tune/common.c: Add gmp_randseed,
+ gmp_randseed_ui and mpz_urandomb.
+
+2002-09-18 Pedro Gimeno <pggimeno@wanadoo.es>
+
+ * tests/rand/gen.c: Add mt, remove lc and bbs.
+
+ * Makefile.am (libgmp_la_SOURCES): Add randmt.c, remove randlc.c and
+ randraw.c.
+
+ * randmt.c: New file.
+ * gmp-h.in (gmp_randinit_mt): Add prototype.
+ * randdef.c: Use gmp_randinit_mt.
+
+ * gmp-impl.h (RNG_FNPTR, RNG_STATE): New macros.
+ (gmp_randfnptr_t): New structure.
+ (_gmp_rand): Now a macro not a function.
+ * gmp-h.in (__gmp_randata_lc): Remove, now internal to randlc2x.c.
+ (__gmp_randstate_struct): Revise comments on field usage.
+ * randsd.c, randclr.c: Use function pointer scheme.
+ * randsdui.c: Use gmp_randseed.
+ * randraw.c: Remove file.
+ * randlc2x.c: Collect up lc_2exp related code from randsd.c, randclr.c
+ and randraw.c, use function pointer scheme, integrate seed==0/a==0
+ into main case and fix case where bits(a) < m2exp.
+
+ * randlc.c: Remove file, never documented and never worked.
+ * gmp-h.in (gmp_randinit_lc): Remove prototype.
+
+2002-09-16 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/alpha/mod_34lsub1.asm: New file.
+
+2002-09-16 Kevin Ryde <kevin@swox.se>
+
+ * configure.in, acinclude.m4 (GMP_C_RESTRICT): Remove this, not
+ currently used, and #define restrict upsets Microsoft C headers on
+ win64. Reported by David Librik.
+
+ * configure.in (x86): Add gcc 3.2 -march and -mcpu flags, remove some
+ unnecessary -march=i486 fallbacks.
+
+ * gmp.texi (Notes for Particular Systems): Note cl /MD is required for
+ Microsoft C and MINGW to cooperate on I/O. Explained by David Librik.
+ (Language Bindings): Add linbox.
+ * gmp.texi (Language Bindings):
+
+2002-09-12 Kevin Ryde <kevin@swox.se>
+
+ * mpz/aorsmul_i.c: Allow for w==x overlap with nails. Test
+ BITS_PER_ULONG > GMP_NUMB_BITS rather than GMP_NAIL_BITS != 0.
+ * tests/mpz/t-aorsmul.c: Test this.
+
+ * tune/common.c: mpn_mod_34lsub1 only exists for GMP_NUMB_BITS%4==0
+ * tune/speed.c: Add mpn_mod_34lsub1.
+
+2002-09-10 Pedro Gimeno <pggimeno@wanadoo.es>
+
+ * rand.c: Remove old disabled BBS code.
+ * mpf/urandomb.c: Use BITS_TO_LIMBS.
+
+2002-09-10 Kevin Ryde <kevin@swox.se>
+
+ * gmp.texi (Multiplication Algorithms): FFT is now enabled by default.
+
+2002-09-10 Pedro Gimeno <pggimeno@wanadoo.es>
+
+ * mpz/urandomm.c: Use mpn level functions, avoid an infinite loop if
+ _gmp_rand forever returns all "1" bits.
+ * tests/rand/t-urndmm.c: New file
+ * tests/rand/Makefile.am (check_PROGRAMS): Add it.
+
+ * gmp-impl.h (BITS_TO_LIMBS): New macro.
+ * mpz/urandomb.c: Use it, and use MPZ_REALLOC.
+
+2002-09-08 Kevin Ryde <kevin@swox.se>
+
+ * acinclude.m4 (GMP_GCC_WA_MCPU): New macro.
+ * configure.in (alpha*-*-*): Use it to avoid -Wa,-mev67 if gas isn't
+ new enough to know ev67. Reported by David Bremner.
+
+2002-07-30 Gerardo Ballabio <gerardo.ballabio@unimib.it>
+
+ * gmpxx.h (__gmpz_value etc): Remove, use mpz_t etc instead.
+ (__gmp_expr): Reorganise specializations, use __gmp_expr<T,T> not
+ mpz_class etc.
+ (mpfr evals): Remove mode parameter, was always
+ __gmp_default_rounding_mode anyway.
+
+2002-09-07 Kevin Ryde <kevin@swox.se>
+
+ * gmp-h.in, mp-h.in: Use #ifdef for tests, for the benefit of
+ applications using gcc -Wundef.
+
+ * longlong.h: Define COUNT_LEADING_ZEROS_NEED_CLZ_TAB for all alphas,
+ since mpn/alpha/cntlz.asm always goes into libgmp.so, even for ev67
+ and ev68 which don't need it. Reported by David Bremner.
+
+ * gmp.texi (Demonstration Programs): New section, expanding on what
+ was under "Build Options".
+ (Converting Floats): Don't need \ for _ in @var within @math.
+ Add and amend various index entries.
+
+ * demos/qcn.c: Add -p prime limit option.
+
+2002-08-30 Kevin Ryde <kevin@swox.se>
+
+ * mpz/pprime_p.c: Handle small negatives with isprime, in particular
+ must do so for n==-2.
+ * tests/mpz/t-pprime_p.c: New file.
+ * tests/mpz/Makefile.am: Add it.
+
+2002-08-26 Torbjorn Granlund <tege@swox.com>
+
+ * gmp.texi (Converting Floats): Fix typo in mpf_get_d_2exp docs,
+ reported by Paul Zimmermann.
+
+2002-08-26 Kevin Ryde <kevin@swox.se>
+
+ * configure.in: Echo the ABI being tried for the compilers.
+ (powerpc*-*-*): Use powerpc64/aix.m4 for ABI=aix64 too.
+ (AC_CHECK_FUNCS): Add strtol, for tests/rand/gen.c.
+
+2002-08-24 Kevin Ryde <kevin@swox.se>
+
+ * configure.in (HAVE_HOST_CPU_, HAVE_HOST_CPU_FAMILY_, HAVE_NATIVE_):
+ Setup templates for these using AH_VERBATIM rather than acconfig.h,
+ preferred by latest autoconf. Prune lists to just things used.
+ * acconfig.h: Remove file.
+
+ * mpn/powerpc32/mode1o.asm: Forgot ASM_START.
+
+ * tune/time.c (have_cgt_id): Renamed from HAVE_CGT_ID so avoid
+ confusion with autoconf outputs, and turn it into a "const" variable.
+
+2002-08-23 Torbjorn Granlund <tege@swox.com>
+
+ * configure.in: Choose powerpc32/aix.m4 or powerpc64/aix.m4 based on
+ ABI, not configuration triple.
+
+ * mpz/pprime_p.c: Partially undo last change--handle small and
+ negative numbers in the same test.
+
+2002-08-22 Kevin Ryde <kevin@swox.se>
+
+ * gmp-impl.h (MUL_FFT_THRESHOLD, SQR_FFT_THRESHOLD): Note
+ mpn/generic/mul_fft.c is not nails-capable, and don't bother setting
+ other FFT data for nails.
+
+ * configfsf.guess: Update to 2002-08-19.
+ * configfsf.sub: Update to 2002-08-20.
+
+ * config.guess (powerpc*-*-*): Use a { } construct to suppress SIGILL
+ message on AIX.
+
+2002-08-20 Kevin Ryde <kevin@swox.se>
+
+ * gmp.texi (Build Options): Add ia64 under cpu types.
+ (ABI and ISA): Describe IRIX 6 ABI=o32.
+ (Notes for Particular Systems): Remove -march=pentiumpro, now ok.
+ (Known Build Problems): Binutils 2.12 is ok for libgmp.a.
+ (Emacs): New section.
+ (Language Bindings): Update MLton URL, reported by Stephen Weeks.
+ (Prime Testing Algorithm): New section.
+ Don't put a blank line after @item in @table since it can make a page
+ break between the heading and the entry.
+ Misc tweaks elsewhere, in particular more index entries.
+
+ * mpz/millerrabin.c: Need x to be size+1 for change to urandomm.
+
+ * gmp-impl.h: Comments on the use of __GMP_DECLSPEC.
+
+ * tune/time.c (freq_measure_mftb_one): Use struct_timeval, for the
+ benefit of mingw.
+
+ * tests/refmpn.c, tests/tests.h (ref_addc_limb, ref_subc_limb):
+ Renamed from add and sub, following gmp-impl.h ADDC_LIMB and SUBC_LIMB.
+
+2002-08-17 Kevin Ryde <kevin@swox.se>
+
+ * mpn/powerpc32/mode1o.asm: New file.
+ * configure.in, acinclude.m4 (GMP_ASM_POWERPC_PIC_ALWAYS): New macro.
+ * mpn/asm-defs.m4: Use it to help setting up PIC.
+
+ * configure.in (AC_PREREQ): Bump to 2.53.
+
+ * mpn/powerpc32/powerpc-defs.m4 (ASSERT): New macro.
+ (PROLOGUE_cpu): New macro, giving ALIGN(4) not 8.
+
+2002-08-16 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/m68k/lshift.asm: Fix typo in !scale_available_p code.
+ * mpn/m68k/rshift.asm: Likewise.
+
+2002-08-16 Kevin Ryde <kevin@swox.se>
+
+ * configure.in (--enable-profiling=instrument): New option.
+ * gmp.texi (Profiling): Describe it.
+ * mpn/x86/x86-defs.m4 (PROLOGUE_cpu, call_instrument, ret_internal):
+ Add support.
+ (call_mcount): Share PIC setups with call_instrument.
+ * mpn/x86/*.asm: Use ret_internal.
+ * mpn/asm-defs.m4 (m4_unquote): New macro.
+ * tests/mpn/t-instrument.c: New file.
+ * tests/mpn/Makefile.am: Add it.
+
+ * mpn/alpha/umul.asm: Add ASM_END.
+
+2002-08-12 Kevin Ryde <kevin@swox.se>
+
+ * mpz/pprime_p.c: Fake up a local mpz_t to take abs(n), rather than
+ using mpz_init etc.
+
+ * mpz/millerrabin.c: Use mpz_urandomm for uniform selection of x,
+ reported by Jason Moxham. Exclude x==n-1, ie. -1 mod n. Use
+ gmp_randinit_default.
+
+ * mpn/alpha/umul.asm: Use "r" registers, for the benefit of Unicos.
+
+ * tests/devel/try.c: Add mpn_copyi and mpn_copyd.
+
+2002-08-09 Kevin Ryde <kevin@swox.se>
+
+ * Makefile.am: Remove configure.lineno from DISTCLEANFILES and gmp.tmp
+ from MOSTLYCLEANFILES, automake does these itself now.
+
+ * */Makefile.in, aclocal.m4, configure, install-sh, missing,
+ mkinstalldirs: Update to automake 1.6.3.
+
+ * mpn/ia64/README: Some notes on assembler syntax.
+
+ * mpn/ia64/add_n.asm, mpn/ia64/sub_n.asm: Add .body.
+ * mpn/ia64/add_n.asm, mpn/ia64/addmul_1.asm, mpn/ia64/mul_1.asm,
+ mpn/ia64/sub_n.asm: Position .save ar.lc just before relevant
+ instruction.
+ * mpn/ia64/addmul_1.asm, mpn/ia64/mul_1.asm: Add .save ar.pfs and pr.
+ * mpn/ia64/copyd.asm, mpn/ia64/copyi.asm: Correction to .body position.
+ * mpn/ia64/lorrshift.asm: Add .prologue stuff.
+
+ * configure.in (*-*-unicos*): Remove forcible --disable-shared,
+ libtool gets this right itself now.
+
+2002-08-07 Kevin Ryde <kevin@swox.se>
+
+ * mpn/x86/pentium/mmx/hamdist.asm: New file, adapted from
+ mpn/x86/pentium/mmx/popham.asm.
+ * mpn/x86/pentium/mmx/popham.asm: Remove file, not faster than plain
+ mpn/x86/pentium/popcount.asm for the popcount.
+
+ * mpn/alpha/umul.asm: Use PROLOGUE/EPILOGUE, rename it mpn_umul_ppmm.
+ * configure.in (alpha*-*-*): Add umul to extra_functions.
+
+ * mpz/remove.c: Make src==0 return 0, not do DIVIDE_BY_ZERO.
+
+2002-08-05 Torbjorn Granlund <tege@swox.com>
+
+ * acconfig.h: Remove spurious undefs for mpn_divrem_newton and
+ mpn_divrem_classic.
+
+2002-08-05 Kevin Ryde <kevin@swox.se>
+
+ * tests/refmpn.c, tests/tests.h, tests/misc/t-printf.c,
+ tests/mpf/t-trunc.c, tests/mpn/t-mp_bases.c, tests/mpn/t-scan.c,
+ tests/mpq/t-cmp_ui.c, tests/mpz/bit.c, tests/mpz/t-aorsmul.c,
+ tests/mpz/t-powm_ui.c tests/mpz/t-root.c, tests/mpz/t-scan.c: More
+ care with long and mp_size_t parameters, for the benefit of K&R.
+
+ * demos/perl/GMP.pm, demos/perl/GMP.xs, demos/perl/GMP/Mpz.pm,
+ demos/perl/test.pl: Add mpz_import and mpz_export.
+ * demos/perl/GMP.pm: Remove "preliminary" warning.
+
+ * mpn/lisp/gmpasm-mode.el: Set add-log-current-defun-header-regexp to
+ pick up m4 defines etc.
+
+ * Makefile.am (libgmpxx_la_DEPENDENCIES): libgmp.la should be here,
+ not libgmpxx_la_LIBADD, for the benefit of "make -j2".
+
+ * mpn/ia64/*.asm [hpux ABI=32]: Extend 32-bit operands to 64-bits, not
+ optimal and might not be sufficient, but seems to work.
+
+2002-08-03 Kevin Ryde <kevin@swox.se>
+
+ * gmp.texi (Profiling): Use a table and expand for clarity.
+ (Integer Special Functions): New section for mpz_array_init,
+ _mpz_realloc, mpz_getlimbn and mpz_size, to discourage their use.
+
+ * configure.in (*-*-msdosdjgpp*): Remove forcible --disable-shared,
+ libtool gets this right itself now.
+
+2002-07-30 Kevin Ryde <kevin@swox.se>
+
+ * mpn/powerpc32/lshift.asm, mpn/powerpc32/rshift.asm: Lose final mr,
+ and make final stwu into an stw.
+
+ * gmp.texi (Known Build Problems): An easier workaround for DESTDIR,
+ using LD_LIBRARY_PATH.
+ (C++ Interface MPFR): Remove mpfrxx.h.
+
+ * mpfrxx.h: Remove file.
+ * Makefile.am: Remove mpfrxx.h.
+ * tests/cxx/Makefile.am: Add Gerardo's new test programs.
+
+2002-07-30 Gerardo Ballabio <gerardo.ballabio@unimib.it>
+
+ * gmpxx.h: Use mpz_addmul etc for ternary a+b*c etc. Reorganise some
+ macros for maintainability. Merge mpfrxx.h.
+ * tests/cxx/t-constr.cc, tests/cxx/t-expr.cc: Various updates.
+ * tests/cxx/t-assign.cc, tests/cxx/t-binary.cc,
+ tests/cxx/t-ternary.cc, tests/cxx/t-unary.cc: New files.
+
+2002-07-27 Kevin Ryde <kevin@swox.se>
+
+ * longlong.h (count_trailing_zeros) [ia64 __GNUC__]: Don't use
+ __builtin_ffs for now, doesn't seem to work.
+
+ * configure.in: Establish CONFIG_SHELL to avoid a problem with
+ AC_LIBTOOL_SYS_MAX_CMD_LEN on ia64-*-hpux*.
+
+ * tune/speed.h (SPEED_ROUTINE_MPN_GCD_FINDA): Don't let calls to
+ mpn_gcd_finda go dead.
+
+ * mpn/generic/tdiv_qr.c: Inline mpn_rshift and MPN_COPY of 2 limbs.
+
+2002-07-24 Kevin Ryde <kevin@swox.se>
+
+ * demos/primes.c: Use __GMP_PROTO and don't use signed, for the
+ benefit of K&R.
+
+ * demos/calc/calclex.l: Add <string.h> for strcmp.
+
+ * mpn/ia64/invert_limb.asm: Use .rodata which works on ia64-*-hpux*
+ and should be standard, rather than worrying about RODATA.
+
+ * gmp.texi (Function Classes): Add cross references.
+ (Integer Import and Export): Fix return value grouping.
+
+ * mpn/lisp/gmpasm-mode.el (gmpasm-comment-start-regexp): Add // for
+ ia64. Add notes on what the various styles are for.
+
+ * mpn/ia64/default.m4 (ASM_START): Define to empty, not dnl, so as not
+ to kill text on the same line.
+ (EPILOGUE_cpu): Force a newline after "#", so as not to suppress macro
+ expansion in the rest of the EPILOGUE line.
+
+2002-07-21 Kevin Ryde <kevin@swox.se>
+
+ * tune/speed.h: Fix some missing _PROTOs.
+
+ * Makefile.am (DISTCLEANFILES): Add configure.lineno.
+
+ * acinclude.m4 (GMP_C_DOUBLE_FORMAT): Define
+ HAVE_DOUBLE_IEEE_BIG_ENDIAN and HAVE_DOUBLE_IEEE_LITTLE_ENDIAN in
+ config.m4 too.
+ * mpn/ia64/invert_limb.asm: Add big-endian data.
+
+ * tests/mpz/t-jac.c (try_si_zi): Correction to "a" parameter type.
+
+2002-07-20 Kevin Ryde <kevin@swox.se>
+
+ * mpz/bin_ui.c, mpz/jacobi.c, mpz/pprime_p.c, mpn/generic/divis.c:
+ More care with long and mp_size_t parameters, for the benefit of K&R.
+
+ * gmp-impl.h (invert_limb): Use parens around macro arguments.
+ (mpn_invert_limb): Give prototype and define unconditionally.
+
+ * gmp-impl.h (CACHED_ABOVE_THRESHOLD, CACHED_BELOW_THRESHOLD): New
+ macros.
+ * mpn/generic/sb_divrem_mn.c: Use them to help gcc let preinv code go
+ dead when not wanted.
+
+2002-07-17 Kevin Ryde <kevin@swox.se>
+
+ * tests/refmpz.c (refmpz_hamdist): Ensure mp_size_t parameters are
+ that type, for the benefit of hpux ia64 bundled cc ABI=64.
+
+ * configure.in (ia64*-*-hpux*): Need +DD64 in cc_64_cppflags to get
+ the right headers for ansi2knr.
+
+ * acinclude.m4 (GMP_TRY_ASSEMBLE, GMP_ASM_UNDERSCORE): Use $CPPFLAGS
+ with $CCAS and when linking, as done by the makefiles.
+ (GMP_ASM_X86_MMX, GMP_ASM_X86_SSE2): Show $CPPFLAGS in diagnostics.
+
+ * gmp-impl.h (ieee_double_extract): Setup using HAVE_DOUBLE_IEEE_*.
+ (GMP_UINT32): New define, 32 bit type for ieee_double_extract.
+ * configure.in: Add AC_CHECK_SIZEOF unsigned.
+ * configure.in, acinclude.m4 (GMP_IMPL_H_IEEE_FLOATS): Remove.
+ (GMP_C_DOUBLE_FORMAT): Instead warn about unknown float here.
+
+ * configure.in, acinclude.m4 (GMP_C_SIZES): Remove.
+ * acinclude.m4 (GMP_INCLUDE_GMP_H_BITS_PER_MP_LIMB): Remove this
+ scheme, not required.
+ * configure.in (unsigned long, mp_limb_t): Run AC_CHECK_SIZEOF for
+ these unconditionally, check mp_limb_t against gmp-mparam.h values.
+ * gmp-impl.h (BYTES_PER_MP_LIMB, BITS_PER_MP_LIMB): Define based on
+ SIZEOF_MP_LIMB_T if not provided by gmp-mparam.h.
+ (BITS_PER_ULONG): Define here now.
+
+ * gmp.texi (ABI and ISA): Add HP-UX IA-64 choices.
+ (Random State Initialization): Typo in m2exp described for
+ gmp_randinit_lc_2exp_size.
+ (Formatted Output Functions): Clarify gmp_obstack_printf a bit.
+ (Formatted Input Strings): Typo in %n summary.
+
+ * mpz/inp_raw.c (NTOH_LIMB_FETCH): Use simple generic default, since
+ endianness detection is now cross-compile friendly.
+ * mpz/out_raw.c (HTON_LIMB_STORE): Ditto.
+
+ * mpz/fib_ui.c: Nailify.
+ * mpz/random.c: Nailify.
+
+ * mpfr/acinclude.m4 (MPFR_CONFIGS): Patch by Vincent for an apparent
+ float rounding gremlin on powerpc.
+
+2002-07-15 Kevin Ryde <kevin@swox.se>
+
+ * Makefile.am (PRINTF_OBJECTS): Avoid ending in a backslash, hpux ia64
+ make doesn't like that.
+
+ * mpn/ia64/*.asm: Add .sptk to unconditional branches, add ";" after
+ .mib etc, for the benefit of hpux.
+
+ * configure.in (ia64*-*-*): Use ABI=64 on non-HPUX systems, for
+ consistency.
+
+ * gmp-impl.h (ieee_double_extract): Test __sparc__, used by gcc 3.1.
+ Reported by nix@esperi.demon.co.uk.
+ * mpfr/mpfr-math.h (_MPFR_NAN_BYTES etc): Ditto.
+
+2002-07-13 Kevin Ryde <kevin@swox.se>
+
+ * mpn/powerpc32/rshift.asm: Rewrite, transformed from lshift.asm.
+
+ * tune/tuneup.c (DIVEXACT_1_THRESHOLD, MODEXACT_1_ODD_THRESHOLD):
+ Always zero for native mpn_divexact_1, mpn_modexact_1_odd.
+
+ * gmp-h.in (__GMP_EXTERN_INLINE): Don't use this during configure,
+ ie. __GMP_WITHIN_CONFIGURE, to avoid needing dependent routines.
+ * acinclude.m4 (GMP_H_EXTERN_INLINE): Consequent changes.
+
+ * gmp-impl.h, mpn/asm-defs.m4 (mpn_addmul_2, mpn_addmul_3,
+ mpn_addmul_4): Add prototypes and defines.
+
+ * gmp.texi (Number Theoretic Functions): Clarify return value.
+ Reported by Peter Keller.
+
+2002-07-10 Kevin Ryde <kevin@swox.se>
+
+ * configure.in, acinclude.m4 (GMP_PROG_LEX): Remove this in favour of
+ AM_PROG_LEX, now ok when lex is missing.
+
+ * longlong.h (count_leading_zeros) [pentiummmx]: Don't use __clz_tab
+ variant under LONGLONG_STANDALONE.
+ (count_trailing_zeros) [ia64 __GNUC__]: Use __builtin_ffs.
+
+ * gmp-impl.h (popc_limb): Add an ia64 asm version.
+ (DItype): Use HAVE_LONG_LONG to choose long long, avoiding _LONGLONG
+ which is in gcc but means something unrelated in MS Visual C 7.0.
+ Reported by David Librik.
+
+ * mpz/divexact.c: Add an ASSERT that den divides num.
+
+ * mpn/asm-defs.m4 (LDEF): New macro.
+ (INT32, INT64): Use it.
+ * mpn/pa32/*.asm: Use it.
+ * mpn/pa32/README: Update notes on labels.
+
+ * tests/refmpn.c, tests/tests.h, tests/t-bswap.c (ref_bswap_limb):
+ Renamed from refmpn_bswap_limb.
+ * tests/t-bswap.c: Add tests_start/tests_end for randomization.
+
+ * tests/refmpn.c, tests/tests.h (ref_popc_limb): New function.
+ * tests/t-popc.c: New file.
+ * tests/Makefile.am: Add it.
+
+ * mpn/ia64/invert_limb.asm: Use RODATA since ".section .rodata" is not
+ accepted by ia64-*-hpux*.
+
+ * acinclude.m4 (GMP_ASM_BYTE): New macro.
+ (GMP_ASM_ALIGN_LOG, GMP_ASM_W32): Use it.
+ (GMP_ASM_LABEL_SUFFIX): Use test compiles, not $host.
+ (GMP_ASM_GLOBL): Ditto, and add .global for ia64-*-hpux*.
+ (GMP_ASM_GLOBL_ATTR): Use GMP_ASM_GLOBL result, not $host.
+ (GMP_ASM_LSYM_PREFIX): Allow any "a-z" nm symbol code, add ".text" to
+ test program, required by ia64-*-hpux*.
+ (GMP_ASM_LABEL_SUFFIX): Make LABEL_SUFFIX just the value, not a "$1:",
+ the former being how it's currently being used in fact.
+
+ * configure.in, acinclude.m4 (GMP_PROG_CC_WORKS_LONGLONG): New macro.
+ * configure.in (ia64-*-hpux*): Add 32 and 64 bit ABI modes.
+
+2002-07-06 Kevin Ryde <kevin@swox.se>
+
+ * tests/cxx/t-allfuns.cc: New file.
+ * tests/cxx/Makefile.am: Add it.
+
+ * mpz/clrbit.c, mpz/setbit.c: Only MPN_NORMALIZE if high limb changes
+ to zero. Use _mpz_realloc return value.
+
+ * gmp.texi (Build Options, C++ Formatted Output, C++ Formatted Input):
+ Cross reference to Headers and Libraries for libgmpxx stuff.
+ (Low-level Functions): mpn_divexact_by3 result based on GMP_NUMB_BITS.
+ mpn_set_str takes "unsigned char *", reported by Mark Sofroniou.
+ (C++ Interface General): Describe linking with libgmpxx and libgmp.
+
+2002-07-01 Kevin Ryde <kevin@swox.se>
+
+ * tune/tuneup.c, gmp-impl.h: Eliminate the array of thresholds in
+ one(), tune just one at a time and let the callers hand dependencies.
+ Eliminate the second_start_min hack, handle SQR_KARATSUBA_THRESHOLD
+ oddities in tune_sqr() instead.
+
+ * mpn/pa64/umul.asm, mpn/pa64/udiv.asm, mpn/asm-defs.m4, acconfig.h,
+ longlong.h, tune/speed.c, tune/speed.h, tune/common.c, tune/many.pl,
+ tests/devel/try.c: Introduce mpn_umul_ppmm_r and mpn_udiv_qrnnd_r
+ rather than having variant parameter order for mpn_umul_ppmm and
+ mpn_udiv_qrnnd on pa64.
+
+ * gmp-h.in (mpz_export): Remove a spurious parameter name.
+ * gmp-impl.h (mpn_rootrem): Use __MPN.
+
+2002-06-29 Kevin Ryde <kevin@swox.se>
+
+ * longlong.h (udiv_qrnnd) [hppa32]: Remove mpn_udiv_qrnnd version, the
+ general mechanism for that suffices.
+
+ * mpf/inp_str.c: Fix returned count of chars read, reported by Paul
+ Zimmermann. Also fix a memory leak for invalid input.
+ * tests/mpf/t-inp_str.c: New file.
+ * tests/mpf/Makefile.am (check_PROGRAMS): Add it.
+
+ * tests/devel/try.c (mpn_mod_34lsub1): Only exists for
+ GMP_NUMB_BITS%4==0.
+ (SIZE2_FIRST): Respect option_firstsize2 for "fraction" case.
+
+ * mpn/generic/diveby3.c: Further nailifications.
+ * gmp-impl.h (MODLIMB_INVERSE_3): Allow for GMP_NUMB_BITS odd.
+ (GMP_NUMB_CEIL_MAX_DIV3, GMP_NUMB_CEIL_2MAX_DIV3): New constants.
+ * tests/t-constants.c: Check them.
+
+ * gmp-h.in (__GMP_CRAY_Pragma): New macro.
+ (__GMPN_COPY_REST): Use it.
+ * gmp-impl.h (CRAY_Pragma): Use it.
+
+2002-06-25 Kevin Ryde <kevin@swox.se>
+
+ * mpz/import.c, mpz/export.c: Cast data pointer through "char *" in
+ alignment tests, for the benefit of Cray vector systems.
+
+ * configure.in (x86-*-*): Remove -march=pentiumpro check, seems ok
+ with current code.
+ * acinclude.m4 (GMP_GCC_MARCH_PENTIUMPRO, GMP_GCC_VERSION_GE): Remove
+ macros, no longer needed
+
+ * acinclude.m4 (GMP_ASM_RODATA): Remove temporary files.
+
+ * configure.in (GMP_ASM_GLOBL_ATTR): Reposition to avoid duplication
+ through AC_REQUIRE.
+
+2002-06-23 Kevin Ryde <kevin@swox.se>
+
+ * tests/mpz/t-fib_ui.c (check_fib_table): Check table values, not just
+ that they're non-zero.
+
+ * acinclude.m4 (GMP_GCC_ARM_UMODSI): Match bad "gcc --version" output
+ exactly, rather than parsing it with GMP_GCC_VERSION_GE.
+ (GMP_ASM_UNDERSCORE): Use GLOBL_ATTR.
+
+ * mpn/pa32/udiv.asm, mpn/pa32/hppa1_1/udiv.asm, mpn/pa64/udiv.asm:
+ Renamed from udiv_qrnnd.asm, for consistency with other udiv's.
+ * mpn/pa64/umul.asm: Renamed from umul_ppmm.asm likewise.
+ * configure.in (hppa*-*-*): Update extra_functions.
+ (NAILS_SUPPORT): Remove umul_ppmm, udiv_qrnnd, udiv_fp, udiv_nfp from
+ nails-neutral list, no longer needed.
+
+ * gmp-h.in (__DECC): Add notes on testing this for ANSI-ness.
+ (__GMP_EXTERN_INLINE): Add static __inline for DEC C.
+ (mpz_mod_ui): Move up to main section, it's still documented.
+
+2002-06-22 Kevin Ryde <kevin@swox.se>
+
+ * mpz/jacobi.c, mpz/kronsz.c, mpz/kronuz.c, mpz/kronzs.c,
+ mpz/kronzu.c: Allow for odd GMP_NUMB_BITS, tweak a few variable setups.
+ * gmp-impl.h (JACOBI_STRIP_LOW_ZEROS): New macro.
+
+ * mpn/generic/mod_34lsub1.c: Nailify.
+ * tests/devel/try.c (CNST_34LSUB1): Nailify.
+ * gmp-impl.h (ADDC_LIMB): New macro.
+
+ * gmpxx.h (mpf_class::get_str): Make exponent mp_exp_t&, default
+ base=10 and ndigits=0.
+ (mpz_class::set_str, mpq_class::set_str, mpf_class::set_str): Add
+ versions accepting "const char *".
+ * mpfrxx.h (mpfr_class::get_str, mpfr_class::set_str): Ditto, and
+ uncommenting set_str and operator=.
+ * gmp.texi (C++ Interface Integers, C++ Interface Rationals)
+ (C++ Interface Floats): Update.
+
+ * gmp-impl.h (modlimb_invert): Merge the <=64bits and general versions.
+ (const, signed): Move to near top of file, fixes --enable-alloca=debug
+ on K&R.
+
+ * gen-fib.c: New file, derived from mainline in mpn/generic/fib2_ui.c.
+ * dumbmp.c (mpz_init_set_ui): New function.
+ * Makefile.am, mpn/Makefile.am: Generate fib_table.h, mpn/fib_table.c.
+ * gmp-impl.h: Use fib_table.h, add __GMP_DECLSPEC to __gmp_fib_table
+ (for the benefit of tests/mpz/t-fib_ui.c).
+ * mpn/generic/fib2_ui.c: Remove __gmp_fib_table and generating code.
+
+ * Makefile.am: Add mp.h to BUILT_SOURCES, distclean all BUILT_SOURCES,
+ use += more.
+
+ * acinclude.m4 (GMP_ASM_M68K_INSTRUCTION, GMP_ASM_M68K_BRANCHES):
+ Don't let "unknown" get into the cache variables.
+ (GMP_ASM_TEXT): See what assembles, don't hard-code hpux and aix.
+ (GMP_PROG_EXEEXT_FOR_BUILD): Add ,ff8 for RISC OS, per autoconf cvs.
+ (GMP_PROG_CPP_FOR_BUILD): Restructure per AC_PROG_CPP, print correct
+ result if CPP_FOR_BUILD overrides the cache variable.
+ (GMP_PROG_CC_FOR_BUILD_WORKS): New macro split from
+ GMP_PROG_CC_FOR_BUILD. Allow for "conftest" default compiler output.
+ * configure.in, acinclude.m4 (GMP_PROG_HOST_CC): Reinstate this,
+ separating HOST_CC establishment from GMP_PROG_CC_FOR_BUILD.
+
+ * configure.in (mpn_objs_in_libgmp): Move mpn/mp_bases.lo ...
+ * Makefile.am (MPN_OBJECTS): ... to here, add $U, and arrange
+ MPN_OBJECTS to be common between libgmp and libmp.
+
+2002-06-20 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/generic/mul_n.c (TOOM3_MUL_REC, TOOM3_SQR_REC): Don't check if
+ basecase is to be invoked when *_TOOM3_THRESHOLD is more than 3 times
+ the corresponding *_THRESHOLD.
+
+2002-06-20 Kevin Ryde <kevin@swox.se>
+
+ * mpn/ia64/submul_1.c: Add missing TMP_DECL, TMP_MARK, TMP_FREE.
+ Reported by Paul Zimmermann.
+
+ * configure.in, acinclude.m4 (AC_DEFINE): Make templates read "Define
+ to 1", for clarity as per autoconf.
+ * acinclude.m4 (GMP_OPTION_ALLOCA): Group WANT_TMP templates.
+
+2002-06-20 Gerardo Ballabio <gerardo.ballabio@unimib.it>
+
+ * gmpxx.h, mpfrxx.h: Remove mpz_classref, let mpq_class::get_num and
+ mpq_class::get_den return mpz_class& as per the documentation.
+ Reported by Roberto Bagnara.
+
+2002-06-18 Kevin Ryde <kevin@swox.se>
+
+ * tests/rand/t-lc2exp.c: New file.
+ * tests/rand/Makefile.am: Add it, and use tests/libtests.la.
+
+ * randraw.c (lc): Pad seed==0 case with zero limbs, return same
+ (m2exp+1)/2 bits as normal, right shift "c" result as normal.
+
+ * configure.in: Don't bother with line numbers in some diagnostics.
+ (*-*-mingw*): Use -mno-cygwin if it works, suggested by delta trinity.
+
+ * tests/mpz/Makefile.am, tests/mpq/Makefile.am,
+ tests/misc/Makefile.am, (CLEANFILES): Set to *.tmp for test program
+ temporaries, to get t-scanf.tmp and reduce future maintenance.
+
+2002-06-16 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/generic/get_str.c (mpn_dc_get_str): Pass scratch memory area in
+ new `tmp' parameter. Trim allocation needs by reusing input parameter.
+
+2002-06-15 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/sparc32/v9/udiv.asm: New file.
+
+2002-06-15 Kevin Ryde <kevin@swox.se>
+
+ * acinclude.m4 (GMP_GCC_VERSION_GE): Correction to recognising mingw
+ gcc 3.1 version number. Reported by Jim Fougeron.
+
+ * configure.in (AC_PROVIDE_AC_LIBTOOL_WIN32_DLL): New define, to make
+ AC_LIBTOOL_WIN32_DLL work with autoconf 2.53.
+
+ * acinclude.m4 (GMP_C_SIZES): Establish BITS_PER_MP_LIMB as a value,
+ not an expression, for the benefit of the gen-bases invocation.
+
+ * config.guess (CC_FOR_BUILD): Try c99, same as configfsf.guess.
+
+2002-06-15 Paul Zimmermann <Paul.Zimmermann@loria.fr>
+
+ * mpfr/set_q.c: Allow for 1 bit numerator or denominator.
+
+2002-06-14 Kevin Ryde <kevin@swox.se>
+
+ * configure.in (AC_C_BIGENDIAN): Use new style action parameters.
+
+ * randlc2x.c: Allow for a<0, allow for c>=2^m2exp.
+ * randraw.c (lc): Allow for a==0.
+
+ * mpn/sparc32/udiv.asm: Renamed from udiv_fp.asm. Don't know if float
+ is the best way for v7, but it's what configure has chosen since gmp 3.
+ * configure.in (*sparc*-*-* ABI=32): extra_functions="udiv" for all,
+ in particular sparc32/v8/udiv.asm is faster (on ultrasparc2) than
+ udiv_fp previously used for v9 chips.
+
+ * gen-bases.c: New file, derived from mpn/mp_bases.c.
+ * dumbmp.c: New file, mostly by Torbjorn, some by me.
+ * configure.in, acinclude.m4 (GMP_PROG_CC_FOR_BUILD,
+ GMP_PROG_CPP_FOR_BUILD, GMP_PROG_EXEEXT_FOR_BUILD,
+ GMP_C_FOR_BUILD_ANSI, GMP_CHECK_LIBM_FOR_BUILD): New macros.
+ (GMP_PROG_HOST_CC): Remove, superceded by GMP_PROG_CC_FOR_BUILD.
+ * Makefile.am: Run gen-bases to create mp_bases.h and mpn/mp_bases.c.
+ * gmp-impl.h: Use mp_bases.h.
+ * mpn/mp_bases.c: Remove file.
+ * mpn/Makefile.am: mp_bases.c now in nodist_libmpn_la_SOURCES.
+
+ * tests/mpz/t-cmp_d.c (check_one_2exp): Use volatile to force to
+ double, fixes gcc 3.1 with -O4. Reported by Michael Lee.
+ * configure.in (AC_C_VOLATILE): New macro.
+
+ * tests/misc/t-scanf.c: (fromstring_gmp_fscanf): Add missing va_end.
+ Don't mix varargs and fixed args functions, not good on x86_64.
+ Reported by Marcus Meissner.
+
+ * Makefile.am (EXTRA_DIST): Remove mpfr/README, now in mpfr/Makefile.in
+
+ * configure, config.in, INSTALL.autoconf: Update to autoconf 2.53.
+ * */Makefile.in, install-sh, mdate-sh, missing, aclocal.m4, configure:
+ Update to automake 1.6.1.
+ * configfsf.guess, configfsf.sub: Update to 2002-05-29.
+
+2002-06-12 Kevin Ryde <kevin@swox.se>
+
+ * acinclude.m4 (GMP_GCC_VERSION_GE): Recognise mingw gcc 3.1 version.
+ (GMP_PROG_CC_WORKS): Allow for a_out.exe, as per autoconf.
+ (GMP_GCC_NO_CPP_PRECOMP, GMP_ASM_UNDERSCORE): Ditto, plus a.exe.
+
+2002-06-09 Torbjorn Granlund <tege@swox.com>
+
+ * randraw.c (lc): Remove broken ASSERT_ALWAYS.
+
+ * mpn/x86: Update gmp-mparam.h files with current measures *_THRESHOLD
+ values.
+ * mpn/x86/p6/mmx/gmp-mparam.h: New file.
+
+2002-06-09 Kevin Ryde <kevin@swox.se>
+
+ * mpn/x86/*/gmp-mparam.h (USE_PREINV_DIVREM_1): Add tuned settings.
+
+ * acconfig.h (HAVE_NATIVE_mpn_preinv_divrem_1): New template.
+
+ * tests/refmpn.c, tests/tests.h (refmpn_chars_per_limb,
+ refmpn_big_base): New functions.
+ * tests/mpn/t-mp_bases.c: Use them, and don't test big_base_inverted
+ unless it's being used.
+
+ * gmp.texi (Notes for Particular Systems): Using Microsoft C with DLLs.
+ (Known Build Problems): Notes on MacOS and GCC.
+ (Integer Logic and Bit Fiddling): Use ULONG_MAX for maximum ulong.
+ (Low-level Functions): mpn_get_str accepts base==256.
+ (Formatted Output Functions): Note output is not atomic.
+ (Internals): Note mp_size_t for limb counts.
+
+ * mp-h.in, gmp-h.in (mp_ptr, mp_srcptr, mp_size_t, mp_exp_t): Remove
+ these types from mp.h, not needed.
+
+ * mpfr/tests/tadd.c, mpfr/tests/tmul.c (check): Apply a hack to the
+ parameter order to make sparc gcc 2.95.2 happy.
+
+ * doc/configuration: Notes on bootstrapping.
+
+2002-06-08 Kevin Ryde <kevin@swox.se>
+
+ * mpfr/tests/tsqrt.c, mpfr/tests/tsqrt_ui.c: Suppress tests if sqrt is
+ not affected by mpfr_set_machine_rnd_mode.
+
+ * mpfr/mul_2si.c: Workaround a mips gcc 2.95.3 bug under -O2 -mabi=n32.
+
+ * configure.in (alphev56): Fix to use ev5 path.
+
+2002-06-06 Kevin Ryde <kevin@swox.se>
+
+ * gmp-h.in: Use __gmp_const not const, in a number of places.
+
+ * configure.in (sparc): Use ABI=32 instead of ABI=standard on v7 and
+ v8, for consistency with v9 choices.
+ (sparc64): Restrict GMP_ASM_SPARC_REGISTER to ABI=64.
+ (x86): Move MMX $path munging to before printout.
+ (CCAS): Move upward to support this.
+
+ * gmp-impl.h (modlimb_invert): Merge macros for specific limb sizes,
+ add a version for arbitrary limb size, use GMP_NUMB_BITS.
+ (modlimb_invert, MODLIMB_INVERSE_3): Fix comments to say GMP_NUMB_BITS.
+
+ * gmp-h.in (__GMP_LIKELY, __GMP_UNLIKELY): New macros.
+ (mpz_getlimbn, mpz_perfect_square_p, mpz_popcount): Use them, make the
+ fetch or mpn call likely, unconditionally calculate the alternative so
+ as to avoid an "else" clause.
+ * gmp-impl.h (LIKELY, UNLIKELY): Aliases.
+
+ * configure.in, mpfr/tests/Makefile.am: Add $LIBM to $LIBS for
+ MPFR_CONFIGS so it detects fesetround, and let it go through to
+ $MPFR_LIBS.
+ * mpfr/rnd_mode.c: Use gmp-impl.h to get MPFR_HAVE_FESETROUND.
+
+ * tests/mpz/t-sizeinbase.c: Disable fake bits test, such pointer
+ setups are bogus and have been seen failing on hppa.
+
+ * tests/misc.c, tests/refmpz.c, tests.tests.h, tests/mpz/t-cong.c:
+ Rename mpz_flipbit to refmpz_combit and move from misc.c to refmpz.c.
+
+2002-06-05 Torbjorn Granlund <tege@swox.com>
+
+ * tests/mpz/t-powm_ui.c Print proper routine name in error message.
+
+2002-06-03 Kevin Ryde <kevin@swox.se>
+
+ * tune/time.c, tune/freq.c, tune/speed.h: Add powerpc mftb support.
+ (FREQ_MEASURE_ONE): Move to speed.h, fix tv_sec factor.
+ (freq_measure): Use for mftb measuring too.
+ * tune/powerpc.asm, tune/powerpc64.asm: New files.
+ * configure.in, tune/Makefile.am: Add them.
+
+ * gmp-impl.h (popc_limb): Add versions for Cray and fallback for
+ arbitrary limb size.
+
+ * mpn/sparc32/sparc-defs.m4: New file.
+ * configure.in (sparc*-*-*): Use it.
+ * acinclude.m4 (GMP_ASM_SPARC_REGISTER): New macro.
+ * configure.in (sparc64): Use it. Also, use -Wc,-m64 for linking.
+ * mpn/sparc64/add_n.asm, mpn/sparc64/addmul_1.asm,
+ mpn/sparc64/copyd.asm, mpn/sparc64/copyi.asm, mpn/sparc64/lshift.asm,
+ mpn/sparc64/mul_1.asm, mpn/sparc64/rshift.asm,
+ mpn/sparc64/sqr_diagonal.asm, mpn/sparc64/sub_n.asm,
+ mpn/sparc64/submul_1.asm: Use REGISTER for .register.
+
+2002-06-01 Kevin Ryde <kevin@swox.se>
+
+ * mpz/powm_ui.c: Fix for result range in certain circumstances.
+
+ * mpn/x86/k6/diveby3.asm: Speedup to 10 c/l, same as divexact_1.
+ Anomaly pointed out by Alexander Kruppa.
+
+2002-05-31 Torbjorn Granlund <tege@swox.com>
+
+ * mpz/export.c: Cast pointer via `unsigned long' when checking
+ alignment to avoid compiler warnings.
+
+2002-05-29 Kevin Ryde <kevin@swox.se>
+
+ * gmp-impl.h (BSWAP_LIMB): Versions for m68k, powerpc, and arbitrary
+ limb size.
+ * configure.in, acconfig.h (HAVE_HOST_CPU_FAMILY_m68k): New define.
+
+2002-05-27 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/generic/mul_basecase.c: Improve MAX_LEFT handling, returning
+ when possible. Add code for mpn_addmul_5 and mpn_addmul_6.
+
+2002-05-25 Kevin Ryde <kevin@swox.se>
+
+ * tune/tuneup.c: Misc nailifications, and disable preinv thresholds
+ with nails.
+ * tune/speed.h: Use GMP_NUMB_HIGHBIT with mpn_sb_divrem_mn and
+ mpn_divrem_2.
+ * mpz/powm.c (redc): Nailify q.
+
+ * tests/mpn/t-scan.c: Reduce the amount of testing, to go faster.
+
+2002-05-23 Torbjorn Granlund <tege@swox.com>
+
+ * Version 4.1 released.
+
+ * mpn/alpha/ev6/nails/gmp-mparam.h: New file.
+
+ * tests/devel/add_n.c (refmpn_add_n): Nailify.
+ * tests/devel/sub_n.c (refmpn_sub_n): Nailify.
+ * tests/devel/addmul_1.c (refmpn_addmul_1): Nailify.
+ * tests/devel/submul_1.c (refmpn_submul_1): Nailify.
+
+ * mpn/alpha/ev6/nails/add_n.asm: New file.
+ * mpn/alpha/ev6/nails/sub_n.asm: New file.
+ * mpn/alpha/ev6/nails/mul_1.asm: New file.
+ * mpn/alpha/ev6/nails/submul_1.asm: New file.
+
+2002-05-22 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/alpha/ev6/nails/addmul_1.asm: New file.
+
+ * mpz/inp_str.c (mpz_inp_str_nowhite): Nailify.
+
+ * mpn/generic/mul_basecase.c: Update pointers before conditional
+ MAX_LEFT break statements.
+
+2002-05-21 Torbjorn Granlund <tege@swox.com>
+
+ * tests/mpz/t-gcd.c: Test mpz_gcd_ui.
+
+ * mpz/lcm_ui.c: Nailify.
+
+ * mpz/gcd_ui.c: Nailify. Make it work as documented, allowing
+ NULL to be passed for result parameter. Fix gcd(0,0) case.
+
+ * mpz/set_str.c: Nailify.
+
+ * randlc2x.c (gmp_randinit_lc_2exp): Nailify.
+
+ From Jakub Jelinek:
+ * longlong.h (add_ssaaaa,sub_ddmmss) [64-bit sparc]:
+ Make it actually work.
+
+2002-05-18 Torbjorn Granlund <tege@swox.com>
+
+ * mpf/ui_div.c: Shut up compiler warning.
+
+ * mpn/generic/mul_basecase.c: Use mpn_addmul_2, mpn_addmul_3, and
+ mpn_addmul_4, as available.
+
+ * mpn/alpha/ev6/nails/addmul_2.asm: Adjust NAILS_SUPPORT decls.
+ * mpn/alpha/ev6/nails/addmul_3.asm: Likewise
+ * mpn/alpha/ev6/nails/addmul_4.asm: Likewise.
+
+ * configure.in (*-cray-unicos*): Back again to -hscalar0.
+ (gmp_mpn_functions_optional): Add mul_3, mul_4, addmul_2, addmul_3,
+ and addmul_4.
+ * acconfig.h: Add #undefs for new optional mpn functions.
+
+2002-05-18 Kevin Ryde <kevin@swox.se>
+
+ * gmp.texi (Integer Import and Export): Mention Cray unfilled words.
+
+ * mpz/set_d.c, mpq/set_d.c: Use LIMBS_PER_DOUBLE for the output of
+ __gmp_extract_double. Reported by Henrik Johansson.
+
+2002-05-17 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/alpha/ev6/nails/addmul_2.asm: New file.
+ * mpn/alpha/ev6/nails/addmul_3.asm: New file.
+ * mpn/alpha/ev6/nails/addmul_4.asm: New file.
+
+ * mpn/generic/dump.c: Rewrite and nailify.
+
+2002-05-16 Kevin Ryde <kevin@swox.se>
+
+ * mpfr/Makefile.am (EXTRA_DIST): Add BUGS file.
+
+2002-05-15 Torbjorn Granlund <tege@swox.com>
+
+ * configure.in (*-cray-unicos*): Remove -hscalar0, add -hnofastmd
+ as workaround for compiler bug.
+ (mips64*-*-*): Pass just -O1 to cc, to work around compiler bug.
+
+2002-05-14 Torbjorn Granlund <tege@swox.com>
+
+ * configure.in (*-cray-unicos*): Pass -hscalar0 to work around
+ compiler bug for mpz/import.c.
+
+2002-05-11 Torbjorn Granlund <tege@swox.com>
+
+ * mpz/import.c: Cast pointer via `unsigned long' when checking
+ alignment to avoid compiler warnings.
+
+ * mpn/generic/rootrem.c: Adjust allocation of qp temporary area.
+
+2002-05-09 Kevin Ryde <kevin@swox.se>
+
+ * mpz/import.c: Corrections to size store, special case tests, and
+ general case ACCUMULATE.
+ * tests/mpz/t-import.c, tests/mpz/t-export.c: More test data.
+
+2002-05-09 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/generic/rootrem.c: Use temp space for root, copy value in place
+ before returning.
+ * mpz/root.c: Don't allocate extra limb for root value.
+ * mpz/perfpow.c: Undo last change.
+
+2002-05-08 Torbjorn Granlund <tege@swox.com>
+
+ * gmp-impl.h (powerpc BSWAP_LIMB_FETCH): Rename local variable to make
+ it not clash with caller.
+
+ * mpn/generic/rootrem.c: New file.
+ * configure.in (gmp_mpn_functions): Add rootrem and pow_1.
+ * mpn/Makefile.am (nodist_libdummy_la_SOURCES): Add rootrem.c and
+ pow_1.c
+ * gmp-impl.h (mpn_rootrem): Add declaration.
+ * mpz/perfpow.c: Amend allocations for mpn_rootrem requirements.
+ * mpz/root.c: Rewrite to use mpn_rootrem.
+
+2002-05-08 Kevin Ryde <kevin@swox.se>
+
+ * gmp-impl.h (MUL_KARATSUBA_THRESHOLD etc): Remove forced nail values.
+
+ * mpf/fits_u.h, mpf/fits_s.h, tests/mpf/t-fits.c: Ignore fraction
+ part, making the code match the documentation.
+
+ * gmpxx.h (struct __gmp_binary_minus): Use mpz_ui_sub.
+
+2002-05-07 Kevin Ryde <kevin@swox.se>
+
+ * mpn/powerpc32/README: New file.
+
+ * mpz/root.c: Use unsigned long with mpz_sub_ui not mp_limb_t.
+
+ * tune/README: Misc updates including sparc32/v9 smoothness, low res
+ timebase, and mpn_add_n operand overlaps.
+ * tune/many.pl: Add udiv.asm support.
+
+ * gmp.texi (Build Options): A couple of --build better as --host.
+ (Known Build Problems, Notes for Package Builds): Add DESTDIR problem.
+ (Compatibility with older versions): Compatible with 4.x versions.
+ (Converting Integers): Remove mpz_get_ui + mpz_tdiv_q_2exp decompose.
+ (Integer Import and Export): New section.
+ (Miscellaneous Integer Functions): Clarify mpz_sizeinbase returns 1
+ for operand of 0.
+ (Language Bindings): Add GNU Pascal.
+ (Low-level Functions): Add GMP_NUMB_MAX.
+
+ * tests/mpz/t-import.c, tests/mpz/t-export.c, tests/mpz/t-get_d.c:
+ New tests.
+ * tests/mpz/Makefile.am: Add them.
+
+ * mpz/import.c, mpz/export.c: New files.
+ * Makefile.am, mpz/Makefile.am, gmp-h.in: Add them.
+
+ * gmp-h.in, gmp-impl.h (GMP_NUMB_MAX): Move to gmp.h.
+ * gmp-impl.h (CNST_LIMB): Add cast to mp_limb_t to ensure unsigned.
+ (CRAY_Pragma, MPN_REVERSE, MPN_BSWAP, MPN_BSWAP_REVERSE,
+ ASSERT_ALWAYS_LIMB, ASSERT_ALWAYS_MPN): New macros.
+ (MPZ_CHECK_FORMAT): Use ASSERT_ALWAYS_MPN.
+
+2002-05-07 Torbjorn Granlund <tege@swox.com>
+
+ * mpz/aors_ui.h: Nailify.
+
+ * tests/mpz/t-addsub.c: New file.
+ * tests/mpz/Makefile.am (check_PROGRAMS): Add t-addsub.
+
+ * mpz/ui_sub.c: New file.
+ * mpz/Makefile.am (libmpz_la_SOURCES): Add ui_sub.c.
+ * Makefile.am (MPZ_OBJECTS): Ditto.
+ * gmp-h.in (mpz_ui_sub): Add declaration.
+
+ * gmp-impl.h (MPZ_REALLOC): Rewrite to allow the use of _mpz_realloc
+ return value.
+
+ * gmp-h.in (mpn_pow_1): Add declaration.
+
+ * mpn/generic/pow_1.c: Handle exp <= 1. Reverse rp/tp parity scheme
+ for bn == 1 arm.
+
+ * Rename MP_LIMB_T_HIGHBIT => GMP_LIMB_HIGHBIT.
+
+2002-05-06 Torbjorn Granlund <tege@swox.com>
+
+ * demos/pexpr.c (main): Don't call mpz_sizeinbase with negative base.
+
+ * randraw.c (lc): Remove an unused variable.
+
+ * mpn/generic/get_str.c: Clarify an algorithm description.
+
+ * tests/mpf/t-trunc.c: Nailify.
+ * tests/mpf/t-set_si.c: Disable for nails.
+
+ * mpf/cmp_si.c: Nailify.
+ * mpf/cmp_ui.c: Nailify.
+ * mpf/div.c: Nailify.
+ * mpf/div_2exp.c: Nailify.
+ * mpf/div_ui.c: Nailify.
+ * mpf/eq.c: Nailify.
+ * mpf/get_d.c: Nailify.
+ * mpf/get_d_2exp.c: Nailify.
+ * mpf/get_si.c: Nailify.
+ * mpf/get_str.c: Nailify.
+ * mpf/get_ui.c: Nailify.
+ * mpf/mul_2exp.c: Nailify.
+ * mpf/random2.c: Nailify.
+ * mpf/set_q.c: Nailify.
+ * mpf/set_si.c: Nailify.
+ * mpf/set_str.c: Nailify.
+ * mpf/set_ui.c: Nailify.
+ * mpf/sub.c: Nailify.
+ * mpf/ui_div.c: Nailify.
+ * mpf/ui_sub.c: Nailify.
+ * mpf/urandomb.c: Nailify.
+
+ * gmp-impl.h (__GMPF_BITS_TO_PREC, __GMPF_PREC_TO_BITS): Nailify.
+
+ * mpz/get_si.c: Misc variable name changes.
+
+ * mpf/fits_u.h: Rewrite - nailify.
+ * mpf/fits_s.h: Likewise.
+
+ * mpz/mod.c: Disambiguate if-statement with extra {}.
+
+ * mpf/int_p.c: Fix type of size variables.
+ * mpf/get_ui: Likewise.
+ * mpf/get_si: Likewise.
+ * mpq/equal.c: Likewise.
+ * mpq/get_d.c: Likewise.
+ * mpz/cmp_d.c: Likewise.
+ * mpz/cmpabs_d.c: Likewise.
+ * mpz/divis_2exp.c: Likewise.
+ * mpz/kronuz.c: Likewise.
+ * mpz/kronzu.c: Likewise.
+ * mpz/kronzs.c: Likewise.
+ * mpz/kronsz.c: Likewise.
+ * mpz/scan0.c: Likewise.
+ * mpz/scan1.c: Likewise.
+ * mpz/tstbit.c: Likewise.
+ * mpz/cong_2exp.c: Likewise.
+ * mpz/divis.c: Likewise.
+
+2002-05-04 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/generic/gcd.c: Additional nailify changes.
+
+2002-05-04 Kevin Ryde <kevin@swox.se>
+
+ * gmp-h.in (__GNU_MP_VERSION): Set to 4.1.
+ * Makefile.am (-version-info): Bump for new release.
+
+2002-04-30 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/generic/divrem_1.c: Additional nailify changes.
+ * mpn/generic/mod_1.c: Likewise.
+
+ * tests/mpq/t-get_d.c: Print floats with all 16 digits.
+
+ * mpq/get_d.c: Nailify.
+
+ * tests/mpq/t-set_f.c: Disable for nails.
+
+ * mpz/get_d.c: Nailify.
+
+ * gmp-impl.h (LIMBS_PER_DOUBLE, MP_BASE_AS_DOUBLE): Nailify.
+
+ * gmp-h.in (__GMPZ_FITS_UTYPE_P): Cast maxval to before shifting it.
+
+ * extract-dbl.c: Nailify.
+
+2002-04-29 Torbjorn Granlund <tege@swox.com>
+
+ * mpq/md_2exp.c (mord_2exp): Nailify.
+
+ * mpq/cmp_ui.c: Nailify.
+
+ * mpq/cmp.c (mpq_cmp): Nailify.
+
+ * mpn/generic/gcd.c: Nailify. GNUify code layout.
+
+ * mpn/generic/gcdext.c: Nailify. Misc changes.
+
+ * tests/mpz/t-sqrtrem.c: Let argv[1] mean # of repetitions.
+ * tests/mpz/t-gcd.c: Likewise.
+
+ * mpz/gcd.c: Nailify.
+
+ * mpn/generic/random.c: Nailify.
+
+ * gmp-impl.h (modlimb_invert): Nailify.
+
+2002-04-27 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/generic/gcdext.c (div2): Remove qh parameter.
+ (mpn_gcdext): Streamline double-limb code.
+ Move GCDEXT_THRESHOLD check to after initial division.
+
+2002-04-27 Kevin Ryde <kevin@swox.se>
+
+ * gmp-impl.h (JACOBI_MOD_OR_MODEXACT_1_ODD): Allow for odd
+ GMP_NUMB_BITS.
+
+ * tune/time.c (sgi_works_p): Allow for 64-bit counter, and fix
+ SGI_CYCLECNTR_SIZE handling.
+
+ * demos/expr/exprfr.c: Add nan and inf constants.
+ * demos/expr/t-expr.c: Exercise them.
+
+2002-04-26 Torbjorn Granlund <tege@swox.com>
+
+ * mpz/cmp_ui.c: Fix overflow conditions for nails.
+
+ * gmp-h.in (mpz_get_ui): Fix typo from last change.
+
+ * mpz/n_pow_ui.c: Adjust allocation for nails.
+ (GMP_NUMB_HALFMAX): Renamed from MP_LIMB_T_HALFMAX.
+ Fix umul_ppmm invocation for for nails.
+
+2002-04-24 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/generic/gcdext.c: Simplify by using mpn_tdiv_qr instead of
+ mpn_divmod.
+
+2002-04-24 Kevin Ryde <kevin@swox.se>
+
+ * configure.in (*-*-cygwin*): Give a sensible default command line
+ limit, to avoid blowups reported by Jim Fougeron on windows 9x.
+ (--enable-nails): Make the default 2, since mp_bases has data for that.
+
+ * mpfr/mpfr-math.h (__mpfr_nan): Use a "double" for the bytes, to
+ avoid a mis-conversion on alpha gcc 3.0.2.
+ (_MPFR_INFP_BYTES, _MPFR_INFM_BYTES): Should be a zero mantissa.
+
+2002-04-23 Torbjorn Granlund <tege@swox.com>
+
+ * mpz/dive_ui.c: Fix typo.
+
+ * mpz/fits_s.h: Rewrite.
+
+ * mpz/jacobi.c: Nailify.
+ * mpz/kronuz.c: Additional nailify changes.
+ * mpz/kronsz.c: Likewise.
+
+2002-04-23 Kevin Ryde <kevin@swox.se>
+
+ * demos/expr/Makefile.am (LDADD): Add $(LIBM) for the benefit of mpfr.
+
+ * mpz/divis_ui.c, mpz/cong_ui.c: Nailify.
+ * mpn/generic/bdivmod.c, mpz/divexact.c, mpz/dive_ui.c: Nailify.
+ * mpn/generic/sb_divrem_mn.c, mpn/generic/divrem.c,
+ mpn/generic/divrem_2.c: Nailify ASSERTs.
+ * mpn/x86/k6/mmx/logops_n.asm, mpn/x86/k6/mmx/com_n.asm: Nailify.
+ * mpz/inp_raw.c, mpz/out_raw.c: Nailify.
+ * mpz/kronzu.c, mpz/kronuz.c, mpz/kronzs.c, mpz/kronsz.c: Nailify.
+ * mpn/generic/divis.c, mpz/cong.c, mpz/cong_2exp.c: Nailify.
+ * gmp-impl.h (NEG_MOD): Nailify.
+
+ * gmp-impl.h, mpn/mp_bases.c: Add back GMP_NUMB_BITS==30 bases data.
+
+ * mpfr/get_d.c: Patch from Paul to avoid problem with constant folding
+ in gcc on OSF.
+
+ * mpn/lisp/gmpasm-mode.el: Remove mention of defunct LF macro.
+
+2002-04-22 Torbjorn Granlund <tege@swox.com>
+
+ * demos/pexpr.c: Handle "binomial" operator.
+
+ * mpz/cmp_ui.c: Move assignments of `up' out of conditionals.
+
+ * mpn/generic/gcdext.c: Fix fencepost error in STAT code.
+
+ * gmp-impl.h (mpn_com_n): Nailify.
+
+ * tests/mpz/t-cdiv_ui.c: New file.
+ * tests/mpz/Makefile.am (check_PROGRAMS): Add t-cdiv_ui.
+ * mpz/cdiv_qr_ui.c: Nailify.
+ * mpz/cdiv_q_ui.c: Nailify.
+ * mpz/cdiv_r_ui.c: Nailify.
+ * mpz/cdiv_ui.c: Nailify.
+
+ * tests/misc/t-printf.c (CHECK_N): Add cast to allow `char' to be an
+ unsigned type.
+ * tests/misc/t-scanf.c: Likewise.
+
+ * mpz/mul_i.h: Rework nails code to handle parameter overlap.
+
+ * tests/mpz/t-set_f.c: Disable for nails.
+
+2002-04-21 Torbjorn Granlund <tege@swox.com>
+
+ * mpz/set_si.c: Add cast to support LONG_LONG_LIMB.
+ * mpz/iset_si.c: Likewise.
+
+ * mpz/bin_ui.c: Nailify.
+ * mpz/bin_uiui.c: Nailify.
+
+ * mpz/cmpabs_ui.c: Nailify.
+
+ * tests/mpz/t-aorsmul.c: Nailify.
+ * mpz/aorsmul_i.c (mpz_addmul_ui, mpz_submul_ui): Nailify better.
+
+2002-04-20 Torbjorn Granlund <tege@swox.com>
+
+ * tests/mpz/t-fdiv_ui.c: Check mpz_fdiv_ui.
+ * tests/mpz/t-tdiv_ui.c: Check mpz_tdiv_ui.
+
+ * mpz/tdiv_ui.c: Rewrite nails code.
+ * mpz/fdiv_ui.c: Nailify.
+
+ * tests/mpz/t-tdiv_ui.c: Check returned remainders.
+ * tests/mpz/t-fdiv_ui.c: Merge in recent t-tdiv_ui changes.
+
+ * mpz/tdiv_q_ui.c: Remove spurious TMP_* calls.
+
+ * mpz/fdiv_qr_ui.c: Nailify.
+ * mpz/fdiv_q_ui.c: Nailify.
+ * mpz/fdiv_r_ui.c: Nailify.
+
+ * mpz/get_si.c: Misc nailify changes to shut up compiler warnings.
+
+ * mpz/ui_pow_ui.c: Fix typo in last change.
+
+2002-04-20 Kevin Ryde <kevin@swox.se>
+
+ * tests/misc/t-printf.c, tests/misc/t-scanf.c: Check all %n types.
+
+ * mpn/x86/k7/mmx/divrem_1.asm, mpn/x86/p6/mmx/divrem_1.asm
+ (mpn_preinv_divrem_1): New entrypoint.
+ (mpn_divrem_1): Avoid a branch when testing high<divisor.
+ * mpn/asm-defs.m4: Add define_mpn(preinv_divrem_1).
+ * configure.in: Allow divrem_1.asm to provide mpn_preinv_divrem_1.
+
+ * gmp-impl.h [nails]: Add #undefs of MUL_KARATSUBA_THRESHOLD etc, to
+ override CPU gmp-mparam.h. Remove JACOBI_BASE_METHOD override since
+ it's nails-neutral.
+
+ * tests/mpn/t-mp_bases.c: New file.
+ * tests/mpn/Makefile.am (check_PROGRAMS): Add it.
+ * tests/t-constants.c: Move MP_BASES constants checks to it.
+
+ * mpn/mp_bases.c: Fix big_base_inverted values for nails.
+ * gmp-impl.h (MP_BASES_BIG_BASE_INVERTED_10,
+ MP_BASES_NORMALIZATION_STEPS_10): Fix nails values.
+ (MP_BASES_*): Remove GMP_NUMB_BITS == 30 data.
+
+ * mpn/x86/pentium/com_n.asm, mpn/x86/pentium/logops_n.asm: Add
+ NAILS_SUPPORT indicators.
+
+ * configure.in: Grep for NAILS_SUPPORT in cpu-specific code, and look
+ in "nails" subdirectories, print path used.
+ * mpn/asm-defs.m4 (NAILS_SUPPORT): New macro.
+
+ * mpfr/mpfr-test.h: Include config.h, for the benefit of test programs
+ not using gmp-impl.h.
+
+2002-04-19 Torbjorn Granlund <tege@swox.com>
+
+ * tests/mpz/t-scan.c: Nailify.
+
+ * mpz/tdiv_qr_ui.c: Nailify.
+ * mpz/tdiv_q_ui.c: Nailify.
+ * mpz/tdiv_r_ui.c: Nailify.
+ * mpz/tdiv_ui.c: Nailify.
+
+ * mpz/cmp_ui.c: Nailify.
+
+ * mpz/ui_pow_ui.c: Misc nailify changes to shut up compiler warnings.
+
+ * mpz/scan0.c: Nailify.
+ * mpz/scan1.c: Nailify.
+
+ * tests/mpz/t-sizeinbase.c (mpz_fake_bits): Nailify.
+
+2002-04-18 Torbjorn Granlund <tege@swox.com>
+
+ * mpz/aorsmul_i.c: Nailify.
+
+ * mpz/cmp_si.c: Nailify (botched).
+
+ * mpz/ui_pow_ui.c: Nailify.
+
+ * gmp-h.in (__GMPZ_FITS_UTYPE_P): Nailify.
+
+ * mpz/fits_s.h: Nailify.
+
+ * tests/mpz/bit.c (check_tstbit): Nailify.
+
+ From Paul Zimmermann:
+ * mpn/generic/sqrtrem.c: Nailify.
+
+ * mpz/n_pow_ui.c: Nailify.
+
+ * mpz/cfdiv_r_2exp.c: Nailify.
+
+ * randraw.c (lc): Undo: Let mpn_rshift put result in place to avoid
+ extra MPN_COPY.
+
+2002-04-17 Torbjorn Granlund <tege@swox.com>
+
+ * mpz/clrbit.c: Add two GMP_NUMB_MASK masks after addition.
+
+ * mpn/generic/random2.c (LOGBITS_PER_BLOCK): Decrease to 4.
+
+ * gmp-impl.h (nail DIV_DC_THRESHOLD): Decrease to 50 to allow fast
+ division.
+
+ * mpn/generic/random2.c: Nailify.
+
+ * mpz/fac_ui.c: Nailify.
+
+ * mpz/mul_i.h: #if ... #endif code block to shut up gcc warnings.
+
+ * mpn/generic/sqrtrem.c: Adopt to GNU coding standards.
+ (mpn_dc_sqrtrem): New name for mpn_dq_sqrtrem.
+ Partial nailification.
+
+ * configure.in: As a temporary hack, clear extra_functions for nails
+ builds.
+
+ * gmp-h.in (mpz_get_ui): #if ... #endif else code block to shut up gcc
+ warnings.
+
+2002-04-17 Kevin Ryde <kevin@swox.se>
+
+ * texinfo.tex: Update to 2002-03-26.08 per texinfo 4.2.
+ * gmp.texi: Must have @top in @ifnottex (or @contents doesn't come out
+ in one run).
+
+ * mpn/generic/scan0.c, mpn/generic/scan1.c: Nailify.
+
+ * tests/mpn/t-scan.c: New file.
+ * tests/mpn/Makefile.am (check_PROGRAMS): Add it.
+
+ * tests/refmpn.c, tests/tests.h (refmpn_tstbit): Use unsigned long for
+ bit index.
+ (refmpn_setbit, refmpn_clrbit, refmpn_scan0, refmpn_scan1): New
+ functions.
+
+ * mpfr/cmp_ui.c (mpfr_cmp_si_2exp): Fix b==0 i!=0 case.
+
+2002-04-17 Gerardo Ballabio <gerardo.ballabio@unimib.it>
+
+ * gmpxx.h, mpfrxx.h: Remove mpfr_class bool combinations, remove
+ mpfr_class::get_str2, use mp_rnd_t for rounding modes, use
+ 8*sizeof(double) for mpfr_t's holding doubles.
+
+2002-04-17 Torbjorn Granlund <tege@swox.com>
+
+ * mpz/powm.c: Nailify.
+ * mpz/powm_ui.c: Nailify.
+
+2002-04-16 Torbjorn Granlund <tege@swox.com>
+
+ * mpz/hamdist.c: Nailify.
+ * tests/misc.c (urandom): Nailify.
+
+ * mpz/get_si.c: Nailify.
+ * gmp-h.in (mpz_get_ui): Nailify. Streamline (and probably upset
+ memory checkers).
+
+ * gmp-impl.h (mp_bases[10] values): Add versions for GMP_NUMB_BITS
+ being 28, 60, and 63.
+ * mpn/mp_bases.c: Add tables for GMP_NUMB_BITS being 28, 60, and 63.
+
+ * mpz/iset_si.c: Nailify.
+ * mpz/iset_ui.c: Nailify
+
+ * tests/mpz/convert.c (main): Print test number in error message.
+
+ * mpn/generic/get_str.c (mpn_sb_get_str): Shift up `frac' into nails
+ field after bignum division.
+
+2002-04-16 Kevin Ryde <kevin@swox.se>
+
+ * gmp-h.in, gmp-impl.h (GMP_NAIL_MASK): Move to gmp.h.
+
+ * gmp.texi: Use @documentdescription and @copying, per texinfo 4.2.
+ (Low-level Functions): Clarify mpn_gcd overlap requirements, rewrite
+ mpn_set_str description, add nails section.
+ (C++ Interface General): Remove bool from types that mix with classes.
+ (Language Bindings): Add STklos, GNU Smalltalk, Regina.
+ (Binary to Radix, Radix to Binary): Describe new code.
+ (Assembler Cache Handling): More notes, mostly by Torbjorn.
+
+ * macos/configure (%vars): Remove __GMP from substitutions, per change
+ to main configure.
+
+ * mpn/generic/dive_1.c: Nailify.
+ * mpn/generic/mode1o.c: Nailify, remove bogus ASSERT in commented-out
+ alternate implementation.
+ * gmp-impl.h (SUBC_LIMB): New macro.
+
+ * tests/devel/try.c (validate_divexact_1): Correction to compare.
+ (udiv_qrnnd): New testing.
+ (SHIFT_LIMIT): Nailify.
+ (-b): New option, remove spurious "H" from getopt string.
+
+ * mpz/clrbit.c: Nailify.
+ * tests/mpz/t-hamdist.c: Nailify.
+ * gmp-impl.h (MPN_FIB2_SIZE): Nailify.
+ (PP): Nailify conditionals.
+ * tests/mpz/t-fib_ui.c (MPZ_FIB_SIZE_FLOAT): Nailify.
+
+ * configure.in, acinclude.m4: Establish GMP_NAIL_BITS and
+ GMP_LIMB_BITS for gmp-h.in configure tests.
+
+ * mpfr/*, configure.in: Update to final mpfr 2.0.1.
+ * mpfr/acinclude.m4 (MPFR_CONFIGS): Use $host, not uname stuff.
+ * mpfr/tests/tout_str.c: Patch from Paul for denorm fprintf tests.
+
+2002-04-15 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/generic/divrem_1.c (EXTRACT): Remove.
+
+ * tests/mpz/t-tdiv_ui.c (dump_abort): Accept argument for error string.
+
+ * mpz/rrandomb.c: Nailify. Needs further work.
+
+ * mpn/generic/mod_1.c: Nailify.
+
+ * gmp-impl.h: Set various *_THRESHOLD values to be used for nails to
+ avoid not yet qualified algorithms.
+ (MPZ_CHECK_FORMAT): Check that nail part is zero.
+
+ * tests/mpz/t-mul.c (main): Test squaring even for huge operands.
+ (base_mul): Nailify.
+ (dump_abort): Accept argument for error string. Print product
+ difference.
+
+ * mpn/generic/set_str.c: Nailify.
+
+ * gmp-h.in (__GMPN_ADD, __GMPN_SUB): Nailify.
+
+2002-04-14 Torbjorn Granlund <tege@swox.com>
+
+ * randraw.c (lc): Return non-nonsense return value for seed=0 case.
+ Check for m2exp being non-zero early; remove all other tests of m2exp.
+ Remove redundant MPN_ZERO call.
+ Let mpn_rshift put result in place to avoid extra MPN_COPY.
+ Remove confusing comment before function `lc' describing BBS algorithm.
+ Misc simplification and cleanups.
+ Nailify. Needs further work.
+
+ * mpz/set_si.c: Nailify.
+ * mpz/set_ui.c: Nailify.
+ * mpz/mul_i.h: Nailify.
+
+ * tests/mpz/t-mul_i.c: Actually test _ui routines. Add some more test
+ values.
+
+ * mpn/generic/mul_n.c: Finish nailifying toom3 code.
+
+2002-04-13 Kevin Ryde <kevin@swox.se>
+
+ * mpfr/*: Update to another new mpfr 2.0.1.
+ * configure.in, Makefile.am, mpfr/Makefile.am, mpfr/tests/Makefile.am:
+ Use MPFR_CONFIGS macro, establish separate MPFR_CFLAGS for mpfr build.
+
+ * mpfr/tests/Makefile.am: Correction to convenience rule for libmpfr.a.
+
+2002-04-11 Kevin Ryde <kevin@swox.se>
+
+ * mpfr/set_q.c: gmp-impl.h before mpfr.h to avoid _PROTO redefine.
+
+ * mpfr/*, configure.in: Update to new mpfr 2.0.1.
+
+ * tests/refmpn.c (refmpn_udiv_qrnnd, refmpn_divmod_1c_workaround):
+ Fixes for nails.
+
+ * tests/t-constants.c (MODLIMB_INVERSE_3): Nailify tests.
+ (MP_BASES_BIG_BASE_INVERTED_10, MP_BASES_NORMALIZATION_STEPS_10): Only
+ check these under USE_PREINV_DIVREM_1.
+ * tests/t-modlinv.c: Nailify tests.
+
+2002-04-11 Gerardo Ballabio <gerardo.ballabio@unimib.it>
+
+ * gmpxx.h: Remove bool combinations, remove mpf_class::get_str2, only
+ need <iosfwd> now.
+
+2002-04-11 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/generic/diveby3.c: Nailify.
+ * gmp-impl.h (MODLIMB_INVERSE_3): Nailify.
+
+ * mpn/generic/mul_n.c: Nailify Toom3 code.
+
+2002-04-10 Kevin Ryde <kevin@swox.se>
+
+ * gmp-impl.h (MPN_KARA_MUL_N_MINSIZE, MPN_KARA_SQR_N_MINSIZE): Set to
+ 3, as needed by nails case.
+
+ * mpn/generic/addmul_1.c, mpn/generic/submul_1.c [nails]: Fix vl
+ assert, add rp,n and up,n asserts.
+
+ * mpfr/Makefile.am: Add new mpfr-math.h, install mpf2mpfr.h.
+
+2002-04-10 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/generic/divrem_1.c: Nailify. Update mp_size_t variables to use
+ `n' suffix instead of `size' suffix.
+ * mpn/generic/divrem_2.c: Likewise.
+ * mpn/generic/sb_divrem_mn.c: Nailify.
+ * mpn/generic/tdiv_qr.c: Nailify.
+ (SHL): Remove silly macro.
+
+ * mpn/generic/mul_n.c (mpn_kara_mul_n): Replace open-coded increment by
+ mpn_incr_u call. Handle nails in ws[n] increment.
+ * mpn/generic/mul_n.c (mpn_kara_sqr_n): Likewise.
+
+ * gmp-h.in (GMP_NUMB_MASK): New #define.
+ (__GMPN_AORS_1): Add version for nails.
+
+ * gmp-impl.h (GMP_NUMB_MASK): Comment out, now in gmp.h.
+ (mpn_incr_u): Don't assume `incr' is non-zero.
+ (mpn_decr_u): Similarly.
+
+2002-04-09 Kevin Ryde <kevin@swox.se>
+
+ * mpfr/*, configure.in: Update to mpfr 2.0.1.
+
+ * tests/refmpn.c (refmpn_mul_1c, lshift_make): Corrections for nails.
+ * tssts/refmpn.c, tests/tests.h (refmpn_cmp_allowzero): New function.
+
+ * mpn/generic/mul_1.c [nails]: Fix vl assert, add {up,n} assert.
+
+ * mpn/pa32/hppa1_1/pa7100/addmul_1.asm,
+ mpn/pa32/hppa1_1/pa7100/submul_1.asm: Rename "size" define, to avoid
+ ELF .size directive. Reported by LaMont Jones.
+
+ * tests/mpz/t-set_si.c: Add nails support.
+
+2002-04-05 Torbjorn Granlund <tege@swox.com>
+
+ * gmp-impl.h: Replace nail mpn_incr_u, mpn_decr_u with faster versions.
+ (mp_bases[10] values): Check GMP_NUMB_BITS instead of BITS_PER_MP_LIMB.
+ Add GMP_NUMB_BITS == 30 version.
+ (__gmp_doprnt, etc): Remove parameter names.
+
+ * mpn/generic/mul_n.c: Nailify Karatsuba code.
+ * mpn/generic/get_str.c: Nailify.
+ * mpn/generic/sqr_basecase.c: Nailify.
+ * mpn/generic/lshift.c: Nailify.
+ * mpn/generic/rshift.c: Likewise.
+ * mpn/generic/add_n.c: Nailify. Revamp non-nail code.
+ * mpn/generic/sub_n.c: Likewise.
+ * mpn/generic/mul_1.c: Likewise.
+ * mpn/generic/addmul_1.c: Likewise.
+ * mpn/generic/submul_1.c: Likewise.
+
+2002-04-02 Kevin Ryde <kevin@swox.se>
+
+ * gmp-impl.h (BSWAP_LIMB_FETCH, BSWAP_LIMB_STORE) [powerpc]:
+ Corrections to constraints, and restrict to bigendian.
+
+2002-03-31 Kevin Ryde <kevin@swox.se>
+
+ * tests/mpz/dive.c: Better diagnostics.
+
+ * tests/devel/try.c (mpn_get_str, mpn_umul_ppmm_r): New tests.
+
+ * tests/misc.c, tests/tests.h (byte_diff_lowest, byte_diff_highest):
+ New functions.
+
+ * tests/t-bswap.c: New file.
+ * tests/Makefile.am (check_PROGRAMS): Add it.
+
+ * tests/mpn/t-aors_1.c, tests/mpn/t-iord_u.c: Add nails support.
+
+ * gmp-impl.h (MPN_IORD_U) [x86]: Eliminate unnecessary jiord and iord,
+ rename "n" to incr per generic versions, restrict to nails==0.
+ (mpn_incr_u, mpn_decr_u): Add nails support.
+ (GMP_NAIL_LOWBIT, GMP_NUMB_MAX): New macros.
+
+ * tests/trace.c, tests/tests.h (byte_trace, byte_tracen): New
+ functions.
+ * tests/trace.c: Handle NULL operands.
+
+ * tests/refmpn.c, tests/devel/try.c, tune/speed.c: Add preliminary
+ nail support.
+
+ * tests/refmpn.c, test/tests.h (byte_overlap_p, refmpn_equal_anynail,
+ refmpn_umul_ppmm_r, refmpn_udiv_qrnnd_r, refmpn_get_str,
+ refmpn_bswap_limb, refmpn_random, refmpn_random2, refmpn_bswap_limb):
+ New functions.
+
+ * gmp-impl.h, tests/refmpn.c (ASSERT_LIMB): Renamed from
+ ASSERT_MP_LIMB_T.
+
+ * mpn/x86/*/*.asm, mpn/powerpc32/*/*.asm, mpn/powerpc64/*/*.asm: Put
+ speeds after the copyright notice, so as to keep that clear.
+
+2002-03-29 Kevin Ryde <kevin@swox.se>
+
+ * configure.in (powerpc*-*-aix*): Correction to xlc -qarch selection,
+ for 32-bit mode.
+
+2002-03-28 Torbjorn Granlund <tege@swox.com>
+
+ * mpn: Fix spacing in many files.
+
+ * mpn/generic/aorsmul_1.c: Split into addmul_1.c and submul_1.c.
+ * mpn/generic/aors_n.c: Split into add_n.c and sub_n.c.
+
+ * mpn/pa64/add_n.asm: Trim another 0.125 cycle/limb. Fix a comment.
+ * mpn/pa64/sub_n.asm: Likewise.
+
+ * mpn/pa64/mul_1.asm: Change comclr, comb to proper forms cmpclr, cmpb.
+ * mpn/pa64/addmul_1.asm: Likewise.
+ * mpn/pa64/submul_1.asm: Likewise.
+
+2002-03-28 Kevin Ryde <kevin@swox.se>
+
+ * gmp.texi (Converting Integers): Fix type of exp in mpz_get_d_2exp,
+ reported by epl@unimelb.edu.au.
+ (References): Update Burnikel and Ziegler URL, reported by Keith
+ Briggs.
+
+ * gmp-h.in, mp-h.in, configure.in, acinclude.m4: Remove __GMP from
+ AC_SUBSTs, since autoconf says leading "_" in makefile variables is
+ not portable.
+
+ * demos/expr/run-expr.c: Declare optarg, optind, opterr if necessary.
+ * configure.in, demos/expr/expr-config-h.in: Configs for this.
+
+2002-03-27 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/Makefile.am (TARG_DIST): Remove pa64w and hppa, add pa32.
+
+ * configure.in (path_20w): Remove pa64w.
+
+ * mpn/pa64/udiv_qrnnd.asm: Tweak for PA8000 performance comparative to
+ that on PA8500.
+
+2002-03-26 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/pa32: New name for mpn/hppa.
+ * configure.in: Corresponding changes.
+
+ * mpn/pa64/umul_ppmm.asm: New file, generalized for both 2.0N and 2.0W.
+ * mpn/pa64/umul_ppmm.S: Remove.
+
+ * mpn/pa64/udiv_qrnnd.asm: Generalize for both 2.0N and 2.0W.
+ * mpn/pa64w/udiv_qrnnd.asm: Remove.
+
+2002-03-26 Kevin Ryde <kevin@swox.se>
+
+ * mpfr/tests/tdiv.c, mpfr/tests/tui_div.c: Don't depend on nan and inf
+ handling in "double", for the benefit of alpha.
+
+ * configure (hppa2.0w): Set path to "pa64w pa64".
+
+ * acinclude.m4, configure.in (GMP_C_INLINE): New macro.
+ * acinclude.m4 (GMP_H_EXTERN_INLINE): Use it, and fix "yes" handling.
+
+2002-03-25 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/pa64w/add_n.s: Remove.
+ * mpn/pa64w/sub_n.s: Remove.
+ * mpn/pa64w/lshift.s: Remove.
+ * mpn/pa64w/rshift.s: Remove.
+ * mpn/pa64w/mul_1.S: Remove.
+ * mpn/pa64w/addmul_1.S: Remove.
+ * mpn/pa64w/submul_1.S: Remove.
+ * mpn/pa64w/sqr_diagonal.asm: Remove.
+
+ * mpn/pa64/mul_1.asm: New file with twice faster code; generalized
+ for both 2.0N and 2.0W.
+ * mpn/pa64/submul_1.asm: Likewise.
+ * mpn/pa64/mul_1.S: Remove.
+ * mpn/pa64/submul_1.S: Remove.
+
+ * mpn/pa64/sqr_diagonal.asm: Generalize for both 2.0N and 2.0W.
+
+ * mpn/pa64/add_n.asm: New file, generalized for both 2.0N and 2.0W.
+ * mpn/pa64/sub_n.asm: Likewise.
+ * mpn/pa64/lshift.asm: Likewise.
+ * mpn/pa64/rshift.asm: Likewise.
+ * mpn/pa64/add_n.s: Remove.
+ * mpn/pa64/sub_n.s: Remove.
+ * mpn/pa64/lshift.s: Remove.
+ * mpn/pa64/rshift.s: Remove.
+
+2002-03-24 Kevin Ryde <kevin@swox.se>
+
+ * gmp-impl.h (BSWAP_LIMB_FETCH, BSWAP_LIMB_STORE): New macros.
+ * mpz/inp_raw.c, mpz/out_raw.c: Use them.
+ * acconfig.h (HAVE_HOST_CPU): Add some powerpc types.
+
+ * mpn/powerpc32/750/com_n.asm: New file.
+
+ * mpfr/tests/tout_str.c: Disable random tests, since they fail on
+ alphaev56-unknown-freebsd4.1 and do nothing by default.
+
+ * mpfr/tests/tsqrt.c: Don't depend on nan, inf or -0 in "double", for
+ the benefit of alpha.
+ * mpfr/sqrt.c: Clear nan flag on -0.
+
+ * demos/factorize.c: Use mpn_random() instead of random(), to avoid
+ portability problems.
+
+ * demos/isprime.c (print_usage_and_exit): Declare as "void" to avoid
+ warnings.
+
+ * demos/pexpr.c (setup_error_handler): Corrections to sigstack code.
+
+ * demos/calc/calc.y: Add some `;'s to make bison 1.34 happy.
+
+2002-03-23 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/pa64/addmul_1.asm: New file with twice faster code; generalized
+ for both 2.0N and 2.0W.
+
+2002-03-22 Kevin Ryde <kevin@swox.se>
+
+ * tune/time.c: Add SGI hardware counter measuring method, change some
+ abort()s into ASSERT_FAIL()s.
+
+ * configure.in (AC_CHECK_HEADERS): Add fcntl.h and sys/syssgi.h.
+ (AC_CHECK_FUNCS): Add syssgi.
+
+ * configure.in, mpfr/Makefile.am, mpfr/tests/Makefile.am: Use
+ -mieee-with-inexact or -ieee_with_inexact for mpfr on alpha, so
+ denorms work.
+
+ * mpfr/isinteger.c: Fix a memory leak.
+
+2002-03-21 Torbjorn Granlund <tege@swox.com>
+
+ * tune/speed.c (struct choice_t): Make `r' an mp_limb_t.
+
+2002-03-21 Kevin Ryde <kevin@swox.se>
+
+ * configure.in (HAVE_LIMB_BIG_ENDIAN, HAVE_LIMB_LITTLE_ENDIAN): Use an
+ AH_VERBATIM and better explanation.
+ * acinclude.m4 (GMP_C_DOUBLE_FORMAT): Similarly for the HAVE_DOUBLE
+ constants.
+
+ * gmp.texi (Number Theoretic Functions): Clarify sign of GCD returned
+ by mpz_gcdext.
+
+ * demos/pexpr.c, demos/pexpr-config-h.in, configure.in: Use an
+ autoconf test for stack_t.
+
+ * configure.in, gmp-h.in, mp-h.in, macos/configure, tests/mpz/reuse.c,
+ tests/mpf/reuse.c: Use __GMP_LIBGMP_DLL to enable windows declspec,
+ don't require _WIN32 (etc), remove __GMP_LIBGMP_SHARED and
+ __GMP_LIBGMP_STATIC.
+
+ * gmp-impl.h (mp_bases): Add __GMP_DECLSPEC, for the benefit of
+ tests/t-constants.c.
+
+ * tune/many.pl, tune/speed.h: Remove suffix hack for back.asm.
+
+2002-03-21 Paul Zimmermann <Paul.Zimmermann@loria.fr>
+
+ * mpfr/sin_cos.c (mpfr_sin_cos): New file.
+ * mpfr/mpfr.h, mpfr/mpfr.texi, mpfr/Makefile.am: Add it.
+ * mpfr/tan.c: Fix sign in 2nd and 4th quadrants.
+
+ * mpfr/log10.c: Fix hangs on certain inputs.
+
+2002-03-20 Torbjorn Granlund <tege@swox.com>
+
+ * demos/pexpr.c (setup_error_handler): Declare `s', the first
+ sigaltstack parameter, using `stack_t' just on AIX.
+
+2002-03-19 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/powerpc32/mul_1.asm: Use free caller-saves registers instead
+ of the callee-saves r30 and r31.
+
+2002-03-19 Kevin Ryde <kevin@swox.se>
+
+ * tune/freq.c (freq_proc_cpuinfo): Recognise powerpc "clock", where
+ previously got the wrong result from "bogomips".
+
+ * mpn/powerpc32/add_n.asm, mpn/powerpc32/sub_n.asm: Rewrite, faster on
+ 750, and smaller too.
+ * mpn/powerpc32/*.asm: Use L(), add some measured speeds.
+
+ * longlong.h (count_trailing_zeros) [vax]: Add a version using ffs,
+ but commented out.
+
+2002-03-17 Kevin Ryde <kevin@swox.se>
+
+ * tune/speed.c, tune/speed.h, tune/common.c, many.pl: Use optional
+ ".r" to specify operand overlaps for mpn_add_n, mpn_sub_n and logops.
+ Remove mpn_add_n_inplace and mpn_add_n_self.
+ * tune/many.pl: Fix MULFUNC_PROLOGUE parsing.
+
+ * gmp.texi (Known Build Problems): Note `make' problem with long
+ libgmp.la dependencies list.
+
+ * printf/doprnt.c, scanf/doscan.c (%zn): Remove test of non-existent
+ HAVE_SIZE_T, just use size_t unconditionally.
+ * printf/doprnt.c (%zd etc): Fix 'z' type parsing.
+ * tests/misc/t-printf.c, tests/misc/t-scanf.c: More tests.
+
+ * configure.in: Use AC_COPYRIGHT.
+ Add m4_pattern_allow(GMP_MPARAM_H_SUGGEST).
+
+ * tune/Makefile.am (libdummy.la): Remove this, sqr_basecase.c already
+ gets an ansi2knr rule from nodist_tuneup_SOURCES.
+
+ * longlong.h (count_leading_zeros) [pentiumpro gcc<3]: Test
+ HAVE_HOST_CPU_i686 too.
+
+ * mpz/out_raw.c (HTON_LIMB_STORE): Fix a typo in big endian #if.
+
+2002-03-14 Kevin Ryde <kevin@swox.se>
+
+ * mpn/x86/pentium/com_n.asm, mpn/x86/pentium/logops_n.asm,
+ mpn/x86/k6/mmx/com_n.asm: Add nails support.
+
+ * texinfo.tex: Update to 2002-03-01.06 (per texinfo 4.1).
+ * gmp.texi (@ma): Remove, @math does this now.
+
+ * mpfr/tests/reuse.c: Clear op1 and op2 flags only in their respective
+ outer loops.
+
+ * configure.in (--enable-cxx): Correction to the default stated in the
+ help string.
+ (power*-*-aix*, not powerpc): Use aix.m4, don't run
+ GMP_ASM_POWERPC_R_REGISTERS or use powerpc-defs.m4.
+
+2002-03-13 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/sparc32/gmp-mparam.h: New file.
+
+2002-03-13 Kevin Ryde <kevin@swox.se>
+
+ * demos/expr/exprfr.c: More mpfr functions, corrections to agm, cos,
+ sin, rename log2 constant to loge2 to make room for log2 function.
+ * demos/expr/t-expr.c: More tests.
+
+ * mpz/inp_raw.c (NTOH_LIMB_FETCH) [generic 16bit]: Remove spurious "+".
+
+ * mpfr/acos.c: Avoid a memory leak for certain operands.
+
+ * acinclude.m4, configure.in (GMP_C_DOUBLE_FORMAT): New macro.
+
+ * acinclude.m4 (GMP_HPC_HPPA_2_0, GMP_ASM_UNDERSCORE,
+ GMP_ASM_ALIGN_LOG, GMP_ASM_LSYM_PREFIX, GMP_ASM_W32, GMP_ASM_X86_MMX):
+ Change ac_objext to OBJEXT, which is the documented variable.
+
+ * config.guess (powerpc*-*-*): Use #ifdef on constants POWER_630 etc
+ in the AIX test, since old versions don't have them all.
+
+2002-03-11 Kevin Ryde <kevin@swox.se>
+
+ * configure.in (LIBC211): New AC_DEFINE, for mpfr.
+
+ * configure.in (mips*-*-*): Support ABI=o32 on irix 6, allow gcc 2.7.2
+ to fall back on it, but detect it doesn't work with gcc 2.95. Use
+ single mips-defs.m4 for both mips32 and mips64.
+ * acinclude.m4 (GMP_GCC_MIPS_O32): New macro.
+ * mpn/mips32/mips-defs.m4: Renamed from mips.m4.
+ * mpn/mips64/mips.m4: Remove (was a copy of mips32/mips.m4).
+
+ * mpn/powerpc32/750: New directory.
+ * configure.in (powerpc740, powerpc750, powerpc7400): Use it.
+ * mpn/powerpc32/750/gmp-mparam.h: New file.
+
+ * config.sub, gmp.texi (ultrasparc1): Remove this, just use plain
+ "ultrasparc".
+
+2002-03-10 Kevin Ryde <kevin@swox.se>
+
+ * mpfr: Update to 20020301, except internal_ceil_exp2.c,
+ internal_ceil_log2.c, internal_floor_log2.c renamed to i_ceil_exp2.c,
+ i_ceil_log2.c, i_floor_log2.c to be unique in DOS 8.3. And sqrtrem.c
+ removed since no longer required.
+ * mpfr/mpfr.texi: Fix some formatting.
+ * mpfr/tests/reuse.c: Patch by Paul to fix test4 variable handling.
+ * mpfr/sinh.c: Patch by Paul to fix err calculation when t==0.
+ * mpfr/tests/tget_d.c: Disable until portability of rnd_mode.c can be
+ sorted out.
+
+ * configure.in (powerpc*-*-*): Separate gcc and xlc cpu flags setups
+ for clarity.
+
+ * longlong.h (count_leading_zeros, count_trailing_zeros) [x86_64]: New
+ macros.
+
+2002-03-07 Kevin Ryde <kevin@swox.se>
+
+ * gmp.texi (Build Options): Note all the ultrasparcs accepted.
+ (Language Bindings): Add Math::BigInt::GMP.
+
+ * config.sub (ultrasparc2i): New cpu type.
+ * config.guess (sparc-*-*, sparc64-*-*): Add some exact CPU detection.
+
+2002-03-05 Kevin Ryde <kevin@swox.se>
+
+ * longlong.h (count_leading_zeros, count_trailing_zeros) [alphaev67,
+ alphaev68]: Use ctlz and cttz insns (as per gcc longlong.h).
+ (count_leading_zeros) [sparclite]: Fix parameter order (as per gcc
+ longlong.h).
+ * acconfig.h (HAVE_HOST_CPU_alphaev68): New define.
+
+ * config.guess [i?86-*-*]: Suppress error messages if compiler not
+ found or test program won't run.
+ [rs6000-*-*, powerpc-*-*]: Force code alignment for mfpvr test.
+
+2002-03-04 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/generic/pow_1.c: New file.
+
+2002-03-03 Kevin Ryde <kevin@swox.se>
+
+ * gmp.texi (Build Options): Note compiler must be able to fully link,
+ add alphapca57 and alphaev68, give a clearer example of MPN_PATH
+ (Debugging): Add notes on valgrind.
+ (C++ Formatted Output): Clarify mpf showbase handling, in particular
+ note "00.4" in octal.
+
+ * printf/doprntf.c: Do a showbase on octal float fractions, for
+ instance "00.4" where previously it gave "0.4".
+ * tests/cxx/t-ostream.cc: Update.
+
+ * gmp-h.in, mp-h.in (__GMP_DECLSPEC, __GMP_DECLSPEC_XX): Test
+ __WIN32__ for Borland C, reported by "delta trinity".
+
+ * gmp-h.in, mp-h.in: Use <cstddef> for size_t under C++, suggested by
+ Hans Aberg some time ago.
+ * gmp-h.in (<iosfwd>): Move to top of file for clarity.
+
+ * Makefile.am (libgmpxx_la_SOURCES): Use dummy.cc to force C++.
+ (CXX_OBJECTS): Add osfuns$U.lo.
+ * dummy.cc: New file.
+ * cxx/Makefile.am (INCLUDES): Use __GMP_WITHIN_GMPXX.
+ (libcxx_la_SOURCES): Add osfuns.cc.
+ * gmp-h.in (__GMP_DECLSPEC_XX): New define, use it on libgmpxx funs.
+ * gmp-impl.h: Add __GMP_DECLSPEC to libgmp functions used by libgmpxx.
+
+ * longlong.h (COUNT_TRAILING_ZEROS_TIME): Remove, no longer used.
+
+ * gmp-impl.h (MPN_SIZEINBASE, MPN_SIZEINBASE_16): Correction to
+ __totbits for nails.
+
+ * gmp-impl.h (JACOBI_LS0): Test size before limb, to pacify valgrind.
+ (JACOBI_0LS): Ditto, and fix parens around arguments.
+
+ * mpn/x86/x86-defs.m4 (call_mcount): Add a counter to make data labels
+ unique, since simplified L() scheme no longer gives that effect.
+ (notl_or_xorl_GMP_NUMB_MASK): New macro.
+ Add m4_assert_numargs in a few places.
+
+ * configure.in (*sparc*): Fix cycle counter setups for ABI=64.
+
+2002-02-28 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/vax/gmp-mparam.h: New file.
+
+2002-02-28 Kevin Ryde <kevin@swox.se>
+
+ * gmp-h.in (gmp_errno, gmp_version): Move into extern "C" block,
+ reported by librik@panix.com.
+
+ * gmp-h.in, mp-h.in (__GMP_DECLSPEC_EXPORT, __GMP_DECLSPEC_IMPORT):
+ Use __declspec(dllexport) and __declspec(dllimport) on Borland.
+ * gmp-h.in (_GMP_H_HAVE_FILE): Test __STDIO_H for Borland.
+ Reported by "delta trinity".
+
+ * gmp-impl.h (va_copy): Fall back on memcpy, not "=".
+
+ * mpn/generic/pre_mod_1.c: Add a comment about obsolescence.
+
+ * tune/time.c (MICROSECONDS_P): Don't trust time differences of 1
+ microsecond.
+
+ * tests/cxx/t-ostream.cc: Use "const char *" not just "char *" for
+ test data strings, avoids warnings on Sun CC.
+
+2002-02-27 Torbjorn Granlund <tege@swox.com>
+
+ * configure.in: For sparc under solaris2.[7-9], pass -fsimple=1 to
+ disable some crazy -fast optimizations.
+
+2002-02-25 Torbjorn Granlund <tege@swox.com>
+
+ * configure.in: For sparc under solaris2.[7-9], pass -fns=no to enable
+ denorm handling under -fast.
+
+2002-02-25 Kevin Ryde <kevin@swox.se>
+
+ * configure.in (alpha*-*-*): Rearrange -mcpu selection for gcc,
+ provide an ev67 -> ev6 fallback. Fix -arch,-tune selection for DEC C.
+ Allow ~ for space in optional options lists.
+
+ * tune/tuneup.c (tune_preinv_divrem_1): Compare against an assembler
+ mpn_divrem_1 if it exists, not the generic C mpn_divrem_1_div.
+ (tune_preinv_mod_1): Ditto with mpn_mod_1.
+
+ * tune/time.c (DIFF_SECS_ROUTINE): Eliminate the unused "type"
+ parameter, try to make the code a bit clearer.
+
+ * tune/freq.c: Reduce the period measured for cycles versus
+ gettimeofday, add cycles versus microsecond getrusage.
+
+ * mpz/array_init.c: "i" should be mp_size_t, noticed by E. Khong.
+
+2002-02-24 Torbjorn Granlund <tege@swox.com>
+
+ * configure.in: For sparc under solaris2.[7-9], pass -fast instead of
+ other optimization options.
+
+2002-02-23 Kevin Ryde <kevin@swox.se>
+
+ * mpn/asm-defs.m4 (GMP_NUMB_MASK): New macro.
+ (PROLOGUE, EPILOGUE): Relax quoting for the benefit of tune/many.pl
+ when GSYM_PREFIX non-empty.
+
+ * tune/time.c, tune/speed.h (speed_time_init): Include clock tick
+ period in speed_time_string.
+ * tune/time.c, configure.in (clock_gettime): New measuring method.
+
+ * tune/many.pl: Add -DHAVE_NATIVE_mpn_foo to C objects, to avoid
+ conflicts with a macro version in gmp-impl.h, eg. mpn_com_n.
+
+2002-02-22 Torbjorn Granlund <tege@swox.com>
+
+ * demos/pexpr.c: Increase RLIMIT_STACK to 4Mibyte.
+
+2002-02-22 Kevin Ryde <kevin@swox.se>
+
+ * tune/tuneup.c: Don't confuse gcc with mipspro cc in diagnostic.
+
+2002-02-20 Torbjorn Granlund <tege@swox.com>
+
+ * configure.in (mips*-*-irix[6789]*]): Set `extra_functions_n32', not
+ `extra_functions'.
+
+ * printf/doprnt.c: Conditionally include inttypes.h.
+ * printf/repl-vsnprintf.c: Likewise.
+ * scanf/doscan.c: Likewise.
+
+2002-02-20 Kevin Ryde <kevin@swox.se>
+
+ * mpn/x86/k7/mmx/com_n.asm: New file.
+
+ * mpz/n_pow_ui.c (SWAP_RP_TP): Use ASSERT_CODE on ralloc and talloc,
+ to ensure they needn't live past the initial allocs in a normal build.
+
+ * mpn/generic/mod_34lsub1.c: Note this is for internal use.
+
+2002-02-19 Torbjorn Granlund <tege@swox.com>
+
+ * Clean up *_THRESHOLD names. Many files affected.
+
+ * mpn/mips32: Asm-ify 32-bit mips code.
+ Move files from `mips2' to `mips32' directory.
+ * mpn/mips64: Move files from `mips3' to `mips64' directory.
+ * configure.in: Change `mips2' => `mips32' and `mips3' => `mips64'.
+
+2002-02-19 Kevin Ryde <kevin@swox.se>
+
+ * acinclude.m4, configure.in (GMP_PROG_LEX): New macro.
+
+ * tune/tuneup.c (one): Start next threshold at a max of previous ones,
+ in order to get a good starting point for TOOM3_SQR_THRESHOLD if
+ KARATSUBA_SQR_THRESHOLD is 0 (ie. using mpn_mul_basecase only).
+
+ * configure.in, tune/tuneup.c (GMP_MPARAM_H_SUGGEST): New AC_DEFINE
+ replacing GMP_MPARAM_H_FILENAME. Suggest a new file in a cpu specific
+ subdirectory rather than mpn/generic.
+
+ * acinclude.m4 (POWERPC64_PATTERN): New macro.
+ * configure.in (powerpc*-*-*): Use it.
+ (powerpc*-*-*): Use umul in 32L and aix64.
+ (mips*-*-*): Use umul, 32 and 64 bit versions.
+
+2002-02-18 Torbjorn Granlund <tege@swox.com>
+
+ * longlong.h: Add basic x86-64 support.
+
+2002-02-17 Torbjorn Granlund <tege@swox.com>
+
+ * demos/pexpr.c: Support `-X' for upper case hex, make `-x' output
+ lower case hex.
+
+ * mpn/mips2/umul.s: Make it actually work.
+ * mpn/mips3/umul.asm: New file.
+
+ * mpn/mips2/gmp-mparam.h: New file.
+
+2002-02-16 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/generic/get_str.c (mpn_sb_get_str): Round frac upwards after
+ umul_ppmm calls.
+
+2002-02-16 Kevin Ryde <kevin@swox.se>
+
+ * config.guess (alpha-*-*): Do alpha exact cpu probes on any system,
+ and only if configfsf.guess gives a plain "alpha".
+
+ * acinclude.m4 (GMP_PROG_CC_WORKS): Detect a gcc 3.0.3 powerpc64
+ linker invocation problem.
+
+2002-02-15 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/generic/get_str.c (mpn_sb_get_str): For base 10, develop initial
+ digits using umul_ppmm, then switch to plain multiplication.
+
+ * config.guess: Rewrite Alpha subtype detection code for *bsd systems.
+
+2002-02-15 Kevin Ryde <kevin@swox.se>
+
+ * gmp.texi (Build Options): Note powerpc exact cpu types.
+ (Debugging): Advertise DEBUG in memory.c.
+
+ * config.sub, config.guess: Add some powerpc exact cpus.
+ * configure.in: Add configs for them.
+
+ * memory.c [__NeXT__]: Remove unused #define of "static".
+ (__gmp_default_allocate, __gmp_default_reallocate): Print size if
+ allocation fails, don't use perror.
+
+ * gmp-h.in: g++ 3 demands __GMP_NOTHROW is before other attributes.
+
+2002-02-14 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/alpha/mul_1.asm: Fix typo preventing build on T3E systems.
+
+2002-02-14 Kevin Ryde <kevin@swox.se>
+
+ * tune/tuneup.c (tune_set_str): Increase max_size, for the benefit of
+ alpha.
+
+ * macos/README: Bug reports to bug-gmp@gnu.org, clarify MacOS X a bit.
+
+ * mpn/generic/gcdext.c [WANT_GCDEXT_ONE_STEP]: Add missing TMP_FREE.
+
+ * tune/speed.c, tune/tuneup.c: Allow for speed_cycletime of 0.0 in
+ some diagnostic printouts.
+ * tune/time.c (speed_cycletime): Note can be 0.0.
+
+2002-02-12 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/alpha/mul_1.asm: Add mpn_mul_1c entry.
+
+ * mpn/pa64w/sqr_diagonal.asm: Use L() for labels.
+
+2002-02-11 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/generic/get_str.c (mpn_sb_get_str): Change declaration of rp to
+ accommodate tuneup compiles.
+
+2002-02-11 Kevin Ryde <kevin@swox.se>
+
+ * mpn/alpha/default.m4, mpn/alpha/unicos.m4 (PROLOGUE_cpu): Add
+ noalign option.
+ * mpn/alpha/default.m4 (PROLOGUE_cpu): use ALIGN instead of ".align".
+
+ * gmp.texi (Debugging): Notes on Checker.
+ (Other Multiplication): Move note on float FFTs to here.
+ (Assembler Floating Point): New text and revisions by Torbjorn,
+ picture formatting by me.
+ Simplify tex pictures elsewhere a bit, share heights, eliminate some
+ gaps at line joins.
+
+2002-02-11 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/generic/get_str.c (mpn_sb_get_str): Rewrite to generate fraction
+ limbs and use multiplication for digit development. Trim allocation of
+ buf. Get rid of code for !USE_MULTILIMB.
+
+2002-02-10 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/generic/set_str.c (mpn_set_str): Undo this:
+ Change invocations of mpn_add_1 to instead use mpn_incr_u.
+
+ * tests/mpz/convert.c: Free str only after it is used in error message.
+
+ * mpn/generic/get_str.c (mpn_sb_get_str): Combine tail code for base 10
+ and generic bases.
+
+ * mpn/mp_bases.c: Add entries for base 256. Remove __ prefix from
+ table name.
+ * gmp-impl.h (__mp_bases): Remove superfluous mp_ part of name, making
+ it __gmpn_bases instead of __gmpn_mp_bases.
+ (mp_bases): New #define.
+ * tune/speed.h (SPEED_ROUTINE_MPN_SET_STR): Allow bases up to 256.
+ (SPEED_ROUTINE_MPN_GET_STR): Likewise.
+
+2002-02-09 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/generic/set_str.c (mpn_set_str): Use mpn_mul_1c if available.
+ Change invocations of mpn_add_1 to instead use mpn_incr_u.
+
+2002-02-09 Kevin Ryde <kevin@swox.se>
+
+ * mpz/array_init.c, mpz/cfdiv_q_2exp.c, mpz/cfdiv_r_2exp.c,
+ mpz/cong_2exp.c, mpz/divis_2exp.c, mpz/hamdist.c, mpz/init2.c,
+ mpz/mul_2exp.c, mpz/realloc2.c, mpz/scan0.c, mpz/scan1.c,
+ mpz/setbit.c, mpz/tdiv_q_2exp.c, mpz/tdiv_r_2exp.c, mpz/tstbit.c,
+ mpz/urandomb.c: Use GMP_NUMB_BITS.
+
+ * mpz/iset_str.c [__CHECKER__]: Store a dummy value to the low limb to
+ stop it appearing uninitialized.
+
+ * gmp-h.in (__GMP_NOTHROW): New macro.
+ (mp_set_memory_functions, mpz_cmp, mpz_cmp_si, mpz_cmp_ui, mpz_cmpabs,
+ mpz_cmpabs_ui, mpz_congruent_2exp_p, mpz_divisible_2exp_p,
+ mpz_fits_sint_p, mpz_fits_slong_p, mpz_fits_sshort_p, mpz_fits_uint_p,
+ mpz_fits_ulong_p, mpz_fits_ushort_p, mpz_get_si, mpz_get_ui,
+ mpz_getlimbn, mpz_hamdist, mpz_popcount, mpz_scan0, mpz_scan1,
+ mpz_size, mpz_sizeinbase, mpz_swap, mpz_tstbit, mpq_equal, mpq_swap,
+ mpf_cmp, mpf_cmp_si, mpf_cmp_ui, mpf_fits_sint_p, mpf_fits_slong_p,
+ mpf_fits_sshort_p, mpf_fits_uint_p, mpf_fits_ulong_p,
+ mpf_fits_ushort_p, mpf_get_default_prec, mpf_get_prec, mpf_get_si,
+ mpf_get_ui, mpf_integer_p, mpf_set_default_prec, mpf_set_prec_raw,
+ mpf_size, mpf_swap, mpn_add_1, mpn_cmp, mpn_hamdist, mpn_popcount,
+ mpn_sub_1): Use it.
+
+ * gmp-impl.h (MPN_SIZEINBASE, MPN_SIZEINBASE_16): New macros from
+ mpn_sizeinbase, and use GMP_NUMB_BITS.
+ * mpz/get_str.c, mpz/sizeinbase.c, mpbsd/mout.c, tune/speed.h: Use
+ MPN_SIZEINBASE.
+ * mpbsd/mtox.c: Use MPN_SIZEINBASE_16.
+
+ * configure.in, mpn/Makefile.am, gmp-impl.h (mpn_sizeinbase): Remove.
+ * mpn/generic/sizeinbase.c: Remove file.
+
+ * gmp-impl.h (MPN_GET_STR_SIZE): Remove.
+ * tests/mpn/t-g_str_size.c: Remove file.
+ * tests/mpn/Makefile.am: Update.
+
+ * Makefile.am (dist-hook): Don't distribute cvs merge ".#" files.
+
+2002-02-08 Torbjorn Granlund <tege@swox.com>
+
+ * configure.in: Override extra_functions for all sparcv8 systems, not
+ just supersparc.
+
+2002-02-06 Kevin Ryde <kevin@swox.se>
+
+ * tune/tuneup.c (tune_mul, tune_sqr): Disable FFTs until tuned.
+ * tune/speed.h (SPEED_ROUTINE_MPN_SET_STR): Fix memory clobber in
+ destination cache priming.
+
+ * printf/doprnt.c: Fix parsing of %s and %p conversions.
+ * tests/misc/t-printf.c (check_misc): Add some tests.
+
+2002-02-03 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/sparc32/v8/udiv.asm: New file, from v8/supersparc.
+
+ * mpn/generic/set_str.c: Rename indigits_per_limb => chars_per_limb.
+ Remove redundant chars_per_limb. Reverse 4 loops in basecase code for
+ speed. Use MP_BASES_CHARS_PER_LIMB_10.
+
+2002-02-03 Kevin Ryde <kevin@swox.se>
+
+ * acinclude.m4 (GMP_PROG_NM): Ensure -B or -p get used when doing a
+ cross compile with the native nm, helps OSF for instance.
+ (GMP_ASM_LSYM_PREFIX): Remove ".byte 0" for the benefit of irix 6,
+ allow "N" from nm for OSF, allow for "t" for other systems, but prefer
+ no mention of the symbol at all.
+
+ * tune/tuneup.c (print_define_remark): New function.
+ Turn some "#if"s into plain "if"s.
+
+ * tune/tuneup.c, gmp-impl.h, tune/Makefile.am
+ (GET_STR_BASECASE_THRESHOLD, GET_STR_PRECOMPUTE_THRESHOLD): Tune these.
+ * mpn/generic/get_str.c [TUNE_PROGRAM_BUILD]: Cope with non-constant
+ GET_STR_PRECOMPUTE_THRESHOLD.
+
+2002-02-02 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/generic/get_str.c (mpn_get_str): Fix typo in a declaration.
+
+2002-02-02 Kevin Ryde <kevin@swox.se>
+
+ * mpn/generic/set_str.c: Use MP_PTR_SWAP and POW2_P, add __GMP_PROTO
+ to convert_blocks prototype, disable SET_STR_BLOCK_SIZE sanity check.
+
+ * tune/set_strb.c, tune/set_strs.c: New files.
+ * tune/speed.h, tune/speed.c, tune/common.c,tune/Makefile.am: Add them.
+ * tune/tuneup.c: Tune SET_STR_THRESHOLD.
+ (DEFAULT_MAX_SIZE): Renamed from MAX_SIZE, allow any param.max_size[].
+
+2002-02-01 Torbjorn Granlund <tege@swox.com>
+
+ * tests/mpz/convert.c: Increase operand size. Add (yet disabled) code
+ for testing with random strings.
+
+ * mpn/generic/get_str.c (mpn_get_str): Rewrite to become sub-quadratic.
+ (mpn_dc_get_str, mpn_sb_get_str): New functions.
+
+2002-01-31 Kevin Ryde <kevin@swox.se>
+
+ * gmpxx.h (cmp): Renamed from "compare".
+
+ * configure.in (AC_C_BIGENDIAN): Don't abort when cross compiling.
+ (PROLOGUE): Allow new style optional second parameter when grepping.
+
+ * acinclude.m4 (GMP_HPC_HPPA_2_0, GMP_ASM_UNDERSCORE,
+ GMP_ASM_ALIGN_LOG, GMP_ASM_LSYM_PREFIX, GMP_ASM_W32, GMP_ASM_X86_MMX):
+ Use $ac_objext for object filenames.
+ (GMP_ASM_UNDERSCORE): Use CCAS to assemble.
+
+ * demos/pexpr-config-h.in: New file.
+ * configure.in: Generate demos/pexpr-config.h.
+ (AC_CHECK_FUNCS): Add clock, cputime, setrlimit, sigaction,
+ sigaltstack, sigstack.
+ * acinclude.m4 (GMP_SUBST_CHECK_FUNCS, GMP_SUBST_CHECK_HEADERS): New
+ macros.
+ * demos/pexpr.c: Use pexpr-config.h, not various #ifdefs.
+ (setup_error_handler): Use signal if sigaction not available, allow
+ for SIGBUS missing on mingw.
+ (main): Use time() for random seed if gettimeofday not available.
+ (cleanup_and_exit): Move SIGFPE out of LIMIT_RESOURCE_USAGE.
+
+2002-01-30 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/generic/set_str.c: Rewrite to become sub-quadratic.
+ (convert_blocks): New function.
+
+2002-01-30 Kevin Ryde <kevin@swox.se>
+
+ * gmp-impl.h (GMP_NUMB_MASK, GMP_NAIL_MASK, GMP_NUMB_HIGHBIT,
+ ASSERT_MPN, ASSERT_MP_LIMB_T): New macros.
+
+ * mpn/generic/fib2_ui.c: Use GMP_NUMB_BITS, simplify the data
+ generator program, share __gmp_fib_table initializers between bit
+ sizes, cope with bit sizes other than those specifically setup.
+ * gmp-impl.h (FIB_TABLE_LIMIT, FIB_TABLE_LUCNUM_LIMIT): Corresponding
+ rearrangement of conditionals.
+ * tests/mpz/t-fib_ui.c (check_fib_table): New test.
+
+2002-01-28 Kevin Ryde <kevin@swox.se>
+
+ * mpz/set_si.c, mpz/iset_si.c: Store to _mp_d[0] unconditionally, use
+ an expression for _mp_size.
+
+ * mpz/init.c, mpz/init2.c, mpz/iset.c, mpq/init.c [__CHECKER__]: Store
+ dummy values to low limbs to stop them appearing uninitialized.
+
+2002-01-26 Kevin Ryde <kevin@swox.se>
+
+ * mpfr/mpfr-test.h (MAX, MIN, ABS): Use instead a patch from Paul and
+ Vincent.
+
+2002-01-24 Kevin Ryde <kevin@swox.se>
+
+ * configure.in: Extra quoting to get argument help messages right.
+
+ * gmp.texi (Efficiency): Suggest hex or octal for input and output.
+ (Formatted Output Strings): Mention "*" for width and precision.
+
+ * mpn/generic/sizeinbase.c: New file, adapted from mpz/sizeinbase.c.
+ Use POW2_P, use __mp_bases[base].big_base for log2(base).
+ * configure.in, mpn/Makefile.am: Add it.
+ * gmp-impl.h: Add prototype.
+ * mpz/sizeinbase.c, tune/speed.h, mpn/generic/get_str.c,
+ mpz/get_str.c, mpbsd/mout.c, mpbsd/mtox.c: Use it.
+ * mpz/get_str.c: Write directly to user buffer, skip at most one
+ leading zero, eliminate special case for x==0.
+ * mpbsd/mtox.c: Allocate exact result space at the start, eliminate
+ special case for x==0.
+ * mpbsd/mout.c: Only need to skip one high zero with mpn_sizeinbase.
+
+ * configure.in (--enable-nails): New option.
+ (GMP_NAIL_BITS, GMP_LIMB_BITS, GMP_NUMB_BITS): New defines for gmp.h
+ and config.m4.
+ * gmp-h.in: Add templates.
+
+ * mpfr/mpfr-test.h (MAX, MIN, ABS): Use #ifndef to avoid a redefine
+ error on AIX xlc.
+
+2002-01-23 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/generic/get_str.c: Correct type of `out_len'.
+
+2002-01-22 Kevin Ryde <kevin@swox.se>
+
+ * mpn/generic/pre_divrem_1.c: Corrections to some ASSERTs.
+
+ * mpfr/mul_ui.c: Don't call mpn_lshift with 0 shift.
+
+ * mpfr/mpz_set_fr.c: Produce correct mpz_t for f==0.
+
+2002-01-21 Torbjorn Granlund <tege@swox.com>
+
+ * longlong.h (32-bit powerpc add_ssaaaa): Remove spurious commutative
+ declaration.
+ (64-bit powerpc add_ssaaaa): Likewise.
+
+2002-01-20 Kevin Ryde <kevin@swox.se>
+
+ * acinclude.m4 (GMP_FUNC_VSNPRINTF): Use %n to better detect sparc
+ solaris 2.7 problems.
+
+2002-01-19 Torbjorn Granlund <tege@swox.com>
+
+ * demos/pexpr.c (mpz_eval_expr): Optimize s^rhs for -1 <= s <= 1.
+ (cleanup_and_exit): Improve error message wording.
+
+2002-01-19 Kevin Ryde <kevin@swox.se>
+
+ * mpfr/mpfr.h (_PROTO): Use __GMP_PROTO, for compatibility with
+ gmp-impl.h.
+
+2002-01-17 Torbjorn Granlund <tege@swox.com>
+
+ * mpfr/mpfr-test.h: Test "__hpux", not "hpux". Mask off mrand48
+ return value to 31 bits to work around sloppy mpfr #include practices.
+
+ * mpfr/tests/*.c: Use #include "", not <>, for gmp.h and mpfr.h.
+ Make sure to #include mpfr-test.h from all files that use random().
+
+2002-01-17 Kevin Ryde <kevin@swox.se>
+
+ * gmp-impl.h (__GMP_REALLOCATE_FUNC_MAYBE_TYPE): New macro.
+ * gmp-impl.h, mpz/get_str.c, mpz/out_raw.c, mpq/get_str.c,
+ mpq/set_str.c, mpf/get_str.c, printf/asprntffuns.c, printf/doprnt.c,
+ printf/repl-vsnprintf.c, printf/snprntffuns.c, scanf/doscan.c,
+ mpbsd/mtox.c: Some fixes to compile as C++.
+
+ * mpn/generic/jacbase.c (JACOBI_BASE_METHOD): New tuned parameter,
+ replacing COUNT_TRAILING_ZEROS_TIME test. Add a third method too.
+ * tune/speed.c, tune/speed.h, tune/common.c, tune/Makefile.am: Add
+ measuring of mpn_jacobi_base methods.
+ * tune/jacbase1.c, tune/jacbase2.c, tune/jacbase3.c: New files.
+ * tune/tuneup.c (JACOBI_BASE_METHOD): Tune this.
+ * mpn/x86/*/gmp-mparam.h (COUNT_TRAILING_ZEROS_TIME): Remove macro.
+
+ * gmp-h.in: Use __gmp prefix on variables in inlines.
+
+ * gmp-impl.h (MPN_COPY_INCR, MPN_COPY_DECR): Remove __i, unused.
+
+ * mpn/generic/mul_fft.c: Use HAVE_NATIVE_mpn_addsub_n, not ADDSUB.
+ Use CNST_LIMB for some constants.
+
+2002-01-15 Kevin Ryde <kevin@swox.se>
+
+ * tests/mpbsd/Makefile.am: Add a convenience rule for ../libtests.la.
+
+ * printf/Makefile.am: libdummy.la should be in EXTRA_LTLIBRARIES.
+
+ * mpf/out_str.c: Use MPF_SIGNIFICANT_DIGITS, so mpf_out_str and
+ mpf_get_str give the same for ndigits==0.
+
+ * mpfr/exceptions.c (mpfr_set_emin, mpfr_set_emax): Work around a
+ powerpc64 gcc 3.0 -O2 bug.
+
+ * tests/memory.c, tests/tests.h (tests_memory_validate): New function.
+
+2002-01-14 Kevin Ryde <kevin@swox.se>
+
+ * mpn/generic/sb_divrem_mn.c, mpn/generic/divrem_1.c,
+ mpn/generic/divrem_2.c, mpn/generic/mod_1.c: Don't use UMUL_TIME and
+ UDIV_TIME, just default to preinv.
+ * gmp-impl.h (USE_PREINV_DIVREM_1, USE_PREINV_MOD_1): Ditto.
+ (DIVEXACT_1_THRESHOLD, MODEXACT_1_ODD_THRESHOLD): Don't use UMUL_TIME
+ and UDIV_TIME, make default thresholds 0.
+ (UDIV_NORM_PREINV_TIME, UDIV_UNNORM_PREINV_TIME): Remove macros.
+ * mpn/x86/*/gmp-mparam.h (UMUL_TIME, UDIV_TIME,
+ UDIV_NORM_PREINV_TIME): Remove macros.
+
+ * gmp.texi (Headers and Libraries): New section, being the header
+ notes from "GMP Basics" and some new stuff.
+ (Parameter Conventions): Notes on "const" parameters.
+ (Formatted Output Strings): Add type N, tweak some wording.
+
+ * tests/refmpn.c (refmpn_divmod_1c): Avoid a bug in i386 gcc 3.0.
+
+2002-01-12 Kevin Ryde <kevin@swox.se>
+
+ * mpz/root.c: Add <stdlib.h>, for abort().
+
+ * mpfr/tests/Makefile.am (AUTOMAKE_OPTIONS): Add ansi2knr.
+ * mpfr/mpfr.h, mpfr/mpfr-tests.h, reuse.c, tadd.c, tadd_ui.c, tagm.c,
+ tatan.c, tcmp2.c, tcos.c, tdiv.c, tdiv_ui.c, teq.c, texp.c,
+ tget_str.c, thyperbolic.c, tlog.c, tmul.c, tout_str.c, tpow.c,
+ trandom.c, tset_z.c, tsin.c, tsqrt.c, tsqrt_ui.c, tsub_ui.c, ttan.c,
+ tui_div.c: Fixes for K&R.
+
+ * tests/misc/t-scanf.c (check_misc, check_misc):
+
+ * tests/mpz/t-inp_str.c, tests/mpq/t-inp_str.c, tests/misc/t-scanf.c:
+ Avoid strings in ASSERT, not enjoyed by K&R.
+ * gmp-impl.h (ASSERT): Note this.
+
+ * tests/tests.h (refmpn_mod_34lsub1): Add __GMP_PROTO.
+
+ * mpbsd/Makefile.am: Avoid an automake problem with ansi2knr and
+ sources in a different directory.
+
+ * printf/repl-vsnprintf.c: Test HAVE_LONG_DOUBLE for long double.
+
+ * mpn/Makefile.am (nodist_libdummy_la_SOURCES): Add mod_34lsub1.c,
+ mul_2.c, pre_divrem_1.c.
+
+ * gmp-h.in, gmp-impl.h (mpn_add_nc, mpn_addmul_1c, mpn_addsub_n,
+ mpn_addsub_nc, mpn_divrem_1c, mpn_dump, mpn_mod_1c, mpn_mul_1c,
+ mpn_mul_basecase, mpn_sqr_n, mpn_sqr_basecase, mpn_sub_nc,
+ mpn_submul_1c): Move to gmp-impl.h, since they're undocumented.
+
+ * gmp-impl.h (mpn_reciprocal): Remove, unused.
+
+ * tune/many.pl (cntlz, cnttz): Use new SPEED_ROUTINE_COUNT_ZEROS.
+
+2002-01-11 Kevin Ryde <kevin@swox.se>
+
+ * mpn/hppa/*.asm, mpn/pa64/*.asm, mpn/pa64w/*.asm: Use L().
+
+2002-01-08 Kevin Ryde <kevin@swox.se>
+
+ * mpn/asm-defs.m4 (PROLOGUE, EPILOGUE): New scheme, optional function
+ name to EPILOGUE, check for missing or wrong function name EPILOGUE.
+ * mpn/alpha/unicos.m4, mpn/alpha/default.m4, mpn/m68k/m68k-defs.m4,
+ mpn/mips3/mips.m4, mpn/ia64/default.m4, mpn/powerpc32/aix.m4,
+ mpn/powerpc64/aix.m4, mpn/x86/x86-defs.m4: Consequent updates, add a
+ few more asserts.
+ * mpn/alpha/unicos.m4, mpn/alpha/default.m4, mpn/alpha/cntlz.asm,
+ mpn/alpha/invert_limb.asm (PROLOGUE_GP): Change to an optional "gp"
+ parameter on plain PROLOGUE.
+
+ * gmp.texi (Low-level Functions): mpn_get_str doesn't clobber an extra
+ limb, and doesn't clobber at all for power of 2 bases.
+ (Language Bindings): Add python gmpy.
+
+ * mpz/get_str.c: Determine realloc size arithmetically.
+
+ * mpbsd/mtox.c: Size memory block returned to actual space needed.
+ * gmp.texi (BSD Compatible Functions): Describe this.
+
+ * mpz/get_str.c: Don't copy mpn_get_str input for power of 2 bases.
+ * mpbsd/mtox.c: Ditto, and as a side effect avoid a memory leak from a
+ missing TMP_FREE.
+
+ * mpz/get_str.c, mpbsd/mout.c: No longer need for +1 limb for
+ mpn_get_str clobber.
+
+ * gmp-impl.h (MPN_GET_STR_SIZE): New macro.
+ * mpn/generic/get_str.c, mpz/get_str.c, mpbsd/mout.c, mpbsd/mtox.c,
+ tune/speed.h: Use it.
+ * tests/mpn/t-g_str_size.c: New test.
+ * tests/mpn/Makefile.am: Add it.
+
+ * gmp-impl.h (POW2_P): New macro.
+ * mpn/generic/get_str.c, tests/misc.c: Use it.
+
+ * printf/doprnt.c: Add "N" for mpn, share some code between N, Q and Z.
+ * tests/misc/t-printf.c: Add tests.
+ * gmp-impl.h (ASSERT_CODE): New macro.
+
+ * tests/mpbsd/t-mtox.c: New test.
+ * tests/mpbsd/Makefile.am: Add it.
+ (allfuns_LDADD): Don't link against libgmp when testing everything in
+ libmp can link.
+
+2002-01-07 Torbjorn Granlund <tege@swox.com>
+
+ * gmp-impl.h (MPN_COPY_INCR, MPN_COPY_DECR): Rewrite generic versions.
+
+2002-01-06 Kevin Ryde <kevin@swox.se>
+
+ * mpn/generic/pre_divrem_1.c: Don't support size==0.
+ * tests/devel/try.c: Update.
+
+ * mpn/generic/get_str.c: Add special case for base==10.
+ * gmp-impl.h (MP_BASES_CHARS_PER_LIMB_10, MP_BASES_BIG_BASE_10,
+ MP_BASES_BIG_BASE_INVERTED_10, MP_BASES_NORMALIZATION_STEPS_10): New
+ constants.
+ * tests/t-constants.c: Add checks.
+ * mpn/mp_bases.c [GENERATE_TABLE]: Print defines for gmp-impl.h, print
+ all standard bits-per-limb by default.
+
+ * demos/pexpr.c, demos/expr/expr.h, demos/expr/expr-impl.h: Use
+ __GMP_PROTO.
+
+ * gmp-h.in (mpn_divexact_by3c): Remove variables from prototype, to
+ keep out of application namespace.
+
+2002-01-04 Torbjorn Granlund <tege@swox.com>
+
+ * gmp-impl.h: Move _PROTO declaration to before its first usages.
+
+2002-01-04 Kevin Ryde <kevin@swox.se>
+
+ * gmp-h.in, mp-h.in, tests/tests.h: Rename _PROTO to __GMP_PROTO, and
+ don't use #ifndef just define it ourselves.
+ * gmp-impl.h: Provide _PROTO as an alias for __GMP_PROTO, to avoid big
+ edits internally, for the moment.
+
+2002-01-03 Torbjorn Granlund <tege@swox.com>
+
+ * tune/speed.c (usage): Insert "\n\" into a string.
+
+2001-12-30 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/pa64/udiv_qrnnd.c: Remove file.
+ * mpn/pa64w/udiv_qrnnd.c: Remove file.
+
+ * gmp-impl.h (MPN_IORD_U): Change formatting (labels in pos 0, insns
+ indented by tab).
+ (MPN_INCR_U): Use "addl $1,foo; jc", not "incl foo; jz".
+
+ * gmp-impl.h (udiv_qrnnd_preinv): Use plain subtract, not sub_ddmmss,
+ in one more case.
+
+2001-12-30 Kevin Ryde <kevin@swox.se>
+
+ * mpn/generic/get_str.c (udiv_qrnd_unnorm): New macro.
+ Use "do while" for dig_per_u loop since it's non-zero.
+ * acconfig.h (HAVE_HOST_CPU_m68k etc): Add templates.
+
+ * mpn/generic/mul_basecase.c, mpz/mul.c, mpz/n_pow_ui.c,
+ mpn/x86/pentium/mul_2.asm, tests/devel/try.c, tests/tests.h,
+ tests/refmpn.c, tune/speed.c, tune/speed.h, tune/common.c,
+ tune/many.pl (mpn_mul_2): New parameter style.
+ * gmp-impl.h (mpn_mul_2): Add prototype.
+ * configure.in (gmp_mpn_functions_optional): Add mul_2.
+
+ * longlong.h (__vxworks__): Remove from powerpc tests, not correct,
+ not on its own at least.
+
+ * tune/speed.c: Add "aas" to specify 0xAA..AA data.
+
+ * tune/tuneup.c (print_define_end): Indicate "never" and "always".
+
+2001-12-29 Torbjorn Granlund <tege@swox.com>
+
+ * mpq/set_d.c: ANSI-fy.
+ * mpz/invert.c: Use PTR and SIZ (cosmetic change).
+
+ * mpz/cong.c: Rename `xor' to `sign' to avoid C++ reserved word.
+
+2001-12-28 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/sparc64/sqr_diagonal.asm: New file.
+
+2001-12-28 Kevin Ryde <kevin@swox.se>
+
+ * mpn/generic/get_str.c: Avoid one mpn_divrem_1 by running main loop
+ only until msize==1.
+
+ * tune/tuneup.c: Break up all() for clarity.
+ (USE_PREINV_DIVREM_1, USE_PREINV_MOD_1): Compare against plain
+ division udiv_qrnnd, not the tuned and possibly preinv version.
+
+ * tune/freq.c: Split sysctl and sysctlbyname probes into separate
+ functions, shorten some identifiers, put descriptions inside
+ functions, define functions unconditionally and do nothing if
+ requisites not available.
+
+ * mpz/inp_raw.c: Avoid a gcc 3.0 powerpc64 bug on AIX.
+
+ * acinclude.m4, configure.in (GMP_C_RESTRICT): New macro.
+
+ * mpfr/sin.c: Patch from Paul to fix sign of sin(3pi/2).
+
+ * demos/calc/calc.y: Improve some error messages.
+
+2001-12-28 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/sparc64/mul_1.asm: Rename r72 -> r80.
+ * mpn/sparc64/addmul_1.asm: Likewise.
+
+2001-12-27 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/generic/tdiv_qr.c: Misc formatting cleanups.
+ For switch case 2, replace `dn' with its value (2).
+
+2001-12-25 Torbjorn Granlund <tege@swox.com>
+
+ * tests/devel/mul_1.c: Add FIXED_XLIMB.
+ * tests/devel/addmul_1.c: Likewise.
+ * tests/devel/submul_1.c: Likewise.
+
+ * tests/devel/add_n.c: Improve error message.
+ Accept command line argument for # of tests.
+ * tests/devel/sub_n.c: Likewise.
+
+ * tests/devel/: Remove CLOCK settings.
+
+ * mpn/sparc32/v9/mul_1.asm: Rewrite.
+ * mpn/sparc32/v9/addmul_1.asm: Rewrite.
+ * mpn/sparc32/v9/submul_1.asm: Rewrite.
+
+2001-12-24 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/sparc64/mul_1.asm: Get rid of global constant 0.0 (L(noll)).
+ * mpn/sparc64/addmul_1.asm: Likewise.
+
+2001-12-23 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/generic/get_str.c: Move final ASSERT to just before zero fill
+ loop.
+
+2001-12-22 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/generic/get_str.c: Move ASSERTs out of loops. Split digit
+ generation code into two loops, saving a test of msize in the loop.
+
+2001-12-22 Kevin Ryde <kevin@swox.se>
+
+ * mpn/x86/x86-defs.m4, mpn/x86/*/*.asm: Remove L / LF scheme putting
+ function name in local labels.
+
+ * mpn/generic/get_str.c: Use mpn_preinv_divrem_1, add a couple of
+ ASSERTs.
+
+ * mpn/generic/pre_divrem_1.c: New file.
+ * configure.in (gmp_mpn_functions): Add it.
+ * gmp-impl.h (mpn_preinv_divrem_1): Add prototype.
+ (USE_PREINV_DIVREM_1, MPN_DIVREM_OR_PREINV_DIVREM_1): New macros.
+ * tests/devel/try.c, tune/speed.c, tune/speed.h, tune/common.c,
+ tune/many.pl, tune/Makefile.am (mpn_preinv_divrem_1): Add testing and
+ measuring.
+ * tune/tuneup.c: Determine USE_PREINV_DIVREM_1.
+ * tune/pre_divrem_1.c: New file.
+ * tests/refmpn.c, tests/tests.h (refmpn_preinv_divrem_1): New function.
+
+ * tests/mpz/t-io_raw.c: New file.
+ * tests/mpz/Makefile.am (check_PROGRAMS): Add it.
+
+ * mpz/inp_raw.c, mpz/out_raw.c: Rewrite.
+ * acinclude.m4, configure.in (AC_C_BIGENDIAN): New test.
+ * gmp-impl.h (BSWAP_LIMB): New macro.
+
+ * acinclude.m4 (GMP_PROG_CC_WORKS): For a native compile, demand
+ executables will run, per AC_PROG_CC. This detects ABI=64 is unusable
+ in a native sparc solaris 7 build with the kernel in 32-bit mode.
+ * gmp.texi (ABI and ISA): Add notes on this, add an example configure
+ setting an ABI.
+
+ * tune/tuneup.c, configure.in: Print the gmp-mparam.h filename.
+ * tune/tuneup.c: Print the CPU frequency.
+
+ * tune/time.c, tune/speed.h: Add s390 "stck" method, flatten
+ conditionals in speed_time_init a bit, use have_* variables to let
+ some code go dead in speed_starttime and speed_endtime.
+
+ * tune/freq.c (speed_cpu_frequency_irix_hinv): New function.
+
+ * Makefile.am, configure.in: Restore mpfr.
+
+ * configure.in: Add --with-readline, AC_PROG_YACC and AM_PROG_LEX.
+ * demos/calc/calc.y, demos/calc/calclex.l: Add readline support, add
+ lucnum function.
+ * demos/calc/Makefile.am: Add calcread.c, calc-common.h, use $(YACC),
+ $(LEX) and $(LEXLIB).
+ * demos/calc/calcread.c, demos/calc/calc-common.h,
+ demos/calc/calc-config-h.in, demos/calc/README: New files.
+
+ * configure.in: Put demos/expr configs in expr-config.h.
+ * demos/expr/expr-config-h.in: New file.
+ * demos/expr/expr-impl.h: Renamed from expr-impl-h.in, get configs
+ from expr-config.h.
+ * demos/expr/Makefile.am: Update.
+
+ * demos/expr/exprfr.c: Use mpfr_sin and mpfr_cos, remove some spurious
+ returns.
+
+2001-12-20 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/sparc64/mul_1.asm: Trim an instruction.
+ * mpn/sparc64/addmul_1.asm: Likewise.
+
+ * mpn/ia64/add_n.asm: Rewrite.
+ * mpn/ia64/sub_n.asm: Rewrite.
+
+2001-12-19 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/ia64/mul_1.asm: Rewrite.
+ * mpn/ia64/addmul_1.asm: Rewrite.
+ * mpn/ia64/submul_1.c: Use TMP_ALLOC_LIMBS.
+
+ * tests/devel/mul_1.c: Improve error message.
+ Accept command line argument for # of tests.
+ * tests/devel/addmul_1.c: Likewise.
+ * tests/devel/submul_1.c: Likewise.
+
+2001-12-18 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/mips3/mul_1.asm: Add NOPs to save a cycle on R1x000.
+
+2001-12-18 Kevin Ryde <kevin@swox.se>
+
+ * gmpxx.h (gmp_randclass): Don't allow copy constructors or "=",
+ implementation by Gerardo.
+
+ * gmp-h.in (operator<<, operator>>): Remove parameter names from
+ prototypes, to keep out of user namespace.
+
+ * acinclude.m4 (GMP_FUNC_VSNPRINTF): Let the test program work as C++.
+
+2001-12-16 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/sparc64/mul_1.asm: Rewrite.
+ * mpn/sparc64/addmul_1.asm: Rewrite.
+ * mpn/sparc64/submul_1.asm: Rewrite.
+
+ * mpn/sparc64/addmul1h.asm: Remove.
+ * mpn/sparc64/submul1h.asm: Remove.
+ * mpn/sparc64/mul1h.asm: Remove.
+
+2001-12-15 Kevin Ryde <kevin@swox.se>
+
+ * gmp-h.in (mpn_add, mpn_add_1, mpn_cmp, mpn_sub, mpn_sub_1): Follow
+ __GMP_INLINE_PROTOTYPES for whether to give prototype with inline.
+
+ * configure.in (i686*-*-*, pentiumpro-*-*, pentium[23]-*-*,
+ athlon-*-*, pentium4-*-*): Fall back on -march=pentium if
+ -march=pentiumpro or higher is not good (eg. solaris cmov).
+
+2001-12-12 Torbjorn Granlund <tege@swox.com>
+
+ * gmp-impl.h (MPN_ZERO): Rewrite generic version to be similar to
+ powerpc version.
+
+2001-12-12 Kevin Ryde <kevin@swox.se>
+
+ * acinclude.m4 (GMP_PROG_CC_WORKS): Detect cmov problems with gcc
+ -march=pentiumpro on solaris 2.8.
+
+ * tune/common.c, tune/speed.h: Allow for commas in count_leading_zeros
+ and count_trailing_zeros macros.
+
+ * demos/expr/Makefile.am: Distribute exprfr.c and exprfra.c.
+
+ * tune/Makefile.am (speed_ext_SOURCES): Should be speed-ext.c.
+
+2001-12-10 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/s390/addmul_1.asm: New file.
+ * mpn/s390/submul_1.asm: New file.
+ * mpn/s390/mul_1.asm: New file.
+ * mpn/s390/gmp-mparam.h: Update.
+
+2001-12-07 Kevin Ryde <kevin@swox.se>
+
+ * gmp-h.in, mp-h.in, gmp-impl.h: __GMP_DECLSPEC at start of
+ prototypes, for the benefit of Microsoft C.
+
+ * gmp.texi (Introduction to GMP): Mention ABI and ISA section.
+ (Known Build Problems): Recommend GNU sed on solaris 2.6.
+ (Assigning Integers): Direct feedback to bug-gmp.
+ (References): Typo Knuth vol 2 is from 1998.
+
+ * gmpxx.h (gmp_randclass): Add initializers for gmp_randinit_default
+ and gmp_randinit_lc_2exp_size.
+ gmp.texi (C++ Interface Random Numbers): Describe them.
+
+ * tests/misc/t-locale.c, tests/cxx/t-locale.cc: Ensure mpf_clear is
+ done when the localconv override doesn't work. Reported by Mike
+ Jetzer.
+
+ * printf/doprnti.c: Don't showbase on a zero mpq denominator.
+ * tests/misc/t-printf.c, tests/cxx/t-ostream.c: Add test cases.
+
+2001-12-04 Kevin Ryde <kevin@swox.se>
+
+ * gmp.texi (Known Build Problems): Update to gmp_randinit_lc_2exp_size
+ for the sparc solaris 2.7 problem.
+ (Reentrancy): SCO ctype.h affects all text-based input functions.
+ (Formatted Output Strings): Correction to the mpf example.
+ (Single Limb Division): Correction, should be q-1 not q+1.
+ (Extended GCD): Clarify why single-limb is inferior.
+ (Raw Output Internals): Clarify size is twos complement, note limb
+ order means _mp_d doesn't get directly read or written.
+ (Contributors): Clarify mpz_jacobi.
+ And a couple of formatting tweaks elsewhere.
+
+ * tests/cxx/t-headers.cc: New file.
+ * tests/cxx/Makefile.am: Add it.
+
+ * gmpxx.h: Add <strstream>, needed by mpf_class::get_str2.
+
+ * gmp-h.in (mpq_inp_str, mpn_hamdist): Add __GMP_DECLSPEC.
+
+2001-12-01 Torbjorn Granlund <tege@swox.com>
+
+ * Version 4.0 released.
+
+ * mpfr/README: Replace contents with explanation of why mpfr is gone.
+
+2001-12-01 Kevin Ryde <kevin@swox.se>
+
+ * Makefile.am, configure.in: Temporarily remove mpfr, just leave a
+ README.
+
+ * mpn/Makefile.am (EXTRA_DIST): Add Makeasm.am.
+
+2001-11-30 Gerardo Ballabio <ballabio@sissa.it>
+
+ * tests/cxx/t-constr.cc, tests/cxx/t-expr.cc: New files.
+ * tests/cxx/Makefile.am (check_PROGRAMS): Add them.
+
+2001-11-30 Kevin Ryde <kevin@swox.se>
+
+ * mpfr: Update to 2001-11-16. Patch TMP handling of agm.c and sqrt.c,
+ use plain mpn_sqrtrem in sqrt.c, separate .c files for floor and ceil,
+ disable an expression style assert in add1.c.
+
+ * mpn/s370: Rename to s390.
+ * configure.in (s3[6-9]0*-*-*): Update.
+ * mpn/Makefile.am (TARG_DIST): Add s390.
+
+ * mpz/fits_s.c, mpf/fits_s.c, mpf/fits_u.c: Remove files, unused since
+ change to .h style.
+
+2001-11-29 Torbjorn Granlund <tege@swox.com>
+
+ * gmp-h.in: Declare mpz_get_d_2exp and mpf_get_d_2exp.
+ * Makefile.am: Add mpz/get_d_2exp$U.lo and mpf/get_d_2exp$U.lo.
+ * mpf/Makefile.am: Add get_d_2exp.c.
+ * mpz/Makefile.am: Add get_d_2exp.c.
+
+2001-11-29 Kevin Ryde <kevin@swox.se>
+
+ * mpn/*/gmp-mparam.h: Update measured thresholds.
+ * mpn/s370/gmp-mparam.h: New file.
+
+ * mpz/millerrabin.c: Mark for internal use only, for now.
+ * gmp.texi (Number Theoretic Functions): Remove documentation.
+
+2001-11-28 Torbjorn Granlund <tege@swox.com>
+
+ * mpf/get_d_2exp.c: New file.
+ * mpz/get_d_2exp.c: New file.
+
+ * mpz/realloc2.c: Fix typo. Make more similar to mpz_realloc.
+ * mpz/realloc.c: Use __GMP_REALLOCATE_FUNC_LIMBS.
+
+2001-11-27 Gerardo Ballabio <ballabio@sissa.it>
+
+ * gmpxx.h, mpfrxx.h: Various updates and improvements.
+
+2001-11-27 Kevin Ryde <kevin@swox.se>
+
+ * gmp.texi (Useful Macros and Constants): Add gmp_version, add @findex
+ for mp_bits_per_limb.
+
+ * demos/perl/GMP.pm, demos/perl/GMP.xs: Use new style gmp_randinit's.
+ * demos/perl/test.pl: Update for this, and for mpz_perfect_power_p
+ handling of 0 and 1.
+
+2001-11-26 Torbjorn Granlund <tege@swox.com>
+
+ * mpz/realloc.c: Clear variable when decreasing allocation to less than
+ needed. Misc updates.
+
+2001-11-25 Kevin Ryde <kevin@swox.se>
+
+ * tests/misc/t-locale.c: Avoid printf in the normal case, since the
+ replacement localeconv breaks it on SunOS 4.
+
+ * gmp.texi (Build Options, Notes for Package Builds): Note libgmpxx
+ depends on libgmp from same GMP version.
+
+ * acinclude.m4, configure.in (GMP_FUNC_SSCANF_WRITABLE_INPUT): New
+ test.
+ * scanf/sscanf.c, scanf/vsscanf.c: Use it to ensure sscanf input is
+ writable, if necessary.
+
+ * tests/misc/t-scanf.c: Ensure sscanf arguments are writable, always.
+ * configure.in (AC_CHECK_DECLS): Remove sscanf, no longer required.
+
+ * configure.in (none-*-*): Fix default CFLAGS setups.
+
+ * doc/configuration: Misc updates.
+
+2001-11-23 Kevin Ryde <kevin@swox.se>
+
+ * mpz/init2.c, mpz/realloc2.c: New files.
+ * Makefile.am, mpz/Makefile.am: Add them.
+ * gmp-h.in: Add prototypes.
+ * gmp.texi (Efficiency): Mention these instead of _mpz_realloc.
+ (Initializing Integers): Add documentation, reword other parts.
+
+2001-11-22 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/cray/ieee/addmul_1.c: Fix logic for more_carries scalar loop.
+ * mpn/cray/ieee/submul_1.c: Likewise.
+
+2001-11-20 Kevin Ryde <kevin@swox.se>
+
+ * gmp.texi (Known Build Problems): Note an out of memory on DJGPP.
+ (Function Classes): Update function counts.
+ Misc tweaks elsewhere.
+
+ * configure.in (AC_CHECK_DECLS): Add sscanf.
+ * tests/misc/t-scanf.c: Use it, for the benefit of SunOS 4.
+
+ * tal-debug.c, gmp-impl.h: More checks of TMP_DECL/TMP_MARK/TMP_FREE
+ consistency.
+
+ * mpfr/Makefile.am (AR): Explicit AR=@AR@ to override automake
+ default, necessary for powerpc64 ABI=aix64.
+
+2001-11-18 Torbjorn Granlund <tege@swox.com>
+
+ * mpz/powm.c: Move TMP_MARK to before any TMP_ALLOCs.
+
+2001-11-18 Kevin Ryde <kevin@swox.se>
+
+ * configure.in (--enable-fft): Make this the default.
+ * gmp.texi (Build Options): Update.
+
+ * Makefile.am (libmp_la_DEPENDENCIES): Revise mpz objects needed by
+ new mpz/powm.c.
+
+ * gmp.texi (Random State Initialization): Add gmp_randinit_default and
+ gmp_randinit_lc_2exp_size, mark gmp_randinit as obsolete.
+ (Random State Seeding): New section, taken from "Random State
+ Initialization" and "Random Number Functions".
+
+ * configure.in (AC_CHECK_DECLS): Add fgetc, fscanf, ungetc.
+ * scanf/fscanffuns.c: Use these, for the benefit of SunOS 4.
+
+ * gmp-impl.h, gmp-h.in (__gmp_default_fp_limb_precision): Move back to
+ gmp-impl.h now not required for inlined mpf.
+
+ * randlc2s.c (gmp_randinit_lc_2exp_size): New file, the size-based LC
+ selection from rand.c.
+ * rand.c (gmp_randinit): Use it.
+ * randdef.c (gmp_randinit_default): New file.
+ * gmp-impl.h (RANDS): Use it.
+ (ASSERT_CARRY): New macro.
+ * gmp-h.in (gmp_randinit_default, gmp_randinit_lc_2exp_size: Add
+ prototypes.
+ * Makefile.am (libgmp_la_SOURCES): Add randdef.c and randlc2s.c.
+
+ * printf/asprntffuns.c: Include config.h before using its defines.
+
+ * gmp-impl.h: Move C++ <string> to top of file to avoid the memset
+ redefine upsetting configure tests. Remove <iostream> since <iosfwd>
+ in gmp.h suffices.
+
+2001-11-16 Kevin Ryde <kevin@swox.se>
+
+ * gmp.texi (Integer Exponentiation): mpz_powm supports negative
+ exponents.
+ (Assigning Floats, I/O of Floats, C++ Formatted Output, C++ Formatted
+ Input): Decimal point follows locale.
+ (Formatted Output Strings): %n accepts any type.
+ (Formatted Input Strings): New section.
+ (Formatted Input Functions): New section.
+ (C++ Class Interface): Corrections and clarifications suggested by
+ Gerardo.
+
+ * scanf/doscan.c, scanf/fscanf.c, scanf/fscanffuns.c, scanf/scanf.c,
+ scanf/sscanf.c, scanf/sscanffuns.c, scanf/vfscanf.c, scanf/vscanf.c,
+ scanf/vsscanf.c, scanf/Makefile.am, tests/misc/t-scanf.c: New files.
+ * gmp-h.in, gmp-impl.h, Makefile.am, configure.in: Consequent
+ additions.
+
+ * tests/misc: New directory.
+ * tests/misc/Makefile.am: New file.
+ * tests/misc/t-locale.c: New file.
+ * tests/misc/t-printf.c: Moved from tests/printf.
+ * tests/printf: Remove directory.
+ * configure.in, tests/Makefile.am: Update.
+
+ * tests/cxx/t-locale.cc: New file.
+ * tests/cxx/Makefile.am: Add it.
+
+ * mpf/set_str.c, cxx/ismpf.cc: Use localeconv for the decimal point.
+
+ * acinclude.m4 (GMP_ASM_X86_MCOUNT): Update to $lt_prog_compiler_pic
+ for current libtool, recognise non-PIC style mcount in windows DLLs.
+
+ * gmp-impl.h (__gmp_replacement_vsnprintf): Add prototype.
+
+ * gmp-impl.h (__gmp_rands, __gmp_rands_initialized,
+ modlimb_invert_table): Add __GMP_DECLSPEC for the benefit of test
+ programs using them from a windows DLL.
+ * longlong.h (__clz_tab): Ditto.
+
+ * mpn/x86/t-zdisp2.pl: New file.
+
+ * mpn/x86/pentium4/README: New file.
+
+2001-11-15 Torbjorn Granlund <tege@swox.com>
+
+ * mpz/powm.c (HANDLE_NEGATIVE_EXPONENT): #define to 1.
+ * tests/mpz/reuse.c (main): Use mpz_invert to avoid undefined mpz_powm
+ cases.
+
+2001-11-14 Torbjorn Granlund <tege@swox.com>
+
+ * mpz/powm_ui.c: Rewrite along the lines of mpz/powm.c (except still no
+ redc).
+ * mpz/powm.c: Adjust for negative b, after exponentiation done. Add
+ (still disabled) code for handling negative exponents. Misc cleanups.
+
+2001-11-14 Kevin Ryde <kevin@swox.se>
+
+ * mpf/out_str.c: Use localeconv for the decimal point.
+
+ * tests/misc.c (tests_rand_end): Use time() if gettimeofday() not
+ available (eg. on mingw).
+
+2001-11-11 Kevin Ryde <kevin@swox.se>
+
+ * gmp-h.in: Remove parameter names from prototypes, to keep out of
+ application namespace.
+
+2001-11-08 Kevin Ryde <kevin@swox.se>
+
+ * acinclude.m4 (GMP_GCC_VERSION_GE): Fix sed regexps to work on
+ Solaris 8.
+
+ * printf/doprnt.c: Support %n of all types, per glibc.
+
+ * gmp-h.in, gmp-impl.h, mpf/abs.c, mpf/neg.c, mpf/get_prc.c,
+ mpf/get_dfl_prec.c, mpf/set_dfl_prec.c, mpf/set_prc_raw.c,
+ mpf/set_si.c, mpf/set_ui.c, mpf/size.c: Revert mpf inlining, in order
+ to leave open the possibility of keeping binary compatibility if mpf
+ becomes mpfr.
+
+ * mpn/x86/k7/mmx/lshift.asm, mpn/x86/k7/mmx/rshift.asm: Use Zdisp to
+ force code size for computed jumps.
+ * mpn/x86/k6/mod_34lsub1.asm, mpn/x86/k6/k62mmx/copyd.asm: Use Zdisp
+ to force good code alignment.
+ * mpn/x86/x86-defs.m4 (Zdisp): More instructions.
+
+ * mpn/x86/pentium/sqr_basecase.asm, mpn/x86/k7/mmx/mod_1.asm,
+ mpn/x86/k7/mmx/popham.asm: Remove some unnecessary "0" address offsets.
+
+ * mpq/set_si.c, mpq/set_ui.c: Set _mp_den._mp_size correctly if den==0.
+
+2001-11-07 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/hppa/hppa1_1/udiv_qrnnd.asm: Work around gas bug.
+
+ * mpn/asm-defs.m4 (PROLOGUE): Change alignment to 8 (probably a good
+ idea in general; required for hppa/hppa1_1/udiv_qrnnd.asm).
+
+2001-11-06 Torbjorn Granlund <tege@swox.com>
+
+ * gmp-impl.h (MPN_COPY_INCR): Prepend local variable by `__'.
+ (MPN_COPY_DECR): Likewise.
+
+2001-11-05 Torbjorn Granlund <tege@swox.com>
+
+ * mpz/powm.c: Call mpn functions, not mpz functions, for computation
+ mod m. Streamline allocations to use a mixture of stack allocation and
+ heap allocation. Add currently disabled phi(m) exponent reduction
+ code. Misc optimizations and cleanups.
+
+2001-11-05 Kevin Ryde <kevin@swox.se>
+
+ * mpq/inp_str.c: Remove unused variable "ret".
+
+ * mpn/x86/k7/sqr_basecase.asm: Fix a 0(%edi) to use Zdisp, so the
+ computed jumps hit the right spot on old gas.
+
+ * mpq/canonicalize.c: DIVIDE_BY_ZERO if denominator is zero.
+
+ * mpn/lisp/gmpasm-mode.el (comment-start-skip): Correction to the way
+ the first \( \) pair is setup.
+ (gmpasm-font-lock-keywords): Don't fontify the space before a "#" etc.
+ Misc tweaks to some comments.
+
+2001-11-03 Torbjorn Granlund <tege@swox.com>
+
+ * tests/refmpn.c (refmpn_overlap_p): Reverse return values.
+
+2001-11-02 Kevin Ryde <kevin@swox.se>
+
+ * tune/many.pl: Setup CFLAGS_PIC and ASMFLAGS_PIC, since that's no
+ longer done by configure.
+
+ * mpn/x86/pentium4/mmx/popham.asm: New file.
+
+ * mpn/x86/x86-defs.m4 (psadbw): New macro.
+ * mpn/x86/k7/mmx/popham.asm: Use it.
+
+ * tests/refmpn.c (refmpn_overlap_p): New function, independent of
+ MPN_OVERLAP_P.
+
+2001-10-31 Torbjorn Granlund <tege@swox.com>
+
+ * tests/mpz/t-powm.c: Print proper error message when finding
+ discrepancy.
+
+2001-10-31 Kevin Ryde <kevin@swox.se>
+
+ * mpn/x86/pentium/mod_34lsub1.asm: New file.
+ * mpn/x86/k7/mod_34lsub1.asm: New file.
+ * mpn/x86/mod_34lsub1.asm: New file.
+
+2001-10-30 Kevin Ryde <kevin@swox.se>
+
+ * tests/printf/t-printf.c (check_misc): Add checks from the glibc docs.
+ (check_vasprintf, check_vsnprintf): Run these unconditionally.
+
+ * gmp-impl.h (ASSERT_MPQ_CANONICAL): New macro.
+ * mpq/cmp.c, mpq/cmp_si.c, mpq/cmp_ui.c, mpq/equal.c: Add ASSERTs for
+ canonical inputs, where correctness depends on it.
+
+ * mpn/lisp/gmpasm-mode.el (comment-start-skip): Add "dnl".
+
+2001-10-27 Torbjorn Granlund <tege@swox.com>
+
+ * demos/pexpr.c: Remove some unused variables.
+ (main): Allocate more buffer space to accommodate minus sign.
+
+2001-10-27 Kevin Ryde <kevin@swox.se>
+
+ * gmp-impl.h, mpn/asm-defs.m4, configure.in, tune/speed.h,
+ tune/speed.c, tune/common.c, tune/many.pl, tests/devel/try.c: Add
+ mpn_mod_34lsub1.
+ * tests/refmpn.c, tests/tests.h (refmpn_mod_34lsub1): New function.
+
+ * mpn/generic/mod_34lsub1.c: New file.
+ * mpn/x86/k6/mod_34lsub1.asm: New file.
+ * mpn/x86/pentium4/sse2/mod_34lsub1.asm: New file.
+ * mpn/x86/x86-defs.m4 (Zdisp): Add another instruction.
+
+ * gmp-h.in, gmpxx.h: Use <iosfwd> not whole <iostream>.
+
+ * gmp.texi (Known Build Problems): Add note on test programs with
+ Windows DLLs.
+
+2001-10-26 Kevin Ryde <kevin@swox.se>
+
+ * tests/mpq/t-get_d.c: Limit the size of "eps" for vax.
+
+ * gmp.texi (maybepagebreak): New macro, use it in a few places.
+ (Notes for Particular Systems): C++ Windows DLLs are not supported.
+ (Known Build Problems): Note sparc solaris 2.7 gcc 2.95.2 shared
+ library problems.
+ (Autoconf): Tweak version numbers shown.
+ (Integer Roots): mpz_perfect_square_p and mpz_perfect_power_p consider
+ 0 and 1 perfect powers, mpz_perfect_power_p accepts negatives.
+ (Number Theoretic Functions): Add mpz_millerrabin, combined with a
+ reworded mpz_probab_prime_p.
+ (Formatted Output Strings): Misc clarifications.
+ (Formatted Output Functions): gmp_asprintf, gmp_vasprintf,
+ gmp_snprintf, gmp_vsnprintf always available.
+ (C++ Formatted Output): Misc rewordings.
+ (Formatted Input): New chapter.
+ (C++ Class Interface): New chapter, by Gerardo and me.
+ (Language Bindings): Update GMP++ now in GMP.
+ (C++ Interface Internals): New section, by Gerardo and me.
+
+ * printf/repl-vsnprintf.c: New file.
+ * configure.in, acinclude.m4, Makefile.am, printf/Makefile.am: Use it
+ if libc vsnprintf missing or bad.
+ * configure.in (AC_CHECK_FUNCS): Add strnlen.
+
+ * printf/snprntffuns.c, printf/vasprintf.c: Use
+ __gmp_replacement_vsnprintf if libc vsnprintf not available.
+ * printf/asprintf.c, printf/snprintf.c, printf/vasprintf.c,
+ printf/vsnprintf.c: Provide these functions unconditionally.
+ * acinclude.m4 (GMP_FUNC_VSNPRINTF): Remove warning about omissions
+ when vsnprintf not available.
+
+2001-10-24 Kevin Ryde <kevin@swox.se>
+
+ * configure, aclocal.m4: Regenerate with a libtool patch for a stray
+ quote in AC_LIBTOOL_PROG_LD_SHLIBS under mingw and cygwin.
+
+ * gmp-impl.h (modlimb_invert): More comments.
+
+ * printf/doprnt.c, printf/doprnti.c: Use the precision field to print
+ leading zeros.
+ * tests/printf/t-printf.c: Test this.
+ * cxx/osdoprnti.cc, gmp-impl.h: Ignore precision in operator<<.
+
+ * tune/speed.c, tune/speed.h, tune/common.c: Add mpn_mul_1_inplace.
+
+2001-10-23 Torbjorn Granlund <tege@swox.com>
+
+ * mpz/pprime_p.c (mpz_millerrabin): Remove function and its descendant.
+
+ * mpz/millerrabin.c: New file with code from pprime.c.
+ * mpz/Makefile.am: Compile millerrabin.c.
+ * Makefile.am (MPZ_OBJECTS): Ditto.
+ * gmp-h.in: Declare mpz_millerrabin.
+
+2001-10-22 Torbjorn Granlund <tege@swox.com>
+
+ * tests/mpz/t-perfsqr.c: New file.
+ * tests/mpz/Makefile.am (check_PROGRAMS): Add it.
+
+ * demos/factorize.c (factor): Check for number to factor == 0.
+ (main): When invoked without arguments, read from stdin.
+
+ * mpz/perfpow.c: Add code to handle negative perfect powers ((-b)^odd).
+ Treat 0 and 1 as perfect powers.
+
+ * mpn/sparc32/v9/sqr_diagonal.asm: Jump past .align.
+
+2001-10-21 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/generic/perfsqr.c (sq_res_0x100): Remove bogus final `,'.
+ (mpn_perfect_square_p): Suppress superfluous `&1' in sq_res_0x100 test.
+ (mpn_perfect_square_p, O(n) test): Improve comments. Combine remainder
+ tests for some small primes. Don't share code for different limb
+ sizes. Use single `if' with many `||' for better code density.
+
+2001-10-22 Kevin Ryde <kevin@swox.se>
+
+ * demos/perl/GMP.xs (mutate_mpz, tmp_mpf_grow): Make these "static".
+
+ * mpn/x86/pentium/popcount.asm, mpn/x86/pentium/hamdist.asm
+ (mpn_popcount_table): Use GSYM_PREFIX.
+
+2001-10-19 Kevin Ryde <kevin@swox.se>
+
+ * mpn/x86/*.asm: Add some measured speeds on various x86s.
+
+ * tests/mpz/reuse.c, tests/mpf/reuse.c: Disable tests when using a
+ windows DLL, because certain global variable usages won't compile.
+
+ * configure.in (AC_CHECK_FUNCS): Add alarm.
+ * tests/spinner.c: Conditionalize alarm and SIGALRM availability, for
+ the benefit of mingw32.
+
+ * acinclude.m4 (GMP_ASM_TYPE, GMP_ASM_SIZE): Suppress .type and .size
+ on COFF.
+
+ * acinclude.m4 (GMP_PROG_HOST_CC): New macro.
+ * configure.in: Use it for windows DLL cross-compiles.
+ * aclocal.m4, configure: Regenerate with libtool patch to hold HOST_CC
+ in the generated libtool script.
+
+ * aclocal.m4, configure: Regenerate with libtool patch to suppress
+ warnings when probing command line limit on FreeBSD.
+
+ * demos/qcn.c (M_PI): Define if not already provided, helps mingw32.
+
+2001-10-17 Kevin Ryde <kevin@swox.se>
+
+ * printf/doprnt.c: Use <stdint.h> for intmax_t.
+
+ * longlong.h: Recognise __sparcv8 for gcc on Solaris. Reported by
+ Mark Mentovai <mark@mentovai.com>.
+
+ * gmp-impl.h (gmp_allocated_string): No need for inline on member funs.
+
+2001-10-16 Kevin Ryde <kevin@swox.se>
+
+ * gmp.texi (Debugging): Add mpatrol.
+ (Integer Comparisons, Comparing Rationals, Float Comparison): Index
+ entries for sign tests.
+ (I/O of Floats): Clarify mpf_out_str exponent is in decimal.
+ (C++ Formatted Output): mpf_t operator<< exponent now in decimal.
+ (FFT Multiplication): Use an ascii art sigma.
+ (Contributors): Add Gerardo Ballabio.
+
+ * cxx/osfuns.cc (__gmp_doprnt_params_from_ios): Always give mpf_t
+ exponent in decimal, irrespective of ios::hex or ios::oct.
+ * tests/cxx/t-ostream.cc (check_mpf): Update.
+
+ * printf/doprnt.c: Support %lln and %hhn.
+
+ * mpn/x86/pentium4/sse2/submul_1.asm: Use a psubq to negate the
+ initial carry (helps the submul_1c case), and improve the comments.
+
+2001-10-11 Kevin Ryde <kevin@swox.se>
+
+ * acinclude.m4, configure.in (GMP_IMPL_H_IEEE_FLOATS): New macro.
+
+ * ltmain.sh: Send some rm errors to /dev/null, helps during compiles
+ on Solaris 2.7 and HP-UX 10.
+
+ * tal-notreent.c: Renamed from stack-alloc.c.
+ * Makefile.am, acinclude.m4, gmp-impl.h: Update.
+
+ * gmp-h.in: Don't give both prototypes and inlines, except on gcc.
+
+ * gmp-h.in, gmp-impl.h: Use #includes to get necessary standard
+ classes, add std:: to prototypes.
+ * cxx/*.cc, tests/cxx/t-ostream.cc: Add "use namespace std".
+ * acinclude.m4 (GMP_PROG_CXX_WORKS): Ditto.
+
+ * tests/*/Makefile.in, mpfr/tests/Makefile.in: Regenerate with
+ automake patch to avoid Ultrix problem with empty $(TESTS).
+
+ * */Makefile.in: Regenerate with automake patch to only rm *_.c in
+ "make clean" when ansi2knr actually in use, helps DOS 8.3.
+
+ * Makefile.in: Regenerate with automake patch to fix stamp-h
+ numbering, avoiding an unnecessary config.status run.
+
+2001-10-09 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/hppa/hppa1_1/udiv_qrnnd.asm: Use L macros for labels.
+ Quote L reloc operator.
+
+ * gmp-impl.h: Declare class string.
+
+ * mpn/asm-defs.m4 (INT32, INT64): Quote $1 to prevent further
+ expansion.
+
+ * mpn/alpha/ev6/mul_1.asm: New file.
+
+2001-10-09 Kevin Ryde <kevin@swox.se>
+
+ * gmp.texi (Introduction to GMP): Add pentium 4 to optimized CPUs.
+ (Build Options): Note macos directory.
+ (Notes for Package Builds): GMP 4 series binary compatible with 3.
+ (Known Build Problems): Remove $* and ansi2knr note, now fixed, except
+ possibly under --host=none.
+ (Formatted Output Strings): Remove -1 prec for all digits.
+
+ * mpz/add.c, mpz/sub.c: Don't use mpz path on #include (helps macos).
+ * mpbsd/Makefile.am (INCLUDES): Add -I$(top_srcdir)/mpz.
+
+ * printf/doprnt.c, tests/printf/t-printf.c: Remove support for %.*Fe
+ prec -1 meaning all digits.
+
+ * acinclude.m4 (GMP_PROG_AR): Override libtool, use AR_FLAGS="cq".
+ (GMP_HPC_HPPA_2_0): Print version string to config.log.
+
+ * Makefile.am (AUTOMAKE_OPTIONS): Remove check-news (permission notice
+ in NEWS file is too big).
+ (dist-hook): Don't distribute numbered or unnumbered emacs backups.
+
+ * Makefile.am, cxx/Makefile.am: Updates for Gerardo's stuff.
+
+2001-10-09 Gerardo Ballabio <ballabio@sissa.it>
+
+ * cxx/isfuns.cc: New file.
+ * gmp-impl.h: Add prototypes.
+ * cxx/ismpf.cc, cxx/ismpq.cc, cxx/ismpz.cc: New files.
+ * gmp-h.in: Add prototypes.
+ * gmpxx.h, mpfrxx.h: New files.
+
+2001-10-08 Kevin Ryde <kevin@swox.se>
+
+ * configure.in (with_tags): Establish a default based on --enable-cxx.
+
+ * aclocal.m4: Regenerate with libtool patches for sed char range to
+ help Cray, LTCC quotes and +Z warnings grep to help HP-UX.
+
+ * gmp-impl.h (doprnt_format_t, doprnt_memory_t, doprnt_reps_t,
+ doprnt_final_t): Use _PROTO.
+
+2001-10-05 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/asm-defs.m4 (INT32, INT64): Use LABEL_SUFFIX.
+
+ * mpn/hppa: Convert files to `.asm'.
+
+2001-10-05 Kevin Ryde <kevin@swox.se>
+
+ * mpn/Makeasm.am (.S files): Revert to separate CPP and CCAS, use
+ cpp-ccas, and only pass CPPFLAGS to CPP, not whole CFLAGS.
+ * mpn/cpp-ccas: New file.
+ * mpn/Makefile.am (EXTRA_DIST): Add it.
+
+ * tune/common.c, tune/speed.h: Change SPEED_ROUTINE_MPN_COPY_CALL uses
+ to SPEED_ROUTINE_MPN_COPY or new SPEED_ROUTINE_MPN_COPY_BYTES. Avoids
+ macro expansion problems on Cray.
+
+ * configure.in (AC_PROG_CXXCPP): Add this, to make libtool happier.
+
+2001-10-04 Torbjorn Granlund <tege@swox.com>
+
+ * mpz/rrandomb.c (gmp_rrandomb): Change bit_pos to be 0-based (was
+ 1-based); shift 2 (was 1) when making bit mask. These two changes
+ avoid undefined shift counts.
+ (gmp_rrandomb): Avoid most calls to _gmp_rand by caching random values.
+
+ * mpn/generic/random2.c: Changes for mirroring mpz/rrandomb.c.
+
+2001-10-04 Kevin Ryde <kevin@swox.se>
+
+ * gmp.texi (Build Options): Add --enable-cxx.
+ (Notes for Particular Systems): Mention pentium4 performance and SSE2.
+ (Known Build Problems): Remove vax jsobgtr note, no longer needed.
+ (Converting Floats): Tweak mpf_get_str description.
+ (Low-level Functions): Correction to mpn_gcdext destination space
+ requirements.
+ (C++ Formatted Output): New section.
+ (Language Bindings): Add ALP
+ (Contributors): Add Paul Zimmermann's square root, update my things.
+
+ * acinclude.m4 (GMP_PROG_CC_IS_GNU, GMP_PROG_CXX_WORKS): Send compiler
+ errors to config.log.
+
+ * mpq/Makefile.am (INCLUDES): Remove -DOPERATION_$*, not needed.
+
+ * mpn/x86/*.asm: Change references to old README.family to just README.
+
+ * mpz/README: Remove file, now adequately covered in the manual.
+
+2001-10-03 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/x86/pentium4/copyi.asm: New file.
+ * mpn/x86/pentium4/copyd.asm: New file.
+
+ * gmp-impl.h: Implement separate MPN_COPY_INCR and MPN_COPY_DECR
+ macros for CRAY systems.
+ (CRAY _MPN_COPY): Delete.
+
+2001-10-02 Kevin Ryde <kevin@swox.se>
+
+ * tests/mpz/t-popcount.c (check_data): Use "~ (unsigned long) 0" to
+ avoid compiler warnings on sco.
+
+ * mpbsd/Makefile.am: Compile mpz files directly, no copying.
+ Use mpz/add.c and mpz/sub.c rather than mpz/aors.c.
+ (INCLUDES): Remove -DOPERATION_$*, no longer needed (by mpz).
+
+ * mpz/aors.h: Renamed from mpz/aors.c.
+ * mpz/add.c, mpz/sub.c: New files, using mpz/aors.h.
+ * mpz/aors_ui.h: Renamed from mpz/aors_ui.c.
+ * mpz/add_ui.c, mpz/sub_ui.c: New files, using mpz/aors_ui.h.
+ * mpz/fits_s.h: Renamed and adapted from mpz/fits_s.c.
+ * mpz/fits_sshort.c, mpz/fits_sint.c, mpz/fits_slong.c: New files.
+ * mpz/mul_i.h: Renamed from mpz/mul_siui.c.
+ * mpz/mul_ui.c, mpz/mul_ui.c: New files, using mpz/mul_i.h.
+ * mpz/Makefile.am: Consequent updates.
+ (INCLUDES): Remove -DOPERATION_$*.
+
+ * mpf/fits_s.h: Renamed and adapted from mpf/fits_s.c.
+ * mpf/fits_sshort.c, mpf/fits_sint.c, mpf/fits_slong.c: New files.
+ * mpf/fits_u.h: Renamed and adapted from mpf/fits_u.c.
+ * mpf/fits_ushort.c, mpf/fits_uint.c, mpf/fits_ulong.c: New files.
+ * mpf/Makefile.am: Consequent updates.
+ (INCLUDES): Remove -DOPERATION_$*.
+
+ * cxx/osfuns.cc (__gmp_doprnt_params_from_ios): Don't use ios::hex etc
+ as cases in a switch, they're not constant in g++ 3.0.
+
+ * mpn/Makeasm.am (.s.o, .s.obj, .S.o, .S.obj, .asm.o, .asm.obj):
+ Locate source file with test -f the same as automake.
+ (.S): Let CCAS do the preprocessing, and run libtool for .S.lo.
+ (.asm.lo): Run libtool via m4-ccas to get new style foo.lo right.
+ (COMPILE_FLAGS): Add $(DEFAULT_INCLUDES), per new automake.
+ * mpn/m4-ccas: New file.
+ * mpn/Makefile.am (EXTRA_DIST): Add it.
+ * mpn/asm-defs.m4: Add m4_not_for_expansion(`DLL_EXPORT').
+ * mpn/x86/x86-defs.m4: Undefine PIC if DLL_EXPORT is set.
+ * configure.in (CFLAGS_PIC, ASMFLAGS_PIC): Remove, no longer needed.
+
+ * acinclude.m4 (GMP_FUNC_VSNPRINTF): Warn what's omitted when
+ vsnprintf not available.
+
+ * mpn/underscore.h: Remove file, not used since m68k converted to asm.
+ * mpn/Makefile.am (EXTRA_DIST): Remove it.
+
+ * tests/refmpz.c: Add <stdlib.h>, for free().
+
+2001-10-01 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/x86/pentium4/sse2/submul_1.asm: Apply some algebraic
+ simplifications.
+ * mpn/x86/pentium4/sse2/addmul_1.asm: Comment.
+
+2001-10-01 Kevin Ryde <kevin@swox.se>
+
+ * configure.in (--enable-cxx): New option for C++ support.
+ Add cxx and tests/cxx subdirectories.
+ * ltmain.sh, aclocal.m4: Update to libtool 2001-09-30.
+
+ * cxx/Makefile.am, cxx/Makefile.in, cxx/osdoprnti.cc, cxx/osfuns.cc,
+ cxx/osmpf.cc, cxx/osmpq.cc, cxx/osmpz.cc: New files.
+ * Makefile.am: Add them, in new libgmpxx.
+ * gmp-h.in, gmp-impl.h: Prototypes and support.
+ * tests/cxx/Makefile.am, tests/cxx/Makefile.in,
+ tests/cxx/t-ostream.cc: New files.
+
+ * tune/speed.h (SPEED_ROUTINE_MPN_GCD_CALL,
+ SPEED_ROUTINE_MPN_GCDEXT_ONE): mpn_gcdext needs size+1 for
+ destinations. Found by Torbjorn.
+
+ * gmp-h.in (__GNU_MP__, __GNU_MP_VERSION): Bump to 4.0.
+ * mp-h.in (__GNU_MP__): Ditto.
+ * gmp.texi, Makefile.am, compat.c: Amend version 3.2 to 4.0.
+
+ * acinclude.m4 (GMP_PROG_CXX_WORKS): New macro.
+ (GMP_PROG_CC_WORKS): Write "conftest" test program, not a.out.
+
+ * gmp-impl.h (struct gmp_asprintf_t): Moved from printf/vasprintf.c.
+ (GMP_ASPRINTF_T_INIT): New macro.
+ (GMP_ASPRINTF_T_NEED): New macro, adapted from vasprintf.c NEED().
+ * printf/vasprintf.c: Use these.
+
+ * printf/asprntffuns.c: New file.
+ * printf/Makefile.am, Makefile.am: Add it.
+ * printf/asprntffuns.c, printf/vasprintf.c, gmp-impl.h
+ (__gmp_asprintf_memory, __gmp_asprintf_reps, __gmp_asprintf_final):
+ Move to asprntffuns.c, rename to __gmp and make global, remove
+ spurious formal parameters from __gmp_asprintf_final.
+
+ * configure.in (j90-*-*, sv1-*-*): Don't duplicate $path in $add_path.
+ (*-*-mingw*): Don't assemble with -DPIC (as per cygwin).
+
+ * printf/snprntffuns.c (gmp_snprintf_final): Remove spurious formal
+ parameters.
+
+ * tune/tuneup.c (POWM_THRESHOLD): Reduce stop_factor to 1.1 to help
+ Cray vector systems.
+
+ * tests/misc.c (tests_rand_start): Print GMP_CHECK_RANDOMIZE=NN to
+ facilitate cut and paste when re-running.
+ * tests/mpz/t-inp_str.c (check_data): Add more diagnostic prints.
+
+2001-09-30 Kent Boortz <kent@swox.com>
+
+ * macos/configure, macos/Makefile.in, macos/README: Updates for gmp 4.
+ * gmp-h.in (_GMP_H_HAVE_FILE): Recognise Apple MPW.
+
+2001-09-30 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/cray/ieee/submul_1.c: Rewrite. Streamline multiplications;
+ use `majority' logic.
+
+2001-09-27 Torbjorn Granlund <tege@swox.com>
+
+ * gmp-h.in (__GMPN_AORS_1): Rewrite to work around Cray compiler bug.
+
+2001-09-26 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/x86/pentium4/sse2/gmp-mparam.h: New file.
+
+2001-09-26 Kevin Ryde <kevin@swox.se>
+
+ * mpn/x86/pentium4/sse2/dive_1.asm: New file.
+ * mpn/x86/pentium4/sse2/submul_1.asm: New file.
+ * mpn/x86/pentium4/sse2/sqr_basecase.asm: New file.
+
+ * mpn/x86/pentium/copyi.asm: New file, based on past work by Torbjorn.
+ * mpn/x86/pentium/copyi.asm: New file, ditto.
+ * mpn/x86/pentium/com_n.asm: Rewrite, ditto.
+
+ * printf/snprntffuns.c (gmp_snprintf_format): Copy va_list in case
+ vsnprintf trashes it.
+ * printf/vasprintf.c (gmp_asprintf_format): Ditto.
+ * gmp-impl.h, doprnt.c (va_copy): Move to gmp-impl.h.
+
+ * tests/mpz/t-cmp_d.c (check_low_z_one): Patch by Torbjorn for vax
+ limited float range.
+
+2001-09-23 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/vax/lshift.s: Change `jsob*' to `sob*'.
+ * mpn/vax/rshift.s: Likewise.
+
+2001-09-23 Kevin Ryde <kevin@swox.se>
+
+ * mpn/x86/pentium4/sse2/mul_basecase.asm: Some simple but real code.
+
+ * printf/doprnt.c: Use va_copy for va_list variables, copy function
+ parameter in case it's call-by-reference.
+
+ * tune/freq.c (speed_cpu_frequency_bsd_dmesg): New function.
+ (speed_cpu_frequency_table): Use it.
+
+ * tune/many.pl (popcount, hamdist): Fix declared return value.
+ (sb_divrem_mn): Remove a spurious duplicate entry.
+ (CLEAN): Add tmp-$objbase.c when using that for .h files.
+ (macro_speed): Give a default for .h files.
+ Add ATTRIBUTE_CONST or __GMP_ATTRIBUTE_PURE as appropriate.
+
+ * tune/speed.h (SPEED_ROUTINE_MPN_MOD_CALL,
+ SPEED_ROUTINE_MPN_PREINV_MOD_1, SPEED_ROUTINE_MPN_POPCOUNT,
+ SPEED_ROUTINE_MPN_HAMDIST, SPEED_ROUTINE_MPN_GCD_1N,
+ SPEED_ROUTINE_MPN_GCD_1_CALL, SPEED_ROUTINE_MPZ_JACOBI): Use return
+ values so gcc 3 won't discard calls to pure or const functions.
+ (mpn_mod_1_div, mpn_mod_1_inv): Add __GMP_ATTRIBUTE_PURE.
+
+2001-09-22 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/x86/pentium4/sse2/mul_basecase.asm: New file, placeholder
+ for real code, hiding the default x86 mul_basecase.asm.
+
+2001-09-22 Kevin Ryde <kevin@swox.se>
+
+ * configure.in (AC_PREREQ): Bump to 2.52.
+ (m4_pattern_forbid, m4_pattern_allow): New calls, forbid GMP_.
+ (AC_CHECK_HEADERS): Remove sys/types.h, already done by autoconf.
+ * acinclude.m4, configure.in (GMP_GCC_NO_CPP_PRECOMP): New macro.
+
+ * tests/devel/try.c (TYPE_PREINV_MOD_1): Don't run size==0.
+ (malloc_region): Need fd=-1 for mmap MAP_ANON on BSD.
+
+2001-09-20 Torbjorn Granlund <tege@swox.com>
+
+ * mpz/cong.c (mpz_congruent_p): Fix one-limb c<d test.
+
+ * longlong.h: Rewrite __i370__ smul_ppmm; enable also for __s390__.
+
+ * configure.in: Add support for IBM 360, 370, 390 families.
+
+2001-09-20 Kevin Ryde <kevin@swox.se>
+
+ * mpn/x86/pentium4/sse2/diveby3.asm: New file.
+ * mpn/x86/pentium4/sse2/mode1o.asm: New file.
+
+2001-09-16 Kevin Ryde <kevin@swox.se>
+
+ * printf/doprnt.c: '#' means showpoint and showtrailing for %e, %f, %g.
+ * tests/printf/t-printf.c (check_f): More test cases.
+
+2001-09-15 Torbjorn Granlund <tege@swox.com>
+
+ * gmp-h.in (__GMPN_AORS_1): Remove param TEST, add OP and CB.
+ Postpone zeroing of (cout).
+ (__GMPN_ADD_1, __GMPN_SUB_1): Corresponding changes.
+
+2001-09-14 Kevin Ryde <kevin@swox.se>
+
+ * ChangeLog: Merge in tests/rand/ChangeLog.
+ * tests/rand/ChangeLog: Remove file.
+
+ * printf/doprnt.c: Fix handling of a plain format after a GMP one; no
+ need to protect against negative precision internally.
+ * tests/printf/t-printf.c (check_misc): More checks.
+
+2001-09-12 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/cray/ieee/invert_limb.c: Add a PROLOGUE in a comment to have
+ HAVE_NATIVE_... defined.
+
+2001-09-11 Kevin Ryde <kevin@swox.se>
+
+ * configure.in, gmp-h.in (__GMP_HAVE_HOST_CPU_FAMILY_power,
+ __GMP_HAVE_HOST_CPU_FAMILY_powerpc): New AC_SUBSTs.
+ * gmp-h.in (__GMPN_COPY_INCR): Use them to select the power/powerpc
+ code, rather than preprocessor defines.
+
+ * acinclude.m4, configure.in (GMP_H_ANSI): New macro.
+
+ * gmp-h.in (__GMP_EXTERN_INLINE): Add a definition for SCO 8 cc.
+
+ * gmp-h.in, version.c (gmp_version): Make the pointer "const" as well
+ as the string.
+
+ * acinclude.m4, configure.in (GMP_PROG_CC_IS_XLC): Recognise xlc when
+ invoked under another name (cc, xlc128, etc).
+ * acinclude.m4 (GMP_PROG_CC_IS_GCC): Print a message when recognised.
+
+2001-09-11 Torbjorn Granlund <tege@swox.com>
+
+ * gmp-h.in: Let __DECC mean __GMP_HAVE_CONST, etc.
+ * mp-h.in: Likewise.
+
+2001-09-10 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/x86/pentium4/mmx/lshift.asm: New file.
+ * mpn/x86/pentium4/mmx/rshift.asm: New file.
+
+ * tests/mpn/t-iord_u.c (check_incr_data): Work around HP compiler bug.
+ (check_decr_data): Likewise.
+
+2001-09-08 Kevin Ryde <kevin@swox.se>
+
+ * gmp.texi (Integer Logic and Bit Fiddling): Update mpz_hamdist
+ behaviour, clarify mpz_popcount a touch.
+ (Language Bindings): Add mlton, fix alphabetical order.
+ (Single Limb Division): Describe 2 or 1/2 limbs at a time style.
+
+ * configure.in (AC_CHECK_FUNCS): Add mmap.
+ * tests/devel/try.c (malloc_region): Use mmap if available.
+
+ * tests/refmpz.c, tests/tests.h (refmpz_hamdist): New function.
+ * tests/mpz/t-hamdist.c: New file.
+ * tests/mpz/Makefile.am: Add it.
+
+ * mpz/hamdist.c: Support neg/neg operands.
+
+ * macos/Makefile.in: Remove dual compile of mpq/aors.c and
+ mpn/generic/popham.c.
+
+ * gmp-impl.h (popc_limb): New macro, adapted from mpn/generic/popham.c.
+ For 64-bits reuse 0x33...33 constant.
+ * mpn/generic/popcount.c, mpn/generic/hamdist.c: Split from popham.c,
+ use popc_limb macro, remove unused "i", don't bother with "register"
+ qualifiers.
+ * mpn/generic/popham.c: Remove file.
+
+ * ltmain.sh, configure, aclocal.m4: Update to libtool 1.4.1, with one
+ ltdll.c generation patch.
+ * doc/configuration: Misc updates, note libtool patch used.
+
+ * mpn/x86/pentium4/sse2/mul_1.asm: Use pointer increments not indexed
+ addressing, to get 4.0 c/l flat.
+
+ * tests/mpq/t-cmp_si.c (check_data): Use ULONG_MAX for denominators.
+
+ * tests/misc.c (mpz_negrandom): Use given rstate, not RANDS.
+
+2001-09-07 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/x86/pentium4/sse2/addmul_1.asm: New file.
+
+2001-09-04 Kevin Ryde <kevin@swox.se>
+
+ * tune/freq.c: Define a HAVE for each speed_cpu_frequency routine to
+ avoid duplicating conditionals.
+ (speed_cpu_frequency_sco_etchw): New function.
+ (speed_cpu_frequency_table): Use it.
+ * tune/README: Mention SCO openunix 8 /etc/hw.
+
+ * mpz/fib_ui.c: Use ?: to avoid a gcc 3 bug on powerpc64.
+ Store back a carry for limb<long.
+
+ * mpn/x86/k7/mmx/divrem_1.asm, mpn/x86/k7/mmx/mod_1.asm,
+ mpn/x86/p6/mmx/divrem_1.asm: Fix a couple of comments.
+
+ * config.guess: Give m68020 for 68020 or better, not m68k.
+ * configfsf.guess: Update to 2001-09-04.
+
+2001-09-02 Kevin Ryde <kevin@swox.se>
+
+ * configure.in (m68k-*-*): Let m68k mean 68000, not 68020.
+ * gmp.texi (Notes for Particular Systems): Update.
+
+ * gmp-impl.h (union ieee_double_extract) [m68k]: Use longs, since int
+ might be only 16 bits.
+
+ * tests/mpq/t-aors.c: New file.
+ * tests/mpq/Makefile.am: Add it.
+
+ * tests/refmpq.c: New file.
+ * tests/Makefile.am: Add it.
+ * tests/tests.h: Add prototypes.
+
+ * mpq/aors.c: Share object code for mpq_add and mpq_sub.
+ * Makefile.am, mpq/Makefile.am: Single mpq/aors.lo now.
+
+ * tests/devel/try.c (TYPE_SUBMUL_1): Use correct reference routine.
+
+2001-08-30 Kevin Ryde <kevin@swox.se>
+
+ * mpn/x86/x86-defs.m4 (cmov_available_p): Add pentium4.
+
+ * gmp-h.in: Put #define renamings with prototypes.
+ Remove commented out #defines of gmp-impl.h things.
+ (mpn_invert_limb): Remove #define, already in gmp-impl.h.
+ (mpn_lshiftc, mpn_rshiftc): Remove #defines, unused.
+ (mpn_addsub_nc): Add prototype to #define.
+
+2001-08-28 Kevin Ryde <kevin@swox.se>
+
+ * gmp.texi: Switch to GFDL.
+ (Top): Arrange copyright and conditions to appear here too. For
+ clarity have all this before the miscellaneous macro definitions.
+ (Copying): Refer to COPYING.LIB file, mention plain GPL2 in demo
+ programs.
+ (Contributors, References): Use @appendix rather than @unnumbered.
+ (GNU Free Documentation License): New appendix.
+ (@contents): Move to start of document, use only for tex (not html).
+ (Debugging): Add leakbug.
+ (Build Options): Add pentium4.
+ (I/O of Rationals): Add mpq_inp_str.
+
+ * fdl.texi: New file, with two @appendix directive tweaks.
+ * Makefile.am (gmp_TEXINFOS): Add it.
+
+ * tests/mpz/io.c: Check mpz_inp_str return against ftell, send error
+ messages just to stdout.
+
+ * mpz/inp_str.c, gmp-impl.h (__gmpz_inp_str_nowhite): New function,
+ and share a __gmp_free_func call.
+ * mpq/inp_str.c: New file.
+ * Makefile.am, mpq/Makefile.am: Add it.
+ * tests/mpq/t-inp_str.c: New file.
+ * tests/mpq/Makefile.am (check_PROGRAMS): Add it.
+
+ * configure.in, acconfig.h (HAVE_HOST_CPU_FAMILY_power,
+ HAVE_HOST_CPU_FAMILY_powerpc, HAVE_HOST_CPU_FAMILY_x86): AC_DEFINEs
+ for processor families.
+ * gmp-impl.h: Use them, rather than cpp defines.
+
+ * demos/Makefile.am (primes_LDADD): Use $(LIBM), for log().
+
+ * tune/many.pl, tune/Makefile.am: Fix some from clean and distclean.
+
+2001-08-26 Kevin Ryde <kevin@swox.se>
+
+ * tests/devel/try.c (ARRAY_ITERATION): Make types match on "?:" legs.
+ (TYPE_MPZ_JACOBI, TYPE_MPZ_KRONECKER): Remove some superseded code.
+
+ * tests/printf/t-printf.c (check_plain): Don't compare "all digits"
+ precision against plain printf.
+
+ * tune/Makefile.am: Eliminate empty TUNE_MPZ_SRCS.
+
+ * configure, config.in, INSTALL.autoconf: Update to autoconf 2.52.
+ * */Makefile.in, mdate-sh, missing, aclocal.m4, configure: Update to
+ automake 1.5.
+ * configfsf.guess, configfsf.sub: Update to 2001-08-23.
+
+2001-08-24 Torbjorn Granlund <tege@swox.com>
+
+ * demos/primes.c: Complete rewrite.
+
+2001-08-24 Kevin Ryde <kevin@swox.se>
+
+ * longlong.h: Test __ppc__ for apple darwin cc, reported by Jon
+ Becker. Also test __POWERPC__, PPC and __vxworks__.
+
+ * tune/speed.h (speed_cyclecounter) [x86]: Don't clobber ebx in PIC.
+
+2001-08-22 Kevin Ryde <kevin@swox.se>
+
+ * configure.in (x86 mmx): Correction to mmx path stripping.
+
+2001-08-17 Kevin Ryde <kevin@swox.se>
+
+ * configure.in, acinclude.m4, Makefile.am, printf/Makefile.am,
+ tests/printf/Makefile.am, gmp-h.in, gmp-impl.h, gmp.texi: Remove C++
+ support, for the time being.
+ * printf/doprntfx.cc, doprntix.cc, osfuns.cc, osmpf.cc, osmpq.cc,
+ osmpz.cc, tests/printf/t-ostream.cc: Remove files.
+
+ * printf/doprnt.c, printf/doprntf.c, gmp-impl.h: Use a single
+ __gmp_doprnt_mpf, rather than a separate ndigits calculation.
+ * printf/doprnt.c, printf/doprntf.c, gmp-impl.h, gmp.texi,
+ tests/printf/t-printf.c: Let empty or -1 prec mean all digits for mpf.
+ * printf/doprnt.c, tests/printf/t-printf.c: Accept h or l in %n; let
+ negative "*" style width mean left justify.
+
+ * gmp-impl.h, mpf/get_str.c (MPF_SIGNIFICANT_DIGITS): New macro,
+ extracted from mpf/get_str.c.
+
+ * libmp.sym: New file.
+ * Makefile.am (libmp_la_LDFLAGS): Use it.
+ (DISTCLEANFILES): Remove asm-syntax.h, no longer generated.
+ Remove some comments about "make check".
+
+ * demos/perl/GMP.pm, GMP.xs, GMP/Mpf.pm: Add printf and sprintf,
+ change get_str to string/exponent for floats, remove separate
+ mpf_get_str.
+ * demos/perl/GMP/Mpf.pm (overload_string): Use $# (default "%.g").
+ * demos/perl/typemap: Fix some duplicate string entries.
+ * demos/perl/test.pl: Update tests, split overloaded constants into ...
+ * demos/perl/test2.pl: ... this new file.
+ * demos/perl/Makefile.PL (clean): Add test.tmp.
+
+2001-08-16 Kevin Ryde <kevin@swox.se>
+
+ * printf/snprntffuns.c (gmp_snprintf_format): Correction to bufsize-1
+ return value handling.
+
+ * demos/calc/calc.y: Reposition "%{" so copyright notice gets into
+ generated files.
+
+ * INSTALL: Use gmp_printf.
+
+2001-08-14 Kevin Ryde <kevin@swox.se>
+
+ * mpz/inp_str.c: Fix return value (was 1 too big).
+ * tests/mpz/t-inp_str.c: New file.
+ * tests/mpz/Makefile.am: Add it.
+
+ * mpn/x86/pentium4/sse2/add_n.asm: New file.
+ * mpn/x86/pentium4/sse2/sub_n.asm: New file.
+ * mpn/x86/pentium4/sse2/mul_1.asm: New file.
+
+2001-08-12 Kevin Ryde <kevin@swox.se>
+
+ * printf/sprintffuns.c, printf/doprntf.c: Don't use sprintf return
+ value (it's a pointer on SunOS 4).
+
+ * acinclude.m4 (GMP_ASM_X86_SSE2, GMP_STRIP_PATH): New macros.
+ * configure.in: Add pentium4 support.
+ * mpn/x86/pentium4, mpn/x86/pentium4/mmx, mpn/x86/pentium4/sse2: New
+ directories.
+ * mpn/x86/README: Update.
+
+2001-08-10 Torbjorn Granlund <tege@swox.com>
+
+ * demos/pexpr.c (setup_error_handler): Catch also SIGABRT.
+
+2001-07-31 Kevin Ryde <kevin@swox.se>
+
+ * tests/refmpn.c (refmpn_mul_1c): Allow low to high overlaps.
+
+ * gmp-h.in, gmp-impl.h (_gmp_rand): Move prototype to gmp-impl.h.
+
+ * tune/Makefile.am (EXTRA_DIST): Add many.pl.
+
+2001-07-28 Kevin Ryde <kevin@swox.se>
+
+ * gmp.texi (Random Number Functions): Old rand functions no longer use
+ the C library.
+
+ * configure.in, acinclude.m4 (GMP_FUNC_VSNPRINTF): New macro.
+
+ * mpn/generic/get_str.c: Add an ASSERT for high limb non-zero.
+
+2001-07-24 Kevin Ryde <kevin@swox.se>
+
+ * gmp.texi (Build Options): Add --enable-cxx.
+ (Converting Floats): Note mpf_get_str only generates accurately
+ representable digits.
+ (Low-level Functions): Note mpn_get_str requires non-zero high limb.
+ (Formatted Output): New chapter.
+ (Multiplication Algorithms): Use @quotation with @multitable.
+ (Toom-Cook 3-Way Multiplication): Ditto.
+
+ * tests/memory.c (tests_free_nosize): New function.
+ * tests/tests.h (tests_allocate etc): Add prototypes.
+
+ * tests/printf: New directory.
+ * tests/printf/Makefile.am, t-printf.c, t-ostream.cc: New files.
+ * configure.in, tests/Makefile.am: Add them.
+
+ * configure.in, acinclude.m4 (GMP_PROG_CXX): New macro.
+ * configure.in (--enable-cxx): New option.
+ (AC_CHECK_HEADERS): Add locale.h and sys/types.h, remove unistd.h.
+ (AC_CHECK_TYPES): Add intmax_t, long double, long long, ptrdiff_t,
+ quad_t.
+ (AC_CHECK_FUNCS): Add localeconv, memset, obstack_vprintf, snprintf,
+ strchr, vsnprintf.
+ (AC_CHECK_DECLS): Add vfprintf.
+
+ * gmp-h.in, gmp-impl.h: Additions for gmp_printf etc.
+
+ * printf: New directory.
+ * printf/Makefile.am, asprintf.c, doprnt.c, doprntf.c, doprntfx.cc,
+ doprnti.c, doprntix.cc, fprintf.c, obprintf.c, obprntffuns.c,
+ obvprintf.c, osfuns.cc, osmpf.cc, osmpq.cc, osmpz.cc, printf.c,
+ printffuns.c, snprintf.c, snprntffuns.c, sprintf.c, sprintffuns.c,
+ vasprintf.c, vfprintf.c, vprintf.c, vsnprintf.c, vsprintf.c: New
+ files.
+ * configure.in, Makefile.am: Add them.
+
+ * configure.in (HAVE_INLINE): Remove AC_DEFINE, unused.
+ (AC_CHECK_TYPES): Don't test for void, assume it always exists.
+
+ * gmp-impl.h (__GMP_REALLOCATE_FUNC_MAYBE): New macro.
+ * mpz/get_str.c, mpq/get_str.c, mpf/get_str.c: Use it.
+
+ * gmp-impl.h (mpn_fib2_ui): Use __MPN.
+ (MPN_COPY_DECR): Fix an ASSERT.
+ (CAST_TO_VOID): Remove macro.
+
+ * gmp-h.in (mpq_out_str): Give #define even without prototype.
+ (mpz_cmp_d, mpz_cmpabs_d): Corrections to #defines.
+
+ * tests/devel/try.c: Add mpn_add and mpn_sub, don't use CAST_TO_VOID.
+
+2001-07-23 Torbjorn Granlund <tege@swox.com>
+
+ * config.guess: Recognize pentium4.
+ * config.sub: Recognize pentium4.
+
+2001-07-17 Kevin Ryde <kevin@swox.se>
+
+ * gmp-h.in (__GMPN_AORS_1): Remove x86 and gcc versions, leave just
+ one version.
+ (__GMPN_ADD, __GMPN_SUB): New macros, rewrite of mpn_add and mpn_sub.
+ (mpn_add, mpn_sub): Use them.
+ (__GMPN_COPY_REST): New macro.
+
+ * gmp-h.in, gmp-impl.h, acinclude.m4: Remove __GMP_ASM_L and
+ __GMP_LSYM_PREFIX, revert to ASM_L in gmp-impl.h and AC_DEFINE of
+ LSYM_PREFIX.
+
+2001-07-11 Kevin Ryde <kevin@swox.se>
+
+ * gmp-h.in (__GMPN_ADD_1 etc) [x86]: Don't use this on egcs 2.91.
+
+ * mpz/fits_uint.c, fits_ulong.c, mpz/fits_ushort.c: Split up fits_u.c.
+ * mpz/fits_u.c: Remove file.
+ * mpz/Makefile.am, macos/Makefile.in: Update.
+
+ * tests/refmpn.c,tests.h (refmpn_copy): New function.
+ * tests/devel/try.c (TYPE_ZERO): No return value from call.
+ (TYPE_MODEXACT_1_ODD, TYPE_MODEXACT_1C_ODD): Share call with
+ TYPE_MOD_1 and TYPE_MOD_1C.
+ (MPN_COPY, __GMPN_COPY, __GMPN_COPY_INCR): Add testing.
+
+2001-07-10 Kevin Ryde <kevin@swox.se>
+
+ * gmp-h.in (__GMPN_COPY): Add form to help gcc on power and powerpc.
+ * gmp-impl.h (MPN_COPY_INCR, MPN_COPY_DECR, MPN_ZERO): Ditto.
+ * mpn/powerpc64/copyi.asm, mpn/powerpc64/copyd.asm: Remove files.
+
+ * mpz/tdiv_ui.c: Eliminate some local variables (seems to save code on
+ i386 gcc 2.95.x), remove a bogus comment about quotient.
+
+ * errno.c, gmp-impl.h (__gmp_exception, __gmp_divide_by_zero,
+ __gmp_sqrt_of_negative): New functions.
+ * gmp-impl.h (GMP_ERROR, DIVIDE_BY_ZERO, SQRT_OF_NEGATIVE): Use them.
+
+ * randclr.c, randraw.c: Use ASSERT(0) for unrecognised algorithms.
+
+2001-07-07 Kevin Ryde <kevin@swox.se>
+
+ * configure.in (powerpc*-*-*): Use -no-cpp-precomp for Darwin.
+
+ * tests/mpbsd/t-itom.c: Renamed from t-misc.c.
+ * tests/mpbsd/t-misc.c: Remove file.
+ * tests/mpbsd/Makefile.am: Update.
+
+ * tests/mpf/t-set_si.c,t-cmp_si.c,t-gsprec.c: Split from t-misc.c.
+ * tests/mpf/t-misc.c: Remove file.
+ * tests/mpf/Makefile.am: Update.
+
+ * tests/mpz/t-oddeven.c,t-set_si.c,t-cmp_si.c: Split from t-misc.c.
+ * tests/mpz/t-misc.c: Remove file.
+ * tests/mpz/Makefile.am: Update.
+
+ * stack-alloc.c: Add some alignment ASSERTs.
+
+ * gmp-impl.h (MPN_NORMALIZE): Add notes on x86 repe/scasl slow.
+
+ * tests/devel/try.c (MPN_ZERO): Add testing.
+ * tune/speed.c,speed.h,common.c,many.pl (MPN_ZERO): Add measuring.
+
+ * mpn/x86/divrem_1.asm: Update a remark about gcc and "loop".
+
+ * tests/mpq/t-cmp_si.c: New file.
+ * tests/mpq/Makefile.am: Add it.
+
+ * tests/misc.c,tests.h (mpq_set_str_or_abort): New function.
+
+ * mpq/cmp_si.c: New file.
+ * Makefile.am, mpq/Makefile.am: Add it.
+ * gmp-h.in (mpq_cmp_si): Add prototype.
+ * gmp.texi (Comparing Rationals): Add doco.
+
+ * gmp-h.in (_GMP_H_HAVE_FILE): Add _FILE_DEFINED for microsoft, add
+ notes on what symbols are for what systems.
+
+2001-07-06 Torbjorn Granlund <tege@swox.com>
+
+ * longlong.h (ibm032 umul_ppmm): Fix typo.
+ * longlong.h (sparclite sdiv_qrnnd): Fix typo.
+
+2001-07-03 Kevin Ryde <kevin@swox.se>
+
+ * mpz/bin_ui.c (DIVIDE): Use MPN_DIVREM_OR_DIVEXACT_1.
+ * mpz/bin_uiui.c (MULDIV): Ditto, and use local variables for size and
+ pointer.
+
+ * acinclude.m4 (GMP_INCLUDE_GMP_H): New macro, use it everywhere gmp.h
+ is wanted at configure time.
+ * acinclude.m4, configure.in (GMP_H_EXTERN_INLINE, GMP_H_HAVE_FILE):
+ New macros.
+
+ * gmp-h.in (__GMP_EXTERN_INLINE): Set to "inline" for C++.
+ (mpn_add, mpn_sub): Use new style __GMP_EXTERN_INLINE.
+ * gmp-h.in, mp-h.in, gmp-impl.h (_EXTERN_INLINE): Remove, unused.
+ * mpn/generic/add.c, mpn/generic/sub.c: New files.
+ * mpn/generic/inlines.c: Remove file.
+ * configure.in, mpn/Makefile.am: Update.
+
+ * gmp.texi (GMP Basics): Note the need for stdio.h to get FILE
+ prototypes.
+
+2001-07-01 Kevin Ryde <kevin@swox.se>
+
+ * gmp.texi (Build Options, Reentrancy): Updates for new
+ --enable-alloca behaviour.
+ (Debugging): Describe --enable-alloca=debug.
+ (Miscellaneous Integer Functions): Note mpz_sizeinbase ignores signs.
+ (Low-level Functions): Give a formula for mpn_gcdext cofactor.
+ (Factorial Algorithm): New section.
+ (Binomial Coefficients Algorithm): New section.
+ Misc tweaks elsewhere.
+
+ * mpf/set_prc.c: Merge the two truncation conditionals, misc cleanups,
+ no functional changes.
+
+ * mpn/*/gmp-mparam.h (DIVEXACT_1_THRESHOLD): Add tuned values.
+ * gmp-impl.h (DIVEXACT_1_THRESHOLD): Make the default 0 when
+ 2*UMUL_TIME < UDIV_TIME.
+
+ * mpn/x86/p6/dive_1.asm: New file.
+
+ * mpn/x86/dive_1.asm: New file.
+ * mpn/x86/gmp-mparam.h (DIVEXACT_1_THRESHOLD): Use it always.
+
+ * tests/refmpn.c, tests.h (refmpn_zero): New function.
+ * tests/devel/try.c: Use it.
+
+ * tests/refmpn.c (refmpn_sb_divrem_mn): Use refmpn_cmp, not mpn_cmp.
+
+ * tests/mpf/t-get_d.c (main): Use || not |.
+
+ * tests/misc.c, tests/t-modlinv.c, tests/mpq/t-get_str.c,
+ tests/mpf/reuse.c: Add string.h.
+
+2001-06-29 Kevin Ryde <kevin@swox.se>
+
+ * tune/speed.h (SPEED_ROUTINE_MPN_FIB2_UI,
+ SPEED_ROUTINE_COUNT_ZEROS_C): Corrections to TMP block handling.
+
+ * gmp-impl.h (MPN_TOOM3_MUL_N_MINSIZE, MPN_TOOM3_SQR_N_MINSIZE):
+ Corrections to these to account for adding tD into E.
+ (MPN_INCR_U, MPN_DECR_U) [WANT_ASSERT]: Add size
+ assertions, since mpn_add_1 and mpn_sub_1 from gmp.h don't get them.
+ (MPN_DIVREM_OR_DIVEXACT_1): Add an assert of no remainder.
+
+ * assert.c: Add stdlib.h for abort prototype.
+ * tests/spinner.c, trace.c, t-constants.c, t-count_zeros.c,
+ t-gmpmax.c, t-modlinv.c: Ditto.
+ * tests/mpz/t-bin.c, t-cmp.c, t-get_si.c, t-misc.c, t-popcount.c,
+ t-set_str.c, t-sizeinbase.c: Ditto.
+ * tests/mpq/t-equal.c, t-get_str.c, t-set_f.c, t-set_str.c: Ditto.
+ * tests/mpf/t-fits.c, t-get_d.c, t-get_si.c, t-int_p.c, t-misc.c,
+ t-trunc.c: Ditto.
+ * tests/mpbsd/allfuns.c, t-misc.c: Ditto.
+
+ * mpn/generic/mul_n.c, mpz/cfdiv_r_2exp.c: Use MPN_INCR_U rather than
+ mpn_incr_u.
+
+ * tests/devel/try.c (TYPE_SB_DIVREM_MN): More fixes for calling method.
+
+ * mpn/x86/k6/cross.pl: More insn exceptions.
+
+2001-06-23 Kevin Ryde <kevin@swox.se>
+
+ * gmp-h.in (__GMPN_ADD_1, __GMPN_SUB_1) [i386]: Fix some asm output
+ constraints.
+
+ * gmp-impl.h (modlimb_invert): Mask after shifting, so mask constant
+ fits a signed byte.
+
+ * tests/devel/try.c (TYPE_SB_DIVREM_MN): Fix initial fill of quotient
+ with garbage.
+
+2001-06-20 Kevin Ryde <kevin@swox.se>
+
+ * config.guess (rs6000-*-aix4* | powerpc-*-aix4*): Suppress error
+ messages if $CC_FOR_BUILD or program don't work.
+
+ * mpz/sqrt.c,sqrtrem.c: Special case for op==0, to avoid TMP_ALLOC(0).
+ * tests/refmpf.c (refmpf_add, refmpf_sub): Avoid TMP_ALLOC(0).
+
+ * tests/mpn/t-aors_1.c: New file.
+ * tests/mpn/Makefile.am: Add it.
+
+ * gmp-h.in (__GMPN_ADD_1, __GMPN_SUB_1): New macros, rewrite of
+ mpn_add_1 and mpn_sub_1, better code for src==dst and/or n==1,
+ separate versions for gcc x86, gcc generic, and non-gcc.
+ (mpn_add_1, mpn_sub_1): Use them.
+ (mpn_add, mpn_sub): Ditto, to get inlines on all compilers.
+ (extern "C") [__cplusplus]: Let this encompass the extern inlines too.
+ * mpn/generic/add_1.c,sub_1.c: New files, force code from gmp.h.
+ * configure.in, mpn/Makefile.am: Add them.
+
+ * acinclude.m4 (GMP_ASM_LSYM_PREFIX): AC_SUBST __GMP_LSYM_PREFIX
+ rather than AC_DEFINE LSYM_PREFIX.
+ * gmp-h.in (__GMP_LSYM_PREFIX): New substitution.
+ (__GMP_ASM_L): New macro.
+ * gmp-impl.h (ASM_L): Use it.
+
+ * acinclude.m4, configure.in (GMP_C_ATTRIBUTE_MALLOC): New macro.
+ * gmp-impl.h: Use it for all the malloc based TMP_ALLOCs.
+
+ * stack-alloc.h: Remove file.
+ * tal-reent.c: New file.
+ * Makefile.am: Update.
+
+ * acinclude.m4, configure.in (GMP_OPTION_ALLOCA): New macro, add
+ malloc-reentrant method, use stack-alloc.c as malloc-notreentrant,
+ make "reentrant" the default.
+ * gmp-impl.h (__TMP_ALIGN): Moved from stack-alloc.c, use a union to
+ determine the value, and demand only 4 bytes align on 32-bit systems.
+ * gmp-impl.h (WANT_TMP_NOTREENTRANT): Move global parts of
+ stack-alloc.h to here, allow non power-of-2 __TMP_ALIGN in TMP_ALLOC.
+ * gmp-impl.h: Extend extern "C" to TMP_ALLOC declarations.
+ * stack-alloc.c (tmp_stack): Move private parts of stack-alloc.h to
+ here, use gmp-impl.h.
+
+ * gmp-impl.h (TMP_ALLOC_LIMBS_2): New macro.
+ * mpz/fib_ui.c, mpz/jacobi.c, mpq/cmp.c, mpn/generic/fib2_ui.c: Use it.
+
+ * mpfr/exp2.c: Patch by Paul to match TMP_MARK and TMP_FREE in loop.
+ * mpfr/sqrt.c: Scope nested TMP_DECL into nested { } block, patch by
+ Paul, tweaked by me.
+ * mpfr/agm.c: Ditto, and add a final TMP_FREE(marker2).
+
+ * gmp-h.in (mpn_cmp): Add __GMP_ATTRIBUTE_PURE.
+
+ * INSTALL: Clarify "make install", tweak formatting a bit.
+
+2001-06-17 Kevin Ryde <kevin@swox.se>
+
+ * configure.in, Makefile.am, gmp-impl.h: Add a debugging TMP_ALLOC,
+ selected with --enable-alloca=debug.
+ * tal-debug.c: New file.
+ * configure.in, Makefile.am: Compile stack-alloc.c only for
+ --disable-alloca.
+ * assert.c (__gmp_assert_header): New function, split from
+ __gmp_assert_fail.
+
+ * mpz/lcm.c: Don't TMP_MARK and then just return. Remove unnecessary
+ _mpz_realloc prototype.
+
+ * mpn/generic/mul.c (mpn_sqr_n): Use __gmp_allocate_func for toom3
+ temporary workspace.
+
+2001-06-15 Kevin Ryde <kevin@swox.se>
+
+ * tests/mpz/t-set_f.c: New file.
+ * tests/mpz/Makefile.am (check_PROGRAMS): Add it.
+
+ * mpz/set_f.c: Share MPN_COPY between pad and trunc cases, do exp<=0
+ test earlier, store SIZ(w) earlier.
+
+ * tests/t-count_zeros.c: New file.
+ * tests/t-gmpmax.c: New file.
+ * tests/Makefile.am (check_PROGRAMS): Add them.
+
+ * mp_clz_tab.c: Compile the table only if longlong.h says it's needed;
+ add an internal-use-only comment.
+ * tune/common.c: Force a __clz_tab for convenience when testing.
+
+ * mpn/x86/pentium/gmp-mparam.h, mpn/x86/pentium/mmx/gmp-mparam.h: Add
+ COUNT_LEADING_ZEROS_NEED_CLZ_TAB, for mod_1.asm.
+
+ * longlong.h (count_leading_zeros) [pentium]: Decide to go with float
+ method for p54.
+ (count_leading_zeros) [alpha]: Add COUNT_LEADING_ZEROS_NEED_CLZ_TAB.
+ (__clz_tab): Provide a prototype only if it's needed.
+
+ * tests/trace.c (mpz_trace): Don't use = on structures.
+ (mpn_trace): Set _mp_alloc when creating mpz.
+
+2001-06-12 Kevin Ryde <kevin@swox.se>
+
+ * mpn/x86/divrem_1.asm: Amend some comments about P5 speed.
+
+ * tune/README: Clarify reconfigure on gmp-mparam.h update.
+
+ * mpn/x86/p6/copyd.asm: New file.
+ * mpn/x86/p6/README: Update copyd and mod_1.
+ * mpn/x86/copyd.asm: Amend some comments.
+
+ * gmp-impl.h (__builtin_constant_p): Add dummy for non-gcc.
+ (mpn_incr_u, mpn_decr_u): Recognise incr==1 at compile time in the
+ generic code on gcc.
+
+ * gmp-impl.h (ASSERT_ZERO_P, ASSERT_MPN_NONZERO_P): New macros.
+ * mpn/generic/gcd_1.c, mpn/generic/mul_fft.c: Use them.
+ * mpz/get_d.c: Add a private mpn_zero_p.
+ * mpfr/trunc.c: Use own mpn_zero_p.
+ * tune/speed.h (SPEED_ROUTINE_MPN_GCD_1N): Use refmpn_zero_p.
+ * gmp-impl.h (mpn_zero_p): Remove, no longer needed.
+
+ * gmp-h.in, gmp-impl.h: Move MPN_CMP to gmp.h as __GMPN_CMP, leave an
+ MPN_CMP alias in gmp-impl.h.
+ * gmp-h.in (mpn_cmp): Add an inline version.
+ * mpn/generic/cmp.c: Use __GMP_FORCE_mpn_cmp to get code from gmp.h.
+
+ * acinclude.m4 (GMP_C_ATTRIBUTE_MODE): New macro.
+ * configure.in: Call it.
+ * gmp-impl.h (SItype etc): Use it.
+
+ * randraw.c (lc): Change mpn_mul_basecase->mpn_mul,
+ mpn_incr_u->MPN_INCR_U, abort->ASSERT_ALWAYS(0).
+
+ * longlong.h (count_leading_zeros) [pentiumpro]: Work around a partial
+ register stall on gcc < 3.
+
+ * gmp.texi (Introduction to GMP): Add IA-64.
+ (Notes for Particular Systems): i386 means generic x86.
+
+ * tests/t-modlinv.c: Use tests_start and tests_end.
+
+2001-06-10 Kevin Ryde <kevin@swox.se>
+
+ * gmp.texi (Number Theoretic Functions): mpz_jacobi only defined for b
+ odd. Separate the jacobi/legendre/kronecker descriptions.
+ (Low-level Functions): Document mpn_mul_1 "incr" overlaps.
+ (Language Bindings): New chapter.
+
+ * mpz/jacobi.c: Don't retaining old behaviour of mpz_jacobi on even b
+ (it wasn't documented in 3.1.1).
+ * mpz/jacobi.c, gmp-h.in (mpz_kronecker, mpz_legendre): Remove
+ separate entrypoints, just #define to mpz_jacobi.
+ * compat.c (__gmpz_legendre): Add compatibility entrypoint.
+
+ * mpn/generic/mul_1.c: Allow "incr" style overlaps.
+ * tests/devel/try.c (param_init): Test this.
+
+ * mpf/mul_ui.c: Do size==0 test earlier.
+
+2001-06-08 Kevin Ryde <kevin@swox.se>
+
+ * gmp-impl.h (ULONG_HIGHBIT, UINT_HIGHBIT, USHRT_HIGHBIT): Cast
+ ULONG_MAX etc to unsigned long etc before attempting to right shift.
+
+ * acinclude.m4 (GMP_ASM_LSYM_PREFIX): Add an AC_DEFINE of LSYM_PREFIX.
+ * gmp-impl.h (ASM_L): New macro.
+ (mpn_incr_u, mpn_decr_u, MPN_INCR_U, MPN_DECR_U): Add i386 optimized
+ versions.
+
+ * mpn/hppa/*.s,S,asm: Use .label so the code works with gas on hppa
+ GNU/Linux too, reported by LaMont Jones <lamont@smallone.fc.hp.com>.
+ * mpn/hppa/README: Add some notes on this.
+ * acinclude.m4 (GMP_ASM_LABEL_SUFFIX): Ditto.
+
+ * mpn/Makefile.am (nodist_libdummy_la_SOURCES): Add dive_1.c,
+ fib2_ui.c.
+
+ * tests/mpn/t-iord_u.c: New file.
+ * tests/mpn/Makefile.am (check_PROGRAMS): Add it.
+
+ * configure.in (mips*-*-irix[6789]*): Make ABI=n32 the default, same
+ as in gmp 3.1.
+ * gmp.texi (ABI and ISA): Update.
+
+ * gmp.texi (Build Options): Misc tweaks.
+ (Notes for Particular Systems): Describe windows DLL handling.
+ (Known Build Problems): DJGPP needs bash 2.04.
+ (Number Theoretic Functions): mpz_invert returns 0<=r<modulus; add
+ mpz_fib2_ui, mpz_lucnum_ui, mpz_lucnum2_ui.
+ (Fibonacci Numbers Algorithm): Update for new formulas used.
+ (Lucas Numbers Algorithm): New section.
+
+ * tune/speed.c,speed.h,common.c,many.pl: Add mpn_fib2_ui, mpz_fib2_ui,
+ mpz_lucnum_ui, mpz_lucnum2_ui.
+ * demos/expr/exprz.c,README: Add lucnum.
+ * demos/perl/GMP.pm,GMP.xs,GMP/Mpz.pm,test.pl: Add fib2, lucnum,
+ lucnum2.
+
+ * tests/mpz/t-lucnum_ui.c: New file.
+ * tests/mpz/Makefile.am (check_PROGRAMS): Add it.
+ * tests/mpz/t-fib_ui.c: Check mpz_fib2_ui too, updates for new style
+ MPN_FIB2_SIZE.
+
+ * tune/tuneup.c, tune/Makefile.am, gmp-impl.h, mpn/*/gmp-mparam.h:
+ Remove FIB_THRESHOLD, no longer required.
+
+ * mpz/fib2_ui.c, mpz/lucnum_ui.c mpz/lucnum2_ui.c: New files.
+ * Makefile.am, mpz/Makefile.am: Add them.
+ * gmp-h.in (mpz_fib2_ui, mpz_lucnum_ui, mpz_lucnum2_ui): Add
+ prototypes.
+
+ * mpn/generic/fib2_ui.c: New file.
+ * configure.in (gmp_mpn_functions): Add it.
+ * gmp-impl.h (mpn_fib2_ui, FIB_TABLE, etc): Add these.
+ * mpz/fib_ui.c: Rewrite.
+
+ * acinclude.m4 (GMP_C_SIZES): Fix _LONG_LONG_LIMB define for mp_limb_t
+ size test.
+ (GMP_FUNC_ALLOCA): Add dummy __GMP_BITS_PER_MP_LIMB for gmp-h.in work.
+
+ * configure.in (CPPFLAGS): Remove -D__GMP_WITHIN_GMP, don't want it
+ everywhere.
+ * Makefile.am, mpn/Makefile.am, mpz/Makefile.am, mpq/Makefile.am,
+ mpf/Makefile.am, mpbsd/Makefile.am (INCLUDES): Set -D__GMP_WITHIN_GMP.
+
+ * configure.in (*-*-msdosdjgpp*): Forcibly disable shared libraries,
+ to make libtests.la work.
+
+ * acconfig.h (_LONG_LONG_LIMB, HAVE_MPFR): Remove dummy defines, no
+ longer needed.
+
+ * mpz/set_ui.c: Store to _mp_d[0] unconditionally.
+
+2001-05-27 Kevin Ryde <kevin@swox.se>
+
+ * configure.in, gmp-h.in, mp-h.in: Add support for windows DLLs.
+
+2001-05-26 Kevin Ryde <kevin@swox.se>
+
+ * gmp.texi (ABI and ISA, Reentrancy): Minor tweaks
+ (Notes for Package Builds): Note gmp.h is a generated file.
+ (Notes for Particular Systems): -march=pentiumpro is used for gcc
+ 2.95.4 and up.
+ (Assembler Loop Unrolling): Mention non power-of-2 unrolling.
+ (Internals): New chapter.
+ * mpf/README: Remove file.
+
+ * demos/expr/README: Miscellaneous rewordings.
+
+ * demos/perl: New directory.
+ * demos/Makefile.am: Add it.
+ * demos/perl/INSTALL, Makefile.PL, GMP.pm, GMP.xs, typemap,
+ GMP/Mpz.pm, GMP/Mpq.pm, GMP/mpf.pm, GMP/Rand.pm, sample.pl, test.pl:
+ New files.
+
+ * configure, aclocal.m4: Update to autoconf 2.50.
+
+ * configure, aclocal.m4, ltmain.sh: Update to libtool 1.4.
+
+ * configure, aclocal.m4, missing, ansi2knr.c, */Makefile.in: Update to
+ automake 1.4f.
+ * Makefile.am: Conditionalize mpfr in $(SUBDIRS) to handle mpfr.info.
+ * mpfr/Makefile.am (INFO_DEPS): Remove previous mpfr.info handling.
+ * mpn/Makefile.am (GENERIC_SOURCES): Remove this, just put mp_bases.c
+ in libmpn_la_SOURCES.
+ * tests/Makefile.am (tests.h): Move from EXTRA_HEADERS to
+ libtests_la_SOURCES.
+ * ltconfig: Remove file, no longer needed.
+
+ * Makefile.am (gmp-impl.h, longlong.h, stack-alloc.h): Move from
+ EXTRA_DIST to libgmp_la_SOURCES, so they get included in TAGS.
+ * tests/rand/Makefile.am (gmpstat.h): Move to libstat_la_SOURCES
+ similarly.
+
+ * config.guess (68k-*-*): Use $SHELL not "sh", tweak some comments.
+
+ * mpfr/mpfr.texi (Introduction to MPFR): Tweak table formatting, note
+ non-free programs must be able to be re-linked.
+
+2001-05-20 Kevin Ryde <kevin@swox.se>
+
+ * mpn/powerpc64/addmul_1.asm, mpn/powerpc64/mul_1.asm,
+ mpn/powerpc64/submul_1.asm: Add carry-in entrypoints.
+
+2001-05-17 Kevin Ryde <kevin@swox.se>
+
+ * gmp.texi (ge): Fix definition for info.
+ (Notes for Particular Systems): Mention 68k dragonball and cpu32.
+ (Efficiency): Add static linking, more about in-place operations,
+ describe mpq+/-integer using addmul.
+ (Reporting Bugs): A couple of words about self-contained reports.
+ (Floating-point Functions): Note exponent limitations of mpf_get_str
+ and mpf_set_str.
+ (Initializing Floats): Clarify mpf_get_prec, mpf_set_prec and
+ mpf_set_prec_raw a bit.
+ (Float Comparison): Note current mpf_eq deficiencies.
+
+ * gmp-h.in (__GMP_HAVE_CONST, __GMP_HAVE_PROTOTYPES,
+ __GMP_HAVE_TOKEN_PASTE): Merge GNU ansidecl.h tests for ANSI compilers.
+ * demos/expr/expr-impl-h.in: Ditto.
+
+ * gmp-impl.h (BITS_PER_MP_LIMB): Define from __GMP_BITS_PER_MP_LIMB if
+ not already in gmp-mparam.h.
+ * tests/t-constants.c (BITS_PER_MP_LIMB, __GMP_BITS_PER_MP_LIMB):
+ Check these are the same.
+
+ * gmp-h.in (mpf_get_default_prec, mpf_get_prec, mpf_set_default_prec,
+ mpf_set_prec_raw): Provide "extern inline" versions, use __GMPF on the
+ macros.
+ * mpf/get_dfl_prc.c, mpf/get_prc.c, mpf/set_dfl_prc.c,
+ mpf/set_prc_raw.c: Get code from gmp.h using __GMP_FORCE.
+
+ * gmp-h.in, gmp-impl.h (__gmp_default_fp_limb_precision): Move from
+ gmp-impl.h to gmp-h.in.
+ (__GMPF_BITS_TO_PREC, __GMPF_PREC_TO_BITS): Ditto, and use __GMPF
+ prefix and add a couple of casts.
+ * gmp-h.in (__GMP_MAX): New macro.
+ * mpf/init2.c mpf/set_prc.c: Update for __GMPF prefix.
+
+ * gmp-h.in (__GMP_BITS_PER_MP_LIMB): New templated define.
+ * acinclude.m4 (GMP_C_SIZES): Add AC_SUBST __GMP_BITS_PER_MP_LIMB,
+ remove AC_DEFINE BITS_PER_MP_LIMB.
+
+2001-05-13 Kevin Ryde <kevin@swox.se>
+
+ * gmp-h.in, gmp.texi, Makefile.am, mpz/Makefile.am, tests/mpz/t-pow.c:
+ Remove mpz_si_pow_ui, pending full si support.
+ * mpz/si_pow_ui.c: Remove file.
+
+2001-05-11 Kevin Ryde <kevin@swox.se>
+
+ * mpn/x86/pentium/dive_1.asm: New file.
+
+ * mpn/powerpc32/umul.asm: Use r on registers.
+ * mpn/powerpc64/umul.asm: New file.
+ * configure.in (powerpc*-*-*): Enable umul in extra_functions.
+
+ * tests/refmpn.c, tests/tests.h (refmpn_umul_ppmm): Use same arguments
+ as normal mpn_umul_ppmm.
+ (refmpn_mul_1c): Update.
+ * tests/devel/try.c, tune/many.pl: Add some umul_ppmm testing support.
+
+ * mpn/x86/k6/mmx/popham.asm, mpn/x86/k7/mmx/popham.asm: Don't support
+ size==0.
+ * mpn/x86/pentium/popcount.asm, mpn/x86/pentium/hamdist.asm: Ditto,
+ and shave a couple of cycles from the PIC entry code.
+
+ * mpz/mul.c: Use mpn_mul_1 for size==1 and mpn_mul_2 (if available)
+ for size==2, to avoid copying; do vsize==0 test earlier.
+
+ * mpf/sub.c: Test r!=u before calling mpf_set.
+ * mpf/add.c: Ditto, and share mpf_set between usize==0 and vsize==0.
+
+ * mpn/generic/tdiv_qr.c, mpq/get_d.c, mpf/div.c, mpf/set_q.c,
+ mpf/set_str.c, mpf/ui_div.c: Test for high bit set, not for
+ count_leading_zeros zero.
+
+ * acinclude.m4 (GMP_PROG_AR, GMP_PROG_NM): Print a message if extra
+ flags are added.
+
+ * tests/mpz/t-mul_i.c: New file.
+ * tests/mpz/Makefile.am: Add it.
+
+ * mpz/mul_siui.c (mpz_mul_si): Fix for -0x80..00 on long long limb.
+
+ * gmp-h.in (mpf_set_si, mpf_set_ui): Revert last change, set exp to 0
+ when n==0.
+ * mpf/ceilfloor.c, mpf/trunc.c: Fix exp to 0 when setting r to 0.
+ * gmp-impl.h (MPF_CHECK_FORMAT): Check exp==0 when size==0.
+
+2001-05-07 Kevin Ryde <kevin@swox.se>
+
+ * gmp-h.in (mpf_set_si, mpf_set_ui): Don't bother setting _mp_exp to 0
+ when n==0 (use 1 unconditionally).
+ * tests/mpf/t-misc.c (check_mpf_set_si): Don't demand anything of
+ _mp_exp when _mp_size is zero.
+
+ * mpn/x86/README: Note gas _GLOBAL_OFFSET_TABLE_ with leal problem.
+
+ * gmp-h.in (mpz_fits_uint_p, mpz_fits_ulong_p, mpz_fits_ushort_p):
+ Provide these as "extern inline"s.
+ (__GMP_UINT_MAX, __GMP_ULONG_MAX, __GMP_USHRT_MAX): New macros.
+ (mpz_popcount): Use __GMP_ULONG_MAX.
+ * gmp-impl.h (UINT_MAX, ULONG_MAX, USHRT_MAX): Use __GMP_U*_MAX, if
+ not already defined.
+ * mpz/fits_u.c: Use the code from gmp.h.
+
+2001-05-06 Kevin Ryde <kevin@swox.se>
+
+ * mpn/x86/k7/dive_1.asm: New file.
+ * mpn/x86/k7/gcd_1.asm: New file.
+ * mpn/asm-defs.m4 (m4_count_trailing_zeros): New macro.
+
+ * gmp-h.in (mpz_get_ui, mpz_getlimbn, mpz_set_q, mpz_perfect_square_p,
+ mpz_popcount, mpz_size, mpf_set_ui, mpf_set_si, mpf_size): Provide
+ these as "extern inlines".
+ Use just one big extern "C" block.
+ * mpz/getlimbn.c, mpz/get_ui.c, mpz/perfsqr.c, mpz/popcount.c
+ mpz/set_q.c, mpz/size.c, mpf/set_si.c, mpf/set_ui.c, mpf/size.c: Use
+ __GMP_FORCE to get code from gmp.h.
+
+2001-05-03 Kevin Ryde <kevin@swox.se>
+
+ * extract-dbl.c: Add ASSERT d>=0.
+
+ * gmp.texi (Efficiency): Add mpz_addmul etc for mpz+=integer, add
+ mpz_neg etc in-place.
+ (Integer Arithmetic): Add mpz_addmul, mpz_submul, mpz_submul_ui.
+ (Initializing Rationals): Add mpq_set_str.
+ (Low-level Functions): mpn_set_str requires strsize >= 1.
+
+ * gmp-h.in (__GMP_EXTERN_INLINE, __GMP_ABS): New macros.
+ (mpz_abs, mpq_abs, mpf_abs, mpz_neg, mpq_neg, mpf_neg): Provide inline
+ versions.
+ * mpz/abs.c, mpq/abs.c, mpf/abs.c, mpz/neg.c, mpq/neg.c, mpf/neg.c:
+ Add suitable __GMP_FORCE to turn off inline versions.
+
+ * tests/mpz/t-aorsmul.c,t-cmp_d.c,t-popcount,t-set_str.c: New files.
+ * tests/mpz/Makefile.am: Add them.
+
+ * mpz/aorsmul_i.c: New file, rewrite of addmul_ui.c. Add
+ mpz_submul_ui entrypoint, share more code between some of the
+ conditionals, use mpn_mul_1c if available.
+ * mpz/addmul_ui.c: Remove file.
+ * mpz/aorsmul.c: New file.
+ * Makefile.am, mpz/Makefile.am: Update.
+ * gmp-h.in (mpz_addmul, mpz_submul, mpz_submul_ui): Add prototypes.
+ * gmp-impl.h (mpz_aorsmul_1): Add prototype.
+
+ * tests/mpq/t-set_str.c: New file.
+ * tests/mpq/Makefile.am: Add it.
+
+ * mpq/set_str.c: New file.
+ * Makefile.am, mpq/Makefile.am: Add it.
+ * gmp-h.in (mpq_set_str): Add prototype.
+
+ * mpz/set_str.c: Fix for trailing white space on zero, eg. "0 ".
+ * mpn/generic/set_str.c: Add ASSERT str_len >= 1.
+
+ * gmp-h.in, gmp-impl.h (mpn_incr_u, mpn_decr_u): Move to gmp-impl.h.
+ * gmp-impl.h (MPN_INCR_U, MPN_DECR_U): New macros.
+
+2001-04-30 Kevin Ryde <kevin@swox.se>
+
+ * tests/mpz/t-lcm.c: New file.
+ * tests/mpz/Makefile.am (check_PROGRAMS): Add it.
+
+ * mpz/lcm.c: Add one limb special case.
+
+ * mpz/lcm_ui.c: New file.
+ * Makefile.am, mpz/Makefile.am: Add it.
+ * gmp-h.in (mpz_lcm_ui): Add prototype.
+ * gmp.texi (Number Theoretic Functions): Add mpz_lcm_ui, document lcm
+ now always positive.
+
+ * mp-h.in (mp_size_t, mp_exp_t): Fix typedefs to match gmp-h.in.
+
+ * gmp-h.in (mpn_add_1, mpn_add, mpn_sub_1, mpn_sub): Remove K&R
+ function defines (ansi2knr will handle mpn/inline.c, and just ansi is
+ enough for gcc extern inline).
+
+ * gmp-h.in (__GMP_HAVE_TOKEN_PASTE): New macro.
+ (__MPN): Use it.
+ * gmp-impl.h (CNST_LIMB): Ditto.
+
+ * gmp-h.in, mp-h.in (__gmp_const, __gmp_signed, _PROTO, __MPN): Use
+ ANSI forms on Microsoft C.
+ (__GMP_HAVE_CONST): New define.
+ * gmp-impl.h (const, signed): Use it.
+
+ * demos/expr/expr-impl-h.in (<stdarg.h>): Use this with Microsoft C.
+ (HAVE_STDARG): New define.
+ * demos/expr/expr.c,exprz.c,exprq.c,exprf.c,exprfr.c: Use it.
+
+ * acinclude.m4 (GMP_C_STDARG): New macro.
+ * configure.in: Call it.
+ * rand.c: Use it.
+
+ * configure.in (AC_PROG_CC_STDC): New test.
+
+2001-04-25 Kevin Ryde <kevin@swox.se>
+
+ * mpn/x86/k6/mmx/dive_1.asm: New file.
+ * mpn/x86/x86-defs.m4 (Zdisp): Two more insns.
+
+ * mpn/x86/pentium/mul_2.asm: New file.
+ * mpn/asm-defs.m4: Add define_mpn(mul_2).
+ * acconfig.h (HAVE_NATIVE_mpn_divexact_1, mul_2): Add templates.
+
+ * configure.in (ABI): Use AC_ARG_VAR.
+
+ * tests/devel/try.c: Run reference function when validate fails.
+
+ * mpq/get_str.c: Fixes for negative bases.
+ * tests/mpq/t-get_str.c: Check negative bases.
+ * tests/misc.c,tests.h (__gmp_allocate_strdup, strtoupper): New
+ functions.
+
+2001-04-24 Torbjorn Granlund <tege@swox.com>
+
+ * mpz/lcm.c (mpz_lcm): Make result always positive.
+
+ * gmp-h.in (mpz_inp_binary, mpz_out_binary): Remove declarations.
+
+2001-04-22 Kevin Ryde <kevin@swox.se>
+
+ * mpn/powerpc64/addsub_n.asm: Use config.m4 not asm-syntax.m4.
+
+ * mpz/cmp_d.c, mpz/cmpabs_d.c: New files.
+ * Makefile.am, mpz/Makefile.am: Add them.
+ * mpf/cmp_d.c, mpf/get_dfl_prec.c: New files.
+ * Makefile.am, mpf/Makefile.am: Add them.
+ * gmp-h.in (mpz_cmp_d, mpz_cmpabs_d, mpf_cmp_d, mpf_get_default_prec):
+ Add prototypes.
+ * gmp.texi: Add documentation.
+
+ * mpf/set_prc.c: Avoid a realloc call if already the right precision.
+
+ * gmp-impl.h (MPF_BITS_TO_PREC, MPF_PREC_TO_BITS): New macros.
+ * mpf/get_prc.c, init2.c, set_dfl_prec.c, set_prc.c, set_prc_raw.c:
+ Use them.
+
+2001-04-20 Kevin Ryde <kevin@swox.se>
+
+ * tests/devel/try.c: Don't test size==0 on mpn_popcount and
+ mpn_hamdist; add testing for mpn_divexact_1; print some limb values
+ with mpn_trace not printf.
+
+ * mpz/popcount.c, mpz/hamdist.c: Don't pass size==0 to mpn_popcount
+ and mpn_hamdist.
+ * mpn/generic/popham.c: Don't support size==0.
+
+ * config.guess (m68k-*-*): Detect m68010, return m68360 for cpu32,
+ cleanup the nesting a bit.
+
+ * gmp.texi (Integer Division): Fix mpz_congruent_2exp_p "c" type.
+ (Integer Division): Add mpz_divexact_ui.
+ (Number Theoretic Functions): Fix mpz_nextprime return type.
+ (Exact Remainder): Divisibility tests now implemented.
+ And more index entries in a few places.
+
+ * tests/mpz/dive_ui.c: New file.
+ * tests/mpz/Makefile.am (check_PROGRAMS): Add it.
+
+ * mpz/dive_ui.c: New file.
+ * Makefile.am, mpz/Makefile.am: Add it.
+ * gmp-h.in (mpz_divexact_ui): Add prototype.
+
+ * tune/many.pl, tune/speed.h: Add special mpn_back_to_back for
+ development.
+
+ * gmp-impl.h (MPN_DIVREM_OR_DIVEXACT_1): New macro.
+ * mpz/divexact.c: Use it.
+
+ * gmp-impl.h (DIVEXACT_1_THRESHOLD): New threshold.
+ * tune/tuneup.c: Tune it.
+
+ * tune/speed.c,speed.h,common.c,many.pl: Add measuring of
+ mpn_divexact_1, mpn_copyi, mpn_copyd.
+
+ * mpn/generic/dive_1.c: New file.
+ * configure.in (gmp_mpn_functions): Add it.
+ * gmp-impl.h (mpn_divexact_1): Add prototype.
+ * mpn/asm-defs.m4: Add define_mpn(divexact_1).
+
+ * tests/mpn: New directory.
+ * tests/Makefile.am: Add it.
+ * tests/mpn/Makefile.am: New file.
+ * configure.in (AC_OUTPUT): Add it.
+ * tests/mpn/t-asmtype.c: New file.
+
+ * configure, config.in: Update to autoconf 2.49d.
+
+ * configure.in, gmp-h.in, mp-h.in, demos/expr/expr-impl-h.in: Revert
+ to generating gmp.h, mp.h and expr-impl.h with AC_OUTPUT and AC_SUBST.
+
+ * configure.in (m68*-*-*): Oops, m683?2 is 68000, m68360 is cpu32.
+ * mpn/m68k/m68k-defs.m4 (scale_available_p): Ditto.
+
+ * configure.in (underscore, asm_align): Remove these variables, unused.
+ (GMP_ASM_*): Sort by AC_REQUIREs, to avoid duplication.
+ * acinclude.m4 (GMP_ASM_UNDERSCORE, GMP_ASM_ALIGN_LOG): Remove support
+ for actions, no longer needed.
+
+2001-04-17 Kevin Ryde <kevin@swox.se>
+
+ * config.guess (m68k-*-*): Look for cpu in linux kernel /proc/cpuinfo.
+
+ * acinclude.m4 (GMP_GCC_MARCH_PENTIUMPRO): The -mpentiumpro problem is
+ fixed in 2.95.4, so test for that.
+ (GMP_ASM_TYPE): Amend some comments.
+
+ * tune/freq.c (speed_cpu_frequency_sysctl): Avoid having unused
+ variables on GNU/Linux.
+
+ * mpn/asm-defs.m4 (m4_instruction_wrapper): Fix a quoting problem if
+ the name of the file is a macro.
+
+2001-04-15 Kevin Ryde <kevin@swox.se>
+
+ * mpn/powerpc64/*.asm: Add speeds on ppc630.
+
+ * acconfig.h: Add dummy templates for _LONG_LONG_LIMB and HAVE_MPFR.
+ * configure.in: Ensure config.in is the last AM_CONFIG_HEADER,
+ which autoheader requires.
+
+ * mpn/x86/pentium/popcount.asm: New file.
+ * mpn/x86/pentium/hamdist.asm: New file.
+
+ * mpn/asm-defs.m4: (m4_popcount): New macro.
+ Amend a few comments elsewhere.
+
+ * acinclude.m4 (GMP_ASM_RODATA): If possible, grep compiler output for
+ the right directive.
+
+ * tune/speed.c: Print clock speed in MHz, not cycle time.
+
+ * configure.in (AC_CHECK_HEADERS): Check for sys/processor.h.
+ * tune/freq.c (speed_cpu_frequency_processor_info): Require
+ <sys/processor.h> to exist, to differentiate the different
+ processor_info on Darwin.
+ (speed_cpu_frequency_sysctlbyname): Remove hw.model test which is in
+ speed_cpu_frequency_sysctl.
+ (speed_cpu_frequency_sysctl): Add hw.cpufrequency for Darwin.
+
+ * gmp-impl.h (MPN_LOGOPS_N_INLINE, mpn_and_n ... mpn_xnor_n): Use a
+ single expression argument for the different operations, necessary for
+ the Darwin "smart" preprocessor.
+
+ * mpn/m68k/t-m68k-defs.pl: Allow white space in m4_definsn and
+ m4_defbranch.
+
+ * tune/many.pl: Change RM_TMP_S to RM_TMP to match mpn/Makeasm.am,
+ avoid a possibly undefined array in a diagnostic, add more renaming to
+ hamdist.
+
+2001-04-13 Kevin Ryde <kevin@swox.se>
+
+ * ltmain.sh, aclocal.m4, configure, config.in: Update to libtool 1.3d.
+ * configure.in: Change ac_ to lt_ in lt_cv_archive_cmds_need_lc and
+ lt_cv_proc_cc_pic.
+
+ * config.guess (m68*-*-*): Detect exact cpu with BSD sysctl hw.model,
+ detect 68000/68010 with trapf, detect 68302 with bfffo.
+
+2001-04-11 Kevin Ryde <kevin@swox.se>
+
+ * acinclude.m4 (GMP_ASM_M68K_INSTRUCTION, GMP_ASM_M68K_ADDRESSING,
+ GMP_ASM_M68K_BRANCHES): New macros.
+ * configure.in: Use them, remove old 68k configs, use mc68020 udiv and
+ umul.
+
+ * mpn/m68k/m68k-defs.m4: New file.
+ * mpn/m68k/t-m68k-defs.pl: New file.
+ * mpn/m68k/*.asm: New files, converted from .S. Merge add_n and sub_n
+ to aors_n, ditto mc68020 addmul_1 and submul_1 to aorsmul_1. No
+ object code changes (except .type and .size now used on NetBSD 1.4).
+ * mpn/m68k/README: New file.
+ * mpn/m68k/*.S, */*.S, syntax.h: Remove files.
+
+ * configure.in (m68*-*-netbsd1.4*): Pretend getrusage doesn't exist.
+ * tune/README: Update.
+
+ * configure.in (powerpc*-*-*): For the benefit of Darwin 1.3, add cc
+ to cclist, make gcc_cflags -Wa,-mppc optional.
+
+2001-04-06 Kevin Ryde <kevin@swox.se>
+
+ * mpn/lisp/gmpasm-mode.el (gmpasm-comment-start-regexp): Add | for 68k.
+ (gmpasm-mode-syntax-table): Add to comments.
+
+ * tests/mpz/reuse.c (dsi_div_func_names): Add names for cdiv_[qr]_2exp.
+
+2001-04-04 Kevin Ryde <kevin@swox.se>
+
+ * acinclude.m4 (GMP_M4_M4WRAP_SPURIOUS): Fix test so as to actually
+ detect the problem, add notes on m68k netbsd 1.4.1.
+
+ * gmp.texi (Compatibility with older versions): Note libmp
+ compatibility.
+
+2001-04-03 Kevin Ryde <kevin@swox.se>
+
+ * tests/mpz/reuse.c: Add mpz_cdiv_q_2exp and mpz_cdiv_r_2exp.
+
+ * tests/mpz/t-pow.c: Drag in refmpn.o when testing mpz_pow_ui etc with
+ refmpn_mul_2.
+
+ * tune/speed.c,speed.h,common.c,many.pl: Add measuring of mpn_com_n
+ and mpn_mul_2.
+ * tests/devel/try.c: Add testing of mpn_mul_2, and a
+ DATA_MULTIPLE_DIVISOR attribute.
+
+ * gmp.texi (Build Options): List more m68k's.
+ (Build Options): Add cross reference to tex2html.
+ (Notes for Particular Systems): Add m68k means 68020 or up.
+ (Rational Conversions): New section, with mpq_get_d, mpq_set_d and
+ mpq_set_f from Miscellaneous, and new mpq_set_str.
+ (Applying Integer Functions): Move mpq_get_num, mpq_get_den,
+ mpq_set_num and mpq_set_den from Misc.
+ (Miscellaneous Rational Functions): Remove section.
+ (Custom Allocation): Partial rewrite for various clarifications.
+ (References): Improve line breaks near URLs.
+
+ * acinclude.m4 (GMP_GCC_M68K_OPTIMIZE): New macro.
+ * configure.in (m68*-*-*): Use it to run gcc 2.95.x at -O not -O2.
+ (m680?0-*-*, m683?2-*-*, m68360-*-*): Add optional gcc -m options.
+
+ * tests/mpz/t-cmp.c: New file.
+ * tests/mpz/t-sizeinbase.c: New file.
+ * tests/mpz/Makefile.am: Add them.
+
+ * gmp-impl.h (MPN_CMP): New macro.
+ * mpz/cmp.c,cmpabs.c: Use it, and minor cleanups too.
+
+ * tests/mpq/t-equal.c: New file.
+ * tests/mpq/t-get_str.c: New file.
+ * tests/mpq/Makefile.am: Add them.
+
+ * mpq/get_str.c: New file.
+ * Makefile.am, mpq/Makefile.am: Add it.
+ * gmp-h.in (mpq_get_str): Add prototype.
+
+ * mpq/equal.c: Rewrite using inline compare loops.
+
+ * tests/refmpn.c,tests.h (refmpn_mul_2): Fix parameter order.
+ * mpz/n_pow_ui.c: Fix mpn_mul_2 calls parameter order.
+
+2001-03-29 Kevin Ryde <kevin@swox.se>
+
+ * tests/mpf/t-trunc.c: New file.
+ * tests/mpf/Makefile.am (check_PROGRAMS): Add it.
+ * gmp-impl.h (MPF_CHECK_FORMAT): New macro.
+
+ * mpf/trunc.c: New file, rewrite of integer.c, preserve prec+1 in
+ copy, don't copy if unnecessary.
+ * mpf/ceilfloor.c: New file likewise, and use common subroutine for
+ ceil and floor.
+ * mpf/integer.c: Remove file.
+ * Makefile.am, mpf/Makefile.am, macos/Makefile.in: Update.
+
+ * acinclude.m4 (GMP_GCC_VERSION_GE): New macro.
+ (GMP_GCC_MARCH_PENTIUMPRO): Use it, remove CCBASE parameter (don't
+ bother checking it's gcc).
+ (GMP_GCC_ARM_UMODSI): New macro.
+ * configure.in (GMP_GCC_MARCH_PENTIUMPRO): Update parameters.
+ (arm*-*-*): Use GMP_GCC_ARM_UMODSI.
+ * gmp.texi (Notes for Particular Systems): Add arm gcc requirements.
+
+2001-03-28 Kevin Ryde <kevin@swox.se>
+
+ * gmp.texi (Converting Integers): Document mpz_getlimbn using absolute
+ value and giving zero for N out of range, move to end of section.
+
+ * tests/refmpn.c (refmpn_tdiv_qr): Use refmpn_divmod_1 rather than
+ refmpn_divrem_1.
+ * tests/tests.h: Add some prototypes that were missing.
+
+ * mpz/tdiv_q_ui.c: Remove a comment that belonged to mpz_tdiv_r_ui.
+
+2001-03-26 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/generic/gcdext.c: Handle carry overflow after m*n multiply code
+ in both arms. Partially combine multiply arms.
+
+2001-03-24 Kevin Ryde <kevin@swox.se>
+
+ * longlong.h: Add comments to P5 count_leading_zeros.
+
+ * demos/expr/exprz.c,t-expr.c,README: Add congruent_p and divisible_p.
+
+2001-03-23 Kevin Ryde <kevin@swox.se>
+
+ * gmp.texi (GMPceil, GMPfloor, ge, le): New macros.
+ (Integer Division, mpn_cmp, mpn_sqrtrem, Algorithms): Use them.
+ (mpn_bdivmod): Refer to mp_bits_per_limb, not BITS_PER_MP_LIMB, and
+ improve formatting a bit.
+ (mpn_lshift, mpn_rshift): Clarify the return values, and use {rp,n}
+ for the destination.
+ Miscellaneous minor rewordings in a few places.
+
+ * mpn/arm/arm-defs.m4: New file.
+ * configure.in (arm*-*-*): Use it.
+ * mpn/arm/*.asm: Use changecom and registers from arm-defs.m4, use L()
+ for local labels.
+
+ * mpn/x86/k6/mmx/com_n.asm: Relax code alignment (same speed).
+
+ * gmp-h.in (__GMP_ATTRIBUTE_PURE): Use __pure__ to avoid application
+ namespace.
+
+ * gmp-impl.h (ABS): Add parens around argument.
+
+2001-03-20 Kevin Ryde <kevin@swox.se>
+
+ * acinclude.m4 (GMP_PROG_M4): Use AC_ARG_VAR on $M4.
+
+ * acinclude.m4 (GMP_M4_M4WRAP_SPURIOUS): New macro.
+ * configure.in: Use it.
+ * mpn/asm-defs.m4: Ditto.
+
+2001-03-18 Kevin Ryde <kevin@swox.se>
+
+ * mpn/x86/pentium/logops_n.asm: New file.
+
+ * mpn/x86/k6/k62mmx/copyd.asm: Rewrite, smaller and simpler, faster on
+ small sizes, slower on big sizes (about half the time).
+ * mpn/x86/k6/k62mmx/copyi.asm: Remove file, in favour of generic x86.
+ * mpn/x86/copyi.asm: Add some comments.
+ * mpn/x86/k6/README: Update.
+
+ * mpn/x86/k6/gcd_1.asm: New file.
+
+ * gmp-impl.h (NEG_MOD): Fix type of __dnorm.
+
+ * acinclude.m4 (GMP_C_SIZES): Fix use of __GMP_WITHIN_CONFIGURE.
+
+2001-03-15 Kevin Ryde <kevin@swox.se>
+
+ * gmp.texi (GMPabs): New macro.
+ (Float Comparison - mpf_reldiff): Use it.
+ (Integer Comparisons - mpz_cmpabs): Ditto, puts "abs" in info.
+ (Reentrancy): Update notes on old random functions.
+ (Karatsuba Multiplication): Better characterize the effect of basecase
+ speedups on the thresholds, pointed out by Torbjorn.
+
+ * tune/README: Notes on the 1x1 div threshold for mpn_gcd_1.
+
+ * tests/misc.c (mpz_pow2abs_p, mpz_flipbit, mpz_errandomb,
+ mpz_errandomb_nonzero, mpz_negrandom): New functions.
+ (mpz_erandomb, mpz_erandomb_nonzero): Use urandom().
+ * tests/spinner.c (spinner_wanted, spinner_tick): Make global.
+ * tests/tests.h: Update prototypes.
+
+ * tests/mpz/t-cong.c, tests/mpz/t-cong_2exp.c: New files.
+ * tests/mpz/Makefile.am (check_PROGRAMS): Add them.
+
+ * mpz/cong.c, mpz/cong_2exp.c, mpz/cong_ui.c: New files.
+ * Makefile.am, mpz/Makefile.am: Add them.
+ * gmp-impl.h (NEG_MOD): New macro.
+ * gmp-h.in (mpz_congruent_p, mpz_congruent_2exp_p,
+ mpz_congruent_ui_p): Add prototypes.
+ * gmp.texi (Integer Division, Efficiency): Add documentation.
+
+ * mpq/aors.c: No need for ABS on denominator sizes.
+
+ * gmp-impl.h (mpn_divisible_p): Use __MPN.
+
+ * gmp-impl.h (LOW_ZEROS_MASK): New macro.
+ * mpz/divis_ui.c, mpn/generic/divis.c: Use it.
+
+ * mpz/setbit.c: Fix normalization for case of a negative ending up
+ with a zero high limb.
+ * tests/mpz/bit.c (check_single): New test for this problem.
+
+ * configure.in (none-*-*): Fix cclist for default ABI=long.
+
+2001-03-10 Kevin Ryde <kevin@swox.se>
+
+ * mpz/cfdiv_q_2exp.c: Don't scan for non-zero limbs if they don't
+ matter to the rounding.
+
+ * mpz/get_ui.c: Fetch _mp_d[0] unconditionally, so the code can come
+ out branch-free.
+
+2001-03-08 Kevin Ryde <kevin@swox.se>
+
+ * tests/devel/try.c (param_init): Fix reference functions for and_n
+ and nand_n.
+
+ * tune/speed.c, tests/devel/try.c: Seed RANDS, not srandom etc.
+ * configure.in (AC_CHECK_FUNCS): Remove srand48 and srandom.
+ * macos/configure (coptions): Remove random/srandom, now unnecessary.
+
+ * configure.in (gmp.h, mp.h, demos/expr/expr-impl.h): Generate using
+ AM_CONFIG_HEADER.
+ (_LONG_LONG_LIMB, HAVE_MPFR): Change to AC_DEFINEs.
+ * gmp-h.in, mp-h.in, demos/expr/expr-impl-h.in: Change to #undef's.
+ * acinclude.m4 (GMP_FUNC_ALLOCA, GMP_C_SIZES): Use gmp-h.in, not gmp.h.
+ * Makefile.am (EXTRA_DIST): Remove gmp-h.in and mp-h.in, now done
+ automatically.
+ * acinclude.m4 (GMP_FUNC_ALLOCA), gmp-impl.h: Set and use
+ __GMP_WITHIN_CONFIGURE rather than GMP_FUNC_ALLOCA_TEST.
+
+ * mpf/random2.c: Use _gmp_rand and RANDS instead of random() for the
+ exponent, ensures full range of values too.
+
+ * tests/mpz/t-div_2exp.c (check_various): Start with d based on i, but
+ don't let it go negative.
+
+ * tune/tuneup.c (KARATSUBA_MUL_THRESHOLD): Limit probing to
+ TOOM3_MUL_THRESHOLD_LIMIT, the size of the workspace in mul_n.c.
+ Use a -1 with this too, so size<LIMIT not <=.
+
+2001-03-07 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/cray/cfp/mul_1.c: Don't call mpn_add_n with size 0.
+ * mpn/cray/cfp/addmul_1.c: Likewise.
+ * mpn/cray/cfp/submul_1.c: Don't call mpn_sub_n with size 0.
+
+ * tests/mpz/t-div_2exp.c (check_various): Start 2nd d loop from 0
+ (avoid problems with Cray compilers).
+
+2001-03-06 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/cray/ieee/submul_1.c: Don't call mpn_sub_n with size 0.
+
+ * mpn/cray/ieee/mul_basecase.c: New file.
+ * mpn/cray/ieee/sqr_basecase.c: New file, derived from mul_basecase.c.
+
+2001-03-06 Kevin Ryde <kevin@swox.se>
+
+ * tests/devel/try.c (pointer_setup): Allow dst_size == SIZE_SIZE2 for
+ the benefit of mpn_tdiv_qr.
+
+ * tune/tuneup.c (all): Start karatsuba probing at size==4, for the
+ benefit of cray t90 ieee which has speed oddities at size==2.
+
+ * gmp-impl.h (USE_LEADING_REGPARM): Use __GMP_GNUC_PREREQ.
+ Use __GMP_ATTRIBUTE_PURE and ATTRIBUTE_CONST in a few places.
+
+ * gmp-h.in (__GMP_GNUC_PREREQ) New macro.
+ (__GMP_ATTRIBUTE_PURE): New macro, use it in many places.
+
+ * gmp-impl.h, gmp-h.in (mpn_jacobi_base): Move prototype to
+ gmp-impl.h, use ATTRIBUTE_CONST.
+
+ * tune/speed.h (speed_cyclecounter): Inline asm version for i386.
+
+ * mpz/cfdiv_r_2exp.c (cfdiv_r_2exp): Only reread "up" after second
+ realloc, first is under w!=u.
+
+2001-03-05 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/cray/sub_n.c: Rewrite using `majority' logic.
+
+ * mpz/cfdiv_r_2exp.c (cfdiv_r_2exp): Reread `up' after realloc of w.
+
+ * mpn/cray/ieee/mul_1.c: Rewrite. Streamline multiplications;
+ use `majority' logic.
+ * mpn/cray/ieee/addmul_1.c: Likewise.
+
+ * mpn/cray/add_n.c: Rewrite using `majority' logic.
+
+2001-03-04 Torbjorn Granlund <tege@swox.com>
+
+ * longlong.h (CRAY udiv_qrnnd): No longer conditional on CRAYMPP.
+ (64-bit hppa add_ssaaaa): New.
+ (64-bit hppa sub_ddmmss): New.
+
+ * mpn/cray/ieee/invert_limb.c: New file.
+
+ * gmp-impl.h (RANDS): Add a `,0' to make it compile on more compilers.
+
+2001-03-03 Kevin Ryde <kevin@swox.se>
+
+ * mpz/n_pow_ui.c (ULONG_PARITY): Move to gmp-impl.h.
+ * gmp-impl.h (ULONG_PARITY): i386 part from n_pow_ui.c, new generic
+ form by Torbjorn.
+
+ * tests/mpz/t-div_2exp.c: New file, rewrite of t-2exp.c.
+ * tests/mpz/t-2exp.c: Remove file.
+ * tests/mpz/Makefile.am (check_PROGRAMS): Update.
+
+ * gmp-h.in (mpz_cdiv_q_2exp, mpz_cdiv_q_2exp): Add prototypes.
+ * gmp.texi (Integer Division): Add mpz_cdiv_q_2exp and mpz_cdiv_q_2exp.
+
+ * mpz/cfdiv_q_2exp.c: New file, partial rewrite of fdiv_q_2exp.c, add
+ mpz_cdiv_q_2exp entrypoint.
+ * mpz/cfdiv_r_2exp.c: New file, rewrite of fdiv_r_2exp.c, use all mpn,
+ add mpz_cdiv_r_2exp entrypoint.
+ * mpz/fdiv_q_2exp.c, mpz/fdiv_r_2exp.c: Remove files.
+ * mpz/Makefile.am (libmpz_la_SOURCES): Update.
+ * Makefile.am (MPZ_OBJECTS): Ditto.
+
+ * gmp-impl.h (USE_LEADING_REGPARM): Use __i386__ same as longlong.h
+ (REGPARM_2_1, REGPARM_3_1, REGPARM_ATTR): New macros.
+ * mpz/jacobi.c (jac_or_kron): Use them.
+
+ * configure.in (HAVE_ABI_$ABI): Re-enable this for config.m4, with
+ dots changed to underscores (necessary for hppa).
+
+ * tests/mpz/t-divis.c, tests/mpz/t-divis_2exp.c: New files.
+ * tests/mpz/Makefile.am (check_PROGRAMS): Add them.
+
+ * gmp-h.in (mpz_divisible_p, mpz_divisible_ui_p,
+ mpz_divisible_2exp_p): Add prototypes.
+ * gmp.texi (Integer Division): Add mpz_divisible_p.
+ (Efficiency): Add remarks about divisibility testing.
+
+ * mpz/divis.c, mpz/divis_ui.c, mpz/divis_2exp.c: New files.
+ * mpz/Makefile.am (libmpz_la_SOURCES): Add them.
+ * Makefile.am (MPZ_OBJECTS): Ditto.
+
+ * mpn/generic/divis.c: New file.
+ * configure.in (gmp_mpn_functions): Add it.
+ * mpn/Makefile.am (nodist_libdummy_la_SOURCES): Ditto.
+ * gmp-impl.h (mpn_divisible_p): Add prototype.
+
+ * urandom.h: Remove file.
+ * Makefile.am (EXTRA_DIST): Remove it.
+
+ * tests/mpz/convert.c, dive.c, io.c, logic.c, reuse.c, t-2exp.c,
+ t-fdiv.c, t-fdiv_ui.c, t-gcd.c, t-jac.c, t-mul.c, t-pow.c,
+ t-powm.c, t-powm_ui.c, t-root.c, t-sqrtrem.c, t-tdiv.c,
+ t-tdiv_ui.c: Use RANDS, initialized by tests_rand_start.
+
+ * tests/mpz/t-pow.c: New file, being t-pow_ui renamed and with some
+ further tests added.
+ * tests/mpz/t-pow_ui.c: Remove file.
+ * tests/mpz/Makefile.am (check_PROGRAMS): Update.
+
+ * tests/t-modlinv.c: Don't use urandom.h.
+ * tests/mpz/bit.c, tests/mpz/t-scan.c: Ditto.
+ * tests/mpq/t-cmp.c, tests/mpq/t-cmp_ui.c, tests/mpq/t-get_d.c: Ditto.
+ * tests/mpf/reuse.c, t-add.c, t-conv.c, t-dm2exp.c, t-muldiv.c,
+ t-sqrt.c, t-sub.c: Ditto.
+
+ * tests/misc.c (tests_rand_start, tests_rand_end): New functions.
+ (tests_start, tests_end): Use them.
+ (urandom): New function.
+ * tests/tests.h: Add prototypes.
+
+ * mpz/random.c: Rewrite using mpz_urandomb and RANDS.
+ * mpn/generic/random.c: Rewrite using _gmp_rand and RANDS.
+ * mpn/generic/random2.c: Use RANDS not random() etc.
+
+ * gmp-impl.h (__gmp_rands, __gmp_rands_initialized): Add externs.
+ (gmp_randstate_ptr): New typedef.
+ (RANDS, RANDS_CLEAR): New macros.
+
+ * rands.c: New file.
+ * Makefile.am (libgmp_la_SOURCES): Add it.
+
+ * configure.in (mpn_objs_in_libmp): New AC_SUBST.
+ * Makefile.am (libmp_la_DEPENDENCIES): Use it.
+
+2001-03-02 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/pa64/udiv_qrnnd.asm: New file.
+
+2001-03-01 Kevin Ryde <kevin@swox.se>
+
+ * mpbsd/rpow.c: New file.
+ * mpbsd/Makefile.am (libmpbsd_la_SOURCES): Add it
+ (nodist_libmpbsd_la_SOURCES): Remove pow_ui.c.
+ * Makefile.am (MPBSD_OBJECTS): Add rpow.lo, remove pow_ui.lo.
+ (libmp_la_DEPENDENCIES): Add mpz/n_pow_ui.lo.
+
+ * mpz/ui_pow_ui.c: Rewrite using mpz_n_pow_ui.
+ * mpz/pow_ui.c: Ditto, and no longer provide rpow for mpbsd.
+
+ * mpz/n_pow_ui.c: New file, rewrite of pow_ui.c and ui_pow_ui.c. Use
+ less temporary memory, strip factors of 2 from the base, use mpn_mul_2
+ if available.
+ * mpz/si_pow_ui.c: New file.
+ * mpz/Makefile.am (libmpz_la_SOURCES): Add them.
+ * Makefile.am (MPZ_OBJECTS): Ditto.
+ * gmp-impl.h (mpz_n_pow_ui): Add prototype.
+ * gmp-h.in (mpz_si_pow_ui): Add prototype.
+ * gmp.texi (Integer Exponentiation): Add mpz_si_pow_ui.
+
+ * acinclude.m4 (GMP_C_SIZES): Add BITS_PER_ULONG.
+ Correction to mp_limb_t working check.
+ * configure.in (limb_chosen): New variable.
+ * tests/t-constants.c (BITS_PER_ULONG): Check this value.
+ Add some reminders about tests that fail on Cray.
+
+ * tests/refmpn.c (refmpn_mul_2): New function.
+ * tests/refmpz.c (refmpz_pow_ui): Copied from tests/mpz/t-pow_ui.c
+ * tests/tests.h: Add prototypes.
+
+ * configure.in (none-*-*): Add ABI=longlong.
+ * doc/configuration (Long long limb testing): Describe it.
+
+ * gmp.texi (Low-level Functions): Move some commented out remarks ...
+ * mpn/generic/mul_basecase.c: ... to here.
+
+ * mpn/x86/README: Note "%=" as an alternative to "1:" in __asm__.
+
+ * tests/trace.c (mp_trace_start): Print "bin" for binary.
+
+ * mpn/generic/dump.c: Add a couple of casts to keep gcc quiet.
+
+ * gmp-h.in (mpn_incr_u, mpn_decr_u): Add parens around arguments.
+
+ * mpbsd/mout.c, mpbsd/mtox.c (num_to_text): Remove unused variable.
+
+ * mpfr/set_d.c (mpfr_get_d2): Declare "q" for 64-bit limbs.
+
+2001-02-28 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/pa64w/udiv_qrnnd.asm: Tune.
+
+2001-02-27 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/pa64w/udiv_qrnnd.asm: New file.
+
+2001-02-26 Torbjorn Granlund <tege@swox.com>
+
+ * longlong.h (arm): Optimize sub_ddmmss by testing for constant
+ operands.
+ * mpn/arm/invert_limb.asm: New file.
+
+2001-02-24 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/generic/lshift.c: Rewrite.
+ * mpn/generic/rshift.c: Rewrite.
+
+ * longlong.h: Use UWtype for external interfaces that expect mp_limb_t.
+
+ * longlong.h (arm): #define invert_limb.
+
+ * mpn/arm: Make labels have local scope.
+
+ * configure.in (arm*-*-*): Set extra_functions.
+ * longlong.h (arm): #define udiv_qrnnd.
+ * mpn/arm/udiv.asm: New file.
+
+2001-02-24 Kevin Ryde <kevin@swox.se>
+
+ * tune/many.pl: Add mpn_count_leading_zeros, mpn_count_trailing_zeros
+ and mpn_invert_limb. Add count_leading_zeros, count_trailing_zeros
+ from a .h file. Correction to modexact_1_odd prototype. Support
+ ansi2knr.
+ * tune/speed.h, tune/common.c: Consequent changes.
+
+ * demos/expr/*: Make a few more functions available in expressions,
+ create only libexpr.a, misc minor updates.
+
+ * mpn/Makeasm.am: Add some comments about suffix ordering.
+
+ * tests/refmpn.c (rshift_make, lshift_make): No need to compare
+ unsigned to zero.
+
+ * mpq/mul.c: Detect and optimize squaring.
+
+2001-02-23 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/mips3: Convert files to `.asm'.
+
+ * mpn/arm: Convert files to `.asm'. Misc cleanups.
+ * mpn/arm/submul_1.asm: New file.
+
+2001-02-21 Kevin Ryde <kevin@swox.se>
+
+ * tune/tuneup.c (all): Only one compiler print should match, no need
+ for #undef PRINTED_COMPILER.
+
+ * mpfr/mpfr.h (mpfr_sgn): Use mpfr_cmp_ui (patch from Paul).
+
+ * mpz/fib_ui.c: Update some remarks about alternative algorithms.
+ * gmp.texi (Fibonacci Numbers Algorithm): Ditto.
+ (Assigning Floats): Clarify mpf_swap swaps the precisions too.
+ (Low-level Functions): Try to be clearer about negative cofactors.
+
+2001-02-21 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/sparc64/copyi.asm: Streamline for small operands.
+ * mpn/sparc64/add_n.asm: Likewise.
+ * mpn/sparc64/sub_n.asm: Likewise.
+
+ * mpn/sparc64/copyd.asm: New file.
+
+2001-02-20 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/sparc64/lshift.asm: Rewrite.
+ * mpn/sparc64/rshift.asm: Rewrite.
+
+2001-02-19 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/sparc64/add_n.asm: Rewrite using `majority' logic.
+ * mpn/sparc64/sub_n.asm: Likewise.
+
+ * tune/tuneup.c (all): Recognise DECC and MIPSpro compilers.
+
+ * mpn/pa64/sqr_diagonal.asm: Use PROLOGUE/EPILOGUE.
+ * mpn/pa642/sqr_diagonal.asm: Likewise.
+
+ * configure.in (HAVE_ABI_$abi): Disable for now.
+
+ * mpn/asm-defs.m4 (PROLOGUE): Use LABEL_SUFFIX.
+
+ * acinclude.m4 (GMP_ASM_ATTR): New check, for hppa oddities.
+
+2001-02-18 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/hppa/hppa1_1/gmp-mparam.h: New file.
+ * mpn/hppa/hppa2_0/gmp-mparam.h: New file.
+
+ * mpn/pa64/sqr_diagonal.asm: New file.
+ * mpn/pa64w/sqr_diagonal.asm: New file.
+ * mpn/hppa/hppa1_1/sqr_diagonal.asm: New file.
+ * mpn/hppa/hppa2_0/sqr_diagonal.asm: New file.
+
+ * mpn/sparc32/v9/add_n.asm: Use `fitod' instead of `fxtod' for dummy
+ FA-pipeline insns.
+ * mpn/sparc32/v9/sub_n.asm: Likewise.
+
+2001-02-18 Kevin Ryde <kevin@swox.se>
+
+ * gmp.texi (Known Build Problems): Notes on make, $* and K&R, misc
+ tweaks elsewhere.
+ (Low-level Functions): Use {} notation in mpn_sqrtrem.
+ (Basecase Multiplication): Mention BASECASE_SQR_THRESHOLD.
+
+ * mpfr/isnan.c (mpfr_number_p): Infinity is not a number.
+ * mpfr/out_str.c: Pass strlen+1 for the block size to free.
+ * mpfr/get_str.c: Correction for realloc to strlen+1.
+
+ * acinclude.m4 (GMP_C_SIZES): Generate an error if mp_limb_t doesn't
+ seem to work for some reason.
+
+2001-02-16 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/sparc32/v9/gmp-mparam.h: Retune.
+
+ * mpn/sparc32/v9/add_n.asm: New file.
+ * mpn/sparc32/v9/sub_n.asm: New file.
+
+ * mpn/sparc32/v9/mul_1.asm: Tune function entry.
+ * mpn/sparc32/v9/addmul_1.asm: Likewise.
+ * mpn/sparc32/v9/submul_1.asm: Likewise.
+
+ * mpn/sparc32/v9/sqr_diagonal.asm: New file.
+
+2001-02-16 Kevin Ryde <kevin@swox.se>
+
+ * configure.in: Fix flags selection when $CC is a compiler known to us.
+
+ * demos/expr/exprfr.c (e_mpfr_cos, e_mpfr_sin): mpfr_sin_cos now
+ allows NULL for one parameter.
+
+ * mpfr/*: Update to 20010215.
+ * mpfr/trunc.c: Use -DOPERATION scheme, and gmp mpn_zero_p.
+ * mpfr/sqrt.c: Use plain mpn_sqrtrem, not mpn_sqrtrem_new.
+ * mpfr/sqrtrem.c: Remove file.
+ * mpfr/Makefile.am (libmpfr_a_SOURCES): Add isnan.c and set_ui.c,
+ remove sqrtrem.c and srandom.h.
+
+ * configfsf.guess: Update to 2001-02-13.
+ * configfsf.sub: Update to 2001-02-16.
+ * config.sub (j90, t90): Remove special handing, configfsf.sub now ok.
+
+ * Makefile.am (MPF_OBJECTS): Add a couple of missing $U's.
+
+ * tune/tuneup.c: Identify compiler used (GCC and Sun C so far).
+
+2001-02-15 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/sparc32/v9/mul_1.asm: Change `ld' to `lduw' and `st' to `stw'.
+ * mpn/sparc32/v9/addmul_1.asm: Likewise.
+ * mpn/sparc32/v9/submul_1.asm: Likewise.
+
+2001-02-14 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/mips3/mips.m4: New file.
+ * configure.in (mips*-*-irix[6789]*): Use mips3/mips.m4.
+
+ * mpn/powerpc64/sqr_diagonal.asm: New file.
+
+ * mpn/mips3/sqr_diagonal.asm: New file.
+
+2001-02-12 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/powerpc32/sqr_diagonal.asm: New file.
+
+ * mpn/generic/sqr_basecase.c: Remove declaration of mpn_sqr_diagonal.
+ Fix typo in header comment.
+
+2001-02-12 Kevin Ryde <kevin@swox.se>
+
+ * mpn/generic/mul.c, mpn/generic/mul_n.c, gmp-impl.h: Use
+ mpn_mul_basecase for squaring below new BASECASE_SQR_THRESHOLD.
+ * tune/tuneup.c gmp-impl.h: Tune BASECASE_SQR_THRESHOLD.
+
+ * Makefile.am (libgmp.la, libmp.la): Revert change to build from
+ mpn/libmpn.la etc, go back to explicitly listed objects.
+
+ * configure.in: Recognise sparc64-*-*, not just sparc64-*-linux*.
+
+2001-02-11 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/asm-defs.m4 (sqr_diagonal): New define_mpn.
+
+ * mpn/alpha/sqr_diagonal.asm: New file.
+
+2001-02-11 Kevin Ryde <kevin@swox.se>
+
+ * gmp.texi (Low-level Functions): Note mpn_get_str clobbers its input
+ plus 1 extra limb.
+
+ * mpfr/add.c,agm.c,exp2.c,exp3.c,generic.c,log2.c,pi.c,print_raw.c,
+ set_d.c,sin_cos.c,sqrtrem.c,sub.c: Apply some tweaks for K&R.
+ * tests/mpz/reuse.c, tests/mpq/t-md_2exp.c, demos/pexpr.c,
+ demos/expr/t-expr.c: Ditto.
+
+ * configure.in (HAVE_ABI_$abi): New define in config.m4.
+
+ * gmp-impl.h (mpn_sqr_diagonal): Add prototype and define.
+ * tune/speed.c,speed.h,common.c,many.pl: Add measuring of
+ mpn_sqr_diagonal.
+
+ * gmp.texi, acinclude.m4: Mention x86 solaris 2.7 has the reg->reg
+ movq bug the same as 2.6.
+
+ * mpfr/Makefile.am (EXTRA_DIST): Add mpfr-test.h and mpf2mpfr.h.
+
+ * mpn/x86/README: Merge contents of README.family.
+ * mpn/x86/README.family: Remove file.
+
+ * mpn/Makefile.am (nodist_libdummy_la_SOURCES): Add mode1o, gcd_finda,
+ invert_limb, sqr_diagonal; remove mod_1_rs; sort alphabetically.
+
+2001-02-10 Torbjorn Granlund <tege@swox.com>
+
+ * configure.in (gmp_mpn_functions_optional): List sqr_diagonal.
+
+ * mpn/powerpc32/aix.m4: Use unnamed csects.
+ * mpn/powerpc64/aix.m4: Likewise.
+
+ * acconfig.h: Add #undef of mpn_sqr_diagonal.
+ Remove lots of spacing.
+
+ * configure.in (syntax testing section): Match power* instead of
+ powerpc*.
+ * mpn/power: Convert files to `.asm'.
+ Prefix umul_ppmm and sdiv_qrnnd.
+ Update some comments.
+
+2001-02-09 Kevin Ryde <kevin@swox.se>
+
+ * acconfig.h: Add HAVE_NATIVE_mpn_modexact_1_odd and
+ HAVE_NATIVE_mpn_modexact_1c_odd.
+
+ * configure.in (CCAS): Don't override a user selection.
+
+ * mpq/cmp_ui.c: DIVIDE_BY_ZERO if den2==0.
+
+2001-02-08 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/generic/sqr_basecase.c: Use mpn_sqr_diagonal when appropriate.
+
+2001-02-07 Kevin Ryde <kevin@swox.se>
+
+ * gmp.texi (Low-level Functions): mpn_preinv_mod_1 now undocumented.
+
+ * mpn/generic/random2.c (myrandom): Use rand() on mingw.
+
+ * mpn/alpha/gmp-mparam.h: Update tuned parameters.
+
+2001-02-05 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/alpha/ev6/gmp-mparam.h: Retune.
+
+2001-02-05 Kevin Ryde <kevin@swox.se>
+
+ * Makefile.am (libgmp, libmp): Construct from mpn/libmpn.la etc rather
+ than explicitly listed objects.
+
+ * urandom.h: Use rand() on mingw.
+
+ * mpn/powerpc64/lshift.asm,addsub_n.asm: Use r1 not 1.
+
+2001-02-04 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/ia64/copyi.asm: New file.
+ * mpn/ia64/copyd.asm: New file.
+
+2001-02-04 Kevin Ryde <kevin@swox.se>
+
+ * mpn/alpha/ev5/gmp-mparam.h, mpn/mips3/gmp-mparam.h,
+ mpn/powerpc32/gmp-mparam.h, mpn/powerpc64/gmp-mparam.h,
+ mpn/sparc64/gmp-mparam.h, mpn/x86/*/gmp-mparam.h:
+ Update tuned parameters.
+
+ * mpn/x86/i486: New directory.
+ * configure.in (i486-*-*): Use it.
+ * mpn/x86/i486/gmp-mparam.h: New file.
+
+ * mpn/x86/pentium/mode1o.asm: New file.
+ * mpn/x86/p6/mode1o.asm: New file.
+
+ * tune/many.pl: Use $(ASMFLAGS_PIC) and $(CFLAGS_PIC).
+
+ * gmp.texi (Integer Division): Another rewording of 2exp divisions.
+
+2001-02-03 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/arm/gmp-mparam.h: Tune.
+
+ * mpn/ia64/popcount.asm: Put a `;;' break at end of main loop.
+
+ * configure.in (arm*-*-*): Set gcc_cflags in order to pass
+ $fomit_frame_pointer.
+
+ * tests/mpz/t-mul.c (base_mul): Remove an unused variable.
+
+2001-02-02 Torbjorn Granlund <tege@swox.com>
+
+ * demos/pexpr.c (TIME): New macro.
+ (main): Use TIME--print timing more accurately.
+ (setup_error_handler): Increase RLIMIT_DATA to 16 Mibyte.
+
+ * longlong.h (arm): Add __CLOBBER_CC to add_ssaaaa and sub_ddmmss.
+
+2001-02-02 Kevin Ryde <kevin@swox.se>
+
+ * configure.in: Don't remove gmp-mparam.h and mpn source links under
+ --no-create since in that case they're not re-created.
+
+ * demos/expr: New directory.
+ * Makefile.am (SUBDIRS, allprogs): Add it.
+ * demos/expr/README, Makefile.am, expr.c, exprv.c, exprz.c, exprza.c,
+ exprq.c, exprqa.c, exprfa.c, exprf.c, exprfr.c, exprfra.c, expr.h,
+ expr-impl-h.in, run-expr.c, t-expr.c: New files.
+ * configure.in: Generate demos/expr/Makefile & demos/expr/expr-impl.h.
+
+ * Makefile.am: Remove mpfr from main libgmp.
+ * mpfr/Makefile.am: Build and install separate libmpfr.a.
+ * mpfr/*: Update to mpfr 2001.
+
+ * gmp-h.in (__GNU_MP_VERSION_MINOR): Bump to 2.
+ * Makefile.am (libtool -version-info): Bump appropriately.
+ * NEWS: Updates.
+
+ * tune/divrem1div.c, tune/divrem1inv.c, tune/divrem2div.c,
+ tune/divrem2inv.c: Renamed from divrem_1_div.c, divrem_1_inv.c,
+ divrem_2_div.c, divrem_2_inv.c, to be unique in DOS 8.3 filenames.
+ * tune/Makefile.am (libspeed_la_SOURCES): Update.
+
+ * mpn/x86/*/README, mpn/x86/README.family: Misc updates.
+ * tune/README: Misc updates.
+ * doc/configuration: Misc updates.
+
+ * mpn/x86/pentium/mmx/gmp-mparam.h: Change UDIV_PREINV_TIME to
+ UDIV_NORM_PREINV_TIME.
+
+ * mpz/pprime_p.c: Use ASSERT_ALWAYS instead of abort.
+
+ * rand.c (__gmp_rand_lc_scheme): Add "const".
+ (struct __gmp_rand_lc_scheme_struct): Make astr "const char *".
+
+ * demos/calc/calc.y, demos/calc/calclex.l: Add kron function.
+
+ * tests/devel/try.c: Partial rewrite, new scheme of function types,
+ allow result validation functions, add sqrtrem and jacobi testing.
+ * tune/many.pl: Corresponding updates.
+ * tests/devel/Makefile.am: Add a convenience rule for libtests.la.
+
+ * tests/refmpz.c: New file.
+ * tests/Makefile.am: Add it.
+ * tests/misc.c (mpz_erandomb, mpz_erandomb_nonzero): New functions.
+ * tests/tests.h: Add prototypes.
+
+ * mpn/x86/k6/cross.pl: Add a couple more exceptions.
+
+ * gmp.texi: Don't use @nicode{'\0'}, it doesn't come out right in tex.
+ (Introduction to GMP): Mention Cray vector systems.
+ (Build Options): Describe --enable-mpfr, refer to its manual. Add
+ Crays under supported CPUs.
+ (Debugging): Add notes on source file paths.
+ (Autoconf): New section.
+ (Assigning Integers): Note truncation by mpz_set_d, mpz_set_q and
+ mpz_set_f.
+ (Converting Integers): Note the size mpz_get_str allocates.
+ (Floating-point Functions): Rewrite introduction, clarifying some
+ points about precision handling.
+ (Converting Floats): Note the size mpf_get_str allocates, and that it
+ gives an empty string for zero. Add mpf_get_si and mpf_get_ui.
+ (Float Comparison): Give the formula mpf_reldiff calculates.
+ (Miscellaneous Float Functions): Add mpf_integer_p and mpf_fits_*_p.
+ (Random Number Functions): Misc rewordings for clarity.
+ (Random State Initialization): Ditto.
+ (Custom Allocation): Remove note on deallocate_function called with 0,
+ misc rewording and clarifications.
+ (Exact Remainder): New section.
+ (Binary GCD): A few words on initial reduction using division.
+ (Accelerated GCD): Refer to exact remainder section.
+ (Extended GCD): Extra remarks on single versus double selection.
+ (Jacobi Symbol): Update for mpz/jacobi.c rewrite and modexact_1_odd.
+ (Modular Powering Algorithm): Refer to exact remainder section.
+ (Assembler SIMD Instructions): Update remarks on MMX.
+ (Contributors): Amend to "Divide and Conquer" division.
+ (References): Tweak some formatting. Add "Proof of GMP Fast Division
+ and Square Root Implementations" by Paul Zimmermann.
+
+2001-01-31 Torbjorn Granlund <tege@swox.com>
+
+ * configure.in: Don't ever pass -mips3; let ABI flags imply ISA.
+
+2001-01-31 Kevin Ryde <kevin@swox.se>
+
+ * tune/time.c: Remove unnecessary longlong.h.
+ (speed_endtime): Add some extra diagnostics.
+
+ * tests/mpz/t-fdiv_ui.c, tests/mpz/t-tdiv_ui.c: Use unsigned long for
+ the divisor, not mp_limb_t.
+ * tests/mpz/t-jac.c (try_base): Use %llu for long long limb.
+ * tests/trace.c: Add <string.h> for strlen.
+
+ * tune/freq.c (speed_cpu_frequency_proc_cpuinfo): Ignore "cycle
+ frequency" of 0, allow "BogoMIPS" as well as "bogomips".
+
+ * macos/Makefile.in: Add mpf/fits_s.c and mpf/fits_u.c objects.
+
+2001-01-30 Torbjorn Granlund <tege@swox.com>
+
+ * longlong.h: Add add_ssaaaa and sub_ddmmss for 64-bit sparc.
+
+2001-01-29 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/powerpc64/addmul_1.asm: Prefix registers with an `r'.
+ * mpn/powerpc64/submul_1.asm: Likewise.
+ * mpn/powerpc64/mul_1.asm: Likewise.
+
+ * configure.in (alpha*-*-*): Amend last change to handle pca*.
+
+2001-01-29 Kevin Ryde <kevin@swox.se>
+
+ * tune/speed.h (SPEED_ROUTINE_INVERT_LIMB_CALL): Don't let the
+ compiler optimize everything away.
+
+ * tune/speed.c, tune/speed.h, tune/common.c, tune/Makefile.am: Measure
+ operator_div, operator_mod, mpn_divrem_2_div, mpn_divrem_2_inv,
+ mpn_sb_divrem_m3, mpn_sb_divrem_m3_div, mpn_sb_divrem_m3_inv,
+ mpn_dc_divrem_sb_div, mpn_dc_divrem_sb_inv.
+ * tune/divrem_2_div.c, tune/divrem_2_inv.c, tune/sb_div.c,
+ tune/sb_inv.c: New files.
+
+ * tune/tuneup.c, gmp-impl.h, tune/speed.h, tune/common.c,
+ tune/Makefile.am: Tune SB_PREINV_THRESHOLD and DIVREM_2_THRESHOLD.
+
+ * mpn/generic/divrem_2.c: Use new DIVREM_2_THRESHOLD.
+ * mpn/generic/sb_divrem_mn.c: Use new SB_PREINV_THRESHOLD.
+
+ * mpn/x86/p6/mmx/lshift.asm, mpn/x86/p6/mmx/rshift.asm: New files,
+ just m4 include()ing the P55 code.
+ * configure.in (pentium[23]-*-*): Remove x86/pentium/mmx from path.
+
+2001-01-27 Kevin Ryde <kevin@swox.se>
+
+ * configure.in (AC_CHECK_FUNCS): Add srand48.
+ * tune/speed.c: Use this test.
+
+ * acinclude.m4 (GMP_GCC_MARCH_PENTIUMPRO): Allow "egcs-" prefix on gcc
+ --version, warn if the format is unrecognised.
+ (GMP_COMPARE_GE): Guard against empty $1 not only on last arg.
+ (GMP_INIT, GMP_FINISH, GMP_PROG_M4): Obscure or eliminate literal
+ "dnl"s since autoconf thinks they indicate faulty macros.
+
+ * mpz/get_str.c, mpf/get_str.c: Make allocated string block exactly
+ strlen(str)+1 bytes.
+ * mpz/dump.c, mpf/dump.c, tests/mpz/convert.c: Use this size when
+ freeing.
+ * tests/mpf/t-conv.c: Ditto, and ensure x==0 is exercised.
+
+ * tests/mpz/t-fits.c: New file.
+ * tests/mpz/Makefile.am: Add it.
+
+ * tests/mpf/t-fits.c: New file.
+ * tests/mpf/t-get_si.c: New file.
+ * tests/mpf/t-int.c: New file.
+ * tests/mpf/Makefile.am: Add them.
+
+ * mpf/fits_s.c: New file.
+ * mpf/fits_u.c: New file.
+ * mpf/get_si.c: New file.
+ * mpf/get_ui.c: New file.
+ * mpf/int_p.c: New file.
+ * Makefile.am, mpf/Makefile.am: Add them.
+ * gmp-h.in (mpf_fits_*_p, mpf_get_si, mpf_get_ui, mpf_integer_p): Add
+ prototypes.
+
+ * tests/memory.c (tests_allocate, tests_reallocate): Guard against
+ size==0.
+
+ * tests/mpz/*.c, tests/mpq/*.c, tests/mpf/*.c: Uses tests_start and
+ tests_end.
+
+ * gmp-impl.h (USE_LEADING_REGPARM): Fix conditionals.
+
+2001-01-23 Kevin Ryde <kevin@swox.se>
+
+ * configure.in, mpn/Makeasm.am (ASMFLAGS_PIC): New substitution,
+ allowing -DPIC to be suppressed on cygwin.
+ (CFLAGS_PIC): New substitution, use it and $(CCAS) directly, rather
+ than $(LIBTOOL), avoiding a problem with FreeBSD 2.2.8.
+
+ * mpn/x86/k6/mode1o.asm, mpn/x86/k7/mode1o.asm: Remove an unnecessary
+ +[.-L(here)] from _GLOBAL_OFFSET_TABLE_, avoids a segv from gas 1.92.3.
+ * mpn/x86/README.family: Add notes on the problem.
+
+2001-01-20 Torbjorn Granlund <tege@swox.com>
+
+ * configure.in (alpha*-*-*): Default `flavour' to ev4.
+
+2001-01-19 Kevin Ryde <kevin@swox.se>
+
+ * assert.c, gmp-impl.h (__gmp_assert_fail): Change return type to
+ void, since it's no longer used in expressions.
+
+ * mpn/x86/addsub_n.S: Remove file, since it doesn't work and it upsets
+ tune/many.pl.
+
+ * mpz/jacobi.c: Rewrite, but still binary algorithm; accept zero and
+ negative denominators; merge mpz_jacobi and mpz_legendre, add
+ mpz_kronecker; use mpn directly, add special cases for size==1.
+ * gmp.texi (Number Theoretic Functions): Update.
+ * gmp-h.in (mpz_kronecker): Add prototype.
+ * gmp-impl.h (USE_LEADING_REGPARM): New macro.
+ * tests/mpz/t-jac.c: Test mpz_kronecker.
+ * mpz/legendre.c: Remove file.
+ * Makefile.am, mpz/Makefile.am: Update.
+
+ * longlong.h (alpha count_leading_zeros): Use __attribute__ ((const))
+ when possible, add parameter to prototype.
+ (ia64 udiv_qrnnd): Use for all compilers, not just gcc.
+ (pentium count_trailing_zeros): Use count_leading_zeros.
+
+ * acinclude.m4 (GMP_C_ATTRIBUTE_CONST, GMP_C_ATTRIBUTE_NORETURN): New
+ macros.
+ * configure.in: Use them.
+ * gmp-impl.h (ATTRIBUTE_CONST, ATTRIBUTE_NORETURN): New macros.
+ (mpn_invert_limb): Add ATTRIBUTE_CONST.
+ (__gmp_assert_fail): Add ATTRIBUTE_NORETURN.
+
+2001-01-18 Kevin Ryde <kevin@swox.se>
+
+ * gmp-h.in, gmp-impl.h (__gmp_allocate_func, __gmp_reallocate_func,
+ __gmp_free_func): Move prototypes from gmp-impl.h to gmp-h.in, for the
+ benefit of gmp++.h.
+
+ * gmp-impl.h, tests/misc.c, tests/tests.h: Move MPZ_SET_STR_OR_ABORT
+ and MPF_SET_STR_OR_ABORT to mpz_set_str_or_abort and
+ mpf_set_str_or_abort in libtests.
+ * tests/mpz/convert.c, tests/mpz/t-bin.c, tests/mpz/t-get_si.c,
+ tests/mpz/t-jac.c, tests/mpz/t-misc.c, tests/mpq/t-md_2exp.c,
+ tests/mpq/t-set_f.c, tests/mpf/t-conv.c, tests/mpf/t-misc.c: Update.
+
+ * mpn/generic/sqrtrem.c: Use MPN_COPY_INCR (for when rp==NULL).
+
+ * tests/mpz/reuse.c: Only run mpz_divexact_gcd on positive divisors.
+
+2001-01-18 Torbjorn Granlund <tege@swox.com>
+
+ * demos/pexpr.c (main): Accept -vml option.
+ (fns): List `hamdist', `pow', `nextprime'.
+ (mpz_eval_expr): Return -1 for `popc' of negative.
+ (mpz_eval_expr): Handle `hamdist', `pow', `nextprime'.
+
+2001-01-15 Kevin Ryde <kevin@swox.se>
+
+ * mpn/alpha/ev5/mode1o.c: New file.
+
+ * tune/freq.c (speed_cpu_frequency_measure): Check cycles_works_p
+ before running speed_cyclecounter.
+ * tune/speed.h (cycles_works_p): Add prototype.
+
+2001-01-13 Torbjorn Granlund <tege@swox.com>
+
+ * tests/rand/t-rand.c (farr): Fix typo.
+ (zarr): Fix typo.
+
+2001-01-12 Kevin Ryde <kevin@swox.se>
+
+ * mpz/kronsz.c: Don't depend on right shifting a negative.
+
+ * mpn/x86/gmp-mparam.h: New file.
+
+ * mpn/x86/pentium/mmx/mul_1.asm: New file.
+
+2001-01-11 Torbjorn Granlund <tege@swox.com>
+
+ * mpz/kronsz.c: Temporary workaround for Cray right shift oddities.
+ Explicitly compare against zero in tests.
+
+2001-01-10 Kevin Ryde <kevin@swox.se>
+
+ * mpz/kronzs.c: Don't depend on right shifting a negative.
+
+2001-01-09 Torbjorn Granlund <tege@swox.com>
+
+ * tests/t-constants.c: Disable some undefined tests.
+ (CHECK_MAX_S): Remove workaround for gcc 2.95.2 bug recently added.
+
+2001-01-09 Kevin Ryde <kevin@swox.se>
+
+ * tests/t-constants.c: Add more diagnostics.
+ (CHECK_MAX_S): Fix for gcc 2.95.2 -mpowerpc64 -maix64.
+
+ * mpn/x86/k6/mode1o.asm: New file.
+ * mpn/x86/k7/mode1o.asm: New file.
+
+ * mpn/asm-defs.m4 (modexact_1_odd, modexact_1c_odd): New define_mpn's.
+ (__clz_tab, modlimb_invert_table, PROLOGUE, EPILOGUE): Add asserts for
+ GSYM_PREFIX.
+ * mpn/x86/x86-defs.m4 (Zdisp): Add a movzbl.
+
+ * tests/mpz/t-jac.c (check_a_zero): New test.
+ (check_squares_zi): Fix to use (a^2/b), not (a*b/b); revert last
+ change avoiding a,b=0, both are fine.
+ (try_2den): Don't use mpz_kronecker_ui for the expected answer.
+ (try_*): Call abort rather than exit.
+
+ * mpz/kronzu.c, mpz/kronzs.c: Fix for a=0.
+
+ * tune/tuneup.c (USE_PREINV_MOD_1): Fix to use new DATA_HIGH_LT_R.
+
+2001-01-08 Torbjorn Granlund <tege@swox.com>
+
+ * urandom.h: Amend 2000-11-21 change to also handle cygwin.
+
+2001-01-08 Kevin Ryde <kevin@swox.se>
+
+ * tune/many.pl: Updates for move to tests/devel, add modexact_1_odd,
+ don't assume C files can't have carry-in entrypoints, remove
+ $(TRY_TESTS_OBJS) now in libtests.
+
+ * tests/devel/try.c, tests/refmpn.c, tests/tests.h: Remove
+ mpn_mod_1_rshift testing.
+
+ * tune/tuneup.c (fft_step_size): Test for overflow using the actual
+ mp_size_t, don't use BITS_PER_INT.
+
+ * tune/speed.c (r_string): "r" is a limb, use BITS_PER_MP_LIMB and
+ change LONG_ONES to LIMB_ONES.
+ * tune/time.c (M_2POWU): Use INT_MAX rather than BITS_PER_INT.
+
+ * extract-dbl.c (BITS_PER_PART): Use BITS_PER_MP_LIMB not
+ BITS_PER_LONGINT.
+
+ * mpz/inp_raw.c, mpz/out_raw.c: Add private defines of BITS_PER_CHAR.
+ * mpz/fac_ui.c, tests/mpz/t-fac_ui.c: Don't use BITS_PER_LONGINT.
+ * tests/mpz/t-get_si.c: Don't use BITS_PER_LONGINT, do the LONG_MAX
+ tests with some explicit code.
+
+ * mpn/*/gmp-mparam.h, acinclude.m4, tests/t-constants.c
+ (BITS_PER_LONGINT, BITS_PER_INT, BITS_PER_SHORTINT, BITS_PER_CHAR):
+ Remove defines, remove probings, remove tests.
+
+ * tune/tuneup.c (MODEXACT_1_ODD_THRESHOLD): Add tuning.
+
+ * tune/speed.c,speed.h,common.c: Add measuring of mpn_modexact_1_odd,
+ mpn_gcd_finda, and an "N" form for mpn_gcd_1.
+
+ * tests/mpz/t-jac.c (check_squares_zi): Ensure random a,b != 0.
+
+2001-01-07 Kevin Ryde <kevin@swox.se>
+
+ * configure.in (gmp_mpn_functions): Add mode1o, remove mod_1_rs.
+
+ * mpn/generic/mod_1_rs.c: Remove file, no longer needed.
+ * gmp-h.in (mpn_mod_1_rshift): Remove prototype and define.
+
+ * mpq/set_f.c: Use MPN_STRIP_LOW_ZEROS_NOT_ZERO.
+
+ * mpz/kronzu.c, mpz/kronzs.c, mpz/kronuz.c, mpz/kronsz.c: Use
+ mpn_modexact_1_odd, new style MPN_STRIP_LOW_ZEROS_NOT_ZERO, and new
+ JACOBI macros. Various rearrangements supporting all this.
+
+ * mpn/generic/gcd_1.c: Use mpn_modexact_1_odd, reduce u%v if u much
+ bigger than v when size==1, some rearrangements supporting this.
+
+ * gmp-impl.h (JACOBI_*): More macros, add some casts to "int".
+ (MPN_STRIP_LOW_ZEROS_NOT_ZERO): Add a "low" parameter.
+ (mpn_modexact_1_odd, mpn_modexact_1c_odd): Add prototype and defines.
+ (MODEXACT_1_ODD_THRESHOLD): New threshold.
+ (MPN_MOD_OR_MODEXACT_1_ODD, JACOBI_MOD_OR_MODEXACT_1_ODD): New macros.
+
+ * mpn/generic/mode1o.c: New file.
+
+ * tests/mpz/reuse.c: Add testing of mpz_divexact_gcd.
+ * tests/mpz/t-fac_ui.c: Use libtests for memory leak checking.
+ * tests/mpz/t-fib_ui.c: Add a usage comment.
+
+ * tests/mpz/bit.c: Use libtests.
+ * tests/mpz/t-scan.c: Remove unused subroutines.
+ * tests/devel/try.c: Use libtests, define PROT_NONE if the system
+ doesn't.
+
+ * tests/spinner.c, tests/x86check.c: Use tests.h.
+ * tests/trace.c: Use tests.h, add mpf_trace.
+ * tests/refmpn.c: Use tests.h, add refmpn_malloc_limbs_aligned,
+ refmpn_tstbit, refmpn_neg.
+
+ * tune/common.c, tune/speed.h: Update for functions moved to
+ tests/misc.c.
+
+ * tune/Makefile.am, tests/mpz/Makefile.am, tests/mpq/Makefile.am,
+ tests/mpf/Makefile.am: Use tests/libtests.la.
+
+ * configure.in (AC_OUTPUT): Update for new directories.
+ (x86 CALLING_CONVENTIONS_OBJS): Use .lo for libtests.la, allow
+ ansi2knr on x86check.c.
+
+ * tests/Makefile.am: Establish new libtests.la convenience library,
+ add mpz, mpq, mpf, mpbsd subdirectories.
+ * tests/tests.h: New file.
+ * mpn/tests/ref.h,try.h: Remove files, now in tests.h.
+
+ * tests/mpf/ref.c: Move to tests/refmpf.c, rename functions to refmpf.
+ * tests/mpf/t-add.c, tests/mpf/t-sub.c: Use libtests.
+ * tests/mpf/Makefile.am: Update.
+
+ * tests/memory.c: New file.
+ * tests/misc.c: New file, a few subroutines from the test programs.
+
+ * mpz/tests, mpq/tests, mpf/tests, mpbsd/tests: Move directories to
+ tests/mpz etc.
+ * mpz/Makefile.am, mpq/Makefile.am, mpf/Makefile.am, mpbsd/Makefile.am
+ (SUBDIRS): Remove.
+
+ * tests/devel: New directory.
+ * mpn/tests/*.c: Move programs to tests/devel.
+ * mpn/tests/Makefile.am, mpn/tests/README: Move to tests/devel, update.
+
+ * mpn/tests/ref.c: Move to tests/refmpn.c.
+ * mpn/tests/spinner.c,trace.c,x86call.asm,x86check.c: Move to tests
+ directory.
+
+ * tests/t-constants.c: Add checks of HIGHBIT, MAX and MIN constants,
+ simplify ANSI vs K&R stringizing, use correct printf format types, do
+ all tests before aborting.
+
+2001-01-05 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/cray/ieee/gmp-mparam.h: Retune.
+
+2001-01-05 Kevin Ryde <kevin@swox.se>
+
+ * configure.in (mp.h): Only create this under --enable-mpbsd.
+
+ * demos/calc: New subdirectory, move demos/calc* to it.
+ * demos/calc/Makefile.am: New file, split from demos/Makefile.am.
+ * demos/Makefile.am: Update.
+ * configure.in (AC_OUTPUT): Add demos/calc/Makefile.
+
+ * tests/t-constants.c (CALC_BITS_PER_TYPE etc): Use a run-time test
+ for how many bits work in a give type, don't assume bits==8*sizeof.
+
+2001-01-04 Kevin Ryde <kevin@swox.se>
+
+ * mpz/fits_s.c, mpz/fits_u.c: New files, split from fits.c, use plain
+ UINT_MAX etc, not MPZ_FITS_UTYPE_SDT etc.
+ * mpz/fits.c: Remove file.
+ * mpz/Makefile.am, macos/Makefile.in: Update.
+
+ * gmp-impl.h (UNSIGNED_TYPE_MAX etc): Remove these generic forms.
+ (MPZ_FITS_[SU]TYPE_SDT): Remove these.
+ (UINT_MAX etc): Provide a full set of defaults.
+ * gmp-h.in (__GMP_MP_SIZE_T_INT): New define.
+
+ * mpz/tests/t-scan.c: New file.
+ * mpz/tests/Makefile.am (check_PROGRAMS): Add it.
+
+ * mpz/scan0.c, mpz/scan1.c: Rewrite, don't read beyond allocated
+ memory, support negatives, return ULONG_MAX for no bit found.
+ * gmp.texi (Integer Logic and Bit Fiddling): Update.
+
+2001-01-03 Torbjorn Granlund <tege@swox.com>
+
+ * mpz/tests/dive.c: Generate test operands using new random functions.
+ * mpz/tests/io.c: Likewise.
+ * mpz/tests/logic.c: Likewise.
+ * mpz/tests/t-2exp.c: Likewise.
+
+ * stack-alloc.c (__gmp_tmp_alloc): Round `now' to required alignment.
+
+ * stack-alloc.h (__TMP_ALIGN): Append `L'.
+
+ * gmp-impl.h: For Cray, #include limits.h.
+ (LONG_MIN): New #define.
+ (ULONG_HIGHBIT): #define in terms of ULONG_MAX.
+ (LONG_HIGHBIT): #define as LONG_MIN.
+ (USHRT_MAX): New name for USHORT_MAX.
+ (SHRT_MAX): New name for SHORT_MAX.
+ (SHRT_MIN): New #define.
+ (USHORT_HIGHBIT,SHORT_HIGHBIT): Removed.
+
+ * mpbsd/tests/t-misc.c (check_itom [data]): *SHORT* => *SHRT*;
+ remove code disabling a test for Cray.
+
+ * tests/t-constants.c (CHECK_CONSTANT): Cast parameters to long.
+
+ * mpn/generic/mul_n.c (mpn_kara_sqr_n): Remove unused variable `t'.
+ (mpn_kara_mul_n): Likewise.
+
+ * mpz/fac_ui.c (MPZ_SET_1_NZ): Actually use `__z'.
+
+ * mpz/tests/t-jac.c
+ (main, check_squares_zi): Generate test operands using new random
+ functions.
+
+ All changes below on this date for enabling `make; make check'
+ with C++ compilers:
+
+ * mpz/tests/t-pow_ui.c (debug_mp, ref_mpz_pow_ui): Provide prototypes.
+
+ * mpz/tests/t-mul.c (debug_mp, base_mul, ref_mpz_mul):
+ Provide prototypes.
+ (dump_abort): Provide prototype and declare properly for C++.
+
+ * mpz/tests/t-jac.c: #include stdlib.h and sys/time.h.
+
+ * mpz/tests/t-fdiv.c
+ (dump_abort): Provide prototype and declare properly for C++.
+ (debug_mp): Provide prototype.
+ * mpz/tests/t-fdiv_ui.c: Likewise.
+ * mpz/tests/t-gcd.c: Likewise.
+ * mpz/tests/t-powm.c: Likewise.
+ * mpz/tests/t-powm_ui.c: Likewise.
+ * mpz/tests/t-sqrtrem.c: Likewise.
+ * mpz/tests/t-tdiv_ui.c: Likewise.
+ * mpz/tests/t-tdiv.c: Likewise.
+
+ * mpz/tests/t-2exp.c: #include stdlib.h and sys/time.h.
+ Remove #include of longlong.h.
+
+ * mpz/tests/io.c: #include config.h, stdlib.h, sys/time.h, and
+ conditionally unistd.h.
+
+ * mpz/tests/dive.c: #include stdlib.h and sys/time.h.
+ (dump_abort): Provide prototype and declare properly for C++.
+ (debug_mp): Provide prototype.
+ * mpz/tests/logic.c: Likewise.
+
+ * mpz/tests/convert.c (debug_mp): Provide prototype.
+ * mpz/tests/t-root.c (debug_mp): Likewise.
+
+ * mpz/tests/bit.c: #include stdlib.h and sys/time.h.
+
+ * mpq/tests/t-get_d.c: #include stdlib.h and sys/time.h.
+ (dump): Provide prototype and declare properly for C++.
+
+ * mpq/tests/t-cmp_ui.c: #include stdio.h, stdlib.h and sys/time.h.
+ (ref_mpq_cmp_ui): Declare properly for C++.
+
+ * mpq/tests/t-cmp.c: #include stdlib.h and sys/time.h.
+ (ref_mpq_cmp): Declare properly for C++.
+ (dump): Delete unused function.
+
+ * mpf/random2.c (myrandom): New function.
+ (mpf_random2): Use it.
+
+ * mpn/generic/random2.c: #include stdlib.h (for random/mrand48).
+ (myrandom): New function.
+ (mpn_random2): Use it.
+
+ * mpf/tests/t-add.c: #include stdlib.h and sys/time.h.
+ (oo): Remove unused function.
+ * mpf/tests/t-conv.c: Likewise.
+ * mpf/tests/t-sub.c: Likewise.
+ * mpf/tests/t-dm2exp.c: Likewise.
+ * mpf/tests/t-muldiv.c: Likewise.
+ * mpf/tests/t-sqrt.c: Likewise.
+
+ * mpf/tests/reuse.c: #include stdlib.h and sys/time.h.
+ Use PROTO on some typedefs.
+ (oo): Remove function.
+ (dump_abort): Call mpf_dump instead of oo.
+
+ * mpf/set_str.c: #include stdlib.h (for strtol).
+
+ * mpf/random2.c: #include stdlib.h (for random/mrand48).
+ * mpn/alpha/udiv_arnnd: File deleted.
+
+ * Remove K&R function headers.
+
+2001-01-02 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/generic/mul.c: Clean up spacing and indentation.
+
+ * mpn/generic/mul_fft.c (mpn_fft_add_modF): Use mpn_decr_u.
+ Clean up spacing and indentation.
+
+ * extract-dbl.c: Generalize to handle smaller limb sizes.
+
+2001-01-01 Torbjorn Granlund <tege@swox.com>
+
+ * mpbsd/mout.c: Output newline after "0".
+
+2000-12-31 Torbjorn Granlund <tege@swox.com>
+
+ * ltmain.sh: Remove space between `#!' and `$SHELL' when generating
+ `libtool'.
+
+ * mpbsd/tests/t-misc.c (check_itom): Exclude test for all Cray
+ vector systems. Correct comment.
+
+2000-12-31 Kevin Ryde <kevin@swox.se>
+
+ * gmp.texi (ABI and ISA): New enough gcc needed for mips n32 etc, gcc
+ 2.95 needed for sparc 64-bit ABI, gcc 2.8 needed for -mv8plus.
+
+ * configure.in ([cjt]90,sv1-cray-unicos*): Preserve user specified
+ MPN_PATH, amend test program indenting.
+ (none-*-*): Add -DNO_ASM to gcc to disable longlong.h asm macros in
+ generic C.
+
+ * config.sub (j90, t90): Preserve these, don't let configfsf.sub turn
+ them into c90.
+
+ * config.guess (m68k-*-nextstep*,m68k-*-openstep*): Don't transform
+ m68k to m68020, since m68k is already interpreted as 68020.
+
+2000-12-30 Kevin Ryde <kevin@swox.se>
+
+ * mpq/neg.c: Rewrite, use mpn, avoid denominator copy if unnecessary.
+
+ * mpz/tstbit.c: Rewrite, slightly simplified.
+ * mpz/tests/bit.c (check_tstbit): New test, and add a couple more
+ diagnostics elsewhere.
+
+ * configure.in (x86 gcc_cflags_cpu): Add -m486 for gcc 2.7.2.
+ (ccbase): Only use a known compiler in eval statements (avoids
+ problems with non-symbol characters).
+ (ccbase): Use GMP_PROG_CC_IS_GNU to identify gcc installed under a
+ different name.
+ (cclist): Use same style $abi as other variables.
+
+ * acinclude.m4 (GMP_PROG_CC_IS_GNU): New macro.
+ (GMP_GCC_MARCH_PENTIUMPRO): Use $ccbase to identify gcc.
+ (GMP_ASM_TYPE): Define TYPE to empty, not "dnl", when no .type needed.
+ (GMP_ASM_SIZE): Ditto for SIZE, which ensures EPILOGUE on the last
+ line of a file doesn't leave a tab and no newline.
+ (GMP_ASM_UNDERSCORE): Add a prototype for C++.
+
+ * configure.in (sys/mman.h, mprotect): New tests.
+ * mpn/tests/try.c: Use them, and HAVE_UNISTD_H too.
+
+ * configure.in (getopt.h): Remove test.
+ * tune/speed.c, mpn/tests/try.c (getopt.h): Remove include, since
+ plain getopt() is in <unistd.h>.
+
+ * configure.in, gmp-h.in (mips*-*-irix6*): Set limb_n32=longlong
+ rather than using _ABIN32.
+
+2000-12-29 Torbjorn Granlund <tege@swox.com>
+
+ * mpz/tests/reuse.c: Rename dump_abort => dump.
+ * mpz/tests/reuse.c: Generate operands using gmp_rand*.
+ * mpz/tests/convert.c: Likewise.
+
+ * configure.in: Detect T90-ieee systems; move Cray path
+ selection to after AC_PROG_CC. Invoke AC_PROG_CPP.
+ * mpn/cray/cfp: New directory. Move cfp specific files here.
+ * mpn/cray/cfp/mulwwc90.s: New file.
+ * mpn/cray/cfp/mulwwj90.s: New file.
+ * mpn/cray/mulww.s: Delete.
+
+2000-12-27 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/cray/ieee/mul_1.c: New file.
+ * mpn/cray/ieee/addmul_1.c: New file.
+ * mpn/cray/ieee/submul_1.c: New file.
+ * mpn/cray/ieee/gmp-mparam.h: New file.
+
+ * mpn/cray/gmp-mparam.h: Disable UMUL_TIME and UDIV_TIME.
+
+ * mpn/cray/hamdist.c: New file.
+ * mpn/cray/popcount.c: New file.
+ * mpn/cray/rshift.c: New file.
+ * mpn/cray/lshift.c: New file.
+
+ * longlong.h: Add count_leading_zeros for _CRAY.
+ Reorganize _CRAY stuff.
+
+2000-12-24 Kevin Ryde <kevin@swox.se>
+
+ * configure.in (alpha*-cray-unicos*): Disable SPEED_CYCLECOUNTER_OBJ,
+ as tune/alpha.asm doesn't suit.
+
+ * mpn/generic/sqrtrem.c, mpz/pow_ui.c, mpz/powm_ui.c, mpf/get_str.c,
+ mpf/set_str.c: Use mpn_sqr_n when applicable, not mpn_mul_n.
+
+2000-12-23 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/generic/mul_fft.c: Reformat.
+ (mpn_fft_neg_modF): Remove.
+ (mpn_fft_mul_2exp_modF): Inline mpn_fft_neg_modF.
+
+ * mpn/cray/gmp-mparam.h: Retune.
+
+ * configure.in (*-cray-unicos*): Pass `-O3 -htask0'.
+ (vax*-*-*): Fix typo.
+
+ * mpn/cray/mul_1.c: Use dynamic arrays, get rid of TMP_*.
+ * mpn/cray/addmul_1.c: Likewise.
+ * mpn/cray/submul_1.c: Likewise.
+ * mpn/cray/add_n.c: Likewise.
+ * mpn/cray/sub_n.c: Likewise.
+
+ * configure.in (default cc_cflags,cc_64_cflags): Remove -g/add -O.
+ (mips*-*-irix[6789]*]): Remove -g from cc_*_cflags.
+
+2000-12-22 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/generic/mul_n.c: Delete K&R function headers.
+
+ * mpn/generic/mul_n.c (mpn_kara_mul_n): Clean up type confusion
+ between mp_limb_t and mp_size_t.
+ (mpn_kara_sqr_n): Likewise.
+
+ * mpn/generic/mul_n.c (mpn_kara_mul_n): Use mpn_incr_u.
+ (mpn_kara_sqr_n): Likewise.
+
+ * mpn/generic/mul_n.c (mpn_kara_mul_n): Change handling of `sign'
+ to work around GCC 2.8.1 MIPS bug.
+
+ * configure.in (implied alpha*-cray-unicos*): Remove -g from cc_cflags.
+
+2000-12-21 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/alpha/invert_limb.asm: Simplify a bit.
+ Add handling of bigend systems.
+ * mpn/alpha/unicos.m4: Define `bigend'.
+ * mpn/alpha/default.m4: Define `bigend' (to expand to nothing).
+
+ * tests/t-constants.c (CHECK_CONSTANT): Print using %lx.
+
+ * mpn/alpha/gmp-mparam.h: Remove sizes for plain C types.
+ * mpn/alpha/ev5/gmp-mparam.h: Likewise.
+ * mpn/alpha/ev6/gmp-mparam.h: Likewise.
+
+ * mpn/alpha/unicos.m4: Define LEA.
+ * mpn/alpha/default.m4: Likewise.
+ * mpn/alpha/invert_limb.asm: Use LEA for loading symbolic addresses.
+ * mpn/alpha/cntlz.asm: Likewise.
+
+ * mpn/alpha/cntlz.asm: Don't use `ldbu', use slightly slower
+ `ldq_u' + `extbl' instead.
+
+ * mpn/alpha/unicos.m4: Define EXTERN.
+ * mpn/alpha/default.m4: Define EXTERN (to expand to nothing).
+ * mpn/alpha/cntlz.asm: Declare __clz_tab usign `EXTERN' (for the
+ benefit of Unicos).
+
+2000-12-21 Kevin Ryde <kevin@swox.se>
+
+ * mpn/alpha/unicos.m4 (GSYM_PREFIX): Define for the benefit of
+ __clz_tab.
+
+2000-12-20 Torbjorn Granlund <tege@swox.com>
+
+ * longlong.h: Add udiv_qrnnd and count_leading_zeros for _CRAYMPP
+ systems.
+
+2000-12-19 Torbjorn Granlund <tege@swox.com>
+
+ * configure.in (*sparc*-*-*): Remove -g from cc_cflags and acc_cflags.
+
+ * mpn/generic/sqrtrem.c (mpn_sqrtrem): Separate `limb' values from
+ `size' values.
+
+ * configure.in (*-cray-unicos*): Add `-Wa,-B' to cc_cflags.
+
+ * demos/pexpr.c (rstate): New variable.
+ (main): Initialize rstate.
+ (enum op_t): Add RANDOM.
+ (fns): Add field for RANDOM.
+ (mpz_eval_expr): Handle RANDOM.
+
+2000-12-19 Kevin Ryde <kevin@swox.se>
+
+ * mpn/generic/sqrtrem.c: Rewrite by Paul Zimmermann, based on his
+ Karatsuba Square Root algorithm.
+ * gmp.texi (Square Root Algorithm): Update.
+
+ * tune/many.pl: New file.
+
+ * mpn/tests/try.c,ref.[ch] (mpn_preinv_mod_1, mpn_sb_divrem_mn,
+ mpn_tdiv_qr, mpn_gcd_finda, mpn_kara_mul_n, mpn_kara_sqr_n,
+ mpn_toom3_mul_n, mpn_toom3_sqr_n): Add testing.
+ * mpn/tests/ref.c: Cast some "0"s in function calls.
+
+ * mpn/x86/k7/mmx/mod_1.asm: Add preinv_mod_1 entrypoint, remove extra
+ variable for loop termination.
+
+ * mpn/x86/p6/mmx/mod_1.asm: Remove file, in favour of the following.
+ * mpn/x86/p6/mod_1.asm: New file.
+
+ * mpn/x86/pentium/mod_1.asm: New file.
+
+2000-12-18 Torbjorn Granlund <tege@swox.com>
+
+ * configure.in (mips*-*-irix[6789]*): Pass options to compiler using
+ `-Wc'.
+
+2000-12-18 Kevin Ryde <kevin@swox.se>
+
+ * mpn/x86/k6/pre_mod_1.asm: New file.
+
+ * tune/tuneup.c (USE_PREINV_MOD_1): Tune this, rearrange mpn_divrem_1
+ and mpn_mod_1 handling in support of it.
+ * tune/Makefile.am: Consequent changes to divrem_1.c and mod_1.c.
+
+ * gmp-impl.h (USE_PREINV_MOD_1, MPN_MOD_OR_PREINV_MOD_1): New macros.
+ * mpn/generic/perfsqr.c, mpz/pprime_p.c: Use MPN_MOD_OR_PREINV_MOD_1.
+
+ * configure.in: Let an asm mod_1 provide a preinv_mod_1 entrypoint.
+
+ * mpn/alpha/default.m4: Remove some newlines, add some asserts.
+ (r0 etc, f0 etc): Use defreg and deflit.
+ (PROLOGUE, PROLOGUE_GP, EPILOGUE): Use GSYM_PREFIX.
+ * mpn/alpha/unicos.m4: Remove some newlines, add some asserts.
+ * mpn/alpha/invert_limb.asm: Remove unused second DATASTART parameter.
+ * mpn/alpha/cntlz.asm: Use mpn_count_leading_zeros and __clz_tab.
+
+ * mpn/asm-defs.m4 (changecom): Comments on portability.
+ (__clz_tab, modlimb_invert_table): New macros, matching gmp-impl.h.
+ (count_leading_zeros, count_trailing_zeros): New define_mpn's.
+ (PROLOGUE etc): Comments on usage, add some asserts.
+ (OPERATION_[lr]shift): Use m4_not_for_expansion, for the benefit of
+ lorrshift multifunc.
+
+ * mpn/Makeasm.am (RM_TMP): New variable controlling tmp-*.s
+ removal, for development purposes.
+
+ * mpz/fac_ui.c: Fix for long long limb by using mpn_mul_1 not
+ mpz_mul_ui, and note some possible enhancements.
+
+ * mpz/tests/t-fac_ui.c: New test.
+ * mpz/tests/Makefile.am (check_PROGRAMS): Add it.
+ * macos/Makefile.in: Ditto, and add t-fib_ui too.
+
+ * mpn/generic/[lr]shift.c: Remove some DEBUG code adequately covered
+ by new parameter ASSERTs.
+
+ * longlong.h (count_trailing_zeros): Assert x!=0.
+
+ * doc/configuration: Updates for new configure things, add some notes
+ on test setups.
+
+2000-12-16 Torbjorn Granlund <tege@swox.com>
+
+ * configure.in (*-*-aix): Pass -qmaxmem=20000 to xlc also for 64-bit
+ compiles.
+ * configure.in: Disable shared libs for *-*-ultrix*.
+
+2000-12-15 Torbjorn Granlund <tege@swox.com>
+
+ * configure.in (powerpc*-*-*): Pass -Wa,-mppc when using gcc.
+
+ * gmp-impl.h (_EXTERN_INLINE): #define different for GCC and other
+ compilers.
+
+ * gmp-h.in (__gmp_inline): Remove.
+ * mp-h.in: Likewise.
+ * mpn/generic/gcd.c: Use `inline' instead of `__gmp_inline'.
+
+ * configure.in (mips*-*-irix[6789]*): Define *_ldflags.
+
+2000-12-14 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/generic/pre_mod_1.c: Use proper type for udiv_qrnnd
+ parameter `dummy'.
+
+ * mpn/generic/divrem_1.c: Use explicit `!= 0' in if statement.
+ * mpn/generic/mod_1.c: Likewise.
+
+2000-12-14 Kevin Ryde <kevin@swox.se>
+
+ * config.guess (mips-*-irix[6789]*): Transform to mips64.
+ (m68k-*-nextstep* | m68k-*-openstep*): Transform to m68020.
+
+2000-12-13 Torbjorn Granlund <tege@swox.com>
+
+ * tests/t-constants.c (main): Conditionalize use of PP_INVERTED.
+
+ * mpn/mp_bases.c: Handle 4-bit limbs.
+ (main): Add code for generating tables.
+
+ * mpn/generic/popham.c: Handle limb bitsizes of 4, 8, 16.
+ Suffix all 32-bit constant with `L'.
+ Use CNST_LIMB for 64-bit constants.
+
+2000-12-13 Kevin Ryde <kevin@swox.se>
+
+ * gmp-impl.h (FIB_THRESHOLD): Defaults for 4,8,16 bits per limb, and
+ an arbitrary fallback default.
+ (modlimb_invert): Add efficient code for 8,16 (or 4) bits per limb.
+
+ * configure.in (mips3, mips64): Don't bother with o32 (mips2 32-bit
+ limb) on IRIX 6.
+
+ * Makefile.am (SUBDIRS): Put "tests" first so tests/t-constants.c is
+ run first, to pick up any limb size mismatch.
+
+ * tune/tuneup.c (DIVREM_1, MOD_1): Fix result values, were off by 1.
+
+ * mpz/fib_ui.c (table1, table2): Add data for 4,8,16 bits per limb.
+
+2000-12-12 Torbjorn Granlund <tege@swox.com>
+
+ * gmp-impl.h (LIMBS_PER_DOUBLE): Define for any limb bitsize.
+
+2000-12-11 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/mp_bases.c: Add tables for 8-bit and 16-bit limbs.
+ Round existing `double' values properly.
+
+ * gmp-h.in (__gmp_randstate_struct): Prefix field names with _mp_
+ to keep out of user name space.
+ (__gmp_randata_lc): Likewise.
+ * randclr.c, randlc.c, randlc2x.c, randraw.c, randsd.c, randsdui.c:
+ Corresponding changes.
+
+ * gmp-impl.h (PP): #define for machines with BITS_PER_MP_LIMB
+ of 2, 4, 8, and 16.
+ (PP_FIRST_OMITTED): New, define for various BITS_PER_MP_LIMB.
+ (PP_MASK): Remove.
+ (PP_MAXPRIME): Remove.
+
+ * mpn/generic/perfsqr.c: Generalize PP handling for machines with
+ limbs of < 32 bits. Allow PP_INVERTED to be undefined.
+ * mpz/pprime_p.c: Likewise.
+
+2000-12-10 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/generic/mul_1.c: Declare parameters in C89 style.
+
+2000-12-10 Kevin Ryde <kevin@swox.se>
+
+ * tune/Makefile.am (speed_LDFLAGS, speed_ext_LDFLAGS, tune_LDFLAGS):
+ Don't use -all-static, as gcc 2.95.2 on i386 solaris 8 doesn't like
+ it.
+
+ * configure.in (mips3,mips64): Add ABI=64, name the others ABI=n32 and
+ ABI=o32.
+ * mpn/mips3/gmp-mparam.h (BITS_PER_LONGINT): Remove #define and let
+ configure determine it, since it varies with ABI=64 or ABI=n32.
+ * gmp.texi (ABI and ISA): Update.
+ (mpz_mod_ui): Remark that it's identical to mpz_fdiv_r_ui.
+ (mpn_divexact_by3): Qualify a statement needing mp_bits_per_limb even.
+
+ * mul_fft.c (mpn_fft_mul_modF_K etc): Patch by Paul Zimmermann to fix
+ results in certain cases of recursing into a further FFT.
+
+2000-12-09 Torbjorn Granlund <tege@swox.com>
+
+ * mpz/cmpabs.c: Remove unused variable.
+ * mpz/rrandomb.c: Likewise.
+ * mpz/xor.c: Likewise.
+
+2000-12-07 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/generic/gcdext.c: Handle double carry when computing s1.
+ Merge two code blocks for computing s0 and s1.
+
+2000-12-07 Kevin Ryde <kevin@swox.se>
+
+ * configure.in (hppa*-*-*): Remove -Aa -D_HPUX_SOURCE from
+ cc_cflags/cppflags, and instead let AM_C_PROTOTYPES add it, or -Ae,
+ whichever works.
+
+ * configure.in (*-*-aix[34]*): Disable shared by default, but let
+ the user override that, if desired.
+ * gmp.texi (Notes for Particular Systems): Update.
+
+2000-12-06 Torbjorn Granlund <tege@swox.com>
+
+ * mpq/cmp_ui.c: Streamline.
+
+2000-12-06 Kevin Ryde <kevin@swox.se>
+
+ * tune/divrem_1_div.c,divrem_1_inv.c,mod_1_div.c,mod_1_inv.c,
+ gcdext_double.c: New files for measuring.
+ * tune/Makefile.am (libspeed_la_SOURCES): Add them.
+ * tune/speed.c,speed.h,common.c: Add measuring of them.
+ (mpn_preinv_mod_1, mpz_jacobi, mpz_powm_ui): Add measuring.
+
+ * speed.c (getopt_long): Don't use this, just plain getopt.
+ * configure.in (getopt_long): Remove test.
+
+ * gmp-impl.h (MPN_KARA_MUL_N_TSIZE, MPN_KARA_MUL_N_MINSIZE,
+ MPN_TOOM3_MUL_N_TSIZE, MPN_TOOM3_MUL_N_MINSIZE): New macros, and
+ assume toom3 square tsize was meant to be the same as the mul (both
+ are overestimates).
+ * tune/tuneup.c, mpn/generic/mul.c, mpn/generic/mul_n.c: Use them.
+ * mpn/generic/mul_n.c (mpn_toom3_sqr_n): Fix an ASSERT to use
+ TOOM3_SQR_THRESHOLD not TOOM3_MUL_THRESHOLD, add a few that might
+ be more realistic size checks.
+ * tune/speed.h (SPEED_ROUTINE_MPN_MUL_N_TSPACE etc): Use minsize.
+
+ * mpn/generic/divrem_1.c: Partial rewrite, merge fractional part
+ calculation, skip a divide step in more cases, introduce
+ DIVREM_1_NORM_THRESHOLD and DIVREM_1_UNNORM_THRESHOLD.
+ * mpn/generic/mod_1.c: Partial rewrite, skip a divide step in more
+ cases, introduce MOD_1_NORM_THRESHOLD, MOD_1_UNNORM_THRESHOLD.
+ * longlong.h (UDIV_PREINV_ALWAYS): New define, set for alpha and ia64.
+ * tune/tuneup.c (DIVREM_1_NORM_THRESHOLD, DIVREM_1_UNNORM_THRESHOLD,
+ MOD_1_NORM_THRESHOLD, MOD_1_UNNORM_THRESHOLD): Tune these.
+ * gmp-impl.h [TUNE_PROGRAM_BUILD]: Support for this.
+ * tune/Makefile.am (TUNE_MPN_SRCS): Add divrem_1.c and mod_1.c.
+
+ * gmp-impl.h (UDIV_NORM_PREINV_TIME): Renamed from UDIV_PREINV_TIME.
+ * mpn/generic/perfsqr.c, mpn/generic/sb_divrem_mn.c,
+ mpn/x86/*/gmp-mparam.h: Ditto.
+ * gmp-impl.h (UDIV_UNNORM_PREINV_TIME): New define.
+
+ * configure.in (AC_C_INLINE, HAVE_INLINE): New test and define.
+ * gmp-impl.h (inline): Remove, use config.h.
+ (_EXTERN_INLINE): Redefine based on HAVE_INLINE.
+ (mpn_zero_p): Use HAVE_INLINE.
+
+ * acinclude.m4 (GMP_PROG_AR, GMP_PROG_NM): Don't add flags to a user
+ selected $AR or $NM.
+
+ * tune/tuneup.c (all): Print how long the tuning took.
+
+ * configure.in (AM_C_PROTOTYPES): Use this, not GMP_ANSI2KNR.
+ * acinclude.m4 (GMP_ANSI2KNR): Remove.
+
+ * Makefile.am (gmp.h, mp.h): In DISTCLEANFILES not CLEANFILES.
+
+ * gmp-h.in (mpn_divmod, mpn_divmod_1, mpn_divexact_by3): Cast some
+ zeros, for the benefit of K&R if long!=int.
+
+ * mpn/lisp/gmpasm-mode.el (gmpasm-comment-start-regexp): Add "*" for
+ the benefit of cray.
+
+ * compat.c (mpn_divexact_by3, mpn_divmod_1): Return types should be
+ mp_limb_t, not int, and need an actual "return".
+
+2000-12-05 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/sparc32/v8/supersparc/gmp-mparam.h: Retune.
+ * mpn/alpha/gmp-mparam.h: Tune for 21064.
+
+ * longlong.h: Reformat to avoid newlines within strings.
+
+ * gmp-impl.h (inline): Disable if GCC has defined __STRICT_ANSI__.
+
+ * configure.in: Do a `mkdir tune' before creating tune/sqr_basecase.c.
+
+ * Makefile.am: Treat mp.h analogously to gmp.h.
+
+ configure.in (*-*-aix): Pass -qmaxmem=20000 to xlc.
+
+ * mp-h.in: Renamed from mp.h.
+ Add #define for _LONG_LONG_LIMB.
+ Move some other fixes from gmp-h.in.
+ * mp.h: Removed.
+ * configure.in: Generate mp.h from mp-h.in like we handle
+ gmp-h.in/gmp.h.
+
+2000-12-04 Torbjorn Granlund <tege@swox.com>
+
+ * acinclude.m4: Fix typo testing for bad HP compiler.
+
+2000-12-03 Torbjorn Granlund <tege@swox.com>
+
+ * mpbsd/tests/t-misc.c (check_itom): Exclude some tests for Cray
+ CFP systems.
+
+ * longlong.h (CRAYIEEE umul_ppmm): New.
+
+ * mpn/cray/gmp-mparam.h (BITS_PER_SHORTINT): 32 => 64.
+ (*_THRESHOLD): Tune.
+
+ * configure.in: Disable shared libs for *-*-unicos*.
+
+2000-12-03 Kevin Ryde <kevin@swox.se>
+
+ * configure.in, tune/Makefile.am: Create tune/sqr_basecase.c during
+ configure, and use it unconditionally in $(nodist_tuneup_SOURCES).
+ Fixes a problem with sqr_basecase.lo under --disable-static.
+
+2000-12-01 Torbjorn Granlund <tege@swox.com>
+
+ * mpf/tests/t-get_d.c (LOW_BOUND,HIGH_BOUND): #define for non-IEEE
+ Cray systems.
+
+ * gmp-impl.h (union ieee_double_extract): Test for _CRAYIEEE.
+
+2000-11-30 Torbjorn Granlund <tege@swox.com>
+
+ * mpz/tests/t-mul.c (base_mul): Fix re-evaluation problems in macro
+ invocations.
+ (ref_mpz_mul): New name from mpz_refmul. Make static.
+ (base_mul): New name for _mpn_mul_classic.
+
+2000-11-30 Kevin Ryde <kevin@swox.se>
+
+ * configure.in: Rewrite of CC/CFLAGS selection scheme, introduce a
+ notion of ABI, merge compiler and mpn path selection, add flags
+ selection for AR and NM, let CC without CFLAGS work.
+ (AC_PROG_CC): Use this, not GMP_SELECT_CC.
+ * acinclude.m4 (GMP_PROG_CC_WORKS): Don't use AC_TRY_COMPILE, combine
+ cc/cflags parameter.
+ (GMP_PROG_CC_FIND, GMP_CHECK_CC_64BIT, GMP_PROG_CC_SELECT): Remove.
+ * gmp.texi (Installing GMP): Updates for new scheme.
+
+ * configure.in (AC_CANONICAL_HOST): Use this and $host, not $target.
+ * acinclude.m4, acconfig.h, longlong.h, mpn/x86/x86-defs.m4,
+ mpn/x86/k7/mmx/popham.asm: Ditto, renaming HAVE_TARGET_CPU to
+ HAVE_HOST_CPU.
+ * gmp.texi (Build Options, and elsewhere): Update.
+
+ * acinclude.m4 (GMP_COMPARE_GE): New macro.
+ (GMP_GCC_MARCH_PENTIUMPRO): Use it, add CC parameter, check for GCC.
+ (GMP_HPC_HPPA_2_0): New macro, adapted from GMP_CHECK_CC_64BIT.
+
+ * acinclude.m4 (GMP_PROG_AR): New macro, using AC_CHECK_TOOL, adding
+ GMP flags.
+ * configure.in: Use it
+
+ * gmp-h.in: Renamed from gmp.h.
+ (@define_LONG_LONG_LIMB@): Placeholder for instantiation.
+ (__GNU_MP__): Bump to 3.
+ * acinclude.m4 (GMP_VERSION): Get version from gmp-h.in.
+ * configure.in: Create gmp.h from gmp-h.in to set _LONG_LONG_LIMB.
+ * gmp.texi.h (ABI and ISA): Mention this.
+ * acconfig.h (_LONG_LONG_LIMB): Remove undef.
+ * Makefile.am: Distribute gmp-h.in, not gmp.h.
+
+ * configure.in (AC_PROG_CPP, AC_PROG_INSTALL, AC_PROG_LN_S): Remove,
+ dragged in by other macros.
+ (gmp_asm_syntax_testing): Renamed from gmp_no_asm_syntax_testing.
+ (AC_EXEEXT, AC_OBJEXT): Remove, done automatically by libtool.
+ * configure.in, acinclude.m4: Remove "" from "`foo`", being
+ unnecessary and not portable.
+
+ * configure.in (GMP_LDFLAGS): New AC_SUBST flags for libtool link.
+ (powerpc64*-*-aix*): Use for -Wc,-maix to fix shared library creation,
+ but can't build shared and static at the same time.
+ * Makefile.am (libgmp_la_LDFLAGS, libmp_la_LDFLAGS): Use
+ $(GMP_LDFLAGS).
+ * gmp.texi (Notes for Particular Systems): Update AIX problem
+
+ * configure.in (AC_CONFIG_LINKS): Use where needed, not via gmp_links.
+ (gmp_srclinks): Build up as needed, not via gmp_links.
+
+ * acinclude.m4 (GMP_INIT): Do CONFIG_TOP_SRCDIR and asm-defs.m4 here.
+ * configure.in (asm-defs.m4): Consequent changes.
+
+ * acinclude.m4 (GMP_INCLUDE_MPN): Using include_mpn(), replacing
+ GMP_INCLUDE and GMP_SINCLUDE.
+ * configure.in (gmp_m4postinc): Remove this scheme, use
+ GMP_INCLUDE_MPN instead.
+
+ * configure.in (*-*-sco3.2v5*): Force ac_cv_archive_cmds_need_lc=no,
+ until libtool does this itself.
+ * gmp.texi (Known Build Problems): Remove SCO -lc problem.
+
+ * configure, INSTALL.autoconf, etc: Update to autoconf 2000-11-29.
+ * acinclude.m4 (GMP_C_SIZES): Use AC_CHECK_SIZEOF.
+ * gmp.texi (Known Build Problems): Remove version.c sed/config.h
+ problem, fixed.
+
+ * ltmain.sh, aclocal.m4: Update to libtool 2000-11-25.
+ * ltconfig: No longer required, but leave an empty dummy for automake.
+ * gmp.texi (Known Build Problems): Remove SunOS native ar ranlib
+ problem, fixed.
+
+ * */Makefile.in, aclocal.m4: Update to automake 2000-11-25.
+ * mpbsd/tests/Makefile.am, mpfr/tests/Makefile.am (check_PROGRAMS):
+ Remove dummy, no longer required.
+ * mpbsd/tests/dummy.c, mpfr/tests/dummy.c: Remove files.
+ * depcomp: Remove file, no longer required (with no-dependencies).
+
+ * texinfo.tex: Update to 2000-11-09.
+ * gmp.texi (Build Options): Mention PDF from gmp.texi.
+ * Makefile.am (MOSTLYCLEANFILES): Add gmp.tmp, from new texinfo.tex.
+
+ * gmp.texi (Build Options): List alphaev56, alphapca56, alphaev67,
+ hppa2.0n and power among supported CPUs.
+
+2000-11-30 Torbjorn Granlund <tege@swox.com>
+
+ * mpz/tests/t-mul.c: Increase max operand size from 2^17 bits
+ to 2^19 bits. Misc cleanups.
+
+2000-11-26 Kevin Ryde <kevin@swox.se>
+
+ * tune/tuneup.c (FIB_THRESHOLD): Cope better with different speeds of
+ odd and even sizes.
+
+ * longlong.h (alpha): Use udiv_qrnnd and count_leading_zeros on all
+ compilers, not just gcc.
+
+ * pre_mod_1.c: Use conditional subtract to always skip a division.
+ (UMUL_TIME, UDIV_TIME): Remove defaults, now in longlong.h.
+
+2000-11-22 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/pa64w/gmp-mparam.h: Retune.
+ * mpn/pa64/gmp-mparam.h: Retune.
+ * mpn/sparc64/gmp-mparam.h: Retune.
+
+2000-11-22 Kevin Ryde <kevin@swox.se>
+
+ * gmp-impl.h (ABOVE_THRESHOLD, BELOW_THRESHOLD): New macros.
+ * mpn/generic/gcdext.c: Use them.
+
+ * mpn/generic/gcdext.c [WANT_GCDEXT_ONE_STEP]: Force only one step.
+ * tune/gcdextos.c, tune/gcdextod.c: New files, one step gcdext, single
+ and double.
+ * tune/Makefile.am (libspeed_la_SOURCES): Add them.
+ (TUNE_MPN_SRCS): Remove gcdext.c.
+ * tune/speed.h, tune/common.c, tune/speed.c: Add measuring.
+ * tune/tuneup.c: Use for GCDEXT_THRESHOLD, plus check if double limb
+ is ever better. Should be more accurate, and hopefully faster.
+
+ * tune/gcdext_single.c: New file, gcdext forced to single limbs.
+ * tune/Makefile.am: Add it.
+ * tune/speed.h, tune/common.c, tune/speed.c: Add measuring, and of
+ invert_limb.
+
+ * tune/speed.h (speed_params r): Use mp_limb_t, not long.
+ * tune/speed.h, tune/common.c: Don't "switch" on "r".
+ * tune/speed.c (r_string): Accept limb sized constants.
+ (choice scale): Add a scale factor (eg. "2.33*mpn_add_n").
+ * tune/common.c (SPEED_ROUTINE_UDIV_QRNND_A): Default r to
+ __mp_bases[10].big_base, being a full limb value.
+
+ * configure.in (alphapca56*-*-*): Use ev5 mpn path.
+ (am29000*-*-*): Remove this, leave the canonical a29k.
+ (z8k*-*-*, z8kx*-*-*): Changed from z8000, since z8k is canonical.
+ (gmp_mpn_functions_optional): Add invert_limb, use for alpha and ia64.
+
+ * configure.in (alloca): Accept yes/no/detect, generate an error if
+ "yes" but not available.
+ * gmp.texi (Build Options): Update.
+
+ * acinclude.m4 (GMP_TRY_ASSEMBLE): Make conftest.out available.
+ (GMP_ASM_ALIGN_FILL_0x90): Use it.
+
+ * acinclude.m4 (GMP_ASM_X86_MMX) [*-*-solaris*]: Check for solaris
+ 2.6 "as" movq bug.
+ * gmp.texi (Notes for Particular Systems): Update x86 MMX note.
+
+2000-11-21 Torbjorn Granlund <tege@swox.com>
+
+ * tune/Makefile.am (EXTRA_DIST): List hppa2w.asm.
+
+ * tune/hppa2.asm: Change level directive to "2.0n".
+ * tune/hppa2w.asm: New file.
+ * configure.in [SPEED_CYCLECOUNTER_OBJS switch]: Separate out hppa2.0w.
+
+ * mpn/pa64/gmp-mparam.h (BITS_PER_LONGINT): 64 => 32.
+
+2000-11-21 Kevin Ryde <kevin@swox.se>
+
+ * urandom.h (random): No prototype if glibc stdlib.h has already
+ provided it (avoids an int32_t/long conflict).
+
+ * tune/Makefile.am (LDFLAGS): Use -all-static.
+ (speed-dynamic): Dynamic linked version of speed.c.
+ * tune/README: Update.
+
+ * mpn/generic/gcd.c (find_a): Use native version if available.
+ * acconfig.h (HAVE_NATIVE_mpn_gcd_finda): Add #undef.
+ * gmp-impl.h (mpn_gcd_finda): Add prototype and define.
+ * mpn/asm-defs.m4 (mpn_gcd_finda): New define_mpn.
+ * tune/gcd_finda_gen.c: #undef any HAVE_NATIVE_mpn_gcd_finda.
+ * configure.in (gmp_mpn_functions_optional): Add gcd_finda.
+ * mpn/x86/k6/gcd_finda.asm: New file.
+
+ * tune/tuneup.c (POWM_THRESHOLD): Slightly bigger size steps.
+
+ * gmp-impl.h (__GMP_IMPL_H__): Protect against multiple inclusion.
+ * tune/gcd_bin.c, tune/powm_mod.c, tune/powm_redc.c: Use #undef after
+ gmp-impl.h to force thresholds.
+ * tune/tuneup.c (print_define, fft): No need for #ifndefs on
+ thresholds any more.
+
+2000-11-20 Torbjorn Granlund <tege@swox.com>
+
+ * mpz/tests/t-powm.c: Analogous changes as made 2000-11-12 to t-mul.c.
+ * mpz/tests/t-powm_ui.c: Likewise.
+ * mpz/tests/t-pow_ui.c: Likewise.
+ * mpz/tests/t-root.c: Likewise.
+
+ * configure.in [compiler switch]: Pass "-Aa -D_HPUX_SOURCE" to cc for
+ all hppa versions.
+
+ * mpn/hppa/hppa1_1/udiv_qrnnd.S: Reference data using PC relative
+ addressing (was r19 relative addressing).
+
+2000-11-18 Torbjorn Granlund <tege@swox.com>
+
+ * rand.c: (__gmp_rand_lc_scheme): Convert strings to hexadecimal.
+ (gmp_randinit): Expect strings in hexadecimal.
+
+2000-11-18 Kevin Ryde <kevin@swox.se>
+
+ * configfsf.guess, configfsf.sub: Update to 2000-11-16.
+ * config.guess (alpha*-*-openbsd*): Do exact cpu detection.
+
+2000-11-14 Torbjorn Granlund <tege@swox.com>
+
+ * mpz/tests/t-fdiv.c: Analogous changes as made 2000-11-12 to t-mul.c.
+ * mpz/tests/t-tdiv_ui.c: Likewise.
+ * mpz/tests/t-fdiv_ui.c: Likewise.
+ * mpz/tests/t-sqrtrem.c: Likewise.
+ * mpz/tests/t-gcd.c: Likewise.
+
+2000-11-13 Kevin Ryde <kevin@swox.se>
+
+ * mpn/Makeasm.am: New file, splitting out assembler rules.
+ * mpn/Makefile.am, tune/Makefile.am: Use it.
+
+ * mpn/Makefile.am (@CPP@): Remove this, automake already gives it.
+
+ * configure.in (AC_CHECK_LIBM): New test, and AC_SUBST it.
+ * Makefile.am (MPFR_LIBADD_OPTION): Use it.
+ * demos/Makefile.am (qcn_LDADD): Ditto.
+ * tune/Makefile.am (libspeed_la_LIBADD): Ditto.
+ * tests/rand/Makefile.am (libstat_la_LIBADD): Ditto.
+
+ * tune/time.c (timeval_diff_secs): Better calculation.
+ (read_real_time): New measuring method for AIX power/powerpc.
+ (speed_endtime): Protect against negative times.
+ * tune/common.c (speed_measure): Protect against big reps.
+ * tune/freq.c (speed_cpu_frequency_measure_one): Better timeval diff.
+ * tune/speed.h (TIMEVAL_DIFF_SEC,USEC): Remove macros.
+ * configure.in: (sys/systemcfg.h, read_real_time): New tests.
+
+2000-11-13 Torbjorn Granlund <tege@swox.com>
+
+ * mpz/tests/t-mul.c: Remove #include urandom.h.
+ * mpz/tests/t-tdiv.c: Likewise.
+
+ * configure.in [SPEED_CYCLECOUNTER_OBJS switch]:
+ Declare hppa.asm as just 32 bits (cyclecounter_size=1).
+
+2000-11-12 Torbjorn Granlund <tege@swox.com>
+
+ * mpz/tests/t-mul.c
+ (main): Generate random numbers using gmp_rand* functions.
+ (main): Distribute random numbers non-uniformly.
+ (main): Seed by current time if GMP_CHECK_RANDOMIZE is set.
+ (_mpn_mul_classic): Streamline.
+ * mpz/tests/t-tdiv.c: Analogous changes.
+
+ * demos/pexpr.c (HAVE_sigaltstack): Fix typo in testing for _UNICOS.
+ Also test for __hpux.
+
+2000-11-11 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/alpha/ev5/gmp-mparam.h: Retune.
+
+ * mpn/alpha/ev6/gmp-mparam.h: Retune.
+
+ * mpn/alpha/ev6/add_n.asm: Misc cleanups.
+
+ * mpn/alpha/ev6/sub_n.asm: New file.
+
+2000-11-10 Torbjorn Granlund <tege@swox.com>
+
+ * configure.in [path switch] (alphaev6*-*-*): Add alpha/ev5 to path.
+
+ * mpn/alpha/ev6/add_n.asm: New file.
+
+2000-11-10 Kevin Ryde <kevin@swox.se>
+
+ * mpz/powm.c (redc): Make global under WANT_REDC_GLOBAL.
+ * tune/powm_mod.c, tune/powm_redc.c: New files.
+ * tune/Makefile.am (libspeed_la_SOURCES): Add them.
+ * tune/*: Add measuring of redc, mpz_mod, mpz_powm_mod, mpz_powm_redc.
+
+ * tune/tuneup.c (POWM_THRESHOLD): Determine from redc and mpz_mod.
+ * tune/Makefile.am (TUNE_MPZ_SRCS): Remove powm.
+
+2000-11-10 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/mips3/gmp-mparam.h: Retune.
+
+ * configure.in (os_64bit): Rename to check_64bit_compiler.
+
+2000-11-09 Torbjorn Granlund <tege@swox.com>
+
+ * configure.in [SPEED_CYCLECOUNTER_OBJS switch]: Choose hppa/hppa2 code
+ depending on $CC64.
+
+2000-11-09 Kevin Ryde <kevin@swox.se>
+
+ * mpn/x86/pentium/mul_1.asm: Unroll 2x, saving 1 c/l when in L1.
+ Add 1c entrypoint.
+ * mpn/x86/pentium/aorsmul_1.asm: Add 1c entrypoints, shave a couple
+ of cycles at entry and exit.
+
+ * configure.in (power1,2,2sc): Support these as synonyms for plain
+ power.
+
+ * acinclude.m4 (GMP_ASM_X86_SHLDL_CL): GMP_DEFINE WANT_SHLDL_CL here.
+ (GMP_ASM_X86_MMX, GMP_ASM_X86_SHLDL_CL): Add X86 into the names.
+ * configure.in: Consequent changes.
+
+ * gmp.texi (Notes for Particular Systems): Remarks about power/powerpc.
+ (Reentrancy): Remarks about simultaneous writing.
+ (Reporting Bugs): Ask for configfsf.guess.
+
+2000-11-08 Kevin Ryde <kevin@swox.se>
+
+ * acinclude.m4 (GMP_FUNC_ALLOCA): New macro.
+ * configure.in: Use it.
+ * gmp-impl.h (alloca): Conditionals and setups as per autoconf
+ (should make alloca available on more non-gcc compilers).
+
+ * acinclude.m4: Misc reformatting, simplify some quoting.
+ (GMP_ASM_UNDERSCORE, GMP_ASM_X86_MCOUNT): Use $CC $CFLAGS $CPPFLAGS.
+ (GMP_ASM_UNDERSCORE, GMP_ASM_ALIGN_FILL_0x90, GMP_ASM_RODATA): Put
+ AC_REQUIREs outside AC_CACHE_CHECK.
+ (GMP_C_SIZES): Use $srcdir/gmp.h, not -I; use $CPPFLAGS.
+ (GMP_ASM_UNDERSCORE): Use "gmp_compile" variable, and only rm
+ conftes1* conftes2*.
+ (GMP_PROG_NM): New macro, require it in appropriate GMP_ASM_*.
+ (GMP_TRY_ASSEMBLE): New macro, use it in various GMP_ASM_*.
+ * configure.in: Use GMP_PROG_NM.
+
+ * mpn/tests/spinner.c (spinner_signal): Use RETSIGTYPE.
+ (spinner_init): Force output to unbuffered.
+
+ * mpn/x86/README.family: Notes about GOT table and imul, misc updates.
+ * mpn/x86/k7/diveby3.asm: Change to 3 operands for immediate imul.
+ * mpn/x86/k6/diveby3.asm: Ditto.
+
+2000-11-06 Torbjorn Granlund <tege@swox.com>
+
+ * urandom.h: Simplify and make it work properly for 64-bit
+ machines also in environments without `random'.
+
+2000-11-04 Torbjorn Granlund <tege@swox.com>
+
+ * configure.in [path switch]: Don't match rs6000-*-*, in
+ particular don't assume POWER.
+
+ * tune/tuneup.c (fft): Remove usleep calls.
+
+ * config.guess: Don't pass "$@" when it is known to be empty.
+
+ * Makefile.am (EXTRA_DIST): List configfsf.guess and configfsf.sub.
+
+2000-11-04 Kevin Ryde <kevin@swox.se>
+
+ * configfsf.guess, configfsf.sub: Moved from config.guess and
+ config.sub.
+ * config.guess, config.sub: New files, wrappers around around
+ configfsf versions.
+ * configfsf.guess: Update to FSF 2000-10-23.
+ * configfsf.sub: Update to FSF 2000-10-25.
+
+ * acinclude.m4 (GMP_ASM_POWERPC_R_REGISTERS): New macro.
+ * mpn/powerpc32/powerpc-defs.m4: New file, regmap.m4 r0 etc macros
+ conditionalized by GMP_ASM_POWERPC_R_REGISTERS.
+ * mpn/powerpc32/regmap.m4: Remove file.
+ * configure.in (powerpc*-*-*): Use all this.
+
+ * mpz/divegcd.c: New file, providing mpz_divexact_gcd.
+ * Makefile.am, mpz/Makefile.am: Add it.
+ * gmp-impl.h (mpz_divexact_gcd): Add prototype.
+ * mpq/aors.c,canonicalize.c,div.c,mul.c: Use it.
+
+ * longlong.h [pentium] (count_leading_zeros): New macro.
+ (__clz_tab): Always provide prototype.
+ * acconfig.h (HAVE_TARGET_CPU_): Add x86s.
+
+ * tune/speed.[ch],common.c (count_leading_zeros,
+ count_trailing_zeros, __udiv_qrnnd_c): Add measuring.
+
+ * configure.in (X86_PATTERN): Move from here ...
+ * acinclude.m4 (X86_PATTERN): ... to here.
+ (GMP_ASM_RODATA): Use it.
+
+ * configure.in (srandom): New test.
+ * mpn/tests/try.c: Use it.
+ * tune/speed.c: Ditto, and conditionalize getrusage and headers.
+
+2000-11-02 Kevin Ryde <kevin@swox.se>
+
+ * mpn/Makefile.am (nodist_libdummy_la_SOURCES): Add udiv_qrnnd.c
+ and udiv_w_sdiv.c.
+
+ * mpn/generic/mul_n.c (mpn_kara_sqr_n): Remove a duplicate
+ subtract at the evaluate stage.
+
+2000-11-01 Torbjorn Granlund <tege@swox.com>
+
+ * configure.in [compiler switch] (sparc64-*-linux*): Spell
+ gmp_xoptcflags_gcc properly, and pass same options as for other
+ sparcv9 configs.
+
+ * tune/speed.h (SPEED_ROUTINE_MPN_GET_STR): Fix type of wsize.
+
+2000-10-31 Torbjorn Granlund <tege@swox.com>
+
+ * configure.in [compiler switch] (sparc64-*-linux*): Remove -mvis
+ from gmp_xoptflags_gcc, this might not be an ultrasparc.
+ Remove -m32 from gmp_cflags_gcc; add -Wa,-xarch=v8plus.
+
+2000-10-29 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/ia64/lorrshift.asm: New file.
+
+ * configure.in: New mulfunc `lorrshift' for lshift and rshift.
+
+2000-10-29 Kevin Ryde <kevin@swox.se>
+
+ * mpn/generic/mul_n.c (mpn_kara_sqr_n): Delete code performing
+ superfluous mpn_sub_n calls.
+
+ * configure.in (found_asm, M4): Account for SPEED_CYCLECOUNTER_OBJ,
+ for the benefit of targets whose only .asm is a cycle counter.
+
+ * tune/tuneup.c (fft): Remove bogus usleep calls.
+
+2000-10-28 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/ia64/invert_limb.asm: Get return value for 0x800...00 right.
+
+ * tune/Makefile.am (EXTRA_DIST): Add ia64.asm.
+
+ * tune/ia64.asm: Fix typo.
+
+ * add_n.asm addmul_1.asm mul_1.asm popcount.asm sub_n.asm:
+ Preserve ar.lc as required by ABI.
+ * longlong.h (ia64 udiv_qrnnd): New.
+
+ * configure.in [path switch] (ia64*-*-*): Set extra_functions.
+ * mpn/ia64/invert_limb.asm: New file.
+
+2000-10-27 Torbjorn Granlund <tege@swox.com>
+
+ * configure.in [compiler switch]:
+ Get rid of c89 for all hppa flavours--it is an evil compiler!
+
+ * tune/speed.h (SPEED_ROUTINE_MPN_SET_STR): Fix type of xp.
+ (SPEED_ROUTINE_MPN_GET_STR): Fix type of wp.
+
+2000-10-27 Kevin Ryde <kevin@swox.se>
+
+ * gmp.texi (Fibonacci Number Algorithm): New section.
+
+ * mpz/tests/t-fib_ui.c: New file.
+ * mpz/tests/Makefile.am (check_PROGRAMS): Add it.
+
+ * mpz/fib_ui.c: Rewrite, same formulas but using mpn functions and
+ some lookup tables, much faster at small to moderate sizes.
+ * gmp-impl.h (MPZ_FIB_SIZE): New macro.
+ (FIB_THRESHOLD): Establish default here.
+ * tune/tuneup.c (FIB_THRESHOLD): Start search after the new table
+ data.
+
+ * mpn/x86/x86-defs.m4 (mcount_movl_GOT_ebx): Rename from movl_GOT_ebx,
+ and don't use GSYM_PREFIX with _GLOBAL_OFFSET_TABLE_.
+
+ * tune/freq.c (speed_cpu_frequency_measure): New test comparing
+ gettimeofday and speed_cyclecounter, should cover many systems.
+
+2000-10-27 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/ia64/gmp-mparam.h: Retune.
+
+2000-10-26 Torbjorn Granlund <tege@swox.com>
+
+ * longlong.h (ia64): Set UMUL_TIME and UDIV_TIME.
+
+ * mpn/ia64/submul_1.c: Fix typo.
+
+2000-10-25 Kevin Ryde <kevin@swox.se>
+
+ * tune/freq.c (speed_cpu_frequency_sysctl): New test, supporting
+ hw.model for BSD flavours.
+ * configure.in (sysctl, sys/param.h): New tests.
+
+2000-10-24 Torbjorn Granlund <tege@swox.com>
+
+ * tune/freq.c: Explicitly #include config.h before other include files.
+
+ * mpz/tests/reuse.c (FAIL2): New #define.
+ (main): Use FAIL2. Now this test properly returns non-zero exit
+ status when it fails.
+
+ * mpn/powerpc32/gmp-mparam.h: Retune.
+ * mpn/powerpc64/gmp-mparam.h: Retune.
+
+2000-10-24 Kevin Ryde <kevin@swox.se>
+
+ * mpn/x86/k6/cross.pl: Support 8 and 16 byte code alignment.
+
+ * mpq/aors.c, mpq/canonicalize.c: Skip two mpz_divexact calls if
+ gcd gives 1, which should be 60% of the time.
+ * gmp-impl.h (MPZ_EQUAL_1_P): New macro.
+ * mpq/mul.c, mpq/div.c: Use it, and a new DIV_OR_SET.
+
+ * tune/tuneup.c (xp_block, yp_block): Initialize these with random
+ data. Fixes GCD_ACCEL and GCDEXT thresholds, and latest POWM.
+
+2000-10-23 Torbjorn Granlund <tege@swox.com>
+
+ * configure.in [SPEED_CYCLECOUNTER_OBJS switch]: Add ia64 case.
+
+ * mpn/ia64/gmp-mparam.h: Fill in some parameters.
+
+ * mpn/ia64/submul_1.c: New file.
+
+ * tune/ia64.asm: New file.
+
+ * gmp-impl.h (union ieee_double_extract): Handle ia64.
+
+ * mpn/mp_bases.c: Decrease chars_per_bit_exactly for entry 1 to
+ work around buggy ia64-linux.
+
+ * longlong.h (ia64 umul_ppmm): Update register flags to match new GCC.
+
+2000-10-22 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/alpha/ev6/gmp-mparam.h (DC_THRESHOLD): Update.
+ * mpn/alpha/ev6/submul_1.asm: New file.
+
+2000-10-22 Kevin Ryde <kevin@swox.se>
+
+ * tune/gcd_bin.c: New file.
+ * tune/gcd_finda_gen.c: New file.
+ * tune/Makefile.am (libspeed_la_SOURCES): Add them.
+ * tune/speed.[ch],common.c (mpn_gcd_binary, find_a): Add measuring.
+
+ * * (__gmp_allocate_func etc): Rename from _mp_allocate_func etc.
+ (__gmp_default_allocate etc): Rename from _mp_default_allocate etc.
+ * gmp-impl.h (__GMP_REALLOCATE_FUNC_TYPE,
+ __GMP_REALLOCATE_FUNC_LIMBS): New macros.
+
+ * gmp-impl.h (DC_THRESHOLD): Establish default here, set to 3*KARA
+ since that's the measured average.
+ * mpn/generic/dc_divrem_n.c, mpn/generic/tdiv_qr.c (DC_THRESHOLD):
+ Remove default.
+
+2000-10-21 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/Makefile.am (TARG_DIST): Add ia64.
+
+2000-10-21 Kevin Ryde <kevin@swox.se>
+
+ * *: Change BZ -> DC.
+ * mpn/generic/dc_divrem_n.c: Renamed from bz_divrem_n.c.
+
+ * doc/multiplication: Remove file, now in the manual.
+ * doc/assembly_code: Ditto.
+ * tune/README: Remove some parts now in the manual.
+
+ * gmp.texi (@m etc): Add and use some new macros.
+ (Integer Division - mpz_[cft]div_*): Merge descriptions, for brevity
+ and to emphasise similarities.
+ (Low-Level Functions - mpn_[lr]shift): Specify count as 1 to
+ mp_bits_per_limb-1.
+ (Algorithms): New chapter.
+ (References): Add some papers.
+
+ * mpn/generic/mul_n.c (mpn_toom3_mul_n, mpn_toom3_sqr_n): Remove some
+ unused variables.
+ * mpn/generic/mul_fft.c (mpn_fft_best_k): Ditto.
+
+ * tune/freq.c: New file, split from time.c.
+ * tune/time.c: Rewrite, now more automated.
+ * configure.in, tune/*: Consequent changes.
+
+2000-10-20 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/ia64/default.m4: New file.
+ * configure.in [config.m4 switch] (ia64*-*-*): Use ia64/default.m4.
+
+ * mpn/ia64/mul_1.asm: New file.
+ * mpn/ia64/addmul_1.asm: New file.
+ * mpn/ia64/add_n.asm: New file.
+ * mpn/ia64/sub_n.asm: New file.
+ * mpn/ia64/popcount.asm: New file.
+ * mpn/ia64/README: New file.
+
+ * mpn/alpha/cntlz.asm: Override `.set noat' from ASM_START.
+
+ * configure.in (HAVE_TARGET_CPU_*): Support hppa1.0, hppa1.1, hppa2.0
+ by sed'ing the period into `_'.
+
+ * acconfig.h: Add #undefs for hppa targets.
+
+ * longlong.h (udiv_qrnnd): Fix typo in last change.
+
+ * mpz/tstbit.c: Rewrite (partly to work around GCC 2.95.2 HPPA bug).
+
+ * configure.in [path switch]:
+ (hppa2.0*-*-*): For non-CC64 case, update path.
+
+ * configure.in [compiler switch]:
+ (hppa2.0w-*-*): Match with same regexp in both places.
+ (hppa*-*-*): New case.
+ (all hppa alternatives): Don't inherit default gmp_cflags_cc,
+ gmp_cflags_c89.
+
+2000-10-18 Torbjorn Granlund <tege@swox.com>
+
+ * configure.in (alpha*-*-*): Define gmp_xoptcflags_gcc like for
+ alpha*-*-osf*.
+
+ * longlong.h (x86 udiv_qrnnd): Change `d' => `dx' to avoid K&R C
+ stringification.
+
+2000-10-15 Kevin Ryde <kevin@swox.se>
+
+ * doc/configuration: Updates.
+
+ * demos/calc.y: Remove some comments.
+
+2000-10-14 Kevin Ryde <kevin@swox.se>
+
+ * gmp.texi (Parameter Conventions, Memory Management): New sections
+ split from "Variable Conventions".
+ (Efficiency, Debugging, Profiling): New sections in "GMP Basics".
+ (Reentrancy): Some rewording, add note on standard I/O.
+ (Build options): Add --enable-assert and --enable-profiling.
+
+ * configure.in (--enable-profiling): New option.
+ * acinclude.m4 (GMP_ASM_X86_MCOUNT): New macro, finding how to profile.
+ * mpn/x86/x86-defs.m4 (PROLOGUE_cpu, call_mcount): Profiling support.
+
+ * acinclude.m4, configure.in (GMP_ASM_*): Rename from GMP_CHECK_ASM_*,
+ to follow autoconf conventions.
+
+ * configure.in: Run GMP_CHECK_ASM tests only if needed.
+ * acinclude.m4 (GMP_CHECK_ASM_MMX): Don't use GMP_CHECK_ASM_TEXT.
+
+ * mpn/x86/x86-defs.m4 (ASSERT): Allow no condition, to just emit code.
+
+2000-10-13 Kevin Ryde <kevin@swox.se>
+
+ * mpq/md_2exp.c: New file.
+ * mpq/Makefile.am (libmpq_la_SOURCES): Add it.
+ * Makefile.am (MPQ_OBJECTS): Ditto.
+ * gmp.h (mpq_mul_2exp, mpq_div_2exp): Add prototypes.
+ * gmp.texi (Rational Arithmetic): Add documentation.
+
+ * mpq/tests/t-md_2exp.c: New file.
+ * mpq/tests/Makefile.am (check_PROGRAMS): Add it.
+
+ * mpn/generic/perfsqr.c: Add/amend some comments.
+
+ * gmp.texi (Known Build Problems): Note VERSION problem with old
+ sed, do some minor rewording.
+ (Build Options): Add cygwin and djgpp URLs, mention INSTALL.autoconf,
+ mention HTML.
+ (Getting the Latest Version of GMP): Move this ...
+ (Introduction to GMP): ... to here.
+ (Compatibility with older versions): Just refer to 2.x and 3.x, not
+ every minor version.
+ (Initializing Integers): Note restrictions on mpz_array_init'ed
+ variables.
+ (Integer Logic and Bit Fiddling): Note bits are numbered from 0.
+
+ * INSTALL.autoconf: New file.
+ * Makefile.am (EXTRA_DIST): Add it.
+
+ * tune/Makefile.am, tune/tuneup.c, configure.in, gmp-impl.h: New
+ scheme for recompiled objects used by tune program. Don't use
+ libgmptune.a, make better use of libtool, work with ansi2knr.
+
+ * tune/speed.h,common.c (SPEED_ROUTINE_MPZ_POWM): Use s->yp and
+ s->xp_block, make exponent a fixed size.
+
+2000-10-07 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/mips3/gmp-mparam.h: Retune.
+
+ * mpn/generic/mul_n.c (USE_MORE_MPN): Revert last change.
+
+2000-10-06 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/mips3/add_n.s: Decrease carry recurrence from 4 to 3 cycles.
+ * mpn/mips3/sub_n.s: Likewise.
+
+2000-10-04 Torbjorn Granlund <tege@swox.com>
+
+ * configure.in (sparc64-*-linux*): Set path according to CC64.
+
+2000-10-04 Kevin Ryde <kevin@swox.se>
+
+ * acinclude.m4 (GMP_CHECK_ASM_UNDERSCORE): Use LABEL_SUFFIX, not a
+ hard-coded ":".
+
+ * config.sub: Don't demand "86" in CPU name for SCO.
+
+ * configure.in (supersparc-*-*): Remove -DSUPERSPARC.
+ * longlong.h: Use HAVE_TARGET_CPU_supersparc.
+
+ * configure.in (HAVE_TARGET_CPU_*): AC_DEFINE from $target_cpu.
+ * acconfig.h: Add #undefs, but only for targets of interest.
+
+2000-10-03 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/alpha/cntlz.asm: Rewrite.
+
+ * mp_clz_tab.c (__clz_tab): Half table size to 128 entires.
+ * longlong.h (count_leading_zeros): Demand just 128 entries from
+ __clz_tab.
+
+ * configure.in (mips-sgi-irix6.*): Pass -mips3 in addition to options
+ for n32 ABI.
+
+ * longlong.h: Move NO_ASM test around all assembly code.
+ From gcc:
+ * longlong.h (count_leading_zeros): Sparclite scan instruction was
+ being invoked incorrectly.
+ Replace __mc68332__ with __mcpu32__.
+ Add ARC support.
+
+2000-10-02 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/mips3/gmp-mparam.h: Retune for both gcc and cc.
+
+ * mpn/generic/mul_n.c (USE_MORE_MPN): Remove exception for __mips.
+ (interpolate3): Cast mp_limb_t variables to mp_limb_signed_t
+ when testing sign bit.
+
+ * mpn/alpha/ev6/gmp-mparam.h: Retune.
+ * mpn/powerpc32/gmp-mparam.h: Retune.
+ * mpn/powerpc64/gmp-mparam.h: Retune.
+ * mpn/x86/pentium/gmp-mparam.h: Retune.
+ * mpn/x86/pentium/mmx/gmp-mparam.h: Retune.
+ * mpn/sparc32/v9/gmp-mparam.h: Retune.
+ * mpn/x86/k6/gmp-mparam.h: Retune.
+ * mpn/x86/p6/gmp-mparam.h: Retune.
+ * mpn/x86/k7/gmp-mparam.h: Retune.
+ * mpn/sparc64/gmp-mparam.h: Retune.
+
+ * mpn/m68k/gmp-mparam.h: New file.
+ * mpn/alpha/ev5/gmp-mparam.h: New file.
+
+ * gmp-impl.h (default MPN_COPY): Remove final `;'.
+
+ * tune/time.c (speed_endtime): Rewrite.
+
+ * tune/speed.h (SPEED_ROUTINE_MPZ_POWM): Set base to a large value,
+ not 2.
+
+ * demos/pexpr.c (setup_error_handler): Fix typo.
+
+ * mpz/powm.c (redc): New function, based on old mpz_redc. Don't
+ multiply here.
+ (mpz_redc): Remove.
+ (mpz_powm): Major changes, partially reverting to mpn calls.
+ Multiply before calling redc.
+ (mpz_powm): Use TMP_ allocation.
+ (mpz_powm): Refine calculation of k (width of exponent window).
+ (mpz_powm): Cast constants to mp_limb_t before left shifting.
+
+ * longlong.h: Use ia64 count_leading_zeros just when __GNUC__.
+
+2000-09-29 Kevin Ryde <kevin@swox.se>
+
+ * acinclude.m4 (GMP_C_SIZES): New macro.
+ * configure.in: Use it.
+ * acconfig.in (BYTES_PER_MP_LIMB etc): Add #undefs.
+ * mpn/generic/gmp-mparam.h (BYTES_PER_MP_LIMB etc): Remove #defines.
+ * gmp.texi (Known Build Problems): Remove 64-bit generic C
+ gmp-mparam.h problem, now fixed.
+
+ * configure.in: Only run GMP_PROG_M4 if it's actually needed.
+
+2000-09-27 Torbjorn Granlund <tege@swox.com>
+
+ * demos/pexpr.c: Clean up code for systems not supporting
+ sigaltstack. Handle old Linux without sigaltstack. Properly
+ disable all stuff related to sigaltstack under Unicos.
+
+ * mpn/alpha/ev6/addmul_1.asm: Use explicit offset for all load and
+ store insns. Helps old gas.
+
+ * longlong.h (count_leading_zeros): Define for ia64.
+
+2000-09-27 Paul Zimmermann <Paul.Zimmermann@loria.fr>
+
+ * mpn/generic/bz_divrem_n.c: Fix qhl handling, simplify.
+
+2000-09-27 Kevin Ryde <kevin@swox.se>
+
+ * mpn/Makefile.in (.SUFFIXES): Regenerate with patched automake to
+ get .s before .c, which is needed to override ansi2knr .c rules.
+
+ * gmp.texi (mpn_sqrtrem): Fix r2p==NULL return value description
+ to match the code (change by Torbjorn).
+ (mpn_gcd, mpn_gcdext, mpn_sqrtrem, mpn_tdiv_qr): Note most
+ significant limbs must be non-zero.
+ (mpn_gcd, mpn_gcdext, mpn_sqrtrem): Clarify destination size
+ requirements.
+ (mpn_gcd_1): Clarify value must be non-zero, not just size.
+
+ * gmp-impl.h (mpn_zero_p): New inline function.
+ * mpn/generic/inlines.c: Add gmp-impl.h.
+ * mpf/integer.c, mpz/get_d.c, mpn/generic/mul_fft.c: Use it.
+
+ * mpn/generic/gcd.c: Use MPN_COPY_INCR not MPN_COPY.
+ * mpf/add_ui.c: Ditto.
+ * mpf/add.c: Ditto, and fix test to skip copy.
+
+2000-09-26 Kevin Ryde <kevin@swox.se>
+
+ * gmp-impl.h, longlong.h, mpn/generic/*.c: Add ASSERTs for various
+ parameter restrictions.
+
+ * gmp-impl.h (UDIV_PREINV_TIME): New macro.
+ * mpn/generic/sb_divrem_mn.c: Use it.
+ * mpn/generic/perfsqr.c: Ditto.
+ * mpn/x86/*/gmp-mparam.h (UDIV_PREINV_TIME): Add values.
+
+ * macos/Makefile.in: Add mpz/tests/t-get_si.c, mpf/tests/t-set_f.c,
+ and new multi-function mpz and mpq files.
+
+2000-09-25 Kevin Ryde <kevin@swox.se>
+
+ * randlc.c, randlc2x.c, randsd.c, mpz/urandomb.c, mpz/urandomm.c:
+ Use mpz_ptr and mpz_srcptr for parameters.
+ * gmp.h (gmp_randinit_lc, gmp_randinit_lc_2exp, gmp_randseed,
+ mpz_urandomb, mpz_urandomm): Corresponding change to prototypes.
+ * randsdui.c: Remove wrong K&R parameters part.
+
+2000-09-12 Kevin Ryde <kevin@swox.se>
+
+ * gmp-impl.h (mpn_tdiv_qr): Move prototype from here ...
+ * gmp.h (mpn_tdiv_qr): ... to here.
+
+ * gmp.texi (Miscellaneous Rational Functions): Comment-out and
+ move version 1 compatibility note to "Compatibility" section.
+ (Rational Number Functions): Ditto for canonicalization note.
+
+2000-09-10 Kevin Ryde <kevin@swox.se>
+
+ * mpn/x86/pentium/com_n.asm: New file.
+
+ * gmp.texi (Rational Arithmetic): Add mpq_abs.
+ (Miscellaneous Rational Functions): Merge and simplify descriptions of
+ mpq_get_num, mpq_get_den, mpq_set_num, mpq_set_den.
+
+ * mpq/abs.c: New file.
+ * mpq/Makefile.am (libmpq_la_SOURCES): Add it.
+ * Makefile.am (MPQ_OBJECTS): Add it.
+ * gmp.h (mpq_abs): Add prototype.
+
+ * mpq/set_den.c: Don't discard sign when copying, this makes the
+ code match the manual.
+
+2000-09-07 Torbjorn Granlund <tege@swox.com>
+
+ * tune/alpha.asm: Rewrite to actually work right.
+
+2000-09-07 Kevin Ryde <kevin@swox.se>
+
+ * tune/common.c,speed.[ch]: Add measuring of mpn_sqrtrem,
+ mpn_get_str, mpn_set_str.
+ * tune/README: Various updates.
+
+2000-09-06 Torbjorn Granlund <tege@swox.com>
+
+ * mpz/fits.c: Correct type of `data'.
+
+2000-09-06 Kevin Ryde <kevin@swox.se>
+
+ * gmp.texi (Build Options): Clarify where to find CFLAGS.
+ (Known Build Problems): Note SCO -lc problem.
+
+ * tune/speed.h (SPEED_ROUTINE_MPN_GCD_CALL): Fix for sizes > 512 limbs.
+
+ * doc/multiplication: Corrections and additions suggested by Paul.
+
+ * tune/modlinv.c: New file with alternate modlimb_inverts.
+ * tune/Makefile.am, tune/speed.[ch]: Add measuring of them.
+ * tune/speed.c (FLAG_NODATA): New attribute, use for mpz_bin_uiui,
+ mpz_fib_ui, mpz_fac_ui.
+
+ * mpn/x86/t-zdisp.sh: New file.
+
+ * tests/t-modlinv.c: New file.
+ * tests/Makefile.am (check_PROGRAMS): Add it.
+
+ * mpq/tests/t-set_f.c: New file.
+ * mpq/tests/Makefile.am (check_PROGRAMS): Add it.
+
+ * gmp-impl.h (MPQ_CHECK_FORMAT): New macro.
+ * mpq/tests/t-get_d.c: Use it.
+
+ * mpq/set_f.c: New file.
+ * mpq/Makefile.am (libmpq_la_SOURCES): Add it.
+ * Makefile.am (MPQ_OBJECTS): Ditto.
+ * gmp.h: Add prototype.
+ * gmp.texi (Miscellaneous Rational Functions): Document mpq_set_f,
+ correct return type of mpq_set_d.
+
+2000-09-03 Kevin Ryde <kevin@swox.se>
+
+ * mpz/aors_ui.c: New file merging add_ui.c and sub_ui.c, no object
+ code changes.
+ * mpz/add_ui.c, mpz/sub_ui.c: Remove files.
+ * mpz/Makefile.am: Update.
+
+ * gmp-impl.h (MPZ_FITS_STYPE_SDT, MPZ_FITS_UTYPE_SDT): New macros.
+ * mpz/fits.c: New file merging six separate fits*.c.
+ * mpz/fits_sshort_p.c, fits_sint_p.c, fits_slong_p.c, fits_ushort_p.c,
+ fits_uint_p.c, fits_ulong_p.c: Remove files
+ * mpz/Makefile.am: Use new fits.c, change object names from
+ fits_*_p.lo to fits_*.lo to avoid SunOS 4 native "ar" warnings.
+ * Makefile.am (MPZ_OBJECTS): Change from fits_*_p.lo to fits_*.lo.
+
+ * acinclude.m4 (GMP_CHECK_ASM_RODATA): New macro, defining RODATA.
+ * configure.in: Use it.
+ * mpn/x86/k[67]/mmx/popham.asm: Use it.
+
+ * mpn/x86/*/*.asm: Use "TEXT" not ".text".
+
+2000-09-02 Kevin Ryde <kevin@swox.se>
+
+ * mpq/aors.c: New file merging add.c and sub.c, no object code changes.
+ * mpq/add.c, mpq/sub.c: Remove files.
+ * mpq/Makefile.am: Update.
+
+ * mpz/aors.c: New file merging add.c and sub.c, no object code changes.
+ * mpz/add.c, mpz/sub.c: Remove files.
+ * mpz/Makefile.am, mpbsd/Makefile.am: Update.
+
+ * configure.in: Re-apply "PROLOGUE.*" regexp change for the
+ benefit of alpha PROLOGUE_GP, lost in path search reorganisation.
+
+ * mpn/x86/x86-defs.m4 (jadcl0, cmov_simulate, ASSERT,
+ movl_text_address): Don't use "1:" style labels.
+ (Zdisp): Rearrange a bit, switch to all hex.
+ * mpn/x86/README.family: Note SCO "as" doesn't support "1:" style
+ local labels, misc rewordings.
+
+2000-08-29 Torbjorn Granlund <tege@swox.com>
+
+ * demos/primes.c: Include string.h.
+
+ * config.guess (x86 variant recog code): Remove dummy*.o files
+ generated by some compilers.
+
+2000-08-28 Kevin Ryde <kevin@swox.se>
+
+ * acinclude.m4 (GMP_CHECK_ASM_ALIGN_FILL_0x90): Fix Solaris 2.8
+ warning message suppression, add notes about SCO.
+
+ * Makefile.am (MPZ_OBJECTS etc): Move some comments.
+
+2000-08-25 Kevin Ryde <kevin@swox.se>
+
+ * mpz/pprime_p.c (mpz_millerrabin): Fix a TMP_FREE.
+
+ * gmp.texi (Copying): Refer to Lesser not Library GPL.
+ (GMP and Reentrancy): Note stack-alloc.c is not reentrant, and
+ that SCO <ctype.h> is potentially not reentrant.
+
+ * acinclude.m4 (GMP_CHECK_ASM_UNDERSCORE): Test by attempting to
+ link with or without an underscore.
+ * gmp.texi (Known Build Problems): Remove SunOS 4 native grep
+ GSYM_PREFIX problem, now fixed.
+
+ * gmp-impl.h (MODLIMB_INVERSE_3): New constant.
+ * mpn/generic/diveby3.c: Use it instead of own INVERSE_3.
+ * mpn/generic/mul_n.c: Ditto.
+ * tests/t-constants.c: Check it, and PP_INVERTED too.
+
+ * acinclude.m4 (GMP_GCC_MARCH_PENTIUMPRO): New macro.
+ * configure.in [p6 and athlon] (gmp_optcflags_gcc): Use it to
+ possibly add -march=pentiumpro.
+
+ * gmp-impl.h (MPZ_SET_STR_OR_ABORT, MPF_SET_STR_OR_ABORT): New macros.
+ * mpz/tests/t-bin.c, mpz/tests/t-get_si.c, mpz/tests/t-jac.c,
+ mpz/tests/t-misc.c: Use them.
+ * mpf/tests/t-conv.c, mpf/tests/t-misc.c: Ditto.
+ * mpz/tests/convert.c: Ditto and amend diagnostics slightly.
+ * mpz/tests/t-misc.c (check_mpz_set_si): Remove a superfluous init.
+ * mpz/tests/io.c: Differentiate between I/O and data conversion errors.
+
+ * mpn/generic/aors_n.c: New file merging add_n and sub_n, no
+ object code changes.
+ * mpn/generic/add_n.c: Remove file.
+ * mpn/generic/sub_n.c: Remove file.
+
+ * mpn/generic/aorsmul_1.c: New file merging addmul_1 and submul_1,
+ no object code changes.
+ * mpn/generic/addmul_1.c: Remove file.
+ * mpn/generic/submul_1.c: Remove file.
+
+ * mpn/generic/popham.c: New file merging popcount and hamdist, no
+ object code changes.
+ * mpn/generic/popcount.c: Remove file.
+ * mpn/generic/hamdist.c: Remove file.
+
+2000-08-24 Torbjorn Granlund <tege@swox.com>
+
+ * gmp-impl.h (mpn_com_n): Fix typo.
+
+2000-08-23 Torbjorn Granlund <tege@swox.com>
+
+ * demos/primes.c (main): Don't call mpz_probab_prime_p for numbers
+ that are known to be prime after sieving.
+ (main): Declare and initialize max_s_prime_squared.
+ (MAX_S_PRIME): Increase.
+ (ST_SIZE): Increase.
+
+2000-08-23 Kevin Ryde <kevin@swox.se>
+
+ * gmp-impl.h (ASSERT_ALWAYS): Change to statement style.
+ (JACOBI_TWO_U_BIT1): Remove ASSERT.
+ (MPZ_CHECK_FORMAT): Use ASSERT_ALWAYS as a statement.
+
+2000-08-21 Torbjorn Granlund <tege@swox.com>
+
+ * gmp-impl.h (ASSERT): Use do..while for dummy version.
+
+ * mpf/get_str.c: Don't set n_digits from digits_computed_so_far
+ when the converted operand becomes zero. Misc cleanups.
+
+2000-08-21 Kevin Ryde <kevin@swox.se>
+
+ * mpz/fdiv_r_2exp.c, mpz/lcm.c, mpz/urandomm.c: Add missing
+ TMP_MARK/FREE, avoiding memory leak when using stack-alloc.c.
+
+2000-08-20 Kevin Ryde <kevin@swox.se>
+
+ * mpz/set.c [BERKELEY_MP] (move): Add conditionals to build as
+ "move" for libmp.
+ * mpbsd/Makefile.am: Use mpz/set.c, not move.c.
+ * Makefile.am (MPBSD_OBJECTS): Corresponding change.
+ * mpbsd/move.c: Remove file.
+
+ * mpn/Makefile.am, mpz/Makefile.am, mpq/Makefile.am, mpf/Makefile.am,
+ mpbsd/Makefile.am (-DOPERATION_foo): Use "foo" even for ansi2knr
+ "foo_" objects. Do this with the makefiles to keep the sources
+ cleaner.
+ * mpz/mul_siui.c, mpf/integer.c: Revert to plain OPERATION_* forms.
+
+ * mpn/lisp/gmpasm-mode.el (gmpasm-remove-from-list): Renamed from
+ gmpasm-delete-from-list, because it's non-destructive.
+ (gmpasm-font-lock-keywords): Add some more keywords.
+
+2000-08-16 Kevin Ryde <kevin@swox.se>
+
+ * tune/mul_n_mpn.c, tune/mul_n_open.c: New files, being forced
+ open-coded and mpn #includes of mpn/generic/mul_n.c.
+ * tune/*: Add measuring of them.
+ * tune/speed.c: Print command line into *.gnuplot file.
+
+ * mpn/generic/mul_n.c (USE_MORE_MPN): Change to #if not #ifdef for
+ using the value, add #ifndef for providing the default.
+ * mpn/sparc64/gmp-mparam.h (USE_MORE_MPN): Add #ifndef.
+
+ * tests/t-constants.c: New file.
+ * tests/Makefile.am (check_PROGRAMS): Add it.
+
+ * mpz/get_si.c: Use LONG_MAX, not BITS_PER_MP_LIMB, so the result
+ doesn't depend on limb size when outside the range of a long
+ (though such results are not actually documented).
+ * mpz/tests/t-get_si.c: New file.
+ * mpz/tests/Makefile.am (check_PROGRAMS): Add it.
+
+ * mpn/tests/try.c (call): Cast popcount and hamdist calls,
+ for the benefit of long long limb.
+
+2000-08-15 Kevin Ryde <kevin@swox.se>
+
+ * mp.h (mp_set_memory_functions): Add missing #define.
+ * mpbsd/tests/allfuns.c (mp_set_memory_functions): Verify its
+ existence.
+
+ * mpf/tests/t-misc.c (check_mpf_getset_prec): New test, verifying
+ reverted behaviour of mpf_get_prec.
+
+ * mpn/tests/ref.c (refmpn_strip_twos): Use refmpn_copyi, not
+ MPN_COPY_INCR.
+
+ * mpz/mul_siui.c, mpf/integer.c: Recognise OPERATION_*_ forms
+ produced under ansi2knr.
+
+ * configure.in (mpn_objects, mpn_objs_in_libgmp): Add $U to .c
+ objects when ansi2knr in use.
+
+ * mpn/Makefile.am (AUTOMAKE_OPTIONS): Enable ansi2knr.
+ (libdummy.la): Add this, not built, to create ansi2knr style rules
+ for all potential .c files.
+ * mpz/Makefile.am, mpq/Makefile.am, mpf/Makefile.am, mpfr/Makefile.am,
+ mpbsd/Makefile.am, mpq/tests/Makefile.am, tests/Makefile.am
+ (AUTOMAKE_OPTIONS): Enable ansi2knr (now everywhere).
+ * Makefile.am (MPZ_OBJECTS, MPQ_OBJECTS, MPF_OBJECTS, MPFR_OBJECTS,
+ MPBSD_OBJECTS, libmp_la_DEPENDENCIES): Add $U to all .lo filenames.
+
+2000-08-03 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/alpha/ev6/addmul_1.asm: Correct number of cycles to 3.5/28.
+
+2000-08-02 Torbjorn Granlund <tege@swox.com>
+
+ * Version 3.1 released.
+
+ * gmp.texi: Rephrase mpf_urandomb documentation.
+
+ * mpn/alpha/ev6: New directory with ev6/21264 optimized code.
+ * mpn/alpha/ev6/addmul_1.asm: New file.
+ * mpn/alpha/ev6/gmp-mparam.h: New file.
+
+2000-08-02 Kevin Ryde <kevin@swox.se>
+
+ * demos/factorize.c (random): Don't use "inline".
+
+ * mpfr/log.c, mpfr/mul_ui.c, mpfr/round.c, mpfr/set.c, mpfr/set_d.c:
+ Corrections to K&R parts.
+
+ * Makefile.am (EXTRA_HEADERS): Omit $(MPFR_HEADERS_OPTION).
+ * mpfr/Makefile.am (EXTRA_DIST): Add mpfr.h.
+
+ * gmp.texi (Known Build Problems): Note problem stripping libgmp.a.
+
+2000-08-02 Kent Boortz <kent@swox.com>
+
+ * mpfr: Integrated experimental version of mpfr-0.4.
+ * configure.in: Changes for option --enable-mpfr.
+ * Makefile.am: Changes for option --enable-mpfr.
+
+2000-08-01 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/generic/popcount.c: Disable SPARC v9 popc_limb pattern.
+ * mpn/generic/hamdist.c: Likewise.
+
+2000-08-01 Kevin Ryde <kevin@swox.se>
+
+ * mpn/tests/try.c (try_init): Account for ALIGNMENTS when sizing
+ source and dest regions.
+
+2000-07-31 Torbjorn Granlund <tege@swox.com>
+
+ * mpf/get_str.c: Develop three extra digits, not just one.
+
+2000-07-31 Kevin Ryde <kevin@swox.se>
+
+ * gmp.texi (References): Add URL for invariant division.
+
+2000-07-30 Kevin Ryde <kevin@swox.se>
+
+ * tune/time.c (speed_cpu_frequency_proc_cpuinfo): Add support for
+ alpha linux "cycle frequency".
+
+ * mpn/sparc64/gmp-mparam.h: Re-run tune program for FFT thresholds.
+
+2000-07-29 Kevin Ryde <kevin@swox.se>
+
+ * gmp.texi (ABI and ISA): Add sparc64-*-linux*.
+ * configure.in [sparc64-*-linux*] (gmp_cflags64_gcc): Same flags
+ as under solaris.
+
+ * configure.in (--enable-fft): New option, default "no".
+ * gmp.texi (Build Options): Describe it.
+ * mpn/generic/mul.c, mpn/generic/mul_n.c [WANT_FFT]: Use it.
+ * tune/tuneup.c [WANT_FFT]: By default don't probe FFTs if not enabled.
+ * NEWS: Multiplication optionally using FFT.
+
+ * tune/README: Notes on FFT and GCD thresholds, other minor updates.
+
+ * Makefile.am: Expunge the macos generated files update stuff.
+
+2000-07-28 Kevin Ryde <kevin@swox.se>
+
+ * mpn/x86/*/gmp-mparam.h: Add some FFT thresholds.
+
+2000-07-28 Kent Boortz <kent@swox.se>
+
+ * macos/Asm*, macos/CmnObj, macos/Mp*: Delete directories.
+ * macos/Makefile: Delete file.
+ * macos/Makefile.cw: Delete file.
+ * macos/config.h: Delete file.
+ * macos/Asm/*.s: Delete files.
+ * macos/configure: Create target directories. Don't transform
+ '(C)' to '(;)' in a 'dnl' line comment in .asm file.
+ * Makefile.am: Delete macos targets.
+ * macos/README: Reflect that we reverted back to a build
+ process that require ""macos/configure" to run on MacOS.
+ This imply that MacPerl is needed for a build in MacOS.
+
+2000-07-27 Kevin Ryde <kevin@swox.se>
+
+ * mpn/generic/mul_fft.c: New file, by Paul Zimmermann, minor mods
+ applied.
+ * configure.in (gmp_mpn_functions): Add it.
+ * mpn/generic/mul.c, mpn/generic/mul_n.c: Use it.
+ * doc/multiplication: Describe it (briefly).
+
+ * gmp-impl.h (FFT_MUL_THRESHOLD etc): New thresholds.
+ (mpn_fft_best_k, mpn_fft_next_size, mpn_mul_fft, mpn_mul_fft_full):
+ New functions.
+ (numberof, TMP_ALLOC_TYPE etc, _MP_ALLOCATE_FUNC_TYPE etc,
+ UNSIGNED_TYPE_MAX etc): New macros.
+
+ * tune/*: Add FFT threshold tuning and speed measuring.
+ * tune/common.c: Avoid huge macro expansions for umul and udiv.
+
+ * mpz/tests/t-bin.c, mpz/tests/t-jac.c, mpz/tests/t-misc.c,
+ mpbsd/tests/t-misc.c, mpf/tests/t-misc.c, mpn/tests/try.c,
+ mpn/tests/spinner.c: Use new gmp-impl.h macros.
+
+ * demos/Makefile.am (BUILT_SOURCES): Don't need calc.c etc under this.
+
+2000-07-27 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/ia64/gmp-mparam.h: New file.
+
+2000-07-26 Torbjorn Granlund <tege@swox.com>
+
+ * demos/isprime.c: Handle any number of arguments and print
+ classification for each. Add `-q' option for old behaviour.
+
+2000-07-26 Kevin Ryde <kevin@swox.se>
+
+ * gmp.texi (Build Options): Mention djgpp stack size.
+ (Notes for Package Builds): New section.
+ (Compatibility with older versions): Update for 3.1, add mpf_get_prec.
+
+ * demos/factorize.c [__GLIBC__]: Don't declare random() under glibc.
+
+ * gmp.h (gmp_version): Add prototype and define.
+
+ * Makefile.am: Keep macos directory generated files up-to-date
+ during development and on a "make dist".
+
+2000-07-25 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/hppa/gmp-mparam.h: Update threshold values from new `tune' run.
+
+ * mpn/pa64/gmp-mparam.h: Fill in values from `make tune' run.
+ * mpn/pa64w/gmp-mparam.h: Likewise.
+ * mpn/mips3/gmp-mparam.h: Likewise.
+
+ * tune/hppa2.asm: Fix typo in .level directive.
+
+ * configure.in: Add sparc64-*-linux* support (from Jakub Jelinek).
+ * configure: Regenerate.
+
+ * mpn/sparc64/rshift.asm: Use %g5 instead of volatile stack frame area
+ for return value (from Jakub Jelinek).
+ * mpn/sparc64/lshift.asm: Likewise.
+
+ * mpf/get_prc.c: Revert Aug 8, 1996 change.
+
+ * version.c: No longer static.
+
+ * mpn/pa64/gmp-mparam.h: Only #define *_THRESHOLD if not already
+ defined.
+ * mpn/pa64w/gmp-mparam.h: Likewise.
+ * mpn/arm/gmp-mparam.h: Likewise.
+ * mpn/mips3/gmp-mparam.h: Likewise.
+
+2000-07-25 Kevin Ryde <kevin@swox.se>
+
+ * INSTALL: It's "info -f ./gmp.info" to be sure of hitting the
+ gmp.info in the current directory.
+
+ * Makefile.am (libmp_la_DEPENDENCIES): Add mpz/cmp.lo, for last
+ mpz/powm.c fix.
+
+ * mpn/sparc64/addmul1h.asm, mpn/sparc64/submul1h.asm: Renamed from
+ addmul_1h.asm, submul_1h.asm to avoid name conflicts on an 8.3
+ filesystem.
+ * mpn/sparc64/addmul_1.asm, mpn/sparc64/submul_1.asm,
+ mpn/sparc64/mul_1.asm: Update include_mpn()s.
+
+2000-07-24 Torbjorn Granlund <tege@swox.com>
+
+ * Update header of all files previously under the Library GPL
+ to instead be under the Lesser GPL.
+
+ * COPYING.LIB: Now Lesser GPL.
+ * demos/primes.c: Change license to GPL (was Library GPL).
+ * demos/isprime.c: Change license to GPL (was Library GPL).
+
+ * gmp.h (error code enum): Add GMP_ERROR_BAD_STRING (currently unused).
+
+ * mpz/tests/t-mul.c: Default SIZE to a function of TOOM3_MUL_THRESHOLD.
+ Improve error messages. Decrease reps.
+
+2000-07-22 Kevin Ryde <kevin@swox.se>
+
+ * tune/speed.h: Decrease the amount of data used for gcd and powm
+ measuring, to make the tune go a bit faster.
+
+2000-07-21 Kent Boortz <kent@swox.se>
+
+ * macos/Asm*, macos/CmnObj, macos/Mp*: Directories no longer created
+ from configure script, now part of dist.
+ * macos/Makefile
+ * macos/Makefile.cw
+ * macos/config.h
+ * macos/Asm/*.s
+ New files and directories that is the output from configure. This way
+ no Perl installation is required to build on MacOS, just MPW.
+ * macos/configure: Added prefix '__g' to exported assembler labels.
+ Changed to handle new m4 syntax instead of the old cpp syntax in asm.
+ * macos/Makefile.in: Corrected 'clean' target, added 'distclean'
+ and 'maintainer_clean'. Added "mpn/mp_bases.c" to build.
+ * macos/README: Reflect the new build process without configure.
+ Corrected the file structure for Apple MPW installation.
+
+2000-07-21 Torbjorn Granlund <tege@swox.com>
+
+ * mpf/tests/t-muldiv.c: Relax error limit. Make precision depend
+ on SIZE. Misc changes.
+
+ * configure: Regenerate.
+
+2000-07-20 Kent Boortz <kent@swox.com>
+
+ * macos/Makefile.in: Removed hard coded targets, added special
+ targets found in Makefile.am files.
+ * macos/configure: Generate targets from top configure script and
+ Makefile.am files. Made script runnable from Unix for testing.
+ * macos/README: Notes about search paths for includes, contributed
+ by Marco Bambini.
+ * configure.in: Added comment about lines that the "macos/configure"
+ script depend on.
+
+2000-07-20 Torbjorn Granlund <tege@swox.com>
+
+ * mpz/powm.c (mpz_powm): After final mpz_redc call, subtract `mod'
+ from result if it is greater than `mod'.
+
+2000-07-19 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/hppa/gmp-mparam.h: Fill in values from `make tune' run.
+ * mpn/alpha/gmp-mparam.h: Likewise.
+ * mpn/powerpc32/gmp-mparam.h: Likewise.
+
+ * tune/hppa.asm: New file.
+ * tune/hppa2.asm: New file.
+ * configure.in (SPEED_CYCLECOUNTER_OBJS): Set for hppa2*-*-* and
+ hppa*-*-*.
+ * tune/Makefile.am (EXTRA_DIST): Add hppa.asm and hppa2.asm.
+
+ * tune/speed.h (SPEED_ROUTINE_MPN_BZ_DIVREM_CALL): Declare `marker';
+ invoke TMP_FREE.
+
+ * mpn/hppa/hppa1_1/udiv_qrnnd.S: Use "%" instead of "'" for
+ reloc/symbol delimiter.
+
+2000-07-16 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/powerpc64/gmp-mparam.h: Update with output from tune utility.
+ * mpn/powerpc64/copyi.asm: New file.
+ * mpn/powerpc64/copyd.asm: New file.
+
+2000-07-16 Kevin Ryde <kevin@swox.se>
+
+ * tune/*: Add measuring for umul_ppmm and udiv_qrnnd.
+
+2000-07-14 Kevin Ryde <kevin@swox.se>
+
+ * mpn/x86/k6/k62mmx: New directory.
+ * configure.in (k6[23]*-*-*): Use it.
+ * mpn/x86/k6/k62mmx/copyi.asm, mpn/x86/k6/k62mmx/copyd.asm: Move from
+ mmx directory, improve code alignment a bit.
+ * mpn/x86/k6/k62mmx/lshift.asm, mpn/x86/k6/k62mmx/rshift.asm: Ditto,
+ and improve addressing modes for pre-CXT cores.
+ * mpn/x86/x86-defs.m4 (Zdisp): Add an instruction.
+ * mpn/x86/k6/mmx/lshift.asm, mpn/x86/k6/mmx/rshift.asm: New files,
+ suiting plain K6.
+ * mpn/x86/README, mpn/x86/k6/README: Updates.
+ * mpn/x86/k6/mmx/*.asm: Update some comments.
+
+ * mpn/tests/Makefile.am: Use $(MAKE) in .asm rules, not "m".
+ * tune/Makefile.am: Use $(EXEEXT) and libtool --config objdir, for
+ the benefit of djgpp.
+
+ * */Makefile.in: Regenerate with patched automake that adds
+ $(EXEEXT) to EXTRA_PROGRAMS.
+
+ * mpn/tests/try.c: Add #ifdef to SIGBUS, for the benefit of djgpp.
+ * config.guess: Recognise pc:*:*:* as an x86, for djgpp.
+
+ * configure: Regenerate with patched autoconf to fix temp file
+ ".hdr" which is invalid on a DOS 8.3 filesystem, and to fix two
+ sed substitutes that clobbered a ":" in $srcdir (eg. a DOS drive
+ spec).
+
+ * mpz/tests/io.c: Use one fp opened "w+", since separately opened
+ input and output doesn't work on MS-DOS 6.21.
+
+ * tests/rand/Makefile.am (allprogs): Pseudo-target to build everything.
+ (CLEANFILES): Add EXTRA_PROGRAMS and EXTRA_LTLIBRARIES.
+ (manual-test, manual-bigtest): Add $(EXEEXT) to dependencies.
+
+ * tests/rand/*/Makefile.in: Regenerate with patched automake that adds
+ $(EXEEXT) to EXTRA_PROGRAMS.
+
+2000-07-13 Torbjorn Granlund <tege@swox.com>
+
+ * mpz/tests/t-root.c: Also test mpz_perfect_power_p.
+ Generate `nth' so that there will be fewer trivial values.
+
+ * mpz/root.c: Reverse return value in tests for detecting root of +1
+ and -1.
+
+ * mpz/perfpow.c: Use TMP_ALLOC interface.
+
+2000-07-12 Torbjorn Granlund <tege@swox.com>
+
+ * mpz/perfpow.c (primes): Make it const.
+
+2000-07-06 Kevin Ryde <kevin@swox.se>
+
+ * mpn/x86/k6/cross.pl: New file.
+
+ * mpn/x86/*/gmp-mparam.h: Updates to thresholds, conditionalize
+ all _TIME defines.
+ * mpn/x86/pentium/mmx/gmp-mparam.h: New file.
+ * mpn/sparc64/gmp-mparam.h: Update thresholds.
+ * mpn/sparc32/v9/gmp-mparam.h: Ditto.
+
+2000-07-04 Kevin Ryde <kevin@swox.se>
+
+ * NEWS: Updates.
+ * mpn/x86/*/README: Miscellaneous updates.
+
+ * tune/speed-ext.c: New file.
+ * tune/Makefile.am: Add it.
+ * tune/README: Updates.
+ * tune/speed.h (SPEED_ROUTINE_MPN_DIVREM_2): Bug fixes.
+
+ * demos/calc.y,calclex.l: New files.
+ * demos/calc.c,calc.h,calclex.c: New files, generated from .y and .l.
+ * demos/Makefile.am: Add them.
+
+ * gmp.h (mpq_swap, mpf_swap): Add prototypes and defines.
+
+2000-07-01 Kevin Ryde <kevin@swox.se>
+
+ * gmp.texi (ABI and ISA): New section, bringing together ABI notes.
+ (Build Options): Add MPN_PATH, various updates.
+ (Build Options): Add note on setting CFLAGS when setting CC.
+ (Notes for Particular Systems): Add -march=pentiumpro problem.
+ (Known Build Problems): Note on gmp-mparam.h for 64-bit generic C.
+ (GMP Variable Conventions): Add some info on user defined functions.
+ (Reporting Bugs): Minor rewording.
+
+ * configure.in (MPN_PATH): Renamed from mpn_path.
+
+ * gmp-impl.h (ULONG_MAX,ULONG_HIGHBIT,...,SHORT_MAX): New defines.
+ * mp[zf]/tests/t-misc.c: Use them.
+
+ * mpbsd/tests/t-misc.c: New file.
+ * mpbsd/tests/Makefile.am: Add it.
+
+ * Makefile.am (LIBGMP_LT_*, LIBMP_LT_*): Bump version info.
+ * gmp.h (__GNU_MP_VERSION_*): Bump to 3.1.
+
+ * mpf/tests/Makefile.am (AUTOMAKE_OPTIONS): Add ansi2knr.
+
+ * Makefile.am (libmp_la_SOURCES): Add mp_set_fns.c, accidentally
+ omitted in gmp 3.0.x.
+ * gmp.texi (Custom Allocation): Note this is available in mpbsd,
+ and some minor rewording.
+
+2000-06-30 Torbjorn Granlund <tege@swox.com>
+
+ * demos/factorize.c (random): New function, defined conditionally.
+ (factor_using_pollard_rho): Use it, not mrand48.
+
+ * mpn/cray/README: New file.
+
+2000-06-30 Kevin Ryde <kevin@swox.se>
+
+ * mpn/x86/pentium/aorsmul_1.asm: Add MULFUNC_PROLOGUE.
+
+ * mpz/tests/t-jac.c: Test limbs on mpn_jacobi_base, not just ulongs.
+
+ * gmp-impl.h, mpn/tests/try.c, mpn/tests/spinner.c, tune/speed.c:
+ Use config.h unconditionally, not under HAVE_CONFIG_H.
+
+ * demos/pexpr.c [__DJGPP__]: Patch by Richard Dawe to not use
+ setup_error_handler on djgpp.
+
+ * tune/*: Locate data to help direct-mapped caches, add measuring
+ of mpz_init/clear, mpz_add and mpz_bin_uiui, various cleanups.
+ * configure.in (AC_CHECK_FUNCS): Add popen.
+
+2000-06-29 Torbjorn Granlund <tege@swox.com>
+
+ * mpf/mul_2exp.c: Streamline criterion for whether to use mpn_lshift or
+ mpn_rshift. Increase precision when exp is a multiple of
+ BITS_PER_MP_LIMB primarily to make exp==0 be a noop.
+ * mpf/div_2exp.c: Analogous changes.
+
+ * mpf/tests/t-dm2exp.c: Set u randomly in loop. Perform more
+ mpf_mul_2exp testing.
+
+ * configure.in: Recognize cray vector processors with a broad `*';
+ move after alpha* not to match that.
+
+2000-06-28 Kevin Ryde <kevin@swox.se>
+
+ * mpz/tests/io.c: Use a disk file, not a pipe, switch to ansi2knr
+ style, switch from MP_INT to mpz_t, add a couple of error checks.
+ * mpz/tests/Makefile.am (CLEANFILES): Add io.tmp, in case io.c fails.
+
+2000-06-27 Torbjorn Granlund <tege@swox.com>
+
+ * mpf/tests/t-get_d.c: Be more lax about relative error, to handle Cray
+ floating point format.
+
+ * mpq/tests/t-get_d.c: Decrease default reps to 1000.
+
+ * mpf/tests/t-conv.c: Correct type of `bexp'.
+
+ * configure.in (cray vector machines): Don't inherit gmp_cflags_cc.
+
+ * tune/Makefile.am (EXTRA_DIST): Delete sparc64.asm.
+
+ * configure.in (cray vector machines): Set extra_functions.
+
+ * mpn/cray/mulww.f: New file with vectorizing cray code.
+ * mpn/cray/mulww.s: Generated from mulww.f.
+ * mpn/cray/mul_1.c: New file.
+ * mpn/cray/addmul_1.c: New file.
+ * mpn/cray/submul_1.c: New file.
+ * mpn/cray/add_n.c: New file.
+ * mpn/cray/sub_n.c: New file.
+
+2000-06-26 Kevin Ryde <kevin@swox.se>
+
+ * acinclude.m4 (GMP_CHECK_ASM_ALIGN_FILL_0x90): Fix so it actually
+ detects solaris 2.6, and also suppress warning on solaris 2.8.
+ * configure.in (SPEED_CYCLECOUNTER): Remove spurious "athlon" from
+ sparc case.
+
+ * mpn/lisp/gmpasm-mode.el: Move keymap to the top of the docstring.
+
+2000-06-21 Kevin Ryde <kevin@swox.se>
+
+ * mpn/generic/mul_n.c (mpn_kara_mul_n, mpn_kara_sqr_n): Use
+ mp_size_t for n2.
+ (mpn_toom3_mul_n, mpn_toom3_sqr_n): Use mp_size_t for size
+ parameters and "l" variables.
+ * gmp-impl.h (mpn_toom3_mul_n, mpn_toom3_sqr_n): Update prototypes.
+
+ * mpbsd/itom.c, mpbsd/sdiv.c: Add casts for correct handling of
+ -0x80...00 on systems with sizeof(short)==sizeof(int).
+
+ * mpz/tests/t-misc.c: Move "bin" test from here ...
+ * mpz/tests/t-bin.c: ... to here, and add a new (2k,k) test too.
+ * mpz/tests/Makefile.am (check_PROGRAMS): Add t-bin.
+
+ * mpz/bin_ui.c [_LONG_LONG_LIMB]: Use mpn_divrem_1, since kacc is
+ a limb not a ulong.
+ * mpz/bin_uiui.c [_LONG_LONG_LIMB]: Ditto, and use mpn_mul_1 too,
+ since nacc is a limb.
+
+ * mpf/tests/t-misc.c (check_mpf_set_si, check_mpf_cmp_si):
+ New file, testing mpf_set_si, mpf_init_set_si, and mpf_cmp_si.
+ * mpf/tests/Makefile.am (check_PROGRAMS): Add it.
+
+ * mpz/tests/t-misc.c (check_mpz_set_si, check_mpz_cmp_si):
+ New tests, for mpz_set_si, mpz_init_set_si, and mpz_cmp_si.
+
+ * mpz/set_si.c, mpz/iset_si.c, mpz/cmp_si.c [_LONG_LONG_LIMB]: Fix
+ handling of -0x80..00.
+ * mpf/set_si.c, mpf/iset_si.c, mpf/cmp_si.c [_LONG_LONG_LIMB]: Ditto.
+
+2000-06-19 Torbjorn Granlund <tege@swox.com>
+
+ * demos/primes.c: Properly handle arguments `m +n'.
+
+2000-06-17 Torbjorn Granlund <tege@swox.com>
+
+ * config.sub: Recognize k5 and k6 with common pattern.
+
+ * mpq/tests/t-get_d.c: Also test mpq_set_d. Misc improvements.
+
+ * mpq/set_d.c: Special case 0.0. Don't call mpn_rshift with 0 count.
+ Allocate correct amount of memory for numerator. Delete spurious
+ ASSERT_ALWAYS(1).
+
+2000-06-17 Kevin Ryde <kevin@swox.se>
+
+ * mpz/perfsqr.c: Fix so that zero is considered a perfect square.
+ (Was wrongly calling mpn_perfect_square_p with size==0.)
+
+2000-06-16 Kevin Ryde <kevin@swox.se>
+
+ * configure.in: Set k5*-*-* to use basic i386 code until there's
+ something specific. Add path=x86 as a default for x86s.
+
+ * acinclude.m4 (GMP_CHECK_ASM_ALIGN_LOG): Generate
+ ALIGN_LOGARITHMIC setting, not a full ALIGN definition.
+ (GMP_CHECK_ASM_ALIGN_FILL_0x90): New test.
+ * configure.in [x86-*-*]: Use GMP_CHECK_ASM_ALIGN_FILL_0x90.
+ * mpn/asm-defs.m4 (ALIGN): New macro.
+ * mpn/x86/x86-defs.m4 (ALIGN): Remove supplementary definition.
+
+ * tune/*: Plain "unsigned" for speed_cyclecounter.
+ * configure.in: Use tune/sparcv9.asm for 32 and 64 bit modes.
+ * tune/sparc64.asm: Remove file.
+
+2000-06-15 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/x86/k7/mmx/copyi.asm: Use `testb' instead of `test'.
+ * mpn/x86/k7/mmx/copyd.asm: Likewise.
+
+ * mpn/x86/k7/mmx/lshift.asm: Avoid using `~' (Solaris as problems).
+ * mpn/x86/k7/mmx/rshift.asm: Likewise.
+ * mpn/x86/k6/aors_n.asm: Likewise.
+ * mpn/x86/k7/aors_n.asm: Likewise.
+ * mpn/x86/k7/mul_basecase.asm: Likewise.
+
+2000-06-13 Torbjorn Granlund <tege@swox.com>
+
+ * tune/sparcv9.asm: Tune, deleting two instructions.
+
+ * tune/alpha.asm: Update to unified speed_cyclecounter.
+
+2000-06-11 Kevin Ryde <kevin@swox.se>
+
+ * mpz/tests/reuse.c (FAIL): Add a K&R version.
+ Use _PROTO on some typedefs.
+ * mpz/tests/t-misc.c: Add gmp-impl.h for "const".
+
+ * configure.in: Rework mpn multi-function and optional files.
+ Names standardized, no need for explicit declarations, all picked
+ up in one $path traversal.
+ * doc/configuration: Updates.
+
+ * tests/rand/t-rand.c (main): Change "usage" to work with K&R.
+
+2000-06-10 Kevin Ryde <kevin@swox.se>
+
+ * mpn/x86/pentium/mmx/popham.asm, mpn/x86/p6/mmx/popham.asm,
+ mpn/x86/p6/p3mmx/popham.asm, mpn/x86/p6/diveby3.asm: Add
+ MULFUNC_PROLOGUE for correct HAVE_NATIVE_* matching.
+
+ * mpn/x86/x86-defs.m4 (cmov_bytes_tttn): Use eval() on expressions.
+ (cmov_available_p): Switch to list CPUs which do have cmov.
+ * mpn/x86/p6/sqr_basecase.asm, mpn/x86/k6/sqr_basecase.asm,
+ mpn/x86/k7/sqr_basecase.asm: Use eval() for multiplication.
+ * mpn/x86/README.family: Various updates.
+
+2000-06-09 Kevin Ryde <kevin@swox.se>
+
+ * mpbsd/tests/allfuns.c (main): Call exit() instead of doing return.
+
+ * doc/tasks.html, doc/projects.html: Moved from projects directory.
+ * doc/multiplication: New file.
+ * Makefile.am (EXTRA_DIST): Remove projects, add doc.
+
+ * Makefile.am (libgmp_la_LIBADD, libmp_la_LIBADD): Remove
+ unnecessary -lm.
+ * INSTALL: Remove -lm from instructions.
+ * demos/Makefile.am (qcn_LDADD): Add -lm.
+
+ * tune/*: Add measuring for mpn_divrem_2 and modlimb_invert,
+ improve addsub_n. Switch to unified speed_cyclecounter.
+ * configure.in: Update configs for speed_cyclecounter.
+
+ * gmp-impl.h (MP_LIMB_T_MAX, MP_LIMB_T_HIGHBIT): New macros.
+ * mpn/generic/diveby3.c, mpn/generic/mul_n.c, mpn/generic/gcd.c,
+ tune/speed.c, mpn/tests/ref.c: Use them.
+
+ * mpn/tests/spinner.c: Remove setitimer, just alarm is enough.
+ * configure.in (AC_CHECK_FUNCS): Remove setitimer.
+ * mpn/tests/x86call.asm: Start with junk in %eax, %ecx, %edx.
+ * mpn/tests/ref.[ch] (refmpn_addsub_nc): New function.
+ * mpn/tests/try.c: Add some support for mpn_addsub_nc.
+ * mpn/tests/Makefile.am (EXTRA_PROGRAMS): Remove addsub_n and
+ addsub_n_2 which don't currently build.
+ * mpn/tests/copy.c: Test MPN_COPY_INCR, not __gmpn_copy.
+
+ * tests/rand/Makefile.am (libstat_la_LIBADD): Add -lm, no longer on
+ libgmp.la.
+ (findlc_LDADD): Use libstat.la.
+ (AUTOMAKE_OPTIONS): Use ansi2knr.
+
+2000-06-08 Torbjorn Granlund <tege@swox.com>
+
+ * configure.in (alpha*-*-osf*): Default `flavour' to ev6 for ev6 and
+ higher.
+ (alpha*-*-*): Likewise.
+ (alpha*-*-osf*: gmp_optcflags_cc): Move -arch/-tune flags from
+ gmp_xoptcflags_gcc.
+
+ * mpn/Makefile.am (TARG_DIST): Add pa64w.
+
+ * longlong.h: Wrap 64-bit hppa code in #ifndef LONGLONG_STANDALONE.
+
+2000-06-07 Torbjorn Granlund <tege@swox.com>
+
+ * mpz/remove.c: Fail for `src' being zero.
+
+ * mpz/tests/reuse.c: Test more functions.
+ (FAIL): New define.
+
+ * mpz/tests/t-powm.c: Loop during operand generation while they
+ are mathematically ill-defined (used to just skip such tests).
+
+ * mpz/powm.c (mpz_redc): Clean up argument declarations.
+
+ * configure.in (gmp_cflags64_gcc): Don't add bogus -mWHAT option.
+ (sparcv9-*-solaris2.[7-9]], gmp_cflags64_gcc):
+ Inherit from previous gmp_cflags64_gcc; pass `-m64 -mptr64'.
+ (ia64*-*-*): New.
+
+ * mpn/generic/dump.c: Make it work when an mp_limb_t is not `long'.
+
+ * mpf/set_prc.c: MPN_COPY => MPN_COPY_INCR.
+
+2000-06-06 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/generic/mul_n.c (mpn_toom3_mul_n, mpn_toom3_sqr_n):
+ Use mpn_incr_u for final carry propagation.
+
+ * mpz/tests/t-gcd.c: Add calls to mpz_gcdext with argument t == NULL.
+
+ * mpz/tests/reuse.c: Major rewrite; test many more functions.
+
+ * mpz/powm_ui.c: When exp is 0, change res assign order in order
+ to handle argument overlap.
+ * mpz/powm.c: When exp is 0, change res assign order in order
+ to handle argument overlap. Handle negative exp and mod arguments.
+
+ * mpz/gcdext.c: Rework code after mpn_gcdext call to handle
+ argument overlap.
+
+ * mpz/fdiv_qr.c: Read dividend->_mp_size before calling mpz_tdiv_qr
+ in order to handle argument overlap.
+ * mpz/cdiv_qr.c: Likewise.
+
+ * mpf/tests/reuse.c: Fix typo that effectively disabled `dis_funcs'
+ tests. Clean up test for mpf_ui_div.
+
+2000-06-06 Kevin Ryde <kevin@swox.se>
+
+ * mpn/x86/p6/sqr_basecase.asm: New file.
+ * mpn/x86/mod_1.asm: Avoid one conditional jump.
+ * mpn/x86/p6/gmp-mparam.h: Update thresholds, #ifndef UMUL_TIME
+ and UDIV_TIME, add COUNT_TRAILING_ZEROS_TIME.
+
+ * mp_minv_tab.c: New file.
+ * Makefile.am (libgmp_la_SOURCES, libmp_la_SOURCES): Add it.
+ * gmp-impl.h (modlimb_invert): New macro.
+ * mpz/powm.c: Remove mpz_dmprepare, use modlimb_invert instead.
+ * mpn/generic/bdivmod.c: Use modlimb_invert instead of a loop.
+ * mpn/generic/gcd.c: Inline two small mpn_bdivmod calls, use
+ MPN_COPY_INCR not MPN_COPY in one place.
+
+2000-06-05 Torbjorn Granlund <tege@swox.com>
+
+ * mpf/tests/reuse.c (dsi_funcs): Add mpf_mul_2exp and mpf_div_2exp.
+ (main): Clean up test for mpf_div_ui.
+
+ * mpf/mul_2exp.c: Correct criterion for whether to use mpn_lshift or
+ mpn_rshift. MPN_COPY => MPN_COPY_INCR. Coerce the two assignments to
+ r->_mp_size.
+
+ * mpf/div_2exp.c: Use mpn_rshift instead of mpn_lshift when overlap
+ so requires. MPN_COPY => MPN_COPY_INCR.
+
+ * mpf/tests/t-dm2exp.c: Correct type of res_prec.
+
+2000-06-04 Kevin Ryde <kevin@swox.se>
+
+ * mpz/bin_uiui.c: Fix result for n==0 and n==k.
+ * mpz/bin_ui.c: Fix result for k>n, add support for n<0.
+ * gmp.texi (Number Theoretic Functions): Update mpz_bin_ui to
+ note n<0 is supported.
+
+ * mpz/tests/t-misc.c: New file.
+ * mpz/tests/Makefile.am (check_PROGRAMS): Add it.
+
+2000-05-31 Kevin Ryde <kevin@swox.se>
+
+ * tune/speed.* (FLAG_R_OPTIONAL): New option for routines, use on
+ mpn_gcd_1 and mpn_mul_basecase.
+ * tune/README: Update.
+
+ * tune/alpha.asm: New file, by Torbjorn.
+ * tune/Makefile.am (EXTRA_DIST): Add it.
+ * configure.in (alpha*-*-*): Use it.
+
+2000-05-31 Linus Nordberg <linus@swox.se>
+
+ * doc/configuration: New file.
+
+2000-05-30 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/generic/mul_basecase.c: Call mpn_mul_2 and mpn_addmul_2
+ if available. Don't include longlong.h.
+
+ * doc/isa_abi_headache: New file.
+
+2000-05-30 Linus Nordberg <linus@swox.se>
+
+ * configure.in (NM): Use AC_PROG_NM rather than AC_CHECK_TOOL to
+ find `nm'. (AC_PROG_NM comes with Libtool and is needed to get
+ the `-B' option (BSD compatible output) included in $NM.)
+ (AR): Use AC_CHECK_PROG rather than AC_CHECK_TOOL to find `ar'.
+ (Now that NM isn't a cross compilation tool, don't give the
+ impression that we know how to cross compile.)
+ (CCAS): Remove spurious comment.
+
+ * gmp.texi (Notes for Particular Systems): Remove comment about
+ using GNU `nm' on AIX since system nm now works.
+
+2000-05-29 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/power/mul_1.s: Remove [PR] from first word in function
+ descriptor.
+ * mpn/power/addmul_1.s: Likewise.
+ * mpn/power/submul_1.s: Likewise.
+
+2000-05-28 Kevin Ryde <kevin@swox.se>
+
+ * configure.in, tune/*: Change pentium rdtsc cycle scheme to
+ HAVE_SPEED_CYCLECOUNTER and SPEED_CYCLECOUNTER_OBJS.
+ * tune/pentium.asm: Renamed and converted from rdtsc.asm.
+ * tune/sparcv9.asm: New file, by Torbjorn.
+ * tune/sparc64.asm: New file.
+ * tune/tuneup.c: Put a limit on gcdext search.
+
+ * gmp.h (mp_set_memory_functions): Add extern "C".
+ * mp.h (__GNU_MP__): Bump to "3".
+ * mpz/add.c,mul.c,powm.c,sub.c,sqrtrem.c,tdiv_qr.c [BERKELEY_MP]:
+ Include mp.h for mpbsd compile.
+ * mpz/gcd.c: Ditto, and remove _mpz_realloc declaration.
+
+ * gmp.texi (Integer Functions): Flatten @subsections into @sections.
+ (Floating-point Functions): Ditto.
+ (Integer Random Numbers): Split from miscellaneous as a sep section.
+ (Installing GMP): Make nodes for the sections.
+ Add more "@cindex"s.
+ (Known Build Problems): Remove SunOS get_d problem, believed fixed.
+ (Notes for Particular Systems): Remove HPPA note since now PIC.
+ (References): URL for Jebelean.
+
+2000-05-27 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/pa64w: New directory, contents based on corresponding mpn/pa64
+ files.
+ * configure.in (hppa2.0w-*-*): New.
+ * mpz/tests/io.c (_INCLUDE_POSIX_SOURCE): Define when __hpux before
+ including stdio.h.
+ * gmp-impl.h: Always define DItype and UDItype.
+
+2000-05-27 Kevin Ryde <kevin@swox.se>
+
+ * tune/common.c (speed_measure): Correction to array sorting,
+ better diagnostic when measuring fails.
+ * tune/time.c: Add microsecond accurate getrusage method.
+
+ * tune/time.c (speed_cpu_frequency_processor_info): New function.
+ * configure.in (AC_CHECK_FUNCS): Add processor_info.
+
+2000-05-26 Linus Nordberg <linus@swox.se>
+
+ * gmp.texi (Installing GMP): Shared libraries work for AIX < 4.3
+ if using GNU nm.
+
+2000-05-26 Torbjorn Granlund <tege@swox.com>
+
+ * tune/tuneup.c (SIGNED_TYPE_MAX): Shift `-1' instead of `1' to
+ avoid signed overflow.
+
+ * demos/pexpr.c (setup_error_handler): Don't call sigaltstack on
+ Unicos.
+
+2000-05-25 Torbjorn Granlund <tege@swox.com>
+
+ * insert-dbl.c: Work around GCC 2.8 bug.
+ * extract-dbl.c: Likewise.
+
+ * config.sub: Allow i586, i686, i786 again.
+
+ * config.guess: Use X86CPU for lots more systems.
+
+2000-05-25 Linus Nordberg <linus@swox.se>
+
+ * mpbsd/tests/dummy.c (main): Call exit() instead of doing return
+ (some old SysV machines don't get this correct, I've heard.)
+
+2000-05-25 Kevin Ryde <kevin@swox.se>
+
+ * mpf/iset_str.c: Initialize _mp_size and _mp_exp to 0, in case no
+ digits in string, so it's the same as a separate init and set_str.
+
+2000-05-24 Torbjorn Granlund <tege@swox.com>
+
+ * mpz/tests/reuse.c: Use mpz_random2 instead of mpz_random.
+
+ * mpz/divexact.c: Read pointers after reallocation.
+ Compare `quot' and `den' instead of `qp' and `dp' in overlap check.
+ Use MPN_COPY_INCR for copying from `np'.
+
+ (*-*-aix4.[3-9]*): Disable shared libs just for problematic AIX
+ versions.
+ * configure.in (*-cray-unicos*): Disable asm syntax checking; set
+ compiler explicitly.
+ * configure.in (hppa*-*-*): Remove code disabling shared libs.
+
+2000-05-24 Linus Nordberg <linus@swox.se>
+
+ * acinclude.m4 (GMP_PROG_CC_WORKS): Don't report progress to user
+ when doing the AIX specific test to avoid "nested output".
+
+2000-05-22 Kevin Ryde <kevin@swox.se>
+
+ * mp.h (_PROTO): Copy from gmp.h, use on prototypes.
+ Add extern "C" too.
+ * mpbsd/tests/Makefile.am (AUTOMAKE_OPTIONS): Enable ansi2knr.
+ * mpbsd/tests/allfuns.c: Don't execute mout, just link to it.
+ (main): ANSI style definition.
+
+ * gmp-impl.h (MP_BASE_AS_DOUBLE): Change the expression to
+ something that works on SunOS native cc. Seems to fix the
+ mp*_get_d problems.
+
+ * mpn/tests/ref.c (refmpn_strip_twos): Use MPN_COPY_INCR.
+ * mpn/tests/Makefile.am: Let .asm.o rules work with absolute $srcdir.
+
+2000-05-21 Kevin Ryde <kevin@swox.se>
+
+ * mpn/x86/k7/sqr_basecase.asm: Replace file with K7 specific code.
+ * mpn/x86/k7/README: Update.
+ * mpn/x86/k7/gmp-mparam.h: Tune thresholds.
+ (COUNT_TRAILING_ZEROS_TIME): New define.
+ * mpn/x86/k6/gmp-mparam.h: Ditto.
+
+ * mpn/x86/pentium/mmx/popham.asm: New file (include_mpn of K6 version).
+ * mpn/x86/p6/diveby3.asm: New file (include_mpn of P5 version).
+ * mpn/x86/p6/mmx/popham.asm: New file (include_mpn of K6 version).
+ * mpn/x86/p6/p3mmx/popham.asm: New file (include_mpn of K7 version).
+ * configure.in (pentium3-*-*): Add p3mmx to $path.
+
+ * gmp.texi (Integer Arithmetic): Clarify mpz_jacobi op2; add
+ mpz_*_kronecker_*.
+ (Miscellaneous Integer Functions): Add mpz_odd_p and mpz_even_p.
+ (Low-level Functions): Put mpn_divmod_1 with mpn_divrem_1 and note
+ it's now a macro.
+ (References): Add Henri Cohen.
+
+ * gmp.h (mpn_addmul_1c, mpn_divrem_1c, mpn_mod_1c, mpn_mul_1c,
+ mpn_submul_1c): Add prototypes.
+ (mpz_odd_p, mpz_even_p): New macros.
+
+ * mpn/asm-defs.m4 (m4wrap_prepend): New macro.
+ (m4_error): Use it.
+ (m4_not_for_expansion): Corrections to OPERATION symbols.
+ More comments about variations between m4 versions.
+ * mpn/x86/x86-defs.m4 (PROLOGUE): Use m4wrap_prepend (fixes error
+ exit under BSD m4, previously m4_error printed the message but the
+ exit code was 0).
+
+ * gmp.h (mpn_divmod_1): Change to a macro calling mpn_divrem_1.
+ * mpn/generic/divrem_1.c: Move divmod_1.c code to here, make it
+ static and call it __gmpn_divmod_1_internal.
+ * mpn/generic/divmod_1.c: Remove file.
+ * configure.in (gmp_mpn_functions): Remove divmod_1.
+ * mpn/asm-defs.m4 (define_mpn): Remove divmod_1 and divmod_1c.
+ * compat.c (mpn_divmod_1): Add compatibility function.
+ * tune/*: Remove mpn_divmod_1 measuring (leave just divrem_1).
+
+ * acconfig.h (HAVE_NATIVE_mpn_*): Add some missing carry-in
+ variants, remove divmod_1.
+
+ * mpn/x86/diveby3.asm: Use imul, update comments.
+
+ * demos/qcn.c: New file.
+ * demos/Makefile.am (EXTRA_PROGRAMS): Add it.
+
+ * mpz/tests/t-jac.c: New file.
+ * mpz/tests/Makefile.am (check_PROGRAMS): Add it. Enable ansi2knr.
+
+ * mpz/kronsz.c: New file.
+ * mpz/kronuz.c: New file.
+ * mpz/kronzs.c: New file.
+ * mpz/kronzu.c: New file.
+ * mpz/Makefile.am (libmpz_la_SOURCES): Add them.
+ * Makefile.am (MPZ_OBJECTS): Add them.
+ * gmp-impl.h (JACOBI_*, MPN_STRIP_LOW_ZEROS_NOT_ZERO): New macros.
+ * gmp.h (mpz_*_kronecker_*): New defines and prototypes.
+
+ * mpn/generic/jacbase.c: New file.
+ * mpn/generic/mod_1_rs.c: New file.
+ * configure.in (gmp_mpn_functions): Add them.
+ * gmp.h (mpn_jacobi_base, mpn_mod_1_rshift): New defines and
+ prototypes.
+ * longlong.h (COUNT_TRAILING_ZEROS_TIME): New define.
+ * mpn/tests/ref.c (refmpn_mod_1_rshift): New function.
+ * mpn/tests/try.c: Add mpn_mod_1_rshift.
+ * tune/*: Add measuring for mpn_jacobi_base.
+
+ * acinclude.m4 (GMP_FINISH): Add ifdefs to allow multiple
+ inclusion of config.m4.
+ (GMP_PROG_M4): Put "good" message through to config.log.
+
+ * mpz/powm.c: Use a POWM_THRESHOLD for where redc stops.
+ * tune/*: Add mpz_powm measuring, and tune POWM_THRESHOLD.
+ * gmp-impl.h [TUNE_PROGRAM_BUILD] (POWM_THRESHOLD): Conditional
+ redefinition for use when tuning.
+
+ * mpz/powm_ui.c: Use DIVIDE_BY_ZERO.
+
+ * mpz/iset_str.c: Initialize _mp_size to 0, in case no digits in
+ string; this makes it the same as a separate init and set_str.
+
+2000-05-20 Kevin Ryde <kevin@swox.se>
+
+ * mpn/asm-defs.m4: Note &,|,^ aren't bitwise in BSD m4 eval().
+ * mpn/x86/k6/sqr_basecase.asm: Use "%" not "&" in m4 eval()s.
+
+ * mpn/x86/x86-defs.m4 (Zdisp): Yet more instruction forms.
+
+2000-05-19 Linus Nordberg <linus@swox.se>
+
+ * acinclude.m4 (GMP_CHECK_CC_64BIT): Don't use shell variable
+ `ac_compile' for our own compile command string since other
+ Autoconf macros may depend on it.
+
+2000-05-19 Kevin Ryde <kevin@swox.se>
+
+ * mpn/generic/mul_n.c (mpn_toom3_mul_n, mpn_toom3_sqr_n): Fix
+ carry propagation in final coefficient additions.
+
+2000-05-18 Linus Nordberg <linus@swox.se>
+
+ * configure.in: Set NM before looking for compiler since
+ GMP_CHECK_CC_64BIT needs it.
+
+ * acinclude.m4 (GMP_CHECK_CC_64BIT): Don't execute on target.
+ (GMP_PROG_CC_FIND): Before checking if the compiler knows how to
+ produce 64-bit code, verify that it works at all. The background
+ is that /usr/ucb/cc on Solaris 7 successfully compiles in 64-bit
+ mode but fails when doing final link.
+ (GMP_PROG_CC_WORKS): Report to user what's happening.
+
+2000-05-17 Linus Nordberg <linus@swox.se>
+
+ * config.guess: Use X86CPU for x86 Cygwin.
+
+2000-05-16 Kevin Ryde <kevin@swox.se>
+
+ * mpn/x86/p6/mmx/divrem_1.asm: New file.
+ * mpn/x86/p6/mmx/mod_1.asm: New file.
+ * mpn/x86/p6/README: Update.
+ * mpn/x86/divrem_1.asm: Update comments.
+ * mpn/x86/mod_1.asm: Ditto.
+
+2000-05-14 Kevin Ryde <kevin@swox.se>
+
+ * tune/speed.h: Run gcd functions on a set of data.
+
+ * mpn/tests/try.c: New file.
+ * mpn/tests/try.h: New file.
+ * mpn/tests/spinner.c: New file.
+ * mpn/tests/trace.c: New file.
+ * mpn/tests/x86call.asm: New file.
+ * mpn/tests/x86check.c: New file.
+ * mpn/tests/ref.c (refmpn_hamdist): Allow size==0.
+ (refmpn_gcd): New function, and other additions supporting it.
+ * mpn/tests/ref.h: More prototypes.
+ * mpn/tests/Makefile.am: Add try program, use ansi2knr.
+
+ * mpn/x86/k7/mmx/popham.asm: New file.
+ * mpn/x86/k6/mmx/popham.asm: New file.
+ * mpn/x86/k6/sqr_basecase.asm: Unroll the addmul, for approx 1.3x
+ speedup above 15 limbs.
+ * mpn/x86/k7/README: Update.
+ * mpn/x86/k6/README: Update, and add notes on plain K6 and pre-CXT
+ K6-2 problems.
+ * configure.in (k6*-*-*, athlon-*-*): Add popham.
+
+ * mpn/x86/pentium/diveby3.asm: New file.
+ * mpn/x86/pentium/README: Update.
+
+ * gmp.texi (Installing GMP): Add note on bad OpenBSD 2.6 m4.
+ (Reporting Bugs): Ask for config.m4 if asm file related.
+ (I/O of Rationals): New section, add mpq_out_str.
+ (References): Add url for on-line gcc manuals.
+ A few node and menu updates.
+
+ * INSTALL: Better command line argument checking for test progs.
+ Change MP -> GMP.
+
+ * configure.in (WANT_ASSERT, USE_STACK_ALLOC, HAVE_PENTIUM_RDTSC):
+ Put descriptions here, not in acconfig.h.
+ (CALLING_CONVENTIONS_OBJS): New AC_SUBST (for mpn/tests/try).
+ (HAVE_CALLING_CONVENTIONS): New AC_DEFINE.
+ (AC_CHECK_HEADERS): Add sys/time.h.
+ (AC_CHECK_FUNCS): Add getpagesize, setitimer.
+ (KARATSUBA_SQR_THRESHOLD): Strip trailing comments from the
+ #define when passing through to config.m4.
+ * acconfig.h (PACKAGE, VERSION, WANT_ASSERT, USE_STACK_ALLOC,
+ HAVE_PENTIUM_RDTSC): No need for #undefs, autoheader gets them
+ from configure.in.
+
+ * acinclude.m4 (GMP_PROG_M4): Check for broken OpenBSD 2.6 m4
+ eval(), put messages into config.log.
+ * mpn/asm-defs.m4: Add notes and test for OpenBSD 2.6 m4.
+
+ * mpq/out_str.c: New file.
+ * mpq/Makefile.am (libmpq_la_SOURCES): Add it.
+ * Makefile.am (MPQ_OBJECTS): Ditto.
+ * gmp.h (mpq_out_str): New define and prototype.
+
+2000-05-12 Kevin Ryde <kevin@swox.se>
+
+ * configure.in (CONFIG_TOP_SRCDIR): Fix to use $srcdir not
+ $top_srcdir (which doesn't exist).
+ * acinclude.m4 (GMP_C_ANSI2KNR): Fix setting U=_.
+ * gmp-impl.h (mpn_com_n, MPN_LOGOPS_N_INLINE): Fix missing "do"
+ (not currently used, probably no ill effect anyway).
+
+2000-05-11 Torbjorn Granlund <tege@swox.com>
+
+ * randraw.c (lc): Major overhaul (pending rewrite).
+ (_gmp_rand): Rewrite.
+
+2000-05-08 Torbjorn Granlund <tege@swox.com>
+
+ * mpz/tests/convert.c: Call free via _mp_free_func.
+ * mpf/tests/t-conv.c: Likewise.
+
+ * memory.c: Add code enabled for DEBUG that adds special patterns
+ around allocated blocks.
+
+2000-05-05 Linus Nordberg <linus@swox.se>
+
+ * gmp.texi (Miscellaneous Float Functions): Correct parameter list
+ for mpf_urandomb().
+
+ * configure.in: Invoke AC_REVISION.
+
+2000-05-05 Kevin Ryde <kevin@swox.se>
+
+ * gmp.texi: Use @dircategory and @direntry.
+ (Installing GMP): Clarification for --target, updates on SunOS
+ problems.
+ (Integer Arithmetic): Add mpz_mul_si.
+ (Initializing Rationals): Add mpq_swap.
+ (Assigning Floats): Add mpf_swap.
+ (Low-level Functions): Add mpn_divexact_by3c, and details of what
+ the calculation actually gives.
+ (Low-level Functions): Note extra space needed by mpn_gcdext,
+ clarify the details a bit.
+
+ * compat.c: New file, entry points for upward binary compatibility.
+ (mpn_divexact_by3): Compatibility function.
+ * Makefile.am (libgmp_la_SOURCES): Add compat.c.
+
+ * mpn/tests/ref.c: Rearrange macros for ansi2knr.
+ (div1): Renamed from div to avoid library function.
+ (refmpn_divexact_by3c, refmpn_gcd_1, refmpn_popcount,
+ refmpn_hamdist): New functions.
+ * mpn/tests/ref.h: Add extern "C", add new prototypes.
+
+ * gmp.h (gmp_randinit, etc): Add extern "C".
+ (_mpq_cmp_ui): Fix prototype name from mpq_cmp_ui.
+ (mpn_divexact_by3): Now a macro calling mpn_divexact_by3c.
+ (mpn_divexact_by3c): New prototype and define.
+
+ * mpn/x86/diveby3.asm: Change to mpn_divexact_by3c.
+ * mpn/x86/k6/diveby3.asm: Ditto.
+ * mpn/generic/diveby3.c: Ditto.
+ * mpn/asm-defs.m4: Ditto on the define_mpn.
+ * acconfig.h (HAVE_NATIVE_mpn_divexact_by3c): New define.
+
+ * mpq/swap.c: New file, derived from mpz/swap.c.
+ * mpf/swap.c: Ditto.
+ * mpq/Makefile.am: Add swap.c.
+ * mpf/Makefile.am: Ditto.
+ * Makefile.am: Add two new "swap.lo"s.
+
+ * mpn/x86/k6/mmx/com_n.asm: Fix an addressing bug (fortunately
+ this code hasn't been used anywhere yet).
+
+ * mpn/x86/k7/mmx/divrem_1.asm: New file.
+ * mpn/x86/k7/mmx/mod_1.asm: New file.
+ * mpn/x86/k7/diveby3.asm: New file.
+ * mpn/x86/k7/README: Update.
+
+ * mpn/x86/k7/aorsmul_1.asm: Use new cmovCC, no object code change.
+ * mpn/x86/k7/mul_basecase.asm: Ditto.
+ * mpn/x86/p6/aorsmul_1.asm: Ditto.
+
+ * mpn/x86/x86-defs.m4 (defframe_empty_if_zero): Eval the argument.
+ (cmovCC): New macros, replacing individual cmovCC_reg_reg forms.
+ (Zdisp): Recognise more instructions.
+ (shldl,etc): Use m4_instruction_wrapper().
+ (ASSERT, movl_text_address): New macros.
+
+ * mpn/asm-defs.m4: Add remarks on SunOS /usr/bin/m4 and new
+ OpenBSD m4.
+ (m4_assert_numargs_internal_check): Remove a spurious parameter.
+ (m4_empty_if_zero): Eval the argument.
+ (m4_assert, m4_assert_numargs_range, m4_config_gmp_mparam,
+ m4_instruction_wrapper): New macros.
+
+2000-05-04 Linus Nordberg <linus@swox.se>
+
+ * gmp.texi (Reporting Bugs): Be explicit about output from running
+ a command.
+
+2000-05-02 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/generic/bz_divrem_n.c (mpn_bz_divrem_n): Handle non-zero return
+ from first mpn_bz_div_3_halves_by_2 call.
+ (mpn_bz_divrem_aux): Likewise.
+
+2000-04-30 Kevin Ryde <kevin@swox.se>
+
+ * tune/* (GCD_ACCEL_THRESHOLD, GCDEXT_THRESHOLD): Tune these.
+
+ * mpn/generic/gcdext.c (GCDEXT_THRESHOLD): Rename from THRESHOLD,
+ use with >=, adjust default to 17 accordingly.
+ Use new *_SWAP macros.
+
+ * mpn/generic/gcd.c (GCD_ACCEL_THRESHOLD): Rename from
+ ACCEL_THRESHOLD, use with >=, adjust default to 5 accordingly.
+ Use new *_SWAP macros.
+
+ * mpf/get_str.c, mpf/set_str.c, mpf/sub.c, mpz/add.c, mpz/ior.c,
+ mpz/and.c, mpz/sub.c, mpz/xor.c, mpz/ui_pow_ui.c,
+ mpn/generic/mul.c: Use new *_SWAP macros.
+
+ * stack-alloc.h: Add extern "C" around prototypes.
+
+ * gmp-impl.h: (MP_PTR_SWAP, etc): New macros.
+ (_mp_allocate_func, etc): Use _PROTO.
+ [TUNE_PROGRAM_BUILD]: More changes in tune program build part.
+
+2000-04-28 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/pa64/add_n.s: Add `,entry' to export directive.
+ * mpn/pa64/addmul_1.S, mpn/pa64/lshift.s, mpn/pa64/mul_1.S,
+ mpn/pa64/rshift.s, mpn/pa64/sub_n.s, mpn/pa64/submul_1.S,
+ mpn/pa64/umul_ppmm.S: Likewise.
+ * mpn/hppa/hppa1_1/udiv_qrnnd.S: New name for udiv_qrnnd.s.
+ Add PIC support.
+
+2000-04-29 Kevin Ryde <kevin@swox.se>
+
+ * gmp-impl.h [TUNE_PROGRAM_BUILD] (TOOM3_MUL_THRESHOLD_LIMIT): New
+ define.
+ * mpn/generic/mul_n.c [TUNE_PROGRAM_BUILD] (mpn_mul_n): Use
+ TOOM3_MUL_THRESHOLD_LIMIT, not a hard coded 500.
+
+ * memory.c: Use <stdlib.h> for malloc etc, and use _PROTO.
+ * stack-alloc.c: Don't use C++ reserved word "this".
+ * urandom.h: Put extern "C" around prototypes.
+ * mpz/powm.c: Switch a couple of parameters to "const", which they
+ are, to satisfy g++.
+
+ * randraw.c, stack-alloc.c, mpbsd/mout.c, mpbsd/mtox.c: Add casts to
+ help g++.
+
+ * stack-alloc.c: Provide dual ANSI/K&R function definitions.
+ * mpz/addmul_ui.c,get_d.c,inp_str.c,perfpow.c,powm.c,pprime_p.c,
+ rrandomb.c,set_str.c,ui_pow_ui.c: Ditto.
+ * mpf/integer.c,set_str.c: Ditto.
+ * mpbsd/min.c,xtom.c: Ditto.
+ * mpn/generic/bz_divrem_n.c,dump.c,gcd_1.c,get_str.c,hamdist.c,
+ popcount.c,random.c,random2.c,set_str.c: Ditto.
+
+ * rand.c: Use <stdio.h> for NULL.
+ * mpz/gcd_ui.c,gcdext.c,mul.c,perfpow.c,powm_ui.c,root.c,sqrt.c,
+ sqrtrem.c: Ditto
+ * mpf/sqrt.c,sqrt_ui.c: Ditto.
+ * mpn/generic/perfsqr.c,sqrtrem.c: Ditto.
+
+ * gmp-impl.h (NULL, malloc, realloc, free): Don't define/declare.
+ (extern "C"): Add around function prototypes.
+ (mpn_kara_mul_n, mpn_kara_sqr_n, mpn_toom3_mul_n, mpn_toom3_sqr_n):
+ Add prototypes.
+ [TUNE_PROGRAM_BUILD] (FIB_THRESHOLD): Add necessary redefinitions for
+ use by tune program.
+ * mpn/generic/mul_n.c: Remove mpn_toom3_mul_n prototype.
+
+ * acinclude.m4 (GMP_C_ANSI2KNR): New macro.
+ (GMP_CHECK_ASM_MMX, GMP_CHECK_ASM_SHLDL_CL): Fix to use
+ $gmp_cv_check_asm_text which is what GMP_CHECK_ASM_TEXT sets.
+ * configure.in (GMP_C_ANSI2KNR): Use this instead of AM_C_PROTOTYPES,
+ for reasons described with its definition.
+
+ * demos/Makefile.am (ansi2knr): Use $(top_builddir) nor $(top_srcdir).
+
+ * mpz/fib_ui.c (FIB_THRESHOLD): Rename from FIB_THRES, for consistency.
+ (FIB_THRESHOLD): Conditionalize so gmp-mparam.h can define a value.
+ (mpz_fib_bigcase): Use >= FIB_THRESHOLD, same as main mpz_fib_ui.
+ * tune/tuneup.c,Makefile.am (FIB_THRESHOLD): Tune this.
+
+ * configure.in (*-*-aix* gmp_m4postinc): Fix setting (don't overwrite
+ a value just stored).
+
+2000-04-26 Kevin Ryde <kevin@swox.se>
+
+ * mpn/sparc32/udiv_fp.asm: Use mpn_udiv_qrnnd macro.
+ * mpn/sparc32/udiv_nfp.asm: Ditto.
+ * mpn/sparc32/v8/supersparc/udiv.asm: Ditto.
+ * mpn/sparc32/umul.asm: Name the function mpn_umul_ppmm.
+ * mpn/sparc32/v8/umul.asm: Ditto.
+ * mpn/powerpc32/umul.asm: Ditto.
+
+ * mpn/x86/syntax.h: Remove file, since now unused.
+
+ * configure.in (x86): Remove -DBROKEN_ALIGN and -DOLD_GAS
+ previously used by .S files.
+ (x86 extra_functions): Add udiv and umul.
+ (GMP_PROG_M4): Use this instead of AC_CHECK_PROG(M4,m4,...)
+ (HAVE_NATIVE_*): Loosen up the regexp to "PROLOGUE.*" so as to
+ accept PROLOGUE_GP on alpha.
+
+ * acconfig.h (HAVE_NATIVE_mpn_umul_ppmm, udiv_qrnnd, invert_limb):
+ New template defines.
+ * mpn/asm-defs.m4 (mpn_umul_ppmm, mpn_udiv_qrnnd): New define_mpn()s.
+ * longlong.h (umul_ppmm, udiv_qrnnd): Use a library version if
+ it's available and an asm macro isn't.
+ * gmp-impl.h (invert_limb): Ditto.
+
+ * gmp-impl.h (ASSERT_NOREALLOC): Not a good idea, remove it.
+
+ * acinclude.m4 (GMP_PROG_M4): New macro.
+
+2000-04-25 Linus Nordberg <linus@swox.se>
+
+ * gmp.texi (Random State Initialization): Correct arguments to
+ `gmp_randinit'.
+
+ * acinclude.m4 (GMP_VERSION): Change `eval' --> `m4_eval'. Fix
+ from Kevin.
+ * aclocal.m4: Regenerate.
+
+2000-04-25 Kevin Ryde <kevin@swox.se>
+
+ * mpn/x86/aors_n.asm: Remove parentheses around an immediate that
+ Solaris "as" doesn't like, change by Torbjorn.
+
+2000-04-24 Kevin Ryde <kevin@swox.se>
+
+ * configure.in (AC_CHECK_FUNCS): Add strtoul.
+
+ * mpn/generic/mul_n.c [TUNE_PROGRAM_BUILD] (mpn_mul_n): Bigger
+ array for karatsuba temporary space for tune program build.
+ (mpn_toom3_sqr_n) Remove an unused variable.
+
+ * demos/Makefile.am (AUTOMAKE_OPTIONS): Add ansi2knr.
+ Add "allprogs:" pseudo-target.
+ * demos/factorize.c, demos/isprime.c: Switch to ANSI functions,
+ rely on ansi2knr.
+
+ * gmp.texi (Getting the Latest Version of GMP): Add reference to
+ ftp.gnu.org mirrors list.
+ * INSTALL: Add arg count check to example programs.
+
+ * mpn/x86/*/*.asm: Convert to FORTRAN ... or rather to
+ FORTRAN-style "C" commenting to support Solaris "as".
+ * mpn/x86/x86-defs.m4: Ditto, and add another Zdisp insn.
+ * mpn/asm-defs.m4 (C): Update comments.
+ * mpn/x86/README.family: Add a note on commenting, remove
+ description of .S files.
+
+ * mpn/sparc64/addmul_1.asm, mul_1.asm, submul_1.asm: Use
+ include_mpn().
+
+2000-04-23 Torbjorn Granlund <tege@swox.com>
+
+ * config.sub: Merge with FSF version of April 23.
+
+ * mpn/powerpc32: Use dnl/C instead of `#' for comments.
+
+ * config.guess: Get "model" limit between pentium 2 and pentium3 right.
+ Get rid of code determining `_' prefix; use double labels instead.
+ * config.guess: Partially merge with FSF version of April 22.
+ (Don't bring over NetBSD changes for now.)
+
+2000-04-23 Kevin Ryde <kevin@swox.se>
+
+ * tune/Makefile.am, tune/README, tune/common.c, tune/rdtsc.asm,
+ tune/speed.c, tune/speed.h, tune/time.c, tune/tuneup.c: New files.
+ * tune/Makefile.in: New file, generated from Makefile.am.
+
+ * gmp-impl.h (ASSERT_NOREALLOC,TMP_ALLOC_LIMBS): New macros.
+ [TUNE_PROGRAM_BUILD] Further mods for tune program builds.
+
+ * mpz/Makefile.am: Add -DOPERATION_$* for new mul_siui.c.
+ Add rules to build mul_si and mul_ui from a common mul_siui.c.
+ * mpz/mul_siui.c: New file, derived from and replacing mul_ui.c.
+ * gmp.h (mpz_mul_si): New prototype and define.
+
+ * mpn/tests/*.c [__i386__] (CLOCK): Don't use floating point in
+ CLOCK because cpp can't handle floats in #if's (TIMES is derived
+ from CLOCK by default).
+
+ * mpn/asm-defs.m4 (include_mpn): New macro.
+ (m4_assert_numargs) Changes to implementation.
+
+ * mpf/Makefile.am: Add -DOPERATION_$* for new integer.c.
+ Remove explicit rules for floor.o etc.
+ * mpf/integer.c: Use OPERATION_$* for floor/ceil/trunc.
+
+ * mpn/Makefile.am: Put "tests" in SUBDIRS.
+ * mpn/tests/Makefile.am: New file providing rules to build test
+ programs, nothing done in a "make all" or "make check" though.
+ * mpn/tests/README: New file.
+
+ * acconfig.h (HAVE_PENTIUM_RDTSC): New define.
+
+ * configure.in (x86): Rearrange target cases.
+ Add mulfunc aors_n and aorsmul_1 for x86 and pentium (now all x86s).
+ Remove asm-syntax.h generation not needed.
+ Remove now unused family=x86.
+ (sparc) Remove unused family=sparc.
+ (HAVE_PENTIUM_RDTSC) New AC_DEFINE and AM_CONDITIONAL.
+ (AM_C_PROTOTYPES) New test, supporting ansi2knr.
+ (AC_CHECK_HEADERS) Add getopt.h, unistd.h and sys/sysctl.h for
+ tune progs.
+ (AC_CHECK_FUNCS) Add getopt_long, sysconf and sysctlbyname for
+ tune progs.
+ (config.m4 CONFIG_TOP_SRCDIR) Renamed from CONFIG_SRCDIR.
+ (config.m4 asm-defs.m4) Use CONFIG_TOP_SRCDIR and include().
+ (gmp_m4postinc) Use include_mpn().
+ (gmp_links) Omit asm-defs.m4/asm.m4 and gmp_m4postinc's.
+ (MULFUNC_PROLOGUE) Fix regexps so all functions get AC_DEFINE'd.
+ (PROLOGUE) Ditto (native copyi and copyd were unused in gmp 3).
+ (KARATSUBA_SQR_THRESHOLD) Copy from gmp-mparam.h into config.m4.
+ (AC_OUTPUT) Add tune/Makefile, mpn/tests/Makefile.
+
+ * Makefile.am (AUTOMAKE_OPTIONS): Add ansi2knr.
+ (SUBDIRS): Add tune, reorder directories.
+ (MPZ_OBJECTS): Add mpz/mul_si.lo.
+ (libmp_la_SOURCES): Use this for top-level objects, not .lo's.
+ * ansi2knr.c, ansi2knr.1: New files, provided by automake.
+
+ * mpn/x86/aors_n.asm: Convert add_n.S and sub_n.S to a
+ multi-function aors_n.asm, no object code change.
+ * mpn/x86/pentium/aors_n.asm: Ditto.
+ * mpn/x86/aorsmul_1.asm: Ditto for addmul/submul.
+ * mpn/x86/pentium/aorsmul_1.asm: Ditto.
+
+ * mpn/x86/lshift.asm, mpn/x86/mul_1.asm, mpn/x86/mul_basecase.asm,
+ mpn/x86/rshift.asm: Convert from .S, no object code change.
+ * mpn/x86/pentium/lshift.asm, mpn/x86/pentium/mul_1.asm,
+ mpn/x86/pentium/mul_basecase.asm, mpn/x86/pentium/rshift.asm: Ditto.
+
+ * gmp.texi (Reporting Bugs): Itemize the list of things to include.
+ (Miscellaneous Float Functions): Correct typo in mpf_ceil etc
+ argument types.
+ Change @ifinfo -> @ifnottex for benefit of makeinfo --html.
+ Remove unnecessary @iftex's around @tex.
+
+2000-04-22 Torbjorn Granlund <tege@swox.com>
+
+ * config.guess: Generalize x86 cpu determination code.
+ Now works on Solaris.
+
+ * mpz/nextprime.c: Rewrite still disabled code.
+
+ * configure.in: Specifically match freebsd[3-9].
+
+2000-04-21 Torbjorn Granlund <tege@swox.com>
+
+ * rand.c: Call mpz_clear for otherwise leaking mpz_t.
+
+ * mpz/pprime_p.c (mpz_probab_prime_p): Merge handling of negative
+ n into code for handling small positive n. Merge variables m and n.
+ After dividing, simply call mpz_millerrabin.
+ (isprime): Local variables now use attribute `long'.
+ (mpz_millerrabin): New static function, based on code from
+ mpz_probab_prime_p.
+ (millerrabin): Now simple workhorse for mpz_millerrabin.
+
+2000-04-19 Torbjorn Granlund <tege@swox.com>
+
+ * gmp-impl.h: Fix parenthesis error in test for __APPLE_CC__.
+
+2000-04-18 Linus Nordberg <linus@swox.se>
+
+ * NEWS: Add info about shared libraries. Remove reference to
+ gmp_randinit_lc.
+
+2000-04-17 Torbjorn Granlund <tege@swox.com>
+
+ * Version 3.0 released.
+
+ * mpn/arm/add_n.S: New version from Robert Harley.
+ * mpn/arm/addmul_1.S: Likewise.
+ * mpn/arm/mul_1.S: Likewise.
+ * mpn/arm/sub_n.S: Likewise.
+
+ * gmp.h (__GNU_MP_VERSION_PATCHLEVEL): Now 0.
+
+2000-04-17 Linus Nordberg <linus@swox.se>
+
+ * configure.in (hppa2.0*-*-*): Pass `+O3' to cc/c89 in 64-bit mode
+ to avoid compiler bug.
+ (ns32k*-*-*): Fix typo in path. Change by Kevin.
+ (alpha*-*-osf*): New case. Pass assembly flags for architecture
+ to gcc.
+ (alpha*-*-*): Don't bother searching for cc.
+ * configure: Regenerate.
+
+ * Makefile.am (EXTRA_DIST): Add `macos', `.gdbinit'.
+ * Makefile.in: Regenerate.
+ * mpn/Makefile.am (EXTRA_DIST): Add `m88k', `lisp'.
+ * mpn/Makefile.in: Regenerate.
+
+2000-04-16 Kevin Ryde <kevin@swox.se>
+
+ * README: Updates, and don't duplicate the example in INSTALL.
+ * INSTALL: Minor updates.
+ * gmp.texi (Installing MP): Minor edits, restore CC/CFLAGS description.
+
+2000-04-16 Linus Nordberg <linus@swox.se>
+
+ * configure.in (*-*-cygwin*): Select BSD_SYNTAX to avoid
+ .type/.size in PROLOGUE for ELF_SYNTAX. Override ALIGN definition
+ from x86/syntax.h.
+ (gmp_xoptcflags_${CC}): New set of variables, indicating
+ ``exclusive optional cflags''.
+ (most sparcs): Use gmp_xoptcflags instead of gmp_optcflags to
+ ensure that we pass CPU type to older gcc.
+ (CFLAGS): CFLAGS on the command line was spoiled.
+ * configure: Regenerate.
+
+2000-04-16 Linus Nordberg <linus@swox.se>
+
+ * configure.in: Invoke AC_PROG_LIBTOOL directly.
+
+ * acinclude.m4 (GMP_PROG_CC_FIND): Quote source variable when
+ setting CC64 and CFLAGS64.
+ (GMP_PROG_CC_SELECT): Cache result.
+ (GMP_PROG_LIBTOOL): Remove.
+
+ * aclocal.m4: Regenerate.
+ * configure: Regenerate.
+
+2000-04-16 Linus Nordberg <linus@swox.se>
+
+ * tests/rand/t-rand.c (main): Add non-ANSI function declaration.
+ Don't use `const'.
+
+2000-04-16 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/generic/dump.c: Suppress output of leading zeros.
+
+ * mpz/inp_str.c: Fix memory leakage.
+
+ * mpz/tests/reuse.c (dss_func_division): Add a final 1.
+
+ * longlong.h (alpha count_leading_zeros): Wrap in __MPN.
+ * mpn/alpha/cntlz.asm: Use __gmpn prefix (by means of __MPN).
+
+ * longlong.h (__umul_ppmm, __udiv_qrnnd): Wrap in __MPN.
+ * mpn/alpha/udiv_qrnnd.S: Use __gmpn prefix.
+ * mpn/hppa/udiv_qrnnd.s: Likewise.
+ * mpn/hppa/hppa1_1/udiv_qrnnd.s: Likewise.
+ * mpn/pa64/udiv_qrnnd.c: Likewise (by means of __MPN).
+ * mpn/pa64/umul_ppmm.S: Likewise.
+ * mpn/sparc32/udiv_fp.asm: Likewise (by means of MPN).
+ * mpn/sparc32/udiv_nfp.asm: Likewise (by means of MPN).
+ * mpn/sparc32/v8/supersparc/udiv.asm: Likewise (by means of MPN).
+
+ * mpn/generic/tdiv_qr.c: Work around gcc 2.7.2.3 i386 register handling
+ bug.
+
+ * mpn/generic/tdiv_qr.c: Use udiv_qrnnd instead of mpn_divrem_1
+ when computing appropriate quotient; mpn_divrem_1 writes too
+ many quotient limbs.
+
+ * mpn/asm-defs.m4: invert_normalized_limb => invert_limb.
+ * mpn/alpha/invert_limb.asm: mpn_invert_normalized_limb =>
+ mpn_invert_limb.
+ * gmp.h: Likewise.
+ * gmp-impl.h (alpha specific): invert_normalized_limb => invert_limb;
+ wrap with __MPN.
+ * longlong.h (alpha udiv_qrnnd): Likewise.
+
+2000-04-16 Kevin Ryde <kevin@swox.se>
+
+ * gmp.h (mp_set_memory_functions,mp_bits_per_limb,gmp_errno): Add
+ #defines so the library symbols are __gmp_*.
+ * errno.c: Include gmp.h.
+ * gmp-impl.h (_mp_allocate_func,etc): Add #defines to __gmp_*.
+ (__clz_tab): New #define to __MPN(clz_tab).
+ * stack-alloc.c (__gmp_allocate_func,etc): Change from _mp_*.
+
+ * Makefile.am (libmp_la_DEPENDENCIES): Add some mpz files needed
+ for new mpz_powm (pow in libmp).
+ (EXTRA_DIST): Add projects directory.
+
+ * mpn/*: Change __mpn to __gmpn.
+ * gmp.h (__MPN): Ditto.
+ * stack_alloc.c,stack-alloc.h: Change __tmp to __gmp_tmp.
+
+ * mpn/generic/sb_divrem_mn.c (mpn_sb_divrem_mn): Avoid gcc 2.7.2.3
+ i386 register handling bug (same as previously in mpn_divrem_classic).
+
+ * mpn/generic/divrem.c: Now contains mpn_divrem, which is not an
+ internal function, so remove warning comment.
+
+ * gmp.texi (Compatibility with Version 2.0.x): Source level only.
+
+2000-04-16 Linus Nordberg <linus@swox.se>
+
+ * configure.in (hppa1.0*): Prefer c89 to cc.
+ * configure: Regenerate.
+
+2000-04-15 Linus Nordberg <linus@swox.se>
+
+ * configure.in: If `mpn_path' is set by user on configure command
+ line, use that as path.
+ * configure: Regenerate.
+
+2000-04-15 Linus Nordberg <linus@swox.se>
+
+ * configure.in (hppa2.0*): Use path "hppa/hppa1_1 hppa" if no
+ 64-bit compiler was found.
+ * configure: Regenerate.
+
+2000-04-15 Linus Nordberg <linus@swox.se>
+
+ * configure.in: Honor `CC' and `CFLAGS' set by user on configure
+ command line.
+ * acinclude.m4: (GMP_PROG_CC_SELECT): Set CFLAGS if not set already.
+ * aclocal.m4: Regenerate.
+ * configure: Regenerate.
+
+2000-04-15 Linus Nordberg <linus@swox.se>
+
+ * acinclude.m4 (GMP_PROG_CC_FIND): Remove debug output. Remove
+ commented out code.
+ * aclocal.m4: Regenerate.
+ * configure: Regenerate.
+
+ * configure.in: Make all `-mcpu' options to gcc optional.
+ * configure: Regenerate.
+
+ * tests/rand/Makefile.am: Don't do anything for target 'all'.
+ * tests/rand/Makefile.in: Regenerate.
+
+2000-04-15 Kevin Ryde <kevin@swox.se>
+
+ * README: Small updates.
+ * NEWS: Add some things about 3.0.
+
+ * mpz/Makefile.am (EXTRA_DIST): Remove dmincl.c.
+
+ * Makefile.am: Use -version-info on libraries, not -release.
+
+ * mpz/tdiv_qr.c: Add mdiv function header #ifdef BERKELEY_MP.
+ * mpbsd/Makefile.am: Use mpz/tdiv_qr.c, not mdiv.c.
+ * Makefile.am (MPBSD_OBJECTS): Change mdiv.lo to tdiv_qr.lo.
+ (libmp_la_DEPENDENCIES): Add mp_clz_tab.lo.
+ * mpbsd/mdiv.c: Remove file.
+
+ * config/mt-linux,mt-m68k,mt-m88110,mt-ppc,mt-ppc64-aix,mt-pwr,
+ mt-sprc8-gcc,mt-sprc9-gcc,mt-supspc-gcc,mt-vax,mt-x86,
+ mpn/config/mt-pa2hpux,mt-sprc9,t-oldgas,t-ppc-aix,t-pwr-aix:
+ Remove configure fragments not used since change to autoconf.
+
+ * mpn/generic/bz_divrem_n.c,sb_divrem_mn.c: Add comment that
+ internal functions are changeable and shouldn't be used directly.
+
+2000-04-15 Linus Nordberg <linus@swox.se>
+
+ * configure.in: Remove debug output.
+ * configure: Regenerate.
+
+2000-04-15 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/generic/tdiv_qr.c: Don't use alloca directly.
+
+ * mpz/tdiv_qr.c: Fix typo.
+ * mpz/tdiv_r.c: Fix typo.
+ * mpz/tdiv_q.c: Fix typo.
+
+ * configure.in: Disable -march=pentiumpro due to apparent compiler
+ problems.
+
+ * mpz/powm.c: Replace with new code from Paul Zimmermann.
+
+ * mpz/tdiv_q.c: Remove debug code.
+
+ * mpn/generic/divrem.c: Remove C++ style `//' commented-out code.
+ * mpn/generic/sb_divrem_mn.c: Likewise.
+
+2000-04-14 Torbjorn Granlund <tege@swox.com>
+
+ * mpz/cdiv_q.c: Change temp allocation for new requirements of
+ mpz_tdiv_qr.
+ * mpz/fdiv_q.c: Likewise.
+
+ * mpn/sparc64/gmp-mparam.h: Set up parameters for TOOM3.
+
+ * mpz/dmincl.c: Delete file.
+ * mpz/tdiv_qr.c: Rewrite using mpn_tdiv_qr.
+ * mpz/tdiv_r.c: Likewise.
+ * mpz/tdiv_q.c: Likewise.
+
+ * mpn/generic/tdiv_qr.c: New file.
+ * mpn/generic/bz_divrem_n.c: New file.
+ * mpn/generic/sb_divrem_mn.c: New file.
+
+ * gmp-impl.h (MPZ_REALLOC): New macro.
+ (mpn_sb_divrem_mn): Declare.
+ (mpn_bz_divrem_n): Declare.
+ (mpn_tdiv_qr): Declare.
+
+ * configure.in (gmp_mpn_functions): Delete divrem_newt and divrem_1n;
+ add tdiv_qr, bz_divrem_n, and sb_divrem_mn.
+ * mpn/generic/divrem_newt.c: Delete file.
+ * mpn/generic/divrem_1n.c: Delete file.
+
+ * gmp.h (mpn_divrem_newton): Remove declaration.
+ (mpn_divrem_classic): Remove declaration.
+
+ * gmp.h (mpn_divrem): Remove function definition.
+ * mpn/generic/divrem.c: Replace mpn_divrem_classic with a
+ mpn_divrem wrapper.
+
+2000-04-14 Kevin Ryde <kevin@swox.se>
+
+ * mpf/dump.c, mpz/dump.c, mpn/generic/dump.c,
+ mpn/generic/divrem.c, mpn/generic/divrem_1n.c,
+ mpn/generic/divrem_2.c, mpn/generic/divrem_newt.c,
+ mpn/generic/mul.c, mpn/generic/mul_basecase.c,
+ mpn/generic/mul_n.c, mpn/generic/sqr_basecase.c,
+ mpn/generic/udiv_w_sdiv.c: Add comment that internal functions are
+ changeable and shouldn't be used directly.
+
+ * mpq/div.c: Use DIVIDE_BY_ZERO (previously didn't get an
+ exception on zero divisor).
+
+ * mpf/tests/t-get_d.c, mpz/tests/reuse.c: Add K&R function
+ definitions.
+ * mpz/tests/t-2exp.c: Don't use ANSI-ism 2ul.
+
+ * gmp.texi (Installing MP): Build problem notes for GSYM_PREFIX
+ and ranlib on native SunOS.
+ Particular systems notes about AIX and HPPA shared libraries
+ disabled.
+ (MP Basics): Add that undocumented things shouldn't be used.
+ (Introduction to MP): Add to CPUs listed.
+
+ * acinclude.m4 (GMP_CHECK_ASM_UNDERSCORE): Don't depend on C
+ having "void".
+
+2000-04-13 Linus Nordberg <linus@swox.se>
+
+ * mpn/pa64/udiv_qrnnd.c (__udiv_qrnnd64): Add K&R function
+ definition.
+
+ * configure.in: Disable shared libraries for hppa*.
+ (mips-sgi-irix6.*): Fix flags for 64-bit gcc.
+ (hppa2.0*-*-*): Prefer c89 to cc.
+ * configure: Regenerate.
+
+ * gmp.h (gmp_randalg_t): Remove comma after last element.
+
+ * tests/rand/t-rand.c: Add copyright notice.
+
+2000-04-13 Kevin Ryde <kevin@swox.se>
+
+ * mpn/generic/mul_n.c, mpn/generic/gcdext.c, mpz/nextprime.c,
+ mpz/remove.c, mpz/root.c: Add K&R function definitions.
+ * mpz/rrandomb.c: Fix typo in K&R part.
+ * stack-alloc.c: Add K&R style function pointer declarations.
+
+ * mpz/root.c: Use SQRT_OF_NEGATIVE on even roots of negatives.
+ Use DIVIDE_BY_ZERO on a "zero'th" root.
+
+ * configure: Regenerate with autoconf backpatched to fix --srcdir
+ absolute path wildcards that bash doesn't like, change by Linus.
+
+ * gmp.texi (Integer Arithmetic): Document mpz_nextprime.
+ (Miscellaneous Integer Functions): Fix mpz_fits_* formatting.
+ (Installing MP): Comment-out CC and CFLAGS description.
+
+2000-04-13 Linus Nordberg <linus@swox.se>
+
+ * rand.c (gmp_randinit): Don't combine va_alist with ordinary
+ arguments for non STDC.
+
+2000-04-13 Torbjorn Granlund <tege@swox.com>
+
+ * mpz/nextprime.c: Use proper names of new random types and functions.
+
+ * mpz/rrandomb.c: New file.
+ * mpz/Makefile.am: List it.
+ * mpz/Makefile.in: Regenerate.
+ * Makefile.am: Here too.
+ * Makefile.in: Regenerate.
+ * gmp.h: Declare mpz_rrandomb.
+
+2000-04-12 Linus Nordberg <linus@swox.se>
+
+ * Makefile.am, demos/Makefile.am, mpbsd/Makefile.am,
+ mpbsd/tests/Makefile.am, mpf/Makefile.am, mpf/tests/Makefile.am,
+ mpn/Makefile.am, mpq/Makefile.am, mpq/tests/Makefile.am,
+ mpz/Makefile.am, mpz/tests/Makefile.am, tests/Makefile.am,
+ tests/rand/Makefile.am (AUTOMAKE_OPTIONS): Add 'no-dependencies'.
+
+ * Makefile.in, demos/Makefile.in, mpbsd/Makefile.in,
+ mpbsd/tests/Makefile.in, mpf/Makefile.in, mpf/tests/Makefile.in,
+ mpn/Makefile.in, mpq/Makefile.in, mpq/tests/Makefile.in,
+ mpz/Makefile.in, mpz/tests/Makefile.in, tests/Makefile.in,
+ tests/rand/Makefile.in: Regenerate.
+
+2000-04-12 Linus Nordberg <linus@swox.se>
+
+ * randlc.c (gmp_randinit_lc): Disable function.
+ * gmp.texi (Random State Initialization): Remove gmp_randinit_lc.
+
+ * acinclude.m4 (GMP_CHECK_CC_64BIT): Compiling an empty main
+ successfully with `-n32' will have to suffice on irix6.
+ * aclocal.m4: Regenerate.
+
+ * configure.in (sparc): Don't pass -D_LONG_LONG_LIMB to compiler.
+ (mips-sgi-irix6.*): Use compiler option `-n32' rather than `-64'
+ for 64-bit `cc'. Add options for gcc.
+ * configure: Regenerate.
+
+ * mpf/urandomb.c (mpf_urandomb): Add third parameter 'nbits'. If
+ 'nbits' doesn't make even limbs, shift up result before
+ normalizing.
+
+ * gmp.h (mpf_urandomb): Add parameter to prototype.
+
+ * mpf/urandom.c: Rename file to ...
+ * mpf/urandomb.c: ... this.
+ * Makefile.am (MPF_OBJECTS): Change urandom.lo --> urandomb.lo.
+ * Makefile.in: Regenerate.
+ * mpf/Makefile.am (libmpf_la_SOURCES): Change urandom.c --> urandomb.c.
+ * mpf/Makefile.in: Regenerate.
+
+ * config.in: Regenerate for HAVE_DECL_OPTARG.
+
+ * randraw.c (_gmp_rand): Fix bug with _LONG_LONG_LIMB.
+ (lc): Change return type.
+ Use one temporary storage instead of two.
+ Handle seed of size 0.
+ Avoid modulus operation in some cases.
+ Abort if M is not a power of 2.
+ Fix bug with 64-bit limbs.
+ Fix bug with small seed, small A and large M.
+
+ * tests/rand/gen.c (main): Include gmp.h. Remove macros MIN, MAX. Add
+ option '-q'. Don't demand argument N. Change parameters in call
+ to mpf_urandomb.
+
+ * tests/rand/t-rand.c: New file for testing random number generation.
+
+ * tests/rand/Makefile.am: Run t-rand for 'make check'.
+ (test, bigtest): Rename to manual-test, manual-bigtest.
+ * tests/rand/Makefile.in: Regenerate.
+
+2000-04-12 Kevin Ryde <kevin@swox.se>
+
+ * gmp-impl.h: Include config.h before TMP_ALLOC, so
+ --disable-alloca works.
+
+ * mpbsd/Makefile.am: Don't recompile top-level sources here.
+ * Makefile.am (libmp_la_DEPENDENCIES): Put objects here instead,
+ add errno.lo and stack-alloc.lo.
+
+ * mpn/asm-defs.m4: Add a test and message for the unsuitable SunOS m4.
+ * gmp.texi (Installing MP): Update note on SunOS m4 failure.
+
+ * acconfig.h: Add copyright notice using @TOP@.
+
+ * stack-alloc.c: Use _mp_allocate_func, not malloc.
+ * gmp.texi (Installing MP): Note this under --disable-alloca.
+
+ * gmp.texi (Comparison Functions): mpz_cmp_abs => mpz_cmpabs.
+ (Integer Arithmetic): mpz_prime_p not yet implemented, comment out.
+ (Float Arithmetic): mpf_pow_ui now implemented, uncomment-out.
+ (Miscellaneous Float Functions): Add mpf_ceil, mpf_floor, mpf_trunc.
+ (Low-level Functions): Add mpn_random2, with mpn_random.
+
+ * mpn/m68k/mc68020/udiv.S: Rename from udiv.s.
+ * mpn/m68k/mc68020/umul.S: Ditto.
+
+ * mpn/alpha/umul.asm: Rename from umul.s, remove .file and
+ compiler identifiers.
+
+ * mpn/powerpc32/syntax.h: Removed, no longer used.
+
+ * mpn/a29k/udiv.s: Remove .file and compiler identifiers.
+ * mpn/a29k/umul.s: Ditto.
+
+ * mpn/tests/ref.c: Use WANT_ASSERT.
+ * mpn/tests/ref.h: Use _PROTO.
+
+ * mpbsd/configure.in: Removed, no longer required.
+
+ * mpf/div.c: Use DIVIDE_BY_ZERO.
+ * mpf/div_ui.c: Ditto.
+ * mpf/ui_div.c: Ditto.
+ * mpq/inv.c: Ditto.
+ * mpf/sqrt.c: Use SQRT_OF_NEGATIVE.
+ * mpz/sqrt.c: Ditto.
+ * mpz/sqrtrem.c: Ditto.
+
+ * gmp-impl.h (GMP_ERROR,SQRT_OF_NEGATIVE): New macros.
+ (DIVIDE_BY_ZERO): Use GMP_ERROR.
+ (__mp_bases): #define to __MPN(mp_bases).
+
+2000-04-11 Linus Nordberg <linus@swox.se>
+
+ * tests/rand/stat.c (main): Initialize `l1runs' at declaration.
+
+2000-04-11 Kevin Ryde <kevin@swox.se>
+
+ * mpz/fib_ui.c: Add K&R function definitions.
+
+ * mpbsd/tests/Makefile.am (TESTS): Add a dummy test to avoid a
+ shell problem with an empty "for tst in $(TESTS) ; ...".
+ * mpbsd/tests/dummy.c: New file.
+
+2000-04-10 Torbjorn Granlund <tege@swox.com>
+
+ * mpz/bin_uiui.c: Delete several unused variables.
+ Add copyright notice.
+ * mpz/bin_ui.c: Add copyright notice.
+
+ * longlong.h: Declare __count_leading_zeros for alpha.
+
+2000-04-10 Linus Nordberg <linus@swox.se>
+
+ * rand.c (gmp_randinit): Change parameter list to (rstate, alg, ...).
+ * gmp.h: Change prototype accordingly.
+ * mpz/pprime_p.c (millerrabin): Change call accordingly.
+
+ * configure.in: Check for `optarg'.
+ * configure: Regenerate.
+
+ * mpn/Makefile.am: Remove incorrect comment.
+ * mpn/Makefile.in: Regenerate.
+
+ * gmp.h: Rename most of the random number functions, structs and some
+ of the struct members.
+ * rand.c (gmp_randinit): Likewise.
+ * randclr.c (gmp_randclear): Likewise.
+ * randlc.c (gmp_randinit_lc): Likewise.
+ * randlc2x.c (gmp_randinit_lc_2exp): Likewise.
+ * randraw.c (lc): Likewise.
+ (_gmp_rand_getraw): Likewise.
+ * randsd.c (gmp_randseed): Likewise.
+ * randsdui.c (gmp_randseed_ui): Likewise.
+ * gmp.texi: Likewise.
+
+ * gmp.texi: Use three hyphens for a dash.
+ (Low-level Functions): Remove documentation for gmp_rand_getraw.
+ (Random Number Functions): Add info on where to find documentation
+ on the random number functions.
+
+ * tests/rand/Makefile.am (test, bigtest): Quote argument to grep.
+ * tests/rand/Makefile.in: Regenerate.
+
+ * tests/rand/gen.c: Declare optarg, optind, opterr if not already
+ declared.
+ (main): Use new names for the random stuff.
+ (main): Don't use strtoul() if we don't have it. Use strtol()
+ instead, if we have it. Otherwise, use atoi().
+ (main): Use srandom/srandomdev for __FreeBSD__ only.
+ (main): Use new parameter order to gmp_randinit().
+
+ * tests/rand/stat.c: Declare optarg, optind, opterr if not already
+ declared.
+
+2000-04-10 Torbjorn Granlund <tege@swox.com>
+
+ * mpz/pprime_p.c: Pass 0L for mpz_scan1. mpz_mmod => mpz_mod.
+ (millerrabin): Use new random interface.
+ (millerrabin): ... and don't forget to call gmp_randclear.
+
+ * mpz/nextprime.c: New file.
+ * gmp.h: Declare mpz_nextprime.
+ * mpz/Makefile.am: List nextprime.c.
+ * mpz/Makefile.in: Regenerate.
+ * Makefile.am: List mpz/nextprime.lo.
+ * Makefile.in: Regenerate.
+
+2000-04-10 Kevin Ryde <kevin@swox.se>
+
+ * move-if-change, mpz/tests/move-if-change, mpq/tests/move-if-change,
+ mpf/tests/move-if-change: Remove, no longer used.
+
+ * Makefile.am (SUBDIRS): Add tests, demos, mpbsd.
+ (libmp.la): New target, conditional on WANT_MPBSD.
+ (libgmp_la_LIBADD): Add -lm.
+ (AUTOMAKE_OPTIONS): Add check-news.
+ (include_HEADERS): Setup to install gmp.h and possibly mp.h.
+ (DISTCLEANFILES): Add generated files.
+ (check): Remove explicit target (now uses check-recursive).
+
+ * configure.in: Use AM_CONFIG_HEADER.
+ Add --enable-mpbsd setting automake conditional WANT_MPBSD.
+ Output demos/Makefile, mpbsd/Makefile and mpbsd/tests/Makefile.
+
+ * mpz/Makefile.am: Add SUBDIRS=tests, shorten INCLUDES since now
+ using AM_CONFIG_HEADER.
+ * mpq/Makefile.am: Ditto.
+ * mpf/Makefile.am: Ditto, and add DISTCLEANFILES.
+ * mpn/Makefile.am: Shorten INCLUDES, amend some comments.
+ * mpz/tests/Makefile.am: Use TESTS and $(top_builddir).
+ * mpf/tests/Makefile.am: Ditto.
+ * mpq/tests/Makefile.am: Ditto.
+ * demos/Makefile.am: New file.
+
+ * mpbsd/Makefile.am: New file, derived from old mpbsd/Makefile.in.
+ * mpbsd/Makefile.in: Now generated from Makefile.am.
+ * mpbsd/realloc.c: Removed, use mpz/realloc.c instead.
+ * mpbsd/tests/Makefile.am: New file.
+ * mpbsd/tests/Makefile.in: New file, generated from Makefile.am.
+ * mpbsd/tests/allfuns.c: New file.
+
+ * gmp.texi (Top): Use @ifnottex, to help makeinfo --html.
+ (Installing MP): Describe --enable-mpbsd and demo programs.
+
+ * tests/rand/statlib.c: mpz_cmp_abs => mpz_cmpabs.
+
+ * tests/rand/Makefile.am (LDADD): Don't need -lm (now in libgmp.la).
+ (EXTRA_PROGRAMS): Not noinst_PROGRAMS.
+ (INCLUDES): Shorten to -I$(top_srcdir) now using AM_CONFIG_HEADER.
+
+2000-04-09 Torbjorn Granlund <tege@swox.com>
+
+ * mpz/urandomm.c: Get type of count right.
+ Simplify computation of nbits.
+
+2000-04-08 Torbjorn Granlund <tege@swox.com>
+
+ * mpz/urandomb.c: Fix reallocation condition.
+ Simplify size computation.
+
+2000-04-08 Linus Nordberg <linus@swox.se>
+
+ * acinclude.m4 (GMP_CHECK_CC_64BIT): Add special handling for
+ HPUX.
+ (GMP_CHECK_ASM_W32): Ditto.
+ * aclocal.m4: Regenerate.
+
+ * mpn/Makefile.am: Use $(CCAS) for assembling.
+ (.asm.obj): Add rule.
+ * mpn/Makefile.in: Regenerate.
+
+ * gmp.texi (Miscellaneous Integer Functions): Fix typos.
+
+ * configure.in: Never pass `-h' to grep.
+ (mips-sgi-irix6.[2-9]*): Try to find 64-bit compiler.
+ (hppa1.0*-*-*): New flag for cc.
+ (hppa2.0*-*-*): Try to find 64-bit compiler. Chose path, set
+ CCAS.
+ * configure: Regenerate.
+
+2000-04-08 Torbjorn Granlund <tege@swox.com>
+
+ * mpz/bin_ui.c: Don't depend on ANSI C features.
+ * mpz/bin_uiui.c: Likewise.
+
+ * Makefile.am (MPZ_OBJECTS): mpz/cmp_abs* => mpz/cmpabs*.
+ (MPQ_OBJECTS): Add mpq/set_d.lo.
+ (MPZ_OBJECTS): Add mpz/fits*.lo.
+ * Makefile.in: Regenerate.
+
+ * mpz/cmpabs.c: New name for mpz/cmp_abs.c.
+ * mpz/cmpabs_ui.c: New name for mpz/cmp_abs_ui.c.
+ * mpz/Makefile.am: Corresponding changes.
+ * mpz/Makefile.in: Regenerate.
+ * gmp.h: mpz_cmp_abs* => mpz_cmpabs*.
+
+ * mpz/addmul_ui.c (mpn_neg1): Don't depend on ANSI C features.
+
+ * mpz/invert.c: Use TMP_MARK since we invoke MPZ_TMP_INIT.
+
+ * gmp.h (mpq_set_d): Declare correctly.
+ (mpz_root): Use _PROTO.
+ (mpz_remove): Use _PROTO.
+ (mpf_pow_iu): Use _PROTO.
+
+ * mpn/asm-defs.m4 (MPN_PREFIX): Revert previous change.
+ * gmp.h (__MPN): Revert previous change.
+
+ * mpz/perfpow.c: De-ANSI-fy. Add copyright notice.
+
+ * mpz/set_d.c: Misc cleanups.
+
+ * mpq/set_d: New file.
+ * gmp.h: Declare mpq_set_d.
+ * mpq/Makefile.am: List set_d.c.
+ * mpq/Makefile.in: Regenerate.
+
+2000-04-07 Torbjorn Granlund <tege@swox.com>
+
+ * mpz/fits_sint_p.c: New file.
+ * mpz/fits_slong_p.c: New file.
+ * mpz/fits_sshort_p.c: New file.
+ * mpz/fits_uint_p.c: New file.
+ * mpz/fits_ulong_p.c: New file.
+ * mpz/fits_ushort_p.c: New file.
+ * gmp.h: Declare mpz_fits_*.
+ * mpz/Makefile.am: List fits_* files.
+ * mpz/Makefile.in: Regenerate.
+
+2000-04-06 Kevin Ryde <kevin@swox.se>
+
+ * gmp.texi (Installing MP): Add known build problem SunOS 4.1.4 m4
+ failure.
+
+ * mpn/x86/pentium/gmp-mparam.h: Tune thresholds.
+ * mpn/x86/p6/gmp-mparam.h: Ditto.
+ * mpn/x86/k6/gmp-mparam.h: Tune thresholds, add UMUL_TIME, UDIV_TIME.
+ * mpn/x86/k7/gmp-mparam.h: Tune thresholds, amend UMUL_TIME.
+
+ * mpn/generic/mul_n.c (mpn_kara_mul_n): Add an ASSERT.
+ (mpn_kara_sqr_n): Add an ASSERT, use KARATSUBA_SQR_THRESHOLD.
+ (mpn_toom3_sqr_n): Eliminate second evaluate3.
+
+ * gmp-impl.h (mpn_com_n,MPN_LOGOPS_N_INLINE): Don't allow size==0.
+ (tune_mul_threshold,tune_sqr_threshold): Conditionalize
+ declarations on TUNE_PROGRAM_BUILD.
+
+ * mpn/generic/sqr_basecase.c: Add an assert.
+
+2000-04-05 Torbjorn Granlund <tege@swox.com>
+
+ * gmp.h, mpn/asm-defs.m4: List the same functions for __MPN, but
+ leave some commented out.
+
+ * gmp-impl.h (MPN_LOGOPS_N_INLINE): Optimize.
+ (mpn_com_n): Optimize.
+
+ * gmp.h (__MPN): Make it use __gmpn instead of __mpn for consistency.
+ * mpn/asm-defs.m4 (MPN_PREFIX): Likewise.
+
+ * gmp.h (GMP_ERROR_ALLOCATE): New errcode.
+
+ * gmp-impl.h (MPN_MUL_N_RECURSE): Delete.
+ (MPN_SQR_RECURSE): Delete.
+
+ * gmp-impl.h (TARGET_REGISTER_STARVED): New define.
+
+ * gmp-impl.h (mpn_kara_sqr_n): Remap with __MPN.
+ (mpn_toom3_sqr_n): Likewise.
+ (mpn_kara_mul_n): Likewise.
+ (mpn_toom3_mul_n): Likewise.
+ (mpn_reciprocal): Likewise.
+
+ * gmp-impl.h (__gmpn_mul_n): Remove declaration.
+ (__gmpn_sqr): Likewise.
+ * gmp.h (mpn_sqr_n): Declare/remap.
+ * mpn/generic/mul.c (mpn_sqr_n): New name for mpn_sqr.
+
+ * gmp.h (mpn_udiv_w_sdiv): Move __MPN remap from here...
+ * gmp-impl.h: ...to here.
+
+2000-04-05 Linus Nordberg <linus@swox.se>
+
+ * gmp.texi (Top): Add `Random Number Functions' to menu.
+ (Introduction to MP): Fix typo.
+ (MP Basics): Create menu for all sections. Move `Random Number
+ Functions' to its own chapter. Add nodes for all sections.
+ (Function Classes): Mention random generation functions under
+ miscellaneous.
+ (Miscellaneous Integer Functions): Update mpz_urandomb,
+ mpz_urandomm.
+ (Low-level Functions): Remove mpn_rawrandom.
+ (Random State Initialization): Update.
+
+ * mpf/urandom.c (mpf_urandomb): Remove SIZE parameter. Normalize
+ result correctly.
+
+ * gmp.h (mpf_urandomb): Remove SIZE parameter.
+
+ * randraw.c (gmp_rand_getraw): Handle the case where (1) the LC
+ scheme doesn't generate even limbs and (2) more than one LC
+ invocation is necessary to produce the requested number of bits.
+
+2000-04-05 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/generic/mul_n.c (INVERSE_3): New name for THIRD, define for
+ any BITS_PER_MP_LIMB.
+ (MP_LIMB_T_MAX): New.
+ (mpn_divexact3_n): Remove.
+ (interpolate3): Use mpn_divexact_by3 instead of mpn_divexact3_n.
+
+2000-04-05 Kevin Ryde <kevin@swox.se>
+
+ * gmp-impl.h (KARATSUBA_MUL_THRESHOLD<2): Remove cpp test.
+ (tune_mul_threshold,tune_sqr_threshold): Add declarations, used in
+ development only.
+
+ * mpn/x86/k7/sqr_basecase.asm: New file, only a copy of k6 for now.
+
+2000-04-04 Torbjorn Granlund <tege@swox.com>
+
+ * gmp-impl.h (TOOM3_MUL_THRESHOLD): Provide default.
+ (TOOM3_SQR_THRESHOLD): Provide default.
+
+ * mpn/generic/mul_n.c: Rewrite (mostly by Robert Harley).
+ * mpn/generic/mul.c: Rewrite (mostly by Robert Harley).
+
+ * configure.in (sparcv9 64-bit OS): Set extra_functions.
+
+2000-04-04 Linus Nordberg <linus@swox.se>
+
+ * mpn/generic/rawrandom.c: Remove file and replace with randraw.c
+ on top level.
+ (mpn_rawrandom): Rename to gmp_rand_getraw.
+
+ * randraw.c: New file; essentially a copy of
+ mpn/generic/rawrandom.c.
+ (gmp_rand_getraw): New function (formerly known as mpn_rawrandom).
+
+ * mpz/urandomb.c (mpz_urandomb): Change mpn_rawrandom -->
+ gmp_rand_getraw.
+ * mpz/urandomm.c (mpz_urandomb): Ditto.
+ * mpf/urandom.c (mpf_urandomb): Ditto.
+
+ * gmp.h (gmp_rand_getraw): Add function prototype.
+ (mpn_rawrandom): Remove function prototype.
+
+ * Makefile.am (libgmp_la_SOURCES): Add randraw.c.
+ * Makefile.in: Regenerate.
+
+ * configure.in (gmp_mpn_functions): Remove rawrandom.
+ * configure: Regenerate.
+
+2000-04-04 Linus Nordberg <linus@swox.se>
+
+ * gmp.h (GMP_ERROR enum): Remove comma after last enumeration
+ since the AIX compiler (xlc) doesn't like that.
+
+ * randlc.c (gmp_rand_init_lc): Allocate enough space for seed to
+ hold any upcoming seed.
+ * randlc2x.c (gmp_rand_init_lc_2exp): Likewise.
+
+ * mpn/generic/rawrandom.c: Remove debugging code.
+ (mpn_lc): Don't reallocate seed.
+
+ * mpz/urandomm.c (mpz_urandomm): Implement function.
+
+ * mpz/urandomb.c (mpz_urandomb): Fix typo in function definition.
+
+2000-04-04 Kevin Ryde <kevin@swox.se>
+
+ * make.bat: Removed (no longer works, no longer supported).
+ * mpn/msdos/asm-syntax.h: Removed (was used only by make.bat).
+
+2000-04-03 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/generic/brandom.c: New file, replacing random2.
+
+2000-04-02 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/sparc32/v9/submul_1.asm: Change some carry-form instructions
+ into their plain counterparts.
+
+ * mpn/sparc64/copyi.asm: Avoid executing ALIGN.
+
+ * mpn/sparc64/mul_1.asm: Handle overlap of rp/sp.
+ * mpn/sparc64/addmul_1.asm: Likewise.
+ * mpn/sparc64/submul_1.asm: Likewise.
+
+2000-04-01 Linus Nordberg <linus@swox.se>
+
+ * gmp.h: Fix function prototypes for randomization functions.
+ (__gmp_rand_lc_scheme_struct): Replace `m' with `m2exp'. Remove
+ unused `bits'.
+ (__gmp_rand_data_lc): Add `m2exp' as another way of representing
+ the modulus.
+ (__gmp_rand_state_struct): Remove unused `size'.
+
+ * rand.c (__gmp_rand_scheme): Use better multipliers. Remove test
+ schemes. Replace `m' with `m2exp'.
+ (gmp_rand_init): Change parameters and return type. Use `m2exp'
+ instead of `m'. Set `gmp_errno' on error. Disable BBS algorithm.
+
+ * randlc.c (gmp_rand_init_lc): Don't use malloc(). Change
+ parameters.
+
+ * randclr.c (gmp_rand_clear): Don't use free(). Disable BBS
+ algorithm. Set `gmp_errno' on error.
+
+ * randlc2x.c (gmp_rand_init_lc_2exp): New function.
+ * randsd.c (gmp_rand_seed): New function.
+ * randsdui.c (gmp_rand_seed_ui): New function.
+ * randlcui.c: Remove unused file.
+
+ * mpn/generic/rawrandom.c (mpn_rawrandom): Rewrite.
+ (mpn_lc): New static function.
+
+ * mpz/urandomb.c (mpz_urandomb): Use ABSIZ() instead of SIZ() for
+ determining size of ROP.
+
+ * mpf/urandom.c (mpf_urandomb): Add third parameter, nbits. (Not
+ used yet!)
+ Change parameter order to mpn_rawrandom().
+
+ * Makefile.am (libgmp_la_SOURCES): Add errno.c, randlc2x.c,
+ randsd.c, randsdui.c. Remove randui.c.
+ (MPZ_OBJECTS): Rename urandom.lo --> urandomb.lo. Add urandomm.lo.
+ * Makefile.in: Regenerate.
+
+ * mpz/Makefile.am (libmpz_la_SOURCES): Change urandom.c -->
+ urandomb.c. Add urandomm.c.
+ * mpz/Makefile.in: Regenerate.
+
+ * tests/rand/Makefile.am (noinst_PROGRAMS): Change findcl --> findlc.
+ Add gen.static.
+ * tests/rand/Makefile.in: Regenerate.
+
+ * tests/rand/gen.c (main): Add mpz_urandomm. Add command line options
+ `-C', `-m', extend `-a'. Use *mp*_*rand*() with new parameters. Call
+ gmp_rand_seed().
+
+2000-04-01 Kevin Ryde <kevin@swox.se>
+
+ * acinclude.m4 (GMP_CHECK_ASM_DATA): Plain .data for hpux.
+ * configure.in (CCAS): No CFLAGS, they're added when it's used.
+ (CONFIG_SRCDIR): New define for config.m4.
+ * mpn/sparc64/addmul_1.asm: Use it for an include().
+ * mpn/sparc64/submul_1.asm: Ditto.
+ * mpn/sparc64/mul_1.asm: Ditto.
+
+2000-03-31 Linus Nordberg <linus@swox.se>
+
+ * mpz/urandom.c: Rename to...
+ * mpz/urandomb.c: ...this.
+
+ * mpz/urandomb.c (mpz_urandomb): Change operand order in call to
+ mpn_rawrandom(). Use ABSIZ() instead of SIZ() when checking size
+ of ROP.
+
+ * mpz/urandomm.c: New file.
+
+2000-03-31 Kevin Ryde <kevin@swox.se>
+
+ * acinclude.m4 (GMP_CHECK_ASM_MMX): Give a warning when mmx code
+ will be omitted.
+
+2000-03-30 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/sparc64/mul_1h.asm: New file.
+ * mpn/sparc64/addmul_1h.asm: New file.
+ * mpn/sparc64/submul_1h.asm: New file.
+ * mpn/sparc64/mul_1.asm: Rewrite.
+ * mpn/sparc64/addmul_1.asm: Rewrite.
+ * mpn/sparc64/submul_1.asm: Rewrite.
+
+2000-03-28 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/sparc32/v9/mul_1.asm: Fix typo in branch prediction.
+ * mpn/sparc32/v9/addmul_1.asm: Likewise.
+ * mpn/sparc32/v9/submul_1.asm: Likewise.
+
+2000-03-25 Kevin Ryde <kevin@swox.se>
+
+ * mpn/lisp/gmpasm-mode.el: Fix some comment detection, use custom,
+ fontify more keywords, turn into a standalone mode.
+
+ * stamp-vti: New file, generated together with version.texi.
+
+ * acinclude.m4 (GMP_VERSION,GMP_HEADER_GETVAL): New macros.
+ * configure.in (AM_INIT_AUTOMAKE): Use GMP_VERSION.
+
+2000-03-24 Kevin Ryde <kevin@swox.se>
+
+ * INSTALL: Updates for new configure system.
+
+ * configure.in: Add gmp_optcflags_gcc for the x86s, setting -mcpu
+ and -march.
+
+2000-03-23 Torbjorn Granlund <tege@swox.com>
+
+ * demos/pexpr.c (mpz_eval_expr): Properly initialize rhs/lhs
+ for ROOT.
+
+2000-03-23 Kevin Ryde <kevin@swox.se>
+
+ * config.guess (i?86:*:*:*): Use uname -m if detection program fails.
+
+ * mpn/x86/README: Remove remarks on the now implemented MMX shifts.
+ * mpn/x86/k6/README: Add speed of mpn_divexact_by3, update mpn_mul_1.
+
+ * gmp.texi (Installing MP): Corrections to target CPUs.
+
+ * version.c: Use VERSION from config.h, add copyright comment,
+ restore "const" somehow lost.
+
+ * configure.in (a29k*-*-*): Fix directory name.
+
+2000-03-22 Torbjorn Granlund <tege@swox.com>
+
+ * demos/pexpr.c (op_t): Add ROOT.
+ (fns): Add ROOT.
+ (mpz_eval_expr): Add ROOT.
+
+ * mpz/root.c: Handle roots of negative numbers.
+ Fix other border cases.
+ Fix rare memory leakage.
+
+ * errno.c: New file.
+
+2000-03-21 Torbjorn Granlund <tege@swox.com>
+
+ * gmp.h (error number enum): New anonymous enum.
+ (gmp_errno): New.
+
+ * gmp.h (__GNU_MP_VERSION, __GNU_MP_VERSION_MINOR): Bump for GMP 3.0.
+
+2000-03-20 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/alpha/unicos.m4 (FLOAT64): New define.
+ * mpn/alpha/default.m4 (FLOAT64): New define.
+ * mpn/alpha/invert_limb.asm (C36): Use FLOAT64.
+
+2000-03-21 Kevin Ryde <kevin@swox.se>
+
+ * mpn/x86/k6/diveby3.asm: Tiny speedup.
+
+ * acinclude.m4 (GMP_CHECK_ASM_SHLDL_CL): New macro.
+ * configure.in: Use it, set WANT_SHLDL_CL in config.m4.
+ * mpn/x86/x86-defs.m4 (shldl,shrdl,shldw,shrdw): New macros, using
+ WANT_SHLDL_CL.
+ * mpn/x86/k6/mmx/lshift.asm: Use shldl macro.
+ * mpn/x86/k7/mmx/lshift.asm: Ditto.
+ * mpn/x86/pentium/mmx/lshift.asm: Ditto.
+ * mpn/x86/k6/mmx/rshift.asm: Use shrdl macro.
+ * mpn/x86/k7/mmx/rshift.asm: Ditto.
+ * mpn/x86/pentium/mmx/rshift.asm: Ditto.
+ * mpn/x86/README.family: Add a note about this.
+
+2000-03-20 Linus Nordberg <linus@swox.se>
+
+ * mpn/generic/rawrandom.c (mpn_rawrandom): Handle seed value of 0
+ correctly.
+
+ * configure.in: Fix detection of alpha flavour.
+ Set compiler options for `sparcv8'.
+ * configure: Regenerate.
+
+ * rand.c (__gmp_rand_scheme): Clean up some. Use slightly better
+ multipliers.
+
+ * configure.in (AC_OUTPUT): Add tests/Makefile and
+ tests/rand/Makefile.
+
+ * acinclude.m4 (AC_CANONICAL_BUILD): Define to
+ `_AC_CANONICAL_BUILD' to deal with incompatibilities between
+ Autoconf and Libtool.
+ (AC_CHECK_TOOL_PREFIX): Likewise.
+
+ * Makefile.am (EXTRA_DIST): Add directory `tests'.
+
+ * mkinstalldirs: Update (Automake 2000-03-17).
+ * ltconfig: Update (Libtool 2000-03-17).
+ * ltmain.sh: Ditto.
+
+ * configure: Regenerate with new autoconf/-make/libtool suite.
+ * aclocal.m4: Ditto.
+ * config.in: Ditto.
+ * all Makefile.in's: Ditto.
+
+2000-03-20 Torbjorn Granlund <tege@swox.com>
+
+ * demos/pexpr.c (main): Don't allow `-N' for base, require `-bN'.
+
+ * mpn/alpha/unicos.m4 (cvttqc): New define.
+ * mpn/alpha/invert_limb.asm: Use new define for cvttqc.
+
+2000-03-19 Kevin Ryde <kevin@swox.se>
+
+ * mpn/x86/k6/sqr_basecase.asm: Tiny amendments for 3x3 case.
+
+ * gmp.texi: Use @include version.texi.
+ Use @email and @uref.
+ (Installing MP): Rewrite for new configure.
+ (Low-level Functions): Add mpn_divexact_by3.
+
+ * configure.in (--enable-alloca): New option.
+ * acconfig.h (USE_STACK_ALLOC): For --disable-alloca.
+
+2000-03-18 Kent Boortz <kent@swox.com>
+
+ * macos: New directory with macos port files.
+
+2000-03-17 Torbjorn Granlund <tege@swox.com>
+
+ * gmp-impl.h (union ieee_double_extract): Check _CRAYMPP.
+
+ * mpn/asm-defs.m4 (invert_normalized_limb): Define.
+
+ * mpn/alpha: Translate `.s' files to `.asm'.
+
+ * configure: Regenerate.
+
+ * mpn/alpha/invert_limb.asm: Replace dash in file name with underscore.
+ * configure.in: Corresponding change.
+
+ * configure.in: Assign special "path" for alphaev6.
+
+ * mpn/alpha/unicos.m4: New file.
+ * configure.in (alpha*-cray-unicos*): [This part of the change
+ commited 2000-03-13 by linus]
+ * mpn/alpha/default.m4: New file.
+ * configure.in (alpha*-*-*): Use it.
+
+2000-03-17 Kevin Ryde <kevin@swox.se>
+
+ * mpn/x86/pentium/rshift.S: Use plain rcrl (not rcrl $1) for
+ shift-by-1 case, significant speedup.
+ * mpn/x86/pentium/README: Add shift-by-1 speed.
+
+2000-03-16 Torbjorn Granlund <tege@swox.com>
+
+ * config.guess: Handle Cray T3D/E.
+
+2000-03-15 Kevin Ryde <kevin@swox.se>
+
+ * mpn/generic/diveby3.c: New file.
+ * mpn/x86/diveby3.asm: New file.
+ * mpn/x86/k6/diveby3.asm: New file.
+ * gmp.h (mpn_divexact_by3): Prototype and define.
+ * mpn/asm-defs.m4: define_mpn(divexact_by3).
+ * configure.in (gmp_mpn_functions): Add diveby3.
+
+ * mpn/x86/pentium/sqr_basecase.asm: A few better addressing modes.
+
+ * configure.in: Add AC_C_STRINGIZE and AC_CHECK_TYPES((void)).
+ * gmp-impl.h (ASSERT): Use them.
+
+ * mpn/x86/k7/mmx/lshift.asm: New file.
+ * mpn/x86/k7/mmx/rshift.asm: Rewrite simple loop and return value
+ handling, add some pictures.
+
+2000-03-14 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/sparc32/v8/mul_1.asm: Make PIC actually work.
+ * mpn/sparc32/v8/addmul_1.asm: Likewise.
+
+ * mpn/sparc32/v8/mul_1.asm: Use m4 ifdef, not cpp #if.
+ * mpn/sparc32/v8/addmul_1.asm: Likewise.
+
+ * mpn/asm-defs.m4 (C): New define for comments.
+ * mpn/sparc32: Start comments with `C'.
+
+ * config.guess: Remove `SunOS 6' handling.
+ Recognize sun4m and sun4d architectures under old SunOS.
+
+2000-03-14 Linus Nordberg <linus@swox.se>
+
+ * configure.in (gmp_srclinks): Set to list of links created by
+ configure.
+ * configure: Regenerate.
+
+ * Makefile.am (libgmp_la_LDFLAGS): Set version info.
+ (DISTCLEANFILES): Include @gmp_srclinks@.
+ * Makefile.in: Regenerate.
+
+2000-03-13 Linus Nordberg <linus@swox.se>
+
+ * configure.in: Remove some changequote's by quoting the strings
+ containing `[]'.
+ Add support for `alpha*-cray-unicos*'.
+ AC_DEFINE `_LONG_LONG_LIMB' instead of passing it in CFLAGS.
+ Conditionalize the assembler syntax checks.
+ * configure: Regenerate.
+ * config.in: Regenerate.
+
+ * acinclude.m4 (GMP_PROG_CCAS): Remove macro.
+ * aclocal.m4: Regenerate.
+
+2000-03-13 Kevin Ryde <kevin@swox.se>
+
+ * mpn/x86/p6/README: New file.
+
+ * mpn/x86/k6/mul_1.asm: Rewrite, smaller and slightly faster.
+
+ * mpn/lisp/gmpasm-mode.el: Rewrite assembler comment detection and
+ handling.
+
+ * configure.in: Separate mmx directories for each x86 flavour.
+ * configure: Regenerate.
+
+2000-03-12 Kevin Ryde <kevin@swox.se>
+
+ * mpn/x86/x86-defs.m4 (ALIGN): Supplement definition from
+ config.m4 so as to pad with nops not zeros on old gas.
+
+ * mpn/x86/k7/mmx/copyd.asm: Use plain emms (femms is just an alias
+ for emms now).
+ * mpn/x86/k7/mmx/copyi.asm: Ditto.
+ * mpn/x86/k7/mmx/rshift.asm: Ditto.
+ * mpn/x86/x86-defs.m4: Amend comments.
+
+ * mpn/x86/mod_1.asm: Add comments on speeds.
+
+ * mpn/x86/pentium/mmx/lshift.asm: New file.
+ * mpn/x86/pentium/mmx/rshift.asm: New file.
+ * mpn/x86/pentium/README: Add speeds of various routines.
+
+2000-03-10 Linus Nordberg <linus@swox.se>
+
+ * configure.in: Reorganize.
+ Use AC_CHECK_TOOL to find `ar'.
+ Add post-includes `regmap.m4' and `aix.m4' for AIX targets.
+ asm-syntax.h is not needed for PPC or sparc anymore.
+ (powerpc64-*-aix*): Compiler is always 64-bit. Use `-q64
+ -qtune=pwr3' to xlc and `-maix64 -mpowerpc64' to gcc. Pass `-X
+ 64' to `ar' and `nm'.
+ (pentiummmx): Use GMP_CHECK_ASM_MMX and avoid MMX assembly path if
+ assembler is not MMX capable.
+ (pentium[23]): Likewise.
+ (athlon): Likewise.
+ (k6*): Likewise.
+ * configure: Regenerate.
+
+ * acinclude.m4 (GMP_PROG_CC_WORKS): New macro.
+ (GMP_PROG_CC_FIND): Use GMP_PROG_CC_WORKS instead of
+ AC_TRY_COMPILER. Make sure that the *first* working 32-bit
+ compiler is used if no 64-bit compiler is found.
+ (GMP_CHECK_ASM_MMX): New macro.
+ * aclocal.m4: Regenerate.
+
+ * Makefile.in: Regenerate. (CC_TEST removed.)
+ * mpf/Makefile.in: Likewise.
+ * mpn/Makefile.in: Likewise.
+ * mpq/Makefile.in: Likewise.
+ * mpz/Makefile.in: Likewise.
+ * mpf/tests/Makefile.in: Likewise.
+ * mpq/tests/Makefile.in: Likewise.
+ * mpz/tests/Makefile.in: Likewise.
+
+ * acconfig.h (_LONG_LONG_LIMB): Add.
+
+ * gmp-impl.h: Include config.h only if HAVE_CONFIG_H is defined.
+
+2000-03-09 Kevin Ryde <kevin@swox.se>
+
+ * mpn/x86/pentium/mul_basecase.S: Small speedup by avoiding an AGI.
+
+ * mpn/x86/k7/mmx/copyd.asm: Tiny speedup by avoiding popl.
+ * mpn/x86/k7/mmx/copyi.asm: Ditto.
+ * mpn/x86/k7/mul_basecase.asm: Ditto.
+
+2000-03-07 Torbjorn Granlund <tege@swox.com>
+
+ * config.guess: Better recognize POWER/PowerPC processor type.
+
+2000-03-07 Kevin Ryde <kevin@swox.se>
+
+ * mpn/generic/addsub_n.c: Use HAVE_NATIVE_* now in config.h.
+
+ * mpn/asm-defs.m4: Add comments about SysV m4.
+ (m4_log2): Don't use <<.
+ (m4_lshift,m4_rshift): New macros.
+
+2000-03-06 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/powerpc32/regmap.m4: Map cr0 => `0', etc.
+
+2000-03-06 Kevin Ryde <kevin@swox.se>
+
+ * mpn/tests/ref.c (refmpn_divexact_by3): New function.
+ * mpn/tests/ref.h: Prototype.
+
+ * acconfig.h (WANT_ASSERT): New define.
+ * configure.in (--enable-assert): Turn on WANT_ASSERT.
+ * assert.c: New file.
+ * Makefile.am: Add to build.
+ * gmp-impl.h (ASSERT): New macro.
+ (ASSERT_NOCARRY) Renamed from assert_nocarry.
+ (MPZ_CHECK_FORMAT): Use ASSERT_ALWAYS.
+ * mpn/tests/ref.c: Use ASSERT.
+ * mpf/get_str.c: Use ASSERT_ALWAYS.
+ * mpf/set_str.c: Remove old assert macro.
+
+ * mpn/x86/x86-defs.m4 (cmovnz_ebx_ecx): New macro.
+ * mpn/x86/p6/aorsmul_1.asm: Use cmov.
+
+ * mpn/x86/lshift.S: Use %dl with testb, not %edx. No object code
+ change, testb was still getting generated.
+ * mpn/x86/rshift.S: Ditto.
+
+2000-03-03 Torbjorn Granlund <tege@swox.com>
+
+ * longlong.h: Add IA-64 support.
+
+ * mpn/powerpc32: Misc cleanups.
+ * mpn/powerpc32/aix.m4: New file (mainly by Linus).
+ * mpn/powerpc64/aix.m4: New file (mainly by Linus).
+ * mpn/powerpc64: Translate `.S' files to `.asm'.
+
+ * configure.in: Fix tyops.
+ * configure: Regenerate.
+
+2000-03-02 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/powerpc32/regmap.m4: New file.
+ * mpn/powerpc32: Translate `.S' files to `.asm'.
+ * configure.in: Use mpn/powerpc32/regmap.m4 for powerpc targets
+ except some weird ones.
+
+2000-03-03 Kevin Ryde <kevin@swox.se>
+
+ * mpn/lisp/gmpasm-mode.el: Suppress postscript comment prefixes in
+ filladapt.
+
+ * mpn/x86/pentium/sqr_basecase.asm: New file.
+ * mpn/x86/pentium/gmp-mparam.h (KARATSUBA_SQR_THRESHOLD): Update.
+
+ * configure.in: Add --enable-assert, enable k6 logops functions.
+
+ * mpn/x86/k6/mmx/copyi.asm: Use m4 for divide, not as.
+ * mpn/x86/k6/mmx/copyd.asm: Ditto.
+ * mpn/x86/README.family: Add a note on this.
+
+2000-03-02 Kevin Ryde <kevin@swox.se>
+
+ * mpn/x86/k6/aors_n.asm: Don't use stosl.
+ * mpn/x86/copyi.asm: Use cld to clear direction flag.
+ * mpn/x86/divrem_1.asm: Ditto.
+ * mpn/x86/README.family: Add a note on this.
+
+ * mpn/x86/k6/mmx/copyi.asm: Rewrite.
+ * mpn/x86/k6/mmx/copyd.asm: New file.
+ * mpn/x86/k6/README: Update, and small amendments.
+
+ * mpn/x86/x86-defs.m4 (Zdisp): New macro.
+ * mpn/asm-defs.m4 (m4_stringequal_p): New macro.
+
+ * mpn/x86/p6/aorsmul_1.asm: Use Zdisp to force zero displacements.
+ * mpn/x86/k6/aorsmul_1.asm: Ditto.
+ * mpn/x86/k6/mul_1.asm: Ditto.
+ * mpn/x86/k6/mul_basecase.asm: Ditto.
+ * mpn/x86/k7/aors_n.asm: Ditto.
+ * mpn/x86/k7/aorsmul_1.asm: Ditto.
+ * mpn/x86/k7/mul_1.asm: Ditto.
+ * mpn/x86/k7/mul_basecase.asm: Ditto.
+ * mpn/x86/README.family: Add a note on this.
+
+2000-02-27 Kevin Ryde <kevin@swox.se>
+
+ * mpn/generic/divrem.c (mpn_divrem_classic): Patch to avoid gcc
+ 2.7.2.3 i386 register handling bug.
+
+ * mpn/x86/k6/aors_n.asm: Rewrite.
+ * mpn/x86/k6/mmx/lshift.asm: Rewrite.
+ * mpn/x86/k6/mmx/rshift.asm: Rewrite.
+ * mpn/x86/k6/README: Update.
+
+ * mpn/x86/k7/mmx/copyd.asm: Support size==0.
+ * mpn/x86/k7/mmx/copyi.asm: Ditto.
+ * mpn/x86/k6/mmx/copyi.asm: Ditto.
+ * gmp-impl.h: Comment size==0 allowed in MPN_COPY_INCR and
+ MPN_COPY_DECR.
+ * configure.in: Enable x86 copyi, copyd; add k6 com_n.
+
+2000-02-25 Torbjorn Granlund <tege@swox.com>
+
+ * demos/pexpr.c (power): Move factorial handing code from `factor'
+ to `power'.
+
+ * demos/factorize.c (factor_using_pollard_rho): Move resetting of `c'
+ to before checking for a non-zero gcd.
+
+2000-02-25 Kevin Ryde <kevin@swox.se>
+
+ * mpn/asm-defs.m4 (MULFUNC_PROLOGUE): New macro by Linus.
+ * mpn/x86/k6/aors_n.asm: Use MULFUNC_PROLOGUE.
+ * mpn/x86/k6/aorsmul_1.asm: Ditto.
+ * mpn/x86/k7/aors_n.asm: Ditto.
+ * mpn/x86/k7/aorsmul_1.asm: Ditto.
+ * mpn/x86/p6/aorsmul_1.asm: Ditto.
+
+ * mpn/tests/ref.c (refmpn_copyi,refmpn_copyd): Allow size==0.
+
+ * gmp-impl.h: Move mpn_and_n, mpn_andn_n, mpn_com_n, mpn_ior_n,
+ mpn_iorn_n, mpn_nand_n, mpn_nior_n, mpn_xor_n and mpn_xorn_n here
+ from gmp.h. Use HAVE_NATIVE_mpn_* to make these functions or
+ inlines.
+
+ * gmp-impl.h: Move mpn_copyd, mpn_copyi here from gmp.h.
+ * gmp-impl.h (MPN_COPY_INCR): Use mpn_copyi if available.
+ * gmp-impl.h (MPN_COPY_DECR): Use mpn_copyd if available.
+
+ * mpn/x86/k6/mmx/com_n.asm: Moved into mmx subdirectory.
+ * mpn/x86/k6/mmx/copyi.asm: Ditto.
+ * mpn/x86/k6/mmx/lshift.asm: Ditto.
+ * mpn/x86/k6/mmx/rshift.asm: Ditto.
+ * mpn/x86/k7/mmx/rshift.asm: Ditto.
+ * mpn/x86/k6/mmx/logops_n.asm: New file.
+ * configure.in (k6*-*-*): Add logops_n.asm.
+ * mpn/x86/k6/README: Update.
+
+ * mpn/x86/k7/mmx/copyi.asm: New file.
+ * mpn/x86/k7/mmx/copyd.asm: New file.
+ * mpn/x86/k7/README: Update.
+
+2000-02-24 Kevin Ryde <kevin@swox.se>
+
+ * mpn/x86/x86-defs.m4 (femms): Generate emms if 3dnow not available.
+ * mpn/x86/x86-defs.m4 (FRAME_popl): New macro.
+
+ * Makefile.am: Add info_TEXINFOS = gmp.texi
+
+ * mpn/x86/divrem_1.asm: Moved from mpn/x86/k6, allow size==0,
+ conditionalize loop versus decl/jnz.
+ * mpn/x86/mod_1.asm: Ditto.
+ * mpn/x86/divmod_1.asm: Removed.
+ * gmp.texi (mpn_divrem_1,mpn_mod_1): Add that size==0 is allowed.
+ * mpn/tests/ref.c (refmpn_divrem_1c,etc): Allow size==0.
+
+ * mpn/x86/k6/aors_n.asm: Avoid gas 1.92.3 leal displacement
+ expression problem.
+ * mpn/x86/k6/aorsmul_1.asm: Ditto.
+ * mpn/x86/k6/mul_1.asm: Ditto.
+ * mpn/x86/k6/mul_basecase.asm: Ditto
+ * mpn/x86/k7/aors_n.asm: Ditto.
+ * mpn/x86/k7/aorsmul_1.asm: Ditto.
+ * mpn/x86/k7/mul_1.asm: Ditto.
+ * mpn/x86/k7/mul_basecase.asm: Ditto.
+ * mpn/x86/k7/rshift.asm: Ditto.
+ * mpn/x86/p6/aorsmul_1.asm: Ditto.
+ * mpn/x86/README.family: Describe problem.
+
+2000-02-24 Linus Nordberg <linus@swox.se>
+
+ * acinclude.m4 (GMP_CHECK_ASM_LSYM_PREFIX): Add dummy symbol to
+ testcase to avoid nm failure. Try nm before piping to grep.
+
+ * acconfig.h: Undef HAVE_NATIVE_func for every mpn function found
+ in gmp.h.
+
+ * configure.in: Invoke AC_CONFIG_HEADERS.
+ Don't invoke AM_CONFIG_HEADER; it makes autoconf confused.
+ Dig out entry points declared in assembly code and AC_DEFINE proper
+ HAVE_NATIVE_func.
+
+ * mpn/asm-defs.m4 (MULFUNC_PROLOGUE): New macro.
+
+ * mpn/x86/p6/aorsmul_1.asm: Use MULFUNC_PROLOGUE.
+ * mpn/x86/k6/aors_n.asm: Likewise.
+
+ * Makefile.am (EXTRA_DIST): Add config.in; needed when we don't
+ use AM_CONFIG_HEADER in configure.in.
+
+ * mpn/Makefile.am (INCLUDES): Add `-I..' for config.h and
+ gmp-mparam.h.
+ * mpf/Makefile.am: Likewise.
+ * mpq/Makefile.am: Likewise.
+ * mpz/Makefile.am: Likewise.
+
+ * mpf/tests/Makefile.am (INCLUDES): Add `-I../..' for config.h and
+ gmp-mparam.h.
+ * mpq/tests/Makefile.am: Likewise.
+ * mpz/tests/Makefile.am: Likewise.
+
+ * configure: Regenerate.
+ * aclocal.m4: Regenerate.
+ * config.in: Regenerate.
+ * Makefile.in: Regenerate.
+ * mpf/Makefile.in: Regenerate.
+ * mpn/Makefile.in: Regenerate.
+ * mpq/Makefile.in: Regenerate.
+ * mpz/Makefile.in: Regenerate.
+ * mpf/tests/Makefile.in: Regenerate.
+ * mpq/tests/Makefile.in: Regenerate.
+ * mpz/tests/Makefile.in: Regenerate.
+
+2000-02-23 Kevin Ryde <kevin@swox.se>
+
+ * mpn/x86/addmul_1.S: Amend comments, this code no longer used by
+ PentiumPro.
+ * mpn/x86/submul_1.S: Ditto.
+
+ * mpn/x86/k6/com_n.asm: Rewrite, smaller but same speed.
+
+ * mpn/x86/addmul_1.S: Add PROLOGUE and EPILOGUE to get .type and
+ .size for ELF. Rename #define size to n to avoid .size.
+ * mpn/x86/lshift.S: Ditto.
+ * mpn/x86/mul_1.S: Ditto.
+ * mpn/x86/mul_basecase.S: Ditto.
+ * mpn/x86/rshift.S: Ditto.
+ * mpn/x86/submul_1.S: Ditto.
+ * mpn/x86/udiv.S: Ditto.
+ * mpn/x86/umul.S: Ditto.
+ * mpn/x86/pentium/add_n.S: Ditto.
+ * mpn/x86/pentium/addmul_1.S: Ditto.
+ * mpn/x86/pentium/lshift.S: Ditto.
+ * mpn/x86/pentium/mul_1.S: Ditto.
+ * mpn/x86/pentium/mul_basecase.S: Ditto.
+ * mpn/x86/pentium/rshift.S: Ditto.
+ * mpn/x86/pentium/sub_n.S: Ditto.
+ * mpn/x86/pentium/submul_1.S: Ditto.
+
+2000-02-22 Linus Nordberg <linus@swox.se>
+
+ * acinclude.m4 (GMP_INIT): Use temporary file cnfm4p.tmp for
+ post-defines.
+ (GMP_FINISH): Ditto.
+ (GMP_DEFINE): Add third optional argument specifying location in
+ outfile.
+ (GMP_DEFINE_RAW): New macro.
+ * aclocal.m4: Regenerate.
+
+ * configure.in: Add `HAVE_TARGET_CPU_$target_cpu' using
+ GMP_DEFINE_RAW.
+ * configure: Regenerate.
+
+ * mpz/tests/Makefile.am: New test t-root.
+ * mpz/tests/Makefile.in: Regenerate.
+
+2000-02-22 Torbjorn Granlund <tege@swox.com>
+
+ * mpz/root.c: Complete rewrite; still primitive, but at least correct.
+ * mpz/tests/t-root.c: New test.
+
+2000-02-22 Kevin Ryde <kevin@swox.se>
+
+ * mpn/x86/k7/mul_basecase.asm: New file.
+ * mpn/x86/k7/README: Add mpn_mul_basecase speed.
+ * mpn/x86/k7/gmp-mparam.h: New file.
+
+ * mpn/x86/x86-defs.m4 (loop_or_decljnz,cmov_bytes): New macros.
+ * mpn/asm-defs.m4 (m4_ifdef_anyof_p): New macro.
+
+ * mpn/x86/k6/aorsmul_1.asm: New file.
+ * mpn/x86/k6/addmul_1.S: Removed (was a copy of pentium version).
+ * mpn/x86/k6/submul_1.S: Removed (was a copy of pentium version).
+
+ * mpn/x86/p6/aorsmul_1.asm: Use OPERATION_addmul_1 and
+ OPERATION_submul_1.
+ * mpn/x86/k6/aors_n.asm: Use OPERATION_add_n and OPERATION_sub_n.
+ * configure.in: Declare multi-function files for k6 and p6.
+
+ * configure.in: Add HAVE_TARGET_CPU_$target_cpu for config.m4.
+ * mpn/asm-defs.m4 (define_not_for_expansion): New macro.
+
+ * mpn/generic/divrem_1n.c (__gmpn_divrem_1n): New file, split from
+ mpn/generic/divrem_1.c.
+ * mpn/generic/divrem_1.c: Ditto.
+ * configure.in (gmp_mpn_functions): Ditto.
+
+2000-02-21 Torbjorn Granlund <tege@swox.com>
+
+ * gmp.h: Undo 1996-10-06 NeXT change, it was clearly improperly
+ written.
+
+2000-02-21 Linus Nordberg <linus@swox.se>
+
+ * configure.in: Link <src>/mpn/asm-defs.m4 to <build>mpn/asm.m4.
+ * configure: Regenerate.
+
+2000-02-21 Linus Nordberg <linus@swox.se>
+
+ * mpn/x86/k7/aorsmul_1.asm: Change OPERATION_ADDMUL -->
+ OPERATION_addmul_1. Change OPERATION_SUBMUL -->
+ OPERATION_submul_1.
+
+ * mpn/x86/k7/aors_n.asm: Change OPERATION_ADD --> OPERATION_add_n.
+ Change OPERATION_SUB --> OPERATION_sub_n.
+
+ * mpn/Makefile.am: Pass -DOPERATION_$* to preprocessors.
+ * mpn/Makefile.in: Regenerate.
+
+ * configure.in: Symlink mpn/asm-defs.m4 to build-dir/mpn. Link
+ multi-function files to mpn/<function>.asm and remove function
+ name from `gmp_mpn_functions'.
+ * configure: Regenerate.
+
+ * acinclude.m4 (GMP_FINISH): Tell user what we're doing.
+ * aclocal.m4: Regenerate.
+
+2000-02-21 Kevin Ryde <kevin@swox.se>
+
+ * gmp-impl.h: Rename __gmpn_mul_basecase to mpn_mul_basecase and
+ __gmpn_sqr_basecase to mpn_sqr_basecase, remove __gmpn prototypes.
+ * mpn/x86/mul_basecase.S: Ditto.
+ * mpn/x86/pentium/mul_basecase.S: Ditto.
+
+ * configure.in (gmp_m4postinc): Use x86-defs.m4 on athlon-*-* too.
+
+2000-02-20 Kevin Ryde <kevin@swox.se>
+
+ * acinclude.m4 (GSYM_PREFIX): Drop $1, change by Linus.
+ * mpn/asm-defs.m4 (PROLOGUE,EPILOGUE): Use GSYM_PREFIX as a
+ string, change by Linus.
+ * mpn/x86/x86-defs.m4: Use GSYM_PREFIX as a string.
+
+ * mpn/x86/k6/gmp-mparam.h: New file.
+ * mpn/asm-defs.m4 (m4_warning): New macro.
+
+ * mpn/x86/README: Amendments per new code and directories.
+ * mpn/x86/README.family: New file.
+ * mpn/x86/k6/README: New file.
+ * mpn/x86/k7/README: New file.
+
+ * mpn/generic/mul_n.c: Rename __gmpn_mul_basecase to
+ mpn_mul_basecase and __gmpn_sqr_basecase to mpn_sqr_basecase.
+ * mpn/generic/mul_basecase.c: Ditto.
+ * mpn/generic/sqr_basecase.c: Ditto.
+ * mpn/generic/mul.c: Ditto.
+
+2000-02-19 Linus Nordberg <linus@swox.se>
+
+ * configure.in: Don't try to symlink more than one multi-func
+ file.
+ * configure: Regenerate.
+
+2000-02-18 Linus Nordberg <linus@swox.se>
+
+ * acinclude.m4 (GMP_CHECK_ASM_UNDERSCORE): GMP_DEFINE
+ `GSYM_PREFIX'. Run ACTIONs even when value is found in cache.
+ (GMP_CHECK_ASM_ALIGN_LOG): GMP_DEFINE `ALIGN'. Run ACTIONs even
+ when value is found in cache.
+ * aclocal.m4: Regenerate.
+
+ * configure.in: Don't define GSYM_PREFIX or ALIGN.
+ Add mechanism for multi-function files.
+ * configure: Regenerate.
+
+2000-02-18 Kevin Ryde <kevin@swox.se>
+
+ * configure.in (gmp_m4postinc): Enable x86-defs.m4.
+ * mpn/x86/k7/mul_1.asm: Fix include.
+ * mpn/x86/k6/mul_basecase.S: Removed (copy of the pentium version).
+ * mpn/x86/k6/mul_basecase.asm: New file.
+ * mpn/x86/k6/sqr_basecase.asm: New file.
+ * mpn/x86/k6/com_n.asm: New file.
+ * mpn/x86/k6/copyi.asm: New file.
+ * gmp.texi (Low-level Functions): Clarify mpn overlaps permitted.
+ * gmp-impl.h (MPN_OVERLAP_P): New macro.
+ * gmp-impl.h (assert_nocarry): New macro.
+ * mpn/tests/ref.c: New file, based in part on other mpn/tests/*.c.
+ * mpn/tests/ref.h: New file.
+
+2000-02-17 Linus Nordberg <linus@swox.se>
+
+ * Makefile.am (dist-hook): Don't include any emacs backup files
+ (*.~*) in dist.
+ * Makefile.in: Regenerate.
+
+2000-02-17 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/sparc32/v9/mul_1.asm: Use `rd' to get current PC; get rid of
+ getpc function.
+ * mpn/sparc32/v9/addmul_1.asm: Likewise.
+ * mpn/sparc32/v9/submul_1.asm: Likewise.
+
+2000-02-17 Kevin Ryde <kevin@swox.se>
+
+ * gmp.h: Add prototypes and defines for mpn_and_n, mpn_andn_n,
+ mpn_com_n, mpn_copyd, mpn_copyi, mpn_ior_n, mpn_iorn_n,
+ mpn_mul_basecase, mpn_nand_n, mpn_nior_n, mpn_sqr_basecase,
+ mpn_xor_n, mpn_xorn_n.
+
+ * mpn/asm-defs.m4: Many additions making up initial version.
+ * mpn/asm-defs.m4 (L): Use defn(`LSYM_PREFIX').
+ * mpn/x86/x86-defs.m4: New file.
+ * mpn/x86/k6/aors_n.asm: New file.
+ * mpn/x86/k6/divmod_1.asm: New file.
+ * mpn/x86/k6/divrem_1.asm: New file.
+ * mpn/x86/k6/lshift.S: Removed (was a copy of the pentium version).
+ * mpn/x86/k6/lshift.asm: New file.
+ * mpn/x86/k6/mod_1.asm: New file.
+ * mpn/x86/k6/mul_1.S: Removed (was a copy of the pentium version).
+ * mpn/x86/k6/mul_1.asm: New file.
+ * mpn/x86/k6/rshift.S: Removed (was a copy of the pentium version).
+ * mpn/x86/k6/rshift.asm: New file.
+ * mpn/x86/k7/aors_n.asm: New file.
+ * mpn/x86/k7/aorsmul_1.asm: New file.
+ * mpn/x86/k7/mul_1.asm: New file.
+ * mpn/x86/k7/rshift.asm: New file.
+ * mpn/x86/p6/aorsmul_1.asm: New file.
+ * mpn/x86/copyi.asm: New file.
+ * mpn/x86/copyd.asm: New file.
+ * mpn/lisp/gmpasm-mode.el: New file.
+
+2000-02-16 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/sparc32/v9/mul_1.asm: Conditionalize for PIC.
+ * mpn/sparc32/v9/addmul_1.asm: Likewise.
+ * mpn/sparc32/v9/submul_1.asm: Likewise.
+ * mpn/sparc32/v8/supersparc/udiv.asm: Likewise.
+ * mpn/sparc32/udiv_fp.asm: Likewise.
+
+2000-02-16 Linus Nordberg <linus@swox.se>
+
+ * configure.in: Add mechanism for including target specific
+ m4-files in config.m4.
+ * configure: Regenerate.
+
+ * acinclude.m4 (GMP_PROG_CCAS): Begin assembly lines (except
+ labels) with a tab character. HP-UX demands it.
+ (GMP_CHECK_ASM_SIZE): Ditto.
+ (GMP_CHECK_ASM_LSYM_PREFIX): Ditto.
+ (GMP_CHECK_ASM_LABEL_SUFFIX): Set to empty string for HP-UX.
+ (GMP_CHECK_ASM_GLOBL): Change `.xport' --> `.export'.
+ * aclocal.m4: Regenerate.
+
+2000-02-16 Linus Nordberg <linus@swox.se>
+
+ * acinclude.m4 (GMP_CHECK_ASM_LSYM_PREFIX): Define LSYM_PREFIX as
+ the prefix only, no argument.
+ * aclocal.m4: Regenerate.
+ * configure: Regenerate.
+
+ * mpn/asm-defs.m4 (L): No argument to LSYM_PREFIX.
+
+2000-02-15 Linus Nordberg <linus@swox.se>
+
+ * acinclude.m4: Prefix all temporary shell variables with
+ `gmp_tmp_'.
+ (GMP_PROG_CC_FIND): Use defaults if no arguments are passed.
+ Quote use of arguments.
+ (GMP_PROG_CCAS): New macro.
+ (GMP_INIT): New macro.
+ (GMP_FINISH): New macro.
+ (GMP_INCLUDE): New macro.
+ (GMP_SINCLUDE): New macro.
+ (GMP_DEFINE): New macro.
+ (GMP_CHECK_ASM_LABEL_SUFFIX): New macro.
+ (GMP_CHECK_ASM_TEXT): New macro.
+ (GMP_CHECK_ASM_DATA): New macro.
+ (GMP_CHECK_ASM_GLOBL): New macro.
+ (GMP_CHECK_ASM_TYPE): New macro.
+ (GMP_CHECK_ASM_SIZE): New macro.
+ (GMP_CHECK_ASM_LSYM_PREFIX): New macro.
+ (GMP_CHECK_ASM_W32): New macro.
+ * aclocal.m4: Regenerate.
+
+ * configure.in: Find m4 and nm for target.
+ Use new macros to create config.m4.
+ Prefix all temporary shell variables with `tmp_'.
+ Pass `-X 64' to nm for 64-bit PPC target with 64-bit compiler.
+ * configure: Regenerate.
+
+ * Makefile.am (dist-hook): *Really* remove all CVS dirs in
+ dist.
+ * Makefile.in: Regenerate.
+
+ * mpn/Makefile.am: Add target for building .lo and .o from
+ .asm.
+ Pass -DPIC to preprocessor (CPP/m4) when building .lo.
+ Build .o a second time for target .lo, without -DPIC to
+ preprocessor.
+ (SUFFIX): Add `.asm'.
+ (EXTRA_DIST): Add asm-defs.m4.
+ * mpn/Makefile.in: Regenerate.
+
+ * mpf/Makefile.in: Regenerate.
+ * mpf/tests/Makefile.in: Regenerate.
+ * mpq/Makefile.in: Regenerate.
+ * mpq/tests/Makefile.in: Regenerate.
+ * mpz/Makefile.in: Regenerate.
+ * mpz/tests/Makefile.in: Regenerate.
+
+2000-02-15 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/sparc32/udiv_fp.asm: Change `RODATA' to `DATA'.
+ * mpn/sparc32/v8/supersparc/udiv.asm: Likewise.
+ * mpn/sparc32/v9/addmul_1.asm: Likewise.
+ * mpn/sparc32/v9/submul_1.asm: Likewise.
+ * mpn/sparc32/v9/mul_1.asm: Likewise.
+
+ * mpn/sparc32/add_n.asm: Rename `size' -> `n'.
+ * mpn/sparc32/sub_n.asm: Likewise.
+
+ * sparc32: Rename `.s' and `.S' files to `.asm'.
+ * sparc64: Rename `.s' and `.S' files to `.asm'.
+
+2000-02-11 Torbjorn Granlund <tege@swox.com>
+
+ * config.sub: Adopt to new config.guess sparc naming conventions.
+
+ * config.guess (sun4u:SunOS:5.*:*): Change `sparc9' to `sparcv9'.
+ * config.guess (sun4m:SunOS:5.*:*): Change to sun4[md]:SunOS:5.*:* and
+ change `sparc8' to `sparcv8'.
+
+ * mpn/x86/add_n.S: Use PROLOGUE/EPILOGUE.
+ * mpn/x86/sub_n.S: Likewise.
+
+ * mpn/x86/syntax.h (PROLOGUE): New name for PROLOG.
+ * mpn/x86/syntax.h (EPILOGUE): New name for EPILOG.
+
+2000-02-11 Linus Nordberg <linus@swox.se>
+
+ * configure.in: Better path for 64-bit sparc without 64-bit cc.
+ Change sparc8 --> sparcv8.
+ Change sparc9 --> sparcv9.
+ * configure: Regenerate.
+
+2000-02-10 Linus Nordberg <linus@swox.se>
+
+ * configure.in: Use Autoconf.
+ * Makefile.am: New file.
+
+ * AUTHORS: New file.
+ * COPYING: New file.
+ * acinclude.m4: New file.
+ * acconfig.h: New file.
+
+ * configure: Generate.
+ * Makefile.in: Generate.
+ * aclocal.m4: Generate.
+ * config.in: Generate.
+
+ * install.sh: Remove.
+ * install-sh: New file from Automake.
+ * missing: New file from Automake.
+ * ltconfig: New file from Libtool.
+ * ltmain.sh: New file from Libtool.
+
+ * mpf/Makefile.am: New file.
+ * mpf/Makefile.in: Generate.
+ * mpf/configure.in: Remove.
+ * mpf/tests/Makefile.am: New file.
+ * mpf/tests/Makefile.in: Generate.
+ * mpf/tests/configure.in: Remove.
+
+ * mpn/Makefile.am: New file.
+ * mpn/Makefile.in: Generate.
+ * mpn/configure.in: Remove.
+
+ * mpq/Makefile.am: New file.
+ * mpq/Makefile.in: Generate.
+ * mpq/configure.in: Remove.
+ * mpq/tests/Makefile.am: New file.
+ * mpq/tests/Makefile.in: Generate.
+ * mpq/tests/configure.in: Remove.
+
+ * mpz/Makefile.am: New file.
+ * mpz/Makefile.in: Generate.
+ * mpz/configure.in: Remove.
+ * mpz/tests/Makefile.am: New file.
+ * mpz/tests/Makefile.in: Generate.
+ * mpz/tests/configure.in: Remove.
+
+2000-02-10 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/x86/add_n.S: Don't use label L0 twice.
+ * mpn/x86/sub_n.S: Likewise.
+
+2000-01-20 Linus Nordberg <linus@swox.se>
+
+ * demos/pexpr.c: Don't use setup_error_handler() in windoze.
+
+2000-01-19 Torbjorn Granlund <tege@swox.com>
+
+ * demos/pexpr.c (sigaltstack): #define to sigstack for AIX.
+ (setup_error_handler): Don't write to ss_size and ss_flags
+ on AIX.
+
+2000-01-11 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/configure.in (hppa2.0*-*-*): Move assignment of
+ target_makefile_frag to where it belongs.
+
+1999-12-21 Torbjorn Granlund <tege@swox.com>
+
+ * longlong.h (v9 umul_ppmm): New #define.
+ (v9 udiv_qrnnd): New #define.
+
+1999-12-14 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/generic/divmod_1.c: Use invert_limb.
+ * mpn/generic/mod_1.c: Use invert_limb.
+
+ * gmp-impl.h (invert_limb): Put definition here.
+ * mpn/generic/divrem.c (invert_limb): Delete definition.
+ * mpn/generic/divrem_2.c (invert_limb): Delete definition.
+
+ * gmp.h (mpn_divrem): Inhibit for non-gcc.
+ But declare (undo 1999-11-22 change).
+
+ * gmp-impl.h (DItype,UDItype): Do these also if _LONG_LONG_LIMB.
+
+ * longlong.h: Move 64-bit hppa code out of __GNUC__ conditional.
+
+ * stack-alloc.c (HSIZ): New #define.
+ (__tmp_alloc): Use HSIZ instead of sizeof(tmp_stack).
+
+1999-12-10 Torbjorn Granlund <tege@swox.com>
+
+ * config.sub: Clean up handling of x86 CPUs: Properly recognize
+ Amd CPUs as unique entities. Use manufacturer's names of
+ processors ("pentium", etc); still match ambiguous names like
+ "i586", "i686", "p6" but be conservative in interpreting them.
+
+ * configure.in: Recognize x86 CPU types known by config.guess.
+ * mpn/configure.in: Likewise. Add x86/mmx path component as
+ appropriate.
+ (athlon-*-*): Fix typo.
+
+ * config.guess: Update x86 recog code to initially match
+ more than just i386.
+ Call K6-2 and K6-III for "k62" and "k63" respectively.
+
+ * config.guess: Recognize x86 CPU types.
+ Update code for FreeBSD, NetBSD, OpenBSD, Linux.
+
+1999-12-08 Torbjorn Granlund <tege@swox.com>
+
+ * mpf/pow_ui.c: Avoid final squaring in loop.
+
+1999-12-07 Torbjorn Granlund <tege@swox.com>
+
+ * gmp-impl.h (udiv_qrnnd_preinv2gen): Prefix local variables with `_'.
+ (udiv_qrnnd_preinv2norm): Likewise.
+ From Kevin Ryde:
+ (HAVE_ALLOCA): #define also if defined (alloca).
+
+1999-12-04 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/tests/add_n.c: Set OPS from CLOCK.
+ * mpn/tests/sub_n.c: Likewise.
+ * mpn/tests/mul_1.c: Likewise.
+ * mpn/tests/addmul_1.c: Likewise.
+ * mpn/tests/submul_1.c: Likewise.
+
+ * mpn/tests/lshift.c: Update from add_n.c.
+ * mpn/tests/rshift.c: Likewise.
+
+1999-12-03 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/powerpc64/copy.S: New file.
+
+1999-12-02 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/sparc64/copy.s: New file.
+
+ * mpn/tests/copy.c: New file.
+
+ * mpn/configure.in: Recognize more Amd CPUs; Set special paths for
+ k7 CPU.
+
+ * configure.in: Recognize Amd x86 CPUs.
+
+ * mpz/fdiv_r_2exp.c: In rounding code, read in->_mp_size before
+ writing to res->_mp_size.
+
+ * mpn/powerpc64/*.S: Clean up assembly syntax, add function headers.
+ * mpn/powerpc64/gmp-mparam.h: (KARATSUBA_MUL_THRESHOLD): #define.
+ (KARATSUBA_SQR_THRESHOLD): #define.
+
+ * mpn/tests/add_n.c (main): Only print test number if TIMES==1
+ and not printing.
+ (main): Don't run reference code if NOCHECK.
+ * mpn/tests/sub_n.c: Likewise.
+ * mpn/tests/mul_1.c: Likewise.
+ * mpn/tests/addmul_1.c: Likewise.
+ * mpn/tests/submul_1.c: Likewise.
+
+ * mpn/tests/lshift.c: (main): Only print test number if TIMES==1
+ and not printing.
+ * mpn/tests/rshift.c: Likewise.
+
+1999-11-22 Torbjorn Granlund <tege@swox.com>
+
+ * gmp.h (mpz_init_set_str): Declare using __gmp_const.
+ (mpz_set_str): Likewise.
+ (mpf_init_set_str): Likewise.
+ (mpf_set_str): Likewise.
+ (mpn_set_str): Likewise.
+ (__gmp_0): Likewise.
+ (mpn_divrem): Remove separate declaration; it's defined later in
+ this file.
+
+ * gmp.h: Replace "defined (__STD__)' by (__STDC__-0) in
+ expressions involving more than one term, to handle Sun's compiler
+ that most helpfully sets __STDC__ to 0.
+ * gmp-impl.h: Likewise.
+ * longlong.h: Likewise.
+
+1999-11-21 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/sparc64/gmp-mparam.h (KARATSUBA_MUL_THRESHOLD): #define.
+ (KARATSUBA_SQR_THRESHOLD): #define.
+
+ * mpn/sparc64/lshift.s: Compensate stack references for odd stack ptr.
+ * mpn/sparc64/rshift.s: Likewise.
+
+ * mpn/sparc64/addmul_1.s: Propagate carry properly.
+ * mpn/sparc64/submul_1.s: Likewise.
+
+ * mpn/sparc64/sub_n.s: Rewrite.
+
+ * mpn/sparc64/sub_n.s: Get operand order for main subcc right
+ (before scrapping this code for new code).
+
+1999-11-20 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/sparc64/add_n.s: Rewrite.
+
+1999-11-17 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/x86/syntax.h (PROLOG): New #define.
+ (EPILOG): New #define.
+
+ * gmp.h (mpn_addsub_n): Declare.
+ * gmp.h (mpn_add_nc): Declare.
+ * gmp.h (mpn_sub_nc): Declare.
+ * mpn/powerpc64/addsub_n.S: New file.
+
+1999-11-17 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/alpha/gmp-mparam.h
+ (KARATSUBA_MUL_THRESHOLD): Only #define #ifndef.
+ (KARATSUBA_SQR_THRESHOLD): Likewise.
+
+1999-11-14 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/x86/mul_1.S: Unroll and optimize for P6 and K7.
+
+1999-11-09 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/x86/p6/gmp-mparam.h
+ (KARATSUBA_MUL_THRESHOLD): Only #define #ifndef.
+ (KARATSUBA_SQR_THRESHOLD): Likewise.
+
+1999-11-05 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/generic/addsub_n.c: New file.
+
+1999-11-02 Torbjorn Granlund <tege@swox.com>
+
+ * config.guess: Handle alpha:FreeBSD with alpha:NetBSD.
+
+ * configure.in (vax*-*-*): New case.
+ * config/mt-vax: New file.
+ * mpn/vax/add_n.s: Rewrite.
+ * mpn/vax/sub_n.s: Rewrite.
+
+1999-10-31 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/vax/rshift.s: New file.
+ * mpn/vax/lshift.s: New file.
+
+1999-10-29 Torbjorn Granlund <tege@swox.com>
+
+ * config.sub: Handle k5 and k6.
+ * mpn/configure.in: Recognize k6.
+
+ * mpf/tests/t-get_d.c (LOW_BOUND, HIGH_BOUND): New #defines.
+ (main): Tighten error bounds to 14 digits.
+
+ * longlong.h (default umul_ppmm, when smul_ppmm exists):
+ Rename __m0 => __xm0, __m1 => __xm1.
+ (default smul_ppmm): Likewise.
+
+1999-10-11 Torbjorn Granlund <tege@swox.com>
+
+ * config.guess: Reverse the test for POWER vs PowerPC.
+ * config.guess (sun4m:SunOS:5.*:*): New case.
+ * config.guess (sun4u:SunOS:5.*:*): New case.
+
+1999-09-29 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/generic/divrem_2.c: Clean up comments.
+
+1999-09-23 Torbjorn Granlund <tege@swox.com>
+
+ * mpz/tests/Makefile.in: Use move-if-change when generating binaries.
+ * mpf/tests/Makefile.in: Likewise.
+ * mpq/tests/Makefile.in: Likewise.
+ * mpz/tests/move-if-change: New file.
+ * mpf/tests/move-if-change: New file.
+ * mpq/tests/move-if-change: New file.
+
+ * gmp.h (mpn_incr_u): New macro (from mpn/generic/mul_n.c).
+ (mpn_decr_u): New macro.
+
+ * mpn/generic/mul_n.c (mpn_incr): Delete.
+ * mpn/generic/mul_n.c: Update usages mpn_incr => mpn_incr_u.
+ * mpn/generic/divrem_newt.c: Use mpn_incr_u and mpn_decr_u instead of
+ mpn_add_1 and mpn_sub_1.
+ * mpn/generic/sqrtrem.c: Likewise.
+ * mpz/cdiv_q_ui.c: Likewise.
+ * mpz/cdiv_qr_ui.c: Likewise.
+ * mpz/fdiv_q_ui.c: Likewise.
+ * mpz/fdiv_qr_ui.c: Likewise.
+
+ * mpn/generic/sqrtrem.c: Start single-limb Newton iteration from 18
+ bits.
+
+1999-07-27 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/generic/divrem_1.c (__gmpn_divrem_1n): New function.
+
+ * mpn/generic/divrem_2.c: New file, code from divrem.c, `case 2:'.
+ * mpn/Makefile.in: Compile divrem_2.c.
+ * make.bat: Compile divrem_2.c.
+ * mpn/configure.in (functions): Add divrem_2.
+ * gmp.h: Declare mpn_divrem_2.
+
+ * mpn/generic/divrem.c: Delete special cases, handle just divisors
+ of more than 2 limbs.
+ * gmp.h (mpn_divrem): Call mpn_divrem_1, mpn_divrem_2, as appropriate.
+
+ * mpn/generic/divrem.c: Rework variable usage for better register
+ allocation.
+
+1999-07-26 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/alpha/ev5/add_n.s: Rewrite for better ev6 speed.
+ * mpn/alpha/ev5/sub_n.s: Likewise.
+
+1999-07-21 Torbjorn Granlund <tege@swox.com>
+
+ * longlong.h (alpha): Define umul_ppmm for cc.
+
+ * gmp-impl.h (DItype, UDItype): Define for non-gcc if _LONGLONG is
+ defined.
+
+1999-07-15 Torbjorn Granlund <tege@swox.com>
+
+ * longlong.h (powerpc64 count_leading_zeros): Fix typo.
+ (powerpc64 add_ssaaaa): Fix typos.
+ (powerpc64 sub_ddmmss): Fix typos.
+
+1999-07-14 Torbjorn Granlund <tege@swox.com>
+
+ * mpz/tests/Makefile.in: Pass XCFLAGS when linking.
+ * mpf/tests/Makefile.in: Likewise.
+ * mpq/tests/Makefile.in: Likewise.
+ * mpn/Makefile.in (.S.o): Pass XCFLAGS.
+
+ * longlong.h: Add support for 64-bit PowerPC.
+ * config.sub: Handle "powerpc64".
+ * configure.in: Likewise.
+ * mpn/configure.in: Suppress use of config/t-ppc-aix for now,
+ it seems compiler passes proper options.
+ * mpn/powerpc64/*.S: New files.
+
+ * Makefile.in (FLAGS_TO_PASS): Pass "AR=$(AR)".
+
+1999-07-07 Torbjorn Granlund <tege@swox.com>
+
+ * demos/pexpr.c (factor): Change alloca call to a malloc/free pair.
+
+ * mpn/powerpc32/syntax.h: Add #define's for crN.
+
+ * gmp.h (gmp_rand_algorithm): Remove spurious `,'.
+
+1999-07-05 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/generic/divrem_1.c: Normalize divisor when needed.
+
+1999-07-02 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/configure.in (powerpc*-apple-mach): New configuration.
+ * mpn/powerpc32/*: Add support for apple-macho syntax.
+ * mpn/powerpc32/syntax.h: New file.
+ * gmp-impl.h: Don't use `__attribute__' syntax for Apple's perversion
+ of GCC.
+
+1999-05-26 Linus Nordberg <linus@swox.se>
+
+ * rand.c (gmp_rand_init): Fix typo.
+
+ * mpn/generic/rawrandom.c (mpn_rawrandom): Count bits, not limbs,
+ to keep track of how many rounds to do in loop. Clean up
+ temporary allocation. Update `seedsize' inside loop. Mask off
+ the correct number of bits from final result. Init `mcopyp' even
+ when not normalizing `m'.
+
+ * randlc.c (gmp_rand_init_lc): Fix typo (don't call
+ mpz_init_set_ui()).
+
+ * mpn/generic/rawrandom.c (mpn_rawrandom): Set SIZ(s->seed) when
+ reallocating.
+
+ * tests/rand/Makefile (test, bigtest): Add 33-bit tests.
+
+ * tests/rand/gen.c (main): Set precision of variable passed to
+ mpf_urandomb(). Add option `-p'.
+
+1999-05-25 Linus Nordberg <linus@swox.se>
+
+ * randcm.c: Remove.
+ * randcmui.c: Remove.
+ * Makefile.in: Remove randcm and randcmui.
+ * make.bat: Ditto.
+ * gmp-impl.h: Remove prototypes for __gmp_rand_init_common() and
+ __gmp_rand_init_common_ui().
+ * randlc.c (gmp_rand_init_lc): Don't call
+ __gmp_rand_init_common().
+
+ * randlcui.c (gmp_rand_init_lc_ui): Don't call
+ __gmp_rand_init_common_ui().
+
+ * gmp.h (__gmp_rand_state_struct): Remove unused member `maxval'.
+ * randclr.c (gmp_rand_clear): Remove reference to s->maxval.
+ * randcm.c (__gmp_rand_init_common): Ditto
+
+ * mpn/generic/rawrandom.c (mpn_rawrandom): Don't calculate nlimbs
+ twice.
+
+ * gmp.h (__gmp_rand_dist): Remove.
+
+1999-05-24 Linus Nordberg <linus@swox.se>
+
+ * mpn/generic/rawrandom.c: Clean up comments.
+
+ * gmp.texi: Add documentation for random number generation.
+
+1999-05-21 Linus Nordberg <linus@swox.se>
+
+ * gmp.h: Typedef `gmp_rand_state' as an array with one element.
+ Change prototypes accordingly.
+ * gmp-impl.h: Change prototypes using `gmp_rand_state'.
+ * rand.c (gmp_rand_init): Take `gmp_rand_state' as argument
+ instead of a pointer to a `gmp_rand_state'.
+ * mpf/urandom.c (mpf_urandomb): Ditto.
+ * mpz/urandom.c (mpz_urandomb): Ditto.
+ * mpn/generic/rawrandom.c (mpn_rawrandom): Ditto.
+ * randcmui.c (__gmp_rand_init_common_ui): Ditto.
+ * randlc.c (gmp_rand_init_lc): Ditto.
+ * randlcui.c (gmp_rand_init_lc_ui): Ditto.
+ * randui.c (gmp_rand_init_ui): Ditto.
+ * randcm.c (__gmp_rand_init_common): Ditto.
+ * randclr.c (gmp_rand_clear): Ditto.
+
+ * tests/rand/gen.c (main): Pass `s' to rand-funcs instead of address
+ of `s'.
+
+1999-05-20 Linus Nordberg <linus@swox.se>
+
+ * Makefile.in: Rename randi.c --> rand.c, randi_lc.c --> randlc.c,
+ randicom.c --> randcm.c. Add randui.c, randcmui.c, randlcui.c.
+ * make.bat: Ditto.
+
+ * gmp.h: Add prototypes for gmp_rand_init_ui() and
+ gmp_rand_init_lc_ui().
+ * gmp-impl.h: Add prototypes for __gmp_rand_init_common() and
+ __gmp_rand_init_common_ui().
+
+ * randlc.c, randcm.c, randclr.c, rand.c: Change #include of
+ <gmp.h> to "gmp.h".
+ * randclr.c: Include stdlib.h for free().
+ * rand.c: Include gmp-impl.h.
+
+1999-05-12 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/configure.in: Put generic m68k alternative last.
+
+1999-05-04 Torbjorn Granlund <tege@swox.com>
+
+ * demos/pexpr.c (setup_error_handler): Use sigemptyset to create
+ empty set (for portability).
+ (fns): Fix typo '#if #if'.
+ (mpz_eval_expr): Implement FERMAT and MERSENNE.
+
+ * demos/pexpr.c: Cast longjmp argument via long to silent warnings on
+ 64-bit hosts.
+
+1999-05-03 Torbjorn Granlund <tege@swox.com>
+
+ * demos/pexpr.c: Add #defines for GMP 1.x and 2.0 compatibility.
+
+ * demos/pexpr.c (setup_error_handler): New function; take signal
+ handler setup code from main(), with major modifications to use modern
+ signal interface.
+ (main): Remove signal handler setup code; call setup_error_handler.
+
+1999-04-29 Linus Nordberg <linus@swox.se>
+
+ * tests/rand/findcl.c (main): Add option '-i' for interval factor.
+ Separate v and merit lose figures. Add '-v' for version.
+
+1999-04-28 Linus Nordberg <linus@swox.se>
+
+ * tests/rand/statlib.c: Change debugging stuff.
+
+ * tests/rand/gmpstat.h: Add debug values definitions.
+
+ * tests/rand/findcl.c (main): Print low and high merit on startup.
+ Print version string on startup. Catch SEGV and HUP. Add option -d
+ for debug. Fix bug making test for v too hard.
+ (sh_status): New function.
+ (sh_status): Flush stdout. Add RCSID.
+
+1999-04-27 Linus Nordberg <linus@swox.se>
+
+ * tests/rand/Makefile (clean): Add target.
+
+1999-04-27 Linus Nordberg <linus.nordberg@canit.se>
+
+ * tests/rand/stat.c: Include gmpstat.h.
+ Add global int g_debug.
+
+ * tests/rand/spect.c: Include <unistd.h>.
+
+ * tests/rand/findcl.c (main): Input is `m', not all factors of `m'.
+ Print only the very first matching multiplier. Include <unistd.h>.
+ Flush stdout. Print "done." when done.
+
+ * tests/rand/spect.c: Move everything but main() to statlib.c.
+
+ * tests/rand/findcl.c: New file.
+
+ * tests/rand/gmpstat.h: New file.
+
+ * tests/rand/statlib.c (merit, merit_u, f_floor, vz_dot,
+ spectral_test): New functions.
+
+1999-04-27 Torbjorn Granlund <tege@swox.com>
+
+ * mpn/configure.in: Fix typo, "sparc-*)" was "sparc)".
+
+1999-04-21 Torbjorn Granlund <tege@swox.com>
+
+ * config.sub: Recognize ev6.
+
+1999-04-12 Linus Nordberg <linus.nordberg@canit.se>
+
+ * urandom.c: Split up into randclr.c, randi.c, randi_lc.c,
+ randicom.c.
+ * randclr.c, randi.c, randi_lc.c, randicom.c: New files.
+ * Makefile.in: Remove urandom. Add randclr, randi, randi_lc,
+ randicom.
+ * make.bat: Ditto
+
+1999-03-31 Torbjorn Granlund <tege@matematik.su.se>
+
+ * configure.in (sparc9-*-solaris2.[789]*, etc): New alternative.
+ * mpn/configure.in: Use mt-sprc9 also for ultrasparc*-*-solaris2*.
+
+1999-03-30 Linus Nordberg <linus.nordberg@canit.se>
+
+ * urandom.c (__gmp_rand_scheme): Change NULL->0.
+ Include "gmp.h" instead of <gmp.h>.
+
+1999-03-29 Linus Nordberg <linus.nordberg@canit.se>
+
+ * gmp.h (__gmp_rand_data_lc): Now holds a, c, m instead of scheme
+ struct.
+ (__gmp_rand_lc_scheme_struct): Remove mpz_t's `a' and `m'.
+
+ * tests/rand/stat.c (f_freq): Don't print 2nd level results if doing
+ 1st level.
+
+ * tests/rand/gen.c (main): Set default algorithm to mpz_urandomb.
+ (main): Add option -c.
+
+1999-03-24 Linus Nordberg <linus.nordberg@canit.se>
+
+ * tests/rand/Makefile (GMPINC): Rename to GMPH.
+ (GMPH): Add gmp-mparam.h.
+ (CFLAGS): Add -I$(GMPLIBDIR)/mpn
+
+1999-03-23 Linus Nordberg <linus.nordberg@canit.se>
+
+ * Makefile.in: Compile top-dir/urandom.c.
+ * make.bat: Ditto.
+
+ * mpn/Makefile.in: Compile rawrandom.c.
+ * make.bat: Ditto.
+
+ * mpn/configure.in (functions): Add rawrandom.
+
+ * gmp.h (__gmp_rand_scheme_struct): Rename to
+ __gmp_rand_lc_scheme_struct.
+ (__gmp_rand_data_lc): Remove member 'n'. Allocate a
+ __gmp_rand_lc_scheme_struct instead of a pointer to one.
+ Add prototype for gmp_rand_init_lc(), mpn_rawrandom().
+ New prototype for mpz_urandomb().
+
+ * urandom.c: New file.
+ (__gmp_rand_init_common): New function.
+ (gmp_rand_init_lc): New function.
+ (gmp_rand_init): Don't init data_lc->n. Call gmp_rand_init_lc()
+ and __gmp_rand_init_common().
+ (gmp_rand_clear): Remove reference to data_lc->n.
+
+ * mpz/urandom.c (gmp_rand_init, gmp_rand_clear): Move to new file
+ urandom.c in top-dir.
+ (mpz_urandomb): Add function parameter nbits. Call mpn_rawrandom().
+
+ * mpf/urandom.c (mpf_urandomb): Call mpn_rawrandom().
+
+ * mpn/generic/rawrandom.c: New file.
+ (mpn_rawrandom): New function.
+
+1999-03-17 Torbjorn Granlund <tege@matematik.su.se>
+
+ * extract-dbl.c: When packing result, adjust exp when sc == 0.
+
+ * mpf/tests/t-get_d.c: New file.
+ * mpf/tests/Makefile.in: Compile t-get_d.c.
+
+1999-03-16 Linus Nordberg <linus.nordberg@canit.se>
+
+ * mpz/urandom.c (__gmp_rand_scheme): Add extra braces around the
+ mpz_t members.
+
+ * make.bat: Compile mpz/urandom.c and mpf/urandom.c
+
+ * tests/rand/statlib.c (ks_table): Use mpf_pow_ui() and exp().
+
+ * tests/rand/gen.c: Include unistd.h for getopt.
+
+1999-03-15 Linus Nordberg <linus.nordberg@canit.se>
+
+ * mpz/urandom.c (gmp_rand_init): New function.
+ (gmp_rand_clear): New function.
+ (mpz_urandomb): New function.
+
+ * mpz/Makefile.in: Compile urandom.c
+
+ * mpf/urandom.c (mpf_urandomb): New function.
+
+ * mpf/Makefile.in: Compile urandom.c.
+
+ * gmp.h (__gmp_rand_state_struct, __gmp_rand_scheme_struct): New
+ structs for randomization functions.
+ (gmp_rand_dist, gmp_rand_alogrithm): New enums for randomization
+ functions.
+ (mpz_urandomb, mpf_urandomb): Add prototype.
+ (gmp_rand_init, gmp_rand_clear): Add prototype.
+
+ * tests/rand/gen.c, stat.c, statlib.c, statlib.h: New files.
+ * tests/rand/Makefile, tests/rand/ChangeLog: New files.
+
+1999-03-15 Torbjorn Granlund <tege@matematik.su.se>
+
+ * .gdbinit: New file.
+
+ * mpz/dump.c: New file.
+ * mpz/Makefile.in: Compile dump.c.
+ * make.bat: Likewise.
+ * gmp.h (mpz_dump): Declare.
+
+1999-03-14 Torbjorn Granlund <tege@matematik.su.se>
+
+ * mpz/tests/reuse.c: Also test mpz_invert and mpz_divexact.
+
+ * mpz/tests/convert.c: Update to GMP 2 variable syntax.
+
+1999-03-13 Torbjorn Granlund <tege@matematik.su.se>
+
+ * mpf/README: New file.
+ * mpz/README: New file.
+
+ * mpf/pow_ui.c: New file.
+ * mpf/Makefile.in: Compile pow_ui.c.
+ * make.bat: Likewise.
+ * gmp.h (mpf_pow_ui): Declare.
+
+1999-03-12 Torbjorn Granlund <tege@matematik.su.se>
+
+ * mpn/configure.in: Stage 1 of rewrite.
+ * mpn/underscore.h: New name for bsd.h.
+ * mpn/sysv.h: Deleted.
+
+ * mpn/m68k/*: Don't include sysdep.h.
+
+ * mpn/pa64/README: New file.
+
+1999-03-11 Torbjorn Granlund <tege@matematik.su.se>
+
+ * mpn/powerpc32/add_n.S: Add support for both AIX and ELF syntax.
+ Renamed from `.s'.
+ * mpn/powerpc32/sub_n.S: Likewise.
+ * mpn/powerpc32/lshift.S: Likewise.
+ * mpn/powerpc32/rshift.S: Likewise.
+ * mpn/powerpc32/mul_1.S: Likewise.
+ * mpn/powerpc32/addmul_1.S: Likewise.
+ * mpn/powerpc32/submul_1.S: Likewise.
+
+ * mpn/powerpc32/umul.S: New file.
+ * mpn/sparc32/v8/umul.S: New file.
+ * mpn/sparc32/umul.S: New file.
+ * mpn/x86/umul.S: New file.
+ * mpn/x86/udiv.S: New file.
+
+ * mpn/Makefile.in (mul_basecase.o): Delete rule.
+
+1999-02-22 Torbjorn Granlund <tege@matematik.su.se>
+
+ * configure.in (hppa2.0*-*-*): Force use of GCC.
+
+ * extract-dbl.c: Handle IEEE denormalized numbrs. Clean up.
+
+1998-12-02 Torbjorn Granlund <tege@matematik.su.se>
+
+ * mpn/Makefile.in (CCAS): New macro.
+ (.s.o): Use CCAS.
+ (.S.o): Likewise.
+
+ * mpn/Makefile.in (mul_basecase.o): Add dependency.
+ (sqr_basecase.o): Likewise.
+ (mod_1.o): Likewise.
+
+ * demos/pexpr.c (cputime): Test also __hpux.
+ (cleanup_and_exit): Check SIGXCPU only #ifdef LIMIT_RESOURCE_USAGE.
+
+ * mpz/tests/t-2exp.c: Use urandom, not random.
+
+ * mpn/configure.in (arm*-*-*): New alternative.
+
+1998-11-30 Torbjorn Granlund <tege@matematik.su.se>
+
+ * gmp-impl.h (union ieee_double_extract): Special case for
+ little-endian arm.
+ (LIMBS): Alias for PTR.
+
+1998-11-26 Torbjorn Granlund <tege@matematik.su.se>
+
+ * longlong.h (m68000 umul_ppmm): Use `muluw', not `mulu'.
+ (m68k stuff): Clean up; add coldfire support.
+
+1998-11-23 Torbjorn Granlund <tege@matematik.su.se>
+
+ * mpn/mips3/gmp-mparam.h (KARATSUBA_MUL_THRESHOLD): #define.
+ (KARATSUBA_SQR_THRESHOLD): #define.
+
+ * mpn/sparc32/v9/README: New file.
+
+1998-11-20 Torbjorn Granlund <tege@matematik.su.se>
+
+ * mpn/x86/README: New file.
+
+ * mpn/arm/gmp-mparam.h: New file.
+ * mpn/pa64/gmp-mparam.h: New file.
+ * mpn/hppa/gmp-mparam.h: New file.
+ * mpn/x86/pentium/gmp-mparam.h: New file.
+ * mpn/sparc32/v9/gmp-mparam.h: New file.
+ * mpn/powerpc32/gmp-mparam.h: New file.
+ * mpn/x86/p6/gmp-mparam.h: New file.
+
+ * mpn/alpha/gmp-mparam.h (KARATSUBA_MUL_THRESHOLD): #define.
+ (KARATSUBA_SQR_THRESHOLD): #define.
+
+ * mpn/configure.in: Point to x86/p6 when appropriate.
+
+ * mpn/power/umul.s: New file.
+ * mpn/power/sdiv.s: New file.
+ * mpn/pa64/addmul_1.S: New file.
+ * mpn/pa64/submul_1.S: New file.
+ * mpn/pa64/mul_1.S: New file.
+ * mpn/pa64/udiv_qrnnd.c: New file.
+ * mpn/pa64/umul_ppmm.S: New file.
+ * mpn/mips2/umul.s: New file.
+ * mpn/m68k/mc68020/umul.s: New file.
+ * mpn/m68k/mc68020/udiv.s: New file.
+ * mpn/hppa/hppa1_1/umul.s: New file.
+ * mpn/alpha/umul.s: New file.
+ * mpn/a29k/udiv.s: New file.
+ * mpn/a29k/umul.s: New file.
+
+1998-11-17 Torbjorn Granlund <tege@matematik.su.se>
+
+ * mpn/x86/mul_basecase.S: New file for non-pentiums.
+ * mpn/x86/mul_basecase.S: Move to mpn/x86/pentium.
+
+1998-11-16 Torbjorn Granlund <tege@matematik.su.se>
+
+ * make.bat: Compile mul_basecase.c and sqr_basecase.c.
+
+1998-11-10 Torbjorn Granlund <tege@matematik.su.se>
+
+ * mpz/invert.c: Defer writing to parameter `invert' until
+ end.
+
+1998-11-03 Torbjorn Granlund <tege@matematik.su.se>
+
+ * mpn/pa64/udiv_qrnnd.c: Handle more border cases.
+
+1998-10-29 Torbjorn Granlund <tege@matematik.su.se>
+
+ * insert-dbl.c: Special case biased exponents < 1; Get boundary for
+ Inf right.
+
+ * longlong.h (COUNT_LEADING_ZEROS_NEED_CLZ_TAB): New #define.
+
+1998-10-28 Torbjorn Granlund <tege@matematik.su.se>
+
+ * mpn/powerpc32/submul_1.s: Rewrite, optimizing for PPC604.
+ * mpn/powerpc32/addmul_1.s: Likewise.
+ * mpn/powerpc32/lshift.s: Likewise.
+
+1998-10-23 Torbjorn Granlund <tege@matematik.su.se>
+
+ * config/mt-sprc9-gcc (XCFLAGS): Add -Wa,-xarch=v8plus.
+
+ * mpn/sparc32/v9/submul_1.s: New file.
+
+1998-10-21 Torbjorn Granlund <tege@matematik.su.se>
+
+ * mpn/config/mt-pa2hpux: New file.
+ * mpn/configure.in (hppa2.0*-*-*): Use new 64-bit code.
+
+ * config.sub: Recognize hppa2.0 as CPU type.
+
+ * longlong.h (64-bit hppa): Add umul_ppmm and udiv_qrnnd.
+ * mpn/pa64/mul_1.S: New file.
+ * mpn/pa64/addmul_1.S: New file.
+ * mpn/pa64/submul_1.S: New file.
+ * mpn/pa64/umul_ppmm.S: New file.
+ * mpn/pa64/udiv_qrnnd.c: New file.
+
+1998-10-20 Torbjorn Granlund <tege@matematik.su.se>
+
+ * mpz/pprime_p.c: Pass 1L, not 1, to mpz_cmp_ui.
+
+ * mpz/fdiv_q_2exp.c: Cast `long' argument to `mp_limb_t' for mpn calls.
+ * mpz/gcd_ui.c: Likewise.
+ * mpz/add_ui.c: Likewise.
+ * mpz/sub_ui.c: Likewise.
+
+1998-10-19 Torbjorn Granlund <tege@matematik.su.se>
+
+ * mpn/generic/bdivmod.c: Avoid using switch statement with mp_limb_t
+ index.
+
+1998-10-17 Torbjorn Granlund <tege@matematik.su.se>
+
+ * mpn/sparc32/v9/mul_1.s: Misc cleanups.
+ * mpn/sparc32/v9/addmul_1.s: Misc cleanups.
+
+1998-10-16 Torbjorn Granlund <tege@matematik.su.se>
+
+ * mpn/tests/{add,sub,}mul_1.c: Print xlimb using mpn_print.
+
+ * mpz/tests/t-powm.c (SIZE): Increase to 50.
+ (EXP_SIZE): New parameter; use it for computing exp_size.
+
+1998-10-15 Torbjorn Granlund <tege@matematik.su.se>
+
+ * mpn/generic/divrem_newt.c: Use TMP_ALLOC interface.
+
+ * mpn/generic/sqrtrem.c: Check BITS_PER_MP_LIMB before defining
+ assembly variants of SQRT.
+
+1998-10-14 Torbjorn Granlund <tege@matematik.su.se>
+
+ * mpn/tests: Clean up timing routines. Don't include longlong.h
+ where it is not needed.
+ (mpn_print): Handle printing when _LONG_LONG_LIMB.
+ * mpn/tests/{add,sub,}mul_1.c: Generate xlimb with mpn_random2
+ and do it whether TIMES != 1 or not.
+
+ * mpn/generic/mul_n.c: Delay assignment of `sign' for lower
+ register pressure.
+
+ * mpn/sparc32/v9/mul_1.s: New file.
+
+ * config/mt-sprc9-gcc: New file.
+ * configure.in: Use it.
+
+ * mpn/configure.in: Use sparc64 for Solaris 2.7 and later with a
+ sparc v9 CPU.
+ * mpn/configure.in: Use sparc32/v9 for Solaris 2.6 or earlier with
+ a sparc v9 CPU.
+
+ * mpf/sub.c: In initial code for ediff == 0, limit precision
+ before jumping to `normalize'.
+
+1998-10-13 Torbjorn Granlund <tege@matematik.su.se>
+
+ * mpn/hppa/hppa2_0/add_n.s: New file.
+ * mpn/hppa/hppa2_0/sub_n.s: New file.
+ * mpn/configure.in: Handle hppa2.0 (32-bit code for now).
+
+ * config.guess: Update from egcs 1.1.
+ (9000/[3478]??:HP-UX:*:*): Properly return 2.0 for all known 2.0
+ machines.
+
+1998-10-07 Torbjorn Granlund <tege@matematik.su.se>
+
+ * mpz/root.c (mpz_root): New file.
+ * mpz/Makefile.in: Compile it.
+ * make.bat: Likewise.
+ * gmp.h (mpz_root): Declare.
+
+ * mpz/perfpow.c: New file.
+ * mpz/Makefile.in: Compile it.
+ * make.bat: Likewise.
+ * gmp.h (mpz_perfect_power_p): Declare.
+
+ * mpz/remove.c: New file.
+ * mpz/Makefile.in: Compile it.
+ * make.bat: Likewise.
+ * gmp.h (mpz_remove): Declare.
+
+ * mpz/bin_ui.c: New file.
+ * mpz/Makefile.in: Compile it.
+ * make.bat: Likewise.
+ * gmp.h (mpz_bin_ui): Declare.
+
+ * mpz/bin_uiui.c: New file.
+ * mpz/Makefile.in: Compile it.
+ * make.bat: Likewise.
+ * gmp.h (mpz_bin_uiui): Declare.
+
+1998-09-16 Torbjorn Granlund <tege@matematik.su.se>
+
+ * longlong.h: Test for __powerpc__ in addition to _ARCH_PPC.
+
+Sat Sep 5 17:22:28 1998 Torbjorn Granlund <tege@matematik.su.se>
+
+ * mpf/cmp_si.c: Compare most significant mantissa limb before
+ trying to deduce anything from the limb count.
+ * mpf/cmp_ui.c: Likewise.
+
+Tue Aug 18 10:24:39 1998 Torbjorn Granlund <tege@matematik.su.se>
+
+ * mpz/pprime_p.c (mpz_probab_prime_p): Add new code block
+ for doing more dividing.
+
+Sat Aug 15 18:43:17 1998 Torbjorn Granlund <tege@matematik.su.se>
+
+ * mpn/generic/divrem_newt.c: New name for divrem_newton.c.
+ * mpn/Makefile.in: Corresponding changes.
+ * mpn/configure.in: Likewise.
+
+Wed Aug 12 23:07:09 1998 Torbjorn Granlund <tege@matematik.su.se>
+
+ * config.guess: Handle powerpc for NetBSD.
+
+Tue Jul 28 23:10:55 1998 Torbjorn Granlund <tege@matematik.su.se>
+
+ * mpz/fib_ui.c: New file.
+ * mpz/Makefile.in: Compile it.
+ * make.bat: Likewise.
+ * gmp.h (mpz_fib_ui): Declare.
+
+Wed Jun 17 22:52:58 1998 Torbjorn Granlund <tege@matematik.su.se>
+
+ * make.bat: Fix typo, `asm-synt.h' => `asm-syntax.h'.
+
+Wed Jun 3 11:27:32 1998 Torbjorn Granlund <tege@matematik.su.se>
+
+ * config/mt-pwr: New file.
+ * config/mt-ppc: New file.
+ * configure.in: Use the new files.
+
+Tue Jun 2 13:04:17 1998 Torbjorn Granlund <tege@matematik.su.se>
+
+ * mpn/sparc32/v9/addmul_1.s: New file.
+ * mpn/config/mt-sprc9: New file.
+ * mpn/configure.in: Use mt-sprc9.
+
+Tue May 26 11:24:18 1998 Torbjorn Granlund <tege@matematik.su.se>
+
+ * demos/factorize.c (factor_using_pollard_rho): Pass correct
+ parameters in recursive calls; join the two recursion arms.
+
+ * mpf/set_q.c: Set result sign.
+ When normalizing the numerator, don't allow it to increase in size
+ beyond prec.
+
+Tue May 19 17:28:14 1998 Torbjorn Granlund <tege@matematik.su.se>
+
+ * demos/factorize.c (factor_using_division): Call fflush
+ also for the factor 2.
+
+Mon May 18 15:51:01 1998 Torbjorn Granlund <tege@matematik.su.se>
+
+ * make.bat: Pass -fomit-frame-pointer. Do not pass -g.
+
+Tue May 5 01:42:50 1998 Torbjorn Granlund <tege@matematik.su.se>
+
+ * mpz/Makefile.in (LOCAL_CC): Remove definition.
+
+ * gmp.h: Get rid of GMP_SMALL stuff.
+ * mpz/Makefile.in: Likewise.
+ * mpq/Makefile.in: Likewise.
+ * mpf/Makefile.in: Likewise.
+
+ * mpz/invert.c: Fix typo in comment.
+
+Mon May 4 23:05:32 1998 Torbjorn Granlund <tege@matematik.su.se>
+
+ * mpn/generic/sqrtrem.c: Check that __arch64__ is not defined
+ before defining sparc SQRT.
+
+Mon Apr 20 19:16:17 1998 Torbjorn Granlund <tege@matematik.su.se>
+
+ * mpn/generic/gcdext.c: Allow gp to be NULL.
+
+1998-04-03 Torbjorn Granlund <tege@matematik.su.se>
+
+ * mpn/configure.in: Recognize `alphaev5*', not `alphaev5'.
+
+ * config.guess: Handle CPU variants for NetBSD.
+
+Mon Mar 16 13:07:54 1998 Torbjorn Granlund <tege@matematik.su.se>
+
+ * mpz/pprime_p.c: Use mpn_mod_1/mpn_preinv_mod_1 for computing mod PP,
+ not mpz_tdiv_r_ui (which expects an `unsigned long').
+ (mpz_probab_prime_p): Change type of `r' to mp_limb_t.
+
+Thu Mar 12 17:19:04 1998 Torbjorn Granlund <tege@matematik.su.se>
+
+ * gmp.h (mpf_ceil, mpf_floor, mpf_trunc): Add declarations.
+
+ * config.guess: Update from FSF version.
+ * config.sub: Likewise.
+
+ * config.guess: Add special handling of alpha-*-NetBSD.
+
+Wed Mar 11 00:55:34 1998 Torbjorn Granlund <tege@matematik.su.se>
+
+ * mpz/inp_str.c: Update from set_str.c.
+ Properly increment `nread' when skipping minus sign.
+
+ * mpz/set_str.c: Check for empty string after having skipped
+ leading zeros.
+
+Mon Mar 9 19:28:00 1998 Torbjorn Granlund <tege@matematik.su.se>
+
+ * mpz/set_str.c: Skip leading zeros.
+
+Wed Mar 4 19:29:16 1998 Torbjorn Granlund <tege@matematik.su.se>
+
+ * gmp.h (mpz_cmp_si): Cast argument before calling mpz_cmp_ui.
+
+ * demos/factorize.c: Rewrite.
+
+1998-02-04 Torbjorn Granlund <tege@matematik.su.se>
+
+ * configure.in (i[3456]86* etc): Check if using gcc before
+ choosing mt-x86.
+
+ * configure.in (m68*-*-*): New alternative.
+ * config/mt-m68k: New file.
+
+ * mpn/alpha/invert-limb.s: Put tables in text segment,
+ since not all systems support "rdata".
+
+Wed Feb 4 02:20:57 1998 Torbjorn Granlund <tege@matematik.su.se>
+
+ * gmp.h (__GNU_MP_VERSION_SNAP): New #define.
+ (__GNU_MP_VERSION_MINOR): Now 1.
+
+Wed Jan 28 22:29:36 1998 Torbjorn Granlund <tege@tunnis.tmg.se>
+
+ * longlong.h (alpha udiv_qrnnd): #define UDIV_NEEDS_NORMALIZATION.
+
+Wed Jan 28 20:28:19 1998 Torbjorn Granlund <tege@sophie.matematik.su.se>
+
+ * mpz/pprime_p.c (mpz_probab_prime_p): Delete 59 from tried divisors.
+
+Mon Jan 26 01:39:02 1998 Torbjorn Granlund <tege@tunnis.tmg.se>
+
+ * mpz/pprime_p.c (mpz_probab_prime_p): Major overhaul: Check small
+ numbers specifically; check small factors, then perform a fermat test.
+
+Tue Jan 13 14:58:28 1998 Torbjorn Granlund <tege@tunnis.tmg.se>
+
+ * longlong.h (alpha udiv_qrnnd): Call __mpn_invert_normalized_limb
+ and udiv_qrnnd_preinv.
+
+Wed Jan 7 01:52:54 1998 Torbjorn Granlund <tege@tunnis.tmg.se>
+
+ * mpn/configure.in (alpha*, extra_functions): Add invert-limb and
+ remove udiv_qrnnd.
+
+ * mpn/tests/divrem.c: Get allocations right.
+
+ * mpn/generic/divrem.c: Conditionally pre-invert most significant
+ divisor limb.
+
+Tue Jan 6 23:08:54 1998 Torbjorn Granlund <tege@tunnis.tmg.se>
+
+ * mpn/generic/divrem_1.c: Rename variables to comply to conventions.
+ Make `i' have type `mp_size_t'.
+
+Tue Dec 30 22:21:42 1997 Torbjorn Granlund <tege@matematik.su.se>
+
+ * mpz/tdiv_qr_ui.c: Return the remainder.
+ * mpz/tdiv_r_ui.c: Likewise.
+ * mpz/tdiv_q_ui.c: Likewise.
+ * gmp.h: Change return type of mpz_tdiv_qr_ui, mpz_tdiv_r_ui,
+ mpz_tdiv_q_ui.
+
+ * mpz/tdiv_ui.c: New file.
+ * mpz/Makefile.in: Compile it.
+ * make.bat: Likewise.
+ * gmp.h (mpz_tdiv_ui): Declare.
+
+Fri Nov 7 04:21:15 1997 Torbjorn Granlund <tege@matematik.su.se>
+
+ * mpf/integer.c (FUNC_NAME): Fix bogus test for mpf_trunc.
+
+ * demos/isprime.c: New file.
+
+ Sat Nov 1 19:32:25 1997 Torbjorn Granlund <tege@matematik.su.se>
+
+ * mpz/cmp_abs.c: New file.
+ * mpz/Makefile.in: Compile it.
+ * make.bat: Likewise.
+ * gmp.h (mpz_cmp_abs): Declare.
+
+ * mpz/cmp_abs_ui.c: New file.
+ * mpz/Makefile.in: Compile it.
+ * make.bat: Likewise.
+ * gmp.h (mpz_cmp_abs_ui): Declare.
+
+Sat Sep 27 04:49:52 1997 Torbjorn Granlund <tege@tunnis.tmg.se>
+
+ * mpz/fdiv_r_2exp.c: Get allocation for `tmp' right.
+
+ * mpz/fdiv_q_2exp.c: In final result adjustment code, handle
+ that intermediate result is zero.
+
+ * mpz/tests/t-2exp.c: New file.
+ * mpz/tests/Makefile.in: Handle t-2exp.c.
+
+Fri Sep 26 16:29:21 1997 Torbjorn Granlund <tege@tunnis.tmg.se>
+
+ * mpz/divexact.c: Fix typo in test for whether to copy numerator to
+ quotient and move that statement to after handling quotient and
+ denominator overlap. Misc cleanups.
+
+ * mpn/generic/gcd.c: Change count argument of mpn_lshift/mpn_rshift
+ calls to `unsigned int'.
+ * mpz/divexact.c: Likewise.
+
+Mon Sep 22 02:19:52 1997 Torbjorn Granlund <tege@pro.tmg.se>
+
+ * mpz/tests/t-powm.c: Decrease `reps' to 2500.
+
+ * mpz/tests/t-pow_ui.c: New file.
+ * mpz/tests/Makefile.in: Handle t-pow_ui.c.
+
+ * mpz/ui_pow_ui.c: Get special cases for exponent and base right.
+
+ * mpz/pow_ui.c: Increase temp space allocation by 1 limb.
+ Split `rsize' into two variables; compute space allocation into
+ `ralloc'.
+
+Sun Sep 7 04:15:12 1997 Torbjorn Granlund <tege@pro.tmg.se>
+
+ * mpn/pa64/lshift.s: New file.
+ * mpn/pa64/rshift.s: New file.
+ * mpn/pa64/sub_n.s: New file.
+
+Sat Sep 6 19:14:13 1997 Torbjorn Granlund <tege@gmp.tmg.se>
+
+ * mpn/pa64/add_n.s: New file.
+ * mpn/pa64: New directory.
+
+Tue Aug 19 16:17:09 1997 Torbjorn Granlund <tege@pro.tmg.se>
+
+ * mpz/swap.c: New file.
+ * mpz/Makefile.in: Compile it.
+ * make.bat: Likewise.
+ * gmp.h (mpz_swap): Declare.
+
+ * mpn/generic/mul_n.c: Push assignment of x and y pointers into the
+ if/else clauses in several places. (Decreases register pressure.)
+
+Mon Aug 18 03:29:50 1997 Torbjorn Granlund <tege@pro.tmg.se>
+
+ * mpn/thumb/add_n.s: New file.
+ * mpn/thumb/sub_n.s: New file.
+ * mpn/arm/add_n.s: New file.
+ * mpn/arm/sub_n.s: New file.
+
+ * mpz/powm.c: After mpn_mul_n and mpn_mul calls, adjust product size
+ if most significant limb is zero.
+ * mpz/powm_ui.c: Likewise.
+
+Fri Aug 15 02:13:57 1997 Torbjorn Granlund <tege@pro.tmg.se>
+
+ * mpn/arm/m/mul_1.s: New file.
+ * mpn/arm/m/addmul_1.s: New file.
+
+ * mpn/powerpc32/mul_1.s: Rewrite.
+
+ * mpn/alpha/mul_1.s: Prefix labels with `.'.
+
+Mon Aug 11 02:37:16 1997 Torbjorn Granlund <tege@pro.tmg.se>
+
+ * mpn/powerpc32/add_n.s: Rewrite.
+ * mpn/powerpc32/sub_n.s: Rewrite.
+
+Sun Aug 10 17:07:15 1997 Torbjorn Granlund <tege@pro.tmg.se>
+
+ * mpn/powerpc32/addmul_1.s: Delete obsolete comments.
+ * mpn/powerpc32/submul_1.s: Likewise.
+
+Fri Jul 25 20:07:54 1997 Torbjorn Granlund <tege@pro.tmg.se>
+
+ * mpz/addmul_ui.c: New file.
+ * mpz/Makefile.in: Compile it.
+ * make.bat: Likewise.
+ * gmp.h (mpz_addmul_ui): Declare.
+
+ * mpz/setbit.c: Add missing code after final `else'.
+
+Tue Jul 22 17:45:01 1997 Torbjorn Granlund <tege@tunnis.tmg.se>
+
+ * mpn/sh/add_n.s: Fix typo.
+ * mpn/sh/sub_n.s: Likewise.
+
+ * longlong.h (ns32k count_trailing_zeros): Fix typo.
+
+ * insert-dbl.c: Check for exponent overflow and return Inf.
+
+ * mpz/get_d.c: Rewrite to avoid rounding errors.
+
+Thu May 29 11:51:07 1997 Torbjorn Granlund <tege@pro.tmg.se>
+
+ * mpq/add.c: Swap some usages of tmp1 and tmp2 to make sure
+ their allocation suffices.
+ * mpq/sub.c: Likewise.
+
+Wed Apr 16 02:24:25 1997 Torbjorn Granlund <tege@pro.tmg.se>
+
+ * demos/pexpr.c: New file.
+
+ * mpn/generic/mul_n.c: Misc optimizations from Robert Harley.
+
+ * gmp-impl.h (MPZ_PROVOKE_REALLOC): New #define.
+
+Sat Apr 12 17:54:04 1997 Torbjorn Granlund <tege@pro.tmg.se>
+
+ * mpz/tstbit.c: New file.
+ * mpz/Makefile.in: Compile it.
+ * make.bat: Likewise.
+ * gmp.h (mpz_tstbit): Declare.
+
+ * mpz/tests/logic.c: Use MPZ_CHECK_FORMAT.
+ * mpz/tests/bit.c: New test.
+ * mpz/tests/Makefile.in: Handle bit.c.
+
+ * mpz/ior.c: In -OP2,+OP1 case, normalize OP2 after call to mpn_sub_1.
+
+ * gmp-impl.h (MPZ_CHECK_FORMAT): New #define.
+
+Thu Apr 10 00:30:14 1997 Torbjorn Granlund <tege@tmg.se>
+
+ * longlong.h (POWER/PowerPC): Test _ARCH_PWR instead of _IBMR2.
+
+Wed Apr 9 18:23:31 1997 Torbjorn Granlund <tege@pro.tmg.se>
+
+ * gmp-impl.h: Move defaulting of UMUL_TIME and UDIV_TIME from here...
+ * longlong.h: ...to here.
+
+Sun Mar 30 12:16:23 1997 Torbjorn Granlund <tege@matematik.su.se>
+
+ * mpn/generic/next_prime.c: New file.
+
+ * mpn/generic/perfsqr.c: Remove definitions of PP and PP_INVERTED.
+ * gmp-impl.h: Put them here.
+
+Fri Mar 28 08:18:05 1997 Torbjorn Granlund <tege@matematik.su.se>
+
+ * gmp-impl.h (MPN_COPY_INCR, MPN_COPY_DECR): Define as inline asm for
+ for x86, but leave disabled for now.
+
+Fri Feb 28 02:39:47 1997 Torbjorn Granlund <tege@matematik.su.se>
+
+ * mpn/Makefile.in (.S.o): Pass SFLAGS and CFLAGS also to compiler
+ for assembly phase.
+ (.s.o): Pass SFLAGS.
+
+Wed Feb 26 06:46:08 1997 Torbjorn Granlund <tege@matematik.su.se>
+
+ * mpn/configure.in: For Pentium Pro, use default code, not Pentium
+ optimized code.
+
+ * mpn/x86/addmul_1.S: Unroll and optimize for Pentium Pro.
+ * mpn/x86/submul_1.S: Likewise.
+
+Thu Feb 13 08:26:09 1997 Torbjorn Granlund <tege@matematik.su.se>
+
+ * mpf/Makefile.in: Compile floor.o, ceil.o and trunc.o (from
+ integer.c).
+ * make.bat: Likewise.
+
+Wed Feb 5 05:58:44 1997 Torbjorn Granlund <tege@matematik.su.se>
+
+ * mpn/configure.in (alpha*): Add cntlz to extra_functions.
+
+Wed Feb 4 03:30:45 1997 Torbjorn Granlund <tege@matematik.su.se>
+
+ * mpf/integer.c: New file (supporting mpf_floor, mpf_ceil, mpf_trunc).
+
+Mon Feb 3 14:21:36 1997 Torbjorn Granlund <tege@matematik.su.se>
+
+ * make.bat: Fix typo, set_dfl_prc => set_dfl_prec.
+
+Sun Feb 2 02:34:33 1997 Torbjorn Granlund <tege@matematik.su.se>
+
+ * mpf/out_str.c: After outputting `-', decrement n_digits.
+
+Wed Jan 8 02:50:20 1997 Torbjorn Granlund <tege@quiet.matematik.su.se>
+
+ * mpn/generic/divrem.c: qextra_limbs => qxn.
+
+Wed Dec 18 07:50:46 1996 Torbjorn Granlund <tege@quiet.matematik.su.se>
+
+ * mpz/tests/t-tdiv.c (SIZE): Increase to 200.
+
+Tue Dec 17 19:32:48 1996 Torbjorn Granlund <tege@quiet.matematik.su.se>
+
+ * mpn/generic/divrem.c (mpn_divrem_classic): New name for mpn_divrem.
+ * gmp.h (mpn_divrem): New function.
+ * mpn/generic/divrem_newton.c: New file.
+ * mpn/configure.in (functions): Add divrem_newton.
+ * make.bat: Likewise.
+
+Thu Dec 12 17:55:13 1996 Torbjorn Granlund <tege@quiet.matematik.su.se>
+
+ * gmp.h (_GMP_H_HAVE_FILE): Test also __dj_include_stdio_h_.
+
+Sat Dec 7 09:40:06 1996 Torbjorn Granlund <tege@quiet.matematik.su.se>
+
+ * mpn/alpha/invert-limb.s: New file.
+
+Thu Dec 5 01:25:31 1996 Torbjorn Granlund <tege@quiet.matematik.su.se>
+
+ * mpz/ui_pow_ui.c (mpz_pow2): New (static) function.
+ (mpz_ui_pow_ui): Rewrite.
+
+ * make.bat: `pre_mod_1.c' => `pre_mod_.c'. Fix typo in path to
+ gmp-mpar.h.
+
+Fri Nov 15 00:49:55 1996 Torbjorn Granlund <tege@quiet.matematik.su.se>
+
+ * mpz/ui_pow_ui.c: Rewrite for better speed.
+
+Fri Nov 1 16:36:56 1996 Torbjorn Granlund <tege@quiet.matematik.su.se>
+
+ * Makefile.in (recursive make rules): Use `&&' instead of `;' as
+ delimiter.
+
+Fri Oct 25 17:12:36 1996 Torbjorn Granlund <tege@quiet.matematik.su.se>
+
+ * gmp-impl.h (Cray/uxp MPN_COPY): Really declare as inline.
+
+Thu Oct 24 15:08:19 1996 Torbjorn Granlund <tege@quiet.matematik.su.se>
+
+ * mpn/fujitsu/rshift.c: Fix typo in loop boundaries.
+
+Fri Oct 18 03:13:54 1996 Torbjorn Granlund <tege@quiet.matematik.su.se>
+
+ * mpn/configure.in: Recognize `nextstep' for m68k variants; likewise
+ for x86 variants.
+
+ * mpn/x86/syntax.h (INSND): New macro.
+ * mpn/x86/[lr]shift.S: Use INSND.
+ * mpn/x86/pentium/[lr]shift.S: Likewise.
+ * mpn/config/t-oldgas (SFLAGS): Pass -DOLD_GAS.
+
+ * gmp-impl.h: In code for determining endianness, test also
+ __BIG_ENDIAN__ and __hppa__. Remove test of __NeXT__.
+
+Wed Oct 16 03:50:34 1996 Torbjorn Granlund <tege@quiet.matematik.su.se>
+
+ * mpf/set_str.c: Let `prec' determine precision used in
+ exponentiation code; decrease allocation accordingly.
+
+ * mpn/vax: Change `jsob*' to `sob*' in all files.
+
+Tue Oct 15 03:54:06 1996 Torbjorn Granlund <tege@quiet.matematik.su.se>
+
+ * longlong.h (m88110 udiv_qrnnd): Change type of intermediate quotient
+ to DImode (divu.d generates a 64-bit quotient).
+
+ * configure.in (m88110*): Fix typo.
+
+ * mpf/get_str.c: Compute exp_in_base using `double' to avoid overflow.
+
+ * gmp-impl.h (struct bases): Change type of chars_per_bit_exactly from
+ float to double.
+ * mpn/mp_bases.c (__mp_bases): Give 17 digits for chars_per_bit_exactly
+ field.
+
+ * mpf/get_str.c: Let `prec' determine precision used in
+ exponentiation code; decrease allocation accordingly.
+
+Sun Oct 13 03:31:53 1996 Torbjorn Granlund <tege@quiet.matematik.su.se>
+
+ * longlong.h: Major cleanup.
+ (__udiv_qrnnd_c): Compute remainders using multiply and subtract,
+ not explicit `%' operator.
+ (C umul_ppmm): Get rid of a redundant __ll_lowpart.
+
+ * mpz/invert.c: Properly detect all operands that would yield an
+ undefined inverse; make sure the inverse is always positive.
+
+ * mpz/xor.c: New file.
+ * mpz/Makefile.in: Compile it.
+ * make.bat: Likewise.
+ * gmp.h (mpz_xor): Declare.
+
+ * mpz/tests/logic.c: Also test mpz_xor.
+
+ * mpz/lcm.c: Special case for when either operand equals 0.
+
+Sat Oct 12 01:57:09 1996 Torbjorn Granlund <tege@quiet.matematik.su.se>
+
+ * mpn/generic/gcd.c (find_a): Don't inline on x86.
+
+ * Makefile.in (CFLAGS): Default to just `-g'.
+
+ * configure.in: Recognize 386 and 486 wherever other x86 cpus are
+ recognized.
+ * configure.in: Use mt-x86 for all x86 cpus.
+ * config/mt-x86: New file.
+
+ * mpn/alpha/cntlz.s: New file.
+
+Tue Oct 8 00:16:18 1996 Torbjorn Granlund <tege@quiet.matematik.su.se>
+
+ * longlong.h: Define smul_ppmm for Fujitsu vpp/uxp.
+ Rewrite umul_ppmm to actually work on the hardware.
+
+ * mpn/x86/sub_n.S: Avoid parens around displacement of `leal'.
+ * mpn/x86/add_n.S: Likewise.
+
+ * mpn/x86/syntax.h (R): Define differently depending on __STDC__.
+
+Mon Oct 7 16:48:08 1996 Torbjorn Granlund <tege@quiet.matematik.su.se>
+
+ * longlong.h: Don't test for __NeXT__ in outer 68k conditional;
+ add test for __m68k__.
+
+Sun Oct 6 00:59:09 1996 Torbjorn Granlund <tege@quiet.matematik.su.se>
+
+ * gmp.h: Declare mpn_random.
+ * make.bat: Compile mpn/generic/random.c.
+
+ * longlong.h: Define umul_ppmm for Fujitsu vpp/uxp.
+
+ * gmp-impl.h: Protect definitions using `__attribute__ ((mode (...)))'
+ with test also for __GNUC_MINOR__.
+
+ * gmp.h: Don't define macros using __builtin_constant_p when using
+ NeXT's compiler.
+
+Fri Oct 4 16:53:50 1996 Torbjorn Granlund <tege@quiet.matematik.su.se>
+
+ * mpz/lcm.c: New file.
+ * mpz/Makefile.in: Compile it.
+ * make.bat: Likewise.
+ * gmp.h (mpz_lcm): Declare.
+
+Wed Sep 25 00:06:21 1996 Torbjorn Granlund <tege@quiet.matematik.su.se>
+
+ * mpq/tests/t-cmp_ui.c: Make sure numerator and denominator of `b' is
+ within limits of an `unsigned long int'.
+
+ * mpz/tests/t-powm_ui.c: Change type of exp2 to `unsigned long int'.
+
+Tue Sep 24 18:58:20 1996 Torbjorn Granlund <tege@quiet.matematik.su.se>
+
+ * mpz/powm_ui.c: Make result always positive.
+
+ * urandom.h (urandom): Make it return mp_limb_t.
+
+ * gmp-impl.h (CNST_LIMB): New macro.
+ * mpn/mp_bases.c: Use CNST_LIMB.
+ * mpn/generic/hamdist.c (popc_limb): Likewise.
+ * mpn/generic/popcount.c (popc_limb): Likewise.
+ * mpn/generic/perfsqr.c: Likewise.
+
+Fri Sep 20 03:08:10 1996 Torbjorn Granlund <tege@quiet.matematik.su.se>
+
+ * mpz/pprime_p.c: When n <= 3, don't clear out n before using it.
+
+Wed Sep 18 11:22:45 1996 Torbjorn Granlund <tege@quiet.matematik.su.se>
+
+ * mpn/fujitsu/mul_1.c: New file.
+ * mpn/fujitsu/addmul_1.c: New file.
+ * mpn/fujitsu/sub_n.c: New file.
+ * mpn/fujitsu/add_n.c: Mew file.
+
+Sun Sep 15 03:13:02 1996 Torbjorn Granlund <tege@quiet.matematik.su.se>
+
+ * mpn/generic/random.c: New file.
+ * mpn/configure.in (functions): Add `random'.
+
+ * gmp-impl.h (MPN_COPY): Define as annotated inline function for
+ Crays and Fujitsu VPPs.
+
+ * gmp.h (mp_size_t): Define as `int' for non-MPP Cray.
+ (mp_exp_t): Likewise.
+
+ * configure.in: Add support for Fujitsu VPP machines.
+ * mpn/configure.in: Likewise.
+ * config.guess: Likewise.
+ * config.sub: Likewise.
+
+ * mpn/fujitsu/rshift.c: New file.
+ * mpn/fujitsu/lshift.c: New file.
+ * mpn/fujitsu: New directory, for Fujitsu VPP machines.
+
+Wed Sep 11 11:34:38 1996 Torbjorn Granlund <tege@quiet.matematik.su.se>
+
+ * mpn/generic/mul_n.c (__gmpn_mul_n): New name for impn_mul_n.
+ Call __gmpn_mul_basecase, not impn_mul_n_basecase; update parameter
+ list to work with __gmpn_mul_basecase.
+ (__gmpn_sqr): New name for impn_sqr_n.
+ Call __gmpn_sqr_basecase, not impn_sqr_n_basecase; update parameter
+ list to work with __gmpn_sqr_basecase.
+ (mpn_mul_n): Update calls to match new names and parameter conventions.
+ * gmp-impl.h (MPN_MUL_N_RECURSE): Likewise.
+ (MPN_SQR_RECURSE): New name for MPN_SQR_N_RECURSE.
+ Update calls to match new names and parameter conventions.
+ * mpn/generic/mul.c: Never perform multiply explicitly here, call
+ __gmpn_mul_basecase instead.
+ Update calls to match new names and parameter conventions.
+
+ * mpn/x86/mul_basecase.S: New file.
+ * mpn/generic/mul_basecase.c: New file.
+ * mpn/generic/sqr_basecase.c: New file.
+
+Wed Sep 4 02:59:21 1996 Torbjorn Granlund <tege@quiet.matematik.su.se>
+
+ * mpz/set_str.c: Let `0b' and `0B' mean base 2.
+
+Fri Aug 30 00:44:00 1996 Torbjorn Granlund <tege@quiet.matematik.su.se>
+
+ * longlong.h (x86 umul_ppmm): Work around GCC bug that was
+ triggered by Aug 28 change.
+
+ * mpbsd/min.c (digit_value_in_base): New function.
+
+ * mpz/set_str.c: Refine allocation size computation, use
+ chars_per_bit_exactly instead of chars_per_limb.
+
+ * mpbsd/Makefile.in (.c.o): Add -D_mpz_realloc=_mp_realloc.
+
+Wed Aug 28 02:52:14 1996 Torbjorn Granlund <tege@quiet.matematik.su.se>
+
+ * longlong.h (x86 umul_ppmm): Don't cast result operands.
+ (x86 udiv_qrnnd): Likewise.
+ (default smul_ppmm): Fix typo, umul_ppmm => smul_ppmm.
+ (default umul_ppmm): New #define using smul_ppmm.
+ (vax smul_ppmm): New #define.
+ (vax umul_ppmm): Delete.
+ (POWER umul_ppmm): Delete.
+ (IBM 370 smul_ppmm): New #define.
+ (IBM 370 umul_ppmm): Delete.
+ (IBM RT/ROMP smul_ppmm): New #define.
+ (IBM RT/ROMP umul_ppmm): Delete.
+
+Tue Aug 27 01:03:25 1996 Torbjorn Granlund <tege@quiet.matematik.su.se>
+
+ * gmp-impl.h (__gmp_0): Make it `const'.
+
+ * mpn/Makefile.in (clean mostlyclean): Comment out recursive clean
+ of `tests'.
+
+ * mpn/generic/mul.c: Identify when we do squaring, and call
+ impn_sqr_n_basecase/impn_sqr_n as appropriate. Use
+ KARATSUBA_MUL_THRESHOLD and KARATSUBA_SQR_THRESHOLD.
+ Don't #define KARATSUBA_THRESHOLD.
+
+ * mpn/generic/mul_n.c: Don't #define KARATSUBA_THRESHOLD.
+ (impn_mul_n, impn_sqr_n): Rewrite, based on code contributed by
+ Robert Harley.
+ (impn_sqr_n_basecase): Rewrite.
+
+ * gmp-impl.h (KARATSUBA_MUL_THRESHOLD): New #define.
+ (KARATSUBA_SQR_THRESHOLD): Likewise.
+ (MPN_SQR_N_RECURSE): Use KARATSUBA_SQR_THRESHOLD.
+ (MPN_MUL_N_RECURSE): Use KARATSUBA_MUL_THRESHOLD.
+
+ * configure.in: Fix typo in last change.
+
+Mon Aug 26 22:25:18 1996 Torbjorn Granlund <tege@quiet.matematik.su.se>
+
+ * mpn/generic/random2.c: Fix typo, `alpha__' => `__alpha'.
+ * mpf/random2.c: Likewise.
+
+Sun Aug 25 00:07:09 1996 Torbjorn Granlund <tege@quiet.matematik.su.se>
+
+ * mpz/tests/t-mul.c: Also test squaring.
+
+Fri Aug 16 05:12:08 1996 Torbjorn Granlund <tege@noisy.matematik.su.se>
+
+ * mp_clz_tab.c (__clz_tab): Declare as `const'.
+ * version.c (gmp_version): Likewise.
+ * mpn/generic/sqrtrem.c (even_approx_tab, odd_approx_tab): Likewise.
+
+Thu Aug 15 02:34:47 1996 Torbjorn Granlund <tege@noisy.matematik.su.se>
+
+ * gmp.h: Fix typo, `mips__' => `__mips'.
+
+ * mpf/set_str.c: Allow a number to start with a period, if next
+ position contains a digit.
+
+Tue Aug 13 18:41:25 1996 Torbjorn Granlund <tege@noisy.matematik.su.se>
+
+ * mpz/gcdext.c: Get cofactor sign right for negative input operands.
+ Clean up code for computing tt.
+
+ * mpz/invert.c: Get rid of variable `rv'.
+
+ * mpz/divexact.c: Test for zero divisor in special case for zero
+ dividend.
+
+Mon Aug 12 18:04:07 1996 Torbjorn Granlund <tege@noisy.matematik.su.se>
+
+ * mpz/?div_*_ui.c: Special case for division by 0.
+ * mpz/tdiv_q.c: Likewise.
+
+Sat Aug 10 14:45:26 1996 Torbjorn Granlund <tege@noisy.matematik.su.se>
+
+ * mpz/dmincl.c: Special case for division by 0.
+
+ * mpz/tdiv_*_ui.c: Delete special case for dividend being 0; handle
+ it when computing size after mpn_divmod_1 call.
+
+ * mp_bpl.c: (__gmp_junk): New variable.
+ (__gmp_0): New constant.
+
+ * gmp-impl.h (DIVIDE_BY_ZERO): New #define.
+
+Fri Aug 9 20:03:27 1996 Torbjorn Granlund <tege@noisy.matematik.su.se>
+
+ * mpz/divexact.c: Test for dividend being zero before testing
+ for small divisors.
+
+Thu Aug 8 13:20:23 1996 Torbjorn Granlund <tege@noisy.matematik.su.se>
+
+ * configure.in: Require operating system specification for cpus
+ where assembly syntax differs between system.
+
+ * Makefile.in (many targets): Change `-' action prefix to `@'.
+
+ * mpn/Makefile.in: (distclean): Fix typo.
+
+ * mpq/cmp_ui.c: Rename function to _mpq_cmp_ui.
+ (mpq_cmp_ui): #undef deleted.
+ * mpz/cmp_si.c: Rename function to _mpz_cmp_si.
+ (mpz_cmp_si): #undef deleted.
+ * mpz/cmp_ui.c: Rename function to _mpz_cmp_ui.
+ (mpz_cmp_ui): #undef deleted.
+ * Makefile.in: Corresponding changes.
+
+ * mpf/get_prc.c: Return the *highest* precision achievable.
+
+ * mpf/get_str.c: Complete rewrite.
+
+ * mpf/set_str.c (swapptr): New #define.
+ (assert): New #define.
+ * mpf/set_str.c: Set prec to one more than the saved _mp_prec.
+ Misc cleanups.
+
+ * mpz/set_str.c: #include string.h.
+ * mpf/out_str.c: #include string.h.
+ * mpbsd/xtom.c: #include string.h and ctype.h.
+ * mpbsd/mout.c: #include string.h.
+
+Wed Aug 7 11:46:04 EDT 1996 Ken Weber <kweber@mcs.kent.edu>
+
+ * mpn/generic/gcd.c: Reorder mpn_gcd argument list.
+ * mpz/gcd.c: Change call to mpn_gcd.
+ * gmp.texi: Update manual entry on mpn_gcd.
+ * mpn/generic/bdivmod.c: Delete limb cache to make mpn_bdivmod
+ reentrant.
+
+Wed Aug 7 02:15:38 1996 Torbjorn Granlund <tege@noisy.matematik.su.se>
+
+ * mpf/get_str.c: Rewrite code for converting integral part of a
+ number with both an integral and fractional part.
+
+ * mpf/set_str.c: Get rid of variable xxx. New variables madj and radj.
+ In exp_in_base==0 case, add madj to msize for EXP field.
+
+ * mpz/tests/t-gcd.c: Test deleted. Rename t-gcd2.c to t-gcd.c.
+ Increase reps to 2000.
+ * mpz/tests/t-gcd2.c: Get rid of mpz_refgcd.
+
+ * mpf/set_str.c: Ignore excess limbs in MP,MSIZE.
+
+Thu Jul 25 04:39:10 1996 Torbjorn Granlund <tege@noisy.matematik.su.se>
+
+ * mpn/configure.in: Fix typo in setting path, "sparc" => "sparc32".
+
+Wed Jul 24 02:27:02 1996 Torbjorn Granlund <tege@noisy.matematik.su.se>
+
+ * mpn/generic/gcdext.c: Reorganize and clean up. Get rid of all
+ signed limb arithmetic.
+
+Mon Jul 22 02:39:56 1996 Torbjorn Granlund <tege@noisy.matematik.su.se>
+
+ * mpn/generic/gcdext.c (mpn_gcdext): For large enough operands,
+ work with most significant *two* limbs.
+ (div2): New function (two variants).
+ (THRESHOLD): New #define.
+
+ * mpz/gcdext.c: Fix typo in MPZ_TMP_INIT call.
+
+ * longlong.h (alpha UMUL_TIME): Now 30.
+ (alpha UDIV_TIME): Now 350.
+ (x86 UMUL_TIME): Now 10 (let Pentium decide).
+ (SuperSPARC UDIV_TIME): Override default.
+
+ * extract-dbl.c (MP_BASE_AS_DOUBLE): Don't redefine here.
+
+ * extract-dbl.c: New name for extract-double.c.
+ * insert-dbl.c: New name for insert-double.c.
+ * Makefile.in: Corresponding changes.
+ * make.bat: Likewise.
+
+ * mpz/Makefile.in (.c.o): Don't pass non-portable `-f' to cp.
+ * mpq/Makefile.in: Likewise.
+ * mpf/Makefile.in: Likewise.
+
+Sat Jul 20 01:35:18 1996 Torbjorn Granlund <tege@noisy.matematik.su.se>
+
+ * mpz/getlimbn.c: Take ABS of integer->_mp_size.
+
+ * mpz/divexact.c: Use mpn_divmod_1 if divisor is a single limb.
+
+Thu Jul 18 00:31:15 1996 Torbjorn Granlund <tege@noisy.matematik.su.se>
+
+ * mpn/generic/popcount.c (popc_limb): Use different masking trick
+ for first step (due to David Seal).
+ * mpn/generic/hamdist.c (popc_limb): Likewise.
+
+Wed Jul 17 23:21:48 1996 Torbjorn Granlund <tege@noisy.matematik.su.se>
+
+ * mpn/generic/divrem.c: In MPN_COPY_DECR call, copy dsize - 1 limbs.
+
+Sun Jul 14 17:47:46 1996 Torbjorn Granlund <tege@noisy.matematik.su.se>
+
+ * configure.in: Handle sparc9, sparc64, and ultrasparc like sparc8.
+
+Thu Jul 11 14:05:54 1996 J.T. Conklin <jtc@rtl.cygnus.com>
+
+ * longlong.h (mc680x0): Define umul_ppmm, udiv_qrnnd, sdiv_qrnnd
+ for the '020, '030, '040, and '332. Define count_leading_zeros
+ for the '020, '030, '040, and '060.
+
+Sun Jul 14 15:24:53 1996 Torbjorn Granlund <tege@noisy.matematik.su.se>
+
+ From Joe Keane:
+ * mpq/equal.c: Take ABS of num1_size before passing it to mpn_cmp.
+
+Fri Jul 12 17:11:17 1996 Torbjorn Granlund <tege@noisy.matematik.su.se>
+
+ * mpn/generic/sqrtrem.c (SQRT): New asm for x86, but leave it
+ disabled for now.
+
+ * mpn/generic/sqrtrem.c: Use MP_BASE_AS_DOUBLE.
+
+Wed Jul 10 03:17:45 1996 Torbjorn Granlund <tege@noisy.matematik.su.se>
+
+ * cre-mparam.c: Delete obsolete file.
+
+ * gmp.h: #define _LONG_LONG_LIMB if __mips && _ABIN32.
+ * longlong.h: Test __mips instead of __mips__.
+
+Sun Jul 7 23:19:13 1996 Torbjorn Granlund <tege@noisy.matematik.su.se>
+
+ * longlong.h (_PROTO): Define, unless already defined.
+ (alpha __udiv_qrnnd): Declare using _PROTO.
+ (hppa __udiv_qrnnd): Likewise.
+ (sparc __udiv_qrnnd): Likewise.
+
+Mon Jul 1 01:44:30 1996 Torbjorn Granlund <tege@noisy.matematik.su.se>
+
+ * config.guess: Update from master version; add Cray x90 handling.
+
+Wed Jun 26 05:35:02 1996 Torbjorn Granlund <tege@noisy.matematik.su.se>
+
+ * mpn/power/add_n.s (__mpn_add_n): Work around GAS bug.
+ * mpn/power/sub_n.s (__mpn_sub_n): Likewise.
+
+ * insert-double.c: Rework loop to avoid potential overflow.
+
+ * mpq/get_d.c: For vax, if qsize > N_QLIMBS, ignore excess limbs.
+
+ * mpq/tests/t-get_d.c (SIZE): Special case for vax.
+
+ * gmp.h (mpX_cmp_ui): #define also when ! __GNUC__.
+
+Mon Jun 24 17:13:21 1996 Torbjorn Granlund <tege@noisy.matematik.su.se>
+
+ * longlong.h (vax sdiv_qrnnd): Fix typo.
+
+Sat Jun 15 01:33:33 1996 Torbjorn Granlund <tege@noisy.matematik.su.se>
+
+ * gmp.h: Support `small' and `large' type and function variants,
+ controlled by GMP_SMALL.
+
+ * mpz/Makefile.in (.c.o): Compile each function twice, for small and
+ large variant.
+ (MPZS_OBJS): New variable.
+ (libmpz.a): Include MPZS_OBJS in archive.
+ * mpf/Makefile.in: Analogous changes.
+ * mpq/Makefile.in: Analogous changes.
+
+ * gmp.h: Prefix all functions with __gmp, to allow namespace-clean
+ internal calls.
+
+ * mp.h: Rip out __MP_SMALL__ stuff.
+ (__mpz_struct): mp_size_t => int.
+
+ * mpz/invert.c: #include "gmp-impl.h".
+ Use MPZ_TMP_INIT, not mpz_init.
+
+ * mpz/gcdext.c: Rewrite to call mpn_gcdext.
+
+Fri Jun 14 18:05:29 1996 Torbjorn Granlund <tege@noisy.matematik.su.se>
+
+ * mpn/generic/gcdext.c (s0size): New parameter.
+ * gmp.h (mpn_gcdext): Update prototype.
+
+ * mpn/generic/gcdext.c: Major rewrite.
+
+Mon Jun 10 00:14:27 1996 Torbjorn Granlund <tege@noisy.matematik.su.se>
+
+ * mpn/generic/dump.c: Add missing `else'.
+
+Fri Jun 7 03:35:12 1996 Torbjorn Granlund <tege@noisy.matematik.su.se>
+
+ * Makefile.in (gmp_toc.html): Pass -expandinfo to texi2html.
+
+Thu Jun 6 19:00:53 1996 Torbjorn Granlund <tege@noisy.matematik.su.se>
+
+ * Version 2.0.2 released.
+
+ * install.sh: New file.
+ * Makefile.in (INSTALL): Use install.sh.
+ (install-normal): New name for target `install'.
+ (install): New dummy target.
+
+ * mpz/pow_ui.c: Swap tests for (e == 0) and (bsize == 0).
+ * mpz/ui_pow_ui.c: Swap tests for (e == 0) and (blimb == 0).
+
+ * config/mt-linux (AR_FLAGS): New file.
+ * configure.in: Use config/mt-linux for all linux systems.
+
+Tue Jun 4 03:42:18 1996 Torbjorn Granlund <tege@noisy.matematik.su.se>
+
+ * Version 2.0.1 released.
+
+ * mpf/tests/ref.c: Cast result of TMP_ALLOC to the right pointer type.
+
+ * extract-double.c: Test _GMP_IEEE_FLOATS with #if, not plain if.
+
+ * insert-double.c: Don't #include stdlib.h.
+
+ * gmp-impl.h (union ieee_double_extract): Test sparc and __sparc.
+ Do not test __sparc__.
+
+ * mpf/reldiff.c: Change declaration to work around irix5 compiler bug.
+ * mpq/equal.c: Likewise.
+
+ * mpn/generic/gcd.c: Delete spurious comma at end of enumeration.
+
+ * mpn/generic/gcdext.c: Add K&R declaration syntax.
+ * stack-alloc.h: Likewise.
+ * insert-double.c: Likewise.
+ * extract-double.c: Likewise.
+ * mpf/tests/reuse.c: Likewise.
+ * mpz/tests/reuse.c: Likewise.
+ * mpf/tests/t-sub.c: Likewise.
+ * mpf/tests/t-add.c: Likewise.
+ * mpf/tests/t-muldiv.c: Likewise.
+ * mpf/tests/t-conv.c: Likewise.
+ * mpf/tests/ref.c: Likewise.
+
+ * mpn/config/t-oldgas: Renamed from t-freebsd.
+ * mpn/configure.in: Use t-oldgas for freebsd, netbsd, and some linux
+ configurations.
+
+ * mpn/powerpc32/mul_1.s: Really clear cy before entering loop.
+ * mpn/powerpc32/*.s: Fix power/powerpc syntax issues.
+
+ * mpn/config/t-ppc-aix: New file.
+ * mpn/configure.in: Use t-ppc-aix for powerpc like t-pwr-aix for power.
+
+Wed May 29 02:07:31 1996 Torbjorn Granlund <tege@noisy.matematik.su.se>
+
+ * gmp.h (mp_bits_per_limb): Change qualifier from `const' to
+ __gmp_const.
+
+ * gmp.h (mpf_init_set_str): Add `const' qualifier for 2nd parameter.
+ * mpf/iset_str.c: Likewise.
+
+Mon May 27 00:15:58 1996 Torbjorn Granlund <tege@noisy.matematik.su.se>
+
+ * gmp-impl.h: Declare __gmp_extract_double.
+
+ * mpz/set_q.c: Delete unused variables.
+
+ * gmp.h (mpq_equal): Declare.
+
+ * mpf/eq.c: mpf_cmp2 -> mpf_eq.
+
+Fri May 24 03:20:44 1996 Torbjorn Granlund <tege@noisy.matematik.su.se>
+
+ * mpz/iset_d.c: Don't include <math.h>.
+
+ * insert-double.c (__gmp_scale2): New name for scal2.
+ * mpz/get_d.c: Corresponding change.
+ * mpf/get_d.c: Likewise.
+ * mpq/get_d.c: Likewise.
+ * gmp-impl.h: Declare __gmp_scale2.
+
+ * mpn/generic/scan0.c: Clarify comment.
+
+ * mpz/set_q.c: New file.
+ * Makefile.in: Compile it.
+ * make.bat: Likewise.
+ * gmp.h: Declare mpz_set_q.
+
+ * insert-double.c: New file.
+ * Makefile.in: Compile it.
+ * make.bat: Likewise.
+
+ * mpz/get_d.c: New file.
+ * mpz/Makefile.in: Compile it.
+ * make.bat: Likewise.
+ * gmp.h: Declare mpz_get_d.
+
+ * mpf/get_d.c: New file.
+ * mpf/Makefile.in: Compile it.
+ * make.bat: Likewise.
+ * gmp.h: Declare mpf_get_d.
+
+ * make.bat: Compile things in alphabetical order.
+
+ * gmp-impl.h (MP_BASE_AS_DOUBLE): New #define.
+ (LIMBS_PER_DOUBLE): New #define.
+
+ * extract-double.c: New file.
+ * Makefile.in: Compile it.
+ * make.bat: Likewise.
+ * mpz/set_d.c: Rewrite to use __gmp_extract_double.
+ * mpf/set_d.c: Likewise.
+
+ * mpn/configure.in: Use t-pwr-aix also for aix 3.2.4 and up.
+
+Wed May 22 02:48:35 1996 Torbjorn Granlund <tege@noisy.matematik.su.se>
+
+ * gmp-impl.h: Rework code for defining ieee_double_extract.
+ (IEEE_DOUBLE_BIG_ENDIAN): Macro removed.
+ (_GMP_IEEE_FLOATS): New macro.
+ * mpn/vax/gmp-mparam.h: Delete.
+
+ * mpn/config/t-pwr-aix: New file.
+ * mpn/configure.in: Use t-pwr-aix for aix 4 and later.
+
+Mon May 20 16:30:31 1996 Torbjorn Granlund <tege@noisy.matematik.su.se>
+
+ * gmp.h: In code for setting _GMP_H_HAVE_FILE, test more symbols.
+
+ * mpf/tests/t-add.c (oo): Add some `l' printf modifiers.
+ * mpf/tests/t-sub.c (oo): Likewise.
+ * mpf/tests/t-conv.c (oo): Likewise.
+ * mpf/tests/t-sqrt.c (oo): Likewise.
+
+ * mpz/tests/t-mul.c (_mpn_mul_classic): Remove unused variables.
+
+ * mpn/{pyr,i960,clipper}/*.s: Add missing copyright headers.
+
+Fri May 17 02:24:43 1996 Torbjorn Granlund <tege@noisy.matematik.su.se>
+
+ * mpz/set_d.c: Call _mpz_realloc.
+
+ * mpq/set_z.c: New file.
+ * mpq/Makefile.in: Compile it.
+ * make.bat: Likewise.
+ * gmp.h: Declare mpq_set_z.
+
+ * mp?/Makefile.in (libmp?.a): Depend on Makefile, not Makefile.in.
+ * mpf/Makefile.in (test): Delete spurious target.
+ * mpq/Makefile.in (test): Likewise.
+
+ * mpf/out_str.c: Use `e' to separate exponent when base <= 10.
+
+ * mpn/configure.in: Treat ultrasparc just like sparc v8,
+ until 64-bit compilers are ready.
+
+ * mpf/set_d.c: Make it work for 64-bit machines.
+
+Thu May 16 20:53:57 1996 Torbjorn Granlund <tege@noisy.matematik.su.se>
+
+ * gmp-impl.h: Set IEEE_DOUBLE_BIG_ENDIAN to 0 for little-endian
+ machines.
+ * mpn/x86/gmp-mparam.h: Delete file.
+
+ * configure.in: Treat microsparc like sparc8.
+
+ * urandom.h: Test __alpha instead of __alpha__, since the former
+ is the standard symbol.
+ * mpn/generic/random2.c: Likewise.
+ * mpf/random2.c: Likewise.
+
+Tue May 14 13:42:39 1996 Torbjorn Granlund (tege@tiny.matematik.su.se)
+
+ * mpz/set_f.c: New file.
+ * mpz/Makefile.in: Compile it.
+ * gmp.h: Declare mpz_set_f.
+
+ * mpf/set_q.c: Simplify expression in rsize == nsize if-then-else arms.
+
+Tue May 14 13:03:07 1996 Torbjorn Granlund (tege@tiny.matematik.su.se)
+
+ * make.bat: Add all new files.
+
+Sun May 12 22:24:36 1996 Torbjorn Granlund <tege@noisy.matematik.su.se>
+
+ * mpf/set_z.c: New file.
+ * mpf/Makefile.in: Compile it.
+ * gmp.h: Declare mpf_set_z.
+
+Sat May 11 19:26:25 1996 Torbjorn Granlund <tege@noisy.matematik.su.se>
+
+ * gmp.h: Declare mpf_set_q.
+
+ * mpf/set_q.c: Compute prec-1 limbs in mpn_divrem call.
+
+Fri May 10 17:37:38 1996 Torbjorn Granlund <tege@noisy.matematik.su.se>
+
+ * mpf/set_q.c: New file.
+ * mpf/Makefile.in: Compile it.
+
+ * config.sub: Recognize sparc8.
+
+Wed May 8 09:19:11 1996 Torbjorn Granlund <tege@noisy.matematik.su.se>
+
+ * mpf/tests/t-dm2exp.c: New file.
+
+ * mpf/tests/t-add.c: Correct header comment.
+ * mpf/tests/t-sub.c: Likewise.
+ * mpf/tests/t-sqrt.c: Likewise.
+
+ * mpf/div.c: Misc variable name cleanups.
+ * mpf/div_ui.c: Base more closely on mpf/div.c.
+ * mpf/ui_div.c: Likewise.
+
+ * mpz/tests/Makefile.in (check): Depend on Makefile.
+ * mpq/tests/Makefile.in (check): Likewise.
+ * mpf/tests/Makefile.in (check): Likewise.
+
+ * mpf/tests/t-muldiv.c: New file.
+ * mpf/tests/Makefile.in: Compile and run `t-muldiv'.
+ (t-ref.o): Delete spurious rule.
+
+ * mpf/sqrt.c: Properly detect negative input operand.
+
+ * mpf/sqrt_ui.c: Delete spurious header comment.
+ * mpf/sqrt.c: Likewise.
+ * mpz/sqrt.c: Likewise.
+
+ * mpz/tests/reuse.c (main): Read `reps' from command line.
+
+ * mpf/tests/reuse.c: New file.
+ * mpf/tests/Makefile.in: Compile and run `reuse'.
+
+ * mpf/mul_ui.c: Disable code for removing low zero limbs.
+
+ * mpf/div.c: Fix condition for when vp and qp overlaps.
+
+ * mpf/add_ui.c: When sum equals u, copy up to prec+1 limbs.
+
+ * mpf/out_str.c: Don't output '\n' after exponent.
+
+ * mpf/add_ui.c: New special case for when U is completely cancelled.
+
+Wed Apr 24 05:33:28 1996 Torbjorn Granlund <tege@noisy.matematik.su.se>
+
+ * Version 2.0 released.
+
+ * All files: Update FSF's address.
+
+ * Makefile.in (gmp_toc.html): New name for gmp.html.
+ (TAGS): Depend on force.
+
+ * mpf/tests/t-conv.c: Pass -base to mpf_set_str.
+
+Sat Apr 20 03:54:06 1996 Torbjorn Granlund <tege@noisy.matematik.su.se>
+
+ * Makefile.in (ps): New target, depend on gmp.ps.
+
+Fri Apr 19 14:03:15 1996 Torbjorn Granlund <tege@noisy.matematik.su.se>
+
+ * mpf/out_str.c: Print `@' before exponent, not `e'.
+
+ * make.bat: Update from Makefiles.
+
+Thu Apr 18 01:22:05 1996 Torbjorn Granlund <tege@noisy.matematik.su.se>
+
+ * mpf/set_str.c: If parameter `base' is negative, expect exponent
+ to be decimal, otherwise in the same base as the mantissa.
+
+Wed Apr 17 17:28:36 1996 Torbjorn Granlund <tege@noisy.matematik.su.se>
+
+ * mpf/set_dfl_prec.c: Don't return anything.
+ * gmp.h: Corresponding changes.
+
+ * mpf/set_dfl_prec.c: Use `unsigned long int' for bit counts.
+ * mpf/init2.c: Likewise.
+ * mpf/get_prc.c: Likewise.
+ * mpf/set_prc.c: Likewise.
+ * mpf/set_prc_raw.c: Likewise.
+ * mpz/popcount.c: Likewise.
+ * mpz/hamdist.c: Likewise.
+ * mpz/scan1.c: Likewise.
+ * mpz/scan0.c: Likewise.
+ * mpn/generic/popcount.c: Likewise.
+ * mpn/generic/hamdist.c: Likewise.
+ * mpn/generic/scan1.c: Likewise.
+ * mpn/generic/scan0.c: Likewise.
+ * gmp.h: Likewise.
+
+ * mpf/eq.c: New file, based on mpf/diff.c.
+ * mpf/diff.c: Delete.
+ * mpf/Makefile.in: Corresponding changes.
+ * gmp.h: Likewise.
+
+ * mpf/reldiff.c: New file.
+ * mpf/Makefile.in: Compile it.
+ * gmp.h: Declare mpf_reldiff.
+
+ * mpz/iset_d.c: New file.
+ * mpz/Makefile.in: Compile it.
+ * gmp.h: Declare mpz_init_set_d.
+
+Tue Apr 16 16:28:31 1996 Torbjorn Granlund <tege@noisy.matematik.su.se>
+
+ * Makefile.in (gmp.html): Pass -acc to texi2html.
+
+Mon Apr 15 16:20:24 1996 Torbjorn Granlund <tege@noisy.matematik.su.se>
+
+ * mpf/set_str.c: Switch off code for defaulting the base from the
+ leading characters.
+
+ * gmp.h (mp?_sign): Delete.
+ (mp?_sgn): New macros.
+
+Fri Apr 12 17:23:33 1996 Torbjorn Granlund <tege@noisy.matematik.su.se>
+
+ * Makefile.in (gmp.dvi): Delete tmp.* at end of rule.
+
+Wed Apr 10 22:52:02 1996 Torbjorn Granlund (tege@tiny.matematik.su.se)
+
+ * mpf/random2.c: Change of `exp' param, mp_size_t => mp_exp_t.
+ * gmp.h: Corresponding change.
+
+ * gmp.h (mp_bits_per_limb): Make it const.
+
+Sat Mar 30 01:20:23 1996 Torbjorn Granlund <tege@noisy.matematik.su.se>
+
+ * configure.in: Re-enable recognition of with_gcc.
+
+ * mpf/Makefile.in (.c.o): Pass XCFLAGS.
+ * mpn/Makefile.in (.c.o): Likewise.
+ * mpz/Makefile.in (.c.o): Likewise.
+ * mpq/Makefile.in (.c.o): Likewise.
+ * mpbsd/Makefile.in (.c.o): Likewise.
+ * mpf/tests/Makefile.in (.c.o): Likewise.
+ * mpz/tests/Makefile.in (.c.o): Likewise.
+ * mpq/tests/Makefile.in (.c.o): Likewise.
+
+ * Makefile.in (XCFLAGS): Default to empty.
+ (FLAGS_TO_PASS): Pass on XCFLAGS.
+ (.c.o): Pass XCFLAGS.
+
+ * config/mt-m88110 (XCFLAGS): Define instead of CC.
+ * config/mt-sprc8-gcc (XCFLAGS): Likewise.
+ * config/mt-supspc-gcc (XCFLAGS): Likewise.
+
+ * configure: Don't default CC to "gcc -O2" is -with-gcc=no was
+ specified.
+
+Mon Mar 25 01:07:54 1996 Torbjorn Granlund <tege@noisy.matematik.su.se>
+
+ * urandom.h: Test for __SVR4 in addition to __svr4__.
+
+ * mp_bpl.c (mp_bits_per_limb): Declare as `const'.
+
+ * Makefile.in (CFLAGS): `-O2' => `-O'.
+ * mpn/Makefile.in (CFLAGS): Likewise.
+
+ * gmp-impl.h: Get rid of obsolete field access macros.
+
+ * mpn/mp_bases.c (__mp_bases): 1e39 => 1e38 to work around Solaris
+ cc compiler bug.
+
+ * gmp.h (__MPN): Make it work also for non-ANSI compilers.
+
+Thu Mar 21 01:07:54 1996 Torbjorn Granlund <tege@noisy.matematik.su.se>
+
+ * mpf/sub.c: New special case for ediff <= 1 before generic code.
+ Simplify generic code for ediff == 0.
+ Rename uexp => exp.
+
+Mon Mar 11 18:24:57 1996 Torbjorn Granlund <tege@noisy.matematik.su.se>
+
+ * mpf/tests/*.c: Use ref_mpf_sub for error calculation.
+ * mpf/tests/Makefile.in: Link ref.o to all executables.
+
+ * mpf/tests/t-sub.c: Make u = v + 1 with 50% probability.
+
+Sun Mar 10 21:03:17 1996 Torbjorn Granlund (tege@tiny.matematik.su.se)
+
+ * mpf/get_str.c: In digit development loop for fractions, change
+ loop condition from `<' to `<='.
+
+Thu Mar 7 04:58:11 1996 Torbjorn Granlund <tege@tiny.matematik.su.se>
+
+ * mpn/mp_bases.c (__mp_bases): 1e100 => 1e39 to avoid overflow warning.
+
+Wed Mar 6 01:10:42 1996 Torbjorn Granlund <tege@noisy.matematik.su.se>
+
+ * mpf/tests/t-sqrt.c: New file.
+ * mpf/tests/Makefile.in: Corresponding changes.
+
+ * mpf/sqrt.c: Special case for square root of zero.
+
+ * mpq/add.c: Clean up variable names.
+ * mpq/sub.c: Update from mpq/add.c.
+
+ * mpz/divexact.c: abs => ABS.
+ * mpz/gcd.c: Likewise. Rewrite final fixup code, to decrease
+ allocation. Misc cleanups.
+
+Tue Mar 5 22:24:56 1996 Torbjorn Granlund <tege@matematik.su.se>
+
+ * mpn/configure.in: Recognize linuxoldld as a synonym for linuxaout.
+
+ * gmp.h (mpn_add, mpn_add_1, mpn_sub, mpn_sub_1): Add prototypes.
+
+ * mpn/configure.in: Use t-freebsd also for netbsd.
+
+Mon Mar 4 15:13:28 1996 Torbjorn Granlund <tege@matematik.su.se>
+
+ * mpq/Makefile.in (cmp.o): Depend on longlong.h.
+
+ * mpq/equal.c: New file.
+ * mpq/Makefile.in: Corresponding changes.
+
+ * mpf/tests/t-add.c: New file.
+ * mpf/tests/t-sub.c: Renamed from t-addsub.c.
+ * mpf/tests/ref.c: New file.
+ * mpf/tests/Makefile.in: Corresponding changes.
+
+ * gmp-impl.h (SIZ, ABSIZ, PTR, EXP, PREC, ALLOC): New #defines.
+
+Sun Mar 3 07:45:46 1996 Torbjorn Granlund <tege@matematik.su.se>
+
+ * mpf/set_str.c: In exponentiation code, allocate 3 extra
+ limbs, not just 2.
+
+ * mpf/get_str.c: Allocate sufficient space for tstr.
+ When calculating exp_in_base, round result down.
+
+ * mpf/tests/t-conv.c: New file.
+ * mpf/tests/Makefile.in: Corresponding changes.
+
+ * mp_bpl.c: New file.
+ * gmp.h: Declare it.
+ * Makefile.in: Corresponding changes.
+
+Sat Mar 2 06:27:56 1996 Torbjorn Granlund <tege@matematik.su.se>
+
+ * mpf/set_prc_raw.c: New file.
+ * mpf/set_prc.c: Renamed from set_prec.c.
+ * mpf/get_prc.c: New file.
+ * mpf/Makefile.in: Corresponding changes.
+ * gmp.h: Declare new functions.
+
+ * mpn/generic/gcdext.c: Add copyright header.
+
+Fri Mar 1 01:22:24 1996 Torbjorn Granlund <tege@matematik.su.se>
+
+ * mpn/configure.in: For ppc601, search "power" before "powerpc32".
+
+ * mp?/Makefile.in (AR_FLAGS): New variable.
+ (libmp?.a): Use it.
+
+ * make.bat: New file.
+ * mpn/msdos: New directory.
+ * mpn/msdos/asm-syntax.h: New file.
+
+ * mpn/Makefile.in (distclean maintainer-clean): Delete asm-syntax.h.
+
+ * config.sub: Recognize [ctj]90-cray.
+
+ * mpn/configure.in: Recognize [ctj]90-cray-unicos*.
+
+ * mpn/generic/gcdext.c: Don't use alloca directly, use TMP_* macros.
+
+ * mpn/generic/gcd.c: Split increment from use of USIZE to avoid
+ undefined behaviour.
+
+Thu Feb 29 04:11:24 1996 Torbjorn Granlund <tege@matematik.su.se>
+
+ * Makefile.in (install-info-files): Update for new install-info
+ behaviour.
+
+ * mpn/power/add_n.s: Rewrite.
+ * mpn/power/sub_n.s: Rewrite.
+
+Wed Feb 28 01:34:30 1996 Torbjorn Granlund <tege@matematik.su.se>
+
+ * mpz/pow_ui.c: Compute allocation more aggressively for small bases.
+ * mpz/ui_pow_ui.c: Likewise.
+
+ * mpn/mp_bases.c (__mp_bases): Put huge value in 2nd field for index 1.
+
+ * mpn/generic/sqrtrem.c: sizeof (mp_limb_t) => BYTES_PER_MP_LIMB.
+ * mpn/generic/gcd.c: Likewise.
+ (SIGN_BIT): Compute differently.
+
+Mon Feb 26 00:07:36 1996 Torbjorn Granlund <tege@matematik.su.se>
+
+ * All files: mp_limb => mp_limb_t, mp_limb_signed => mp_limb_signed_t.
+
+ * Makefile.in (install, install-bsdmp, install-info-files): Depend
+ on installdirs. chmod all installed files.
+
+Sun Feb 25 01:47:41 1996 Torbjorn Granlund <tege@matematik.su.se>
+
+ * mpbsd/configure.in: Delete debugging code.
+
+ * All Makefile.in: Update clean targets.
+
+ * Makefile.in (AR_FLAGS): New variable.
+ (libgmp.a): Use it.
+ (libmp.a): Likewise.
+
+ * VERSION: Delete file.
+
+ * Makefile.in (installdirs): New target.
+ * mkinstalldirs: New file (from the texinfo package).
+
+ * Makefile.in (INSTALL, INSTALL_DATA, INSTALL_PROGRAM): New variables.
+ (MAKEINFO, MAKEINFOFLAGS, TEXI2DVI): New variables.
+ (install-info): New target.
+ (install, install-bsdmp): Depend on install-info.
+ ($(srcdir)/gmp.info): Changed from plain gmp.info; put info files
+ into source directory.
+ (distclean, mostlyclean): New targets.
+ (maintainer-clean): New name for realclean.
+ (uninstall): New target.
+ (TAGS): New target.
+ (info, dvi): New targets.
+ (.PHONY): Assign.
+
+ * Makefile.in (install, install-bsdmp): Use INSTALL_DATA.
+
+ * mp{n,z,f,bsd}/move-if-change: Delete.
+
+ * mpbsd/Makefile.in (stamp-stddefh): Delete target.
+
+ * Makefile.in (.c.o): Pass CFLAGS last.
+ * mpbsd/Makefile.in (.c.o): Likewise.
+ * mpf/Makefile.in (.c.o): Likewise.
+ * mpq/Makefile.in (.c.o): Likewise.
+ * mpz/Makefile.in (.c.o): Likewise.
+ * mpn/Makefile.in (.c.o): Likewise.
+ (.S.o): Likewise.
+
+ * memory.c: Change allocation error message.
+
+ * Makefile.in (install): Prefix gmp.h with $(srcdir).
+ (install-bsdmp): Prefix mp.h with $(srcdir).
+
+ * mp{n,z,f,bsd}/{configure,config.sub}: Delete.
+
+ * Makefile.in (gmp.dvi): Set TEXINPUTS also for 2nd tex invocation
+ (install targets): Install gmp.info-N.
+
+Sat Feb 24 03:36:52 1996 Torbjorn Granlund <tege@matematik.su.se>
+
+ * mpf/get_str.c: Fix typo.
+
+ * mpz/legendre.c: Clarify expression with extra parens.
+
+ * version.c (gmp_version): Not static.
+
+ * mpf/iset_str.c: Properly return error code.
+
+ * mpf/add.c: Delete unused variables.
+ * mpf/inp_str.c: Likewise.
+ * mpq/get_d.c: Likewise.
+
+ * mpn/generic/dump.c: #include <stdio.h>.
+ * mpf/dump.c: Likewise.
+ * mpf/set_str.c: #include <ctype.h>.
+ (strtol): Declare.
+
+ * gmp.h: mpn_sqrt => mpn_sqrtrem.
+
+ * Makefile.in (clean, realclean): Clean in mpbsd.
+ (check): Test in mpf.
+
+ * mpf/Makefile.in (clean): Clean in tests.
+ * mpq/Makefile.in (clean): Clean in tests.
+
+ * mpf/tests/Makefile.in: New file.
+ * mpf/tests/configure.in: New file.
+ * mpf/tests/t-addsub.c: New file.
+
+ * mpf/sub_ui.c: Simply call mpf_sub for now.
+
+ * mpf/sub.c: Increase prec by 1.
+ * mpf/ui_sub.c: Likewise.
+
+Fri Feb 23 00:59:54 1996 Torbjorn Granlund <tege@matematik.su.se>
+
+ * mpf/ui_sub.c: Fix typos.
+
+ * mpf/get_str.c: When allocating space for tmp, allow for an extra
+ limb. In code for fraction conversion, add special case for bases
+ that are a power of 2.
+
+ * mpf/out_str.c: Output leading "0.".
+ Default base to 10, before computing string allocation.
+
+ * mpf/get_str.c: Make variables for string size have type size_t.
+ * gmp.h: Corresponding change.
+
+ * mpf/random2.c: Allow creation of prec+1 large mantissas.
+
+ * mpf/add_ui.c: Don't abort if u < 0; special case for u <= 0.
+ Fix typo in MPN_COPY offset.
+ * mpf/sub_ui.c: Analogous changes.
+
+ * mpf/set_prec.c: Rewrite.
+
+ * mpf/init2.c: Compute precision as in set_prec.c.
+
+ * mpf/div_2exp.c: Special case for u == 0.
+ * mpf/mul_2exp.c: Likewise. Write r->_mp_size always.
+
+ * mpf/sqrt_ui.c: mpn_sqrt => mpn_sqrtrem.
+ * mpf/sqrt.c: Likewise. When computing new exponent, round quotient
+ towards -infinity.
+
+ * mpf/add.c: Fix typos.
+ * mpf/sub.c: Fix typos.
+
+Thu Feb 22 00:24:48 1996 Torbjorn Granlund <tege@matematik.su.se>
+
+ * mpz/Makefile.in (stamp-stddefh): Delete target.
+ (test): Delete target.
+ * Makefile.in (stamp-stddefh): Delete target.
+ (cre-stddefh.o): Delete target.
+ (gmp.dvi): Set TEXINPUTS before invoking tex.
+
+ * cre-stddefh.c: Delete.
+
+ * mpz/sqrt.c: Fix typo.
+
+ * mpz/powm.c: Special case for mod == 0.
+ * mpz/powm_ui.c: Likewise.
+
+ * mpz/get_si.c: Handle -0x80000000 correctly.
+
+ * mpz/inp_str.c: Now returns size_t.
+ Make it return number of bytes read or error indication.
+ * mpf/inp_str.c: Likewise.
+
+ * mpz/out_raw.c: Replace by mpz/out_binary.c, with modifications.
+ * mpz/inp_raw.c: Rewrite, using mpz/inp_binary as a base.
+ * mpz/inp_binary.c: Delete.
+
+ * mpn/Makefile.in (XCFLAGS): Remove variable.
+ (.c.o): Don't pass XCFLAGS.
+ (SFLAGS): Set to nothing.
+ (.S.o): Pass SFLAGS, not XCFLAGS.
+
+ * mpn/config/t-freebsd (SFLAGS): New name for XCFLAGS.
+
+ * mpf/out_str.c: Make return number of bytes written or error
+ indication.
+ * mpz/out_str.c: Likewise.
+ * gmp.h: Corresponding changes.
+
+ * gmp.h (__mpz_struct): mp_size_t => int.
+ (__mpq_struct): Likewise.
+ (__mpf_struct): Likewise.
+ (mp_size_t): int => long int.
+
+ * mpn/cray: New directory.
+ * mpn/cray/gmp-mparam.h: New file.
+ * mpn/configure.in: Recognize cray variants.
+
+ * Makefile.in: Set defaults for prefix, libdir, etc.
+ (install): New target.
+ (install-bsdmp): New target.
+ (gmp.html): New target.
+
+ * stack-alloc.c (__tmp_alloc): Cast void ptrs to char * in comparison.
+
+Wed Feb 21 04:35:02 1996 Torbjorn Granlund <tege@matematik.su.se>
+
+ * gmp.h: Sort mpn declarations.
+ (mpn_gcdext): Add declaration.
+
+ * mpn/generic/divrem_1.c: New file.
+ * mpn/Makefile.in (divrem_1.o): New rule.
+ * configure.in (functions): Add divrem_1.
+
+ * mpn/generic/divmod.c: Delete file.
+ * mpn/configure.in (functions): Delete divmod.
+ * Makefile.in (divmod.o): Delete rule.
+ * gmp.h (mpn_divmod): New #define.
+
+ * gmp.h (mpn_next_bit_set): Delete spurious declaration.
+
+ * mpn/generic/divrem.c (default case): In code assigning
+ most_significant_q_limb, move reassignment of n0 into if statement.
+
+ * gmp.h (mpf_inp_str): Fix typo.
+ (mpf_out_str): Make prototype match reality.
+ * mpf/inp_str.c: New file.
+ * mpf/out_str.c: New file.
+ * mpf/Makefile.in: Compile new files.
+
+ * mpn/Makefile.in (dump.o): Fix dependency path.
+ (inlines.o): Likewise.
+
+ * mpn/configure.in: Make m68060 be the same as m68000. Clean up
+ m68k configs.
+
+Tue Feb 20 01:35:11 1996 Torbjorn Granlund <tege@matematik.su.se>
+
+ * mpn/generic/sqrtrem.c: Renamed from sqrt.
+ * mpn/configure.in (functions): Corresponding change.
+ * mpn/Makefile.in: Likewise.
+ * mpz/sqrtrem.c: Likewise.
+ * mpz/sqrt.c: Likewise.
+ * mpn/generic/perfsqr.c: Likewise.
+
+ * Makefile.in (clean): Also remove libmp.a.
+ Don't compile cre-conv-tab.c or mp_bases.c.
+ cre-conv-tab.c: Delete file.
+ (gmp.ps): New rule.
+
+ * mpn/mp_bases.c: New file.
+ * mpn/Makefile.in: Compile mp_bases.c.
+
+ * mpz/set_str.c: Skip initial whitespace.
+ * mpf/set_str.c: Likewise.
+ * mpbsd/xtom.c: Likewise.
+
+ * gmp.h: Add missing mpz declarations.
+ Delete all formal parameter names from declarations.
+
+ * mpn/Makefile.in: Add dependencies for .c files.
+
+ * Makefile.in (check): Write recursive make calls separately, not as
+ a loop.
+ (FLAGS_TO_PASS): New variable. Use it for most recursive makes.
+
+Mon Feb 19 01:02:20 1996 Torbjorn Granlund <tege@matematik.su.se>
+
+ * mpn/Makefile.in (.S.o): Pipe cpp output to grep in order to delete
+ lines starting with #.
+ (CPP): Set to $(CC) -E to avoid gcc dependency.
+
+ * mpn/m68k/syntax.h (moveql): Define to moveq for MIT_SYNTAX.
+
+ * mpn/hppa/hppa1_1/pa7100/addmul_1.S: Fix typo in s1_ptr alignment
+ code.
+ * mpn/hppa/hppa1_1/pa7100/submul_1.S: Likewise.
+
+ * gmp.h: Fix typos in #defines of recently added mpn functions.
+
+ * mpz/inp_str.c: Skip all whitespace, not just plain space.
+ * mpbsd/min.c: Likewise.
+
+ * mpn/configure.in (functions): Add gcdext.
+ * mpn/generic/gcdext.c: New file.
+
+ * mpz/legendre.c: mpz_div_2exp => mpz_tdiv_q_2exp.
+
+ * gmp.h: Surround mpn declarations with extern "C" { ... }.
+
+ * Makefile.in (check): New target.
+
+ * mpq/get_d.c: Update comments. Use rsize instead of dsize + N_QLIMBS
+ when possible. Add special case for nsize == 0.
+
+ * gmp.h (mpq_get_d): Add declaration.
+ (mpq_canonicalize): Likewise.
+ (mpq_cmp_ui): Likewise.
+ (mpf_diff): Likewise.
+ (mpf_ui_sub): Likewise.
+ (mpf_set_prec): Likewise.
+ (mpf_random2): Likewise.
+
+ * gmp.h (mpz_cmp_ui): New #define.
+ (mpz_cmp_si): New #define.
+ (mpq_cmp_ui): New #define.
+ (mpz_sign): New #define.
+ (mpq_sign): New #define.
+ (mpf_sign): New #define.
+ (mpq_numref): New #define.
+ (mpq_denref): New #define.
+
+ * mpq/set_z.c: File deleted.
+ * mpq/Makefile.in: Corresponding changes.
+
+Sun Feb 18 01:34:47 1996 Torbjorn Granlund <tege@matematik.su.se>
+
+ * mpbsd/sdiv.c: Use _mp_realloc, not _mpz_realloc.
+
+ * mpz/inp_binary.c: Default stream to stdin.
+ * mpz/inp_str.c: Likewise.
+ * mpz/inp_raw.c: Likewise.
+ * mpz/out_binary.c: Default stream to stdout.
+ * mpz/out_raw.c: Likewise.
+ * mpz/out_str.c: Likewise.
+
+ * mpbsd/realloc.c: New file.
+ * mpbsd/Makefile.in: Corresponding changes.
+
+ * mpbsd/min.c: Rewrite (base on mpz/inp_str.c).
+ * mpbsd/mtox.c: Rewrite (base on mpz/get_str.c).
+
+ * mpbsd/mout.c: Rewrite (base on mpz/out_str) but make it output
+ spaces in each 10th position.
+ * mpbsd/xtom.c: Rewrite (base on mpz/set_str).
+
+ * mpq/tests/Makefile.in (st-cmp): New file.
+ * mpq/tests/configure.in (srcname): New file.
+
+ * mpz/tests/configure.in (srcname): Fix typo.
+
+ * mpq/cmp.c: Add check using number of significant bits, to avoid
+ general multiplication.
+
+Sat Feb 17 11:58:30 1996 Torbjorn Granlund <tege@matematik.su.se>
+
+ * mpq/cmp_ui.c: Store cy_limb after the mpn_mul_1 calls.
+
+ * mpq/tests: New directory.
+ * mpq/tests/t-cmp.c: New file.
+ * mpq/tests/t-cmp_ui.c: New file.
+
+ * mpz/tests/dive.c (main): Generate zero numerator.
+ (get_random_size) : Delete.
+
+ * mpz/divexact.c: Add special case for 0/x.
+
+ * gmp.h (mpz_mod): Add declaration.
+
+Fri Feb 16 18:18:39 1996 Andreas Schwab <schwab@informatik.uni-dortmund.de>
+
+ * mpn/m68k/*: Rewrite code not to use the INSN macros.
+ (L): New macro to properly prefix local labels for ELF.
+
+Fri Feb 16 00:20:56 1996 Torbjorn Granlund <tege@matematik.su.se>
+
+ * gmp-impl.h (ieee_double_extract): Use plain `unsigned int' for
+ fields.
+ * mpn/generic/inlines.c (_FORCE_INLINES): New #define. Delete
+ conditional __GNUC__.
+ * gmp.h (mpn_add, mpn_sub, mpn_add_1, mpn_sub_1):
+ Only define these if __GNUC__ || _FORCE_INLINES.
+ * mpf/random2.c: Add missing parameter in non-ANSI header.
+ * mpn/generic/gcd.c (SIGN_BIT): Do as #define to work around bug
+ in AIX compilers.
+ * mpq/get_d.c: #define N_QLIMBS.
+ * mpz/divexact.c: Obscure division by 0 to silent compiler warnings.
+ * stack-alloc.c: Cast void* pointer to char* before doing arithmetic
+ on it.
+
+ * Makefile.in (mpbsd/libmpbsd.a): New rule.
+ * configure.in (configdirs): Add mpbsd.
+
+ * gmp.h: Add declarations for a few missing mpn functions.
+
+ * Makefile.in (libmp.a): New rule.
+
+ * mpbsd/mdiv.c: #include "dmincl.c", not "mpz_dmincl.c"
+ * gmp.h: Move #define of __GNU_MP__ into the `#if __GNU_MP__' block.
+ * mp.h: Likewise. Update typedefs from gmp.h.
+ * mpbsd/configure.in: New file.
+ * mpbsd/Makefile.in: New file.
+ * mpbsd/configure: Link to master configure.
+ * mpbsd/config.sub: Link to master config.sub.
+
+ * Makefile.in: Set RANLIB_TEST.
+ * (libgmp.a): Use it.
+ * (libgmp.a): Do ranlib before moving the libgmp.a to the build
+ directory.
+ * mp?/Makefile.in: Don't use or set RANLIB.
+
+Thu Feb 15 16:38:41 1996 Torbjorn Granlund <tege@matematik.su.se>
+
+ * mpz/add_ui.c: MP_INT => mpz_t.
+ * mpz/cmp_ui.c: Likewise.
+ * mpz/fac_ui.c: Likewise.
+ * mpz/inp_binary.c: Likewise.
+ * mpz/inp_raw.c: Likewise.
+ * mpz/legendre.c: Likewise.
+ * mpz/jacobi.c: Likewise.
+ * mpz/out_binary.c: Likewise.
+ * mpz/out_raw.c: Likewise.
+ * mpz/random2.c: Likewise.
+ * mpz/random.c: Likewise.
+ * mpz/realloc.c: Likewise.
+
+ * mpz/legendre.c: __mpz_2factor(X) => mpz_scan1(X,0),
+ __mpz_odd_less1_2factor => mpz_scan1(X,1).
+ * mpz/ntsup.c: File deleted.
+ * mpz/Makefile.in: Corresponding changes.
+
+ * mpz/pprime_p: Use mpz_scan1 to avoid looping.
+
+ * mpz/fac_ui.c: Type of `k' and `p' is `unsigned long'.
+ * mpz/pprime_p.c: Pass long to *_ui functions.
+ * mpz/gcdext.c: Likewise.
+ * mpz/fdiv_r_2exp.c: Likewise.
+ * mpz/fac_ui.c: Likewise.
+
+ * mpz/powm.c: Don't use mpn_rshift when mod_shift_cnt is 0.
+
+ * mpz/tests/Makefile.in (st-sqrtrem): Fix typo.
+
+ * mpz/cmp_ui.c: #undef mpz_cmp_ui.
+ * mpz/cmp_si.c: #undef mpz_cmp_si.
+ * gmp.h (mpz_cmp_ui): New #define.
+ (mpz_cmp_si): New #define.
+
+Wed Feb 14 22:11:24 1996 Torbjorn Granlund <tege@matematik.su.se>
+
+ * gmp.h: Test __cplusplus in addition to __STDC__.
+ * gmp-impl.h: Likewise.
+
+ * gmp.h: Surround declarations with extern "C" { ... }.
+
+Tue Feb 13 15:20:45 1996 Torbjorn Granlund <tege@matematik.su.se>
+
+ * mpz/fdiv_r_2exp.c: Use MPN_NORMALIZE.
+ * mpz/tdiv_r_2exp.c: Likewise.
+
+ * mpz/fdiv_r_2exp.c: New file.
+ * mpz/fdiv_q_2exp.c: New file.
+ * mpz/tdiv_r_2exp.c: Renamed from mpz/mod_2exp.c.
+ * mpz/tdiv_q_2exp.c: Renamed from mpz/div_2exp.c
+ * mpz/Makefile.in: Corresponding changes.
+
+ * mpz/scan0.c,scan1.c: New files.
+ * mpz/Makefile.in: Compile them.
+
+ * gmp.h (mpn_normal_size): Delete.
+
+ * config.guess: Update from Cygnus version.
+
+ * mpn/m68k/rshift.S: Use INSN2 macro for lea instructions.
+ * mpn/m68k/lshift.S: Likewise.
+
+ * mpn/configure.in: Fix configuration for plain 68000.
+
+Mon Feb 12 01:06:06 1996 Torbjorn Granlund <tege@matematik.su.se>
+
+ * mpz/tests/t-powm.c: Generate negative BASE operand.
+
+ * mpz/powm.c: Make result always positive.
+
+Sun Feb 11 01:44:56 1996 Torbjorn Granlund <tege@noisy.matematik.su.se>
+
+ * mpz/tests/*.c: Add t- prefix.
+ * mpz/tests/Makefile.in: Corresponding changes.
+ * mpz/tests/configure.in: Update srctrigger.
+
+ * mpz/tests/gcd.c: Generate negative operands.
+ * mpz/tests/gcd2.c: Likewise.
+
+ * mpz/gcdext.c: At end, if G is negative, negate all G, S, and T.
+
+Thu Feb 8 17:16:12 UTC 1996 Ken Weber <kweber@mat.ufrgs.br>
+
+ * mp{z,n}/gcd.c: Change mpn_gcd interface.
+ * gmp.h: Ditto.
+ * gmp.texi: update documentation.
+
+Mon Feb 7 23:58:43 1996 Andreas Schwab <schwab@informatik.uni-dortmund.de>
+
+ * mpn/m68k/{lshift,rshift}.S: New files.
+ * mpn/m68k/syntax.h: New ELF_SYNTAX macros.
+ (MEM_INDX, R, PROLOG, EPILOG): New macros.
+ * mpn/m68k/*.S: Use R macro with register name. Use PROLOG and EPILOG
+ macros. Rename `size' to `s_size' or s1_size to avoid clash with ELF
+ .size directive.
+ * mpn/configure.in: New target m68k-*-linux*.
+
+Wed Feb 7 07:41:31 1996 Torbjorn Granlund <tege@noisy.matematik.su.se>
+
+ * Makefile.in (cre-conv-tab): Workaround for SunOS make.
+
+ * mpz/tests/reuse.c: New file.
+ * mpz/tests/Makefile.in: Handle reuse.c.
+
+Tue Feb 6 11:56:24 UTC 1996 Ken Weber <kweber@mat.ufrgs.br>
+
+ * mpz/gcd.c: Fix g->size when one op is 0 and g == other op.
+
+Tue Feb 6 01:36:39 1996 Torbjorn Granlund <tege@noisy.matematik.su.se>
+
+ * gmp.h (mpz_divexact): Delete parameter names.
+ (mpz_lcm): Delete spurious declaration.
+
+ * mpz/dmincl.c: Fix typo.
+
+Mon Feb 5 01:11:56 1996 Torbjorn Granlund <tege@noisy.matematik.su.se>
+
+ * mpn/generic/gcd.c (gcd_2): Declare consistently.
+
+ * mpz/tdiv_q.c: Optimize division by a single-limb divisor.
+ * mpz/dmincl.c: Likewise.
+
+ * mpz/add.c: Use MPN_NORMALIZE instead of mpn_normal_size.
+ * mpz/sub.c: Likewise.
+ * mpn/generic/sqrt.c: Likewise.
+
+ * mpn/tests/{add_n,sub_n,lshift,rshift}.c: Put garbage in the
+ destination arrays.
+
+Fri Feb 2 02:21:27 1996 Torbjorn Granlund <tege@noisy.matematik.su.se>
+
+ * mpz/{jacobi.c,legendre.c,ntsup.c,invert.c}: New files.
+ * mpz/Makefile.in: Compile them.
+
+ * mpn/Makefile.in (INCLUDES): Don't search in `generic'.
+
+Thu Feb 1 02:15:11 1996 Torbjorn Granlund <tege@noisy.matematik.su.se>
+
+ Change from Ken Weber:
+ * mpz/divexact.c: Make it work when quot is identical to either input.
+
+ * mpf/ui_sub.c: New file.
+ * mpf/Makefile.in: Compile it.
+
+ * gmp-impl.h (MPZ_TMP_INIT): alloca -> TMP_ALLOC.
+ * mpz/{c,f}div_{q,qr,r}.c: Use TMP_DECL/TMP_MARK/TMP_FREE since
+ these use MPZ_TMP_INIT.
+ * mpz/mod.c: Likewise.
+ * mpq/{add,sub}.c: Likewise.
+ * mpq/canonicalize: Likewise.
+
+ * mpq/{add,sub,mul,div}.c: Use mpz_divexact. MP_INT -> mpz_t.
+ * mpq/canonicalize.c: Likewise.
+
+Wed Jan 31 01:45:00 1996 Torbjorn Granlund <tege@noisy.matematik.su.se>
+
+ * mpn/generic/gcd.c: Misc changes from Ken.
+
+ * mpz/tests/gcd2.c: New file.
+ * mpz/tests/Makefile.in: Handle gcd2.c.
+
+ * mpn/generic/gcd.c (mpn_gcd): When GCD == ORIG_V, return vsize,
+ not orig_vsize. Fix parameter declaration.
+
+ * mpz/mod_ui.c: Delete file.
+ * mpz/Makefile.in: Don't try to compile mod_ui.
+
+ * mpz/cdiv_*_ui.c): Make them work right.
+ * gmp.h: Declare cdiv*.
+
+Tue Jan 30 02:22:56 1996 Torbjorn Granlund <tege@noisy.matematik.su.se>
+
+ * mpz/{cdiv_q.c,cdiv_q_ui.c,cdiv_qr.c,cdiv_qr_ui.c,cdiv_r.c,
+ cdiv_r_ui.c,cdiv_ui.c}: New files.
+ * mpz/Makefile.in: Compile them.
+
+ * All files: Make file permissions right.
+
+ Changes from Ken Weber:
+ * mpn/generic/accelgcd.c: Delete.
+ * mpn/generic/bingcd.c: Delete.
+ * mpn/generic/numbits.c: Delete.
+ * mpn/generic/gcd.c: New file.
+ * mpn/configure.in (functions): Update accordingly.
+ * mpz/divexact.c: New file.
+ * mpz/Makefile.in: Compile divexact.c.
+ * mpz/gcd.c: Rewrite to accommodate for gcd changes in mpn.
+ * gmp.h: declare new functions, delete obsolete declarations.
+ * mpz/tests/dive.c: New file.
+ * mpz/tests/Makefile.in: Handle dive.c.
+
+Mon Jan 29 03:53:24 1996 Torbjorn Granlund <tege@noisy.matematik.su.se>
+
+ * mpz/random.c: Handle negative SIZE parameter.
+
+ * mpz/tests/tdiv(_ui).c: New name for tst-dm(_ui).c.
+ * mpz/tests/tst-mdm(_ui).c: Delete.
+ * mpz/tests/fdiv(_ui).c: New test based in tst-mdm(_ui).
+ * mpz/tests/*.c: Get rid of tst- prefix for DOS 8+3 naming.
+ * mpz/tests/Makefile.in: Corresponding changes.
+ * mpz/tests/configure.in: Update srctrigger.
+
+ * mpn/generic/divmod.c: Update from divrem.
+ * mpn/generic/divrem.c: Misc cleanups.
+
+Sun Jan 28 03:25:08 1996 Torbjorn Granlund <tege@noisy.matematik.su.se>
+
+ * All files: Use new TMP_ALLOC interface.
+
+ * mpz/powm_ui.c: Make Jan 25 changes to powm.c also here.
+
+ * mpz/tests/powm_ui.c: New file.
+ * mpz/tests/Makefile.in: Add rules for tst-powm and tst-powm_ui.
+
+ * Makefile.in: Update dependency list.
+ * mpf/Makefile.in: Likewise.
+ * mpz/Makefile.in: Likewise.
+ * mpq/Makefile.in: Likewise.
+ * Makefile.in: Set RANLIB simply to ranlib, and allow configure
+ to override it.
+
+ * mpz/Makefile.in (conf): Delete spurious target.
+ (mp_bases.c): Delete.
+ (cre-conv-tab rules): Delete.
+
+ * Makefile.in (cre-conv-tab): Greatly simplify.
+
+Sat Jan 27 13:38:15 1996 Torbjorn Granlund <tege@noisy.matematik.su.se>
+
+ * stack-alloc.c: New file.
+ * stack-alloc.h: New file.
+
+ * gmp.h (__gmp_inline): Define using __inline__.
+
+Thu Jan 25 00:28:37 1996 Torbjorn Granlund <tege@noisy.matematik.su.se>
+
+ * mpn/generic/scan0.c: New file.
+ * mpn/generic/scan1.c: Renamed from next_bit.c.
+ * mpn/configure.in (functions): Include scan0 and scan1.
+
+ * mpn/m68k/*: #include sysdep.h. Use C_GLOBAL_NAME.
+
+ * configure: Update from Cygnus version.
+ * config.guess: Likewise.
+ * config.sub: Likewise.
+ * configure: Pass --nfp to recursive configures.
+
+ * mpz/tests/tst-*.c: Adjust SIZE and reps.
+
+ * mpz/powm.c: Move esize==0 test earlier.
+ In final reduction of rp,rsize, don't call mpn_divmod unless
+ reduction is really needed.
+
+ * mpz/tests/tst-powm.c: Fix thinko in checking code.
+
+ * All files: Get rid of `__' prefix from mpn_* calls and declarations.
+ * gmp.h: #define __MPN.
+ * gmp.h: Use __MPN in #defines for mpn calls.
+
+ * mpn/generic/mul_n.c: Prepend `i' to internal routines.
+ * gmp-impl.h: Add #defines using __MPN for those internal routines.
+
+ * mpn/generic/sqrt.c: Change call to mpn_mul to mpn_mul_n.
+
+Wed Jan 24 13:28:19 1996 Torbjorn Granlund <tege@noisy.matematik.su.se>
+
+ * mpn/sparc32/udiv_fp.S: New name for udiv_qrnnd.S.
+ * mpn/sparc32/udiv_nfp.S: New name for v8/udiv_qrnnd.S.
+ * mpn/sparc32/v8/supersparc: New directory.
+ * mpn/sparc32/v8/supersparc/udiv.S: New file.
+
+Tue Jan 23 01:10:11 1996 Torbjorn Granlund <tege@noisy.matematik.su.se>
+
+ This major contribution is from Ken Weber:
+ * mpn/generic/accelgcd.c: New file.
+ * mpn/generic/bdivmod.c: New file.
+ * mpn/generic/bingcd.c: New file.
+ * mpn/generic/gcd_1.c: Rewrite.
+ * mpn/generic/numbits.c: New file (to go away soon).
+ * mpz/gcd.c: Rewrite.
+ * mpz/tests/tst-gcd.c (SIZE): Now 128.
+ * gmp.h: Declare new functions.
+ * mpn/configure.in (functions): List new files.
+ * gmp-impl.h (MPN_SWAP): Delete.
+ (MPN_LESS_BITS_LIMB, MPN_LESS_BITS, MPN_MORE_BITS): Delete.
+ (MPN_COMPL_INCR, MPN_COMPL): Delete.
+
+Mon Jan 22 02:04:59 1996 Torbjorn Granlund <tege@noisy.matematik.su.se>
+
+ * gmp.h (mpn_name): New #define.
+
+ * mpn/m88k/mc88110/addmul_1.s: New file.
+ * mpn/m88k/mc88110/add_n.S: New file.
+ * mpn/m88k/mc88110/sub_n.S: New file.
+
+ * mpn/m88k/sub_n.s: Correctly initialize carry.
+
+ * mpn/sparc32/{add_n.S,sub_n.S,lshift.S,rshift.S): `beq' => `be'.
+
+Sun Jan 21 00:04:35 1996 Torbjorn Granlund <tege@noisy.matematik.su.se>
+
+ * mpn/sparc64/addmul_1.s: New file.
+ * mpn/sparc64/submul_1.s: New file.
+ * mpn/sparc64/rshift.s: New file.
+
+Sat Jan 20 00:32:54 1996 Torbjorn Granlund <tege@noisy.matematik.su.se>
+
+ * mpz/iset.c: Fix typo introduced Dec 25.
+
+Wed Jan 17 13:16:44 1996 Torbjorn Granlund <tege@noisy.matematik.su.se>
+
+ * config/mt-sprc8-gcc: New name for mt-sparc8-gcc.
+ * config/mt-sparcv8-gcc: Delete.
+ * configure.in: Corresponding changes.
+
+Tue Jan 16 16:31:01 1996 Torbjorn Granlund <tege@noisy.matematik.su.se>
+
+ * gmp-impl.h: #include alloca.h when necessary.
+
+ * longlong.h: Test __alpha instead of __alpha__, since the former
+ is the standard symbol.
+
+Mon Jan 15 18:06:57 1996 Torbjorn Granlund <tege@noisy.matematik.su.se>
+
+ * mpn/sparc64/mul_1.s: Swap operands of mulx instructions.
+ * mpn/sparc64/lshift.s: New file.
+
+Fri Dec 29 17:34:03 1995 Torbjorn Granlund <tege@noisy.matematik.su.se>
+
+ * mpn/x86/pentium/add_n.S: Get rid of #defines for register names.
+ * mpn/x86/pentium/sub_n.S: Likewise.
+
+Thu Dec 28 03:16:57 1995 Torbjorn Granlund <tege@noisy.matematik.su.se>
+
+ * mpn/x86/pentium/mul_1.S: Rework loop to avoid AGI between update
+ of loop induction variable and load insn at beginning of loop.
+ * mpn/x86/pentium/addmul_1.S: Likewise.
+ * mpn/x86/pentium/submul_1.S: Likewise.
+
+Mon Dec 25 23:22:55 1995 Torbjorn Granlund <tege@noisy.matematik.su.se>
+
+ * All files: Prefix user-visible structure fields with _mp_.
+
+Fri Dec 22 20:42:17 1995 Torbjorn Granlund <tege@noisy.matematik.su.se>
+
+ * mpn/configure.in (m68k configs): Terminate path variable with
+ plain "m68k".
+
+Fri Dec 22 03:29:33 1995 Torbjorn Granlund <tege@noisy.matematik.su.se>
+
+ * mpn/sparc32/add_n.S: Update from sub_n.S to fix bugs, and to
+ clean things up.
+
+ * mpn/configure.in (m68k configs): Update #include path for new
+ mpn directory organization.
+
+Tue Dec 12 02:53:02 1995 Torbjorn Granlund <tege@noisy.matematik.su.se>
+
+ * gmp.h: Prefix all structure field with _mp_.
+ * gmp-impl.h: Define access macros for these fields.
+
+Sun Dec 10 00:47:17 1995 Torbjorn Granlund <tege@noisy.matematik.su.se>
+
+ * mpn/alpha/addmul_1.s: Prefix labels with `.'.
+ * mpn/alpha/submul_1.s: Likewise.
+ * mpn/alpha/[lr]shift.s: Likewise.
+ * mpn/alpha/udiv_qrnnd.S: Likewise.
+ * mpn/alpha/ev5/[lr]shift.s: Likewise.
+
+ * mpn/alpha/ev5/lshift.s: Fix typos.
+
+Fri Dec 1 14:28:20 1995 Torbjorn Granlund <tege@noisy.matematik.su.se>
+
+ * mpn/Makefile.in (.SUFFIXES): Define.
+
+Wed Nov 29 23:11:57 1995 Torbjorn Granlund <tege@noisy.matematik.su.se>
+
+ * mpn/sparc64/{add_n.s, sub_n.s}: New files.
+
+Tue Nov 28 06:03:13 1995 Torbjorn Granlund <tege@noisy.matematik.su.se>
+
+ * mpn/x86/syntax.h: Handle ELF_SYNTAX.
+ Rename GAS_SYNTAX => BSD_SYNTAX.
+
+ * mpn/configure.in: Handle linuxelf and SysV for x86 variants.
+
+Mon Nov 27 01:32:12 1995 Torbjorn Granlund <tege@noisy.matematik.su.se>
+
+ * mpn/hppa/hppa1_1/pa7100/submul_1.S: New file.
+
+Sun Nov 26 04:30:47 1995 Torbjorn Granlund <tege@noisy.matematik.su.se>
+
+ * mpn/hppa/hppa1_1/pa7100/addmul_1.S: New file.
+
+ * mpn/sparc32/add_n.S: Rewrite to use 64 bit loads/stores.
+ * mpn/sparc32/sub_n.S: Likewise.
+
+Fri Nov 17 00:18:46 1995 Torbjorn Granlund <tege@bozo.matematik.su.se>
+
+ * mpn/configure.in: Handle m68k on NextStep.
+
+Thu Nov 16 02:30:26 1995 Torbjorn Granlund <tege@bozo.matematik.su.se>
+
+ * mpn: Reorganize machine-specific directories.
+ * mpn/configure.in: Corresponding changes.
+ (sh, sh2): Handle these.
+ (m68k targets): Create asm-syntax.h.
+
+Thu Nov 9 02:20:50 1995 Torbjorn Granlund <tege@bozo.matematik.su.se>
+
+ * mpn/generic/mul_n.c (____mpn_sqr_n): Delete code that calls abort.
+ (____mpn_mul_n): Likewise.
+
+Tue Nov 7 03:25:12 1995 Torbjorn Granlund <tege@bozo.matematik.su.se>
+
+ * mpf/get_str.c: In exponentiation code (two places), don't swap
+ input and output areas when calling mpn_mul_1.
+ * mpf/set_str.c: Likewise.
+
+Fri Nov 3 02:35:58 1995 Torbjorn Granlund <tege@bozo.matematik.su.se>
+
+ * mpf/Makefile.in: Make sure all objects are listed in dependency list;
+ delete spurious entries.
+
+ * mpf/mul.c: Handle U or V being 0. Allow prec+1 for result precision.
+
+ * mpf/set_prec.c: New computation of limb precision.
+ * mpf/set_dfl_prec.c: Likewise.
+
+ * mpf/random2.c: Fix typo computing exp.
+ * mpf/get_str.c: In (uexp > usize) case, set n_limbs as a function of
+ the user-requested number of digits, n_digits.
+
+Thu Nov 2 16:25:07 1995 Torbjorn Granlund <tege@bozo.matematik.su.se>
+
+ * mpn/generic/divrem.c (case 2): Don't move np vector back, it is
+ never read.
+ (default case): Put most significant limb from np in new variable n2;
+ decrease size argument for MPN_COPY_DECR; use n2 instead of np[dsize].
+
+Wed Nov 1 02:59:53 1995 Torbjorn Granlund <tege@bozo.matematik.su.se>
+
+ * mpn/sparc/[lr]shift.S: New files.
+
+Tue Oct 31 00:08:12 1995 Torbjorn Granlund <tege@bozo.matematik.su.se>
+
+ * mpz/gcd_ui.c: Set w->size unconditionally when v is zero.
+
+ * gmp-impl.h (assert): Delete definition.
+
+ * mpf/sub.c: Delete all assert calls. Delete variable `cy'.
+
+ * mpf/neg.c: Use prec+1 as precision. Optimize for when arguments
+ are the same.
+ * mpf/abs.c: Likewise.
+ * mpf/{set,neg,abs}.c: Make structure and variable names similar.
+
+Mon Oct 30 12:45:26 1995 Torbjorn Granlund <tege@bozo.matematik.su.se>
+
+ * mpf/random2.c (random): Test __SVR4 in addition to __svr4__.
+ * mpn/generic/random2.c (random): Likewise.
+
+Sun Oct 29 01:54:28 1995 Torbjorn Granlund <tege@bozo.matematik.su.se>
+
+ * mpf/div.c: Special handle U or V being 0.
+
+ * mpf/random2.c: New file.
+
+ * longlong.h (i860 rshift_rhlc): Define.
+ (i960 udiv_qrnnd): Define.
+ (i960 count_leading_zeros): Define.
+ (i960 add_ssaaaa): Define.
+ (i960 sub_ddmmss): Define.
+ (i960 rshift_rhlc): Define.
+
+Sat Oct 28 19:09:15 1995 Torbjorn Granlund <tege@bozo.matematik.su.se>
+
+ * mpn/pentium/rshift.S: Fix and generalize condition for when to use
+ special code for shift by 1.
+ * mpn/pentium/lshift.S: Likewise.
+
+Thu Oct 26 00:02:56 1995 Torbjorn Granlund <tege@bozo.matematik.su.se>
+
+ * gmp.h: #undef __need_size_t.
+ * mp.h: Update from gmp.h.
+
+Wed Oct 25 00:17:27 1995 Torbjorn Granlund <tege@bozo.matematik.su.se>
+
+ * mpf/Makefile.in: Compile set_prec.c.
+ * mpf/realloc.c: Delete this file.
+ * mpf/Makefile.in: Delete mentions of realloc.c.
+
+ * gmp.h (__mpf_struct): Get rid of `alloc' field.
+ * mpf/clear.c: Likewise.
+ * mpf/init*.c: Likewise.
+ * mpf/set_prec.c: Likewise.
+ * mpf/iset*.c: Likewise.
+
+ * mpf/iset_str.c: New file.
+
+ * mpn/configure.in: Handle pyramid.
+
+ * mpf/set.c: Use prec+1 as precision.
+
+ * mpf/set_prec.c: New file.
+
+Tue Oct 24 00:56:41 1995 Torbjorn Granlund <tege@bozo.matematik.su.se>
+
+ * mpn/generic/divrem.c: New file. Will replace mpn/generic/divmod.c
+ when rest of source is converted.
+ * mpn/configure.in (functions): Add `divrem'
+ * mpn/generic/set_str.c: Never call __mpn_mul_1 with zero size.
+
+ * mpf/get_str.c: Completely rewritten.
+ * mpf/add.c: Fix several problems.
+ * mpf/sub.c: Compare operands from most significant end until
+ first difference, exclude skipped limbs from computation.
+ Accordingly simplify normalization code.
+ * mpf/set_str.c: Fix several problems.
+ * mpf/dump.c: New file.
+ * mpf/Makefile.in: Compile dump.c.
+ * mpf/init2.c: Set prec field correctly.
+
+Sun Oct 22 03:02:09 1995 Torbjorn Granlund <tege@bozo.matematik.su.se>
+
+ * cre-conv-tab.c: #include math.h; don't declare log and floor.
+
+Sat Oct 21 23:04:10 1995 Torbjorn Granlund <tege@bozo.matematik.su.se>
+
+ * mpf/mul_ui.c: Handle U being 0.
+
+Wed Oct 18 19:39:27 1995 Torbjorn Granlund <tege@bozo.matematik.su.se>
+
+ * mpn/generic/set_str.c: Correctly handle input like "000000000000".
+ Misc cleanups.
+
+Tue Oct 17 15:14:13 1995 Torbjorn Granlund <tege@bozo.matematik.su.se>
+
+ * longlong.h: Define COUNT_LEADING_ZEROS_0 for machines where
+ appropriate.
+
+Mon Oct 16 19:14:43 1995 Torbjorn Granlund <tege@bozo.matematik.su.se>
+
+ * mpf/add.c: Rewrite.
+ * mpf/set_str.c: New file. Needs more work.
+
+Sat Oct 14 00:14:04 1995 Torbjorn Granlund <tege@bozo.matematik.su.se>
+
+ * mpf/div_2exp.c: Vastly simplify.
+ * mpf/mul_2exp.c: Likewise.
+
+ * mpf/sub.c: Rewrite.
+
+ * gmp-impl.h (udiv_qrnnd_preinv2gen): Terminate comment.
+
+ * mpf/dump.c: Free allocated memory.
+
+ * gmp-impl.h (assert): Define.
+
+Wed Oct 11 13:31:00 1995 Torbjorn Granlund <tege@bozo.matematik.su.se>
+
+ * mpn/pentium/rshift.S: Install new code to optimize shift-by-1.
+
+Tue Oct 10 00:37:21 1995 Torbjorn Granlund <tege@bozo.matematik.su.se>
+
+ * mpn/pentium/lshift.S: Install new code to optimize shift-by-1.
+
+ * mpn/powerpc32/{lshift.s,rshift.s}: New files.
+
+ * configure.in: Fix typo.
+
+Sat Oct 7 08:17:09 1995 Torbjorn Granlund <tege@bozo.matematik.su.se>
+
+ * longlong.h (smul_ppmm): Correct type of __m0 and __m1.
+
+Wed Oct 4 16:31:28 1995 Torbjorn Granlund <tege@bozo.matematik.su.se>
+
+ * mpn/configure.in: Handle alphaev5.
+ * mpn/ev4: New name for alpha subdir.
+ * mpn/ev5: New subdir.
+ * mpn/ev5/lshift.s: New file.
+
+Tue Oct 3 15:06:45 1995 Torbjorn Granlund <tege@bozo.matematik.su.se>
+
+ * mpn/alpha/mul_1.s: Avoid static increments of pointers; use
+ corresponding offsets in ldq and stq instructions instead.
+ (Loop): Swap cmpult and stq to save one cycle on EV5.
+
+ * mpn/tests/{add_n.s,sub_n.s,lshift.s,rshift.s,mul_1.s,addmul_1.s,
+ submul_1.s}: Don't check results if NOCHECK is defined.
+
+Mon Oct 2 11:40:18 1995 Torbjorn Granlund <tege@bozo.matematik.su.se>
+
+ * longlong.h (mips umul_ppmm [32 and 64 bit versions]):
+ Make new variants, based on GCC version number, that use `l' and `h'
+ constraints instead of explicit mflo and mfhi instructions
+
+Sun Oct 1 00:17:47 1995 Torbjorn Granlund <tege@bozo.matematik.su.se>
+
+ * mpn/mc88100/add_n.s: Decrease unrolling factor from 16 to 8.
+ * mpn/mc88100/sub_n.s: Likewise.
+
+ * config/mt-m88110: New file.
+ * configure.in: Use it.
+
+ * mpn/mc88110/mul_1.s: Fix thinko.
+
+Sat Sep 30 21:28:19 1995 Torbjorn Granlund <tege@bozo.matematik.su.se>
+
+ * mpz/set_d.c: Declare `size' at function start.
+
+ * experimental: New directory for mpx and mpz2.
+
+ * mpz/tdiv_q.c: Clarify comments.
+ * mpz/{mod.c,mod_ui.c}: New file, for math mod function.
+
+ * mpn/sh2/{mul_1.s,addmul_1.s,submul_1.s}: New files.
+
+ * mpn/sh/{add_n.s,sub_n.s}: New files.
+
+ * mpn/pyr/{add_n.s,sub_n.s,mul_1.s,addmul_1.s}: New files.
+
+ * mpn/i960/{add_n.s,sub_n.s}: New files.
+
+ * mpn/alpha/addmul_1.s (Loop): Move decrement of r18 to before umulh,
+ to save cycles on EV5.
+ * mpn/alpha/submul_1.s: Ditto.
+ * mpn/alpha/mul_1.s: Ditto.
+
+Thu Sep 28 02:48:59 1995 Torbjorn Granlund <tege@bozo.matematik.su.se>
+
+ * gmp.h (mp_limb, mp_limb_signed): Define as `long long' if
+ _LONG_LONG_LIMB is defined.
+
+ * longlong.h (m88110): Test __m88110__, not __mc88110__
+
+ * mpn/mc88110/mul_1.s: Rewrite.
+
+Tue Sep 26 23:29:05 1995 Torbjorn Granlund <tege@bozo.matematik.su.se>
+
+ * config.sub: Update from current Cygnus version.
+
+ * mpn/configure.in: Recognize canonical m88*, not mc88*.
+
+Fri Sep 22 14:58:05 1995 Torbjorn Granlund <tege@bozo.matematik.su.se>
+
+ * mpz/set_d.c: New file.
+ * mpz/Makefile.in: Build new files.
+
+ * mpq/get_d.c: Replace usage of scalbn with ldexp.
+
+ * mpn/{vax,i386}/gmp-mparam.h: New files.
+ * gmp-impl.h (ieee_double_extract): Define here.
+ * mpf/set_d.c (ieee_double_extract): Not here.
+
+Thu Sep 21 00:56:36 1995 Torbjorn Granlund <tege@bozo.matematik.su.se>
+
+ * longlong.h (C umul_ppmm): Use UWtype, not USItype for temps.
+ (udiv_qrnnd): For cases implemented with call to __udiv_qrnnd,
+ protect with new symbol LONGLONG_STANDALONE.
+ (68000 umul_ppmm): Use %# prefix for immediate constants.
+
+Wed Sep 20 15:36:23 1995 Torbjorn Granlund <tege@bozo.matematik.su.se>
+
+ * mpn/generic/divmod_1.c: Handle
+ divisor_limb == 1 << (BITS_PER_MP_LIMB - 1)
+ specifically also when normalization_steps != 0.
+
+Mon Sep 18 15:42:30 1995 Torbjorn Granlund <tege@bozo.matematik.su.se>
+
+ * mpq/get_d.c: New file.
+
+Sun Sep 17 02:04:36 1995 Torbjorn Granlund <tege@bozo.matematik.su.se>
+
+ * longlong.h (pyr): Botch up for now.
+
+Sat Sep 16 00:11:50 1995 Torbjorn Granlund <tege@bozo.matematik.su.se>
+
+ * mpn/clipper/mul_1.s: New file.
+ * mpn/clipper/add_n.s: New file.
+ * mpn/clipper/sub_n.s: New file.
+ * mpn/configure.in: Handle clipper*-*-*.
+
+ * mpn/configure.in: Recognize rs6000-*-*.
+
+Fri Sep 15 00:41:34 1995 Torbjorn Granlund <tege@bozo.matematik.su.se>
+
+ * mpn/alpha/add_n.s: New file.
+ * mpn/alpha/sub_n.s: New file.
+
+ * mpn/mips3: New name for mpn/r4000.
+ * mpn/mips2: New name for mpn/r3000.
+ * mpn/configure.in: Corresponding changes.
+
+ * mpn/generic/perfsqr.c (primes): Delete.
+ (residue_map): Delete.
+
+Thu Sep 14 00:07:58 1995 Torbjorn Granlund <tege@bozo.matematik.su.se>
+
+ * mpn/r3000/sub_n.s: Fix typo.
+
+ * dm_trunc.c: Delete spurious file.
+
+ * mpz/out_binary.c: Fix typo.
+
+ * mpn/configure.in (per-target): Make mips*-*-irix6* imply r4000.
+
+ * gmp-impl.h: For sparc and sgi, include alloca.h.
+
+ * mpn/z8000/mul_1.s: Replace `test r' with `and r,r'. Replace
+ `ldk r,#0' with `xor r,r'.
+
+Wed Sep 6 00:58:38 1995 Torbjorn Granlund <tege@bozo.matematik.su.se>
+
+ * mpz/inp_binary.c: New file.
+ * mpz/out_binary.c: New file.
+ * mpz/Makefile.in: Build new files.
+
+Tue Sep 5 22:53:51 1995 Torbjorn Granlund <tege@bozo.matematik.su.se>
+
+ * gmp.h (__mpz_struct): Change `long int' => `mp_size_t' for alloc
+ and size fields.
+
+Sat Sep 2 17:47:59 1995 Torbjorn Granlund <tege@bozo.matematik.su.se>
+
+ * mpn/r4000/{add_n.s,sub_n.s}: Optimize away some pointer arithmetic.
+ * mpn/r3000/{add_n.s,sub_n.s,lshift.s,rshift.s}: New files,
+ derived from r4000 code.
+
+Fri Sep 1 05:35:52 1995 Torbjorn Granlund <tege@bozo.matematik.su.se>
+
+ * mpn/r3000/mul_1.s: Fix typo.
+
+ * mpn/powerpc32: Fix some old vs new mnemonic issues.
+
+ * mpn/powerpc32/{add_n.s,sub_n.s}: New files.
+ * mpn/r4000/{add_n.s,sub_n.s,lshift.s,rshift.s}: New files.
+
+Wed Aug 30 10:43:47 1995 Torbjorn Granlund <tege@bozo.matematik.su.se>
+
+ * mpn/r3000/mul_1.s ($LC1): Use addiu for immediate add.
+ * mpn/r4000/{mul_1.s,addmul_1.s,submul_1.s}: New files.
+
+ * config.guess: Update to latest FSF revision.
+
+Mon Aug 28 02:18:13 1995 Torbjorn Granlund <tege@bozo.matematik.su.se>
+
+ * mpz/out_str.c: Cast str to char * in fputs call.
+
+ * gmp-impl.h: Define UQItype, SItype, and USItype also
+ when not __GNUC__.
+
+Fri Aug 25 01:45:04 1995 Torbjorn Granlund <tege@bozo.matematik.su.se>
+
+ * mpn/i386/syntax.h: Renamed from asm-syntax.h.
+ * mpn/mc68020/syntax.h: Renamed from asm-syntax.h.
+ * mpn/configure.in: Corresponding changes.
+
+Sun Aug 13 19:20:04 1995 Torbjorn Granlund <tege@bozo.matematik.su.se>
+
+ * mpn/generic/random2.c: Test __hpux, not hpux.
+
+Sat Apr 15 20:50:33 1995 Torbjorn Granlund (tege@tiny.cygnus.com)
+
+ * mpn/sparc/add_n.S: Make it work for PIC.
+ * mpn/sparc/sub_n.s: Likewise.
+ * mpn/sparc8/addmul_1.S: Likewise.
+ * mpn/sparc8/mul_1.S: Likewise.
+ * mpn/i386/add_n.S: Likewise.
+ * mpn/i386/sub_n.S: Likewise.
+
+Thu Apr 13 23:15:03 1995 Torbjorn Granlund (tege@tiny.cygnus.com)
+
+ * mpn/configure.in: Don't search power subdir for generic ppc configs.
+ Add some ppc cpu-specific configs. Misc clean up.
+
+Mon Apr 10 00:16:35 1995 Torbjorn Granlund (tege@tiny.cygnus.com)
+
+ * mpz/ui_pow_ui.c: Delete spurious code to handle negative results.
+
+Sun Apr 9 12:38:11 1995 Torbjorn Granlund (tege@tiny.cygnus.com)
+
+ * longlong.h (SPARC v8 udiv_qrnnd): Generate remainder in C,
+ not in asm.
+
+ * mpn/generic/sqrt.c (SQRT): Test for __SOFT_FLOAT.
+
+Tue Mar 28 00:19:52 1995 Torbjorn Granlund (tege@tiny.cygnus.com)
+
+ * mpn/generic/hamdist.c (popc_limb): Make Mar 16 change here too.
+
+Fri Mar 17 23:29:22 1995 Torbjorn Granlund (tege@tiny.cygnus.com)
+
+ * longlong.h (SH umul_ppmm): Define.
+
+Thu Mar 16 16:40:44 1995 Torbjorn Granlund (tege@tiny.cygnus.com)
+
+ * mpn/generic/popcount.c (popc_limb): Rearrange 32 bit case
+ to help CSE.
+
+Fri Mar 10 20:03:49 1995 Torbjorn Granlund (tege@tiny.cygnus.com)
+
+ * mpn/powerpc32/mul_1.s: Clear cy before entering loop.
+ Rearrange loop to save a cycle.
+ * mpn/powerpc32/addmul_1.s: New file.
+ * mpn/powerpc32/submul_1.s: New file.
+
+Fri Feb 17 22:44:45 1995 Torbjorn Granlund (tege@tiny.cygnus.com)
+
+ * mpn/configure.in: Set target_makefile_frag for freebsd
+ in new case stmt.
+ * mpn/config/t-freebsd: New file.
+ * mpn/Makefile.in: Add #### for frag insertion.
+ (XCFLAGS): Clear by default.
+ (.c.o, .S.o rules): Pass XCFLAGS.
+
+Tue Feb 7 16:27:50 1995 Torbjorn Granlund (tege@tiny.cygnus.com)
+
+ * longlong.h (68000 umul_ppmm): Merge improvements from henderson.
+
+Tue Jan 24 04:23:20 1995 Torbjorn Granlund (tege@tiny.cygnus.com)
+
+ * longlong.h (default umul_ppmm): Store input parameters in temporaries
+ to avoid reading them twice.
+ (default smul_ppmm): New definition.
+
+Thu Dec 29 04:20:07 1994 Jim Meyering (meyering@comco.com)
+
+ * generic/perfsqr.c (__mpn_perfect_square_p): Remove declaration
+ of unused variable.
+ * generic/pre_mod_1.c (__mpn_preinv_mod_1): Likewise.
+ * mpz/powm.c (pow): Likewise.
+
+ * mpz/and.c (mpz_and): Use {} instead of `;' for empty else clause
+ to placate `gcc -Wall'.
+ * mpz/ior.c (mpz_ior): Likewise.
+
+Wed Dec 28 13:31:40 1994 Torbjorn Granlund (tege@tiny.cygnus.com)
+
+ * mpn/m*68*/*.S: #include asm-syntax.h, not asm.h.
+
+Mon Dec 26 17:15:36 1994 Torbjorn Granlund (tege@tiny.cygnus.com)
+
+ * longlong.h: Test for more symbols, in __mc68000__ case.
+
+ * mpn/mpn/config.sub: Recognize m68060.
+ * mpn/configure.in: Change mc* to m* for 68k targets.
+ * mpn/Makefile.in (.S.o): Delete spurious creation of temp .c file.
+
+Mon Dec 19 01:56:30 1994 Torbjorn Granlund (tege@tiny.cygnus.com)
+
+ * config.sub: Recognize pentium as a valid CPU.
+ * mpn/configure.in: Handle pentium specifically, to use new assembly
+ code.
+
+Mon Dec 19 00:13:01 1994 Jim Meyering (meyering@comco.com)
+
+ * gmp.h: Define _GMP_H_HAVE_FILE if FILE, __STDIO_H__, or H_STDIO
+ is defined.
+ * gmp.h: test _GMP_H_HAVE_FILE instead of FILE everywhere else.
+
+Mon Dec 19 00:04:54 1994 Kent Boortz (boortz@sics.se)
+
+ * Makefile.in (recursive makes): Pass CFLAGS.
+
+Sun Dec 18 22:34:49 1994 Torbjorn Granlund (tege@tiny.cygnus.com)
+
+ * mpn/pentium: New directory.
+
+ * mpz/pprime.c: Make sure to mpz_clear all temporaries.
+
+ * longlong.h: Don't use udiv instruction when SUPERSPARC is defined.
+ * configure.in: Handle supersparc*-.
+ * config/mt-supspc-gcc: New file.
+ * config/mt-sparc8-gcc: New name for mt-sparcv8-gcc.
+
+Mon Dec 12 22:22:10 1994 Torbjorn Granlund (tege@tiny.cygnus.com)
+
+ * mpn/i386/*.S: #include "asm-syntax.h", not "asm.h".
+ #include sysdep.h before asm-syntax.h.
+
+ * mpn/mc68020/asm-syntax.h: #undef ALIGN before defining it.
+ * mpn/i386/asm-syntax.h: Likewise.
+
+ * mpn/mc68020/asm-syntax.h: New name for asm.h.
+ * mpn/i386/asm-syntax.h: New name for asm.h.
+
+Tue Dec 6 21:55:25 1994 Torbjorn Granlund (tege@tiny.cygnus.com)
+
+ * mpz/array_init.c: Fix typo in declaration.
+
+Fri Nov 18 19:50:52 1994 Torbjorn Granlund (tege@tiny.cygnus.com)
+
+ * mpn/Makefile.in (.S.o): Pass CFLAGS and INCLUDES.
+
+Mon Nov 14 00:34:12 1994 Torbjorn Granlund (tege@tiny.cygnus.com)
+
+ * mpn/generic/random2.c (random): Test for __svr4__.
+
+Wed Oct 12 23:28:16 1994 Torbjorn Granlund (tege@tiny.cygnus.com)
+
+ * cre-conv-tab.c (main): Avoid upper-case X in printf format string.
+
+Tue Aug 23 17:16:35 1994 Torbjorn Granlund (tege@tiny.cygnus.com)
+
+ * mpz/perfsqr.c: Use mpn_perfect_square_p.
+ * mpn/generic/perfsqr.c: New file.
+
+Wed Jul 6 13:46:51 1994 Torbjorn Granlund (tege@tiny.cygnus.com)
+
+ * mpz/array_init.c: New file.
+ * mpz/Makefile.in: Compile array_init.
+ * gmp.h: Declare mpz_array_init.
+
+Mon Jul 4 01:10:03 1994 Torbjorn Granlund (tege@tiny.cygnus.com)
+
+ * mpz/add.c: Fix bogus comment.
+ * mpz/sub.c: Likewise.
+
+Sat Jul 2 02:14:56 1994 Torbjorn Granlund (tege@adder.cygnus.com)
+
+ * mpn/generic/pre_mod_1.c: New file.
+ * mpz/perfsqr.c: Use __mpn_preinv_mod_1 when faster.
+
+Fri Jul 01 22:10:19 1994 Richard Earnshaw (rwe11@cl.cam.ac.uk)
+
+ * longlong.h (arm umul_ppmm): Fix typos in last change. Mark
+ hard-coded registers with "%|"
+
+Thu Jun 30 03:59:33 1994 Torbjorn Granlund (tege@tiny.cygnus.com)
+
+ * mpz/perfsqr.c: Define PP, etc, for machines with 64 bit limbs.
+ Use __mpn_mod_1.
+ * mpz/perfsqr.c: Don't clobber REM in quadratic residue check loop.
+
+Wed Jun 29 18:45:41 1994 Torbjorn Granlund (tege@adder.cygnus.com)
+
+ * mpn/generic/sqrt.c (SQRT): New asm for IBM POWER2.
+
+ * mpz/gcd_ui.c: Return 0 if result does not fit an unsigned long.
+
+ * gmp.h: Use "defined (__STDC__)" consistently.
+
+Tue Jun 28 18:44:58 1994 Torbjorn Granlund (tege@adder.cygnus.com)
+
+ * gmp.h (mpz_get_si): Don't use "signed" keyword for return type.
+
+ * mpz/tests/Makefile.in: Use CFLAGS for linking.
+
+ * Makefile.in (CFLAGS): Use -O2 here.
+ * mpn/Makefile (CFLAGS): Not here.
+
+ * mpq/cmp_ui.c: Fix typo.
+ * mpq/canonicalize.c: Fix typo.
+ * mpz/gcd_ui.c: Handle gcd(0,v) and gcd(u,0) correctly.
+ * mpn/generic/gcd_1.c: Fix braino in last change.
+
+Mon Jun 27 16:10:27 1994 Torbjorn Granlund (tege@rtl.cygnus.com)
+
+ * mpz/gcd_ui.c: Change return type and return result.
+ Allow destination param to be NULL.
+ * gmp.h: Corresponding change.
+ * mpn/generic/gcd_1.c: Handle zero return from mpn_mod_1.
+
+Tue Jun 14 02:17:43 1994 Torbjorn Granlund (tege@tiny.cygnus.com)
+
+ * mpn/i386/asm.h (ALIGN): Make it take a parameter.
+ * mpn/i386/*.S: Use ALIGN to align all loops.
+
+ * mpn/i386/*.S: Move colon inside C_GLOBAL_NAME expression.
+ (Makes old versions of GAS happy.)
+
+Sat May 28 01:43:54 1994 Torbjorn Granlund (tege@adder.cygnus.com)
+
+ * Many files: Delete unused variables and labels.
+ * mpn/generic/dump.c: cast printf width argument to int.
+
+Wed May 25 00:42:37 1994 Torbjorn Granlund (tege@thepub.cygnus.com)
+
+ * mpz/gcd.c (mpz_gcd): Normalize after __mpn_sub calls.
+ (xmod): Ignore return value of __mpn_divmod.
+ (xmod): Improve normalization code.
+
+Sat May 21 01:30:09 1994 Torbjorn Granlund (tege@adder.cygnus.com)
+
+ * mpz/gcdext.c: Cosmetic changes.
+
+ * mpz/fdiv_ui.c: New file.
+
+Fri May 20 00:24:53 1994 Torbjorn Granlund (tege@adder.cygnus.com)
+
+ * mpz/tests/Makefile.in: Use explicit rules for running tests,
+ not a shell loop.
+ (clean): Delete stmp-*.
+
+ * mpz/Makefile.in: Update.
+
+ * mpz/div_ui.c: Don't include longlong.h.
+ * mpz/dm_ui.c: Likewise.
+
+ * mpz/fdiv_q.c, mpz/fdiv_q_ui.c, mpz/fdiv_qr.c, mpz/fdiv_qr_ui.c,
+ mpz/fdiv_r.c, mpz/fdiv_r_ui.c: New files. Code partly from deleted
+ mdm.c, mdm_ui.c, etc, partly rewritten.
+ * mpz/dm_floor_ui.c, mpz/dm_floor.c: Delete.
+ * mpz/mdm.c, mpz/mdm_ui.c, mpz/mdiv.c, mpz/mdiv_ui.c, mpz/mmod.c,
+ mpz/mmod_ui.c: Delete.
+
+ * mpz/tdiv_q.c, mpz/tdiv_q_ui.c, mpz/tdiv_qr.c, mpz/tdiv_qr_ui.c,
+ mpz/tdiv_r.c, mpz/tdiv_r_ui.c:
+ New names for files implementing truncating division.
+ * mpz/div_ui.c, mpz/dm_ui.c, mpz/mod_ui.c: Simplify.
+
+ * mpn/Makefile.in (.S.o): Don't rely on CPP being defined, use CC
+ instead.
+ (clean): Delete tmp-*.
+
+Thu May 19 01:37:44 1994 Torbjorn Granlund (tege@adder.cygnus.com)
+
+ * mpz/cmp.c: Call __mpn_cmp.
+
+ * mpz/popcount.c: Fix typo.
+
+ * mpz/powm_ui.c: Simplify main loop. Keep principal operand size
+ smaller than MSIZE when possible.
+ * mpz/powm.c: Likewise.
+
+ * mpn/generic/sqrt.c: Move alloca calls into where the memory is
+ needed. Simplify.
+
+ * gmp.h: (_PROTO): New macro.
+ Add many function declarations; use _PROTO macro in all declarations.
+
+ * mpf/*.c: Prepend mpn calls with __.
+
+Wed May 18 20:57:06 1994 Torbjorn Granlund (tege@adder.cygnus.com)
+
+ * mpf/*ui*.c: Make ui argument `long' for consistency with mpz
+ functions.
+
+ * mpf/div_ui.c: Simplify.
+
+Tue May 17 01:05:14 1994 Torbjorn Granlund (tege@adder.cygnus.com)
+
+ * mpz/*.c: Prepend mpn calls with __.
+
+ * mpz/mul_ui.c: Use mpn_mul_1.
+
+Mon May 16 17:19:41 1994 Torbjorn Granlund (tege@adder.cygnus.com)
+
+ * mpn/i386/mul_1.S: Use C_GLOBAL_NAME.
+ * mpn/i386/mul_1.S, mpn/i386/addmul_1.S, mpn/i386/submul_1.S:
+ Nuke use of LAB.
+
+Sat May 14 14:21:02 1994 Torbjorn Granlund (tege@adder.cygnus.com)
+
+ * gmp-impl.h: Don't define abort here.
+
+ * mpz/pow_ui.c: Increase temporary allocation.
+ * mpz/ui_pow_ui.c: Likewise.
+
+ * gmp.h (mpz_add_1, mpz_sub_1): Don't call memcpy.
+
+ * All Makefile.in: Delete spurious -I arguments.
+ Update dependencies.
+
+ * mpz/popcount.c: New file.
+ * mpz/hamdist.c: New file.
+
+ * All configure: Latest version from Cygnus.
+
+ * mpq/Makefile.in: New file.
+ * mpq/configure.in: New file.
+ * Makefile.in, configure.in: Enable compilation of mpq.
+
+ * mpq/set_z.c: Fix typos.
+ * mpq/canonicalize.c: Fix typos.
+ * mpq/cmp_ui.c: Fix typos.
+
+ * mpf/add_ui.c: Read U->D into UP always. Delete spurious MPN_COPY.
+ * mpf/sub_ui.c: Likewise.
+
+ * gmp-impl.h: Don't redefine alloca.
+
+ * COPYING.LIB: Renamed from COPYING.
+
+Wed May 11 01:45:44 1994 Torbjorn Granlund (tege@adder.cygnus.com)
+
+ * mpz/powm_ui.c: When shifting E left by C+1, handle out-of-range
+ shift counts. Fix typo when testing negative_result.
+ * mpz/powm.c: Likewise.
+
+ * mpz/ui_pow_ui.c: New file.
+ * mpz/Makefile.in: Update.
+
+ * mpz/pow_ui.c: Call __mpn_mul_n instead of __mpn_mul when possible.
+
+ * mpz/div.c, mpz/div_ui.c, mpz/gcd.c: Prefix external mpn calls.
+ * mpz/gcd.c: Declare mpn_xmod.
+
+ * mpz/powm.c: Major changes to accommodate changed mpn semantics.
+ * mpz/powm_ui.c: Update from mpz/powm.c.
+
+ * mpz/tests/tst-io.c: New file.
+ * mpz/tests/tst-logic: New file.
+ * mpz/tests/Makefile.in: Update.
+
+ * mpz/inp_str.c: Get base right when checking for first digit.
+ * mpz/inp_str.c: Allocate more space for DEST when needed.
+
+ * mpz/com.c: Use mpn_add_1 and mpn_sub_1.
+ * mpz/and.c, mpz/ior.c: Likewise. Simplify somewhat.
+
+ * mpz/add_ui.c: Use mpn_add_1 and mpn_sub_1.
+ Rename parameters to be consistent with mpz/sub_ui.
+ General simplifications.
+ * mpz/sub_ui.x: Likewise.
+
+Tue Aug 10 19:41:16 1993 Torbjorn Granlund (tege@prudens.matematik.su.se)
+
+ * mpf: New directory.
+ * mpf/*.c: Merge basic set of mpf functions.
+
+ * Many logs missing...
+
+Sun Apr 25 18:40:26 1993 Torbjorn Granlund (tege@pde.nada.kth.se)
+
+ * memory.c: Use #if instead of #ifdef for __STDC__ for consistency.
+ * bsd/xtom.c: Likewise.
+
+ * mpz/div.c: Remove free_me and free_me_size and their usage.
+ Use mpn_divmod for division; corresponding changes in return value
+ convention.
+ * mpz/powm.c: `carry_digit' => `carry_limb'.
+ * bsd/sdiv.c: Clarify comment.
+
+Sun Apr 25 00:31:28 1993 Torbjorn Granlund (tege@pde.nada.kth.se)
+
+ * longlong.h (__udiv_qrnnd_c): Make all variables `unsigned long int'.
+
+Sat Apr 24 16:23:33 1993 Torbjorn Granlund (tege@pde.nada.kth.se)
+
+ * longlong.h (__udiv_qrnnd_c): Make all variables `unsigned long int'.
+
+ * gmp-impl.h: #define ABS.
+ * (Many files): Use ABS instead of abs.
+
+ * mpn/generic/sqrt.c, mpz/clrbit.c, mpz/get_si.c, mpz/mod_2exp.c,
+ mpz/pow_ui.c: Cast 1 to mp_limb before shifting.
+
+ * mpz/perfsqr.c: Use #if, not plain if for exclusion of code for
+ non-32-bit machines.
+
+Tue Apr 20 13:13:58 1993 Torbjorn Granlund (tege@du.nada.kth.se)
+
+ * mpn/generic/sqrt.c: Handle overflow for intermediate quotients by
+ rounding them down to fit.
+
+ * mpz/perfsqr.c (PP): Define in hexadecimal to avoid GCC warnings.
+
+ * mpz/inp_str.c (char_ok_for_base): New function.
+ (mpz_inp_str): Use it.
+
+Sun Mar 28 21:54:06 1993 Torbjorn Granlund (tege@cyklop.nada.kth.se)
+
+ * mpz/inp_raw.c: Allocate x_index, not xsize limbs.
+
+Mon Mar 15 11:44:06 1993 Torbjorn Granlund (tege@pde.nada.kth.se)
+
+ * mpz/pprime.c: Declare param `const'.
+ * gmp.h: Add declarations for mpz_com.
+
+Thu Feb 18 14:10:34 1993 Torbjorn Granlund (tege@pde.nada.kth.se)
+
+ * mpq/add.c, mpq/sub.c: Call mpz_clear for t.
+
+Fri Feb 12 20:27:34 1993 Torbjorn Granlund (tege@cyklop.nada.kth.se)
+
+ * mpz/inp_str.c: Recog minus sign as first character.
+
+Wed Feb 3 01:36:02 1993 Torbjorn Granlund (tege@cyklop.nada.kth.se)
+
+ * mpz/iset.c: Handle 0 size.
+
+Tue Feb 2 13:03:33 1993 Torbjorn Granlund (tege@cyklop.nada.kth.se)
+
+ * mpz/mod_ui.c: Initialize dividend_size before it's used.
+
+Mon Jan 4 09:11:15 1993 Torbjorn Granlund (tege@sics.se)
+
+ * bsd/itom.c: Declare param explicitly 'signed'.
+ * bsd/sdiv.c: Likewise.
+
+ * mpq/cmp.c: Remove unused variable tmp_size.
+ * mpz/powm_ui.c: Fix typo in esize==0 if stmt.
+ * mpz/powm.c: Likewise.
+
+Sun Nov 29 01:16:11 1992 Torbjorn Granlund (tege@sics.se)
+
+ * mpn/generic/divmod_1.c (mpn_divmod_1): Handle
+ divisor_limb == 1 << (BITS_PER_MP_LIMB - 1)
+ specifically.
+
+ * Reorganize sources. New directories mpn, mpn/MACH, mpn/generic,
+ mpz, mpq, bsd. Use full file name for change logs hereafter.
+
+Wed Oct 28 17:40:04 1992 Torbjorn Granlund (tege@jupiter.sics.se)
+
+ * longlong.h (__hppa umul_ppmm): Fix typos.
+ (__hppa sub_ddmmss): Swap input arguments.
+
+ * mpz_perfsqr.c (mpz_perfect_square_p): Avoid , before } in
+ initializator.
+
+Sun Oct 25 20:30:06 1992 Torbjorn Granlund (tege@jupiter.sics.se)
+
+ * mpz_pprime.c (mpz_probab_prime_p): Handle numbers <= 3
+ specifically (used to consider all negative numbers prime).
+
+ * mpz_powm_ui: `carry_digit' => `carry_limb'.
+
+ * sdiv: Handle zero dividend specifically. Replace most code in
+ this function with a call to mpn_divmod_1.
+
+Fri Sep 11 22:15:55 1992 Torbjorn Granlund (tege@tarrega.sics.se)
+
+ * mpq_clear: Don't free the MP_RAT!
+
+ * mpn_lshift, mpn_rshift, mpn_rshiftci: Remove `long' from 4:th arg.
+
+Thu Sep 3 01:47:07 1992 Torbjorn Granlund (tege@jupiter.sics.se)
+
+ * All files: Remove leading _ from mpn function names.
+
+Wed Sep 2 22:21:16 1992 Torbjorn Granlund (tege@jupiter.sics.se)
+
+ Fix from Jan-Hein Buhrman:
+ * mpz_mdiv.c, mpz_mmod.c, mpz_mdm.c: Make them work as documented.
+
+ * mpz_mmod.c, mpz_mdm.c: Move decl of TEMP_DIVISOR to reflect its
+ life.
+
+Sun Aug 30 18:37:15 1992 Torbjorn Granlund (tege@jupiter.sics.se)
+
+ * _mpz_get_str: Use mpz_sizeinbase for computing out_len.
+ * _mpz_get_str: Don't remove leading zeros. Abort if there are some.
+
+Wed Mar 4 17:56:56 1992 Torbjorn Granlund (tege@zevs.sics.se)
+
+ * gmp.h: Change definition of MP_INT to make the & before params
+ optional. Use typedef to define it.
+ * mp.h: Use typedef to define MINT.
+
+Tue Feb 18 14:38:39 1992 Torbjorn Granlund (tege@zevs.sics.se)
+
+ longlong.h (hppa umul_ppmm): Add missing semicolon. Declare type
+ of __w1 and __w0.
+
+Fri Feb 14 21:33:21 1992 Torbjorn Granlund (tege@zevs.sics.se)
+
+ * longlong.h: Make default count_leading_zeros work for machines >
+ 32 bits. Prepend `__' before local variables to avoid conflicts
+ with users' variables.
+
+ * mpn_dm_1.c: Remove udiv_qrnnd_preinv ...
+ * gmp-impl.h: ... and put it here.
+ * mpn_mod_1: Use udiv_qrnnd_preinv if it is faster than udiv_qrnnd.
+
+Tue Feb 11 17:20:12 1992 Torbjorn Granlund (tege@zevs.sics.se)
+
+ * mpn_mul: Enhance base case by handling small multiplicands.
+ * mpn_dm_1.c: Revert last change.
+
+Mon Feb 10 11:55:15 1992 Torbjorn Granlund (tege@zevs.sics.se)
+
+ * mpn_dm_1.c: Don't define udiv_qrnnd_preinv unless needed.
+
+Fri Feb 7 16:26:16 1992 Torbjorn Granlund (tege@zevs.sics.se)
+
+ * mpn_mul: Replace code for base case.
+
+Thu Feb 6 15:10:42 1992 Torbjorn Granlund (tege@zevs.sics.se)
+
+ * mpn_dm_1.c (_mpn_divmod_1): Add code for avoiding division by
+ pre-inverting divisor.
+
+Sun Feb 2 11:10:25 1992 Torbjorn Granlund (tege@zevs.sics.se)
+
+ * longlong.h: Make __LLDEBUG__ work differently.
+ (_IBMR2): Reinsert old code.
+
+Sat Feb 1 16:43:00 1992 Torbjorn Granlund (tege@zevs.sics.se)
+
+ * longlong.h (#ifdef _IBMR2): Replace udiv_qrnnd with new code
+ using floating point operations. Don't define
+ UDIV_NEEDS_NORMALIZATION any longer.
+
+Fri Jan 31 15:09:13 1992 Torbjorn Granlund (tege@zevs.sics.se)
+
+ * longlong.h: Define UMUL_TIME and UDIV_TIME for most machines.
+ * longlong.h (#ifdef __hppa): Define umul_ppmm.
+
+Wed Jan 29 16:41:36 1992 Torbjorn Granlund (tege@zevs.sics.se)
+
+ * mpn_cmp: Only one length parameter, assume operand lengths are
+ the same. Don't require normalization.
+ * mpq_cmp, mpz_add, mpz_sub, mpz_gcd, mpn_mul, mpn_sqrt: Change for
+ new mpn_cmp definition.
+
+Tue Jan 28 11:18:55 1992 Torbjorn Granlund (tege@zevs.sics.se)
+
+ * _mpz_get_str: Fix typo in comment.
+
+Mon Jan 27 09:44:16 1992 Torbjorn Granlund (tege@zevs.sics.se)
+
+ * Makefile.in: Add new files.
+
+ * mpn_dm_1.c: New file with function _mpn_divmod_1.
+ * mpz_dm_ui.c (mpz_divmod_ui): Use _mpn_divmod_1.
+ * mpz_div_ui: Likewise.
+
+ * mpn_mod_1.c: New file with function _mpn_mod_1.
+ * mpz_mod_ui: Use _mpn_mod_1.
+
+Thu Jan 23 18:54:09 1992 Torbjorn Granlund (tege@zevs.sics.se)
+
+ Bug found by Paul Zimmermann (zimmermann@inria.inria.fr):
+ * mpz_div_ui.c (mpz_div_ui), mpz_dm_ui.c (mpz_divmod_ui):
+ Handle dividend == 0.
+
+Wed Jan 22 12:02:26 1992 Torbjorn Granlund (tege@zevs.sics.se)
+
+ * mpz_pprime.c: Use "" for #include.
+
+Sun Jan 19 13:36:55 1992 Torbjorn Granlund (tege@zevs.sics.se)
+
+ * mpn_rshiftci.c (header): Correct comment.
+
+Wed Jan 15 18:56:04 1992 Torbjorn Granlund (tege@zevs.sics.se)
+
+ * mpz_powm, mpz_powm_ui (if (bsize > msize)): Do alloca (bsize + 1)
+ to make space for ignored quotient at the end. (The quotient might
+ always be an extra limb.)
+
+Tue Jan 14 21:28:48 1992 Torbjorn Granlund (tege@zevs.sics.se)
+
+ * mpz_powm_ui: Fix comment.
+ * mpz_powm: Likewise.
+
+Mon Jan 13 18:16:25 1992 Torbjorn Granlund (tege@zevs.sics.se)
+
+ * tests/Makefile.in: Prepend $(TEST_PREFIX) to Makefile target.
+
+Sun Jan 12 13:54:28 1992 Torbjorn Granlund (tege@zevs.sics.se)
+
+ Fixes from Kazumaro Aoki:
+ * mpz_out_raw: Take abs of size to handle negative values.
+ * mpz_inp_raw: Reallocate before reading ptr from X.
+ * mpz_inp_raw: Store, don't read, size to x->size.
+
+Tue Jan 7 17:50:25 1992 Torbjorn Granlund (tege@zevs.sics.se)
+
+ * gmp.h, mp.h: Remove parameter names from prototypes.
+
+Sun Dec 15 00:09:36 1991 Torbjorn Granlund (tege@zevs.sics.se)
+
+ * tests/Makefile.in: Prepend "./" to file names when executing
+ tests.
+
+ * Makefile.in: Fix many problems.
+
+Sat Dec 14 01:00:02 1991 Torbjorn Granlund (tege@zevs.sics.se)
+
+ * mpn_sqrt.c: New file with _mpn_sqrt.
+ * mpz_sqrt, mpz_sqrtrem, mpz_perfect_square_p: Use _mpn_sqrt.
+ * msqrt.c: Delete. Create from mpz_sqrtrem.c in Makefile.in.
+ * mpz_do_sqrt.c: Delete.
+ * Makefile.in: Update to reflect these changes.
+
+ * Makefile.in, configure, configure.subr: New files
+ (from bothner@cygnus.com).
+ * dist-Makefile: Delete.
+
+ * mpz_fac_ui: Fix comment.
+
+ * mpz_random2: Rewrite a bit to make it possible for the most
+ significant limb to be == 1.
+
+ * mpz_pprime.c (mpz_probab_prime_p): Remove \t\n.
+
+Fri Dec 13 23:10:02 1991 Torbjorn Granlund (tege@zevs.sics.se)
+
+ * mpz_do_sqrt: Simplify special case for U == 0.
+ * m*sqrt*.c, mpz_perfsqr.c (mpz_perfect_square_p):
+ Rename _mpz_impl_sqrt to _mpz_do_sqrt.
+
+Fri Dec 13 12:52:28 1991 Torbjorn Granlund (tege@zevs.sics.se)
+
+ * gmp-impl.h (MPZ_TMP_INIT): Cast to the right type.
+
+Thu Dec 12 22:17:29 1991 Torbjorn Granlund (tege@zevs.sics.se)
+
+ * mpn_add, mpn_sub, mpn_mul, mpn_div: Change type of several
+ variables to mp_size.
+
+Wed Dec 11 22:00:34 1991 Torbjorn Granlund (tege@zevs.sics.se)
+
+ * mpn_rshift.c: Fix header comments.
+
+Mon Dec 9 17:46:10 1991 Torbjorn Granlund (tege@zevs.sics.se)
+
+ Released 1.2.
+
+ * gmp-impl.h (MPZ_TMP_INIT): Cast alloca return value.
+
+ * dist-Makefile: Add missing dependency for cre-mparam.
+
+ * mpz_mdiv.c, mpz_mmod.c, mpz_mdm.c, mpz_mdiv_ui.c,
+ mpz_mmod_ui.c, mpz_mdm_ui.c: Remove obsolete comment.
+
+ * dist-Makefile (clean): clean in tests subdir too.
+ * tests/Makefile: Define default values for ROOT and SUB.
+
+ * longlong.h (__a29k__ udiv_qrnnd): Change "q" to "1" for operand
+ 2 constraint.
+
+Mon Nov 11 00:06:05 1991 Torbjorn Granlund (tege@zevs.sics.se)
+
+ * mpz_sizeinb.c (mpz_sizeinbase): Special code for size == 0.
+
+Sat Nov 9 23:47:38 1991 Torbjorn Granlund (tege@zevs.sics.se)
+
+ Released 1.1.94.
+
+ * dist-Makefile, Makefile, tests/Makefile: Merge tests into
+ distribution.
+
+Fri Nov 8 22:57:19 1991 Torbjorn Granlund (tege@zevs.sics.se)
+
+ * gmp.h: Don't use keyword `signed' for non-ANSI compilers.
+
+Thu Nov 7 22:06:46 1991 Torbjorn Granlund (tege@zevs.sics.se)
+
+ * longlong.h: Cosmetic changes to keep it identical to gcc2 version
+ of longlong.h.
+ * longlong.h (__ibm032__): Fix operand order for add_ssaaaa and
+ sub_ddmmss.
+
+Mon Nov 4 00:36:46 1991 Torbjorn Granlund (tege@zevs.sics.se)
+
+ * mpn_mul: Fix indentation.
+
+ * mpz_do_sqrt: Don't assume 32 bit limbs (had constant
+ 4294967296.0).
+ * mpz_do_sqrt: Handle overflow in conversion from double returned
+ by SQRT to mp_limb.
+
+ * gmp.h: Add missing function definitions.
+
+Sun Nov 3 18:25:25 1991 Torbjorn Granlund (tege@zevs.sics.se)
+
+ * mpz_pow_ui: Change type of `i' to int.
+
+ * ChangeLog: Add change log entry.
+ * ChangeLog: Add change log entry.
+ * ChangeLog: Add change log entry.
+ * ChangeLog: Add change log entry.
+ * ChangeLog: Add change log entry.
+ * ChangeLog: Add change log entry.
+ * ChangeLog: Add change log entry.
+ * ChangeLog: Add change log entry.
+Stack overflow.
+
+ * mpz_pow_ui.c: Fix typo in comment.
+
+ * dist-Makefile: Create rpow.c from mpz_powm_ui.c.
+ * mpz_powm_ui.c: Add code for rpow.
+ * rpow.c: Delete this file. The rpow function is now implemented
+ in mpz_powm_ui.c.
+
+ * mpz_fac_ui.c: New file.
+ * gmp.h, dist-Makefile: Add stuff for mpz_fac_ui.
+
+ Bug found by John Amanatides (amana@sasquatch.cs.yorku.ca):
+ * mpz_powm_ui, mpz_powm: Call _mpn_mul in the right way, with
+ the first argument not smaller than the second.
+
+Tue Oct 29 13:56:55 1991 Torbjorn Granlund (tege@zevs.sics.se)
+
+ * cre-conv-tab.c (main), cre-mparam.c (main): Fix typo in output
+ header text.
+
+Mon Oct 28 00:35:29 1991 Torbjorn Granlund (tege@zevs.sics.se)
+
+ * mpz_random2: Handle size == 0.
+
+ * gmp-impl.h (struct __mp_bases): Rename chars_per_limb_exactly to
+ chars_per_bit_exactly, and change its definition.
+ * cre-conv-tab.c (main): Output field according to its new
+ definition.
+ * mpz_out_str, _mpz_get_str, mpz_sizeinb, mout:
+ Use chars_per_bit_exactly.
+
+ * mpz_random2: Change the loop termination condition in order to
+ get a large most significant limb with higher probability.
+
+ * gmp.h: Add declaration of new mpz_random2 and mpz_get_si.
+ * mpz_get_si.c: New file.
+ * dist-Makefile: Add mpz_random2 and mpz_get_si.
+
+ * mpz_sizeinb.c (mpz_sizeinbase): Special code for base being a
+ power of 2, giving exact result.
+
+ * mpn_mul: Fix MPN_MUL_VERIFY in various ways.
+ * mpn_mul: New macro KARATSUBA_THRESHOLD.
+ * mpn_mul (karatsuba's algorithm): Don't write intermediate results
+ to prodp, use temporary pp instead. (Intermediate results can be
+ larger than the final result, possibly writing into hyperspace.)
+ * mpn_mul: Make smarter choice between Karatsuba's algorithm and the
+ shortcut algorithm.
+ * mpn_mul: Fix typo, cy instead of xcy. Unify carry handling code.
+
+Sun Oct 27 19:57:32 1991 Torbjorn Granlund (tege@zevs.sics.se)
+
+ * mpn_mul: In non-classical case, choose Karatsuba's algorithm only
+ when usize > 1.5 vsize.
+
+ * mpn_mul: Break between classical and Karatsuba's algorithm at
+ KARATSUBA_THRESHOLD, if defined. Default to 8.
+
+ * mpn_div: Kludge to fix stray memory read.
+
+Sat Oct 26 20:06:14 1991 Torbjorn Granlund (tege@zevs.sics.se)
+
+ * mpz_gcdext: Handle a = b = 0. Remove memory leakage by calling
+ mpz_clear for all temporary variables.
+
+ * mpz_gcd: Reduce w_bcnt in _mpn_lshift call to hold that
+ function's argument constraints. Compute wsize correctly.
+
+ * mpz_gcd: Fix typo in comment.
+
+ * memory.c (_mp_default_allocate, _mp_default_reallocate): Call
+ abort if allocation fails, don't just exit.
+
+Fri Oct 25 22:17:20 1991 Torbjorn Granlund (tege@zevs.sics.se)
+
+ * mpz_random2.c: New file.
+
+Thu Oct 17 18:06:42 1991 Torbjorn Granlund (tege@zevs.sics.se)
+
+ Bugs found by Pierre-Joseph Gailly (pjg@sunbim.be):
+ * mpq_cmp: Take sign into account, don't just compare the
+ magnitudes.
+ * mpq_cmp: Call _mpn_mul in the right way, with the first argument
+ not smaller than the second.
+
+Wed Oct 16 19:27:32 1991 Torbjorn Granlund (tege@zevs.sics.se)
+
+ * mpz_random: Ensure the result is normalized.
+
+Tue Oct 15 14:55:13 1991 Torbjorn Granlund (tege@zevs.sics.se)
+
+ * mpz_clrbit: Support non-ANSI compilers.
+
+Wed Oct 9 18:03:28 1991 Torbjorn Granlund (tege@zevs.sics.se)
+
+ * longlong.h (68k add_ssaaaa, sub_ddmmss): Generalize constraints.
+
+Tue Oct 8 17:42:59 1991 Torbjorn Granlund (tege@zevs.sics.se)
+
+ * mpz_mdm_ui: Add comments.
+
+ * mpz_mdiv: Use MPZ_TMP_INIT instead of mpz_init.
+ * mpz_init_ui: Change spacing and header comment.
+
+Thu Oct 3 18:36:13 1991 Torbjorn Granlund (tege@zevs.sics.se)
+
+ * dist-Makefile: Prepend `./' before some filenames.
+
+Sun Sep 29 14:02:11 1991 Torbjorn Granlund (tege@zevs.sics.se)
+
+ Released 1.1 (public).
+
+ * mpz_com: New name of mpz_not.
+ * dist-Makefile: Change mpz_not to mpz_com.
+
+Tue Sep 24 12:44:11 1991 Torbjorn Granlund (tege@zevs.sics.se)
+
+ * longlong.h: Fix header comment.
+
+Mon Sep 9 15:16:24 1991 Torbjorn Granlund (tege@zevs.sics.se)
+
+ Released 1.0.92.
+
+ * mpn_mul.c (_mpn_mul): Handle leading zero limbs in non-Karatsuba
+ case.
+
+ * longlong.h (m68000 umul_ppmm): Clobber one register less by
+ slightly rearranging the code.
+
+Sun Sep 1 18:53:25 1991 Torbjorn Granlund (tege@zevs.sics.se)
+
+ * dist-Makefile (stamp-stddefh): Fix typo.
+
+Sat Aug 31 20:41:31 1991 Torbjorn Granlund (tege@zevs.sics.se)
+
+ Released 1.0.91.
+
+ * mpz_mdiv.c, mpz_mmod.c, mpz_mdm.c, mpz_mdiv_ui.c,
+ mpz_mmod_ui.c, mpz_mdm_ui.c: New files and functions.
+ * gmp.h, gmp.texi: Define the new functions.
+
+Fri Aug 30 08:32:56 1991 Torbjorn Granlund (tege@zevs.sics.se)
+
+ * mpz_gcdext: Compute t argument from the other quantities at the
+ end, of the function, not in the loop. New feature: Allow t to be
+ NULL.
+
+ * mpz_add.c, mpz_sub.c, mpz_mul.c, mpz_powm.c, mpz_gcd.c: Don't
+ include "mp.h". Use type name `MP_INT' always.
+
+ * dist-Makefile, mpz_cmp.c: Merge mcmp.c from mpz_cmp.c.
+
+Wed Aug 28 00:45:11 1991 Torbjorn Granlund (tege@zevs.sics.se)
+
+ * dist-Makefile (documentation): Go via tmp.texi to avoid the
+ creation of gmp.dvi if any errors occur. Make tex read input
+ from /dev/null.
+
+Fri Aug 23 15:58:52 1991 Torbjorn Granlund (tege@zevs.sics.se)
+
+ * longlong.h (68020, i386): Don't define machine-dependent
+ __umulsidi3 (so the default definition is used).
+ * longlong.h (all machines): Cast all operands, sources and
+ destinations, to `unsigned long int'.
+ * longlong.h: Add gmicro support.
+
+Thu Aug 22 00:28:29 1991 Torbjorn Granlund (tege@zevs.sics.se)
+
+ * longlong.h: Rename BITS_PER_LONG to LONG_TYPE_SIZE.
+ * longlong.h (__ibm032__): Define count_leading_zeros and umul_ppmm.
+ * longlong.h: Define UMUL_TIME and UDIV_TIME for some CPUs.
+ * _mpz_get_str.c: Add code to do division by big_base using only
+ umul_qrnnd, if that is faster. Use UMUL_TIME and UDIV_TIME to
+ decide which variant to use.
+
+Wed Aug 21 15:45:23 1991 Torbjorn Granlund (tege@zevs.sics.se)
+
+ * longlong.h (__sparc__ umul_ppmm): Move two insn from end to the
+ nops. (Saves two insn.)
+
+ * longlong.h (__sparc__ umul_ppmm): Rewrite in order to avoid
+ branch, and to permit input/output register overlap.
+
+ * longlong.h (__29k__): Remove duplicated udiv_qrnnd definition.
+ * longlong.h (__29k__ umul_ppmm): Split asm instructions into two
+ asm statements (gives better code if either the upper or lower
+ part of the product is unused.
+
+Tue Aug 20 17:57:59 1991 Torbjorn Granlund (tege@zevs.sics.se)
+
+ * _mpz_get_str.c (outside of functions): Remove
+ num_to_ascii_lower_case and num_to_ascii_upper_case. Use string
+ constants in the function instead.
+
+Mon Aug 19 00:37:42 1991 Torbjorn Granlund (tege@zevs.sics.se)
+
+ * cre-conv-tab.c (main): Output table in hex. Output 4 fields, not
+ 3, for components 0 and 1.
+
+ * gmp.h: Add declaration of mpq_neg.
+
+ Released 1.0beta.13.
+
+ * _mpz_set_str.c (mpz_set_str): Cast EOF and SPC to char before
+ comparing to enum literals SPC and EOF. This makes the code work
+ for compilers where `char' is unsigned. (Bug found by Brian
+ Beuning).
+
+ Released 1.0beta.12.
+
+ * mpz_mod_ui: Remove references to quot. Remove quot_ptr, quot_size
+ declarations and assignment code.
+
+Sun Aug 18 14:44:26 1991 Torbjorn Granlund (tege@zevs.sics.se)
+
+ * mpz_mod_ui: Handle dividend < 0.
+
+ Released 1.0beta.11.
+
+ * mpz_dm_ui, mpz_div_ui, mpz_mod_ui, sdiv: Make them share the same
+ general structure, variable names, etc.
+
+ * sdiv: Un-normalize the remainder in n1 before it is negated.
+
+ * longlong.h: Mention UDIV_NEEDS_NORMALIZATION in description of
+ udiv_qrnnd.
+
+ * mpz_dm_ui.c (mpz_divmod_ui), mpz_div_ui.c (mpz_div_ui): Increment
+ the quotient size if the dividend size is incremented. (Bug found
+ by Brian Beuning.)
+
+ * mpz_mod_ui: Shift back the remainder, if UDIV_NEEDS_NORMALIZATION.
+ (Bug found by Brian Beuning.)
+
+ * mpz_mod_ui: Replace "digit" by "limb".
+
+ * mpz_perfsqr.c (mpz_perfect_square_p): Disable second test case
+ for non-32-bit machines (PP is hardwired for such machines).
+ * mpz_perfsqr.c (outside of functions): Define PP value with an L.
+
+ * mpn_mul.c (_mpn_mul): Add verification code that is activated if
+ DEBUG is defined. Replace "digit" by "limb".
+ * mpn_mul.c (_mpn_mul: Karatsuba's algorithm: 4.): Normalize temp
+ after the addition.
+ * mpn_mul.c (_mpn_mul: Karatsuba's algorithm: 1.): Compare u0_size
+ and v0_size, and according to the result, swap arguments in
+ recursive call. (Don't violate mpn_mul's own argument
+ constraints.)
+
+Fri Aug 16 13:47:12 1991 Torbjorn Granlund (tege@zevs.sics.se)
+
+ Released 1.0beta.10.
+
+ * longlong.h (IBMR2): Add udiv_qrnnd.
+
+ * mpz_perfsqr: Remove unused variables.
+
+ * mpz_and (case for different signs): Initialize loop variable i!
+
+ * dist-Makefile: Update automatically generated dependencies.
+ * dist-Makefile (madd.c, msub.c, pow.c, mult.c, gcd.c): Add mp.h,
+ etc to dependency file lists.
+
+ * longlong.h (add_ssaaaa, sub_ddmmss [C default versions]): Make __x
+ `unsigned long int'.
+ * longlong.h: Add `int' after `unsigned' and `long' everywhere.
+
+Wed Aug 14 18:06:48 1991 Torbjorn Granlund (tege@zevs.sics.se)
+
+ * longlong.h: Add ARM, i860 support.
+
+ * mpn_lshift, mpn_rshift, mpn_rshiftci: Rename *_word with *_limb.
+
+Tue Aug 13 21:57:43 1991 Torbjorn Granlund (tege@zevs.sics.se)
+
+ * _mpz_get_str.c, _mpz_set_str.c, mpz_sizeinb.c (mpz_sizeinbase),
+ mpz_out_str.c, mout.c: Remove declaration of __mp_bases.
+ * gmp-impl.h: Put it here, and make it `const'.
+ * cre-conv-tab.c (main): Make struct __mp_bases `const'.
+
+Mon Aug 12 17:11:46 1991 Torbjorn Granlund (tege@zevs.sics.se)
+
+ * cre-conv-tab.c (main): Use %lu in printf for long ints.
+
+ * dist-Makefile: Fix cre-* dependencies.
+
+ * cre-conv-tab.c (main): Output field big_base_inverted.
+
+ * gmp-impl.h (struct bases): New field big_base_inverted.
+ * gmp-impl.h (struct bases): Change type of chars_per_limb_exactly
+ to float (in order to keep the structure smaller).
+
+ * mp.h, gmp.h: Change names of macros for avoiding multiple
+ includes.
+
+Fri Aug 9 18:01:36 1991 Torbjorn Granlund (tege@zevs.sics.se)
+
+ * _mpz_get_str: Only shift limb array if normalization_steps != 0
+ (optimization).
+
+ * longlong.h (sparc umul_ppmm): Use __asm__, not asm.
+ * longlong.h (IBMR2 umul_ppmm): Refer to __m0 and __m1, not to m0
+ and m1 (overlap between output and input operands did not work).
+ * longlong.h: Add VAX, ROMP and HP-PA support.
+ * longlong.h: Sort the machine dependent code in alphabetical order
+ on the CPU name.
+ * longlong.h: Hack comments.
+
+Thu Aug 8 14:13:36 1991 Torbjorn Granlund (tege@zevs.sics.se)
+
+ Released 1.0beta.9.
+
+ * longlong.h: Define BITS_PER_LONG to 32 if it's not already
+ defined.
+ * Define __BITS4 to BITS_PER_LONG / 4.
+ * Don't assume 32 bit word size in "count_leading_zeros" C macro.
+ Use __BITS4 and BITS_PER_LONG instead.
+
+ * longlong.h: Don't #undef internal macros (reverse change of Aug 3).
+
+ * longlong.h (68k): Define add_ssaaaa sub_ddmmss, and umul_ppmm
+ even for plain mc68000.
+
+ * mpq_div: Flip the sign of the numerator *and* denominator of the
+ result if the intermediate denominator is negative.
+
+ * mpz_and.c, mpz_ior.c: Use MPN_COPY for all copying operations.
+
+ * mpz_and.c: Compute the result size more conservatively.
+ * mpz_ior.c: Likewise.
+
+ * mpz_realloc: Never allocate zero space even if NEW_SIZE == 0.
+
+ * dist-Makefile: Remove madd.c, msub.c, pow.c, mult.c, gcd.c from
+ BSDMP_SRCS.
+
+ * dist-Makefile: Create mult.c from mpz_mul.c.
+ * mult.c: Delete this file.
+
+ * _mpz_set_str: Normalize the result (for bases 2, 4, 8... it was
+ not done properly if the input string had many leading zeros).
+
+Sun Aug 4 16:54:14 1991 Torbjorn Granlund (tege@zevs.sics.se)
+
+ * dist-Makefile (gcd.c, pow.c, madd.c, msub.c): Make these targets
+ work with VPATH and GNU MP.
+
+ * mpz_gcd: Don't call mpz_set; inline its functionality.
+
+ * mpq_mul, mpq_div: Fix several serious typos.
+
+ * mpz_dmincl, mpz_div: Don't normalize the quotient if it's already
+ zero.
+
+ * mpq_neg.c: New file.
+
+ * dist-Makefile: Remove obsolete dependencies.
+
+ * mpz_sub: Fix typo.
+
+ Bugs found by Pierre-Joseph Gailly (pjg@sunbim.be):
+ * mpq_mul, mpq_div: Initialize tmp[12] variables even when the gcd
+ is just 1.
+ * mpz_gcd: Handle gcd(0,v) and gcd(u,0) in special cases.
+
+Sat Aug 3 23:45:28 1991 Torbjorn Granlund (tege@zevs.sics.se)
+
+ * longlong.h: Clean up comments.
+ * longlong.h: #undef internal macros.
+
+Fri Aug 2 18:29:11 1991 Torbjorn Granlund (tege@zevs.sics.se)
+
+ * mpq_set_si, mpq_set_ui: Canonicalize 0/x to 0/1.
+ * mpq_set_si, mpq_set_ui: Cosmetic formatting changes.
+
+ * mpz_dmincl.c: Normalize the remainder before shifting it back.
+
+ * mpz_dm_ui.c (mpz_divmod_ui): Handle rem == dividend.
+
+ * mpn_div.c: Fix comment.
+
+ * mpz_add.c, mpz_sub.c: Use __MP_INT (not MP_INT) for intermediate
+ type, in order to work for both GNU and Berkeley functions.
+
+ * dist-Makefile: Create gcd.c from mpz_gcd.c, pow.c from mpz_powm,
+ madd.c from mpz_add.c, msub.c from mpz_sub.c.
+ respectively.
+ * pow.c, gcd.c, mpz_powmincl.c, madd.c, msub.c: Remove these.
+ * mpz_powm.c, mpz_gcd.c, mpz_add.c, mpz_sub.c: #ifdef for GNU and
+ Berkeley function name variants.
+ * dist-Makefile: Add created files to "clean" target.
+
+Tue Jul 16 15:19:46 1991 Torbjorn Granlund (tege@zevs.sics.se)
+
+ * mpq_get_den: No need for absolute value of the size, the
+ denominator is always positive.
+
+ * mpz_get_ui: If the operand is zero, return zero. Don't read the
+ limb array!
+
+ * mpz_dmincl.c: Don't ignore the return value from _mpn_rshift, it
+ is the size of the remainder.
+
+Mon Jul 15 11:08:05 1991 Torbjorn Granlund (tege@zevs.sics.se)
+
+ * Several files: Remove unused variables and functions.
+
+ * gmp-impl.h: Declare _mpz_impl_sqrt.
+
+ * mpz_dm_ui (mpz_divmod_ui), sdiv: Shift back the remainder if
+ UDIV_NEEDS_NORMALIZATION. (Fix from Brian Beuning.)
+
+ * mpz_dm_ui.c, sdiv: Replace *digit with *limb.
+
+ * mpz_ior: Add missing else statement in -OP1 | -OP2 case.
+ * mpz_ior: Add missing else statement in OP1 | -OP2 case.
+ * mpz_ior: Swap also OP1 and OP2 pointers in -OP1 & OP2 case.
+ * mpz_ior: Duplicate _mpz_realloc code.
+
+ * mpz_and: Add missing else statement in -OP1 & -OP2 case.
+ * mpz_and: Rewrite OP1 & -OP2 case.
+ * mpz_and: Swap also OP1 and OP2 pointers in -OP1 & OP2 case.
+
+ * mpz_gcdext: Loop in d1.size (not b->size). (Fix from Brian
+ Beuning.)
+
+ * mpz_perfsqr: Fix argument order in _mpz_impl_sqrt call. (Fix from
+ Brian Beuning.)
+
+Fri Jul 12 17:10:33 1991 Torbjorn Granlund (tege@zevs.sics.se)
+
+ * mpq_set.c, mpq_set_ui.c, mpq_set_si.c, mpq_inv.c,
+ mpq_get_num.c, mpq_get_den.c, mpq_set_num.c, mpq_set_den.c:
+ New files.
+
+ * mpz_dmincl.c: Remove second re-allocation of rem->d. It
+ was never executed.
+
+ * dist-Makefile: Use `-r' instead of `-x' for test for ranlib (as
+ some unixes' test doesn't have the -r option).
+
+ * *.*: Cast allocated pointers to the appropriate type (makes old C
+ compilers happier).
+
+ * cre-conv-tab.c (main): Divide max_uli by 2 and multiply again
+ after conversion to double. (Kludge for broken C compilers.)
+
+ * dist-Makefile (stamp-stddefh): New target. Test if "stddef.h"
+ exists in the system and creates a minimal one if it does not
+ exist.
+ * cre-stddefh.c: New file.
+ * dist-Makefile: Make libgmp.a and libmp.a depend on stamp-stddefh.
+ * dist-Makefile (clean): Add some more.
+ * gmp.h, mp.h: Unconditionally include "stddef.h".
+
+Thu Jul 11 10:08:21 1991 Torbjorn Granlund (tege@zevs.sics.se)
+
+ * min: Do ungetc of last read character.
+ * min.c: include stdio.h.
+
+ * dist-Makefile: Go via tmp- files for cre* redirection.
+ * dist-Makefile: Add tmp* to "clean" target.
+
+ * dist-Makefile: Use LOCAL_CC for cre*, to simplify cross
+ compilation.
+
+ * gmp.h, mp.h: Don't define NULL here.
+ * gmp-impl.h: Define it here.
+
+Wed Jul 10 14:13:33 1991 Torbjorn Granlund (tege@zevs.sics.se)
+
+ * mpz_mod_2exp: Don't copy too much, overwriting most significant
+ limb.
+
+ * mpz_and, mpz_ior: Don't read op[12]_ptr from op[12] when
+ reallocating res, if op[12]_ptr got their value from alloca.
+
+ * mpz_and, mpz_ior: Clear up comments.
+
+ * cre-mparam.c: Output parameters for `short int' and `int'.
+
+ * mpz_and, mpz_ior: Negate negative op[12]_size in several places.
+
+Tue Jul 9 18:40:30 1991 Torbjorn Granlund (tege@zevs.sics.se)
+
+ * gmp.h, mp.h: Test for _SIZE_T defined before typedef'ing size_t.
+ (Fix for Sun lossage.)
+
+ * gmp.h: Add declaration of mpq_clear.
+
+ * dist-Makefile: Check if "ranlib" exists, before using it.
+ * dist-Makefile: Add mpz_sqrtrem.c and mpz_size.c.
+ * mpz_powm: Fix typo, "pow" instead of "mpz_powm".
+
+Fri Jul 5 19:08:09 1991 Torbjorn Granlund (tege@zevs.sics.se)
+
+ * move: Remove incorrect comment.
+
+ * mpz_free, mpq_free: Rename to *_clear.
+ * dist-Makefile: Likewise.
+ * mpq_add, mpq_sub, mpq_mul, mpq_div: Likewise.
+
+ * mpz_dmincl.c: Don't call "move", inline its functionality.
+
+Thu Jul 4 00:06:39 1991 Torbjorn Granlund (tege@zevs.sics.se)
+
+ * Makefile: Include dist-Makefile. Fix dist target to include
+ dist-Makefile (with the name "Makefile" in the archive).
+
+ * dist-Makefile: New file made from Makefile. Add new mpz_...
+ functions.
+
+ * mpz_powincl.c New file for mpz_powm (Berkeley MP pow)
+ functionality. Avoids code duplication.
+ * pow.c, mpz_powm.c: Include mpz_powincl.c
+
+ * mpz_dmincl.c: New file containing general division code. Avoids
+ code duplication.
+ * mpz_dm.c (mpz_divmod), mpz_mod.c (mpz_mod), mdiv.c (mdiv): Include
+ mpz_dmincl.c.
+
+ * _mpz_get_str: Don't call memmove, unless HAS_MEMMOVE is defined.
+ Instead, write the overlapping memory copying inline.
+
+ * mpz_dm_ui.c: New name for mpz_divmod_ui.c (SysV file name limit).
+
+ * longlong.h: Don't use #elif.
+ * mpz_do_sqrt.c: Likewise.
+
+ * longlong.h: Use __asm__ instead of asm.
+ * longlong.h (sparc udiv_qrnnd): Make it to one string over several
+ lines.
+
+ * longlong.h: Preend __ll_ to B, highpart, and lowpart.
+
+ * longlong.h: Move array t in count_leading_zeros to the new file
+ mp_clz_tab.c. Rename the array __clz_tab.
+ * All files: #ifdef for traditional C compatibility.
+
+Wed Jul 3 11:42:14 1991 Torbjorn Granlund (tege@zevs.sics.se)
+
+ * mpz_and: Initialize res_ptr always (used to be initialized only
+ when reallocating).
+
+ * longlong.h (umul_ppmm [C variant]): Make __ul...__vh
+ `unsigned int', and cast the multiplications. This way
+ compilers more easily can choose cheaper multiplication
+ instructions.
+
+ * mpz_mod_2exp: Handle input argument < modulo argument.
+ * mpz_many: Make sure mp_size is the type for sizes, not int.
+
+ * mpz_init, mpz_init_set*, mpq_init, mpq_add, mpq_sub, mpq_mul,
+ mpq_div: Change mpz_init* interface. Structure pointer as first
+ arg to initialization function, no longer *return* struct.
+
+Sun Jun 30 19:21:44 1991 Torbjorn Granlund (tege@zevs.sics.se)
+
+ * Rename mpz_impl_sqrt.c to mpz_do_sqrt.c to satisfy SysV 14
+ character file name length limit.
+
+ * Most files: Rename MINT to MP_INT. Rename MRAT to MP_RAT.
+ * mpz_sizeinb.c: New file with function mpz_sizeinbase.
+ * mp_bases.c: New file, with array __mp_bases.
+ * _mpz_get_str, _mpz_set_str: Remove struct bases, use extern
+ __mp_bases instead.
+ * mout, mpz_out_str: Use array __mp_bases instead of function
+ _mpz_get_cvtlen.
+ * mpz_get_cvtlen.c: Remove.
+ * Makefile: Update.
+
+Sat Jun 29 21:57:28 1991 Torbjorn Granlund (tege@zevs.sics.se)
+
+ * longlong.h (__sparc8__ umul_ppmm): Insert 3 nop:s for wr delay.
+ * longlong.h (___IBMR2__): Define umul_ppmm, add_ssaaaa, sub_ddmmss.
+ * longlong.h (__sparc__): Don't call .umul; expand asm instead.
+ Don't define __umulsidi3 (i.e. use default definition).
+
+Mon Jun 24 17:37:23 1991 Torbjorn Granlund (tege@amon.sics.se)
+
+ * _mpz_get_str.c (num_to_ascii_lower_case, num_to_ascii_upper_case):
+ Swap 't' and 's'.
+
+Sat Jun 22 13:54:01 1991 Torbjorn Granlund (tege@zevs.sics.se)
+
+ * mpz_gcdext.c: New file.
+
+ * mpn_mul: Handle carry and unexpected operand sizes in last
+ additions/subtractions. (Bug trigged when v1_size == 1.)
+
+ * mp*_alloc*: Rename functions to mp*_init* (files to mp*_iset*.c).
+ * mpq_*: Call mpz_init*.
+
+ * mpz_pow_ui, rpow: Use _mpn_mul instead of mult. Restructure.
+
+Wed May 29 20:32:33 1991 Torbjorn Granlund (tege@zevs.sics.se)
+
+ * mpz_get_cvtlen: multiply by size.
+
+Sun May 26 15:01:15 1991 Torbjorn Granlund (tege@bella.nada.kth.se)
+
+ Alpha-release 0.95.
+
+ Fixes from Doug Lea (dl@g.oswego.edu):
+ * mpz_mul_ui: Loop to MULT_SIZE (not PROD_SIZE). Adjust PROD_SIZE
+ correctly.
+ * mpz_div: Prepend _ to mpz_realloc.
+ * mpz_set_xs, mpz_set_ds: Fix typos in function name.
+
+Sat May 25 22:51:16 1991 Torbjorn Granlund (tege@bella.nada.kth.se)
+
+ * mpz_divmod_ui: New function.
+
+ * sdiv: Make the sign of the remainder correct.
+
+Thu May 23 15:28:24 1991 Torbjorn Granlund (tege@zevs.sics.se)
+
+ * Alpha-release 0.94.
+
+ * mpz_mul_ui: Include longlong.h.
+
+ * mpz_perfsqr.c (mpz_perfect_square_p): Call _mpz_impl_sqrt instead
+ of msqrt.
+
+ * mpz_impl_sqrt: Don't call "move", inline its functionality.
+
+ * mdiv: Use MPN_COPY instead of memcpy.
+ * rpow, mpz_mul, mpz_mod_2exp: Likewise.
+ * pow.c: Likewise, and fix bug in the size arg.
+
+ * xtom: Don't use mpz_alloc, inline needed code instead. Call
+ _mpz_set_str instead of mpz_set_str.
+
+ * Makefile: Make two libraries, libmp.a and libgmp.a.
+
+Thu May 22 20:25:29 1991 Torbjorn Granlund (tege@zevs.sics.se)
+
+ * Add manual to distribution.
+ * Fold in many missing routines described in the manual.
+ * Update Makefile.
+
+Wed May 22 13:48:46 1991 Torbjorn Granlund (tege@zevs.sics.se)
+
+ * mpz_set_str: Make it handle 0x prefix OK.
+
+Sat May 18 18:31:02 1991 Torbjorn Granlund (tege@zevs.sics.se)
+
+ * memory.c (_mp_default_reallocate): Swap OLD_SIZE and NEW_SIZE
+ arguments.
+ * mpz_realloc (_mpz_realloc): Swap in call to _mp_reallocate_func.
+ * min: Likewise.
+
+Thu May 16 20:43:05 1991 Torbjorn Granlund (tege@zevs.sics.se)
+
+ * memory.c: Make the default allocations functions global.
+ * mp_set_fns (mp_set_memory_functions): Make a NULL pointer mean the
+ default memory function.
+
+Wed May 8 20:02:42 1991 Torbjorn Granlund (tege@zevs.sics.se)
+
+ * mpz_div: Handle DEN the same as QUOT correctly by copying DEN->D
+ even if no normalization is needed.
+ * mpz_div: Rework reallocation scheme, to avoid excess copying.
+
+ * mpz_sub_ui.c, mpz_add_ui.c: New files.
+
+ * mpz_cmp.c, mpz_cmp_ui.c: New files.
+
+ * mpz_mul_2exp: Handle zero input MINT correctly.
+
+ * mpn_rshiftci: Don't handle shift counts > BITS_PER_MP_DIGIT.
+
+ * mpz_out_raw.c, mpz_inp_raw.c: New files for raw I/O.
+
+Tue May 7 15:44:58 1991 Torbjorn Granlund (tege@zevs.sics.se)
+
+ * mpn_rshift: Don't handle shift counts > BITS_PER_MP_DIGIT.
+ * mpz_div_2exp: Don't call _mpn_rshift with cnt > BITS_PER_MP_DIGIT.
+ * gcd, mpz_gcd: Likewise.
+
+ * gcd, mpz_gcd: Handle common 2 factors correctly.
+
+Mon May 6 20:22:59 1991 Torbjorn Granlund (tege@zevs.sics.se)
+
+ * gmp-impl.h (MPN_COPY): Inline a loop instead of calling memcpy.
+
+ * gmp-impl.h, mpz_get_str, rpow: Swap DST and SRC in TMPCOPY* macros.
+
+Sun May 5 15:16:23 1991 Torbjorn Granlund (tege@zevs.sics.se)
+
+ * mpz_div: Remove test for QUOT == 0.
+
+Sun Apr 28 20:21:04 1991 Torbjorn Granlund (tege@zevs.sics.se)
+
+ * pow: Don't make MOD normalization in place, as it's a bad idea to
+ write on an input parameter.
+ * pow: Reduce BASE if it's > MOD.
+ * pow, mult, mpz_mul: Simplify realloc code.
+
+Sat Apr 27 21:03:11 1991 Torbjorn Granlund (tege@zevs.sics.se)
+
+ * Install multiplication using Karatsuba's algorithm as default.
+
+Fri Apr 26 01:03:57 1991 Torbjorn Granlund (tege@zevs.sics.se)
+
+ * msqrt: Store in ROOT even for U==0, to make msqrt(0) defined.
+
+ * mpz_div_2exp.c, mpz_mul_2exp.c: New files for shifting right and
+ left, respectively.
+ * gmp.h: Add definitions for mpz_div_2exp and mpz_mul_2exp.
+
+ * mlshift.c, mrshift.c: Remove.
+
+Wed Apr 24 21:39:22 1991 Torbjorn Granlund (tege@zevs.sics.se)
+
+ * mpn_mul: Check only for m2_size == 0 in function header.
+
+Mon Apr 22 01:31:57 1991 Torbjorn Granlund (tege@zevs.sics.se)
+
+ * karatsuba.c: New file for Karatsuba's multiplication algorithm.
+
+ * mpz_random, mpz_init, mpz_mod_2exp: New files and functions.
+
+ * mpn_cmp: Fix header comment.
+
+Sun Apr 21 00:10:44 1991 Torbjorn Granlund (tege@zevs.sics.se)
+
+ * pow: Switch off initial base reduction.
+
+Sat Apr 20 22:06:05 1991 Torbjorn Granlund (tege@echnaton.sics.se)
+
+ * mpz_get_str: Don't generate initial zeros for initial word.
+ Used to write outside of allocated storage.
+
+Mon Apr 15 15:48:08 1991 Torbjorn Granlund (tege@zevs.sics.se)
+
+ * _mpz_realloc: Make it accept size in number of mp_digits.
+ * Most functions: Use new _mpz_realloc definition.
+
+ * mpz_set_str: Remove calls _mp_free_func.
+
+ * Most functions: Rename mpn_* to _mpn_*. Rename mpz_realloc to
+ _mpz_realloc.
+ * mpn_lshift: Redefine _mpn_lshift to only handle small shifts.
+ * mdiv, mpz_div, ...: Changes for new definition of _mpn_lshift.
+ * msqrt, mp*_*shift*: Define cnt as unsigned (for speed).
+
+Sat Apr 6 14:05:16 1991 Torbjorn Granlund (tege@musta.nada.kth.se)
+
+ * mpn_mul: Multiply by the first digit in M2 in a special
+ loop instead of zeroing the product area.
+
+ * mpz_abs.c: New file.
+
+ * sdiv: Implement as mpz_div_si for speed.
+
+ * mpn_add: Make it work for second source operand == 0.
+
+ * msub: Negate the correct operand, i.e. V before swapping, not
+ the smaller of U and V!
+ * madd, msub: Update abs_* when swapping operands, and not after
+ (optimization).
+
+Fri Apr 5 00:19:36 1991 Torbjorn Granlund (tege@black.nada.kth.se)
+
+ * mpn_sub: Make it work for subtrahend == 0.
+
+ * madd, msub: Rewrite to minimize mpn_cmp calls. Ensure
+ mpn_cmp is called with positive sizes (used to be called
+ incorrectly with negative sizes sometimes).
+
+ * msqrt: Make it divide by zero if fed with a negative number.
+ * Remove if statement at end of precision calculation that was
+ never true.
+
+ * itom, mp.h: The argument is of type short, not int.
+
+ * mpz_realloc, gmp.h: Make mpz_realloc return the new digit pointer.
+
+ * mpz_get_str.c, mpz_set_str.c, mpz_new_str.c: Don't include mp.h.
+
+ * Add COPYING to distribution.
+
+ * mpz_div_ui.c, mpz_div_si.c, mpz_new_ui.c, mpz_new_si.c: New files.
+
+Fri Mar 15 00:26:29 1991 Torbjorn Granlund (tege@musta.nada.kth.se)
+
+ * Add Copyleft headers to all files.
+
+ * mpn_mul.c, mpn_div.c: Add header comments.
+ * mult.c, mdiv.c: Update header comments.
+
+ * mpq_add.c, mpq_sub.c, mpq_div.c, mpq_new.c, mpq_new_ui.c,
+ mpq_free.c: New files for rational arithmetics.
+
+ * mpn_lshift.c: Avoid writing the most significant word if it is 0.
+
+ * mdiv.c: Call mpn_lshift for the normalization.
+ * mdiv.c: Remove #ifdefs.
+
+ * Makefile: Add ChangeLog to DISTFILES.
+
+ * mpn_div.c: Make the add_back code work (by removing abort()).
+ * mpn_div.c: Make it return if the quotient is size as compared
+ with the difference NSIZE - DSIZE. If the stored quotient is
+ larger than that, return 1, otherwise 0.
+ * gmp.h: Fix mpn_div declaration.
+ * mdiv.c: Adopt call to mpn_div.
+ * mpz_div.c: New file (developed from mdiv.c).
+
+ * README: Update routine names.
+
+Thu Mar 14 18:45:28 1991 Torbjorn Granlund (tege@musta.nada.kth.se)
+
+ * mpq_mul.c: New file for rational multiplication.
+
+ * gmp.h: Add definitions for rational arithmetics.
+
+ * mpn_div: Kludge the case where the high numerator digit > the
+ high denominator digit. (This code is going to be optimized later.)
+
+ * New files: gmp.h for GNU specific functions, gmp-common.h for
+ definitions common for mp.h and gmp.h.
+
+ * Ensure mp.h just defines what BSD mp.h defines.
+
+ * pow.c: Fix typo for bp allocation.
+
+ * Rename natural number functions to mpn_*, integer functions to
+ mpz_*.
+
+Tue Mar 5 18:47:04 1991 Torbjorn Granlund (tege@musta.nada.kth.se)
+
+ * mdiv.c (_mp_divide, case 2): Change test for estimate of Q from
+ "n0 >= r" to "n0 > r".
+
+ * msqrt: Tune the increasing precision scheme, to do fewer steps.
+
+Tue Mar 3 18:50:10 1991 Torbjorn Granlund (tege@musta.nada.kth.se)
+
+ * msqrt: Use the low level routines. Use low precision in the
+ beginning, and increase the precision as the result converges.
+ (This optimization gave a 6-fold speedup.)
diff --git a/Build/source/libs/gmp/gmp-6.0.0/INSTALL b/Build/source/libs/gmp/gmp-6.0.0/INSTALL
new file mode 100644
index 00000000000..75199a1aba7
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/INSTALL
@@ -0,0 +1,80 @@
+Copyright 1996, 1997, 1999-2002, 2006 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/.
+
+
+
+
+
+ INSTALLING GNU MP
+ =================
+
+
+These instructions are only for the impatient. Others should read the install
+instructions in gmp.info. Use
+
+ info -f doc/gmp.info
+
+from the gmp source directory.
+
+Here are some brief instructions on how to install GMP. First you need to
+compile. Since you're impatient, try this
+
+ ./configure
+ make
+ make check <= VERY IMPORTANT!!
+
+If that fails, or you care about the performance of GMP, you need to read the
+full instructions in the chapter "Installing GMP" in the manual.
+
+You should not skip the "make check" part; the risk that the GMP sources are
+miscompiled are unfortunately quite high. And if they indeed are, "make check"
+is very likely to trigger the compiler-introduced bug.
+
+Optionally, you can install the library with the following command. This will
+be to /usr/local by default, and you'll probably need to be "root" to be able
+to write there.
+
+ make install
+
+To create the printable documentation from the texinfo source, type "make
+gmp.dvi" or "make gmp.ps". This requires various "tex" commands.
+
+If you are new to GMP, it is a good idea you at least read the chapter "GMP
+Basics" in the manual.
+
+Some known build problems are noted in the "Installing GMP" chapter of
+the manual. Please report other problems to gmp-bugs@gmplib.org.
+
+The GMP web site is located here: https://gmplib.org/.
+
+
+----------------
+Local variables:
+mode: text
+fill-column: 78
+End:
diff --git a/Build/source/libs/gmp/gmp-6.0.0/Makefile.am b/Build/source/libs/gmp/gmp-6.0.0/Makefile.am
new file mode 100644
index 00000000000..8567c0e3f6c
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/Makefile.am
@@ -0,0 +1,445 @@
+## Process this file with automake to generate Makefile.in
+
+
+# Copyright 1991, 1993, 1994, 1996, 1997, 1999-2004, 2006-2009, 2011-2014 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/.
+
+
+# The following options are the same as AM_INIT_AUTOMAKE in configure.in,
+# except no $(top_builddir) on ansi2knr. That directory is wanted for the
+# Makefiles in subdirectories, but here we must omit it so automake gives
+# the actual ansi2knr build rule, not "cd $(top_builddir) && make ansi2knr".
+#
+# AUTOMAKE_OPTIONS = 1.8 gnu no-dependencies
+
+
+# Libtool -version-info for libgmp.la and libmp.la. See "Versioning" in the
+# libtool manual.
+#
+# CURRENT:REVISION:AGE
+#
+# 1. No interfaces changed, only implementations (good): Increment REVISION.
+#
+# 2. Interfaces added, none removed (good): Increment CURRENT, increment
+# AGE, set REVISION to 0.
+#
+# 3. Interfaces removed (BAD, breaks upward compatibility): Increment
+# CURRENT, set AGE and REVISION to 0.
+#
+# Do this separately for libgmp, libgmpxx and libmp, and only for releases.
+#
+# GMP -version-info
+# release libgmp libgmpxx libmp
+# 2.0.x - - -
+# 3.0 3:0:0 - 3:0:0
+# 3.0.1 3:1:0 - 3:0:0
+# 3.1 4:0:1 - 4:0:1
+# 3.1.1 4:1:1 - 4:1:1
+# 4.0 5:0:2 3:0:0 4:2:1
+# 4.0.1 5:1:2 3:1:0 4:3:1
+# 4.1 6:0:3 3:2:0 4:4:1
+# 4.1.1 6:1:3 3:3:0 4:5:1
+# 4.1.2 6:2:3 3:4:0 4:6:1
+# 4.1.3 6:3:3 3:5:0 4:7:1
+# 4.1.4 6:3:3 3:5:0 4:7:1 WRONG, same as 4.1.3!
+# 4.2 6:0:3 3:2:0 4:4:1 REALLY WRONG, same as 4.1!
+# 4.2.1 7:1:4 4:1:1 4:10:1 WRONG for libgmpxx
+# 4.2.2 7:2:4 4:2:0 4:11:1
+# 4.2.3 7:3:4 4:3:0 4:12:1
+# 4.2.4 7:4:4 4:4:0 4:13:1
+# 4.3.0 8:0:5 5:0:1 4:14:1
+# 4.3.1 8:1:5 5:1:1 4:15:1 WRONG Really used same as 4.3.0
+# 4.3.2 8:2:5 5:2:1 4:16:1
+# 5.0.0 9:0:6 6:0:2 4:20:1 Should have been 10:0:0
+# 5.0.1 10:1:0 6:1:2 4:21:1
+# 5.0.2 10:2:0 6:2:2 4:22:1
+# 5.0.3 10:3:0 6:3:2 4:23:1
+# 5.0.4 10:4:0 6:4:2 4:24:1
+# 5.0.5 10:5:0 6:5:2 4:25:1
+# 5.1.0 11:0:1 7:0:3 -
+# 5.1.1 11:1:1 7:1:3 -
+# 5.1.2 11:2:1 7:2:3 -
+# 6.0.0 12:0:2 8:0:4 -
+#
+# 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
+# packages of gmp 2. Pretend gmp 2 was 2:0:0, so the interface changes for
+# gmp 3 mean 3:0:0 is right.
+#
+# We interpret "implementation changed" in item "1." above as meaning any
+# release, ie. the REVISION is incremented every time (if nothing else).
+# Even if we thought the code generated will be identical on all systems,
+# 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 = 12
+LIBGMP_LT_REVISION = 0
+LIBGMP_LT_AGE = 2
+
+LIBGMPXX_LT_CURRENT = 8
+LIBGMPXX_LT_REVISION = 0
+LIBGMPXX_LT_AGE = 4
+
+
+SUBDIRS = tests mpn mpz mpq mpf printf scanf rand cxx demos tune doc
+
+EXTRA_DIST = configfsf.guess configfsf.sub .gdbinit INSTALL.autoconf \
+ COPYING.LESSERv3 COPYINGv2 COPYINGv3
+
+
+if WANT_CXX
+GMPXX_HEADERS_OPTION = gmpxx.h
+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.
+#
+# $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,
+# but anyone knowledgeable enough to be playing with exec_prefix will be able
+# to address that.
+#
+includeexecdir = $(exec_prefix)/include
+include_HEADERS = $(GMPXX_HEADERS_OPTION)
+nodist_includeexec_HEADERS = gmp.h
+lib_LTLIBRARIES = libgmp.la $(GMPXX_LTLIBRARIES_OPTION)
+
+BUILT_SOURCES = gmp.h
+
+DISTCLEANFILES = $(BUILT_SOURCES) config.m4 @gmp_srclinks@
+
+# Tell gmp.h it's building gmp, not an application, used by windows DLL stuff.
+INCLUDES=-D__GMP_WITHIN_GMP
+
+
+MPF_OBJECTS = mpf/init$U.lo mpf/init2$U.lo mpf/inits$U.lo mpf/set$U.lo \
+ mpf/set_ui$U.lo mpf/set_si$U.lo mpf/set_str$U.lo mpf/set_d$U.lo \
+ mpf/set_z$U.lo mpf/iset$U.lo mpf/iset_ui$U.lo mpf/iset_si$U.lo \
+ mpf/iset_str$U.lo mpf/iset_d$U.lo mpf/clear$U.lo mpf/clears$U.lo \
+ mpf/get_str$U.lo mpf/dump$U.lo mpf/size$U.lo mpf/eq$U.lo mpf/reldiff$U.lo \
+ mpf/sqrt$U.lo mpf/random2$U.lo mpf/inp_str$U.lo mpf/out_str$U.lo \
+ mpf/add$U.lo mpf/add_ui$U.lo mpf/sub$U.lo mpf/sub_ui$U.lo mpf/ui_sub$U.lo \
+ mpf/mul$U.lo mpf/mul_ui$U.lo mpf/div$U.lo mpf/div_ui$U.lo \
+ mpf/cmp$U.lo mpf/cmp_d$U.lo mpf/cmp_ui$U.lo mpf/cmp_si$U.lo \
+ mpf/mul_2exp$U.lo mpf/div_2exp$U.lo mpf/abs$U.lo mpf/neg$U.lo \
+ mpf/set_q$U.lo mpf/get_d$U.lo mpf/get_d_2exp$U.lo mpf/set_dfl_prec$U.lo \
+ mpf/set_prc$U.lo mpf/set_prc_raw$U.lo mpf/get_dfl_prec$U.lo \
+ mpf/get_prc$U.lo mpf/ui_div$U.lo mpf/sqrt_ui$U.lo \
+ mpf/ceilfloor$U.lo mpf/trunc$U.lo mpf/pow_ui$U.lo \
+ mpf/urandomb$U.lo mpf/swap$U.lo \
+ mpf/fits_sint$U.lo mpf/fits_slong$U.lo mpf/fits_sshort$U.lo \
+ mpf/fits_uint$U.lo mpf/fits_ulong$U.lo mpf/fits_ushort$U.lo \
+ mpf/get_si$U.lo mpf/get_ui$U.lo \
+ mpf/int_p$U.lo
+
+MPZ_OBJECTS = mpz/abs$U.lo mpz/add$U.lo mpz/add_ui$U.lo \
+ mpz/aorsmul$U.lo mpz/aorsmul_i$U.lo mpz/and$U.lo mpz/array_init$U.lo \
+ mpz/bin_ui$U.lo mpz/bin_uiui$U.lo \
+ mpz/cdiv_q$U.lo mpz/cdiv_q_ui$U.lo \
+ mpz/cdiv_qr$U.lo mpz/cdiv_qr_ui$U.lo \
+ mpz/cdiv_r$U.lo mpz/cdiv_r_ui$U.lo mpz/cdiv_ui$U.lo \
+ mpz/cfdiv_q_2exp$U.lo mpz/cfdiv_r_2exp$U.lo \
+ mpz/clear$U.lo mpz/clears$U.lo mpz/clrbit$U.lo \
+ mpz/cmp$U.lo mpz/cmp_d$U.lo mpz/cmp_si$U.lo mpz/cmp_ui$U.lo \
+ mpz/cmpabs$U.lo mpz/cmpabs_d$U.lo mpz/cmpabs_ui$U.lo \
+ mpz/com$U.lo mpz/combit$U.lo \
+ mpz/cong$U.lo mpz/cong_2exp$U.lo mpz/cong_ui$U.lo \
+ mpz/divexact$U.lo mpz/divegcd$U.lo mpz/dive_ui$U.lo \
+ mpz/divis$U.lo mpz/divis_ui$U.lo mpz/divis_2exp$U.lo mpz/dump$U.lo \
+ mpz/export$U.lo mpz/mfac_uiui$U.lo \
+ mpz/2fac_ui$U.lo mpz/fac_ui$U.lo mpz/oddfac_1$U.lo mpz/prodlimbs$U.lo \
+ mpz/fdiv_q_ui$U.lo mpz/fdiv_qr$U.lo mpz/fdiv_qr_ui$U.lo \
+ mpz/fdiv_r$U.lo mpz/fdiv_r_ui$U.lo mpz/fdiv_q$U.lo \
+ mpz/fdiv_ui$U.lo mpz/fib_ui$U.lo mpz/fib2_ui$U.lo mpz/fits_sint$U.lo \
+ mpz/fits_slong$U.lo mpz/fits_sshort$U.lo mpz/fits_uint$U.lo \
+ mpz/fits_ulong$U.lo mpz/fits_ushort$U.lo mpz/gcd$U.lo \
+ mpz/gcd_ui$U.lo mpz/gcdext$U.lo mpz/get_d$U.lo mpz/get_d_2exp$U.lo \
+ mpz/get_si$U.lo mpz/get_str$U.lo mpz/get_ui$U.lo mpz/getlimbn$U.lo \
+ mpz/hamdist$U.lo \
+ mpz/import$U.lo mpz/init$U.lo mpz/init2$U.lo mpz/inits$U.lo \
+ mpz/inp_raw$U.lo mpz/inp_str$U.lo mpz/invert$U.lo \
+ mpz/ior$U.lo mpz/iset$U.lo mpz/iset_d$U.lo mpz/iset_si$U.lo \
+ mpz/iset_str$U.lo mpz/iset_ui$U.lo mpz/jacobi$U.lo mpz/kronsz$U.lo \
+ 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/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 \
+ mpz/out_raw$U.lo mpz/out_str$U.lo mpz/perfpow$U.lo mpz/perfsqr$U.lo \
+ mpz/popcount$U.lo mpz/pow_ui$U.lo mpz/powm$U.lo mpz/powm_sec$U.lo \
+ mpz/powm_ui$U.lo mpz/primorial_ui$U.lo \
+ mpz/pprime_p$U.lo mpz/random$U.lo mpz/random2$U.lo \
+ mpz/realloc$U.lo mpz/realloc2$U.lo mpz/remove$U.lo mpz/roinit_n$U.lo \
+ mpz/root$U.lo mpz/rootrem$U.lo mpz/rrandomb$U.lo mpz/scan0$U.lo \
+ mpz/scan1$U.lo mpz/set$U.lo mpz/set_d$U.lo mpz/set_f$U.lo \
+ 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/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 \
+ mpz/tstbit$U.lo mpz/ui_pow_ui$U.lo mpz/ui_sub$U.lo mpz/urandomb$U.lo \
+ mpz/urandomm$U.lo mpz/xor$U.lo
+
+MPQ_OBJECTS = mpq/abs$U.lo mpq/aors$U.lo \
+ mpq/canonicalize$U.lo mpq/clear$U.lo mpq/clears$U.lo \
+ mpq/cmp$U.lo mpq/cmp_si$U.lo mpq/cmp_ui$U.lo mpq/div$U.lo \
+ mpq/get_d$U.lo mpq/get_den$U.lo mpq/get_num$U.lo mpq/get_str$U.lo \
+ mpq/init$U.lo mpq/inits$U.lo mpq/inp_str$U.lo mpq/inv$U.lo \
+ mpq/md_2exp$U.lo mpq/mul$U.lo mpq/neg$U.lo mpq/out_str$U.lo \
+ mpq/set$U.lo mpq/set_den$U.lo mpq/set_num$U.lo \
+ mpq/set_si$U.lo mpq/set_str$U.lo mpq/set_ui$U.lo \
+ mpq/equal$U.lo mpq/set_z$U.lo mpq/set_d$U.lo \
+ mpq/set_f$U.lo mpq/swap$U.lo
+
+MPN_OBJECTS = mpn/fib_table$U.lo mpn/mp_bases$U.lo
+
+PRINTF_OBJECTS = \
+ printf/asprintf$U.lo printf/asprntffuns$U.lo \
+ printf/doprnt$U.lo printf/doprntf$U.lo printf/doprnti$U.lo \
+ printf/fprintf$U.lo \
+ printf/obprintf$U.lo printf/obvprintf$U.lo printf/obprntffuns$U.lo \
+ printf/printf$U.lo printf/printffuns$U.lo \
+ printf/snprintf$U.lo printf/snprntffuns$U.lo \
+ printf/sprintf$U.lo printf/sprintffuns$U.lo \
+ printf/vasprintf$U.lo printf/vfprintf$U.lo printf/vprintf$U.lo \
+ printf/vsnprintf$U.lo printf/vsprintf$U.lo \
+ printf/repl-vsnprintf$U.lo
+
+SCANF_OBJECTS = \
+ scanf/doscan$U.lo scanf/fscanf$U.lo scanf/fscanffuns$U.lo \
+ scanf/scanf$U.lo scanf/sscanf$U.lo scanf/sscanffuns$U.lo \
+ scanf/vfscanf$U.lo scanf/vscanf$U.lo scanf/vsscanf$U.lo
+
+RANDOM_OBJECTS = \
+ rand/rand$U.lo rand/randclr$U.lo rand/randdef$U.lo rand/randiset$U.lo \
+ rand/randlc2s$U.lo rand/randlc2x$U.lo rand/randmt$U.lo \
+ rand/randmts$U.lo rand/rands$U.lo rand/randsd$U.lo rand/randsdui$U.lo \
+ rand/randbui$U.lo rand/randmui$U.lo
+
+# no $U for C++ files
+CXX_OBJECTS = \
+ cxx/isfuns.lo cxx/ismpf.lo cxx/ismpq.lo cxx/ismpz.lo cxx/ismpznw.lo \
+ cxx/limits.lo cxx/osdoprnti.lo cxx/osfuns.lo \
+ cxx/osmpf.lo cxx/osmpq.lo cxx/osmpz.lo
+
+# In libtool 1.5 it doesn't work to build libgmp.la from the convenience
+# libraries like mpz/libmpz.la. Or rather it works, but it ends up putting
+# PIC objects into libgmp.a if shared and static are both built. (The PIC
+# objects go into mpz/.libs/libmpz.a, and thence into .libs/libgmp.a.)
+#
+# For now the big lists of objects above are used. Something like mpz/*.lo
+# would probably work, but might risk missing something out or getting
+# something extra. The source files for each .lo are listed in the
+# Makefile.am's in the subdirectories.
+#
+# Currently, for libgmp, unlike libmp below, we're not using
+# -export-symbols, since the tune and speed programs, and perhaps some of
+# the test programs, want to access undocumented symbols.
+
+libgmp_la_SOURCES = gmp-impl.h longlong.h \
+ assert.c compat.c errno.c extract-dbl.c invalid.c memory.c \
+ mp_bpl.c mp_clz_tab.c mp_dv_tab.c mp_minv_tab.c mp_get_fns.c mp_set_fns.c \
+ version.c nextprime.c primesieve.c
+EXTRA_libgmp_la_SOURCES = tal-debug.c tal-notreent.c tal-reent.c
+libgmp_la_DEPENDENCIES = @TAL_OBJECT@ \
+ $(MPF_OBJECTS) $(MPZ_OBJECTS) $(MPQ_OBJECTS) \
+ $(MPN_OBJECTS) @mpn_objs_in_libgmp@ \
+ $(PRINTF_OBJECTS) $(SCANF_OBJECTS) $(RANDOM_OBJECTS)
+libgmp_la_LIBADD = $(libgmp_la_DEPENDENCIES)
+libgmp_la_LDFLAGS = $(GMP_LDFLAGS) $(LIBGMP_LDFLAGS) \
+ -version-info $(LIBGMP_LT_CURRENT):$(LIBGMP_LT_REVISION):$(LIBGMP_LT_AGE)
+
+
+# We need at least one .cc file in $(libgmpxx_la_SOURCES) so automake will
+# use $(CXXLINK) rather than the plain C $(LINK). cxx/dummy.cc is that
+# file.
+
+if WANT_CXX
+GMPXX_LTLIBRARIES_OPTION = libgmpxx.la
+endif
+libgmpxx_la_SOURCES = cxx/dummy.cc
+libgmpxx_la_DEPENDENCIES = $(CXX_OBJECTS) libgmp.la
+libgmpxx_la_LIBADD = $(libgmpxx_la_DEPENDENCIES)
+libgmpxx_la_LDFLAGS = $(GMP_LDFLAGS) $(LIBGMPXX_LDFLAGS) \
+ -version-info $(LIBGMPXX_LT_CURRENT):$(LIBGMPXX_LT_REVISION):$(LIBGMPXX_LT_AGE)
+
+
+
+install-data-hook:
+ @echo ''
+ @echo '+-------------------------------------------------------------+'
+ @echo '| CAUTION: |'
+ @echo '| |'
+ @echo '| If you have not already run "make check", then we strongly |'
+ @echo '| recommend you do so. |'
+ @echo '| |'
+ @echo '| GMP has been carefully tested by its authors, but compilers |'
+ @echo '| are all too often released with serious bugs. GMP tends to |'
+ @echo '| explore interesting corners in compilers and has hit bugs |'
+ @echo '| on quite a few occasions. |'
+ @echo '| |'
+ @echo '+-------------------------------------------------------------+'
+ @echo ''
+
+
+# The "test -f" support for srcdir!=builddir is similar to the automake .c.o
+# etc rules, but with each foo.c explicitly, since $< is not portable
+# outside an inference rule.
+#
+# A quoted 'foo.c' is used with the "test -f"'s to avoid Sun make rewriting
+# it as part of its VPATH support. See the autoconf manual "Limitations of
+# Make".
+#
+# Generated .h files which are used by gmp-impl.h are BUILT_SOURCES since
+# they must exist before anything can be compiled.
+#
+# Other generated .h files are also BUILT_SOURCES so as to get all the
+# build-system stuff over and done with at the start. Also, dependencies on
+# the .h files are not properly expressed for the various objects that use
+# them.
+
+EXTRA_DIST += bootstrap.c
+
+fac_table.h: gen-fac$(EXEEXT_FOR_BUILD)
+ ./gen-fac $(GMP_LIMB_BITS) $(GMP_NAIL_BITS) >fac_table.h || (rm -f fac_table.h; exit 1)
+BUILT_SOURCES += fac_table.h
+
+gen-fac$(EXEEXT_FOR_BUILD): gen-fac$(U_FOR_BUILD).c bootstrap.c
+ $(CC_FOR_BUILD) `test -f 'gen-fac$(U_FOR_BUILD).c' || echo '$(srcdir)/'`gen-fac$(U_FOR_BUILD).c -o gen-fac$(EXEEXT_FOR_BUILD)
+DISTCLEANFILES += gen-fac$(EXEEXT_FOR_BUILD)
+EXTRA_DIST += gen-fac.c
+
+
+fib_table.h: gen-fib$(EXEEXT_FOR_BUILD)
+ ./gen-fib header $(GMP_LIMB_BITS) $(GMP_NAIL_BITS) >fib_table.h || (rm -f fib_table.h; exit 1)
+BUILT_SOURCES += fib_table.h
+
+mpn/fib_table.c: gen-fib$(EXEEXT_FOR_BUILD)
+ ./gen-fib table $(GMP_LIMB_BITS) $(GMP_NAIL_BITS) >mpn/fib_table.c || (rm -f mpn/fib_table.c; exit 1)
+BUILT_SOURCES += mpn/fib_table.c
+
+gen-fib$(EXEEXT_FOR_BUILD): gen-fib$(U_FOR_BUILD).c bootstrap.c
+ $(CC_FOR_BUILD) `test -f 'gen-fib$(U_FOR_BUILD).c' || echo '$(srcdir)/'`gen-fib$(U_FOR_BUILD).c -o gen-fib$(EXEEXT_FOR_BUILD)
+DISTCLEANFILES += gen-fib$(EXEEXT_FOR_BUILD)
+EXTRA_DIST += gen-fib.c
+
+
+mp_bases.h: gen-bases$(EXEEXT_FOR_BUILD)
+ ./gen-bases header $(GMP_LIMB_BITS) $(GMP_NAIL_BITS) >mp_bases.h || (rm -f mp_bases.h; exit 1)
+BUILT_SOURCES += mp_bases.h
+
+mpn/mp_bases.c: gen-bases$(EXEEXT_FOR_BUILD)
+ ./gen-bases table $(GMP_LIMB_BITS) $(GMP_NAIL_BITS) >mpn/mp_bases.c || (rm -f mpn/mp_bases.c; exit 1)
+BUILT_SOURCES += mpn/mp_bases.c
+
+gen-bases$(EXEEXT_FOR_BUILD): gen-bases$(U_FOR_BUILD).c bootstrap.c
+ $(CC_FOR_BUILD) `test -f 'gen-bases$(U_FOR_BUILD).c' || echo '$(srcdir)/'`gen-bases$(U_FOR_BUILD).c -o gen-bases$(EXEEXT_FOR_BUILD) $(LIBM_FOR_BUILD)
+DISTCLEANFILES += gen-bases$(EXEEXT_FOR_BUILD)
+EXTRA_DIST += gen-bases.c
+
+
+trialdivtab.h: gen-trialdivtab$(EXEEXT_FOR_BUILD)
+ ./gen-trialdivtab $(GMP_LIMB_BITS) 8000 >trialdivtab.h || (rm -f trialdivtab.h; exit 1)
+BUILT_SOURCES += trialdivtab.h
+
+gen-trialdivtab$(EXEEXT_FOR_BUILD): gen-trialdivtab$(U_FOR_BUILD).c bootstrap.c
+ $(CC_FOR_BUILD) `test -f 'gen-trialdivtab$(U_FOR_BUILD).c' || echo '$(srcdir)/'`gen-trialdivtab$(U_FOR_BUILD).c -o gen-trialdivtab$(EXEEXT_FOR_BUILD) $(LIBM_FOR_BUILD)
+DISTCLEANFILES += gen-trialdivtab$(EXEEXT_FOR_BUILD)
+EXTRA_DIST += gen-trialdivtab.c
+
+
+mpn/jacobitab.h: gen-jacobitab$(EXEEXT_FOR_BUILD)
+ ./gen-jacobitab >mpn/jacobitab.h || (rm -f mpn/jacobitab.h; exit 1)
+BUILT_SOURCES += mpn/jacobitab.h
+
+gen-jacobitab$(EXEEXT_FOR_BUILD): gen-jacobitab$(U_FOR_BUILD).c
+ $(CC_FOR_BUILD) `test -f 'gen-jacobitab$(U_FOR_BUILD).c' || echo '$(srcdir)/'`gen-jacobitab$(U_FOR_BUILD).c -o gen-jacobitab$(EXEEXT_FOR_BUILD)
+DISTCLEANFILES += gen-jacobitab$(EXEEXT_FOR_BUILD)
+EXTRA_DIST += gen-jacobitab.c
+
+
+mpn/perfsqr.h: gen-psqr$(EXEEXT_FOR_BUILD)
+ ./gen-psqr $(GMP_LIMB_BITS) $(GMP_NAIL_BITS) >mpn/perfsqr.h || (rm -f mpn/perfsqr.h; exit 1)
+BUILT_SOURCES += mpn/perfsqr.h
+
+gen-psqr$(EXEEXT_FOR_BUILD): gen-psqr$(U_FOR_BUILD).c bootstrap.c
+ $(CC_FOR_BUILD) `test -f 'gen-psqr$(U_FOR_BUILD).c' || echo '$(srcdir)/'`gen-psqr$(U_FOR_BUILD).c -o gen-psqr$(EXEEXT_FOR_BUILD) $(LIBM_FOR_BUILD)
+DISTCLEANFILES += gen-psqr$(EXEEXT_FOR_BUILD)
+EXTRA_DIST += gen-psqr.c
+
+# 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/tests/Makefile mini-gmp/tests/run-tests
+
+# Avoid: CVS - cvs directories
+# *~ - emacs backups
+# .#* - cvs merge originals
+#
+# *~ and .#* only occur when a whole directory without it's own Makefile.am
+# is distributed, like "doc" or the mpn cpu subdirectories.
+#
+dist-hook:
+ -find $(distdir) \( -name CVS -type d \) -o -name "*~" -o -name ".#*" \
+ | xargs rm -rf
+ cp "$(srcdir)"/mini-gmp/tests/*.[ch] "$(distdir)/mini-gmp/tests"
+# grep -F $(VERSION) $(srcdir)/Makefile.am \
+# | grep -q "^# *$(VERSION) *$(LIBGMP_LT_CURRENT):$(LIBGMP_LT_REVISION):$(LIBGMP_LT_AGE) *$(LIBGMPXX_LT_CURRENT):$(LIBGMPXX_LT_REVISION):$(LIBGMPXX_LT_AGE)"
+# test -z "`sed -n 's/^# *[0-9]*\.[0-9]*\.[0-9]* *\([0-9]*:[0-9]*:[0-9]*\) *\([0-9]*:[0-9]*:[0-9]*\) *\([0-9]*:[0-9]*:[0-9]*\).*/A\1\nB\2\nC\3/p' $(srcdir)/Makefile.am | grep -v 'A6:3:3\|B3:5:0\|C4:7:1' | sort | uniq -d`"
+
+.PHONY: check-mini-gmp clean-mini-gmp
+
+check-mini-gmp:
+ abs_srcdir="`cd $(srcdir) && pwd`" ; \
+ $(MKDIR_P) mini-gmp/tests \
+ && cd mini-gmp/tests \
+ && LD_LIBRARY_PATH="../../.libs:$$LD_LIBRARY_PATH" \
+ DYLD_LIBRARY_PATH="../../.libs:$$DYLD_LIBRARY_PATH" \
+ $(MAKE) -f "$$abs_srcdir/mini-gmp/tests/Makefile" \
+ VPATH="$$abs_srcdir/mini-gmp/tests" \
+ srcdir="$$abs_srcdir/mini-gmp/tests" \
+ MINI_GMP_DIR="$$abs_srcdir/mini-gmp" \
+ LDFLAGS="-L../../.libs" \
+ LIBS="-lgmp -lm" \
+ CC="$(CC_FOR_BUILD)" EXTRA_CFLAGS="-g -I../.." check
+
+clean-mini-gmp:
+ if [ -d mini-gmp/tests ] ; then \
+ abs_srcdir="`cd $(srcdir) && pwd`" ; \
+ cd mini-gmp/tests \
+ && $(MAKE) -f "$$abs_srcdir/mini-gmp/tests/Makefile" clean ; \
+ fi
+
+clean-local: clean-mini-gmp
+distclean-local: clean-mini-gmp
diff --git a/Build/source/libs/gmp/gmp-6.0.0/NEWS b/Build/source/libs/gmp/gmp-6.0.0/NEWS
new file mode 100644
index 00000000000..5f77bce1e14
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/NEWS
@@ -0,0 +1,891 @@
+Copyright 1996, 1999-2014 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 5.1.* and 6.0.0
+
+ BUGS FIXED
+ * The function mpz_invert now considers any number invertible in Z/1Z.
+
+ * The mpn multiply code now handles operands of more than 2^31 limbs
+ correctly. (Note however that the mpz code is limited to 2^32 bits on
+ 32-bit hosts and 2^37 bits on 64-bit hosts.)
+
+ * Contains all fixes from release 5.1.3.
+
+ SPEEDUPS
+ * Plain division of large operands is faster and more monotonous in operand
+ size.
+
+ * Major speedup for ARM, in particular ARM Cortex-A15, thanks to improved
+ assembly.
+
+ * Major speedup for SPARC T4/T5 and speedup also for T3, thanks to a lot of
+ new assembly.
+
+ * Speedup for Intel Sandy Bridge, Ivy Bridge, Haswell, thanks to rewritten
+ and vastly expanded assembly support. Speedup also for the older Core 2
+ and Nehalem.
+
+ * Faster mixed arithmetic between mpq_class and double.
+
+ * With g++, optimise more operations when one argument is a simple constant.
+
+ FEATURES
+ * Support for new Intel and AMD CPUs.
+
+ * Support for ARM64 alias Aarch64 alias ARMv8.
+
+ * New public functions mpn_sec_mul and mpn_sec_sqr, implementing side-channel
+ silent multiplication and squaring.
+
+ * New public functions mpn_sec_div_qr and mpn_sec_div_r, implementing
+ side-channel silent division.
+
+ * New public functions mpn_cnd_add_n and mpn_cnd_sub_n. Side-channel silent
+ conditional addition and subtraction.
+
+ * New public function mpn_sec_powm, implementing side-channel silent modexp.
+
+ * New public function mpn_sec_invert, implementing side-channel silent
+ modular inversion.
+
+ * Better support for applications which use the mpz_t type, but nevertheless
+ need to call some of the lower-level mpn functions. See the documentation
+ for mpz_limbs_read and related functions.
+
+ MISC
+ * This release will not work on NetBSD 5.x, FreeBSD 7.x, 8.x or 9 series
+ before 9.3. The reason is that the m4 command is not correctly
+ implemented. (Workaround: Use an older GMP release, or install GNU m4 from
+ /usr/ports and tell GMP to use it.)
+
+ * This release will not build properly on FreeBSD/amd64 before version 10
+ using the 32-bit ABI (once a working m4 is installed). The reason is
+ broken limits.h. (Workaround: Use an older GMP release if using the 32-bit
+ ABI on these FreeBSD releases is important.)
+
+ * This release will not work reliably on FreeBSD 10.0 for i386 or amd64 using
+ the 32-bit ABI. The reason is bugs in the compiler 'clang'. Depending on
+ CPU-dependent compiler flags, GMP may or may not be miscompiled in a
+ particular build. (Workaround: Compiling gcc from /usr/ports should work,
+ except that gcc circularly depends on GMP; we have not been able to test
+ that workaround due to FreeBSD 10.0 bugs affecting its ability to run under
+ KVM and Xen.)
+
+ * This release will not compile on FreeBSD before version 10 for i386,
+ targeting any modern AMD processor. The reason is bugs in the old gcc
+ bundled with FreeBSD. (Workaround: install a less obsolete gcc from
+ /usr/ports and tell GMP to use it, or override the -march=amdfam10
+ GMP configure command line argument.)
+
+
+Changes between GMP version 5.1.2 and 5.1.3
+
+ BUGS FIXED
+ * The internal functions mpn_sbpi1_div_qr_sec mpn_sbpi1_div_r_sec could
+ compute garbage with a low probability. They are now rewritten, and the
+ test code has been improved.
+
+ * A bug in the ia64 implementation of mpn_divrem_2, clobbering some
+ callee-save registers, has been fixed. This is an internal
+ function, with the bug manifesting itself as miscomputation in,
+ e.g., mpn_sqrtrem.
+
+ * The documentation now correctly says 'const' for input arguments.
+
+ SPEEDUPS
+ * None.
+
+ FEATURES
+ * None.
+
+ MISC
+ * None.
+
+
+Changes between GMP version 5.1.1 and 5.1.2
+
+ BUGS FIXED
+ * A bug in mpz_powm_ui triggered by base arguments of at least 15000 decimal
+ digits or mod arguments of at least 7500 decimal digits has been fixed.
+
+ * An AMD Bulldozer specific bug affecting the 64-bit Windows ABI has been
+ fixed. This bug was in a key function (mpn_mul_1) and made both Bulldozer
+ specific builds and fat builds run on Bulldozer completely non-functional.
+
+ SPEEDUPS
+ * None.
+
+ FEATURES
+ * None.
+
+ MISC
+ * Fixes and generalisations to the test suite.
+
+ * Minor portability enhancements.
+
+
+Changes between GMP version 5.1.0 and 5.1.1
+
+ BUGS FIXED
+ * On Windows 64-bit, an error causing link errors about
+ __gmp_binvert_limb_table has been fixed.
+
+ * Aarch64 alias ARM64 support now works.
+
+ * A possible buffer overrun in mpz_ior has been fixed.
+
+ * A rare sign flip in mpz_remove has been fixed.
+
+ * A bug causing problems with mpf numbers with absolute value >= 2^31 has
+ been fixed.
+
+ * Several bugs in mini-gmp have been fixed.
+
+ * A bug caused by automake, related to the 'distcheck' target, has been fixed
+ by upgrading the automake used for GMP release engineering.
+
+ SPEEDUPS
+ * None.
+
+ FEATURES
+ * Preliminary support for the x32 ABI under x86-64.
+
+ MISC
+ * The mini-gmp testsuite now tests the entire set of functions.
+
+ * Various improvements of the GMP testsuite.
+
+
+Changes between GMP version 5.0.* and 5.1.0
+
+ BUGS FIXED
+ * When reading a C++ number (like mpz_class) in an istream reaches the end
+ of the stream, the eofbit is now set.
+
+ * The result sign of mpz_rootrem's remainder is now always correct.
+
+ * The mpz_remove function now handles negative divisors.
+
+ * Contains all fixes from release 5.0.5.
+
+ SPEEDUPS
+ * The n-factorial and n-over-k functions have been reimplemented for great
+ speedups for small and large operands.
+
+ * New subquadratic algorithm for the Kronecker/Jacobi/Legendre symbol.
+
+ * Major speedup for ARM, in particular ARM Cortex-A9 and A15, thanks to broad
+ assembly support.
+
+ * Significant speedup for POWER6 and POWER7 thanks to improved assembly.
+
+ * The performance under M$ Windows' 64-bit ABI has been greatly improved
+ thanks to complete assembly support.
+
+ * Minor speed improvements of many functions and for many platforms.
+
+ FEATURES
+ * Many new CPUs recognised.
+
+ * New functions for multi-factorials, and primorial: mpz_2fac_ui,
+ mpz_mfac_uiui and mpz_primorial_ui.
+
+ * The mpz_powm_sec function now uses side-channel silent division for
+ converting into Montgomery residues.
+
+ * The fat binary mechanism is now more robust in its CPU recognition.
+
+ MISC
+ * Inclusion of assembly code is now controlled by the configure options
+ --enable-assembly and --disable-assembly. The "none" CPU target is gone.
+
+ * In C++, the conversions mpq_class->mpz_class, mpf_class->mpz_class and
+ mpf_class->mpq_class are now explicit.
+
+ * Includes "mini-gmp", a small, portable, but less efficient, implementation
+ of a subset of GMP's mpn and mpz interfaces. Used in GMP bootstrap, but it
+ can also be bundled with applications as a fallback when the real GMP
+ library is unavailable.
+
+ * The ABIs under AIX are no longer called aix32 and aix64, but mode64 and 32.
+ This is more consistent with other powerpc systems.
+
+ * The coverage of the testsuite has been improved, using the lcov tool. See
+ also https://gmplib.org/devel/lcov/.
+
+ * It is now possible to compile GMP using a C++ compiler.
+
+ * K&R C compilers are no longer supported.
+
+ * The BSD MP compatibility functions have been removed.
+
+
+Changes between GMP version 5.0.4 and 5.0.5
+
+ BUGS FIXED
+ * A bug causing AMD 11h processors to be treated like AMD 10h has been fixed.
+ The 11h processors do not correctly handle all 10h (aka K10) instructions,
+ and GMP's use of these instructions results in major miscomputations (not
+ as one would have hoped CPU traps of some 'illegal instruction' sort).
+
+ * A bug affecting recent Intel Sandy Bridge CPUs resulting in configuration
+ failures has been fixed.
+
+ SPEEDUPS
+ * None.
+
+ FEATURES
+ * A couple of tests added to the self-check suite.
+
+ MISC
+ * None.
+
+
+Changes between GMP version 5.0.3 and 5.0.4
+
+ BUGS FIXED
+ * Thresholds in mpn_powm_sec for both fat and non-fat builds are now used
+ safely, plugging a one-word buffer overrun introduced in the 5.0.3 release
+ (for non-fat) and a multi-word buffer overrun that existed since 5.0 (for
+ fat). (We have not been able to provoke malign stack smashing in any of
+ the ~100 configurations explored by the GMP nightly builds, but the bug
+ should be assumed to be exploitable.)
+
+ * Two bugs in multiplication code causing incorrect computation with
+ extremely low probability have been fixed.
+
+ * A bug in the test suite causing buffer overruns during "make check",
+ sometimes leading to subsequent malloc crashes, has been fixed.
+
+ * Two bugs in the gcd code have been fixed. They could lead to incorrect
+ results, but for uniformly distributed random operands, the likelihood for
+ that is infinitesimally small. (There was also a third bug, but that was
+ an incorrect ASSERT, which furthermore was not enabled by default.)
+
+ * A bug affecting 32-bit PowerPC division has been fixed. The bug caused
+ miscomputation for certain divisors in the range 2^32 ... 2^64-1 (about 1
+ in 2^30 of these).
+
+ SPEEDUPS
+ * None, except indirectly through recognition of new CPUs, and through better
+ tuning parameters.
+
+ FEATURES
+ * Some more tests added to the self-check suite.
+
+ * The AMD "Bulldozer" CPU is now recognised.
+
+ MISC
+ * None.
+
+
+Changes between GMP version 5.0.2 and 5.0.3
+
+ BUGS FIXED
+ * A few minor bugs related to portability fixed.
+
+ * A slight timing leak of the powm_sec functions have been sealed. (This
+ leak could possibly be used to extract the most significant few bits of the
+ exponent. "Few" here means at most 10.)
+
+ * The mpz_nextprime function now runs a safer number of pseudo-random prime
+ tests.
+
+ * A bug in division code possibly causing incorrect computation was fixed.
+
+ SPEEDUPS
+ * None, except indirectly through recognition of new CPUs, and through better
+ tuning parameters.
+
+ FEATURES
+ * New CPUs recognised.
+
+ * IBM S/390 are now supported in both 31/32-bit and 64-bit mode. (We have
+ not been able to fully test this on any multilib machine, since IBM expired
+ our guest account a few days before our release.)
+
+ MISC
+ * None.
+
+
+Changes between GMP version 5.0.1 and 5.0.2
+
+ BUGS FIXED
+ * Many minor bugs related to portability fixed.
+
+ * The support for HPPA 2.0N now works, after an assembly bug fix.
+
+ * A test case type error has been fixed. The symptom of this bug was
+ spurious 'make check' failures.
+
+ SPEEDUPS
+ * None, except indirectly through recognition of new CPUs.
+
+ FEATURES
+ * Fat builds are now supported for 64-bit x86 processors also under Darwin.
+
+ MISC
+ * None.
+
+
+Changes between GMP version 5.0.0 and 5.0.1
+
+ BUGS FIXED
+ * Fat builds fixed.
+
+ * Fixed crash for huge multiplies when old FFT_TABLE2 type of parameter
+ selection tables' sentinel was smaller than multiplied operands.
+
+ * The solib numbers now reflect the removal of the documented but preliminary
+ mpn_bdivmod function; we correctly flag incompatibility with GMP 4.3. GMP
+ 5.0.0 has this wrong, and should perhaps be uninstalled to avoid confusion.
+
+ SPEEDUPS
+ * Multiplication of large numbers has indirectly been sped up through better
+ FFT tuning and processor recognition. Since many operations depend on
+ multiplication, there will be a general speedup.
+
+ FEATURES
+ * More Core i3, i5 an Core i7 processor models are recognised.
+
+ * Fixes and workarounds for Mac OS quirks should make this GMP version build
+ using many of the different versions of "Xcode".
+
+ MISC
+ * The amount of scratch memory needed for multiplication of huge numbers has
+ been reduced substantially (but is still larger than in GMP 4.3.)
+
+ * Likewise, the amount of scratch memory needed for division of large numbers
+ has been reduced substantially.
+
+ * The FFT tuning code of tune/tuneup.c has been completely rewritten, and
+ new, large FFT parameter selection tables are provided for many machines.
+
+ * Upgraded to the latest autoconf, automake, libtool.
+
+
+Changes between GMP version 4.3.X and 5.0.0
+
+ BUGS FIXED
+ * None (contains the same fixes as release 4.3.2).
+
+ SPEEDUPS
+ * Multiplication has been overhauled:
+ (1) Multiplication of larger same size operands has been improved with
+ the addition of two new Toom functions and a new internal function
+ mpn_mulmod_bnm1 (computing U * V mod (B^n-1), B being the word base.
+ This latter function is used for the largest products, waiting for a
+ better Schoenhage-Strassen U * V mod (B^n+1) implementation.
+ (2) Likewise for squaring.
+ (3) Multiplication of different size operands has been improved with the
+ addition of many new Toom function, and by selecting underlying
+ functions better from the main multiply functions.
+
+ * Division and mod have been overhauled:
+ (1) Plain "schoolbook" division is reimplemented using faster quotient
+ approximation.
+ (2) Division Q = N/D, R = N mod D where both the quotient and remainder
+ are needed now runs in time O(M(log(N))). This is an improvement of
+ a factor log(log(N))
+ (3) Division where just the quotient is needed is now O(M(log(Q))) on
+ average.
+ (4) Modulo operations using Montgomery REDC form now take time O(M(n)).
+ (5) Exact division Q = N/D by means of mpz_divexact has been improved
+ for all sizes, and now runs in time O(M(log(N))).
+
+ * The function mpz_powm is now faster for all sizes. Its complexity has
+ gone from O(M(n)log(n)m) to O(M(n)m) where n is the size of the modulo
+ argument and m is the size of the exponent. It is also radically
+ faster for even modulus, since it now partially factors such modulus
+ and performs two smaller modexp operations, then uses CRT.
+
+ * The internal support for multiplication yielding just the lower n limbs
+ has been improved by using Mulders' algorithm.
+
+ * Computation of inverses, both plain 1/N and 1/N mod B^n have been
+ improved by using well-tuned Newton iterations, and wrap-around
+ multiplication using mpn_mulmod_bnm1.
+
+ * A new algorithm makes mpz_perfect_power_p asymptotically faster.
+
+ * The function mpz_remove uses a much faster algorithm, is better tuned,
+ and also benefits from the division improvements.
+
+ * Intel Atom and VIA Nano specific optimisations.
+
+ * Plus hundreds of smaller improvements and tweaks!
+
+ FEATURES
+ * New mpz function: mpz_powm_sec for side-channel quiet modexp
+ computations.
+
+ * New mpn functions: mpn_sqr, mpn_and_n, mpn_ior_n, mpn_xor_n, mpn_nand_n,
+ mpn_nior_n, mpn_xnor_n, mpn_andn_n, mpn_iorn_n, mpn_com, mpn_neg,
+ mpn_copyi, mpn_copyd, mpn_zero.
+
+ * The function mpn_tdiv_qr now allows certain argument overlap.
+
+ * Support for fat binaries for 64-bit x86 processors has been added.
+
+ * A new type, mp_bitcnt_t for bignum bit counts, has been introduced.
+
+ * Support for Windows64 through mingw64 has been added.
+
+ * The cofactors of mpz_gcdext and mpn_gcdext are now more strictly
+ normalised, returning to how GMP 4.2 worked. (Note that also release
+ 4.3.2 has this change.)
+
+ MISC
+ * The mpn_mul function should no longer be used for squaring,
+ instead use the new mpn_sqr.
+
+ * The algorithm selection has been improved, the number of thresholds have
+ more than doubled, and the tuning and use of existing thresholds have
+ been improved.
+
+ * The tune/speed program can measure many of new functions.
+
+ * The mpn_bdivmod function has been removed. We do not consider this an
+ incompatible change, since the function was marked as preliminary.
+
+ * The testsuite has been enhanced in various ways.
+
+
+Changes between GMP version 4.3.1 and 4.3.2
+
+ Bugs:
+ * Fixed bug in mpf_eq.
+ * Fixed overflow issues in mpz_set_str, mpz_inp_str, mpf_set_str, and
+ mpf_get_str.
+ * Avoid unbounded stack allocation for unbalanced multiplication.
+ * Fixed bug in FFT multiplication.
+
+ Speedups:
+ * None, except that proper processor recognition helps affected processors.
+
+ Features:
+ * Recognise more "Core 2" processor variants.
+ * The cofactors of mpz_gcdext and mpn_gcdext are now more strictly
+ normalised, returning to how GMP 4.2 worked.
+
+
+Changes between GMP version 4.3.0 and 4.3.1
+
+ Bugs:
+ * Fixed bug in mpn_gcdext, affecting also mpz_gcdext and mpz_invert.
+ The bug could cause a cofactor to have a leading zero limb, which
+ could lead to crashes or miscomputation later on.
+ * Fixed some minor documentation issues.
+
+ Speedups:
+ * None.
+
+ Features:
+ * Workarounds for various issues with Mac OS X's build tools.
+ * Recognise more IBM "POWER" processor variants.
+
+
+Changes between GMP version 4.2.X and 4.3.0
+
+ Bugs:
+ * Fixed bug in mpz_perfect_power_p with recognition of negative perfect
+ powers that can be written both as an even and odd power.
+ * We might accidentally have added bugs since there is a large amount of
+ new code in this release.
+
+ Speedups:
+ * Vastly improved assembly code for x86-64 processors from AMD and Intel.
+ * Major improvements also for many other processor families, such as
+ Alpha, PowerPC, and Itanium.
+ * New sub-quadratic mpn_gcd and mpn_gcdext, as well as improved basecase
+ gcd code.
+ * The multiply FFT code has been slightly improved.
+ * Balanced multiplication now uses 4-way Toom in addition to schoolbook,
+ Karatsuba, 3-way Toom, and FFT.
+ * Unbalanced multiplication has been vastly improved.
+ * Improved schoolbook division by means of faster quotient approximation.
+ * Several new algorithms for division and mod by single limbs, giving
+ many-fold speedups.
+ * Improved nth root computations.
+ * The mpz_nextprime function uses sieving and is much faster.
+ * Countless minor tweaks.
+
+ Features:
+ * Updated support for fat binaries for x86_32 include current processors
+ * Lots of new mpn internal interfaces. Some of them will become public
+ in a future GMP release.
+ * Support for the 32-bit ABI under x86-apple-darwin.
+ * x86 CPU recognition code should now default better for future
+ processors.
+ * The experimental nails feature does not work in this release, but
+ it might be re-enabled in the future.
+
+ Misc:
+ * The gmp_version variable now always contains three parts. For this
+ release, it is "4.3.0".
+
+
+Changes between GMP version 4.2.3 and 4.2.4
+
+ Bugs:
+ * Fix bug with parsing exponent '+' sign in mpf.
+ * Fix an allocation bug in mpf_set_str, also affecting mpf_init_set_str, and
+ mpf_inp_str.
+
+ Speedups:
+ * None, except that proper processor recognition helps affected processors.
+
+ Features:
+ * Recognize new AMD processors.
+
+
+Changes between GMP version 4.2.2 and 4.2.3
+
+ Bugs:
+ * Fix x86 CPU recognition code to properly identify recent AMD and Intel
+ 64-bit processors.
+ * The >> operator of the C++ wrapper gmpxx.h now does floor rounding, not
+ truncation.
+ * Inline semantics now follow the C99 standard, and works with recent GCC
+ releases.
+ * C++ bitwise logical operations work for more types.
+ * For C++, gmp.h now includes cstdio, improving compiler compatibility.
+ * Bases > 36 now work properly in mpf_set_str.
+
+ Speedups:
+ * None, except that proper processor recognition helps affected processors.
+
+ Features:
+ * The allocation functions now detect overflow of the mpz_t type. This means
+ that overflow will now cause an abort, except when the allocation
+ computation itself overflows. (Such overflow can probably only happen in
+ powering functions; we will detect powering overflow in the future.)
+
+
+Changes between GMP version 4.2.1 and 4.2.2
+
+ * License is now LGPL version 3.
+
+ Bugs:
+ * Shared library numbers corrected for libcxx.
+ * Fixed serious bug in gmpxx.h where a=a+b*c would generate garbage.
+ Note that this only affects C++ programs.
+ * Fix crash in mpz_set_d for arguments with large negative exponent.
+ * Fix 32-bit ABI bug with Itanium assembly for popcount and hamdist.
+ * Fix assembly syntax problem for powerpc-ibm-aix with AIX native assembler.
+ * Fix problems with x86 --enable-fat, where the compiler where told to
+ generate code for the build machine, not plain i386 code as it should.
+ * Improved recognition of powerpc systems wrt Altivec/VMX capability.
+ * Misc minor fixes, mainly workarounds for compiler/assembler bugs.
+
+ Speedups:
+ * "Core 2" and Pentium 4 processors, running in 64-bit mode will get a
+ slight boost as they are now specifically recognized.
+
+ Features:
+ * New support for x86_64-solaris
+ * New, rudimentary support for x86-apple-darwin and x86_64-apple-darwin.
+ (Please see https://gmplib.org/macos.html for more information.)
+
+
+Changes between GMP version 4.2 and 4.2.1
+
+ Bugs:
+ * Shared library numbers corrected.
+ * Broken support for 32-bit AIX fixed.
+ * Misc minor fixes.
+
+ Speedups:
+ * Exact division (mpz_divexact) now falls back to plain division for large
+ operands.
+
+ Features:
+ * Support for some new systems.
+
+
+Changes between GMP version 4.1.4 and 4.2
+
+ Bugs:
+ * Minor bug fixes and code generalizations.
+ * Expanded and improved test suite.
+
+ Speedups:
+ * Many minor optimizations, too many to mention here.
+ * Division now always subquadratic.
+ * Computation of n-factorial much faster.
+ * Added basic x86-64 assembly code.
+ * Floating-point output is now subquadratic for all bases.
+ * FFT multiply code now about 25% faster.
+ * Toom3 multiply code faster.
+
+ Features:
+ * Much improved configure.
+ * Workarounds for many more compiler bugs.
+ * Temporary allocations are now made on the stack only if small.
+ * New systems supported: HPPA-2.0 gcc, IA-64 HP-UX, PowerPC-64 Darwin,
+ Sparc64 GNU/Linux.
+ * New i386 fat binaries, selecting optimised code at runtime (--enable-fat).
+ * New build option: --enable-profiling=instrument.
+ * New memory function: mp_get_memory_functions.
+ * New Mersenne Twister random numbers: gmp_randinit_mt, also now used for
+ gmp_randinit_default.
+ * New random functions: gmp_randinit_set, gmp_urandomb_ui, gmp_urandomm_ui.
+ * New integer functions: mpz_combit, mpz_rootrem.
+ * gmp_printf etc new type "M" for mp_limb_t.
+ * gmp_scanf and friends now accept C99 hex floats.
+ * Numeric input and output can now be in bases up to 62.
+ * Comparisons mpz_cmp_d, mpz_cmpabs_d, mpf_cmp_d recognise infinities.
+ * Conversions mpz_get_d, mpq_get_d, mpf_get_d truncate towards zero,
+ previously their behaviour was unspecified.
+ * Fixes for overflow issues with operands >= 2^31 bits.
+
+ Caveats:
+ * mpfr is gone, and will from now on be released only separately. Please see
+ www.mpfr.org.
+
+
+Changes between GMP version 4.1.3 and 4.1.4
+
+* Bug fix to FFT multiplication code (crash for huge operands).
+* Bug fix to mpf_sub (miscomputation).
+* Support for powerpc64-gnu-linux.
+* Better support for AMD64 in 32-bit mode.
+* Upwardly binary compatible with 4.1.3, 4.1.2, 4.1.1, 4.1, 4.0.1, 4.0,
+ and 3.x versions.
+
+
+Changes between GMP version 4.1.2 and 4.1.3
+
+* Bug fix for FFT multiplication code (miscomputation).
+* Bug fix to K6 assembly code for gcd.
+* Bug fix to IA-64 assembly code for population count.
+* Portability improvements, most notably functional AMD64 support.
+* mpz_export allows NULL for countp parameter.
+* Many minor bug fixes.
+* mpz_export allows NULL for countp parameter.
+* Upwardly binary compatible with 4.1.2, 4.1.1, 4.1, 4.0.1, 4.0, and 3.x
+ versions.
+
+
+Changes between GMP version 4.1.1 and 4.1.2
+
+* Bug fixes.
+
+
+Changes between GMP version 4.1 and 4.1.1
+
+* Bug fixes.
+* New systems supported: NetBSD and OpenBSD sparc64.
+
+
+Changes between GMP version 4.0.1 and 4.1
+
+* Bug fixes.
+* Speed improvements.
+* Upwardly binary compatible with 4.0, 4.0.1, and 3.x versions.
+* Asymptotically fast conversion to/from strings (mpz, mpq, mpn levels), but
+ also major speed improvements for tiny operands.
+* mpn_get_str parameter restrictions relaxed.
+* Major speed improvements for HPPA 2.0 systems.
+* Major speed improvements for UltraSPARC systems.
+* Major speed improvements for IA-64 systems (but still sub-optimal code).
+* Extended test suite.
+* mpfr is back, with many bug fixes and portability improvements.
+* New function: mpz_ui_sub.
+* New functions: mpz_export, mpz_import.
+* Optimization for nth root functions (mpz_root, mpz_perfect_power_p).
+* Optimization for extended gcd (mpz_gcdext, mpz_invert, mpn_gcdext).
+* Generalized low-level number format, reserving a `nails' part of each
+ limb. (Please note that this is really experimental; some functions
+ are likely to compute garbage when nails are enabled.)
+* Nails-enabled Alpha 21264 assembly code, allowing up to 75% better
+ performance. (Use --enable-nails=4 to enable it.)
+
+
+Changes between GMP version 4.0 and 4.0.1
+
+* Bug fixes.
+
+
+Changes between GMP version 3.1.1 and 4.0
+
+* Bug fixes.
+* Speed improvements.
+* Upwardly binary compatible with 3.x versions.
+* New CPU support: IA-64, Pentium 4.
+* Improved CPU support: 21264, Cray vector systems.
+* Support for all MIPS ABIs: o32, n32, 64.
+* New systems supported: Darwin, SCO, Windows DLLs.
+* New divide-and-conquer square root algorithm.
+* New algorithms chapter in the manual.
+* New malloc reentrant temporary memory method.
+* New C++ class interface by Gerardo Ballabio (beta).
+* Revamped configure, featuring ABI selection.
+* Speed improvements for mpz_powm and mpz_powm_ui (mainly affecting small
+ operands).
+* mpz_perfect_power_p now properly recognizes 0, 1, and negative perfect
+ powers.
+* mpz_hamdist now supports negative operands.
+* mpz_jacobi now accepts non-positive denominators.
+* mpz_powm now supports negative exponents.
+* mpn_mul_1 operand overlap requirements relaxed.
+* Float input and output uses locale specific decimal point where available.
+* New gmp_printf, gmp_scanf and related functions.
+* New division functions: mpz_cdiv_q_2exp, mpz_cdiv_r_2exp, mpz_divexact_ui.
+* New divisibility tests: mpz_divisible_p, mpz_divisible_ui_p,
+ mpz_divisible_2exp_p, mpz_congruent_p, mpz_congruent_ui_p,
+ mpz_congruent_2exp_p.
+* New Fibonacci function: mpz_fib2_ui.
+* New Lucas number functions: mpz_lucnum_ui, mpz_lucnum2_ui.
+* Other new integer functions: mpz_cmp_d, mpz_cmpabs_d, mpz_get_d_2exp,
+ mpz_init2, mpz_kronecker, mpz_lcm_ui, mpz_realloc2.
+* New rational I/O: mpq_get_str, mpq_inp_str, mpq_out_str, mpq_set_str.
+* Other new rational functions: mpq_abs, mpq_cmp_si, mpq_div_2exp,
+ mpq_mul_2exp, mpq_set_f.
+* New float tests: mpf_integer_p, mpf_fits_sint_p, mpf_fits_slong_p,
+ mpf_fits_sshort_p, mpf_fits_uint_p, mpf_fits_ulong_p, mpf_fits_ushort_p.
+* Other new float functions: mpf_cmp_d, mpf_get_default_prec, mpf_get_si,
+ mpf_get_ui, mpf_get_d_2exp.
+* New random functions: gmp_randinit_default, gmp_randinit_lc_2exp_size.
+* New demo expression string parser (see demos/expr).
+* New preliminary perl interface (see demos/perl).
+* Tuned algorithm thresholds for many more CPUs.
+
+
+Changes between GMP version 3.1 and 3.1.1
+
+* Bug fixes for division (rare), mpf_get_str, FFT, and miscellaneous minor
+ things.
+
+
+Changes between GMP version 3.0 and 3.1
+
+* Bug fixes.
+* Improved `make check' running more tests.
+* Tuned algorithm cutoff points for many machines. This will improve speed for
+ a lot of operations, in some cases by a large amount.
+* Major speed improvements: Alpha 21264.
+* Some speed improvements: Cray vector computers, AMD K6 and Athlon, Intel P5
+ and Pentium Pro/II/III.
+* The mpf_get_prec function now works as it did in GMP 2.
+* New utilities for auto-tuning and speed measuring.
+* Multiplication now optionally uses FFT for very large operands. (To enable
+ it, pass --enable-fft to configure.)
+* Support for new systems: Solaris running on x86, FreeBSD 5, HP-UX 11, Cray
+ vector computers, Rhapsody, Nextstep/Openstep, MacOS.
+* Support for shared libraries on 32-bit HPPA.
+* New integer functions: mpz_mul_si, mpz_odd_p, mpz_even_p.
+* New Kronecker symbol functions: mpz_kronecker_si, mpz_kronecker_ui,
+ mpz_si_kronecker, mpz_ui_kronecker.
+* New rational functions: mpq_out_str, mpq_swap.
+* New float functions: mpf_swap.
+* New mpn functions: mpn_divexact_by3c, mpn_tdiv_qr.
+* New EXPERIMENTAL function layer for accurate floating-point arithmetic, mpfr.
+ To try it, pass --enable-mpfr to configure. See the mpfr subdirectory for
+ more information; it is not documented in the main GMP manual.
+
+
+Changes between GMP version 3.0 and 3.0.1
+
+* Memory leaks in gmp_randinit and mpz_probab_prime_p fixed.
+* Documentation for gmp_randinit fixed. Misc documentation errors fixed.
+
+
+Changes between GMP version 2.0 and 3.0
+
+* Source level compatibility with past releases (except mpn_gcd).
+* Bug fixes.
+* Much improved speed thanks to both host independent and host dependent
+ optimizations.
+* Switch to autoconf/automake/libtool.
+* Support for building libgmp as a shared library.
+* Multiplication and squaring using 3-way Toom-Cook.
+* Division using the Burnikel-Ziegler method.
+* New functions computing binomial coefficients: mpz_bin_ui, mpz_bin_uiui.
+* New function computing Fibonacci numbers: mpz_fib_ui.
+* New random number generators: mpf_urandomb, mpz_rrandomb, mpz_urandomb,
+ mpz_urandomm, gmp_randclear, gmp_randinit, gmp_randinit_lc_2exp,
+ gmp_randseed, gmp_randseed_ui.
+* New function for quickly extracting limbs: mpz_getlimbn.
+* New functions performing integer size tests: mpz_fits_sint_p,
+ mpz_fits_slong_p, mpz_fits_sshort_p, mpz_fits_uint_p, mpz_fits_ulong_p,
+ mpz_fits_ushort_p.
+* New mpf functions: mpf_ceil, mpf_floor, mpf_pow_ui, mpf_trunc.
+* New mpq function: mpq_set_d.
+* New mpz functions: mpz_addmul_ui, mpz_cmpabs, mpz_cmpabs_ui, mpz_lcm,
+ mpz_nextprime, mpz_perfect_power_p, mpz_remove, mpz_root, mpz_swap,
+ mpz_tdiv_ui, mpz_tstbit, mpz_xor.
+* New mpn function: mpn_divexact_by3.
+* New CPU support: DEC Alpha 21264, AMD K6 and Athlon, HPPA 2.0 and 64,
+ Intel Pentium Pro and Pentium-II/III, Sparc 64, PowerPC 64.
+* Almost 10 times faster mpz_invert and mpn_gcdext.
+* The interface of mpn_gcd has changed.
+* Better support for MIPS R4x000 and R5000 under Irix 6.
+* Improved support for SPARCv8 and SPARCv9 processors.
+
+
+Changes between GMP version 2.0 and 2.0.2
+
+* Many bug fixes.
+
+
+Changes between GMP version 1.3.2 and 2.0
+
+* Division routines in the mpz class have changed. There are three classes of
+ functions, that rounds the quotient to -infinity, 0, and +infinity,
+ respectively. The first class of functions have names that begin with
+ mpz_fdiv (f is short for floor), the second class' names begin with mpz_tdiv
+ (t is short for trunc), and the third class' names begin with mpz_cdiv (c is
+ short for ceil).
+
+ The old division routines beginning with mpz_m are similar to the new
+ mpz_fdiv, with the exception that some of the new functions return useful
+ values.
+
+ The old function names can still be used. All the old functions names will
+ now do floor division, not trunc division as some of them used to. This was
+ changed to make the functions more compatible with common mathematical
+ practice.
+
+ The mpz_mod and mpz_mod_ui functions now compute the mathematical mod
+ function. I.e., the sign of the 2nd argument is ignored.
+
+* The mpq assignment functions do not canonicalize their results. A new
+ function, mpq_canonicalize must be called by the user if the result is not
+ known to be canonical.
+* The mpn functions are now documented. These functions are intended for
+ very time critical applications, or applications that need full control over
+ memory allocation. Note that the mpn interface is irregular and hard to
+ use.
+* New functions for arbitrary precision floating point arithmetic. Names
+ begin with `mpf_'. Associated type mpf_t.
+* New and improved mpz functions, including much faster GCD, fast exact
+ division (mpz_divexact), bit scan (mpz_scan0 and mpz_scan1), and number
+ theoretical functions like Jacobi (mpz_jacobi) and multiplicative inverse
+ (mpz_invert).
+* New variable types (mpz_t and mpq_t) are available that makes syntax of
+ mpz and mpq calls nicer (no need for & before variables). The MP_INT and
+ MP_RAT types are still available for compatibility.
+* Uses GNU configure. This makes it possible to choose target architecture
+ and CPU variant, and to compile into a separate object directory.
+* Carefully optimized assembly for important inner loops. Support for DEC
+ Alpha, Amd 29000, HPPA 1.0 and 1.1, Intel Pentium and generic x86, Intel
+ i960, Motorola MC68000, MC68020, MC88100, and MC88110, Motorola/IBM
+ PowerPC, National NS32000, IBM POWER, MIPS R3000, R4000, SPARCv7,
+ SuperSPARC, generic SPARCv8, and DEC VAX. Some support also for ARM,
+ Clipper, IBM ROMP (RT), and Pyramid AP/XP.
+* Faster. Thanks to the assembler code, new algorithms, and general tuning.
+ In particular, the speed on machines without GCC is improved.
+* Support for machines without alloca.
+* Now under the LGPL.
+
+INCOMPATIBILITIES BETWEEN GMP 1 AND GMP 2
+
+* mpq assignment functions do not canonicalize their results.
+* mpz division functions round differently.
+* mpz mod functions now really compute mod.
+* mpz_powm and mpz_powm_ui now really use mod for reduction.
diff --git a/Build/source/libs/gmp/gmp-6.0.0/README b/Build/source/libs/gmp/gmp-6.0.0/README
new file mode 100644
index 00000000000..013899dc09c
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/README
@@ -0,0 +1,116 @@
+Copyright 1991, 1996, 1999, 2000, 2007 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/.
+
+
+
+
+
+
+ THE GNU MP LIBRARY
+
+
+GNU MP is a library for arbitrary precision arithmetic, operating on signed
+integers, rational numbers, and floating point numbers. It has a rich set of
+functions, and the functions have a regular interface.
+
+GNU MP is designed to be as fast as possible, both for small operands and huge
+operands. The speed is achieved by using fullwords as the basic arithmetic
+type, by using fast algorithms, with carefully optimized assembly code for the
+most common inner loops for lots of CPUs, and by a general emphasis on speed
+(instead of simplicity or elegance).
+
+GNU MP is believed to be faster than any other similar library. Its advantage
+increases with operand sizes for certain operations, since GNU MP in many
+cases has asymptotically faster algorithms.
+
+GNU MP is free software and may be freely copied on the terms contained in the
+files COPYING* (see the manual for information on which license(s) applies to
+which components of GNU MP).
+
+
+
+ OVERVIEW OF GNU MP
+
+There are five classes of functions in GNU MP.
+
+ 1. Signed integer arithmetic functions (mpz). These functions are intended
+ to be easy to use, with their regular interface. The associated type is
+ `mpz_t'.
+
+ 2. Rational arithmetic functions (mpq). For now, just a small set of
+ functions necessary for basic rational arithmetics. The associated type
+ is `mpq_t'.
+
+ 3. Floating-point arithmetic functions (mpf). If the C type `double'
+ doesn't give enough precision for your application, declare your
+ variables as `mpf_t' instead, set the precision to any number desired,
+ and call the functions in the mpf class for the arithmetic operations.
+
+ 4. Positive-integer, hard-to-use, very low overhead functions are in the
+ mpn class. No memory management is performed. The caller must ensure
+ enough space is available for the results. The set of functions is not
+ regular, nor is the calling interface. These functions accept input
+ arguments in the form of pairs consisting of a pointer to the least
+ significant word, and an integral size telling how many limbs (= words)
+ the pointer points to.
+
+ Almost all calculations, in the entire package, are made by calling these
+ low-level functions.
+
+ 5. Berkeley MP compatible functions.
+
+ To use these functions, include the file "mp.h". You can test if you are
+ using the GNU version by testing if the symbol __GNU_MP__ is defined.
+
+For more information on how to use GNU MP, please refer to the documentation.
+It is composed from the file doc/gmp.texi, and can be displayed on the screen
+or printed. How to do that, as well how to build the library, is described in
+the INSTALL file in this directory.
+
+
+
+ REPORTING BUGS
+
+If you find a bug in the library, please make sure to tell us about it!
+
+You should first check the GNU MP web pages at https://gmplib.org/, under
+"Status of the current release". There will be patches for all known serious
+bugs there.
+
+Report bugs to gmp-bugs@gmplib.org. What information is needed in a useful bug
+report is described in the manual. The same address can be used for suggesting
+modifications and enhancements.
+
+
+
+
+----------------
+Local variables:
+mode: text
+fill-column: 78
+End:
diff --git a/Build/source/libs/gmp/gmp-6.0.0/acinclude.m4 b/Build/source/libs/gmp/gmp-6.0.0/acinclude.m4
new file mode 100644
index 00000000000..227712a5db0
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/acinclude.m4
@@ -0,0 +1,3984 @@
+dnl GMP specific autoconf macros
+
+
+dnl Copyright 2000-2006, 2009, 2011, 2013, 2014 Free Software Foundation, Inc.
+dnl
+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 Some tests use, or must delete, the default compiler output. The
+dnl possible filenames are based on what autoconf looks for, namely
+dnl
+dnl a.out - normal unix style
+dnl b.out - i960 systems, including gcc there
+dnl a.exe - djgpp
+dnl a_out.exe - OpenVMS DEC C called via GNV wrapper (gnv.sourceforge.net)
+dnl conftest.exe - various DOS compilers
+
+
+define(IA64_PATTERN,
+[[ia64*-*-* | itanium-*-* | itanium2-*-*]])
+
+dnl Need to be careful not to match m6811, m6812, m68hc11 and m68hc12, all
+dnl of which config.sub accepts. (Though none of which are likely to work
+dnl with GMP.)
+dnl
+define(M68K_PATTERN,
+[[m68k-*-* | m68[0-9][0-9][0-9]-*-*]])
+
+define(POWERPC64_PATTERN,
+[[powerpc64-*-* | powerpc64le-*-* | powerpc620-*-* | powerpc630-*-* | powerpc970-*-* | power[3-9]-*-*]])
+
+define(S390_PATTERN,
+[[s390-*-* | z900esa-*-* | z990esa-*-* | z9esa-*-* | z10esa-*-* | z196esa-*-*]])
+
+define(S390X_PATTERN,
+[[s390x-*-* | z900-*-* | z990-*-* | z9-*-* | z10-*-* | z196-*-*]])
+
+define(X86_PATTERN,
+[[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-*-* | core2-*-* | corei*-*-* | x86_64-*-* | nano-*-*]])
+
+dnl GMP_FAT_SUFFIX(DSTVAR, DIRECTORY)
+dnl ---------------------------------
+dnl Emit code to set shell variable DSTVAR to the suffix for a fat binary
+dnl routine from DIRECTORY. DIRECTORY can be a shell expression like $foo
+dnl etc.
+dnl
+dnl The suffix is directory separators / or \ changed to underscores, and
+dnl if there's more than one directory part, then the first is dropped.
+dnl
+dnl For instance,
+dnl
+dnl x86 -> x86
+dnl x86/k6 -> k6
+dnl x86/k6/mmx -> k6_mmx
+
+define(GMP_FAT_SUFFIX,
+[[$1=`echo $2 | sed -e '/\//s:^[^/]*/::' -e 's:[\\/]:_:g'`]])
+
+
+dnl GMP_REMOVE_FROM_LIST(listvar,item)
+dnl ----------------------------------
+dnl Emit code to remove any occurrence of ITEM from $LISTVAR. ITEM can be a
+dnl shell expression like $foo if desired.
+
+define(GMP_REMOVE_FROM_LIST,
+[remove_from_list_tmp=
+for remove_from_list_i in $[][$1]; do
+ if test $remove_from_list_i = [$2]; then :;
+ else
+ remove_from_list_tmp="$remove_from_list_tmp $remove_from_list_i"
+ fi
+done
+[$1]=$remove_from_list_tmp
+])
+
+
+dnl GMP_STRIP_PATH(subdir)
+dnl ----------------------
+dnl Strip entries */subdir from $path and $fat_path.
+
+define(GMP_STRIP_PATH,
+[GMP_STRIP_PATH_VAR(path, [$1])
+GMP_STRIP_PATH_VAR(fat_path, [$1])
+])
+
+define(GMP_STRIP_PATH_VAR,
+[tmp_path=
+for i in $[][$1]; do
+ case $i in
+ */[$2]) ;;
+ *) tmp_path="$tmp_path $i" ;;
+ esac
+done
+[$1]="$tmp_path"
+])
+
+
+dnl GMP_INCLUDE_GMP_H
+dnl -----------------
+dnl Expand to the right way to #include gmp-h.in. This must be used
+dnl instead of gmp.h, since that file isn't generated until the end of the
+dnl configure.
+dnl
+dnl Dummy value for GMP_LIMB_BITS is enough
+dnl for all current configure-time uses of gmp.h.
+
+define(GMP_INCLUDE_GMP_H,
+[[#define __GMP_WITHIN_CONFIGURE 1 /* ignore template stuff */
+#define GMP_NAIL_BITS $GMP_NAIL_BITS
+#define GMP_LIMB_BITS 123
+$DEFN_LONG_LONG_LIMB
+#include "$srcdir/gmp-h.in"]
+])
+
+
+dnl GMP_HEADER_GETVAL(NAME,FILE)
+dnl ----------------------------
+dnl Expand at autoconf time to the value of a "#define NAME" from the given
+dnl FILE. The regexps here aren't very rugged, but are enough for gmp.
+dnl /dev/null as a parameter prevents a hang if $2 is accidentally omitted.
+
+define(GMP_HEADER_GETVAL,
+[patsubst(patsubst(
+esyscmd([grep "^#define $1 " $2 /dev/null 2>/dev/null]),
+[^.*$1[ ]+],[]),
+[[
+ ]*$],[])])
+
+
+dnl GMP_VERSION
+dnl -----------
+dnl The gmp version number, extracted from the #defines in gmp-h.in at
+dnl autoconf time. Two digits like 3.0 if patchlevel <= 0, or three digits
+dnl like 3.0.1 if patchlevel > 0.
+
+define(GMP_VERSION,
+[GMP_HEADER_GETVAL(__GNU_MP_VERSION,gmp-h.in)[]dnl
+.GMP_HEADER_GETVAL(__GNU_MP_VERSION_MINOR,gmp-h.in)[]dnl
+.GMP_HEADER_GETVAL(__GNU_MP_VERSION_PATCHLEVEL,gmp-h.in)])
+
+
+dnl GMP_SUBST_CHECK_FUNCS(func,...)
+dnl ------------------------------
+dnl Setup an AC_SUBST of HAVE_FUNC_01 for each argument.
+
+AC_DEFUN([GMP_SUBST_CHECK_FUNCS],
+[m4_if([$1],,,
+[_GMP_SUBST_CHECK_FUNCS(ac_cv_func_[$1],HAVE_[]m4_translit([$1],[a-z],[A-Z])_01)
+GMP_SUBST_CHECK_FUNCS(m4_shift($@))])])
+
+dnl Called: _GMP_SUBST_CHECK_FUNCS(cachevar,substvar)
+AC_DEFUN([_GMP_SUBST_CHECK_FUNCS],
+[case $[$1] in
+yes) AC_SUBST([$2],1) ;;
+no) [$2]=0 ;;
+esac
+])
+
+
+dnl GMP_SUBST_CHECK_HEADERS(foo.h,...)
+dnl ----------------------------------
+dnl Setup an AC_SUBST of HAVE_FOO_H_01 for each argument.
+
+AC_DEFUN([GMP_SUBST_CHECK_HEADERS],
+[m4_if([$1],,,
+[_GMP_SUBST_CHECK_HEADERS(ac_cv_header_[]m4_translit([$1],[./],[__]),
+HAVE_[]m4_translit([$1],[a-z./],[A-Z__])_01)
+GMP_SUBST_CHECK_HEADERS(m4_shift($@))])])
+
+dnl Called: _GMP_SUBST_CHECK_HEADERS(cachevar,substvar)
+AC_DEFUN([_GMP_SUBST_CHECK_HEADERS],
+[case $[$1] in
+yes) AC_SUBST([$2],1) ;;
+no) [$2]=0 ;;
+esac
+])
+
+
+dnl GMP_COMPARE_GE(A1,B1, A2,B2, ...)
+dnl ---------------------------------
+dnl Compare two version numbers A1.A2.etc and B1.B2.etc. Set
+dnl $gmp_compare_ge to yes or no according to the result. The A parts
+dnl should be variables, the B parts fixed numbers. As many parts as
+dnl desired can be included. An empty string in an A part is taken to be
+dnl zero, the B parts should be non-empty and non-zero.
+dnl
+dnl For example,
+dnl
+dnl GMP_COMPARE($major,10, $minor,3, $subminor,1)
+dnl
+dnl would test whether $major.$minor.$subminor is greater than or equal to
+dnl 10.3.1.
+
+AC_DEFUN([GMP_COMPARE_GE],
+[gmp_compare_ge=no
+GMP_COMPARE_GE_INTERNAL($@)
+])
+
+AC_DEFUN([GMP_COMPARE_GE_INTERNAL],
+[ifelse(len([$3]),0,
+[if test -n "$1" && test "$1" -ge $2; then
+ gmp_compare_ge=yes
+fi],
+[if test -n "$1"; then
+ if test "$1" -gt $2; then
+ gmp_compare_ge=yes
+ else
+ if test "$1" -eq $2; then
+ GMP_COMPARE_GE_INTERNAL(m4_shift(m4_shift($@)))
+ fi
+ fi
+fi])
+])
+
+
+dnl GMP_PROG_AR
+dnl -----------
+dnl GMP additions to $AR.
+dnl
+dnl A cross-"ar" may be necessary when cross-compiling since the build
+dnl system "ar" might try to interpret the object files to build a symbol
+dnl table index, hence the use of AC_CHECK_TOOL.
+dnl
+dnl A user-selected $AR is always left unchanged. AC_CHECK_TOOL is still
+dnl run to get the "checking" message printed though.
+dnl
+dnl If extra flags are added to AR, then ac_cv_prog_AR and
+dnl ac_cv_prog_ac_ct_AR are set too, since libtool (cvs 2003-03-31 at
+dnl least) will do an AC_CHECK_TOOL and that will AR from one of those two
+dnl cached variables. (ac_cv_prog_AR is used if there's an ac_tool_prefix,
+dnl or ac_cv_prog_ac_ct_AR is used otherwise.) FIXME: This is highly
+dnl dependent on autoconf internals, perhaps it'd work to put our extra
+dnl flags into AR_FLAGS instead.
+dnl
+dnl $AR_FLAGS is set to "cq" rather than leaving it to libtool "cru". The
+dnl latter fails when libtool goes into piecewise mode and is unlucky
+dnl enough to have two same-named objects in separate pieces, as happens
+dnl for instance to random.o (and others) on vax-dec-ultrix4.5. Naturally
+dnl a user-selected $AR_FLAGS is left unchanged.
+dnl
+dnl For reference, $ARFLAGS is used by automake (1.8) for its ".a" archive
+dnl file rules. This doesn't get used by the piecewise linking, so we
+dnl leave it at the default "cru".
+dnl
+dnl FIXME: Libtool 1.5.2 has its own arrangements for "cq", but that version
+dnl is broken in other ways. When we can upgrade, remove the forcible
+dnl AR_FLAGS=cq.
+
+AC_DEFUN([GMP_PROG_AR],
+[dnl Want to establish $AR before libtool initialization.
+AC_BEFORE([$0],[AC_PROG_LIBTOOL])
+gmp_user_AR=$AR
+AC_CHECK_TOOL(AR, ar, ar)
+if test -z "$gmp_user_AR"; then
+ eval arflags=\"\$ar${abi1}_flags\"
+ test -n "$arflags" || eval arflags=\"\$ar${abi2}_flags\"
+ if test -n "$arflags"; then
+ AC_MSG_CHECKING([for extra ar flags])
+ AR="$AR $arflags"
+ ac_cv_prog_AR="$AR $arflags"
+ ac_cv_prog_ac_ct_AR="$AR $arflags"
+ AC_MSG_RESULT([$arflags])
+ fi
+fi
+if test -z "$AR_FLAGS"; then
+ AR_FLAGS=cq
+fi
+])
+
+
+dnl GMP_PROG_M4
+dnl -----------
+dnl Find a working m4, either in $PATH or likely locations, and setup $M4
+dnl and an AC_SUBST accordingly. If $M4 is already set then it's a user
+dnl choice and is accepted with no checks. GMP_PROG_M4 is like
+dnl AC_PATH_PROG or AC_CHECK_PROG, but tests each m4 found to see if it's
+dnl good enough.
+dnl
+dnl See mpn/asm-defs.m4 for details on the known bad m4s.
+
+AC_DEFUN([GMP_PROG_M4],
+[AC_ARG_VAR(M4,[m4 macro processor])
+AC_CACHE_CHECK([for suitable m4],
+ gmp_cv_prog_m4,
+[if test -n "$M4"; then
+ gmp_cv_prog_m4="$M4"
+else
+ cat >conftest.m4 <<\EOF
+dnl Must protect this against being expanded during autoconf m4!
+dnl Dont put "dnl"s in this as autoconf will flag an error for unexpanded
+dnl macros.
+[define(dollarhash,``$][#'')ifelse(dollarhash(x),1,`define(t1,Y)',
+``bad: $][# not supported (SunOS /usr/bin/m4)
+'')ifelse(eval(89),89,`define(t2,Y)',
+`bad: eval() doesnt support 8 or 9 in a constant (OpenBSD 2.6 m4)
+')ifelse(eval(9,9),10,`define(t3,Y)',
+`bad: eval() doesnt support radix in eval (FreeBSD 8.x,9.0,9.1,9.2 m4)
+')ifelse(t1`'t2`'t3,YYY,`good
+')]
+EOF
+dnl ' <- balance the quotes for emacs sh-mode
+ echo "trying m4" >&AC_FD_CC
+ gmp_tmp_val=`(m4 conftest.m4) 2>&AC_FD_CC`
+ echo "$gmp_tmp_val" >&AC_FD_CC
+ if test "$gmp_tmp_val" = good; then
+ gmp_cv_prog_m4="m4"
+ else
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+dnl $ac_dummy forces splitting on constant user-supplied paths.
+dnl POSIX.2 word splitting is done only on the output of word expansions,
+dnl not every word. This closes a longstanding sh security hole.
+ ac_dummy="$PATH:/usr/5bin"
+ for ac_dir in $ac_dummy; do
+ test -z "$ac_dir" && ac_dir=.
+ echo "trying $ac_dir/m4" >&AC_FD_CC
+ gmp_tmp_val=`($ac_dir/m4 conftest.m4) 2>&AC_FD_CC`
+ echo "$gmp_tmp_val" >&AC_FD_CC
+ if test "$gmp_tmp_val" = good; then
+ gmp_cv_prog_m4="$ac_dir/m4"
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+ if test -z "$gmp_cv_prog_m4"; then
+ AC_MSG_ERROR([No usable m4 in \$PATH or /usr/5bin (see config.log for reasons).])
+ fi
+ fi
+ rm -f conftest.m4
+fi])
+M4="$gmp_cv_prog_m4"
+AC_SUBST(M4)
+])
+
+
+dnl GMP_M4_M4WRAP_SPURIOUS
+dnl ----------------------
+dnl Check for spurious output from m4wrap(), as described in mpn/asm-defs.m4.
+dnl
+dnl The following systems have been seen with the problem.
+dnl
+dnl - Unicos alpha, but its assembler doesn't seem to mind.
+dnl - MacOS X Darwin, its assembler fails.
+dnl - NetBSD 1.4.1 m68k, and gas 1.92.3 there gives a warning and ignores
+dnl the bad last line since it doesn't have a newline.
+dnl - NetBSD 1.4.2 alpha, but its assembler doesn't seem to mind.
+dnl - HP-UX ia64.
+dnl
+dnl Enhancement: Maybe this could be in GMP_PROG_M4, and attempt to prefer
+dnl an m4 with a working m4wrap, if it can be found.
+
+AC_DEFUN([GMP_M4_M4WRAP_SPURIOUS],
+[AC_REQUIRE([GMP_PROG_M4])
+AC_CACHE_CHECK([if m4wrap produces spurious output],
+ gmp_cv_m4_m4wrap_spurious,
+[# hide the d-n-l from autoconf's error checking
+tmp_d_n_l=d""nl
+cat >conftest.m4 <<EOF
+[changequote({,})define(x,)m4wrap({x})$tmp_d_n_l]
+EOF
+echo test input is >&AC_FD_CC
+cat conftest.m4 >&AC_FD_CC
+tmp_chars=`$M4 conftest.m4 | wc -c`
+echo produces $tmp_chars chars output >&AC_FD_CC
+rm -f conftest.m4
+if test $tmp_chars = 0; then
+ gmp_cv_m4_m4wrap_spurious=no
+else
+ gmp_cv_m4_m4wrap_spurious=yes
+fi
+])
+GMP_DEFINE_RAW(["define(<M4WRAP_SPURIOUS>,<$gmp_cv_m4_m4wrap_spurious>)"])
+])
+
+
+dnl GMP_PROG_NM
+dnl -----------
+dnl GMP additions to libtool AC_PROG_NM.
+dnl
+dnl Note that if AC_PROG_NM can't find a working nm it still leaves
+dnl $NM set to "nm", so $NM can't be assumed to actually work.
+dnl
+dnl A user-selected $NM is always left unchanged. AC_PROG_NM is still run
+dnl to get the "checking" message printed though.
+dnl
+dnl Perhaps it'd be worthwhile checking that nm works, by running it on an
+dnl actual object file. For instance on sparcv9 solaris old versions of
+dnl GNU nm don't recognise 64-bit objects. Checking would give a better
+dnl error message than just a failure in later tests like GMP_ASM_W32 etc.
+dnl
+dnl On the other hand it's not really normal autoconf practice to take too
+dnl much trouble over detecting a broken set of tools. And libtool doesn't
+dnl do anything at all for say ranlib or strip. So for now we're inclined
+dnl to just demand that the user provides a coherent environment.
+
+AC_DEFUN([GMP_PROG_NM],
+[dnl Make sure we're the first to call AC_PROG_NM, so our extra flags are
+dnl used by everyone.
+AC_BEFORE([$0],[AC_PROG_NM])
+gmp_user_NM=$NM
+AC_PROG_NM
+
+# FIXME: When cross compiling (ie. $ac_tool_prefix not empty), libtool
+# defaults to plain "nm" if a "${ac_tool_prefix}nm" is not found. In this
+# case run it again to try the native "nm", firstly so that likely locations
+# are searched, secondly so that -B or -p are added if necessary for BSD
+# format. This is necessary for instance on OSF with "./configure
+# --build=alphaev5-dec-osf --host=alphaev6-dec-osf".
+#
+if test -z "$gmp_user_NM" && test -n "$ac_tool_prefix" && test "$NM" = nm; then
+ $as_unset lt_cv_path_NM
+ gmp_save_ac_tool_prefix=$ac_tool_prefix
+ ac_tool_prefix=
+ NM=
+ AC_PROG_NM
+ ac_tool_prefix=$gmp_save_ac_tool_prefix
+fi
+
+if test -z "$gmp_user_NM"; then
+ eval nmflags=\"\$nm${abi1}_flags\"
+ test -n "$nmflags" || eval nmflags=\"\$nm${abi2}_flags\"
+ if test -n "$nmflags"; then
+ AC_MSG_CHECKING([for extra nm flags])
+ NM="$NM $nmflags"
+ AC_MSG_RESULT([$nmflags])
+ fi
+fi
+])
+
+
+dnl GMP_PROG_CC_WORKS(cc+cflags,[ACTION-IF-WORKS][,ACTION-IF-NOT-WORKS])
+dnl --------------------------------------------------------------------
+dnl Check if cc+cflags can compile and link.
+dnl
+dnl This test is designed to be run repeatedly with different cc+cflags
+dnl selections, so the result is not cached.
+dnl
+dnl For a native build, meaning $cross_compiling == no, we require that the
+dnl generated program will run. This is the same as AC_PROG_CC does in
+dnl _AC_COMPILER_EXEEXT_WORKS, and checking here will ensure we don't pass
+dnl a CC/CFLAGS combination that it rejects.
+dnl
+dnl sparc-*-solaris2.7 can compile ABI=64 but won't run it if the kernel
+dnl was booted in 32-bit mode. The effect of requiring the compiler output
+dnl will run is that a plain native "./configure" falls back on ABI=32, but
+dnl ABI=64 is still available as a cross-compile.
+dnl
+dnl The various specific problems we try to detect are done in separate
+dnl compiles. Although this is probably a bit slower than one test
+dnl program, it makes it easy to indicate the problem in AC_MSG_RESULT,
+dnl hence giving the user a clue about why we rejected the compiler.
+
+AC_DEFUN([GMP_PROG_CC_WORKS],
+[AC_MSG_CHECKING([compiler $1])
+gmp_prog_cc_works=yes
+
+# first see a simple "main()" works, then go on to other checks
+GMP_PROG_CC_WORKS_PART([$1], [])
+
+GMP_PROG_CC_WORKS_PART([$1], [function pointer return],
+[/* The following provokes an internal error from gcc 2.95.2 -mpowerpc64
+ (without -maix64), hence detecting an unusable compiler */
+void *g() { return (void *) 0; }
+void *f() { return g(); }
+])
+
+GMP_PROG_CC_WORKS_PART([$1], [cmov instruction],
+[/* The following provokes an invalid instruction syntax from i386 gcc
+ -march=pentiumpro on Solaris 2.8. The native sun assembler
+ requires a non-standard syntax for cmov which gcc (as of 2.95.2 at
+ least) doesn't know. */
+int n;
+int cmov () { return (n >= 0 ? n : 0); }
+])
+
+GMP_PROG_CC_WORKS_PART([$1], [double -> ulong conversion],
+[/* The following provokes a linker invocation problem with gcc 3.0.3
+ on AIX 4.3 under "-maix64 -mpowerpc64 -mcpu=630". The -mcpu=630
+ option causes gcc to incorrectly select the 32-bit libgcc.a, not
+ the 64-bit one, and consequently it misses out on the __fixunsdfdi
+ helper (double -> uint64 conversion). */
+double d;
+unsigned long gcc303 () { return (unsigned long) d; }
+])
+
+GMP_PROG_CC_WORKS_PART([$1], [double negation],
+[/* The following provokes an error from hppa gcc 2.95 under -mpa-risc-2-0 if
+ the assembler doesn't know hppa 2.0 instructions. fneg is a 2.0
+ instruction, and a negation like this comes out using it. */
+double fneg_data;
+unsigned long fneg () { return -fneg_data; }
+])
+
+GMP_PROG_CC_WORKS_PART([$1], [double -> float conversion],
+[/* The following makes gcc 3.3 -march=pentium4 generate an SSE2 xmm insn
+ (cvtsd2ss) which will provoke an error if the assembler doesn't recognise
+ those instructions. Not sure how much of the gmp code will come out
+ wanting sse2, but it's easiest to reject an option we know is bad. */
+double ftod_data;
+float ftod () { return (float) ftod_data; }
+])
+
+GMP_PROG_CC_WORKS_PART([$1], [gnupro alpha ev6 char spilling],
+[/* The following provokes an internal compiler error from gcc version
+ "2.9-gnupro-99r1" under "-O2 -mcpu=ev6", apparently relating to char
+ values being spilled into floating point registers. The problem doesn't
+ show up all the time, but has occurred enough in GMP for us to reject
+ this compiler+flags. */
+#include <string.h> /* for memcpy */
+struct try_t
+{
+ char dst[2];
+ char size;
+ long d0, d1, d2, d3, d4, d5, d6;
+ char overlap;
+};
+struct try_t param[6];
+int
+param_init ()
+{
+ struct try_t *p;
+ memcpy (p, &param[ 2 ], sizeof (*p));
+ memcpy (p, &param[ 2 ], sizeof (*p));
+ p->size = 2;
+ memcpy (p, &param[ 1 ], sizeof (*p));
+ p->dst[0] = 1;
+ p->overlap = 2;
+ memcpy (p, &param[ 3 ], sizeof (*p));
+ p->dst[0] = 1;
+ p->overlap = 8;
+ memcpy (p, &param[ 4 ], sizeof (*p));
+ memcpy (p, &param[ 4 ], sizeof (*p));
+ p->overlap = 8;
+ memcpy (p, &param[ 5 ], sizeof (*p));
+ memcpy (p, &param[ 5 ], sizeof (*p));
+ memcpy (p, &param[ 5 ], sizeof (*p));
+ return 0;
+}
+])
+
+# __builtin_alloca is not available everywhere, check it exists before
+# seeing that it works
+GMP_PROG_CC_WORKS_PART_TEST([$1],[__builtin_alloca availability],
+[int k; int foo () { __builtin_alloca (k); }],
+ [GMP_PROG_CC_WORKS_PART([$1], [alloca array],
+[/* The following provokes an internal compiler error from Itanium HP-UX cc
+ under +O2 or higher. We use this sort of code in mpn/generic/mul_fft.c. */
+int k;
+int foo ()
+{
+ int i, **a;
+ a = __builtin_alloca (k);
+ for (i = 0; i <= k; i++)
+ a[i] = __builtin_alloca (1 << i);
+}
+])])
+
+GMP_PROG_CC_WORKS_PART([$1], [abs int -> double conversion],
+[/* The following provokes an internal error from the assembler on
+ power2-ibm-aix4.3.1.0. gcc -mrios2 compiles to nabs+fcirz, and this
+ results in "Internal error related to the source program domain".
+
+ For reference it seems to be the combination of nabs+fcirz which is bad,
+ not either alone. This sort of thing occurs in mpz/get_str.c with the
+ way double chars_per_bit_exactly is applied in MPN_SIZEINBASE. Perhaps
+ if that code changes to a scaled-integer style then we won't need this
+ test. */
+
+double fp[1];
+int x;
+int f ()
+{
+ int a;
+ a = (x >= 0 ? x : -x);
+ return a * fp[0];
+}
+])
+
+GMP_PROG_CC_WORKS_PART([$1], [long long reliability test 1],
+[/* The following provokes a segfault in the compiler on powerpc-apple-darwin.
+ Extracted from tests/mpn/t-iord_u.c. Causes Apple's gcc 3.3 build 1640 and
+ 1666 to segfault with e.g., -O2 -mpowerpc64. */
+
+#if defined (__GNUC__) && ! defined (__cplusplus)
+typedef unsigned long long t1;typedef t1*t2;
+static __inline__ t1 e(t2 rp,t2 up,int n,t1 v0)
+{t1 c,x,r;int i;if(v0){c=1;for(i=1;i<n;i++){x=up[i];r=x+1;rp[i]=r;}}return c;}
+f(){static const struct{t1 n;t1 src[9];t1 want[9];}d[]={{1,{0},{1}},};t1 got[9];int i;
+for(i=0;i<1;i++){if(e(got,got,9,d[i].n)==0)h();g(i,d[i].src,d[i].n,got,d[i].want,9);if(d[i].n)h();}}
+h(){}g(){}
+#else
+int dummy;
+#endif
+])
+
+GMP_PROG_CC_WORKS_PART([$1], [long long reliability test 2],
+[/* The following provokes an internal compiler error on powerpc-apple-darwin.
+ Extracted from mpz/cfdiv_q_2exp.c. Causes Apple's gcc 3.3 build 1640 and
+ 1666 to get an ICE with -O1 -mpowerpc64. */
+
+#if defined (__GNUC__) && ! defined (__cplusplus)
+f(int u){int i;long long x;x=u?~0:0;if(x)for(i=0;i<9;i++);x&=g();if(x)g();}
+g(){}
+#else
+int dummy;
+#endif
+])
+
+GMP_PROG_CC_WORKS_PART_MAIN([$1], [mpn_lshift_com optimization],
+[/* The following is mis-compiled by HP ia-64 cc version
+ cc: HP aC++/ANSI C B3910B A.05.55 [Dec 04 2003]
+ under "cc +O3", both in +DD32 and +DD64 modes. The mpn_lshift_com gets
+ inlined and its return value somehow botched to be 0 instead of 1. This
+ arises in the real mpn_lshift_com in mul_fft.c. A lower optimization
+ level, like +O2 seems ok. This code needs to be run to show the problem,
+ but that's fine, the offending cc is a native-only compiler so we don't
+ have to worry about cross compiling. */
+
+#if ! defined (__cplusplus)
+unsigned long
+lshift_com (rp, up, n, cnt)
+ unsigned long *rp;
+ unsigned long *up;
+ long n;
+ unsigned cnt;
+{
+ unsigned long retval, high_limb, low_limb;
+ unsigned tnc;
+ long i;
+ tnc = 8 * sizeof (unsigned long) - cnt;
+ low_limb = *up++;
+ retval = low_limb >> tnc;
+ high_limb = low_limb << cnt;
+ for (i = n - 1; i != 0; i--)
+ {
+ low_limb = *up++;
+ *rp++ = ~(high_limb | (low_limb >> tnc));
+ high_limb = low_limb << cnt;
+ }
+ return retval;
+}
+int
+main ()
+{
+ unsigned long cy, rp[2], up[2];
+ up[0] = ~ 0L;
+ up[1] = 0;
+ cy = lshift_com (rp, up, 2L, 1);
+ if (cy != 1L)
+ return 1;
+ return 0;
+}
+#else
+int
+main ()
+{
+ return 0;
+}
+#endif
+])
+
+GMP_PROG_CC_WORKS_PART_MAIN([$1], [mpn_lshift_com optimization 2],
+[/* The following is mis-compiled by Intel ia-64 icc version 1.8 under
+ "icc -O3", After several calls, the function writes partial garbage to
+ the result vector. Perhaps relates to the chk.a.nc insn. This code needs
+ to be run to show the problem, but that's fine, the offending cc is a
+ native-only compiler so we don't have to worry about cross compiling. */
+
+#if ! defined (__cplusplus)
+#include <stdlib.h>
+void
+lshift_com (rp, up, n, cnt)
+ unsigned long *rp;
+ unsigned long *up;
+ long n;
+ unsigned cnt;
+{
+ unsigned long high_limb, low_limb;
+ unsigned tnc;
+ long i;
+ up += n;
+ rp += n;
+ tnc = 8 * sizeof (unsigned long) - cnt;
+ low_limb = *--up;
+ high_limb = low_limb << cnt;
+ for (i = n - 1; i != 0; i--)
+ {
+ low_limb = *--up;
+ *--rp = ~(high_limb | (low_limb >> tnc));
+ high_limb = low_limb << cnt;
+ }
+ *--rp = ~high_limb;
+}
+int
+main ()
+{
+ unsigned long *r, *r2;
+ unsigned long a[88 + 1];
+ long i;
+ for (i = 0; i < 88 + 1; i++)
+ a[i] = ~0L;
+ r = malloc (10000 * sizeof (unsigned long));
+ r2 = r;
+ for (i = 0; i < 528; i += 22)
+ {
+ lshift_com (r2, a,
+ i / (8 * sizeof (unsigned long)) + 1,
+ i % (8 * sizeof (unsigned long)));
+ r2 += 88 + 1;
+ }
+ if (r[2048] != 0 || r[2049] != 0 || r[2050] != 0 || r[2051] != 0 ||
+ r[2052] != 0 || r[2053] != 0 || r[2054] != 0)
+ abort ();
+ return 0;
+}
+#else
+int
+main ()
+{
+ return 0;
+}
+#endif
+])
+
+
+# A certain _GLOBAL_OFFSET_TABLE_ problem in past versions of gas, tickled
+# by recent versions of gcc.
+#
+if test "$gmp_prog_cc_works" = yes; then
+ case $host in
+ X86_PATTERN)
+ # this problem only arises in PIC code, so don't need to test when
+ # --disable-shared. We don't necessarily have $enable_shared set to
+ # yes at this point, it will still be unset for the default (which is
+ # yes); hence the use of "!= no".
+ if test "$enable_shared" != no; then
+ GMP_PROG_CC_X86_GOT_EAX_EMITTED([$1],
+ [GMP_ASM_X86_GOT_EAX_OK([$1],,
+ [gmp_prog_cc_works="no, bad gas GOT with eax"])])
+ fi
+ ;;
+ esac
+fi
+
+AC_MSG_RESULT($gmp_prog_cc_works)
+case $gmp_prog_cc_works in
+ yes)
+ [$2]
+ ;;
+ *)
+ [$3]
+ ;;
+esac
+])
+
+dnl Called: GMP_PROG_CC_WORKS_PART(CC+CFLAGS,FAIL-MESSAGE [,CODE])
+dnl A dummy main() is appended to the CODE given.
+dnl
+AC_DEFUN([GMP_PROG_CC_WORKS_PART],
+[GMP_PROG_CC_WORKS_PART_MAIN([$1],[$2],
+[$3]
+[int main () { return 0; }])
+])
+
+dnl Called: GMP_PROG_CC_WORKS_PART_MAIN(CC+CFLAGS,FAIL-MESSAGE,CODE)
+dnl CODE must include a main().
+dnl
+AC_DEFUN([GMP_PROG_CC_WORKS_PART_MAIN],
+[GMP_PROG_CC_WORKS_PART_TEST([$1],[$2],[$3],
+ [],
+ gmp_prog_cc_works="no[]m4_if([$2],,,[[, ]])[$2]",
+ gmp_prog_cc_works="no[]m4_if([$2],,,[[, ]])[$2][[, program does not run]]")
+])
+
+dnl Called: GMP_PROG_CC_WORKS_PART_TEST(CC+CFLAGS,TITLE,[CODE],
+dnl [ACTION-GOOD],[ACTION-BAD][ACTION-NORUN])
+dnl
+AC_DEFUN([GMP_PROG_CC_WORKS_PART_TEST],
+[if test "$gmp_prog_cc_works" = yes; then
+ # remove anything that might look like compiler output to our "||" expression
+ rm -f conftest* a.out b.out a.exe a_out.exe
+ cat >conftest.c <<EOF
+[$3]
+EOF
+ echo "Test compile: [$2]" >&AC_FD_CC
+ gmp_compile="$1 conftest.c >&AC_FD_CC"
+ if AC_TRY_EVAL(gmp_compile); then
+ cc_works_part=yes
+ if test "$cross_compiling" = no; then
+ if AC_TRY_COMMAND([./a.out || ./b.out || ./a.exe || ./a_out.exe || ./conftest]); then :;
+ else
+ cc_works_part=norun
+ fi
+ fi
+ else
+ cc_works_part=no
+ fi
+ if test "$cc_works_part" != yes; then
+ echo "failed program was:" >&AC_FD_CC
+ cat conftest.c >&AC_FD_CC
+ fi
+ rm -f conftest* a.out b.out a.exe a_out.exe
+ case $cc_works_part in
+ yes)
+ $4
+ ;;
+ no)
+ $5
+ ;;
+ norun)
+ $6
+ ;;
+ esac
+fi
+])
+
+
+dnl GMP_PROG_CC_WORKS_LONGLONG(cc+cflags,[ACTION-YES][,ACTION-NO])
+dnl --------------------------------------------------------------
+dnl Check that cc+cflags accepts "long long".
+dnl
+dnl This test is designed to be run repeatedly with different cc+cflags
+dnl selections, so the result is not cached.
+
+AC_DEFUN([GMP_PROG_CC_WORKS_LONGLONG],
+[AC_MSG_CHECKING([compiler $1 has long long])
+cat >conftest.c <<EOF
+long long foo;
+long long bar () { return foo; }
+int main () { return 0; }
+EOF
+gmp_prog_cc_works=no
+gmp_compile="$1 -c conftest.c >&AC_FD_CC"
+if AC_TRY_EVAL(gmp_compile); then
+ gmp_prog_cc_works=yes
+else
+ echo "failed program was:" >&AC_FD_CC
+ cat conftest.c >&AC_FD_CC
+fi
+rm -f conftest* a.out b.out a.exe a_out.exe
+AC_MSG_RESULT($gmp_prog_cc_works)
+if test $gmp_prog_cc_works = yes; then
+ ifelse([$2],,:,[$2])
+else
+ ifelse([$3],,:,[$3])
+fi
+])
+
+
+dnl GMP_C_TEST_SIZEOF(cc/cflags,test,[ACTION-GOOD][,ACTION-BAD])
+dnl ------------------------------------------------------------
+dnl The given cc/cflags compiler is run to check the size of a type
+dnl specified by the "test" argument. "test" can either be a string, or a
+dnl variable like $foo. The value should be for instance "sizeof-long-4",
+dnl to test that sizeof(long)==4.
+dnl
+dnl This test is designed to be run for different compiler and/or flags
+dnl combinations, so the result is not cached.
+dnl
+dnl The idea for making an array that has a negative size if the desired
+dnl condition test is false comes from autoconf AC_CHECK_SIZEOF. The cast
+dnl to "long" in the array dimension also follows autoconf, apparently it's
+dnl a workaround for a HP compiler bug.
+
+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/'`]
+AC_MSG_CHECKING([compiler $1 has sizeof($gmp_sizeof_type)==$gmp_sizeof_want])
+cat >conftest.c <<EOF
+[int
+main ()
+{
+ static int test_array [1 - 2 * (long) (sizeof ($gmp_sizeof_type) != $gmp_sizeof_want)];
+ test_array[0] = 0;
+ return 0;
+}]
+EOF
+gmp_c_testlist_sizeof=no
+gmp_compile="$1 -c conftest.c >&AC_FD_CC"
+if AC_TRY_EVAL(gmp_compile); then
+ gmp_c_testlist_sizeof=yes
+fi
+rm -f conftest*
+AC_MSG_RESULT($gmp_c_testlist_sizeof)
+if test $gmp_c_testlist_sizeof = yes; then
+ ifelse([$3],,:,[$3])
+else
+ ifelse([$4],,:,[$4])
+fi
+])
+
+
+dnl GMP_PROG_CC_IS_GNU(CC,[ACTIONS-IF-YES][,ACTIONS-IF-NO])
+dnl -------------------------------------------------------
+dnl Determine whether the given compiler is GNU C.
+dnl
+dnl This test is the same as autoconf _AC_LANG_COMPILER_GNU, but doesn't
+dnl cache the result. The same "ifndef" style test is used, to avoid
+dnl problems with syntax checking cpp's used on NeXT and Apple systems.
+
+AC_DEFUN([GMP_PROG_CC_IS_GNU],
+[cat >conftest.c <<EOF
+#if ! defined (__GNUC__) || defined (__INTEL_COMPILER)
+ choke me
+#endif
+EOF
+gmp_compile="$1 -c conftest.c >&AC_FD_CC"
+if AC_TRY_EVAL(gmp_compile); then
+ rm -f conftest*
+ AC_MSG_CHECKING([whether $1 is gcc])
+ AC_MSG_RESULT(yes)
+ ifelse([$2],,:,[$2])
+else
+ rm -f conftest*
+ ifelse([$3],,:,[$3])
+fi
+])
+
+
+dnl GMP_PROG_CC_IS_XLC(CC,[ACTIONS-IF-YES][,ACTIONS-IF-NO])
+dnl -------------------------------------------------------
+dnl Determine whether the given compiler is IBM xlc (on AIX).
+dnl
+dnl There doesn't seem to be a preprocessor symbol to test for this, or if
+dnl there is one then it's well hidden in xlc 3.1 on AIX 4.3, so just grep
+dnl the man page printed when xlc is invoked with no arguments.
+
+AC_DEFUN([GMP_PROG_CC_IS_XLC],
+[gmp_command="$1 2>&1 | grep xlc >/dev/null"
+if AC_TRY_EVAL(gmp_command); then
+ AC_MSG_CHECKING([whether $1 is xlc])
+ AC_MSG_RESULT(yes)
+ ifelse([$2],,:,[$2])
+else
+ ifelse([$3],,:,[$3])
+fi
+])
+
+
+dnl GMP_PROG_CC_X86_GOT_EAX_EMITTED(CC+CFLAGS, [ACTION-YES] [, ACTION-NO])
+dnl ----------------------------------------------------------------------
+dnl Determine whether CC+CFLAGS emits instructions using %eax with
+dnl _GLOBAL_OFFSET_TABLE_. This test is for use on x86 systems.
+dnl
+dnl Recent versions of gcc will use %eax for the GOT in leaf functions, for
+dnl instance gcc 3.3.3 with -O3. This avoids having to save and restore
+dnl %ebx which otherwise usually holds the GOT, and is what gcc used in the
+dnl past.
+dnl
+dnl %ecx and %edx are also candidates for this sort of optimization, and
+dnl are used under lesser optimization levels, like -O2 in 3.3.3. FIXME:
+dnl It's not quite clear what the conditions for using %eax are, we might
+dnl need more test code to provoke it.
+dnl
+dnl The motivation for this test is that past versions of gas have bugs
+dnl affecting this usage, see GMP_ASM_X86_GOT_EAX_OK.
+dnl
+dnl This test is not specific to gcc, other compilers might emit %eax GOT
+dnl insns like this, though we've not investigated that.
+dnl
+dnl This is for use by compiler probing in GMP_PROG_CC_WORKS, so we doesn't
+dnl cache the result.
+dnl
+dnl -fPIC is hard coded here, because this test is for use before libtool
+dnl has established the pic options. It's right for gcc, but perhaps not
+dnl other compilers.
+
+AC_DEFUN([GMP_PROG_CC_X86_GOT_EAX_EMITTED],
+[echo "Testing gcc GOT with eax emitted" >&AC_FD_CC
+cat >conftest.c <<\EOF
+[int foo;
+int bar () { return foo; }
+]EOF
+tmp_got_emitted=no
+gmp_compile="$1 -fPIC -S conftest.c >&AC_FD_CC 2>&1"
+if AC_TRY_EVAL(gmp_compile); then
+ if grep "addl.*_GLOBAL_OFFSET_TABLE_.*eax" conftest.s >/dev/null; then
+ tmp_got_emitted=yes
+ fi
+fi
+rm -f conftest.*
+echo "Result: $tmp_got_emitted" >&AC_FD_CC
+if test "$tmp_got_emitted" = yes; then
+ ifelse([$2],,:,[$2])
+else
+ ifelse([$3],,:,[$3])
+fi
+])
+
+
+dnl GMP_HPC_HPPA_2_0(cc,[ACTION-IF-GOOD][,ACTION-IF-BAD])
+dnl ---------------------------------------------------------
+dnl Find out whether a HP compiler is good enough to generate hppa 2.0.
+dnl
+dnl This test might be repeated for different compilers, so the result is
+dnl not cached.
+
+AC_DEFUN([GMP_HPC_HPPA_2_0],
+[AC_MSG_CHECKING([whether HP compiler $1 is good for 64-bits])
+# Bad compiler output:
+# ccom: HP92453-01 G.10.32.05 HP C Compiler
+# Good compiler output:
+# ccom: HP92453-01 A.10.32.30 HP C Compiler
+# Let A.10.32.30 or higher be ok.
+echo >conftest.c
+gmp_tmp_vs=`$1 $2 -V -c -o conftest.$OBJEXT conftest.c 2>&1 | grep "^ccom:"`
+echo "Version string: $gmp_tmp_vs" >&AC_FD_CC
+rm conftest*
+gmp_tmp_v1=`echo $gmp_tmp_vs | sed 's/.* .\.\([[0-9]]*\).*/\1/'`
+gmp_tmp_v2=`echo $gmp_tmp_vs | sed 's/.* .\..*\.\(.*\)\..* HP C.*/\1/'`
+gmp_tmp_v3=`echo $gmp_tmp_vs | sed 's/.* .\..*\..*\.\(.*\) HP C.*/\1/'`
+echo "Version number: $gmp_tmp_v1.$gmp_tmp_v2.$gmp_tmp_v3" >&AC_FD_CC
+if test -z "$gmp_tmp_v1"; then
+ gmp_hpc_64bit=not-applicable
+else
+ GMP_COMPARE_GE($gmp_tmp_v1, 10, $gmp_tmp_v2, 32, $gmp_tmp_v3, 30)
+ gmp_hpc_64bit=$gmp_compare_ge
+fi
+AC_MSG_RESULT($gmp_hpc_64bit)
+if test $gmp_hpc_64bit = yes; then
+ ifelse([$2],,:,[$2])
+else
+ ifelse([$3],,:,[$3])
+fi
+])
+
+
+dnl GMP_GCC_ARM_UMODSI(CC,[ACTIONS-IF-GOOD][,ACTIONS-IF-BAD])
+dnl ---------------------------------------------------------
+dnl gcc 2.95.3 and earlier on arm has a bug in the libgcc __umodsi routine
+dnl making "%" give wrong results for some operands, eg. "0x90000000 % 3".
+dnl We're hoping it'll be fixed in 2.95.4, and we know it'll be fixed in
+dnl gcc 3.
+dnl
+dnl There's only a couple of places gmp cares about this, one is the
+dnl size==1 case in mpn/generic/mode1o.c, and this shows up in
+dnl tests/mpz/t-jac.c as a wrong result from mpz_kronecker_ui.
+
+AC_DEFUN([GMP_GCC_ARM_UMODSI],
+[AC_MSG_CHECKING([whether ARM gcc unsigned division works])
+tmp_version=`$1 --version`
+echo "$tmp_version" >&AC_FD_CC
+case $tmp_version in
+ [2.95 | 2.95.[123]])
+ ifelse([$3],,:,[$3])
+ gmp_gcc_arm_umodsi_result=["no, gcc 2.95.[0123]"] ;;
+ *)
+ ifelse([$2],,:,[$2])
+ gmp_gcc_arm_umodsi_result=yes ;;
+esac
+AC_MSG_RESULT([$gmp_gcc_arm_umodsi_result])
+])
+
+
+dnl GMP_GCC_MIPS_O32(gcc,[actions-yes][,[actions-no]])
+dnl -------------------------------------------------
+dnl Test whether gcc supports o32.
+dnl
+dnl gcc 2.7.2.2 only does o32, and doesn't accept -mabi=32.
+dnl
+dnl gcc 2.95 accepts -mabi=32 but it only works on irix5, on irix6 it gives
+dnl "cc1: The -mabi=32 support does not work yet".
+
+AC_DEFUN([GMP_GCC_MIPS_O32],
+[AC_MSG_CHECKING([whether gcc supports o32])
+echo 'int x;' >conftest.c
+echo "$1 -mabi=32 -c conftest.c" >&AC_FD_CC
+if $1 -mabi=32 -c conftest.c >conftest.out 2>&1; then
+ result=yes
+else
+ cat conftest.out >&AC_FD_CC
+ if grep "cc1: Invalid option \`abi=32'" conftest.out >/dev/null; then
+ result=yes
+ else
+ result=no
+ fi
+fi
+rm -f conftest.*
+AC_MSG_RESULT($result)
+if test $result = yes; then
+ ifelse([$2],,:,[$2])
+else
+ ifelse([$3],,:,[$3])
+fi
+])
+
+
+dnl GMP_GCC_NO_CPP_PRECOMP(CCBASE,CC,CFLAGS,[ACTIONS-YES][,ACTIONS-NO])
+dnl -------------------------------------------------------------------
+dnl Check whether -no-cpp-precomp should be used on this compiler, and
+dnl execute the corresponding ACTIONS-YES or ACTIONS-NO.
+dnl
+dnl -no-cpp-precomp is only meant for Apple's hacked version of gcc found
+dnl on powerpc*-*-darwin*, but we can give it a try on any gcc. Normal gcc
+dnl (as of 3.0 at least) only gives a warning, not an actual error, and we
+dnl watch for that and decide against the option in that case, to avoid
+dnl confusing the user.
+
+AC_DEFUN([GMP_GCC_NO_CPP_PRECOMP],
+[if test "$ccbase" = gcc; then
+ AC_MSG_CHECKING([compiler $2 $3 -no-cpp-precomp])
+ result=no
+ cat >conftest.c <<EOF
+int main () { return 0; }
+EOF
+ gmp_compile="$2 $3 -no-cpp-precomp conftest.c >conftest.out 2>&1"
+ if AC_TRY_EVAL(gmp_compile); then
+ if grep "unrecognized option.*-no-cpp-precomp" conftest.out >/dev/null; then : ;
+ else
+ result=yes
+ fi
+ fi
+ cat conftest.out >&AC_FD_CC
+ rm -f conftest* a.out b.out a.exe a_out.exe
+ AC_MSG_RESULT($result)
+ if test "$result" = yes; then
+ ifelse([$4],,:,[$4])
+ else
+ ifelse([$5],,:,[$5])
+ fi
+fi
+])
+
+
+dnl GMP_GCC_PENTIUM4_SSE2(CC+CFLAGS,[ACTION-IF-YES][,ACTION-IF-NO])
+dnl ---------------------------------------------------------------
+dnl Determine whether gcc CC+CFLAGS is a good enough version for
+dnl -march=pentium4 with sse2.
+dnl
+dnl Gcc 3.2.1 was seen generating incorrect code for raw double -> int
+dnl conversions through a union. We believe the problem is in all 3.1 and
+dnl 3.2 versions, but that it's fixed in 3.3.
+
+AC_DEFUN([GMP_GCC_PENTIUM4_SSE2],
+[AC_MSG_CHECKING([whether gcc is good for sse2])
+case `$1 -dumpversion` in
+ [3.[012] | 3.[012].*]) result=no ;;
+ *) result=yes ;;
+esac
+AC_MSG_RESULT($result)
+if test "$result" = yes; then
+ ifelse([$2],,:,[$2])
+else
+ ifelse([$3],,:,[$3])
+fi
+])
+
+
+dnl GMP_GCC_WA_MCPU(CC+CFLAGS, NEWFLAG [,ACTION-YES [,ACTION-NO]])
+dnl --------------------------------------------------------------
+dnl Check whether gcc (or gas rather) accepts a flag like "-Wa,-mev67".
+dnl
+dnl Gas doesn't give an error for an unknown cpu, it only prints a warning
+dnl like "Warning: Unknown CPU identifier `ev78'".
+dnl
+dnl This is intended for use on alpha, since only recent versions of gas
+dnl accept -mev67, but there's nothing here that's alpha specific.
+
+AC_DEFUN([GMP_GCC_WA_MCPU],
+[AC_MSG_CHECKING([assembler $1 $2])
+result=no
+cat >conftest.c <<EOF
+int main () {}
+EOF
+gmp_compile="$1 $2 -c conftest.c >conftest.out 2>&1"
+if AC_TRY_EVAL(gmp_compile); then
+ if grep "Unknown CPU identifier" conftest.out >/dev/null; then : ;
+ else
+ result=yes
+ fi
+fi
+cat conftest.out >&AC_FD_CC
+rm -f conftest*
+AC_MSG_RESULT($result)
+if test "$result" = yes; then
+ ifelse([$3],,:,[$3])
+else
+ ifelse([$4],,:,[$4])
+fi
+])
+
+
+dnl GMP_GCC_WA_OLDAS(CC+CFLAGS [,ACTION-YES [,ACTION-NO]])
+dnl ------------------------------------------------------
+dnl Check whether gcc should be run with "-Wa,-oldas".
+dnl
+dnl On systems alpha*-*-osf* (or maybe just osf5), apparently there's a
+dnl newish Compaq "as" which doesn't work with the gcc mips-tfile.
+dnl Compiling an empty file with "gcc -c foo.c" produces for instance
+dnl
+dnl mips-tfile, /tmp/ccaqUNnF.s:7 Segmentation fault
+dnl
+dnl The fix is to pass "-oldas" to that assembler, as noted by
+dnl
+dnl http://gcc.gnu.org/install/specific.html#alpha*-dec-osf*
+dnl
+dnl The test here tries to compile an empty file, and if that fails but
+dnl adding -Wa,-oldas makes it succeed, then that flag is considered
+dnl necessary.
+dnl
+dnl We look for the failing case specifically, since it may not be a good
+dnl idea to use -Wa,-oldas in other circumstances. For instance gas takes
+dnl "-oldas" to mean the "-o" option and will write a file called "ldas" as
+dnl its output. Normally gcc puts its own "-o" after any -Wa options, so
+dnl -oldas ends up being harmless, but clearly that's only through good
+dnl luck.
+dnl
+dnl This macro is designed for use while probing for a good compiler, and
+dnl so doesn't cache it's result.
+
+AC_DEFUN([GMP_GCC_WA_OLDAS],
+[AC_MSG_CHECKING([for $1 -Wa,-oldas])
+result=no
+cat >conftest.c <<EOF
+EOF
+echo "with empty conftest.c" >&AC_FD_CC
+gmp_compile="$1 -c conftest.c >&AC_FD_CC 2>&1"
+if AC_TRY_EVAL(gmp_compile); then : ;
+else
+ # empty fails
+ gmp_compile="$1 -Wa,-oldas -c conftest.c >&AC_FD_CC 2>&1"
+ if AC_TRY_EVAL(gmp_compile); then
+ # but with -Wa,-oldas it works
+ result=yes
+ fi
+fi
+rm -f conftest*
+AC_MSG_RESULT($result)
+if test "$result" = yes; then
+ ifelse([$2],,:,[$2])
+else
+ ifelse([$3],,:,[$3])
+fi
+])
+
+
+dnl GMP_OS_X86_XMM(CC+CFLAGS,[ACTION-IF-YES][,ACTION-IF-NO])
+dnl --------------------------------------------------------
+dnl Determine whether the operating system supports XMM registers.
+dnl
+dnl If build==host then a test program is run, executing an SSE2
+dnl instruction using an XMM register. This will give a SIGILL if the
+dnl system hasn't set the OSFXSR bit in CR4 to say it knows it must use
+dnl fxsave/fxrestor in a context switch (to save xmm registers).
+dnl
+dnl If build!=host, we can fallback on:
+dnl
+dnl - FreeBSD version 4 is the first supporting xmm.
+dnl
+dnl - Linux kernel 2.4 might be the first stable series supporting xmm
+dnl (not sure). But there's no version number in the GNU/Linux
+dnl config tuple to test anyway.
+dnl
+dnl The default is to allow xmm. This might seem rash, but it's likely
+dnl most systems know xmm by now, so this will normally be what's wanted.
+dnl And cross compiling is a bit hairy anyway, so hopefully anyone doing it
+dnl will be smart enough to know what to do.
+dnl
+dnl In the test program, .text and .globl are hard coded because this macro
+dnl is wanted before GMP_ASM_TEXT and GMP_ASM_GLOBL are run. A .byte
+dnl sequence is used (for xorps %xmm0, %xmm0) to make us independent of
+dnl tests for whether the assembler supports sse2/xmm. Obviously we need
+dnl both assembler and OS support, but this means we don't force the order
+dnl in which we test.
+dnl
+dnl FIXME: Maybe we should use $CCAS to assemble, if it's set. (Would
+dnl still want $CC/$CFLAGS for the link.) But this test is used before
+dnl AC_PROG_CC sets $OBJEXT, so we'd need to check for various object file
+dnl suffixes ourselves.
+
+AC_DEFUN([GMP_OS_X86_XMM],
+[AC_CACHE_CHECK([whether the operating system supports XMM registers],
+ gmp_cv_os_x86_xmm,
+[if test "$build" = "$host"; then
+ # remove anything that might look like compiler output to our "||" expression
+ rm -f conftest* a.out b.out a.exe a_out.exe
+ cat >conftest.s <<EOF
+ .text
+main:
+_main:
+ .globl main
+ .globl _main
+ .byte 0x0f, 0x57, 0xc0
+ xorl %eax, %eax
+ ret
+EOF
+ gmp_compile="$1 conftest.s -o conftest >&AC_FD_CC"
+ if AC_TRY_EVAL(gmp_compile); then
+ if AC_TRY_COMMAND([./a.out || ./b.out || ./a.exe || ./a_out.exe || ./conftest]); then
+ gmp_cv_os_x86_xmm=yes
+ else
+ gmp_cv_os_x86_xmm=no
+ fi
+ else
+ AC_MSG_WARN([Oops, cannot compile test program])
+ fi
+ rm -f conftest*
+fi
+
+if test -z "$gmp_cv_os_x86_xmm"; then
+ case $host_os in
+ [freebsd[123] | freebsd[123].*])
+ gmp_cv_os_x86_xmm=no ;;
+ freebsd*)
+ gmp_cv_os_x86_xmm=yes ;;
+ *)
+ gmp_cv_os_x86_xmm=probably ;;
+ esac
+fi
+])
+
+if test "$gmp_cv_os_x86_xmm" = probably; then
+ AC_MSG_WARN([Not certain of OS support for xmm when cross compiling.])
+ AC_MSG_WARN([Will assume it's ok, expect a SIGILL if this is wrong.])
+fi
+
+case $gmp_cv_os_x86_xmm in
+no)
+ $3
+ ;;
+*)
+ $2
+ ;;
+esac
+])
+
+
+dnl GMP_CRAY_HOST_TYPES(C90/T90-IEEE, C90/T90-CFP, J90/SV1)
+dnl -------------------------------------------------------
+dnl Execute the actions in the arguments on the respective Cray vector
+dnl systems. For other hosts, do nothing.
+dnl
+dnl This macro should be used after the C compiler has been chosen, since
+dnl on c90 and t90 we ask the compiler whether we're in IEEE or CFP float
+dnl mode.
+dnl
+dnl This code is in a macro so that any AC_REQUIRE pre-requisites of
+dnl AC_EGREP_CPP will be expanded at the top-level, ie. for all hosts not
+dnl merely c90 and t90. In autoconf 2.57 for instance this means
+dnl AC_PROG_EGREP, which is needed by various other macros.
+
+AC_DEFUN([GMP_CRAY_OPTIONS],
+[case $host_cpu in
+ c90 | t90)
+ AC_EGREP_CPP(yes,
+[#ifdef _CRAYIEEE
+yes
+#endif],
+ [$1],
+ [$2])
+ ;;
+ j90 | sv1)
+ [$3]
+ ;;
+esac
+])
+
+
+dnl GMP_HPPA_LEVEL_20(cc/cflags [, ACTION-GOOD [,ACTION-BAD]])
+dnl ----------------------------------------------------------
+dnl Check that the given cc/cflags accepts HPPA 2.0n assembler code.
+dnl
+dnl Old versions of gas don't know 2.0 instructions. It rejects ".level
+dnl 2.0" for a start, so just test that.
+dnl
+dnl This test is designed to be run for various different compiler and
+dnl flags combinations, and hence doesn't cache its result.
+
+AC_DEFUN([GMP_HPPA_LEVEL_20],
+[AC_MSG_CHECKING([$1 assembler knows hppa 2.0])
+result=no
+cat >conftest.s <<EOF
+ .level 2.0
+EOF
+gmp_compile="$1 -c conftest.s >&AC_FD_CC 2>&1"
+if AC_TRY_EVAL(gmp_compile); then
+ result=yes
+else
+ echo "failed program was" >&AC_FD_CC
+ cat conftest.s >&AC_FD_CC
+fi
+rm -f conftest*
+AC_MSG_RESULT($result)
+if test "$result" = yes; then
+ ifelse([$2],,:,[$2])
+else
+ ifelse([$3],,:,[$3])
+fi
+])
+
+
+dnl GMP_PROG_CXX_WORKS(cxx/cxxflags [, ACTION-YES [,ACTION-NO]])
+dnl ------------------------------------------------------------
+dnl Check whether cxx/cxxflags can compile and link.
+dnl
+dnl This test is designed to be run repeatedly with different cxx/cxxflags
+dnl selections, so the result is not cached.
+dnl
+dnl For a native build, we insist on being able to run the program, so as
+dnl to detect any problems with the standard C++ library. During
+dnl development various systems with broken or incomplete C++ installations
+dnl were seen.
+dnl
+dnl The various features and problems we try to detect are done in separate
+dnl compiles. Although this is probably a bit slower than one test
+dnl program, it makes it easy to indicate the problem in AC_MSG_RESULT,
+dnl hence giving the user a clue about why we rejected the compiler.
+
+AC_DEFUN([GMP_PROG_CXX_WORKS],
+[AC_MSG_CHECKING([C++ compiler $1])
+gmp_prog_cxx_works=yes
+
+# start with a plain "main()", then go on to further checks
+GMP_PROG_CXX_WORKS_PART([$1], [])
+
+GMP_PROG_CXX_WORKS_PART([$1], [namespace],
+[namespace foo { }
+using namespace foo;
+])
+
+# GMP requires the standard C++ iostream classes
+GMP_PROG_CXX_WORKS_PART([$1], [std iostream],
+[/* This test rejects g++ 2.7.2 which doesn't have <iostream>, only a
+ pre-standard iostream.h. */
+#include <iostream>
+
+/* This test rejects OSF 5.1 Compaq C++ in its default pre-standard iostream
+ mode, since that mode puts cout in the global namespace, not "std". */
+void someoutput (void) { std::cout << 123; }
+])
+
+AC_MSG_RESULT($gmp_prog_cxx_works)
+case $gmp_prog_cxx_works in
+ yes)
+ [$2]
+ ;;
+ *)
+ [$3]
+ ;;
+esac
+])
+
+dnl Called: GMP_PROG_CXX_WORKS_PART(CXX+CXXFLAGS, FAIL-MESSAGE [,CODE])
+dnl
+AC_DEFUN([GMP_PROG_CXX_WORKS_PART],
+[if test "$gmp_prog_cxx_works" = yes; then
+ # remove anything that might look like compiler output to our "||" expression
+ rm -f conftest* a.out b.out a.exe a_out.exe
+ cat >conftest.cc <<EOF
+[$3]
+int main (void) { return 0; }
+EOF
+ echo "Test compile: [$2]" >&AC_FD_CC
+ gmp_cxxcompile="$1 conftest.cc >&AC_FD_CC"
+ if AC_TRY_EVAL(gmp_cxxcompile); then
+ if test "$cross_compiling" = no; then
+ if AC_TRY_COMMAND([./a.out || ./b.out || ./a.exe || ./a_out.exe || ./conftest]); then :;
+ else
+ gmp_prog_cxx_works="no[]m4_if([$2],,,[, ])[$2], program does not run"
+ fi
+ fi
+ else
+ gmp_prog_cxx_works="no[]m4_if([$2],,,[, ])[$2]"
+ fi
+ case $gmp_prog_cxx_works in
+ no*)
+ echo "failed program was:" >&AC_FD_CC
+ cat conftest.cc >&AC_FD_CC
+ ;;
+ esac
+ rm -f conftest* a.out b.out a.exe a_out.exe
+fi
+])
+
+
+dnl GMP_INIT([M4-DEF-FILE])
+dnl -----------------------
+dnl Initializations for GMP config.m4 generation.
+dnl
+dnl FIXME: The generated config.m4 doesn't get recreated by config.status.
+dnl Maybe the relevant "echo"s should go through AC_CONFIG_COMMANDS.
+
+AC_DEFUN([GMP_INIT],
+[ifelse([$1], , gmp_configm4=config.m4, gmp_configm4="[$1]")
+gmp_tmpconfigm4=cnfm4.tmp
+gmp_tmpconfigm4i=cnfm4i.tmp
+gmp_tmpconfigm4p=cnfm4p.tmp
+rm -f $gmp_tmpconfigm4 $gmp_tmpconfigm4i $gmp_tmpconfigm4p
+
+# CONFIG_TOP_SRCDIR is a path from the mpn builddir to the top srcdir.
+# The pattern here tests for an absolute path the same way as
+# _AC_OUTPUT_FILES in autoconf acgeneral.m4.
+case $srcdir in
+[[\\/]]* | ?:[[\\/]]* ) tmp="$srcdir" ;;
+*) tmp="../$srcdir" ;;
+esac
+echo ["define(<CONFIG_TOP_SRCDIR>,<\`$tmp'>)"] >>$gmp_tmpconfigm4
+
+# All CPUs use asm-defs.m4
+echo ["include][(CONFIG_TOP_SRCDIR\`/mpn/asm-defs.m4')"] >>$gmp_tmpconfigm4i
+])
+
+
+dnl GMP_FINISH
+dnl ----------
+dnl Create config.m4 from its accumulated parts.
+dnl
+dnl __CONFIG_M4_INCLUDED__ is used so that a second or subsequent include
+dnl of config.m4 is harmless.
+dnl
+dnl A separate ifdef on the angle bracket quoted part ensures the quoting
+dnl style there is respected. The basic defines from gmp_tmpconfigm4 are
+dnl fully quoted but are still put under an ifdef in case any have been
+dnl redefined by one of the m4 include files.
+dnl
+dnl Doing a big ifdef within asm-defs.m4 and/or other macro files wouldn't
+dnl work, since it'd interpret parentheses and quotes in dnl comments, and
+dnl having a whole file as a macro argument would overflow the string space
+dnl on BSD m4.
+
+AC_DEFUN([GMP_FINISH],
+[AC_REQUIRE([GMP_INIT])
+echo "creating $gmp_configm4"
+echo ["d""nl $gmp_configm4. Generated automatically by configure."] > $gmp_configm4
+if test -f $gmp_tmpconfigm4; then
+ echo ["changequote(<,>)"] >> $gmp_configm4
+ echo ["ifdef(<__CONFIG_M4_INCLUDED__>,,<"] >> $gmp_configm4
+ cat $gmp_tmpconfigm4 >> $gmp_configm4
+ echo [">)"] >> $gmp_configm4
+ echo ["changequote(\`,')"] >> $gmp_configm4
+ rm $gmp_tmpconfigm4
+fi
+echo ["ifdef(\`__CONFIG_M4_INCLUDED__',,\`"] >> $gmp_configm4
+if test -f $gmp_tmpconfigm4i; then
+ cat $gmp_tmpconfigm4i >> $gmp_configm4
+ rm $gmp_tmpconfigm4i
+fi
+if test -f $gmp_tmpconfigm4p; then
+ cat $gmp_tmpconfigm4p >> $gmp_configm4
+ rm $gmp_tmpconfigm4p
+fi
+echo ["')"] >> $gmp_configm4
+echo ["define(\`__CONFIG_M4_INCLUDED__')"] >> $gmp_configm4
+])
+
+
+dnl GMP_INCLUDE_MPN(FILE)
+dnl ---------------------
+dnl Add an include_mpn(`FILE') to config.m4. FILE should be a path
+dnl relative to the mpn source directory, for example
+dnl
+dnl GMP_INCLUDE_MPN(`x86/x86-defs.m4')
+dnl
+
+AC_DEFUN([GMP_INCLUDE_MPN],
+[AC_REQUIRE([GMP_INIT])
+echo ["include_mpn(\`$1')"] >> $gmp_tmpconfigm4i
+])
+
+
+dnl GMP_DEFINE(MACRO, DEFINITION [, LOCATION])
+dnl ------------------------------------------
+dnl Define M4 macro MACRO as DEFINITION in temporary file.
+dnl
+dnl If LOCATION is `POST', the definition will appear after any include()
+dnl directives inserted by GMP_INCLUDE. Mind the quoting! No shell
+dnl variables will get expanded. Don't forget to invoke GMP_FINISH to
+dnl create file config.m4. config.m4 uses `<' and '>' as quote characters
+dnl for all defines.
+
+AC_DEFUN([GMP_DEFINE],
+[AC_REQUIRE([GMP_INIT])
+echo ['define(<$1>, <$2>)'] >>ifelse([$3], [POST],
+ $gmp_tmpconfigm4p, $gmp_tmpconfigm4)
+])
+
+
+dnl GMP_DEFINE_RAW(STRING [, LOCATION])
+dnl ------------------------------------
+dnl Put STRING into config.m4 file.
+dnl
+dnl If LOCATION is `POST', the definition will appear after any include()
+dnl directives inserted by GMP_INCLUDE. Don't forget to invoke GMP_FINISH
+dnl to create file config.m4.
+
+AC_DEFUN([GMP_DEFINE_RAW],
+[AC_REQUIRE([GMP_INIT])
+echo [$1] >> ifelse([$2], [POST], $gmp_tmpconfigm4p, $gmp_tmpconfigm4)
+])
+
+
+dnl GMP_TRY_ASSEMBLE(asm-code,[action-success][,action-fail])
+dnl ----------------------------------------------------------
+dnl Attempt to assemble the given code.
+dnl Do "action-success" if this succeeds, "action-fail" if not.
+dnl
+dnl conftest.o and conftest.out are available for inspection in
+dnl "action-success". If either action does a "break" out of a loop then
+dnl an explicit "rm -f conftest*" will be necessary.
+dnl
+dnl This is not unlike AC_TRY_COMPILE, but there's no default includes or
+dnl anything in "asm-code", everything wanted must be given explicitly.
+
+AC_DEFUN([GMP_TRY_ASSEMBLE],
+[cat >conftest.s <<EOF
+[$1]
+EOF
+gmp_assemble="$CCAS $CFLAGS $CPPFLAGS conftest.s >conftest.out 2>&1"
+if AC_TRY_EVAL(gmp_assemble); then
+ cat conftest.out >&AC_FD_CC
+ ifelse([$2],,:,[$2])
+else
+ cat conftest.out >&AC_FD_CC
+ echo "configure: failed program was:" >&AC_FD_CC
+ cat conftest.s >&AC_FD_CC
+ ifelse([$3],,:,[$3])
+fi
+rm -f conftest*
+])
+
+
+dnl Checks whether the stack can be marked nonexecutable by passing an option
+dnl to the C-compiler when acting on .s files. Appends that option to ASFLAGS.
+dnl This macro is adapted from one found in GLIBC-2.3.5.
+AC_DEFUN([CL_AS_NOEXECSTACK],[
+dnl AC_REQUIRE([AC_PROG_CC]) GMP uses something else
+AC_CACHE_CHECK([whether assembler supports --noexecstack option],
+cl_cv_as_noexecstack, [dnl
+ cat > conftest.c <<EOF
+void foo() {}
+EOF
+ if AC_TRY_COMMAND([${CC} $CFLAGS $CPPFLAGS
+ -S -o conftest.s conftest.c >/dev/null]) \
+ && grep .note.GNU-stack conftest.s >/dev/null \
+ && AC_TRY_COMMAND([${CC} $CFLAGS $CPPFLAGS -Wa,--noexecstack
+ -c -o conftest.o conftest.s >/dev/null])
+ then
+ cl_cv_as_noexecstack=yes
+ else
+ cl_cv_as_noexecstack=no
+ fi
+ rm -f conftest*])
+ if test "$cl_cv_as_noexecstack" = yes; then
+ ASMFLAGS="$ASMFLAGS -Wa,--noexecstack"
+ fi
+ AC_SUBST(ASMFLAGS)
+])
+
+
+dnl GMP_ASM_LABEL_SUFFIX
+dnl --------------------
+dnl : - is usual.
+dnl empty - hppa on HP-UX doesn't use a :, just the label name
+dnl
+dnl Note that it's necessary to test the empty case first, since HP "as"
+dnl will accept "somelabel:", and take it to mean a label with a name that
+dnl happens to end in a colon.
+
+AC_DEFUN([GMP_ASM_LABEL_SUFFIX],
+[AC_REQUIRE([GMP_ASM_TEXT])
+AC_CACHE_CHECK([for assembler label suffix],
+ gmp_cv_asm_label_suffix,
+[gmp_cv_asm_label_suffix=unknown
+for i in "" ":"; do
+ echo "trying $i" >&AC_FD_CC
+ GMP_TRY_ASSEMBLE(
+[ $gmp_cv_asm_text
+somelabel$i],
+ [gmp_cv_asm_label_suffix=$i
+ rm -f conftest*
+ break],
+ [cat conftest.out >&AC_FD_CC])
+done
+if test "$gmp_cv_asm_label_suffix" = "unknown"; then
+ AC_MSG_ERROR([Cannot determine label suffix])
+fi
+])
+echo ["define(<LABEL_SUFFIX>, <$gmp_cv_asm_label_suffix>)"] >> $gmp_tmpconfigm4
+])
+
+
+dnl GMP_ASM_UNDERSCORE
+dnl ------------------
+dnl Determine whether global symbols need to be prefixed with an underscore.
+dnl The output from "nm" is grepped to see what a typical symbol looks like.
+dnl
+dnl This test used to grep the .o file directly, but that failed with greps
+dnl that don't like binary files (eg. SunOS 4).
+dnl
+dnl This test also used to construct an assembler file with and without an
+dnl underscore and try to link that to a C file, to see which worked.
+dnl Although that's what will happen in the real build we don't really want
+dnl to depend on creating asm files within configure for every possible CPU
+dnl (or at least we don't want to do that more than we have to).
+dnl
+dnl The fallback on no underscore is based on the assumption that the world
+dnl is moving towards non-underscore systems. There should actually be no
+dnl good reason for nm to fail though.
+
+AC_DEFUN([GMP_ASM_UNDERSCORE],
+[AC_REQUIRE([GMP_PROG_NM])
+AC_CACHE_CHECK([if globals are prefixed by underscore],
+ gmp_cv_asm_underscore,
+[gmp_cv_asm_underscore="unknown"
+cat >conftest.c <<EOF
+int gurkmacka;
+EOF
+gmp_compile="$CC $CFLAGS $CPPFLAGS -c conftest.c >&AC_FD_CC"
+if AC_TRY_EVAL(gmp_compile); then
+ $NM conftest.$OBJEXT >conftest.out
+ if grep _gurkmacka conftest.out >/dev/null; then
+ gmp_cv_asm_underscore=yes
+ elif grep gurkmacka conftest.out >/dev/null; then
+ gmp_cv_asm_underscore=no
+ else
+ echo "configure: $NM doesn't have gurkmacka:" >&AC_FD_CC
+ cat conftest.out >&AC_FD_CC
+ fi
+else
+ echo "configure: failed program was:" >&AC_FD_CC
+ cat conftest.c >&AC_FD_CC
+fi
+rm -f conftest*
+])
+case $gmp_cv_asm_underscore in
+ yes)
+ GMP_DEFINE(GSYM_PREFIX, [_]) ;;
+ no)
+ GMP_DEFINE(GSYM_PREFIX, []) ;;
+ *)
+ AC_MSG_WARN([+----------------------------------------------------------])
+ AC_MSG_WARN([| Cannot determine global symbol prefix.])
+ AC_MSG_WARN([| $NM output doesn't contain a global data symbol.])
+ AC_MSG_WARN([| Will proceed with no underscore.])
+ AC_MSG_WARN([| If this is wrong then you'll get link errors referring])
+ AC_MSG_WARN([| to ___gmpn_add_n (note three underscores).])
+ AC_MSG_WARN([| In this case do a fresh build with an override,])
+ AC_MSG_WARN([| ./configure gmp_cv_asm_underscore=yes])
+ AC_MSG_WARN([+----------------------------------------------------------])
+ GMP_DEFINE(GSYM_PREFIX, [])
+ ;;
+esac
+])
+
+
+dnl GMP_ASM_ALIGN_LOG
+dnl -----------------
+dnl Is parameter to `.align' logarithmic?
+
+AC_DEFUN([GMP_ASM_ALIGN_LOG],
+[AC_REQUIRE([GMP_ASM_GLOBL])
+AC_REQUIRE([GMP_ASM_BYTE])
+AC_REQUIRE([GMP_ASM_DATA])
+AC_REQUIRE([GMP_ASM_LABEL_SUFFIX])
+AC_REQUIRE([GMP_PROG_NM])
+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_globl foo
+ $gmp_cv_asm_byte 1
+ .align 4
+foo$gmp_cv_asm_label_suffix
+ $gmp_cv_asm_byte 2],
+ [gmp_tmp_val=[`$NM conftest.$OBJEXT | grep foo | \
+ sed -e 's;[[][0-9][]]\(.*\);\1;' -e 's;[^1-9]*\([0-9]*\).*;\1;'`]
+ if test "$gmp_tmp_val" = "10" || test "$gmp_tmp_val" = "16"; then
+ gmp_cv_asm_align_log=yes
+ else
+ gmp_cv_asm_align_log=no
+ fi],
+ [AC_MSG_ERROR([cannot assemble alignment test])])])
+
+GMP_DEFINE_RAW(["define(<ALIGN_LOGARITHMIC>,<$gmp_cv_asm_align_log>)"])
+])
+
+
+dnl GMP_ASM_ALIGN_FILL_0x90
+dnl -----------------------
+dnl Determine whether a ",0x90" suffix works on a .align directive.
+dnl This is only meant for use on x86, 0x90 being a "nop".
+dnl
+dnl Old gas, eg. 1.92.3
+dnl Needs ",0x90" or else the fill is 0x00, which can't be executed
+dnl across.
+dnl
+dnl New gas, eg. 2.91
+dnl Generates multi-byte nop fills even when ",0x90" is given.
+dnl
+dnl Solaris 2.6 as
+dnl ",0x90" is not allowed, causes a fatal error.
+dnl
+dnl Solaris 2.8 as
+dnl ",0x90" does nothing, generates a warning that it's being ignored.
+dnl
+dnl SCO OpenServer 5 as
+dnl Second parameter is max bytes to fill, not a fill pattern.
+dnl ",0x90" is an error due to being bigger than the first parameter.
+dnl Multi-byte nop fills are generated in text segments.
+dnl
+dnl Note that both solaris "as"s only care about ",0x90" if they actually
+dnl have to use it to fill something, hence the .byte in the test. It's
+dnl the second .align which provokes the error or warning.
+dnl
+dnl The warning from solaris 2.8 is suppressed to stop anyone worrying that
+dnl something might be wrong.
+
+AC_DEFUN([GMP_ASM_ALIGN_FILL_0x90],
+[AC_REQUIRE([GMP_ASM_TEXT])
+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
+ .byte 0
+ .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
+else
+ gmp_cv_asm_align_fill_0x90=yes
+fi],
+[gmp_cv_asm_align_fill_0x90=no])])
+
+GMP_DEFINE_RAW(["define(<ALIGN_FILL_0x90>,<$gmp_cv_asm_align_fill_0x90>)"])
+])
+
+
+dnl GMP_ASM_BYTE
+dnl ------------
+dnl .byte - is usual.
+dnl data1 - required by ia64 (on hpux at least).
+dnl
+dnl This macro is just to support other configure tests, not any actual asm
+dnl code.
+
+AC_DEFUN([GMP_ASM_BYTE],
+[AC_REQUIRE([GMP_ASM_TEXT])
+AC_REQUIRE([GMP_ASM_LABEL_SUFFIX])
+AC_CACHE_CHECK([for assembler byte directive],
+ gmp_cv_asm_byte,
+[for i in .byte data1; do
+ echo "trying $i" >&AC_FD_CC
+ GMP_TRY_ASSEMBLE(
+[ $gmp_cv_asm_data
+ $i 0
+],
+ [gmp_cv_asm_byte=$i
+ rm -f conftest*
+ break],
+ [cat conftest.out >&AC_FD_CC])
+done
+if test -z "$gmp_cv_asm_byte"; then
+ AC_MSG_ERROR([Cannot determine how to emit a data byte])
+fi
+])
+])
+
+
+dnl GMP_ASM_TEXT
+dnl ------------
+dnl .text - is usual.
+dnl .code - is needed by the hppa on HP-UX (but ia64 HP-UX uses .text)
+dnl .csect .text[PR] - is for AIX.
+
+AC_DEFUN([GMP_ASM_TEXT],
+[AC_CACHE_CHECK([how to switch to text section],
+ gmp_cv_asm_text,
+[for i in ".text" ".code" [".csect .text[PR]"]; do
+ echo "trying $i" >&AC_FD_CC
+ GMP_TRY_ASSEMBLE([ $i],
+ [gmp_cv_asm_text=$i
+ rm -f conftest*
+ break])
+done
+if test -z "$gmp_cv_asm_text"; then
+ AC_MSG_ERROR([Cannot determine text section directive])
+fi
+])
+echo ["define(<TEXT>, <$gmp_cv_asm_text>)"] >> $gmp_tmpconfigm4
+])
+
+
+dnl GMP_ASM_DATA
+dnl ------------
+dnl Can we say `.data'?
+
+AC_DEFUN([GMP_ASM_DATA],
+[AC_CACHE_CHECK([how to switch to data section],
+ gmp_cv_asm_data,
+[case $host in
+ *-*-aix*) gmp_cv_asm_data=[".csect .data[RW]"] ;;
+ *) gmp_cv_asm_data=".data" ;;
+esac
+])
+echo ["define(<DATA>, <$gmp_cv_asm_data>)"] >> $gmp_tmpconfigm4
+])
+
+
+dnl GMP_ASM_RODATA
+dnl --------------
+dnl Find out how to switch to the read-only data section.
+dnl
+dnl The compiler output is grepped for the right directive. It's not
+dnl considered wise to just probe for ".section .rodata" or whatever works,
+dnl since arbitrary section names might be accepted, but not necessarily do
+dnl the right thing when they get to the linker.
+dnl
+dnl Only a few asm files use RODATA, so this code is perhaps a bit
+dnl excessive right now, but should find more uses in the future.
+dnl
+dnl FIXME: gcc on aix generates something like ".csect _foo.ro_c[RO],3"
+dnl where foo is the object file. Might need to check for that if we use
+dnl RODATA there.
+
+AC_DEFUN([GMP_ASM_RODATA],
+[AC_REQUIRE([GMP_ASM_TEXT])
+AC_REQUIRE([GMP_ASM_DATA])
+AC_REQUIRE([GMP_ASM_LABEL_SUFFIX])
+AC_REQUIRE([GMP_ASM_UNDERSCORE])
+AC_CACHE_CHECK([how to switch to read-only data section],
+ gmp_cv_asm_rodata,
+[
+dnl Default to DATA on CPUs with split code/data caching, and TEXT
+dnl elsewhere. i386 means generic x86, so use DATA on it.
+case $host in
+X86_PATTERN | x86_64-*-*)
+ gmp_cv_asm_rodata="$gmp_cv_asm_data" ;;
+*)
+ gmp_cv_asm_rodata="$gmp_cv_asm_text" ;;
+esac
+
+cat >conftest.c <<EOF
+extern const int foo[[]]; /* Suppresses C++'s suppression of foo */
+const int foo[[]] = {1,2,3};
+EOF
+echo "Test program:" >&AC_FD_CC
+cat conftest.c >&AC_FD_CC
+gmp_compile="$CC $CFLAGS $CPPFLAGS -S conftest.c >&AC_FD_CC"
+if AC_TRY_EVAL(gmp_compile); then
+ echo "Compiler output:" >&AC_FD_CC
+ cat conftest.s >&AC_FD_CC
+ if test $gmp_cv_asm_underscore = yes; then
+ tmp_gsym_prefix=_
+ else
+ tmp_gsym_prefix=
+ fi
+ # must see our label
+ if grep "^${tmp_gsym_prefix}foo$gmp_cv_asm_label_suffix" conftest.s >/dev/null 2>&AC_FD_CC; then
+ # take the last directive before our label (hence skipping segments
+ # getting debugging info etc)
+ tmp_match=`sed -n ["/^${tmp_gsym_prefix}foo$gmp_cv_asm_label_suffix/q
+ /^[. ]*data/p
+ /^[. ]*rdata/p
+ /^[. ]*text/p
+ /^[. ]*section/p
+ /^[. ]*csect/p
+ /^[. ]*CSECT/p"] conftest.s | sed -n '$p'`
+ echo "Match: $tmp_match" >&AC_FD_CC
+ if test -n "$tmp_match"; then
+ gmp_cv_asm_rodata=$tmp_match
+ fi
+ else
+ echo "Couldn't find label: ^${tmp_gsym_prefix}foo$gmp_cv_asm_label_suffix" >&AC_FD_CC
+ fi
+fi
+rm -f conftest*
+])
+echo ["define(<RODATA>, <$gmp_cv_asm_rodata>)"] >> $gmp_tmpconfigm4
+])
+
+
+dnl GMP_ASM_GLOBL
+dnl -------------
+dnl The assembler directive to mark a label as a global symbol.
+dnl
+dnl ia64 - .global is standard, according to the Intel documentation.
+dnl
+dnl hppa - ".export foo,entry" is demanded by HP hppa "as". ".global" is a
+dnl kind of import.
+dnl
+dnl other - .globl is usual.
+dnl
+dnl "gas" tends to accept .globl everywhere, in addition to .export or
+dnl .global or whatever the system assembler demands.
+
+AC_DEFUN([GMP_ASM_GLOBL],
+[AC_REQUIRE([GMP_ASM_TEXT])
+AC_CACHE_CHECK([for assembler global directive],
+ gmp_cv_asm_globl,
+[case $host in
+ hppa*-*-*) gmp_cv_asm_globl=.export ;;
+ IA64_PATTERN) gmp_cv_asm_globl=.global ;;
+ *) gmp_cv_asm_globl=.globl ;;
+esac
+])
+echo ["define(<GLOBL>, <$gmp_cv_asm_globl>)"] >> $gmp_tmpconfigm4
+])
+
+
+dnl GMP_ASM_GLOBL_ATTR
+dnl ------------------
+dnl Do we need something after `GLOBL symbol'?
+
+AC_DEFUN([GMP_ASM_GLOBL_ATTR],
+[AC_REQUIRE([GMP_ASM_GLOBL])
+AC_CACHE_CHECK([for assembler global directive attribute],
+ gmp_cv_asm_globl_attr,
+[case $gmp_cv_asm_globl in
+ .export) gmp_cv_asm_globl_attr=",entry" ;;
+ *) gmp_cv_asm_globl_attr="" ;;
+esac
+])
+echo ["define(<GLOBL_ATTR>, <$gmp_cv_asm_globl_attr>)"] >> $gmp_tmpconfigm4
+])
+
+
+dnl GMP_ASM_TYPE
+dnl ------------
+dnl Can we say ".type", and how?
+dnl
+dnl For i386 GNU/Linux ELF systems, and very likely other ELF systems,
+dnl .type and .size are important on functions in shared libraries. If
+dnl .type is omitted and the mainline program references that function then
+dnl the code will be copied down to the mainline at load time like a piece
+dnl of data. If .size is wrong or missing (it defaults to 4 bytes or some
+dnl such) then incorrect bytes will be copied and a segv is the most likely
+dnl result. In any case such copying is not what's wanted, a .type
+dnl directive will ensure a PLT entry is used.
+dnl
+dnl In GMP the assembler functions are normally only used from within the
+dnl library (since most programs are not interested in the low level
+dnl routines), and in those circumstances a missing .type isn't fatal,
+dnl letting the problem go unnoticed. tests/mpn/t-asmtype.c aims to check
+dnl for it.
+
+AC_DEFUN([GMP_ASM_TYPE],
+[AC_CACHE_CHECK([for assembler .type directive],
+ gmp_cv_asm_type,
+[gmp_cv_asm_type=
+for gmp_tmp_prefix in @ \# %; do
+ GMP_TRY_ASSEMBLE([ .type sym,${gmp_tmp_prefix}function],
+ [if grep "\.type pseudo-op used outside of \.def/\.endef ignored" conftest.out >/dev/null; then : ;
+ else
+ gmp_cv_asm_type=".type \$][1,${gmp_tmp_prefix}\$][2"
+ break
+ fi])
+done
+rm -f conftest*
+])
+echo ["define(<TYPE>, <$gmp_cv_asm_type>)"] >> $gmp_tmpconfigm4
+])
+
+
+dnl GMP_ASM_SIZE
+dnl ------------
+dnl Can we say `.size'?
+
+AC_DEFUN([GMP_ASM_SIZE],
+[AC_CACHE_CHECK([for assembler .size directive],
+ gmp_cv_asm_size,
+[gmp_cv_asm_size=
+GMP_TRY_ASSEMBLE([ .size sym,1],
+ [if grep "\.size pseudo-op used outside of \.def/\.endef ignored" conftest.out >/dev/null; then : ;
+ else
+ gmp_cv_asm_size=".size \$][1,\$][2"
+ fi])
+])
+echo ["define(<SIZE>, <$gmp_cv_asm_size>)"] >> $gmp_tmpconfigm4
+])
+
+
+dnl GMP_ASM_COFF_TYPE
+dnl -----------------
+dnl Determine whether the assembler supports COFF type information.
+dnl
+dnl Currently this is only needed for mingw (and cygwin perhaps) and so is
+dnl run only on the x86s, but it ought to work anywhere.
+dnl
+dnl On MINGW, recent versions of the linker have an automatic import scheme
+dnl for data in a DLL which is referenced by a mainline but without
+dnl __declspec (__dllimport__) on the prototype. It seems functions
+dnl without type information are treated as data, or something, and calls
+dnl to them from the mainline will crash. gcc puts type information on the
+dnl C functions it generates, we need to do the same for assembler
+dnl functions.
+dnl
+dnl This applies only to functions without __declspec(__dllimport__),
+dnl ie. without __GMP_DECLSPEC in the case of libgmp, so it also works just
+dnl to ensure all assembler functions used from outside libgmp have
+dnl __GMP_DECLSPEC on their prototypes. But this isn't an ideal situation,
+dnl since we don't want perfectly valid calls going wrong just because
+dnl there wasn't a prototype in scope.
+dnl
+dnl When an auto-import takes place, the following warning is given by the
+dnl linker. This shouldn't be seen for any functions.
+dnl
+dnl Info: resolving _foo by linking to __imp__foo (auto-import)
+dnl
+dnl
+dnl COFF type directives look like the following
+dnl
+dnl .def _foo
+dnl .scl 2
+dnl .type 32
+dnl .endef
+dnl
+dnl _foo is the symbol with GSYM_PREFIX (_). .scl is the storage class, 2
+dnl for external, 3 for static. .type is the object type, 32 for a
+dnl function.
+dnl
+dnl On an ELF system, this is (correctly) rejected due to .def, .endef and
+dnl .scl being invalid, and .type not having enough arguments.
+
+AC_DEFUN([GMP_ASM_COFF_TYPE],
+[AC_REQUIRE([GMP_ASM_TEXT])
+AC_REQUIRE([GMP_ASM_GLOBL])
+AC_REQUIRE([GMP_ASM_GLOBL_ATTR])
+AC_REQUIRE([GMP_ASM_LABEL_SUFFIX])
+AC_REQUIRE([GMP_ASM_UNDERSCORE])
+AC_CACHE_CHECK([for assembler COFF type directives],
+ gmp_cv_asm_x86_coff_type,
+[GMP_TRY_ASSEMBLE(
+[ $gmp_cv_asm_text
+ $gmp_cv_asm_globl ${tmp_gsym_prefix}foo$gmp_cv_asm_globl_attr
+ .def ${tmp_gsym_prefix}foo
+ .scl 2
+ .type 32
+ .endef
+${tmp_gsym_prefix}foo$gmp_cv_asm_label_suffix
+],
+ [gmp_cv_asm_x86_coff_type=yes],
+ [gmp_cv_asm_x86_coff_type=no])
+])
+echo ["define(<HAVE_COFF_TYPE>, <$gmp_cv_asm_x86_coff_type>)"] >> $gmp_tmpconfigm4
+])
+
+
+dnl GMP_ASM_LSYM_PREFIX
+dnl -------------------
+dnl What is the prefix for a local label?
+dnl
+dnl The prefixes tested are,
+dnl
+dnl L - usual for underscore systems
+dnl .L - usual for non-underscore systems
+dnl $ - alpha (gas and OSF system assembler)
+dnl L$ - hppa (gas and HP-UX system assembler)
+dnl
+dnl The default is "L" if the tests fail for any reason. There's a good
+dnl chance this will be adequate, since on most systems labels are local
+dnl anyway unless given a ".globl", and an "L" will avoid clashes with
+dnl other identifers.
+dnl
+dnl For gas, ".L" is normally purely local to the assembler, it doesn't get
+dnl put into the object file at all. This style is preferred, to keep the
+dnl object files nice and clean.
+dnl
+dnl BSD format nm produces a line like
+dnl
+dnl 00000000 t Lgurkmacka
+dnl
+dnl The symbol code is normally "t" for text, but any lower case letter
+dnl indicates a local definition.
+dnl
+dnl Code "n" is for a debugging symbol, OSF "nm -B" gives that as an upper
+dnl case "N" for a local.
+dnl
+dnl HP-UX nm prints an error message (though seems to give a 0 exit) if
+dnl there's no symbols at all in an object file, hence the use of "dummy".
+
+AC_DEFUN([GMP_ASM_LSYM_PREFIX],
+[AC_REQUIRE([GMP_ASM_LABEL_SUFFIX])
+AC_REQUIRE([GMP_ASM_TEXT])
+AC_REQUIRE([GMP_PROG_NM])
+AC_CACHE_CHECK([for assembler local label prefix],
+ gmp_cv_asm_lsym_prefix,
+[gmp_tmp_pre_appears=yes
+for gmp_tmp_pre in L .L $L $ L$; do
+ echo "Trying $gmp_tmp_pre" >&AC_FD_CC
+ GMP_TRY_ASSEMBLE(
+[ $gmp_cv_asm_text
+dummy${gmp_cv_asm_label_suffix}
+${gmp_tmp_pre}gurkmacka${gmp_cv_asm_label_suffix}],
+ [if $NM conftest.$OBJEXT >conftest.nm 2>&AC_FD_CC; then : ; else
+ cat conftest.nm >&AC_FD_CC
+ AC_MSG_WARN(["$NM" failure])
+ break
+ fi
+ cat conftest.nm >&AC_FD_CC
+ if grep gurkmacka conftest.nm >/dev/null; then : ; else
+ # no mention of the symbol, this is good
+ echo "$gmp_tmp_pre label doesn't appear in object file at all (good)" >&AC_FD_CC
+ gmp_cv_asm_lsym_prefix="$gmp_tmp_pre"
+ gmp_tmp_pre_appears=no
+ break
+ fi
+ if grep [' [a-zN] .*gurkmacka'] conftest.nm >/dev/null; then
+ # symbol mentioned as a local, use this if nothing better
+ echo "$gmp_tmp_pre label is local but still in object file" >&AC_FD_CC
+ if test -z "$gmp_cv_asm_lsym_prefix"; then
+ gmp_cv_asm_lsym_prefix="$gmp_tmp_pre"
+ fi
+ else
+ echo "$gmp_tmp_pre label is something unknown" >&AC_FD_CC
+ fi
+ ])
+done
+rm -f conftest*
+if test -z "$gmp_cv_asm_lsym_prefix"; then
+ gmp_cv_asm_lsym_prefix=L
+ AC_MSG_WARN([cannot determine local label, using default $gmp_cv_asm_lsym_prefix])
+fi
+# for development purposes, note whether we got a purely temporary local label
+echo "Local label appears in object files: $gmp_tmp_pre_appears" >&AC_FD_CC
+])
+echo ["define(<LSYM_PREFIX>, <${gmp_cv_asm_lsym_prefix}>)"] >> $gmp_tmpconfigm4
+AC_DEFINE_UNQUOTED(LSYM_PREFIX, "$gmp_cv_asm_lsym_prefix",
+ [Assembler local label prefix])
+])
+
+
+dnl GMP_ASM_W32
+dnl -----------
+dnl How to define a 32-bit word.
+dnl
+dnl FIXME: This test is not right for ia64-*-hpux*. The directive should
+dnl be "data4", but the W32 macro is not currently used by the mpn/ia64 asm
+dnl files.
+
+AC_DEFUN([GMP_ASM_W32],
+[AC_REQUIRE([GMP_ASM_DATA])
+AC_REQUIRE([GMP_ASM_BYTE])
+AC_REQUIRE([GMP_ASM_GLOBL])
+AC_REQUIRE([GMP_ASM_LABEL_SUFFIX])
+AC_REQUIRE([GMP_PROG_NM])
+AC_CACHE_CHECK([how to define a 32-bit word],
+ gmp_cv_asm_w32,
+[case $host in
+ *-*-hpux*)
+ # FIXME: HPUX puts first symbol at 0x40000000, breaking our assumption
+ # that it's at 0x0. We'll have to declare another symbol before the
+ # .long/.word and look at the distance between the two symbols. The
+ # only problem is that the sed expression(s) barfs (on Solaris, for
+ # example) for the symbol with value 0. For now, HPUX uses .word.
+ gmp_cv_asm_w32=".word"
+ ;;
+ *-*-*)
+ gmp_tmp_val=
+ for gmp_tmp_op in .long .word data4; do
+ GMP_TRY_ASSEMBLE(
+[ $gmp_cv_asm_data
+ $gmp_cv_asm_globl foo
+ $gmp_tmp_op 0
+foo$gmp_cv_asm_label_suffix
+ $gmp_cv_asm_byte 0],
+ [gmp_tmp_val=[`$NM conftest.$OBJEXT | grep foo | \
+ sed -e 's;[[][0-9][]]\(.*\);\1;' -e 's;[^1-9]*\([0-9]*\).*;\1;'`]
+ if test "$gmp_tmp_val" = 4; then
+ gmp_cv_asm_w32="$gmp_tmp_op"
+ break
+ fi])
+ done
+ rm -f conftest*
+ ;;
+esac
+if test -z "$gmp_cv_asm_w32"; then
+ AC_MSG_ERROR([cannot determine how to define a 32-bit word])
+fi
+])
+echo ["define(<W32>, <$gmp_cv_asm_w32>)"] >> $gmp_tmpconfigm4
+])
+
+
+dnl GMP_X86_ASM_GOT_UNDERSCORE
+dnl --------------------------
+dnl Determine whether i386 _GLOBAL_OFFSET_TABLE_ needs an additional
+dnl underscore prefix.
+dnl
+dnl SVR4 - the standard is _GLOBAL_OFFSET_TABLE_
+dnl GNU/Linux - follows SVR4
+dnl OpenBSD - an a.out underscore system, uses __GLOBAL_OFFSET_TABLE_
+dnl NetBSD - also an a.out underscore system, but _GLOBAL_OFFSET_TABLE_
+dnl
+dnl The test attempts to link a program using _GLOBAL_OFFSET_TABLE_ or
+dnl __GLOBAL_OFFSET_TABLE_ to see which works.
+dnl
+dnl $lt_prog_compiler_pic is included in the compile because old versions
+dnl of gas wouldn't accept PIC idioms without the right option (-K). This
+dnl is the same as what libtool and mpn/Makeasm.am will do.
+dnl
+dnl $lt_prog_compiler_pic is also included in the link because OpenBSD ld
+dnl won't accept an R_386_GOTPC relocation without the right options. This
+dnl is not what's done by the Makefiles when building executables, but
+dnl let's hope it's ok (it works fine with gcc).
+dnl
+dnl The fallback is no additional underscore, on the basis that this will
+dnl suit SVR4/ELF style systems, which should be much more common than
+dnl a.out systems with shared libraries.
+dnl
+dnl Note that it's not an error for the tests to fail, since for instance
+dnl cygwin, mingw and djgpp don't have a _GLOBAL_OFFSET_TABLE_ scheme at
+dnl all.
+dnl
+dnl Perhaps $CCAS could be asked to do the linking as well as the
+dnl assembling, but in the Makefiles it's only used for assembling, so lets
+dnl keep it that way.
+dnl
+dnl The test here is run even under --disable-shared, so that PIC objects
+dnl can be built and tested by the tune/many.pl development scheme. The
+dnl tests will be reasonably quick and won't give a fatal error, so this
+dnl arrangement is ok. AC_LIBTOOL_PROG_COMPILER_PIC does its
+dnl $lt_prog_compiler_pic setups even for --disable-shared too.
+
+AC_DEFUN([GMP_ASM_X86_GOT_UNDERSCORE],
+[AC_REQUIRE([GMP_ASM_TEXT])
+AC_REQUIRE([GMP_ASM_GLOBL])
+AC_REQUIRE([GMP_ASM_GLOBL_ATTR])
+AC_REQUIRE([GMP_ASM_LABEL_SUFFIX])
+AC_REQUIRE([GMP_ASM_UNDERSCORE])
+AC_REQUIRE([AC_LIBTOOL_PROG_COMPILER_PIC])
+AC_CACHE_CHECK([if _GLOBAL_OFFSET_TABLE_ is prefixed by underscore],
+ gmp_cv_asm_x86_got_underscore,
+[gmp_cv_asm_x86_got_underscore="not applicable"
+if test $gmp_cv_asm_underscore = yes; then
+ tmp_gsym_prefix=_
+else
+ tmp_gsym_prefix=
+fi
+for tmp_underscore in "" "_"; do
+ cat >conftest.s <<EOF
+ $gmp_cv_asm_text
+ $gmp_cv_asm_globl ${tmp_gsym_prefix}main$gmp_cv_asm_globl_attr
+${tmp_gsym_prefix}main$gmp_cv_asm_label_suffix
+ addl $ ${tmp_underscore}_GLOBAL_OFFSET_TABLE_, %ebx
+EOF
+ gmp_compile="$CCAS $CFLAGS $CPPFLAGS $lt_prog_compiler_pic conftest.s >&AC_FD_CC && $CC $CFLAGS $CPPFLAGS $lt_prog_compiler_pic conftest.$OBJEXT >&AC_FD_CC"
+ if AC_TRY_EVAL(gmp_compile); then
+ if test "$tmp_underscore" = "_"; then
+ gmp_cv_asm_x86_got_underscore=yes
+ else
+ gmp_cv_asm_x86_got_underscore=no
+ fi
+ break
+ fi
+done
+rm -f conftest* a.out b.out a.exe a_out.exe
+])
+if test "$gmp_cv_asm_x86_got_underscore" = "yes"; then
+ GMP_DEFINE(GOT_GSYM_PREFIX, [_])
+else
+ GMP_DEFINE(GOT_GSYM_PREFIX, [])
+fi
+])
+
+
+dnl GMP_ASM_X86_GOT_EAX_OK(CC+CFLAGS, [ACTION-YES] [, ACTION-NO])
+dnl -------------------------------------------------------------
+dnl Determine whether _GLOBAL_OFFSET_TABLE_ used with %eax is ok.
+dnl
+dnl An instruction
+dnl
+dnl addl $_GLOBAL_OFFSET_TABLE_, %eax
+dnl
+dnl is incorrectly assembled by gas 2.12 (or thereabouts) and earlier. It
+dnl puts an addend 2 into the R_386_GOTPC relocation, but it should be 1
+dnl for this %eax form being a 1 byte opcode (with other registers it's 2
+dnl opcode bytes). See note about this in mpn/x86/README too.
+dnl
+dnl We assemble this, surrounded by some unlikely byte sequences as
+dnl delimiters, and check for the bad output.
+dnl
+dnl This is for use by compiler probing in GMP_PROG_CC_WORKS, so the result
+dnl is not cached.
+dnl
+dnl This test is not specific to gas, but old gas is the only assembler we
+dnl know of with this problem. The Solaris has been seen coming out ok.
+dnl
+dnl ".text" is hard coded because this macro is wanted before GMP_ASM_TEXT.
+dnl This should be fine, ".text" is normal on x86 systems, and certainly
+dnl will be fine with the offending gas.
+dnl
+dnl If an error occurs when assembling, we consider the assembler ok, since
+dnl the bad output does not occur. This happens for instance on mingw,
+dnl where _GLOBAL_OFFSET_TABLE_ results in a bfd error, since there's no
+dnl GOT etc in PE object files.
+dnl
+dnl This test is used before the object file extension has been determined,
+dnl so we force output to conftest.o. Using -o with -c is not portable,
+dnl but we think all x86 compilers will accept -o with -c, certainly gcc
+dnl does.
+dnl
+dnl -fPIC is hard coded here, because this test is for use before libtool
+dnl has established the pic options. It's right for gcc, but perhaps not
+dnl other compilers.
+
+AC_DEFUN([GMP_ASM_X86_GOT_EAX_OK],
+[echo "Testing gas GOT with eax good" >&AC_FD_CC
+cat >conftest.awk <<\EOF
+[BEGIN {
+ want[0] = "001"
+ want[1] = "043"
+ want[2] = "105"
+ want[3] = "147"
+ want[4] = "211"
+ want[5] = "253"
+ want[6] = "315"
+ want[7] = "357"
+
+ want[8] = "005"
+ want[9] = "002"
+ want[10] = "000"
+ want[11] = "000"
+ want[12] = "000"
+
+ want[13] = "376"
+ want[14] = "334"
+ want[15] = "272"
+ want[16] = "230"
+ want[17] = "166"
+ want[18] = "124"
+ want[19] = "062"
+ want[20] = "020"
+
+ result = "yes"
+}
+{
+ for (f = 2; f <= NF; f++)
+ {
+ for (i = 0; i < 20; i++)
+ got[i] = got[i+1];
+ got[20] = $f;
+
+ found = 1
+ for (i = 0; i < 21; i++)
+ if (got[i] != want[i])
+ {
+ found = 0
+ break
+ }
+ if (found)
+ {
+ result = "no"
+ exit
+ }
+ }
+}
+END {
+ print result
+}
+]EOF
+cat >conftest.s <<\EOF
+[ .text
+ .byte 1, 35, 69, 103, 137, 171, 205, 239
+ addl $_GLOBAL_OFFSET_TABLE_, %eax
+ .byte 254, 220, 186, 152, 118, 84, 50, 16
+]EOF
+tmp_got_good=yes
+gmp_compile="$1 -fPIC -o conftest.o -c conftest.s >&AC_FD_CC 2>&1"
+if AC_TRY_EVAL(gmp_compile); then
+ tmp_got_good=`od -b conftest.o | $AWK -f conftest.awk`
+fi
+rm -f conftest.*
+echo "Result: $tmp_got_good" >&AC_FD_CC
+if test "$tmp_got_good" = no; then
+ ifelse([$3],,:,[$3])
+else
+ ifelse([$2],,:,[$2])
+fi
+])
+
+
+dnl GMP_ASM_X86_MMX([ACTION-IF-YES][,ACTION-IF-NO])
+dnl -----------------------------------------------
+dnl Determine whether the assembler supports MMX instructions.
+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. Actually
+dnl ".text" probably isn't needed at all, at least for just checking
+dnl instruction syntax.
+dnl
+dnl "movq %mm0, %mm1" should assemble to "0f 6f c8", but Solaris 2.6 and
+dnl 2.7 wrongly assemble it to "0f 6f c1" (that being the reverse "movq
+dnl %mm1, %mm0"). It seems more trouble than it's worth to work around
+dnl this in the code, so just detect and reject.
+
+AC_DEFUN([GMP_ASM_X86_MMX],
+[AC_CACHE_CHECK([if the assembler knows about MMX instructions],
+ gmp_cv_asm_x86_mmx,
+[GMP_TRY_ASSEMBLE(
+[ .text
+ movq %mm0, %mm1],
+[gmp_cv_asm_x86_mmx=yes
+case $host in
+*-*-solaris*)
+ if (dis conftest.$OBJEXT >conftest.out) 2>/dev/null; then
+ if grep "0f 6f c1" conftest.out >/dev/null; then
+ gmp_cv_asm_x86_mmx=movq-bug
+ fi
+ else
+ AC_MSG_WARN(["dis" not available to check for "as" movq bug])
+ fi
+esac],
+[gmp_cv_asm_x86_mmx=no])])
+
+case $gmp_cv_asm_x86_mmx in
+movq-bug)
+ AC_MSG_WARN([+----------------------------------------------------------])
+ AC_MSG_WARN([| WARNING WARNING WARNING])
+ AC_MSG_WARN([| Host CPU has MMX code, but the assembler])
+ AC_MSG_WARN([| $CCAS $CFLAGS $CPPFLAGS])
+ AC_MSG_WARN([| has the Solaris 2.6 and 2.7 bug where register to register])
+ AC_MSG_WARN([| movq operands are reversed.])
+ AC_MSG_WARN([| Non-MMX replacements will be used.])
+ AC_MSG_WARN([| This will be an inferior build.])
+ AC_MSG_WARN([+----------------------------------------------------------])
+ ;;
+no)
+ AC_MSG_WARN([+----------------------------------------------------------])
+ AC_MSG_WARN([| WARNING WARNING WARNING])
+ AC_MSG_WARN([| Host CPU has MMX code, but it can't be assembled by])
+ AC_MSG_WARN([| $CCAS $CFLAGS $CPPFLAGS])
+ AC_MSG_WARN([| Non-MMX replacements will be used.])
+ AC_MSG_WARN([| This will be an inferior build.])
+ AC_MSG_WARN([+----------------------------------------------------------])
+ ;;
+esac
+if test "$gmp_cv_asm_x86_mmx" = yes; then
+ ifelse([$1],,:,[$1])
+else
+ ifelse([$2],,:,[$2])
+fi
+])
+
+
+dnl GMP_ASM_X86_SHLDL_CL
+dnl --------------------
+
+AC_DEFUN([GMP_ASM_X86_SHLDL_CL],
+[AC_REQUIRE([GMP_ASM_TEXT])
+AC_CACHE_CHECK([if the assembler takes cl with shldl],
+ gmp_cv_asm_x86_shldl_cl,
+[GMP_TRY_ASSEMBLE(
+[ $gmp_cv_asm_text
+ shldl %cl, %eax, %ebx],
+ gmp_cv_asm_x86_shldl_cl=yes,
+ gmp_cv_asm_x86_shldl_cl=no)
+])
+if test "$gmp_cv_asm_x86_shldl_cl" = "yes"; then
+ GMP_DEFINE(WANT_SHLDL_CL,1)
+else
+ GMP_DEFINE(WANT_SHLDL_CL,0)
+fi
+])
+
+
+dnl GMP_ASM_X86_SSE2([ACTION-IF-YES][,ACTION-IF-NO])
+dnl ------------------------------------------------
+dnl Determine whether the assembler supports SSE2 instructions.
+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_SSE2],
+[AC_CACHE_CHECK([if the assembler knows about SSE2 instructions],
+ gmp_cv_asm_x86_sse2,
+[GMP_TRY_ASSEMBLE(
+[ .text
+ paddq %mm0, %mm1],
+ [gmp_cv_asm_x86_sse2=yes],
+ [gmp_cv_asm_x86_sse2=no])
+])
+case $gmp_cv_asm_x86_sse2 in
+yes)
+ ifelse([$1],,:,[$1])
+ ;;
+*)
+ AC_MSG_WARN([+----------------------------------------------------------])
+ AC_MSG_WARN([| WARNING WARNING WARNING])
+ AC_MSG_WARN([| Host CPU has SSE2 code, but it can't be assembled by])
+ AC_MSG_WARN([| $CCAS $CFLAGS $CPPFLAGS])
+ AC_MSG_WARN([| Non-SSE2 replacements will be used.])
+ AC_MSG_WARN([| This will be an inferior build.])
+ AC_MSG_WARN([+----------------------------------------------------------])
+ ifelse([$2],,:,[$2])
+ ;;
+esac
+])
+
+
+dnl GMP_ASM_X86_MULX([ACTION-IF-YES][,ACTION-IF-NO])
+dnl ------------------------------------------------
+dnl Determine whether the assembler supports the mulx instruction which debut
+dnl with Haswell.
+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_MULX],
+[AC_CACHE_CHECK([if the assembler knows about the mulx instruction],
+ gmp_cv_asm_x86_mulx,
+[GMP_TRY_ASSEMBLE(
+[ .text
+ mulx %r8, %r9, %r10],
+ [gmp_cv_asm_x86_mulx=yes],
+ [gmp_cv_asm_x86_mulx=no])
+])
+case $gmp_cv_asm_x86_mulx in
+yes)
+ ifelse([$1],,:,[$1])
+ ;;
+*)
+ AC_MSG_WARN([+----------------------------------------------------------])
+ AC_MSG_WARN([| WARNING WARNING WARNING])
+ AC_MSG_WARN([| Host CPU has the mulx instruction, but it can't be])
+ AC_MSG_WARN([| 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_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.
+dnl
+dnl A dummy function is compiled and the ".s" output examined. The pattern
+dnl matching might be a bit fragile, but should work at least with gcc on
+dnl sensible systems. Certainly it's better than hard coding a table of
+dnl conventions.
+dnl
+dnl For non-PIC, any ".data" is taken to mean a counter might be passed.
+dnl It's assumed a movl will set it up, and the right register is taken
+dnl from that movl. Any movl involving %esp is ignored (a frame pointer
+dnl setup normally).
+dnl
+dnl For PIC, any ".data" is similarly interpreted, but a GOTOFF identifies
+dnl the line setting up the right register.
+dnl
+dnl In both cases a line with "mcount" identifies the call and that line is
+dnl used literally.
+dnl
+dnl On some systems (eg. FreeBSD 3.5) gcc emits ".data" but doesn't use it,
+dnl so it's not an error to have .data but then not find a register.
+dnl
+dnl Variations in mcount conventions on different x86 systems can be found
+dnl in gcc config/i386. mcount can have a "_" prefix or be .mcount or
+dnl _mcount_ptr, and for PIC it can be called through a GOT entry, or via
+dnl the PLT. If a pointer to a counter is required it's passed in %eax or
+dnl %edx.
+dnl
+dnl Flags to specify PIC are taken from $lt_prog_compiler_pic set by
+dnl AC_PROG_LIBTOOL.
+dnl
+dnl Enhancement: Cache the values determined here. But what's the right way
+dnl to get two variables (mcount_nonpic_reg and mcount_nonpic_call say) set
+dnl from one block of commands?
+
+AC_DEFUN([GMP_ASM_X86_MCOUNT],
+[AC_REQUIRE([AC_ENABLE_SHARED])
+AC_REQUIRE([AC_PROG_LIBTOOL])
+AC_MSG_CHECKING([how to call x86 mcount])
+cat >conftest.c <<EOF
+foo(){bar();}
+EOF
+
+if test "$enable_static" = yes; then
+ gmp_asmout_compile="$CC $CFLAGS $CPPFLAGS -S conftest.c 1>&AC_FD_CC"
+ if AC_TRY_EVAL(gmp_asmout_compile); then
+ if grep '\.data' conftest.s >/dev/null; then
+ mcount_nonpic_reg=`sed -n ['/esp/!s/.*movl.*,\(%[a-z]*\).*$/\1/p'] conftest.s`
+ else
+ mcount_nonpic_reg=
+ fi
+ mcount_nonpic_call=`grep 'call.*mcount' conftest.s`
+ if test -z "$mcount_nonpic_call"; then
+ AC_MSG_ERROR([Cannot find mcount call for non-PIC])
+ fi
+ else
+ AC_MSG_ERROR([Cannot compile test program for non-PIC])
+ fi
+fi
+
+if test "$enable_shared" = yes; then
+ gmp_asmout_compile="$CC $CFLAGS $CPPFLAGS $lt_prog_compiler_pic -S conftest.c 1>&AC_FD_CC"
+ if AC_TRY_EVAL(gmp_asmout_compile); then
+ if grep '\.data' conftest.s >/dev/null; then
+ case $lt_prog_compiler_pic in
+ *-DDLL_EXPORT*)
+ # Windows DLLs have non-PIC style mcount
+ mcount_pic_reg=`sed -n ['/esp/!s/.*movl.*,\(%[a-z]*\).*$/\1/p'] conftest.s`
+ ;;
+ *)
+ mcount_pic_reg=`sed -n ['s/.*GOTOFF.*,\(%[a-z]*\).*$/\1/p'] conftest.s`
+ ;;
+ esac
+ else
+ mcount_pic_reg=
+ fi
+ mcount_pic_call=`grep 'call.*mcount' conftest.s`
+ if test -z "$mcount_pic_call"; then
+ AC_MSG_ERROR([Cannot find mcount call for PIC])
+ fi
+ else
+ AC_MSG_ERROR([Cannot compile test program for PIC])
+ fi
+fi
+
+GMP_DEFINE_RAW(["define(<MCOUNT_NONPIC_REG>, <\`$mcount_nonpic_reg'>)"])
+GMP_DEFINE_RAW(["define(<MCOUNT_NONPIC_CALL>,<\`$mcount_nonpic_call'>)"])
+GMP_DEFINE_RAW(["define(<MCOUNT_PIC_REG>, <\`$mcount_pic_reg'>)"])
+GMP_DEFINE_RAW(["define(<MCOUNT_PIC_CALL>, <\`$mcount_pic_call'>)"])
+
+rm -f conftest.*
+AC_MSG_RESULT([determined])
+])
+
+
+dnl GMP_ASM_IA64_ALIGN_OK
+dnl ---------------------
+dnl Determine whether .align correctly pads with nop instructions in a text
+dnl segment.
+dnl
+dnl gas 2.14 and earlier byte swaps its padding bundle on big endian
+dnl systems, which is incorrect (endianness only changes data). What
+dnl should be "nop.m / nop.f / nop.i" comes out as "break" instructions.
+dnl
+dnl The test here detects the bad case, and assumes anything else is ok
+dnl (there are many sensible nop bundles, so it'd be impractical to try to
+dnl match everything good).
+
+AC_DEFUN([GMP_ASM_IA64_ALIGN_OK],
+[AC_CACHE_CHECK([whether assembler .align padding is good],
+ gmp_cv_asm_ia64_align_ok,
+[cat >conftest.awk <<\EOF
+[BEGIN {
+ want[0] = "011"
+ want[1] = "160"
+ want[2] = "074"
+ want[3] = "040"
+ want[4] = "000"
+ want[5] = "040"
+ want[6] = "020"
+ want[7] = "221"
+ want[8] = "114"
+ want[9] = "000"
+ want[10] = "100"
+ want[11] = "200"
+ want[12] = "122"
+ want[13] = "261"
+ want[14] = "000"
+ want[15] = "200"
+
+ want[16] = "000"
+ want[17] = "004"
+ want[18] = "000"
+ want[19] = "000"
+ want[20] = "000"
+ want[21] = "000"
+ want[22] = "002"
+ want[23] = "000"
+ want[24] = "000"
+ want[25] = "000"
+ want[26] = "000"
+ want[27] = "001"
+ want[28] = "000"
+ want[29] = "000"
+ want[30] = "000"
+ want[31] = "014"
+
+ want[32] = "011"
+ want[33] = "270"
+ want[34] = "140"
+ want[35] = "062"
+ want[36] = "000"
+ want[37] = "040"
+ want[38] = "240"
+ want[39] = "331"
+ want[40] = "160"
+ want[41] = "000"
+ want[42] = "100"
+ want[43] = "240"
+ want[44] = "343"
+ want[45] = "371"
+ want[46] = "000"
+ want[47] = "200"
+
+ result = "yes"
+}
+{
+ for (f = 2; f <= NF; f++)
+ {
+ for (i = 0; i < 47; i++)
+ got[i] = got[i+1];
+ got[47] = $f;
+
+ found = 1
+ for (i = 0; i < 48; i++)
+ if (got[i] != want[i])
+ {
+ found = 0
+ break
+ }
+ if (found)
+ {
+ result = "no"
+ exit
+ }
+ }
+}
+END {
+ print result
+}
+]EOF
+GMP_TRY_ASSEMBLE(
+[ .text
+ .align 32
+{ .mmi; add r14 = r15, r16
+ add r17 = r18, r19
+ add r20 = r21, r22 ;; }
+ .align 32
+{ .mmi; add r23 = r24, r25
+ add r26 = r27, r28
+ add r29 = r30, r31 ;; }
+],
+ [gmp_cv_asm_ia64_align_ok=`od -b conftest.$OBJEXT | $AWK -f conftest.awk`],
+ [AC_MSG_WARN([oops, cannot compile test program])
+ gmp_cv_asm_ia64_align_ok=yes])
+])
+GMP_DEFINE_RAW(["define(<IA64_ALIGN_OK>, <\`$gmp_cv_asm_ia64_align_ok'>)"])
+])
+
+
+
+
+dnl GMP_ASM_M68K_INSTRUCTION
+dnl ------------------------
+dnl Not sure if ".l" and "%" are independent settings, but it doesn't hurt
+dnl to try all four possibilities. Note that the % ones must be first, so
+dnl "d0" won't be interpreted as a label.
+dnl
+dnl gas 1.92.3 on NetBSD 1.4 needs to be tested with a two operand
+dnl instruction. It takes registers without "%", but a single operand
+dnl "clrl %d0" only gives a warning, not an error.
+
+AC_DEFUN([GMP_ASM_M68K_INSTRUCTION],
+[AC_REQUIRE([GMP_ASM_TEXT])
+AC_CACHE_CHECK([assembler instruction and register style],
+ gmp_cv_asm_m68k_instruction,
+[for i in "addl %d0,%d1" "add.l %d0,%d1" "addl d0,d1" "add.l d0,d1"; do
+ GMP_TRY_ASSEMBLE(
+ [ $gmp_cv_asm_text
+ $i],
+ [gmp_cv_asm_m68k_instruction=$i
+ rm -f conftest*
+ break])
+done
+if test -z "$gmp_cv_asm_m68k_instruction"; then
+ AC_MSG_ERROR([cannot determine assembler instruction and register style])
+fi
+])
+case $gmp_cv_asm_m68k_instruction in
+"addl d0,d1") want_dot_size=no; want_register_percent=no ;;
+"addl %d0,%d1") want_dot_size=no; want_register_percent=yes ;;
+"add.l d0,d1") want_dot_size=yes; want_register_percent=no ;;
+"add.l %d0,%d1") want_dot_size=yes; want_register_percent=yes ;;
+*) AC_MSG_ERROR([oops, unrecognised instruction and register style]) ;;
+esac
+GMP_DEFINE_RAW(["define(<WANT_REGISTER_PERCENT>, <\`$want_register_percent'>)"])
+GMP_DEFINE_RAW(["define(<WANT_DOT_SIZE>, <\`$want_dot_size'>)"])
+])
+
+
+dnl GMP_ASM_M68K_ADDRESSING
+dnl -----------------------
+
+AC_DEFUN([GMP_ASM_M68K_ADDRESSING],
+[AC_REQUIRE([GMP_ASM_TEXT])
+AC_REQUIRE([GMP_ASM_M68K_INSTRUCTION])
+AC_CACHE_CHECK([assembler addressing style],
+ gmp_cv_asm_m68k_addressing,
+[case $gmp_cv_asm_m68k_instruction in
+addl*) movel=movel ;;
+add.l*) movel=move.l ;;
+*) AC_MSG_ERROR([oops, unrecognised gmp_cv_asm_m68k_instruction]) ;;
+esac
+case $gmp_cv_asm_m68k_instruction in
+*"%d0,%d1") dreg=%d0; areg=%a0 ;;
+*"d0,d1") dreg=d0; areg=a0 ;;
+*) AC_MSG_ERROR([oops, unrecognised gmp_cv_asm_m68k_instruction]) ;;
+esac
+GMP_TRY_ASSEMBLE(
+[ $gmp_cv_asm_text
+ $movel $dreg, $areg@-],
+ [gmp_cv_asm_m68k_addressing=mit],
+[GMP_TRY_ASSEMBLE(
+[ $gmp_cv_asm_text
+ $movel $dreg, -($areg)],
+ [gmp_cv_asm_m68k_addressing=motorola],
+[AC_MSG_ERROR([cannot determine assembler addressing style])])])
+])
+GMP_DEFINE_RAW(["define(<WANT_ADDRESSING>, <\`$gmp_cv_asm_m68k_addressing'>)"])
+])
+
+
+dnl GMP_ASM_M68K_BRANCHES
+dnl ---------------------
+dnl "bra" is the standard branch instruction. "jra" or "jbra" are
+dnl preferred where available, since on gas for instance they give a
+dnl displacement only as big as it needs to be, whereas "bra" is always
+dnl 16-bits. This applies to the conditional branches "bcc" etc too.
+dnl However "dbcc" etc on gas are already only as big as they need to be.
+
+AC_DEFUN([GMP_ASM_M68K_BRANCHES],
+[AC_REQUIRE([GMP_ASM_TEXT])
+AC_CACHE_CHECK([assembler shortest branches],
+ gmp_cv_asm_m68k_branches,
+[for i in jra jbra bra; do
+ GMP_TRY_ASSEMBLE(
+[ $gmp_cv_asm_text
+foo$gmp_cv_asm_label_suffix
+ $i foo],
+ [gmp_cv_asm_m68k_branches=$i
+ rm -f conftest*
+ break])
+done
+if test -z "$gmp_cv_asm_m68k_branches"; then
+ AC_MSG_ERROR([cannot determine assembler branching style])
+fi
+])
+GMP_DEFINE_RAW(["define(<WANT_BRANCHES>, <\`$gmp_cv_asm_m68k_branches'>)"])
+])
+
+
+dnl GMP_ASM_POWERPC_PIC_ALWAYS
+dnl --------------------------
+dnl Determine whether PIC is the default compiler output.
+dnl
+dnl SVR4 style "foo@ha" addressing is interpreted as non-PIC, and anything
+dnl else is assumed to require PIC always (Darwin or AIX). SVR4 is the
+dnl only non-PIC addressing syntax the asm files have at the moment anyway.
+dnl
+dnl Libtool does this by taking "*-*-aix* | *-*-darwin* | *-*-rhapsody*" to
+dnl mean PIC always, but it seems more reliable to grep the compiler
+dnl output.
+dnl
+dnl The next paragraph is untrue for Tiger. Was it ever true? For tiger,
+dnl "cc -fast" makes non-PIC the default (and the binaries do run).
+dnl On Darwin "cc -static" is non-PIC with syntax "ha16(_foo)", but that's
+dnl apparently only for use in the kernel, which we're not attempting to
+dnl target at the moment, so don't look for that.
+
+AC_DEFUN([GMP_ASM_POWERPC_PIC_ALWAYS],
+[AC_REQUIRE([AC_PROG_CC])
+AC_CACHE_CHECK([whether compiler output is PIC by default],
+ gmp_cv_asm_powerpc_pic,
+[gmp_cv_asm_powerpc_pic=yes
+cat >conftest.c <<EOF
+int foo;
+int *bar() { return &foo; }
+EOF
+echo "Test program:" >&AC_FD_CC
+cat conftest.c >&AC_FD_CC
+gmp_compile="$CC $CFLAGS $CPPFLAGS -S conftest.c >&AC_FD_CC"
+if AC_TRY_EVAL(gmp_compile); then
+ echo "Compiler output:" >&AC_FD_CC
+ cat conftest.s >&AC_FD_CC
+ if grep 'foo@ha' conftest.s >/dev/null 2>&AC_FD_CC; then
+ gmp_cv_asm_powerpc_pic=no
+ fi
+ if grep 'ha16(_foo)' conftest.s >/dev/null 2>&AC_FD_CC; then
+ gmp_cv_asm_powerpc_pic=no
+ fi
+fi
+rm -f conftest*
+])
+GMP_DEFINE_RAW(["define(<PIC_ALWAYS>,<$gmp_cv_asm_powerpc_pic>)"])
+])
+
+
+dnl GMP_ASM_POWERPC_R_REGISTERS
+dnl ---------------------------
+dnl Determine whether the assembler takes powerpc registers with an "r" as
+dnl in "r6", or as plain "6". The latter is standard, but NeXT, Rhapsody,
+dnl and MacOS-X require the "r" forms.
+dnl
+dnl See also mpn/powerpc32/powerpc-defs.m4 which uses the result of this
+dnl test.
+
+AC_DEFUN([GMP_ASM_POWERPC_R_REGISTERS],
+[AC_REQUIRE([GMP_ASM_TEXT])
+AC_CACHE_CHECK([if the assembler needs r on registers],
+ gmp_cv_asm_powerpc_r_registers,
+[GMP_TRY_ASSEMBLE(
+[ $gmp_cv_asm_text
+ mtctr 6],
+[gmp_cv_asm_powerpc_r_registers=no],
+[GMP_TRY_ASSEMBLE(
+[ $gmp_cv_asm_text
+ mtctr r6],
+[gmp_cv_asm_powerpc_r_registers=yes],
+[AC_MSG_ERROR([neither "mtctr 6" nor "mtctr r6" works])])])])
+
+GMP_DEFINE_RAW(["define(<WANT_R_REGISTERS>,<$gmp_cv_asm_powerpc_r_registers>)"])
+])
+
+
+dnl GMP_ASM_SPARC_REGISTER
+dnl ----------------------
+dnl Determine whether the assembler accepts the ".register" directive.
+dnl Old versions of solaris "as" don't.
+dnl
+dnl See also mpn/sparc32/sparc-defs.m4 which uses the result of this test.
+
+AC_DEFUN([GMP_ASM_SPARC_REGISTER],
+[AC_REQUIRE([GMP_ASM_TEXT])
+AC_CACHE_CHECK([if the assembler accepts ".register"],
+ gmp_cv_asm_sparc_register,
+[GMP_TRY_ASSEMBLE(
+[ $gmp_cv_asm_text
+ .register %g2,#scratch
+],
+[gmp_cv_asm_sparc_register=yes],
+[gmp_cv_asm_sparc_register=no])])
+
+GMP_DEFINE_RAW(["define(<HAVE_REGISTER>,<$gmp_cv_asm_sparc_register>)"])
+])
+
+
+dnl GMP_ASM_SPARC_GOTDATA
+dnl ----------------------
+dnl Determine whether the assembler accepts gotdata relocations.
+dnl
+dnl See also mpn/sparc32/sparc-defs.m4 which uses the result of this test.
+
+AC_DEFUN([GMP_ASM_SPARC_GOTDATA],
+[AC_REQUIRE([GMP_ASM_TEXT])
+AC_CACHE_CHECK([if the assembler accepts gotdata relocations],
+ gmp_cv_asm_sparc_gotdata,
+[GMP_TRY_ASSEMBLE(
+[ $gmp_cv_asm_text
+ .text
+ sethi %gdop_hix22(symbol), %g1
+ or %g1, %gdop_lox10(symbol), %g1
+],
+[gmp_cv_asm_sparc_gotdata=yes],
+[gmp_cv_asm_sparc_gotdata=no])])
+
+GMP_DEFINE_RAW(["define(<HAVE_GOTDATA>,<$gmp_cv_asm_sparc_gotdata>)"])
+])
+
+
+dnl GMP_ASM_SPARC_SHARED_THUNKS
+dnl ----------------------
+dnl Determine whether the assembler supports all of the features
+dnl necessary in order to emit shared PIC thunks on sparc.
+dnl
+dnl See also mpn/sparc32/sparc-defs.m4 which uses the result of this test.
+
+AC_DEFUN([GMP_ASM_SPARC_SHARED_THUNKS],
+[AC_REQUIRE([GMP_ASM_TEXT])
+AC_CACHE_CHECK([if the assembler can support shared PIC thunks],
+ gmp_cv_asm_sparc_shared_thunks,
+[GMP_TRY_ASSEMBLE(
+[ $gmp_cv_asm_text
+ .section .text.__sparc_get_pc_thunk.l7,"axG",@progbits,__sparc_get_pc_thunk.l7,comdat
+ .weak __sparc_get_pc_thunk.l7
+ .hidden __sparc_get_pc_thunk.l7
+ .type __sparc_get_pc_thunk.l7, #function
+__sparc_get_pc_thunk.l7:
+ jmp %o7+8
+ add %o7, %l7, %l7
+],
+[gmp_cv_asm_sparc_shared_thunks=yes],
+[gmp_cv_asm_sparc_shared_thunks=no])])
+
+GMP_DEFINE_RAW(["define(<HAVE_SHARED_THUNKS>,<$gmp_cv_asm_sparc_shared_thunks>)"])
+])
+
+
+dnl GMP_C_ATTRIBUTE_CONST
+dnl ---------------------
+
+AC_DEFUN([GMP_C_ATTRIBUTE_CONST],
+[AC_CACHE_CHECK([whether gcc __attribute__ ((const)) works],
+ gmp_cv_c_attribute_const,
+[AC_TRY_COMPILE([int foo (int x) __attribute__ ((const));], ,
+ gmp_cv_c_attribute_const=yes, gmp_cv_c_attribute_const=no)
+])
+if test $gmp_cv_c_attribute_const = yes; then
+ AC_DEFINE(HAVE_ATTRIBUTE_CONST, 1,
+ [Define to 1 if the compiler accepts gcc style __attribute__ ((const))])
+fi
+])
+
+
+dnl GMP_C_ATTRIBUTE_MALLOC
+dnl ----------------------
+dnl gcc 2.95.x accepts __attribute__ ((malloc)) but with a warning that
+dnl it's ignored. Pretend it doesn't exist in this case, to avoid that
+dnl warning.
+
+AC_DEFUN([GMP_C_ATTRIBUTE_MALLOC],
+[AC_CACHE_CHECK([whether gcc __attribute__ ((malloc)) works],
+ gmp_cv_c_attribute_malloc,
+[cat >conftest.c <<EOF
+void *foo (int x) __attribute__ ((malloc));
+EOF
+gmp_compile="$CC $CFLAGS $CPPFLAGS -c conftest.c >conftest.out 2>&1"
+if AC_TRY_EVAL(gmp_compile); then
+ if grep "attribute directive ignored" conftest.out >/dev/null; then
+ gmp_cv_c_attribute_malloc=no
+ else
+ gmp_cv_c_attribute_malloc=yes
+ fi
+else
+ gmp_cv_c_attribute_malloc=no
+fi
+cat conftest.out >&AC_FD_CC
+rm -f conftest*
+])
+if test $gmp_cv_c_attribute_malloc = yes; then
+ AC_DEFINE(HAVE_ATTRIBUTE_MALLOC, 1,
+ [Define to 1 if the compiler accepts gcc style __attribute__ ((malloc))])
+fi
+])
+
+
+dnl GMP_C_ATTRIBUTE_MODE
+dnl --------------------
+dnl Introduced in gcc 2.2, but perhaps not in all Apple derived versions.
+
+AC_DEFUN([GMP_C_ATTRIBUTE_MODE],
+[AC_CACHE_CHECK([whether gcc __attribute__ ((mode (XX))) works],
+ gmp_cv_c_attribute_mode,
+[AC_TRY_COMPILE([typedef int SItype __attribute__ ((mode (SI)));], ,
+ gmp_cv_c_attribute_mode=yes, gmp_cv_c_attribute_mode=no)
+])
+if test $gmp_cv_c_attribute_mode = yes; then
+ AC_DEFINE(HAVE_ATTRIBUTE_MODE, 1,
+ [Define to 1 if the compiler accepts gcc style __attribute__ ((mode (XX)))])
+fi
+])
+
+
+dnl GMP_C_ATTRIBUTE_NORETURN
+dnl ------------------------
+
+AC_DEFUN([GMP_C_ATTRIBUTE_NORETURN],
+[AC_CACHE_CHECK([whether gcc __attribute__ ((noreturn)) works],
+ gmp_cv_c_attribute_noreturn,
+[AC_TRY_COMPILE([void foo (int x) __attribute__ ((noreturn));], ,
+ gmp_cv_c_attribute_noreturn=yes, gmp_cv_c_attribute_noreturn=no)
+])
+if test $gmp_cv_c_attribute_noreturn = yes; then
+ AC_DEFINE(HAVE_ATTRIBUTE_NORETURN, 1,
+ [Define to 1 if the compiler accepts gcc style __attribute__ ((noreturn))])
+fi
+])
+
+
+dnl GMP_C_DOUBLE_FORMAT
+dnl -------------------
+dnl Determine the floating point format.
+dnl
+dnl The object file is grepped, in order to work when cross compiling. A
+dnl start and end sequence is included to avoid false matches, and allowance
+dnl is made for the desired data crossing an "od -b" line boundary. The test
+dnl number is a small integer so it should appear exactly, no rounding or
+dnl truncation etc.
+dnl
+dnl "od -b", incidentally, is supported even by Unix V7, and the awk script
+dnl used doesn't have functions or anything, so even an "old" awk should
+dnl suffice.
+dnl
+dnl The C code here declares the variable foo as extern; without that, some
+dnl C++ compilers will not put foo in the object file.
+
+AC_DEFUN([GMP_C_DOUBLE_FORMAT],
+[AC_REQUIRE([AC_PROG_CC])
+AC_REQUIRE([AC_PROG_AWK])
+AC_CACHE_CHECK([format of `double' floating point],
+ gmp_cv_c_double_format,
+[gmp_cv_c_double_format=unknown
+cat >conftest.c <<\EOF
+[struct foo {
+ char before[8];
+ double x;
+ char after[8];
+};
+extern struct foo foo;
+struct foo foo = {
+ { '\001', '\043', '\105', '\147', '\211', '\253', '\315', '\357' },
+ -123456789.0,
+ { '\376', '\334', '\272', '\230', '\166', '\124', '\062', '\020' },
+};]
+EOF
+gmp_compile="$CC $CFLAGS $CPPFLAGS -c conftest.c >&AC_FD_CC 2>&1"
+if AC_TRY_EVAL(gmp_compile); then
+cat >conftest.awk <<\EOF
+[
+BEGIN {
+ found = 0
+}
+
+{
+ for (f = 2; f <= NF; f++)
+ {
+ for (i = 0; i < 23; i++)
+ got[i] = got[i+1];
+ got[23] = $f;
+
+ # match the special begin and end sequences
+ if (got[0] != "001") continue
+ if (got[1] != "043") continue
+ if (got[2] != "105") continue
+ if (got[3] != "147") continue
+ if (got[4] != "211") continue
+ if (got[5] != "253") continue
+ if (got[6] != "315") continue
+ if (got[7] != "357") continue
+ if (got[16] != "376") continue
+ if (got[17] != "334") continue
+ if (got[18] != "272") continue
+ if (got[19] != "230") continue
+ if (got[20] != "166") continue
+ if (got[21] != "124") continue
+ if (got[22] != "062") continue
+ if (got[23] != "020") continue
+
+ saw = " (" got[8] " " got[9] " " got[10] " " got[11] " " got[12] " " got[13] " " got[14] " " got[15] ")"
+
+ if (got[8] == "000" && \
+ got[9] == "000" && \
+ got[10] == "000" && \
+ got[11] == "124" && \
+ got[12] == "064" && \
+ got[13] == "157" && \
+ got[14] == "235" && \
+ got[15] == "301")
+ {
+ print "IEEE little endian"
+ found = 1
+ exit
+ }
+
+ # Little endian with the two 4-byte halves swapped, as used by ARM
+ # when the chip is in little endian mode.
+ #
+ if (got[8] == "064" && \
+ got[9] == "157" && \
+ got[10] == "235" && \
+ got[11] == "301" && \
+ got[12] == "000" && \
+ got[13] == "000" && \
+ got[14] == "000" && \
+ got[15] == "124")
+ {
+ print "IEEE little endian, swapped halves"
+ found = 1
+ exit
+ }
+
+ # gcc 2.95.4 on one GNU/Linux ARM system was seen generating 000 in
+ # the last byte, whereas 124 is correct. Not sure where the bug
+ # actually lies, but a running program didn't seem to get a full
+ # mantissa worth of working bits.
+ #
+ # We match this case explicitly so we can give a nice result message,
+ # but we deliberately exclude it from the normal IEEE double setups
+ # since it's too broken.
+ #
+ if (got[8] == "064" && \
+ got[9] == "157" && \
+ got[10] == "235" && \
+ got[11] == "301" && \
+ got[12] == "000" && \
+ got[13] == "000" && \
+ got[14] == "000" && \
+ got[15] == "000")
+ {
+ print "bad ARM software floats"
+ found = 1
+ exit
+ }
+
+ if (got[8] == "301" && \
+ got[9] == "235" && \
+ got[10] == "157" && \
+ got[11] == "064" && \
+ got[12] == "124" && \
+ got[13] == "000" && \
+ got[14] == "000" && \
+ got[15] == "000")
+ {
+ print "IEEE big endian"
+ found = 1
+ exit
+ }
+
+ if (got[8] == "353" && \
+ got[9] == "315" && \
+ got[10] == "242" && \
+ got[11] == "171" && \
+ got[12] == "000" && \
+ got[13] == "240" && \
+ got[14] == "000" && \
+ got[15] == "000")
+ {
+ print "VAX D"
+ found = 1
+ exit
+ }
+
+ if (got[8] == "275" && \
+ got[9] == "301" && \
+ got[10] == "064" && \
+ got[11] == "157" && \
+ got[12] == "000" && \
+ got[13] == "124" && \
+ got[14] == "000" && \
+ got[15] == "000")
+ {
+ print "VAX G"
+ found = 1
+ exit
+ }
+
+ if (got[8] == "300" && \
+ got[9] == "033" && \
+ got[10] == "353" && \
+ got[11] == "171" && \
+ got[12] == "242" && \
+ got[13] == "240" && \
+ got[14] == "000" && \
+ got[15] == "000")
+ {
+ print "Cray CFP"
+ found = 1
+ exit
+ }
+ }
+}
+
+END {
+ if (! found)
+ print "unknown", saw
+}
+]
+EOF
+ gmp_cv_c_double_format=`od -b conftest.$OBJEXT | $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
+ ;;
+ esac
+else
+ AC_MSG_WARN([oops, cannot compile test program])
+fi
+rm -f conftest*
+])
+
+AH_VERBATIM([HAVE_DOUBLE],
+[/* Define one of the following to 1 for the format of a `double'.
+ If your format is not among these choices, or you don't know what it is,
+ then leave all undefined.
+ IEEE_LITTLE_SWAPPED means little endian, but with the two 4-byte halves
+ swapped, as used by ARM CPUs in little endian mode. */
+#undef HAVE_DOUBLE_IEEE_BIG_ENDIAN
+#undef HAVE_DOUBLE_IEEE_LITTLE_ENDIAN
+#undef HAVE_DOUBLE_IEEE_LITTLE_SWAPPED
+#undef HAVE_DOUBLE_VAX_D
+#undef HAVE_DOUBLE_VAX_G
+#undef HAVE_DOUBLE_CRAY_CFP])
+
+case $gmp_cv_c_double_format in
+ "IEEE big endian")
+ AC_DEFINE(HAVE_DOUBLE_IEEE_BIG_ENDIAN, 1)
+ GMP_DEFINE_RAW("define_not_for_expansion(\`HAVE_DOUBLE_IEEE_BIG_ENDIAN')", POST)
+ ;;
+ "IEEE little endian")
+ AC_DEFINE(HAVE_DOUBLE_IEEE_LITTLE_ENDIAN, 1)
+ GMP_DEFINE_RAW("define_not_for_expansion(\`HAVE_DOUBLE_IEEE_LITTLE_ENDIAN')", POST)
+ ;;
+ "IEEE little endian, swapped halves")
+ AC_DEFINE(HAVE_DOUBLE_IEEE_LITTLE_SWAPPED, 1) ;;
+ "VAX D")
+ AC_DEFINE(HAVE_DOUBLE_VAX_D, 1) ;;
+ "VAX G")
+ AC_DEFINE(HAVE_DOUBLE_VAX_G, 1) ;;
+ "Cray CFP")
+ AC_DEFINE(HAVE_DOUBLE_CRAY_CFP, 1) ;;
+ "bad ARM software floats")
+ ;;
+ unknown*)
+ AC_MSG_WARN([Could not determine float format.])
+ AC_MSG_WARN([Conversions to and from "double" may be slow.])
+ ;;
+ *)
+ AC_MSG_WARN([oops, unrecognised float format: $gmp_cv_c_double_format])
+ ;;
+esac
+])
+
+
+dnl GMP_C_STDARG
+dnl ------------
+dnl Test whether to use <stdarg.h>.
+dnl
+dnl Notice the AC_DEFINE here is HAVE_STDARG to avoid clashing with
+dnl HAVE_STDARG_H which could arise from AC_CHECK_HEADERS.
+dnl
+dnl This test might be slight overkill, after all there's really only going
+dnl to be ANSI or K&R and the two can be differentiated by AC_PROG_CC_STDC
+dnl or very likely by the setups for _PROTO in gmp.h. On the other hand
+dnl this test is nice and direct, being what we're going to actually use.
+
+dnl AC_DEFUN([GMP_C_STDARG],
+dnl [AC_CACHE_CHECK([whether <stdarg.h> exists and works],
+dnl gmp_cv_c_stdarg,
+dnl [AC_TRY_COMPILE(
+dnl [#include <stdarg.h>
+dnl int foo (int x, ...)
+dnl {
+dnl va_list ap;
+dnl int y;
+dnl va_start (ap, x);
+dnl y = va_arg (ap, int);
+dnl va_end (ap);
+dnl return y;
+dnl }],,
+dnl gmp_cv_c_stdarg=yes, gmp_cv_c_stdarg=no)
+dnl ])
+dnl if test $gmp_cv_c_stdarg = yes; then
+dnl AC_DEFINE(HAVE_STDARG, 1, [Define to 1 if <stdarg.h> exists and works])
+dnl fi
+dnl ])
+
+
+dnl GMP_FUNC_ALLOCA
+dnl ---------------
+dnl Determine whether "alloca" is available. This is AC_FUNC_ALLOCA from
+dnl autoconf, but changed so it doesn't use alloca.c if alloca() isn't
+dnl available, and also to use gmp-impl.h for the conditionals detecting
+dnl compiler builtin alloca's.
+
+AC_DEFUN([GMP_FUNC_ALLOCA],
+[AC_REQUIRE([GMP_HEADER_ALLOCA])
+AC_CACHE_CHECK([for alloca (via gmp-impl.h)],
+ gmp_cv_func_alloca,
+[AC_TRY_LINK(
+GMP_INCLUDE_GMP_H
+[#include "$srcdir/gmp-impl.h"
+],
+ [char *p = (char *) alloca (1);],
+ gmp_cv_func_alloca=yes,
+ gmp_cv_func_alloca=no)])
+if test $gmp_cv_func_alloca = yes; then
+ AC_DEFINE(HAVE_ALLOCA, 1, [Define to 1 if alloca() works (via gmp-impl.h).])
+fi
+])
+
+AC_DEFUN([GMP_HEADER_ALLOCA],
+[# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
+# for constant arguments. Useless!
+AC_CACHE_CHECK([for working alloca.h],
+ gmp_cv_header_alloca,
+[AC_TRY_LINK([#include <alloca.h>],
+ [char *p = (char *) alloca (2 * sizeof (int));],
+ gmp_cv_header_alloca=yes,
+ gmp_cv_header_alloca=no)])
+if test $gmp_cv_header_alloca = yes; then
+ AC_DEFINE(HAVE_ALLOCA_H, 1,
+ [Define to 1 if you have <alloca.h> and it should be used (not on Ultrix).])
+fi
+])
+
+
+dnl GMP_OPTION_ALLOCA
+dnl -----------------
+dnl Decide what to do about --enable-alloca from the user.
+dnl This is a macro so it can require GMP_FUNC_ALLOCA.
+
+AC_DEFUN([GMP_OPTION_ALLOCA],
+[AC_REQUIRE([GMP_FUNC_ALLOCA])
+AC_CACHE_CHECK([how to allocate temporary memory],
+ gmp_cv_option_alloca,
+[case $enable_alloca in
+ yes)
+ gmp_cv_option_alloca=alloca
+ ;;
+ no)
+ gmp_cv_option_alloca=malloc-reentrant
+ ;;
+ reentrant | notreentrant)
+ case $gmp_cv_func_alloca in
+ yes) gmp_cv_option_alloca=alloca ;;
+ *) gmp_cv_option_alloca=malloc-$enable_alloca ;;
+ esac
+ ;;
+ *)
+ gmp_cv_option_alloca=$enable_alloca
+ ;;
+esac
+])
+
+AH_VERBATIM([WANT_TMP],
+[/* Define one of these to 1 for the desired temporary memory allocation
+ method, per --enable-alloca. */
+#undef WANT_TMP_ALLOCA
+#undef WANT_TMP_REENTRANT
+#undef WANT_TMP_NOTREENTRANT
+#undef WANT_TMP_DEBUG])
+
+case $gmp_cv_option_alloca in
+ alloca)
+ if test $gmp_cv_func_alloca = no; then
+ AC_MSG_ERROR([--enable-alloca=alloca specified, but alloca not available])
+ fi
+ AC_DEFINE(WANT_TMP_ALLOCA)
+ TAL_OBJECT=tal-reent$U.lo
+ ;;
+ malloc-reentrant)
+ AC_DEFINE(WANT_TMP_REENTRANT)
+ TAL_OBJECT=tal-reent$U.lo
+ ;;
+ malloc-notreentrant)
+ AC_DEFINE(WANT_TMP_NOTREENTRANT)
+ TAL_OBJECT=tal-notreent$U.lo
+ ;;
+ debug)
+ AC_DEFINE(WANT_TMP_DEBUG)
+ TAL_OBJECT=tal-debug$U.lo
+ ;;
+ *)
+ # checks at the start of configure.in should protect us
+ AC_MSG_ERROR([unrecognised --enable-alloca=$gmp_cv_option_alloca])
+ ;;
+esac
+AC_SUBST(TAL_OBJECT)
+])
+
+
+dnl GMP_FUNC_SSCANF_WRITABLE_INPUT
+dnl ------------------------------
+dnl Determine whether sscanf requires a writable input string.
+dnl
+dnl It might be nicer to run a program to determine this when doing a
+dnl native build, but the systems afflicted are few and far between these
+dnl days, so it seems good enough just to list them.
+
+AC_DEFUN([GMP_FUNC_SSCANF_WRITABLE_INPUT],
+[AC_CACHE_CHECK([whether sscanf needs writable input],
+ gmp_cv_func_sscanf_writable_input,
+[case $host in
+ *-*-hpux9 | *-*-hpux9.*)
+ gmp_cv_func_sscanf_writable_input=yes ;;
+ *) gmp_cv_func_sscanf_writable_input=no ;;
+esac
+])
+case $gmp_cv_func_sscanf_writable_input in
+ yes) AC_DEFINE(SSCANF_WRITABLE_INPUT, 1,
+ [Define to 1 if sscanf requires writable inputs]) ;;
+ no) ;;
+ *) AC_MSG_ERROR([unrecognised \$gmp_cv_func_sscanf_writable_input]) ;;
+esac
+])
+
+
+dnl GMP_FUNC_VSNPRINTF
+dnl ------------------
+dnl Check whether vsnprintf exists, and works properly.
+dnl
+dnl Systems without vsnprintf include mingw32, OSF 4.
+dnl
+dnl Sparc Solaris 2.7 in 64-bit mode doesn't always truncate, making
+dnl vsnprintf like vsprintf, and hence completely useless. On one system a
+dnl literal string is enough to provoke the problem, on another a "%n" was
+dnl needed. There seems to be something weird going on with the optimizer
+dnl or something, since on the first system adding a second check with
+dnl "%n", or even just an initialized local variable, makes it work. In
+dnl any case, without bothering to get to the bottom of this, the two
+dnl program runs in the code below end up successfully detecting the
+dnl problem.
+dnl
+dnl glibc 2.0.x returns either -1 or bufsize-1 for an overflow (both seen,
+dnl not sure which 2.0.x does which), but still puts the correct null
+dnl terminated result into the buffer.
+
+AC_DEFUN([GMP_FUNC_VSNPRINTF],
+[AC_CHECK_FUNC(vsnprintf,
+ [gmp_vsnprintf_exists=yes],
+ [gmp_vsnprintf_exists=no])
+if test "$gmp_vsnprintf_exists" = no; then
+ gmp_cv_func_vsnprintf=no
+else
+ AC_CACHE_CHECK([whether vsnprintf works],
+ gmp_cv_func_vsnprintf,
+ [gmp_cv_func_vsnprintf=yes
+ for i in 'return check ("hello world");' 'int n; return check ("%nhello world", &n);'; do
+ AC_TRY_RUN([
+#include <string.h> /* for strcmp */
+#include <stdio.h> /* for vsnprintf */
+
+#include <stdarg.h>
+
+int
+check (const char *fmt, ...)
+{
+ static char buf[128];
+ va_list ap;
+ int ret;
+
+ va_start (ap, fmt);
+
+ ret = vsnprintf (buf, 4, fmt, ap);
+
+ if (strcmp (buf, "hel") != 0)
+ return 1;
+
+ /* allowed return values */
+ if (ret != -1 && ret != 3 && ret != 11)
+ return 2;
+
+ return 0;
+}
+
+int
+main ()
+{
+$i
+}
+],
+ [:],
+ [gmp_cv_func_vsnprintf=no; break],
+ [gmp_cv_func_vsnprintf=probably; break])
+ done
+ ])
+ if test "$gmp_cv_func_vsnprintf" = probably; then
+ AC_MSG_WARN([cannot check for properly working vsnprintf when cross compiling, will assume it's ok])
+ fi
+ if test "$gmp_cv_func_vsnprintf" != no; then
+ AC_DEFINE(HAVE_VSNPRINTF,1,
+ [Define to 1 if you have the `vsnprintf' function and it works properly.])
+ fi
+fi
+])
+
+
+dnl GMP_H_EXTERN_INLINE
+dnl -------------------
+dnl If the compiler has an "inline" of some sort, check whether the
+dnl #ifdef's in gmp.h recognise it.
+
+AC_DEFUN([GMP_H_EXTERN_INLINE],
+[AC_REQUIRE([AC_C_INLINE])
+case $ac_cv_c_inline in
+no) ;;
+*)
+ AC_TRY_COMPILE(
+[#define __GMP_WITHIN_CONFIGURE_INLINE 1
+]GMP_INCLUDE_GMP_H[
+#ifndef __GMP_EXTERN_INLINE
+die die die
+#endif
+],,,
+ [case $ac_cv_c_inline in
+ yes) tmp_inline=inline ;;
+ *) tmp_inline=$ac_cv_c_inline ;;
+ esac
+ AC_MSG_WARN([gmp.h doesnt recognise compiler "$tmp_inline", inlines will be unavailable])])
+ ;;
+esac
+])
+
+
+dnl GMP_H_HAVE_FILE
+dnl ---------------
+dnl Check whether the #ifdef's in gmp.h recognise when stdio.h has been
+dnl included to get FILE.
+
+AC_DEFUN([GMP_H_HAVE_FILE],
+[AC_TRY_COMPILE(
+[#include <stdio.h>]
+GMP_INCLUDE_GMP_H
+[#if ! _GMP_H_HAVE_FILE
+die die die
+#endif
+],,,
+ [AC_MSG_WARN([gmp.h doesnt recognise <stdio.h>, FILE prototypes will be unavailable])])
+])
+
+
+dnl GMP_PROG_CC_FOR_BUILD
+dnl ---------------------
+dnl Establish CC_FOR_BUILD, a C compiler for the build system.
+dnl
+dnl If CC_FOR_BUILD is set then it's expected to work, likewise the old
+dnl style HOST_CC, otherwise some likely candidates are tried, the same as
+dnl configfsf.guess.
+
+AC_DEFUN([GMP_PROG_CC_FOR_BUILD],
+[AC_REQUIRE([AC_PROG_CC])
+if test -n "$CC_FOR_BUILD"; then
+ GMP_PROG_CC_FOR_BUILD_WORKS($CC_FOR_BUILD,,
+ [AC_MSG_ERROR([Specified CC_FOR_BUILD doesn't seem to work])])
+elif test -n "$HOST_CC"; then
+ GMP_PROG_CC_FOR_BUILD_WORKS($HOST_CC,
+ [CC_FOR_BUILD=$HOST_CC],
+ [AC_MSG_ERROR([Specified HOST_CC doesn't seem to work])])
+else
+ for i in "$CC" "$CC $CFLAGS $CPPFLAGS" cc gcc c89 c99; do
+ GMP_PROG_CC_FOR_BUILD_WORKS($i,
+ [CC_FOR_BUILD=$i
+ break])
+ done
+ if test -z "$CC_FOR_BUILD"; then
+ AC_MSG_ERROR([Cannot find a build system compiler])
+ fi
+fi
+
+AC_ARG_VAR(CC_FOR_BUILD,[build system C compiler])
+AC_SUBST(CC_FOR_BUILD)
+])
+
+
+dnl GMP_PROG_CC_FOR_BUILD_WORKS(cc/cflags[,[action-if-good][,action-if-bad]])
+dnl -------------------------------------------------------------------------
+dnl See if the given cc/cflags works on the build system.
+dnl
+dnl It seems easiest to just use the default compiler output, rather than
+dnl figuring out the .exe or whatever at this stage.
+
+AC_DEFUN([GMP_PROG_CC_FOR_BUILD_WORKS],
+[AC_MSG_CHECKING([build system compiler $1])
+# remove anything that might look like compiler output to our "||" expression
+rm -f conftest* a.out b.out a.exe a_out.exe
+cat >conftest.c <<EOF
+int
+main ()
+{
+ exit(0);
+}
+EOF
+gmp_compile="$1 conftest.c"
+cc_for_build_works=no
+if AC_TRY_EVAL(gmp_compile); then
+ if (./a.out || ./b.out || ./a.exe || ./a_out.exe || ./conftest) >&AC_FD_CC 2>&1; then
+ cc_for_build_works=yes
+ fi
+fi
+rm -f conftest* a.out b.out a.exe a_out.exe
+AC_MSG_RESULT($cc_for_build_works)
+if test "$cc_for_build_works" = yes; then
+ ifelse([$2],,:,[$2])
+else
+ ifelse([$3],,:,[$3])
+fi
+])
+
+
+dnl GMP_PROG_CPP_FOR_BUILD
+dnl ---------------------
+dnl Establish CPP_FOR_BUILD, the build system C preprocessor.
+dnl The choices tried here are the same as AC_PROG_CPP, but with
+dnl CC_FOR_BUILD.
+
+AC_DEFUN([GMP_PROG_CPP_FOR_BUILD],
+[AC_REQUIRE([GMP_PROG_CC_FOR_BUILD])
+AC_MSG_CHECKING([for build system preprocessor])
+if test -z "$CPP_FOR_BUILD"; then
+ AC_CACHE_VAL(gmp_cv_prog_cpp_for_build,
+ [cat >conftest.c <<EOF
+#define FOO BAR
+EOF
+ for i in "$CC_FOR_BUILD -E" "$CC_FOR_BUILD -E -traditional-cpp" "/lib/cpp"; do
+ gmp_compile="$i conftest.c"
+ if AC_TRY_EVAL(gmp_compile) >&AC_FD_CC 2>&1; then
+ gmp_cv_prog_cpp_for_build=$i
+ break
+ fi
+ done
+ rm -f conftest* a.out b.out a.exe a_out.exe
+ if test -z "$gmp_cv_prog_cpp_for_build"; then
+ AC_MSG_ERROR([Cannot find build system C preprocessor.])
+ fi
+ ])
+ CPP_FOR_BUILD=$gmp_cv_prog_cpp_for_build
+fi
+AC_MSG_RESULT([$CPP_FOR_BUILD])
+
+AC_ARG_VAR(CPP_FOR_BUILD,[build system C preprocessor])
+AC_SUBST(CPP_FOR_BUILD)
+])
+
+
+dnl GMP_PROG_EXEEXT_FOR_BUILD
+dnl -------------------------
+dnl Determine EXEEXT_FOR_BUILD, the build system executable suffix.
+dnl
+dnl The idea is to find what "-o conftest$foo" will make it possible to run
+dnl the program with ./conftest. On Unix-like systems this is of course
+dnl nothing, for DOS it's ".exe", or for a strange RISC OS foreign file
+dnl system cross compile it can be ",ff8" apparently. Not sure if the
+dnl latter actually applies to a build-system executable, maybe it doesn't,
+dnl but it won't hurt to try.
+
+AC_DEFUN([GMP_PROG_EXEEXT_FOR_BUILD],
+[AC_REQUIRE([GMP_PROG_CC_FOR_BUILD])
+AC_CACHE_CHECK([for build system executable suffix],
+ gmp_cv_prog_exeext_for_build,
+[cat >conftest.c <<EOF
+int
+main ()
+{
+ exit (0);
+}
+EOF
+for i in .exe ,ff8 ""; do
+ gmp_compile="$CC_FOR_BUILD conftest.c -o conftest$i"
+ if AC_TRY_EVAL(gmp_compile); then
+ if (./conftest) 2>&AC_FD_CC; then
+ gmp_cv_prog_exeext_for_build=$i
+ break
+ fi
+ fi
+done
+rm -f conftest*
+if test "${gmp_cv_prog_exeext_for_build+set}" != set; then
+ AC_MSG_ERROR([Cannot determine executable suffix])
+fi
+])
+AC_SUBST(EXEEXT_FOR_BUILD,$gmp_cv_prog_exeext_for_build)
+])
+
+
+dnl GMP_C_FOR_BUILD_ANSI
+dnl --------------------
+dnl Determine whether CC_FOR_BUILD is ANSI, and establish U_FOR_BUILD
+dnl accordingly.
+dnl
+dnl FIXME: Use AC_PROG_CC sets ac_cv_prog_cc_c89 which could be used instead
+
+AC_DEFUN([GMP_C_FOR_BUILD_ANSI],
+[AC_REQUIRE([GMP_PROG_CC_FOR_BUILD])
+AC_CACHE_CHECK([whether build system compiler is ANSI],
+ gmp_cv_c_for_build_ansi,
+[cat >conftest.c <<EOF
+int
+main (int argc, char **argv)
+{
+ exit(0);
+}
+EOF
+gmp_compile="$CC_FOR_BUILD conftest.c"
+if AC_TRY_EVAL(gmp_compile); then
+ gmp_cv_c_for_build_ansi=yes
+else
+ gmp_cv_c_for_build_ansi=no
+fi
+rm -f conftest* a.out b.out a.exe a_out.exe
+])
+if test "$gmp_cv_c_for_build_ansi" = yes; then
+ U_FOR_BUILD=
+else
+ AC_SUBST(U_FOR_BUILD,_)
+fi
+])
+
+
+dnl GMP_CHECK_LIBM_FOR_BUILD
+dnl ------------------------
+dnl Establish LIBM_FOR_BUILD as -lm, if that seems to work.
+dnl
+dnl Libtool AC_CHECK_LIBM also uses -lmw on *-ncr-sysv4.3*, if it works.
+dnl Don't know what that does, lets assume it's not needed just for log().
+
+AC_DEFUN([GMP_CHECK_LIBM_FOR_BUILD],
+[AC_REQUIRE([GMP_PROG_CC_FOR_BUILD])
+AC_CACHE_CHECK([for build system compiler math library],
+ gmp_cv_check_libm_for_build,
+[cat >conftest.c <<EOF
+int
+main ()
+{
+ exit(0);
+}
+double d;
+double
+foo ()
+{
+ return log (d);
+}
+EOF
+gmp_compile="$CC_FOR_BUILD conftest.c -lm"
+if AC_TRY_EVAL(gmp_compile); then
+ gmp_cv_check_libm_for_build=-lm
+else
+ gmp_cv_check_libm_for_build=no
+fi
+rm -f conftest* a.out b.out a.exe a_out.exe
+])
+case $gmp_cv_check_libm_for_build in
+ yes) AC_SUBST(LIBM_FOR_BUILD,-lm) ;;
+ no) LIBM_FOR_BUILD= ;;
+ *) LIBM_FOR_BUILD=$gmp_cv_check_libm_for_build ;;
+esac
+])
diff --git a/Build/source/libs/gmp/gmp-6.0.0/assert.c b/Build/source/libs/gmp/gmp-6.0.0/assert.c
new file mode 100644
index 00000000000..2e85e6bf639
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/assert.c
@@ -0,0 +1,59 @@
+/* GMP assertion failure handler.
+
+ 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 2000, 2001 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 <stdlib.h>
+#include "gmp.h"
+#include "gmp-impl.h"
+
+
+void
+__gmp_assert_header (const char *filename, int linenum)
+{
+ if (filename != NULL && filename[0] != '\0')
+ {
+ fprintf (stderr, "%s:", filename);
+ if (linenum != -1)
+ fprintf (stderr, "%d: ", linenum);
+ }
+}
+
+void
+__gmp_assert_fail (const char *filename, int linenum,
+ const char *expr)
+{
+ __gmp_assert_header (filename, linenum);
+ fprintf (stderr, "GNU MP assertion failed: %s\n", expr);
+ abort();
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/bootstrap.c b/Build/source/libs/gmp/gmp-6.0.0/bootstrap.c
new file mode 100644
index 00000000000..bff960ed83a
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/bootstrap.c
@@ -0,0 +1,146 @@
+/* Functions needed for bootstrapping the gmp build, based on mini-gmp.
+
+Copyright 2001, 2002, 2004, 2011, 2012 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 "mini-gmp/mini-gmp.c"
+
+#define MIN(l,o) ((l) < (o) ? (l) : (o))
+#define PTR(x) ((x)->_mp_d)
+#define SIZ(x) ((x)->_mp_size)
+
+#define xmalloc gmp_default_alloc
+
+int
+isprime (unsigned long int t)
+{
+ unsigned long int q, r, d;
+
+ if (t < 32)
+ return (0xa08a28acUL >> t) & 1;
+ if ((t & 1) == 0)
+ return 0;
+
+ if (t % 3 == 0)
+ return 0;
+ if (t % 5 == 0)
+ return 0;
+ if (t % 7 == 0)
+ return 0;
+
+ for (d = 11;;)
+ {
+ q = t / d;
+ r = t - q * d;
+ if (q < d)
+ return 1;
+ if (r == 0)
+ break;
+ d += 2;
+ q = t / d;
+ r = t - q * d;
+ if (q < d)
+ return 1;
+ if (r == 0)
+ break;
+ d += 4;
+ }
+ return 0;
+}
+
+int
+log2_ceil (int n)
+{
+ int e;
+ assert (n >= 1);
+ for (e = 0; ; e++)
+ if ((1 << e) >= n)
+ break;
+ return e;
+}
+
+/* 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_t t;
+ int norm;
+ assert (SIZ(d) > 0);
+
+ 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_tdiv_q (inv, t, d);
+ mpz_set_ui (t, 1L);
+ mpz_mul_2exp (t, t, numb_bits);
+ mpz_sub (inv, inv, t);
+
+ mpz_clear (t);
+}
+
+/* Calculate r satisfying r*d == 1 mod 2^n. */
+void
+mpz_invert_2exp (mpz_t r, mpz_t a, unsigned long n)
+{
+ unsigned long i;
+ mpz_t inv, prod;
+
+ assert (mpz_odd_p (a));
+
+ mpz_init_set_ui (inv, 1L);
+ mpz_init (prod);
+
+ for (i = 1; i < n; i++)
+ {
+ mpz_mul (prod, inv, a);
+ if (mpz_tstbit (prod, i) != 0)
+ mpz_setbit (inv, i);
+ }
+
+ mpz_mul (prod, inv, a);
+ mpz_tdiv_r_2exp (prod, prod, n);
+ assert (mpz_cmp_ui (prod, 1L) == 0);
+
+ mpz_set (r, inv);
+
+ mpz_clear (inv);
+ mpz_clear (prod);
+}
+
+/* Calculate inv satisfying r*a == 1 mod 2^n. */
+void
+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);
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/compat.c b/Build/source/libs/gmp/gmp-6.0.0/compat.c
new file mode 100644
index 00000000000..b896f8489f0
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/compat.c
@@ -0,0 +1,60 @@
+/* Old function entrypoints retained for binary compatibility.
+
+Copyright 2000, 2001 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.h"
+#include "gmp-impl.h"
+
+
+/* mpn_divexact_by3 was a function in gmp 3.0.1, but as of gmp 3.1 it's a
+ macro calling mpn_divexact_by3c. */
+mp_limb_t
+__MPN (divexact_by3) (mp_ptr dst, mp_srcptr src, mp_size_t size)
+{
+ return mpn_divexact_by3 (dst, src, size);
+}
+
+
+/* mpn_divmod_1 was a function in gmp 3.0.1 and earlier, but marked obsolete
+ in both gmp 2 and 3. As of gmp 3.1 it's a macro calling mpn_divrem_1. */
+mp_limb_t
+__MPN (divmod_1) (mp_ptr dst, mp_srcptr src, mp_size_t size, mp_limb_t divisor)
+{
+ return mpn_divmod_1 (dst, src, size, divisor);
+}
+
+
+/* mpz_legendre was a separate function in gmp 3.1.1 and earlier, but as of
+ 4.0 it's a #define alias for mpz_jacobi. */
+int
+__gmpz_legendre (mpz_srcptr a, mpz_srcptr b)
+{
+ return mpz_jacobi (a, b);
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/config.in b/Build/source/libs/gmp/gmp-6.0.0/config.in
new file mode 100644
index 00000000000..e94acd7c03a
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/config.in
@@ -0,0 +1,640 @@
+/* config.in. Generated from configure.ac by autoheader. */
+
+/*
+
+Copyright 1996-2014 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 if building universal (internal helper macro) */
+#undef AC_APPLE_UNIVERSAL_BUILD
+
+/* The gmp-mparam.h file (a string) the tune program should suggest updating.
+ */
+#undef GMP_MPARAM_H_SUGGEST
+
+/* Define to 1 if you have the `alarm' function. */
+#undef HAVE_ALARM
+
+/* Define to 1 if alloca() works (via gmp-impl.h). */
+#undef HAVE_ALLOCA
+
+/* Define to 1 if you have <alloca.h> and it should be used (not on Ultrix).
+ */
+#undef HAVE_ALLOCA_H
+
+/* Define to 1 if the compiler accepts gcc style __attribute__ ((const)) */
+#undef HAVE_ATTRIBUTE_CONST
+
+/* Define to 1 if the compiler accepts gcc style __attribute__ ((malloc)) */
+#undef HAVE_ATTRIBUTE_MALLOC
+
+/* Define to 1 if the compiler accepts gcc style __attribute__ ((mode (XX)))
+ */
+#undef HAVE_ATTRIBUTE_MODE
+
+/* Define to 1 if the compiler accepts gcc style __attribute__ ((noreturn)) */
+#undef HAVE_ATTRIBUTE_NORETURN
+
+/* Define to 1 if you have the `attr_get' function. */
+#undef HAVE_ATTR_GET
+
+/* Define to 1 if tests/libtests has calling conventions checking for the CPU
+ */
+#undef HAVE_CALLING_CONVENTIONS
+
+/* Define to 1 if you have the `clock' function. */
+#undef HAVE_CLOCK
+
+/* Define to 1 if you have the `clock_gettime' function */
+#undef HAVE_CLOCK_GETTIME
+
+/* Define to 1 if you have the `cputime' function. */
+#undef HAVE_CPUTIME
+
+/* Define to 1 if you have the declaration of `fgetc', and to 0 if you don't.
+ */
+#undef HAVE_DECL_FGETC
+
+/* Define to 1 if you have the declaration of `fscanf', and to 0 if you don't.
+ */
+#undef HAVE_DECL_FSCANF
+
+/* Define to 1 if you have the declaration of `optarg', and to 0 if you don't.
+ */
+#undef HAVE_DECL_OPTARG
+
+/* Define to 1 if you have the declaration of `sys_errlist', and to 0 if you
+ don't. */
+#undef HAVE_DECL_SYS_ERRLIST
+
+/* Define to 1 if you have the declaration of `sys_nerr', and to 0 if you
+ don't. */
+#undef HAVE_DECL_SYS_NERR
+
+/* Define to 1 if you have the declaration of `ungetc', and to 0 if you don't.
+ */
+#undef HAVE_DECL_UNGETC
+
+/* Define to 1 if you have the declaration of `vfprintf', and to 0 if you
+ don't. */
+#undef HAVE_DECL_VFPRINTF
+
+/* Define to 1 if you have the <dlfcn.h> header file. */
+#undef HAVE_DLFCN_H
+
+/* Define one of the following to 1 for the format of a `double'.
+ If your format is not among these choices, or you don't know what it is,
+ then leave all undefined.
+ IEEE_LITTLE_SWAPPED means little endian, but with the two 4-byte halves
+ swapped, as used by ARM CPUs in little endian mode. */
+#undef HAVE_DOUBLE_IEEE_BIG_ENDIAN
+#undef HAVE_DOUBLE_IEEE_LITTLE_ENDIAN
+#undef HAVE_DOUBLE_IEEE_LITTLE_SWAPPED
+#undef HAVE_DOUBLE_VAX_D
+#undef HAVE_DOUBLE_VAX_G
+#undef HAVE_DOUBLE_CRAY_CFP
+
+/* Define to 1 if you have the <fcntl.h> header file. */
+#undef HAVE_FCNTL_H
+
+/* Define to 1 if you have the <float.h> header file. */
+#undef HAVE_FLOAT_H
+
+/* Define to 1 if you have the `getpagesize' function. */
+#undef HAVE_GETPAGESIZE
+
+/* Define to 1 if you have the `getrusage' function. */
+#undef HAVE_GETRUSAGE
+
+/* Define to 1 if you have the `getsysinfo' function. */
+#undef HAVE_GETSYSINFO
+
+/* Define to 1 if you have the `gettimeofday' function. */
+#undef HAVE_GETTIMEOFDAY
+
+/* Define one of these to 1 for the host CPU family.
+ If your CPU is not in any of these families, leave all undefined.
+ For an AMD64 chip, define "x86" in ABI=32, but not in ABI=64. */
+#undef HAVE_HOST_CPU_FAMILY_alpha
+#undef HAVE_HOST_CPU_FAMILY_m68k
+#undef HAVE_HOST_CPU_FAMILY_power
+#undef HAVE_HOST_CPU_FAMILY_powerpc
+#undef HAVE_HOST_CPU_FAMILY_x86
+#undef HAVE_HOST_CPU_FAMILY_x86_64
+
+/* Define one of the following to 1 for the host CPU, as per the output of
+ ./config.guess. If your CPU is not listed here, leave all undefined. */
+#undef HAVE_HOST_CPU_alphaev67
+#undef HAVE_HOST_CPU_alphaev68
+#undef HAVE_HOST_CPU_alphaev7
+#undef HAVE_HOST_CPU_m68020
+#undef HAVE_HOST_CPU_m68030
+#undef HAVE_HOST_CPU_m68040
+#undef HAVE_HOST_CPU_m68060
+#undef HAVE_HOST_CPU_m68360
+#undef HAVE_HOST_CPU_powerpc604
+#undef HAVE_HOST_CPU_powerpc604e
+#undef HAVE_HOST_CPU_powerpc750
+#undef HAVE_HOST_CPU_powerpc7400
+#undef HAVE_HOST_CPU_supersparc
+#undef HAVE_HOST_CPU_i386
+#undef HAVE_HOST_CPU_i586
+#undef HAVE_HOST_CPU_i686
+#undef HAVE_HOST_CPU_pentium
+#undef HAVE_HOST_CPU_pentiummmx
+#undef HAVE_HOST_CPU_pentiumpro
+#undef HAVE_HOST_CPU_pentium2
+#undef HAVE_HOST_CPU_pentium3
+#undef HAVE_HOST_CPU_s390_z900
+#undef HAVE_HOST_CPU_s390_z990
+#undef HAVE_HOST_CPU_s390_z9
+#undef HAVE_HOST_CPU_s390_z10
+#undef HAVE_HOST_CPU_s390_z196
+
+/* Define to 1 iff we have a s390 with 64-bit registers. */
+#undef HAVE_HOST_CPU_s390_zarch
+
+/* Define to 1 if the system has the type `intmax_t'. */
+#undef HAVE_INTMAX_T
+
+/* Define to 1 if the system has the type `intptr_t'. */
+#undef HAVE_INTPTR_T
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#undef HAVE_INTTYPES_H
+
+/* Define to 1 if you have the <invent.h> header file. */
+#undef HAVE_INVENT_H
+
+/* Define to 1 if you have the <langinfo.h> header file. */
+#undef HAVE_LANGINFO_H
+
+/* Define one of these to 1 for the endianness of `mp_limb_t'.
+ If the endianness is not a simple big or little, or you don't know what
+ it is, then leave both undefined. */
+#undef HAVE_LIMB_BIG_ENDIAN
+#undef HAVE_LIMB_LITTLE_ENDIAN
+
+/* Define to 1 if you have the `localeconv' function. */
+#undef HAVE_LOCALECONV
+
+/* Define to 1 if you have the <locale.h> header file. */
+#undef HAVE_LOCALE_H
+
+/* Define to 1 if the system has the type `long double'. */
+#undef HAVE_LONG_DOUBLE
+
+/* Define to 1 if the system has the type `long long'. */
+#undef HAVE_LONG_LONG
+
+/* Define to 1 if you have the <machine/hal_sysinfo.h> header file. */
+#undef HAVE_MACHINE_HAL_SYSINFO_H
+
+/* Define to 1 if you have the <memory.h> header file. */
+#undef HAVE_MEMORY_H
+
+/* Define to 1 if you have the `memset' function. */
+#undef HAVE_MEMSET
+
+/* Define to 1 if you have the `mmap' function. */
+#undef HAVE_MMAP
+
+/* Define to 1 if you have the `mprotect' function. */
+#undef HAVE_MPROTECT
+
+/* Define to 1 each of the following for which a native (ie. CPU specific)
+ implementation of the corresponding routine exists. */
+#undef HAVE_NATIVE_mpn_add_n
+#undef HAVE_NATIVE_mpn_add_n_sub_n
+#undef HAVE_NATIVE_mpn_add_nc
+#undef HAVE_NATIVE_mpn_addaddmul_1msb0
+#undef HAVE_NATIVE_mpn_addlsh1_n
+#undef HAVE_NATIVE_mpn_addlsh2_n
+#undef HAVE_NATIVE_mpn_addlsh_n
+#undef HAVE_NATIVE_mpn_addlsh1_nc
+#undef HAVE_NATIVE_mpn_addlsh2_nc
+#undef HAVE_NATIVE_mpn_addlsh_nc
+#undef HAVE_NATIVE_mpn_addlsh1_n_ip1
+#undef HAVE_NATIVE_mpn_addlsh2_n_ip1
+#undef HAVE_NATIVE_mpn_addlsh_n_ip1
+#undef HAVE_NATIVE_mpn_addlsh1_nc_ip1
+#undef HAVE_NATIVE_mpn_addlsh2_nc_ip1
+#undef HAVE_NATIVE_mpn_addlsh_nc_ip1
+#undef HAVE_NATIVE_mpn_addlsh1_n_ip2
+#undef HAVE_NATIVE_mpn_addlsh2_n_ip2
+#undef HAVE_NATIVE_mpn_addlsh_n_ip2
+#undef HAVE_NATIVE_mpn_addlsh1_nc_ip2
+#undef HAVE_NATIVE_mpn_addlsh2_nc_ip2
+#undef HAVE_NATIVE_mpn_addlsh_nc_ip2
+#undef HAVE_NATIVE_mpn_addmul_1c
+#undef HAVE_NATIVE_mpn_addmul_2
+#undef HAVE_NATIVE_mpn_addmul_3
+#undef HAVE_NATIVE_mpn_addmul_4
+#undef HAVE_NATIVE_mpn_addmul_5
+#undef HAVE_NATIVE_mpn_addmul_6
+#undef HAVE_NATIVE_mpn_addmul_7
+#undef HAVE_NATIVE_mpn_addmul_8
+#undef HAVE_NATIVE_mpn_addmul_2s
+#undef HAVE_NATIVE_mpn_and_n
+#undef HAVE_NATIVE_mpn_andn_n
+#undef HAVE_NATIVE_mpn_bdiv_dbm1c
+#undef HAVE_NATIVE_mpn_bdiv_q_1
+#undef HAVE_NATIVE_mpn_pi1_bdiv_q_1
+#undef HAVE_NATIVE_mpn_cnd_add_n
+#undef HAVE_NATIVE_mpn_cnd_sub_n
+#undef HAVE_NATIVE_mpn_com
+#undef HAVE_NATIVE_mpn_copyd
+#undef HAVE_NATIVE_mpn_copyi
+#undef HAVE_NATIVE_mpn_div_qr_1n_pi1
+#undef HAVE_NATIVE_mpn_div_qr_2
+#undef HAVE_NATIVE_mpn_divexact_1
+#undef HAVE_NATIVE_mpn_divexact_by3c
+#undef HAVE_NATIVE_mpn_divrem_1
+#undef HAVE_NATIVE_mpn_divrem_1c
+#undef HAVE_NATIVE_mpn_divrem_2
+#undef HAVE_NATIVE_mpn_gcd_1
+#undef HAVE_NATIVE_mpn_hamdist
+#undef HAVE_NATIVE_mpn_invert_limb
+#undef HAVE_NATIVE_mpn_ior_n
+#undef HAVE_NATIVE_mpn_iorn_n
+#undef HAVE_NATIVE_mpn_lshift
+#undef HAVE_NATIVE_mpn_lshiftc
+#undef HAVE_NATIVE_mpn_lshsub_n
+#undef HAVE_NATIVE_mpn_mod_1
+#undef HAVE_NATIVE_mpn_mod_1_1p
+#undef HAVE_NATIVE_mpn_mod_1c
+#undef HAVE_NATIVE_mpn_mod_1s_2p
+#undef HAVE_NATIVE_mpn_mod_1s_4p
+#undef HAVE_NATIVE_mpn_mod_34lsub1
+#undef HAVE_NATIVE_mpn_modexact_1_odd
+#undef HAVE_NATIVE_mpn_modexact_1c_odd
+#undef HAVE_NATIVE_mpn_mul_1
+#undef HAVE_NATIVE_mpn_mul_1c
+#undef HAVE_NATIVE_mpn_mul_2
+#undef HAVE_NATIVE_mpn_mul_3
+#undef HAVE_NATIVE_mpn_mul_4
+#undef HAVE_NATIVE_mpn_mul_5
+#undef HAVE_NATIVE_mpn_mul_6
+#undef HAVE_NATIVE_mpn_mul_basecase
+#undef HAVE_NATIVE_mpn_nand_n
+#undef HAVE_NATIVE_mpn_nior_n
+#undef HAVE_NATIVE_mpn_popcount
+#undef HAVE_NATIVE_mpn_preinv_divrem_1
+#undef HAVE_NATIVE_mpn_preinv_mod_1
+#undef HAVE_NATIVE_mpn_redc_1
+#undef HAVE_NATIVE_mpn_redc_2
+#undef HAVE_NATIVE_mpn_rsblsh1_n
+#undef HAVE_NATIVE_mpn_rsblsh2_n
+#undef HAVE_NATIVE_mpn_rsblsh_n
+#undef HAVE_NATIVE_mpn_rsblsh1_nc
+#undef HAVE_NATIVE_mpn_rsblsh2_nc
+#undef HAVE_NATIVE_mpn_rsblsh_nc
+#undef HAVE_NATIVE_mpn_rsh1add_n
+#undef HAVE_NATIVE_mpn_rsh1add_nc
+#undef HAVE_NATIVE_mpn_rsh1sub_n
+#undef HAVE_NATIVE_mpn_rsh1sub_nc
+#undef HAVE_NATIVE_mpn_rshift
+#undef HAVE_NATIVE_mpn_sqr_basecase
+#undef HAVE_NATIVE_mpn_sqr_diagonal
+#undef HAVE_NATIVE_mpn_sqr_diag_addlsh1
+#undef HAVE_NATIVE_mpn_sub_n
+#undef HAVE_NATIVE_mpn_sub_nc
+#undef HAVE_NATIVE_mpn_sublsh1_n
+#undef HAVE_NATIVE_mpn_sublsh2_n
+#undef HAVE_NATIVE_mpn_sublsh_n
+#undef HAVE_NATIVE_mpn_sublsh1_nc
+#undef HAVE_NATIVE_mpn_sublsh2_nc
+#undef HAVE_NATIVE_mpn_sublsh_nc
+#undef HAVE_NATIVE_mpn_sublsh1_n_ip1
+#undef HAVE_NATIVE_mpn_sublsh2_n_ip1
+#undef HAVE_NATIVE_mpn_sublsh_n_ip1
+#undef HAVE_NATIVE_mpn_sublsh1_nc_ip1
+#undef HAVE_NATIVE_mpn_sublsh2_nc_ip1
+#undef HAVE_NATIVE_mpn_sublsh_nc_ip1
+#undef HAVE_NATIVE_mpn_submul_1c
+#undef HAVE_NATIVE_mpn_tabselect
+#undef HAVE_NATIVE_mpn_udiv_qrnnd
+#undef HAVE_NATIVE_mpn_udiv_qrnnd_r
+#undef HAVE_NATIVE_mpn_umul_ppmm
+#undef HAVE_NATIVE_mpn_umul_ppmm_r
+#undef HAVE_NATIVE_mpn_xor_n
+#undef HAVE_NATIVE_mpn_xnor_n
+
+/* Define to 1 if you have the `nl_langinfo' function. */
+#undef HAVE_NL_LANGINFO
+
+/* Define to 1 if you have the <nl_types.h> header file. */
+#undef HAVE_NL_TYPES_H
+
+/* Define to 1 if you have the `obstack_vprintf' function. */
+#undef HAVE_OBSTACK_VPRINTF
+
+/* Define to 1 if you have the `popen' function. */
+#undef HAVE_POPEN
+
+/* Define to 1 if you have the `processor_info' function. */
+#undef HAVE_PROCESSOR_INFO
+
+/* Define to 1 if <sys/pstat.h> `struct pst_processor' exists and contains
+ `psp_iticksperclktick'. */
+#undef HAVE_PSP_ITICKSPERCLKTICK
+
+/* Define to 1 if you have the `pstat_getprocessor' function. */
+#undef HAVE_PSTAT_GETPROCESSOR
+
+/* Define to 1 if the system has the type `ptrdiff_t'. */
+#undef HAVE_PTRDIFF_T
+
+/* Define to 1 if the system has the type `quad_t'. */
+#undef HAVE_QUAD_T
+
+/* Define to 1 if you have the `raise' function. */
+#undef HAVE_RAISE
+
+/* Define to 1 if you have the `read_real_time' function. */
+#undef HAVE_READ_REAL_TIME
+
+/* Define to 1 if you have the `sigaction' function. */
+#undef HAVE_SIGACTION
+
+/* Define to 1 if you have the `sigaltstack' function. */
+#undef HAVE_SIGALTSTACK
+
+/* Define to 1 if you have the `sigstack' function. */
+#undef HAVE_SIGSTACK
+
+/* Tune directory speed_cyclecounter, undef=none, 1=32bits, 2=64bits) */
+#undef HAVE_SPEED_CYCLECOUNTER
+
+/* Define to 1 if you have the <sstream> header file. */
+#undef HAVE_SSTREAM
+
+/* Define to 1 if the system has the type `stack_t'. */
+#undef HAVE_STACK_T
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#undef HAVE_STDINT_H
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#undef HAVE_STDLIB_H
+
+/* Define to 1 if the system has the type `std::locale'. */
+#undef HAVE_STD__LOCALE
+
+/* Define to 1 if you have the `strchr' function. */
+#undef HAVE_STRCHR
+
+/* Define to 1 if you have the `strerror' function. */
+#undef HAVE_STRERROR
+
+/* Define to 1 if cpp supports the ANSI # stringizing operator. */
+#undef HAVE_STRINGIZE
+
+/* Define to 1 if you have the <strings.h> header file. */
+#undef HAVE_STRINGS_H
+
+/* Define to 1 if you have the <string.h> header file. */
+#undef HAVE_STRING_H
+
+/* Define to 1 if you have the `strnlen' function. */
+#undef HAVE_STRNLEN
+
+/* Define to 1 if you have the `strtol' function. */
+#undef HAVE_STRTOL
+
+/* Define to 1 if you have the `strtoul' function. */
+#undef HAVE_STRTOUL
+
+/* Define to 1 if you have the `sysconf' function. */
+#undef HAVE_SYSCONF
+
+/* Define to 1 if you have the `sysctl' function. */
+#undef HAVE_SYSCTL
+
+/* Define to 1 if you have the `sysctlbyname' function. */
+#undef HAVE_SYSCTLBYNAME
+
+/* Define to 1 if you have the `syssgi' function. */
+#undef HAVE_SYSSGI
+
+/* Define to 1 if you have the <sys/attributes.h> header file. */
+#undef HAVE_SYS_ATTRIBUTES_H
+
+/* Define to 1 if you have the <sys/iograph.h> header file. */
+#undef HAVE_SYS_IOGRAPH_H
+
+/* Define to 1 if you have the <sys/mman.h> header file. */
+#undef HAVE_SYS_MMAN_H
+
+/* Define to 1 if you have the <sys/param.h> header file. */
+#undef HAVE_SYS_PARAM_H
+
+/* Define to 1 if you have the <sys/processor.h> header file. */
+#undef HAVE_SYS_PROCESSOR_H
+
+/* Define to 1 if you have the <sys/pstat.h> header file. */
+#undef HAVE_SYS_PSTAT_H
+
+/* Define to 1 if you have the <sys/resource.h> header file. */
+#undef HAVE_SYS_RESOURCE_H
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#undef HAVE_SYS_STAT_H
+
+/* Define to 1 if you have the <sys/sysctl.h> header file. */
+#undef HAVE_SYS_SYSCTL_H
+
+/* Define to 1 if you have the <sys/sysinfo.h> header file. */
+#undef HAVE_SYS_SYSINFO_H
+
+/* Define to 1 if you have the <sys/syssgi.h> header file. */
+#undef HAVE_SYS_SYSSGI_H
+
+/* Define to 1 if you have the <sys/systemcfg.h> header file. */
+#undef HAVE_SYS_SYSTEMCFG_H
+
+/* Define to 1 if you have the <sys/times.h> header file. */
+#undef HAVE_SYS_TIMES_H
+
+/* Define to 1 if you have the <sys/time.h> header file. */
+#undef HAVE_SYS_TIME_H
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#undef HAVE_SYS_TYPES_H
+
+/* Define to 1 if you have the `times' function. */
+#undef HAVE_TIMES
+
+/* Define to 1 if the system has the type `uint_least32_t'. */
+#undef HAVE_UINT_LEAST32_T
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#undef HAVE_UNISTD_H
+
+/* Define to 1 if you have the `vsnprintf' function and it works properly. */
+#undef HAVE_VSNPRINTF
+
+/* Define to 1 for Windos/64 */
+#undef HOST_DOS64
+
+/* Assembler local label prefix */
+#undef LSYM_PREFIX
+
+/* Define to the sub-directory in which libtool stores uninstalled libraries.
+ */
+#undef LT_OBJDIR
+
+/* Name of package */
+#undef PACKAGE
+
+/* Define to the address where bug reports for this package should be sent. */
+#undef PACKAGE_BUGREPORT
+
+/* Define to the full name of this package. */
+#undef PACKAGE_NAME
+
+/* Define to the full name and version of this package. */
+#undef PACKAGE_STRING
+
+/* Define to the one symbol short name of this package. */
+#undef PACKAGE_TARNAME
+
+/* Define to the home page for this package. */
+#undef PACKAGE_URL
+
+/* Define to the version of this package. */
+#undef PACKAGE_VERSION
+
+/* Define as the return type of signal handlers (`int' or `void'). */
+#undef RETSIGTYPE
+
+/* The size of `mp_limb_t', as computed by sizeof. */
+#undef SIZEOF_MP_LIMB_T
+
+/* The size of `unsigned', as computed by sizeof. */
+#undef SIZEOF_UNSIGNED
+
+/* The size of `unsigned long', as computed by sizeof. */
+#undef SIZEOF_UNSIGNED_LONG
+
+/* The size of `unsigned short', as computed by sizeof. */
+#undef SIZEOF_UNSIGNED_SHORT
+
+/* The size of `void *', as computed by sizeof. */
+#undef SIZEOF_VOID_P
+
+/* Define to 1 if sscanf requires writable inputs */
+#undef SSCANF_WRITABLE_INPUT
+
+/* Define to 1 if you have the ANSI C header files. */
+#undef STDC_HEADERS
+
+/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
+#undef TIME_WITH_SYS_TIME
+
+/* Maximum size the tune program can test for SQR_TOOM2_THRESHOLD */
+#undef TUNE_SQR_TOOM2_MAX
+
+/* Version number of package */
+#undef VERSION
+
+/* Defined to 1 as per --enable-assembly */
+#undef WANT_ASSEMBLY
+
+/* Define to 1 to enable ASSERT checking, per --enable-assert */
+#undef WANT_ASSERT
+
+/* Define to 1 to enable GMP_CPU_TYPE faking cpuid, per --enable-fake-cpuid */
+#undef WANT_FAKE_CPUID
+
+/* Define to 1 when building a fat binary. */
+#undef WANT_FAT_BINARY
+
+/* Define to 1 to enable FFTs for multiplication, per --enable-fft */
+#undef WANT_FFT
+
+/* Define to 1 to enable old mpn_mul_fft_full for multiplication, per
+ --enable-old-fft-full */
+#undef WANT_OLD_FFT_FULL
+
+/* Define to 1 if --enable-profiling=gprof */
+#undef WANT_PROFILING_GPROF
+
+/* Define to 1 if --enable-profiling=instrument */
+#undef WANT_PROFILING_INSTRUMENT
+
+/* Define to 1 if --enable-profiling=prof */
+#undef WANT_PROFILING_PROF
+
+/* Define one of these to 1 for the desired temporary memory allocation
+ method, per --enable-alloca. */
+#undef WANT_TMP_ALLOCA
+#undef WANT_TMP_REENTRANT
+#undef WANT_TMP_NOTREENTRANT
+#undef WANT_TMP_DEBUG
+
+/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
+ significant byte first (like Motorola and SPARC, unlike Intel). */
+#if defined AC_APPLE_UNIVERSAL_BUILD
+# if defined __BIG_ENDIAN__
+# define WORDS_BIGENDIAN 1
+# endif
+#else
+# ifndef WORDS_BIGENDIAN
+# undef WORDS_BIGENDIAN
+# endif
+#endif
+
+/* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a
+ `char[]'. */
+#undef YYTEXT_POINTER
+
+/* Define to `__inline__' or `__inline' if that's what the C compiler
+ calls it, or to nothing if 'inline' is not supported under any name. */
+#ifndef __cplusplus
+#undef inline
+#endif
+
+/* Define to the equivalent of the C99 'restrict' keyword, or to
+ nothing if this is not supported. Do not define if restrict is
+ supported directly. */
+#undef restrict
+/* Work around a bug in Sun C++: it does not support _Restrict or
+ __restrict__, even though the corresponding Sun C compiler ends up with
+ "#define restrict _Restrict" or "#define restrict __restrict__" in the
+ previous line. Perhaps some future version of Sun C++ will work with
+ restrict; if so, hopefully it defines __RESTRICT like Sun C does. */
+#if defined __SUNPRO_CC && !defined __RESTRICT
+# define _Restrict
+# define __restrict__
+#endif
+
+/* Define to empty if the keyword `volatile' does not work. Warning: valid
+ code using `volatile' can become incorrect without. Disable with care. */
+#undef volatile
diff --git a/Build/source/libs/gmp/gmp-6.0.0/configgmp.guess b/Build/source/libs/gmp/gmp-6.0.0/configgmp.guess
new file mode 100755
index 00000000000..02b61f45aaf
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/configgmp.guess
@@ -0,0 +1,1021 @@
+#! /bin/sh
+#
+# GMP config.guess wrapper.
+
+
+# Copyright 2000-2006, 2008, 2011-2014 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/.
+
+
+# Usage: config.guess
+#
+# Print the host system CPU-VENDOR-OS.
+#
+# configfsf.guess is run and its guess then sharpened up to take advantage
+# of the finer grained CPU types that GMP knows.
+
+
+# Expect to find configfsf.guess in the same directory as this config.guess
+configfsf_guess="`echo \"$0\" | sed 's/config.guess$/configfsf.guess/'`"
+if test "$configfsf_guess" = "$0"; then
+ echo "Cannot derive configfsf.guess from $0" 1>&2
+ exit 1
+fi
+if test -f "$configfsf_guess"; then
+ :
+else
+ echo "$configfsf_guess not found" 1>&2
+ exit 1
+fi
+
+# Setup a $SHELL with which to run configfsf.guess, using the same
+# $CONFIG_SHELL or /bin/sh as autoconf does when running config.guess
+SHELL=${CONFIG_SHELL-/bin/sh}
+
+# Identify ourselves on --version, --help or errors
+if test $# != 0; then
+ echo "(GNU MP wrapped config.guess)"
+ $SHELL $configfsf_guess "$@"
+ exit 1
+fi
+
+guess_full=`$SHELL $configfsf_guess`
+if test $? != 0; then
+ exit 1
+fi
+
+guess_cpu=`echo "$guess_full" | sed 's/-.*$//'`
+guess_rest=`echo "$guess_full" | sed 's/^[^-]*//'`
+exact_cpu=
+
+
+# -------------------------------------------------------------------------
+# The following should look at the current guess and probe the system to
+# establish a better guess in exact_cpu. Leave exact_cpu empty if probes
+# can't be done, or don't work.
+#
+# When a number of probes are done, test -z "$exact_cpu" can be used instead
+# of putting each probe under an "else" of the preceeding. That can stop
+# the code getting horribly nested and marching off the right side of the
+# screen.
+
+# Note that when a compile-and-link is done in one step we need to remove .o
+# files, since lame C compilers generate these even when not asked.
+#
+
+# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
+# compiler to aid in system detection is discouraged as it requires
+# temporary files to be created and, as you can see below, it is a
+# headache to deal with in a portable fashion.
+
+# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
+# use `HOST_CC' if defined, but it is deprecated.
+
+# Portable tmp directory creation inspired by the Autoconf team.
+
+set_cc_for_build='
+trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
+trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
+: ${TMPDIR=/tmp} ;
+ { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
+ { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
+ { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
+ { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
+dummy=$tmp/dummy ;
+tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy $dummy.core ${dummy}0.s" ;
+case $CC_FOR_BUILD,$HOST_CC,$CC in
+ ,,) echo "int x;" > $dummy.c ;
+ for c in cc gcc c89 c99 ; do
+ if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
+ CC_FOR_BUILD="$c"; break ;
+ fi ;
+ done ;
+ if test x"$CC_FOR_BUILD" = x ; then
+ CC_FOR_BUILD=no_compiler_found ;
+ fi
+ ;;
+ ,,*) CC_FOR_BUILD=$CC ;;
+ ,*,*) CC_FOR_BUILD=$HOST_CC ;;
+esac ; set_cc_for_build= ;'
+
+
+case "$guess_full" in
+
+alpha-*-*)
+ eval $set_cc_for_build
+ # configfsf.guess detects exact alpha cpu types for OSF and GNU/Linux, but
+ # not for *BSD and other systems. We try to get an exact type for any
+ # plain "alpha" it leaves.
+ #
+ # configfsf.guess used to have a block of code not unlike this, but these
+ # days does its thing with Linux kernel /proc/cpuinfo or OSF psrinfo.
+ #
+ cat <<EOF >${dummy}0.s
+ .data
+Lformat:
+ .byte 37,100,45,37,120,10,0 # "%d-%x\n"
+ .text
+ .globl main
+ .align 4
+ .ent main
+main:
+ .frame \$30,16,\$26,0
+ ldgp \$29,0(\$27)
+ .prologue 1
+ .long 0x47e03d91 # implver \$17
+ lda \$2,-1
+ .long 0x47e20c21 # amask \$2,\$1
+ lda \$16,Lformat
+ not \$1,\$18
+ jsr \$26,printf
+ ldgp \$29,0(\$26)
+ mov 0,\$16
+ jsr \$26,exit
+ .end main
+EOF
+ $CC_FOR_BUILD ${dummy}0.s -o $dummy 2>/dev/null
+ if test "$?" = 0 ; then
+ case `$dummy` in
+ 0-0) exact_cpu=alpha ;;
+ 1-0) exact_cpu=alphaev5 ;;
+ 1-1) exact_cpu=alphaev56 ;;
+ 1-101) exact_cpu=alphapca56 ;;
+ 2-303) exact_cpu=alphaev6 ;;
+ 2-307) exact_cpu=alphaev67 ;;
+ 2-1307) exact_cpu=alphaev68 ;;
+ esac
+ fi
+ ;;
+
+arm*-*-*)
+ cpu_code=`sed -n 's/^CPU part.*\(0x.*\)$/\1/p' /proc/cpuinfo 2>/dev/null`
+ case "$cpu_code" in
+ 0xa10 | 0xa11 | 0xb11) # v4 strongarm/sa1100
+ exact_cpu="armsa1";;
+ 0x915 | 0x925 | \
+ 0x920 | 0x922 | 0x940) # v4
+ exact_cpu="arm9tdmi";;
+ 0x210 | 0x290 | 0x2d0 | \
+ 0x212 | 0x292 | 0x2d2 | \
+ 0x411) exact_cpu="armxscale";; # v5 pxa2xx
+ 0x926 | 0x946 | 0x966 | 0x968) # v5te/v5tej
+ exact_cpu="arm9te";;
+ 0xa20 | 0xa22 | 0xa26) # v5te
+ exact_cpu="arm10";;
+ 0xb02) exact_cpu="arm11mpcore";; # v6
+ 0xb36) exact_cpu="arm1136";; # v6
+ 0xb56) exact_cpu="arm1156";; # v6t2
+ 0xb76) exact_cpu="arm1176";; # v6
+ 0xc05) exact_cpu="armcortexa5";; # v7a
+ 0xc07) exact_cpu="armcortexa7";; # v7a
+ 0xc08) exact_cpu="armcortexa8";; # v7a
+ 0xc09) exact_cpu="armcortexa9";; # v7a
+ 0xc0f) exact_cpu="armcortexa15";; # v7a
+ 0xc14) exact_cpu="armcortexr4";; # v7r
+ 0xc15) exact_cpu="armcortexr5";; # v7r
+ 0xc23) exact_cpu="armcortexm3";; # v7m
+ esac
+ exact_cpu="${exact_cpu}`sed -n 's;^Features.*\(neon\).*;\1;p' /proc/cpuinfo 2>/dev/null`"
+ ;;
+
+ia64*-*-*)
+ eval $set_cc_for_build
+ # CPUID[3] bits 24 to 31 is the processor family. itanium2 is documented
+ # as 0x1f, plain itanium has been seen returning 0x07 on two systems, but
+ # haven't found any documentation on it as such.
+ #
+ # Defining both getcpuid and _getcpuid lets us ignore whether the system
+ # expects underscores or not.
+ #
+ # "unsigned long long" is always 64 bits, in fact on hpux in ilp32 mode
+ # (which is the default there), it's the only 64-bit type.
+ #
+ cat >${dummy}0.s <<EOF
+ .text
+ .global _getcpuid
+ .proc _getcpuid
+_getcpuid:
+ mov r8 = CPUID[r32] ;;
+ br.ret.sptk.many rp ;;
+ .endp _getcpuid
+ .global getcpuid
+ .proc getcpuid
+getcpuid:
+ mov r8 = CPUID[r32] ;;
+ br.ret.sptk.many rp ;;
+ .endp getcpuid
+EOF
+ cat >$dummy.c <<EOF
+#include <stdio.h>
+unsigned long long getcpuid ();
+int
+main ()
+{
+ if (getcpuid(0LL) == 0x49656E69756E6547LL && getcpuid(1LL) == 0x6C65746ELL)
+ {
+ /* "GenuineIntel" */
+ switch ((getcpuid(3LL) >> 24) & 0xFF) {
+ case 0x07: puts ("itanium"); break;
+ case 0x1F: puts ("itanium2"); break; /* McKinley, Madison */
+ case 0x20: puts ("itanium2"); break; /* Montecito */
+ }
+ }
+ return 0;
+}
+EOF
+ if $CC_FOR_BUILD ${dummy}0.s $dummy.c -o $dummy >/dev/null 2>&1; then
+ exact_cpu=`$dummy`
+ fi
+ ;;
+
+mips-*-irix[6789]*)
+ # IRIX 6 and up always has a 64-bit mips cpu
+ exact_cpu=mips64
+ ;;
+
+m68k-*-*)
+ eval $set_cc_for_build
+ # NetBSD (and presumably other *BSD) "sysctl hw.model" gives for example
+ # hw.model = Apple Macintosh Quadra 610 (68040)
+ exact_cpu=`(sysctl hw.model) 2>/dev/null | sed -n 's/^.*\(680[012346]0\).*$/m\1/p'`
+ if test -z "$exact_cpu"; then
+ # Linux kernel 2.2 gives for example "CPU: 68020" (tabs in between).
+ exact_cpu=`sed -n 's/^CPU:.*\(680[012346]0\).*$/m\1/p' /proc/cpuinfo 2>/dev/null`
+ fi
+ if test -z "$exact_cpu"; then
+ # Try: movel #0,%d0; rts
+ # This is to check the compiler and our asm code works etc, before
+ # assuming failures below indicate cpu characteristics.
+ # .byte is used to avoid problems with assembler syntax variations.
+ # For testing, provoke failures by adding "illegal" possibly as
+ # ".byte 0x4A, 0xFC"
+ cat >${dummy}0.s <<EOF
+ .text
+ .globl main
+ .globl _main
+main:
+_main:
+ .byte 0x70, 0x00
+ .byte 0x4e, 0x75
+EOF
+
+ if ($CC_FOR_BUILD ${dummy}0.s -o $dummy && $dummy) >/dev/null 2>&1; then
+
+ # $SHELL -c is used to execute $dummy below, since ($dummy)
+ # 2>/dev/null still prints the SIGILL message on some shells.
+ #
+ # Try: movel #0,%d0
+ # rtd #0
+ cat >${dummy}0.s <<EOF
+ .text
+ .globl main
+ .globl _main
+main:
+_main:
+ .byte 0x70, 0x00
+ .byte 0x4e, 0x74, 0x00, 0x00
+EOF
+ if $CC_FOR_BUILD ${dummy}0.s -o $dummy >/dev/null 2>&1; then
+ $SHELL -c $dummy >/dev/null 2>&1
+ if test $? != 0; then
+ exact_cpu=m68000 # because rtd didn't work
+ fi
+ fi
+ #
+
+ if test -z "$exact_cpu"; then
+ # Try: trapf
+ # movel #0,%d0
+ # rts
+ # Another possibility for identifying 68000 and 68010 is the
+ # different value stored by "movem a0,(a0)+"
+ cat >${dummy}0.s <<EOF
+ .text
+ .globl main
+ .globl _main
+main:
+_main:
+ .byte 0x51, 0xFC
+ .byte 0x70, 0x00
+ .byte 0x4e, 0x75
+EOF
+ if $CC_FOR_BUILD ${dummy}0.s -o $dummy >/dev/null 2>&1; then
+ $SHELL -c $dummy >/dev/null 2>&1
+ if test $? != 0; then
+ exact_cpu=m68010 # because trapf didn't work
+ fi
+ fi
+ fi
+
+ if test -z "$exact_cpu"; then
+ # Try: bfffo %d1{0:31},%d0
+ # movel #0,%d0
+ # rts
+ cat >${dummy}0.s <<EOF
+ .text
+ .globl main
+ .globl _main
+main:
+_main:
+ .byte 0xED, 0xC1, 0x00, 0x1F
+ .byte 0x70, 0x00
+ .byte 0x4e, 0x75
+EOF
+ if $CC_FOR_BUILD ${dummy}0.s -o $dummy >/dev/null 2>&1; then
+ $SHELL -c $dummy >/dev/null 2>&1
+ if test $? != 0; then
+ exact_cpu=m68360 # cpu32, because bfffo didn't work
+ fi
+ fi
+ fi
+
+ if test -z "$exact_cpu"; then
+ # FIXME: Now we know 68020 or up, but how to detect 030, 040 and 060?
+ exact_cpu=m68020
+ fi
+ fi
+ fi
+ if test -z "$exact_cpu"; then
+ case "$guess_full" in
+ *-*-next* | *-*-openstep*) # NeXTs are 68020 or better
+ exact_cpu=m68020 ;;
+ esac
+ fi
+ ;;
+
+
+rs6000-*-* | powerpc*-*-*)
+ # Enhancement: On MacOS the "machine" command prints for instance
+ # "ppc750". Interestingly on powerpc970-apple-darwin6.8.5 it prints
+ # "ppc970" where there's no actual #define for 970 from NXGetLocalArchInfo
+ # (as noted below). But the man page says the command is still "under
+ # development", so it doesn't seem wise to use it just yet, not while
+ # there's an alternative.
+ #
+ # 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.
+ #
+ # Using explicit bytes for mfpvr avoids worrying about assembler syntax
+ # and underscores. "char"s are used instead of "int"s to avoid worrying
+ # whether sizeof(int)==4 or if it's the right endianness.
+ #
+ # 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
+ # AIX doesn't allow mfpvr anyway.
+ #
+ eval $set_cc_for_build
+ cat >$dummy.c <<\EOF
+#include <stdio.h>
+struct {
+ int n; /* force 4-byte alignment */
+ char a[8];
+} getpvr = {
+ 0,
+ {
+ 0x7c, 0x7f, 0x42, 0xa6, /* mfpvr r3 */
+ 0x4e, 0x80, 0x00, 0x20, /* blr */
+ }
+};
+int
+main ()
+{
+ unsigned (*fun)();
+ unsigned pvr;
+
+ /* a separate "fun" variable is necessary for gcc 2.95.2 on MacOS,
+ it gets a compiler error on a combined cast and call */
+ fun = (unsigned (*)()) getpvr.a;
+ pvr = (*fun) ();
+
+ switch (pvr >> 16) {
+ case 0x0001: puts ("powerpc601"); break;
+ case 0x0003: puts ("powerpc603"); break;
+ case 0x0004: puts ("powerpc604"); break;
+ case 0x0006: puts ("powerpc603e"); break;
+ case 0x0007: puts ("powerpc603e"); break; /* 603ev */
+ case 0x0008: puts ("powerpc750"); break;
+ case 0x0009: puts ("powerpc604e"); break;
+ case 0x000a: puts ("powerpc604e"); break; /* 604ev5 */
+ case 0x000c: puts ("powerpc7400"); break;
+ case 0x0041: puts ("powerpc630"); break;
+ case 0x0050: puts ("powerpc860"); break;
+ case 0x8000: puts ("powerpc7450"); break;
+ case 0x8001: puts ("powerpc7455"); break;
+ case 0x8002: puts ("powerpc7457"); break;
+ case 0x8003: puts ("powerpc7447"); break; /* really 7447A */
+ case 0x800c: puts ("powerpc7410"); break;
+ }
+ return 0;
+}
+EOF
+ if ($CC_FOR_BUILD $dummy.c -o $dummy) >/dev/null 2>&1; then
+ # This style construct is needed on AIX 4.3 to suppress the SIGILL error
+ # from (*fun)(). Using $SHELL -c $dummy 2>/dev/null doesn't work.
+ { x=`$dummy`; } 2>/dev/null
+ if test -n "$x"; then
+ exact_cpu=$x
+ fi
+ fi
+
+ # Grep the linux kernel /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 "s;POWER;power;"` ;;
+ esac
+ fi
+
+ if test -z "$exact_cpu"; then
+ # On AIX, try looking at _system_configuration. This is present in
+ # version 4 at least.
+ cat >$dummy.c <<EOF
+#include <stdio.h>
+#include <sys/systemcfg.h>
+int
+main ()
+{
+ switch (_system_configuration.implementation) {
+ /* Old versions of AIX don't have all these constants,
+ use ifdef for safety. */
+#ifdef POWER_RS2
+ case POWER_RS2: puts ("power2"); break;
+#endif
+#ifdef POWER_601
+ case POWER_601: puts ("power"); break;
+#endif
+#ifdef POWER_603
+ case POWER_603: puts ("powerpc603"); break;
+#endif
+#ifdef POWER_604
+ case POWER_604: puts ("powerpc604"); break;
+#endif
+#ifdef POWER_620
+ case POWER_620: puts ("powerpc620"); break;
+#endif
+#ifdef POWER_630
+ case POWER_630: puts ("powerpc630"); break;
+#endif
+ /* Dunno what this is, leave it out for now.
+ case POWER_A35: puts ("powerpca35"); break;
+ */
+ /* This is waiting for a bit more info.
+ case POWER_RS64II: puts ("powerpcrs64ii"); break;
+ */
+#ifdef POWER_4
+ case POWER_4: puts ("power4"); break;
+#endif
+#ifdef POWER_5
+ case POWER_5: puts ("power5"); break;
+#endif
+#ifdef POWER_6
+ case POWER_6: puts ("power6"); break;
+#endif
+#ifdef POWER_7
+ case POWER_7: puts ("power7"); break;
+#endif
+ default:
+ if (_system_configuration.architecture == POWER_RS)
+ puts ("power");
+ else if (_system_configuration.width == 64)
+ puts ("powerpc64");
+ }
+ return 0;
+}
+EOF
+ if ($CC_FOR_BUILD $dummy.c -o $dummy) >/dev/null 2>&1; then
+ x=`$dummy`
+ if test -n "$x"; then
+ exact_cpu=$x
+ fi
+ fi
+ fi
+
+ if test -z "$exact_cpu"; then
+ # On MacOS X (or any Mach-O presumably), NXGetLocalArchInfo cpusubtype
+ # can tell us the exact cpu.
+ cat >$dummy.c <<EOF
+#include <stdio.h>
+#include <mach-o/arch.h>
+int
+main (void)
+{
+ const NXArchInfo *a = NXGetLocalArchInfo();
+ if (a->cputype == CPU_TYPE_POWERPC)
+ {
+ switch (a->cpusubtype) {
+ /* The following known to Darwin 1.3. */
+ case CPU_SUBTYPE_POWERPC_601: puts ("powerpc601"); break;
+ case CPU_SUBTYPE_POWERPC_602: puts ("powerpc602"); break;
+ case CPU_SUBTYPE_POWERPC_603: puts ("powerpc603"); break;
+ case CPU_SUBTYPE_POWERPC_603e: puts ("powerpc603e"); break;
+ case CPU_SUBTYPE_POWERPC_603ev: puts ("powerpc603e"); break;
+ case CPU_SUBTYPE_POWERPC_604: puts ("powerpc604"); break;
+ case CPU_SUBTYPE_POWERPC_604e: puts ("powerpc604e"); break;
+ case CPU_SUBTYPE_POWERPC_620: puts ("powerpc620"); break;
+ case CPU_SUBTYPE_POWERPC_750: puts ("powerpc750"); break;
+ case CPU_SUBTYPE_POWERPC_7400: puts ("powerpc7400"); break;
+ case CPU_SUBTYPE_POWERPC_7450: puts ("powerpc7450"); break;
+ /* Darwin 6.8.5 doesn't define the following */
+ case 0x8001: puts ("powerpc7455"); break;
+ case 0x8002: puts ("powerpc7457"); break;
+ case 0x8003: puts ("powerpc7447"); break;
+ case 100: puts ("powerpc970"); break;
+ }
+ }
+ return 0;
+}
+EOF
+ if ($CC_FOR_BUILD $dummy.c -o $dummy) >/dev/null 2>&1; then
+ x=`$dummy`
+ if test -n "$x"; then
+ exact_cpu=$x
+ fi
+ fi
+ fi
+ ;;
+
+sparc-*-* | sparc64-*-*)
+ # If we can recognise an actual v7 then $exact_cpu is set to "sparc" so as
+ # to short-circuit subsequent tests.
+
+ # Grep the linux kernel /proc/cpuinfo pseudo-file.
+ # A typical line is "cpu\t\t: TI UltraSparc II (BlackBird)"
+ # See arch/sparc/kernel/cpu.c and arch/sparc64/kernel/cpu.c.
+ #
+ if test -f /proc/cpuinfo; then
+ if grep 'cpu.*Cypress' /proc/cpuinfo >/dev/null; then
+ exact_cpu="sparc" # ie. v7
+ elif grep 'cpu.*Power-UP' /proc/cpuinfo >/dev/null; then
+ exact_cpu="sparc" # ie. v7
+ elif grep 'cpu.*HyperSparc' /proc/cpuinfo >/dev/null; then
+ exact_cpu="sparcv8"
+ elif grep 'cpu.*SuperSparc' /proc/cpuinfo >/dev/null; then
+ exact_cpu="supersparc"
+ elif grep 'cpu.*MicroSparc' /proc/cpuinfo >/dev/null; then
+ exact_cpu="microsparc"
+ elif grep 'cpu.*MB86904' /proc/cpuinfo >/dev/null; then
+ # actually MicroSPARC-II
+ exact_cpu=microsparc
+ elif grep 'cpu.*UltraSparc T4' /proc/cpuinfo >/dev/null; then
+ exact_cpu="ultrasparct4"
+ elif grep 'cpu.*UltraSparc T3' /proc/cpuinfo >/dev/null; then
+ exact_cpu="ultrasparct3"
+ elif grep 'cpu.*UltraSparc T2' /proc/cpuinfo >/dev/null; then
+ exact_cpu="ultrasparct2"
+ elif grep 'cpu.*UltraSparc T1' /proc/cpuinfo >/dev/null; then
+ exact_cpu="ultrasparct1"
+ elif grep 'cpu.*UltraSparc III' /proc/cpuinfo >/dev/null; then
+ exact_cpu="ultrasparc3"
+ elif grep 'cpu.*UltraSparc IIi' /proc/cpuinfo >/dev/null; then
+ exact_cpu="ultrasparc2i"
+ elif grep 'cpu.*UltraSparc II' /proc/cpuinfo >/dev/null; then
+ exact_cpu="ultrasparc2"
+ elif grep 'cpu.*UltraSparc' /proc/cpuinfo >/dev/null; then
+ exact_cpu="ultrasparc"
+ fi
+ fi
+
+ # Need to invoke this for setup of $dummy
+ eval $set_cc_for_build
+
+ # Grep the output from sysinfo on SunOS.
+ # sysinfo has been seen living in /bin or in /usr/kvm
+ # cpu0 is a "SuperSPARC Model 41 SPARCmodule" CPU
+ # cpu0 is a "75 MHz TI,TMS390Z55" CPU
+ #
+ if test -z "$exact_cpu"; then
+ for i in sysinfo /usr/kvm/sysinfo; do
+ if $SHELL -c $i 2>/dev/null >$dummy; then
+ if grep 'cpu0 is a "SuperSPARC' $dummy >/dev/null; then
+ exact_cpu=supersparc
+ break
+ elif grep 'cpu0 is a .*TMS390Z5.' $dummy >/dev/null; then
+ # TMS390Z50 and TMS390Z55
+ exact_cpu=supersparc
+ break
+ fi
+ fi
+ done
+ fi
+
+ # Grep the output from prtconf on Solaris.
+ # Use an explicit /usr/sbin, since that directory might not be in a normal
+ # user's path.
+ #
+ # SUNW,UltraSPARC (driver not attached)
+ # SUNW,UltraSPARC-II (driver not attached)
+ # SUNW,UltraSPARC-IIi (driver not attached)
+ # SUNW,UltraSPARC-III+ (driver not attached)
+ # Ross,RT625 (driver not attached)
+ # TI,TMS390Z50 (driver not attached)
+ #
+ # /usr/sbin/sysdef prints similar information, but includes all loadable
+ # cpu modules, not just the real cpu.
+ #
+ # We first try a plain prtconf, since that is known to work on older systems.
+ # But for newer T1 systems, that doesn't produce any useful output, we need
+ # "prtconf -vp" there.
+ #
+ for prtconfopt in "" "-vp"; do
+ if test -z "$exact_cpu"; then
+ if $SHELL -c "/usr/sbin/prtconf $prtconfopt" 2>/dev/null >$dummy; then
+ if grep 'SUNW,UltraSPARC-T3' $dummy >/dev/null; then
+ exact_cpu=ultrasparct3
+ elif grep 'SUNW,UltraSPARC-T2' $dummy >/dev/null; then
+ exact_cpu=ultrasparct2
+ elif grep 'SUNW,UltraSPARC-T1' $dummy >/dev/null; then
+ exact_cpu=ultrasparct1
+ elif grep 'SUNW,UltraSPARC-III' $dummy >/dev/null; then
+ exact_cpu=ultrasparc3
+ elif grep 'SUNW,UltraSPARC-IIi' $dummy >/dev/null; then
+ exact_cpu=ultrasparc2i
+ elif grep 'SUNW,UltraSPARC-II' $dummy >/dev/null; then
+ exact_cpu=ultrasparc2
+ elif grep 'SUNW,UltraSPARC' $dummy >/dev/null; then
+ exact_cpu=ultrasparc
+ elif grep 'Ross,RT62.' $dummy >/dev/null; then
+ # RT620, RT625, RT626 hypersparcs (v8).
+ exact_cpu=sparcv8
+ elif grep 'TI,TMS390Z5.' $dummy >/dev/null; then
+ # TMS390Z50 and TMS390Z55
+ exact_cpu=supersparc
+ elif grep 'TI,TMS390S10' $dummy >/dev/null; then
+ exact_cpu=microsparc
+ elif grep 'FMI,MB86904' $dummy >/dev/null; then
+ # actually MicroSPARC-II
+ exact_cpu=microsparc
+ fi
+ fi
+ fi
+ done
+
+ # Grep the output from sysctl hw.model on sparc or sparc64 *BSD.
+ # Use an explicit /sbin, since that directory might not be in a normal
+ # user's path. Example outputs,
+ #
+ # hw.model: Sun Microsystems UltraSparc-IIi
+ #
+ if test -z "$exact_cpu"; then
+ if $SHELL -c "/sbin/sysctl hw.model" 2>/dev/null >$dummy; then
+ if grep -i 'UltraSparc-T3' $dummy >/dev/null; then
+ exact_cpu=ultrasparct3
+ elif grep -i 'UltraSparc-T2' $dummy >/dev/null; then
+ exact_cpu=ultrasparct2
+ elif grep -i 'UltraSparc-T1' $dummy >/dev/null; then
+ exact_cpu=ultrasparct1
+ elif grep -i 'UltraSparc-III' $dummy >/dev/null; then
+ exact_cpu=ultrasparc3
+ elif grep -i 'UltraSparc-IIi' $dummy >/dev/null; then
+ exact_cpu=ultrasparc2i
+ elif grep -i 'UltraSparc-II' $dummy >/dev/null; then
+ exact_cpu=ultrasparc2
+ elif grep -i 'UltraSparc' $dummy >/dev/null; then
+ exact_cpu=ultrasparc
+ elif grep 'TMS390Z5.' $dummy >/dev/null; then
+ # TMS390Z50 and TMS390Z55
+ exact_cpu=supersparc
+ elif grep 'TMS390S10' $dummy >/dev/null; then
+ exact_cpu=microsparc
+ elif grep 'MB86904' $dummy >/dev/null; then
+ # actually MicroSPARC-II
+ exact_cpu=microsparc
+ elif grep 'MB86907' $dummy >/dev/null; then
+ exact_cpu=turbosparc
+ fi
+ fi
+ fi
+
+ # sun4m and sun4d are v8s of some sort, sun4u is a v9 of some sort
+ #
+ if test -z "$exact_cpu"; then
+ case `uname -m` in
+ sun4[md]) exact_cpu=sparcv8 ;;
+ sun4u) exact_cpu=sparcv9 ;;
+ esac
+ fi
+ ;;
+
+
+# Recognise x86 processors using a tricky cpuid with 4 arguments, repeating
+# arguments; for x86-64 we effectively pass the 1st in rdx and the 2nd in rcx.
+# This allows the same asm to work for both standard and Windoze calling
+# conventions.
+
+i?86-*-* | amd64-*-* | x86_64-*-*)
+ eval $set_cc_for_build
+
+ cat <<EOF >$dummy.c
+#include <string.h>
+#include <stdio.h>
+#define CPUID(a,b) cpuid(b,a,a,b)
+#if __cplusplus
+extern "C"
+#endif
+unsigned int cpuid (int, char *, char *, int);
+int
+main ()
+{
+ char vendor_string[13];
+ char dummy_string[12];
+ long fms;
+ int family, model, stepping;
+ const char *modelstr;
+ int cpu_64bit = 0;
+ int cpuid_64bit;
+
+ CPUID (vendor_string, 0);
+ vendor_string[12] = 0;
+
+ fms = CPUID (dummy_string, 1);
+
+ family = ((fms >> 8) & 0xf) + ((fms >> 20) & 0xff);
+ model = ((fms >> 4) & 0xf) + ((fms >> 12) & 0xf0);
+ stepping = fms & 0xf;
+
+ modelstr = "$guess_cpu";
+
+ /**************************************************/
+ /*** WARNING: keep this list in sync with fat.c ***/
+ /**************************************************/
+ if (strcmp (vendor_string, "GenuineIntel") == 0)
+ {
+ switch (family)
+ {
+ case 5:
+ if (model <= 2) modelstr = "pentium";
+ else if (model >= 4) modelstr = "pentiummmx";
+ break;
+ case 6:
+ if (model <= 1) modelstr = "pentiumpro";
+ else if (model <= 6) modelstr = "pentium2";
+ else if (model <= 8) modelstr = "pentium3";
+ else if (model <= 9) modelstr = "pentiumm";
+ else if (model <= 0x0c) modelstr = "pentium3";
+ else if (model <= 0x0e) modelstr = "pentiumm";
+ else if (model <= 0x19) cpu_64bit = 1, modelstr = "core2";
+ else if (model == 0x1a) cpu_64bit = 1, modelstr = "coreinhm"; /* NHM Gainestown */
+ else if (model == 0x1c) cpu_64bit = 1, modelstr = "atom"; /* Silverthorne */
+ else if (model == 0x1d) cpu_64bit = 1, modelstr = "core2"; /* PNR Dunnington */
+ else if (model == 0x1e) cpu_64bit = 1, modelstr = "coreinhm"; /* NHM Lynnfield/Jasper */
+ else if (model == 0x25) cpu_64bit = 1, modelstr = "coreiwsm"; /* WSM Clarkdale/Arrandale */
+ else if (model == 0x26) cpu_64bit = 1, modelstr = "atom"; /* Lincroft */
+ else if (model == 0x27) cpu_64bit = 1, modelstr = "atom"; /* Saltwell */
+ else if (model == 0x2a) cpu_64bit = 1, modelstr = "coreisbr"; /* SB */
+ else if (model == 0x2c) cpu_64bit = 1, modelstr = "coreiwsm"; /* WSM Gulftown */
+ else if (model == 0x2d) cpu_64bit = 1, modelstr = "coreisbr"; /* SBC-EP */
+ else if (model == 0x2e) cpu_64bit = 1, modelstr = "coreinhm"; /* NHM Beckton */
+ else if (model == 0x2f) cpu_64bit = 1, modelstr = "coreiwsm"; /* WSM Eagleton */
+ else if (model == 0x36) cpu_64bit = 1, modelstr = "atom"; /* Cedarview/Saltwell */
+ else if (model == 0x37) cpu_64bit = 1, modelstr = "coreinhm"; /* Atom Silvermont */
+ else if (model == 0x3a) cpu_64bit = 1, modelstr = "coreisbr"; /* IBR */
+ else if (model == 0x3c) cpu_64bit = 1, modelstr = "coreihwl"; /* Haswell client */
+ else if (model == 0x3d) cpu_64bit = 1, modelstr = "coreibwl"; /* Broadwell */
+ else if (model == 0x3e) cpu_64bit = 1, modelstr = "coreisbr"; /* Ivytown */
+ else if (model == 0x3f) cpu_64bit = 1, modelstr = "coreihwl"; /* Haswell server */
+ else if (model == 0x45) cpu_64bit = 1, modelstr = "coreihwl"; /* Haswell ULT */
+ else if (model == 0x46) cpu_64bit = 1, modelstr = "coreihwl"; /* Crystal Well */
+ else if (model == 0x4d) cpu_64bit = 1, modelstr = "coreinhm"; /* Silvermont/Avoton */
+ else if (model == 0x4f) cpu_64bit = 1, modelstr = "coreibwl"; /* Broadwell server */
+ else if (model == 0x56) cpu_64bit = 1, modelstr = "coreibwl"; /* Broadwell microserver */
+ else cpu_64bit = 1, modelstr = "corei"; /* default */
+
+ if (strcmp (modelstr, "coreihwl") == 0)
+ {
+ /* Some Haswells lack BMI2. Let them appear as Sandybridges for
+ now. */
+ CPUID (dummy_string, 7);
+ if ((dummy_string[0 + 8 / 8] & (1 << (8 % 8))) == 0)
+ modelstr = "coreisbr";
+ }
+
+ break;
+ case 15:
+ cpu_64bit = 1, modelstr = "pentium4";
+ break;
+ }
+ }
+ else if (strcmp (vendor_string, "AuthenticAMD") == 0)
+ {
+ switch (family)
+ {
+ case 5:
+ if (model <= 3) modelstr = "k5";
+ else if (model <= 7) modelstr = "k6";
+ else if (model == 8) modelstr = "k62";
+ else if (model == 9) modelstr = "k63";
+ else if (model == 10) modelstr = "geode";
+ else if (model == 13) modelstr = "k63";
+ break;
+ case 6:
+ modelstr = "athlon";
+ break;
+ case 15: /* K8, K9 */
+ cpu_64bit = 1, modelstr = "k8";
+ break;
+ case 16: /* K10 */
+ cpu_64bit = 1, modelstr = "k10";
+ break;
+ case 17: /* Hybrid k8/k10, claim k8 */
+ cpu_64bit = 1, modelstr = "k8";
+ break;
+ case 18: /* Llano, uses K10 core */
+ cpu_64bit = 1, modelstr = "k10";
+ break;
+ case 19: /* AMD Internal, assume future K10 */
+ cpu_64bit = 1, modelstr = "k10";
+ break;
+ case 20: /* Bobcat */
+ cpu_64bit = 1, modelstr = "bobcat";
+ break;
+ case 21: /* Bulldozer */
+ cpu_64bit = 1;
+ if (model <= 1)
+ modelstr = "bulldozer";
+ else if (model < 0x20) /* really 2, [0x10-0x20) */
+ modelstr = "piledriver";
+ else if (model < 0x40) /* really [0x30-0x40) */
+ modelstr = "steamroller";
+ else /* really [0x60-0x70) */
+ modelstr = "excavator";
+ break;
+ case 22: /* Jaguar, an improved bobcat */
+ cpu_64bit = 1, modelstr = "jaguar";
+ break;
+ }
+ }
+ else if (strcmp (vendor_string, "CyrixInstead") == 0)
+ {
+ /* Should recognize Cyrix' processors too. */
+ }
+ else if (strcmp (vendor_string, "CentaurHauls") == 0)
+ {
+ switch (family)
+ {
+ case 6:
+ if (model < 9) modelstr = "viac3";
+ else if (model < 15) modelstr = "viac32";
+ else cpu_64bit = 1, modelstr = "nano";
+ break;
+ }
+ }
+
+ CPUID (dummy_string, 0x80000001);
+ cpuid_64bit = (dummy_string[7] >> 5) & 1;
+
+ /* If our cpuid-based CPU identification thinks this is a 32-bit CPU but
+ cpuid claims AMD64 capabilities, then revert to the generic "x86_64".
+ This is of course wrong, but it can happen in some emulators, so this
+ workaround allows for successful 64-bit builds. */
+ if (cpuid_64bit && ! cpu_64bit)
+ modelstr = "x86_64";
+
+ printf ("%s", modelstr);
+ return 0;
+}
+EOF
+
+# The rcx/ecx zeroing here and in the variant below is needed for the BMI2
+# check.
+
+ cat <<EOF >${dummy}0.s
+ .globl cpuid
+ .globl _cpuid
+cpuid:
+_cpuid:
+ push %rbx
+ mov %rdx, %r8
+ mov %ecx, %eax
+ xor %ecx, %ecx
+ .byte 0x0f
+ .byte 0xa2
+ mov %ebx, (%r8)
+ mov %edx, 4(%r8)
+ mov %ecx, 8(%r8)
+ pop %rbx
+ ret
+EOF
+
+ if ($CC_FOR_BUILD ${dummy}0.s $dummy.c -o $dummy) >/dev/null 2>&1; then
+ # On 80386 and early 80486 cpuid is not available and will result in a
+ # SIGILL message, hence 2>/dev/null.
+ #
+ # On i386-unknown-freebsd4.9, "/bin/sh -c ./dummy" seems to send an
+ # "Illegal instruction (core dumped)" message to stdout, so we test $?
+ # to check if the program run was successful.
+ #
+ x=`$SHELL -c $dummy 2>/dev/null`
+ if test $? = 0 && test -n "$x"; then
+ exact_cpu=$x
+ fi
+ fi
+
+ cat <<EOF >${dummy}0.s
+ .globl cpuid
+ .globl _cpuid
+cpuid:
+_cpuid:
+ pushl %esi
+ pushl %ebx
+ movl 24(%esp),%eax
+ xor %ecx, %ecx
+ .byte 0x0f
+ .byte 0xa2
+ movl 20(%esp),%esi
+ movl %ebx,(%esi)
+ movl %edx,4(%esi)
+ movl %ecx,8(%esi)
+ popl %ebx
+ popl %esi
+ ret
+EOF
+
+ if test -z "$exact_cpu"; then
+ if ($CC_FOR_BUILD ${dummy}0.s $dummy.c -o $dummy) >/dev/null 2>&1; then
+ # On 80386 and early 80486 cpuid is not available and will result in a
+ # SIGILL message, hence 2>/dev/null.
+ #
+ # On i386-unknown-freebsd4.9, "/bin/sh -c ./dummy" seems to send an
+ # "Illegal instruction (core dumped)" message to stdout, so we test $?
+ # to check if the program run was successful.
+ #
+ x=`$SHELL -c $dummy 2>/dev/null`
+ if test $? = 0 && test -n "$x"; then
+ exact_cpu=$x
+ fi
+ fi
+ fi
+
+ # We need to remove some .o files here since lame C compilers
+ # generate these even when not asked.
+ ;;
+
+s390*-*-*)
+ model=`grep "^processor 0: version =" /proc/cpuinfo | sed -e 's/.*machine = //'`
+ case $model in
+ 2064 | 2066) zcpu="z900" ;;
+ 2084 | 2086) zcpu="z990" ;;
+ 2094 | 2096) zcpu="z9" ;;
+ 2097 | 2098) zcpu="z10" ;;
+ 2817 | 2818 | *) zcpu="z196" ;;
+ esac
+ case "$guess_full" in
+ s390x-*-*) exact_cpu=${zcpu} ;;
+ s390-*-*) exact_cpu=${zcpu}esa ;;
+ esac
+ ;;
+
+esac
+
+
+
+# -------------------------------------------------------------------------
+# Use an exact cpu, if possible
+
+if test -n "$exact_cpu"; then
+ echo "$exact_cpu$guess_rest"
+else
+ echo "$guess_full"
+fi
+exit 0
+
+
+
+# Local variables:
+# fill-column: 76
+# End:
diff --git a/Build/source/libs/gmp/gmp-6.0.0/configgmp.sub b/Build/source/libs/gmp/gmp-6.0.0/configgmp.sub
new file mode 100755
index 00000000000..d734c434580
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/configgmp.sub
@@ -0,0 +1,165 @@
+#! /bin/sh
+#
+# GMP config.sub wrapper.
+
+
+# Copyright 2000-2003, 2006, 2009-2014 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/.
+
+
+# Usage: config.sub CPU-VENDOR-OS
+# config.sub ALIAS
+#
+# Validate and canonicalize the given configuration name, with special
+# handling for GMP extra CPU names.
+#
+# When the CPU isn't special the whole name is simply passed straight
+# through to configfsf.sub.
+#
+# When the CPU is a GMP extra, configfsf.sub is run on a similar CPU that it
+# will recognise. For example "athlon-pc-freebsd3.5" is validated using
+# "i386-pc-freebsd3.5".
+#
+# Any canonicalizations made by configfsf.sub are preserved. For example
+# given "athlon-linux", configfsf.sub is called with "i386-linux" and will
+# give back "i386-pc-linux-gnu". "athlon" is then reinstated, so we print
+# "athlon-pc-linux-gnu".
+
+
+# Expect to find configfsf.sub in the same directory as this config.sub
+configfsf_sub="`echo \"$0\" | sed 's/config.sub$/configfsf.sub/'`"
+if test "$configfsf_sub" = "$0"; then
+ echo "Cannot derive configfsf.sub from $0" 1>&2
+ exit 1
+fi
+if test -f "$configfsf_sub"; then
+ :
+else
+ echo "$configfsf_sub not found" 1>&2
+ exit 1
+fi
+
+# Always run configfsf.sub with $SHELL, like autoconf does for config.sub
+SHELL=${CONFIG_SHELL-/bin/sh}
+
+# Identify ourselves on --version, --help, etc
+case "$1" in
+"" | -*)
+ echo "(GNU MP wrapped config.sub)" 1>&2
+ $SHELL $configfsf_sub "$@"
+ exit
+ ;;
+esac
+
+given_full="$1"
+given_cpu=`echo "$given_full" | sed 's/-.*$//'`
+given_rest=`echo "$given_full" | sed 's/^[^-]*//'`
+
+
+# Aliases for GMP extras
+case "$given_cpu" in
+ # configfsf.sub turns p5 into i586, instead use our exact cpu type
+ p5 | p54) given_cpu=pentium ;;
+ p55) given_cpu=pentiummmx ;;
+
+ # configfsf.sub turns p6, pentiumii and pentiumiii into i686, instead use
+ # our exact cpu types
+ p6) given_cpu=pentiumpro ;;
+ pentiumii) given_cpu=pentium2 ;;
+ pentiumiii) given_cpu=pentium3 ;;
+esac
+given_full="$given_cpu$given_rest"
+
+
+# GMP extras and what to use for the config.sub test
+case "$given_cpu" in
+itanium | itanium2)
+ test_cpu=ia64 ;;
+pentium | pentiummmx | pentiumpro | pentium[234m] | k[567] | k6[23] | geode | athlon | viac3*)
+ test_cpu=i386 ;;
+athlon64 | atom | core2 | corei | coreinhm | coreiwsm | coreisbr | coreihwl | coreibwl | opteron | k[89] | k10 | bobcat | jaguar | bulldozer | piledriver | steamroller | excavator | nano)
+ test_cpu=x86_64 ;;
+power[2-9] | power2sc)
+ test_cpu=power ;;
+powerpc401 | powerpc403 | powerpc405 | \
+powerpc505 | \
+powerpc601 | powerpc602 | \
+powerpc603 | powerpc603e | \
+powerpc604 | powerpc604e | \
+powerpc620 | powerpc630 | powerpc970 | \
+powerpc740 | powerpc7400 | powerpc7450 | powerpc750 | \
+powerpc801 | powerpc821 | powerpc823 | powerpc860 | \
+powerpc64)
+ test_cpu=powerpc ;;
+sparcv8 | supersparc | microsparc | \
+ultrasparc | ultrasparc2 | ultrasparc2i | ultrasparc3 | ultrasparct[1234])
+ test_cpu=sparc ;;
+sh2)
+ test_cpu=sh ;;
+
+z900 | z990 | z9 | z10 | z196)
+ test_cpu=s390x;;
+z900esa | z990esa | z9esa | z10esa | z196esa)
+ test_cpu=s390;;
+
+armsa1 | armxscale | arm9tdmi | arm9te | \
+arm10* | arm11mpcore | armsa1 | arm1136 | arm1156 | arm1176 | \
+armcortexa5 | armcortexa7 | armcortexa8 | armcortexa9 | armcortexa15 | \
+armcortexr4 | armcortexr5 | armcortexm3)
+ test_cpu="arm";;
+
+*)
+ # Don't need or want to change the given name, just run configfsf.sub
+ $SHELL $configfsf_sub "$given_full"
+ if test $? = 0; then
+ exit 0
+ else
+ echo "(GNU MP wrapped config.sub, testing \"$given_full\")"
+ exit 1
+ fi
+esac
+
+
+test_full="$test_cpu$given_rest"
+canonical_full=`$SHELL $configfsf_sub "$test_full"`
+if test $? = 0; then
+ :
+else
+ echo "(GNU MP wrapped config.sub, testing \"$given_full\" as \"$test_full\")"
+ exit 1
+fi
+
+canonical_rest=`echo "$canonical_full" | sed 's/^[^-]*//'`
+echo "$given_cpu$canonical_rest"
+exit 0
+
+
+
+# Local variables:
+# fill-column: 76
+# End:
diff --git a/Build/source/libs/gmp/gmp-6.0.0/configure.ac b/Build/source/libs/gmp/gmp-6.0.0/configure.ac
new file mode 100644
index 00000000000..64b2c50957f
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/configure.ac
@@ -0,0 +1,3816 @@
+dnl Process this file with autoconf to produce a configure script.
+
+
+define(GMP_COPYRIGHT,[[
+
+Copyright 1996-2014 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/.
+]])
+
+AC_COPYRIGHT(GMP_COPYRIGHT)
+AH_TOP(/*GMP_COPYRIGHT*/)
+
+AC_REVISION($Revision$)
+AC_PREREQ(2.59)
+AC_INIT(GNU MP, GMP_VERSION, [gmp-bugs@gmplib.org, see https://gmplib.org/manual/Reporting-Bugs.html], gmp)
+AC_CONFIG_SRCDIR(gmp-impl.h)
+m4_pattern_forbid([^[ \t]*GMP_])
+m4_pattern_allow(GMP_LDFLAGS)
+m4_pattern_allow(GMP_LIMB_BITS)
+m4_pattern_allow(GMP_MPARAM_H_SUGGEST)
+m4_pattern_allow(GMP_NAIL_BITS)
+m4_pattern_allow(GMP_NUMB_BITS)
+m4_pattern_allow(GMP_NONSTD_ABI)
+m4_pattern_allow(GMP_CPU_TYPE)
+
+# If --target is not used then $target_alias is empty, but if say
+# "./configure athlon-pc-freebsd3.5" is used, then all three of
+# $build_alias, $host_alias and $target_alias are set to
+# "athlon-pc-freebsd3.5".
+#
+if test -n "$target_alias" && test "$target_alias" != "$host_alias"; then
+ AC_MSG_ERROR([--target is not appropriate for GMP
+Use --build=CPU-VENDOR-OS if you need to specify your CPU and/or system
+explicitly. Use --host if cross-compiling (see "Installing GMP" in the
+manual for more on this).])
+fi
+
+GMP_INIT(config.m4)
+
+AC_CANONICAL_HOST
+
+dnl Automake "no-dependencies" is used because include file dependencies
+dnl are not useful to us. Pretty much everything depends just on gmp.h,
+dnl gmp-impl.h and longlong.h, and yet only rarely does everything need to
+dnl be rebuilt for changes to those files.
+dnl
+dnl "no-dependencies" also helps with the way we're setup to run
+dnl AC_PROG_CXX only conditionally. If dependencies are used then recent
+dnl automake (eg 1.7.2) appends an AM_CONDITIONAL to AC_PROG_CXX, and then
+dnl gets upset if it's not actually executed.
+dnl
+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])
+AC_CONFIG_HEADERS(config.h:config.in)
+AM_MAINTAINER_MODE
+
+
+AC_ARG_ENABLE(assert,
+AC_HELP_STRING([--enable-assert],[enable ASSERT checking [[default=no]]]),
+[case $enableval in
+yes|no) ;;
+*) AC_MSG_ERROR([bad value $enableval for --enable-assert, need yes or no]) ;;
+esac],
+[enable_assert=no])
+
+if test "$enable_assert" = "yes"; then
+ AC_DEFINE(WANT_ASSERT,1,
+ [Define to 1 to enable ASSERT checking, per --enable-assert])
+ want_assert_01=1
+else
+ want_assert_01=0
+fi
+GMP_DEFINE_RAW(["define(<WANT_ASSERT>,$want_assert_01)"])
+
+
+AC_ARG_ENABLE(alloca,
+AC_HELP_STRING([--enable-alloca],[how to get temp memory [[default=reentrant]]]),
+[case $enableval in
+alloca|malloc-reentrant|malloc-notreentrant) ;;
+yes|no|reentrant|notreentrant) ;;
+debug) ;;
+*)
+ AC_MSG_ERROR([bad value $enableval for --enable-alloca, need one of:
+yes no reentrant notreentrant alloca malloc-reentrant malloc-notreentrant debug]) ;;
+esac],
+[enable_alloca=reentrant])
+
+
+# IMPROVE ME: The default for C++ is disabled. The tests currently
+# performed below for a working C++ compiler are not particularly strong,
+# and in general can't be expected to get the right setup on their own. The
+# most significant problem is getting the ABI the same. Defaulting CXXFLAGS
+# to CFLAGS takes only a small step towards this. It's also probably worth
+# worrying whether the C and C++ runtimes from say gcc and a vendor C++ can
+# work together. Some rather broken C++ installations were encountered
+# during testing, and though such things clearly aren't GMP's problem, if
+# --enable-cxx=detect were to be the default then some careful checks of
+# which, if any, C++ compiler on the system is up to scratch would be
+# wanted.
+#
+AC_ARG_ENABLE(cxx,
+AC_HELP_STRING([--enable-cxx],[enable C++ support [[default=no]]]),
+[case $enableval in
+yes|no|detect) ;;
+*) AC_MSG_ERROR([bad value $enableval for --enable-cxx, need yes/no/detect]) ;;
+esac],
+[enable_cxx=no])
+
+
+AC_ARG_ENABLE(assembly,
+AC_HELP_STRING([--enable-assembly],[enable the use of assembly loops [[default=yes]]]),
+[case $enableval in
+yes|no) ;;
+*) AC_MSG_ERROR([bad value $enableval for --enable-assembly, need yes or no]) ;;
+esac],
+[enable_assembly=yes])
+
+if test "$enable_assembly" = "yes"; then
+ AC_DEFINE(WANT_ASSEMBLY,1,
+ [Defined to 1 as per --enable-assembly])
+fi
+
+
+AC_ARG_ENABLE(fft,
+AC_HELP_STRING([--enable-fft],[enable FFTs for multiplication [[default=yes]]]),
+[case $enableval in
+yes|no) ;;
+*) AC_MSG_ERROR([bad value $enableval for --enable-fft, need yes or no]) ;;
+esac],
+[enable_fft=yes])
+
+if test "$enable_fft" = "yes"; then
+ AC_DEFINE(WANT_FFT,1,
+ [Define to 1 to enable FFTs for multiplication, per --enable-fft])
+fi
+
+
+AC_ARG_ENABLE(old-fft-full,
+AC_HELP_STRING([--enable-old-fft-full],[enable old mpn_mul_fft_full for multiplication [[default=no]]]),
+[case $enableval in
+yes|no) ;;
+*) AC_MSG_ERROR([bad value $enableval for --enable-old-fft-full, need yes or no]) ;;
+esac],
+[enable_old_fft_full=no])
+
+if test "$enable_old_fft_full" = "yes"; then
+ AC_DEFINE(WANT_OLD_FFT_FULL,1,
+ [Define to 1 to enable old mpn_mul_fft_full for multiplication, per --enable-old-fft-full])
+fi
+
+
+AC_ARG_ENABLE(nails,
+AC_HELP_STRING([--enable-nails],[use nails on limbs [[default=no]]]),
+[case $enableval in
+[yes|no|[02468]|[0-9][02468]]) ;;
+[*[13579]])
+ AC_MSG_ERROR([bad value $enableval for --enable-nails, only even nail sizes supported]) ;;
+*)
+ AC_MSG_ERROR([bad value $enableval for --enable-nails, need yes/no/number]) ;;
+esac],
+[enable_nails=no])
+
+case $enable_nails in
+yes) GMP_NAIL_BITS=2 ;;
+no) GMP_NAIL_BITS=0 ;;
+*) GMP_NAIL_BITS=$enable_nails ;;
+esac
+AC_SUBST(GMP_NAIL_BITS)
+
+
+AC_ARG_ENABLE(profiling,
+AC_HELP_STRING([--enable-profiling],
+ [build with profiler support [[default=no]]]),
+[case $enableval in
+no|prof|gprof|instrument) ;;
+*) AC_MSG_ERROR([bad value $enableval for --enable-profiling, need no/prof/gprof/instrument]) ;;
+esac],
+[enable_profiling=no])
+
+case $enable_profiling in
+ prof)
+ AC_DEFINE(WANT_PROFILING_PROF, 1,
+ [Define to 1 if --enable-profiling=prof])
+ ;;
+ gprof)
+ AC_DEFINE(WANT_PROFILING_GPROF, 1,
+ [Define to 1 if --enable-profiling=gprof])
+ ;;
+ instrument)
+ AC_DEFINE(WANT_PROFILING_INSTRUMENT, 1,
+ [Define to 1 if --enable-profiling=instrument])
+ ;;
+esac
+
+GMP_DEFINE_RAW(["define(<WANT_PROFILING>,<\`$enable_profiling'>)"])
+
+# -fomit-frame-pointer is incompatible with -pg on some chips
+if test "$enable_profiling" = gprof; then
+ fomit_frame_pointer=
+else
+ fomit_frame_pointer="-fomit-frame-pointer"
+fi
+
+
+AC_ARG_WITH(readline,
+AC_HELP_STRING([--with-readline],
+ [readline support in calc demo program [[default=detect]]]),
+[case $withval in
+yes|no|detect) ;;
+*) AC_MSG_ERROR([bad value $withval for --with-readline, need yes/no/detect]) ;;
+esac],
+[with_readline=detect])
+
+
+AC_ARG_ENABLE(fat,
+AC_HELP_STRING([--enable-fat],
+ [build a fat binary on systems that support it [[default=no]]]),
+[case $enableval in
+yes|no) ;;
+*) AC_MSG_ERROR([bad value $enableval for --enable-fat, need yes or no]) ;;
+esac],
+[enable_fat=no])
+
+
+AC_ARG_ENABLE(minithres,
+AC_HELP_STRING([--enable-minithres],
+ [choose minimal thresholds for testing [[default=no]]]),
+[case $enableval in
+yes|no) ;;
+*) AC_MSG_ERROR([bad value $enableval for --enable-minithres, need yes or no]) ;;
+esac],
+[enable_minithres=no])
+
+
+AC_ARG_ENABLE(fake-cpuid,
+AC_HELP_STRING([--enable-fake-cpuid],[enable GMP_CPU_TYPE faking cpuid [[default=no]]]),
+[case $enableval in
+yes|no) ;;
+*) AC_MSG_ERROR([bad value $enableval for --enable-fake-cpuid, need yes or no]) ;;
+esac],
+[enable_fake_cpuid=no])
+
+if test "$enable_fake_cpuid" = "yes"; then
+ AC_DEFINE(WANT_FAKE_CPUID,1,
+ [Define to 1 to enable GMP_CPU_TYPE faking cpuid, per --enable-fake-cpuid])
+fi
+
+
+if test $enable_fat = yes && test $enable_assembly = no ; then
+ AC_MSG_ERROR([when doing a fat build, disabling assembly will not work])
+fi
+
+if test $enable_fake_cpuid = yes && test $enable_fat = no ; then
+ AC_MSG_ERROR([--enable-fake-cpuid requires --enable-fat])
+fi
+
+
+tmp_host=`echo $host_cpu | sed 's/\./_/'`
+AC_DEFINE_UNQUOTED(HAVE_HOST_CPU_$tmp_host)
+GMP_DEFINE_RAW("define_not_for_expansion(\`HAVE_HOST_CPU_$tmp_host')", POST)
+
+dnl The HAVE_HOST_CPU_ list here only needs to have entries for those which
+dnl are going to be tested, not everything that can possibly be selected.
+dnl
+dnl The HAVE_HOST_CPU_FAMILY_ list similarly, and note that the AC_DEFINEs
+dnl for these are under the cpu specific setups below.
+
+AH_VERBATIM([HAVE_HOST_CPU_1],
+[/* Define one of these to 1 for the host CPU family.
+ If your CPU is not in any of these families, leave all undefined.
+ For an AMD64 chip, define "x86" in ABI=32, but not in ABI=64. */
+#undef HAVE_HOST_CPU_FAMILY_alpha
+#undef HAVE_HOST_CPU_FAMILY_m68k
+#undef HAVE_HOST_CPU_FAMILY_power
+#undef HAVE_HOST_CPU_FAMILY_powerpc
+#undef HAVE_HOST_CPU_FAMILY_x86
+#undef HAVE_HOST_CPU_FAMILY_x86_64
+
+/* Define one of the following to 1 for the host CPU, as per the output of
+ ./config.guess. If your CPU is not listed here, leave all undefined. */
+#undef HAVE_HOST_CPU_alphaev67
+#undef HAVE_HOST_CPU_alphaev68
+#undef HAVE_HOST_CPU_alphaev7
+#undef HAVE_HOST_CPU_m68020
+#undef HAVE_HOST_CPU_m68030
+#undef HAVE_HOST_CPU_m68040
+#undef HAVE_HOST_CPU_m68060
+#undef HAVE_HOST_CPU_m68360
+#undef HAVE_HOST_CPU_powerpc604
+#undef HAVE_HOST_CPU_powerpc604e
+#undef HAVE_HOST_CPU_powerpc750
+#undef HAVE_HOST_CPU_powerpc7400
+#undef HAVE_HOST_CPU_supersparc
+#undef HAVE_HOST_CPU_i386
+#undef HAVE_HOST_CPU_i586
+#undef HAVE_HOST_CPU_i686
+#undef HAVE_HOST_CPU_pentium
+#undef HAVE_HOST_CPU_pentiummmx
+#undef HAVE_HOST_CPU_pentiumpro
+#undef HAVE_HOST_CPU_pentium2
+#undef HAVE_HOST_CPU_pentium3
+#undef HAVE_HOST_CPU_s390_z900
+#undef HAVE_HOST_CPU_s390_z990
+#undef HAVE_HOST_CPU_s390_z9
+#undef HAVE_HOST_CPU_s390_z10
+#undef HAVE_HOST_CPU_s390_z196
+
+/* Define to 1 iff we have a s390 with 64-bit registers. */
+#undef HAVE_HOST_CPU_s390_zarch])
+
+
+# Table of compilers, options, and mpn paths. This code has various related
+# purposes
+#
+# - better default CC/CFLAGS selections than autoconf otherwise gives
+# - default CC/CFLAGS selections for extra CPU types specific to GMP
+# - a few tests for known bad compilers
+# - choice of ABIs on suitable systems
+# - selection of corresponding mpn search path
+#
+# After GMP specific searches and tests, the standard autoconf AC_PROG_CC is
+# called. User selections of CC etc are respected.
+#
+# Care is taken not to use macros like AC_TRY_COMPILE during the GMP
+# pre-testing, since they of course depend on AC_PROG_CC, and also some of
+# them cache their results, which is not wanted.
+#
+# The ABI selection mechanism is unique to GMP. All that reaches autoconf
+# is a different selection of CC/CFLAGS according to the best ABI the system
+# supports, and/or what the user selects. Naturally the mpn assembler code
+# selected is very dependent on the ABI.
+#
+# The closest the standard tools come to a notion of ABI is something like
+# "sparc64" which encodes a CPU and an ABI together. This doesn't seem to
+# scale well for GMP, where exact CPU types like "ultrasparc2" are wanted,
+# separate from the ABI used on them.
+#
+#
+# The variables set here are
+#
+# cclist the compiler choices
+# xx_cflags flags for compiler xx
+# xx_cflags_maybe flags for compiler xx, if they work
+# xx_cppflags cpp flags for compiler xx
+# xx_cflags_optlist list of sets of optional flags
+# xx_cflags_yyy set yyy of optional flags for compiler xx
+# xx_ldflags -Wc,-foo flags for libtool linking with compiler xx
+# ar_flags extra flags for $AR
+# nm_flags extra flags for $NM
+# limb limb size, can be "longlong"
+# path mpn search path
+# extra_functions extra mpn functions
+# fat_path fat binary mpn search path [if fat binary desired]
+# fat_functions fat functions
+# fat_thresholds fat thresholds
+#
+# Suppose xx_cflags_optlist="arch", then flags from $xx_cflags_arch are
+# tried, and the first flag that works will be used. An optlist like "arch
+# cpu optimize" can be used to get multiple independent sets of flags tried.
+# The first that works from each will be used. If no flag in a set works
+# then nothing from that set is added.
+#
+# For multiple ABIs, the scheme extends as follows.
+#
+# abilist set of ABI choices
+# cclist_aa compiler choices in ABI aa
+# xx_aa_cflags flags for xx in ABI aa
+# xx_aa_cflags_maybe flags for xx in ABI aa, if they work
+# xx_aa_cppflags cpp flags for xx in ABI aa
+# xx_aa_cflags_optlist list of sets of optional flags in ABI aa
+# xx_aa_cflags_yyy set yyy of optional flags for compiler xx in ABI aa
+# xx_aa_ldflags -Wc,-foo flags for libtool linking
+# ar_aa_flags extra flags for $AR in ABI aa
+# nm_aa_flags extra flags for $NM in ABI aa
+# limb_aa limb size in ABI aa, can be "longlong"
+# path_aa mpn search path in ABI aa
+# extra_functions_aa extra mpn functions in ABI aa
+#
+# As a convenience, the unadorned xx_cflags (etc) are used for the last ABI
+# in ablist, if an xx_aa_cflags for that ABI isn't given. For example if
+# abilist="64 32" then $cc_64_cflags will be used for the 64-bit ABI, but
+# for the 32-bit either $cc_32_cflags or $cc_cflags is used, whichever is
+# defined. This makes it easy to add some 64-bit compilers and flags to an
+# unadorned 32-bit set.
+#
+# limb=longlong (or limb_aa=longlong) applies to all compilers within that
+# ABI. It won't work to have some needing long long and some not, since a
+# single instantiated gmp.h will be used by both.
+#
+# SPEED_CYCLECOUNTER, cyclecounter_size and CALLING_CONVENTIONS_OBJS are
+# also set here, with an ABI suffix.
+#
+#
+#
+# A table-driven approach like this to mapping cpu type to good compiler
+# options is a bit of a maintenance burden, but there's not much uniformity
+# between options specifications on different compilers. Some sort of
+# separately updatable tool might be cute.
+#
+# The use of lots of variables like this, direct and indirect, tends to
+# obscure when and how various things are done, but unfortunately it's
+# pretty much the only way. If shell subroutines were portable then actual
+# code like "if this .. do that" could be written, but attempting the same
+# with full copies of GMP_PROG_CC_WORKS etc expanded at every point would
+# hugely bloat the output.
+
+
+AC_ARG_VAR(ABI, [desired ABI (for processors supporting more than one ABI)])
+
+# abilist needs to be non-empty, "standard" is just a generic name here
+abilist="standard"
+
+# FIXME: We'd like to prefer an ANSI compiler, perhaps by preferring
+# c89 over cc here. But note that on HP-UX c89 provides a castrated
+# environment, and would want to be excluded somehow. Maybe
+# AC_PROG_CC_STDC already does enough to stick cc into ANSI mode and
+# we don't need to worry.
+#
+cclist="gcc cc"
+
+gcc_cflags="-O2 -pedantic"
+gcc_64_cflags="-O2 -pedantic"
+cc_cflags="-O"
+cc_64_cflags="-O"
+
+SPEED_CYCLECOUNTER_OBJ=
+cyclecounter_size=2
+
+AC_SUBST(HAVE_HOST_CPU_FAMILY_power, 0)
+AC_SUBST(HAVE_HOST_CPU_FAMILY_powerpc,0)
+
+case $host in
+
+ alpha*-*-*)
+ AC_DEFINE(HAVE_HOST_CPU_FAMILY_alpha)
+ case $host_cpu in
+ alphaev5* | alphapca5*)
+ path="alpha/ev5 alpha" ;;
+ alphaev67 | alphaev68 | alphaev7*)
+ path="alpha/ev67 alpha/ev6 alpha" ;;
+ alphaev6)
+ path="alpha/ev6 alpha" ;;
+ *)
+ path="alpha" ;;
+ esac
+ if test "$enable_assembly" = "yes" ; then
+ extra_functions="cntlz"
+ fi
+ gcc_cflags_optlist="asm cpu oldas" # need asm ahead of cpu, see below
+ gcc_cflags_maybe="-mieee"
+ gcc_cflags_oldas="-Wa,-oldas" # see GMP_GCC_WA_OLDAS.
+
+ # gcc 2.7.2.3 doesn't know any -mcpu= for alpha, apparently.
+ # gcc 2.95 knows -mcpu= ev4, ev5, ev56, pca56, ev6.
+ # gcc 3.0 adds nothing.
+ # gcc 3.1 adds ev45, ev67 (but ev45 is the same as ev4).
+ # gcc 3.2 adds nothing.
+ #
+ # gcc version "2.9-gnupro-99r1" under "-O2 -mcpu=ev6" strikes internal
+ # compiler errors too easily and is rejected by GMP_PROG_CC_WORKS. Each
+ # -mcpu=ev6 below has a fallback to -mcpu=ev56 for this reason.
+ #
+ case $host_cpu in
+ alpha) gcc_cflags_cpu="-mcpu=ev4" ;;
+ alphaev5) gcc_cflags_cpu="-mcpu=ev5" ;;
+ alphaev56) gcc_cflags_cpu="-mcpu=ev56" ;;
+ alphapca56 | alphapca57)
+ gcc_cflags_cpu="-mcpu=pca56" ;;
+ alphaev6) gcc_cflags_cpu="-mcpu=ev6 -mcpu=ev56" ;;
+ alphaev67 | alphaev68 | alphaev7*)
+ gcc_cflags_cpu="-mcpu=ev67 -mcpu=ev6 -mcpu=ev56" ;;
+ esac
+
+ # gcc version "2.9-gnupro-99r1" on alphaev68-dec-osf5.1 has been seen
+ # accepting -mcpu=ev6, but not putting the assembler in the right mode
+ # for what it produces. We need to do this for it, and need to do it
+ # before testing the -mcpu options.
+ #
+ # On old versions of gcc, which don't know -mcpu=, we believe an
+ # explicit -Wa,-mev5 etc will be necessary to put the assembler in
+ # the right mode for our .asm files and longlong.h asm blocks.
+ #
+ # On newer versions of gcc, when -mcpu= is known, we must give a -Wa
+ # which is at least as high as the code gcc will generate. gcc
+ # establishes what it needs with a ".arch" directive, our command line
+ # option seems to override that.
+ #
+ # gas prior to 2.14 doesn't accept -mev67, but -mev6 seems enough for
+ # ctlz and cttz (in 2.10.0 at least).
+ #
+ # OSF `as' accepts ev68 but stupidly treats it as ev4. -arch only seems
+ # to affect insns like ldbu which are expanded as macros when necessary.
+ # Insns like ctlz which were never available as macros are always
+ # accepted and always generate their plain code.
+ #
+ case $host_cpu in
+ alpha) gcc_cflags_asm="-Wa,-arch,ev4 -Wa,-mev4" ;;
+ alphaev5) gcc_cflags_asm="-Wa,-arch,ev5 -Wa,-mev5" ;;
+ alphaev56) gcc_cflags_asm="-Wa,-arch,ev56 -Wa,-mev56" ;;
+ alphapca56 | alphapca57)
+ gcc_cflags_asm="-Wa,-arch,pca56 -Wa,-mpca56" ;;
+ alphaev6) gcc_cflags_asm="-Wa,-arch,ev6 -Wa,-mev6" ;;
+ alphaev67 | alphaev68 | alphaev7*)
+ gcc_cflags_asm="-Wa,-arch,ev67 -Wa,-mev67 -Wa,-arch,ev6 -Wa,-mev6" ;;
+ esac
+
+ # It might be better to ask "cc" whether it's Cray C or DEC C,
+ # instead of relying on the OS part of $host. But it's hard to
+ # imagine either of those compilers anywhere except their native
+ # systems.
+ #
+ GMP_INCLUDE_MPN(alpha/alpha-defs.m4)
+ case $host in
+ *-cray-unicos*)
+ cc_cflags="-O" # no -g, it silently disables all optimizations
+ GMP_INCLUDE_MPN(alpha/unicos.m4)
+ # Don't perform any assembly syntax tests on this beast.
+ gmp_asm_syntax_testing=no
+ ;;
+ *-*-osf*)
+ GMP_INCLUDE_MPN(alpha/default.m4)
+ cc_cflags=""
+ cc_cflags_optlist="opt cpu"
+
+ # not sure if -fast works on old versions, so make it optional
+ cc_cflags_opt="-fast -O2"
+
+ # DEC C V5.9-005 knows ev4, ev5, ev56, pca56, ev6.
+ # Compaq C V6.3-029 adds ev67.
+ #
+ case $host_cpu in
+ alpha) cc_cflags_cpu="-arch~ev4~-tune~ev4" ;;
+ alphaev5) cc_cflags_cpu="-arch~ev5~-tune~ev5" ;;
+ alphaev56) cc_cflags_cpu="-arch~ev56~-tune~ev56" ;;
+ alphapca56 | alphapca57)
+ cc_cflags_cpu="-arch~pca56~-tune~pca56" ;;
+ alphaev6) cc_cflags_cpu="-arch~ev6~-tune~ev6" ;;
+ alphaev67 | alphaev68 | alphaev7*)
+ cc_cflags_cpu="-arch~ev67~-tune~ev67 -arch~ev6~-tune~ev6" ;;
+ esac
+ ;;
+ *)
+ GMP_INCLUDE_MPN(alpha/default.m4)
+ ;;
+ esac
+
+ case $host in
+ *-*-unicos*)
+ # tune/alpha.asm assumes int==4bytes but unicos uses int==8bytes
+ ;;
+ *)
+ SPEED_CYCLECOUNTER_OBJ=alpha.lo
+ cyclecounter_size=1 ;;
+ esac
+ ;;
+
+
+ # Cray vector machines.
+ # This must come after alpha* so that we can recognize present and future
+ # vector processors with a wildcard.
+ *-cray-unicos*)
+ gmp_asm_syntax_testing=no
+ cclist="cc"
+ # We used to have -hscalar0 here as a workaround for miscompilation of
+ # mpz/import.c, but let's hope Cray fixes their bugs instead, since
+ # -hscalar0 causes disastrously poor code to be generated.
+ cc_cflags="-O3 -hnofastmd -htask0 -Wa,-B"
+ path="cray"
+ ;;
+
+
+ arm64*-*-* | aarch64*-*-*)
+ path="arm64"
+ ;;
+
+
+ arm*-*-*)
+ gcc_cflags="$gcc_cflags $fomit_frame_pointer"
+ gcc_cflags_optlist="arch neon tune"
+ gcc_cflags_maybe="-marm"
+ gcc_testlist="gcc-arm-umodsi"
+ GMP_INCLUDE_MPN(arm/arm-defs.m4)
+ CALLING_CONVENTIONS_OBJS='arm32call.lo arm32check.lo'
+
+ # FIXME: We make mandatory compiler options optional here. We should
+ # either enforce them, or organise to strip paths as the corresponding
+ # options fail.
+ case $host_cpu in
+ armsa1 | arm9tdmi | armv4*)
+ path="arm"
+ gcc_cflags_arch="-march=armv4"
+ ;;
+ armxscale | arm9te | arm10 | armv5*)
+ path="arm/v5 arm"
+ gcc_cflags_arch="-march=armv5"
+ ;;
+ arm11mpcore | arm1136 | arm1176 | armv6*)
+ path="arm/v6 arm/v5 arm"
+ gcc_cflags_arch="-march=armv6"
+ ;;
+ arm1156)
+ path="arm/v6t2 arm/v6 arm/v5 arm"
+ gcc_cflags_arch="-march=armv6t2"
+ ;;
+ armcortexa5 | armv7a*)
+ path="arm/v6t2 arm/v6 arm/v5 arm"
+ gcc_cflags_arch="-march=armv7-a"
+ ;;
+ armcortexa8)
+ path="arm/v6t2 arm/v6 arm/v5 arm"
+ gcc_cflags_arch="-march=armv7-a"
+ gcc_cflags_tune="-mtune=cortex-a8"
+ ;;
+ armcortexa8neon)
+ path="arm/v6t2 arm/v6 arm/v5 arm/neon arm"
+ gcc_cflags_arch="-march=armv7-a"
+ gcc_cflags_neon="-mfpu=neon"
+ gcc_cflags_tune="-mtune=cortex-a8"
+ ;;
+ armcortexa9)
+ path="arm/v7a/cora9 arm/v6t2 arm/v6 arm/v5 arm"
+ gcc_cflags_arch="-march=armv7-a"
+ gcc_cflags_tune="-mtune=cortex-a9"
+ ;;
+ armcortexa9neon)
+ path="arm/v7a/cora9 arm/v6t2 arm/v6 arm/v5 arm/neon arm"
+ gcc_cflags_arch="-march=armv7-a"
+ gcc_cflags_neon="-mfpu=neon"
+ gcc_cflags_tune="-mtune=cortex-a9"
+ ;;
+ armcortexa15)
+ path="arm/v7a/cora15 arm/v6t2 arm/v6 arm/v5 arm"
+ gcc_cflags_arch="-march=armv7-a"
+ gcc_cflags_tune="-mtune=cortex-a15 -mtune=cortex-a9"
+ ;;
+ armcortexa15neon)
+ path="arm/v7a/cora15/neon arm/v7a/cora15 arm/v6t2 arm/v6 arm/v5 arm/neon arm"
+ gcc_cflags_arch="-march=armv7-a"
+ gcc_cflags_neon="-mfpu=neon"
+ gcc_cflags_tune="-mtune=cortex-a15 -mtune=cortex-a9"
+ ;;
+ *)
+ path="arm"
+ ;;
+ esac
+ ;;
+
+
+ # Fujitsu
+ [f30[01]-fujitsu-sysv*])
+ cclist="gcc vcc"
+ # FIXME: flags for vcc?
+ vcc_cflags="-g"
+ path="fujitsu"
+ ;;
+
+
+ hppa*-*-*)
+ # HP cc (the one sold separately) is K&R by default, but AM_C_PROTOTYPES
+ # will add "-Ae", or "-Aa -D_HPUX_SOURCE", to put it into ansi mode, if
+ # possible.
+ #
+ # gcc for hppa 2.0 can be built either for 2.0n (32-bit) or 2.0w
+ # (64-bit), but not both, so there's no option to choose the desired
+ # mode, we must instead detect which of the two it is. This is done by
+ # checking sizeof(long), either 4 or 8 bytes respectively. Do this in
+ # ABI=1.0 too, in case someone tries to build that with a 2.0w gcc.
+ #
+ gcc_cflags_optlist="arch"
+ gcc_testlist="sizeof-long-4"
+ SPEED_CYCLECOUNTER_OBJ=hppa.lo
+ cyclecounter_size=1
+
+ # FIXME: For hppa2.0*, path should be "pa32/hppa2_0 pa32/hppa1_1 pa32".
+ # (Can't remember why this isn't done already, have to check what .asm
+ # files are available in each and how they run on a typical 2.0 cpu.)
+ #
+ case $host_cpu in
+ hppa1.0*) path="pa32" ;;
+ hppa7000*) path="pa32/hppa1_1 pa32" ;;
+ hppa2.0* | hppa64)
+ path="pa32/hppa2_0 pa32/hppa1_1/pa7100 pa32/hppa1_1 pa32" ;;
+ *) # default to 7100
+ path="pa32/hppa1_1/pa7100 pa32/hppa1_1 pa32" ;;
+ esac
+
+ # gcc 2.7.2.3 knows -mpa-risc-1-0 and -mpa-risc-1-1
+ # gcc 2.95 adds -mpa-risc-2-0, plus synonyms -march=1.0, 1.1 and 2.0
+ #
+ # We don't use -mpa-risc-2-0 in ABI=1.0 because 64-bit registers may not
+ # be saved by the kernel on an old system. Actually gcc (as of 3.2)
+ # only adds a few float instructions with -mpa-risc-2-0, so it would
+ # probably be safe, but let's not take the chance. In any case, a
+ # configuration like --host=hppa2.0 ABI=1.0 is far from optimal.
+ #
+ case $host_cpu in
+ hppa1.0*) gcc_cflags_arch="-mpa-risc-1-0" ;;
+ *) # default to 7100
+ gcc_cflags_arch="-mpa-risc-1-1" ;;
+ esac
+
+ case $host_cpu in
+ hppa1.0*) cc_cflags="+O2" ;;
+ *) # default to 7100
+ cc_cflags="+DA1.1 +O2" ;;
+ esac
+
+ case $host in
+ hppa2.0*-*-* | hppa64-*-*)
+ cclist_20n="gcc cc"
+ abilist="2.0n 1.0"
+ path_20n="pa64"
+ limb_20n=longlong
+ any_20n_testlist="sizeof-long-4"
+ SPEED_CYCLECOUNTER_OBJ_20n=hppa2.lo
+ cyclecounter_size_20n=2
+
+ # -mpa-risc-2-0 is only an optional flag, in case an old gcc is
+ # used. Assembler support for 2.0 is essential though, for our asm
+ # files.
+ gcc_20n_cflags="$gcc_cflags"
+ gcc_20n_cflags_optlist="arch"
+ gcc_20n_cflags_arch="-mpa-risc-2-0 -mpa-risc-1-1"
+ gcc_20n_testlist="sizeof-long-4 hppa-level-2.0"
+
+ cc_20n_cflags="+DA2.0 +e +O2 -Wl,+vnocompatwarnings"
+ cc_20n_testlist="hpc-hppa-2-0"
+
+ # ABI=2.0w is available for hppa2.0w and hppa2.0, but not for
+ # hppa2.0n, on the assumption that that the latter indicates a
+ # desire for ABI=2.0n.
+ case $host in
+ hppa2.0n-*-*) ;;
+ *)
+ # HPUX 10 and earlier cannot run 2.0w. Not sure about other
+ # 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
+
+ cclist_20w="gcc cc"
+ gcc_20w_cflags="$gcc_cflags -mpa-risc-2-0"
+ cc_20w_cflags="+DD64 +O2"
+ cc_20w_testlist="hpc-hppa-2-0"
+ path_20w="pa64"
+ any_20w_testlist="sizeof-long-8"
+ SPEED_CYCLECOUNTER_OBJ_20w=hppa2w.lo
+ cyclecounter_size_20w=2
+ ;;
+ esac
+ ;;
+ esac
+ ;;
+
+
+ IA64_PATTERN)
+ abilist="64"
+ GMP_INCLUDE_MPN(ia64/ia64-defs.m4)
+ SPEED_CYCLECOUNTER_OBJ=ia64.lo
+ any_32_testlist="sizeof-long-4"
+
+ case $host_cpu in
+ itanium) path="ia64/itanium ia64" ;;
+ itanium2) path="ia64/itanium2 ia64" ;;
+ *) path="ia64" ;;
+ esac
+
+ gcc_64_cflags_optlist="tune"
+ gcc_32_cflags_optlist=$gcc_64_cflags_optlist
+
+ # gcc pre-release 3.4 adds -mtune itanium and itanium2
+ case $host_cpu in
+ itanium) gcc_cflags_tune="-mtune=itanium" ;;
+ itanium2) gcc_cflags_tune="-mtune=itanium2" ;;
+ esac
+
+ case $host in
+ *-*-linux*)
+ cclist="gcc icc"
+ icc_cflags="-no-gcc"
+ icc_cflags_optlist="opt"
+ # Don't use -O3, it is for "large data sets" and also miscompiles GMP.
+ # But icc miscompiles GMP at any optimization level, at higher levels
+ # it miscompiles more files...
+ icc_cflags_opt="-O2 -O1"
+ ;;
+
+ *-*-hpux*)
+ # HP cc sometimes gets internal errors if the optimization level is
+ # too high. GMP_PROG_CC_WORKS detects this, the "_opt" fallbacks
+ # let us use whatever seems to work.
+ #
+ abilist="32 64"
+ any_64_testlist="sizeof-long-8"
+
+ cclist_32="gcc cc"
+ path_32="ia64"
+ cc_32_cflags=""
+ cc_32_cflags_optlist="opt"
+ cc_32_cflags_opt="+O3 +O2 +O1"
+ gcc_32_cflags="$gcc_cflags -milp32"
+ limb_32=longlong
+ SPEED_CYCLECOUNTER_OBJ_32=ia64.lo
+ cyclecounter_size_32=2
+
+ # Must have +DD64 in CPPFLAGS to get the right __LP64__ for headers,
+ # but also need it in CFLAGS for linking programs, since automake
+ # only uses CFLAGS when linking, not CPPFLAGS.
+ # FIXME: Maybe should use cc_64_ldflags for this, but that would
+ # need GMP_LDFLAGS used consistently by all the programs.
+ #
+ cc_64_cflags="+DD64"
+ cc_64_cppflags="+DD64"
+ cc_64_cflags_optlist="opt"
+ cc_64_cflags_opt="+O3 +O2 +O1"
+ gcc_64_cflags="$gcc_cflags -mlp64"
+ ;;
+ esac
+ ;;
+
+
+ # Motorola 68k
+ #
+ M68K_PATTERN)
+ AC_DEFINE(HAVE_HOST_CPU_FAMILY_m68k)
+ GMP_INCLUDE_MPN(m68k/m68k-defs.m4)
+ gcc_cflags="$gcc_cflags $fomit_frame_pointer"
+ gcc_cflags_optlist="arch"
+
+ # gcc 2.7.2 knows -m68000, -m68020, -m68030, -m68040.
+ # gcc 2.95 adds -mcpu32, -m68060.
+ # FIXME: Maybe "-m68020 -mnobitfield" would suit cpu32 on 2.7.2.
+ #
+ case $host_cpu in
+ m68020) gcc_cflags_arch="-m68020" ;;
+ m68030) gcc_cflags_arch="-m68030" ;;
+ m68040) gcc_cflags_arch="-m68040" ;;
+ m68060) gcc_cflags_arch="-m68060 -m68000" ;;
+ m68360) gcc_cflags_arch="-mcpu32 -m68000" ;;
+ *) gcc_cflags_arch="-m68000" ;;
+ esac
+
+ # FIXME: m68k/mc68020 looks like it's ok for cpu32, but this wants to be
+ # tested. Will need to introduce an m68k/cpu32 if m68k/mc68020 ever uses
+ # the bitfield instructions.
+ case $host_cpu in
+ [m680[234]0 | m68360]) path="m68k/mc68020 m68k" ;;
+ *) path="m68k" ;;
+ esac
+ ;;
+
+
+ # Motorola 88k
+ m88k*-*-*)
+ path="m88k"
+ ;;
+ m88110*-*-*)
+ gcc_cflags="$gcc_cflags -m88110"
+ path="m88k/mc88110 m88k"
+ ;;
+
+
+ # IRIX 5 and earlier can only run 32-bit o32.
+ #
+ # IRIX 6 and up always has a 64-bit mips CPU can run n32 or 64. n32 is
+ # preferred over 64, but only because that's been the default in past
+ # versions of GMP. The two are equally efficient.
+ #
+ # Linux kernel 2.2.13 arch/mips/kernel/irixelf.c has a comment about not
+ # supporting n32 or 64.
+ #
+ # For reference, libtool (eg. 1.5.6) recognises the n32 ABI and knows the
+ # right options to use when linking (both cc and gcc), so no need for
+ # anything special from us.
+ #
+ mips*-*-*)
+ abilist="o32"
+ gcc_cflags_optlist="abi"
+ gcc_cflags_abi="-mabi=32"
+ gcc_testlist="gcc-mips-o32"
+ path="mips32"
+ cc_cflags="-O2 -o32" # no -g, it disables all optimizations
+ # this suits both mips32 and mips64
+ GMP_INCLUDE_MPN(mips32/mips-defs.m4)
+
+ case $host in
+ [mips64*-*-* | mips*-*-irix[6789]*])
+ abilist="n32 64 o32"
+
+ cclist_n32="gcc cc"
+ gcc_n32_cflags="$gcc_cflags -mabi=n32"
+ cc_n32_cflags="-O2 -n32" # no -g, it disables all optimizations
+ limb_n32=longlong
+ path_n32="mips64"
+
+ cclist_64="gcc cc"
+ gcc_64_cflags="$gcc_cflags -mabi=64"
+ 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"
+ ;;
+ esac
+ ;;
+
+
+ # Darwin (powerpc-apple-darwin1.3) has it's hacked gcc installed as cc.
+ # Our usual "gcc in disguise" detection means gcc_cflags etc here gets
+ # used.
+ #
+ # The darwin pre-compiling preprocessor is disabled with -no-cpp-precomp
+ # since it doesn't like "__attribute__ ((mode (SI)))" etc in gmp-impl.h,
+ # and so always ends up running the plain preprocessor anyway. This could
+ # be done in CPPFLAGS rather than CFLAGS, but there's not many places
+ # preprocessing is done separately, and this is only a speedup, the normal
+ # preprocessor gets run if there's any problems.
+ #
+ # We used to use -Wa,-mppc with gcc, but can't remember exactly why.
+ # Presumably it was for old versions of gcc where -mpowerpc doesn't put
+ # the assembler in the right mode. In any case -Wa,-mppc is not good, for
+ # instance -mcpu=604 makes recent gcc use -m604 to get access to the
+ # "fsel" instruction, but a -Wa,-mppc overrides that, making code that
+ # comes out with fsel fail.
+ #
+ # (Note also that the darwin assembler doesn't accept "-mppc", so any
+ # -Wa,-mppc was used only if it worked. The right flag on darwin would be
+ # "-arch ppc" or some such, but that's already the default.)
+ #
+ [powerpc*-*-* | power[3-9]-*-*])
+ AC_DEFINE(HAVE_HOST_CPU_FAMILY_powerpc)
+ HAVE_HOST_CPU_FAMILY_powerpc=1
+ abilist="32"
+ cclist="gcc cc"
+ cc_cflags="-O2"
+ gcc_32_cflags="$gcc_cflags -mpowerpc"
+ gcc_cflags_optlist="precomp subtype asm cpu"
+ gcc_cflags_precomp="-no-cpp-precomp"
+ gcc_cflags_subtype="-force_cpusubtype_ALL" # for vmx on darwin
+ gcc_cflags_asm=""
+ gcc_cflags_cpu=""
+ vmx_path=""
+
+ # grab this object, though it's not a true cycle counter routine
+ SPEED_CYCLECOUNTER_OBJ=powerpc.lo
+ cyclecounter_size=0
+
+ case $host_cpu in
+ powerpc740 | powerpc750)
+ path="powerpc32/750 powerpc32" ;;
+ powerpc7400 | powerpc7410)
+ path="powerpc32/vmx powerpc32/750 powerpc32" ;;
+ [powerpc74[45]?])
+ path="powerpc32/vmx powerpc32" ;;
+ *)
+ path="powerpc32" ;;
+ esac
+
+ case $host_cpu in
+ powerpc401) gcc_cflags_cpu="-mcpu=401" ;;
+ powerpc403) gcc_cflags_cpu="-mcpu=403"
+ xlc_cflags_arch="-qarch=403 -qarch=ppc" ;;
+ powerpc405) gcc_cflags_cpu="-mcpu=405" ;;
+ powerpc505) gcc_cflags_cpu="-mcpu=505" ;;
+ powerpc601) gcc_cflags_cpu="-mcpu=601"
+ xlc_cflags_arch="-qarch=601 -qarch=ppc" ;;
+ powerpc602) gcc_cflags_cpu="-mcpu=602"
+ xlc_cflags_arch="-qarch=602 -qarch=ppc" ;;
+ powerpc603) gcc_cflags_cpu="-mcpu=603"
+ xlc_cflags_arch="-qarch=603 -qarch=ppc" ;;
+ powerpc603e) gcc_cflags_cpu="-mcpu=603e -mcpu=603"
+ xlc_cflags_arch="-qarch=603 -qarch=ppc" ;;
+ powerpc604) gcc_cflags_cpu="-mcpu=604"
+ xlc_cflags_arch="-qarch=604 -qarch=ppc" ;;
+ powerpc604e) gcc_cflags_cpu="-mcpu=604e -mcpu=604"
+ xlc_cflags_arch="-qarch=604 -qarch=ppc" ;;
+ powerpc620) gcc_cflags_cpu="-mcpu=620" ;;
+ powerpc630) gcc_cflags_cpu="-mcpu=630"
+ xlc_cflags_arch="-qarch=pwr3"
+ cpu_path="p3 p3-p7" ;;
+ powerpc740) gcc_cflags_cpu="-mcpu=740" ;;
+ powerpc7400 | powerpc7410)
+ gcc_cflags_asm="-Wa,-maltivec"
+ gcc_cflags_cpu="-mcpu=7400 -mcpu=750" ;;
+ [powerpc74[45]?])
+ gcc_cflags_asm="-Wa,-maltivec"
+ gcc_cflags_cpu="-mcpu=7450" ;;
+ powerpc750) gcc_cflags_cpu="-mcpu=750" ;;
+ powerpc801) gcc_cflags_cpu="-mcpu=801" ;;
+ powerpc821) gcc_cflags_cpu="-mcpu=821" ;;
+ powerpc823) gcc_cflags_cpu="-mcpu=823" ;;
+ powerpc860) gcc_cflags_cpu="-mcpu=860" ;;
+ powerpc970) gcc_cflags_cpu="-mtune=970"
+ xlc_cflags_arch="-qarch=970 -qarch=pwr3"
+ vmx_path="powerpc64/vmx"
+ cpu_path="p4 p3-p7" ;;
+ power4) gcc_cflags_cpu="-mtune=power4"
+ xlc_cflags_arch="-qarch=pwr4"
+ cpu_path="p4 p3-p7" ;;
+ power5) gcc_cflags_cpu="-mtune=power5 -mtune=power4"
+ xlc_cflags_arch="-qarch=pwr5"
+ cpu_path="p5 p4 p3-p7" ;;
+ power6) gcc_cflags_cpu="-mtune=power6"
+ xlc_cflags_arch="-qarch=pwr6"
+ cpu_path="p6 p3-p7" ;;
+ power7) gcc_cflags_cpu="-mtune=power7 -mtune=power5"
+ xlc_cflags_arch="-qarch=pwr7 -qarch=pwr5"
+ cpu_path="p7 p5 p4 p3-p7" ;;
+ esac
+
+ case $host in
+ *-*-aix*)
+ cclist="gcc xlc cc"
+ gcc_32_cflags_maybe="-maix32"
+ xlc_cflags="-O2 -qmaxmem=20000"
+ xlc_cflags_optlist="arch"
+ xlc_32_cflags_maybe="-q32"
+ ar_32_flags="-X32"
+ nm_32_flags="-X32"
+ esac
+
+ case $host in
+ POWERPC64_PATTERN)
+ case $host in
+ *-*-aix*)
+ # On AIX a true 64-bit ABI is available.
+ # Need -Wc to pass object type flags through to the linker.
+ abilist="mode64 $abilist"
+ cclist_mode64="gcc xlc"
+ gcc_mode64_cflags="$gcc_cflags -maix64 -mpowerpc64"
+ gcc_mode64_cflags_optlist="cpu"
+ gcc_mode64_ldflags="-Wc,-maix64"
+ xlc_mode64_cflags="-O2 -q64 -qmaxmem=20000"
+ xlc_mode64_cflags_optlist="arch"
+ xlc_mode64_ldflags="-Wc,-q64"
+ # Must indicate object type to ar and nm
+ ar_mode64_flags="-X64"
+ nm_mode64_flags="-X64"
+ path_mode64=""
+ p=""
+ for i in $cpu_path
+ do path_mode64="${path_mode64}powerpc64/mode64/$i "
+ path_mode64="${path_mode64}powerpc64/$i "
+ p="${p} powerpc32/$i "
+ done
+ path_mode64="${path_mode64}powerpc64/mode64 $vmx_path powerpc64"
+ path="$p $path"
+ # grab this object, though it's not a true cycle counter routine
+ SPEED_CYCLECOUNTER_OBJ_mode64=powerpc64.lo
+ cyclecounter_size_mode64=0
+ ;;
+ *-*-darwin*)
+ # On Darwin we can use 64-bit instructions with a longlong limb,
+ # but the chip still in 32-bit mode.
+ # In theory this can be used on any OS which knows how to save
+ # 64-bit registers in a context switch.
+ #
+ # Note that we must use -mpowerpc64 with gcc, since the
+ # longlong.h macros expect limb operands in a single 64-bit
+ # register, not two 32-bit registers as would be given for a
+ # long long without -mpowerpc64. In theory we could detect and
+ # accommodate both styles, but the proper 64-bit registers will
+ # be fastest and are what we really want to use.
+ #
+ # One would think -mpowerpc64 would set the assembler in the right
+ # mode to handle 64-bit instructions. But for that, also
+ # -force_cpusubtype_ALL is needed.
+ #
+ # Do not use -fast for Darwin, it actually adds options
+ # incompatible with a shared library.
+ #
+ abilist="mode64 mode32 $abilist"
+ gcc_32_cflags_maybe="-m32"
+ gcc_cflags_opt="-O3 -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"
+ limb_mode32=longlong
+ cclist_mode64="gcc"
+ gcc_mode64_cflags="-m64"
+ gcc_mode64_cflags_optlist="cpu opt"
+ gcc_mode64_cflags_opt="-O3 -O2 -O1"
+ path_mode64=""
+ path_mode32=""
+ p=""
+ for i in $cpu_path
+ do path_mode64="${path_mode64}powerpc64/mode64/$i "
+ path_mode64="${path_mode64}powerpc64/$i "
+ path_mode32="${path_mode32}powerpc64/mode32/$i "
+ path_mode32="${path_mode32}powerpc64/$i "
+ p="${p} powerpc32/$i "
+ done
+ path_mode64="${path_mode64}powerpc64/mode64 $vmx_path powerpc64"
+ path_mode32="${path_mode32}powerpc64/mode32 $vmx_path powerpc64"
+ path="$p $path"
+ SPEED_CYCLECOUNTER_OBJ_mode64=powerpc64.lo
+ cyclecounter_size_mode64=0
+ any_mode64_testlist="sizeof-long-8"
+ ;;
+ *-*-linux* | *-*-*bsd*)
+ # On GNU/Linux, assume the processor is in 64-bit mode. Some
+ # environments have a gcc that is always in 64-bit mode, while
+ # others require -m64, hence the use of cflags_maybe. The
+ # sizeof-long-8 test checks the mode is right (for the no option
+ # case).
+ #
+ # -mpowerpc64 is not used, since it should be the default in
+ # 64-bit mode. (We need its effect for the various longlong.h
+ # asm macros to be right of course.)
+ #
+ # gcc64 was an early port of gcc to 64-bit mode, but should be
+ # obsolete before too long. We prefer plain gcc when it knows
+ # 64-bits.
+ #
+ abilist="mode64 mode32 $abilist"
+ gcc_32_cflags_maybe="-m32"
+ cclist_mode32="gcc"
+ gcc_mode32_cflags_maybe="-m32"
+ gcc_mode32_cflags="-mpowerpc64"
+ gcc_mode32_cflags_optlist="cpu opt"
+ gcc_mode32_cflags_opt="-O3 -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"
+ path_mode64=""
+ path_mode32=""
+ p=""
+ for i in $cpu_path
+ do path_mode64="${path_mode64}powerpc64/mode64/$i "
+ path_mode64="${path_mode64}powerpc64/$i "
+ path_mode32="${path_mode32}powerpc64/mode32/$i "
+ path_mode32="${path_mode32}powerpc64/$i "
+ p="${p} powerpc32/$i "
+ done
+ path_mode64="${path_mode64}powerpc64/mode64 $vmx_path powerpc64"
+ path_mode32="${path_mode32}powerpc64/mode32 $vmx_path powerpc64"
+ path="$p $path"
+ SPEED_CYCLECOUNTER_OBJ_mode64=powerpc64.lo
+ cyclecounter_size_mode64=0
+ any_mode64_testlist="sizeof-long-8"
+ ;;
+ esac
+ ;;
+ esac
+ ;;
+
+
+ # POWER 32-bit
+ [power-*-* | power[12]-*-* | power2sc-*-*])
+ AC_DEFINE(HAVE_HOST_CPU_FAMILY_power)
+ HAVE_HOST_CPU_FAMILY_power=1
+ cclist="gcc"
+ extra_functions="udiv_w_sdiv"
+ path="power"
+
+ # gcc 2.7.2 knows rios1, rios2, rsc
+ #
+ # -mcpu=rios2 can tickle an AIX assembler bug (see GMP_PROG_CC_WORKS) so
+ # there needs to be a fallback to just -mpower.
+ #
+ gcc_cflags_optlist="cpu"
+ case $host in
+ power-*-*) gcc_cflags_cpu="-mcpu=power -mpower" ;;
+ power1-*-*) gcc_cflags_cpu="-mcpu=rios1 -mpower" ;;
+ power2-*-*) gcc_cflags_cpu="-mcpu=rios2 -mpower" ;;
+ power2sc-*-*) gcc_cflags_cpu="-mcpu=rsc -mpower" ;;
+ esac
+ case $host in
+ *-*-aix*)
+ cclist="gcc xlc"
+ xlc_cflags="-O2 -qarch=pwr -qmaxmem=20000"
+ ;;
+ esac
+ ;;
+
+
+ # IBM System/390 and z/Architecture
+ S390_PATTERN | S390X_PATTERN)
+ abilist="32"
+ gcc_cflags="$gcc_cflags $fomit_frame_pointer"
+ gcc_cflags_optlist="arch"
+ path="s390_32"
+ extra_functions="udiv_w_sdiv"
+ gcc_32_cflags_maybe="-m31"
+
+ case $host_cpu in
+ s390)
+ ;;
+ z900 | z900esa)
+ cpu="z900"
+ gccarch="$cpu"
+ path="s390_32/esame/$cpu s390_32/esame s390_32"
+ gcc_cflags_arch="-march=$gccarch"
+ AC_DEFINE_UNQUOTED(HAVE_HOST_CPU_s390_$cpu)
+ AC_DEFINE(HAVE_HOST_CPU_s390_zarch)
+ extra_functions=""
+ ;;
+ z990 | z990esa)
+ cpu="z990"
+ gccarch="$cpu"
+ path="s390_32/esame/$cpu s390_32/esame s390_32"
+ gcc_cflags_arch="-march=$gccarch"
+ AC_DEFINE_UNQUOTED(HAVE_HOST_CPU_s390_$cpu)
+ AC_DEFINE(HAVE_HOST_CPU_s390_zarch)
+ extra_functions=""
+ ;;
+ z9 | z9esa)
+ cpu="z9"
+ gccarch="z9-109"
+ path="s390_32/esame/$cpu s390_32/esame s390_32"
+ gcc_cflags_arch="-march=$gccarch"
+ AC_DEFINE_UNQUOTED(HAVE_HOST_CPU_s390_$cpu)
+ AC_DEFINE(HAVE_HOST_CPU_s390_zarch)
+ extra_functions=""
+ ;;
+ z10 | z10esa)
+ cpu="z10"
+ gccarch="z10"
+ path="s390_32/esame/$cpu s390_32/esame s390_32"
+ gcc_cflags_arch="-march=$gccarch"
+ AC_DEFINE_UNQUOTED(HAVE_HOST_CPU_s390_$cpu)
+ AC_DEFINE(HAVE_HOST_CPU_s390_zarch)
+ extra_functions=""
+ ;;
+ z196 | z196esa)
+ cpu="z196"
+ gccarch="z196"
+ path="s390_32/esame/$cpu s390_32/esame s390_32"
+ gcc_cflags_arch="-march=$gccarch"
+ AC_DEFINE_UNQUOTED(HAVE_HOST_CPU_s390_$cpu)
+ AC_DEFINE(HAVE_HOST_CPU_s390_zarch)
+ extra_functions=""
+ ;;
+ esac
+
+ case $host in
+ S390X_PATTERN)
+ abilist="64 32"
+ cclist_64="gcc"
+ gcc_64_cflags_optlist="arch"
+ gcc_64_cflags="$gcc_cflags -m64"
+ path_64="s390_64/$host_cpu s390_64"
+ extra_functions=""
+ ;;
+ esac
+ ;;
+
+
+ sh-*-*) path="sh" ;;
+ [sh[2-4]-*-*]) path="sh/sh2 sh" ;;
+
+
+ *sparc*-*-*)
+ # sizeof(long)==4 or 8 is tested, to ensure we get the right ABI. We've
+ # had various bug reports where users have set CFLAGS for their desired
+ # mode, but not set our ABI. For some reason it's sparc where this
+ # keeps coming up, presumably users there are accustomed to driving the
+ # compiler mode that way. The effect of our testlist setting is to
+ # reject ABI=64 in favour of ABI=32 if the user has forced the flags to
+ # 32-bit mode.
+ #
+ abilist="32"
+ cclist="gcc acc cc"
+ any_testlist="sizeof-long-4"
+ GMP_INCLUDE_MPN(sparc32/sparc-defs.m4)
+
+ case $host_cpu in
+ sparcv8 | microsparc | turbosparc)
+ path="sparc32/v8 sparc32" ;;
+ supersparc)
+ path="sparc32/v8/supersparc sparc32/v8 sparc32" ;;
+ [sparc64 | sparcv9* | ultrasparc | ultrasparc[234]*])
+ path="sparc32/v9 sparc32/v8 sparc32" ;;
+ [ultrasparct[12345]])
+ path="sparc32/ultrasparct1 sparc32/v8 sparc32" ;;
+ *)
+ path="sparc32" ;;
+ esac
+
+ # gcc 2.7.2 doesn't know about v9 and doesn't pass -xarch=v8plus to the
+ # assembler. Add it explicitly since the solaris assembler won't accept
+ # our sparc32/v9 asm code without it. gas accepts -xarch=v8plus too, so
+ # it can be in the cflags unconditionally (though gas doesn't need it).
+ #
+ # gcc -m32 is needed to force 32-bit mode on a dual-ABI system, but past
+ # gcc doesn't know that flag, hence cflags_maybe. Note that -m32 cannot
+ # be done through the optlist since the plain cflags would be run first
+ # and we don't want to require the default mode (whatever it is) works.
+ #
+ # Note it's gcc_32_cflags_maybe and not gcc_cflags_maybe because the
+ # latter would be used in the 64-bit ABI on systems like "*bsd" where
+ # abilist="64" only.
+ #
+ gcc_32_cflags_maybe="-m32"
+ gcc_cflags_optlist="cpu asm"
+
+ # gcc 2.7.2 knows -mcypress, -msupersparc, -mv8, -msparclite.
+ # gcc 2.95 knows -mcpu= v7, hypersparc, sparclite86x, f930, f934,
+ # sparclet, tsc701, v9, ultrasparc. A warning is given that the
+ # plain -m forms will disappear.
+ # gcc 3.3 adds ultrasparc3.
+ #
+ case $host_cpu in
+ supersparc*)
+ gcc_cflags_cpu="-mcpu=supersparc -msupersparc"
+ gcc_cflags_asm="-Wa,-Av8 -Wa,-xarch=v8";;
+ sparcv8 | microsparc* | turbosparc | hypersparc*)
+ gcc_cflags_cpu="-mcpu=v8 -mv8"
+ gcc_cflags_asm="-Wa,-Av8 -Wa,-xarch=v8";;
+ sparc64 | sparcv9*)
+ gcc_cflags_cpu="-mcpu=v9"
+ gcc_32_cflags_asm="-Wa,-Av8 -Wa,-xarch=v8plus"
+ gcc_64_cflags_asm="-Wa,-Av9 -Wa,-xarch=v9";;
+ ultrasparc1 | ultrasparc2*)
+ gcc_cflags_cpu="-mcpu=ultrasparc -mcpu=v9"
+ gcc_32_cflags_asm="-Wa,-Av8plusa -Wa,-xarch=v8plusa"
+ gcc_64_cflags_asm="-Wa,-Av9a -Wa,-xarch=v9a";;
+ [ultrasparc[34]])
+ gcc_cflags_cpu="-mcpu=ultrasparc3 -mcpu=ultrasparc -mcpu=v9"
+ gcc_32_cflags_asm="-Wa,-Av8plusb -Wa,-xarch=v8plusb"
+ gcc_64_cflags_asm="-Wa,-Av9b -Wa,-xarch=v9b";;
+ [ultrasparct[12]])
+ gcc_cflags_cpu="-mcpu=niagara -mcpu=v9"
+ gcc_32_cflags_asm="-Wa,-Av8plusc -Wa,-xarch=v8plusc"
+ gcc_64_cflags_asm="-Wa,-Av9c -Wa,-xarch=v9c";;
+ ultrasparct3)
+ gcc_cflags_cpu="-mcpu=niagara3 -mcpu=niagara -mcpu=v9"
+ gcc_32_cflags_asm="-Wa,-Av8plusd -Wa,-xarch=v8plusd"
+ gcc_64_cflags_asm="-Wa,-Av9d -Wa,-xarch=v9d";;
+ ultrasparct4)
+ gcc_cflags_cpu="-mcpu=niagara4 -mcpu=niagara3 -mcpu=niagara -mcpu=v9"
+ gcc_32_cflags_asm="-Wa,-Av8plusd -Wa,-xarch=v8plusd"
+ gcc_64_cflags_asm="-Wa,-Av9d -Wa,-xarch=v9d";;
+ *)
+ gcc_cflags_cpu="-mcpu=v7 -mcypress"
+ gcc_cflags_asm="";;
+ esac
+
+ # SunPRO cc and acc, and SunOS bundled cc
+ case $host in
+ *-*-solaris* | *-*-sunos*)
+ # Note no -g, it disables all optimizations.
+ cc_cflags=
+ cc_cflags_optlist="opt arch cpu"
+
+ # SunOS cc doesn't know -xO4, fallback to -O2.
+ cc_cflags_opt="-xO4 -O2"
+
+ # SunOS cc doesn't know -xarch, apparently always generating v7
+ # code, so make this optional
+ case $host_cpu in
+ sparcv8 | microsparc* | supersparc* | turbosparc | hypersparc*)
+ cc_cflags_arch="-xarch=v8";;
+ [ultrasparct[345]])
+ cc_cflags_arch="-xarch=v8plusd" ;;
+ sparc64 | sparcv9* | ultrasparc*)
+ cc_cflags_arch="-xarch=v8plus" ;;
+ *)
+ cc_cflags_arch="-xarch=v7" ;;
+ esac
+
+ # SunOS cc doesn't know -xchip and doesn't seem to have an equivalent.
+ # SunPRO cc 5 recognises -xchip=generic, old, super, super2, micro,
+ # micro2, hyper, hyper2, powerup, ultra, ultra2, ultra2i.
+ # SunPRO cc 6 adds -xchip=ultra2e, ultra3cu.
+ #
+ case $host_cpu in
+ supersparc*) cc_cflags_cpu="-xchip=super" ;;
+ microsparc*) cc_cflags_cpu="-xchip=micro" ;;
+ turbosparc) cc_cflags_cpu="-xchip=micro2" ;;
+ hypersparc*) cc_cflags_cpu="-xchip=hyper" ;;
+ ultrasparc) cc_cflags_cpu="-xchip=ultra" ;;
+ ultrasparc2) cc_cflags_cpu="-xchip=ultra2 -xchip=ultra" ;;
+ ultrasparc2i) cc_cflags_cpu="-xchip=ultra2i -xchip=ultra2 -xchip=ultra" ;;
+ ultrasparc3) cc_cflags_cpu="-xchip=ultra3 -xchip=ultra" ;;
+ ultrasparc4) cc_cflags_cpu="-xchip=ultra4 -xchip=ultra3 -xchip=ultra" ;;
+ ultrasparct1) cc_cflags_cpu="-xchip=ultraT1" ;;
+ ultrasparct2) cc_cflags_cpu="-xchip=ultraT2 -xchip=ultraT1" ;;
+ ultrasparct3) cc_cflags_cpu="-xchip=ultraT3 -xchip=ultraT2" ;;
+ ultrasparct4) cc_cflags_cpu="-xchip=T4" ;;
+ ultrasparct5) cc_cflags_cpu="-xchip=T5 -xchip=T4" ;;
+ *) cc_cflags_cpu="-xchip=generic" ;;
+ esac
+ esac
+
+ case $host_cpu in
+ sparc64 | sparcv9* | ultrasparc*)
+ case $host in
+ # Solaris 6 and earlier cannot run ABI=64 since it doesn't save
+ # registers properly, so ABI=32 is left as the only choice.
+ #
+ [*-*-solaris2.[0-6] | *-*-solaris2.[0-6].*]) ;;
+
+ # BSD sparc64 ports are 64-bit-only systems, so ABI=64 is the only
+ # choice. In fact they need no special compiler flags, gcc -m64
+ # is the default, but it doesn't hurt to add it. v9 CPUs always
+ # use the sparc64 port, since the plain 32-bit sparc ports don't
+ # run on a v9.
+ #
+ *-*-*bsd*) abilist="64" ;;
+
+ # For all other systems, we try both 64 and 32.
+ #
+ # GNU/Linux sparc64 has only recently gained a 64-bit user mode.
+ # In the past sparc64 meant a v9 cpu, but there were no 64-bit
+ # operations in user mode. We assume that if "gcc -m64" works
+ # then the system is suitable. Hopefully even if someone attempts
+ # to put a new gcc and/or glibc on an old system it won't run.
+ #
+ *) abilist="64 32" ;;
+ esac
+
+ case $host_cpu in
+ ultrasparc | ultrasparc2 | ultrasparc2i)
+ path_64="sparc64/ultrasparc1234 sparc64" ;;
+ [ultrasparc[34]])
+ path_64="sparc64/ultrasparc34 sparc64/ultrasparc1234 sparc64" ;;
+ [ultrasparct[12]])
+ path_64="sparc64/ultrasparct1 sparc64" ;;
+ [ultrasparct[345]])
+ path_64="sparc64/ultrasparct3 sparc64" ;;
+ *)
+ path_64="sparc64"
+ esac
+
+ cclist_64="gcc"
+ any_64_testlist="sizeof-long-8"
+
+ # gcc -mptr64 is probably implied by -m64, but we're not sure if
+ # this was always so. On Solaris in the past we always used both
+ # "-m64 -mptr64".
+ #
+ # gcc -Wa,-xarch=v9 is thought to be necessary in some cases on
+ # solaris, but it would seem likely that if gcc is going to generate
+ # 64-bit code it will have to add that option itself where needed.
+ # An extra copy of this option should be harmless though, but leave
+ # it until we're sure. (Might want -xarch=v9a or -xarch=v9b for the
+ # higher cpu types instead.)
+ #
+ gcc_64_cflags="$gcc_cflags -m64 -mptr64"
+ gcc_64_ldflags="-Wc,-m64"
+ gcc_64_cflags_optlist="cpu asm"
+
+ case $host in
+ *-*-solaris*)
+ # Sun cc.
+ #
+ # We used to have -fast and some fixup options here, but it
+ # recurrently caused problems with miscompilation. Of course,
+ # -fast is documented as miscompiling things for the sake of speed.
+ #
+ cclist_64="$cclist_64 cc"
+ cc_64_cflags_optlist="cpu"
+ case $host_cpu in
+ [ultrasparct[345]])
+ cc_64_cflags="$cc_64_cflags -xO3 -xarch=v9d" ;;
+ *)
+ cc_64_cflags="-xO3 -xarch=v9" ;;
+ esac
+ ;;
+ esac
+
+ # using the v9 %tick register
+ SPEED_CYCLECOUNTER_OBJ_32=sparcv9.lo
+ SPEED_CYCLECOUNTER_OBJ_64=sparcv9.lo
+ cyclecounter_size_32=2
+ cyclecounter_size_64=2
+ ;;
+ esac
+ ;;
+
+
+ # VAX
+ vax*-*-*elf*)
+ # Use elf conventions (i.e., '%' register prefix, no global prefix)
+ #
+ GMP_INCLUDE_MPN(vax/elf.m4)
+ gcc_cflags="$gcc_cflags $fomit_frame_pointer"
+ path="vax"
+ extra_functions="udiv_w_sdiv"
+ ;;
+ vax*-*-*)
+ # Default to aout conventions (i.e., no register prefix, '_' global prefix)
+ #
+ gcc_cflags="$gcc_cflags $fomit_frame_pointer"
+ path="vax"
+ extra_functions="udiv_w_sdiv"
+ ;;
+
+
+ # AMD and Intel x86 configurations, including AMD64
+ #
+ # Rumour has it gcc -O2 used to give worse register allocation than just
+ # -O, but lets assume that's no longer true.
+ #
+ # -m32 forces 32-bit mode on a bi-arch 32/64 amd64 build of gcc. -m64 is
+ # the default in such a build (we think), so -m32 is essential for ABI=32.
+ # This is, of course, done for any $host_cpu, not just x86_64, so we can
+ # get such a gcc into the right mode to cross-compile to say i486-*-*.
+ #
+ # -m32 is not available in gcc 2.95 and earlier, hence cflags_maybe to use
+ # it when it works. We check sizeof(long)==4 to ensure we get the right
+ # mode, in case -m32 has failed not because it's an old gcc, but because
+ # it's a dual 32/64-bit gcc without a 32-bit libc, or whatever.
+ #
+ X86_PATTERN | X86_64_PATTERN)
+ abilist="32"
+ cclist="gcc icc cc"
+ gcc_cflags="$gcc_cflags $fomit_frame_pointer"
+ gcc_32_cflags_maybe="-m32"
+ icc_cflags="-no-gcc"
+ icc_cflags_optlist="opt"
+ icc_cflags_opt="-O3 -O2 -O1"
+ any_32_testlist="sizeof-long-4"
+ CALLING_CONVENTIONS_OBJS='x86call.lo x86check$U.lo'
+
+ # Availability of rdtsc is checked at run-time.
+ SPEED_CYCLECOUNTER_OBJ=pentium.lo
+
+ # 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=.
+ # gcc 3.0 adds athlon.
+ # gcc 3.1 adds k6-2, k6-3, pentium-mmx, pentium2, pentium3, pentium4,
+ # athlon-tbird, athlon-4, athlon-xp, athlon-mp.
+ # gcc 3.2 adds winchip2.
+ # gcc 3.3 adds winchip-c6.
+ # gcc 3.3.1 from mandrake adds k8 and knows -mtune.
+ # gcc 3.4 adds c3, c3-2, k8, and deprecates -mcpu in favour of -mtune.
+ #
+ # In gcc 2.95.[0123], -march=pentiumpro provoked a stack slot bug in an
+ # old version of mpz/powm.c. Seems to be fine with the current code, so
+ # no need for any restrictions on that option.
+ #
+ # -march=pentiumpro can fail if the assembler doesn't know "cmov"
+ # (eg. solaris 2.8 native "as"), so always have -march=pentium after
+ # that as a fallback.
+ #
+ # -march=pentium4 and -march=k8 enable SSE2 instructions, which may or
+ # may not be supported by the assembler and/or the OS, and is bad in gcc
+ # prior to 3.3. The tests will reject these if no good, so fallbacks
+ # like "-march=pentium4 -mno-sse2" are given to try also without SSE2.
+ # Note the relevant -march types are listed in the optflags handling
+ # below, be sure to update there if adding new types emitting SSE2.
+ #
+ # -mtune is used at the start of each cpu option list to give something
+ # gcc 3.4 will use, thereby avoiding warnings from -mcpu. -mcpu forms
+ # are retained for use by prior gcc. For example pentium has
+ # "-mtune=pentium -mcpu=pentium ...", the -mtune is for 3.4 and the
+ # -mcpu for prior. If there's a brand new choice in 3.4 for a chip,
+ # like k8 for x86_64, then it can be the -mtune at the start, no need to
+ # duplicate anything.
+ #
+ gcc_cflags_optlist="cpu arch"
+ case $host_cpu in
+ i386*)
+ gcc_cflags_cpu="-mtune=i386 -mcpu=i386 -m386"
+ gcc_cflags_arch="-march=i386"
+ path="x86"
+ ;;
+ i486*)
+ gcc_cflags_cpu="-mtune=i486 -mcpu=i486 -m486"
+ gcc_cflags_arch="-march=i486"
+ path="x86/i486 x86"
+ ;;
+ i586 | pentium)
+ gcc_cflags_cpu="-mtune=pentium -mcpu=pentium -m486"
+ gcc_cflags_arch="-march=pentium"
+ path="x86/pentium x86"
+ ;;
+ pentiummmx)
+ gcc_cflags_cpu="-mtune=pentium-mmx -mcpu=pentium-mmx -mcpu=pentium -m486"
+ gcc_cflags_arch="-march=pentium-mmx -march=pentium"
+ path="x86/pentium/mmx x86/pentium x86/mmx x86"
+ ;;
+ i686 | pentiumpro)
+ gcc_cflags_cpu="-mtune=pentiumpro -mcpu=pentiumpro -mcpu=i486 -m486"
+ gcc_cflags_arch="-march=pentiumpro -march=pentium"
+ path="x86/p6 x86"
+ ;;
+ pentium2)
+ gcc_cflags_cpu="-mtune=pentium2 -mcpu=pentium2 -mcpu=pentiumpro -mcpu=i486 -m486"
+ gcc_cflags_arch="-march=pentium2 -march=pentiumpro -march=pentium"
+ path="x86/p6/mmx x86/p6 x86/mmx x86"
+ ;;
+ pentium3)
+ gcc_cflags_cpu="-mtune=pentium3 -mcpu=pentium3 -mcpu=pentiumpro -mcpu=i486 -m486"
+ gcc_cflags_arch="-march=pentium3 -march=pentiumpro -march=pentium"
+ path="x86/p6/p3mmx x86/p6/mmx x86/p6 x86/mmx x86"
+ ;;
+ pentiumm)
+ gcc_cflags_cpu="-mtune=pentium3 -mcpu=pentium3 -mcpu=pentiumpro -mcpu=i486 -m486"
+ gcc_cflags_arch="-march=pentium3 -march=pentiumpro -march=pentium"
+ path="x86/p6/sse2 x86/p6/p3mmx x86/p6/mmx x86/p6 x86/mmx x86"
+ ;;
+ k6)
+ gcc_cflags_cpu="-mtune=k6 -mcpu=k6 -mcpu=i486 -m486"
+ gcc_cflags_arch="-march=k6"
+ path="x86/k6/mmx x86/k6 x86/mmx x86"
+ ;;
+ k62)
+ gcc_cflags_cpu="-mtune=k6-2 -mcpu=k6-2 -mcpu=k6 -mcpu=i486 -m486"
+ gcc_cflags_arch="-march=k6-2 -march=k6"
+ path="x86/k6/k62mmx x86/k6/mmx x86/k6 x86/mmx x86"
+ ;;
+ k63)
+ gcc_cflags_cpu="-mtune=k6-3 -mcpu=k6-3 -mcpu=k6 -mcpu=i486 -m486"
+ gcc_cflags_arch="-march=k6-3 -march=k6"
+ path="x86/k6/k62mmx x86/k6/mmx x86/k6 x86/mmx x86"
+ ;;
+ geode)
+ gcc_cflags_cpu="-mtune=k6-3 -mcpu=k6-3 -mcpu=k6 -mcpu=i486 -m486"
+ gcc_cflags_arch="-march=k6-3 -march=k6"
+ path="x86/geode x86/k6/k62mmx x86/k6/mmx x86/k6 x86/mmx x86"
+ ;;
+ athlon)
+ # Athlon instruction costs are close to P6 (3 cycle load latency,
+ # 4-6 cycle mul, 40 cycle div, pairable adc, etc) so if gcc doesn't
+ # know athlon (eg. 2.95.2 doesn't) then fall back on pentiumpro.
+ gcc_cflags_cpu="-mtune=athlon -mcpu=athlon -mcpu=pentiumpro -mcpu=i486 -m486"
+ gcc_cflags_arch="-march=athlon -march=pentiumpro -march=pentium"
+ path="x86/k7/mmx x86/k7 x86/mmx x86"
+ ;;
+ i786 | pentium4)
+ # pentiumpro is the primary fallback when gcc doesn't know pentium4.
+ # This gets us cmov to eliminate branches. Maybe "athlon" would be
+ # a possibility on gcc 3.0.
+ #
+ gcc_cflags_cpu="-mtune=pentium4 -mcpu=pentium4 -mcpu=pentiumpro -mcpu=i486 -m486"
+ gcc_cflags_arch="-march=pentium4 -march=pentium4~-mno-sse2 -march=pentiumpro -march=pentium"
+ gcc_64_cflags_cpu="-mtune=nocona"
+ path="x86/pentium4/sse2 x86/pentium4/mmx x86/pentium4 x86/mmx x86"
+ path_64="x86_64/pentium4 x86_64"
+ ;;
+ viac32)
+ # Not sure of the best fallbacks here for -mcpu.
+ # c3-2 has sse and mmx, so pentium3 is good for -march.
+ gcc_cflags_cpu="-mtune=c3-2 -mcpu=c3-2 -mcpu=i486 -m486"
+ gcc_cflags_arch="-march=c3-2 -march=pentium3 -march=pentiumpro -march=pentium"
+ path="x86/p6/p3mmx x86/p6/mmx x86/p6 x86/mmx x86"
+ ;;
+ viac3*)
+ # Not sure of the best fallbacks here.
+ gcc_cflags_cpu="-mtune=c3 -mcpu=c3 -mcpu=i486 -m486"
+ gcc_cflags_arch="-march=c3 -march=pentium-mmx -march=pentium"
+ path="x86/pentium/mmx x86/pentium x86/mmx x86"
+ ;;
+ athlon64 | k8 | x86_64)
+ gcc_cflags_cpu="-mtune=k8 -mcpu=athlon -mcpu=pentiumpro -mcpu=i486 -m486"
+ gcc_cflags_arch="-march=k8 -march=k8~-mno-sse2 -march=athlon -march=pentiumpro -march=pentium"
+ path="x86/k8 x86/k7/mmx x86/k7 x86/mmx x86"
+ path_64="x86_64/k8 x86_64"
+ ;;
+ k10)
+ gcc_cflags_cpu="-mtune=amdfam10 -mtune=k8"
+ gcc_cflags_arch="-march=amdfam10 -march=k8 -march=k8~-mno-sse2"
+ path="x86/k10 x86/k8 x86/k7/mmx x86/k7 x86/mmx x86"
+ path_64="x86_64/k10 x86_64/k8 x86_64"
+ ;;
+ 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"
+ ;;
+ jaguar)
+ 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"
+ ;;
+ bulldozer | bd1)
+ gcc_cflags_cpu="-mtune=bdver1 -mtune=amdfam10 -mtune=k8"
+ gcc_cflags_arch="-march=bdver1 -march=amdfam10 -march=k8 -march=k8~-mno-sse2"
+ path="x86/bd1 x86/k7/mmx x86/k7 x86/mmx x86"
+ path_64="x86_64/bd1 x86_64/k10 x86_64/k8 x86_64"
+ ;;
+ piledriver | bd2)
+ gcc_cflags_cpu="-mtune=bdver2 -mtune=bdver1 -mtune=amdfam10 -mtune=k8"
+ gcc_cflags_arch="-march=bdver2 -march=bdver1 -march=amdfam10 -march=k8 -march=k8~-mno-sse2"
+ path="x86/bd2 x86/bd1 x86/k7/mmx x86/k7 x86/mmx x86"
+ path_64="x86_64/bd2 x86_64/bd1 x86_64/k10 x86_64/k8 x86_64"
+ ;;
+ steamroller | bd3)
+ gcc_cflags_cpu="-mtune=bdver3 -mtune=bdver2 -mtune=bdver1 -mtune=amdfam10 -mtune=k8"
+ gcc_cflags_arch="-march=bdver3 -march=bdver2 -march=bdver1 -march=amdfam10 -march=k8 -march=k8~-mno-sse2"
+ path="x86/bd3 x86/bd2 x86/bd1 x86/k7/mmx x86/k7 x86/mmx x86"
+ path_64="x86_64/bd3 x86_64/bd2 x86_64/bd1 x86_64/k10 x86_64/k8 x86_64"
+ ;;
+ excavator | bd4)
+ gcc_cflags_cpu="-mtune=bdver4 -mtune=bdver3 -mtune=bdver2 -mtune=bdver1 -mtune=amdfam10 -mtune=k8"
+ 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"
+ ;;
+ core2)
+ gcc_cflags_cpu="-mtune=core2 -mtune=k8"
+ gcc_cflags_arch="-march=core2 -march=core2~-mno-sse2 -march=k8 -march=k8~-mno-sse2"
+ path="x86/core2 x86/p6/sse2 x86/p6/p3mmx x86/p6/mmx x86/p6 x86/mmx x86"
+ path_64="x86_64/core2 x86_64"
+ ;;
+ corei | coreinhm | coreiwsm)
+ 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"
+ 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"
+ ;;
+ coreisbr)
+ 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"
+ path="x86/coreisbr x86/p6/sse2 x86/p6/p3mmx x86/p6/mmx x86/p6 x86/mmx x86"
+ path_64="x86_64/coreisbr x86_64/coreinhm x86_64/core2 x86_64"
+ ;;
+ coreihwl)
+ 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"
+ path="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"
+ ;;
+ coreibwl)
+ 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"
+ path="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"
+ # extra_functions_64="missing" # enable for bmi2/adx simulation
+ ;;
+ atom)
+ gcc_cflags_cpu="-mtune=atom -mtune=pentium3"
+ gcc_cflags_arch="-march=atom -march=pentium3"
+ path="x86/atom/sse2 x86/atom/mmx x86/atom x86/mmx x86"
+ path_64="x86_64/atom x86_64"
+ ;;
+ nano)
+ gcc_cflags_cpu="-mtune=nano"
+ gcc_cflags_arch="-march=nano"
+ path="x86/nano x86/mmx x86"
+ path_64="x86_64/nano x86_64"
+ ;;
+ *)
+ gcc_cflags_cpu="-mtune=i486 -mcpu=i486 -m486"
+ gcc_cflags_arch="-march=i486"
+ path="x86"
+ path_64="x86_64"
+ ;;
+ esac
+
+ case $host in
+ X86_64_PATTERN)
+ cclist_64="gcc cc"
+ gcc_64_cflags="$gcc_cflags -m64"
+ gcc_64_cflags_optlist="cpu arch"
+ CALLING_CONVENTIONS_OBJS_64='amd64call.lo amd64check$U.lo'
+ SPEED_CYCLECOUNTER_OBJ_64=x86_64.lo
+ cyclecounter_size_64=2
+
+ cclist_x32="gcc cc"
+ gcc_x32_cflags="$gcc_cflags -mx32"
+ gcc_x32_cflags_optlist="$gcc_64_cflags_optlist"
+ CALLING_CONVENTIONS_OBJS_x32="$CALLING_CONVENTIONS_OBJS_64"
+ SPEED_CYCLECOUNTER_OBJ_x32="$SPEED_CYCLECOUNTER_OBJ_64"
+ cyclecounter_size_x32="$cyclecounter_size_64"
+ path_x32="$path_64"
+ limb_x32=longlong
+ any_x32_testlist="sizeof-long-4"
+
+ abilist="64 x32 32"
+ if test "$enable_assembly" = "yes" ; then
+ extra_functions_64="$extra_functions_64 invert_limb_table"
+ extra_functions_x32=$extra_functions_64
+ fi
+
+ case $host in
+ *-*-solaris*)
+ # Sun cc.
+ cc_64_cflags="-xO3 -m64"
+ ;;
+ *-*-mingw* | *-*-cygwin)
+ limb_64=longlong
+ CALLING_CONVENTIONS_OBJS_64=""
+ AC_DEFINE(HOST_DOS64,1,[Define to 1 for Windos/64])
+ GMP_NONSTD_ABI_64=DOS64
+ ;;
+ esac
+ ;;
+ esac
+ ;;
+
+
+ # Special CPU "none" used to select generic C, now this is obsolete.
+ none-*-*)
+ enable_assembly=no
+ AC_MSG_WARN([the \"none\" host is obsolete, use --disable-assembly])
+ ;;
+
+esac
+
+# mingw can be built by the cygwin gcc if -mno-cygwin is added. For
+# convenience add this automatically if it works. Actual mingw gcc accepts
+# -mno-cygwin too, but of course is the default. mingw only runs on the
+# x86s, but allow any CPU here so as to catch "none" too.
+#
+case $host in
+ *-*-mingw*)
+ gcc_cflags_optlist="$gcc_cflags_optlist nocygwin"
+ gcc_cflags_nocygwin="-mno-cygwin"
+ ;;
+esac
+
+
+CFLAGS_or_unset=${CFLAGS-'(unset)'}
+CPPFLAGS_or_unset=${CPPFLAGS-'(unset)'}
+
+cat >&AC_FD_CC <<EOF
+User:
+ABI=$ABI
+CC=$CC
+CFLAGS=$CFLAGS_or_unset
+CPPFLAGS=$CPPFLAGS_or_unset
+MPN_PATH=$MPN_PATH
+GMP:
+abilist=$abilist
+cclist=$cclist
+EOF
+
+
+test_CFLAGS=${CFLAGS+set}
+test_CPPFLAGS=${CPPFLAGS+set}
+
+for abi in $abilist; do
+ abi_last="$abi"
+done
+
+# If the user specifies an ABI then it must be in $abilist, after that
+# $abilist is restricted to just that choice.
+#
+if test -n "$ABI"; then
+ found=no
+ for abi in $abilist; do
+ if test $abi = "$ABI"; then found=yes; break; fi
+ done
+ if test $found = no; then
+ AC_MSG_ERROR([ABI=$ABI is not among the following valid choices: $abilist])
+ fi
+ abilist="$ABI"
+fi
+
+found_compiler=no
+
+for abi in $abilist; do
+
+ echo "checking ABI=$abi"
+
+ # Suppose abilist="64 32", then for abi=64, will have abi1="_64" and
+ # abi2="_64". For abi=32, will have abi1="_32" and abi2="". This is how
+ # $gcc_cflags becomes a fallback for $gcc_32_cflags (the last in the
+ # abilist), but there's no fallback for $gcc_64_cflags.
+ #
+ abi1=[`echo _$abi | sed 's/[.]//g'`]
+ if test $abi = $abi_last; then abi2=; else abi2="$abi1"; fi
+
+ # Compiler choices under this ABI
+ eval cclist_chosen=\"\$cclist$abi1\"
+ test -n "$cclist_chosen" || eval cclist_chosen=\"\$cclist$abi2\"
+
+ # If there's a user specified $CC then don't use a list for
+ # $cclist_chosen, just a single value for $ccbase.
+ #
+ if test -n "$CC"; then
+
+ # The first word of $CC, stripped of any directory. For instance
+ # CC="/usr/local/bin/gcc -pipe" will give "gcc".
+ #
+ for ccbase in $CC; do break; done
+ ccbase=`echo $ccbase | sed 's:.*/::'`
+
+ # If this $ccbase is in $cclist_chosen then it's a compiler we know and
+ # we can do flags defaulting with it. If not, then $cclist_chosen is
+ # set to "unrecognised" so no default flags are used.
+ #
+ # "unrecognised" is used to avoid bad effects with eval if $ccbase has
+ # non-symbol characters. For instance ccbase=my+cc would end up with
+ # something like cflags="$my+cc_cflags" which would give
+ # cflags="+cc_cflags" rather than the intended empty string for an
+ # unknown compiler.
+ #
+ found=unrecognised
+ for i in $cclist_chosen; do
+ if test "$ccbase" = $i; then
+ found=$ccbase
+ break
+ fi
+ done
+ cclist_chosen=$found
+ fi
+
+ for ccbase in $cclist_chosen; do
+
+ # When cross compiling, look for a compiler with the $host_alias as a
+ # prefix, the same way that AC_CHECK_TOOL does. But don't do this to a
+ # user-selected $CC.
+ #
+ # $cross_compiling will be yes/no/maybe at this point. Do the host
+ # prefixing for "maybe" as well as "yes".
+ #
+ if test "$cross_compiling" != no && test -z "$CC"; then
+ cross_compiling_prefix="${host_alias}-"
+ fi
+
+ for ccprefix in $cross_compiling_prefix ""; do
+
+ cc="$CC"
+ test -n "$cc" || cc="$ccprefix$ccbase"
+
+ # If the compiler is gcc but installed under another name, then change
+ # $ccbase so as to use the flags we know for gcc. This helps for
+ # instance when specifying CC=gcc272 on Debian GNU/Linux, or the
+ # native cc which is really gcc on NeXT or MacOS-X.
+ #
+ # FIXME: There's a slight misfeature here. If cc is actually gcc but
+ # gcc is not a known compiler under this $abi then we'll end up
+ # testing it with no flags and it'll work, but chances are it won't be
+ # in the right mode for the ABI we desire. Let's quietly hope this
+ # doesn't happen.
+ #
+ if test $ccbase != gcc; then
+ GMP_PROG_CC_IS_GNU($cc,ccbase=gcc)
+ fi
+
+ # Similarly if the compiler is IBM xlc but invoked as cc or whatever
+ # then change $ccbase and make the default xlc flags available.
+ if test $ccbase != xlc; then
+ GMP_PROG_CC_IS_XLC($cc,ccbase=xlc)
+ fi
+
+ # acc was Sun's first unbundled compiler back in the SunOS days, or
+ # something like that, but today its man page says it's not meant to
+ # be used directly (instead via /usr/ucb/cc). The options are pretty
+ # much the same as the main SunPRO cc, so share those configs.
+ #
+ case $host in
+ *sparc*-*-solaris* | *sparc*-*-sunos*)
+ if test "$ccbase" = acc; then ccbase=cc; fi ;;
+ esac
+
+ for tmp_cflags_maybe in yes no; do
+ eval cflags=\"\$${ccbase}${abi1}_cflags\"
+ test -n "$cflags" || eval cflags=\"\$${ccbase}${abi2}_cflags\"
+
+ if test "$tmp_cflags_maybe" = yes; then
+ # don't try cflags_maybe when the user set CFLAGS
+ if test "$test_CFLAGS" = set; then continue; fi
+ eval cflags_maybe=\"\$${ccbase}${abi1}_cflags_maybe\"
+ test -n "$cflags_maybe" || eval cflags_maybe=\"\$${ccbase}${abi2}_cflags_maybe\"
+ # don't try cflags_maybe if there's nothing set
+ if test -z "$cflags_maybe"; then continue; fi
+ cflags="$cflags_maybe $cflags"
+ fi
+
+ # Any user CFLAGS, even an empty string, takes precedence
+ if test "$test_CFLAGS" = set; then cflags=$CFLAGS; fi
+
+ # Any user CPPFLAGS, even an empty string, takes precedence
+ eval cppflags=\"\$${ccbase}${abi1}_cppflags\"
+ test -n "$cppflags" || eval cppflags=\"\$${ccbase}${abi2}_cppflags\"
+ if test "$test_CPPFLAGS" = set; then cppflags=$CPPFLAGS; fi
+
+ # --enable-profiling adds -p/-pg even to user-specified CFLAGS.
+ # This is convenient, but it's perhaps a bit naughty to modify user
+ # CFLAGS.
+ case "$enable_profiling" in
+ prof) cflags="$cflags -p" ;;
+ gprof) cflags="$cflags -pg" ;;
+ instrument) cflags="$cflags -finstrument-functions" ;;
+ esac
+
+ GMP_PROG_CC_WORKS($cc $cflags $cppflags,,continue)
+
+ # If we're supposed to be using a "long long" for a limb, check that
+ # it works.
+ eval limb_chosen=\"\$limb$abi1\"
+ test -n "$limb_chosen" || eval limb_chosen=\"\$limb$abi2\"
+ if test "$limb_chosen" = longlong; then
+ GMP_PROG_CC_WORKS_LONGLONG($cc $cflags $cppflags,,continue)
+ fi
+
+ # The tests to perform on this $cc, if any
+ eval testlist=\"\$${ccbase}${abi1}_testlist\"
+ test -n "$testlist" || eval testlist=\"\$${ccbase}${abi2}_testlist\"
+ test -n "$testlist" || eval testlist=\"\$any${abi1}_testlist\"
+ test -n "$testlist" || eval testlist=\"\$any${abi2}_testlist\"
+
+ testlist_pass=yes
+ for tst in $testlist; do
+ case $tst in
+ hpc-hppa-2-0) GMP_HPC_HPPA_2_0($cc,,testlist_pass=no) ;;
+ gcc-arm-umodsi) GMP_GCC_ARM_UMODSI($cc,,testlist_pass=no) ;;
+ gcc-mips-o32) GMP_GCC_MIPS_O32($cc,,testlist_pass=no) ;;
+ hppa-level-2.0) GMP_HPPA_LEVEL_20($cc $cflags,,testlist_pass=no) ;;
+ sizeof*) GMP_C_TEST_SIZEOF($cc $cflags,$tst,,testlist_pass=no) ;;
+ esac
+ if test $testlist_pass = no; then break; fi
+ done
+
+ if test $testlist_pass = yes; then
+ found_compiler=yes
+ break
+ fi
+ done
+
+ if test $found_compiler = yes; then break; fi
+ done
+
+ if test $found_compiler = yes; then break; fi
+ done
+
+ if test $found_compiler = yes; then break; fi
+done
+
+
+# If we recognised the CPU, as indicated by $path being set, then insist
+# that we have a working compiler, either from our $cclist choices or from
+# $CC. We can't let AC_PROG_CC look around for a compiler because it might
+# find one that we've rejected (for not supporting the modes our asm code
+# demands, etc).
+#
+# If we didn't recognise the CPU (and this includes host_cpu=none), then
+# fall through and let AC_PROG_CC look around for a compiler too. This is
+# mostly in the interests of following a standard autoconf setup, after all
+# we've already tested cc and gcc adequately (hopefully). As of autoconf
+# 2.50 the only thing AC_PROG_CC really adds is a check for "cl" (Microsoft
+# C on MS-DOS systems).
+#
+if test $found_compiler = no && test -n "$path"; then
+ AC_MSG_ERROR([could not find a working compiler, see config.log for details])
+fi
+
+case $host in
+ X86_PATTERN | X86_64_PATTERN)
+ # If the user asked for a fat build, override the path and flags set above
+ if test $enable_fat = yes; then
+ gcc_cflags_cpu=""
+ gcc_cflags_arch=""
+
+ 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
+ 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"
+
+ if test "$abi" = 32; then
+ extra_functions="$extra_functions fat fat_entry"
+ path="x86/fat x86"
+ 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/pentium x86/pentium/mmx
+ x86/p6 x86/p6/mmx x86/p6/p3mmx x86/p6/sse2
+ x86/pentium4 x86/pentium4/mmx x86/pentium4/sse2
+ x86/core2 x86/coreinhm x86/coreisbr
+ x86/atom x86/atom/mmx x86/atom/sse2 x86/nano"
+ fi
+
+ if test "$abi" = 64; then
+ gcc_64_cflags=""
+ 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/atom x86_64/nano"
+ fat_functions="$fat_functions addmul_2 addlsh1_n addlsh2_n sublsh1_n"
+ fi
+
+ fat_thresholds="MUL_TOOM22_THRESHOLD MUL_TOOM33_THRESHOLD
+ SQR_TOOM2_THRESHOLD SQR_TOOM3_THRESHOLD
+ BMOD_1_TO_MOD_1_THRESHOLD"
+ fi
+ ;;
+esac
+
+
+if test $found_compiler = yes; then
+
+ # If we're creating CFLAGS, then look for optional additions. If the user
+ # set CFLAGS then leave it alone.
+ #
+ if test "$test_CFLAGS" != set; then
+ eval optlist=\"\$${ccbase}${abi1}_cflags_optlist\"
+ test -n "$optlist" || eval optlist=\"\$${ccbase}${abi2}_cflags_optlist\"
+
+ for opt in $optlist; do
+ eval optflags=\"\$${ccbase}${abi1}_cflags_${opt}\"
+ test -n "$optflags" || eval optflags=\"\$${ccbase}${abi2}_cflags_${opt}\"
+ test -n "$optflags" || eval optflags=\"\$${ccbase}_cflags_${opt}\"
+
+ for flag in $optflags; do
+
+ # ~ represents a space in an option spec
+ flag=`echo "$flag" | tr '~' ' '`
+
+ case $flag in
+ -march=pentium4 | -march=k8)
+ # For -march settings which enable SSE2 we exclude certain bad
+ # gcc versions and we need an OS knowing how to save xmm regs.
+ #
+ # This is only for ABI=32, any 64-bit gcc is good and any OS
+ # knowing x86_64 will know xmm.
+ #
+ # -march=k8 was only introduced in gcc 3.3, so we shouldn't need
+ # the GMP_GCC_PENTIUM4_SSE2 check (for gcc 3.2 and prior). But
+ # it doesn't hurt to run it anyway, sharing code with the
+ # pentium4 case.
+ #
+ if test "$abi" = 32; then
+ GMP_GCC_PENTIUM4_SSE2($cc $cflags $cppflags,, continue)
+ GMP_OS_X86_XMM($cc $cflags $cppflags,, continue)
+ fi
+ ;;
+ -no-cpp-precomp)
+ # special check, avoiding a warning
+ GMP_GCC_NO_CPP_PRECOMP($ccbase,$cc,$cflags,
+ [cflags="$cflags $flag"
+ break],
+ [continue])
+ ;;
+ -Wa,-m*)
+ case $host in
+ alpha*-*-*)
+ GMP_GCC_WA_MCPU($cc $cflags, $flag, , [continue])
+ ;;
+ esac
+ ;;
+ -Wa,-oldas)
+ GMP_GCC_WA_OLDAS($cc $cflags $cppflags,
+ [cflags="$cflags $flag"
+ break],
+ [continue])
+ ;;
+ esac
+
+ GMP_PROG_CC_WORKS($cc $cflags $cppflags $flag,
+ [cflags="$cflags $flag"
+ break])
+ done
+ done
+ fi
+
+ ABI="$abi"
+ 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)
+
+
+ # GMP_LDFLAGS substitution, selected according to ABI.
+ # These are needed on libgmp.la and libmp.la, but currently not on
+ # convenience libraries like tune/libspeed.la or mpz/libmpz.la.
+ #
+ eval GMP_LDFLAGS=\"\$${ccbase}${abi1}_ldflags\"
+ test -n "$GMP_LDFLAGS" || eval GMP_LDFLAGS=\"\$${ccbase}${abi1}_ldflags\"
+ AC_SUBST(GMP_LDFLAGS)
+ AC_SUBST(LIBGMP_LDFLAGS)
+ AC_SUBST(LIBGMPXX_LDFLAGS)
+
+ # extra_functions, selected according to ABI
+ eval tmp=\"\$extra_functions$abi1\"
+ test -n "$tmp" || eval tmp=\"\$extra_functions$abi2\"
+ extra_functions="$tmp"
+
+
+ # Cycle counter, selected according to ABI.
+ #
+ eval tmp=\"\$SPEED_CYCLECOUNTER_OBJ$abi1\"
+ test -n "$tmp" || eval tmp=\"\$SPEED_CYCLECOUNTER_OBJ$abi2\"
+ SPEED_CYCLECOUNTER_OBJ="$tmp"
+ eval tmp=\"\$cyclecounter_size$abi1\"
+ test -n "$tmp" || eval tmp=\"\$cyclecounter_size$abi2\"
+ cyclecounter_size="$tmp"
+
+ if test -n "$SPEED_CYCLECOUNTER_OBJ"; then
+ AC_DEFINE_UNQUOTED(HAVE_SPEED_CYCLECOUNTER, $cyclecounter_size,
+ [Tune directory speed_cyclecounter, undef=none, 1=32bits, 2=64bits)])
+ fi
+ AC_SUBST(SPEED_CYCLECOUNTER_OBJ)
+
+
+ # Calling conventions checking, selected according to ABI.
+ #
+ eval tmp=\"\$CALLING_CONVENTIONS_OBJS$abi1\"
+ test -n "$tmp" || eval tmp=\"\$CALLING_CONVENTIONS_OBJS$abi2\"
+ if test "$enable_assembly" = "yes"; then
+ CALLING_CONVENTIONS_OBJS="$tmp"
+ else
+ CALLING_CONVENTIONS_OBJS=""
+ fi
+
+ if test -n "$CALLING_CONVENTIONS_OBJS"; then
+ AC_DEFINE(HAVE_CALLING_CONVENTIONS,1,
+ [Define to 1 if tests/libtests has calling conventions checking for the CPU])
+ fi
+ AC_SUBST(CALLING_CONVENTIONS_OBJS)
+
+fi
+
+
+# If the user gave an MPN_PATH, use that verbatim, otherwise choose
+# according to the ABI and add "generic".
+#
+if test -n "$MPN_PATH"; then
+ path="$MPN_PATH"
+else
+ eval tmp=\"\$path$abi1\"
+ test -n "$tmp" || eval tmp=\"\$path$abi2\"
+ path="$tmp generic"
+fi
+
+
+# Long long limb setup for gmp.h.
+case $limb_chosen in
+longlong) DEFN_LONG_LONG_LIMB="#define _LONG_LONG_LIMB 1" ;;
+*) DEFN_LONG_LONG_LIMB="/* #undef _LONG_LONG_LIMB */" ;;
+esac
+AC_SUBST(DEFN_LONG_LONG_LIMB)
+
+
+# The C compiler and preprocessor, put into ANSI mode if possible.
+AC_PROG_CC
+AC_PROG_CC_STDC
+AC_PROG_CPP
+
+
+# The C compiler on the build system, and associated tests.
+GMP_PROG_CC_FOR_BUILD
+GMP_PROG_CPP_FOR_BUILD
+GMP_PROG_EXEEXT_FOR_BUILD
+GMP_C_FOR_BUILD_ANSI
+GMP_CHECK_LIBM_FOR_BUILD
+
+
+# How to assemble, used with CFLAGS etc, see mpn/Makeasm.am.
+# Using the compiler is a lot easier than figuring out how to invoke the
+# assembler directly.
+#
+test -n "$CCAS" || CCAS="$CC -c"
+AC_SUBST(CCAS)
+
+
+# The C++ compiler, if desired.
+want_cxx=no
+if test $enable_cxx != no; then
+ test_CXXFLAGS=${CXXFLAGS+set}
+ AC_PROG_CXX
+
+ echo "CXXFLAGS chosen by autoconf: $CXXFLAGS" >&AC_FD_CC
+ cxxflags_ac_prog_cxx=$CXXFLAGS
+ cxxflags_list=ac_prog_cxx
+
+ # If the user didn't specify $CXXFLAGS, then try $CFLAGS, with -g removed
+ # if AC_PROG_CXX thinks that doesn't work. $CFLAGS stands a good chance
+ # of working, eg. on a GNU system where CC=gcc and CXX=g++.
+ #
+ if test "$test_CXXFLAGS" != set; then
+ cxxflags_cflags=$CFLAGS
+ cxxflags_list="cflags $cxxflags_list"
+ if test "$ac_prog_cxx_g" = no; then
+ cxxflags_cflags=`echo "$cxxflags_cflags" | sed -e 's/ -g //' -e 's/^-g //' -e 's/ -g$//'`
+ fi
+ fi
+
+ # See if the C++ compiler works. If the user specified CXXFLAGS then all
+ # we're doing is checking whether AC_PROG_CXX succeeded, since it doesn't
+ # give a fatal error, just leaves CXX set to a default g++. If on the
+ # other hand the user didn't specify CXXFLAGS then we get to try here our
+ # $cxxflags_list alternatives.
+ #
+ # Automake includes $CPPFLAGS in a C++ compile, so we do the same here.
+ #
+ for cxxflags_choice in $cxxflags_list; do
+ eval CXXFLAGS=\"\$cxxflags_$cxxflags_choice\"
+ GMP_PROG_CXX_WORKS($CXX $CPPFLAGS $CXXFLAGS,
+ [want_cxx=yes
+ break])
+ done
+
+ # If --enable-cxx=yes but a C++ compiler can't be found, then abort.
+ if test $want_cxx = no && test $enable_cxx = yes; then
+ AC_MSG_ERROR([C++ compiler not available, see config.log for details])
+ fi
+fi
+
+AM_CONDITIONAL(WANT_CXX, test $want_cxx = yes)
+
+# FIXME: We're not interested in CXXCPP for ourselves, but if we don't do it
+# here then AC_PROG_LIBTOOL will AC_REQUIRE it (via _LT_AC_TAGCONFIG) and
+# hence execute it unconditionally, and that will fail if there's no C++
+# compiler (and no generic /lib/cpp).
+#
+if test $want_cxx = yes; then
+ AC_PROG_CXXCPP
+fi
+
+
+# Path setups for Cray, according to IEEE or CFP. These must come after
+# deciding the compiler.
+#
+GMP_CRAY_OPTIONS(
+ [add_path="cray/ieee"],
+ [add_path="cray/cfp"; extra_functions="mulwwc90"],
+ [add_path="cray/cfp"; extra_functions="mulwwj90"])
+
+
+if test -z "$MPN_PATH"; then
+ path="$add_path $path"
+fi
+
+# For a nail build, also look in "nails" subdirectories.
+#
+if test $GMP_NAIL_BITS != 0 && test -z "$MPN_PATH"; then
+ new_path=
+ for i in $path; do
+ case $i in
+ generic) new_path="$new_path $i" ;;
+ *) new_path="$new_path $i/nails $i" ;;
+ esac
+ done
+ path=$new_path
+fi
+
+
+# Put all directories into CPUVEC_list so as to get a full set of
+# CPUVEC_SETUP_$tmp_suffix defines into config.h, even if some of them are
+# empty because mmx and/or sse2 had to be dropped.
+#
+for i in $fat_path; do
+ GMP_FAT_SUFFIX(tmp_suffix, $i)
+ CPUVEC_list="$CPUVEC_list CPUVEC_SETUP_$tmp_suffix"
+done
+
+
+# If there's any sse2 or mmx in the path, check whether the assembler
+# supports it, and remove if not.
+#
+# We only need this in ABI=32, for ABI=64 on x86_64 we can assume a new
+# enough assembler.
+#
+case $host in
+ X86_PATTERN | X86_64_PATTERN)
+ if test "$ABI" = 32; then
+ case "$path $fat_path" in
+ *mmx*) GMP_ASM_X86_MMX( , [GMP_STRIP_PATH(*mmx*)]) ;;
+ esac
+ case "$path $fat_path" in
+ *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
+
+
+if test "$enable_assembly" = "no"; then
+ path="generic"
+ CFLAGS="$CFLAGS -DNO_ASM"
+# for abi in $abilist; do
+# eval unset "path_\$abi"
+# eval gcc_${abi}_cflags=\"\$gcc_${abi}_cflags -DNO_ASM\"
+# done
+fi
+
+
+cat >&AC_FD_CC <<EOF
+Decided:
+ABI=$ABI
+CC=$CC
+CFLAGS=$CFLAGS
+CPPFLAGS=$CPPFLAGS
+GMP_LDFLAGS=$GMP_LDFLAGS
+CXX=$CXX
+CXXFLAGS=$CXXFLAGS
+path=$path
+EOF
+echo "using ABI=\"$ABI\""
+echo " CC=\"$CC\""
+echo " CFLAGS=\"$CFLAGS\""
+echo " CPPFLAGS=\"$CPPFLAGS\""
+if test $want_cxx = yes; then
+ echo " CXX=\"$CXX\""
+ echo " CXXFLAGS=\"$CXXFLAGS\""
+fi
+echo " MPN_PATH=\"$path\""
+
+
+CL_AS_NOEXECSTACK
+
+GMP_PROG_AR
+GMP_PROG_NM
+
+case $host in
+ # FIXME: On AIX 3 and 4, $libname.a is included in libtool
+ # $library_names_spec, so libgmp.a becomes a symlink to libgmp.so, making
+ # it impossible to build shared and static libraries simultaneously.
+ # Disable shared libraries by default, but let the user override with
+ # --enable-shared --disable-static.
+ #
+ # FIXME: This $libname.a problem looks like it might apply to *-*-amigaos*
+ # and *-*-os2* too, but wait for someone to test this before worrying
+ # about it. If there is a problem then of course libtool is the right
+ # place to fix it.
+ #
+ [*-*-aix[34]*])
+ if test -z "$enable_shared"; then enable_shared=no; fi ;;
+esac
+
+
+# Configs for Windows DLLs.
+
+AC_LIBTOOL_WIN32_DLL
+
+AC_SUBST(LIBGMP_DLL,0)
+case $host in
+ *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
+ # By default, build only static.
+ if test -z "$enable_shared"; then
+ enable_shared=no
+ fi
+ # Don't allow both static and DLL.
+ if test "$enable_shared" != no && test "$enable_static" != no; then
+ AC_MSG_ERROR([cannot build both static and DLL, since gmp.h is different for each.
+Use "--disable-static --enable-shared" to build just a DLL.])
+ fi
+
+ # "-no-undefined" is required when building a DLL, see documentation on
+ # AC_LIBTOOL_WIN32_DLL.
+ #
+ # "-Wl,--export-all-symbols" is a bit of a hack, it gets all libgmp and
+ # libgmpxx functions and variables exported. This is what libtool did
+ # in the past, and it's convenient for us in the test programs.
+ #
+ # Maybe it'd be prudent to check for --export-all-symbols before using
+ # it, but it seems to have been in ld since at least 2000, and there's
+ # not really any alternative we want to take up at the moment.
+ #
+ # "-Wl,output-def" is used to get a .def file for use by MS lib to make
+ # a .lib import library, described in the manual. libgmp-3.dll.def
+ # corresponds to the libmp-3.dll.def generated by libtool (as a result
+ # of -export-symbols on that library).
+ #
+ # Incidentally, libtool does generate an import library libgmp.dll.a,
+ # but it's "ar" format and cannot be used by the MS linker. There
+ # doesn't seem to be any GNU tool for generating or converting to .lib.
+ #
+ # FIXME: The .def files produced by -Wl,output-def include isascii,
+ # iscsym, iscsymf and toascii, apparently because mingw ctype.h doesn't
+ # inline isascii (used in gmp). It gives an extern inline for
+ # __isascii, but for some reason not the plain isascii.
+ #
+ if test "$enable_shared" = yes; then
+ GMP_LDFLAGS="$GMP_LDFLAGS -no-undefined -Wl,--export-all-symbols"
+ LIBGMP_LDFLAGS="$LIBGMP_LDFLAGS -Wl,--output-def,.libs/libgmp-3.dll.def"
+ LIBGMPXX_LDFLAGS="$LIBGMP_LDFLAGS -Wl,--output-def,.libs/libgmpxx-3.dll.def"
+ LIBGMP_DLL=1
+ fi
+ ;;
+esac
+
+
+# Ensure that $CONFIG_SHELL is available for AC_LIBTOOL_SYS_MAX_CMD_LEN.
+# It's often set already by _LT_AC_PROG_ECHO_BACKSLASH or
+# _AS_LINENO_PREPARE, but not always.
+#
+# The symptom of CONFIG_SHELL unset is some "expr" errors during the test,
+# and an empty result. This only happens when invoked as "sh configure",
+# ie. no path, and can be seen for instance on ia64-*-hpux*.
+#
+# FIXME: Newer libtool should have it's own fix for this.
+#
+if test -z "$CONFIG_SHELL"; then
+ CONFIG_SHELL=$SHELL
+fi
+
+# Enable CXX in libtool only if we want it, and never enable GCJ, nor RC on
+# mingw and cygwin. Under --disable-cxx this avoids some error messages
+# from libtool arising from the fact we didn't actually run AC_PROG_CXX.
+# Notice that any user-supplied --with-tags setting takes precedence.
+#
+# FIXME: Is this the right way to get this effect? Very possibly not, but
+# the current _LT_AC_TAGCONFIG doesn't really suggest an alternative.
+#
+if test "${with_tags+set}" != set; then
+ if test $want_cxx = yes; then
+ with_tags=CXX
+ else
+ with_tags=
+ fi
+fi
+
+# The dead hand of AC_REQUIRE makes AC_PROG_LIBTOOL expand and execute
+# AC_PROG_F77, even when F77 is not in the selected with_tags. This is
+# probably harmless, but it's unsightly and bloats our configure, so pretend
+# AC_PROG_F77 has been expanded already.
+#
+# FIXME: Rumour has it libtool will one day provide a way for a configure.in
+# to say what it wants from among supported languages etc.
+#
+#AC_PROVIDE([AC_PROG_F77])
+
+AC_PROG_LIBTOOL
+
+# Generate an error here if attempting to build both shared and static when
+# $libname.a is in $library_names_spec (as mentioned above), rather than
+# wait for ar or ld to fail.
+#
+if test "$enable_shared" = yes && test "$enable_static" = yes; then
+ case $library_names_spec in
+ *libname.a*)
+ AC_MSG_ERROR([cannot create both shared and static libraries on this system, --disable one of the two])
+ ;;
+ esac
+fi
+
+AM_CONDITIONAL(ENABLE_STATIC, test "$enable_static" = yes)
+
+
+# Many of these library and header checks are for the benefit of
+# supplementary programs. libgmp doesn't use anything too weird.
+
+AC_HEADER_STDC
+AC_HEADER_TIME
+
+# Reasons for testing:
+# float.h - not in SunOS bundled cc
+# invent.h - IRIX specific
+# langinfo.h - X/Open standard only, not in djgpp for instance
+# locale.h - old systems won't have this
+# nl_types.h - X/Open standard only, not in djgpp for instance
+# (usually langinfo.h gives nl_item etc, but not on netbsd 1.4.1)
+# sys/attributes.h - IRIX specific
+# sys/iograph.h - IRIX specific
+# sys/mman.h - not in Cray Unicos
+# sys/param.h - not in mingw
+# sys/processor.h - solaris specific, though also present in macos
+# sys/pstat.h - HPUX specific
+# sys/resource.h - not in mingw
+# sys/sysctl.h - not in mingw
+# sys/sysinfo.h - OSF specific
+# sys/syssgi.h - IRIX specific
+# sys/systemcfg.h - AIX specific
+# sys/time.h - autoconf suggests testing, don't know anywhere without it
+# sys/times.h - not in mingw
+# machine/hal_sysinfo.h - OSF specific
+#
+# inttypes.h, stdint.h, unistd.h and sys/types.h are already in the autoconf
+# default tests
+#
+AC_CHECK_HEADERS(fcntl.h float.h invent.h langinfo.h locale.h nl_types.h sys/attributes.h sys/iograph.h sys/mman.h sys/param.h sys/processor.h sys/pstat.h sys/sysinfo.h sys/syssgi.h sys/systemcfg.h sys/time.h sys/times.h)
+
+# On SunOS, sys/resource.h needs sys/time.h (for struct timeval)
+AC_CHECK_HEADERS(sys/resource.h,,,
+[#if TIME_WITH_SYS_TIME
+# include <sys/time.h>
+# include <time.h>
+#else
+# if HAVE_SYS_TIME_H
+# include <sys/time.h>
+# else
+# include <time.h>
+# endif
+#endif])
+
+# On NetBSD and OpenBSD, sys/sysctl.h needs sys/param.h for various constants
+AC_CHECK_HEADERS(sys/sysctl.h,,,
+[#if HAVE_SYS_PARAM_H
+# include <sys/param.h>
+#endif])
+
+# On OSF 4.0, <machine/hal_sysinfo.h> must have <sys/sysinfo.h> for ulong_t
+AC_CHECK_HEADERS(machine/hal_sysinfo.h,,,
+[#if HAVE_SYS_SYSINFO_H
+# include <sys/sysinfo.h>
+#endif])
+
+# Reasons for testing:
+# optarg - not declared in mingw
+# fgetc, fscanf, ungetc, vfprintf - not declared in SunOS 4
+# sys_errlist, sys_nerr - not declared in SunOS 4
+#
+# optarg should be in unistd.h and the rest in stdio.h, both of which are
+# in the autoconf default includes.
+#
+# sys_errlist and sys_nerr are supposed to be in <errno.h> on SunOS according
+# to the man page (but aren't), in glibc they're in stdio.h.
+#
+AC_CHECK_DECLS([fgetc, fscanf, optarg, ungetc, vfprintf])
+AC_CHECK_DECLS([sys_errlist, sys_nerr], , ,
+[#include <stdio.h>
+#include <errno.h>])
+
+AC_TYPE_SIGNAL
+
+# Reasons for testing:
+# intmax_t - C99
+# long double - not in the HP bundled K&R cc
+# long long - only in reasonably recent compilers
+# ptrdiff_t - seems to be everywhere, maybe don't need to check this
+# quad_t - BSD specific
+# uint_least32_t - C99
+#
+# the default includes are sufficient for all these types
+#
+AC_CHECK_TYPES([intmax_t, long double, long long, ptrdiff_t, quad_t,
+ uint_least32_t, intptr_t])
+
+AC_C_STRINGIZE
+
+# FIXME: Really want #ifndef __cplusplus around the #define volatile
+# replacement autoconf gives, since volatile is always available in C++.
+# But we don't use it in C++ currently.
+AC_C_VOLATILE
+
+AC_C_RESTRICT
+
+# GMP_C_STDARG
+GMP_C_ATTRIBUTE_CONST
+GMP_C_ATTRIBUTE_MALLOC
+GMP_C_ATTRIBUTE_MODE
+GMP_C_ATTRIBUTE_NORETURN
+
+GMP_H_EXTERN_INLINE
+
+# from libtool
+AC_CHECK_LIBM
+AC_SUBST(LIBM)
+
+GMP_FUNC_ALLOCA
+GMP_OPTION_ALLOCA
+
+GMP_H_HAVE_FILE
+
+AC_C_BIGENDIAN(
+ [AC_DEFINE(HAVE_LIMB_BIG_ENDIAN, 1)
+ GMP_DEFINE_RAW("define_not_for_expansion(\`HAVE_LIMB_BIG_ENDIAN')", POST)],
+ [AC_DEFINE(HAVE_LIMB_LITTLE_ENDIAN, 1)
+ GMP_DEFINE_RAW("define_not_for_expansion(\`HAVE_LIMB_LITTLE_ENDIAN')", POST)
+ ], [:])
+AH_VERBATIM([HAVE_LIMB],
+[/* Define one of these to 1 for the endianness of `mp_limb_t'.
+ If the endianness is not a simple big or little, or you don't know what
+ it is, then leave both undefined. */
+#undef HAVE_LIMB_BIG_ENDIAN
+#undef HAVE_LIMB_LITTLE_ENDIAN])
+
+GMP_C_DOUBLE_FORMAT
+
+
+# Reasons for testing:
+# alarm - not in mingw
+# attr_get - IRIX specific
+# clock_gettime - not in glibc 2.2.4, only very recent systems
+# cputime - not in glibc
+# getsysinfo - OSF specific
+# getrusage - not in mingw
+# gettimeofday - not in mingw
+# mmap - not in mingw, djgpp
+# nl_langinfo - X/Open standard only, not in djgpp for instance
+# obstack_vprintf - glibc specific
+# processor_info - solaris specific
+# pstat_getprocessor - HPUX specific (10.x and up)
+# raise - an ANSI-ism, though probably almost universal by now
+# read_real_time - AIX specific
+# sigaction - not in mingw
+# sigaltstack - not in mingw, or old AIX (reputedly)
+# sigstack - not in mingw
+# strerror - not in SunOS
+# strnlen - glibc extension (some other systems too)
+# syssgi - IRIX specific
+# times - not in mingw
+#
+# AC_FUNC_STRNLEN is not used because we don't want the AC_LIBOBJ
+# replacement setups it gives. It detects a faulty strnlen on AIX, but
+# missing out on that test is ok since our only use of strnlen is in
+# __gmp_replacement_vsnprintf which is not required on AIX since it has a
+# vsnprintf.
+#
+AC_CHECK_FUNCS(alarm attr_get clock cputime getpagesize getrusage gettimeofday getsysinfo localeconv memset mmap mprotect nl_langinfo obstack_vprintf popen processor_info pstat_getprocessor raise read_real_time sigaction sigaltstack sigstack syssgi strchr strerror strnlen strtol strtoul sysconf sysctl sysctlbyname times)
+
+# clock_gettime is in librt on *-*-osf5.1 and on glibc, so att -lrt to
+# TUNE_LIBS if needed. On linux (tested on x86_32, 2.6.26),
+# clock_getres reports ns accuracy, while in a quick test on osf
+# clock_getres said only 1 millisecond.
+
+old_LIBS="$LIBS"
+AC_SEARCH_LIBS(clock_gettime, rt, [
+ AC_DEFINE([HAVE_CLOCK_GETTIME],1,[Define to 1 if you have the `clock_gettime' function])])
+TUNE_LIBS="$LIBS"
+LIBS="$old_LIBS"
+
+AC_SUBST(TUNE_LIBS)
+
+GMP_FUNC_VSNPRINTF
+GMP_FUNC_SSCANF_WRITABLE_INPUT
+
+# Reasons for checking:
+# pst_processor psp_iticksperclktick - not in hpux 9
+#
+AC_CHECK_MEMBER(struct pst_processor.psp_iticksperclktick,
+ [AC_DEFINE(HAVE_PSP_ITICKSPERCLKTICK, 1,
+[Define to 1 if <sys/pstat.h> `struct pst_processor' exists
+and contains `psp_iticksperclktick'.])],,
+ [#include <sys/pstat.h>])
+
+# C++ tests, when required
+#
+if test $enable_cxx = yes; then
+ AC_LANG_PUSH(C++)
+
+ # Reasons for testing:
+ # <sstream> - not in g++ 2.95.2
+ # std::locale - not in g++ 2.95.4
+ #
+ AC_CHECK_HEADERS([sstream])
+ AC_CHECK_TYPES([std::locale],,,[#include <locale>])
+
+ AC_LANG_POP(C++)
+fi
+
+
+# Pick the correct source files in $path and link them to mpn/.
+# $gmp_mpn_functions lists all functions we need.
+#
+# The rule is to find a file with the function name and a .asm, .S,
+# .s, or .c extension. Certain multi-function files with special names
+# can provide some functions too. (mpn/Makefile.am passes
+# -DOPERATION_<func> to get them to generate the right code.)
+
+# Note: $gmp_mpn_functions must have mod_1 before pre_mod_1 so the former
+# can optionally provide the latter as an extra entrypoint. Likewise
+# divrem_1 and pre_divrem_1.
+
+gmp_mpn_functions_optional="umul udiv \
+ invert_limb sqr_diagonal sqr_diag_addlsh1 \
+ mul_2 mul_3 mul_4 mul_5 mul_6 \
+ addmul_2 addmul_3 addmul_4 addmul_5 addmul_6 addmul_7 addmul_8 \
+ addlsh1_n sublsh1_n rsblsh1_n rsh1add_n rsh1sub_n \
+ addlsh2_n sublsh2_n rsblsh2_n \
+ addlsh_n sublsh_n rsblsh_n \
+ add_n_sub_n addaddmul_1msb0"
+
+gmp_mpn_functions="$extra_functions \
+ add add_1 add_n sub sub_1 sub_n cnd_add_n cnd_sub_n neg com \
+ 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 \
+ 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 \
+ scan0 scan1 popcount hamdist cmp \
+ perfsqr perfpow \
+ 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 \
+ hgcd_matrix hgcd2 hgcd_step hgcd_reduce hgcd hgcd_appr \
+ hgcd2_jacobi hgcd_jacobi \
+ mullo_n mullo_basecase \
+ toom22_mul toom32_mul toom42_mul toom52_mul toom62_mul \
+ toom33_mul toom43_mul toom53_mul toom54_mul toom63_mul \
+ toom44_mul \
+ toom6h_mul toom6_sqr toom8h_mul toom8_sqr \
+ toom_couple_handling \
+ toom2_sqr toom3_sqr toom4_sqr \
+ toom_eval_dgr3_pm1 toom_eval_dgr3_pm2 \
+ toom_eval_pm1 toom_eval_pm2 toom_eval_pm2exp toom_eval_pm2rexp \
+ toom_interpolate_5pts toom_interpolate_6pts toom_interpolate_7pts \
+ toom_interpolate_8pts toom_interpolate_12pts toom_interpolate_16pts \
+ invertappr invert binvert mulmod_bnm1 sqrmod_bnm1 \
+ div_qr_1 div_qr_1n_pi1 \
+ div_qr_2 div_qr_2n_pi1 div_qr_2u_pi1 \
+ sbpi1_div_q sbpi1_div_qr sbpi1_divappr_q \
+ 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 \
+ dcpi1_bdiv_q dcpi1_bdiv_qr \
+ mu_bdiv_q mu_bdiv_qr \
+ bdiv_q bdiv_qr broot brootinv bsqrt bsqrtinv \
+ divexact bdiv_dbm1c redc_1 redc_2 redc_n powm powlo sec_powm \
+ sec_mul sec_sqr sec_div_qr sec_div_r sec_pi1_div_qr sec_pi1_div_r \
+ sec_add_1 sec_sub_1 sec_invert \
+ trialdiv remove \
+ and_n andn_n nand_n ior_n iorn_n nior_n xor_n xnor_n \
+ copyi copyd zero sec_tabselect \
+ comb_tables \
+ $gmp_mpn_functions_optional"
+
+define(GMP_MULFUNC_CHOICES,
+[# functions that can be provided by multi-function files
+tmp_mulfunc=
+case $tmp_fn in
+ add_n|sub_n) tmp_mulfunc="aors_n" ;;
+ add_err1_n|sub_err1_n)
+ tmp_mulfunc="aors_err1_n" ;;
+ add_err2_n|sub_err2_n)
+ tmp_mulfunc="aors_err2_n" ;;
+ add_err3_n|sub_err3_n)
+ tmp_mulfunc="aors_err3_n" ;;
+ cnd_add_n|cnd_sub_n) tmp_mulfunc="cnd_aors_n" ;;
+ sec_add_1|sec_sub_1) tmp_mulfunc="sec_aors_1" ;;
+ addmul_1|submul_1) tmp_mulfunc="aorsmul_1" ;;
+ mul_2|addmul_2) tmp_mulfunc="aormul_2" ;;
+ mul_3|addmul_3) tmp_mulfunc="aormul_3" ;;
+ mul_4|addmul_4) tmp_mulfunc="aormul_4" ;;
+ popcount|hamdist) tmp_mulfunc="popham" ;;
+ and_n|andn_n|nand_n | ior_n|iorn_n|nior_n | xor_n|xnor_n)
+ tmp_mulfunc="logops_n" ;;
+ lshift|rshift) tmp_mulfunc="lorrshift";;
+ addlsh1_n)
+ tmp_mulfunc="aorslsh1_n aorrlsh1_n aorsorrlsh1_n";;
+ sublsh1_n)
+ tmp_mulfunc="aorslsh1_n sorrlsh1_n aorsorrlsh1_n";;
+ rsblsh1_n)
+ tmp_mulfunc="aorrlsh1_n sorrlsh1_n aorsorrlsh1_n";;
+ addlsh2_n)
+ tmp_mulfunc="aorslsh2_n aorrlsh2_n aorsorrlsh2_n";;
+ sublsh2_n)
+ tmp_mulfunc="aorslsh2_n sorrlsh2_n aorsorrlsh2_n";;
+ rsblsh2_n)
+ tmp_mulfunc="aorrlsh2_n sorrlsh2_n aorsorrlsh2_n";;
+ addlsh_n)
+ tmp_mulfunc="aorslsh_n aorrlsh_n aorsorrlsh_n";;
+ sublsh_n)
+ tmp_mulfunc="aorslsh_n sorrlsh_n aorsorrlsh_n";;
+ rsblsh_n)
+ tmp_mulfunc="aorrlsh_n sorrlsh_n aorsorrlsh_n";;
+ rsh1add_n|rsh1sub_n)
+ tmp_mulfunc="rsh1aors_n";;
+ sec_div_qr|sec_div_r)
+ tmp_mulfunc="sec_div";;
+ sec_pi1_div_qr|sec_pi1_div_r)
+ tmp_mulfunc="sec_pi1_div";;
+esac
+])
+
+# the list of all object files used by mpn/Makefile.in and the
+# top-level Makefile.in, respectively
+mpn_objects=
+mpn_objs_in_libgmp=
+
+# links from the sources, to be removed by "make distclean"
+gmp_srclinks=
+
+
+# mpn_relative_top_srcdir is $top_srcdir, but for use from within the mpn
+# build directory. If $srcdir is relative then we use a relative path too,
+# so the two trees can be moved together.
+case $srcdir in
+ [[\\/]* | ?:[\\/]*]) # absolute, as per autoconf
+ mpn_relative_top_srcdir=$srcdir ;;
+ *) # relative
+ mpn_relative_top_srcdir=../$srcdir ;;
+esac
+
+
+define(MPN_SUFFIXES,[asm S s c])
+
+dnl Usage: GMP_FILE_TO_FUNCTION_BASE(func,file)
+dnl
+dnl Set $func to the function base name for $file, eg. dive_1 gives
+dnl divexact_1.
+dnl
+define(GMP_FILE_TO_FUNCTION,
+[case $$2 in
+ dive_1) $1=divexact_1 ;;
+ diveby3) $1=divexact_by3c ;;
+ pre_divrem_1) $1=preinv_divrem_1 ;;
+ mode1o) $1=modexact_1c_odd ;;
+ pre_mod_1) $1=preinv_mod_1 ;;
+ mod_1_1) $1=mod_1_1p ;;
+ mod_1_1_cps) $1=mod_1_1p_cps ;;
+ mod_1_2) $1=mod_1s_2p ;;
+ mod_1_2_cps) $1=mod_1s_2p_cps ;;
+ mod_1_3) $1=mod_1s_3p ;;
+ mod_1_3_cps) $1=mod_1s_3p_cps ;;
+ mod_1_4) $1=mod_1s_4p ;;
+ mod_1_4_cps) $1=mod_1s_4p_cps ;;
+ *) $1=$$2 ;;
+esac
+])
+
+# Fat binary setups.
+#
+# We proceed through each $fat_path directory, and look for $fat_function
+# routines there. Those found are incorporated in the build by generating a
+# little mpn/<foo>.asm or mpn/<foo>.c file in the build directory, with
+# suitable function renaming, and adding that to $mpn_objects (the same as a
+# normal mpn file).
+#
+# fat.h is generated with macros to let internal calls to each $fat_function
+# go directly through __gmpn_cpuvec, plus macros and declarations helping to
+# setup that structure, on a per-directory basis ready for
+# mpn/<cpu>/fat/fat.c.
+#
+# fat.h includes thresholds listed in $fat_thresholds, extracted from
+# gmp-mparam.h in each directory. An overall maximum for each threshold is
+# established, for use in making fixed size arrays of temporary space.
+# (Eg. MUL_TOOM33_THRESHOLD_LIMIT used by mpn/generic/mul.c.)
+#
+# It'd be possible to do some of this manually, but when there's more than a
+# few functions and a few directories it becomes very tedious, and very
+# prone to having some routine accidentally omitted. On that basis it seems
+# best to automate as much as possible, even if the code to do so is a bit
+# ugly.
+#
+
+if test -n "$fat_path"; then
+ # Usually the mpn build directory is created with mpn/Makefile
+ # instantiation, but we want to write to it sooner.
+ mkdir mpn 2>/dev/null
+
+ echo "/* fat.h - setups for fat binaries." >fat.h
+ echo " Generated by configure - DO NOT EDIT. */" >>fat.h
+
+ AC_DEFINE(WANT_FAT_BINARY, 1, [Define to 1 when building a fat binary.])
+ GMP_DEFINE(WANT_FAT_BINARY, yes)
+
+ # Don't want normal copies of fat functions
+ for tmp_fn in $fat_functions; do
+ GMP_REMOVE_FROM_LIST(gmp_mpn_functions, $tmp_fn)
+ GMP_REMOVE_FROM_LIST(gmp_mpn_functions_optional, $tmp_fn)
+ done
+
+ for tmp_fn in $fat_functions; do
+ GMP_FILE_TO_FUNCTION(tmp_fbase,tmp_fn)
+ echo "
+#ifndef OPERATION_$tmp_fn
+#undef mpn_$tmp_fbase
+#define mpn_$tmp_fbase (*__gmpn_cpuvec.$tmp_fbase)
+#endif
+DECL_$tmp_fbase (__MPN(${tmp_fbase}_init));" >>fat.h
+ # encourage various macros to use fat functions
+ AC_DEFINE_UNQUOTED(HAVE_NATIVE_mpn_$tmp_fbase)
+ done
+
+ echo "" >>fat.h
+ echo "/* variable thresholds */" >>fat.h
+ for tmp_tn in $fat_thresholds; do
+ echo "#undef $tmp_tn" >>fat.h
+ echo "#define $tmp_tn CPUVEC_THRESHOLD (`echo $tmp_tn | tr [A-Z] [a-z]`)" >>fat.h
+ done
+
+ echo "
+/* Copy all fields into __gmpn_cpuvec.
+ memcpy is not used because it might operate byte-wise (depending on its
+ implementation), and we need the function pointer writes to be atomic.
+ "volatile" discourages the compiler from trying to optimize this. */
+#define CPUVEC_INSTALL(vec) \\
+ do { \\
+ volatile struct cpuvec_t *p = &__gmpn_cpuvec; \\" >>fat.h
+ for tmp_fn in $fat_functions; do
+ GMP_FILE_TO_FUNCTION(tmp_fbase,tmp_fn)
+ echo " p->$tmp_fbase = vec.$tmp_fbase; \\" >>fat.h
+ done
+ for tmp_tn in $fat_thresholds; do
+ tmp_field_name=`echo $tmp_tn | tr [[A-Z]] [[a-z]]`
+ echo " p->$tmp_field_name = vec.$tmp_field_name; \\" >>fat.h
+ done
+ echo " } while (0)" >>fat.h
+
+ echo "
+/* A helper to check all fields are filled. */
+#define ASSERT_CPUVEC(vec) \\
+ do { \\" >>fat.h
+ for tmp_fn in $fat_functions; do
+ GMP_FILE_TO_FUNCTION(tmp_fbase,tmp_fn)
+ echo " ASSERT (vec.$tmp_fbase != NULL); \\" >>fat.h
+ done
+ for tmp_tn in $fat_thresholds; do
+ tmp_field_name=`echo $tmp_tn | tr [[A-Z]] [[a-z]]`
+ echo " ASSERT (vec.$tmp_field_name != 0); \\" >>fat.h
+ done
+ echo " } while (0)" >>fat.h
+
+ echo "
+/* Call ITERATE(field) for each fat threshold field. */
+#define ITERATE_FAT_THRESHOLDS() \\
+ do { \\" >>fat.h
+ for tmp_tn in $fat_thresholds; do
+ tmp_field_name=`echo $tmp_tn | tr [[A-Z]] [[a-z]]`
+ echo " ITERATE ($tmp_tn, $tmp_field_name); \\" >>fat.h
+ done
+ echo " } while (0)" >>fat.h
+
+ for tmp_dir in $fat_path; do
+ CPUVEC_SETUP=
+ THRESH_ASM_SETUP=
+ echo "" >>fat.h
+ GMP_FAT_SUFFIX(tmp_suffix, $tmp_dir)
+
+ # In order to keep names unique on a DOS 8.3 filesystem, use a prefix
+ # (rather than a suffix) for the generated file names, and abbreviate.
+ case $tmp_suffix in
+ pentium) tmp_prefix=p ;;
+ pentium_mmx) tmp_prefix=pm ;;
+ p6_mmx) tmp_prefix=p2 ;;
+ p6_p3mmx) tmp_prefix=p3 ;;
+ pentium4) tmp_prefix=p4 ;;
+ pentium4_mmx) tmp_prefix=p4m ;;
+ pentium4_sse2) tmp_prefix=p4s ;;
+ k6_mmx) tmp_prefix=k6m ;;
+ k6_k62mmx) tmp_prefix=k62 ;;
+ k7_mmx) tmp_prefix=k7m ;;
+ *) tmp_prefix=$tmp_suffix ;;
+ esac
+
+ # Extract desired thresholds from gmp-mparam.h file in this directory,
+ # if present.
+ tmp_mparam=$srcdir/mpn/$tmp_dir/gmp-mparam.h
+ if test -f $tmp_mparam; then
+ for tmp_tn in $fat_thresholds; do
+ tmp_thresh=`sed -n "s/^#define $tmp_tn[ ]*\\([0-9][0-9]*\\).*$/\\1/p" $tmp_mparam`
+ if test -n "$tmp_thresh"; then
+ THRESH_ASM_SETUP=["${THRESH_ASM_SETUP}define($tmp_tn,$tmp_thresh)
+"]
+ CPUVEC_SETUP="$CPUVEC_SETUP decided_cpuvec.`echo $tmp_tn | tr [[A-Z]] [[a-z]]` = $tmp_thresh; \\
+"
+ eval tmp_limit=\$${tmp_tn}_LIMIT
+ if test -z "$tmp_limit"; then
+ tmp_limit=0
+ fi
+ if test $tmp_thresh -gt $tmp_limit; then
+ eval ${tmp_tn}_LIMIT=$tmp_thresh
+ fi
+ fi
+ done
+ fi
+
+ for tmp_fn in $fat_functions; do
+ GMP_MULFUNC_CHOICES
+
+ for tmp_base in $tmp_fn $tmp_mulfunc; do
+ for tmp_ext in MPN_SUFFIXES; do
+ tmp_file=$srcdir/mpn/$tmp_dir/$tmp_base.$tmp_ext
+ if test -f $tmp_file; then
+
+ # If the host uses a non-standard ABI, check if tmp_file supports it
+ #
+ if test -n "$GMP_NONSTD_ABI" && test $tmp_ext != "c"; then
+ abi=[`sed -n 's/^[ ]*ABI_SUPPORT(\(.*\))/\1/p' $tmp_file `]
+ if echo "$abi" | grep -q "\\b${GMP_NONSTD_ABI}\\b"; then
+ true
+ else
+ continue
+ fi
+ fi
+
+ mpn_objects="$mpn_objects ${tmp_prefix}_$tmp_fn.lo"
+ mpn_objs_in_libgmp="$mpn_objs_in_libgmp mpn/${tmp_prefix}_$tmp_fn.lo"
+
+ GMP_FILE_TO_FUNCTION(tmp_fbase,tmp_fn)
+
+ # carry-in variant, eg. divrem_1c or modexact_1c_odd
+ case $tmp_fbase in
+ *_1*) tmp_fbasec=`echo $tmp_fbase | sed 's/_1/_1c/'` ;;
+ *) tmp_fbasec=${tmp_fbase}c ;;
+ esac
+
+ # Create a little file doing an include from srcdir. The
+ # OPERATION and renamings aren't all needed all the time, but
+ # they don't hurt if unused.
+ #
+ # FIXME: Should generate these via config.status commands.
+ # Would need them all in one AC_CONFIG_COMMANDS though, since
+ # that macro doesn't accept a set of separate commands generated
+ # by shell code.
+ #
+ case $tmp_ext in
+ asm)
+ # hide the d-n-l from autoconf's error checking
+ tmp_d_n_l=d""nl
+ echo ["$tmp_d_n_l mpn_$tmp_fbase - from $tmp_dir directory for fat binary.
+$tmp_d_n_l Generated by configure - DO NOT EDIT.
+
+define(OPERATION_$tmp_fn)
+define(__gmpn_$tmp_fbase, __gmpn_${tmp_fbase}_$tmp_suffix)
+define(__gmpn_$tmp_fbasec,__gmpn_${tmp_fbasec}_${tmp_suffix})
+define(__gmpn_preinv_${tmp_fbase},__gmpn_preinv_${tmp_fbase}_${tmp_suffix})
+define(__gmpn_${tmp_fbase}_cps,__gmpn_${tmp_fbase}_cps_${tmp_suffix})
+
+$tmp_d_n_l For k6 and k7 gcd_1 calling their corresponding mpn_modexact_1_odd
+ifdef(\`__gmpn_modexact_1_odd',,
+\`define(__gmpn_modexact_1_odd,__gmpn_modexact_1_odd_${tmp_suffix})')
+
+$THRESH_ASM_SETUP
+include][($mpn_relative_top_srcdir/mpn/$tmp_dir/$tmp_base.asm)
+"] >mpn/${tmp_prefix}_$tmp_fn.asm
+ ;;
+ c)
+ echo ["/* mpn_$tmp_fbase - from $tmp_dir directory for fat binary.
+ Generated by configure - DO NOT EDIT. */
+
+#define OPERATION_$tmp_fn 1
+#define __gmpn_$tmp_fbase __gmpn_${tmp_fbase}_$tmp_suffix
+#define __gmpn_$tmp_fbasec __gmpn_${tmp_fbasec}_${tmp_suffix}
+#define __gmpn_preinv_${tmp_fbase} __gmpn_preinv_${tmp_fbase}_${tmp_suffix}
+#define __gmpn_${tmp_fbase}_cps __gmpn_${tmp_fbase}_cps_${tmp_suffix}
+
+#include \"$mpn_relative_top_srcdir/mpn/$tmp_dir/$tmp_base.c\"
+"] >mpn/${tmp_prefix}_$tmp_fn.c
+ ;;
+ esac
+
+ # Prototype, and append to CPUVEC_SETUP for this directory.
+ echo "DECL_$tmp_fbase (__gmpn_${tmp_fbase}_$tmp_suffix);" >>fat.h
+ CPUVEC_SETUP="$CPUVEC_SETUP decided_cpuvec.$tmp_fbase = __gmpn_${tmp_fbase}_${tmp_suffix}; \\
+"
+ # Ditto for any preinv variant (preinv_divrem_1, preinv_mod_1).
+ if grep "^PROLOGUE(mpn_preinv_$tmp_fn)" $tmp_file >/dev/null; then
+ echo "DECL_preinv_$tmp_fbase (__gmpn_preinv_${tmp_fbase}_$tmp_suffix);" >>fat.h
+ CPUVEC_SETUP="$CPUVEC_SETUP decided_cpuvec.preinv_$tmp_fbase = __gmpn_preinv_${tmp_fbase}_${tmp_suffix}; \\
+"
+ fi
+
+ # Ditto for any mod_1...cps variant
+ if grep "^PROLOGUE(mpn_${tmp_fbase}_cps)" $tmp_file >/dev/null; then
+ echo "DECL_${tmp_fbase}_cps (__gmpn_${tmp_fbase}_cps_$tmp_suffix);" >>fat.h
+ CPUVEC_SETUP="$CPUVEC_SETUP decided_cpuvec.${tmp_fbase}_cps = __gmpn_${tmp_fbase}_cps_${tmp_suffix}; \\
+"
+ fi
+ fi
+ done
+ done
+ done
+
+ # Emit CPUVEC_SETUP for this directory
+ echo "" >>fat.h
+ echo "#define CPUVEC_SETUP_$tmp_suffix \\" >>fat.h
+ echo " do { \\" >>fat.h
+ echo "$CPUVEC_SETUP } while (0)" >>fat.h
+ done
+
+ # Emit threshold limits
+ echo "" >>fat.h
+ for tmp_tn in $fat_thresholds; do
+ eval tmp_limit=\$${tmp_tn}_LIMIT
+ echo "#define ${tmp_tn}_LIMIT $tmp_limit" >>fat.h
+ done
+fi
+
+
+# Normal binary setups.
+#
+
+for tmp_ext in MPN_SUFFIXES; do
+ eval found_$tmp_ext=no
+done
+
+for tmp_fn in $gmp_mpn_functions; do
+ for tmp_ext in MPN_SUFFIXES; do
+ test "$no_create" = yes || rm -f mpn/$tmp_fn.$tmp_ext
+ done
+
+ # mpn_preinv_divrem_1 might have been provided by divrem_1.asm, likewise
+ # mpn_preinv_mod_1 by mod_1.asm.
+ case $tmp_fn in
+ pre_divrem_1)
+ if test "$HAVE_NATIVE_mpn_preinv_divrem_1" = yes; then continue; fi ;;
+ pre_mod_1)
+ if test "$HAVE_NATIVE_mpn_preinv_mod_1" = yes; then continue; fi ;;
+ esac
+
+ GMP_MULFUNC_CHOICES
+
+ found=no
+ for tmp_dir in $path; do
+ for tmp_base in $tmp_fn $tmp_mulfunc; do
+ for tmp_ext in MPN_SUFFIXES; do
+ tmp_file=$srcdir/mpn/$tmp_dir/$tmp_base.$tmp_ext
+ if test -f $tmp_file; then
+
+ # For a nails build, check if the file supports our nail bits.
+ # Generic code always supports all nails.
+ #
+ # FIXME: When a multi-function file is selected to provide one of
+ # the nails-neutral routines, like logops_n for and_n, the
+ # PROLOGUE grepping will create HAVE_NATIVE_mpn_<foo> defines for
+ # all functions in that file, even if they haven't all been
+ # nailified. Not sure what to do about this, it's only really a
+ # problem for logops_n, and it's not too terrible to insist those
+ # get nailified always.
+ #
+ if test $GMP_NAIL_BITS != 0 && test $tmp_dir != generic; then
+ case $tmp_fn in
+ and_n | ior_n | xor_n | andn_n | \
+ copyi | copyd | \
+ popcount | hamdist | \
+ udiv | udiv_w_sdiv | umul | \
+ cntlz | invert_limb)
+ # these operations are either unaffected by nails or defined
+ # to operate on full limbs
+ ;;
+ *)
+ nails=[`sed -n 's/^[ ]*NAILS_SUPPORT(\(.*\))/\1/p' $tmp_file `]
+ for n in $nails; do
+ case $n in
+ *-*)
+ n_start=`echo "$n" | sed -n 's/\(.*\)-.*/\1/p'`
+ n_end=`echo "$n" | sed -n 's/.*-\(.*\)/\1/p'`
+ ;;
+ *)
+ n_start=$n
+ n_end=$n
+ ;;
+ esac
+ if test $GMP_NAIL_BITS -ge $n_start && test $GMP_NAIL_BITS -le $n_end; then
+ found=yes
+ break
+ fi
+ done
+ if test $found != yes; then
+ continue
+ fi
+ ;;
+ esac
+ fi
+
+ # If the host uses a non-standard ABI, check if tmp_file supports it
+ #
+ if test -n "$GMP_NONSTD_ABI" && test $tmp_ext != "c"; then
+ abi=[`sed -n 's/^[ ]*ABI_SUPPORT(\(.*\))/\1/p' $tmp_file `]
+ if echo "$abi" | grep -q "\\b${GMP_NONSTD_ABI}\\b"; then
+ true
+ else
+ continue
+ fi
+ fi
+
+ found=yes
+ eval found_$tmp_ext=yes
+
+ if test $tmp_ext = c; then
+ tmp_u='$U'
+ else
+ tmp_u=
+ fi
+
+ mpn_objects="$mpn_objects $tmp_fn$tmp_u.lo"
+ mpn_objs_in_libgmp="$mpn_objs_in_libgmp mpn/$tmp_fn$tmp_u.lo"
+ AC_CONFIG_LINKS(mpn/$tmp_fn.$tmp_ext:mpn/$tmp_dir/$tmp_base.$tmp_ext)
+ gmp_srclinks="$gmp_srclinks mpn/$tmp_fn.$tmp_ext"
+
+ # Duplicate AC_DEFINEs are harmless, so it doesn't matter
+ # that multi-function files get grepped here repeatedly.
+ # The PROLOGUE pattern excludes the optional second parameter.
+ gmp_ep=[`
+ sed -n 's/^[ ]*MULFUNC_PROLOGUE(\(.*\))/\1/p' $tmp_file ;
+ sed -n 's/^[ ]*PROLOGUE(\([^,]*\).*)/\1/p' $tmp_file
+ `]
+ for gmp_tmp in $gmp_ep; do
+ AC_DEFINE_UNQUOTED(HAVE_NATIVE_$gmp_tmp)
+ eval HAVE_NATIVE_$gmp_tmp=yes
+ done
+
+ case $tmp_fn in
+ sqr_basecase) sqr_basecase_source=$tmp_file ;;
+ esac
+
+ break
+ fi
+ done
+ if test $found = yes; then break ; fi
+ done
+ if test $found = yes; then break ; fi
+ done
+
+ if test $found = no; then
+ for tmp_optional in $gmp_mpn_functions_optional; do
+ if test $tmp_optional = $tmp_fn; then
+ found=yes
+ fi
+ done
+ if test $found = no; then
+ AC_MSG_ERROR([no version of $tmp_fn found in path: $path])
+ fi
+ fi
+done
+
+# All cycle counters are .asm files currently
+if test -n "$SPEED_CYCLECOUNTER_OBJ"; then
+ found_asm=yes
+fi
+
+dnl The following list only needs to have templates for those defines which
+dnl are going to be tested by the code, there's no need to have every
+dnl possible mpn routine.
+
+AH_VERBATIM([HAVE_NATIVE],
+[/* Define to 1 each of the following for which a native (ie. CPU specific)
+ implementation of the corresponding routine exists. */
+#undef HAVE_NATIVE_mpn_add_n
+#undef HAVE_NATIVE_mpn_add_n_sub_n
+#undef HAVE_NATIVE_mpn_add_nc
+#undef HAVE_NATIVE_mpn_addaddmul_1msb0
+#undef HAVE_NATIVE_mpn_addlsh1_n
+#undef HAVE_NATIVE_mpn_addlsh2_n
+#undef HAVE_NATIVE_mpn_addlsh_n
+#undef HAVE_NATIVE_mpn_addlsh1_nc
+#undef HAVE_NATIVE_mpn_addlsh2_nc
+#undef HAVE_NATIVE_mpn_addlsh_nc
+#undef HAVE_NATIVE_mpn_addlsh1_n_ip1
+#undef HAVE_NATIVE_mpn_addlsh2_n_ip1
+#undef HAVE_NATIVE_mpn_addlsh_n_ip1
+#undef HAVE_NATIVE_mpn_addlsh1_nc_ip1
+#undef HAVE_NATIVE_mpn_addlsh2_nc_ip1
+#undef HAVE_NATIVE_mpn_addlsh_nc_ip1
+#undef HAVE_NATIVE_mpn_addlsh1_n_ip2
+#undef HAVE_NATIVE_mpn_addlsh2_n_ip2
+#undef HAVE_NATIVE_mpn_addlsh_n_ip2
+#undef HAVE_NATIVE_mpn_addlsh1_nc_ip2
+#undef HAVE_NATIVE_mpn_addlsh2_nc_ip2
+#undef HAVE_NATIVE_mpn_addlsh_nc_ip2
+#undef HAVE_NATIVE_mpn_addmul_1c
+#undef HAVE_NATIVE_mpn_addmul_2
+#undef HAVE_NATIVE_mpn_addmul_3
+#undef HAVE_NATIVE_mpn_addmul_4
+#undef HAVE_NATIVE_mpn_addmul_5
+#undef HAVE_NATIVE_mpn_addmul_6
+#undef HAVE_NATIVE_mpn_addmul_7
+#undef HAVE_NATIVE_mpn_addmul_8
+#undef HAVE_NATIVE_mpn_addmul_2s
+#undef HAVE_NATIVE_mpn_and_n
+#undef HAVE_NATIVE_mpn_andn_n
+#undef HAVE_NATIVE_mpn_bdiv_dbm1c
+#undef HAVE_NATIVE_mpn_bdiv_q_1
+#undef HAVE_NATIVE_mpn_pi1_bdiv_q_1
+#undef HAVE_NATIVE_mpn_cnd_add_n
+#undef HAVE_NATIVE_mpn_cnd_sub_n
+#undef HAVE_NATIVE_mpn_com
+#undef HAVE_NATIVE_mpn_copyd
+#undef HAVE_NATIVE_mpn_copyi
+#undef HAVE_NATIVE_mpn_div_qr_1n_pi1
+#undef HAVE_NATIVE_mpn_div_qr_2
+#undef HAVE_NATIVE_mpn_divexact_1
+#undef HAVE_NATIVE_mpn_divexact_by3c
+#undef HAVE_NATIVE_mpn_divrem_1
+#undef HAVE_NATIVE_mpn_divrem_1c
+#undef HAVE_NATIVE_mpn_divrem_2
+#undef HAVE_NATIVE_mpn_gcd_1
+#undef HAVE_NATIVE_mpn_hamdist
+#undef HAVE_NATIVE_mpn_invert_limb
+#undef HAVE_NATIVE_mpn_ior_n
+#undef HAVE_NATIVE_mpn_iorn_n
+#undef HAVE_NATIVE_mpn_lshift
+#undef HAVE_NATIVE_mpn_lshiftc
+#undef HAVE_NATIVE_mpn_lshsub_n
+#undef HAVE_NATIVE_mpn_mod_1
+#undef HAVE_NATIVE_mpn_mod_1_1p
+#undef HAVE_NATIVE_mpn_mod_1c
+#undef HAVE_NATIVE_mpn_mod_1s_2p
+#undef HAVE_NATIVE_mpn_mod_1s_4p
+#undef HAVE_NATIVE_mpn_mod_34lsub1
+#undef HAVE_NATIVE_mpn_modexact_1_odd
+#undef HAVE_NATIVE_mpn_modexact_1c_odd
+#undef HAVE_NATIVE_mpn_mul_1
+#undef HAVE_NATIVE_mpn_mul_1c
+#undef HAVE_NATIVE_mpn_mul_2
+#undef HAVE_NATIVE_mpn_mul_3
+#undef HAVE_NATIVE_mpn_mul_4
+#undef HAVE_NATIVE_mpn_mul_5
+#undef HAVE_NATIVE_mpn_mul_6
+#undef HAVE_NATIVE_mpn_mul_basecase
+#undef HAVE_NATIVE_mpn_nand_n
+#undef HAVE_NATIVE_mpn_nior_n
+#undef HAVE_NATIVE_mpn_popcount
+#undef HAVE_NATIVE_mpn_preinv_divrem_1
+#undef HAVE_NATIVE_mpn_preinv_mod_1
+#undef HAVE_NATIVE_mpn_redc_1
+#undef HAVE_NATIVE_mpn_redc_2
+#undef HAVE_NATIVE_mpn_rsblsh1_n
+#undef HAVE_NATIVE_mpn_rsblsh2_n
+#undef HAVE_NATIVE_mpn_rsblsh_n
+#undef HAVE_NATIVE_mpn_rsblsh1_nc
+#undef HAVE_NATIVE_mpn_rsblsh2_nc
+#undef HAVE_NATIVE_mpn_rsblsh_nc
+#undef HAVE_NATIVE_mpn_rsh1add_n
+#undef HAVE_NATIVE_mpn_rsh1add_nc
+#undef HAVE_NATIVE_mpn_rsh1sub_n
+#undef HAVE_NATIVE_mpn_rsh1sub_nc
+#undef HAVE_NATIVE_mpn_rshift
+#undef HAVE_NATIVE_mpn_sqr_basecase
+#undef HAVE_NATIVE_mpn_sqr_diagonal
+#undef HAVE_NATIVE_mpn_sqr_diag_addlsh1
+#undef HAVE_NATIVE_mpn_sub_n
+#undef HAVE_NATIVE_mpn_sub_nc
+#undef HAVE_NATIVE_mpn_sublsh1_n
+#undef HAVE_NATIVE_mpn_sublsh2_n
+#undef HAVE_NATIVE_mpn_sublsh_n
+#undef HAVE_NATIVE_mpn_sublsh1_nc
+#undef HAVE_NATIVE_mpn_sublsh2_nc
+#undef HAVE_NATIVE_mpn_sublsh_nc
+#undef HAVE_NATIVE_mpn_sublsh1_n_ip1
+#undef HAVE_NATIVE_mpn_sublsh2_n_ip1
+#undef HAVE_NATIVE_mpn_sublsh_n_ip1
+#undef HAVE_NATIVE_mpn_sublsh1_nc_ip1
+#undef HAVE_NATIVE_mpn_sublsh2_nc_ip1
+#undef HAVE_NATIVE_mpn_sublsh_nc_ip1
+#undef HAVE_NATIVE_mpn_submul_1c
+#undef HAVE_NATIVE_mpn_tabselect
+#undef HAVE_NATIVE_mpn_udiv_qrnnd
+#undef HAVE_NATIVE_mpn_udiv_qrnnd_r
+#undef HAVE_NATIVE_mpn_umul_ppmm
+#undef HAVE_NATIVE_mpn_umul_ppmm_r
+#undef HAVE_NATIVE_mpn_xor_n
+#undef HAVE_NATIVE_mpn_xnor_n])
+
+
+# Don't demand an m4 unless it's actually needed.
+if test $found_asm = yes; then
+ GMP_PROG_M4
+ GMP_M4_M4WRAP_SPURIOUS
+# else
+# It's unclear why this m4-not-needed stuff was ever done.
+# if test -z "$M4" ; then
+# M4=m4-not-needed
+# fi
+fi
+
+# Only do the GMP_ASM checks if there's a .S or .asm wanting them.
+if test $found_asm = no && test $found_S = no; then
+ gmp_asm_syntax_testing=no
+fi
+
+if test "$gmp_asm_syntax_testing" != no; then
+ GMP_ASM_TEXT
+ GMP_ASM_DATA
+ GMP_ASM_LABEL_SUFFIX
+ GMP_ASM_GLOBL
+ GMP_ASM_GLOBL_ATTR
+ GMP_ASM_UNDERSCORE
+ GMP_ASM_RODATA
+ GMP_ASM_TYPE
+ GMP_ASM_SIZE
+ GMP_ASM_LSYM_PREFIX
+ GMP_ASM_W32
+ GMP_ASM_ALIGN_LOG
+
+ case $host in
+ hppa*-*-*)
+ # for both pa32 and pa64
+ GMP_INCLUDE_MPN(pa32/pa-defs.m4)
+ ;;
+ IA64_PATTERN)
+ GMP_ASM_IA64_ALIGN_OK
+ ;;
+ M68K_PATTERN)
+ GMP_ASM_M68K_INSTRUCTION
+ GMP_ASM_M68K_ADDRESSING
+ GMP_ASM_M68K_BRANCHES
+ ;;
+ [powerpc*-*-* | power[3-9]-*-*])
+ GMP_ASM_POWERPC_PIC_ALWAYS
+ GMP_ASM_POWERPC_R_REGISTERS
+ GMP_INCLUDE_MPN(powerpc32/powerpc-defs.m4)
+
+ # Check for Linux ELFv2 ABI
+ AC_EGREP_CPP(yes,
+[#if _CALL_ELF == 2
+yes
+#endif],
+ [GMP_DEFINE_RAW(["define(<ELFv2_ABI>)"])])
+
+ case $host in
+ *-*-aix*)
+ case $ABI in
+ mode64) GMP_INCLUDE_MPN(powerpc64/aix.m4) ;;
+ *) GMP_INCLUDE_MPN(powerpc32/aix.m4) ;;
+ esac
+ ;;
+ *-*-linux* | *-*-*bsd*)
+ case $ABI in
+ mode64) GMP_INCLUDE_MPN(powerpc64/elf.m4) ;;
+ mode32 | 32) GMP_INCLUDE_MPN(powerpc32/elf.m4) ;;
+ esac
+ ;;
+ *-*-darwin*)
+ case $ABI in
+ mode64) GMP_INCLUDE_MPN(powerpc64/darwin.m4) ;;
+ mode32 | 32) GMP_INCLUDE_MPN(powerpc32/darwin.m4) ;;
+ esac
+ ;;
+ *)
+ # Assume unrecognized operating system is the powerpc eABI
+ GMP_INCLUDE_MPN(powerpc32/eabi.m4)
+ ;;
+ esac
+ ;;
+ power*-*-aix*)
+ GMP_INCLUDE_MPN(powerpc32/aix.m4)
+ ;;
+ *sparc*-*-*)
+ case $ABI in
+ 64)
+ GMP_ASM_SPARC_REGISTER
+ ;;
+ esac
+ GMP_ASM_SPARC_GOTDATA
+ GMP_ASM_SPARC_SHARED_THUNKS
+ ;;
+ X86_PATTERN | X86_64_PATTERN)
+ GMP_ASM_ALIGN_FILL_0x90
+ case $ABI in
+ 32)
+ GMP_INCLUDE_MPN(x86/x86-defs.m4)
+ AC_DEFINE(HAVE_HOST_CPU_FAMILY_x86)
+ GMP_ASM_COFF_TYPE
+ GMP_ASM_X86_GOT_UNDERSCORE
+ GMP_ASM_X86_SHLDL_CL
+ case $enable_profiling in
+ prof | gprof) GMP_ASM_X86_MCOUNT ;;
+ esac
+ case $host in
+ *-*-darwin*)
+ GMP_INCLUDE_MPN(x86/darwin.m4) ;;
+ esac
+ ;;
+ 64|x32)
+ GMP_INCLUDE_MPN(x86_64/x86_64-defs.m4)
+ AC_DEFINE(HAVE_HOST_CPU_FAMILY_x86_64)
+ case $host in
+ *-*-darwin*)
+ GMP_INCLUDE_MPN(x86_64/darwin.m4) ;;
+ *-*-mingw* | *-*-cygwin)
+ GMP_INCLUDE_MPN(x86_64/dos64.m4) ;;
+ *-openbsd*)
+ GMP_DEFINE_RAW(["define(<OPENBSD>,1)"]) ;;
+ esac
+ ;;
+ esac
+ ;;
+ esac
+fi
+
+# For --enable-minithres, prepend "minithres" to path so that its special
+# gmp-mparam.h will be used.
+if test $enable_minithres = yes; then
+ path="minithres $path"
+fi
+
+# Create link for gmp-mparam.h.
+gmp_mparam_source=
+for gmp_mparam_dir in $path; do
+ test "$no_create" = yes || rm -f gmp-mparam.h
+ tmp_file=$srcdir/mpn/$gmp_mparam_dir/gmp-mparam.h
+ if test -f $tmp_file; then
+ AC_CONFIG_LINKS(gmp-mparam.h:mpn/$gmp_mparam_dir/gmp-mparam.h)
+ gmp_srclinks="$gmp_srclinks gmp-mparam.h"
+ gmp_mparam_source=$tmp_file
+ break
+ fi
+done
+if test -z "$gmp_mparam_source"; then
+ AC_MSG_ERROR([no version of gmp-mparam.h found in path: $path])
+fi
+
+# For a helpful message from tune/tuneup.c
+gmp_mparam_suggest=$gmp_mparam_source
+if test "$gmp_mparam_dir" = generic; then
+ for i in $path; do break; done
+ if test "$i" != generic; then
+ gmp_mparam_suggest="new file $srcdir/mpn/$i/gmp-mparam.h"
+ fi
+fi
+AC_DEFINE_UNQUOTED(GMP_MPARAM_H_SUGGEST, "$gmp_mparam_source",
+[The gmp-mparam.h file (a string) the tune program should suggest updating.])
+
+
+# Copy relevant parameters from gmp-mparam.h to config.m4.
+# We only do this for parameters that are used by some assembly files.
+# Fat binaries do this on a per-file basis, so skip in that case.
+#
+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`
+ if test -n "$value"; then
+ GMP_DEFINE_RAW(["define(<$i>,<$value>)"])
+ fi
+ done
+fi
+
+
+# Sizes of some types, needed at preprocessing time.
+#
+# FIXME: The assumption that GMP_LIMB_BITS is 8*sizeof(mp_limb_t) might
+# be slightly rash, but it's true everywhere we know of and ought to be true
+# of any sensible system. In a generic C build, grepping LONG_BIT out of
+# <limits.h> might be an alternative, for maximum portability.
+#
+AC_CHECK_SIZEOF(void *)
+AC_CHECK_SIZEOF(unsigned short)
+AC_CHECK_SIZEOF(unsigned)
+AC_CHECK_SIZEOF(unsigned long)
+AC_CHECK_SIZEOF(mp_limb_t, , GMP_INCLUDE_GMP_H)
+if test "$ac_cv_sizeof_mp_limb_t" = 0; then
+ AC_MSG_ERROR([Oops, mp_limb_t doesn't seem to work])
+fi
+AC_SUBST(GMP_LIMB_BITS, `expr 8 \* $ac_cv_sizeof_mp_limb_t`)
+GMP_DEFINE_RAW(["define(<SIZEOF_UNSIGNED>,<$ac_cv_sizeof_unsigned>)"])
+
+# Check compiler limb size matches gmp-mparam.h
+#
+# FIXME: Some of the cycle counter objects in the tune directory depend on
+# the size of ulong, it'd be possible to check that here, though a mismatch
+# probably wouldn't want to be fatal, none of the libgmp assembler code
+# depends on ulong.
+#
+mparam_bits=[`sed -n 's/^#define GMP_LIMB_BITS[ ][ ]*\([0-9]*\).*$/\1/p' $gmp_mparam_source`]
+if test -n "$mparam_bits" && test "$mparam_bits" -ne $GMP_LIMB_BITS; then
+ if test "$test_CFLAGS" = set; then
+ AC_MSG_ERROR([Oops, mp_limb_t is $GMP_LIMB_BITS bits, but the assembler code
+in this configuration expects $mparam_bits bits.
+You appear to have set \$CFLAGS, perhaps you also need to tell GMP the
+intended ABI, see "ABI and ISA" in the manual.])
+ else
+ AC_MSG_ERROR([Oops, mp_limb_t is $GMP_LIMB_BITS bits, but the assembler code
+in this configuration expects $mparam_bits bits.])
+ fi
+fi
+
+GMP_DEFINE_RAW(["define(<GMP_LIMB_BITS>,$GMP_LIMB_BITS)"])
+GMP_DEFINE_RAW(["define(<GMP_NAIL_BITS>,$GMP_NAIL_BITS)"])
+GMP_DEFINE_RAW(["define(<GMP_NUMB_BITS>,eval(GMP_LIMB_BITS-GMP_NAIL_BITS))"])
+
+
+AC_SUBST(mpn_objects)
+AC_SUBST(mpn_objs_in_libgmp)
+AC_SUBST(gmp_srclinks)
+
+
+# A recompiled sqr_basecase for use in the tune program, if necessary.
+TUNE_SQR_OBJ=
+test -d tune || mkdir tune
+case $sqr_basecase_source in
+ *.asm)
+ sqr_max=[`sed -n 's/^def...(SQR_TOOM2_THRESHOLD_MAX, *\([0-9]*\))/\1/p' $sqr_basecase_source`]
+ if test -n "$sqr_max"; then
+ TUNE_SQR_OBJ=sqr_asm.o
+ AC_DEFINE_UNQUOTED(TUNE_SQR_TOOM2_MAX,$sqr_max,
+ [Maximum size the tune program can test for SQR_TOOM2_THRESHOLD])
+ fi
+ cat >tune/sqr_basecase.c <<EOF
+/* not sure that an empty file can compile, so put in a dummy */
+int sqr_basecase_dummy;
+EOF
+ ;;
+ *.c)
+ TUNE_SQR_OBJ=
+ AC_DEFINE(TUNE_SQR_TOOM2_MAX,SQR_TOOM2_MAX_GENERIC)
+ cat >tune/sqr_basecase.c <<EOF
+#define TUNE_PROGRAM_BUILD 1
+#define TUNE_PROGRAM_BUILD_SQR 1
+#include "mpn/sqr_basecase.c"
+EOF
+ ;;
+esac
+AC_SUBST(TUNE_SQR_OBJ)
+
+
+# Configs for demos/pexpr.c.
+#
+AC_CONFIG_FILES(demos/pexpr-config.h:demos/pexpr-config-h.in)
+GMP_SUBST_CHECK_FUNCS(clock, cputime, getrusage, gettimeofday, sigaction, sigaltstack, sigstack)
+GMP_SUBST_CHECK_HEADERS(sys/resource.h)
+AC_CHECK_TYPES([stack_t], HAVE_STACK_T_01=1, HAVE_STACK_T_01=0,
+ [#include <signal.h>])
+AC_SUBST(HAVE_STACK_T_01)
+
+# Configs for demos/calc directory
+#
+# AC_SUBST+AC_CONFIG_FILES is used for calc-config.h, rather than AC_DEFINE+
+# AC_CONFIG_HEADERS, since with the latter automake (1.8) will then put the
+# directory (ie. demos/calc) into $(DEFAULT_INCLUDES) for every Makefile.in,
+# which would look very strange.
+#
+# -lcurses is required by libreadline. On a typical SVR4 style system this
+# normally doesn't have to be given explicitly, since libreadline.so will
+# have a NEEDED record for it. But if someone for some reason is using only
+# a static libreadline.a then we must give -lcurses. Readline (as of
+# version 4.3) doesn't use libtool, so we can't rely on a .la to cover
+# necessary dependencies.
+#
+# On a couple of systems we've seen libreadline available, but the headers
+# not in the default include path, so check for readline/readline.h. We've
+# also seen readline/history.h missing, not sure if that's just a broken
+# install or a very old version, but check that too.
+#
+AC_CONFIG_FILES(demos/calc/calc-config.h:demos/calc/calc-config-h.in)
+LIBCURSES=
+if test $with_readline != no; then
+ AC_CHECK_LIB(ncurses, tputs, [LIBCURSES=-lncurses],
+ [AC_CHECK_LIB(curses, tputs, [LIBCURSES=-lcurses])])
+fi
+AC_SUBST(LIBCURSES)
+use_readline=$with_readline
+if test $with_readline = detect; then
+ use_readline=no
+ AC_CHECK_LIB(readline, readline,
+ [AC_CHECK_HEADER(readline/readline.h,
+ [AC_CHECK_HEADER(readline/history.h, use_readline=yes)])],
+ , $LIBCURSES)
+ AC_MSG_CHECKING(readline detected)
+ AC_MSG_RESULT($use_readline)
+fi
+if test $use_readline = yes; then
+ AC_SUBST(WITH_READLINE_01, 1)
+ AC_SUBST(LIBREADLINE, -lreadline)
+else
+ WITH_READLINE_01=0
+fi
+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
+
+
+# Create config.m4.
+GMP_FINISH
+
+# Create Makefiles
+# FIXME: Upcoming version of autoconf/automake may not like broken lines.
+# Right now automake isn't accepting the new AC_CONFIG_FILES scheme.
+
+AC_OUTPUT(Makefile \
+ mpf/Makefile mpn/Makefile mpq/Makefile \
+ mpz/Makefile printf/Makefile scanf/Makefile rand/Makefile cxx/Makefile \
+ tests/Makefile tests/devel/Makefile \
+ tests/mpf/Makefile tests/mpn/Makefile tests/mpq/Makefile \
+ tests/mpz/Makefile tests/rand/Makefile tests/misc/Makefile \
+ tests/cxx/Makefile \
+ doc/Makefile tune/Makefile \
+ demos/Makefile demos/calc/Makefile demos/expr/Makefile \
+ gmp.h:gmp-h.in)
+
+AC_MSG_NOTICE([summary of build options:
+
+ Version: ${PACKAGE_STRING}
+ Host type: ${host}
+ ABI: ${ABI}
+ Install prefix: ${prefix}
+ Compiler: ${CC}
+ 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
diff --git a/Build/source/libs/gmp/gmp-6.0.0/errno.c b/Build/source/libs/gmp/gmp-6.0.0/errno.c
new file mode 100644
index 00000000000..d3c02ef4b82
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/errno.c
@@ -0,0 +1,70 @@
+/* gmp_errno, __gmp_exception -- exception handling and reporting.
+
+ THE FUNCTIONS IN THIS FILE, APART FROM gmp_errno, ARE FOR INTERNAL USE
+ ONLY. THEY'RE ALMOST CERTAIN TO BE SUBJECT TO INCOMPATIBLE CHANGES OR
+ DISAPPEAR COMPLETELY IN FUTURE GNU MP RELEASES.
+
+Copyright 2000, 2001, 2003 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 <stdlib.h>
+#include "gmp.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. */
+
+void
+__gmp_exception (int error_bit)
+{
+ gmp_errno |= error_bit;
+ __gmp_junk = 10 / __gmp_0;
+ abort ();
+}
+
+
+/* These functions minimize the amount of code required in functions raising
+ exceptions. Since they're "noreturn" and don't take any parameters, a
+ test and call might even come out as a simple conditional jump. */
+void
+__gmp_sqrt_of_negative (void)
+{
+ __gmp_exception (GMP_ERROR_SQRT_OF_NEGATIVE);
+}
+void
+__gmp_divide_by_zero (void)
+{
+ __gmp_exception (GMP_ERROR_DIVISION_BY_ZERO);
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/extract-dbl.c b/Build/source/libs/gmp/gmp-6.0.0/extract-dbl.c
new file mode 100644
index 00000000000..a6e7bf94681
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/extract-dbl.c
@@ -0,0 +1,311 @@
+/* __gmp_extract_double -- convert from double to array of mp_limb_t.
+
+Copyright 1996, 1999-2002, 2006, 2012 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.h"
+#include "gmp-impl.h"
+
+#ifdef XDEBUG
+#undef _GMP_IEEE_FLOATS
+#endif
+
+#ifndef _GMP_IEEE_FLOATS
+#define _GMP_IEEE_FLOATS 0
+#endif
+
+/* Extract a non-negative double in d. */
+
+int
+__gmp_extract_double (mp_ptr rp, double d)
+{
+ long exp;
+ unsigned sc;
+#ifdef _LONG_LONG_LIMB
+#define BITS_PER_PART 64 /* somewhat bogus */
+ unsigned long long int manl;
+#else
+#define BITS_PER_PART GMP_LIMB_BITS
+ unsigned long int manh, manl;
+#endif
+
+ /* BUGS
+
+ 1. Should handle Inf and NaN in IEEE specific code.
+ 2. Handle Inf and NaN also in default code, to avoid hangs.
+ 3. Generalize to handle all GMP_LIMB_BITS >= 32.
+ 4. This lits is incomplete and misspelled.
+ */
+
+ ASSERT (d >= 0.0);
+
+ if (d == 0.0)
+ {
+ MPN_ZERO (rp, LIMBS_PER_DOUBLE);
+ return 0;
+ }
+
+#if _GMP_IEEE_FLOATS
+ {
+#if defined (__alpha) && __GNUC__ == 2 && __GNUC_MINOR__ == 8
+ /* Work around alpha-specific bug in GCC 2.8.x. */
+ volatile
+#endif
+ union ieee_double_extract x;
+ x.d = d;
+ exp = x.s.exp;
+#if BITS_PER_PART == 64 /* generalize this to BITS_PER_PART > BITS_IN_MANTISSA */
+ manl = (((mp_limb_t) 1 << 63)
+ | ((mp_limb_t) x.s.manh << 43) | ((mp_limb_t) x.s.manl << 11));
+ if (exp == 0)
+ {
+ /* Denormalized number. Don't try to be clever about this,
+ since it is not an important case to make fast. */
+ exp = 1;
+ do
+ {
+ manl = manl << 1;
+ exp--;
+ }
+ while ((manl & GMP_LIMB_HIGHBIT) == 0);
+ }
+#endif
+#if BITS_PER_PART == 32
+ manh = ((mp_limb_t) 1 << 31) | (x.s.manh << 11) | (x.s.manl >> 21);
+ manl = x.s.manl << 11;
+ if (exp == 0)
+ {
+ /* Denormalized number. Don't try to be clever about this,
+ since it is not an important case to make fast. */
+ exp = 1;
+ do
+ {
+ manh = (manh << 1) | (manl >> 31);
+ manl = manl << 1;
+ exp--;
+ }
+ while ((manh & GMP_LIMB_HIGHBIT) == 0);
+ }
+#endif
+#if BITS_PER_PART != 32 && BITS_PER_PART != 64
+ You need to generalize the code above to handle this.
+#endif
+ exp -= 1022; /* Remove IEEE bias. */
+ }
+#else
+ {
+ /* Unknown (or known to be non-IEEE) double format. */
+ exp = 0;
+ if (d >= 1.0)
+ {
+ ASSERT_ALWAYS (d * 0.5 != d);
+
+ while (d >= 32768.0)
+ {
+ d *= (1.0 / 65536.0);
+ exp += 16;
+ }
+ while (d >= 1.0)
+ {
+ d *= 0.5;
+ exp += 1;
+ }
+ }
+ else if (d < 0.5)
+ {
+ while (d < (1.0 / 65536.0))
+ {
+ d *= 65536.0;
+ exp -= 16;
+ }
+ while (d < 0.5)
+ {
+ d *= 2.0;
+ exp -= 1;
+ }
+ }
+
+ d *= (4.0 * ((unsigned long int) 1 << (BITS_PER_PART - 2)));
+#if BITS_PER_PART == 64
+ manl = d;
+#endif
+#if BITS_PER_PART == 32
+ manh = d;
+ manl = (d - manh) * (4.0 * ((unsigned long int) 1 << (BITS_PER_PART - 2)));
+#endif
+ }
+#endif /* IEEE */
+
+ sc = (unsigned) (exp + 64 * GMP_NUMB_BITS) % GMP_NUMB_BITS;
+
+ /* We add something here to get rounding right. */
+ exp = (exp + 64 * GMP_NUMB_BITS) / GMP_NUMB_BITS - 64 * GMP_NUMB_BITS / GMP_NUMB_BITS + 1;
+
+#if BITS_PER_PART == 64 && LIMBS_PER_DOUBLE == 2
+#if GMP_NAIL_BITS == 0
+ if (sc != 0)
+ {
+ rp[1] = manl >> (GMP_LIMB_BITS - sc);
+ rp[0] = manl << sc;
+ }
+ else
+ {
+ rp[1] = manl;
+ rp[0] = 0;
+ exp--;
+ }
+#else
+ if (sc > GMP_NAIL_BITS)
+ {
+ rp[1] = manl >> (GMP_LIMB_BITS - sc);
+ rp[0] = (manl << (sc - GMP_NAIL_BITS)) & GMP_NUMB_MASK;
+ }
+ else
+ {
+ if (sc == 0)
+ {
+ rp[1] = manl >> GMP_NAIL_BITS;
+ rp[0] = (manl << GMP_NUMB_BITS - GMP_NAIL_BITS) & GMP_NUMB_MASK;
+ exp--;
+ }
+ else
+ {
+ rp[1] = manl >> (GMP_LIMB_BITS - sc);
+ rp[0] = (manl >> (GMP_NAIL_BITS - sc)) & GMP_NUMB_MASK;
+ }
+ }
+#endif
+#endif
+
+#if BITS_PER_PART == 64 && LIMBS_PER_DOUBLE == 3
+ if (sc > GMP_NAIL_BITS)
+ {
+ rp[2] = manl >> (GMP_LIMB_BITS - sc);
+ rp[1] = (manl << sc - GMP_NAIL_BITS) & GMP_NUMB_MASK;
+ if (sc >= 2 * GMP_NAIL_BITS)
+ rp[0] = 0;
+ else
+ rp[0] = (manl << GMP_NUMB_BITS - GMP_NAIL_BITS + sc) & GMP_NUMB_MASK;
+ }
+ else
+ {
+ if (sc == 0)
+ {
+ rp[2] = manl >> GMP_NAIL_BITS;
+ rp[1] = (manl << GMP_NUMB_BITS - GMP_NAIL_BITS) & GMP_NUMB_MASK;
+ rp[0] = 0;
+ exp--;
+ }
+ else
+ {
+ rp[2] = manl >> (GMP_LIMB_BITS - sc);
+ rp[1] = (manl >> GMP_NAIL_BITS - sc) & GMP_NUMB_MASK;
+ rp[0] = (manl << GMP_NUMB_BITS - GMP_NAIL_BITS + sc) & GMP_NUMB_MASK;
+ }
+ }
+#endif
+
+#if BITS_PER_PART == 32 && LIMBS_PER_DOUBLE == 3
+#if GMP_NAIL_BITS == 0
+ if (sc != 0)
+ {
+ rp[2] = manh >> (GMP_LIMB_BITS - sc);
+ rp[1] = (manh << sc) | (manl >> (GMP_LIMB_BITS - sc));
+ rp[0] = manl << sc;
+ }
+ else
+ {
+ rp[2] = manh;
+ rp[1] = manl;
+ rp[0] = 0;
+ exp--;
+ }
+#else
+ if (sc > GMP_NAIL_BITS)
+ {
+ rp[2] = (manh >> (GMP_LIMB_BITS - sc));
+ rp[1] = ((manh << (sc - GMP_NAIL_BITS)) |
+ (manl >> (GMP_LIMB_BITS - sc + GMP_NAIL_BITS))) & GMP_NUMB_MASK;
+ if (sc >= 2 * GMP_NAIL_BITS)
+ rp[0] = (manl << sc - 2 * GMP_NAIL_BITS) & GMP_NUMB_MASK;
+ else
+ rp[0] = manl >> (2 * GMP_NAIL_BITS - sc) & GMP_NUMB_MASK;
+ }
+ else
+ {
+ if (sc == 0)
+ {
+ rp[2] = manh >> GMP_NAIL_BITS;
+ rp[1] = ((manh << GMP_NUMB_BITS - GMP_NAIL_BITS) | (manl >> 2 * GMP_NAIL_BITS)) & GMP_NUMB_MASK;
+ rp[0] = (manl << GMP_NUMB_BITS - 2 * GMP_NAIL_BITS) & GMP_NUMB_MASK;
+ exp--;
+ }
+ else
+ {
+ rp[2] = (manh >> (GMP_LIMB_BITS - sc));
+ rp[1] = (manh >> (GMP_NAIL_BITS - sc)) & GMP_NUMB_MASK;
+ rp[0] = ((manh << (GMP_NUMB_BITS - GMP_NAIL_BITS + sc))
+ | (manl >> (GMP_LIMB_BITS - (GMP_NUMB_BITS - GMP_NAIL_BITS + sc)))) & GMP_NUMB_MASK;
+ }
+ }
+#endif
+#endif
+
+#if BITS_PER_PART == 32 && LIMBS_PER_DOUBLE > 3
+ if (sc == 0)
+ {
+ int i;
+
+ for (i = LIMBS_PER_DOUBLE - 1; i >= 0; i--)
+ {
+ rp[i] = manh >> (BITS_PER_ULONG - GMP_NUMB_BITS);
+ manh = ((manh << GMP_NUMB_BITS)
+ | (manl >> (BITS_PER_ULONG - GMP_NUMB_BITS)));
+ manl = manl << GMP_NUMB_BITS;
+ }
+ exp--;
+ }
+ else
+ {
+ int i;
+
+ rp[LIMBS_PER_DOUBLE - 1] = (manh >> (GMP_LIMB_BITS - sc));
+ manh = (manh << sc) | (manl >> (GMP_LIMB_BITS - sc));
+ manl = (manl << sc);
+ for (i = LIMBS_PER_DOUBLE - 2; i >= 0; i--)
+ {
+ rp[i] = manh >> (BITS_PER_ULONG - GMP_NUMB_BITS);
+ manh = ((manh << GMP_NUMB_BITS)
+ | (manl >> (BITS_PER_ULONG - GMP_NUMB_BITS)));
+ manl = manl << GMP_NUMB_BITS;
+ }
+ }
+#endif
+
+ return exp;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/gen-bases.c b/Build/source/libs/gmp/gmp-6.0.0/gen-bases.c
new file mode 100644
index 00000000000..4d4b0db8ace
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/gen-bases.c
@@ -0,0 +1,251 @@
+/* Generate mp_bases data.
+
+Copyright 1991, 1993, 1994, 1996, 2000, 2002, 2004, 2011, 2012 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 "bootstrap.c"
+
+
+int chars_per_limb;
+mpz_t big_base;
+int normalization_steps;
+mpz_t big_base_inverted;
+
+mpz_t t;
+
+#define POW2_P(n) (((n) & ((n) - 1)) == 0)
+
+unsigned int
+ulog2 (unsigned int x)
+{
+ unsigned int i;
+ for (i = 0; x != 0; i++)
+ x >>= 1;
+ return i;
+}
+
+void
+generate (int limb_bits, int nail_bits, int base)
+{
+ int numb_bits = limb_bits - nail_bits;
+
+ mpz_set_ui (t, 1L);
+ mpz_mul_2exp (t, t, numb_bits);
+ mpz_set_ui (big_base, 1L);
+ chars_per_limb = 0;
+ for (;;)
+ {
+ mpz_mul_ui (big_base, big_base, (long) base);
+ if (mpz_cmp (big_base, t) > 0)
+ break;
+ chars_per_limb++;
+ }
+
+ mpz_ui_pow_ui (big_base, (long) base, (long) chars_per_limb);
+
+ normalization_steps = limb_bits - mpz_sizeinbase (big_base, 2);
+
+ 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);
+}
+
+void
+header (int limb_bits, int nail_bits)
+{
+ int numb_bits = limb_bits - nail_bits;
+
+ generate (limb_bits, nail_bits, 10);
+
+ printf ("/* This file generated by gen-bases.c - DO NOT EDIT. */\n");
+ printf ("\n");
+ printf ("#if GMP_NUMB_BITS != %d\n", numb_bits);
+ printf ("Error, error, this data is for %d bits\n", numb_bits);
+ printf ("#endif\n");
+ 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_10 CNST_LIMB(0x");
+ mpz_out_str (stdout, 16, big_base);
+ printf (")\n");
+ 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_NORMALIZATION_STEPS_10 %d\n", normalization_steps);
+}
+
+
+#define EXTRA 16
+
+/* Compute log(2)/log(b) as a fixnum. */
+void
+mp_2logb (mpz_t r, int bi, int prec)
+{
+ mpz_t t, t2, two, b;
+ int i;
+
+ mpz_init_set_ui (t, 1);
+ mpz_mul_2exp (t, t, prec+EXTRA);
+
+ mpz_init (t2);
+
+ mpz_init_set_ui (two, 2);
+ mpz_mul_2exp (two, two, prec+EXTRA);
+
+ mpz_set_ui (r, 0);
+
+ mpz_init_set_ui (b, bi);
+ mpz_mul_2exp (b, b, prec+EXTRA);
+
+ for (i = prec-1; i >= 0; i--)
+ {
+ mpz_mul_2exp (b, b, prec+EXTRA);
+ mpz_sqrt (b, b);
+
+ mpz_mul (t2, t, b);
+ mpz_tdiv_q_2exp (t2, t2, prec+EXTRA);
+
+ 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_clear (t);
+ mpz_clear (t2);
+ mpz_clear (two);
+ mpz_clear (b);
+}
+
+void
+table (int limb_bits, int nail_bits)
+{
+ int numb_bits = limb_bits - nail_bits;
+ int base;
+ mpz_t r, t, logb2, log2b;
+
+ mpz_init (r);
+ mpz_init (t);
+ mpz_init (logb2);
+ mpz_init (log2b);
+
+ 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);
+ printf ("Error, error, this data is for %d bits\n", numb_bits);
+ printf ("#endif\n");
+ printf ("\n");
+ puts ("const struct bases mp_bases[257] =\n{");
+ puts (" /* 0 */ { 0, 0, 0, 0, 0 },");
+ puts (" /* 1 */ { 0, 0, 0, 0, 0 },");
+ for (base = 2; base <= 256; base++)
+ {
+ generate (limb_bits, nail_bits, base);
+ mp_2logb (r, base, limb_bits + 8);
+ mpz_tdiv_q_2exp (logb2, r, 8);
+ mpz_set_ui (t, 1);
+ mpz_mul_2exp (t, t, 2*limb_bits + 5);
+ mpz_sub_ui (t, t, 1);
+ mpz_add_ui (r, r, 1);
+ mpz_tdiv_q (log2b, t, r);
+
+ printf (" /* %3u */ { ", base);
+ if (POW2_P (base))
+ {
+ mpz_set_ui (big_base, ulog2 (base) - 1);
+ mpz_set_ui (big_base_inverted, 0);
+ }
+
+ printf ("%u,", chars_per_limb);
+ printf (" CNST_LIMB(0x");
+ mpz_out_str (stdout, 16, logb2);
+ printf ("), CNST_LIMB(0x");
+ mpz_out_str (stdout, 16, log2b);
+ printf ("), CNST_LIMB(0x");
+ mpz_out_str (stdout, 16, big_base);
+ printf ("), CNST_LIMB(0x");
+ mpz_out_str (stdout, 16, big_base_inverted);
+ printf (") },\n");
+ }
+
+ puts ("};");
+
+ mpz_clear (r);
+ mpz_clear (t);
+ mpz_clear (logb2);
+ mpz_clear (log2b);
+
+}
+
+int
+main (int argc, char **argv)
+{
+ int limb_bits, nail_bits;
+
+ mpz_init (big_base);
+ mpz_init (big_base_inverted);
+ mpz_init (t);
+
+ if (argc != 4)
+ {
+ fprintf (stderr, "Usage: gen-bases <header|table> <limbbits> <nailbits>\n");
+ exit (1);
+ }
+
+ limb_bits = atoi (argv[2]);
+ nail_bits = atoi (argv[3]);
+
+ if (limb_bits <= 0
+ || nail_bits < 0
+ || nail_bits >= limb_bits)
+ {
+ fprintf (stderr, "Invalid limb/nail bits: %d %d\n",
+ limb_bits, nail_bits);
+ exit (1);
+ }
+
+ if (strcmp (argv[1], "header") == 0)
+ header (limb_bits, nail_bits);
+ else if (strcmp (argv[1], "table") == 0)
+ table (limb_bits, nail_bits);
+ else
+ {
+ fprintf (stderr, "Invalid header/table choice: %s\n", argv[1]);
+ exit (1);
+ }
+
+ return 0;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/gen-fac.c b/Build/source/libs/gmp/gmp-6.0.0/gen-fac.c
new file mode 100644
index 00000000000..b1756a61173
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/gen-fac.c
@@ -0,0 +1,285 @@
+/* Generate data for combinatorics: fac_ui, bin_uiui, ...
+
+Copyright 2002, 2011-2013 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 <stdlib.h>
+
+#include "bootstrap.c"
+
+int
+mpz_remove_twos (mpz_t x)
+{
+ mp_bitcnt_t r = mpz_scan1(x, 0);
+ mpz_tdiv_q_2exp (x, x, r);
+ return r;
+}
+
+/* returns 0 on success */
+int
+gen_consts (int numb, int nail, int limb)
+{
+ mpz_t x, mask, y, last;
+ unsigned long a, b;
+ 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 ("#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 ("#endif\n");
+#endif
+
+ printf
+ ("/* This table is 0!,1!,2!,3!,...,n! where n! has <= GMP_NUMB_BITS bits */\n");
+ printf
+ ("#define ONE_LIMB_FACTORIAL_TABLE CNST_LIMB(0x1),CNST_LIMB(0x1");
+ mpz_init_set_ui (x, 1);
+ mpz_init (last);
+ for (b = 2;; b++)
+ {
+ mpz_mul_ui (x, x, b); /* so b!=a */
+ if (mpz_sizeinbase (x, 2) > numb)
+ break;
+ printf ("),CNST_LIMB(0x");
+ mpz_out_str (stdout, 16, x);
+ }
+ printf (")\n");
+
+ printf
+ ("\n/* This table is 0!,1!,2!/2,3!/2,...,n!/2^sn where n!/2^sn is an */\n");
+ printf
+ ("/* odd integer for each n, and n!/2^sn has <= GMP_NUMB_BITS bits */\n");
+ printf
+ ("#define ONE_LIMB_ODD_FACTORIAL_TABLE CNST_LIMB(0x1),CNST_LIMB(0x1),CNST_LIMB(0x1");
+ mpz_set_ui (x, 1);
+ for (b = 3;; b++)
+ {
+ for (a = b; (a & 1) == 0; a >>= 1);
+ mpz_swap (last, x);
+ mpz_mul_ui (x, last, a);
+ if (mpz_sizeinbase (x, 2) > numb)
+ break;
+ printf ("),CNST_LIMB(0x");
+ mpz_out_str (stdout, 16, x);
+ }
+ printf (")\n");
+ printf
+ ("#define ODD_FACTORIAL_TABLE_MAX CNST_LIMB(0x");
+ mpz_out_str (stdout, 16, last);
+ printf (")\n");
+
+ ofl = b - 1;
+ printf
+ ("#define ODD_FACTORIAL_TABLE_LIMIT (%lu)\n", ofl);
+ mpz_init2 (mask, numb);
+ mpz_setbit (mask, numb);
+ mpz_sub_ui (mask, mask, 1);
+ printf
+ ("\n/* Previous table, continued, values modulo 2^GMP_NUMB_BITS */\n");
+ printf
+ ("#define ONE_LIMB_ODD_FACTORIAL_EXTTABLE CNST_LIMB(0x");
+ mpz_and (x, x, mask);
+ mpz_out_str (stdout, 16, x);
+ mpz_init (y);
+ mpz_bin_uiui (y, b, b/2);
+ b++;
+ for (;; b++)
+ {
+ for (a = b; (a & 1) == 0; a >>= 1);
+ if (a == b) {
+ mpz_divexact_ui (y, y, a/2+1);
+ mpz_mul_ui (y, y, a);
+ } else
+ mpz_mul_2exp (y, y, 1);
+ if (mpz_sizeinbase (y, 2) > numb)
+ break;
+ mpz_mul_ui (x, x, a);
+ mpz_and (x, x, mask);
+ printf ("),CNST_LIMB(0x");
+ mpz_out_str (stdout, 16, x);
+ }
+ printf (")\n");
+ ofe = b - 1;
+ printf
+ ("#define ODD_FACTORIAL_EXTTABLE_LIMIT (%lu)\n", ofe);
+
+ printf
+ ("\n/* This table is 1!!,3!!,...,(2n+1)!! where (2n+1)!! has <= GMP_NUMB_BITS bits */\n");
+ printf
+ ("#define ONE_LIMB_ODD_DOUBLEFACTORIAL_TABLE CNST_LIMB(0x1");
+ mpz_set_ui (x, 1);
+ for (b = 3;; b+=2)
+ {
+ mpz_swap (last, x);
+ mpz_mul_ui (x, last, b);
+ if (mpz_sizeinbase (x, 2) > numb)
+ break;
+ printf ("),CNST_LIMB(0x");
+ mpz_out_str (stdout, 16, x);
+ }
+ printf (")\n");
+ printf
+ ("#define ODD_DOUBLEFACTORIAL_TABLE_MAX CNST_LIMB(0x");
+ mpz_out_str (stdout, 16, last);
+ printf (")\n");
+
+ printf
+ ("#define ODD_DOUBLEFACTORIAL_TABLE_LIMIT (%lu)\n", b - 2);
+
+ printf
+ ("\n/* This table x_1, x_2,... contains values s.t. x_n^n has <= GMP_NUMB_BITS bits */\n");
+ printf
+ ("#define NTH_ROOT_NUMB_MASK_TABLE (GMP_NUMB_MASK");
+ for (b = 2;b <= 8; b++)
+ {
+ mpz_root (x, mask, b);
+ printf ("),CNST_LIMB(0x");
+ mpz_out_str (stdout, 16, x);
+ }
+ printf (")\n");
+
+ mpz_add_ui (mask, mask, 1);
+ printf
+ ("\n/* This table contains inverses of odd factorials, modulo 2^GMP_NUMB_BITS */\n");
+ printf
+ ("\n/* It begins with (2!/2)^-1=1 */\n");
+ printf
+ ("#define ONE_LIMB_ODD_FACTORIAL_INVERSES_TABLE CNST_LIMB(0x1");
+ mpz_set_ui (x, 1);
+ for (b = 3;b <= ofe - 2; b++)
+ {
+ for (a = b; (a & 1) == 0; a >>= 1);
+ mpz_mul_ui (x, x, a);
+ mpz_invert (y, x, mask);
+ printf ("),CNST_LIMB(0x");
+ mpz_out_str (stdout, 16, y);
+ }
+ printf (")\n");
+
+ ofe = (ofe / 16 + 1) * 16;
+
+ printf
+ ("\n/* This table contains 2n-popc(2n) for small n */\n");
+ printf
+ ("\n/* It begins with 2-1=1 (n=1) */\n");
+ printf
+ ("#define TABLE_2N_MINUS_POPC_2N 1");
+ for (b = 4; b <= ofe; b += 2)
+ {
+ mpz_set_ui (x, b);
+ printf (",%lu",b - mpz_popcount (x));
+ }
+ printf ("\n");
+ printf
+ ("#define TABLE_LIMIT_2N_MINUS_POPC_2N %lu\n", ofe + 1);
+
+
+ ofl = (ofl + 1) / 2;
+ printf
+ ("#define ODD_CENTRAL_BINOMIAL_OFFSET (%lu)\n", ofl);
+ printf
+ ("\n/* This table contains binomial(2k,k)/2^t */\n");
+ printf
+ ("\n/* It begins with ODD_CENTRAL_BINOMIAL_TABLE_MIN */\n");
+ printf
+ ("#define ONE_LIMB_ODD_CENTRAL_BINOMIAL_TABLE ");
+ for (b = ofl;; b++)
+ {
+ mpz_bin_uiui (x, 2 * b, b);
+ mpz_remove_twos (x);
+ if (mpz_sizeinbase (x, 2) > numb)
+ break;
+ if (b != ofl)
+ printf ("),");
+ printf("CNST_LIMB(0x");
+ mpz_out_str (stdout, 16, x);
+ }
+ printf (")\n");
+
+ ofe = b - 1;
+ printf
+ ("#define ODD_CENTRAL_BINOMIAL_TABLE_LIMIT (%lu)\n", ofe);
+
+ printf
+ ("\n/* This table contains the inverses of elements in the previous table. */\n");
+ printf
+ ("#define ONE_LIMB_ODD_CENTRAL_BINOMIAL_INVERSE_TABLE CNST_LIMB(0x");
+ for (b = ofl; b <= ofe; b++)
+ {
+ mpz_bin_uiui (x, 2 * b, b);
+ mpz_remove_twos (x);
+ mpz_invert (x, x, mask);
+ mpz_out_str (stdout, 16, x);
+ if (b != ofe)
+ printf ("),CNST_LIMB(0x");
+ }
+ printf (")\n");
+
+ printf
+ ("\n/* This table contains the values t in the formula binomial(2k,k)/2^t */\n");
+ printf
+ ("#define CENTRAL_BINOMIAL_2FAC_TABLE ");
+ for (b = ofl; b <= ofe; b++)
+ {
+ mpz_bin_uiui (x, 2 * b, b);
+ printf ("%d", mpz_remove_twos (x));
+ if (b != ofe)
+ printf (",");
+ }
+ printf ("\n");
+
+ return 0;
+}
+
+int
+main (int argc, char *argv[])
+{
+ int nail_bits, limb_bits, numb_bits;
+
+ if (argc != 3)
+ {
+ fprintf (stderr, "Usage: gen-fac_ui limbbits nailbits\n");
+ exit (1);
+ }
+ limb_bits = atoi (argv[1]);
+ nail_bits = atoi (argv[2]);
+ numb_bits = limb_bits - nail_bits;
+ if (limb_bits < 2 || nail_bits < 0 || numb_bits < 1)
+ {
+ fprintf (stderr, "Invalid limb/nail bits %d,%d\n", limb_bits,
+ nail_bits);
+ exit (1);
+ }
+ gen_consts (numb_bits, nail_bits, limb_bits);
+ return 0;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/gen-fib.c b/Build/source/libs/gmp/gmp-6.0.0/gen-fib.c
new file mode 100644
index 00000000000..d5f26019155
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/gen-fib.c
@@ -0,0 +1,156 @@
+/* Generate Fibonacci table data.
+
+Copyright 2001, 2002, 2004, 2012 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 "bootstrap.c"
+
+mpz_t *f;
+int fnum, fib_limit, luc_limit;
+
+void
+generate (int numb_bits)
+{
+ mpz_t limit, l;
+ int falloc, i;
+
+ mpz_init_set_ui (limit, 1L);
+ mpz_mul_2exp (limit, limit, numb_bits);
+
+ /* fib(2n) > 2^n, so use 2n as a limit for the table size */
+ falloc = 2 * numb_bits;
+ f = xmalloc (falloc * sizeof (*f));
+
+ mpz_init_set_ui (f[0], 1L); /* F[-1] */
+ mpz_init_set_ui (f[1], 0L); /* F[0] */
+
+ mpz_init (l);
+
+ for (i = 2; ; i++)
+ {
+ assert (i < falloc);
+
+ /* F[i] = F[i-1] + F[i-2] */
+ mpz_init (f[i]);
+ mpz_add (f[i], f[i-1], f[i-2]);
+ if (mpz_cmp (f[i], limit) >= 0)
+ break;
+
+ fnum = i+1;
+ fib_limit = i-1;
+
+ /* L[i] = F[i]+2*F[i-1] */
+ mpz_add (l, f[i], f[i-1]);
+ mpz_add (l, l, f[i-1]);
+
+ if (mpz_cmp (l, limit) < 0)
+ luc_limit = i-1;
+ }
+
+ mpz_clear (limit);
+}
+
+
+void
+header (int numb_bits)
+{
+ printf ("/* This file generated by gen-fib.c - DO NOT EDIT. */\n");
+ printf ("\n");
+ printf ("#if GMP_NUMB_BITS != %d\n", numb_bits);
+ printf ("Error, error, this data is for %d bits\n", numb_bits);
+ printf ("#endif\n");
+ printf ("\n");
+ printf ("#define FIB_TABLE_LIMIT %d\n", fib_limit);
+ printf ("#define FIB_TABLE_LUCNUM_LIMIT %d\n", luc_limit);
+}
+
+void
+table (int numb_bits)
+{
+ int i;
+
+ printf ("/* This file generated by gen-fib.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);
+ printf ("Error, error, this data is for %d bits\n", numb_bits);
+ printf ("#endif\n");
+ printf ("\n");
+ printf ("const mp_limb_t\n");
+ printf ("__gmp_fib_table[FIB_TABLE_LIMIT+2] = {\n");
+
+ for (i = 0; i < fnum; i++)
+ {
+ printf (" CNST_LIMB (0x");
+ mpz_out_str (stdout, 16, f[i]);
+ printf ("), /* %d */\n", i-1);
+ }
+ printf ("};\n");
+}
+
+int
+main (int argc, char *argv[])
+{
+ int limb_bits, nail_bits, numb_bits;
+
+ if (argc != 4)
+ {
+ fprintf (stderr, "Usage: gen-bases <header|table> <limbbits> <nailbits>\n");
+ exit (1);
+ }
+
+ limb_bits = atoi (argv[2]);
+ nail_bits = atoi (argv[3]);
+
+ if (limb_bits <= 0
+ || nail_bits < 0
+ || nail_bits >= limb_bits)
+ {
+ fprintf (stderr, "Invalid limb/nail bits: %d %d\n",
+ limb_bits, nail_bits);
+ exit (1);
+ }
+ numb_bits = limb_bits - nail_bits;
+
+ generate (numb_bits);
+
+ if (strcmp (argv[1], "header") == 0)
+ header (numb_bits);
+ else if (strcmp (argv[1], "table") == 0)
+ table (numb_bits);
+ else
+ {
+ fprintf (stderr, "Invalid header/table choice: %s\n", argv[1]);
+ exit (1);
+ }
+
+ return 0;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/gen-jacobitab.c b/Build/source/libs/gmp/gmp-6.0.0/gen-jacobitab.c
new file mode 100644
index 00000000000..537994b3b27
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/gen-jacobitab.c
@@ -0,0 +1,128 @@
+/* gen-jacobi.c
+
+ Contributed to the GNU project by Niels Möller.
+
+Copyright 2010 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/. */
+
+/* Generate the lookup table needed for fast left-to-right computation
+ of the Jacobi symbol. */
+
+#include <assert.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+static const struct
+{
+ unsigned char a;
+ unsigned char b;
+} decode_table[13] = {
+ /* 0 */ { 0, 1 },
+ /* 1 */ { 0, 3 },
+ /* 2 */ { 1, 1 },
+ /* 3 */ { 1, 3 },
+ /* 4 */ { 2, 1 },
+ /* 5 */ { 2, 3 },
+ /* 6 */ { 3, 1 },
+ /* 7 */ { 3, 3 }, /* d = 1 */
+ /* 8 */ { 1, 0 },
+ /* 9 */ { 1, 2 },
+ /* 10 */ { 3, 0 },
+ /* 11 */ { 3, 2 },
+ /* 12 */ { 3, 3 }, /* d = 0 */
+
+};
+#define JACOBI_A(bits) (decode_table[(bits)>>1].a)
+#define JACOBI_B(bits) (decode_table[(bits)>>1].b)
+
+#define JACOBI_E(bits) ((bits) & 1)
+#define JACOBI_D(bits) (((bits)>>1) == 7) /* Gives 0 for don't care states. */
+
+static unsigned
+encode (unsigned a, unsigned b, unsigned d)
+{
+ unsigned i;
+
+ assert (d < 2);
+ assert (a < 4);
+ assert (b < 4);
+ assert ( (a | b ) & 1);
+
+ if (a == 3 && b == 3)
+ return d ? 7 : 12;
+
+ for (i = 0; i < 12; i++)
+ if (decode_table[i].a == a
+ && decode_table[i].b == b)
+ return i;
+
+ abort ();
+}
+
+int
+main (int argc, char **argv)
+{
+ unsigned bits;
+
+ for (bits = 0; bits < 208; bits++)
+ {
+ unsigned e, a, b, d_old, d, q;
+
+ if (bits && !(bits & 0xf))
+ printf("\n");
+
+ q = bits & 3;
+ d = (bits >> 2) & 1;
+
+ e = JACOBI_E (bits >> 3);
+ a = JACOBI_A (bits >> 3);
+ b = JACOBI_B (bits >> 3);
+ d_old = JACOBI_D (bits >> 3);
+
+ if (d != d_old && a == 3 && b == 3)
+ e ^= 1;
+
+ if (d == 1)
+ {
+ if (b == 2)
+ e ^= (q & (a >> 1)) ^ (q >> 1);
+ a = (a - q * b) & 3;
+ }
+ else
+ {
+ if (a == 2)
+ e ^= (q & (b >> 1)) ^ (q >> 1);
+ b = (b - q * a) & 3;
+ }
+
+ printf("%2d,", (encode (a, b, d) << 1) | e);
+ }
+ printf("\n");
+
+ return 0;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/gen-psqr.c b/Build/source/libs/gmp/gmp-6.0.0/gen-psqr.c
new file mode 100644
index 00000000000..31977cda1c2
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/gen-psqr.c
@@ -0,0 +1,586 @@
+/* Generate perfect square testing data.
+
+Copyright 2002-2004, 2012 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 <stdlib.h>
+
+#include "bootstrap.c"
+
+
+/* The aim of this program is to choose either mpn_mod_34lsub1 or mpn_mod_1
+ (plus a PERFSQR_PP modulus), and generate tables indicating quadratic
+ residues and non-residues modulo small factors of that modulus.
+
+ For the usual 32 or 64 bit cases mpn_mod_34lsub1 gets used. That
+ function exists specifically because 2^24-1 and 2^48-1 have nice sets of
+ prime factors. For other limb sizes it's considered, but if it doesn't
+ have good factors then mpn_mod_1 will be used instead.
+
+ When mpn_mod_1 is used, the modulus PERFSQR_PP is created from a
+ selection of small primes, chosen to fill PERFSQR_MOD_BITS of a limb,
+ with that bit count chosen so (2*GMP_LIMB_BITS)*2^PERFSQR_MOD_BITS <=
+ GMP_LIMB_MAX, allowing PERFSQR_MOD_IDX in mpn/generic/perfsqr.c to do its
+ calculation within a single limb.
+
+ In either case primes can be combined to make divisors. The table data
+ then effectively indicates remainders which are quadratic residues mod
+ all the primes. This sort of combining reduces the number of steps
+ needed after mpn_mod_34lsub1 or mpn_mod_1, saving code size and time.
+ Nothing is gained or lost in terms of detections, the same total fraction
+ of non-residues will be identified.
+
+ Nothing particularly sophisticated is attempted for combining factors to
+ make divisors. This is probably a kind of knapsack problem so it'd be
+ too hard to attempt anything completely general. For the usual 32 and 64
+ bit limbs we get a good enough result just pairing the biggest and
+ smallest which fit together, repeatedly.
+
+ Another aim is to get powerful combinations, ie. divisors which identify
+ biggest fraction of non-residues, and have those run first. Again for
+ the usual 32 and 64 bits it seems good enough just to pair for big
+ divisors then sort according to the resulting fraction of non-residues
+ identified.
+
+ Also in this program, a table sq_res_0x100 of residues modulo 256 is
+ generated. This simply fills bits into limbs of the appropriate
+ build-time GMP_LIMB_BITS each.
+
+*/
+
+
+/* Normally we aren't using const in gen*.c programs, so as not to have to
+ bother figuring out if it works, but using it with f_cmp_divisor and
+ f_cmp_fraction avoids warnings from the qsort calls. */
+
+/* Same tests as gmp.h. */
+#if defined (__STDC__) \
+ || defined (__cplusplus) \
+ || defined (_AIX) \
+ || defined (__DECC) \
+ || (defined (__mips) && defined (_SYSTYPE_SVR4)) \
+ || defined (_MSC_VER) \
+ || defined (_WIN32)
+#define HAVE_CONST 1
+#endif
+
+#if ! HAVE_CONST
+#define const
+#endif
+
+
+mpz_t *sq_res_0x100; /* table of limbs */
+int nsq_res_0x100; /* elements in sq_res_0x100 array */
+int sq_res_0x100_num; /* squares in sq_res_0x100 */
+double sq_res_0x100_fraction; /* sq_res_0x100_num / 256 */
+
+int mod34_bits; /* 3*GMP_NUMB_BITS/4 */
+int mod_bits; /* bits from PERFSQR_MOD_34 or MOD_PP */
+int max_divisor; /* all divisors <= max_divisor */
+int max_divisor_bits; /* ceil(log2(max_divisor)) */
+double total_fraction; /* of squares */
+mpz_t pp; /* product of primes, or 0 if mod_34lsub1 used */
+mpz_t pp_norm; /* pp shifted so NUMB high bit set */
+mpz_t pp_inverted; /* invert_limb style inverse */
+mpz_t mod_mask; /* 2^mod_bits-1 */
+char mod34_excuse[128]; /* why mod_34lsub1 not used (if it's not) */
+
+/* raw list of divisors of 2^mod34_bits-1 or pp, just to show in a comment */
+struct rawfactor_t {
+ int divisor;
+ int multiplicity;
+};
+struct rawfactor_t *rawfactor;
+int nrawfactor;
+
+/* factors of 2^mod34_bits-1 or pp and associated data, after combining etc */
+struct factor_t {
+ int divisor;
+ mpz_t inverse; /* 1/divisor mod 2^mod_bits */
+ mpz_t mask; /* indicating squares mod divisor */
+ double fraction; /* squares/total */
+};
+struct factor_t *factor;
+int nfactor; /* entries in use in factor array */
+int factor_alloc; /* entries allocated to factor array */
+
+
+int
+f_cmp_divisor (const void *parg, const void *qarg)
+{
+ const struct factor_t *p, *q;
+ p = parg;
+ q = qarg;
+ if (p->divisor > q->divisor)
+ return 1;
+ else if (p->divisor < q->divisor)
+ return -1;
+ else
+ return 0;
+}
+
+int
+f_cmp_fraction (const void *parg, const void *qarg)
+{
+ const struct factor_t *p, *q;
+ p = parg;
+ q = qarg;
+ if (p->fraction > q->fraction)
+ return 1;
+ else if (p->fraction < q->fraction)
+ return -1;
+ else
+ return 0;
+}
+
+/* Remove array[idx] by copying the remainder down, and adjust narray
+ accordingly. */
+#define COLLAPSE_ELEMENT(array, idx, narray) \
+ do { \
+ memmove (&(array)[idx], \
+ &(array)[idx+1], \
+ ((narray)-((idx)+1)) * sizeof (array[0])); \
+ (narray)--; \
+ } while (0)
+
+
+/* return n*2^p mod m */
+int
+mul_2exp_mod (int n, int p, int m)
+{
+ int i;
+ for (i = 0; i < p; i++)
+ n = (2 * n) % m;
+ return n;
+}
+
+/* return -n mod m */
+int
+neg_mod (int n, int m)
+{
+ assert (n >= 0 && n < m);
+ return (n == 0 ? 0 : m-n);
+}
+
+/* Set "mask" to a value such that "mask & (1<<idx)" is non-zero if
+ "-(idx<<mod_bits)" can be a square modulo m. */
+void
+square_mask (mpz_t mask, int m)
+{
+ int p, i, r, idx;
+
+ p = mul_2exp_mod (1, mod_bits, m);
+ p = neg_mod (p, m);
+
+ mpz_set_ui (mask, 0L);
+ for (i = 0; i < m; i++)
+ {
+ r = (i * i) % m;
+ idx = (r * p) % m;
+ mpz_setbit (mask, (unsigned long) idx);
+ }
+}
+
+void
+generate_sq_res_0x100 (int limb_bits)
+{
+ int i, res;
+
+ nsq_res_0x100 = (0x100 + limb_bits - 1) / limb_bits;
+ sq_res_0x100 = xmalloc (nsq_res_0x100 * sizeof (*sq_res_0x100));
+
+ for (i = 0; i < nsq_res_0x100; i++)
+ mpz_init_set_ui (sq_res_0x100[i], 0L);
+
+ for (i = 0; i < 0x100; i++)
+ {
+ res = (i * i) % 0x100;
+ mpz_setbit (sq_res_0x100[res / limb_bits],
+ (unsigned long) (res % limb_bits));
+ }
+
+ sq_res_0x100_num = 0;
+ for (i = 0; i < nsq_res_0x100; i++)
+ sq_res_0x100_num += mpz_popcount (sq_res_0x100[i]);
+ sq_res_0x100_fraction = (double) sq_res_0x100_num / 256.0;
+}
+
+void
+generate_mod (int limb_bits, int nail_bits)
+{
+ int numb_bits = limb_bits - nail_bits;
+ int i, divisor;
+
+ mpz_init_set_ui (pp, 0L);
+ mpz_init_set_ui (pp_norm, 0L);
+ mpz_init_set_ui (pp_inverted, 0L);
+
+ /* no more than limb_bits many factors in a one limb modulus (and of
+ course in reality nothing like that many) */
+ factor_alloc = limb_bits;
+ factor = xmalloc (factor_alloc * sizeof (*factor));
+ rawfactor = xmalloc (factor_alloc * sizeof (*rawfactor));
+
+ if (numb_bits % 4 != 0)
+ {
+ strcpy (mod34_excuse, "GMP_NUMB_BITS % 4 != 0");
+ goto use_pp;
+ }
+
+ max_divisor = 2*limb_bits;
+ max_divisor_bits = log2_ceil (max_divisor);
+
+ if (numb_bits / 4 < max_divisor_bits)
+ {
+ /* Wind back to one limb worth of max_divisor, if that will let us use
+ mpn_mod_34lsub1. */
+ max_divisor = limb_bits;
+ max_divisor_bits = log2_ceil (max_divisor);
+
+ if (numb_bits / 4 < max_divisor_bits)
+ {
+ strcpy (mod34_excuse, "GMP_NUMB_BITS / 4 too small");
+ goto use_pp;
+ }
+ }
+
+ {
+ /* Can use mpn_mod_34lsub1, find small factors of 2^mod34_bits-1. */
+ mpz_t m, q, r;
+ int multiplicity;
+
+ mod34_bits = (numb_bits / 4) * 3;
+
+ /* mpn_mod_34lsub1 returns a full limb value, PERFSQR_MOD_34 folds it at
+ the mod34_bits mark, adding the two halves for a remainder of at most
+ mod34_bits+1 many bits */
+ mod_bits = mod34_bits + 1;
+
+ mpz_init_set_ui (m, 1L);
+ mpz_mul_2exp (m, m, mod34_bits);
+ mpz_sub_ui (m, m, 1L);
+
+ mpz_init (q);
+ mpz_init (r);
+
+ for (i = 3; i <= max_divisor; i++)
+ {
+ if (! isprime (i))
+ continue;
+
+ mpz_tdiv_qr_ui (q, r, m, (unsigned long) i);
+ if (mpz_sgn (r) != 0)
+ continue;
+
+ /* if a repeated prime is found it's used as an i^n in one factor */
+ divisor = 1;
+ multiplicity = 0;
+ do
+ {
+ if (divisor > max_divisor / i)
+ break;
+ multiplicity++;
+ mpz_set (m, q);
+ mpz_tdiv_qr_ui (q, r, m, (unsigned long) i);
+ }
+ while (mpz_sgn (r) == 0);
+
+ assert (nrawfactor < factor_alloc);
+ rawfactor[nrawfactor].divisor = i;
+ rawfactor[nrawfactor].multiplicity = multiplicity;
+ nrawfactor++;
+ }
+
+ mpz_clear (m);
+ mpz_clear (q);
+ mpz_clear (r);
+ }
+
+ if (nrawfactor <= 2)
+ {
+ mpz_t new_pp;
+
+ sprintf (mod34_excuse, "only %d small factor%s",
+ nrawfactor, nrawfactor == 1 ? "" : "s");
+
+ use_pp:
+ /* reset to two limbs of max_divisor, in case the mpn_mod_34lsub1 code
+ tried with just one */
+ max_divisor = 2*limb_bits;
+ max_divisor_bits = log2_ceil (max_divisor);
+
+ mpz_init (new_pp);
+ nrawfactor = 0;
+ mod_bits = MIN (numb_bits, limb_bits - max_divisor_bits);
+
+ /* one copy of each small prime */
+ mpz_set_ui (pp, 1L);
+ for (i = 3; i <= max_divisor; i++)
+ {
+ if (! isprime (i))
+ continue;
+
+ mpz_mul_ui (new_pp, pp, (unsigned long) i);
+ if (mpz_sizeinbase (new_pp, 2) > mod_bits)
+ break;
+ mpz_set (pp, new_pp);
+
+ assert (nrawfactor < factor_alloc);
+ rawfactor[nrawfactor].divisor = i;
+ rawfactor[nrawfactor].multiplicity = 1;
+ nrawfactor++;
+ }
+
+ /* Plus an extra copy of one or more of the primes selected, if that
+ still fits in max_divisor and the total in mod_bits. Usually only
+ 3 or 5 will be candidates */
+ for (i = nrawfactor-1; i >= 0; i--)
+ {
+ if (rawfactor[i].divisor > max_divisor / rawfactor[i].divisor)
+ continue;
+ mpz_mul_ui (new_pp, pp, (unsigned long) rawfactor[i].divisor);
+ if (mpz_sizeinbase (new_pp, 2) > mod_bits)
+ continue;
+ mpz_set (pp, new_pp);
+
+ rawfactor[i].multiplicity++;
+ }
+
+ mod_bits = mpz_sizeinbase (pp, 2);
+
+ mpz_set (pp_norm, pp);
+ while (mpz_sizeinbase (pp_norm, 2) < numb_bits)
+ mpz_add (pp_norm, pp_norm, pp_norm);
+
+ mpz_preinv_invert (pp_inverted, pp_norm, numb_bits);
+
+ mpz_clear (new_pp);
+ }
+
+ /* start the factor array */
+ for (i = 0; i < nrawfactor; i++)
+ {
+ int j;
+ assert (nfactor < factor_alloc);
+ factor[nfactor].divisor = 1;
+ for (j = 0; j < rawfactor[i].multiplicity; j++)
+ factor[nfactor].divisor *= rawfactor[i].divisor;
+ nfactor++;
+ }
+
+ combine:
+ /* Combine entries in the factor array. Combine the smallest entry with
+ the biggest one that will fit with it (ie. under max_divisor), then
+ repeat that with the new smallest entry. */
+ qsort (factor, nfactor, sizeof (factor[0]), f_cmp_divisor);
+ for (i = nfactor-1; i >= 1; i--)
+ {
+ if (factor[i].divisor <= max_divisor / factor[0].divisor)
+ {
+ factor[0].divisor *= factor[i].divisor;
+ COLLAPSE_ELEMENT (factor, i, nfactor);
+ goto combine;
+ }
+ }
+
+ total_fraction = 1.0;
+ for (i = 0; i < nfactor; i++)
+ {
+ mpz_init (factor[i].inverse);
+ mpz_invert_ui_2exp (factor[i].inverse,
+ (unsigned long) factor[i].divisor,
+ (unsigned long) mod_bits);
+
+ mpz_init (factor[i].mask);
+ square_mask (factor[i].mask, factor[i].divisor);
+
+ /* fraction of possible squares */
+ factor[i].fraction = (double) mpz_popcount (factor[i].mask)
+ / factor[i].divisor;
+
+ /* total fraction of possible squares */
+ total_fraction *= factor[i].fraction;
+ }
+
+ /* best tests first (ie. smallest fraction) */
+ qsort (factor, nfactor, sizeof (factor[0]), f_cmp_fraction);
+}
+
+void
+print (int limb_bits, int nail_bits)
+{
+ int i;
+ mpz_t mhi, mlo;
+
+ printf ("/* This file generated by gen-psqr.c - DO NOT EDIT. */\n");
+ printf ("\n");
+
+ printf ("#if GMP_LIMB_BITS != %d || GMP_NAIL_BITS != %d\n",
+ limb_bits, nail_bits);
+ printf ("Error, error, this data is for %d bit limb and %d bit nail\n",
+ limb_bits, nail_bits);
+ printf ("#endif\n");
+ printf ("\n");
+
+ printf ("/* Non-zero bit indicates a quadratic residue mod 0x100.\n");
+ printf (" This test identifies %.2f%% as non-squares (%d/256). */\n",
+ (1.0 - sq_res_0x100_fraction) * 100.0,
+ 0x100 - sq_res_0x100_num);
+ printf ("static const mp_limb_t\n");
+ printf ("sq_res_0x100[%d] = {\n", nsq_res_0x100);
+ for (i = 0; i < nsq_res_0x100; i++)
+ {
+ printf (" CNST_LIMB(0x");
+ mpz_out_str (stdout, 16, sq_res_0x100[i]);
+ printf ("),\n");
+ }
+ printf ("};\n");
+ printf ("\n");
+
+ if (mpz_sgn (pp) != 0)
+ {
+ printf ("/* mpn_mod_34lsub1 not used due to %s */\n", mod34_excuse);
+ printf ("/* PERFSQR_PP = ");
+ }
+ else
+ printf ("/* 2^%d-1 = ", mod34_bits);
+ for (i = 0; i < nrawfactor; i++)
+ {
+ if (i != 0)
+ printf (" * ");
+ printf ("%d", rawfactor[i].divisor);
+ if (rawfactor[i].multiplicity != 1)
+ printf ("^%d", rawfactor[i].multiplicity);
+ }
+ printf (" %s*/\n", mpz_sgn (pp) == 0 ? "... " : "");
+
+ printf ("#define PERFSQR_MOD_BITS %d\n", mod_bits);
+ if (mpz_sgn (pp) != 0)
+ {
+ printf ("#define PERFSQR_PP CNST_LIMB(0x");
+ mpz_out_str (stdout, 16, pp);
+ printf (")\n");
+ printf ("#define PERFSQR_PP_NORM CNST_LIMB(0x");
+ mpz_out_str (stdout, 16, pp_norm);
+ printf (")\n");
+ printf ("#define PERFSQR_PP_INVERTED CNST_LIMB(0x");
+ mpz_out_str (stdout, 16, pp_inverted);
+ printf (")\n");
+ }
+ printf ("\n");
+
+ mpz_init (mhi);
+ mpz_init (mlo);
+
+ printf ("/* This test identifies %.2f%% as non-squares. */\n",
+ (1.0 - total_fraction) * 100.0);
+ printf ("#define PERFSQR_MOD_TEST(up, usize) \\\n");
+ printf (" do { \\\n");
+ printf (" mp_limb_t r; \\\n");
+ if (mpz_sgn (pp) != 0)
+ printf (" PERFSQR_MOD_PP (r, up, usize); \\\n");
+ else
+ printf (" PERFSQR_MOD_34 (r, up, usize); \\\n");
+
+ for (i = 0; i < nfactor; i++)
+ {
+ printf (" \\\n");
+ printf (" /* %5.2f%% */ \\\n",
+ (1.0 - factor[i].fraction) * 100.0);
+
+ printf (" PERFSQR_MOD_%d (r, CNST_LIMB(%2d), CNST_LIMB(0x",
+ factor[i].divisor <= limb_bits ? 1 : 2,
+ factor[i].divisor);
+ mpz_out_str (stdout, 16, factor[i].inverse);
+ printf ("), \\\n");
+ printf (" CNST_LIMB(0x");
+
+ if ( factor[i].divisor <= limb_bits)
+ {
+ mpz_out_str (stdout, 16, factor[i].mask);
+ }
+ else
+ {
+ mpz_tdiv_r_2exp (mlo, factor[i].mask, (unsigned long) limb_bits);
+ mpz_tdiv_q_2exp (mhi, factor[i].mask, (unsigned long) limb_bits);
+ mpz_out_str (stdout, 16, mhi);
+ printf ("), CNST_LIMB(0x");
+ mpz_out_str (stdout, 16, mlo);
+ }
+ printf (")); \\\n");
+ }
+
+ printf (" } while (0)\n");
+ printf ("\n");
+
+ printf ("/* Grand total sq_res_0x100 and PERFSQR_MOD_TEST, %.2f%% non-squares. */\n",
+ (1.0 - (total_fraction * 44.0/256.0)) * 100.0);
+ printf ("\n");
+
+ printf ("/* helper for tests/mpz/t-perfsqr.c */\n");
+ printf ("#define PERFSQR_DIVISORS { 256,");
+ for (i = 0; i < nfactor; i++)
+ printf (" %d,", factor[i].divisor);
+ printf (" }\n");
+
+
+ mpz_clear (mhi);
+ mpz_clear (mlo);
+}
+
+int
+main (int argc, char *argv[])
+{
+ int limb_bits, nail_bits;
+
+ if (argc != 3)
+ {
+ fprintf (stderr, "Usage: gen-psqr <limbbits> <nailbits>\n");
+ exit (1);
+ }
+
+ limb_bits = atoi (argv[1]);
+ nail_bits = atoi (argv[2]);
+
+ if (limb_bits <= 0
+ || nail_bits < 0
+ || nail_bits >= limb_bits)
+ {
+ fprintf (stderr, "Invalid limb/nail bits: %d %d\n",
+ limb_bits, nail_bits);
+ exit (1);
+ }
+
+ generate_sq_res_0x100 (limb_bits);
+ generate_mod (limb_bits, nail_bits);
+
+ print (limb_bits, nail_bits);
+
+ return 0;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/gen-trialdivtab.c b/Build/source/libs/gmp/gmp-6.0.0/gen-trialdivtab.c
new file mode 100644
index 00000000000..75876660031
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/gen-trialdivtab.c
@@ -0,0 +1,300 @@
+/* gen-trialdivtab.c
+
+ Contributed to the GNU project by Torbjorn Granlund.
+
+Copyright 2009, 2012, 2013 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/. */
+
+/*
+ Generate tables for fast, division-free trial division for GMP.
+
+ There is one main table, ptab. It contains primes, multiplied together, and
+ several types of pre-computed inverses. It refers to tables of the type
+ dtab, via the last two indices. That table contains the individual primes in
+ the range, except that the primes are not actually included in the table (see
+ the P macro; it sneakingly excludes the primes themselves). Instead, the
+ dtab tables contains tuples for each prime (modular-inverse, limit) used for
+ divisibility checks.
+
+ This interface is not intended for division of very many primes, since then
+ other algorithms apply.
+*/
+
+#include <stdlib.h>
+#include <stdio.h>
+#include "bootstrap.c"
+
+int sumspills (mpz_t, mpz_t *, int);
+void mpn_mod_1s_4p_cps (mpz_t [7], mpz_t);
+
+int limb_bits;
+
+mpz_t B;
+
+int
+main (int argc, char *argv[])
+{
+ unsigned long t, p;
+ mpz_t ppp, acc, inv, gmp_numb_max, tmp, Bhalf;
+ mpz_t pre[7];
+ int i;
+ int start_p, end_p, interval_start, interval_end, omitted_p;
+ char *endtok;
+ int stop;
+ int np, start_idx;
+
+ if (argc < 2)
+ {
+ fprintf (stderr, "usage: %s bits endprime\n", argv[0]);
+ exit (1);
+ }
+
+ limb_bits = atoi (argv[1]);
+
+ end_p = 1290; /* default end prime */
+ if (argc == 3)
+ end_p = atoi (argv[2]);
+
+ printf ("#if GMP_LIMB_BITS != %d\n", limb_bits);
+ printf ("#error This table is for GMP_LIMB_BITS = %d\n", limb_bits);
+ printf ("#endif\n\n");
+
+ printf ("#if GMP_NAIL_BITS != 0\n");
+ printf ("#error This table does not support nails\n");
+ printf ("#endif\n\n");
+
+ 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_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);
+
+ start_p = 3;
+
+ mpz_init_set_ui (ppp, 1);
+ mpz_init (acc);
+ interval_start = start_p;
+ omitted_p = 3;
+ interval_end = 0;
+
+/* printf ("static struct gmp_primes_dtab gmp_primes_dtab[] = {\n"); */
+
+ printf ("#ifdef WANT_dtab\n");
+
+ for (t = start_p; t <= end_p; t += 2)
+ {
+ if (! isprime (t))
+ continue;
+
+ mpz_mul_ui (acc, ppp, t);
+ stop = mpz_cmp (acc, Bhalf) >= 0;
+ if (!stop)
+ {
+ mpn_mod_1s_4p_cps (pre, acc);
+ stop = sumspills (acc, pre + 2, 5);
+ }
+
+ if (stop)
+ {
+ for (p = interval_start; p <= interval_end; p += 2)
+ {
+ if (! isprime (p))
+ continue;
+
+ printf (" P(%d,", (int) p);
+ mpz_invert_ui_2exp (inv, p, limb_bits);
+ printf ("CNST_LIMB(0x"); mpz_out_str (stdout, 16, inv); printf ("),");
+
+ mpz_tdiv_q_ui (tmp, gmp_numb_max, p);
+ printf ("CNST_LIMB(0x"); mpz_out_str (stdout, 16, tmp);
+ printf (")),\n");
+ }
+ mpz_set_ui (ppp, t);
+ interval_start = t;
+ omitted_p = t;
+ }
+ else
+ {
+ mpz_set (ppp, acc);
+ }
+ interval_end = t;
+ }
+ printf ("#define SMALLEST_OMITTED_PRIME %d\n", (int) omitted_p);
+ printf ("#endif\n");
+
+ printf ("#ifdef WANT_ptab\n");
+
+/* printf ("static struct gmp_primes_ptab gmp_primes_ptab[] = {\n"); */
+
+ endtok = "";
+
+ mpz_set_ui (ppp, 1);
+ interval_start = start_p;
+ interval_end = 0;
+ np = 0;
+ start_idx = 0;
+ for (t = start_p; t <= end_p; t += 2)
+ {
+ if (! isprime (t))
+ continue;
+
+ mpz_mul_ui (acc, ppp, t);
+
+ stop = mpz_cmp (acc, Bhalf) >= 0;
+ if (!stop)
+ {
+ mpn_mod_1s_4p_cps (pre, acc);
+ stop = sumspills (acc, pre + 2, 5);
+ }
+
+ if (stop)
+ {
+ mpn_mod_1s_4p_cps (pre, ppp);
+ printf ("%s", endtok);
+ printf (" {CNST_LIMB(0x"); mpz_out_str (stdout, 16, ppp);
+ printf ("),{CNST_LIMB(0x"); mpz_out_str (stdout, 16, pre[0]);
+ printf ("),%d", (int) PTR(pre[1])[0]);
+ for (i = 0; i < 5; i++)
+ {
+ printf (",");
+ printf ("CNST_LIMB(0x"); mpz_out_str (stdout, 16, pre[2 + i]);
+ printf (")");
+ }
+ printf ("},");
+ printf ("%d,", start_idx);
+ printf ("%d}", np - start_idx);
+
+ endtok = ",\n";
+ mpz_set_ui (ppp, t);
+ interval_start = t;
+ start_idx = np;
+ }
+ else
+ {
+ mpz_set (ppp, acc);
+ }
+ interval_end = t;
+ np++;
+ }
+
+ printf ("\n");
+ printf ("#endif\n");
+
+ return 0;
+}
+
+unsigned long
+mpz_log2 (mpz_t x)
+{
+ return mpz_sgn (x) ? mpz_sizeinbase (x, 2) : 0;
+}
+
+void
+mpn_mod_1s_4p_cps (mpz_t cps[7], mpz_t bparm)
+{
+ mpz_t b, bi;
+ mpz_t B1modb, B2modb, B3modb, B4modb, B5modb;
+ mpz_t t;
+ int cnt;
+
+ mpz_init_set (b, bparm);
+
+ cnt = limb_bits - mpz_log2 (b);
+
+ mpz_init (bi);
+ mpz_init (t);
+ mpz_init (B1modb);
+ mpz_init (B2modb);
+ mpz_init (B3modb);
+ mpz_init (B4modb);
+ mpz_init (B5modb);
+
+ mpz_set_ui (t, 1);
+ mpz_mul_2exp (t, t, limb_bits - cnt);
+ mpz_sub (t, t, b);
+ mpz_mul_2exp (t, t, limb_bits);
+ mpz_tdiv_q (bi, t, b); /* bi = B^2/b, except msb */
+
+ mpz_set_ui (t, 1);
+ mpz_mul_2exp (t, t, limb_bits); /* t = B */
+ mpz_tdiv_r (B1modb, t, b);
+
+ mpz_mul_2exp (t, B1modb, limb_bits);
+ mpz_tdiv_r (B2modb, t, b);
+
+ mpz_mul_2exp (t, B2modb, limb_bits);
+ mpz_tdiv_r (B3modb, t, b);
+
+ mpz_mul_2exp (t, B3modb, limb_bits);
+ mpz_tdiv_r (B4modb, t, b);
+
+ mpz_mul_2exp (t, B4modb, limb_bits);
+ mpz_tdiv_r (B5modb, t, b);
+
+ mpz_set (cps[0], bi);
+ mpz_set_ui (cps[1], cnt);
+ mpz_tdiv_q_2exp (cps[2], B1modb, 0);
+ mpz_tdiv_q_2exp (cps[3], B2modb, 0);
+ mpz_tdiv_q_2exp (cps[4], B3modb, 0);
+ mpz_tdiv_q_2exp (cps[5], B4modb, 0);
+ mpz_tdiv_q_2exp (cps[6], B5modb, 0);
+
+ mpz_clear (b);
+ mpz_clear (bi);
+ mpz_clear (t);
+ mpz_clear (B1modb);
+ mpz_clear (B2modb);
+ mpz_clear (B3modb);
+ mpz_clear (B4modb);
+ mpz_clear (B5modb);
+}
+
+int
+sumspills (mpz_t ppp, mpz_t *a, int n)
+{
+ mpz_t s;
+ int i, ret;
+
+ mpz_init_set (s, a[0]);
+
+ for (i = 1; i < n; i++)
+ {
+ mpz_add (s, s, a[i]);
+ }
+ ret = mpz_cmp (s, B) >= 0;
+ mpz_clear (s);
+
+ return ret;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/gmp-h.in b/Build/source/libs/gmp/gmp-6.0.0/gmp-h.in
new file mode 100644
index 00000000000..32f63d9a08e
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/gmp-h.in
@@ -0,0 +1,2301 @@
+/* Definitions for GNU multiple precision functions. -*- mode: c -*-
+
+Copyright 1991, 1993-1997, 1999-2014 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/. */
+
+#ifndef __GMP_H__
+
+#if defined (__cplusplus)
+#include <iosfwd> /* for std::istream, std::ostream, std::string */
+#include <cstdio>
+#endif
+
+
+/* Instantiated by configure. */
+#if ! defined (__GMP_WITHIN_CONFIGURE)
+#define __GMP_HAVE_HOST_CPU_FAMILY_power @HAVE_HOST_CPU_FAMILY_power@
+#define __GMP_HAVE_HOST_CPU_FAMILY_powerpc @HAVE_HOST_CPU_FAMILY_powerpc@
+#define GMP_LIMB_BITS @GMP_LIMB_BITS@
+#define GMP_NAIL_BITS @GMP_NAIL_BITS@
+#endif
+#define GMP_NUMB_BITS (GMP_LIMB_BITS - GMP_NAIL_BITS)
+#define GMP_NUMB_MASK ((~ __GMP_CAST (mp_limb_t, 0)) >> GMP_NAIL_BITS)
+#define GMP_NUMB_MAX GMP_NUMB_MASK
+#define GMP_NAIL_MASK (~ GMP_NUMB_MASK)
+
+
+/* The following (everything under ifndef __GNU_MP__) must be identical in
+ gmp.h and mp.h to allow both to be included in an application or during
+ the library build. */
+#ifndef __GNU_MP__
+#define __GNU_MP__ 5
+
+#include <stddef.h> /* for size_t */
+
+/* Instantiated by configure. */
+#if ! defined (__GMP_WITHIN_CONFIGURE)
+@DEFN_LONG_LONG_LIMB@
+#define __GMP_LIBGMP_DLL @LIBGMP_DLL@
+#endif
+
+
+/* __GMP_DECLSPEC supports Windows DLL versions of libgmp, and is empty in
+ all other circumstances.
+
+ When compiling objects for libgmp, __GMP_DECLSPEC is an export directive,
+ or when compiling for an application it's an import directive. The two
+ cases are differentiated by __GMP_WITHIN_GMP defined by the GMP Makefiles
+ (and not defined from an application).
+
+ __GMP_DECLSPEC_XX is similarly used for libgmpxx. __GMP_WITHIN_GMPXX
+ indicates when building libgmpxx, and in that case libgmpxx functions are
+ exports, but libgmp functions which might get called are imports.
+
+ Libtool DLL_EXPORT define is not used.
+
+ There's no attempt to support GMP built both static and DLL. Doing so
+ would mean applications would have to tell us which of the two is going
+ to be used when linking, and that seems very tedious and error prone if
+ using GMP by hand, and equally tedious from a package since autoconf and
+ automake don't give much help.
+
+ __GMP_DECLSPEC is required on all documented global functions and
+ variables, the various internals in gmp-impl.h etc can be left unadorned.
+ But internals used by the test programs or speed measuring programs
+ should have __GMP_DECLSPEC, and certainly constants or variables must
+ have it or the wrong address will be resolved.
+
+ In gcc __declspec can go at either the start or end of a prototype.
+
+ In Microsoft C __declspec must go at the start, or after the type like
+ void __declspec(...) *foo()". There's no __dllexport or anything to
+ guard against someone foolish #defining dllexport. _export used to be
+ available, but no longer.
+
+ In Borland C _export still exists, but needs to go after the type, like
+ "void _export foo();". Would have to change the __GMP_DECLSPEC syntax to
+ make use of that. Probably more trouble than it's worth. */
+
+#if defined (__GNUC__)
+#define __GMP_DECLSPEC_EXPORT __declspec(__dllexport__)
+#define __GMP_DECLSPEC_IMPORT __declspec(__dllimport__)
+#endif
+#if defined (_MSC_VER) || defined (__BORLANDC__)
+#define __GMP_DECLSPEC_EXPORT __declspec(dllexport)
+#define __GMP_DECLSPEC_IMPORT __declspec(dllimport)
+#endif
+#ifdef __WATCOMC__
+#define __GMP_DECLSPEC_EXPORT __export
+#define __GMP_DECLSPEC_IMPORT __import
+#endif
+#ifdef __IBMC__
+#define __GMP_DECLSPEC_EXPORT _Export
+#define __GMP_DECLSPEC_IMPORT _Import
+#endif
+
+#if __GMP_LIBGMP_DLL
+#ifdef __GMP_WITHIN_GMP
+/* compiling to go into a DLL libgmp */
+#define __GMP_DECLSPEC __GMP_DECLSPEC_EXPORT
+#else
+/* compiling to go into an application which will link to a DLL libgmp */
+#define __GMP_DECLSPEC __GMP_DECLSPEC_IMPORT
+#endif
+#else
+/* all other cases */
+#define __GMP_DECLSPEC
+#endif
+
+
+#ifdef __GMP_SHORT_LIMB
+typedef unsigned int mp_limb_t;
+typedef int mp_limb_signed_t;
+#else
+#ifdef _LONG_LONG_LIMB
+typedef unsigned long long int mp_limb_t;
+typedef long long int mp_limb_signed_t;
+#else
+typedef unsigned long int mp_limb_t;
+typedef long int mp_limb_signed_t;
+#endif
+#endif
+typedef unsigned long int mp_bitcnt_t;
+
+/* For reference, note that the name __mpz_struct gets into C++ mangled
+ function names, which means although the "__" suggests an internal, we
+ must leave this name for binary compatibility. */
+typedef struct
+{
+ int _mp_alloc; /* Number of *limbs* allocated and pointed
+ to by the _mp_d field. */
+ int _mp_size; /* abs(_mp_size) is the number of limbs the
+ last field points to. If _mp_size is
+ negative this is a negative number. */
+ mp_limb_t *_mp_d; /* Pointer to the limbs. */
+} __mpz_struct;
+
+#endif /* __GNU_MP__ */
+
+
+typedef __mpz_struct MP_INT; /* gmp 1 source compatibility */
+typedef __mpz_struct mpz_t[1];
+
+typedef mp_limb_t * mp_ptr;
+typedef const mp_limb_t * mp_srcptr;
+#if defined (_CRAY) && ! defined (_CRAYMPP)
+/* plain `int' is much faster (48 bits) */
+#define __GMP_MP_SIZE_T_INT 1
+typedef int mp_size_t;
+typedef int mp_exp_t;
+#else
+#define __GMP_MP_SIZE_T_INT 0
+typedef long int mp_size_t;
+typedef long int mp_exp_t;
+#endif
+
+typedef struct
+{
+ __mpz_struct _mp_num;
+ __mpz_struct _mp_den;
+} __mpq_struct;
+
+typedef __mpq_struct MP_RAT; /* gmp 1 source compatibility */
+typedef __mpq_struct mpq_t[1];
+
+typedef struct
+{
+ int _mp_prec; /* Max precision, in number of `mp_limb_t's.
+ Set by mpf_init and modified by
+ mpf_set_prec. The area pointed to by the
+ _mp_d field contains `prec' + 1 limbs. */
+ int _mp_size; /* abs(_mp_size) is the number of limbs the
+ last field points to. If _mp_size is
+ negative this is a negative number. */
+ mp_exp_t _mp_exp; /* Exponent, in the base of `mp_limb_t'. */
+ mp_limb_t *_mp_d; /* Pointer to the limbs. */
+} __mpf_struct;
+
+/* typedef __mpf_struct MP_FLOAT; */
+typedef __mpf_struct mpf_t[1];
+
+/* Available random number generation algorithms. */
+typedef enum
+{
+ GMP_RAND_ALG_DEFAULT = 0,
+ GMP_RAND_ALG_LC = GMP_RAND_ALG_DEFAULT /* Linear congruential. */
+} gmp_randalg_t;
+
+/* Random state struct. */
+typedef struct
+{
+ mpz_t _mp_seed; /* _mp_d member points to state of the generator. */
+ gmp_randalg_t _mp_alg; /* Currently unused. */
+ union {
+ void *_mp_lc; /* Pointer to function pointers structure. */
+ } _mp_algdata;
+} __gmp_randstate_struct;
+typedef __gmp_randstate_struct gmp_randstate_t[1];
+
+/* Types for function declarations in gmp files. */
+/* ??? Should not pollute user name space with these ??? */
+typedef const __mpz_struct *mpz_srcptr;
+typedef __mpz_struct *mpz_ptr;
+typedef const __mpf_struct *mpf_srcptr;
+typedef __mpf_struct *mpf_ptr;
+typedef const __mpq_struct *mpq_srcptr;
+typedef __mpq_struct *mpq_ptr;
+
+
+/* This is not wanted in mp.h, so put it outside the __GNU_MP__ common
+ section. */
+#if __GMP_LIBGMP_DLL
+#ifdef __GMP_WITHIN_GMPXX
+/* compiling to go into a DLL libgmpxx */
+#define __GMP_DECLSPEC_XX __GMP_DECLSPEC_EXPORT
+#else
+/* compiling to go into a application which will link to a DLL libgmpxx */
+#define __GMP_DECLSPEC_XX __GMP_DECLSPEC_IMPORT
+#endif
+#else
+/* all other cases */
+#define __GMP_DECLSPEC_XX
+#endif
+
+
+#ifndef __MPN
+#define __MPN(x) __gmpn_##x
+#endif
+
+/* 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 */
+#define _GMP_H_HAVE_FILE 1
+#endif
+
+/* In ISO C, if a prototype involving "struct obstack *" is given without
+ that structure defined, then the struct is scoped down to just the
+ prototype, causing a conflict if it's subsequently defined for real. So
+ only give prototypes if we've got obstack.h. */
+#if defined (_OBSTACK_H) /* glibc <obstack.h> */
+#define _GMP_H_HAVE_OBSTACK 1
+#endif
+
+/* The prototypes for gmp_vprintf etc are provided only if va_list is defined,
+ via an application having included <stdarg.h>. Usually va_list is a typedef
+ so can't be tested directly, but C99 specifies that va_start is a macro.
+
+ <stdio.h> will define some sort of va_list for vprintf and vfprintf, but
+ let's not bother trying to use that since it's not standard and since
+ application uses for gmp_vprintf etc will almost certainly require the
+ whole <stdarg.h> anyway. */
+
+#ifdef va_start
+#define _GMP_H_HAVE_VA_LIST 1
+#endif
+
+/* Test for gcc >= maj.min, as per __GNUC_PREREQ in glibc */
+#if defined (__GNUC__) && defined (__GNUC_MINOR__)
+#define __GMP_GNUC_PREREQ(maj, min) \
+ ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min))
+#else
+#define __GMP_GNUC_PREREQ(maj, min) 0
+#endif
+
+/* "pure" is in gcc 2.96 and up, see "(gcc)Function Attributes". Basically
+ it means a function does nothing but examine its arguments and memory
+ (global or via arguments) to generate a return value, but changes nothing
+ and has no side-effects. __GMP_NO_ATTRIBUTE_CONST_PURE lets
+ tune/common.c etc turn this off when trying to write timing loops. */
+#if __GMP_GNUC_PREREQ (2,96) && ! defined (__GMP_NO_ATTRIBUTE_CONST_PURE)
+#define __GMP_ATTRIBUTE_PURE __attribute__ ((__pure__))
+#else
+#define __GMP_ATTRIBUTE_PURE
+#endif
+
+
+/* __GMP_CAST allows us to use static_cast in C++, so our macros are clean
+ to "g++ -Wold-style-cast".
+
+ Casts in "extern inline" code within an extern "C" block don't induce
+ these warnings, so __GMP_CAST only needs to be used on documented
+ macros. */
+
+#ifdef __cplusplus
+#define __GMP_CAST(type, expr) (static_cast<type> (expr))
+#else
+#define __GMP_CAST(type, expr) ((type) (expr))
+#endif
+
+
+/* An empty "throw ()" means the function doesn't throw any C++ exceptions,
+ this can save some stack frame info in applications.
+
+ Currently it's given only on functions which never divide-by-zero etc,
+ don't allocate memory, and are expected to never need to allocate memory.
+ This leaves open the possibility of a C++ throw from a future GMP
+ exceptions scheme.
+
+ mpz_set_ui etc are omitted to leave open the lazy allocation scheme
+ described in doc/tasks.html. mpz_get_d etc are omitted to leave open
+ exceptions for float overflows.
+
+ Note that __GMP_NOTHROW must be given on any inlines the same as on their
+ prototypes (for g++ at least, where they're used together). Note also
+ that g++ 3.0 demands that __GMP_NOTHROW is before other attributes like
+ __GMP_ATTRIBUTE_PURE. */
+
+#if defined (__cplusplus)
+#define __GMP_NOTHROW throw ()
+#else
+#define __GMP_NOTHROW
+#endif
+
+
+/* PORTME: What other compilers have a useful "extern inline"? "static
+ inline" would be an acceptable substitute if the compiler (or linker)
+ discards unused statics. */
+
+ /* gcc has __inline__ in all modes, including strict ansi. Give a prototype
+ for an inline too, so as to correctly specify "dllimport" on windows, in
+ case the function is called rather than inlined.
+ GCC 4.3 and above with -std=c99 or -std=gnu99 implements ISO C99
+ inline semantics, unless -fgnu89-inline is used. */
+#ifdef __GNUC__
+#if (defined __GNUC_STDC_INLINE__) || (__GNUC__ == 4 && __GNUC_MINOR__ == 2) \
+ || (defined __GNUC_GNU_INLINE__ && defined __cplusplus)
+#define __GMP_EXTERN_INLINE extern __inline__ __attribute__ ((__gnu_inline__))
+#else
+#define __GMP_EXTERN_INLINE extern __inline__
+#endif
+#define __GMP_INLINE_PROTOTYPES 1
+#endif
+
+/* DEC C (eg. version 5.9) supports "static __inline foo()", even in -std1
+ strict ANSI mode. Inlining is done even when not optimizing (ie. -O0
+ mode, which is the default), but an unnecessary local copy of foo is
+ emitted unless -O is used. "extern __inline" is accepted, but the
+ "extern" appears to be ignored, ie. it becomes a plain global function
+ but which is inlined within its file. Don't know if all old versions of
+ DEC C supported __inline, but as a start let's do the right thing for
+ current versions. */
+#ifdef __DECC
+#define __GMP_EXTERN_INLINE static __inline
+#endif
+
+/* SCO OpenUNIX 8 cc supports "static inline foo()" but not in -Xc strict
+ ANSI mode (__STDC__ is 1 in that mode). Inlining only actually takes
+ place under -O. Without -O "foo" seems to be emitted whether it's used
+ or not, which is wasteful. "extern inline foo()" isn't useful, the
+ "extern" is apparently ignored, so foo is inlined if possible but also
+ emitted as a global, which causes multiple definition errors when
+ building a shared libgmp. */
+#ifdef __SCO_VERSION__
+#if __SCO_VERSION__ > 400000000 && __STDC__ != 1 \
+ && ! defined (__GMP_EXTERN_INLINE)
+#define __GMP_EXTERN_INLINE static inline
+#endif
+#endif
+
+/* Microsoft's C compiler accepts __inline */
+#ifdef _MSC_VER
+#define __GMP_EXTERN_INLINE __inline
+#endif
+
+/* Recent enough Sun C compilers want "inline" */
+#if defined (__SUNPRO_C) && __SUNPRO_C >= 0x560 \
+ && ! defined (__GMP_EXTERN_INLINE)
+#define __GMP_EXTERN_INLINE inline
+#endif
+
+/* Somewhat older Sun C compilers want "static inline" */
+#if defined (__SUNPRO_C) && __SUNPRO_C >= 0x540 \
+ && ! defined (__GMP_EXTERN_INLINE)
+#define __GMP_EXTERN_INLINE static inline
+#endif
+
+
+/* C++ always has "inline" and since it's a normal feature the linker should
+ discard duplicate non-inlined copies, or if it doesn't then that's a
+ problem for everyone, not just GMP. */
+#if defined (__cplusplus) && ! defined (__GMP_EXTERN_INLINE)
+#define __GMP_EXTERN_INLINE inline
+#endif
+
+/* Don't do any inlining within a configure run, since if the compiler ends
+ up emitting copies of the code into the object file it can end up
+ demanding the various support routines (like mpn_popcount) for linking,
+ making the "alloca" test and perhaps others fail. And on hppa ia64 a
+ pre-release gcc 3.2 was seen not respecting the "extern" in "extern
+ __inline__", triggering this problem too. */
+#if defined (__GMP_WITHIN_CONFIGURE) && ! __GMP_WITHIN_CONFIGURE_INLINE
+#undef __GMP_EXTERN_INLINE
+#endif
+
+/* By default, don't give a prototype when there's going to be an inline
+ version. Note in particular that Cray C++ objects to the combination of
+ prototype and inline. */
+#ifdef __GMP_EXTERN_INLINE
+#ifndef __GMP_INLINE_PROTOTYPES
+#define __GMP_INLINE_PROTOTYPES 0
+#endif
+#else
+#define __GMP_INLINE_PROTOTYPES 1
+#endif
+
+
+#define __GMP_ABS(x) ((x) >= 0 ? (x) : -(x))
+#define __GMP_MAX(h,i) ((h) > (i) ? (h) : (i))
+
+/* __GMP_USHRT_MAX is not "~ (unsigned short) 0" because short is promoted
+ to int by "~". It still needs to have the promoted type. */
+#define __GMP_UINT_MAX (~ (unsigned) 0)
+#define __GMP_ULONG_MAX (~ (unsigned long) 0)
+#define __GMP_USHRT_MAX (0 + (unsigned short) ~0)
+
+
+/* __builtin_expect is in gcc 3.0, and not in 2.95. */
+#if __GMP_GNUC_PREREQ (3,0)
+#define __GMP_LIKELY(cond) __builtin_expect ((cond) != 0, 1)
+#define __GMP_UNLIKELY(cond) __builtin_expect ((cond) != 0, 0)
+#else
+#define __GMP_LIKELY(cond) (cond)
+#define __GMP_UNLIKELY(cond) (cond)
+#endif
+
+#ifdef _CRAY
+#define __GMP_CRAY_Pragma(str) _Pragma (str)
+#else
+#define __GMP_CRAY_Pragma(str)
+#endif
+
+
+/* Allow direct user access to numerator and denominator of a mpq_t object. */
+#define mpq_numref(Q) (&((Q)->_mp_num))
+#define mpq_denref(Q) (&((Q)->_mp_den))
+
+
+#if defined (__cplusplus)
+extern "C" {
+using std::FILE;
+#endif
+
+#define mp_set_memory_functions __gmp_set_memory_functions
+__GMP_DECLSPEC void mp_set_memory_functions (void *(*) (size_t),
+ void *(*) (void *, size_t, size_t),
+ void (*) (void *, size_t)) __GMP_NOTHROW;
+
+#define mp_get_memory_functions __gmp_get_memory_functions
+__GMP_DECLSPEC void mp_get_memory_functions (void *(**) (size_t),
+ void *(**) (void *, size_t, size_t),
+ void (**) (void *, size_t)) __GMP_NOTHROW;
+
+#define mp_bits_per_limb __gmp_bits_per_limb
+__GMP_DECLSPEC extern const int mp_bits_per_limb;
+
+#define gmp_errno __gmp_errno
+__GMP_DECLSPEC extern int gmp_errno;
+
+#define gmp_version __gmp_version
+__GMP_DECLSPEC extern const char * const gmp_version;
+
+
+/**************** Random number routines. ****************/
+
+/* obsolete */
+#define gmp_randinit __gmp_randinit
+__GMP_DECLSPEC void gmp_randinit (gmp_randstate_t, gmp_randalg_t, ...);
+
+#define gmp_randinit_default __gmp_randinit_default
+__GMP_DECLSPEC void gmp_randinit_default (gmp_randstate_t);
+
+#define gmp_randinit_lc_2exp __gmp_randinit_lc_2exp
+__GMP_DECLSPEC void gmp_randinit_lc_2exp (gmp_randstate_t, mpz_srcptr, unsigned long int, mp_bitcnt_t);
+
+#define gmp_randinit_lc_2exp_size __gmp_randinit_lc_2exp_size
+__GMP_DECLSPEC int gmp_randinit_lc_2exp_size (gmp_randstate_t, mp_bitcnt_t);
+
+#define gmp_randinit_mt __gmp_randinit_mt
+__GMP_DECLSPEC void gmp_randinit_mt (gmp_randstate_t);
+
+#define gmp_randinit_set __gmp_randinit_set
+__GMP_DECLSPEC void gmp_randinit_set (gmp_randstate_t, const __gmp_randstate_struct *);
+
+#define gmp_randseed __gmp_randseed
+__GMP_DECLSPEC void gmp_randseed (gmp_randstate_t, mpz_srcptr);
+
+#define gmp_randseed_ui __gmp_randseed_ui
+__GMP_DECLSPEC void gmp_randseed_ui (gmp_randstate_t, unsigned long int);
+
+#define gmp_randclear __gmp_randclear
+__GMP_DECLSPEC void gmp_randclear (gmp_randstate_t);
+
+#define gmp_urandomb_ui __gmp_urandomb_ui
+__GMP_DECLSPEC unsigned long gmp_urandomb_ui (gmp_randstate_t, unsigned long);
+
+#define gmp_urandomm_ui __gmp_urandomm_ui
+__GMP_DECLSPEC unsigned long gmp_urandomm_ui (gmp_randstate_t, unsigned long);
+
+
+/**************** Formatted output routines. ****************/
+
+#define gmp_asprintf __gmp_asprintf
+__GMP_DECLSPEC int gmp_asprintf (char **, const char *, ...);
+
+#define gmp_fprintf __gmp_fprintf
+#ifdef _GMP_H_HAVE_FILE
+__GMP_DECLSPEC int gmp_fprintf (FILE *, const char *, ...);
+#endif
+
+#define gmp_obstack_printf __gmp_obstack_printf
+#if defined (_GMP_H_HAVE_OBSTACK)
+__GMP_DECLSPEC int gmp_obstack_printf (struct obstack *, const char *, ...);
+#endif
+
+#define gmp_obstack_vprintf __gmp_obstack_vprintf
+#if defined (_GMP_H_HAVE_OBSTACK) && defined (_GMP_H_HAVE_VA_LIST)
+__GMP_DECLSPEC int gmp_obstack_vprintf (struct obstack *, const char *, va_list);
+#endif
+
+#define gmp_printf __gmp_printf
+__GMP_DECLSPEC int gmp_printf (const char *, ...);
+
+#define gmp_snprintf __gmp_snprintf
+__GMP_DECLSPEC int gmp_snprintf (char *, size_t, const char *, ...);
+
+#define gmp_sprintf __gmp_sprintf
+__GMP_DECLSPEC int gmp_sprintf (char *, const char *, ...);
+
+#define gmp_vasprintf __gmp_vasprintf
+#if defined (_GMP_H_HAVE_VA_LIST)
+__GMP_DECLSPEC int gmp_vasprintf (char **, const char *, va_list);
+#endif
+
+#define gmp_vfprintf __gmp_vfprintf
+#if defined (_GMP_H_HAVE_FILE) && defined (_GMP_H_HAVE_VA_LIST)
+__GMP_DECLSPEC int gmp_vfprintf (FILE *, const char *, va_list);
+#endif
+
+#define gmp_vprintf __gmp_vprintf
+#if defined (_GMP_H_HAVE_VA_LIST)
+__GMP_DECLSPEC int gmp_vprintf (const char *, va_list);
+#endif
+
+#define gmp_vsnprintf __gmp_vsnprintf
+#if defined (_GMP_H_HAVE_VA_LIST)
+__GMP_DECLSPEC int gmp_vsnprintf (char *, size_t, const char *, va_list);
+#endif
+
+#define gmp_vsprintf __gmp_vsprintf
+#if defined (_GMP_H_HAVE_VA_LIST)
+__GMP_DECLSPEC int gmp_vsprintf (char *, const char *, va_list);
+#endif
+
+
+/**************** Formatted input routines. ****************/
+
+#define gmp_fscanf __gmp_fscanf
+#ifdef _GMP_H_HAVE_FILE
+__GMP_DECLSPEC int gmp_fscanf (FILE *, const char *, ...);
+#endif
+
+#define gmp_scanf __gmp_scanf
+__GMP_DECLSPEC int gmp_scanf (const char *, ...);
+
+#define gmp_sscanf __gmp_sscanf
+__GMP_DECLSPEC int gmp_sscanf (const char *, const char *, ...);
+
+#define gmp_vfscanf __gmp_vfscanf
+#if defined (_GMP_H_HAVE_FILE) && defined (_GMP_H_HAVE_VA_LIST)
+__GMP_DECLSPEC int gmp_vfscanf (FILE *, const char *, va_list);
+#endif
+
+#define gmp_vscanf __gmp_vscanf
+#if defined (_GMP_H_HAVE_VA_LIST)
+__GMP_DECLSPEC int gmp_vscanf (const char *, va_list);
+#endif
+
+#define gmp_vsscanf __gmp_vsscanf
+#if defined (_GMP_H_HAVE_VA_LIST)
+__GMP_DECLSPEC int gmp_vsscanf (const char *, const char *, va_list);
+#endif
+
+
+/**************** Integer (i.e. Z) routines. ****************/
+
+#define _mpz_realloc __gmpz_realloc
+#define mpz_realloc __gmpz_realloc
+__GMP_DECLSPEC void *_mpz_realloc (mpz_ptr, mp_size_t);
+
+#define mpz_abs __gmpz_abs
+#if __GMP_INLINE_PROTOTYPES || defined (__GMP_FORCE_mpz_abs)
+__GMP_DECLSPEC void mpz_abs (mpz_ptr, mpz_srcptr);
+#endif
+
+#define mpz_add __gmpz_add
+__GMP_DECLSPEC void mpz_add (mpz_ptr, mpz_srcptr, mpz_srcptr);
+
+#define mpz_add_ui __gmpz_add_ui
+__GMP_DECLSPEC void mpz_add_ui (mpz_ptr, mpz_srcptr, unsigned long int);
+
+#define mpz_addmul __gmpz_addmul
+__GMP_DECLSPEC void mpz_addmul (mpz_ptr, mpz_srcptr, mpz_srcptr);
+
+#define mpz_addmul_ui __gmpz_addmul_ui
+__GMP_DECLSPEC void mpz_addmul_ui (mpz_ptr, mpz_srcptr, unsigned long int);
+
+#define mpz_and __gmpz_and
+__GMP_DECLSPEC void mpz_and (mpz_ptr, mpz_srcptr, mpz_srcptr);
+
+#define mpz_array_init __gmpz_array_init
+__GMP_DECLSPEC void mpz_array_init (mpz_ptr, mp_size_t, mp_size_t);
+
+#define mpz_bin_ui __gmpz_bin_ui
+__GMP_DECLSPEC void mpz_bin_ui (mpz_ptr, mpz_srcptr, unsigned long int);
+
+#define mpz_bin_uiui __gmpz_bin_uiui
+__GMP_DECLSPEC void mpz_bin_uiui (mpz_ptr, unsigned long int, unsigned long int);
+
+#define mpz_cdiv_q __gmpz_cdiv_q
+__GMP_DECLSPEC void mpz_cdiv_q (mpz_ptr, mpz_srcptr, mpz_srcptr);
+
+#define mpz_cdiv_q_2exp __gmpz_cdiv_q_2exp
+__GMP_DECLSPEC void mpz_cdiv_q_2exp (mpz_ptr, mpz_srcptr, mp_bitcnt_t);
+
+#define mpz_cdiv_q_ui __gmpz_cdiv_q_ui
+__GMP_DECLSPEC unsigned long int mpz_cdiv_q_ui (mpz_ptr, mpz_srcptr, unsigned long int);
+
+#define mpz_cdiv_qr __gmpz_cdiv_qr
+__GMP_DECLSPEC void mpz_cdiv_qr (mpz_ptr, mpz_ptr, mpz_srcptr, mpz_srcptr);
+
+#define mpz_cdiv_qr_ui __gmpz_cdiv_qr_ui
+__GMP_DECLSPEC unsigned long int mpz_cdiv_qr_ui (mpz_ptr, mpz_ptr, mpz_srcptr, unsigned long int);
+
+#define mpz_cdiv_r __gmpz_cdiv_r
+__GMP_DECLSPEC void mpz_cdiv_r (mpz_ptr, mpz_srcptr, mpz_srcptr);
+
+#define mpz_cdiv_r_2exp __gmpz_cdiv_r_2exp
+__GMP_DECLSPEC void mpz_cdiv_r_2exp (mpz_ptr, mpz_srcptr, mp_bitcnt_t);
+
+#define mpz_cdiv_r_ui __gmpz_cdiv_r_ui
+__GMP_DECLSPEC unsigned long int mpz_cdiv_r_ui (mpz_ptr, mpz_srcptr, unsigned long int);
+
+#define mpz_cdiv_ui __gmpz_cdiv_ui
+__GMP_DECLSPEC unsigned long int mpz_cdiv_ui (mpz_srcptr, unsigned long int) __GMP_ATTRIBUTE_PURE;
+
+#define mpz_clear __gmpz_clear
+__GMP_DECLSPEC void mpz_clear (mpz_ptr);
+
+#define mpz_clears __gmpz_clears
+__GMP_DECLSPEC void mpz_clears (mpz_ptr, ...);
+
+#define mpz_clrbit __gmpz_clrbit
+__GMP_DECLSPEC void mpz_clrbit (mpz_ptr, mp_bitcnt_t);
+
+#define mpz_cmp __gmpz_cmp
+__GMP_DECLSPEC int mpz_cmp (mpz_srcptr, mpz_srcptr) __GMP_NOTHROW __GMP_ATTRIBUTE_PURE;
+
+#define mpz_cmp_d __gmpz_cmp_d
+__GMP_DECLSPEC int mpz_cmp_d (mpz_srcptr, double) __GMP_ATTRIBUTE_PURE;
+
+#define _mpz_cmp_si __gmpz_cmp_si
+__GMP_DECLSPEC int _mpz_cmp_si (mpz_srcptr, signed long int) __GMP_NOTHROW __GMP_ATTRIBUTE_PURE;
+
+#define _mpz_cmp_ui __gmpz_cmp_ui
+__GMP_DECLSPEC int _mpz_cmp_ui (mpz_srcptr, unsigned long int) __GMP_NOTHROW __GMP_ATTRIBUTE_PURE;
+
+#define mpz_cmpabs __gmpz_cmpabs
+__GMP_DECLSPEC int mpz_cmpabs (mpz_srcptr, mpz_srcptr) __GMP_NOTHROW __GMP_ATTRIBUTE_PURE;
+
+#define mpz_cmpabs_d __gmpz_cmpabs_d
+__GMP_DECLSPEC int mpz_cmpabs_d (mpz_srcptr, double) __GMP_ATTRIBUTE_PURE;
+
+#define mpz_cmpabs_ui __gmpz_cmpabs_ui
+__GMP_DECLSPEC int mpz_cmpabs_ui (mpz_srcptr, unsigned long int) __GMP_NOTHROW __GMP_ATTRIBUTE_PURE;
+
+#define mpz_com __gmpz_com
+__GMP_DECLSPEC void mpz_com (mpz_ptr, mpz_srcptr);
+
+#define mpz_combit __gmpz_combit
+__GMP_DECLSPEC void mpz_combit (mpz_ptr, mp_bitcnt_t);
+
+#define mpz_congruent_p __gmpz_congruent_p
+__GMP_DECLSPEC int mpz_congruent_p (mpz_srcptr, mpz_srcptr, mpz_srcptr) __GMP_ATTRIBUTE_PURE;
+
+#define mpz_congruent_2exp_p __gmpz_congruent_2exp_p
+__GMP_DECLSPEC int mpz_congruent_2exp_p (mpz_srcptr, mpz_srcptr, mp_bitcnt_t) __GMP_NOTHROW __GMP_ATTRIBUTE_PURE;
+
+#define mpz_congruent_ui_p __gmpz_congruent_ui_p
+__GMP_DECLSPEC int mpz_congruent_ui_p (mpz_srcptr, unsigned long, unsigned long) __GMP_ATTRIBUTE_PURE;
+
+#define mpz_divexact __gmpz_divexact
+__GMP_DECLSPEC void mpz_divexact (mpz_ptr, mpz_srcptr, mpz_srcptr);
+
+#define mpz_divexact_ui __gmpz_divexact_ui
+__GMP_DECLSPEC void mpz_divexact_ui (mpz_ptr, mpz_srcptr, unsigned long);
+
+#define mpz_divisible_p __gmpz_divisible_p
+__GMP_DECLSPEC int mpz_divisible_p (mpz_srcptr, mpz_srcptr) __GMP_ATTRIBUTE_PURE;
+
+#define mpz_divisible_ui_p __gmpz_divisible_ui_p
+__GMP_DECLSPEC int mpz_divisible_ui_p (mpz_srcptr, unsigned long) __GMP_ATTRIBUTE_PURE;
+
+#define mpz_divisible_2exp_p __gmpz_divisible_2exp_p
+__GMP_DECLSPEC int mpz_divisible_2exp_p (mpz_srcptr, mp_bitcnt_t) __GMP_NOTHROW __GMP_ATTRIBUTE_PURE;
+
+#define mpz_dump __gmpz_dump
+__GMP_DECLSPEC void mpz_dump (mpz_srcptr);
+
+#define mpz_export __gmpz_export
+__GMP_DECLSPEC void *mpz_export (void *, size_t *, int, size_t, int, size_t, mpz_srcptr);
+
+#define mpz_fac_ui __gmpz_fac_ui
+__GMP_DECLSPEC void mpz_fac_ui (mpz_ptr, unsigned long int);
+
+#define mpz_2fac_ui __gmpz_2fac_ui
+__GMP_DECLSPEC void mpz_2fac_ui (mpz_ptr, unsigned long int);
+
+#define mpz_mfac_uiui __gmpz_mfac_uiui
+__GMP_DECLSPEC void mpz_mfac_uiui (mpz_ptr, unsigned long int, unsigned long int);
+
+#define mpz_primorial_ui __gmpz_primorial_ui
+__GMP_DECLSPEC void mpz_primorial_ui (mpz_ptr, unsigned long int);
+
+#define mpz_fdiv_q __gmpz_fdiv_q
+__GMP_DECLSPEC void mpz_fdiv_q (mpz_ptr, mpz_srcptr, mpz_srcptr);
+
+#define mpz_fdiv_q_2exp __gmpz_fdiv_q_2exp
+__GMP_DECLSPEC void mpz_fdiv_q_2exp (mpz_ptr, mpz_srcptr, mp_bitcnt_t);
+
+#define mpz_fdiv_q_ui __gmpz_fdiv_q_ui
+__GMP_DECLSPEC unsigned long int mpz_fdiv_q_ui (mpz_ptr, mpz_srcptr, unsigned long int);
+
+#define mpz_fdiv_qr __gmpz_fdiv_qr
+__GMP_DECLSPEC void mpz_fdiv_qr (mpz_ptr, mpz_ptr, mpz_srcptr, mpz_srcptr);
+
+#define mpz_fdiv_qr_ui __gmpz_fdiv_qr_ui
+__GMP_DECLSPEC unsigned long int mpz_fdiv_qr_ui (mpz_ptr, mpz_ptr, mpz_srcptr, unsigned long int);
+
+#define mpz_fdiv_r __gmpz_fdiv_r
+__GMP_DECLSPEC void mpz_fdiv_r (mpz_ptr, mpz_srcptr, mpz_srcptr);
+
+#define mpz_fdiv_r_2exp __gmpz_fdiv_r_2exp
+__GMP_DECLSPEC void mpz_fdiv_r_2exp (mpz_ptr, mpz_srcptr, mp_bitcnt_t);
+
+#define mpz_fdiv_r_ui __gmpz_fdiv_r_ui
+__GMP_DECLSPEC unsigned long int mpz_fdiv_r_ui (mpz_ptr, mpz_srcptr, unsigned long int);
+
+#define mpz_fdiv_ui __gmpz_fdiv_ui
+__GMP_DECLSPEC unsigned long int mpz_fdiv_ui (mpz_srcptr, unsigned long int) __GMP_ATTRIBUTE_PURE;
+
+#define mpz_fib_ui __gmpz_fib_ui
+__GMP_DECLSPEC void mpz_fib_ui (mpz_ptr, unsigned long int);
+
+#define mpz_fib2_ui __gmpz_fib2_ui
+__GMP_DECLSPEC void mpz_fib2_ui (mpz_ptr, mpz_ptr, unsigned long int);
+
+#define mpz_fits_sint_p __gmpz_fits_sint_p
+__GMP_DECLSPEC int mpz_fits_sint_p (mpz_srcptr) __GMP_NOTHROW __GMP_ATTRIBUTE_PURE;
+
+#define mpz_fits_slong_p __gmpz_fits_slong_p
+__GMP_DECLSPEC int mpz_fits_slong_p (mpz_srcptr) __GMP_NOTHROW __GMP_ATTRIBUTE_PURE;
+
+#define mpz_fits_sshort_p __gmpz_fits_sshort_p
+__GMP_DECLSPEC int mpz_fits_sshort_p (mpz_srcptr) __GMP_NOTHROW __GMP_ATTRIBUTE_PURE;
+
+#define mpz_fits_uint_p __gmpz_fits_uint_p
+#if __GMP_INLINE_PROTOTYPES || defined (__GMP_FORCE_mpz_fits_uint_p)
+__GMP_DECLSPEC int mpz_fits_uint_p (mpz_srcptr) __GMP_NOTHROW __GMP_ATTRIBUTE_PURE;
+#endif
+
+#define mpz_fits_ulong_p __gmpz_fits_ulong_p
+#if __GMP_INLINE_PROTOTYPES || defined (__GMP_FORCE_mpz_fits_ulong_p)
+__GMP_DECLSPEC int mpz_fits_ulong_p (mpz_srcptr) __GMP_NOTHROW __GMP_ATTRIBUTE_PURE;
+#endif
+
+#define mpz_fits_ushort_p __gmpz_fits_ushort_p
+#if __GMP_INLINE_PROTOTYPES || defined (__GMP_FORCE_mpz_fits_ushort_p)
+__GMP_DECLSPEC int mpz_fits_ushort_p (mpz_srcptr) __GMP_NOTHROW __GMP_ATTRIBUTE_PURE;
+#endif
+
+#define mpz_gcd __gmpz_gcd
+__GMP_DECLSPEC void mpz_gcd (mpz_ptr, mpz_srcptr, mpz_srcptr);
+
+#define mpz_gcd_ui __gmpz_gcd_ui
+__GMP_DECLSPEC unsigned long int mpz_gcd_ui (mpz_ptr, mpz_srcptr, unsigned long int);
+
+#define mpz_gcdext __gmpz_gcdext
+__GMP_DECLSPEC void mpz_gcdext (mpz_ptr, mpz_ptr, mpz_ptr, mpz_srcptr, mpz_srcptr);
+
+#define mpz_get_d __gmpz_get_d
+__GMP_DECLSPEC double mpz_get_d (mpz_srcptr) __GMP_ATTRIBUTE_PURE;
+
+#define mpz_get_d_2exp __gmpz_get_d_2exp
+__GMP_DECLSPEC double mpz_get_d_2exp (signed long int *, mpz_srcptr);
+
+#define mpz_get_si __gmpz_get_si
+__GMP_DECLSPEC /* signed */ long int mpz_get_si (mpz_srcptr) __GMP_NOTHROW __GMP_ATTRIBUTE_PURE;
+
+#define mpz_get_str __gmpz_get_str
+__GMP_DECLSPEC char *mpz_get_str (char *, int, mpz_srcptr);
+
+#define mpz_get_ui __gmpz_get_ui
+#if __GMP_INLINE_PROTOTYPES || defined (__GMP_FORCE_mpz_get_ui)
+__GMP_DECLSPEC unsigned long int mpz_get_ui (mpz_srcptr) __GMP_NOTHROW __GMP_ATTRIBUTE_PURE;
+#endif
+
+#define mpz_getlimbn __gmpz_getlimbn
+#if __GMP_INLINE_PROTOTYPES || defined (__GMP_FORCE_mpz_getlimbn)
+__GMP_DECLSPEC mp_limb_t mpz_getlimbn (mpz_srcptr, mp_size_t) __GMP_NOTHROW __GMP_ATTRIBUTE_PURE;
+#endif
+
+#define mpz_hamdist __gmpz_hamdist
+__GMP_DECLSPEC mp_bitcnt_t mpz_hamdist (mpz_srcptr, mpz_srcptr) __GMP_NOTHROW __GMP_ATTRIBUTE_PURE;
+
+#define mpz_import __gmpz_import
+__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);
+
+#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, ...);
+
+#define mpz_init_set __gmpz_init_set
+__GMP_DECLSPEC void mpz_init_set (mpz_ptr, mpz_srcptr);
+
+#define mpz_init_set_d __gmpz_init_set_d
+__GMP_DECLSPEC void mpz_init_set_d (mpz_ptr, double);
+
+#define mpz_init_set_si __gmpz_init_set_si
+__GMP_DECLSPEC void mpz_init_set_si (mpz_ptr, signed long int);
+
+#define mpz_init_set_str __gmpz_init_set_str
+__GMP_DECLSPEC int mpz_init_set_str (mpz_ptr, const char *, int);
+
+#define mpz_init_set_ui __gmpz_init_set_ui
+__GMP_DECLSPEC void mpz_init_set_ui (mpz_ptr, unsigned long int);
+
+#define mpz_inp_raw __gmpz_inp_raw
+#ifdef _GMP_H_HAVE_FILE
+__GMP_DECLSPEC size_t mpz_inp_raw (mpz_ptr, FILE *);
+#endif
+
+#define mpz_inp_str __gmpz_inp_str
+#ifdef _GMP_H_HAVE_FILE
+__GMP_DECLSPEC size_t mpz_inp_str (mpz_ptr, FILE *, int);
+#endif
+
+#define mpz_invert __gmpz_invert
+__GMP_DECLSPEC int mpz_invert (mpz_ptr, mpz_srcptr, mpz_srcptr);
+
+#define mpz_ior __gmpz_ior
+__GMP_DECLSPEC void mpz_ior (mpz_ptr, mpz_srcptr, mpz_srcptr);
+
+#define mpz_jacobi __gmpz_jacobi
+__GMP_DECLSPEC int mpz_jacobi (mpz_srcptr, mpz_srcptr) __GMP_ATTRIBUTE_PURE;
+
+#define mpz_kronecker mpz_jacobi /* alias */
+
+#define mpz_kronecker_si __gmpz_kronecker_si
+__GMP_DECLSPEC int mpz_kronecker_si (mpz_srcptr, long) __GMP_ATTRIBUTE_PURE;
+
+#define mpz_kronecker_ui __gmpz_kronecker_ui
+__GMP_DECLSPEC int mpz_kronecker_ui (mpz_srcptr, unsigned long) __GMP_ATTRIBUTE_PURE;
+
+#define mpz_si_kronecker __gmpz_si_kronecker
+__GMP_DECLSPEC int mpz_si_kronecker (long, mpz_srcptr) __GMP_ATTRIBUTE_PURE;
+
+#define mpz_ui_kronecker __gmpz_ui_kronecker
+__GMP_DECLSPEC int mpz_ui_kronecker (unsigned long, mpz_srcptr) __GMP_ATTRIBUTE_PURE;
+
+#define mpz_lcm __gmpz_lcm
+__GMP_DECLSPEC void mpz_lcm (mpz_ptr, mpz_srcptr, mpz_srcptr);
+
+#define mpz_lcm_ui __gmpz_lcm_ui
+__GMP_DECLSPEC void mpz_lcm_ui (mpz_ptr, mpz_srcptr, unsigned long);
+
+#define mpz_legendre mpz_jacobi /* alias */
+
+#define mpz_lucnum_ui __gmpz_lucnum_ui
+__GMP_DECLSPEC void mpz_lucnum_ui (mpz_ptr, unsigned long int);
+
+#define mpz_lucnum2_ui __gmpz_lucnum2_ui
+__GMP_DECLSPEC void mpz_lucnum2_ui (mpz_ptr, mpz_ptr, unsigned long int);
+
+#define mpz_millerrabin __gmpz_millerrabin
+__GMP_DECLSPEC int mpz_millerrabin (mpz_srcptr, int) __GMP_ATTRIBUTE_PURE;
+
+#define mpz_mod __gmpz_mod
+__GMP_DECLSPEC void mpz_mod (mpz_ptr, mpz_srcptr, mpz_srcptr);
+
+#define mpz_mod_ui mpz_fdiv_r_ui /* same as fdiv_r because divisor unsigned */
+
+#define mpz_mul __gmpz_mul
+__GMP_DECLSPEC void mpz_mul (mpz_ptr, mpz_srcptr, mpz_srcptr);
+
+#define mpz_mul_2exp __gmpz_mul_2exp
+__GMP_DECLSPEC void mpz_mul_2exp (mpz_ptr, mpz_srcptr, mp_bitcnt_t);
+
+#define mpz_mul_si __gmpz_mul_si
+__GMP_DECLSPEC void mpz_mul_si (mpz_ptr, mpz_srcptr, long int);
+
+#define mpz_mul_ui __gmpz_mul_ui
+__GMP_DECLSPEC void mpz_mul_ui (mpz_ptr, mpz_srcptr, unsigned long int);
+
+#define mpz_neg __gmpz_neg
+#if __GMP_INLINE_PROTOTYPES || defined (__GMP_FORCE_mpz_neg)
+__GMP_DECLSPEC void mpz_neg (mpz_ptr, mpz_srcptr);
+#endif
+
+#define mpz_nextprime __gmpz_nextprime
+__GMP_DECLSPEC void mpz_nextprime (mpz_ptr, mpz_srcptr);
+
+#define mpz_out_raw __gmpz_out_raw
+#ifdef _GMP_H_HAVE_FILE
+__GMP_DECLSPEC size_t mpz_out_raw (FILE *, mpz_srcptr);
+#endif
+
+#define mpz_out_str __gmpz_out_str
+#ifdef _GMP_H_HAVE_FILE
+__GMP_DECLSPEC size_t mpz_out_str (FILE *, int, mpz_srcptr);
+#endif
+
+#define mpz_perfect_power_p __gmpz_perfect_power_p
+__GMP_DECLSPEC int mpz_perfect_power_p (mpz_srcptr) __GMP_ATTRIBUTE_PURE;
+
+#define mpz_perfect_square_p __gmpz_perfect_square_p
+#if __GMP_INLINE_PROTOTYPES || defined (__GMP_FORCE_mpz_perfect_square_p)
+__GMP_DECLSPEC int mpz_perfect_square_p (mpz_srcptr) __GMP_ATTRIBUTE_PURE;
+#endif
+
+#define mpz_popcount __gmpz_popcount
+#if __GMP_INLINE_PROTOTYPES || defined (__GMP_FORCE_mpz_popcount)
+__GMP_DECLSPEC mp_bitcnt_t mpz_popcount (mpz_srcptr) __GMP_NOTHROW __GMP_ATTRIBUTE_PURE;
+#endif
+
+#define mpz_pow_ui __gmpz_pow_ui
+__GMP_DECLSPEC void mpz_pow_ui (mpz_ptr, mpz_srcptr, unsigned long int);
+
+#define mpz_powm __gmpz_powm
+__GMP_DECLSPEC void mpz_powm (mpz_ptr, mpz_srcptr, mpz_srcptr, mpz_srcptr);
+
+#define mpz_powm_sec __gmpz_powm_sec
+__GMP_DECLSPEC void mpz_powm_sec (mpz_ptr, mpz_srcptr, mpz_srcptr, mpz_srcptr);
+
+#define mpz_powm_ui __gmpz_powm_ui
+__GMP_DECLSPEC void mpz_powm_ui (mpz_ptr, mpz_srcptr, unsigned long int, mpz_srcptr);
+
+#define mpz_probab_prime_p __gmpz_probab_prime_p
+__GMP_DECLSPEC int mpz_probab_prime_p (mpz_srcptr, int) __GMP_ATTRIBUTE_PURE;
+
+#define mpz_random __gmpz_random
+__GMP_DECLSPEC void mpz_random (mpz_ptr, mp_size_t);
+
+#define mpz_random2 __gmpz_random2
+__GMP_DECLSPEC void mpz_random2 (mpz_ptr, mp_size_t);
+
+#define mpz_realloc2 __gmpz_realloc2
+__GMP_DECLSPEC void mpz_realloc2 (mpz_ptr, mp_bitcnt_t);
+
+#define mpz_remove __gmpz_remove
+__GMP_DECLSPEC mp_bitcnt_t mpz_remove (mpz_ptr, mpz_srcptr, mpz_srcptr);
+
+#define mpz_root __gmpz_root
+__GMP_DECLSPEC int mpz_root (mpz_ptr, mpz_srcptr, unsigned long int);
+
+#define mpz_rootrem __gmpz_rootrem
+__GMP_DECLSPEC void mpz_rootrem (mpz_ptr, mpz_ptr, mpz_srcptr, unsigned long int);
+
+#define mpz_rrandomb __gmpz_rrandomb
+__GMP_DECLSPEC void mpz_rrandomb (mpz_ptr, gmp_randstate_t, mp_bitcnt_t);
+
+#define mpz_scan0 __gmpz_scan0
+__GMP_DECLSPEC mp_bitcnt_t mpz_scan0 (mpz_srcptr, mp_bitcnt_t) __GMP_NOTHROW __GMP_ATTRIBUTE_PURE;
+
+#define mpz_scan1 __gmpz_scan1
+__GMP_DECLSPEC mp_bitcnt_t mpz_scan1 (mpz_srcptr, mp_bitcnt_t) __GMP_NOTHROW __GMP_ATTRIBUTE_PURE;
+
+#define mpz_set __gmpz_set
+__GMP_DECLSPEC void mpz_set (mpz_ptr, mpz_srcptr);
+
+#define mpz_set_d __gmpz_set_d
+__GMP_DECLSPEC void mpz_set_d (mpz_ptr, double);
+
+#define mpz_set_f __gmpz_set_f
+__GMP_DECLSPEC void mpz_set_f (mpz_ptr, mpf_srcptr);
+
+#define mpz_set_q __gmpz_set_q
+#if __GMP_INLINE_PROTOTYPES || defined (__GMP_FORCE_mpz_set_q)
+__GMP_DECLSPEC void mpz_set_q (mpz_ptr, mpq_srcptr);
+#endif
+
+#define mpz_set_si __gmpz_set_si
+__GMP_DECLSPEC void mpz_set_si (mpz_ptr, signed long int);
+
+#define mpz_set_str __gmpz_set_str
+__GMP_DECLSPEC int mpz_set_str (mpz_ptr, const char *, int);
+
+#define mpz_set_ui __gmpz_set_ui
+__GMP_DECLSPEC void mpz_set_ui (mpz_ptr, unsigned long int);
+
+#define mpz_setbit __gmpz_setbit
+__GMP_DECLSPEC void mpz_setbit (mpz_ptr, mp_bitcnt_t);
+
+#define mpz_size __gmpz_size
+#if __GMP_INLINE_PROTOTYPES || defined (__GMP_FORCE_mpz_size)
+__GMP_DECLSPEC size_t mpz_size (mpz_srcptr) __GMP_NOTHROW __GMP_ATTRIBUTE_PURE;
+#endif
+
+#define mpz_sizeinbase __gmpz_sizeinbase
+__GMP_DECLSPEC size_t mpz_sizeinbase (mpz_srcptr, int) __GMP_NOTHROW __GMP_ATTRIBUTE_PURE;
+
+#define mpz_sqrt __gmpz_sqrt
+__GMP_DECLSPEC void mpz_sqrt (mpz_ptr, mpz_srcptr);
+
+#define mpz_sqrtrem __gmpz_sqrtrem
+__GMP_DECLSPEC void mpz_sqrtrem (mpz_ptr, mpz_ptr, mpz_srcptr);
+
+#define mpz_sub __gmpz_sub
+__GMP_DECLSPEC void mpz_sub (mpz_ptr, mpz_srcptr, mpz_srcptr);
+
+#define mpz_sub_ui __gmpz_sub_ui
+__GMP_DECLSPEC void mpz_sub_ui (mpz_ptr, mpz_srcptr, unsigned long int);
+
+#define mpz_ui_sub __gmpz_ui_sub
+__GMP_DECLSPEC void mpz_ui_sub (mpz_ptr, unsigned long int, mpz_srcptr);
+
+#define mpz_submul __gmpz_submul
+__GMP_DECLSPEC void mpz_submul (mpz_ptr, mpz_srcptr, mpz_srcptr);
+
+#define mpz_submul_ui __gmpz_submul_ui
+__GMP_DECLSPEC void mpz_submul_ui (mpz_ptr, mpz_srcptr, unsigned long int);
+
+#define mpz_swap __gmpz_swap
+__GMP_DECLSPEC void mpz_swap (mpz_ptr, mpz_ptr) __GMP_NOTHROW;
+
+#define mpz_tdiv_ui __gmpz_tdiv_ui
+__GMP_DECLSPEC unsigned long int mpz_tdiv_ui (mpz_srcptr, unsigned long int) __GMP_ATTRIBUTE_PURE;
+
+#define mpz_tdiv_q __gmpz_tdiv_q
+__GMP_DECLSPEC void mpz_tdiv_q (mpz_ptr, mpz_srcptr, mpz_srcptr);
+
+#define mpz_tdiv_q_2exp __gmpz_tdiv_q_2exp
+__GMP_DECLSPEC void mpz_tdiv_q_2exp (mpz_ptr, mpz_srcptr, mp_bitcnt_t);
+
+#define mpz_tdiv_q_ui __gmpz_tdiv_q_ui
+__GMP_DECLSPEC unsigned long int mpz_tdiv_q_ui (mpz_ptr, mpz_srcptr, unsigned long int);
+
+#define mpz_tdiv_qr __gmpz_tdiv_qr
+__GMP_DECLSPEC void mpz_tdiv_qr (mpz_ptr, mpz_ptr, mpz_srcptr, mpz_srcptr);
+
+#define mpz_tdiv_qr_ui __gmpz_tdiv_qr_ui
+__GMP_DECLSPEC unsigned long int mpz_tdiv_qr_ui (mpz_ptr, mpz_ptr, mpz_srcptr, unsigned long int);
+
+#define mpz_tdiv_r __gmpz_tdiv_r
+__GMP_DECLSPEC void mpz_tdiv_r (mpz_ptr, mpz_srcptr, mpz_srcptr);
+
+#define mpz_tdiv_r_2exp __gmpz_tdiv_r_2exp
+__GMP_DECLSPEC void mpz_tdiv_r_2exp (mpz_ptr, mpz_srcptr, mp_bitcnt_t);
+
+#define mpz_tdiv_r_ui __gmpz_tdiv_r_ui
+__GMP_DECLSPEC unsigned long int mpz_tdiv_r_ui (mpz_ptr, mpz_srcptr, unsigned long int);
+
+#define mpz_tstbit __gmpz_tstbit
+__GMP_DECLSPEC int mpz_tstbit (mpz_srcptr, mp_bitcnt_t) __GMP_NOTHROW __GMP_ATTRIBUTE_PURE;
+
+#define mpz_ui_pow_ui __gmpz_ui_pow_ui
+__GMP_DECLSPEC void mpz_ui_pow_ui (mpz_ptr, unsigned long int, unsigned long int);
+
+#define mpz_urandomb __gmpz_urandomb
+__GMP_DECLSPEC void mpz_urandomb (mpz_ptr, gmp_randstate_t, mp_bitcnt_t);
+
+#define mpz_urandomm __gmpz_urandomm
+__GMP_DECLSPEC void mpz_urandomm (mpz_ptr, gmp_randstate_t, mpz_srcptr);
+
+#define mpz_xor __gmpz_xor
+#define mpz_eor __gmpz_xor
+__GMP_DECLSPEC void mpz_xor (mpz_ptr, mpz_srcptr, mpz_srcptr);
+
+#define mpz_limbs_read __gmpz_limbs_read
+__GMP_DECLSPEC mp_srcptr mpz_limbs_read (mpz_srcptr);
+
+#define mpz_limbs_write __gmpz_limbs_write
+__GMP_DECLSPEC mp_ptr mpz_limbs_write (mpz_ptr, mp_size_t);
+
+#define mpz_limbs_modify __gmpz_limbs_modify
+__GMP_DECLSPEC mp_ptr mpz_limbs_modify (mpz_ptr, mp_size_t);
+
+#define mpz_limbs_finish __gmpz_limbs_finish
+__GMP_DECLSPEC void mpz_limbs_finish (mpz_ptr, mp_size_t);
+
+#define mpz_roinit_n __gmpz_roinit_n
+__GMP_DECLSPEC mpz_srcptr mpz_roinit_n (mpz_ptr, mp_srcptr, mp_size_t);
+
+#define MPZ_ROINIT_N(xp, xs) {{0, (xs),(xp) }}
+
+/**************** Rational (i.e. Q) routines. ****************/
+
+#define mpq_abs __gmpq_abs
+#if __GMP_INLINE_PROTOTYPES || defined (__GMP_FORCE_mpq_abs)
+__GMP_DECLSPEC void mpq_abs (mpq_ptr, mpq_srcptr);
+#endif
+
+#define mpq_add __gmpq_add
+__GMP_DECLSPEC void mpq_add (mpq_ptr, mpq_srcptr, mpq_srcptr);
+
+#define mpq_canonicalize __gmpq_canonicalize
+__GMP_DECLSPEC void mpq_canonicalize (mpq_ptr);
+
+#define mpq_clear __gmpq_clear
+__GMP_DECLSPEC void mpq_clear (mpq_ptr);
+
+#define mpq_clears __gmpq_clears
+__GMP_DECLSPEC void mpq_clears (mpq_ptr, ...);
+
+#define mpq_cmp __gmpq_cmp
+__GMP_DECLSPEC int mpq_cmp (mpq_srcptr, mpq_srcptr) __GMP_ATTRIBUTE_PURE;
+
+#define _mpq_cmp_si __gmpq_cmp_si
+__GMP_DECLSPEC int _mpq_cmp_si (mpq_srcptr, long, unsigned long) __GMP_ATTRIBUTE_PURE;
+
+#define _mpq_cmp_ui __gmpq_cmp_ui
+__GMP_DECLSPEC int _mpq_cmp_ui (mpq_srcptr, unsigned long int, unsigned long int) __GMP_ATTRIBUTE_PURE;
+
+#define mpq_div __gmpq_div
+__GMP_DECLSPEC void mpq_div (mpq_ptr, mpq_srcptr, mpq_srcptr);
+
+#define mpq_div_2exp __gmpq_div_2exp
+__GMP_DECLSPEC void mpq_div_2exp (mpq_ptr, mpq_srcptr, mp_bitcnt_t);
+
+#define mpq_equal __gmpq_equal
+__GMP_DECLSPEC int mpq_equal (mpq_srcptr, mpq_srcptr) __GMP_NOTHROW __GMP_ATTRIBUTE_PURE;
+
+#define mpq_get_num __gmpq_get_num
+__GMP_DECLSPEC void mpq_get_num (mpz_ptr, mpq_srcptr);
+
+#define mpq_get_den __gmpq_get_den
+__GMP_DECLSPEC void mpq_get_den (mpz_ptr, mpq_srcptr);
+
+#define mpq_get_d __gmpq_get_d
+__GMP_DECLSPEC double mpq_get_d (mpq_srcptr) __GMP_ATTRIBUTE_PURE;
+
+#define mpq_get_str __gmpq_get_str
+__GMP_DECLSPEC char *mpq_get_str (char *, int, mpq_srcptr);
+
+#define mpq_init __gmpq_init
+__GMP_DECLSPEC void mpq_init (mpq_ptr);
+
+#define mpq_inits __gmpq_inits
+__GMP_DECLSPEC void mpq_inits (mpq_ptr, ...);
+
+#define mpq_inp_str __gmpq_inp_str
+#ifdef _GMP_H_HAVE_FILE
+__GMP_DECLSPEC size_t mpq_inp_str (mpq_ptr, FILE *, int);
+#endif
+
+#define mpq_inv __gmpq_inv
+__GMP_DECLSPEC void mpq_inv (mpq_ptr, mpq_srcptr);
+
+#define mpq_mul __gmpq_mul
+__GMP_DECLSPEC void mpq_mul (mpq_ptr, mpq_srcptr, mpq_srcptr);
+
+#define mpq_mul_2exp __gmpq_mul_2exp
+__GMP_DECLSPEC void mpq_mul_2exp (mpq_ptr, mpq_srcptr, mp_bitcnt_t);
+
+#define mpq_neg __gmpq_neg
+#if __GMP_INLINE_PROTOTYPES || defined (__GMP_FORCE_mpq_neg)
+__GMP_DECLSPEC void mpq_neg (mpq_ptr, mpq_srcptr);
+#endif
+
+#define mpq_out_str __gmpq_out_str
+#ifdef _GMP_H_HAVE_FILE
+__GMP_DECLSPEC size_t mpq_out_str (FILE *, int, mpq_srcptr);
+#endif
+
+#define mpq_set __gmpq_set
+__GMP_DECLSPEC void mpq_set (mpq_ptr, mpq_srcptr);
+
+#define mpq_set_d __gmpq_set_d
+__GMP_DECLSPEC void mpq_set_d (mpq_ptr, double);
+
+#define mpq_set_den __gmpq_set_den
+__GMP_DECLSPEC void mpq_set_den (mpq_ptr, mpz_srcptr);
+
+#define mpq_set_f __gmpq_set_f
+__GMP_DECLSPEC void mpq_set_f (mpq_ptr, mpf_srcptr);
+
+#define mpq_set_num __gmpq_set_num
+__GMP_DECLSPEC void mpq_set_num (mpq_ptr, mpz_srcptr);
+
+#define mpq_set_si __gmpq_set_si
+__GMP_DECLSPEC void mpq_set_si (mpq_ptr, signed long int, unsigned long int);
+
+#define mpq_set_str __gmpq_set_str
+__GMP_DECLSPEC int mpq_set_str (mpq_ptr, const char *, int);
+
+#define mpq_set_ui __gmpq_set_ui
+__GMP_DECLSPEC void mpq_set_ui (mpq_ptr, unsigned long int, unsigned long int);
+
+#define mpq_set_z __gmpq_set_z
+__GMP_DECLSPEC void mpq_set_z (mpq_ptr, mpz_srcptr);
+
+#define mpq_sub __gmpq_sub
+__GMP_DECLSPEC void mpq_sub (mpq_ptr, mpq_srcptr, mpq_srcptr);
+
+#define mpq_swap __gmpq_swap
+__GMP_DECLSPEC void mpq_swap (mpq_ptr, mpq_ptr) __GMP_NOTHROW;
+
+
+/**************** Float (i.e. F) routines. ****************/
+
+#define mpf_abs __gmpf_abs
+__GMP_DECLSPEC void mpf_abs (mpf_ptr, mpf_srcptr);
+
+#define mpf_add __gmpf_add
+__GMP_DECLSPEC void mpf_add (mpf_ptr, mpf_srcptr, mpf_srcptr);
+
+#define mpf_add_ui __gmpf_add_ui
+__GMP_DECLSPEC void mpf_add_ui (mpf_ptr, mpf_srcptr, unsigned long int);
+#define mpf_ceil __gmpf_ceil
+__GMP_DECLSPEC void mpf_ceil (mpf_ptr, mpf_srcptr);
+
+#define mpf_clear __gmpf_clear
+__GMP_DECLSPEC void mpf_clear (mpf_ptr);
+
+#define mpf_clears __gmpf_clears
+__GMP_DECLSPEC void mpf_clears (mpf_ptr, ...);
+
+#define mpf_cmp __gmpf_cmp
+__GMP_DECLSPEC int mpf_cmp (mpf_srcptr, mpf_srcptr) __GMP_NOTHROW __GMP_ATTRIBUTE_PURE;
+
+#define mpf_cmp_d __gmpf_cmp_d
+__GMP_DECLSPEC int mpf_cmp_d (mpf_srcptr, double) __GMP_ATTRIBUTE_PURE;
+
+#define mpf_cmp_si __gmpf_cmp_si
+__GMP_DECLSPEC int mpf_cmp_si (mpf_srcptr, signed long int) __GMP_NOTHROW __GMP_ATTRIBUTE_PURE;
+
+#define mpf_cmp_ui __gmpf_cmp_ui
+__GMP_DECLSPEC int mpf_cmp_ui (mpf_srcptr, unsigned long int) __GMP_NOTHROW __GMP_ATTRIBUTE_PURE;
+
+#define mpf_div __gmpf_div
+__GMP_DECLSPEC void mpf_div (mpf_ptr, mpf_srcptr, mpf_srcptr);
+
+#define mpf_div_2exp __gmpf_div_2exp
+__GMP_DECLSPEC void mpf_div_2exp (mpf_ptr, mpf_srcptr, mp_bitcnt_t);
+
+#define mpf_div_ui __gmpf_div_ui
+__GMP_DECLSPEC void mpf_div_ui (mpf_ptr, mpf_srcptr, unsigned long int);
+
+#define mpf_dump __gmpf_dump
+__GMP_DECLSPEC void mpf_dump (mpf_srcptr);
+
+#define mpf_eq __gmpf_eq
+__GMP_DECLSPEC int mpf_eq (mpf_srcptr, mpf_srcptr, mp_bitcnt_t) __GMP_ATTRIBUTE_PURE;
+
+#define mpf_fits_sint_p __gmpf_fits_sint_p
+__GMP_DECLSPEC int mpf_fits_sint_p (mpf_srcptr) __GMP_NOTHROW __GMP_ATTRIBUTE_PURE;
+
+#define mpf_fits_slong_p __gmpf_fits_slong_p
+__GMP_DECLSPEC int mpf_fits_slong_p (mpf_srcptr) __GMP_NOTHROW __GMP_ATTRIBUTE_PURE;
+
+#define mpf_fits_sshort_p __gmpf_fits_sshort_p
+__GMP_DECLSPEC int mpf_fits_sshort_p (mpf_srcptr) __GMP_NOTHROW __GMP_ATTRIBUTE_PURE;
+
+#define mpf_fits_uint_p __gmpf_fits_uint_p
+__GMP_DECLSPEC int mpf_fits_uint_p (mpf_srcptr) __GMP_NOTHROW __GMP_ATTRIBUTE_PURE;
+
+#define mpf_fits_ulong_p __gmpf_fits_ulong_p
+__GMP_DECLSPEC int mpf_fits_ulong_p (mpf_srcptr) __GMP_NOTHROW __GMP_ATTRIBUTE_PURE;
+
+#define mpf_fits_ushort_p __gmpf_fits_ushort_p
+__GMP_DECLSPEC int mpf_fits_ushort_p (mpf_srcptr) __GMP_NOTHROW __GMP_ATTRIBUTE_PURE;
+
+#define mpf_floor __gmpf_floor
+__GMP_DECLSPEC void mpf_floor (mpf_ptr, mpf_srcptr);
+
+#define mpf_get_d __gmpf_get_d
+__GMP_DECLSPEC double mpf_get_d (mpf_srcptr) __GMP_ATTRIBUTE_PURE;
+
+#define mpf_get_d_2exp __gmpf_get_d_2exp
+__GMP_DECLSPEC double mpf_get_d_2exp (signed long int *, mpf_srcptr);
+
+#define mpf_get_default_prec __gmpf_get_default_prec
+__GMP_DECLSPEC mp_bitcnt_t mpf_get_default_prec (void) __GMP_NOTHROW __GMP_ATTRIBUTE_PURE;
+
+#define mpf_get_prec __gmpf_get_prec
+__GMP_DECLSPEC mp_bitcnt_t mpf_get_prec (mpf_srcptr) __GMP_NOTHROW __GMP_ATTRIBUTE_PURE;
+
+#define mpf_get_si __gmpf_get_si
+__GMP_DECLSPEC long mpf_get_si (mpf_srcptr) __GMP_NOTHROW __GMP_ATTRIBUTE_PURE;
+
+#define mpf_get_str __gmpf_get_str
+__GMP_DECLSPEC char *mpf_get_str (char *, mp_exp_t *, int, size_t, mpf_srcptr);
+
+#define mpf_get_ui __gmpf_get_ui
+__GMP_DECLSPEC unsigned long mpf_get_ui (mpf_srcptr) __GMP_NOTHROW __GMP_ATTRIBUTE_PURE;
+
+#define mpf_init __gmpf_init
+__GMP_DECLSPEC void mpf_init (mpf_ptr);
+
+#define mpf_init2 __gmpf_init2
+__GMP_DECLSPEC void mpf_init2 (mpf_ptr, mp_bitcnt_t);
+
+#define mpf_inits __gmpf_inits
+__GMP_DECLSPEC void mpf_inits (mpf_ptr, ...);
+
+#define mpf_init_set __gmpf_init_set
+__GMP_DECLSPEC void mpf_init_set (mpf_ptr, mpf_srcptr);
+
+#define mpf_init_set_d __gmpf_init_set_d
+__GMP_DECLSPEC void mpf_init_set_d (mpf_ptr, double);
+
+#define mpf_init_set_si __gmpf_init_set_si
+__GMP_DECLSPEC void mpf_init_set_si (mpf_ptr, signed long int);
+
+#define mpf_init_set_str __gmpf_init_set_str
+__GMP_DECLSPEC int mpf_init_set_str (mpf_ptr, const char *, int);
+
+#define mpf_init_set_ui __gmpf_init_set_ui
+__GMP_DECLSPEC void mpf_init_set_ui (mpf_ptr, unsigned long int);
+
+#define mpf_inp_str __gmpf_inp_str
+#ifdef _GMP_H_HAVE_FILE
+__GMP_DECLSPEC size_t mpf_inp_str (mpf_ptr, FILE *, int);
+#endif
+
+#define mpf_integer_p __gmpf_integer_p
+__GMP_DECLSPEC int mpf_integer_p (mpf_srcptr) __GMP_NOTHROW __GMP_ATTRIBUTE_PURE;
+
+#define mpf_mul __gmpf_mul
+__GMP_DECLSPEC void mpf_mul (mpf_ptr, mpf_srcptr, mpf_srcptr);
+
+#define mpf_mul_2exp __gmpf_mul_2exp
+__GMP_DECLSPEC void mpf_mul_2exp (mpf_ptr, mpf_srcptr, mp_bitcnt_t);
+
+#define mpf_mul_ui __gmpf_mul_ui
+__GMP_DECLSPEC void mpf_mul_ui (mpf_ptr, mpf_srcptr, unsigned long int);
+
+#define mpf_neg __gmpf_neg
+__GMP_DECLSPEC void mpf_neg (mpf_ptr, mpf_srcptr);
+
+#define mpf_out_str __gmpf_out_str
+#ifdef _GMP_H_HAVE_FILE
+__GMP_DECLSPEC size_t mpf_out_str (FILE *, int, size_t, mpf_srcptr);
+#endif
+
+#define mpf_pow_ui __gmpf_pow_ui
+__GMP_DECLSPEC void mpf_pow_ui (mpf_ptr, mpf_srcptr, unsigned long int);
+
+#define mpf_random2 __gmpf_random2
+__GMP_DECLSPEC void mpf_random2 (mpf_ptr, mp_size_t, mp_exp_t);
+
+#define mpf_reldiff __gmpf_reldiff
+__GMP_DECLSPEC void mpf_reldiff (mpf_ptr, mpf_srcptr, mpf_srcptr);
+
+#define mpf_set __gmpf_set
+__GMP_DECLSPEC void mpf_set (mpf_ptr, mpf_srcptr);
+
+#define mpf_set_d __gmpf_set_d
+__GMP_DECLSPEC void mpf_set_d (mpf_ptr, double);
+
+#define mpf_set_default_prec __gmpf_set_default_prec
+__GMP_DECLSPEC void mpf_set_default_prec (mp_bitcnt_t) __GMP_NOTHROW;
+
+#define mpf_set_prec __gmpf_set_prec
+__GMP_DECLSPEC void mpf_set_prec (mpf_ptr, mp_bitcnt_t);
+
+#define mpf_set_prec_raw __gmpf_set_prec_raw
+__GMP_DECLSPEC void mpf_set_prec_raw (mpf_ptr, mp_bitcnt_t) __GMP_NOTHROW;
+
+#define mpf_set_q __gmpf_set_q
+__GMP_DECLSPEC void mpf_set_q (mpf_ptr, mpq_srcptr);
+
+#define mpf_set_si __gmpf_set_si
+__GMP_DECLSPEC void mpf_set_si (mpf_ptr, signed long int);
+
+#define mpf_set_str __gmpf_set_str
+__GMP_DECLSPEC int mpf_set_str (mpf_ptr, const char *, int);
+
+#define mpf_set_ui __gmpf_set_ui
+__GMP_DECLSPEC void mpf_set_ui (mpf_ptr, unsigned long int);
+
+#define mpf_set_z __gmpf_set_z
+__GMP_DECLSPEC void mpf_set_z (mpf_ptr, mpz_srcptr);
+
+#define mpf_size __gmpf_size
+__GMP_DECLSPEC size_t mpf_size (mpf_srcptr) __GMP_NOTHROW __GMP_ATTRIBUTE_PURE;
+
+#define mpf_sqrt __gmpf_sqrt
+__GMP_DECLSPEC void mpf_sqrt (mpf_ptr, mpf_srcptr);
+
+#define mpf_sqrt_ui __gmpf_sqrt_ui
+__GMP_DECLSPEC void mpf_sqrt_ui (mpf_ptr, unsigned long int);
+
+#define mpf_sub __gmpf_sub
+__GMP_DECLSPEC void mpf_sub (mpf_ptr, mpf_srcptr, mpf_srcptr);
+
+#define mpf_sub_ui __gmpf_sub_ui
+__GMP_DECLSPEC void mpf_sub_ui (mpf_ptr, mpf_srcptr, unsigned long int);
+
+#define mpf_swap __gmpf_swap
+__GMP_DECLSPEC void mpf_swap (mpf_ptr, mpf_ptr) __GMP_NOTHROW;
+
+#define mpf_trunc __gmpf_trunc
+__GMP_DECLSPEC void mpf_trunc (mpf_ptr, mpf_srcptr);
+
+#define mpf_ui_div __gmpf_ui_div
+__GMP_DECLSPEC void mpf_ui_div (mpf_ptr, unsigned long int, mpf_srcptr);
+
+#define mpf_ui_sub __gmpf_ui_sub
+__GMP_DECLSPEC void mpf_ui_sub (mpf_ptr, unsigned long int, mpf_srcptr);
+
+#define mpf_urandomb __gmpf_urandomb
+__GMP_DECLSPEC void mpf_urandomb (mpf_t, gmp_randstate_t, mp_bitcnt_t);
+
+
+/************ Low level positive-integer (i.e. N) routines. ************/
+
+/* This is ugly, but we need to make user calls reach the prefixed function. */
+
+#define mpn_add __MPN(add)
+#if __GMP_INLINE_PROTOTYPES || defined (__GMP_FORCE_mpn_add)
+__GMP_DECLSPEC mp_limb_t mpn_add (mp_ptr, mp_srcptr, mp_size_t, mp_srcptr, mp_size_t);
+#endif
+
+#define mpn_add_1 __MPN(add_1)
+#if __GMP_INLINE_PROTOTYPES || defined (__GMP_FORCE_mpn_add_1)
+__GMP_DECLSPEC mp_limb_t mpn_add_1 (mp_ptr, mp_srcptr, mp_size_t, mp_limb_t) __GMP_NOTHROW;
+#endif
+
+#define mpn_add_n __MPN(add_n)
+__GMP_DECLSPEC mp_limb_t mpn_add_n (mp_ptr, mp_srcptr, mp_srcptr, mp_size_t);
+
+#define mpn_addmul_1 __MPN(addmul_1)
+__GMP_DECLSPEC mp_limb_t mpn_addmul_1 (mp_ptr, mp_srcptr, mp_size_t, mp_limb_t);
+
+#define mpn_cmp __MPN(cmp)
+#if __GMP_INLINE_PROTOTYPES || defined (__GMP_FORCE_mpn_cmp)
+__GMP_DECLSPEC int mpn_cmp (mp_srcptr, mp_srcptr, mp_size_t) __GMP_NOTHROW __GMP_ATTRIBUTE_PURE;
+#endif
+
+#define mpn_divexact_by3(dst,src,size) \
+ mpn_divexact_by3c (dst, src, size, __GMP_CAST (mp_limb_t, 0))
+
+#define mpn_divexact_by3c __MPN(divexact_by3c)
+__GMP_DECLSPEC mp_limb_t mpn_divexact_by3c (mp_ptr, mp_srcptr, mp_size_t, mp_limb_t);
+
+#define mpn_divmod_1(qp,np,nsize,dlimb) \
+ mpn_divrem_1 (qp, __GMP_CAST (mp_size_t, 0), np, nsize, dlimb)
+
+#define mpn_divrem __MPN(divrem)
+__GMP_DECLSPEC mp_limb_t mpn_divrem (mp_ptr, mp_size_t, mp_ptr, mp_size_t, mp_srcptr, mp_size_t);
+
+#define mpn_divrem_1 __MPN(divrem_1)
+__GMP_DECLSPEC mp_limb_t mpn_divrem_1 (mp_ptr, mp_size_t, mp_srcptr, mp_size_t, mp_limb_t);
+
+#define mpn_divrem_2 __MPN(divrem_2)
+__GMP_DECLSPEC mp_limb_t mpn_divrem_2 (mp_ptr, mp_size_t, mp_ptr, mp_size_t, mp_srcptr);
+
+#define mpn_div_qr_1 __MPN(div_qr_1)
+__GMP_DECLSPEC mp_limb_t mpn_div_qr_1 (mp_ptr, mp_limb_t *, mp_srcptr, mp_size_t, mp_limb_t);
+
+#define mpn_div_qr_2 __MPN(div_qr_2)
+__GMP_DECLSPEC mp_limb_t mpn_div_qr_2 (mp_ptr, mp_ptr, mp_srcptr, mp_size_t, mp_srcptr);
+
+#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_1 __MPN(gcd_1)
+__GMP_DECLSPEC mp_limb_t mpn_gcd_1 (mp_srcptr, mp_size_t, mp_limb_t) __GMP_ATTRIBUTE_PURE;
+
+#define mpn_gcdext_1 __MPN(gcdext_1)
+__GMP_DECLSPEC mp_limb_t mpn_gcdext_1 (mp_limb_signed_t *, mp_limb_signed_t *, mp_limb_t, mp_limb_t);
+
+#define mpn_gcdext __MPN(gcdext)
+__GMP_DECLSPEC mp_size_t mpn_gcdext (mp_ptr, mp_ptr, mp_size_t *, mp_ptr, mp_size_t, mp_ptr, mp_size_t);
+
+#define mpn_get_str __MPN(get_str)
+__GMP_DECLSPEC size_t mpn_get_str (unsigned char *, int, mp_ptr, mp_size_t);
+
+#define mpn_hamdist __MPN(hamdist)
+__GMP_DECLSPEC mp_bitcnt_t mpn_hamdist (mp_srcptr, mp_srcptr, mp_size_t) __GMP_NOTHROW __GMP_ATTRIBUTE_PURE;
+
+#define mpn_lshift __MPN(lshift)
+__GMP_DECLSPEC mp_limb_t mpn_lshift (mp_ptr, mp_srcptr, mp_size_t, unsigned int);
+
+#define mpn_mod_1 __MPN(mod_1)
+__GMP_DECLSPEC mp_limb_t mpn_mod_1 (mp_srcptr, mp_size_t, mp_limb_t) __GMP_ATTRIBUTE_PURE;
+
+#define mpn_mul __MPN(mul)
+__GMP_DECLSPEC mp_limb_t mpn_mul (mp_ptr, mp_srcptr, mp_size_t, mp_srcptr, mp_size_t);
+
+#define mpn_mul_1 __MPN(mul_1)
+__GMP_DECLSPEC mp_limb_t mpn_mul_1 (mp_ptr, mp_srcptr, mp_size_t, mp_limb_t);
+
+#define mpn_mul_n __MPN(mul_n)
+__GMP_DECLSPEC void mpn_mul_n (mp_ptr, mp_srcptr, mp_srcptr, mp_size_t);
+
+#define mpn_sqr __MPN(sqr)
+__GMP_DECLSPEC void mpn_sqr (mp_ptr, mp_srcptr, mp_size_t);
+
+#define mpn_neg __MPN(neg)
+#if __GMP_INLINE_PROTOTYPES || defined (__GMP_FORCE_mpn_neg)
+__GMP_DECLSPEC mp_limb_t mpn_neg (mp_ptr, mp_srcptr, mp_size_t);
+#endif
+
+#define mpn_com __MPN(com)
+#if __GMP_INLINE_PROTOTYPES || defined (__GMP_FORCE_mpn_com)
+__GMP_DECLSPEC void mpn_com (mp_ptr, mp_srcptr, mp_size_t);
+#endif
+
+#define mpn_perfect_square_p __MPN(perfect_square_p)
+__GMP_DECLSPEC int mpn_perfect_square_p (mp_srcptr, mp_size_t) __GMP_ATTRIBUTE_PURE;
+
+#define mpn_perfect_power_p __MPN(perfect_power_p)
+__GMP_DECLSPEC int mpn_perfect_power_p (mp_srcptr, mp_size_t) __GMP_ATTRIBUTE_PURE;
+
+#define mpn_popcount __MPN(popcount)
+__GMP_DECLSPEC mp_bitcnt_t mpn_popcount (mp_srcptr, mp_size_t) __GMP_NOTHROW __GMP_ATTRIBUTE_PURE;
+
+#define mpn_pow_1 __MPN(pow_1)
+__GMP_DECLSPEC mp_size_t mpn_pow_1 (mp_ptr, mp_srcptr, mp_size_t, mp_limb_t, mp_ptr);
+
+/* undocumented now, but retained here for upward compatibility */
+#define mpn_preinv_mod_1 __MPN(preinv_mod_1)
+__GMP_DECLSPEC mp_limb_t mpn_preinv_mod_1 (mp_srcptr, mp_size_t, mp_limb_t, mp_limb_t) __GMP_ATTRIBUTE_PURE;
+
+#define mpn_random __MPN(random)
+__GMP_DECLSPEC void mpn_random (mp_ptr, mp_size_t);
+
+#define mpn_random2 __MPN(random2)
+__GMP_DECLSPEC void mpn_random2 (mp_ptr, mp_size_t);
+
+#define mpn_rshift __MPN(rshift)
+__GMP_DECLSPEC mp_limb_t mpn_rshift (mp_ptr, mp_srcptr, mp_size_t, unsigned int);
+
+#define mpn_scan0 __MPN(scan0)
+__GMP_DECLSPEC mp_bitcnt_t mpn_scan0 (mp_srcptr, mp_bitcnt_t) __GMP_ATTRIBUTE_PURE;
+
+#define mpn_scan1 __MPN(scan1)
+__GMP_DECLSPEC mp_bitcnt_t mpn_scan1 (mp_srcptr, mp_bitcnt_t) __GMP_ATTRIBUTE_PURE;
+
+#define mpn_set_str __MPN(set_str)
+__GMP_DECLSPEC mp_size_t mpn_set_str (mp_ptr, const unsigned char *, size_t, int);
+
+#define mpn_sizeinbase __MPN(sizeinbase)
+__GMP_DECLSPEC size_t mpn_sizeinbase (mp_srcptr, mp_size_t, int);
+
+#define mpn_sqrtrem __MPN(sqrtrem)
+__GMP_DECLSPEC mp_size_t mpn_sqrtrem (mp_ptr, mp_ptr, mp_srcptr, mp_size_t);
+
+#define mpn_sub __MPN(sub)
+#if __GMP_INLINE_PROTOTYPES || defined (__GMP_FORCE_mpn_sub)
+__GMP_DECLSPEC mp_limb_t mpn_sub (mp_ptr, mp_srcptr, mp_size_t, mp_srcptr, mp_size_t);
+#endif
+
+#define mpn_sub_1 __MPN(sub_1)
+#if __GMP_INLINE_PROTOTYPES || defined (__GMP_FORCE_mpn_sub_1)
+__GMP_DECLSPEC mp_limb_t mpn_sub_1 (mp_ptr, mp_srcptr, mp_size_t, mp_limb_t) __GMP_NOTHROW;
+#endif
+
+#define mpn_sub_n __MPN(sub_n)
+__GMP_DECLSPEC mp_limb_t mpn_sub_n (mp_ptr, mp_srcptr, mp_srcptr, mp_size_t);
+
+#define mpn_submul_1 __MPN(submul_1)
+__GMP_DECLSPEC mp_limb_t mpn_submul_1 (mp_ptr, mp_srcptr, mp_size_t, mp_limb_t);
+
+#define mpn_tdiv_qr __MPN(tdiv_qr)
+__GMP_DECLSPEC void mpn_tdiv_qr (mp_ptr, mp_ptr, mp_size_t, mp_srcptr, mp_size_t, mp_srcptr, mp_size_t);
+
+#define mpn_and_n __MPN(and_n)
+__GMP_DECLSPEC void mpn_and_n (mp_ptr, mp_srcptr, mp_srcptr, mp_size_t);
+#define mpn_andn_n __MPN(andn_n)
+__GMP_DECLSPEC void mpn_andn_n (mp_ptr, mp_srcptr, mp_srcptr, mp_size_t);
+#define mpn_nand_n __MPN(nand_n)
+__GMP_DECLSPEC void mpn_nand_n (mp_ptr, mp_srcptr, mp_srcptr, mp_size_t);
+#define mpn_ior_n __MPN(ior_n)
+__GMP_DECLSPEC void mpn_ior_n (mp_ptr, mp_srcptr, mp_srcptr, mp_size_t);
+#define mpn_iorn_n __MPN(iorn_n)
+__GMP_DECLSPEC void mpn_iorn_n (mp_ptr, mp_srcptr, mp_srcptr, mp_size_t);
+#define mpn_nior_n __MPN(nior_n)
+__GMP_DECLSPEC void mpn_nior_n (mp_ptr, mp_srcptr, mp_srcptr, mp_size_t);
+#define mpn_xor_n __MPN(xor_n)
+__GMP_DECLSPEC void mpn_xor_n (mp_ptr, mp_srcptr, mp_srcptr, mp_size_t);
+#define mpn_xnor_n __MPN(xnor_n)
+__GMP_DECLSPEC void mpn_xnor_n (mp_ptr, mp_srcptr, mp_srcptr, mp_size_t);
+
+#define mpn_copyi __MPN(copyi)
+__GMP_DECLSPEC void mpn_copyi (mp_ptr, mp_srcptr, mp_size_t);
+#define mpn_copyd __MPN(copyd)
+__GMP_DECLSPEC void mpn_copyd (mp_ptr, mp_srcptr, mp_size_t);
+#define mpn_zero __MPN(zero)
+__GMP_DECLSPEC void mpn_zero (mp_ptr, mp_size_t);
+
+#define mpn_cnd_add_n __MPN(cnd_add_n)
+__GMP_DECLSPEC mp_limb_t mpn_cnd_add_n (mp_limb_t, mp_ptr, mp_srcptr, mp_srcptr, mp_size_t);
+#define mpn_cnd_sub_n __MPN(cnd_sub_n)
+__GMP_DECLSPEC mp_limb_t mpn_cnd_sub_n (mp_limb_t, mp_ptr, mp_srcptr, mp_srcptr, mp_size_t);
+
+#define mpn_sec_add_1 __MPN(sec_add_1)
+__GMP_DECLSPEC mp_limb_t mpn_sec_add_1 (mp_ptr, mp_srcptr, mp_size_t, mp_limb_t, mp_ptr);
+#define mpn_sec_add_1_itch __MPN(sec_add_1_itch)
+__GMP_DECLSPEC mp_size_t mpn_sec_add_1_itch (mp_size_t) __GMP_ATTRIBUTE_PURE;
+
+#define mpn_sec_sub_1 __MPN(sec_sub_1)
+__GMP_DECLSPEC mp_limb_t mpn_sec_sub_1 (mp_ptr, mp_srcptr, mp_size_t, mp_limb_t, mp_ptr);
+#define mpn_sec_sub_1_itch __MPN(sec_sub_1_itch)
+__GMP_DECLSPEC mp_size_t mpn_sec_sub_1_itch (mp_size_t) __GMP_ATTRIBUTE_PURE;
+
+#define mpn_sec_mul __MPN(sec_mul)
+__GMP_DECLSPEC void mpn_sec_mul (mp_ptr, mp_srcptr, mp_size_t, mp_srcptr, mp_size_t, mp_ptr);
+#define mpn_sec_mul_itch __MPN(sec_mul_itch)
+__GMP_DECLSPEC mp_size_t mpn_sec_mul_itch (mp_size_t, mp_size_t) __GMP_ATTRIBUTE_PURE;
+
+#define mpn_sec_sqr __MPN(sec_sqr)
+__GMP_DECLSPEC void mpn_sec_sqr (mp_ptr, mp_srcptr, mp_size_t, mp_ptr);
+#define mpn_sec_sqr_itch __MPN(sec_sqr_itch)
+__GMP_DECLSPEC mp_size_t mpn_sec_sqr_itch (mp_size_t) __GMP_ATTRIBUTE_PURE;
+
+#define mpn_sec_powm __MPN(sec_powm)
+__GMP_DECLSPEC void mpn_sec_powm (mp_ptr, mp_srcptr, mp_size_t, mp_srcptr, mp_bitcnt_t, mp_srcptr, mp_size_t, mp_ptr);
+#define mpn_sec_powm_itch __MPN(sec_powm_itch)
+__GMP_DECLSPEC mp_size_t mpn_sec_powm_itch (mp_size_t, mp_bitcnt_t, mp_size_t) __GMP_ATTRIBUTE_PURE;
+
+#define mpn_sec_tabselect __MPN(sec_tabselect)
+__GMP_DECLSPEC void mpn_sec_tabselect (volatile mp_limb_t *, volatile const mp_limb_t *, mp_size_t, mp_size_t, mp_size_t);
+
+#define mpn_sec_div_qr __MPN(sec_div_qr)
+__GMP_DECLSPEC mp_limb_t mpn_sec_div_qr (mp_ptr, mp_ptr, mp_size_t, mp_srcptr, mp_size_t, mp_ptr);
+#define mpn_sec_div_qr_itch __MPN(sec_div_qr_itch)
+__GMP_DECLSPEC mp_size_t mpn_sec_div_qr_itch (mp_size_t, mp_size_t) __GMP_ATTRIBUTE_PURE;
+#define mpn_sec_div_r __MPN(sec_div_r)
+__GMP_DECLSPEC void mpn_sec_div_r (mp_ptr, mp_size_t, mp_srcptr, mp_size_t, mp_ptr);
+#define mpn_sec_div_r_itch __MPN(sec_div_r_itch)
+__GMP_DECLSPEC mp_size_t mpn_sec_div_r_itch (mp_size_t, mp_size_t) __GMP_ATTRIBUTE_PURE;
+
+#define mpn_sec_invert __MPN(sec_invert)
+__GMP_DECLSPEC int mpn_sec_invert (mp_ptr, mp_ptr, mp_srcptr, mp_size_t, mp_bitcnt_t, mp_ptr);
+#define mpn_sec_invert_itch __MPN(sec_invert_itch)
+__GMP_DECLSPEC mp_size_t mpn_sec_invert_itch (mp_size_t) __GMP_ATTRIBUTE_PURE;
+
+
+/**************** mpz inlines ****************/
+
+/* The following are provided as inlines where possible, but always exist as
+ library functions too, for binary compatibility.
+
+ Within gmp itself this inlining generally isn't relied on, since it
+ doesn't get done for all compilers, whereas if something is worth
+ inlining then it's worth arranging always.
+
+ There are two styles of inlining here. When the same bit of code is
+ wanted for the inline as for the library version, then __GMP_FORCE_foo
+ arranges for that code to be emitted and the __GMP_EXTERN_INLINE
+ directive suppressed, eg. mpz_fits_uint_p. When a different bit of code
+ is wanted for the inline than for the library version, then
+ __GMP_FORCE_foo arranges the inline to be suppressed, eg. mpz_abs. */
+
+#if defined (__GMP_EXTERN_INLINE) && ! defined (__GMP_FORCE_mpz_abs)
+__GMP_EXTERN_INLINE void
+mpz_abs (mpz_ptr __gmp_w, mpz_srcptr __gmp_u)
+{
+ if (__gmp_w != __gmp_u)
+ mpz_set (__gmp_w, __gmp_u);
+ __gmp_w->_mp_size = __GMP_ABS (__gmp_w->_mp_size);
+}
+#endif
+
+#if GMP_NAIL_BITS == 0
+#define __GMPZ_FITS_UTYPE_P(z,maxval) \
+ mp_size_t __gmp_n = z->_mp_size; \
+ mp_ptr __gmp_p = z->_mp_d; \
+ return (__gmp_n == 0 || (__gmp_n == 1 && __gmp_p[0] <= maxval));
+#else
+#define __GMPZ_FITS_UTYPE_P(z,maxval) \
+ mp_size_t __gmp_n = z->_mp_size; \
+ mp_ptr __gmp_p = z->_mp_d; \
+ return (__gmp_n == 0 || (__gmp_n == 1 && __gmp_p[0] <= maxval) \
+ || (__gmp_n == 2 && __gmp_p[1] <= ((mp_limb_t) maxval >> GMP_NUMB_BITS)));
+#endif
+
+#if defined (__GMP_EXTERN_INLINE) || defined (__GMP_FORCE_mpz_fits_uint_p)
+#if ! defined (__GMP_FORCE_mpz_fits_uint_p)
+__GMP_EXTERN_INLINE
+#endif
+int
+mpz_fits_uint_p (mpz_srcptr __gmp_z) __GMP_NOTHROW
+{
+ __GMPZ_FITS_UTYPE_P (__gmp_z, __GMP_UINT_MAX);
+}
+#endif
+
+#if defined (__GMP_EXTERN_INLINE) || defined (__GMP_FORCE_mpz_fits_ulong_p)
+#if ! defined (__GMP_FORCE_mpz_fits_ulong_p)
+__GMP_EXTERN_INLINE
+#endif
+int
+mpz_fits_ulong_p (mpz_srcptr __gmp_z) __GMP_NOTHROW
+{
+ __GMPZ_FITS_UTYPE_P (__gmp_z, __GMP_ULONG_MAX);
+}
+#endif
+
+#if defined (__GMP_EXTERN_INLINE) || defined (__GMP_FORCE_mpz_fits_ushort_p)
+#if ! defined (__GMP_FORCE_mpz_fits_ushort_p)
+__GMP_EXTERN_INLINE
+#endif
+int
+mpz_fits_ushort_p (mpz_srcptr __gmp_z) __GMP_NOTHROW
+{
+ __GMPZ_FITS_UTYPE_P (__gmp_z, __GMP_USHRT_MAX);
+}
+#endif
+
+#if defined (__GMP_EXTERN_INLINE) || defined (__GMP_FORCE_mpz_get_ui)
+#if ! defined (__GMP_FORCE_mpz_get_ui)
+__GMP_EXTERN_INLINE
+#endif
+unsigned long
+mpz_get_ui (mpz_srcptr __gmp_z) __GMP_NOTHROW
+{
+ mp_ptr __gmp_p = __gmp_z->_mp_d;
+ mp_size_t __gmp_n = __gmp_z->_mp_size;
+ mp_limb_t __gmp_l = __gmp_p[0];
+ /* This is a "#if" rather than a plain "if" so as to avoid gcc warnings
+ about "<< GMP_NUMB_BITS" exceeding the type size, and to avoid Borland
+ C++ 6.0 warnings about condition always true for something like
+ "__GMP_ULONG_MAX < GMP_NUMB_MASK". */
+#if GMP_NAIL_BITS == 0 || defined (_LONG_LONG_LIMB)
+ /* limb==long and no nails, or limb==longlong, one limb is enough */
+ return (__gmp_n != 0 ? __gmp_l : 0);
+#else
+ /* limb==long and nails, need two limbs when available */
+ __gmp_n = __GMP_ABS (__gmp_n);
+ if (__gmp_n <= 1)
+ return (__gmp_n != 0 ? __gmp_l : 0);
+ else
+ return __gmp_l + (__gmp_p[1] << GMP_NUMB_BITS);
+#endif
+}
+#endif
+
+#if defined (__GMP_EXTERN_INLINE) || defined (__GMP_FORCE_mpz_getlimbn)
+#if ! defined (__GMP_FORCE_mpz_getlimbn)
+__GMP_EXTERN_INLINE
+#endif
+mp_limb_t
+mpz_getlimbn (mpz_srcptr __gmp_z, mp_size_t __gmp_n) __GMP_NOTHROW
+{
+ mp_limb_t __gmp_result = 0;
+ if (__GMP_LIKELY (__gmp_n >= 0 && __gmp_n < __GMP_ABS (__gmp_z->_mp_size)))
+ __gmp_result = __gmp_z->_mp_d[__gmp_n];
+ return __gmp_result;
+}
+#endif
+
+#if defined (__GMP_EXTERN_INLINE) && ! defined (__GMP_FORCE_mpz_neg)
+__GMP_EXTERN_INLINE void
+mpz_neg (mpz_ptr __gmp_w, mpz_srcptr __gmp_u)
+{
+ if (__gmp_w != __gmp_u)
+ mpz_set (__gmp_w, __gmp_u);
+ __gmp_w->_mp_size = - __gmp_w->_mp_size;
+}
+#endif
+
+#if defined (__GMP_EXTERN_INLINE) || defined (__GMP_FORCE_mpz_perfect_square_p)
+#if ! defined (__GMP_FORCE_mpz_perfect_square_p)
+__GMP_EXTERN_INLINE
+#endif
+int
+mpz_perfect_square_p (mpz_srcptr __gmp_a)
+{
+ mp_size_t __gmp_asize;
+ int __gmp_result;
+
+ __gmp_asize = __gmp_a->_mp_size;
+ __gmp_result = (__gmp_asize >= 0); /* zero is a square, negatives are not */
+ if (__GMP_LIKELY (__gmp_asize > 0))
+ __gmp_result = mpn_perfect_square_p (__gmp_a->_mp_d, __gmp_asize);
+ return __gmp_result;
+}
+#endif
+
+#if defined (__GMP_EXTERN_INLINE) || defined (__GMP_FORCE_mpz_popcount)
+#if ! defined (__GMP_FORCE_mpz_popcount)
+__GMP_EXTERN_INLINE
+#endif
+mp_bitcnt_t
+mpz_popcount (mpz_srcptr __gmp_u) __GMP_NOTHROW
+{
+ mp_size_t __gmp_usize;
+ mp_bitcnt_t __gmp_result;
+
+ __gmp_usize = __gmp_u->_mp_size;
+ __gmp_result = (__gmp_usize < 0 ? __GMP_ULONG_MAX : 0);
+ if (__GMP_LIKELY (__gmp_usize > 0))
+ __gmp_result = mpn_popcount (__gmp_u->_mp_d, __gmp_usize);
+ return __gmp_result;
+}
+#endif
+
+#if defined (__GMP_EXTERN_INLINE) || defined (__GMP_FORCE_mpz_set_q)
+#if ! defined (__GMP_FORCE_mpz_set_q)
+__GMP_EXTERN_INLINE
+#endif
+void
+mpz_set_q (mpz_ptr __gmp_w, mpq_srcptr __gmp_u)
+{
+ mpz_tdiv_q (__gmp_w, mpq_numref (__gmp_u), mpq_denref (__gmp_u));
+}
+#endif
+
+#if defined (__GMP_EXTERN_INLINE) || defined (__GMP_FORCE_mpz_size)
+#if ! defined (__GMP_FORCE_mpz_size)
+__GMP_EXTERN_INLINE
+#endif
+size_t
+mpz_size (mpz_srcptr __gmp_z) __GMP_NOTHROW
+{
+ return __GMP_ABS (__gmp_z->_mp_size);
+}
+#endif
+
+
+/**************** mpq inlines ****************/
+
+#if defined (__GMP_EXTERN_INLINE) && ! defined (__GMP_FORCE_mpq_abs)
+__GMP_EXTERN_INLINE void
+mpq_abs (mpq_ptr __gmp_w, mpq_srcptr __gmp_u)
+{
+ if (__gmp_w != __gmp_u)
+ mpq_set (__gmp_w, __gmp_u);
+ __gmp_w->_mp_num._mp_size = __GMP_ABS (__gmp_w->_mp_num._mp_size);
+}
+#endif
+
+#if defined (__GMP_EXTERN_INLINE) && ! defined (__GMP_FORCE_mpq_neg)
+__GMP_EXTERN_INLINE void
+mpq_neg (mpq_ptr __gmp_w, mpq_srcptr __gmp_u)
+{
+ if (__gmp_w != __gmp_u)
+ mpq_set (__gmp_w, __gmp_u);
+ __gmp_w->_mp_num._mp_size = - __gmp_w->_mp_num._mp_size;
+}
+#endif
+
+
+/**************** mpn inlines ****************/
+
+/* The comments with __GMPN_ADD_1 below apply here too.
+
+ The test for FUNCTION returning 0 should predict well. If it's assumed
+ {yp,ysize} will usually have a random number of bits then the high limb
+ won't be full and a carry out will occur a good deal less than 50% of the
+ time.
+
+ ysize==0 isn't a documented feature, but is used internally in a few
+ places.
+
+ Producing cout last stops it using up a register during the main part of
+ the calculation, though gcc (as of 3.0) on an "if (mpn_add (...))"
+ doesn't seem able to move the true and false legs of the conditional up
+ to the two places cout is generated. */
+
+#define __GMPN_AORS(cout, wp, xp, xsize, yp, ysize, FUNCTION, TEST) \
+ do { \
+ mp_size_t __gmp_i; \
+ mp_limb_t __gmp_x; \
+ \
+ /* ASSERT ((ysize) >= 0); */ \
+ /* ASSERT ((xsize) >= (ysize)); */ \
+ /* ASSERT (MPN_SAME_OR_SEPARATE2_P (wp, xsize, xp, xsize)); */ \
+ /* ASSERT (MPN_SAME_OR_SEPARATE2_P (wp, xsize, yp, ysize)); */ \
+ \
+ __gmp_i = (ysize); \
+ if (__gmp_i != 0) \
+ { \
+ if (FUNCTION (wp, xp, yp, __gmp_i)) \
+ { \
+ do \
+ { \
+ if (__gmp_i >= (xsize)) \
+ { \
+ (cout) = 1; \
+ goto __gmp_done; \
+ } \
+ __gmp_x = (xp)[__gmp_i]; \
+ } \
+ while (TEST); \
+ } \
+ } \
+ if ((wp) != (xp)) \
+ __GMPN_COPY_REST (wp, xp, xsize, __gmp_i); \
+ (cout) = 0; \
+ __gmp_done: \
+ ; \
+ } while (0)
+
+#define __GMPN_ADD(cout, wp, xp, xsize, yp, ysize) \
+ __GMPN_AORS (cout, wp, xp, xsize, yp, ysize, mpn_add_n, \
+ (((wp)[__gmp_i++] = (__gmp_x + 1) & GMP_NUMB_MASK) == 0))
+#define __GMPN_SUB(cout, wp, xp, xsize, yp, ysize) \
+ __GMPN_AORS (cout, wp, xp, xsize, yp, ysize, mpn_sub_n, \
+ (((wp)[__gmp_i++] = (__gmp_x - 1) & GMP_NUMB_MASK), __gmp_x == 0))
+
+
+/* The use of __gmp_i indexing is designed to ensure a compile time src==dst
+ remains nice and clear to the compiler, so that __GMPN_COPY_REST can
+ disappear, and the load/add/store gets a chance to become a
+ read-modify-write on CISC CPUs.
+
+ Alternatives:
+
+ Using a pair of pointers instead of indexing would be possible, but gcc
+ isn't able to recognise compile-time src==dst in that case, even when the
+ pointers are incremented more or less together. Other compilers would
+ very likely have similar difficulty.
+
+ gcc could use "if (__builtin_constant_p(src==dst) && src==dst)" or
+ similar to detect a compile-time src==dst. This works nicely on gcc
+ 2.95.x, it's not good on gcc 3.0 where __builtin_constant_p(p==p) seems
+ to be always false, for a pointer p. But the current code form seems
+ good enough for src==dst anyway.
+
+ gcc on x86 as usual doesn't give particularly good flags handling for the
+ carry/borrow detection. It's tempting to want some multi instruction asm
+ blocks to help it, and this was tried, but in truth there's only a few
+ instructions to save and any gain is all too easily lost by register
+ juggling setting up for the asm. */
+
+#if GMP_NAIL_BITS == 0
+#define __GMPN_AORS_1(cout, dst, src, n, v, OP, CB) \
+ do { \
+ mp_size_t __gmp_i; \
+ mp_limb_t __gmp_x, __gmp_r; \
+ \
+ /* ASSERT ((n) >= 1); */ \
+ /* ASSERT (MPN_SAME_OR_SEPARATE_P (dst, src, n)); */ \
+ \
+ __gmp_x = (src)[0]; \
+ __gmp_r = __gmp_x OP (v); \
+ (dst)[0] = __gmp_r; \
+ if (CB (__gmp_r, __gmp_x, (v))) \
+ { \
+ (cout) = 1; \
+ for (__gmp_i = 1; __gmp_i < (n);) \
+ { \
+ __gmp_x = (src)[__gmp_i]; \
+ __gmp_r = __gmp_x OP 1; \
+ (dst)[__gmp_i] = __gmp_r; \
+ ++__gmp_i; \
+ if (!CB (__gmp_r, __gmp_x, 1)) \
+ { \
+ if ((src) != (dst)) \
+ __GMPN_COPY_REST (dst, src, n, __gmp_i); \
+ (cout) = 0; \
+ break; \
+ } \
+ } \
+ } \
+ else \
+ { \
+ if ((src) != (dst)) \
+ __GMPN_COPY_REST (dst, src, n, 1); \
+ (cout) = 0; \
+ } \
+ } while (0)
+#endif
+
+#if GMP_NAIL_BITS >= 1
+#define __GMPN_AORS_1(cout, dst, src, n, v, OP, CB) \
+ do { \
+ mp_size_t __gmp_i; \
+ mp_limb_t __gmp_x, __gmp_r; \
+ \
+ /* ASSERT ((n) >= 1); */ \
+ /* ASSERT (MPN_SAME_OR_SEPARATE_P (dst, src, n)); */ \
+ \
+ __gmp_x = (src)[0]; \
+ __gmp_r = __gmp_x OP (v); \
+ (dst)[0] = __gmp_r & GMP_NUMB_MASK; \
+ if (__gmp_r >> GMP_NUMB_BITS != 0) \
+ { \
+ (cout) = 1; \
+ for (__gmp_i = 1; __gmp_i < (n);) \
+ { \
+ __gmp_x = (src)[__gmp_i]; \
+ __gmp_r = __gmp_x OP 1; \
+ (dst)[__gmp_i] = __gmp_r & GMP_NUMB_MASK; \
+ ++__gmp_i; \
+ if (__gmp_r >> GMP_NUMB_BITS == 0) \
+ { \
+ if ((src) != (dst)) \
+ __GMPN_COPY_REST (dst, src, n, __gmp_i); \
+ (cout) = 0; \
+ break; \
+ } \
+ } \
+ } \
+ else \
+ { \
+ if ((src) != (dst)) \
+ __GMPN_COPY_REST (dst, src, n, 1); \
+ (cout) = 0; \
+ } \
+ } while (0)
+#endif
+
+#define __GMPN_ADDCB(r,x,y) ((r) < (y))
+#define __GMPN_SUBCB(r,x,y) ((x) < (y))
+
+#define __GMPN_ADD_1(cout, dst, src, n, v) \
+ __GMPN_AORS_1(cout, dst, src, n, v, +, __GMPN_ADDCB)
+#define __GMPN_SUB_1(cout, dst, src, n, v) \
+ __GMPN_AORS_1(cout, dst, src, n, v, -, __GMPN_SUBCB)
+
+
+/* Compare {xp,size} and {yp,size}, setting "result" to positive, zero or
+ negative. size==0 is allowed. On random data usually only one limb will
+ need to be examined to get a result, so it's worth having it inline. */
+#define __GMPN_CMP(result, xp, yp, size) \
+ do { \
+ mp_size_t __gmp_i; \
+ mp_limb_t __gmp_x, __gmp_y; \
+ \
+ /* ASSERT ((size) >= 0); */ \
+ \
+ (result) = 0; \
+ __gmp_i = (size); \
+ while (--__gmp_i >= 0) \
+ { \
+ __gmp_x = (xp)[__gmp_i]; \
+ __gmp_y = (yp)[__gmp_i]; \
+ if (__gmp_x != __gmp_y) \
+ { \
+ /* Cannot use __gmp_x - __gmp_y, may overflow an "int" */ \
+ (result) = (__gmp_x > __gmp_y ? 1 : -1); \
+ break; \
+ } \
+ } \
+ } while (0)
+
+
+#if defined (__GMPN_COPY) && ! defined (__GMPN_COPY_REST)
+#define __GMPN_COPY_REST(dst, src, size, start) \
+ do { \
+ /* ASSERT ((start) >= 0); */ \
+ /* ASSERT ((start) <= (size)); */ \
+ __GMPN_COPY ((dst)+(start), (src)+(start), (size)-(start)); \
+ } while (0)
+#endif
+
+/* Copy {src,size} to {dst,size}, starting at "start". This is designed to
+ keep the indexing dst[j] and src[j] nice and simple for __GMPN_ADD_1,
+ __GMPN_ADD, etc. */
+#if ! defined (__GMPN_COPY_REST)
+#define __GMPN_COPY_REST(dst, src, size, start) \
+ do { \
+ mp_size_t __gmp_j; \
+ /* ASSERT ((size) >= 0); */ \
+ /* ASSERT ((start) >= 0); */ \
+ /* ASSERT ((start) <= (size)); */ \
+ /* ASSERT (MPN_SAME_OR_SEPARATE_P (dst, src, size)); */ \
+ __GMP_CRAY_Pragma ("_CRI ivdep"); \
+ for (__gmp_j = (start); __gmp_j < (size); __gmp_j++) \
+ (dst)[__gmp_j] = (src)[__gmp_j]; \
+ } while (0)
+#endif
+
+/* Enhancement: Use some of the smarter code from gmp-impl.h. Maybe use
+ mpn_copyi if there's a native version, and if we don't mind demanding
+ binary compatibility for it (on targets which use it). */
+
+#if ! defined (__GMPN_COPY)
+#define __GMPN_COPY(dst, src, size) __GMPN_COPY_REST (dst, src, size, 0)
+#endif
+
+
+#if defined (__GMP_EXTERN_INLINE) || defined (__GMP_FORCE_mpn_add)
+#if ! defined (__GMP_FORCE_mpn_add)
+__GMP_EXTERN_INLINE
+#endif
+mp_limb_t
+mpn_add (mp_ptr __gmp_wp, mp_srcptr __gmp_xp, mp_size_t __gmp_xsize, mp_srcptr __gmp_yp, mp_size_t __gmp_ysize)
+{
+ mp_limb_t __gmp_c;
+ __GMPN_ADD (__gmp_c, __gmp_wp, __gmp_xp, __gmp_xsize, __gmp_yp, __gmp_ysize);
+ return __gmp_c;
+}
+#endif
+
+#if defined (__GMP_EXTERN_INLINE) || defined (__GMP_FORCE_mpn_add_1)
+#if ! defined (__GMP_FORCE_mpn_add_1)
+__GMP_EXTERN_INLINE
+#endif
+mp_limb_t
+mpn_add_1 (mp_ptr __gmp_dst, mp_srcptr __gmp_src, mp_size_t __gmp_size, mp_limb_t __gmp_n) __GMP_NOTHROW
+{
+ mp_limb_t __gmp_c;
+ __GMPN_ADD_1 (__gmp_c, __gmp_dst, __gmp_src, __gmp_size, __gmp_n);
+ return __gmp_c;
+}
+#endif
+
+#if defined (__GMP_EXTERN_INLINE) || defined (__GMP_FORCE_mpn_cmp)
+#if ! defined (__GMP_FORCE_mpn_cmp)
+__GMP_EXTERN_INLINE
+#endif
+int
+mpn_cmp (mp_srcptr __gmp_xp, mp_srcptr __gmp_yp, mp_size_t __gmp_size) __GMP_NOTHROW
+{
+ int __gmp_result;
+ __GMPN_CMP (__gmp_result, __gmp_xp, __gmp_yp, __gmp_size);
+ return __gmp_result;
+}
+#endif
+
+#if defined (__GMP_EXTERN_INLINE) || defined (__GMP_FORCE_mpn_sub)
+#if ! defined (__GMP_FORCE_mpn_sub)
+__GMP_EXTERN_INLINE
+#endif
+mp_limb_t
+mpn_sub (mp_ptr __gmp_wp, mp_srcptr __gmp_xp, mp_size_t __gmp_xsize, mp_srcptr __gmp_yp, mp_size_t __gmp_ysize)
+{
+ mp_limb_t __gmp_c;
+ __GMPN_SUB (__gmp_c, __gmp_wp, __gmp_xp, __gmp_xsize, __gmp_yp, __gmp_ysize);
+ return __gmp_c;
+}
+#endif
+
+#if defined (__GMP_EXTERN_INLINE) || defined (__GMP_FORCE_mpn_sub_1)
+#if ! defined (__GMP_FORCE_mpn_sub_1)
+__GMP_EXTERN_INLINE
+#endif
+mp_limb_t
+mpn_sub_1 (mp_ptr __gmp_dst, mp_srcptr __gmp_src, mp_size_t __gmp_size, mp_limb_t __gmp_n) __GMP_NOTHROW
+{
+ mp_limb_t __gmp_c;
+ __GMPN_SUB_1 (__gmp_c, __gmp_dst, __gmp_src, __gmp_size, __gmp_n);
+ return __gmp_c;
+}
+#endif
+
+#if defined (__GMP_EXTERN_INLINE) || defined (__GMP_FORCE_mpn_neg)
+#if ! defined (__GMP_FORCE_mpn_neg)
+__GMP_EXTERN_INLINE
+#endif
+mp_limb_t
+mpn_neg (mp_ptr __gmp_rp, mp_srcptr __gmp_up, mp_size_t __gmp_n)
+{
+ mp_limb_t __gmp_ul, __gmp_cy;
+ __gmp_cy = 0;
+ do {
+ __gmp_ul = *__gmp_up++;
+ *__gmp_rp++ = -__gmp_ul - __gmp_cy;
+ __gmp_cy |= __gmp_ul != 0;
+ } while (--__gmp_n != 0);
+ return __gmp_cy;
+}
+#endif
+
+#if defined (__cplusplus)
+}
+#endif
+
+
+/* Allow faster testing for negative, zero, and positive. */
+#define mpz_sgn(Z) ((Z)->_mp_size < 0 ? -1 : (Z)->_mp_size > 0)
+#define mpf_sgn(F) ((F)->_mp_size < 0 ? -1 : (F)->_mp_size > 0)
+#define mpq_sgn(Q) ((Q)->_mp_num._mp_size < 0 ? -1 : (Q)->_mp_num._mp_size > 0)
+
+/* When using GCC, optimize certain common comparisons. */
+#if defined (__GNUC__) && __GNUC__ >= 2
+#define mpz_cmp_ui(Z,UI) \
+ (__builtin_constant_p (UI) && (UI) == 0 \
+ ? mpz_sgn (Z) : _mpz_cmp_ui (Z,UI))
+#define mpz_cmp_si(Z,SI) \
+ (__builtin_constant_p ((SI) >= 0) && (SI) >= 0 \
+ ? mpz_cmp_ui (Z, __GMP_CAST (unsigned long, SI)) \
+ : _mpz_cmp_si (Z,SI))
+#define mpq_cmp_ui(Q,NUI,DUI) \
+ (__builtin_constant_p (NUI) && (NUI) == 0 ? mpq_sgn (Q) \
+ : __builtin_constant_p ((NUI) == (DUI)) && (NUI) == (DUI) \
+ ? mpz_cmp (mpq_numref (Q), mpq_denref (Q)) \
+ : _mpq_cmp_ui (Q,NUI,DUI))
+#define mpq_cmp_si(q,n,d) \
+ (__builtin_constant_p ((n) >= 0) && (n) >= 0 \
+ ? mpq_cmp_ui (q, __GMP_CAST (unsigned long, n), d) \
+ : _mpq_cmp_si (q, n, d))
+#else
+#define mpz_cmp_ui(Z,UI) _mpz_cmp_ui (Z,UI)
+#define mpz_cmp_si(Z,UI) _mpz_cmp_si (Z,UI)
+#define mpq_cmp_ui(Q,NUI,DUI) _mpq_cmp_ui (Q,NUI,DUI)
+#define mpq_cmp_si(q,n,d) _mpq_cmp_si(q,n,d)
+#endif
+
+
+/* Using "&" rather than "&&" means these can come out branch-free. Every
+ mpz_t has at least one limb allocated, so fetching the low limb is always
+ allowed. */
+#define mpz_odd_p(z) (((z)->_mp_size != 0) & __GMP_CAST (int, (z)->_mp_d[0]))
+#define mpz_even_p(z) (! mpz_odd_p (z))
+
+
+/**************** C++ routines ****************/
+
+#ifdef __cplusplus
+__GMP_DECLSPEC_XX std::ostream& operator<< (std::ostream &, mpz_srcptr);
+__GMP_DECLSPEC_XX std::ostream& operator<< (std::ostream &, mpq_srcptr);
+__GMP_DECLSPEC_XX std::ostream& operator<< (std::ostream &, mpf_srcptr);
+__GMP_DECLSPEC_XX std::istream& operator>> (std::istream &, mpz_ptr);
+__GMP_DECLSPEC_XX std::istream& operator>> (std::istream &, mpq_ptr);
+__GMP_DECLSPEC_XX std::istream& operator>> (std::istream &, mpf_ptr);
+#endif
+
+
+/* Source-level compatibility with GMP 2 and earlier. */
+#define mpn_divmod(qp,np,nsize,dp,dsize) \
+ mpn_divrem (qp, __GMP_CAST (mp_size_t, 0), np, nsize, dp, dsize)
+
+/* Source-level compatibility with GMP 1. */
+#define mpz_mdiv mpz_fdiv_q
+#define mpz_mdivmod mpz_fdiv_qr
+#define mpz_mmod mpz_fdiv_r
+#define mpz_mdiv_ui mpz_fdiv_q_ui
+#define mpz_mdivmod_ui(q,r,n,d) \
+ (((r) == 0) ? mpz_fdiv_q_ui (q,n,d) : mpz_fdiv_qr_ui (q,r,n,d))
+#define mpz_mmod_ui(r,n,d) \
+ (((r) == 0) ? mpz_fdiv_ui (n,d) : mpz_fdiv_r_ui (r,n,d))
+
+/* Useful synonyms, but not quite compatible with GMP 1. */
+#define mpz_div mpz_fdiv_q
+#define mpz_divmod mpz_fdiv_qr
+#define mpz_div_ui mpz_fdiv_q_ui
+#define mpz_divmod_ui mpz_fdiv_qr_ui
+#define mpz_div_2exp mpz_fdiv_q_2exp
+#define mpz_mod_2exp mpz_fdiv_r_2exp
+
+enum
+{
+ GMP_ERROR_NONE = 0,
+ GMP_ERROR_UNSUPPORTED_ARGUMENT = 1,
+ GMP_ERROR_DIVISION_BY_ZERO = 2,
+ GMP_ERROR_SQRT_OF_NEGATIVE = 4,
+ GMP_ERROR_INVALID_ARGUMENT = 8
+};
+
+/* Define CC and CFLAGS which were used to build this version of GMP */
+#define __GMP_CC "@CC@"
+#define __GMP_CFLAGS "@CFLAGS@"
+
+/* Major version number is the value of __GNU_MP__ too, above and in mp.h. */
+#define __GNU_MP_VERSION 6
+#define __GNU_MP_VERSION_MINOR 0
+#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__
+#endif /* __GMP_H__ */
diff --git a/Build/source/libs/gmp/gmp-6.0.0/gmp-impl.h b/Build/source/libs/gmp/gmp-6.0.0/gmp-impl.h
new file mode 100644
index 00000000000..dc4e084a723
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/gmp-impl.h
@@ -0,0 +1,5203 @@
+/* Include file for internal GNU MP types and definitions.
+
+ 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-2014 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/. */
+
+
+/* __GMP_DECLSPEC must be given on any global data that will be accessed
+ from outside libgmp, meaning from the test or development programs, or
+ from libgmpxx. Failing to do this will result in an incorrect address
+ being used for the accesses. On functions __GMP_DECLSPEC makes calls
+ from outside libgmp more efficient, but they'll still work fine without
+ it. */
+
+
+#ifndef __GMP_IMPL_H__
+#define __GMP_IMPL_H__
+
+#if defined _CRAY
+#include <intrinsics.h> /* for _popcnt */
+#endif
+
+/* For INT_MAX, etc. We used to avoid it because of a bug (on solaris,
+ gcc 2.95 under -mcpu=ultrasparc in ABI=32 ends up getting wrong
+ values (the ABI=64 values)), but it should be safe now.
+
+ On Cray vector systems, however, we need the system limits.h since sizes
+ of signed and unsigned types can differ there, depending on compiler
+ options (eg. -hnofastmd), making our SHRT_MAX etc expressions fail. For
+ reference, int can be 46 or 64 bits, whereas uint is always 64 bits; and
+ short can be 24, 32, 46 or 64 bits, and different for ushort. */
+
+#include <limits.h>
+
+/* For fat.h and other fat binary stuff.
+ No need for __GMP_ATTRIBUTE_PURE or __GMP_NOTHROW, since functions
+ declared this way are only used to set function pointers in __gmpn_cpuvec,
+ they're not called directly. */
+#define DECL_add_n(name) \
+ __GMP_DECLSPEC mp_limb_t name (mp_ptr, mp_srcptr, mp_srcptr, mp_size_t)
+#define DECL_addlsh1_n(name) \
+ DECL_add_n (name)
+#define DECL_addlsh2_n(name) \
+ DECL_add_n (name)
+#define DECL_addmul_1(name) \
+ __GMP_DECLSPEC mp_limb_t name (mp_ptr, mp_srcptr, mp_size_t, mp_limb_t)
+#define DECL_addmul_2(name) \
+ __GMP_DECLSPEC mp_limb_t name (mp_ptr, mp_srcptr, mp_size_t, mp_srcptr)
+#define DECL_bdiv_dbm1c(name) \
+ __GMP_DECLSPEC mp_limb_t name (mp_ptr, mp_srcptr, mp_size_t, mp_limb_t, mp_limb_t)
+#define DECL_cnd_add_n(name) \
+ __GMP_DECLSPEC mp_limb_t name (mp_limb_t, mp_ptr, mp_srcptr, mp_srcptr, mp_size_t)
+#define DECL_cnd_sub_n(name) \
+ __GMP_DECLSPEC mp_limb_t name (mp_limb_t, mp_ptr, mp_srcptr, mp_srcptr, mp_size_t)
+#define DECL_com(name) \
+ __GMP_DECLSPEC void name (mp_ptr, mp_srcptr, mp_size_t)
+#define DECL_copyd(name) \
+ __GMP_DECLSPEC void name (mp_ptr, mp_srcptr, mp_size_t)
+#define DECL_copyi(name) \
+ DECL_copyd (name)
+#define DECL_divexact_1(name) \
+ __GMP_DECLSPEC void name (mp_ptr, mp_srcptr, mp_size_t, mp_limb_t)
+#define DECL_divexact_by3c(name) \
+ __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_lshift(name) \
+ __GMP_DECLSPEC mp_limb_t name (mp_ptr, mp_srcptr, mp_size_t, unsigned)
+#define DECL_lshiftc(name) \
+ DECL_lshift (name)
+#define DECL_mod_1(name) \
+ __GMP_DECLSPEC mp_limb_t name (mp_srcptr, mp_size_t, mp_limb_t)
+#define DECL_mod_1_1p(name) \
+ __GMP_DECLSPEC mp_limb_t name (mp_srcptr, mp_size_t, mp_limb_t, const mp_limb_t [])
+#define DECL_mod_1_1p_cps(name) \
+ __GMP_DECLSPEC void name (mp_limb_t cps[], mp_limb_t b)
+#define DECL_mod_1s_2p(name) \
+ DECL_mod_1_1p (name)
+#define DECL_mod_1s_2p_cps(name) \
+ DECL_mod_1_1p_cps (name)
+#define DECL_mod_1s_4p(name) \
+ DECL_mod_1_1p (name)
+#define DECL_mod_1s_4p_cps(name) \
+ DECL_mod_1_1p_cps (name)
+#define DECL_mod_34lsub1(name) \
+ __GMP_DECLSPEC mp_limb_t name (mp_srcptr, mp_size_t)
+#define DECL_modexact_1c_odd(name) \
+ __GMP_DECLSPEC mp_limb_t name (mp_srcptr, mp_size_t, mp_limb_t, mp_limb_t)
+#define DECL_mul_1(name) \
+ DECL_addmul_1 (name)
+#define DECL_mul_basecase(name) \
+ __GMP_DECLSPEC void name (mp_ptr, mp_srcptr, mp_size_t, mp_srcptr, mp_size_t)
+#define DECL_mullo_basecase(name) \
+ __GMP_DECLSPEC void name (mp_ptr, mp_srcptr, mp_srcptr, mp_size_t)
+#define DECL_preinv_divrem_1(name) \
+ __GMP_DECLSPEC mp_limb_t name (mp_ptr, mp_size_t, mp_srcptr, mp_size_t, mp_limb_t, mp_limb_t, int)
+#define DECL_preinv_mod_1(name) \
+ __GMP_DECLSPEC mp_limb_t name (mp_srcptr, mp_size_t, mp_limb_t, mp_limb_t)
+#define DECL_redc_1(name) \
+ __GMP_DECLSPEC mp_limb_t name (mp_ptr, mp_ptr, mp_srcptr, mp_size_t, mp_limb_t)
+#define DECL_redc_2(name) \
+ __GMP_DECLSPEC mp_limb_t name (mp_ptr, mp_ptr, mp_srcptr, mp_size_t, mp_srcptr)
+#define DECL_rshift(name) \
+ DECL_lshift (name)
+#define DECL_sqr_basecase(name) \
+ __GMP_DECLSPEC void name (mp_ptr, mp_srcptr, mp_size_t)
+#define DECL_sub_n(name) \
+ DECL_add_n (name)
+#define DECL_sublsh1_n(name) \
+ DECL_add_n (name)
+#define DECL_submul_1(name) \
+ DECL_addmul_1 (name)
+
+#if ! defined (__GMP_WITHIN_CONFIGURE)
+#include "config.h"
+#include "gmp-mparam.h"
+#include "fib_table.h"
+#include "fac_table.h"
+#include "mp_bases.h"
+#if WANT_FAT_BINARY
+#include "fat.h"
+#endif
+#endif
+
+#if HAVE_INTTYPES_H /* for uint_least32_t */
+# include <inttypes.h>
+#else
+# if HAVE_STDINT_H
+# include <stdint.h>
+# endif
+#endif
+
+#ifdef __cplusplus
+#include <cstring> /* for strlen */
+#include <string> /* for std::string */
+#endif
+
+
+#ifndef WANT_TMP_DEBUG /* for TMP_ALLOC_LIMBS_2 and others */
+#define WANT_TMP_DEBUG 0
+#endif
+
+/* The following tries to get a good version of alloca. The tests are
+ adapted from autoconf AC_FUNC_ALLOCA, with a couple of additions.
+ Whether this succeeds is tested by GMP_FUNC_ALLOCA and HAVE_ALLOCA will
+ be setup appropriately.
+
+ ifndef alloca - a cpp define might already exist.
+ glibc <stdlib.h> includes <alloca.h> which uses GCC __builtin_alloca.
+ HP cc +Olibcalls adds a #define of alloca to __builtin_alloca.
+
+ GCC __builtin_alloca - preferred whenever available.
+
+ _AIX pragma - IBM compilers need a #pragma in "each module that needs to
+ use alloca". Pragma indented to protect pre-ANSI cpp's. _IBMR2 was
+ used in past versions of GMP, retained still in case it matters.
+
+ The autoconf manual says this pragma needs to be at the start of a C
+ file, apart from comments and preprocessor directives. Is that true?
+ xlc on aix 4.xxx doesn't seem to mind it being after prototypes etc
+ from gmp.h.
+*/
+
+#ifndef alloca
+# ifdef __GNUC__
+# define alloca __builtin_alloca
+# else
+# ifdef __DECC
+# define alloca(x) __ALLOCA(x)
+# else
+# ifdef _MSC_VER
+# include <malloc.h>
+# define alloca _alloca
+# else
+# if HAVE_ALLOCA_H
+# include <alloca.h>
+# else
+# if defined (_AIX) || defined (_IBMR2)
+ #pragma alloca
+# else
+ char *alloca ();
+# endif
+# endif
+# endif
+# endif
+# endif
+#endif
+
+
+/* if not provided by gmp-mparam.h */
+#ifndef GMP_LIMB_BYTES
+#define GMP_LIMB_BYTES SIZEOF_MP_LIMB_T
+#endif
+#ifndef GMP_LIMB_BITS
+#define GMP_LIMB_BITS (8 * SIZEOF_MP_LIMB_T)
+#endif
+
+#define BITS_PER_ULONG (8 * SIZEOF_UNSIGNED_LONG)
+
+
+/* gmp_uint_least32_t is an unsigned integer type with at least 32 bits. */
+#if HAVE_UINT_LEAST32_T
+typedef uint_least32_t gmp_uint_least32_t;
+#else
+#if SIZEOF_UNSIGNED_SHORT >= 4
+typedef unsigned short gmp_uint_least32_t;
+#else
+#if SIZEOF_UNSIGNED >= 4
+typedef unsigned gmp_uint_least32_t;
+#else
+typedef unsigned long gmp_uint_least32_t;
+#endif
+#endif
+#endif
+
+
+/* gmp_intptr_t, for pointer to integer casts */
+#if HAVE_INTPTR_T
+typedef intptr_t gmp_intptr_t;
+#else /* fallback */
+typedef size_t gmp_intptr_t;
+#endif
+
+
+/* pre-inverse types for truncating division and modulo */
+typedef struct {mp_limb_t inv32;} gmp_pi1_t;
+typedef struct {mp_limb_t inv21, inv32, inv53;} gmp_pi2_t;
+
+
+/* "const" basically means a function does nothing but examine its arguments
+ and give a return value, it doesn't read or write any memory (neither
+ global nor pointed to by arguments), and has no other side-effects. This
+ is more restrictive than "pure". See info node "(gcc)Function
+ Attributes". __GMP_NO_ATTRIBUTE_CONST_PURE lets tune/common.c etc turn
+ this off when trying to write timing loops. */
+#if HAVE_ATTRIBUTE_CONST && ! defined (__GMP_NO_ATTRIBUTE_CONST_PURE)
+#define ATTRIBUTE_CONST __attribute__ ((const))
+#else
+#define ATTRIBUTE_CONST
+#endif
+
+#if HAVE_ATTRIBUTE_NORETURN
+#define ATTRIBUTE_NORETURN __attribute__ ((noreturn))
+#else
+#define ATTRIBUTE_NORETURN
+#endif
+
+/* "malloc" means a function behaves like malloc in that the pointer it
+ returns doesn't alias anything. */
+#if HAVE_ATTRIBUTE_MALLOC
+#define ATTRIBUTE_MALLOC __attribute__ ((malloc))
+#else
+#define ATTRIBUTE_MALLOC
+#endif
+
+
+#if ! HAVE_STRCHR
+#define strchr(s,c) index(s,c)
+#endif
+
+#if ! HAVE_MEMSET
+#define memset(p, c, n) \
+ do { \
+ ASSERT ((n) >= 0); \
+ char *__memset__p = (p); \
+ int __i; \
+ for (__i = 0; __i < (n); __i++) \
+ __memset__p[__i] = (c); \
+ } while (0)
+#endif
+
+/* va_copy is standard in C99, and gcc provides __va_copy when in strict C89
+ mode. Falling back to a memcpy will give maximum portability, since it
+ works no matter whether va_list is a pointer, struct or array. */
+#if ! defined (va_copy) && defined (__va_copy)
+#define va_copy(dst,src) __va_copy(dst,src)
+#endif
+#if ! defined (va_copy)
+#define va_copy(dst,src) \
+ do { memcpy (&(dst), &(src), sizeof (va_list)); } while (0)
+#endif
+
+
+/* HAVE_HOST_CPU_alpha_CIX is 1 on an alpha with the CIX instructions
+ (ie. ctlz, ctpop, cttz). */
+#if HAVE_HOST_CPU_alphaev67 || HAVE_HOST_CPU_alphaev68 \
+ || HAVE_HOST_CPU_alphaev7
+#define HAVE_HOST_CPU_alpha_CIX 1
+#endif
+
+
+#if defined (__cplusplus)
+extern "C" {
+#endif
+
+
+/* Usage: TMP_DECL;
+ TMP_MARK;
+ ptr = TMP_ALLOC (bytes);
+ TMP_FREE;
+
+ Small allocations should use TMP_SALLOC, big allocations should use
+ TMP_BALLOC. Allocations that might be small or big should use TMP_ALLOC.
+
+ Functions that use just TMP_SALLOC should use TMP_SDECL, TMP_SMARK, and
+ TMP_SFREE.
+
+ TMP_DECL just declares a variable, but might be empty and so must be last
+ in a list of variables. TMP_MARK must be done before any TMP_ALLOC.
+ TMP_ALLOC(0) is not allowed. TMP_FREE doesn't need to be done if a
+ 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. */
+union tmp_align_t {
+ mp_limb_t l;
+ char *p;
+};
+#define __TMP_ALIGN sizeof (union tmp_align_t)
+
+/* Return "a" rounded upwards to a multiple of "m", if it isn't already.
+ "a" must be an unsigned type.
+ This is designed for use with a compile-time constant "m".
+ The POW2 case is expected to be usual, and gcc 3.0 and up recognises
+ "(-(8*n))%8" or the like is always zero, which means the rounding up in
+ the WANT_TMP_NOTREENTRANT version of TMP_ALLOC below will be a noop. */
+#define ROUND_UP_MULTIPLE(a,m) \
+ (POW2_P(m) ? (a) + (-(a))%(m) \
+ : (a)+(m)-1 - (((a)+(m)-1) % (m)))
+
+#if defined (WANT_TMP_ALLOCA) || defined (WANT_TMP_REENTRANT)
+struct tmp_reentrant_t {
+ struct tmp_reentrant_t *next;
+ size_t size; /* bytes, including header */
+};
+__GMP_DECLSPEC void *__gmp_tmp_reentrant_alloc (struct tmp_reentrant_t **, size_t) ATTRIBUTE_MALLOC;
+__GMP_DECLSPEC void __gmp_tmp_reentrant_free (struct tmp_reentrant_t *);
+#endif
+
+#if WANT_TMP_ALLOCA
+#define TMP_SDECL
+#define TMP_DECL struct tmp_reentrant_t *__tmp_marker
+#define TMP_SMARK
+#define TMP_MARK __tmp_marker = 0
+#define TMP_SALLOC(n) alloca(n)
+#define TMP_BALLOC(n) __gmp_tmp_reentrant_alloc (&__tmp_marker, n)
+#define TMP_ALLOC(n) \
+ (LIKELY ((n) < 65536) ? TMP_SALLOC(n) : TMP_BALLOC(n))
+#define TMP_SFREE
+#define TMP_FREE \
+ do { \
+ if (UNLIKELY (__tmp_marker != 0)) \
+ __gmp_tmp_reentrant_free (__tmp_marker); \
+ } while (0)
+#endif
+
+#if WANT_TMP_REENTRANT
+#define TMP_SDECL TMP_DECL
+#define TMP_DECL struct tmp_reentrant_t *__tmp_marker
+#define TMP_SMARK TMP_MARK
+#define TMP_MARK __tmp_marker = 0
+#define TMP_SALLOC(n) TMP_ALLOC(n)
+#define TMP_BALLOC(n) TMP_ALLOC(n)
+#define TMP_ALLOC(n) __gmp_tmp_reentrant_alloc (&__tmp_marker, n)
+#define TMP_SFREE TMP_FREE
+#define TMP_FREE __gmp_tmp_reentrant_free (__tmp_marker)
+#endif
+
+#if WANT_TMP_NOTREENTRANT
+struct tmp_marker
+{
+ struct tmp_stack *which_chunk;
+ void *alloc_point;
+};
+__GMP_DECLSPEC void *__gmp_tmp_alloc (unsigned long) ATTRIBUTE_MALLOC;
+__GMP_DECLSPEC void __gmp_tmp_mark (struct tmp_marker *);
+__GMP_DECLSPEC void __gmp_tmp_free (struct tmp_marker *);
+#define TMP_SDECL TMP_DECL
+#define TMP_DECL struct tmp_marker __tmp_marker
+#define TMP_SMARK TMP_MARK
+#define TMP_MARK __gmp_tmp_mark (&__tmp_marker)
+#define TMP_SALLOC(n) TMP_ALLOC(n)
+#define TMP_BALLOC(n) TMP_ALLOC(n)
+#define TMP_ALLOC(n) \
+ __gmp_tmp_alloc (ROUND_UP_MULTIPLE ((unsigned long) (n), __TMP_ALIGN))
+#define TMP_SFREE TMP_FREE
+#define TMP_FREE __gmp_tmp_free (&__tmp_marker)
+#endif
+
+#if WANT_TMP_DEBUG
+/* See tal-debug.c for some comments. */
+struct tmp_debug_t {
+ struct tmp_debug_entry_t *list;
+ const char *file;
+ int line;
+};
+struct tmp_debug_entry_t {
+ struct tmp_debug_entry_t *next;
+ char *block;
+ size_t size;
+};
+__GMP_DECLSPEC void __gmp_tmp_debug_mark (const char *, int, struct tmp_debug_t **,
+ struct tmp_debug_t *,
+ const char *, const char *);
+__GMP_DECLSPEC void *__gmp_tmp_debug_alloc (const char *, int, int,
+ struct tmp_debug_t **, const char *,
+ size_t) ATTRIBUTE_MALLOC;
+__GMP_DECLSPEC void __gmp_tmp_debug_free (const char *, int, int,
+ struct tmp_debug_t **,
+ const char *, const char *);
+#define TMP_SDECL TMP_DECL_NAME(__tmp_xmarker, "__tmp_marker")
+#define TMP_DECL TMP_DECL_NAME(__tmp_xmarker, "__tmp_marker")
+#define TMP_SMARK TMP_MARK_NAME(__tmp_xmarker, "__tmp_marker")
+#define TMP_MARK TMP_MARK_NAME(__tmp_xmarker, "__tmp_marker")
+#define TMP_SFREE TMP_FREE_NAME(__tmp_xmarker, "__tmp_marker")
+#define TMP_FREE TMP_FREE_NAME(__tmp_xmarker, "__tmp_marker")
+/* The marker variable is designed to provoke an uninitialized variable
+ warning from the compiler if TMP_FREE is used without a TMP_MARK.
+ __tmp_marker_inscope does the same for TMP_ALLOC. Runtime tests pick
+ these things up too. */
+#define TMP_DECL_NAME(marker, marker_name) \
+ int marker; \
+ int __tmp_marker_inscope; \
+ const char *__tmp_marker_name = marker_name; \
+ struct tmp_debug_t __tmp_marker_struct; \
+ /* don't demand NULL, just cast a zero */ \
+ struct tmp_debug_t *__tmp_marker = (struct tmp_debug_t *) 0
+#define TMP_MARK_NAME(marker, marker_name) \
+ do { \
+ marker = 1; \
+ __tmp_marker_inscope = 1; \
+ __gmp_tmp_debug_mark (ASSERT_FILE, ASSERT_LINE, \
+ &__tmp_marker, &__tmp_marker_struct, \
+ __tmp_marker_name, marker_name); \
+ } while (0)
+#define TMP_SALLOC(n) TMP_ALLOC(n)
+#define TMP_BALLOC(n) TMP_ALLOC(n)
+#define TMP_ALLOC(size) \
+ __gmp_tmp_debug_alloc (ASSERT_FILE, ASSERT_LINE, \
+ __tmp_marker_inscope, \
+ &__tmp_marker, __tmp_marker_name, size)
+#define TMP_FREE_NAME(marker, marker_name) \
+ do { \
+ __gmp_tmp_debug_free (ASSERT_FILE, ASSERT_LINE, \
+ marker, &__tmp_marker, \
+ __tmp_marker_name, marker_name); \
+ } while (0)
+#endif /* WANT_TMP_DEBUG */
+
+
+/* Allocating various types. */
+#define TMP_ALLOC_TYPE(n,type) ((type *) TMP_ALLOC ((n) * sizeof (type)))
+#define TMP_SALLOC_TYPE(n,type) ((type *) TMP_SALLOC ((n) * sizeof (type)))
+#define TMP_BALLOC_TYPE(n,type) ((type *) TMP_BALLOC ((n) * sizeof (type)))
+#define TMP_ALLOC_LIMBS(n) TMP_ALLOC_TYPE(n,mp_limb_t)
+#define TMP_SALLOC_LIMBS(n) TMP_SALLOC_TYPE(n,mp_limb_t)
+#define TMP_BALLOC_LIMBS(n) TMP_BALLOC_TYPE(n,mp_limb_t)
+#define TMP_ALLOC_MP_PTRS(n) TMP_ALLOC_TYPE(n,mp_ptr)
+#define TMP_SALLOC_MP_PTRS(n) TMP_SALLOC_TYPE(n,mp_ptr)
+#define TMP_BALLOC_MP_PTRS(n) TMP_BALLOC_TYPE(n,mp_ptr)
+
+/* It's more efficient to allocate one block than two. This is certainly
+ true of the malloc methods, but it can even be true of alloca if that
+ involves copying a chunk of stack (various RISCs), or a call to a stack
+ bounds check (mingw). In any case, when debugging keep separate blocks
+ so a redzoning malloc debugger can protect each individually. */
+#define TMP_ALLOC_LIMBS_2(xp,xsize, yp,ysize) \
+ do { \
+ if (WANT_TMP_DEBUG) \
+ { \
+ (xp) = TMP_ALLOC_LIMBS (xsize); \
+ (yp) = TMP_ALLOC_LIMBS (ysize); \
+ } \
+ else \
+ { \
+ (xp) = TMP_ALLOC_LIMBS ((xsize) + (ysize)); \
+ (yp) = (xp) + (xsize); \
+ } \
+ } while (0)
+
+
+/* From gmp.h, nicer names for internal use. */
+#define CRAY_Pragma(str) __GMP_CRAY_Pragma(str)
+#define MPN_CMP(result, xp, yp, size) __GMPN_CMP(result, xp, yp, size)
+#define LIKELY(cond) __GMP_LIKELY(cond)
+#define UNLIKELY(cond) __GMP_UNLIKELY(cond)
+
+#define ABS(x) ((x) >= 0 ? (x) : -(x))
+#define NEG_CAST(T,x) (- (__GMP_CAST (T, (x) + 1) - 1))
+#define ABS_CAST(T,x) ((x) >= 0 ? __GMP_CAST (T, x) : NEG_CAST (T,x))
+#undef MIN
+#define MIN(l,o) ((l) < (o) ? (l) : (o))
+#undef MAX
+#define MAX(h,i) ((h) > (i) ? (h) : (i))
+#define numberof(x) (sizeof (x) / sizeof ((x)[0]))
+
+/* Field access macros. */
+#define SIZ(x) ((x)->_mp_size)
+#define ABSIZ(x) ABS (SIZ (x))
+#define PTR(x) ((x)->_mp_d)
+#define EXP(x) ((x)->_mp_exp)
+#define PREC(x) ((x)->_mp_prec)
+#define ALLOC(x) ((x)->_mp_alloc)
+#define NUM(x) mpq_numref(x)
+#define DEN(x) mpq_denref(x)
+
+/* n-1 inverts any low zeros and the lowest one bit. If n&(n-1) leaves zero
+ then that lowest one bit must have been the only bit set. n==0 will
+ return true though, so avoid that. */
+#define POW2_P(n) (((n) & ((n) - 1)) == 0)
+
+/* This is intended for constant THRESHOLDs only, where the compiler
+ can completely fold the result. */
+#define LOG2C(n) \
+ (((n) >= 0x1) + ((n) >= 0x2) + ((n) >= 0x4) + ((n) >= 0x8) + \
+ ((n) >= 0x10) + ((n) >= 0x20) + ((n) >= 0x40) + ((n) >= 0x80) + \
+ ((n) >= 0x100) + ((n) >= 0x200) + ((n) >= 0x400) + ((n) >= 0x800) + \
+ ((n) >= 0x1000) + ((n) >= 0x2000) + ((n) >= 0x4000) + ((n) >= 0x8000))
+
+/* The "short" defines are a bit different because shorts are promoted to
+ ints by ~ or >> etc.
+
+ #ifndef's are used since on some systems (HP?) header files other than
+ limits.h setup these defines. We could forcibly #undef in that case, but
+ there seems no need to worry about that.
+
+ Now that we include <limits.h> we should be able to remove all this. */
+
+#ifndef ULONG_MAX
+#define ULONG_MAX __GMP_ULONG_MAX
+#endif
+#ifndef UINT_MAX
+#define UINT_MAX __GMP_UINT_MAX
+#endif
+#ifndef USHRT_MAX
+#define USHRT_MAX __GMP_USHRT_MAX
+#endif
+#define MP_LIMB_T_MAX (~ (mp_limb_t) 0)
+
+/* Must cast ULONG_MAX etc to unsigned long etc, since they might not be
+ unsigned on a K&R compiler. In particular the HP-UX 10 bundled K&R cc
+ treats the plain decimal values in <limits.h> as signed. */
+#define ULONG_HIGHBIT (ULONG_MAX ^ ((unsigned long) ULONG_MAX >> 1))
+#define UINT_HIGHBIT (UINT_MAX ^ ((unsigned) UINT_MAX >> 1))
+#define USHRT_HIGHBIT (USHRT_MAX ^ ((unsigned short) USHRT_MAX >> 1))
+#define GMP_LIMB_HIGHBIT (MP_LIMB_T_MAX ^ (MP_LIMB_T_MAX >> 1))
+
+#ifndef LONG_MIN
+#define LONG_MIN ((long) ULONG_HIGHBIT)
+#endif
+#ifndef LONG_MAX
+#define LONG_MAX (-(LONG_MIN+1))
+#endif
+
+#ifndef INT_MIN
+#define INT_MIN ((int) UINT_HIGHBIT)
+#endif
+#ifndef INT_MAX
+#define INT_MAX (-(INT_MIN+1))
+#endif
+
+#ifndef SHRT_MIN
+#define SHRT_MIN ((int) (short) USHRT_HIGHBIT)
+#endif
+#ifndef SHRT_MAX
+#define SHRT_MAX (-(SHRT_MIN+1))
+#endif
+
+#if __GMP_MP_SIZE_T_INT
+#define MP_SIZE_T_MAX INT_MAX
+#define MP_SIZE_T_MIN INT_MIN
+#else
+#define MP_SIZE_T_MAX LONG_MAX
+#define MP_SIZE_T_MIN LONG_MIN
+#endif
+
+/* mp_exp_t is the same as mp_size_t */
+#define MP_EXP_T_MAX MP_SIZE_T_MAX
+#define MP_EXP_T_MIN MP_SIZE_T_MIN
+
+#define LONG_HIGHBIT LONG_MIN
+#define INT_HIGHBIT INT_MIN
+#define SHRT_HIGHBIT SHRT_MIN
+
+
+#define GMP_NUMB_HIGHBIT (CNST_LIMB(1) << (GMP_NUMB_BITS-1))
+
+#if GMP_NAIL_BITS == 0
+#define GMP_NAIL_LOWBIT CNST_LIMB(0)
+#else
+#define GMP_NAIL_LOWBIT (CNST_LIMB(1) << GMP_NUMB_BITS)
+#endif
+
+#if GMP_NAIL_BITS != 0
+/* Set various *_THRESHOLD values to be used for nails. Thus we avoid using
+ code that has not yet been qualified. */
+
+#undef DC_DIV_QR_THRESHOLD
+#define DC_DIV_QR_THRESHOLD 50
+
+#undef DIVREM_1_NORM_THRESHOLD
+#undef DIVREM_1_UNNORM_THRESHOLD
+#undef MOD_1_NORM_THRESHOLD
+#undef MOD_1_UNNORM_THRESHOLD
+#undef USE_PREINV_DIVREM_1
+#undef DIVREM_2_THRESHOLD
+#undef DIVEXACT_1_THRESHOLD
+#define DIVREM_1_NORM_THRESHOLD MP_SIZE_T_MAX /* no preinv */
+#define DIVREM_1_UNNORM_THRESHOLD MP_SIZE_T_MAX /* no preinv */
+#define MOD_1_NORM_THRESHOLD MP_SIZE_T_MAX /* no preinv */
+#define MOD_1_UNNORM_THRESHOLD MP_SIZE_T_MAX /* no preinv */
+#define USE_PREINV_DIVREM_1 0 /* no preinv */
+#define DIVREM_2_THRESHOLD MP_SIZE_T_MAX /* no preinv */
+
+/* mpn/generic/mul_fft.c is not nails-capable. */
+#undef MUL_FFT_THRESHOLD
+#undef SQR_FFT_THRESHOLD
+#define MUL_FFT_THRESHOLD MP_SIZE_T_MAX
+#define SQR_FFT_THRESHOLD MP_SIZE_T_MAX
+#endif
+
+/* Swap macros. */
+
+#define MP_LIMB_T_SWAP(x, y) \
+ do { \
+ mp_limb_t __mp_limb_t_swap__tmp = (x); \
+ (x) = (y); \
+ (y) = __mp_limb_t_swap__tmp; \
+ } while (0)
+#define MP_SIZE_T_SWAP(x, y) \
+ do { \
+ mp_size_t __mp_size_t_swap__tmp = (x); \
+ (x) = (y); \
+ (y) = __mp_size_t_swap__tmp; \
+ } while (0)
+
+#define MP_PTR_SWAP(x, y) \
+ do { \
+ mp_ptr __mp_ptr_swap__tmp = (x); \
+ (x) = (y); \
+ (y) = __mp_ptr_swap__tmp; \
+ } while (0)
+#define MP_SRCPTR_SWAP(x, y) \
+ do { \
+ mp_srcptr __mp_srcptr_swap__tmp = (x); \
+ (x) = (y); \
+ (y) = __mp_srcptr_swap__tmp; \
+ } while (0)
+
+#define MPN_PTR_SWAP(xp,xs, yp,ys) \
+ do { \
+ MP_PTR_SWAP (xp, yp); \
+ MP_SIZE_T_SWAP (xs, ys); \
+ } while(0)
+#define MPN_SRCPTR_SWAP(xp,xs, yp,ys) \
+ do { \
+ MP_SRCPTR_SWAP (xp, yp); \
+ MP_SIZE_T_SWAP (xs, ys); \
+ } while(0)
+
+#define MPZ_PTR_SWAP(x, y) \
+ do { \
+ mpz_ptr __mpz_ptr_swap__tmp = (x); \
+ (x) = (y); \
+ (y) = __mpz_ptr_swap__tmp; \
+ } while (0)
+#define MPZ_SRCPTR_SWAP(x, y) \
+ do { \
+ mpz_srcptr __mpz_srcptr_swap__tmp = (x); \
+ (x) = (y); \
+ (y) = __mpz_srcptr_swap__tmp; \
+ } while (0)
+
+
+/* Enhancement: __gmp_allocate_func could have "__attribute__ ((malloc))",
+ but current gcc (3.0) doesn't seem to support that. */
+__GMP_DECLSPEC extern void * (*__gmp_allocate_func) (size_t);
+__GMP_DECLSPEC extern void * (*__gmp_reallocate_func) (void *, size_t, size_t);
+__GMP_DECLSPEC extern void (*__gmp_free_func) (void *, size_t);
+
+__GMP_DECLSPEC void *__gmp_default_allocate (size_t);
+__GMP_DECLSPEC void *__gmp_default_reallocate (void *, size_t, size_t);
+__GMP_DECLSPEC void __gmp_default_free (void *, size_t);
+
+#define __GMP_ALLOCATE_FUNC_TYPE(n,type) \
+ ((type *) (*__gmp_allocate_func) ((n) * sizeof (type)))
+#define __GMP_ALLOCATE_FUNC_LIMBS(n) __GMP_ALLOCATE_FUNC_TYPE (n, mp_limb_t)
+
+#define __GMP_REALLOCATE_FUNC_TYPE(p, old_size, new_size, type) \
+ ((type *) (*__gmp_reallocate_func) \
+ (p, (old_size) * sizeof (type), (new_size) * sizeof (type)))
+#define __GMP_REALLOCATE_FUNC_LIMBS(p, old_size, new_size) \
+ __GMP_REALLOCATE_FUNC_TYPE(p, old_size, new_size, mp_limb_t)
+
+#define __GMP_FREE_FUNC_TYPE(p,n,type) (*__gmp_free_func) (p, (n) * sizeof (type))
+#define __GMP_FREE_FUNC_LIMBS(p,n) __GMP_FREE_FUNC_TYPE (p, n, mp_limb_t)
+
+#define __GMP_REALLOCATE_FUNC_MAYBE(ptr, oldsize, newsize) \
+ do { \
+ if ((oldsize) != (newsize)) \
+ (ptr) = (*__gmp_reallocate_func) (ptr, oldsize, newsize); \
+ } while (0)
+
+#define __GMP_REALLOCATE_FUNC_MAYBE_TYPE(ptr, oldsize, newsize, type) \
+ do { \
+ if ((oldsize) != (newsize)) \
+ (ptr) = (type *) (*__gmp_reallocate_func) \
+ (ptr, (oldsize) * sizeof (type), (newsize) * sizeof (type)); \
+ } while (0)
+
+
+/* Dummy for non-gcc, code involving it will go dead. */
+#if ! defined (__GNUC__) || __GNUC__ < 2
+#define __builtin_constant_p(x) 0
+#endif
+
+
+/* In gcc 2.96 and up on i386, tail calls are optimized to jumps if the
+ stack usage is compatible. __attribute__ ((regparm (N))) helps by
+ putting leading parameters in registers, avoiding extra stack.
+
+ regparm cannot be used with calls going through the PLT, because the
+ binding code there may clobber the registers (%eax, %edx, %ecx) used for
+ the regparm parameters. Calls to local (ie. static) functions could
+ still use this, if we cared to differentiate locals and globals.
+
+ On athlon-unknown-freebsd4.9 with gcc 3.3.3, regparm cannot be used with
+ -p or -pg profiling, since that version of gcc doesn't realize the
+ .mcount calls will clobber the parameter registers. Other systems are
+ ok, like debian with glibc 2.3.2 (mcount doesn't clobber), but we don't
+ bother to try to detect this. regparm is only an optimization so we just
+ disable it when profiling (profiling being a slowdown anyway). */
+
+#if HAVE_HOST_CPU_FAMILY_x86 && __GMP_GNUC_PREREQ (2,96) && ! defined (PIC) \
+ && ! WANT_PROFILING_PROF && ! WANT_PROFILING_GPROF
+#define USE_LEADING_REGPARM 1
+#else
+#define USE_LEADING_REGPARM 0
+#endif
+
+/* Macros for altering parameter order according to regparm usage. */
+#if USE_LEADING_REGPARM
+#define REGPARM_2_1(a,b,x) x,a,b
+#define REGPARM_3_1(a,b,c,x) x,a,b,c
+#define REGPARM_ATTR(n) __attribute__ ((regparm (n)))
+#else
+#define REGPARM_2_1(a,b,x) a,b,x
+#define REGPARM_3_1(a,b,c,x) a,b,c,x
+#define REGPARM_ATTR(n)
+#endif
+
+
+/* ASM_L gives a local label for a gcc asm block, for use when temporary
+ local labels like "1:" might not be available, which is the case for
+ instance on the x86s (the SCO assembler doesn't support them).
+
+ The label generated is made unique by including "%=" which is a unique
+ number for each insn. This ensures the same name can be used in multiple
+ asm blocks, perhaps via a macro. Since jumps between asm blocks are not
+ allowed there's no need for a label to be usable outside a single
+ block. */
+
+#define ASM_L(name) LSYM_PREFIX "asm_%=_" #name
+
+
+#if defined (__GNUC__) && HAVE_HOST_CPU_FAMILY_x86
+#if 0
+/* FIXME: Check that these actually improve things.
+ FIXME: Need a cld after each std.
+ FIXME: Can't have inputs in clobbered registers, must describe them as
+ dummy outputs, and add volatile. */
+#define MPN_COPY_INCR(DST, SRC, N) \
+ __asm__ ("cld\n\trep\n\tmovsl" : : \
+ "D" (DST), "S" (SRC), "c" (N) : \
+ "cx", "di", "si", "memory")
+#define MPN_COPY_DECR(DST, SRC, N) \
+ __asm__ ("std\n\trep\n\tmovsl" : : \
+ "D" ((DST) + (N) - 1), "S" ((SRC) + (N) - 1), "c" (N) : \
+ "cx", "di", "si", "memory")
+#endif
+#endif
+
+
+__GMP_DECLSPEC void __gmpz_aorsmul_1 (REGPARM_3_1 (mpz_ptr, mpz_srcptr, mp_limb_t, mp_size_t)) REGPARM_ATTR(1);
+#define mpz_aorsmul_1(w,u,v,sub) __gmpz_aorsmul_1 (REGPARM_3_1 (w, u, v, sub))
+
+#define mpz_n_pow_ui __gmpz_n_pow_ui
+__GMP_DECLSPEC void mpz_n_pow_ui (mpz_ptr, mp_srcptr, mp_size_t, unsigned long);
+
+
+#define mpn_addmul_1c __MPN(addmul_1c)
+__GMP_DECLSPEC mp_limb_t mpn_addmul_1c (mp_ptr, mp_srcptr, mp_size_t, mp_limb_t, mp_limb_t);
+
+#ifndef mpn_addmul_2 /* if not done with cpuvec in a fat binary */
+#define mpn_addmul_2 __MPN(addmul_2)
+__GMP_DECLSPEC mp_limb_t mpn_addmul_2 (mp_ptr, mp_srcptr, mp_size_t, mp_srcptr);
+#endif
+
+#define mpn_addmul_3 __MPN(addmul_3)
+__GMP_DECLSPEC mp_limb_t mpn_addmul_3 (mp_ptr, mp_srcptr, mp_size_t, mp_srcptr);
+
+#define mpn_addmul_4 __MPN(addmul_4)
+__GMP_DECLSPEC mp_limb_t mpn_addmul_4 (mp_ptr, mp_srcptr, mp_size_t, mp_srcptr);
+
+#define mpn_addmul_5 __MPN(addmul_5)
+__GMP_DECLSPEC mp_limb_t mpn_addmul_5 (mp_ptr, mp_srcptr, mp_size_t, mp_srcptr);
+
+#define mpn_addmul_6 __MPN(addmul_6)
+__GMP_DECLSPEC mp_limb_t mpn_addmul_6 (mp_ptr, mp_srcptr, mp_size_t, mp_srcptr);
+
+#define mpn_addmul_7 __MPN(addmul_7)
+__GMP_DECLSPEC mp_limb_t mpn_addmul_7 (mp_ptr, mp_srcptr, mp_size_t, mp_srcptr);
+
+#define mpn_addmul_8 __MPN(addmul_8)
+__GMP_DECLSPEC mp_limb_t mpn_addmul_8 (mp_ptr, mp_srcptr, mp_size_t, mp_srcptr);
+
+/* Alternative entry point in mpn_addmul_2 for the benefit of mpn_sqr_basecase. */
+#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 */
+#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
+#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
+#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
+#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. */
+#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
+#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
+#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
+#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. */
+#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);
+#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
+#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
+#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. */
+#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
+#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
+#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
+#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. */
+#define mpn_sublsh2_n __MPN(sublsh2_n)
+__GMP_DECLSPEC mp_limb_t mpn_sublsh2_n (mp_ptr, mp_srcptr, mp_srcptr, mp_size_t);
+#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
+#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
+#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. */
+#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
+#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);
+#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
+#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_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)
+__GMP_DECLSPEC mp_limb_t mpn_rsh1sub_nc (mp_ptr, mp_srcptr, mp_srcptr, mp_size_t, mp_limb_t);
+
+#ifndef mpn_lshiftc /* if not done with cpuvec in a fat binary */
+#define mpn_lshiftc __MPN(lshiftc)
+__GMP_DECLSPEC mp_limb_t mpn_lshiftc (mp_ptr, mp_srcptr, mp_size_t, unsigned int);
+#endif
+
+#define mpn_add_err1_n __MPN(add_err1_n)
+__GMP_DECLSPEC mp_limb_t mpn_add_err1_n (mp_ptr, mp_srcptr, mp_srcptr, mp_ptr, mp_srcptr, mp_size_t, mp_limb_t);
+
+#define mpn_add_err2_n __MPN(add_err2_n)
+__GMP_DECLSPEC mp_limb_t mpn_add_err2_n (mp_ptr, mp_srcptr, mp_srcptr, mp_ptr, mp_srcptr, mp_srcptr, mp_size_t, mp_limb_t);
+
+#define mpn_add_err3_n __MPN(add_err3_n)
+__GMP_DECLSPEC mp_limb_t mpn_add_err3_n (mp_ptr, mp_srcptr, mp_srcptr, mp_ptr, mp_srcptr, mp_srcptr, mp_srcptr, mp_size_t, mp_limb_t);
+
+#define mpn_sub_err1_n __MPN(sub_err1_n)
+__GMP_DECLSPEC mp_limb_t mpn_sub_err1_n (mp_ptr, mp_srcptr, mp_srcptr, mp_ptr, mp_srcptr, mp_size_t, mp_limb_t);
+
+#define mpn_sub_err2_n __MPN(sub_err2_n)
+__GMP_DECLSPEC mp_limb_t mpn_sub_err2_n (mp_ptr, mp_srcptr, mp_srcptr, mp_ptr, mp_srcptr, mp_srcptr, mp_size_t, mp_limb_t);
+
+#define mpn_sub_err3_n __MPN(sub_err3_n)
+__GMP_DECLSPEC mp_limb_t mpn_sub_err3_n (mp_ptr, mp_srcptr, mp_srcptr, mp_ptr, mp_srcptr, mp_srcptr, mp_srcptr, mp_size_t, mp_limb_t);
+
+#define mpn_add_n_sub_n __MPN(add_n_sub_n)
+__GMP_DECLSPEC mp_limb_t mpn_add_n_sub_n (mp_ptr, mp_ptr, mp_srcptr, mp_srcptr, mp_size_t);
+
+#define mpn_add_n_sub_nc __MPN(add_n_sub_nc)
+__GMP_DECLSPEC mp_limb_t mpn_add_n_sub_nc (mp_ptr, mp_ptr, mp_srcptr, mp_srcptr, mp_size_t, mp_limb_t);
+
+#define mpn_addaddmul_1msb0 __MPN(addaddmul_1msb0)
+__GMP_DECLSPEC mp_limb_t mpn_addaddmul_1msb0 (mp_ptr, mp_srcptr, mp_srcptr, mp_size_t, mp_limb_t, mp_limb_t);
+
+#define mpn_divrem_1c __MPN(divrem_1c)
+__GMP_DECLSPEC mp_limb_t mpn_divrem_1c (mp_ptr, mp_size_t, mp_srcptr, mp_size_t, mp_limb_t, mp_limb_t);
+
+#define mpn_dump __MPN(dump)
+__GMP_DECLSPEC void mpn_dump (mp_srcptr, mp_size_t);
+
+#define mpn_fib2_ui __MPN(fib2_ui)
+__GMP_DECLSPEC mp_size_t mpn_fib2_ui (mp_ptr, mp_ptr, unsigned long);
+
+/* Remap names of internal mpn functions. */
+#define __clz_tab __MPN(clz_tab)
+#define mpn_udiv_w_sdiv __MPN(udiv_w_sdiv)
+
+#define mpn_jacobi_base __MPN(jacobi_base)
+__GMP_DECLSPEC int mpn_jacobi_base (mp_limb_t, mp_limb_t, int) ATTRIBUTE_CONST;
+
+#define mpn_jacobi_2 __MPN(jacobi_2)
+__GMP_DECLSPEC int mpn_jacobi_2 (mp_srcptr, mp_srcptr, unsigned);
+
+#define mpn_jacobi_n __MPN(jacobi_n)
+__GMP_DECLSPEC int mpn_jacobi_n (mp_ptr, mp_ptr, mp_size_t, unsigned);
+
+#define mpn_mod_1c __MPN(mod_1c)
+__GMP_DECLSPEC mp_limb_t mpn_mod_1c (mp_srcptr, mp_size_t, mp_limb_t, mp_limb_t) __GMP_ATTRIBUTE_PURE;
+
+#define mpn_mul_1c __MPN(mul_1c)
+__GMP_DECLSPEC mp_limb_t mpn_mul_1c (mp_ptr, mp_srcptr, mp_size_t, mp_limb_t, mp_limb_t);
+
+#define mpn_mul_2 __MPN(mul_2)
+__GMP_DECLSPEC mp_limb_t mpn_mul_2 (mp_ptr, mp_srcptr, mp_size_t, mp_srcptr);
+
+#define mpn_mul_3 __MPN(mul_3)
+__GMP_DECLSPEC mp_limb_t mpn_mul_3 (mp_ptr, mp_srcptr, mp_size_t, mp_srcptr);
+
+#define mpn_mul_4 __MPN(mul_4)
+__GMP_DECLSPEC mp_limb_t mpn_mul_4 (mp_ptr, mp_srcptr, mp_size_t, mp_srcptr);
+
+#define mpn_mul_5 __MPN(mul_5)
+__GMP_DECLSPEC mp_limb_t mpn_mul_5 (mp_ptr, mp_srcptr, mp_size_t, mp_srcptr);
+
+#define mpn_mul_6 __MPN(mul_6)
+__GMP_DECLSPEC mp_limb_t mpn_mul_6 (mp_ptr, mp_srcptr, mp_size_t, mp_srcptr);
+
+#ifndef mpn_mul_basecase /* if not done with cpuvec in a fat binary */
+#define mpn_mul_basecase __MPN(mul_basecase)
+__GMP_DECLSPEC void mpn_mul_basecase (mp_ptr, mp_srcptr, mp_size_t, mp_srcptr, mp_size_t);
+#endif
+
+#define mpn_mullo_n __MPN(mullo_n)
+__GMP_DECLSPEC void mpn_mullo_n (mp_ptr, mp_srcptr, mp_srcptr, mp_size_t);
+
+#ifndef mpn_mullo_basecase /* if not done with cpuvec in a fat binary */
+#define mpn_mullo_basecase __MPN(mullo_basecase)
+__GMP_DECLSPEC void mpn_mullo_basecase (mp_ptr, mp_srcptr, mp_srcptr, mp_size_t);
+#endif
+
+#ifndef mpn_sqr_basecase /* if not done with cpuvec in a fat binary */
+#define mpn_sqr_basecase __MPN(sqr_basecase)
+__GMP_DECLSPEC void mpn_sqr_basecase (mp_ptr, mp_srcptr, mp_size_t);
+#endif
+
+#define mpn_mulmid_basecase __MPN(mulmid_basecase)
+__GMP_DECLSPEC void mpn_mulmid_basecase (mp_ptr, mp_srcptr, mp_size_t, mp_srcptr, mp_size_t);
+
+#define mpn_mulmid_n __MPN(mulmid_n)
+__GMP_DECLSPEC void mpn_mulmid_n (mp_ptr, mp_srcptr, mp_srcptr, mp_size_t);
+
+#define mpn_mulmid __MPN(mulmid)
+__GMP_DECLSPEC void mpn_mulmid (mp_ptr, mp_srcptr, mp_size_t, mp_srcptr, mp_size_t);
+
+#define mpn_submul_1c __MPN(submul_1c)
+__GMP_DECLSPEC mp_limb_t mpn_submul_1c (mp_ptr, mp_srcptr, mp_size_t, mp_limb_t, mp_limb_t);
+
+#ifndef mpn_redc_1 /* if not done with cpuvec in a fat binary */
+#define mpn_redc_1 __MPN(redc_1)
+__GMP_DECLSPEC mp_limb_t mpn_redc_1 (mp_ptr, mp_ptr, mp_srcptr, mp_size_t, mp_limb_t);
+#endif
+
+#ifndef mpn_redc_2 /* if not done with cpuvec in a fat binary */
+#define mpn_redc_2 __MPN(redc_2)
+__GMP_DECLSPEC mp_limb_t mpn_redc_2 (mp_ptr, mp_ptr, mp_srcptr, mp_size_t, mp_srcptr);
+#endif
+
+#define mpn_redc_n __MPN(redc_n)
+__GMP_DECLSPEC void mpn_redc_n (mp_ptr, mp_ptr, mp_srcptr, mp_size_t, mp_srcptr);
+
+
+#ifndef mpn_mod_1_1p_cps /* if not done with cpuvec in a fat binary */
+#define mpn_mod_1_1p_cps __MPN(mod_1_1p_cps)
+__GMP_DECLSPEC void mpn_mod_1_1p_cps (mp_limb_t [4], mp_limb_t);
+#endif
+#ifndef mpn_mod_1_1p /* if not done with cpuvec in a fat binary */
+#define mpn_mod_1_1p __MPN(mod_1_1p)
+__GMP_DECLSPEC mp_limb_t mpn_mod_1_1p (mp_srcptr, mp_size_t, mp_limb_t, const mp_limb_t [4]) __GMP_ATTRIBUTE_PURE;
+#endif
+
+#ifndef mpn_mod_1s_2p_cps /* if not done with cpuvec in a fat binary */
+#define mpn_mod_1s_2p_cps __MPN(mod_1s_2p_cps)
+__GMP_DECLSPEC void mpn_mod_1s_2p_cps (mp_limb_t [5], mp_limb_t);
+#endif
+#ifndef mpn_mod_1s_2p /* if not done with cpuvec in a fat binary */
+#define mpn_mod_1s_2p __MPN(mod_1s_2p)
+__GMP_DECLSPEC mp_limb_t mpn_mod_1s_2p (mp_srcptr, mp_size_t, mp_limb_t, const mp_limb_t [5]) __GMP_ATTRIBUTE_PURE;
+#endif
+
+#ifndef mpn_mod_1s_3p_cps /* if not done with cpuvec in a fat binary */
+#define mpn_mod_1s_3p_cps __MPN(mod_1s_3p_cps)
+__GMP_DECLSPEC void mpn_mod_1s_3p_cps (mp_limb_t [6], mp_limb_t);
+#endif
+#ifndef mpn_mod_1s_3p /* if not done with cpuvec in a fat binary */
+#define mpn_mod_1s_3p __MPN(mod_1s_3p)
+__GMP_DECLSPEC mp_limb_t mpn_mod_1s_3p (mp_srcptr, mp_size_t, mp_limb_t, const mp_limb_t [6]) __GMP_ATTRIBUTE_PURE;
+#endif
+
+#ifndef mpn_mod_1s_4p_cps /* if not done with cpuvec in a fat binary */
+#define mpn_mod_1s_4p_cps __MPN(mod_1s_4p_cps)
+__GMP_DECLSPEC void mpn_mod_1s_4p_cps (mp_limb_t [7], mp_limb_t);
+#endif
+#ifndef mpn_mod_1s_4p /* if not done with cpuvec in a fat binary */
+#define mpn_mod_1s_4p __MPN(mod_1s_4p)
+__GMP_DECLSPEC mp_limb_t mpn_mod_1s_4p (mp_srcptr, mp_size_t, mp_limb_t, const mp_limb_t [7]) __GMP_ATTRIBUTE_PURE;
+#endif
+
+#define mpn_bc_mulmod_bnm1 __MPN(bc_mulmod_bnm1)
+__GMP_DECLSPEC void mpn_bc_mulmod_bnm1 (mp_ptr, mp_srcptr, mp_srcptr, mp_size_t, mp_ptr);
+#define mpn_mulmod_bnm1 __MPN(mulmod_bnm1)
+__GMP_DECLSPEC void mpn_mulmod_bnm1 (mp_ptr, mp_size_t, mp_srcptr, mp_size_t, mp_srcptr, mp_size_t, mp_ptr);
+#define mpn_mulmod_bnm1_next_size __MPN(mulmod_bnm1_next_size)
+__GMP_DECLSPEC mp_size_t mpn_mulmod_bnm1_next_size (mp_size_t) ATTRIBUTE_CONST;
+static inline mp_size_t
+mpn_mulmod_bnm1_itch (mp_size_t rn, mp_size_t an, mp_size_t bn) {
+ mp_size_t n, itch;
+ n = rn >> 1;
+ itch = rn + 4 +
+ (an > n ? (bn > n ? rn : n) : 0);
+ return itch;
+}
+
+#define mpn_sqrmod_bnm1 __MPN(sqrmod_bnm1)
+__GMP_DECLSPEC void mpn_sqrmod_bnm1 (mp_ptr, mp_size_t, mp_srcptr, mp_size_t, mp_ptr);
+#define mpn_sqrmod_bnm1_next_size __MPN(sqrmod_bnm1_next_size)
+__GMP_DECLSPEC mp_size_t mpn_sqrmod_bnm1_next_size (mp_size_t) ATTRIBUTE_CONST;
+static inline mp_size_t
+mpn_sqrmod_bnm1_itch (mp_size_t rn, mp_size_t an) {
+ mp_size_t n, itch;
+ n = rn >> 1;
+ itch = rn + 3 +
+ (an > n ? an : 0);
+ return itch;
+}
+
+typedef __gmp_randstate_struct *gmp_randstate_ptr;
+typedef const __gmp_randstate_struct *gmp_randstate_srcptr;
+
+/* Pseudo-random number generator function pointers structure. */
+typedef struct {
+ void (*randseed_fn) (gmp_randstate_t, mpz_srcptr);
+ void (*randget_fn) (gmp_randstate_t, mp_ptr, unsigned long int);
+ void (*randclear_fn) (gmp_randstate_t);
+ void (*randiset_fn) (gmp_randstate_ptr, gmp_randstate_srcptr);
+} gmp_randfnptr_t;
+
+/* Macro to obtain a void pointer to the function pointers structure. */
+#define RNG_FNPTR(rstate) ((rstate)->_mp_algdata._mp_lc)
+
+/* Macro to obtain a pointer to the generator's state.
+ When used as a lvalue the rvalue needs to be cast to mp_ptr. */
+#define RNG_STATE(rstate) ((rstate)->_mp_seed->_mp_d)
+
+/* Write a given number of random bits to rp. */
+#define _gmp_rand(rp, state, bits) \
+ do { \
+ gmp_randstate_ptr __rstate = (state); \
+ (*((gmp_randfnptr_t *) RNG_FNPTR (__rstate))->randget_fn) \
+ (__rstate, rp, bits); \
+ } while (0)
+
+__GMP_DECLSPEC void __gmp_randinit_mt_noseed (gmp_randstate_t);
+
+
+/* __gmp_rands is the global state for the old-style random functions, and
+ is also used in the test programs (hence the __GMP_DECLSPEC).
+
+ There's no seeding here, so mpz_random etc will generate the same
+ sequence every time. This is not unlike the C library random functions
+ if you don't seed them, so perhaps it's acceptable. Digging up a seed
+ from /dev/random or the like would work on many systems, but might
+ encourage a false confidence, since it'd be pretty much impossible to do
+ something that would work reliably everywhere. In any case the new style
+ functions are recommended to applications which care about randomness, so
+ the old functions aren't too important. */
+
+__GMP_DECLSPEC extern char __gmp_rands_initialized;
+__GMP_DECLSPEC extern gmp_randstate_t __gmp_rands;
+
+#define RANDS \
+ ((__gmp_rands_initialized ? 0 \
+ : (__gmp_rands_initialized = 1, \
+ __gmp_randinit_mt_noseed (__gmp_rands), 0)), \
+ __gmp_rands)
+
+/* this is used by the test programs, to free memory */
+#define RANDS_CLEAR() \
+ do { \
+ if (__gmp_rands_initialized) \
+ { \
+ __gmp_rands_initialized = 0; \
+ gmp_randclear (__gmp_rands); \
+ } \
+ } while (0)
+
+
+/* For a threshold between algorithms A and B, size>=thresh is where B
+ should be used. Special value MP_SIZE_T_MAX means only ever use A, or
+ value 0 means only ever use B. The tests for these special values will
+ be compile-time constants, so the compiler should be able to eliminate
+ the code for the unwanted algorithm. */
+
+#if ! defined (__GNUC__) || __GNUC__ < 2
+#define ABOVE_THRESHOLD(size,thresh) \
+ ((thresh) == 0 \
+ || ((thresh) != MP_SIZE_T_MAX \
+ && (size) >= (thresh)))
+#else
+#define ABOVE_THRESHOLD(size,thresh) \
+ ((__builtin_constant_p (thresh) && (thresh) == 0) \
+ || (!(__builtin_constant_p (thresh) && (thresh) == MP_SIZE_T_MAX) \
+ && (size) >= (thresh)))
+#endif
+#define BELOW_THRESHOLD(size,thresh) (! ABOVE_THRESHOLD (size, thresh))
+
+#define MPN_TOOM22_MUL_MINSIZE 4
+#define MPN_TOOM2_SQR_MINSIZE 4
+
+#define MPN_TOOM33_MUL_MINSIZE 17
+#define MPN_TOOM3_SQR_MINSIZE 17
+
+#define MPN_TOOM44_MUL_MINSIZE 30
+#define MPN_TOOM4_SQR_MINSIZE 30
+
+#define MPN_TOOM6H_MUL_MINSIZE 46
+#define MPN_TOOM6_SQR_MINSIZE 46
+
+#define MPN_TOOM8H_MUL_MINSIZE 86
+#define MPN_TOOM8_SQR_MINSIZE 86
+
+#define MPN_TOOM32_MUL_MINSIZE 10
+#define MPN_TOOM42_MUL_MINSIZE 10
+#define MPN_TOOM43_MUL_MINSIZE 25
+#define MPN_TOOM53_MUL_MINSIZE 17
+#define MPN_TOOM54_MUL_MINSIZE 31
+#define MPN_TOOM63_MUL_MINSIZE 49
+
+#define MPN_TOOM42_MULMID_MINSIZE 4
+
+#define mpn_sqr_diagonal __MPN(sqr_diagonal)
+__GMP_DECLSPEC void mpn_sqr_diagonal (mp_ptr, mp_srcptr, mp_size_t);
+
+#define mpn_sqr_diag_addlsh1 __MPN(sqr_diag_addlsh1)
+__GMP_DECLSPEC void mpn_sqr_diag_addlsh1 (mp_ptr, mp_srcptr, mp_srcptr, mp_size_t);
+
+#define mpn_toom_interpolate_5pts __MPN(toom_interpolate_5pts)
+__GMP_DECLSPEC void mpn_toom_interpolate_5pts (mp_ptr, mp_ptr, mp_ptr, mp_size_t, mp_size_t, int, mp_limb_t);
+
+enum toom6_flags {toom6_all_pos = 0, toom6_vm1_neg = 1, toom6_vm2_neg = 2};
+#define mpn_toom_interpolate_6pts __MPN(toom_interpolate_6pts)
+__GMP_DECLSPEC void mpn_toom_interpolate_6pts (mp_ptr, mp_size_t, enum toom6_flags, mp_ptr, mp_ptr, mp_ptr, mp_size_t);
+
+enum toom7_flags { toom7_w1_neg = 1, toom7_w3_neg = 2 };
+#define mpn_toom_interpolate_7pts __MPN(toom_interpolate_7pts)
+__GMP_DECLSPEC void mpn_toom_interpolate_7pts (mp_ptr, mp_size_t, enum toom7_flags, mp_ptr, mp_ptr, mp_ptr, mp_ptr, mp_size_t, mp_ptr);
+
+#define mpn_toom_interpolate_8pts __MPN(toom_interpolate_8pts)
+__GMP_DECLSPEC void mpn_toom_interpolate_8pts (mp_ptr, mp_size_t, mp_ptr, mp_ptr, mp_size_t, mp_ptr);
+
+#define mpn_toom_interpolate_12pts __MPN(toom_interpolate_12pts)
+__GMP_DECLSPEC void mpn_toom_interpolate_12pts (mp_ptr, mp_ptr, mp_ptr, mp_ptr, mp_size_t, mp_size_t, int, mp_ptr);
+
+#define mpn_toom_interpolate_16pts __MPN(toom_interpolate_16pts)
+__GMP_DECLSPEC void mpn_toom_interpolate_16pts (mp_ptr, mp_ptr, mp_ptr, mp_ptr, mp_ptr, mp_size_t, mp_size_t, int, mp_ptr);
+
+#define mpn_toom_couple_handling __MPN(toom_couple_handling)
+__GMP_DECLSPEC void mpn_toom_couple_handling (mp_ptr, mp_size_t, mp_ptr, int, mp_size_t, int, int);
+
+#define mpn_toom_eval_dgr3_pm1 __MPN(toom_eval_dgr3_pm1)
+__GMP_DECLSPEC int mpn_toom_eval_dgr3_pm1 (mp_ptr, mp_ptr, mp_srcptr, mp_size_t, mp_size_t, mp_ptr);
+
+#define mpn_toom_eval_dgr3_pm2 __MPN(toom_eval_dgr3_pm2)
+__GMP_DECLSPEC int mpn_toom_eval_dgr3_pm2 (mp_ptr, mp_ptr, mp_srcptr, mp_size_t, mp_size_t, mp_ptr);
+
+#define mpn_toom_eval_pm1 __MPN(toom_eval_pm1)
+__GMP_DECLSPEC int mpn_toom_eval_pm1 (mp_ptr, mp_ptr, unsigned, mp_srcptr, mp_size_t, mp_size_t, mp_ptr);
+
+#define mpn_toom_eval_pm2 __MPN(toom_eval_pm2)
+__GMP_DECLSPEC int mpn_toom_eval_pm2 (mp_ptr, mp_ptr, unsigned, mp_srcptr, mp_size_t, mp_size_t, mp_ptr);
+
+#define mpn_toom_eval_pm2exp __MPN(toom_eval_pm2exp)
+__GMP_DECLSPEC int mpn_toom_eval_pm2exp (mp_ptr, mp_ptr, unsigned, mp_srcptr, mp_size_t, mp_size_t, unsigned, mp_ptr);
+
+#define mpn_toom_eval_pm2rexp __MPN(toom_eval_pm2rexp)
+__GMP_DECLSPEC int mpn_toom_eval_pm2rexp (mp_ptr, mp_ptr, unsigned, mp_srcptr, mp_size_t, mp_size_t, unsigned, mp_ptr);
+
+#define mpn_toom22_mul __MPN(toom22_mul)
+__GMP_DECLSPEC void mpn_toom22_mul (mp_ptr, mp_srcptr, mp_size_t, mp_srcptr, mp_size_t, mp_ptr);
+
+#define mpn_toom32_mul __MPN(toom32_mul)
+__GMP_DECLSPEC void mpn_toom32_mul (mp_ptr, mp_srcptr, mp_size_t, mp_srcptr, mp_size_t, mp_ptr);
+
+#define mpn_toom42_mul __MPN(toom42_mul)
+__GMP_DECLSPEC void mpn_toom42_mul (mp_ptr, mp_srcptr, mp_size_t, mp_srcptr, mp_size_t, mp_ptr);
+
+#define mpn_toom52_mul __MPN(toom52_mul)
+__GMP_DECLSPEC void mpn_toom52_mul (mp_ptr, mp_srcptr, mp_size_t, mp_srcptr, mp_size_t, mp_ptr);
+
+#define mpn_toom62_mul __MPN(toom62_mul)
+__GMP_DECLSPEC void mpn_toom62_mul (mp_ptr, mp_srcptr, mp_size_t, mp_srcptr, mp_size_t, mp_ptr);
+
+#define mpn_toom2_sqr __MPN(toom2_sqr)
+__GMP_DECLSPEC void mpn_toom2_sqr (mp_ptr, mp_srcptr, mp_size_t, mp_ptr);
+
+#define mpn_toom33_mul __MPN(toom33_mul)
+__GMP_DECLSPEC void mpn_toom33_mul (mp_ptr, mp_srcptr, mp_size_t, mp_srcptr, mp_size_t, mp_ptr);
+
+#define mpn_toom43_mul __MPN(toom43_mul)
+__GMP_DECLSPEC void mpn_toom43_mul (mp_ptr, mp_srcptr, mp_size_t, mp_srcptr, mp_size_t, mp_ptr);
+
+#define mpn_toom53_mul __MPN(toom53_mul)
+__GMP_DECLSPEC void mpn_toom53_mul (mp_ptr, mp_srcptr, mp_size_t, mp_srcptr, mp_size_t, mp_ptr);
+
+#define mpn_toom54_mul __MPN(toom54_mul)
+__GMP_DECLSPEC void mpn_toom54_mul (mp_ptr, mp_srcptr, mp_size_t, mp_srcptr, mp_size_t, mp_ptr);
+
+#define mpn_toom63_mul __MPN(toom63_mul)
+__GMP_DECLSPEC void mpn_toom63_mul (mp_ptr, mp_srcptr, mp_size_t, mp_srcptr, mp_size_t, mp_ptr);
+
+#define mpn_toom3_sqr __MPN(toom3_sqr)
+__GMP_DECLSPEC void mpn_toom3_sqr (mp_ptr, mp_srcptr, mp_size_t, mp_ptr);
+
+#define mpn_toom44_mul __MPN(toom44_mul)
+__GMP_DECLSPEC void mpn_toom44_mul (mp_ptr, mp_srcptr, mp_size_t, mp_srcptr, mp_size_t, mp_ptr);
+
+#define mpn_toom4_sqr __MPN(toom4_sqr)
+__GMP_DECLSPEC void mpn_toom4_sqr (mp_ptr, mp_srcptr, mp_size_t, mp_ptr);
+
+#define mpn_toom6h_mul __MPN(toom6h_mul)
+__GMP_DECLSPEC void mpn_toom6h_mul (mp_ptr, mp_srcptr, mp_size_t, mp_srcptr, mp_size_t, mp_ptr);
+
+#define mpn_toom6_sqr __MPN(toom6_sqr)
+__GMP_DECLSPEC void mpn_toom6_sqr (mp_ptr, mp_srcptr, mp_size_t, mp_ptr);
+
+#define mpn_toom8h_mul __MPN(toom8h_mul)
+__GMP_DECLSPEC void mpn_toom8h_mul (mp_ptr, mp_srcptr, mp_size_t, mp_srcptr, mp_size_t, mp_ptr);
+
+#define mpn_toom8_sqr __MPN(toom8_sqr)
+__GMP_DECLSPEC void mpn_toom8_sqr (mp_ptr, mp_srcptr, mp_size_t, mp_ptr);
+
+#define mpn_toom42_mulmid __MPN(toom42_mulmid)
+__GMP_DECLSPEC void mpn_toom42_mulmid (mp_ptr, mp_srcptr, mp_srcptr, mp_size_t, mp_ptr);
+
+#define mpn_fft_best_k __MPN(fft_best_k)
+__GMP_DECLSPEC int mpn_fft_best_k (mp_size_t, int) ATTRIBUTE_CONST;
+
+#define mpn_mul_fft __MPN(mul_fft)
+__GMP_DECLSPEC mp_limb_t mpn_mul_fft (mp_ptr, mp_size_t, mp_srcptr, mp_size_t, mp_srcptr, mp_size_t, int);
+
+#define mpn_mul_fft_full __MPN(mul_fft_full)
+__GMP_DECLSPEC void mpn_mul_fft_full (mp_ptr, mp_srcptr, mp_size_t, mp_srcptr, mp_size_t);
+
+#define mpn_nussbaumer_mul __MPN(nussbaumer_mul)
+__GMP_DECLSPEC void mpn_nussbaumer_mul (mp_ptr, mp_srcptr, mp_size_t, mp_srcptr, mp_size_t);
+
+#define mpn_fft_next_size __MPN(fft_next_size)
+__GMP_DECLSPEC mp_size_t mpn_fft_next_size (mp_size_t, int) ATTRIBUTE_CONST;
+
+#define mpn_div_qr_1n_pi1 __MPN(div_qr_1n_pi1)
+ __GMP_DECLSPEC mp_limb_t mpn_div_qr_1n_pi1 (mp_ptr, mp_srcptr, mp_size_t, mp_limb_t, mp_limb_t, mp_limb_t);
+
+#define mpn_div_qr_2n_pi1 __MPN(div_qr_2n_pi1)
+ __GMP_DECLSPEC mp_limb_t mpn_div_qr_2n_pi1 (mp_ptr, mp_ptr, mp_srcptr, mp_size_t, mp_limb_t, mp_limb_t, mp_limb_t);
+
+#define mpn_div_qr_2u_pi1 __MPN(div_qr_2u_pi1)
+ __GMP_DECLSPEC mp_limb_t mpn_div_qr_2u_pi1 (mp_ptr, mp_ptr, mp_srcptr, mp_size_t, mp_limb_t, mp_limb_t, int, mp_limb_t);
+
+#define mpn_sbpi1_div_qr __MPN(sbpi1_div_qr)
+__GMP_DECLSPEC mp_limb_t mpn_sbpi1_div_qr (mp_ptr, mp_ptr, mp_size_t, mp_srcptr, mp_size_t, mp_limb_t);
+
+#define mpn_sbpi1_div_q __MPN(sbpi1_div_q)
+__GMP_DECLSPEC mp_limb_t mpn_sbpi1_div_q (mp_ptr, mp_ptr, mp_size_t, mp_srcptr, mp_size_t, mp_limb_t);
+
+#define mpn_sbpi1_divappr_q __MPN(sbpi1_divappr_q)
+__GMP_DECLSPEC mp_limb_t mpn_sbpi1_divappr_q (mp_ptr, mp_ptr, mp_size_t, mp_srcptr, mp_size_t, mp_limb_t);
+
+#define mpn_dcpi1_div_qr __MPN(dcpi1_div_qr)
+__GMP_DECLSPEC mp_limb_t mpn_dcpi1_div_qr (mp_ptr, mp_ptr, mp_size_t, mp_srcptr, mp_size_t, gmp_pi1_t *);
+#define mpn_dcpi1_div_qr_n __MPN(dcpi1_div_qr_n)
+__GMP_DECLSPEC mp_limb_t mpn_dcpi1_div_qr_n (mp_ptr, mp_ptr, mp_srcptr, mp_size_t, gmp_pi1_t *, mp_ptr);
+
+#define mpn_dcpi1_div_q __MPN(dcpi1_div_q)
+__GMP_DECLSPEC mp_limb_t mpn_dcpi1_div_q (mp_ptr, mp_ptr, mp_size_t, mp_srcptr, mp_size_t, gmp_pi1_t *);
+
+#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);
+#define mpn_preinv_mu_div_qr_itch __MPN(preinv_mu_div_qr_itch)
+__GMP_DECLSPEC mp_size_t mpn_preinv_mu_div_qr_itch (mp_size_t, mp_size_t, mp_size_t) ATTRIBUTE_CONST;
+
+#define mpn_mu_divappr_q __MPN(mu_divappr_q)
+__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)
+__GMP_DECLSPEC mp_size_t mpn_mu_div_q_itch (mp_size_t, mp_size_t, int) ATTRIBUTE_CONST;
+
+#define mpn_div_q __MPN(div_q)
+__GMP_DECLSPEC void mpn_div_q (mp_ptr, mp_srcptr, mp_size_t, mp_srcptr, mp_size_t, mp_ptr);
+
+#define mpn_invert __MPN(invert)
+__GMP_DECLSPEC void mpn_invert (mp_ptr, mp_srcptr, mp_size_t, mp_ptr);
+#define mpn_invert_itch(n) mpn_invertappr_itch(n)
+
+#define mpn_ni_invertappr __MPN(ni_invertappr)
+__GMP_DECLSPEC mp_limb_t mpn_ni_invertappr (mp_ptr, mp_srcptr, mp_size_t, mp_ptr);
+#define mpn_invertappr __MPN(invertappr)
+__GMP_DECLSPEC mp_limb_t mpn_invertappr (mp_ptr, mp_srcptr, mp_size_t, mp_ptr);
+#define mpn_invertappr_itch(n) (3 * (n) + 2)
+
+#define mpn_binvert __MPN(binvert)
+__GMP_DECLSPEC void mpn_binvert (mp_ptr, mp_srcptr, mp_size_t, mp_ptr);
+#define mpn_binvert_itch __MPN(binvert_itch)
+__GMP_DECLSPEC mp_size_t mpn_binvert_itch (mp_size_t) ATTRIBUTE_CONST;
+
+#define mpn_bdiv_q_1 __MPN(bdiv_q_1)
+__GMP_DECLSPEC mp_limb_t mpn_bdiv_q_1 (mp_ptr, mp_srcptr, mp_size_t, mp_limb_t);
+
+#define mpn_pi1_bdiv_q_1 __MPN(pi1_bdiv_q_1)
+__GMP_DECLSPEC mp_limb_t mpn_pi1_bdiv_q_1 (mp_ptr, mp_srcptr, mp_size_t, mp_limb_t, mp_limb_t, int);
+
+#define mpn_sbpi1_bdiv_qr __MPN(sbpi1_bdiv_qr)
+__GMP_DECLSPEC mp_limb_t mpn_sbpi1_bdiv_qr (mp_ptr, mp_ptr, mp_size_t, mp_srcptr, mp_size_t, mp_limb_t);
+
+#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_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)
+__GMP_DECLSPEC mp_size_t mpn_dcpi1_bdiv_qr_n_itch (mp_size_t) ATTRIBUTE_CONST;
+
+#define mpn_dcpi1_bdiv_qr_n __MPN(dcpi1_bdiv_qr_n)
+__GMP_DECLSPEC mp_limb_t mpn_dcpi1_bdiv_qr_n (mp_ptr, mp_ptr, mp_srcptr, mp_size_t, mp_limb_t, mp_ptr);
+#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)
+__GMP_DECLSPEC mp_size_t mpn_mu_bdiv_qr_itch (mp_size_t, mp_size_t) ATTRIBUTE_CONST;
+
+#define mpn_mu_bdiv_q __MPN(mu_bdiv_q)
+__GMP_DECLSPEC void mpn_mu_bdiv_q (mp_ptr, mp_srcptr, mp_size_t, mp_srcptr, mp_size_t, mp_ptr);
+#define mpn_mu_bdiv_q_itch __MPN(mu_bdiv_q_itch)
+__GMP_DECLSPEC mp_size_t mpn_mu_bdiv_q_itch (mp_size_t, mp_size_t) ATTRIBUTE_CONST;
+
+#define mpn_bdiv_qr __MPN(bdiv_qr)
+__GMP_DECLSPEC mp_limb_t mpn_bdiv_qr (mp_ptr, mp_ptr, mp_srcptr, mp_size_t, mp_srcptr, mp_size_t, mp_ptr);
+#define mpn_bdiv_qr_itch __MPN(bdiv_qr_itch)
+__GMP_DECLSPEC mp_size_t mpn_bdiv_qr_itch (mp_size_t, mp_size_t) ATTRIBUTE_CONST;
+
+#define mpn_bdiv_q __MPN(bdiv_q)
+__GMP_DECLSPEC void mpn_bdiv_q (mp_ptr, mp_srcptr, mp_size_t, mp_srcptr, mp_size_t, mp_ptr);
+#define mpn_bdiv_q_itch __MPN(bdiv_q_itch)
+__GMP_DECLSPEC mp_size_t mpn_bdiv_q_itch (mp_size_t, mp_size_t) ATTRIBUTE_CONST;
+
+#define mpn_divexact __MPN(divexact)
+__GMP_DECLSPEC void mpn_divexact (mp_ptr, mp_srcptr, mp_size_t, mp_srcptr, mp_size_t);
+#define mpn_divexact_itch __MPN(divexact_itch)
+__GMP_DECLSPEC mp_size_t mpn_divexact_itch (mp_size_t, mp_size_t) ATTRIBUTE_CONST;
+
+#ifndef mpn_bdiv_dbm1c /* if not done with cpuvec in a fat binary */
+#define mpn_bdiv_dbm1c __MPN(bdiv_dbm1c)
+__GMP_DECLSPEC mp_limb_t mpn_bdiv_dbm1c (mp_ptr, mp_srcptr, mp_size_t, mp_limb_t, mp_limb_t);
+#endif
+
+#define mpn_bdiv_dbm1(dst, src, size, divisor) \
+ mpn_bdiv_dbm1c (dst, src, size, divisor, __GMP_CAST (mp_limb_t, 0))
+
+#define mpn_powm __MPN(powm)
+__GMP_DECLSPEC void mpn_powm (mp_ptr, mp_srcptr, mp_size_t, mp_srcptr, mp_size_t, mp_srcptr, mp_size_t, mp_ptr);
+#define mpn_powlo __MPN(powlo)
+__GMP_DECLSPEC void mpn_powlo (mp_ptr, mp_srcptr, mp_srcptr, mp_size_t, mp_size_t, mp_ptr);
+
+#define mpn_sec_pi1_div_qr __MPN(sec_pi1_div_qr)
+__GMP_DECLSPEC mp_limb_t mpn_sec_pi1_div_qr (mp_ptr, mp_ptr, mp_size_t, mp_srcptr, mp_size_t, mp_limb_t, mp_ptr);
+#define mpn_sec_pi1_div_r __MPN(sec_pi1_div_r)
+__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 */
+#else
+#define DIVEXACT_BY3_METHOD 1
+#endif
+#endif
+
+#if DIVEXACT_BY3_METHOD == 0
+#undef mpn_divexact_by3
+#define mpn_divexact_by3(dst,src,size) \
+ (3 & mpn_bdiv_dbm1 (dst, src, size, __GMP_CAST (mp_limb_t, GMP_NUMB_MASK / 3)))
+/* override mpn_divexact_by3c defined in gmp.h */
+/*
+#undef mpn_divexact_by3c
+#define mpn_divexact_by3c(dst,src,size,cy) \
+ (3 & mpn_bdiv_dbm1c (dst, src, size, __GMP_CAST (mp_limb_t, GMP_NUMB_MASK / 3, GMP_NUMB_MASK / 3 * cy)))
+*/
+#endif
+
+#if GMP_NUMB_BITS % 4 == 0
+#define mpn_divexact_by5(dst,src,size) \
+ (7 & 3 * mpn_bdiv_dbm1 (dst, src, size, __GMP_CAST (mp_limb_t, GMP_NUMB_MASK / 5)))
+#endif
+
+#if GMP_NUMB_BITS % 3 == 0
+#define mpn_divexact_by7(dst,src,size) \
+ (7 & 1 * mpn_bdiv_dbm1 (dst, src, size, __GMP_CAST (mp_limb_t, GMP_NUMB_MASK / 7)))
+#endif
+
+#if GMP_NUMB_BITS % 6 == 0
+#define mpn_divexact_by9(dst,src,size) \
+ (15 & 7 * mpn_bdiv_dbm1 (dst, src, size, __GMP_CAST (mp_limb_t, GMP_NUMB_MASK / 9)))
+#endif
+
+#if GMP_NUMB_BITS % 10 == 0
+#define mpn_divexact_by11(dst,src,size) \
+ (15 & 5 * mpn_bdiv_dbm1 (dst, src, size, __GMP_CAST (mp_limb_t, GMP_NUMB_MASK / 11)))
+#endif
+
+#if GMP_NUMB_BITS % 12 == 0
+#define mpn_divexact_by13(dst,src,size) \
+ (15 & 3 * mpn_bdiv_dbm1 (dst, src, size, __GMP_CAST (mp_limb_t, GMP_NUMB_MASK / 13)))
+#endif
+
+#if GMP_NUMB_BITS % 4 == 0
+#define mpn_divexact_by15(dst,src,size) \
+ (15 & 1 * mpn_bdiv_dbm1 (dst, src, size, __GMP_CAST (mp_limb_t, GMP_NUMB_MASK / 15)))
+#endif
+
+#define mpz_divexact_gcd __gmpz_divexact_gcd
+__GMP_DECLSPEC void mpz_divexact_gcd (mpz_ptr, mpz_srcptr, mpz_srcptr);
+
+#define mpz_prodlimbs __gmpz_prodlimbs
+__GMP_DECLSPEC mp_size_t mpz_prodlimbs (mpz_ptr, mp_ptr, mp_size_t);
+
+#define mpz_oddfac_1 __gmpz_oddfac_1
+__GMP_DECLSPEC void mpz_oddfac_1 (mpz_ptr, mp_limb_t, unsigned);
+
+#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);
+#endif
+
+#define mpn_divisible_p __MPN(divisible_p)
+__GMP_DECLSPEC int mpn_divisible_p (mp_srcptr, mp_size_t, mp_srcptr, mp_size_t) __GMP_ATTRIBUTE_PURE;
+
+#define mpn_rootrem __MPN(rootrem)
+__GMP_DECLSPEC mp_size_t mpn_rootrem (mp_ptr, mp_ptr, mp_srcptr, mp_size_t, mp_limb_t);
+
+#define mpn_broot __MPN(broot)
+__GMP_DECLSPEC void mpn_broot (mp_ptr, mp_srcptr, mp_size_t, mp_limb_t);
+
+#define mpn_broot_invm1 __MPN(broot_invm1)
+__GMP_DECLSPEC void mpn_broot_invm1 (mp_ptr, mp_srcptr, mp_size_t, mp_limb_t);
+
+#define mpn_brootinv __MPN(brootinv)
+__GMP_DECLSPEC void mpn_brootinv (mp_ptr, mp_srcptr, mp_size_t, mp_limb_t, mp_ptr);
+
+#define mpn_bsqrt __MPN(bsqrt)
+__GMP_DECLSPEC void mpn_bsqrt (mp_ptr, mp_srcptr, mp_bitcnt_t, mp_ptr);
+
+#define mpn_bsqrtinv __MPN(bsqrtinv)
+__GMP_DECLSPEC int mpn_bsqrtinv (mp_ptr, mp_srcptr, mp_bitcnt_t, mp_ptr);
+
+#if defined (_CRAY)
+#define MPN_COPY_INCR(dst, src, n) \
+ do { \
+ int __i; /* Faster on some Crays with plain int */ \
+ _Pragma ("_CRI ivdep"); \
+ for (__i = 0; __i < (n); __i++) \
+ (dst)[__i] = (src)[__i]; \
+ } while (0)
+#endif
+
+/* used by test programs, hence __GMP_DECLSPEC */
+#ifndef mpn_copyi /* if not done with cpuvec in a fat binary */
+#define mpn_copyi __MPN(copyi)
+__GMP_DECLSPEC void mpn_copyi (mp_ptr, mp_srcptr, mp_size_t);
+#endif
+
+#if ! defined (MPN_COPY_INCR) && HAVE_NATIVE_mpn_copyi
+#define MPN_COPY_INCR(dst, src, size) \
+ do { \
+ ASSERT ((size) >= 0); \
+ ASSERT (MPN_SAME_OR_INCR_P (dst, src, size)); \
+ mpn_copyi (dst, src, size); \
+ } while (0)
+#endif
+
+/* Copy N limbs from SRC to DST incrementing, N==0 allowed. */
+#if ! defined (MPN_COPY_INCR)
+#define MPN_COPY_INCR(dst, src, n) \
+ do { \
+ ASSERT ((n) >= 0); \
+ ASSERT (MPN_SAME_OR_INCR_P (dst, src, n)); \
+ if ((n) != 0) \
+ { \
+ mp_size_t __n = (n) - 1; \
+ mp_ptr __dst = (dst); \
+ mp_srcptr __src = (src); \
+ mp_limb_t __x; \
+ __x = *__src++; \
+ if (__n != 0) \
+ { \
+ do \
+ { \
+ *__dst++ = __x; \
+ __x = *__src++; \
+ } \
+ while (--__n); \
+ } \
+ *__dst++ = __x; \
+ } \
+ } while (0)
+#endif
+
+
+#if defined (_CRAY)
+#define MPN_COPY_DECR(dst, src, n) \
+ do { \
+ int __i; /* Faster on some Crays with plain int */ \
+ _Pragma ("_CRI ivdep"); \
+ for (__i = (n) - 1; __i >= 0; __i--) \
+ (dst)[__i] = (src)[__i]; \
+ } while (0)
+#endif
+
+/* used by test programs, hence __GMP_DECLSPEC */
+#ifndef mpn_copyd /* if not done with cpuvec in a fat binary */
+#define mpn_copyd __MPN(copyd)
+__GMP_DECLSPEC void mpn_copyd (mp_ptr, mp_srcptr, mp_size_t);
+#endif
+
+#if ! defined (MPN_COPY_DECR) && HAVE_NATIVE_mpn_copyd
+#define MPN_COPY_DECR(dst, src, size) \
+ do { \
+ ASSERT ((size) >= 0); \
+ ASSERT (MPN_SAME_OR_DECR_P (dst, src, size)); \
+ mpn_copyd (dst, src, size); \
+ } while (0)
+#endif
+
+/* Copy N limbs from SRC to DST decrementing, N==0 allowed. */
+#if ! defined (MPN_COPY_DECR)
+#define MPN_COPY_DECR(dst, src, n) \
+ do { \
+ ASSERT ((n) >= 0); \
+ ASSERT (MPN_SAME_OR_DECR_P (dst, src, n)); \
+ if ((n) != 0) \
+ { \
+ mp_size_t __n = (n) - 1; \
+ mp_ptr __dst = (dst) + __n; \
+ mp_srcptr __src = (src) + __n; \
+ mp_limb_t __x; \
+ __x = *__src--; \
+ if (__n != 0) \
+ { \
+ do \
+ { \
+ *__dst-- = __x; \
+ __x = *__src--; \
+ } \
+ while (--__n); \
+ } \
+ *__dst-- = __x; \
+ } \
+ } while (0)
+#endif
+
+
+#ifndef MPN_COPY
+#define MPN_COPY(d,s,n) \
+ do { \
+ ASSERT (MPN_SAME_OR_SEPARATE_P (d, s, n)); \
+ MPN_COPY_INCR (d, s, n); \
+ } while (0)
+#endif
+
+
+/* Set {dst,size} to the limbs of {src,size} in reverse order. */
+#define MPN_REVERSE(dst, src, size) \
+ do { \
+ mp_ptr __dst = (dst); \
+ mp_size_t __size = (size); \
+ mp_srcptr __src = (src) + __size - 1; \
+ mp_size_t __i; \
+ ASSERT ((size) >= 0); \
+ ASSERT (! MPN_OVERLAP_P (dst, size, src, size)); \
+ CRAY_Pragma ("_CRI ivdep"); \
+ for (__i = 0; __i < __size; __i++) \
+ { \
+ *__dst = *__src; \
+ __dst++; \
+ __src--; \
+ } \
+ } while (0)
+
+
+/* Zero n limbs at dst.
+
+ For power and powerpc we want an inline stu/bdnz loop for zeroing. On
+ ppc630 for instance this is optimal since it can sustain only 1 store per
+ cycle.
+
+ gcc 2.95.x (for powerpc64 -maix64, or powerpc32) doesn't recognise the
+ "for" loop in the generic code below can become stu/bdnz. The do/while
+ here helps it get to that. The same caveat about plain -mpowerpc64 mode
+ applies here as to __GMPN_COPY_INCR in gmp.h.
+
+ xlc 3.1 already generates stu/bdnz from the generic C, and does so from
+ this loop too.
+
+ Enhancement: GLIBC does some trickery with dcbz to zero whole cache lines
+ at a time. MPN_ZERO isn't all that important in GMP, so it might be more
+ trouble than it's worth to do the same, though perhaps a call to memset
+ would be good when on a GNU system. */
+
+#if HAVE_HOST_CPU_FAMILY_power || HAVE_HOST_CPU_FAMILY_powerpc
+#define MPN_ZERO(dst, n) \
+ do { \
+ ASSERT ((n) >= 0); \
+ if ((n) != 0) \
+ { \
+ mp_ptr __dst = (dst) - 1; \
+ mp_size_t __n = (n); \
+ do \
+ *++__dst = 0; \
+ while (--__n); \
+ } \
+ } while (0)
+#endif
+
+#ifndef MPN_ZERO
+#define MPN_ZERO(dst, n) \
+ do { \
+ ASSERT ((n) >= 0); \
+ if ((n) != 0) \
+ { \
+ mp_ptr __dst = (dst); \
+ mp_size_t __n = (n); \
+ do \
+ *__dst++ = 0; \
+ while (--__n); \
+ } \
+ } while (0)
+#endif
+
+
+/* On the x86s repe/scasl doesn't seem useful, since it takes many cycles to
+ start up and would need to strip a lot of zeros before it'd be faster
+ than a simple cmpl loop. Here are some times in cycles for
+ std/repe/scasl/cld and cld/repe/scasl (the latter would be for stripping
+ low zeros).
+
+ std cld
+ P5 18 16
+ P6 46 38
+ K6 36 13
+ K7 21 20
+*/
+#ifndef MPN_NORMALIZE
+#define MPN_NORMALIZE(DST, NLIMBS) \
+ do { \
+ while ((NLIMBS) > 0) \
+ { \
+ if ((DST)[(NLIMBS) - 1] != 0) \
+ break; \
+ (NLIMBS)--; \
+ } \
+ } while (0)
+#endif
+#ifndef MPN_NORMALIZE_NOT_ZERO
+#define MPN_NORMALIZE_NOT_ZERO(DST, NLIMBS) \
+ do { \
+ while (1) \
+ { \
+ ASSERT ((NLIMBS) >= 1); \
+ if ((DST)[(NLIMBS) - 1] != 0) \
+ break; \
+ (NLIMBS)--; \
+ } \
+ } while (0)
+#endif
+
+/* Strip least significant zero limbs from {ptr,size} by incrementing ptr
+ and decrementing size. low should be ptr[0], and will be the new ptr[0]
+ on returning. The number in {ptr,size} must be non-zero, ie. size!=0 and
+ somewhere a non-zero limb. */
+#define MPN_STRIP_LOW_ZEROS_NOT_ZERO(ptr, size, low) \
+ do { \
+ ASSERT ((size) >= 1); \
+ ASSERT ((low) == (ptr)[0]); \
+ \
+ while ((low) == 0) \
+ { \
+ (size)--; \
+ ASSERT ((size) >= 1); \
+ (ptr)++; \
+ (low) = *(ptr); \
+ } \
+ } while (0)
+
+/* Initialize X of type mpz_t with space for NLIMBS limbs. X should be a
+ temporary variable; it will be automatically cleared out at function
+ return. We use __x here to make it possible to accept both mpz_ptr and
+ mpz_t arguments. */
+#define MPZ_TMP_INIT(X, NLIMBS) \
+ do { \
+ mpz_ptr __x = (X); \
+ ASSERT ((NLIMBS) >= 1); \
+ __x->_mp_alloc = (NLIMBS); \
+ __x->_mp_d = TMP_ALLOC_LIMBS (NLIMBS); \
+ } while (0)
+
+#if WANT_ASSERT
+static inline void *
+_mpz_newalloc (mpz_ptr z, mp_size_t n)
+{
+ void * res = _mpz_realloc(z,n);
+ /* If we are checking the code, force a random change to limbs. */
+ ((mp_ptr) res)[0] = ~ ((mp_ptr) res)[ALLOC (z) - 1];
+ return res;
+}
+#else
+#define _mpz_newalloc _mpz_realloc
+#endif
+/* Realloc for an mpz_t WHAT if it has less than NEEDED limbs. */
+#define MPZ_REALLOC(z,n) (UNLIKELY ((n) > ALLOC(z)) \
+ ? (mp_ptr) _mpz_realloc(z,n) \
+ : PTR(z))
+#define MPZ_NEWALLOC(z,n) (UNLIKELY ((n) > ALLOC(z)) \
+ ? (mp_ptr) _mpz_newalloc(z,n) \
+ : PTR(z))
+
+#define MPZ_EQUAL_1_P(z) (SIZ(z)==1 && PTR(z)[0] == 1)
+
+
+/* MPN_FIB2_SIZE(n) is the size in limbs required by mpn_fib2_ui for fp and
+ f1p.
+
+ From Knuth vol 1 section 1.2.8, F[n] = phi^n/sqrt(5) rounded to the
+ nearest integer, where phi=(1+sqrt(5))/2 is the golden ratio. So the
+ number of bits required is n*log_2((1+sqrt(5))/2) = n*0.6942419.
+
+ The multiplier used is 23/32=0.71875 for efficient calculation on CPUs
+ without good floating point. There's +2 for rounding up, and a further
+ +2 since at the last step x limbs are doubled into a 2x+1 limb region
+ whereas the actual F[2k] value might be only 2x-1 limbs.
+
+ Note that a division is done first, since on a 32-bit system it's at
+ least conceivable to go right up to n==ULONG_MAX. (F[2^32-1] would be
+ about 380Mbytes, plus temporary workspace of about 1.2Gbytes here and
+ whatever a multiply of two 190Mbyte numbers takes.)
+
+ Enhancement: When GMP_NUMB_BITS is not a power of 2 the division could be
+ worked into the multiplier. */
+
+#define MPN_FIB2_SIZE(n) \
+ ((mp_size_t) ((n) / 32 * 23 / GMP_NUMB_BITS) + 4)
+
+
+/* FIB_TABLE(n) returns the Fibonacci number F[n]. Must have n in the range
+ -1 <= n <= FIB_TABLE_LIMIT (that constant in fib_table.h).
+
+ FIB_TABLE_LUCNUM_LIMIT (in fib_table.h) is the largest n for which L[n] =
+ F[n] + 2*F[n-1] fits in a limb. */
+
+__GMP_DECLSPEC extern const mp_limb_t __gmp_fib_table[];
+#define FIB_TABLE(n) (__gmp_fib_table[(n)+1])
+
+extern const mp_limb_t __gmp_oddfac_table[];
+extern const mp_limb_t __gmp_odd2fac_table[];
+extern const unsigned char __gmp_fac2cnt_table[];
+extern const mp_limb_t __gmp_limbroots_table[];
+
+/* n^log <= GMP_NUMB_MAX, a limb can store log factors less than n */
+static inline unsigned
+log_n_max (mp_limb_t n)
+{
+ unsigned log;
+ for (log = 8; n > __gmp_limbroots_table[log - 1]; log--);
+ return log;
+}
+
+#define SIEVESIZE 512 /* FIXME: Allow gmp_init_primesieve to choose */
+typedef struct
+{
+ unsigned long d; /* current index in s[] */
+ unsigned long s0; /* number corresponding to s[0] */
+ unsigned long sqrt_s0; /* misnomer for sqrt(s[SIEVESIZE-1]) */
+ unsigned char s[SIEVESIZE + 1]; /* sieve table */
+} gmp_primesieve_t;
+
+#define gmp_init_primesieve __gmp_init_primesieve
+__GMP_DECLSPEC void gmp_init_primesieve (gmp_primesieve_t *);
+
+#define gmp_nextprime __gmp_nextprime
+__GMP_DECLSPEC unsigned long int gmp_nextprime (gmp_primesieve_t *);
+
+#define gmp_primesieve __gmp_primesieve
+__GMP_DECLSPEC mp_limb_t gmp_primesieve (mp_ptr, mp_limb_t);
+
+
+#ifndef MUL_TOOM22_THRESHOLD
+#define MUL_TOOM22_THRESHOLD 30
+#endif
+
+#ifndef MUL_TOOM33_THRESHOLD
+#define MUL_TOOM33_THRESHOLD 100
+#endif
+
+#ifndef MUL_TOOM44_THRESHOLD
+#define MUL_TOOM44_THRESHOLD 300
+#endif
+
+#ifndef MUL_TOOM6H_THRESHOLD
+#define MUL_TOOM6H_THRESHOLD 350
+#endif
+
+#ifndef SQR_TOOM6_THRESHOLD
+#define SQR_TOOM6_THRESHOLD MUL_TOOM6H_THRESHOLD
+#endif
+
+#ifndef MUL_TOOM8H_THRESHOLD
+#define MUL_TOOM8H_THRESHOLD 450
+#endif
+
+#ifndef SQR_TOOM8_THRESHOLD
+#define SQR_TOOM8_THRESHOLD MUL_TOOM8H_THRESHOLD
+#endif
+
+#ifndef MUL_TOOM32_TO_TOOM43_THRESHOLD
+#define MUL_TOOM32_TO_TOOM43_THRESHOLD 100
+#endif
+
+#ifndef MUL_TOOM32_TO_TOOM53_THRESHOLD
+#define MUL_TOOM32_TO_TOOM53_THRESHOLD 110
+#endif
+
+#ifndef MUL_TOOM42_TO_TOOM53_THRESHOLD
+#define MUL_TOOM42_TO_TOOM53_THRESHOLD 100
+#endif
+
+#ifndef MUL_TOOM42_TO_TOOM63_THRESHOLD
+#define MUL_TOOM42_TO_TOOM63_THRESHOLD 110
+#endif
+
+#ifndef MUL_TOOM43_TO_TOOM54_THRESHOLD
+#define MUL_TOOM43_TO_TOOM54_THRESHOLD 150
+#endif
+
+/* MUL_TOOM22_THRESHOLD_LIMIT is the maximum for MUL_TOOM22_THRESHOLD. In a
+ normal build MUL_TOOM22_THRESHOLD is a constant and we use that. In a fat
+ binary or tune program build MUL_TOOM22_THRESHOLD is a variable and a
+ separate hard limit will have been defined. Similarly for TOOM3. */
+#ifndef MUL_TOOM22_THRESHOLD_LIMIT
+#define MUL_TOOM22_THRESHOLD_LIMIT MUL_TOOM22_THRESHOLD
+#endif
+#ifndef MUL_TOOM33_THRESHOLD_LIMIT
+#define MUL_TOOM33_THRESHOLD_LIMIT MUL_TOOM33_THRESHOLD
+#endif
+#ifndef MULLO_BASECASE_THRESHOLD_LIMIT
+#define MULLO_BASECASE_THRESHOLD_LIMIT MULLO_BASECASE_THRESHOLD
+#endif
+
+/* SQR_BASECASE_THRESHOLD is where mpn_sqr_basecase should take over from
+ mpn_mul_basecase. Default is to use mpn_sqr_basecase from 0. (Note that we
+ certainly always want it if there's a native assembler mpn_sqr_basecase.)
+
+ If it turns out that mpn_toom2_sqr becomes faster than mpn_mul_basecase
+ before mpn_sqr_basecase does, then SQR_BASECASE_THRESHOLD is the toom2
+ threshold and SQR_TOOM2_THRESHOLD is 0. This oddity arises more or less
+ because SQR_TOOM2_THRESHOLD represents the size up to which mpn_sqr_basecase
+ should be used, and that may be never. */
+
+#ifndef SQR_BASECASE_THRESHOLD
+#define SQR_BASECASE_THRESHOLD 0
+#endif
+
+#ifndef SQR_TOOM2_THRESHOLD
+#define SQR_TOOM2_THRESHOLD 50
+#endif
+
+#ifndef SQR_TOOM3_THRESHOLD
+#define SQR_TOOM3_THRESHOLD 120
+#endif
+
+#ifndef SQR_TOOM4_THRESHOLD
+#define SQR_TOOM4_THRESHOLD 400
+#endif
+
+/* See comments above about MUL_TOOM33_THRESHOLD_LIMIT. */
+#ifndef SQR_TOOM3_THRESHOLD_LIMIT
+#define SQR_TOOM3_THRESHOLD_LIMIT SQR_TOOM3_THRESHOLD
+#endif
+
+#ifndef MULMID_TOOM42_THRESHOLD
+#define MULMID_TOOM42_THRESHOLD MUL_TOOM22_THRESHOLD
+#endif
+
+#ifndef DC_DIV_QR_THRESHOLD
+#define DC_DIV_QR_THRESHOLD 50
+#endif
+
+#ifndef DC_DIVAPPR_Q_THRESHOLD
+#define DC_DIVAPPR_Q_THRESHOLD 200
+#endif
+
+#ifndef DC_BDIV_QR_THRESHOLD
+#define DC_BDIV_QR_THRESHOLD 50
+#endif
+
+#ifndef DC_BDIV_Q_THRESHOLD
+#define DC_BDIV_Q_THRESHOLD 180
+#endif
+
+#ifndef DIVEXACT_JEB_THRESHOLD
+#define DIVEXACT_JEB_THRESHOLD 25
+#endif
+
+#ifndef INV_MULMOD_BNM1_THRESHOLD
+#define INV_MULMOD_BNM1_THRESHOLD (5*MULMOD_BNM1_THRESHOLD)
+#endif
+
+#ifndef INV_APPR_THRESHOLD
+#define INV_APPR_THRESHOLD INV_NEWTON_THRESHOLD
+#endif
+
+#ifndef INV_NEWTON_THRESHOLD
+#define INV_NEWTON_THRESHOLD 200
+#endif
+
+#ifndef BINV_NEWTON_THRESHOLD
+#define BINV_NEWTON_THRESHOLD 300
+#endif
+
+#ifndef MU_DIVAPPR_Q_THRESHOLD
+#define MU_DIVAPPR_Q_THRESHOLD 2000
+#endif
+
+#ifndef MU_DIV_QR_THRESHOLD
+#define MU_DIV_QR_THRESHOLD 2000
+#endif
+
+#ifndef MUPI_DIV_QR_THRESHOLD
+#define MUPI_DIV_QR_THRESHOLD 200
+#endif
+
+#ifndef MU_BDIV_Q_THRESHOLD
+#define MU_BDIV_Q_THRESHOLD 2000
+#endif
+
+#ifndef MU_BDIV_QR_THRESHOLD
+#define MU_BDIV_QR_THRESHOLD 2000
+#endif
+
+#ifndef MULMOD_BNM1_THRESHOLD
+#define MULMOD_BNM1_THRESHOLD 16
+#endif
+
+#ifndef SQRMOD_BNM1_THRESHOLD
+#define SQRMOD_BNM1_THRESHOLD 16
+#endif
+
+#ifndef MUL_TO_MULMOD_BNM1_FOR_2NXN_THRESHOLD
+#define MUL_TO_MULMOD_BNM1_FOR_2NXN_THRESHOLD (INV_MULMOD_BNM1_THRESHOLD/2)
+#endif
+
+#if HAVE_NATIVE_mpn_addmul_2 || HAVE_NATIVE_mpn_redc_2
+
+#ifndef REDC_1_TO_REDC_2_THRESHOLD
+#define REDC_1_TO_REDC_2_THRESHOLD 15
+#endif
+#ifndef REDC_2_TO_REDC_N_THRESHOLD
+#define REDC_2_TO_REDC_N_THRESHOLD 100
+#endif
+
+#else
+
+#ifndef REDC_1_TO_REDC_N_THRESHOLD
+#define REDC_1_TO_REDC_N_THRESHOLD 100
+#endif
+
+#endif /* HAVE_NATIVE_mpn_addmul_2 || HAVE_NATIVE_mpn_redc_2 */
+
+
+/* First k to use for an FFT modF multiply. A modF FFT is an order
+ log(2^k)/log(2^(k-1)) algorithm, so k=3 is merely 1.5 like karatsuba,
+ whereas k=4 is 1.33 which is faster than toom3 at 1.485. */
+#define FFT_FIRST_K 4
+
+/* Threshold at which FFT should be used to do a modF NxN -> N multiply. */
+#ifndef MUL_FFT_MODF_THRESHOLD
+#define MUL_FFT_MODF_THRESHOLD (MUL_TOOM33_THRESHOLD * 3)
+#endif
+#ifndef SQR_FFT_MODF_THRESHOLD
+#define SQR_FFT_MODF_THRESHOLD (SQR_TOOM3_THRESHOLD * 3)
+#endif
+
+/* Threshold at which FFT should be used to do an NxN -> 2N multiply. This
+ will be a size where FFT is using k=7 or k=8, since an FFT-k used for an
+ NxN->2N multiply and not recursing into itself is an order
+ log(2^k)/log(2^(k-2)) algorithm, so it'll be at least k=7 at 1.39 which
+ is the first better than toom3. */
+#ifndef MUL_FFT_THRESHOLD
+#define MUL_FFT_THRESHOLD (MUL_FFT_MODF_THRESHOLD * 10)
+#endif
+#ifndef SQR_FFT_THRESHOLD
+#define SQR_FFT_THRESHOLD (SQR_FFT_MODF_THRESHOLD * 10)
+#endif
+
+/* Table of thresholds for successive modF FFT "k"s. The first entry is
+ where FFT_FIRST_K+1 should be used, the second FFT_FIRST_K+2,
+ etc. See mpn_fft_best_k(). */
+#ifndef MUL_FFT_TABLE
+#define MUL_FFT_TABLE \
+ { MUL_TOOM33_THRESHOLD * 4, /* k=5 */ \
+ MUL_TOOM33_THRESHOLD * 8, /* k=6 */ \
+ MUL_TOOM33_THRESHOLD * 16, /* k=7 */ \
+ MUL_TOOM33_THRESHOLD * 32, /* k=8 */ \
+ MUL_TOOM33_THRESHOLD * 96, /* k=9 */ \
+ MUL_TOOM33_THRESHOLD * 288, /* k=10 */ \
+ 0 }
+#endif
+#ifndef SQR_FFT_TABLE
+#define SQR_FFT_TABLE \
+ { SQR_TOOM3_THRESHOLD * 4, /* k=5 */ \
+ SQR_TOOM3_THRESHOLD * 8, /* k=6 */ \
+ SQR_TOOM3_THRESHOLD * 16, /* k=7 */ \
+ SQR_TOOM3_THRESHOLD * 32, /* k=8 */ \
+ SQR_TOOM3_THRESHOLD * 96, /* k=9 */ \
+ SQR_TOOM3_THRESHOLD * 288, /* k=10 */ \
+ 0 }
+#endif
+
+struct fft_table_nk
+{
+ unsigned int n:27;
+ unsigned int k:5;
+};
+
+#ifndef FFT_TABLE_ATTRS
+#define FFT_TABLE_ATTRS static const
+#endif
+
+#define MPN_FFT_TABLE_SIZE 16
+
+
+#ifndef DC_DIV_QR_THRESHOLD
+#define DC_DIV_QR_THRESHOLD (3 * MUL_TOOM22_THRESHOLD)
+#endif
+
+#ifndef GET_STR_DC_THRESHOLD
+#define GET_STR_DC_THRESHOLD 18
+#endif
+
+#ifndef GET_STR_PRECOMPUTE_THRESHOLD
+#define GET_STR_PRECOMPUTE_THRESHOLD 35
+#endif
+
+#ifndef SET_STR_DC_THRESHOLD
+#define SET_STR_DC_THRESHOLD 750
+#endif
+
+#ifndef SET_STR_PRECOMPUTE_THRESHOLD
+#define SET_STR_PRECOMPUTE_THRESHOLD 2000
+#endif
+
+#ifndef FAC_ODD_THRESHOLD
+#define FAC_ODD_THRESHOLD 35
+#endif
+
+#ifndef FAC_DSC_THRESHOLD
+#define FAC_DSC_THRESHOLD 400
+#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 MPN_OVERLAP_P(xp, xsize, yp, ysize) \
+ ((xp) + (xsize) > (yp) && (yp) + (ysize) > (xp))
+#define MEM_OVERLAP_P(xp, xsize, yp, ysize) \
+ ( (char *) (xp) + (xsize) > (char *) (yp) \
+ && (char *) (yp) + (ysize) > (char *) (xp))
+
+/* Return non-zero if xp,xsize and yp,ysize are either identical or not
+ overlapping. Return zero if they're partially overlapping. */
+#define MPN_SAME_OR_SEPARATE_P(xp, yp, size) \
+ MPN_SAME_OR_SEPARATE2_P(xp, size, yp, size)
+#define MPN_SAME_OR_SEPARATE2_P(xp, xsize, yp, ysize) \
+ ((xp) == (yp) || ! MPN_OVERLAP_P (xp, xsize, yp, ysize))
+
+/* Return non-zero if dst,dsize and src,ssize are either identical or
+ overlapping in a way suitable for an incrementing/decrementing algorithm.
+ Return zero if they're partially overlapping in an unsuitable fashion. */
+#define MPN_SAME_OR_INCR2_P(dst, dsize, src, ssize) \
+ ((dst) <= (src) || ! MPN_OVERLAP_P (dst, dsize, src, ssize))
+#define MPN_SAME_OR_INCR_P(dst, src, size) \
+ MPN_SAME_OR_INCR2_P(dst, size, src, size)
+#define MPN_SAME_OR_DECR2_P(dst, dsize, src, ssize) \
+ ((dst) >= (src) || ! MPN_OVERLAP_P (dst, dsize, src, ssize))
+#define MPN_SAME_OR_DECR_P(dst, src, size) \
+ MPN_SAME_OR_DECR2_P(dst, size, src, size)
+
+
+/* ASSERT() is a private assertion checking scheme, similar to <assert.h>.
+ ASSERT() does the check only if WANT_ASSERT is selected, ASSERT_ALWAYS()
+ does it always. Generally assertions are meant for development, but
+ might help when looking for a problem later too.
+
+ Note that strings shouldn't be used within the ASSERT expression,
+ eg. ASSERT(strcmp(s,"notgood")!=0), since the quotes upset the "expr"
+ used in the !HAVE_STRINGIZE case (ie. K&R). */
+
+#ifdef __LINE__
+#define ASSERT_LINE __LINE__
+#else
+#define ASSERT_LINE -1
+#endif
+
+#ifdef __FILE__
+#define ASSERT_FILE __FILE__
+#else
+#define ASSERT_FILE ""
+#endif
+
+__GMP_DECLSPEC void __gmp_assert_header (const char *, int);
+__GMP_DECLSPEC void __gmp_assert_fail (const char *, int, const char *) ATTRIBUTE_NORETURN;
+
+#if HAVE_STRINGIZE
+#define ASSERT_FAIL(expr) __gmp_assert_fail (ASSERT_FILE, ASSERT_LINE, #expr)
+#else
+#define ASSERT_FAIL(expr) __gmp_assert_fail (ASSERT_FILE, ASSERT_LINE, "expr")
+#endif
+
+#define ASSERT_ALWAYS(expr) \
+ do { \
+ if (UNLIKELY (!(expr))) \
+ ASSERT_FAIL (expr); \
+ } while (0)
+
+#if WANT_ASSERT
+#define ASSERT(expr) ASSERT_ALWAYS (expr)
+#else
+#define ASSERT(expr) do {} while (0)
+#endif
+
+
+/* ASSERT_CARRY checks the expression is non-zero, and ASSERT_NOCARRY checks
+ that it's zero. In both cases if assertion checking is disabled the
+ expression is still evaluated. These macros are meant for use with
+ routines like mpn_add_n() where the return value represents a carry or
+ whatever that should or shouldn't occur in some context. For example,
+ ASSERT_NOCARRY (mpn_add_n (rp, s1p, s2p, size)); */
+#if WANT_ASSERT
+#define ASSERT_CARRY(expr) ASSERT_ALWAYS ((expr) != 0)
+#define ASSERT_NOCARRY(expr) ASSERT_ALWAYS ((expr) == 0)
+#else
+#define ASSERT_CARRY(expr) (expr)
+#define ASSERT_NOCARRY(expr) (expr)
+#endif
+
+
+/* ASSERT_CODE includes code when assertion checking is wanted. This is the
+ same as writing "#if WANT_ASSERT", but more compact. */
+#if WANT_ASSERT
+#define ASSERT_CODE(expr) expr
+#else
+#define ASSERT_CODE(expr)
+#endif
+
+
+/* Test that an mpq_t is in fully canonical form. This can be used as
+ protection on routines like mpq_equal which give wrong results on
+ non-canonical inputs. */
+#if WANT_ASSERT
+#define ASSERT_MPQ_CANONICAL(q) \
+ do { \
+ ASSERT (q->_mp_den._mp_size > 0); \
+ if (q->_mp_num._mp_size == 0) \
+ { \
+ /* zero should be 0/1 */ \
+ ASSERT (mpz_cmp_ui (mpq_denref(q), 1L) == 0); \
+ } \
+ else \
+ { \
+ /* no common factors */ \
+ mpz_t __g; \
+ mpz_init (__g); \
+ mpz_gcd (__g, mpq_numref(q), mpq_denref(q)); \
+ ASSERT (mpz_cmp_ui (__g, 1) == 0); \
+ mpz_clear (__g); \
+ } \
+ } while (0)
+#else
+#define ASSERT_MPQ_CANONICAL(q) do {} while (0)
+#endif
+
+/* Check that the nail parts are zero. */
+#define ASSERT_ALWAYS_LIMB(limb) \
+ do { \
+ mp_limb_t __nail = (limb) & GMP_NAIL_MASK; \
+ ASSERT_ALWAYS (__nail == 0); \
+ } while (0)
+#define ASSERT_ALWAYS_MPN(ptr, size) \
+ do { \
+ /* let whole loop go dead when no nails */ \
+ if (GMP_NAIL_BITS != 0) \
+ { \
+ mp_size_t __i; \
+ for (__i = 0; __i < (size); __i++) \
+ ASSERT_ALWAYS_LIMB ((ptr)[__i]); \
+ } \
+ } while (0)
+#if WANT_ASSERT
+#define ASSERT_LIMB(limb) ASSERT_ALWAYS_LIMB (limb)
+#define ASSERT_MPN(ptr, size) ASSERT_ALWAYS_MPN (ptr, size)
+#else
+#define ASSERT_LIMB(limb) do {} while (0)
+#define ASSERT_MPN(ptr, size) do {} while (0)
+#endif
+
+
+/* Assert that an mpn region {ptr,size} is zero, or non-zero.
+ size==0 is allowed, and in that case {ptr,size} considered to be zero. */
+#if WANT_ASSERT
+#define ASSERT_MPN_ZERO_P(ptr,size) \
+ do { \
+ mp_size_t __i; \
+ ASSERT ((size) >= 0); \
+ for (__i = 0; __i < (size); __i++) \
+ ASSERT ((ptr)[__i] == 0); \
+ } while (0)
+#define ASSERT_MPN_NONZERO_P(ptr,size) \
+ do { \
+ mp_size_t __i; \
+ int __nonzero = 0; \
+ ASSERT ((size) >= 0); \
+ for (__i = 0; __i < (size); __i++) \
+ if ((ptr)[__i] != 0) \
+ { \
+ __nonzero = 1; \
+ break; \
+ } \
+ ASSERT (__nonzero); \
+ } while (0)
+#else
+#define ASSERT_MPN_ZERO_P(ptr,size) do {} while (0)
+#define ASSERT_MPN_NONZERO_P(ptr,size) do {} while (0)
+#endif
+
+
+#if ! HAVE_NATIVE_mpn_com
+#undef mpn_com
+#define mpn_com(d,s,n) \
+ do { \
+ mp_ptr __d = (d); \
+ mp_srcptr __s = (s); \
+ mp_size_t __n = (n); \
+ ASSERT (__n >= 1); \
+ ASSERT (MPN_SAME_OR_SEPARATE_P (__d, __s, __n)); \
+ do \
+ *__d++ = (~ *__s++) & GMP_NUMB_MASK; \
+ while (--__n); \
+ } while (0)
+#endif
+
+#define MPN_LOGOPS_N_INLINE(rp, up, vp, n, operation) \
+ do { \
+ mp_srcptr __up = (up); \
+ mp_srcptr __vp = (vp); \
+ mp_ptr __rp = (rp); \
+ mp_size_t __n = (n); \
+ mp_limb_t __a, __b; \
+ ASSERT (__n > 0); \
+ ASSERT (MPN_SAME_OR_SEPARATE_P (__rp, __up, __n)); \
+ ASSERT (MPN_SAME_OR_SEPARATE_P (__rp, __vp, __n)); \
+ __up += __n; \
+ __vp += __n; \
+ __rp += __n; \
+ __n = -__n; \
+ do { \
+ __a = __up[__n]; \
+ __b = __vp[__n]; \
+ __rp[__n] = operation; \
+ } while (++__n); \
+ } while (0)
+
+
+#if ! HAVE_NATIVE_mpn_and_n
+#undef mpn_and_n
+#define mpn_and_n(rp, up, vp, n) \
+ MPN_LOGOPS_N_INLINE (rp, up, vp, n, __a & __b)
+#endif
+
+#if ! HAVE_NATIVE_mpn_andn_n
+#undef mpn_andn_n
+#define mpn_andn_n(rp, up, vp, n) \
+ MPN_LOGOPS_N_INLINE (rp, up, vp, n, __a & ~__b)
+#endif
+
+#if ! HAVE_NATIVE_mpn_nand_n
+#undef mpn_nand_n
+#define mpn_nand_n(rp, up, vp, n) \
+ MPN_LOGOPS_N_INLINE (rp, up, vp, n, ~(__a & __b) & GMP_NUMB_MASK)
+#endif
+
+#if ! HAVE_NATIVE_mpn_ior_n
+#undef mpn_ior_n
+#define mpn_ior_n(rp, up, vp, n) \
+ MPN_LOGOPS_N_INLINE (rp, up, vp, n, __a | __b)
+#endif
+
+#if ! HAVE_NATIVE_mpn_iorn_n
+#undef mpn_iorn_n
+#define mpn_iorn_n(rp, up, vp, n) \
+ MPN_LOGOPS_N_INLINE (rp, up, vp, n, (__a | ~__b) & GMP_NUMB_MASK)
+#endif
+
+#if ! HAVE_NATIVE_mpn_nior_n
+#undef mpn_nior_n
+#define mpn_nior_n(rp, up, vp, n) \
+ MPN_LOGOPS_N_INLINE (rp, up, vp, n, ~(__a | __b) & GMP_NUMB_MASK)
+#endif
+
+#if ! HAVE_NATIVE_mpn_xor_n
+#undef mpn_xor_n
+#define mpn_xor_n(rp, up, vp, n) \
+ MPN_LOGOPS_N_INLINE (rp, up, vp, n, __a ^ __b)
+#endif
+
+#if ! HAVE_NATIVE_mpn_xnor_n
+#undef mpn_xnor_n
+#define mpn_xnor_n(rp, up, vp, n) \
+ MPN_LOGOPS_N_INLINE (rp, up, vp, n, ~(__a ^ __b) & GMP_NUMB_MASK)
+#endif
+
+#define mpn_trialdiv __MPN(trialdiv)
+__GMP_DECLSPEC mp_limb_t mpn_trialdiv (mp_srcptr, mp_size_t, mp_size_t, int *);
+
+#define mpn_remove __MPN(remove)
+__GMP_DECLSPEC mp_bitcnt_t mpn_remove (mp_ptr, mp_size_t *, mp_ptr, mp_size_t, mp_ptr, mp_size_t, mp_bitcnt_t);
+
+
+/* ADDC_LIMB sets w=x+y and cout to 0 or 1 for a carry from that addition. */
+#if GMP_NAIL_BITS == 0
+#define ADDC_LIMB(cout, w, x, y) \
+ do { \
+ mp_limb_t __x = (x); \
+ mp_limb_t __y = (y); \
+ mp_limb_t __w = __x + __y; \
+ (w) = __w; \
+ (cout) = __w < __x; \
+ } while (0)
+#else
+#define ADDC_LIMB(cout, w, x, y) \
+ do { \
+ mp_limb_t __w; \
+ ASSERT_LIMB (x); \
+ ASSERT_LIMB (y); \
+ __w = (x) + (y); \
+ (w) = __w & GMP_NUMB_MASK; \
+ (cout) = __w >> GMP_NUMB_BITS; \
+ } while (0)
+#endif
+
+/* SUBC_LIMB sets w=x-y and cout to 0 or 1 for a borrow from that
+ subtract. */
+#if GMP_NAIL_BITS == 0
+#define SUBC_LIMB(cout, w, x, y) \
+ do { \
+ mp_limb_t __x = (x); \
+ mp_limb_t __y = (y); \
+ mp_limb_t __w = __x - __y; \
+ (w) = __w; \
+ (cout) = __w > __x; \
+ } while (0)
+#else
+#define SUBC_LIMB(cout, w, x, y) \
+ do { \
+ mp_limb_t __w = (x) - (y); \
+ (w) = __w & GMP_NUMB_MASK; \
+ (cout) = __w >> (GMP_LIMB_BITS-1); \
+ } while (0)
+#endif
+
+
+/* MPN_INCR_U does {ptr,size} += n, MPN_DECR_U does {ptr,size} -= n, both
+ expecting no carry (or borrow) from that.
+
+ The size parameter is only for the benefit of assertion checking. In a
+ normal build it's unused and the carry/borrow is just propagated as far
+ as it needs to go.
+
+ On random data, usually only one or two limbs of {ptr,size} get updated,
+ so there's no need for any sophisticated looping, just something compact
+ and sensible.
+
+ FIXME: Switch all code from mpn_{incr,decr}_u to MPN_{INCR,DECR}_U,
+ declaring their operand sizes, then remove the former. This is purely
+ for the benefit of assertion checking. */
+
+#if defined (__GNUC__) && GMP_NAIL_BITS == 0 && ! defined (NO_ASM) \
+ && (defined(HAVE_HOST_CPU_FAMILY_x86) || defined(HAVE_HOST_CPU_FAMILY_x86_64)) \
+ && ! WANT_ASSERT
+/* Better flags handling than the generic C gives on i386, saving a few
+ bytes of code and maybe a cycle or two. */
+
+#define MPN_IORD_U(ptr, incr, aors) \
+ do { \
+ mp_ptr __ptr_dummy; \
+ if (__builtin_constant_p (incr) && (incr) == 0) \
+ { \
+ } \
+ else if (__builtin_constant_p (incr) && (incr) == 1) \
+ { \
+ __asm__ __volatile__ \
+ ("\n" ASM_L(top) ":\n" \
+ "\t" aors "\t$1, (%0)\n" \
+ "\tlea\t%c2(%0), %0\n" \
+ "\tjc\t" ASM_L(top) \
+ : "=r" (__ptr_dummy) \
+ : "0" (ptr), "n" (sizeof(mp_limb_t)) \
+ : "memory"); \
+ } \
+ else \
+ { \
+ __asm__ __volatile__ \
+ ( aors "\t%2, (%0)\n" \
+ "\tjnc\t" ASM_L(done) "\n" \
+ ASM_L(top) ":\n" \
+ "\t" aors "\t$1, %c3(%0)\n" \
+ "\tlea\t%c3(%0), %0\n" \
+ "\tjc\t" ASM_L(top) "\n" \
+ ASM_L(done) ":\n" \
+ : "=r" (__ptr_dummy) \
+ : "0" (ptr), \
+ "ri" ((mp_limb_t) (incr)), "n" (sizeof(mp_limb_t)) \
+ : "memory"); \
+ } \
+ } while (0)
+
+#if GMP_LIMB_BITS == 32
+#define MPN_INCR_U(ptr, size, incr) MPN_IORD_U (ptr, incr, "addl")
+#define MPN_DECR_U(ptr, size, incr) MPN_IORD_U (ptr, incr, "subl")
+#endif
+#if GMP_LIMB_BITS == 64
+#define MPN_INCR_U(ptr, size, incr) MPN_IORD_U (ptr, incr, "addq")
+#define MPN_DECR_U(ptr, size, incr) MPN_IORD_U (ptr, incr, "subq")
+#endif
+#define mpn_incr_u(ptr, incr) MPN_INCR_U (ptr, 0, incr)
+#define mpn_decr_u(ptr, incr) MPN_DECR_U (ptr, 0, incr)
+#endif
+
+#if GMP_NAIL_BITS == 0
+#ifndef mpn_incr_u
+#define mpn_incr_u(p,incr) \
+ do { \
+ mp_limb_t __x; \
+ mp_ptr __p = (p); \
+ if (__builtin_constant_p (incr) && (incr) == 1) \
+ { \
+ while (++(*(__p++)) == 0) \
+ ; \
+ } \
+ else \
+ { \
+ __x = *__p + (incr); \
+ *__p = __x; \
+ if (__x < (incr)) \
+ while (++(*(++__p)) == 0) \
+ ; \
+ } \
+ } while (0)
+#endif
+#ifndef mpn_decr_u
+#define mpn_decr_u(p,incr) \
+ do { \
+ mp_limb_t __x; \
+ mp_ptr __p = (p); \
+ if (__builtin_constant_p (incr) && (incr) == 1) \
+ { \
+ while ((*(__p++))-- == 0) \
+ ; \
+ } \
+ else \
+ { \
+ __x = *__p; \
+ *__p = __x - (incr); \
+ if (__x < (incr)) \
+ while ((*(++__p))-- == 0) \
+ ; \
+ } \
+ } while (0)
+#endif
+#endif
+
+#if GMP_NAIL_BITS >= 1
+#ifndef mpn_incr_u
+#define mpn_incr_u(p,incr) \
+ do { \
+ mp_limb_t __x; \
+ mp_ptr __p = (p); \
+ if (__builtin_constant_p (incr) && (incr) == 1) \
+ { \
+ do \
+ { \
+ __x = (*__p + 1) & GMP_NUMB_MASK; \
+ *__p++ = __x; \
+ } \
+ while (__x == 0); \
+ } \
+ else \
+ { \
+ __x = (*__p + (incr)); \
+ *__p++ = __x & GMP_NUMB_MASK; \
+ if (__x >> GMP_NUMB_BITS != 0) \
+ { \
+ do \
+ { \
+ __x = (*__p + 1) & GMP_NUMB_MASK; \
+ *__p++ = __x; \
+ } \
+ while (__x == 0); \
+ } \
+ } \
+ } while (0)
+#endif
+#ifndef mpn_decr_u
+#define mpn_decr_u(p,incr) \
+ do { \
+ mp_limb_t __x; \
+ mp_ptr __p = (p); \
+ if (__builtin_constant_p (incr) && (incr) == 1) \
+ { \
+ do \
+ { \
+ __x = *__p; \
+ *__p++ = (__x - 1) & GMP_NUMB_MASK; \
+ } \
+ while (__x == 0); \
+ } \
+ else \
+ { \
+ __x = *__p - (incr); \
+ *__p++ = __x & GMP_NUMB_MASK; \
+ if (__x >> GMP_NUMB_BITS != 0) \
+ { \
+ do \
+ { \
+ __x = *__p; \
+ *__p++ = (__x - 1) & GMP_NUMB_MASK; \
+ } \
+ while (__x == 0); \
+ } \
+ } \
+ } while (0)
+#endif
+#endif
+
+#ifndef MPN_INCR_U
+#if WANT_ASSERT
+#define MPN_INCR_U(ptr, size, n) \
+ do { \
+ ASSERT ((size) >= 1); \
+ ASSERT_NOCARRY (mpn_add_1 (ptr, ptr, size, n)); \
+ } while (0)
+#else
+#define MPN_INCR_U(ptr, size, n) mpn_incr_u (ptr, n)
+#endif
+#endif
+
+#ifndef MPN_DECR_U
+#if WANT_ASSERT
+#define MPN_DECR_U(ptr, size, n) \
+ do { \
+ ASSERT ((size) >= 1); \
+ ASSERT_NOCARRY (mpn_sub_1 (ptr, ptr, size, n)); \
+ } while (0)
+#else
+#define MPN_DECR_U(ptr, size, n) mpn_decr_u (ptr, n)
+#endif
+#endif
+
+
+/* Structure for conversion between internal binary format and strings. */
+struct bases
+{
+ /* Number of digits in the conversion base that always fits in an mp_limb_t.
+ For example, for base 10 on a machine where a mp_limb_t has 32 bits this
+ is 9, since 10**9 is the largest number that fits into a mp_limb_t. */
+ int chars_per_limb;
+
+ /* log(2)/log(conversion_base) */
+ mp_limb_t logb2;
+
+ /* log(conversion_base)/log(2) */
+ mp_limb_t log2b;
+
+ /* base**chars_per_limb, i.e. the biggest number that fits a word, built by
+ factors of base. Exception: For 2, 4, 8, etc, big_base is log2(base),
+ i.e. the number of bits used to represent each digit in the base. */
+ mp_limb_t big_base;
+
+ /* A GMP_LIMB_BITS bit approximation to 1/big_base, represented as a
+ fixed-point number. Instead of dividing by big_base an application can
+ choose to multiply by big_base_inverted. */
+ mp_limb_t big_base_inverted;
+};
+
+#define mp_bases __MPN(bases)
+__GMP_DECLSPEC extern const struct bases mp_bases[257];
+
+
+/* Compute the number of digits in base for nbits bits, making sure the result
+ is never too small. The two variants of the macro implement the same
+ function; the GT2 variant below works just for bases > 2. */
+#define DIGITS_IN_BASE_FROM_BITS(res, nbits, b) \
+ do { \
+ mp_limb_t _ph, _dummy; \
+ size_t _nbits = (nbits); \
+ umul_ppmm (_ph, _dummy, mp_bases[b].logb2, _nbits); \
+ _ph += (_dummy + _nbits < _dummy); \
+ res = _ph + 1; \
+ } while (0)
+#define DIGITS_IN_BASEGT2_FROM_BITS(res, nbits, b) \
+ do { \
+ mp_limb_t _ph, _dummy; \
+ size_t _nbits = (nbits); \
+ umul_ppmm (_ph, _dummy, mp_bases[b].logb2 + 1, _nbits); \
+ res = _ph + 1; \
+ } while (0)
+
+/* For power of 2 bases this is exact. For other bases the result is either
+ exact or one too big.
+
+ To be exact always it'd be necessary to examine all the limbs of the
+ operand, since numbers like 100..000 and 99...999 generally differ only
+ in the lowest limb. It'd be possible to examine just a couple of high
+ limbs to increase the probability of being exact, but that doesn't seem
+ worth bothering with. */
+
+#define MPN_SIZEINBASE(result, ptr, size, base) \
+ do { \
+ int __lb_base, __cnt; \
+ size_t __totbits; \
+ \
+ ASSERT ((size) >= 0); \
+ ASSERT ((base) >= 2); \
+ ASSERT ((base) < numberof (mp_bases)); \
+ \
+ /* Special case for X == 0. */ \
+ if ((size) == 0) \
+ (result) = 1; \
+ else \
+ { \
+ /* Calculate the total number of significant bits of X. */ \
+ count_leading_zeros (__cnt, (ptr)[(size)-1]); \
+ __totbits = (size_t) (size) * GMP_NUMB_BITS - (__cnt - GMP_NAIL_BITS);\
+ \
+ if (POW2_P (base)) \
+ { \
+ __lb_base = mp_bases[base].big_base; \
+ (result) = (__totbits + __lb_base - 1) / __lb_base; \
+ } \
+ else \
+ { \
+ DIGITS_IN_BASEGT2_FROM_BITS (result, __totbits, base); \
+ } \
+ } \
+ } while (0)
+
+#define MPN_SIZEINBASE_2EXP(result, ptr, size, base2exp) \
+ do { \
+ int __cnt; \
+ mp_bitcnt_t __totbits; \
+ ASSERT ((size) > 0); \
+ ASSERT ((ptr)[(size)-1] != 0); \
+ count_leading_zeros (__cnt, (ptr)[(size)-1]); \
+ __totbits = (mp_bitcnt_t) (size) * GMP_NUMB_BITS - (__cnt - GMP_NAIL_BITS); \
+ (result) = (__totbits + (base2exp)-1) / (base2exp); \
+ } while (0)
+
+
+/* bit count to limb count, rounding up */
+#define BITS_TO_LIMBS(n) (((n) + (GMP_NUMB_BITS - 1)) / GMP_NUMB_BITS)
+
+/* MPN_SET_UI sets an mpn (ptr, cnt) to given ui. MPZ_FAKE_UI creates fake
+ mpz_t from ui. The zp argument must have room for LIMBS_PER_ULONG limbs
+ in both cases (LIMBS_PER_ULONG is also defined here.) */
+#if BITS_PER_ULONG <= GMP_NUMB_BITS /* need one limb per ulong */
+
+#define LIMBS_PER_ULONG 1
+#define MPN_SET_UI(zp, zn, u) \
+ (zp)[0] = (u); \
+ (zn) = ((zp)[0] != 0);
+#define MPZ_FAKE_UI(z, zp, u) \
+ (zp)[0] = (u); \
+ PTR (z) = (zp); \
+ SIZ (z) = ((zp)[0] != 0); \
+ ASSERT_CODE (ALLOC (z) = 1);
+
+#else /* need two limbs per ulong */
+
+#define LIMBS_PER_ULONG 2
+#define MPN_SET_UI(zp, zn, u) \
+ (zp)[0] = (u) & GMP_NUMB_MASK; \
+ (zp)[1] = (u) >> GMP_NUMB_BITS; \
+ (zn) = ((zp)[1] != 0 ? 2 : (zp)[0] != 0 ? 1 : 0);
+#define MPZ_FAKE_UI(z, zp, u) \
+ (zp)[0] = (u) & GMP_NUMB_MASK; \
+ (zp)[1] = (u) >> GMP_NUMB_BITS; \
+ SIZ (z) = ((zp)[1] != 0 ? 2 : (zp)[0] != 0 ? 1 : 0); \
+ PTR (z) = (zp); \
+ ASSERT_CODE (ALLOC (z) = 2);
+
+#endif
+
+
+#if HAVE_HOST_CPU_FAMILY_x86
+#define TARGET_REGISTER_STARVED 1
+#else
+#define TARGET_REGISTER_STARVED 0
+#endif
+
+
+/* LIMB_HIGHBIT_TO_MASK(n) examines the high bit of a limb value and turns 1
+ or 0 there into a limb 0xFF..FF or 0 respectively.
+
+ On most CPUs this is just an arithmetic right shift by GMP_LIMB_BITS-1,
+ but C99 doesn't guarantee signed right shifts are arithmetic, so we have
+ a little compile-time test and a fallback to a "? :" form. The latter is
+ necessary for instance on Cray vector systems.
+
+ Recent versions of gcc (eg. 3.3) will in fact optimize a "? :" like this
+ to an arithmetic right shift anyway, but it's good to get the desired
+ shift on past versions too (in particular since an important use of
+ LIMB_HIGHBIT_TO_MASK is in udiv_qrnnd_preinv). */
+
+#define LIMB_HIGHBIT_TO_MASK(n) \
+ (((mp_limb_signed_t) -1 >> 1) < 0 \
+ ? (mp_limb_signed_t) (n) >> (GMP_LIMB_BITS - 1) \
+ : (n) & GMP_LIMB_HIGHBIT ? MP_LIMB_T_MAX : CNST_LIMB(0))
+
+
+/* Use a library function for invert_limb, if available. */
+#define mpn_invert_limb __MPN(invert_limb)
+__GMP_DECLSPEC mp_limb_t mpn_invert_limb (mp_limb_t) ATTRIBUTE_CONST;
+#if ! defined (invert_limb) && HAVE_NATIVE_mpn_invert_limb
+#define invert_limb(invxl,xl) \
+ do { \
+ (invxl) = mpn_invert_limb (xl); \
+ } while (0)
+#endif
+
+#ifndef invert_limb
+#define invert_limb(invxl,xl) \
+ do { \
+ mp_limb_t _dummy; \
+ ASSERT ((xl) != 0); \
+ udiv_qrnnd (invxl, _dummy, ~(xl), ~CNST_LIMB(0), xl); \
+ } while (0)
+#endif
+
+#define invert_pi1(dinv, d1, d0) \
+ do { \
+ mp_limb_t _v, _p, _t1, _t0, _mask; \
+ invert_limb (_v, d1); \
+ _p = (d1) * _v; \
+ _p += (d0); \
+ if (_p < (d0)) \
+ { \
+ _v--; \
+ _mask = -(mp_limb_t) (_p >= (d1)); \
+ _p -= (d1); \
+ _v += _mask; \
+ _p -= _mask & (d1); \
+ } \
+ umul_ppmm (_t1, _t0, d0, _v); \
+ _p += _t1; \
+ if (_p < _t1) \
+ { \
+ _v--; \
+ if (UNLIKELY (_p >= (d1))) \
+ { \
+ if (_p > (d1) || _t0 >= (d0)) \
+ _v--; \
+ } \
+ } \
+ (dinv).inv32 = _v; \
+ } while (0)
+
+
+/* udiv_qrnnd_preinv -- Based on work by Niels Möller and Torbjörn Granlund.
+ We write things strangely below, to help gcc. A more straightforward
+ version:
+ _r = (nl) - _qh * (d);
+ _t = _r + (d);
+ if (_r >= _ql)
+ {
+ _qh--;
+ _r = _t;
+ }
+ For one operation shorter critical path, one may want to use this form:
+ _p = _qh * (d)
+ _s = (nl) + (d);
+ _r = (nl) - _p;
+ _t = _s - _p;
+ if (_r >= _ql)
+ {
+ _qh--;
+ _r = _t;
+ }
+*/
+#define udiv_qrnnd_preinv(q, r, nh, nl, d, di) \
+ do { \
+ mp_limb_t _qh, _ql, _r, _mask; \
+ umul_ppmm (_qh, _ql, (nh), (di)); \
+ if (__builtin_constant_p (nl) && (nl) == 0) \
+ { \
+ _qh += (nh) + 1; \
+ _r = - _qh * (d); \
+ _mask = -(mp_limb_t) (_r > _ql); /* both > and >= are OK */ \
+ _qh += _mask; \
+ _r += _mask & (d); \
+ } \
+ else \
+ { \
+ add_ssaaaa (_qh, _ql, _qh, _ql, (nh) + 1, (nl)); \
+ _r = (nl) - _qh * (d); \
+ _mask = -(mp_limb_t) (_r > _ql); /* both > and >= are OK */ \
+ _qh += _mask; \
+ _r += _mask & (d); \
+ if (UNLIKELY (_r >= (d))) \
+ { \
+ _r -= (d); \
+ _qh++; \
+ } \
+ } \
+ (r) = _r; \
+ (q) = _qh; \
+ } while (0)
+
+/* Dividing (NH, NL) by D, returning the remainder only. Unlike
+ udiv_qrnnd_preinv, works also for the case NH == D, where the
+ quotient doesn't quite fit in a single limb. */
+#define udiv_rnnd_preinv(r, nh, nl, d, di) \
+ do { \
+ mp_limb_t _qh, _ql, _r, _mask; \
+ umul_ppmm (_qh, _ql, (nh), (di)); \
+ if (__builtin_constant_p (nl) && (nl) == 0) \
+ { \
+ _r = ~(_qh + (nh)) * (d); \
+ _mask = -(mp_limb_t) (_r > _ql); /* both > and >= are OK */ \
+ _r += _mask & (d); \
+ } \
+ else \
+ { \
+ add_ssaaaa (_qh, _ql, _qh, _ql, (nh) + 1, (nl)); \
+ _r = (nl) - _qh * (d); \
+ _mask = -(mp_limb_t) (_r > _ql); /* both > and >= are OK */ \
+ _r += _mask & (d); \
+ if (UNLIKELY (_r >= (d))) \
+ _r -= (d); \
+ } \
+ (r) = _r; \
+ } while (0)
+
+/* Compute quotient the quotient and remainder for n / d. Requires d
+ >= B^2 / 2 and n < d B. di is the inverse
+
+ floor ((B^3 - 1) / (d0 + d1 B)) - B.
+
+ NOTE: Output variables are updated multiple times. Only some inputs
+ and outputs may overlap.
+*/
+#define udiv_qr_3by2(q, r1, r0, n2, n1, n0, d1, d0, dinv) \
+ do { \
+ mp_limb_t _q0, _t1, _t0, _mask; \
+ umul_ppmm ((q), _q0, (n2), (dinv)); \
+ add_ssaaaa ((q), _q0, (q), _q0, (n2), (n1)); \
+ \
+ /* Compute the two most significant limbs of n - q'd */ \
+ (r1) = (n1) - (d1) * (q); \
+ sub_ddmmss ((r1), (r0), (r1), (n0), (d1), (d0)); \
+ umul_ppmm (_t1, _t0, (d0), (q)); \
+ sub_ddmmss ((r1), (r0), (r1), (r0), _t1, _t0); \
+ (q)++; \
+ \
+ /* Conditionally adjust q and the remainders */ \
+ _mask = - (mp_limb_t) ((r1) >= _q0); \
+ (q) += _mask; \
+ add_ssaaaa ((r1), (r0), (r1), (r0), _mask & (d1), _mask & (d0)); \
+ if (UNLIKELY ((r1) >= (d1))) \
+ { \
+ if ((r1) > (d1) || (r0) >= (d0)) \
+ { \
+ (q)++; \
+ sub_ddmmss ((r1), (r0), (r1), (r0), (d1), (d0)); \
+ } \
+ } \
+ } while (0)
+
+#ifndef mpn_preinv_divrem_1 /* if not done with cpuvec in a fat binary */
+#define mpn_preinv_divrem_1 __MPN(preinv_divrem_1)
+__GMP_DECLSPEC mp_limb_t mpn_preinv_divrem_1 (mp_ptr, mp_size_t, mp_srcptr, mp_size_t, mp_limb_t, mp_limb_t, int);
+#endif
+
+
+/* USE_PREINV_DIVREM_1 is whether to use mpn_preinv_divrem_1, as opposed to the
+ plain mpn_divrem_1. The default is yes, since the few CISC chips where
+ preinv is not good have defines saying so. */
+#ifndef USE_PREINV_DIVREM_1
+#define USE_PREINV_DIVREM_1 1
+#endif
+
+#if USE_PREINV_DIVREM_1
+#define MPN_DIVREM_OR_PREINV_DIVREM_1(qp,xsize,ap,size,d,dinv,shift) \
+ mpn_preinv_divrem_1 (qp, xsize, ap, size, d, dinv, shift)
+#else
+#define MPN_DIVREM_OR_PREINV_DIVREM_1(qp,xsize,ap,size,d,dinv,shift) \
+ mpn_divrem_1 (qp, xsize, ap, size, d)
+#endif
+
+#ifndef PREINV_MOD_1_TO_MOD_1_THRESHOLD
+#define PREINV_MOD_1_TO_MOD_1_THRESHOLD 10
+#endif
+
+/* This selection may seem backwards. The reason mpn_mod_1 typically takes
+ over for larger sizes is that it uses the mod_1_1 function. */
+#define MPN_MOD_OR_PREINV_MOD_1(src,size,divisor,inverse) \
+ (BELOW_THRESHOLD (size, PREINV_MOD_1_TO_MOD_1_THRESHOLD) \
+ ? mpn_preinv_mod_1 (src, size, divisor, inverse) \
+ : mpn_mod_1 (src, size, divisor))
+
+
+#ifndef mpn_mod_34lsub1 /* if not done with cpuvec in a fat binary */
+#define mpn_mod_34lsub1 __MPN(mod_34lsub1)
+__GMP_DECLSPEC mp_limb_t mpn_mod_34lsub1 (mp_srcptr, mp_size_t) __GMP_ATTRIBUTE_PURE;
+#endif
+
+
+/* DIVEXACT_1_THRESHOLD is at what size to use mpn_divexact_1, as opposed to
+ plain mpn_divrem_1. Likewise BMOD_1_TO_MOD_1_THRESHOLD for
+ mpn_modexact_1_odd against plain mpn_mod_1. On most CPUs divexact and
+ modexact are faster at all sizes, so the defaults are 0. Those CPUs
+ where this is not right have a tuned threshold. */
+#ifndef DIVEXACT_1_THRESHOLD
+#define DIVEXACT_1_THRESHOLD 0
+#endif
+#ifndef BMOD_1_TO_MOD_1_THRESHOLD
+#define BMOD_1_TO_MOD_1_THRESHOLD 10
+#endif
+
+#ifndef mpn_divexact_1 /* if not done with cpuvec in a fat binary */
+#define mpn_divexact_1 __MPN(divexact_1)
+__GMP_DECLSPEC void mpn_divexact_1 (mp_ptr, mp_srcptr, mp_size_t, mp_limb_t);
+#endif
+
+#define MPN_DIVREM_OR_DIVEXACT_1(rp, up, n, d) \
+ do { \
+ if (BELOW_THRESHOLD (n, DIVEXACT_1_THRESHOLD)) \
+ ASSERT_NOCARRY (mpn_divrem_1 (rp, (mp_size_t) 0, up, n, d)); \
+ else \
+ { \
+ ASSERT (mpn_mod_1 (up, n, d) == 0); \
+ mpn_divexact_1 (rp, up, n, d); \
+ } \
+ } while (0)
+
+#ifndef mpn_modexact_1c_odd /* if not done with cpuvec in a fat binary */
+#define mpn_modexact_1c_odd __MPN(modexact_1c_odd)
+__GMP_DECLSPEC mp_limb_t mpn_modexact_1c_odd (mp_srcptr, mp_size_t, mp_limb_t, mp_limb_t) __GMP_ATTRIBUTE_PURE;
+#endif
+
+#if HAVE_NATIVE_mpn_modexact_1_odd
+#define mpn_modexact_1_odd __MPN(modexact_1_odd)
+__GMP_DECLSPEC mp_limb_t mpn_modexact_1_odd (mp_srcptr, mp_size_t, mp_limb_t) __GMP_ATTRIBUTE_PURE;
+#else
+#define mpn_modexact_1_odd(src,size,divisor) \
+ mpn_modexact_1c_odd (src, size, divisor, CNST_LIMB(0))
+#endif
+
+#define MPN_MOD_OR_MODEXACT_1_ODD(src,size,divisor) \
+ (BELOW_THRESHOLD (size, BMOD_1_TO_MOD_1_THRESHOLD) \
+ ? mpn_modexact_1_odd (src, size, divisor) \
+ : mpn_mod_1 (src, size, divisor))
+
+/* binvert_limb() sets inv to the multiplicative inverse of n modulo
+ 2^GMP_NUMB_BITS, ie. satisfying inv*n == 1 mod 2^GMP_NUMB_BITS.
+ n must be odd (otherwise such an inverse doesn't exist).
+
+ This is not to be confused with invert_limb(), which is completely
+ different.
+
+ The table lookup gives an inverse with the low 8 bits valid, and each
+ multiply step doubles the number of bits. See Jebelean "An algorithm for
+ exact division" end of section 4 (reference in gmp.texi).
+
+ Possible enhancement: Could use UHWtype until the last step, if half-size
+ multiplies are faster (might help under _LONG_LONG_LIMB).
+
+ Alternative: As noted in Granlund and Montgomery "Division by Invariant
+ Integers using Multiplication" (reference in gmp.texi), n itself gives a
+ 3-bit inverse immediately, and could be used instead of a table lookup.
+ A 4-bit inverse can be obtained effectively from xoring bits 1 and 2 into
+ bit 3, for instance with (((n + 2) & 4) << 1) ^ n. */
+
+#define binvert_limb_table __gmp_binvert_limb_table
+__GMP_DECLSPEC extern const unsigned char binvert_limb_table[128];
+
+#define binvert_limb(inv,n) \
+ do { \
+ mp_limb_t __n = (n); \
+ mp_limb_t __inv; \
+ ASSERT ((__n & 1) == 1); \
+ \
+ __inv = binvert_limb_table[(__n/2) & 0x7F]; /* 8 */ \
+ if (GMP_NUMB_BITS > 8) __inv = 2 * __inv - __inv * __inv * __n; \
+ if (GMP_NUMB_BITS > 16) __inv = 2 * __inv - __inv * __inv * __n; \
+ if (GMP_NUMB_BITS > 32) __inv = 2 * __inv - __inv * __inv * __n; \
+ \
+ if (GMP_NUMB_BITS > 64) \
+ { \
+ int __invbits = 64; \
+ do { \
+ __inv = 2 * __inv - __inv * __inv * __n; \
+ __invbits *= 2; \
+ } while (__invbits < GMP_NUMB_BITS); \
+ } \
+ \
+ ASSERT ((__inv * __n & GMP_NUMB_MASK) == 1); \
+ (inv) = __inv & GMP_NUMB_MASK; \
+ } while (0)
+#define modlimb_invert binvert_limb /* backward compatibility */
+
+/* Multiplicative inverse of 3, modulo 2^GMP_NUMB_BITS.
+ Eg. 0xAAAAAAAB for 32 bits, 0xAAAAAAAAAAAAAAAB for 64 bits.
+ GMP_NUMB_MAX/3*2+1 is right when GMP_NUMB_BITS is even, but when it's odd
+ we need to start from GMP_NUMB_MAX>>1. */
+#define MODLIMB_INVERSE_3 (((GMP_NUMB_MAX >> (GMP_NUMB_BITS % 2)) / 3) * 2 + 1)
+
+/* ceil(GMP_NUMB_MAX/3) and ceil(2*GMP_NUMB_MAX/3).
+ These expressions work because GMP_NUMB_MAX%3 != 0 for all GMP_NUMB_BITS. */
+#define GMP_NUMB_CEIL_MAX_DIV3 (GMP_NUMB_MAX / 3 + 1)
+#define GMP_NUMB_CEIL_2MAX_DIV3 ((GMP_NUMB_MAX>>1) / 3 + 1 + GMP_NUMB_HIGHBIT)
+
+
+/* Set r to -a mod d. a>=d is allowed. Can give r>d. All should be limbs.
+
+ It's not clear whether this is the best way to do this calculation.
+ Anything congruent to -a would be fine for the one limb congruence
+ tests. */
+
+#define NEG_MOD(r, a, d) \
+ do { \
+ ASSERT ((d) != 0); \
+ ASSERT_LIMB (a); \
+ ASSERT_LIMB (d); \
+ \
+ if ((a) <= (d)) \
+ { \
+ /* small a is reasonably likely */ \
+ (r) = (d) - (a); \
+ } \
+ else \
+ { \
+ unsigned __twos; \
+ mp_limb_t __dnorm; \
+ count_leading_zeros (__twos, d); \
+ __twos -= GMP_NAIL_BITS; \
+ __dnorm = (d) << __twos; \
+ (r) = ((a) <= __dnorm ? __dnorm : 2*__dnorm) - (a); \
+ } \
+ \
+ ASSERT_LIMB (r); \
+ } while (0)
+
+/* A bit mask of all the least significant zero bits of n, or -1 if n==0. */
+#define LOW_ZEROS_MASK(n) (((n) & -(n)) - 1)
+
+
+/* ULONG_PARITY sets "p" to 1 if there's an odd number of 1 bits in "n", or
+ to 0 if there's an even number. "n" should be an unsigned long and "p"
+ an int. */
+
+#if defined (__GNUC__) && ! defined (NO_ASM) && HAVE_HOST_CPU_alpha_CIX
+#define ULONG_PARITY(p, n) \
+ do { \
+ int __p; \
+ __asm__ ("ctpop %1, %0" : "=r" (__p) : "r" (n)); \
+ (p) = __p & 1; \
+ } while (0)
+#endif
+
+/* Cray intrinsic _popcnt. */
+#ifdef _CRAY
+#define ULONG_PARITY(p, n) \
+ do { \
+ (p) = _popcnt (n) & 1; \
+ } while (0)
+#endif
+
+#if defined (__GNUC__) && ! defined (__INTEL_COMPILER) \
+ && ! defined (NO_ASM) && defined (__ia64)
+/* unsigned long is either 32 or 64 bits depending on the ABI, zero extend
+ to a 64 bit unsigned long long for popcnt */
+#define ULONG_PARITY(p, n) \
+ do { \
+ unsigned long long __n = (unsigned long) (n); \
+ int __p; \
+ __asm__ ("popcnt %0 = %1" : "=r" (__p) : "r" (__n)); \
+ (p) = __p & 1; \
+ } while (0)
+#endif
+
+#if defined (__GNUC__) && ! defined (__INTEL_COMPILER) \
+ && ! defined (NO_ASM) && HAVE_HOST_CPU_FAMILY_x86
+#if __GMP_GNUC_PREREQ (3,1)
+#define __GMP_qm "=Qm"
+#define __GMP_q "=Q"
+#else
+#define __GMP_qm "=qm"
+#define __GMP_q "=q"
+#endif
+#define ULONG_PARITY(p, n) \
+ do { \
+ char __p; \
+ unsigned long __n = (n); \
+ __n ^= (__n >> 16); \
+ __asm__ ("xorb %h1, %b1\n\t" \
+ "setpo %0" \
+ : __GMP_qm (__p), __GMP_q (__n) \
+ : "1" (__n)); \
+ (p) = __p; \
+ } while (0)
+#endif
+
+#if ! defined (ULONG_PARITY)
+#define ULONG_PARITY(p, n) \
+ do { \
+ unsigned long __n = (n); \
+ int __p = 0; \
+ do \
+ { \
+ __p ^= 0x96696996L >> (__n & 0x1F); \
+ __n >>= 5; \
+ } \
+ while (__n != 0); \
+ \
+ (p) = __p & 1; \
+ } while (0)
+#endif
+
+
+/* 3 cycles on 604 or 750 since shifts and rlwimi's can pair. gcc (as of
+ version 3.1 at least) doesn't seem to know how to generate rlwimi for
+ anything other than bit-fields, so use "asm". */
+#if defined (__GNUC__) && ! defined (NO_ASM) \
+ && HAVE_HOST_CPU_FAMILY_powerpc && GMP_LIMB_BITS == 32
+#define BSWAP_LIMB(dst, src) \
+ do { \
+ mp_limb_t __bswapl_src = (src); \
+ mp_limb_t __tmp1 = __bswapl_src >> 24; /* low byte */ \
+ mp_limb_t __tmp2 = __bswapl_src << 24; /* high byte */ \
+ __asm__ ("rlwimi %0, %2, 24, 16, 23" /* 2nd low */ \
+ : "=r" (__tmp1) : "0" (__tmp1), "r" (__bswapl_src)); \
+ __asm__ ("rlwimi %0, %2, 8, 8, 15" /* 3nd high */ \
+ : "=r" (__tmp2) : "0" (__tmp2), "r" (__bswapl_src)); \
+ (dst) = __tmp1 | __tmp2; /* whole */ \
+ } while (0)
+#endif
+
+/* bswap is available on i486 and up and is fast. A combination rorw $8 /
+ roll $16 / rorw $8 is used in glibc for plain i386 (and in the linux
+ kernel with xchgb instead of rorw), but this is not done here, because
+ i386 means generic x86 and mixing word and dword operations will cause
+ partial register stalls on P6 chips. */
+#if defined (__GNUC__) && ! defined (NO_ASM) \
+ && HAVE_HOST_CPU_FAMILY_x86 && ! HAVE_HOST_CPU_i386 \
+ && GMP_LIMB_BITS == 32
+#define BSWAP_LIMB(dst, src) \
+ do { \
+ __asm__ ("bswap %0" : "=r" (dst) : "0" (src)); \
+ } while (0)
+#endif
+
+#if defined (__GNUC__) && ! defined (NO_ASM) \
+ && defined (__amd64__) && GMP_LIMB_BITS == 64
+#define BSWAP_LIMB(dst, src) \
+ do { \
+ __asm__ ("bswap %q0" : "=r" (dst) : "0" (src)); \
+ } while (0)
+#endif
+
+#if defined (__GNUC__) && ! defined (__INTEL_COMPILER) \
+ && ! defined (NO_ASM) && defined (__ia64) && GMP_LIMB_BITS == 64
+#define BSWAP_LIMB(dst, src) \
+ do { \
+ __asm__ ("mux1 %0 = %1, @rev" : "=r" (dst) : "r" (src)); \
+ } while (0)
+#endif
+
+/* As per glibc. */
+#if defined (__GNUC__) && ! defined (NO_ASM) \
+ && HAVE_HOST_CPU_FAMILY_m68k && GMP_LIMB_BITS == 32
+#define BSWAP_LIMB(dst, src) \
+ do { \
+ mp_limb_t __bswapl_src = (src); \
+ __asm__ ("ror%.w %#8, %0\n\t" \
+ "swap %0\n\t" \
+ "ror%.w %#8, %0" \
+ : "=d" (dst) \
+ : "0" (__bswapl_src)); \
+ } while (0)
+#endif
+
+#if ! defined (BSWAP_LIMB)
+#if GMP_LIMB_BITS == 8
+#define BSWAP_LIMB(dst, src) \
+ do { (dst) = (src); } while (0)
+#endif
+#if GMP_LIMB_BITS == 16
+#define BSWAP_LIMB(dst, src) \
+ do { \
+ (dst) = ((src) << 8) + ((src) >> 8); \
+ } while (0)
+#endif
+#if GMP_LIMB_BITS == 32
+#define BSWAP_LIMB(dst, src) \
+ do { \
+ (dst) = \
+ ((src) << 24) \
+ + (((src) & 0xFF00) << 8) \
+ + (((src) >> 8) & 0xFF00) \
+ + ((src) >> 24); \
+ } while (0)
+#endif
+#if GMP_LIMB_BITS == 64
+#define BSWAP_LIMB(dst, src) \
+ do { \
+ (dst) = \
+ ((src) << 56) \
+ + (((src) & 0xFF00) << 40) \
+ + (((src) & 0xFF0000) << 24) \
+ + (((src) & 0xFF000000) << 8) \
+ + (((src) >> 8) & 0xFF000000) \
+ + (((src) >> 24) & 0xFF0000) \
+ + (((src) >> 40) & 0xFF00) \
+ + ((src) >> 56); \
+ } while (0)
+#endif
+#endif
+
+#if ! defined (BSWAP_LIMB)
+#define BSWAP_LIMB(dst, src) \
+ do { \
+ mp_limb_t __bswapl_src = (src); \
+ mp_limb_t __dstl = 0; \
+ int __i; \
+ for (__i = 0; __i < GMP_LIMB_BYTES; __i++) \
+ { \
+ __dstl = (__dstl << 8) | (__bswapl_src & 0xFF); \
+ __bswapl_src >>= 8; \
+ } \
+ (dst) = __dstl; \
+ } while (0)
+#endif
+
+
+/* Apparently lwbrx might be slow on some PowerPC chips, so restrict it to
+ those we know are fast. */
+#if defined (__GNUC__) && ! defined (NO_ASM) \
+ && GMP_LIMB_BITS == 32 && HAVE_LIMB_BIG_ENDIAN \
+ && (HAVE_HOST_CPU_powerpc604 \
+ || HAVE_HOST_CPU_powerpc604e \
+ || HAVE_HOST_CPU_powerpc750 \
+ || HAVE_HOST_CPU_powerpc7400)
+#define BSWAP_LIMB_FETCH(limb, src) \
+ do { \
+ mp_srcptr __blf_src = (src); \
+ mp_limb_t __limb; \
+ __asm__ ("lwbrx %0, 0, %1" \
+ : "=r" (__limb) \
+ : "r" (__blf_src), \
+ "m" (*__blf_src)); \
+ (limb) = __limb; \
+ } while (0)
+#endif
+
+#if ! defined (BSWAP_LIMB_FETCH)
+#define BSWAP_LIMB_FETCH(limb, src) BSWAP_LIMB (limb, *(src))
+#endif
+
+
+/* On the same basis that lwbrx might be slow, restrict stwbrx to those we
+ know are fast. FIXME: Is this necessary? */
+#if defined (__GNUC__) && ! defined (NO_ASM) \
+ && GMP_LIMB_BITS == 32 && HAVE_LIMB_BIG_ENDIAN \
+ && (HAVE_HOST_CPU_powerpc604 \
+ || HAVE_HOST_CPU_powerpc604e \
+ || HAVE_HOST_CPU_powerpc750 \
+ || HAVE_HOST_CPU_powerpc7400)
+#define BSWAP_LIMB_STORE(dst, limb) \
+ do { \
+ mp_ptr __dst = (dst); \
+ mp_limb_t __limb = (limb); \
+ __asm__ ("stwbrx %1, 0, %2" \
+ : "=m" (*__dst) \
+ : "r" (__limb), \
+ "r" (__dst)); \
+ } while (0)
+#endif
+
+#if ! defined (BSWAP_LIMB_STORE)
+#define BSWAP_LIMB_STORE(dst, limb) BSWAP_LIMB (*(dst), limb)
+#endif
+
+
+/* Byte swap limbs from {src,size} and store at {dst,size}. */
+#define MPN_BSWAP(dst, src, size) \
+ do { \
+ mp_ptr __dst = (dst); \
+ mp_srcptr __src = (src); \
+ mp_size_t __size = (size); \
+ mp_size_t __i; \
+ ASSERT ((size) >= 0); \
+ ASSERT (MPN_SAME_OR_SEPARATE_P (dst, src, size)); \
+ CRAY_Pragma ("_CRI ivdep"); \
+ for (__i = 0; __i < __size; __i++) \
+ { \
+ BSWAP_LIMB_FETCH (*__dst, __src); \
+ __dst++; \
+ __src++; \
+ } \
+ } while (0)
+
+/* Byte swap limbs from {dst,size} and store in reverse order at {src,size}. */
+#define MPN_BSWAP_REVERSE(dst, src, size) \
+ do { \
+ mp_ptr __dst = (dst); \
+ mp_size_t __size = (size); \
+ mp_srcptr __src = (src) + __size - 1; \
+ mp_size_t __i; \
+ ASSERT ((size) >= 0); \
+ ASSERT (! MPN_OVERLAP_P (dst, size, src, size)); \
+ CRAY_Pragma ("_CRI ivdep"); \
+ for (__i = 0; __i < __size; __i++) \
+ { \
+ BSWAP_LIMB_FETCH (*__dst, __src); \
+ __dst++; \
+ __src--; \
+ } \
+ } while (0)
+
+
+/* No processor claiming to be SPARC v9 compliant seems to
+ implement the POPC instruction. Disable pattern for now. */
+#if 0
+#if defined __GNUC__ && defined __sparc_v9__ && GMP_LIMB_BITS == 64
+#define popc_limb(result, input) \
+ do { \
+ DItype __res; \
+ __asm__ ("popc %1,%0" : "=r" (result) : "rI" (input)); \
+ } while (0)
+#endif
+#endif
+
+#if defined (__GNUC__) && ! defined (NO_ASM) && HAVE_HOST_CPU_alpha_CIX
+#define popc_limb(result, input) \
+ do { \
+ __asm__ ("ctpop %1, %0" : "=r" (result) : "r" (input)); \
+ } while (0)
+#endif
+
+/* Cray intrinsic. */
+#ifdef _CRAY
+#define popc_limb(result, input) \
+ do { \
+ (result) = _popcnt (input); \
+ } while (0)
+#endif
+
+#if defined (__GNUC__) && ! defined (__INTEL_COMPILER) \
+ && ! defined (NO_ASM) && defined (__ia64) && GMP_LIMB_BITS == 64
+#define popc_limb(result, input) \
+ do { \
+ __asm__ ("popcnt %0 = %1" : "=r" (result) : "r" (input)); \
+ } while (0)
+#endif
+
+/* Cool population count of an mp_limb_t.
+ You have to figure out how this works, We won't tell you!
+
+ The constants could also be expressed as:
+ 0x55... = [2^N / 3] = [(2^N-1)/3]
+ 0x33... = [2^N / 5] = [(2^N-1)/5]
+ 0x0f... = [2^N / 17] = [(2^N-1)/17]
+ (N is GMP_LIMB_BITS, [] denotes truncation.) */
+
+#if ! defined (popc_limb) && GMP_LIMB_BITS == 8
+#define popc_limb(result, input) \
+ do { \
+ 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); \
+ (result) = __x & 0x0f; \
+ } while (0)
+#endif
+
+#if ! defined (popc_limb) && GMP_LIMB_BITS == 16
+#define popc_limb(result, input) \
+ do { \
+ 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; \
+ } while (0)
+#endif
+
+#if ! defined (popc_limb) && GMP_LIMB_BITS == 32
+#define popc_limb(result, input) \
+ do { \
+ 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); \
+ __x = ((__x >> 16) + __x); \
+ (result) = __x & 0xff; \
+ } while (0)
+#endif
+
+#if ! defined (popc_limb) && GMP_LIMB_BITS == 64
+#define popc_limb(result, input) \
+ do { \
+ 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); \
+ __x = ((__x >> 16) + __x); \
+ __x = ((__x >> 32) + __x); \
+ (result) = __x & 0xff; \
+ } while (0)
+#endif
+
+
+/* Define stuff for longlong.h. */
+#if HAVE_ATTRIBUTE_MODE
+typedef unsigned int UQItype __attribute__ ((mode (QI)));
+typedef int SItype __attribute__ ((mode (SI)));
+typedef unsigned int USItype __attribute__ ((mode (SI)));
+typedef int DItype __attribute__ ((mode (DI)));
+typedef unsigned int UDItype __attribute__ ((mode (DI)));
+#else
+typedef unsigned char UQItype;
+typedef long SItype;
+typedef unsigned long USItype;
+#if HAVE_LONG_LONG
+typedef long long int DItype;
+typedef unsigned long long int UDItype;
+#else /* Assume `long' gives us a wide enough type. Needed for hppa2.0w. */
+typedef long int DItype;
+typedef unsigned long int UDItype;
+#endif
+#endif
+
+typedef mp_limb_t UWtype;
+typedef unsigned int UHWtype;
+#define W_TYPE_SIZE GMP_LIMB_BITS
+
+/* Define ieee_double_extract and _GMP_IEEE_FLOATS.
+
+ Bit field packing is "implementation defined" according to C99, which
+ leaves us at the compiler's mercy here. For some systems packing is
+ defined in the ABI (eg. x86). In any case so far it seems universal that
+ little endian systems pack from low to high, and big endian from high to
+ low within the given type.
+
+ Within the fields we rely on the integer endianness being the same as the
+ float endianness, this is true everywhere we know of and it'd be a fairly
+ strange system that did anything else. */
+
+#if HAVE_DOUBLE_IEEE_LITTLE_SWAPPED
+#define _GMP_IEEE_FLOATS 1
+union ieee_double_extract
+{
+ struct
+ {
+ gmp_uint_least32_t manh:20;
+ gmp_uint_least32_t exp:11;
+ gmp_uint_least32_t sig:1;
+ gmp_uint_least32_t manl:32;
+ } s;
+ double d;
+};
+#endif
+
+#if HAVE_DOUBLE_IEEE_LITTLE_ENDIAN
+#define _GMP_IEEE_FLOATS 1
+union ieee_double_extract
+{
+ struct
+ {
+ gmp_uint_least32_t manl:32;
+ gmp_uint_least32_t manh:20;
+ gmp_uint_least32_t exp:11;
+ gmp_uint_least32_t sig:1;
+ } s;
+ double d;
+};
+#endif
+
+#if HAVE_DOUBLE_IEEE_BIG_ENDIAN
+#define _GMP_IEEE_FLOATS 1
+union ieee_double_extract
+{
+ struct
+ {
+ gmp_uint_least32_t sig:1;
+ gmp_uint_least32_t exp:11;
+ gmp_uint_least32_t manh:20;
+ gmp_uint_least32_t manl:32;
+ } s;
+ double d;
+};
+#endif
+
+#if HAVE_DOUBLE_VAX_D
+union double_extract
+{
+ struct
+ {
+ gmp_uint_least32_t man3:7; /* highest 7 bits */
+ gmp_uint_least32_t exp:8; /* excess-128 exponent */
+ gmp_uint_least32_t sig:1;
+ gmp_uint_least32_t man2:16;
+ gmp_uint_least32_t man1:16;
+ gmp_uint_least32_t man0:16; /* lowest 16 bits */
+ } s;
+ double d;
+};
+#endif
+
+/* Use (4.0 * ...) instead of (2.0 * ...) to work around buggy compilers
+ that don't convert ulong->double correctly (eg. SunOS 4 native cc). */
+#define MP_BASE_AS_DOUBLE (4.0 * ((mp_limb_t) 1 << (GMP_NUMB_BITS - 2)))
+/* Maximum number of limbs it will take to store any `double'.
+ We assume doubles have 53 mantissa bits. */
+#define LIMBS_PER_DOUBLE ((53 + GMP_NUMB_BITS - 2) / GMP_NUMB_BITS + 1)
+
+__GMP_DECLSPEC int __gmp_extract_double (mp_ptr, double);
+
+#define mpn_get_d __gmpn_get_d
+__GMP_DECLSPEC double mpn_get_d (mp_srcptr, mp_size_t, mp_size_t, long) __GMP_ATTRIBUTE_PURE;
+
+
+/* DOUBLE_NAN_INF_ACTION executes code a_nan if x is a NaN, or executes
+ a_inf if x is an infinity. Both are considered unlikely values, for
+ branch prediction. */
+
+#if _GMP_IEEE_FLOATS
+#define DOUBLE_NAN_INF_ACTION(x, a_nan, a_inf) \
+ do { \
+ union ieee_double_extract u; \
+ u.d = (x); \
+ if (UNLIKELY (u.s.exp == 0x7FF)) \
+ { \
+ if (u.s.manl == 0 && u.s.manh == 0) \
+ { a_inf; } \
+ else \
+ { a_nan; } \
+ } \
+ } while (0)
+#endif
+
+#if HAVE_DOUBLE_VAX_D || HAVE_DOUBLE_VAX_G || HAVE_DOUBLE_CRAY_CFP
+/* no nans or infs in these formats */
+#define DOUBLE_NAN_INF_ACTION(x, a_nan, a_inf) \
+ do { } while (0)
+#endif
+
+#ifndef DOUBLE_NAN_INF_ACTION
+/* Unknown format, try something generic.
+ NaN should be "unordered", so x!=x.
+ Inf should be bigger than DBL_MAX. */
+#define DOUBLE_NAN_INF_ACTION(x, a_nan, a_inf) \
+ do { \
+ { \
+ if (UNLIKELY ((x) != (x))) \
+ { a_nan; } \
+ else if (UNLIKELY ((x) > DBL_MAX || (x) < -DBL_MAX)) \
+ { a_inf; } \
+ } \
+ } while (0)
+#endif
+
+/* On m68k, x86 and amd64, gcc (and maybe other compilers) can hold doubles
+ in the coprocessor, which means a bigger exponent range than normal, and
+ depending on the rounding mode, a bigger mantissa than normal. (See
+ "Disappointments" in the gcc manual.) FORCE_DOUBLE stores and fetches
+ "d" through memory to force any rounding and overflows to occur.
+
+ On amd64, and on x86s with SSE2, gcc (depending on options) uses the xmm
+ registers, where there's no such extra precision and no need for the
+ FORCE_DOUBLE. We don't bother to detect this since the present uses for
+ FORCE_DOUBLE are only in test programs and default generic C code.
+
+ Not quite sure that an "automatic volatile" will use memory, but it does
+ in gcc. An asm("":"=m"(d):"0"(d)) can't be used to trick gcc, since
+ apparently matching operands like "0" are only allowed on a register
+ output. gcc 3.4 warns about this, though in fact it and past versions
+ seem to put the operand through memory as hoped. */
+
+#if (HAVE_HOST_CPU_FAMILY_m68k || HAVE_HOST_CPU_FAMILY_x86 \
+ || defined (__amd64__))
+#define FORCE_DOUBLE(d) \
+ do { volatile double __gmp_force = (d); (d) = __gmp_force; } while (0)
+#else
+#define FORCE_DOUBLE(d) do { } while (0)
+#endif
+
+
+__GMP_DECLSPEC extern const unsigned char __gmp_digit_value_tab[];
+
+__GMP_DECLSPEC extern int __gmp_junk;
+__GMP_DECLSPEC extern const int __gmp_0;
+__GMP_DECLSPEC void __gmp_exception (int) ATTRIBUTE_NORETURN;
+__GMP_DECLSPEC void __gmp_divide_by_zero (void) ATTRIBUTE_NORETURN;
+__GMP_DECLSPEC void __gmp_sqrt_of_negative (void) ATTRIBUTE_NORETURN;
+__GMP_DECLSPEC void __gmp_invalid_operation (void) ATTRIBUTE_NORETURN;
+#define GMP_ERROR(code) __gmp_exception (code)
+#define DIVIDE_BY_ZERO __gmp_divide_by_zero ()
+#define SQRT_OF_NEGATIVE __gmp_sqrt_of_negative ()
+
+#if defined _LONG_LONG_LIMB
+#define CNST_LIMB(C) ((mp_limb_t) C##LL)
+#else /* not _LONG_LONG_LIMB */
+#define CNST_LIMB(C) ((mp_limb_t) C##L)
+#endif /* _LONG_LONG_LIMB */
+
+/* Stuff used by mpn/generic/perfsqr.c and mpz/prime_p.c */
+#if GMP_NUMB_BITS == 2
+#define PP 0x3 /* 3 */
+#define PP_FIRST_OMITTED 5
+#endif
+#if GMP_NUMB_BITS == 4
+#define PP 0xF /* 3 x 5 */
+#define PP_FIRST_OMITTED 7
+#endif
+#if GMP_NUMB_BITS == 8
+#define PP 0x69 /* 3 x 5 x 7 */
+#define PP_FIRST_OMITTED 11
+#endif
+#if GMP_NUMB_BITS == 16
+#define PP 0x3AA7 /* 3 x 5 x 7 x 11 x 13 */
+#define PP_FIRST_OMITTED 17
+#endif
+#if GMP_NUMB_BITS == 32
+#define PP 0xC0CFD797L /* 3 x 5 x 7 x 11 x ... x 29 */
+#define PP_INVERTED 0x53E5645CL
+#define PP_FIRST_OMITTED 31
+#endif
+#if GMP_NUMB_BITS == 64
+#define PP CNST_LIMB(0xE221F97C30E94E1D) /* 3 x 5 x 7 x 11 x ... x 53 */
+#define PP_INVERTED CNST_LIMB(0x21CFE6CFC938B36B)
+#define PP_FIRST_OMITTED 59
+#endif
+#ifndef PP_FIRST_OMITTED
+#define PP_FIRST_OMITTED 3
+#endif
+
+/* 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
+ used to ensure the expressions are "int"s even if a and/or b might be
+ other types.
+
+ JACOBI_TWOS_U_BIT1 and JACOBI_RECIP_UU_BIT1 are used in mpn_jacobi_base
+ and their speed is important. Expressions are used rather than
+ conditionals to accumulate sign changes, which effectively means XORs
+ instead of conditional JUMPs. */
+
+/* (a/0), with a signed; is 1 if a=+/-1, 0 otherwise */
+#define JACOBI_S0(a) (((a) == 1) | ((a) == -1))
+
+/* (a/0), with a unsigned; is 1 if a=+/-1, 0 otherwise */
+#define JACOBI_U0(a) ((a) == 1)
+
+/* FIXME: JACOBI_LS0 and JACOBI_0LS are the same, so delete one and
+ come up with a better name. */
+
+/* (a/0), with a given by low and size;
+ is 1 if a=+/-1, 0 otherwise */
+#define JACOBI_LS0(alow,asize) \
+ (((asize) == 1 || (asize) == -1) && (alow) == 1)
+
+/* (a/0), with a an mpz_t;
+ fetch of low limb always valid, even if size is zero */
+#define JACOBI_Z0(a) JACOBI_LS0 (PTR(a)[0], SIZ(a))
+
+/* (0/b), with b unsigned; is 1 if b=1, 0 otherwise */
+#define JACOBI_0U(b) ((b) == 1)
+
+/* (0/b), with b unsigned; is 1 if b=+/-1, 0 otherwise */
+#define JACOBI_0S(b) ((b) == 1 || (b) == -1)
+
+/* (0/b), with b given by low and size; is 1 if b=+/-1, 0 otherwise */
+#define JACOBI_0LS(blow,bsize) \
+ (((bsize) == 1 || (bsize) == -1) && (blow) == 1)
+
+/* Convert a bit1 to +1 or -1. */
+#define JACOBI_BIT1_TO_PN(result_bit1) \
+ (1 - ((int) (result_bit1) & 2))
+
+/* (2/b), with b unsigned and odd;
+ is (-1)^((b^2-1)/8) which is 1 if b==1,7mod8 or -1 if b==3,5mod8 and
+ hence obtained from (b>>1)^b */
+#define JACOBI_TWO_U_BIT1(b) \
+ ((int) (((b) >> 1) ^ (b)))
+
+/* (2/b)^twos, with b unsigned and odd */
+#define JACOBI_TWOS_U_BIT1(twos, b) \
+ ((int) ((twos) << 1) & JACOBI_TWO_U_BIT1 (b))
+
+/* (2/b)^twos, with b unsigned and odd */
+#define JACOBI_TWOS_U(twos, b) \
+ (JACOBI_BIT1_TO_PN (JACOBI_TWOS_U_BIT1 (twos, b)))
+
+/* (-1/b), with b odd (signed or unsigned);
+ is (-1)^((b-1)/2) */
+#define JACOBI_N1B_BIT1(b) \
+ ((int) (b))
+
+/* (a/b) effect due to sign of a: signed/unsigned, b odd;
+ is (-1/b) if a<0, or +1 if a>=0 */
+#define JACOBI_ASGN_SU_BIT1(a, b) \
+ ((((a) < 0) << 1) & JACOBI_N1B_BIT1(b))
+
+/* (a/b) effect due to sign of b: signed/signed;
+ is -1 if a and b both negative, +1 otherwise */
+#define JACOBI_BSGN_SS_BIT1(a, b) \
+ ((((a)<0) & ((b)<0)) << 1)
+
+/* (a/b) effect due to sign of b: signed/mpz;
+ is -1 if a and b both negative, +1 otherwise */
+#define JACOBI_BSGN_SZ_BIT1(a, b) \
+ JACOBI_BSGN_SS_BIT1 (a, SIZ(b))
+
+/* (a/b) effect due to sign of b: mpz/signed;
+ is -1 if a and b both negative, +1 otherwise */
+#define JACOBI_BSGN_ZS_BIT1(a, b) \
+ JACOBI_BSGN_SZ_BIT1 (b, a)
+
+/* (a/b) reciprocity to switch to (b/a), a,b both unsigned and odd;
+ is (-1)^((a-1)*(b-1)/4), which means +1 if either a,b==1mod4, or -1 if
+ both a,b==3mod4, achieved in bit 1 by a&b. No ASSERT()s about a,b odd
+ because this is used in a couple of places with only bit 1 of a or b
+ valid. */
+#define JACOBI_RECIP_UU_BIT1(a, b) \
+ ((int) ((a) & (b)))
+
+/* Strip low zero limbs from {b_ptr,b_size} by incrementing b_ptr and
+ decrementing b_size. b_low should be b_ptr[0] on entry, and will be
+ updated for the new b_ptr. result_bit1 is updated according to the
+ factors of 2 stripped, as per (a/2). */
+#define JACOBI_STRIP_LOW_ZEROS(result_bit1, a, b_ptr, b_size, b_low) \
+ do { \
+ ASSERT ((b_size) >= 1); \
+ ASSERT ((b_low) == (b_ptr)[0]); \
+ \
+ while (UNLIKELY ((b_low) == 0)) \
+ { \
+ (b_size)--; \
+ ASSERT ((b_size) >= 1); \
+ (b_ptr)++; \
+ (b_low) = *(b_ptr); \
+ \
+ ASSERT (((a) & 1) != 0); \
+ if ((GMP_NUMB_BITS % 2) == 1) \
+ (result_bit1) ^= JACOBI_TWO_U_BIT1(a); \
+ } \
+ } while (0)
+
+/* Set a_rem to {a_ptr,a_size} reduced modulo b, either using mod_1 or
+ modexact_1_odd, but in either case leaving a_rem<b. b must be odd and
+ unsigned. modexact_1_odd effectively calculates -a mod b, and
+ result_bit1 is adjusted for the factor of -1.
+
+ The way mpn_modexact_1_odd sometimes bases its remainder on a_size and
+ sometimes on a_size-1 means if GMP_NUMB_BITS is odd we can't know what
+ factor to introduce into result_bit1, so for that case use mpn_mod_1
+ unconditionally.
+
+ FIXME: mpn_modexact_1_odd is more efficient, so some way to get it used
+ for odd GMP_NUMB_BITS would be good. Perhaps it could mung its result,
+ or not skip a divide step, or something. */
+
+#define JACOBI_MOD_OR_MODEXACT_1_ODD(result_bit1, a_rem, a_ptr, a_size, b) \
+ do { \
+ mp_srcptr __a_ptr = (a_ptr); \
+ mp_size_t __a_size = (a_size); \
+ mp_limb_t __b = (b); \
+ \
+ ASSERT (__a_size >= 1); \
+ ASSERT (__b & 1); \
+ \
+ if ((GMP_NUMB_BITS % 2) != 0 \
+ || ABOVE_THRESHOLD (__a_size, BMOD_1_TO_MOD_1_THRESHOLD)) \
+ { \
+ (a_rem) = mpn_mod_1 (__a_ptr, __a_size, __b); \
+ } \
+ else \
+ { \
+ (result_bit1) ^= JACOBI_N1B_BIT1 (__b); \
+ (a_rem) = mpn_modexact_1_odd (__a_ptr, __a_size, __b); \
+ } \
+ } while (0)
+
+/* State for the Jacobi computation using Lehmer. */
+#define jacobi_table __gmp_jacobi_table
+__GMP_DECLSPEC extern const unsigned char jacobi_table[208];
+
+/* Bit layout for the initial state. b must be odd.
+
+ 3 2 1 0
+ +--+--+--+--+
+ |a1|a0|b1| s|
+ +--+--+--+--+
+
+ */
+static inline unsigned
+mpn_jacobi_init (unsigned a, unsigned b, unsigned s)
+{
+ ASSERT (b & 1);
+ ASSERT (s <= 1);
+ return ((a & 3) << 2) + (b & 2) + s;
+}
+
+static inline int
+mpn_jacobi_finish (unsigned bits)
+{
+ /* (a, b) = (1,0) or (0,1) */
+ ASSERT ( (bits & 14) == 0);
+
+ return 1-2*(bits & 1);
+}
+
+static inline unsigned
+mpn_jacobi_update (unsigned bits, unsigned denominator, unsigned q)
+{
+ /* FIXME: Could halve table size by not including the e bit in the
+ * index, and instead xor when updating. Then the lookup would be
+ * like
+ *
+ * bits ^= table[((bits & 30) << 2) + (denominator << 2) + q];
+ */
+
+ ASSERT (bits < 26);
+ ASSERT (denominator < 2);
+ ASSERT (q < 4);
+
+ /* For almost all calls, denominator is constant and quite often q
+ is constant too. So use addition rather than or, so the compiler
+ can put the constant part can into the offset of an indexed
+ addressing instruction.
+
+ With constant denominator, the below table lookup is compiled to
+
+ C Constant q = 1, constant denominator = 1
+ movzbl table+5(%eax,8), %eax
+
+ or
+
+ C q in %edx, constant denominator = 1
+ movzbl table+4(%edx,%eax,8), %eax
+
+ One could maintain the state preshifted 3 bits, to save a shift
+ here, but at least on x86, that's no real saving.
+ */
+ return bits = jacobi_table[(bits << 3) + (denominator << 2) + q];
+}
+
+/* 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;
+
+#ifndef MATRIX22_STRASSEN_THRESHOLD
+#define MATRIX22_STRASSEN_THRESHOLD 30
+#endif
+
+/* HGCD definitions */
+
+/* Extract one numb, shifting count bits left
+ ________ ________
+ |___xh___||___xl___|
+ |____r____|
+ >count <
+
+ The count includes any nail bits, so it should work fine if count
+ is computed using count_leading_zeros. If GMP_NAIL_BITS > 0, all of
+ xh, xl and r include nail bits. Must have 0 < count < GMP_LIMB_BITS.
+
+ FIXME: Omit masking with GMP_NUMB_MASK, and let callers do that for
+ those calls where the count high bits of xh may be non-zero.
+*/
+
+#define MPN_EXTRACT_NUMB(count, xh, xl) \
+ ((((xh) << ((count) - GMP_NAIL_BITS)) & GMP_NUMB_MASK) | \
+ ((xl) >> (GMP_LIMB_BITS - (count))))
+
+
+/* The matrix non-negative M = (u, u'; v,v') keeps track of the
+ reduction (a;b) = M (alpha; beta) where alpha, beta are smaller
+ than a, b. The determinant must always be one, so that M has an
+ inverse (v', -u'; -v, u). Elements always fit in GMP_NUMB_BITS - 1
+ bits. */
+struct hgcd_matrix1
+{
+ mp_limb_t u[2][2];
+};
+
+#define mpn_hgcd2 __MPN (hgcd2)
+__GMP_DECLSPEC int mpn_hgcd2 (mp_limb_t, mp_limb_t, mp_limb_t, mp_limb_t, struct hgcd_matrix1 *);
+
+#define mpn_hgcd_mul_matrix1_vector __MPN (hgcd_mul_matrix1_vector)
+__GMP_DECLSPEC mp_size_t mpn_hgcd_mul_matrix1_vector (const struct hgcd_matrix1 *, mp_ptr, mp_srcptr, mp_ptr, mp_size_t);
+
+#define mpn_matrix22_mul1_inverse_vector __MPN (matrix22_mul1_inverse_vector)
+__GMP_DECLSPEC mp_size_t mpn_matrix22_mul1_inverse_vector (const struct hgcd_matrix1 *, mp_ptr, mp_srcptr, mp_ptr, mp_size_t);
+
+#define mpn_hgcd2_jacobi __MPN (hgcd2_jacobi)
+__GMP_DECLSPEC int mpn_hgcd2_jacobi (mp_limb_t, mp_limb_t, mp_limb_t, mp_limb_t, struct hgcd_matrix1 *, unsigned *);
+
+struct hgcd_matrix
+{
+ mp_size_t alloc; /* for sanity checking only */
+ mp_size_t n;
+ mp_ptr p[2][2];
+};
+
+#define MPN_HGCD_MATRIX_INIT_ITCH(n) (4 * ((n+1)/2 + 1))
+
+#define mpn_hgcd_matrix_init __MPN (hgcd_matrix_init)
+__GMP_DECLSPEC void mpn_hgcd_matrix_init (struct hgcd_matrix *, mp_size_t, mp_ptr);
+
+#define mpn_hgcd_matrix_update_q __MPN (hgcd_matrix_update_q)
+__GMP_DECLSPEC void mpn_hgcd_matrix_update_q (struct hgcd_matrix *, mp_srcptr, mp_size_t, unsigned, mp_ptr);
+
+#define mpn_hgcd_matrix_mul_1 __MPN (hgcd_matrix_mul_1)
+__GMP_DECLSPEC void mpn_hgcd_matrix_mul_1 (struct hgcd_matrix *, const struct hgcd_matrix1 *, mp_ptr);
+
+#define mpn_hgcd_matrix_mul __MPN (hgcd_matrix_mul)
+__GMP_DECLSPEC void mpn_hgcd_matrix_mul (struct hgcd_matrix *, const struct hgcd_matrix *, mp_ptr);
+
+#define mpn_hgcd_matrix_adjust __MPN (hgcd_matrix_adjust)
+__GMP_DECLSPEC mp_size_t mpn_hgcd_matrix_adjust (const struct hgcd_matrix *, mp_size_t, mp_ptr, mp_ptr, mp_size_t, mp_ptr);
+
+#define mpn_hgcd_step __MPN(hgcd_step)
+__GMP_DECLSPEC mp_size_t mpn_hgcd_step (mp_size_t, mp_ptr, mp_ptr, mp_size_t, struct hgcd_matrix *, mp_ptr);
+
+#define mpn_hgcd_reduce __MPN(hgcd_reduce)
+__GMP_DECLSPEC mp_size_t mpn_hgcd_reduce (struct hgcd_matrix *, mp_ptr, mp_ptr, mp_size_t, mp_size_t, mp_ptr);
+
+#define mpn_hgcd_reduce_itch __MPN(hgcd_reduce_itch)
+__GMP_DECLSPEC mp_size_t mpn_hgcd_reduce_itch (mp_size_t, mp_size_t) ATTRIBUTE_CONST;
+
+#define mpn_hgcd_itch __MPN (hgcd_itch)
+__GMP_DECLSPEC mp_size_t mpn_hgcd_itch (mp_size_t) ATTRIBUTE_CONST;
+
+#define mpn_hgcd __MPN (hgcd)
+__GMP_DECLSPEC mp_size_t mpn_hgcd (mp_ptr, mp_ptr, mp_size_t, struct hgcd_matrix *, mp_ptr);
+
+#define mpn_hgcd_appr_itch __MPN (hgcd_appr_itch)
+__GMP_DECLSPEC mp_size_t mpn_hgcd_appr_itch (mp_size_t) ATTRIBUTE_CONST;
+
+#define mpn_hgcd_appr __MPN (hgcd_appr)
+__GMP_DECLSPEC int mpn_hgcd_appr (mp_ptr, mp_ptr, mp_size_t, struct hgcd_matrix *, mp_ptr);
+
+#define mpn_hgcd_jacobi __MPN (hgcd_jacobi)
+__GMP_DECLSPEC mp_size_t mpn_hgcd_jacobi (mp_ptr, mp_ptr, mp_size_t, struct hgcd_matrix *, unsigned *, mp_ptr);
+
+typedef void gcd_subdiv_step_hook(void *, mp_srcptr, mp_size_t, mp_srcptr, mp_size_t, int);
+
+/* Needs storage for the quotient */
+#define MPN_GCD_SUBDIV_STEP_ITCH(n) (n)
+
+#define mpn_gcd_subdiv_step __MPN(gcd_subdiv_step)
+__GMP_DECLSPEC mp_size_t mpn_gcd_subdiv_step (mp_ptr, mp_ptr, mp_size_t, mp_size_t, gcd_subdiv_step_hook *, void *, mp_ptr);
+
+struct gcdext_ctx
+{
+ /* Result parameters. */
+ mp_ptr gp;
+ mp_size_t gn;
+ mp_ptr up;
+ mp_size_t *usize;
+
+ /* Cofactors updated in each step. */
+ mp_size_t un;
+ mp_ptr u0, u1, tp;
+};
+
+#define mpn_gcdext_hook __MPN (gcdext_hook)
+gcd_subdiv_step_hook mpn_gcdext_hook;
+
+#define MPN_GCDEXT_LEHMER_N_ITCH(n) (4*(n) + 3)
+
+#define mpn_gcdext_lehmer_n __MPN(gcdext_lehmer_n)
+__GMP_DECLSPEC mp_size_t mpn_gcdext_lehmer_n (mp_ptr, mp_ptr, mp_size_t *, mp_ptr, mp_ptr, mp_size_t, mp_ptr);
+
+/* 4*(an + 1) + 4*(bn + 1) + an */
+#define MPN_GCDEXT_LEHMER_ITCH(an, bn) (5*(an) + 4*(bn) + 8)
+
+#ifndef HGCD_THRESHOLD
+#define HGCD_THRESHOLD 400
+#endif
+
+#ifndef HGCD_APPR_THRESHOLD
+#define HGCD_APPR_THRESHOLD 400
+#endif
+
+#ifndef HGCD_REDUCE_THRESHOLD
+#define HGCD_REDUCE_THRESHOLD 1000
+#endif
+
+#ifndef GCD_DC_THRESHOLD
+#define GCD_DC_THRESHOLD 1000
+#endif
+
+#ifndef GCDEXT_DC_THRESHOLD
+#define GCDEXT_DC_THRESHOLD 600
+#endif
+
+/* Definitions for mpn_set_str and mpn_get_str */
+struct powers
+{
+ mp_ptr p; /* actual power value */
+ mp_size_t n; /* # of limbs at p */
+ mp_size_t shift; /* weight of lowest limb, in limb base B */
+ size_t digits_in_base; /* number of corresponding digits */
+ int base;
+};
+typedef struct powers powers_t;
+#define mpn_dc_set_str_powtab_alloc(n) ((n) + GMP_LIMB_BITS)
+#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_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
+ limb and adds an extra limb. __GMPF_PREC_TO_BITS drops that extra limb,
+ hence giving back the user's size in bits rounded up. Notice that
+ converting prec->bits->prec gives an unchanged value. */
+#define __GMPF_BITS_TO_PREC(n) \
+ ((mp_size_t) ((__GMP_MAX (53, n) + 2 * GMP_NUMB_BITS - 1) / GMP_NUMB_BITS))
+#define __GMPF_PREC_TO_BITS(n) \
+ ((mp_bitcnt_t) (n) * GMP_NUMB_BITS - GMP_NUMB_BITS)
+
+__GMP_DECLSPEC extern mp_size_t __gmp_default_fp_limb_precision;
+
+/* Compute the number of base-b digits corresponding to nlimbs limbs, rounding
+ down. */
+#define DIGITS_IN_BASE_PER_LIMB(res, nlimbs, b) \
+ do { \
+ mp_limb_t _ph, _pl; \
+ umul_ppmm (_ph, _pl, \
+ mp_bases[b].logb2, GMP_NUMB_BITS * (mp_limb_t) (nlimbs));\
+ res = _ph; \
+ } while (0)
+
+/* Compute the number of limbs corresponding to ndigits base-b digits, rounding
+ up. */
+#define LIMBS_PER_DIGIT_IN_BASE(res, ndigits, b) \
+ do { \
+ mp_limb_t _ph, _dummy; \
+ umul_ppmm (_ph, _dummy, mp_bases[b].log2b, (mp_limb_t) (ndigits)); \
+ res = 8 * _ph / GMP_NUMB_BITS + 2; \
+ } while (0)
+
+
+/* Set n to the number of significant digits an mpf of the given _mp_prec
+ field, in the given base. This is a rounded up value, designed to ensure
+ there's enough digits to reproduce all the guaranteed part of the value.
+
+ There are prec many limbs, but the high might be only "1" so forget it
+ and just count prec-1 limbs into chars. +1 rounds that upwards, and a
+ further +1 is because the limbs usually won't fall on digit boundaries.
+
+ FIXME: If base is a power of 2 and the bits per digit divides
+ GMP_LIMB_BITS then the +2 is unnecessary. This happens always for
+ base==2, and in base==16 with the current 32 or 64 bit limb sizes. */
+
+#define MPF_SIGNIFICANT_DIGITS(n, base, prec) \
+ do { \
+ size_t rawn; \
+ ASSERT (base >= 2 && base < numberof (mp_bases)); \
+ DIGITS_IN_BASE_PER_LIMB (rawn, (prec) - 1, base); \
+ n = rawn + 2; \
+ } while (0)
+
+
+/* Decimal point string, from the current C locale. Needs <langinfo.h> for
+ nl_langinfo and constants, preferably with _GNU_SOURCE defined to get
+ DECIMAL_POINT from glibc, and needs <locale.h> for localeconv, each under
+ their respective #if HAVE_FOO_H.
+
+ GLIBC recommends nl_langinfo because getting only one facet can be
+ faster, apparently. */
+
+/* DECIMAL_POINT seems to need _GNU_SOURCE defined to get it from glibc. */
+#if HAVE_NL_LANGINFO && defined (DECIMAL_POINT)
+#define GMP_DECIMAL_POINT (nl_langinfo (DECIMAL_POINT))
+#endif
+/* RADIXCHAR is deprecated, still in unix98 or some such. */
+#if HAVE_NL_LANGINFO && defined (RADIXCHAR) && ! defined (GMP_DECIMAL_POINT)
+#define GMP_DECIMAL_POINT (nl_langinfo (RADIXCHAR))
+#endif
+/* localeconv is slower since it returns all locale stuff */
+#if HAVE_LOCALECONV && ! defined (GMP_DECIMAL_POINT)
+#define GMP_DECIMAL_POINT (localeconv()->decimal_point)
+#endif
+#if ! defined (GMP_DECIMAL_POINT)
+#define GMP_DECIMAL_POINT (".")
+#endif
+
+
+#define DOPRNT_CONV_FIXED 1
+#define DOPRNT_CONV_SCIENTIFIC 2
+#define DOPRNT_CONV_GENERAL 3
+
+#define DOPRNT_JUSTIFY_NONE 0
+#define DOPRNT_JUSTIFY_LEFT 1
+#define DOPRNT_JUSTIFY_RIGHT 2
+#define DOPRNT_JUSTIFY_INTERNAL 3
+
+#define DOPRNT_SHOWBASE_YES 1
+#define DOPRNT_SHOWBASE_NO 2
+#define DOPRNT_SHOWBASE_NONZERO 3
+
+struct doprnt_params_t {
+ int base; /* negative for upper case */
+ int conv; /* choices above */
+ const char *expfmt; /* exponent format */
+ int exptimes4; /* exponent multiply by 4 */
+ char fill; /* character */
+ int justify; /* choices above */
+ int prec; /* prec field, or -1 for all digits */
+ int showbase; /* choices above */
+ int showpoint; /* if radix point always shown */
+ int showtrailing; /* if trailing zeros wanted */
+ char sign; /* '+', ' ', or '\0' */
+ int width; /* width field */
+};
+
+#if _GMP_H_HAVE_VA_LIST
+
+typedef int (*doprnt_format_t) (void *, const char *, va_list);
+typedef int (*doprnt_memory_t) (void *, const char *, size_t);
+typedef int (*doprnt_reps_t) (void *, int, int);
+typedef int (*doprnt_final_t) (void *);
+
+struct doprnt_funs_t {
+ doprnt_format_t format;
+ doprnt_memory_t memory;
+ doprnt_reps_t reps;
+ doprnt_final_t final; /* NULL if not required */
+};
+
+extern const struct doprnt_funs_t __gmp_fprintf_funs;
+extern const struct doprnt_funs_t __gmp_sprintf_funs;
+extern const struct doprnt_funs_t __gmp_snprintf_funs;
+extern const struct doprnt_funs_t __gmp_obstack_printf_funs;
+extern const struct doprnt_funs_t __gmp_ostream_funs;
+
+/* "buf" is a __gmp_allocate_func block of "alloc" many bytes. The first
+ "size" of these have been written. "alloc > size" is maintained, so
+ there's room to store a '\0' at the end. "result" is where the
+ application wants the final block pointer. */
+struct gmp_asprintf_t {
+ char **result;
+ char *buf;
+ size_t size;
+ size_t alloc;
+};
+
+#define GMP_ASPRINTF_T_INIT(d, output) \
+ do { \
+ (d).result = (output); \
+ (d).alloc = 256; \
+ (d).buf = (char *) (*__gmp_allocate_func) ((d).alloc); \
+ (d).size = 0; \
+ } while (0)
+
+/* If a realloc is necessary, use twice the size actually required, so as to
+ avoid repeated small reallocs. */
+#define GMP_ASPRINTF_T_NEED(d, n) \
+ do { \
+ size_t alloc, newsize, newalloc; \
+ ASSERT ((d)->alloc >= (d)->size + 1); \
+ \
+ alloc = (d)->alloc; \
+ newsize = (d)->size + (n); \
+ if (alloc <= newsize) \
+ { \
+ newalloc = 2*newsize; \
+ (d)->alloc = newalloc; \
+ (d)->buf = __GMP_REALLOCATE_FUNC_TYPE ((d)->buf, \
+ alloc, newalloc, char); \
+ } \
+ } while (0)
+
+__GMP_DECLSPEC int __gmp_asprintf_memory (struct gmp_asprintf_t *, const char *, size_t);
+__GMP_DECLSPEC int __gmp_asprintf_reps (struct gmp_asprintf_t *, int, int);
+__GMP_DECLSPEC int __gmp_asprintf_final (struct gmp_asprintf_t *);
+
+/* buf is where to write the next output, and size is how much space is left
+ there. If the application passed size==0 then that's what we'll have
+ here, and nothing at all should be written. */
+struct gmp_snprintf_t {
+ char *buf;
+ size_t size;
+};
+
+/* Add the bytes printed by the call to the total retval, or bail out on an
+ error. */
+#define DOPRNT_ACCUMULATE(call) \
+ do { \
+ int __ret; \
+ __ret = call; \
+ if (__ret == -1) \
+ goto error; \
+ retval += __ret; \
+ } while (0)
+#define DOPRNT_ACCUMULATE_FUN(fun, params) \
+ do { \
+ ASSERT ((fun) != NULL); \
+ DOPRNT_ACCUMULATE ((*(fun)) params); \
+ } while (0)
+
+#define DOPRNT_FORMAT(fmt, ap) \
+ DOPRNT_ACCUMULATE_FUN (funs->format, (data, fmt, ap))
+#define DOPRNT_MEMORY(ptr, len) \
+ DOPRNT_ACCUMULATE_FUN (funs->memory, (data, ptr, len))
+#define DOPRNT_REPS(c, n) \
+ DOPRNT_ACCUMULATE_FUN (funs->reps, (data, c, n))
+
+#define DOPRNT_STRING(str) DOPRNT_MEMORY (str, strlen (str))
+
+#define DOPRNT_REPS_MAYBE(c, n) \
+ do { \
+ if ((n) != 0) \
+ DOPRNT_REPS (c, n); \
+ } while (0)
+#define DOPRNT_MEMORY_MAYBE(ptr, len) \
+ do { \
+ if ((len) != 0) \
+ DOPRNT_MEMORY (ptr, len); \
+ } while (0)
+
+__GMP_DECLSPEC int __gmp_doprnt (const struct doprnt_funs_t *, void *, const char *, va_list);
+__GMP_DECLSPEC int __gmp_doprnt_integer (const struct doprnt_funs_t *, void *, const struct doprnt_params_t *, const char *);
+
+#define __gmp_doprnt_mpf __gmp_doprnt_mpf2
+__GMP_DECLSPEC int __gmp_doprnt_mpf (const struct doprnt_funs_t *, void *, const struct doprnt_params_t *, const char *, mpf_srcptr);
+
+__GMP_DECLSPEC int __gmp_replacement_vsnprintf (char *, size_t, const char *, va_list);
+#endif /* _GMP_H_HAVE_VA_LIST */
+
+
+typedef int (*gmp_doscan_scan_t) (void *, const char *, ...);
+typedef void *(*gmp_doscan_step_t) (void *, int);
+typedef int (*gmp_doscan_get_t) (void *);
+typedef int (*gmp_doscan_unget_t) (int, void *);
+
+struct gmp_doscan_funs_t {
+ gmp_doscan_scan_t scan;
+ gmp_doscan_step_t step;
+ gmp_doscan_get_t get;
+ gmp_doscan_unget_t unget;
+};
+extern const struct gmp_doscan_funs_t __gmp_fscanf_funs;
+extern const struct gmp_doscan_funs_t __gmp_sscanf_funs;
+
+#if _GMP_H_HAVE_VA_LIST
+__GMP_DECLSPEC int __gmp_doscan (const struct gmp_doscan_funs_t *, void *, const char *, va_list);
+#endif
+
+
+/* For testing and debugging. */
+#define MPZ_CHECK_FORMAT(z) \
+ do { \
+ ASSERT_ALWAYS (SIZ(z) == 0 || PTR(z)[ABSIZ(z) - 1] != 0); \
+ ASSERT_ALWAYS (ALLOC(z) >= ABSIZ(z)); \
+ ASSERT_ALWAYS_MPN (PTR(z), ABSIZ(z)); \
+ } while (0)
+
+#define MPQ_CHECK_FORMAT(q) \
+ do { \
+ MPZ_CHECK_FORMAT (mpq_numref (q)); \
+ MPZ_CHECK_FORMAT (mpq_denref (q)); \
+ ASSERT_ALWAYS (SIZ(mpq_denref(q)) >= 1); \
+ \
+ if (SIZ(mpq_numref(q)) == 0) \
+ { \
+ /* should have zero as 0/1 */ \
+ ASSERT_ALWAYS (SIZ(mpq_denref(q)) == 1 \
+ && PTR(mpq_denref(q))[0] == 1); \
+ } \
+ else \
+ { \
+ /* should have no common factors */ \
+ mpz_t g; \
+ mpz_init (g); \
+ mpz_gcd (g, mpq_numref(q), mpq_denref(q)); \
+ ASSERT_ALWAYS (mpz_cmp_ui (g, 1) == 0); \
+ mpz_clear (g); \
+ } \
+ } while (0)
+
+#define MPF_CHECK_FORMAT(f) \
+ do { \
+ ASSERT_ALWAYS (PREC(f) >= __GMPF_BITS_TO_PREC(53)); \
+ ASSERT_ALWAYS (ABSIZ(f) <= PREC(f)+1); \
+ if (SIZ(f) == 0) \
+ ASSERT_ALWAYS (EXP(f) == 0); \
+ if (SIZ(f) != 0) \
+ ASSERT_ALWAYS (PTR(f)[ABSIZ(f) - 1] != 0); \
+ } while (0)
+
+
+/* Enhancement: The "mod" and "gcd_1" functions below could have
+ __GMP_ATTRIBUTE_PURE, but currently (gcc 3.3) that's not supported on
+ function pointers, only actual functions. It probably doesn't make much
+ difference to the gmp code, since hopefully we arrange calls so there's
+ no great need for the compiler to move things around. */
+
+#if WANT_FAT_BINARY && (HAVE_HOST_CPU_FAMILY_x86 || HAVE_HOST_CPU_FAMILY_x86_64)
+/* NOTE: The function pointers in this struct are also in CPUVEC_FUNCS_LIST
+ in mpn/x86/x86-defs.m4 and mpn/x86_64/x86_64-defs.m4. Be sure to update
+ those when changing here. */
+struct cpuvec_t {
+ DECL_add_n ((*add_n));
+ DECL_addlsh1_n ((*addlsh1_n));
+ DECL_addlsh2_n ((*addlsh2_n));
+ DECL_addmul_1 ((*addmul_1));
+ DECL_addmul_2 ((*addmul_2));
+ DECL_bdiv_dbm1c ((*bdiv_dbm1c));
+ DECL_cnd_add_n ((*cnd_add_n));
+ DECL_cnd_sub_n ((*cnd_sub_n));
+ DECL_com ((*com));
+ DECL_copyd ((*copyd));
+ DECL_copyi ((*copyi));
+ DECL_divexact_1 ((*divexact_1));
+ DECL_divrem_1 ((*divrem_1));
+ DECL_gcd_1 ((*gcd_1));
+ DECL_lshift ((*lshift));
+ DECL_lshiftc ((*lshiftc));
+ DECL_mod_1 ((*mod_1));
+ DECL_mod_1_1p ((*mod_1_1p));
+ DECL_mod_1_1p_cps ((*mod_1_1p_cps));
+ DECL_mod_1s_2p ((*mod_1s_2p));
+ DECL_mod_1s_2p_cps ((*mod_1s_2p_cps));
+ DECL_mod_1s_4p ((*mod_1s_4p));
+ DECL_mod_1s_4p_cps ((*mod_1s_4p_cps));
+ DECL_mod_34lsub1 ((*mod_34lsub1));
+ DECL_modexact_1c_odd ((*modexact_1c_odd));
+ DECL_mul_1 ((*mul_1));
+ DECL_mul_basecase ((*mul_basecase));
+ DECL_mullo_basecase ((*mullo_basecase));
+ DECL_preinv_divrem_1 ((*preinv_divrem_1));
+ DECL_preinv_mod_1 ((*preinv_mod_1));
+ DECL_redc_1 ((*redc_1));
+ DECL_redc_2 ((*redc_2));
+ DECL_rshift ((*rshift));
+ DECL_sqr_basecase ((*sqr_basecase));
+ DECL_sub_n ((*sub_n));
+ DECL_sublsh1_n ((*sublsh1_n));
+ DECL_submul_1 ((*submul_1));
+ mp_size_t mul_toom22_threshold;
+ mp_size_t mul_toom33_threshold;
+ mp_size_t sqr_toom2_threshold;
+ mp_size_t sqr_toom3_threshold;
+ mp_size_t bmod_1_to_mod_1_threshold;
+};
+__GMP_DECLSPEC extern struct cpuvec_t __gmpn_cpuvec;
+__GMP_DECLSPEC extern int __gmpn_cpuvec_initialized;
+#endif /* x86 fat binary */
+
+__GMP_DECLSPEC void __gmpn_cpuvec_init (void);
+
+/* Get a threshold "field" from __gmpn_cpuvec, running __gmpn_cpuvec_init()
+ if that hasn't yet been done (to establish the right values). */
+#define CPUVEC_THRESHOLD(field) \
+ ((LIKELY (__gmpn_cpuvec_initialized) ? 0 : (__gmpn_cpuvec_init (), 0)), \
+ __gmpn_cpuvec.field)
+
+
+#if HAVE_NATIVE_mpn_add_nc
+#define mpn_add_nc __MPN(add_nc)
+__GMP_DECLSPEC mp_limb_t mpn_add_nc (mp_ptr, mp_srcptr, mp_srcptr, mp_size_t, mp_limb_t);
+#else
+static inline
+mp_limb_t
+mpn_add_nc (mp_ptr rp, mp_srcptr up, mp_srcptr vp, mp_size_t n, mp_limb_t ci)
+{
+ mp_limb_t co;
+ co = mpn_add_n (rp, up, vp, n);
+ co += mpn_add_1 (rp, rp, n, ci);
+ return co;
+}
+#endif
+
+#if HAVE_NATIVE_mpn_sub_nc
+#define mpn_sub_nc __MPN(sub_nc)
+__GMP_DECLSPEC mp_limb_t mpn_sub_nc (mp_ptr, mp_srcptr, mp_srcptr, mp_size_t, mp_limb_t);
+#else
+static inline mp_limb_t
+mpn_sub_nc (mp_ptr rp, mp_srcptr up, mp_srcptr vp, mp_size_t n, mp_limb_t ci)
+{
+ mp_limb_t co;
+ co = mpn_sub_n (rp, up, vp, n);
+ co += mpn_sub_1 (rp, rp, n, ci);
+ return co;
+}
+#endif
+
+static inline int
+mpn_zero_p (mp_srcptr ap, mp_size_t n)
+{
+ while (--n >= 0)
+ {
+ if (ap[n] != 0)
+ return 0;
+ }
+ return 1;
+}
+
+#if TUNE_PROGRAM_BUILD
+/* Some extras wanted when recompiling some .c files for use by the tune
+ program. Not part of a normal build.
+
+ It's necessary to keep these thresholds as #defines (just to an
+ identically named variable), since various defaults are established based
+ on #ifdef in the .c files. For some this is not so (the defaults are
+ instead established above), but all are done this way for consistency. */
+
+#undef MUL_TOOM22_THRESHOLD
+#define MUL_TOOM22_THRESHOLD mul_toom22_threshold
+extern mp_size_t mul_toom22_threshold;
+
+#undef MUL_TOOM33_THRESHOLD
+#define MUL_TOOM33_THRESHOLD mul_toom33_threshold
+extern mp_size_t mul_toom33_threshold;
+
+#undef MUL_TOOM44_THRESHOLD
+#define MUL_TOOM44_THRESHOLD mul_toom44_threshold
+extern mp_size_t mul_toom44_threshold;
+
+#undef MUL_TOOM6H_THRESHOLD
+#define MUL_TOOM6H_THRESHOLD mul_toom6h_threshold
+extern mp_size_t mul_toom6h_threshold;
+
+#undef MUL_TOOM8H_THRESHOLD
+#define MUL_TOOM8H_THRESHOLD mul_toom8h_threshold
+extern mp_size_t mul_toom8h_threshold;
+
+#undef MUL_TOOM32_TO_TOOM43_THRESHOLD
+#define MUL_TOOM32_TO_TOOM43_THRESHOLD mul_toom32_to_toom43_threshold
+extern mp_size_t mul_toom32_to_toom43_threshold;
+
+#undef MUL_TOOM32_TO_TOOM53_THRESHOLD
+#define MUL_TOOM32_TO_TOOM53_THRESHOLD mul_toom32_to_toom53_threshold
+extern mp_size_t mul_toom32_to_toom53_threshold;
+
+#undef MUL_TOOM42_TO_TOOM53_THRESHOLD
+#define MUL_TOOM42_TO_TOOM53_THRESHOLD mul_toom42_to_toom53_threshold
+extern mp_size_t mul_toom42_to_toom53_threshold;
+
+#undef MUL_TOOM42_TO_TOOM63_THRESHOLD
+#define MUL_TOOM42_TO_TOOM63_THRESHOLD mul_toom42_to_toom63_threshold
+extern mp_size_t mul_toom42_to_toom63_threshold;
+
+#undef MUL_TOOM43_TO_TOOM54_THRESHOLD
+#define MUL_TOOM43_TO_TOOM54_THRESHOLD mul_toom43_to_toom54_threshold;
+extern mp_size_t mul_toom43_to_toom54_threshold;
+
+#undef MUL_FFT_THRESHOLD
+#define MUL_FFT_THRESHOLD mul_fft_threshold
+extern mp_size_t mul_fft_threshold;
+
+#undef MUL_FFT_MODF_THRESHOLD
+#define MUL_FFT_MODF_THRESHOLD mul_fft_modf_threshold
+extern mp_size_t mul_fft_modf_threshold;
+
+#undef MUL_FFT_TABLE
+#define MUL_FFT_TABLE { 0 }
+
+#undef MUL_FFT_TABLE3
+#define MUL_FFT_TABLE3 { {0,0} }
+
+/* A native mpn_sqr_basecase is not tuned and SQR_BASECASE_THRESHOLD should
+ remain as zero (always use it). */
+#if ! HAVE_NATIVE_mpn_sqr_basecase
+#undef SQR_BASECASE_THRESHOLD
+#define SQR_BASECASE_THRESHOLD sqr_basecase_threshold
+extern mp_size_t sqr_basecase_threshold;
+#endif
+
+#if TUNE_PROGRAM_BUILD_SQR
+#undef SQR_TOOM2_THRESHOLD
+#define SQR_TOOM2_THRESHOLD SQR_TOOM2_MAX_GENERIC
+#else
+#undef SQR_TOOM2_THRESHOLD
+#define SQR_TOOM2_THRESHOLD sqr_toom2_threshold
+extern mp_size_t sqr_toom2_threshold;
+#endif
+
+#undef SQR_TOOM3_THRESHOLD
+#define SQR_TOOM3_THRESHOLD sqr_toom3_threshold
+extern mp_size_t sqr_toom3_threshold;
+
+#undef SQR_TOOM4_THRESHOLD
+#define SQR_TOOM4_THRESHOLD sqr_toom4_threshold
+extern mp_size_t sqr_toom4_threshold;
+
+#undef SQR_TOOM6_THRESHOLD
+#define SQR_TOOM6_THRESHOLD sqr_toom6_threshold
+extern mp_size_t sqr_toom6_threshold;
+
+#undef SQR_TOOM8_THRESHOLD
+#define SQR_TOOM8_THRESHOLD sqr_toom8_threshold
+extern mp_size_t sqr_toom8_threshold;
+
+#undef SQR_FFT_THRESHOLD
+#define SQR_FFT_THRESHOLD sqr_fft_threshold
+extern mp_size_t sqr_fft_threshold;
+
+#undef SQR_FFT_MODF_THRESHOLD
+#define SQR_FFT_MODF_THRESHOLD sqr_fft_modf_threshold
+extern mp_size_t sqr_fft_modf_threshold;
+
+#undef SQR_FFT_TABLE
+#define SQR_FFT_TABLE { 0 }
+
+#undef SQR_FFT_TABLE3
+#define SQR_FFT_TABLE3 { {0,0} }
+
+#undef MULLO_BASECASE_THRESHOLD
+#define MULLO_BASECASE_THRESHOLD mullo_basecase_threshold
+extern mp_size_t mullo_basecase_threshold;
+
+#undef MULLO_DC_THRESHOLD
+#define MULLO_DC_THRESHOLD mullo_dc_threshold
+extern mp_size_t mullo_dc_threshold;
+
+#undef MULLO_MUL_N_THRESHOLD
+#define MULLO_MUL_N_THRESHOLD mullo_mul_n_threshold
+extern mp_size_t mullo_mul_n_threshold;
+
+#undef MULMID_TOOM42_THRESHOLD
+#define MULMID_TOOM42_THRESHOLD mulmid_toom42_threshold
+extern mp_size_t mulmid_toom42_threshold;
+
+#undef DIV_QR_2_PI2_THRESHOLD
+#define DIV_QR_2_PI2_THRESHOLD div_qr_2_pi2_threshold
+extern mp_size_t div_qr_2_pi2_threshold;
+
+#undef DC_DIV_QR_THRESHOLD
+#define DC_DIV_QR_THRESHOLD dc_div_qr_threshold
+extern mp_size_t dc_div_qr_threshold;
+
+#undef DC_DIVAPPR_Q_THRESHOLD
+#define DC_DIVAPPR_Q_THRESHOLD dc_divappr_q_threshold
+extern mp_size_t dc_divappr_q_threshold;
+
+#undef DC_BDIV_Q_THRESHOLD
+#define DC_BDIV_Q_THRESHOLD dc_bdiv_q_threshold
+extern mp_size_t dc_bdiv_q_threshold;
+
+#undef DC_BDIV_QR_THRESHOLD
+#define DC_BDIV_QR_THRESHOLD dc_bdiv_qr_threshold
+extern mp_size_t dc_bdiv_qr_threshold;
+
+#undef MU_DIV_QR_THRESHOLD
+#define MU_DIV_QR_THRESHOLD mu_div_qr_threshold
+extern mp_size_t mu_div_qr_threshold;
+
+#undef MU_DIVAPPR_Q_THRESHOLD
+#define MU_DIVAPPR_Q_THRESHOLD mu_divappr_q_threshold
+extern mp_size_t mu_divappr_q_threshold;
+
+#undef MUPI_DIV_QR_THRESHOLD
+#define MUPI_DIV_QR_THRESHOLD mupi_div_qr_threshold
+extern mp_size_t mupi_div_qr_threshold;
+
+#undef MU_BDIV_QR_THRESHOLD
+#define MU_BDIV_QR_THRESHOLD mu_bdiv_qr_threshold
+extern mp_size_t mu_bdiv_qr_threshold;
+
+#undef MU_BDIV_Q_THRESHOLD
+#define MU_BDIV_Q_THRESHOLD mu_bdiv_q_threshold
+extern mp_size_t mu_bdiv_q_threshold;
+
+#undef INV_MULMOD_BNM1_THRESHOLD
+#define INV_MULMOD_BNM1_THRESHOLD inv_mulmod_bnm1_threshold
+extern mp_size_t inv_mulmod_bnm1_threshold;
+
+#undef INV_NEWTON_THRESHOLD
+#define INV_NEWTON_THRESHOLD inv_newton_threshold
+extern mp_size_t inv_newton_threshold;
+
+#undef INV_APPR_THRESHOLD
+#define INV_APPR_THRESHOLD inv_appr_threshold
+extern mp_size_t inv_appr_threshold;
+
+#undef BINV_NEWTON_THRESHOLD
+#define BINV_NEWTON_THRESHOLD binv_newton_threshold
+extern mp_size_t binv_newton_threshold;
+
+#undef REDC_1_TO_REDC_2_THRESHOLD
+#define REDC_1_TO_REDC_2_THRESHOLD redc_1_to_redc_2_threshold
+extern mp_size_t redc_1_to_redc_2_threshold;
+
+#undef REDC_2_TO_REDC_N_THRESHOLD
+#define REDC_2_TO_REDC_N_THRESHOLD redc_2_to_redc_n_threshold
+extern mp_size_t redc_2_to_redc_n_threshold;
+
+#undef REDC_1_TO_REDC_N_THRESHOLD
+#define REDC_1_TO_REDC_N_THRESHOLD redc_1_to_redc_n_threshold
+extern mp_size_t redc_1_to_redc_n_threshold;
+
+#undef MATRIX22_STRASSEN_THRESHOLD
+#define MATRIX22_STRASSEN_THRESHOLD matrix22_strassen_threshold
+extern mp_size_t matrix22_strassen_threshold;
+
+#undef HGCD_THRESHOLD
+#define HGCD_THRESHOLD hgcd_threshold
+extern mp_size_t hgcd_threshold;
+
+#undef HGCD_APPR_THRESHOLD
+#define HGCD_APPR_THRESHOLD hgcd_appr_threshold
+extern mp_size_t hgcd_appr_threshold;
+
+#undef HGCD_REDUCE_THRESHOLD
+#define HGCD_REDUCE_THRESHOLD hgcd_reduce_threshold
+extern mp_size_t hgcd_reduce_threshold;
+
+#undef GCD_DC_THRESHOLD
+#define GCD_DC_THRESHOLD gcd_dc_threshold
+extern mp_size_t gcd_dc_threshold;
+
+#undef GCDEXT_DC_THRESHOLD
+#define GCDEXT_DC_THRESHOLD gcdext_dc_threshold
+extern mp_size_t gcdext_dc_threshold;
+
+#undef DIV_QR_1N_PI1_METHOD
+#define DIV_QR_1N_PI1_METHOD div_qr_1n_pi1_method
+extern int div_qr_1n_pi1_method;
+
+#undef DIV_QR_1_NORM_THRESHOLD
+#define DIV_QR_1_NORM_THRESHOLD div_qr_1_norm_threshold
+extern mp_size_t div_qr_1_norm_threshold;
+
+#undef DIV_QR_1_UNNORM_THRESHOLD
+#define DIV_QR_1_UNNORM_THRESHOLD div_qr_1_unnorm_threshold
+extern mp_size_t div_qr_1_unnorm_threshold;
+
+#undef DIVREM_1_NORM_THRESHOLD
+#define DIVREM_1_NORM_THRESHOLD divrem_1_norm_threshold
+extern mp_size_t divrem_1_norm_threshold;
+
+#undef DIVREM_1_UNNORM_THRESHOLD
+#define DIVREM_1_UNNORM_THRESHOLD divrem_1_unnorm_threshold
+extern mp_size_t divrem_1_unnorm_threshold;
+
+#undef MOD_1_NORM_THRESHOLD
+#define MOD_1_NORM_THRESHOLD mod_1_norm_threshold
+extern mp_size_t mod_1_norm_threshold;
+
+#undef MOD_1_UNNORM_THRESHOLD
+#define MOD_1_UNNORM_THRESHOLD mod_1_unnorm_threshold
+extern mp_size_t mod_1_unnorm_threshold;
+
+#undef MOD_1_1P_METHOD
+#define MOD_1_1P_METHOD mod_1_1p_method
+extern int mod_1_1p_method;
+
+#undef MOD_1N_TO_MOD_1_1_THRESHOLD
+#define MOD_1N_TO_MOD_1_1_THRESHOLD mod_1n_to_mod_1_1_threshold
+extern mp_size_t mod_1n_to_mod_1_1_threshold;
+
+#undef MOD_1U_TO_MOD_1_1_THRESHOLD
+#define MOD_1U_TO_MOD_1_1_THRESHOLD mod_1u_to_mod_1_1_threshold
+extern mp_size_t mod_1u_to_mod_1_1_threshold;
+
+#undef MOD_1_1_TO_MOD_1_2_THRESHOLD
+#define MOD_1_1_TO_MOD_1_2_THRESHOLD mod_1_1_to_mod_1_2_threshold
+extern mp_size_t mod_1_1_to_mod_1_2_threshold;
+
+#undef MOD_1_2_TO_MOD_1_4_THRESHOLD
+#define MOD_1_2_TO_MOD_1_4_THRESHOLD mod_1_2_to_mod_1_4_threshold
+extern mp_size_t mod_1_2_to_mod_1_4_threshold;
+
+#undef PREINV_MOD_1_TO_MOD_1_THRESHOLD
+#define PREINV_MOD_1_TO_MOD_1_THRESHOLD preinv_mod_1_to_mod_1_threshold
+extern mp_size_t preinv_mod_1_to_mod_1_threshold;
+
+#if ! UDIV_PREINV_ALWAYS
+#undef DIVREM_2_THRESHOLD
+#define DIVREM_2_THRESHOLD divrem_2_threshold
+extern mp_size_t divrem_2_threshold;
+#endif
+
+#undef MULMOD_BNM1_THRESHOLD
+#define MULMOD_BNM1_THRESHOLD mulmod_bnm1_threshold
+extern mp_size_t mulmod_bnm1_threshold;
+
+#undef SQRMOD_BNM1_THRESHOLD
+#define SQRMOD_BNM1_THRESHOLD sqrmod_bnm1_threshold
+extern mp_size_t sqrmod_bnm1_threshold;
+
+#undef GET_STR_DC_THRESHOLD
+#define GET_STR_DC_THRESHOLD get_str_dc_threshold
+extern mp_size_t get_str_dc_threshold;
+
+#undef GET_STR_PRECOMPUTE_THRESHOLD
+#define GET_STR_PRECOMPUTE_THRESHOLD get_str_precompute_threshold
+extern mp_size_t get_str_precompute_threshold;
+
+#undef SET_STR_DC_THRESHOLD
+#define SET_STR_DC_THRESHOLD set_str_dc_threshold
+extern mp_size_t set_str_dc_threshold;
+
+#undef SET_STR_PRECOMPUTE_THRESHOLD
+#define SET_STR_PRECOMPUTE_THRESHOLD set_str_precompute_threshold
+extern mp_size_t set_str_precompute_threshold;
+
+#undef FAC_ODD_THRESHOLD
+#define FAC_ODD_THRESHOLD fac_odd_threshold
+extern mp_size_t fac_odd_threshold;
+
+#undef FAC_DSC_THRESHOLD
+#define FAC_DSC_THRESHOLD fac_dsc_threshold
+extern mp_size_t fac_dsc_threshold;
+
+#undef FFT_TABLE_ATTRS
+#define FFT_TABLE_ATTRS
+extern mp_size_t mpn_fft_table[2][MPN_FFT_TABLE_SIZE];
+#define FFT_TABLE3_SIZE 2000 /* generous space for tuning */
+extern struct fft_table_nk mpn_fft_table3[2][FFT_TABLE3_SIZE];
+
+/* Sizes the tune program tests up to, used in a couple of recompilations. */
+#undef MUL_TOOM22_THRESHOLD_LIMIT
+#undef MUL_TOOM33_THRESHOLD_LIMIT
+#undef MULLO_BASECASE_THRESHOLD_LIMIT
+#undef SQR_TOOM3_THRESHOLD_LIMIT
+#define SQR_TOOM2_MAX_GENERIC 200
+#define MUL_TOOM22_THRESHOLD_LIMIT 700
+#define MUL_TOOM33_THRESHOLD_LIMIT 700
+#define SQR_TOOM3_THRESHOLD_LIMIT 400
+#define MUL_TOOM44_THRESHOLD_LIMIT 1000
+#define SQR_TOOM4_THRESHOLD_LIMIT 1000
+#define MUL_TOOM6H_THRESHOLD_LIMIT 1100
+#define SQR_TOOM6_THRESHOLD_LIMIT 1100
+#define MUL_TOOM8H_THRESHOLD_LIMIT 1200
+#define SQR_TOOM8_THRESHOLD_LIMIT 1200
+#define MULLO_BASECASE_THRESHOLD_LIMIT 200
+#define GET_STR_THRESHOLD_LIMIT 150
+#define FAC_DSC_THRESHOLD_LIMIT 2048
+
+#endif /* TUNE_PROGRAM_BUILD */
+
+#if defined (__cplusplus)
+}
+#endif
+
+/* FIXME: Make these itch functions less conservative. Also consider making
+ them dependent on just 'an', and compute the allocation directly from 'an'
+ instead of via n. */
+
+/* toom22/toom2: Scratch need is 2*(an + k), k is the recursion depth.
+ k is ths smallest k such that
+ ceil(an/2^k) < MUL_TOOM22_THRESHOLD.
+ which implies that
+ k = bitsize of floor ((an-1)/(MUL_TOOM22_THRESHOLD-1))
+ = 1 + floor (log_2 (floor ((an-1)/(MUL_TOOM22_THRESHOLD-1))))
+*/
+#define mpn_toom22_mul_itch(an, bn) \
+ (2 * ((an) + GMP_NUMB_BITS))
+#define mpn_toom2_sqr_itch(an) \
+ (2 * ((an) + GMP_NUMB_BITS))
+
+/* toom33/toom3: Scratch need is 5an/2 + 10k, k is the recursion depth.
+ We use 3an + C, so that we can use a smaller constant.
+ */
+#define mpn_toom33_mul_itch(an, bn) \
+ (3 * (an) + GMP_NUMB_BITS)
+#define mpn_toom3_sqr_itch(an) \
+ (3 * (an) + GMP_NUMB_BITS)
+
+/* toom33/toom3: Scratch need is 8an/3 + 13k, k is the recursion depth.
+ We use 3an + C, so that we can use a smaller constant.
+ */
+#define mpn_toom44_mul_itch(an, bn) \
+ (3 * (an) + GMP_NUMB_BITS)
+#define mpn_toom4_sqr_itch(an) \
+ (3 * (an) + GMP_NUMB_BITS)
+
+#define mpn_toom6_sqr_itch(n) \
+ (((n) - SQR_TOOM6_THRESHOLD)*2 + \
+ MAX(SQR_TOOM6_THRESHOLD*2 + GMP_NUMB_BITS*6, \
+ mpn_toom4_sqr_itch(SQR_TOOM6_THRESHOLD)))
+
+#define MUL_TOOM6H_MIN \
+ ((MUL_TOOM6H_THRESHOLD > MUL_TOOM44_THRESHOLD) ? \
+ MUL_TOOM6H_THRESHOLD : MUL_TOOM44_THRESHOLD)
+#define mpn_toom6_mul_n_itch(n) \
+ (((n) - MUL_TOOM6H_MIN)*2 + \
+ MAX(MUL_TOOM6H_MIN*2 + GMP_NUMB_BITS*6, \
+ mpn_toom44_mul_itch(MUL_TOOM6H_MIN,MUL_TOOM6H_MIN)))
+
+static inline mp_size_t
+mpn_toom6h_mul_itch (mp_size_t an, mp_size_t bn) {
+ mp_size_t estimatedN;
+ estimatedN = (an + bn) / (size_t) 10 + 1;
+ return mpn_toom6_mul_n_itch (estimatedN * 6);
+}
+
+#define mpn_toom8_sqr_itch(n) \
+ ((((n)*15)>>3) - ((SQR_TOOM8_THRESHOLD*15)>>3) + \
+ MAX(((SQR_TOOM8_THRESHOLD*15)>>3) + GMP_NUMB_BITS*6, \
+ mpn_toom6_sqr_itch(SQR_TOOM8_THRESHOLD)))
+
+#define MUL_TOOM8H_MIN \
+ ((MUL_TOOM8H_THRESHOLD > MUL_TOOM6H_MIN) ? \
+ MUL_TOOM8H_THRESHOLD : MUL_TOOM6H_MIN)
+#define mpn_toom8_mul_n_itch(n) \
+ ((((n)*15)>>3) - ((MUL_TOOM8H_MIN*15)>>3) + \
+ MAX(((MUL_TOOM8H_MIN*15)>>3) + GMP_NUMB_BITS*6, \
+ mpn_toom6_mul_n_itch(MUL_TOOM8H_MIN)))
+
+static inline mp_size_t
+mpn_toom8h_mul_itch (mp_size_t an, mp_size_t bn) {
+ mp_size_t estimatedN;
+ estimatedN = (an + bn) / (size_t) 14 + 1;
+ return mpn_toom8_mul_n_itch (estimatedN * 8);
+}
+
+static inline mp_size_t
+mpn_toom32_mul_itch (mp_size_t an, mp_size_t bn)
+{
+ mp_size_t n = 1 + (2 * an >= 3 * bn ? (an - 1) / (size_t) 3 : (bn - 1) >> 1);
+ mp_size_t itch = 2 * n + 1;
+
+ return itch;
+}
+
+static inline mp_size_t
+mpn_toom42_mul_itch (mp_size_t an, mp_size_t bn)
+{
+ mp_size_t n = an >= 2 * bn ? (an + 3) >> 2 : (bn + 1) >> 1;
+ return 6 * n + 3;
+}
+
+static inline mp_size_t
+mpn_toom43_mul_itch (mp_size_t an, mp_size_t bn)
+{
+ mp_size_t n = 1 + (3 * an >= 4 * bn ? (an - 1) >> 2 : (bn - 1) / (size_t) 3);
+
+ return 6*n + 4;
+}
+
+static inline mp_size_t
+mpn_toom52_mul_itch (mp_size_t an, mp_size_t bn)
+{
+ mp_size_t n = 1 + (2 * an >= 5 * bn ? (an - 1) / (size_t) 5 : (bn - 1) >> 1);
+ return 6*n + 4;
+}
+
+static inline mp_size_t
+mpn_toom53_mul_itch (mp_size_t an, mp_size_t bn)
+{
+ mp_size_t n = 1 + (3 * an >= 5 * bn ? (an - 1) / (size_t) 5 : (bn - 1) / (size_t) 3);
+ return 10 * n + 10;
+}
+
+static inline mp_size_t
+mpn_toom62_mul_itch (mp_size_t an, mp_size_t bn)
+{
+ mp_size_t n = 1 + (an >= 3 * bn ? (an - 1) / (size_t) 6 : (bn - 1) >> 1);
+ return 10 * n + 10;
+}
+
+static inline mp_size_t
+mpn_toom63_mul_itch (mp_size_t an, mp_size_t bn)
+{
+ mp_size_t n = 1 + (an >= 2 * bn ? (an - 1) / (size_t) 6 : (bn - 1) / (size_t) 3);
+ return 9 * n + 3;
+}
+
+static inline mp_size_t
+mpn_toom54_mul_itch (mp_size_t an, mp_size_t bn)
+{
+ mp_size_t n = 1 + (4 * an >= 5 * bn ? (an - 1) / (size_t) 5 : (bn - 1) / (size_t) 4);
+ return 9 * n + 3;
+}
+
+/* let S(n) = space required for input size n,
+ then S(n) = 3 floor(n/2) + 1 + S(floor(n/2)). */
+#define mpn_toom42_mulmid_itch(n) \
+ (3 * (n) + GMP_NUMB_BITS)
+
+#if 0
+#define mpn_fft_mul mpn_mul_fft_full
+#else
+#define mpn_fft_mul mpn_nussbaumer_mul
+#endif
+
+#ifdef __cplusplus
+
+/* A little helper for a null-terminated __gmp_allocate_func string.
+ The destructor ensures it's freed even if an exception is thrown.
+ The len field is needed by the destructor, and can be used by anyone else
+ to avoid a second strlen pass over the data.
+
+ Since our input is a C string, using strlen is correct. Perhaps it'd be
+ more C++-ish style to use std::char_traits<char>::length, but char_traits
+ isn't available in gcc 2.95.4. */
+
+class gmp_allocated_string {
+ public:
+ char *str;
+ size_t len;
+ gmp_allocated_string(char *arg)
+ {
+ str = arg;
+ len = std::strlen (str);
+ }
+ ~gmp_allocated_string()
+ {
+ (*__gmp_free_func) (str, len+1);
+ }
+};
+
+std::istream &__gmpz_operator_in_nowhite (std::istream &, mpz_ptr, char);
+int __gmp_istream_set_base (std::istream &, char &, bool &, bool &);
+void __gmp_istream_set_digits (std::string &, std::istream &, char &, bool &, int);
+void __gmp_doprnt_params_from_ios (struct doprnt_params_t *, std::ios &);
+std::ostream& __gmp_doprnt_integer_ostream (std::ostream &, struct doprnt_params_t *, char *);
+extern const struct doprnt_funs_t __gmp_asprintf_funs_noformat;
+
+#endif /* __cplusplus */
+
+#endif /* __GMP_IMPL_H__ */
diff --git a/Build/source/libs/gmp/gmp-6.0.0/gmpxx.h b/Build/source/libs/gmp/gmp-6.0.0/gmpxx.h
new file mode 100644
index 00000000000..6dd9129c5ab
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/gmpxx.h
@@ -0,0 +1,3336 @@
+/* gmpxx.h -- C++ class wrapper for GMP types. -*- C++ -*-
+
+Copyright 2001-2003, 2006, 2008, 2011, 2012 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/. */
+
+#ifndef __GMP_PLUSPLUS__
+#define __GMP_PLUSPLUS__
+
+#include <iosfwd>
+
+#include <cstring> /* for strlen */
+#include <limits> /* numeric_limits */
+#include <utility>
+#include <algorithm> /* swap */
+#include <string>
+#include <stdexcept>
+#include <cfloat>
+#include <gmp.h>
+
+// wrapper for gcc's __builtin_constant_p
+// __builtin_constant_p has been in gcc since forever,
+// but g++-3.4 miscompiles it.
+#if __GMP_GNUC_PREREQ(4, 2)
+#define __GMPXX_CONSTANT(X) __builtin_constant_p(X)
+#else
+#define __GMPXX_CONSTANT(X) false
+#endif
+#define __GMPXX_CONSTANT_TRUE(X) (__GMPXX_CONSTANT(X) && (X))
+
+// Use C++11 features
+#ifndef __GMPXX_USE_CXX11
+#if __cplusplus >= 201103L
+#define __GMPXX_USE_CXX11 1
+#else
+#define __GMPXX_USE_CXX11 0
+#endif
+#endif
+
+#if __GMPXX_USE_CXX11
+#define __GMPXX_NOEXCEPT noexcept
+#include <type_traits> // for common_type
+#else
+#define __GMPXX_NOEXCEPT
+#endif
+
+// Max allocations for plain types when converted to GMP types
+#if GMP_NAIL_BITS != 0 && ! defined _LONG_LONG_LIMB
+#define __GMPZ_ULI_LIMBS 2
+#else
+#define __GMPZ_ULI_LIMBS 1
+#endif
+
+#define __GMPXX_BITS_TO_LIMBS(n) (((n) + (GMP_NUMB_BITS - 1)) / GMP_NUMB_BITS)
+#define __GMPZ_DBL_LIMBS __GMPXX_BITS_TO_LIMBS(DBL_MAX_EXP)+1
+#define __GMPQ_NUM_DBL_LIMBS __GMPZ_DBL_LIMBS
+#define __GMPQ_DEN_DBL_LIMBS __GMPXX_BITS_TO_LIMBS(DBL_MANT_DIG+1-DBL_MIN_EXP)+1
+// The final +1s are a security margin. The current implementation of
+// mpq_set_d seems to need it for the denominator.
+
+inline void __mpz_set_ui_safe(mpz_ptr p, unsigned long l)
+{
+ p->_mp_size = (l != 0);
+ p->_mp_d[0] = l & GMP_NUMB_MASK;
+#if __GMPZ_ULI_LIMBS > 1
+ l >>= GMP_NUMB_BITS;
+ p->_mp_d[1] = l;
+ p->_mp_size += (l != 0);
+#endif
+}
+
+inline void __mpz_set_si_safe(mpz_ptr p, long l)
+{
+ if(l < 0)
+ {
+ __mpz_set_ui_safe(p, -static_cast<unsigned long>(l));
+ mpz_neg(p, p);
+ }
+ else
+ __mpz_set_ui_safe(p, l);
+ // Note: we know the high bit of l is 0 so we could do slightly better
+}
+
+// Fake temporary variables
+#define __GMPXX_TMPZ_UI \
+ mpz_t temp; \
+ mp_limb_t limbs[__GMPZ_ULI_LIMBS]; \
+ temp->_mp_d = limbs; \
+ __mpz_set_ui_safe (temp, l)
+#define __GMPXX_TMPZ_SI \
+ mpz_t temp; \
+ mp_limb_t limbs[__GMPZ_ULI_LIMBS]; \
+ temp->_mp_d = limbs; \
+ __mpz_set_si_safe (temp, l)
+#define __GMPXX_TMPZ_D \
+ mpz_t temp; \
+ mp_limb_t limbs[__GMPZ_DBL_LIMBS]; \
+ temp->_mp_d = limbs; \
+ temp->_mp_alloc = __GMPZ_DBL_LIMBS; \
+ mpz_set_d (temp, d)
+
+#define __GMPXX_TMPQ_UI \
+ mpq_t temp; \
+ mp_limb_t limbs[__GMPZ_ULI_LIMBS+1]; \
+ mpq_numref(temp)->_mp_d = limbs; \
+ __mpz_set_ui_safe (mpq_numref(temp), l); \
+ mpq_denref(temp)->_mp_d = limbs + __GMPZ_ULI_LIMBS; \
+ mpq_denref(temp)->_mp_size = 1; \
+ mpq_denref(temp)->_mp_d[0] = 1
+#define __GMPXX_TMPQ_SI \
+ mpq_t temp; \
+ mp_limb_t limbs[__GMPZ_ULI_LIMBS+1]; \
+ mpq_numref(temp)->_mp_d = limbs; \
+ __mpz_set_si_safe (mpq_numref(temp), l); \
+ mpq_denref(temp)->_mp_d = limbs + __GMPZ_ULI_LIMBS; \
+ mpq_denref(temp)->_mp_size = 1; \
+ mpq_denref(temp)->_mp_d[0] = 1
+#define __GMPXX_TMPQ_D \
+ mpq_t temp; \
+ mp_limb_t limbs[__GMPQ_NUM_DBL_LIMBS + __GMPQ_DEN_DBL_LIMBS]; \
+ mpq_numref(temp)->_mp_d = limbs; \
+ mpq_numref(temp)->_mp_alloc = __GMPQ_NUM_DBL_LIMBS; \
+ mpq_denref(temp)->_mp_d = limbs + __GMPQ_NUM_DBL_LIMBS; \
+ mpq_denref(temp)->_mp_alloc = __GMPQ_DEN_DBL_LIMBS; \
+ mpq_set_d (temp, d)
+
+inline unsigned long __gmpxx_abs_ui (signed long l)
+{
+ return l >= 0 ? static_cast<unsigned long>(l)
+ : -static_cast<unsigned long>(l);
+}
+
+/**************** Function objects ****************/
+/* Any evaluation of a __gmp_expr ends up calling one of these functions
+ all intermediate functions being inline, the evaluation should optimize
+ to a direct call to the relevant function, thus yielding no overhead
+ over the C interface. */
+
+struct __gmp_unary_plus
+{
+ static void eval(mpz_ptr z, mpz_srcptr w) { mpz_set(z, w); }
+ static void eval(mpq_ptr q, mpq_srcptr r) { mpq_set(q, r); }
+ static void eval(mpf_ptr f, mpf_srcptr g) { mpf_set(f, g); }
+};
+
+struct __gmp_unary_minus
+{
+ static void eval(mpz_ptr z, mpz_srcptr w) { mpz_neg(z, w); }
+ static void eval(mpq_ptr q, mpq_srcptr r) { mpq_neg(q, r); }
+ static void eval(mpf_ptr f, mpf_srcptr g) { mpf_neg(f, g); }
+};
+
+struct __gmp_unary_com
+{
+ static void eval(mpz_ptr z, mpz_srcptr w) { mpz_com(z, w); }
+};
+
+struct __gmp_binary_plus
+{
+ static void eval(mpz_ptr z, mpz_srcptr w, mpz_srcptr v)
+ { mpz_add(z, w, v); }
+
+ static void eval(mpz_ptr z, mpz_srcptr w, unsigned long int l)
+ {
+ // Ideally, those checks should happen earlier so that the tree
+ // generated for a+0+b would just be sum(a,b).
+ if (__GMPXX_CONSTANT(l) && l == 0)
+ {
+ if (z != w) mpz_set(z, w);
+ }
+ else
+ mpz_add_ui(z, w, l);
+ }
+ static void eval(mpz_ptr z, unsigned long int l, mpz_srcptr w)
+ { eval(z, w, l); }
+ static void eval(mpz_ptr z, mpz_srcptr w, signed long int l)
+ {
+ if (l >= 0)
+ eval(z, w, static_cast<unsigned long>(l));
+ else
+ mpz_sub_ui(z, w, -static_cast<unsigned long>(l));
+ }
+ static void eval(mpz_ptr z, signed long int l, mpz_srcptr w)
+ { eval(z, w, l); }
+ static void eval(mpz_ptr z, mpz_srcptr w, double d)
+ { __GMPXX_TMPZ_D; mpz_add (z, w, temp); }
+ static void eval(mpz_ptr z, double d, mpz_srcptr w)
+ { eval(z, w, d); }
+
+ static void eval(mpq_ptr q, mpq_srcptr r, mpq_srcptr s)
+ { mpq_add(q, r, s); }
+
+ static void eval(mpq_ptr q, mpq_srcptr r, unsigned long int l)
+ {
+ if (__GMPXX_CONSTANT(l) && l == 0)
+ {
+ if (q != r) mpq_set(q, r);
+ }
+ else
+ {
+ if (q == r)
+ mpz_addmul_ui(mpq_numref(q), mpq_denref(q), l);
+ else
+ {
+ mpz_mul_ui(mpq_numref(q), mpq_denref(r), l);
+ mpz_add(mpq_numref(q), mpq_numref(q), mpq_numref(r));
+ mpz_set(mpq_denref(q), mpq_denref(r));
+ }
+ }
+ }
+ static void eval(mpq_ptr q, unsigned long int l, mpq_srcptr r)
+ { eval(q, r, l); }
+ static inline void eval(mpq_ptr q, mpq_srcptr r, signed long int l);
+ // defined after __gmp_binary_minus
+ static void eval(mpq_ptr q, signed long int l, mpq_srcptr r)
+ { eval(q, r, l); }
+ static void eval(mpq_ptr q, mpq_srcptr r, double d)
+ { __GMPXX_TMPQ_D; mpq_add (q, r, temp); }
+ static void eval(mpq_ptr q, double d, mpq_srcptr r)
+ { eval(q, r, d); }
+
+ static void eval(mpq_ptr q, mpq_srcptr r, mpz_srcptr z)
+ {
+ if (q == r)
+ mpz_addmul(mpq_numref(q), mpq_denref(q), z);
+ else
+ {
+ mpz_mul(mpq_numref(q), mpq_denref(r), z);
+ mpz_add(mpq_numref(q), mpq_numref(q), mpq_numref(r));
+ mpz_set(mpq_denref(q), mpq_denref(r));
+ }
+ }
+ static void eval(mpq_ptr q, mpz_srcptr z, mpq_srcptr r)
+ { eval(q, r, z); }
+
+ static void eval(mpf_ptr f, mpf_srcptr g, mpf_srcptr h)
+ { mpf_add(f, g, h); }
+
+ static void eval(mpf_ptr f, mpf_srcptr g, unsigned long int l)
+ { mpf_add_ui(f, g, l); }
+ static void eval(mpf_ptr f, unsigned long int l, mpf_srcptr g)
+ { mpf_add_ui(f, g, l); }
+ static void eval(mpf_ptr f, mpf_srcptr g, signed long int l)
+ {
+ if (l >= 0)
+ mpf_add_ui(f, g, l);
+ else
+ mpf_sub_ui(f, g, -static_cast<unsigned long>(l));
+ }
+ static void eval(mpf_ptr f, signed long int l, mpf_srcptr g)
+ { eval(f, g, l); }
+ static void eval(mpf_ptr f, mpf_srcptr g, double d)
+ {
+ mpf_t temp;
+ mpf_init2(temp, 8*sizeof(double));
+ mpf_set_d(temp, d);
+ mpf_add(f, g, temp);
+ mpf_clear(temp);
+ }
+ static void eval(mpf_ptr f, double d, mpf_srcptr g)
+ { eval(f, g, d); }
+};
+
+struct __gmp_binary_minus
+{
+ static void eval(mpz_ptr z, mpz_srcptr w, mpz_srcptr v)
+ { mpz_sub(z, w, v); }
+
+ static void eval(mpz_ptr z, mpz_srcptr w, unsigned long int l)
+ {
+ if (__GMPXX_CONSTANT(l) && l == 0)
+ {
+ if (z != w) mpz_set(z, w);
+ }
+ else
+ mpz_sub_ui(z, w, l);
+ }
+ static void eval(mpz_ptr z, unsigned long int l, mpz_srcptr w)
+ {
+ if (__GMPXX_CONSTANT(l) && l == 0)
+ {
+ mpz_neg(z, w);
+ }
+ else
+ mpz_ui_sub(z, l, w);
+ }
+ static void eval(mpz_ptr z, mpz_srcptr w, signed long int l)
+ {
+ if (l >= 0)
+ eval(z, w, static_cast<unsigned long>(l));
+ else
+ mpz_add_ui(z, w, -static_cast<unsigned long>(l));
+ }
+ static void eval(mpz_ptr z, signed long int l, mpz_srcptr w)
+ {
+ if (l >= 0)
+ eval(z, static_cast<unsigned long>(l), w);
+ else
+ {
+ mpz_add_ui(z, w, -static_cast<unsigned long>(l));
+ mpz_neg(z, z);
+ }
+ }
+ static void eval(mpz_ptr z, mpz_srcptr w, double d)
+ { __GMPXX_TMPZ_D; mpz_sub (z, w, temp); }
+ static void eval(mpz_ptr z, double d, mpz_srcptr w)
+ { __GMPXX_TMPZ_D; mpz_sub (z, temp, w); }
+
+ static void eval(mpq_ptr q, mpq_srcptr r, mpq_srcptr s)
+ { mpq_sub(q, r, s); }
+
+ static void eval(mpq_ptr q, mpq_srcptr r, unsigned long int l)
+ {
+ if (__GMPXX_CONSTANT(l) && l == 0)
+ {
+ if (q != r) mpq_set(q, r);
+ }
+ else
+ {
+ if (q == r)
+ mpz_submul_ui(mpq_numref(q), mpq_denref(q), l);
+ else
+ {
+ mpz_mul_ui(mpq_numref(q), mpq_denref(r), l);
+ mpz_sub(mpq_numref(q), mpq_numref(r), mpq_numref(q));
+ mpz_set(mpq_denref(q), mpq_denref(r));
+ }
+ }
+ }
+ static void eval(mpq_ptr q, unsigned long int l, mpq_srcptr r)
+ { eval(q, r, l); mpq_neg(q, q); }
+ static void eval(mpq_ptr q, mpq_srcptr r, signed long int l)
+ {
+ if (l >= 0)
+ eval(q, r, static_cast<unsigned long>(l));
+ else
+ __gmp_binary_plus::eval(q, r, -static_cast<unsigned long>(l));
+ }
+ static void eval(mpq_ptr q, signed long int l, mpq_srcptr r)
+ { eval(q, r, l); mpq_neg(q, q); }
+ static void eval(mpq_ptr q, mpq_srcptr r, double d)
+ { __GMPXX_TMPQ_D; mpq_sub (q, r, temp); }
+ static void eval(mpq_ptr q, double d, mpq_srcptr r)
+ { __GMPXX_TMPQ_D; mpq_sub (q, temp, r); }
+
+ static void eval(mpq_ptr q, mpq_srcptr r, mpz_srcptr z)
+ {
+ if (q == r)
+ mpz_submul(mpq_numref(q), mpq_denref(q), z);
+ else
+ {
+ mpz_mul(mpq_numref(q), mpq_denref(r), z);
+ mpz_sub(mpq_numref(q), mpq_numref(r), mpq_numref(q));
+ mpz_set(mpq_denref(q), mpq_denref(r));
+ }
+ }
+ static void eval(mpq_ptr q, mpz_srcptr z, mpq_srcptr r)
+ { eval(q, r, z); mpq_neg(q, q); }
+
+ static void eval(mpf_ptr f, mpf_srcptr g, mpf_srcptr h)
+ { mpf_sub(f, g, h); }
+
+ static void eval(mpf_ptr f, mpf_srcptr g, unsigned long int l)
+ { mpf_sub_ui(f, g, l); }
+ static void eval(mpf_ptr f, unsigned long int l, mpf_srcptr g)
+ { mpf_ui_sub(f, l, g); }
+ static void eval(mpf_ptr f, mpf_srcptr g, signed long int l)
+ {
+ if (l >= 0)
+ mpf_sub_ui(f, g, l);
+ else
+ mpf_add_ui(f, g, -static_cast<unsigned long>(l));
+ }
+ static void eval(mpf_ptr f, signed long int l, mpf_srcptr g)
+ {
+ if (l >= 0)
+ mpf_sub_ui(f, g, l);
+ else
+ mpf_add_ui(f, g, -static_cast<unsigned long>(l));
+ mpf_neg(f, f);
+ }
+ static void eval(mpf_ptr f, mpf_srcptr g, double d)
+ {
+ mpf_t temp;
+ mpf_init2(temp, 8*sizeof(double));
+ mpf_set_d(temp, d);
+ mpf_sub(f, g, temp);
+ mpf_clear(temp);
+ }
+ static void eval(mpf_ptr f, double d, mpf_srcptr g)
+ {
+ mpf_t temp;
+ mpf_init2(temp, 8*sizeof(double));
+ mpf_set_d(temp, d);
+ mpf_sub(f, temp, g);
+ mpf_clear(temp);
+ }
+};
+
+// defined here so it can reference __gmp_binary_minus
+inline void
+__gmp_binary_plus::eval(mpq_ptr q, mpq_srcptr r, signed long int l)
+{
+ if (l >= 0)
+ eval(q, r, static_cast<unsigned long>(l));
+ else
+ __gmp_binary_minus::eval(q, r, -static_cast<unsigned long>(l));
+}
+
+struct __gmp_binary_lshift
+{
+ static void eval(mpz_ptr z, mpz_srcptr w, mp_bitcnt_t l)
+ {
+ if (__GMPXX_CONSTANT(l) && (l == 0))
+ {
+ if (z != w) mpz_set(z, w);
+ }
+ else
+ mpz_mul_2exp(z, w, l);
+ }
+ static void eval(mpq_ptr q, mpq_srcptr r, mp_bitcnt_t l)
+ {
+ if (__GMPXX_CONSTANT(l) && (l == 0))
+ {
+ if (q != r) mpq_set(q, r);
+ }
+ else
+ mpq_mul_2exp(q, r, l);
+ }
+ static void eval(mpf_ptr f, mpf_srcptr g, mp_bitcnt_t l)
+ { mpf_mul_2exp(f, g, l); }
+};
+
+struct __gmp_binary_rshift
+{
+ static void eval(mpz_ptr z, mpz_srcptr w, mp_bitcnt_t l)
+ {
+ if (__GMPXX_CONSTANT(l) && (l == 0))
+ {
+ if (z != w) mpz_set(z, w);
+ }
+ else
+ mpz_fdiv_q_2exp(z, w, l);
+ }
+ static void eval(mpq_ptr q, mpq_srcptr r, mp_bitcnt_t l)
+ {
+ if (__GMPXX_CONSTANT(l) && (l == 0))
+ {
+ if (q != r) mpq_set(q, r);
+ }
+ else
+ mpq_div_2exp(q, r, l);
+ }
+ static void eval(mpf_ptr f, mpf_srcptr g, mp_bitcnt_t l)
+ { mpf_div_2exp(f, g, l); }
+};
+
+struct __gmp_binary_multiplies
+{
+ static void eval(mpz_ptr z, mpz_srcptr w, mpz_srcptr v)
+ { mpz_mul(z, w, v); }
+
+ static void eval(mpz_ptr z, mpz_srcptr w, unsigned long int l)
+ {
+// gcc-3.3 doesn't have __builtin_ctzl. Don't bother optimizing for old gcc.
+#if __GMP_GNUC_PREREQ(3, 4)
+ if (__GMPXX_CONSTANT(l) && (l & (l-1)) == 0)
+ {
+ if (l == 0)
+ {
+ z->_mp_size = 0;
+ }
+ else
+ {
+ __gmp_binary_lshift::eval(z, w, __builtin_ctzl(l));
+ }
+ }
+ else
+#endif
+ mpz_mul_ui(z, w, l);
+ }
+ static void eval(mpz_ptr z, unsigned long int l, mpz_srcptr w)
+ { eval(z, w, l); }
+ static void eval(mpz_ptr z, mpz_srcptr w, signed long int l)
+ {
+ if (__GMPXX_CONSTANT_TRUE(l >= 0))
+ eval(z, w, static_cast<unsigned long>(l));
+ else if (__GMPXX_CONSTANT_TRUE(l <= 0))
+ {
+ eval(z, w, -static_cast<unsigned long>(l));
+ mpz_neg(z, z);
+ }
+ else
+ mpz_mul_si (z, w, l);
+ }
+ static void eval(mpz_ptr z, signed long int l, mpz_srcptr w)
+ { eval(z, w, l); }
+ static void eval(mpz_ptr z, mpz_srcptr w, double d)
+ { __GMPXX_TMPZ_D; mpz_mul (z, w, temp); }
+ static void eval(mpz_ptr z, double d, mpz_srcptr w)
+ { eval(z, w, d); }
+
+ static void eval(mpq_ptr q, mpq_srcptr r, mpq_srcptr s)
+ { mpq_mul(q, r, s); }
+
+ static void eval(mpq_ptr q, mpq_srcptr r, unsigned long int l)
+ {
+#if __GMP_GNUC_PREREQ(3, 4)
+ if (__GMPXX_CONSTANT(l) && (l & (l-1)) == 0)
+ {
+ if (l == 0)
+ {
+ mpq_set_ui(q, 0, 1);
+ }
+ else
+ {
+ __gmp_binary_lshift::eval(q, r, __builtin_ctzl(l));
+ }
+ }
+ else
+#endif
+ {
+ __GMPXX_TMPQ_UI;
+ mpq_mul (q, r, temp);
+ }
+ }
+ static void eval(mpq_ptr q, unsigned long int l, mpq_srcptr r)
+ { eval(q, r, l); }
+ static void eval(mpq_ptr q, mpq_srcptr r, signed long int l)
+ {
+ if (__GMPXX_CONSTANT_TRUE(l >= 0))
+ eval(q, r, static_cast<unsigned long>(l));
+ else if (__GMPXX_CONSTANT_TRUE(l <= 0))
+ {
+ eval(q, r, -static_cast<unsigned long>(l));
+ mpq_neg(q, q);
+ }
+ else
+ {
+ __GMPXX_TMPQ_SI;
+ mpq_mul (q, r, temp);
+ }
+ }
+ static void eval(mpq_ptr q, signed long int l, mpq_srcptr r)
+ { eval(q, r, l); }
+ static void eval(mpq_ptr q, mpq_srcptr r, double d)
+ { __GMPXX_TMPQ_D; mpq_mul (q, r, temp); }
+ static void eval(mpq_ptr q, double d, mpq_srcptr r)
+ { eval(q, r, d); }
+
+ static void eval(mpf_ptr f, mpf_srcptr g, mpf_srcptr h)
+ { mpf_mul(f, g, h); }
+
+ static void eval(mpf_ptr f, mpf_srcptr g, unsigned long int l)
+ { mpf_mul_ui(f, g, l); }
+ static void eval(mpf_ptr f, unsigned long int l, mpf_srcptr g)
+ { mpf_mul_ui(f, g, l); }
+ static void eval(mpf_ptr f, mpf_srcptr g, signed long int l)
+ {
+ if (l >= 0)
+ mpf_mul_ui(f, g, l);
+ else
+ {
+ mpf_mul_ui(f, g, -static_cast<unsigned long>(l));
+ mpf_neg(f, f);
+ }
+ }
+ static void eval(mpf_ptr f, signed long int l, mpf_srcptr g)
+ { eval(f, g, l); }
+ static void eval(mpf_ptr f, mpf_srcptr g, double d)
+ {
+ mpf_t temp;
+ mpf_init2(temp, 8*sizeof(double));
+ mpf_set_d(temp, d);
+ mpf_mul(f, g, temp);
+ mpf_clear(temp);
+ }
+ static void eval(mpf_ptr f, double d, mpf_srcptr g)
+ { eval(f, g, d); }
+};
+
+struct __gmp_binary_divides
+{
+ static void eval(mpz_ptr z, mpz_srcptr w, mpz_srcptr v)
+ { mpz_tdiv_q(z, w, v); }
+
+ static void eval(mpz_ptr z, mpz_srcptr w, unsigned long int l)
+ {
+#if __GMP_GNUC_PREREQ(3, 4)
+ // Don't optimize division by 0...
+ if (__GMPXX_CONSTANT(l) && (l & (l-1)) == 0 && l != 0)
+ {
+ if (l == 1)
+ {
+ if (z != w) mpz_set(z, w);
+ }
+ else
+ mpz_tdiv_q_2exp(z, w, __builtin_ctzl(l));
+ // warning: do not use rshift (fdiv)
+ }
+ else
+#endif
+ mpz_tdiv_q_ui(z, w, l);
+ }
+ static void eval(mpz_ptr z, unsigned long int l, mpz_srcptr w)
+ {
+ if (mpz_sgn(w) >= 0)
+ {
+ if (mpz_fits_ulong_p(w))
+ mpz_set_ui(z, l / mpz_get_ui(w));
+ else
+ mpz_set_ui(z, 0);
+ }
+ else
+ {
+ mpz_neg(z, w);
+ if (mpz_fits_ulong_p(z))
+ {
+ mpz_set_ui(z, l / mpz_get_ui(z));
+ mpz_neg(z, z);
+ }
+ else
+ mpz_set_ui(z, 0);
+ }
+ }
+ static void eval(mpz_ptr z, mpz_srcptr w, signed long int l)
+ {
+ if (l >= 0)
+ eval(z, w, static_cast<unsigned long>(l));
+ else
+ {
+ eval(z, w, -static_cast<unsigned long>(l));
+ mpz_neg(z, z);
+ }
+ }
+ static void eval(mpz_ptr z, signed long int l, mpz_srcptr w)
+ {
+ if (mpz_fits_slong_p(w))
+ mpz_set_si(z, l / mpz_get_si(w));
+ else
+ {
+ /* if w is bigger than a long then the quotient must be zero, unless
+ l==LONG_MIN and w==-LONG_MIN in which case the quotient is -1 */
+ mpz_set_si (z, (mpz_cmpabs_ui (w, __gmpxx_abs_ui(l)) == 0 ? -1 : 0));
+ }
+ }
+ static void eval(mpz_ptr z, mpz_srcptr w, double d)
+ { __GMPXX_TMPZ_D; mpz_tdiv_q (z, w, temp); }
+ static void eval(mpz_ptr z, double d, mpz_srcptr w)
+ { __GMPXX_TMPZ_D; mpz_tdiv_q (z, temp, w); }
+
+ static void eval(mpq_ptr q, mpq_srcptr r, mpq_srcptr s)
+ { mpq_div(q, r, s); }
+
+ static void eval(mpq_ptr q, mpq_srcptr r, unsigned long int l)
+ {
+#if __GMP_GNUC_PREREQ(3, 4)
+ if (__GMPXX_CONSTANT(l) && (l & (l-1)) == 0 && l != 0)
+ __gmp_binary_rshift::eval(q, r, __builtin_ctzl(l));
+ else
+#endif
+ {
+ __GMPXX_TMPQ_UI;
+ mpq_div (q, r, temp);
+ }
+ }
+ static void eval(mpq_ptr q, unsigned long int l, mpq_srcptr r)
+ { __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))
+ eval(q, r, static_cast<unsigned long>(l));
+ else if (__GMPXX_CONSTANT_TRUE(l <= 0))
+ {
+ eval(q, r, -static_cast<unsigned long>(l));
+ mpq_neg(q, q);
+ }
+ else
+ {
+ __GMPXX_TMPQ_SI;
+ mpq_div (q, r, temp);
+ }
+ }
+ static void eval(mpq_ptr q, signed long int l, mpq_srcptr r)
+ { __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)
+ { __GMPXX_TMPQ_D; mpq_div (q, temp, r); }
+
+ static void eval(mpf_ptr f, mpf_srcptr g, mpf_srcptr h)
+ { mpf_div(f, g, h); }
+
+ static void eval(mpf_ptr f, mpf_srcptr g, unsigned long int l)
+ { mpf_div_ui(f, g, l); }
+ static void eval(mpf_ptr f, unsigned long int l, mpf_srcptr g)
+ { mpf_ui_div(f, l, g); }
+ static void eval(mpf_ptr f, mpf_srcptr g, signed long int l)
+ {
+ if (l >= 0)
+ mpf_div_ui(f, g, l);
+ else
+ {
+ mpf_div_ui(f, g, -static_cast<unsigned long>(l));
+ mpf_neg(f, f);
+ }
+ }
+ static void eval(mpf_ptr f, signed long int l, mpf_srcptr g)
+ {
+ if (l >= 0)
+ mpf_ui_div(f, l, g);
+ else
+ {
+ mpf_ui_div(f, -static_cast<unsigned long>(l), g);
+ mpf_neg(f, f);
+ }
+ }
+ static void eval(mpf_ptr f, mpf_srcptr g, double d)
+ {
+ mpf_t temp;
+ mpf_init2(temp, 8*sizeof(double));
+ mpf_set_d(temp, d);
+ mpf_div(f, g, temp);
+ mpf_clear(temp);
+ }
+ static void eval(mpf_ptr f, double d, mpf_srcptr g)
+ {
+ mpf_t temp;
+ mpf_init2(temp, 8*sizeof(double));
+ mpf_set_d(temp, d);
+ mpf_div(f, temp, g);
+ mpf_clear(temp);
+ }
+};
+
+struct __gmp_binary_modulus
+{
+ static void eval(mpz_ptr z, mpz_srcptr w, mpz_srcptr v)
+ { mpz_tdiv_r(z, w, v); }
+
+ static void eval(mpz_ptr z, mpz_srcptr w, unsigned long int l)
+ { mpz_tdiv_r_ui(z, w, l); }
+ static void eval(mpz_ptr z, unsigned long int l, mpz_srcptr w)
+ {
+ if (mpz_sgn(w) >= 0)
+ {
+ if (mpz_fits_ulong_p(w))
+ mpz_set_ui(z, l % mpz_get_ui(w));
+ else
+ mpz_set_ui(z, l);
+ }
+ else
+ {
+ mpz_neg(z, w);
+ if (mpz_fits_ulong_p(z))
+ mpz_set_ui(z, l % mpz_get_ui(z));
+ else
+ mpz_set_ui(z, l);
+ }
+ }
+ static void eval(mpz_ptr z, mpz_srcptr w, signed long int l)
+ {
+ mpz_tdiv_r_ui (z, w, __gmpxx_abs_ui(l));
+ }
+ static void eval(mpz_ptr z, signed long int l, mpz_srcptr w)
+ {
+ if (mpz_fits_slong_p(w))
+ mpz_set_si(z, l % mpz_get_si(w));
+ else
+ {
+ /* if w is bigger than a long then the remainder is l unchanged,
+ unless l==LONG_MIN and w==-LONG_MIN in which case it's 0 */
+ mpz_set_si (z, mpz_cmpabs_ui (w, __gmpxx_abs_ui(l)) == 0 ? 0 : l);
+ }
+ }
+ static void eval(mpz_ptr z, mpz_srcptr w, double d)
+ { __GMPXX_TMPZ_D; mpz_tdiv_r (z, w, temp); }
+ static void eval(mpz_ptr z, double d, mpz_srcptr w)
+ { __GMPXX_TMPZ_D; mpz_tdiv_r (z, temp, w); }
+};
+
+struct __gmp_binary_and
+{
+ static void eval(mpz_ptr z, mpz_srcptr w, mpz_srcptr v)
+ { mpz_and(z, w, v); }
+
+ static void eval(mpz_ptr z, mpz_srcptr w, unsigned long int l)
+ { __GMPXX_TMPZ_UI; mpz_and (z, w, temp); }
+ static void eval(mpz_ptr z, unsigned long int l, mpz_srcptr w)
+ { eval(z, w, l); }
+ static void eval(mpz_ptr z, mpz_srcptr w, signed long int l)
+ { __GMPXX_TMPZ_SI; mpz_and (z, w, temp); }
+ static void eval(mpz_ptr z, signed long int l, mpz_srcptr w)
+ { eval(z, w, l); }
+ static void eval(mpz_ptr z, mpz_srcptr w, double d)
+ { __GMPXX_TMPZ_D; mpz_and (z, w, temp); }
+ static void eval(mpz_ptr z, double d, mpz_srcptr w)
+ { eval(z, w, d); }
+};
+
+struct __gmp_binary_ior
+{
+ static void eval(mpz_ptr z, mpz_srcptr w, mpz_srcptr v)
+ { mpz_ior(z, w, v); }
+ static void eval(mpz_ptr z, mpz_srcptr w, unsigned long int l)
+ { __GMPXX_TMPZ_UI; mpz_ior (z, w, temp); }
+ static void eval(mpz_ptr z, unsigned long int l, mpz_srcptr w)
+ { eval(z, w, l); }
+ static void eval(mpz_ptr z, mpz_srcptr w, signed long int l)
+ { __GMPXX_TMPZ_SI; mpz_ior (z, w, temp); }
+ static void eval(mpz_ptr z, signed long int l, mpz_srcptr w)
+ { eval(z, w, l); }
+ static void eval(mpz_ptr z, mpz_srcptr w, double d)
+ { __GMPXX_TMPZ_D; mpz_ior (z, w, temp); }
+ static void eval(mpz_ptr z, double d, mpz_srcptr w)
+ { eval(z, w, d); }
+};
+
+struct __gmp_binary_xor
+{
+ static void eval(mpz_ptr z, mpz_srcptr w, mpz_srcptr v)
+ { mpz_xor(z, w, v); }
+ static void eval(mpz_ptr z, mpz_srcptr w, unsigned long int l)
+ { __GMPXX_TMPZ_UI; mpz_xor (z, w, temp); }
+ static void eval(mpz_ptr z, unsigned long int l, mpz_srcptr w)
+ { eval(z, w, l); }
+ static void eval(mpz_ptr z, mpz_srcptr w, signed long int l)
+ { __GMPXX_TMPZ_SI; mpz_xor (z, w, temp); }
+ static void eval(mpz_ptr z, signed long int l, mpz_srcptr w)
+ { eval(z, w, l); }
+ static void eval(mpz_ptr z, mpz_srcptr w, double d)
+ { __GMPXX_TMPZ_D; mpz_xor (z, w, temp); }
+ static void eval(mpz_ptr z, double d, mpz_srcptr w)
+ { eval(z, w, d); }
+};
+
+struct __gmp_binary_equal
+{
+ static bool eval(mpz_srcptr z, mpz_srcptr w) { return mpz_cmp(z, w) == 0; }
+
+ static bool eval(mpz_srcptr z, unsigned long int l)
+ { return mpz_cmp_ui(z, l) == 0; }
+ static bool eval(unsigned long int l, mpz_srcptr z)
+ { return eval(z, l); }
+ static bool eval(mpz_srcptr z, signed long int l)
+ { return mpz_cmp_si(z, l) == 0; }
+ static bool eval(signed long int l, mpz_srcptr z)
+ { return eval(z, l); }
+ static bool eval(mpz_srcptr z, double d)
+ { return mpz_cmp_d(z, d) == 0; }
+ static bool eval(double d, mpz_srcptr z)
+ { return eval(z, d); }
+
+ static bool eval(mpq_srcptr q, mpq_srcptr r)
+ { return mpq_equal(q, r) != 0; }
+
+ static bool eval(mpq_srcptr q, unsigned long int l)
+ { return mpq_cmp_ui(q, l, 1) == 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; }
+ static bool eval(signed long int l, mpq_srcptr q)
+ { return eval(q, l); }
+ static bool eval(mpq_srcptr q, double d)
+ { __GMPXX_TMPQ_D; return mpq_equal (q, temp) != 0; }
+ static bool eval(double d, mpq_srcptr q)
+ { return eval(q, d); }
+
+ static bool eval(mpf_srcptr f, mpf_srcptr g) { return mpf_cmp(f, g) == 0; }
+
+ static bool eval(mpf_srcptr f, unsigned long int l)
+ { return mpf_cmp_ui(f, l) == 0; }
+ static bool eval(unsigned long int l, mpf_srcptr f)
+ { return eval(f, l); }
+ static bool eval(mpf_srcptr f, signed long int l)
+ { return mpf_cmp_si(f, l) == 0; }
+ static bool eval(signed long int l, mpf_srcptr f)
+ { return eval(f, l); }
+ static bool eval(mpf_srcptr f, double d)
+ { return mpf_cmp_d(f, d) == 0; }
+ static bool eval(double d, mpf_srcptr f)
+ { return eval(f, d); }
+};
+
+struct __gmp_binary_less
+{
+ static bool eval(mpz_srcptr z, mpz_srcptr w) { return mpz_cmp(z, w) < 0; }
+
+ static bool eval(mpz_srcptr z, unsigned long int l)
+ { return mpz_cmp_ui(z, l) < 0; }
+ static bool eval(unsigned long int l, mpz_srcptr z)
+ { return mpz_cmp_ui(z, l) > 0; }
+ static bool eval(mpz_srcptr z, signed long int l)
+ { return mpz_cmp_si(z, l) < 0; }
+ static bool eval(signed long int l, mpz_srcptr z)
+ { return mpz_cmp_si(z, l) > 0; }
+ static bool eval(mpz_srcptr z, double d)
+ { return mpz_cmp_d(z, d) < 0; }
+ static bool eval(double d, mpz_srcptr z)
+ { return mpz_cmp_d(z, d) > 0; }
+
+ static bool eval(mpq_srcptr q, mpq_srcptr r) { return mpq_cmp(q, r) < 0; }
+
+ static bool eval(mpq_srcptr q, unsigned long int l)
+ { return mpq_cmp_ui(q, l, 1) < 0; }
+ static bool eval(unsigned long int l, mpq_srcptr q)
+ { return mpq_cmp_ui(q, l, 1) > 0; }
+ static bool eval(mpq_srcptr q, signed long int l)
+ { return mpq_cmp_si(q, l, 1) < 0; }
+ static bool eval(signed long int l, mpq_srcptr q)
+ { return mpq_cmp_si(q, l, 1) > 0; }
+ static bool eval(mpq_srcptr q, double d)
+ { __GMPXX_TMPQ_D; return mpq_cmp (q, temp) < 0; }
+ static bool eval(double d, mpq_srcptr q)
+ { __GMPXX_TMPQ_D; return mpq_cmp (temp, q) < 0; }
+
+ static bool eval(mpf_srcptr f, mpf_srcptr g) { return mpf_cmp(f, g) < 0; }
+
+ static bool eval(mpf_srcptr f, unsigned long int l)
+ { return mpf_cmp_ui(f, l) < 0; }
+ static bool eval(unsigned long int l, mpf_srcptr f)
+ { return mpf_cmp_ui(f, l) > 0; }
+ static bool eval(mpf_srcptr f, signed long int l)
+ { return mpf_cmp_si(f, l) < 0; }
+ static bool eval(signed long int l, mpf_srcptr f)
+ { return mpf_cmp_si(f, l) > 0; }
+ static bool eval(mpf_srcptr f, double d)
+ { return mpf_cmp_d(f, d) < 0; }
+ static bool eval(double d, mpf_srcptr f)
+ { return mpf_cmp_d(f, d) > 0; }
+};
+
+struct __gmp_binary_greater
+{
+ template <class T, class U>
+ static inline bool eval(T t, U u) { return __gmp_binary_less::eval(u, t); }
+};
+
+struct __gmp_unary_increment
+{
+ static void eval(mpz_ptr z) { mpz_add_ui(z, z, 1); }
+ static void eval(mpq_ptr q)
+ { mpz_add(mpq_numref(q), mpq_numref(q), mpq_denref(q)); }
+ static void eval(mpf_ptr f) { mpf_add_ui(f, f, 1); }
+};
+
+struct __gmp_unary_decrement
+{
+ static void eval(mpz_ptr z) { mpz_sub_ui(z, z, 1); }
+ static void eval(mpq_ptr q)
+ { mpz_sub(mpq_numref(q), mpq_numref(q), mpq_denref(q)); }
+ static void eval(mpf_ptr f) { mpf_sub_ui(f, f, 1); }
+};
+
+struct __gmp_abs_function
+{
+ static void eval(mpz_ptr z, mpz_srcptr w) { mpz_abs(z, w); }
+ static void eval(mpq_ptr q, mpq_srcptr r) { mpq_abs(q, r); }
+ static void eval(mpf_ptr f, mpf_srcptr g) { mpf_abs(f, g); }
+};
+
+struct __gmp_trunc_function
+{
+ static void eval(mpf_ptr f, mpf_srcptr g) { mpf_trunc(f, g); }
+};
+
+struct __gmp_floor_function
+{
+ static void eval(mpf_ptr f, mpf_srcptr g) { mpf_floor(f, g); }
+};
+
+struct __gmp_ceil_function
+{
+ static void eval(mpf_ptr f, mpf_srcptr g) { mpf_ceil(f, g); }
+};
+
+struct __gmp_sqrt_function
+{
+ static void eval(mpz_ptr z, mpz_srcptr w) { mpz_sqrt(z, w); }
+ static void eval(mpf_ptr f, mpf_srcptr g) { mpf_sqrt(f, g); }
+};
+
+struct __gmp_hypot_function
+{
+ static void eval(mpf_ptr f, mpf_srcptr g, mpf_srcptr h)
+ {
+ mpf_t temp;
+ mpf_init2(temp, mpf_get_prec(f));
+ mpf_mul(temp, g, g);
+ mpf_mul(f, h, h);
+ mpf_add(f, f, temp);
+ mpf_sqrt(f, f);
+ mpf_clear(temp);
+ }
+
+ static void eval(mpf_ptr f, mpf_srcptr g, unsigned long int l)
+ {
+ mpf_t temp;
+ mpf_init2(temp, mpf_get_prec(f));
+ mpf_mul(temp, g, g);
+ mpf_set_ui(f, l);
+ mpf_mul_ui(f, f, l);
+ mpf_add(f, f, temp);
+ mpf_clear(temp);
+ mpf_sqrt(f, f);
+ }
+ static void eval(mpf_ptr f, unsigned long int l, mpf_srcptr g)
+ { eval(f, g, l); }
+ static void eval(mpf_ptr f, mpf_srcptr g, signed long int l)
+ { eval(f, g, __gmpxx_abs_ui(l)); }
+ static void eval(mpf_ptr f, signed long int l, mpf_srcptr g)
+ { eval(f, g, l); }
+ static void eval(mpf_ptr f, mpf_srcptr g, double d)
+ {
+ mpf_t temp;
+ mpf_init2(temp, mpf_get_prec(f));
+ mpf_mul(temp, g, g);
+ mpf_set_d(f, d);
+ mpf_mul(f, f, f);
+ mpf_add(f, f, temp);
+ mpf_sqrt(f, f);
+ mpf_clear(temp);
+ }
+ static void eval(mpf_ptr f, double d, mpf_srcptr g)
+ { eval(f, g, d); }
+};
+
+struct __gmp_sgn_function
+{
+ static int eval(mpz_srcptr z) { return mpz_sgn(z); }
+ static int eval(mpq_srcptr q) { return mpq_sgn(q); }
+ static int eval(mpf_srcptr f) { return mpf_sgn(f); }
+};
+
+struct __gmp_cmp_function
+{
+ static int eval(mpz_srcptr z, mpz_srcptr w) { return mpz_cmp(z, w); }
+
+ static int eval(mpz_srcptr z, unsigned long int l)
+ { return mpz_cmp_ui(z, l); }
+ static int eval(unsigned long int l, mpz_srcptr z)
+ { return -mpz_cmp_ui(z, l); }
+ static int eval(mpz_srcptr z, signed long int l)
+ { return mpz_cmp_si(z, l); }
+ static int eval(signed long int l, mpz_srcptr z)
+ { return -mpz_cmp_si(z, l); }
+ static int eval(mpz_srcptr z, double d)
+ { return mpz_cmp_d(z, d); }
+ static int eval(double d, mpz_srcptr z)
+ { return -mpz_cmp_d(z, d); }
+
+ static int eval(mpq_srcptr q, mpq_srcptr r) { return mpq_cmp(q, r); }
+
+ static int eval(mpq_srcptr q, unsigned long int l)
+ { return mpq_cmp_ui(q, l, 1); }
+ static int eval(unsigned long int l, mpq_srcptr q)
+ { return -mpq_cmp_ui(q, l, 1); }
+ static int eval(mpq_srcptr q, signed long int l)
+ { return mpq_cmp_si(q, l, 1); }
+ static int eval(signed long int l, mpq_srcptr q)
+ { return -mpq_cmp_si(q, l, 1); }
+ static int eval(mpq_srcptr q, double d)
+ { __GMPXX_TMPQ_D; return mpq_cmp (q, temp); }
+ static int eval(double d, mpq_srcptr q)
+ { __GMPXX_TMPQ_D; return mpq_cmp (temp, q); }
+
+ static int eval(mpf_srcptr f, mpf_srcptr g) { return mpf_cmp(f, g); }
+
+ static int eval(mpf_srcptr f, unsigned long int l)
+ { return mpf_cmp_ui(f, l); }
+ static int eval(unsigned long int l, mpf_srcptr f)
+ { return -mpf_cmp_ui(f, l); }
+ static int eval(mpf_srcptr f, signed long int l)
+ { return mpf_cmp_si(f, l); }
+ static int eval(signed long int l, mpf_srcptr f)
+ { return -mpf_cmp_si(f, l); }
+ static int eval(mpf_srcptr f, double d)
+ { return mpf_cmp_d(f, d); }
+ static int eval(double d, mpf_srcptr f)
+ { return -mpf_cmp_d(f, d); }
+};
+
+struct __gmp_rand_function
+{
+ static void eval(mpz_ptr z, gmp_randstate_t s, mp_bitcnt_t l)
+ { mpz_urandomb(z, s, l); }
+ static void eval(mpz_ptr z, gmp_randstate_t s, mpz_srcptr w)
+ { mpz_urandomm(z, s, w); }
+ static void eval(mpf_ptr f, gmp_randstate_t s, mp_bitcnt_t prec)
+ { mpf_urandomb(f, s, prec); }
+};
+
+
+/**************** Auxiliary classes ****************/
+
+/* this is much the same as gmp_allocated_string in gmp-impl.h
+ since gmp-impl.h is not publicly available, I redefine it here
+ I use a different name to avoid possible clashes */
+
+extern "C" {
+ typedef void (*__gmp_freefunc_t) (void *, size_t);
+}
+struct __gmp_alloc_cstring
+{
+ char *str;
+ __gmp_alloc_cstring(char *s) { str = s; }
+ ~__gmp_alloc_cstring()
+ {
+ __gmp_freefunc_t freefunc;
+ mp_get_memory_functions (NULL, NULL, &freefunc);
+ (*freefunc) (str, std::strlen(str)+1);
+ }
+};
+
+
+// general expression template class
+template <class T, class U>
+class __gmp_expr;
+
+
+// templates for resolving expression types
+template <class T>
+struct __gmp_resolve_ref
+{
+ typedef T ref_type;
+};
+
+template <class T, class U>
+struct __gmp_resolve_ref<__gmp_expr<T, U> >
+{
+ typedef const __gmp_expr<T, U> & ref_type;
+};
+
+
+template <class T, class U = T>
+struct __gmp_resolve_expr;
+
+template <>
+struct __gmp_resolve_expr<mpz_t>
+{
+ typedef mpz_t value_type;
+ typedef mpz_ptr ptr_type;
+ typedef mpz_srcptr srcptr_type;
+};
+
+template <>
+struct __gmp_resolve_expr<mpq_t>
+{
+ typedef mpq_t value_type;
+ typedef mpq_ptr ptr_type;
+ typedef mpq_srcptr srcptr_type;
+};
+
+template <>
+struct __gmp_resolve_expr<mpf_t>
+{
+ typedef mpf_t value_type;
+ typedef mpf_ptr ptr_type;
+ typedef mpf_srcptr srcptr_type;
+};
+
+template <>
+struct __gmp_resolve_expr<mpz_t, mpq_t>
+{
+ typedef mpq_t value_type;
+};
+
+template <>
+struct __gmp_resolve_expr<mpq_t, mpz_t>
+{
+ typedef mpq_t value_type;
+};
+
+template <>
+struct __gmp_resolve_expr<mpz_t, mpf_t>
+{
+ typedef mpf_t value_type;
+};
+
+template <>
+struct __gmp_resolve_expr<mpf_t, mpz_t>
+{
+ typedef mpf_t value_type;
+};
+
+template <>
+struct __gmp_resolve_expr<mpq_t, mpf_t>
+{
+ typedef mpf_t value_type;
+};
+
+template <>
+struct __gmp_resolve_expr<mpf_t, mpq_t>
+{
+ typedef mpf_t value_type;
+};
+
+#if __GMPXX_USE_CXX11
+namespace std {
+ template <class T, class U, class V, class W>
+ struct common_type <__gmp_expr<T, U>, __gmp_expr<V, W> >
+ {
+ private:
+ typedef typename __gmp_resolve_expr<T, V>::value_type X;
+ public:
+ typedef __gmp_expr<X, X> type;
+ };
+
+ template <class T, class U>
+ struct common_type <__gmp_expr<T, U>, __gmp_expr<T, U> >
+ {
+ typedef __gmp_expr<T, U> type;
+ };
+
+#define __GMPXX_DECLARE_COMMON_TYPE(typ) \
+ template <class T, class U> \
+ struct common_type <__gmp_expr<T, U>, typ > \
+ { \
+ typedef __gmp_expr<T, T> type; \
+ }; \
+ \
+ template <class T, class U> \
+ struct common_type <typ, __gmp_expr<T, U> > \
+ { \
+ typedef __gmp_expr<T, T> type; \
+ }
+
+ __GMPXX_DECLARE_COMMON_TYPE(signed char);
+ __GMPXX_DECLARE_COMMON_TYPE(unsigned char);
+ __GMPXX_DECLARE_COMMON_TYPE(signed int);
+ __GMPXX_DECLARE_COMMON_TYPE(unsigned int);
+ __GMPXX_DECLARE_COMMON_TYPE(signed short int);
+ __GMPXX_DECLARE_COMMON_TYPE(unsigned short int);
+ __GMPXX_DECLARE_COMMON_TYPE(signed long int);
+ __GMPXX_DECLARE_COMMON_TYPE(unsigned long int);
+ __GMPXX_DECLARE_COMMON_TYPE(float);
+ __GMPXX_DECLARE_COMMON_TYPE(double);
+#undef __GMPXX_DECLARE_COMMON_TYPE
+}
+#endif
+
+// classes for evaluating unary and binary expressions
+template <class T, class Op>
+struct __gmp_unary_expr
+{
+ const T &val;
+
+ __gmp_unary_expr(const T &v) : val(v) { }
+private:
+ __gmp_unary_expr();
+};
+
+template <class T, class U, class Op>
+struct __gmp_binary_expr
+{
+ typename __gmp_resolve_ref<T>::ref_type val1;
+ typename __gmp_resolve_ref<U>::ref_type val2;
+
+ __gmp_binary_expr(const T &v1, const U &v2) : val1(v1), val2(v2) { }
+private:
+ __gmp_binary_expr();
+};
+
+
+
+/**************** Macros for in-class declarations ****************/
+/* This is just repetitive code that is easier to maintain if it's written
+ only once */
+
+#define __GMPP_DECLARE_COMPOUND_OPERATOR(fun) \
+ template <class T, class U> \
+ __gmp_expr<value_type, value_type> & fun(const __gmp_expr<T, U> &);
+
+#define __GMPN_DECLARE_COMPOUND_OPERATOR(fun) \
+ __gmp_expr & fun(signed char); \
+ __gmp_expr & fun(unsigned char); \
+ __gmp_expr & fun(signed int); \
+ __gmp_expr & fun(unsigned int); \
+ __gmp_expr & fun(signed short int); \
+ __gmp_expr & fun(unsigned short int); \
+ __gmp_expr & fun(signed long int); \
+ __gmp_expr & fun(unsigned long int); \
+ __gmp_expr & fun(float); \
+ __gmp_expr & fun(double); \
+ /* __gmp_expr & fun(long double); */
+
+#define __GMP_DECLARE_COMPOUND_OPERATOR(fun) \
+__GMPP_DECLARE_COMPOUND_OPERATOR(fun) \
+__GMPN_DECLARE_COMPOUND_OPERATOR(fun)
+
+#define __GMP_DECLARE_COMPOUND_OPERATOR_UI(fun) \
+ __gmp_expr & fun(mp_bitcnt_t);
+
+#define __GMP_DECLARE_INCREMENT_OPERATOR(fun) \
+ inline __gmp_expr & fun(); \
+ inline __gmp_expr fun(int);
+
+#define __GMPXX_DEFINE_ARITHMETIC_CONSTRUCTORS \
+ __gmp_expr(signed char c) { init_si(c); } \
+ __gmp_expr(unsigned char c) { init_ui(c); } \
+ __gmp_expr(signed int i) { init_si(i); } \
+ __gmp_expr(unsigned int i) { init_ui(i); } \
+ __gmp_expr(signed short int s) { init_si(s); } \
+ __gmp_expr(unsigned short int s) { init_ui(s); } \
+ __gmp_expr(signed long int l) { init_si(l); } \
+ __gmp_expr(unsigned long int l) { init_ui(l); } \
+ __gmp_expr(float f) { init_d(f); } \
+ __gmp_expr(double d) { init_d(d); }
+
+#define __GMPXX_DEFINE_ARITHMETIC_ASSIGNMENTS \
+ __gmp_expr & operator=(signed char c) { assign_si(c); return *this; } \
+ __gmp_expr & operator=(unsigned char c) { assign_ui(c); return *this; } \
+ __gmp_expr & operator=(signed int i) { assign_si(i); return *this; } \
+ __gmp_expr & operator=(unsigned int i) { assign_ui(i); return *this; } \
+ __gmp_expr & operator=(signed short int s) { assign_si(s); return *this; } \
+ __gmp_expr & operator=(unsigned short int s) { assign_ui(s); return *this; } \
+ __gmp_expr & operator=(signed long int l) { assign_si(l); return *this; } \
+ __gmp_expr & operator=(unsigned long int l) { assign_ui(l); return *this; } \
+ __gmp_expr & operator=(float f) { assign_d(f); return *this; } \
+ __gmp_expr & operator=(double d) { assign_d(d); return *this; }
+
+/**************** mpz_class -- wrapper for mpz_t ****************/
+
+template <>
+class __gmp_expr<mpz_t, mpz_t>
+{
+private:
+ typedef mpz_t value_type;
+ value_type mp;
+
+ // Helper functions used for all arithmetic types
+ void assign_ui(unsigned long l)
+ {
+ if (__GMPXX_CONSTANT_TRUE(l == 0))
+ mp->_mp_size = 0;
+ else
+ mpz_set_ui(mp, l);
+ }
+ void assign_si(signed long l)
+ {
+ if (__GMPXX_CONSTANT_TRUE(l >= 0))
+ assign_ui(l);
+ else if (__GMPXX_CONSTANT_TRUE(l <= 0))
+ {
+ assign_ui(-static_cast<unsigned long>(l));
+ mpz_neg(mp, mp);
+ }
+ else
+ mpz_set_si(mp, l);
+ }
+ void assign_d (double d)
+ {
+ mpz_set_d (mp, d);
+ }
+
+ void init_ui(unsigned long l)
+ {
+ if (__GMPXX_CONSTANT_TRUE(l == 0))
+ mpz_init(mp);
+ else
+ mpz_init_set_ui(mp, l);
+ }
+ void init_si(signed long l)
+ {
+ if (__GMPXX_CONSTANT_TRUE(l >= 0))
+ init_ui(l);
+ else if (__GMPXX_CONSTANT_TRUE(l <= 0))
+ {
+ init_ui(-static_cast<unsigned long>(l));
+ mpz_neg(mp, mp);
+ }
+ else
+ mpz_init_set_si(mp, l);
+ }
+ void init_d (double d)
+ {
+ mpz_init_set_d (mp, d);
+ }
+
+public:
+ mp_bitcnt_t get_prec() const { return mpf_get_default_prec(); }
+
+ // constructors and destructor
+ __gmp_expr() { mpz_init(mp); }
+
+ __gmp_expr(const __gmp_expr &z) { mpz_init_set(mp, z.mp); }
+#if __GMPXX_USE_CXX11
+ __gmp_expr(__gmp_expr &&z)
+ { *mp = *z.mp; mpz_init(z.mp); }
+#endif
+ template <class T>
+ __gmp_expr(const __gmp_expr<mpz_t, T> &expr)
+ { mpz_init(mp); __gmp_set_expr(mp, expr); }
+ template <class T, class U>
+ explicit __gmp_expr(const __gmp_expr<T, U> &expr)
+ { mpz_init(mp); __gmp_set_expr(mp, expr); }
+
+ __GMPXX_DEFINE_ARITHMETIC_CONSTRUCTORS
+
+ explicit __gmp_expr(const char *s, int base = 0)
+ {
+ if (mpz_init_set_str (mp, s, base) != 0)
+ {
+ mpz_clear (mp);
+ throw std::invalid_argument ("mpz_set_str");
+ }
+ }
+ explicit __gmp_expr(const std::string &s, int base = 0)
+ {
+ if (mpz_init_set_str(mp, s.c_str(), base) != 0)
+ {
+ mpz_clear (mp);
+ throw std::invalid_argument ("mpz_set_str");
+ }
+ }
+
+ explicit __gmp_expr(mpz_srcptr z) { mpz_init_set(mp, z); }
+
+ ~__gmp_expr() { mpz_clear(mp); }
+
+ void swap(__gmp_expr& z) __GMPXX_NOEXCEPT { std::swap(*mp, *z.mp); }
+
+ // assignment operators
+ __gmp_expr & operator=(const __gmp_expr &z)
+ { mpz_set(mp, z.mp); return *this; }
+#if __GMPXX_USE_CXX11
+ __gmp_expr & operator=(__gmp_expr &&z) noexcept
+ { swap(z); return *this; }
+#endif
+ template <class T, class U>
+ __gmp_expr<value_type, value_type> & operator=(const __gmp_expr<T, U> &expr)
+ { __gmp_set_expr(mp, expr); return *this; }
+
+ __GMPXX_DEFINE_ARITHMETIC_ASSIGNMENTS
+
+ __gmp_expr & operator=(const char *s)
+ {
+ if (mpz_set_str (mp, s, 0) != 0)
+ throw std::invalid_argument ("mpz_set_str");
+ return *this;
+ }
+ __gmp_expr & operator=(const std::string &s)
+ {
+ if (mpz_set_str(mp, s.c_str(), 0) != 0)
+ throw std::invalid_argument ("mpz_set_str");
+ return *this;
+ }
+
+ // string input/output functions
+ int set_str(const char *s, int base)
+ { return mpz_set_str(mp, s, base); }
+ int set_str(const std::string &s, int base)
+ { return mpz_set_str(mp, s.c_str(), base); }
+ std::string get_str(int base = 10) const
+ {
+ __gmp_alloc_cstring temp(mpz_get_str(0, base, mp));
+ return std::string(temp.str);
+ }
+
+ // conversion functions
+ mpz_srcptr __get_mp() const { return mp; }
+ mpz_ptr __get_mp() { return mp; }
+ mpz_srcptr get_mpz_t() const { return mp; }
+ mpz_ptr get_mpz_t() { return mp; }
+
+ signed long int get_si() const { return mpz_get_si(mp); }
+ unsigned long int get_ui() const { return mpz_get_ui(mp); }
+ double get_d() const { return mpz_get_d(mp); }
+
+ // bool fits_schar_p() const { return mpz_fits_schar_p(mp); }
+ // bool fits_uchar_p() const { return mpz_fits_uchar_p(mp); }
+ bool fits_sint_p() const { return mpz_fits_sint_p(mp); }
+ bool fits_uint_p() const { return mpz_fits_uint_p(mp); }
+ bool fits_sshort_p() const { return mpz_fits_sshort_p(mp); }
+ bool fits_ushort_p() const { return mpz_fits_ushort_p(mp); }
+ bool fits_slong_p() const { return mpz_fits_slong_p(mp); }
+ bool fits_ulong_p() const { return mpz_fits_ulong_p(mp); }
+ // bool fits_float_p() const { return mpz_fits_float_p(mp); }
+ // bool fits_double_p() const { return mpz_fits_double_p(mp); }
+ // bool fits_ldouble_p() const { return mpz_fits_ldouble_p(mp); }
+
+#if __GMPXX_USE_CXX11
+ explicit operator bool() const { return mp->_mp_size != 0; }
+#endif
+
+ // member operators
+ __GMP_DECLARE_COMPOUND_OPERATOR(operator+=)
+ __GMP_DECLARE_COMPOUND_OPERATOR(operator-=)
+ __GMP_DECLARE_COMPOUND_OPERATOR(operator*=)
+ __GMP_DECLARE_COMPOUND_OPERATOR(operator/=)
+ __GMP_DECLARE_COMPOUND_OPERATOR(operator%=)
+
+ __GMP_DECLARE_COMPOUND_OPERATOR(operator&=)
+ __GMP_DECLARE_COMPOUND_OPERATOR(operator|=)
+ __GMP_DECLARE_COMPOUND_OPERATOR(operator^=)
+
+ __GMP_DECLARE_COMPOUND_OPERATOR_UI(operator<<=)
+ __GMP_DECLARE_COMPOUND_OPERATOR_UI(operator>>=)
+
+ __GMP_DECLARE_INCREMENT_OPERATOR(operator++)
+ __GMP_DECLARE_INCREMENT_OPERATOR(operator--)
+};
+
+typedef __gmp_expr<mpz_t, mpz_t> mpz_class;
+
+
+/**************** mpq_class -- wrapper for mpq_t ****************/
+
+template <>
+class __gmp_expr<mpq_t, mpq_t>
+{
+private:
+ typedef mpq_t value_type;
+ value_type mp;
+
+ // Helper functions used for all arithmetic types
+ void assign_ui(unsigned long l) { mpq_set_ui(mp, l, 1); }
+ void assign_si(signed long l)
+ {
+ if (__GMPXX_CONSTANT_TRUE(l >= 0))
+ assign_ui(l);
+ else
+ mpq_set_si(mp, l, 1);
+ }
+ void assign_d (double d) { mpq_set_d (mp, d); }
+
+ void init_ui(unsigned long l) { mpq_init(mp); get_num() = l; }
+ void init_si(signed long l) { mpq_init(mp); get_num() = l; }
+ void init_d (double d) { mpq_init(mp); assign_d (d); }
+
+public:
+ mp_bitcnt_t get_prec() const { return mpf_get_default_prec(); }
+ void canonicalize() { mpq_canonicalize(mp); }
+
+ // constructors and destructor
+ __gmp_expr() { mpq_init(mp); }
+
+ __gmp_expr(const __gmp_expr &q)
+ {
+ mpz_init_set(mpq_numref(mp), mpq_numref(q.mp));
+ mpz_init_set(mpq_denref(mp), mpq_denref(q.mp));
+ }
+#if __GMPXX_USE_CXX11
+ __gmp_expr(__gmp_expr &&q)
+ { *mp = *q.mp; mpq_init(q.mp); }
+#endif
+ template <class T>
+ __gmp_expr(const __gmp_expr<mpz_t, T> &expr)
+ { mpq_init(mp); __gmp_set_expr(mp, expr); }
+ template <class T>
+ __gmp_expr(const __gmp_expr<mpq_t, T> &expr)
+ { mpq_init(mp); __gmp_set_expr(mp, expr); }
+ template <class T, class U>
+ explicit __gmp_expr(const __gmp_expr<T, U> &expr)
+ { mpq_init(mp); __gmp_set_expr(mp, expr); }
+
+ __GMPXX_DEFINE_ARITHMETIC_CONSTRUCTORS
+
+ explicit __gmp_expr(const char *s, int base = 0)
+ {
+ mpq_init (mp);
+ // If s is the literal 0, we meant to call another constructor.
+ // If s just happens to evaluate to 0, we would crash, so whatever.
+ if (s == 0)
+ {
+ // Don't turn mpq_class(0,0) into 0
+ mpz_set_si(mpq_denref(mp), base);
+ }
+ else if (mpq_set_str(mp, s, base) != 0)
+ {
+ mpq_clear (mp);
+ throw std::invalid_argument ("mpq_set_str");
+ }
+ }
+ explicit __gmp_expr(const std::string &s, int base = 0)
+ {
+ mpq_init(mp);
+ if (mpq_set_str (mp, s.c_str(), base) != 0)
+ {
+ mpq_clear (mp);
+ throw std::invalid_argument ("mpq_set_str");
+ }
+ }
+ explicit __gmp_expr(mpq_srcptr q)
+ {
+ mpz_init_set(mpq_numref(mp), mpq_numref(q));
+ mpz_init_set(mpq_denref(mp), mpq_denref(q));
+ }
+
+ __gmp_expr(const mpz_class &num, const mpz_class &den)
+ {
+ mpz_init_set(mpq_numref(mp), num.get_mpz_t());
+ mpz_init_set(mpq_denref(mp), den.get_mpz_t());
+ }
+
+ ~__gmp_expr() { mpq_clear(mp); }
+
+ void swap(__gmp_expr& q) __GMPXX_NOEXCEPT { std::swap(*mp, *q.mp); }
+
+ // assignment operators
+ __gmp_expr & operator=(const __gmp_expr &q)
+ { mpq_set(mp, q.mp); return *this; }
+#if __GMPXX_USE_CXX11
+ __gmp_expr & operator=(__gmp_expr &&q) noexcept
+ { swap(q); return *this; }
+ __gmp_expr & operator=(mpz_class &&z) noexcept
+ { get_num() = std::move(z); get_den() = 1u; return *this; }
+#endif
+ template <class T, class U>
+ __gmp_expr<value_type, value_type> & operator=(const __gmp_expr<T, U> &expr)
+ { __gmp_set_expr(mp, expr); return *this; }
+
+ __GMPXX_DEFINE_ARITHMETIC_ASSIGNMENTS
+
+ __gmp_expr & operator=(const char *s)
+ {
+ if (mpq_set_str (mp, s, 0) != 0)
+ throw std::invalid_argument ("mpq_set_str");
+ return *this;
+ }
+ __gmp_expr & operator=(const std::string &s)
+ {
+ if (mpq_set_str(mp, s.c_str(), 0) != 0)
+ throw std::invalid_argument ("mpq_set_str");
+ return *this;
+ }
+
+ // string input/output functions
+ int set_str(const char *s, int base)
+ { return mpq_set_str(mp, s, base); }
+ int set_str(const std::string &s, int base)
+ { return mpq_set_str(mp, s.c_str(), base); }
+ std::string get_str(int base = 10) const
+ {
+ __gmp_alloc_cstring temp(mpq_get_str(0, base, mp));
+ return std::string(temp.str);
+ }
+
+ // conversion functions
+
+ // casting a reference to an mpz_t to mpz_class & is a dirty hack,
+ // but works because the internal representation of mpz_class is
+ // exactly an mpz_t
+ const mpz_class & get_num() const
+ { return reinterpret_cast<const mpz_class &>(*mpq_numref(mp)); }
+ mpz_class & get_num()
+ { return reinterpret_cast<mpz_class &>(*mpq_numref(mp)); }
+ const mpz_class & get_den() const
+ { return reinterpret_cast<const mpz_class &>(*mpq_denref(mp)); }
+ mpz_class & get_den()
+ { return reinterpret_cast<mpz_class &>(*mpq_denref(mp)); }
+
+ mpq_srcptr __get_mp() const { return mp; }
+ mpq_ptr __get_mp() { return mp; }
+ mpq_srcptr get_mpq_t() const { return mp; }
+ mpq_ptr get_mpq_t() { return mp; }
+
+ mpz_srcptr get_num_mpz_t() const { return mpq_numref(mp); }
+ mpz_ptr get_num_mpz_t() { return mpq_numref(mp); }
+ mpz_srcptr get_den_mpz_t() const { return mpq_denref(mp); }
+ mpz_ptr get_den_mpz_t() { return mpq_denref(mp); }
+
+ double get_d() const { return mpq_get_d(mp); }
+
+#if __GMPXX_USE_CXX11
+ explicit operator bool() const { return mpq_numref(mp)->_mp_size != 0; }
+#endif
+
+ // compound assignments
+ __GMP_DECLARE_COMPOUND_OPERATOR(operator+=)
+ __GMP_DECLARE_COMPOUND_OPERATOR(operator-=)
+ __GMP_DECLARE_COMPOUND_OPERATOR(operator*=)
+ __GMP_DECLARE_COMPOUND_OPERATOR(operator/=)
+
+ __GMP_DECLARE_COMPOUND_OPERATOR_UI(operator<<=)
+ __GMP_DECLARE_COMPOUND_OPERATOR_UI(operator>>=)
+
+ __GMP_DECLARE_INCREMENT_OPERATOR(operator++)
+ __GMP_DECLARE_INCREMENT_OPERATOR(operator--)
+};
+
+typedef __gmp_expr<mpq_t, mpq_t> mpq_class;
+
+
+/**************** mpf_class -- wrapper for mpf_t ****************/
+
+template <>
+class __gmp_expr<mpf_t, mpf_t>
+{
+private:
+ typedef mpf_t value_type;
+ value_type mp;
+
+ // Helper functions used for all arithmetic types
+ void assign_ui(unsigned long l) { mpf_set_ui(mp, l); }
+ void assign_si(signed long l)
+ {
+ if (__GMPXX_CONSTANT_TRUE(l >= 0))
+ assign_ui(l);
+ else
+ mpf_set_si(mp, l);
+ }
+ void assign_d (double d) { mpf_set_d (mp, d); }
+
+ void init_ui(unsigned long l)
+ {
+ if (__GMPXX_CONSTANT_TRUE(l == 0))
+ mpf_init(mp);
+ else
+ mpf_init_set_ui(mp, l);
+ }
+ void init_si(signed long l)
+ {
+ if (__GMPXX_CONSTANT_TRUE(l >= 0))
+ init_ui(l);
+ else
+ mpf_init_set_si(mp, l);
+ }
+ void init_d (double d) { mpf_init_set_d (mp, d); }
+
+public:
+ mp_bitcnt_t get_prec() const { return mpf_get_prec(mp); }
+
+ void set_prec(mp_bitcnt_t prec) { mpf_set_prec(mp, prec); }
+ void set_prec_raw(mp_bitcnt_t prec) { mpf_set_prec_raw(mp, prec); }
+
+ // constructors and destructor
+ __gmp_expr() { mpf_init(mp); }
+
+ __gmp_expr(const __gmp_expr &f)
+ { mpf_init2(mp, f.get_prec()); mpf_set(mp, f.mp); }
+#if __GMPXX_USE_CXX11
+ __gmp_expr(__gmp_expr &&f)
+ { *mp = *f.mp; mpf_init2(f.mp, get_prec()); }
+#endif
+ __gmp_expr(const __gmp_expr &f, mp_bitcnt_t prec)
+ { mpf_init2(mp, prec); mpf_set(mp, f.mp); }
+ template <class T, class U>
+ __gmp_expr(const __gmp_expr<T, U> &expr)
+ { mpf_init2(mp, expr.get_prec()); __gmp_set_expr(mp, expr); }
+ template <class T, class U>
+ __gmp_expr(const __gmp_expr<T, U> &expr, mp_bitcnt_t prec)
+ { mpf_init2(mp, prec); __gmp_set_expr(mp, expr); }
+
+ __GMPXX_DEFINE_ARITHMETIC_CONSTRUCTORS
+
+ __gmp_expr(signed char c, mp_bitcnt_t prec)
+ { mpf_init2(mp, prec); mpf_set_si(mp, c); }
+ __gmp_expr(unsigned char c, mp_bitcnt_t prec)
+ { mpf_init2(mp, prec); mpf_set_ui(mp, c); }
+
+ __gmp_expr(signed int i, mp_bitcnt_t prec)
+ { mpf_init2(mp, prec); mpf_set_si(mp, i); }
+ __gmp_expr(unsigned int i, mp_bitcnt_t prec)
+ { mpf_init2(mp, prec); mpf_set_ui(mp, i); }
+
+ __gmp_expr(signed short int s, mp_bitcnt_t prec)
+ { mpf_init2(mp, prec); mpf_set_si(mp, s); }
+ __gmp_expr(unsigned short int s, mp_bitcnt_t prec)
+ { mpf_init2(mp, prec); mpf_set_ui(mp, s); }
+
+ __gmp_expr(signed long int l, mp_bitcnt_t prec)
+ { mpf_init2(mp, prec); mpf_set_si(mp, l); }
+ __gmp_expr(unsigned long int l, mp_bitcnt_t prec)
+ { mpf_init2(mp, prec); mpf_set_ui(mp, l); }
+
+ __gmp_expr(float f, mp_bitcnt_t prec)
+ { mpf_init2(mp, prec); mpf_set_d(mp, f); }
+ __gmp_expr(double d, mp_bitcnt_t prec)
+ { mpf_init2(mp, prec); mpf_set_d(mp, d); }
+ // __gmp_expr(long double ld) { mpf_init_set_d(mp, ld); }
+ // __gmp_expr(long double ld, mp_bitcnt_t prec)
+ // { mpf_init2(mp, prec); mpf_set_d(mp, ld); }
+
+ explicit __gmp_expr(const char *s)
+ {
+ if (mpf_init_set_str (mp, s, 0) != 0)
+ {
+ mpf_clear (mp);
+ throw std::invalid_argument ("mpf_set_str");
+ }
+ }
+ __gmp_expr(const char *s, mp_bitcnt_t prec, int base = 0)
+ {
+ mpf_init2(mp, prec);
+ if (mpf_set_str(mp, s, base) != 0)
+ {
+ mpf_clear (mp);
+ throw std::invalid_argument ("mpf_set_str");
+ }
+ }
+ explicit __gmp_expr(const std::string &s)
+ {
+ if (mpf_init_set_str(mp, s.c_str(), 0) != 0)
+ {
+ mpf_clear (mp);
+ throw std::invalid_argument ("mpf_set_str");
+ }
+ }
+ __gmp_expr(const std::string &s, mp_bitcnt_t prec, int base = 0)
+ {
+ mpf_init2(mp, prec);
+ if (mpf_set_str(mp, s.c_str(), base) != 0)
+ {
+ mpf_clear (mp);
+ throw std::invalid_argument ("mpf_set_str");
+ }
+ }
+
+ explicit __gmp_expr(mpf_srcptr f)
+ { mpf_init2(mp, mpf_get_prec(f)); mpf_set(mp, f); }
+ __gmp_expr(mpf_srcptr f, mp_bitcnt_t prec)
+ { mpf_init2(mp, prec); mpf_set(mp, f); }
+
+ ~__gmp_expr() { mpf_clear(mp); }
+
+ void swap(__gmp_expr& f) __GMPXX_NOEXCEPT { std::swap(*mp, *f.mp); }
+
+ // assignment operators
+ __gmp_expr & operator=(const __gmp_expr &f)
+ { mpf_set(mp, f.mp); return *this; }
+#if __GMPXX_USE_CXX11
+ __gmp_expr & operator=(__gmp_expr &&f) noexcept
+ { swap(f); return *this; }
+#endif
+ template <class T, class U>
+ __gmp_expr<value_type, value_type> & operator=(const __gmp_expr<T, U> &expr)
+ { __gmp_set_expr(mp, expr); return *this; }
+
+ __GMPXX_DEFINE_ARITHMETIC_ASSIGNMENTS
+
+ __gmp_expr & operator=(const char *s)
+ {
+ if (mpf_set_str (mp, s, 0) != 0)
+ throw std::invalid_argument ("mpf_set_str");
+ return *this;
+ }
+ __gmp_expr & operator=(const std::string &s)
+ {
+ if (mpf_set_str(mp, s.c_str(), 0) != 0)
+ throw std::invalid_argument ("mpf_set_str");
+ return *this;
+ }
+
+ // string input/output functions
+ int set_str(const char *s, int base)
+ { return mpf_set_str(mp, s, base); }
+ int set_str(const std::string &s, int base)
+ { return mpf_set_str(mp, s.c_str(), base); }
+ std::string get_str(mp_exp_t &expo, int base = 10, size_t size = 0) const
+ {
+ __gmp_alloc_cstring temp(mpf_get_str(0, &expo, base, size, mp));
+ return std::string(temp.str);
+ }
+
+ // conversion functions
+ mpf_srcptr __get_mp() const { return mp; }
+ mpf_ptr __get_mp() { return mp; }
+ mpf_srcptr get_mpf_t() const { return mp; }
+ mpf_ptr get_mpf_t() { return mp; }
+
+ signed long int get_si() const { return mpf_get_si(mp); }
+ unsigned long int get_ui() const { return mpf_get_ui(mp); }
+ double get_d() const { return mpf_get_d(mp); }
+
+ // bool fits_schar_p() const { return mpf_fits_schar_p(mp); }
+ // bool fits_uchar_p() const { return mpf_fits_uchar_p(mp); }
+ bool fits_sint_p() const { return mpf_fits_sint_p(mp); }
+ bool fits_uint_p() const { return mpf_fits_uint_p(mp); }
+ bool fits_sshort_p() const { return mpf_fits_sshort_p(mp); }
+ bool fits_ushort_p() const { return mpf_fits_ushort_p(mp); }
+ bool fits_slong_p() const { return mpf_fits_slong_p(mp); }
+ bool fits_ulong_p() const { return mpf_fits_ulong_p(mp); }
+ // bool fits_float_p() const { return mpf_fits_float_p(mp); }
+ // bool fits_double_p() const { return mpf_fits_double_p(mp); }
+ // bool fits_ldouble_p() const { return mpf_fits_ldouble_p(mp); }
+
+#if __GMPXX_USE_CXX11
+ explicit operator bool() const { return mp->_mp_size != 0; }
+#endif
+
+ // compound assignments
+ __GMP_DECLARE_COMPOUND_OPERATOR(operator+=)
+ __GMP_DECLARE_COMPOUND_OPERATOR(operator-=)
+ __GMP_DECLARE_COMPOUND_OPERATOR(operator*=)
+ __GMP_DECLARE_COMPOUND_OPERATOR(operator/=)
+
+ __GMP_DECLARE_COMPOUND_OPERATOR_UI(operator<<=)
+ __GMP_DECLARE_COMPOUND_OPERATOR_UI(operator>>=)
+
+ __GMP_DECLARE_INCREMENT_OPERATOR(operator++)
+ __GMP_DECLARE_INCREMENT_OPERATOR(operator--)
+};
+
+typedef __gmp_expr<mpf_t, mpf_t> mpf_class;
+
+
+
+/**************** User-defined literals ****************/
+
+#if __GMPXX_USE_CXX11
+inline mpz_class operator"" _mpz(const char* s)
+{
+ return mpz_class(s);
+}
+
+inline mpq_class operator"" _mpq(const char* s)
+{
+ mpq_class q;
+ q.get_num() = s;
+ return q;
+}
+
+inline mpf_class operator"" _mpf(const char* s)
+{
+ return mpf_class(s);
+}
+#endif
+
+/**************** I/O operators ****************/
+
+// these should (and will) be provided separately
+
+template <class T, class U>
+inline std::ostream & operator<<
+(std::ostream &o, const __gmp_expr<T, U> &expr)
+{
+ __gmp_expr<T, T> const& temp(expr);
+ return o << temp.__get_mp();
+}
+
+template <class T>
+inline std::istream & operator>>(std::istream &i, __gmp_expr<T, T> &expr)
+{
+ return i >> expr.__get_mp();
+}
+
+/*
+// you might want to uncomment this
+inline std::istream & operator>>(std::istream &i, mpq_class &q)
+{
+ i >> q.get_mpq_t();
+ q.canonicalize();
+ return i;
+}
+*/
+
+
+/**************** Functions for type conversion ****************/
+
+inline void __gmp_set_expr(mpz_ptr z, const mpz_class &w)
+{
+ mpz_set(z, w.get_mpz_t());
+}
+
+template <class T>
+inline void __gmp_set_expr(mpz_ptr z, const __gmp_expr<mpz_t, T> &expr)
+{
+ expr.eval(z);
+}
+
+template <class T>
+inline void __gmp_set_expr(mpz_ptr z, const __gmp_expr<mpq_t, T> &expr)
+{
+ mpq_class const& temp(expr);
+ mpz_set_q(z, temp.get_mpq_t());
+}
+
+template <class T>
+inline void __gmp_set_expr(mpz_ptr z, const __gmp_expr<mpf_t, T> &expr)
+{
+ mpf_class const& temp(expr);
+ mpz_set_f(z, temp.get_mpf_t());
+}
+
+inline void __gmp_set_expr(mpq_ptr q, const mpz_class &z)
+{
+ mpq_set_z(q, z.get_mpz_t());
+}
+
+template <class T>
+inline void __gmp_set_expr(mpq_ptr q, const __gmp_expr<mpz_t, T> &expr)
+{
+ __gmp_set_expr(mpq_numref(q), expr);
+ mpz_set_ui(mpq_denref(q), 1);
+}
+
+inline void __gmp_set_expr(mpq_ptr q, const mpq_class &r)
+{
+ mpq_set(q, r.get_mpq_t());
+}
+
+template <class T>
+inline void __gmp_set_expr(mpq_ptr q, const __gmp_expr<mpq_t, T> &expr)
+{
+ expr.eval(q);
+}
+
+template <class T>
+inline void __gmp_set_expr(mpq_ptr q, const __gmp_expr<mpf_t, T> &expr)
+{
+ mpf_class const& temp(expr);
+ mpq_set_f(q, temp.get_mpf_t());
+}
+
+template <class T>
+inline void __gmp_set_expr(mpf_ptr f, const __gmp_expr<mpz_t, T> &expr)
+{
+ mpz_class const& temp(expr);
+ mpf_set_z(f, temp.get_mpz_t());
+}
+
+template <class T>
+inline void __gmp_set_expr(mpf_ptr f, const __gmp_expr<mpq_t, T> &expr)
+{
+ mpq_class const& temp(expr);
+ mpf_set_q(f, temp.get_mpq_t());
+}
+
+inline void __gmp_set_expr(mpf_ptr f, const mpf_class &g)
+{
+ mpf_set(f, g.get_mpf_t());
+}
+
+template <class T>
+inline void __gmp_set_expr(mpf_ptr f, const __gmp_expr<mpf_t, T> &expr)
+{
+ expr.eval(f);
+}
+
+
+/* Temporary objects */
+
+template <class T>
+class __gmp_temp
+{
+ __gmp_expr<T, T> val;
+ public:
+ template<class U, class V>
+ __gmp_temp(U const& u, V) : val (u) {}
+ typename __gmp_resolve_expr<T>::srcptr_type
+ __get_mp() const { return val.__get_mp(); }
+};
+
+template <>
+class __gmp_temp <mpf_t>
+{
+ mpf_class val;
+ public:
+ template<class U>
+ __gmp_temp(U const& u, mpf_ptr res) : val (u, mpf_get_prec(res)) {}
+ mpf_srcptr __get_mp() const { return val.__get_mp(); }
+};
+
+/**************** Specializations of __gmp_expr ****************/
+/* The eval() method of __gmp_expr<T, U> evaluates the corresponding
+ expression and assigns the result to its argument, which is either an
+ mpz_t, mpq_t, or mpf_t as specified by the T argument.
+ Compound expressions are evaluated recursively (temporaries are created
+ to hold intermediate values), while for simple expressions the eval()
+ method of the appropriate function object (available as the Op argument
+ of either __gmp_unary_expr<T, Op> or __gmp_binary_expr<T, U, Op>) is
+ called. */
+
+
+/**************** Unary expressions ****************/
+/* cases:
+ - simple: argument is mp*_class, that is, __gmp_expr<T, T>
+ - compound: argument is __gmp_expr<T, U> (with U not equal to T) */
+
+
+// simple expressions
+
+template <class T, class Op>
+class __gmp_expr<T, __gmp_unary_expr<__gmp_expr<T, T>, Op> >
+{
+private:
+ typedef __gmp_expr<T, T> val_type;
+
+ __gmp_unary_expr<val_type, Op> expr;
+public:
+ explicit __gmp_expr(const val_type &val) : expr(val) { }
+ void eval(typename __gmp_resolve_expr<T>::ptr_type p) const
+ { Op::eval(p, expr.val.__get_mp()); }
+ const val_type & get_val() const { return expr.val; }
+ mp_bitcnt_t get_prec() const { return expr.val.get_prec(); }
+};
+
+
+// compound expressions
+
+template <class T, class U, class Op>
+class __gmp_expr<T, __gmp_unary_expr<__gmp_expr<T, U>, Op> >
+{
+private:
+ typedef __gmp_expr<T, U> val_type;
+
+ __gmp_unary_expr<val_type, Op> expr;
+public:
+ explicit __gmp_expr(const val_type &val) : expr(val) { }
+ void eval(typename __gmp_resolve_expr<T>::ptr_type p) const
+ { expr.val.eval(p); Op::eval(p, p); }
+ const val_type & get_val() const { return expr.val; }
+ mp_bitcnt_t get_prec() const { return expr.val.get_prec(); }
+};
+
+
+/**************** Binary expressions ****************/
+/* simple:
+ - arguments are both mp*_class
+ - one argument is mp*_class, one is a built-in type
+ compound:
+ - one is mp*_class, one is __gmp_expr<T, U>
+ - one is __gmp_expr<T, U>, one is built-in
+ - both arguments are __gmp_expr<...> */
+
+
+// simple expressions
+
+template <class T, class Op>
+class __gmp_expr
+<T, __gmp_binary_expr<__gmp_expr<T, T>, __gmp_expr<T, T>, Op> >
+{
+private:
+ typedef __gmp_expr<T, T> val1_type;
+ typedef __gmp_expr<T, T> val2_type;
+
+ __gmp_binary_expr<val1_type, val2_type, Op> expr;
+public:
+ __gmp_expr(const val1_type &val1, const val2_type &val2)
+ : expr(val1, val2) { }
+ void eval(typename __gmp_resolve_expr<T>::ptr_type p) const
+ { Op::eval(p, expr.val1.__get_mp(), expr.val2.__get_mp()); }
+ const val1_type & get_val1() const { return expr.val1; }
+ const val2_type & get_val2() const { return expr.val2; }
+ mp_bitcnt_t get_prec() const
+ {
+ mp_bitcnt_t prec1 = expr.val1.get_prec(),
+ prec2 = expr.val2.get_prec();
+ return (prec1 > prec2) ? prec1 : prec2;
+ }
+};
+
+
+// simple expressions, T is a built-in numerical type
+
+template <class T, class U, class Op>
+class __gmp_expr<T, __gmp_binary_expr<__gmp_expr<T, T>, U, Op> >
+{
+private:
+ typedef __gmp_expr<T, T> val1_type;
+ typedef U val2_type;
+
+ __gmp_binary_expr<val1_type, val2_type, Op> expr;
+public:
+ __gmp_expr(const val1_type &val1, const val2_type &val2)
+ : expr(val1, val2) { }
+ void eval(typename __gmp_resolve_expr<T>::ptr_type p) const
+ { Op::eval(p, expr.val1.__get_mp(), expr.val2); }
+ const val1_type & get_val1() const { return expr.val1; }
+ const val2_type & get_val2() const { return expr.val2; }
+ mp_bitcnt_t get_prec() const { return expr.val1.get_prec(); }
+};
+
+template <class T, class U, class Op>
+class __gmp_expr<T, __gmp_binary_expr<U, __gmp_expr<T, T>, Op> >
+{
+private:
+ typedef U val1_type;
+ typedef __gmp_expr<T, T> val2_type;
+
+ __gmp_binary_expr<val1_type, val2_type, Op> expr;
+public:
+ __gmp_expr(const val1_type &val1, const val2_type &val2)
+ : expr(val1, val2) { }
+ void eval(typename __gmp_resolve_expr<T>::ptr_type p) const
+ { Op::eval(p, expr.val1, expr.val2.__get_mp()); }
+ const val1_type & get_val1() const { return expr.val1; }
+ const val2_type & get_val2() const { return expr.val2; }
+ mp_bitcnt_t get_prec() const { return expr.val2.get_prec(); }
+};
+
+
+// compound expressions, one argument is a subexpression
+
+template <class T, class U, class V, class Op>
+class __gmp_expr
+<T, __gmp_binary_expr<__gmp_expr<T, T>, __gmp_expr<U, V>, Op> >
+{
+private:
+ typedef __gmp_expr<T, T> val1_type;
+ typedef __gmp_expr<U, V> val2_type;
+
+ __gmp_binary_expr<val1_type, val2_type, Op> expr;
+public:
+ __gmp_expr(const val1_type &val1, const val2_type &val2)
+ : expr(val1, val2) { }
+ void eval(typename __gmp_resolve_expr<T>::ptr_type p) const
+ {
+ if(p != expr.val1.__get_mp())
+ {
+ __gmp_set_expr(p, expr.val2);
+ Op::eval(p, expr.val1.__get_mp(), p);
+ }
+ else
+ {
+ __gmp_temp<T> temp(expr.val2, p);
+ Op::eval(p, expr.val1.__get_mp(), temp.__get_mp());
+ }
+ }
+ const val1_type & get_val1() const { return expr.val1; }
+ const val2_type & get_val2() const { return expr.val2; }
+ mp_bitcnt_t get_prec() const
+ {
+ mp_bitcnt_t prec1 = expr.val1.get_prec(),
+ prec2 = expr.val2.get_prec();
+ return (prec1 > prec2) ? prec1 : prec2;
+ }
+};
+
+template <class T, class U, class V, class Op>
+class __gmp_expr
+<T, __gmp_binary_expr<__gmp_expr<U, V>, __gmp_expr<T, T>, Op> >
+{
+private:
+ typedef __gmp_expr<U, V> val1_type;
+ typedef __gmp_expr<T, T> val2_type;
+
+ __gmp_binary_expr<val1_type, val2_type, Op> expr;
+public:
+ __gmp_expr(const val1_type &val1, const val2_type &val2)
+ : expr(val1, val2) { }
+ void eval(typename __gmp_resolve_expr<T>::ptr_type p) const
+ {
+ if(p != expr.val2.__get_mp())
+ {
+ __gmp_set_expr(p, expr.val1);
+ Op::eval(p, p, expr.val2.__get_mp());
+ }
+ else
+ {
+ __gmp_temp<T> temp(expr.val1, p);
+ Op::eval(p, temp.__get_mp(), expr.val2.__get_mp());
+ }
+ }
+ const val1_type & get_val1() const { return expr.val1; }
+ const val2_type & get_val2() const { return expr.val2; }
+ mp_bitcnt_t get_prec() const
+ {
+ mp_bitcnt_t prec1 = expr.val1.get_prec(),
+ prec2 = expr.val2.get_prec();
+ return (prec1 > prec2) ? prec1 : prec2;
+ }
+};
+
+template <class T, class U, class Op>
+class __gmp_expr
+<T, __gmp_binary_expr<__gmp_expr<T, T>, __gmp_expr<T, U>, Op> >
+{
+private:
+ typedef __gmp_expr<T, T> val1_type;
+ typedef __gmp_expr<T, U> val2_type;
+
+ __gmp_binary_expr<val1_type, val2_type, Op> expr;
+public:
+ __gmp_expr(const val1_type &val1, const val2_type &val2)
+ : expr(val1, val2) { }
+ void eval(typename __gmp_resolve_expr<T>::ptr_type p) const
+ {
+ if(p != expr.val1.__get_mp())
+ {
+ __gmp_set_expr(p, expr.val2);
+ Op::eval(p, expr.val1.__get_mp(), p);
+ }
+ else
+ {
+ __gmp_temp<T> temp(expr.val2, p);
+ Op::eval(p, expr.val1.__get_mp(), temp.__get_mp());
+ }
+ }
+ const val1_type & get_val1() const { return expr.val1; }
+ const val2_type & get_val2() const { return expr.val2; }
+ mp_bitcnt_t get_prec() const
+ {
+ mp_bitcnt_t prec1 = expr.val1.get_prec(),
+ prec2 = expr.val2.get_prec();
+ return (prec1 > prec2) ? prec1 : prec2;
+ }
+};
+
+template <class T, class U, class Op>
+class __gmp_expr
+<T, __gmp_binary_expr<__gmp_expr<T, U>, __gmp_expr<T, T>, Op> >
+{
+private:
+ typedef __gmp_expr<T, U> val1_type;
+ typedef __gmp_expr<T, T> val2_type;
+
+ __gmp_binary_expr<val1_type, val2_type, Op> expr;
+public:
+ __gmp_expr(const val1_type &val1, const val2_type &val2)
+ : expr(val1, val2) { }
+ void eval(typename __gmp_resolve_expr<T>::ptr_type p) const
+ {
+ if(p != expr.val2.__get_mp())
+ {
+ __gmp_set_expr(p, expr.val1);
+ Op::eval(p, p, expr.val2.__get_mp());
+ }
+ else
+ {
+ __gmp_temp<T> temp(expr.val1, p);
+ Op::eval(p, temp.__get_mp(), expr.val2.__get_mp());
+ }
+ }
+ const val1_type & get_val1() const { return expr.val1; }
+ const val2_type & get_val2() const { return expr.val2; }
+ mp_bitcnt_t get_prec() const
+ {
+ mp_bitcnt_t prec1 = expr.val1.get_prec(),
+ prec2 = expr.val2.get_prec();
+ return (prec1 > prec2) ? prec1 : prec2;
+ }
+};
+
+
+// one argument is a subexpression, one is a built-in
+
+template <class T, class U, class V, class Op>
+class __gmp_expr<T, __gmp_binary_expr<__gmp_expr<T, U>, V, Op> >
+{
+private:
+ typedef __gmp_expr<T, U> val1_type;
+ typedef V val2_type;
+
+ __gmp_binary_expr<val1_type, val2_type, Op> expr;
+public:
+ __gmp_expr(const val1_type &val1, const val2_type &val2)
+ : expr(val1, val2) { }
+ void eval(typename __gmp_resolve_expr<T>::ptr_type p) const
+ {
+ expr.val1.eval(p);
+ Op::eval(p, p, expr.val2);
+ }
+ const val1_type & get_val1() const { return expr.val1; }
+ const val2_type & get_val2() const { return expr.val2; }
+ mp_bitcnt_t get_prec() const { return expr.val1.get_prec(); }
+};
+
+template <class T, class U, class V, class Op>
+class __gmp_expr<T, __gmp_binary_expr<U, __gmp_expr<T, V>, Op> >
+{
+private:
+ typedef U val1_type;
+ typedef __gmp_expr<T, V> val2_type;
+
+ __gmp_binary_expr<val1_type, val2_type, Op> expr;
+public:
+ __gmp_expr(const val1_type &val1, const val2_type &val2)
+ : expr(val1, val2) { }
+ void eval(typename __gmp_resolve_expr<T>::ptr_type p) const
+ {
+ expr.val2.eval(p);
+ Op::eval(p, expr.val1, p);
+ }
+ const val1_type & get_val1() const { return expr.val1; }
+ const val2_type & get_val2() const { return expr.val2; }
+ mp_bitcnt_t get_prec() const { return expr.val2.get_prec(); }
+};
+
+
+// both arguments are subexpressions
+
+template <class T, class U, class V, class W, class Op>
+class __gmp_expr
+<T, __gmp_binary_expr<__gmp_expr<T, U>, __gmp_expr<V, W>, Op> >
+{
+private:
+ typedef __gmp_expr<T, U> val1_type;
+ typedef __gmp_expr<V, W> val2_type;
+
+ __gmp_binary_expr<val1_type, val2_type, Op> expr;
+public:
+ __gmp_expr(const val1_type &val1, const val2_type &val2)
+ : expr(val1, val2) { }
+ void eval(typename __gmp_resolve_expr<T>::ptr_type p) const
+ {
+ __gmp_temp<T> temp2(expr.val2, p);
+ expr.val1.eval(p);
+ Op::eval(p, p, temp2.__get_mp());
+ }
+ const val1_type & get_val1() const { return expr.val1; }
+ const val2_type & get_val2() const { return expr.val2; }
+ mp_bitcnt_t get_prec() const
+ {
+ mp_bitcnt_t prec1 = expr.val1.get_prec(),
+ prec2 = expr.val2.get_prec();
+ return (prec1 > prec2) ? prec1 : prec2;
+ }
+};
+
+template <class T, class U, class V, class W, class Op>
+class __gmp_expr
+<T, __gmp_binary_expr<__gmp_expr<U, V>, __gmp_expr<T, W>, Op> >
+{
+private:
+ typedef __gmp_expr<U, V> val1_type;
+ typedef __gmp_expr<T, W> val2_type;
+
+ __gmp_binary_expr<val1_type, val2_type, Op> expr;
+public:
+ __gmp_expr(const val1_type &val1, const val2_type &val2)
+ : expr(val1, val2) { }
+ void eval(typename __gmp_resolve_expr<T>::ptr_type p) const
+ {
+ __gmp_temp<T> temp1(expr.val1, p);
+ expr.val2.eval(p);
+ Op::eval(p, temp1.__get_mp(), p);
+ }
+ const val1_type & get_val1() const { return expr.val1; }
+ const val2_type & get_val2() const { return expr.val2; }
+ mp_bitcnt_t get_prec() const
+ {
+ mp_bitcnt_t prec1 = expr.val1.get_prec(),
+ prec2 = expr.val2.get_prec();
+ return (prec1 > prec2) ? prec1 : prec2;
+ }
+};
+
+template <class T, class U, class V, class Op>
+class __gmp_expr
+<T, __gmp_binary_expr<__gmp_expr<T, U>, __gmp_expr<T, V>, Op> >
+{
+private:
+ typedef __gmp_expr<T, U> val1_type;
+ typedef __gmp_expr<T, V> val2_type;
+
+ __gmp_binary_expr<val1_type, val2_type, Op> expr;
+public:
+ __gmp_expr(const val1_type &val1, const val2_type &val2)
+ : expr(val1, val2) { }
+ void eval(typename __gmp_resolve_expr<T>::ptr_type p) const
+ {
+ __gmp_temp<T> temp2(expr.val2, p);
+ expr.val1.eval(p);
+ Op::eval(p, p, temp2.__get_mp());
+ }
+ const val1_type & get_val1() const { return expr.val1; }
+ const val2_type & get_val2() const { return expr.val2; }
+ mp_bitcnt_t get_prec() const
+ {
+ mp_bitcnt_t prec1 = expr.val1.get_prec(),
+ prec2 = expr.val2.get_prec();
+ return (prec1 > prec2) ? prec1 : prec2;
+ }
+};
+
+
+/**************** Special cases ****************/
+
+/* Some operations (i.e., add and subtract) with mixed mpz/mpq arguments
+ can be done directly without first converting the mpz to mpq.
+ Appropriate specializations of __gmp_expr are required. */
+
+
+#define __GMPZQ_DEFINE_EXPR(eval_fun) \
+ \
+template <> \
+class __gmp_expr<mpq_t, __gmp_binary_expr<mpz_class, mpq_class, eval_fun> > \
+{ \
+private: \
+ typedef mpz_class val1_type; \
+ typedef mpq_class val2_type; \
+ \
+ __gmp_binary_expr<val1_type, val2_type, eval_fun> expr; \
+public: \
+ __gmp_expr(const val1_type &val1, const val2_type &val2) \
+ : expr(val1, val2) { } \
+ void eval(mpq_ptr q) const \
+ { eval_fun::eval(q, expr.val1.get_mpz_t(), expr.val2.get_mpq_t()); } \
+ const val1_type & get_val1() const { return expr.val1; } \
+ const val2_type & get_val2() const { return expr.val2; } \
+ mp_bitcnt_t get_prec() const { return mpf_get_default_prec(); } \
+}; \
+ \
+template <> \
+class __gmp_expr<mpq_t, __gmp_binary_expr<mpq_class, mpz_class, eval_fun> > \
+{ \
+private: \
+ typedef mpq_class val1_type; \
+ typedef mpz_class val2_type; \
+ \
+ __gmp_binary_expr<val1_type, val2_type, eval_fun> expr; \
+public: \
+ __gmp_expr(const val1_type &val1, const val2_type &val2) \
+ : expr(val1, val2) { } \
+ void eval(mpq_ptr q) const \
+ { eval_fun::eval(q, expr.val1.get_mpq_t(), expr.val2.get_mpz_t()); } \
+ const val1_type & get_val1() const { return expr.val1; } \
+ const val2_type & get_val2() const { return expr.val2; } \
+ mp_bitcnt_t get_prec() const { return mpf_get_default_prec(); } \
+}; \
+ \
+template <class T> \
+class __gmp_expr \
+<mpq_t, __gmp_binary_expr<mpz_class, __gmp_expr<mpq_t, T>, eval_fun> > \
+{ \
+private: \
+ typedef mpz_class val1_type; \
+ typedef __gmp_expr<mpq_t, T> val2_type; \
+ \
+ __gmp_binary_expr<val1_type, val2_type, eval_fun> expr; \
+public: \
+ __gmp_expr(const val1_type &val1, const val2_type &val2) \
+ : expr(val1, val2) { } \
+ void eval(mpq_ptr q) const \
+ { \
+ mpq_class temp(expr.val2); \
+ eval_fun::eval(q, expr.val1.get_mpz_t(), temp.get_mpq_t()); \
+ } \
+ const val1_type & get_val1() const { return expr.val1; } \
+ const val2_type & get_val2() const { return expr.val2; } \
+ mp_bitcnt_t get_prec() const { return mpf_get_default_prec(); } \
+}; \
+ \
+template <class T> \
+class __gmp_expr \
+<mpq_t, __gmp_binary_expr<mpq_class, __gmp_expr<mpz_t, T>, eval_fun> > \
+{ \
+private: \
+ typedef mpq_class val1_type; \
+ typedef __gmp_expr<mpz_t, T> val2_type; \
+ \
+ __gmp_binary_expr<val1_type, val2_type, eval_fun> expr; \
+public: \
+ __gmp_expr(const val1_type &val1, const val2_type &val2) \
+ : expr(val1, val2) { } \
+ void eval(mpq_ptr q) const \
+ { \
+ mpz_class temp(expr.val2); \
+ eval_fun::eval(q, expr.val1.get_mpq_t(), temp.get_mpz_t()); \
+ } \
+ const val1_type & get_val1() const { return expr.val1; } \
+ const val2_type & get_val2() const { return expr.val2; } \
+ mp_bitcnt_t get_prec() const { return mpf_get_default_prec(); } \
+}; \
+ \
+template <class T> \
+class __gmp_expr \
+<mpq_t, __gmp_binary_expr<__gmp_expr<mpz_t, T>, mpq_class, eval_fun> > \
+{ \
+private: \
+ typedef __gmp_expr<mpz_t, T> val1_type; \
+ typedef mpq_class val2_type; \
+ \
+ __gmp_binary_expr<val1_type, val2_type, eval_fun> expr; \
+public: \
+ __gmp_expr(const val1_type &val1, const val2_type &val2) \
+ : expr(val1, val2) { } \
+ void eval(mpq_ptr q) const \
+ { \
+ mpz_class temp(expr.val1); \
+ eval_fun::eval(q, temp.get_mpz_t(), expr.val2.get_mpq_t()); \
+ } \
+ const val1_type & get_val1() const { return expr.val1; } \
+ const val2_type & get_val2() const { return expr.val2; } \
+ mp_bitcnt_t get_prec() const { return mpf_get_default_prec(); } \
+}; \
+ \
+template <class T> \
+class __gmp_expr \
+<mpq_t, __gmp_binary_expr<__gmp_expr<mpq_t, T>, mpz_class, eval_fun> > \
+{ \
+private: \
+ typedef __gmp_expr<mpq_t, T> val1_type; \
+ typedef mpz_class val2_type; \
+ \
+ __gmp_binary_expr<val1_type, val2_type, eval_fun> expr; \
+public: \
+ __gmp_expr(const val1_type &val1, const val2_type &val2) \
+ : expr(val1, val2) { } \
+ void eval(mpq_ptr q) const \
+ { \
+ mpq_class temp(expr.val1); \
+ eval_fun::eval(q, temp.get_mpq_t(), expr.val2.get_mpz_t()); \
+ } \
+ const val1_type & get_val1() const { return expr.val1; } \
+ const val2_type & get_val2() const { return expr.val2; } \
+ mp_bitcnt_t get_prec() const { return mpf_get_default_prec(); } \
+}; \
+ \
+template <class T, class U> \
+class __gmp_expr<mpq_t, __gmp_binary_expr \
+<__gmp_expr<mpz_t, T>, __gmp_expr<mpq_t, U>, eval_fun> > \
+{ \
+private: \
+ typedef __gmp_expr<mpz_t, T> val1_type; \
+ typedef __gmp_expr<mpq_t, U> val2_type; \
+ \
+ __gmp_binary_expr<val1_type, val2_type, eval_fun> expr; \
+public: \
+ __gmp_expr(const val1_type &val1, const val2_type &val2) \
+ : expr(val1, val2) { } \
+ void eval(mpq_ptr q) const \
+ { \
+ mpz_class temp1(expr.val1); \
+ expr.val2.eval(q); \
+ eval_fun::eval(q, temp1.get_mpz_t(), q); \
+ } \
+ const val1_type & get_val1() const { return expr.val1; } \
+ const val2_type & get_val2() const { return expr.val2; } \
+ mp_bitcnt_t get_prec() const { return mpf_get_default_prec(); } \
+}; \
+ \
+template <class T, class U> \
+class __gmp_expr<mpq_t, __gmp_binary_expr \
+<__gmp_expr<mpq_t, T>, __gmp_expr<mpz_t, U>, eval_fun> > \
+{ \
+private: \
+ typedef __gmp_expr<mpq_t, T> val1_type; \
+ typedef __gmp_expr<mpz_t, U> val2_type; \
+ \
+ __gmp_binary_expr<val1_type, val2_type, eval_fun> expr; \
+public: \
+ __gmp_expr(const val1_type &val1, const val2_type &val2) \
+ : expr(val1, val2) { } \
+ void eval(mpq_ptr q) const \
+ { \
+ mpz_class temp2(expr.val2); \
+ expr.val1.eval(q); \
+ eval_fun::eval(q, q, temp2.get_mpz_t()); \
+ } \
+ const val1_type & get_val1() const { return expr.val1; } \
+ const val2_type & get_val2() const { return expr.val2; } \
+ mp_bitcnt_t get_prec() const { return mpf_get_default_prec(); } \
+};
+
+
+__GMPZQ_DEFINE_EXPR(__gmp_binary_plus)
+__GMPZQ_DEFINE_EXPR(__gmp_binary_minus)
+
+
+
+/**************** Macros for defining functions ****************/
+/* Results of operators and functions are instances of __gmp_expr<T, U>.
+ T determines the numerical type of the expression: it can be either
+ mpz_t, mpq_t, or mpf_t. When the arguments of a binary
+ expression have different numerical types, __gmp_resolve_expr is used
+ to determine the "larger" type.
+ U is either __gmp_unary_expr<V, Op> or __gmp_binary_expr<V, W, Op>,
+ where V and W are the arguments' types -- they can in turn be
+ expressions, thus allowing to build compound expressions to any
+ degree of complexity.
+ Op is a function object that must have an eval() method accepting
+ appropriate arguments.
+ Actual evaluation of a __gmp_expr<T, U> object is done when it gets
+ assigned to an mp*_class ("lazy" evaluation): this is done by calling
+ its eval() method. */
+
+
+// non-member unary operators and functions
+
+#define __GMP_DEFINE_UNARY_FUNCTION(fun, eval_fun) \
+ \
+template <class T, 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> \
+inline type fun(const __gmp_expr<T, U> &expr) \
+{ \
+ __gmp_expr<T, T> const& temp(expr); \
+ return eval_fun::eval(temp.__get_mp()); \
+}
+
+
+// non-member binary operators and functions
+
+#define __GMPP_DEFINE_BINARY_FUNCTION(fun, eval_fun) \
+ \
+template <class T, class U, class V, class W> \
+inline __gmp_expr<typename __gmp_resolve_expr<T, V>::value_type, \
+__gmp_binary_expr<__gmp_expr<T, U>, __gmp_expr<V, W>, eval_fun> > \
+fun(const __gmp_expr<T, U> &expr1, const __gmp_expr<V, W> &expr2) \
+{ \
+ return __gmp_expr<typename __gmp_resolve_expr<T, V>::value_type, \
+ __gmp_binary_expr<__gmp_expr<T, U>, __gmp_expr<V, W>, eval_fun> > \
+ (expr1, expr2); \
+}
+
+#define __GMPNN_DEFINE_BINARY_FUNCTION(fun, eval_fun, type, bigtype) \
+ \
+template <class T, 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 T, 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(fun, eval_fun, type) \
+__GMPNN_DEFINE_BINARY_FUNCTION(fun, eval_fun, type, signed long int)
+
+#define __GMPNU_DEFINE_BINARY_FUNCTION(fun, eval_fun, type) \
+__GMPNN_DEFINE_BINARY_FUNCTION(fun, eval_fun, type, unsigned long int)
+
+#define __GMPND_DEFINE_BINARY_FUNCTION(fun, eval_fun, type) \
+__GMPNN_DEFINE_BINARY_FUNCTION(fun, eval_fun, type, double)
+
+#define __GMPNLD_DEFINE_BINARY_FUNCTION(fun, eval_fun, type) \
+__GMPNN_DEFINE_BINARY_FUNCTION(fun, eval_fun, type, long double)
+
+#define __GMPN_DEFINE_BINARY_FUNCTION(fun, eval_fun) \
+__GMPNS_DEFINE_BINARY_FUNCTION(fun, eval_fun, signed char) \
+__GMPNU_DEFINE_BINARY_FUNCTION(fun, eval_fun, unsigned char) \
+__GMPNS_DEFINE_BINARY_FUNCTION(fun, eval_fun, signed int) \
+__GMPNU_DEFINE_BINARY_FUNCTION(fun, eval_fun, unsigned int) \
+__GMPNS_DEFINE_BINARY_FUNCTION(fun, eval_fun, signed short int) \
+__GMPNU_DEFINE_BINARY_FUNCTION(fun, eval_fun, unsigned short int) \
+__GMPNS_DEFINE_BINARY_FUNCTION(fun, eval_fun, signed long int) \
+__GMPNU_DEFINE_BINARY_FUNCTION(fun, eval_fun, unsigned long int) \
+__GMPND_DEFINE_BINARY_FUNCTION(fun, eval_fun, float) \
+__GMPND_DEFINE_BINARY_FUNCTION(fun, eval_fun, double) \
+/* __GMPNLD_DEFINE_BINARY_FUNCTION(fun, eval_fun, long double) */
+
+#define __GMP_DEFINE_BINARY_FUNCTION(fun, eval_fun) \
+__GMPP_DEFINE_BINARY_FUNCTION(fun, eval_fun) \
+__GMPN_DEFINE_BINARY_FUNCTION(fun, eval_fun)
+
+
+#define __GMP_DEFINE_BINARY_FUNCTION_UI(fun, eval_fun) \
+ \
+template <class T, class U> \
+inline __gmp_expr \
+<T, __gmp_binary_expr<__gmp_expr<T, U>, mp_bitcnt_t, eval_fun> > \
+fun(const __gmp_expr<T, U> &expr, mp_bitcnt_t l) \
+{ \
+ return __gmp_expr<T, __gmp_binary_expr \
+ <__gmp_expr<T, U>, mp_bitcnt_t, eval_fun> >(expr, l); \
+}
+
+
+#define __GMPP_DEFINE_BINARY_TYPE_FUNCTION(type, fun, eval_fun) \
+ \
+template <class T, class U, class V, class W> \
+inline type fun(const __gmp_expr<T, U> &expr1, \
+ const __gmp_expr<V, W> &expr2) \
+{ \
+ typedef typename __gmp_resolve_expr<T, V>::value_type eval_type; \
+ __gmp_expr<eval_type, eval_type> const& temp1(expr1); \
+ __gmp_expr<eval_type, eval_type> const& temp2(expr2); \
+ return eval_fun::eval(temp1.__get_mp(), temp2.__get_mp()); \
+}
+
+#define __GMPNN_DEFINE_BINARY_TYPE_FUNCTION(type, fun, eval_fun, \
+ type2, bigtype) \
+ \
+template <class T, class U> \
+inline type fun(const __gmp_expr<T, U> &expr, type2 t) \
+{ \
+ __gmp_expr<T, T> const& temp(expr); \
+ return eval_fun::eval(temp.__get_mp(), static_cast<bigtype>(t)); \
+} \
+ \
+template <class T, class U> \
+inline type fun(type2 t, const __gmp_expr<T, U> &expr) \
+{ \
+ __gmp_expr<T, T> const& temp(expr); \
+ return eval_fun::eval(static_cast<bigtype>(t), temp.__get_mp()); \
+}
+
+#define __GMPNS_DEFINE_BINARY_TYPE_FUNCTION(type, fun, eval_fun, type2) \
+__GMPNN_DEFINE_BINARY_TYPE_FUNCTION(type, fun, eval_fun, \
+ type2, signed long int)
+
+#define __GMPNU_DEFINE_BINARY_TYPE_FUNCTION(type, fun, eval_fun, type2) \
+__GMPNN_DEFINE_BINARY_TYPE_FUNCTION(type, fun, eval_fun, \
+ type2, unsigned long int)
+
+#define __GMPND_DEFINE_BINARY_TYPE_FUNCTION(type, fun, eval_fun, type2) \
+__GMPNN_DEFINE_BINARY_TYPE_FUNCTION(type, fun, eval_fun, type2, double)
+
+#define __GMPNLD_DEFINE_BINARY_TYPE_FUNCTION(type, fun, eval_fun, type2) \
+__GMPNN_DEFINE_BINARY_TYPE_FUNCTION(type, fun, eval_fun, type2, long double)
+
+#define __GMPN_DEFINE_BINARY_TYPE_FUNCTION(type, fun, eval_fun) \
+__GMPNS_DEFINE_BINARY_TYPE_FUNCTION(type, fun, eval_fun, signed char) \
+__GMPNU_DEFINE_BINARY_TYPE_FUNCTION(type, fun, eval_fun, unsigned char) \
+__GMPNS_DEFINE_BINARY_TYPE_FUNCTION(type, fun, eval_fun, signed int) \
+__GMPNU_DEFINE_BINARY_TYPE_FUNCTION(type, fun, eval_fun, unsigned int) \
+__GMPNS_DEFINE_BINARY_TYPE_FUNCTION(type, fun, eval_fun, signed short int) \
+__GMPNU_DEFINE_BINARY_TYPE_FUNCTION(type, fun, eval_fun, unsigned short int) \
+__GMPNS_DEFINE_BINARY_TYPE_FUNCTION(type, fun, eval_fun, signed long int) \
+__GMPNU_DEFINE_BINARY_TYPE_FUNCTION(type, fun, eval_fun, unsigned long int) \
+__GMPND_DEFINE_BINARY_TYPE_FUNCTION(type, fun, eval_fun, float) \
+__GMPND_DEFINE_BINARY_TYPE_FUNCTION(type, fun, eval_fun, double) \
+/* __GMPNLD_DEFINE_BINARY_TYPE_FUNCTION(type, fun, eval_fun, long double) */
+
+#define __GMP_DEFINE_BINARY_TYPE_FUNCTION(type, fun, eval_fun) \
+__GMPP_DEFINE_BINARY_TYPE_FUNCTION(type, fun, eval_fun) \
+__GMPN_DEFINE_BINARY_TYPE_FUNCTION(type, fun, eval_fun)
+
+
+// member operators
+
+#define __GMPP_DEFINE_COMPOUND_OPERATOR(type, fun, eval_fun) \
+ \
+template <class T, class U> \
+inline type##_class & type##_class::fun(const __gmp_expr<T, U> &expr) \
+{ \
+ __gmp_set_expr(mp, __gmp_expr<type##_t, __gmp_binary_expr \
+ <type##_class, __gmp_expr<T, U>, eval_fun> >(*this, expr)); \
+ return *this; \
+}
+
+#define __GMPNN_DEFINE_COMPOUND_OPERATOR(type, fun, eval_fun, \
+ type2, bigtype) \
+ \
+inline type##_class & type##_class::fun(type2 t) \
+{ \
+ __gmp_set_expr(mp, __gmp_expr<type##_t, __gmp_binary_expr \
+ <type##_class, bigtype, eval_fun> >(*this, t)); \
+ return *this; \
+}
+
+#define __GMPNS_DEFINE_COMPOUND_OPERATOR(type, fun, eval_fun, type2) \
+__GMPNN_DEFINE_COMPOUND_OPERATOR(type, fun, eval_fun, \
+ type2, signed long int)
+
+#define __GMPNU_DEFINE_COMPOUND_OPERATOR(type, fun, eval_fun, type2) \
+__GMPNN_DEFINE_COMPOUND_OPERATOR(type, fun, eval_fun, \
+ type2, unsigned long int)
+
+#define __GMPND_DEFINE_COMPOUND_OPERATOR(type, fun, eval_fun, type2) \
+__GMPNN_DEFINE_COMPOUND_OPERATOR(type, fun, eval_fun, type2, double)
+
+#define __GMPNLD_DEFINE_COMPOUND_OPERATOR(type, fun, eval_fun, type2) \
+__GMPNN_DEFINE_COMPOUND_OPERATOR(type, fun, eval_fun, type2, long double)
+
+#define __GMPN_DEFINE_COMPOUND_OPERATOR(type, fun, eval_fun) \
+__GMPNS_DEFINE_COMPOUND_OPERATOR(type, fun, eval_fun, signed char) \
+__GMPNU_DEFINE_COMPOUND_OPERATOR(type, fun, eval_fun, unsigned char) \
+__GMPNS_DEFINE_COMPOUND_OPERATOR(type, fun, eval_fun, signed int) \
+__GMPNU_DEFINE_COMPOUND_OPERATOR(type, fun, eval_fun, unsigned int) \
+__GMPNS_DEFINE_COMPOUND_OPERATOR(type, fun, eval_fun, signed short int) \
+__GMPNU_DEFINE_COMPOUND_OPERATOR(type, fun, eval_fun, unsigned short int) \
+__GMPNS_DEFINE_COMPOUND_OPERATOR(type, fun, eval_fun, signed long int) \
+__GMPNU_DEFINE_COMPOUND_OPERATOR(type, fun, eval_fun, unsigned long int) \
+__GMPND_DEFINE_COMPOUND_OPERATOR(type, fun, eval_fun, float) \
+__GMPND_DEFINE_COMPOUND_OPERATOR(type, fun, eval_fun, double) \
+/* __GMPNLD_DEFINE_COMPOUND_OPERATOR(type, fun, eval_fun, long double) */
+
+#define __GMP_DEFINE_COMPOUND_OPERATOR(type, fun, eval_fun) \
+__GMPP_DEFINE_COMPOUND_OPERATOR(type, fun, eval_fun) \
+__GMPN_DEFINE_COMPOUND_OPERATOR(type, fun, eval_fun)
+
+#define __GMPZ_DEFINE_COMPOUND_OPERATOR(fun, eval_fun) \
+__GMP_DEFINE_COMPOUND_OPERATOR(mpz, fun, eval_fun)
+
+#define __GMPQ_DEFINE_COMPOUND_OPERATOR(fun, eval_fun) \
+__GMP_DEFINE_COMPOUND_OPERATOR(mpq, fun, eval_fun)
+
+#define __GMPF_DEFINE_COMPOUND_OPERATOR(fun, eval_fun) \
+__GMP_DEFINE_COMPOUND_OPERATOR(mpf, fun, eval_fun)
+
+
+
+#define __GMP_DEFINE_COMPOUND_OPERATOR_UI(type, fun, eval_fun) \
+ \
+inline type##_class & type##_class::fun(mp_bitcnt_t l) \
+{ \
+ __gmp_set_expr(mp, __gmp_expr<type##_t, __gmp_binary_expr \
+ <type##_class, mp_bitcnt_t, eval_fun> >(*this, l)); \
+ return *this; \
+}
+
+#define __GMPZ_DEFINE_COMPOUND_OPERATOR_UI(fun, eval_fun) \
+__GMP_DEFINE_COMPOUND_OPERATOR_UI(mpz, fun, eval_fun)
+
+#define __GMPQ_DEFINE_COMPOUND_OPERATOR_UI(fun, eval_fun) \
+__GMP_DEFINE_COMPOUND_OPERATOR_UI(mpq, fun, eval_fun)
+
+#define __GMPF_DEFINE_COMPOUND_OPERATOR_UI(fun, eval_fun) \
+__GMP_DEFINE_COMPOUND_OPERATOR_UI(mpf, fun, eval_fun)
+
+
+
+#define __GMP_DEFINE_INCREMENT_OPERATOR(type, fun, eval_fun) \
+ \
+inline type##_class & type##_class::fun() \
+{ \
+ eval_fun::eval(mp); \
+ return *this; \
+} \
+ \
+inline type##_class type##_class::fun(int) \
+{ \
+ type##_class temp(*this); \
+ eval_fun::eval(mp); \
+ return temp; \
+}
+
+#define __GMPZ_DEFINE_INCREMENT_OPERATOR(fun, eval_fun) \
+__GMP_DEFINE_INCREMENT_OPERATOR(mpz, fun, eval_fun)
+
+#define __GMPQ_DEFINE_INCREMENT_OPERATOR(fun, eval_fun) \
+__GMP_DEFINE_INCREMENT_OPERATOR(mpq, fun, eval_fun)
+
+#define __GMPF_DEFINE_INCREMENT_OPERATOR(fun, eval_fun) \
+__GMP_DEFINE_INCREMENT_OPERATOR(mpf, fun, eval_fun)
+
+
+
+/**************** Arithmetic operators and functions ****************/
+
+// non-member operators and functions
+
+__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_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_UI(operator<<, __gmp_binary_lshift)
+__GMP_DEFINE_BINARY_FUNCTION_UI(operator>>, __gmp_binary_rshift)
+
+__GMP_DEFINE_BINARY_TYPE_FUNCTION(bool, operator==, __gmp_binary_equal)
+__GMP_DEFINE_BINARY_TYPE_FUNCTION(bool, operator!=, ! __gmp_binary_equal)
+__GMP_DEFINE_BINARY_TYPE_FUNCTION(bool, operator<, __gmp_binary_less)
+__GMP_DEFINE_BINARY_TYPE_FUNCTION(bool, operator<=, ! __gmp_binary_greater)
+__GMP_DEFINE_BINARY_TYPE_FUNCTION(bool, operator>, __gmp_binary_greater)
+__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_UNARY_TYPE_FUNCTION(int, sgn, __gmp_sgn_function)
+__GMP_DEFINE_BINARY_TYPE_FUNCTION(int, cmp, __gmp_cmp_function)
+
+template <class T>
+void swap(__gmp_expr<T, T>& x, __gmp_expr<T, T>& y) __GMPXX_NOEXCEPT
+{ x.swap(y); }
+
+// member operators for mpz_class
+
+__GMPZ_DEFINE_COMPOUND_OPERATOR(operator+=, __gmp_binary_plus)
+__GMPZ_DEFINE_COMPOUND_OPERATOR(operator-=, __gmp_binary_minus)
+__GMPZ_DEFINE_COMPOUND_OPERATOR(operator*=, __gmp_binary_multiplies)
+__GMPZ_DEFINE_COMPOUND_OPERATOR(operator/=, __gmp_binary_divides)
+__GMPZ_DEFINE_COMPOUND_OPERATOR(operator%=, __gmp_binary_modulus)
+
+__GMPZ_DEFINE_COMPOUND_OPERATOR(operator&=, __gmp_binary_and)
+__GMPZ_DEFINE_COMPOUND_OPERATOR(operator|=, __gmp_binary_ior)
+__GMPZ_DEFINE_COMPOUND_OPERATOR(operator^=, __gmp_binary_xor)
+
+__GMPZ_DEFINE_COMPOUND_OPERATOR_UI(operator<<=, __gmp_binary_lshift)
+__GMPZ_DEFINE_COMPOUND_OPERATOR_UI(operator>>=, __gmp_binary_rshift)
+
+__GMPZ_DEFINE_INCREMENT_OPERATOR(operator++, __gmp_unary_increment)
+__GMPZ_DEFINE_INCREMENT_OPERATOR(operator--, __gmp_unary_decrement)
+
+// member operators for mpq_class
+
+__GMPQ_DEFINE_COMPOUND_OPERATOR(operator+=, __gmp_binary_plus)
+__GMPQ_DEFINE_COMPOUND_OPERATOR(operator-=, __gmp_binary_minus)
+__GMPQ_DEFINE_COMPOUND_OPERATOR(operator*=, __gmp_binary_multiplies)
+__GMPQ_DEFINE_COMPOUND_OPERATOR(operator/=, __gmp_binary_divides)
+
+__GMPQ_DEFINE_COMPOUND_OPERATOR_UI(operator<<=, __gmp_binary_lshift)
+__GMPQ_DEFINE_COMPOUND_OPERATOR_UI(operator>>=, __gmp_binary_rshift)
+
+__GMPQ_DEFINE_INCREMENT_OPERATOR(operator++, __gmp_unary_increment)
+__GMPQ_DEFINE_INCREMENT_OPERATOR(operator--, __gmp_unary_decrement)
+
+// member operators for mpf_class
+
+__GMPF_DEFINE_COMPOUND_OPERATOR(operator+=, __gmp_binary_plus)
+__GMPF_DEFINE_COMPOUND_OPERATOR(operator-=, __gmp_binary_minus)
+__GMPF_DEFINE_COMPOUND_OPERATOR(operator*=, __gmp_binary_multiplies)
+__GMPF_DEFINE_COMPOUND_OPERATOR(operator/=, __gmp_binary_divides)
+
+__GMPF_DEFINE_COMPOUND_OPERATOR_UI(operator<<=, __gmp_binary_lshift)
+__GMPF_DEFINE_COMPOUND_OPERATOR_UI(operator>>=, __gmp_binary_rshift)
+
+__GMPF_DEFINE_INCREMENT_OPERATOR(operator++, __gmp_unary_increment)
+__GMPF_DEFINE_INCREMENT_OPERATOR(operator--, __gmp_unary_decrement)
+
+
+
+/**************** Class wrapper for gmp_randstate_t ****************/
+
+class __gmp_urandomb_value { };
+class __gmp_urandomm_value { };
+
+template <>
+class __gmp_expr<mpz_t, __gmp_urandomb_value>
+{
+private:
+ __gmp_randstate_struct *state;
+ mp_bitcnt_t bits;
+public:
+ __gmp_expr(gmp_randstate_t s, mp_bitcnt_t l) : state(s), bits(l) { }
+ void eval(mpz_ptr z) const { __gmp_rand_function::eval(z, state, bits); }
+ mp_bitcnt_t get_prec() const { return mpf_get_default_prec(); }
+};
+
+template <>
+class __gmp_expr<mpz_t, __gmp_urandomm_value>
+{
+private:
+ __gmp_randstate_struct *state;
+ mpz_class range;
+public:
+ __gmp_expr(gmp_randstate_t s, const mpz_class &z) : state(s), range(z) { }
+ void eval(mpz_ptr z) const
+ { __gmp_rand_function::eval(z, state, range.get_mpz_t()); }
+ mp_bitcnt_t get_prec() const { return mpf_get_default_prec(); }
+};
+
+template <>
+class __gmp_expr<mpf_t, __gmp_urandomb_value>
+{
+private:
+ __gmp_randstate_struct *state;
+ mp_bitcnt_t bits;
+public:
+ __gmp_expr(gmp_randstate_t s, mp_bitcnt_t l) : state(s), bits(l) { }
+ void eval(mpf_ptr f) const
+ {
+ __gmp_rand_function::eval(f, state,
+ (bits>0) ? bits : mpf_get_prec(f));
+ }
+ mp_bitcnt_t get_prec() const
+ {
+ if (bits == 0)
+ return mpf_get_default_prec();
+ else
+ return bits;
+ }
+};
+
+extern "C" {
+ typedef void __gmp_randinit_default_t (gmp_randstate_t);
+ typedef void __gmp_randinit_lc_2exp_t (gmp_randstate_t, mpz_srcptr, unsigned long int, mp_bitcnt_t);
+ typedef int __gmp_randinit_lc_2exp_size_t (gmp_randstate_t, mp_bitcnt_t);
+}
+
+class gmp_randclass
+{
+private:
+ gmp_randstate_t state;
+
+ // copy construction and assignment not allowed
+ gmp_randclass(const gmp_randclass &);
+ void operator=(const gmp_randclass &);
+public:
+ // constructors and destructor
+ gmp_randclass(gmp_randalg_t alg, unsigned long int size)
+ {
+ switch (alg)
+ {
+ case GMP_RAND_ALG_LC: // no other cases for now
+ default:
+ gmp_randinit(state, alg, size);
+ break;
+ }
+ }
+
+ // gmp_randinit_default
+ gmp_randclass(__gmp_randinit_default_t* f) { f(state); }
+
+ // gmp_randinit_lc_2exp
+ gmp_randclass(__gmp_randinit_lc_2exp_t* f,
+ mpz_class z, unsigned long int l1, mp_bitcnt_t l2)
+ { f(state, z.get_mpz_t(), l1, l2); }
+
+ // gmp_randinit_lc_2exp_size
+ gmp_randclass(__gmp_randinit_lc_2exp_size_t* f,
+ mp_bitcnt_t size)
+ {
+ if (f (state, size) == 0)
+ throw std::length_error ("gmp_randinit_lc_2exp_size");
+ }
+
+ ~gmp_randclass() { gmp_randclear(state); }
+
+ // initialize
+ void seed(); // choose a random seed some way (?)
+ void seed(unsigned long int s) { gmp_randseed_ui(state, s); }
+ void seed(const mpz_class &z) { gmp_randseed(state, z.get_mpz_t()); }
+
+ // get random number
+ __gmp_expr<mpz_t, __gmp_urandomb_value> get_z_bits(mp_bitcnt_t l)
+ { return __gmp_expr<mpz_t, __gmp_urandomb_value>(state, l); }
+ __gmp_expr<mpz_t, __gmp_urandomb_value> get_z_bits(const mpz_class &z)
+ { return get_z_bits(z.get_ui()); }
+ // FIXME: z.get_bitcnt_t() ?
+
+ __gmp_expr<mpz_t, __gmp_urandomm_value> get_z_range(const mpz_class &z)
+ { return __gmp_expr<mpz_t, __gmp_urandomm_value>(state, z); }
+
+ __gmp_expr<mpf_t, __gmp_urandomb_value> get_f(mp_bitcnt_t prec = 0)
+ { return __gmp_expr<mpf_t, __gmp_urandomb_value>(state, prec); }
+};
+
+
+/**************** Specialize std::numeric_limits ****************/
+
+namespace std {
+ template <> class numeric_limits<mpz_class>
+ {
+ public:
+ static const bool is_specialized = true;
+ static mpz_class min() { return mpz_class(); }
+ static mpz_class max() { return mpz_class(); }
+ static mpz_class lowest() { return mpz_class(); }
+ static const int digits = 0;
+ static const int digits10 = 0;
+ static const int max_digits10 = 0;
+ static const bool is_signed = true;
+ static const bool is_integer = true;
+ static const bool is_exact = true;
+ static const int radix = 2;
+ static mpz_class epsilon() { return mpz_class(); }
+ static mpz_class round_error() { return mpz_class(); }
+ static const int min_exponent = 0;
+ static const int min_exponent10 = 0;
+ static const int max_exponent = 0;
+ static const int max_exponent10 = 0;
+ static const bool has_infinity = false;
+ static const bool has_quiet_NaN = false;
+ static const bool has_signaling_NaN = false;
+ static const float_denorm_style has_denorm = denorm_absent;
+ static const bool has_denorm_loss = false;
+ static mpz_class infinity() { return mpz_class(); }
+ static mpz_class quiet_NaN() { return mpz_class(); }
+ static mpz_class signaling_NaN() { return mpz_class(); }
+ static mpz_class denorm_min() { return mpz_class(); }
+ static const bool is_iec559 = false;
+ static const bool is_bounded = false;
+ static const bool is_modulo = false;
+ static const bool traps = false;
+ static const bool tinyness_before = false;
+ static const float_round_style round_style = round_toward_zero;
+ };
+
+ template <> class numeric_limits<mpq_class>
+ {
+ public:
+ static const bool is_specialized = true;
+ static mpq_class min() { return mpq_class(); }
+ static mpq_class max() { return mpq_class(); }
+ static mpq_class lowest() { return mpq_class(); }
+ static const int digits = 0;
+ static const int digits10 = 0;
+ static const int max_digits10 = 0;
+ static const bool is_signed = true;
+ static const bool is_integer = false;
+ static const bool is_exact = true;
+ static const int radix = 2;
+ static mpq_class epsilon() { return mpq_class(); }
+ static mpq_class round_error() { return mpq_class(); }
+ static const int min_exponent = 0;
+ static const int min_exponent10 = 0;
+ static const int max_exponent = 0;
+ static const int max_exponent10 = 0;
+ static const bool has_infinity = false;
+ static const bool has_quiet_NaN = false;
+ static const bool has_signaling_NaN = false;
+ static const float_denorm_style has_denorm = denorm_absent;
+ static const bool has_denorm_loss = false;
+ static mpq_class infinity() { return mpq_class(); }
+ static mpq_class quiet_NaN() { return mpq_class(); }
+ static mpq_class signaling_NaN() { return mpq_class(); }
+ static mpq_class denorm_min() { return mpq_class(); }
+ static const bool is_iec559 = false;
+ static const bool is_bounded = false;
+ static const bool is_modulo = false;
+ static const bool traps = false;
+ static const bool tinyness_before = false;
+ static const float_round_style round_style = round_toward_zero;
+ };
+
+ template <> class numeric_limits<mpf_class>
+ {
+ public:
+ static const bool is_specialized = true;
+ static mpf_class min() { return mpf_class(); }
+ static mpf_class max() { return mpf_class(); }
+ static mpf_class lowest() { return mpf_class(); }
+ static const int digits = 0;
+ static const int digits10 = 0;
+ static const int max_digits10 = 0;
+ static const bool is_signed = true;
+ static const bool is_integer = false;
+ static const bool is_exact = false;
+ static const int radix = 2;
+ static mpf_class epsilon() { return mpf_class(); }
+ static mpf_class round_error() { return mpf_class(); }
+ static const int min_exponent = 0;
+ static const int min_exponent10 = 0;
+ static const int max_exponent = 0;
+ static const int max_exponent10 = 0;
+ static const bool has_infinity = false;
+ static const bool has_quiet_NaN = false;
+ static const bool has_signaling_NaN = false;
+ static const float_denorm_style has_denorm = denorm_absent;
+ static const bool has_denorm_loss = false;
+ static mpf_class infinity() { return mpf_class(); }
+ static mpf_class quiet_NaN() { return mpf_class(); }
+ static mpf_class signaling_NaN() { return mpf_class(); }
+ static mpf_class denorm_min() { return mpf_class(); }
+ static const bool is_iec559 = false;
+ static const bool is_bounded = false;
+ static const bool is_modulo = false;
+ static const bool traps = false;
+ static const bool tinyness_before = false;
+ static const float_round_style round_style = round_indeterminate;
+ };
+}
+
+
+/**************** #undef all private macros ****************/
+
+#undef __GMPP_DECLARE_COMPOUND_OPERATOR
+#undef __GMPN_DECLARE_COMPOUND_OPERATOR
+#undef __GMP_DECLARE_COMPOUND_OPERATOR
+#undef __GMP_DECLARE_COMPOUND_OPERATOR_UI
+#undef __GMP_DECLARE_INCREMENT_OPERATOR
+#undef __GMPXX_DEFINE_ARITHMETIC_CONSTRUCTORS
+#undef __GMPXX_DEFINE_ARITHMETIC_ASSIGNMENTS
+
+#undef __GMPZQ_DEFINE_EXPR
+
+#undef __GMP_DEFINE_UNARY_FUNCTION
+#undef __GMP_DEFINE_UNARY_TYPE_FUNCTION
+
+#undef __GMPP_DEFINE_BINARY_FUNCTION
+#undef __GMPNN_DEFINE_BINARY_FUNCTION
+#undef __GMPNS_DEFINE_BINARY_FUNCTION
+#undef __GMPNU_DEFINE_BINARY_FUNCTION
+#undef __GMPND_DEFINE_BINARY_FUNCTION
+#undef __GMPNLD_DEFINE_BINARY_FUNCTION
+#undef __GMPN_DEFINE_BINARY_FUNCTION
+#undef __GMP_DEFINE_BINARY_FUNCTION
+
+#undef __GMP_DEFINE_BINARY_FUNCTION_UI
+
+#undef __GMPP_DEFINE_BINARY_TYPE_FUNCTION
+#undef __GMPNN_DEFINE_BINARY_TYPE_FUNCTION
+#undef __GMPNS_DEFINE_BINARY_TYPE_FUNCTION
+#undef __GMPNU_DEFINE_BINARY_TYPE_FUNCTION
+#undef __GMPND_DEFINE_BINARY_TYPE_FUNCTION
+#undef __GMPNLD_DEFINE_BINARY_TYPE_FUNCTION
+#undef __GMPN_DEFINE_BINARY_TYPE_FUNCTION
+#undef __GMP_DEFINE_BINARY_TYPE_FUNCTION
+
+#undef __GMPZ_DEFINE_COMPOUND_OPERATOR
+
+#undef __GMPP_DEFINE_COMPOUND_OPERATOR
+#undef __GMPNN_DEFINE_COMPOUND_OPERATOR
+#undef __GMPNS_DEFINE_COMPOUND_OPERATOR
+#undef __GMPNU_DEFINE_COMPOUND_OPERATOR
+#undef __GMPND_DEFINE_COMPOUND_OPERATOR
+#undef __GMPNLD_DEFINE_COMPOUND_OPERATOR
+#undef __GMPN_DEFINE_COMPOUND_OPERATOR
+#undef __GMP_DEFINE_COMPOUND_OPERATOR
+
+#undef __GMPQ_DEFINE_COMPOUND_OPERATOR
+#undef __GMPF_DEFINE_COMPOUND_OPERATOR
+
+#undef __GMP_DEFINE_COMPOUND_OPERATOR_UI
+#undef __GMPZ_DEFINE_COMPOUND_OPERATOR_UI
+#undef __GMPQ_DEFINE_COMPOUND_OPERATOR_UI
+#undef __GMPF_DEFINE_COMPOUND_OPERATOR_UI
+
+#undef __GMP_DEFINE_INCREMENT_OPERATOR
+#undef __GMPZ_DEFINE_INCREMENT_OPERATOR
+#undef __GMPQ_DEFINE_INCREMENT_OPERATOR
+#undef __GMPF_DEFINE_INCREMENT_OPERATOR
+
+#undef __GMPXX_CONSTANT_TRUE
+#undef __GMPXX_CONSTANT
+
+#endif /* __GMP_PLUSPLUS__ */
diff --git a/Build/source/libs/gmp/gmp-6.0.0/invalid.c b/Build/source/libs/gmp/gmp-6.0.0/invalid.c
new file mode 100644
index 00000000000..81d6720c0dd
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/invalid.c
@@ -0,0 +1,83 @@
+/* __gmp_invalid_operation -- invalid floating point operation.
+
+ 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 2003 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 "config.h"
+
+#include <signal.h>
+#include <stdlib.h>
+
+#if HAVE_UNISTD_H
+#include <unistd.h> /* for getpid */
+#endif
+
+#include "gmp.h"
+#include "gmp-impl.h"
+
+
+/* Incidentally, kill is not available on mingw, but that's ok, it has raise
+ and we'll be using that. */
+#if ! HAVE_RAISE
+#define raise(sig) kill (getpid(), sig)
+#endif
+
+
+/* __gmp_invalid_operation is for an invalid floating point operation, like
+ mpz_set_d on a NaN or Inf. It's done as a subroutine to minimize code in
+ places raising an exception.
+
+ feraiseexcept(FE_INVALID) is not used here, since unfortunately on most
+ systems it would require libm.
+
+ Alternatives:
+
+ It might be possible to check whether a hardware "invalid operation" trap
+ is enabled or not before raising a signal. This would require all
+ callers to be prepared to continue with some bogus result. Bogus returns
+ are bad, but presumably an application disabling the trap is prepared for
+ that.
+
+ On some systems (eg. BSD) the signal handler can find out the reason for
+ a SIGFPE (overflow, invalid, div-by-zero, etc). Perhaps we could get
+ that into our raise too.
+
+ i386 GLIBC implements feraiseexcept(FE_INVALID) with an asm fdiv 0/0.
+ That would both respect the exceptions mask and give a reason code in a
+ BSD signal. */
+
+void
+__gmp_invalid_operation (void)
+{
+ raise (SIGFPE);
+ abort ();
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/longlong.h b/Build/source/libs/gmp/gmp-6.0.0/longlong.h
new file mode 100644
index 00000000000..f144dee9e70
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/longlong.h
@@ -0,0 +1,2183 @@
+/* longlong.h -- definitions for mixed size 32/64 bit arithmetic.
+
+Copyright 1991-1994, 1996, 1997, 1999-2005, 2007-2009, 2011-2013 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/. */
+
+/* You have to define the following before including this file:
+
+ UWtype -- An unsigned type, default type for operations (typically a "word")
+ UHWtype -- An unsigned type, at least half the size of UWtype
+ UDWtype -- An unsigned type, at least twice as large a UWtype
+ W_TYPE_SIZE -- size in bits of UWtype
+
+ SItype, USItype -- Signed and unsigned 32 bit types
+ DItype, UDItype -- Signed and unsigned 64 bit types
+
+ On a 32 bit machine UWtype should typically be USItype;
+ on a 64 bit machine, UWtype should typically be UDItype.
+
+ Optionally, define:
+
+ LONGLONG_STANDALONE -- Avoid code that needs machine-dependent support files
+ NO_ASM -- Disable inline asm
+
+
+ CAUTION! Using this version of longlong.h outside of GMP is not safe. You
+ need to include gmp.h and gmp-impl.h, or certain things might not work as
+ expected.
+*/
+
+#define __BITS4 (W_TYPE_SIZE / 4)
+#define __ll_B ((UWtype) 1 << (W_TYPE_SIZE / 2))
+#define __ll_lowpart(t) ((UWtype) (t) & (__ll_B - 1))
+#define __ll_highpart(t) ((UWtype) (t) >> (W_TYPE_SIZE / 2))
+
+/* This is used to make sure no undesirable sharing between different libraries
+ that use this file takes place. */
+#ifndef __MPN
+#define __MPN(x) __##x
+#endif
+
+/* Define auxiliary asm macros.
+
+ 1) umul_ppmm(high_prod, low_prod, multiplier, multiplicand) multiplies two
+ UWtype integers MULTIPLIER and MULTIPLICAND, and generates a two UWtype
+ word product in HIGH_PROD and LOW_PROD.
+
+ 2) __umulsidi3(a,b) multiplies two UWtype integers A and B, and returns a
+ UDWtype product. This is just a variant of umul_ppmm.
+
+ 3) udiv_qrnnd(quotient, remainder, high_numerator, low_numerator,
+ denominator) divides a UDWtype, composed by the UWtype integers
+ HIGH_NUMERATOR and LOW_NUMERATOR, by DENOMINATOR and places the quotient
+ in QUOTIENT and the remainder in REMAINDER. HIGH_NUMERATOR must be less
+ than DENOMINATOR for correct operation. If, in addition, the most
+ significant bit of DENOMINATOR must be 1, then the pre-processor symbol
+ UDIV_NEEDS_NORMALIZATION is defined to 1.
+
+ 4) sdiv_qrnnd(quotient, remainder, high_numerator, low_numerator,
+ denominator). Like udiv_qrnnd but the numbers are signed. The quotient
+ is rounded towards 0.
+
+ 5) count_leading_zeros(count, x) counts the number of zero-bits from the
+ msb to the first non-zero bit in the UWtype X. This is the number of
+ steps X needs to be shifted left to set the msb. Undefined for X == 0,
+ unless the symbol COUNT_LEADING_ZEROS_0 is defined to some value.
+
+ 6) count_trailing_zeros(count, x) like count_leading_zeros, but counts
+ from the least significant end.
+
+ 7) add_ssaaaa(high_sum, low_sum, high_addend_1, low_addend_1,
+ high_addend_2, low_addend_2) adds two UWtype integers, composed by
+ HIGH_ADDEND_1 and LOW_ADDEND_1, and HIGH_ADDEND_2 and LOW_ADDEND_2
+ respectively. The result is placed in HIGH_SUM and LOW_SUM. Overflow
+ (i.e. carry out) is not stored anywhere, and is lost.
+
+ 8) sub_ddmmss(high_difference, low_difference, high_minuend, low_minuend,
+ high_subtrahend, low_subtrahend) subtracts two two-word UWtype integers,
+ composed by HIGH_MINUEND_1 and LOW_MINUEND_1, and HIGH_SUBTRAHEND_2 and
+ LOW_SUBTRAHEND_2 respectively. The result is placed in HIGH_DIFFERENCE
+ and LOW_DIFFERENCE. Overflow (i.e. carry out) is not stored anywhere,
+ and is lost.
+
+ If any of these macros are left undefined for a particular CPU,
+ C macros are used.
+
+
+ Notes:
+
+ For add_ssaaaa the two high and two low addends can both commute, but
+ unfortunately gcc only supports one "%" commutative in each asm block.
+ This has always been so but is only documented in recent versions
+ (eg. pre-release 3.3). Having two or more "%"s can cause an internal
+ compiler error in certain rare circumstances.
+
+ Apparently it was only the last "%" that was ever actually respected, so
+ the code has been updated to leave just that. Clearly there's a free
+ choice whether high or low should get it, if there's a reason to favour
+ one over the other. Also obviously when the constraints on the two
+ operands are identical there's no benefit to the reloader in any "%" at
+ all.
+
+ */
+
+/* The CPUs come in alphabetical order below.
+
+ Please add support for more CPUs here, or improve the current support
+ for the CPUs below! */
+
+
+/* count_leading_zeros_gcc_clz is count_leading_zeros implemented with gcc
+ 3.4 __builtin_clzl or __builtin_clzll, according to our limb size.
+ Similarly count_trailing_zeros_gcc_ctz using __builtin_ctzl or
+ __builtin_ctzll.
+
+ These builtins are only used when we check what code comes out, on some
+ chips they're merely libgcc calls, where we will instead want an inline
+ in that case (either asm or generic C).
+
+ These builtins are better than an asm block of the same insn, since an
+ asm block doesn't give gcc any information about scheduling or resource
+ usage. We keep an asm block for use on prior versions of gcc though.
+
+ For reference, __builtin_ffs existed in gcc prior to __builtin_clz, but
+ it's not used (for count_leading_zeros) because it generally gives extra
+ code to ensure the result is 0 when the input is 0, which we don't need
+ or want. */
+
+#ifdef _LONG_LONG_LIMB
+#define count_leading_zeros_gcc_clz(count,x) \
+ do { \
+ ASSERT ((x) != 0); \
+ (count) = __builtin_clzll (x); \
+ } while (0)
+#else
+#define count_leading_zeros_gcc_clz(count,x) \
+ do { \
+ ASSERT ((x) != 0); \
+ (count) = __builtin_clzl (x); \
+ } while (0)
+#endif
+
+#ifdef _LONG_LONG_LIMB
+#define count_trailing_zeros_gcc_ctz(count,x) \
+ do { \
+ ASSERT ((x) != 0); \
+ (count) = __builtin_ctzll (x); \
+ } while (0)
+#else
+#define count_trailing_zeros_gcc_ctz(count,x) \
+ do { \
+ ASSERT ((x) != 0); \
+ (count) = __builtin_ctzl (x); \
+ } while (0)
+#endif
+
+
+/* FIXME: The macros using external routines like __MPN(count_leading_zeros)
+ don't need to be under !NO_ASM */
+#if ! defined (NO_ASM)
+
+#if defined (__alpha) && W_TYPE_SIZE == 64
+/* Most alpha-based machines, except Cray systems. */
+#if defined (__GNUC__)
+#if __GMP_GNUC_PREREQ (3,3)
+#define umul_ppmm(ph, pl, m0, m1) \
+ do { \
+ UDItype __m0 = (m0), __m1 = (m1); \
+ (ph) = __builtin_alpha_umulh (__m0, __m1); \
+ (pl) = __m0 * __m1; \
+ } while (0)
+#else
+#define umul_ppmm(ph, pl, m0, m1) \
+ do { \
+ UDItype __m0 = (m0), __m1 = (m1); \
+ __asm__ ("umulh %r1,%2,%0" \
+ : "=r" (ph) \
+ : "%rJ" (m0), "rI" (m1)); \
+ (pl) = __m0 * __m1; \
+ } while (0)
+#endif
+#define UMUL_TIME 18
+#else /* ! __GNUC__ */
+#include <machine/builtins.h>
+#define umul_ppmm(ph, pl, m0, m1) \
+ do { \
+ UDItype __m0 = (m0), __m1 = (m1); \
+ (ph) = __UMULH (m0, m1); \
+ (pl) = __m0 * __m1; \
+ } while (0)
+#endif
+#ifndef LONGLONG_STANDALONE
+#define udiv_qrnnd(q, r, n1, n0, d) \
+ do { UWtype __di; \
+ __di = __MPN(invert_limb) (d); \
+ udiv_qrnnd_preinv (q, r, n1, n0, d, __di); \
+ } 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
+ always goes into libgmp.so, even when not actually used. */
+#define COUNT_LEADING_ZEROS_NEED_CLZ_TAB
+
+#if defined (__GNUC__) && HAVE_HOST_CPU_alpha_CIX
+#define count_leading_zeros(COUNT,X) \
+ __asm__("ctlz %1,%0" : "=r"(COUNT) : "r"(X))
+#define count_trailing_zeros(COUNT,X) \
+ __asm__("cttz %1,%0" : "=r"(COUNT) : "r"(X))
+#endif /* clz/ctz using cix */
+
+#if ! defined (count_leading_zeros) \
+ && defined (__GNUC__) && ! defined (LONGLONG_STANDALONE)
+/* ALPHA_CMPBGE_0 gives "cmpbge $31,src,dst", ie. test src bytes == 0.
+ "$31" is written explicitly in the asm, since an "r" constraint won't
+ select reg 31. There seems no need to worry about "r31" syntax for cray,
+ since gcc itself (pre-release 3.4) emits just $31 in various places. */
+#define ALPHA_CMPBGE_0(dst, src) \
+ do { asm ("cmpbge $31, %1, %0" : "=r" (dst) : "r" (src)); } while (0)
+/* Zero bytes are turned into bits with cmpbge, a __clz_tab lookup counts
+ them, locating the highest non-zero byte. A second __clz_tab lookup
+ counts the leading zero bits in that byte, giving the result. */
+#define count_leading_zeros(count, x) \
+ do { \
+ UWtype __clz__b, __clz__c, __clz__x = (x); \
+ ALPHA_CMPBGE_0 (__clz__b, __clz__x); /* zero bytes */ \
+ __clz__b = __clz_tab [(__clz__b >> 1) ^ 0x7F]; /* 8 to 1 byte */ \
+ __clz__b = __clz__b * 8 - 7; /* 57 to 1 shift */ \
+ __clz__x >>= __clz__b; \
+ __clz__c = __clz_tab [__clz__x]; /* 8 to 1 bit */ \
+ __clz__b = 65 - __clz__b; \
+ (count) = __clz__b - __clz__c; \
+ } while (0)
+#define COUNT_LEADING_ZEROS_NEED_CLZ_TAB
+#endif /* clz using cmpbge */
+
+#if ! defined (count_leading_zeros) && ! defined (LONGLONG_STANDALONE)
+#if HAVE_ATTRIBUTE_CONST
+long __MPN(count_leading_zeros) (UDItype) __attribute__ ((const));
+#else
+long __MPN(count_leading_zeros) (UDItype);
+#endif
+#define count_leading_zeros(count, x) \
+ ((count) = __MPN(count_leading_zeros) (x))
+#endif /* clz using mpn */
+#endif /* __alpha */
+
+#if defined (__AVR) && W_TYPE_SIZE == 8
+#define umul_ppmm(ph, pl, m0, m1) \
+ do { \
+ unsigned short __p = (unsigned short) (m0) * (m1); \
+ (ph) = __p >> 8; \
+ (pl) = __p; \
+ } while (0)
+#endif /* AVR */
+
+#if defined (_CRAY) && W_TYPE_SIZE == 64
+#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)))
+#if defined (_CRAYIEEE) /* I.e., Cray T90/ieee, T3D, and T3E */
+#define umul_ppmm(ph, pl, m0, m1) \
+ do { \
+ UDItype __m0 = (m0), __m1 = (m1); \
+ (ph) = _int_mult_upper (m0, m1); \
+ (pl) = __m0 * __m1; \
+ } while (0)
+#ifndef LONGLONG_STANDALONE
+#define udiv_qrnnd(q, r, n1, n0, d) \
+ do { UWtype __di; \
+ __di = __MPN(invert_limb) (d); \
+ udiv_qrnnd_preinv (q, r, n1, n0, d, __di); \
+ } while (0)
+#endif /* LONGLONG_STANDALONE */
+#endif /* _CRAYIEEE */
+#endif /* _CRAY */
+
+#if defined (__ia64) && W_TYPE_SIZE == 64
+/* This form encourages gcc (pre-release 3.4 at least) to emit predicated
+ "sub r=r,r" and "sub r=r,r,1", giving a 2 cycle latency. The generic
+ code using "al<bl" arithmetically comes out making an actual 0 or 1 in a
+ register, which takes an extra cycle. */
+#define sub_ddmmss(sh, sl, ah, al, bh, bl) \
+ do { \
+ UWtype __x; \
+ __x = (al) - (bl); \
+ if ((al) < (bl)) \
+ (sh) = (ah) - (bh) - 1; \
+ else \
+ (sh) = (ah) - (bh); \
+ (sl) = __x; \
+ } while (0)
+#if defined (__GNUC__) && ! defined (__INTEL_COMPILER)
+/* Do both product parts in assembly, since that gives better code with
+ all gcc versions. Some callers will just use the upper part, and in
+ that situation we waste an instruction, but not any cycles. */
+#define umul_ppmm(ph, pl, m0, m1) \
+ __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; \
+ __asm__ ("mux1 %0 = %1, @rev" : "=r" (_y) : "r" (_x)); \
+ __asm__ ("czx1.l %0 = %1" : "=r" (_a) : "r" (-_y | _y)); \
+ _c = (_a - 1) << 3; \
+ _x >>= _c; \
+ if (_x >= 1 << 4) \
+ _x >>= 4, _c += 4; \
+ if (_x >= 1 << 2) \
+ _x >>= 2, _c += 2; \
+ _c += _x >> 1; \
+ (count) = W_TYPE_SIZE - 1 - _c; \
+ } while (0)
+/* similar to what gcc does for __builtin_ffs, but 0 based rather than 1
+ based, and we don't need a special case for x==0 here */
+#define count_trailing_zeros(count, x) \
+ do { \
+ UWtype __ctz_x = (x); \
+ __asm__ ("popcnt %0 = %1" \
+ : "=r" (count) \
+ : "r" ((__ctz_x-1) & ~__ctz_x)); \
+ } while (0)
+#endif
+#if defined (__INTEL_COMPILER)
+#include <ia64intrin.h>
+#define umul_ppmm(ph, pl, m0, m1) \
+ do { \
+ UWtype _m0 = (m0), _m1 = (m1); \
+ ph = _m64_xmahu (_m0, _m1, 0); \
+ pl = _m0 * _m1; \
+ } while (0)
+#endif
+#ifndef LONGLONG_STANDALONE
+#define udiv_qrnnd(q, r, n1, n0, d) \
+ do { UWtype __di; \
+ __di = __MPN(invert_limb) (d); \
+ udiv_qrnnd_preinv (q, r, n1, n0, d, __di); \
+ } while (0)
+#define UDIV_PREINV_ALWAYS 1
+#define UDIV_NEEDS_NORMALIZATION 1
+#endif
+#define UDIV_TIME 220
+#endif
+
+
+#if defined (__GNUC__)
+
+/* We sometimes need to clobber "cc" with gcc2, but that would not be
+ understood by gcc1. Use cpp to avoid major code duplication. */
+#if __GNUC__ < 2
+#define __CLOBBER_CC
+#define __AND_CLOBBER_CC
+#else /* __GNUC__ >= 2 */
+#define __CLOBBER_CC : "cc"
+#define __AND_CLOBBER_CC , "cc"
+#endif /* __GNUC__ < 2 */
+
+#if (defined (__a29k__) || defined (_AM29K)) && W_TYPE_SIZE == 32
+#define add_ssaaaa(sh, sl, ah, al, bh, bl) \
+ __asm__ ("add %1,%4,%5\n\taddc %0,%2,%3" \
+ : "=r" (sh), "=&r" (sl) \
+ : "r" (ah), "rI" (bh), "%r" (al), "rI" (bl))
+#define sub_ddmmss(sh, sl, ah, al, bh, bl) \
+ __asm__ ("sub %1,%4,%5\n\tsubc %0,%2,%3" \
+ : "=r" (sh), "=&r" (sl) \
+ : "r" (ah), "rI" (bh), "r" (al), "rI" (bl))
+#define umul_ppmm(xh, xl, m0, m1) \
+ do { \
+ USItype __m0 = (m0), __m1 = (m1); \
+ __asm__ ("multiplu %0,%1,%2" \
+ : "=r" (xl) \
+ : "r" (__m0), "r" (__m1)); \
+ __asm__ ("multmu %0,%1,%2" \
+ : "=r" (xh) \
+ : "r" (__m0), "r" (__m1)); \
+ } while (0)
+#define udiv_qrnnd(q, r, n1, n0, d) \
+ __asm__ ("dividu %0,%3,%4" \
+ : "=r" (q), "=q" (r) \
+ : "1" (n1), "r" (n0), "r" (d))
+#define count_leading_zeros(count, x) \
+ __asm__ ("clz %0,%1" \
+ : "=r" (count) \
+ : "r" (x))
+#define COUNT_LEADING_ZEROS_0 32
+#endif /* __a29k__ */
+
+#if defined (__arc__)
+#define add_ssaaaa(sh, sl, ah, al, bh, bl) \
+ __asm__ ("add.f\t%1, %4, %5\n\tadc\t%0, %2, %3" \
+ : "=r" (sh), \
+ "=&r" (sl) \
+ : "r" ((USItype) (ah)), \
+ "rIJ" ((USItype) (bh)), \
+ "%r" ((USItype) (al)), \
+ "rIJ" ((USItype) (bl)))
+#define sub_ddmmss(sh, sl, ah, al, bh, bl) \
+ __asm__ ("sub.f\t%1, %4, %5\n\tsbc\t%0, %2, %3" \
+ : "=r" (sh), \
+ "=&r" (sl) \
+ : "r" ((USItype) (ah)), \
+ "rIJ" ((USItype) (bh)), \
+ "r" ((USItype) (al)), \
+ "rIJ" ((USItype) (bl)))
+#endif
+
+#if defined (__arm__) && !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" \
+ : "=r" (sh), "=&r" (sl) \
+ : "r" (ah), "rI" (bh), "%r" (al), "rI" (bl) __CLOBBER_CC)
+#define sub_ddmmss(sh, sl, ah, al, bh, bl) \
+ do { \
+ if (__builtin_constant_p (al)) \
+ { \
+ if (__builtin_constant_p (ah)) \
+ __asm__ ("rsbs\t%1, %5, %4\n\trsc\t%0, %3, %2" \
+ : "=r" (sh), "=&r" (sl) \
+ : "rI" (ah), "r" (bh), "rI" (al), "r" (bl) __CLOBBER_CC); \
+ else \
+ __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 (ah)) \
+ { \
+ if (__builtin_constant_p (bl)) \
+ __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); \
+ else \
+ __asm__ ("rsbs\t%1, %5, %4\n\trsc\t%0, %3, %2" \
+ : "=r" (sh), "=&r" (sl) \
+ : "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); \
+ } \
+ 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);\
+ } while (0)
+#if 1 || defined (__arm_m__) /* `M' series has widening multiply support */
+#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
+#define udiv_qrnnd(q, r, n1, n0, d) \
+ do { UWtype __di; \
+ __di = __MPN(invert_limb) (d); \
+ udiv_qrnnd_preinv (q, r, n1, n0, d, __di); \
+ } while (0)
+#define UDIV_PREINV_ALWAYS 1
+#define UDIV_NEEDS_NORMALIZATION 1
+#define UDIV_TIME 70
+#endif /* LONGLONG_STANDALONE */
+#else
+#define umul_ppmm(xh, xl, a, b) \
+ __asm__ ("%@ Inlined umul_ppmm\n" \
+" mov %|r0, %2, lsr #16\n" \
+" mov %|r2, %3, lsr #16\n" \
+" bic %|r1, %2, %|r0, lsl #16\n" \
+" bic %|r2, %3, %|r2, lsl #16\n" \
+" mul %1, %|r1, %|r2\n" \
+" mul %|r2, %|r0, %|r2\n" \
+" mul %|r1, %0, %|r1\n" \
+" mul %0, %|r0, %0\n" \
+" adds %|r1, %|r2, %|r1\n" \
+" addcs %0, %0, #65536\n" \
+" adds %1, %1, %|r1, lsl #16\n" \
+" adc %0, %0, %|r1, lsr #16" \
+ : "=&r" (xh), "=r" (xl) \
+ : "r" (a), "r" (b) \
+ : "r0", "r1", "r2")
+#define UMUL_TIME 20
+#ifndef LONGLONG_STANDALONE
+#define udiv_qrnnd(q, r, n1, n0, d) \
+ do { UWtype __r; \
+ (q) = __MPN(udiv_qrnnd) (&__r, (n1), (n0), (d)); \
+ (r) = __r; \
+ } while (0)
+extern UWtype __MPN(udiv_qrnnd) (UWtype *, UWtype, UWtype, UWtype);
+#define UDIV_TIME 200
+#endif /* LONGLONG_STANDALONE */
+#endif
+/* This is a bizarre test, but GCC doesn't define any useful common symbol. */
+#if defined (__ARM_ARCH_5__) || defined (__ARM_ARCH_5T__) || \
+ defined (__ARM_ARCH_5E__) || defined (__ARM_ARCH_5TE__)|| \
+ defined (__ARM_ARCH_6__) || defined (__ARM_ARCH_6J__) || \
+ defined (__ARM_ARCH_6K__) || defined (__ARM_ARCH_6Z__) || \
+ defined (__ARM_ARCH_6ZK__)|| defined (__ARM_ARCH_6T2__)|| \
+ defined (__ARM_ARCH_6M__) || defined (__ARM_ARCH_7__) || \
+ defined (__ARM_ARCH_7A__) || defined (__ARM_ARCH_7R__) || \
+ defined (__ARM_ARCH_7M__) || defined (__ARM_ARCH_7EM__)
+#define count_leading_zeros(count, x) \
+ __asm__ ("clz\t%0, %1" : "=r" (count) : "r" (x))
+#define COUNT_LEADING_ZEROS_0 32
+#endif
+#endif /* __arm__ */
+
+#if defined (__aarch64__) && W_TYPE_SIZE == 64
+/* 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" (ah), "rZ" (bh), "%r" (al), "rI" (bl) __CLOBBER_CC)
+#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" (ah), "rZ,rZ" (bh), "r,Z" (al), "rI,r" (bl) __CLOBBER_CC)
+#define umul_ppmm(ph, pl, m0, m1) \
+ do { \
+ UDItype __m0 = (m0), __m1 = (m1); \
+ __asm__ ("umulh\t%0, %1, %2" : "=r" (ph) : "r" (m0), "r" (m1)); \
+ (pl) = __m0 * __m1; \
+ } while (0)
+#define count_leading_zeros(count, x) \
+ __asm__ ("clz\t%0, %1" : "=r" (count) : "r" (x))
+#define count_trailing_zeros(count, x) \
+ __asm__ ("rbit\t%0, %1\n\tclz\t%0, %0" : "=r" (count) : "r" (x))
+#define COUNT_LEADING_ZEROS_0 64
+#endif /* __aarch64__ */
+
+#if defined (__clipper__) && W_TYPE_SIZE == 32
+#define umul_ppmm(w1, w0, u, v) \
+ ({union {UDItype __ll; \
+ struct {USItype __l, __h;} __i; \
+ } __x; \
+ __asm__ ("mulwux %2,%0" \
+ : "=r" (__x.__ll) \
+ : "%0" ((USItype)(u)), "r" ((USItype)(v))); \
+ (w1) = __x.__i.__h; (w0) = __x.__i.__l;})
+#define smul_ppmm(w1, w0, u, v) \
+ ({union {DItype __ll; \
+ struct {SItype __l, __h;} __i; \
+ } __x; \
+ __asm__ ("mulwx %2,%0" \
+ : "=r" (__x.__ll) \
+ : "%0" ((SItype)(u)), "r" ((SItype)(v))); \
+ (w1) = __x.__i.__h; (w0) = __x.__i.__l;})
+#define __umulsidi3(u, v) \
+ ({UDItype __w; \
+ __asm__ ("mulwux %2,%0" \
+ : "=r" (__w) : "%0" ((USItype)(u)), "r" ((USItype)(v))); \
+ __w; })
+#endif /* __clipper__ */
+
+/* Fujitsu vector computers. */
+#if defined (__uxp__) && W_TYPE_SIZE == 32
+#define umul_ppmm(ph, pl, u, v) \
+ do { \
+ union {UDItype __ll; \
+ struct {USItype __h, __l;} __i; \
+ } __x; \
+ __asm__ ("mult.lu %1,%2,%0" : "=r" (__x.__ll) : "%r" (u), "rK" (v));\
+ (ph) = __x.__i.__h; \
+ (pl) = __x.__i.__l; \
+ } while (0)
+#define smul_ppmm(ph, pl, u, v) \
+ do { \
+ union {UDItype __ll; \
+ struct {USItype __h, __l;} __i; \
+ } __x; \
+ __asm__ ("mult.l %1,%2,%0" : "=r" (__x.__ll) : "%r" (u), "rK" (v)); \
+ (ph) = __x.__i.__h; \
+ (pl) = __x.__i.__l; \
+ } while (0)
+#endif
+
+#if defined (__gmicro__) && W_TYPE_SIZE == 32
+#define add_ssaaaa(sh, sl, ah, al, bh, bl) \
+ __asm__ ("add.w %5,%1\n\taddx %3,%0" \
+ : "=g" (sh), "=&g" (sl) \
+ : "0" ((USItype)(ah)), "g" ((USItype)(bh)), \
+ "%1" ((USItype)(al)), "g" ((USItype)(bl)))
+#define sub_ddmmss(sh, sl, ah, al, bh, bl) \
+ __asm__ ("sub.w %5,%1\n\tsubx %3,%0" \
+ : "=g" (sh), "=&g" (sl) \
+ : "0" ((USItype)(ah)), "g" ((USItype)(bh)), \
+ "1" ((USItype)(al)), "g" ((USItype)(bl)))
+#define umul_ppmm(ph, pl, m0, m1) \
+ __asm__ ("mulx %3,%0,%1" \
+ : "=g" (ph), "=r" (pl) \
+ : "%0" ((USItype)(m0)), "g" ((USItype)(m1)))
+#define udiv_qrnnd(q, r, nh, nl, d) \
+ __asm__ ("divx %4,%0,%1" \
+ : "=g" (q), "=r" (r) \
+ : "1" ((USItype)(nh)), "0" ((USItype)(nl)), "g" ((USItype)(d)))
+#define count_leading_zeros(count, x) \
+ __asm__ ("bsch/1 %1,%0" \
+ : "=g" (count) : "g" ((USItype)(x)), "0" ((USItype)0))
+#endif
+
+#if defined (__hppa) && W_TYPE_SIZE == 32
+#define add_ssaaaa(sh, sl, ah, al, bh, bl) \
+ __asm__ ("add%I5 %5,%r4,%1\n\taddc %r2,%r3,%0" \
+ : "=r" (sh), "=&r" (sl) \
+ : "rM" (ah), "rM" (bh), "%rM" (al), "rI" (bl))
+#define sub_ddmmss(sh, sl, ah, al, bh, bl) \
+ __asm__ ("sub%I4 %4,%r5,%1\n\tsubb %r2,%r3,%0" \
+ : "=r" (sh), "=&r" (sl) \
+ : "rM" (ah), "rM" (bh), "rI" (al), "rM" (bl))
+#if defined (_PA_RISC1_1)
+#define umul_ppmm(wh, wl, u, v) \
+ do { \
+ union {UDItype __ll; \
+ struct {USItype __h, __l;} __i; \
+ } __x; \
+ __asm__ ("xmpyu %1,%2,%0" : "=*f" (__x.__ll) : "*f" (u), "*f" (v)); \
+ (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 { \
+ USItype __tmp; \
+ __asm__ ( \
+ "ldi 1,%0\n" \
+" extru,= %1,15,16,%%r0 ; Bits 31..16 zero?\n" \
+" extru,tr %1,15,16,%1 ; No. Shift down, skip add.\n" \
+" ldo 16(%0),%0 ; Yes. Perform add.\n" \
+" extru,= %1,23,8,%%r0 ; Bits 15..8 zero?\n" \
+" extru,tr %1,23,8,%1 ; No. Shift down, skip add.\n" \
+" ldo 8(%0),%0 ; Yes. Perform add.\n" \
+" extru,= %1,27,4,%%r0 ; Bits 7..4 zero?\n" \
+" extru,tr %1,27,4,%1 ; No. Shift down, skip add.\n" \
+" ldo 4(%0),%0 ; Yes. Perform add.\n" \
+" extru,= %1,29,2,%%r0 ; Bits 3..2 zero?\n" \
+" extru,tr %1,29,2,%1 ; No. Shift down, skip add.\n" \
+" ldo 2(%0),%0 ; Yes. Perform add.\n" \
+" extru %1,30,1,%1 ; Extract bit 1.\n" \
+" sub %0,%1,%0 ; Subtract it.\n" \
+ : "=r" (count), "=r" (__tmp) : "1" (x)); \
+ } while (0)
+#endif /* hppa */
+
+/* These macros are for ABI=2.0w. In ABI=2.0n they can't be used, since GCC
+ (3.2) puts longlong into two adjacent 32-bit registers. Presumably this
+ is just a case of no direct support for 2.0n but treating it like 1.0. */
+#if defined (__hppa) && W_TYPE_SIZE == 64 && ! defined (_LONG_LONG_LIMB)
+#define add_ssaaaa(sh, sl, ah, al, bh, bl) \
+ __asm__ ("add%I5 %5,%r4,%1\n\tadd,dc %r2,%r3,%0" \
+ : "=r" (sh), "=&r" (sl) \
+ : "rM" (ah), "rM" (bh), "%rM" (al), "rI" (bl))
+#define sub_ddmmss(sh, sl, ah, al, bh, bl) \
+ __asm__ ("sub%I4 %4,%r5,%1\n\tsub,db %r2,%r3,%0" \
+ : "=r" (sh), "=&r" (sl) \
+ : "rM" (ah), "rM" (bh), "rI" (al), "rM" (bl))
+#endif /* hppa */
+
+#if (defined (__i370__) || defined (__s390__) || defined (__mvs__)) && W_TYPE_SIZE == 32
+#if defined (__zarch__) || defined (HAVE_HOST_CPU_s390_zarch)
+#define add_ssaaaa(sh, sl, ah, al, bh, bl) \
+ do { \
+/* if (__builtin_constant_p (bl)) \
+ __asm__ ("alfi\t%1,%o5\n\talcr\t%0,%3" \
+ : "=r" (sh), "=&r" (sl) \
+ : "0" (ah), "r" (bh), "%1" (al), "n" (bl) __CLOBBER_CC);\
+ else \
+*/ __asm__ ("alr\t%1,%5\n\talcr\t%0,%3" \
+ : "=r" (sh), "=&r" (sl) \
+ : "0" (ah), "r" (bh), "%1" (al), "r" (bl)__CLOBBER_CC); \
+ } while (0)
+#define sub_ddmmss(sh, sl, ah, al, bh, bl) \
+ do { \
+/* if (__builtin_constant_p (bl)) \
+ __asm__ ("slfi\t%1,%o5\n\tslbr\t%0,%3" \
+ : "=r" (sh), "=&r" (sl) \
+ : "0" (ah), "r" (bh), "1" (al), "n" (bl) __CLOBBER_CC); \
+ else \
+*/ __asm__ ("slr\t%1,%5\n\tslbr\t%0,%3" \
+ : "=r" (sh), "=&r" (sl) \
+ : "0" (ah), "r" (bh), "1" (al), "r" (bl) __CLOBBER_CC); \
+ } while (0)
+#if __GMP_GNUC_PREREQ (4,5)
+#define umul_ppmm(xh, xl, m0, m1) \
+ do { \
+ union {UDItype __ll; \
+ struct {USItype __h, __l;} __i; \
+ } __x; \
+ __x.__ll = (UDItype) (m0) * (UDItype) (m1); \
+ (xh) = __x.__i.__h; (xl) = __x.__i.__l; \
+ } while (0)
+#else
+#if 0
+/* FIXME: this fails if gcc knows about the 64-bit registers. Use only
+ with a new enough processor pretending we have 32-bit registers. */
+#define umul_ppmm(xh, xl, m0, m1) \
+ do { \
+ union {UDItype __ll; \
+ struct {USItype __h, __l;} __i; \
+ } __x; \
+ __asm__ ("mlr\t%0,%2" \
+ : "=r" (__x.__ll) \
+ : "%0" (m0), "r" (m1)); \
+ (xh) = __x.__i.__h; (xl) = __x.__i.__l; \
+ } while (0)
+#else
+#define umul_ppmm(xh, xl, m0, m1) \
+ do { \
+ /* When we have 64-bit regs and gcc is aware of that, we cannot simply use
+ DImode for the product, since that would be allocated to a single 64-bit
+ register, whereas mlr uses the low 32-bits of an even-odd register pair.
+ */ \
+ register USItype __r0 __asm__ ("0"); \
+ register USItype __r1 __asm__ ("1") = (m0); \
+ __asm__ ("mlr\t%0,%3" \
+ : "=r" (__r0), "=r" (__r1) \
+ : "r" (__r1), "r" (m1)); \
+ (xh) = __r0; (xl) = __r1; \
+ } while (0)
+#endif /* if 0 */
+#endif
+#if 0
+/* FIXME: this fails if gcc knows about the 64-bit registers. Use only
+ with a new enough processor pretending we have 32-bit registers. */
+#define udiv_qrnnd(q, r, n1, n0, d) \
+ do { \
+ union {UDItype __ll; \
+ struct {USItype __h, __l;} __i; \
+ } __x; \
+ __x.__i.__h = n1; __x.__i.__l = n0; \
+ __asm__ ("dlr\t%0,%2" \
+ : "=r" (__x.__ll) \
+ : "0" (__x.__ll), "r" (d)); \
+ (q) = __x.__i.__l; (r) = __x.__i.__h; \
+ } while (0)
+#else
+#define udiv_qrnnd(q, r, n1, n0, d) \
+ do { \
+ register USItype __r0 __asm__ ("0") = (n1); \
+ register USItype __r1 __asm__ ("1") = (n0); \
+ __asm__ ("dlr\t%0,%4" \
+ : "=r" (__r0), "=r" (__r1) \
+ : "r" (__r0), "r" (__r1), "r" (d)); \
+ (q) = __r1; (r) = __r0; \
+ } while (0)
+#endif /* if 0 */
+#else /* if __zarch__ */
+/* FIXME: this fails if gcc knows about the 64-bit registers. */
+#define smul_ppmm(xh, xl, m0, m1) \
+ do { \
+ union {DItype __ll; \
+ struct {USItype __h, __l;} __i; \
+ } __x; \
+ __asm__ ("mr\t%0,%2" \
+ : "=r" (__x.__ll) \
+ : "%0" (m0), "r" (m1)); \
+ (xh) = __x.__i.__h; (xl) = __x.__i.__l; \
+ } while (0)
+/* FIXME: this fails if gcc knows about the 64-bit registers. */
+#define sdiv_qrnnd(q, r, n1, n0, d) \
+ do { \
+ union {DItype __ll; \
+ struct {USItype __h, __l;} __i; \
+ } __x; \
+ __x.__i.__h = n1; __x.__i.__l = n0; \
+ __asm__ ("dr\t%0,%2" \
+ : "=r" (__x.__ll) \
+ : "0" (__x.__ll), "r" (d)); \
+ (q) = __x.__i.__l; (r) = __x.__i.__h; \
+ } while (0)
+#endif /* if __zarch__ */
+#endif
+
+#if defined (__s390x__) && W_TYPE_SIZE == 64
+/* We need to cast operands with register constraints, otherwise their types
+ will be assumed to be SImode by gcc. For these machines, such operations
+ will insert a value into the low 32 bits, and leave the high 32 bits with
+ garbage. */
+#define add_ssaaaa(sh, sl, ah, al, bh, bl) \
+ do { \
+ __asm__ ("algr\t%1,%5\n\talcgr\t%0,%3" \
+ : "=r" (sh), "=&r" (sl) \
+ : "0" ((UDItype)(ah)), "r" ((UDItype)(bh)), \
+ "%1" ((UDItype)(al)), "r" ((UDItype)(bl)) __CLOBBER_CC); \
+ } while (0)
+#define sub_ddmmss(sh, sl, ah, al, bh, bl) \
+ do { \
+ __asm__ ("slgr\t%1,%5\n\tslbgr\t%0,%3" \
+ : "=r" (sh), "=&r" (sl) \
+ : "0" ((UDItype)(ah)), "r" ((UDItype)(bh)), \
+ "1" ((UDItype)(al)), "r" ((UDItype)(bl)) __CLOBBER_CC); \
+ } while (0)
+#define umul_ppmm(xh, xl, m0, m1) \
+ do { \
+ union {unsigned int __attribute__ ((mode(TI))) __ll; \
+ struct {UDItype __h, __l;} __i; \
+ } __x; \
+ __asm__ ("mlgr\t%0,%2" \
+ : "=r" (__x.__ll) \
+ : "%0" ((UDItype)(m0)), "r" ((UDItype)(m1))); \
+ (xh) = __x.__i.__h; (xl) = __x.__i.__l; \
+ } while (0)
+#define udiv_qrnnd(q, r, n1, n0, d) \
+ do { \
+ union {unsigned int __attribute__ ((mode(TI))) __ll; \
+ struct {UDItype __h, __l;} __i; \
+ } __x; \
+ __x.__i.__h = n1; __x.__i.__l = n0; \
+ __asm__ ("dlgr\t%0,%2" \
+ : "=r" (__x.__ll) \
+ : "0" (__x.__ll), "r" ((UDItype)(d))); \
+ (q) = __x.__i.__l; (r) = __x.__i.__h; \
+ } while (0)
+#if 0 /* FIXME: Enable for z10 (?) */
+#define count_leading_zeros(cnt, x) \
+ do { \
+ union {unsigned int __attribute__ ((mode(TI))) __ll; \
+ struct {UDItype __h, __l;} __i; \
+ } __clr_cnt; \
+ __asm__ ("flogr\t%0,%1" \
+ : "=r" (__clr_cnt.__ll) \
+ : "r" (x) __CLOBBER_CC); \
+ (cnt) = __clr_cnt.__i.__h; \
+ } while (0)
+#endif
+#endif
+
+#if (defined (__i386__) || defined (__i486__)) && W_TYPE_SIZE == 32
+#define add_ssaaaa(sh, sl, ah, al, bh, bl) \
+ __asm__ ("addl %5,%k1\n\tadcl %3,%k0" \
+ : "=r" (sh), "=&r" (sl) \
+ : "0" ((USItype)(ah)), "g" ((USItype)(bh)), \
+ "%1" ((USItype)(al)), "g" ((USItype)(bl)))
+#define sub_ddmmss(sh, sl, ah, al, bh, bl) \
+ __asm__ ("subl %5,%k1\n\tsbbl %3,%k0" \
+ : "=r" (sh), "=&r" (sl) \
+ : "0" ((USItype)(ah)), "g" ((USItype)(bh)), \
+ "1" ((USItype)(al)), "g" ((USItype)(bl)))
+#define umul_ppmm(w1, w0, u, v) \
+ __asm__ ("mull %3" \
+ : "=a" (w0), "=d" (w1) \
+ : "%0" ((USItype)(u)), "rm" ((USItype)(v)))
+#define udiv_qrnnd(q, r, n1, n0, dx) /* d renamed to dx avoiding "=d" */\
+ __asm__ ("divl %4" /* stringification in K&R C */ \
+ : "=a" (q), "=d" (r) \
+ : "0" ((USItype)(n0)), "1" ((USItype)(n1)), "rm" ((USItype)(dx)))
+
+#if HAVE_HOST_CPU_i586 || HAVE_HOST_CPU_pentium || HAVE_HOST_CPU_pentiummmx
+/* Pentium bsrl takes between 10 and 72 cycles depending where the most
+ significant 1 bit is, hence the use of the following alternatives. bsfl
+ is slow too, between 18 and 42 depending where the least significant 1
+ bit is, so let the generic count_trailing_zeros below make use of the
+ count_leading_zeros here too. */
+
+#if HAVE_HOST_CPU_pentiummmx && ! defined (LONGLONG_STANDALONE)
+/* The following should be a fixed 14 or 15 cycles, but possibly plus an L1
+ cache miss reading from __clz_tab. For P55 it's favoured over the float
+ below so as to avoid mixing MMX and x87, since the penalty for switching
+ between the two is about 100 cycles.
+
+ The asm block sets __shift to -3 if the high 24 bits are clear, -2 for
+ 16, -1 for 8, or 0 otherwise. This could be written equivalently as
+ follows, but as of gcc 2.95.2 it results in conditional jumps.
+
+ __shift = -(__n < 0x1000000);
+ __shift -= (__n < 0x10000);
+ __shift -= (__n < 0x100);
+
+ The middle two sbbl and cmpl's pair, and with luck something gcc
+ generates might pair with the first cmpl and the last sbbl. The "32+1"
+ constant could be folded into __clz_tab[], but it doesn't seem worth
+ making a different table just for that. */
+
+#define count_leading_zeros(c,n) \
+ do { \
+ USItype __n = (n); \
+ USItype __shift; \
+ __asm__ ("cmpl $0x1000000, %1\n" \
+ "sbbl %0, %0\n" \
+ "cmpl $0x10000, %1\n" \
+ "sbbl $0, %0\n" \
+ "cmpl $0x100, %1\n" \
+ "sbbl $0, %0\n" \
+ : "=&r" (__shift) : "r" (__n)); \
+ __shift = __shift*8 + 24 + 1; \
+ (c) = 32 + 1 - __shift - __clz_tab[__n >> __shift]; \
+ } while (0)
+#define COUNT_LEADING_ZEROS_NEED_CLZ_TAB
+#define COUNT_LEADING_ZEROS_0 31 /* n==0 indistinguishable from n==1 */
+
+#else /* ! pentiummmx || LONGLONG_STANDALONE */
+/* The following should be a fixed 14 cycles or so. Some scheduling
+ opportunities should be available between the float load/store too. This
+ sort of code is used in gcc 3 for __builtin_ffs (with "n&-n") and is
+ apparently suggested by the Intel optimizing manual (don't know exactly
+ where). gcc 2.95 or up will be best for this, so the "double" is
+ correctly aligned on the stack. */
+#define count_leading_zeros(c,n) \
+ do { \
+ union { \
+ double d; \
+ unsigned a[2]; \
+ } __u; \
+ ASSERT ((n) != 0); \
+ __u.d = (UWtype) (n); \
+ (c) = 0x3FF + 31 - (__u.a[1] >> 20); \
+ } while (0)
+#define COUNT_LEADING_ZEROS_0 (0x3FF + 31)
+#endif /* pentiummx */
+
+#else /* ! pentium */
+
+#if __GMP_GNUC_PREREQ (3,4) /* using bsrl */
+#define count_leading_zeros(count,x) count_leading_zeros_gcc_clz(count,x)
+#endif /* gcc clz */
+
+/* On P6, gcc prior to 3.0 generates a partial register stall for
+ __cbtmp^31, due to using "xorb $31" instead of "xorl $31", the former
+ being 1 code byte smaller. "31-__cbtmp" is a workaround, probably at the
+ cost of one extra instruction. Do this for "i386" too, since that means
+ generic x86. */
+#if ! defined (count_leading_zeros) && __GNUC__ < 3 \
+ && (HAVE_HOST_CPU_i386 \
+ || HAVE_HOST_CPU_i686 \
+ || HAVE_HOST_CPU_pentiumpro \
+ || HAVE_HOST_CPU_pentium2 \
+ || HAVE_HOST_CPU_pentium3)
+#define count_leading_zeros(count, x) \
+ do { \
+ USItype __cbtmp; \
+ ASSERT ((x) != 0); \
+ __asm__ ("bsrl %1,%0" : "=r" (__cbtmp) : "rm" ((USItype)(x))); \
+ (count) = 31 - __cbtmp; \
+ } while (0)
+#endif /* gcc<3 asm bsrl */
+
+#ifndef count_leading_zeros
+#define count_leading_zeros(count, x) \
+ do { \
+ USItype __cbtmp; \
+ ASSERT ((x) != 0); \
+ __asm__ ("bsrl %1,%0" : "=r" (__cbtmp) : "rm" ((USItype)(x))); \
+ (count) = __cbtmp ^ 31; \
+ } while (0)
+#endif /* asm bsrl */
+
+#if __GMP_GNUC_PREREQ (3,4) /* using bsfl */
+#define count_trailing_zeros(count,x) count_trailing_zeros_gcc_ctz(count,x)
+#endif /* gcc ctz */
+
+#ifndef count_trailing_zeros
+#define count_trailing_zeros(count, x) \
+ do { \
+ ASSERT ((x) != 0); \
+ __asm__ ("bsfl %1,%k0" : "=r" (count) : "rm" ((USItype)(x))); \
+ } while (0)
+#endif /* asm bsfl */
+
+#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
+#define add_ssaaaa(sh, sl, ah, al, bh, bl) \
+ __asm__ ("addq %5,%q1\n\tadcq %3,%q0" \
+ : "=r" (sh), "=&r" (sl) \
+ : "0" ((UDItype)(ah)), "rme" ((UDItype)(bh)), \
+ "%1" ((UDItype)(al)), "rme" ((UDItype)(bl)))
+#define sub_ddmmss(sh, sl, ah, al, bh, bl) \
+ __asm__ ("subq %5,%q1\n\tsbbq %3,%q0" \
+ : "=r" (sh), "=&r" (sl) \
+ : "0" ((UDItype)(ah)), "rme" ((UDItype)(bh)), \
+ "1" ((UDItype)(al)), "rme" ((UDItype)(bl)))
+#define umul_ppmm(w1, w0, u, v) \
+ __asm__ ("mulq %3" \
+ : "=a" (w0), "=d" (w1) \
+ : "%0" ((UDItype)(u)), "rm" ((UDItype)(v)))
+#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. */
+#define count_leading_zeros(count, x) \
+ do { \
+ UDItype __cbtmp; \
+ ASSERT ((x) != 0); \
+ __asm__ ("bsrq %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. */
+#define count_trailing_zeros(count, x) \
+ do { \
+ ASSERT ((x) != 0); \
+ __asm__ ("bsfq %1,%q0" : "=r" (count) : "rm" ((UDItype)(x))); \
+ } while (0)
+#endif /* __amd64__ */
+
+#if defined (__i860__) && W_TYPE_SIZE == 32
+#define rshift_rhlc(r,h,l,c) \
+ __asm__ ("shr %3,r0,r0\;shrd %1,%2,%0" \
+ "=r" (r) : "r" (h), "r" (l), "rn" (c))
+#endif /* i860 */
+
+#if defined (__i960__) && W_TYPE_SIZE == 32
+#define add_ssaaaa(sh, sl, ah, al, bh, bl) \
+ __asm__ ("cmpo 1,0\;addc %5,%4,%1\;addc %3,%2,%0" \
+ : "=r" (sh), "=&r" (sl) \
+ : "dI" (ah), "dI" (bh), "%dI" (al), "dI" (bl))
+#define sub_ddmmss(sh, sl, ah, al, bh, bl) \
+ __asm__ ("cmpo 0,0\;subc %5,%4,%1\;subc %3,%2,%0" \
+ : "=r" (sh), "=&r" (sl) \
+ : "dI" (ah), "dI" (bh), "dI" (al), "dI" (bl))
+#define umul_ppmm(w1, w0, u, v) \
+ ({union {UDItype __ll; \
+ struct {USItype __l, __h;} __i; \
+ } __x; \
+ __asm__ ("emul %2,%1,%0" \
+ : "=d" (__x.__ll) : "%dI" (u), "dI" (v)); \
+ (w1) = __x.__i.__h; (w0) = __x.__i.__l;})
+#define __umulsidi3(u, v) \
+ ({UDItype __w; \
+ __asm__ ("emul %2,%1,%0" : "=d" (__w) : "%dI" (u), "dI" (v)); \
+ __w; })
+#define udiv_qrnnd(q, r, nh, nl, d) \
+ do { \
+ union {UDItype __ll; \
+ struct {USItype __l, __h;} __i; \
+ } __nn; \
+ __nn.__i.__h = (nh); __nn.__i.__l = (nl); \
+ __asm__ ("ediv %d,%n,%0" \
+ : "=d" (__rq.__ll) : "dI" (__nn.__ll), "dI" (d)); \
+ (r) = __rq.__i.__l; (q) = __rq.__i.__h; \
+ } while (0)
+#define count_leading_zeros(count, x) \
+ do { \
+ USItype __cbtmp; \
+ __asm__ ("scanbit %1,%0" : "=r" (__cbtmp) : "r" (x)); \
+ (count) = __cbtmp ^ 31; \
+ } while (0)
+#define COUNT_LEADING_ZEROS_0 (-32) /* sic */
+#if defined (__i960mx) /* what is the proper symbol to test??? */
+#define rshift_rhlc(r,h,l,c) \
+ do { \
+ union {UDItype __ll; \
+ struct {USItype __l, __h;} __i; \
+ } __nn; \
+ __nn.__i.__h = (h); __nn.__i.__l = (l); \
+ __asm__ ("shre %2,%1,%0" : "=d" (r) : "dI" (__nn.__ll), "dI" (c)); \
+ }
+#endif /* i960mx */
+#endif /* i960 */
+
+#if (defined (__mc68000__) || defined (__mc68020__) || defined(mc68020) \
+ || defined (__m68k__) || defined (__mc5200__) || defined (__mc5206e__) \
+ || defined (__mc5307__)) && W_TYPE_SIZE == 32
+#define add_ssaaaa(sh, sl, ah, al, bh, bl) \
+ __asm__ ("add%.l %5,%1\n\taddx%.l %3,%0" \
+ : "=d" (sh), "=&d" (sl) \
+ : "0" ((USItype)(ah)), "d" ((USItype)(bh)), \
+ "%1" ((USItype)(al)), "g" ((USItype)(bl)))
+#define sub_ddmmss(sh, sl, ah, al, bh, bl) \
+ __asm__ ("sub%.l %5,%1\n\tsubx%.l %3,%0" \
+ : "=d" (sh), "=&d" (sl) \
+ : "0" ((USItype)(ah)), "d" ((USItype)(bh)), \
+ "1" ((USItype)(al)), "g" ((USItype)(bl)))
+/* The '020, '030, '040 and CPU32 have 32x32->64 and 64/32->32q-32r. */
+#if defined (__mc68020__) || defined(mc68020) \
+ || defined (__mc68030__) || defined (mc68030) \
+ || defined (__mc68040__) || defined (mc68040) \
+ || defined (__mcpu32__) || defined (mcpu32) \
+ || defined (__NeXT__)
+#define umul_ppmm(w1, w0, u, v) \
+ __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) \
+ : "0" ((USItype)(n0)), "1" ((USItype)(n1)), "dmi" ((USItype)(d)))
+#else /* for other 68k family members use 16x16->32 multiplication */
+#define umul_ppmm(xh, xl, a, b) \
+ do { USItype __umul_tmp1, __umul_tmp2; \
+ __asm__ ("| Inlined umul_ppmm\n" \
+" move%.l %5,%3\n" \
+" move%.l %2,%0\n" \
+" move%.w %3,%1\n" \
+" swap %3\n" \
+" swap %0\n" \
+" mulu%.w %2,%1\n" \
+" mulu%.w %3,%0\n" \
+" mulu%.w %2,%3\n" \
+" swap %2\n" \
+" mulu%.w %5,%2\n" \
+" add%.l %3,%2\n" \
+" jcc 1f\n" \
+" add%.l %#0x10000,%0\n" \
+"1: move%.l %2,%3\n" \
+" clr%.w %2\n" \
+" swap %2\n" \
+" swap %3\n" \
+" clr%.w %3\n" \
+" add%.l %3,%1\n" \
+" addx%.l %2,%0\n" \
+" | End inlined umul_ppmm" \
+ : "=&d" (xh), "=&d" (xl), \
+ "=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
+ exclude bfffo on that chip (bitfield insns not available). */
+#if (defined (__mc68020__) || defined (mc68020) \
+ || defined (__mc68030__) || defined (mc68030) \
+ || defined (__mc68040__) || defined (mc68040) \
+ || defined (__mc68060__) || defined (mc68060) \
+ || defined (__NeXT__)) \
+ && ! defined (__mcpu32__)
+#define count_leading_zeros(count, x) \
+ __asm__ ("bfffo %1{%b2:%b2},%0" \
+ : "=d" (count) \
+ : "od" ((USItype) (x)), "n" (0))
+#define COUNT_LEADING_ZEROS_0 32
+#endif
+#endif /* mc68000 */
+
+#if defined (__m88000__) && W_TYPE_SIZE == 32
+#define add_ssaaaa(sh, sl, ah, al, bh, bl) \
+ __asm__ ("addu.co %1,%r4,%r5\n\taddu.ci %0,%r2,%r3" \
+ : "=r" (sh), "=&r" (sl) \
+ : "rJ" (ah), "rJ" (bh), "%rJ" (al), "rJ" (bl))
+#define sub_ddmmss(sh, sl, ah, al, bh, bl) \
+ __asm__ ("subu.co %1,%r4,%r5\n\tsubu.ci %0,%r2,%r3" \
+ : "=r" (sh), "=&r" (sl) \
+ : "rJ" (ah), "rJ" (bh), "rJ" (al), "rJ" (bl))
+#define count_leading_zeros(count, x) \
+ do { \
+ USItype __cbtmp; \
+ __asm__ ("ff1 %0,%1" : "=r" (__cbtmp) : "r" (x)); \
+ (count) = __cbtmp ^ 31; \
+ } while (0)
+#define COUNT_LEADING_ZEROS_0 63 /* sic */
+#if defined (__m88110__)
+#define umul_ppmm(wh, wl, u, v) \
+ do { \
+ union {UDItype __ll; \
+ struct {USItype __h, __l;} __i; \
+ } __x; \
+ __asm__ ("mulu.d %0,%1,%2" : "=r" (__x.__ll) : "r" (u), "r" (v)); \
+ (wh) = __x.__i.__h; \
+ (wl) = __x.__i.__l; \
+ } while (0)
+#define udiv_qrnnd(q, r, n1, n0, d) \
+ ({union {UDItype __ll; \
+ struct {USItype __h, __l;} __i; \
+ } __x, __q; \
+ __x.__i.__h = (n1); __x.__i.__l = (n0); \
+ __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__ */
+
+#if defined (__mips) && W_TYPE_SIZE == 32
+#if __GMP_GNUC_PREREQ (4,4)
+#define umul_ppmm(w1, w0, u, v) \
+ do { \
+ UDItype __ll = (UDItype)(u) * (v); \
+ w1 = __ll >> 32; \
+ w0 = __ll; \
+ } while (0)
+#endif
+#if !defined (umul_ppmm) && __GMP_GNUC_PREREQ (2,7)
+#define umul_ppmm(w1, w0, u, v) \
+ __asm__ ("multu %2,%3" : "=l" (w0), "=h" (w1) : "d" (u), "d" (v))
+#endif
+#if !defined (umul_ppmm)
+#define umul_ppmm(w1, w0, u, v) \
+ __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)
+#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) && __GMP_GNUC_PREREQ (2,7)
+#define umul_ppmm(w1, w0, u, v) \
+ __asm__ ("dmultu %2,%3" : "=l" (w0), "=h" (w1) : "d" (u), "d" (v))
+#endif
+#if !defined (umul_ppmm)
+#define umul_ppmm(w1, w0, u, v) \
+ __asm__ ("dmultu %2,%3\n\tmflo %0\n\tmfhi %1" \
+ : "=d" (w0), "=d" (w1) : "d" (u), "d" (v))
+#endif
+#define UMUL_TIME 20
+#define UDIV_TIME 140
+#endif /* __mips */
+
+#if defined (__mmix__) && W_TYPE_SIZE == 64
+#define umul_ppmm(w1, w0, u, v) \
+ __asm__ ("MULU %0,%2,%3" : "=r" (w0), "=z" (w1) : "r" (u), "r" (v))
+#endif
+
+#if defined (__ns32000__) && W_TYPE_SIZE == 32
+#define umul_ppmm(w1, w0, u, v) \
+ ({union {UDItype __ll; \
+ struct {USItype __l, __h;} __i; \
+ } __x; \
+ __asm__ ("meid %2,%0" \
+ : "=g" (__x.__ll) \
+ : "%0" ((USItype)(u)), "g" ((USItype)(v))); \
+ (w1) = __x.__i.__h; (w0) = __x.__i.__l;})
+#define __umulsidi3(u, v) \
+ ({UDItype __w; \
+ __asm__ ("meid %2,%0" \
+ : "=g" (__w) \
+ : "%0" ((USItype)(u)), "g" ((USItype)(v))); \
+ __w; })
+#define udiv_qrnnd(q, r, n1, n0, d) \
+ ({union {UDItype __ll; \
+ struct {USItype __l, __h;} __i; \
+ } __x; \
+ __x.__i.__h = (n1); __x.__i.__l = (n0); \
+ __asm__ ("deid %2,%0" \
+ : "=g" (__x.__ll) \
+ : "0" (__x.__ll), "g" ((USItype)(d))); \
+ (r) = __x.__i.__l; (q) = __x.__i.__h; })
+#define count_trailing_zeros(count,x) \
+ do { \
+ __asm__ ("ffsd %2,%0" \
+ : "=r" (count) \
+ : "0" ((USItype) 0), "r" ((USItype) (x))); \
+ } while (0)
+#endif /* __ns32000__ */
+
+/* In the past we had a block of various #defines tested
+ _ARCH_PPC - AIX
+ _ARCH_PWR - AIX
+ __powerpc__ - gcc
+ __POWERPC__ - BEOS
+ __ppc__ - Darwin
+ PPC - old gcc, GNU/Linux, SysV
+ The plain PPC test was not good for vxWorks, since PPC is defined on all
+ CPUs there (eg. m68k too), as a constant one is expected to compare
+ CPU_FAMILY against.
+
+ At any rate, this was pretty unattractive and a bit fragile. The use of
+ HAVE_HOST_CPU_FAMILY is designed to cut through it all and be sure of
+ getting the desired effect.
+
+ ENHANCE-ME: We should test _IBMR2 here when we add assembly support for
+ the system vendor compilers. (Is that vendor compilers with inline asm,
+ or what?) */
+
+#if (HAVE_HOST_CPU_FAMILY_power || HAVE_HOST_CPU_FAMILY_powerpc) \
+ && W_TYPE_SIZE == 32
+#define add_ssaaaa(sh, sl, ah, al, bh, bl) \
+ 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)); \
+ 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)); \
+ else \
+ __asm__ ("add%I5c %1,%4,%5\n\tadde %0,%2,%3" \
+ : "=r" (sh), "=&r" (sl) \
+ : "r" (ah), "r" (bh), "%r" (al), "rI" (bl)); \
+ } 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));\
+ 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));\
+ 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));\
+ 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));\
+ else \
+ __asm__ ("subf%I4c %1,%5,%4\n\tsubfe %0,%3,%2" \
+ : "=r" (sh), "=&r" (sl) \
+ : "r" (ah), "r" (bh), "rI" (al), "r" (bl)); \
+ } while (0)
+#define count_leading_zeros(count, x) \
+ __asm__ ("cntlzw %0,%1" : "=r" (count) : "r" (x))
+#define COUNT_LEADING_ZEROS_0 32
+#if HAVE_HOST_CPU_FAMILY_powerpc
+#if __GMP_GNUC_PREREQ (4,4)
+#define umul_ppmm(w1, w0, u, v) \
+ do { \
+ UDItype __ll = (UDItype)(u) * (v); \
+ w1 = __ll >> 32; \
+ w0 = __ll; \
+ } while (0)
+#endif
+#if !defined (umul_ppmm)
+#define umul_ppmm(ph, pl, m0, m1) \
+ do { \
+ USItype __m0 = (m0), __m1 = (m1); \
+ __asm__ ("mulhwu %0,%1,%2" : "=r" (ph) : "%r" (m0), "r" (m1)); \
+ (pl) = __m0 * __m1; \
+ } while (0)
+#endif
+#define UMUL_TIME 15
+#define smul_ppmm(ph, pl, m0, m1) \
+ do { \
+ SItype __m0 = (m0), __m1 = (m1); \
+ __asm__ ("mulhw %0,%1,%2" : "=r" (ph) : "%r" (m0), "r" (m1)); \
+ (pl) = __m0 * __m1; \
+ } while (0)
+#define SMUL_TIME 14
+#define UDIV_TIME 120
+#else
+#define UMUL_TIME 8
+#define smul_ppmm(xh, xl, m0, m1) \
+ __asm__ ("mul %0,%2,%3" : "=r" (xh), "=q" (xl) : "r" (m0), "r" (m1))
+#define SMUL_TIME 4
+#define sdiv_qrnnd(q, r, nh, nl, d) \
+ __asm__ ("div %0,%2,%4" : "=r" (q), "=q" (r) : "r" (nh), "1" (nl), "r" (d))
+#define UDIV_TIME 100
+#endif
+#endif /* 32-bit POWER architecture variants. */
+
+/* We should test _IBMR2 here when we add assembly support for the system
+ vendor compilers. */
+#if HAVE_HOST_CPU_FAMILY_powerpc && W_TYPE_SIZE == 64
+#if !defined (_LONG_LONG_LIMB)
+/* _LONG_LONG_LIMB is ABI=mode32 where adde operates on 32-bit values. So
+ use adde etc only when not _LONG_LONG_LIMB. */
+#define add_ssaaaa(sh, sl, ah, al, bh, bl) \
+ 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)); \
+ else if (__builtin_constant_p (bh) && (bh) == ~(UDItype) 0) \
+ __asm__ ("add%I4c %1,%3,%4\n\taddme %0,%2" \
+ : "=r" (sh), "=&r" (sl) : "r" (ah), "%r" (al), "rI" (bl)); \
+ else \
+ __asm__ ("add%I5c %1,%4,%5\n\tadde %0,%2,%3" \
+ : "=r" (sh), "=&r" (sl) \
+ : "r" (ah), "r" (bh), "%r" (al), "rI" (bl)); \
+ } while (0)
+/* We use "*rI" for the constant operand here, since with just "I", gcc barfs.
+ This might seem strange, but gcc folds away the dead code late. */
+#define sub_ddmmss(sh, sl, ah, al, bh, bl) \
+ do { \
+ if (__builtin_constant_p (bl) && bl > -0x8000 && bl <= 0x8000) { \
+ if (__builtin_constant_p (ah) && (ah) == 0) \
+ __asm__ ("addic %1,%3,%4\n\tsubfze %0,%2" \
+ : "=r" (sh), "=&r" (sl) : "r" (bh), "rI" (al), "*rI" (-bl)); \
+ else if (__builtin_constant_p (ah) && (ah) == ~(UDItype) 0) \
+ __asm__ ("addic %1,%3,%4\n\tsubfme %0,%2" \
+ : "=r" (sh), "=&r" (sl) : "r" (bh), "rI" (al), "*rI" (-bl)); \
+ else if (__builtin_constant_p (bh) && (bh) == 0) \
+ __asm__ ("addic %1,%3,%4\n\taddme %0,%2" \
+ : "=r" (sh), "=&r" (sl) : "r" (ah), "rI" (al), "*rI" (-bl)); \
+ else if (__builtin_constant_p (bh) && (bh) == ~(UDItype) 0) \
+ __asm__ ("addic %1,%3,%4\n\taddze %0,%2" \
+ : "=r" (sh), "=&r" (sl) : "r" (ah), "rI" (al), "*rI" (-bl)); \
+ else \
+ __asm__ ("addic %1,%4,%5\n\tsubfe %0,%3,%2" \
+ : "=r" (sh), "=&r" (sl) \
+ : "r" (ah), "r" (bh), "rI" (al), "*rI" (-bl)); \
+ } else { \
+ 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)); \
+ else if (__builtin_constant_p (ah) && (ah) == ~(UDItype) 0) \
+ __asm__ ("subf%I3c %1,%4,%3\n\tsubfme %0,%2" \
+ : "=r" (sh), "=&r" (sl) : "r" (bh), "rI" (al), "r" (bl)); \
+ 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)); \
+ else if (__builtin_constant_p (bh) && (bh) == ~(UDItype) 0) \
+ __asm__ ("subf%I3c %1,%4,%3\n\taddze %0,%2" \
+ : "=r" (sh), "=&r" (sl) : "r" (ah), "rI" (al), "r" (bl)); \
+ else \
+ __asm__ ("subf%I4c %1,%5,%4\n\tsubfe %0,%3,%2" \
+ : "=r" (sh), "=&r" (sl) \
+ : "r" (ah), "r" (bh), "rI" (al), "r" (bl)); \
+ } \
+ } while (0)
+#endif /* ! _LONG_LONG_LIMB */
+#define count_leading_zeros(count, x) \
+ __asm__ ("cntlzd %0,%1" : "=r" (count) : "r" (x))
+#define COUNT_LEADING_ZEROS_0 64
+#if 0 && __GMP_GNUC_PREREQ (4,4) /* Disable, this results in libcalls! */
+#define umul_ppmm(w1, w0, u, v) \
+ do { \
+ typedef unsigned int __ll_UTItype __attribute__((mode(TI))); \
+ __ll_UTItype __ll = (__ll_UTItype)(u) * (v); \
+ w1 = __ll >> 64; \
+ w0 = __ll; \
+ } while (0)
+#endif
+#if !defined (umul_ppmm)
+#define umul_ppmm(ph, pl, m0, m1) \
+ do { \
+ UDItype __m0 = (m0), __m1 = (m1); \
+ __asm__ ("mulhdu %0,%1,%2" : "=r" (ph) : "%r" (m0), "r" (m1)); \
+ (pl) = __m0 * __m1; \
+ } while (0)
+#endif
+#define UMUL_TIME 15
+#define smul_ppmm(ph, pl, m0, m1) \
+ do { \
+ DItype __m0 = (m0), __m1 = (m1); \
+ __asm__ ("mulhd %0,%1,%2" : "=r" (ph) : "%r" (m0), "r" (m1)); \
+ (pl) = __m0 * __m1; \
+ } while (0)
+#define SMUL_TIME 14 /* ??? */
+#define UDIV_TIME 120 /* ??? */
+#endif /* 64-bit PowerPC. */
+
+#if defined (__pyr__) && W_TYPE_SIZE == 32
+#define add_ssaaaa(sh, sl, ah, al, bh, bl) \
+ __asm__ ("addw %5,%1\n\taddwc %3,%0" \
+ : "=r" (sh), "=&r" (sl) \
+ : "0" ((USItype)(ah)), "g" ((USItype)(bh)), \
+ "%1" ((USItype)(al)), "g" ((USItype)(bl)))
+#define sub_ddmmss(sh, sl, ah, al, bh, bl) \
+ __asm__ ("subw %5,%1\n\tsubwb %3,%0" \
+ : "=r" (sh), "=&r" (sl) \
+ : "0" ((USItype)(ah)), "g" ((USItype)(bh)), \
+ "1" ((USItype)(al)), "g" ((USItype)(bl)))
+/* This insn works on Pyramids with AP, XP, or MI CPUs, but not with SP. */
+#define umul_ppmm(w1, w0, u, v) \
+ ({union {UDItype __ll; \
+ struct {USItype __h, __l;} __i; \
+ } __x; \
+ __asm__ ("movw %1,%R0\n\tuemul %2,%0" \
+ : "=&r" (__x.__ll) \
+ : "g" ((USItype) (u)), "g" ((USItype)(v))); \
+ (w1) = __x.__i.__h; (w0) = __x.__i.__l;})
+#endif /* __pyr__ */
+
+#if defined (__ibm032__) /* RT/ROMP */ && W_TYPE_SIZE == 32
+#define add_ssaaaa(sh, sl, ah, al, bh, bl) \
+ __asm__ ("a %1,%5\n\tae %0,%3" \
+ : "=r" (sh), "=&r" (sl) \
+ : "0" ((USItype)(ah)), "r" ((USItype)(bh)), \
+ "%1" ((USItype)(al)), "r" ((USItype)(bl)))
+#define sub_ddmmss(sh, sl, ah, al, bh, bl) \
+ __asm__ ("s %1,%5\n\tse %0,%3" \
+ : "=r" (sh), "=&r" (sl) \
+ : "0" ((USItype)(ah)), "r" ((USItype)(bh)), \
+ "1" ((USItype)(al)), "r" ((USItype)(bl)))
+#define smul_ppmm(ph, pl, m0, m1) \
+ __asm__ ( \
+ "s r2,r2\n" \
+" mts r10,%2\n" \
+" m r2,%3\n" \
+" m r2,%3\n" \
+" m r2,%3\n" \
+" m r2,%3\n" \
+" m r2,%3\n" \
+" m r2,%3\n" \
+" m r2,%3\n" \
+" m r2,%3\n" \
+" m r2,%3\n" \
+" m r2,%3\n" \
+" m r2,%3\n" \
+" m r2,%3\n" \
+" m r2,%3\n" \
+" m r2,%3\n" \
+" m r2,%3\n" \
+" m r2,%3\n" \
+" cas %0,r2,r0\n" \
+" mfs r10,%1" \
+ : "=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) \
+ __asm__ ("clz %0,%1" \
+ : "=r" (count) : "r" ((USItype)(x) >> 16)); \
+ else \
+ { \
+ __asm__ ("clz %0,%1" \
+ : "=r" (count) : "r" ((USItype)(x))); \
+ (count) += 16; \
+ } \
+ } while (0)
+#endif /* RT/ROMP */
+
+#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
+#define add_ssaaaa(sh, sl, ah, al, bh, bl) \
+ __asm__ ("addcc %r4,%5,%1\n\taddx %r2,%3,%0" \
+ : "=r" (sh), "=&r" (sl) \
+ : "rJ" (ah), "rI" (bh),"%rJ" (al), "rI" (bl) \
+ __CLOBBER_CC)
+#define sub_ddmmss(sh, sl, ah, al, bh, bl) \
+ __asm__ ("subcc %r4,%5,%1\n\tsubx %r2,%3,%0" \
+ : "=r" (sh), "=&r" (sl) \
+ : "rJ" (ah), "rI" (bh), "rJ" (al), "rI" (bl) \
+ __CLOBBER_CC)
+/* FIXME: When gcc -mcpu=v9 is used on solaris, gcc/config/sol2-sld-64.h
+ doesn't define anything to indicate that to us, it only sets __sparcv8. */
+#if defined (__sparc_v9__) || defined (__sparcv9)
+/* Perhaps we should use floating-point operations here? */
+#if 0
+/* Triggers a bug making mpz/tests/t-gcd.c fail.
+ Perhaps we simply need explicitly zero-extend the inputs? */
+#define umul_ppmm(w1, w0, u, v) \
+ __asm__ ("mulx %2,%3,%%g1; srl %%g1,0,%1; srlx %%g1,32,%0" : \
+ "=r" (w1), "=r" (w0) : "r" (u), "r" (v) : "g1")
+#else
+/* Use v8 umul until above bug is fixed. */
+#define umul_ppmm(w1, w0, u, v) \
+ __asm__ ("umul %2,%3,%1;rd %%y,%0" : "=r" (w1), "=r" (w0) : "r" (u), "r" (v))
+#endif
+/* Use a plain v8 divide for v9. */
+#define udiv_qrnnd(q, r, n1, n0, d) \
+ do { \
+ USItype __q; \
+ __asm__ ("mov %1,%%y;nop;nop;nop;udiv %2,%3,%0" \
+ : "=r" (__q) : "r" (n1), "r" (n0), "r" (d)); \
+ (r) = (n0) - __q * (d); \
+ (q) = __q; \
+ } while (0)
+#else
+#if defined (__sparc_v8__) /* gcc normal */ \
+ || defined (__sparcv8) /* gcc solaris */ \
+ || HAVE_HOST_CPU_supersparc
+/* Don't match immediate range because, 1) it is not often useful,
+ 2) the 'I' flag thinks of the range as a 13 bit signed interval,
+ while we want to match a 13 bit interval, sign extended to 32 bits,
+ 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. */
+#define udiv_qrnnd(q, r, n1, n0, d) \
+ do { \
+ USItype __q; \
+ __asm__ ("mov %1,%%y;nop;nop;nop;udiv %2,%3,%0" \
+ : "=r" (__q) : "r" (n1), "r" (n0), "r" (d)); \
+ (r) = (n0) - __q * (d); \
+ (q) = __q; \
+ } while (0)
+#define UDIV_TIME 25
+#endif /* HAVE_HOST_CPU_supersparc */
+
+#else /* ! __sparc_v8__ */
+#if defined (__sparclite__)
+/* This has hardware multiply but not divide. It also has two additional
+ 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" \
+" tst %%g0\n" \
+" divscc %3,%4,%%g1\n" \
+" divscc %%g1,%4,%%g1\n" \
+" divscc %%g1,%4,%%g1\n" \
+" divscc %%g1,%4,%%g1\n" \
+" divscc %%g1,%4,%%g1\n" \
+" divscc %%g1,%4,%%g1\n" \
+" divscc %%g1,%4,%%g1\n" \
+" divscc %%g1,%4,%%g1\n" \
+" divscc %%g1,%4,%%g1\n" \
+" divscc %%g1,%4,%%g1\n" \
+" divscc %%g1,%4,%%g1\n" \
+" divscc %%g1,%4,%%g1\n" \
+" divscc %%g1,%4,%%g1\n" \
+" divscc %%g1,%4,%%g1\n" \
+" divscc %%g1,%4,%%g1\n" \
+" divscc %%g1,%4,%%g1\n" \
+" divscc %%g1,%4,%%g1\n" \
+" divscc %%g1,%4,%%g1\n" \
+" divscc %%g1,%4,%%g1\n" \
+" divscc %%g1,%4,%%g1\n" \
+" divscc %%g1,%4,%%g1\n" \
+" divscc %%g1,%4,%%g1\n" \
+" divscc %%g1,%4,%%g1\n" \
+" divscc %%g1,%4,%%g1\n" \
+" divscc %%g1,%4,%%g1\n" \
+" divscc %%g1,%4,%%g1\n" \
+" divscc %%g1,%4,%%g1\n" \
+" divscc %%g1,%4,%%g1\n" \
+" divscc %%g1,%4,%%g1\n" \
+" divscc %%g1,%4,%%g1\n" \
+" divscc %%g1,%4,%%g1\n" \
+" divscc %%g1,%4,%0\n" \
+" rd %%y,%1\n" \
+" bl,a 1f\n" \
+" add %1,%4,%1\n" \
+"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
+ implementations might change this. Therefore, leave COUNT_LEADING_ZEROS_0
+ undefined. */
+#endif /* __sparclite__ */
+#endif /* __sparc_v8__ */
+#endif /* __sparc_v9__ */
+/* Default to sparc v7 versions of umul_ppmm and udiv_qrnnd. */
+#ifndef umul_ppmm
+#define umul_ppmm(w1, w0, u, v) \
+ __asm__ ("! Inlined umul_ppmm\n" \
+" wr %%g0,%2,%%y ! SPARC has 0-3 delay insn after a wr\n" \
+" sra %3,31,%%g2 ! Don't move this insn\n" \
+" and %2,%%g2,%%g2 ! Don't move this insn\n" \
+" andcc %%g0,0,%%g1 ! Don't move this insn\n" \
+" mulscc %%g1,%3,%%g1\n" \
+" mulscc %%g1,%3,%%g1\n" \
+" mulscc %%g1,%3,%%g1\n" \
+" mulscc %%g1,%3,%%g1\n" \
+" mulscc %%g1,%3,%%g1\n" \
+" mulscc %%g1,%3,%%g1\n" \
+" mulscc %%g1,%3,%%g1\n" \
+" mulscc %%g1,%3,%%g1\n" \
+" mulscc %%g1,%3,%%g1\n" \
+" mulscc %%g1,%3,%%g1\n" \
+" mulscc %%g1,%3,%%g1\n" \
+" mulscc %%g1,%3,%%g1\n" \
+" mulscc %%g1,%3,%%g1\n" \
+" mulscc %%g1,%3,%%g1\n" \
+" mulscc %%g1,%3,%%g1\n" \
+" mulscc %%g1,%3,%%g1\n" \
+" mulscc %%g1,%3,%%g1\n" \
+" mulscc %%g1,%3,%%g1\n" \
+" mulscc %%g1,%3,%%g1\n" \
+" mulscc %%g1,%3,%%g1\n" \
+" mulscc %%g1,%3,%%g1\n" \
+" mulscc %%g1,%3,%%g1\n" \
+" mulscc %%g1,%3,%%g1\n" \
+" mulscc %%g1,%3,%%g1\n" \
+" mulscc %%g1,%3,%%g1\n" \
+" mulscc %%g1,%3,%%g1\n" \
+" mulscc %%g1,%3,%%g1\n" \
+" mulscc %%g1,%3,%%g1\n" \
+" mulscc %%g1,%3,%%g1\n" \
+" mulscc %%g1,%3,%%g1\n" \
+" mulscc %%g1,%3,%%g1\n" \
+" mulscc %%g1,%3,%%g1\n" \
+" mulscc %%g1,0,%%g1\n" \
+" add %%g1,%%g2,%0\n" \
+" 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
+#define udiv_qrnnd(q, r, n1, n0, d) \
+ do { UWtype __r; \
+ (q) = __MPN(udiv_qrnnd) (&__r, (n1), (n0), (d)); \
+ (r) = __r; \
+ } while (0)
+extern UWtype __MPN(udiv_qrnnd) (UWtype *, UWtype, UWtype, UWtype);
+#ifndef UDIV_TIME
+#define UDIV_TIME 140
+#endif
+#endif /* LONGLONG_STANDALONE */
+#endif /* udiv_qrnnd */
+#endif /* __sparc__ */
+
+#if defined (__sparc__) && W_TYPE_SIZE == 64
+#define add_ssaaaa(sh, sl, ah, al, bh, bl) \
+ __asm__ ( \
+ "addcc %r4,%5,%1\n" \
+ " addccc %r6,%7,%%g0\n" \
+ " addc %r2,%3,%0" \
+ : "=r" (sh), "=&r" (sl) \
+ : "rJ" (ah), "rI" (bh), "%rJ" (al), "rI" (bl), \
+ "%rJ" ((al) >> 32), "rI" ((bl) >> 32) \
+ __CLOBBER_CC)
+#define sub_ddmmss(sh, sl, ah, al, bh, bl) \
+ __asm__ ( \
+ "subcc %r4,%5,%1\n" \
+ " subccc %r6,%7,%%g0\n" \
+ " subc %r2,%3,%0" \
+ : "=r" (sh), "=&r" (sl) \
+ : "rJ" (ah), "rI" (bh), "rJ" (al), "rI" (bl), \
+ "rJ" ((al) >> 32), "rI" ((bl) >> 32) \
+ __CLOBBER_CC)
+#if __VIS__ >= 0x300
+#undef add_ssaaaa
+#define add_ssaaaa(sh, sl, ah, al, bh, bl) \
+ __asm__ ( \
+ "addcc %r4, %5, %1\n" \
+ " addxc %r2, %r3, %0" \
+ : "=r" (sh), "=&r" (sl) \
+ : "rJ" (ah), "rJ" (bh), "%rJ" (al), "rI" (bl) __CLOBBER_CC)
+#define umul_ppmm(ph, pl, m0, m1) \
+ do { \
+ UDItype __m0 = (m0), __m1 = (m1); \
+ (pl) = __m0 * __m1; \
+ __asm__ ("umulxhi\t%2, %1, %0" \
+ : "=r" (ph) \
+ : "%r" (__m0), "r" (__m1)); \
+ } while (0)
+#define count_leading_zeros(count, x) \
+ __asm__ ("lzd\t%1,%0" : "=r" (count) : "r" (x))
+#endif
+#endif
+
+#if (defined (__vax) || defined (__vax__)) && W_TYPE_SIZE == 32
+#define add_ssaaaa(sh, sl, ah, al, bh, bl) \
+ __asm__ ("addl2 %5,%1\n\tadwc %3,%0" \
+ : "=g" (sh), "=&g" (sl) \
+ : "0" ((USItype)(ah)), "g" ((USItype)(bh)), \
+ "%1" ((USItype)(al)), "g" ((USItype)(bl)))
+#define sub_ddmmss(sh, sl, ah, al, bh, bl) \
+ __asm__ ("subl2 %5,%1\n\tsbwc %3,%0" \
+ : "=g" (sh), "=&g" (sl) \
+ : "0" ((USItype)(ah)), "g" ((USItype)(bh)), \
+ "1" ((USItype)(al)), "g" ((USItype)(bl)))
+#define smul_ppmm(xh, xl, m0, m1) \
+ do { \
+ union {UDItype __ll; \
+ struct {USItype __l, __h;} __i; \
+ } __x; \
+ USItype __m0 = (m0), __m1 = (m1); \
+ __asm__ ("emul %1,%2,$0,%0" \
+ : "=g" (__x.__ll) : "g" (__m0), "g" (__m1)); \
+ (xh) = __x.__i.__h; (xl) = __x.__i.__l; \
+ } while (0)
+#define sdiv_qrnnd(q, r, n1, n0, d) \
+ do { \
+ union {DItype __ll; \
+ struct {SItype __l, __h;} __i; \
+ } __x; \
+ __x.__i.__h = n1; __x.__i.__l = n0; \
+ __asm__ ("ediv %3,%2,%0,%1" \
+ : "=g" (q), "=g" (r) : "g" (__x.__ll), "g" (d)); \
+ } while (0)
+#if 0
+/* FIXME: This instruction appears to be unimplemented on some systems (vax
+ 8800 maybe). */
+#define count_trailing_zeros(count,x) \
+ do { \
+ __asm__ ("ffs 0, 31, %1, %0" \
+ : "=g" (count) \
+ : "g" ((USItype) (x))); \
+ } while (0)
+#endif
+#endif /* vax */
+
+#if defined (__z8000__) && W_TYPE_SIZE == 16
+#define add_ssaaaa(sh, sl, ah, al, bh, bl) \
+ __asm__ ("add %H1,%H5\n\tadc %H0,%H3" \
+ : "=r" (sh), "=&r" (sl) \
+ : "0" ((unsigned int)(ah)), "r" ((unsigned int)(bh)), \
+ "%1" ((unsigned int)(al)), "rQR" ((unsigned int)(bl)))
+#define sub_ddmmss(sh, sl, ah, al, bh, bl) \
+ __asm__ ("sub %H1,%H5\n\tsbc %H0,%H3" \
+ : "=r" (sh), "=&r" (sl) \
+ : "0" ((unsigned int)(ah)), "r" ((unsigned int)(bh)), \
+ "1" ((unsigned int)(al)), "rQR" ((unsigned int)(bl)))
+#define umul_ppmm(xh, xl, m0, m1) \
+ do { \
+ union {long int __ll; \
+ struct {unsigned int __h, __l;} __i; \
+ } __x; \
+ unsigned int __m0 = (m0), __m1 = (m1); \
+ __asm__ ("mult %S0,%H3" \
+ : "=r" (__x.__i.__h), "=r" (__x.__i.__l) \
+ : "%1" (m0), "rQR" (m1)); \
+ (xh) = __x.__i.__h; (xl) = __x.__i.__l; \
+ (xh) += ((((signed int) __m0 >> 15) & __m1) \
+ + (((signed int) __m1 >> 15) & __m0)); \
+ } while (0)
+#endif /* __z8000__ */
+
+#endif /* __GNUC__ */
+
+#endif /* NO_ASM */
+
+
+/* FIXME: "sidi" here is highly doubtful, should sometimes be "diti". */
+#if !defined (umul_ppmm) && defined (__umulsidi3)
+#define umul_ppmm(ph, pl, m0, m1) \
+ { \
+ UDWtype __ll = __umulsidi3 (m0, m1); \
+ ph = (UWtype) (__ll >> W_TYPE_SIZE); \
+ pl = (UWtype) __ll; \
+ }
+#endif
+
+#if !defined (__umulsidi3)
+#define __umulsidi3(u, v) \
+ ({UWtype __hi, __lo; \
+ umul_ppmm (__hi, __lo, u, v); \
+ ((UDWtype) __hi << W_TYPE_SIZE) | __lo; })
+#endif
+
+
+/* Use mpn_umul_ppmm or mpn_udiv_qrnnd functions, if they exist. The "_r"
+ forms have "reversed" arguments, meaning the pointer is last, which
+ sometimes allows better parameter passing, in particular on 64-bit
+ hppa. */
+
+#define mpn_umul_ppmm __MPN(umul_ppmm)
+extern UWtype mpn_umul_ppmm (UWtype *, UWtype, UWtype);
+
+#if ! defined (umul_ppmm) && HAVE_NATIVE_mpn_umul_ppmm \
+ && ! defined (LONGLONG_STANDALONE)
+#define umul_ppmm(wh, wl, u, v) \
+ do { \
+ UWtype __umul_ppmm__p0; \
+ (wh) = mpn_umul_ppmm (&__umul_ppmm__p0, (UWtype) (u), (UWtype) (v));\
+ (wl) = __umul_ppmm__p0; \
+ } while (0)
+#endif
+
+#define mpn_umul_ppmm_r __MPN(umul_ppmm_r)
+extern UWtype mpn_umul_ppmm_r (UWtype, UWtype, UWtype *);
+
+#if ! defined (umul_ppmm) && HAVE_NATIVE_mpn_umul_ppmm_r \
+ && ! defined (LONGLONG_STANDALONE)
+#define umul_ppmm(wh, wl, u, v) \
+ do { \
+ UWtype __umul_p0; \
+ (wh) = mpn_umul_ppmm_r ((UWtype) (u), (UWtype) (v), &__umul_p0); \
+ (wl) = __umul_p0; \
+ } while (0)
+#endif
+
+#define mpn_udiv_qrnnd __MPN(udiv_qrnnd)
+extern UWtype mpn_udiv_qrnnd (UWtype *, UWtype, UWtype, UWtype);
+
+#if ! defined (udiv_qrnnd) && HAVE_NATIVE_mpn_udiv_qrnnd \
+ && ! defined (LONGLONG_STANDALONE)
+#define udiv_qrnnd(q, r, n1, n0, d) \
+ do { \
+ UWtype __udiv_qrnnd_r; \
+ (q) = mpn_udiv_qrnnd (&__udiv_qrnnd_r, \
+ (UWtype) (n1), (UWtype) (n0), (UWtype) d); \
+ (r) = __udiv_qrnnd_r; \
+ } while (0)
+#endif
+
+#define mpn_udiv_qrnnd_r __MPN(udiv_qrnnd_r)
+extern UWtype mpn_udiv_qrnnd_r (UWtype, UWtype, UWtype, UWtype *);
+
+#if ! defined (udiv_qrnnd) && HAVE_NATIVE_mpn_udiv_qrnnd_r \
+ && ! defined (LONGLONG_STANDALONE)
+#define udiv_qrnnd(q, r, n1, n0, d) \
+ do { \
+ UWtype __udiv_qrnnd_r; \
+ (q) = mpn_udiv_qrnnd_r ((UWtype) (n1), (UWtype) (n0), (UWtype) d, \
+ &__udiv_qrnnd_r); \
+ (r) = __udiv_qrnnd_r; \
+ } while (0)
+#endif
+
+
+/* If this machine has no inline assembler, use C macros. */
+
+#if !defined (add_ssaaaa)
+#define add_ssaaaa(sh, sl, ah, al, bh, bl) \
+ do { \
+ UWtype __x; \
+ __x = (al) + (bl); \
+ (sh) = (ah) + (bh) + (__x < (al)); \
+ (sl) = __x; \
+ } while (0)
+#endif
+
+#if !defined (sub_ddmmss)
+#define sub_ddmmss(sh, sl, ah, al, bh, bl) \
+ do { \
+ UWtype __x; \
+ __x = (al) - (bl); \
+ (sh) = (ah) - (bh) - ((al) < (bl)); \
+ (sl) = __x; \
+ } while (0)
+#endif
+
+/* If we lack umul_ppmm but have smul_ppmm, define umul_ppmm in terms of
+ smul_ppmm. */
+#if !defined (umul_ppmm) && defined (smul_ppmm)
+#define umul_ppmm(w1, w0, u, v) \
+ do { \
+ UWtype __w1; \
+ UWtype __xm0 = (u), __xm1 = (v); \
+ smul_ppmm (__w1, w0, __xm0, __xm1); \
+ (w1) = __w1 + (-(__xm0 >> (W_TYPE_SIZE - 1)) & __xm1) \
+ + (-(__xm1 >> (W_TYPE_SIZE - 1)) & __xm0); \
+ } while (0)
+#endif
+
+/* If we still don't have umul_ppmm, define it using plain C.
+
+ For reference, when this code is used for squaring (ie. u and v identical
+ expressions), gcc recognises __x1 and __x2 are the same and generates 3
+ multiplies, not 4. The subsequent additions could be optimized a bit,
+ but the only place GMP currently uses such a square is mpn_sqr_basecase,
+ and chips obliged to use this generic C umul will have plenty of worse
+ performance problems than a couple of extra instructions on the diagonal
+ of sqr_basecase. */
+
+#if !defined (umul_ppmm)
+#define umul_ppmm(w1, w0, u, v) \
+ do { \
+ UWtype __x0, __x1, __x2, __x3; \
+ UHWtype __ul, __vl, __uh, __vh; \
+ UWtype __u = (u), __v = (v); \
+ \
+ __ul = __ll_lowpart (__u); \
+ __uh = __ll_highpart (__u); \
+ __vl = __ll_lowpart (__v); \
+ __vh = __ll_highpart (__v); \
+ \
+ __x0 = (UWtype) __ul * __vl; \
+ __x1 = (UWtype) __ul * __vh; \
+ __x2 = (UWtype) __uh * __vl; \
+ __x3 = (UWtype) __uh * __vh; \
+ \
+ __x1 += __ll_highpart (__x0);/* this can't give carry */ \
+ __x1 += __x2; /* but this indeed can */ \
+ if (__x1 < __x2) /* did we get it? */ \
+ __x3 += __ll_B; /* yes, add it in the proper pos. */ \
+ \
+ (w1) = __x3 + __ll_highpart (__x1); \
+ (w0) = (__x1 << W_TYPE_SIZE/2) + __ll_lowpart (__x0); \
+ } while (0)
+#endif
+
+/* If we don't have smul_ppmm, define it using umul_ppmm (which surely will
+ exist in one form or another. */
+#if !defined (smul_ppmm)
+#define smul_ppmm(w1, w0, u, v) \
+ do { \
+ UWtype __w1; \
+ UWtype __xm0 = (u), __xm1 = (v); \
+ umul_ppmm (__w1, w0, __xm0, __xm1); \
+ (w1) = __w1 - (-(__xm0 >> (W_TYPE_SIZE - 1)) & __xm1) \
+ - (-(__xm1 >> (W_TYPE_SIZE - 1)) & __xm0); \
+ } while (0)
+#endif
+
+/* Define this unconditionally, so it can be used for debugging. */
+#define __udiv_qrnnd_c(q, r, n1, n0, d) \
+ do { \
+ UWtype __d1, __d0, __q1, __q0, __r1, __r0, __m; \
+ \
+ ASSERT ((d) != 0); \
+ ASSERT ((n1) < (d)); \
+ \
+ __d1 = __ll_highpart (d); \
+ __d0 = __ll_lowpart (d); \
+ \
+ __q1 = (n1) / __d1; \
+ __r1 = (n1) - __q1 * __d1; \
+ __m = __q1 * __d0; \
+ __r1 = __r1 * __ll_B | __ll_highpart (n0); \
+ if (__r1 < __m) \
+ { \
+ __q1--, __r1 += (d); \
+ if (__r1 >= (d)) /* i.e. we didn't get carry when adding to __r1 */\
+ if (__r1 < __m) \
+ __q1--, __r1 += (d); \
+ } \
+ __r1 -= __m; \
+ \
+ __q0 = __r1 / __d1; \
+ __r0 = __r1 - __q0 * __d1; \
+ __m = __q0 * __d0; \
+ __r0 = __r0 * __ll_B | __ll_lowpart (n0); \
+ if (__r0 < __m) \
+ { \
+ __q0--, __r0 += (d); \
+ if (__r0 >= (d)) \
+ if (__r0 < __m) \
+ __q0--, __r0 += (d); \
+ } \
+ __r0 -= __m; \
+ \
+ (q) = __q1 * __ll_B | __q0; \
+ (r) = __r0; \
+ } while (0)
+
+/* If the processor has no udiv_qrnnd but sdiv_qrnnd, go through
+ __udiv_w_sdiv (defined in libgcc or elsewhere). */
+#if !defined (udiv_qrnnd) && defined (sdiv_qrnnd)
+#define udiv_qrnnd(q, r, nh, nl, d) \
+ do { \
+ UWtype __r; \
+ (q) = __MPN(udiv_w_sdiv) (&__r, nh, nl, d); \
+ (r) = __r; \
+ } while (0)
+__GMP_DECLSPEC UWtype __MPN(udiv_w_sdiv) (UWtype *, UWtype, UWtype, UWtype);
+#endif
+
+/* If udiv_qrnnd was not defined for this processor, use __udiv_qrnnd_c. */
+#if !defined (udiv_qrnnd)
+#define UDIV_NEEDS_NORMALIZATION 1
+#define udiv_qrnnd __udiv_qrnnd_c
+#endif
+
+#if !defined (count_leading_zeros)
+#define count_leading_zeros(count, x) \
+ do { \
+ UWtype __xr = (x); \
+ UWtype __a; \
+ \
+ if (W_TYPE_SIZE == 32) \
+ { \
+ __a = __xr < ((UWtype) 1 << 2*__BITS4) \
+ ? (__xr < ((UWtype) 1 << __BITS4) ? 1 : __BITS4 + 1) \
+ : (__xr < ((UWtype) 1 << 3*__BITS4) ? 2*__BITS4 + 1 \
+ : 3*__BITS4 + 1); \
+ } \
+ else \
+ { \
+ for (__a = W_TYPE_SIZE - 8; __a > 0; __a -= 8) \
+ if (((__xr >> __a) & 0xff) != 0) \
+ break; \
+ ++__a; \
+ } \
+ \
+ (count) = W_TYPE_SIZE + 1 - __a - __clz_tab[__xr >> __a]; \
+ } while (0)
+/* This version gives a well-defined value for zero. */
+#define COUNT_LEADING_ZEROS_0 (W_TYPE_SIZE - 1)
+#define COUNT_LEADING_ZEROS_NEED_CLZ_TAB
+#define COUNT_LEADING_ZEROS_SLOW
+#endif
+
+/* clz_tab needed by mpn/x86/pentium/mod_1.asm in a fat binary */
+#if HAVE_HOST_CPU_FAMILY_x86 && WANT_FAT_BINARY
+#define COUNT_LEADING_ZEROS_NEED_CLZ_TAB
+#endif
+
+#ifdef COUNT_LEADING_ZEROS_NEED_CLZ_TAB
+extern const unsigned char __GMP_DECLSPEC __clz_tab[129];
+#endif
+
+#if !defined (count_trailing_zeros)
+#if !defined (COUNT_LEADING_ZEROS_SLOW)
+/* Define count_trailing_zeros using an asm count_leading_zeros. */
+#define count_trailing_zeros(count, x) \
+ do { \
+ UWtype __ctz_x = (x); \
+ UWtype __ctz_c; \
+ ASSERT (__ctz_x != 0); \
+ count_leading_zeros (__ctz_c, __ctz_x & -__ctz_x); \
+ (count) = W_TYPE_SIZE - 1 - __ctz_c; \
+ } while (0)
+#else
+/* Define count_trailing_zeros in plain C, assuming small counts are common.
+ We use clz_tab without ado, since the C count_leading_zeros above will have
+ pulled it in. */
+#define count_trailing_zeros(count, x) \
+ do { \
+ UWtype __ctz_x = (x); \
+ int __ctz_c; \
+ \
+ if (LIKELY ((__ctz_x & 0xff) != 0)) \
+ (count) = __clz_tab[__ctz_x & -__ctz_x] - 2; \
+ else \
+ { \
+ for (__ctz_c = 8 - 2; __ctz_c < W_TYPE_SIZE - 2; __ctz_c += 8) \
+ { \
+ __ctz_x >>= 8; \
+ if (LIKELY ((__ctz_x & 0xff) != 0)) \
+ break; \
+ } \
+ \
+ (count) = __ctz_c + __clz_tab[__ctz_x & -__ctz_x]; \
+ } \
+ } while (0)
+#endif
+#endif
+
+#ifndef UDIV_NEEDS_NORMALIZATION
+#define UDIV_NEEDS_NORMALIZATION 0
+#endif
+
+/* Whether udiv_qrnnd is actually implemented with udiv_qrnnd_preinv, and
+ that hence the latter should always be used. */
+#ifndef UDIV_PREINV_ALWAYS
+#define UDIV_PREINV_ALWAYS 0
+#endif
+
+/* Give defaults for UMUL_TIME and UDIV_TIME. */
+#ifndef UMUL_TIME
+#define UMUL_TIME 1
+#endif
+
+#ifndef UDIV_TIME
+#define UDIV_TIME UMUL_TIME
+#endif
diff --git a/Build/source/libs/gmp/gmp-6.0.0/memory.c b/Build/source/libs/gmp/gmp-6.0.0/memory.c
new file mode 100644
index 00000000000..4475f37de37
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/memory.c
@@ -0,0 +1,146 @@
+/* Memory allocation routines.
+
+Copyright 1991, 1993, 1994, 2000-2002, 2012 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 <stdlib.h> /* for malloc, realloc, free */
+
+#include "gmp.h"
+#include "gmp-impl.h"
+
+
+void * (*__gmp_allocate_func) (size_t) = __gmp_default_allocate;
+void * (*__gmp_reallocate_func) (void *, size_t, size_t) = __gmp_default_reallocate;
+void (*__gmp_free_func) (void *, size_t) = __gmp_default_free;
+
+
+/* Default allocation functions. In case of failure to allocate/reallocate
+ an error message is written to stderr and the program aborts. */
+
+void *
+__gmp_default_allocate (size_t size)
+{
+ void *ret;
+#ifdef DEBUG
+ size_t req_size = size;
+ size += 2 * GMP_LIMB_BYTES;
+#endif
+ ret = malloc (size);
+ if (ret == 0)
+ {
+ fprintf (stderr, "GNU MP: Cannot allocate memory (size=%lu)\n", (long) size);
+ abort ();
+ }
+
+#ifdef DEBUG
+ {
+ mp_ptr p = ret;
+ p++;
+ p[-1] = (0xdeadbeef << 31) + 0xdeafdeed;
+ if (req_size % GMP_LIMB_BYTES == 0)
+ p[req_size / GMP_LIMB_BYTES] = ~((0xdeadbeef << 31) + 0xdeafdeed);
+ ret = p;
+ }
+#endif
+ return ret;
+}
+
+void *
+__gmp_default_reallocate (void *oldptr, size_t old_size, size_t new_size)
+{
+ void *ret;
+
+#ifdef DEBUG
+ size_t req_size = new_size;
+
+ if (old_size != 0)
+ {
+ mp_ptr p = oldptr;
+ if (p[-1] != (0xdeadbeef << 31) + 0xdeafdeed)
+ {
+ fprintf (stderr, "gmp: (realloc) data clobbered before allocation block\n");
+ abort ();
+ }
+ if (old_size % GMP_LIMB_BYTES == 0)
+ if (p[old_size / GMP_LIMB_BYTES] != ~((0xdeadbeef << 31) + 0xdeafdeed))
+ {
+ fprintf (stderr, "gmp: (realloc) data clobbered after allocation block\n");
+ abort ();
+ }
+ oldptr = p - 1;
+ }
+
+ new_size += 2 * GMP_LIMB_BYTES;
+#endif
+
+ ret = realloc (oldptr, new_size);
+ if (ret == 0)
+ {
+ fprintf (stderr, "GNU MP: Cannot reallocate memory (old_size=%lu new_size=%lu)\n", (long) old_size, (long) new_size);
+ abort ();
+ }
+
+#ifdef DEBUG
+ {
+ mp_ptr p = ret;
+ p++;
+ p[-1] = (0xdeadbeef << 31) + 0xdeafdeed;
+ if (req_size % GMP_LIMB_BYTES == 0)
+ p[req_size / GMP_LIMB_BYTES] = ~((0xdeadbeef << 31) + 0xdeafdeed);
+ ret = p;
+ }
+#endif
+ return ret;
+}
+
+void
+__gmp_default_free (void *blk_ptr, size_t blk_size)
+{
+#ifdef DEBUG
+ {
+ mp_ptr p = blk_ptr;
+ if (blk_size != 0)
+ {
+ if (p[-1] != (0xdeadbeef << 31) + 0xdeafdeed)
+ {
+ fprintf (stderr, "gmp: (free) data clobbered before allocation block\n");
+ abort ();
+ }
+ if (blk_size % GMP_LIMB_BYTES == 0)
+ if (p[blk_size / GMP_LIMB_BYTES] != ~((0xdeadbeef << 31) + 0xdeafdeed))
+ {
+ fprintf (stderr, "gmp: (free) data clobbered after allocation block\n");
+ abort ();
+ }
+ }
+ blk_ptr = p - 1;
+ }
+#endif
+ free (blk_ptr);
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mini-gmp/README b/Build/source/libs/gmp/gmp-6.0.0/mini-gmp/README
new file mode 100644
index 00000000000..f291489ea3e
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mini-gmp/README
@@ -0,0 +1,77 @@
+Copyright 2011-2013 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/.
+
+
+This is "mini-gmp", a small implementation of a subset of GMP's mpn
+and mpz 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
+numbers very efficiently. Those applications can include a copy of
+mini-gmp to get a GMP-compatible interface with small footprint. One
+can also arrange for optional linking with the real GMP library, using
+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
+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
+ mp_set_memory_functions does not get the correct size of the
+ 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.
+
+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
+bits. No asymptotically fast algorithms are included in mini-gmp, so
+it will be many orders of magnitude slower than GMP for very large
+numbers.
+
+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.
+
+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.
+
+The current version was put together by Niels Möller
+<nisse@lysator.liu.se>, with a fair amount of copy-and-paste from the
+GMP sources.
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mini-gmp/mini-gmp.c b/Build/source/libs/gmp/gmp-6.0.0/mini-gmp/mini-gmp.c
new file mode 100644
index 00000000000..b9186951cbb
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mini-gmp/mini-gmp.c
@@ -0,0 +1,4386 @@
+/* mini-gmp, a minimalistic implementation of a GNU GMP subset.
+
+ Contributed to the GNU project by Niels Möller
+
+Copyright 1991-1997, 1999-2014 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/. */
+
+/* NOTE: All functions in this file which are not declared in
+ mini-gmp.h are internal, and are not intended to be compatible
+ neither with GMP nor with future versions of mini-gmp. */
+
+/* Much of the material copied from GMP files, including: gmp-impl.h,
+ longlong.h, mpn/generic/add_n.c, mpn/generic/addmul_1.c,
+ mpn/generic/lshift.c, mpn/generic/mul_1.c,
+ mpn/generic/mul_basecase.c, mpn/generic/rshift.c,
+ mpn/generic/sbpi1_div_qr.c, mpn/generic/sub_n.c,
+ mpn/generic/submul_1.c. */
+
+#include <assert.h>
+#include <ctype.h>
+#include <limits.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "mini-gmp.h"
+
+
+/* Macros */
+#define GMP_LIMB_BITS (sizeof(mp_limb_t) * CHAR_BIT)
+
+#define GMP_LIMB_MAX (~ (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))
+#define GMP_LLIMB_MASK (GMP_HLIMB_BIT - 1)
+
+#define GMP_ULONG_BITS (sizeof(unsigned long) * CHAR_BIT)
+#define GMP_ULONG_HIGHBIT ((unsigned long) 1 << (GMP_ULONG_BITS - 1))
+
+#define GMP_ABS(x) ((x) >= 0 ? (x) : -(x))
+#define GMP_NEG_CAST(T,x) (-((T)((x) + 1) - 1))
+
+#define GMP_MIN(a, b) ((a) < (b) ? (a) : (b))
+#define GMP_MAX(a, b) ((a) > (b) ? (a) : (b))
+
+#define gmp_assert_nocarry(x) do { \
+ mp_limb_t __cy = x; \
+ assert (__cy == 0); \
+ } while (0)
+
+#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; \
+ for (; (__clz_x & GMP_LIMB_HIGHBIT) == 0; __clz_c++) \
+ __clz_x <<= 1; \
+ (count) = __clz_c; \
+ } while (0)
+
+#define gmp_ctz(count, x) do { \
+ mp_limb_t __ctz_x = (x); \
+ unsigned __ctz_c = 0; \
+ gmp_clz (__ctz_c, __ctz_x & - __ctz_x); \
+ (count) = GMP_LIMB_BITS - 1 - __ctz_c; \
+ } while (0)
+
+#define gmp_add_ssaaaa(sh, sl, ah, al, bh, bl) \
+ do { \
+ mp_limb_t __x; \
+ __x = (al) + (bl); \
+ (sh) = (ah) + (bh) + (__x < (al)); \
+ (sl) = __x; \
+ } while (0)
+
+#define gmp_sub_ddmmss(sh, sl, ah, al, bh, bl) \
+ do { \
+ mp_limb_t __x; \
+ __x = (al) - (bl); \
+ (sh) = (ah) - (bh) - ((al) < (bl)); \
+ (sl) = __x; \
+ } while (0)
+
+#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); \
+ \
+ __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; \
+ \
+ __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); \
+ } while (0)
+
+#define gmp_udiv_qrnnd_preinv(q, r, nh, nl, d, di) \
+ do { \
+ mp_limb_t _qh, _ql, _r, _mask; \
+ gmp_umul_ppmm (_qh, _ql, (nh), (di)); \
+ gmp_add_ssaaaa (_qh, _ql, _qh, _ql, (nh) + 1, (nl)); \
+ _r = (nl) - _qh * (d); \
+ _mask = -(mp_limb_t) (_r > _ql); /* both > and >= are OK */ \
+ _qh += _mask; \
+ _r += _mask & (d); \
+ if (_r >= (d)) \
+ { \
+ _r -= (d); \
+ _qh++; \
+ } \
+ \
+ (r) = _r; \
+ (q) = _qh; \
+ } while (0)
+
+#define gmp_udiv_qr_3by2(q, r1, r0, n2, n1, n0, d1, d0, dinv) \
+ do { \
+ mp_limb_t _q0, _t1, _t0, _mask; \
+ gmp_umul_ppmm ((q), _q0, (n2), (dinv)); \
+ gmp_add_ssaaaa ((q), _q0, (q), _q0, (n2), (n1)); \
+ \
+ /* Compute the two most significant limbs of n - q'd */ \
+ (r1) = (n1) - (d1) * (q); \
+ gmp_sub_ddmmss ((r1), (r0), (r1), (n0), (d1), (d0)); \
+ gmp_umul_ppmm (_t1, _t0, (d0), (q)); \
+ gmp_sub_ddmmss ((r1), (r0), (r1), (r0), _t1, _t0); \
+ (q)++; \
+ \
+ /* Conditionally adjust q and the remainders */ \
+ _mask = - (mp_limb_t) ((r1) >= _q0); \
+ (q) += _mask; \
+ gmp_add_ssaaaa ((r1), (r0), (r1), (r0), _mask & (d1), _mask & (d0)); \
+ if ((r1) >= (d1)) \
+ { \
+ if ((r1) > (d1) || (r0) >= (d0)) \
+ { \
+ (q)++; \
+ gmp_sub_ddmmss ((r1), (r0), (r1), (r0), (d1), (d0)); \
+ } \
+ } \
+ } while (0)
+
+/* Swap macros. */
+#define MP_LIMB_T_SWAP(x, y) \
+ do { \
+ mp_limb_t __mp_limb_t_swap__tmp = (x); \
+ (x) = (y); \
+ (y) = __mp_limb_t_swap__tmp; \
+ } while (0)
+#define MP_SIZE_T_SWAP(x, y) \
+ do { \
+ mp_size_t __mp_size_t_swap__tmp = (x); \
+ (x) = (y); \
+ (y) = __mp_size_t_swap__tmp; \
+ } while (0)
+#define MP_BITCNT_T_SWAP(x,y) \
+ do { \
+ mp_bitcnt_t __mp_bitcnt_t_swap__tmp = (x); \
+ (x) = (y); \
+ (y) = __mp_bitcnt_t_swap__tmp; \
+ } while (0)
+#define MP_PTR_SWAP(x, y) \
+ do { \
+ mp_ptr __mp_ptr_swap__tmp = (x); \
+ (x) = (y); \
+ (y) = __mp_ptr_swap__tmp; \
+ } while (0)
+#define MP_SRCPTR_SWAP(x, y) \
+ do { \
+ mp_srcptr __mp_srcptr_swap__tmp = (x); \
+ (x) = (y); \
+ (y) = __mp_srcptr_swap__tmp; \
+ } while (0)
+
+#define MPN_PTR_SWAP(xp,xs, yp,ys) \
+ do { \
+ MP_PTR_SWAP (xp, yp); \
+ MP_SIZE_T_SWAP (xs, ys); \
+ } while(0)
+#define MPN_SRCPTR_SWAP(xp,xs, yp,ys) \
+ do { \
+ MP_SRCPTR_SWAP (xp, yp); \
+ MP_SIZE_T_SWAP (xs, ys); \
+ } while(0)
+
+#define MPZ_PTR_SWAP(x, y) \
+ do { \
+ mpz_ptr __mpz_ptr_swap__tmp = (x); \
+ (x) = (y); \
+ (y) = __mpz_ptr_swap__tmp; \
+ } while (0)
+#define MPZ_SRCPTR_SWAP(x, y) \
+ do { \
+ mpz_srcptr __mpz_srcptr_swap__tmp = (x); \
+ (x) = (y); \
+ (y) = __mpz_srcptr_swap__tmp; \
+ } while (0)
+
+const int mp_bits_per_limb = GMP_LIMB_BITS;
+
+
+/* Memory allocation and other helper functions. */
+static void
+gmp_die (const char *msg)
+{
+ fprintf (stderr, "%s\n", msg);
+ abort();
+}
+
+static void *
+gmp_default_alloc (size_t size)
+{
+ void *p;
+
+ assert (size > 0);
+
+ p = malloc (size);
+ if (!p)
+ gmp_die("gmp_default_alloc: Virtual memory exhausted.");
+
+ return p;
+}
+
+static void *
+gmp_default_realloc (void *old, size_t old_size, size_t new_size)
+{
+ mp_ptr p;
+
+ p = realloc (old, new_size);
+
+ if (!p)
+ gmp_die("gmp_default_realoc: Virtual memory exhausted.");
+
+ return p;
+}
+
+static void
+gmp_default_free (void *p, size_t size)
+{
+ free (p);
+}
+
+static void * (*gmp_allocate_func) (size_t) = gmp_default_alloc;
+static void * (*gmp_reallocate_func) (void *, size_t, size_t) = gmp_default_realloc;
+static void (*gmp_free_func) (void *, size_t) = gmp_default_free;
+
+void
+mp_get_memory_functions (void *(**alloc_func) (size_t),
+ void *(**realloc_func) (void *, size_t, size_t),
+ void (**free_func) (void *, size_t))
+{
+ if (alloc_func)
+ *alloc_func = gmp_allocate_func;
+
+ if (realloc_func)
+ *realloc_func = gmp_reallocate_func;
+
+ if (free_func)
+ *free_func = gmp_free_func;
+}
+
+void
+mp_set_memory_functions (void *(*alloc_func) (size_t),
+ void *(*realloc_func) (void *, size_t, size_t),
+ void (*free_func) (void *, size_t))
+{
+ if (!alloc_func)
+ alloc_func = gmp_default_alloc;
+ if (!realloc_func)
+ realloc_func = gmp_default_realloc;
+ if (!free_func)
+ free_func = gmp_default_free;
+
+ gmp_allocate_func = alloc_func;
+ gmp_reallocate_func = realloc_func;
+ gmp_free_func = free_func;
+}
+
+#define gmp_xalloc(size) ((*gmp_allocate_func)((size)))
+#define gmp_free(p) ((*gmp_free_func) ((p), 0))
+
+static mp_ptr
+gmp_xalloc_limbs (mp_size_t size)
+{
+ return gmp_xalloc (size * sizeof (mp_limb_t));
+}
+
+static mp_ptr
+gmp_xrealloc_limbs (mp_ptr old, mp_size_t size)
+{
+ assert (size > 0);
+ return (*gmp_reallocate_func) (old, 0, size * sizeof (mp_limb_t));
+}
+
+
+/* MPN interface */
+
+void
+mpn_copyi (mp_ptr d, mp_srcptr s, mp_size_t n)
+{
+ mp_size_t i;
+ for (i = 0; i < n; i++)
+ d[i] = s[i];
+}
+
+void
+mpn_copyd (mp_ptr d, mp_srcptr s, mp_size_t n)
+{
+ while (n-- > 0)
+ d[n] = s[n];
+}
+
+int
+mpn_cmp (mp_srcptr ap, mp_srcptr bp, mp_size_t n)
+{
+ while (--n >= 0)
+ {
+ if (ap[n] != bp[n])
+ return ap[n] > bp[n] ? 1 : -1;
+ }
+ return 0;
+}
+
+static int
+mpn_cmp4 (mp_srcptr ap, mp_size_t an, mp_srcptr bp, mp_size_t bn)
+{
+ if (an != bn)
+ return an < bn ? -1 : 1;
+ else
+ return mpn_cmp (ap, bp, an);
+}
+
+static mp_size_t
+mpn_normalized_size (mp_srcptr xp, mp_size_t n)
+{
+ for (; n > 0 && xp[n-1] == 0; n--)
+ ;
+ return n;
+}
+
+#define mpn_zero_p(xp, n) (mpn_normalized_size ((xp), (n)) == 0)
+
+void
+mpn_zero (mp_ptr rp, mp_size_t n)
+{
+ mp_size_t i;
+
+ for (i = 0; i < n; i++)
+ rp[i] = 0;
+}
+
+mp_limb_t
+mpn_add_1 (mp_ptr rp, mp_srcptr ap, mp_size_t n, mp_limb_t b)
+{
+ mp_size_t i;
+
+ assert (n > 0);
+ i = 0;
+ do
+ {
+ mp_limb_t r = ap[i] + b;
+ /* Carry out */
+ b = (r < b);
+ rp[i] = r;
+ }
+ while (++i < n);
+
+ return b;
+}
+
+mp_limb_t
+mpn_add_n (mp_ptr rp, mp_srcptr ap, mp_srcptr bp, mp_size_t n)
+{
+ mp_size_t i;
+ mp_limb_t cy;
+
+ for (i = 0, cy = 0; i < n; i++)
+ {
+ mp_limb_t a, b, r;
+ a = ap[i]; b = bp[i];
+ r = a + cy;
+ cy = (r < cy);
+ r += b;
+ cy += (r < b);
+ rp[i] = r;
+ }
+ return cy;
+}
+
+mp_limb_t
+mpn_add (mp_ptr rp, mp_srcptr ap, mp_size_t an, mp_srcptr bp, mp_size_t bn)
+{
+ mp_limb_t cy;
+
+ assert (an >= bn);
+
+ cy = mpn_add_n (rp, ap, bp, bn);
+ if (an > bn)
+ cy = mpn_add_1 (rp + bn, ap + bn, an - bn, cy);
+ return cy;
+}
+
+mp_limb_t
+mpn_sub_1 (mp_ptr rp, mp_srcptr ap, mp_size_t n, mp_limb_t b)
+{
+ mp_size_t i;
+
+ assert (n > 0);
+
+ i = 0;
+ do
+ {
+ mp_limb_t a = ap[i];
+ /* Carry out */
+ mp_limb_t cy = a < b;;
+ rp[i] = a - b;
+ b = cy;
+ }
+ while (++i < n);
+
+ return b;
+}
+
+mp_limb_t
+mpn_sub_n (mp_ptr rp, mp_srcptr ap, mp_srcptr bp, mp_size_t n)
+{
+ mp_size_t i;
+ mp_limb_t cy;
+
+ for (i = 0, cy = 0; i < n; i++)
+ {
+ mp_limb_t a, b;
+ a = ap[i]; b = bp[i];
+ b += cy;
+ cy = (b < cy);
+ cy += (a < b);
+ rp[i] = a - b;
+ }
+ return cy;
+}
+
+mp_limb_t
+mpn_sub (mp_ptr rp, mp_srcptr ap, mp_size_t an, mp_srcptr bp, mp_size_t bn)
+{
+ mp_limb_t cy;
+
+ assert (an >= bn);
+
+ cy = mpn_sub_n (rp, ap, bp, bn);
+ if (an > bn)
+ cy = mpn_sub_1 (rp + bn, ap + bn, an - bn, cy);
+ return cy;
+}
+
+mp_limb_t
+mpn_mul_1 (mp_ptr rp, mp_srcptr up, mp_size_t n, mp_limb_t vl)
+{
+ mp_limb_t ul, cl, hpl, lpl;
+
+ assert (n >= 1);
+
+ cl = 0;
+ do
+ {
+ ul = *up++;
+ gmp_umul_ppmm (hpl, lpl, ul, vl);
+
+ lpl += cl;
+ cl = (lpl < cl) + hpl;
+
+ *rp++ = lpl;
+ }
+ while (--n != 0);
+
+ return cl;
+}
+
+mp_limb_t
+mpn_addmul_1 (mp_ptr rp, mp_srcptr up, mp_size_t n, mp_limb_t vl)
+{
+ mp_limb_t ul, cl, hpl, lpl, rl;
+
+ assert (n >= 1);
+
+ cl = 0;
+ do
+ {
+ ul = *up++;
+ gmp_umul_ppmm (hpl, lpl, ul, vl);
+
+ lpl += cl;
+ cl = (lpl < cl) + hpl;
+
+ rl = *rp;
+ lpl = rl + lpl;
+ cl += lpl < rl;
+ *rp++ = lpl;
+ }
+ while (--n != 0);
+
+ return cl;
+}
+
+mp_limb_t
+mpn_submul_1 (mp_ptr rp, mp_srcptr up, mp_size_t n, mp_limb_t vl)
+{
+ mp_limb_t ul, cl, hpl, lpl, rl;
+
+ assert (n >= 1);
+
+ cl = 0;
+ do
+ {
+ ul = *up++;
+ gmp_umul_ppmm (hpl, lpl, ul, vl);
+
+ lpl += cl;
+ cl = (lpl < cl) + hpl;
+
+ rl = *rp;
+ lpl = rl - lpl;
+ cl += lpl > rl;
+ *rp++ = lpl;
+ }
+ while (--n != 0);
+
+ return cl;
+}
+
+mp_limb_t
+mpn_mul (mp_ptr rp, mp_srcptr up, mp_size_t un, mp_srcptr vp, mp_size_t vn)
+{
+ assert (un >= vn);
+ assert (vn >= 1);
+
+ /* 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
+ way. */
+
+ rp[un] = mpn_mul_1 (rp, up, un, vp[0]);
+ rp += 1, vp += 1, vn -= 1;
+
+ /* Now accumulate the product of up[] and the next higher limb from
+ vp[]. */
+
+ while (vn >= 1)
+ {
+ rp[un] = mpn_addmul_1 (rp, up, un, vp[0]);
+ rp += 1, vp += 1, vn -= 1;
+ }
+ return rp[un - 1];
+}
+
+void
+mpn_mul_n (mp_ptr rp, mp_srcptr ap, mp_srcptr bp, mp_size_t n)
+{
+ mpn_mul (rp, ap, n, bp, n);
+}
+
+void
+mpn_sqr (mp_ptr rp, mp_srcptr ap, mp_size_t n)
+{
+ mpn_mul (rp, ap, n, ap, n);
+}
+
+mp_limb_t
+mpn_lshift (mp_ptr rp, mp_srcptr up, mp_size_t n, unsigned int cnt)
+{
+ mp_limb_t high_limb, low_limb;
+ unsigned int tnc;
+ mp_size_t i;
+ mp_limb_t retval;
+
+ assert (n >= 1);
+ assert (cnt >= 1);
+ assert (cnt < GMP_LIMB_BITS);
+
+ up += n;
+ rp += n;
+
+ tnc = GMP_LIMB_BITS - cnt;
+ low_limb = *--up;
+ retval = low_limb >> tnc;
+ high_limb = (low_limb << cnt);
+
+ for (i = n; --i != 0;)
+ {
+ low_limb = *--up;
+ *--rp = high_limb | (low_limb >> tnc);
+ high_limb = (low_limb << cnt);
+ }
+ *--rp = high_limb;
+
+ return retval;
+}
+
+mp_limb_t
+mpn_rshift (mp_ptr rp, mp_srcptr up, mp_size_t n, unsigned int cnt)
+{
+ mp_limb_t high_limb, low_limb;
+ unsigned int tnc;
+ mp_size_t i;
+ mp_limb_t retval;
+
+ assert (n >= 1);
+ assert (cnt >= 1);
+ assert (cnt < GMP_LIMB_BITS);
+
+ tnc = GMP_LIMB_BITS - cnt;
+ high_limb = *up++;
+ retval = (high_limb << tnc);
+ low_limb = high_limb >> cnt;
+
+ for (i = n; --i != 0;)
+ {
+ high_limb = *up++;
+ *rp++ = low_limb | (high_limb << tnc);
+ low_limb = high_limb >> cnt;
+ }
+ *rp = low_limb;
+
+ return retval;
+}
+
+static mp_bitcnt_t
+mpn_common_scan (mp_limb_t limb, mp_size_t i, mp_srcptr up, mp_size_t un,
+ mp_limb_t ux)
+{
+ unsigned cnt;
+
+ assert (ux == 0 || ux == GMP_LIMB_MAX);
+ assert (0 <= i && i <= un );
+
+ while (limb == 0)
+ {
+ i++;
+ if (i == un)
+ return (ux == 0 ? ~(mp_bitcnt_t) 0 : un * GMP_LIMB_BITS);
+ limb = ux ^ up[i];
+ }
+ gmp_ctz (cnt, limb);
+ return (mp_bitcnt_t) i * GMP_LIMB_BITS + cnt;
+}
+
+mp_bitcnt_t
+mpn_scan1 (mp_srcptr ptr, mp_bitcnt_t bit)
+{
+ mp_size_t i;
+ i = bit / GMP_LIMB_BITS;
+
+ return mpn_common_scan ( ptr[i] & (GMP_LIMB_MAX << (bit % GMP_LIMB_BITS)),
+ i, ptr, i, 0);
+}
+
+mp_bitcnt_t
+mpn_scan0 (mp_srcptr ptr, mp_bitcnt_t bit)
+{
+ mp_size_t i;
+ i = bit / GMP_LIMB_BITS;
+
+ return mpn_common_scan (~ptr[i] & (GMP_LIMB_MAX << (bit % GMP_LIMB_BITS)),
+ i, ptr, i, GMP_LIMB_MAX);
+}
+
+
+/* MPN division interface. */
+mp_limb_t
+mpn_invert_3by2 (mp_limb_t u1, mp_limb_t u0)
+{
+ mp_limb_t r, p, m;
+ unsigned ul, uh;
+ unsigned ql, qh;
+
+ /* First, do a 2/1 inverse. */
+ /* The inverse m is defined as floor( (B^2 - 1 - u1)/u1 ), so that 0 <
+ * B^2 - (B + m) u1 <= u1 */
+ assert (u1 >= GMP_LIMB_HIGHBIT);
+
+ ul = u1 & GMP_LLIMB_MASK;
+ uh = u1 >> (GMP_LIMB_BITS / 2);
+
+ qh = ~u1 / uh;
+ 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;
+
+ /* Do a 3/2 division (with half limb size) */
+ p = (r >> (GMP_LIMB_BITS / 2)) * qh + r;
+ ql = (p >> (GMP_LIMB_BITS / 2)) + 1;
+
+ /* By the 3/2 method, 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 (u0 > 0)
+ {
+ mp_limb_t th, tl;
+ r = ~r;
+ r += u0;
+ if (r < u0)
+ {
+ m--;
+ if (r >= u1)
+ {
+ m--;
+ r -= u1;
+ }
+ r -= u1;
+ }
+ gmp_umul_ppmm (th, tl, u0, m);
+ r += th;
+ if (r < th)
+ {
+ m--;
+ m -= ((r > u1) | ((r == u1) & (tl > u0)));
+ }
+ }
+
+ return m;
+}
+
+struct gmp_div_inverse
+{
+ /* Normalization shift count. */
+ unsigned shift;
+ /* Normalized divisor (d0 unused for mpn_div_qr_1) */
+ mp_limb_t d1, d0;
+ /* Inverse, for 2/1 or 3/2. */
+ mp_limb_t di;
+};
+
+static void
+mpn_div_qr_1_invert (struct gmp_div_inverse *inv, mp_limb_t d)
+{
+ unsigned shift;
+
+ assert (d > 0);
+ gmp_clz (shift, d);
+ inv->shift = shift;
+ inv->d1 = d << shift;
+ inv->di = mpn_invert_limb (inv->d1);
+}
+
+static void
+mpn_div_qr_2_invert (struct gmp_div_inverse *inv,
+ mp_limb_t d1, mp_limb_t d0)
+{
+ unsigned shift;
+
+ assert (d1 > 0);
+ gmp_clz (shift, d1);
+ inv->shift = shift;
+ if (shift > 0)
+ {
+ d1 = (d1 << shift) | (d0 >> (GMP_LIMB_BITS - shift));
+ d0 <<= shift;
+ }
+ inv->d1 = d1;
+ inv->d0 = d0;
+ inv->di = mpn_invert_3by2 (d1, d0);
+}
+
+static void
+mpn_div_qr_invert (struct gmp_div_inverse *inv,
+ mp_srcptr dp, mp_size_t dn)
+{
+ assert (dn > 0);
+
+ if (dn == 1)
+ mpn_div_qr_1_invert (inv, dp[0]);
+ else if (dn == 2)
+ mpn_div_qr_2_invert (inv, dp[1], dp[0]);
+ else
+ {
+ unsigned shift;
+ mp_limb_t d1, d0;
+
+ d1 = dp[dn-1];
+ d0 = dp[dn-2];
+ assert (d1 > 0);
+ gmp_clz (shift, d1);
+ inv->shift = shift;
+ if (shift > 0)
+ {
+ d1 = (d1 << shift) | (d0 >> (GMP_LIMB_BITS - shift));
+ d0 = (d0 << shift) | (dp[dn-3] >> (GMP_LIMB_BITS - shift));
+ }
+ inv->d1 = d1;
+ inv->d0 = d0;
+ inv->di = mpn_invert_3by2 (d1, d0);
+ }
+}
+
+/* Not matching current public gmp interface, rather corresponding to
+ the sbpi1_div_* functions. */
+static mp_limb_t
+mpn_div_qr_1_preinv (mp_ptr qp, mp_srcptr np, mp_size_t nn,
+ const struct gmp_div_inverse *inv)
+{
+ mp_limb_t d, di;
+ mp_limb_t r;
+ mp_ptr tp = NULL;
+
+ if (inv->shift > 0)
+ {
+ tp = gmp_xalloc_limbs (nn);
+ r = mpn_lshift (tp, np, nn, inv->shift);
+ np = tp;
+ }
+ else
+ r = 0;
+
+ d = inv->d1;
+ di = inv->di;
+ while (nn-- > 0)
+ {
+ mp_limb_t q;
+
+ gmp_udiv_qrnnd_preinv (q, r, r, np[nn], d, di);
+ if (qp)
+ qp[nn] = q;
+ }
+ if (inv->shift > 0)
+ 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,
+ 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;
+ d1 = inv->d1;
+ d0 = inv->d0;
+ di = inv->di;
+
+ if (shift > 0)
+ {
+ tp = gmp_xalloc_limbs (nn);
+ r1 = mpn_lshift (tp, np, nn, shift);
+ np = tp;
+ }
+ else
+ r1 = 0;
+
+ r0 = np[nn - 1];
+
+ i = nn - 2;
+ do
+ {
+ mp_limb_t n0, q;
+ n0 = np[i];
+ gmp_udiv_qr_3by2 (q, r1, r0, r1, r0, n0, d1, d0, di);
+
+ if (qp)
+ qp[i] = q;
+ }
+ while (--i >= 0);
+
+ if (shift > 0)
+ {
+ assert ((r0 << (GMP_LIMB_BITS - shift)) == 0);
+ r0 = (r0 >> shift) | (r1 << (GMP_LIMB_BITS - shift));
+ r1 >>= shift;
+
+ gmp_free (tp);
+ }
+
+ rp[1] = r1;
+ rp[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,
+ mp_limb_t dinv)
+{
+ mp_size_t i;
+
+ mp_limb_t d1, d0;
+ mp_limb_t cy, cy1;
+ mp_limb_t q;
+
+ assert (dn > 2);
+ assert (nn >= dn);
+
+ d1 = dp[dn - 1];
+ d0 = dp[dn - 2];
+
+ assert ((d1 & GMP_LIMB_HIGHBIT) != 0);
+ /* Iteration variable is the index of the q limb.
+ *
+ * We divide <n1, np[dn-1+i], np[dn-2+i], np[dn-3+i],..., np[i]>
+ * by <d1, d0, dp[dn-3], ..., dp[0] >
+ */
+
+ i = nn - dn;
+ do
+ {
+ mp_limb_t n0 = np[dn-1+i];
+
+ if (n1 == d1 && n0 == d0)
+ {
+ q = GMP_LIMB_MAX;
+ mpn_submul_1 (np+i, dp, dn, q);
+ n1 = np[dn-1+i]; /* update n1, last loop's value will now be invalid */
+ }
+ else
+ {
+ gmp_udiv_qr_3by2 (q, n1, n0, n1, n0, np[dn-2+i], d1, d0, dinv);
+
+ cy = mpn_submul_1 (np + i, dp, dn-2, q);
+
+ cy1 = n0 < cy;
+ n0 = n0 - cy;
+ cy = n1 < cy1;
+ n1 = n1 - cy1;
+ np[dn-2+i] = n0;
+
+ if (cy != 0)
+ {
+ n1 += d1 + mpn_add_n (np + i, np + i, dp, dn - 1);
+ q--;
+ }
+ }
+
+ if (qp)
+ qp[i] = q;
+ }
+ while (--i >= 0);
+
+ np[dn - 1] = n1;
+}
+
+static void
+mpn_div_qr_preinv (mp_ptr qp, mp_ptr np, mp_size_t nn,
+ mp_srcptr dp, mp_size_t dn,
+ const struct gmp_div_inverse *inv)
+{
+ assert (dn > 0);
+ assert (nn >= dn);
+
+ 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);
+ else
+ {
+ mp_limb_t nh;
+ unsigned shift;
+
+ assert (inv->d1 == dp[dn-1]);
+ assert (inv->d0 == dp[dn-2]);
+ assert ((inv->d1 & GMP_LIMB_HIGHBIT) != 0);
+
+ shift = inv->shift;
+ if (shift > 0)
+ nh = mpn_lshift (np, np, nn, shift);
+ else
+ nh = 0;
+
+ mpn_div_qr_pi1 (qp, np, nn, nh, dp, dn, inv->di);
+
+ if (shift > 0)
+ gmp_assert_nocarry (mpn_rshift (np, np, dn, shift));
+ }
+}
+
+static void
+mpn_div_qr (mp_ptr qp, mp_ptr np, mp_size_t nn, mp_srcptr dp, mp_size_t dn)
+{
+ struct gmp_div_inverse inv;
+ mp_ptr tp = NULL;
+
+ assert (dn > 0);
+ assert (nn >= dn);
+
+ mpn_div_qr_invert (&inv, dp, dn);
+ if (dn > 2 && inv.shift > 0)
+ {
+ tp = gmp_xalloc_limbs (dn);
+ gmp_assert_nocarry (mpn_lshift (tp, dp, dn, inv.shift));
+ dp = tp;
+ }
+ mpn_div_qr_preinv (qp, np, nn, dp, dn, &inv);
+ if (tp)
+ gmp_free (tp);
+}
+
+
+/* MPN base conversion. */
+static unsigned
+mpn_base_power_of_two_p (unsigned b)
+{
+ switch (b)
+ {
+ case 2: return 1;
+ case 4: return 2;
+ case 8: return 3;
+ case 16: return 4;
+ case 32: return 5;
+ case 64: return 6;
+ case 128: return 7;
+ case 256: return 8;
+ default: return 0;
+ }
+}
+
+struct mpn_base_info
+{
+ /* bb is the largest power of the base which fits in one limb, and
+ exp is the corresponding exponent. */
+ unsigned exp;
+ mp_limb_t bb;
+};
+
+static void
+mpn_get_base_info (struct mpn_base_info *info, mp_limb_t b)
+{
+ mp_limb_t m;
+ mp_limb_t p;
+ unsigned exp;
+
+ m = GMP_LIMB_MAX / b;
+ for (exp = 1, p = b; p <= m; exp++)
+ p *= b;
+
+ info->exp = exp;
+ info->bb = p;
+}
+
+static mp_bitcnt_t
+mpn_limb_size_in_base_2 (mp_limb_t u)
+{
+ unsigned shift;
+
+ assert (u > 0);
+ gmp_clz (shift, u);
+ return GMP_LIMB_BITS - shift;
+}
+
+static size_t
+mpn_get_str_bits (unsigned char *sp, unsigned bits, mp_srcptr up, mp_size_t un)
+{
+ unsigned char mask;
+ size_t sn, j;
+ mp_size_t i;
+ int shift;
+
+ sn = ((un - 1) * GMP_LIMB_BITS + mpn_limb_size_in_base_2 (up[un-1])
+ + bits - 1) / bits;
+
+ mask = (1U << bits) - 1;
+
+ for (i = 0, j = sn, shift = 0; j-- > 0;)
+ {
+ unsigned char digit = up[i] >> shift;
+
+ shift += bits;
+
+ if (shift >= GMP_LIMB_BITS && ++i < un)
+ {
+ shift -= GMP_LIMB_BITS;
+ digit |= up[i] << (bits - shift);
+ }
+ sp[j] = digit & mask;
+ }
+ return sn;
+}
+
+/* We generate digits from the least significant end, and reverse at
+ the end. */
+static size_t
+mpn_limb_get_str (unsigned char *sp, mp_limb_t w,
+ const struct gmp_div_inverse *binv)
+{
+ mp_size_t i;
+ for (i = 0; w > 0; i++)
+ {
+ mp_limb_t h, l, r;
+
+ h = w >> (GMP_LIMB_BITS - binv->shift);
+ l = w << binv->shift;
+
+ gmp_udiv_qrnnd_preinv (w, r, h, l, binv->d1, binv->di);
+ assert ( (r << (GMP_LIMB_BITS - binv->shift)) == 0);
+ r >>= binv->shift;
+
+ sp[i] = r;
+ }
+ return i;
+}
+
+static size_t
+mpn_get_str_other (unsigned char *sp,
+ int base, const struct mpn_base_info *info,
+ mp_ptr up, mp_size_t un)
+{
+ struct gmp_div_inverse binv;
+ size_t sn;
+ size_t i;
+
+ mpn_div_qr_1_invert (&binv, base);
+
+ sn = 0;
+
+ if (un > 1)
+ {
+ struct gmp_div_inverse bbinv;
+ mpn_div_qr_1_invert (&bbinv, info->bb);
+
+ do
+ {
+ mp_limb_t w;
+ size_t done;
+ w = mpn_div_qr_1_preinv (up, up, un, &bbinv);
+ un -= (up[un-1] == 0);
+ done = mpn_limb_get_str (sp + sn, w, &binv);
+
+ for (sn += done; done < info->exp; done++)
+ sp[sn++] = 0;
+ }
+ while (un > 1);
+ }
+ sn += mpn_limb_get_str (sp + sn, up[0], &binv);
+
+ /* Reverse order */
+ for (i = 0; 2*i + 1 < sn; i++)
+ {
+ unsigned char t = sp[i];
+ sp[i] = sp[sn - i - 1];
+ sp[sn - i - 1] = t;
+ }
+
+ return sn;
+}
+
+size_t
+mpn_get_str (unsigned char *sp, int base, mp_ptr up, mp_size_t un)
+{
+ unsigned bits;
+
+ assert (un > 0);
+ assert (up[un-1] > 0);
+
+ bits = mpn_base_power_of_two_p (base);
+ if (bits)
+ return mpn_get_str_bits (sp, bits, up, un);
+ else
+ {
+ struct mpn_base_info info;
+
+ mpn_get_base_info (&info, base);
+ return mpn_get_str_other (sp, base, &info, up, un);
+ }
+}
+
+static mp_size_t
+mpn_set_str_bits (mp_ptr rp, const unsigned char *sp, size_t sn,
+ unsigned bits)
+{
+ mp_size_t rn;
+ size_t j;
+ unsigned shift;
+
+ for (j = sn, rn = 0, shift = 0; j-- > 0; )
+ {
+ if (shift == 0)
+ {
+ rp[rn++] = sp[j];
+ shift += bits;
+ }
+ else
+ {
+ rp[rn-1] |= (mp_limb_t) sp[j] << shift;
+ shift += bits;
+ if (shift >= GMP_LIMB_BITS)
+ {
+ shift -= GMP_LIMB_BITS;
+ if (shift > 0)
+ rp[rn++] = (mp_limb_t) sp[j] >> (bits - shift);
+ }
+ }
+ }
+ rn = mpn_normalized_size (rp, rn);
+ return rn;
+}
+
+static mp_size_t
+mpn_set_str_other (mp_ptr rp, const unsigned char *sp, size_t sn,
+ mp_limb_t b, const struct mpn_base_info *info)
+{
+ mp_size_t rn;
+ mp_limb_t w;
+ unsigned k;
+ size_t j;
+
+ k = 1 + (sn - 1) % info->exp;
+
+ j = 0;
+ w = sp[j++];
+ for (; --k > 0; )
+ w = w * b + sp[j++];
+
+ rp[0] = w;
+
+ for (rn = (w > 0); j < sn;)
+ {
+ mp_limb_t cy;
+
+ w = sp[j++];
+ for (k = 1; k < info->exp; k++)
+ w = w * b + sp[j++];
+
+ cy = mpn_mul_1 (rp, rp, rn, info->bb);
+ cy += mpn_add_1 (rp, rp, rn, w);
+ if (cy > 0)
+ rp[rn++] = cy;
+ }
+ assert (j == sn);
+
+ return rn;
+}
+
+mp_size_t
+mpn_set_str (mp_ptr rp, const unsigned char *sp, size_t sn, int base)
+{
+ unsigned bits;
+
+ if (sn == 0)
+ return 0;
+
+ bits = mpn_base_power_of_two_p (base);
+ if (bits)
+ return mpn_set_str_bits (rp, sp, sn, bits);
+ else
+ {
+ struct mpn_base_info info;
+
+ mpn_get_base_info (&info, base);
+ return mpn_set_str_other (rp, sp, sn, base, &info);
+ }
+}
+
+
+/* MPZ interface */
+void
+mpz_init (mpz_t r)
+{
+ r->_mp_alloc = 1;
+ r->_mp_size = 0;
+ r->_mp_d = gmp_xalloc_limbs (1);
+}
+
+/* The utility of this function is a bit limited, since many functions
+ assigns the result variable using mpz_swap. */
+void
+mpz_init2 (mpz_t r, mp_bitcnt_t bits)
+{
+ mp_size_t rn;
+
+ bits -= (bits != 0); /* Round down, except if 0 */
+ rn = 1 + bits / GMP_LIMB_BITS;
+
+ r->_mp_alloc = rn;
+ r->_mp_size = 0;
+ r->_mp_d = gmp_xalloc_limbs (rn);
+}
+
+void
+mpz_clear (mpz_t r)
+{
+ gmp_free (r->_mp_d);
+}
+
+static void *
+mpz_realloc (mpz_t r, mp_size_t size)
+{
+ size = GMP_MAX (size, 1);
+
+ r->_mp_d = gmp_xrealloc_limbs (r->_mp_d, size);
+ r->_mp_alloc = size;
+
+ if (GMP_ABS (r->_mp_size) > size)
+ r->_mp_size = 0;
+
+ return r->_mp_d;
+}
+
+/* Realloc for an mpz_t WHAT if it has less than NEEDED limbs. */
+#define MPZ_REALLOC(z,n) ((n) > (z)->_mp_alloc \
+ ? mpz_realloc(z,n) \
+ : (z)->_mp_d)
+
+/* MPZ assignment and basic conversions. */
+void
+mpz_set_si (mpz_t r, signed long int x)
+{
+ if (x >= 0)
+ mpz_set_ui (r, x);
+ else /* (x < 0) */
+ {
+ r->_mp_size = -1;
+ r->_mp_d[0] = GMP_NEG_CAST (unsigned long int, x);
+ }
+}
+
+void
+mpz_set_ui (mpz_t r, unsigned long int x)
+{
+ if (x > 0)
+ {
+ r->_mp_size = 1;
+ r->_mp_d[0] = x;
+ }
+ else
+ r->_mp_size = 0;
+}
+
+void
+mpz_set (mpz_t r, const mpz_t x)
+{
+ /* Allow the NOP r == x */
+ if (r != x)
+ {
+ mp_size_t n;
+ mp_ptr rp;
+
+ n = GMP_ABS (x->_mp_size);
+ rp = MPZ_REALLOC (r, n);
+
+ mpn_copyi (rp, x->_mp_d, n);
+ r->_mp_size = x->_mp_size;
+ }
+}
+
+void
+mpz_init_set_si (mpz_t r, signed long int x)
+{
+ mpz_init (r);
+ mpz_set_si (r, x);
+}
+
+void
+mpz_init_set_ui (mpz_t r, unsigned long int x)
+{
+ mpz_init (r);
+ mpz_set_ui (r, x);
+}
+
+void
+mpz_init_set (mpz_t r, const mpz_t x)
+{
+ mpz_init (r);
+ mpz_set (r, x);
+}
+
+int
+mpz_fits_slong_p (const mpz_t u)
+{
+ mp_size_t us = u->_mp_size;
+
+ if (us == 0)
+ return 1;
+ else 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 0;
+}
+
+int
+mpz_fits_ulong_p (const mpz_t u)
+{
+ mp_size_t us = u->_mp_size;
+
+ return (us == (us > 0));
+}
+
+long int
+mpz_get_si (const mpz_t u)
+{
+ mp_size_t us = u->_mp_size;
+
+ if (us > 0)
+ return (long) (u->_mp_d[0] & ~GMP_LIMB_HIGHBIT);
+ else if (us < 0)
+ return (long) (- u->_mp_d[0] | GMP_LIMB_HIGHBIT);
+ else
+ return 0;
+}
+
+unsigned long int
+mpz_get_ui (const mpz_t u)
+{
+ return u->_mp_size == 0 ? 0 : u->_mp_d[0];
+}
+
+size_t
+mpz_size (const mpz_t u)
+{
+ return GMP_ABS (u->_mp_size);
+}
+
+mp_limb_t
+mpz_getlimbn (const mpz_t u, mp_size_t n)
+{
+ if (n >= 0 && n < GMP_ABS (u->_mp_size))
+ return u->_mp_d[n];
+ else
+ return 0;
+}
+
+void
+mpz_realloc2 (mpz_t x, mp_bitcnt_t n)
+{
+ mpz_realloc (x, 1 + (n - (n != 0)) / GMP_LIMB_BITS);
+}
+
+mp_srcptr
+mpz_limbs_read (mpz_srcptr x)
+{
+ return x->_mp_d;;
+}
+
+mp_ptr
+mpz_limbs_modify (mpz_t x, mp_size_t n)
+{
+ assert (n > 0);
+ return MPZ_REALLOC (x, n);
+}
+
+mp_ptr
+mpz_limbs_write (mpz_t x, mp_size_t n)
+{
+ return mpz_limbs_modify (x, n);
+}
+
+void
+mpz_limbs_finish (mpz_t x, mp_size_t xs)
+{
+ mp_size_t xn;
+ xn = mpn_normalized_size (x->_mp_d, GMP_ABS (xs));
+ x->_mp_size = xs < 0 ? -xn : xn;
+}
+
+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_limbs_finish (x, xs);
+ return x;
+}
+
+
+/* Conversions and comparison to double. */
+void
+mpz_set_d (mpz_t r, double x)
+{
+ int sign;
+ mp_ptr rp;
+ mp_size_t rn, i;
+ double B;
+ double Bi;
+ mp_limb_t f;
+
+ /* 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 || x == x * 0.5)
+ {
+ r->_mp_size = 0;
+ return;
+ }
+
+ sign = x < 0.0 ;
+ if (sign)
+ x = - x;
+
+ if (x < 1.0)
+ {
+ r->_mp_size = 0;
+ return;
+ }
+ B = 2.0 * (double) GMP_LIMB_HIGHBIT;
+ Bi = 1.0 / B;
+ for (rn = 1; x >= B; rn++)
+ x *= Bi;
+
+ rp = MPZ_REALLOC (r, rn);
+
+ f = (mp_limb_t) x;
+ x -= f;
+ assert (x < 1.0);
+ i = rn-1;
+ rp[i] = f;
+ while (--i >= 0)
+ {
+ x = B * x;
+ f = (mp_limb_t) x;
+ x -= f;
+ assert (x < 1.0);
+ rp[i] = f;
+ }
+
+ r->_mp_size = sign ? - rn : rn;
+}
+
+void
+mpz_init_set_d (mpz_t r, double x)
+{
+ mpz_init (r);
+ mpz_set_d (r, x);
+}
+
+double
+mpz_get_d (const mpz_t u)
+{
+ mp_size_t un;
+ double x;
+ double B = 2.0 * (double) GMP_LIMB_HIGHBIT;
+
+ un = GMP_ABS (u->_mp_size);
+
+ if (un == 0)
+ return 0.0;
+
+ x = u->_mp_d[--un];
+ while (un > 0)
+ x = B*x + u->_mp_d[--un];
+
+ if (u->_mp_size < 0)
+ x = -x;
+
+ return x;
+}
+
+int
+mpz_cmpabs_d (const mpz_t x, double d)
+{
+ mp_size_t xn;
+ double B, Bi;
+ mp_size_t i;
+
+ xn = x->_mp_size;
+ d = GMP_ABS (d);
+
+ if (xn != 0)
+ {
+ xn = GMP_ABS (xn);
+
+ B = 2.0 * (double) GMP_LIMB_HIGHBIT;
+ Bi = 1.0 / B;
+
+ /* Scale d so it can be compared with the top limb. */
+ for (i = 1; i < xn; i++)
+ d *= Bi;
+
+ if (d >= B)
+ return -1;
+
+ /* Compare floor(d) to top limb, subtract and cancel when equal. */
+ for (i = xn; i-- > 0;)
+ {
+ mp_limb_t f, xl;
+
+ f = (mp_limb_t) d;
+ xl = x->_mp_d[i];
+ if (xl > f)
+ return 1;
+ else if (xl < f)
+ return -1;
+ d = B * (d - f);
+ }
+ }
+ return - (d > 0.0);
+}
+
+int
+mpz_cmp_d (const mpz_t x, double d)
+{
+ if (x->_mp_size < 0)
+ {
+ if (d >= 0.0)
+ return -1;
+ else
+ return -mpz_cmpabs_d (x, d);
+ }
+ else
+ {
+ if (d < 0.0)
+ return 1;
+ else
+ return mpz_cmpabs_d (x, d);
+ }
+}
+
+
+/* MPZ comparisons and the like. */
+int
+mpz_sgn (const mpz_t u)
+{
+ mp_size_t usize = u->_mp_size;
+
+ return (usize > 0) - (usize < 0);
+}
+
+int
+mpz_cmp_si (const mpz_t u, long v)
+{
+ mp_size_t usize = u->_mp_size;
+
+ if (usize < -1)
+ return -1;
+ else if (v >= 0)
+ return mpz_cmp_ui (u, v);
+ else if (usize >= 0)
+ return 1;
+ else /* usize == -1 */
+ {
+ mp_limb_t ul = u->_mp_d[0];
+ if ((mp_limb_t)GMP_NEG_CAST (unsigned long int, v) < ul)
+ return -1;
+ else
+ return (mp_limb_t)GMP_NEG_CAST (unsigned long int, v) > ul;
+ }
+}
+
+int
+mpz_cmp_ui (const mpz_t u, unsigned long v)
+{
+ mp_size_t usize = u->_mp_size;
+
+ if (usize > 1)
+ return 1;
+ else if (usize < 0)
+ return -1;
+ else
+ {
+ mp_limb_t ul = (usize > 0) ? u->_mp_d[0] : 0;
+ return (ul > v) - (ul < v);
+ }
+}
+
+int
+mpz_cmp (const mpz_t a, const mpz_t b)
+{
+ mp_size_t asize = a->_mp_size;
+ mp_size_t bsize = b->_mp_size;
+
+ if (asize != bsize)
+ return (asize < bsize) ? -1 : 1;
+ else if (asize >= 0)
+ return mpn_cmp (a->_mp_d, b->_mp_d, asize);
+ else
+ return mpn_cmp (b->_mp_d, a->_mp_d, -asize);
+}
+
+int
+mpz_cmpabs_ui (const mpz_t u, unsigned long v)
+{
+ mp_size_t un = GMP_ABS (u->_mp_size);
+ mp_limb_t ul;
+
+ if (un > 1)
+ return 1;
+
+ ul = (un == 1) ? u->_mp_d[0] : 0;
+
+ return (ul > v) - (ul < v);
+}
+
+int
+mpz_cmpabs (const mpz_t u, const mpz_t v)
+{
+ return mpn_cmp4 (u->_mp_d, GMP_ABS (u->_mp_size),
+ v->_mp_d, GMP_ABS (v->_mp_size));
+}
+
+void
+mpz_abs (mpz_t r, const mpz_t u)
+{
+ if (r != u)
+ mpz_set (r, u);
+
+ r->_mp_size = GMP_ABS (r->_mp_size);
+}
+
+void
+mpz_neg (mpz_t r, const mpz_t u)
+{
+ if (r != u)
+ mpz_set (r, u);
+
+ r->_mp_size = -r->_mp_size;
+}
+
+void
+mpz_swap (mpz_t u, mpz_t v)
+{
+ MP_SIZE_T_SWAP (u->_mp_size, v->_mp_size);
+ MP_SIZE_T_SWAP (u->_mp_alloc, v->_mp_alloc);
+ MP_PTR_SWAP (u->_mp_d, v->_mp_d);
+}
+
+
+/* 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)
+ {
+ r->_mp_d[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 = MPZ_REALLOC (r, an);
+
+ if (an == 0)
+ {
+ rp[0] = b;
+ return -(b > 0);
+ }
+ else 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);
+}
+
+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);
+}
+
+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);
+}
+
+static mp_size_t
+mpz_abs_add (mpz_t r, const mpz_t a, const mpz_t b)
+{
+ mp_size_t an = GMP_ABS (a->_mp_size);
+ mp_size_t bn = GMP_ABS (b->_mp_size);
+ mp_ptr rp;
+ mp_limb_t cy;
+
+ if (an < bn)
+ {
+ MPZ_SRCPTR_SWAP (a, b);
+ MP_SIZE_T_SWAP (an, bn);
+ }
+
+ rp = MPZ_REALLOC (r, an + 1);
+ cy = mpn_add (rp, a->_mp_d, an, b->_mp_d, bn);
+
+ rp[an] = cy;
+
+ return an + cy;
+}
+
+static mp_size_t
+mpz_abs_sub (mpz_t r, const mpz_t a, const mpz_t b)
+{
+ mp_size_t an = GMP_ABS (a->_mp_size);
+ mp_size_t bn = GMP_ABS (b->_mp_size);
+ int cmp;
+ mp_ptr rp;
+
+ cmp = mpn_cmp4 (a->_mp_d, an, b->_mp_d, bn);
+ if (cmp > 0)
+ {
+ rp = MPZ_REALLOC (r, an);
+ gmp_assert_nocarry (mpn_sub (rp, a->_mp_d, an, b->_mp_d, bn));
+ return mpn_normalized_size (rp, an);
+ }
+ else if (cmp < 0)
+ {
+ rp = MPZ_REALLOC (r, bn);
+ gmp_assert_nocarry (mpn_sub (rp, b->_mp_d, bn, a->_mp_d, an));
+ return -mpn_normalized_size (rp, bn);
+ }
+ else
+ return 0;
+}
+
+void
+mpz_add (mpz_t r, const mpz_t a, const mpz_t b)
+{
+ mp_size_t rn;
+
+ if ( (a->_mp_size ^ b->_mp_size) >= 0)
+ rn = mpz_abs_add (r, a, b);
+ else
+ rn = mpz_abs_sub (r, a, b);
+
+ r->_mp_size = a->_mp_size >= 0 ? rn : - rn;
+}
+
+void
+mpz_sub (mpz_t r, const mpz_t a, const mpz_t b)
+{
+ mp_size_t rn;
+
+ if ( (a->_mp_size ^ b->_mp_size) >= 0)
+ rn = mpz_abs_sub (r, a, b);
+ else
+ rn = mpz_abs_add (r, a, b);
+
+ r->_mp_size = a->_mp_size >= 0 ? rn : - rn;
+}
+
+
+/* MPZ multiplication */
+void
+mpz_mul_si (mpz_t r, const mpz_t u, long int v)
+{
+ if (v < 0)
+ {
+ mpz_mul_ui (r, u, GMP_NEG_CAST (unsigned long int, v));
+ mpz_neg (r, r);
+ }
+ else
+ mpz_mul_ui (r, u, (unsigned long int) 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;
+}
+
+void
+mpz_mul (mpz_t r, const mpz_t u, const mpz_t v)
+{
+ int sign;
+ mp_size_t un, vn, rn;
+ mpz_t t;
+ mp_ptr tp;
+
+ un = u->_mp_size;
+ vn = v->_mp_size;
+
+ if (un == 0 || vn == 0)
+ {
+ r->_mp_size = 0;
+ return;
+ }
+
+ sign = (un ^ vn) < 0;
+
+ un = GMP_ABS (un);
+ vn = GMP_ABS (vn);
+
+ mpz_init2 (t, (un + vn) * GMP_LIMB_BITS);
+
+ tp = t->_mp_d;
+ if (un >= vn)
+ mpn_mul (tp, u->_mp_d, un, v->_mp_d, vn);
+ else
+ mpn_mul (tp, v->_mp_d, vn, u->_mp_d, un);
+
+ rn = un + vn;
+ rn -= tp[rn-1] == 0;
+
+ t->_mp_size = sign ? - rn : rn;
+ mpz_swap (r, t);
+ mpz_clear (t);
+}
+
+void
+mpz_mul_2exp (mpz_t r, const mpz_t u, mp_bitcnt_t bits)
+{
+ mp_size_t un, rn;
+ mp_size_t limbs;
+ unsigned shift;
+ mp_ptr rp;
+
+ un = GMP_ABS (u->_mp_size);
+ if (un == 0)
+ {
+ r->_mp_size = 0;
+ return;
+ }
+
+ limbs = bits / GMP_LIMB_BITS;
+ shift = bits % GMP_LIMB_BITS;
+
+ rn = un + limbs + (shift > 0);
+ rp = MPZ_REALLOC (r, rn);
+ if (shift > 0)
+ {
+ mp_limb_t cy = mpn_lshift (rp + limbs, u->_mp_d, un, shift);
+ rp[rn-1] = cy;
+ rn -= (cy == 0);
+ }
+ else
+ mpn_copyd (rp + limbs, u->_mp_d, un);
+
+ while (limbs > 0)
+ rp[--limbs] = 0;
+
+ r->_mp_size = (u->_mp_size < 0) ? - rn : rn;
+}
+
+void
+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_add (r, r, t);
+ mpz_clear (t);
+}
+
+void
+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_sub (r, r, t);
+ mpz_clear (t);
+}
+
+void
+mpz_addmul (mpz_t r, const mpz_t u, const mpz_t v)
+{
+ mpz_t t;
+ mpz_init (t);
+ mpz_mul (t, u, v);
+ mpz_add (r, r, t);
+ mpz_clear (t);
+}
+
+void
+mpz_submul (mpz_t r, const mpz_t u, const mpz_t v)
+{
+ mpz_t t;
+ mpz_init (t);
+ mpz_mul (t, u, v);
+ mpz_sub (r, r, t);
+ mpz_clear (t);
+}
+
+
+/* MPZ division */
+enum mpz_div_round_mode { GMP_DIV_FLOOR, GMP_DIV_CEIL, GMP_DIV_TRUNC };
+
+/* Allows q or r to be zero. Returns 1 iff remainder is non-zero. */
+static int
+mpz_div_qr (mpz_t q, mpz_t r,
+ const mpz_t n, const mpz_t d, enum mpz_div_round_mode mode)
+{
+ mp_size_t ns, ds, nn, dn, qs;
+ ns = n->_mp_size;
+ ds = d->_mp_size;
+
+ if (ds == 0)
+ gmp_die("mpz_div_qr: Divide by zero.");
+
+ if (ns == 0)
+ {
+ if (q)
+ q->_mp_size = 0;
+ if (r)
+ r->_mp_size = 0;
+ return 0;
+ }
+
+ nn = GMP_ABS (ns);
+ dn = GMP_ABS (ds);
+
+ qs = ds ^ ns;
+
+ if (nn < dn)
+ {
+ if (mode == GMP_DIV_CEIL && qs >= 0)
+ {
+ /* q = 1, r = n - d */
+ if (r)
+ mpz_sub (r, n, d);
+ if (q)
+ mpz_set_ui (q, 1);
+ }
+ else if (mode == GMP_DIV_FLOOR && qs < 0)
+ {
+ /* q = -1, r = n + d */
+ if (r)
+ mpz_add (r, n, d);
+ if (q)
+ mpz_set_si (q, -1);
+ }
+ else
+ {
+ /* q = 0, r = d */
+ if (r)
+ mpz_set (r, n);
+ if (q)
+ q->_mp_size = 0;
+ }
+ return 1;
+ }
+ else
+ {
+ mp_ptr np, qp;
+ mp_size_t qn, rn;
+ mpz_t tq, tr;
+
+ mpz_init_set (tr, n);
+ np = tr->_mp_d;
+
+ qn = nn - dn + 1;
+
+ if (q)
+ {
+ mpz_init2 (tq, qn * GMP_LIMB_BITS);
+ qp = tq->_mp_d;
+ }
+ else
+ qp = NULL;
+
+ mpn_div_qr (qp, np, nn, d->_mp_d, dn);
+
+ if (qp)
+ {
+ qn -= (qp[qn-1] == 0);
+
+ tq->_mp_size = qs < 0 ? -qn : qn;
+ }
+ rn = mpn_normalized_size (np, dn);
+ tr->_mp_size = ns < 0 ? - rn : rn;
+
+ if (mode == GMP_DIV_FLOOR && qs < 0 && rn != 0)
+ {
+ if (q)
+ mpz_sub_ui (tq, tq, 1);
+ if (r)
+ mpz_add (tr, tr, d);
+ }
+ else if (mode == GMP_DIV_CEIL && qs >= 0 && rn != 0)
+ {
+ if (q)
+ mpz_add_ui (tq, tq, 1);
+ if (r)
+ mpz_sub (tr, tr, d);
+ }
+
+ if (q)
+ {
+ mpz_swap (tq, q);
+ mpz_clear (tq);
+ }
+ if (r)
+ mpz_swap (tr, r);
+
+ mpz_clear (tr);
+
+ return rn != 0;
+ }
+}
+
+void
+mpz_cdiv_qr (mpz_t q, mpz_t r, const mpz_t n, const mpz_t d)
+{
+ mpz_div_qr (q, r, n, d, GMP_DIV_CEIL);
+}
+
+void
+mpz_fdiv_qr (mpz_t q, mpz_t r, const mpz_t n, const mpz_t d)
+{
+ mpz_div_qr (q, r, n, d, GMP_DIV_FLOOR);
+}
+
+void
+mpz_tdiv_qr (mpz_t q, mpz_t r, const mpz_t n, const mpz_t d)
+{
+ mpz_div_qr (q, r, n, d, GMP_DIV_TRUNC);
+}
+
+void
+mpz_cdiv_q (mpz_t q, const mpz_t n, const mpz_t d)
+{
+ mpz_div_qr (q, NULL, n, d, GMP_DIV_CEIL);
+}
+
+void
+mpz_fdiv_q (mpz_t q, const mpz_t n, const mpz_t d)
+{
+ mpz_div_qr (q, NULL, n, d, GMP_DIV_FLOOR);
+}
+
+void
+mpz_tdiv_q (mpz_t q, const mpz_t n, const mpz_t d)
+{
+ mpz_div_qr (q, NULL, n, d, GMP_DIV_TRUNC);
+}
+
+void
+mpz_cdiv_r (mpz_t r, const mpz_t n, const mpz_t d)
+{
+ mpz_div_qr (NULL, r, n, d, GMP_DIV_CEIL);
+}
+
+void
+mpz_fdiv_r (mpz_t r, const mpz_t n, const mpz_t d)
+{
+ mpz_div_qr (NULL, r, n, d, GMP_DIV_FLOOR);
+}
+
+void
+mpz_tdiv_r (mpz_t r, const mpz_t n, const mpz_t d)
+{
+ mpz_div_qr (NULL, r, n, d, GMP_DIV_TRUNC);
+}
+
+void
+mpz_mod (mpz_t r, const mpz_t n, const mpz_t d)
+{
+ mpz_div_qr (NULL, r, n, d, d->_mp_size >= 0 ? GMP_DIV_FLOOR : GMP_DIV_CEIL);
+}
+
+static void
+mpz_div_q_2exp (mpz_t q, const mpz_t u, mp_bitcnt_t bit_index,
+ enum mpz_div_round_mode mode)
+{
+ mp_size_t un, qn;
+ mp_size_t limb_cnt;
+ mp_ptr qp;
+ int adjust;
+
+ un = u->_mp_size;
+ if (un == 0)
+ {
+ q->_mp_size = 0;
+ return;
+ }
+ limb_cnt = bit_index / GMP_LIMB_BITS;
+ qn = GMP_ABS (un) - limb_cnt;
+ bit_index %= GMP_LIMB_BITS;
+
+ if (mode == ((un > 0) ? GMP_DIV_CEIL : GMP_DIV_FLOOR)) /* un != 0 here. */
+ /* Note: Below, the final indexing at limb_cnt is valid because at
+ that point we have qn > 0. */
+ adjust = (qn <= 0
+ || !mpn_zero_p (u->_mp_d, limb_cnt)
+ || (u->_mp_d[limb_cnt]
+ & (((mp_limb_t) 1 << bit_index) - 1)));
+ else
+ adjust = 0;
+
+ if (qn <= 0)
+ qn = 0;
+
+ else
+ {
+ qp = MPZ_REALLOC (q, qn);
+
+ if (bit_index != 0)
+ {
+ mpn_rshift (qp, u->_mp_d + limb_cnt, qn, bit_index);
+ qn -= qp[qn - 1] == 0;
+ }
+ else
+ {
+ mpn_copyi (qp, u->_mp_d + limb_cnt, qn);
+ }
+ }
+
+ q->_mp_size = qn;
+
+ if (adjust)
+ mpz_add_ui (q, q, 1);
+ if (un < 0)
+ mpz_neg (q, q);
+}
+
+static void
+mpz_div_r_2exp (mpz_t r, const mpz_t u, mp_bitcnt_t bit_index,
+ enum mpz_div_round_mode mode)
+{
+ mp_size_t us, un, rn;
+ mp_ptr rp;
+ mp_limb_t mask;
+
+ us = u->_mp_size;
+ if (us == 0 || bit_index == 0)
+ {
+ r->_mp_size = 0;
+ return;
+ }
+ rn = (bit_index + GMP_LIMB_BITS - 1) / GMP_LIMB_BITS;
+ assert (rn > 0);
+
+ rp = MPZ_REALLOC (r, rn);
+ un = GMP_ABS (us);
+
+ mask = GMP_LIMB_MAX >> (rn * GMP_LIMB_BITS - bit_index);
+
+ if (rn > un)
+ {
+ /* Quotient (with truncation) is zero, and remainder is
+ non-zero */
+ if (mode == ((us > 0) ? GMP_DIV_CEIL : GMP_DIV_FLOOR)) /* us != 0 here. */
+ {
+ /* Have to negate and sign extend. */
+ mp_size_t i;
+ mp_limb_t cy;
+
+ for (cy = 1, i = 0; i < un; i++)
+ {
+ mp_limb_t s = ~u->_mp_d[i] + cy;
+ cy = s < cy;
+ rp[i] = s;
+ }
+ assert (cy == 0);
+ for (; i < rn - 1; i++)
+ rp[i] = GMP_LIMB_MAX;
+
+ rp[rn-1] = mask;
+ us = -us;
+ }
+ else
+ {
+ /* Just copy */
+ if (r != u)
+ mpn_copyi (rp, u->_mp_d, un);
+
+ rn = un;
+ }
+ }
+ else
+ {
+ if (r != u)
+ mpn_copyi (rp, u->_mp_d, rn - 1);
+
+ rp[rn-1] = u->_mp_d[rn-1] & mask;
+
+ if (mode == ((us > 0) ? GMP_DIV_CEIL : GMP_DIV_FLOOR)) /* us != 0 here. */
+ {
+ /* If r != 0, compute 2^{bit_count} - r. */
+ mp_size_t i;
+
+ for (i = 0; i < rn && rp[i] == 0; i++)
+ ;
+ if (i < rn)
+ {
+ /* r > 0, need to flip sign. */
+ rp[i] = ~rp[i] + 1;
+ while (++i < rn)
+ rp[i] = ~rp[i];
+
+ rp[rn-1] &= mask;
+
+ /* us is not used for anything else, so we can modify it
+ here to indicate flipped sign. */
+ us = -us;
+ }
+ }
+ }
+ rn = mpn_normalized_size (rp, rn);
+ r->_mp_size = us < 0 ? -rn : rn;
+}
+
+void
+mpz_cdiv_q_2exp (mpz_t r, const mpz_t u, mp_bitcnt_t cnt)
+{
+ mpz_div_q_2exp (r, u, cnt, GMP_DIV_CEIL);
+}
+
+void
+mpz_fdiv_q_2exp (mpz_t r, const mpz_t u, mp_bitcnt_t cnt)
+{
+ mpz_div_q_2exp (r, u, cnt, GMP_DIV_FLOOR);
+}
+
+void
+mpz_tdiv_q_2exp (mpz_t r, const mpz_t u, mp_bitcnt_t cnt)
+{
+ mpz_div_q_2exp (r, u, cnt, GMP_DIV_TRUNC);
+}
+
+void
+mpz_cdiv_r_2exp (mpz_t r, const mpz_t u, mp_bitcnt_t cnt)
+{
+ mpz_div_r_2exp (r, u, cnt, GMP_DIV_CEIL);
+}
+
+void
+mpz_fdiv_r_2exp (mpz_t r, const mpz_t u, mp_bitcnt_t cnt)
+{
+ mpz_div_r_2exp (r, u, cnt, GMP_DIV_FLOOR);
+}
+
+void
+mpz_tdiv_r_2exp (mpz_t r, const mpz_t u, mp_bitcnt_t cnt)
+{
+ mpz_div_r_2exp (r, u, cnt, GMP_DIV_TRUNC);
+}
+
+void
+mpz_divexact (mpz_t q, const mpz_t n, const mpz_t d)
+{
+ gmp_assert_nocarry (mpz_div_qr (q, NULL, n, d, GMP_DIV_TRUNC));
+}
+
+int
+mpz_divisible_p (const mpz_t n, const mpz_t d)
+{
+ return mpz_div_qr (NULL, NULL, n, d, GMP_DIV_TRUNC) == 0;
+}
+
+int
+mpz_congruent_p (const mpz_t a, const mpz_t b, const mpz_t m)
+{
+ mpz_t t;
+ int res;
+
+ /* a == b (mod 0) iff a == b */
+ if (mpz_sgn (m) == 0)
+ return (mpz_cmp (a, b) == 0);
+
+ mpz_init (t);
+ mpz_sub (t, a, b);
+ res = mpz_divisible_p (t, m);
+ mpz_clear (t);
+
+ return res;
+}
+
+static unsigned long
+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;
+
+ ns = n->_mp_size;
+ if (ns == 0)
+ {
+ if (q)
+ q->_mp_size = 0;
+ if (r)
+ r->_mp_size = 0;
+ return 0;
+ }
+
+ 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)
+ {
+ r->_mp_d[0] = rl;
+ r->_mp_size = rs;
+ }
+ if (q)
+ {
+ qn -= (qp[qn-1] == 0);
+ assert (qn == 0 || qp[qn-1] > 0);
+
+ q->_mp_size = (ns < 0) ? - qn : qn;
+ }
+
+ return rl;
+}
+
+unsigned long
+mpz_cdiv_qr_ui (mpz_t q, mpz_t r, const mpz_t n, unsigned long d)
+{
+ return mpz_div_qr_ui (q, r, n, d, GMP_DIV_CEIL);
+}
+
+unsigned long
+mpz_fdiv_qr_ui (mpz_t q, mpz_t r, const mpz_t n, unsigned long d)
+{
+ return mpz_div_qr_ui (q, r, n, d, GMP_DIV_FLOOR);
+}
+
+unsigned long
+mpz_tdiv_qr_ui (mpz_t q, mpz_t r, const mpz_t n, unsigned long d)
+{
+ return mpz_div_qr_ui (q, r, n, d, GMP_DIV_TRUNC);
+}
+
+unsigned long
+mpz_cdiv_q_ui (mpz_t q, const mpz_t n, unsigned long d)
+{
+ return mpz_div_qr_ui (q, NULL, n, d, GMP_DIV_CEIL);
+}
+
+unsigned long
+mpz_fdiv_q_ui (mpz_t q, const mpz_t n, unsigned long d)
+{
+ return mpz_div_qr_ui (q, NULL, n, d, GMP_DIV_FLOOR);
+}
+
+unsigned long
+mpz_tdiv_q_ui (mpz_t q, const mpz_t n, unsigned long d)
+{
+ return mpz_div_qr_ui (q, NULL, n, d, GMP_DIV_TRUNC);
+}
+
+unsigned long
+mpz_cdiv_r_ui (mpz_t r, const mpz_t n, unsigned long d)
+{
+ return mpz_div_qr_ui (NULL, r, n, d, GMP_DIV_CEIL);
+}
+unsigned long
+mpz_fdiv_r_ui (mpz_t r, const mpz_t n, unsigned long d)
+{
+ return mpz_div_qr_ui (NULL, r, n, d, GMP_DIV_FLOOR);
+}
+unsigned long
+mpz_tdiv_r_ui (mpz_t r, const mpz_t n, unsigned long d)
+{
+ return mpz_div_qr_ui (NULL, r, n, d, GMP_DIV_TRUNC);
+}
+
+unsigned long
+mpz_cdiv_ui (const mpz_t n, unsigned long d)
+{
+ return mpz_div_qr_ui (NULL, NULL, n, d, GMP_DIV_CEIL);
+}
+
+unsigned long
+mpz_fdiv_ui (const mpz_t n, unsigned long d)
+{
+ return mpz_div_qr_ui (NULL, NULL, n, d, GMP_DIV_FLOOR);
+}
+
+unsigned long
+mpz_tdiv_ui (const mpz_t n, unsigned long d)
+{
+ return mpz_div_qr_ui (NULL, NULL, n, d, GMP_DIV_TRUNC);
+}
+
+unsigned long
+mpz_mod_ui (mpz_t r, const mpz_t n, unsigned long d)
+{
+ return mpz_div_qr_ui (NULL, r, n, d, GMP_DIV_FLOOR);
+}
+
+void
+mpz_divexact_ui (mpz_t q, const mpz_t n, unsigned long d)
+{
+ gmp_assert_nocarry (mpz_div_qr_ui (q, NULL, n, d, GMP_DIV_TRUNC));
+}
+
+int
+mpz_divisible_ui_p (const mpz_t n, unsigned long d)
+{
+ return mpz_div_qr_ui (NULL, NULL, n, d, GMP_DIV_TRUNC) == 0;
+}
+
+
+/* GCD */
+static mp_limb_t
+mpn_gcd_11 (mp_limb_t u, mp_limb_t v)
+{
+ unsigned shift;
+
+ assert ( (u | v) > 0);
+
+ if (u == 0)
+ return v;
+ else if (v == 0)
+ return u;
+
+ gmp_ctz (shift, u | v);
+
+ u >>= shift;
+ v >>= shift;
+
+ if ( (u & 1) == 0)
+ MP_LIMB_T_SWAP (u, v);
+
+ while ( (v & 1) == 0)
+ v >>= 1;
+
+ while (u != v)
+ {
+ if (u > v)
+ {
+ u -= v;
+ do
+ u >>= 1;
+ while ( (u & 1) == 0);
+ }
+ else
+ {
+ v -= u;
+ do
+ v >>= 1;
+ while ( (v & 1) == 0);
+ }
+ }
+ return u << shift;
+}
+
+unsigned long
+mpz_gcd_ui (mpz_t g, const mpz_t u, unsigned long v)
+{
+ mp_size_t un;
+
+ 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_set_ui (g, v);
+ }
+
+ return v;
+}
+
+static mp_bitcnt_t
+mpz_make_odd (mpz_t r)
+{
+ mp_bitcnt_t shift;
+
+ assert (r->_mp_size > 0);
+ /* Count trailing zeros, equivalent to mpn_scan1, because we know that there is a 1 */
+ shift = mpn_common_scan (r->_mp_d[0], 0, r->_mp_d, 0, 0);
+ mpz_tdiv_q_2exp (r, r, shift);
+
+ return shift;
+}
+
+void
+mpz_gcd (mpz_t g, const mpz_t u, const mpz_t v)
+{
+ mpz_t tu, tv;
+ mp_bitcnt_t uz, vz, gz;
+
+ if (u->_mp_size == 0)
+ {
+ mpz_abs (g, v);
+ return;
+ }
+ if (v->_mp_size == 0)
+ {
+ mpz_abs (g, u);
+ return;
+ }
+
+ mpz_init (tu);
+ mpz_init (tv);
+
+ mpz_abs (tu, u);
+ uz = mpz_make_odd (tu);
+ mpz_abs (tv, v);
+ vz = mpz_make_odd (tv);
+ gz = GMP_MIN (uz, vz);
+
+ if (tu->_mp_size < tv->_mp_size)
+ mpz_swap (tu, tv);
+
+ mpz_tdiv_r (tu, tu, tv);
+ if (tu->_mp_size == 0)
+ {
+ mpz_swap (g, tv);
+ }
+ else
+ for (;;)
+ {
+ int c;
+
+ mpz_make_odd (tu);
+ c = mpz_cmp (tu, tv);
+ if (c == 0)
+ {
+ mpz_swap (g, tu);
+ break;
+ }
+ if (c < 0)
+ mpz_swap (tu, tv);
+
+ if (tv->_mp_size == 1)
+ {
+ mp_limb_t vl = tv->_mp_d[0];
+ mp_limb_t ul = mpz_tdiv_ui (tu, vl);
+ mpz_set_ui (g, mpn_gcd_11 (ul, vl));
+ break;
+ }
+ mpz_sub (tu, tu, tv);
+ }
+ mpz_clear (tu);
+ mpz_clear (tv);
+ mpz_mul_2exp (g, g, gz);
+}
+
+void
+mpz_gcdext (mpz_t g, mpz_t s, mpz_t t, const mpz_t u, const mpz_t v)
+{
+ mpz_t tu, tv, s0, s1, t0, t1;
+ mp_bitcnt_t uz, vz, gz;
+ mp_bitcnt_t power;
+
+ if (u->_mp_size == 0)
+ {
+ /* g = 0 u + sgn(v) v */
+ signed long sign = mpz_sgn (v);
+ mpz_abs (g, v);
+ if (s)
+ mpz_set_ui (s, 0);
+ if (t)
+ mpz_set_si (t, sign);
+ return;
+ }
+
+ if (v->_mp_size == 0)
+ {
+ /* g = sgn(u) u + 0 v */
+ signed long sign = mpz_sgn (u);
+ mpz_abs (g, u);
+ if (s)
+ mpz_set_si (s, sign);
+ if (t)
+ mpz_set_ui (t, 0);
+ return;
+ }
+
+ mpz_init (tu);
+ mpz_init (tv);
+ mpz_init (s0);
+ mpz_init (s1);
+ mpz_init (t0);
+ mpz_init (t1);
+
+ mpz_abs (tu, u);
+ uz = mpz_make_odd (tu);
+ mpz_abs (tv, v);
+ vz = mpz_make_odd (tv);
+ gz = GMP_MIN (uz, vz);
+
+ uz -= gz;
+ vz -= gz;
+
+ /* Cofactors corresponding to odd gcd. gz handled later. */
+ if (tu->_mp_size < tv->_mp_size)
+ {
+ mpz_swap (tu, tv);
+ MPZ_SRCPTR_SWAP (u, v);
+ MPZ_PTR_SWAP (s, t);
+ MP_BITCNT_T_SWAP (uz, vz);
+ }
+
+ /* Maintain
+ *
+ * u = t0 tu + t1 tv
+ * v = s0 tu + s1 tv
+ *
+ * where u and v denote the inputs with common factors of two
+ * eliminated, and det (s0, t0; s1, t1) = 2^p. Then
+ *
+ * 2^p tu = s1 u - t1 v
+ * 2^p tv = -s0 u + t0 v
+ */
+
+ /* After initial division, tu = q tv + tu', we have
+ *
+ * u = 2^uz (tu' + q tv)
+ * v = 2^vz tv
+ *
+ * or
+ *
+ * t0 = 2^uz, t1 = 2^uz q
+ * s0 = 0, s1 = 2^vz
+ */
+
+ mpz_setbit (t0, uz);
+ mpz_tdiv_qr (t1, tu, tu, tv);
+ mpz_mul_2exp (t1, t1, uz);
+
+ mpz_setbit (s1, vz);
+ power = uz + vz;
+
+ if (tu->_mp_size > 0)
+ {
+ mp_bitcnt_t shift;
+ shift = mpz_make_odd (tu);
+ mpz_mul_2exp (t0, t0, shift);
+ mpz_mul_2exp (s0, s0, shift);
+ power += shift;
+
+ for (;;)
+ {
+ int c;
+ c = mpz_cmp (tu, tv);
+ if (c == 0)
+ break;
+
+ if (c < 0)
+ {
+ /* tv = tv' + tu
+ *
+ * u = t0 tu + t1 (tv' + tu) = (t0 + t1) tu + t1 tv'
+ * v = s0 tu + s1 (tv' + tu) = (s0 + s1) tu + s1 tv' */
+
+ mpz_sub (tv, tv, tu);
+ mpz_add (t0, t0, t1);
+ mpz_add (s0, s0, s1);
+
+ shift = mpz_make_odd (tv);
+ mpz_mul_2exp (t1, t1, shift);
+ mpz_mul_2exp (s1, s1, shift);
+ }
+ else
+ {
+ mpz_sub (tu, tu, tv);
+ mpz_add (t1, t0, t1);
+ mpz_add (s1, s0, s1);
+
+ shift = mpz_make_odd (tu);
+ mpz_mul_2exp (t0, t0, shift);
+ mpz_mul_2exp (s0, s0, shift);
+ }
+ power += shift;
+ }
+ }
+
+ /* Now tv = odd part of gcd, and -s0 and t0 are corresponding
+ cofactors. */
+
+ mpz_mul_2exp (tv, tv, gz);
+ mpz_neg (s0, s0);
+
+ /* 2^p g = s0 u + t0 v. Eliminate one factor of two at a time. To
+ adjust cofactors, we need u / g and v / g */
+
+ mpz_divexact (s1, v, tv);
+ mpz_abs (s1, s1);
+ mpz_divexact (t1, u, tv);
+ mpz_abs (t1, t1);
+
+ while (power-- > 0)
+ {
+ /* s0 u + t0 v = (s0 - v/g) u - (t0 + u/g) v */
+ if (mpz_odd_p (s0) || mpz_odd_p (t0))
+ {
+ mpz_sub (s0, s0, s1);
+ mpz_add (t0, t0, t1);
+ }
+ mpz_divexact_ui (s0, s0, 2);
+ mpz_divexact_ui (t0, t0, 2);
+ }
+
+ /* Arrange so that |s| < |u| / 2g */
+ mpz_add (s1, s0, s1);
+ if (mpz_cmpabs (s0, s1) > 0)
+ {
+ mpz_swap (s0, s1);
+ mpz_sub (t0, t0, t1);
+ }
+ if (u->_mp_size < 0)
+ mpz_neg (s0, s0);
+ if (v->_mp_size < 0)
+ mpz_neg (t0, t0);
+
+ mpz_swap (g, tv);
+ if (s)
+ mpz_swap (s, s0);
+ if (t)
+ mpz_swap (t, t0);
+
+ mpz_clear (tu);
+ mpz_clear (tv);
+ mpz_clear (s0);
+ mpz_clear (s1);
+ mpz_clear (t0);
+ mpz_clear (t1);
+}
+
+void
+mpz_lcm (mpz_t r, const mpz_t u, const mpz_t v)
+{
+ mpz_t g;
+
+ if (u->_mp_size == 0 || v->_mp_size == 0)
+ {
+ r->_mp_size = 0;
+ return;
+ }
+
+ mpz_init (g);
+
+ mpz_gcd (g, u, v);
+ mpz_divexact (g, u, g);
+ mpz_mul (r, g, v);
+
+ mpz_clear (g);
+ mpz_abs (r, r);
+}
+
+void
+mpz_lcm_ui (mpz_t r, const mpz_t u, unsigned long v)
+{
+ if (v == 0 || u->_mp_size == 0)
+ {
+ r->_mp_size = 0;
+ return;
+ }
+
+ v /= mpz_gcd_ui (NULL, u, v);
+ mpz_mul_ui (r, u, v);
+
+ mpz_abs (r, r);
+}
+
+int
+mpz_invert (mpz_t r, const mpz_t u, const mpz_t m)
+{
+ mpz_t g, tr;
+ int invertible;
+
+ if (u->_mp_size == 0 || mpz_cmpabs_ui (m, 1) <= 0)
+ return 0;
+
+ mpz_init (g);
+ mpz_init (tr);
+
+ mpz_gcdext (g, tr, NULL, u, m);
+ invertible = (mpz_cmp_ui (g, 1) == 0);
+
+ if (invertible)
+ {
+ if (tr->_mp_size < 0)
+ {
+ if (m->_mp_size >= 0)
+ mpz_add (tr, tr, m);
+ else
+ mpz_sub (tr, tr, m);
+ }
+ mpz_swap (r, tr);
+ }
+
+ mpz_clear (g);
+ mpz_clear (tr);
+ return invertible;
+}
+
+
+/* Higher level operations (sqrt, pow and root) */
+
+void
+mpz_pow_ui (mpz_t r, const mpz_t b, unsigned long e)
+{
+ unsigned long bit;
+ mpz_t tr;
+ mpz_init_set_ui (tr, 1);
+
+ bit = GMP_ULONG_HIGHBIT;
+ do
+ {
+ mpz_mul (tr, tr, tr);
+ if (e & bit)
+ mpz_mul (tr, tr, b);
+ bit >>= 1;
+ }
+ while (bit > 0);
+
+ mpz_swap (r, tr);
+ mpz_clear (tr);
+}
+
+void
+mpz_ui_pow_ui (mpz_t r, unsigned long blimb, unsigned long e)
+{
+ mpz_t b;
+ mpz_init_set_ui (b, blimb);
+ mpz_pow_ui (r, b, e);
+ mpz_clear (b);
+}
+
+void
+mpz_powm (mpz_t r, const mpz_t b, const mpz_t e, const mpz_t m)
+{
+ mpz_t tr;
+ mpz_t base;
+ mp_size_t en, mn;
+ mp_srcptr mp;
+ struct gmp_div_inverse minv;
+ unsigned shift;
+ mp_ptr tp = NULL;
+
+ en = GMP_ABS (e->_mp_size);
+ mn = GMP_ABS (m->_mp_size);
+ if (mn == 0)
+ gmp_die ("mpz_powm: Zero modulo.");
+
+ if (en == 0)
+ {
+ mpz_set_ui (r, 1);
+ return;
+ }
+
+ mp = m->_mp_d;
+ mpn_div_qr_invert (&minv, mp, mn);
+ shift = minv.shift;
+
+ if (shift > 0)
+ {
+ /* To avoid shifts, we do all our reductions, except the final
+ one, using a *normalized* m. */
+ minv.shift = 0;
+
+ tp = gmp_xalloc_limbs (mn);
+ gmp_assert_nocarry (mpn_lshift (tp, mp, mn, shift));
+ mp = tp;
+ }
+
+ mpz_init (base);
+
+ if (e->_mp_size < 0)
+ {
+ if (!mpz_invert (base, b, m))
+ gmp_die ("mpz_powm: Negative exponent and non-invertible base.");
+ }
+ else
+ {
+ mp_size_t bn;
+ mpz_abs (base, b);
+
+ bn = base->_mp_size;
+ if (bn >= mn)
+ {
+ mpn_div_qr_preinv (NULL, base->_mp_d, base->_mp_size, mp, mn, &minv);
+ bn = mn;
+ }
+
+ /* We have reduced the absolute value. Now take care of the
+ sign. Note that we get zero represented non-canonically as
+ m. */
+ if (b->_mp_size < 0)
+ {
+ mp_ptr bp = MPZ_REALLOC (base, mn);
+ gmp_assert_nocarry (mpn_sub (bp, mp, mn, bp, bn));
+ bn = mn;
+ }
+ base->_mp_size = mpn_normalized_size (base->_mp_d, bn);
+ }
+ mpz_init_set_ui (tr, 1);
+
+ while (en-- > 0)
+ {
+ mp_limb_t w = e->_mp_d[en];
+ mp_limb_t bit;
+
+ bit = GMP_LIMB_HIGHBIT;
+ do
+ {
+ mpz_mul (tr, tr, tr);
+ if (w & bit)
+ mpz_mul (tr, tr, base);
+ if (tr->_mp_size > mn)
+ {
+ mpn_div_qr_preinv (NULL, tr->_mp_d, tr->_mp_size, mp, mn, &minv);
+ tr->_mp_size = mpn_normalized_size (tr->_mp_d, mn);
+ }
+ bit >>= 1;
+ }
+ while (bit > 0);
+ }
+
+ /* Final reduction */
+ if (tr->_mp_size >= mn)
+ {
+ minv.shift = shift;
+ mpn_div_qr_preinv (NULL, tr->_mp_d, tr->_mp_size, mp, mn, &minv);
+ tr->_mp_size = mpn_normalized_size (tr->_mp_d, mn);
+ }
+ if (tp)
+ gmp_free (tp);
+
+ mpz_swap (r, tr);
+ mpz_clear (tr);
+ mpz_clear (base);
+}
+
+void
+mpz_powm_ui (mpz_t r, const mpz_t b, unsigned long elimb, const mpz_t m)
+{
+ mpz_t e;
+ mpz_init_set_ui (e, elimb);
+ mpz_powm (r, b, e, m);
+ mpz_clear (e);
+}
+
+/* x=trunc(y^(1/z)), r=y-x^z */
+void
+mpz_rootrem (mpz_t x, mpz_t r, const mpz_t y, unsigned long z)
+{
+ int sgn;
+ mpz_t t, u;
+
+ sgn = y->_mp_size < 0;
+ if ((~z & sgn) != 0)
+ gmp_die ("mpz_rootrem: Negative argument, with even root.");
+ if (z == 0)
+ gmp_die ("mpz_rootrem: Zeroth root.");
+
+ if (mpz_cmpabs_ui (y, 1) <= 0) {
+ if (x)
+ mpz_set (x, y);
+ if (r)
+ r->_mp_size = 0;
+ return;
+ }
+
+ mpz_init (u);
+ {
+ mp_bitcnt_t tb;
+ tb = mpz_sizeinbase (y, 2) / z + 1;
+ mpz_init2 (t, tb);
+ mpz_setbit (t, tb);
+ }
+
+ if (z == 2) /* simplify sqrt loop: z-1 == 1 */
+ do {
+ mpz_swap (u, t); /* u = x */
+ mpz_tdiv_q (t, y, u); /* t = y/x */
+ mpz_add (t, t, u); /* t = y/x + x */
+ mpz_tdiv_q_2exp (t, t, 1); /* x'= (y/x + x)/2 */
+ } while (mpz_cmpabs (t, u) < 0); /* |x'| < |x| */
+ else /* z != 2 */ {
+ mpz_t v;
+
+ mpz_init (v);
+ if (sgn)
+ mpz_neg (t, t);
+
+ do {
+ mpz_swap (u, t); /* u = x */
+ mpz_pow_ui (t, u, z - 1); /* t = x^(z-1) */
+ mpz_tdiv_q (t, y, t); /* t = y/x^(z-1) */
+ mpz_mul_ui (v, u, z - 1); /* v = x*(z-1) */
+ mpz_add (t, t, v); /* t = y/x^(z-1) + x*(z-1) */
+ mpz_tdiv_q_ui (t, t, z); /* x'=(y/x^(z-1) + x*(z-1))/z */
+ } while (mpz_cmpabs (t, u) < 0); /* |x'| < |x| */
+
+ mpz_clear (v);
+ }
+
+ if (r) {
+ mpz_pow_ui (t, u, z);
+ mpz_sub (r, y, t);
+ }
+ if (x)
+ mpz_swap (x, u);
+ mpz_clear (u);
+ mpz_clear (t);
+}
+
+int
+mpz_root (mpz_t x, const mpz_t y, unsigned long z)
+{
+ int res;
+ mpz_t r;
+
+ mpz_init (r);
+ mpz_rootrem (x, r, y, z);
+ res = r->_mp_size == 0;
+ mpz_clear (r);
+
+ return res;
+}
+
+/* Compute s = floor(sqrt(u)) and r = u - s^2. Allows r == NULL */
+void
+mpz_sqrtrem (mpz_t s, mpz_t r, const mpz_t u)
+{
+ mpz_rootrem (s, r, u, 2);
+}
+
+void
+mpz_sqrt (mpz_t s, const mpz_t u)
+{
+ mpz_rootrem (s, NULL, u, 2);
+}
+
+int
+mpz_perfect_square_p (const mpz_t u)
+{
+ if (u->_mp_size <= 0)
+ return (u->_mp_size == 0);
+ else
+ return mpz_root (NULL, u, 2);
+}
+
+int
+mpn_perfect_square_p (mp_srcptr p, mp_size_t n)
+{
+ mpz_t t;
+
+ assert (n > 0);
+ assert (p [n-1] != 0);
+ return mpz_root (NULL, mpz_roinit_n (t, p, n), 2);
+}
+
+mp_size_t
+mpn_sqrtrem (mp_ptr sp, mp_ptr rp, mp_srcptr p, mp_size_t n)
+{
+ mpz_t s, r, u;
+ mp_size_t res;
+
+ assert (n > 0);
+ assert (p [n-1] != 0);
+
+ mpz_init (r);
+ mpz_init (s);
+ mpz_rootrem (s, r, mpz_roinit_n (u, p, n), 2);
+
+ assert (s->_mp_size == (n+1)/2);
+ mpn_copyd (sp, s->_mp_d, s->_mp_size);
+ mpz_clear (s);
+ res = r->_mp_size;
+ if (rp)
+ mpn_copyd (rp, r->_mp_d, res);
+ mpz_clear (r);
+ return res;
+}
+
+/* Combinatorics */
+
+void
+mpz_fac_ui (mpz_t x, unsigned long n)
+{
+ mpz_set_ui (x, n + (n == 0));
+ for (;n > 2;)
+ mpz_mul_ui (x, x, --n);
+}
+
+void
+mpz_bin_uiui (mpz_t r, unsigned long n, unsigned long k)
+{
+ mpz_t t;
+
+ mpz_set_ui (r, k <= n);
+
+ if (k > (n >> 1))
+ k = (k <= n) ? n - k : 0;
+
+ mpz_init (t);
+ mpz_fac_ui (t, k);
+
+ for (; k > 0; k--)
+ mpz_mul_ui (r, r, n--);
+
+ mpz_divexact (r, r, t);
+ mpz_clear (t);
+}
+
+
+/* Primality testing */
+static int
+gmp_millerrabin (const mpz_t n, const mpz_t nm1, mpz_t y,
+ const mpz_t q, mp_bitcnt_t k)
+{
+ assert (k > 0);
+
+ /* Caller must initialize y to the base. */
+ mpz_powm (y, y, q, n);
+
+ if (mpz_cmp_ui (y, 1) == 0 || mpz_cmp (y, nm1) == 0)
+ return 1;
+
+ while (--k > 0)
+ {
+ mpz_powm_ui (y, y, 2, n);
+ if (mpz_cmp (y, nm1) == 0)
+ return 1;
+ /* y == 1 means that the previous y was a non-trivial square root
+ of 1 (mod n). y == 0 means that n is a power of the base.
+ In either case, n is not prime. */
+ if (mpz_cmp_ui (y, 1) <= 0)
+ return 0;
+ }
+ return 0;
+}
+
+/* This product is 0xc0cfd797, and fits in 32 bits. */
+#define GMP_PRIME_PRODUCT \
+ (3UL*5UL*7UL*11UL*13UL*17UL*19UL*23UL*29UL)
+
+/* Bit (p+1)/2 is set, for each odd prime <= 61 */
+#define GMP_PRIME_MASK 0xc96996dcUL
+
+int
+mpz_probab_prime_p (const mpz_t n, int reps)
+{
+ mpz_t nm1;
+ mpz_t q;
+ mpz_t y;
+ mp_bitcnt_t k;
+ int is_prime;
+ int j;
+
+ /* Note that we use the absolute value of n only, for compatibility
+ with the real GMP. */
+ if (mpz_even_p (n))
+ return (mpz_cmpabs_ui (n, 2) == 0) ? 2 : 0;
+
+ /* Above test excludes n == 0 */
+ assert (n->_mp_size != 0);
+
+ if (mpz_cmpabs_ui (n, 64) < 0)
+ return (GMP_PRIME_MASK >> (n->_mp_d[0] >> 1)) & 2;
+
+ if (mpz_gcd_ui (NULL, n, GMP_PRIME_PRODUCT) != 1)
+ return 0;
+
+ /* All prime factors are >= 31. */
+ 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);
+ k = mpz_scan1 (nm1, 0);
+ mpz_tdiv_q_2exp (q, nm1, k);
+
+ for (j = 0, is_prime = 1; is_prime & (j < reps); j++)
+ {
+ mpz_set_ui (y, (unsigned long) j*j+j+41);
+ if (mpz_cmp (y, nm1) >= 0)
+ {
+ /* Don't try any further bases. This "early" break does not affect
+ the result for any reasonable reps value (<=5000 was tested) */
+ assert (j >= 30);
+ break;
+ }
+ is_prime = gmp_millerrabin (n, nm1, y, q, k);
+ }
+ mpz_clear (nm1);
+ mpz_clear (q);
+ mpz_clear (y);
+
+ return is_prime;
+}
+
+
+/* Logical operations and bit manipulation. */
+
+/* Numbers are treated as if represented in two's complement (and
+ infinitely sign extended). For a negative values we get the two's
+ complement from -x = ~x + 1, where ~ is bitwise complement.
+ Negation transforms
+
+ xxxx10...0
+
+ into
+
+ yyyy10...0
+
+ where yyyy is the bitwise complement of xxxx. So least significant
+ bits, up to and including the first one bit, are unchanged, and
+ the more significant bits are all complemented.
+
+ To change a bit from zero to one in a negative number, subtract the
+ corresponding power of two from the absolute value. This can never
+ underflow. To change a bit from one to zero, add the corresponding
+ power of two, and this might overflow. E.g., if x = -001111, the
+ two's complement is 110001. Clearing the least significant bit, we
+ get two's complement 110000, and -010000. */
+
+int
+mpz_tstbit (const mpz_t d, mp_bitcnt_t bit_index)
+{
+ mp_size_t limb_index;
+ unsigned shift;
+ mp_size_t ds;
+ mp_size_t dn;
+ mp_limb_t w;
+ int bit;
+
+ ds = d->_mp_size;
+ dn = GMP_ABS (ds);
+ limb_index = bit_index / GMP_LIMB_BITS;
+ if (limb_index >= dn)
+ return ds < 0;
+
+ shift = bit_index % GMP_LIMB_BITS;
+ w = d->_mp_d[limb_index];
+ bit = (w >> shift) & 1;
+
+ if (ds < 0)
+ {
+ /* 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)
+ return bit ^ 1;
+ while (limb_index-- > 0)
+ if (d->_mp_d[limb_index] > 0)
+ return bit ^ 1;
+ }
+ return bit;
+}
+
+static void
+mpz_abs_add_bit (mpz_t d, mp_bitcnt_t bit_index)
+{
+ mp_size_t dn, limb_index;
+ mp_limb_t bit;
+ mp_ptr dp;
+
+ dn = GMP_ABS (d->_mp_size);
+
+ limb_index = bit_index / GMP_LIMB_BITS;
+ bit = (mp_limb_t) 1 << (bit_index % GMP_LIMB_BITS);
+
+ if (limb_index >= dn)
+ {
+ mp_size_t i;
+ /* The bit should be set outside of the end of the number.
+ We have to increase the size of the number. */
+ dp = MPZ_REALLOC (d, limb_index + 1);
+
+ dp[limb_index] = bit;
+ for (i = dn; i < limb_index; i++)
+ dp[i] = 0;
+ dn = limb_index + 1;
+ }
+ else
+ {
+ mp_limb_t cy;
+
+ dp = d->_mp_d;
+
+ cy = mpn_add_1 (dp + limb_index, dp + limb_index, dn - limb_index, bit);
+ if (cy > 0)
+ {
+ dp = MPZ_REALLOC (d, dn + 1);
+ dp[dn++] = cy;
+ }
+ }
+
+ d->_mp_size = (d->_mp_size < 0) ? - dn : dn;
+}
+
+static void
+mpz_abs_sub_bit (mpz_t d, mp_bitcnt_t bit_index)
+{
+ mp_size_t dn, limb_index;
+ mp_ptr dp;
+ mp_limb_t bit;
+
+ dn = GMP_ABS (d->_mp_size);
+ dp = d->_mp_d;
+
+ limb_index = bit_index / GMP_LIMB_BITS;
+ bit = (mp_limb_t) 1 << (bit_index % GMP_LIMB_BITS);
+
+ assert (limb_index < dn);
+
+ gmp_assert_nocarry (mpn_sub_1 (dp + limb_index, dp + limb_index,
+ dn - limb_index, bit));
+ dn -= (dp[dn-1] == 0);
+ d->_mp_size = (d->_mp_size < 0) ? - dn : dn;
+}
+
+void
+mpz_setbit (mpz_t d, mp_bitcnt_t bit_index)
+{
+ if (!mpz_tstbit (d, bit_index))
+ {
+ if (d->_mp_size >= 0)
+ mpz_abs_add_bit (d, bit_index);
+ else
+ mpz_abs_sub_bit (d, bit_index);
+ }
+}
+
+void
+mpz_clrbit (mpz_t d, mp_bitcnt_t bit_index)
+{
+ if (mpz_tstbit (d, bit_index))
+ {
+ if (d->_mp_size >= 0)
+ mpz_abs_sub_bit (d, bit_index);
+ else
+ mpz_abs_add_bit (d, bit_index);
+ }
+}
+
+void
+mpz_combit (mpz_t d, mp_bitcnt_t bit_index)
+{
+ if (mpz_tstbit (d, bit_index) ^ (d->_mp_size < 0))
+ mpz_abs_sub_bit (d, bit_index);
+ else
+ mpz_abs_add_bit (d, bit_index);
+}
+
+void
+mpz_com (mpz_t r, const mpz_t u)
+{
+ mpz_neg (r, u);
+ mpz_sub_ui (r, r, 1);
+}
+
+void
+mpz_and (mpz_t r, const mpz_t u, const mpz_t v)
+{
+ mp_size_t un, vn, rn, i;
+ mp_ptr up, vp, rp;
+
+ mp_limb_t ux, vx, rx;
+ mp_limb_t uc, vc, rc;
+ mp_limb_t ul, vl, rl;
+
+ un = GMP_ABS (u->_mp_size);
+ vn = GMP_ABS (v->_mp_size);
+ if (un < vn)
+ {
+ MPZ_SRCPTR_SWAP (u, v);
+ MP_SIZE_T_SWAP (un, vn);
+ }
+ if (vn == 0)
+ {
+ r->_mp_size = 0;
+ return;
+ }
+
+ uc = u->_mp_size < 0;
+ vc = v->_mp_size < 0;
+ rc = uc & vc;
+
+ ux = -uc;
+ vx = -vc;
+ rx = -rc;
+
+ /* If the smaller input is positive, higher limbs don't matter. */
+ rn = vx ? un : vn;
+
+ rp = MPZ_REALLOC (r, rn + rc);
+
+ up = u->_mp_d;
+ vp = v->_mp_d;
+
+ i = 0;
+ do
+ {
+ ul = (up[i] ^ ux) + uc;
+ uc = ul < uc;
+
+ vl = (vp[i] ^ vx) + vc;
+ vc = vl < vc;
+
+ rl = ( (ul & vl) ^ rx) + rc;
+ rc = rl < rc;
+ rp[i] = rl;
+ }
+ while (++i < vn);
+ assert (vc == 0);
+
+ for (; i < rn; i++)
+ {
+ ul = (up[i] ^ ux) + uc;
+ uc = ul < uc;
+
+ rl = ( (ul & vx) ^ rx) + rc;
+ rc = rl < rc;
+ rp[i] = rl;
+ }
+ if (rc)
+ rp[rn++] = rc;
+ else
+ rn = mpn_normalized_size (rp, rn);
+
+ r->_mp_size = rx ? -rn : rn;
+}
+
+void
+mpz_ior (mpz_t r, const mpz_t u, const mpz_t v)
+{
+ mp_size_t un, vn, rn, i;
+ mp_ptr up, vp, rp;
+
+ mp_limb_t ux, vx, rx;
+ mp_limb_t uc, vc, rc;
+ mp_limb_t ul, vl, rl;
+
+ un = GMP_ABS (u->_mp_size);
+ vn = GMP_ABS (v->_mp_size);
+ if (un < vn)
+ {
+ MPZ_SRCPTR_SWAP (u, v);
+ MP_SIZE_T_SWAP (un, vn);
+ }
+ if (vn == 0)
+ {
+ mpz_set (r, u);
+ return;
+ }
+
+ uc = u->_mp_size < 0;
+ vc = v->_mp_size < 0;
+ rc = uc | vc;
+
+ ux = -uc;
+ vx = -vc;
+ rx = -rc;
+
+ /* If the smaller input is negative, by sign extension higher limbs
+ don't matter. */
+ rn = vx ? vn : un;
+
+ rp = MPZ_REALLOC (r, rn + rc);
+
+ up = u->_mp_d;
+ vp = v->_mp_d;
+
+ i = 0;
+ do
+ {
+ ul = (up[i] ^ ux) + uc;
+ uc = ul < uc;
+
+ vl = (vp[i] ^ vx) + vc;
+ vc = vl < vc;
+
+ rl = ( (ul | vl) ^ rx) + rc;
+ rc = rl < rc;
+ rp[i] = rl;
+ }
+ while (++i < vn);
+ assert (vc == 0);
+
+ for (; i < rn; i++)
+ {
+ ul = (up[i] ^ ux) + uc;
+ uc = ul < uc;
+
+ rl = ( (ul | vx) ^ rx) + rc;
+ rc = rl < rc;
+ rp[i] = rl;
+ }
+ if (rc)
+ rp[rn++] = rc;
+ else
+ rn = mpn_normalized_size (rp, rn);
+
+ r->_mp_size = rx ? -rn : rn;
+}
+
+void
+mpz_xor (mpz_t r, const mpz_t u, const mpz_t v)
+{
+ mp_size_t un, vn, i;
+ mp_ptr up, vp, rp;
+
+ mp_limb_t ux, vx, rx;
+ mp_limb_t uc, vc, rc;
+ mp_limb_t ul, vl, rl;
+
+ un = GMP_ABS (u->_mp_size);
+ vn = GMP_ABS (v->_mp_size);
+ if (un < vn)
+ {
+ MPZ_SRCPTR_SWAP (u, v);
+ MP_SIZE_T_SWAP (un, vn);
+ }
+ if (vn == 0)
+ {
+ mpz_set (r, u);
+ return;
+ }
+
+ uc = u->_mp_size < 0;
+ vc = v->_mp_size < 0;
+ rc = uc ^ vc;
+
+ ux = -uc;
+ vx = -vc;
+ rx = -rc;
+
+ rp = MPZ_REALLOC (r, un + rc);
+
+ up = u->_mp_d;
+ vp = v->_mp_d;
+
+ i = 0;
+ do
+ {
+ ul = (up[i] ^ ux) + uc;
+ uc = ul < uc;
+
+ vl = (vp[i] ^ vx) + vc;
+ vc = vl < vc;
+
+ rl = (ul ^ vl ^ rx) + rc;
+ rc = rl < rc;
+ rp[i] = rl;
+ }
+ while (++i < vn);
+ assert (vc == 0);
+
+ for (; i < un; i++)
+ {
+ ul = (up[i] ^ ux) + uc;
+ uc = ul < uc;
+
+ rl = (ul ^ ux) + rc;
+ rc = rl < rc;
+ rp[i] = rl;
+ }
+ if (rc)
+ rp[un++] = rc;
+ else
+ un = mpn_normalized_size (rp, un);
+
+ r->_mp_size = rx ? -un : un;
+}
+
+static unsigned
+gmp_popcount_limb (mp_limb_t x)
+{
+ unsigned c;
+
+ /* Do 16 bits at a time, to avoid limb-sized constants. */
+ for (c = 0; x > 0; x >>= 16)
+ {
+ unsigned w = ((x >> 1) & 0x5555) + (x & 0x5555);
+ w = ((w >> 2) & 0x3333) + (w & 0x3333);
+ w = ((w >> 4) & 0x0f0f) + (w & 0x0f0f);
+ w = (w >> 8) + (w & 0x00ff);
+ c += w;
+ }
+ return c;
+}
+
+mp_bitcnt_t
+mpn_popcount (mp_srcptr p, mp_size_t n)
+{
+ mp_size_t i;
+ mp_bitcnt_t c;
+
+ for (c = 0, i = 0; i < n; i++)
+ c += gmp_popcount_limb (p[i]);
+
+ return c;
+}
+
+mp_bitcnt_t
+mpz_popcount (const mpz_t u)
+{
+ mp_size_t un;
+
+ un = u->_mp_size;
+
+ if (un < 0)
+ return ~(mp_bitcnt_t) 0;
+
+ return mpn_popcount (u->_mp_d, un);
+}
+
+mp_bitcnt_t
+mpz_hamdist (const mpz_t u, const mpz_t v)
+{
+ mp_size_t un, vn, i;
+ mp_limb_t uc, vc, ul, vl, comp;
+ mp_srcptr up, vp;
+ mp_bitcnt_t c;
+
+ un = u->_mp_size;
+ vn = v->_mp_size;
+
+ if ( (un ^ vn) < 0)
+ return ~(mp_bitcnt_t) 0;
+
+ comp = - (uc = vc = (un < 0));
+ if (uc)
+ {
+ assert (vn < 0);
+ un = -un;
+ vn = -vn;
+ }
+
+ up = u->_mp_d;
+ vp = v->_mp_d;
+
+ if (un < vn)
+ MPN_SRCPTR_SWAP (up, un, vp, vn);
+
+ for (i = 0, c = 0; i < vn; i++)
+ {
+ ul = (up[i] ^ comp) + uc;
+ uc = ul < uc;
+
+ vl = (vp[i] ^ comp) + vc;
+ vc = vl < vc;
+
+ c += gmp_popcount_limb (ul ^ vl);
+ }
+ assert (vc == 0);
+
+ for (; i < un; i++)
+ {
+ ul = (up[i] ^ comp) + uc;
+ uc = ul < uc;
+
+ c += gmp_popcount_limb (ul ^ comp);
+ }
+
+ return c;
+}
+
+mp_bitcnt_t
+mpz_scan1 (const mpz_t u, mp_bitcnt_t starting_bit)
+{
+ mp_ptr up;
+ mp_size_t us, un, i;
+ mp_limb_t limb, ux;
+
+ us = u->_mp_size;
+ un = GMP_ABS (us);
+ i = starting_bit / GMP_LIMB_BITS;
+
+ /* Past the end there's no 1 bits for u>=0, or an immediate 1 bit
+ for u<0. Notice this test picks up any u==0 too. */
+ if (i >= un)
+ return (us >= 0 ? ~(mp_bitcnt_t) 0 : starting_bit);
+
+ up = u->_mp_d;
+ ux = 0;
+ limb = up[i];
+
+ if (starting_bit != 0)
+ {
+ if (us < 0)
+ {
+ ux = mpn_zero_p (up, i);
+ limb = ~ limb + ux;
+ ux = - (mp_limb_t) (limb >= ux);
+ }
+
+ /* Mask to 0 all bits before starting_bit, thus ignoring them. */
+ limb &= (GMP_LIMB_MAX << (starting_bit % GMP_LIMB_BITS));
+ }
+
+ return mpn_common_scan (limb, i, up, un, ux);
+}
+
+mp_bitcnt_t
+mpz_scan0 (const mpz_t u, mp_bitcnt_t starting_bit)
+{
+ mp_ptr up;
+ mp_size_t us, un, i;
+ mp_limb_t limb, ux;
+
+ us = u->_mp_size;
+ ux = - (mp_limb_t) (us >= 0);
+ un = GMP_ABS (us);
+ i = starting_bit / GMP_LIMB_BITS;
+
+ /* When past end, there's an immediate 0 bit for u>=0, or no 0 bits for
+ u<0. Notice this test picks up all cases of u==0 too. */
+ if (i >= un)
+ return (ux ? starting_bit : ~(mp_bitcnt_t) 0);
+
+ up = u->_mp_d;
+ limb = up[i] ^ ux;
+
+ if (ux == 0)
+ 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));
+
+ return mpn_common_scan (limb, i, up, un, ux);
+}
+
+
+/* MPZ base conversion. */
+
+size_t
+mpz_sizeinbase (const mpz_t u, int base)
+{
+ mp_size_t un;
+ mp_srcptr up;
+ mp_ptr tp;
+ mp_bitcnt_t bits;
+ struct gmp_div_inverse bi;
+ size_t ndigits;
+
+ assert (base >= 2);
+ assert (base <= 36);
+
+ un = GMP_ABS (u->_mp_size);
+ if (un == 0)
+ return 1;
+
+ up = u->_mp_d;
+
+ bits = (un - 1) * GMP_LIMB_BITS + mpn_limb_size_in_base_2 (up[un-1]);
+ switch (base)
+ {
+ case 2:
+ return bits;
+ case 4:
+ return (bits + 1) / 2;
+ case 8:
+ return (bits + 2) / 3;
+ case 16:
+ return (bits + 3) / 4;
+ case 32:
+ return (bits + 4) / 5;
+ /* FIXME: Do something more clever for the common case of base
+ 10. */
+ }
+
+ tp = gmp_xalloc_limbs (un);
+ mpn_copyi (tp, up, un);
+ mpn_div_qr_1_invert (&bi, base);
+
+ ndigits = 0;
+ do
+ {
+ ndigits++;
+ mpn_div_qr_1_preinv (tp, tp, un, &bi);
+ un -= (tp[un-1] == 0);
+ }
+ while (un > 0);
+
+ gmp_free (tp);
+ return ndigits;
+}
+
+char *
+mpz_get_str (char *sp, int base, const mpz_t u)
+{
+ unsigned bits;
+ const char *digits;
+ mp_size_t un;
+ size_t i, sn;
+
+ if (base >= 0)
+ {
+ digits = "0123456789abcdefghijklmnopqrstuvwxyz";
+ }
+ else
+ {
+ base = -base;
+ digits = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
+ }
+ if (base <= 1)
+ base = 10;
+ if (base > 36)
+ return NULL;
+
+ sn = 1 + mpz_sizeinbase (u, base);
+ if (!sp)
+ sp = gmp_xalloc (1 + sn);
+
+ un = GMP_ABS (u->_mp_size);
+
+ if (un == 0)
+ {
+ sp[0] = '0';
+ sp[1] = '\0';
+ return sp;
+ }
+
+ i = 0;
+
+ if (u->_mp_size < 0)
+ sp[i++] = '-';
+
+ bits = mpn_base_power_of_two_p (base);
+
+ if (bits)
+ /* Not modified in this case. */
+ sn = i + mpn_get_str_bits ((unsigned char *) sp + i, bits, u->_mp_d, un);
+ else
+ {
+ struct mpn_base_info info;
+ mp_ptr tp;
+
+ mpn_get_base_info (&info, base);
+ tp = gmp_xalloc_limbs (un);
+ mpn_copyi (tp, u->_mp_d, un);
+
+ sn = i + mpn_get_str_other ((unsigned char *) sp + i, base, &info, tp, un);
+ gmp_free (tp);
+ }
+
+ for (; i < sn; i++)
+ sp[i] = digits[(unsigned char) sp[i]];
+
+ sp[sn] = '\0';
+ return sp;
+}
+
+int
+mpz_set_str (mpz_t r, const char *sp, int base)
+{
+ unsigned bits;
+ mp_size_t rn, alloc;
+ mp_ptr rp;
+ size_t sn;
+ int sign;
+ unsigned char *dp;
+
+ assert (base == 0 || (base >= 2 && base <= 36));
+
+ while (isspace( (unsigned char) *sp))
+ sp++;
+
+ sign = (*sp == '-');
+ sp += sign;
+
+ if (base == 0)
+ {
+ if (*sp == '0')
+ {
+ sp++;
+ if (*sp == 'x' || *sp == 'X')
+ {
+ base = 16;
+ sp++;
+ }
+ else if (*sp == 'b' || *sp == 'B')
+ {
+ base = 2;
+ sp++;
+ }
+ else
+ base = 8;
+ }
+ else
+ base = 10;
+ }
+
+ sn = strlen (sp);
+ dp = gmp_xalloc (sn + (sn == 0));
+
+ for (sn = 0; *sp; sp++)
+ {
+ unsigned digit;
+
+ if (isspace ((unsigned char) *sp))
+ continue;
+ if (*sp >= '0' && *sp <= '9')
+ digit = *sp - '0';
+ else if (*sp >= 'a' && *sp <= 'z')
+ digit = *sp - 'a' + 10;
+ else if (*sp >= 'A' && *sp <= 'Z')
+ digit = *sp - 'A' + 10;
+ else
+ digit = base; /* fail */
+
+ if (digit >= base)
+ {
+ gmp_free (dp);
+ r->_mp_size = 0;
+ return -1;
+ }
+
+ dp[sn++] = digit;
+ }
+
+ bits = mpn_base_power_of_two_p (base);
+
+ if (bits > 0)
+ {
+ alloc = (sn * bits + GMP_LIMB_BITS - 1) / GMP_LIMB_BITS;
+ rp = MPZ_REALLOC (r, alloc);
+ rn = mpn_set_str_bits (rp, dp, sn, bits);
+ }
+ else
+ {
+ struct mpn_base_info info;
+ mpn_get_base_info (&info, base);
+ alloc = (sn + info.exp - 1) / info.exp;
+ rp = MPZ_REALLOC (r, alloc);
+ rn = mpn_set_str_other (rp, dp, sn, base, &info);
+ }
+ assert (rn <= alloc);
+ gmp_free (dp);
+
+ r->_mp_size = sign ? - rn : rn;
+
+ return 0;
+}
+
+int
+mpz_init_set_str (mpz_t r, const char *sp, int base)
+{
+ mpz_init (r);
+ return mpz_set_str (r, sp, base);
+}
+
+size_t
+mpz_out_str (FILE *stream, int base, const mpz_t x)
+{
+ char *str;
+ size_t len;
+
+ str = mpz_get_str (NULL, base, x);
+ len = strlen (str);
+ len = fwrite (str, 1, len, stream);
+ gmp_free (str);
+ return len;
+}
+
+
+static int
+gmp_detect_endian (void)
+{
+ static const int i = 2;
+ const unsigned char *p = (const unsigned char *) &i;
+ return 1 - *p;
+}
+
+/* Import and export. Does not support nails. */
+void
+mpz_import (mpz_t r, size_t count, int order, size_t size, int endian,
+ size_t nails, const void *src)
+{
+ const unsigned char *p;
+ ptrdiff_t word_step;
+ mp_ptr rp;
+ mp_size_t rn;
+
+ /* The current (partial) limb. */
+ mp_limb_t limb;
+ /* The number of bytes already copied to this limb (starting from
+ the low end). */
+ size_t bytes;
+ /* The index where the limb should be stored, when completed. */
+ mp_size_t i;
+
+ if (nails != 0)
+ gmp_die ("mpz_import: Nails not supported.");
+
+ assert (order == 1 || order == -1);
+ assert (endian >= -1 && endian <= 1);
+
+ if (endian == 0)
+ endian = gmp_detect_endian ();
+
+ p = (unsigned char *) src;
+
+ word_step = (order != endian) ? 2 * size : 0;
+
+ /* Process bytes from the least significant end, so point p at the
+ least significant word. */
+ if (order == 1)
+ {
+ p += size * (count - 1);
+ word_step = - word_step;
+ }
+
+ /* And at least significant byte of that word. */
+ if (endian == 1)
+ p += (size - 1);
+
+ rn = (size * count + sizeof(mp_limb_t) - 1) / sizeof(mp_limb_t);
+ rp = MPZ_REALLOC (r, rn);
+
+ for (limb = 0, bytes = 0, i = 0; count > 0; count--, p += word_step)
+ {
+ size_t j;
+ for (j = 0; j < size; j++, p -= (ptrdiff_t) endian)
+ {
+ limb |= (mp_limb_t) *p << (bytes++ * CHAR_BIT);
+ if (bytes == sizeof(mp_limb_t))
+ {
+ rp[i++] = limb;
+ bytes = 0;
+ limb = 0;
+ }
+ }
+ }
+ assert (i + (bytes > 0) == rn);
+ if (limb != 0)
+ rp[i++] = limb;
+ else
+ i = mpn_normalized_size (rp, i);
+
+ r->_mp_size = i;
+}
+
+void *
+mpz_export (void *r, size_t *countp, int order, size_t size, int endian,
+ size_t nails, const mpz_t u)
+{
+ size_t count;
+ mp_size_t un;
+
+ if (nails != 0)
+ gmp_die ("mpz_import: Nails not supported.");
+
+ assert (order == 1 || order == -1);
+ assert (endian >= -1 && endian <= 1);
+ assert (size > 0 || u->_mp_size == 0);
+
+ un = u->_mp_size;
+ count = 0;
+ if (un != 0)
+ {
+ size_t k;
+ unsigned char *p;
+ ptrdiff_t word_step;
+ /* The current (partial) limb. */
+ mp_limb_t limb;
+ /* The number of bytes left to to in this limb. */
+ size_t bytes;
+ /* The index where the limb was read. */
+ mp_size_t i;
+
+ un = GMP_ABS (un);
+
+ /* Count bytes in top limb. */
+ limb = u->_mp_d[un-1];
+ assert (limb != 0);
+
+ k = 0;
+ do {
+ k++; limb >>= CHAR_BIT;
+ } while (limb != 0);
+
+ count = (k + (un-1) * sizeof (mp_limb_t) + size - 1) / size;
+
+ if (!r)
+ r = gmp_xalloc (count * size);
+
+ if (endian == 0)
+ endian = gmp_detect_endian ();
+
+ p = (unsigned char *) r;
+
+ word_step = (order != endian) ? 2 * size : 0;
+
+ /* Process bytes from the least significant end, so point p at the
+ least significant word. */
+ if (order == 1)
+ {
+ p += size * (count - 1);
+ word_step = - word_step;
+ }
+
+ /* And at least significant byte of that word. */
+ if (endian == 1)
+ p += (size - 1);
+
+ 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)
+ {
+ if (bytes == 0)
+ {
+ if (i < un)
+ limb = u->_mp_d[i++];
+ bytes = sizeof (mp_limb_t);
+ }
+ *p = limb;
+ limb >>= CHAR_BIT;
+ bytes--;
+ }
+ }
+ assert (i == un);
+ assert (k == count);
+ }
+
+ if (countp)
+ *countp = count;
+
+ return r;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mini-gmp/mini-gmp.h b/Build/source/libs/gmp/gmp-6.0.0/mini-gmp/mini-gmp.h
new file mode 100644
index 00000000000..c043ca7e661
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mini-gmp/mini-gmp.h
@@ -0,0 +1,294 @@
+/* mini-gmp, a minimalistic implementation of a GNU GMP subset.
+
+Copyright 2011-2014 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/. */
+
+/* About mini-gmp: This is a minimal implementation of a subset of the
+ GMP interface. It is intended for inclusion into applications which
+ have modest bignums needs, as a fallback when the real GMP library
+ is not installed.
+
+ This file defines the public interface. */
+
+#ifndef __MINI_GMP_H__
+#define __MINI_GMP_H__
+
+/* For size_t */
+#include <stddef.h>
+
+#if defined (__cplusplus)
+extern "C" {
+#endif
+
+void mp_set_memory_functions (void *(*) (size_t),
+ void *(*) (void *, size_t, size_t),
+ void (*) (void *, size_t));
+
+void mp_get_memory_functions (void *(**) (size_t),
+ void *(**) (void *, size_t, size_t),
+ void (**) (void *, size_t));
+
+typedef unsigned long mp_limb_t;
+typedef long mp_size_t;
+typedef unsigned long mp_bitcnt_t;
+
+typedef mp_limb_t *mp_ptr;
+typedef const mp_limb_t *mp_srcptr;
+
+typedef struct
+{
+ int _mp_alloc; /* Number of *limbs* allocated and pointed
+ to by the _mp_d field. */
+ int _mp_size; /* abs(_mp_size) is the number of limbs the
+ last field points to. If _mp_size is
+ negative this is a negative number. */
+ mp_limb_t *_mp_d; /* Pointer to the limbs. */
+} __mpz_struct;
+
+typedef __mpz_struct mpz_t[1];
+
+typedef __mpz_struct *mpz_ptr;
+typedef const __mpz_struct *mpz_srcptr;
+
+extern const int mp_bits_per_limb;
+
+void mpn_copyi (mp_ptr, mp_srcptr, mp_size_t);
+void mpn_copyd (mp_ptr, mp_srcptr, mp_size_t);
+void mpn_zero (mp_ptr, mp_size_t);
+
+int mpn_cmp (mp_srcptr, mp_srcptr, mp_size_t);
+
+mp_limb_t mpn_add_1 (mp_ptr, mp_srcptr, mp_size_t, mp_limb_t);
+mp_limb_t mpn_add_n (mp_ptr, mp_srcptr, mp_srcptr, mp_size_t);
+mp_limb_t mpn_add (mp_ptr, mp_srcptr, mp_size_t, mp_srcptr, mp_size_t);
+
+mp_limb_t mpn_sub_1 (mp_ptr, mp_srcptr, mp_size_t, mp_limb_t);
+mp_limb_t mpn_sub_n (mp_ptr, mp_srcptr, mp_srcptr, mp_size_t);
+mp_limb_t mpn_sub (mp_ptr, mp_srcptr, mp_size_t, mp_srcptr, mp_size_t);
+
+mp_limb_t mpn_mul_1 (mp_ptr, mp_srcptr, mp_size_t, mp_limb_t);
+mp_limb_t mpn_addmul_1 (mp_ptr, mp_srcptr, mp_size_t, mp_limb_t);
+mp_limb_t mpn_submul_1 (mp_ptr, mp_srcptr, mp_size_t, mp_limb_t);
+
+mp_limb_t mpn_mul (mp_ptr, mp_srcptr, mp_size_t, mp_srcptr, mp_size_t);
+void mpn_mul_n (mp_ptr, mp_srcptr, mp_srcptr, mp_size_t);
+void mpn_sqr (mp_ptr, mp_srcptr, mp_size_t);
+int mpn_perfect_square_p (mp_srcptr, mp_size_t);
+mp_size_t mpn_sqrtrem (mp_ptr, mp_ptr, mp_srcptr, mp_size_t);
+
+mp_limb_t mpn_lshift (mp_ptr, mp_srcptr, mp_size_t, unsigned int);
+mp_limb_t mpn_rshift (mp_ptr, mp_srcptr, mp_size_t, unsigned int);
+
+mp_bitcnt_t mpn_scan0 (mp_srcptr, mp_bitcnt_t);
+mp_bitcnt_t mpn_scan1 (mp_srcptr, mp_bitcnt_t);
+
+mp_bitcnt_t mpn_popcount (mp_srcptr, mp_size_t);
+
+mp_limb_t mpn_invert_3by2 (mp_limb_t, mp_limb_t);
+#define mpn_invert_limb(x) mpn_invert_3by2 ((x), 0)
+
+size_t mpn_get_str (unsigned char *, int, mp_ptr, mp_size_t);
+mp_size_t mpn_set_str (mp_ptr, const unsigned char *, size_t, int);
+
+void mpz_init (mpz_t);
+void mpz_init2 (mpz_t, mp_bitcnt_t);
+void mpz_clear (mpz_t);
+
+#define mpz_odd_p(z) (((z)->_mp_size != 0) & (int) (z)->_mp_d[0])
+#define mpz_even_p(z) (! mpz_odd_p (z))
+
+int mpz_sgn (const mpz_t);
+int mpz_cmp_si (const mpz_t, long);
+int mpz_cmp_ui (const mpz_t, unsigned long);
+int mpz_cmp (const mpz_t, const mpz_t);
+int mpz_cmpabs_ui (const mpz_t, unsigned long);
+int mpz_cmpabs (const mpz_t, const mpz_t);
+int mpz_cmp_d (const mpz_t, double);
+int mpz_cmpabs_d (const mpz_t, double);
+
+void mpz_abs (mpz_t, const mpz_t);
+void mpz_neg (mpz_t, const mpz_t);
+void mpz_swap (mpz_t, mpz_t);
+
+void mpz_add_ui (mpz_t, const mpz_t, unsigned long);
+void mpz_add (mpz_t, const mpz_t, const mpz_t);
+void mpz_sub_ui (mpz_t, const mpz_t, unsigned long);
+void mpz_ui_sub (mpz_t, unsigned long, const mpz_t);
+void mpz_sub (mpz_t, const mpz_t, const mpz_t);
+
+void mpz_mul_si (mpz_t, const mpz_t, long int);
+void mpz_mul_ui (mpz_t, const mpz_t, unsigned long int);
+void mpz_mul (mpz_t, const mpz_t, const mpz_t);
+void mpz_mul_2exp (mpz_t, const mpz_t, mp_bitcnt_t);
+void mpz_addmul_ui (mpz_t, const mpz_t, unsigned long int);
+void mpz_addmul (mpz_t, const mpz_t, const mpz_t);
+void mpz_submul_ui (mpz_t, const mpz_t, unsigned long int);
+void mpz_submul (mpz_t, const mpz_t, const mpz_t);
+
+void mpz_cdiv_qr (mpz_t, mpz_t, const mpz_t, const mpz_t);
+void mpz_fdiv_qr (mpz_t, mpz_t, const mpz_t, const mpz_t);
+void mpz_tdiv_qr (mpz_t, mpz_t, const mpz_t, const mpz_t);
+void mpz_cdiv_q (mpz_t, const mpz_t, const mpz_t);
+void mpz_fdiv_q (mpz_t, const mpz_t, const mpz_t);
+void mpz_tdiv_q (mpz_t, const mpz_t, const mpz_t);
+void mpz_cdiv_r (mpz_t, const mpz_t, const mpz_t);
+void mpz_fdiv_r (mpz_t, const mpz_t, const mpz_t);
+void mpz_tdiv_r (mpz_t, const mpz_t, const mpz_t);
+
+void mpz_cdiv_q_2exp (mpz_t, const mpz_t, mp_bitcnt_t);
+void mpz_fdiv_q_2exp (mpz_t, const mpz_t, mp_bitcnt_t);
+void mpz_tdiv_q_2exp (mpz_t, const mpz_t, mp_bitcnt_t);
+void mpz_cdiv_r_2exp (mpz_t, const mpz_t, mp_bitcnt_t);
+void mpz_fdiv_r_2exp (mpz_t, const mpz_t, mp_bitcnt_t);
+void mpz_tdiv_r_2exp (mpz_t, const mpz_t, mp_bitcnt_t);
+
+void mpz_mod (mpz_t, const mpz_t, const mpz_t);
+
+void mpz_divexact (mpz_t, const mpz_t, const mpz_t);
+
+int mpz_divisible_p (const mpz_t, const mpz_t);
+int mpz_congruent_p (const mpz_t, const mpz_t, const mpz_t);
+
+unsigned long mpz_cdiv_qr_ui (mpz_t, mpz_t, const mpz_t, unsigned long);
+unsigned long mpz_fdiv_qr_ui (mpz_t, mpz_t, const mpz_t, unsigned long);
+unsigned long mpz_tdiv_qr_ui (mpz_t, mpz_t, const mpz_t, unsigned long);
+unsigned long mpz_cdiv_q_ui (mpz_t, const mpz_t, unsigned long);
+unsigned long mpz_fdiv_q_ui (mpz_t, const mpz_t, unsigned long);
+unsigned long mpz_tdiv_q_ui (mpz_t, const mpz_t, unsigned long);
+unsigned long mpz_cdiv_r_ui (mpz_t, const mpz_t, unsigned long);
+unsigned long mpz_fdiv_r_ui (mpz_t, const mpz_t, unsigned long);
+unsigned long mpz_tdiv_r_ui (mpz_t, const mpz_t, unsigned long);
+unsigned long mpz_cdiv_ui (const mpz_t, unsigned long);
+unsigned long mpz_fdiv_ui (const mpz_t, unsigned long);
+unsigned long mpz_tdiv_ui (const mpz_t, unsigned long);
+
+unsigned long mpz_mod_ui (mpz_t, const mpz_t, unsigned long);
+
+void mpz_divexact_ui (mpz_t, const mpz_t, unsigned long);
+
+int mpz_divisible_ui_p (const mpz_t, unsigned long);
+
+unsigned long mpz_gcd_ui (mpz_t, const mpz_t, unsigned long);
+void mpz_gcd (mpz_t, const mpz_t, const mpz_t);
+void mpz_gcdext (mpz_t, mpz_t, mpz_t, const mpz_t, const mpz_t);
+void mpz_lcm_ui (mpz_t, const mpz_t, unsigned long);
+void mpz_lcm (mpz_t, const mpz_t, const mpz_t);
+int mpz_invert (mpz_t, const mpz_t, const mpz_t);
+
+void mpz_sqrtrem (mpz_t, mpz_t, const mpz_t);
+void mpz_sqrt (mpz_t, const mpz_t);
+int mpz_perfect_square_p (const mpz_t);
+
+void mpz_pow_ui (mpz_t, const mpz_t, unsigned long);
+void mpz_ui_pow_ui (mpz_t, unsigned long, unsigned long);
+void mpz_powm (mpz_t, const mpz_t, const mpz_t, const mpz_t);
+void mpz_powm_ui (mpz_t, const mpz_t, unsigned long, const mpz_t);
+
+void mpz_rootrem (mpz_t, mpz_t, const mpz_t, unsigned long);
+int mpz_root (mpz_t, const mpz_t, unsigned long);
+
+void mpz_fac_ui (mpz_t, unsigned long);
+void mpz_bin_uiui (mpz_t, unsigned long, unsigned long);
+
+int mpz_probab_prime_p (const mpz_t, int);
+
+int mpz_tstbit (const mpz_t, mp_bitcnt_t);
+void mpz_setbit (mpz_t, mp_bitcnt_t);
+void mpz_clrbit (mpz_t, mp_bitcnt_t);
+void mpz_combit (mpz_t, mp_bitcnt_t);
+
+void mpz_com (mpz_t, const mpz_t);
+void mpz_and (mpz_t, const mpz_t, const mpz_t);
+void mpz_ior (mpz_t, const mpz_t, const mpz_t);
+void mpz_xor (mpz_t, const mpz_t, const mpz_t);
+
+mp_bitcnt_t mpz_popcount (const mpz_t);
+mp_bitcnt_t mpz_hamdist (const mpz_t, const mpz_t);
+mp_bitcnt_t mpz_scan0 (const mpz_t, mp_bitcnt_t);
+mp_bitcnt_t mpz_scan1 (const mpz_t, mp_bitcnt_t);
+
+int mpz_fits_slong_p (const mpz_t);
+int mpz_fits_ulong_p (const mpz_t);
+long int mpz_get_si (const mpz_t);
+unsigned long int mpz_get_ui (const mpz_t);
+double mpz_get_d (const mpz_t);
+size_t mpz_size (const mpz_t);
+mp_limb_t mpz_getlimbn (const mpz_t, mp_size_t);
+
+void mpz_realloc2 (mpz_t, mp_bitcnt_t);
+mp_srcptr mpz_limbs_read (mpz_srcptr);
+mp_ptr mpz_limbs_modify (mpz_t, mp_size_t);
+mp_ptr mpz_limbs_write (mpz_t, mp_size_t);
+void mpz_limbs_finish (mpz_t, mp_size_t);
+mpz_srcptr mpz_roinit_n (mpz_t, mp_srcptr, mp_size_t);
+
+#define MPZ_ROINIT_N(xp, xs) {{0, (xs),(xp) }}
+
+void mpz_set_si (mpz_t, signed long int);
+void mpz_set_ui (mpz_t, unsigned long int);
+void mpz_set (mpz_t, const mpz_t);
+void mpz_set_d (mpz_t, double);
+
+void mpz_init_set_si (mpz_t, signed long int);
+void mpz_init_set_ui (mpz_t, unsigned long int);
+void mpz_init_set (mpz_t, const mpz_t);
+void mpz_init_set_d (mpz_t, double);
+
+size_t mpz_sizeinbase (const mpz_t, int);
+char *mpz_get_str (char *, int, const mpz_t);
+int mpz_set_str (mpz_t, const char *, int);
+int mpz_init_set_str (mpz_t, const char *, int);
+
+/* 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 mpz_out_str (FILE *, int, const mpz_t);
+#endif
+
+void mpz_import (mpz_t, size_t, int, size_t, int, size_t, const void *);
+void *mpz_export (void *, size_t *, int, size_t, int, size_t, const mpz_t);
+
+#if defined (__cplusplus)
+}
+#endif
+#endif /* __MINI_GMP_H__ */
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mp_bpl.c b/Build/source/libs/gmp/gmp-6.0.0/mp_bpl.c
new file mode 100644
index 00000000000..6328057965d
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mp_bpl.c
@@ -0,0 +1,35 @@
+/*
+Copyright 1996 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.h"
+#include "gmp-impl.h"
+
+const int mp_bits_per_limb = GMP_LIMB_BITS;
+const int __gmp_0 = 0;
+int __gmp_junk;
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mp_clz_tab.c b/Build/source/libs/gmp/gmp-6.0.0/mp_clz_tab.c
new file mode 100644
index 00000000000..7c9227e8b32
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mp_clz_tab.c
@@ -0,0 +1,49 @@
+/* __clz_tab -- support for longlong.h
+
+ THE CONTENTS OF THIS FILE ARE FOR INTERNAL USE AND MAY CHANGE
+ INCOMPATIBLY OR DISAPPEAR IN A FUTURE GNU MP RELEASE.
+
+Copyright 1991, 1993, 1994, 1996, 1997, 2000, 2001 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.h"
+#include "gmp-impl.h"
+#include "longlong.h"
+
+#ifdef COUNT_LEADING_ZEROS_NEED_CLZ_TAB
+const
+unsigned char __clz_tab[129] =
+{
+ 1,2,3,3,4,4,4,4,5,5,5,5,5,5,5,5,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,
+ 7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+ 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,
+ 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,
+ 9
+};
+#endif
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mp_dv_tab.c b/Build/source/libs/gmp/gmp-6.0.0/mp_dv_tab.c
new file mode 100644
index 00000000000..c6d74eb3f29
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mp_dv_tab.c
@@ -0,0 +1,78 @@
+/* __gmp_digit_value_tab -- support for mp*_set_str
+
+ THE CONTENTS OF THIS FILE ARE FOR INTERNAL USE AND MAY CHANGE
+ INCOMPATIBLY OR DISAPPEAR IN A FUTURE GNU MP RELEASE.
+
+Copyright 2003, 2013 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.h"
+#include "gmp-impl.h"
+
+/* Table to be indexed by character, to get its numerical value. Assumes ASCII
+ character set.
+
+ First part of table supports common usages, where 'A' and 'a' have the same
+ value; this supports bases 2..36
+
+ At offset 208, values for bases 37..62 start. Here, 'A' has the value 10
+ (in decimal) and 'a' has the value 36. */
+
+#define X 0xff
+const unsigned char __gmp_digit_value_tab[] =
+{
+ X, X, X, X, X, X, X, X, X, X, X, X, X, X, X, X,
+ X, X, X, X, X, X, X, X, X, X, X, X, X, X, X, X,
+ X, X, X, X, X, X, X, X, X, X, X, X, X, X, X, X,
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, X, X, X, X, X, X,
+ X,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,
+ 25,26,27,28,29,30,31,32,33,34,35,X, X, X, X, X,
+ X,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,
+ 25,26,27,28,29,30,31,32,33,34,35,X, X, X, X, X,
+ X, X, X, X, X, X, X, X, X, X, X, X, X, X, X, X,
+ X, X, X, X, X, X, X, X, X, X, X, X, X, X, X, X,
+ X, X, X, X, X, X, X, X, X, X, X, X, X, X, X, X,
+ X, X, X, X, X, X, X, X, X, X, X, X, X, X, X, X,
+ X, X, X, X, X, X, X, X, X, X, X, X, X, X, X, X,
+ X, X, X, X, X, X, X, X, X, X, X, X, X, X, X, X,
+ X, X, X, X, X, X, X, X, X, X, X, X, X, X, X, X,
+ X, X, X, X, X, X, X, X, X, X, X, X, X, X, X, X,
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, X, X, X, X, X, X,
+ X,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,
+ 25,26,27,28,29,30,31,32,33,34,35,X, X, X, X, X,
+ X,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,
+ 51,52,53,54,55,56,57,58,59,60,61,X, X, X, X, X,
+ X, X, X, X, X, X, X, X, X, X, X, X, X, X, X, X,
+ X, X, X, X, X, X, X, X, X, X, X, X, X, X, X, X,
+ X, X, X, X, X, X, X, X, X, X, X, X, X, X, X, X,
+ X, X, X, X, X, X, X, X, X, X, X, X, X, X, X, X,
+ X, X, X, X, X, X, X, X, X, X, X, X, X, X, X, X,
+ X, X, X, X, X, X, X, X, X, X, X, X, X, X, X, X,
+ X, X, X, X, X, X, X, X, X, X, X, X, X, X, X, X,
+ X, X, X, X, X, X, X, X, X, X, X, X, X, X, X, X
+};
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mp_get_fns.c b/Build/source/libs/gmp/gmp-6.0.0/mp_get_fns.c
new file mode 100644
index 00000000000..c77980fbeb6
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mp_get_fns.c
@@ -0,0 +1,48 @@
+/* mp_get_memory_functions -- Get the allocate, reallocate, and free functions.
+
+Copyright 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/. */
+
+#include <stdio.h> /* for NULL */
+#include "gmp.h"
+#include "gmp-impl.h"
+
+void
+mp_get_memory_functions (void *(**alloc_func) (size_t),
+ void *(**realloc_func) (void *, size_t, size_t),
+ void (**free_func) (void *, size_t)) __GMP_NOTHROW
+{
+ if (alloc_func != NULL)
+ *alloc_func = __gmp_allocate_func;
+
+ if (realloc_func != NULL)
+ *realloc_func = __gmp_reallocate_func;
+
+ if (free_func != NULL)
+ *free_func = __gmp_free_func;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mp_minv_tab.c b/Build/source/libs/gmp/gmp-6.0.0/mp_minv_tab.c
new file mode 100644
index 00000000000..522bd0184bf
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mp_minv_tab.c
@@ -0,0 +1,59 @@
+/* A table of data supporting binvert_limb().
+
+ THE CONTENTS OF THIS FILE ARE FOR INTERNAL USE AND MAY CHANGE
+ INCOMPATIBLY OR DISAPPEAR IN A FUTURE GNU MP RELEASE. */
+
+/*
+Copyright 2000 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.h"
+#include "gmp-impl.h"
+
+
+/* binvert_limb_table[i] is the multiplicative inverse of 2*i+1 mod 256,
+ ie. (binvert_limb_table[i] * (2*i+1)) % 256 == 1 */
+
+const unsigned char binvert_limb_table[128] = {
+ 0x01, 0xAB, 0xCD, 0xB7, 0x39, 0xA3, 0xC5, 0xEF,
+ 0xF1, 0x1B, 0x3D, 0xA7, 0x29, 0x13, 0x35, 0xDF,
+ 0xE1, 0x8B, 0xAD, 0x97, 0x19, 0x83, 0xA5, 0xCF,
+ 0xD1, 0xFB, 0x1D, 0x87, 0x09, 0xF3, 0x15, 0xBF,
+ 0xC1, 0x6B, 0x8D, 0x77, 0xF9, 0x63, 0x85, 0xAF,
+ 0xB1, 0xDB, 0xFD, 0x67, 0xE9, 0xD3, 0xF5, 0x9F,
+ 0xA1, 0x4B, 0x6D, 0x57, 0xD9, 0x43, 0x65, 0x8F,
+ 0x91, 0xBB, 0xDD, 0x47, 0xC9, 0xB3, 0xD5, 0x7F,
+ 0x81, 0x2B, 0x4D, 0x37, 0xB9, 0x23, 0x45, 0x6F,
+ 0x71, 0x9B, 0xBD, 0x27, 0xA9, 0x93, 0xB5, 0x5F,
+ 0x61, 0x0B, 0x2D, 0x17, 0x99, 0x03, 0x25, 0x4F,
+ 0x51, 0x7B, 0x9D, 0x07, 0x89, 0x73, 0x95, 0x3F,
+ 0x41, 0xEB, 0x0D, 0xF7, 0x79, 0xE3, 0x05, 0x2F,
+ 0x31, 0x5B, 0x7D, 0xE7, 0x69, 0x53, 0x75, 0x1F,
+ 0x21, 0xCB, 0xED, 0xD7, 0x59, 0xC3, 0xE5, 0x0F,
+ 0x11, 0x3B, 0x5D, 0xC7, 0x49, 0x33, 0x55, 0xFF
+};
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mp_set_fns.c b/Build/source/libs/gmp/gmp-6.0.0/mp_set_fns.c
new file mode 100644
index 00000000000..7be60066b9f
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mp_set_fns.c
@@ -0,0 +1,50 @@
+/* mp_set_memory_functions -- Set the allocate, reallocate, and free functions
+ for use by the mp package.
+
+Copyright 1991, 1993, 1994, 2000, 2001 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.h"
+#include "gmp-impl.h"
+
+void
+mp_set_memory_functions (void *(*alloc_func) (size_t),
+ void *(*realloc_func) (void *, size_t, size_t),
+ void (*free_func) (void *, size_t)) __GMP_NOTHROW
+{
+ if (alloc_func == 0)
+ alloc_func = __gmp_default_allocate;
+ if (realloc_func == 0)
+ realloc_func = __gmp_default_reallocate;
+ if (free_func == 0)
+ free_func = __gmp_default_free;
+
+ __gmp_allocate_func = alloc_func;
+ __gmp_reallocate_func = realloc_func;
+ __gmp_free_func = free_func;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpf/Makefile.am b/Build/source/libs/gmp/gmp-6.0.0/mpf/Makefile.am
new file mode 100644
index 00000000000..30b0ea8f5f2
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpf/Makefile.am
@@ -0,0 +1,47 @@
+## Process this file with automake to generate Makefile.in
+
+# Copyright 1996, 1998-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/.
+
+
+INCLUDES = -D__GMP_WITHIN_GMP -I$(top_srcdir)
+
+noinst_LTLIBRARIES = libmpf.la
+libmpf_la_SOURCES = \
+ init.c init2.c inits.c set.c set_ui.c set_si.c set_str.c set_d.c set_z.c \
+ set_q.c iset.c iset_ui.c iset_si.c iset_str.c iset_d.c clear.c clears.c \
+ get_str.c dump.c size.c eq.c reldiff.c sqrt.c random2.c inp_str.c out_str.c \
+ add.c add_ui.c sub.c sub_ui.c ui_sub.c mul.c mul_ui.c div.c div_ui.c \
+ cmp.c cmp_d.c cmp_si.c cmp_ui.c mul_2exp.c div_2exp.c abs.c neg.c get_d.c \
+ get_d_2exp.c set_dfl_prec.c set_prc.c set_prc_raw.c get_dfl_prec.c get_prc.c \
+ ui_div.c sqrt_ui.c \
+ pow_ui.c urandomb.c swap.c get_si.c get_ui.c int_p.c \
+ ceilfloor.c trunc.c \
+ fits_sint.c fits_slong.c fits_sshort.c \
+ fits_uint.c fits_ulong.c fits_ushort.c \
+ fits_s.h fits_u.h
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpf/abs.c b/Build/source/libs/gmp/gmp-6.0.0/mpf/abs.c
new file mode 100644
index 00000000000..a2bde2a4f85
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpf/abs.c
@@ -0,0 +1,59 @@
+/* mpf_abs -- Compute the absolute value of a float.
+
+Copyright 1993-1995, 2001 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.h"
+#include "gmp-impl.h"
+
+void
+mpf_abs (mpf_ptr r, mpf_srcptr u)
+{
+ mp_size_t size;
+
+ size = ABS (u->_mp_size);
+ if (r != u)
+ {
+ mp_size_t prec;
+ mp_ptr rp, up;
+
+ prec = r->_mp_prec + 1; /* lie not to lose precision in assignment */
+ rp = r->_mp_d;
+ up = u->_mp_d;
+
+ if (size > prec)
+ {
+ up += size - prec;
+ size = prec;
+ }
+
+ MPN_COPY (rp, up, size);
+ r->_mp_exp = u->_mp_exp;
+ }
+ r->_mp_size = size;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpf/add.c b/Build/source/libs/gmp/gmp-6.0.0/mpf/add.c
new file mode 100644
index 00000000000..d2a5c097c57
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpf/add.c
@@ -0,0 +1,184 @@
+/* mpf_add -- Add two floats.
+
+Copyright 1993, 1994, 1996, 2000, 2001, 2005 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.h"
+#include "gmp-impl.h"
+
+void
+mpf_add (mpf_ptr r, mpf_srcptr u, mpf_srcptr v)
+{
+ mp_srcptr up, vp;
+ mp_ptr rp, tp;
+ mp_size_t usize, vsize, rsize;
+ mp_size_t prec;
+ mp_exp_t uexp;
+ mp_size_t ediff;
+ mp_limb_t cy;
+ int negate;
+ TMP_DECL;
+
+ usize = u->_mp_size;
+ vsize = v->_mp_size;
+
+ /* Handle special cases that don't work in generic code below. */
+ if (usize == 0)
+ {
+ set_r_v_maybe:
+ if (r != v)
+ mpf_set (r, v);
+ return;
+ }
+ if (vsize == 0)
+ {
+ v = u;
+ goto set_r_v_maybe;
+ }
+
+ /* If signs of U and V are different, perform subtraction. */
+ if ((usize ^ vsize) < 0)
+ {
+ __mpf_struct v_negated;
+ v_negated._mp_size = -vsize;
+ v_negated._mp_exp = v->_mp_exp;
+ v_negated._mp_d = v->_mp_d;
+ mpf_sub (r, u, &v_negated);
+ return;
+ }
+
+ TMP_MARK;
+
+ /* Signs are now known to be the same. */
+ negate = usize < 0;
+
+ /* Make U be the operand with the largest exponent. */
+ if (u->_mp_exp < v->_mp_exp)
+ {
+ mpf_srcptr t;
+ t = u; u = v; v = t;
+ usize = u->_mp_size;
+ vsize = v->_mp_size;
+ }
+
+ usize = ABS (usize);
+ vsize = ABS (vsize);
+ up = u->_mp_d;
+ vp = v->_mp_d;
+ rp = r->_mp_d;
+ prec = r->_mp_prec;
+ uexp = u->_mp_exp;
+ ediff = u->_mp_exp - v->_mp_exp;
+
+ /* If U extends beyond PREC, ignore the part that does. */
+ if (usize > prec)
+ {
+ up += usize - prec;
+ usize = prec;
+ }
+
+ /* If V extends beyond PREC, ignore the part that does.
+ Note that this may make vsize negative. */
+ if (vsize + ediff > prec)
+ {
+ vp += vsize + ediff - prec;
+ vsize = prec - ediff;
+ }
+
+#if 0
+ /* Locate the least significant non-zero limb in (the needed parts
+ of) U and V, to simplify the code below. */
+ while (up[0] == 0)
+ up++, usize--;
+ while (vp[0] == 0)
+ vp++, vsize--;
+#endif
+
+ /* Allocate temp space for the result. Allocate
+ just vsize + ediff later??? */
+ tp = TMP_ALLOC_LIMBS (prec);
+
+ if (ediff >= prec)
+ {
+ /* V completely cancelled. */
+ if (rp != up)
+ MPN_COPY_INCR (rp, up, usize);
+ rsize = usize;
+ }
+ else
+ {
+ /* uuuu | uuuu | uuuu | uuuu | uuuu */
+ /* vvvvvvv | vv | vvvvv | v | vv */
+
+ if (usize > ediff)
+ {
+ /* U and V partially overlaps. */
+ if (vsize + ediff <= usize)
+ {
+ /* uuuu */
+ /* v */
+ mp_size_t size;
+ size = usize - ediff - vsize;
+ MPN_COPY (tp, up, size);
+ cy = mpn_add (tp + size, up + size, usize - size, vp, vsize);
+ rsize = usize;
+ }
+ else
+ {
+ /* uuuu */
+ /* vvvvv */
+ mp_size_t size;
+ size = vsize + ediff - usize;
+ MPN_COPY (tp, vp, size);
+ cy = mpn_add (tp + size, up, usize, vp + size, usize - ediff);
+ rsize = vsize + ediff;
+ }
+ }
+ else
+ {
+ /* uuuu */
+ /* vv */
+ mp_size_t size;
+ size = vsize + ediff - usize;
+ MPN_COPY (tp, vp, vsize);
+ MPN_ZERO (tp + vsize, ediff - usize);
+ MPN_COPY (tp + size, up, usize);
+ cy = 0;
+ rsize = size + usize;
+ }
+
+ MPN_COPY (rp, tp, rsize);
+ rp[rsize] = cy;
+ rsize += cy;
+ uexp += cy;
+ }
+
+ r->_mp_size = negate ? -rsize : rsize;
+ r->_mp_exp = uexp;
+ TMP_FREE;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpf/add_ui.c b/Build/source/libs/gmp/gmp-6.0.0/mpf/add_ui.c
new file mode 100644
index 00000000000..b1e57d04c1e
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpf/add_ui.c
@@ -0,0 +1,153 @@
+/* mpf_add_ui -- Add a float and an unsigned integer.
+
+Copyright 1993, 1994, 1996, 2000, 2001 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.h"
+#include "gmp-impl.h"
+
+void
+mpf_add_ui (mpf_ptr sum, mpf_srcptr u, unsigned long int v)
+{
+ mp_srcptr up = u->_mp_d;
+ mp_ptr sump = sum->_mp_d;
+ mp_size_t usize, sumsize;
+ mp_size_t prec = sum->_mp_prec;
+ mp_exp_t uexp = u->_mp_exp;
+
+ usize = u->_mp_size;
+ if (usize <= 0)
+ {
+ if (usize == 0)
+ {
+ mpf_set_ui (sum, v);
+ return;
+ }
+ else
+ {
+ __mpf_struct u_negated;
+ u_negated._mp_size = -usize;
+ u_negated._mp_exp = u->_mp_exp;
+ u_negated._mp_d = u->_mp_d;
+ mpf_sub_ui (sum, &u_negated, v);
+ sum->_mp_size = -(sum->_mp_size);
+ return;
+ }
+ }
+
+ if (v == 0)
+ {
+ sum_is_u:
+ if (u != sum)
+ {
+ sumsize = MIN (usize, prec + 1);
+ MPN_COPY (sum->_mp_d, up + usize - sumsize, sumsize);
+ sum->_mp_size = sumsize;
+ sum->_mp_exp = u->_mp_exp;
+ }
+ return;
+ }
+
+ if (uexp > 0)
+ {
+ /* U >= 1. */
+ if (uexp > prec)
+ {
+ /* U >> V, V is not part of final result. */
+ goto sum_is_u;
+ }
+ else
+ {
+ /* U's "limb point" is somewhere between the first limb
+ and the PREC:th limb.
+ Both U and V are part of the final result. */
+ if (uexp > usize)
+ {
+ /* uuuuuu0000. */
+ /* + v. */
+ /* We begin with moving U to the top of SUM, to handle
+ samevar(U,SUM). */
+ MPN_COPY_DECR (sump + uexp - usize, up, usize);
+ sump[0] = v;
+ MPN_ZERO (sump + 1, uexp - usize - 1);
+#if 0 /* What is this??? */
+ if (sum == u)
+ MPN_COPY (sum->_mp_d, sump, uexp);
+#endif
+ sum->_mp_size = uexp;
+ sum->_mp_exp = uexp;
+ }
+ else
+ {
+ /* uuuuuu.uuuu */
+ /* + v. */
+ mp_limb_t cy_limb;
+ if (usize > prec)
+ {
+ /* Ignore excess limbs in U. */
+ up += usize - prec;
+ usize -= usize - prec; /* Eq. usize = prec */
+ }
+ if (sump != up)
+ MPN_COPY_INCR (sump, up, usize - uexp);
+ cy_limb = mpn_add_1 (sump + usize - uexp, up + usize - uexp,
+ uexp, (mp_limb_t) v);
+ sump[usize] = cy_limb;
+ sum->_mp_size = usize + cy_limb;
+ sum->_mp_exp = uexp + cy_limb;
+ }
+ }
+ }
+ else
+ {
+ /* U < 1, so V > U for sure. */
+ /* v. */
+ /* .0000uuuu */
+ if ((-uexp) >= prec)
+ {
+ sump[0] = v;
+ sum->_mp_size = 1;
+ sum->_mp_exp = 1;
+ }
+ else
+ {
+ if (usize + (-uexp) + 1 > prec)
+ {
+ /* Ignore excess limbs in U. */
+ up += usize + (-uexp) + 1 - prec;
+ usize -= usize + (-uexp) + 1 - prec;
+ }
+ if (sump != up)
+ MPN_COPY_INCR (sump, up, usize);
+ MPN_ZERO (sump + usize, -uexp);
+ sump[usize + (-uexp)] = v;
+ sum->_mp_size = usize + (-uexp) + 1;
+ sum->_mp_exp = 1;
+ }
+ }
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpf/ceilfloor.c b/Build/source/libs/gmp/gmp-6.0.0/mpf/ceilfloor.c
new file mode 100644
index 00000000000..302e2b8ae5a
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpf/ceilfloor.c
@@ -0,0 +1,126 @@
+/* mpf_ceil, mpf_floor -- round an mpf to an integer.
+
+Copyright 2001, 2004, 2012 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.h"
+#include "gmp-impl.h"
+
+
+/* dir==1 for ceil, dir==-1 for floor
+
+ Notice the use of prec+1 ensures mpf_ceil and mpf_floor are equivalent to
+ mpf_set if u is already an integer. */
+
+static void __gmpf_ceil_or_floor (REGPARM_2_1 (mpf_ptr, mpf_srcptr, int)) REGPARM_ATTR (1);
+#define mpf_ceil_or_floor(r,u,dir) __gmpf_ceil_or_floor (REGPARM_2_1 (r, u, dir))
+
+REGPARM_ATTR (1) static void
+mpf_ceil_or_floor (mpf_ptr r, mpf_srcptr u, int dir)
+{
+ mp_ptr rp, up, p;
+ mp_size_t size, asize, prec;
+ mp_exp_t exp;
+
+ size = SIZ(u);
+ if (size == 0)
+ {
+ zero:
+ SIZ(r) = 0;
+ EXP(r) = 0;
+ return;
+ }
+
+ rp = PTR(r);
+ exp = EXP(u);
+ if (exp <= 0)
+ {
+ /* u is only a fraction */
+ if ((size ^ dir) < 0)
+ goto zero;
+ rp[0] = 1;
+ EXP(r) = 1;
+ SIZ(r) = dir;
+ return;
+ }
+ EXP(r) = exp;
+
+ up = PTR(u);
+ asize = ABS (size);
+ up += asize;
+
+ /* skip fraction part of u */
+ asize = MIN (asize, exp);
+
+ /* don't lose precision in the copy */
+ prec = PREC (r) + 1;
+
+ /* skip excess over target precision */
+ asize = MIN (asize, prec);
+
+ up -= asize;
+
+ if ((size ^ dir) >= 0)
+ {
+ /* rounding direction matches sign, must increment if ignored part is
+ non-zero */
+ for (p = PTR(u); p != up; p++)
+ {
+ if (*p != 0)
+ {
+ if (mpn_add_1 (rp, up, asize, CNST_LIMB(1)))
+ {
+ /* was all 0xFF..FFs, which have become zeros, giving just
+ a carry */
+ rp[0] = 1;
+ asize = 1;
+ EXP(r)++;
+ }
+ SIZ(r) = (size >= 0 ? asize : -asize);
+ return;
+ }
+ }
+ }
+
+ SIZ(r) = (size >= 0 ? asize : -asize);
+ if (rp != up)
+ MPN_COPY_INCR (rp, up, asize);
+}
+
+
+void
+mpf_ceil (mpf_ptr r, mpf_srcptr u)
+{
+ mpf_ceil_or_floor (r, u, 1);
+}
+
+void
+mpf_floor (mpf_ptr r, mpf_srcptr u)
+{
+ mpf_ceil_or_floor (r, u, -1);
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpf/clear.c b/Build/source/libs/gmp/gmp-6.0.0/mpf/clear.c
new file mode 100644
index 00000000000..2df0de579b0
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpf/clear.c
@@ -0,0 +1,39 @@
+/* mpf_clear -- de-allocate the space occupied by the dynamic digit space of
+ an integer.
+
+Copyright 1993-1995, 2000, 2001 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.h"
+#include "gmp-impl.h"
+
+void
+mpf_clear (mpf_ptr m)
+{
+ (*__gmp_free_func) (m->_mp_d, (size_t) (m->_mp_prec + 1) * GMP_LIMB_BYTES);
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpf/clears.c b/Build/source/libs/gmp/gmp-6.0.0/mpf/clears.c
new file mode 100644
index 00000000000..addbe8faf3b
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpf/clears.c
@@ -0,0 +1,49 @@
+/* mpf_clears() -- Clear multiple mpf_t variables.
+
+Copyright 2009, 2014 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 <stdarg.h>
+#include <stdio.h> /* for NULL */
+#include "gmp.h"
+#include "gmp-impl.h"
+
+void
+mpf_clears (mpf_ptr x, ...)
+{
+ va_list ap;
+
+ va_start (ap, x);
+
+ while (x != NULL)
+ {
+ (*__gmp_free_func) (x->_mp_d, (size_t) (x->_mp_prec + 1) * GMP_LIMB_BYTES);
+ x = va_arg (ap, mpf_ptr);
+ }
+ va_end (ap);
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpf/cmp.c b/Build/source/libs/gmp/gmp-6.0.0/mpf/cmp.c
new file mode 100644
index 00000000000..ab22c3f89cc
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpf/cmp.c
@@ -0,0 +1,117 @@
+/* mpf_cmp -- Compare two floats.
+
+Copyright 1993, 1994, 1996, 2001 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.h"
+#include "gmp-impl.h"
+
+int
+mpf_cmp (mpf_srcptr u, mpf_srcptr v) __GMP_NOTHROW
+{
+ mp_srcptr up, vp;
+ mp_size_t usize, vsize;
+ mp_exp_t uexp, vexp;
+ int cmp;
+ int usign;
+
+ uexp = u->_mp_exp;
+ vexp = v->_mp_exp;
+
+ usize = u->_mp_size;
+ vsize = v->_mp_size;
+
+ /* 1. Are the signs different? */
+ if ((usize ^ vsize) >= 0)
+ {
+ /* U and V are both non-negative or both negative. */
+ if (usize == 0)
+ /* vsize >= 0 */
+ return -(vsize != 0);
+ if (vsize == 0)
+ /* usize >= 0 */
+ return usize != 0;
+ /* Fall out. */
+ }
+ else
+ {
+ /* Either U or V is negative, but not both. */
+ return usize >= 0 ? 1 : -1;
+ }
+
+ /* U and V have the same sign and are both non-zero. */
+
+ usign = usize >= 0 ? 1 : -1;
+
+ /* 2. Are the exponents different? */
+ if (uexp > vexp)
+ return usign;
+ if (uexp < vexp)
+ return -usign;
+
+ usize = ABS (usize);
+ vsize = ABS (vsize);
+
+ up = u->_mp_d;
+ vp = v->_mp_d;
+
+#define STRICT_MPF_NORMALIZATION 0
+#if ! STRICT_MPF_NORMALIZATION
+ /* Ignore zeroes at the low end of U and V. */
+ while (up[0] == 0)
+ {
+ up++;
+ usize--;
+ }
+ while (vp[0] == 0)
+ {
+ vp++;
+ vsize--;
+ }
+#endif
+
+ if (usize > vsize)
+ {
+ cmp = mpn_cmp (up + usize - vsize, vp, vsize);
+ if (cmp == 0)
+ return usign;
+ }
+ else if (vsize > usize)
+ {
+ cmp = mpn_cmp (up, vp + vsize - usize, usize);
+ if (cmp == 0)
+ return -usign;
+ }
+ else
+ {
+ cmp = mpn_cmp (up, vp, usize);
+ if (cmp == 0)
+ return 0;
+ }
+ return cmp > 0 ? usign : -usign;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpf/cmp_d.c b/Build/source/libs/gmp/gmp-6.0.0/mpf/cmp_d.c
new file mode 100644
index 00000000000..52893a781ec
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpf/cmp_d.c
@@ -0,0 +1,60 @@
+/* mpf_cmp_d -- compare mpf and double.
+
+Copyright 2001, 2003 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 "config.h"
+
+#if HAVE_FLOAT_H
+#include <float.h> /* for DBL_MAX */
+#endif
+
+#include "gmp.h"
+#include "gmp-impl.h"
+
+int
+mpf_cmp_d (mpf_srcptr f, double d)
+{
+ mp_limb_t darray[LIMBS_PER_DOUBLE];
+ mpf_t df;
+
+ /* d=NaN has no sensible return value, so raise an exception.
+ d=Inf or -Inf is always bigger than z. */
+ DOUBLE_NAN_INF_ACTION (d,
+ __gmp_invalid_operation (),
+ return (d < 0.0 ? 1 : -1));
+
+ if (d == 0.0)
+ return SIZ(f);
+
+ PTR(df) = darray;
+ SIZ(df) = (d >= 0.0 ? LIMBS_PER_DOUBLE : -LIMBS_PER_DOUBLE);
+ EXP(df) = __gmp_extract_double (darray, ABS(d));
+
+ return mpf_cmp (f, df);
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpf/cmp_si.c b/Build/source/libs/gmp/gmp-6.0.0/mpf/cmp_si.c
new file mode 100644
index 00000000000..eaa8b87da9b
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpf/cmp_si.c
@@ -0,0 +1,118 @@
+/* mpf_cmp_si -- Compare a float with a signed integer.
+
+Copyright 1993-1995, 1999-2002, 2004, 2012 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.h"
+#include "gmp-impl.h"
+
+int
+mpf_cmp_si (mpf_srcptr u, long int vval) __GMP_NOTHROW
+{
+ mp_srcptr up;
+ mp_size_t usize;
+ mp_exp_t uexp;
+ mp_limb_t ulimb;
+ int usign;
+ unsigned long abs_vval;
+
+ uexp = u->_mp_exp;
+ usize = u->_mp_size;
+
+ /* 1. Are the signs different? */
+ if ((usize < 0) == (vval < 0)) /* don't use xor, type size may differ */
+ {
+ /* U and V are both non-negative or both negative. */
+ if (usize == 0)
+ /* vval >= 0 */
+ return -(vval != 0);
+ if (vval == 0)
+ /* usize >= 0 */
+ return usize != 0;
+ /* Fall out. */
+ }
+ else
+ {
+ /* Either U or V is negative, but not both. */
+ return usize >= 0 ? 1 : -1;
+ }
+
+ /* U and V have the same sign and are both non-zero. */
+
+ usign = usize >= 0 ? 1 : -1;
+ usize = ABS (usize);
+ abs_vval = ABS_CAST (unsigned long, vval);
+
+ /* 2. Are the exponents different (V's exponent == 1)? */
+#if GMP_NAIL_BITS != 0
+ if (uexp > 1 + (abs_vval > GMP_NUMB_MAX))
+ return usign;
+ if (uexp < 1 + (abs_vval > GMP_NUMB_MAX))
+ return -usign;
+#else
+ if (uexp > 1)
+ return usign;
+ if (uexp < 1)
+ return -usign;
+#endif
+
+ up = u->_mp_d;
+
+ ulimb = up[usize - 1];
+#if GMP_NAIL_BITS != 0
+ if (usize >= 2 && uexp == 2)
+ {
+ if ((ulimb >> GMP_NAIL_BITS) != 0)
+ return usign;
+ ulimb = (ulimb << GMP_NUMB_BITS) | up[usize - 2];
+ usize--;
+ }
+#endif
+ usize--;
+
+ /* 3. Compare the most significant mantissa limb with V. */
+ if (ulimb > abs_vval)
+ return usign;
+ else if (ulimb < abs_vval)
+ return -usign;
+
+ /* Ignore zeroes at the low end of U. */
+ while (*up == 0)
+ {
+ up++;
+ usize--;
+ }
+
+ /* 4. Now, if the number of limbs are different, we have a difference
+ since we have made sure the trailing limbs are not zero. */
+ if (usize > 0)
+ return usign;
+
+ /* Wow, we got zero even if we tried hard to avoid it. */
+ return 0;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpf/cmp_ui.c b/Build/source/libs/gmp/gmp-6.0.0/mpf/cmp_ui.c
new file mode 100644
index 00000000000..ccb76c6ce0a
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpf/cmp_ui.c
@@ -0,0 +1,100 @@
+/* mpf_cmp_ui -- Compare a float with an unsigned integer.
+
+Copyright 1993-1995, 1999, 2001, 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/. */
+
+#include "gmp.h"
+#include "gmp-impl.h"
+
+int
+mpf_cmp_ui (mpf_srcptr u, unsigned long int vval) __GMP_NOTHROW
+{
+ mp_srcptr up;
+ mp_size_t usize;
+ mp_exp_t uexp;
+ mp_limb_t ulimb;
+
+ uexp = u->_mp_exp;
+ usize = u->_mp_size;
+
+ /* 1. Is U negative? */
+ if (usize < 0)
+ return -1;
+ /* We rely on usize being non-negative in the code that follows. */
+
+ if (vval == 0)
+ return usize != 0;
+
+ /* 2. Are the exponents different (V's exponent == 1)? */
+#if GMP_NAIL_BITS != 0
+ if (uexp > 1 + (vval > GMP_NUMB_MAX))
+ return 1;
+ if (uexp < 1 + (vval > GMP_NUMB_MAX))
+ return -1;
+#else
+ if (uexp > 1)
+ return 1;
+ if (uexp < 1)
+ return -1;
+#endif
+
+ up = u->_mp_d;
+
+ ulimb = up[usize - 1];
+#if GMP_NAIL_BITS != 0
+ if (usize >= 2 && uexp == 2)
+ {
+ if ((ulimb >> GMP_NAIL_BITS) != 0)
+ return 1;
+ ulimb = (ulimb << GMP_NUMB_BITS) | up[usize - 2];
+ usize--;
+ }
+#endif
+ usize--;
+
+ /* 3. Compare the most significant mantissa limb with V. */
+ if (ulimb > vval)
+ return 1;
+ else if (ulimb < vval)
+ return -1;
+
+ /* Ignore zeroes at the low end of U. */
+ while (*up == 0)
+ {
+ up++;
+ usize--;
+ }
+
+ /* 4. Now, if the number of limbs are different, we have a difference
+ since we have made sure the trailing limbs are not zero. */
+ if (usize > 0)
+ return 1;
+
+ /* Wow, we got zero even if we tried hard to avoid it. */
+ return 0;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpf/div.c b/Build/source/libs/gmp/gmp-6.0.0/mpf/div.c
new file mode 100644
index 00000000000..af38cb8698f
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpf/div.c
@@ -0,0 +1,138 @@
+/* mpf_div -- Divide two floats.
+
+Copyright 1993, 1994, 1996, 2000-2002, 2004, 2005, 2010, 2012 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.h"
+#include "gmp-impl.h"
+
+
+/* Not done:
+
+ No attempt is made to identify an overlap u==v. The result will be
+ correct (1.0), but a full actual division is done whereas of course
+ x/x==1 needs no work. Such a call is not a sensible thing to make, and
+ it's left to an application to notice and optimize if it might arise
+ somehow through pointer aliasing or whatever.
+
+ Enhancements:
+
+ The high quotient limb is non-zero when high{up,vsize} >= {vp,vsize}. We
+ could make that comparison and use qsize==prec instead of qsize==prec+1,
+ to save one limb in the division.
+
+ If r==u but the size is enough bigger than prec that there won't be an
+ overlap between quotient and dividend in mpn_div_q, then we can avoid
+ copying up,usize. This would only arise from a prec reduced with
+ mpf_set_prec_raw and will be pretty unusual, but might be worthwhile if
+ it could be worked into the copy_u decision cleanly. */
+
+void
+mpf_div (mpf_ptr r, mpf_srcptr u, mpf_srcptr v)
+{
+ mp_srcptr up, vp;
+ mp_ptr rp, tp, new_vp;
+ mp_size_t usize, vsize, rsize, prospective_rsize, tsize, zeros;
+ mp_size_t sign_quotient, prec, high_zero, chop;
+ mp_exp_t rexp;
+ int copy_u;
+ TMP_DECL;
+
+ usize = SIZ(u);
+ vsize = SIZ(v);
+
+ if (UNLIKELY (vsize == 0))
+ DIVIDE_BY_ZERO;
+
+ if (usize == 0)
+ {
+ SIZ(r) = 0;
+ EXP(r) = 0;
+ return;
+ }
+
+ sign_quotient = usize ^ vsize;
+ usize = ABS (usize);
+ vsize = ABS (vsize);
+ prec = PREC(r);
+
+ TMP_MARK;
+ rexp = EXP(u) - EXP(v) + 1;
+
+ rp = PTR(r);
+ up = PTR(u);
+ vp = PTR(v);
+
+ prospective_rsize = usize - vsize + 1; /* quot from using given u,v sizes */
+ rsize = prec + 1; /* desired quot */
+
+ zeros = rsize - prospective_rsize; /* padding u to give rsize */
+ copy_u = (zeros > 0 || rp == up); /* copy u if overlap or padding */
+
+ chop = MAX (-zeros, 0); /* negative zeros means shorten u */
+ up += chop;
+ usize -= chop;
+ zeros += chop; /* now zeros >= 0 */
+
+ tsize = usize + zeros; /* size for possible copy of u */
+
+ /* copy and possibly extend u if necessary */
+ if (copy_u)
+ {
+ tp = TMP_ALLOC_LIMBS (tsize + 1); /* +1 for mpn_div_q's scratch needs */
+ MPN_ZERO (tp, zeros);
+ MPN_COPY (tp+zeros, up, usize);
+ up = tp;
+ usize = tsize;
+ }
+ else
+ {
+ tp = TMP_ALLOC_LIMBS (usize + 1);
+ }
+
+ /* ensure divisor doesn't overlap quotient */
+ if (rp == vp)
+ {
+ new_vp = TMP_ALLOC_LIMBS (vsize);
+ MPN_COPY (new_vp, vp, vsize);
+ vp = new_vp;
+ }
+
+ ASSERT (usize-vsize+1 == rsize);
+ mpn_div_q (rp, up, usize, vp, vsize, tp);
+
+ /* strip possible zero high limb */
+ high_zero = (rp[rsize-1] == 0);
+ rsize -= high_zero;
+ rexp -= high_zero;
+
+ SIZ(r) = sign_quotient >= 0 ? rsize : -rsize;
+ EXP(r) = rexp;
+ TMP_FREE;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpf/div_2exp.c b/Build/source/libs/gmp/gmp-6.0.0/mpf/div_2exp.c
new file mode 100644
index 00000000000..fef81520503
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpf/div_2exp.c
@@ -0,0 +1,139 @@
+/* mpf_div_2exp -- Divide a float by 2^n.
+
+Copyright 1993, 1994, 1996, 2000-2002, 2004 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.h"
+#include "gmp-impl.h"
+
+
+/* Multiples of GMP_NUMB_BITS in exp simply mean an amount subtracted from
+ EXP(u) to set EXP(r). The remainder exp%GMP_NUMB_BITS is then a right
+ shift for the limb data.
+
+ If exp%GMP_NUMB_BITS == 0 then there's no shifting, we effectively just
+ do an mpz_set with changed EXP(r). Like mpz_set we take prec+1 limbs in
+ this case. Although just prec would suffice, it's nice to have
+ mpf_div_2exp with exp==0 come out the same as mpz_set.
+
+ When shifting we take up to prec many limbs from the input. Our shift is
+ cy = mpn_rshift (PTR(r)+1, PTR(u)+k, ...), where k is the number of low
+ limbs dropped from u, and the carry out is stored to PTR(r)[0]. We don't
+ try to work extra bits from PTR(u)[k-1] (when k>=1 makes it available)
+ into that low carry limb. Just prec limbs (with the high non-zero) from
+ the input is enough bits for the application requested precision, no need
+ to do extra work.
+
+ If r==u the shift will have overlapping operands. When k>=1 (ie. when
+ usize > prec), the overlap is in the style supported by rshift (ie. dst
+ <= src).
+
+ But when r==u and k==0 (ie. usize <= prec), we would have an invalid
+ overlap (mpn_rshift (rp+1, rp, ...)). In this case we must instead use
+ mpn_lshift (PTR(r), PTR(u), size, NUMB-shift). An lshift by NUMB-shift
+ bits gives identical data of course, it's just its overlap restrictions
+ which differ.
+
+ In both shift cases, the resulting data is abs_usize+1 limbs. "adj" is
+ used to add +1 to that size if the high is non-zero (it may of course
+ have become zero by the shifting). EXP(u) is the exponent just above
+ those abs_usize+1 limbs, so it gets -1+adj, which means -1 if the high is
+ zero, or no change if the high is non-zero.
+
+ Enhancements:
+
+ The way mpn_lshift is used means successive mpf_div_2exp calls on the
+ same operand will accumulate low zero limbs, until prec+1 limbs is
+ reached. This is wasteful for subsequent operations. When abs_usize <=
+ prec, we should test the low exp%GMP_NUMB_BITS many bits of PTR(u)[0],
+ ie. those which would be shifted out by an mpn_rshift. If they're zero
+ then use that mpn_rshift. */
+
+void
+mpf_div_2exp (mpf_ptr r, mpf_srcptr u, mp_bitcnt_t exp)
+{
+ mp_srcptr up;
+ mp_ptr rp = r->_mp_d;
+ mp_size_t usize;
+ mp_size_t abs_usize;
+ mp_size_t prec = r->_mp_prec;
+ mp_exp_t uexp = u->_mp_exp;
+
+ usize = u->_mp_size;
+
+ if (UNLIKELY (usize == 0))
+ {
+ r->_mp_size = 0;
+ r->_mp_exp = 0;
+ return;
+ }
+
+ abs_usize = ABS (usize);
+ up = u->_mp_d;
+
+ if (exp % GMP_NUMB_BITS == 0)
+ {
+ prec++; /* retain more precision here as we don't need
+ to account for carry-out here */
+ if (abs_usize > prec)
+ {
+ up += abs_usize - prec;
+ abs_usize = prec;
+ }
+ if (rp != up)
+ MPN_COPY_INCR (rp, up, abs_usize);
+ r->_mp_exp = uexp - exp / GMP_NUMB_BITS;
+ }
+ else
+ {
+ mp_limb_t cy_limb;
+ mp_size_t adj;
+ if (abs_usize > prec)
+ {
+ up += abs_usize - prec;
+ abs_usize = prec;
+ /* Use mpn_rshift since mpn_lshift operates downwards, and we
+ therefore would clobber part of U before using that part, in case
+ R is the same variable as U. */
+ cy_limb = mpn_rshift (rp + 1, up, abs_usize, exp % GMP_NUMB_BITS);
+ rp[0] = cy_limb;
+ adj = rp[abs_usize] != 0;
+ }
+ else
+ {
+ cy_limb = mpn_lshift (rp, up, abs_usize,
+ GMP_NUMB_BITS - exp % GMP_NUMB_BITS);
+ rp[abs_usize] = cy_limb;
+ adj = cy_limb != 0;
+ }
+
+ abs_usize += adj;
+ r->_mp_exp = uexp - exp / GMP_NUMB_BITS - 1 + adj;
+ }
+ r->_mp_size = usize >= 0 ? abs_usize : -abs_usize;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpf/div_ui.c b/Build/source/libs/gmp/gmp-6.0.0/mpf/div_ui.c
new file mode 100644
index 00000000000..9be7e680bef
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpf/div_ui.c
@@ -0,0 +1,111 @@
+/* mpf_div_ui -- Divide a float with an unsigned integer.
+
+Copyright 1993, 1994, 1996, 2000-2002, 2004, 2005, 2012 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.h"
+#include "gmp-impl.h"
+#include "longlong.h"
+
+void
+mpf_div_ui (mpf_ptr r, mpf_srcptr u, unsigned long int v)
+{
+ mp_srcptr up;
+ mp_ptr rp, tp, rtp;
+ mp_size_t usize;
+ mp_size_t rsize, tsize;
+ mp_size_t sign_quotient;
+ mp_size_t prec;
+ mp_limb_t q_limb;
+ mp_exp_t rexp;
+ TMP_DECL;
+
+#if BITS_PER_ULONG > GMP_NUMB_BITS /* avoid warnings about shift amount */
+ if (v > GMP_NUMB_MAX)
+ {
+ mpf_t vf;
+ mp_limb_t vl[2];
+ SIZ(vf) = 2;
+ EXP(vf) = 2;
+ PTR(vf) = vl;
+ vl[0] = v & GMP_NUMB_MASK;
+ vl[1] = v >> GMP_NUMB_BITS;
+ mpf_div (r, u, vf);
+ return;
+ }
+#endif
+
+ if (UNLIKELY (v == 0))
+ DIVIDE_BY_ZERO;
+
+ usize = u->_mp_size;
+
+ if (usize == 0)
+ {
+ r->_mp_size = 0;
+ r->_mp_exp = 0;
+ return;
+ }
+
+ sign_quotient = usize;
+ usize = ABS (usize);
+ prec = r->_mp_prec;
+
+ TMP_MARK;
+
+ rp = r->_mp_d;
+ up = u->_mp_d;
+
+ tsize = 1 + prec;
+ tp = TMP_ALLOC_LIMBS (tsize + 1);
+
+ if (usize > tsize)
+ {
+ up += usize - tsize;
+ usize = tsize;
+ rtp = tp;
+ }
+ else
+ {
+ MPN_ZERO (tp, tsize - usize);
+ rtp = tp + (tsize - usize);
+ }
+
+ /* Move the dividend to the remainder. */
+ MPN_COPY (rtp, up, usize);
+
+ mpn_divmod_1 (rp, tp, tsize, (mp_limb_t) v);
+ q_limb = rp[tsize - 1];
+
+ rsize = tsize - (q_limb == 0);
+ rexp = u->_mp_exp - (q_limb == 0);
+ r->_mp_size = sign_quotient >= 0 ? rsize : -rsize;
+ r->_mp_exp = rexp;
+ TMP_FREE;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpf/dump.c b/Build/source/libs/gmp/gmp-6.0.0/mpf/dump.c
new file mode 100644
index 00000000000..af671059237
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpf/dump.c
@@ -0,0 +1,53 @@
+/* mpf_dump -- Dump a float to stdout.
+
+ THIS IS AN INTERNAL FUNCTION WITH A MUTABLE INTERFACE. IT IS NOT SAFE TO
+ CALL THIS FUNCTION DIRECTLY. IN FACT, IT IS ALMOST GUARANTEED THAT THIS
+ FUNCTION WILL CHANGE OR DISAPPEAR IN A FUTURE GNU MP RELEASE.
+
+
+Copyright 1993-1995, 2000, 2001 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 <string.h> /* for strlen */
+#include "gmp.h"
+#include "gmp-impl.h"
+
+void
+mpf_dump (mpf_srcptr u)
+{
+ mp_exp_t exp;
+ char *str;
+
+ str = mpf_get_str (0, &exp, 10, 0, u);
+ if (str[0] == '-')
+ printf ("-0.%se%ld\n", str + 1, exp);
+ else
+ printf ("0.%se%ld\n", str, exp);
+ (*__gmp_free_func) (str, strlen (str) + 1);
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpf/eq.c b/Build/source/libs/gmp/gmp-6.0.0/mpf/eq.c
new file mode 100644
index 00000000000..30c6befd061
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpf/eq.c
@@ -0,0 +1,150 @@
+/* mpf_eq -- Compare two floats up to a specified bit #.
+
+Copyright 1993, 1995, 1996, 2001, 2002, 2008, 2009, 2012 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.h"
+#include "gmp-impl.h"
+#include "longlong.h"
+
+int
+mpf_eq (mpf_srcptr u, mpf_srcptr v, mp_bitcnt_t n_bits)
+{
+ mp_srcptr up, vp, p;
+ mp_size_t usize, vsize, minsize, maxsize, n_limbs, i, size;
+ mp_exp_t uexp, vexp;
+ mp_limb_t diff;
+ int cnt;
+
+ uexp = u->_mp_exp;
+ vexp = v->_mp_exp;
+
+ usize = u->_mp_size;
+ vsize = v->_mp_size;
+
+ /* 1. Are the signs different? */
+ if ((usize ^ vsize) >= 0)
+ {
+ /* U and V are both non-negative or both negative. */
+ if (usize == 0)
+ return vsize == 0;
+ if (vsize == 0)
+ return 0;
+
+ /* Fall out. */
+ }
+ else
+ {
+ /* Either U or V is negative, but not both. */
+ return 0;
+ }
+
+ /* U and V have the same sign and are both non-zero. */
+
+ /* 2. Are the exponents different? */
+ if (uexp != vexp)
+ return 0;
+
+ usize = ABS (usize);
+ vsize = ABS (vsize);
+
+ up = u->_mp_d;
+ vp = v->_mp_d;
+
+ up += usize; /* point just above most significant limb */
+ vp += vsize; /* point just above most significant limb */
+
+ count_leading_zeros (cnt, up[-1]);
+ if ((vp[-1] >> (GMP_LIMB_BITS - 1 - cnt)) != 1)
+ return 0; /* msb positions different */
+
+ n_bits += cnt - GMP_NAIL_BITS;
+ n_limbs = (n_bits + GMP_NUMB_BITS - 1) / GMP_NUMB_BITS;
+
+ usize = MIN (usize, n_limbs);
+ vsize = MIN (vsize, n_limbs);
+
+#if 0
+ /* Ignore zeros at the low end of U and V. */
+ while (up[0] == 0)
+ up++, usize--;
+ while (vp[0] == 0)
+ vp++, vsize--;
+#endif
+
+ minsize = MIN (usize, vsize);
+ maxsize = usize + vsize - minsize;
+
+ up -= minsize; /* point at most significant common limb */
+ vp -= minsize; /* point at most significant common limb */
+
+ /* Compare the most significant part which has explicit limbs for U and V. */
+ for (i = minsize - 1; i > 0; i--)
+ {
+ if (up[i] != vp[i])
+ return 0;
+ }
+
+ n_bits -= (maxsize - 1) * GMP_NUMB_BITS;
+
+ size = maxsize - minsize;
+ if (size != 0)
+ {
+ if (up[0] != vp[0])
+ return 0;
+
+ /* Now either U or V has its limbs consumed, i.e, continues with an
+ infinite number of implicit zero limbs. Check that the other operand
+ has just zeros in the corresponding, relevant part. */
+
+ if (usize > vsize)
+ p = up - size;
+ else
+ p = vp - size;
+
+ for (i = size - 1; i > 0; i--)
+ {
+ if (p[i] != 0)
+ return 0;
+ }
+
+ diff = p[0];
+ }
+ else
+ {
+ /* Both U or V has its limbs consumed. */
+
+ diff = up[0] ^ vp[0];
+ }
+
+ if (n_bits < GMP_NUMB_BITS)
+ diff >>= GMP_NUMB_BITS - n_bits;
+
+ return diff == 0;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpf/fits_s.h b/Build/source/libs/gmp/gmp-6.0.0/mpf/fits_s.h
new file mode 100644
index 00000000000..ec2635f6569
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpf/fits_s.h
@@ -0,0 +1,75 @@
+/* mpf_fits_s*_p -- test whether an mpf fits a C signed type.
+
+Copyright 2001, 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/. */
+
+#include "gmp.h"
+#include "gmp-impl.h"
+
+
+/* Notice this is equivalent to mpz_set_f + mpz_fits_s*_p. */
+
+int
+FUNCTION (mpf_srcptr f) __GMP_NOTHROW
+{
+ mp_size_t fs, fn;
+ mp_srcptr fp;
+ mp_exp_t exp;
+ mp_limb_t fl;
+
+ fs = SIZ(f);
+ if (fs == 0)
+ return 1; /* zero fits */
+
+ exp = EXP(f);
+ if (exp < 1)
+ return 1; /* -1 < f < 1 truncates to zero, so fits */
+
+ fp = PTR(f);
+ fn = ABS (fs);
+
+ if (exp == 1)
+ {
+ fl = fp[fn-1];
+ }
+#if GMP_NAIL_BITS != 0
+ else if (exp == 2 && MAXIMUM > GMP_NUMB_MAX)
+ {
+ fl = fp[fn-1];
+ if ((fl >> GMP_NAIL_BITS) != 0)
+ return 0;
+ fl = (fl << GMP_NUMB_BITS);
+ if (fn >= 2)
+ fl |= fp[fn-2];
+ }
+#endif
+ else
+ return 0;
+
+ return fl <= (fs >= 0 ? (mp_limb_t) MAXIMUM : - (mp_limb_t) MINIMUM);
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpf/fits_sint.c b/Build/source/libs/gmp/gmp-6.0.0/mpf/fits_sint.c
new file mode 100644
index 00000000000..26ace07c380
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpf/fits_sint.c
@@ -0,0 +1,36 @@
+/* mpf_fits_sint_p -- test whether an mpf fits an int.
+
+Copyright 2001 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 FUNCTION mpf_fits_sint_p
+#define MAXIMUM INT_MAX
+#define MINIMUM INT_MIN
+
+#include "fits_s.h"
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpf/fits_slong.c b/Build/source/libs/gmp/gmp-6.0.0/mpf/fits_slong.c
new file mode 100644
index 00000000000..25db68c47d4
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpf/fits_slong.c
@@ -0,0 +1,36 @@
+/* mpf_fits_slong_p -- test whether an mpf fits a long.
+
+Copyright 2001 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 FUNCTION mpf_fits_slong_p
+#define MAXIMUM LONG_MAX
+#define MINIMUM LONG_MIN
+
+#include "fits_s.h"
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpf/fits_sshort.c b/Build/source/libs/gmp/gmp-6.0.0/mpf/fits_sshort.c
new file mode 100644
index 00000000000..3bfc5a4a345
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpf/fits_sshort.c
@@ -0,0 +1,36 @@
+/* mpf_fits_sshort_p -- test whether an mpf fits a short.
+
+Copyright 2001 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 FUNCTION mpf_fits_sshort_p
+#define MAXIMUM SHRT_MAX
+#define MINIMUM SHRT_MIN
+
+#include "fits_s.h"
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpf/fits_u.h b/Build/source/libs/gmp/gmp-6.0.0/mpf/fits_u.h
new file mode 100644
index 00000000000..65ac60e09af
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpf/fits_u.h
@@ -0,0 +1,74 @@
+/* mpf_fits_u*_p -- test whether an mpf fits a C unsigned type.
+
+Copyright 2001, 2002, 2013 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.h"
+#include "gmp-impl.h"
+
+
+/* Notice this is equivalent to mpz_set_f + mpz_fits_u*_p. */
+
+int
+FUNCTION (mpf_srcptr f) __GMP_NOTHROW
+{
+ mp_size_t fn;
+ mp_srcptr fp;
+ mp_exp_t exp;
+ mp_limb_t fl;
+
+ exp = EXP(f);
+ if (exp < 1)
+ return 1; /* -1 < f < 1 truncates to zero, so fits */
+
+ fn = SIZ(f);
+ if (fn <= 0)
+ return fn == 0; /* zero fits, negatives don't */
+
+ fp = PTR(f);
+
+ if (exp == 1)
+ {
+ fl = fp[fn-1];
+ }
+#if GMP_NAIL_BITS != 0
+ else if (exp == 2 && MAXIMUM > GMP_NUMB_MAX)
+ {
+ fl = fp[fn-1];
+ if ((fl >> GMP_NAIL_BITS) != 0)
+ return 0;
+ fl = (fl << GMP_NUMB_BITS);
+ if (fn >= 2)
+ fl |= fp[fn-2];
+ }
+#endif
+ else
+ return 0;
+
+ return fl <= MAXIMUM;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpf/fits_uint.c b/Build/source/libs/gmp/gmp-6.0.0/mpf/fits_uint.c
new file mode 100644
index 00000000000..4b107b04d89
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpf/fits_uint.c
@@ -0,0 +1,35 @@
+/* mpf_fits_uint_p -- test whether an mpf fits an unsigned int.
+
+Copyright 2001 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 FUNCTION mpf_fits_uint_p
+#define MAXIMUM UINT_MAX
+
+#include "fits_u.h"
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpf/fits_ulong.c b/Build/source/libs/gmp/gmp-6.0.0/mpf/fits_ulong.c
new file mode 100644
index 00000000000..1db688ce4c6
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpf/fits_ulong.c
@@ -0,0 +1,35 @@
+/* mpf_fits_ulong_p -- test whether an mpf fits an unsigned long.
+
+Copyright 2001, 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/. */
+
+
+#define FUNCTION mpf_fits_ulong_p
+#define MAXIMUM ULONG_MAX
+
+#include "fits_u.h"
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpf/fits_ushort.c b/Build/source/libs/gmp/gmp-6.0.0/mpf/fits_ushort.c
new file mode 100644
index 00000000000..76a3fd9d528
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpf/fits_ushort.c
@@ -0,0 +1,35 @@
+/* mpf_fits_ushort_p -- test whether an mpf fits an unsigned short.
+
+Copyright 2001 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 FUNCTION mpf_fits_ushort_p
+#define MAXIMUM USHRT_MAX
+
+#include "fits_u.h"
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpf/get_d.c b/Build/source/libs/gmp/gmp-6.0.0/mpf/get_d.c
new file mode 100644
index 00000000000..8f6f9bbea1d
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpf/get_d.c
@@ -0,0 +1,47 @@
+/* double mpf_get_d (mpf_t src) -- return SRC truncated to a double.
+
+Copyright 1996, 2001-2004 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.h"
+#include "gmp-impl.h"
+
+double
+mpf_get_d (mpf_srcptr src)
+{
+ mp_size_t size, abs_size;
+ long exp;
+
+ size = SIZ (src);
+ if (UNLIKELY (size == 0))
+ return 0.0;
+
+ abs_size = ABS (size);
+ exp = (EXP (src) - abs_size) * GMP_NUMB_BITS;
+ return mpn_get_d (PTR (src), abs_size, size, exp);
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpf/get_d_2exp.c b/Build/source/libs/gmp/gmp-6.0.0/mpf/get_d_2exp.c
new file mode 100644
index 00000000000..17ce229f251
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpf/get_d_2exp.c
@@ -0,0 +1,61 @@
+/* double mpf_get_d_2exp (signed long int *exp, mpf_t src).
+
+Copyright 2001-2004 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.h"
+#include "gmp-impl.h"
+#include "longlong.h"
+
+
+double
+mpf_get_d_2exp (signed long int *exp2, 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;
+ return 0.0;
+ }
+
+ ptr = PTR(src);
+ abs_size = ABS (size);
+ 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));
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpf/get_dfl_prec.c b/Build/source/libs/gmp/gmp-6.0.0/mpf/get_dfl_prec.c
new file mode 100644
index 00000000000..9a773d83acb
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpf/get_dfl_prec.c
@@ -0,0 +1,39 @@
+/* mpf_get_default_prec -- return default precision in bits.
+
+Copyright 2001 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.h"
+#include "gmp-impl.h"
+
+
+mp_bitcnt_t
+mpf_get_default_prec (void) __GMP_NOTHROW
+{
+ return __GMPF_PREC_TO_BITS (__gmp_default_fp_limb_precision);
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpf/get_prc.c b/Build/source/libs/gmp/gmp-6.0.0/mpf/get_prc.c
new file mode 100644
index 00000000000..3b3283a48c5
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpf/get_prc.c
@@ -0,0 +1,38 @@
+/* mpf_get_prec(x) -- Return the precision in bits of x.
+
+Copyright 1996, 2000, 2001 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.h"
+#include "gmp-impl.h"
+
+mp_bitcnt_t
+mpf_get_prec (mpf_srcptr x) __GMP_NOTHROW
+{
+ return __GMPF_PREC_TO_BITS (x->_mp_prec);
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpf/get_si.c b/Build/source/libs/gmp/gmp-6.0.0/mpf/get_si.c
new file mode 100644
index 00000000000..5b63dbd4256
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpf/get_si.c
@@ -0,0 +1,87 @@
+/* mpf_get_si -- mpf to long conversion
+
+Copyright 2001, 2002, 2004 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.h"
+#include "gmp-impl.h"
+
+
+/* Any fraction bits are truncated, meaning simply discarded.
+
+ For values bigger than a long, the low bits are returned, like
+ mpz_get_si, but this isn't documented.
+
+ Notice this is equivalent to mpz_set_f + mpz_get_si.
+
+
+ Implementation:
+
+ fl is established in basically the same way as for mpf_get_ui, see that
+ code for explanations of the conditions.
+
+ However unlike mpf_get_ui we need an explicit return 0 for exp<=0. When
+ f is a negative fraction (ie. size<0 and exp<=0) we can't let fl==0 go
+ through to the zany final "~ ((fl - 1) & LONG_MAX)", that would give
+ -0x80000000 instead of the desired 0. */
+
+long
+mpf_get_si (mpf_srcptr f) __GMP_NOTHROW
+{
+ mp_exp_t exp;
+ mp_size_t size, abs_size;
+ mp_srcptr fp;
+ mp_limb_t fl;
+
+ exp = EXP (f);
+ size = SIZ (f);
+ fp = PTR (f);
+
+ /* fraction alone truncates to zero
+ this also covers zero, since we have exp==0 for zero */
+ if (exp <= 0)
+ return 0L;
+
+ /* there are some limbs above the radix point */
+
+ fl = 0;
+ abs_size = ABS (size);
+ if (abs_size >= exp)
+ fl = fp[abs_size-exp];
+
+#if BITS_PER_ULONG > GMP_NUMB_BITS
+ if (exp > 1 && abs_size+1 >= exp)
+ fl |= fp[abs_size - exp + 1] << GMP_NUMB_BITS;
+#endif
+
+ if (size > 0)
+ return fl & LONG_MAX;
+ else
+ /* this form necessary to correctly handle -0x80..00 */
+ return -1 - (long) ((fl - 1) & LONG_MAX);
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpf/get_str.c b/Build/source/libs/gmp/gmp-6.0.0/mpf/get_str.c
new file mode 100644
index 00000000000..98af03272e6
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpf/get_str.c
@@ -0,0 +1,330 @@
+/* mpf_get_str (digit_ptr, exp, base, n_digits, a) -- Convert the floating
+ point number A to a base BASE number and store N_DIGITS raw digits at
+ DIGIT_PTR, and the base BASE exponent in the word pointed to by EXP. For
+ 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 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 <stdlib.h> /* for NULL */
+#include "gmp.h"
+#include "gmp-impl.h"
+#include "longlong.h" /* for count_leading_zeros */
+
+/* Could use some more work.
+
+ 1. Allocation is excessive. Try to combine areas. Perhaps use result
+ string area for temp limb space?
+ 2. We generate up to two limbs of extra digits. This is because we don't
+ check the exact number of bits in the input operand, and from that
+ compute an accurate exponent (variable e in the code). It would be
+ cleaner and probably somewhat faster to change this.
+*/
+
+/* Compute base^exp and return the most significant prec limbs in rp[].
+ Put the count of omitted low limbs in *ign.
+ Return the actual size (which might be less than prec).
+ Allocation of rp[] and the temporary tp[] should be 2*prec+2 limbs. */
+static mp_size_t
+mpn_pow_1_highpart (mp_ptr rp, mp_size_t *ignp,
+ mp_limb_t base, unsigned long exp,
+ mp_size_t prec, mp_ptr tp)
+{
+ mp_size_t ign; /* counts number of ignored low limbs in r */
+ mp_size_t off; /* keeps track of offset where value starts */
+ mp_ptr passed_rp = rp;
+ mp_size_t rn;
+ int cnt;
+ int i;
+
+ if (exp == 0)
+ {
+ rp[0] = 1;
+ *ignp = 0;
+ return 1;
+ }
+
+ rp[0] = base;
+ rn = 1;
+ off = 0;
+ ign = 0;
+ count_leading_zeros (cnt, exp);
+ for (i = GMP_LIMB_BITS - cnt - 2; i >= 0; i--)
+ {
+ mpn_sqr (tp, rp + off, rn);
+ rn = 2 * rn;
+ rn -= tp[rn - 1] == 0;
+ ign <<= 1;
+
+ off = 0;
+ if (rn > prec)
+ {
+ ign += rn - prec;
+ off = rn - prec;
+ rn = prec;
+ }
+ MP_PTR_SWAP (rp, tp);
+
+ if (((exp >> i) & 1) != 0)
+ {
+ mp_limb_t cy;
+ cy = mpn_mul_1 (rp, rp + off, rn, base);
+ rp[rn] = cy;
+ rn += cy != 0;
+ off = 0;
+ }
+ }
+
+ if (rn > prec)
+ {
+ ASSERT (rn == prec + 1);
+
+ ign += rn - prec;
+ rp += rn - prec;
+ rn = prec;
+ }
+
+ /* With somewhat less than 50% probability, we can skip this copy. */
+ if (passed_rp != rp + off)
+ MPN_COPY_INCR (passed_rp, rp + off, rn);
+ *ignp = ign;
+ return rn;
+}
+
+char *
+mpf_get_str (char *dbuf, mp_exp_t *exp, int base, size_t n_digits, mpf_srcptr u)
+{
+ mp_exp_t ue;
+ mp_size_t n_limbs_needed;
+ size_t max_digits;
+ mp_ptr up, pp, tp;
+ mp_size_t un, pn, tn;
+ unsigned char *tstr;
+ mp_exp_t exp_in_base;
+ size_t n_digits_computed;
+ mp_size_t i;
+ const char *num_to_text;
+ size_t alloc_size = 0;
+ char *dp;
+ TMP_DECL;
+
+ up = PTR(u);
+ un = ABSIZ(u);
+ ue = EXP(u);
+
+ if (base >= 0)
+ {
+ num_to_text = "0123456789abcdefghijklmnopqrstuvwxyz";
+ if (base <= 1)
+ base = 10;
+ else if (base > 36)
+ {
+ num_to_text = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
+ if (base > 62)
+ return NULL;
+ }
+ }
+ else
+ {
+ base = -base;
+ if (base <= 1)
+ base = 10;
+ else if (base > 36)
+ return NULL;
+ num_to_text = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
+ }
+
+ MPF_SIGNIFICANT_DIGITS (max_digits, base, PREC(u));
+ if (n_digits == 0 || n_digits > max_digits)
+ n_digits = max_digits;
+
+ if (dbuf == 0)
+ {
+ /* 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);
+ }
+
+ if (un == 0)
+ {
+ *exp = 0;
+ *dbuf = 0;
+ n_digits = 0;
+ goto done;
+ }
+
+ TMP_MARK;
+
+ /* Allocate temporary digit space. We can't put digits directly in the user
+ area, since we generate more digits than requested. (We allocate
+ 2 * GMP_LIMB_BITS extra bytes because of the digit block nature of the
+ conversion.) */
+ tstr = (unsigned char *) TMP_ALLOC (n_digits + 2 * GMP_LIMB_BITS + 3);
+
+ LIMBS_PER_DIGIT_IN_BASE (n_limbs_needed, n_digits, base);
+
+ if (ue <= n_limbs_needed)
+ {
+ /* We need to multiply number by base^n to get an n_digits integer part. */
+ mp_size_t n_more_limbs_needed, ign, off;
+ unsigned long e;
+
+ n_more_limbs_needed = n_limbs_needed - ue;
+ DIGITS_IN_BASE_PER_LIMB (e, n_more_limbs_needed, base);
+
+ if (un > n_limbs_needed)
+ {
+ up += un - n_limbs_needed;
+ un = n_limbs_needed;
+ }
+ pp = TMP_ALLOC_LIMBS (2 * n_limbs_needed + 2);
+ tp = TMP_ALLOC_LIMBS (2 * n_limbs_needed + 2);
+
+ pn = mpn_pow_1_highpart (pp, &ign, (mp_limb_t) base, e, n_limbs_needed, tp);
+ if (un > pn)
+ mpn_mul (tp, up, un, pp, pn); /* FIXME: mpn_mul_highpart */
+ else
+ mpn_mul (tp, pp, pn, up, un); /* FIXME: mpn_mul_highpart */
+ tn = un + pn;
+ tn -= tp[tn - 1] == 0;
+ off = un - ue - ign;
+ if (off < 0)
+ {
+ MPN_COPY_DECR (tp - off, tp, tn);
+ MPN_ZERO (tp, -off);
+ tn -= off;
+ off = 0;
+ }
+ n_digits_computed = mpn_get_str (tstr, base, tp + off, tn - off);
+
+ exp_in_base = n_digits_computed - e;
+ }
+ else
+ {
+ /* We need to divide number by base^n to get an n_digits integer part. */
+ mp_size_t n_less_limbs_needed, ign, off, xn;
+ unsigned long e;
+ mp_ptr dummyp, xp;
+
+ n_less_limbs_needed = ue - n_limbs_needed;
+ DIGITS_IN_BASE_PER_LIMB (e, n_less_limbs_needed, base);
+
+ if (un > n_limbs_needed)
+ {
+ up += un - n_limbs_needed;
+ un = n_limbs_needed;
+ }
+ pp = TMP_ALLOC_LIMBS (2 * n_limbs_needed + 2);
+ tp = TMP_ALLOC_LIMBS (2 * n_limbs_needed + 2);
+
+ pn = mpn_pow_1_highpart (pp, &ign, (mp_limb_t) base, e, n_limbs_needed, tp);
+
+ xn = n_limbs_needed + (n_less_limbs_needed-ign);
+ xp = TMP_ALLOC_LIMBS (xn);
+ off = xn - un;
+ MPN_ZERO (xp, off);
+ MPN_COPY (xp + off, up, un);
+
+ dummyp = TMP_ALLOC_LIMBS (pn);
+ mpn_tdiv_qr (tp, dummyp, (mp_size_t) 0, xp, xn, pp, pn);
+ tn = xn - pn + 1;
+ tn -= tp[tn - 1] == 0;
+ n_digits_computed = mpn_get_str (tstr, base, tp, tn);
+
+ exp_in_base = n_digits_computed + e;
+ }
+
+ /* We should normally have computed too many digits. Round the result
+ at the point indicated by n_digits. */
+ if (n_digits_computed > n_digits)
+ {
+ size_t i;
+ /* Round the result. */
+ if (tstr[n_digits] * 2 >= base)
+ {
+ n_digits_computed = n_digits;
+ for (i = n_digits - 1;; i--)
+ {
+ unsigned int x;
+ x = ++(tstr[i]);
+ if (x != base)
+ break;
+ n_digits_computed--;
+ if (i == 0)
+ {
+ /* We had something like `bbbbbbb...bd', where 2*d >= base
+ and `b' denotes digit with significance base - 1.
+ This rounds up to `1', increasing the exponent. */
+ tstr[0] = 1;
+ n_digits_computed = 1;
+ exp_in_base++;
+ break;
+ }
+ }
+ }
+ }
+
+ /* We might have fewer digits than requested as a result of rounding above,
+ (i.e. 0.999999 => 1.0) or because we have a number that simply doesn't
+ need many digits in this base (e.g., 0.125 in base 10). */
+ if (n_digits > n_digits_computed)
+ n_digits = n_digits_computed;
+
+ /* Remove trailing 0. There can be many zeros. */
+ while (n_digits != 0 && tstr[n_digits - 1] == 0)
+ n_digits--;
+
+ dp = dbuf + (SIZ(u) < 0);
+
+ /* Translate to ASCII and copy to result string. */
+ for (i = 0; i < n_digits; i++)
+ dp[i] = num_to_text[tstr[i]];
+ dp[n_digits] = 0;
+
+ *exp = exp_in_base;
+
+ if (SIZ(u) < 0)
+ {
+ dbuf[0] = '-';
+ n_digits++;
+ }
+
+ TMP_FREE;
+
+ done:
+ /* If the string was alloced then resize it down to the actual space
+ required. */
+ if (alloc_size != 0)
+ {
+ __GMP_REALLOCATE_FUNC_MAYBE_TYPE (dbuf, alloc_size, n_digits + 1, char);
+ }
+
+ return dbuf;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpf/get_ui.c b/Build/source/libs/gmp/gmp-6.0.0/mpf/get_ui.c
new file mode 100644
index 00000000000..eb9b30e69c0
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpf/get_ui.c
@@ -0,0 +1,102 @@
+/* mpf_get_ui -- mpf to ulong conversion
+
+Copyright 2001, 2002, 2004 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.h"
+#include "gmp-impl.h"
+
+
+/* Any fraction bits are truncated, meaning simply discarded.
+
+ For values bigger than a ulong, the low bits are returned (the low
+ absolute value bits actually), like mpz_get_ui, but this isn't
+ documented.
+
+ Notice this is equivalent to mpz_set_f + mpz_get_ui.
+
+
+ Implementation:
+
+ The limb just above the radix point for us to extract is ptr[size-exp].
+
+ We need to check that the size-exp index falls in our available data
+ range, 0 to size-1 inclusive. We test this without risk of an overflow
+ involving exp by requiring size>=exp (giving size-exp >= 0) and exp>0
+ (giving size-exp <= size-1).
+
+ Notice if size==0 there's no fetch, since of course size>=exp and exp>0
+ can only be true if size>0. So there's no special handling for size==0,
+ it comes out as 0 the same as any other time we have no data at our
+ target index.
+
+ For nails, the second limb above the radix point is also required, this
+ is ptr[size-exp+1].
+
+ Again we need to check that size-exp+1 falls in our data range, 0 to
+ size-1 inclusive. We test without risk of overflow by requiring
+ size+1>=exp (giving size-exp+1 >= 0) and exp>1 (giving size-exp+1 <=
+ size-1).
+
+ And again if size==0 these second fetch conditions are not satisfied
+ either since size+1>=exp and exp>1 are only true if size>0.
+
+ The code is arranged with exp>0 wrapping the exp>1 test since exp>1 is
+ mis-compiled by alpha gcc prior to version 3.4. It re-writes it as
+ exp-1>0, which is incorrect when exp==MP_EXP_T_MIN. By having exp>0
+ tested first we ensure MP_EXP_T_MIN doesn't reach exp>1. */
+
+unsigned long
+mpf_get_ui (mpf_srcptr f) __GMP_NOTHROW
+{
+ mp_size_t size;
+ mp_exp_t exp;
+ mp_srcptr fp;
+ mp_limb_t fl;
+
+ exp = EXP (f);
+ size = SIZ (f);
+ fp = PTR (f);
+
+ fl = 0;
+ if (exp > 0)
+ {
+ /* there are some limbs above the radix point */
+
+ size = ABS (size);
+ if (size >= exp)
+ fl = fp[size-exp];
+
+#if BITS_PER_ULONG > GMP_NUMB_BITS
+ if (exp > 1 && size+1 >= exp)
+ fl += (fp[size-exp+1] << GMP_NUMB_BITS);
+#endif
+ }
+
+ return (unsigned long) fl;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpf/init.c b/Build/source/libs/gmp/gmp-6.0.0/mpf/init.c
new file mode 100644
index 00000000000..d8590f27a71
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpf/init.c
@@ -0,0 +1,42 @@
+/* mpf_init() -- Make a new multiple precision number with value 0.
+
+Copyright 1993-1995, 2000, 2001, 2004 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.h"
+#include "gmp-impl.h"
+
+void
+mpf_init (mpf_ptr r)
+{
+ mp_size_t prec = __gmp_default_fp_limb_precision;
+ r->_mp_size = 0;
+ r->_mp_exp = 0;
+ r->_mp_prec = prec;
+ r->_mp_d = (mp_ptr) (*__gmp_allocate_func) ((size_t) (prec + 1) * GMP_LIMB_BYTES);
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpf/init2.c b/Build/source/libs/gmp/gmp-6.0.0/mpf/init2.c
new file mode 100644
index 00000000000..a7891e33dd3
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpf/init2.c
@@ -0,0 +1,44 @@
+/* mpf_init2() -- Make a new multiple precision number with value 0.
+
+Copyright 1993-1995, 2000, 2001, 2004 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.h"
+#include "gmp-impl.h"
+
+void
+mpf_init2 (mpf_ptr r, mp_bitcnt_t prec_in_bits)
+{
+ mp_size_t prec;
+
+ prec = __GMPF_BITS_TO_PREC (prec_in_bits);
+ r->_mp_size = 0;
+ r->_mp_exp = 0;
+ r->_mp_prec = prec;
+ r->_mp_d = (mp_ptr) (*__gmp_allocate_func) ((size_t) (prec + 1) * GMP_LIMB_BYTES);
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpf/inits.c b/Build/source/libs/gmp/gmp-6.0.0/mpf/inits.c
new file mode 100644
index 00000000000..fb14c6b0fd8
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpf/inits.c
@@ -0,0 +1,49 @@
+/* mpf_inits() -- Initialize multiple mpf_t variables and set them to 0.
+
+Copyright 2009 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 <stdarg.h>
+#include <stdio.h> /* for NULL */
+#include "gmp.h"
+#include "gmp-impl.h"
+
+void
+mpf_inits (mpf_ptr x, ...)
+{
+ va_list ap;
+
+ va_start (ap, x);
+
+ while (x != NULL)
+ {
+ mpf_init (x);
+ x = va_arg (ap, mpf_ptr);
+ }
+ va_end (ap);
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpf/inp_str.c b/Build/source/libs/gmp/gmp-6.0.0/mpf/inp_str.c
new file mode 100644
index 00000000000..45cc34cebba
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpf/inp_str.c
@@ -0,0 +1,93 @@
+/* mpf_inp_str(dest_float, stream, base) -- Input a number in base
+ BASE from stdio stream STREAM and store the result in DEST_FLOAT.
+
+Copyright 1996, 2000-2002, 2005 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 <ctype.h>
+#include "gmp.h"
+#include "gmp-impl.h"
+
+size_t
+mpf_inp_str (mpf_ptr rop, FILE *stream, int base)
+{
+ char *str;
+ size_t alloc_size, str_size;
+ int c;
+ int res;
+ size_t nread;
+
+ if (stream == 0)
+ stream = stdin;
+
+ alloc_size = 100;
+ str = (char *) (*__gmp_allocate_func) (alloc_size);
+ str_size = 0;
+ nread = 0;
+
+ /* Skip whitespace. */
+ do
+ {
+ c = getc (stream);
+ nread++;
+ }
+ while (isspace (c));
+
+ for (;;)
+ {
+ if (str_size >= alloc_size)
+ {
+ size_t old_alloc_size = alloc_size;
+ alloc_size = alloc_size * 3 / 2;
+ str = (char *) (*__gmp_reallocate_func) (str, old_alloc_size, alloc_size);
+ }
+ if (c == EOF || isspace (c))
+ break;
+ str[str_size++] = c;
+ c = getc (stream);
+ }
+ ungetc (c, stream);
+ nread--;
+
+ if (str_size >= alloc_size)
+ {
+ 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[str_size] = 0;
+
+ res = mpf_set_str (rop, str, base);
+ (*__gmp_free_func) (str, alloc_size);
+
+ if (res == -1)
+ return 0; /* error */
+
+ return str_size + nread;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpf/int_p.c b/Build/source/libs/gmp/gmp-6.0.0/mpf/int_p.c
new file mode 100644
index 00000000000..91e62266bef
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpf/int_p.c
@@ -0,0 +1,59 @@
+/* mpf_integer_p -- test whether an mpf is an integer */
+
+/*
+Copyright 2001, 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/. */
+
+#include "gmp.h"
+#include "gmp-impl.h"
+
+
+int
+mpf_integer_p (mpf_srcptr f) __GMP_NOTHROW
+{
+ mp_srcptr ptr;
+ mp_exp_t exp;
+ mp_size_t size, frac, i;
+
+ size = SIZ (f);
+ if (size == 0)
+ return 1; /* zero is an integer */
+
+ exp = EXP (f);
+ if (exp <= 0)
+ return 0; /* has only fraction limbs */
+
+ /* any fraction limbs must be zero */
+ frac = ABS (size) - exp;
+ ptr = PTR (f);
+ for (i = 0; i < frac; i++)
+ if (ptr[i] != 0)
+ return 0;
+
+ return 1;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpf/iset.c b/Build/source/libs/gmp/gmp-6.0.0/mpf/iset.c
new file mode 100644
index 00000000000..c8c35e50e9f
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpf/iset.c
@@ -0,0 +1,62 @@
+/* mpf_init_set -- Initialize a float and assign it from another float.
+
+Copyright 1993-1995, 2000, 2001, 2004 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.h"
+#include "gmp-impl.h"
+
+void
+mpf_init_set (mpf_ptr r, mpf_srcptr s)
+{
+ mp_ptr rp, sp;
+ mp_size_t ssize, size;
+ mp_size_t prec;
+
+ prec = __gmp_default_fp_limb_precision;
+ r->_mp_d = (mp_ptr) (*__gmp_allocate_func) ((size_t) (prec + 1) * GMP_LIMB_BYTES);
+ r->_mp_prec = prec;
+
+ prec++; /* lie not to lose precision in assignment */
+ ssize = s->_mp_size;
+ size = ABS (ssize);
+
+ rp = r->_mp_d;
+ sp = s->_mp_d;
+
+ if (size > prec)
+ {
+ sp += size - prec;
+ size = prec;
+ }
+
+ r->_mp_exp = s->_mp_exp;
+ r->_mp_size = ssize >= 0 ? size : -size;
+
+ MPN_COPY (rp, sp, size);
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpf/iset_d.c b/Build/source/libs/gmp/gmp-6.0.0/mpf/iset_d.c
new file mode 100644
index 00000000000..d128db9b4d3
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpf/iset_d.c
@@ -0,0 +1,42 @@
+/* mpf_init_set_d -- Initialize a float and assign it from a double.
+
+Copyright 1993-1995, 2000, 2001, 2004 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.h"
+#include "gmp-impl.h"
+
+void
+mpf_init_set_d (mpf_ptr r, double val)
+{
+ mp_size_t prec = __gmp_default_fp_limb_precision;
+ r->_mp_prec = prec;
+ r->_mp_d = (mp_ptr) (*__gmp_allocate_func) ((size_t) (prec + 1) * GMP_LIMB_BYTES);
+
+ mpf_set_d (r, val);
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpf/iset_si.c b/Build/source/libs/gmp/gmp-6.0.0/mpf/iset_si.c
new file mode 100644
index 00000000000..f7e9005086c
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpf/iset_si.c
@@ -0,0 +1,58 @@
+/* mpf_init_set_si() -- Initialize a float and assign it from a signed int.
+
+Copyright 1993-1995, 2000, 2001, 2003, 2004, 2012 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.h"
+#include "gmp-impl.h"
+
+void
+mpf_init_set_si (mpf_ptr r, long int val)
+{
+ mp_size_t prec = __gmp_default_fp_limb_precision;
+ mp_size_t size;
+ mp_limb_t vl;
+
+ r->_mp_prec = prec;
+ r->_mp_d = (mp_ptr) (*__gmp_allocate_func) ((size_t) (prec + 1) * GMP_LIMB_BYTES);
+
+ vl = (mp_limb_t) ABS_CAST (unsigned long int, val);
+
+ r->_mp_d[0] = vl & GMP_NUMB_MASK;
+ size = vl != 0;
+
+#if BITS_PER_ULONG > GMP_NUMB_BITS
+ vl >>= GMP_NUMB_BITS;
+ r->_mp_d[1] = vl;
+ size += (vl != 0);
+#endif
+
+ r->_mp_exp = size;
+ r->_mp_size = val >= 0 ? size : -size;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpf/iset_str.c b/Build/source/libs/gmp/gmp-6.0.0/mpf/iset_str.c
new file mode 100644
index 00000000000..a181f80c935
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpf/iset_str.c
@@ -0,0 +1,44 @@
+/* mpf_init_set_str -- Initialize a float and assign it from a string.
+
+Copyright 1995, 1996, 2000, 2001, 2004 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.h"
+#include "gmp-impl.h"
+
+int
+mpf_init_set_str (mpf_ptr r, const char *s, int base)
+{
+ mp_size_t prec = __gmp_default_fp_limb_precision;
+ r->_mp_size = 0;
+ r->_mp_exp = 0;
+ r->_mp_prec = prec;
+ r->_mp_d = (mp_ptr) (*__gmp_allocate_func) ((size_t) (prec + 1) * GMP_LIMB_BYTES);
+
+ return mpf_set_str (r, s, base);
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpf/iset_ui.c b/Build/source/libs/gmp/gmp-6.0.0/mpf/iset_ui.c
new file mode 100644
index 00000000000..f047982116e
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpf/iset_ui.c
@@ -0,0 +1,53 @@
+/* mpf_init_set_ui() -- Initialize a float and assign it from an unsigned int.
+
+Copyright 1993-1995, 2000, 2001, 2003, 2004 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.h"
+#include "gmp-impl.h"
+
+void
+mpf_init_set_ui (mpf_ptr r, unsigned long int val)
+{
+ mp_size_t prec = __gmp_default_fp_limb_precision;
+ mp_size_t size;
+
+ r->_mp_prec = prec;
+ r->_mp_d = (mp_ptr) (*__gmp_allocate_func) ((size_t) (prec + 1) * GMP_LIMB_BYTES);
+ r->_mp_d[0] = val & GMP_NUMB_MASK;
+ size = (val != 0);
+
+#if BITS_PER_ULONG > GMP_NUMB_BITS
+ val >>= GMP_NUMB_BITS;
+ r->_mp_d[1] = val;
+ size += (val != 0);
+#endif
+
+ r->_mp_size = size;
+ r->_mp_exp = size;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpf/mul.c b/Build/source/libs/gmp/gmp-6.0.0/mpf/mul.c
new file mode 100644
index 00000000000..41d1db7c14a
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpf/mul.c
@@ -0,0 +1,96 @@
+/* mpf_mul -- Multiply two floats.
+
+Copyright 1993, 1994, 1996, 2001, 2005 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.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;
+ TMP_DECL;
+
+ TMP_MARK;
+ usize = u->_mp_size;
+ vsize = v->_mp_size;
+ sign_product = usize ^ vsize;
+
+ usize = ABS (usize);
+ vsize = ABS (vsize);
+
+ up = u->_mp_d;
+ vp = v->_mp_d;
+ if (usize > prec)
+ {
+ up += usize - prec;
+ usize = prec;
+ }
+ if (vsize > prec)
+ {
+ vp += vsize - prec;
+ vsize = prec;
+ }
+
+ if (usize == 0 || vsize == 0)
+ {
+ r->_mp_size = 0;
+ r->_mp_exp = 0; /* ??? */
+ }
+ else
+ {
+ mp_size_t rsize;
+ mp_limb_t cy_limb;
+ mp_ptr rp, tp;
+ mp_size_t adj;
+
+ 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;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpf/mul_2exp.c b/Build/source/libs/gmp/gmp-6.0.0/mpf/mul_2exp.c
new file mode 100644
index 00000000000..83df2176d3b
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpf/mul_2exp.c
@@ -0,0 +1,133 @@
+/* mpf_mul_2exp -- Multiply a float by 2^n.
+
+Copyright 1993, 1994, 1996, 2000-2002, 2004 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.h"
+#include "gmp-impl.h"
+
+
+/* Multiples of GMP_NUMB_BITS in exp simply mean an amount added to EXP(u)
+ to set EXP(r). The remainder exp%GMP_NUMB_BITS is then a left shift for
+ the limb data.
+
+ If exp%GMP_NUMB_BITS == 0 then there's no shifting, we effectively just
+ do an mpz_set with changed EXP(r). Like mpz_set we take prec+1 limbs in
+ this case. Although just prec would suffice, it's nice to have
+ mpf_mul_2exp with exp==0 come out the same as mpz_set.
+
+ When shifting we take up to prec many limbs from the input. Our shift is
+ cy = mpn_lshift (PTR(r), PTR(u)+k, size, ...), where k is the number of
+ low limbs dropped from u, and the carry out is stored to PTR(r)[size].
+
+ It may be noted that the low limb PTR(r)[0] doesn't incorporate bits from
+ PTR(u)[k-1] (when k>=1 makes that limb available). Taking just prec
+ limbs from the input (with the high non-zero) is enough bits for the
+ application requested precision, there's no need for extra work.
+
+ If r==u the shift will have overlapping operands. When k==0 (ie. when
+ usize <= prec), the overlap is supported by lshift (ie. dst == src).
+
+ But when r==u and k>=1 (ie. usize > prec), we would have an invalid
+ overlap (ie. mpn_lshift (rp, rp+k, ...)). In this case we must instead
+ use mpn_rshift (PTR(r)+1, PTR(u)+k, size, NUMB-shift) with the carry out
+ stored to PTR(r)[0]. An rshift by NUMB-shift bits like this gives
+ identical data, it's just its overlap restrictions which differ.
+
+ Enhancements:
+
+ The way mpn_lshift is used means successive mpf_mul_2exp calls on the
+ same operand will accumulate low zero limbs, until prec+1 limbs is
+ reached. This is wasteful for subsequent operations. When abs_usize <=
+ prec, we should test the low exp%GMP_NUMB_BITS many bits of PTR(u)[0],
+ ie. those which would be shifted out by an mpn_rshift. If they're zero
+ then use that mpn_rshift. */
+
+void
+mpf_mul_2exp (mpf_ptr r, mpf_srcptr u, mp_bitcnt_t exp)
+{
+ mp_srcptr up;
+ mp_ptr rp = r->_mp_d;
+ mp_size_t usize;
+ mp_size_t abs_usize;
+ mp_size_t prec = r->_mp_prec;
+ mp_exp_t uexp = u->_mp_exp;
+
+ usize = u->_mp_size;
+
+ if (UNLIKELY (usize == 0))
+ {
+ r->_mp_size = 0;
+ r->_mp_exp = 0;
+ return;
+ }
+
+ abs_usize = ABS (usize);
+ up = u->_mp_d;
+
+ if (exp % GMP_NUMB_BITS == 0)
+ {
+ prec++; /* retain more precision here as we don't need
+ to account for carry-out here */
+ if (abs_usize > prec)
+ {
+ up += abs_usize - prec;
+ abs_usize = prec;
+ }
+ if (rp != up)
+ MPN_COPY_INCR (rp, up, abs_usize);
+ r->_mp_exp = uexp + exp / GMP_NUMB_BITS;
+ }
+ else
+ {
+ mp_limb_t cy_limb;
+ mp_size_t adj;
+ if (abs_usize > prec)
+ {
+ up += abs_usize - prec;
+ abs_usize = prec;
+ /* Use mpn_rshift since mpn_lshift operates downwards, and we
+ therefore would clobber part of U before using that part, in case
+ R is the same variable as U. */
+ cy_limb = mpn_rshift (rp + 1, up, abs_usize,
+ GMP_NUMB_BITS - exp % GMP_NUMB_BITS);
+ rp[0] = cy_limb;
+ adj = rp[abs_usize] != 0;
+ }
+ else
+ {
+ cy_limb = mpn_lshift (rp, up, abs_usize, exp % GMP_NUMB_BITS);
+ rp[abs_usize] = cy_limb;
+ adj = cy_limb != 0;
+ }
+
+ abs_usize += adj;
+ r->_mp_exp = uexp + exp / GMP_NUMB_BITS + adj;
+ }
+ r->_mp_size = usize >= 0 ? abs_usize : -abs_usize;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpf/mul_ui.c b/Build/source/libs/gmp/gmp-6.0.0/mpf/mul_ui.c
new file mode 100644
index 00000000000..031b2fe06fe
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpf/mul_ui.c
@@ -0,0 +1,182 @@
+/* mpf_mul_ui -- Multiply a float and an unsigned integer.
+
+Copyright 1993, 1994, 1996, 2001, 2003, 2004 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.h"
+#include "gmp-impl.h"
+#include "longlong.h"
+
+
+/* The core operation is a multiply of PREC(r) limbs from u by v, producing
+ either PREC(r) or PREC(r)+1 result limbs. If u is shorter than PREC(r),
+ then we take only as much as it has. If u is longer we incorporate a
+ carry from the lower limbs.
+
+ If u has just 1 extra limb, then the carry to add is high(up[0]*v). That
+ is of course what mpn_mul_1 would do if it was called with PREC(r)+1
+ limbs of input.
+
+ If u has more than 1 extra limb, then there can be a further carry bit
+ out of lower uncalculated limbs (the way the low of one product adds to
+ the high of the product below it). This is of course what an mpn_mul_1
+ would do if it was called with the full u operand. But we instead work
+ downwards explicitly, until a carry occurs or until a value other than
+ GMP_NUMB_MAX occurs (that being the only value a carry bit can propagate
+ across).
+
+ The carry determination normally requires two umul_ppmm's, only rarely
+ will GMP_NUMB_MAX occur and require further products.
+
+ The carry limb is conveniently added into the mul_1 using mpn_mul_1c when
+ that function exists, otherwise a subsequent mpn_add_1 is needed.
+
+ Clearly when mpn_mul_1c is used the carry must be calculated first. But
+ this is also the case when add_1 is used, since if r==u and ABSIZ(r) >
+ PREC(r) then the mpn_mul_1 overwrites the low part of the input.
+
+ A reuse r==u with size > prec can occur from a size PREC(r)+1 in the
+ usual way, or it can occur from an mpf_set_prec_raw leaving a bigger
+ sized value. In both cases we can end up calling mpn_mul_1 with
+ overlapping src and dst regions, but this will be with dst < src and such
+ an overlap is permitted.
+
+ Not done:
+
+ No attempt is made to determine in advance whether the result will be
+ PREC(r) or PREC(r)+1 limbs. If it's going to be PREC(r)+1 then we could
+ take one less limb from u and generate just PREC(r), that of course
+ satisfying application requested precision. But any test counting bits
+ or forming the high product would almost certainly take longer than the
+ incremental cost of an extra limb in mpn_mul_1.
+
+ Enhancements:
+
+ Repeated mpf_mul_ui's with an even v will accumulate low zero bits on the
+ result, leaving low zero limbs after a while, which it might be nice to
+ strip to save work in subsequent operations. Calculating the low limb
+ explicitly would let us direct mpn_mul_1 to put the balance at rp when
+ the low is zero (instead of normally rp+1). But it's not clear whether
+ this would be worthwhile. Explicit code for the low limb will probably
+ be slower than having it done in mpn_mul_1, so we need to consider how
+ often a zero will be stripped and how much that's likely to save
+ later. */
+
+void
+mpf_mul_ui (mpf_ptr r, mpf_srcptr u, unsigned long int v)
+{
+ mp_srcptr up;
+ mp_size_t usize;
+ mp_size_t size;
+ mp_size_t prec, excess;
+ mp_limb_t cy_limb, vl, cbit, cin;
+ mp_ptr rp;
+
+ usize = u->_mp_size;
+ if (UNLIKELY (v == 0) || UNLIKELY (usize == 0))
+ {
+ r->_mp_size = 0;
+ r->_mp_exp = 0;
+ return;
+ }
+
+#if BITS_PER_ULONG > GMP_NUMB_BITS /* avoid warnings about shift amount */
+ if (v > GMP_NUMB_MAX)
+ {
+ mpf_t vf;
+ mp_limb_t vp[2];
+ vp[0] = v & GMP_NUMB_MASK;
+ vp[1] = v >> GMP_NUMB_BITS;
+ PTR(vf) = vp;
+ SIZ(vf) = 2;
+ ASSERT_CODE (PREC(vf) = 2);
+ EXP(vf) = 2;
+ mpf_mul (r, u, vf);
+ return;
+ }
+#endif
+
+ size = ABS (usize);
+ prec = r->_mp_prec;
+ up = u->_mp_d;
+ vl = v;
+ excess = size - prec;
+ cin = 0;
+
+ if (excess > 0)
+ {
+ /* up is bigger than desired rp, shorten it to prec limbs and
+ determine a carry-in */
+
+ mp_limb_t vl_shifted = vl << GMP_NAIL_BITS;
+ mp_limb_t hi, lo, next_lo, sum;
+ mp_size_t i;
+
+ /* high limb of top product */
+ i = excess - 1;
+ umul_ppmm (cin, lo, up[i], vl_shifted);
+
+ /* and carry bit out of products below that, if any */
+ for (;;)
+ {
+ i--;
+ if (i < 0)
+ break;
+
+ umul_ppmm (hi, next_lo, up[i], vl_shifted);
+ lo >>= GMP_NAIL_BITS;
+ ADDC_LIMB (cbit, sum, hi, lo);
+ cin += cbit;
+ lo = next_lo;
+
+ /* Continue only if the sum is GMP_NUMB_MAX. GMP_NUMB_MAX is the
+ only value a carry from below can propagate across. If we've
+ just seen the carry out (ie. cbit!=0) then sum!=GMP_NUMB_MAX,
+ so this test stops us for that case too. */
+ if (LIKELY (sum != GMP_NUMB_MAX))
+ break;
+ }
+
+ up += excess;
+ size = prec;
+ }
+
+ rp = r->_mp_d;
+#if HAVE_NATIVE_mpn_mul_1c
+ cy_limb = mpn_mul_1c (rp, up, size, vl, cin);
+#else
+ cy_limb = mpn_mul_1 (rp, up, size, vl);
+ __GMPN_ADD_1 (cbit, rp, rp, size, cin);
+ cy_limb += cbit;
+#endif
+ rp[size] = cy_limb;
+ cy_limb = cy_limb != 0;
+ r->_mp_exp = u->_mp_exp + cy_limb;
+ size += cy_limb;
+ r->_mp_size = usize >= 0 ? size : -size;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpf/neg.c b/Build/source/libs/gmp/gmp-6.0.0/mpf/neg.c
new file mode 100644
index 00000000000..553018f306a
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpf/neg.c
@@ -0,0 +1,62 @@
+/* mpf_neg -- Negate a float.
+
+Copyright 1993-1995, 2001 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.h"
+#include "gmp-impl.h"
+
+void
+mpf_neg (mpf_ptr r, mpf_srcptr u)
+{
+ mp_size_t size;
+
+ size = -u->_mp_size;
+ if (r != u)
+ {
+ mp_size_t prec;
+ mp_size_t asize;
+ mp_ptr rp, up;
+
+ prec = r->_mp_prec + 1; /* lie not to lose precision in assignment */
+ asize = ABS (size);
+ rp = r->_mp_d;
+ up = u->_mp_d;
+
+ if (asize > prec)
+ {
+ up += asize - prec;
+ asize = prec;
+ }
+
+ MPN_COPY (rp, up, asize);
+ r->_mp_exp = u->_mp_exp;
+ size = size >= 0 ? asize : -asize;
+ }
+ r->_mp_size = size;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpf/out_str.c b/Build/source/libs/gmp/gmp-6.0.0/mpf/out_str.c
new file mode 100644
index 00000000000..200da748063
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpf/out_str.c
@@ -0,0 +1,117 @@
+/* mpf_out_str (stream, base, n_digits, op) -- Print N_DIGITS digits from
+ the float OP to STREAM in base BASE. Return the number of characters
+ written, or 0 if an error occurred.
+
+Copyright 1996, 1997, 2001, 2002, 2005, 2011 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 _GNU_SOURCE /* for DECIMAL_POINT in langinfo.h */
+
+#include "config.h"
+
+#include <stdio.h>
+#include <string.h>
+
+#if HAVE_LANGINFO_H
+#include <langinfo.h> /* for nl_langinfo */
+#endif
+
+#if HAVE_LOCALE_H
+#include <locale.h> /* for localeconv */
+#endif
+
+#include "gmp.h"
+#include "gmp-impl.h"
+#include "longlong.h"
+
+
+size_t
+mpf_out_str (FILE *stream, int base, size_t n_digits, mpf_srcptr op)
+{
+ char *str;
+ mp_exp_t exp;
+ size_t written;
+ TMP_DECL;
+
+ TMP_MARK;
+
+ if (base == 0)
+ base = 10;
+ if (n_digits == 0)
+ MPF_SIGNIFICANT_DIGITS (n_digits, base, op->_mp_prec);
+
+ if (stream == 0)
+ stream = stdout;
+
+ /* Consider these changes:
+ * Don't allocate memory here for huge n_digits; pass NULL to mpf_get_str.
+ * Make mpf_get_str allocate extra space when passed NULL, to avoid
+ allocating two huge string buffers.
+ * Implement more/other allocation reductions tricks. */
+
+ str = (char *) TMP_ALLOC (n_digits + 2); /* extra for minus sign and \0 */
+
+ mpf_get_str (str, &exp, base, n_digits, op);
+ n_digits = strlen (str);
+
+ written = 0;
+
+ /* Write sign */
+ if (str[0] == '-')
+ {
+ str++;
+ fputc ('-', stream);
+ written = 1;
+ n_digits--;
+ }
+
+ {
+ const char *point = GMP_DECIMAL_POINT;
+ size_t pointlen = strlen (point);
+ putc ('0', stream);
+ fwrite (point, 1, pointlen, stream);
+ written += pointlen + 1;
+ }
+
+ /* Write mantissa */
+ {
+ size_t fwret;
+ fwret = fwrite (str, 1, n_digits, stream);
+ written += fwret;
+ }
+
+ /* Write exponent */
+ {
+ int fpret;
+ fpret = fprintf (stream, (base <= 10 ? "e%ld" : "@%ld"), exp);
+ written += fpret;
+ }
+
+ TMP_FREE;
+ return ferror (stream) ? 0 : written;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpf/pow_ui.c b/Build/source/libs/gmp/gmp-6.0.0/mpf/pow_ui.c
new file mode 100644
index 00000000000..a5af4310590
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpf/pow_ui.c
@@ -0,0 +1,54 @@
+/* mpf_pow_ui -- Compute b^e.
+
+Copyright 1998, 1999, 2001, 2012 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.h"
+#include "gmp-impl.h"
+
+void
+mpf_pow_ui (mpf_ptr r, mpf_srcptr b, unsigned long int e)
+{
+ mpf_t b2;
+
+ mpf_init2 (b2, mpf_get_prec (r));
+ mpf_set (b2, b);
+
+ if ((e & 1) != 0)
+ mpf_set (r, b);
+ else
+ mpf_set_ui (r, 1);
+ while (e >>= 1)
+ {
+ mpf_mul (b2, b2, b2);
+ if ((e & 1) != 0)
+ mpf_mul (r, r, b2);
+ }
+
+ mpf_clear (b2);
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpf/random2.c b/Build/source/libs/gmp/gmp-6.0.0/mpf/random2.c
new file mode 100644
index 00000000000..4d7f37e976d
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpf/random2.c
@@ -0,0 +1,67 @@
+/* mpf_random2 -- Generate a positive random mpf_t of specified size, with
+ long runs of consecutive ones and zeros in the binary representation.
+ Intended for testing of other MP routines.
+
+Copyright 1995, 1996, 2001-2003 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.h"
+#include "gmp-impl.h"
+
+
+void
+mpf_random2 (mpf_ptr x, mp_size_t xs, mp_exp_t exp)
+{
+ mp_size_t xn;
+ mp_size_t prec;
+ mp_limb_t elimb;
+
+ xn = ABS (xs);
+ prec = PREC(x);
+
+ if (xn == 0)
+ {
+ EXP(x) = 0;
+ SIZ(x) = 0;
+ return;
+ }
+
+ if (xn > prec + 1)
+ xn = prec + 1;
+
+ /* General random mantissa. */
+ mpn_random2 (PTR(x), xn);
+
+ /* Generate random exponent. */
+ _gmp_rand (&elimb, RANDS, GMP_NUMB_BITS);
+ exp = ABS (exp);
+ exp = elimb % (2 * exp + 1) - exp;
+
+ EXP(x) = exp;
+ SIZ(x) = xs < 0 ? -xn : xn;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpf/reldiff.c b/Build/source/libs/gmp/gmp-6.0.0/mpf/reldiff.c
new file mode 100644
index 00000000000..f49da081665
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpf/reldiff.c
@@ -0,0 +1,65 @@
+/* mpf_reldiff -- Generate the relative difference of two floats.
+
+Copyright 1996, 2001, 2004, 2005 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.h"
+#include "gmp-impl.h"
+
+
+/* The precision we use for d = x-y is based on what mpf_div will want from
+ the dividend. It calls mpn_div_q to produce a quotient of rprec+1 limbs.
+ So rprec+1 == dsize - xsize + 1, hence dprec = rprec+xsize. */
+
+void
+mpf_reldiff (mpf_t rdiff, mpf_srcptr x, mpf_srcptr y)
+{
+ if (UNLIKELY (SIZ(x) == 0))
+ {
+ mpf_set_ui (rdiff, (unsigned long int) (mpf_sgn (y) != 0));
+ }
+ else
+ {
+ mp_size_t dprec;
+ mpf_t d;
+ TMP_DECL;
+
+ TMP_MARK;
+ dprec = PREC(rdiff) + ABSIZ(x);
+ ASSERT (PREC(rdiff)+1 == dprec - ABSIZ(x) + 1);
+
+ PREC(d) = dprec;
+ PTR(d) = TMP_ALLOC_LIMBS (dprec + 1);
+
+ mpf_sub (d, x, y);
+ SIZ(d) = ABSIZ(d);
+ mpf_div (rdiff, d, x);
+
+ TMP_FREE;
+ }
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpf/set.c b/Build/source/libs/gmp/gmp-6.0.0/mpf/set.c
new file mode 100644
index 00000000000..ec8161d779f
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpf/set.c
@@ -0,0 +1,56 @@
+/* mpf_set -- Assign a float from another float.
+
+Copyright 1993-1995, 2001, 2004 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.h"
+#include "gmp-impl.h"
+
+void
+mpf_set (mpf_ptr r, mpf_srcptr u)
+{
+ mp_ptr rp, up;
+ mp_size_t size, asize;
+ mp_size_t prec;
+
+ prec = r->_mp_prec + 1; /* lie not to lose precision in assignment */
+ size = u->_mp_size;
+ asize = ABS (size);
+ rp = r->_mp_d;
+ up = u->_mp_d;
+
+ if (asize > prec)
+ {
+ up += asize - prec;
+ asize = prec;
+ }
+
+ r->_mp_exp = u->_mp_exp;
+ r->_mp_size = size >= 0 ? asize : -asize;
+ MPN_COPY_INCR (rp, up, asize);
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpf/set_d.c b/Build/source/libs/gmp/gmp-6.0.0/mpf/set_d.c
new file mode 100644
index 00000000000..100194d1167
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpf/set_d.c
@@ -0,0 +1,60 @@
+/* mpf_set_d -- Assign a float from a double.
+
+Copyright 1993-1996, 2001, 2003, 2004 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 "config.h"
+
+#if HAVE_FLOAT_H
+#include <float.h> /* for DBL_MAX */
+#endif
+
+#include "gmp.h"
+#include "gmp-impl.h"
+
+void
+mpf_set_d (mpf_ptr r, double d)
+{
+ int negative;
+
+ DOUBLE_NAN_INF_ACTION (d,
+ __gmp_invalid_operation (),
+ __gmp_invalid_operation ());
+
+ if (UNLIKELY (d == 0))
+ {
+ SIZ(r) = 0;
+ EXP(r) = 0;
+ return;
+ }
+ negative = d < 0;
+ d = ABS (d);
+
+ SIZ(r) = negative ? -LIMBS_PER_DOUBLE : LIMBS_PER_DOUBLE;
+ EXP(r) = __gmp_extract_double (PTR(r), d);
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpf/set_dfl_prec.c b/Build/source/libs/gmp/gmp-6.0.0/mpf/set_dfl_prec.c
new file mode 100644
index 00000000000..04c9a551354
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpf/set_dfl_prec.c
@@ -0,0 +1,40 @@
+/* mpf_set_default_prec --
+
+Copyright 1993-1995, 2001 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.h"
+#include "gmp-impl.h"
+
+mp_size_t __gmp_default_fp_limb_precision = __GMPF_BITS_TO_PREC (53);
+
+void
+mpf_set_default_prec (mp_bitcnt_t prec_in_bits) __GMP_NOTHROW
+{
+ __gmp_default_fp_limb_precision = __GMPF_BITS_TO_PREC (prec_in_bits);
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpf/set_prc.c b/Build/source/libs/gmp/gmp-6.0.0/mpf/set_prc.c
new file mode 100644
index 00000000000..30ba06c6e65
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpf/set_prc.c
@@ -0,0 +1,69 @@
+/* mpf_set_prec(x) -- Change the precision of x.
+
+Copyright 1993-1995, 2000, 2001 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.h"
+#include "gmp-impl.h"
+
+
+/* A full new_prec+1 limbs are always retained, even though just new_prec
+ would satisfy the requested precision. If size==new_prec+1 then
+ certainly new_prec+1 should be kept since no copying is needed in that
+ case. If just new_prec was kept for size>new_prec+1 it'd be a bit
+ inconsistent. */
+
+void
+mpf_set_prec (mpf_ptr x, mp_bitcnt_t new_prec_in_bits)
+{
+ mp_size_t old_prec, new_prec, new_prec_plus1;
+ mp_size_t size, sign;
+ mp_ptr xp;
+
+ new_prec = __GMPF_BITS_TO_PREC (new_prec_in_bits);
+ old_prec = PREC(x);
+
+ /* do nothing if already the right precision */
+ if (new_prec == old_prec)
+ return;
+
+ PREC(x) = new_prec;
+ new_prec_plus1 = new_prec + 1;
+
+ /* retain most significant limbs */
+ sign = SIZ(x);
+ size = ABS (sign);
+ xp = PTR(x);
+ if (size > new_prec_plus1)
+ {
+ SIZ(x) = (sign >= 0 ? new_prec_plus1 : -new_prec_plus1);
+ MPN_COPY_INCR (xp, xp + size - new_prec_plus1, new_prec_plus1);
+ }
+
+ PTR(x) = __GMP_REALLOCATE_FUNC_LIMBS (xp, old_prec+1, new_prec_plus1);
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpf/set_prc_raw.c b/Build/source/libs/gmp/gmp-6.0.0/mpf/set_prc_raw.c
new file mode 100644
index 00000000000..77994422994
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpf/set_prc_raw.c
@@ -0,0 +1,40 @@
+/* mpf_set_prec_raw(x,bits) -- Change the precision of x without changing
+ allocation. For proper operation, the original precision need to be reset
+ sooner or later.
+
+Copyright 1996, 2001 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.h"
+#include "gmp-impl.h"
+
+void
+mpf_set_prec_raw (mpf_ptr x, mp_bitcnt_t prec_in_bits) __GMP_NOTHROW
+{
+ x->_mp_prec = __GMPF_BITS_TO_PREC (prec_in_bits);
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpf/set_q.c b/Build/source/libs/gmp/gmp-6.0.0/mpf/set_q.c
new file mode 100644
index 00000000000..c5739b2abec
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpf/set_q.c
@@ -0,0 +1,155 @@
+/* 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.
+
+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> /* 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).
+
+ 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.
+
+ 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
+ could make that comparison and use qsize==prec instead of qsize==prec+1,
+ 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)
+{
+ 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_exp_t exp;
+ TMP_DECL;
+
+ ASSERT (SIZ(&q->_mp_den) > 0); /* canonical q */
+
+ nsize = SIZ (&q->_mp_num);
+ dsize = SIZ (&q->_mp_den);
+
+ if (UNLIKELY (nsize == 0))
+ {
+ SIZ (r) = 0;
+ EXP (r) = 0;
+ return;
+ }
+
+ TMP_MARK;
+
+ prec = PREC (r);
+ qp = PTR (r);
+
+ sign_quotient = nsize;
+ nsize = ABS (nsize);
+ np = PTR (&q->_mp_num);
+ dp = PTR (&q->_mp_den);
+
+ prospective_qsize = nsize - dsize + 1; /* q from using given n,d sizes */
+ 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 */
+
+ 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;
+ }
+ 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);
+
+ /* strip possible zero high limb */
+ high_zero = (qp[qsize-1] == 0);
+ qsize -= high_zero;
+ exp -= high_zero;
+
+ EXP (r) = exp;
+ SIZ (r) = sign_quotient >= 0 ? qsize : -qsize;
+
+ TMP_FREE;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpf/set_si.c b/Build/source/libs/gmp/gmp-6.0.0/mpf/set_si.c
new file mode 100644
index 00000000000..9c47c7511ff
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpf/set_si.c
@@ -0,0 +1,53 @@
+/* mpf_set_si() -- Assign a float from a signed int.
+
+Copyright 1993-1995, 2000-2002, 2004, 2012 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.h"
+#include "gmp-impl.h"
+
+void
+mpf_set_si (mpf_ptr dest, long val)
+{
+ mp_size_t size;
+ mp_limb_t vl;
+
+ vl = (mp_limb_t) ABS_CAST (unsigned long int, val);
+
+ dest->_mp_d[0] = vl & GMP_NUMB_MASK;
+ size = vl != 0;
+
+#if BITS_PER_ULONG > GMP_NUMB_BITS
+ vl >>= GMP_NUMB_BITS;
+ dest->_mp_d[1] = vl;
+ size += (vl != 0);
+#endif
+
+ dest->_mp_exp = size;
+ dest->_mp_size = val >= 0 ? size : -size;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpf/set_str.c b/Build/source/libs/gmp/gmp-6.0.0/mpf/set_str.c
new file mode 100644
index 00000000000..9053accadeb
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpf/set_str.c
@@ -0,0 +1,402 @@
+/* mpf_set_str (dest, string, base) -- Convert the string STRING
+ 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.
+
+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/. */
+
+/*
+ This still needs work, as suggested by some FIXME comments.
+ 1. Don't depend on superfluous mantissa digits.
+ 2. Allocate temp space more cleverly.
+ 3. Use mpn_div_q instead of mpn_lshift+mpn_divrem.
+*/
+
+#define _GNU_SOURCE /* for DECIMAL_POINT in langinfo.h */
+
+#include "config.h"
+
+#include <stdlib.h>
+#include <string.h>
+#include <ctype.h>
+
+#if HAVE_LANGINFO_H
+#include <langinfo.h> /* for nl_langinfo */
+#endif
+
+#if HAVE_LOCALE_H
+#include <locale.h> /* for localeconv */
+#endif
+
+#include "gmp.h"
+#include "gmp-impl.h"
+#include "longlong.h"
+
+
+#define digit_value_tab __gmp_digit_value_tab
+
+/* Compute base^exp and return the most significant prec limbs in rp[].
+ Put the count of omitted low limbs in *ign.
+ Return the actual size (which might be less than prec). */
+static mp_size_t
+mpn_pow_1_highpart (mp_ptr rp, mp_size_t *ignp,
+ mp_limb_t base, mp_exp_t exp,
+ mp_size_t prec, mp_ptr tp)
+{
+ mp_size_t ign; /* counts number of ignored low limbs in r */
+ mp_size_t off; /* keeps track of offset where value starts */
+ mp_ptr passed_rp = rp;
+ mp_size_t rn;
+ int cnt;
+ int i;
+
+ rp[0] = base;
+ rn = 1;
+ off = 0;
+ ign = 0;
+ count_leading_zeros (cnt, exp);
+ for (i = GMP_LIMB_BITS - cnt - 2; i >= 0; i--)
+ {
+ mpn_sqr (tp, rp + off, rn);
+ rn = 2 * rn;
+ rn -= tp[rn - 1] == 0;
+ ign <<= 1;
+
+ off = 0;
+ if (rn > prec)
+ {
+ ign += rn - prec;
+ off = rn - prec;
+ rn = prec;
+ }
+ MP_PTR_SWAP (rp, tp);
+
+ if (((exp >> i) & 1) != 0)
+ {
+ mp_limb_t cy;
+ cy = mpn_mul_1 (rp, rp + off, rn, base);
+ rp[rn] = cy;
+ rn += cy != 0;
+ off = 0;
+ }
+ }
+
+ if (rn > prec)
+ {
+ ign += rn - prec;
+ rp += rn - prec;
+ rn = prec;
+ }
+
+ MPN_COPY_INCR (passed_rp, rp + off, rn);
+ *ignp = ign;
+ return rn;
+}
+
+int
+mpf_set_str (mpf_ptr x, const char *str, int base)
+{
+ size_t str_size;
+ char *s, *begs;
+ size_t i, j;
+ int c;
+ int negative;
+ char *dotpos = 0;
+ const char *expptr;
+ int exp_base;
+ const char *point = GMP_DECIMAL_POINT;
+ size_t pointlen = strlen (point);
+ const unsigned char *digit_value;
+ TMP_DECL;
+
+ c = (unsigned char) *str;
+
+ /* Skip whitespace. */
+ while (isspace (c))
+ c = (unsigned char) *++str;
+
+ negative = 0;
+ if (c == '-')
+ {
+ negative = 1;
+ c = (unsigned char) *++str;
+ }
+
+ /* Default base to decimal. */
+ if (base == 0)
+ base = 10;
+
+ exp_base = base;
+
+ if (base < 0)
+ {
+ exp_base = 10;
+ base = -base;
+ }
+
+ digit_value = digit_value_tab;
+ if (base > 36)
+ {
+ /* For bases > 36, use the collating sequence
+ 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz. */
+ digit_value += 208;
+ if (base > 62)
+ return -1; /* too large base */
+ }
+
+ /* Require at least one digit, possibly after an initial decimal point. */
+ if (digit_value[c] >= base)
+ {
+ /* not a digit, must be a decimal point */
+ for (i = 0; i < pointlen; i++)
+ if (str[i] != point[i])
+ return -1;
+ if (digit_value[(unsigned char) str[pointlen]] >= base)
+ return -1;
+ }
+
+ /* Locate exponent part of the input. Look from the right of the string,
+ since the exponent is usually a lot shorter than the mantissa. */
+ expptr = NULL;
+ str_size = strlen (str);
+ for (i = str_size - 1; i > 0; i--)
+ {
+ c = (unsigned char) str[i];
+ if (c == '@' || (base <= 10 && (c == 'e' || c == 'E')))
+ {
+ expptr = str + i + 1;
+ str_size = i;
+ break;
+ }
+ }
+
+ TMP_MARK;
+ s = begs = (char *) TMP_ALLOC (str_size + 1);
+
+ /* Loop through mantissa, converting it from ASCII to raw byte values. */
+ for (i = 0; i < str_size; i++)
+ {
+ c = (unsigned char) *str;
+ if (!isspace (c))
+ {
+ int dig;
+
+ for (j = 0; j < pointlen; j++)
+ if (str[j] != point[j])
+ goto not_point;
+ if (1)
+ {
+ if (dotpos != 0)
+ {
+ /* already saw a decimal point, another is invalid */
+ TMP_FREE;
+ return -1;
+ }
+ dotpos = s;
+ str += pointlen - 1;
+ i += pointlen - 1;
+ }
+ else
+ {
+ not_point:
+ dig = digit_value[c];
+ if (dig >= base)
+ {
+ TMP_FREE;
+ return -1;
+ }
+ *s++ = dig;
+ }
+ }
+ c = (unsigned char) *++str;
+ }
+
+ str_size = s - begs;
+
+ {
+ long exp_in_base;
+ mp_size_t ra, ma, rn, mn;
+ int cnt;
+ mp_ptr mp, tp, rp;
+ mp_exp_t exp_in_limbs;
+ mp_size_t prec = PREC(x) + 1;
+ int divflag;
+ mp_size_t madj, radj;
+
+#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. */
+ /* 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)
+ 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)
+ {
+ SIZ(x) = 0;
+ EXP(x) = 0;
+ TMP_FREE;
+ return 0;
+ }
+
+ madj = 0;
+ /* Ignore excess limbs in MP,MSIZE. */
+ if (mn > prec)
+ {
+ madj = mn - prec;
+ mp += mn - prec;
+ mn = prec;
+ }
+
+ if (expptr != 0)
+ {
+ /* Scan and convert the exponent, in base exp_base. */
+ long dig, minus, plusminus;
+ c = (unsigned char) *expptr;
+ minus = -(long) (c == '-');
+ plusminus = minus | -(long) (c == '+');
+ expptr -= plusminus; /* conditional increment */
+ c = (unsigned char) *expptr++;
+ dig = digit_value[c];
+ if (dig >= exp_base)
+ {
+ TMP_FREE;
+ return -1;
+ }
+ exp_in_base = dig;
+ c = (unsigned char) *expptr++;
+ dig = digit_value[c];
+ while (dig < exp_base)
+ {
+ exp_in_base = exp_in_base * exp_base;
+ exp_in_base += dig;
+ c = (unsigned char) *expptr++;
+ dig = digit_value[c];
+ }
+ exp_in_base = (exp_in_base ^ minus) - minus; /* conditional negation */
+ }
+ else
+ exp_in_base = 0;
+ if (dotpos != 0)
+ exp_in_base -= s - dotpos;
+ divflag = exp_in_base < 0;
+ exp_in_base = ABS (exp_in_base);
+
+ if (exp_in_base == 0)
+ {
+ MPN_COPY (PTR(x), mp, mn);
+ SIZ(x) = negative ? -mn : mn;
+ EXP(x) = mn + madj;
+ TMP_FREE;
+ return 0;
+ }
+
+ ra = 2 * (prec + 1);
+ rp = TMP_ALLOC_LIMBS (ra);
+ tp = TMP_ALLOC_LIMBS (ra);
+ rn = mpn_pow_1_highpart (rp, &radj, (mp_limb_t) base, exp_in_base, prec, tp);
+
+ if (divflag)
+ {
+#if 0
+ /* FIXME: Should use mpn_div_q here. */
+ ...
+ mpn_div_q (tp, mp, mn, rp, rn, scratch);
+ ...
+#else
+ mp_ptr qp;
+ mp_limb_t qlimb;
+ if (mn < rn)
+ {
+ /* Pad out MP,MSIZE for current divrem semantics. */
+ mp_ptr tmp = TMP_ALLOC_LIMBS (rn + 1);
+ MPN_ZERO (tmp, rn - mn);
+ MPN_COPY (tmp + rn - mn, mp, mn);
+ mp = tmp;
+ madj -= rn - mn;
+ mn = rn;
+ }
+ if ((rp[rn - 1] & GMP_NUMB_HIGHBIT) == 0)
+ {
+ mp_limb_t cy;
+ count_leading_zeros (cnt, rp[rn - 1]);
+ cnt -= GMP_NAIL_BITS;
+ mpn_lshift (rp, rp, rn, cnt);
+ cy = mpn_lshift (mp, mp, mn, cnt);
+ if (cy)
+ mp[mn++] = cy;
+ }
+
+ qp = TMP_ALLOC_LIMBS (prec + 1);
+ qlimb = mpn_divrem (qp, prec - (mn - rn), mp, mn, rp, rn);
+ tp = qp;
+ exp_in_limbs = qlimb + (mn - rn) + (madj - radj);
+ rn = prec;
+ if (qlimb != 0)
+ {
+ tp[prec] = qlimb;
+ /* Skip the least significant limb not to overrun the destination
+ variable. */
+ tp++;
+ }
+#endif
+ }
+ else
+ {
+ tp = TMP_ALLOC_LIMBS (rn + mn);
+ if (rn > mn)
+ mpn_mul (tp, rp, rn, mp, mn);
+ else
+ mpn_mul (tp, mp, mn, rp, rn);
+ rn += mn;
+ rn -= tp[rn - 1] == 0;
+ exp_in_limbs = rn + madj + radj;
+
+ if (rn > prec)
+ {
+ tp += rn - prec;
+ rn = prec;
+ exp_in_limbs += 0;
+ }
+ }
+
+ MPN_COPY (PTR(x), tp, rn);
+ SIZ(x) = negative ? -rn : rn;
+ EXP(x) = exp_in_limbs;
+ TMP_FREE;
+ return 0;
+ }
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpf/set_ui.c b/Build/source/libs/gmp/gmp-6.0.0/mpf/set_ui.c
new file mode 100644
index 00000000000..617bce13c14
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpf/set_ui.c
@@ -0,0 +1,49 @@
+/* mpf_set_ui() -- Assign a float from an unsigned int.
+
+Copyright 1993-1995, 2001, 2002, 2004 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.h"
+#include "gmp-impl.h"
+
+void
+mpf_set_ui (mpf_ptr f, unsigned long val)
+{
+ mp_size_t size;
+
+ f->_mp_d[0] = val & GMP_NUMB_MASK;
+ size = val != 0;
+
+#if BITS_PER_ULONG > GMP_NUMB_BITS
+ val >>= GMP_NUMB_BITS;
+ f->_mp_d[1] = val;
+ size += (val != 0);
+#endif
+
+ f->_mp_exp = f->_mp_size = size;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpf/set_z.c b/Build/source/libs/gmp/gmp-6.0.0/mpf/set_z.c
new file mode 100644
index 00000000000..fe91904563d
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpf/set_z.c
@@ -0,0 +1,57 @@
+/* mpf_set_z -- Assign a float from an integer.
+
+Copyright 1996, 2001, 2004 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.h"
+#include "gmp-impl.h"
+
+void
+mpf_set_z (mpf_ptr r, mpz_srcptr u)
+{
+ mp_ptr rp, up;
+ mp_size_t size, asize;
+ mp_size_t prec;
+
+ prec = PREC (r) + 1;
+ size = SIZ (u);
+ asize = ABS (size);
+ rp = PTR (r);
+ up = PTR (u);
+
+ EXP (r) = asize;
+
+ if (asize > prec)
+ {
+ up += asize - prec;
+ asize = prec;
+ }
+
+ SIZ (r) = size >= 0 ? asize : -asize;
+ MPN_COPY (rp, up, asize);
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpf/size.c b/Build/source/libs/gmp/gmp-6.0.0/mpf/size.c
new file mode 100644
index 00000000000..c6b22b64cc3
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpf/size.c
@@ -0,0 +1,39 @@
+/* mpf_size(x) -- return the number of limbs currently used by the
+ value of the float X.
+
+Copyright 1993-1995, 2001 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.h"
+#include "gmp-impl.h"
+
+size_t
+mpf_size (mpf_srcptr f) __GMP_NOTHROW
+{
+ return __GMP_ABS (f->_mp_size);
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpf/sqrt.c b/Build/source/libs/gmp/gmp-6.0.0/mpf/sqrt.c
new file mode 100644
index 00000000000..44502244e24
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpf/sqrt.c
@@ -0,0 +1,113 @@
+/* mpf_sqrt -- Compute the square root of a float.
+
+Copyright 1993, 1994, 1996, 2000, 2001, 2004, 2005, 2012 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> /* for NULL */
+#include "gmp.h"
+#include "gmp-impl.h"
+
+
+/* As usual, the aim is to produce PREC(r) limbs of result, with the high
+ limb non-zero. This is accomplished by applying mpn_sqrtrem to either
+ 2*prec or 2*prec-1 limbs, both such sizes resulting in prec limbs.
+
+ The choice between 2*prec or 2*prec-1 limbs is based on the input
+ exponent. With b=2^GMP_NUMB_BITS the limb base then we can think of
+ effectively taking out a factor b^(2k), for suitable k, to get to an
+ integer input of the desired size ready for mpn_sqrtrem. It must be an
+ even power taken out, ie. an even number of limbs, so the square root
+ gives factor b^k and the radix point is still on a limb boundary. So if
+ EXP(r) is even we'll get an even number of input limbs 2*prec, or if
+ EXP(r) is odd we get an odd number 2*prec-1.
+
+ Further limbs below the 2*prec or 2*prec-1 used don't affect the result
+ and are simply truncated. This can be seen by considering an integer x,
+ with s=floor(sqrt(x)). s is the unique integer satisfying s^2 <= x <
+ (s+1)^2. Notice that adding a fraction part to x (ie. some further bits)
+ doesn't change the inequality, s remains the unique solution. Working
+ suitable factors of 2 into this argument lets it apply to an intended
+ precision at any position for any x, not just the integer binary point.
+
+ If the input is smaller than 2*prec or 2*prec-1, then we just pad with
+ zeros, that of course being our usual interpretation of short inputs.
+ The effect is to extend the root beyond the size of the input (for
+ instance into fractional limbs if u is an integer). */
+
+void
+mpf_sqrt (mpf_ptr r, mpf_srcptr u)
+{
+ mp_size_t usize;
+ mp_ptr up, tp;
+ mp_size_t prec, tsize;
+ mp_exp_t uexp, expodd;
+ TMP_DECL;
+
+ usize = u->_mp_size;
+ if (UNLIKELY (usize <= 0))
+ {
+ if (usize < 0)
+ SQRT_OF_NEGATIVE;
+ r->_mp_size = 0;
+ r->_mp_exp = 0;
+ return;
+ }
+
+ TMP_MARK;
+
+ uexp = u->_mp_exp;
+ prec = r->_mp_prec;
+ up = u->_mp_d;
+
+ expodd = (uexp & 1);
+ tsize = 2 * prec - expodd;
+ r->_mp_size = prec;
+ r->_mp_exp = (uexp + expodd) / 2; /* ceil(uexp/2) */
+
+ /* root size is ceil(tsize/2), this will be our desired "prec" limbs */
+ ASSERT ((tsize + 1) / 2 == prec);
+
+ tp = TMP_ALLOC_LIMBS (tsize);
+
+ if (usize > tsize)
+ {
+ up += usize - tsize;
+ usize = tsize;
+ MPN_COPY (tp, up, tsize);
+ }
+ else
+ {
+ MPN_ZERO (tp, tsize - usize);
+ MPN_COPY (tp + (tsize - usize), up, usize);
+ }
+
+ mpn_sqrtrem (r->_mp_d, NULL, tp, tsize);
+
+ TMP_FREE;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpf/sqrt_ui.c b/Build/source/libs/gmp/gmp-6.0.0/mpf/sqrt_ui.c
new file mode 100644
index 00000000000..82dec7bcb38
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpf/sqrt_ui.c
@@ -0,0 +1,109 @@
+/* mpf_sqrt_ui -- Compute the square root of an unsigned integer.
+
+Copyright 1993, 1994, 1996, 2000, 2001, 2004, 2005 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> /* for NULL */
+#include "gmp.h"
+#include "gmp-impl.h"
+
+
+/* As usual the aim is to produce PREC(r) limbs of result with the high limb
+ non-zero. That high limb will end up floor(sqrt(u)), and limbs below are
+ produced by padding the input with zeros, two for each desired result
+ limb, being 2*(prec-1) for a total 2*prec-1 limbs passed to mpn_sqrtrem.
+ The way mpn_sqrtrem calculates floor(sqrt(x)) ensures the root is correct
+ to the intended accuracy, ie. truncated to prec limbs.
+
+ With nails, u might be two limbs, in which case a total 2*prec limbs is
+ passed to mpn_sqrtrem (still giving a prec limb result). If uhigh is
+ zero we adjust back to 2*prec-1, since mpn_sqrtrem requires the high
+ non-zero. 2*prec limbs are always allocated, even when uhigh is zero, so
+ the store of uhigh can be done without a conditional.
+
+ u==0 is a special case so the rest of the code can assume the result is
+ non-zero (ie. will have a non-zero high limb on the result).
+
+ Not done:
+
+ No attempt is made to identify perfect squares. It's considered this can
+ be left to an application if it might occur with any frequency. As it
+ stands, mpn_sqrtrem does its normal amount of work on a perfect square
+ followed by zero limbs, though of course only an mpn_sqrtrem1 would be
+ actually needed. We also end up leaving our mpf result with lots of low
+ trailing zeros, slowing down subsequent operations.
+
+ We're not aware of any optimizations that can be made using the fact the
+ input has lots of trailing zeros (apart from the perfect square
+ case). */
+
+
+/* 1 if we (might) need two limbs for u */
+#define U2 (GMP_NUMB_BITS < BITS_PER_ULONG)
+
+void
+mpf_sqrt_ui (mpf_ptr r, unsigned long int u)
+{
+ mp_size_t rsize, zeros;
+ mp_ptr tp;
+ mp_size_t prec;
+ TMP_DECL;
+
+ if (UNLIKELY (u == 0))
+ {
+ r->_mp_size = 0;
+ r->_mp_exp = 0;
+ return;
+ }
+
+ TMP_MARK;
+
+ prec = r->_mp_prec;
+ zeros = 2 * prec - 2;
+ rsize = zeros + 1 + U2;
+
+ tp = TMP_ALLOC_LIMBS (rsize);
+
+ MPN_ZERO (tp, zeros);
+ tp[zeros] = u & GMP_NUMB_MASK;
+
+#if U2
+ {
+ mp_limb_t uhigh = u >> GMP_NUMB_BITS;
+ tp[zeros + 1] = uhigh;
+ rsize -= (uhigh == 0);
+ }
+#endif
+
+ mpn_sqrtrem (r->_mp_d, NULL, tp, rsize);
+
+ r->_mp_size = prec;
+ r->_mp_exp = 1;
+ TMP_FREE;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpf/sub.c b/Build/source/libs/gmp/gmp-6.0.0/mpf/sub.c
new file mode 100644
index 00000000000..3aaf192790a
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpf/sub.c
@@ -0,0 +1,419 @@
+/* mpf_sub -- Subtract two floats.
+
+Copyright 1993-1996, 1999-2002, 2004, 2005, 2011 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.h"
+#include "gmp-impl.h"
+
+void
+mpf_sub (mpf_ptr r, mpf_srcptr u, mpf_srcptr v)
+{
+ mp_srcptr up, vp;
+ mp_ptr rp, tp;
+ mp_size_t usize, vsize, rsize;
+ mp_size_t prec;
+ mp_exp_t exp;
+ mp_size_t ediff;
+ int negate;
+ TMP_DECL;
+
+ usize = u->_mp_size;
+ vsize = v->_mp_size;
+
+ /* Handle special cases that don't work in generic code below. */
+ if (usize == 0)
+ {
+ mpf_neg (r, v);
+ return;
+ }
+ if (vsize == 0)
+ {
+ if (r != u)
+ mpf_set (r, u);
+ return;
+ }
+
+ /* If signs of U and V are different, perform addition. */
+ if ((usize ^ vsize) < 0)
+ {
+ __mpf_struct v_negated;
+ v_negated._mp_size = -vsize;
+ v_negated._mp_exp = v->_mp_exp;
+ v_negated._mp_d = v->_mp_d;
+ mpf_add (r, u, &v_negated);
+ return;
+ }
+
+ TMP_MARK;
+
+ /* Signs are now known to be the same. */
+ negate = usize < 0;
+
+ /* Make U be the operand with the largest exponent. */
+ if (u->_mp_exp < v->_mp_exp)
+ {
+ mpf_srcptr t;
+ t = u; u = v; v = t;
+ negate ^= 1;
+ usize = u->_mp_size;
+ vsize = v->_mp_size;
+ }
+
+ usize = ABS (usize);
+ vsize = ABS (vsize);
+ up = u->_mp_d;
+ vp = v->_mp_d;
+ rp = r->_mp_d;
+ prec = r->_mp_prec + 1;
+ exp = u->_mp_exp;
+ ediff = u->_mp_exp - v->_mp_exp;
+
+ /* If ediff is 0 or 1, we might have a situation where the operands are
+ extremely close. We need to scan the operands from the most significant
+ end ignore the initial parts that are equal. */
+ if (ediff <= 1)
+ {
+ if (ediff == 0)
+ {
+ /* Skip leading limbs in U and V that are equal. */
+ if (up[usize - 1] == vp[vsize - 1])
+ {
+ /* This loop normally exits immediately. Optimize for that. */
+ do
+ {
+ usize--;
+ vsize--;
+ exp--;
+
+ if (usize == 0)
+ {
+ /* u cancels high limbs of v, result is rest of v */
+ negate ^= 1;
+ cancellation:
+ /* strip high zeros before truncating to prec */
+ while (vsize != 0 && vp[vsize - 1] == 0)
+ {
+ vsize--;
+ exp--;
+ }
+ if (vsize > prec)
+ {
+ vp += vsize - prec;
+ vsize = prec;
+ }
+ MPN_COPY_INCR (rp, vp, vsize);
+ rsize = vsize;
+ goto done;
+ }
+ if (vsize == 0)
+ {
+ vp = up;
+ vsize = usize;
+ goto cancellation;
+ }
+ }
+ while (up[usize - 1] == vp[vsize - 1]);
+ }
+
+ if (up[usize - 1] < vp[vsize - 1])
+ {
+ /* For simplicity, swap U and V. Note that since the loop above
+ wouldn't have exited unless up[usize - 1] and vp[vsize - 1]
+ were non-equal, this if-statement catches all cases where U
+ is smaller than V. */
+ MPN_SRCPTR_SWAP (up,usize, vp,vsize);
+ negate ^= 1;
+ /* negating ediff not necessary since it is 0. */
+ }
+
+ /* Check for
+ x+1 00000000 ...
+ x ffffffff ... */
+ if (up[usize - 1] != vp[vsize - 1] + 1)
+ goto general_case;
+ usize--;
+ vsize--;
+ exp--;
+ }
+ else /* ediff == 1 */
+ {
+ /* Check for
+ 1 00000000 ...
+ 0 ffffffff ... */
+
+ if (up[usize - 1] != 1 || vp[vsize - 1] != GMP_NUMB_MAX
+ || (usize >= 2 && up[usize - 2] != 0))
+ goto general_case;
+
+ usize--;
+ exp--;
+ }
+
+ /* Skip sequences of 00000000/ffffffff */
+ while (vsize != 0 && usize != 0 && up[usize - 1] == 0
+ && vp[vsize - 1] == GMP_NUMB_MAX)
+ {
+ usize--;
+ vsize--;
+ exp--;
+ }
+
+ if (usize == 0)
+ {
+ while (vsize != 0 && vp[vsize - 1] == GMP_NUMB_MAX)
+ {
+ vsize--;
+ exp--;
+ }
+ }
+
+ if (usize > prec - 1)
+ {
+ up += usize - (prec - 1);
+ usize = prec - 1;
+ }
+ if (vsize > prec - 1)
+ {
+ vp += vsize - (prec - 1);
+ vsize = prec - 1;
+ }
+
+ tp = TMP_ALLOC_LIMBS (prec);
+ {
+ mp_limb_t cy_limb;
+ if (vsize == 0)
+ {
+ mp_size_t size, i;
+ size = usize;
+ for (i = 0; i < size; i++)
+ tp[i] = up[i];
+ tp[size] = 1;
+ rsize = size + 1;
+ exp++;
+ goto normalize;
+ }
+ if (usize == 0)
+ {
+ mp_size_t size, i;
+ size = vsize;
+ for (i = 0; i < size; i++)
+ tp[i] = ~vp[i] & GMP_NUMB_MASK;
+ cy_limb = 1 - mpn_add_1 (tp, tp, vsize, (mp_limb_t) 1);
+ rsize = vsize;
+ if (cy_limb == 0)
+ {
+ tp[rsize] = 1;
+ rsize++;
+ exp++;
+ }
+ goto normalize;
+ }
+ if (usize >= vsize)
+ {
+ /* uuuu */
+ /* vv */
+ mp_size_t size;
+ size = usize - vsize;
+ MPN_COPY (tp, up, size);
+ cy_limb = mpn_sub_n (tp + size, up + size, vp, vsize);
+ rsize = usize;
+ }
+ else /* (usize < vsize) */
+ {
+ /* uuuu */
+ /* vvvvvvv */
+ mp_size_t size, i;
+ size = vsize - usize;
+ for (i = 0; i < size; i++)
+ tp[i] = ~vp[i] & GMP_NUMB_MASK;
+ cy_limb = mpn_sub_n (tp + size, up, vp + size, usize);
+ cy_limb+= mpn_sub_1 (tp + size, tp + size, usize, (mp_limb_t) 1);
+ cy_limb-= mpn_add_1 (tp, tp, vsize, (mp_limb_t) 1);
+ rsize = vsize;
+ }
+ if (cy_limb == 0)
+ {
+ tp[rsize] = 1;
+ rsize++;
+ exp++;
+ }
+ goto normalize;
+ }
+ }
+
+general_case:
+ /* If U extends beyond PREC, ignore the part that does. */
+ if (usize > prec)
+ {
+ up += usize - prec;
+ usize = prec;
+ }
+
+ /* If V extends beyond PREC, ignore the part that does.
+ Note that this may make vsize negative. */
+ if (vsize + ediff > prec)
+ {
+ vp += vsize + ediff - prec;
+ vsize = prec - ediff;
+ }
+
+ if (ediff >= prec)
+ {
+ /* V completely cancelled. */
+ if (rp != up)
+ MPN_COPY (rp, up, usize);
+ rsize = usize;
+ }
+ else
+ {
+ /* Allocate temp space for the result. Allocate
+ just vsize + ediff later??? */
+ tp = TMP_ALLOC_LIMBS (prec);
+
+ /* Locate the least significant non-zero limb in (the needed
+ parts of) U and V, to simplify the code below. */
+ for (;;)
+ {
+ if (vsize == 0)
+ {
+ MPN_COPY (rp, up, usize);
+ rsize = usize;
+ goto done;
+ }
+ if (vp[0] != 0)
+ break;
+ vp++, vsize--;
+ }
+ for (;;)
+ {
+ if (usize == 0)
+ {
+ MPN_COPY (rp, vp, vsize);
+ rsize = vsize;
+ negate ^= 1;
+ goto done;
+ }
+ if (up[0] != 0)
+ break;
+ up++, usize--;
+ }
+
+ /* uuuu | uuuu | uuuu | uuuu | uuuu */
+ /* vvvvvvv | vv | vvvvv | v | vv */
+
+ if (usize > ediff)
+ {
+ /* U and V partially overlaps. */
+ if (ediff == 0)
+ {
+ /* Have to compare the leading limbs of u and v
+ to determine whether to compute u - v or v - u. */
+ if (usize >= vsize)
+ {
+ /* uuuu */
+ /* vv */
+ mp_size_t size;
+ size = usize - vsize;
+ MPN_COPY (tp, up, size);
+ mpn_sub_n (tp + size, up + size, vp, vsize);
+ rsize = usize;
+ }
+ else /* (usize < vsize) */
+ {
+ /* uuuu */
+ /* vvvvvvv */
+ mp_size_t size, i;
+ size = vsize - usize;
+ tp[0] = -vp[0] & GMP_NUMB_MASK;
+ for (i = 1; i < size; i++)
+ tp[i] = ~vp[i] & GMP_NUMB_MASK;
+ mpn_sub_n (tp + size, up, vp + size, usize);
+ mpn_sub_1 (tp + size, tp + size, usize, (mp_limb_t) 1);
+ rsize = vsize;
+ }
+ }
+ else
+ {
+ if (vsize + ediff <= usize)
+ {
+ /* uuuu */
+ /* v */
+ mp_size_t size;
+ size = usize - ediff - vsize;
+ MPN_COPY (tp, up, size);
+ mpn_sub (tp + size, up + size, usize - size, vp, vsize);
+ rsize = usize;
+ }
+ else
+ {
+ /* uuuu */
+ /* vvvvv */
+ mp_size_t size, i;
+ size = vsize + ediff - usize;
+ tp[0] = -vp[0] & GMP_NUMB_MASK;
+ for (i = 1; i < size; i++)
+ tp[i] = ~vp[i] & GMP_NUMB_MASK;
+ mpn_sub (tp + size, up, usize, vp + size, usize - ediff);
+ mpn_sub_1 (tp + size, tp + size, usize, (mp_limb_t) 1);
+ rsize = vsize + ediff;
+ }
+ }
+ }
+ else
+ {
+ /* uuuu */
+ /* vv */
+ mp_size_t size, i;
+ size = vsize + ediff - usize;
+ tp[0] = -vp[0] & GMP_NUMB_MASK;
+ for (i = 1; i < vsize; i++)
+ tp[i] = ~vp[i] & GMP_NUMB_MASK;
+ for (i = vsize; i < size; i++)
+ tp[i] = GMP_NUMB_MAX;
+ mpn_sub_1 (tp + size, up, usize, (mp_limb_t) 1);
+ rsize = size + usize;
+ }
+
+ normalize:
+ /* Full normalize. Optimize later. */
+ while (rsize != 0 && tp[rsize - 1] == 0)
+ {
+ rsize--;
+ exp--;
+ }
+ MPN_COPY (rp, tp, rsize);
+ }
+
+ done:
+ r->_mp_size = negate ? -rsize : rsize;
+ if (rsize == 0)
+ exp = 0;
+ r->_mp_exp = exp;
+ TMP_FREE;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpf/sub_ui.c b/Build/source/libs/gmp/gmp-6.0.0/mpf/sub_ui.c
new file mode 100644
index 00000000000..cf9b88eb004
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpf/sub_ui.c
@@ -0,0 +1,51 @@
+/* mpf_sub_ui -- Subtract an unsigned integer from a float.
+
+Copyright 1993, 1994, 1996, 2001 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.h"
+#include "gmp-impl.h"
+
+void
+mpf_sub_ui (mpf_ptr sum, mpf_srcptr u, unsigned long int v)
+{
+ __mpf_struct vv;
+ mp_limb_t vl;
+
+ if (v == 0)
+ {
+ mpf_set (sum, u);
+ return;
+ }
+
+ vl = v;
+ vv._mp_size = 1;
+ vv._mp_d = &vl;
+ vv._mp_exp = 1;
+ mpf_sub (sum, u, &vv);
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpf/swap.c b/Build/source/libs/gmp/gmp-6.0.0/mpf/swap.c
new file mode 100644
index 00000000000..a3706528763
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpf/swap.c
@@ -0,0 +1,57 @@
+/* mpf_swap (U, V) -- Swap U and V.
+
+Copyright 1997, 1998, 2000, 2001, 2013 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.h"
+#include "gmp-impl.h"
+
+void
+mpf_swap (mpf_ptr u, mpf_ptr v) __GMP_NOTHROW
+{
+ mp_ptr tptr;
+ mp_size_t tprec;
+ mp_size_t tsiz;
+ mp_exp_t texp;
+
+ tprec = PREC(u);
+ PREC(u) = PREC(v);
+ PREC(v) = tprec;
+
+ tsiz = SIZ(u);
+ SIZ(u) = SIZ(v);
+ SIZ(v) = tsiz;
+
+ texp = EXP(u);
+ EXP(u) = EXP(v);
+ EXP(v) = texp;
+
+ tptr = PTR(u);
+ PTR(u) = PTR(v);
+ PTR(v) = tptr;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpf/trunc.c b/Build/source/libs/gmp/gmp-6.0.0/mpf/trunc.c
new file mode 100644
index 00000000000..5f94f7aec85
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpf/trunc.c
@@ -0,0 +1,75 @@
+/* mpf_trunc -- truncate an mpf to an integer.
+
+Copyright 2001 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.h"
+#include "gmp-impl.h"
+
+
+/* Notice the use of prec+1 ensures mpf_trunc is equivalent to mpf_set if u
+ is already an integer. */
+
+void
+mpf_trunc (mpf_ptr r, mpf_srcptr u)
+{
+ mp_ptr rp;
+ mp_srcptr up;
+ mp_size_t size, asize, prec;
+ mp_exp_t exp;
+
+ exp = EXP(u);
+ size = SIZ(u);
+ if (size == 0 || exp <= 0)
+ {
+ /* u is only a fraction */
+ SIZ(r) = 0;
+ EXP(r) = 0;
+ return;
+ }
+
+ up = PTR(u);
+ EXP(r) = exp;
+ asize = ABS (size);
+ up += asize;
+
+ /* skip fraction part of u */
+ asize = MIN (asize, exp);
+
+ /* don't lose precision in the copy */
+ prec = PREC(r) + 1;
+
+ /* skip excess over target precision */
+ asize = MIN (asize, prec);
+
+ up -= asize;
+ rp = PTR(r);
+ SIZ(r) = (size >= 0 ? asize : -asize);
+ if (rp != up)
+ MPN_COPY_INCR (rp, up, asize);
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpf/ui_div.c b/Build/source/libs/gmp/gmp-6.0.0/mpf/ui_div.c
new file mode 100644
index 00000000000..ceb881ebcc2
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpf/ui_div.c
@@ -0,0 +1,128 @@
+/* mpf_ui_div -- Divide an unsigned integer with a float.
+
+Copyright 1993-1996, 2000-2002, 2004, 2005, 2012 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> /* for NULL */
+#include "gmp.h"
+#include "gmp-impl.h"
+#include "longlong.h"
+
+
+void
+mpf_ui_div (mpf_ptr r, unsigned long int u, mpf_srcptr v)
+{
+ mp_srcptr vp;
+ mp_ptr rp, tp, remp, new_vp;
+ mp_size_t vsize;
+ mp_size_t rsize, prospective_rsize, zeros, tsize, high_zero;
+ mp_size_t sign_quotient;
+ mp_size_t prec;
+ mp_exp_t rexp;
+ TMP_DECL;
+
+ vsize = v->_mp_size;
+ sign_quotient = vsize;
+
+ if (UNLIKELY (vsize == 0))
+ DIVIDE_BY_ZERO;
+
+ if (UNLIKELY (u == 0))
+ {
+ r->_mp_size = 0;
+ r->_mp_exp = 0;
+ return;
+ }
+
+ vsize = ABS (vsize);
+ prec = r->_mp_prec;
+
+ TMP_MARK;
+ rexp = 1 - v->_mp_exp + 1;
+
+ rp = r->_mp_d;
+ vp = v->_mp_d;
+
+ prospective_rsize = 1 - vsize + 1; /* quot from using given u,v sizes */
+ rsize = prec + 1; /* desired quot size */
+
+ zeros = rsize - prospective_rsize; /* padding u to give rsize */
+ tsize = 1 + zeros; /* u with zeros */
+
+ if (WANT_TMP_DEBUG)
+ {
+ /* separate alloc blocks, for malloc debugging */
+ remp = TMP_ALLOC_LIMBS (vsize);
+ tp = TMP_ALLOC_LIMBS (tsize);
+ new_vp = NULL;
+ if (rp == vp)
+ new_vp = TMP_ALLOC_LIMBS (vsize);
+ }
+ else
+ {
+ /* one alloc with calculated size, for efficiency */
+ mp_size_t size = vsize + tsize + (rp == vp ? vsize : 0);
+ remp = TMP_ALLOC_LIMBS (size);
+ tp = remp + vsize;
+ new_vp = tp + tsize;
+ }
+
+ /* ensure divisor doesn't overlap quotient */
+ if (rp == vp)
+ {
+ MPN_COPY (new_vp, vp, vsize);
+ vp = new_vp;
+ }
+
+ MPN_ZERO (tp, tsize-1);
+
+ tp[tsize - 1] = u & GMP_NUMB_MASK;
+#if BITS_PER_ULONG > GMP_NUMB_BITS
+ if (u > GMP_NUMB_MAX)
+ {
+ /* tsize-vsize+1 == rsize, so tsize >= rsize. rsize == prec+1 >= 2,
+ so tsize >= 2, hence there's room for 2-limb u with nails */
+ ASSERT (tsize >= 2);
+ tp[tsize - 1] = u >> GMP_NUMB_BITS;
+ tp[tsize - 2] = u & GMP_NUMB_MASK;
+ rexp++;
+ }
+#endif
+
+ ASSERT (tsize-vsize+1 == rsize);
+ mpn_tdiv_qr (rp, remp, (mp_size_t) 0, tp, tsize, vp, vsize);
+
+ /* strip possible zero high limb */
+ high_zero = (rp[rsize-1] == 0);
+ rsize -= high_zero;
+ rexp -= high_zero;
+
+ r->_mp_size = sign_quotient >= 0 ? rsize : -rsize;
+ r->_mp_exp = rexp;
+ TMP_FREE;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpf/ui_sub.c b/Build/source/libs/gmp/gmp-6.0.0/mpf/ui_sub.c
new file mode 100644
index 00000000000..b7a536eb8bc
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpf/ui_sub.c
@@ -0,0 +1,336 @@
+/* mpf_ui_sub -- Subtract a float from an unsigned long int.
+
+Copyright 1993-1996, 2001, 2002, 2005 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.h"
+#include "gmp-impl.h"
+
+void
+mpf_ui_sub (mpf_ptr r, unsigned long int u, mpf_srcptr v)
+{
+ mp_srcptr up, vp;
+ mp_ptr rp, tp;
+ mp_size_t usize, vsize, rsize;
+ mp_size_t prec;
+ mp_exp_t uexp;
+ mp_size_t ediff;
+ int negate;
+ mp_limb_t ulimb;
+ TMP_DECL;
+
+ vsize = v->_mp_size;
+
+ /* Handle special cases that don't work in generic code below. */
+ if (u == 0)
+ {
+ mpf_neg (r, v);
+ return;
+ }
+ if (vsize == 0)
+ {
+ mpf_set_ui (r, u);
+ return;
+ }
+
+ /* If signs of U and V are different, perform addition. */
+ if (vsize < 0)
+ {
+ __mpf_struct v_negated;
+ v_negated._mp_size = -vsize;
+ v_negated._mp_exp = v->_mp_exp;
+ v_negated._mp_d = v->_mp_d;
+ mpf_add_ui (r, &v_negated, u);
+ return;
+ }
+
+ TMP_MARK;
+
+ /* Signs are now known to be the same. */
+
+ ulimb = u;
+ /* Make U be the operand with the largest exponent. */
+ if (1 < v->_mp_exp)
+ {
+ negate = 1;
+ usize = ABS (vsize);
+ vsize = 1;
+ up = v->_mp_d;
+ vp = &ulimb;
+ rp = r->_mp_d;
+ prec = r->_mp_prec + 1;
+ uexp = v->_mp_exp;
+ ediff = uexp - 1;
+ }
+ else
+ {
+ negate = 0;
+ usize = 1;
+ vsize = ABS (vsize);
+ up = &ulimb;
+ vp = v->_mp_d;
+ rp = r->_mp_d;
+ prec = r->_mp_prec;
+ uexp = 1;
+ ediff = 1 - v->_mp_exp;
+ }
+
+ /* Ignore leading limbs in U and V that are equal. Doing
+ this helps increase the precision of the result. */
+ if (ediff == 0)
+ {
+ /* This loop normally exits immediately. Optimize for that. */
+ for (;;)
+ {
+ usize--;
+ vsize--;
+ if (up[usize] != vp[vsize])
+ break;
+ uexp--;
+ if (usize == 0)
+ goto Lu0;
+ if (vsize == 0)
+ goto Lv0;
+ }
+ usize++;
+ vsize++;
+ /* Note that either operand (but not both operands) might now have
+ leading zero limbs. It matters only that U is unnormalized if
+ vsize is now zero, and vice versa. And it is only in that case
+ that we have to adjust uexp. */
+ if (vsize == 0)
+ Lv0:
+ while (usize != 0 && up[usize - 1] == 0)
+ usize--, uexp--;
+ if (usize == 0)
+ Lu0:
+ while (vsize != 0 && vp[vsize - 1] == 0)
+ vsize--, uexp--;
+ }
+
+ /* If U extends beyond PREC, ignore the part that does. */
+ if (usize > prec)
+ {
+ up += usize - prec;
+ usize = prec;
+ }
+
+ /* If V extends beyond PREC, ignore the part that does.
+ Note that this may make vsize negative. */
+ if (vsize + ediff > prec)
+ {
+ vp += vsize + ediff - prec;
+ vsize = prec - ediff;
+ }
+
+ /* Allocate temp space for the result. Allocate
+ just vsize + ediff later??? */
+ tp = TMP_ALLOC_LIMBS (prec);
+
+ if (ediff >= prec)
+ {
+ /* V completely cancelled. */
+ if (tp != up)
+ MPN_COPY (rp, up, usize);
+ rsize = usize;
+ }
+ else
+ {
+ /* Locate the least significant non-zero limb in (the needed
+ parts of) U and V, to simplify the code below. */
+ for (;;)
+ {
+ if (vsize == 0)
+ {
+ MPN_COPY (rp, up, usize);
+ rsize = usize;
+ goto done;
+ }
+ if (vp[0] != 0)
+ break;
+ vp++, vsize--;
+ }
+ for (;;)
+ {
+ if (usize == 0)
+ {
+ MPN_COPY (rp, vp, vsize);
+ rsize = vsize;
+ negate ^= 1;
+ goto done;
+ }
+ if (up[0] != 0)
+ break;
+ up++, usize--;
+ }
+
+ /* uuuu | uuuu | uuuu | uuuu | uuuu */
+ /* vvvvvvv | vv | vvvvv | v | vv */
+
+ if (usize > ediff)
+ {
+ /* U and V partially overlaps. */
+ if (ediff == 0)
+ {
+ /* Have to compare the leading limbs of u and v
+ to determine whether to compute u - v or v - u. */
+ if (usize > vsize)
+ {
+ /* uuuu */
+ /* vv */
+ int cmp;
+ cmp = mpn_cmp (up + usize - vsize, vp, vsize);
+ if (cmp >= 0)
+ {
+ mp_size_t size;
+ size = usize - vsize;
+ MPN_COPY (tp, up, size);
+ mpn_sub_n (tp + size, up + size, vp, vsize);
+ rsize = usize;
+ }
+ else
+ {
+ /* vv */ /* Swap U and V. */
+ /* uuuu */
+ mp_size_t size, i;
+ size = usize - vsize;
+ tp[0] = -up[0] & GMP_NUMB_MASK;
+ for (i = 1; i < size; i++)
+ tp[i] = ~up[i] & GMP_NUMB_MASK;
+ mpn_sub_n (tp + size, vp, up + size, vsize);
+ mpn_sub_1 (tp + size, tp + size, vsize, (mp_limb_t) 1);
+ negate ^= 1;
+ rsize = usize;
+ }
+ }
+ else if (usize < vsize)
+ {
+ /* uuuu */
+ /* vvvvvvv */
+ int cmp;
+ cmp = mpn_cmp (up, vp + vsize - usize, usize);
+ if (cmp > 0)
+ {
+ mp_size_t size, i;
+ size = vsize - usize;
+ tp[0] = -vp[0] & GMP_NUMB_MASK;
+ for (i = 1; i < size; i++)
+ tp[i] = ~vp[i] & GMP_NUMB_MASK;
+ mpn_sub_n (tp + size, up, vp + size, usize);
+ mpn_sub_1 (tp + size, tp + size, usize, (mp_limb_t) 1);
+ rsize = vsize;
+ }
+ else
+ {
+ /* vvvvvvv */ /* Swap U and V. */
+ /* uuuu */
+ /* This is the only place we can get 0.0. */
+ mp_size_t size;
+ size = vsize - usize;
+ MPN_COPY (tp, vp, size);
+ mpn_sub_n (tp + size, vp + size, up, usize);
+ negate ^= 1;
+ rsize = vsize;
+ }
+ }
+ else
+ {
+ /* uuuu */
+ /* vvvv */
+ int cmp;
+ cmp = mpn_cmp (up, vp + vsize - usize, usize);
+ if (cmp > 0)
+ {
+ mpn_sub_n (tp, up, vp, usize);
+ rsize = usize;
+ }
+ else
+ {
+ mpn_sub_n (tp, vp, up, usize);
+ negate ^= 1;
+ rsize = usize;
+ /* can give zero */
+ }
+ }
+ }
+ else
+ {
+ if (vsize + ediff <= usize)
+ {
+ /* uuuu */
+ /* v */
+ mp_size_t size;
+ size = usize - ediff - vsize;
+ MPN_COPY (tp, up, size);
+ mpn_sub (tp + size, up + size, usize - size, vp, vsize);
+ rsize = usize;
+ }
+ else
+ {
+ /* uuuu */
+ /* vvvvv */
+ mp_size_t size, i;
+ size = vsize + ediff - usize;
+ tp[0] = -vp[0] & GMP_NUMB_MASK;
+ for (i = 1; i < size; i++)
+ tp[i] = ~vp[i] & GMP_NUMB_MASK;
+ mpn_sub (tp + size, up, usize, vp + size, usize - ediff);
+ mpn_sub_1 (tp + size, tp + size, usize, (mp_limb_t) 1);
+ rsize = vsize + ediff;
+ }
+ }
+ }
+ else
+ {
+ /* uuuu */
+ /* vv */
+ mp_size_t size, i;
+ size = vsize + ediff - usize;
+ tp[0] = -vp[0] & GMP_NUMB_MASK;
+ for (i = 1; i < vsize; i++)
+ tp[i] = ~vp[i] & GMP_NUMB_MASK;
+ for (i = vsize; i < size; i++)
+ tp[i] = GMP_NUMB_MAX;
+ mpn_sub_1 (tp + size, up, usize, (mp_limb_t) 1);
+ rsize = size + usize;
+ }
+
+ /* Full normalize. Optimize later. */
+ while (rsize != 0 && tp[rsize - 1] == 0)
+ {
+ rsize--;
+ uexp--;
+ }
+ MPN_COPY (rp, tp, rsize);
+ }
+
+ done:
+ r->_mp_size = negate ? -rsize : rsize;
+ r->_mp_exp = uexp;
+ TMP_FREE;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpf/urandomb.c b/Build/source/libs/gmp/gmp-6.0.0/mpf/urandomb.c
new file mode 100644
index 00000000000..72271e8762a
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpf/urandomb.c
@@ -0,0 +1,69 @@
+/* mpf_urandomb (rop, state, nbits) -- Generate a uniform pseudorandom
+ real number between 0 (inclusive) and 1 (exclusive) of size NBITS,
+ using STATE as the random state previously initialized by a call to
+ gmp_randinit().
+
+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/. */
+
+#include "gmp.h"
+#include "gmp-impl.h"
+
+void
+mpf_urandomb (mpf_t rop, gmp_randstate_t rstate, mp_bitcnt_t nbits)
+{
+ mp_ptr rp;
+ mp_size_t nlimbs;
+ mp_exp_t exp;
+ mp_size_t prec;
+
+ rp = PTR (rop);
+ nlimbs = BITS_TO_LIMBS (nbits);
+ prec = PREC (rop);
+
+ if (nlimbs > prec + 1 || nlimbs == 0)
+ {
+ nlimbs = prec + 1;
+ nbits = nlimbs * GMP_NUMB_BITS;
+ }
+
+ _gmp_rand (rp, rstate, nbits);
+
+ /* If nbits isn't a multiple of GMP_NUMB_BITS, shift up. */
+ if (nbits % GMP_NUMB_BITS != 0)
+ mpn_lshift (rp, rp, nlimbs, GMP_NUMB_BITS - nbits % GMP_NUMB_BITS);
+
+ exp = 0;
+ while (nlimbs != 0 && rp[nlimbs - 1] == 0)
+ {
+ nlimbs--;
+ exp--;
+ }
+ EXP (rop) = exp;
+ SIZ (rop) = nlimbs;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/Makeasm.am b/Build/source/libs/gmp/gmp-6.0.0/mpn/Makeasm.am
new file mode 100644
index 00000000000..5d7306c221e
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/Makeasm.am
@@ -0,0 +1,118 @@
+## Automake asm file rules.
+
+# Copyright 1996, 1998-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/.
+
+
+# COMPILE minus CC.
+#
+COMPILE_FLAGS = $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) $(ASMFLAGS)
+
+# Flags used for preprocessing (in ansi2knr rules).
+#
+PREPROCESS_FLAGS = $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+ $(CPPFLAGS)
+
+
+# Recent versions of automake (1.5 and up for instance) append automake
+# generated suffixes to this $(SUFFIXES) list. This is essential for us,
+# since .c must come after .s, .S and .asm. If .c is before .s, for
+# instance, then in the mpn directory "make" will see add_n.c mentioned in
+# an explicit rule (the ansi2knr stuff) and decide it must have add_n.c,
+# even if add_n.c doesn't exist but add_n.s does. See GNU make
+# documentation "(make)Implicit Rule Search", part 5c.
+#
+# On IRIX 6 native make this doesn't work properly though. Somehow .c
+# remains ahead of .s, perhaps because .c.s is a builtin rule. .asm works
+# fine though, and mpn/mips3 uses this.
+#
+SUFFIXES = .s .S .asm
+
+
+# .s assembler, no preprocessing.
+#
+.s.o:
+ $(CCAS) $(COMPILE_FLAGS) `test -f '$<' || echo '$(srcdir)/'`$<
+.s.obj:
+ $(CCAS) $(COMPILE_FLAGS) `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi`
+.s.lo:
+ $(LIBTOOL) --mode=compile --tag=CC $(CCAS) $(COMPILE_FLAGS) `test -f '$<' || echo '$(srcdir)/'`$<
+
+
+# can be overridden during development, eg. "make RM_TMP=: mul_1.lo"
+RM_TMP = rm -f
+
+
+# .S assembler, preprocessed with cpp.
+#
+# It's necessary to run $(CPP) separately, since it seems not all compilers
+# recognise .S files, in particular "cc" on HP-UX 10 and 11 doesn't (and
+# will silently do nothing if given a .S).
+#
+# For .lo we need a helper script, as described below for .asm.lo.
+#
+.S.o:
+ $(CPP) $(PREPROCESS_FLAGS) `test -f '$<' || echo '$(srcdir)/'`$< | grep -v '^#' >tmp-$*.s
+ $(CCAS) $(COMPILE_FLAGS) tmp-$*.s -o $@
+ $(RM_TMP) tmp-$*.s
+.S.obj:
+ $(CPP) $(PREPROCESS_FLAGS) `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi` | grep -v '^#' >tmp-$*.s
+ $(CCAS) $(COMPILE_FLAGS) tmp-$*.s -o $@
+ $(RM_TMP) tmp-$*.s
+.S.lo:
+ $(LIBTOOL) --mode=compile --tag=CC $(top_srcdir)/mpn/cpp-ccas --cpp="$(CPP) $(PREPROCESS_FLAGS)" $(CCAS) $(COMPILE_FLAGS) `test -f '$<' || echo '$(srcdir)/'`$<
+
+
+# .asm assembler, preprocessed with m4.
+#
+# .o and .obj are non-PIC and just need m4 followed by a compile.
+#
+# .lo is a bit tricky. Libtool (as of version 1.5) has foo.lo as a little
+# text file, and .libs/foo.o and foo.o as the PIC and non-PIC objects,
+# respectively. It'd be asking for lots of trouble to try to create foo.lo
+# ourselves, so instead arrange to invoke libtool like a --mode=compile, but
+# with a special m4-ccas script which first m4 preprocesses, then compiles.
+# --tag=CC is necessary since foo.asm is otherwise unknown to libtool.
+#
+# Libtool adds -DPIC when building a shared object and the .asm files look
+# for that. But it should be noted that the other PIC flags are on occasion
+# important too, in particular FreeBSD 2.2.8 gas 1.92.3 requires -k before
+# it accepts PIC constructs like @GOT, and gcc adds that flag only under
+# -fPIC. (Later versions of gas are happy to accept PIC stuff any time.)
+#
+.asm.o:
+ $(M4) -DOPERATION_$* `test -f '$<' || echo '$(srcdir)/'`$< >tmp-$*.s
+ $(CCAS) $(COMPILE_FLAGS) tmp-$*.s -o $@
+ $(RM_TMP) tmp-$*.s
+.asm.obj:
+ $(M4) -DOPERATION_$* `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi` >tmp-$*.s
+ $(CCAS) $(COMPILE_FLAGS) tmp-$*.s -o $@
+ $(RM_TMP) tmp-$*.s
+.asm.lo:
+ $(LIBTOOL) --mode=compile --tag=CC $(top_srcdir)/mpn/m4-ccas --m4="$(M4)" $(CCAS) $(COMPILE_FLAGS) `test -f '$<' || echo '$(srcdir)/'`$<
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/Makefile.am b/Build/source/libs/gmp/gmp-6.0.0/mpn/Makefile.am
new file mode 100644
index 00000000000..20b8a4a1168
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/Makefile.am
@@ -0,0 +1,59 @@
+## Process this file with automake to generate Makefile.in
+
+# Copyright 1996, 1998-2002, 2005, 2011, 2013 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/.
+
+
+INCLUDES = -D__GMP_WITHIN_GMP -I$(top_srcdir) \
+ -DOPERATION_`echo $* | sed 's/_$$//'`
+
+OFILES = @mpn_objects@
+
+noinst_LTLIBRARIES = libmpn.la
+nodist_libmpn_la_SOURCES = fib_table.c mp_bases.c
+libmpn_la_LIBADD = $(OFILES)
+libmpn_la_DEPENDENCIES = $(OFILES)
+
+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
+
+EXTRA_DIST = asm-defs.m4 cpp-ccas m4-ccas $(TARG_DIST)
+
+
+# These are BUILT_SOURCES at the top-level, so normally they're built before
+# recursing into this directory.
+#
+fib_table.c:
+ cd ..; $(MAKE) $(AM_MAKEFLAGS) mpn/fib_table.c
+mp_bases.c:
+ cd ..; $(MAKE) $(AM_MAKEFLAGS) mpn/mp_bases.c
+perfsqr.h:
+ cd ..; $(MAKE) $(AM_MAKEFLAGS) mpn/perfsqr.h
+
+include Makeasm.am
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/README b/Build/source/libs/gmp/gmp-6.0.0/mpn/README
new file mode 100644
index 00000000000..bc046be7322
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/README
@@ -0,0 +1,44 @@
+Copyright 1996, 1999 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/.
+
+
+
+
+This directory contains all code for the mpn layer of GMP.
+
+Most subdirectories contain machine-dependent code, written in assembly or C.
+The `generic' subdirectory contains default code, used when there is no
+machine-dependent replacement for a particular machine.
+
+There is one subdirectory for each ISA family. Note that e.g., 32-bit SPARC
+and 64-bit SPARC are very different ISA's, and thus cannot share any code.
+
+A particular compile will only use code from one subdirectory, and the
+`generic' subdirectory. The ISA-specific subdirectories contain hierachies of
+directories for various architecture variants and implementations; the
+top-most level contains code that runs correctly on all variants.
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/README b/Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/README
new file mode 100644
index 00000000000..09c2f040473
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/README
@@ -0,0 +1,208 @@
+Copyright 1996, 1997, 1999-2005 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/.
+
+
+
+
+
+This directory contains mpn functions optimized for DEC Alpha processors.
+
+ALPHA ASSEMBLY RULES AND REGULATIONS
+
+The `.prologue N' pseudo op marks the end of instruction that needs special
+handling by unwinding. It also says whether $27 is really needed for computing
+the gp. The `.mask M' pseudo op says which registers are saved on the stack,
+and at what offset in the frame.
+
+Cray T3 code is very very different...
+
+"$6" / "$f6" etc is the usual syntax for registers, but on Unicos instead "r6"
+/ "f6" is required. We use the "r6" / "f6" forms, and have m4 defines expand
+them to "$6" or "$f6" where necessary.
+
+"0x" introduces a hex constant in gas and DEC as, but on Unicos "^X" is
+required. The X() macro accommodates this difference.
+
+"cvttqc" is required by DEC as, "cvttq/c" is required by Unicos, and gas will
+accept either. We use cvttqc and have an m4 define expand to cvttq/c where
+necessary.
+
+"not" as an alias for "ornot r31, ..." is available in gas and DEC as, but not
+the Unicos assembler. The full "ornot" must be used.
+
+"unop" is not available in Unicos. We make an m4 define to the usual "ldq_u
+r31,0(r30)", and in fact use that define on all systems since it comes out the
+same.
+
+"!literal!123" etc explicit relocations as per Tru64 4.0 are apparently not
+available in older alpha assemblers (including gas prior to 2.12), according to
+the GCC manual, so the assembler macro forms must be used (eg. ldgp).
+
+
+
+RELEVANT OPTIMIZATION ISSUES
+
+EV4
+
+1. This chip has very limited store bandwidth. The on-chip L1 cache is write-
+ through, and a cache line is transferred from the store buffer to the off-
+ chip L2 in as much 15 cycles on most systems. This delay hurts mpn_add_n,
+ mpn_sub_n, mpn_lshift, and mpn_rshift.
+
+2. Pairing is possible between memory instructions and integer arithmetic
+ instructions.
+
+3. mulq and umulh are documented to have a latency of 23 cycles, but 2 of these
+ cycles are pipelined. Thus, multiply instructions can be issued at a rate
+ of one each 21st cycle.
+
+EV5
+
+1. The memory bandwidth of this chip is good, both for loads and stores. The
+ L1 cache can handle two loads or one store per cycle, but two cycles after a
+ store, no ld can issue.
+
+2. mulq has a latency of 12 cycles and an issue rate of 1 each 8th cycle.
+ umulh has a latency of 14 cycles and an issue rate of 1 each 10th cycle.
+ (Note that published documentation gets these numbers slightly wrong.)
+
+3. mpn_add_n. With 4-fold unrolling, we need 37 instructions, whereof 12
+ are memory operations. This will take at least
+ ceil(37/2) [dual issue] + 1 [taken branch] = 19 cycles
+ We have 12 memory cycles, plus 4 after-store conflict cycles, or 16 data
+ cache cycles, which should be completely hidden in the 19 issue cycles.
+ The computation is inherently serial, with these dependencies:
+
+ ldq ldq
+ \ /\
+ (or) addq |
+ |\ / \ |
+ | addq cmpult
+ \ | |
+ cmpult |
+ \ /
+ or
+
+ I.e., 3 operations are needed between carry-in and carry-out, making 12
+ cycles the absolute minimum for the 4 limbs. We could replace the `or' with
+ a cmoveq/cmovne, which could issue one cycle earlier that the `or', but that
+ might waste a cycle on EV4. The total depth remain unaffected, since cmov
+ has a latency of 2 cycles.
+
+ addq
+ / \
+ addq cmpult
+ | \
+ cmpult -> cmovne
+
+ Montgomery has a slightly different way of computing carry that requires one
+ less instruction, but has depth 4 (instead of the current 3). Since the code
+ is currently instruction issue bound, Montgomery's idea should save us 1/2
+ cycle per limb, or bring us down to a total of 17 cycles or 4.25 cycles/limb.
+ Unfortunately, this method will not be good for the EV6.
+
+4. addmul_1 and friends: We previously had a scheme for splitting the single-
+ limb operand in 21-bits chunks and the multi-limb operand in 32-bit chunks,
+ and then use FP operations for every 2nd multiply, and integer operations
+ for every 2nd multiply.
+
+ But it seems much better to split the single-limb operand in 16-bit chunks,
+ since we save many integer shifts and adds that way. See powerpc64/README
+ for some more details.
+
+EV6
+
+Here we have a really parallel pipeline, capable of issuing up to 4 integer
+instructions per cycle. In actual practice, it is never possible to sustain
+more than 3.5 integer insns/cycle due to rename register shortage. One integer
+multiply instruction can issue each cycle. To get optimal speed, we need to
+pretend we are vectorizing the code, i.e., minimize the depth of recurrences.
+
+There are two dependencies to watch out for. 1) Address arithmetic
+dependencies, and 2) carry propagation dependencies.
+
+We can avoid serializing due to address arithmetic by unrolling loops, so that
+addresses don't depend heavily on an index variable. Avoiding serializing
+because of carry propagation is trickier; the ultimate performance of the code
+will be determined of the number of latency cycles it takes from accepting
+carry-in to a vector point until we can generate carry-out.
+
+Most integer instructions can execute in either the L0, U0, L1, or U1
+pipelines. Shifts only execute in U0 and U1, and multiply only in U1.
+
+CMOV instructions split into two internal instructions, CMOV1 and CMOV2. CMOV
+split the mapping process (see pg 2-26 in cmpwrgd.pdf), suggesting the CMOV
+should always be placed as the last instruction of an aligned 4 instruction
+block, or perhaps simply avoided.
+
+Perhaps the most important issue is the latency between the L0/U0 and L1/U1
+clusters; a result obtained on either cluster has an extra cycle of latency for
+consumers in the opposite cluster. Because of the dynamic nature of the
+implementation, it is hard to predict where an instruction will execute.
+
+
+
+REFERENCES
+
+"Alpha Architecture Handbook", version 4, Compaq, October 1998, order number
+EC-QD2KC-TE.
+
+"Alpha 21164 Microprocessor Hardware Reference Manual", Compaq, December 1998,
+order number EC-QP99C-TE.
+
+"Alpha 21264/EV67 Microprocessor Hardware Reference Manual", revision 1.4,
+Compaq, September 2000, order number DS-0028B-TE.
+
+"Compiler Writer's Guide for the Alpha 21264", Compaq, June 1999, order number
+EC-RJ66A-TE.
+
+All of the above are available online from
+
+ http://ftp.digital.com/pub/Digital/info/semiconductor/literature/dsc-library.html
+ ftp://ftp.compaq.com/pub/products/alphaCPUdocs
+
+"Tru64 Unix Assembly Language Programmer's Guide", Compaq, March 1996, part
+number AA-PS31D-TE.
+
+"Digital UNIX Calling Standard for Alpha Systems", Digital Equipment Corp,
+March 1996, part number AA-PY8AC-TE.
+
+The above are available online,
+
+ http://h30097.www3.hp.com/docs/pub_page/V40F_DOCS.HTM
+
+(Dunno what h30097 means in this URL, but if it moves try searching for "tru64
+online documentation" from the main www.hp.com page.)
+
+
+
+----------------
+Local variables:
+mode: text
+fill-column: 79
+End:
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/add_n.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/add_n.asm
new file mode 100644
index 00000000000..bc572a57a90
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/add_n.asm
@@ -0,0 +1,164 @@
+dnl Alpha mpn_add_n -- Add two limb vectors of the same length > 0 and
+dnl store sum in a third limb vector.
+
+dnl Copyright 1995, 1999, 2000, 2005, 2011 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 EV4: ?
+C EV5: 4.75
+C EV6: 3
+
+dnl INPUT PARAMETERS
+dnl res_ptr r16
+dnl s1_ptr r17
+dnl s2_ptr r18
+dnl size r19
+
+ASM_START()
+PROLOGUE(mpn_add_nc)
+ bis r20,r31,r25
+ br L(com)
+EPILOGUE()
+PROLOGUE(mpn_add_n)
+ bis r31,r31,r25 C clear cy
+L(com): subq r19,4,r19 C decr loop cnt
+ blt r19,$Lend2 C if less than 4 limbs, goto 2nd loop
+C Start software pipeline for 1st loop
+ ldq r0,0(r18)
+ ldq r4,0(r17)
+ ldq r1,8(r18)
+ ldq r5,8(r17)
+ addq r17,32,r17 C update s1_ptr
+ addq r0,r4,r28 C 1st main add
+ ldq r2,16(r18)
+ addq r25,r28,r20 C 1st carry add
+ ldq r3,24(r18)
+ cmpult r28,r4,r8 C compute cy from last add
+ ldq r6,-16(r17)
+ cmpult r20,r28,r25 C compute cy from last add
+ ldq r7,-8(r17)
+ bis r8,r25,r25 C combine cy from the two adds
+ subq r19,4,r19 C decr loop cnt
+ addq r1,r5,r28 C 2nd main add
+ addq r18,32,r18 C update s2_ptr
+ addq r28,r25,r21 C 2nd carry add
+ cmpult r28,r5,r8 C compute cy from last add
+ blt r19,$Lend1 C if less than 4 limbs remain, jump
+C 1st loop handles groups of 4 limbs in a software pipeline
+ ALIGN(16)
+$Loop: cmpult r21,r28,r25 C compute cy from last add
+ ldq r0,0(r18)
+ bis r8,r25,r25 C combine cy from the two adds
+ ldq r1,8(r18)
+ addq r2,r6,r28 C 3rd main add
+ ldq r4,0(r17)
+ addq r28,r25,r22 C 3rd carry add
+ ldq r5,8(r17)
+ cmpult r28,r6,r8 C compute cy from last add
+ cmpult r22,r28,r25 C compute cy from last add
+ stq r20,0(r16)
+ bis r8,r25,r25 C combine cy from the two adds
+ stq r21,8(r16)
+ addq r3,r7,r28 C 4th main add
+ addq r28,r25,r23 C 4th carry add
+ cmpult r28,r7,r8 C compute cy from last add
+ cmpult r23,r28,r25 C compute cy from last add
+ addq r17,32,r17 C update s1_ptr
+ bis r8,r25,r25 C combine cy from the two adds
+ addq r16,32,r16 C update res_ptr
+ addq r0,r4,r28 C 1st main add
+ ldq r2,16(r18)
+ addq r25,r28,r20 C 1st carry add
+ ldq r3,24(r18)
+ cmpult r28,r4,r8 C compute cy from last add
+ ldq r6,-16(r17)
+ cmpult r20,r28,r25 C compute cy from last add
+ ldq r7,-8(r17)
+ bis r8,r25,r25 C combine cy from the two adds
+ subq r19,4,r19 C decr loop cnt
+ stq r22,-16(r16)
+ addq r1,r5,r28 C 2nd main add
+ stq r23,-8(r16)
+ addq r25,r28,r21 C 2nd carry add
+ addq r18,32,r18 C update s2_ptr
+ cmpult r28,r5,r8 C compute cy from last add
+ bge r19,$Loop
+C Finish software pipeline for 1st loop
+$Lend1: cmpult r21,r28,r25 C compute cy from last add
+ bis r8,r25,r25 C combine cy from the two adds
+ addq r2,r6,r28 C 3rd main add
+ addq r28,r25,r22 C 3rd carry add
+ cmpult r28,r6,r8 C compute cy from last add
+ cmpult r22,r28,r25 C compute cy from last add
+ stq r20,0(r16)
+ bis r8,r25,r25 C combine cy from the two adds
+ stq r21,8(r16)
+ addq r3,r7,r28 C 4th main add
+ addq r28,r25,r23 C 4th carry add
+ cmpult r28,r7,r8 C compute cy from last add
+ cmpult r23,r28,r25 C compute cy from last add
+ bis r8,r25,r25 C combine cy from the two adds
+ addq r16,32,r16 C update res_ptr
+ stq r22,-16(r16)
+ stq r23,-8(r16)
+$Lend2: addq r19,4,r19 C restore loop cnt
+ beq r19,$Lret
+C Start software pipeline for 2nd loop
+ ldq r0,0(r18)
+ ldq r4,0(r17)
+ subq r19,1,r19
+ beq r19,$Lend0
+C 2nd loop handles remaining 1-3 limbs
+ ALIGN(16)
+$Loop0: addq r0,r4,r28 C main add
+ ldq r0,8(r18)
+ cmpult r28,r4,r8 C compute cy from last add
+ ldq r4,8(r17)
+ addq r28,r25,r20 C carry add
+ addq r18,8,r18
+ addq r17,8,r17
+ stq r20,0(r16)
+ cmpult r20,r28,r25 C compute cy from last add
+ subq r19,1,r19 C decr loop cnt
+ bis r8,r25,r25 C combine cy from the two adds
+ addq r16,8,r16
+ bne r19,$Loop0
+$Lend0: addq r0,r4,r28 C main add
+ addq r28,r25,r20 C carry add
+ cmpult r28,r4,r8 C compute cy from last add
+ cmpult r20,r28,r25 C compute cy from last add
+ stq r20,0(r16)
+ bis r8,r25,r25 C combine cy from the two adds
+
+$Lret: bis r25,r31,r0 C return cy
+ ret r31,(r26),1
+EPILOGUE()
+ASM_END()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/addmul_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/addmul_1.asm
new file mode 100644
index 00000000000..c4e6834b615
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/addmul_1.asm
@@ -0,0 +1,99 @@
+dnl Alpha mpn_addmul_1 -- Multiply a limb vector with a limb and add the
+dnl result 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 cycles/limb
+C EV4: 42
+C EV5: 18
+C EV6: 7
+
+C INPUT PARAMETERS
+C rp r16
+C up r17
+C n r18
+C vl r19
+
+
+ASM_START()
+PROLOGUE(mpn_addmul_1)
+ ldq r2,0(r17) C r2 = s1_limb
+ addq r17,8,r17 C s1_ptr++
+ subq r18,1,r18 C size--
+ mulq r2,r19,r3 C r3 = prod_low
+ ldq r5,0(r16) C r5 = *res_ptr
+ umulh r2,r19,r0 C r0 = prod_high
+ beq r18,$Lend1 C jump if size was == 1
+ ldq r2,0(r17) C r2 = s1_limb
+ addq r17,8,r17 C s1_ptr++
+ subq r18,1,r18 C size--
+ addq r5,r3,r3
+ cmpult r3,r5,r4
+ stq r3,0(r16)
+ addq r16,8,r16 C res_ptr++
+ beq r18,$Lend2 C jump if size was == 2
+
+ ALIGN(8)
+$Loop: mulq r2,r19,r3 C r3 = prod_low
+ ldq r5,0(r16) C r5 = *res_ptr
+ addq r4,r0,r0 C cy_limb = cy_limb + 'cy'
+ subq r18,1,r18 C size--
+ umulh r2,r19,r4 C r4 = cy_limb
+ ldq r2,0(r17) C r2 = s1_limb
+ addq r17,8,r17 C s1_ptr++
+ addq r3,r0,r3 C r3 = cy_limb + prod_low
+ cmpult r3,r0,r0 C r0 = carry from (cy_limb + prod_low)
+ addq r5,r3,r3
+ cmpult r3,r5,r5
+ stq r3,0(r16)
+ addq r16,8,r16 C res_ptr++
+ addq r5,r0,r0 C combine carries
+ bne r18,$Loop
+
+$Lend2: mulq r2,r19,r3 C r3 = prod_low
+ ldq r5,0(r16) C r5 = *res_ptr
+ addq r4,r0,r0 C cy_limb = cy_limb + 'cy'
+ umulh r2,r19,r4 C r4 = cy_limb
+ addq r3,r0,r3 C r3 = cy_limb + prod_low
+ cmpult r3,r0,r0 C r0 = carry from (cy_limb + prod_low)
+ addq r5,r3,r3
+ cmpult r3,r5,r5
+ stq r3,0(r16)
+ addq r5,r0,r0 C combine carries
+ addq r4,r0,r0 C cy_limb = prod_high + cy
+ ret r31,(r26),1
+$Lend1: addq r5,r3,r3
+ cmpult r3,r5,r5
+ stq r3,0(r16)
+ addq r0,r5,r0
+ ret r31,(r26),1
+EPILOGUE(mpn_addmul_1)
+ASM_END()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/alpha-defs.m4 b/Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/alpha-defs.m4
new file mode 100644
index 00000000000..af34c9294c9
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/alpha-defs.m4
@@ -0,0 +1,107 @@
+divert(-1)
+
+dnl m4 macros for Alpha assembler.
+
+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/.
+
+
+dnl Usage: ASSERT([reg] [,code])
+dnl
+dnl Require that the given reg is non-zero after executing the test code.
+dnl For example,
+dnl
+dnl ASSERT(r8,
+dnl ` cmpult r16, r17, r8')
+dnl
+dnl If the register argument is empty then nothing is tested, the code is
+dnl just executed. This can be used for setups required by later ASSERTs.
+dnl If the code argument is omitted then the register is just tested, with
+dnl no special setup code.
+
+define(ASSERT,
+m4_assert_numargs_range(1,2)
+m4_assert_defined(`WANT_ASSERT')
+`ifelse(WANT_ASSERT,1,
+`ifelse(`$2',,,`$2')
+ifelse(`$1',,,
+` bne $1, L(ASSERTok`'ASSERT_label_counter)
+ .long 0 C halt
+L(ASSERTok`'ASSERT_label_counter):
+define(`ASSERT_label_counter',eval(ASSERT_label_counter+1))
+')
+')')
+define(`ASSERT_label_counter',1)
+
+
+dnl Usage: bigend(`code')
+dnl
+dnl Emit the given code only for a big-endian system, like Unicos. This
+dnl can be used for instance for extra stuff needed by extwl.
+
+define(bigend,
+m4_assert_numargs(1)
+`ifdef(`HAVE_LIMB_BIG_ENDIAN',`$1',
+`ifdef(`HAVE_LIMB_LITTLE_ENDIAN',`',
+`m4_error(`Cannot assemble, unknown limb endianness')')')')
+
+
+dnl Usage: bwx_available_p
+dnl
+dnl Evaluate to 1 if the BWX byte memory instructions are available, or to
+dnl 0 if not.
+dnl
+dnl Listing the chips which do have BWX means anything we haven't looked at
+dnl will use safe non-BWX code. The only targets without BWX currently are
+dnl plain alpha (ie. ev4) and alphaev5.
+
+define(bwx_available_p,
+m4_assert_numargs(-1)
+`m4_ifdef_anyof_p(
+ `HAVE_HOST_CPU_alphaev56',
+ `HAVE_HOST_CPU_alphapca56',
+ `HAVE_HOST_CPU_alphapca57',
+ `HAVE_HOST_CPU_alphaev6',
+ `HAVE_HOST_CPU_alphaev67',
+ `HAVE_HOST_CPU_alphaev68',
+ `HAVE_HOST_CPU_alphaev69',
+ `HAVE_HOST_CPU_alphaev7',
+ `HAVE_HOST_CPU_alphaev79')')
+
+
+dnl Usage: unop
+dnl
+dnl The Cray Unicos assembler lacks unop, so give the equivalent ldq_u
+dnl explicitly.
+
+define(unop,
+m4_assert_numargs(-1)
+`ldq_u r31, 0(r30)')
+
+
+divert
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/aorslsh1_n.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/aorslsh1_n.asm
new file mode 100644
index 00000000000..9525e669db2
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/aorslsh1_n.asm
@@ -0,0 +1,164 @@
+dnl Alpha mpn_addlsh1_n/mpn_sublsh1_n -- rp[] = up[] +- (vp[] << 1).
+
+dnl Copyright 2003, 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/limb
+C EV4: ?
+C EV5: 6.25
+C EV6: 4.5
+
+define(`rp',`r16')
+define(`up',`r17')
+define(`vp',`r18')
+define(`n', `r19')
+
+define(`u0', `r8')
+define(`u1', `r1')
+define(`v0', `r4')
+define(`v1', `r5')
+
+define(`cy0', `r0')
+define(`cy1', `r20')
+define(`cy', `r22')
+define(`rr', `r24')
+define(`ps', `r25')
+define(`sl', `r28')
+
+ifdef(`OPERATION_addlsh1_n',`
+ define(ADDSUB, addq)
+ define(CARRY, `cmpult $1,$2,$3')
+ define(func, mpn_addlsh1_n)
+')
+ifdef(`OPERATION_sublsh1_n',`
+ define(ADDSUB, subq)
+ define(CARRY, `cmpult $2,$1,$3')
+ define(func, mpn_sublsh1_n)
+')
+
+MULFUNC_PROLOGUE(mpn_addlsh1_n mpn_sublsh1_n)
+
+ASM_START()
+PROLOGUE(func)
+ and n, 2, cy0
+ blbs n, L(bx1)
+L(bx0): ldq v1, 0(vp)
+ ldq u1, 0(up)
+ nop
+ bne cy0, L(b10)
+
+L(b00): lda vp, 48(vp)
+ lda up, -16(up)
+ lda rp, -8(rp)
+ br r31, L(lo0)
+
+L(b10): lda vp, 32(vp)
+ lda rp, 8(rp)
+ lda cy0, 0(r31)
+ br r31, L(lo2)
+
+L(bx1): ldq v0, 0(vp)
+ ldq u0, 0(up)
+ lda cy1, 0(r31)
+ beq cy0, L(b01)
+
+L(b11): lda vp, 40(vp)
+ lda up, -24(up)
+ lda rp, 16(rp)
+ br r31, L(lo3)
+
+L(b01): lda n, -4(n)
+ ble n, L(end)
+ lda vp, 24(vp)
+ lda up, -8(up)
+
+ ALIGN(16)
+L(top): addq v0, v0, sl C left shift vlimb
+ ldq v1, -16(vp)
+ ADDSUB u0, sl, ps C ulimb + (vlimb << 1)
+ cmplt v0, r31, cy0 C carry out #1
+ ldq u1, 16(up)
+ ADDSUB ps, cy1, rr C consume carry from previous operation
+ CARRY( ps, u0, cy) C carry out #2
+ stq rr, 0(rp)
+ addq cy, cy0, cy0 C combine carry out #1 and #2
+ CARRY( rr, ps, cy) C carry out #3
+ addq cy, cy0, cy0 C final carry out
+ lda vp, 32(vp) C bookkeeping
+L(lo0): addq v1, v1, sl
+ ldq v0, -40(vp)
+ ADDSUB u1, sl, ps
+ cmplt v1, r31, cy1
+ ldq u0, 24(up)
+ ADDSUB ps, cy0, rr
+ CARRY( ps, u1, cy)
+ stq rr, 8(rp)
+ addq cy, cy1, cy1
+ CARRY( rr, ps, cy)
+ addq cy, cy1, cy1
+ lda rp, 32(rp) C bookkeeping
+L(lo3): addq v0, v0, sl
+ ldq v1, -32(vp)
+ ADDSUB u0, sl, ps
+ cmplt v0, r31, cy0
+ ldq u1, 32(up)
+ ADDSUB ps, cy1, rr
+ CARRY( ps, u0, cy)
+ stq rr, -16(rp)
+ addq cy, cy0, cy0
+ CARRY( rr, ps, cy)
+ addq cy, cy0, cy0
+ lda up, 32(up) C bookkeeping
+L(lo2): addq v1, v1, sl
+ ldq v0, -24(vp)
+ ADDSUB u1, sl, ps
+ cmplt v1, r31, cy1
+ ldq u0, 8(up)
+ ADDSUB ps, cy0, rr
+ CARRY( ps, u1, cy)
+ stq rr, -8(rp)
+ addq cy, cy1, cy1
+ CARRY( rr, ps, cy)
+ addq cy, cy1, cy1
+ lda n, -4(n) C bookkeeping
+ bgt n, L(top)
+
+L(end): addq v0, v0, sl
+ ADDSUB u0, sl, ps
+ ADDSUB ps, cy1, rr
+ cmplt v0, r31, cy0
+ CARRY( ps, u0, cy)
+ stq rr, 0(rp)
+ addq cy, cy0, cy0
+ CARRY( rr, ps, cy)
+ addq cy, cy0, r0
+ ret r31,(r26),1
+EPILOGUE()
+ASM_END()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/aorslsh2_n.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/aorslsh2_n.asm
new file mode 100644
index 00000000000..bdee1d6d021
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/aorslsh2_n.asm
@@ -0,0 +1,167 @@
+dnl Alpha mpn_addlsh2_n/mpn_sublsh2_n -- rp[] = up[] +- (vp[] << 2).
+
+dnl Copyright 2003, 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/limb
+C EV4: ?
+C EV5: 6
+C EV6: 3.75
+
+C TODO
+C * Tune to reach 3.5 c/l on ev6 and 5.75 c/l on ev5.
+
+define(`rp',`r16')
+define(`up',`r17')
+define(`vp',`r18')
+define(`n', `r19')
+
+define(`u0', `r8')
+define(`u1', `r1')
+define(`v0', `r4')
+define(`v1', `r5')
+
+define(`cy0', `r0')
+define(`cy1', `r20')
+define(`cy', `r22')
+define(`rr', `r24')
+define(`ps', `r25')
+define(`sl', `r28')
+
+ifdef(`OPERATION_addlsh2_n',`
+ define(ADDSUB, addq)
+ define(CARRY, `cmpult $1,$2,$3')
+ define(func, mpn_addlsh2_n)
+')
+ifdef(`OPERATION_sublsh2_n',`
+ define(ADDSUB, subq)
+ define(CARRY, `cmpult $2,$1,$3')
+ define(func, mpn_sublsh2_n)
+')
+
+MULFUNC_PROLOGUE(mpn_addlsh2_n mpn_sublsh2_n)
+
+ASM_START()
+PROLOGUE(func)
+ and n, 2, cy0
+ blbs n, L(bx1)
+L(bx0): ldq v1, 0(vp)
+ ldq u1, 0(up)
+ bis r31, r31, r2
+ bne cy0, L(b10)
+
+L(b00): lda vp, 48(vp)
+ lda up, -16(up)
+ lda rp, -8(rp)
+ s4addq v1, r31, sl
+ br r31, L(lo0)
+
+L(b10): lda vp, 32(vp)
+ lda rp, 8(rp)
+ lda cy0, 0(r31)
+ br r31, L(lo2)
+
+L(bx1): ldq v0, 0(vp)
+ ldq u0, 0(up)
+ lda cy1, 0(r31)
+ bis r31, r31, r3
+ nop
+ beq cy0, L(b01)
+
+L(b11): lda vp, 40(vp)
+ lda up, -24(up)
+ lda rp, 16(rp)
+ br r31, L(lo3)
+
+L(b01): lda n, -4(n)
+ ble n, L(end)
+ lda vp, 24(vp)
+ lda up, -8(up)
+
+ ALIGN(16)
+L(top): s4addq v0, r3, sl C combined vlimb
+ ldq v1, -16(vp)
+ ADDSUB u0, sl, ps C ulimb + (vlimb << 1)
+ ldq u1, 16(up)
+ srl v0, 62, r2 C high v bits
+ ADDSUB ps, cy1, rr C consume carry from previous operation
+ CARRY( ps, u0, cy0) C carry out #2
+ stq rr, 0(rp)
+ CARRY( rr, ps, cy) C carry out #3
+ lda vp, 32(vp) C bookkeeping
+ addq cy, cy0, cy0 C final carry out
+ s4addq v1, r2, sl
+L(lo0): ldq v0, -40(vp)
+ ADDSUB u1, sl, ps
+ ldq u0, 24(up)
+ srl v1, 62, r3
+ ADDSUB ps, cy0, rr
+ CARRY( ps, u1, cy1)
+ stq rr, 8(rp)
+ CARRY( rr, ps, cy)
+ lda rp, 32(rp) C bookkeeping
+ addq cy, cy1, cy1
+L(lo3): s4addq v0, r3, sl
+ ldq v1, -32(vp)
+ ADDSUB u0, sl, ps
+ ldq u1, 32(up)
+ srl v0, 62, r2
+ ADDSUB ps, cy1, rr
+ CARRY( ps, u0, cy0)
+ stq rr, -16(rp)
+ CARRY( rr, ps, cy)
+ lda up, 32(up) C bookkeeping
+ addq cy, cy0, cy0
+L(lo2): s4addq v1, r2, sl
+ ldq v0, -24(vp)
+ ADDSUB u1, sl, ps
+ ldq u0, 8(up)
+ srl v1, 62, r3
+ ADDSUB ps, cy0, rr
+ CARRY( ps, u1, cy1)
+ stq rr, -8(rp)
+ CARRY( rr, ps, cy)
+ lda n, -4(n) C bookkeeping
+ addq cy, cy1, cy1
+ bgt n, L(top)
+
+L(end): s4addq v0, r3, sl
+ ADDSUB u0, sl, ps
+ srl v0, 62, r2
+ ADDSUB ps, cy1, rr
+ CARRY( ps, u0, cy0)
+ stq rr, 0(rp)
+ CARRY( rr, ps, cy)
+ addq cy, cy0, cy0
+ addq cy0, r2, r0
+
+ ret r31,(r26),1
+EPILOGUE()
+ASM_END()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/bdiv_dbm1c.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/bdiv_dbm1c.asm
new file mode 100644
index 00000000000..472966ca98e
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/bdiv_dbm1c.asm
@@ -0,0 +1,282 @@
+dnl Alpha mpn_bdiv_dbm1c.
+
+dnl Copyright 2008 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 EV4: 42
+C EV5: 18
+C EV6: 3
+
+C TODO
+C * Try less unrolling, 2-way should give the same performance.
+C * Optimize feed-in and wind-down code, for speed, and perhaps further for
+C code size.
+C * This runs optimally given the algorithm, r8 is on a 3 operation recurrency
+C path. We have not tried very hard to find a better algorithm. Perhaps
+C it would be a good task for the GNU superoptimizer.
+
+C INPUT PARAMETERS
+define(`rp', `r16')
+define(`up', `r17')
+define(`n', `r18')
+define(`bd', `r19')
+define(`cy', `r19')
+
+
+ASM_START()
+PROLOGUE(mpn_bdiv_dbm1c)
+ mov r20, r8
+
+ ldq r24, 0(r17)
+ and r18, 3, r28
+ lda r18, -4(r18)
+ beq r28, L(b0)
+ cmpeq r28, 1, r21
+ bne r21, L(b1)
+ cmpeq r28, 2, r21
+ bne r21, L(b2)
+
+
+L(b3): ldq r2, 8(r17)
+ ldq r3, 16(r17)
+ bgt r18, L(gt3)
+
+ mulq r24, r19, r5 C U1
+ umulh r24, r19, r21 C U1
+ mulq r2, r19, r6 C U1
+ umulh r2, r19, r22 C U1
+ mulq r3, r19, r7 C U1
+ umulh r3, r19, r23 C U1
+ lda r16, -32(r16)
+ br L(cj3)
+
+L(gt3): ldq r0, 24(r17)
+ mulq r24, r19, r5 C U1
+ umulh r24, r19, r21 C U1
+ ldq r1, 32(r17)
+ mulq r2, r19, r6 C U1
+ umulh r2, r19, r22 C U1
+ ldq r2, 40(r17)
+ mulq r3, r19, r7 C U1
+ umulh r3, r19, r23 C U1
+ ldq r3, 48(r17)
+ lda r18, -4(r18)
+ lda r17, 56(r17)
+ mulq r0, r19, r4 C U1
+ bgt r18, L(L3)
+
+ br L(cj7)
+
+
+L(b2): ldq r3, 8(r17)
+ bgt r18, L(gt2)
+
+ mulq r24, r19, r6 C U1
+ umulh r24, r19, r22 C U1
+ mulq r3, r19, r7 C U1
+ umulh r3, r19, r23 C U1
+ lda r16, -40(r16)
+ br L(cj2)
+
+L(gt2): ldq r0, 16(r17)
+ ldq r1, 24(r17)
+ mulq r24, r19, r6 C U1
+ umulh r24, r19, r22 C U1
+ ldq r2, 32(r17)
+ mulq r3, r19, r7 C U1
+ umulh r3, r19, r23 C U1
+ ldq r3, 40(r17)
+ lda r18, -4(r18)
+ lda r17, 48(r17)
+ mulq r0, r19, r4 C U1
+ umulh r0, r19, r20 C U1
+ lda r16, -8(r16)
+ bgt r18, L(gt6)
+
+ mulq r1, r19, r5 C U1
+ br L(cj6)
+
+L(gt6): ldq r0, 0(r17)
+ mulq r1, r19, r5 C U1
+ br L(L2)
+
+
+L(b1): bgt r18, L(gt1)
+
+ mulq r24, r19, r7 C U1
+ umulh r24, r19, r23 C U1
+ lda r16, -48(r16)
+ br L(cj1)
+
+L(gt1): ldq r0, 8(r17)
+ ldq r1, 16(r17)
+ ldq r2, 24(r17)
+ mulq r24, r19, r7 C U1
+ umulh r24, r19, r23 C U1
+ ldq r3, 32(r17)
+ lda r18, -4(r18)
+ lda r17, 40(r17)
+ mulq r0, r19, r4 C U1
+ umulh r0, r19, r20 C U1
+ lda r16, -16(r16)
+ bgt r18, L(gt5)
+
+ mulq r1, r19, r5 C U1
+ umulh r1, r19, r21 C U1
+ mulq r2, r19, r6 C U1
+ br L(cj5)
+
+L(gt5): ldq r0, 0(r17)
+ mulq r1, r19, r5 C U1
+ umulh r1, r19, r21 C U1
+ ldq r1, 8(r17)
+ mulq r2, r19, r6 C U1
+ br L(L1)
+
+
+L(b0): ldq r1, 8(r17)
+ ldq r2, 16(r17)
+ ldq r3, 24(r17)
+ lda r17, 32(r17)
+ lda r16, -24(r16)
+ mulq r24, r19, r4 C U1
+ umulh r24, r19, r20 C U1
+ bgt r18, L(gt4)
+
+ mulq r1, r19, r5 C U1
+ umulh r1, r19, r21 C U1
+ mulq r2, r19, r6 C U1
+ umulh r2, r19, r22 C U1
+ mulq r3, r19, r7 C U1
+ br L(cj4)
+
+L(gt4): ldq r0, 0(r17)
+ mulq r1, r19, r5 C U1
+ umulh r1, r19, r21 C U1
+ ldq r1, 8(r17)
+ mulq r2, r19, r6 C U1
+ umulh r2, r19, r22 C U1
+ ldq r2, 16(r17)
+ mulq r3, r19, r7 C U1
+ br L(L0)
+
+C *** MAIN LOOP START ***
+ ALIGN(16)
+L(top): mulq r0, r19, r4 C U1
+ subq r8, r28, r8
+L(L3): umulh r0, r19, r20 C U1
+ cmpult r8, r5, r28
+ ldq r0, 0(r17)
+ subq r8, r5, r8
+ addq r21, r28, r28
+ stq r8, 0(r16)
+
+ mulq r1, r19, r5 C U1
+ subq r8, r28, r8
+L(L2): umulh r1, r19, r21 C U1
+ cmpult r8, r6, r28
+ ldq r1, 8(r17)
+ subq r8, r6, r8
+ addq r22, r28, r28
+ stq r8, 8(r16)
+
+ mulq r2, r19, r6 C U1
+ subq r8, r28, r8
+L(L1): umulh r2, r19, r22 C U1
+ cmpult r8, r7, r28
+ ldq r2, 16(r17)
+ subq r8, r7, r8
+ addq r23, r28, r28
+ stq r8, 16(r16)
+
+ mulq r3, r19, r7 C U1
+ subq r8, r28, r8
+L(L0): umulh r3, r19, r23 C U1
+ cmpult r8, r4, r28
+ ldq r3, 24(r17)
+ subq r8, r4, r8
+ addq r20, r28, r28
+ stq r8, 24(r16)
+
+ lda r18, -4(r18)
+ lda r17, 32(r17)
+ lda r16, 32(r16)
+ bgt r18, L(top)
+C *** MAIN LOOP END ***
+
+ mulq r0, r19, r4 C U1
+ subq r8, r28, r8
+L(cj7): umulh r0, r19, r20 C U1
+ cmpult r8, r5, r28
+ subq r8, r5, r8
+ addq r21, r28, r28
+ stq r8, 0(r16)
+ mulq r1, r19, r5 C U1
+ subq r8, r28, r8
+L(cj6): umulh r1, r19, r21 C U1
+ cmpult r8, r6, r28
+ subq r8, r6, r8
+ addq r22, r28, r28
+ stq r8, 8(r16)
+ mulq r2, r19, r6 C U1
+ subq r8, r28, r8
+L(cj5): umulh r2, r19, r22 C U1
+ cmpult r8, r7, r28
+ subq r8, r7, r8
+ addq r23, r28, r28
+ stq r8, 16(r16)
+ mulq r3, r19, r7 C U1
+ subq r8, r28, r8
+L(cj4): umulh r3, r19, r23 C U1
+ cmpult r8, r4, r28
+ subq r8, r4, r8
+ addq r20, r28, r28
+ stq r8, 24(r16)
+ subq r8, r28, r8
+L(cj3): cmpult r8, r5, r28
+ subq r8, r5, r8
+ addq r21, r28, r28
+ stq r8, 32(r16)
+ subq r8, r28, r8
+L(cj2): cmpult r8, r6, r28
+ subq r8, r6, r8
+ addq r22, r28, r28
+ stq r8, 40(r16)
+ subq r8, r28, r8
+L(cj1): cmpult r8, r7, r28
+ subq r8, r7, r8
+ addq r23, r28, r28
+ stq r8, 48(r16)
+ subq r8, r28, r0
+ ret r31, (r26), 1
+
+EPILOGUE()
+ASM_END()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/cntlz.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/cntlz.asm
new file mode 100644
index 00000000000..25af19b1316
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/cntlz.asm
@@ -0,0 +1,55 @@
+dnl Alpha auxiliary for longlong.h's count_leading_zeros
+
+dnl Copyright 1997, 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')
+
+
+ASM_START()
+EXTERN(__clz_tab)
+PROLOGUE(mpn_count_leading_zeros,gp)
+ cmpbge r31, r16, r1
+ LEA(r3,__clz_tab)
+ sra r1, 1, r1
+ xor r1, 127, r1
+ srl r16, 1, r16
+ addq r1, r3, r1
+ ldq_u r0, 0(r1)
+ lda r2, 64
+ extbl r0, r1, r0
+ s8subl r0, 8, r0
+ srl r16, r0, r16
+ addq r16, r3, r16
+ ldq_u r1, 0(r16)
+ extbl r1, r16, r1
+ subq r2, r1, r2
+ subq r2, r0, r0
+ ret r31, (r26),1
+EPILOGUE(mpn_count_leading_zeros)
+ASM_END()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/com.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/com.asm
new file mode 100644
index 00000000000..f084ab5e961
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/com.asm
@@ -0,0 +1,176 @@
+dnl Alpha mpn_com -- mpn one's complement.
+
+dnl Copyright 2003 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 EV4: 4.75
+C EV5: 2.0
+C EV6: 1.5
+
+
+C mp_limb_t mpn_com (mp_ptr dst, mp_srcptr src, mp_size_t size);
+C
+C For ev5 the main loop is 7 cycles plus 1 taken branch bubble, for a total
+C 2.0 c/l. In general, a pattern like this unrolled to N limbs per loop
+C will be 1.5+2/N c/l.
+C
+C 2 cycles of loop control are unavoidable, for pointer updates and the
+C taken branch bubble, but also since ldq cannot issue two cycles after stq
+C (and with a run of stqs that means neither of two cycles at the end of the
+C loop.
+C
+C The fbeq is forced into the second cycle of the loop using unops, since
+C the first time through it must wait for the cvtqt result. Once that
+C result is ready (a 1 cycle stall) then both the branch and following loads
+C can issue together.
+C
+C The main loop handles an odd count of limbs, being two limbs loaded before
+C each size test, plus one pipelined around from the previous iteration (or
+C setup in the entry sequence).
+C
+C An even number of limbs is handled by an explicit dst[0]=~src[0] in the
+C entry sequence, and an increment of the pointers. For an odd size there's
+C no increment and the first store in the loop (r24) is a repeat of dst[0].
+C
+C Note that the load for r24 after the possible pointer increment is done
+C before the explicit store to dst[0], in case src==dst.
+
+
+ASM_START()
+
+FLOAT64(L(dat), 2.0)
+
+ ALIGN(16)
+
+PROLOGUE(mpn_com,gp)
+
+ C r16 dst
+ C r17 src
+ C r18 size
+
+ lda r30, -16(r30) C temporary stack space
+ lda r7, -3(r18) C size - 3
+
+ ldq r20, 0(r17) C src[0]
+ srl r7, 1, r6 C (size-3)/2
+
+ stq r6, 8(r30) C (size-3)/2
+ and r7, 1, r5 C 1 if size even
+
+ LEA( r8, L(dat))
+ s8addq r5, r17, r17 C skip src[0] if even
+
+ ornot r31, r20, r20 C ~src[0]
+ unop
+
+ ldt f0, 8(r30) C (size-3)/2
+ ldq r24, 0(r17) C src[0 or 1]
+
+ stq r20, 0(r16) C dst[0]
+ s8addq r5, r16, r19 C skip dst[0] if even
+
+ ldt f1, 0(r8) C data 2.0
+ lda r30, 16(r30) C restore stack
+ unop
+ cvtqt f0, f0 C (size-3)/2 as float
+
+ ornot r31, r24, r24
+ blt r7, L(done_1) C if size<=2
+ unop
+ unop
+
+
+ C 16-byte alignment here
+L(top):
+ C r17 src, incrementing
+ C r19 dst, incrementing
+ C r24 dst[i] result, ready to store
+ C f0 (size-3)/2, decrementing
+ C f1 2.0
+
+ ldq r20, 8(r17) C src[i+1]
+ ldq r21, 16(r17) C src[i+2]
+ unop
+ unop
+
+ fbeq f0, L(done_2)
+ unop
+ ldq r22, 24(r17) C src[i+3]
+ ldq r23, 32(r17) C src[i+4]
+
+ stq r24, 0(r19) C dst[i]
+ ornot r31, r20, r20
+ subt f0, f1, f0 C count -= 2
+ unop
+
+ stq r20, 8(r19) C dst[i+1]
+ ornot r31, r21, r21
+ unop
+ unop
+
+ stq r21, 16(r19) C dst[i+2]
+ ornot r31, r22, r22
+
+ stq r22, 24(r19) C dst[i+3]
+ ornot r31, r23, r24
+
+ lda r17, 32(r17) C src += 4
+ lda r19, 32(r19) C dst += 4
+ unop
+ fbge f0, L(top)
+
+
+L(done_1):
+ C r19 &dst[size-1]
+ C r24 result for dst[size-1]
+
+ stq r24, 0(r19) C dst[size-1]
+ ret r31, (r26), 1
+
+
+L(done_2):
+ C r19 &dst[size-3]
+ C r20 src[size-2]
+ C r21 src[size-1]
+ C r24 result for dst[size-3]
+
+ stq r24, 0(r19) C dst[size-3]
+ ornot r31, r20, r20
+
+ stq r20, 8(r19) C dst[size-2]
+ ornot r31, r21, r21
+
+ stq r21, 16(r19) C dst[size-1]
+ ret r31, (r26), 1
+
+EPILOGUE()
+ASM_END()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/copyd.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/copyd.asm
new file mode 100644
index 00000000000..b41b5366cc5
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/copyd.asm
@@ -0,0 +1,88 @@
+dnl Alpha mpn_copyd -- copy, decrementing.
+
+dnl Copyright 2002, 2003 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 EV4: 4
+C EV5: 1.75
+C EV6: 1
+
+C INPUT PARAMETERS
+C rp r16
+C up r17
+C n r18
+
+
+ASM_START()
+PROLOGUE(mpn_copyd)
+ s8addq r18,r16,r16 C E0
+ s8addq r18,r17,r17 C E1
+ lda r18,-8(r18) C E0
+ blt r18,$Lend C E1
+$Loop: ldq r0,-8(r17) C E0
+ ldq r1,-16(r17) C E1
+ ldq r2,-24(r17) C E0
+ ldq r3,-32(r17) C E1
+ ldq r4,-40(r17) C E0
+ ldq r5,-48(r17) C E1
+ ldq r6,-56(r17) C E0
+ ldq r7,-64(r17) C E1
+ stq r0,-8(r16) C E0
+ lda r17,-64(r17) C E1
+ stq r1,-16(r16) C E0
+ bis r31, r31, r31 C E1
+ stq r2,-24(r16) C E0
+ lda r18,-8(r18) C E1
+ stq r3,-32(r16) C E0
+ bis r31, r31, r31 C E1
+ stq r4,-40(r16) C E0
+ bis r31, r31, r31 C E1
+ stq r5,-48(r16) C E0
+ bis r31, r31, r31 C E1
+ stq r6,-56(r16) C E0
+ bis r31, r31, r31 C E1
+ stq r7,-64(r16) C E0
+ lda r16,-64(r16) C E1
+ bge r18,$Loop C E1
+$Lend: lda r18,7(r18) C E0
+ blt r18,$Lret C E1
+ ldq r0,-8(r17) C E0
+ beq r18,$Lend0 C E1
+$Loop0: stq r0,-8(r16) C E0
+ lda r16,-8(r16) C E1
+ ldq r0,-16(r17) C E0
+ lda r18,-1(r18) C E1
+ lda r17,-8(r17) C E0
+ bgt r18,$Loop0 C E1
+$Lend0: stq r0,-8(r16) C E0
+$Lret: ret r31,(r26),1 C E1
+EPILOGUE(mpn_copyd)
+ASM_END()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/copyi.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/copyi.asm
new file mode 100644
index 00000000000..f7e2ad6f6a9
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/copyi.asm
@@ -0,0 +1,86 @@
+dnl Alpha mpn_copyi -- copy, incrementing.
+
+dnl Copyright 2002, 2003 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 EV4: 4
+C EV5: 1.75
+C EV6: 1
+
+C INPUT PARAMETERS
+C rp r16
+C up r17
+C n r18
+
+
+ASM_START()
+PROLOGUE(mpn_copyi)
+ lda r18,-8(r18) C E0
+ blt r18,$Lend C E1
+$Loop: ldq r0,0(r17) C E0
+ ldq r1,8(r17) C E1
+ ldq r2,16(r17) C E0
+ ldq r3,24(r17) C E1
+ ldq r4,32(r17) C E0
+ ldq r5,40(r17) C E1
+ ldq r6,48(r17) C E0
+ ldq r7,56(r17) C E1
+ stq r0,0(r16) C E0
+ lda r17,64(r17) C E1
+ stq r1,8(r16) C E0
+ bis r31, r31, r31 C E1
+ stq r2,16(r16) C E0
+ lda r18,-8(r18) C E1
+ stq r3,24(r16) C E0
+ bis r31, r31, r31 C E1
+ stq r4,32(r16) C E0
+ bis r31, r31, r31 C E1
+ stq r5,40(r16) C E0
+ bis r31, r31, r31 C E1
+ stq r6,48(r16) C E0
+ bis r31, r31, r31 C E1
+ stq r7,56(r16) C E0
+ lda r16,64(r16) C E1
+ bge r18,$Loop C E1
+$Lend: lda r18,7(r18) C E0
+ blt r18,$Lret C E1
+ ldq r0,0(r17) C E0
+ beq r18,$Lend0 C E1
+$Loop0: stq r0,0(r16) C E0
+ lda r16,8(r16) C E1
+ ldq r0,8(r17) C E0
+ lda r18,-1(r18) C E1
+ lda r17,8(r17) C E0
+ bgt r18,$Loop0 C E1
+$Lend0: stq r0,0(r16) C E0
+$Lret: ret r31,(r26),1 C E1
+EPILOGUE(mpn_copyi)
+ASM_END()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/default.m4 b/Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/default.m4
new file mode 100644
index 00000000000..8fe7c4e1223
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/default.m4
@@ -0,0 +1,127 @@
+divert(-1)
+
+dnl m4 macros for alpha assembler (everywhere except unicos).
+
+
+dnl Copyright 2000, 2002-2004, 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/.
+
+
+dnl Usage: ASM_START()
+define(`ASM_START',
+m4_assert_numargs(0)
+` .set noreorder
+ .set noat')
+
+dnl Usage: X(value)
+define(`X',
+m4_assert_numargs(1)
+`0x$1')
+
+dnl Usage: FLOAT64(label,value)
+define(`FLOAT64',
+m4_assert_numargs(2)
+` .align 3
+$1: .t_floating $2')
+
+
+dnl Called: PROLOGUE_cpu(GSYM_PREFIX`'foo[,gp|noalign])
+dnl EPILOGUE_cpu(GSYM_PREFIX`'foo)
+
+define(`PROLOGUE_cpu',
+m4_assert_numargs_range(1,2)
+`ifelse(`$2',gp,,
+`ifelse(`$2',noalign,,
+`ifelse(`$2',,,`m4_error(`Unrecognised PROLOGUE parameter
+')')')')dnl
+ .text
+ifelse(`$2',noalign,,` ALIGN(16)')
+ .globl $1
+ .ent $1
+$1:
+ .frame r30,0,r26,0
+ifelse(`$2',gp,` ldgp r29, 0(r27)
+`$'$1..ng:')
+ .prologue ifelse(`$2',gp,1,0)')
+
+define(`EPILOGUE_cpu',
+m4_assert_numargs(1)
+` .end $1')
+
+
+dnl Usage: LDGP(dst,src)
+dnl
+dnl Emit an "ldgp dst,src", but only if the system uses a GOT.
+
+define(LDGP,
+m4_assert_numargs(2)
+`ldgp `$1', `$2'')
+
+
+dnl Usage: EXTERN(variable_name)
+define(`EXTERN',
+m4_assert_numargs(1)
+)
+
+dnl Usage: r0 ... r31
+dnl f0 ... f31
+dnl
+dnl Map register names r0 to $0, and f0 to $f0, etc.
+dnl This is needed on all systems but Unicos
+dnl
+dnl defreg() is used to protect the $ in $0 (otherwise it would represent a
+dnl macro argument). Double quoting is used to protect the f0 in $f0
+dnl (otherwise it would be an infinite recursion).
+
+forloop(i,0,31,`defreg(`r'i,$i)')
+forloop(i,0,31,`deflit(`f'i,``$f''i)')
+
+
+dnl Usage: DATASTART(name,align) or DATASTART(name)
+dnl DATAEND()
+
+define(`DATASTART',
+m4_assert_numargs_range(1,2)
+` RODATA
+ ALIGN(ifelse($#,1,2,$2))
+$1:')
+define(`DATAEND',
+m4_assert_numargs(0)
+)
+
+dnl Load a symbolic address into a register
+define(`LEA',
+m4_assert_numargs(2)
+`lda $1, $2')
+
+dnl Usage: ASM_END()
+define(`ASM_END',
+m4_assert_numargs(0)
+)
+
+divert
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/dive_1.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/dive_1.c
new file mode 100644
index 00000000000..88b82db2f73
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/dive_1.c
@@ -0,0 +1,115 @@
+/* Alpha mpn_divexact_1 -- mpn by limb exact division.
+
+ 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 2000-2003 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.h"
+#include "gmp-impl.h"
+#include "longlong.h"
+
+
+/* cycles/limb
+ EV4: 47.0
+ EV5: 30.0
+ EV6: 15.0
+*/
+
+
+/* The dependent chain is as follows (the same as modexact), and this is
+ what the code runs as.
+
+ ev4 ev5 ev6
+ 1 1 1 sub y = x - h
+ 23 13 7 mulq q = y * inverse
+ 23 15 7 umulh h = high (q * d)
+ -- -- --
+ 47 30 15
+
+ The time to load src[i+1] and establish x hides under the umulh latency. */
+
+void
+mpn_divexact_1 (mp_ptr dst, mp_srcptr src, mp_size_t size, mp_limb_t divisor)
+{
+ mp_limb_t inverse, lshift_mask, s, sr, s_next, c, h, x, y, q, dummy;
+ unsigned rshift, lshift;
+
+ ASSERT (size >= 1);
+ ASSERT (divisor != 0);
+ ASSERT (MPN_SAME_OR_SEPARATE_P (dst, src, size));
+ ASSERT_MPN (src, size);
+ ASSERT_LIMB (divisor);
+
+ s_next = *src++; /* src[0] */
+
+ rshift = 0;
+ lshift_mask = 0;
+ if ((divisor & 1) == 0)
+ {
+ count_trailing_zeros (rshift, divisor);
+ lshift_mask = MP_LIMB_T_MAX;
+ divisor >>= rshift;
+ }
+
+ binvert_limb (inverse, divisor);
+ lshift = 64 - rshift;
+
+ c = 0;
+ h = 0;
+ sr = s_next >> rshift;
+
+ size--;
+ if (LIKELY (size != 0))
+ {
+ do
+ {
+ s_next = *src++; /* src[i+1] */
+ s = sr | ((s_next << lshift) & lshift_mask);
+ x = s - c;
+ c = s < c;
+ sr = s_next >> rshift;
+
+ y = x - h;
+ c += (x < h);
+ q = y * inverse;
+ *dst++ = q;
+ umul_ppmm (h, dummy, q, divisor);
+
+ size--;
+ }
+ while (size != 0);
+ }
+
+ x = sr - c;
+ y = x - h;
+ q = y * inverse;
+ *dst = q; /* dst[size-1] */
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/divrem_2.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/divrem_2.asm
new file mode 100644
index 00000000000..046b246a95e
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/divrem_2.asm
@@ -0,0 +1,177 @@
+dnl Alpha mpn_divrem_2 -- Divide an mpn number by a normalized 2-limb number.
+
+dnl Copyright 2007, 2008, 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 norm frac
+C ev4
+C ev5 70 70
+C ev6 29 29
+
+C TODO
+C * Perhaps inline mpn_invert_limb, that would allow us to not save/restore
+C any registers (thus save ~10 cycles per call).
+C * Use negated d1 and/or d0 to speed carry propagation. Might save a cycle
+C or two.
+C * Check cluster delays (for ev6). We very likely could save some cycles.
+C * Use branch-free code for computing di.
+C * CAVEAT: We rely on r19 not being clobbered by mpn_invert_limb call.
+
+C INPUT PARAMETERS
+define(`qp', `r16')
+define(`fn', `r17')
+define(`up_param', `r18')
+define(`un_param', `r19')
+define(`dp', `r20')
+
+ASM_START()
+PROLOGUE(mpn_divrem_2,gp)
+ lda r30, -80(r30)
+ stq r26, 0(r30)
+ stq r9, 8(r30)
+ stq r10, 16(r30)
+ stq r11, 24(r30)
+ stq r12, 32(r30)
+ stq r13, 40(r30)
+C stq r14, 48(r30)
+ stq r15, 56(r30)
+ .prologue 1
+ stq r16, 64(r30)
+ bis r31, r17, r15
+ s8addq r19, r18, r13
+ lda r13, -24(r13)
+ ldq r12, 8(r20)
+ ldq r10, 0(r20)
+ ldq r11, 16(r13)
+ ldq r9, 8(r13)
+
+ bis r31, r31, r3 C most_significant_q_limb = 0
+ cmpult r11, r12, r1
+ bne r1, L(L8)
+ cmpule r11, r12, r1
+ cmpult r9, r10, r2
+ and r1, r2, r1
+ bne r1, L(L8)
+ subq r11, r12, r11
+ subq r11, r2, r11
+ subq r9, r10, r9
+ lda r3, 1(r31) C most_significant_q_limb = 1
+L(L8): stq r3, 72(r30)
+
+ addq r15, r19, r19
+ lda r19, -3(r19)
+ blt r19, L(L10)
+ bis r31, r12, r16
+ jsr r26, mpn_invert_limb
+ LDGP( r29, 0(r26))
+ mulq r0, r12, r4 C t0 = LO(di * d1)
+ umulh r0, r10, r2 C s1 = HI(di * d0)
+ addq r4, r10, r4 C t0 += d0
+ cmpule r10, r4, r7 C (t0 < d0)
+ addq r4, r2, r4 C t0 += s1
+ cmpult r4, r2, r1
+ subq r1, r7, r7 C t1 (-1, 0, or 1)
+ blt r7, L(L42)
+L(L22):
+ lda r0, -1(r0) C di--
+ cmpult r4, r12, r1 C cy for: t0 -= d1 (below)
+ subq r7, r1, r7 C t1 -= cy
+ subq r4, r12, r4 C t0 -= d1
+ bge r7, L(L22)
+L(L42):
+ ldq r16, 64(r30)
+ s8addq r19, r16, r16
+ ALIGN(16)
+L(loop):
+ mulq r11, r0, r5 C q0 (early)
+ umulh r11, r0, r6 C q (early)
+ addq r5, r9, r8 C q0 += n1
+ addq r6, r11, r6 C q += n2
+ cmpult r8, r5, r1 C cy for: q0 += n1
+ addq r6, r1, r6 C q += cy
+ unop
+ mulq r12, r6, r1 C LO(d1 * q)
+ umulh r10, r6, r7 C t1 = HI(d0 * q)
+ subq r9, r1, r9 C n1 -= LO(d1 * q)
+ mulq r10, r6, r4 C t0 = LO(d0 * q)
+ unop
+ cmple r15, r19, r5 C condition and n0...
+ beq r5, L(L31)
+ ldq r5, 0(r13)
+ lda r13, -8(r13)
+L(L31): subq r9, r12, r9 C n1 -= d1
+ cmpult r5, r10, r1 C
+ subq r9, r1, r9 C
+ subq r5, r10, r5 C n0 -= d0
+ subq r9, r7, r9 C n1 -= t0
+ cmpult r5, r4, r1 C
+ subq r9, r1, r2 C
+ subq r5, r4, r5 C n0 -= t1
+ cmpult r2, r8, r1 C (n1 < q0)
+ addq r6, r1, r6 C q += cond
+ lda r1, -1(r1) C -(n1 >= q0)
+ and r1, r10, r4 C
+ addq r5, r4, r9 C n0 += mask & d0
+ and r1, r12, r1 C
+ cmpult r9, r5, r11 C cy for: n0 += mask & d0
+ addq r2, r1, r1 C n1 += mask & d1
+ addq r1, r11, r11 C n1 += cy
+ cmpult r11, r12, r1 C
+ beq r1, L(fix) C
+L(bck): stq r6, 0(r16)
+ lda r16, -8(r16)
+ lda r19, -1(r19)
+ bge r19, L(loop)
+
+L(L10): stq r9, 8(r13)
+ stq r11, 16(r13)
+ ldq r0, 72(r30)
+ ldq r26, 0(r30)
+ ldq r9, 8(r30)
+ ldq r10, 16(r30)
+ ldq r11, 24(r30)
+ ldq r12, 32(r30)
+ ldq r13, 40(r30)
+C ldq r14, 48(r30)
+ ldq r15, 56(r30)
+ lda r30, 80(r30)
+ ret r31, (r26), 1
+
+L(fix): cmpule r11, r12, r1
+ cmpult r9, r10, r2
+ and r1, r2, r1
+ bne r1, L(bck)
+ subq r11, r12, r11
+ subq r11, r2, r11
+ subq r9, r10, r9
+ lda r6, 1(r6)
+ br L(bck)
+EPILOGUE()
+ASM_END()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/ev5/diveby3.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/ev5/diveby3.asm
new file mode 100644
index 00000000000..3758188e020
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/ev5/diveby3.asm
@@ -0,0 +1,332 @@
+dnl Alpha mpn_divexact_by3c -- mpn division by 3, expecting no remainder.
+
+dnl Copyright 2004, 2005, 2009 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 EV4: 22
+C EV5: 11.5
+C EV6: 6.3 Note that mpn_bdiv_dbm1c is faster
+
+C TODO
+C * Remove the unops, they benefit just ev6, which no longer uses this file.
+C * Try prefetch for destination, using lds.
+C * Improve feed-in code, by moving initial mulq earlier; make initial load
+C to u0/u0 to save some copying.
+C * Combine u0 and u2, u1 and u3.
+
+C INPUT PARAMETERS
+define(`rp', `r16')
+define(`up', `r17')
+define(`n', `r18')
+define(`cy', `r19')
+
+ASM_START()
+
+DATASTART(L(LC),8)
+ .quad 0xAAAAAAAAAAAAAAAB
+ .quad 0x5555555555555555
+ .quad 0xAAAAAAAAAAAAAAAA
+DATAEND()
+
+define(`xAAAAAAAAAAAAAAAB', `r20')
+define(`x5555555555555555', `r21')
+define(`xAAAAAAAAAAAAAAAA', `r22')
+define(`u0', `r0') define(`u1', `r1')
+define(`u2', `r2') define(`u3', `r3')
+define(`l0', `r25') define(`x', `r8')
+define(`q0', `r4') define(`q1', `r5')
+define(`p6', `r6') define(`p7', `r7')
+define(`t0', `r23') define(`t1', `r24')
+define(`cymask',`r28')
+
+
+PROLOGUE(mpn_divexact_by3c,gp)
+
+ ldq r28, 0(up) C load first limb early
+
+C Put magic constants in registers
+ lda r0, L(LC)
+ ldq xAAAAAAAAAAAAAAAB, 0(r0)
+ ldq x5555555555555555, 8(r0)
+ ldq xAAAAAAAAAAAAAAAA, 16(r0)
+
+C Compute initial l0 value
+ cmpeq cy, 1, p6
+ cmpeq cy, 2, p7
+ negq p6, p6
+ and p6, x5555555555555555, l0
+ cmovne p7, xAAAAAAAAAAAAAAAA, l0
+
+C Feed-in depending on (n mod 4)
+ and n, 3, r8
+ lda n, -3(n)
+ cmpeq r8, 1, r4
+ cmpeq r8, 2, r5
+ bne r4, $Lb01
+ bne r5, $Lb10
+ beq r8, $Lb00
+
+$Lb11: ldq u3, 8(up)
+ lda up, -24(up)
+ lda rp, -24(rp)
+ mulq r28, xAAAAAAAAAAAAAAAB, q0
+ mov r28, u2
+ br r31, $L11
+
+$Lb00: ldq u2, 8(up)
+ lda up, -16(up)
+ lda rp, -16(rp)
+ mulq r28, xAAAAAAAAAAAAAAAB, q1
+ mov r28, u1
+ br r31, $L00
+
+$Lb01: lda rp, -8(rp)
+ mulq r28, xAAAAAAAAAAAAAAAB, q0
+ mov r28, u0
+ blt n, $Lcj1
+ ldq u1, 8(up)
+ lda up, -8(up)
+ br r31, $L01
+
+$Lb10: ldq u0, 8(up)
+ mulq r28, xAAAAAAAAAAAAAAAB, q1
+ mov r28, u3
+ blt n, $Lend
+
+ ALIGN(16)
+$Ltop:
+C 0
+ cmpult u3, cy, cy C L0
+ mulq u0, xAAAAAAAAAAAAAAAB, q0 C U1
+ ldq u1, 16(up) C L1
+ addq q1, l0, x C U0
+C 1
+ negq cy, cymask C L0
+ unop C U1
+ unop C L1
+ cmpult x5555555555555555, x, p6 C U0
+C 2
+ cmpult xAAAAAAAAAAAAAAAA, x, p7 C U1
+ unop
+ unop
+ negq p6, t0 C L0
+C 3
+ negq p7, t1 C L0
+ and cymask, x5555555555555555, l0 C U1
+ addq p6, cy, cy
+ and t0, x5555555555555555, t0
+C 4
+ and t1, x5555555555555555, t1
+ addq p7, cy, cy
+ unop
+ addq t0, l0, l0
+C 5
+ addq t1, l0, l0
+ unop
+ stq x, 0(rp) C L1
+ unop
+$L01:
+C 0
+ cmpult u0, cy, cy C L0
+ mulq u1, xAAAAAAAAAAAAAAAB, q1 C U1
+ ldq u2, 24(up) C L1
+ addq q0, l0, x C U0
+C 1
+ negq cy, cymask C L0
+ unop C U1
+ unop C L1
+ cmpult x5555555555555555, x, p6 C U0
+C 2
+ cmpult xAAAAAAAAAAAAAAAA, x, p7 C U1
+ unop
+ unop
+ negq p6, t0 C L0
+C 3
+ negq p7, t1 C L0
+ and cymask, x5555555555555555, l0 C U1
+ addq p6, cy, cy
+ and t0, x5555555555555555, t0
+C 4
+ and t1, x5555555555555555, t1
+ addq p7, cy, cy
+ unop
+ addq t0, l0, l0
+C 5
+ addq t1, l0, l0
+ unop
+ stq x, 8(rp) C L1
+ unop
+$L00:
+C 0
+ cmpult u1, cy, cy C L0
+ mulq u2, xAAAAAAAAAAAAAAAB, q0 C U1
+ ldq u3, 32(up) C L1
+ addq q1, l0, x C U0
+C 1
+ negq cy, cymask C L0
+ unop C U1
+ unop C L1
+ cmpult x5555555555555555, x, p6 C U0
+C 2
+ cmpult xAAAAAAAAAAAAAAAA, x, p7 C U1
+ unop
+ unop
+ negq p6, t0 C L0
+C 3
+ negq p7, t1 C L0
+ and cymask, x5555555555555555, l0 C U1
+ addq p6, cy, cy
+ and t0, x5555555555555555, t0
+C 4
+ and t1, x5555555555555555, t1
+ addq p7, cy, cy
+ unop
+ addq t0, l0, l0
+C 5
+ addq t1, l0, l0
+ unop
+ stq x, 16(rp) C L1
+ unop
+$L11:
+C 0
+ cmpult u2, cy, cy C L0
+ mulq u3, xAAAAAAAAAAAAAAAB, q1 C U1
+ ldq u0, 40(up) C L1
+ addq q0, l0, x C U0
+C 1
+ negq cy, cymask C L0
+ unop C U1
+ unop C L1
+ cmpult x5555555555555555, x, p6 C U0
+C 2
+ cmpult xAAAAAAAAAAAAAAAA, x, p7 C U1
+ lda n, -4(n) C L1 bookkeeping
+ unop
+ negq p6, t0 C L0
+C 3
+ negq p7, t1 C L0
+ and cymask, x5555555555555555, l0 C U1
+ addq p6, cy, cy
+ and t0, x5555555555555555, t0
+C 4
+ and t1, x5555555555555555, t1
+ addq p7, cy, cy
+ unop
+ addq t0, l0, l0
+C 5
+ addq t1, l0, l0
+ unop
+ stq x, 24(rp) C L1
+ lda up, 32(up)
+C
+ ldl r31, 256(up) C prefetch
+ unop
+ lda rp, 32(rp)
+ bge n, $Ltop C U1
+C *** MAIN LOOP END ***
+$Lend:
+
+ cmpult u3, cy, cy C L0
+ mulq u0, xAAAAAAAAAAAAAAAB, q0 C U1
+ unop
+ addq q1, l0, x C U0
+C 1
+ negq cy, cymask C L0
+ unop C U1
+ unop C L1
+ cmpult x5555555555555555, x, p6 C U0
+C 2
+ cmpult xAAAAAAAAAAAAAAAA, x, p7 C U1
+ unop
+ unop
+ negq p6, t0 C L0
+C 3
+ negq p7, t1 C L0
+ and cymask, x5555555555555555, l0 C U1
+ addq p6, cy, cy
+ and t0, x5555555555555555, t0
+C 4
+ and t1, x5555555555555555, t1
+ addq p7, cy, cy
+ unop
+ addq t0, l0, l0
+C 5
+ addq t1, l0, l0
+ unop
+ stq x, 0(rp) C L1
+ unop
+$Lcj1:
+ cmpult u0, cy, cy C L0
+ addq q0, l0, x C U0
+ cmpult x5555555555555555, x, p6 C U0
+ cmpult xAAAAAAAAAAAAAAAA, x, p7 C U1
+ addq p6, cy, cy
+ addq p7, cy, r0
+ stq x, 8(rp) C L1
+
+ ret r31,(r26),1
+EPILOGUE()
+ASM_END()
+
+C This is useful for playing with various schedules.
+C Expand as: one(0)one(1)one(2)one(3)
+define(`one',`
+C 0
+ cmpult `$'eval(($1+3)%4), cy, cy C L0
+ mulq `$'$1, xAAAAAAAAAAAAAAAB, `$'eval(4+$1%2) C U1
+ ldq `$'eval(($1+1)%4), eval($1*8+16)(up) C L1
+ addq `$'eval(4+($1+1)%2), l0, x C U0
+C 1
+ negq cy, cymask C L0
+ unop C U1
+ unop C L1
+ cmpult x5555555555555555, x, p6 C U0
+C 2
+ cmpult xAAAAAAAAAAAAAAAA, x, p7 C U1
+ unop
+ unop
+ negq p6, t0 C L0
+C 3
+ negq p7, t1 C L0
+ and cymask, x5555555555555555, l0 C U1
+ addq p6, cy, cy
+ and t0, x5555555555555555, t0
+C 4
+ and t1, x5555555555555555, t1
+ addq p7, cy, cy
+ unop
+ addq t0, l0, l0
+C 5
+ addq t1, l0, l0
+ unop
+ stq x, eval($1*8)(rp) C L1
+ unop
+')
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/ev5/gmp-mparam.h b/Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/ev5/gmp-mparam.h
new file mode 100644
index 00000000000..b560c20afec
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/ev5/gmp-mparam.h
@@ -0,0 +1,187 @@
+/* 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.
+
+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
+
+/* 600 MHz 21164A */
+/* FFT tuning limit = 5000000 */
+/* Generated by tuneup.c, 2014-03-12, gcc 4.5 */
+
+#define DIVREM_1_NORM_THRESHOLD 0 /* preinv always */
+#define DIVREM_1_UNNORM_THRESHOLD 0 /* always */
+#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_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 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 */
+#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 MUL_TOOM22_THRESHOLD 14
+#define MUL_TOOM33_THRESHOLD 50
+#define MUL_TOOM44_THRESHOLD 118
+#define MUL_TOOM6H_THRESHOLD 157
+#define MUL_TOOM8H_THRESHOLD 236
+
+#define MUL_TOOM32_TO_TOOM43_THRESHOLD 73
+#define MUL_TOOM32_TO_TOOM53_THRESHOLD 77
+#define MUL_TOOM42_TO_TOOM53_THRESHOLD 81
+#define MUL_TOOM42_TO_TOOM63_THRESHOLD 56
+#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_TOOM4_THRESHOLD 178
+#define SQR_TOOM6_THRESHOLD 0 /* always */
+#define SQR_TOOM8_THRESHOLD 260
+
+#define MULMID_TOOM42_THRESHOLD 18
+
+#define MULMOD_BNM1_THRESHOLD 9
+#define SQRMOD_BNM1_THRESHOLD 12
+
+#define MUL_FFT_MODF_THRESHOLD 284 /* k = 5 */
+#define MUL_FFT_TABLE3 \
+ { { 284, 5}, { 11, 6}, { 6, 5}, { 13, 6}, \
+ { 7, 5}, { 15, 6}, { 13, 7}, { 7, 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}, \
+ { 23, 8}, { 47,10}, { 15, 9}, { 39,10}, \
+ { 23, 9}, { 47,11}, { 15,10}, { 31, 9}, \
+ { 67,10}, { 39, 9}, { 79,10}, { 47, 9}, \
+ { 95,10}, { 55,11}, { 31,10}, { 63, 8}, \
+ { 255, 7}, { 511,10}, { 71, 9}, { 143, 8}, \
+ { 287, 7}, { 575, 9}, { 159, 8}, { 319,11}, \
+ { 47,12}, { 31,11}, { 63, 9}, { 255, 8}, \
+ { 511,10}, { 143, 9}, { 287,11}, { 79,10}, \
+ { 159, 9}, { 319,10}, { 175, 9}, { 351, 8}, \
+ { 703,10}, { 191, 9}, { 383,10}, { 207, 9}, \
+ { 415,12}, { 63,10}, { 255,11}, { 143,10}, \
+ { 287, 9}, { 575,11}, { 159,10}, { 319, 9}, \
+ { 639,11}, { 175,12}, { 95,11}, { 191,10}, \
+ { 383,11}, { 207,10}, { 415,11}, { 223,13}, \
+ { 63,11}, { 287,10}, { 575,12}, { 159,11}, \
+ { 319,10}, { 639,11}, { 351,12}, { 191,11}, \
+ { 415,12}, { 223,11}, { 447,10}, { 895,11}, \
+ { 479,12}, { 287,11}, { 575,12}, { 351,13}, \
+ { 191,12}, { 479,13}, { 255,12}, { 575,13}, \
+ { 319,12}, { 703,13}, { 383,12}, { 831,13}, \
+ { 447,14}, { 255,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 121
+#define MUL_FFT_THRESHOLD 4224
+
+#define SQR_FFT_MODF_THRESHOLD 240 /* k = 5 */
+#define SQR_FFT_TABLE3 \
+ { { 240, 5}, { 13, 6}, { 7, 5}, { 15, 6}, \
+ { 14, 5}, { 29, 7}, { 9, 6}, { 19, 7}, \
+ { 13, 6}, { 27, 8}, { 7, 7}, { 21, 8}, \
+ { 11, 7}, { 29, 8}, { 19, 9}, { 11, 8}, \
+ { 27,10}, { 7, 9}, { 15, 8}, { 33, 9}, \
+ { 19, 8}, { 39, 9}, { 23, 8}, { 47,10}, \
+ { 15, 9}, { 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,10}, { 79,11}, { 47,12}, { 31,11}, \
+ { 63,10}, { 127, 9}, { 255,10}, { 143, 9}, \
+ { 287,11}, { 79,10}, { 159, 9}, { 319,10}, \
+ { 175,11}, { 95,10}, { 191, 9}, { 383,10}, \
+ { 207, 9}, { 415,11}, { 111,10}, { 223,12}, \
+ { 63,11}, { 175,12}, { 95,11}, { 207,13}, \
+ { 63,12}, { 127,11}, { 287,12}, { 159,11}, \
+ { 351,12}, { 191,11}, { 415,12}, { 223,11}, \
+ { 447,13}, { 127,12}, { 351,13}, { 191,12}, \
+ { 383,11}, { 767,12}, { 415,11}, { 831,12}, \
+ { 447,14}, { 127,13}, { 255,12}, { 511,11}, \
+ { 1087,12}, { 575,13}, { 319,12}, { 703,13}, \
+ { 383,12}, { 831,13}, { 447,14}, { 255,13}, \
+ { 511,12}, { 1023,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 105
+#define SQR_FFT_THRESHOLD 3968
+
+#define MULLO_BASECASE_THRESHOLD 0 /* always */
+#define MULLO_DC_THRESHOLD 45
+#define MULLO_MUL_N_THRESHOLD 8397
+
+#define DC_DIV_QR_THRESHOLD 47
+#define DC_DIVAPPR_Q_THRESHOLD 168
+#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 BINV_NEWTON_THRESHOLD 196
+#define REDC_1_TO_REDC_N_THRESHOLD 51
+
+#define MU_DIV_QR_THRESHOLD 1558
+#define MU_DIVAPPR_Q_THRESHOLD 1558
+#define MUPI_DIV_QR_THRESHOLD 90
+#define MU_BDIV_QR_THRESHOLD 855
+#define MU_BDIV_Q_THRESHOLD 1078
+
+#define POWM_SEC_TABLE 1,16,90,452,1221
+
+#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 13
+#define GET_STR_PRECOMPUTE_THRESHOLD 28
+#define SET_STR_DC_THRESHOLD 426
+#define SET_STR_PRECOMPUTE_THRESHOLD 1505
+
+#define FAC_DSC_THRESHOLD 1404
+#define FAC_ODD_THRESHOLD 0 /* always */
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/ev6/add_n.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/ev6/add_n.asm
new file mode 100644
index 00000000000..9261f31b8a1
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/ev6/add_n.asm
@@ -0,0 +1,283 @@
+dnl Alpha ev6 mpn_add_n -- Add two limb vectors of the same length > 0 and
+dnl store sum in a third limb vector.
+
+dnl Copyright 2000, 2003, 2005 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 EV4: ?
+C EV5: 5.4
+C EV6: 2.125
+
+C INPUT PARAMETERS
+C rp r16
+C up r17
+C vp r18
+C n r19
+C cy r20 (for mpn_add_nc)
+
+C TODO
+C Finish cleaning up cy registers r22, r23 (make them use cy0/cy1)
+C Use multi-pronged feed-in.
+C Perform additional micro-tuning
+
+C This code was written in cooperation with ev6 pipeline expert Steve Root.
+
+C Pair loads and stores where possible
+C Store pairs oct-aligned where possible (didn't need it here)
+C Stores are delayed every third cycle
+C Loads and stores are delayed by fills
+C U stays still, put code there where possible (note alternation of U1 and U0)
+C L moves because of loads and stores
+C Note dampers in L to limit damage
+
+C This odd-looking optimization expects that were having random bits in our
+C data, so that a pure zero result is unlikely. so we penalize the unlikely
+C case to help the common case.
+
+define(`u0', `r0') define(`u1', `r3')
+define(`v0', `r1') define(`v1', `r4')
+
+define(`cy0', `r20') define(`cy1', `r21')
+
+MULFUNC_PROLOGUE(mpn_add_n mpn_add_nc)
+
+ASM_START()
+PROLOGUE(mpn_add_nc)
+ br r31, $entry
+EPILOGUE()
+PROLOGUE(mpn_add_n)
+ bis r31, r31, cy0 C clear carry in
+$entry: cmpult r19, 5, r22 C L1 move counter
+ ldq u1, 0(r17) C L0 get next ones
+ ldq v1, 0(r18) C L1
+ bne r22, $Lsmall
+
+ ldq u0, 8(r17) C L0 get next ones
+ ldq v0, 8(r18) C L1
+ addq u1, v1, r5 C U0 add two data
+
+ cmpult r5, v1, r23 C U0 did it carry
+ ldq u1, 16(r17) C L0 get next ones
+ ldq v1, 16(r18) C L1
+
+ addq u0, v0, r8 C U1 add two data
+ addq r5, cy0, r5 C U0 carry in
+
+ cmpult r8, v0, r22 C U1 did it carry
+ beq r5, $fix5f C U0 fix exact zero
+$ret5f: ldq u0, 24(r17) C L0 get next ones
+ ldq v0, 24(r18) C L1
+
+ addq r8, r23, r8 C U1 carry from last
+ addq u1, v1, r7 C U0 add two data
+
+ beq r8, $fix6f C U1 fix exact zero
+$ret6f: cmpult r7, v1, r23 C U0 did it carry
+ ldq u1, 32(r17) C L0 get next ones
+ ldq v1, 32(r18) C L1
+
+ lda r17, 40(r17) C L0 move pointer
+ lda r18, 40(r18) C L1 move pointer
+
+ lda r16, -8(r16)
+ lda r19, -13(r19) C L1 move counter
+ blt r19, $Lend C U1 loop control
+
+
+C Main loop. 8-way unrolled.
+ ALIGN(16)
+$Loop: addq u0, v0, r2 C U1 add two data
+ addq r7, r22, r7 C U0 add in carry
+ stq r5, 8(r16) C L0 put an answer
+ stq r8, 16(r16) C L1 pair
+
+ cmpult r2, v0, cy1 C U1 did it carry
+ beq r7, $fix7 C U0 fix exact 0
+$ret7: ldq u0, 0(r17) C L0 get next ones
+ ldq v0, 0(r18) C L1
+
+ bis r31, r31, r31 C L damp out
+ addq r2, r23, r2 C U1 carry from last
+ bis r31, r31, r31 C L moves in L !
+ addq u1, v1, r5 C U0 add two data
+
+ beq r2, $fix0 C U1 fix exact zero
+$ret0: cmpult r5, v1, cy0 C U0 did it carry
+ ldq u1, 8(r17) C L0 get next ones
+ ldq v1, 8(r18) C L1
+
+ addq u0, v0, r8 C U1 add two data
+ addq r5, cy1, r5 C U0 carry from last
+ stq r7, 24(r16) C L0 store pair
+ stq r2, 32(r16) C L1
+
+ cmpult r8, v0, r22 C U1 did it carry
+ beq r5, $fix1 C U0 fix exact zero
+$ret1: ldq u0, 16(r17) C L0 get next ones
+ ldq v0, 16(r18) C L1
+
+ lda r16, 64(r16) C L0 move pointer
+ addq r8, cy0, r8 C U1 carry from last
+ lda r19, -8(r19) C L1 move counter
+ addq u1, v1, r7 C U0 add two data
+
+ beq r8, $fix2 C U1 fix exact zero
+$ret2: cmpult r7, v1, r23 C U0 did it carry
+ ldq u1, 24(r17) C L0 get next ones
+ ldq v1, 24(r18) C L1
+
+ addq u0, v0, r2 C U1 add two data
+ addq r7, r22, r7 C U0 add in carry
+ stq r5, -24(r16) C L0 put an answer
+ stq r8, -16(r16) C L1 pair
+
+ cmpult r2, v0, cy1 C U1 did it carry
+ beq r7, $fix3 C U0 fix exact 0
+$ret3: ldq u0, 32(r17) C L0 get next ones
+ ldq v0, 32(r18) C L1
+
+ bis r31, r31, r31 C L damp out
+ addq r2, r23, r2 C U1 carry from last
+ bis r31, r31, r31 C L moves in L !
+ addq u1, v1, r5 C U0 add two data
+
+ beq r2, $fix4 C U1 fix exact zero
+$ret4: cmpult r5, v1, cy0 C U0 did it carry
+ ldq u1, 40(r17) C L0 get next ones
+ ldq v1, 40(r18) C L1
+
+ addq u0, v0, r8 C U1 add two data
+ addq r5, cy1, r5 C U0 carry from last
+ stq r7, -8(r16) C L0 store pair
+ stq r2, 0(r16) C L1
+
+ cmpult r8, v0, r22 C U1 did it carry
+ beq r5, $fix5 C U0 fix exact zero
+$ret5: ldq u0, 48(r17) C L0 get next ones
+ ldq v0, 48(r18) C L1
+
+ ldl r31, 256(r17) C L0 prefetch
+ addq r8, cy0, r8 C U1 carry from last
+ ldl r31, 256(r18) C L1 prefetch
+ addq u1, v1, r7 C U0 add two data
+
+ beq r8, $fix6 C U1 fix exact zero
+$ret6: cmpult r7, v1, r23 C U0 did it carry
+ ldq u1, 56(r17) C L0 get next ones
+ ldq v1, 56(r18) C L1
+
+ lda r17, 64(r17) C L0 move pointer
+ bis r31, r31, r31 C U
+ lda r18, 64(r18) C L1 move pointer
+ bge r19, $Loop C U1 loop control
+C ==== main loop end
+
+$Lend: addq u0, v0, r2 C U1 add two data
+ addq r7, r22, r7 C U0 add in carry
+ stq r5, 8(r16) C L0 put an answer
+ stq r8, 16(r16) C L1 pair
+ cmpult r2, v0, cy1 C U1 did it carry
+ beq r7, $fix7c C U0 fix exact 0
+$ret7c: addq r2, r23, r2 C U1 carry from last
+ addq u1, v1, r5 C U0 add two data
+ beq r2, $fix0c C U1 fix exact zero
+$ret0c: cmpult r5, v1, cy0 C U0 did it carry
+ addq r5, cy1, r5 C U0 carry from last
+ stq r7, 24(r16) C L0 store pair
+ stq r2, 32(r16) C L1
+ beq r5, $fix1c C U0 fix exact zero
+$ret1c: stq r5, 40(r16) C L0 put an answer
+ lda r16, 48(r16) C L0 move pointer
+
+ lda r19, 8(r19)
+ beq r19, $Lret
+
+ ldq u1, 0(r17)
+ ldq v1, 0(r18)
+$Lsmall:
+ lda r19, -1(r19)
+ beq r19, $Lend0
+
+ ALIGN(8)
+$Loop0: addq u1, v1, r2 C main add
+ cmpult r2, v1, r8 C compute cy from last add
+ ldq u1, 8(r17)
+ ldq v1, 8(r18)
+ addq r2, cy0, r5 C carry add
+ lda r17, 8(r17)
+ lda r18, 8(r18)
+ stq r5, 0(r16)
+ cmpult r5, r2, cy0 C compute cy from last add
+ lda r19, -1(r19) C decr loop cnt
+ bis r8, cy0, cy0 C combine cy from the two adds
+ lda r16, 8(r16)
+ bne r19, $Loop0
+$Lend0: addq u1, v1, r2 C main add
+ addq r2, cy0, r5 C carry add
+ cmpult r2, v1, r8 C compute cy from last add
+ cmpult r5, r2, cy0 C compute cy from last add
+ stq r5, 0(r16)
+ bis r8, cy0, r0 C combine cy from the two adds
+ ret r31,(r26),1
+
+ ALIGN(8)
+$Lret: lda r0, 0(cy0) C copy carry into return register
+ ret r31,(r26),1
+
+$fix5f: bis r23, cy0, r23 C bring forward carry
+ br r31, $ret5f
+$fix6f: bis r22, r23, r22 C bring forward carry
+ br r31, $ret6f
+$fix0: bis cy1, r23, cy1 C bring forward carry
+ br r31, $ret0
+$fix1: bis cy0, cy1, cy0 C bring forward carry
+ br r31, $ret1
+$fix2: bis r22, cy0, r22 C bring forward carry
+ br r31, $ret2
+$fix3: bis r23, r22, r23 C bring forward carry
+ br r31, $ret3
+$fix4: bis cy1, r23, cy1 C bring forward carry
+ br r31, $ret4
+$fix5: bis cy1, cy0, cy0 C bring forward carry
+ br r31, $ret5
+$fix6: bis r22, cy0, r22 C bring forward carry
+ br r31, $ret6
+$fix7: bis r23, r22, r23 C bring forward carry
+ br r31, $ret7
+$fix0c: bis cy1, r23, cy1 C bring forward carry
+ br r31, $ret0c
+$fix1c: bis cy0, cy1, cy0 C bring forward carry
+ br r31, $ret1c
+$fix7c: bis r23, r22, r23 C bring forward carry
+ br r31, $ret7c
+
+EPILOGUE()
+ASM_END()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/ev6/aorslsh1_n.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/ev6/aorslsh1_n.asm
new file mode 100644
index 00000000000..cb966ce0213
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/ev6/aorslsh1_n.asm
@@ -0,0 +1,172 @@
+dnl Alpha mpn_addlsh1_n/mpn_sublsh1_n -- rp[] = up[] +- (vp[] << 1).
+
+dnl Copyright 2003, 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/limb
+C EV4: ?
+C EV5: 7
+C EV6: 4
+
+C TODO
+C * Tune to reach 3.75 c/l on ev6.
+
+define(`rp',`r16')
+define(`up',`r17')
+define(`vp',`r18')
+define(`n', `r19')
+
+define(`u0', `r8')
+define(`u1', `r1')
+define(`v0', `r4')
+define(`v1', `r5')
+
+define(`cy0', `r0')
+define(`cy1', `r20')
+define(`cy', `r22')
+define(`rr', `r24')
+define(`ps', `r25')
+define(`sl', `r28')
+
+ifdef(`OPERATION_addlsh1_n',`
+ define(ADDSUB, addq)
+ define(CARRY, `cmpult $1,$2,$3')
+ define(func, mpn_addlsh1_n)
+')
+ifdef(`OPERATION_sublsh1_n',`
+ define(ADDSUB, subq)
+ define(CARRY, `cmpult $2,$1,$3')
+ define(func, mpn_sublsh1_n)
+')
+
+MULFUNC_PROLOGUE(mpn_addlsh1_n mpn_sublsh1_n)
+
+ASM_START()
+PROLOGUE(func)
+ and n, 2, cy0
+ blbs n, L(bx1)
+L(bx0): ldq v1, 0(vp)
+ ldq u1, 0(up)
+ lda r2, 0(r31)
+ bne cy0, L(b10)
+
+L(b00): lda vp, 48(vp)
+ lda up, -16(up)
+ lda rp, -8(rp)
+ lda cy0, 0(r31)
+ br r31, L(lo0)
+
+L(b10): lda vp, 32(vp)
+ lda rp, 8(rp)
+ lda cy0, 0(r31)
+ br r31, L(lo2)
+
+L(bx1): ldq v0, 0(vp)
+ ldq u0, 0(up)
+ lda r3, 0(r31)
+ beq cy0, L(b01)
+
+L(b11): lda vp, 40(vp)
+ lda up, -24(up)
+ lda rp, 16(rp)
+ lda cy1, 0(r31)
+ br r31, L(lo3)
+
+L(b01): lda n, -4(n)
+ lda cy1, 0(r31)
+ ble n, L(end)
+ lda vp, 24(vp)
+ lda up, -8(up)
+
+ ALIGN(16)
+L(top): addq v0, v0, r6
+ ldq v1, -16(vp)
+ addq r6, r3, sl C combined vlimb
+ ldq u1, 16(up)
+ ADDSUB u0, sl, ps C ulimb + (vlimb << 1)
+ cmplt v0, r31, r2 C high v bits
+ ADDSUB ps, cy1, rr C consume carry from previous operation
+ CARRY( ps, u0, cy0) C carry out #2
+ stq rr, 0(rp)
+ CARRY( rr, ps, cy) C carry out #3
+ lda vp, 32(vp) C bookkeeping
+ addq cy, cy0, cy0 C final carry out
+L(lo0): addq v1, v1, r7
+ ldq v0, -40(vp)
+ addq r7, r2, sl
+ ldq u0, 24(up)
+ ADDSUB u1, sl, ps
+ cmplt v1, r31, r3
+ ADDSUB ps, cy0, rr
+ CARRY( ps, u1, cy1)
+ stq rr, 8(rp)
+ CARRY( rr, ps, cy)
+ lda rp, 32(rp) C bookkeeping
+ addq cy, cy1, cy1
+L(lo3): addq v0, v0, r6
+ ldq v1, -32(vp)
+ addq r6, r3, sl
+ ldq u1, 32(up)
+ ADDSUB u0, sl, ps
+ cmplt v0, r31, r2
+ ADDSUB ps, cy1, rr
+ CARRY( ps, u0, cy0)
+ stq rr, -16(rp)
+ CARRY( rr, ps, cy)
+ lda up, 32(up) C bookkeeping
+ addq cy, cy0, cy0
+L(lo2): addq v1, v1, r7
+ ldq v0, -24(vp)
+ addq r7, r2, sl
+ ldq u0, 8(up)
+ ADDSUB u1, sl, ps
+ cmplt v1, r31, r3
+ ADDSUB ps, cy0, rr
+ CARRY( ps, u1, cy1)
+ stq rr, -8(rp)
+ CARRY( rr, ps, cy)
+ lda n, -4(n) C bookkeeping
+ addq cy, cy1, cy1
+ bgt n, L(top)
+
+L(end): addq v0, v0, r6
+ addq r6, r3, sl
+ ADDSUB u0, sl, ps
+ cmplt v0, r31, r2
+ ADDSUB ps, cy1, rr
+ CARRY( ps, u0, cy0)
+ stq rr, 0(rp)
+ CARRY( rr, ps, cy)
+ addq cy, cy0, cy0
+ addq cy0, r2, r0
+
+ ret r31,(r26),1
+EPILOGUE()
+ASM_END()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/ev6/aorsmul_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/ev6/aorsmul_1.asm
new file mode 100644
index 00000000000..0e68e6e7adb
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/ev6/aorsmul_1.asm
@@ -0,0 +1,398 @@
+dnl Alpha ev6 mpn_addmul_1 and mpn_submul_1.
+
+dnl Copyright 2000, 2003-2005, 2008 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 EV4: 42
+C EV5: 18
+C EV6: 3.5
+
+C INPUT PARAMETERS
+define(`rp', `r16')
+define(`up', `r17')
+define(`n', `r18')
+define(`v0', `r19')
+
+dnl This code was written in cooperation with ev6 pipeline expert Steve Root.
+
+dnl The stores can issue a cycle late so we have paired no-op's to 'catch'
+dnl them, so that further disturbance to the schedule is damped.
+
+dnl We couldn't pair the loads, because the entangled schedule of the carry's
+dnl has to happen on one side {0} of the machine.
+
+dnl This is a great schedule for the d_cache, a poor schedule for the b_cache.
+dnl The lockup on U0 means that any stall can't be recovered from. Consider a
+dnl ldq in L1, say that load gets stalled because it collides with a fill from
+dnl the b_cache. On the next cycle, this load gets priority. If first looks
+dnl at L0, and goes there. The instruction we intended for L0 gets to look at
+dnl L1, which is NOT where we want it. It either stalls 1, because it can't
+dnl go in L0, or goes there, and causes a further instruction to stall.
+
+dnl So for b_cache, we're likely going to want to put one or more cycles back
+dnl into the code! And, of course, put in lds prefetch for the rp[] operand.
+dnl At a place where we have an mt followed by a bookkeeping, put the
+dnl bookkeeping in upper, and the prefetch into lower.
+
+dnl Note, the ldq's and stq's are at the end of the quadpacks. Note, we'd
+dnl like not to have an ldq or an stq to preceded a conditional branch in a
+dnl quadpack. The conditional branch moves the retire pointer one cycle
+dnl later.
+
+ifdef(`OPERATION_addmul_1',`
+ define(`ADDSUB', `addq')
+ define(`CMPCY', `cmpult $2,$1')
+ define(`func', `mpn_addmul_1')
+')
+ifdef(`OPERATION_submul_1',`
+ define(`ADDSUB', `subq')
+ define(`CMPCY', `cmpult $1,$2')
+ define(`func', `mpn_submul_1')
+')
+
+MULFUNC_PROLOGUE(mpn_addmul_1 mpn_submul_1)
+
+ASM_START()
+PROLOGUE(func)
+ ldq r3, 0(up) C
+ and r18, 7, r20 C
+ lda r18, -9(r18) C
+ cmpeq r20, 1, r21 C
+ beq r21, $L1 C
+
+$1mod8: ldq r5, 0(rp) C
+ mulq v0, r3, r7 C
+ umulh v0, r3, r8 C
+ ADDSUB r5, r7, r23 C
+ CMPCY( r5, r23), r20 C
+ addq r8, r20, r0 C
+ stq r23, 0(rp) C
+ bge r18, $ent1 C
+ ret r31, (r26), 1 C
+
+$L1: lda r8, 0(r31) C zero carry reg
+ lda r24, 0(r31) C zero carry reg
+ cmpeq r20, 2, r21 C
+ bne r21, $2mod8 C
+ cmpeq r20, 3, r21 C
+ bne r21, $3mod8 C
+ cmpeq r20, 4, r21 C
+ bne r21, $4mod8 C
+ cmpeq r20, 5, r21 C
+ bne r21, $5mod8 C
+ cmpeq r20, 6, r21 C
+ bne r21, $6mod8 C
+ cmpeq r20, 7, r21 C
+ beq r21, $0mod8 C
+
+$7mod8: ldq r5, 0(rp) C
+ lda up, 8(up) C
+ mulq v0, r3, r7 C
+ umulh v0, r3, r24 C
+ ADDSUB r5, r7, r23 C
+ CMPCY( r5, r23), r20 C
+ addq r24, r20, r24 C
+ stq r23, 0(rp) C
+ lda rp, 8(rp) C
+ ldq r3, 0(up) C
+$6mod8: ldq r1, 8(up) C
+ mulq v0, r3, r25 C
+ umulh v0, r3, r3 C
+ mulq v0, r1, r28 C
+ ldq r0, 16(up) C
+ ldq r4, 0(rp) C
+ umulh v0, r1, r8 C
+ ldq r1, 24(up) C
+ lda up, 48(up) C L1 bookkeeping
+ mulq v0, r0, r2 C
+ ldq r5, 8(rp) C
+ lda rp, -32(rp) C L1 bookkeeping
+ umulh v0, r0, r6 C
+ ADDSUB r4, r25, r25 C lo + acc
+ mulq v0, r1, r7 C
+ br r31, $ent6 C
+
+$ent1: lda up, 8(up) C
+ lda rp, 8(rp) C
+ lda r8, 0(r0) C
+ ldq r3, 0(up) C
+$0mod8: ldq r1, 8(up) C
+ mulq v0, r3, r2 C
+ umulh v0, r3, r6 C
+ mulq v0, r1, r7 C
+ ldq r0, 16(up) C
+ ldq r4, 0(rp) C
+ umulh v0, r1, r24 C
+ ldq r1, 24(up) C
+ mulq v0, r0, r25 C
+ ldq r5, 8(rp) C
+ umulh v0, r0, r3 C
+ ADDSUB r4, r2, r2 C lo + acc
+ mulq v0, r1, r28 C
+ lda rp, -16(rp) C
+ br r31, $ent0 C
+
+$3mod8: ldq r5, 0(rp) C
+ lda up, 8(up) C
+ mulq v0, r3, r7 C
+ umulh v0, r3, r8 C
+ ADDSUB r5, r7, r23 C
+ CMPCY( r5, r23), r20 C
+ addq r8, r20, r24 C
+ stq r23, 0(rp) C
+ lda rp, 8(rp) C
+ ldq r3, 0(up) C
+$2mod8: ldq r1, 8(up) C
+ mulq v0, r3, r25 C
+ umulh v0, r3, r3 C
+ mulq v0, r1, r28 C
+ ble r18, $n23 C
+ ldq r0, 16(up) C
+ ldq r4, 0(rp) C
+ umulh v0, r1, r8 C
+ ldq r1, 24(up) C
+ lda up, 16(up) C L1 bookkeeping
+ mulq v0, r0, r2 C
+ ldq r5, 8(rp) C
+ lda rp, 0(rp) C L1 bookkeeping
+ umulh v0, r0, r6 C
+ ADDSUB r4, r25, r25 C lo + acc
+ mulq v0, r1, r7 C
+ br r31, $ent2 C
+
+$5mod8: ldq r5, 0(rp) C
+ lda up, 8(up) C
+ mulq v0, r3, r7 C
+ umulh v0, r3, r24 C
+ ADDSUB r5, r7, r23 C
+ CMPCY( r5, r23), r20 C
+ addq r24, r20, r8 C
+ stq r23, 0(rp) C
+ lda rp, 8(rp) C
+ ldq r3, 0(up) C
+$4mod8: ldq r1, 8(up) C
+ mulq v0, r3, r2 C
+ umulh v0, r3, r6 C
+ mulq v0, r1, r7 C
+ ldq r0, 16(up) C
+ ldq r4, 0(rp) C
+ umulh v0, r1, r24 C
+ ldq r1, 24(up) C
+ lda up, 32(up) C L1 bookkeeping
+ mulq v0, r0, r25 C
+ ldq r5, 8(rp) C
+ lda rp, 16(rp) C L1 bookkeeping
+ umulh v0, r0, r3 C
+ ADDSUB r4, r2, r2 C lo + acc
+ mulq v0, r1, r28 C
+ CMPCY( r4, r2), r20 C L0 lo add => carry
+ ADDSUB r2, r8, r22 C U0 hi add => answer
+ ble r18, $Lend C
+ ALIGN(16)
+$Loop:
+ bis r31, r31, r31 C U1 mt
+ CMPCY( r2, r22), r21 C L0 hi add => carry
+ addq r6, r20, r6 C U0 hi mul + carry
+ ldq r0, 0(up) C
+
+ bis r31, r31, r31 C U1 mt
+ ADDSUB r5, r7, r7 C L0 lo + acc
+ addq r6, r21, r6 C U0 hi mul + carry
+ ldq r4, 0(rp) C L1
+
+ umulh v0, r1, r8 C U1
+ CMPCY( r5, r7), r20 C L0 lo add => carry
+ ADDSUB r7, r6, r23 C U0 hi add => answer
+ ldq r1, 8(up) C L1
+
+ mulq v0, r0, r2 C U1
+ CMPCY( r7, r23), r21 C L0 hi add => carry
+ addq r24, r20, r24 C U0 hi mul + carry
+ ldq r5, 8(rp) C L1
+
+ umulh v0, r0, r6 C U1
+ ADDSUB r4, r25, r25 C U0 lo + acc
+ stq r22, -16(rp) C L0
+ stq r23, -8(rp) C L1
+
+ bis r31, r31, r31 C L0 st slosh
+ mulq v0, r1, r7 C U1
+ bis r31, r31, r31 C L1 st slosh
+ addq r24, r21, r24 C U0 hi mul + carry
+$ent2:
+ CMPCY( r4, r25), r20 C L0 lo add => carry
+ bis r31, r31, r31 C U1 mt
+ lda r18, -8(r18) C L1 bookkeeping
+ ADDSUB r25, r24, r22 C U0 hi add => answer
+
+ bis r31, r31, r31 C U1 mt
+ CMPCY( r25, r22), r21 C L0 hi add => carry
+ addq r3, r20, r3 C U0 hi mul + carry
+ ldq r0, 16(up) C L1
+
+ bis r31, r31, r31 C U1 mt
+ ADDSUB r5, r28, r28 C L0 lo + acc
+ addq r3, r21, r3 C U0 hi mul + carry
+ ldq r4, 16(rp) C L1
+
+ umulh v0, r1, r24 C U1
+ CMPCY( r5, r28), r20 C L0 lo add => carry
+ ADDSUB r28, r3, r23 C U0 hi add => answer
+ ldq r1, 24(up) C L1
+
+ mulq v0, r0, r25 C U1
+ CMPCY( r28, r23), r21 C L0 hi add => carry
+ addq r8, r20, r8 C U0 hi mul + carry
+ ldq r5, 24(rp) C L1
+
+ umulh v0, r0, r3 C U1
+ ADDSUB r4, r2, r2 C U0 lo + acc
+ stq r22, 0(rp) C L0
+ stq r23, 8(rp) C L1
+
+ bis r31, r31, r31 C L0 st slosh
+ mulq v0, r1, r28 C U1
+ bis r31, r31, r31 C L1 st slosh
+ addq r8, r21, r8 C U0 hi mul + carry
+$ent0:
+ CMPCY( r4, r2), r20 C L0 lo add => carry
+ bis r31, r31, r31 C U1 mt
+ lda up, 64(up) C L1 bookkeeping
+ ADDSUB r2, r8, r22 C U0 hi add => answer
+
+ bis r31, r31, r31 C U1 mt
+ CMPCY( r2, r22), r21 C L0 hi add => carry
+ addq r6, r20, r6 C U0 hi mul + carry
+ ldq r0, -32(up) C L1
+
+ bis r31, r31, r31 C U1 mt
+ ADDSUB r5, r7, r7 C L0 lo + acc
+ addq r6, r21, r6 C U0 hi mul + carry
+ ldq r4, 32(rp) C L1
+
+ umulh v0, r1, r8 C U1
+ CMPCY( r5, r7), r20 C L0 lo add => carry
+ ADDSUB r7, r6, r23 C U0 hi add => answer
+ ldq r1, -24(up) C L1
+
+ mulq v0, r0, r2 C U1
+ CMPCY( r7, r23), r21 C L0 hi add => carry
+ addq r24, r20, r24 C U0 hi mul + carry
+ ldq r5, 40(rp) C L1
+
+ umulh v0, r0, r6 C U1
+ ADDSUB r4, r25, r25 C U0 lo + acc
+ stq r22, 16(rp) C L0
+ stq r23, 24(rp) C L1
+
+ bis r31, r31, r31 C L0 st slosh
+ mulq v0, r1, r7 C U1
+ bis r31, r31, r31 C L1 st slosh
+ addq r24, r21, r24 C U0 hi mul + carry
+$ent6:
+ CMPCY( r4, r25), r20 C L0 lo add => carry
+ bis r31, r31, r31 C U1 mt
+ lda rp, 64(rp) C L1 bookkeeping
+ ADDSUB r25, r24, r22 C U0 hi add => answer
+
+ bis r31, r31, r31 C U1 mt
+ CMPCY( r25, r22), r21 C L0 hi add => carry
+ addq r3, r20, r3 C U0 hi mul + carry
+ ldq r0, -16(up) C L1
+
+ bis r31, r31, r31 C U1 mt
+ ADDSUB r5, r28, r28 C L0 lo + acc
+ addq r3, r21, r3 C U0 hi mul + carry
+ ldq r4, -16(rp) C L1
+
+ umulh v0, r1, r24 C U1
+ CMPCY( r5, r28), r20 C L0 lo add => carry
+ ADDSUB r28, r3, r23 C U0 hi add => answer
+ ldq r1, -8(up) C L1
+
+ mulq v0, r0, r25 C U1
+ CMPCY( r28, r23), r21 C L0 hi add => carry
+ addq r8, r20, r8 C U0 hi mul + carry
+ ldq r5, -8(rp) C L1
+
+ umulh v0, r0, r3 C U1
+ ADDSUB r4, r2, r2 C U0 lo + acc
+ stq r22, -32(rp) C L0
+ stq r23, -24(rp) C L1
+
+ bis r31, r31, r31 C L0 st slosh
+ mulq v0, r1, r28 C U1
+ bis r31, r31, r31 C L1 st slosh
+ addq r8, r21, r8 C U0 hi mul + carry
+
+ CMPCY( r4, r2), r20 C L0 lo add => carry
+ ADDSUB r2, r8, r22 C U0 hi add => answer
+ ldl r31, 256(up) C prefetch up[]
+ bgt r18, $Loop C U1 bookkeeping
+
+$Lend: CMPCY( r2, r22), r21 C
+ addq r6, r20, r6 C
+ ADDSUB r5, r7, r7 C
+ addq r6, r21, r6 C
+ ldq r4, 0(rp) C
+ umulh v0, r1, r8 C
+ CMPCY( r5, r7), r20 C
+ ADDSUB r7, r6, r23 C
+ CMPCY(r7, r23), r21 C
+ addq r24, r20, r24 C
+ ldq r5, 8(rp) C
+ ADDSUB r4, r25, r25 C
+ stq r22, -16(rp) C
+ stq r23, -8(rp) C
+ addq r24, r21, r24 C
+ br L(x)
+
+ ALIGN(16)
+$n23: ldq r4, 0(rp) C
+ ldq r5, 8(rp) C
+ umulh v0, r1, r8 C
+ ADDSUB r4, r25, r25 C
+L(x): CMPCY( r4, r25), r20 C
+ ADDSUB r25, r24, r22 C
+ CMPCY( r25, r22), r21 C
+ addq r3, r20, r3 C
+ ADDSUB r5, r28, r28 C
+ addq r3, r21, r3 C
+ CMPCY( r5, r28), r20 C
+ ADDSUB r28, r3, r23 C
+ CMPCY( r28, r23), r21 C
+ addq r8, r20, r8 C
+ stq r22, 0(rp) C
+ stq r23, 8(rp) C
+ addq r8, r21, r0 C
+ ret r31, (r26), 1 C
+EPILOGUE()
+ASM_END()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/ev6/gmp-mparam.h b/Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/ev6/gmp-mparam.h
new file mode 100644
index 00000000000..e51d6b0d159
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/ev6/gmp-mparam.h
@@ -0,0 +1,209 @@
+/* gmp-mparam.h -- Compiler/machine parameter header file.
+
+Copyright 1991, 1993, 1994, 1999-2002, 2004, 2005, 2008-2010, 2014 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
+
+#define DIVEXACT_BY3_METHOD 0 /* override ../diveby3.asm */
+
+/* 500 MHz 21164 (agnesi.math.su.se) */
+/* FFT tuning limit = 20000000 */
+/* Generated by tuneup.c, 2014-03-14, gcc 3.3 */
+
+#define DIVREM_1_NORM_THRESHOLD 0 /* preinv always */
+#define DIVREM_1_UNNORM_THRESHOLD 0 /* always */
+#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 4
+#define MOD_1U_TO_MOD_1_1_THRESHOLD 2
+#define MOD_1_1_TO_MOD_1_2_THRESHOLD 10
+#define MOD_1_2_TO_MOD_1_4_THRESHOLD 21
+#define PREINV_MOD_1_TO_MOD_1_THRESHOLD 7
+#define USE_PREINV_DIVREM_1 1 /* preinv always */
+#define DIV_QR_1N_PI1_METHOD 2
+#define DIV_QR_1_NORM_THRESHOLD 5
+#define DIV_QR_1_UNNORM_THRESHOLD 1
+#define DIV_QR_2_PI2_THRESHOLD 8
+#define DIVEXACT_1_THRESHOLD 0 /* always */
+#define BMOD_1_TO_MOD_1_THRESHOLD 20
+
+#define MUL_TOOM22_THRESHOLD 32
+#define MUL_TOOM33_THRESHOLD 117
+#define MUL_TOOM44_THRESHOLD 124
+#define MUL_TOOM6H_THRESHOLD 230
+#define MUL_TOOM8H_THRESHOLD 357
+
+#define MUL_TOOM32_TO_TOOM43_THRESHOLD 97
+#define MUL_TOOM32_TO_TOOM53_THRESHOLD 107
+#define MUL_TOOM42_TO_TOOM53_THRESHOLD 88
+#define MUL_TOOM42_TO_TOOM63_THRESHOLD 105
+#define MUL_TOOM43_TO_TOOM54_THRESHOLD 136
+
+#define SQR_BASECASE_THRESHOLD 0 /* always */
+#define SQR_TOOM2_THRESHOLD 59
+#define SQR_TOOM3_THRESHOLD 123
+#define SQR_TOOM4_THRESHOLD 163
+#define SQR_TOOM6_THRESHOLD 333
+#define SQR_TOOM8_THRESHOLD 0 /* always */
+
+#define MULMID_TOOM42_THRESHOLD 52
+
+#define MULMOD_BNM1_THRESHOLD 19
+#define SQRMOD_BNM1_THRESHOLD 5
+
+#define MUL_FFT_MODF_THRESHOLD 468 /* k = 5 */
+#define MUL_FFT_TABLE3 \
+ { { 468, 5}, { 19, 6}, { 10, 5}, { 21, 6}, \
+ { 11, 5}, { 23, 6}, { 19, 7}, { 10, 6}, \
+ { 24, 7}, { 13, 6}, { 27, 7}, { 14, 6}, \
+ { 29, 7}, { 17, 6}, { 35, 7}, { 29, 8}, \
+ { 15, 7}, { 32, 8}, { 17, 7}, { 35, 8}, \
+ { 19, 7}, { 39, 8}, { 29, 9}, { 15, 8}, \
+ { 35, 9}, { 19, 8}, { 41, 9}, { 23, 8}, \
+ { 51, 9}, { 27, 8}, { 55, 9}, { 35, 8}, \
+ { 71, 9}, { 39,10}, { 23, 9}, { 55,10}, \
+ { 31, 9}, { 67,10}, { 39, 9}, { 79,10}, \
+ { 47, 9}, { 95,10}, { 55,11}, { 31,10}, \
+ { 79,11}, { 47,10}, { 103,12}, { 31,11}, \
+ { 63,10}, { 135,11}, { 79,10}, { 167,11}, \
+ { 95,10}, { 199,11}, { 111,12}, { 63,11}, \
+ { 143,10}, { 287, 9}, { 575,11}, { 159,10}, \
+ { 319,12}, { 95,11}, { 191,10}, { 383,11}, \
+ { 207,13}, { 63,12}, { 127,11}, { 255,10}, \
+ { 511,11}, { 271,10}, { 543,11}, { 287,10}, \
+ { 575,12}, { 159,11}, { 319,10}, { 639,11}, \
+ { 335,10}, { 671,11}, { 351,10}, { 703,12}, \
+ { 191,11}, { 383,10}, { 767,11}, { 415,12}, \
+ { 223,11}, { 447,13}, { 127,12}, { 255,11}, \
+ { 543,12}, { 287,11}, { 575,10}, { 1151,11}, \
+ { 607,12}, { 319,11}, { 671,12}, { 351,11}, \
+ { 703,13}, { 191,12}, { 383,11}, { 767,12}, \
+ { 415,11}, { 831,12}, { 447,14}, { 127,13}, \
+ { 255,12}, { 575,11}, { 1151,12}, { 607,13}, \
+ { 319,12}, { 735,13}, { 383,12}, { 767,11}, \
+ { 1535,12}, { 831,13}, { 447,12}, { 959,14}, \
+ { 255,13}, { 511,12}, { 1087,13}, { 575,12}, \
+ { 1215,13}, { 639,12}, { 1343,13}, { 703,12}, \
+ { 1407,14}, { 383,13}, { 767,12}, { 1535,13}, \
+ { 831,12}, { 1663,13}, { 959,15}, { 255,14}, \
+ { 511,13}, { 1215,14}, { 639,13}, { 1407,14}, \
+ { 767,13}, { 1663,14}, { 895,13}, { 1855,15}, \
+ { 511,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 151
+#define MUL_FFT_THRESHOLD 5760
+
+#define SQR_FFT_MODF_THRESHOLD 412 /* k = 5 */
+#define SQR_FFT_TABLE3 \
+ { { 412, 5}, { 19, 6}, { 10, 5}, { 21, 6}, \
+ { 11, 5}, { 23, 6}, { 12, 5}, { 25, 6}, \
+ { 27, 7}, { 14, 6}, { 29, 7}, { 28, 8}, \
+ { 15, 7}, { 31, 8}, { 17, 7}, { 36, 8}, \
+ { 19, 7}, { 39, 8}, { 29, 9}, { 15, 8}, \
+ { 35, 9}, { 19, 8}, { 41, 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}, \
+ { 95,10}, { 55,11}, { 31,10}, { 79,11}, \
+ { 47,10}, { 95,12}, { 31,11}, { 63,10}, \
+ { 127, 9}, { 255,11}, { 79,10}, { 159, 9}, \
+ { 319,10}, { 167,11}, { 95,10}, { 191, 9}, \
+ { 383,11}, { 111,12}, { 63,11}, { 127,10}, \
+ { 271,11}, { 143,10}, { 287, 9}, { 575,10}, \
+ { 303,11}, { 159,10}, { 319,12}, { 95,11}, \
+ { 191,10}, { 383,11}, { 207,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,12}, \
+ { 191,11}, { 383,10}, { 767,11}, { 415,12}, \
+ { 223,11}, { 447,13}, { 127,12}, { 255,11}, \
+ { 543,12}, { 287,11}, { 575,10}, { 1151,11}, \
+ { 607,12}, { 319,11}, { 639,10}, { 1279,11}, \
+ { 671,12}, { 351,11}, { 703,13}, { 191,12}, \
+ { 383,11}, { 767,12}, { 415,11}, { 831,12}, \
+ { 447,11}, { 895,12}, { 479,14}, { 127,13}, \
+ { 255,12}, { 575,11}, { 1151,12}, { 607,13}, \
+ { 319,12}, { 703,11}, { 1407,12}, { 735,13}, \
+ { 383,12}, { 831,13}, { 447,12}, { 959,14}, \
+ { 255,13}, { 511,12}, { 1087,13}, { 575,12}, \
+ { 1151,13}, { 639,12}, { 1279,13}, { 703,12}, \
+ { 1407,14}, { 383,13}, { 767,12}, { 1535,13}, \
+ { 831,12}, { 1663,13}, { 959,15}, { 255,14}, \
+ { 511,13}, { 1215,14}, { 639,13}, { 1407,14}, \
+ { 767,13}, { 1663,14}, { 895,13}, { 1791,15}, \
+ { 511,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 159
+#define SQR_FFT_THRESHOLD 5056
+
+#define MULLO_BASECASE_THRESHOLD 0 /* always */
+#define MULLO_DC_THRESHOLD 100
+#define MULLO_MUL_N_THRESHOLD 11355
+
+#define DC_DIV_QR_THRESHOLD 124
+#define DC_DIVAPPR_Q_THRESHOLD 438
+#define DC_BDIV_QR_THRESHOLD 153
+#define DC_BDIV_Q_THRESHOLD 318
+
+#define INV_MULMOD_BNM1_THRESHOLD 62
+#define INV_NEWTON_THRESHOLD 384
+#define INV_APPR_THRESHOLD 402
+
+#define BINV_NEWTON_THRESHOLD 381
+#define REDC_1_TO_REDC_N_THRESHOLD 110
+
+#define MU_DIV_QR_THRESHOLD 1752
+#define MU_DIVAPPR_Q_THRESHOLD 1895
+#define MUPI_DIV_QR_THRESHOLD 174
+#define MU_BDIV_QR_THRESHOLD 1387
+#define MU_BDIV_Q_THRESHOLD 1787
+
+#define POWM_SEC_TABLE 1,13,66,82,579
+
+#define MATRIX22_STRASSEN_THRESHOLD 15
+#define HGCD_THRESHOLD 318
+#define HGCD_APPR_THRESHOLD 363
+#define HGCD_REDUCE_THRESHOLD 2384
+#define GCD_DC_THRESHOLD 2504
+#define GCDEXT_DC_THRESHOLD 671
+#define JACOBI_BASE_METHOD 3
+
+#define GET_STR_DC_THRESHOLD 14
+#define GET_STR_PRECOMPUTE_THRESHOLD 25
+#define SET_STR_DC_THRESHOLD 3754
+#define SET_STR_PRECOMPUTE_THRESHOLD 8097
+
+#define FAC_DSC_THRESHOLD 951
+#define FAC_ODD_THRESHOLD 24
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/ev6/mod_1_4.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/ev6/mod_1_4.asm
new file mode 100644
index 00000000000..836de07c0fc
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/ev6/mod_1_4.asm
@@ -0,0 +1,337 @@
+dnl Alpha mpn_mod_1s_4p
+
+dnl Contributed to the GNU project by Torbjorn Granlund.
+
+dnl Copyright 2009, 2010 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 TODO:
+C * Optimise. 2.75 c/l should be possible.
+C * Write a proper mpn_mod_1s_4p_cps. The code below was compiler generated.
+C * Optimise feed-in code, starting the sw pipeline in switch code.
+C * Shorten software pipeline. The mul instructions are scheduled too far
+C from their users. Fixing this will allow us to use fewer registers.
+C * If we cannot reduce register usage, write perhaps small-n basecase.
+C * Does this work for PIC?
+
+C cycles/limb
+C EV4: ?
+C EV5: 23
+C EV6: 3
+
+define(`ap', `r16')
+define(`n', `r17')
+define(`pl', `r24')
+define(`ph', `r25')
+define(`rl', `r6')
+define(`rh', `r7')
+define(`B1modb', `r1')
+define(`B2modb', `r2')
+define(`B3modb', `r3')
+define(`B4modb', `r4')
+define(`B5modb', `r5')
+
+ASM_START()
+PROLOGUE(mpn_mod_1s_4p)
+ lda r30, -64(r30)
+ stq r9, 8(r30)
+ ldq B1modb, 16(r19)
+ stq r10, 16(r30)
+ ldq B2modb, 24(r19)
+ stq r11, 24(r30)
+ ldq B3modb, 32(r19)
+ stq r12, 32(r30)
+ ldq B4modb, 40(r19)
+ stq r13, 40(r30)
+ ldq B5modb, 48(r19)
+ s8addq n, ap, ap C point ap at vector end
+
+ and n, 3, r0
+ lda n, -4(n)
+ beq r0, L(b0)
+ lda r6, -2(r0)
+ blt r6, L(b1)
+ beq r6, L(b2)
+
+L(b3): ldq r21, -16(ap)
+ ldq r22, -8(ap)
+ ldq r20, -24(ap)
+ mulq r21, B1modb, r8
+ umulh r21, B1modb, r12
+ mulq r22, B2modb, r9
+ umulh r22, B2modb, r13
+ addq r8, r20, pl
+ cmpult pl, r8, r0
+ addq r0, r12, ph
+ addq r9, pl, rl
+ cmpult rl, r9, r0
+ addq r13, ph, ph
+ addq r0, ph, rh
+ lda ap, -56(ap)
+ br L(com)
+
+L(b0): ldq r21, -24(ap)
+ ldq r22, -16(ap)
+ ldq r23, -8(ap)
+ ldq r20, -32(ap)
+ mulq r21, B1modb, r8
+ umulh r21, B1modb, r12
+ mulq r22, B2modb, r9
+ umulh r22, B2modb, r13
+ mulq r23, B3modb, r10
+ umulh r23, B3modb, r27
+ addq r8, r20, pl
+ cmpult pl, r8, r0
+ addq r0, r12, ph
+ addq r9, pl, pl
+ cmpult pl, r9, r0
+ addq r13, ph, ph
+ addq r0, ph, ph
+ addq r10, pl, rl
+ cmpult rl, r10, r0
+ addq r27, ph, ph
+ addq r0, ph, rh
+ lda ap, -64(ap)
+ br L(com)
+
+L(b1): bis r31, r31, rh
+ ldq rl, -8(ap)
+ lda ap, -40(ap)
+ br L(com)
+
+L(b2): ldq rh, -8(ap)
+ ldq rl, -16(ap)
+ lda ap, -48(ap)
+
+L(com): ble n, L(ed3)
+ ldq r21, 8(ap)
+ ldq r22, 16(ap)
+ ldq r23, 24(ap)
+ ldq r20, 0(ap)
+ lda n, -4(n)
+ lda ap, -32(ap)
+ mulq r21, B1modb, r8
+ umulh r21, B1modb, r12
+ mulq r22, B2modb, r9
+ umulh r22, B2modb, r13
+ mulq r23, B3modb, r10
+ umulh r23, B3modb, r27
+ mulq rl, B4modb, r11
+ umulh rl, B4modb, r28
+ ble n, L(ed2)
+
+ ALIGN(16)
+L(top): ldq r21, 8(ap)
+ mulq rh, B5modb, rl
+ addq r8, r20, pl
+ ldq r22, 16(ap)
+ cmpult pl, r8, r0
+ umulh rh, B5modb, rh
+ ldq r23, 24(ap)
+ addq r0, r12, ph
+ addq r9, pl, pl
+ mulq r21, B1modb, r8
+ cmpult pl, r9, r0
+ addq r13, ph, ph
+ umulh r21, B1modb, r12
+ lda ap, -32(ap)
+ addq r0, ph, ph
+ addq r10, pl, pl
+ mulq r22, B2modb, r9
+ cmpult pl, r10, r0
+ addq r27, ph, ph
+ addq r11, pl, pl
+ umulh r22, B2modb, r13
+ addq r0, ph, ph
+ cmpult pl, r11, r0
+ addq r28, ph, ph
+ mulq r23, B3modb, r10
+ ldq r20, 32(ap)
+ addq pl, rl, rl
+ umulh r23, B3modb, r27
+ addq r0, ph, ph
+ cmpult rl, pl, r0
+ mulq rl, B4modb, r11
+ addq ph, rh, rh
+ umulh rl, B4modb, r28
+ addq r0, rh, rh
+ lda n, -4(n)
+ bgt n, L(top)
+
+L(ed2): mulq rh, B5modb, rl
+ addq r8, r20, pl
+ umulh rh, B5modb, rh
+ cmpult pl, r8, r0
+ addq r0, r12, ph
+ addq r9, pl, pl
+ cmpult pl, r9, r0
+ addq r13, ph, ph
+ addq r0, ph, ph
+ addq r10, pl, pl
+ cmpult pl, r10, r0
+ addq r27, ph, ph
+ addq r11, pl, pl
+ addq r0, ph, ph
+ cmpult pl, r11, r0
+ addq r28, ph, ph
+ addq pl, rl, rl
+ addq r0, ph, ph
+ cmpult rl, pl, r0
+ addq ph, rh, rh
+ addq r0, rh, rh
+
+L(ed3): mulq rh, B1modb, r8
+ umulh rh, B1modb, rh
+ addq r8, rl, rl
+ cmpult rl, r8, r0
+ addq r0, rh, rh
+
+ ldq r24, 8(r19) C cnt
+ sll rh, r24, rh
+ subq r31, r24, r25
+ srl rl, r25, r2
+ sll rl, r24, rl
+ or r2, rh, rh
+
+ ldq r23, 0(r19) C bi
+ mulq rh, r23, r8
+ umulh rh, r23, r9
+ addq rh, 1, r7
+ addq r8, rl, r8 C ql
+ cmpult r8, rl, r0
+ addq r9, r7, r9
+ addq r0, r9, r9 C qh
+ mulq r9, r18, r21 C qh * b
+ subq rl, r21, rl
+ cmpult r8, rl, r0 C rl > ql
+ negq r0, r0
+ and r0, r18, r0
+ addq rl, r0, rl
+ cmpule r18, rl, r0 C rl >= b
+ negq r0, r0
+ and r0, r18, r0
+ subq rl, r0, rl
+
+ srl rl, r24, r0
+
+ ldq r9, 8(r30)
+ ldq r10, 16(r30)
+ ldq r11, 24(r30)
+ ldq r12, 32(r30)
+ ldq r13, 40(r30)
+ lda r30, 64(r30)
+ ret r31, (r26), 1
+EPILOGUE()
+
+PROLOGUE(mpn_mod_1s_4p_cps,gp)
+ lda r30, -32(r30)
+ stq r26, 0(r30)
+ stq r9, 8(r30)
+ stq r10, 16(r30)
+ stq r11, 24(r30)
+ mov r16, r11
+ LEA( r4, __clz_tab)
+ lda r10, 65(r31)
+ cmpbge r31, r17, r1
+ srl r1, 1, r1
+ xor r1, 127, r1
+ addq r1, r4, r1
+ ldq_u r2, 0(r1)
+ extbl r2, r1, r2
+ s8subq r2, 7, r2
+ srl r17, r2, r3
+ subq r10, r2, r10
+ addq r3, r4, r3
+ ldq_u r1, 0(r3)
+ extbl r1, r3, r1
+ subq r10, r1, r10
+ sll r17, r10, r9
+ mov r9, r16
+ jsr r26, mpn_invert_limb
+ ldah r29, 0(r26)
+ subq r31, r10, r2
+ lda r1, 1(r31)
+ sll r1, r10, r1
+ subq r31, r9, r3
+ srl r0, r2, r2
+ ldq r26, 0(r30)
+ bis r2, r1, r2
+ lda r29, 0(r29)
+ stq r0, 0(r11)
+ stq r10, 8(r11)
+ mulq r2, r3, r2
+ srl r2, r10, r3
+ umulh r2, r0, r1
+ stq r3, 16(r11)
+ mulq r2, r0, r3
+ ornot r31, r1, r1
+ subq r1, r2, r1
+ mulq r1, r9, r1
+ addq r1, r9, r2
+ cmpule r1, r3, r3
+ cmoveq r3, r2, r1
+ srl r1, r10, r3
+ umulh r1, r0, r2
+ stq r3, 24(r11)
+ mulq r1, r0, r3
+ ornot r31, r2, r2
+ subq r2, r1, r2
+ mulq r2, r9, r2
+ addq r2, r9, r1
+ cmpule r2, r3, r3
+ cmoveq r3, r1, r2
+ srl r2, r10, r1
+ umulh r2, r0, r3
+ stq r1, 32(r11)
+ mulq r2, r0, r1
+ ornot r31, r3, r3
+ subq r3, r2, r3
+ mulq r3, r9, r3
+ addq r3, r9, r2
+ cmpule r3, r1, r1
+ cmoveq r1, r2, r3
+ srl r3, r10, r2
+ umulh r3, r0, r1
+ stq r2, 40(r11)
+ mulq r3, r0, r0
+ ornot r31, r1, r1
+ subq r1, r3, r1
+ mulq r1, r9, r1
+ addq r1, r9, r9
+ cmpule r1, r0, r0
+ cmoveq r0, r9, r1
+ ldq r9, 8(r30)
+ srl r1, r10, r1
+ ldq r10, 16(r30)
+ stq r1, 48(r11)
+ ldq r11, 24(r30)
+ lda r30, 32(r30)
+ ret r31, (r26), 1
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/ev6/mul_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/ev6/mul_1.asm
new file mode 100644
index 00000000000..8ee19cd429d
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/ev6/mul_1.asm
@@ -0,0 +1,496 @@
+dnl Alpha ev6 mpn_mul_1 -- Multiply a limb vector with a limb and store the
+dnl result in a second limb vector.
+
+dnl Copyright 2000, 2001, 2005 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 r16
+C s1_ptr r17
+C size r18
+C s2_limb r19
+
+C This code runs at 2.25 cycles/limb on EV6.
+
+C This code was written in close cooperation with ev6 pipeline expert
+C Steve Root. Any errors are tege's fault, though.
+
+C Code structure:
+
+C code for n < 8
+C code for n > 8 code for (n mod 8)
+C code for (n div 8) feed-in code
+C 8-way unrolled loop
+C wind-down code
+
+C Some notes about unrolled loop:
+C
+C r1-r8 multiplies and workup
+C r21-r28 multiplies and workup
+C r9-r12 loads
+C r0 -1
+C r20,r29,r13-r15 scramble
+C
+C We're doing 7 of the 8 carry propagations with a br fixup code and 1 with a
+C put-the-carry-into-hi. The idea is that these branches are very rarely
+C taken, and since a non-taken branch consumes no resources, that is better
+C than an addq.
+C
+C Software pipeline: a load in cycle #09, feeds a mul in cycle #16, feeds an
+C add NEXT cycle #09 which feeds a store in NEXT cycle #02
+
+C The code could use some further work:
+C 1. Speed up really small multiplies. The default alpha/mul_1.asm code is
+C faster than this for size < 3.
+C 2. Improve feed-in code, perhaps with the equivalent of switch(n%8) unless
+C that is too costly.
+C 3. Consider using 4-way unrolling, even if that runs slower.
+C 4. Reduce register usage. In particular, try to avoid using r29.
+
+ASM_START()
+PROLOGUE(mpn_mul_1)
+ cmpult r18, 8, r1
+ beq r1, $Large
+$Lsmall:
+ ldq r2,0(r17) C r2 = s1_limb
+ lda r18,-1(r18) C size--
+ mulq r2,r19,r3 C r3 = prod_low
+ bic r31,r31,r4 C clear cy_limb
+ umulh r2,r19,r0 C r0 = prod_high
+ beq r18,$Le1a C jump if size was == 1
+ ldq r2,8(r17) C r2 = s1_limb
+ lda r18,-1(r18) C size--
+ stq r3,0(r16)
+ beq r18,$Le2a C jump if size was == 2
+ ALIGN(8)
+$Lopa: mulq r2,r19,r3 C r3 = prod_low
+ addq r4,r0,r0 C cy_limb = cy_limb + 'cy'
+ lda r18,-1(r18) C size--
+ umulh r2,r19,r4 C r4 = cy_limb
+ ldq r2,16(r17) C r2 = s1_limb
+ lda r17,8(r17) C s1_ptr++
+ addq r3,r0,r3 C r3 = cy_limb + prod_low
+ stq r3,8(r16)
+ cmpult r3,r0,r0 C r0 = carry from (cy_limb + prod_low)
+ lda r16,8(r16) C res_ptr++
+ bne r18,$Lopa
+
+$Le2a: mulq r2,r19,r3 C r3 = prod_low
+ addq r4,r0,r0 C cy_limb = cy_limb + 'cy'
+ umulh r2,r19,r4 C r4 = cy_limb
+ addq r3,r0,r3 C r3 = cy_limb + prod_low
+ cmpult r3,r0,r0 C r0 = carry from (cy_limb + prod_low)
+ stq r3,8(r16)
+ addq r4,r0,r0 C cy_limb = prod_high + cy
+ ret r31,(r26),1
+$Le1a: stq r3,0(r16)
+ ret r31,(r26),1
+
+$Large:
+ lda r30, -224(r30)
+ stq r26, 0(r30)
+ stq r9, 8(r30)
+ stq r10, 16(r30)
+ stq r11, 24(r30)
+ stq r12, 32(r30)
+ stq r13, 40(r30)
+ stq r14, 48(r30)
+ stq r15, 56(r30)
+ stq r29, 64(r30)
+
+ and r18, 7, r20 C count for the first loop, 0-7
+ srl r18, 3, r18 C count for unrolled loop
+ bis r31, r31, r21
+ beq r20, $L_8_or_more C skip first loop
+
+$L_9_or_more:
+ ldq r2,0(r17) C r2 = s1_limb
+ lda r17,8(r17) C s1_ptr++
+ lda r20,-1(r20) C size--
+ mulq r2,r19,r3 C r3 = prod_low
+ umulh r2,r19,r21 C r21 = prod_high
+ beq r20,$Le1b C jump if size was == 1
+ bis r31, r31, r0 C FIXME: shouldn't need this
+ ldq r2,0(r17) C r2 = s1_limb
+ lda r17,8(r17) C s1_ptr++
+ lda r20,-1(r20) C size--
+ stq r3,0(r16)
+ lda r16,8(r16) C res_ptr++
+ beq r20,$Le2b C jump if size was == 2
+ ALIGN(8)
+$Lopb: mulq r2,r19,r3 C r3 = prod_low
+ addq r21,r0,r0 C cy_limb = cy_limb + 'cy'
+ lda r20,-1(r20) C size--
+ umulh r2,r19,r21 C r21 = prod_high
+ ldq r2,0(r17) C r2 = s1_limb
+ lda r17,8(r17) C s1_ptr++
+ addq r3,r0,r3 C r3 = cy_limb + prod_low
+ stq r3,0(r16)
+ cmpult r3,r0,r0 C r0 = carry from (cy_limb + prod_low)
+ lda r16,8(r16) C res_ptr++
+ bne r20,$Lopb
+
+$Le2b: mulq r2,r19,r3 C r3 = prod_low
+ addq r21,r0,r0 C cy_limb = cy_limb + 'cy'
+ umulh r2,r19,r21 C r21 = prod_high
+ addq r3,r0,r3 C r3 = cy_limb + prod_low
+ cmpult r3,r0,r0 C r0 = carry from (cy_limb + prod_low)
+ stq r3,0(r16)
+ lda r16,8(r16) C res_ptr++
+ addq r21,r0,r21 C cy_limb = prod_high + cy
+ br r31, $L_8_or_more
+$Le1b: stq r3,0(r16)
+ lda r16,8(r16) C res_ptr++
+
+$L_8_or_more:
+ lda r0, -1(r31) C put -1 in r0, for tricky loop control
+ lda r17, -32(r17) C L1 bookkeeping
+ lda r18, -1(r18) C decrement count
+
+ ldq r9, 32(r17) C L1
+ ldq r10, 40(r17) C L1
+ mulq r9, r19, r22 C U1 #07
+ ldq r11, 48(r17) C L1
+ umulh r9, r19, r23 C U1 #08
+ ldq r12, 56(r17) C L1
+ mulq r10, r19, r24 C U1 #09
+ ldq r9, 64(r17) C L1
+
+ lda r17, 64(r17) C L1 bookkeeping
+
+ umulh r10, r19, r25 C U1 #11
+ mulq r11, r19, r26 C U1 #12
+ umulh r11, r19, r27 C U1 #13
+ mulq r12, r19, r28 C U1 #14
+ ldq r10, 8(r17) C L1
+ umulh r12, r19, r1 C U1 #15
+ ldq r11, 16(r17) C L1
+ mulq r9, r19, r2 C U1 #16
+ ldq r12, 24(r17) C L1
+ umulh r9, r19, r3 C U1 #17
+ addq r21, r22, r13 C L1 mov
+ mulq r10, r19, r4 C U1 #18
+ addq r23, r24, r22 C L0 sum 2 mul's
+ cmpult r13, r21, r14 C L1 carry from sum
+ bgt r18, $L_16_or_more
+
+ cmpult r22, r24, r24 C U0 carry from sum
+ umulh r10, r19, r5 C U1 #02
+ addq r25, r26, r23 C U0 sum 2 mul's
+ mulq r11, r19, r6 C U1 #03
+ cmpult r23, r26, r25 C U0 carry from sum
+ umulh r11, r19, r7 C U1 #04
+ addq r27, r28, r28 C U0 sum 2 mul's
+ mulq r12, r19, r8 C U1 #05
+ cmpult r28, r27, r15 C L0 carry from sum
+ lda r16, 32(r16) C L1 bookkeeping
+ addq r13, r31, r13 C U0 start carry cascade
+ umulh r12, r19, r21 C U1 #06
+ br r31, $ret0c
+
+$L_16_or_more:
+C ---------------------------------------------------------------
+ subq r18,1,r18
+ cmpult r22, r24, r24 C U0 carry from sum
+ ldq r9, 32(r17) C L1
+
+ umulh r10, r19, r5 C U1 #02
+ addq r25, r26, r23 C U0 sum 2 mul's
+ mulq r11, r19, r6 C U1 #03
+ cmpult r23, r26, r25 C U0 carry from sum
+ umulh r11, r19, r7 C U1 #04
+ addq r27, r28, r28 C U0 sum 2 mul's
+ mulq r12, r19, r8 C U1 #05
+ cmpult r28, r27, r15 C L0 carry from sum
+ lda r16, 32(r16) C L1 bookkeeping
+ addq r13, r31, r13 C U0 start carry cascade
+
+ umulh r12, r19, r21 C U1 #06
+C beq r13, $fix0w C U0
+$ret0w: addq r22, r14, r26 C L0
+ ldq r10, 40(r17) C L1
+
+ mulq r9, r19, r22 C U1 #07
+ beq r26, $fix1w C U0
+$ret1w: addq r23, r24, r27 C L0
+ ldq r11, 48(r17) C L1
+
+ umulh r9, r19, r23 C U1 #08
+ beq r27, $fix2w C U0
+$ret2w: addq r28, r25, r28 C L0
+ ldq r12, 56(r17) C L1
+
+ mulq r10, r19, r24 C U1 #09
+ beq r28, $fix3w C U0
+$ret3w: addq r1, r2, r20 C L0 sum 2 mul's
+ ldq r9, 64(r17) C L1
+
+ addq r3, r4, r2 C L0 #10 2 mul's
+ lda r17, 64(r17) C L1 bookkeeping
+ cmpult r20, r1, r29 C U0 carry from sum
+
+ umulh r10, r19, r25 C U1 #11
+ cmpult r2, r4, r4 C U0 carry from sum
+ stq r13, -32(r16) C L0
+ stq r26, -24(r16) C L1
+
+ mulq r11, r19, r26 C U1 #12
+ addq r5, r6, r14 C U0 sum 2 mul's
+ stq r27, -16(r16) C L0
+ stq r28, -8(r16) C L1
+
+ umulh r11, r19, r27 C U1 #13
+ cmpult r14, r6, r3 C U0 carry from sum
+C could do cross-jumping here:
+C bra $L_middle_of_unrolled_loop
+ mulq r12, r19, r28 C U1 #14
+ addq r7, r3, r5 C L0 eat carry
+ addq r20, r15, r20 C U0 carry cascade
+ ldq r10, 8(r17) C L1
+
+ umulh r12, r19, r1 C U1 #15
+ beq r20, $fix4 C U0
+$ret4w: addq r2, r29, r6 C L0
+ ldq r11, 16(r17) C L1
+
+ mulq r9, r19, r2 C U1 #16
+ beq r6, $fix5 C U0
+$ret5w: addq r14, r4, r7 C L0
+ ldq r12, 24(r17) C L1
+
+ umulh r9, r19, r3 C U1 #17
+ beq r7, $fix6 C U0
+$ret6w: addq r5, r8, r8 C L0 sum 2
+ addq r21, r22, r13 C L1 sum 2 mul's
+
+ mulq r10, r19, r4 C U1 #18
+ addq r23, r24, r22 C L0 sum 2 mul's
+ cmpult r13, r21, r14 C L1 carry from sum
+ ble r18, $Lend C U0
+C ---------------------------------------------------------------
+ ALIGN(16)
+$Loop:
+ umulh r0, r18, r18 C U1 #01 decrement r18!
+ cmpult r8, r5, r29 C L0 carry from last bunch
+ cmpult r22, r24, r24 C U0 carry from sum
+ ldq r9, 32(r17) C L1
+
+ umulh r10, r19, r5 C U1 #02
+ addq r25, r26, r23 C U0 sum 2 mul's
+ stq r20, 0(r16) C L0
+ stq r6, 8(r16) C L1
+
+ mulq r11, r19, r6 C U1 #03
+ cmpult r23, r26, r25 C U0 carry from sum
+ stq r7, 16(r16) C L0
+ stq r8, 24(r16) C L1
+
+ umulh r11, r19, r7 C U1 #04
+ bis r31, r31, r31 C L0 st slosh
+ bis r31, r31, r31 C L1 st slosh
+ addq r27, r28, r28 C U0 sum 2 mul's
+
+ mulq r12, r19, r8 C U1 #05
+ cmpult r28, r27, r15 C L0 carry from sum
+ lda r16, 64(r16) C L1 bookkeeping
+ addq r13, r29, r13 C U0 start carry cascade
+
+ umulh r12, r19, r21 C U1 #06
+ beq r13, $fix0 C U0
+$ret0: addq r22, r14, r26 C L0
+ ldq r10, 40(r17) C L1
+
+ mulq r9, r19, r22 C U1 #07
+ beq r26, $fix1 C U0
+$ret1: addq r23, r24, r27 C L0
+ ldq r11, 48(r17) C L1
+
+ umulh r9, r19, r23 C U1 #08
+ beq r27, $fix2 C U0
+$ret2: addq r28, r25, r28 C L0
+ ldq r12, 56(r17) C L1
+
+ mulq r10, r19, r24 C U1 #09
+ beq r28, $fix3 C U0
+$ret3: addq r1, r2, r20 C L0 sum 2 mul's
+ ldq r9, 64(r17) C L1
+
+ addq r3, r4, r2 C L0 #10 2 mul's
+ bis r31, r31, r31 C U1 mul hole
+ lda r17, 64(r17) C L1 bookkeeping
+ cmpult r20, r1, r29 C U0 carry from sum
+
+ umulh r10, r19, r25 C U1 #11
+ cmpult r2, r4, r4 C U0 carry from sum
+ stq r13, -32(r16) C L0
+ stq r26, -24(r16) C L1
+
+ mulq r11, r19, r26 C U1 #12
+ addq r5, r6, r14 C U0 sum 2 mul's
+ stq r27, -16(r16) C L0
+ stq r28, -8(r16) C L1
+
+ umulh r11, r19, r27 C U1 #13
+ bis r31, r31, r31 C L0 st slosh
+ bis r31, r31, r31 C L1 st slosh
+ cmpult r14, r6, r3 C U0 carry from sum
+$L_middle_of_unrolled_loop:
+ mulq r12, r19, r28 C U1 #14
+ addq r7, r3, r5 C L0 eat carry
+ addq r20, r15, r20 C U0 carry cascade
+ ldq r10, 8(r17) C L1
+
+ umulh r12, r19, r1 C U1 #15
+ beq r20, $fix4 C U0
+$ret4: addq r2, r29, r6 C L0
+ ldq r11, 16(r17) C L1
+
+ mulq r9, r19, r2 C U1 #16
+ beq r6, $fix5 C U0
+$ret5: addq r14, r4, r7 C L0
+ ldq r12, 24(r17) C L1
+
+ umulh r9, r19, r3 C U1 #17
+ beq r7, $fix6 C U0
+$ret6: addq r5, r8, r8 C L0 sum 2
+ addq r21, r22, r13 C L1 sum 2 mul's
+
+ mulq r10, r19, r4 C U1 #18
+ addq r23, r24, r22 C L0 sum 2 mul's
+ cmpult r13, r21, r14 C L1 carry from sum
+ bgt r18, $Loop C U0
+C ---------------------------------------------------------------
+$Lend:
+ cmpult r8, r5, r29 C L0 carry from last bunch
+ cmpult r22, r24, r24 C U0 carry from sum
+
+ umulh r10, r19, r5 C U1 #02
+ addq r25, r26, r23 C U0 sum 2 mul's
+ stq r20, 0(r16) C L0
+ stq r6, 8(r16) C L1
+
+ mulq r11, r19, r6 C U1 #03
+ cmpult r23, r26, r25 C U0 carry from sum
+ stq r7, 16(r16) C L0
+ stq r8, 24(r16) C L1
+
+ umulh r11, r19, r7 C U1 #04
+ addq r27, r28, r28 C U0 sum 2 mul's
+
+ mulq r12, r19, r8 C U1 #05
+ cmpult r28, r27, r15 C L0 carry from sum
+ lda r16, 64(r16) C L1 bookkeeping
+ addq r13, r29, r13 C U0 start carry cascade
+
+ umulh r12, r19, r21 C U1 #06
+ beq r13, $fix0c C U0
+$ret0c: addq r22, r14, r26 C L0
+ beq r26, $fix1c C U0
+$ret1c: addq r23, r24, r27 C L0
+ beq r27, $fix2c C U0
+$ret2c: addq r28, r25, r28 C L0
+ beq r28, $fix3c C U0
+$ret3c: addq r1, r2, r20 C L0 sum 2 mul's
+ addq r3, r4, r2 C L0 #10 2 mul's
+ lda r17, 64(r17) C L1 bookkeeping
+ cmpult r20, r1, r29 C U0 carry from sum
+ cmpult r2, r4, r4 C U0 carry from sum
+ stq r13, -32(r16) C L0
+ stq r26, -24(r16) C L1
+ addq r5, r6, r14 C U0 sum 2 mul's
+ stq r27, -16(r16) C L0
+ stq r28, -8(r16) C L1
+ cmpult r14, r6, r3 C U0 carry from sum
+ addq r7, r3, r5 C L0 eat carry
+ addq r20, r15, r20 C U0 carry cascade
+ beq r20, $fix4c C U0
+$ret4c: addq r2, r29, r6 C L0
+ beq r6, $fix5c C U0
+$ret5c: addq r14, r4, r7 C L0
+ beq r7, $fix6c C U0
+$ret6c: addq r5, r8, r8 C L0 sum 2
+ cmpult r8, r5, r29 C L0 carry from last bunch
+ stq r20, 0(r16) C L0
+ stq r6, 8(r16) C L1
+ stq r7, 16(r16) C L0
+ stq r8, 24(r16) C L1
+ addq r29, r21, r0
+
+ ldq r26, 0(r30)
+ ldq r9, 8(r30)
+ ldq r10, 16(r30)
+ ldq r11, 24(r30)
+ ldq r12, 32(r30)
+ ldq r13, 40(r30)
+ ldq r14, 48(r30)
+ ldq r15, 56(r30)
+ ldq r29, 64(r30)
+ lda r30, 224(r30)
+ ret r31, (r26), 1
+
+C $fix0w: bis r14, r29, r14 C join carries
+C br r31, $ret0w
+$fix1w: bis r24, r14, r24 C join carries
+ br r31, $ret1w
+$fix2w: bis r25, r24, r25 C join carries
+ br r31, $ret2w
+$fix3w: bis r15, r25, r15 C join carries
+ br r31, $ret3w
+$fix0: bis r14, r29, r14 C join carries
+ br r31, $ret0
+$fix1: bis r24, r14, r24 C join carries
+ br r31, $ret1
+$fix2: bis r25, r24, r25 C join carries
+ br r31, $ret2
+$fix3: bis r15, r25, r15 C join carries
+ br r31, $ret3
+$fix4: bis r29, r15, r29 C join carries
+ br r31, $ret4
+$fix5: bis r4, r29, r4 C join carries
+ br r31, $ret5
+$fix6: addq r5, r4, r5 C can't carry twice!
+ br r31, $ret6
+$fix0c: bis r14, r29, r14 C join carries
+ br r31, $ret0c
+$fix1c: bis r24, r14, r24 C join carries
+ br r31, $ret1c
+$fix2c: bis r25, r24, r25 C join carries
+ br r31, $ret2c
+$fix3c: bis r15, r25, r15 C join carries
+ br r31, $ret3c
+$fix4c: bis r29, r15, r29 C join carries
+ br r31, $ret4c
+$fix5c: bis r4, r29, r4 C join carries
+ br r31, $ret5c
+$fix6c: addq r5, r4, r5 C can't carry twice!
+ br r31, $ret6c
+
+EPILOGUE(mpn_mul_1)
+ASM_END()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/ev6/nails/README b/Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/ev6/nails/README
new file mode 100644
index 00000000000..b214ac50adb
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/ev6/nails/README
@@ -0,0 +1,65 @@
+Copyright 2002, 2005 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/.
+
+
+
+
+
+This directory contains assembly code for nails-enabled 21264. The code is not
+very well optimized.
+
+For addmul_N, as N grows larger, we could make multiple loads together, then do
+about 3.3 i/c. 10 cycles after the last load, we can increase to 4 i/c. This
+would surely allow addmul_4 to run at 2 c/l, but the same should be possible
+also for addmul_3 and perhaps even addmul_2.
+
+
+ current fair best
+Routine c/l unroll c/l unroll c/l i/c
+mul_1 3.25 2.75 2.75 3.273
+addmul_1 4.0 4 3.5 4 14 3.25 3.385
+addmul_2 4.0 1 2.5 2 10 2.25 3.333
+addmul_3 3.0 1 2.33 2 14 2 3.333
+addmul_4 2.5 1 2.125 2 17 2 3.135
+
+addmul_5 2 1 10
+addmul_6 2 1 12
+addmul_7 2 1 14
+
+(The "best" column doesn't account for bookkeeping instructions and
+thereby assumes infinite unrolling.)
+
+Basecase usages:
+
+1 addmul_1
+2 addmul_2
+3 addmul_3
+4 addmul_4
+5 addmul_3 + addmul_2 2.3998
+6 addmul_4 + addmul_2
+7 addmul_4 + addmul_3
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/ev6/nails/addmul_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/ev6/nails/addmul_1.asm
new file mode 100644
index 00000000000..711d4e66e5a
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/ev6/nails/addmul_1.asm
@@ -0,0 +1,396 @@
+dnl Alpha ev6 nails mpn_addmul_1.
+
+dnl Copyright 2002, 2005, 2006 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 EV4: 42
+C EV5: 18
+C EV6: 4
+
+C TODO
+C * Reroll loop for 3.75 c/l with current 4-way unrolling.
+C * The loop is overscheduled wrt loads and wrt multiplies, in particular
+C umulh.
+C * Use FP loop count and multiple exit points, that would simplify feed-in lp0
+C and would work since the loop structure is really regular.
+
+C INPUT PARAMETERS
+define(`rp',`r16')
+define(`up',`r17')
+define(`n', `r18')
+define(`vl0',`r19')
+
+define(`numb_mask',`r6')
+
+define(`m0a',`r0')
+define(`m0b',`r1')
+define(`m1a',`r2')
+define(`m1b',`r3')
+define(`m2a',`r20')
+define(`m2b',`r21')
+define(`m3a',`r22')
+define(`m3b',`r23')
+
+define(`acc0',`r25')
+define(`acc1',`r27')
+
+define(`ul0',`r4')
+define(`ul1',`r5')
+define(`ul2',`r4')
+define(`ul3',`r5')
+
+define(`rl0',`r24')
+define(`rl1',`r24')
+define(`rl2',`r24')
+define(`rl3',`r24')
+
+define(`t0',`r7')
+define(`t1',`r8')
+
+define(`NAIL_BITS',`GMP_NAIL_BITS')
+define(`NUMB_BITS',`GMP_NUMB_BITS')
+
+dnl This declaration is munged by configure
+NAILS_SUPPORT(2-63)
+
+ASM_START()
+PROLOGUE(mpn_addmul_1)
+ sll vl0, NAIL_BITS, vl0
+ lda numb_mask, -1(r31)
+ srl numb_mask, NAIL_BITS, numb_mask
+
+ and n, 3, r25
+ cmpeq r25, 1, r21
+ bne r21, L(1m4)
+ cmpeq r25, 2, r21
+ bne r21, L(2m4)
+ beq r25, L(0m4)
+
+L(3m4): ldq ul3, 0(up)
+ lda n, -4(n)
+ ldq ul0, 8(up)
+ mulq vl0, ul3, m3a
+ umulh vl0, ul3, m3b
+ ldq ul1, 16(up)
+ lda up, 24(up)
+ lda rp, -8(rp)
+ mulq vl0, ul0, m0a
+ umulh vl0, ul0, m0b
+ bge n, L(ge3)
+
+ mulq vl0, ul1, m1a
+ umulh vl0, ul1, m1b
+ ldq rl3, 8(rp)
+ srl m3a,NAIL_BITS, t0
+ addq t0, r31, acc1
+ addq rl3, acc1, acc1
+ ldq rl0, 16(rp)
+ srl m0a,NAIL_BITS, t0
+ addq t0, m3b, acc0
+ srl acc1,NUMB_BITS, t1
+ br r31, L(ta3)
+
+L(ge3): ldq ul2, 0(up)
+ mulq vl0, ul1, m1a
+ umulh vl0, ul1, m1b
+ ldq rl3, 8(rp)
+ srl m3a,NAIL_BITS, t0
+ ldq ul3, 8(up)
+ lda n, -4(n)
+ mulq vl0, ul2, m2a
+ addq t0, r31, acc1
+ umulh vl0, ul2, m2b
+ addq rl3, acc1, acc1
+ ldq rl0, 16(rp)
+ srl m0a,NAIL_BITS, t0
+ ldq ul0, 16(up)
+ mulq vl0, ul3, m3a
+ addq t0, m3b, acc0
+ srl acc1,NUMB_BITS, t1
+ br r31, L(el3)
+
+L(0m4): lda n, -8(n)
+ ldq ul2, 0(up)
+ ldq ul3, 8(up)
+ mulq vl0, ul2, m2a
+ umulh vl0, ul2, m2b
+ ldq ul0, 16(up)
+ mulq vl0, ul3, m3a
+ umulh vl0, ul3, m3b
+ ldq ul1, 24(up)
+ lda up, 32(up)
+ mulq vl0, ul0, m0a
+ umulh vl0, ul0, m0b
+ bge n, L(ge4)
+
+ ldq rl2, 0(rp)
+ srl m2a,NAIL_BITS, t0
+ mulq vl0, ul1, m1a
+ addq t0, r31, acc0
+ umulh vl0, ul1, m1b
+ addq rl2, acc0, acc0
+ ldq rl3, 8(rp)
+ srl m3a,NAIL_BITS, t0
+ addq t0, m2b, acc1
+ srl acc0,NUMB_BITS, t1
+ br r31, L(ta4)
+
+L(ge4): ldq rl2, 0(rp)
+ srl m2a,NAIL_BITS, t0
+ ldq ul2, 0(up)
+ mulq vl0, ul1, m1a
+ addq t0, r31, acc0
+ umulh vl0, ul1, m1b
+ addq rl2, acc0, acc0
+ ldq rl3, 8(rp)
+ srl m3a,NAIL_BITS, t0
+ ldq ul3, 8(up)
+ lda n, -4(n)
+ mulq vl0, ul2, m2a
+ addq t0, m2b, acc1
+ srl acc0,NUMB_BITS, t1
+ br r31, L(el0)
+
+L(2m4): lda n, -4(n)
+ ldq ul0, 0(up)
+ ldq ul1, 8(up)
+ lda up, 16(up)
+ lda rp, -16(rp)
+ mulq vl0, ul0, m0a
+ umulh vl0, ul0, m0b
+ bge n, L(ge2)
+
+ mulq vl0, ul1, m1a
+ umulh vl0, ul1, m1b
+ ldq rl0, 16(rp)
+ srl m0a,NAIL_BITS, t0
+ addq t0, r31, acc0
+ addq rl0, acc0, acc0
+ ldq rl1, 24(rp)
+ srl m1a,NAIL_BITS, t0
+ addq t0, m0b, acc1
+ srl acc0,NUMB_BITS, t1
+ br r31, L(ta2)
+
+L(ge2): ldq ul2, 0(up)
+ mulq vl0, ul1, m1a
+ umulh vl0, ul1, m1b
+ ldq ul3, 8(up)
+ lda n, -4(n)
+ mulq vl0, ul2, m2a
+ umulh vl0, ul2, m2b
+ ldq rl0, 16(rp)
+ srl m0a,NAIL_BITS, t0
+ ldq ul0, 16(up)
+ mulq vl0, ul3, m3a
+ addq t0, r31, acc0
+ umulh vl0, ul3, m3b
+ addq rl0, acc0, acc0
+ ldq rl1, 24(rp)
+ srl m1a,NAIL_BITS, t0
+ ldq ul1, 24(up)
+ lda up, 32(up)
+ lda rp, 32(rp)
+ mulq vl0, ul0, m0a
+ addq t0, m0b, acc1
+ srl acc0,NUMB_BITS, t1
+ bge n, L(el2)
+
+ br r31, L(ta6)
+
+L(1m4): lda n, -4(n)
+ ldq ul1, 0(up)
+ lda up, 8(up)
+ lda rp, -24(rp)
+ bge n, L(ge1)
+
+ mulq vl0, ul1, m1a
+ umulh vl0, ul1, m1b
+ ldq rl1, 24(rp)
+ srl m1a,NAIL_BITS, t0
+ addq rl1, t0, acc1
+ and acc1,numb_mask, r28
+ srl acc1,NUMB_BITS, t1
+ stq r28, 24(rp)
+ addq t1, m1b, r0
+ ret r31, (r26), 1
+
+L(ge1): ldq ul2, 0(up)
+ mulq vl0, ul1, m1a
+ umulh vl0, ul1, m1b
+ ldq ul3, 8(up)
+ lda n, -4(n)
+ mulq vl0, ul2, m2a
+ umulh vl0, ul2, m2b
+ ldq ul0, 16(up)
+ mulq vl0, ul3, m3a
+ umulh vl0, ul3, m3b
+ ldq rl1, 24(rp)
+ srl m1a,NAIL_BITS, t0
+ ldq ul1, 24(up)
+ lda up, 32(up)
+ lda rp, 32(rp)
+ mulq vl0, ul0, m0a
+ addq t0, r31, acc1
+ umulh vl0, ul0, m0b
+ addq rl1, acc1, acc1
+ ldq rl2, 0(rp)
+ srl m2a,NAIL_BITS, t0
+ mulq vl0, ul1, m1a
+ addq t0, m1b, acc0
+ srl acc1,NUMB_BITS, t1
+ blt n, L(ta5)
+
+L(ge5): ldq ul2, 0(up)
+ br r31, L(el1)
+
+ ALIGN(16)
+L(top): mulq vl0, ul0, m0a C U1
+ addq t0, m0b, acc1 C L0
+ srl acc0,NUMB_BITS, t1 C U0
+ stq r28, -24(rp) C L1
+C
+L(el2): umulh vl0, ul0, m0b C U1
+ and acc0,numb_mask, r28 C L0
+ addq rl1, acc1, acc1 C U0
+ ldq rl2, 0(rp) C L1
+C
+ unop C U1
+ addq t1, acc1, acc1 C L0
+ srl m2a,NAIL_BITS, t0 C U0
+ ldq ul2, 0(up) C L1
+C
+ mulq vl0, ul1, m1a C U1
+ addq t0, m1b, acc0 C L0
+ srl acc1,NUMB_BITS, t1 C U0
+ stq r28, -16(rp) C L1
+C
+L(el1): umulh vl0, ul1, m1b C U1
+ and acc1,numb_mask, r28 C L0
+ addq rl2, acc0, acc0 C U0
+ ldq rl3, 8(rp) C L1
+C
+ lda n, -4(n) C L1
+ addq t1, acc0, acc0 C L0
+ srl m3a,NAIL_BITS, t0 C U0
+ ldq ul3, 8(up) C L1
+C
+ mulq vl0, ul2, m2a C U1
+ addq t0, m2b, acc1 C L0
+ srl acc0,NUMB_BITS, t1 C U0
+ stq r28, -8(rp) C L1
+C
+L(el0): umulh vl0, ul2, m2b C U1
+ and acc0,numb_mask, r28 C L0
+ addq rl3, acc1, acc1 C U0
+ ldq rl0, 16(rp) C L1
+C
+ unop C U1
+ addq t1, acc1, acc1 C L0
+ srl m0a,NAIL_BITS, t0 C U0
+ ldq ul0, 16(up) C L1
+C
+ mulq vl0, ul3, m3a C U1
+ addq t0, m3b, acc0 C L0
+ srl acc1,NUMB_BITS, t1 C U0
+ stq r28, 0(rp) C L1
+C
+L(el3): umulh vl0, ul3, m3b C U1
+ and acc1,numb_mask, r28 C L0
+ addq rl0, acc0, acc0 C U0
+ ldq rl1, 24(rp) C L1
+C
+ unop C U1
+ addq t1, acc0, acc0 C L0
+ srl m1a,NAIL_BITS, t0 C U0
+ ldq ul1, 24(up) C L1
+C
+ lda up, 32(up) C L0
+ unop C U1
+ lda rp, 32(rp) C L1
+ bge n, L(top) C U0
+
+L(end): mulq vl0, ul0, m0a
+ addq t0, m0b, acc1
+ srl acc0,NUMB_BITS, t1
+ stq r28, -24(rp)
+L(ta6): umulh vl0, ul0, m0b
+ and acc0,numb_mask, r28
+ addq rl1, acc1, acc1
+ ldq rl2, 0(rp)
+ addq t1, acc1, acc1
+ srl m2a,NAIL_BITS, t0
+ mulq vl0, ul1, m1a
+ addq t0, m1b, acc0
+ srl acc1,NUMB_BITS, t1
+ stq r28, -16(rp)
+L(ta5): umulh vl0, ul1, m1b
+ and acc1,numb_mask, r28
+ addq rl2, acc0, acc0
+ ldq rl3, 8(rp)
+ addq t1, acc0, acc0
+ srl m3a,NAIL_BITS, t0
+ addq t0, m2b, acc1
+ srl acc0,NUMB_BITS, t1
+ stq r28, -8(rp)
+ unop
+ ALIGN(16)
+L(ta4): and acc0,numb_mask, r28
+ addq rl3, acc1, acc1
+ ldq rl0, 16(rp)
+ addq t1, acc1, acc1
+ srl m0a,NAIL_BITS, t0
+ addq t0, m3b, acc0
+ srl acc1,NUMB_BITS, t1
+ stq r28, 0(rp)
+ unop
+ ALIGN(16)
+L(ta3): and acc1,numb_mask, r28
+ addq rl0, acc0, acc0
+ ldq rl1, 24(rp)
+ addq t1, acc0, acc0
+ srl m1a,NAIL_BITS, t0
+ addq t0, m0b, acc1
+ srl acc0,NUMB_BITS, t1
+ stq r28, 8(rp)
+ unop
+ ALIGN(16)
+L(ta2): and acc0,numb_mask, r28
+ addq rl1, acc1, acc1
+ addq t1, acc1, acc1
+ srl acc1,NUMB_BITS, t1
+ stq r28, 16(rp)
+ and acc1,numb_mask, r28
+ addq t1, m1b, r0
+ stq r28, 24(rp)
+ ret r31, (r26), 1
+EPILOGUE()
+ASM_END()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/ev6/nails/addmul_2.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/ev6/nails/addmul_2.asm
new file mode 100644
index 00000000000..6ff6b3ad6b0
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/ev6/nails/addmul_2.asm
@@ -0,0 +1,146 @@
+dnl Alpha ev6 nails mpn_addmul_2.
+
+dnl Copyright 2002, 2005, 2006 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 Runs at 4.0 cycles/limb.
+
+C We could either go for 2-way unrolling over 11 cycles, or 2.75 c/l,
+C or 4-way unrolling over 20 cycles, for 2.5 c/l.
+
+
+C INPUT PARAMETERS
+define(`rp',`r16')
+define(`up',`r17')
+define(`n',`r18')
+define(`vp',`r19')
+
+C Useful register aliases
+define(`numb_mask',`r24')
+define(`ulimb',`r25')
+define(`rlimb',`r27')
+
+define(`m0a',`r0')
+define(`m0b',`r1')
+define(`m1a',`r2')
+define(`m1b',`r3')
+
+define(`acc0',`r4')
+define(`acc1',`r5')
+
+define(`v0',`r6')
+define(`v1',`r7')
+
+C Used for temps: r8 r19 r28
+
+define(`NAIL_BITS',`GMP_NAIL_BITS')
+define(`NUMB_BITS',`GMP_NUMB_BITS')
+
+C This declaration is munged by configure
+NAILS_SUPPORT(3-63)
+
+ASM_START()
+PROLOGUE(mpn_addmul_2)
+ lda numb_mask,-1(r31)
+ srl numb_mask,NAIL_BITS,numb_mask
+
+ ldq v0, 0(vp)
+ ldq v1, 8(vp)
+
+ bis r31, r31, acc0 C zero acc0
+ sll v0,NAIL_BITS, v0
+ bis r31, r31, acc1 C zero acc1
+ sll v1,NAIL_BITS, v1
+ bis r31, r31, r19
+
+ ldq ulimb, 0(up)
+ lda up, 8(up)
+ mulq v0, ulimb, m0a C U1
+ umulh v0, ulimb, m0b C U1
+ mulq v1, ulimb, m1a C U1
+ umulh v1, ulimb, m1b C U1
+ lda n, -1(n)
+ beq n, L(end) C U0
+
+ ALIGN(16)
+L(top): bis r31, r31, r31 C U1 nop
+ addq r19, acc0, acc0 C U0 propagate nail
+ ldq rlimb, 0(rp) C L0
+ ldq ulimb, 0(up) C L1
+
+ lda rp, 8(rp) C L1
+ srl m0a,NAIL_BITS, r8 C U0
+ lda up, 8(up) C L0
+ mulq v0, ulimb, m0a C U1
+
+ addq r8, acc0, r19 C U0
+ addq m0b, acc1, acc0 C L1
+ umulh v0, ulimb, m0b C U1
+ bis r31, r31, r31 C L0 nop
+
+ addq rlimb, r19, r19 C L1 FINAL PROD-SUM
+ srl m1a,NAIL_BITS, r8 C U0
+ lda n, -1(n) C L0
+ mulq v1, ulimb, m1a C U1
+
+ addq r8, acc0, acc0 C U0
+ bis r31, m1b, acc1 C L1
+ umulh v1, ulimb, m1b C U1
+ and r19,numb_mask, r28 C L0 extract numb part
+
+ unop
+ srl r19,NUMB_BITS, r19 C U1 extract nail part
+ stq r28, -8(rp) C L1
+ bne n, L(top) C U0
+
+L(end): ldq rlimb, 0(rp)
+ addq r19, acc0, acc0 C propagate nail
+ lda rp, 8(rp)
+ srl m0a,NAIL_BITS, r8 C U0
+ addq r8, acc0, r19
+ addq m0b, acc1, acc0
+ addq rlimb, r19, r19
+ srl m1a,NAIL_BITS, r8 C U0
+ addq r8, acc0, acc0
+ bis r31, m1b, acc1
+ and r19,numb_mask, r28 C extract limb
+
+ srl r19,NUMB_BITS, r19 C extract nail
+ stq r28, -8(rp)
+
+ addq r19, acc0, acc0 C propagate nail
+ and acc0,numb_mask, r28
+ stq r28, 0(rp)
+ srl acc0,NUMB_BITS, r19
+ addq r19, acc1, r0
+
+ ret r31, (r26), 1
+EPILOGUE()
+ASM_END()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/ev6/nails/addmul_3.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/ev6/nails/addmul_3.asm
new file mode 100644
index 00000000000..a1ffb680eca
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/ev6/nails/addmul_3.asm
@@ -0,0 +1,169 @@
+dnl Alpha ev6 nails mpn_addmul_3.
+
+dnl Copyright 2002, 2006 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 Runs at 3.0 cycles/limb.
+
+C With 2-way unrolling, we could probably reach 2.25 c/l (3.33 i/c).
+
+
+C INPUT PARAMETERS
+define(`rp',`r16')
+define(`up',`r17')
+define(`n',`r18')
+define(`vp',`r19')
+
+C Useful register aliases
+define(`numb_mask',`r24')
+define(`ulimb',`r25')
+define(`rlimb',`r27')
+
+define(`m0a',`r0')
+define(`m0b',`r1')
+define(`m1a',`r2')
+define(`m1b',`r3')
+define(`m2a',`r20')
+define(`m2b',`r21')
+
+define(`acc0',`r4')
+define(`acc1',`r5')
+define(`acc2',`r22')
+
+define(`v0',`r6')
+define(`v1',`r7')
+define(`v2',`r23')
+
+C Used for temps: r8 r19 r28
+
+define(`NAIL_BITS',`GMP_NAIL_BITS')
+define(`NUMB_BITS',`GMP_NUMB_BITS')
+
+C This declaration is munged by configure
+NAILS_SUPPORT(3-63)
+
+ASM_START()
+PROLOGUE(mpn_addmul_3)
+ lda numb_mask,-1(r31)
+ srl numb_mask,NAIL_BITS,numb_mask
+
+ ldq v0, 0(vp)
+ ldq v1, 8(vp)
+ ldq v2, 16(vp)
+
+ bis r31, r31, acc0 C zero acc0
+ sll v0,NAIL_BITS, v0
+ bis r31, r31, acc1 C zero acc1
+ sll v1,NAIL_BITS, v1
+ bis r31, r31, acc2 C zero acc2
+ sll v2,NAIL_BITS, v2
+ bis r31, r31, r19
+
+ ldq ulimb, 0(up)
+ lda up, 8(up)
+ mulq v0, ulimb, m0a C U1
+ umulh v0, ulimb, m0b C U1
+ mulq v1, ulimb, m1a C U1
+ umulh v1, ulimb, m1b C U1
+ lda n, -1(n)
+ mulq v2, ulimb, m2a C U1
+ umulh v2, ulimb, m2b C U1
+ beq n, L(end) C U0
+
+ ALIGN(16)
+L(top): ldq rlimb, 0(rp) C L1
+ ldq ulimb, 0(up) C L0
+ bis r31, r31, r31 C U0 nop
+ addq r19, acc0, acc0 C U1 propagate nail
+
+ lda rp, 8(rp) C L1
+ srl m0a,NAIL_BITS, r8 C U0
+ lda up, 8(up) C L0
+ mulq v0, ulimb, m0a C U1
+
+ addq r8, acc0, r19 C U0
+ addq m0b, acc1, acc0 C L1
+ umulh v0, ulimb, m0b C U1
+ bis r31, r31, r31 C L0 nop
+
+ addq rlimb, r19, r19 C L1
+ srl m1a,NAIL_BITS, r8 C U0
+ bis r31, r31, r31 C L0 nop
+ mulq v1, ulimb, m1a C U1
+
+ addq r8, acc0, acc0 C U0
+ addq m1b, acc2, acc1 C L1
+ umulh v1, ulimb, m1b C U1
+ and r19,numb_mask, r28 C L0 extract numb part
+
+ bis r31, r31, r31 C L1 nop
+ srl m2a,NAIL_BITS, r8 C U0
+ lda n, -1(n) C L0
+ mulq v2, ulimb, m2a C U1
+
+ addq r8, acc1, acc1 C L0
+ bis r31, m2b, acc2 C L1
+ umulh v2, ulimb, m2b C U1
+ srl r19,NUMB_BITS, r19 C U0 extract nail part
+
+ stq r28, -8(rp) C L
+ bne n, L(top) C U0
+
+L(end): ldq rlimb, 0(rp)
+ addq r19, acc0, acc0 C propagate nail
+ lda rp, 8(rp)
+ srl m0a,NAIL_BITS, r8 C U0
+ addq r8, acc0, r19
+ addq m0b, acc1, acc0
+ addq rlimb, r19, r19
+ srl m1a,NAIL_BITS, r8 C U0
+ addq r8, acc0, acc0
+ addq m1b, acc2, acc1
+ and r19,numb_mask, r28 C extract limb
+ srl m2a,NAIL_BITS, r8 C U0
+ addq r8, acc1, acc1
+ bis r31, m2b, acc2
+ srl r19,NUMB_BITS, r19 C extract nail
+ stq r28, -8(rp)
+
+ addq r19, acc0, acc0 C propagate nail
+ and acc0,numb_mask, r28
+ stq r28, 0(rp)
+ srl acc0,NUMB_BITS, r19
+ addq r19, acc1, acc1
+
+ and acc1,numb_mask, r28
+ stq r28, 8(rp)
+ srl acc1,NUMB_BITS, r19
+ addq r19, acc2, m0a
+
+ ret r31, (r26), 1
+EPILOGUE()
+ASM_END()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/ev6/nails/addmul_4.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/ev6/nails/addmul_4.asm
new file mode 100644
index 00000000000..77e02a4316f
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/ev6/nails/addmul_4.asm
@@ -0,0 +1,210 @@
+dnl Alpha ev6 nails mpn_addmul_4.
+
+dnl Copyright 2002, 2005, 2006 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 Runs at 2.5 cycles/limb.
+
+C We should go for 2-way unrolling over 17 cycles, for 2.125 c/l corresponding
+C to 3.24 insn/cycle.
+
+
+C INPUT PARAMETERS
+define(`rp',`r16')
+define(`up',`r17')
+define(`n',`r18')
+define(`vp',`r19')
+
+C Useful register aliases
+define(`numb_mask',`r24')
+define(`ulimb',`r25')
+define(`rlimb',`r27')
+
+define(`m0a',`r0')
+define(`m0b',`r1')
+define(`m1a',`r2')
+define(`m1b',`r3')
+define(`m2a',`r20')
+define(`m2b',`r21')
+define(`m3a',`r12')
+define(`m3b',`r13')
+
+define(`acc0',`r4')
+define(`acc1',`r5')
+define(`acc2',`r22')
+define(`acc3',`r14')
+
+define(`v0',`r6')
+define(`v1',`r7')
+define(`v2',`r23')
+define(`v3',`r15')
+
+C Used for temps: r8 r19 r28
+
+define(`NAIL_BITS',`GMP_NAIL_BITS')
+define(`NUMB_BITS',`GMP_NUMB_BITS')
+
+C This declaration is munged by configure
+NAILS_SUPPORT(4-63)
+
+ASM_START()
+PROLOGUE(mpn_addmul_4)
+ lda r30, -240(r30)
+ stq r12, 32(r30)
+ stq r13, 40(r30)
+ stq r14, 48(r30)
+ stq r15, 56(r30)
+
+ lda numb_mask,-1(r31)
+ srl numb_mask,NAIL_BITS,numb_mask
+
+ ldq v0, 0(vp)
+ ldq v1, 8(vp)
+ ldq v2, 16(vp)
+ ldq v3, 24(vp)
+
+ bis r31, r31, acc0 C zero acc0
+ sll v0,NAIL_BITS, v0
+ bis r31, r31, acc1 C zero acc1
+ sll v1,NAIL_BITS, v1
+ bis r31, r31, acc2 C zero acc2
+ sll v2,NAIL_BITS, v2
+ bis r31, r31, acc3 C zero acc3
+ sll v3,NAIL_BITS, v3
+ bis r31, r31, r19
+
+ ldq ulimb, 0(up)
+ lda up, 8(up)
+ mulq v0, ulimb, m0a C U1
+ umulh v0, ulimb, m0b C U1
+ mulq v1, ulimb, m1a C U1
+ umulh v1, ulimb, m1b C U1
+ lda n, -1(n)
+ mulq v2, ulimb, m2a C U1
+ umulh v2, ulimb, m2b C U1
+ mulq v3, ulimb, m3a C U1
+ umulh v3, ulimb, m3b C U1
+ beq n, L(end) C U0
+
+ ALIGN(16)
+L(top): bis r31, r31, r31 C U1 nop
+ ldq rlimb, 0(rp) C L0
+ ldq ulimb, 0(up) C L1
+ addq r19, acc0, acc0 C U0 propagate nail
+
+ bis r31, r31, r31 C L0 nop
+ bis r31, r31, r31 C U1 nop
+ bis r31, r31, r31 C L1 nop
+ bis r31, r31, r31 C U0 nop
+
+ lda rp, 8(rp) C L0
+ srl m0a,NAIL_BITS, r8 C U0
+ lda up, 8(up) C L1
+ mulq v0, ulimb, m0a C U1
+
+ addq r8, acc0, r19 C U0
+ addq m0b, acc1, acc0 C L0
+ umulh v0, ulimb, m0b C U1
+ bis r31, r31, r31 C L1 nop
+
+ addq rlimb, r19, r19 C L0
+ srl m1a,NAIL_BITS, r8 C U0
+ bis r31, r31, r31 C L1 nop
+ mulq v1, ulimb, m1a C U1
+
+ addq r8, acc0, acc0 C U0
+ addq m1b, acc2, acc1 C L0
+ umulh v1, ulimb, m1b C U1
+ and r19,numb_mask, r28 C L1 extract numb part
+
+ bis r31, r31, r31 C L0 nop
+ srl m2a,NAIL_BITS, r8 C U0
+ lda n, -1(n) C L1
+ mulq v2, ulimb, m2a C U1
+
+ addq r8, acc1, acc1 C L1
+ addq m2b, acc3, acc2 C L0
+ umulh v2, ulimb, m2b C U1
+ srl r19,NUMB_BITS, r19 C U0 extract nail part
+
+ bis r31, r31, r31 C L0 nop
+ srl m3a,NAIL_BITS, r8 C U0
+ stq r28, -8(rp) C L1
+ mulq v3, ulimb, m3a C U1
+
+ addq r8, acc2, acc2 C L0
+ bis r31, m3b, acc3 C L1
+ umulh v3, ulimb, m3b C U1
+ bne n, L(top) C U0
+
+L(end): ldq rlimb, 0(rp)
+ addq r19, acc0, acc0 C propagate nail
+ lda rp, 8(rp) C FIXME: DELETE
+ srl m0a,NAIL_BITS, r8 C U0
+ addq r8, acc0, r19
+ addq m0b, acc1, acc0
+ addq rlimb, r19, r19
+ srl m1a,NAIL_BITS, r8 C U0
+ addq r8, acc0, acc0
+ addq m1b, acc2, acc1
+ and r19,numb_mask, r28 C extract limb
+ srl m2a,NAIL_BITS, r8 C U0
+ addq r8, acc1, acc1
+ addq m2b, acc3, acc2
+ srl r19,NUMB_BITS, r19 C extract nail
+ srl m3a,NAIL_BITS, r8 C U0
+ stq r28, -8(rp)
+ addq r8, acc2, acc2
+ bis r31, m3b, acc3
+
+ addq r19, acc0, acc0 C propagate nail
+ and acc0,numb_mask, r28
+ stq r28, 0(rp)
+ srl acc0,NUMB_BITS, r19
+ addq r19, acc1, acc1
+
+ and acc1,numb_mask, r28
+ stq r28, 8(rp)
+ srl acc1,NUMB_BITS, r19
+ addq r19, acc2, acc2
+
+ and acc2,numb_mask, r28
+ stq r28, 16(rp)
+ srl acc2,NUMB_BITS, r19
+ addq r19, acc3, r0
+
+ ldq r12, 32(r30)
+ ldq r13, 40(r30)
+ ldq r14, 48(r30)
+ ldq r15, 56(r30)
+ lda r30, 240(r30)
+ ret r31, (r26), 1
+EPILOGUE()
+ASM_END()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/ev6/nails/aors_n.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/ev6/nails/aors_n.asm
new file mode 100644
index 00000000000..f6586773f57
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/ev6/nails/aors_n.asm
@@ -0,0 +1,233 @@
+dnl Alpha ev6 nails mpn_add_n and mpn_sub_n.
+
+dnl Copyright 2002, 2006 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 Runs at 2.5 cycles/limb. It would be possible to reach 2.0 cycles/limb
+dnl with 8-way unrolling.
+
+include(`../config.m4')
+
+dnl INPUT PARAMETERS
+define(`rp',`r16')
+define(`up',`r17')
+define(`vp',`r18')
+define(`n',`r19')
+
+define(`rl0',`r0')
+define(`rl1',`r1')
+define(`rl2',`r2')
+define(`rl3',`r3')
+
+define(`ul0',`r4')
+define(`ul1',`r5')
+define(`ul2',`r6')
+define(`ul3',`r7')
+
+define(`vl0',`r22')
+define(`vl1',`r23')
+define(`vl2',`r24')
+define(`vl3',`r25')
+
+define(`numb_mask',`r21')
+
+define(`NAIL_BITS',`GMP_NAIL_BITS')
+define(`CYSH',`GMP_NUMB_BITS')
+
+dnl This declaration is munged by configure
+NAILS_SUPPORT(1-63)
+
+ifdef(`OPERATION_add_n', `
+ define(`OP', addq)
+ define(`CYSH',`GMP_NUMB_BITS')
+ define(`func', mpn_add_n)')
+ifdef(`OPERATION_sub_n', `
+ define(`OP', subq)
+ define(`CYSH',63)
+ define(`func', mpn_sub_n)')
+
+MULFUNC_PROLOGUE(mpn_add_n mpn_sub_n)
+
+ASM_START()
+PROLOGUE(func)
+ lda numb_mask, -1(r31)
+ srl numb_mask, NAIL_BITS, numb_mask
+ bis r31, r31, r20
+
+ and n, 3, r25
+ lda n, -4(n)
+ beq r25, L(ge4)
+
+L(lp0): ldq ul0, 0(up)
+ lda up, 8(up)
+ ldq vl0, 0(vp)
+ lda vp, 8(vp)
+ lda rp, 8(rp)
+ lda r25, -1(r25)
+ OP ul0, vl0, rl0
+ OP rl0, r20, rl0
+ and rl0, numb_mask, r28
+ stq r28, -8(rp)
+ srl rl0, CYSH, r20
+ bne r25, L(lp0)
+
+ blt n, L(ret)
+
+L(ge4): ldq ul0, 0(up)
+ ldq vl0, 0(vp)
+ ldq ul1, 8(up)
+ ldq vl1, 8(vp)
+ ldq ul2, 16(up)
+ ldq vl2, 16(vp)
+ ldq ul3, 24(up)
+ ldq vl3, 24(vp)
+ lda up, 32(up)
+ lda vp, 32(vp)
+ lda n, -4(n)
+ bge n, L(ge8)
+
+ OP ul0, vl0, rl0 C main-add 0
+ OP rl0, r20, rl0 C cy-add 0
+ OP ul1, vl1, rl1 C main-add 1
+ srl rl0, CYSH, r20 C gen cy 0
+ OP rl1, r20, rl1 C cy-add 1
+ and rl0,numb_mask, r27
+ br r31, L(cj0)
+
+L(ge8): OP ul0, vl0, rl0 C main-add 0
+ ldq ul0, 0(up)
+ ldq vl0, 0(vp)
+ OP rl0, r20, rl0 C cy-add 0
+ OP ul1, vl1, rl1 C main-add 1
+ srl rl0, CYSH, r20 C gen cy 0
+ ldq ul1, 8(up)
+ ldq vl1, 8(vp)
+ OP rl1, r20, rl1 C cy-add 1
+ and rl0,numb_mask, r27
+ OP ul2, vl2, rl2 C main-add 2
+ srl rl1, CYSH, r20 C gen cy 1
+ ldq ul2, 16(up)
+ ldq vl2, 16(vp)
+ OP rl2, r20, rl2 C cy-add 2
+ and rl1,numb_mask, r28
+ stq r27, 0(rp)
+ OP ul3, vl3, rl3 C main-add 3
+ srl rl2, CYSH, r20 C gen cy 2
+ ldq ul3, 24(up)
+ ldq vl3, 24(vp)
+ OP rl3, r20, rl3 C cy-add 3
+ and rl2,numb_mask, r27
+ stq r28, 8(rp)
+ lda rp, 32(rp)
+ lda up, 32(up)
+ lda vp, 32(vp)
+ lda n, -4(n)
+ blt n, L(end)
+
+ ALIGN(32)
+L(top): OP ul0, vl0, rl0 C main-add 0
+ srl rl3, CYSH, r20 C gen cy 3
+ ldq ul0, 0(up)
+ ldq vl0, 0(vp)
+
+ OP rl0, r20, rl0 C cy-add 0
+ and rl3,numb_mask, r28
+ stq r27, -16(rp)
+ bis r31, r31, r31
+
+ OP ul1, vl1, rl1 C main-add 1
+ srl rl0, CYSH, r20 C gen cy 0
+ ldq ul1, 8(up)
+ ldq vl1, 8(vp)
+
+ OP rl1, r20, rl1 C cy-add 1
+ and rl0,numb_mask, r27
+ stq r28, -8(rp)
+ bis r31, r31, r31
+
+ OP ul2, vl2, rl2 C main-add 2
+ srl rl1, CYSH, r20 C gen cy 1
+ ldq ul2, 16(up)
+ ldq vl2, 16(vp)
+
+ OP rl2, r20, rl2 C cy-add 2
+ and rl1,numb_mask, r28
+ stq r27, 0(rp)
+ bis r31, r31, r31
+
+ OP ul3, vl3, rl3 C main-add 3
+ srl rl2, CYSH, r20 C gen cy 2
+ ldq ul3, 24(up)
+ ldq vl3, 24(vp)
+
+ OP rl3, r20, rl3 C cy-add 3
+ and rl2,numb_mask, r27
+ stq r28, 8(rp)
+ bis r31, r31, r31
+
+ bis r31, r31, r31
+ lda n, -4(n)
+ lda up, 32(up)
+ lda vp, 32(vp)
+
+ bis r31, r31, r31
+ bis r31, r31, r31
+ lda rp, 32(rp)
+ bge n, L(top)
+
+L(end): OP ul0, vl0, rl0 C main-add 0
+ srl rl3, CYSH, r20 C gen cy 3
+ OP rl0, r20, rl0 C cy-add 0
+ and rl3,numb_mask, r28
+ stq r27, -16(rp)
+ OP ul1, vl1, rl1 C main-add 1
+ srl rl0, CYSH, r20 C gen cy 0
+ OP rl1, r20, rl1 C cy-add 1
+ and rl0,numb_mask, r27
+ stq r28, -8(rp)
+L(cj0): OP ul2, vl2, rl2 C main-add 2
+ srl rl1, CYSH, r20 C gen cy 1
+ OP rl2, r20, rl2 C cy-add 2
+ and rl1,numb_mask, r28
+ stq r27, 0(rp)
+ OP ul3, vl3, rl3 C main-add 3
+ srl rl2, CYSH, r20 C gen cy 2
+ OP rl3, r20, rl3 C cy-add 3
+ and rl2,numb_mask, r27
+ stq r28, 8(rp)
+
+ srl rl3, CYSH, r20 C gen cy 3
+ and rl3,numb_mask, r28
+ stq r27, 16(rp)
+ stq r28, 24(rp)
+
+L(ret): and r20, 1, r0
+ ret r31, (r26), 1
+EPILOGUE()
+ASM_END()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/ev6/nails/gmp-mparam.h b/Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/ev6/nails/gmp-mparam.h
new file mode 100644
index 00000000000..7949fe8df89
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/ev6/nails/gmp-mparam.h
@@ -0,0 +1,72 @@
+/* gmp-mparam.h -- Compiler/machine parameter header file.
+
+Copyright 1991, 1993, 1994, 1999-2004 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
+
+/* Generated by tuneup.c, 2004-02-07, gcc 3.3 */
+
+#define MUL_TOOM22_THRESHOLD 40
+#define MUL_TOOM33_THRESHOLD 236
+
+#define SQR_BASECASE_THRESHOLD 7 /* karatsuba */
+#define SQR_TOOM2_THRESHOLD 0 /* never sqr_basecase */
+#define SQR_TOOM3_THRESHOLD 120
+
+#define DIV_SB_PREINV_THRESHOLD MP_SIZE_T_MAX /* no preinv with nails */
+#define DIV_DC_THRESHOLD 48
+#define POWM_THRESHOLD 113
+
+#define HGCD_THRESHOLD 78
+#define GCD_ACCEL_THRESHOLD 3
+#define GCD_DC_THRESHOLD 392
+#define JACOBI_BASE_METHOD 1
+
+#define DIVREM_1_NORM_THRESHOLD MP_SIZE_T_MAX /* no preinv with nails */
+#define DIVREM_1_UNNORM_THRESHOLD MP_SIZE_T_MAX /* no preinv with nails */
+#define MOD_1_NORM_THRESHOLD MP_SIZE_T_MAX /* no preinv with nails */
+#define MOD_1_UNNORM_THRESHOLD MP_SIZE_T_MAX /* no preinv with nails */
+#define USE_PREINV_DIVREM_1 0 /* no preinv with nails */
+#define USE_PREINV_MOD_1 0 /* no preinv with nails */
+#define DIVREM_2_THRESHOLD MP_SIZE_T_MAX /* no preinv with nails */
+#define DIVEXACT_1_THRESHOLD 0 /* always */
+#define MODEXACT_1_ODD_THRESHOLD 0 /* always */
+
+#define GET_STR_DC_THRESHOLD 15
+#define GET_STR_PRECOMPUTE_THRESHOLD 24
+#define SET_STR_THRESHOLD 6336
+
+#define MUL_FFT_TABLE { 688, 1440, 3648, 6400, 25600, 0 }
+#define MUL_FFT_MODF_THRESHOLD 488
+#define MUL_FFT_THRESHOLD 3712
+
+#define SQR_FFT_TABLE { 432, 864, 3136, 6400, 25600, 0 }
+#define SQR_FFT_MODF_THRESHOLD 480
+#define SQR_FFT_THRESHOLD 2976
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/ev6/nails/mul_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/ev6/nails/mul_1.asm
new file mode 100644
index 00000000000..da2ee3d0997
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/ev6/nails/mul_1.asm
@@ -0,0 +1,364 @@
+dnl Alpha ev6 nails mpn_mul_1.
+
+dnl Copyright 2002, 2005, 2006 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 EV4: 42
+C EV5: 18
+C EV6: 3.25
+
+C TODO
+C * Reroll loop for 3.0 c/l with current 4-way unrolling.
+C * The loop is overscheduled wrt loads and wrt multiplies, in particular
+C umulh.
+C * Use FP loop count and multiple exit points, that would simplify feed-in lp0
+C and would work since the loop structure is really regular.
+
+C INPUT PARAMETERS
+define(`rp',`r16')
+define(`up',`r17')
+define(`n', `r18')
+define(`vl0',`r19')
+
+define(`numb_mask',`r6')
+
+define(`m0a',`r0')
+define(`m0b',`r1')
+define(`m1a',`r2')
+define(`m1b',`r3')
+define(`m2a',`r20')
+define(`m2b',`r21')
+define(`m3a',`r22')
+define(`m3b',`r23')
+
+define(`acc0',`r25')
+define(`acc1',`r27')
+
+define(`ul0',`r4')
+define(`ul1',`r5')
+define(`ul2',`r4')
+define(`ul3',`r5')
+
+define(`rl0',`r24')
+define(`rl1',`r24')
+define(`rl2',`r24')
+define(`rl3',`r24')
+
+define(`t0',`r7')
+define(`t1',`r8')
+
+define(`NAIL_BITS',`GMP_NAIL_BITS')
+define(`NUMB_BITS',`GMP_NUMB_BITS')
+
+dnl This declaration is munged by configure
+NAILS_SUPPORT(1-63)
+
+ASM_START()
+PROLOGUE(mpn_mul_1)
+ sll vl0, NAIL_BITS, vl0
+ lda numb_mask, -1(r31)
+ srl numb_mask, NAIL_BITS, numb_mask
+
+ and n, 3, r25
+ cmpeq r25, 1, r21
+ bne r21, L(1m4)
+ cmpeq r25, 2, r21
+ bne r21, L(2m4)
+ beq r25, L(0m4)
+
+L(3m4): ldq ul3, 0(up)
+ lda n, -4(n)
+ ldq ul0, 8(up)
+ mulq vl0, ul3, m3a
+ umulh vl0, ul3, m3b
+ ldq ul1, 16(up)
+ lda up, 24(up)
+ lda rp, -8(rp)
+ mulq vl0, ul0, m0a
+ umulh vl0, ul0, m0b
+ bge n, L(ge3)
+
+ mulq vl0, ul1, m1a
+ umulh vl0, ul1, m1b
+ srl m3a,NAIL_BITS, t0
+ addq t0, r31, acc1
+ srl m0a,NAIL_BITS, t0
+ addq t0, m3b, acc0
+ srl acc1,NUMB_BITS, t1
+ br r31, L(ta3)
+
+L(ge3): ldq ul2, 0(up)
+ mulq vl0, ul1, m1a
+ umulh vl0, ul1, m1b
+ srl m3a,NAIL_BITS, t0
+ ldq ul3, 8(up)
+ lda n, -4(n)
+ mulq vl0, ul2, m2a
+ addq t0, r31, acc1
+ umulh vl0, ul2, m2b
+ srl m0a,NAIL_BITS, t0
+ ldq ul0, 16(up)
+ mulq vl0, ul3, m3a
+ addq t0, m3b, acc0
+ srl acc1,NUMB_BITS, t1
+ br r31, L(el3)
+
+L(0m4): lda n, -8(n)
+ ldq ul2, 0(up)
+ ldq ul3, 8(up)
+ mulq vl0, ul2, m2a
+ umulh vl0, ul2, m2b
+ ldq ul0, 16(up)
+ mulq vl0, ul3, m3a
+ umulh vl0, ul3, m3b
+ ldq ul1, 24(up)
+ lda up, 32(up)
+ mulq vl0, ul0, m0a
+ umulh vl0, ul0, m0b
+ bge n, L(ge4)
+
+ srl m2a,NAIL_BITS, t0
+ mulq vl0, ul1, m1a
+ addq t0, r31, acc0
+ umulh vl0, ul1, m1b
+ srl m3a,NAIL_BITS, t0
+ addq t0, m2b, acc1
+ srl acc0,NUMB_BITS, t1
+ br r31, L(ta4)
+
+L(ge4): srl m2a,NAIL_BITS, t0
+ ldq ul2, 0(up)
+ mulq vl0, ul1, m1a
+ addq t0, r31, acc0
+ umulh vl0, ul1, m1b
+ srl m3a,NAIL_BITS, t0
+ ldq ul3, 8(up)
+ lda n, -4(n)
+ mulq vl0, ul2, m2a
+ addq t0, m2b, acc1
+ srl acc0,NUMB_BITS, t1
+ br r31, L(el0)
+
+L(2m4): lda n, -4(n)
+ ldq ul0, 0(up)
+ ldq ul1, 8(up)
+ lda up, 16(up)
+ lda rp, -16(rp)
+ mulq vl0, ul0, m0a
+ umulh vl0, ul0, m0b
+ bge n, L(ge2)
+
+ mulq vl0, ul1, m1a
+ umulh vl0, ul1, m1b
+ srl m0a,NAIL_BITS, t0
+ addq t0, r31, acc0
+ srl m1a,NAIL_BITS, t0
+ addq t0, m0b, acc1
+ srl acc0,NUMB_BITS, t1
+ br r31, L(ta2)
+
+L(ge2): ldq ul2, 0(up)
+ mulq vl0, ul1, m1a
+ umulh vl0, ul1, m1b
+ ldq ul3, 8(up)
+ lda n, -4(n)
+ mulq vl0, ul2, m2a
+ umulh vl0, ul2, m2b
+ srl m0a,NAIL_BITS, t0
+ ldq ul0, 16(up)
+ mulq vl0, ul3, m3a
+ addq t0, r31, acc0
+ umulh vl0, ul3, m3b
+ srl m1a,NAIL_BITS, t0
+ ldq ul1, 24(up)
+ lda up, 32(up)
+ lda rp, 32(rp)
+ mulq vl0, ul0, m0a
+ addq t0, m0b, acc1
+ srl acc0,NUMB_BITS, t1
+ bge n, L(el2)
+
+ br r31, L(ta6)
+
+L(1m4): lda n, -4(n)
+ ldq ul1, 0(up)
+ lda up, 8(up)
+ lda rp, -24(rp)
+ bge n, L(ge1)
+
+ mulq vl0, ul1, m1a
+ umulh vl0, ul1, m1b
+ srl m1a,NAIL_BITS, t0
+ addq t0, r31, acc1
+ and acc1,numb_mask, r28
+ srl acc1,NUMB_BITS, t1
+ stq r28, 24(rp)
+ addq t1, m1b, r0
+ ret r31, (r26), 1
+
+L(ge1): ldq ul2, 0(up)
+ mulq vl0, ul1, m1a
+ umulh vl0, ul1, m1b
+ ldq ul3, 8(up)
+ lda n, -4(n)
+ mulq vl0, ul2, m2a
+ umulh vl0, ul2, m2b
+ ldq ul0, 16(up)
+ mulq vl0, ul3, m3a
+ umulh vl0, ul3, m3b
+ srl m1a,NAIL_BITS, t0
+ ldq ul1, 24(up)
+ lda up, 32(up)
+ lda rp, 32(rp)
+ mulq vl0, ul0, m0a
+ addq t0, r31, acc1
+ umulh vl0, ul0, m0b
+ srl m2a,NAIL_BITS, t0
+ mulq vl0, ul1, m1a
+ addq t0, m1b, acc0
+ srl acc1,NUMB_BITS, t1
+ blt n, L(ta5)
+
+L(ge5): ldq ul2, 0(up)
+ br r31, L(el1)
+
+ ALIGN(16)
+L(top): mulq vl0, ul0, m0a C U1
+ addq t0, m0b, acc1 C L0
+ srl acc0,NUMB_BITS, t1 C U0
+ stq r28, -24(rp) C L1
+C
+L(el2): umulh vl0, ul0, m0b C U1
+ and acc0,numb_mask, r28 C L0
+ unop C U0
+ unop C L1
+C
+ unop C U1
+ addq t1, acc1, acc1 C L0
+ srl m2a,NAIL_BITS, t0 C U0
+ ldq ul2, 0(up) C L1
+C
+ mulq vl0, ul1, m1a C U1
+ addq t0, m1b, acc0 C L0
+ srl acc1,NUMB_BITS, t1 C U0
+ stq r28, -16(rp) C L1
+C
+L(el1): umulh vl0, ul1, m1b C U1
+ and acc1,numb_mask, r28 C L0
+ unop C U0
+ lda n, -4(n) C L1
+C
+ unop C U1
+ addq t1, acc0, acc0 C L0
+ srl m3a,NAIL_BITS, t0 C U0
+ ldq ul3, 8(up) C L1
+C
+ mulq vl0, ul2, m2a C U1
+ addq t0, m2b, acc1 C L0
+ srl acc0,NUMB_BITS, t1 C U0
+ stq r28, -8(rp) C L1
+C
+L(el0): umulh vl0, ul2, m2b C U1
+ and acc0,numb_mask, r28 C L0
+ unop C U0
+ unop C L1
+C
+ unop C U1
+ addq t1, acc1, acc1 C L0
+ srl m0a,NAIL_BITS, t0 C U0
+ ldq ul0, 16(up) C L1
+C
+ mulq vl0, ul3, m3a C U1
+ addq t0, m3b, acc0 C L0
+ srl acc1,NUMB_BITS, t1 C U0
+ stq r28, 0(rp) C L1
+C
+L(el3): umulh vl0, ul3, m3b C U1
+ and acc1,numb_mask, r28 C L0
+ unop C U0
+ unop C L1
+C
+ unop C U1
+ addq t1, acc0, acc0 C L0
+ srl m1a,NAIL_BITS, t0 C U0
+ ldq ul1, 24(up) C L1
+C
+ lda up, 32(up) C L0
+ unop C U1
+ lda rp, 32(rp) C L1
+ bge n, L(top) C U0
+
+L(end): mulq vl0, ul0, m0a
+ addq t0, m0b, acc1
+ srl acc0,NUMB_BITS, t1
+ stq r28, -24(rp)
+L(ta6): umulh vl0, ul0, m0b
+ and acc0,numb_mask, r28
+ addq t1, acc1, acc1
+ srl m2a,NAIL_BITS, t0
+ mulq vl0, ul1, m1a
+ addq t0, m1b, acc0
+ srl acc1,NUMB_BITS, t1
+ stq r28, -16(rp)
+L(ta5): umulh vl0, ul1, m1b
+ and acc1,numb_mask, r28
+ addq t1, acc0, acc0
+ srl m3a,NAIL_BITS, t0
+ addq t0, m2b, acc1
+ srl acc0,NUMB_BITS, t1
+ stq r28, -8(rp)
+ ALIGN(16)
+L(ta4): and acc0,numb_mask, r28
+ addq t1, acc1, acc1
+ srl m0a,NAIL_BITS, t0
+ addq t0, m3b, acc0
+ srl acc1,NUMB_BITS, t1
+ stq r28, 0(rp)
+ unop
+ ALIGN(16)
+L(ta3): and acc1,numb_mask, r28
+ addq t1, acc0, acc0
+ srl m1a,NAIL_BITS, t0
+ addq t0, m0b, acc1
+ srl acc0,NUMB_BITS, t1
+ stq r28, 8(rp)
+ unop
+ ALIGN(16)
+L(ta2): and acc0,numb_mask, r28
+ addq t1, acc1, acc1
+ srl acc1,NUMB_BITS, t1
+ stq r28, 16(rp)
+ and acc1,numb_mask, r28
+ addq t1, m1b, r0
+ stq r28, 24(rp)
+ ret r31, (r26), 1
+EPILOGUE()
+ASM_END()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/ev6/nails/submul_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/ev6/nails/submul_1.asm
new file mode 100644
index 00000000000..f473a59ba82
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/ev6/nails/submul_1.asm
@@ -0,0 +1,396 @@
+dnl Alpha ev6 nails mpn_submul_1.
+
+dnl Copyright 2002, 2005, 2006 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 EV4: 42
+C EV5: 18
+C EV6: 4
+
+C TODO
+C * Reroll loop for 3.75 c/l with current 4-way unrolling.
+C * The loop is overscheduled wrt loads and wrt multiplies, in particular
+C umulh.
+C * Use FP loop count and multiple exit points, that would simplify feed-in lp0
+C and would work since the loop structure is really regular.
+
+C INPUT PARAMETERS
+define(`rp',`r16')
+define(`up',`r17')
+define(`n', `r18')
+define(`vl0',`r19')
+
+define(`numb_mask',`r6')
+
+define(`m0a',`r0')
+define(`m0b',`r1')
+define(`m1a',`r2')
+define(`m1b',`r3')
+define(`m2a',`r20')
+define(`m2b',`r21')
+define(`m3a',`r22')
+define(`m3b',`r23')
+
+define(`acc0',`r25')
+define(`acc1',`r27')
+
+define(`ul0',`r4')
+define(`ul1',`r5')
+define(`ul2',`r4')
+define(`ul3',`r5')
+
+define(`rl0',`r24')
+define(`rl1',`r24')
+define(`rl2',`r24')
+define(`rl3',`r24')
+
+define(`t0',`r7')
+define(`t1',`r8')
+
+define(`NAIL_BITS',`GMP_NAIL_BITS')
+define(`NUMB_BITS',`GMP_NUMB_BITS')
+
+dnl This declaration is munged by configure
+NAILS_SUPPORT(2-63)
+
+ASM_START()
+PROLOGUE(mpn_submul_1)
+ sll vl0, NAIL_BITS, vl0
+ lda numb_mask, -1(r31)
+ srl numb_mask, NAIL_BITS, numb_mask
+
+ and n, 3, r25
+ cmpeq r25, 1, r21
+ bne r21, L(1m4)
+ cmpeq r25, 2, r21
+ bne r21, L(2m4)
+ beq r25, L(0m4)
+
+L(3m4): ldq ul3, 0(up)
+ lda n, -4(n)
+ ldq ul0, 8(up)
+ mulq vl0, ul3, m3a
+ umulh vl0, ul3, m3b
+ ldq ul1, 16(up)
+ lda up, 24(up)
+ lda rp, -8(rp)
+ mulq vl0, ul0, m0a
+ umulh vl0, ul0, m0b
+ bge n, L(ge3)
+
+ mulq vl0, ul1, m1a
+ umulh vl0, ul1, m1b
+ ldq rl3, 8(rp)
+ srl m3a,NAIL_BITS, t0
+ addq t0, r31, acc1
+ subq rl3, acc1, acc1
+ ldq rl0, 16(rp)
+ srl m0a,NAIL_BITS, t0
+ addq t0, m3b, acc0
+ sra acc1,NUMB_BITS, t1
+ br r31, L(ta3)
+
+L(ge3): ldq ul2, 0(up)
+ mulq vl0, ul1, m1a
+ umulh vl0, ul1, m1b
+ ldq rl3, 8(rp)
+ srl m3a,NAIL_BITS, t0
+ ldq ul3, 8(up)
+ lda n, -4(n)
+ mulq vl0, ul2, m2a
+ addq t0, r31, acc1
+ umulh vl0, ul2, m2b
+ subq rl3, acc1, acc1
+ ldq rl0, 16(rp)
+ srl m0a,NAIL_BITS, t0
+ ldq ul0, 16(up)
+ mulq vl0, ul3, m3a
+ addq t0, m3b, acc0
+ sra acc1,NUMB_BITS, t1
+ br r31, L(el3)
+
+L(0m4): lda n, -8(n)
+ ldq ul2, 0(up)
+ ldq ul3, 8(up)
+ mulq vl0, ul2, m2a
+ umulh vl0, ul2, m2b
+ ldq ul0, 16(up)
+ mulq vl0, ul3, m3a
+ umulh vl0, ul3, m3b
+ ldq ul1, 24(up)
+ lda up, 32(up)
+ mulq vl0, ul0, m0a
+ umulh vl0, ul0, m0b
+ bge n, L(ge4)
+
+ ldq rl2, 0(rp)
+ srl m2a,NAIL_BITS, t0
+ mulq vl0, ul1, m1a
+ addq t0, r31, acc0
+ umulh vl0, ul1, m1b
+ subq rl2, acc0, acc0
+ ldq rl3, 8(rp)
+ srl m3a,NAIL_BITS, t0
+ addq t0, m2b, acc1
+ sra acc0,NUMB_BITS, t1
+ br r31, L(ta4)
+
+L(ge4): ldq rl2, 0(rp)
+ srl m2a,NAIL_BITS, t0
+ ldq ul2, 0(up)
+ mulq vl0, ul1, m1a
+ addq t0, r31, acc0
+ umulh vl0, ul1, m1b
+ subq rl2, acc0, acc0
+ ldq rl3, 8(rp)
+ srl m3a,NAIL_BITS, t0
+ ldq ul3, 8(up)
+ lda n, -4(n)
+ mulq vl0, ul2, m2a
+ addq t0, m2b, acc1
+ sra acc0,NUMB_BITS, t1
+ br r31, L(el0)
+
+L(2m4): lda n, -4(n)
+ ldq ul0, 0(up)
+ ldq ul1, 8(up)
+ lda up, 16(up)
+ lda rp, -16(rp)
+ mulq vl0, ul0, m0a
+ umulh vl0, ul0, m0b
+ bge n, L(ge2)
+
+ mulq vl0, ul1, m1a
+ umulh vl0, ul1, m1b
+ ldq rl0, 16(rp)
+ srl m0a,NAIL_BITS, t0
+ addq t0, r31, acc0
+ subq rl0, acc0, acc0
+ ldq rl1, 24(rp)
+ srl m1a,NAIL_BITS, t0
+ addq t0, m0b, acc1
+ sra acc0,NUMB_BITS, t1
+ br r31, L(ta2)
+
+L(ge2): ldq ul2, 0(up)
+ mulq vl0, ul1, m1a
+ umulh vl0, ul1, m1b
+ ldq ul3, 8(up)
+ lda n, -4(n)
+ mulq vl0, ul2, m2a
+ umulh vl0, ul2, m2b
+ ldq rl0, 16(rp)
+ srl m0a,NAIL_BITS, t0
+ ldq ul0, 16(up)
+ mulq vl0, ul3, m3a
+ addq t0, r31, acc0
+ umulh vl0, ul3, m3b
+ subq rl0, acc0, acc0
+ ldq rl1, 24(rp)
+ srl m1a,NAIL_BITS, t0
+ ldq ul1, 24(up)
+ lda up, 32(up)
+ lda rp, 32(rp)
+ mulq vl0, ul0, m0a
+ addq t0, m0b, acc1
+ sra acc0,NUMB_BITS, t1
+ bge n, L(el2)
+
+ br r31, L(ta6)
+
+L(1m4): lda n, -4(n)
+ ldq ul1, 0(up)
+ lda up, 8(up)
+ lda rp, -24(rp)
+ bge n, L(ge1)
+
+ mulq vl0, ul1, m1a
+ umulh vl0, ul1, m1b
+ ldq rl1, 24(rp)
+ srl m1a,NAIL_BITS, t0
+ subq rl1, t0, acc1
+ and acc1,numb_mask, r28
+ sra acc1,NUMB_BITS, t1
+ stq r28, 24(rp)
+ subq m1b, t1, r0
+ ret r31, (r26), 1
+
+L(ge1): ldq ul2, 0(up)
+ mulq vl0, ul1, m1a
+ umulh vl0, ul1, m1b
+ ldq ul3, 8(up)
+ lda n, -4(n)
+ mulq vl0, ul2, m2a
+ umulh vl0, ul2, m2b
+ ldq ul0, 16(up)
+ mulq vl0, ul3, m3a
+ umulh vl0, ul3, m3b
+ ldq rl1, 24(rp)
+ srl m1a,NAIL_BITS, t0
+ ldq ul1, 24(up)
+ lda up, 32(up)
+ lda rp, 32(rp)
+ mulq vl0, ul0, m0a
+ addq t0, r31, acc1
+ umulh vl0, ul0, m0b
+ subq rl1, acc1, acc1
+ ldq rl2, 0(rp)
+ srl m2a,NAIL_BITS, t0
+ mulq vl0, ul1, m1a
+ addq t0, m1b, acc0
+ sra acc1,NUMB_BITS, t1
+ blt n, L(ta5)
+
+L(ge5): ldq ul2, 0(up)
+ br r31, L(el1)
+
+ ALIGN(16)
+L(top): mulq vl0, ul0, m0a C U1
+ addq t0, m0b, acc1 C L0
+ sra acc0,NUMB_BITS, t1 C U0
+ stq r28, -24(rp) C L1
+C
+L(el2): umulh vl0, ul0, m0b C U1
+ and acc0,numb_mask, r28 C L0
+ subq rl1, acc1, acc1 C U0
+ ldq rl2, 0(rp) C L1
+C
+ unop C U1
+ addq t1, acc1, acc1 C L0
+ srl m2a,NAIL_BITS, t0 C U0
+ ldq ul2, 0(up) C L1
+C
+ mulq vl0, ul1, m1a C U1
+ addq t0, m1b, acc0 C L0
+ sra acc1,NUMB_BITS, t1 C U0
+ stq r28, -16(rp) C L1
+C
+L(el1): umulh vl0, ul1, m1b C U1
+ and acc1,numb_mask, r28 C L0
+ subq rl2, acc0, acc0 C U0
+ ldq rl3, 8(rp) C L1
+C
+ lda n, -4(n) C L1
+ addq t1, acc0, acc0 C L0
+ srl m3a,NAIL_BITS, t0 C U0
+ ldq ul3, 8(up) C L1
+C
+ mulq vl0, ul2, m2a C U1
+ addq t0, m2b, acc1 C L0
+ sra acc0,NUMB_BITS, t1 C U0
+ stq r28, -8(rp) C L1
+C
+L(el0): umulh vl0, ul2, m2b C U1
+ and acc0,numb_mask, r28 C L0
+ subq rl3, acc1, acc1 C U0
+ ldq rl0, 16(rp) C L1
+C
+ unop C U1
+ addq t1, acc1, acc1 C L0
+ srl m0a,NAIL_BITS, t0 C U0
+ ldq ul0, 16(up) C L1
+C
+ mulq vl0, ul3, m3a C U1
+ addq t0, m3b, acc0 C L0
+ sra acc1,NUMB_BITS, t1 C U0
+ stq r28, 0(rp) C L1
+C
+L(el3): umulh vl0, ul3, m3b C U1
+ and acc1,numb_mask, r28 C L0
+ subq rl0, acc0, acc0 C U0
+ ldq rl1, 24(rp) C L1
+C
+ unop C U1
+ addq t1, acc0, acc0 C L0
+ srl m1a,NAIL_BITS, t0 C U0
+ ldq ul1, 24(up) C L1
+C
+ lda up, 32(up) C L0
+ unop C U1
+ lda rp, 32(rp) C L1
+ bge n, L(top) C U0
+
+L(end): mulq vl0, ul0, m0a
+ addq t0, m0b, acc1
+ sra acc0,NUMB_BITS, t1
+ stq r28, -24(rp)
+L(ta6): umulh vl0, ul0, m0b
+ and acc0,numb_mask, r28
+ subq rl1, acc1, acc1
+ ldq rl2, 0(rp)
+ addq t1, acc1, acc1
+ srl m2a,NAIL_BITS, t0
+ mulq vl0, ul1, m1a
+ addq t0, m1b, acc0
+ sra acc1,NUMB_BITS, t1
+ stq r28, -16(rp)
+L(ta5): umulh vl0, ul1, m1b
+ and acc1,numb_mask, r28
+ subq rl2, acc0, acc0
+ ldq rl3, 8(rp)
+ addq t1, acc0, acc0
+ srl m3a,NAIL_BITS, t0
+ addq t0, m2b, acc1
+ sra acc0,NUMB_BITS, t1
+ stq r28, -8(rp)
+ unop
+ ALIGN(16)
+L(ta4): and acc0,numb_mask, r28
+ subq rl3, acc1, acc1
+ ldq rl0, 16(rp)
+ addq t1, acc1, acc1
+ srl m0a,NAIL_BITS, t0
+ addq t0, m3b, acc0
+ sra acc1,NUMB_BITS, t1
+ stq r28, 0(rp)
+ unop
+ ALIGN(16)
+L(ta3): and acc1,numb_mask, r28
+ subq rl0, acc0, acc0
+ ldq rl1, 24(rp)
+ addq t1, acc0, acc0
+ srl m1a,NAIL_BITS, t0
+ addq t0, m0b, acc1
+ sra acc0,NUMB_BITS, t1
+ stq r28, 8(rp)
+ unop
+ ALIGN(16)
+L(ta2): and acc0,numb_mask, r28
+ subq rl1, acc1, acc1
+ addq t1, acc1, acc1
+ sra acc1,NUMB_BITS, t1
+ stq r28, 16(rp)
+ and acc1,numb_mask, r28
+ subq m1b, t1, r0
+ stq r28, 24(rp)
+ ret r31, (r26), 1
+EPILOGUE()
+ASM_END()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/ev6/slot.pl b/Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/ev6/slot.pl
new file mode 100755
index 00000000000..a4c8a36882d
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/ev6/slot.pl
@@ -0,0 +1,318 @@
+#!/usr/bin/perl -w
+
+# Copyright 2000, 2001, 2003-2005, 2011 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/.
+
+
+# Usage: slot.pl [filename.o]...
+#
+# Run "objdump" to produce a disassembly of the given object file(s) and
+# annotate the output with "U" or "L" slotting which Alpha EV6 will use.
+#
+# When an instruction is E (ie. either U or L), an "eU" or "eL" is shown, as
+# a reminder that it wasn't a fixed requirement that gave the U or L, but
+# the octaword slotting rules.
+#
+# If an instruction is not recognised, that octaword does not get any U/L
+# shown, only lower-case "u", "l" or "e" for the instructions which are
+# known. Add any unknown instructions to %optable below.
+
+
+use strict;
+
+# The U or L which various instructions demand, or E if either.
+#
+my %optable =
+ (
+ 'addq' => 'E',
+ 'and' => 'E',
+ 'andnot' => 'E',
+ 'beq' => 'U',
+ 'bge' => 'U',
+ 'bgt' => 'U',
+ 'bic' => 'E',
+ 'bis' => 'E',
+ 'blt' => 'U',
+ 'bne' => 'U',
+ 'br' => 'L',
+ 'clr' => 'E',
+ 'cmpule' => 'E',
+ 'cmpult' => 'E',
+ 'cmpeq' => 'E',
+ 'cmoveq' => 'E',
+ 'cmovne' => 'E',
+ 'ctpop' => 'U',
+ 'ctlz' => 'U',
+ 'cttz' => 'U',
+ 'extbl' => 'U',
+ 'extlh' => 'U',
+ 'extll' => 'U',
+ 'extqh' => 'U',
+ 'extql' => 'U',
+ 'extwh' => 'U',
+ 'extwl' => 'U',
+ 'jsr' => 'L',
+ 'lda' => 'E',
+ 'ldah' => 'E',
+ 'ldbu' => 'L',
+ 'ldl' => 'L',
+ 'ldq' => 'L',
+ 'ldt' => 'L',
+ 'ret' => 'L',
+ 'mov' => 'E',
+ 'mull' => 'U',
+ 'mulq' => 'U',
+ 'negq' => 'E',
+ 'nop' => 'E',
+ 'not' => 'E',
+ 's8addq' => 'E',
+ 's8subq' => 'E',
+ # 'sextb' => ?
+ # 'sextl' => ?
+ 'sll' => 'U',
+ 'srl' => 'U',
+ 'stq' => 'L',
+ 'subq' => 'E',
+ 'umulh' => 'U',
+ 'unop' => 'E',
+ 'xor' => 'E',
+ );
+
+# Slottings used for a given pattern of U/L/E in an octaword. This is as
+# per the "Ebox Slotting" section of the EV6 hardware reference manual.
+#
+my %slottable =
+ (
+ 'EEEE' => 'ULUL',
+ 'EEEL' => 'ULUL',
+ 'EEEU' => 'ULLU',
+ 'EELE' => 'ULLU',
+ 'EELL' => 'UULL',
+ 'EELU' => 'ULLU',
+ 'EEUE' => 'ULUL',
+ 'EEUL' => 'ULUL',
+ 'EEUU' => 'LLUU',
+ 'ELEE' => 'ULUL',
+ 'ELEL' => 'ULUL',
+ 'ELEU' => 'ULLU',
+ 'ELLE' => 'ULLU',
+ 'ELLL' => 'ULLL',
+ 'ELLU' => 'ULLU',
+ 'ELUE' => 'ULUL',
+ 'ELUL' => 'ULUL',
+
+ 'LLLL' => 'LLLL',
+ 'LLLU' => 'LLLU',
+ 'LLUE' => 'LLUU',
+ 'LLUL' => 'LLUL',
+ 'LLUU' => 'LLUU',
+ 'LUEE' => 'LULU',
+ 'LUEL' => 'LUUL',
+ 'LUEU' => 'LULU',
+ 'LULE' => 'LULU',
+ 'LULL' => 'LULL',
+ 'LULU' => 'LULU',
+ 'LUUE' => 'LUUL',
+ 'LUUL' => 'LUUL',
+ 'LUUU' => 'LUUU',
+ 'UEEE' => 'ULUL',
+ 'UEEL' => 'ULUL',
+ 'UEEU' => 'ULLU',
+
+ 'ELUU' => 'LLUU',
+ 'EUEE' => 'LULU',
+ 'EUEL' => 'LUUL',
+ 'EUEU' => 'LULU',
+ 'EULE' => 'LULU',
+ 'EULL' => 'UULL',
+ 'EULU' => 'LULU',
+ 'EUUE' => 'LUUL',
+ 'EUUL' => 'LUUL',
+ 'EUUU' => 'LUUU',
+ 'LEEE' => 'LULU',
+ 'LEEL' => 'LUUL',
+ 'LEEU' => 'LULU',
+ 'LELE' => 'LULU',
+ 'LELL' => 'LULL',
+ 'LELU' => 'LULU',
+ 'LEUE' => 'LUUL',
+ 'LEUL' => 'LUUL',
+ 'LEUU' => 'LLUU',
+ 'LLEE' => 'LLUU',
+ 'LLEL' => 'LLUL',
+ 'LLEU' => 'LLUU',
+ 'LLLE' => 'LLLU',
+
+ 'UELE' => 'ULLU',
+ 'UELL' => 'UULL',
+ 'UELU' => 'ULLU',
+ 'UEUE' => 'ULUL',
+ 'UEUL' => 'ULUL',
+ 'UEUU' => 'ULUU',
+ 'ULEE' => 'ULUL',
+ 'ULEL' => 'ULUL',
+ 'ULEU' => 'ULLU',
+ 'ULLE' => 'ULLU',
+ 'ULLL' => 'ULLL',
+ 'ULLU' => 'ULLU',
+ 'ULUE' => 'ULUL',
+ 'ULUL' => 'ULUL',
+ 'ULUU' => 'ULUU',
+ 'UUEE' => 'UULL',
+ 'UUEL' => 'UULL',
+ 'UUEU' => 'UULU',
+ 'UULE' => 'UULL',
+ 'UULL' => 'UULL',
+ 'UULU' => 'UULU',
+ 'UUUE' => 'UUUL',
+ 'UUUL' => 'UUUL',
+ 'UUUU' => 'UUUU',
+ );
+
+# Check all combinations of U/L/E are present in %slottable.
+sub coverage {
+ foreach my $a ('U', 'L', 'E') {
+ foreach my $b ('U', 'L', 'E') {
+ foreach my $c ('U', 'L', 'E') {
+ foreach my $d ('U', 'L', 'E') {
+ my $x = $a . $b . $c . $d;
+ if (! defined $slottable{$x}) {
+ print "slottable missing: $x\n"
+ }
+ }
+ }
+ }
+ }
+}
+
+# Certain consistency checks for %slottable.
+sub check {
+ foreach my $x (keys %slottable) {
+ my $a = substr($x,0,1);
+ my $b = substr($x,1,1);
+ my $c = substr($x,2,1);
+ my $d = substr($x,3,1);
+ my $es = ($a eq 'E') + ($b eq 'E') + ($c eq 'E') + ($d eq 'E');
+ my $ls = ($a eq 'L') + ($b eq 'L') + ($c eq 'L') + ($d eq 'L');
+ my $us = ($a eq 'U') + ($b eq 'U') + ($c eq 'U') + ($d eq 'U');
+
+ my $got = $slottable{$x};
+ my $want = $x;
+
+ if ($es == 0) {
+
+ } elsif ($es == 1) {
+ # when only one E, it's mapped to whichever of U or L is otherwise
+ # used the least
+ if ($ls > $us) {
+ $want =~ s/E/U/;
+ } else {
+ $want =~ s/E/L/;
+ }
+ } elsif ($es == 2) {
+ # when two E's and two U, then the E's map to L; vice versa for two E
+ # and two L
+ if ($ls == 2) {
+ $want =~ s/E/U/g;
+ } elsif ($us == 2) {
+ $want =~ s/E/L/g;
+ } else {
+ next;
+ }
+ } elsif ($es == 3) {
+ next;
+
+ } else { # $es == 4
+ next;
+ }
+
+ if ($want ne $got) {
+ print "slottable $x want $want got $got\n";
+ }
+ }
+}
+
+sub disassemble {
+ my ($file) = @_;
+
+ open (IN, "objdump -Srfh $file |") || die "Cannot open pipe from objdump\n";
+
+ my (%pre, %post, %type);
+ while (<IN>) {
+ my $line = $_ . "";
+
+ if ($line =~ /(^[ \t]*[0-9a-f]*([0-9a-f]):[ \t]*[0-9a-f][0-9a-f] [0-9a-f][0-9a-f] [0-9a-f][0-9a-f] [0-9a-f][0-9a-f] )\t(([a-z0-9]+).*)/) {
+ my ($this_pre, $addr, $this_post, $opcode) = ($1, $2, $3, $4);
+
+ my $this_type = $optable{$opcode};
+ if (! defined ($this_type)) { $this_type = ' '; }
+
+ $pre{$addr} = $this_pre;
+ $post{$addr} = $this_post;
+ $type{$addr} = $this_type;
+
+ if ($addr eq 'c') {
+ my %slot = ('0'=>' ', '4'=>' ', '8'=>' ', 'c'=>' ');
+
+ my $str = $type{'c'} . $type{'8'} . $type{'4'} . $type{'0'};
+ $str = $slottable{$str};
+ if (defined $str) {
+ $slot{'c'} = substr($str,0,1);
+ $slot{'8'} = substr($str,1,1);
+ $slot{'4'} = substr($str,2,1);
+ $slot{'0'} = substr($str,3,1);
+ }
+
+ foreach my $i ('0', '4', '8', 'c') {
+ if ($slot{$i} eq $type{$i}) { $type{$i} = ' '; }
+ print $pre{$i}, ' ', lc($type{$i}),$slot{$i}, ' ', $post{$i}, "\n";
+ }
+
+ %pre = ();
+ %type = ();
+ %post = ();
+ }
+ }
+ }
+
+ close IN || die "Error from objdump (or objdump not available)\n";
+}
+
+coverage();
+check();
+
+my @files;
+if ($#ARGV >= 0) {
+ @files = @ARGV;
+} else {
+ die
+}
+
+foreach (@files) {
+ disassemble($_);
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/ev6/sub_n.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/ev6/sub_n.asm
new file mode 100644
index 00000000000..a35ba40d347
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/ev6/sub_n.asm
@@ -0,0 +1,283 @@
+dnl Alpha ev6 mpn_sub_n -- Subtract two limb vectors of the same length > 0
+dnl and store difference in a third limb vector.
+
+dnl Copyright 2000, 2003, 2005 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 EV4: ?
+C EV5: 5.4
+C EV6: 2.125
+
+C INPUT PARAMETERS
+C rp r16
+C up r17
+C vp r18
+C n r19
+C cy r20 (for mpn_add_nc)
+
+C TODO
+C Finish cleaning up cy registers r22, r23 (make them use cy0/cy1)
+C Use multi-pronged feed-in.
+C Perform additional micro-tuning
+
+C This code was written in cooperation with ev6 pipeline expert Steve Root.
+
+C Pair loads and stores where possible
+C Store pairs oct-aligned where possible (didn't need it here)
+C Stores are delayed every third cycle
+C Loads and stores are delayed by fills
+C U stays still, put code there where possible (note alternation of U1 and U0)
+C L moves because of loads and stores
+C Note dampers in L to limit damage
+
+C This odd-looking optimization expects that were having random bits in our
+C data, so that a pure zero result is unlikely. so we penalize the unlikely
+C case to help the common case.
+
+define(`u0', `r0') define(`u1', `r3')
+define(`v0', `r1') define(`v1', `r4')
+
+define(`cy0', `r20') define(`cy1', `r21')
+
+MULFUNC_PROLOGUE(mpn_sub_n mpn_sub_nc)
+
+ASM_START()
+PROLOGUE(mpn_sub_nc)
+ br r31, $entry
+EPILOGUE()
+PROLOGUE(mpn_sub_n)
+ bis r31, r31, cy0 C clear carry in
+$entry: cmpult r19, 5, r22 C L1 move counter
+ ldq u1, 0(r17) C L0 get next ones
+ ldq v1, 0(r18) C L1
+ bne r22, $Lsmall
+
+ ldq u0, 8(r17) C L0 get next ones
+ ldq v0, 8(r18) C L1
+ subq u1, v1, r5 C U0 sub two data
+
+ cmpult u1, v1, r23 C U0 did it borrow
+ ldq u1, 16(r17) C L0 get next ones
+ ldq v1, 16(r18) C L1
+
+ subq u0, v0, r8 C U1 sub two data
+ subq r5, cy0, r24 C U0 borrow in
+
+ cmpult u0, v0, r22 C U1 did it borrow
+ beq r5, $fix5f C U0 fix exact zero
+$ret5f: ldq u0, 24(r17) C L0 get next ones
+ ldq v0, 24(r18) C L1
+
+ subq r8, r23, r25 C U1 borrow from last
+ subq u1, v1, r7 C U0 sub two data
+
+ beq r8, $fix6f C U1 fix exact zero
+$ret6f: cmpult u1, v1, r23 C U0 did it borrow
+ ldq u1, 32(r17) C L0 get next ones
+ ldq v1, 32(r18) C L1
+
+ lda r17, 40(r17) C L0 move pointer
+ lda r18, 40(r18) C L1 move pointer
+
+ lda r16, -8(r16)
+ lda r19, -13(r19) C L1 move counter
+ blt r19, $Lend C U1 loop control
+
+
+C Main loop. 8-way unrolled.
+ ALIGN(16)
+$Loop: subq u0, v0, r2 C U1 sub two data
+ stq r24, 8(r16) C L0 put an answer
+ subq r7, r22, r24 C U0 borrow from last
+ stq r25, 16(r16) C L1 pair
+
+ cmpult u0, v0, cy1 C U1 did it borrow
+ beq r7, $fix7 C U0 fix exact 0
+$ret7: ldq u0, 0(r17) C L0 get next ones
+ ldq v0, 0(r18) C L1
+
+ bis r31, r31, r31 C L damp out
+ subq r2, r23, r25 C U1 borrow from last
+ bis r31, r31, r31 C L moves in L !
+ subq u1, v1, r5 C U0 sub two data
+
+ beq r2, $fix0 C U1 fix exact zero
+$ret0: cmpult u1, v1, cy0 C U0 did it borrow
+ ldq u1, 8(r17) C L0 get next ones
+ ldq v1, 8(r18) C L1
+
+ subq u0, v0, r8 C U1 sub two data
+ stq r24, 24(r16) C L0 store pair
+ subq r5, cy1, r24 C U0 borrow from last
+ stq r25, 32(r16) C L1
+
+ cmpult u0, v0, r22 C U1 did it borrow
+ beq r5, $fix1 C U0 fix exact zero
+$ret1: ldq u0, 16(r17) C L0 get next ones
+ ldq v0, 16(r18) C L1
+
+ lda r16, 64(r16) C L0 move pointer
+ subq r8, cy0, r25 C U1 borrow from last
+ lda r19, -8(r19) C L1 move counter
+ subq u1, v1, r7 C U0 sub two data
+
+ beq r8, $fix2 C U1 fix exact zero
+$ret2: cmpult u1, v1, r23 C U0 did it borrow
+ ldq u1, 24(r17) C L0 get next ones
+ ldq v1, 24(r18) C L1
+
+ subq u0, v0, r2 C U1 sub two data
+ stq r24, -24(r16) C L0 put an answer
+ subq r7, r22, r24 C U0 borrow from last
+ stq r25, -16(r16) C L1 pair
+
+ cmpult u0, v0, cy1 C U1 did it borrow
+ beq r7, $fix3 C U0 fix exact 0
+$ret3: ldq u0, 32(r17) C L0 get next ones
+ ldq v0, 32(r18) C L1
+
+ bis r31, r31, r31 C L damp out
+ subq r2, r23, r25 C U1 borrow from last
+ bis r31, r31, r31 C L moves in L !
+ subq u1, v1, r5 C U0 sub two data
+
+ beq r2, $fix4 C U1 fix exact zero
+$ret4: cmpult u1, v1, cy0 C U0 did it borrow
+ ldq u1, 40(r17) C L0 get next ones
+ ldq v1, 40(r18) C L1
+
+ subq u0, v0, r8 C U1 sub two data
+ stq r24, -8(r16) C L0 store pair
+ subq r5, cy1, r24 C U0 borrow from last
+ stq r25, 0(r16) C L1
+
+ cmpult u0, v0, r22 C U1 did it borrow
+ beq r5, $fix5 C U0 fix exact zero
+$ret5: ldq u0, 48(r17) C L0 get next ones
+ ldq v0, 48(r18) C L1
+
+ ldl r31, 256(r17) C L0 prefetch
+ subq r8, cy0, r25 C U1 borrow from last
+ ldl r31, 256(r18) C L1 prefetch
+ subq u1, v1, r7 C U0 sub two data
+
+ beq r8, $fix6 C U1 fix exact zero
+$ret6: cmpult u1, v1, r23 C U0 did it borrow
+ ldq u1, 56(r17) C L0 get next ones
+ ldq v1, 56(r18) C L1
+
+ lda r17, 64(r17) C L0 move pointer
+ bis r31, r31, r31 C U
+ lda r18, 64(r18) C L1 move pointer
+ bge r19, $Loop C U1 loop control
+C ==== main loop end
+
+$Lend: subq u0, v0, r2 C U1 sub two data
+ stq r24, 8(r16) C L0 put an answer
+ subq r7, r22, r24 C U0 borrow from last
+ stq r25, 16(r16) C L1 pair
+ cmpult u0, v0, cy1 C U1 did it borrow
+ beq r7, $fix7c C U0 fix exact 0
+$ret7c: subq r2, r23, r25 C U1 borrow from last
+ subq u1, v1, r5 C U0 sub two data
+ beq r2, $fix0c C U1 fix exact zero
+$ret0c: cmpult u1, v1, cy0 C U0 did it borrow
+ stq r24, 24(r16) C L0 store pair
+ subq r5, cy1, r24 C U0 borrow from last
+ stq r25, 32(r16) C L1
+ beq r5, $fix1c C U0 fix exact zero
+$ret1c: stq r24, 40(r16) C L0 put an answer
+ lda r16, 48(r16) C L0 move pointer
+
+ lda r19, 8(r19)
+ beq r19, $Lret
+
+ ldq u1, 0(r17)
+ ldq v1, 0(r18)
+$Lsmall:
+ lda r19, -1(r19)
+ beq r19, $Lend0
+
+ ALIGN(8)
+$Loop0: subq u1, v1, r2 C main sub
+ cmpult u1, v1, r8 C compute bw from last sub
+ ldq u1, 8(r17)
+ ldq v1, 8(r18)
+ subq r2, cy0, r5 C borrow sub
+ lda r17, 8(r17)
+ lda r18, 8(r18)
+ stq r5, 0(r16)
+ cmpult r2, cy0, cy0 C compute bw from last sub
+ lda r19, -1(r19) C decr loop cnt
+ bis r8, cy0, cy0 C combine bw from the two subs
+ lda r16, 8(r16)
+ bne r19, $Loop0
+$Lend0: subq u1, v1, r2 C main sub
+ subq r2, cy0, r5 C borrow sub
+ cmpult u1, v1, r8 C compute bw from last sub
+ cmpult r2, cy0, cy0 C compute bw from last sub
+ stq r5, 0(r16)
+ bis r8, cy0, r0 C combine bw from the two subs
+ ret r31,(r26),1
+
+ ALIGN(8)
+$Lret: lda r0, 0(cy0) C copy borrow into return register
+ ret r31,(r26),1
+
+$fix5f: bis r23, cy0, r23 C bring forward borrow
+ br r31, $ret5f
+$fix6f: bis r22, r23, r22 C bring forward borrow
+ br r31, $ret6f
+$fix0: bis cy1, r23, cy1 C bring forward borrow
+ br r31, $ret0
+$fix1: bis cy0, cy1, cy0 C bring forward borrow
+ br r31, $ret1
+$fix2: bis r22, cy0, r22 C bring forward borrow
+ br r31, $ret2
+$fix3: bis r23, r22, r23 C bring forward borrow
+ br r31, $ret3
+$fix4: bis cy1, r23, cy1 C bring forward borrow
+ br r31, $ret4
+$fix5: bis cy1, cy0, cy0 C bring forward borrow
+ br r31, $ret5
+$fix6: bis r22, cy0, r22 C bring forward borrow
+ br r31, $ret6
+$fix7: bis r23, r22, r23 C bring forward borrow
+ br r31, $ret7
+$fix0c: bis cy1, r23, cy1 C bring forward borrow
+ br r31, $ret0c
+$fix1c: bis cy0, cy1, cy0 C bring forward borrow
+ br r31, $ret1c
+$fix7c: bis r23, r22, r23 C bring forward borrow
+ br r31, $ret7c
+
+EPILOGUE()
+ASM_END()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/ev67/gcd_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/ev67/gcd_1.asm
new file mode 100644
index 00000000000..55fa7d36731
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/ev67/gcd_1.asm
@@ -0,0 +1,145 @@
+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()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/ev67/hamdist.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/ev67/hamdist.asm
new file mode 100644
index 00000000000..4b13e9f14f9
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/ev67/hamdist.asm
@@ -0,0 +1,111 @@
+dnl Alpha ev67 mpn_hamdist -- mpn hamming distance.
+
+dnl Copyright 2003, 2005 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: 2.5 cycles/limb
+
+
+C unsigned long mpn_hamdist (mp_srcptr xp, mp_srcptr yp, mp_size_t size);
+C
+C The hope was for 2.0 c/l here, but that isn't achieved. We're limited by
+C renaming register shortage. Since we need 5 instructions per limb, further
+C unrolling could approach 1.5 c/l.
+C
+C The main loop processes two limbs from each operand on each iteration. An
+C odd size is handled by processing xp[0]^yp[0] at the start. If the size
+C is even that result is discarded, and is repeated by the main loop.
+C
+
+ASM_START()
+PROLOGUE(mpn_hamdist)
+
+ C r16 xp
+ C r17 yp
+ C r18 size
+
+ ldq r1, 0(r16) C L0 xp[0]
+ ldq r2, 0(r17) C L1 yp[0]
+ and r18, 1, r8 C U1 1 if size odd
+ srl r18, 1, r18 C U0 size, limb pairs
+
+ clr r0 C L0 initial total
+ s8addq r8, r17, r17 C U1 yp++ if size odd
+ s8addq r8, r16, r16 C L1 xp++ if size odd
+ clr r6 C U0 dummy initial xor 1
+
+ xor r1, r2, r5 C L initial xor 0
+ beq r18, L(one) C U if size==1
+
+ cmoveq r8, r31, r5 C L discard first limb if size even
+ unop C U
+
+
+ ALIGN(16)
+L(top):
+ C r0 total accumulating
+ C r7 xor 0
+ C r8 xor 1
+ C r16 xp, incrementing
+ C r17 yp, incrementing
+ C r18 size, limb pairs, decrementing
+
+ ldq r1, 0(r16) C L
+ ldq r2, 0(r17) C L
+ ctpop r5, r7 C U0
+ lda r16, 16(r16) C U
+
+ ldq r3, -8(r16) C L
+ ldq r4, 8(r17) C L
+ ctpop r6, r8 C U0
+ lda r17, 16(r17) C U
+
+ ldl r31, 256(r16) C L prefetch
+ ldl r31, 256(r17) C L prefetch
+ xor r1, r2, r5 C U
+ lda r18, -1(r18) C U
+
+ xor r3, r4, r6 C U
+ addq r0, r7, r0 C L
+ addq r0, r8, r0 C L
+ bne r18, L(top) C U
+
+
+ ctpop r6, r8 C U0
+ addq r0, r8, r0 C L
+L(one):
+ ctpop r5, r7 C U0
+ addq r0, r7, r0 C L
+
+ ret r31, (r26), 1 C L0
+
+EPILOGUE()
+ASM_END()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/ev67/popcount.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/ev67/popcount.asm
new file mode 100644
index 00000000000..049c1cd2393
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/ev67/popcount.asm
@@ -0,0 +1,101 @@
+dnl Alpha ev67 mpn_popcount -- mpn bit population count.
+
+dnl Copyright 2003, 2005 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: 1.5 cycles/limb
+
+
+C unsigned long mpn_popcount (mp_srcptr src, mp_size_t size);
+C
+C This schedule seems necessary for the full 1.5 c/l, the IQ can't quite hide
+C all latencies, the addq's must be deferred to the next iteration.
+C
+C Since we need just 3 instructions per limb, further unrolling could approach
+C 1.0 c/l.
+C
+C The main loop processes two limbs at a time. An odd size is handled by
+C processing src[0] at the start. If the size is even that result is
+C discarded, and src[0] is repeated by the main loop.
+C
+
+ASM_START()
+PROLOGUE(mpn_popcount)
+
+ C r16 src
+ C r17 size
+
+ ldq r0, 0(r16) C L0 src[0]
+ and r17, 1, r8 C U1 1 if size odd
+ srl r17, 1, r17 C U0 size, limb pairs
+
+ s8addq r8, r16, r16 C L1 src++ if size odd
+ ctpop r0, r0 C U0
+ beq r17, L(one) C U1 if size==1
+
+ cmoveq r8, r31, r0 C L discard first limb if size even
+ clr r3 C L
+
+ clr r4 C L
+ unop C U
+ unop C L
+ unop C U
+
+
+ ALIGN(16)
+L(top):
+ C r0 total accumulating
+ C r3 pop 0
+ C r4 pop 1
+ C r16 src, incrementing
+ C r17 size, decrementing
+
+ ldq r1, 0(r16) C L
+ ldq r2, 8(r16) C L
+ lda r16, 16(r16) C U
+ lda r17, -1(r17) C U
+
+ addq r0, r3, r0 C L
+ addq r0, r4, r0 C L
+ ctpop r1, r3 C U0
+ ctpop r2, r4 C U0
+
+ ldl r31, 512(r16) C L prefetch
+ bne r17, L(top) C U
+
+
+ addq r0, r3, r0 C L
+ addq r0, r4, r0 C U
+L(one):
+ ret r31, (r26), 1 C L0
+
+EPILOGUE()
+ASM_END()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/gmp-mparam.h b/Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/gmp-mparam.h
new file mode 100644
index 00000000000..b850bd24b5f
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/gmp-mparam.h
@@ -0,0 +1,86 @@
+/* Alpha EV4 gmp-mparam.h -- Compiler/machine parameter header file.
+
+Copyright 1991, 1993, 1994, 1999-2002, 2004, 2005, 2009 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
+
+
+/* 175MHz 21064 */
+
+/* Generated by tuneup.c, 2009-01-15, gcc 3.2 */
+
+#define MUL_TOOM22_THRESHOLD 12
+#define MUL_TOOM33_THRESHOLD 69
+#define MUL_TOOM44_THRESHOLD 88
+
+#define SQR_BASECASE_THRESHOLD 4
+#define SQR_TOOM2_THRESHOLD 20
+#define SQR_TOOM3_THRESHOLD 62
+#define SQR_TOOM4_THRESHOLD 155
+
+#define MULLO_BASECASE_THRESHOLD 0 /* always */
+#define MULLO_DC_THRESHOLD 40
+#define MULLO_MUL_N_THRESHOLD 202
+
+#define DIV_SB_PREINV_THRESHOLD 0 /* preinv always */
+#define DIV_DC_THRESHOLD 38
+#define POWM_THRESHOLD 60
+
+#define MATRIX22_STRASSEN_THRESHOLD 17
+#define HGCD_THRESHOLD 80
+#define GCD_DC_THRESHOLD 237
+#define GCDEXT_DC_THRESHOLD 198
+#define JACOBI_BASE_METHOD 2
+
+#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_1_1_THRESHOLD 2
+#define MOD_1_2_THRESHOLD 9
+#define MOD_1_4_THRESHOLD 20
+#define USE_PREINV_DIVREM_1 1 /* preinv always */
+#define USE_PREINV_MOD_1 1 /* preinv always */
+#define DIVEXACT_1_THRESHOLD 0 /* always */
+#define MODEXACT_1_ODD_THRESHOLD 0 /* always */
+
+#define GET_STR_DC_THRESHOLD 20
+#define GET_STR_PRECOMPUTE_THRESHOLD 37
+#define SET_STR_DC_THRESHOLD 746
+#define SET_STR_PRECOMPUTE_THRESHOLD 1332
+
+#define MUL_FFT_TABLE { 240, 480, 1344, 2304, 5120, 20480, 49152, 0 }
+#define MUL_FFT_MODF_THRESHOLD 232
+#define MUL_FFT_THRESHOLD 1664
+
+#define SQR_FFT_TABLE { 240, 480, 1216, 2304, 5120, 12288, 49152, 0 }
+#define SQR_FFT_MODF_THRESHOLD 232
+#define SQR_FFT_THRESHOLD 1408
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/invert_limb.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/invert_limb.asm
new file mode 100644
index 00000000000..afc010f58c5
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/invert_limb.asm
@@ -0,0 +1,95 @@
+dnl Alpha mpn_invert_limb -- Invert a normalized limb.
+
+dnl Copyright 1996, 2000-2003, 2007, 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/limb
+C EV4: ?
+C EV5: 137/140 (with BWX/without BWX)
+C EV6: 71/72 (with BWX/without BWX)
+
+C This was compiler generated, with minimal manual edits. Surely several
+C cycles could be cut with some thought.
+
+ASM_START()
+PROLOGUE(mpn_invert_limb,gp)
+ LEA( r2, approx_tab)
+ srl r16, 54, r1
+ srl r16, 24, r4
+ and r16, 1, r5
+ bic r1, 1, r7
+ lda r4, 1(r4)
+ srl r16, 1, r3
+ addq r7, r2, r1
+ifelse(bwx_available_p,1,`
+ ldwu r0, -512(r1)
+',`
+ ldq_u r0, -512(r1)
+ extwl r0, r7, r0
+')
+ addq r3, r5, r3
+ mull r0, r0, r1
+ sll r0, 11, r0
+ mulq r1, r4, r1
+ srl r1, 40, r1
+ subq r0, r1, r0
+ lda r0, -1(r0)
+ mulq r0, r0, r2
+ sll r0, 60, r1
+ sll r0, 13, r0
+ mulq r2, r4, r2
+ subq r1, r2, r1
+ srl r1, 47, r1
+ addq r0, r1, r0
+ mulq r0, r3, r3
+ srl r0, 1, r1
+ cmoveq r5, 0, r1
+ subq r1, r3, r1
+ umulh r1, r0, r3
+ sll r0, 31, r0
+ srl r3, 1, r1
+ addq r0, r1, r0
+ mulq r0, r16, r2
+ umulh r0, r16, r3
+ addq r2, r16, r1
+ addq r3, r16, r16
+ cmpult r1, r2, r1
+ addq r16, r1, r3
+ subq r0, r3, r0
+ ret r31, (r26), 1
+EPILOGUE()
+DATASTART(approx_tab,8)
+forloop(i,256,512-1,dnl
+` .word eval(0x7fd00/i)
+')dnl
+ SIZE(approx_tab, 512)
+ TYPE(approx_tab, object)
+DATAEND()
+ASM_END()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/lshift.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/lshift.asm
new file mode 100644
index 00000000000..c62a856aea3
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/lshift.asm
@@ -0,0 +1,182 @@
+dnl Alpha mpn_lshift -- Shift a number left.
+
+dnl Copyright 1994, 1995, 2000, 2003, 2009 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 EV4: ?
+C EV5: 3.25
+C EV6: 1.75
+
+C INPUT PARAMETERS
+C rp r16
+C up r17
+C n r18
+C cnt r19
+
+
+ASM_START()
+PROLOGUE(mpn_lshift)
+ s8addq r18,r17,r17 C make r17 point at end of s1
+ ldq r4,-8(r17) C load first limb
+ subq r31,r19,r20
+ s8addq r18,r16,r16 C make r16 point at end of RES
+ subq r18,1,r18
+ and r18,4-1,r28 C number of limbs in first loop
+ srl r4,r20,r0 C compute function result
+
+ beq r28,L(L0)
+ subq r18,r28,r18
+
+ ALIGN(8)
+L(top0):
+ ldq r3,-16(r17)
+ subq r16,8,r16
+ sll r4,r19,r5
+ subq r17,8,r17
+ subq r28,1,r28
+ srl r3,r20,r6
+ bis r3,r3,r4
+ bis r5,r6,r8
+ stq r8,0(r16)
+ bne r28,L(top0)
+
+L(L0): sll r4,r19,r24
+ beq r18,L(end)
+C warm up phase 1
+ ldq r1,-16(r17)
+ subq r18,4,r18
+ ldq r2,-24(r17)
+ ldq r3,-32(r17)
+ ldq r4,-40(r17)
+C warm up phase 2
+ srl r1,r20,r7
+ sll r1,r19,r21
+ srl r2,r20,r8
+ beq r18,L(end1)
+ ldq r1,-48(r17)
+ sll r2,r19,r22
+ ldq r2,-56(r17)
+ srl r3,r20,r5
+ bis r7,r24,r7
+ sll r3,r19,r23
+ bis r8,r21,r8
+ srl r4,r20,r6
+ ldq r3,-64(r17)
+ sll r4,r19,r24
+ ldq r4,-72(r17)
+ subq r18,4,r18
+ beq r18,L(end2)
+ ALIGN(16)
+C main loop
+L(top): stq r7,-8(r16)
+ bis r5,r22,r5
+ stq r8,-16(r16)
+ bis r6,r23,r6
+
+ srl r1,r20,r7
+ subq r18,4,r18
+ sll r1,r19,r21
+ unop C ldq r31,-96(r17)
+
+ srl r2,r20,r8
+ ldq r1,-80(r17)
+ sll r2,r19,r22
+ ldq r2,-88(r17)
+
+ stq r5,-24(r16)
+ bis r7,r24,r7
+ stq r6,-32(r16)
+ bis r8,r21,r8
+
+ srl r3,r20,r5
+ unop C ldq r31,-96(r17)
+ sll r3,r19,r23
+ subq r16,32,r16
+
+ srl r4,r20,r6
+ ldq r3,-96(r17)
+ sll r4,r19,r24
+ ldq r4,-104(r17)
+
+ subq r17,32,r17
+ bne r18,L(top)
+C cool down phase 2/1
+L(end2):
+ stq r7,-8(r16)
+ bis r5,r22,r5
+ stq r8,-16(r16)
+ bis r6,r23,r6
+ srl r1,r20,r7
+ sll r1,r19,r21
+ srl r2,r20,r8
+ sll r2,r19,r22
+ stq r5,-24(r16)
+ bis r7,r24,r7
+ stq r6,-32(r16)
+ bis r8,r21,r8
+ srl r3,r20,r5
+ sll r3,r19,r23
+ srl r4,r20,r6
+ sll r4,r19,r24
+C cool down phase 2/2
+ stq r7,-40(r16)
+ bis r5,r22,r5
+ stq r8,-48(r16)
+ bis r6,r23,r6
+ stq r5,-56(r16)
+ stq r6,-64(r16)
+C cool down phase 2/3
+ stq r24,-72(r16)
+ ret r31,(r26),1
+
+C cool down phase 1/1
+L(end1):
+ sll r2,r19,r22
+ srl r3,r20,r5
+ bis r7,r24,r7
+ sll r3,r19,r23
+ bis r8,r21,r8
+ srl r4,r20,r6
+ sll r4,r19,r24
+C cool down phase 1/2
+ stq r7,-8(r16)
+ bis r5,r22,r5
+ stq r8,-16(r16)
+ bis r6,r23,r6
+ stq r5,-24(r16)
+ stq r6,-32(r16)
+ stq r24,-40(r16)
+ ret r31,(r26),1
+
+L(end): stq r24,-8(r16)
+ ret r31,(r26),1
+EPILOGUE(mpn_lshift)
+ASM_END()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/mod_34lsub1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/mod_34lsub1.asm
new file mode 100644
index 00000000000..1b03b637d8d
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/mod_34lsub1.asm
@@ -0,0 +1,164 @@
+dnl Alpha mpn_mod_34lsub1.
+
+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 cycles/limb
+C EV4: 4 (?)
+C EV5: 2.67
+C EV6: 1.67
+
+
+dnl INPUT PARAMETERS
+dnl up r16
+dnl n r17
+
+define(`l0',`r18')
+define(`l1',`r19')
+define(`l2',`r20')
+define(`a0',`r21')
+define(`a1',`r22')
+define(`a2',`r23')
+define(`c0',`r24')
+define(`c1',`r5')
+define(`c2',`r6')
+
+ASM_START()
+PROLOGUE(mpn_mod_34lsub1)
+ bis r31, r31, c0
+ bis r31, r31, c1
+ bis r31, r31, c2
+
+ lda r17, -3(r17)
+ bge r17, $L_3_or_more
+ bis r31, r31, a0
+ bis r31, r31, a1
+ bis r31, r31, a2
+ br r31, $L_012
+
+$L_3_or_more:
+ ldq a0, 0(r16)
+ ldq a1, 8(r16)
+ ldq a2, 16(r16)
+ lda r16, 24(r16)
+ lda r17, -3(r17)
+ blt r17, $L_012
+
+$L_6_or_more:
+ ldq l0, 0(r16)
+ ldq l1, 8(r16)
+ ldq l2, 16(r16)
+ addq l0, a0, a0
+
+ lda r16, 24(r16)
+ lda r17, -3(r17)
+ blt r17, $L_end
+
+ ALIGN(16)
+C Main loop
+$L_9_or_more:
+$Loop: cmpult a0, l0, r0
+ ldq l0, 0(r16)
+ addq r0, c0, c0
+ addq l1, a1, a1
+ cmpult a1, l1, r0
+ ldq l1, 8(r16)
+ addq r0, c1, c1
+ addq l2, a2, a2
+ cmpult a2, l2, r0
+ ldq l2, 16(r16)
+ addq r0, c2, c2
+ addq l0, a0, a0
+ lda r16, 24(r16)
+ lda r17, -3(r17)
+ bge r17, $Loop
+
+$L_end: cmpult a0, l0, r0
+ addq r0, c0, c0
+ addq l1, a1, a1
+ cmpult a1, l1, r0
+ addq r0, c1, c1
+ addq l2, a2, a2
+ cmpult a2, l2, r0
+ addq r0, c2, c2
+
+C Handle the last (n mod 3) limbs
+$L_012: lda r17, 2(r17)
+ blt r17, $L_0
+ ldq l0, 0(r16)
+ addq l0, a0, a0
+ cmpult a0, l0, r0
+ addq r0, c0, c0
+ beq r17, $L_0
+ ldq l1, 8(r16)
+ addq l1, a1, a1
+ cmpult a1, l1, r0
+ addq r0, c1, c1
+
+C Align and sum our 3 main accumulators and 3 carry accumulators
+$L_0: srl a0, 48, r2
+ srl a1, 32, r4
+ifdef(`HAVE_LIMB_LITTLE_ENDIAN',
+` insll a1, 2, r1', C (a1 & 0xffffffff) << 16
+` zapnot a1, 15, r25
+ sll r25, 16, r1')
+ zapnot a0, 63, r0 C a0 & 0xffffffffffff
+ srl a2, 16, a1
+ifdef(`HAVE_LIMB_LITTLE_ENDIAN',
+` inswl a2, 4, r3', C (a2 & 0xffff) << 32
+` zapnot a2, 3, r25
+ sll r25, 32, r3')
+ addq r1, r4, r1
+ addq r0, r2, r0
+ srl c0, 32, a2
+ifdef(`HAVE_LIMB_LITTLE_ENDIAN',
+` insll c0, 2, r4', C (c0 & 0xffffffff) << 16
+` zapnot c0, 15, r25
+ sll r25, 16, r4')
+ addq r0, r1, r0
+ addq r3, a1, r3
+ addq r0, r3, r0
+ srl c1, 16, c0
+ifdef(`HAVE_LIMB_LITTLE_ENDIAN',
+` inswl c1, 4, r2', C (c1 & 0xffff) << 32
+` zapnot c1, 3, r25
+ sll r25, 32, r2')
+ addq r4, a2, r4
+C srl c2, 48, r3 C This will be 0 in practise
+ zapnot c2, 63, r1 C r1 = c2 & 0xffffffffffff
+ addq r0, r4, r0
+ addq r2, c0, r2
+ addq r0, r2, r0
+C addq r1, r3, r1
+ addq r0, r1, r0
+
+ ret r31, (r26), 1
+EPILOGUE(mpn_mod_34lsub1)
+ASM_END()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/mode1o.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/mode1o.asm
new file mode 100644
index 00000000000..96dccc73ee0
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/mode1o.asm
@@ -0,0 +1,209 @@
+dnl Alpha mpn_modexact_1c_odd -- mpn exact remainder
+
+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 cycles/limb
+C EV4: 47
+C EV5: 30
+C EV6: 15
+
+
+C mp_limb_t mpn_modexact_1c_odd (mp_srcptr src, mp_size_t size, mp_limb_t d,
+C mp_limb_t c)
+C
+C This code follows the "alternate" code in mpn/generic/mode1o.c,
+C eliminating cbit+climb from the dependent chain. This leaves,
+C
+C ev4 ev5 ev6
+C 1 3 1 subq y = x - h
+C 23 13 7 mulq q = y * inverse
+C 23 14 7 umulh h = high (q * d)
+C -- -- --
+C 47 30 15
+C
+C In each case, the load latency, loop control, and extra carry bit handling
+C hide under the multiply latencies. Those latencies are long enough that
+C we don't need to worry about alignment or pairing to squeeze out
+C performance.
+C
+C For the first limb, some of the loop code is broken out and scheduled back
+C since it can be done earlier.
+C
+C - The first ldq src[0] is near the start of the routine, for maximum
+C time from memory.
+C
+C - The subq y=x-climb can be done without waiting for the inverse.
+C
+C - The mulq y*inverse is replicated after the final subq for the inverse,
+C instead of branching to the mulq in the main loop. On ev4 a branch
+C there would cost cycles, but we can hide them under the mulq latency.
+C
+C For the last limb, high<divisor is tested and if that's true a subtract
+C and addback is done, as per the main mpn/generic/mode1o.c code. This is a
+C data-dependent branch, but we're waiting for umulh so any penalty should
+C hide there. The multiplies saved would be worth the cost anyway.
+C
+C Enhancements:
+C
+C For size==1, a plain division (done bitwise say) might be faster than
+C calculating an inverse, the latter taking about 130 cycles on ev4 or 70 on
+C ev5. A call to gcc __remqu might be a possibility.
+
+ASM_START()
+PROLOGUE(mpn_modexact_1c_odd,gp)
+
+ C r16 src
+ C r17 size
+ C r18 d
+ C r19 c
+
+ LEA(r0, binvert_limb_table)
+ srl r18, 1, r20 C d >> 1
+
+ and r20, 127, r20 C idx = d>>1 & 0x7F
+
+ addq r0, r20, r21 C table + idx
+
+ifelse(bwx_available_p,1,
+` ldbu r20, 0(r21) C table[idx], inverse 8 bits
+',`
+ ldq_u r20, 0(r21) C table[idx] qword
+ extbl r20, r21, r20 C table[idx], inverse 8 bits
+')
+
+ mull r20, r20, r7 C i*i
+ addq r20, r20, r20 C 2*i
+
+ ldq r2, 0(r16) C x = s = src[0]
+ lda r17, -1(r17) C size--
+ clr r0 C initial cbit=0
+
+ mull r7, r18, r7 C i*i*d
+
+ subq r20, r7, r20 C 2*i-i*i*d, inverse 16 bits
+
+ mull r20, r20, r7 C i*i
+ addq r20, r20, r20 C 2*i
+
+ mull r7, r18, r7 C i*i*d
+
+ subq r20, r7, r20 C 2*i-i*i*d, inverse 32 bits
+
+ mulq r20, r20, r7 C i*i
+ addq r20, r20, r20 C 2*i
+
+ mulq r7, r18, r7 C i*i*d
+ subq r2, r19, r3 C y = x - climb
+
+ subq r20, r7, r20 C inv = 2*i-i*i*d, inverse 64 bits
+
+ASSERT(r7, C should have d*inv==1 mod 2^64
+` mulq r18, r20, r7
+ cmpeq r7, 1, r7')
+
+ mulq r3, r20, r4 C first q = y * inv
+
+ beq r17, L(one) C if size==1
+ br L(entry)
+
+
+L(top):
+ C r0 cbit
+ C r16 src, incrementing
+ C r17 size, decrementing
+ C r18 d
+ C r19 climb
+ C r20 inv
+
+ ldq r1, 0(r16) C s = src[i]
+ subq r1, r0, r2 C x = s - cbit
+ cmpult r1, r0, r0 C new cbit = s < cbit
+
+ subq r2, r19, r3 C y = x - climb
+
+ mulq r3, r20, r4 C q = y * inv
+L(entry):
+ cmpult r2, r19, r5 C cbit2 = x < climb
+ addq r5, r0, r0 C cbit += cbit2
+ lda r16, 8(r16) C src++
+ lda r17, -1(r17) C size--
+
+ umulh r4, r18, r19 C climb = q * d
+ bne r17, L(top) C while 2 or more limbs left
+
+
+
+ C r0 cbit
+ C r18 d
+ C r19 climb
+ C r20 inv
+
+ ldq r1, 0(r16) C s = src[size-1] high limb
+
+ cmpult r1, r18, r2 C test high<divisor
+ bne r2, L(skip) C skip if so
+
+ C can't skip a division, repeat loop code
+
+ subq r1, r0, r2 C x = s - cbit
+ cmpult r1, r0, r0 C new cbit = s < cbit
+
+ subq r2, r19, r3 C y = x - climb
+
+ mulq r3, r20, r4 C q = y * inv
+L(one):
+ cmpult r2, r19, r5 C cbit2 = x < climb
+ addq r5, r0, r0 C cbit += cbit2
+
+ umulh r4, r18, r19 C climb = q * d
+
+ addq r19, r0, r0 C return climb + cbit
+ ret r31, (r26), 1
+
+
+ ALIGN(8)
+L(skip):
+ C with high<divisor, the final step can be just (cbit+climb)-s and
+ C an addback of d if that underflows
+
+ addq r19, r0, r19 C c = climb + cbit
+
+ subq r19, r1, r2 C c - s
+ cmpult r19, r1, r3 C c < s
+
+ addq r2, r18, r0 C return c-s + divisor
+
+ cmoveq r3, r2, r0 C return c-s if no underflow
+ ret r31, (r26), 1
+
+EPILOGUE()
+ASM_END()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/mul_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/mul_1.asm
new file mode 100644
index 00000000000..a7cdbcf8ebc
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/mul_1.asm
@@ -0,0 +1,102 @@
+dnl Alpha mpn_mul_1 -- Multiply a limb vector with a limb and store
+dnl the result 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 cycles/limb
+C EV4: 42
+C EV5: 18
+C EV6: 7
+
+C INPUT PARAMETERS
+C rp r16
+C up r17
+C n r18
+C vl r19
+C cl r20
+
+
+ASM_START()
+PROLOGUE(mpn_mul_1c)
+ ldq r2,0(r17) C r2 = s1_limb
+ lda r18,-1(r18) C size--
+ mulq r2,r19,r3 C r3 = prod_low
+ umulh r2,r19,r4 C r4 = prod_high
+ beq r18,$Le1c C jump if size was == 1
+ ldq r2,8(r17) C r2 = s1_limb
+ lda r18,-1(r18) C size--
+ addq r3,r20,r3 C r3 = cy_limb + cl
+ stq r3,0(r16)
+ cmpult r3,r20,r0 C r0 = carry from (cy_limb + cl)
+ bne r18,$Loop C jump if size was == 2
+ br r31,$Le2
+$Le1c: addq r3,r20,r3 C r3 = cy_limb + cl
+ cmpult r3,r20,r0 C r0 = carry from (cy_limb + cl)
+$Le1: stq r3,0(r16)
+ addq r4,r0,r0
+ ret r31,(r26),1
+EPILOGUE(mpn_mul_1c)
+
+PROLOGUE(mpn_mul_1)
+ ldq r2,0(r17) C r2 = s1_limb
+ lda r18,-1(r18) C size--
+ mulq r2,r19,r3 C r3 = prod_low
+ bic r31,r31,r0 C clear cy_limb
+ umulh r2,r19,r4 C r4 = prod_high
+ beq r18,$Le1 C jump if size was == 1
+ ldq r2,8(r17) C r2 = s1_limb
+ lda r18,-1(r18) C size--
+ stq r3,0(r16)
+ beq r18,$Le2 C jump if size was == 2
+
+ ALIGN(8)
+$Loop: mulq r2,r19,r3 C r3 = prod_low
+ addq r4,r0,r0 C cy_limb = cy_limb + 'cy'
+ lda r18,-1(r18) C size--
+ umulh r2,r19,r4 C r4 = prod_high
+ ldq r2,16(r17) C r2 = s1_limb
+ lda r17,8(r17) C s1_ptr++
+ addq r3,r0,r3 C r3 = cy_limb + prod_low
+ stq r3,8(r16)
+ cmpult r3,r0,r0 C r0 = carry from (cy_limb + prod_low)
+ lda r16,8(r16) C res_ptr++
+ bne r18,$Loop
+
+$Le2: mulq r2,r19,r3 C r3 = prod_low
+ addq r4,r0,r0 C cy_limb = cy_limb + 'cy'
+ umulh r2,r19,r4 C r4 = prod_high
+ addq r3,r0,r3 C r3 = cy_limb + prod_low
+ cmpult r3,r0,r0 C r0 = carry from (cy_limb + prod_low)
+ stq r3,8(r16)
+ addq r4,r0,r0 C cy_limb = prod_high + cy
+ ret r31,(r26),1
+EPILOGUE(mpn_mul_1)
+ASM_END()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/rshift.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/rshift.asm
new file mode 100644
index 00000000000..6e1e2145589
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/rshift.asm
@@ -0,0 +1,180 @@
+dnl Alpha mpn_rshift -- Shift a number right.
+
+dnl Copyright 1994, 1995, 2000, 2009 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 EV4: ?
+C EV5: 3.25
+C EV6: 1.75
+
+C INPUT PARAMETERS
+C rp r16
+C up r17
+C n r18
+C cnt r19
+
+
+ASM_START()
+PROLOGUE(mpn_rshift)
+ ldq r4,0(r17) C load first limb
+ subq r31,r19,r20
+ subq r18,1,r18
+ and r18,4-1,r28 C number of limbs in first loop
+ sll r4,r20,r0 C compute function result
+
+ beq r28,L(L0)
+ subq r18,r28,r18
+
+ ALIGN(8)
+L(top0):
+ ldq r3,8(r17)
+ addq r16,8,r16
+ srl r4,r19,r5
+ addq r17,8,r17
+ subq r28,1,r28
+ sll r3,r20,r6
+ bis r3,r3,r4
+ bis r5,r6,r8
+ stq r8,-8(r16)
+ bne r28,L(top0)
+
+L(L0): srl r4,r19,r24
+ beq r18,L(end)
+C warm up phase 1
+ ldq r1,8(r17)
+ subq r18,4,r18
+ ldq r2,16(r17)
+ ldq r3,24(r17)
+ ldq r4,32(r17)
+C warm up phase 2
+ sll r1,r20,r7
+ srl r1,r19,r21
+ sll r2,r20,r8
+ beq r18,L(end1)
+ ldq r1,40(r17)
+ srl r2,r19,r22
+ ldq r2,48(r17)
+ sll r3,r20,r5
+ bis r7,r24,r7
+ srl r3,r19,r23
+ bis r8,r21,r8
+ sll r4,r20,r6
+ ldq r3,56(r17)
+ srl r4,r19,r24
+ ldq r4,64(r17)
+ subq r18,4,r18
+ beq r18,L(end2)
+ ALIGN(16)
+C main loop
+L(top): stq r7,0(r16)
+ bis r5,r22,r5
+ stq r8,8(r16)
+ bis r6,r23,r6
+
+ sll r1,r20,r7
+ subq r18,4,r18
+ srl r1,r19,r21
+ unop C ldq r31,-96(r17)
+
+ sll r2,r20,r8
+ ldq r1,72(r17)
+ srl r2,r19,r22
+ ldq r2,80(r17)
+
+ stq r5,16(r16)
+ bis r7,r24,r7
+ stq r6,24(r16)
+ bis r8,r21,r8
+
+ sll r3,r20,r5
+ unop C ldq r31,-96(r17)
+ srl r3,r19,r23
+ addq r16,32,r16
+
+ sll r4,r20,r6
+ ldq r3,88(r17)
+ srl r4,r19,r24
+ ldq r4,96(r17)
+
+ addq r17,32,r17
+ bne r18,L(top)
+C cool down phase 2/1
+L(end2):
+ stq r7,0(r16)
+ bis r5,r22,r5
+ stq r8,8(r16)
+ bis r6,r23,r6
+ sll r1,r20,r7
+ srl r1,r19,r21
+ sll r2,r20,r8
+ srl r2,r19,r22
+ stq r5,16(r16)
+ bis r7,r24,r7
+ stq r6,24(r16)
+ bis r8,r21,r8
+ sll r3,r20,r5
+ srl r3,r19,r23
+ sll r4,r20,r6
+ srl r4,r19,r24
+C cool down phase 2/2
+ stq r7,32(r16)
+ bis r5,r22,r5
+ stq r8,40(r16)
+ bis r6,r23,r6
+ stq r5,48(r16)
+ stq r6,56(r16)
+C cool down phase 2/3
+ stq r24,64(r16)
+ ret r31,(r26),1
+
+C cool down phase 1/1
+L(end1):
+ srl r2,r19,r22
+ sll r3,r20,r5
+ bis r7,r24,r7
+ srl r3,r19,r23
+ bis r8,r21,r8
+ sll r4,r20,r6
+ srl r4,r19,r24
+C cool down phase 1/2
+ stq r7,0(r16)
+ bis r5,r22,r5
+ stq r8,8(r16)
+ bis r6,r23,r6
+ stq r5,16(r16)
+ stq r6,24(r16)
+ stq r24,32(r16)
+ ret r31,(r26),1
+
+L(end): stq r24,0(r16)
+ ret r31,(r26),1
+EPILOGUE(mpn_rshift)
+ASM_END()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/sec_tabselect.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/sec_tabselect.asm
new file mode 100644
index 00000000000..679b16926ed
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/sec_tabselect.asm
@@ -0,0 +1,137 @@
+dnl Alpha mpn_sec_tabselect.
+
+dnl Contributed to the GNU project by Torbjörn Granlund.
+
+dnl Copyright 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/limb
+C EV4: ?
+C EV5: 2.25
+C EV6: 1.64
+
+define(`rp', `r16')
+define(`tp', `r17')
+define(`n', `r18')
+define(`nents', `r19')
+define(`which', `r20')
+
+define(`i', `r21')
+define(`j', `r22')
+define(`stride', `r23')
+define(`mask', `r24')
+define(`k', `r25')
+
+
+ASM_START()
+PROLOGUE(mpn_sec_tabselect)
+ subq n, 4, j C outer loop induction variable
+
+ blt j, L(outer_end)
+L(outer_top):
+ mov tp, r8
+ lda r0, 0(r31)
+ lda r1, 0(r31)
+ lda r2, 0(r31)
+ lda r3, 0(r31)
+ subq j, 4, j C outer loop induction variable
+ subq nents, which, k
+ mov nents, i
+
+ ALIGN(16)
+L(top): ldq r4, 0(tp)
+ ldq r5, 8(tp)
+ cmpeq k, i, mask
+ subq i, 1, i
+ subq r31, mask, mask
+ ldq r6, 16(tp)
+ ldq r7, 24(tp)
+ and r4, mask, r4
+ and r5, mask, r5
+ or r0, r4, r0
+ or r1, r5, r1
+ and r6, mask, r6
+ and r7, mask, r7
+ or r2, r6, r2
+ or r3, r7, r3
+ s8addq n, tp, tp
+ bne i, L(top)
+
+ stq r0, 0(rp)
+ stq r1, 8(rp)
+ stq r2, 16(rp)
+ stq r3, 24(rp)
+ addq r8, 32, tp
+ addq rp, 32, rp
+ bge j, L(outer_top)
+L(outer_end):
+
+ and n, 2, r0
+ beq r0, L(b0x)
+L(b1x): mov tp, r8
+ lda r0, 0(r31)
+ lda r1, 0(r31)
+ subq nents, which, k
+ mov nents, i
+ ALIGN(16)
+L(tp2): ldq r4, 0(tp)
+ ldq r5, 8(tp)
+ cmpeq k, i, mask
+ subq i, 1, i
+ subq r31, mask, mask
+ and r4, mask, r4
+ and r5, mask, r5
+ or r0, r4, r0
+ or r1, r5, r1
+ s8addq n, tp, tp
+ bne i, L(tp2)
+ stq r0, 0(rp)
+ stq r1, 8(rp)
+ addq r8, 16, tp
+ addq rp, 16, rp
+
+L(b0x): and n, 1, r0
+ beq r0, L(b00)
+L(b01): lda r0, 0(r31)
+ subq nents, which, k
+ mov nents, i
+ ALIGN(16)
+L(tp1): ldq r4, 0(tp)
+ cmpeq k, i, mask
+ subq i, 1, i
+ subq r31, mask, mask
+ and r4, mask, r4
+ or r0, r4, r0
+ s8addq n, tp, tp
+ bne i, L(tp1)
+ stq r0, 0(rp)
+
+L(b00): ret r31, (r26), 1
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/sqr_diag_addlsh1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/sqr_diag_addlsh1.asm
new file mode 100644
index 00000000000..ee219ef7e8e
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/sqr_diag_addlsh1.asm
@@ -0,0 +1,93 @@
+dnl Alpha mpn_sqr_diag_addlsh1.
+
+dnl Copyright 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/limb
+C EV4: ?
+C EV5: 10.2
+C EV6: 4.5
+
+C Ideally, one-way code could run at 9 c/l (limited by mulq+umulh) on ev5 and
+C about 3.75 c/l on ev6. Two-way code could run at about 3.25 c/l on ev6.
+
+C Algorithm: We allow ourselves to propagate carry to a product high word
+C without worrying for carry out, since (B-1)^2 = B^2-2B+1 has a high word of
+C B-2, i.e, will not spill. We propagate carry similarly to a product low word
+C since the problem value B-1 is a quadratic non-residue mod B, but our
+C products are squares.
+
+define(`rp', `r16')
+define(`tp', `r17')
+define(`up', `r18')
+define(`n', `r19')
+
+ASM_START()
+PROLOGUE(mpn_sqr_diag_addlsh1)
+ ldq r0, 0(up)
+ bis r31, r31, r21
+ bis r31, r31, r3
+ mulq r0, r0, r7
+ stq r7, 0(rp)
+ umulh r0, r0, r6
+ lda n, -1(n)
+
+ ALIGN(16)
+L(top): ldq r0, 8(up)
+ lda up, 8(up)
+ ldq r8, 0(tp)
+ ldq r20, 8(tp)
+ mulq r0, r0, r7
+ lda tp, 16(tp)
+ sll r8, 1, r23
+ srl r8, 63, r22
+ or r21, r23, r23
+ sll r20, 1, r24
+ addq r3, r6, r6 C cannot carry per comment above
+ or r22, r24, r24
+ addq r23, r6, r21
+ umulh r0, r0, r6
+ cmpult r21, r23, r1
+ addq r1, r7, r7 C cannot carry per comment above
+ stq r21, 8(rp)
+ addq r24, r7, r22
+ stq r22, 16(rp)
+ lda n, -1(n)
+ cmpult r22, r7, r3
+ srl r20, 63, r21
+ lda rp, 16(rp)
+ bne n, L(top)
+
+ addq r3, r6, r6 C cannot carry per comment above
+ addq r21, r6, r21
+ stq r21, 8(rp)
+ ret r31, (r26), 1
+EPILOGUE()
+ASM_END()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/sub_n.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/sub_n.asm
new file mode 100644
index 00000000000..1bb72263f85
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/sub_n.asm
@@ -0,0 +1,164 @@
+dnl Alpha mpn_sub_n -- Subtract two limb vectors of the same length > 0
+dnl and store difference in a third limb vector.
+
+dnl Copyright 1995, 1999, 2000, 2005, 2011 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 EV4: ?
+C EV5: 4.75
+C EV6: 3
+
+dnl INPUT PARAMETERS
+dnl res_ptr r16
+dnl s1_ptr r17
+dnl s2_ptr r18
+dnl size r19
+
+ASM_START()
+PROLOGUE(mpn_sub_nc)
+ bis r31,r20,r25
+ br L(com)
+EPILOGUE()
+PROLOGUE(mpn_sub_n)
+ bis r31,r31,r25 C clear cy
+L(com): subq r19,4,r19 C decr loop cnt
+ blt r19,$Lend2 C if less than 4 limbs, goto 2nd loop
+C Start software pipeline for 1st loop
+ ldq r0,0(r18)
+ ldq r4,0(r17)
+ ldq r1,8(r18)
+ ldq r5,8(r17)
+ addq r17,32,r17 C update s1_ptr
+ subq r4,r0,r28 C 1st main subtract
+ ldq r2,16(r18)
+ subq r28,r25,r20 C 1st carry subtract
+ ldq r3,24(r18)
+ cmpult r4,r0,r8 C compute cy from last subtract
+ ldq r6,-16(r17)
+ cmpult r28,r25,r25 C compute cy from last subtract
+ ldq r7,-8(r17)
+ bis r8,r25,r25 C combine cy from the two subtracts
+ subq r19,4,r19 C decr loop cnt
+ subq r5,r1,r28 C 2nd main subtract
+ addq r18,32,r18 C update s2_ptr
+ subq r28,r25,r21 C 2nd carry subtract
+ cmpult r5,r1,r8 C compute cy from last subtract
+ blt r19,$Lend1 C if less than 4 limbs remain, jump
+C 1st loop handles groups of 4 limbs in a software pipeline
+ ALIGN(16)
+$Loop: cmpult r28,r25,r25 C compute cy from last subtract
+ ldq r0,0(r18)
+ bis r8,r25,r25 C combine cy from the two subtracts
+ ldq r1,8(r18)
+ subq r6,r2,r28 C 3rd main subtract
+ ldq r4,0(r17)
+ subq r28,r25,r22 C 3rd carry subtract
+ ldq r5,8(r17)
+ cmpult r6,r2,r8 C compute cy from last subtract
+ cmpult r28,r25,r25 C compute cy from last subtract
+ stq r20,0(r16)
+ bis r8,r25,r25 C combine cy from the two subtracts
+ stq r21,8(r16)
+ subq r7,r3,r28 C 4th main subtract
+ subq r28,r25,r23 C 4th carry subtract
+ cmpult r7,r3,r8 C compute cy from last subtract
+ cmpult r28,r25,r25 C compute cy from last subtract
+ addq r17,32,r17 C update s1_ptr
+ bis r8,r25,r25 C combine cy from the two subtracts
+ addq r16,32,r16 C update res_ptr
+ subq r4,r0,r28 C 1st main subtract
+ ldq r2,16(r18)
+ subq r28,r25,r20 C 1st carry subtract
+ ldq r3,24(r18)
+ cmpult r4,r0,r8 C compute cy from last subtract
+ ldq r6,-16(r17)
+ cmpult r28,r25,r25 C compute cy from last subtract
+ ldq r7,-8(r17)
+ bis r8,r25,r25 C combine cy from the two subtracts
+ subq r19,4,r19 C decr loop cnt
+ stq r22,-16(r16)
+ subq r5,r1,r28 C 2nd main subtract
+ stq r23,-8(r16)
+ subq r28,r25,r21 C 2nd carry subtract
+ addq r18,32,r18 C update s2_ptr
+ cmpult r5,r1,r8 C compute cy from last subtract
+ bge r19,$Loop
+C Finish software pipeline for 1st loop
+$Lend1: cmpult r28,r25,r25 C compute cy from last subtract
+ bis r8,r25,r25 C combine cy from the two subtracts
+ subq r6,r2,r28 C cy add
+ subq r28,r25,r22 C 3rd main subtract
+ cmpult r6,r2,r8 C compute cy from last subtract
+ cmpult r28,r25,r25 C compute cy from last subtract
+ stq r20,0(r16)
+ bis r8,r25,r25 C combine cy from the two subtracts
+ stq r21,8(r16)
+ subq r7,r3,r28 C cy add
+ subq r28,r25,r23 C 4th main subtract
+ cmpult r7,r3,r8 C compute cy from last subtract
+ cmpult r28,r25,r25 C compute cy from last subtract
+ bis r8,r25,r25 C combine cy from the two subtracts
+ addq r16,32,r16 C update res_ptr
+ stq r22,-16(r16)
+ stq r23,-8(r16)
+$Lend2: addq r19,4,r19 C restore loop cnt
+ beq r19,$Lret
+C Start software pipeline for 2nd loop
+ ldq r0,0(r18)
+ ldq r4,0(r17)
+ subq r19,1,r19
+ beq r19,$Lend0
+C 2nd loop handles remaining 1-3 limbs
+ ALIGN(16)
+$Loop0: subq r4,r0,r28 C main subtract
+ cmpult r4,r0,r8 C compute cy from last subtract
+ ldq r0,8(r18)
+ ldq r4,8(r17)
+ subq r28,r25,r20 C carry subtract
+ addq r18,8,r18
+ addq r17,8,r17
+ stq r20,0(r16)
+ cmpult r28,r25,r25 C compute cy from last subtract
+ subq r19,1,r19 C decr loop cnt
+ bis r8,r25,r25 C combine cy from the two subtracts
+ addq r16,8,r16
+ bne r19,$Loop0
+$Lend0: subq r4,r0,r28 C main subtract
+ subq r28,r25,r20 C carry subtract
+ cmpult r4,r0,r8 C compute cy from last subtract
+ cmpult r28,r25,r25 C compute cy from last subtract
+ stq r20,0(r16)
+ bis r8,r25,r25 C combine cy from the two subtracts
+
+$Lret: bis r25,r31,r0 C return cy
+ ret r31,(r26),1
+EPILOGUE()
+ASM_END()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/submul_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/submul_1.asm
new file mode 100644
index 00000000000..2b63b52fa40
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/submul_1.asm
@@ -0,0 +1,99 @@
+dnl Alpha mpn_submul_1 -- Multiply a limb vector with a limb and subtract
+dnl the result 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 cycles/limb
+C EV4: 42
+C EV5: 18
+C EV6: 7
+
+C INPUT PARAMETERS
+C rp r16
+C up r17
+C n r18
+C limb r19
+
+
+ASM_START()
+PROLOGUE(mpn_submul_1)
+ ldq r2,0(r17) C r2 = s1_limb
+ addq r17,8,r17 C s1_ptr++
+ subq r18,1,r18 C size--
+ mulq r2,r19,r3 C r3 = prod_low
+ ldq r5,0(r16) C r5 = *res_ptr
+ umulh r2,r19,r0 C r0 = prod_high
+ beq r18,$Lend1 C jump if size was == 1
+ ldq r2,0(r17) C r2 = s1_limb
+ addq r17,8,r17 C s1_ptr++
+ subq r18,1,r18 C size--
+ subq r5,r3,r3
+ cmpult r5,r3,r4
+ stq r3,0(r16)
+ addq r16,8,r16 C res_ptr++
+ beq r18,$Lend2 C jump if size was == 2
+
+ ALIGN(8)
+$Loop: mulq r2,r19,r3 C r3 = prod_low
+ ldq r5,0(r16) C r5 = *res_ptr
+ addq r4,r0,r0 C cy_limb = cy_limb + 'cy'
+ subq r18,1,r18 C size--
+ umulh r2,r19,r4 C r4 = cy_limb
+ ldq r2,0(r17) C r2 = s1_limb
+ addq r17,8,r17 C s1_ptr++
+ addq r3,r0,r3 C r3 = cy_limb + prod_low
+ cmpult r3,r0,r0 C r0 = carry from (cy_limb + prod_low)
+ subq r5,r3,r3
+ cmpult r5,r3,r5
+ stq r3,0(r16)
+ addq r16,8,r16 C res_ptr++
+ addq r5,r0,r0 C combine carries
+ bne r18,$Loop
+
+$Lend2: mulq r2,r19,r3 C r3 = prod_low
+ ldq r5,0(r16) C r5 = *res_ptr
+ addq r4,r0,r0 C cy_limb = cy_limb + 'cy'
+ umulh r2,r19,r4 C r4 = cy_limb
+ addq r3,r0,r3 C r3 = cy_limb + prod_low
+ cmpult r3,r0,r0 C r0 = carry from (cy_limb + prod_low)
+ subq r5,r3,r3
+ cmpult r5,r3,r5
+ stq r3,0(r16)
+ addq r5,r0,r0 C combine carries
+ addq r4,r0,r0 C cy_limb = prod_high + cy
+ ret r31,(r26),1
+$Lend1: subq r5,r3,r3
+ cmpult r5,r3,r5
+ stq r3,0(r16)
+ addq r0,r5,r0
+ ret r31,(r26),1
+EPILOGUE(mpn_submul_1)
+ASM_END()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/umul.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/umul.asm
new file mode 100644
index 00000000000..039081ed482
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/umul.asm
@@ -0,0 +1,44 @@
+dnl mpn_umul_ppmm -- 1x1->2 limb multiplication
+
+dnl Copyright 1999, 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 mp_limb_t mpn_umul_ppmm (mp_limb_t *lowptr, mp_limb_t m1, mp_limb_t m2);
+C
+
+ASM_START()
+PROLOGUE(mpn_umul_ppmm)
+ mulq r17, r18, r1
+ umulh r17, r18, r0
+ stq r1, 0(r16)
+ ret r31, (r26), 1
+EPILOGUE()
+ASM_END()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/unicos.m4 b/Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/unicos.m4
new file mode 100644
index 00000000000..e05cf5cca66
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/alpha/unicos.m4
@@ -0,0 +1,131 @@
+divert(-1)
+
+dnl m4 macros for alpha assembler on unicos.
+
+
+dnl Copyright 2000, 2002-2004, 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/.
+
+
+dnl Note that none of the standard GMP_ASM_ autoconf tests are done for
+dnl unicos, so none of the config.m4 results can be used here.
+
+dnl No underscores on unicos
+define(`GSYM_PREFIX')
+
+define(`ASM_START',
+m4_assert_numargs(0)
+` .ident dummy')
+
+define(`X',
+m4_assert_numargs(1)
+`^X$1')
+
+define(`FLOAT64',
+m4_assert_numargs(2)
+` .psect $1@crud,data
+$1: .t_floating $2
+ .endp')
+
+dnl Called: PROLOGUE_cpu(GSYM_PREFIX`'foo[,gp|noalign])
+dnl EPILOGUE_cpu(GSYM_PREFIX`'foo)
+
+define(`PROLOGUE_cpu',
+m4_assert_numargs_range(1,2)
+`ifelse(`$2',gp,,
+`ifelse(`$2',noalign,,
+`ifelse(`$2',,,`m4_error(`Unrecognised PROLOGUE parameter
+')')')')dnl
+ .stack 192 ; What does this mean? Only Cray knows.
+ .psect $1@code,code,cache
+$1::')
+
+define(`EPILOGUE_cpu',
+m4_assert_numargs(1)
+` .endp')
+
+
+dnl Usage: LDGP(dst,src)
+dnl
+dnl Emit an "ldgp dst,src", but only on systems using a GOT (which unicos
+dnl doesn't).
+
+define(LDGP,
+m4_assert_numargs(2)
+)
+
+
+dnl Usage: EXTERN(variable_name)
+define(`EXTERN',
+m4_assert_numargs(1)
+` .extern $1')
+
+define(`DATASTART',
+m4_assert_numargs_range(1,2)
+` .psect $1@crud,data
+ ALIGN(ifelse($#,1,2,$2))
+$1:')
+
+define(`DATAEND',
+m4_assert_numargs(0)
+` .endp')
+
+define(`ASM_END',
+m4_assert_numargs(0)
+` .end')
+
+define(`cvttqc',
+m4_assert_numargs(-1)
+`cvttq/c')
+
+dnl Load a symbolic address into a register
+define(`LEA',
+m4_assert_numargs(2)
+ `laum $1, $2(r31)
+ sll $1, 32, $1
+ lalm $1, $2($1)
+ lal $1, $2($1)')
+
+
+dnl Usage: ALIGN(bytes)
+dnl
+dnl Unicos assembler .align emits zeros, even in code segments, so disable
+dnl aligning.
+dnl
+dnl GCC uses a macro emiting nops until the desired alignment is reached
+dnl (see unicosmk_file_start in alpha.c). Could do something like that if
+dnl we cared. The maximum desired alignment must be established at the
+dnl start of the section though, since of course emitting nops only
+dnl advances relative to the section beginning.
+
+define(`ALIGN',
+m4_assert_numargs(1)
+)
+
+
+divert
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/README b/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/README
new file mode 100644
index 00000000000..598baa3f2e3
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/README
@@ -0,0 +1,35 @@
+Copyright 2002, 2012 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/.
+
+
+
+
+
+This directory contains mpn functions for ARM processors. It has been
+optimised for Cortex-A9, but the code in the top-level directory should run
+on all ARM processors at architecture level v4 or later.
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/aors_n.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/aors_n.asm
new file mode 100644
index 00000000000..fdad9f7ba68
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/aors_n.asm
@@ -0,0 +1,112 @@
+dnl ARM mpn_add_n and mpn_sub_n
+
+dnl Contributed to the GNU project by Robert Harley.
+
+dnl Copyright 1997, 2000, 2001, 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/limb
+C StrongARM ?
+C XScale ?
+C Cortex-A7 ?
+C Cortex-A8 ?
+C Cortex-A9 2.5 slightly fluctuating
+C Cortex-A15 2.25
+
+define(`rp', `r0')
+define(`up', `r1')
+define(`vp', `r2')
+define(`n', `r3')
+
+ifdef(`OPERATION_add_n', `
+ define(`ADDSUB', adds)
+ define(`ADDSUBC', adcs)
+ define(`CLRCY', `cmn r0, #0')
+ define(`SETCY', `cmp $1, #1')
+ define(`RETVAL', `adc r0, n, #0')
+ define(`func', mpn_add_n)
+ define(`func_nc', mpn_add_nc)')
+ifdef(`OPERATION_sub_n', `
+ define(`ADDSUB', subs)
+ define(`ADDSUBC', sbcs)
+ define(`CLRCY', `cmp r0, r0')
+ define(`SETCY', `rsbs $1, $1, #0')
+ define(`RETVAL', `sbc r0, r0, r0
+ and r0, r0, #1')
+ define(`func', mpn_sub_n)
+ define(`func_nc', mpn_sub_nc)')
+
+MULFUNC_PROLOGUE(mpn_add_n mpn_add_nc mpn_sub_n mpn_sub_nc)
+
+ASM_START()
+PROLOGUE(func_nc)
+ ldr r12, [sp, #0]
+ stmfd sp!, { r8, r9, lr }
+ SETCY( r12)
+ b L(ent)
+EPILOGUE()
+PROLOGUE(func)
+ stmfd sp!, { r8, r9, lr }
+ CLRCY( r12)
+L(ent): tst n, #1
+ beq L(skip1)
+ ldr r12, [up], #4
+ ldr lr, [vp], #4
+ ADDSUBC r12, r12, lr
+ str r12, [rp], #4
+L(skip1):
+ tst n, #2
+ beq L(skip2)
+ ldmia up!, { r8, r9 }
+ ldmia vp!, { r12, lr }
+ ADDSUBC r8, r8, r12
+ ADDSUBC r9, r9, lr
+ stmia rp!, { r8, r9 }
+L(skip2):
+ bics n, n, #3
+ beq L(rtn)
+ stmfd sp!, { r4, r5, r6, r7 }
+
+L(top): ldmia up!, { r4, r5, r6, r7 }
+ ldmia vp!, { r8, r9, r12, lr }
+ ADDSUBC r4, r4, r8
+ sub n, n, #4
+ ADDSUBC r5, r5, r9
+ ADDSUBC r6, r6, r12
+ ADDSUBC r7, r7, lr
+ stmia rp!, { r4, r5, r6, r7 }
+ teq n, #0
+ bne L(top)
+
+ ldmfd sp!, { r4, r5, r6, r7 }
+
+L(rtn): RETVAL
+ ldmfd sp!, { r8, r9, pc }
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/aorslsh1_n.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/aorslsh1_n.asm
new file mode 100644
index 00000000000..1cbd4ba1af4
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/aorslsh1_n.asm
@@ -0,0 +1,167 @@
+dnl ARM mpn_addlsh1_n and mpn_sublsh1_n
+
+dnl Contributed to the GNU project by Torbjörn Granlund.
+
+dnl Copyright 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 addlsh1_n sublsh1_n
+C cycles/limb cycles/limb
+C StrongARM ? ?
+C XScale ? ?
+C Cortex-A7 ? ?
+C Cortex-A8 ? ?
+C Cortex-A9 3.12 3.7
+C Cortex-A15 ? ?
+
+C TODO
+C * The addlsh1_n code runs well, but is only barely faster than mpn_addmul_1.
+C The sublsh1_n code could surely be tweaked, its REVCY slows down things
+C very much. If two insns are really needed, it might help to separate them
+C for better micro-parallelism.
+
+define(`rp', `r0')
+define(`up', `r1')
+define(`vp', `r2')
+define(`n', `r3')
+
+ifdef(`OPERATION_addlsh1_n', `
+ define(`ADDSUB', adds)
+ define(`ADDSUBC', adcs)
+ define(`SETCY', `cmp $1, #1')
+ define(`RETVAL', `adc r0, $1, #2')
+ define(`SAVECY', `sbc $1, $2, #0')
+ define(`RESTCY', `cmn $1, #1')
+ define(`REVCY', `')
+ define(`INICYR', `mov $1, #0')
+ define(`r10r11', `r11')
+ define(`func', mpn_addlsh1_n)
+ define(`func_nc', mpn_addlsh1_nc)')
+ifdef(`OPERATION_sublsh1_n', `
+ define(`ADDSUB', subs)
+ define(`ADDSUBC', sbcs)
+ define(`SETCY', `rsbs $1, $1, #0')
+ define(`RETVAL', `adc r0, $1, #1')
+ define(`SAVECY', `sbc $1, $1, $1')
+ define(`RESTCY', `cmn $1, #1')
+ define(`REVCY', `sbc $1, $1, $1
+ cmn $1, #1')
+ define(`INICYR', `mvn $1, #0')
+ define(`r10r11', `r10')
+ define(`func', mpn_sublsh1_n)
+ define(`func_nc', mpn_sublsh1_nc)')
+
+MULFUNC_PROLOGUE(mpn_addlsh1_n mpn_sublsh1_n)
+
+ASM_START()
+PROLOGUE(func)
+ push {r4-r10r11, r14}
+
+ifdef(`OPERATION_addlsh1_n', `
+ mvn r11, #0
+')
+ INICYR( r14)
+ subs n, n, #3
+ blt L(le2) C carry clear on branch path
+
+ cmn r0, #0 C clear carry
+ ldmia vp!, {r8, r9, r10}
+ b L(mid)
+
+L(top): RESTCY( r14)
+ ADDSUBC r4, r4, r8
+ ADDSUBC r5, r5, r9
+ ADDSUBC r6, r6, r10
+ ldmia vp!, {r8, r9, r10}
+ stmia rp!, {r4, r5, r6}
+ REVCY(r14)
+ adcs r8, r8, r8
+ adcs r9, r9, r9
+ adcs r10, r10, r10
+ ldmia up!, {r4, r5, r6}
+ SAVECY( r14, r11)
+ subs n, n, #3
+ blt L(exi)
+ RESTCY( r12)
+ ADDSUBC r4, r4, r8
+ ADDSUBC r5, r5, r9
+ ADDSUBC r6, r6, r10
+ ldmia vp!, {r8, r9, r10}
+ stmia rp!, {r4, r5, r6}
+ REVCY(r12)
+L(mid): adcs r8, r8, r8
+ adcs r9, r9, r9
+ adcs r10, r10, r10
+ ldmia up!, {r4, r5, r6}
+ SAVECY( r12, r11)
+ subs n, n, #3
+ bge L(top)
+
+ mov r7, r12 C swap alternating...
+ mov r12, r14 C ...carry-save...
+ mov r14, r7 C ...registers
+
+L(exi): RESTCY( r12)
+ ADDSUBC r4, r4, r8
+ ADDSUBC r5, r5, r9
+ ADDSUBC r6, r6, r10
+ stmia rp!, {r4, r5, r6}
+
+ REVCY(r12)
+L(le2): tst n, #1 C n = {-1,-2,-3} map to [2], [1], [0]
+ beq L(e1)
+
+L(e02): tst n, #2
+ beq L(rt0)
+ ldm vp, {r8, r9}
+ adcs r8, r8, r8
+ adcs r9, r9, r9
+ ldm up, {r4, r5}
+ SAVECY( r12, r11)
+ RESTCY( r14)
+ ADDSUBC r4, r4, r8
+ ADDSUBC r5, r5, r9
+ stm rp, {r4, r5}
+ b L(rt1)
+
+L(e1): ldr r8, [vp]
+ adcs r8, r8, r8
+ ldr r4, [up]
+ SAVECY( r12, r11)
+ RESTCY( r14)
+ ADDSUBC r4, r4, r8
+ str r4, [rp]
+
+L(rt1): mov r14, r12
+ REVCY(r12)
+L(rt0): RETVAL( r14)
+ pop {r4-r10r11, r14}
+ bx r14
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/aorsmul_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/aorsmul_1.asm
new file mode 100644
index 00000000000..b02fbb3b2a0
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/aorsmul_1.asm
@@ -0,0 +1,135 @@
+dnl ARM mpn_addmul_1 and mpn_submul_1.
+
+dnl Copyright 1998, 2000, 2001, 2003, 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/limb
+C StrongARM: ?
+C XScale ?
+C Cortex-A7 ?
+C Cortex-A8 ?
+C Cortex-A9 5.25
+C Cortex-A15 4
+
+define(`rp', `r0')
+define(`up', `r1')
+define(`n', `r2')
+define(`vl', `r3')
+define(`rl', `r12')
+define(`ul', `r6')
+define(`r', `lr')
+
+ifdef(`OPERATION_addmul_1', `
+ define(`ADDSUB', adds)
+ define(`ADDSUBC', adcs)
+ define(`CLRRCY', `mov $1, #0
+ adds r0, r0, #0')
+ define(`RETVAL', `adc r0, r4, #0')
+ define(`func', mpn_addmul_1)')
+ifdef(`OPERATION_submul_1', `
+ define(`ADDSUB', subs)
+ define(`ADDSUBC', sbcs)
+ define(`CLRRCY', `subs $1, r0, r0')
+ define(`RETVAL', `sbc r0, r0, r0
+ sub r0, $1, r0')
+ define(`func', mpn_submul_1)')
+
+MULFUNC_PROLOGUE(mpn_addmul_1 mpn_submul_1)
+
+ASM_START()
+PROLOGUE(func)
+ stmfd sp!, { r4-r6, lr }
+ CLRRCY( r4)
+ tst n, #1
+ beq L(skip1)
+ ldr ul, [up], #4
+ ldr rl, [rp, #0]
+ umull r5, r4, ul, vl
+ ADDSUB r, rl, r5
+ str r, [rp], #4
+L(skip1):
+ tst n, #2
+ beq L(skip2)
+ ldr ul, [up], #4
+ ldr rl, [rp, #0]
+ mov r5, #0
+ umlal r4, r5, ul, vl
+ ldr ul, [up], #4
+ ADDSUBC r, rl, r4
+ ldr rl, [rp, #4]
+ mov r4, #0
+ umlal r5, r4, ul, vl
+ str r, [rp], #4
+ ADDSUBC r, rl, r5
+ str r, [rp], #4
+L(skip2):
+ bics n, n, #3
+ beq L(rtn)
+
+ ldr ul, [up], #4
+ ldr rl, [rp, #0]
+ mov r5, #0
+ umlal r4, r5, ul, vl
+ b L(in)
+
+L(top): ldr ul, [up], #4
+ ADDSUBC r, rl, r5
+ ldr rl, [rp, #4]
+ mov r5, #0
+ umlal r4, r5, ul, vl
+ str r, [rp], #4
+L(in): ldr ul, [up], #4
+ ADDSUBC r, rl, r4
+ ldr rl, [rp, #4]
+ mov r4, #0
+ umlal r5, r4, ul, vl
+ str r, [rp], #4
+ ldr ul, [up], #4
+ ADDSUBC r, rl, r5
+ ldr rl, [rp, #4]
+ mov r5, #0
+ umlal r4, r5, ul, vl
+ str r, [rp], #4
+ ldr ul, [up], #4
+ ADDSUBC r, rl, r4
+ ldr rl, [rp, #4]
+ mov r4, #0
+ umlal r5, r4, ul, vl
+ sub n, n, #4
+ tst n, n
+ str r, [rp], #4
+ bne L(top)
+
+ ADDSUBC r, rl, r5
+ str r, [rp]
+
+L(rtn): RETVAL( r4)
+ ldmfd sp!, { r4-r6, pc }
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/arm-defs.m4 b/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/arm-defs.m4
new file mode 100644
index 00000000000..6ca964a2459
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/arm-defs.m4
@@ -0,0 +1,91 @@
+divert(-1)
+
+dnl m4 macros for ARM assembler.
+
+dnl Copyright 2001, 2012, 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/.
+
+
+dnl Standard commenting is with @, the default m4 # is for constants and we
+dnl don't want to disable macro expansions in or after them.
+
+changecom(@&*$)
+
+
+dnl APCS register names.
+
+deflit(a1,r0)
+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)
+deflit(sb,r9)
+deflit(v7,r10)
+deflit(sl,r10)
+deflit(fp,r11)
+deflit(ip,r12)
+deflit(sp,r13)
+deflit(lr,r14)
+deflit(pc,r15)
+
+
+define(`lea_list', `')
+define(`lea_num',0)
+
+dnl LEA(reg,gmp_symbol)
+dnl
+dnl Load the address of gmp_symbol into a register. The gmp_symbol must be
+dnl either local or protected/hidden, since we assume it has a fixed distance
+dnl from the point of use.
+
+define(`LEA',`dnl
+ldr $1, L(ptr`'lea_num)
+ifdef(`PIC',dnl
+`dnl
+L(bas`'lea_num):dnl
+ add $1, $1, pc`'dnl
+ m4append(`lea_list',`
+L(ptr'lea_num`): .word GSYM_PREFIX`'$2-L(bas'lea_num`)-8')
+ define(`lea_num', eval(lea_num+1))dnl
+',`dnl
+ m4append(`lea_list',`
+L(ptr'lea_num`): .word GSYM_PREFIX`'$2')
+ define(`lea_num', eval(lea_num+1))dnl
+')dnl
+')
+
+define(`EPILOGUE_cpu',
+`lea_list
+ SIZE(`$1',.-`$1')')
+
+divert
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/bdiv_dbm1c.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/bdiv_dbm1c.asm
new file mode 100644
index 00000000000..ec3de50e8e2
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/bdiv_dbm1c.asm
@@ -0,0 +1,113 @@
+dnl ARM mpn_bdiv_dbm1c.
+
+dnl Copyright 2008, 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/limb
+C StrongARM ?
+C XScale ?
+C Cortex-A7 ?
+C Cortex-A8 ?
+C Cortex-A9 4.25
+C Cortex-A15 2.5
+
+C TODO
+C * Try using umlal or umaal.
+C * Try using ldm/stm.
+
+define(`qp', `r0')
+define(`up', `r1')
+define(`n', `r2')
+define(`bd', `r3')
+define(`cy', `sp,#0')
+
+ASM_START()
+ TEXT
+ ALIGN(16)
+PROLOGUE(mpn_bdiv_dbm1c)
+ push {r4, r5, r6, r7, r8}
+ ldr r4, [up], #4
+ ldr r5, [sp, #20]
+ ands r12, n, #3
+ beq L(fi0)
+ cmp r12, #2
+ bcc L(fi1)
+ beq L(fi2)
+
+L(fi3): umull r8, r12, r4, bd
+ ldr r4, [up], #4
+ b L(lo3)
+
+L(fi0): umull r6, r7, r4, bd
+ ldr r4, [up], #4
+ b L(lo0)
+
+L(fi1): subs n, n, #1
+ umull r8, r12, r4, bd
+ bls L(wd1)
+ ldr r4, [up], #4
+ b L(lo1)
+
+L(fi2): umull r6, r7, r4, bd
+ ldr r4, [up], #4
+ b L(lo2)
+
+L(top): ldr r4, [up], #4
+ subs r5, r5, r6
+ str r5, [qp], #4
+ sbc r5, r5, r7
+L(lo1): umull r6, r7, r4, bd
+ ldr r4, [up], #4
+ subs r5, r5, r8
+ str r5, [qp], #4
+ sbc r5, r5, r12
+L(lo0): umull r8, r12, r4, bd
+ ldr r4, [up], #4
+ subs r5, r5, r6
+ str r5, [qp], #4
+ sbc r5, r5, r7
+L(lo3): umull r6, r7, r4, bd
+ ldr r4, [up], #4
+ subs r5, r5, r8
+ str r5, [qp], #4
+ sbc r5, r5, r12
+L(lo2): subs n, n, #4
+ umull r8, r12, r4, bd
+ bhi L(top)
+
+L(wd2): subs r5, r5, r6
+ str r5, [qp], #4
+ sbc r5, r5, r7
+L(wd1): subs r5, r5, r8
+ str r5, [qp]
+ sbc r0, r5, r12
+ pop {r4, r5, r6, r7, r8}
+ bx lr
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/cnd_aors_n.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/cnd_aors_n.asm
new file mode 100644
index 00000000000..e8eb60983af
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/cnd_aors_n.asm
@@ -0,0 +1,134 @@
+dnl ARM mpn_cnd_add_n, mpn_cnd_sub_n
+
+dnl Copyright 2012, 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/limb
+C StrongARM ?
+C XScale ?
+C Cortex-A7 ?
+C Cortex-A8 ?
+C Cortex-A9 3
+C Cortex-A15 2.5
+
+define(`cnd', `r0')
+define(`rp', `r1')
+define(`up', `r2')
+define(`vp', `r3')
+
+define(`n', `r12')
+
+
+ifdef(`OPERATION_cnd_add_n', `
+ define(`ADDSUB', adds)
+ define(`ADDSUBC', adcs)
+ define(`INITCY', `cmn r0, #0')
+ define(`RETVAL', `adc r0, n, #0')
+ define(func, mpn_cnd_add_n)')
+ifdef(`OPERATION_cnd_sub_n', `
+ define(`ADDSUB', subs)
+ define(`ADDSUBC', sbcs)
+ define(`INITCY', `cmp r0, #0')
+ define(`RETVAL', `adc r0, n, #0
+ rsb r0, r0, #1')
+ define(func, mpn_cnd_sub_n)')
+
+MULFUNC_PROLOGUE(mpn_cnd_add_n mpn_cnd_sub_n)
+
+ASM_START()
+PROLOGUE(func)
+ push {r4-r11}
+ ldr n, [sp, #32]
+
+ cmp cnd, #1
+ sbc cnd, cnd, cnd C conditionally set to 0xffffffff
+
+ INITCY C really only needed for n = 0 (mod 4)
+
+ ands r4, n, #3
+ beq L(top)
+ cmp r4, #2
+ bcc L(b1)
+ beq L(b2)
+
+L(b3): ldm vp!, {r4,r5,r6}
+ ldm up!, {r8,r9,r10}
+ bic r4, r4, cnd
+ bic r5, r5, cnd
+ bic r6, r6, cnd
+ ADDSUB r8, r8, r4
+ ADDSUBC r9, r9, r5
+ ADDSUBC r10, r10, r6
+ stm rp!, {r8,r9,r10}
+ sub n, n, #3
+ teq n, #0
+ bne L(top)
+ b L(end)
+
+L(b2): ldm vp!, {r4,r5}
+ ldm up!, {r8,r9}
+ bic r4, r4, cnd
+ bic r5, r5, cnd
+ ADDSUB r8, r8, r4
+ ADDSUBC r9, r9, r5
+ stm rp!, {r8,r9}
+ sub n, n, #2
+ teq n, #0
+ bne L(top)
+ b L(end)
+
+L(b1): ldr r4, [vp], #4
+ ldr r8, [up], #4
+ bic r4, r4, cnd
+ ADDSUB r8, r8, r4
+ str r8, [rp], #4
+ sub n, n, #1
+ teq n, #0
+ beq L(end)
+
+L(top): ldm vp!, {r4,r5,r6,r7}
+ ldm up!, {r8,r9,r10,r11}
+ bic r4, r4, cnd
+ bic r5, r5, cnd
+ bic r6, r6, cnd
+ bic r7, r7, cnd
+ ADDSUBC r8, r8, r4
+ ADDSUBC r9, r9, r5
+ ADDSUBC r10, r10, r6
+ ADDSUBC r11, r11, r7
+ sub n, n, #4
+ stm rp!, {r8,r9,r10,r11}
+ teq n, #0
+ bne L(top)
+
+L(end): RETVAL
+ pop {r4-r11}
+ bx r14
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/com.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/com.asm
new file mode 100644
index 00000000000..42f8e3cbbe3
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/com.asm
@@ -0,0 +1,75 @@
+dnl ARM mpn_com.
+
+dnl Copyright 2003, 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/limb
+C StrongARM ?
+C XScale ?
+C Cortex-A7 ?
+C Cortex-A8 ?
+C Cortex-A9 2.0
+C Cortex-A15 1.75
+
+define(`rp', `r0')
+define(`up', `r1')
+define(`n', `r2')
+
+ASM_START()
+PROLOGUE(mpn_com)
+ tst n, #1
+ beq L(skip1)
+ ldr r3, [up], #4
+ mvn r3, r3
+ str r3, [rp], #4
+L(skip1):
+ tst n, #2
+ beq L(skip2)
+ ldmia up!, { r3, r12 } C load 2 limbs
+ mvn r3, r3
+ mvn r12, r12
+ stmia rp!, { r3, r12 } C store 2 limbs
+L(skip2):
+ bics n, n, #3
+ beq L(rtn)
+ stmfd sp!, { r7, r8, r9 } C save regs on stack
+
+L(top): ldmia up!, { r3, r8, r9, r12 } C load 4 limbs
+ subs n, n, #4
+ mvn r3, r3
+ mvn r8, r8
+ mvn r9, r9
+ mvn r12, r12
+ stmia rp!, { r3, r8, r9, r12 } C store 4 limbs
+ bne L(top)
+
+ ldmfd sp!, { r7, r8, r9 } C restore regs from stack
+L(rtn): bx lr
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/copyd.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/copyd.asm
new file mode 100644
index 00000000000..3ea2035099d
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/copyd.asm
@@ -0,0 +1,84 @@
+dnl ARM mpn_copyd.
+
+dnl Contributed to the GNU project by Robert Harley and Torbjörn Granlund.
+
+dnl Copyright 2003, 2012, 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/limb
+C StrongARM ?
+C XScale ?
+C Cortex-A7 ?
+C Cortex-A8 ?
+C Cortex-A9 1.25-1.5
+C Cortex-A15 1.25
+
+C TODO
+C * Consider wider unrolling. Analogous 8-way code runs 10% faster on both A9
+C and A15. But it probably slows things down for 8 <= n < a few dozen.
+
+define(`rp', `r0')
+define(`up', `r1')
+define(`n', `r2')
+
+ASM_START()
+PROLOGUE(mpn_copyd)
+ mov r12, n, lsl #2
+ sub r12, r12, #4
+ add rp, rp, r12
+ add up, up, r12
+
+ tst n, #1
+ beq L(skip1)
+ ldr r3, [up], #-4
+ str r3, [rp], #-4
+L(skip1):
+ tst n, #2
+ beq L(skip2)
+ ldmda up!, { r3,r12 }
+ stmda rp!, { r3,r12 }
+L(skip2):
+ bics n, n, #3
+ beq L(rtn)
+
+ push { r4-r5 }
+ subs n, n, #4
+ ldmda up!, { r3,r4,r5,r12 }
+ beq L(end)
+
+L(top): subs n, n, #4
+ stmda rp!, { r3,r4,r5,r12 }
+ ldmda up!, { r3,r4,r5,r12 }
+ bne L(top)
+
+L(end): stmda rp, { r3,r4,r5,r12 }
+ pop { r4-r5 }
+L(rtn): bx lr
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/copyi.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/copyi.asm
new file mode 100644
index 00000000000..fa454702c14
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/copyi.asm
@@ -0,0 +1,79 @@
+dnl ARM mpn_copyi.
+
+dnl Contributed to the GNU project by Robert Harley and Torbjörn Granlund.
+
+dnl Copyright 2003, 2012, 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/limb
+C StrongARM ?
+C XScale ?
+C Cortex-A7 ?
+C Cortex-A8 ?
+C Cortex-A9 1.25-1.5
+C Cortex-A15 1.25
+
+C TODO
+C * Consider wider unrolling. Analogous 8-way code runs 10% faster on both A9
+C and A15. But it probably slows things down for 8 <= n < a few dozen.
+
+define(`rp', `r0')
+define(`up', `r1')
+define(`n', `r2')
+
+ASM_START()
+PROLOGUE(mpn_copyi)
+ tst n, #1
+ beq L(skip1)
+ ldr r3, [up], #4
+ str r3, [rp], #4
+L(skip1):
+ tst n, #2
+ beq L(skip2)
+ ldmia up!, { r3,r12 }
+ stmia rp!, { r3,r12 }
+L(skip2):
+ bics n, n, #3
+ beq L(rtn)
+
+ push { r4-r5 }
+ subs n, n, #4
+ ldmia up!, { r3,r4,r5,r12 }
+ beq L(end)
+
+L(top): subs n, n, #4
+ stmia rp!, { r3,r4,r5,r12 }
+ ldmia up!, { r3,r4,r5,r12 }
+ bne L(top)
+
+L(end): stm rp, { r3,r4,r5,r12 }
+ pop { r4-r5 }
+L(rtn): bx lr
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/dive_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/dive_1.asm
new file mode 100644
index 00000000000..a695e47c77e
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/dive_1.asm
@@ -0,0 +1,151 @@
+dnl ARM v4 mpn_modexact_1c_odd
+
+dnl Contributed to the GNU project by Torbjorn Granlund.
+
+dnl Copyright 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/limb cycles/limb
+C norm unorm modexact_1c_odd
+C StrongARM ?
+C XScale ?
+C Cortex-A7 ?
+C Cortex-A8 ?
+C Cortex-A9 10 12
+C Cortex-A15 9 9
+
+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(`cy', `r7')
+define(`cnt', `r6')
+define(`tnc', `r8')
+
+ASM_START()
+PROLOGUE(mpn_divexact_1)
+ tst d, #1
+ push {r4-r9}
+ mov cnt, #0
+ bne L(inv)
+
+C count trailing zeros
+ movs r4, d, lsl #16
+ moveq d, d, lsr #16
+ moveq cnt, #16
+ tst d, #0xff
+ moveq d, d, lsr #8
+ addeq cnt, cnt, #8
+ LEA( r4, ctz_tab)
+ and r5, d, #0xff
+ ldrb r4, [r4, r5]
+ mov d, d, lsr r4
+ add cnt, cnt, r4
+
+C binvert limb
+L(inv): LEA( r4, binvert_limb_table)
+ and r12, d, #254
+ ldrb r4, [r4, r12, lsr #1]
+ mul r12, r4, r4
+ mul r12, d, r12
+ rsb r12, r12, r4, lsl #1
+ mul r4, r12, r12
+ mul r4, d, r4
+ rsb r4, r4, r12, lsl #1 C r4 = inverse
+
+ tst cnt, cnt
+ ldr r5, [up], #4 C up[0]
+ mov cy, #0
+ bne L(unnorm)
+
+L(norm):
+ subs n, n, #1 C set carry as side-effect
+ beq L(end)
+
+ ALIGN(16)
+L(top): sbcs cy, r5, cy
+ ldr r5, [up], #4
+ sub n, n, #1
+ mul r9, r4, cy
+ tst n, n
+ umull r12, cy, d, r9
+ str r9, [rp], #4
+ bne L(top)
+
+L(end): sbc cy, r5, cy
+ mul r9, r4, cy
+ str r9, [rp]
+ pop {r4-r9}
+ bx r14
+
+L(unnorm):
+ rsb tnc, cnt, #32
+ mov r5, r5, 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, r5, r12, lsl tnc
+ mov r5, r12, lsr cnt
+ sbcs cy, r9, cy C critical path ->cy->cy->
+ sub n, n, #1
+ mul r9, r4, 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, r5, cy
+ mul r9, r4, cy
+ str r9, [rp]
+ pop {r4-r9}
+ bx r14
+EPILOGUE()
+
+ .section .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
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/gmp-mparam.h b/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/gmp-mparam.h
new file mode 100644
index 00000000000..87eec3a1494
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/gmp-mparam.h
@@ -0,0 +1,127 @@
+/* gmp-mparam.h -- Compiler/machine parameter header file.
+
+Copyright 1991, 1993, 1994, 1999-2003, 2009, 2010 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
+
+/* 1193MHz ARM (gcc55.fsffrance.org) */
+
+#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 56
+#define MOD_1U_TO_MOD_1_1_THRESHOLD 11
+#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 71
+#define USE_PREINV_DIVREM_1 1 /* preinv always */
+#define DIVREM_2_THRESHOLD 0 /* preinv always */
+#define DIVEXACT_1_THRESHOLD 0 /* always */
+#define BMOD_1_TO_MOD_1_THRESHOLD 41
+
+#define MUL_TOOM22_THRESHOLD 36
+#define MUL_TOOM33_THRESHOLD 125
+#define MUL_TOOM44_THRESHOLD 193
+#define MUL_TOOM6H_THRESHOLD 303
+#define MUL_TOOM8H_THRESHOLD 418
+
+#define MUL_TOOM32_TO_TOOM43_THRESHOLD 125
+#define MUL_TOOM32_TO_TOOM53_THRESHOLD 176
+#define MUL_TOOM42_TO_TOOM53_THRESHOLD 114
+#define MUL_TOOM42_TO_TOOM63_THRESHOLD 129
+
+#define SQR_BASECASE_THRESHOLD 12
+#define SQR_TOOM2_THRESHOLD 78
+#define SQR_TOOM3_THRESHOLD 137
+#define SQR_TOOM4_THRESHOLD 212
+#define SQR_TOOM6_THRESHOLD 306
+#define SQR_TOOM8_THRESHOLD 422
+
+#define MULMOD_BNM1_THRESHOLD 20
+#define SQRMOD_BNM1_THRESHOLD 26
+
+#define MUL_FFT_MODF_THRESHOLD 436 /* k = 5 */
+#define MUL_FFT_TABLE3 \
+ { { 436, 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}, { 31, 7}, { 63, 8}, \
+ { 256, 9}, { 512,10}, { 1024,11}, { 2048,12}, \
+ { 4096,13}, { 8192,14}, { 16384,15}, { 32768,16} }
+#define MUL_FFT_TABLE3_SIZE 28
+#define MUL_FFT_THRESHOLD 5760
+
+#define SQR_FFT_MODF_THRESHOLD 404 /* k = 5 */
+#define SQR_FFT_TABLE3 \
+ { { 404, 5}, { 13, 4}, { 27, 5}, { 27, 6}, \
+ { 28, 7}, { 15, 6}, { 32, 7}, { 17, 6}, \
+ { 35, 7}, { 29, 8}, { 15, 7}, { 35, 8}, \
+ { 19, 7}, { 41, 8}, { 23, 7}, { 47, 8}, \
+ { 27, 9}, { 15, 8}, { 39, 9}, { 512,10}, \
+ { 1024,11}, { 2048,12}, { 4096,13}, { 8192,14}, \
+ { 16384,15}, { 32768,16} }
+#define SQR_FFT_TABLE3_SIZE 26
+#define SQR_FFT_THRESHOLD 3776
+
+#define MULLO_BASECASE_THRESHOLD 0 /* always */
+#define MULLO_DC_THRESHOLD 137
+#define MULLO_MUL_N_THRESHOLD 11479
+
+#define DC_DIV_QR_THRESHOLD 150
+#define DC_DIVAPPR_Q_THRESHOLD 494
+#define DC_BDIV_QR_THRESHOLD 148
+#define DC_BDIV_Q_THRESHOLD 345
+
+#define INV_MULMOD_BNM1_THRESHOLD 70
+#define INV_NEWTON_THRESHOLD 474
+#define INV_APPR_THRESHOLD 478
+
+#define BINV_NEWTON_THRESHOLD 542
+#define REDC_1_TO_REDC_N_THRESHOLD 117
+
+#define MU_DIV_QR_THRESHOLD 2089
+#define MU_DIVAPPR_Q_THRESHOLD 2172
+#define MUPI_DIV_QR_THRESHOLD 225
+#define MU_BDIV_QR_THRESHOLD 1528
+#define MU_BDIV_Q_THRESHOLD 2089
+
+#define MATRIX22_STRASSEN_THRESHOLD 16
+#define HGCD_THRESHOLD 197
+#define GCD_DC_THRESHOLD 902
+#define GCDEXT_DC_THRESHOLD 650
+#define JACOBI_BASE_METHOD 2
+
+#define GET_STR_DC_THRESHOLD 20
+#define GET_STR_PRECOMPUTE_THRESHOLD 39
+#define SET_STR_DC_THRESHOLD 1045
+#define SET_STR_PRECOMPUTE_THRESHOLD 2147
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/invert_limb.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/invert_limb.asm
new file mode 100644
index 00000000000..d4c3afe2da3
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/invert_limb.asm
@@ -0,0 +1,93 @@
+dnl ARM mpn_invert_limb -- Invert a normalized limb.
+
+dnl Copyright 2001, 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')
+
+ASM_START()
+PROLOGUE(mpn_invert_limb)
+ LEA( r2, approx_tab-512)
+ mov r3, r0, lsr #23
+ mov r3, r3, asl #1
+ ldrh r3, [r3, r2]
+ mov r1, r3, asl #17
+ mul r12, r3, r3
+ umull r3, r2, r12, r0
+ sub r1, r1, r2, asl #1
+ umull r3, r2, r1, r1
+ umull r12, r3, r0, r3
+ umull r2, r12, r0, r2
+ adds r2, r2, r3
+ adc r12, r12, #0
+ rsb r1, r12, r1
+ mvn r2, r2, lsr #30
+ add r2, r2, r1, asl #2
+ umull r12, r3, r0, r2
+ adds r1, r12, r0
+ adc r3, r3, r0
+ rsb r0, r3, r2
+ bx lr
+EPILOGUE()
+
+ .section .rodata
+ ALIGN(2)
+approx_tab:
+ .short 0xffc0,0xfec0,0xfdc0,0xfcc0,0xfbc0,0xfac0,0xfa00,0xf900
+ .short 0xf800,0xf700,0xf640,0xf540,0xf440,0xf380,0xf280,0xf180
+ .short 0xf0c0,0xefc0,0xef00,0xee00,0xed40,0xec40,0xeb80,0xeac0
+ .short 0xe9c0,0xe900,0xe840,0xe740,0xe680,0xe5c0,0xe500,0xe400
+ .short 0xe340,0xe280,0xe1c0,0xe100,0xe040,0xdf80,0xdec0,0xde00
+ .short 0xdd40,0xdc80,0xdbc0,0xdb00,0xda40,0xd980,0xd8c0,0xd800
+ .short 0xd740,0xd680,0xd600,0xd540,0xd480,0xd3c0,0xd340,0xd280
+ .short 0xd1c0,0xd140,0xd080,0xcfc0,0xcf40,0xce80,0xcdc0,0xcd40
+ .short 0xcc80,0xcc00,0xcb40,0xcac0,0xca00,0xc980,0xc8c0,0xc840
+ .short 0xc780,0xc700,0xc640,0xc5c0,0xc540,0xc480,0xc400,0xc380
+ .short 0xc2c0,0xc240,0xc1c0,0xc100,0xc080,0xc000,0xbf80,0xbec0
+ .short 0xbe40,0xbdc0,0xbd40,0xbc80,0xbc00,0xbb80,0xbb00,0xba80
+ .short 0xba00,0xb980,0xb900,0xb840,0xb7c0,0xb740,0xb6c0,0xb640
+ .short 0xb5c0,0xb540,0xb4c0,0xb440,0xb3c0,0xb340,0xb2c0,0xb240
+ .short 0xb1c0,0xb140,0xb0c0,0xb080,0xb000,0xaf80,0xaf00,0xae80
+ .short 0xae00,0xad80,0xad40,0xacc0,0xac40,0xabc0,0xab40,0xaac0
+ .short 0xaa80,0xaa00,0xa980,0xa900,0xa8c0,0xa840,0xa7c0,0xa740
+ .short 0xa700,0xa680,0xa600,0xa5c0,0xa540,0xa4c0,0xa480,0xa400
+ .short 0xa380,0xa340,0xa2c0,0xa240,0xa200,0xa180,0xa140,0xa0c0
+ .short 0xa080,0xa000,0x9f80,0x9f40,0x9ec0,0x9e80,0x9e00,0x9dc0
+ .short 0x9d40,0x9d00,0x9c80,0x9c40,0x9bc0,0x9b80,0x9b00,0x9ac0
+ .short 0x9a40,0x9a00,0x9980,0x9940,0x98c0,0x9880,0x9840,0x97c0
+ .short 0x9780,0x9700,0x96c0,0x9680,0x9600,0x95c0,0x9580,0x9500
+ .short 0x94c0,0x9440,0x9400,0x93c0,0x9340,0x9300,0x92c0,0x9240
+ .short 0x9200,0x91c0,0x9180,0x9100,0x90c0,0x9080,0x9000,0x8fc0
+ .short 0x8f80,0x8f40,0x8ec0,0x8e80,0x8e40,0x8e00,0x8d80,0x8d40
+ .short 0x8d00,0x8cc0,0x8c80,0x8c00,0x8bc0,0x8b80,0x8b40,0x8b00
+ .short 0x8a80,0x8a40,0x8a00,0x89c0,0x8980,0x8940,0x88c0,0x8880
+ .short 0x8840,0x8800,0x87c0,0x8780,0x8740,0x8700,0x8680,0x8640
+ .short 0x8600,0x85c0,0x8580,0x8540,0x8500,0x84c0,0x8480,0x8440
+ .short 0x8400,0x8380,0x8340,0x8300,0x82c0,0x8280,0x8240,0x8200
+ .short 0x81c0,0x8180,0x8140,0x8100,0x80c0,0x8080,0x8040,0x8000
+ASM_END()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/logops_n.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/logops_n.asm
new file mode 100644
index 00000000000..5a61683fc2e
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/logops_n.asm
@@ -0,0 +1,139 @@
+dnl ARM mpn_and_n, mpn_andn_n. mpn_nand_n, etc.
+
+dnl Contributed to the GNU project by Torbjörn Granlund.
+
+dnl Copyright 1997, 2000, 2001, 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/limb cycles/limb
+C and andn ior xor nand iorn nior xnor
+C StrongARM ? ?
+C XScale ? ?
+C Cortex-A7 ? ?
+C Cortex-A8 ? ?
+C Cortex-A9 2.5-2.72 2.75-3
+C Cortex-A15 2.25 2.75
+
+C TODO
+C * It seems that 2.25 c/l and 2.75 c/l is possible for A9.
+C * Debug popping issue, see comment below.
+
+define(`rp', `r0')
+define(`up', `r1')
+define(`vp', `r2')
+define(`n', `r3')
+
+define(`POSTOP')
+
+ifdef(`OPERATION_and_n',`
+ define(`func', `mpn_and_n')
+ define(`LOGOP', `and $1, $2, $3')')
+ifdef(`OPERATION_andn_n',`
+ define(`func', `mpn_andn_n')
+ define(`LOGOP', `bic $1, $2, $3')')
+ifdef(`OPERATION_nand_n',`
+ define(`func', `mpn_nand_n')
+ define(`POSTOP', `mvn $1, $1')
+ define(`LOGOP', `and $1, $2, $3')')
+ifdef(`OPERATION_ior_n',`
+ define(`func', `mpn_ior_n')
+ define(`LOGOP', `orr $1, $2, $3')')
+ifdef(`OPERATION_iorn_n',`
+ define(`func', `mpn_iorn_n')
+ define(`POSTOP', `mvn $1, $1')
+ define(`LOGOP', `bic $1, $3, $2')')
+ifdef(`OPERATION_nior_n',`
+ define(`func', `mpn_nior_n')
+ define(`POSTOP', `mvn $1, $1')
+ define(`LOGOP', `orr $1, $2, $3')')
+ifdef(`OPERATION_xor_n',`
+ define(`func', `mpn_xor_n')
+ define(`LOGOP', `eor $1, $2, $3')')
+ifdef(`OPERATION_xnor_n',`
+ define(`func', `mpn_xnor_n')
+ define(`POSTOP', `mvn $1, $1')
+ define(`LOGOP', `eor $1, $2, $3')')
+
+MULFUNC_PROLOGUE(mpn_and_n mpn_andn_n mpn_nand_n mpn_ior_n mpn_iorn_n mpn_nior_n mpn_xor_n mpn_xnor_n)
+
+ASM_START()
+PROLOGUE(func)
+ push { r8, r9, r10 }
+ tst n, #1
+ beq L(skip1)
+ ldr r10, [vp], #4
+ ldr r12, [up], #4
+ LOGOP( r12, r12, r10)
+ POSTOP( r12)
+ str r12, [rp], #4
+L(skip1):
+ tst n, #2
+ beq L(skip2)
+ ldmia vp!, { r10, r12 }
+ ldmia up!, { r8, r9 }
+ LOGOP( r8, r8, r10)
+ LOGOP( r9, r9, r12)
+ POSTOP( r8)
+ POSTOP( r9)
+ stmia rp!, { r8, r9 }
+L(skip2):
+ bics n, n, #3
+ beq L(rtn)
+ push { r4, r5, r6, r7 }
+
+ ldmia vp!, { r8, r9, r10, r12 }
+ b L(mid)
+
+L(top): ldmia vp!, { r8, r9, r10, r12 }
+ POSTOP( r4)
+ POSTOP( r5)
+ POSTOP( r6)
+ POSTOP( r7)
+ stmia rp!, { r4, r5, r6, r7 }
+L(mid): sub n, n, #4
+ ldmia up!, { r4, r5, r6, r7 }
+ teq n, #0
+ LOGOP( r4, r4, r8)
+ LOGOP( r5, r5, r9)
+ LOGOP( r6, r6, r10)
+ LOGOP( r7, r7, r12)
+ bne L(top)
+
+ POSTOP( r4)
+ POSTOP( r5)
+ POSTOP( r6)
+ POSTOP( r7)
+ stmia rp!, { r4, r5, r6, r7 }
+
+ pop { r4, r5, r6, r7 } C popping r8-r10 here strangely fails
+
+L(rtn): pop { r8, r9, r10 }
+ bx r14
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/lshift.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/lshift.asm
new file mode 100644
index 00000000000..9f777eb4dd8
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/lshift.asm
@@ -0,0 +1,88 @@
+dnl ARM mpn_lshift.
+
+dnl Contributed to the GNU project by Torbjörn Granlund.
+
+dnl Copyright 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/limb
+C StrongARM ?
+C XScale ?
+C Cortex-A7 ?
+C Cortex-A8 ?
+C Cortex-A9 3.5
+C Cortex-A15 ?
+
+define(`rp', `r0')
+define(`up', `r1')
+define(`n', `r2')
+define(`cnt', `r3')
+define(`tnc', `r12')
+
+ASM_START()
+PROLOGUE(mpn_lshift)
+ add up, up, n, lsl #2
+ push {r4, r6, r7, r8}
+ ldr r4, [up, #-4]!
+ add rp, rp, n, lsl #2
+ rsb tnc, cnt, #32
+
+ mov r7, r4, lsl cnt
+ tst n, #1
+ beq L(evn) C n even
+
+L(odd): subs n, n, #2
+ bcc L(1) C n = 1
+ ldr r8, [up, #-4]!
+ b L(mid)
+
+L(evn): ldr r6, [up, #-4]!
+ subs n, n, #2
+ beq L(end)
+
+L(top): ldr r8, [up, #-4]!
+ orr r7, r7, r6, lsr tnc
+ str r7, [rp, #-4]!
+ mov r7, r6, lsl cnt
+L(mid): ldr r6, [up, #-4]!
+ orr r7, r7, r8, lsr tnc
+ str r7, [rp, #-4]!
+ mov r7, r8, lsl cnt
+ subs n, n, #2
+ bgt L(top)
+
+L(end): orr r7, r7, r6, lsr tnc
+ str r7, [rp, #-4]!
+ mov r7, r6, lsl cnt
+L(1): str r7, [rp, #-4]
+ mov r0, r4, lsr tnc
+ pop {r4, r6, r7, r8}
+ bx r14
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/lshiftc.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/lshiftc.asm
new file mode 100644
index 00000000000..5f3d6e3f5b7
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/lshiftc.asm
@@ -0,0 +1,95 @@
+dnl ARM mpn_lshiftc.
+
+dnl Contributed to the GNU project by Torbjörn Granlund.
+
+dnl Copyright 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/limb
+C StrongARM ?
+C XScale ?
+C Cortex-A7 ?
+C Cortex-A8 ?
+C Cortex-A9 4.0
+C Cortex-A15 ?
+
+define(`rp', `r0')
+define(`up', `r1')
+define(`n', `r2')
+define(`cnt', `r3')
+define(`tnc', `r12')
+
+ASM_START()
+PROLOGUE(mpn_lshiftc)
+ add up, up, n, lsl #2
+ push {r4, r6, r7, r8}
+ ldr r4, [up, #-4]!
+ add rp, rp, n, lsl #2
+ rsb tnc, cnt, #32
+ mvn r6, r4
+
+ mov r7, r6, lsl cnt
+ tst n, #1
+ beq L(evn) C n even
+
+L(odd): subs n, n, #2
+ bcc L(1) C n = 1
+ ldr r8, [up, #-4]!
+ mvn r8, r8
+ b L(mid)
+
+L(evn): ldr r6, [up, #-4]!
+ mvn r6, r6
+ subs n, n, #2
+ beq L(end)
+
+L(top): ldr r8, [up, #-4]!
+ orr r7, r7, r6, lsr tnc
+ str r7, [rp, #-4]!
+ mvn r8, r8
+ mov r7, r6, lsl cnt
+L(mid): ldr r6, [up, #-4]!
+ orr r7, r7, r8, lsr tnc
+ str r7, [rp, #-4]!
+ mvn r6, r6
+ mov r7, r8, lsl cnt
+ subs n, n, #2
+ bgt L(top)
+
+L(end): orr r7, r7, r6, lsr tnc
+ str r7, [rp, #-4]!
+ mov r7, r6, lsl cnt
+L(1): mvn r6, #0
+ orr r7, r7, r6, lsr tnc
+ str r7, [rp, #-4]
+ mov r0, r4, lsr tnc
+ pop {r4, r6, r7, r8}
+ bx r14
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/mod_34lsub1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/mod_34lsub1.asm
new file mode 100644
index 00000000000..ba3c06d8db1
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/mod_34lsub1.asm
@@ -0,0 +1,121 @@
+dnl ARM mpn_mod_34lsub1 -- remainder modulo 2^24-1.
+
+dnl Copyright 2012, 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/limb
+C StrongARM ?
+C XScale ?
+C Cortex-A7 ?
+C Cortex-A8 ?
+C Cortex-A9 1.33
+C Cortex-A15 1.33
+
+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
+ cmn r0, #0 C clear carry
+ sub n, n, #3
+ b L(mid)
+
+L(top): adcs r2, r2, r4
+ adcs r3, r3, r5
+ adcs r12, r12, r6
+L(mid): ldmia ap!, { r4, r5, r6 }
+ tst n, n
+ sub n, n, #3
+ bpl L(top)
+
+ add n, n, #3
+
+ adcs r2, r2, r4
+ adcs r3, r3, r5
+ adcs r12, r12, r6
+ movcs r7, #1 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 r1, r7, #0xff000000
+ add r0, r0, r1
+ add r0, r0, r3, lsr #16
+
+ mov r7, r12, lsl #16
+ bic r1, r7, #0xff000000
+ add r0, r0, r1
+ add r0, r0, r12, lsr #8
+
+ pop { r4, r5, r6, r7 }
+ bx 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 }
+ bx lr
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/mode1o.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/mode1o.asm
new file mode 100644
index 00000000000..5e0f78fc8f5
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/mode1o.asm
@@ -0,0 +1,92 @@
+dnl ARM mpn_modexact_1c_odd
+
+dnl Contributed to the GNU project by Torbjörn Granlund.
+
+dnl Copyright 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/limb
+C StrongARM ?
+C XScale ?
+C Cortex-A7 ?
+C Cortex-A8 ?
+C Cortex-A9 10
+C Cortex-A15 9
+
+C Architecture requirements:
+C v5 -
+C v5t -
+C v5te -
+C v6 -
+C v6t2 -
+C v7a -
+
+define(`up', `r0')
+define(`n', `r1')
+define(`d', `r2')
+define(`cy', `r3')
+
+ .protected binvert_limb_table
+ASM_START()
+PROLOGUE(mpn_modexact_1c_odd)
+ stmfd sp!, {r4, r5}
+
+ LEA( r4, binvert_limb_table)
+
+ ldr r5, [up], #4 C up[0]
+
+ and r12, d, #254
+ ldrb r4, [r4, r12, lsr #1]
+ mul r12, r4, r4
+ mul r12, d, r12
+ rsb r12, r12, r4, asl #1
+ mul r4, r12, r12
+ mul r4, d, r4
+ rsb r4, r4, r12, asl #1 C r4 = inverse
+
+ subs n, n, #1 C set carry as side-effect
+ beq L(end)
+
+L(top): sbcs cy, r5, cy
+ ldr r5, [up], #4
+ sub n, n, #1
+ mul r12, r4, cy
+ tst n, n
+ umull r12, cy, d, r12
+ bne L(top)
+
+L(end): sbcs cy, r5, cy
+ mul r12, r4, cy
+ umull r12, r0, d, r12
+ addcc r0, r0, #1
+
+ ldmfd sp!, {r4, r5}
+ bx r14
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/mul_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/mul_1.asm
new file mode 100644
index 00000000000..f7bc1bc386c
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/mul_1.asm
@@ -0,0 +1,94 @@
+dnl ARM mpn_mul_1 -- Multiply a limb vector with a limb and store the result
+dnl in a second limb vector.
+dnl Contributed by Robert Harley.
+
+dnl Copyright 1998, 2000, 2001, 2003, 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/limb
+C StrongARM 6-8
+C XScale ?
+C Cortex-A7 ?
+C Cortex-A8 ?
+C Cortex-A9 4.75
+C Cortex-A15 ?
+
+C We should rewrite this along the lines of addmul_1.asm. That should save a
+C cycle on StrongARM, and several cycles on XScale.
+
+define(`rp',`r0')
+define(`up',`r1')
+define(`n',`r2')
+define(`vl',`r3')
+
+
+ASM_START()
+PROLOGUE(mpn_mul_1)
+ stmfd sp!, { r8, r9, lr }
+ ands r12, n, #1
+ beq L(skip1)
+ ldr lr, [up], #4
+ umull r9, r12, lr, vl
+ str r9, [rp], #4
+L(skip1):
+ tst n, #2
+ beq L(skip2)
+ mov r8, r12
+ ldmia up!, { r12, lr }
+ mov r9, #0
+ umlal r8, r9, r12, vl
+ mov r12, #0
+ umlal r9, r12, lr, vl
+ stmia rp!, { r8, r9 }
+L(skip2):
+ bics n, n, #3
+ beq L(rtn)
+ stmfd sp!, { r6, r7 }
+
+L(top): mov r6, r12
+ ldmia up!, { r8, r9, r12, lr }
+ ldr r7, [rp, #12] C cache allocate
+ mov r7, #0
+ umlal r6, r7, r8, vl
+ mov r8, #0
+ umlal r7, r8, r9, vl
+ mov r9, #0
+ umlal r8, r9, r12, vl
+ mov r12, #0
+ umlal r9, r12, lr, vl
+ subs n, n, #4
+ stmia rp!, { r6, r7, r8, r9 }
+ bne L(top)
+
+ ldmfd sp!, { r6, r7 }
+
+L(rtn): mov r0, r12
+ ldmfd sp!, { r8, r9, pc }
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/neon/README b/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/neon/README
new file mode 100644
index 00000000000..79e3b48ee64
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/neon/README
@@ -0,0 +1,2 @@
+This directory contains Neon code which runs and is efficient on all
+ARM CPUs which support Neon.
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/neon/hamdist.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/neon/hamdist.asm
new file mode 100644
index 00000000000..232089647df
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/neon/hamdist.asm
@@ -0,0 +1,194 @@
+dnl ARM Neon mpn_hamdist -- mpn bit hamming distance.
+
+dnl Copyright 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/limb
+C StrongARM: -
+C XScale -
+C Cortex-A7 ?
+C Cortex-A8 ?
+C Cortex-A9 1.89
+C Cortex-A15 0.95
+
+C TODO
+C * Explore using vldr and vldm. Does it help on A9? (These loads do
+C 64-bits-at-a-time, which will mess up in big-endian mode. Except not for
+C popcount. Except perhaps also for popcount for the edge loads.)
+C * Arrange to align the pointer, if that helps performance. Use the same
+C read-and-mask trick we use on PCs, for simplicity and performance. (Sorry
+C valgrind!)
+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.
+
+C INPUT PARAMETERS
+define(`ap', r0)
+define(`bp', r1)
+define(`n', r2)
+
+C We sum into 16 16-bit counters in q8,q9, but at the end we sum them and end
+C up with 8 16-bit counters. Therefore, we can sum to 8(2^16-1) bits, or
+C (8*2^16-1)/32 = 0x3fff limbs. We use a chunksize close to that, but which
+C can be represented as a 8-bit ARM constant.
+C
+define(`chunksize',0x3f80)
+
+ASM_START()
+PROLOGUE(mpn_hamdist)
+
+ cmp n, #chunksize
+ bhi L(gt16k)
+
+L(lt16k):
+ vmov.i64 q8, #0 C clear summation register
+ vmov.i64 q9, #0 C clear summation register
+
+ tst n, #1
+ beq L(xxx0)
+ vmov.i64 d0, #0
+ vmov.i64 d20, #0
+ sub n, n, #1
+ vld1.32 {d0[0]}, [ap]! C load 1 limb
+ vld1.32 {d20[0]}, [bp]! C load 1 limb
+ veor d0, d0, d20
+ vcnt.8 d24, d0
+ vpadal.u8 d16, d24 C d16/q8 = 0; could just splat
+
+L(xxx0):tst n, #2
+ beq L(xx00)
+ sub n, n, #2
+ vld1.32 {d0}, [ap]! C load 2 limbs
+ vld1.32 {d20}, [bp]! C load 2 limbs
+ veor d0, d0, d20
+ vcnt.8 d24, d0
+ vpadal.u8 d16, d24
+
+L(xx00):tst n, #4
+ beq L(x000)
+ sub n, n, #4
+ vld1.32 {q0}, [ap]! C load 4 limbs
+ vld1.32 {q10}, [bp]! C load 4 limbs
+ veor q0, q0, q10
+ vcnt.8 q12, q0
+ vpadal.u8 q8, q12
+
+L(x000):tst n, #8
+ beq L(0000)
+
+ subs n, n, #8
+ vld1.32 {q0,q1}, [ap]! C load 8 limbs
+ vld1.32 {q10,q11}, [bp]! C load 8 limbs
+ bls L(sum)
+
+L(gt8): vld1.32 {q2,q3}, [ap]! C load 8 limbs
+ vld1.32 {q14,q15}, [bp]! C load 8 limbs
+ veor q0, q0, q10
+ veor q1, q1, q11
+ sub n, n, #8
+ vcnt.8 q12, q0
+ vcnt.8 q13, q1
+ b L(mid)
+
+L(0000):subs n, n, #16
+ blo L(e0)
+
+ vld1.32 {q2,q3}, [ap]! C load 8 limbs
+ vld1.32 {q0,q1}, [ap]! C load 8 limbs
+ vld1.32 {q14,q15}, [bp]! C load 8 limbs
+ vld1.32 {q10,q11}, [bp]! C load 8 limbs
+ veor q2, q2, q14
+ veor q3, q3, q15
+ vcnt.8 q12, q2
+ vcnt.8 q13, q3
+ subs n, n, #16
+ blo L(end)
+
+L(top): vld1.32 {q2,q3}, [ap]! C load 8 limbs
+ vld1.32 {q14,q15}, [bp]! C load 8 limbs
+ veor q0, q0, q10
+ veor q1, q1, q11
+ vpadal.u8 q8, q12
+ vcnt.8 q12, q0
+ vpadal.u8 q9, q13
+ vcnt.8 q13, q1
+L(mid): vld1.32 {q0,q1}, [ap]! C load 8 limbs
+ vld1.32 {q10,q11}, [bp]! C load 8 limbs
+ veor q2, q2, q14
+ veor q3, q3, q15
+ subs n, n, #16
+ vpadal.u8 q8, q12
+ vcnt.8 q12, q2
+ vpadal.u8 q9, q13
+ vcnt.8 q13, q3
+ bhs L(top)
+
+L(end): vpadal.u8 q8, q12
+ vpadal.u8 q9, q13
+L(sum): veor q0, q0, q10
+ veor q1, q1, q11
+ vcnt.8 q12, q0
+ vcnt.8 q13, q1
+ vpadal.u8 q8, q12
+ vpadal.u8 q9, q13
+ vadd.i16 q8, q8, q9
+ C we have 8 16-bit counts
+L(e0): vpaddl.u16 q8, q8 C we have 4 32-bit counts
+ vpaddl.u32 q8, q8 C we have 2 64-bit counts
+ vmov.32 r0, d16[0]
+ vmov.32 r1, d17[0]
+ add r0, r0, r1
+ bx lr
+
+C Code for large count. Splits operand and calls above code.
+define(`ap2', r5)
+define(`bp2', r6)
+L(gt16k):
+ push {r4,r5,r6,r14}
+ mov ap2, ap
+ mov bp2, bp
+ mov r3, n C full count
+ mov r4, #0 C total sum
+
+1: mov n, #chunksize C count for this invocation
+ bl L(lt16k) C could jump deep inside code
+ add ap2, ap2, #chunksize*4 C point at next chunk
+ add bp2, bp2, #chunksize*4 C point at next chunk
+ add r4, r4, r0
+ mov ap, ap2 C put chunk pointer in place for call
+ mov bp, bp2 C put chunk pointer in place for call
+ sub r3, r3, #chunksize
+ cmp r3, #chunksize
+ bhi 1b
+
+ mov n, r3 C count for final invocation
+ bl L(lt16k)
+ add r0, r4, r0
+ pop {r4,r5,r6,pc}
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/neon/lorrshift.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/neon/lorrshift.asm
new file mode 100644
index 00000000000..3d6253fd495
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/neon/lorrshift.asm
@@ -0,0 +1,279 @@
+dnl ARM Neon mpn_lshift and mpn_rshift.
+
+dnl Contributed to the GNU project by Torbjörn Granlund.
+
+dnl Copyright 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/limb cycles/limb cycles/limb good
+C aligned unaligned best seen for cpu?
+C StrongARM - -
+C XScale - -
+C Cortex-A7 ? ?
+C Cortex-A8 ? ?
+C Cortex-A9 3 3 Y
+C Cortex-A15 1.5 1.5 Y
+
+
+C We read 64 bits at a time at 32-bit aligned addresses, and except for the
+C first and last store, we write using 64-bit aligned addresses. All shifting
+C is done on 64-bit words in 'extension' registers.
+C
+C It should be possible to read also using 64-bit alignment, by manipulating
+C the shift count for unaligned operands. Not done, since it does not seem to
+C matter for A9 or A15.
+C
+C This will not work in big-endian mode.
+
+C TODO
+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 * 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.
+
+C INPUT PARAMETERS
+define(`rp', `r0')
+define(`ap', `r1')
+define(`n', `r2')
+define(`cnt', `r3')
+
+ifdef(`OPERATION_lshift',`
+ define(`IFLSH', `$1')
+ define(`IFRSH', `')
+ define(`X',`0')
+ define(`Y',`1')
+ define(`func',`mpn_lshift')
+')
+ifdef(`OPERATION_rshift',`
+ define(`IFLSH', `')
+ define(`IFRSH', `$1')
+ define(`X',`1')
+ define(`Y',`0')
+ define(`func',`mpn_rshift')
+')
+
+MULFUNC_PROLOGUE(mpn_lshift mpn_rshift)
+
+ASM_START()
+ TEXT
+ ALIGN(64)
+PROLOGUE(func)
+IFLSH(` mov r12, n, lsl #2 ')
+IFLSH(` add rp, rp, r12 ')
+IFLSH(` add ap, ap, r12 ')
+
+ cmp n, #4 C SIMD code n limit
+ ble L(base)
+
+ifdef(`OPERATION_lshift',`
+ 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
+
+IFLSH(` sub ap, ap, #8 ')
+ vld1.32 {d19}, [ap], r12 C load initial 2 limbs
+ vshl.u64 d18, d19, d7 C retval
+
+ tst rp, #4 C is rp 64-bit aligned already?
+ beq L(rp_aligned) C yes, skip
+IFLSH(` add ap, ap, #4 ') C move back ap pointer
+IFRSH(` sub 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
+ vld1.32 {d19}, [ap], r12 C load ap[1] and ap[2]
+
+L(rp_aligned):
+IFLSH(` sub rp, rp, #8 ')
+ subs n, n, #6
+ blt L(two_or_three_more)
+ tst n, #2
+ beq L(2)
+
+L(1): vld1.32 {d17}, [ap], r12
+ vshl.u64 d5, d19, d6
+ vld1.32 {d16}, [ap], r12
+ vshl.u64 d0, d17, d7
+ vshl.u64 d4, d17, d6
+ sub n, n, #2
+ b L(mid)
+
+L(2): vld1.32 {d16}, [ap], r12
+ vshl.u64 d4, d19, d6
+ vld1.32 {d17}, [ap], r12
+ vshl.u64 d1, d16, d7
+ vshl.u64 d5, d16, d6
+ subs n, n, #4
+ blt L(end)
+
+L(top): vld1.32 {d16}, [ap], r12
+ vorr d2, d4, d1
+ vshl.u64 d0, d17, d7
+ vshl.u64 d4, d17, d6
+ vst1.32 {d2}, [rp:64], r12
+L(mid): vld1.32 {d17}, [ap], r12
+ vorr d3, d5, d0
+ vshl.u64 d1, d16, d7
+ vshl.u64 d5, d16, d6
+ vst1.32 {d3}, [rp:64], r12
+ subs n, n, #4
+ bge L(top)
+
+L(end): tst n, #1
+ beq L(evn)
+
+ vorr d2, d4, d1
+ vst1.32 {d2}, [rp:64], r12
+ b L(cj1)
+
+L(evn): vorr d2, d4, d1
+ vshl.u64 d0, d17, d7
+ vshl.u64 d16, d17, d6
+ vst1.32 {d2}, [rp:64], r12
+ vorr d2, d5, d0
+ b L(cj2)
+
+C Load last 2 - 3 limbs, store last 4 - 5 limbs
+L(two_or_three_more):
+ tst n, #1
+ beq L(l2)
+
+L(l3): vshl.u64 d5, d19, d6
+ vld1.32 {d17}, [ap], r12
+L(cj1): veor d16, d16, d16
+IFLSH(` add ap, ap, #4 ')
+ vld1.32 {d16[Y]}, [ap], r12
+ vshl.u64 d0, d17, d7
+ vshl.u64 d4, d17, d6
+ vorr d3, d5, d0
+ vshl.u64 d1, d16, d7
+ vshl.u64 d5, d16, d6
+ 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]
+ bx lr
+
+L(l2): vld1.32 {d16}, [ap], r12
+ vshl.u64 d4, d19, d6
+ vshl.u64 d1, d16, d7
+ vshl.u64 d16, d16, d6
+ vorr d2, d4, d1
+L(cj2): vst1.32 {d2}, [rp:64], r12
+ vst1.32 {d16}, [rp]
+ vmov.32 r0, d18[X]
+ bx lr
+
+
+define(`tnc', `r12')
+L(base):
+ push {r4, r6, r7, r8}
+ifdef(`OPERATION_lshift',`
+ ldr r4, [ap, #-4]!
+ rsb tnc, cnt, #32
+
+ mov r7, r4, lsl cnt
+ tst n, #1
+ beq L(ev) C n even
+
+L(od): subs n, n, #2
+ bcc L(ed1) C n = 1
+ ldr r8, [ap, #-4]!
+ b L(md) C n = 3
+
+L(ev): ldr r6, [ap, #-4]!
+ subs n, n, #2
+ beq L(ed) C n = 3
+ C n = 4
+L(tp): ldr r8, [ap, #-4]!
+ orr r7, r7, r6, lsr tnc
+ str r7, [rp, #-4]!
+ mov r7, r6, lsl cnt
+L(md): ldr r6, [ap, #-4]!
+ orr r7, r7, r8, lsr tnc
+ str r7, [rp, #-4]!
+ mov r7, r8, lsl cnt
+
+L(ed): orr r7, r7, r6, lsr tnc
+ str r7, [rp, #-4]!
+ mov r7, r6, lsl cnt
+L(ed1): str r7, [rp, #-4]
+ mov r0, r4, lsr tnc
+')
+ifdef(`OPERATION_rshift',`
+ ldr r4, [ap]
+ rsb tnc, cnt, #32
+
+ mov r7, r4, lsr cnt
+ tst n, #1
+ beq L(ev) C n even
+
+L(od): subs n, n, #2
+ bcc L(ed1) C n = 1
+ ldr r8, [ap, #4]!
+ b L(md) C n = 3
+
+L(ev): ldr r6, [ap, #4]!
+ subs n, n, #2
+ beq L(ed) C n = 2
+ C n = 4
+
+L(tp): ldr r8, [ap, #4]!
+ orr r7, r7, r6, lsl tnc
+ str r7, [rp], #4
+ mov r7, r6, lsr cnt
+L(md): ldr r6, [ap, #4]!
+ orr r7, r7, r8, lsl tnc
+ str r7, [rp], #4
+ mov r7, r8, lsr cnt
+
+L(ed): orr r7, r7, r6, lsl tnc
+ str r7, [rp], #4
+ mov r7, r6, lsr cnt
+L(ed1): str r7, [rp], #4
+ mov r0, r4, lsl tnc
+')
+ pop {r4, r6, r7, r8}
+ bx r14
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/neon/lshiftc.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/neon/lshiftc.asm
new file mode 100644
index 00000000000..9e4096256d4
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/neon/lshiftc.asm
@@ -0,0 +1,257 @@
+dnl ARM Neon mpn_lshiftc.
+
+dnl Contributed to the GNU project by Torbjörn Granlund.
+
+dnl Copyright 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/limb cycles/limb cycles/limb good
+C aligned unaligned best seen for cpu?
+C StrongARM - -
+C XScale - -
+C Cortex-A7 ? ?
+C Cortex-A8 ? ?
+C Cortex-A9 3.5 3.5 Y
+C Cortex-A15 1.75 1.75 Y
+
+
+C We read 64 bits at a time at 32-bit aligned addresses, and except for the
+C first and last store, we write using 64-bit aligned addresses. All shifting
+C is done on 64-bit words in 'extension' registers.
+C
+C It should be possible to read also using 64-bit alignment, by manipulating
+C the shift count for unaligned operands. Not done, since it does not seem to
+C matter for A9 or A15.
+C
+C This will not work in big-endian mode.
+
+C TODO
+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
+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.
+
+C INPUT PARAMETERS
+define(`rp', `r0')
+define(`ap', `r1')
+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()
+ TEXT
+ ALIGN(64)
+PROLOGUE(mpn_lshiftc)
+IFLSH(` mov r12, n, lsl #2 ')
+IFLSH(` add rp, rp, r12 ')
+IFLSH(` 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
+
+IFLSH(` sub ap, ap, #8 ')
+ vld1.32 {d19}, [ap], r12 C load initial 2 limbs
+ vshl.u64 d18, d19, d7 C retval
+
+ 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
+ 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
+ vld1.32 {d19}, [ap], r12 C load ap[1] and ap[2]
+
+L(rp_aligned):
+IFLSH(` sub rp, rp, #8 ')
+ subs n, n, #6
+ vmvn d19, d19
+ blt L(two_or_three_more)
+ tst n, #2
+ beq L(2)
+
+L(1): vld1.32 {d17}, [ap], r12
+ vshl.u64 d5, d19, d6
+ vmvn d17, d17
+ vld1.32 {d16}, [ap], r12
+ vshl.u64 d0, d17, d7
+ vshl.u64 d4, d17, d6
+ sub n, n, #2
+ b L(mid)
+
+L(2): vld1.32 {d16}, [ap], r12
+ vshl.u64 d4, d19, d6
+ vmvn d16, d16
+ vld1.32 {d17}, [ap], r12
+ vshl.u64 d1, d16, d7
+ vshl.u64 d5, d16, d6
+ subs n, n, #4
+ blt L(end)
+
+L(top): vmvn d17, d17
+ vld1.32 {d16}, [ap], r12
+ vorr d2, d4, d1
+ vshl.u64 d0, d17, d7
+ vshl.u64 d4, d17, d6
+ vst1.32 {d2}, [rp:64], r12
+L(mid): vmvn d16, d16
+ vld1.32 {d17}, [ap], r12
+ vorr d3, d5, d0
+ vshl.u64 d1, d16, d7
+ vshl.u64 d5, d16, d6
+ vst1.32 {d3}, [rp:64], r12
+ subs n, n, #4
+ bge L(top)
+
+L(end): tst n, #1
+ beq L(evn)
+
+ vorr d2, d4, d1
+ vst1.32 {d2}, [rp:64], r12
+ b L(cj1)
+
+L(evn): vmvn d17, d17
+ vorr d2, d4, d1
+ vshl.u64 d0, d17, d7
+ vshl.u64 d4, d17, d6
+ vst1.32 {d2}, [rp:64], r12
+ vmvn.u8 d17, #0
+ vorr d2, d5, d0
+ vshl.u64 d0, d17, d7
+ vorr d3, d4, d0
+ b L(cj2)
+
+C Load last 2 - 3 limbs, store last 4 - 5 limbs
+L(two_or_three_more):
+ tst n, #1
+ beq L(l2)
+
+L(l3): vshl.u64 d5, d19, d6
+ vld1.32 {d17}, [ap], r12
+L(cj1): vmov.u8 d16, #0
+IFLSH(` add ap, ap, #4 ')
+ vmvn d17, d17
+ vld1.32 {d16[Y]}, [ap], r12
+ vshl.u64 d0, d17, d7
+ vshl.u64 d4, d17, d6
+ vmvn d16, d16
+ vorr d3, d5, d0
+ vshl.u64 d1, d16, d7
+ vshl.u64 d5, d16, d6
+ 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]
+ bx lr
+
+L(l2): vld1.32 {d16}, [ap], r12
+ vshl.u64 d4, d19, d6
+ vmvn d16, d16
+ vshl.u64 d1, d16, d7
+ vshl.u64 d5, d16, d6
+ vmvn.u8 d17, #0
+ vorr d2, d4, d1
+ vshl.u64 d0, d17, d7
+ vorr d3, d5, d0
+L(cj2): vst1.32 {d2}, [rp:64], r12
+ vst1.32 {d3}, [rp]
+ vmov.32 r0, d18[X]
+ bx lr
+
+
+define(`tnc', `r12')
+L(base):
+ push {r4, r6, r7, r8}
+ ldr r4, [ap, #-4]!
+ rsb tnc, cnt, #32
+ mvn r6, r4
+
+ mov r7, r6, lsl cnt
+ tst n, #1
+ beq L(ev) C n even
+
+L(od): subs n, n, #2
+ bcc L(ed1) C n = 1
+ ldr r8, [ap, #-4]!
+ mvn r8, r8
+ b L(md) C n = 3
+
+L(ev): ldr r6, [ap, #-4]!
+ mvn r6, r6
+ subs n, n, #2
+ beq L(ed) C n = 3
+ C n = 4
+L(tp): ldr r8, [ap, #-4]!
+ orr r7, r7, r6, lsr tnc
+ str r7, [rp, #-4]!
+ mvn r8, r8
+ mov r7, r6, lsl cnt
+L(md): ldr r6, [ap, #-4]!
+ orr r7, r7, r8, lsr tnc
+ str r7, [rp, #-4]!
+ mvn r6, r6
+ mov r7, r8, lsl cnt
+
+L(ed): orr r7, r7, r6, lsr tnc
+ str r7, [rp, #-4]!
+ mov r7, r6, lsl cnt
+L(ed1): mvn r6, #0
+ orr r7, r7, r6, lsr tnc
+ str r7, [rp, #-4]
+ mov r0, r4, lsr tnc
+ pop {r4, r6, r7, r8}
+ bx r14
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/neon/popcount.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/neon/popcount.asm
new file mode 100644
index 00000000000..2f8f9afc8d6
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/neon/popcount.asm
@@ -0,0 +1,166 @@
+dnl ARM Neon mpn_popcount -- mpn bit population count.
+
+dnl Copyright 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/limb
+C StrongARM: -
+C XScale -
+C Cortex-A7 ?
+C Cortex-A8 ?
+C Cortex-A9 1.125
+C Cortex-A15 0.56
+
+C TODO
+C * Explore using vldr and vldm. Does it help on A9? (These loads do
+C 64-bits-at-a-time, which will mess up in big-endian mode. Except not for
+C popcount. Except perhaps also for popcount for the edge loads.)
+C * Arrange to align the pointer, if that helps performance. Use the same
+C read-and-mask trick we use on PCs, for simplicity and performance. (Sorry
+C valgrind!)
+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.
+
+C INPUT PARAMETERS
+define(`ap', r0)
+define(`n', r1)
+
+C We sum into 16 16-bit counters in q8,q9, but at the end we sum them and end
+C up with 8 16-bit counters. Therefore, we can sum to 8(2^16-1) bits, or
+C (8*2^16-1)/32 = 0x3fff limbs. We use a chunksize close to that, but which
+C can be represented as a 8-bit ARM constant.
+C
+define(`chunksize',0x3f80)
+
+ASM_START()
+PROLOGUE(mpn_popcount)
+
+ cmp n, #chunksize
+ bhi L(gt16k)
+
+L(lt16k):
+ vmov.i64 q8, #0 C clear summation register
+ vmov.i64 q9, #0 C clear summation register
+
+ tst n, #1
+ beq L(xxx0)
+ vmov.i64 d0, #0
+ sub n, n, #1
+ vld1.32 {d0[0]}, [ap]! C load 1 limb
+ vcnt.8 d24, d0
+ vpadal.u8 d16, d24 C d16/q8 = 0; could just splat
+
+L(xxx0):tst n, #2
+ beq L(xx00)
+ sub n, n, #2
+ vld1.32 {d0}, [ap]! C load 2 limbs
+ vcnt.8 d24, d0
+ vpadal.u8 d16, d24
+
+L(xx00):tst n, #4
+ beq L(x000)
+ sub n, n, #4
+ vld1.32 {q0}, [ap]! C load 4 limbs
+ vcnt.8 q12, q0
+ vpadal.u8 q8, q12
+
+L(x000):tst n, #8
+ beq L(0000)
+
+ subs n, n, #8
+ vld1.32 {q0,q1}, [ap]! C load 8 limbs
+ bls L(sum)
+
+L(gt8): vld1.32 {q2,q3}, [ap]! C load 8 limbs
+ sub n, n, #8
+ vcnt.8 q12, q0
+ vcnt.8 q13, q1
+ b L(mid)
+
+L(0000):subs n, n, #16
+ blo L(e0)
+
+ vld1.32 {q2,q3}, [ap]! C load 8 limbs
+ vld1.32 {q0,q1}, [ap]! C load 8 limbs
+ vcnt.8 q12, q2
+ vcnt.8 q13, q3
+ subs n, n, #16
+ blo L(end)
+
+L(top): vld1.32 {q2,q3}, [ap]! C load 8 limbs
+ vpadal.u8 q8, q12
+ vcnt.8 q12, q0
+ vpadal.u8 q9, q13
+ vcnt.8 q13, q1
+L(mid): vld1.32 {q0,q1}, [ap]! C load 8 limbs
+ subs n, n, #16
+ vpadal.u8 q8, q12
+ vcnt.8 q12, q2
+ vpadal.u8 q9, q13
+ vcnt.8 q13, q3
+ bhs L(top)
+
+L(end): vpadal.u8 q8, q12
+ vpadal.u8 q9, q13
+L(sum): vcnt.8 q12, q0
+ vcnt.8 q13, q1
+ vpadal.u8 q8, q12
+ vpadal.u8 q9, q13
+ vadd.i16 q8, q8, q9
+ C we have 8 16-bit counts
+L(e0): vpaddl.u16 q8, q8 C we have 4 32-bit counts
+ vpaddl.u32 q8, q8 C we have 2 64-bit counts
+ vmov.32 r0, d16[0]
+ vmov.32 r1, d17[0]
+ add r0, r0, r1
+ bx lr
+
+C Code for large count. Splits operand and calls above code.
+define(`ap2', r2) C caller-saves reg not used above
+L(gt16k):
+ push {r4,r14}
+ mov ap2, ap
+ mov r3, n C full count
+ mov r4, #0 C total sum
+
+1: mov n, #chunksize C count for this invocation
+ bl L(lt16k) C could jump deep inside code
+ add ap2, ap2, #chunksize*4 C point at next chunk
+ add r4, r4, r0
+ mov ap, ap2 C put chunk pointer in place for call
+ sub r3, r3, #chunksize
+ cmp r3, #chunksize
+ bhi 1b
+
+ mov n, r3 C count for final invocation
+ bl L(lt16k)
+ add r0, r4, r0
+ pop {r4,pc}
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/neon/sec_tabselect.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/neon/sec_tabselect.asm
new file mode 100644
index 00000000000..69fceb00635
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/neon/sec_tabselect.asm
@@ -0,0 +1,140 @@
+dnl ARM Neon mpn_sec_tabselect.
+
+dnl Contributed to the GNU project by Torbjörn Granlund.
+
+dnl Copyright 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/limb
+C StrongARM -
+C XScale -
+C Cortex-A7 ?
+C Cortex-A8 ?
+C Cortex-A9 1.15
+C Cortex-A15 0.65
+
+define(`rp', `r0')
+define(`tp', `r1')
+define(`n', `r2')
+define(`nents', `r3')
+C define(`which', on stack)
+
+define(`i', `r4')
+define(`j', `r5')
+
+define(`maskq', `q10')
+define(`maskd', `d20')
+
+ASM_START()
+PROLOGUE(mpn_sec_tabselect)
+ push {r4-r5}
+
+ add r4, sp, #8
+ vld1.32 {d30[], d31[]}, [r4] C 4 `which' copies
+ vmov.i32 q14, #1 C 4 copies of 1
+
+ subs j, n, #8
+ bmi L(outer_end)
+
+L(outer_top):
+ mov i, nents
+ mov r12, tp C preserve tp
+ veor q13, q13, q13 C 4 counter copies
+ veor q2, q2, q2
+ veor q3, q3, q3
+ ALIGN(16)
+L(top): vceq.i32 maskq, q13, q15 C compare idx copies to `which' copies
+ vld1.32 {q0,q1}, [tp]
+ vadd.i32 q13, q13, q14
+ vbit q2, q0, maskq
+ vbit q3, q1, maskq
+ add tp, tp, n, lsl #2
+ subs i, i, #1
+ bne L(top)
+ vst1.32 {q2,q3}, [rp]!
+ add tp, r12, #32 C restore tp, point to next slice
+ subs j, j, #8
+ bpl L(outer_top)
+L(outer_end):
+
+ tst n, #4
+ beq L(b0xx)
+L(b1xx):mov i, nents
+ mov r12, tp
+ veor q13, q13, q13
+ veor q2, q2, q2
+ ALIGN(16)
+L(tp4): vceq.i32 maskq, q13, q15
+ vld1.32 {q0}, [tp]
+ vadd.i32 q13, q13, q14
+ vbit q2, q0, maskq
+ add tp, tp, n, lsl #2
+ subs i, i, #1
+ bne L(tp4)
+ vst1.32 {q2}, [rp]!
+ add tp, r12, #16
+
+L(b0xx):tst n, #2
+ beq L(b00x)
+L(b01x):mov i, nents
+ mov r12, tp
+ veor d26, d26, d26
+ veor d4, d4, d4
+ ALIGN(16)
+L(tp2): vceq.i32 maskd, d26, d30
+ vld1.32 {d0}, [tp]
+ vadd.i32 d26, d26, d28
+ vbit d4, d0, maskd
+ add tp, tp, n, lsl #2
+ subs i, i, #1
+ bne L(tp2)
+ vst1.32 {d4}, [rp]!
+ add tp, r12, #8
+
+L(b00x):tst n, #1
+ beq L(b000)
+L(b001):mov i, nents
+ mov r12, tp
+ veor d26, d26, d26
+ veor d4, d4, d4
+ ALIGN(16)
+L(tp1): vceq.i32 maskd, d26, d30
+ vld1.32 {d0[0]}, [tp]
+ vadd.i32 d26, d26, d28
+ vbit d4, d0, maskd
+ add tp, tp, n, lsl #2
+ subs i, i, #1
+ bne L(tp1)
+ vst1.32 {d4[0]}, [rp]
+
+L(b000):pop {r4-r5}
+ bx r14
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/rsh1aors_n.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/rsh1aors_n.asm
new file mode 100644
index 00000000000..95c1f79ad9f
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/rsh1aors_n.asm
@@ -0,0 +1,124 @@
+dnl ARM mpn_rsh1add_n and mpn_rsh1sub_n.
+
+dnl Contributed to the GNU project by Torbjörn Granlund.
+
+dnl Copyright 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/limb
+C StrongARM ?
+C XScale ?
+C Cortex-A7 ?
+C Cortex-A8 ?
+C Cortex-A9 3.64-3.7
+C Cortex-A15 2.5
+
+C TODO
+C * Not optimised.
+
+define(`rp', `r0')
+define(`up', `r1')
+define(`vp', `r2')
+define(`n', `r3')
+
+ifdef(`OPERATION_rsh1add_n', `
+ define(`ADDSUB', adds)
+ define(`ADDSUBC', adcs)
+ define(`RSTCY', `cmn $1, $1')
+ define(`func', mpn_rsh1add_n)
+ define(`func_nc', mpn_rsh1add_nc)')
+ifdef(`OPERATION_rsh1sub_n', `
+ define(`ADDSUB', subs)
+ define(`ADDSUBC', sbcs)
+ define(`RSTCY',
+ `mvn $2, #0x80000000
+ cmp $2, $1')
+ define(`func', mpn_rsh1sub_n)
+ define(`func_nc', mpn_rsh1sub_nc)')
+
+MULFUNC_PROLOGUE(mpn_rsh1add_n mpn_rsh1sub_n)
+
+ASM_START()
+PROLOGUE(func)
+ push {r4-r11}
+ ldr r4, [up], #4
+ ldr r8, [vp], #4
+ ADDSUB r4, r4, r8
+ movs r12, r7, rrx
+ and r11, r4, #1 C return value
+ subs n, n, #4
+ blo L(end)
+
+L(top): ldmia up!, {r5,r6,r7}
+ ldmia vp!, {r8,r9,r10}
+ cmn r12, r12
+ ADDSUBC r5, r5, r8
+ ADDSUBC r6, r6, r9
+ ADDSUBC r7, r7, r10
+ movs r12, r7, rrx
+ movs r6, r6, rrx
+ movs r5, r5, rrx
+ movs r4, r4, rrx
+ subs n, n, #3
+ stmia rp!, {r4,r5,r6}
+ mov r4, r7
+ bhs L(top)
+
+L(end): cmn n, #2
+ bls L(e2)
+ ldm up, {r5,r6}
+ ldm vp, {r8,r9}
+ cmn r12, r12
+ ADDSUBC r5, r5, r8
+ ADDSUBC r6, r6, r9
+ movs r12, r6, rrx
+ movs r5, r5, rrx
+ movs r4, r4, rrx
+ stmia rp!, {r4,r5}
+ mov r4, r6
+ b L(e1)
+
+L(e2): bne L(e1)
+ ldr r5, [up, #0]
+ ldr r8, [vp, #0]
+ cmn r12, r12
+ ADDSUBC r5, r5, r8
+ movs r12, r5, rrx
+ movs r4, r4, rrx
+ str r4, [rp], #4
+ mov r4, r5
+
+L(e1): RSTCY( r12, r1)
+ mov r4, r4, rrx
+ str r4, [rp, #0]
+ mov r0, r11
+ pop {r4-r11}
+ bx r14
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/rshift.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/rshift.asm
new file mode 100644
index 00000000000..84728d038a7
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/rshift.asm
@@ -0,0 +1,86 @@
+dnl ARM mpn_rshift.
+
+dnl Contributed to the GNU project by Torbjörn Granlund.
+
+dnl Copyright 1997, 2000, 2001, 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/limb
+C StrongARM ?
+C XScale ?
+C Cortex-A7 ?
+C Cortex-A8 ?
+C Cortex-A9 3.5
+C Cortex-A15 ?
+
+define(`rp', `r0')
+define(`up', `r1')
+define(`n', `r2')
+define(`cnt', `r3')
+define(`tnc', `r12')
+
+ASM_START()
+PROLOGUE(mpn_rshift)
+ push {r4, r6, r7, r8}
+ ldr r4, [up]
+ rsb tnc, cnt, #32
+
+ mov r7, r4, lsr cnt
+ tst n, #1
+ beq L(evn) C n even
+
+L(odd): subs n, n, #2
+ bcc L(1) C n = 1
+ ldr r8, [up, #4]!
+ b L(mid)
+
+L(evn): ldr r6, [up, #4]!
+ subs n, n, #2
+ beq L(end)
+
+L(top): ldr r8, [up, #4]!
+ orr r7, r7, r6, lsl tnc
+ str r7, [rp], #4
+ mov r7, r6, lsr cnt
+L(mid): ldr r6, [up, #4]!
+ orr r7, r7, r8, lsl tnc
+ str r7, [rp], #4
+ mov r7, r8, lsr cnt
+ subs n, n, #2
+ bgt L(top)
+
+L(end): orr r7, r7, r6, lsl tnc
+ str r7, [rp], #4
+ mov r7, r6, lsr cnt
+L(1): str r7, [rp]
+ mov r0, r4, lsl tnc
+ pop {r4, r6, r7, r8}
+ bx r14
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/sec_tabselect.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/sec_tabselect.asm
new file mode 100644
index 00000000000..8cf937a0917
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/sec_tabselect.asm
@@ -0,0 +1,131 @@
+dnl ARM mpn_sec_tabselect
+
+dnl Contributed to the GNU project by Torbjörn Granlund.
+
+dnl Copyright 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/limb
+C StrongARM ?
+C XScale ?
+C Cortex-A7 ?
+C Cortex-A8 ?
+C Cortex-A9 2.33
+C Cortex-A15 2.2
+
+C TODO
+C * Consider using special code for small nents, either swapping the inner and
+C outer loops, or providing a few completely unrolling the inner loops.
+
+define(`rp', `r0')
+define(`tp', `r1')
+define(`n', `r2')
+define(`nents', `r3')
+C which on stack
+
+define(`i', `r11')
+define(`j', `r12')
+define(`c', `r14')
+define(`mask', `r7')
+
+ASM_START()
+PROLOGUE(mpn_sec_tabselect)
+ push {r4-r11, r14}
+
+ subs j, n, #3
+ bmi L(outer_end)
+L(outer_top):
+ ldr c, [sp, #36]
+ mov i, nents
+ push {tp}
+
+ mov r8, #0
+ mov r9, #0
+ mov r10, #0
+
+L(top): subs c, c, #1
+ ldm tp, {r4,r5,r6}
+ sbc mask, mask, mask
+ subs i, i, #1
+ add tp, tp, n, lsl #2
+ and r4, r4, mask
+ and r5, r5, mask
+ and r6, r6, mask
+ orr r8, r8, r4
+ orr r9, r9, r5
+ orr r10, r10, r6
+ bge L(top)
+
+ stmia rp!, {r8,r9,r10}
+ pop {tp}
+ add tp, tp, #12
+ subs j, j, #3
+ bpl L(outer_top)
+L(outer_end):
+
+ cmp j, #-1
+ bne L(n2)
+
+ ldr c, [sp, #36]
+ mov i, nents
+ mov r8, #0
+ mov r9, #0
+L(tp2): subs c, c, #1
+ sbc mask, mask, mask
+ ldm tp, {r4,r5}
+ subs i, i, #1
+ add tp, tp, n, lsl #2
+ and r4, r4, mask
+ and r5, r5, mask
+ orr r8, r8, r4
+ orr r9, r9, r5
+ bge L(tp2)
+ stmia rp, {r8,r9}
+ pop {r4-r11, r14}
+ bx lr
+
+L(n2): cmp j, #-2
+ bne L(n1)
+
+ ldr c, [sp, #36]
+ mov i, nents
+ mov r8, #0
+L(tp1): subs c, c, #1
+ sbc mask, mask, mask
+ ldr r4, [tp]
+ subs i, i, #1
+ add tp, tp, n, lsl #2
+ and r4, r4, mask
+ orr r8, r8, r4
+ bge L(tp1)
+ str r8, [rp]
+L(n1): pop {r4-r11, r14}
+ bx lr
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/udiv.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/udiv.asm
new file mode 100644
index 00000000000..8d441c74edd
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/udiv.asm
@@ -0,0 +1,104 @@
+dnl ARM mpn_udiv_qrnnd -- divide a two limb dividend and a one limb divisor.
+dnl Return quotient and store remainder through a supplied pointer.
+
+dnl Copyright 2001, 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 INPUT PARAMETERS
+define(`rem_ptr',`r0')
+define(`n1',`r1')
+define(`n0',`r2')
+define(`d',`r3')
+
+C divstep -- develop one quotient bit. Dividend in $1$2, divisor in $3.
+C Quotient bit is shifted into $2.
+define(`divstep',
+ `adcs $2, $2, $2
+ adc $1, $1, $1
+ cmp $1, $3
+ subcs $1, $1, $3')
+
+ASM_START()
+PROLOGUE(mpn_udiv_qrnnd)
+ mov r12, #8 C loop counter for both loops below
+ cmp d, #0x80000000 C check divisor msb and clear carry
+ bcs L(_large_divisor)
+
+L(oop): divstep(n1,n0,d)
+ divstep(n1,n0,d)
+ divstep(n1,n0,d)
+ divstep(n1,n0,d)
+ sub r12, r12, #1
+ teq r12, #0
+ bne L(oop)
+
+ str n1, [rem_ptr] C store remainder
+ adc r0, n0, n0 C quotient: add last carry from divstep
+ bx lr
+
+L(_large_divisor):
+ stmfd sp!, { r8, lr }
+
+ and r8, n0, #1 C save lsb of dividend
+ mov lr, n1, lsl #31
+ orrs n0, lr, n0, lsr #1 C n0 = lo(n1n0 >> 1)
+ mov n1, n1, lsr #1 C n1 = hi(n1n0 >> 1)
+
+ and lr, d, #1 C save lsb of divisor
+ movs d, d, lsr #1 C d = floor(orig_d / 2)
+ adc d, d, #0 C d = ceil(orig_d / 2)
+
+L(oop2):
+ divstep(n1,n0,d)
+ divstep(n1,n0,d)
+ divstep(n1,n0,d)
+ divstep(n1,n0,d)
+ sub r12, r12, #1
+ teq r12, #0
+ bne L(oop2)
+
+ adc n0, n0, n0 C shift and add last carry from divstep
+ add n1, r8, n1, lsl #1 C shift in omitted dividend lsb
+ tst lr, lr C test saved divisor lsb
+ beq L(_even_divisor)
+
+ rsb d, lr, d, lsl #1 C restore orig d value
+ adds n1, n1, n0 C fix remainder for omitted divisor lsb
+ addcs n0, n0, #1 C adjust quotient if rem. fix carried
+ subcs n1, n1, d C adjust remainder accordingly
+ cmp n1, d C remainder >= divisor?
+ subcs n1, n1, d C adjust remainder
+ addcs n0, n0, #1 C adjust quotient
+
+L(_even_divisor):
+ str n1, [rem_ptr] C store remainder
+ mov r0, n0 C quotient
+ ldmfd sp!, { r8, pc }
+EPILOGUE(mpn_udiv_qrnnd)
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/v5/gcd_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/v5/gcd_1.asm
new file mode 100644
index 00000000000..169d154bf0b
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/v5/gcd_1.asm
@@ -0,0 +1,120 @@
+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()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/v5/mod_1_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/v5/mod_1_1.asm
new file mode 100644
index 00000000000..3cf0cd77636
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/v5/mod_1_1.asm
@@ -0,0 +1,129 @@
+dnl ARM mpn_mod_1_1p
+
+dnl Contributed to the GNU project by Torbjörn Granlund.
+
+dnl Copyright 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/limb
+C StrongARM -
+C XScale ?
+C Cortex-A7 ?
+C Cortex-A8 ?
+C Cortex-A9 7
+C Cortex-A15 6
+
+define(`ap', `r0')
+define(`n', `r1')
+define(`d', `r2')
+define(`cps',`r3')
+
+ASM_START()
+PROLOGUE(mpn_mod_1_1p)
+ push {r4-r10}
+ add r0, r0, r1, asl #2
+ ldr r5, [r0, #-4]!
+ ldr r12, [r0, #-4]!
+ subs r1, r1, #2
+ ble L(4)
+ ldr r8, [r3, #12]
+ mov r4, r12
+ mov r10, r5
+ umull r7, r5, r10, r8
+ sub r1, r1, #1
+ b L(mid)
+
+L(top): adds r12, r6, r7
+ adcs r10, r4, r5
+ sub r1, r1, #1
+ mov r6, #0
+ movcs r6, r8
+ umull r7, r5, r10, r8
+ adds r4, r12, r6
+ subcs r4, r4, r2
+L(mid): ldr r6, [r0, #-4]!
+ teq r1, #0
+ bne L(top)
+
+ adds r12, r6, r7
+ adcs r5, r4, r5
+ subcs r5, r5, r2
+L(4): ldr r1, [r3, #4]
+ cmp r1, #0
+ beq L(7)
+ ldr r4, [r3, #8]
+ umull r0, r6, r5, r4
+ adds r12, r0, r12
+ addcs r6, r6, #1
+ rsb r0, r1, #32
+ mov r0, r12, lsr r0
+ orr r5, r0, r6, asl r1
+ mov r12, r12, asl r1
+ b L(8)
+L(7): cmp r5, r2
+ subcs r5, r5, r2
+L(8): ldr r0, [r3, #0]
+ umull r4, r3, r5, r0
+ add r5, r5, #1
+ adds r0, r4, r12
+ adc r5, r3, r5
+ mul r5, r2, r5
+ sub r12, r12, r5
+ cmp r12, r0
+ addhi r12, r12, r2
+ cmp r2, r12
+ subls r12, r12, r2
+ mov r0, r12, lsr r1
+ pop {r4-r10}
+ bx r14
+EPILOGUE()
+
+PROLOGUE(mpn_mod_1_1p_cps)
+ stmfd sp!, {r4, r5, r6, r14}
+ mov r5, r0
+ clz r4, r1
+ mov r0, r1, asl r4
+ rsb r6, r0, #0
+ bl mpn_invert_limb
+ str r0, [r5, #0]
+ str r4, [r5, #4]
+ cmp r4, #0
+ beq L(2)
+ rsb r1, r4, #32
+ mov r3, #1
+ mov r3, r3, asl r4
+ orr r3, r3, r0, lsr r1
+ mul r3, r6, r3
+ mov r4, r3, lsr r4
+ str r4, [r5, #8]
+L(2): mul r0, r6, r0
+ str r0, [r5, #12]
+ ldmfd sp!, {r4, r5, r6, pc}
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/v5/mod_1_2.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/v5/mod_1_2.asm
new file mode 100644
index 00000000000..aa26ecb21c1
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/v5/mod_1_2.asm
@@ -0,0 +1,156 @@
+dnl ARM mpn_mod_1s_2p
+
+dnl Contributed to the GNU project by Torbjörn Granlund.
+
+dnl Copyright 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/limb
+C StrongARM -
+C XScale ?
+C Cortex-A7 ?
+C Cortex-A8 ?
+C Cortex-A9 4.25
+C Cortex-A15 3
+
+define(`ap', `r0')
+define(`n', `r1')
+define(`d', `r2')
+define(`cps',`r3')
+
+ASM_START()
+PROLOGUE(mpn_mod_1s_2p)
+ push {r4-r10}
+ tst n, #1
+ add r7, r3, #8
+ ldmia r7, {r7, r8, r12} C load B1, B2, B3
+ add ap, ap, n, lsl #2 C put ap at operand end
+ beq L(evn)
+
+L(odd): subs n, n, #1
+ beq L(1)
+ ldmdb ap!, {r4,r6,r9}
+ mov r10, #0
+ umlal r4, r10, r6, r7
+ umlal r4, r10, r9, r8
+ b L(com)
+
+L(evn): ldmdb ap!, {r4,r10}
+L(com): subs n, n, #2
+ ble L(end)
+ ldmdb ap!, {r5,r6}
+ b L(mid)
+
+L(top): mov r9, #0
+ umlal r5, r9, r6, r7 C B1
+ umlal r5, r9, r4, r8 C B2
+ ldmdb ap!, {r4,r6}
+ umlal r5, r9, r10, r12 C B3
+ ble L(xit)
+ mov r10, #0
+ umlal r4, r10, r6, r7 C B1
+ umlal r4, r10, r5, r8 C B2
+ ldmdb ap!, {r5,r6}
+ umlal r4, r10, r9, r12 C B3
+L(mid): subs n, n, #4
+ bge L(top)
+
+ mov r9, #0
+ umlal r5, r9, r6, r7 C B1
+ umlal r5, r9, r4, r8 C B2
+ umlal r5, r9, r10, r12 C B3
+ mov r4, r5
+
+L(end): movge r9, r10 C executed iff coming via xit
+ ldr r6, [r3, #4] C cps[1] = cnt
+ mov r5, #0
+ umlal r4, r5, r9, r7
+ mov r7, r5, lsl r6
+L(x): rsb r1, r6, #32
+ orr r8, r7, r4, lsr r1
+ mov r9, r4, lsl r6
+ ldr r5, [r3, #0]
+ add r0, r8, #1
+ umull r12, r1, r8, r5
+ adds r4, r12, r9
+ adc r1, r1, r0
+ mul r5, r2, r1
+ sub r9, r9, r5
+ cmp r9, r4
+ addhi r9, r9, r2
+ cmp r2, r9
+ subls r9, r9, r2
+ mov r0, r9, lsr r6
+ pop {r4-r10}
+ bx r14
+
+L(xit): mov r10, #0
+ umlal r4, r10, r6, r7 C B1
+ umlal r4, r10, r5, r8 C B2
+ umlal r4, r10, r9, r12 C B3
+ b L(end)
+
+L(1): ldr r6, [r3, #4] C cps[1] = cnt
+ ldr r4, [ap, #-4] C ap[0]
+ mov r7, #0
+ b L(x)
+EPILOGUE()
+
+PROLOGUE(mpn_mod_1s_2p_cps)
+ push {r4-r8, r14}
+ clz r4, r1
+ mov r5, r1, lsl r4 C b <<= cnt
+ mov r6, r0 C r6 = cps
+ mov r0, r5
+ bl mpn_invert_limb
+ rsb r3, r4, #32
+ mov r3, r0, lsr r3
+ mov r2, #1
+ orr r3, r3, r2, lsl r4
+ rsb r1, r5, #0
+ mul r2, r1, r3
+ umull r3, r12, r2, r0
+ add r12, r2, r12
+ mvn r12, r12
+ mul r1, r5, r12
+ cmp r1, r3
+ addhi r1, r1, r5
+ umull r12, r7, r1, r0
+ add r7, r1, r7
+ mvn r7, r7
+ mul r3, r5, r7
+ cmp r3, r12
+ addhi r3, r3, r5
+ mov r5, r2, lsr r4
+ mov r7, r1, lsr r4
+ mov r8, r3, lsr r4
+ stmia r6, {r0,r4,r5,r7,r8} C fill cps
+ pop {r4-r8, pc}
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/v6/addmul_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/v6/addmul_1.asm
new file mode 100644
index 00000000000..57019e4b2b6
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/v6/addmul_1.asm
@@ -0,0 +1,111 @@
+dnl ARM mpn_addmul_1.
+
+dnl Copyright 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/limb
+C StrongARM: -
+C XScale -
+C Cortex-A7 ?
+C Cortex-A8 ?
+C Cortex-A9 3.25
+C Cortex-A15 4
+
+C TODO
+C * Micro-optimise feed-in code.
+C * Optimise for n=1,2 by delaying register saving.
+C * Try using ldm/stm.
+
+define(`rp',`r0')
+define(`up',`r1')
+define(`n', `r2')
+define(`v0',`r3')
+
+ASM_START()
+PROLOGUE(mpn_addmul_1)
+ stmfd sp!, { r4, r5, r6, r7 }
+
+ ands r6, n, #3
+ mov r12, #0
+ beq L(fi0)
+ cmp r6, #2
+ bcc L(fi1)
+ beq L(fi2)
+
+L(fi3): ldr r4, [up], #4
+ ldr r6, [rp, #0]
+ ldr r5, [up], #4
+ b L(lo3)
+
+L(fi0): ldr r5, [up], #4
+ ldr r7, [rp], #4
+ ldr r4, [up], #4
+ b L(lo0)
+
+L(fi1): ldr r4, [up], #4
+ ldr r6, [rp], #8
+ subs n, n, #1
+ beq L(1)
+ ldr r5, [up], #4
+ b L(lo1)
+
+L(fi2): ldr r5, [up], #4
+ ldr r7, [rp], #12
+ ldr r4, [up], #4
+ b L(lo2)
+
+ ALIGN(16)
+L(top): ldr r6, [rp, #-8]
+ ldr r5, [up], #4
+ str r7, [rp, #-12]
+L(lo1): umaal r6, r12, r4, v0
+ ldr r7, [rp, #-4]
+ ldr r4, [up], #4
+ str r6, [rp, #-8]
+L(lo0): umaal r7, r12, r5, v0
+ ldr r6, [rp, #0]
+ ldr r5, [up], #4
+ str r7, [rp, #-4]
+L(lo3): umaal r6, r12, r4, v0
+ ldr r7, [rp, #4]
+ ldr r4, [up], #4
+ str r6, [rp], #16
+L(lo2): umaal r7, r12, r5, v0
+ subs n, n, #4
+ bhi L(top)
+
+ ldr r6, [rp, #-8]
+ str r7, [rp, #-12]
+L(1): umaal r6, r12, r4, v0
+ str r6, [rp, #-8]
+ mov r0, r12
+ ldmfd sp!, { r4, r5, r6, r7 }
+ bx lr
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/v6/addmul_2.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/v6/addmul_2.asm
new file mode 100644
index 00000000000..69817ce340d
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/v6/addmul_2.asm
@@ -0,0 +1,138 @@
+dnl ARM mpn_addmul_2.
+
+dnl Contributed to the GNU project by Torbjörn Granlund.
+
+dnl Copyright 2012, 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/limb
+C StrongARM: -
+C XScale -
+C Cortex-A7 ?
+C Cortex-A8 ?
+C Cortex-A9 2.25
+C Cortex-A15 2.5
+
+C This is believed to be optimal for A15 for any unrolling, and optimal for A9
+C for 4-way unrolling. Using separate pointer update instructions is necessary
+C for optimal A9 speed.
+
+C TODO:
+C * Start the first multiply or multiplies directly at function entry.
+
+
+define(`rp',`r0')
+define(`up',`r1')
+define(`n', `r2')
+define(`vp',`r3')
+
+define(`v0',`r6')
+define(`v1',`r7')
+define(`u0',`r3')
+define(`u1',`r9')
+
+define(`cya',`r8')
+define(`cyb',`r12')
+
+
+ASM_START()
+PROLOGUE(mpn_addmul_2)
+ push { r4, r5, r6, r7, r8, r9 }
+
+ ldm vp, { v0, v1 }
+ mov cya, #0
+ mov cyb, #0
+
+ tst n, #1
+ beq L(evn)
+
+L(odd): ldr r5, [rp, #0]
+ ldr u0, [up, #0]
+ ldr r4, [rp, #4]
+ tst n, #2
+ beq L(fi1)
+L(fi3): sub up, up, #12
+ sub rp, rp, #12
+ b L(lo3)
+L(fi1): sub n, n, #1
+ sub up, up, #4
+ sub rp, rp, #4
+ b L(lo1)
+
+L(evn): ldr r4, [rp, #0]
+ ldr u1, [up, #0]
+ ldr r5, [rp, #4]
+ tst n, #2
+ bne L(fi2)
+L(fi0): sub up, up, #8
+ sub rp, rp, #8
+ b L(lo0)
+L(fi2): subs n, n, #2
+ bls L(end)
+
+ ALIGN(16)
+L(top): ldr u0, [up, #4]
+ umaal r4, cya, u1, v0
+ str r4, [rp, #0]
+ ldr r4, [rp, #8]
+ umaal r5, cyb, u1, v1
+L(lo1): ldr u1, [up, #8]
+ umaal r5, cya, u0, v0
+ str r5, [rp, #4]
+ ldr r5, [rp, #12]
+ umaal r4, cyb, u0, v1
+L(lo0): ldr u0, [up, #12]
+ umaal r4, cya, u1, v0
+ str r4, [rp, #8]
+ ldr r4, [rp, #16]
+ umaal r5, cyb, u1, v1
+L(lo3): ldr u1, [up, #16]
+ umaal r5, cya, u0, v0
+ str r5, [rp, #12]
+ ldr r5, [rp, #20]
+ add rp, rp, #16
+ umaal r4, cyb, u0, v1
+ add up, up, #16
+ subs n, n, #4
+ bhi L(top)
+
+L(end): umaal r4, cya, u1, v0
+ ldr u0, [up, #4]
+ umaal r5, cyb, u1, v1
+ str r4, [rp, #0]
+ umaal r5, cya, u0, v0
+ umaal cya, cyb, u0, v1
+ str r5, [rp, #4]
+ str cya, [rp, #8]
+ mov r0, cyb
+
+ pop { r4, r5, r6, r7, r8, r9 }
+ bx r14
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/v6/addmul_3.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/v6/addmul_3.asm
new file mode 100644
index 00000000000..046543020f5
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/v6/addmul_3.asm
@@ -0,0 +1,187 @@
+dnl ARM mpn_addmul_3.
+
+dnl Contributed to the GNU project by Torbjörn Granlund.
+
+dnl Copyright 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/limb
+C StrongARM: -
+C XScale -
+C Cortex-A7 ?
+C Cortex-A8 ?
+C Cortex-A9 2.125
+C Cortex-A15 2
+
+C TODO
+C * Use a fast path for n <= KARATSUBA_MUL_THRESHOLD using a jump table,
+C avoiding the current multiply.
+C * Start the first multiply or multiplies early.
+
+define(`rp',`r0')
+define(`up',`r1')
+define(`n', `r2')
+define(`vp',`r3')
+
+define(`v0',`r4') define(`v1',`r5') define(`v2',`r6')
+define(`u0',`r3') define(`u1',`r14')
+define(`w0',`r7') define(`w1',`r8') define(`w2',`r9')
+define(`cy0',`r10') define(`cy1',`r11') define(`cy2',`r12')
+
+
+ASM_START()
+PROLOGUE(mpn_addmul_3)
+ push { r4-r11, r14 }
+
+ ldr w0, =0xaaaaaaab C 3^{-1} mod 2^32
+ ldm vp, { v0,v1,v2 }
+ mov cy0, #0
+ mov cy1, #0
+ mov cy2, #0
+
+C Tricky n mod 6
+ mul w0, w0, n C n * 3^{-1} mod 2^32
+ and w0, w0, #0xc0000001 C pseudo-CRT mod 3,2
+ sub n, n, #3
+ifdef(`PIC',`
+ add pc, pc, w0, ror $28
+ nop
+ b L(b0)
+ b L(b2)
+ b L(b4)
+ .word 0xe7f000f0 C udf
+ b L(b3)
+ b L(b5)
+ b L(b1)
+',`
+ ldr pc, [pc, w0, ror $28]
+ nop
+ .word L(b0), L(b2), L(b4), 0, L(b3), L(b5), L(b1)
+')
+
+L(b5): add up, up, #-8
+ ldr w1, [rp, #0]
+ ldr w2, [rp, #4]
+ ldr u1, [up, #8]
+ b L(lo5)
+
+L(b4): add rp, rp, #-4
+ add up, up, #-12
+ ldr w2, [rp, #4]
+ ldr w0, [rp, #8]
+ ldr u0, [up, #12]
+ b L(lo4)
+
+L(b3): add rp, rp, #-8
+ add up, up, #-16
+ ldr w0, [rp, #8]
+ ldr w1, [rp, #12]
+ ldr u1, [up, #16]
+ b L(lo3)
+
+L(b1): add rp, rp, #8
+ ldr w2, [rp, #-8]
+ ldr w0, [rp, #-4]
+ ldr u1, [up, #0]
+ b L(lo1)
+
+L(b0): add rp, rp, #4
+ add up, up, #-4
+ ldr w0, [rp, #-4]
+ ldr w1, [rp, #0]
+ ldr u0, [up, #4]
+ b L(lo0)
+
+L(b2): add rp, rp, #12
+ add up, up, #4
+ ldr w1, [rp, #-12]
+ ldr w2, [rp, #-8]
+ ldr u0, [up, #-4]
+
+ ALIGN(16)
+L(top): ldr w0, [rp, #-4]
+ umaal w1, cy0, u0, v0
+ ldr u1, [up, #0]
+ umaal w2, cy1, u0, v1
+ str w1, [rp, #-12]
+ umaal w0, cy2, u0, v2
+L(lo1): ldr w1, [rp, #0]
+ umaal w2, cy0, u1, v0
+ ldr u0, [up, #4]
+ umaal w0, cy1, u1, v1
+ str w2, [rp, #-8]
+ umaal w1, cy2, u1, v2
+L(lo0): ldr w2, [rp, #4]
+ umaal w0, cy0, u0, v0
+ ldr u1, [up, #8]
+ umaal w1, cy1, u0, v1
+ str w0, [rp, #-4]
+ umaal w2, cy2, u0, v2
+L(lo5): ldr w0, [rp, #8]
+ umaal w1, cy0, u1, v0
+ ldr u0, [up, #12]
+ umaal w2, cy1, u1, v1
+ str w1, [rp, #0]
+ umaal w0, cy2, u1, v2
+L(lo4): ldr w1, [rp, #12]
+ umaal w2, cy0, u0, v0
+ ldr u1, [up, #16]
+ umaal w0, cy1, u0, v1
+ str w2, [rp, #4]
+ umaal w1, cy2, u0, v2
+L(lo3): ldr w2, [rp, #16]
+ umaal w0, cy0, u1, v0
+ ldr u0, [up, #20]
+ umaal w1, cy1, u1, v1
+ str w0, [rp, #8]
+ umaal w2, cy2, u1, v2
+L(lo2): subs n, n, #6
+ add up, up, #24
+ add rp, rp, #24
+ bge L(top)
+
+L(end): umaal w1, cy0, u0, v0
+ ldr u1, [up, #0]
+ umaal w2, cy1, u0, v1
+ str w1, [rp, #-12]
+ mov w0, #0
+ umaal w0, cy2, u0, v2
+ umaal w2, cy0, u1, v0
+ umaal w0, cy1, u1, v1
+ str w2, [rp, #-8]
+ umaal cy1, cy2, u1, v2
+ adds w0, w0, cy0
+ str w0, [rp, #-4]
+ adcs w1, cy1, #0
+ str w1, [rp, #0]
+ adc r0, cy2, #0
+
+ pop { r4-r11, pc }
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/v6/dive_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/v6/dive_1.asm
new file mode 100644
index 00000000000..92de81473f9
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/v6/dive_1.asm
@@ -0,0 +1,149 @@
+dnl ARM v6 mpn_divexact_1
+
+dnl Contributed to the GNU project by Torbjörn Granlund.
+
+dnl Copyright 2012, 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/limb cycles/limb
+C norm unorm modexact_1c_odd
+C StrongARM - -
+C XScale - -
+C Cortex-A7 ? ?
+C Cortex-A8 ? ?
+C Cortex-A9 9 10 9
+C Cortex-A15 7 7 7
+
+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(`cy', `r7')
+define(`cnt', `r6')
+define(`tnc', `r10')
+
+ASM_START()
+PROLOGUE(mpn_divexact_1)
+ push {r4,r5,r6,r7,r8,r9}
+
+ tst d, #1
+
+ rsb r4, d, #0
+ and r4, r4, d
+ clz r4, r4
+ rsb cnt, r4, #31 C count_trailing_zeros
+ mov d, d, lsr cnt
+
+C binvert limb
+ LEA( r4, binvert_limb_table)
+ and r12, d, #254
+ ldrb r4, [r4, r12, lsr #1]
+ mul r12, r4, r4
+ mul r12, d, r12
+ rsb r12, r12, r4, lsl #1
+ mul r4, r12, r12
+ mul r4, d, r4
+ rsb r4, r4, r12, lsl #1 C r4 = inverse
+
+ ldr r5, [up], #4 C up[0]
+ mov cy, #0
+ rsb r8, r4, #0 C r8 = -inverse
+ beq L(unnorm)
+
+L(norm):
+ subs n, n, #1
+ mul r5, r5, r4
+ beq L(end)
+
+ ALIGN(16)
+L(top): ldr r9, [up], #4
+ mov r12, #0
+ str r5, [rp], #4
+ umaal r12, cy, r5, d
+ mul r5, r9, r4
+ mla r5, cy, r8, r5
+ subs n, n, #1
+ bne L(top)
+
+L(end): str r5, [rp]
+ pop {r4,r5,r6,r7,r8,r9}
+ bx r14
+
+L(unnorm):
+ push {r10,r11}
+ rsb tnc, cnt, #32
+ mov r11, r5, lsr cnt
+ subs n, n, #1
+ beq L(edx)
+
+ ldr r12, [up], #4
+ orr r9, r11, r12, lsl tnc
+ mov r11, r12, lsr cnt
+ mul r5, r9, r4
+ subs n, n, #1
+ beq L(edu)
+
+ ALIGN(16)
+L(tpu): ldr r12, [up], #4
+ orr r9, r11, r12, lsl tnc
+ mov r11, r12, lsr cnt
+ mov r12, #0
+ str r5, [rp], #4
+ umaal r12, cy, r5, d
+ mul r5, r9, r4
+ mla r5, cy, r8, r5
+ subs n, n, #1
+ bne L(tpu)
+
+L(edu): str r5, [rp], #4
+ mov r12, #0
+ umaal r12, cy, r5, d
+ mul r5, r11, r4
+ mla r5, cy, r8, r5
+ str r5, [rp]
+ pop {r10,r11}
+ pop {r4,r5,r6,r7,r8,r9}
+ bx r14
+
+L(edx): mul r5, r11, r4
+ str r5, [rp]
+ pop {r10,r11}
+ pop {r4,r5,r6,r7,r8,r9}
+ bx r14
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/v6/gmp-mparam.h b/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/v6/gmp-mparam.h
new file mode 100644
index 00000000000..c9c68517690
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/v6/gmp-mparam.h
@@ -0,0 +1,157 @@
+/* gmp-mparam.h -- Compiler/machine parameter header file.
+
+Copyright 1991, 1993, 1994, 1999-2003, 2009, 2010, 2012 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
+
+/* 700MHz ARM11 (raspberry pi) */
+
+#define DIVREM_1_NORM_THRESHOLD 0 /* preinv always */
+#define DIVREM_1_UNNORM_THRESHOLD 0 /* always */
+#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 7
+#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 29
+#define USE_PREINV_DIVREM_1 1 /* preinv always */
+#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 MUL_TOOM22_THRESHOLD 36
+#define MUL_TOOM33_THRESHOLD 117
+#define MUL_TOOM44_THRESHOLD 462
+#define MUL_TOOM6H_THRESHOLD 0 /* always */
+#define MUL_TOOM8H_THRESHOLD 620
+
+#define MUL_TOOM32_TO_TOOM43_THRESHOLD 130
+#define MUL_TOOM32_TO_TOOM53_THRESHOLD 573
+#define MUL_TOOM42_TO_TOOM53_THRESHOLD 209
+#define MUL_TOOM42_TO_TOOM63_THRESHOLD 209
+#define MUL_TOOM43_TO_TOOM54_THRESHOLD 305
+
+#define SQR_BASECASE_THRESHOLD 0 /* always (native) */
+#define SQR_TOOM2_THRESHOLD 50
+#define SQR_TOOM3_THRESHOLD 181
+#define SQR_TOOM4_THRESHOLD 686
+#define SQR_TOOM6_THRESHOLD 0 /* always */
+#define SQR_TOOM8_THRESHOLD 915
+
+#define MULMID_TOOM42_THRESHOLD 72
+
+#define MULMOD_BNM1_THRESHOLD 25
+#define SQRMOD_BNM1_THRESHOLD 30
+
+#define MUL_FFT_MODF_THRESHOLD 476 /* k = 5 */
+#define MUL_FFT_TABLE3 \
+ { { 476, 5}, { 21, 6}, { 11, 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}, { 23, 6}, \
+ { 47, 7}, { 29, 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}, \
+ { 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,11}, \
+ { 95,10}, { 191, 9}, { 383,12}, { 4096,13}, \
+ { 8192,14}, { 16384,15}, { 32768,16} }
+#define MUL_FFT_TABLE3_SIZE 63
+#define MUL_FFT_THRESHOLD 4736
+
+#define SQR_FFT_MODF_THRESHOLD 464 /* k = 5 */
+#define SQR_FFT_TABLE3 \
+ { { 464, 5}, { 25, 6}, { 13, 5}, { 27, 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}, \
+ { 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}, { 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,11}, { 95,10}, { 191, 9}, \
+ { 383,12}, { 4096,13}, { 8192,14}, { 16384,15}, \
+ { 32768,16} }
+#define SQR_FFT_TABLE3_SIZE 61
+#define SQR_FFT_THRESHOLD 3776
+
+#define MULLO_BASECASE_THRESHOLD 0 /* always */
+#define MULLO_DC_THRESHOLD 67
+#define MULLO_MUL_N_THRESHOLD 8907
+
+#define DC_DIV_QR_THRESHOLD 40
+#define DC_DIVAPPR_Q_THRESHOLD 156
+#define DC_BDIV_QR_THRESHOLD 71
+#define DC_BDIV_Q_THRESHOLD 208
+
+#define INV_MULMOD_BNM1_THRESHOLD 70
+#define INV_NEWTON_THRESHOLD 151
+#define INV_APPR_THRESHOLD 150
+
+#define BINV_NEWTON_THRESHOLD 375
+#define REDC_1_TO_REDC_2_THRESHOLD 5
+#define REDC_2_TO_REDC_N_THRESHOLD 134
+
+#define MU_DIV_QR_THRESHOLD 2130
+#define MU_DIVAPPR_Q_THRESHOLD 2130
+#define MUPI_DIV_QR_THRESHOLD 80
+#define MU_BDIV_QR_THRESHOLD 1787
+#define MU_BDIV_Q_THRESHOLD 2130
+
+#define POWM_SEC_TABLE 7,32,460,1705
+
+#define MATRIX22_STRASSEN_THRESHOLD 19
+#define HGCD_THRESHOLD 85
+#define HGCD_APPR_THRESHOLD 119
+#define HGCD_REDUCE_THRESHOLD 3389
+#define GCD_DC_THRESHOLD 333
+#define GCDEXT_DC_THRESHOLD 309
+#define JACOBI_BASE_METHOD 1
+
+#define GET_STR_DC_THRESHOLD 21
+#define GET_STR_PRECOMPUTE_THRESHOLD 41
+#define SET_STR_DC_THRESHOLD 527
+#define SET_STR_PRECOMPUTE_THRESHOLD 1323
+
+#define FAC_DSC_THRESHOLD 414
+#define FAC_ODD_THRESHOLD 154
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/v6/mode1o.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/v6/mode1o.asm
new file mode 100644
index 00000000000..a2f77a6bf59
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/v6/mode1o.asm
@@ -0,0 +1,95 @@
+dnl ARM v6 mpn_modexact_1c_odd
+
+dnl Contributed to the GNU project by Torbjörn Granlund.
+
+dnl Copyright 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/limb
+C StrongARM -
+C XScale -
+C Cortex-A7 ?
+C Cortex-A8 ?
+C Cortex-A9 9
+C Cortex-A15 7
+
+C Architecture requirements:
+C v5 -
+C v5t -
+C v5te smulbb
+C v6 umaal
+C v6t2 -
+C v7a -
+
+define(`up', `r0')
+define(`n', `r1')
+define(`d', `r2')
+define(`cy', `r3')
+
+ .protected binvert_limb_table
+ASM_START()
+PROLOGUE(mpn_modexact_1c_odd)
+ stmfd sp!, {r4, r5, r6, r7}
+
+ LEA( r4, binvert_limb_table)
+
+ ldr r6, [up], #4 C up[0]
+
+ and r12, d, #254
+ ldrb r4, [r4, r12, lsr #1]
+ smulbb r12, r4, r4
+ mul r12, d, r12
+ rsb r12, r12, r4, asl #1
+ mul r4, r12, r12
+ mul r4, d, r4
+ rsb r4, r4, r12, asl #1 C r4 = inverse
+
+ subs n, n, #1
+ sub r6, r6, cy
+ mul r6, r6, r4
+ beq L(end)
+
+ rsb r5, r4, #0 C r5 = -inverse
+
+L(top): ldr r7, [up], #4
+ mov r12, #0
+ umaal r12, cy, r6, d
+ mul r6, r7, r4
+ mla r6, cy, r5, r6
+ subs n, n, #1
+ bne L(top)
+
+L(end): mov r12, #0
+ umaal r12, cy, r6, d
+ mov r0, cy
+
+ ldmfd sp!, {r4, r5, r6, r7}
+ bx r14
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/v6/mul_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/v6/mul_1.asm
new file mode 100644
index 00000000000..0fcc0e46d9b
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/v6/mul_1.asm
@@ -0,0 +1,114 @@
+dnl ARM mpn_mul_1.
+
+dnl Copyright 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/limb
+C StrongARM: -
+C XScale -
+C Cortex-A7 ?
+C Cortex-A8 ?
+C Cortex-A9 3.25
+C Cortex-A15 4
+
+C TODO
+C * Micro-optimise feed-in code.
+C * Optimise for n=1,2 by delaying register saving.
+C * Try using ldm/stm.
+
+define(`rp',`r0')
+define(`up',`r1')
+define(`n', `r2')
+define(`v0',`r3')
+
+ASM_START()
+PROLOGUE(mpn_mul_1)
+ stmfd sp!, { r4, r5, r6, r7 }
+
+ ands r6, n, #3
+ mov r12, #0
+ beq L(fi0)
+ cmp r6, #2
+ bcc L(fi1)
+ beq L(fi2)
+
+L(fi3): ldr r4, [up], #4
+ mov r6, #0
+ ldr r5, [up], #4
+ b L(lo3)
+
+L(fi0): ldr r5, [up], #4
+ add rp, rp, #4
+ mov r7, #0
+ ldr r4, [up], #4
+ b L(lo0)
+
+L(fi1): ldr r4, [up], #4
+ mov r6, #0
+ add rp, rp, #8
+ subs n, n, #1
+ beq L(1)
+ ldr r5, [up], #4
+ b L(lo1)
+
+L(fi2): ldr r5, [up], #4
+ add rp, rp, #12
+ mov r7, #0
+ ldr r4, [up], #4
+ b L(lo2)
+
+ ALIGN(16)
+L(top): mov r6, #0
+ ldr r5, [up], #4
+ str r7, [rp, #-12]
+L(lo1): umaal r6, r12, r4, v0
+ mov r7, #0
+ ldr r4, [up], #4
+ str r6, [rp, #-8]
+L(lo0): umaal r7, r12, r5, v0
+ mov r6, #0
+ ldr r5, [up], #4
+ str r7, [rp, #-4]
+L(lo3): umaal r6, r12, r4, v0
+ mov r7, #0
+ ldr r4, [up], #4
+ str r6, [rp], #16
+L(lo2): umaal r7, r12, r5, v0
+ subs n, n, #4
+ bhi L(top)
+
+ mov r6, #0
+ str r7, [rp, #-12]
+L(1): umaal r6, r12, r4, v0
+ str r6, [rp, #-8]
+ mov r0, r12
+ ldmfd sp!, { r4, r5, r6, r7 }
+ bx lr
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/v6/mul_2.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/v6/mul_2.asm
new file mode 100644
index 00000000000..1679542a3c8
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/v6/mul_2.asm
@@ -0,0 +1,131 @@
+dnl ARM mpn_mul_2.
+
+dnl Contributed to the GNU project by Torbjörn Granlund.
+
+dnl Copyright 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/limb
+C StrongARM: -
+C XScale -
+C Cortex-A7 ?
+C Cortex-A8 ?
+C Cortex-A9 2.25
+C Cortex-A15 2.5
+
+C TODO
+C * This is a trivial edit of the addmul_2 code. Check for simplifications,
+C and possible speedups to 2.0 c/l.
+
+define(`rp',`r0')
+define(`up',`r1')
+define(`n', `r2')
+define(`vp',`r3')
+
+define(`v0',`r6')
+define(`v1',`r7')
+define(`u0',`r3')
+define(`u1',`r9')
+
+define(`cya',`r8')
+define(`cyb',`r12')
+
+
+ASM_START()
+PROLOGUE(mpn_mul_2)
+ push { r4, r5, r6, r7, r8, r9 }
+
+ ldm vp, { v0, v1 }
+ mov cya, #0
+ mov cyb, #0
+
+ tst n, #1
+ beq L(evn)
+L(odd): mov r5, #0
+ ldr u0, [up, #0]
+ mov r4, #0
+ tst n, #2
+ beq L(fi1)
+L(fi3): sub up, up, #12
+ sub rp, rp, #16
+ b L(lo3)
+L(fi1): sub n, n, #1
+ sub up, up, #4
+ sub rp, rp, #8
+ b L(lo1)
+L(evn): mov r4, #0
+ ldr u1, [up, #0]
+ mov r5, #0
+ tst n, #2
+ bne L(fi2)
+L(fi0): sub up, up, #8
+ sub rp, rp, #12
+ b L(lo0)
+L(fi2): subs n, n, #2
+ sub rp, rp, #4
+ bls L(end)
+
+ ALIGN(16)
+L(top): ldr u0, [up, #4]
+ umaal r4, cya, u1, v0
+ str r4, [rp, #4]
+ mov r4, #0
+ umaal r5, cyb, u1, v1
+L(lo1): ldr u1, [up, #8]
+ umaal r5, cya, u0, v0
+ str r5, [rp, #8]
+ mov r5, #0
+ umaal r4, cyb, u0, v1
+L(lo0): ldr u0, [up, #12]
+ umaal r4, cya, u1, v0
+ str r4, [rp, #12]
+ mov r4, #0
+ umaal r5, cyb, u1, v1
+L(lo3): ldr u1, [up, #16]!
+ umaal r5, cya, u0, v0
+ str r5, [rp, #16]!
+ mov r5, #0
+ umaal r4, cyb, u0, v1
+ subs n, n, #4
+ bhi L(top)
+
+L(end): umaal r4, cya, u1, v0
+ ldr u0, [up, #4]
+ umaal r5, cyb, u1, v1
+ str r4, [rp, #4]
+ umaal r5, cya, u0, v0
+ umaal cya, cyb, u0, v1
+ str r5, [rp, #8]
+ str cya, [rp, #12]
+ mov r0, cyb
+
+ pop { r4, r5, r6, r7, r8, r9 }
+ bx r14
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/v6/popham.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/v6/popham.asm
new file mode 100644
index 00000000000..44c8f2361cf
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/v6/popham.asm
@@ -0,0 +1,138 @@
+dnl ARM mpn_popcount and mpn_hamdist.
+
+dnl Contributed to the GNU project by Torbjörn Granlund.
+
+dnl Copyright 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 popcount hamdist
+C cycles/limb cycles/limb
+C StrongARM -
+C XScale -
+C Cortex-A7 ?
+C Cortex-A8 ?
+C Cortex-A9 8.94 9.47
+C Cortex-A15 5.67 6.44
+
+C Architecture requirements:
+C v5 -
+C v5t -
+C v5te ldrd strd
+C v6 usada8
+C v6t2 -
+C v7a -
+
+ifdef(`OPERATION_popcount',`
+ define(`func',`mpn_popcount')
+ define(`ap', `r0')
+ define(`n', `r1')
+ define(`a0', `r2')
+ define(`a1', `r3')
+ define(`s', `r5')
+ define(`b_01010101', `r6')
+ define(`b_00110011', `r7')
+ define(`b_00001111', `r8')
+ define(`zero', `r9')
+ define(`POPC', `$1')
+ define(`HAMD', `dnl')
+')
+ifdef(`OPERATION_hamdist',`
+ define(`func',`mpn_hamdist')
+ define(`ap', `r0')
+ define(`bp', `r1')
+ define(`n', `r2')
+ define(`a0', `r6')
+ define(`a1', `r7')
+ define(`b0', `r4')
+ define(`b1', `r5')
+ define(`s', `r11')
+ define(`b_01010101', `r8')
+ define(`b_00110011', `r9')
+ define(`b_00001111', `r10')
+ define(`zero', `r3')
+ define(`POPC', `dnl')
+ define(`HAMD', `$1')
+')
+
+
+ASM_START()
+PROLOGUE(func)
+POPC(` push { r4-r9 } ')
+HAMD(` push { r4-r11 } ')
+
+ ldr b_01010101, =0x55555555
+ mov r12, #0
+ ldr b_00110011, =0x33333333
+ mov zero, #0
+ ldr b_00001111, =0x0f0f0f0f
+
+ tst n, #1
+ beq L(evn)
+
+L(odd): ldr a1, [ap], #4 C 1 x 32 1-bit accumulators, 0-1
+HAMD(` ldr b1, [bp], #4 ') C 1 x 32 1-bit accumulators, 0-1
+HAMD(` eor a1, a1, b1 ')
+ and r4, b_01010101, a1, lsr #1
+ sub a1, a1, r4
+ and r4, a1, b_00110011
+ bic r5, a1, b_00110011
+ add r5, r4, r5, lsr #2 C 8 4-bit accumulators, 0-4
+ subs n, n, #1
+ b L(mid)
+
+L(evn): mov s, #0
+
+L(top): ldrd a0, a1, [ap], #8 C 2 x 32 1-bit accumulators, 0-1
+HAMD(` ldrd b0, b1, [bp], #8')
+HAMD(` eor a0, a0, b0 ')
+HAMD(` eor a1, a1, b1 ')
+ subs n, n, #2
+ usada8 r12, s, zero, r12
+ and r4, b_01010101, a0, lsr #1
+ sub a0, a0, r4
+ and r4, b_01010101, a1, lsr #1
+ sub a1, a1, r4
+ and r4, a0, b_00110011
+ bic r5, a0, b_00110011
+ add a0, r4, r5, lsr #2 C 8 4-bit accumulators, 0-4
+ and r4, a1, b_00110011
+ bic r5, a1, b_00110011
+ add a1, r4, r5, lsr #2 C 8 4-bit accumulators, 0-4
+ add r5, a0, a1 C 8 4-bit accumulators, 0-8
+L(mid): and r4, r5, b_00001111
+ bic r5, r5, b_00001111
+ add s, r4, r5, lsr #4 C 4 8-bit accumulators
+ bne L(top)
+
+ usada8 r0, s, zero, r12
+POPC(` pop { r4-r9 } ')
+HAMD(` pop { r4-r11 } ')
+ bx r14
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/v6/sqr_basecase.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/v6/sqr_basecase.asm
new file mode 100644
index 00000000000..d52970aaa7d
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/v6/sqr_basecase.asm
@@ -0,0 +1,518 @@
+dnl ARM v6 mpn_sqr_basecase.
+
+dnl Contributed to the GNU project by Torbjörn Granlund.
+
+dnl Copyright 2012, 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 Code structure:
+C
+C
+C m_2(0m4) m_2(2m4) m_2(1m4) m_2(3m4)
+C | | | |
+C | | | |
+C | | | |
+C \|/ \|/ \|/ \|/
+C ____________ ____________
+C / \ / \
+C \|/ \ \|/ \
+C am_2(3m4) am_2(1m4) am_2(0m4) am_2(2m4)
+C \ /|\ \ /|\
+C \____________/ \____________/
+C \ /
+C \ /
+C \ /
+C tail(0m2) tail(1m2)
+C \ /
+C \ /
+C sqr_diag_addlsh1
+
+C TODO
+C * Further tweak counter and updates in outer loops. (This could save
+C perhaps 5n cycles).
+C * Try to use fewer register. Perhaps coalesce r9 branch target and n_saved.
+C (This could save 2-3 cycles for n > 4.)
+C * Optimise sqr_diag_addlsh1 loop. (This could save O(n) cycles.)
+C * Implement larger final corners (xit/tix). Also stop loops earlier
+C suppressing writes of upper-most rp[] values. (This could save 10-20
+C cycles for n > 4.)
+C * Is the branch table really faster than discrete branches?
+
+define(`rp', r0)
+define(`up', r1)
+define(`n', r2)
+
+define(`v0', r3)
+define(`v1', r6)
+define(`i', r8)
+define(`n_saved', r14)
+define(`cya', r11)
+define(`cyb', r12)
+define(`u0', r7)
+define(`u1', r9)
+
+ASM_START()
+PROLOGUE(mpn_sqr_basecase)
+ and r12, n, #3
+ cmp n, #4
+ addgt r12, r12, #4
+ add pc, pc, r12, lsl #2
+ nop
+ b L(4)
+ b L(1)
+ b L(2)
+ b L(3)
+ b L(0m4)
+ b L(1m4)
+ b L(2m4)
+ b L(3m4)
+
+
+L(1m4): push {r4-r10,r11,r14}
+ mov n_saved, n
+ sub i, n, #4
+ sub n, n, #2
+ add r10, pc, #L(am2_2m4)-.-8
+ ldm up, {v0,v1,u0}
+ sub up, up, #4
+ mov cyb, #0
+ mov r5, #0
+ umull r4, cya, v1, v0
+ str r4, [rp], #-12
+ mov r4, #0
+ b L(ko0)
+
+L(3m4): push {r4-r10,r11,r14}
+ mov n_saved, n
+ sub i, n, #4
+ sub n, n, #2
+ add r10, pc, #L(am2_0m4)-.-8
+ ldm up, {v0,v1,u0}
+ add up, up, #4
+ mov cyb, #0
+ mov r5, #0
+ umull r4, cya, v1, v0
+ str r4, [rp], #-4
+ mov r4, #0
+ b L(ko2)
+
+L(2m4): push {r4-r10,r11,r14}
+ mov n_saved, n
+ sub i, n, #4
+ sub n, n, #2
+ add r10, pc, #L(am2_3m4)-.-8
+ ldm up, {v0,v1,u1}
+ mov cyb, #0
+ mov r4, #0
+ umull r5, cya, v1, v0
+ str r5, [rp], #-8
+ mov r5, #0
+ b L(ko1)
+
+L(0m4): push {r4-r10,r11,r14}
+ mov n_saved, n
+ sub i, n, #4
+ sub n, n, #2
+ add r10, pc, #L(am2_1m4)-.-8
+ ldm up, {v0,v1,u1}
+ mov cyb, #0
+ mov r4, #0
+ add up, up, #8
+ umull r5, cya, v1, v0
+ str r5, [rp, #0]
+ mov r5, #0
+
+L(top): ldr u0, [up, #4]
+ umaal r4, cya, u1, v0
+ str r4, [rp, #4]
+ mov r4, #0
+ umaal r5, cyb, u1, v1
+L(ko2): ldr u1, [up, #8]
+ umaal r5, cya, u0, v0
+ str r5, [rp, #8]
+ mov r5, #0
+ umaal r4, cyb, u0, v1
+L(ko1): ldr u0, [up, #12]
+ umaal r4, cya, u1, v0
+ str r4, [rp, #12]
+ mov r4, #0
+ umaal r5, cyb, u1, v1
+L(ko0): ldr u1, [up, #16]!
+ umaal r5, cya, u0, v0
+ str r5, [rp, #16]!
+ mov r5, #0
+ umaal r4, cyb, u0, v1
+ subs i, i, #4
+ bhi L(top)
+ bx r10
+
+L(evnloop):
+ subs i, n, #4
+ sub n, n, #2
+ blt L(tix)
+ ldm up, {v0,v1,u0}
+ add up, up, #4
+ mov cya, #0
+ mov cyb, #0
+ ldm rp, {r4,r5}
+ sub rp, rp, #4
+ umaal r4, cya, v1, v0
+ str r4, [rp, #4]
+ ldr r4, [rp, #12]
+ b L(lo2)
+L(ua2): ldr u0, [up, #4]
+ umaal r4, cya, u1, v0
+ str r4, [rp, #4]
+ ldr r4, [rp, #12]
+ umaal r5, cyb, u1, v1
+L(lo2): ldr u1, [up, #8]
+ umaal r5, cya, u0, v0
+ str r5, [rp, #8]
+ ldr r5, [rp, #16]
+ umaal r4, cyb, u0, v1
+ ldr u0, [up, #12]
+ umaal r4, cya, u1, v0
+ str r4, [rp, #12]
+ ldr r4, [rp, #20]
+ umaal r5, cyb, u1, v1
+ ldr u1, [up, #16]!
+ umaal r5, cya, u0, v0
+ str r5, [rp, #16]!
+ ldr r5, [rp, #8]
+ umaal r4, cyb, u0, v1
+ subs i, i, #4
+ bhi L(ua2)
+L(am2_0m4):
+ umaal r4, cya, u1, v0
+ ldr u0, [up, #4]
+ umaal r5, cyb, u1, v1
+ str r4, [rp, #4]
+ umaal r5, cya, u0, v0
+ umaal cya, cyb, u0, v1
+ str r5, [rp, #8]
+ str cya, [rp, #12]
+ str cyb, [rp, #16]
+ sub up, up, n, lsl #2
+ sub rp, rp, n, lsl #2
+ add up, up, #8
+ sub i, n, #4
+ sub n, n, #2
+ ldm up, {v0,v1,u0}
+ sub up, up, #4
+ mov cya, #0
+ mov cyb, #0
+ ldr r4, [rp, #24]
+ ldr r5, [rp, #28]
+ add rp, rp, #12
+ umaal r4, cya, v1, v0
+ str r4, [rp, #12]
+ ldr r4, [rp, #20]
+ b L(lo0)
+L(ua0): ldr u0, [up, #4]
+ umaal r4, cya, u1, v0
+ str r4, [rp, #4]
+ ldr r4, [rp, #12]
+ umaal r5, cyb, u1, v1
+ ldr u1, [up, #8]
+ umaal r5, cya, u0, v0
+ str r5, [rp, #8]
+ ldr r5, [rp, #16]
+ umaal r4, cyb, u0, v1
+ ldr u0, [up, #12]
+ umaal r4, cya, u1, v0
+ str r4, [rp, #12]
+ ldr r4, [rp, #20]
+ umaal r5, cyb, u1, v1
+L(lo0): ldr u1, [up, #16]!
+ umaal r5, cya, u0, v0
+ str r5, [rp, #16]!
+ ldr r5, [rp, #8]
+ umaal r4, cyb, u0, v1
+ subs i, i, #4
+ bhi L(ua0)
+L(am2_2m4):
+ umaal r4, cya, u1, v0
+ ldr u0, [up, #4]
+ umaal r5, cyb, u1, v1
+ str r4, [rp, #4]
+ umaal r5, cya, u0, v0
+ umaal cya, cyb, u0, v1
+ str r5, [rp, #8]
+ str cya, [rp, #12]
+ str cyb, [rp, #16]
+ sub up, up, n, lsl #2
+ sub rp, rp, n, lsl #2
+ add up, up, #8
+ add rp, rp, #24
+ b L(evnloop)
+
+
+L(oddloop):
+ subs i, n, #4
+ sub n, n, #2
+ blt L(xit)
+ ldm up, {v0,v1,u1}
+ mov cya, #0
+ mov cyb, #0
+ sub rp, rp, #8
+ ldr r5, [rp, #8]
+ ldr r4, [rp, #12]
+ umaal r5, cya, v1, v0
+ str r5, [rp, #8]
+ ldr r5, [rp, #16]
+ b L(lo1)
+L(ua1): ldr u0, [up, #4]
+ umaal r4, cya, u1, v0
+ str r4, [rp, #4]
+ ldr r4, [rp, #12]
+ umaal r5, cyb, u1, v1
+ ldr u1, [up, #8]
+ umaal r5, cya, u0, v0
+ str r5, [rp, #8]
+ ldr r5, [rp, #16]
+ umaal r4, cyb, u0, v1
+L(lo1): ldr u0, [up, #12]
+ umaal r4, cya, u1, v0
+ str r4, [rp, #12]
+ ldr r4, [rp, #20]
+ umaal r5, cyb, u1, v1
+ ldr u1, [up, #16]!
+ umaal r5, cya, u0, v0
+ str r5, [rp, #16]!
+ ldr r5, [rp, #8]
+ umaal r4, cyb, u0, v1
+ subs i, i, #4
+ bhi L(ua1)
+L(am2_3m4):
+ umaal r4, cya, u1, v0
+ ldr u0, [up, #4]
+ umaal r5, cyb, u1, v1
+ str r4, [rp, #4]
+ umaal r5, cya, u0, v0
+ umaal cya, cyb, u0, v1
+ str r5, [rp, #8]
+ str cya, [rp, #12]
+ str cyb, [rp, #16]
+ sub up, up, n, lsl #2
+ sub rp, rp, n, lsl #2
+ add up, up, #8
+ add rp, rp, #24
+ subs i, n, #4
+ sub n, n, #2
+ ldm up, {v0,v1,u1}
+ mov cya, #0
+ mov cyb, #0
+ ldr r5, [rp, #0]
+ ldr r4, [rp, #4]
+ add up, up, #8
+ umaal r5, cya, v1, v0
+ str r5, [rp, #0]
+ ldr r5, [rp, #8]
+ bls L(e3)
+L(ua3): ldr u0, [up, #4]
+ umaal r4, cya, u1, v0
+ str r4, [rp, #4]
+ ldr r4, [rp, #12]
+ umaal r5, cyb, u1, v1
+ ldr u1, [up, #8]
+ umaal r5, cya, u0, v0
+ str r5, [rp, #8]
+ ldr r5, [rp, #16]
+ umaal r4, cyb, u0, v1
+ ldr u0, [up, #12]
+ umaal r4, cya, u1, v0
+ str r4, [rp, #12]
+ ldr r4, [rp, #20]
+ umaal r5, cyb, u1, v1
+ ldr u1, [up, #16]!
+ umaal r5, cya, u0, v0
+ str r5, [rp, #16]!
+ ldr r5, [rp, #8]
+ umaal r4, cyb, u0, v1
+ subs i, i, #4
+ bhi L(ua3)
+L(e3):
+L(am2_1m4):
+ umaal r4, cya, u1, v0
+ ldr u0, [up, #4]
+ umaal r5, cyb, u1, v1
+ str r4, [rp, #4]
+ umaal r5, cya, u0, v0
+ umaal cya, cyb, u0, v1
+ str r5, [rp, #8]
+ str cya, [rp, #12]
+ str cyb, [rp, #16]
+ sub up, up, n, lsl #2
+ sub rp, rp, n, lsl #2
+ add up, up, #8
+ add rp, rp, #24
+ b L(oddloop)
+
+L(xit): ldm up!, {v0,u0}
+ ldr cya, [rp], #12
+ mov cyb, #0
+ umaal cya, cyb, u0, v0
+ b L(sqr_diag_addlsh1)
+
+L(tix): ldm up!, {v0,v1,u0}
+ ldm rp, {r4,r5}
+ mov cya, #0
+ mov cyb, #0
+ umaal r4, cya, v1, v0
+ umaal r5, cya, u0, v0
+ stm rp, {r4,r5}
+ umaal cya, cyb, u0, v1
+ add rp, rp, #20
+C b L(sqr_diag_addlsh1)
+
+
+define(`w0', r6)
+define(`w1', r7)
+define(`w2', r8)
+define(`rbx', r9)
+
+L(sqr_diag_addlsh1):
+ str cya, [rp, #-12]
+ str cyb, [rp, #-8]
+ sub n, n_saved, #1
+ sub up, up, n_saved, lsl #2
+ sub rp, rp, n_saved, lsl #3
+ ldr r3, [up], #4
+ umull w1, r5, r3, r3
+ mov w2, #0
+ mov r10, #0
+C cmn r0, #0 C clear cy (already clear by luck)
+ b L(lm)
+
+L(tsd): adds w0, w0, rbx
+ adcs w1, w1, r4
+ str w0, [rp, #0]
+L(lm): ldr w0, [rp, #4]
+ str w1, [rp, #4]
+ ldr w1, [rp, #8]!
+ add rbx, r5, w2
+ adcs w0, w0, w0
+ ldr r3, [up], #4
+ adcs w1, w1, w1
+ adc w2, r10, r10
+ umull r4, r5, r3, r3
+ subs n, n, #1
+ bne L(tsd)
+
+ adds w0, w0, rbx
+ adcs w1, w1, r4
+ adc w2, r5, w2
+ stm rp, {w0,w1,w2}
+
+ pop {r4-r10,r11,pc}
+
+
+C Straight line code for n <= 4
+
+L(1): ldr r3, [up, #0]
+ umull r1, r2, r3, r3
+ stm rp, {r1,r2}
+ bx r14
+
+L(2): push {r4-r5}
+ ldm up, {r5,r12}
+ umull r1, r2, r5, r5
+ umull r3, r4, r12, r12
+ umull r5, r12, r5, r12
+ adds r5, r5, r5
+ adcs r12, r12, r12
+ adc r4, r4, #0
+ adds r2, r2, r5
+ adcs r3, r3, r12
+ adc r4, r4, #0
+ stm rp, {r1,r2,r3,r4}
+ pop {r4-r5}
+ bx r14
+
+L(3): push {r4-r11}
+ ldm up, {r7,r8,r9}
+ umull r1, r2, r7, r7
+ umull r3, r4, r8, r8
+ umull r5, r6, r9, r9
+ umull r10, r11, r7, r8
+ mov r12, #0
+ umlal r11, r12, r7, r9
+ mov r7, #0
+ umlal r12, r7, r8, r9
+ adds r10, r10, r10
+ adcs r11, r11, r11
+ adcs r12, r12, r12
+ adcs r7, r7, r7
+ adc r6, r6, #0
+ adds r2, r2, r10
+ adcs r3, r3, r11
+ adcs r4, r4, r12
+ adcs r5, r5, r7
+ adc r6, r6, #0
+ stm rp, {r1,r2,r3,r4,r5,r6}
+ pop {r4-r11}
+ bx r14
+
+L(4): push {r4-r11, r14}
+ ldm up, {r9,r10,r11,r12}
+ umull r1, r2, r9, r9
+ umull r3, r4, r10, r10
+ umull r5, r6, r11, r11
+ umull r7, r8, r12, r12
+ stm rp, {r1,r2,r3,r4,r5,r6,r7}
+ umull r1, r2, r9, r10
+ mov r3, #0
+ umlal r2, r3, r9, r11
+ mov r4, #0
+ umlal r3, r4, r9, r12
+ mov r5, #0
+ umlal r3, r5, r10, r11
+ umaal r4, r5, r10, r12
+ mov r6, #0
+ umlal r5, r6, r11, r12
+ adds r1, r1, r1
+ adcs r2, r2, r2
+ adcs r3, r3, r3
+ adcs r4, r4, r4
+ adcs r5, r5, r5
+ adcs r6, r6, r6
+ adc r7, r8, #0
+ add rp, rp, #4
+ ldm rp, {r8,r9,r10,r11,r12,r14}
+ adds r1, r1, r8
+ adcs r2, r2, r9
+ adcs r3, r3, r10
+ adcs r4, r4, r11
+ adcs r5, r5, r12
+ adcs r6, r6, r14
+ adc r7, r7, #0
+ stm rp, {r1,r2,r3,r4,r5,r6,r7}
+ pop {r4-r11, pc}
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/v6/submul_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/v6/submul_1.asm
new file mode 100644
index 00000000000..8a21733a0a0
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/v6/submul_1.asm
@@ -0,0 +1,125 @@
+dnl ARM mpn_submul_1.
+
+dnl Copyright 2012, 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/limb
+C StrongARM: -
+C XScale -
+C Cortex-A7 ?
+C Cortex-A8 ?
+C Cortex-A9 3.75
+C Cortex-A15 4.0
+
+C This loop complements U on the fly,
+C U' = B^n - 1 - U
+C and then uses that
+C R - U*v = R + U'*v + v - B^n v
+
+C TODO
+C * Micro-optimise feed-in code.
+C * Optimise for n=1,2 by delaying register saving.
+C * Try using ldm/stm.
+
+define(`rp',`r0')
+define(`up',`r1')
+define(`n', `r2')
+define(`v0',`r3')
+
+ASM_START()
+PROLOGUE(mpn_submul_1)
+ stmfd sp!, { r4, r5, r6, r7 }
+
+ ands r6, n, #3
+ mov r12, v0
+ beq L(fi0)
+ cmp r6, #2
+ bcc L(fi1)
+ beq L(fi2)
+
+L(fi3): ldr r4, [up], #12
+ mvn r4, r4
+ ldr r6, [rp, #0]
+ ldr r5, [up, #-8]
+ b L(lo3)
+
+L(fi0): ldr r5, [up], #16
+ mvn r5, r5
+ ldr r7, [rp], #4
+ ldr r4, [up, #-12]
+ b L(lo0)
+
+L(fi1): ldr r4, [up], #4
+ mvn r4, r4
+ ldr r6, [rp], #8
+ subs n, n, #1
+ beq L(1)
+ ldr r5, [up]
+ b L(lo1)
+
+L(fi2): ldr r5, [up], #8
+ mvn r5, r5
+ ldr r7, [rp], #12
+ ldr r4, [up, #-4]
+ b L(lo2)
+
+ ALIGN(16)
+L(top): ldr r6, [rp, #-8]
+ ldr r5, [up]
+ str r7, [rp, #-12]
+L(lo1): umaal r6, r12, r4, v0
+ add up, up, #16
+ mvn r5, r5
+ ldr r7, [rp, #-4]
+ ldr r4, [up, #-12]
+ str r6, [rp, #-8]
+L(lo0): umaal r7, r12, r5, v0
+ mvn r4, r4
+ ldr r6, [rp, #0]
+ ldr r5, [up, #-8]
+ str r7, [rp, #-4]
+L(lo3): umaal r6, r12, r4, v0
+ mvn r5, r5
+ ldr r7, [rp, #4]
+ ldr r4, [up, #-4]
+ str r6, [rp], #16
+L(lo2): umaal r7, r12, r5, v0
+ mvn r4, r4
+ subs n, n, #4
+ bhi L(top)
+
+ ldr r6, [rp, #-8]
+ str r7, [rp, #-12]
+L(1): umaal r6, r12, r4, v0
+ str r6, [rp, #-8]
+ sub r0, v0, r12
+ ldmfd sp!, { r4, r5, r6, r7 }
+ bx lr
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/v6t2/divrem_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/v6t2/divrem_1.asm
new file mode 100644
index 00000000000..be24615acbb
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/v6t2/divrem_1.asm
@@ -0,0 +1,212 @@
+dnl ARM v6t2 mpn_divrem_1 and mpn_preinv_divrem_1.
+
+dnl Contributed to the GNU project by Torbjörn Granlund.
+
+dnl Copyright 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 norm unorm frac
+C StrongARM - - -
+C XScale - - -
+C Cortex-A7 ? ? ?
+C Cortex-A8 ? ? ?
+C Cortex-A9 13 14 13
+C Cortex-A15 11.4 11.8 11.1
+
+C TODO
+C * Optimise inner-loops better, they could likely run a cycle or two faster.
+C * Decrease register usage, streamline non-loop code.
+
+define(`qp_arg', `r0')
+define(`fn', `r1')
+define(`up_arg', `r2')
+define(`n_arg', `r3')
+define(`d_arg', `0')
+define(`dinv_arg',`4')
+define(`cnt_arg', `8')
+
+define(`n', `r9')
+define(`qp', `r5')
+define(`up', `r6')
+define(`cnt', `r7')
+define(`tnc', `r10')
+define(`dinv', `r0')
+define(`d', `r4')
+
+ASM_START()
+PROLOGUE(mpn_preinv_divrem_1)
+ stmfd sp!, {r4, r5, r6, r7, r8, r9, r10, r11, lr}
+ ldr d, [sp, #9*4+d_arg]
+ ldr cnt, [sp, #9*4+cnt_arg]
+ str r1, [sp, #9*4+d_arg] C reuse d stack slot for fn
+ sub n, r3, #1
+ add r3, r1, n
+ cmp d, #0
+ add qp, qp_arg, r3, lsl #2 C put qp at Q[] end
+ add up, up_arg, n, lsl #2 C put up at U[] end
+ ldr dinv, [sp, #9*4+dinv_arg]
+ blt L(nent)
+ b L(uent)
+EPILOGUE()
+
+PROLOGUE(mpn_divrem_1)
+ stmfd sp!, {r4, r5, r6, r7, r8, r9, r10, r11, lr}
+ sub n, r3, #1
+ ldr d, [sp, #9*4+d_arg] C d
+ str r1, [sp, #9*4+d_arg] C reuse d stack slot for fn
+ add r3, r1, n
+ cmp d, #0
+ add qp, qp_arg, r3, lsl #2 C put qp at Q[] end
+ add up, up_arg, n, lsl #2 C put up at U[] end
+ blt L(normalised)
+
+L(unnorm):
+ clz cnt, d
+ mov r0, d, lsl cnt C pass d << cnt
+ bl mpn_invert_limb
+L(uent):
+ mov d, d, lsl cnt C d <<= cnt
+ cmp n, #0
+ mov r1, #0 C r
+ blt L(frac)
+
+ ldr r11, [up, #0]
+
+ rsb tnc, cnt, #32
+ mov r1, r11, lsr tnc
+ mov r11, r11, lsl cnt
+ beq L(uend)
+
+ ldr r3, [up, #-4]!
+ orr r2, r11, r3, lsr tnc
+ b L(mid)
+
+L(utop):
+ mls r1, d, r8, r11
+ mov r11, r3, lsl cnt
+ ldr r3, [up, #-4]!
+ cmp r1, r2
+ addhi r1, r1, d
+ subhi r8, r8, #1
+ orr r2, r11, r3, lsr tnc
+ cmp r1, d
+ bcs L(ufx)
+L(uok): str r8, [qp], #-4
+L(mid): add r8, r1, #1
+ mov r11, r2
+ umlal r2, r8, r1, dinv
+ subs n, n, #1
+ bne L(utop)
+
+ mls r1, d, r8, r11
+ mov r11, r3, lsl cnt
+ cmp r1, r2
+ addhi r1, r1, d
+ subhi r8, r8, #1
+ cmp r1, d
+ rsbcs r1, d, r1
+ addcs r8, r8, #1
+ str r8, [qp], #-4
+
+L(uend):add r8, r1, #1
+ mov r2, r11
+ umlal r2, r8, r1, dinv
+ mls r1, d, r8, r11
+ cmp r1, r2
+ addhi r1, r1, d
+ subhi r8, r8, #1
+ cmp r1, d
+ rsbcs r1, d, r1
+ addcs r8, r8, #1
+ str r8, [qp], #-4
+L(frac):
+ ldr r2, [sp, #9*4+d_arg] C fn
+ cmp r2, #0
+ beq L(fend)
+
+L(ftop):mov r6, #0
+ add r3, r1, #1
+ umlal r6, r3, r1, dinv
+ mov r8, #0
+ mls r1, d, r3, r8
+ cmp r1, r6
+ addhi r1, r1, d
+ subhi r3, r3, #1
+ subs r2, r2, #1
+ str r3, [qp], #-4
+ bne L(ftop)
+
+L(fend):mov r11, r1, lsr cnt
+L(rtn): mov r0, r11
+ ldmfd sp!, {r4, r5, r6, r7, r8, r9, r10, r11, pc}
+
+L(normalised):
+ mov r0, d
+ bl mpn_invert_limb
+L(nent):
+ cmp n, #0
+ mov r11, #0 C r
+ blt L(nend)
+
+ ldr r11, [up, #0]
+ cmp r11, d
+ movlo r2, #0 C hi q limb
+ movhs r2, #1 C hi q limb
+ subhs r11, r11, d
+
+ str r2, [qp], #-4
+ cmp n, #0
+ beq L(nend)
+
+L(ntop):ldr r1, [up, #-4]!
+ add r12, r11, #1
+ umlal r1, r12, r11, dinv
+ ldr r3, [up, #0]
+ mls r11, d, r12, r3
+ cmp r11, r1
+ addhi r11, r11, d
+ subhi r12, r12, #1
+ cmp d, r11
+ bls L(nfx)
+L(nok): str r12, [qp], #-4
+ subs n, n, #1
+ bne L(ntop)
+
+L(nend):mov r1, r11 C r
+ mov cnt, #0 C shift cnt
+ b L(frac)
+
+L(nfx): add r12, r12, #1
+ rsb r11, d, r11
+ b L(nok)
+L(ufx): rsb r1, d, r1
+ add r8, r8, #1
+ b L(uok)
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/v6t2/gcd_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/v6t2/gcd_1.asm
new file mode 100644
index 00000000000..20636479630
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/v6t2/gcd_1.asm
@@ -0,0 +1,115 @@
+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()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/v7a/cora15/addmul_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/v7a/cora15/addmul_1.asm
new file mode 100644
index 00000000000..c2277b32b28
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/v7a/cora15/addmul_1.asm
@@ -0,0 +1,145 @@
+dnl ARM mpn_addmul_1 optimised for A15.
+
+dnl Copyright 2012, 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/limb best
+C StrongARM: -
+C XScale ?
+C Cortex-A7 ?
+C Cortex-A8 ?
+C Cortex-A9 6 3.25
+C Cortex-A15 2 this
+
+C This code uses umlal for adding in the rp[] data, keeping the recurrency path
+C separate from any multiply instructions. It performs well on A15, at umlal's
+C bandwidth.
+C
+C An A9 variant should perhaps stick to 3-way unrolling, and use ldm and stm
+C for all loads and stores. Alternatively, it could do 2-way or 4-way, but
+C then alignment aware code will be necessary (adding O(1) bookkeeping
+C overhead).
+C
+C We don't use r12 due to ldrd and strd limitations.
+
+C Architecture requirements:
+C v5 -
+C v5t -
+C v5te ldrd strd
+C v6 -
+C v6t2 -
+C v7a -
+
+define(`rp', `r0')
+define(`up', `r1')
+define(`n', `r2')
+define(`v0', `r3')
+
+define(`w0', `r10') define(`w1', `r11')
+define(`u0', `r8') define(`u1', `r9')
+
+ASM_START()
+PROLOGUE(mpn_addmul_1)
+ push { r4-r11 }
+
+ ands r6, n, #3
+ sub n, n, #3
+ beq L(b00)
+ cmp r6, #2
+ bcc L(b01)
+ beq L(b10)
+
+L(b11): mov r6, #0
+ cmn r13, #0 C carry clear
+ ldr u1, [up], #-4
+ ldr w1, [rp], #-4
+ mov r7, #0
+ b L(mid)
+
+L(b00): ldrd u0, u1, [up]
+ ldrd w0, w1, [rp]
+ mov r6, #0
+ umlal w0, r6, u0, v0
+ cmn r13, #0 C carry clear
+ mov r7, #0
+ str w0, [rp]
+ b L(mid)
+
+L(b10): ldrd u0, u1, [up], #8
+ ldrd w0, w1, [rp]
+ mov r4, #0
+ umlal w0, r4, u0, v0
+ cmn r13, #0 C carry clear
+ mov r5, #0
+ str w0, [rp], #8
+ umlal w1, r5, u1, v0
+ tst n, n
+ bmi L(end)
+ b L(top)
+
+L(b01): mov r4, #0
+ ldr u1, [up], #4
+ ldr w1, [rp], #4
+ mov r5, #0
+ umlal w1, r5, u1, v0
+ tst n, n
+ bmi L(end)
+
+ ALIGN(16)
+L(top): ldrd u0, u1, [up, #0]
+ adcs r4, r4, w1
+ ldrd w0, w1, [rp, #0]
+ mov r6, #0
+ umlal w0, r6, u0, v0 C 1 2
+ adcs r5, r5, w0
+ mov r7, #0
+ strd r4, r5, [rp, #-4]
+L(mid): umlal w1, r7, u1, v0 C 2 3
+ ldrd u0, u1, [up, #8]
+ adcs r6, r6, w1
+ ldrd w0, w1, [rp, #8]
+ mov r4, #0
+ umlal w0, r4, u0, v0 C 3 4
+ adcs r7, r7, w0
+ mov r5, #0
+ strd r6, r7, [rp, #4]
+ umlal w1, r5, u1, v0 C 0 1
+ sub n, n, #4
+ add up, up, #16
+ add rp, rp, #16
+ tst n, n
+ bpl L(top)
+
+L(end): adcs r4, r4, w1
+ str r4, [rp, #-4]
+ adc r0, r5, #0
+ pop { r4-r11 }
+ bx r14
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/v7a/cora15/aors_n.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/v7a/cora15/aors_n.asm
new file mode 100644
index 00000000000..dc3f83992e4
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/v7a/cora15/aors_n.asm
@@ -0,0 +1,162 @@
+dnl ARM mpn_add_n/mpn_sub_n optimised for A15.
+
+dnl Copyright 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/limb best
+C StrongARM: -
+C XScale ?
+C Cortex-A7 ?
+C Cortex-A8 ?
+C Cortex-A9 3.55 2.5
+C Cortex-A15 1.27 this
+
+C This was a major improvement compared to the code we had before, but it might
+C not be the best 8-way code possible. We've tried some permutations of auto-
+C increments and separate pointer updates, but they all ran at the same speed
+C on A15.
+
+C Architecture requirements:
+C v5 -
+C v5t -
+C v5te ldrd strd
+C v6 -
+C v6t2 -
+C v7a -
+
+define(`rp', `r0')
+define(`up', `r1')
+define(`vp', `r2')
+define(`n', `r3')
+
+ifdef(`OPERATION_add_n', `
+ define(`ADDSUBC', adcs)
+ define(`IFADD', `$1')
+ define(`SETCY', `cmp $1, #1')
+ define(`RETVAL', `adc r0, n, #0')
+ define(`RETVAL2', `adc r0, n, #1')
+ define(`func', mpn_add_n)
+ define(`func_nc', mpn_add_nc)')
+ifdef(`OPERATION_sub_n', `
+ define(`ADDSUBC', sbcs)
+ define(`IFADD', `')
+ define(`SETCY', `rsbs $1, $1, #0')
+ define(`RETVAL', `sbc r0, r0, r0
+ and r0, r0, #1')
+ define(`RETVAL2', `RETVAL')
+ define(`func', mpn_sub_n)
+ define(`func_nc', mpn_sub_nc)')
+
+MULFUNC_PROLOGUE(mpn_add_n mpn_add_nc mpn_sub_n mpn_sub_nc)
+
+ASM_START()
+PROLOGUE(func_nc)
+ ldr r12, [sp]
+ b L(ent)
+EPILOGUE()
+PROLOGUE(func)
+ mov r12, #0
+L(ent): push { r4-r9 }
+
+ ands r6, n, #3
+ mov n, n, lsr #2
+ beq L(b00)
+ cmp r6, #2
+ bcc L(b01)
+ beq L(b10)
+
+L(b11): ldr r5, [up], #4
+ ldr r7, [vp], #4
+ SETCY( r12)
+ ADDSUBC r9, r5, r7
+ ldrd r4, r5, [up, #0]
+ ldrd r6, r7, [vp, #0]
+ str r9, [rp], #-4
+ b L(lo)
+
+L(b00): ldrd r4, r5, [up], #-8
+ ldrd r6, r7, [vp], #-8
+ SETCY( r12)
+ sub rp, rp, #16
+ b L(mid)
+
+L(b01): ldr r5, [up], #-4
+ ldr r7, [vp], #-4
+ SETCY( r12)
+ ADDSUBC r9, r5, r7
+ str r9, [rp], #-12
+ tst n, n
+ beq L(wd1)
+L(gt1): ldrd r4, r5, [up, #8]
+ ldrd r6, r7, [vp, #8]
+ b L(mid)
+
+L(b10): ldrd r4, r5, [up]
+ ldrd r6, r7, [vp]
+ SETCY( r12)
+ sub rp, rp, #8
+ b L(lo)
+
+ ALIGN(16)
+L(top): ldrd r4, r5, [up, #8]
+ ldrd r6, r7, [vp, #8]
+ strd r8, r9, [rp, #8]
+L(mid): ADDSUBC r8, r4, r6
+ ADDSUBC r9, r5, r7
+ ldrd r4, r5, [up, #16]
+ ldrd r6, r7, [vp, #16]
+ strd r8, r9, [rp, #16]
+ ADDSUBC r8, r4, r6
+ ADDSUBC r9, r5, r7
+ sub n, n, #2
+ tst n, n
+ bmi L(dne)
+ ldrd r4, r5, [up, #24]
+ ldrd r6, r7, [vp, #24]
+ strd r8, r9, [rp, #24]
+ ADDSUBC r8, r4, r6
+ ADDSUBC r9, r5, r7
+ ldrd r4, r5, [up, #32]!
+ ldrd r6, r7, [vp, #32]!
+ strd r8, r9, [rp, #32]!
+L(lo): ADDSUBC r8, r4, r6
+ ADDSUBC r9, r5, r7
+ tst n, n
+ bne L(top)
+
+L(end): strd r8, r9, [rp, #8]
+L(wd1): RETVAL
+ pop { r4-r9 }
+ bx r14
+L(dne): strd r8, r9, [rp, #24]
+ RETVAL2
+ pop { r4-r9 }
+ bx r14
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/v7a/cora15/cnd_aors_n.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/v7a/cora15/cnd_aors_n.asm
new file mode 100644
index 00000000000..b9e5cd3f793
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/v7a/cora15/cnd_aors_n.asm
@@ -0,0 +1,158 @@
+dnl ARM mpn_cnd_add_n/mpn_cnd_sub_n optimised for A15.
+
+dnl Copyright 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/limb best
+C StrongARM: -
+C XScale ?
+C Cortex-A7 ?
+C Cortex-A8 ?
+C Cortex-A9 3.75 3
+C Cortex-A15 1.78 this
+
+C This code does not run as well as one could have hoped, since 1.5 c/l seems
+C realistic for this insn mix.
+
+C Architecture requirements:
+C v5 -
+C v5t -
+C v5te ldrd strd
+C v6 -
+C v6t2 -
+C v7a -
+
+define(`cnd',`r0')
+define(`rp', `r1')
+define(`up', `r2')
+define(`vp', `r3')
+define(`n', `r12')
+
+ifdef(`OPERATION_cnd_add_n', `
+ define(`ADDSUB', adds)
+ define(`ADDSUBC', adcs)
+ define(`IFADD', `$1')
+ define(`INITCY', `cmn r0, #0')
+ define(`RETVAL', `adc r0, n, #0')
+ define(`RETVAL2', `adc r0, n, #1')
+ define(`func', mpn_cnd_add_n)
+ define(`func_nc', mpn_add_nc)')
+ifdef(`OPERATION_cnd_sub_n', `
+ define(`ADDSUB', subs)
+ define(`ADDSUBC', sbcs)
+ define(`IFADD', `')
+ define(`INITCY', `cmp r0, #0')
+ define(`RETVAL', `sbc r0, r0, r0
+ and r0, r0, #1')
+ define(`RETVAL2', `RETVAL')
+ define(`func', mpn_cnd_sub_n)
+ define(`func_nc', mpn_sub_nc)')
+
+MULFUNC_PROLOGUE(mpn_cnd_add_n mpn_cnd_sub_n)
+
+ASM_START()
+PROLOGUE(func)
+ ldr n, [sp]
+ push { r4-r9 }
+
+ cmp cnd, #1
+ sbc cnd, cnd, cnd C conditionally set to 0xffffffff
+
+ ands r6, n, #3
+ mov n, n, lsr #2
+ beq L(b00)
+ cmp r6, #2
+ bcc L(b01)
+ beq L(b10)
+
+L(b11): ldr r5, [up], #4
+ ldr r7, [vp], #4
+ bic r7, r7, cnd
+ ADDSUB r9, r5, r7
+ ldrd r4, r5, [up, #0]
+ ldrd r6, r7, [vp, #0]
+ bic r6, r6, cnd
+ bic r7, r7, cnd
+ str r9, [rp], #-4
+ b L(lo)
+
+L(b00): ldrd r4, r5, [up], #-8
+ ldrd r6, r7, [vp], #-8
+ bic r6, r6, cnd
+ bic r7, r7, cnd
+ INITCY
+ sub rp, rp, #16
+ b L(mid)
+
+L(b01): ldr r5, [up], #-4
+ ldr r7, [vp], #-4
+ bic r7, r7, cnd
+ ADDSUB r9, r5, r7
+ str r9, [rp], #-12
+ tst n, n
+ beq L(wd1)
+L(gt1): ldrd r4, r5, [up, #8]
+ ldrd r6, r7, [vp, #8]
+ bic r6, r6, cnd
+ bic r7, r7, cnd
+ b L(mid)
+
+L(b10): ldrd r4, r5, [up]
+ ldrd r6, r7, [vp]
+ bic r6, r6, cnd
+ bic r7, r7, cnd
+ INITCY
+ sub rp, rp, #8
+ b L(lo)
+
+ ALIGN(16)
+L(top): ldrd r6, r7, [vp, #8]
+ ldrd r4, r5, [up, #8]
+ bic r6, r6, cnd
+ bic r7, r7, cnd
+ strd r8, r9, [rp, #8]
+L(mid): ADDSUBC r8, r4, r6
+ ADDSUBC r9, r5, r7
+ ldrd r6, r7, [vp, #16]!
+ ldrd r4, r5, [up, #16]!
+ bic r6, r6, cnd
+ bic r7, r7, cnd
+ sub n, n, #1
+ strd r8, r9, [rp, #16]!
+L(lo): ADDSUBC r8, r4, r6
+ ADDSUBC r9, r5, r7
+ tst n, n
+ bne L(top)
+
+L(end): strd r8, r9, [rp, #8]
+L(wd1): RETVAL
+ pop { r4-r9 }
+ bx r14
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/v7a/cora15/com.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/v7a/cora15/com.asm
new file mode 100644
index 00000000000..a258afe934e
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/v7a/cora15/com.asm
@@ -0,0 +1,180 @@
+dnl ARM mpn_com optimised for A15.
+
+dnl Contributed to the GNU project by Torbjörn Granlund.
+
+dnl Copyright 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/limb
+C StrongARM ?
+C XScale ?
+C Cortex-A7 ?
+C Cortex-A8 ?
+C Cortex-A9 2.5
+C Cortex-A15 1.0
+
+C This is great A15 core register code, but it is a bit large.
+C We use FEEDIN_VARIANT 1 to save some space, but use 8-way unrolling.
+
+C Architecture requirements:
+C v5 -
+C v5t -
+C v5te ldrd strd
+C v6 -
+C v6t2 -
+C v7a -
+
+define(`FEEDIN_VARIANT', 1) C alternatives: 0 1 2
+define(`UNROLL', 4x2) C alternatives: 4 4x2
+
+define(`rp', `r0')
+define(`up', `r1')
+define(`n', `r2')
+
+ASM_START()
+PROLOGUE(mpn_com)
+ push { r4-r5,r8-r9 }
+
+ifelse(FEEDIN_VARIANT,0,`
+ ands r12, n, #3
+ mov n, n, lsr #2
+ beq L(b00a)
+ tst r12, #1
+ beq L(bx0)
+ ldr r5, [up], #4
+ mvn r9, r5
+ str r9, [rp], #4
+ tst r12, #2
+ beq L(b00)
+L(bx0): ldrd r4, r5, [up, #0]
+ sub rp, rp, #8
+ b L(lo)
+L(b00): tst n, n
+ beq L(wd1)
+L(b00a):ldrd r4, r5, [up], #-8
+ sub rp, rp, #16
+ b L(mid)
+')
+ifelse(FEEDIN_VARIANT,1,`
+ and r12, n, #3
+ mov n, n, lsr #2
+ tst r12, #1
+ beq L(bx0)
+ ldr r5, [up], #4
+ mvn r9, r5
+ str r9, [rp], #4
+L(bx0): tst r12, #2
+ beq L(b00)
+ ldrd r4, r5, [up, #0]
+ sub rp, rp, #8
+ b L(lo)
+L(b00): tst n, n
+ beq L(wd1)
+ ldrd r4, r5, [up], #-8
+ sub rp, rp, #16
+ b L(mid)
+')
+ifelse(FEEDIN_VARIANT,2,`
+ ands r12, n, #3
+ mov n, n, lsr #2
+ beq L(b00)
+ cmp r12, #2
+ bcc L(b01)
+ beq L(b10)
+
+L(b11): ldr r5, [up], #4
+ mvn r9, r5
+ ldrd r4, r5, [up, #0]
+ str r9, [rp], #-4
+ b L(lo)
+
+L(b00): ldrd r4, r5, [up], #-8
+ sub rp, rp, #16
+ b L(mid)
+
+L(b01): ldr r5, [up], #-4
+ mvn r9, r5
+ str r9, [rp], #-12
+ tst n, n
+ beq L(wd1)
+L(gt1): ldrd r4, r5, [up, #8]
+ b L(mid)
+
+L(b10): ldrd r4, r5, [up]
+ sub rp, rp, #8
+ b L(lo)
+')
+ ALIGN(16)
+ifelse(UNROLL,4,`
+L(top): ldrd r4, r5, [up, #8]
+ strd r8, r9, [rp, #8]
+L(mid): mvn r8, r4
+ mvn r9, r5
+ ldrd r4, r5, [up, #16]!
+ strd r8, r9, [rp, #16]!
+ sub n, n, #1
+L(lo): mvn r8, r4
+ mvn r9, r5
+ tst n, n
+ bne L(top)
+')
+ifelse(UNROLL,4x2,`
+L(top): ldrd r4, r5, [up, #8]
+ strd r8, r9, [rp, #8]
+L(mid): mvn r8, r4
+ mvn r9, r5
+ ldrd r4, r5, [up, #16]
+ strd r8, r9, [rp, #16]
+ mvn r8, r4
+ mvn r9, r5
+ sub n, n, #2
+ tst n, n
+ bmi L(dne)
+ ldrd r4, r5, [up, #24]
+ strd r8, r9, [rp, #24]
+ mvn r8, r4
+ mvn r9, r5
+ ldrd r4, r5, [up, #32]!
+ strd r8, r9, [rp, #32]!
+L(lo): mvn r8, r4
+ mvn r9, r5
+ tst n, n
+ bne L(top)
+')
+
+L(end): strd r8, r9, [rp, #8]
+L(wd1): pop { r4-r5,r8-r9 }
+ bx r14
+ifelse(UNROLL,4x2,`
+L(dne): strd r8, r9, [rp, #24]
+ pop { r4-r5,r8-r9 }
+ bx r14
+')
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/v7a/cora15/gmp-mparam.h b/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/v7a/cora15/gmp-mparam.h
new file mode 100644
index 00000000000..2a06532b3eb
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/v7a/cora15/gmp-mparam.h
@@ -0,0 +1,197 @@
+/* gmp-mparam.h -- Compiler/machine parameter header file.
+
+Copyright 1991, 1993, 1994, 1999-2003, 2009, 2010, 2012-2014 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
+
+/* 1700MHz Cortex-A15 with Neon (in spite of file position) */
+/* FFT tuning limit = 25000000 */
+/* Generated by tuneup.c, 2014-03-12, gcc 4.6 */
+
+#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 3
+#define MOD_1_1_TO_MOD_1_2_THRESHOLD 9
+#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_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 MUL_TOOM22_THRESHOLD 23
+#define MUL_TOOM33_THRESHOLD 90
+#define MUL_TOOM44_THRESHOLD 262
+#define MUL_TOOM6H_THRESHOLD 351
+#define MUL_TOOM8H_THRESHOLD 557
+
+#define MUL_TOOM32_TO_TOOM43_THRESHOLD 90
+#define MUL_TOOM32_TO_TOOM53_THRESHOLD 160
+#define MUL_TOOM42_TO_TOOM53_THRESHOLD 89
+#define MUL_TOOM42_TO_TOOM63_THRESHOLD 169
+#define MUL_TOOM43_TO_TOOM54_THRESHOLD 130
+
+#define SQR_BASECASE_THRESHOLD 0 /* always (native) */
+#define SQR_TOOM2_THRESHOLD 43
+#define SQR_TOOM3_THRESHOLD 138
+#define SQR_TOOM4_THRESHOLD 363
+#define SQR_TOOM6_THRESHOLD 517
+#define SQR_TOOM8_THRESHOLD 725
+
+#define MULMID_TOOM42_THRESHOLD 52
+
+#define MULMOD_BNM1_THRESHOLD 17
+#define SQRMOD_BNM1_THRESHOLD 23
+
+#define MUL_FFT_MODF_THRESHOLD 550 /* k = 5 */
+#define MUL_FFT_TABLE3 \
+ { { 550, 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}, { 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}, { 191, 9}, { 383,10}, \
+ { 207,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}, \
+ { 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,10}, \
+ { 831,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}, { 831,12}, { 447,11}, { 895,13}, \
+ { 255,12}, { 511,11}, { 1023,12}, { 575,11}, \
+ { 1151,12}, { 639,11}, { 1279,12}, { 703,13}, \
+ { 383,12}, { 767,11}, { 1599,12}, { 831,11}, \
+ { 1663,12}, { 895,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,14}, { 767,13}, \
+ { 1535,12}, { 3071,15}, { 511,14}, { 1023,13}, \
+ { 2175,14}, { 1279,13}, { 2559,12}, { 5119,13}, \
+ { 2815,12}, { 5631,13}, { 2943,14}, { 16384,15}, \
+ { 32768,16} }
+#define MUL_FFT_TABLE3_SIZE 137
+#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}, \
+ { 32, 7}, { 17, 6}, { 35, 7}, { 19, 6}, \
+ { 39, 7}, { 25, 6}, { 51, 7}, { 27, 8}, \
+ { 15, 7}, { 35, 8}, { 19, 7}, { 41, 8}, \
+ { 23, 7}, { 51, 8}, { 27, 7}, { 55, 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}, { 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,10}, { 191, 9}, \
+ { 383,12}, { 63,11}, { 127,10}, { 255, 9}, \
+ { 511,10}, { 271, 9}, { 543,10}, { 287,11}, \
+ { 159,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}, { 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}, { 543,10}, { 1087,11}, \
+ { 607,12}, { 319,11}, { 671,10}, { 1343,11}, \
+ { 735,12}, { 383,11}, { 799,10}, { 1599,11}, \
+ { 831,12}, { 447,11}, { 895,12}, { 511,11}, \
+ { 1023,12}, { 575,11}, { 1151,12}, { 639,11}, \
+ { 1343,12}, { 703,13}, { 383,12}, { 767,11}, \
+ { 1599,12}, { 831,11}, { 1663,12}, { 895,13}, \
+ { 511,12}, { 1087,13}, { 639,12}, { 1407,13}, \
+ { 767,12}, { 1727,13}, { 895,14}, { 511,13}, \
+ { 1023,12}, { 2047,13}, { 1151,12}, { 2431,13}, \
+ { 1279,14}, { 767,13}, { 1535,12}, { 3071,15}, \
+ { 511,14}, { 1023,13}, { 2047,12}, { 4095,13}, \
+ { 2175,14}, { 1279,13}, { 2559,12}, { 5119,13}, \
+ { 2687,14}, { 16384,15}, { 32768,16} }
+#define SQR_FFT_TABLE3_SIZE 139
+#define SQR_FFT_THRESHOLD 4736
+
+#define MULLO_BASECASE_THRESHOLD 9
+#define MULLO_DC_THRESHOLD 39
+#define MULLO_MUL_N_THRESHOLD 11278
+
+#define DC_DIV_QR_THRESHOLD 54
+#define DC_DIVAPPR_Q_THRESHOLD 296
+#define DC_BDIV_QR_THRESHOLD 52
+#define DC_BDIV_Q_THRESHOLD 300
+
+#define INV_MULMOD_BNM1_THRESHOLD 44
+#define INV_NEWTON_THRESHOLD 294
+#define INV_APPR_THRESHOLD 294
+
+#define BINV_NEWTON_THRESHOLD 375
+#define REDC_1_TO_REDC_2_THRESHOLD 102
+#define REDC_2_TO_REDC_N_THRESHOLD 0 /* always */
+
+#define MU_DIV_QR_THRESHOLD 1718
+#define MU_DIVAPPR_Q_THRESHOLD 1718
+#define MUPI_DIV_QR_THRESHOLD 108
+#define MU_BDIV_QR_THRESHOLD 1528
+#define MU_BDIV_Q_THRESHOLD 1718
+
+#define POWM_SEC_TABLE 3,32,70,416,1464
+
+#define MATRIX22_STRASSEN_THRESHOLD 22
+#define HGCD_THRESHOLD 152
+#define HGCD_APPR_THRESHOLD 230
+#define HGCD_REDUCE_THRESHOLD 3259
+#define GCD_DC_THRESHOLD 702
+#define GCDEXT_DC_THRESHOLD 538
+#define JACOBI_BASE_METHOD 4
+
+#define GET_STR_DC_THRESHOLD 18
+#define GET_STR_PRECOMPUTE_THRESHOLD 32
+#define SET_STR_DC_THRESHOLD 119
+#define SET_STR_PRECOMPUTE_THRESHOLD 1063
+
+#define FAC_DSC_THRESHOLD 262
+#define FAC_ODD_THRESHOLD 26
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/v7a/cora15/logops_n.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/v7a/cora15/logops_n.asm
new file mode 100644
index 00000000000..06026143e14
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/v7a/cora15/logops_n.asm
@@ -0,0 +1,253 @@
+dnl ARM mpn_and_n, mpn_andn_n. mpn_nand_n, etc, optimised for A15.
+
+dnl Contributed to the GNU project by Torbjörn Granlund.
+
+dnl Copyright 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/limb cycles/limb
+C and andn ior xor nand iorn nior xnor
+C StrongARM ? ?
+C XScale ? ?
+C Cortex-A7 ? ?
+C Cortex-A8 ? ?
+C Cortex-A9 3.5 3.56
+C Cortex-A15 1.27 1.64
+
+C This is great A15 core register code, but it is a bit large.
+C We use FEEDIN_VARIANT 1 to save some space, but use 8-way unrolling.
+
+C Architecture requirements:
+C v5 -
+C v5t -
+C v5te ldrd strd
+C v6 -
+C v6t2 -
+C v7a -
+
+define(`FEEDIN_VARIANT', 1) C alternatives: 0 1 2
+define(`UNROLL', 4x2) C alternatives: 4 4x2
+
+define(`rp', `r0')
+define(`up', `r1')
+define(`vp', `r2')
+define(`n', `r3')
+
+define(`POSTOP')
+
+ifdef(`OPERATION_and_n',`
+ define(`func', `mpn_and_n')
+ define(`LOGOP', `and $1, $2, $3')')
+ifdef(`OPERATION_andn_n',`
+ define(`func', `mpn_andn_n')
+ define(`LOGOP', `bic $1, $2, $3')')
+ifdef(`OPERATION_nand_n',`
+ define(`func', `mpn_nand_n')
+ define(`POSTOP', `mvn $1, $1')
+ define(`LOGOP', `and $1, $2, $3')')
+ifdef(`OPERATION_ior_n',`
+ define(`func', `mpn_ior_n')
+ define(`LOGOP', `orr $1, $2, $3')')
+ifdef(`OPERATION_iorn_n',`
+ define(`func', `mpn_iorn_n')
+ define(`POSTOP', `mvn $1, $1')
+ define(`LOGOP', `bic $1, $3, $2')')
+ifdef(`OPERATION_nior_n',`
+ define(`func', `mpn_nior_n')
+ define(`POSTOP', `mvn $1, $1')
+ define(`LOGOP', `orr $1, $2, $3')')
+ifdef(`OPERATION_xor_n',`
+ define(`func', `mpn_xor_n')
+ define(`LOGOP', `eor $1, $2, $3')')
+ifdef(`OPERATION_xnor_n',`
+ define(`func', `mpn_xnor_n')
+ define(`POSTOP', `mvn $1, $1')
+ define(`LOGOP', `eor $1, $2, $3')')
+
+MULFUNC_PROLOGUE(mpn_and_n mpn_andn_n mpn_nand_n mpn_ior_n mpn_iorn_n mpn_nior_n mpn_xor_n mpn_xnor_n)
+
+ASM_START()
+PROLOGUE(func)
+ push { r4-r9 }
+
+ifelse(FEEDIN_VARIANT,0,`
+ ands r6, n, #3
+ mov n, n, lsr #2
+ beq L(b00a)
+ tst r6, #1
+ beq L(bx0)
+ ldr r5, [up], #4
+ ldr r7, [vp], #4
+ LOGOP( r9, r5, r7)
+ POSTOP( r9)
+ str r9, [rp], #4
+ tst r6, #2
+ beq L(b00)
+L(bx0): ldrd r4, r5, [up, #0]
+ ldrd r6, r7, [vp, #0]
+ sub rp, rp, #8
+ b L(lo)
+L(b00): tst n, n
+ beq L(wd1)
+L(b00a):ldrd r4, r5, [up], #-8
+ ldrd r6, r7, [vp], #-8
+ sub rp, rp, #16
+ b L(mid)
+')
+ifelse(FEEDIN_VARIANT,1,`
+ and r6, n, #3
+ mov n, n, lsr #2
+ tst r6, #1
+ beq L(bx0)
+ ldr r5, [up], #4
+ ldr r7, [vp], #4
+ LOGOP( r9, r5, r7)
+ POSTOP( r9)
+ str r9, [rp], #4
+L(bx0): tst r6, #2
+ beq L(b00)
+ ldrd r4, r5, [up, #0]
+ ldrd r6, r7, [vp, #0]
+ sub rp, rp, #8
+ b L(lo)
+L(b00): tst n, n
+ beq L(wd1)
+ ldrd r4, r5, [up], #-8
+ ldrd r6, r7, [vp], #-8
+ sub rp, rp, #16
+ b L(mid)
+')
+ifelse(FEEDIN_VARIANT,2,`
+ ands r6, n, #3
+ mov n, n, lsr #2
+ beq L(b00)
+ cmp r6, #2
+ bcc L(b01)
+ beq L(b10)
+
+L(b11): ldr r5, [up], #4
+ ldr r7, [vp], #4
+ LOGOP( r9, r5, r7)
+ ldrd r4, r5, [up, #0]
+ ldrd r6, r7, [vp, #0]
+ POSTOP( r9)
+ str r9, [rp], #-4
+ b L(lo)
+
+L(b00): ldrd r4, r5, [up], #-8
+ ldrd r6, r7, [vp], #-8
+ sub rp, rp, #16
+ b L(mid)
+
+L(b01): ldr r5, [up], #-4
+ ldr r7, [vp], #-4
+ LOGOP( r9, r5, r7)
+ POSTOP( r9)
+ str r9, [rp], #-12
+ tst n, n
+ beq L(wd1)
+L(gt1): ldrd r4, r5, [up, #8]
+ ldrd r6, r7, [vp, #8]
+ b L(mid)
+
+L(b10): ldrd r4, r5, [up]
+ ldrd r6, r7, [vp]
+ sub rp, rp, #8
+ b L(lo)
+')
+ ALIGN(16)
+ifelse(UNROLL,4,`
+L(top): ldrd r4, r5, [up, #8]
+ ldrd r6, r7, [vp, #8]
+ POSTOP( r8)
+ POSTOP( r9)
+ strd r8, r9, [rp, #8]
+L(mid): LOGOP( r8, r4, r6)
+ LOGOP( r9, r5, r7)
+ ldrd r4, r5, [up, #16]!
+ ldrd r6, r7, [vp, #16]!
+ POSTOP( r8)
+ POSTOP( r9)
+ strd r8, r9, [rp, #16]!
+ sub n, n, #1
+L(lo): LOGOP( r8, r4, r6)
+ LOGOP( r9, r5, r7)
+ tst n, n
+ bne L(top)
+')
+ifelse(UNROLL,4x2,`
+L(top): ldrd r4, r5, [up, #8]
+ ldrd r6, r7, [vp, #8]
+ POSTOP( r8)
+ POSTOP( r9)
+ strd r8, r9, [rp, #8]
+L(mid): LOGOP( r8, r4, r6)
+ LOGOP( r9, r5, r7)
+ ldrd r4, r5, [up, #16]
+ ldrd r6, r7, [vp, #16]
+ POSTOP( r8)
+ POSTOP( r9)
+ strd r8, r9, [rp, #16]
+ LOGOP( r8, r4, r6)
+ LOGOP( r9, r5, r7)
+ sub n, n, #2
+ tst n, n
+ bmi L(dne)
+ ldrd r4, r5, [up, #24]
+ ldrd r6, r7, [vp, #24]
+ POSTOP( r8)
+ POSTOP( r9)
+ strd r8, r9, [rp, #24]
+ LOGOP( r8, r4, r6)
+ LOGOP( r9, r5, r7)
+ ldrd r4, r5, [up, #32]!
+ ldrd r6, r7, [vp, #32]!
+ POSTOP( r8)
+ POSTOP( r9)
+ strd r8, r9, [rp, #32]!
+L(lo): LOGOP( r8, r4, r6)
+ LOGOP( r9, r5, r7)
+ tst n, n
+ bne L(top)
+')
+
+L(end): POSTOP( r8)
+ POSTOP( r9)
+ strd r8, r9, [rp, #8]
+L(wd1): pop { r4-r9 }
+ bx r14
+ifelse(UNROLL,4x2,`
+L(dne): POSTOP( r8)
+ POSTOP( r9)
+ strd r8, r9, [rp, #24]
+ pop { r4-r9 }
+ bx r14
+')
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/v7a/cora15/mul_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/v7a/cora15/mul_1.asm
new file mode 100644
index 00000000000..766ba5c57f2
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/v7a/cora15/mul_1.asm
@@ -0,0 +1,104 @@
+dnl ARM mpn_mul_1 optimised for A15.
+
+dnl Copyright 2012, 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/limb best
+C StrongARM: -
+C XScale ?
+C Cortex-A7 ?
+C Cortex-A8 ?
+C Cortex-A9 5.25 3.25
+C Cortex-A15 2.25 this
+
+
+C This runs well on A15 but very poorly on A9. By scheduling loads and adds
+C it is possible to get good A9 performance as well, but at the cost of using
+C many more (callee-saves) registers.
+
+C This is armv5 code, optimized for the armv7a cpu A15. Its location in the
+C GMP file structure might be misleading.
+
+
+define(`rp', `r0')
+define(`up', `r1')
+define(`n', `r2')
+define(`v0', `r3')
+
+ASM_START()
+PROLOGUE(mpn_mul_1c)
+ ldr r12, [sp]
+ b L(ent)
+EPILOGUE()
+PROLOGUE(mpn_mul_1)
+ mov r12, #0
+L(ent): push {r4-r7}
+
+ ldr r6, [up], #4
+ tst n, #1
+ beq L(bx0)
+
+L(bx1): umull r4, r7, r6, v0
+ adds r4, r4, r12
+ tst n, #2
+ beq L(lo1)
+ b L(lo3)
+
+L(bx0): umull r4, r5, r6, v0
+ adds r4, r4, r12
+ tst n, #2
+ beq L(lo0)
+ b L(lo2)
+
+L(top): ldr r6, [up], #4
+ str r4, [rp], #4
+ umull r4, r5, r6, v0
+ adds r4, r4, r7
+L(lo0): ldr r6, [up], #4
+ str r4, [rp], #4
+ umull r4, r7, r6, v0
+ adcs r4, r4, r5
+L(lo3): ldr r6, [up], #4
+ str r4, [rp], #4
+ umull r4, r5, r6, v0
+ adcs r4, r4, r7
+L(lo2): ldr r6, [up], #4
+ str r4, [rp], #4
+ umull r4, r7, r6, v0
+ adcs r4, r4, r5
+L(lo1): adc r7, r7, #0
+ subs n, n, #4
+ bgt L(top)
+
+ str r4, [rp]
+ mov r0, r7
+ pop {r4-r7}
+ bx lr
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/v7a/cora15/neon/aorsorrlsh1_n.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/v7a/cora15/neon/aorsorrlsh1_n.asm
new file mode 100644
index 00000000000..d8cfe3f78f2
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/v7a/cora15/neon/aorsorrlsh1_n.asm
@@ -0,0 +1,43 @@
+dnl ARM mpn_addlshC_n, mpn_sublshC_n, mpn_rsblshC_n
+
+dnl Contributed to the GNU project by Torbjörn Granlund.
+
+dnl Copyright 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')
+
+define(LSH, 1)
+
+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(`arm/v7a/cora15/neon/aorsorrlshC_n.asm')
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/v7a/cora15/neon/aorsorrlsh2_n.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/v7a/cora15/neon/aorsorrlsh2_n.asm
new file mode 100644
index 00000000000..b48204d9269
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/v7a/cora15/neon/aorsorrlsh2_n.asm
@@ -0,0 +1,43 @@
+dnl ARM mpn_addlshC_n, mpn_sublshC_n, mpn_rsblshC_n
+
+dnl Contributed to the GNU project by Torbjörn Granlund.
+
+dnl Copyright 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')
+
+define(LSH, 2)
+
+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(`arm/v7a/cora15/neon/aorsorrlshC_n.asm')
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/v7a/cora15/neon/aorsorrlshC_n.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/v7a/cora15/neon/aorsorrlshC_n.asm
new file mode 100644
index 00000000000..16c34a2699d
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/v7a/cora15/neon/aorsorrlshC_n.asm
@@ -0,0 +1,144 @@
+dnl ARM mpn_addlshC_n, mpn_sublshC_n, mpn_rsblshC_n
+
+dnl Contributed to the GNU project by Torbjörn Granlund.
+
+dnl Copyright 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/.
+
+
+C cycles/limb
+C StrongARM -
+C XScale -
+C Cortex-A7 ?
+C Cortex-A8 ?
+C Cortex-A9 5.25
+C Cortex-A15 2.25
+
+C TODO
+C * Consider using 4-way feed-in code.
+C * This is ad-hoc scheduled, perhaps unnecessarily so for A15, and perhaps
+C insufficiently for A7 and A8.
+
+define(`rp', `r0')
+define(`up', `r1')
+define(`vp', `r2')
+define(`n', `r3')
+
+ifdef(`DO_add', `
+ define(`ADCSBCS', `adcs $1, $2, $3')
+ define(`CLRCY', `cmn r13, #1')
+ define(`RETVAL', `adc r0, $1, #0')
+ define(`func', mpn_addlsh`'LSH`'_n)')
+ifdef(`DO_sub', `
+ define(`ADCSBCS', `sbcs $1, $2, $3')
+ define(`CLRCY', `cmp r13, #0')
+ define(`RETVAL', `sbc $2, $2, $2
+ cmn $2, #1
+ adc r0, $1, #0')
+ define(`func', mpn_sublsh`'LSH`'_n)')
+ifdef(`DO_rsb', `
+ define(`ADCSBCS', `sbcs $1, $3, $2')
+ define(`CLRCY', `cmp r13, #0')
+ define(`RETVAL', `sbc r0, $1, #0')
+ define(`func', mpn_rsblsh`'LSH`'_n)')
+
+
+ASM_START()
+PROLOGUE(func)
+ push {r4-r10}
+ vmov.i8 d0, #0 C could feed carry through here
+ CLRCY
+ tst n, #1
+ beq L(bb0)
+
+L(bb1): vld1.32 {d3[0]}, [vp]!
+ vsli.u32 d0, d3, #LSH
+ ldr r12, [up], #4
+ vmov.32 r5, d0[0]
+ vshr.u32 d0, d3, #32-LSH
+ ADCSBCS( r12, r12, r5)
+ str r12, [rp], #4
+ bics n, n, #1
+ beq L(rtn)
+
+L(bb0): tst n, #2
+ beq L(b00)
+
+L(b10): vld1.32 {d3}, [vp]!
+ vsli.u64 d0, d3, #LSH
+ ldmia up!, {r10,r12}
+ vmov r4, r5, d0
+ vshr.u64 d0, d3, #64-LSH
+ ADCSBCS( r10, r10, r4)
+ ADCSBCS( r12, r12, r5)
+ stmia rp!, {r10,r12}
+ bics n, n, #2
+ beq L(rtn)
+
+L(b00): vld1.32 {d2}, [vp]!
+ vsli.u64 d0, d2, #LSH
+ vshr.u64 d1, d2, #64-LSH
+ vld1.32 {d3}, [vp]!
+ vsli.u64 d1, d3, #LSH
+ vmov r6, r7, d0
+ vshr.u64 d0, d3, #64-LSH
+ sub n, n, #4
+ tst n, n
+ beq L(end)
+
+ ALIGN(16)
+L(top): ldmia up!, {r8,r9,r10,r12}
+ vld1.32 {d2}, [vp]!
+ vsli.u64 d0, d2, #LSH
+ vmov r4, r5, d1
+ vshr.u64 d1, d2, #64-LSH
+ ADCSBCS( r8, r8, r6)
+ ADCSBCS( r9, r9, r7)
+ vld1.32 {d3}, [vp]!
+ vsli.u64 d1, d3, #LSH
+ vmov r6, r7, d0
+ vshr.u64 d0, d3, #64-LSH
+ ADCSBCS( r10, r10, r4)
+ ADCSBCS( r12, r12, r5)
+ stmia rp!, {r8,r9,r10,r12}
+ sub n, n, #4
+ tst n, n
+ bne L(top)
+
+L(end): ldmia up!, {r8,r9,r10,r12}
+ vmov r4, r5, d1
+ ADCSBCS( r8, r8, r6)
+ ADCSBCS( r9, r9, r7)
+ ADCSBCS( r10, r10, r4)
+ ADCSBCS( r12, r12, r5)
+ stmia rp!, {r8,r9,r10,r12}
+L(rtn): vmov.32 r0, d0[0]
+ RETVAL( r0, r1)
+ pop {r4-r10}
+ bx r14
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/v7a/cora15/neon/com.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/v7a/cora15/neon/com.asm
new file mode 100644
index 00000000000..9e7a629287b
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/v7a/cora15/neon/com.asm
@@ -0,0 +1,97 @@
+dnl ARM Neon mpn_com optimised for A15.
+
+dnl Copyright 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/limb
+C StrongARM ?
+C XScale ?
+C Cortex-A8 ?
+C Cortex-A9 2.1
+C Cortex-A15 0.65
+
+define(`rp', `r0')
+define(`up', `r1')
+define(`n', `r2')
+
+ASM_START()
+PROLOGUE(mpn_com)
+ cmp n, #7
+ ble L(bc)
+
+C Perform a few initial operation until rp is 128-bit aligned
+ tst rp, #4
+ beq L(al1)
+ vld1.32 {d0[0]}, [up]!
+ sub n, n, #1
+ vmvn d0, d0
+ vst1.32 {d0[0]}, [rp]!
+L(al1): tst rp, #8
+ beq L(al2)
+ vld1.32 {d0}, [up]!
+ sub n, n, #2
+ vmvn d0, d0
+ vst1.32 {d0}, [rp:64]!
+L(al2): vld1.32 {q2}, [up]!
+ subs n, n, #12
+ blt L(end)
+
+ ALIGN(16)
+L(top): vld1.32 {q0}, [up]!
+ vmvn q2, q2
+ subs n, n, #8
+ vst1.32 {q2}, [rp:128]!
+ vld1.32 {q2}, [up]!
+ vmvn q0, q0
+ vst1.32 {q0}, [rp:128]!
+ bge L(top)
+
+L(end): vmvn q2, q2
+ vst1.32 {q2}, [rp:128]!
+
+C Handle last 0-7 limbs. Note that rp is aligned after loop, but not when we
+C arrive here via L(bc)
+L(bc): tst n, #4
+ beq L(tl1)
+ vld1.32 {q0}, [up]!
+ vmvn q0, q0
+ vst1.32 {q0}, [rp]!
+L(tl1): tst n, #2
+ beq L(tl2)
+ vld1.32 {d0}, [up]!
+ vmvn d0, d0
+ vst1.32 {d0}, [rp]!
+L(tl2): tst n, #1
+ beq L(tl3)
+ vld1.32 {d0[0]}, [up]
+ vmvn d0, d0
+ vst1.32 {d0[0]}, [rp]
+L(tl3): bx lr
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/v7a/cora15/neon/copyd.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/v7a/cora15/neon/copyd.asm
new file mode 100644
index 00000000000..98fe535def5
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/v7a/cora15/neon/copyd.asm
@@ -0,0 +1,110 @@
+dnl ARM Neon mpn_copyd optimised for A15.
+
+dnl Copyright 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/limb
+C StrongARM -
+C XScale -
+C Cortex-A7 ?
+C Cortex-A8 ?
+C Cortex-A9 1.75 slower than core register code
+C Cortex-A15 0.52
+
+define(`rp', `r0')
+define(`up', `r1')
+define(`n', `r2')
+
+ASM_START()
+PROLOGUE(mpn_copyd)
+ add rp, rp, n, lsl #2
+ add up, up, n, lsl #2
+
+ cmp n, #7
+ ble L(bc)
+
+C Copy until rp is 128-bit aligned
+ tst rp, #4
+ beq L(al1)
+ sub up, up, #4
+ vld1.32 {d22[0]}, [up]
+ sub n, n, #1
+ sub rp, rp, #4
+ vst1.32 {d22[0]}, [rp]
+L(al1): tst rp, #8
+ beq L(al2)
+ sub up, up, #8
+ vld1.32 {d22}, [up]
+ sub n, n, #2
+ sub rp, rp, #8
+ vst1.32 {d22}, [rp:64]
+L(al2): sub up, up, #16
+ vld1.32 {d26-d27}, [up]
+ subs n, n, #12
+ sub rp, rp, #16 C offset rp for loop
+ blt L(end)
+
+ sub up, up, #16 C offset up for loop
+ mov r12, #-16
+
+ ALIGN(16)
+L(top): vld1.32 {d22-d23}, [up], r12
+ vst1.32 {d26-d27}, [rp:128], r12
+ vld1.32 {d26-d27}, [up], r12
+ vst1.32 {d22-d23}, [rp:128], r12
+ subs n, n, #8
+ bge L(top)
+
+ add up, up, #16 C undo up offset
+ C rp offset undoing folded
+L(end): vst1.32 {d26-d27}, [rp:128]
+
+C Copy last 0-7 limbs. Note that rp is aligned after loop, but not when we
+C arrive here via L(bc)
+L(bc): tst n, #4
+ beq L(tl1)
+ sub up, up, #16
+ vld1.32 {d22-d23}, [up]
+ sub rp, rp, #16
+ vst1.32 {d22-d23}, [rp]
+L(tl1): tst n, #2
+ beq L(tl2)
+ sub up, up, #8
+ vld1.32 {d22}, [up]
+ sub rp, rp, #8
+ vst1.32 {d22}, [rp]
+L(tl2): tst n, #1
+ beq L(tl3)
+ sub up, up, #4
+ vld1.32 {d22[0]}, [up]
+ sub rp, rp, #4
+ vst1.32 {d22[0]}, [rp]
+L(tl3): bx lr
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/v7a/cora15/neon/copyi.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/v7a/cora15/neon/copyi.asm
new file mode 100644
index 00000000000..2e05afe5e86
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/v7a/cora15/neon/copyi.asm
@@ -0,0 +1,90 @@
+dnl ARM Neon mpn_copyi optimised for A15.
+
+dnl Copyright 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/limb
+C StrongARM -
+C XScale -
+C Cortex-A7 ?
+C Cortex-A8 ?
+C Cortex-A9 1.75 slower than core register code
+C Cortex-A15 0.52
+
+define(`rp', `r0')
+define(`up', `r1')
+define(`n', `r2')
+
+ASM_START()
+PROLOGUE(mpn_copyi)
+ cmp n, #7
+ ble L(bc)
+
+C Copy until rp is 128-bit aligned
+ tst rp, #4
+ beq L(al1)
+ vld1.32 {d22[0]}, [up]!
+ sub n, n, #1
+ vst1.32 {d22[0]}, [rp]!
+L(al1): tst rp, #8
+ beq L(al2)
+ vld1.32 {d22}, [up]!
+ sub n, n, #2
+ vst1.32 {d22}, [rp:64]!
+L(al2): vld1.32 {d26-d27}, [up]!
+ subs n, n, #12
+ blt L(end)
+
+ ALIGN(16)
+L(top): vld1.32 {d22-d23}, [up]!
+ vst1.32 {d26-d27}, [rp:128]!
+ vld1.32 {d26-d27}, [up]!
+ vst1.32 {d22-d23}, [rp:128]!
+ subs n, n, #8
+ bge L(top)
+
+L(end): vst1.32 {d26-d27}, [rp:128]!
+
+C Copy last 0-7 limbs. Note that rp is aligned after loop, but not when we
+C arrive here via L(bc)
+L(bc): tst n, #4
+ beq L(tl1)
+ vld1.32 {d22-d23}, [up]!
+ vst1.32 {d22-d23}, [rp]!
+L(tl1): tst n, #2
+ beq L(tl2)
+ vld1.32 {d22}, [up]!
+ vst1.32 {d22}, [rp]!
+L(tl2): tst n, #1
+ beq L(tl3)
+ vld1.32 {d22[0]}, [up]
+ vst1.32 {d22[0]}, [rp]
+L(tl3): bx lr
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/v7a/cora15/neon/rsh1aors_n.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/v7a/cora15/neon/rsh1aors_n.asm
new file mode 100644
index 00000000000..2c11d6debd4
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/v7a/cora15/neon/rsh1aors_n.asm
@@ -0,0 +1,177 @@
+dnl ARM Neon mpn_rsh1add_n, mpn_rsh1sub_n.
+
+dnl Contributed to the GNU project by Torbjörn Granlund.
+
+dnl Copyright 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/limb
+C StrongARM -
+C XScale -
+C Cortex-A7 ?
+C Cortex-A8 ?
+C Cortex-A9 4-5
+C Cortex-A15 2.5
+
+C TODO
+C * Try to make this smaller, its size (384 bytes) is excessive.
+C * Try to reach 2.25 c/l on A15, to match the addlsh_1 family.
+C * This is ad-hoc scheduled, perhaps unnecessarily so for A15, and perhaps
+C insufficiently for A7 and A8.
+
+define(`rp', `r0')
+define(`up', `r1')
+define(`vp', `r2')
+define(`n', `r3')
+
+ifdef(`OPERATION_rsh1add_n', `
+ define(`ADDSUBS', `adds $1, $2, $3')
+ define(`ADCSBCS', `adcs $1, $2, $3')
+ define(`IFADD', `$1')
+ define(`IFSUB', `')
+ define(`func', mpn_rsh1add_n)')
+ifdef(`OPERATION_rsh1sub_n', `
+ define(`ADDSUBS', `subs $1, $2, $3')
+ define(`ADCSBCS', `sbcs $1, $2, $3')
+ define(`IFADD', `')
+ define(`IFSUB', `$1')
+ define(`func', mpn_rsh1sub_n)')
+
+MULFUNC_PROLOGUE(mpn_rsh1add_n mpn_rsh1sub_n)
+
+ASM_START()
+PROLOGUE(func)
+ push {r4-r10}
+
+ ands r4, n, #3
+ beq L(b00)
+ cmp r4, #2
+ blo L(b01)
+ beq L(b10)
+
+L(b11): ldmia up!, {r9,r10,r12}
+ ldmia vp!, {r5,r6,r7}
+ ADDSUBS( r9, r9, r5)
+ vmov d4, r9, r9
+ ADCSBCS( r10, r10, r6)
+ ADCSBCS( r12, r12, r7)
+ vshr.u64 d3, d4, #1
+ vmov d1, r10, r12
+ vsli.u64 d3, d1, #31
+ vshr.u64 d2, d1, #1
+ vst1.32 d3[0], [rp]!
+ bics n, n, #3
+ beq L(wd2)
+L(gt3): ldmia up!, {r8,r9,r10,r12}
+ ldmia vp!, {r4,r5,r6,r7}
+ b L(mi0)
+
+L(b10): ldmia up!, {r10,r12}
+ ldmia vp!, {r6,r7}
+ ADDSUBS( r10, r10, r6)
+ ADCSBCS( r12, r12, r7)
+ vmov d4, r10, r12
+ bics n, n, #2
+ vshr.u64 d2, d4, #1
+ beq L(wd2)
+L(gt2): ldmia up!, {r8,r9,r10,r12}
+ ldmia vp!, {r4,r5,r6,r7}
+ b L(mi0)
+
+L(b01): ldr r12, [up], #4
+ ldr r7, [vp], #4
+ ADDSUBS( r12, r12, r7)
+ vmov d4, r12, r12
+ bics n, n, #1
+ bne L(gt1)
+ mov r5, r12, lsr #1
+IFADD(` adc r1, n, #0')
+IFSUB(` adc r1, n, #1')
+ bfi r5, r1, #31, #1
+ str r5, [rp]
+ and r0, r12, #1
+ pop {r4-r10}
+ bx r14
+L(gt1): ldmia up!, {r8,r9,r10,r12}
+ ldmia vp!, {r4,r5,r6,r7}
+ vshr.u64 d2, d4, #1
+ ADCSBCS( r8, r8, r4)
+ ADCSBCS( r9, r9, r5)
+ vmov d0, r8, r9
+ ADCSBCS( r10, r10, r6)
+ ADCSBCS( r12, r12, r7)
+ vsli.u64 d2, d0, #31
+ vshr.u64 d3, d0, #1
+ vst1.32 d2[0], [rp]!
+ b L(mi1)
+
+L(b00): ldmia up!, {r8,r9,r10,r12}
+ ldmia vp!, {r4,r5,r6,r7}
+ ADDSUBS( r8, r8, r4)
+ ADCSBCS( r9, r9, r5)
+ vmov d4, r8, r9
+ ADCSBCS( r10, r10, r6)
+ ADCSBCS( r12, r12, r7)
+ vshr.u64 d3, d4, #1
+ b L(mi1)
+
+ ALIGN(16)
+L(top): ldmia up!, {r8,r9,r10,r12}
+ ldmia vp!, {r4,r5,r6,r7}
+ vsli.u64 d3, d1, #63
+ vshr.u64 d2, d1, #1
+ vst1.32 d3, [rp]!
+L(mi0): ADCSBCS( r8, r8, r4)
+ ADCSBCS( r9, r9, r5)
+ vmov d0, r8, r9
+ ADCSBCS( r10, r10, r6)
+ ADCSBCS( r12, r12, r7)
+ vsli.u64 d2, d0, #63
+ vshr.u64 d3, d0, #1
+ vst1.32 d2, [rp]!
+L(mi1): vmov d1, r10, r12
+ sub n, n, #4
+ tst n, n
+ bne L(top)
+
+L(end): vsli.u64 d3, d1, #63
+ vshr.u64 d2, d1, #1
+ vst1.32 d3, [rp]!
+L(wd2): vmov r4, r5, d2
+IFADD(` adc r1, n, #0')
+IFSUB(` adc r1, n, #1')
+ bfi r5, r1, #31, #1
+ stm rp, {r4,r5}
+
+L(rtn): vmov.32 r0, d4[0]
+ and r0, r0, #1
+ pop {r4-r10}
+ bx r14
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/v7a/cora15/submul_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/v7a/cora15/submul_1.asm
new file mode 100644
index 00000000000..ed7bfe820b6
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/v7a/cora15/submul_1.asm
@@ -0,0 +1,159 @@
+dnl ARM mpn_submul_1 optimised for A15.
+
+dnl Copyright 2012, 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/limb best
+C StrongARM: -
+C XScale ?
+C Cortex-A7 ?
+C Cortex-A8 ?
+C Cortex-A9 5.75 3.75
+C Cortex-A15 2.32 this
+
+C This code uses umlal and umaal for adding in the rp[] data, keeping the
+C recurrency path separate from any multiply instructions. It performs well on
+C A15, but not quite at the multiply bandwidth like the corresponding addmul_1
+C code.
+C
+C We don't use r12 due to ldrd and strd limitations.
+C
+C This loop complements U on the fly,
+C U' = B^n - 1 - U
+C and then uses that
+C R - U*v = R + U'*v + v - B^n v
+
+C Architecture requirements:
+C v5 -
+C v5t -
+C v5te ldrd strd
+C v6 umaal
+C v6t2 -
+C v7a -
+
+define(`rp', `r0')
+define(`up', `r1')
+define(`n', `r2')
+define(`v0', `r3')
+
+define(`w0', `r10') define(`w1', `r11')
+define(`u0', `r8') define(`u1', `r9')
+
+ASM_START()
+PROLOGUE(mpn_submul_1)
+ sub sp, sp, #32
+ strd r10, r11, [sp, #24]
+ strd r8, r9, [sp, #16]
+ strd r6, r7, [sp, #8]
+ strd r4, r5, [sp, #0]
+C push { r4-r11 }
+
+ ands r6, n, #3
+ sub n, n, #3
+ beq L(b00)
+ cmp r6, #2
+ bcc L(b01)
+ beq L(b10)
+
+L(b11): mov r6, #0
+ ldr u1, [up], #-4
+ ldr w1, [rp], #-16
+ mvn u1, u1
+ adds r7, v0, #0
+ b L(mid)
+
+L(b00): ldrd u0, u1, [up]
+ ldrd w0, w1, [rp], #-12
+ mvn u0, u0
+ mvn u1, u1
+ mov r6, v0
+ umaal w0, r6, u0, v0
+ cmn r13, #0 C carry clear
+ mov r7, #0
+ str w0, [rp, #12]
+ b L(mid)
+
+L(b10): ldrd u0, u1, [up], #8
+ ldrd w0, w1, [rp]
+ mvn u0, u0
+ mvn u1, u1
+ mov r4, v0
+ umaal w0, r4, u0, v0
+ mov r5, #0
+ str w0, [rp], #-4
+ umlal w1, r5, u1, v0
+ adds n, n, #0
+ bmi L(end)
+ b L(top)
+
+L(b01): ldr u1, [up], #4
+ ldr w1, [rp], #-8
+ mvn u1, u1
+ mov r5, v0
+ mov r4, #0
+ umaal w1, r5, u1, v0
+ tst n, n
+ bmi L(end)
+
+C ALIGN(16)
+L(top): ldrd u0, u1, [up, #0]
+ adcs r4, r4, w1
+ mvn u0, u0
+ ldrd w0, w1, [rp, #12]
+ mvn u1, u1
+ mov r6, #0
+ umlal w0, r6, u0, v0 C 1 2
+ adcs r5, r5, w0
+ mov r7, #0
+ strd r4, r5, [rp, #8]
+L(mid): umaal w1, r7, u1, v0 C 2 3
+ ldrd u0, u1, [up, #8]
+ add up, up, #16
+ adcs r6, r6, w1
+ mvn u0, u0
+ ldrd w0, w1, [rp, #20]
+ mvn u1, u1
+ mov r4, #0
+ umlal w0, r4, u0, v0 C 3 4
+ adcs r7, r7, w0
+ mov r5, #0
+ strd r6, r7, [rp, #16]!
+ sub n, n, #4
+ umlal w1, r5, u1, v0 C 0 1
+ tst n, n
+ bpl L(top)
+
+L(end): adcs r4, r4, w1
+ str r4, [rp, #8]
+ adc r0, r5, #0
+ sub r0, v0, r0
+ pop { r4-r11 }
+ bx r14
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/v7a/cora9/gmp-mparam.h b/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/v7a/cora9/gmp-mparam.h
new file mode 100644
index 00000000000..96602578200
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/arm/v7a/cora9/gmp-mparam.h
@@ -0,0 +1,209 @@
+/* gmp-mparam.h -- Compiler/machine parameter header file.
+
+Copyright 1991, 1993, 1994, 1999-2003, 2009, 2010, 2012-2014 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
+
+/* 1000MHz Cortex-A9 */
+/* FFT tuning limit = 25000000 */
+/* Generated by tuneup.c, 2014-03-12, gcc 4.6 */
+
+#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 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
+#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 20
+
+#define MUL_TOOM22_THRESHOLD 45
+#define MUL_TOOM33_THRESHOLD 129
+#define MUL_TOOM44_THRESHOLD 387
+#define MUL_TOOM6H_THRESHOLD 517
+#define MUL_TOOM8H_THRESHOLD 774
+
+#define MUL_TOOM32_TO_TOOM43_THRESHOLD 137
+#define MUL_TOOM32_TO_TOOM53_THRESHOLD 222
+#define MUL_TOOM42_TO_TOOM53_THRESHOLD 137
+#define MUL_TOOM42_TO_TOOM63_THRESHOLD 235
+#define MUL_TOOM43_TO_TOOM54_THRESHOLD 208
+
+#define SQR_BASECASE_THRESHOLD 0 /* always (native) */
+#define SQR_TOOM2_THRESHOLD 54
+#define SQR_TOOM3_THRESHOLD 181
+#define SQR_TOOM4_THRESHOLD 490
+#define SQR_TOOM6_THRESHOLD 656
+#define SQR_TOOM8_THRESHOLD 0 /* always */
+
+#define MULMID_TOOM42_THRESHOLD 64
+
+#define MULMOD_BNM1_THRESHOLD 26
+#define SQRMOD_BNM1_THRESHOLD 28
+
+#define MUL_FFT_MODF_THRESHOLD 624 /* k = 5 */
+#define MUL_FFT_TABLE3 \
+ { { 624, 5}, { 28, 6}, { 15, 5}, { 34, 6}, \
+ { 18, 5}, { 37, 6}, { 28, 7}, { 15, 6}, \
+ { 36, 7}, { 19, 6}, { 40, 7}, { 21, 6}, \
+ { 43, 7}, { 23, 6}, { 47, 7}, { 25, 6}, \
+ { 51, 7}, { 27, 6}, { 55, 7}, { 29, 8}, \
+ { 15, 7}, { 31, 6}, { 63, 7}, { 37, 8}, \
+ { 19, 7}, { 43, 8}, { 23, 7}, { 51, 8}, \
+ { 27, 7}, { 57, 9}, { 15, 8}, { 31, 7}, \
+ { 65, 8}, { 35, 7}, { 71, 8}, { 43, 9}, \
+ { 23, 8}, { 55,10}, { 15, 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}, { 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,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}, { 575, 9}, \
+ { 1151,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}, { 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}, { 1535,12}, { 831,11}, \
+ { 1663,12}, { 959,14}, { 255,13}, { 511,12}, \
+ { 1023,11}, { 2047,12}, { 1215,13}, { 639,12}, \
+ { 1407,13}, { 767,12}, { 1663,13}, { 895,12}, \
+ { 1791,14}, { 511,13}, { 1023,12}, { 2111,13}, \
+ { 1151,12}, { 2431,13}, { 1279,12}, { 2559,13}, \
+ { 1407,14}, { 767,13}, { 1535,12}, { 3071,13}, \
+ { 1663,12}, { 3455,13}, { 1791,15}, { 511,14}, \
+ { 1023,13}, { 2047,12}, { 4095,13}, { 2175,12}, \
+ { 4351,13}, { 2431,14}, { 1279,13}, { 2559,12}, \
+ { 5119,13}, { 2815,14}, { 16384,15}, { 32768,16} }
+#define MUL_FFT_TABLE3_SIZE 160
+#define MUL_FFT_THRESHOLD 6784
+
+#define SQR_FFT_MODF_THRESHOLD 560 /* k = 5 */
+#define SQR_FFT_TABLE3 \
+ { { 560, 5}, { 19, 4}, { 39, 5}, { 21, 4}, \
+ { 43, 5}, { 29, 6}, { 15, 5}, { 33, 6}, \
+ { 17, 5}, { 35, 6}, { 36, 7}, { 19, 6}, \
+ { 40, 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}, \
+ { 65, 8}, { 35, 7}, { 71, 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}, { 159,10}, { 95, 9}, { 191,10}, \
+ { 111,11}, { 63,10}, { 159,11}, { 95,10}, \
+ { 191, 9}, { 383,10}, { 207,12}, { 63,11}, \
+ { 127,10}, { 255, 9}, { 511, 8}, { 1023, 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, 9}, { 831,11}, { 223,12}, \
+ { 127,11}, { 255,10}, { 511, 9}, { 1023,10}, \
+ { 543,11}, { 287,10}, { 575, 9}, { 1151,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}, { 575,10}, \
+ { 1151,11}, { 607,12}, { 319,11}, { 671,10}, \
+ { 1343,11}, { 735,12}, { 383,11}, { 863,12}, \
+ { 447,11}, { 959,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}, { 895,11}, \
+ { 1791,12}, { 959,13}, { 511,12}, { 1023,11}, \
+ { 2047,12}, { 1215,13}, { 639,12}, { 1407,13}, \
+ { 767,12}, { 1663,13}, { 895,12}, { 1791,14}, \
+ { 511,13}, { 1023,12}, { 2111,13}, { 1151,12}, \
+ { 2431,13}, { 1279,12}, { 2559,13}, { 1407,14}, \
+ { 767,13}, { 1535,12}, { 3071,13}, { 1663,12}, \
+ { 3455,13}, { 1791,15}, { 511,14}, { 1023,13}, \
+ { 2047,12}, { 4095,13}, { 2175,12}, { 4351,13}, \
+ { 2431,14}, { 1279,13}, { 2559,12}, { 5119,13}, \
+ { 2815,14}, { 16384,15}, { 32768,16} }
+#define SQR_FFT_TABLE3_SIZE 167
+#define SQR_FFT_THRESHOLD 5312
+
+#define MULLO_BASECASE_THRESHOLD 0 /* always */
+#define MULLO_DC_THRESHOLD 38
+#define MULLO_MUL_N_THRESHOLD 13463
+
+#define DC_DIV_QR_THRESHOLD 42
+#define DC_DIVAPPR_Q_THRESHOLD 100
+#define DC_BDIV_QR_THRESHOLD 43
+#define DC_BDIV_Q_THRESHOLD 104
+
+#define INV_MULMOD_BNM1_THRESHOLD 98
+#define INV_NEWTON_THRESHOLD 138
+#define INV_APPR_THRESHOLD 133
+
+#define BINV_NEWTON_THRESHOLD 333
+#define REDC_1_TO_REDC_2_THRESHOLD 2
+#define REDC_2_TO_REDC_N_THRESHOLD 142
+
+#define MU_DIV_QR_THRESHOLD 2350
+#define MU_DIVAPPR_Q_THRESHOLD 2259
+#define MUPI_DIV_QR_THRESHOLD 70
+#define MU_BDIV_QR_THRESHOLD 2089
+#define MU_BDIV_Q_THRESHOLD 2172
+
+#define POWM_SEC_TABLE 37,48,81,615,1925
+
+#define MATRIX22_STRASSEN_THRESHOLD 22
+#define HGCD_THRESHOLD 64
+#define HGCD_APPR_THRESHOLD 50
+#define HGCD_REDUCE_THRESHOLD 4284
+#define GCD_DC_THRESHOLD 416
+#define GCDEXT_DC_THRESHOLD 298
+#define JACOBI_BASE_METHOD 4
+
+#define GET_STR_DC_THRESHOLD 18
+#define GET_STR_PRECOMPUTE_THRESHOLD 33
+#define SET_STR_DC_THRESHOLD 140
+#define SET_STR_PRECOMPUTE_THRESHOLD 748
+
+#define FAC_DSC_THRESHOLD 309
+#define FAC_ODD_THRESHOLD 29
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/arm64/aors_n.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/arm64/aors_n.asm
new file mode 100644
index 00000000000..a880cd35cfd
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/arm64/aors_n.asm
@@ -0,0 +1,98 @@
+dnl ARM64 mpn_add_n and mpn_sub_n
+
+dnl Contributed to the GNU project by Torbjörn Granlund.
+
+dnl Copyright 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/limb
+C Cortex-A53 ?
+C Cortex-A57 ?
+
+changecom(@&*$)
+
+define(`rp', `x0')
+define(`up', `x1')
+define(`vp', `x2')
+define(`n', `x3')
+
+ifdef(`OPERATION_add_n', `
+ 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(`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(`func_nc', mpn_sub_nc)')
+
+MULFUNC_PROLOGUE(mpn_add_n mpn_add_nc mpn_sub_n mpn_sub_nc)
+
+ASM_START()
+PROLOGUE(func_nc)
+ SETCY( x4)
+ b L(ent)
+EPILOGUE()
+PROLOGUE(func)
+ CLRCY
+L(ent): tbz n, #0, L(b0)
+
+ 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(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(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(end): stp x8, x9, [rp]
+L(rt): RETVAL
+ ret
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/arm64/aorsmul_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/arm64/aorsmul_1.asm
new file mode 100644
index 00000000000..bf765a7f773
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/arm64/aorsmul_1.asm
@@ -0,0 +1,122 @@
+dnl ARM64 mpn_submul_1
+
+dnl Contributed to the GNU project by Torbjörn Granlund.
+
+dnl Copyright 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/limb
+C Cortex-A53 ?
+C Cortex-A57 ?
+
+changecom(@&*$)
+
+define(`rp', `x0')
+define(`up', `x1')
+define(`n', `x2')
+define(`v0', `x3')
+
+ifdef(`OPERATION_addmul_1', `
+ define(`ADDSUB', adds)
+ define(`ADDSUBC', adcs)
+ define(`COND', `cc')
+ define(`func', mpn_addmul_1)')
+ifdef(`OPERATION_submul_1', `
+ define(`ADDSUB', subs)
+ define(`ADDSUBC', sbcs)
+ define(`COND', `cs')
+ define(`func', mpn_submul_1)')
+
+MULFUNC_PROLOGUE(mpn_addmul_1 mpn_submul_1)
+
+PROLOGUE(func)
+ mov x15, #0
+
+ tbz n, #0, L(1)
+
+ ldr x4, [up],#8
+ mul x8, x4, v0
+ umulh x12, x4, v0
+ adds x8, x8, x15
+ ldr x4, [rp,#0]
+ ADDSUB x8, x4, x8
+ csinc x15, x12, x12, COND
+ str x8, [rp],#8
+
+L(1): tbz n, #1, L(2)
+
+ ldp x4, x5, [up],#16
+ mul x8, x4, v0
+ umulh x12, x4, v0
+ mul x9, x5, v0
+ umulh x13, x5, v0
+ adds x8, x8, x15
+ adcs x9, x9, x12
+ ldp x4, x5, [rp,#0]
+ adc x15, x13, xzr
+ sub n, n, #1
+ ADDSUB x8, x4, x8
+ ADDSUBC x9, x5, x9
+ csinc x15, x15, x15, COND
+ stp x8, x9, [rp],#16
+
+L(2): lsr n, n, 2
+ cbz n, L(end)
+
+L(top): ldp x4, x5, [up],#16
+ ldp x6, x7, [up],#16
+ mul x8, x4, v0
+ umulh x12, x4, v0
+ mul x9, x5, v0
+ umulh x13, x5, v0
+ adds x8, x8, x15
+ mul x10, x6, v0
+ umulh x14, x6, v0
+ adcs x9, x9, x12
+ mul x11, x7, v0
+ umulh x15, x7, v0
+ adcs x10, x10, x13
+ ldp x4, x5, [rp,#0]
+ adcs x11, x11, x14
+ ldp x6, x7, [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
+ ret
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/arm64/cnd_aors_n.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/arm64/cnd_aors_n.asm
new file mode 100644
index 00000000000..e7836500d5e
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/arm64/cnd_aors_n.asm
@@ -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 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 ?
+C Cortex-A57 ?
+
+changecom(@&*$)
+
+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', `adc x0, xzr, xzr')
+ define(func, mpn_cnd_add_n)')
+ifdef(`OPERATION_cnd_sub_n', `
+ define(`ADDSUBC', sbcs)
+ define(`CLRCY', `cmp xzr, xzr')
+ define(`RETVAL', `sbc x0, xzr, xzr
+ and x0, x0, #1')
+ 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()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/arm64/copyd.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/arm64/copyd.asm
new file mode 100644
index 00000000000..bb477716e5b
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/arm64/copyd.asm
@@ -0,0 +1,93 @@
+dnl ARM64 mpn_copyd.
+
+dnl Copyright 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/limb
+C Cortex-A53 ?
+C Cortex-A57 ?
+
+changecom(@&*$)
+
+define(`rp', `x0')
+define(`up', `x1')
+define(`n', `x2')
+
+ASM_START()
+PROLOGUE(mpn_copyd)
+ add rp, rp, n, lsl #3
+ add up, up, n, lsl #3
+
+ cmp n, #3
+ b.le L(bc)
+
+C Copy until rp is 128-bit aligned
+ tbz rp, #3, L(al2)
+ sub up, up, #8
+ ld1 {v22.1d}, [up]
+ sub n, n, #1
+ sub rp, rp, #8
+ st1 {v22.1d}, [rp]
+
+L(al2): sub up, up, #16
+ ld1 {v26.2d}, [up]
+ subs n, n, #6
+ sub rp, rp, #16 C offset rp for loop
+ b.lt L(end)
+
+ sub up, up, #16 C offset up for loop
+ mov x12, #-16
+
+ ALIGN(16)
+L(top): ld1 {v22.2d}, [up], x12
+ st1 {v26.2d}, [rp], x12
+ ld1 {v26.2d}, [up], x12
+ st1 {v22.2d}, [rp], x12
+ subs n, n, #4
+ b.ge L(top)
+
+ add up, up, #16 C undo up offset
+
+L(end): st1 {v26.2d}, [rp]
+
+C Copy last 0-3 limbs. Note that rp is aligned after loop, but not when we
+C arrive here via L(bc)
+L(bc): tbz n, #1, L(tl1)
+ sub up, up, #16
+ ld1 {v22.2d}, [up]
+ sub rp, rp, #16
+ st1 {v22.2d}, [rp]
+L(tl1): tbz n, #0, L(tl2)
+ sub up, up, #8
+ ld1 {v22.1d}, [up]
+ sub rp, rp, #8
+ st1 {v22.1d}, [rp]
+L(tl2): ret
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/arm64/copyi.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/arm64/copyi.asm
new file mode 100644
index 00000000000..8f7dbd4f520
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/arm64/copyi.asm
@@ -0,0 +1,77 @@
+dnl ARM64 mpn_copyi.
+
+dnl Copyright 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/limb
+C Cortex-A53 ?
+C Cortex-A57 ?
+
+changecom(@&*$)
+
+define(`rp', `x0')
+define(`up', `x1')
+define(`n', `x2')
+
+ASM_START()
+PROLOGUE(mpn_copyi)
+ cmp n, #3
+ b.le L(bc)
+
+C Copy until rp is 128-bit aligned
+ tbz rp, #3, L(al2)
+ ld1 {v22.1d}, [up], #8
+ sub n, n, #1
+ st1 {v22.1d}, [rp], #8
+
+L(al2): ld1 {v26.2d}, [up], #16
+ subs n, n, #6
+ b.lt L(end)
+
+ ALIGN(16)
+L(top): ld1 {v22.2d}, [up], #16
+ st1 {v26.2d}, [rp], #16
+ ld1 {v26.2d}, [up], #16
+ st1 {v22.2d}, [rp], #16
+ subs n, n, #4
+ b.ge L(top)
+
+L(end): st1 {v26.2d}, [rp], #16
+
+C Copy last 0-3 limbs. Note that rp is aligned after loop, but not when we
+C arrive here via L(bc)
+L(bc): tbz n, #1, L(tl1)
+ ld1 {v22.2d}, [up], #16
+ st1 {v22.2d}, [rp], #16
+L(tl1): tbz n, #0, L(tl2)
+ ld1 {v22.1d}, [up]
+ st1 {v22.1d}, [rp]
+L(tl2): ret
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/arm64/gcd_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/arm64/gcd_1.asm
new file mode 100644
index 00000000000..d231dbcbb94
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/arm64/gcd_1.asm
@@ -0,0 +1,125 @@
+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
+ bne 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
+ bhi 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
+ blo L(bmod)
+
+ bl mpn_mod_1
+
+L(red0):mov x3, x0
+L(red1):cmp x3, #0
+ rbit x12, x3
+ clz x12, x12
+ bne 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
+ bne L(top) C
+
+L(end): lsl x0, x19, x20
+ ldp x19, x20, [sp,#16]
+ ldp x29, x30, [sp],#32
+ ret
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/arm64/invert_limb.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/arm64/invert_limb.asm
new file mode 100644
index 00000000000..2302d047e58
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/arm64/invert_limb.asm
@@ -0,0 +1,83 @@
+dnl ARM64 mpn_invert_limb -- Invert a normalized limb.
+
+dnl Contributed to the GNU project by Torbjörn Granlund.
+
+dnl Copyright 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/limb
+C Cortex-A53 ?
+C Cortex-A57 ?
+
+C Compiler generated, mildly edited. Could surely be further optimised.
+
+ASM_START()
+PROLOGUE(mpn_invert_limb)
+ lsr x2, x0, 54
+ adrp x1, approx_tab
+ and x2, x2, #0x1fe
+ add x1, x1, :lo12:approx_tab
+ ldrh w3, [x1,x2]
+ lsr x4, x0, 24
+ add x4, x4, 1
+ ubfiz x2, x3, 11, 16
+ umull x3, w3, w3
+ mul x3, x3, x4
+ sub x2, x2, #1
+ sub x2, x2, x3, lsr 40
+ lsl x3, x2, 60
+ mul x1, x2, x2
+ msub x1, x1, x4, x3
+ lsl x2, x2, 13
+ add x1, x2, x1, lsr 47
+ and x2, x0, 1
+ neg x3, x2
+ and x3, x3, x1, lsr 1
+ add x2, x2, x0, lsr 1
+ msub x2, x1, x2, x3
+ umulh x2, x2, x1
+ lsl x1, x1, 31
+ add x1, x1, x2, lsr 1
+ mul x3, x1, x0
+ umulh x2, x1, x0
+ adds x4, x3, x0
+ adc x0, x2, x0
+ sub x0, x1, x0
+ ret
+EPILOGUE()
+
+ RODATA
+ ALIGN(2)
+ TYPE( approx_tab, object)
+ SIZE( approx_tab, 512)
+approx_tab:
+forloop(i,256,512-1,dnl
+` .hword eval(0x7fd00/i)
+')dnl
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/arm64/logops_n.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/arm64/logops_n.asm
new file mode 100644
index 00000000000..0f75700cfd5
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/arm64/logops_n.asm
@@ -0,0 +1,106 @@
+dnl ARM64 mpn_and_n, mpn_andn_n. mpn_nand_n, etc.
+
+dnl Contributed to the GNU project by Torbjörn Granlund.
+
+dnl Copyright 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/limb
+C Cortex-A53 ?
+C Cortex-A57 ?
+
+changecom(@&*$)
+
+define(`rp', `x0')
+define(`up', `x1')
+define(`vp', `x2')
+define(`n', `x3')
+
+define(`POSTOP', `dnl')
+
+ifdef(`OPERATION_and_n',`
+ define(`func', `mpn_and_n')
+ define(`LOGOP', `and $1, $2, $3')')
+ifdef(`OPERATION_andn_n',`
+ define(`func', `mpn_andn_n')
+ define(`LOGOP', `bic $1, $2, $3')')
+ifdef(`OPERATION_nand_n',`
+ define(`func', `mpn_nand_n')
+ define(`POSTOP', `mvn $1, $1')
+ define(`LOGOP', `and $1, $2, $3')')
+ifdef(`OPERATION_ior_n',`
+ define(`func', `mpn_ior_n')
+ define(`LOGOP', `orr $1, $2, $3')')
+ifdef(`OPERATION_iorn_n',`
+ define(`func', `mpn_iorn_n')
+ define(`LOGOP', `orn $1, $2, $3')')
+ifdef(`OPERATION_nior_n',`
+ define(`func', `mpn_nior_n')
+ define(`POSTOP', `mvn $1, $1')
+ define(`LOGOP', `orr $1, $2, $3')')
+ifdef(`OPERATION_xor_n',`
+ define(`func', `mpn_xor_n')
+ define(`LOGOP', `eor $1, $2, $3')')
+ifdef(`OPERATION_xnor_n',`
+ define(`func', `mpn_xnor_n')
+ define(`LOGOP', `eon $1, $2, $3')')
+
+MULFUNC_PROLOGUE(mpn_and_n mpn_andn_n mpn_nand_n mpn_ior_n mpn_iorn_n mpn_nior_n mpn_xor_n mpn_xnor_n)
+
+ASM_START()
+PROLOGUE(func)
+ tbz n, #0, L(b0)
+
+ 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(b0): ldp x4, x5, [up],#16
+ ldp x6, x7, [vp],#16
+ sub n, n, #2
+ 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)
+
+ stp x8, x9, [rp],#16
+L(rtn): ret
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/arm64/mul_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/arm64/mul_1.asm
new file mode 100644
index 00000000000..c0c2570f0d8
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/arm64/mul_1.asm
@@ -0,0 +1,98 @@
+dnl ARM64 mpn_mul_1
+
+dnl Contributed to the GNU project by Torbjörn Granlund.
+
+dnl Copyright 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/limb
+C Cortex-A53 ?
+C Cortex-A57 ?
+
+define(`rp', `x0')
+define(`up', `x1')
+define(`n', `x2')
+define(`v0', `x3')
+
+ASM_START()
+PROLOGUE(mpn_mul_1)
+ ldr x12, [up], #8
+ and x6, n, #3
+ and n, n, #-4
+ cbz x6, L(fi0)
+ cmp x6, #2
+ bcc L(fi1)
+ beq L(fi2)
+
+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(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(end): str x10, [rp]
+ adc x0, x13, xzr
+ ret
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/asm-defs.m4 b/Build/source/libs/gmp/gmp-6.0.0/mpn/asm-defs.m4
new file mode 100644
index 00000000000..e573cc4ca82
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/asm-defs.m4
@@ -0,0 +1,1761 @@
+divert(-1)
+dnl
+dnl m4 macros for gmp assembly code, shared by all CPUs.
+
+dnl Copyright 1999-2006, 2011 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 These macros are designed for use with any m4 and have been used on
+dnl GNU, FreeBSD, NetBSD, OpenBSD and SysV.
+dnl
+dnl GNU m4 and OpenBSD 2.7 m4 will give filenames and line numbers in error
+dnl messages.
+dnl
+dnl
+dnl Macros:
+dnl
+dnl Most new m4 specific macros have an "m4_" prefix to emphasise they're
+dnl m4 expansions. But new defining things like deflit() and defreg() are
+dnl named like the builtin define(), and forloop() is named following the
+dnl GNU m4 example on which it's based.
+dnl
+dnl GNU m4 with the -P option uses "m4_" as a prefix for builtins, but that
+dnl option isn't going to be used, so there's no conflict or confusion.
+dnl
+dnl
+dnl Comments in output:
+dnl
+dnl The m4 comment delimiters are left at # and \n, the normal assembler
+dnl commenting for most CPUs. m4 passes comment text through without
+dnl expanding macros in it, which is generally a good thing since it stops
+dnl unexpected expansions and possible resultant errors.
+dnl
+dnl But note that when a quoted string is being read, a # isn't special, so
+dnl apostrophes in comments in quoted strings must be avoided or they'll be
+dnl interpreted as a closing quote mark. But when the quoted text is
+dnl re-read # will still act like a normal comment, suppressing macro
+dnl expansion.
+dnl
+dnl For example,
+dnl
+dnl # apostrophes in comments that're outside quotes are ok
+dnl # and using macro names like PROLOGUE is ok too
+dnl ...
+dnl ifdef(`PIC',`
+dnl # but apostrophes aren't ok inside quotes
+dnl # ^--wrong
+dnl ...
+dnl # though macro names like PROLOGUE are still ok
+dnl ...
+dnl ')
+dnl
+dnl If macro expansion in a comment is wanted, use `#' in the .asm (ie. a
+dnl quoted hash symbol), which will turn into # in the .s but get
+dnl expansions done on that line. This can make the .s more readable to
+dnl humans, but it won't make a blind bit of difference to the assembler.
+dnl
+dnl All the above applies, mutatis mutandis, when changecom() is used to
+dnl select @ ! ; or whatever other commenting.
+dnl
+dnl
+dnl Variations in m4 affecting gmp:
+dnl
+dnl $# - When a macro is called as "foo" with no brackets, BSD m4 sets $#
+dnl to 1, whereas GNU or SysV m4 set it to 0. In all cases though
+dnl "foo()" sets $# to 1. This is worked around in various places.
+dnl
+dnl len() - When "len()" is given an empty argument, BSD m4 evaluates to
+dnl nothing, whereas GNU, SysV, and the new OpenBSD, evaluate to 0.
+dnl See m4_length() below which works around this.
+dnl
+dnl translit() - GNU m4 accepts character ranges like A-Z, and the new
+dnl OpenBSD m4 does under option -g, but basic BSD and SysV don't.
+dnl
+dnl popdef() - in BSD and SysV m4 popdef() takes multiple arguments and
+dnl pops each, but GNU m4 only takes one argument.
+dnl
+dnl push back - BSD m4 has some limits on the amount of text that can be
+dnl pushed back. The limit is reasonably big and so long as macros
+dnl don't gratuitously duplicate big arguments it isn't a problem.
+dnl Normally an error message is given, but sometimes it just hangs.
+dnl
+dnl eval() &,|,^ - GNU and SysV m4 have bitwise operators &,|,^ available,
+dnl but BSD m4 doesn't (contrary to what the man page suggests) and
+dnl instead ^ is exponentiation.
+dnl
+dnl eval() ?: - The C ternary operator "?:" is available in BSD m4, but not
+dnl in SysV or GNU m4 (as of GNU m4 1.4 and betas of 1.5).
+dnl
+dnl eval() -2^31 - BSD m4 has a bug where an eval() resulting in -2^31
+dnl (ie. -2147483648) gives "-(". Using -2147483648 within an
+dnl expression is ok, it just can't be a final result. "-(" will of
+dnl course upset parsing, with all sorts of strange effects.
+dnl
+dnl eval() <<,>> - SysV m4 doesn't support shift operators in eval() (on
+dnl Solaris 7 /usr/xpg4/m4 has them but /usr/ccs/m4 doesn't). See
+dnl m4_lshift() and m4_rshift() below for workarounds.
+dnl
+dnl ifdef() - OSF 4.0 m4 considers a macro defined to a zero value `0' or
+dnl `00' etc as not defined. See m4_ifdef below for a workaround.
+dnl
+dnl m4wrap() sequence - in BSD m4, m4wrap() replaces any previous m4wrap()
+dnl string, in SysV m4 it appends to it, and in GNU m4 it prepends.
+dnl See m4wrap_prepend() below which brings uniformity to this.
+dnl
+dnl m4wrap() 0xFF - old versions of BSD m4 store EOF in a C "char" under an
+dnl m4wrap() and on systems where char is unsigned by default a
+dnl spurious 0xFF is output. This has been observed on recent Cray
+dnl Unicos Alpha, Apple MacOS X, and HPUX 11 systems. An autoconf
+dnl test is used to check for this, see the m4wrap handling below. It
+dnl might work to end the m4wrap string with a dnl to consume the
+dnl 0xFF, but that probably induces the offending m4's to read from an
+dnl already closed "FILE *", which could be bad on a glibc style
+dnl stdio.
+dnl
+dnl __file__,__line__ - GNU m4 and OpenBSD 2.7 m4 provide these, and
+dnl they're used here to make error messages more informative. GNU m4
+dnl gives an unhelpful "NONE 0" in an m4wrap(), but that's worked
+dnl around.
+dnl
+dnl __file__ quoting - OpenBSD m4, unlike GNU m4, doesn't quote the
+dnl filename in __file__, so care should be taken that no macro has
+dnl the same name as a file, or an unwanted expansion will occur when
+dnl printing an error or warning.
+dnl
+dnl changecom() - BSD m4 changecom doesn't quite work like the man page
+dnl suggests, in particular "changecom" or "changecom()" doesn't
+dnl disable the comment feature, and multi-character comment sequences
+dnl don't seem to work. If the default `#' and newline aren't
+dnl suitable it's necessary to change it to something else,
+dnl eg. changecom(;).
+dnl
+dnl OpenBSD 2.6 m4 - in this m4, eval() rejects decimal constants containing
+dnl an 8 or 9, making it pretty much unusable. The bug is confined to
+dnl version 2.6 (it's not in 2.5, and was fixed in 2.7).
+dnl
+dnl SunOS /usr/bin/m4 - this m4 lacks a number of desired features,
+dnl including $# and $@, defn(), m4exit(), m4wrap(), pushdef(),
+dnl popdef(). /usr/5bin/m4 is a SysV style m4 which should always be
+dnl available, and "configure" will reject /usr/bin/m4 in favour of
+dnl /usr/5bin/m4 (if necessary).
+dnl
+dnl The sparc code actually has modest m4 requirements currently and
+dnl could manage with /usr/bin/m4, but there's no reason to put our
+dnl macros through contortions when /usr/5bin/m4 is available or GNU
+dnl m4 can be installed.
+
+
+ifdef(`__ASM_DEFS_M4_INCLUDED__',
+`m4_error(`asm-defs.m4 already included, dont include it twice
+')m4exit(1)')
+define(`__ASM_DEFS_M4_INCLUDED__')
+
+
+dnl Detect and give a message about the unsuitable OpenBSD 2.6 m4.
+
+ifelse(eval(89),89,,
+`errprint(
+`This m4 doesnt accept 8 and/or 9 in constants in eval(), making it unusable.
+This is probably OpenBSD 2.6 m4 (September 1999). Upgrade to OpenBSD 2.7,
+or get a bug fix from the CVS (expr.c rev 1.9), or get GNU m4. Dont forget
+to configure with M4=/wherever/m4 if you install one of these in a directory
+not in $PATH.
+')m4exit(1)')
+
+
+dnl Detect and give a message about the unsuitable SunOS /usr/bin/m4.
+dnl
+dnl Unfortunately this test doesn't work when m4 is run in the normal way
+dnl from mpn/Makefile with "m4 -DOPERATION_foo foo.asm", since the bad m4
+dnl takes "-" in "-D..." to mean read stdin, so it will look like it just
+dnl hangs. But running "m4 asm-defs.m4" to try it out will work.
+dnl
+dnl We'd like to abort immediately on finding a problem, but unfortunately
+dnl the bad m4 doesn't have an m4exit(), nor does an invalid eval() kill
+dnl it. Unexpanded $#'s in some m4_assert_numargs() later on will comment
+dnl out some closing parentheses and kill it with "m4: arg stack overflow".
+
+define(m4_dollarhash_works_test,``$#'')
+ifelse(m4_dollarhash_works_test(x),1,,
+`errprint(
+`This m4 doesnt support $# and cant be used for GMP asm processing.
+If this is on SunOS, ./configure should choose /usr/5bin/m4 if you have that
+or can get it, otherwise install GNU m4. Dont forget to configure with
+M4=/wherever/m4 if you install in a directory not in $PATH.
+')')
+undefine(`m4_dollarhash_works_test')
+
+
+dnl --------------------------------------------------------------------------
+dnl Basic error handling things.
+
+
+dnl Usage: m4_dollarhash_1_if_noparen_p
+dnl
+dnl Expand to 1 if a call "foo" gives $# set to 1 (as opposed to 0 like GNU
+dnl and SysV m4 give).
+
+define(m4_dollarhash_1_if_noparen_test,`$#')
+define(m4_dollarhash_1_if_noparen_p,
+eval(m4_dollarhash_1_if_noparen_test==1))
+undefine(`m4_dollarhash_1_if_noparen_test')
+
+
+dnl Usage: m4wrap_prepend(string)
+dnl
+dnl Prepend the given string to what will be expanded under m4wrap at the
+dnl end of input.
+dnl
+dnl This macro exists to work around variations in m4wrap() behaviour in
+dnl the various m4s (notes at the start of this file). Don't use m4wrap()
+dnl directly since it will interfere with this scheme.
+
+define(m4wrap_prepend,
+m4_assert_numargs(1)
+`define(`m4wrap_string',`$1'defn(`m4wrap_string'))')
+
+define(m4wrap_string,`')
+
+define(m4wrap_works_p,
+`ifelse(M4WRAP_SPURIOUS,yes,0,1)')
+
+ifelse(m4wrap_works_p,1,
+`m4wrap(`m4wrap_string')')
+
+
+dnl Usage: m4_file_and_line
+dnl
+dnl Expand to the current file and line number, if the GNU m4 extensions
+dnl __file__ and __line__ are available.
+dnl
+dnl In GNU m4 1.4 at the end of input when m4wrap text is expanded,
+dnl __file__ is NONE and __line__ is 0, which is not a helpful thing to
+dnl print. If m4_file_seen() has been called to note the last file seen,
+dnl then that file at a big line number is used, otherwise "end of input"
+dnl is used (although "end of input" won't parse as an error message).
+
+define(m4_file_and_line,
+`ifdef(`__file__',
+`ifelse(__file__`'__line__,`NONE0',
+`ifdef(`m4_file_seen_last',`m4_file_seen_last: 999999: ',`end of input: ')',
+`__file__: __line__: ')')')
+
+
+dnl Usage: m4_errprint_commas(arg,...)
+dnl
+dnl The same as errprint(), but commas are printed between arguments
+dnl instead of spaces.
+
+define(m4_errprint_commas,
+`errprint(`$1')dnl
+ifelse(eval($#>1),1,`errprint(`,')m4_errprint_commas(shift($@))')')
+
+
+dnl Usage: m4_error(args...)
+dnl m4_warning(args...)
+dnl
+dnl Print an error message, using m4_errprint_commas, prefixed with the
+dnl current filename and line number (if available). m4_error sets up to
+dnl give an error exit at the end of processing, m4_warning just prints.
+dnl These macros are the recommended way to print errors.
+dnl
+dnl The arguments here should be quoted in the usual way to prevent them
+dnl being expanded when the macro call is read. (m4_error takes care not
+dnl to do any further expansion.)
+dnl
+dnl For example,
+dnl
+dnl m4_error(`some error message
+dnl ')
+dnl
+dnl which prints
+dnl
+dnl foo.asm:123: some error message
+dnl
+dnl or if __file__ and __line__ aren't available
+dnl
+dnl some error message
+dnl
+dnl The "file:line:" format is a basic style, used by gcc and GNU m4, so
+dnl emacs and other editors will recognise it in their normal error message
+dnl parsing.
+
+define(m4_warning,
+`m4_errprint_commas(m4_file_and_line`'$@)')
+
+define(m4_error,
+`define(`m4_error_occurred',1)m4_warning($@)dnl
+ifelse(m4wrap_works_p,0,`m4exit(1)')')
+
+define(`m4_error_occurred',0)
+
+dnl This m4wrap_prepend() is first, so it'll be executed last.
+m4wrap_prepend(
+`ifelse(m4_error_occurred,1,
+`m4_error(`Errors occurred during m4 processing
+')m4exit(1)')')
+
+
+dnl Usage: m4_assert_numargs(num)
+dnl
+dnl Put this unquoted on a line on its own at the start of a macro
+dnl definition to add some code to check that num many arguments get passed
+dnl to the macro. For example,
+dnl
+dnl define(foo,
+dnl m4_assert_numargs(2)
+dnl `something `$1' and `$2' blah blah')
+dnl
+dnl Then a call like foo(one,two,three) will provoke an error like
+dnl
+dnl file:10: foo expected 2 arguments, got 3 arguments
+dnl
+dnl Here are some calls and how many arguments they're interpreted as passing.
+dnl
+dnl foo(abc,def) 2
+dnl foo(xyz) 1
+dnl foo() 0
+dnl foo -1
+dnl
+dnl The -1 for no parentheses at all means a macro that's meant to be used
+dnl that way can be checked with m4_assert_numargs(-1). For example,
+dnl
+dnl define(SPECIAL_SUFFIX,
+dnl m4_assert_numargs(-1)
+dnl `ifdef(`FOO',`_foo',`_bar')')
+dnl
+dnl But as an alternative see also deflit() below where parenthesized
+dnl expressions following a macro are passed through to the output.
+dnl
+dnl Note that in BSD m4 there's no way to differentiate calls "foo" and
+dnl "foo()", so in BSD m4 the distinction between the two isn't enforced.
+dnl (In GNU and SysV m4 it can be checked, and is.)
+
+
+dnl m4_assert_numargs is able to check its own arguments by calling
+dnl assert_numargs_internal directly.
+dnl
+dnl m4_doublequote($`'0) expands to ``$0'', whereas ``$`'0'' would expand
+dnl to `$`'0' and do the wrong thing, and likewise for $1. The same is
+dnl done in other assert macros.
+dnl
+dnl $`#' leaves $# in the new macro being defined, and stops # being
+dnl interpreted as a comment character.
+dnl
+dnl `dnl ' means an explicit dnl isn't necessary when m4_assert_numargs is
+dnl used. The space means that if there is a dnl it'll still work.
+
+dnl Usage: m4_doublequote(x) expands to ``x''
+define(m4_doublequote,
+`m4_assert_numargs_internal(`$0',1,$#,len(`$1'))``$1''')
+
+define(m4_assert_numargs,
+`m4_assert_numargs_internal(`$0',1,$#,len(`$1'))dnl
+`m4_assert_numargs_internal'(m4_doublequote($`'0),$1,$`#',`len'(m4_doublequote($`'1)))`dnl '')
+
+dnl Called: m4_assert_numargs_internal(`macroname',wantargs,$#,len(`$1'))
+define(m4_assert_numargs_internal,
+`m4_assert_numargs_internal_check(`$1',`$2',m4_numargs_count(`$3',`$4'))')
+
+dnl Called: m4_assert_numargs_internal_check(`macroname',wantargs,gotargs)
+dnl
+dnl If m4_dollarhash_1_if_noparen_p (BSD m4) then gotargs can be 0 when it
+dnl should be -1. If wantargs is -1 but gotargs is 0 and the two can't be
+dnl distinguished then it's allowed to pass.
+dnl
+define(m4_assert_numargs_internal_check,
+`ifelse(eval($2 == $3
+ || ($2==-1 && $3==0 && m4_dollarhash_1_if_noparen_p)),0,
+`m4_error(`$1 expected 'm4_Narguments(`$2')`, got 'm4_Narguments(`$3')
+)')')
+
+dnl Called: m4_numargs_count($#,len(`$1'))
+dnl If $#==0 then -1 args, if $#==1 but len(`$1')==0 then 0 args, otherwise
+dnl $# args.
+define(m4_numargs_count,
+`ifelse($1,0, -1,
+`ifelse(eval($1==1 && $2-0==0),1, 0, $1)')')
+
+dnl Usage: m4_Narguments(N)
+dnl "$1 argument" or "$1 arguments" with the plural according to $1.
+define(m4_Narguments,
+`$1 argument`'ifelse(`$1',1,,s)')
+
+
+dnl --------------------------------------------------------------------------
+dnl Additional error checking things.
+
+
+dnl Usage: m4_file_seen()
+dnl
+dnl Record __file__ for the benefit of m4_file_and_line in m4wrap text.
+dnl
+dnl The basic __file__ macro comes out quoted in GNU m4, like `foo.asm',
+dnl and m4_file_seen_last is defined like that too.
+dnl
+dnl This is used by PROLOGUE, since that's normally in the main .asm file,
+dnl and in particular it sets up m4wrap error checks for missing EPILOGUE.
+
+define(m4_file_seen,
+m4_assert_numargs(0)
+`ifelse(__file__,`NONE',,
+`define(`m4_file_seen_last',m4_doublequote(__file__))')')
+
+
+dnl Usage: m4_assert_onearg()
+dnl
+dnl Put this, unquoted, at the start of a macro definition to add some code
+dnl to check that one argument is passed to the macro, but with that
+dnl argument allowed to be empty. For example,
+dnl
+dnl define(foo,
+dnl m4_assert_onearg()
+dnl `blah blah $1 blah blah')
+dnl
+dnl Calls "foo(xyz)" or "foo()" are accepted. A call "foo(xyz,abc)" fails.
+dnl A call "foo" fails too, but BSD m4 can't detect this case (GNU and SysV
+dnl m4 can).
+
+define(m4_assert_onearg,
+m4_assert_numargs(0)
+`m4_assert_onearg_internal'(m4_doublequote($`'0),$`#')`dnl ')
+
+dnl Called: m4_assert_onearg(`macroname',$#)
+define(m4_assert_onearg_internal,
+`ifelse($2,1,,
+`m4_error(`$1 expected 1 argument, got 'm4_Narguments(`$2')
+)')')
+
+
+dnl Usage: m4_assert_numargs_range(low,high)
+dnl
+dnl Put this, unquoted, at the start of a macro definition to add some code
+dnl to check that between low and high many arguments get passed to the
+dnl macro. For example,
+dnl
+dnl define(foo,
+dnl m4_assert_numargs_range(3,5)
+dnl `mandatory $1 $2 $3 optional $4 $5 end')
+dnl
+dnl See m4_assert_numargs() for more info.
+
+define(m4_assert_numargs_range,
+m4_assert_numargs(2)
+``m4_assert_numargs_range_internal'(m4_doublequote($`'0),$1,$2,$`#',`len'(m4_doublequote($`'1)))`dnl '')
+
+dnl Called: m4_assert_numargs_range_internal(`name',low,high,$#,len(`$1'))
+define(m4_assert_numargs_range_internal,
+m4_assert_numargs(5)
+`m4_assert_numargs_range_check(`$1',`$2',`$3',m4_numargs_count(`$4',`$5'))')
+
+dnl Called: m4_assert_numargs_range_check(`name',low,high,gotargs)
+dnl
+dnl If m4_dollarhash_1_if_noparen_p (BSD m4) then gotargs can be 0 when it
+dnl should be -1. To ensure a `high' of -1 works, a fudge is applied to
+dnl gotargs if it's 0 and the 0 and -1 cases can't be distinguished.
+dnl
+define(m4_assert_numargs_range_check,
+m4_assert_numargs(4)
+`ifelse(eval($2 <= $4 &&
+ ($4 - ($4==0 && m4_dollarhash_1_if_noparen_p) <= $3)),0,
+`m4_error(`$1 expected $2 to $3 arguments, got 'm4_Narguments(`$4')
+)')')
+
+
+dnl Usage: m4_assert_defined(symbol)
+dnl
+dnl Put this unquoted on a line of its own at the start of a macro
+dnl definition to add some code to check that the given symbol is defined
+dnl when the macro is used. For example,
+dnl
+dnl define(foo,
+dnl m4_assert_defined(`FOO_PREFIX')
+dnl `FOO_PREFIX whatever')
+dnl
+dnl This is a convenient way to check that the user or ./configure or
+dnl whatever has defined the things needed by a macro, as opposed to
+dnl silently generating garbage.
+
+define(m4_assert_defined,
+m4_assert_numargs(1)
+``m4_assert_defined_internal'(m4_doublequote($`'0),``$1'')`dnl '')
+
+dnl Called: m4_assert_defined_internal(`macroname',`define_required')
+define(m4_assert_defined_internal,
+m4_assert_numargs(2)
+`m4_ifdef(`$2',,
+`m4_error(`$1 needs $2 defined
+')')')
+
+
+dnl Usage: m4_not_for_expansion(`SYMBOL')
+dnl define_not_for_expansion(`SYMBOL')
+dnl
+dnl m4_not_for_expansion turns SYMBOL, if defined, into something which
+dnl will give an error if expanded. For example,
+dnl
+dnl m4_not_for_expansion(`PIC')
+dnl
+dnl define_not_for_expansion is the same, but always makes a definition.
+dnl
+dnl These are for symbols that should be tested with ifdef(`FOO',...)
+dnl rather than be expanded as such. They guard against accidentally
+dnl omitting the quotes, as in ifdef(FOO,...). Note though that they only
+dnl catches this when FOO is defined, so be sure to test code both with and
+dnl without each definition.
+
+define(m4_not_for_expansion,
+m4_assert_numargs(1)
+`ifdef(`$1',`define_not_for_expansion(`$1')')')
+
+define(define_not_for_expansion,
+m4_assert_numargs(1)
+`ifelse(defn(`$1'),,,
+`m4_error(``$1' has a non-empty value, maybe it shouldnt be munged with m4_not_for_expansion()
+')')dnl
+define(`$1',`m4_not_for_expansion_internal(`$1')')')
+
+define(m4_not_for_expansion_internal,
+`m4_error(``$1' is not meant to be expanded, perhaps you mean `ifdef(`$1',...)'
+')')
+
+
+dnl --------------------------------------------------------------------------
+dnl Various generic m4 things.
+
+
+dnl Usage: m4_unquote(macro)
+dnl
+dnl Allow the argument text to be re-evaluated. This is useful for "token
+dnl pasting" like m4_unquote(foo`'bar).
+
+define(m4_unquote,
+m4_assert_onearg()
+`$1')
+
+
+dnl Usage: m4_ifdef(name,yes[,no])
+dnl
+dnl Expand to the yes argument if name is defined, or to the no argument if
+dnl not.
+dnl
+dnl This is the same as the builtin "ifdef", but avoids an OSF 4.0 m4 bug
+dnl in which a macro with a zero value `0' or `00' etc is considered not
+dnl defined.
+dnl
+dnl There's no particular need to use this everywhere, only if there might
+dnl be a zero value.
+
+define(m4_ifdef,
+m4_assert_numargs_range(2,3)
+`ifelse(eval(ifdef(`$1',1,0)+m4_length(defn(`$1'))),0,
+`$3',`$2')')
+
+
+dnl Usage: m4_ifdef_anyof_p(`symbol',...)
+dnl
+dnl Expand to 1 if any of the symbols in the argument list are defined, or
+dnl to 0 if not.
+
+define(m4_ifdef_anyof_p,
+`ifelse(eval($#<=1 && m4_length(`$1')==0),1, 0,
+`ifdef(`$1', 1,
+`m4_ifdef_anyof_p(shift($@))')')')
+
+
+dnl Usage: m4_length(string)
+dnl
+dnl Determine the length of a string. This is the same as len(), but
+dnl always expands to a number, working around the BSD len() which
+dnl evaluates to nothing given an empty argument.
+
+define(m4_length,
+m4_assert_onearg()
+`eval(len(`$1')-0)')
+
+
+dnl Usage: m4_stringequal_p(x,y)
+dnl
+dnl Expand to 1 or 0 according as strings x and y are equal or not.
+
+define(m4_stringequal_p,
+`ifelse(`$1',`$2',1,0)')
+
+
+dnl Usage: m4_incr_or_decr(n,last)
+dnl
+dnl Do an incr(n) or decr(n), whichever is in the direction of "last".
+dnl Both n and last must be numbers of course.
+
+define(m4_incr_or_decr,
+m4_assert_numargs(2)
+`ifelse(eval($1<$2),1,incr($1),decr($1))')
+
+
+dnl Usage: forloop(i, first, last, statement)
+dnl
+dnl Based on GNU m4 examples/forloop.m4, but extended.
+dnl
+dnl statement is expanded repeatedly, with i successively defined as
+dnl
+dnl first, first+1, ..., last-1, last
+dnl
+dnl Or if first > last, then it's
+dnl
+dnl first, first-1, ..., last+1, last
+dnl
+dnl If first == last, then one expansion is done.
+dnl
+dnl A pushdef/popdef of i is done to preserve any previous definition (or
+dnl lack of definition). first and last are eval()ed and so can be
+dnl expressions.
+dnl
+dnl forloop_first is defined to 1 on the first iteration, 0 on the rest.
+dnl forloop_last is defined to 1 on the last iteration, 0 on the others.
+dnl Nested forloops are allowed, in which case forloop_first and
+dnl forloop_last apply to the innermost loop that's open.
+dnl
+dnl A simple example,
+dnl
+dnl forloop(i, 1, 2*2+1, `dnl
+dnl iteration number i ... ifelse(forloop_first,1,FIRST)
+dnl ')
+
+
+dnl "i" and "statement" are carefully quoted, but "first" and "last" are
+dnl just plain numbers once eval()ed.
+
+define(`forloop',
+m4_assert_numargs(4)
+`pushdef(`$1',eval(`$2'))dnl
+pushdef(`forloop_first',1)dnl
+pushdef(`forloop_last',0)dnl
+forloop_internal(`$1',eval(`$3'),`$4')`'dnl
+popdef(`forloop_first')dnl
+popdef(`forloop_last')dnl
+popdef(`$1')')
+
+dnl Called: forloop_internal(`var',last,statement)
+define(`forloop_internal',
+m4_assert_numargs(3)
+`ifelse($1,$2,
+`define(`forloop_last',1)$3',
+`$3`'dnl
+define(`forloop_first',0)dnl
+define(`$1',m4_incr_or_decr($1,$2))dnl
+forloop_internal(`$1',$2,`$3')')')
+
+
+dnl Usage: foreach(var,body, item1,item2,...,itemN)
+dnl
+dnl For each "item" argument, define "var" to that value and expand "body".
+dnl For example,
+dnl
+dnl foreach(i, `something i
+dnl ', one, two)
+dnl gives
+dnl something one
+dnl something two
+dnl
+dnl Any previous definition of "var", or lack thereof, is saved and
+dnl restored. Empty "item"s are not allowed.
+
+define(foreach,
+m4_assert_numargs_range(2,1000)
+`ifelse(`$3',,,
+`pushdef(`$1',`$3')$2`'popdef(`$1')dnl
+foreach(`$1',`$2',shift(shift(shift($@))))')')
+
+
+dnl Usage: m4_toupper(x)
+dnl m4_tolower(x)
+dnl
+dnl Convert the argument string to upper or lower case, respectively.
+dnl Only one argument accepted.
+dnl
+dnl BSD m4 doesn't take ranges like a-z in translit(), so the full alphabet
+dnl is written out.
+
+define(m4_alphabet_lower, `abcdefghijklmnopqrstuvwxyz')
+define(m4_alphabet_upper, `ABCDEFGHIJKLMNOPQRSTUVWXYZ')
+
+define(m4_toupper,
+m4_assert_onearg()
+`translit(`$1', m4_alphabet_lower, m4_alphabet_upper)')
+
+define(m4_tolower,
+m4_assert_onearg()
+`translit(`$1', m4_alphabet_upper, m4_alphabet_lower)')
+
+
+dnl Usage: m4_empty_if_zero(x)
+dnl
+dnl Evaluate to x, or to nothing if x is 0. x is eval()ed and so can be an
+dnl expression.
+dnl
+dnl This is useful for x86 addressing mode displacements since forms like
+dnl (%ebx) are one byte shorter than 0(%ebx). A macro `foo' for use as
+dnl foo(%ebx) could be defined with the following so it'll be empty if the
+dnl expression comes out zero.
+dnl
+dnl deflit(`foo', `m4_empty_if_zero(a+b*4-c)')
+dnl
+dnl Naturally this shouldn't be done if, say, a computed jump depends on
+dnl the code being a particular size.
+
+define(m4_empty_if_zero,
+m4_assert_onearg()
+`ifelse(eval($1),0,,eval($1))')
+
+
+dnl Usage: m4_log2(x)
+dnl
+dnl Calculate a logarithm to base 2.
+dnl x must be an integral power of 2, between 2**0 and 2**30.
+dnl x is eval()ed, so it can be an expression.
+dnl An error results if x is invalid.
+dnl
+dnl 2**31 isn't supported, because an unsigned 2147483648 is out of range
+dnl of a 32-bit signed int. Also, the bug in BSD m4 where an eval()
+dnl resulting in 2147483648 (or -2147483648 as the case may be) gives `-('
+dnl means tests like eval(1<<31==(x)) would be necessary, but that then
+dnl gives an unattractive explosion of eval() error messages if x isn't
+dnl numeric.
+
+define(m4_log2,
+m4_assert_numargs(1)
+`m4_log2_internal(0,1,eval(`$1'))')
+
+dnl Called: m4_log2_internal(n,2**n,target)
+define(m4_log2_internal,
+m4_assert_numargs(3)
+`ifelse($2,$3,$1,
+`ifelse($1,30,
+`m4_error(`m4_log2() argument too big or not a power of two: $3
+')',
+`m4_log2_internal(incr($1),eval(2*$2),$3)')')')
+
+
+dnl Usage: m4_div2_towards_zero
+dnl
+dnl m4 division is probably whatever a C signed division is, and C doesn't
+dnl specify what rounding gets used on negatives, so this expression forces
+dnl a rounding towards zero.
+
+define(m4_div2_towards_zero,
+m4_assert_numargs(1)
+`eval((($1) + ((($1)<0) & ($1))) / 2)')
+
+
+dnl Usage: m4_lshift(n,count)
+dnl m4_rshift(n,count)
+dnl
+dnl Calculate n shifted left or right by count many bits. Both n and count
+dnl are eval()ed and so can be expressions.
+dnl
+dnl Negative counts are allowed and mean a shift in the opposite direction.
+dnl Negative n is allowed and right shifts will be arithmetic (meaning
+dnl divide by 2**count, rounding towards zero, also meaning the sign bit is
+dnl duplicated).
+dnl
+dnl Use these macros instead of << and >> in eval() since the basic ccs
+dnl SysV m4 doesn't have those operators.
+
+define(m4_rshift,
+m4_assert_numargs(2)
+`m4_lshift(`$1',-(`$2'))')
+
+define(m4_lshift,
+m4_assert_numargs(2)
+`m4_lshift_internal(eval(`$1'),eval(`$2'))')
+
+define(m4_lshift_internal,
+m4_assert_numargs(2)
+`ifelse(eval($2-0==0),1,$1,
+`ifelse(eval($2>0),1,
+`m4_lshift_internal(eval($1*2),decr($2))',
+`m4_lshift_internal(m4_div2_towards_zero($1),incr($2))')')')
+
+
+dnl Usage: m4_popcount(n)
+dnl
+dnl Expand to the number 1 bits in n.
+
+define(m4_popcount,
+m4_assert_numargs(1)
+`m4_popcount_internal(0,eval(`$1'))')
+
+dnl Called: m4_popcount_internal(count,rem)
+define(m4_popcount_internal,
+m4_assert_numargs(2)
+`ifelse($2,0,$1,
+`m4_popcount_internal(eval($1+($2%2)),eval($2/2))')')
+
+
+dnl Usage: m4_count_trailing_zeros(N)
+dnl
+dnl Determine the number of trailing zero bits on N. N is eval()ed and so
+dnl can be an expression. If N is zero an error is generated.
+
+define(m4_count_trailing_zeros,
+m4_assert_numargs(1)
+`m4_count_trailing_zeros_internal(eval(`$1'),0)')
+
+dnl Called: m4_count_trailing_zeros_internal(val,count)
+define(m4_count_trailing_zeros_internal,
+m4_assert_numargs(2)
+`ifelse($1,0,
+`m4_error(`m4_count_trailing_zeros() given a zero value')',
+`ifelse(eval(($1)%2),1,`$2',
+`m4_count_trailing_zeros_internal(eval($1/2),incr($2))')')')
+
+
+dnl Usage: deflit(name,value)
+dnl
+dnl Like define(), but "name" expands like a literal, rather than taking
+dnl arguments. For example "name(%eax)" expands to "value(%eax)".
+dnl
+dnl Limitations:
+dnl
+dnl $ characters in the value part must have quotes to stop them looking
+dnl like macro parameters. For example, deflit(reg,`123+$`'4+567'). See
+dnl defreg() below for handling simple register definitions like $7 etc.
+dnl
+dnl "name()" is turned into "name", unfortunately. In GNU and SysV m4 an
+dnl error is generated when this happens, but in BSD m4 it will happen
+dnl silently. The problem is that in BSD m4 $# is 1 in both "name" or
+dnl "name()", so there's no way to differentiate them. Because we want
+dnl plain "name" to turn into plain "value", we end up with "name()"
+dnl turning into plain "value" too.
+dnl
+dnl "name(foo)" will lose any whitespace after commas in "foo", for example
+dnl "disp(%eax, %ecx)" would become "128(%eax,%ecx)".
+dnl
+dnl These parentheses oddities shouldn't matter in assembler text, but if
+dnl they do the suggested workaround is to write "name ()" or "name (foo)"
+dnl to stop the parentheses looking like a macro argument list. If a space
+dnl isn't acceptable in the output, then write "name`'()" or "name`'(foo)".
+dnl The `' is stripped when read, but again stops the parentheses looking
+dnl like parameters.
+
+dnl Quoting for deflit_emptyargcheck is similar to m4_assert_numargs. The
+dnl stuff in the ifelse gives a $#, $1 and $@ evaluated in the new macro
+dnl created, not in deflit.
+define(deflit,
+m4_assert_numargs(2)
+`define(`$1',
+`deflit_emptyargcheck'(``$1'',$`#',m4_doublequote($`'1))`dnl
+$2`'dnl
+ifelse(eval($'`#>1 || m4_length('m4_doublequote($`'1)`)!=0),1,($'`@))')')
+
+dnl Called: deflit_emptyargcheck(macroname,$#,`$1')
+define(deflit_emptyargcheck,
+`ifelse(eval($2==1 && !m4_dollarhash_1_if_noparen_p && m4_length(`$3')==0),1,
+`m4_error(`dont use a deflit as $1() because it loses the brackets (see deflit in asm-defs.m4 for more information)
+')')')
+
+
+dnl Usage: m4_assert(`expr')
+dnl
+dnl Test a compile-time requirement with an m4 expression. The expression
+dnl should be quoted, and will be eval()ed and expected to be non-zero.
+dnl For example,
+dnl
+dnl m4_assert(`FOO*2+6 < 14')
+
+define(m4_assert,
+m4_assert_numargs(1)
+`ifelse(eval($1),1,,
+`m4_error(`assertion failed: $1
+')')')
+
+
+dnl Usage: m4_repeat(count,text)
+dnl
+dnl Expand to the given repetitions of the given text. A zero count is
+dnl allowed, and expands to nothing.
+
+define(m4_repeat,
+m4_assert_numargs(2)
+`m4_repeat_internal(eval($1),`$2')')
+
+define(m4_repeat_internal,
+m4_assert_numargs(2)
+`ifelse(`$1',0,,
+`forloop(m4_repeat_internal_counter,1,$1,``$2'')')')
+
+
+dnl Usage: m4_hex_lowmask(bits)
+dnl
+dnl Generate a hex constant which is a low mask of the given number of
+dnl bits. For example m4_hex_lowmask(10) would give 0x3ff.
+
+define(m4_hex_lowmask,
+m4_assert_numargs(1)
+`m4_cpu_hex_constant(m4_hex_lowmask_internal1(eval(`$1')))')
+
+dnl Called: m4_hex_lowmask_internal1(bits)
+define(m4_hex_lowmask_internal1,
+m4_assert_numargs(1)
+`ifelse($1,0,`0',
+`m4_hex_lowmask_internal2(eval(($1)%4),eval(($1)/4))')')
+
+dnl Called: m4_hex_lowmask_internal(remainder,digits)
+define(m4_hex_lowmask_internal2,
+m4_assert_numargs(2)
+`ifelse($1,1,`1',
+`ifelse($1,2,`3',
+`ifelse($1,3,`7')')')dnl
+m4_repeat($2,`f')')
+
+
+dnl --------------------------------------------------------------------------
+dnl The following m4_list functions take a list as multiple arguments.
+dnl Arguments are evaluated multiple times, there's no attempt at strict
+dnl quoting. Empty list elements are not allowed, since an empty final
+dnl argument is ignored. These restrictions don't affect the current uses,
+dnl and make the implementation easier.
+
+
+dnl Usage: m4_list_quote(list,...)
+dnl
+dnl Produce a list with quoted commas, so it can be a single argument
+dnl string. For instance m4_list_quote(a,b,c) gives
+dnl
+dnl a`,'b`,'c`,'
+dnl
+dnl This can be used to put a list in a define,
+dnl
+dnl define(foolist, m4_list_quote(a,b,c))
+dnl
+dnl Which can then be used for instance as
+dnl
+dnl m4_list_find(target, foolist)
+
+define(m4_list_quote,
+`ifelse(`$1',,,
+`$1`,'m4_list_quote(shift($@))')')
+
+
+dnl Usage: m4_list_find(key,list,...)
+dnl
+dnl Evaluate to 1 or 0 according to whether key is in the list elements.
+
+define(m4_list_find,
+m4_assert_numargs_range(1,1000)
+`ifelse(`$2',,0,
+`ifelse(`$1',`$2',1,
+`m4_list_find(`$1',shift(shift($@)))')')')
+
+
+dnl Usage: m4_list_remove(key,list,...)
+dnl
+dnl Evaluate to the given list with `key' removed (if present).
+
+define(m4_list_remove,
+m4_assert_numargs_range(1,1000)
+`ifelse(`$2',,,
+`ifelse(`$1',`$2',,`$2,')dnl
+m4_list_remove(`$1',shift(shift($@)))')')
+
+
+dnl Usage: m4_list_first(list,...)
+dnl
+dnl Evaluate to the first element of the list (if any).
+
+define(m4_list_first,`$1')
+
+
+dnl Usage: m4_list_count(list,...)
+dnl
+dnl Evaluate to the number of elements in the list. This can't just use $#
+dnl because the last element might be empty.
+
+define(m4_list_count,
+`m4_list_count_internal(0,$@)')
+
+dnl Called: m4_list_internal(count,list,...)
+define(m4_list_count_internal,
+m4_assert_numargs_range(1,1000)
+`ifelse(`$2',,$1,
+`m4_list_count_internal(eval($1+1),shift(shift($@)))')')
+
+
+dnl --------------------------------------------------------------------------
+dnl Various assembler things, not specific to any particular CPU.
+dnl
+
+
+dnl Usage: include_mpn(`filename')
+dnl
+dnl Like include(), but adds a path to the mpn source directory. For
+dnl example,
+dnl
+dnl include_mpn(`sparc64/addmul_1h.asm')
+
+define(include_mpn,
+m4_assert_numargs(1)
+m4_assert_defined(`CONFIG_TOP_SRCDIR')
+`include(CONFIG_TOP_SRCDIR`/mpn/$1')')
+
+
+dnl Usage: C comment ...
+dnl
+dnl This works like a FORTRAN-style comment character. It can be used for
+dnl comments to the right of assembly instructions, where just dnl would
+dnl remove the newline and concatenate adjacent lines.
+dnl
+dnl C and/or dnl are useful when an assembler doesn't support comments, or
+dnl where different assemblers for a particular CPU need different styles.
+dnl The intermediate ".s" files will end up with no comments, just code.
+dnl
+dnl Using C is not intended to cause offence to anyone who doesn't like
+dnl FORTRAN; but if that happens it's an unexpected bonus.
+dnl
+dnl During development, if comments are wanted in the .s files to help see
+dnl what's expanding where, C can be redefined with something like
+dnl
+dnl define(`C',`#')
+
+define(C, `
+dnl')
+
+
+dnl Normally PIC is defined (or not) by libtool, but it doesn't set it on
+dnl systems which are always PIC. PIC_ALWAYS established in config.m4
+dnl identifies these for us.
+
+ifelse(`PIC_ALWAYS',`yes',`define(`PIC')')
+
+
+dnl Various possible defines passed from the Makefile that are to be tested
+dnl with ifdef() rather than be expanded.
+
+m4_not_for_expansion(`PIC')
+m4_not_for_expansion(`DLL_EXPORT')
+
+dnl aors_n
+m4_not_for_expansion(`OPERATION_add_n')
+m4_not_for_expansion(`OPERATION_sub_n')
+
+dnl aors_err1_n
+m4_not_for_expansion(`OPERATION_add_err1_n')
+m4_not_for_expansion(`OPERATION_sub_err1_n')
+
+dnl aors_err2_n
+m4_not_for_expansion(`OPERATION_add_err2_n')
+m4_not_for_expansion(`OPERATION_sub_err2_n')
+
+dnl aors_err3_n
+m4_not_for_expansion(`OPERATION_add_err3_n')
+m4_not_for_expansion(`OPERATION_sub_err3_n')
+
+dnl aorsmul_1
+m4_not_for_expansion(`OPERATION_addmul_1')
+m4_not_for_expansion(`OPERATION_submul_1')
+
+dnl logops_n
+m4_not_for_expansion(`OPERATION_and_n')
+m4_not_for_expansion(`OPERATION_andn_n')
+m4_not_for_expansion(`OPERATION_nand_n')
+m4_not_for_expansion(`OPERATION_ior_n')
+m4_not_for_expansion(`OPERATION_iorn_n')
+m4_not_for_expansion(`OPERATION_nior_n')
+m4_not_for_expansion(`OPERATION_xor_n')
+m4_not_for_expansion(`OPERATION_xnor_n')
+
+dnl popham
+m4_not_for_expansion(`OPERATION_popcount')
+m4_not_for_expansion(`OPERATION_hamdist')
+
+dnl lorrshift
+m4_not_for_expansion(`OPERATION_lshift')
+m4_not_for_expansion(`OPERATION_rshift')
+
+dnl aorslsh1_n
+m4_not_for_expansion(`OPERATION_addlsh1_n')
+m4_not_for_expansion(`OPERATION_sublsh1_n')
+m4_not_for_expansion(`OPERATION_rsblsh1_n')
+
+dnl aorslsh2_n
+m4_not_for_expansion(`OPERATION_addlsh2_n')
+m4_not_for_expansion(`OPERATION_sublsh2_n')
+m4_not_for_expansion(`OPERATION_rsblsh2_n')
+
+dnl rsh1aors_n
+m4_not_for_expansion(`OPERATION_rsh1add_n')
+m4_not_for_expansion(`OPERATION_rsh1sub_n')
+
+
+dnl Usage: m4_config_gmp_mparam(`symbol')
+dnl
+dnl Check that `symbol' is defined. If it isn't, issue an error and
+dnl terminate immediately. The error message explains that the symbol
+dnl should be in config.m4, copied from gmp-mparam.h.
+dnl
+dnl Termination is immediate since missing say SQR_TOOM2_THRESHOLD can
+dnl lead to infinite loops and endless error messages.
+
+define(m4_config_gmp_mparam,
+m4_assert_numargs(1)
+`ifdef(`$1',,
+`m4_error(`$1 is not defined.
+ "configure" should have extracted this from gmp-mparam.h and put it
+ in config.m4 (or in <cpu>_<file>.asm for a fat binary), but somehow
+ this has failed.
+')m4exit(1)')')
+
+
+dnl Usage: defreg(name,reg)
+dnl
+dnl Give a name to a $ style register. For example,
+dnl
+dnl defreg(foo,$12)
+dnl
+dnl defreg() inserts an extra pair of quotes after the $ so that it's not
+dnl interpreted as an m4 macro parameter, ie. foo is actually $`'12. m4
+dnl strips those quotes when foo is expanded.
+dnl
+dnl deflit() is used to make the new definition, so it will expand
+dnl literally even if followed by parentheses ie. foo(99) will become
+dnl $12(99). (But there's nowhere that would be used is there?)
+dnl
+dnl When making further definitions from existing defreg() macros, remember
+dnl to use defreg() again to protect the $ in the new definitions too. For
+dnl example,
+dnl
+dnl defreg(a0,$4)
+dnl defreg(a1,$5)
+dnl ...
+dnl
+dnl defreg(PARAM_DST,a0)
+dnl
+dnl This is only because a0 is expanding at the time the PARAM_DST
+dnl definition is made, leaving a literal $4 that must be re-quoted. On
+dnl the other hand in something like the following ra is only expanded when
+dnl ret is used and its $`'31 protection will have its desired effect at
+dnl that time.
+dnl
+dnl defreg(ra,$31)
+dnl ...
+dnl define(ret,`j ra')
+dnl
+dnl Note that only $n forms are meant to be used here, and something like
+dnl 128($30) doesn't get protected and will come out wrong.
+
+define(defreg,
+m4_assert_numargs(2)
+`deflit(`$1',
+substr(`$2',0,1)``''substr(`$2',1))')
+
+
+dnl Usage: m4_instruction_wrapper()
+dnl
+dnl Put this, unquoted, on a line on its own, at the start of a macro
+dnl that's a wrapper around an assembler instruction. It adds code to give
+dnl a descriptive error message if the macro is invoked without arguments.
+dnl
+dnl For example, suppose jmp needs to be wrapped,
+dnl
+dnl define(jmp,
+dnl m4_instruction_wrapper()
+dnl m4_assert_numargs(1)
+dnl `.byte 0x42
+dnl .long $1
+dnl nop')
+dnl
+dnl The point of m4_instruction_wrapper is to get a better error message
+dnl than m4_assert_numargs would give if jmp is accidentally used as plain
+dnl "jmp foo" instead of the intended "jmp( foo)". "jmp()" with no
+dnl argument also provokes the error message.
+dnl
+dnl m4_instruction_wrapper should only be used with wrapped instructions
+dnl that take arguments, since obviously something meant to be used as say
+dnl plain "ret" doesn't want to give an error when used that way.
+
+define(m4_instruction_wrapper,
+m4_assert_numargs(0)
+``m4_instruction_wrapper_internal'(m4_doublequote($`'0),dnl
+ifdef(`__file__',`m4_doublequote(__file__)',``the m4 sources''),dnl
+$`#',m4_doublequote($`'1))`dnl'')
+
+dnl Called: m4_instruction_wrapper_internal($0,`filename',$#,$1)
+define(m4_instruction_wrapper_internal,
+`ifelse(eval($3<=1 && m4_length(`$4')==0),1,
+`m4_error(`$1 is a macro replacing that instruction and needs arguments, see $2 for details
+')')')
+
+
+dnl Usage: m4_cpu_hex_constant(string)
+dnl
+dnl Expand to the string prefixed by a suitable `0x' hex marker. This
+dnl should be redefined as necessary for CPUs with different conventions.
+
+define(m4_cpu_hex_constant,
+m4_assert_numargs(1)
+`0x`$1'')
+
+
+dnl Usage: UNROLL_LOG2, UNROLL_MASK, UNROLL_BYTES
+dnl CHUNK_LOG2, CHUNK_MASK, CHUNK_BYTES
+dnl
+dnl When code supports a variable amount of loop unrolling, the convention
+dnl is to define UNROLL_COUNT to the number of limbs processed per loop.
+dnl When testing code this can be varied to see how much the loop overhead
+dnl is costing. For example,
+dnl
+dnl deflit(UNROLL_COUNT, 32)
+dnl
+dnl If the forloop() generating the unrolled loop has a pattern processing
+dnl more than one limb, the convention is to express this with CHUNK_COUNT.
+dnl For example,
+dnl
+dnl deflit(CHUNK_COUNT, 2)
+dnl
+dnl The LOG2, MASK and BYTES definitions below are derived from these COUNT
+dnl definitions. If COUNT is redefined, the LOG2, MASK and BYTES follow
+dnl the new definition automatically.
+dnl
+dnl LOG2 is the log base 2 of COUNT. MASK is COUNT-1, which can be used as
+dnl a bit mask. BYTES is GMP_LIMB_BYTES*COUNT, the number of bytes
+dnl processed in each unrolled loop.
+dnl
+dnl GMP_LIMB_BYTES is defined in a CPU specific m4 include file. It
+dnl exists only so the BYTES definitions here can be common to all CPUs.
+dnl In the actual code for a given CPU, an explicit 4 or 8 may as well be
+dnl used because the code is only for a particular CPU, it doesn't need to
+dnl be general.
+dnl
+dnl Note that none of these macros do anything except give conventional
+dnl names to commonly used things. You still have to write your own
+dnl expressions for a forloop() and the resulting address displacements.
+dnl Something like the following would be typical for 4 bytes per limb.
+dnl
+dnl forloop(`i',0,UNROLL_COUNT-1,`
+dnl deflit(`disp',eval(i*4))
+dnl ...
+dnl ')
+dnl
+dnl Or when using CHUNK_COUNT,
+dnl
+dnl forloop(`i',0,UNROLL_COUNT/CHUNK_COUNT-1,`
+dnl deflit(`disp0',eval(i*CHUNK_COUNT*4))
+dnl deflit(`disp1',eval(disp0+4))
+dnl ...
+dnl ')
+dnl
+dnl Clearly `i' can be run starting from 1, or from high to low or whatever
+dnl best suits.
+
+deflit(UNROLL_LOG2,
+m4_assert_defined(`UNROLL_COUNT')
+`m4_log2(UNROLL_COUNT)')
+
+deflit(UNROLL_MASK,
+m4_assert_defined(`UNROLL_COUNT')
+`eval(UNROLL_COUNT-1)')
+
+deflit(UNROLL_BYTES,
+m4_assert_defined(`UNROLL_COUNT')
+m4_assert_defined(`GMP_LIMB_BYTES')
+`eval(UNROLL_COUNT * GMP_LIMB_BYTES)')
+
+deflit(CHUNK_LOG2,
+m4_assert_defined(`CHUNK_COUNT')
+`m4_log2(CHUNK_COUNT)')
+
+deflit(CHUNK_MASK,
+m4_assert_defined(`CHUNK_COUNT')
+`eval(CHUNK_COUNT-1)')
+
+deflit(CHUNK_BYTES,
+m4_assert_defined(`CHUNK_COUNT')
+m4_assert_defined(`GMP_LIMB_BYTES')
+`eval(CHUNK_COUNT * GMP_LIMB_BYTES)')
+
+
+dnl Usage: MPN(name)
+dnl
+dnl Add MPN_PREFIX to a name.
+dnl MPN_PREFIX defaults to "__gmpn_" if not defined.
+dnl
+dnl m4_unquote is used in MPN so that when it expands to say __gmpn_foo,
+dnl that identifier will be subject to further macro expansion. This is
+dnl used by some of the fat binary support for renaming symbols.
+
+ifdef(`MPN_PREFIX',,
+`define(`MPN_PREFIX',`__gmpn_')')
+
+define(MPN,
+m4_assert_numargs(1)
+`m4_unquote(MPN_PREFIX`'$1)')
+
+
+dnl Usage: mpn_add_n, etc
+dnl
+dnl Convenience definitions using MPN(), like the #defines in gmp.h. Each
+dnl function that might be implemented in assembler is here.
+
+define(define_mpn,
+m4_assert_numargs(1)
+`deflit(`mpn_$1',`MPN(`$1')')')
+
+define_mpn(add)
+define_mpn(add_1)
+define_mpn(add_err1_n)
+define_mpn(add_err2_n)
+define_mpn(add_err3_n)
+define_mpn(add_n)
+define_mpn(add_nc)
+define_mpn(addlsh1_n)
+define_mpn(addlsh1_nc)
+define_mpn(addlsh2_n)
+define_mpn(addlsh2_nc)
+define_mpn(addlsh_n)
+define_mpn(addlsh_nc)
+define_mpn(addlsh1_n_ip1)
+define_mpn(addlsh1_nc_ip1)
+define_mpn(addlsh2_n_ip1)
+define_mpn(addlsh2_nc_ip1)
+define_mpn(addlsh_n_ip1)
+define_mpn(addlsh_nc_ip1)
+define_mpn(addlsh1_n_ip2)
+define_mpn(addlsh1_nc_ip2)
+define_mpn(addlsh2_n_ip2)
+define_mpn(addlsh2_nc_ip2)
+define_mpn(addlsh_n_ip2)
+define_mpn(addlsh_nc_ip2)
+define_mpn(addmul_1)
+define_mpn(addmul_1c)
+define_mpn(addmul_2)
+define_mpn(addmul_3)
+define_mpn(addmul_4)
+define_mpn(addmul_5)
+define_mpn(addmul_6)
+define_mpn(addmul_7)
+define_mpn(addmul_8)
+define_mpn(addmul_2s)
+define_mpn(add_n_sub_n)
+define_mpn(add_n_sub_nc)
+define_mpn(addaddmul_1msb0)
+define_mpn(and_n)
+define_mpn(andn_n)
+define_mpn(bdiv_q_1)
+define_mpn(pi1_bdiv_q_1)
+define_mpn(bdiv_dbm1c)
+define_mpn(cmp)
+define_mpn(cnd_add_n)
+define_mpn(cnd_sub_n)
+define_mpn(com)
+define_mpn(copyd)
+define_mpn(copyi)
+define_mpn(count_leading_zeros)
+define_mpn(count_trailing_zeros)
+define_mpn(div_qr_1n_pi1)
+define_mpn(div_qr_2)
+define_mpn(div_qr_2n_pi1)
+define_mpn(div_qr_2u_pi1)
+define_mpn(div_qr_2n_pi2)
+define_mpn(div_qr_2u_pi2)
+define_mpn(divexact_1)
+define_mpn(divexact_by3c)
+define_mpn(divrem)
+define_mpn(divrem_1)
+define_mpn(divrem_1c)
+define_mpn(divrem_2)
+define_mpn(divrem_classic)
+define_mpn(divrem_newton)
+define_mpn(dump)
+define_mpn(gcd)
+define_mpn(gcd_1)
+define_mpn(gcdext)
+define_mpn(get_str)
+define_mpn(hamdist)
+define_mpn(invert_limb)
+define_mpn(invert_limb_table)
+define_mpn(ior_n)
+define_mpn(iorn_n)
+define_mpn(lshift)
+define_mpn(lshiftc)
+define_mpn(mod_1_1p)
+define_mpn(mod_1_1p_cps)
+define_mpn(mod_1s_2p)
+define_mpn(mod_1s_2p_cps)
+define_mpn(mod_1s_3p)
+define_mpn(mod_1s_3p_cps)
+define_mpn(mod_1s_4p)
+define_mpn(mod_1s_4p_cps)
+define_mpn(mod_1)
+define_mpn(mod_1c)
+define_mpn(mod_34lsub1)
+define_mpn(modexact_1_odd)
+define_mpn(modexact_1c_odd)
+define_mpn(mul)
+define_mpn(mul_1)
+define_mpn(mul_1c)
+define_mpn(mul_2)
+define_mpn(mul_3)
+define_mpn(mul_4)
+define_mpn(mul_5)
+define_mpn(mul_6)
+define_mpn(mul_basecase)
+define_mpn(mul_n)
+define_mpn(mullo_basecase)
+define_mpn(mulmid_basecase)
+define_mpn(perfect_square_p)
+define_mpn(popcount)
+define_mpn(preinv_divrem_1)
+define_mpn(preinv_mod_1)
+define_mpn(nand_n)
+define_mpn(neg)
+define_mpn(nior_n)
+define_mpn(powm)
+define_mpn(powlo)
+define_mpn(random)
+define_mpn(random2)
+define_mpn(redc_1)
+define_mpn(redc_2)
+define_mpn(rsblsh1_n)
+define_mpn(rsblsh1_nc)
+define_mpn(rsblsh2_n)
+define_mpn(rsblsh2_nc)
+define_mpn(rsblsh_n)
+define_mpn(rsblsh_nc)
+define_mpn(rsh1add_n)
+define_mpn(rsh1add_nc)
+define_mpn(rsh1sub_n)
+define_mpn(rsh1sub_nc)
+define_mpn(rshift)
+define_mpn(rshiftc)
+define_mpn(scan0)
+define_mpn(scan1)
+define_mpn(set_str)
+define_mpn(sqr_basecase)
+define_mpn(sqr_diagonal)
+define_mpn(sqr_diag_addlsh1)
+define_mpn(sub_n)
+define_mpn(sublsh1_n)
+define_mpn(sublsh1_nc)
+define_mpn(sublsh1_n_ip1)
+define_mpn(sublsh1_nc_ip1)
+define_mpn(sublsh2_n)
+define_mpn(sublsh2_nc)
+define_mpn(sublsh2_n_ip1)
+define_mpn(sublsh2_nc_ip1)
+define_mpn(sublsh_n)
+define_mpn(sublsh_nc)
+define_mpn(sublsh_n_ip1)
+define_mpn(sublsh_nc_ip1)
+define_mpn(sqrtrem)
+define_mpn(sub)
+define_mpn(sub_1)
+define_mpn(sub_err1_n)
+define_mpn(sub_err2_n)
+define_mpn(sub_err3_n)
+define_mpn(sub_n)
+define_mpn(sub_nc)
+define_mpn(submul_1)
+define_mpn(submul_1c)
+define_mpn(sec_tabselect)
+define_mpn(umul_ppmm)
+define_mpn(umul_ppmm_r)
+define_mpn(udiv_qrnnd)
+define_mpn(udiv_qrnnd_r)
+define_mpn(xnor_n)
+define_mpn(xor_n)
+
+
+dnl Defines for C global arrays and variables, with names matching what's
+dnl used in the C code.
+dnl
+dnl Notice that GSYM_PREFIX is included, unlike with the function defines
+dnl above. Also, "deflit" is used so that something like __clz_tab(%ebx)
+dnl comes out as __gmpn_clz_tab(%ebx), for the benefit of CPUs with that
+dnl style assembler syntax.
+
+deflit(__clz_tab,
+m4_assert_defined(`GSYM_PREFIX')
+`GSYM_PREFIX`'MPN(`clz_tab')')
+
+deflit(binvert_limb_table,
+m4_assert_defined(`GSYM_PREFIX')
+`GSYM_PREFIX`'__gmp_binvert_limb_table')
+
+
+dnl Usage: ASM_START()
+dnl
+dnl Emit any directives needed once at the start of an assembler file, like
+dnl ".set noreorder" or whatever. The default for this is nothing, but
+dnl it's redefined by CPU specific m4 files.
+
+define(ASM_START)
+
+
+dnl Usage: ASM_END()
+dnl
+dnl Emit any directives needed once at the end of an assembler file. The
+dnl default for this is nothing, but it's redefined by CPU specific m4 files.
+
+define(ASM_END)
+
+
+dnl Usage: PROLOGUE(foo[,param])
+dnl EPILOGUE(foo)
+dnl
+dnl Emit directives to start or end a function. GSYM_PREFIX is added by
+dnl these macros if necessary, so the given "foo" is what the function will
+dnl be called in C.
+dnl
+dnl The second parameter to PROLOGUE is used only for some CPUs and should
+dnl be omitted if not required.
+dnl
+dnl Nested or overlapping PROLOGUE/EPILOGUE pairs are allowed, if that
+dnl makes sense for the system. The name given to EPILOGUE must be a
+dnl currently open PROLOGUE.
+dnl
+dnl If only one PROLOGUE is open then the name can be omitted from
+dnl EPILOGUE. This is encouraged, since it means the name only has to
+dnl appear in one place, not two.
+dnl
+dnl The given name "foo" is not fully quoted here, it will be macro
+dnl expanded more than once. This is the way the m4_list macros work, and
+dnl it also helps the tune/many.pl program do a renaming like
+dnl -D__gmpn_add_n=mpn_add_n_foo when GSYM_PREFIX is not empty.
+
+define(PROLOGUE,
+m4_assert_numargs_range(1,2)
+`m4_file_seen()dnl
+define(`PROLOGUE_list',m4_list_quote($1,PROLOGUE_list))dnl
+ifelse(`$2',,
+`PROLOGUE_cpu(GSYM_PREFIX`'$1)',
+`PROLOGUE_cpu(GSYM_PREFIX`'$1,`$2')')')
+
+define(EPILOGUE,
+m4_assert_numargs_range(0,1)
+`ifelse(`$1',,
+`ifelse(m4_list_count(PROLOGUE_list),0,
+`m4_error(`no open functions for EPILOGUE
+')',
+`ifelse(m4_list_count(PROLOGUE_list),1,
+`EPILOGUE_internal(PROLOGUE_current_function)',
+`m4_error(`more than one open function for EPILOGUE
+')')')',
+`EPILOGUE_internal(`$1')')')
+
+define(EPILOGUE_internal,
+m4_assert_numargs(1)
+m4_assert_defined(`EPILOGUE_cpu')
+`ifelse(m4_list_find($1,PROLOGUE_list),0,
+`m4_error(`EPILOGUE without PROLOGUE: $1
+')')dnl
+define(`PROLOGUE_list',m4_list_quote(m4_list_remove($1,PROLOGUE_list)))dnl
+EPILOGUE_cpu(GSYM_PREFIX`$1')')
+
+dnl Currently open PROLOGUEs, as a comma-separated list.
+define(PROLOGUE_list)
+
+
+dnl Called: PROLOGUE_check(list,...)
+dnl Check there's no remaining open PROLOGUEs at the end of input.
+define(PROLOGUE_check,
+`ifelse($1,,,
+`m4_error(`no EPILOGUE for: $1
+')dnl
+PROLOGUE_check(shift($@))')')
+
+m4wrap_prepend(`PROLOGUE_check(PROLOGUE_list)')
+
+
+dnl Usage: PROLOGUE_current_function
+dnl
+dnl This macro expands to the current PROLOGUE/EPILOGUE function, or the
+dnl most recent PROLOGUE if such pairs are nested or overlapped.
+
+define(PROLOGUE_current_function,
+m4_assert_numargs(-1)
+`m4_list_first(PROLOGUE_list)')
+
+
+dnl Usage: PROLOGUE_cpu(GSYM_PREFIX`'foo[,param])
+dnl EPILOGUE_cpu(GSYM_PREFIX`'foo)
+dnl
+dnl These macros hold the CPU-specific parts of PROLOGUE and EPILOGUE.
+dnl Both are called with the function name, with GSYM_PREFIX already
+dnl prepended.
+dnl
+dnl The definitions here are something typical and sensible, but CPU or
+dnl system specific m4 files should redefine them as necessary. The
+dnl optional extra parameter to PROLOGUE_cpu is not expected and not
+dnl accepted here.
+
+define(PROLOGUE_cpu,
+m4_assert_numargs(1)
+` TEXT
+ ALIGN(8)
+ GLOBL `$1' GLOBL_ATTR
+ TYPE(`$1',`function')
+`$1'LABEL_SUFFIX')
+
+define(EPILOGUE_cpu,
+` SIZE(`$1',.-`$1')')
+
+
+dnl Usage: L(name)
+dnl
+dnl Generate a local label with the given name. This is simply a
+dnl convenient way to add LSYM_PREFIX.
+dnl
+dnl LSYM_PREFIX might be L$, so defn() must be used to quote it or the L
+dnl will expand again as the L macro, making an infinite recursion.
+
+define(`L',
+m4_assert_numargs(1)
+`defn(`LSYM_PREFIX')$1')
+
+
+dnl Usage: LDEF(name)
+dnl
+dnl Generate a directive to define a local label.
+dnl
+dnl On systems with a fixed syntax for defining labels there's no need to
+dnl use this macro, it's only meant for systems where the syntax varies,
+dnl like hppa which is "L(foo):" with gas, but just "L(foo)" in column 0
+dnl with the system `as'.
+dnl
+dnl The extra `' after LABEL_SUFFIX avoids any chance of a following
+dnl "(...)" being interpreted as an argument list. Not that it'd be
+dnl sensible to write anything like that after an LDEF(), but just in case.
+
+define(LDEF,
+m4_assert_numargs(1)
+m4_assert_defined(`LABEL_SUFFIX')
+`L(`$1')`'LABEL_SUFFIX`'')
+
+
+dnl Usage: INT32(label,value)
+dnl INT64(label,first,second)
+
+define(`INT32',
+m4_assert_defined(`W32')
+` ALIGN(4)
+LDEF(`$1')
+ W32 $2')
+
+define(`INT64',
+m4_assert_defined(`W32')
+` ALIGN(8)
+LDEF(`$1')
+ W32 $2
+ W32 $3')
+
+
+dnl Usage: ALIGN(bytes)
+dnl
+dnl Emit a ".align" directive. The alignment is specified in bytes, and
+dnl will normally need to be a power of 2. The actual ".align" generated
+dnl is either bytes or logarithmic according to what ./configure finds the
+dnl assembler needs.
+dnl
+dnl If ALIGN_FILL_0x90 is defined and equal to "yes", then ", 0x90" is
+dnl appended. This is for x86, see mpn/x86/README.
+
+define(ALIGN,
+m4_assert_numargs(1)
+m4_assert_defined(`ALIGN_LOGARITHMIC')
+`.align ifelse(ALIGN_LOGARITHMIC,yes,`m4_log2($1)',`eval($1)')dnl
+ifelse(ALIGN_FILL_0x90,yes,`, 0x90')')
+
+
+dnl Usage: MULFUNC_PROLOGUE(function function...)
+dnl
+dnl A dummy macro which is grepped for by ./configure to know what
+dnl functions a multi-function file is providing. Use this if there aren't
+dnl explicit PROLOGUE()s for each possible function.
+dnl
+dnl Multiple MULFUNC_PROLOGUEs can be used, or just one with the function
+dnl names separated by spaces.
+
+define(`MULFUNC_PROLOGUE',
+m4_assert_numargs(1)
+)
+
+
+dnl Usage: NAILS_SUPPORT(spec spec ...)
+dnl
+dnl A dummy macro which is grepped for by ./configure to know what nails
+dnl are supported in an asm file.
+dnl
+dnl Ranges can be given, or just individual values. Multiple values or
+dnl ranges can be given, separated by spaces. Multiple NAILS_SUPPORT
+dnl declarations work too. Some examples,
+dnl
+dnl NAILS_SUPPORT(1-20)
+dnl NAILS_SUPPORT(1 6 9-12)
+dnl NAILS_SUPPORT(1-10 16-20)
+
+define(NAILS_SUPPORT,
+m4_assert_numargs(1)
+)
+
+
+dnl Usage: ABI_SUPPORT(abi)
+dnl
+dnl A dummy macro which is grepped for by ./configure to know what ABIs
+dnl are supported in an asm file.
+dnl
+dnl If multiple non-standard ABIs are supported, several ABI_SUPPORT
+dnl declarations should be used:
+dnl
+dnl ABI_SUPPORT(FOOABI)
+dnl ABI_SUPPORT(BARABI)
+
+define(ABI_SUPPORT,
+m4_assert_numargs(1)
+)
+
+
+dnl Usage: GMP_NUMB_MASK
+dnl
+dnl A bit mask for the number part of a limb. Eg. with 6 bit nails in a
+dnl 32 bit limb, GMP_NUMB_MASK would be 0x3ffffff.
+
+define(GMP_NUMB_MASK,
+m4_assert_numargs(-1)
+m4_assert_defined(`GMP_NUMB_BITS')
+`m4_hex_lowmask(GMP_NUMB_BITS)')
+
+
+dnl Usage: m4append(`variable',`value-to-append')
+
+define(`m4append',
+`define(`$1', defn(`$1')`$2')
+'
+)
+
+divert`'dnl
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/cpp-ccas b/Build/source/libs/gmp/gmp-6.0.0/mpn/cpp-ccas
new file mode 100755
index 00000000000..25f7cdcbebd
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/cpp-ccas
@@ -0,0 +1,118 @@
+#!/bin/sh
+#
+# A helper script for Makeasm.am .S.lo rule.
+
+# Copyright 2001 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/.
+
+
+# Usage: cpp-cc --cpp=CPP CC ... file.S ...
+#
+# Process file.S with the given CPP command plus any -D options in the
+# rest of the arguments, then assemble with the given CC plus all
+# arguments.
+#
+# The CPP command must be in a single --cpp= argument, and will be
+# split on whitespace. It should include -I options required.
+#
+# When CC is invoked, file.S is replaced with a temporary .s file
+# which is the CPP output.
+#
+# Any lines starting with "#" are removed from the CPP output, usually
+# these will be #line and #file markers from CPP, but they might also
+# be comments from the .S.
+#
+# To allow parallel builds, the temp file name is based on the .S file
+# name, which will be the output object filename for all uses we put
+# this script to.
+
+CPP=
+CPPDEFS=
+CC=
+S=
+SEEN_O=no
+
+for i in "$@"; do
+ case $i in
+ --cpp=*)
+ CPP=`echo "$i" | sed 's/^--cpp=//'`
+ ;;
+ -D*)
+ CPPDEFS="$CPPDEFS $i"
+ CC="$CC $i"
+ ;;
+ *.S)
+ if test -n "$S"; then
+ echo "Only one .S file permitted"
+ exit 1
+ fi
+ BASENAME=`echo "$i" | sed -e 's/\.S$//' -e 's/^.*[\\/:]//'`
+ S=$i
+ TMP_I=tmp-$BASENAME.i
+ TMP_S=tmp-$BASENAME.s
+ CC="$CC $TMP_S"
+ ;;
+ -o)
+ SEEN_O=yes
+ CC="$CC $i"
+ ;;
+ *)
+ CC="$CC $i"
+ ;;
+ esac
+done
+
+if test -z "$CPP"; then
+ echo "No --cpp specified"
+ exit 1
+fi
+
+if test -z "$S"; then
+ echo "No .S specified"
+ exit 1
+fi
+
+# Libtool adds it's own -o when sending output to .libs/foo.o, but not
+# when just wanting foo.o in the current directory. We need an
+# explicit -o in both cases since we're assembling tmp-foo.s.
+#
+if test $SEEN_O = no; then
+ CC="$CC -o $BASENAME.o"
+fi
+
+echo "$CPP $CPPDEFS $S >$TMP_I"
+$CPP $CPPDEFS $S >$TMP_I || exit
+
+echo "grep -v '^#' $TMP_I >$TMP_S"
+grep -v '^#' $TMP_I >$TMP_S
+
+echo "$CC"
+$CC || exit
+
+# Comment this out to preserve .s intermediates
+rm -f $TMP
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/cray/README b/Build/source/libs/gmp/gmp-6.0.0/mpn/cray/README
new file mode 100644
index 00000000000..3a347d28050
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/cray/README
@@ -0,0 +1,121 @@
+Copyright 2000-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/.
+
+
+
+
+
+
+The code in this directory works for Cray vector systems such as C90,
+J90, T90 (both the CFP variant and the IEEE variant) and SV1. (For
+the T3E and T3D systems, see the `alpha' subdirectory at the same
+level as the directory containing this file.)
+
+The cfp subdirectory is for systems utilizing the traditional Cray
+floating-point format, and the ieee subdirectory is for the newer
+systems that use the IEEE floating-point format.
+
+There are several issues that reduces speed on Cray systems. For
+systems with cfp floating point, the main obstacle is the forming of
+128-bit products. For IEEE systems, adding, and in particular
+computing carry is the main issue. There are no vectorizing
+unsigned-less-than instructions, and the sequence that implement that
+operation is very long.
+
+Shifting is the only operation that is simple to make fast. All Cray
+systems have a bitblt instructions (Vi Vj,Vj<Ak and Vi Vj,Vj>Ak) that
+should be really useful.
+
+For best speed for cfp systems, we need a mul_basecase, since that
+reduces the need for carry propagation to a minimum. Depending on the
+size (vn) of the smaller of the two operands (V), we should split U and V
+in different chunk sizes:
+
+U split in 2 32-bit parts
+V split according to the table:
+parts 4 5 6 7 8
+bits/part 16 13 11 10 8
+max allowed vn 1 8 32 64 256
+number of multiplies 8 10 12 14 16
+peak cycles/limb 4 5 6 7 8
+
+U split in 3 22-bit parts
+V split according to the table:
+parts 3 4 5
+bits/part 22 16 13
+max allowed vn 16 1024 8192
+number of multiplies 9 12 15
+peak cycles/limb 4.5 6 7.5
+
+U split in 4 16-bit parts
+V split according to the table:
+parts 4
+bits/part 16
+max allowed vn 65536
+number of multiplies 16
+peak cycles/limb 8
+
+(A T90 CPU can accumulate two products per cycle.)
+
+IDEA:
+* Rewrite mpn_add_n:
+ short cy[n + 1];
+ #pragma _CRI ivdep
+ for (i = 0; i < n; i++)
+ { s = up[i] + vp[i];
+ rp[i] = s;
+ cy[i + 1] = s < up[i]; }
+ more_carries = 0;
+ #pragma _CRI ivdep
+ for (i = 1; i < n; i++)
+ { s = rp[i] + cy[i];
+ rp[i] = s;
+ more_carries += s < cy[i]; }
+ cys = 0;
+ if (more_carries)
+ {
+ cys = rp[1] < cy[1];
+ for (i = 2; i < n; i++)
+ { rp[i] += cys;
+ cys = rp[i] < cys; }
+ }
+ return cys + cy[n];
+
+* Write mpn_add3_n for adding three operands. First add operands 1
+ and 2, and generate cy[]. Then add operand 3 to the partial result,
+ and accumulate carry into cy[]. Finally propagate carry just like
+ in the new mpn_add_n.
+
+IDEA:
+
+Store fewer bits, perhaps 62, per limb. That brings mpn_add_n time
+down to 2.5 cycles/limb and mpn_addmul_1 times to 4 cycles/limb. By
+storing even fewer bits per limb, perhaps 56, it would be possible to
+write a mul_mul_basecase that would run at effectively 1 cycle/limb.
+(Use VM here to better handle the romb-shaped multiply area, perhaps
+rounding operand sizes up to the next power of 2.)
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/cray/add_n.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/cray/add_n.c
new file mode 100644
index 00000000000..65b53bf87af
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/cray/add_n.c
@@ -0,0 +1,91 @@
+/* Cray PVP mpn_add_n -- add two limb vectors and store their sum in a third
+ limb vector.
+
+Copyright 1996, 2000, 2001 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/. */
+
+/* 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
+mpn_add_n (mp_ptr rp, mp_srcptr up, mp_srcptr vp, mp_size_t n)
+{
+ mp_limb_t cy[n];
+ mp_limb_t a, b, r, s0, c0, c1;
+ mp_size_t i;
+ int more_carries;
+
+ /* Main add loop. Generate a raw output sum in rp[] and a carry vector
+ in cy[]. */
+#pragma _CRI ivdep
+ for (i = 0; i < n; i++)
+ {
+ a = up[i];
+ b = vp[i];
+ s0 = a + b;
+ rp[i] = s0;
+ c0 = ((a & b) | ((a | b) & ~s0)) >> 63;
+ cy[i] = c0;
+ }
+ /* Carry add loop. Add the carry vector cy[] to the raw sum rp[] and
+ store the new sum back to rp[0]. If this generates further carry, set
+ more_carries. */
+ more_carries = 0;
+#pragma _CRI ivdep
+ for (i = 1; i < n; i++)
+ {
+ r = rp[i];
+ c0 = cy[i - 1];
+ s0 = r + c0;
+ rp[i] = s0;
+ c0 = (r & ~s0) >> 63;
+ more_carries += c0;
+ }
+ /* If that second loop generated carry, handle that in scalar loop. */
+ if (more_carries)
+ {
+ mp_limb_t cyrec = 0;
+ /* Look for places where rp[k] is zero and cy[k-1] is non-zero.
+ These are where we got a recurrency carry. */
+ for (i = 1; i < n; i++)
+ {
+ r = rp[i];
+ c0 = (r == 0 && cy[i - 1] != 0);
+ s0 = r + cyrec;
+ rp[i] = s0;
+ c1 = (r & ~s0) >> 63;
+ cyrec = c0 | c1;
+ }
+ return cyrec | cy[n - 1];
+ }
+
+ return cy[n - 1];
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/cray/cfp/addmul_1.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/cray/cfp/addmul_1.c
new file mode 100644
index 00000000000..e1d52e4a5f4
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/cray/cfp/addmul_1.c
@@ -0,0 +1,49 @@
+/* mpn_addmul_1 for Cray PVP.
+
+Copyright 1996, 2000, 2001 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.h"
+#include "gmp-impl.h"
+
+mp_limb_t
+mpn_addmul_1 (mp_ptr rp, mp_srcptr up, mp_size_t n, mp_limb_t limb)
+{
+ mp_limb_t p0[n], p1[n], tp[n];
+ mp_limb_t cy_limb;
+
+ GMPN_MULWW (p1, p0, up, &n, &limb);
+ cy_limb = mpn_add_n (tp, rp, p0, n);
+ rp[0] = tp[0];
+ if (n != 1)
+ cy_limb += mpn_add_n (rp + 1, tp + 1, p1, n - 1);
+ cy_limb += p1[n - 1];
+
+ return cy_limb;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/cray/cfp/mul_1.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/cray/cfp/mul_1.c
new file mode 100644
index 00000000000..611a9d2532d
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/cray/cfp/mul_1.c
@@ -0,0 +1,48 @@
+/* mpn_mul_1 for Cray PVP.
+
+Copyright 1996, 2000, 2001 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.h"
+#include "gmp-impl.h"
+
+mp_limb_t
+mpn_mul_1 (mp_ptr rp, mp_srcptr up, mp_size_t n, mp_limb_t limb)
+{
+ mp_limb_t p0[n], p1[n];
+ mp_limb_t cy_limb;
+
+ GMPN_MULWW (p1, p0, up, &n, &limb);
+ rp[0] = p0[0];
+ cy_limb = p1[n - 1];
+ if (n != 1)
+ cy_limb += mpn_add_n (rp + 1, p0 + 1, p1, n - 1);
+
+ return cy_limb;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/cray/cfp/mulwwc90.s b/Build/source/libs/gmp/gmp-6.0.0/mpn/cray/cfp/mulwwc90.s
new file mode 100644
index 00000000000..71d2285fd7e
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/cray/cfp/mulwwc90.s
@@ -0,0 +1,254 @@
+* Helper for mpn_mul_1, mpn_addmul_1, and mpn_submul_1 for Cray PVP.
+
+* Copyright 1996, 2000 Free Software Foundation, Inc.
+* This file is generated from mulww.f in this same directory.
+
+* 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/.
+
+ IDENT GMPN_MULWW
+**********************************************
+* Assemble with Cal Version 2.0 *
+* *
+* Generated by CFT77 6.0.4.19 *
+* on 06/27/00 at 04:34:13 *
+* *
+**********************************************
+* ALLOW UNDERSCORES IN IDENTIFIERS
+ EDIT OFF
+ FORMAT NEW
+@DATA SECTION DATA,CM
+@DATA = W.*
+ CON O'0000000000040000000000
+ CON O'0435152404713723252514
+ CON O'0535270000000000000000
+ CON O'0000000000000001200012
+ VWD 32/0,32/P.GMPN_MULWW
+ CON O'0014003000000000001416
+ CON O'0000000000000000000011
+ CON O'0000000000000000000215
+ BSSZ 1
+@CODE SECTION CODE
+@CODE = P.*
+L3 = P.*
+ A0 A6
+ A5 6
+ B03,A5 0,A0
+ A0 A1+A2
+ A5 1
+ 0,A0 T00,A5
+ B02 A2
+ B66 A3
+ B01 A6
+ A7 P.L4
+ B00 A7
+ A6 @DATA
+ J $STKOFEN
+GMPN_MULWW = P.*
+ A0 @DATA+3
+ B77 A0
+ A1 13
+ A0 B66
+ A2 B66
+ A4 B67
+ 0,A0 B77,A1
+ A7 782
+ A3 A2+A7
+ A0 A4-A3
+ JAM L3
+ A0 A6
+ A5 6
+ B03,A5 0,A0
+ A0 A1+A2
+ A5 1
+ 0,A0 T00,A5
+ B02 A2
+ B66 A3
+ B01 A6
+L4 = P.*
+ A7 B07
+ S7 0,A7
+ A6 B10
+ S6 0,A6
+ S5 1
+ S4 <22
+ S7 S7-S5
+ S5 #S7
+ T00 S6
+ S6 S6>22
+ S7 T00
+ S7 S7>44
+ S3 T00
+ S3 S3&S4
+ S6 S6&S4
+ S7 S7&S4
+ S3 S3<24
+ S6 S6<24
+ S7 S7<24
+ S0 S5
+ S4 S5
+ S1 S6
+ S2 S3
+ S3 S7
+ JSP L5
+L6 = P.*
+ S7 -S4
+ A2 S7
+ VL A2
+ A3 B06
+ A5 B05
+ A4 B04
+ A1 VL
+ A2 S4
+L7 = P.*
+ A0 A3
+ VL A1
+ V7 ,A0,1
+ B11 A5
+ A7 22
+ B12 A4
+ V6 V7>A7
+ B13 A3
+ S7 <22
+ A3 B02
+ V5 S7&V6
+ A6 24
+ V4 V5<A6
+ V3 S1*FV4
+ V2 S7&V7
+ V1 V2<A6
+ V0 S3*FV1
+ V6 V0+V3
+ A5 44
+ V5 V7>A5
+ V2 S1*FV1
+ V3 S7&V5
+ A0 14
+ B77 A0
+ A4 B77
+ A0 A4+A3
+ ,A0,1 V2
+ V0 V3<A6
+ V7 S2*FV1
+ A4 142
+ A0 A4+A3
+ ,A0,1 V7
+ V5 V7>A7
+ V2 S2*FV0
+ V3 V6+V2
+ S7 <20
+ V1 S7&V3
+ A4 270
+ A0 A4+A3
+ ,A0,1 V0
+ A4 14
+ A0 A4+A3
+ V7 ,A0,1
+ V6 V1<A7
+ V2 S2*FV4
+ V0 V7+V2
+ S7 <42
+ V1 S7&V0
+ A4 398
+ A0 A4+A3
+ ,A0,1 V0
+ V7 S3*FV4
+ V2 V5+V1
+ V0 V3<A5
+ A5 526
+ A0 A5+A3
+ ,A0,1 V0
+ A5 270
+ A0 A5+A3
+ V4 ,A0,1
+ V5 V2+V6
+ A5 20
+ V1 V3>A5
+ V0 S1*FV4
+ A5 654
+ A0 A5+A3
+ ,A0,1 V1
+ V6 V7+V0
+ A5 2
+ V2 V6<A5
+ V3 S3*FV4
+ A5 142
+ A0 A5+A3
+ V1 ,A0,1
+ A5 526
+ A0 A5+A3
+ V7 ,A0,1
+ V0 V1+V7
+ V6 V3<A6
+ V4 V6+V2
+ A6 42
+ V7 V5>A6
+ A5 654
+ CPW
+ A0 A5+A3
+ V1 ,A0,1
+ A5 398
+ A0 A5+A3
+ V3 ,A0,1
+ V6 V4+V1
+ V2 V3>A6
+ V5 V6+V2
+ A6 B12
+ V4 V3<A7
+ A7 B13
+ A3 A7+A1
+ A7 B11
+ A5 A7+A1
+ A4 A6+A1
+ A7 A2+A1
+ A0 A2+A1
+ A2 128
+ B13 A0
+ V1 V0+V4
+ A0 B11
+ ,A0,1 V1
+ V6 V5+V7
+ A0 A6
+ ,A0,1 V6
+ A0 B13
+ A1 A2
+ A2 A7
+ JAN L7
+L8 = P.*
+L5 = P.*
+ S1 0
+ A0 B02
+ A2 B02
+ A1 13
+ B66 A0
+ B77,A1 0,A0
+ A0 A2+A1
+ A1 1
+ T00,A1 0,A0
+ J B00
+ EXT $STKOFEN:p
+ ENTRY GMPN_MULWW
+ END
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/cray/cfp/mulwwj90.s b/Build/source/libs/gmp/gmp-6.0.0/mpn/cray/cfp/mulwwj90.s
new file mode 100644
index 00000000000..1c2c7cddbea
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/cray/cfp/mulwwj90.s
@@ -0,0 +1,253 @@
+* Helper for mpn_mul_1, mpn_addmul_1, and mpn_submul_1 for Cray PVP.
+
+* Copyright 1996, 2000 Free Software Foundation, Inc.
+* This file is generated from mulww.f in this same directory.
+
+* 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/.
+
+ IDENT GMPN_MULWW
+**********************************************
+* Assemble with Cal Version 2.0 *
+* *
+* Generated by CFT77 6.0.4.19 *
+* on 06/27/00 at 04:34:13 *
+* *
+**********************************************
+* ALLOW UNDERSCORES IN IDENTIFIERS
+ EDIT OFF
+ FORMAT NEW
+@DATA SECTION DATA,CM
+@DATA = W.*
+ CON O'0000000000040000000000
+ CON O'0435152404713723252514
+ CON O'0535270000000000000000
+ CON O'0000000000000001200012
+ VWD 32/0,32/P.GMPN_MULWW
+ CON O'0014003000000000001416
+ CON O'0000000000000000000011
+ CON O'0000000000000000000215
+ BSSZ 1
+@CODE SECTION CODE
+@CODE = P.*
+L3 = P.*
+ A0 A6
+ A5 6
+ B03,A5 0,A0
+ A0 A1+A2
+ A5 1
+ 0,A0 T00,A5
+ B02 A2
+ B66 A3
+ B01 A6
+ A7 P.L4
+ B00 A7
+ A6 @DATA
+ J $STKOFEN
+GMPN_MULWW = P.*
+ A0 @DATA+3
+ B77 A0
+ A1 13
+ A0 B66
+ A2 B66
+ A4 B67
+ 0,A0 B77,A1
+ A7 782
+ A3 A2+A7
+ A0 A4-A3
+ JAM L3
+ A0 A6
+ A5 6
+ B03,A5 0,A0
+ A0 A1+A2
+ A5 1
+ 0,A0 T00,A5
+ B02 A2
+ B66 A3
+ B01 A6
+L4 = P.*
+ A7 B07
+ S7 0,A7
+ A6 B10
+ S6 0,A6
+ S5 1
+ S4 <22
+ S7 S7-S5
+ S5 #S7
+ T00 S6
+ S6 S6>22
+ S7 T00
+ S7 S7>44
+ S3 T00
+ S3 S3&S4
+ S6 S6&S4
+ S7 S7&S4
+ S3 S3<24
+ S6 S6<24
+ S7 S7<24
+ S0 S5
+ S4 S5
+ S1 S6
+ S2 S3
+ S3 S7
+ JSP L5
+L6 = P.*
+ S7 -S4
+ A2 S7
+ VL A2
+ A3 B06
+ A5 B05
+ A4 B04
+ A1 VL
+ A2 S4
+L7 = P.*
+ A0 A3
+ VL A1
+ V7 ,A0,1
+ B11 A5
+ A7 22
+ B12 A4
+ V6 V7>A7
+ B13 A3
+ S7 <22
+ A3 B02
+ V5 S7&V6
+ A6 24
+ V4 V5<A6
+ V3 S1*FV4
+ V2 S7&V7
+ V1 V2<A6
+ V0 S3*FV1
+ V6 V0+V3
+ A5 44
+ V5 V7>A5
+ V2 S1*FV1
+ V3 S7&V5
+ A0 14
+ B77 A0
+ A4 B77
+ A0 A4+A3
+ ,A0,1 V2
+ V0 V3<A6
+ V7 S2*FV1
+ A4 142
+ A0 A4+A3
+ ,A0,1 V7
+ V5 V7>A7
+ V2 S2*FV0
+ V3 V6+V2
+ S7 <20
+ V1 S7&V3
+ A4 270
+ A0 A4+A3
+ ,A0,1 V0
+ A4 14
+ A0 A4+A3
+ V7 ,A0,1
+ V6 V1<A7
+ V2 S2*FV4
+ V0 V7+V2
+ S7 <42
+ V1 S7&V0
+ A4 398
+ A0 A4+A3
+ ,A0,1 V0
+ V7 S3*FV4
+ V2 V5+V1
+ V0 V3<A5
+ A5 526
+ A0 A5+A3
+ ,A0,1 V0
+ A5 270
+ A0 A5+A3
+ V4 ,A0,1
+ V5 V2+V6
+ A5 20
+ V1 V3>A5
+ V0 S1*FV4
+ A5 654
+ A0 A5+A3
+ ,A0,1 V1
+ V6 V7+V0
+ A5 2
+ V2 V6<A5
+ V3 S3*FV4
+ A5 142
+ A0 A5+A3
+ V1 ,A0,1
+ A5 526
+ A0 A5+A3
+ V7 ,A0,1
+ V0 V1+V7
+ V6 V3<A6
+ V4 V6+V2
+ A6 42
+ V7 V5>A6
+ A5 654
+ A0 A5+A3
+ V1 ,A0,1
+ A5 398
+ A0 A5+A3
+ V3 ,A0,1
+ V6 V4+V1
+ V2 V3>A6
+ V5 V6+V2
+ A6 B12
+ V4 V3<A7
+ A7 B13
+ A3 A7+A1
+ A7 B11
+ A5 A7+A1
+ A4 A6+A1
+ A7 A2+A1
+ A0 A2+A1
+ A2 64
+ B13 A0
+ V1 V0+V4
+ A0 B11
+ ,A0,1 V1
+ V6 V5+V7
+ A0 A6
+ ,A0,1 V6
+ A0 B13
+ A1 A2
+ A2 A7
+ JAN L7
+L8 = P.*
+L5 = P.*
+ S1 0
+ A0 B02
+ A2 B02
+ A1 13
+ B66 A0
+ B77,A1 0,A0
+ A0 A2+A1
+ A1 1
+ T00,A1 0,A0
+ J B00
+ EXT $STKOFEN:p
+ ENTRY GMPN_MULWW
+ END
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/cray/cfp/submul_1.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/cray/cfp/submul_1.c
new file mode 100644
index 00000000000..b44c97df455
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/cray/cfp/submul_1.c
@@ -0,0 +1,49 @@
+/* mpn_submul_1 for Cray PVP.
+
+Copyright 1996, 2000, 2001 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.h"
+#include "gmp-impl.h"
+
+mp_limb_t
+mpn_submul_1 (mp_ptr rp, mp_srcptr up, mp_size_t n, mp_limb_t limb)
+{
+ mp_limb_t p0[n], p1[n], tp[n];
+ mp_limb_t cy_limb;
+
+ GMPN_MULWW (p1, p0, up, &n, &limb);
+ cy_limb = mpn_sub_n (tp, rp, p0, n);
+ rp[0] = tp[0];
+ if (n != 1)
+ cy_limb += mpn_sub_n (rp + 1, tp + 1, p1, n - 1);
+ cy_limb += p1[n - 1];
+
+ return cy_limb;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/cray/gmp-mparam.h b/Build/source/libs/gmp/gmp-6.0.0/mpn/cray/gmp-mparam.h
new file mode 100644
index 00000000000..ea8c25b32e2
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/cray/gmp-mparam.h
@@ -0,0 +1,79 @@
+/* Cray T90 CFP gmp-mparam.h -- Compiler/machine parameter header file.
+
+Copyright 1991, 1993, 1994, 1996, 2000-2004 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
+
+#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 */
+
+#define MUL_TOOM22_THRESHOLD 71
+#define MUL_TOOM33_THRESHOLD 131
+
+#define SQR_BASECASE_THRESHOLD 32
+#define SQR_TOOM2_THRESHOLD 199
+#define SQR_TOOM3_THRESHOLD 363
+
+#define DIV_SB_PREINV_THRESHOLD 0 /* (preinv always) */
+#define DIV_DC_THRESHOLD 996
+#define POWM_THRESHOLD 601
+
+#define HGCD_THRESHOLD 964
+#define GCD_ACCEL_THRESHOLD 3
+#define GCD_DC_THRESHOLD 2874
+#define JACOBI_BASE_METHOD 2
+
+#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 USE_PREINV_DIVREM_1 1 /* preinv always */
+#define USE_PREINV_MOD_1 1 /* preinv always */
+#define DIVREM_2_THRESHOLD 0 /* preinv always */
+#define DIVEXACT_1_THRESHOLD 0 /* always */
+#define MODEXACT_1_ODD_THRESHOLD 0 /* always */
+
+#define GET_STR_DC_THRESHOLD 26
+#define GET_STR_PRECOMPUTE_THRESHOLD 42
+#define SET_STR_THRESHOLD 145756
+
+#define MUL_FFT_TABLE { 272, 544, 1088, 2304, 5120, 12288, 49152, 0 }
+#define MUL_FFT_MODF_THRESHOLD 200
+#define MUL_FFT_THRESHOLD 1664
+
+#define SQR_FFT_TABLE { 1008, 2080, 3904, 7936, 17408, 45056, 0 }
+#define SQR_FFT_MODF_THRESHOLD 600
+#define SQR_FFT_THRESHOLD 2976
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/cray/hamdist.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/cray/hamdist.c
new file mode 100644
index 00000000000..8eb9ba018cd
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/cray/hamdist.c
@@ -0,0 +1,43 @@
+/* Cray mpn_hamdist -- hamming distance count.
+
+Copyright 2000 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 <intrinsics.h>
+#include "gmp.h"
+#include "gmp-impl.h"
+
+unsigned long int
+mpn_hamdist (mp_srcptr p1, mp_srcptr p2, mp_size_t n)
+{
+ unsigned long int result = 0;
+ mp_size_t i;
+ for (i = 0; i < n; i++)
+ result += _popcnt (p1[i] ^ p2[i]);
+ return result;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/cray/ieee/addmul_1.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/cray/ieee/addmul_1.c
new file mode 100644
index 00000000000..6318b7c9c29
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/cray/ieee/addmul_1.c
@@ -0,0 +1,112 @@
+/* Cray PVP/IEEE mpn_addmul_1 -- multiply a limb vector with a limb and add the
+ result to a second limb vector.
+
+Copyright 2000-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/. */
+
+/* This code runs at just under 9 cycles/limb on a T90. That is not perfect,
+ mainly due to vector register shortage in the main loop. Assembly code
+ should bring it down to perhaps 7 cycles/limb. */
+
+#include <intrinsics.h>
+#include "gmp.h"
+#include "gmp-impl.h"
+
+mp_limb_t
+mpn_addmul_1 (mp_ptr rp, mp_srcptr up, mp_size_t n, mp_limb_t vl)
+{
+ mp_limb_t cy[n];
+ mp_limb_t a, b, r, s0, s1, c0, c1;
+ mp_size_t i;
+ int more_carries;
+
+ if (up == rp)
+ {
+ /* The algorithm used below cannot handle overlap. Handle it here by
+ making a temporary copy of the source vector, then call ourselves. */
+ mp_limb_t xp[n];
+ MPN_COPY (xp, up, n);
+ return mpn_addmul_1 (rp, xp, n, vl);
+ }
+
+ a = up[0] * vl;
+ r = rp[0];
+ s0 = a + r;
+ rp[0] = s0;
+ c0 = ((a & r) | ((a | r) & ~s0)) >> 63;
+ cy[0] = c0;
+
+ /* Main multiply loop. Generate a raw accumulated output product in rp[]
+ and a carry vector in cy[]. */
+#pragma _CRI ivdep
+ for (i = 1; i < n; i++)
+ {
+ a = up[i] * vl;
+ b = _int_mult_upper (up[i - 1], vl);
+ s0 = a + b;
+ c0 = ((a & b) | ((a | b) & ~s0)) >> 63;
+ r = rp[i];
+ s1 = s0 + r;
+ rp[i] = s1;
+ c1 = ((s0 & r) | ((s0 | r) & ~s1)) >> 63;
+ cy[i] = c0 + c1;
+ }
+ /* Carry add loop. Add the carry vector cy[] to the raw result rp[] and
+ store the new result back to rp[]. */
+ more_carries = 0;
+#pragma _CRI ivdep
+ for (i = 1; i < n; i++)
+ {
+ r = rp[i];
+ c0 = cy[i - 1];
+ s0 = r + c0;
+ rp[i] = s0;
+ c0 = (r & ~s0) >> 63;
+ more_carries += c0;
+ }
+ /* If that second loop generated carry, handle that in scalar loop. */
+ if (more_carries)
+ {
+ mp_limb_t cyrec = 0;
+ /* Look for places where rp[k] == 0 and cy[k-1] == 1 or
+ rp[k] == 1 and cy[k-1] == 2.
+ These are where we got a recurrency carry. */
+ for (i = 1; i < n; i++)
+ {
+ r = rp[i];
+ c0 = r < cy[i - 1];
+ s0 = r + cyrec;
+ rp[i] = s0;
+ c1 = (r & ~s0) >> 63;
+ cyrec = c0 | c1;
+ }
+ return _int_mult_upper (up[n - 1], vl) + cyrec + cy[n - 1];
+ }
+
+ return _int_mult_upper (up[n - 1], vl) + cy[n - 1];
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/cray/ieee/gmp-mparam.h b/Build/source/libs/gmp/gmp-6.0.0/mpn/cray/ieee/gmp-mparam.h
new file mode 100644
index 00000000000..1fdc286574a
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/cray/ieee/gmp-mparam.h
@@ -0,0 +1,73 @@
+/* Cray T90 IEEE gmp-mparam.h -- Compiler/machine parameter header file.
+
+Copyright 1991, 1993, 1994, 1996, 2000-2002, 2004 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
+
+/* Generated by tuneup.c, 2004-02-07, system compiler */
+
+#define MUL_TOOM22_THRESHOLD 130
+#define MUL_TOOM33_THRESHOLD 260
+
+#define SQR_BASECASE_THRESHOLD 9 /* karatsuba */
+#define SQR_TOOM2_THRESHOLD 0 /* never sqr_basecase */
+#define SQR_TOOM3_THRESHOLD 34
+
+#define DIV_SB_PREINV_THRESHOLD 0 /* preinv always */
+#define DIV_DC_THRESHOLD 390
+#define POWM_THRESHOLD 656
+
+#define HGCD_THRESHOLD 964
+#define GCD_ACCEL_THRESHOLD 3
+#define GCD_DC_THRESHOLD 964
+#define JACOBI_BASE_METHOD 2
+
+#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 USE_PREINV_DIVREM_1 1 /* preinv always */
+#define USE_PREINV_MOD_1 1 /* preinv always */
+#define DIVREM_2_THRESHOLD 0 /* preinv always */
+#define DIVEXACT_1_THRESHOLD 0 /* always */
+#define MODEXACT_1_ODD_THRESHOLD 0 /* always */
+
+#define GET_STR_DC_THRESHOLD 45
+#define GET_STR_PRECOMPUTE_THRESHOLD 77
+#define SET_STR_THRESHOLD 145756
+
+#define MUL_FFT_TABLE { 1104, 2208, 4416, 8960, 19456, 45056, 0 }
+#define MUL_FFT_MODF_THRESHOLD 1168
+#define MUL_FFT_THRESHOLD 6528
+
+#define SQR_FFT_TABLE { 368, 736, 1600, 2816, 7168, 12288, 0 }
+#define SQR_FFT_MODF_THRESHOLD 296
+#define SQR_FFT_THRESHOLD 1312
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/cray/ieee/invert_limb.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/cray/ieee/invert_limb.c
new file mode 100644
index 00000000000..f951a6e1384
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/cray/ieee/invert_limb.c
@@ -0,0 +1,128 @@
+/* mpn_invert_limb -- Invert a normalized limb.
+
+Copyright 1991, 2000, 2001 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.h"
+#include "gmp-impl.h"
+#include "longlong.h"
+
+/*
+ This is needed to make configure define HAVE_NATIVE_mpn_invert_limb:
+ PROLOGUE(mpn_invert_limb)
+*/
+
+static const unsigned short int approx_tab[0x100] =
+{
+ /* 0x400, */
+ 0x3ff,
+ 0x3fc, 0x3f8, 0x3f4, 0x3f0, 0x3ec, 0x3e8, 0x3e4,
+ 0x3e0, 0x3dd, 0x3d9, 0x3d5, 0x3d2, 0x3ce, 0x3ca, 0x3c7,
+ 0x3c3, 0x3c0, 0x3bc, 0x3b9, 0x3b5, 0x3b2, 0x3ae, 0x3ab,
+ 0x3a8, 0x3a4, 0x3a1, 0x39e, 0x39b, 0x397, 0x394, 0x391,
+ 0x38e, 0x38b, 0x387, 0x384, 0x381, 0x37e, 0x37b, 0x378,
+ 0x375, 0x372, 0x36f, 0x36c, 0x369, 0x366, 0x364, 0x361,
+ 0x35e, 0x35b, 0x358, 0x355, 0x353, 0x350, 0x34d, 0x34a,
+ 0x348, 0x345, 0x342, 0x340, 0x33d, 0x33a, 0x338, 0x335,
+ 0x333, 0x330, 0x32e, 0x32b, 0x329, 0x326, 0x324, 0x321,
+ 0x31f, 0x31c, 0x31a, 0x317, 0x315, 0x313, 0x310, 0x30e,
+ 0x30c, 0x309, 0x307, 0x305, 0x303, 0x300, 0x2fe, 0x2fc,
+ 0x2fa, 0x2f7, 0x2f5, 0x2f3, 0x2f1, 0x2ef, 0x2ec, 0x2ea,
+ 0x2e8, 0x2e6, 0x2e4, 0x2e2, 0x2e0, 0x2de, 0x2dc, 0x2da,
+ 0x2d8, 0x2d6, 0x2d4, 0x2d2, 0x2d0, 0x2ce, 0x2cc, 0x2ca,
+ 0x2c8, 0x2c6, 0x2c4, 0x2c2, 0x2c0, 0x2be, 0x2bc, 0x2bb,
+ 0x2b9, 0x2b7, 0x2b5, 0x2b3, 0x2b1, 0x2b0, 0x2ae, 0x2ac,
+ 0x2aa, 0x2a8, 0x2a7, 0x2a5, 0x2a3, 0x2a1, 0x2a0, 0x29e,
+ 0x29c, 0x29b, 0x299, 0x297, 0x295, 0x294, 0x292, 0x291,
+ 0x28f, 0x28d, 0x28c, 0x28a, 0x288, 0x287, 0x285, 0x284,
+ 0x282, 0x280, 0x27f, 0x27d, 0x27c, 0x27a, 0x279, 0x277,
+ 0x276, 0x274, 0x273, 0x271, 0x270, 0x26e, 0x26d, 0x26b,
+ 0x26a, 0x268, 0x267, 0x265, 0x264, 0x263, 0x261, 0x260,
+ 0x25e, 0x25d, 0x25c, 0x25a, 0x259, 0x257, 0x256, 0x255,
+ 0x253, 0x252, 0x251, 0x24f, 0x24e, 0x24d, 0x24b, 0x24a,
+ 0x249, 0x247, 0x246, 0x245, 0x243, 0x242, 0x241, 0x240,
+ 0x23e, 0x23d, 0x23c, 0x23b, 0x239, 0x238, 0x237, 0x236,
+ 0x234, 0x233, 0x232, 0x231, 0x230, 0x22e, 0x22d, 0x22c,
+ 0x22b, 0x22a, 0x229, 0x227, 0x226, 0x225, 0x224, 0x223,
+ 0x222, 0x220, 0x21f, 0x21e, 0x21d, 0x21c, 0x21b, 0x21a,
+ 0x219, 0x218, 0x216, 0x215, 0x214, 0x213, 0x212, 0x211,
+ 0x210, 0x20f, 0x20e, 0x20d, 0x20c, 0x20b, 0x20a, 0x209,
+ 0x208, 0x207, 0x206, 0x205, 0x204, 0x203, 0x202, 0x201,
+};
+
+/* iteration: z = 2z-(z**2)d */
+
+mp_limb_t
+mpn_invert_limb (mp_limb_t d)
+{
+ mp_limb_t z, z2l, z2h, tl, th;
+ mp_limb_t xh, xl;
+ mp_limb_t zh, zl;
+
+#if GMP_LIMB_BITS == 32
+ z = approx_tab[(d >> 23) - 0x100] << 6; /* z < 2^16 */
+
+ z2l = z * z; /* z2l < 2^32 */
+ umul_ppmm (th, tl, z2l, d);
+ z = (z << 17) - (th << 1);
+#endif
+#if GMP_LIMB_BITS == 64
+ z = approx_tab[(d >> 55) - 0x100] << 6; /* z < 2^16 */
+
+ z2l = z * z; /* z2l < 2^32 */
+ th = z2l * (d >> 32); /* th < 2^64 */
+ z = (z << 17) - (th >> 31); /* z < 2^32 */
+
+ z2l = z * z;
+ umul_ppmm (th, tl, z2l, d);
+ z = (z << 33) - (th << 1);
+#endif
+
+ umul_ppmm (z2h, z2l, z, z);
+ umul_ppmm (th, tl, z2h, d);
+ umul_ppmm (xh, xl, z2l, d);
+ tl += xh;
+ th += tl < xh;
+ th = (th << 2) | (tl >> GMP_LIMB_BITS - 2);
+ tl = tl << 2;
+ sub_ddmmss (zh, zl, z << 2, 0, th, tl);
+
+ umul_ppmm (xh, xl, d, zh);
+ xh += d; /* add_ssaaaa (xh, xl, xh, xl, d, 0); */
+ if (~xh != 0)
+ {
+ add_ssaaaa (xh, xl, xh, xl, 0, d);
+ zh++;
+ }
+
+ add_ssaaaa (xh, xl, xh, xl, 0, d);
+ if (xh != 0)
+ zh++;
+
+ return zh;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/cray/ieee/mul_1.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/cray/ieee/mul_1.c
new file mode 100644
index 00000000000..dad09fa8cfd
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/cray/ieee/mul_1.c
@@ -0,0 +1,104 @@
+/* Cray PVP/IEEE mpn_mul_1 -- multiply a limb vector with a limb and store the
+ result in a second limb vector.
+
+Copyright 2000, 2001 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/. */
+
+/* This code runs at 5 cycles/limb on a T90. That would probably
+ be hard to improve upon, even with assembly code. */
+
+#include <intrinsics.h>
+#include "gmp.h"
+#include "gmp-impl.h"
+
+mp_limb_t
+mpn_mul_1 (mp_ptr rp, mp_srcptr up, mp_size_t n, mp_limb_t vl)
+{
+ mp_limb_t cy[n];
+ mp_limb_t a, b, r, s0, s1, c0, c1;
+ mp_size_t i;
+ int more_carries;
+
+ if (up == rp)
+ {
+ /* The algorithm used below cannot handle overlap. Handle it here by
+ making a temporary copy of the source vector, then call ourselves. */
+ mp_limb_t xp[n];
+ MPN_COPY (xp, up, n);
+ return mpn_mul_1 (rp, xp, n, vl);
+ }
+
+ a = up[0] * vl;
+ rp[0] = a;
+ cy[0] = 0;
+
+ /* Main multiply loop. Generate a raw accumulated output product in rp[]
+ and a carry vector in cy[]. */
+#pragma _CRI ivdep
+ for (i = 1; i < n; i++)
+ {
+ a = up[i] * vl;
+ b = _int_mult_upper (up[i - 1], vl);
+ s0 = a + b;
+ c0 = ((a & b) | ((a | b) & ~s0)) >> 63;
+ rp[i] = s0;
+ cy[i] = c0;
+ }
+ /* Carry add loop. Add the carry vector cy[] to the raw sum rp[] and
+ store the new sum back to rp[0]. */
+ more_carries = 0;
+#pragma _CRI ivdep
+ for (i = 2; i < n; i++)
+ {
+ r = rp[i];
+ c0 = cy[i - 1];
+ s0 = r + c0;
+ rp[i] = s0;
+ c0 = (r & ~s0) >> 63;
+ more_carries += c0;
+ }
+ /* If that second loop generated carry, handle that in scalar loop. */
+ if (more_carries)
+ {
+ mp_limb_t cyrec = 0;
+ /* Look for places where rp[k] is zero and cy[k-1] is non-zero.
+ These are where we got a recurrency carry. */
+ for (i = 2; i < n; i++)
+ {
+ r = rp[i];
+ c0 = (r == 0 && cy[i - 1] != 0);
+ s0 = r + cyrec;
+ rp[i] = s0;
+ c1 = (r & ~s0) >> 63;
+ cyrec = c0 | c1;
+ }
+ return _int_mult_upper (up[n - 1], vl) + cyrec + cy[n - 1];
+ }
+
+ return _int_mult_upper (up[n - 1], vl) + cy[n - 1];
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/cray/ieee/mul_basecase.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/cray/ieee/mul_basecase.c
new file mode 100644
index 00000000000..6dc845dd997
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/cray/ieee/mul_basecase.c
@@ -0,0 +1,108 @@
+/* Cray PVP/IEEE mpn_mul_basecase.
+
+Copyright 2000, 2001 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/. */
+
+/* The most critical loop of this code runs at about 5 cycles/limb on a T90.
+ That is not perfect, mainly due to vector register shortage. */
+
+#include <intrinsics.h>
+#include "gmp.h"
+#include "gmp-impl.h"
+
+void
+mpn_mul_basecase (mp_ptr rp,
+ mp_srcptr up, mp_size_t un,
+ mp_srcptr vp, mp_size_t vn)
+{
+ mp_limb_t cy[un + vn];
+ mp_limb_t vl;
+ mp_limb_t a, b, r, s0, s1, c0, c1;
+ mp_size_t i, j;
+ int more_carries;
+
+ for (i = 0; i < un + vn; i++)
+ {
+ rp[i] = 0;
+ cy[i] = 0;
+ }
+
+#pragma _CRI novector
+ for (j = 0; j < vn; j++)
+ {
+ vl = vp[j];
+
+ a = up[0] * vl;
+ r = rp[j];
+ s0 = a + r;
+ rp[j] = s0;
+ c0 = ((a & r) | ((a | r) & ~s0)) >> 63;
+ cy[j] += c0;
+
+#pragma _CRI ivdep
+ for (i = 1; i < un; i++)
+ {
+ a = up[i] * vl;
+ b = _int_mult_upper (up[i - 1], vl);
+ s0 = a + b;
+ c0 = ((a & b) | ((a | b) & ~s0)) >> 63;
+ r = rp[j + i];
+ s1 = s0 + r;
+ rp[j + i] = s1;
+ c1 = ((s0 & r) | ((s0 | r) & ~s1)) >> 63;
+ cy[j + i] += c0 + c1;
+ }
+ rp[j + un] = _int_mult_upper (up[un - 1], vl);
+ }
+
+ more_carries = 0;
+#pragma _CRI ivdep
+ for (i = 1; i < un + vn; i++)
+ {
+ r = rp[i];
+ c0 = cy[i - 1];
+ s0 = r + c0;
+ rp[i] = s0;
+ c0 = (r & ~s0) >> 63;
+ more_carries += c0;
+ }
+ /* If that second loop generated carry, handle that in scalar loop. */
+ if (more_carries)
+ {
+ mp_limb_t cyrec = 0;
+ for (i = 1; i < un + vn; i++)
+ {
+ r = rp[i];
+ c0 = (r < cy[i - 1]);
+ s0 = r + cyrec;
+ rp[i] = s0;
+ c1 = (r & ~s0) >> 63;
+ cyrec = c0 | c1;
+ }
+ }
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/cray/ieee/sqr_basecase.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/cray/ieee/sqr_basecase.c
new file mode 100644
index 00000000000..840d3dd2607
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/cray/ieee/sqr_basecase.c
@@ -0,0 +1,106 @@
+/* Cray PVP/IEEE mpn_sqr_basecase.
+
+Copyright 2000, 2001 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/. */
+
+/* This is just mpn_mul_basecase with trivial modifications. */
+
+#include <intrinsics.h>
+#include "gmp.h"
+#include "gmp-impl.h"
+
+void
+mpn_sqr_basecase (mp_ptr rp,
+ mp_srcptr up, mp_size_t un)
+{
+ mp_limb_t cy[un + un];
+ mp_limb_t ul;
+ mp_limb_t a, b, r, s0, s1, c0, c1;
+ mp_size_t i, j;
+ int more_carries;
+
+ for (i = 0; i < un + un; i++)
+ {
+ rp[i] = 0;
+ cy[i] = 0;
+ }
+
+#pragma _CRI novector
+ for (j = 0; j < un; j++)
+ {
+ ul = up[j];
+
+ a = up[0] * ul;
+ r = rp[j];
+ s0 = a + r;
+ rp[j] = s0;
+ c0 = ((a & r) | ((a | r) & ~s0)) >> 63;
+ cy[j] += c0;
+
+#pragma _CRI ivdep
+ for (i = 1; i < un; i++)
+ {
+ a = up[i] * ul;
+ b = _int_mult_upper (up[i - 1], ul);
+ s0 = a + b;
+ c0 = ((a & b) | ((a | b) & ~s0)) >> 63;
+ r = rp[j + i];
+ s1 = s0 + r;
+ rp[j + i] = s1;
+ c1 = ((s0 & r) | ((s0 | r) & ~s1)) >> 63;
+ cy[j + i] += c0 + c1;
+ }
+ rp[j + un] = _int_mult_upper (up[un - 1], ul);
+ }
+
+ more_carries = 0;
+#pragma _CRI ivdep
+ for (i = 1; i < un + un; i++)
+ {
+ r = rp[i];
+ c0 = cy[i - 1];
+ s0 = r + c0;
+ rp[i] = s0;
+ c0 = (r & ~s0) >> 63;
+ more_carries += c0;
+ }
+ /* If that second loop generated carry, handle that in scalar loop. */
+ if (more_carries)
+ {
+ mp_limb_t cyrec = 0;
+ for (i = 1; i < un + un; i++)
+ {
+ r = rp[i];
+ c0 = (r < cy[i - 1]);
+ s0 = r + cyrec;
+ rp[i] = s0;
+ c1 = (r & ~s0) >> 63;
+ cyrec = c0 | c1;
+ }
+ }
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/cray/ieee/submul_1.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/cray/ieee/submul_1.c
new file mode 100644
index 00000000000..27a1939019f
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/cray/ieee/submul_1.c
@@ -0,0 +1,112 @@
+/* Cray PVP/IEEE mpn_submul_1 -- multiply a limb vector with a limb and
+ subtract the result from a second limb vector.
+
+Copyright 2000-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/. */
+
+/* This code runs at just under 9 cycles/limb on a T90. That is not perfect,
+ mainly due to vector register shortage in the main loop. Assembly code
+ should bring it down to perhaps 7 cycles/limb. */
+
+#include <intrinsics.h>
+#include "gmp.h"
+#include "gmp-impl.h"
+
+mp_limb_t
+mpn_submul_1 (mp_ptr rp, mp_srcptr up, mp_size_t n, mp_limb_t vl)
+{
+ mp_limb_t cy[n];
+ mp_limb_t a, b, r, s0, s1, c0, c1;
+ mp_size_t i;
+ int more_carries;
+
+ if (up == rp)
+ {
+ /* The algorithm used below cannot handle overlap. Handle it here by
+ making a temporary copy of the source vector, then call ourselves. */
+ mp_limb_t xp[n];
+ MPN_COPY (xp, up, n);
+ return mpn_submul_1 (rp, xp, n, vl);
+ }
+
+ a = up[0] * vl;
+ r = rp[0];
+ s0 = r - a;
+ rp[0] = s0;
+ c1 = ((s0 & a) | ((s0 | a) & ~r)) >> 63;
+ cy[0] = c1;
+
+ /* Main multiply loop. Generate a raw accumulated output product in rp[]
+ and a carry vector in cy[]. */
+#pragma _CRI ivdep
+ for (i = 1; i < n; i++)
+ {
+ a = up[i] * vl;
+ b = _int_mult_upper (up[i - 1], vl);
+ s0 = a + b;
+ c0 = ((a & b) | ((a | b) & ~s0)) >> 63;
+ r = rp[i];
+ s1 = r - s0;
+ rp[i] = s1;
+ c1 = ((s1 & s0) | ((s1 | s0) & ~r)) >> 63;
+ cy[i] = c0 + c1;
+ }
+ /* Carry subtract loop. Subtract the carry vector cy[] from the raw result
+ rp[] and store the new result back to rp[]. */
+ more_carries = 0;
+#pragma _CRI ivdep
+ for (i = 1; i < n; i++)
+ {
+ r = rp[i];
+ c0 = cy[i - 1];
+ s0 = r - c0;
+ rp[i] = s0;
+ c0 = (s0 & ~r) >> 63;
+ more_carries += c0;
+ }
+ /* If that second loop generated carry, handle that in scalar loop. */
+ if (more_carries)
+ {
+ mp_limb_t cyrec = 0;
+ /* Look for places where rp[k] == ~0 and cy[k-1] == 1 or
+ rp[k] == ~1 and cy[k-1] == 2.
+ These are where we got a recurrency carry. */
+ for (i = 1; i < n; i++)
+ {
+ r = rp[i];
+ c0 = ~r < cy[i - 1];
+ s0 = r - cyrec;
+ rp[i] = s0;
+ c1 = (s0 & ~r) >> 63;
+ cyrec = c0 | c1;
+ }
+ return _int_mult_upper (up[n - 1], vl) + cyrec + cy[n - 1];
+ }
+
+ return _int_mult_upper (up[n - 1], vl) + cy[n - 1];
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/cray/lshift.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/cray/lshift.c
new file mode 100644
index 00000000000..074f38041a1
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/cray/lshift.c
@@ -0,0 +1,59 @@
+/* mpn_lshift -- Shift left low level for Cray vector processors.
+
+Copyright (C) 2000 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 <intrinsics.h>
+#include "gmp.h"
+#include "gmp-impl.h"
+
+mp_limb_t
+mpn_lshift (mp_ptr wp, mp_srcptr up, mp_size_t n, unsigned int cnt)
+{
+ unsigned sh_1, sh_2;
+ mp_size_t i;
+ mp_limb_t retval;
+
+ sh_1 = cnt;
+ sh_2 = GMP_LIMB_BITS - sh_1;
+ retval = up[n - 1] >> sh_2;
+
+#pragma _CRI ivdep
+ for (i = n - 1; i > 0; i--)
+ {
+#if 1
+ wp[i] = (up[i] << sh_1) | (up[i - 1] >> sh_2);
+#else
+ /* This is the recommended way, but at least on SV1 it is slower. */
+ wp[i] = _dshiftl (up[i], up[i - 1], sh_1);
+#endif
+ }
+
+ wp[0] = up[0] << sh_1;
+ return retval;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/cray/mulww.f b/Build/source/libs/gmp/gmp-6.0.0/mpn/cray/mulww.f
new file mode 100644
index 00000000000..9bddf05bc97
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/cray/mulww.f
@@ -0,0 +1,63 @@
+c Helper for mpn_mul_1, mpn_addmul_1, and mpn_submul_1 for Cray PVP.
+
+c Copyright 1996, 2000 Free Software Foundation, Inc.
+
+c This file is part of the GNU MP Library.
+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 * 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 or
+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 or both in parallel, as here.
+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 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/.
+
+c p1[] = hi(a[]*s); the upper limbs of each product
+c p0[] = low(a[]*s); the corresponding lower limbs
+c n is number of limbs in the vectors
+
+ subroutine gmpn_mulww(p1,p0,a,n,s)
+ integer*8 p1(0:*),p0(0:*),a(0:*),s
+ integer n
+
+ integer*8 a0,a1,a2,s0,s1,s2,c
+ integer*8 ai,t0,t1,t2,t3,t4
+
+ s0 = shiftl(and(s,4194303),24)
+ s1 = shiftl(and(shiftr(s,22),4194303),24)
+ s2 = shiftl(and(shiftr(s,44),4194303),24)
+
+ do i = 0,n-1
+ ai = a(i)
+ a0 = shiftl(and(ai,4194303),24)
+ a1 = shiftl(and(shiftr(ai,22),4194303),24)
+ a2 = shiftl(and(shiftr(ai,44),4194303),24)
+
+ t0 = i24mult(a0,s0)
+ t1 = i24mult(a0,s1)+i24mult(a1,s0)
+ t2 = i24mult(a0,s2)+i24mult(a1,s1)+i24mult(a2,s0)
+ t3 = i24mult(a1,s2)+i24mult(a2,s1)
+ t4 = i24mult(a2,s2)
+
+ p0(i)=shiftl(t2,44)+shiftl(t1,22)+t0
+ c=shiftr(shiftr(t0,22)+and(t1,4398046511103)+
+ $ shiftl(and(t2,1048575),22),42)
+ p1(i)=shiftl(t4,24)+shiftl(t3,2)+shiftr(t2,20)+shiftr(t1,42)+c
+ end do
+ end
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/cray/popcount.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/cray/popcount.c
new file mode 100644
index 00000000000..48ddab875ed
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/cray/popcount.c
@@ -0,0 +1,43 @@
+/* Cray mpn_popcount -- population count.
+
+Copyright 2000 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 <intrinsics.h>
+#include "gmp.h"
+#include "gmp-impl.h"
+
+unsigned long int
+mpn_popcount (mp_srcptr p, mp_size_t n)
+{
+ unsigned long int result = 0;
+ mp_size_t i;
+ for (i = 0; i < n; i++)
+ result += _popcnt (p[i]);
+ return result;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/cray/rshift.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/cray/rshift.c
new file mode 100644
index 00000000000..424bede9db7
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/cray/rshift.c
@@ -0,0 +1,59 @@
+/* mpn_rshift -- Shift right low level for Cray vector processors.
+
+Copyright (C) 2000 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 <intrinsics.h>
+#include "gmp.h"
+#include "gmp-impl.h"
+
+mp_limb_t
+mpn_rshift (mp_ptr wp, mp_srcptr up, mp_size_t n, unsigned int cnt)
+{
+ unsigned sh_1, sh_2;
+ mp_size_t i;
+ mp_limb_t retval;
+
+ sh_1 = cnt;
+ sh_2 = GMP_LIMB_BITS - sh_1;
+ retval = up[0] << sh_2;
+
+#pragma _CRI ivdep
+ for (i = 0; i < n - 1; i++)
+ {
+#if 1
+ wp[i] = (up[i] >> sh_1) | (up[i + 1] << sh_2);
+#else
+ /* This is the recommended way, but at least on SV1 it is slower. */
+ wp[i] = _dshiftr (up[i + 1], up[i], sh_1);
+#endif
+ }
+
+ wp[n - 1] = up[n - 1] >> sh_1;
+ return retval;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/cray/sub_n.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/cray/sub_n.c
new file mode 100644
index 00000000000..0cc9ad1e04a
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/cray/sub_n.c
@@ -0,0 +1,91 @@
+/* Cray PVP mpn_sub_n -- subtract two limb vectors and store their difference
+ in a third limb vector.
+
+Copyright 1996, 2000, 2001 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/. */
+
+/* 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
+mpn_sub_n (mp_ptr rp, mp_srcptr up, mp_srcptr vp, mp_size_t n)
+{
+ mp_limb_t cy[n];
+ mp_limb_t a, b, r, s0, c0, c1;
+ mp_size_t i;
+ int more_carries;
+
+ /* Main subtract loop. Generate a raw output difference in rp[] and a
+ borrow vector in cy[]. */
+#pragma _CRI ivdep
+ for (i = 0; i < n; i++)
+ {
+ a = up[i];
+ b = vp[i];
+ s0 = a - b; /* a = s0 + b */
+ rp[i] = s0;
+ c0 = ((s0 & b) | ((s0 | b) & ~a)) >> 63;
+ cy[i] = c0;
+ }
+ /* Borrow subtract loop. Subtract the borrow vector cy[] from the raw
+ difference rp[] and store the new difference back to rp[0]. If this
+ generates further borrow, set more_carries. */
+ more_carries = 0;
+#pragma _CRI ivdep
+ for (i = 1; i < n; i++)
+ {
+ r = rp[i];
+ c0 = cy[i - 1];
+ s0 = r - c0; /* r = s0 + c0 */
+ rp[i] = s0;
+ c0 = (s0 & ~r) >> 63;
+ more_carries += c0;
+ }
+ /* If that second loop generated borrow, handle that in scalar loop. */
+ if (more_carries)
+ {
+ mp_limb_t cyrec = 0;
+ /* Look for places where rp[k] contains just ones and cy[k-1] is
+ non-zero. These are where we got a recurrency borrow. */
+ for (i = 1; i < n; i++)
+ {
+ r = rp[i];
+ c0 = (~r == 0 && cy[i - 1] != 0);
+ s0 = r - cyrec;
+ rp[i] = s0;
+ c1 = (s0 & ~r) >> 63;
+ cyrec = c0 | c1;
+ }
+ return cyrec | cy[n - 1];
+ }
+
+ return cy[n - 1];
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/add.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/add.c
new file mode 100644
index 00000000000..559f26133cf
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/add.c
@@ -0,0 +1,34 @@
+/* mpn_add - add mpn to mpn.
+
+Copyright 2001 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_FORCE_mpn_add 1
+
+#include "gmp.h"
+#include "gmp-impl.h"
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/add_1.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/add_1.c
new file mode 100644
index 00000000000..ca2d8668528
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/add_1.c
@@ -0,0 +1,34 @@
+/* mpn_add_1 - add limb to mpn.
+
+Copyright 2001 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_FORCE_mpn_add_1 1
+
+#include "gmp.h"
+#include "gmp-impl.h"
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/add_err1_n.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/add_err1_n.c
new file mode 100644
index 00000000000..b8cb75f6e89
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/add_err1_n.c
@@ -0,0 +1,101 @@
+/* mpn_add_err1_n -- add_n with one error term
+
+ Contributed by David Harvey.
+
+ THE FUNCTION IN THIS FILE IS INTERNAL 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 2011 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.h"
+#include "gmp-impl.h"
+
+/*
+ Computes:
+
+ (1) {rp,n} := {up,n} + {vp,n} (just like mpn_add_n) with incoming carry cy,
+ return value is carry out.
+
+ (2) Let c[i+1] = carry from i-th limb addition (c[0] = cy).
+ Computes c[1]*yp[n-1] + ... + c[n]*yp[0], stores two-limb result at ep.
+
+ Requires n >= 1.
+
+ None of the outputs may overlap each other or any of the inputs, except
+ that {rp,n} may be equal to {up,n} or {vp,n}.
+*/
+mp_limb_t
+mpn_add_err1_n (mp_ptr rp, mp_srcptr up, mp_srcptr vp,
+ mp_ptr ep, mp_srcptr yp,
+ mp_size_t n, mp_limb_t cy)
+{
+ mp_limb_t el, eh, ul, vl, yl, zl, rl, sl, cy1, cy2;
+
+ ASSERT (n >= 1);
+ ASSERT (MPN_SAME_OR_SEPARATE_P (rp, up, n));
+ ASSERT (MPN_SAME_OR_SEPARATE_P (rp, vp, n));
+ ASSERT (! MPN_OVERLAP_P (rp, n, yp, n));
+ ASSERT (! MPN_OVERLAP_P (ep, 2, up, n));
+ ASSERT (! MPN_OVERLAP_P (ep, 2, vp, n));
+ ASSERT (! MPN_OVERLAP_P (ep, 2, yp, n));
+ ASSERT (! MPN_OVERLAP_P (ep, 2, rp, n));
+
+ yp += n - 1;
+ el = eh = 0;
+
+ do
+ {
+ yl = *yp--;
+ ul = *up++;
+ vl = *vp++;
+
+ /* ordinary add_n */
+ ADDC_LIMB (cy1, sl, ul, vl);
+ ADDC_LIMB (cy2, rl, sl, cy);
+ cy = cy1 | cy2;
+ *rp++ = rl;
+
+ /* update (eh:el) */
+ zl = (-cy) & yl;
+ el += zl;
+ eh += el < zl;
+ }
+ while (--n);
+
+#if GMP_NAIL_BITS != 0
+ eh = (eh << GMP_NAIL_BITS) + (el >> GMP_NUMB_BITS);
+ el &= GMP_NUMB_MASK;
+#endif
+
+ ep[0] = el;
+ ep[1] = eh;
+
+ return cy;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/add_err2_n.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/add_err2_n.c
new file mode 100644
index 00000000000..4b0242a32df
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/add_err2_n.c
@@ -0,0 +1,117 @@
+/* mpn_add_err2_n -- add_n with two error terms
+
+ Contributed by David Harvey.
+
+ THE FUNCTION IN THIS FILE IS INTERNAL 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 2011 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.h"
+#include "gmp-impl.h"
+
+/*
+ Computes:
+
+ (1) {rp,n} := {up,n} + {vp,n} (just like mpn_add_n) with incoming carry cy,
+ return value is carry out.
+
+ (2) Let c[i+1] = carry from i-th limb addition (c[0] = cy).
+ Computes c[1]*yp1[n-1] + ... + c[n]*yp1[0],
+ c[1]*yp2[n-1] + ... + c[n]*yp2[0],
+ stores two-limb results at {ep,2} and {ep+2,2} respectively.
+
+ Requires n >= 1.
+
+ None of the outputs may overlap each other or any of the inputs, except
+ that {rp,n} may be equal to {up,n} or {vp,n}.
+*/
+mp_limb_t
+mpn_add_err2_n (mp_ptr rp, mp_srcptr up, mp_srcptr vp,
+ mp_ptr ep, mp_srcptr yp1, mp_srcptr yp2,
+ mp_size_t n, mp_limb_t cy)
+{
+ mp_limb_t el1, eh1, el2, eh2, ul, vl, yl1, yl2, zl1, zl2, rl, sl, cy1, cy2;
+
+ ASSERT (n >= 1);
+ ASSERT (MPN_SAME_OR_SEPARATE_P (rp, up, n));
+ ASSERT (MPN_SAME_OR_SEPARATE_P (rp, vp, n));
+ ASSERT (! MPN_OVERLAP_P (rp, n, yp1, n));
+ ASSERT (! MPN_OVERLAP_P (rp, n, yp2, n));
+ ASSERT (! MPN_OVERLAP_P (ep, 4, up, n));
+ ASSERT (! MPN_OVERLAP_P (ep, 4, vp, n));
+ ASSERT (! MPN_OVERLAP_P (ep, 4, yp1, n));
+ ASSERT (! MPN_OVERLAP_P (ep, 4, yp2, n));
+ ASSERT (! MPN_OVERLAP_P (ep, 4, rp, n));
+
+ yp1 += n - 1;
+ yp2 += n - 1;
+ el1 = eh1 = 0;
+ el2 = eh2 = 0;
+
+ do
+ {
+ yl1 = *yp1--;
+ yl2 = *yp2--;
+ ul = *up++;
+ vl = *vp++;
+
+ /* ordinary add_n */
+ ADDC_LIMB (cy1, sl, ul, vl);
+ ADDC_LIMB (cy2, rl, sl, cy);
+ cy = cy1 | cy2;
+ *rp++ = rl;
+
+ /* update (eh1:el1) */
+ zl1 = (-cy) & yl1;
+ el1 += zl1;
+ eh1 += el1 < zl1;
+
+ /* update (eh2:el2) */
+ zl2 = (-cy) & yl2;
+ el2 += zl2;
+ eh2 += el2 < zl2;
+ }
+ while (--n);
+
+#if GMP_NAIL_BITS != 0
+ eh1 = (eh1 << GMP_NAIL_BITS) + (el1 >> GMP_NUMB_BITS);
+ el1 &= GMP_NUMB_MASK;
+ eh2 = (eh2 << GMP_NAIL_BITS) + (el2 >> GMP_NUMB_BITS);
+ el2 &= GMP_NUMB_MASK;
+#endif
+
+ ep[0] = el1;
+ ep[1] = eh1;
+ ep[2] = el2;
+ ep[3] = eh2;
+
+ return cy;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/add_err3_n.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/add_err3_n.c
new file mode 100644
index 00000000000..28cd7facf93
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/add_err3_n.c
@@ -0,0 +1,132 @@
+/* mpn_add_err3_n -- add_n with three error terms
+
+ Contributed by David Harvey.
+
+ THE FUNCTION IN THIS FILE IS INTERNAL 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 2011 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.h"
+#include "gmp-impl.h"
+
+/*
+ Computes:
+
+ (1) {rp,n} := {up,n} + {vp,n} (just like mpn_add_n) with incoming carry cy,
+ return value is carry out.
+
+ (2) Let c[i+1] = carry from i-th limb addition (c[0] = cy).
+ Computes c[1]*yp1[n-1] + ... + c[n]*yp1[0],
+ c[1]*yp2[n-1] + ... + c[n]*yp2[0],
+ c[1]*yp3[n-1] + ... + c[n]*yp3[0],
+ stores two-limb results at {ep,2}, {ep+2,2} and {ep+4,2} respectively.
+
+ Requires n >= 1.
+
+ None of the outputs may overlap each other or any of the inputs, except
+ that {rp,n} may be equal to {up,n} or {vp,n}.
+*/
+mp_limb_t
+mpn_add_err3_n (mp_ptr rp, mp_srcptr up, mp_srcptr vp,
+ mp_ptr ep, mp_srcptr yp1, mp_srcptr yp2, mp_srcptr yp3,
+ mp_size_t n, mp_limb_t cy)
+{
+ mp_limb_t el1, eh1, el2, eh2, el3, eh3, ul, vl, yl1, yl2, yl3, zl1, zl2, zl3, rl, sl, cy1, cy2;
+
+ ASSERT (n >= 1);
+ ASSERT (MPN_SAME_OR_SEPARATE_P (rp, up, n));
+ ASSERT (MPN_SAME_OR_SEPARATE_P (rp, vp, n));
+ ASSERT (! MPN_OVERLAP_P (rp, n, yp1, n));
+ ASSERT (! MPN_OVERLAP_P (rp, n, yp2, n));
+ ASSERT (! MPN_OVERLAP_P (rp, n, yp3, n));
+ ASSERT (! MPN_OVERLAP_P (ep, 6, up, n));
+ ASSERT (! MPN_OVERLAP_P (ep, 6, vp, n));
+ ASSERT (! MPN_OVERLAP_P (ep, 6, yp1, n));
+ ASSERT (! MPN_OVERLAP_P (ep, 6, yp2, n));
+ ASSERT (! MPN_OVERLAP_P (ep, 6, yp3, n));
+ ASSERT (! MPN_OVERLAP_P (ep, 6, rp, n));
+
+ yp1 += n - 1;
+ yp2 += n - 1;
+ yp3 += n - 1;
+ el1 = eh1 = 0;
+ el2 = eh2 = 0;
+ el3 = eh3 = 0;
+
+ do
+ {
+ yl1 = *yp1--;
+ yl2 = *yp2--;
+ yl3 = *yp3--;
+ ul = *up++;
+ vl = *vp++;
+
+ /* ordinary add_n */
+ ADDC_LIMB (cy1, sl, ul, vl);
+ ADDC_LIMB (cy2, rl, sl, cy);
+ cy = cy1 | cy2;
+ *rp++ = rl;
+
+ /* update (eh1:el1) */
+ zl1 = (-cy) & yl1;
+ el1 += zl1;
+ eh1 += el1 < zl1;
+
+ /* update (eh2:el2) */
+ zl2 = (-cy) & yl2;
+ el2 += zl2;
+ eh2 += el2 < zl2;
+
+ /* update (eh3:el3) */
+ zl3 = (-cy) & yl3;
+ el3 += zl3;
+ eh3 += el3 < zl3;
+ }
+ while (--n);
+
+#if GMP_NAIL_BITS != 0
+ eh1 = (eh1 << GMP_NAIL_BITS) + (el1 >> GMP_NUMB_BITS);
+ el1 &= GMP_NUMB_MASK;
+ eh2 = (eh2 << GMP_NAIL_BITS) + (el2 >> GMP_NUMB_BITS);
+ el2 &= GMP_NUMB_MASK;
+ eh3 = (eh3 << GMP_NAIL_BITS) + (el3 >> GMP_NUMB_BITS);
+ el3 &= GMP_NUMB_MASK;
+#endif
+
+ ep[0] = el1;
+ ep[1] = eh1;
+ ep[2] = el2;
+ ep[3] = eh2;
+ ep[4] = el3;
+ ep[5] = eh3;
+
+ return cy;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/add_n.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/add_n.c
new file mode 100644
index 00000000000..1a076709004
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/add_n.c
@@ -0,0 +1,90 @@
+/* mpn_add_n -- Add equal length limb vectors.
+
+Copyright 1992-1994, 1996, 2000, 2002, 2009 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.h"
+#include "gmp-impl.h"
+
+
+#if GMP_NAIL_BITS == 0
+
+mp_limb_t
+mpn_add_n (mp_ptr rp, mp_srcptr up, mp_srcptr vp, mp_size_t n)
+{
+ mp_limb_t ul, vl, sl, rl, cy, cy1, cy2;
+
+ ASSERT (n >= 1);
+ ASSERT (MPN_SAME_OR_INCR_P (rp, up, n));
+ ASSERT (MPN_SAME_OR_INCR_P (rp, vp, n));
+
+ cy = 0;
+ do
+ {
+ ul = *up++;
+ vl = *vp++;
+ sl = ul + vl;
+ cy1 = sl < ul;
+ rl = sl + cy;
+ cy2 = rl < sl;
+ cy = cy1 | cy2;
+ *rp++ = rl;
+ }
+ while (--n != 0);
+
+ return cy;
+}
+
+#endif
+
+#if GMP_NAIL_BITS >= 1
+
+mp_limb_t
+mpn_add_n (mp_ptr rp, mp_srcptr up, mp_srcptr vp, mp_size_t n)
+{
+ mp_limb_t ul, vl, rl, cy;
+
+ ASSERT (n >= 1);
+ ASSERT (MPN_SAME_OR_INCR_P (rp, up, n));
+ ASSERT (MPN_SAME_OR_INCR_P (rp, vp, n));
+
+ cy = 0;
+ do
+ {
+ ul = *up++;
+ vl = *vp++;
+ rl = ul + vl + cy;
+ cy = rl >> GMP_NUMB_BITS;
+ *rp++ = rl & GMP_NUMB_MASK;
+ }
+ while (--n != 0);
+
+ return cy;
+}
+
+#endif
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/add_n_sub_n.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/add_n_sub_n.c
new file mode 100644
index 00000000000..012eb3e33ad
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/add_n_sub_n.c
@@ -0,0 +1,173 @@
+/* mpn_add_n_sub_n -- Add and Subtract two limb vectors of equal, non-zero length.
+
+ THE FUNCTION IN THIS FILE IS INTERNAL 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 1999-2001, 2006 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.h"
+#include "gmp-impl.h"
+
+#ifndef L1_CACHE_SIZE
+#define L1_CACHE_SIZE 8192 /* only 68040 has less than this */
+#endif
+
+#define PART_SIZE (L1_CACHE_SIZE / GMP_LIMB_BYTES / 6)
+
+
+/* mpn_add_n_sub_n.
+ r1[] = s1[] + s2[]
+ r2[] = s1[] - s2[]
+ All operands have n limbs.
+ In-place operations allowed. */
+mp_limb_t
+mpn_add_n_sub_n (mp_ptr r1p, mp_ptr r2p, mp_srcptr s1p, mp_srcptr s2p, mp_size_t n)
+{
+ mp_limb_t acyn, acyo; /* carry for add */
+ mp_limb_t scyn, scyo; /* carry for subtract */
+ mp_size_t off; /* offset in operands */
+ mp_size_t this_n; /* size of current chunk */
+
+ /* We alternatingly add and subtract in chunks that fit into the (L1)
+ cache. Since the chunks are several hundred limbs, the function call
+ overhead is insignificant, but we get much better locality. */
+
+ /* We have three variant of the inner loop, the proper loop is chosen
+ depending on whether r1 or r2 are the same operand as s1 or s2. */
+
+ if (r1p != s1p && r1p != s2p)
+ {
+ /* r1 is not identical to either input operand. We can therefore write
+ to r1 directly, without using temporary storage. */
+ acyo = 0;
+ scyo = 0;
+ for (off = 0; off < n; off += PART_SIZE)
+ {
+ this_n = MIN (n - off, PART_SIZE);
+#if HAVE_NATIVE_mpn_add_nc
+ acyo = mpn_add_nc (r1p + off, s1p + off, s2p + off, this_n, acyo);
+#else
+ acyn = mpn_add_n (r1p + off, s1p + off, s2p + off, this_n);
+ acyo = acyn + mpn_add_1 (r1p + off, r1p + off, this_n, acyo);
+#endif
+#if HAVE_NATIVE_mpn_sub_nc
+ scyo = mpn_sub_nc (r2p + off, s1p + off, s2p + off, this_n, scyo);
+#else
+ scyn = mpn_sub_n (r2p + off, s1p + off, s2p + off, this_n);
+ scyo = scyn + mpn_sub_1 (r2p + off, r2p + off, this_n, scyo);
+#endif
+ }
+ }
+ else if (r2p != s1p && r2p != s2p)
+ {
+ /* r2 is not identical to either input operand. We can therefore write
+ to r2 directly, without using temporary storage. */
+ acyo = 0;
+ scyo = 0;
+ for (off = 0; off < n; off += PART_SIZE)
+ {
+ this_n = MIN (n - off, PART_SIZE);
+#if HAVE_NATIVE_mpn_sub_nc
+ scyo = mpn_sub_nc (r2p + off, s1p + off, s2p + off, this_n, scyo);
+#else
+ scyn = mpn_sub_n (r2p + off, s1p + off, s2p + off, this_n);
+ scyo = scyn + mpn_sub_1 (r2p + off, r2p + off, this_n, scyo);
+#endif
+#if HAVE_NATIVE_mpn_add_nc
+ acyo = mpn_add_nc (r1p + off, s1p + off, s2p + off, this_n, acyo);
+#else
+ acyn = mpn_add_n (r1p + off, s1p + off, s2p + off, this_n);
+ acyo = acyn + mpn_add_1 (r1p + off, r1p + off, this_n, acyo);
+#endif
+ }
+ }
+ else
+ {
+ /* r1 and r2 are identical to s1 and s2 (r1==s1 and r2==s2 or vice versa)
+ Need temporary storage. */
+ mp_limb_t tp[PART_SIZE];
+ acyo = 0;
+ scyo = 0;
+ for (off = 0; off < n; off += PART_SIZE)
+ {
+ this_n = MIN (n - off, PART_SIZE);
+#if HAVE_NATIVE_mpn_add_nc
+ acyo = mpn_add_nc (tp, s1p + off, s2p + off, this_n, acyo);
+#else
+ acyn = mpn_add_n (tp, s1p + off, s2p + off, this_n);
+ acyo = acyn + mpn_add_1 (tp, tp, this_n, acyo);
+#endif
+#if HAVE_NATIVE_mpn_sub_nc
+ scyo = mpn_sub_nc (r2p + off, s1p + off, s2p + off, this_n, scyo);
+#else
+ scyn = mpn_sub_n (r2p + off, s1p + off, s2p + off, this_n);
+ scyo = scyn + mpn_sub_1 (r2p + off, r2p + off, this_n, scyo);
+#endif
+ MPN_COPY (r1p + off, tp, this_n);
+ }
+ }
+
+ return 2 * acyo + scyo;
+}
+
+#ifdef MAIN
+#include <stdlib.h>
+#include <stdio.h>
+#include "timing.h"
+
+long cputime ();
+
+int
+main (int argc, char **argv)
+{
+ mp_ptr r1p, r2p, s1p, s2p;
+ double t;
+ mp_size_t n;
+
+ n = strtol (argv[1], 0, 0);
+
+ r1p = malloc (n * GMP_LIMB_BYTES);
+ r2p = malloc (n * GMP_LIMB_BYTES);
+ s1p = malloc (n * GMP_LIMB_BYTES);
+ s2p = malloc (n * GMP_LIMB_BYTES);
+ TIME (t,(mpn_add_n(r1p,s1p,s2p,n),mpn_sub_n(r1p,s1p,s2p,n)));
+ printf (" separate add and sub: %.3f\n", t);
+ TIME (t,mpn_add_n_sub_n(r1p,r2p,s1p,s2p,n));
+ printf ("combined addsub separate variables: %.3f\n", t);
+ TIME (t,mpn_add_n_sub_n(r1p,r2p,r1p,s2p,n));
+ printf (" combined addsub r1 overlap: %.3f\n", t);
+ TIME (t,mpn_add_n_sub_n(r1p,r2p,r1p,s2p,n));
+ printf (" combined addsub r2 overlap: %.3f\n", t);
+ TIME (t,mpn_add_n_sub_n(r1p,r2p,r1p,r2p,n));
+ printf (" combined addsub in-place: %.3f\n", t);
+
+ return 0;
+}
+#endif
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/addmul_1.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/addmul_1.c
new file mode 100644
index 00000000000..d76b4ad1350
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/addmul_1.c
@@ -0,0 +1,139 @@
+/* mpn_addmul_1 -- multiply the N long limb vector pointed to by UP by VL,
+ add the N least significant limbs of the product to the limb vector
+ 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.
+
+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.h"
+#include "gmp-impl.h"
+#include "longlong.h"
+
+
+#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)
+{
+ mp_limb_t ul, cl, hpl, lpl, rl;
+
+ ASSERT (n >= 1);
+ ASSERT (MPN_SAME_OR_SEPARATE_P (rp, up, n));
+
+ cl = 0;
+ do
+ {
+ ul = *up++;
+ umul_ppmm (hpl, lpl, ul, vl);
+
+ lpl += cl;
+ cl = (lpl < cl) + hpl;
+
+ rl = *rp;
+ lpl = rl + lpl;
+ cl += lpl < rl;
+ *rp++ = lpl;
+ }
+ while (--n != 0);
+
+ return cl;
+}
+
+#endif
+
+#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)
+{
+ mp_limb_t shifted_vl, ul, rl, lpl, hpl, prev_hpl, 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);
+
+ shifted_vl = vl << GMP_NAIL_BITS;
+ cl = 0;
+ prev_hpl = 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;
+ *rp++ = xl;
+ prev_hpl = hpl;
+ }
+ while (--n != 0);
+
+ return prev_hpl + cl;
+}
+
+#endif
+
+#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)
+{
+ mp_limb_t shifted_vl, ul, rl, lpl, hpl, prev_hpl, 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);
+
+ shifted_vl = vl << GMP_NAIL_BITS;
+ cl = 0;
+ prev_hpl = 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;
+ xl = xw & GMP_NUMB_MASK;
+ *rp++ = xl;
+ prev_hpl = hpl;
+ }
+ while (--n != 0);
+
+ return prev_hpl + cl;
+}
+
+#endif
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/bdiv_dbm1c.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/bdiv_dbm1c.c
new file mode 100644
index 00000000000..22c3cfd2c80
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/bdiv_dbm1c.c
@@ -0,0 +1,59 @@
+/* mpn_bdiv_dbm1c -- divide an mpn number by a divisor of B-1, where B is the
+ limb base. The dbm1c moniker means "Divisor of B Minus 1 with Carry".
+
+ THE FUNCTION IN THIS FILE IS INTERNAL 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 2008, 2009 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.h"
+#include "gmp-impl.h"
+#include "longlong.h"
+
+
+mp_limb_t
+mpn_bdiv_dbm1c (mp_ptr qp, mp_srcptr ap, mp_size_t n, mp_limb_t bd, mp_limb_t h)
+{
+ mp_limb_t a, p0, p1, cy;
+ mp_size_t i;
+
+ for (i = 0; i < n; i++)
+ {
+ a = ap[i];
+ umul_ppmm (p1, p0, a, bd << GMP_NAIL_BITS);
+ p0 >>= GMP_NAIL_BITS;
+ cy = h < p0;
+ h = (h - p0) & GMP_NUMB_MASK;
+ qp[i] = h;
+ h = h - p1 - cy;
+ }
+
+ return h;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/bdiv_q.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/bdiv_q.c
new file mode 100644
index 00000000000..1fc1bb7c099
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/bdiv_q.c
@@ -0,0 +1,77 @@
+/* mpn_bdiv_q -- Hensel division with precomputed inverse, returning quotient.
+
+ 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 GMP RELEASE.
+
+Copyright 2006, 2007, 2009 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.h"
+#include "gmp-impl.h"
+
+
+/* Computes Q = N / D mod B^n. */
+
+void
+mpn_bdiv_q (mp_ptr qp,
+ mp_srcptr np, mp_size_t nn,
+ mp_srcptr dp, mp_size_t dn,
+ mp_ptr tp)
+{
+ mp_limb_t di;
+
+ if (BELOW_THRESHOLD (dn, DC_BDIV_Q_THRESHOLD))
+ {
+ MPN_COPY (tp, np, nn);
+ binvert_limb (di, dp[0]); di = -di;
+ mpn_sbpi1_bdiv_q (qp, tp, nn, dp, dn, di);
+ }
+ else if (BELOW_THRESHOLD (dn, MU_BDIV_Q_THRESHOLD))
+ {
+ MPN_COPY (tp, np, nn);
+ binvert_limb (di, dp[0]); di = -di;
+ mpn_dcpi1_bdiv_q (qp, tp, nn, dp, dn, di);
+ }
+ else
+ {
+ mpn_mu_bdiv_q (qp, np, nn, dp, dn, tp);
+ }
+ return;
+}
+
+mp_size_t
+mpn_bdiv_q_itch (mp_size_t nn, mp_size_t dn)
+{
+ if (BELOW_THRESHOLD (dn, MU_BDIV_Q_THRESHOLD))
+ return nn;
+ else
+ return mpn_mu_bdiv_q_itch (nn, dn);
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/bdiv_q_1.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/bdiv_q_1.c
new file mode 100644
index 00000000000..74b247d5a9a
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/bdiv_q_1.c
@@ -0,0 +1,126 @@
+/* mpn_bdiv_q_1, mpn_pi1_bdiv_q_1 -- schoolbook Hensel division by 1-limb
+ divisor, returning quotient only.
+
+ 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 2000-2003, 2005, 2009 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.h"
+#include "gmp-impl.h"
+#include "longlong.h"
+
+mp_limb_t
+mpn_pi1_bdiv_q_1 (mp_ptr rp, mp_srcptr up, mp_size_t n, mp_limb_t d,
+ mp_limb_t di, int shift)
+{
+ mp_size_t i;
+ mp_limb_t c, h, l, u, u_next, dummy;
+
+ ASSERT (n >= 1);
+ ASSERT (d != 0);
+ ASSERT (MPN_SAME_OR_SEPARATE_P (rp, up, n));
+ ASSERT_MPN (up, n);
+ ASSERT_LIMB (d);
+
+ d <<= GMP_NAIL_BITS;
+
+ if (shift != 0)
+ {
+ c = 0;
+
+ u = up[0];
+ rp--;
+ for (i = 1; i < n; i++)
+ {
+ u_next = up[i];
+ u = ((u >> shift) | (u_next << (GMP_NUMB_BITS-shift))) & GMP_NUMB_MASK;
+
+ SUBC_LIMB (c, l, u, c);
+
+ l = (l * di) & GMP_NUMB_MASK;
+ rp[i] = l;
+
+ umul_ppmm (h, dummy, l, d);
+ c += h;
+ u = u_next;
+ }
+
+ u = u >> shift;
+ l = u - c;
+ l = (l * di) & GMP_NUMB_MASK;
+ rp[i] = l;
+ }
+ else
+ {
+ u = up[0];
+ l = (u * di) & GMP_NUMB_MASK;
+ rp[0] = l;
+ c = 0;
+
+ for (i = 1; i < n; i++)
+ {
+ umul_ppmm (h, dummy, l, d);
+ c += h;
+
+ u = up[i];
+ SUBC_LIMB (c, l, u, c);
+
+ l = (l * di) & GMP_NUMB_MASK;
+ rp[i] = l;
+ }
+ }
+
+ return c;
+}
+
+mp_limb_t
+mpn_bdiv_q_1 (mp_ptr rp, mp_srcptr up, mp_size_t n, mp_limb_t d)
+{
+ mp_limb_t di;
+ int shift;
+
+ ASSERT (n >= 1);
+ ASSERT (d != 0);
+ ASSERT (MPN_SAME_OR_SEPARATE_P (rp, up, n));
+ ASSERT_MPN (up, n);
+ ASSERT_LIMB (d);
+
+ if ((d & 1) == 0)
+ {
+ count_trailing_zeros (shift, d);
+ d >>= shift;
+ }
+ else
+ shift = 0;
+
+ binvert_limb (di, d);
+ return mpn_pi1_bdiv_q_1 (rp, up, n, d, di, shift);
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/bdiv_qr.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/bdiv_qr.c
new file mode 100644
index 00000000000..6a5eedbbc2f
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/bdiv_qr.c
@@ -0,0 +1,85 @@
+/* mpn_bdiv_qr -- Hensel division with precomputed inverse, returning quotient
+ and remainder.
+
+ 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 GMP RELEASE.
+
+Copyright 2006, 2007, 2009, 2012 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.h"
+#include "gmp-impl.h"
+
+
+/* Computes Q = N / D mod B^n,
+ R = N - QD. */
+
+mp_limb_t
+mpn_bdiv_qr (mp_ptr qp, mp_ptr rp,
+ mp_srcptr np, mp_size_t nn,
+ mp_srcptr dp, mp_size_t dn,
+ mp_ptr tp)
+{
+ mp_limb_t di;
+ mp_limb_t rh;
+
+ ASSERT (nn > dn);
+ if (BELOW_THRESHOLD (dn, DC_BDIV_QR_THRESHOLD) ||
+ BELOW_THRESHOLD (nn - dn, DC_BDIV_QR_THRESHOLD))
+ {
+ MPN_COPY (tp, np, nn);
+ binvert_limb (di, dp[0]); di = -di;
+ rh = mpn_sbpi1_bdiv_qr (qp, tp, nn, dp, dn, di);
+ MPN_COPY (rp, tp + nn - dn, dn);
+ }
+ else if (BELOW_THRESHOLD (dn, MU_BDIV_QR_THRESHOLD))
+ {
+ MPN_COPY (tp, np, nn);
+ binvert_limb (di, dp[0]); di = -di;
+ rh = mpn_dcpi1_bdiv_qr (qp, tp, nn, dp, dn, di);
+ MPN_COPY (rp, tp + nn - dn, dn);
+ }
+ else
+ {
+ rh = mpn_mu_bdiv_qr (qp, rp, np, nn, dp, dn, tp);
+ }
+
+ return rh;
+}
+
+mp_size_t
+mpn_bdiv_qr_itch (mp_size_t nn, mp_size_t dn)
+{
+ if (BELOW_THRESHOLD (dn, MU_BDIV_QR_THRESHOLD))
+ return nn;
+ else
+ return mpn_mu_bdiv_qr_itch (nn, dn);
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/binvert.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/binvert.c
new file mode 100644
index 00000000000..be27ea552e7
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/binvert.c
@@ -0,0 +1,102 @@
+/* Compute {up,n}^(-1) mod B^n.
+
+ 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 GMP RELEASE.
+
+Copyright (C) 2004-2007, 2009, 2012 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.h"
+#include "gmp-impl.h"
+
+
+/*
+ r[k+1] = r[k] - r[k] * (u*r[k] - 1)
+ r[k+1] = r[k] + r[k] - r[k]*(u*r[k])
+*/
+
+#if TUNE_PROGRAM_BUILD
+#define NPOWS \
+ ((sizeof(mp_size_t) > 6 ? 48 : 8*sizeof(mp_size_t)))
+#else
+#define NPOWS \
+ ((sizeof(mp_size_t) > 6 ? 48 : 8*sizeof(mp_size_t)) - LOG2C (BINV_NEWTON_THRESHOLD))
+#endif
+
+mp_size_t
+mpn_binvert_itch (mp_size_t n)
+{
+ mp_size_t itch_local = mpn_mulmod_bnm1_next_size (n);
+ mp_size_t itch_out = mpn_mulmod_bnm1_itch (itch_local, n, (n + 1) >> 1);
+ return itch_local + itch_out;
+}
+
+void
+mpn_binvert (mp_ptr rp, mp_srcptr up, mp_size_t n, mp_ptr scratch)
+{
+ mp_ptr xp;
+ mp_size_t rn, newrn;
+ mp_size_t sizes[NPOWS], *sizp;
+ mp_limb_t di;
+
+ /* Compute the computation precisions from highest to lowest, leaving the
+ base case size in 'rn'. */
+ sizp = sizes;
+ for (rn = n; ABOVE_THRESHOLD (rn, BINV_NEWTON_THRESHOLD); rn = (rn + 1) >> 1)
+ *sizp++ = rn;
+
+ xp = scratch;
+
+ /* Compute a base value of rn limbs. */
+ MPN_ZERO (xp, rn);
+ xp[0] = 1;
+ binvert_limb (di, up[0]);
+ if (BELOW_THRESHOLD (rn, DC_BDIV_Q_THRESHOLD))
+ mpn_sbpi1_bdiv_q (rp, xp, rn, up, rn, -di);
+ else
+ mpn_dcpi1_bdiv_q (rp, xp, rn, up, rn, -di);
+
+ /* Use Newton iterations to get the desired precision. */
+ for (; rn < n; rn = newrn)
+ {
+ mp_size_t m;
+ newrn = *--sizp;
+
+ /* X <- UR. */
+ m = mpn_mulmod_bnm1_next_size (newrn);
+ mpn_mulmod_bnm1 (xp, m, up, newrn, rp, rn, xp + m);
+ mpn_sub_1 (xp + m, xp, rn - (m - newrn), 1);
+
+ /* R = R(X/B^rn) */
+ mpn_mullo_n (rp + rn, rp, xp + rn, newrn - rn);
+ mpn_neg (rp + rn, rp + rn, newrn - rn);
+ }
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/broot.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/broot.c
new file mode 100644
index 00000000000..6974ac8b9e8
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/broot.c
@@ -0,0 +1,196 @@
+/* mpn_broot -- Compute hensel sqrt
+
+ Contributed to the GNU project by Niels Möller
+
+ 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 GMP RELEASE.
+
+Copyright 2012 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.h"
+#include "gmp-impl.h"
+
+/* Computes a^e (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)
+{
+ mp_limb_t r = 1;
+ mp_limb_t s = a;
+
+ for (r = 1, s = a; e > 0; e >>= 1, s *= s)
+ if (e & 1)
+ r *= s;
+
+ return r;
+}
+
+/* Computes a^{1/k - 1} (mod B^n). Both a and k must be odd.
+
+ Iterates
+
+ r' <-- r - r * (a^{k-1} r^k - 1) / n
+
+ If
+
+ a^{k-1} r^k = 1 (mod 2^m),
+
+ then
+
+ a^{k-1} r'^k = 1 (mod 2^{2m}),
+
+ Compute the update term as
+
+ r' = r - (a^{k-1} r^{k+1} - r) / k
+
+ where we still have cancellation of low limbs.
+
+ */
+void
+mpn_broot_invm1 (mp_ptr rp, mp_srcptr ap, mp_size_t n, mp_limb_t k)
+{
+ mp_size_t sizes[GMP_LIMB_BITS * 2];
+ mp_ptr akm1, tp, rnp, ep;
+ mp_limb_t a0, r0, km1, kp1h, kinv;
+ mp_size_t rn;
+ unsigned i;
+
+ TMP_DECL;
+
+ ASSERT (n > 0);
+ ASSERT (ap[0] & 1);
+ ASSERT (k & 1);
+ ASSERT (k >= 3);
+
+ TMP_MARK;
+
+ akm1 = TMP_ALLOC_LIMBS (4*n);
+ tp = akm1 + n;
+
+ km1 = k-1;
+ /* FIXME: Could arrange the iteration so we don't need to compute
+ this up front, computing a^{k-1} * r^k as (a r)^{k-1} * r. Note
+ that we can use wraparound also for a*r, since the low half is
+ unchanged from the previous iteration. Or possibly mulmid. Also,
+ a r = a^{1/k}, so we get that value too, for free? */
+ mpn_powlo (akm1, ap, &km1, 1, n, tp); /* 3 n scratch space */
+
+ a0 = ap[0];
+ binvert_limb (kinv, k);
+
+ /* 4 bits: a^{1/k - 1} (mod 16):
+
+ a % 8
+ 1 3 5 7
+ k%4 +-------
+ 1 |1 1 1 1
+ 3 |1 9 9 1
+ */
+ r0 = 1 + (((k << 2) & ((a0 << 1) ^ (a0 << 2))) & 8);
+ r0 = kinv * r0 * (k+1 - akm1[0] * powlimb (r0, k & 0x7f)); /* 8 bits */
+ r0 = kinv * r0 * (k+1 - akm1[0] * powlimb (r0, k & 0x7fff)); /* 16 bits */
+ r0 = kinv * r0 * (k+1 - akm1[0] * powlimb (r0, k)); /* 32 bits */
+#if GMP_NUMB_BITS > 32
+ {
+ unsigned prec = 32;
+ do
+ {
+ r0 = kinv * r0 * (k+1 - akm1[0] * powlimb (r0, k));
+ prec *= 2;
+ }
+ while (prec < GMP_NUMB_BITS);
+ }
+#endif
+
+ rp[0] = r0;
+ if (n == 1)
+ {
+ TMP_FREE;
+ return;
+ }
+
+ /* For odd k, (k+1)/2 = k/2+1, and the latter avoids overflow. */
+ kp1h = k/2 + 1;
+
+ /* FIXME: Special case for two limb iteration. */
+ rnp = TMP_ALLOC_LIMBS (2*n + 1);
+ ep = rnp + n;
+
+ /* FIXME: Possible to this on the fly with some bit fiddling. */
+ for (i = 0; n > 1; n = (n + 1)/2)
+ sizes[i++] = n;
+
+ rn = 1;
+
+ while (i-- > 0)
+ {
+ /* Compute x^{k+1}. */
+ mpn_sqr (ep, rp, rn); /* For odd n, writes n+1 limbs in the
+ final iteration. */
+ mpn_powlo (rnp, ep, &kp1h, 1, sizes[i], tp);
+
+ /* Multiply by a^{k-1}. Can use wraparound; low part equals r. */
+
+ mpn_mullo_n (ep, rnp, akm1, sizes[i]);
+ ASSERT (mpn_cmp (ep, rp, rn) == 0);
+
+ ASSERT (sizes[i] <= 2*rn);
+ mpn_pi1_bdiv_q_1 (rp + rn, ep + rn, sizes[i] - rn, k, kinv, 0);
+ mpn_neg (rp + rn, rp + rn, sizes[i] - rn);
+ rn = sizes[i];
+ }
+ TMP_FREE;
+}
+
+/* Computes a^{1/k} (mod B^n). Both a and k must be odd. */
+void
+mpn_broot (mp_ptr rp, mp_srcptr ap, mp_size_t n, mp_limb_t k)
+{
+ mp_ptr tp;
+ TMP_DECL;
+
+ ASSERT (n > 0);
+ ASSERT (ap[0] & 1);
+ ASSERT (k & 1);
+
+ if (k == 1)
+ {
+ MPN_COPY (rp, ap, n);
+ return;
+ }
+
+ TMP_MARK;
+ tp = TMP_ALLOC_LIMBS (n);
+
+ mpn_broot_invm1 (tp, ap, n, k);
+ mpn_mullo_n (rp, tp, ap, n);
+
+ TMP_FREE;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/brootinv.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/brootinv.c
new file mode 100644
index 00000000000..b96c97f1d36
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/brootinv.c
@@ -0,0 +1,140 @@
+/* mpn_brootinv, compute r such that r^k * y = 1 (mod 2^b).
+
+ Contributed to the GNU project by Martin Boij (as part of perfpow.c).
+
+Copyright 2009, 2010, 2012, 2013 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.h"
+#include "gmp-impl.h"
+
+/* Computes a^e (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)
+{
+ mp_limb_t r;
+
+ for (r = 1; e > 0; e >>= 1, a *= a)
+ if (e & 1)
+ r *= a;
+
+ return r;
+}
+
+/* Compute r such that r^k * y = 1 (mod B^n).
+
+ Iterates
+ r' <-- k^{-1} ((k+1) r - r^{k+1} y) (mod 2^b)
+ using Hensel lifting, each time doubling the number of known bits in r.
+
+ Works just for odd k. Else the Hensel lifting degenerates.
+
+ FIXME:
+
+ (1) Make it work for k == GMP_LIMB_MAX (k+1 below overflows).
+
+ (2) Rewrite iteration as
+ r' <-- r - k^{-1} r (r^k y - 1)
+ and take advantage of the zero low part of r^k y - 1.
+
+ (3) Use wrap-around trick.
+
+ (4) Use a small table to get starting value.
+
+ Scratch need: 5*bn, where bn = ceil (bnb / GMP_NUMB_BITS).
+*/
+
+void
+mpn_brootinv (mp_ptr rp, mp_srcptr yp, mp_size_t bn, mp_limb_t k, mp_ptr tp)
+{
+ mp_ptr tp2, tp3;
+ mp_limb_t kinv, k2, r0, y0;
+ mp_size_t order[GMP_LIMB_BITS + 1];
+ int i, d;
+
+ ASSERT (bn > 0);
+ ASSERT ((k & 1) != 0);
+
+ tp2 = tp + bn;
+ tp3 = tp + 2 * bn;
+ k2 = k + 1;
+
+ binvert_limb (kinv, k);
+
+ /* 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
+ 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 */
+#if GMP_NUMB_BITS > 16
+ {
+ unsigned prec = 16;
+ do
+ {
+ r0 = kinv * (k2 * r0 - y0 * powlimb(r0, k2));
+ prec *= 2;
+ }
+ while (prec < GMP_NUMB_BITS);
+ }
+#endif
+
+ rp[0] = r0;
+ 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)
+ order[d++] = bn;
+
+ for (i = d - 1; i >= 0; i--)
+ {
+ bn = order[i];
+
+ mpn_mul_1 (tp, rp, bn, k2);
+
+ mpn_powlo (tp2, rp, &k2, 1, bn, tp3);
+ mpn_mullo_n (rp, yp, tp2, bn);
+
+ mpn_sub_n (tp2, tp, rp, bn);
+ mpn_pi1_bdiv_q_1 (rp, tp2, bn, k, kinv, 0);
+ }
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/bsqrt.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/bsqrt.c
new file mode 100644
index 00000000000..18ba26f440b
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/bsqrt.c
@@ -0,0 +1,48 @@
+/* mpn_bsqrt, a^{1/2} (mod 2^n).
+
+Copyright 2009, 2010, 2012 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.h"
+#include "gmp-impl.h"
+
+
+void
+mpn_bsqrt (mp_ptr rp, mp_srcptr ap, mp_bitcnt_t nb, mp_ptr tp)
+{
+ mp_ptr sp;
+ mp_size_t n;
+
+ ASSERT (nb > 0);
+
+ n = nb / GMP_NUMB_BITS;
+ sp = tp + n;
+
+ mpn_bsqrtinv (sp, ap, nb, tp);
+ mpn_mullo_n (rp, sp, ap, n);
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/bsqrtinv.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/bsqrtinv.c
new file mode 100644
index 00000000000..33df6a3c158
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/bsqrtinv.c
@@ -0,0 +1,105 @@
+/* mpn_bsqrtinv, compute r such that r^2 * y = 1 (mod 2^{b+1}).
+
+ Contributed to the GNU project by Martin Boij (as part of perfpow.c).
+
+Copyright 2009, 2010, 2012 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.h"
+#include "gmp-impl.h"
+
+/* Compute r such that r^2 * y = 1 (mod 2^{b+1}).
+ Return non-zero if such an integer r exists.
+
+ Iterates
+ r' <-- (3r - r^3 y) / 2
+ using Hensel lifting. Since we divide by two, the Hensel lifting is
+ somewhat degenerates. Therefore, we lift from 2^b to 2^{b+1}-1.
+
+ FIXME:
+ (1) Simplify to do precision book-keeping in limbs rather than bits.
+
+ (2) Rewrite iteration as
+ r' <-- r - r (r^2 y - 1) / 2
+ and take advantage of zero low part of r^2 y - 1.
+
+ (3) Use wrap-around trick.
+
+ (4) Use a small table to get starting value.
+*/
+int
+mpn_bsqrtinv (mp_ptr rp, mp_srcptr yp, mp_bitcnt_t bnb, mp_ptr tp)
+{
+ mp_ptr tp2, tp3;
+ mp_limb_t k;
+ mp_size_t bn, order[GMP_LIMB_BITS + 1];
+ int i, d;
+
+ ASSERT (bnb > 0);
+
+ bn = 1 + bnb / GMP_LIMB_BITS;
+
+ tp2 = tp + bn;
+ tp3 = tp + 2 * bn;
+ k = 3;
+
+ rp[0] = 1;
+ if (bnb == 1)
+ {
+ if ((yp[0] & 3) != 1)
+ return 0;
+ }
+ else
+ {
+ if ((yp[0] & 7) != 1)
+ return 0;
+
+ d = 0;
+ for (; bnb != 2; bnb = (bnb + 2) >> 1)
+ order[d++] = bnb;
+
+ for (i = d - 1; i >= 0; i--)
+ {
+ bnb = order[i];
+ bn = 1 + bnb / GMP_LIMB_BITS;
+
+ mpn_mul_1 (tp, rp, bn, k);
+
+ mpn_powlo (tp2, rp, &k, 1, bn, tp3);
+ mpn_mullo_n (rp, yp, tp2, bn);
+
+#if HAVE_NATIVE_mpn_rsh1sub_n
+ mpn_rsh1sub_n (rp, tp, rp, bn);
+#else
+ mpn_sub_n (tp2, tp, rp, bn);
+ mpn_rshift (rp, tp2, bn, 1);
+#endif
+ }
+ }
+ return 1;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/cmp.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/cmp.c
new file mode 100644
index 00000000000..18c7b428444
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/cmp.c
@@ -0,0 +1,34 @@
+/* mpn_cmp -- Compare two low-level natural-number integers.
+
+Copyright 1991, 1993, 1994, 1996, 2000, 2001 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_FORCE_mpn_cmp 1
+
+#include "gmp.h"
+#include "gmp-impl.h"
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/cnd_add_n.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/cnd_add_n.c
new file mode 100644
index 00000000000..443f9858da5
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/cnd_add_n.c
@@ -0,0 +1,70 @@
+/* mpn_cnd_add_n -- Compute R = U + V if CND != 0 or R = U if CND == 0.
+ Both cases should take the same time and perform the exact same memory
+ accesses, since this function is intended to be used where side-channel
+ attack resilience is relevant.
+
+Copyright 1992-1994, 1996, 2000, 2002, 2008, 2009, 2011, 2013 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.h"
+#include "gmp-impl.h"
+
+mp_limb_t
+mpn_cnd_add_n (mp_limb_t cnd, mp_ptr rp, mp_srcptr up, mp_srcptr vp, mp_size_t n)
+{
+ mp_limb_t ul, vl, sl, rl, cy, cy1, cy2, mask;
+
+ ASSERT (n >= 1);
+ ASSERT (MPN_SAME_OR_SEPARATE_P (rp, up, n));
+ ASSERT (MPN_SAME_OR_SEPARATE_P (rp, vp, n));
+
+ mask = -(mp_limb_t) (cnd != 0);
+ cy = 0;
+ do
+ {
+ ul = *up++;
+ vl = *vp++ & mask;
+#if GMP_NAIL_BITS == 0
+ sl = ul + vl;
+ cy1 = sl < ul;
+ rl = sl + cy;
+ cy2 = rl < sl;
+ cy = cy1 | cy2;
+ *rp++ = rl;
+#else
+ rl = ul + vl;
+ rl += cy;
+ cy = rl >> GMP_NUMB_BITS;
+ *rp++ = rl & GMP_NUMB_MASK;
+#endif
+ }
+ while (--n != 0);
+
+ return cy;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/cnd_sub_n.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/cnd_sub_n.c
new file mode 100644
index 00000000000..bd8e029a36f
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/cnd_sub_n.c
@@ -0,0 +1,70 @@
+/* mpn_cnd_sub_n -- Compute R = U - V if CND != 0 or R = U if CND == 0.
+ Both cases should take the same time and perform the exact same memory
+ accesses, since this function is intended to be used where side-channel
+ attack resilience is relevant.
+
+Copyright 1992-1994, 1996, 2000, 2002, 2008, 2009, 2011, 2013 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.h"
+#include "gmp-impl.h"
+
+mp_limb_t
+mpn_cnd_sub_n (mp_limb_t cnd, mp_ptr rp, mp_srcptr up, mp_srcptr vp, mp_size_t n)
+{
+ mp_limb_t ul, vl, sl, rl, cy, cy1, cy2, mask;
+
+ ASSERT (n >= 1);
+ ASSERT (MPN_SAME_OR_SEPARATE_P (rp, up, n));
+ ASSERT (MPN_SAME_OR_SEPARATE_P (rp, vp, n));
+
+ mask = -(mp_limb_t) (cnd != 0);
+ cy = 0;
+ do
+ {
+ ul = *up++;
+ vl = *vp++ & mask;
+#if GMP_NAIL_BITS == 0
+ sl = ul - vl;
+ cy1 = sl > ul;
+ rl = sl - cy;
+ cy2 = rl > sl;
+ cy = cy1 | cy2;
+ *rp++ = rl;
+#else
+ rl = ul - vl;
+ rl -= cy;
+ cy = rl >> (GMP_LIMB_BITS - 1);
+ *rp++ = rl & GMP_NUMB_MASK;
+#endif
+ }
+ while (--n != 0);
+
+ return cy;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/com.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/com.c
new file mode 100644
index 00000000000..cd8551df5ba
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/com.c
@@ -0,0 +1,45 @@
+/* mpn_com - complement an mpn.
+
+Copyright 2009 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.h"
+#include "gmp-impl.h"
+
+#undef mpn_com
+#define mpn_com __MPN(com)
+
+void
+mpn_com (mp_ptr rp, mp_srcptr up, mp_size_t n)
+{
+ mp_limb_t ul;
+ do {
+ ul = *up++;
+ *rp++ = ~ul & GMP_NUMB_MASK;
+ } while (--n != 0);
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/comb_tables.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/comb_tables.c
new file mode 100644
index 00000000000..41bcb5f879d
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/comb_tables.c
@@ -0,0 +1,48 @@
+/* Const tables shared among combinatoric functions.
+
+ 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 2012 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.h"
+#include "gmp-impl.h"
+
+/* Entry i contains (i!/2^t) where t is chosen such that the parenthesis
+ is an odd integer. */
+const mp_limb_t __gmp_oddfac_table[] = { ONE_LIMB_ODD_FACTORIAL_TABLE, ONE_LIMB_ODD_FACTORIAL_EXTTABLE };
+
+/* Entry i contains ((2i+1)!!/2^t) where t is chosen such that the parenthesis
+ is an odd integer. */
+const mp_limb_t __gmp_odd2fac_table[] = { ONE_LIMB_ODD_DOUBLEFACTORIAL_TABLE };
+
+/* Entry i contains 2i-popc(2i). */
+const unsigned char __gmp_fac2cnt_table[] = { TABLE_2N_MINUS_POPC_2N };
+
+const mp_limb_t __gmp_limbroots_table[] = { NTH_ROOT_NUMB_MASK_TABLE };
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/copyd.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/copyd.c
new file mode 100644
index 00000000000..ba3380a82bb
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/copyd.c
@@ -0,0 +1,41 @@
+/* mpn_copyd
+
+Copyright 2009 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.h"
+#include "gmp-impl.h"
+
+void
+mpn_copyd (mp_ptr rp, mp_srcptr up, mp_size_t n)
+{
+ mp_size_t i;
+
+ for (i = n - 1; i >= 0; i--)
+ rp[i] = up[i];
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/copyi.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/copyi.c
new file mode 100644
index 00000000000..0c39b4534bb
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/copyi.c
@@ -0,0 +1,43 @@
+/* mpn_copyi
+
+Copyright 2009 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.h"
+#include "gmp-impl.h"
+
+void
+mpn_copyi (mp_ptr rp, mp_srcptr up, mp_size_t n)
+{
+ mp_size_t i;
+
+ up += n;
+ rp += n;
+ for (i = -n; i != 0; i++)
+ rp[i] = up[i];
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/dcpi1_bdiv_q.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/dcpi1_bdiv_q.c
new file mode 100644
index 00000000000..a7b86c96d44
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/dcpi1_bdiv_q.c
@@ -0,0 +1,160 @@
+/* mpn_dcpi1_bdiv_q -- divide-and-conquer Hensel division with precomputed
+ inverse, returning quotient.
+
+ Contributed to the GNU project by Niels Möller and 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 GMP RELEASE.
+
+Copyright 2006, 2007, 2009-2011 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.h"
+#include "gmp-impl.h"
+
+
+mp_size_t
+mpn_dcpi1_bdiv_q_n_itch (mp_size_t n)
+{
+ /* NOTE: Depends on mullo_n interface */
+ return n;
+}
+
+/* Computes Q = N / D mod B^n, destroys N.
+
+ N = {np,n}
+ D = {dp,n}
+*/
+
+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)
+{
+ while (ABOVE_THRESHOLD (n, DC_BDIV_Q_THRESHOLD))
+ {
+ mp_size_t lo, hi;
+ mp_limb_t cy;
+
+ lo = n >> 1; /* floor(n/2) */
+ hi = n - lo; /* ceil(n/2) */
+
+ 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);
+
+ if (lo < hi)
+ {
+ cy += mpn_submul_1 (np + lo, qp, lo, dp[lo]);
+ np[n - 1] -= cy;
+ }
+ qp += lo;
+ np += lo;
+ n -= lo;
+ }
+ mpn_sbpi1_bdiv_q (qp, np, n, dp, n, dinv);
+}
+
+/* Computes Q = N / D mod B^nn, destroys N.
+
+ N = {np,nn}
+ D = {dp,dn}
+*/
+
+void
+mpn_dcpi1_bdiv_q (mp_ptr qp,
+ mp_ptr np, mp_size_t nn,
+ mp_srcptr dp, mp_size_t dn,
+ mp_limb_t dinv)
+{
+ mp_size_t qn;
+ mp_limb_t cy;
+ mp_ptr tp;
+ TMP_DECL;
+
+ TMP_MARK;
+
+ ASSERT (dn >= 2);
+ ASSERT (nn - dn >= 0);
+ ASSERT (dp[0] & 1);
+
+ tp = TMP_SALLOC_LIMBS (dn);
+
+ qn = nn;
+
+ if (qn > dn)
+ {
+ /* Reduce qn mod dn in a super-efficient manner. */
+ do
+ qn -= dn;
+ while (qn > dn);
+
+ /* Perform the typically smaller block first. */
+ if (BELOW_THRESHOLD (qn, DC_BDIV_QR_THRESHOLD))
+ cy = mpn_sbpi1_bdiv_qr (qp, np, 2 * qn, dp, qn, dinv);
+ else
+ cy = mpn_dcpi1_bdiv_qr_n (qp, np, dp, qn, dinv, tp);
+
+ if (qn != dn)
+ {
+ if (qn > dn - qn)
+ mpn_mul (tp, qp, qn, dp + qn, dn - qn);
+ else
+ 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);
+ cy = 0;
+ }
+
+ np += qn;
+ qp += qn;
+
+ qn = nn - qn;
+ while (qn > dn)
+ {
+ mpn_sub_1 (np + dn, np + dn, qn - dn, cy);
+ cy = mpn_dcpi1_bdiv_qr_n (qp, np, dp, dn, dinv, tp);
+ qp += dn;
+ np += dn;
+ qn -= dn;
+ }
+ mpn_dcpi1_bdiv_q_n (qp, np, dp, dn, dinv, tp);
+ }
+ else
+ {
+ if (BELOW_THRESHOLD (qn, DC_BDIV_Q_THRESHOLD))
+ mpn_sbpi1_bdiv_q (qp, np, qn, dp, qn, dinv);
+ else
+ mpn_dcpi1_bdiv_q_n (qp, np, dp, qn, dinv, tp);
+ }
+
+ TMP_FREE;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/dcpi1_bdiv_qr.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/dcpi1_bdiv_qr.c
new file mode 100644
index 00000000000..8a251f8d9d8
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/dcpi1_bdiv_qr.c
@@ -0,0 +1,177 @@
+/* mpn_dcpi1_bdiv_qr -- divide-and-conquer Hensel division with precomputed
+ inverse, returning quotient and remainder.
+
+ Contributed to the GNU project by Niels Möller and 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 GMP RELEASE.
+
+Copyright 2006, 2007, 2009, 2010 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.h"
+#include "gmp-impl.h"
+
+
+/* Computes Hensel binary division of {np, 2*n} by {dp, n}.
+
+ Output:
+
+ q = n * d^{-1} mod 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.
+
+ d must be odd. dinv is (-d)^-1 mod 2^GMP_NUMB_BITS. */
+
+mp_size_t
+mpn_dcpi1_bdiv_qr_n_itch (mp_size_t n)
+{
+ return n;
+}
+
+mp_limb_t
+mpn_dcpi1_bdiv_qr_n (mp_ptr qp, mp_ptr np, mp_srcptr dp, mp_size_t n,
+ mp_limb_t dinv, mp_ptr tp)
+{
+ mp_size_t lo, hi;
+ mp_limb_t cy;
+ mp_limb_t rh;
+
+ lo = n >> 1; /* floor(n/2) */
+ hi = n - lo; /* ceil(n/2) */
+
+ if (BELOW_THRESHOLD (lo, DC_BDIV_QR_THRESHOLD))
+ cy = mpn_sbpi1_bdiv_qr (qp, np, 2 * lo, dp, lo, dinv);
+ else
+ cy = mpn_dcpi1_bdiv_qr_n (qp, np, dp, lo, dinv, tp);
+
+ 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);
+
+ if (BELOW_THRESHOLD (hi, DC_BDIV_QR_THRESHOLD))
+ cy = mpn_sbpi1_bdiv_qr (qp + lo, np + lo, 2 * hi, dp, hi, dinv);
+ else
+ cy = mpn_dcpi1_bdiv_qr_n (qp + lo, np + lo, dp, hi, dinv, tp);
+
+ 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);
+
+ return rh;
+}
+
+mp_limb_t
+mpn_dcpi1_bdiv_qr (mp_ptr qp, mp_ptr np, mp_size_t nn,
+ mp_srcptr dp, mp_size_t dn, mp_limb_t dinv)
+{
+ mp_size_t qn;
+ mp_limb_t rr, cy;
+ mp_ptr tp;
+ TMP_DECL;
+
+ TMP_MARK;
+
+ ASSERT (dn >= 2); /* to adhere to mpn_sbpi1_div_qr's limits */
+ ASSERT (nn - dn >= 1); /* to adhere to mpn_sbpi1_div_qr's limits */
+ ASSERT (dp[0] & 1);
+
+ tp = TMP_SALLOC_LIMBS (dn);
+
+ qn = nn - dn;
+
+ if (qn > dn)
+ {
+ /* Reduce qn mod dn without division, optimizing small operations. */
+ do
+ qn -= dn;
+ while (qn > dn);
+
+ /* Perform the typically smaller block first. */
+ if (BELOW_THRESHOLD (qn, DC_BDIV_QR_THRESHOLD))
+ cy = mpn_sbpi1_bdiv_qr (qp, np, 2 * qn, dp, qn, dinv);
+ else
+ cy = mpn_dcpi1_bdiv_qr_n (qp, np, dp, qn, dinv, tp);
+
+ rr = 0;
+ if (qn != dn)
+ {
+ if (qn > dn - qn)
+ mpn_mul (tp, qp, qn, dp + qn, dn - qn);
+ else
+ 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);
+ cy = 0;
+ }
+
+ np += qn;
+ qp += qn;
+
+ qn = nn - dn - qn;
+ do
+ {
+ rr += mpn_sub_1 (np + dn, np + dn, qn, cy);
+ cy = mpn_dcpi1_bdiv_qr_n (qp, np, dp, dn, dinv, tp);
+ qp += dn;
+ np += dn;
+ qn -= dn;
+ }
+ while (qn > 0);
+ TMP_FREE;
+ return rr + cy;
+ }
+
+ if (BELOW_THRESHOLD (qn, DC_BDIV_QR_THRESHOLD))
+ cy = mpn_sbpi1_bdiv_qr (qp, np, 2 * qn, dp, qn, dinv);
+ else
+ cy = mpn_dcpi1_bdiv_qr_n (qp, np, dp, qn, dinv, tp);
+
+ rr = 0;
+ if (qn != dn)
+ {
+ if (qn > dn - qn)
+ mpn_mul (tp, qp, qn, dp + qn, dn - qn);
+ else
+ 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);
+ cy = 0;
+ }
+
+ TMP_FREE;
+ return rr + cy;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/dcpi1_div_q.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/dcpi1_div_q.c
new file mode 100644
index 00000000000..32d74c31a9f
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/dcpi1_div_q.c
@@ -0,0 +1,87 @@
+/* mpn_dc_div_q -- divide-and-conquer division, returning exact quotient
+ only.
+
+ Contributed to the GNU project by Torbjorn Granlund and Marco Bodrato.
+
+ THE FUNCTION IN THIS FILE IS INTERNAL WITH A MUTABLE INTERFACE. IT IS ONLY
+ 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 2006, 2007, 2009, 2010 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.h"
+#include "gmp-impl.h"
+
+
+mp_limb_t
+mpn_dcpi1_div_q (mp_ptr qp, mp_ptr np, mp_size_t nn,
+ mp_srcptr dp, mp_size_t dn, gmp_pi1_t *dinv)
+{
+ mp_ptr tp, wp;
+ mp_limb_t qh;
+ mp_size_t qn;
+ TMP_DECL;
+
+ TMP_MARK;
+
+ ASSERT (dn >= 6);
+ ASSERT (nn - dn >= 3);
+ ASSERT (dp[dn-1] & GMP_NUMB_HIGHBIT);
+
+ tp = TMP_SALLOC_LIMBS (nn + 1);
+ MPN_COPY (tp + 1, np, nn);
+ tp[0] = 0;
+
+ qn = nn - dn;
+ wp = TMP_SALLOC_LIMBS (qn + 1);
+
+ qh = mpn_dcpi1_divappr_q (wp, tp, nn + 1, dp, dn, dinv);
+
+ if (wp[0] == 0)
+ {
+ mp_limb_t cy;
+
+ if (qn > dn)
+ mpn_mul (tp, wp + 1, qn, dp, dn);
+ else
+ mpn_mul (tp, dp, dn, wp + 1, qn);
+
+ cy = (qh != 0) ? mpn_add_n (tp + qn, tp + qn, dp, dn) : 0;
+
+ if (cy || mpn_cmp (tp, np, nn) > 0) /* At most is wrong by one, no cycle. */
+ qh -= mpn_sub_1 (qp, wp + 1, qn, 1);
+ else /* Same as below */
+ MPN_COPY (qp, wp + 1, qn);
+ }
+ else
+ MPN_COPY (qp, wp + 1, qn);
+
+ TMP_FREE;
+ return qh;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/dcpi1_div_qr.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/dcpi1_div_qr.c
new file mode 100644
index 00000000000..4d80c7b7692
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/dcpi1_div_qr.c
@@ -0,0 +1,249 @@
+/* mpn_dcpi1_div_qr_n -- recursive divide-and-conquer division for arbitrary
+ size operands.
+
+ 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 GMP RELEASE.
+
+Copyright 2006, 2007, 2009 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.h"
+#include "gmp-impl.h"
+#include "longlong.h"
+
+
+mp_limb_t
+mpn_dcpi1_div_qr_n (mp_ptr qp, mp_ptr np, mp_srcptr dp, mp_size_t n,
+ gmp_pi1_t *dinv, mp_ptr tp)
+{
+ mp_size_t lo, hi;
+ mp_limb_t cy, qh, ql;
+
+ lo = n >> 1; /* floor(n/2) */
+ hi = n - lo; /* ceil(n/2) */
+
+ if (BELOW_THRESHOLD (hi, DC_DIV_QR_THRESHOLD))
+ qh = mpn_sbpi1_div_qr (qp + lo, np + 2 * lo, 2 * hi, dp + lo, hi, dinv->inv32);
+ else
+ qh = mpn_dcpi1_div_qr_n (qp + lo, np + 2 * lo, dp + lo, hi, dinv, tp);
+
+ mpn_mul (tp, qp + lo, hi, dp, lo);
+
+ cy = mpn_sub_n (np + lo, np + lo, tp, n);
+ if (qh != 0)
+ cy += mpn_sub_n (np + n, np + n, dp, lo);
+
+ while (cy != 0)
+ {
+ qh -= mpn_sub_1 (qp + lo, qp + lo, hi, 1);
+ cy -= mpn_add_n (np + lo, np + lo, dp, n);
+ }
+
+ if (BELOW_THRESHOLD (lo, DC_DIV_QR_THRESHOLD))
+ ql = mpn_sbpi1_div_qr (qp, np + hi, 2 * lo, dp + hi, lo, dinv->inv32);
+ else
+ ql = mpn_dcpi1_div_qr_n (qp, np + hi, dp + hi, lo, dinv, tp);
+
+ mpn_mul (tp, dp, hi, qp, lo);
+
+ cy = mpn_sub_n (np, np, tp, n);
+ if (ql != 0)
+ cy += mpn_sub_n (np + lo, np + lo, dp, hi);
+
+ while (cy != 0)
+ {
+ mpn_sub_1 (qp, qp, lo, 1);
+ cy -= mpn_add_n (np, np, dp, n);
+ }
+
+ return qh;
+}
+
+mp_limb_t
+mpn_dcpi1_div_qr (mp_ptr qp,
+ mp_ptr np, mp_size_t nn,
+ mp_srcptr dp, mp_size_t dn,
+ gmp_pi1_t *dinv)
+{
+ mp_size_t qn;
+ mp_limb_t qh, cy;
+ mp_ptr tp;
+ TMP_DECL;
+
+ TMP_MARK;
+
+ ASSERT (dn >= 6); /* to adhere to mpn_sbpi1_div_qr's limits */
+ ASSERT (nn - dn >= 3); /* to adhere to mpn_sbpi1_div_qr's limits */
+ ASSERT (dp[dn-1] & GMP_NUMB_HIGHBIT);
+
+ tp = TMP_SALLOC_LIMBS (dn);
+
+ qn = nn - dn;
+ qp += qn;
+ np += nn;
+ dp += dn;
+
+ if (qn > dn)
+ {
+ /* Reduce qn mod dn without division, optimizing small operations. */
+ do
+ qn -= dn;
+ while (qn > dn);
+
+ qp -= qn; /* point at low limb of next quotient block */
+ np -= qn; /* point in the middle of partial remainder */
+
+ /* Perform the typically smaller block first. */
+ if (qn == 1)
+ {
+ mp_limb_t q, n2, n1, n0, d1, d0;
+
+ /* Handle qh up front, for simplicity. */
+ qh = mpn_cmp (np - dn + 1, dp - dn, dn) >= 0;
+ if (qh)
+ ASSERT_NOCARRY (mpn_sub_n (np - dn + 1, np - dn + 1, dp - dn, dn));
+
+ /* A single iteration of schoolbook: One 3/2 division,
+ followed by the bignum update and adjustment. */
+ n2 = np[0];
+ n1 = np[-1];
+ n0 = np[-2];
+ d1 = dp[-1];
+ d0 = dp[-2];
+
+ ASSERT (n2 < d1 || (n2 == d1 && n1 <= d0));
+
+ if (UNLIKELY (n2 == d1) && n1 == d0)
+ {
+ q = GMP_NUMB_MASK;
+ cy = mpn_submul_1 (np - dn, dp - dn, dn, q);
+ ASSERT (cy == n2);
+ }
+ else
+ {
+ udiv_qr_3by2 (q, n1, n0, n2, n1, n0, d1, d0, dinv->inv32);
+
+ if (dn > 2)
+ {
+ mp_limb_t cy, cy1;
+ cy = mpn_submul_1 (np - dn, dp - dn, dn - 2, q);
+
+ cy1 = n0 < cy;
+ n0 = (n0 - cy) & GMP_NUMB_MASK;
+ cy = n1 < cy1;
+ n1 = (n1 - cy1) & GMP_NUMB_MASK;
+ np[-2] = n0;
+
+ if (UNLIKELY (cy != 0))
+ {
+ n1 += d1 + mpn_add_n (np - dn, np - dn, dp - dn, dn - 1);
+ qh -= (q == 0);
+ q = (q - 1) & GMP_NUMB_MASK;
+ }
+ }
+ else
+ np[-2] = n0;
+
+ np[-1] = n1;
+ }
+ qp[0] = q;
+ }
+ else
+ {
+ /* Do a 2qn / qn division */
+ if (qn == 2)
+ qh = mpn_divrem_2 (qp, 0L, np - 2, 4, dp - 2); /* FIXME: obsolete function. Use 5/3 division? */
+ else if (BELOW_THRESHOLD (qn, DC_DIV_QR_THRESHOLD))
+ qh = mpn_sbpi1_div_qr (qp, np - qn, 2 * qn, dp - qn, qn, dinv->inv32);
+ else
+ qh = mpn_dcpi1_div_qr_n (qp, np - qn, dp - qn, qn, dinv, tp);
+
+ if (qn != dn)
+ {
+ if (qn > dn - qn)
+ mpn_mul (tp, qp, qn, dp - dn, dn - qn);
+ else
+ mpn_mul (tp, dp - dn, dn - qn, qp, qn);
+
+ cy = mpn_sub_n (np - dn, np - dn, tp, dn);
+ if (qh != 0)
+ cy += mpn_sub_n (np - dn + qn, np - dn + qn, dp - dn, dn - qn);
+
+ while (cy != 0)
+ {
+ qh -= mpn_sub_1 (qp, qp, qn, 1);
+ cy -= mpn_add_n (np - dn, np - dn, dp - dn, dn);
+ }
+ }
+ }
+
+ qn = nn - dn - qn;
+ do
+ {
+ qp -= dn;
+ np -= dn;
+ mpn_dcpi1_div_qr_n (qp, np - dn, dp - dn, dn, dinv, tp);
+ qn -= dn;
+ }
+ while (qn > 0);
+ }
+ else
+ {
+ qp -= qn; /* point at low limb of next quotient block */
+ np -= qn; /* point in the middle of partial remainder */
+
+ if (BELOW_THRESHOLD (qn, DC_DIV_QR_THRESHOLD))
+ qh = mpn_sbpi1_div_qr (qp, np - qn, 2 * qn, dp - qn, qn, dinv->inv32);
+ else
+ qh = mpn_dcpi1_div_qr_n (qp, np - qn, dp - qn, qn, dinv, tp);
+
+ if (qn != dn)
+ {
+ if (qn > dn - qn)
+ mpn_mul (tp, qp, qn, dp - dn, dn - qn);
+ else
+ mpn_mul (tp, dp - dn, dn - qn, qp, qn);
+
+ cy = mpn_sub_n (np - dn, np - dn, tp, dn);
+ if (qh != 0)
+ cy += mpn_sub_n (np - dn + qn, np - dn + qn, dp - dn, dn - qn);
+
+ while (cy != 0)
+ {
+ qh -= mpn_sub_1 (qp, qp, qn, 1);
+ cy -= mpn_add_n (np - dn, np - dn, dp - dn, dn);
+ }
+ }
+ }
+
+ TMP_FREE;
+ return qh;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/dcpi1_divappr_q.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/dcpi1_divappr_q.c
new file mode 100644
index 00000000000..c7b03c7f496
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/dcpi1_divappr_q.c
@@ -0,0 +1,257 @@
+/* mpn_dcpi1_divappr_q -- divide-and-conquer division, returning approximate
+ quotient. The quotient returned is either correct, or one too large.
+
+ 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 GMP RELEASE.
+
+Copyright 2006, 2007, 2009, 2010 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.h"
+#include "gmp-impl.h"
+#include "longlong.h"
+
+
+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)
+{
+ mp_size_t lo, hi;
+ mp_limb_t cy, qh, ql;
+
+ lo = n >> 1; /* floor(n/2) */
+ hi = n - lo; /* ceil(n/2) */
+
+ if (BELOW_THRESHOLD (hi, DC_DIV_QR_THRESHOLD))
+ qh = mpn_sbpi1_div_qr (qp + lo, np + 2 * lo, 2 * hi, dp + lo, hi, dinv->inv32);
+ else
+ qh = mpn_dcpi1_div_qr_n (qp + lo, np + 2 * lo, dp + lo, hi, dinv, tp);
+
+ mpn_mul (tp, qp + lo, hi, dp, lo);
+
+ cy = mpn_sub_n (np + lo, np + lo, tp, n);
+ if (qh != 0)
+ cy += mpn_sub_n (np + n, np + n, dp, lo);
+
+ while (cy != 0)
+ {
+ qh -= mpn_sub_1 (qp + lo, qp + lo, hi, 1);
+ cy -= mpn_add_n (np + lo, np + lo, dp, n);
+ }
+
+ if (BELOW_THRESHOLD (lo, DC_DIVAPPR_Q_THRESHOLD))
+ ql = mpn_sbpi1_divappr_q (qp, np + hi, 2 * lo, dp + hi, lo, dinv->inv32);
+ else
+ ql = mpn_dcpi1_divappr_q_n (qp, np + hi, dp + hi, lo, dinv, tp);
+
+ if (UNLIKELY (ql != 0))
+ {
+ mp_size_t i;
+ for (i = 0; i < lo; i++)
+ qp[i] = GMP_NUMB_MASK;
+ }
+
+ return qh;
+}
+
+mp_limb_t
+mpn_dcpi1_divappr_q (mp_ptr qp, mp_ptr np, mp_size_t nn,
+ mp_srcptr dp, mp_size_t dn, gmp_pi1_t *dinv)
+{
+ mp_size_t qn;
+ mp_limb_t qh, cy, qsave;
+ mp_ptr tp;
+ TMP_DECL;
+
+ TMP_MARK;
+
+ ASSERT (dn >= 6);
+ ASSERT (nn > dn);
+ ASSERT (dp[dn-1] & GMP_NUMB_HIGHBIT);
+
+ qn = nn - dn;
+ qp += qn;
+ np += nn;
+ dp += dn;
+
+ if (qn >= dn)
+ {
+ qn++; /* pretend we'll need an extra limb */
+ /* Reduce qn mod dn without division, optimizing small operations. */
+ do
+ qn -= dn;
+ while (qn > dn);
+
+ qp -= qn; /* point at low limb of next quotient block */
+ np -= qn; /* point in the middle of partial remainder */
+
+ tp = TMP_SALLOC_LIMBS (dn);
+
+ /* Perform the typically smaller block first. */
+ if (qn == 1)
+ {
+ mp_limb_t q, n2, n1, n0, d1, d0;
+
+ /* Handle qh up front, for simplicity. */
+ qh = mpn_cmp (np - dn + 1, dp - dn, dn) >= 0;
+ if (qh)
+ ASSERT_NOCARRY (mpn_sub_n (np - dn + 1, np - dn + 1, dp - dn, dn));
+
+ /* A single iteration of schoolbook: One 3/2 division,
+ followed by the bignum update and adjustment. */
+ n2 = np[0];
+ n1 = np[-1];
+ n0 = np[-2];
+ d1 = dp[-1];
+ d0 = dp[-2];
+
+ ASSERT (n2 < d1 || (n2 == d1 && n1 <= d0));
+
+ if (UNLIKELY (n2 == d1) && n1 == d0)
+ {
+ q = GMP_NUMB_MASK;
+ cy = mpn_submul_1 (np - dn, dp - dn, dn, q);
+ ASSERT (cy == n2);
+ }
+ else
+ {
+ udiv_qr_3by2 (q, n1, n0, n2, n1, n0, d1, d0, dinv->inv32);
+
+ if (dn > 2)
+ {
+ mp_limb_t cy, cy1;
+ cy = mpn_submul_1 (np - dn, dp - dn, dn - 2, q);
+
+ cy1 = n0 < cy;
+ n0 = (n0 - cy) & GMP_NUMB_MASK;
+ cy = n1 < cy1;
+ n1 = (n1 - cy1) & GMP_NUMB_MASK;
+ np[-2] = n0;
+
+ if (UNLIKELY (cy != 0))
+ {
+ n1 += d1 + mpn_add_n (np - dn, np - dn, dp - dn, dn - 1);
+ qh -= (q == 0);
+ q = (q - 1) & GMP_NUMB_MASK;
+ }
+ }
+ else
+ np[-2] = n0;
+
+ np[-1] = n1;
+ }
+ qp[0] = q;
+ }
+ else
+ {
+ if (qn == 2)
+ qh = mpn_divrem_2 (qp, 0L, np - 2, 4, dp - 2);
+ else if (BELOW_THRESHOLD (qn, DC_DIV_QR_THRESHOLD))
+ qh = mpn_sbpi1_div_qr (qp, np - qn, 2 * qn, dp - qn, qn, dinv->inv32);
+ else
+ qh = mpn_dcpi1_div_qr_n (qp, np - qn, dp - qn, qn, dinv, tp);
+
+ if (qn != dn)
+ {
+ if (qn > dn - qn)
+ mpn_mul (tp, qp, qn, dp - dn, dn - qn);
+ else
+ mpn_mul (tp, dp - dn, dn - qn, qp, qn);
+
+ cy = mpn_sub_n (np - dn, np - dn, tp, dn);
+ if (qh != 0)
+ cy += mpn_sub_n (np - dn + qn, np - dn + qn, dp - dn, dn - qn);
+
+ while (cy != 0)
+ {
+ qh -= mpn_sub_1 (qp, qp, qn, 1);
+ cy -= mpn_add_n (np - dn, np - dn, dp - dn, dn);
+ }
+ }
+ }
+ qn = nn - dn - qn + 1;
+ while (qn > dn)
+ {
+ qp -= dn;
+ np -= dn;
+ mpn_dcpi1_div_qr_n (qp, np - dn, dp - dn, dn, dinv, tp);
+ qn -= dn;
+ }
+
+ /* Since we pretended we'd need an extra quotient limb before, we now
+ have made sure the code above left just dn-1=qn quotient limbs to
+ develop. Develop that plus a guard limb. */
+ qn--;
+ qp -= qn;
+ np -= dn;
+ qsave = qp[qn];
+ mpn_dcpi1_divappr_q_n (qp, np - dn, dp - dn, dn, dinv, tp);
+ MPN_COPY_INCR (qp, qp + 1, qn);
+ qp[qn] = qsave;
+ }
+ else /* (qn < dn) */
+ {
+ mp_ptr q2p;
+#if 0 /* not possible since we demand nn > dn */
+ if (qn == 0)
+ {
+ qh = mpn_cmp (np - dn, dp - dn, dn) >= 0;
+ if (qh)
+ mpn_sub_n (np - dn, np - dn, dp - dn, dn);
+ TMP_FREE;
+ return qh;
+ }
+#endif
+
+ qp -= qn; /* point at low limb of next quotient block */
+ np -= qn; /* point in the middle of partial remainder */
+
+ q2p = TMP_SALLOC_LIMBS (qn + 1);
+ /* Should we at all check DC_DIVAPPR_Q_THRESHOLD here, or reply on
+ callers not to be silly? */
+ if (BELOW_THRESHOLD (qn, DC_DIVAPPR_Q_THRESHOLD))
+ {
+ qh = mpn_sbpi1_divappr_q (q2p, np - qn - 2, 2 * (qn + 1),
+ dp - (qn + 1), qn + 1, dinv->inv32);
+ }
+ else
+ {
+ /* It is tempting to use qp for recursive scratch and put quotient in
+ tp, but the recursive scratch needs one limb too many. */
+ tp = TMP_SALLOC_LIMBS (qn + 1);
+ qh = mpn_dcpi1_divappr_q_n (q2p, np - qn - 2, dp - (qn + 1), qn + 1, dinv, tp);
+ }
+ MPN_COPY (qp, q2p + 1, qn);
+ }
+
+ TMP_FREE;
+ return qh;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/div_q.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/div_q.c
new file mode 100644
index 00000000000..aabcef08254
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/div_q.c
@@ -0,0 +1,323 @@
+/* mpn_div_q -- division for arbitrary size operands.
+
+ Contributed to the GNU project by Torbjorn Granlund.
+
+ THE FUNCTION IN THIS FILE IS INTERNAL WITH A MUTABLE INTERFACE. IT IS ONLY
+ 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.
+
+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.h"
+#include "gmp-impl.h"
+#include "longlong.h"
+
+
+/* Compute Q = N/D with truncation.
+ N = {np,nn}
+ D = {dp,dn}
+ Q = {qp,nn-dn+1}
+ T = {scratch,nn+1} is scratch space
+ N and D are both untouched by the computation.
+ N and T may overlap; pass the same space if N is irrelevant after the call,
+ but note that tp needs an extra limb.
+
+ Operand requirements:
+ N >= D > 0
+ dp[dn-1] != 0
+ No overlap between the N, D, and Q areas.
+
+ This division function does not clobber its input operands, since it is
+ intended to support average-O(qn) division, and for that to be effective, it
+ cannot put requirements on callers to copy a O(nn) operand.
+
+ If a caller does not care about the value of {np,nn+1} after calling this
+ function, it should pass np also for the scratch argument. This function
+ will then save some time and space by avoiding allocation and copying.
+ (FIXME: Is this a good design? We only really save any copying for
+ already-normalised divisors, which should be rare. It also prevents us from
+ reasonably asking for all scratch space we need.)
+
+ We write nn-dn+1 limbs for the quotient, but return void. Why not return
+ the most significant quotient limb? Look at the 4 main code blocks below
+ (consisting of an outer if-else where each arm contains an if-else). It is
+ tricky for the first code block, since the mpn_*_div_q calls will typically
+ generate all nn-dn+1 and return 0 or 1. I don't see how to fix that unless
+ we generate the most significant quotient limb here, before calling
+ mpn_*_div_q, or put the quotient in a temporary area. Since this is a
+ critical division case (the SB sub-case in particular) copying is not a good
+ idea.
+
+ It might make sense to split the if-else parts of the (qn + FUDGE
+ >= dn) blocks into separate functions, since we could promise quite
+ different things to callers in these two cases. The 'then' case
+ benefits from np=scratch, and it could perhaps even tolerate qp=np,
+ saving some headache for many callers.
+
+ FIXME: Scratch allocation leaves a lot to be desired. E.g., for the MU size
+ operands, we do not reuse the huge scratch for adjustments. This can be a
+ serious waste of memory for the largest operands.
+*/
+
+/* FUDGE determines when to try getting an approximate quotient from the upper
+ parts of the dividend and divisor, then adjust. N.B. FUDGE must be >= 2
+ for the code to be correct. */
+#define FUDGE 5 /* FIXME: tune this */
+
+#define DC_DIV_Q_THRESHOLD DC_DIVAPPR_Q_THRESHOLD
+#define MU_DIV_Q_THRESHOLD MU_DIVAPPR_Q_THRESHOLD
+#define MUPI_DIV_Q_THRESHOLD MUPI_DIVAPPR_Q_THRESHOLD
+#ifndef MUPI_DIVAPPR_Q_THRESHOLD
+#define MUPI_DIVAPPR_Q_THRESHOLD MUPI_DIV_QR_THRESHOLD
+#endif
+
+void
+mpn_div_q (mp_ptr qp,
+ mp_srcptr np, mp_size_t nn,
+ mp_srcptr dp, mp_size_t dn, mp_ptr scratch)
+{
+ mp_ptr new_dp, new_np, tp, rp;
+ mp_limb_t cy, dh, qh;
+ mp_size_t new_nn, qn;
+ gmp_pi1_t dinv;
+ int cnt;
+ TMP_DECL;
+ TMP_MARK;
+
+ ASSERT (nn >= dn);
+ ASSERT (dn > 0);
+ ASSERT (dp[dn - 1] != 0);
+ ASSERT (! MPN_OVERLAP_P (qp, nn - dn + 1, np, nn));
+ ASSERT (! MPN_OVERLAP_P (qp, nn - dn + 1, dp, dn));
+ ASSERT (MPN_SAME_OR_SEPARATE_P (np, scratch, nn));
+
+ ASSERT_ALWAYS (FUDGE >= 2);
+
+ if (dn == 1)
+ {
+ mpn_divrem_1 (qp, 0L, np, nn, dp[dn - 1]);
+ return;
+ }
+
+ qn = nn - dn + 1; /* Quotient size, high limb might be zero */
+
+ if (qn + FUDGE >= dn)
+ {
+ /* |________________________|
+ |_______| */
+ new_np = scratch;
+
+ dh = dp[dn - 1];
+ if (LIKELY ((dh & GMP_NUMB_HIGHBIT) == 0))
+ {
+ count_leading_zeros (cnt, dh);
+
+ cy = mpn_lshift (new_np, np, nn, cnt);
+ new_np[nn] = cy;
+ new_nn = nn + (cy != 0);
+
+ new_dp = TMP_ALLOC_LIMBS (dn);
+ mpn_lshift (new_dp, dp, dn, cnt);
+
+ if (dn == 2)
+ {
+ qh = mpn_divrem_2 (qp, 0L, new_np, new_nn, new_dp);
+ }
+ else if (BELOW_THRESHOLD (dn, DC_DIV_Q_THRESHOLD) ||
+ BELOW_THRESHOLD (new_nn - dn, DC_DIV_Q_THRESHOLD))
+ {
+ invert_pi1 (dinv, new_dp[dn - 1], new_dp[dn - 2]);
+ qh = mpn_sbpi1_div_q (qp, new_np, new_nn, new_dp, dn, dinv.inv32);
+ }
+ else if (BELOW_THRESHOLD (dn, MUPI_DIV_Q_THRESHOLD) || /* fast condition */
+ BELOW_THRESHOLD (nn, 2 * MU_DIV_Q_THRESHOLD) || /* fast condition */
+ (double) (2 * (MU_DIV_Q_THRESHOLD - MUPI_DIV_Q_THRESHOLD)) * dn /* slow... */
+ + (double) MUPI_DIV_Q_THRESHOLD * nn > (double) dn * nn) /* ...condition */
+ {
+ invert_pi1 (dinv, new_dp[dn - 1], new_dp[dn - 2]);
+ qh = mpn_dcpi1_div_q (qp, new_np, new_nn, new_dp, dn, &dinv);
+ }
+ else
+ {
+ mp_size_t itch = mpn_mu_div_q_itch (new_nn, dn, 0);
+ mp_ptr scratch = TMP_ALLOC_LIMBS (itch);
+ qh = mpn_mu_div_q (qp, new_np, new_nn, new_dp, dn, scratch);
+ }
+ 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 /* divisor is already normalised */
+ {
+ if (new_np != np)
+ MPN_COPY (new_np, np, nn);
+
+ if (dn == 2)
+ {
+ qh = mpn_divrem_2 (qp, 0L, new_np, nn, dp);
+ }
+ else if (BELOW_THRESHOLD (dn, DC_DIV_Q_THRESHOLD) ||
+ BELOW_THRESHOLD (nn - dn, DC_DIV_Q_THRESHOLD))
+ {
+ invert_pi1 (dinv, dh, dp[dn - 2]);
+ qh = mpn_sbpi1_div_q (qp, new_np, nn, dp, dn, dinv.inv32);
+ }
+ else if (BELOW_THRESHOLD (dn, MUPI_DIV_Q_THRESHOLD) || /* fast condition */
+ BELOW_THRESHOLD (nn, 2 * MU_DIV_Q_THRESHOLD) || /* fast condition */
+ (double) (2 * (MU_DIV_Q_THRESHOLD - MUPI_DIV_Q_THRESHOLD)) * dn /* slow... */
+ + (double) MUPI_DIV_Q_THRESHOLD * nn > (double) dn * nn) /* ...condition */
+ {
+ invert_pi1 (dinv, dh, dp[dn - 2]);
+ qh = mpn_dcpi1_div_q (qp, new_np, nn, dp, dn, &dinv);
+ }
+ else
+ {
+ mp_size_t itch = mpn_mu_div_q_itch (nn, dn, 0);
+ mp_ptr scratch = TMP_ALLOC_LIMBS (itch);
+ qh = mpn_mu_div_q (qp, np, nn, dp, dn, scratch);
+ }
+ qp[nn - dn] = qh;
+ }
+ }
+ else
+ {
+ /* |________________________|
+ |_________________| */
+ tp = TMP_ALLOC_LIMBS (qn + 1);
+
+ new_np = scratch;
+ new_nn = 2 * qn + 1;
+ if (new_np == np)
+ /* We need {np,nn} to remain untouched until the final adjustment, so
+ we need to allocate separate space for new_np. */
+ new_np = TMP_ALLOC_LIMBS (new_nn + 1);
+
+
+ dh = dp[dn - 1];
+ if (LIKELY ((dh & GMP_NUMB_HIGHBIT) == 0))
+ {
+ count_leading_zeros (cnt, dh);
+
+ cy = mpn_lshift (new_np, np + nn - new_nn, new_nn, cnt);
+ new_np[new_nn] = cy;
+
+ new_nn += (cy != 0);
+
+ new_dp = TMP_ALLOC_LIMBS (qn + 1);
+ mpn_lshift (new_dp, dp + dn - (qn + 1), qn + 1, cnt);
+ new_dp[0] |= dp[dn - (qn + 1) - 1] >> (GMP_NUMB_BITS - cnt);
+
+ if (qn + 1 == 2)
+ {
+ qh = mpn_divrem_2 (tp, 0L, new_np, new_nn, new_dp);
+ }
+ else if (BELOW_THRESHOLD (qn, DC_DIVAPPR_Q_THRESHOLD - 1))
+ {
+ invert_pi1 (dinv, new_dp[qn], new_dp[qn - 1]);
+ qh = mpn_sbpi1_divappr_q (tp, new_np, new_nn, new_dp, qn + 1, dinv.inv32);
+ }
+ else if (BELOW_THRESHOLD (qn, MU_DIVAPPR_Q_THRESHOLD - 1))
+ {
+ invert_pi1 (dinv, new_dp[qn], new_dp[qn - 1]);
+ qh = mpn_dcpi1_divappr_q (tp, new_np, new_nn, new_dp, qn + 1, &dinv);
+ }
+ else
+ {
+ mp_size_t itch = mpn_mu_divappr_q_itch (new_nn, qn + 1, 0);
+ mp_ptr scratch = TMP_ALLOC_LIMBS (itch);
+ qh = mpn_mu_divappr_q (tp, new_np, new_nn, new_dp, qn + 1, scratch);
+ }
+ if (cy == 0)
+ tp[qn] = 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 - (qn + 1);
+ for (i = 0; i < n; i++)
+ tp[i] = GMP_NUMB_MAX;
+ qh = 0; /* currently ignored */
+ }
+ }
+ else /* divisor is already normalised */
+ {
+ MPN_COPY (new_np, np + nn - new_nn, new_nn); /* pointless of MU will be used */
+
+ new_dp = (mp_ptr) dp + dn - (qn + 1);
+
+ if (qn == 2 - 1)
+ {
+ qh = mpn_divrem_2 (tp, 0L, new_np, new_nn, new_dp);
+ }
+ else if (BELOW_THRESHOLD (qn, DC_DIVAPPR_Q_THRESHOLD - 1))
+ {
+ invert_pi1 (dinv, dh, new_dp[qn - 1]);
+ qh = mpn_sbpi1_divappr_q (tp, new_np, new_nn, new_dp, qn + 1, dinv.inv32);
+ }
+ else if (BELOW_THRESHOLD (qn, MU_DIVAPPR_Q_THRESHOLD - 1))
+ {
+ invert_pi1 (dinv, dh, new_dp[qn - 1]);
+ qh = mpn_dcpi1_divappr_q (tp, new_np, new_nn, new_dp, qn + 1, &dinv);
+ }
+ else
+ {
+ mp_size_t itch = mpn_mu_divappr_q_itch (new_nn, qn + 1, 0);
+ mp_ptr scratch = TMP_ALLOC_LIMBS (itch);
+ qh = mpn_mu_divappr_q (tp, new_np, new_nn, new_dp, qn + 1, scratch);
+ }
+ tp[qn] = qh;
+ }
+
+ MPN_COPY (qp, tp + 1, qn);
+ if (tp[0] <= 4)
+ {
+ mp_size_t rn;
+
+ rp = TMP_ALLOC_LIMBS (dn + qn);
+ mpn_mul (rp, dp, dn, tp + 1, qn);
+ rn = dn + qn;
+ rn -= rp[rn - 1] == 0;
+
+ if (rn > nn || mpn_cmp (np, rp, nn) < 0)
+ mpn_decr_u (qp, 1);
+ }
+ }
+
+ TMP_FREE;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/div_qr_1.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/div_qr_1.c
new file mode 100644
index 00000000000..09401ac5358
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/div_qr_1.c
@@ -0,0 +1,126 @@
+/* mpn_div_qr_1 -- mpn by limb division.
+
+ Contributed to the GNU project by Niels Möller and Torbjörn Granlund
+
+Copyright 1991, 1993, 1994, 1996, 1998-2000, 2002, 2003, 2013 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.h"
+#include "gmp-impl.h"
+#include "longlong.h"
+
+#ifndef DIV_QR_1_NORM_THRESHOLD
+#define DIV_QR_1_NORM_THRESHOLD 3
+#endif
+#ifndef DIV_QR_1_UNNORM_THRESHOLD
+#define DIV_QR_1_UNNORM_THRESHOLD 3
+#endif
+
+#if GMP_NAIL_BITS > 0
+#error Nail bits not supported
+#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. */
+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)
+{
+ unsigned cnt;
+ mp_limb_t uh;
+
+ ASSERT (n > 0);
+ ASSERT (d > 0);
+
+ if (d & GMP_NUMB_HIGHBIT)
+ {
+ /* Normalized case */
+ mp_limb_t dinv, q;
+
+ uh = up[--n];
+
+ q = (uh >= d);
+ *qh = q;
+ uh -= (-q) & d;
+
+ if (BELOW_THRESHOLD (n, DIV_QR_1_NORM_THRESHOLD))
+ {
+ cnt = 0;
+ plain:
+ while (n > 0)
+ {
+ mp_limb_t ul = up[--n];
+ udiv_qrnnd (qp[n], uh, uh, ul, d);
+ }
+ return uh >> cnt;
+ }
+ invert_limb (dinv, d);
+ return mpn_div_qr_1n_pi1 (qp, up, n, uh, d, dinv);
+ }
+ else
+ {
+ /* Unnormalized case */
+ mp_limb_t dinv, ul;
+
+ if (! UDIV_NEEDS_NORMALIZATION
+ && BELOW_THRESHOLD (n, DIV_QR_1_UNNORM_THRESHOLD))
+ {
+ uh = up[--n];
+ udiv_qrnnd (*qh, uh, CNST_LIMB(0), uh, d);
+ cnt = 0;
+ goto plain;
+ }
+
+ count_leading_zeros (cnt, d);
+ d <<= cnt;
+
+#if HAVE_NATIVE_div_qr_1u_pi1
+ /* FIXME: Call loop doing on-the-fly normalization */
+#endif
+
+ /* Shift up front, use qp area for shifted copy. A bit messy,
+ since we have only n-1 limbs available, and shift the high
+ limb manually. */
+ uh = up[--n];
+ ul = (uh << cnt) | mpn_lshift (qp, up, n, cnt);
+ uh >>= (GMP_LIMB_BITS - cnt);
+
+ if (UDIV_NEEDS_NORMALIZATION
+ && BELOW_THRESHOLD (n, DIV_QR_1_UNNORM_THRESHOLD))
+ {
+ udiv_qrnnd (*qh, uh, uh, ul, d);
+ up = qp;
+ goto plain;
+ }
+ invert_limb (dinv, d);
+
+ udiv_qrnnd_preinv (*qh, uh, uh, ul, d, dinv);
+ return mpn_div_qr_1n_pi1 (qp, qp, n, uh, d, dinv) >> cnt;
+ }
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/div_qr_1n_pi1.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/div_qr_1n_pi1.c
new file mode 100644
index 00000000000..229ee091a43
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/div_qr_1n_pi1.c
@@ -0,0 +1,277 @@
+/* mpn_div_qr_1n_pi1
+
+ Contributed to the GNU project by Niels Möller
+
+ THIS FILE CONTAINS 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 GNU MP RELEASE.
+
+
+Copyright 2013 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.h"
+#include "gmp-impl.h"
+#include "longlong.h"
+
+#if GMP_NAIL_BITS > 0
+#error Nail bits not supported
+#endif
+
+#ifndef DIV_QR_1N_METHOD
+#define DIV_QR_1N_METHOD 2
+#endif
+
+/* FIXME: Duplicated in mod_1_1.c. Move to gmp-impl.h */
+
+#if defined (__GNUC__)
+
+#if HAVE_HOST_CPU_FAMILY_x86 && W_TYPE_SIZE == 32
+#define add_mssaaaa(m, s1, s0, a1, a0, b1, b0) \
+ __asm__ ( "add %6, %k2\n\t" \
+ "adc %4, %k1\n\t" \
+ "sbb %k0, %k0" \
+ : "=r" (m), "=r" (s1), "=&r" (s0) \
+ : "1" ((USItype)(a1)), "g" ((USItype)(b1)), \
+ "%2" ((USItype)(a0)), "g" ((USItype)(b0)))
+#endif
+
+#if HAVE_HOST_CPU_FAMILY_x86_64 && W_TYPE_SIZE == 64
+#define add_mssaaaa(m, s1, s0, a1, a0, b1, b0) \
+ __asm__ ( "add %6, %q2\n\t" \
+ "adc %4, %q1\n\t" \
+ "sbb %q0, %q0" \
+ : "=r" (m), "=r" (s1), "=&r" (s0) \
+ : "1" ((UDItype)(a1)), "rme" ((UDItype)(b1)), \
+ "%2" ((UDItype)(a0)), "rme" ((UDItype)(b0)))
+#endif
+
+#if defined (__sparc__) && W_TYPE_SIZE == 32
+#define add_mssaaaa(m, sh, sl, ah, al, bh, bl) \
+ __asm__ ( "addcc %r5, %6, %2\n\t" \
+ "addxcc %r3, %4, %1\n\t" \
+ "subx %%g0, %%g0, %0" \
+ : "=r" (m), "=r" (sh), "=&r" (sl) \
+ : "rJ" (ah), "rI" (bh), "%rJ" (al), "rI" (bl) \
+ __CLOBBER_CC)
+#endif
+
+#if defined (__sparc__) && W_TYPE_SIZE == 64
+#define add_mssaaaa(m, sh, sl, ah, al, bh, bl) \
+ __asm__ ( "addcc %r5, %6, %2\n\t" \
+ "addccc %r7, %8, %%g0\n\t" \
+ "addccc %r3, %4, %1\n\t" \
+ "clr %0\n\t" \
+ "movcs %%xcc, -1, %0" \
+ : "=r" (m), "=r" (sh), "=&r" (sl) \
+ : "rJ" (ah), "rI" (bh), "%rJ" (al), "rI" (bl), \
+ "rJ" ((al) >> 32), "rI" ((bl) >> 32) \
+ __CLOBBER_CC)
+#if __VIS__ >= 0x300
+#undef add_mssaaaa
+#define add_mssaaaa(m, sh, sl, ah, al, bh, bl) \
+ __asm__ ( "addcc %r5, %6, %2\n\t" \
+ "addxccc %r3, %4, %1\n\t" \
+ "clr %0\n\t" \
+ "movcs %%xcc, -1, %0" \
+ : "=r" (m), "=r" (sh), "=&r" (sl) \
+ : "rJ" (ah), "rI" (bh), "%rJ" (al), "rI" (bl) \
+ __CLOBBER_CC)
+#endif
+#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_mssaaaa(m, s1, s0, a1, a0, b1, b0) \
+ __asm__ ( "add%I6c %2, %5, %6\n\t" \
+ "adde %1, %3, %4\n\t" \
+ "subfe %0, %0, %0\n\t" \
+ "nor %0, %0, %0" \
+ : "=r" (m), "=r" (s1), "=&r" (s0) \
+ : "r" (a1), "r" (b1), "%r" (a0), "rI" (b0))
+#endif
+
+#if defined (__s390x__) && W_TYPE_SIZE == 64
+#define add_mssaaaa(m, s1, s0, a1, a0, b1, b0) \
+ __asm__ ( "algr %2, %6\n\t" \
+ "alcgr %1, %4\n\t" \
+ "lghi %0, 0\n\t" \
+ "alcgr %0, %0\n\t" \
+ "lcgr %0, %0" \
+ : "=r" (m), "=r" (s1), "=&r" (s0) \
+ : "1" ((UDItype)(a1)), "r" ((UDItype)(b1)), \
+ "%2" ((UDItype)(a0)), "r" ((UDItype)(b0)) __CLOBBER_CC)
+#endif
+
+#if defined (__arm__) && W_TYPE_SIZE == 32
+#define add_mssaaaa(m, sh, sl, ah, al, bh, bl) \
+ __asm__ ( "adds %2, %5, %6\n\t" \
+ "adcs %1, %3, %4\n\t" \
+ "movcc %0, #0\n\t" \
+ "movcs %0, #-1" \
+ : "=r" (m), "=r" (sh), "=&r" (sl) \
+ : "r" (ah), "rI" (bh), "%r" (al), "rI" (bl) __CLOBBER_CC)
+#endif
+#endif /* defined (__GNUC__) */
+
+#ifndef add_mssaaaa
+#define add_mssaaaa(m, s1, s0, a1, a0, b1, b0) \
+ do { \
+ UWtype __s0, __s1, __c0, __c1; \
+ __s0 = (a0) + (b0); \
+ __s1 = (a1) + (b1); \
+ __c0 = __s0 < (a0); \
+ __c1 = __s1 < (a1); \
+ (s0) = __s0; \
+ __s1 = __s1 + __c0; \
+ (s1) = __s1; \
+ (m) = - (__c1 + (__s1 < __c0)); \
+ } while (0)
+#endif
+
+#if DIV_QR_1N_METHOD == 1
+
+/* Divides (uh B^n + {up, n}) by d, storing the quotient at {qp, n}.
+ Requires that uh < d. */
+mp_limb_t
+mpn_div_qr_1n_pi1 (mp_ptr qp, mp_srcptr up, mp_size_t n, mp_limb_t uh,
+ mp_limb_t d, mp_limb_t dinv)
+{
+ ASSERT (n > 0);
+ ASSERT (uh < d);
+ ASSERT (d & GMP_NUMB_HIGHBIT);
+ ASSERT (MPN_SAME_OR_SEPARATE_P (qp, up, n));
+
+ do
+ {
+ mp_limb_t q, ul;
+
+ ul = up[--n];
+ udiv_qrnnd_preinv (q, uh, uh, ul, d, dinv);
+ qp[n] = q;
+ }
+ while (n > 0);
+
+ return uh;
+}
+
+#elif DIV_QR_1N_METHOD == 2
+
+mp_limb_t
+mpn_div_qr_1n_pi1 (mp_ptr qp, mp_srcptr up, mp_size_t n, mp_limb_t u1,
+ mp_limb_t d, mp_limb_t dinv)
+{
+ mp_limb_t B2;
+ mp_limb_t u0, u2;
+ mp_limb_t q0, q1;
+ mp_limb_t p0, p1;
+ mp_limb_t t;
+ mp_size_t j;
+
+ ASSERT (d & GMP_LIMB_HIGHBIT);
+ ASSERT (n > 0);
+ ASSERT (u1 < d);
+
+ if (n == 1)
+ {
+ udiv_qrnnd_preinv (qp[0], u1, u1, up[0], d, dinv);
+ return u1;
+ }
+
+ /* FIXME: Could be precomputed */
+ B2 = -d*dinv;
+
+ umul_ppmm (q1, q0, dinv, u1);
+ umul_ppmm (p1, p0, B2, u1);
+ q1 += u1;
+ ASSERT (q1 >= u1);
+ u0 = up[n-1]; /* Early read, to allow qp == up. */
+ qp[n-1] = q1;
+
+ add_mssaaaa (u2, u1, u0, u0, up[n-2], p1, p0);
+
+ /* FIXME: Keep q1 in a variable between iterations, to reduce number
+ of memory accesses. */
+ for (j = n-2; j-- > 0; )
+ {
+ mp_limb_t q2, cy;
+
+ /* Additions for the q update:
+ * +-------+
+ * |u1 * v |
+ * +---+---+
+ * | u1|
+ * +---+---+
+ * | 1 | v | (conditional on u2)
+ * +---+---+
+ * | 1 | (conditional on u0 + u2 B2 carry)
+ * +---+
+ * + | q0|
+ * -+---+---+---+
+ * | q2| q1| q0|
+ * +---+---+---+
+ */
+ umul_ppmm (p1, t, u1, dinv);
+ add_ssaaaa (q2, q1, -u2, u2 & dinv, CNST_LIMB(0), u1);
+ add_ssaaaa (q2, q1, q2, q1, CNST_LIMB(0), p1);
+ add_ssaaaa (q2, q1, q2, q1, CNST_LIMB(0), q0);
+ q0 = t;
+
+ umul_ppmm (p1, p0, u1, B2);
+ ADDC_LIMB (cy, u0, u0, u2 & B2);
+ u0 -= (-cy) & d;
+
+ /* Final q update */
+ add_ssaaaa (q2, q1, q2, q1, CNST_LIMB(0), cy);
+ qp[j+1] = q1;
+ MPN_INCR_U (qp+j+2, n-j-2, q2);
+
+ add_mssaaaa (u2, u1, u0, u0, up[j], p1, p0);
+ }
+
+ q1 = (u2 > 0);
+ u1 -= (-q1) & d;
+
+ t = (u1 >= d);
+ q1 += t;
+ u1 -= (-t) & d;
+
+ udiv_qrnnd_preinv (t, u0, u1, u0, d, dinv);
+ add_ssaaaa (q1, q0, q1, q0, CNST_LIMB(0), t);
+
+ MPN_INCR_U (qp+1, n-1, q1);
+
+ qp[0] = q0;
+ return u0;
+}
+
+#else
+#error Unknown DIV_QR_1N_METHOD
+#endif
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/div_qr_1n_pi2.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/div_qr_1n_pi2.c
new file mode 100644
index 00000000000..7ea3410cb6e
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/div_qr_1n_pi2.c
@@ -0,0 +1,195 @@
+/* mpn_div_qr_1u_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.
+
+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/. */
+
+/* ISSUES:
+
+ * Can we really use the high pi2 inverse limb for udiv_qrnnd_preinv?
+
+ * Are there any problems with generating n quotient limbs in the q area? It
+ surely simplifies things.
+
+ * 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.
+*/
+#if defined (__GNUC__) && ! defined (__INTEL_COMPILER)
+
+#if HAVE_HOST_CPU_FAMILY_x86 && W_TYPE_SIZE == 32
+#define add_sssaaaa(s2, s1, s0, a1, a0, b1, b0) \
+ __asm__ ("add\t%7, %k2\n\tadc\t%5, %k1\n\tadc\t$0, %k0" \
+ : "=r" (s2), "=&r" (s1), "=&r" (s0) \
+ : "0" ((USItype)(s2)), \
+ "1" ((USItype)(a1)), "g" ((USItype)(b1)), \
+ "%2" ((USItype)(a0)), "g" ((USItype)(b0)))
+#endif
+
+#if defined (__amd64__) && W_TYPE_SIZE == 64
+#define add_sssaaaa(s2, s1, s0, a1, a0, b1, b0) \
+ __asm__ ("add\t%7, %q2\n\tadc\t%5, %q1\n\tadc\t$0, %q0" \
+ : "=r" (s2), "=&r" (s1), "=&r" (s0) \
+ : "0" ((UDItype)(s2)), \
+ "1" ((UDItype)(a1)), "rme" ((UDItype)(b1)), \
+ "%2" ((UDItype)(a0)), "rme" ((UDItype)(b0)))
+#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" \
+ : "=r" (s2), "=&r" (s1), "=&r" (s0) \
+ : "r" (s2), "r" (a1), "r" (b1), "%r" (a0), "rI" (b0))
+#endif
+
+#endif /* __GNUC__ */
+
+#ifndef add_sssaaaa
+#define add_sssaaaa(s2, s1, s0, a1, a0, b1, b0) \
+ do { \
+ UWtype __s0, __s1, __c0, __c1; \
+ __s0 = (a0) + (b0); \
+ __s1 = (a1) + (b1); \
+ __c0 = __s0 < (a0); \
+ __c1 = __s1 < (a1); \
+ (s0) = __s0; \
+ __s1 = __s1 + __c0; \
+ (s1) = __s1; \
+ (s2) += __c1 + (__s1 < __c0); \
+ } while (0)
+#endif
+
+struct precomp_div_1_pi2
+{
+ mp_limb_t dip[2];
+ mp_limb_t d;
+ int norm_cnt;
+};
+
+mp_limb_t
+mpn_div_qr_1n_pi2 (mp_ptr qp,
+ mp_srcptr up, mp_size_t un,
+ struct precomp_div_1_pi2 *pd)
+{
+ mp_limb_t most_significant_q_limb;
+ mp_size_t i;
+ mp_limb_t r, u2, u1, u0;
+ mp_limb_t d0, di1, di0;
+ mp_limb_t q3a, q2a, q2b, q1b, q2c, q1c, q1d, q0d;
+ mp_limb_t cnd;
+
+ ASSERT (un >= 2);
+ ASSERT ((pd->d & GMP_NUMB_HIGHBIT) != 0);
+ ASSERT (! MPN_OVERLAP_P (qp, un-2, up, un) || qp+2 >= up);
+ ASSERT_MPN (up, un);
+
+#define q3 q3a
+#define q2 q2b
+#define q1 q1b
+
+ up += un - 3;
+ r = up[2];
+ d0 = pd->d;
+
+ most_significant_q_limb = (r >= d0);
+ r -= d0 & -most_significant_q_limb;
+
+ qp += un - 3;
+ qp[2] = most_significant_q_limb;
+
+ di1 = pd->dip[1];
+ di0 = pd->dip[0];
+
+ for (i = un - 3; i >= 0; i -= 2)
+ {
+ u2 = r;
+ u1 = up[1];
+ u0 = up[0];
+
+ /* Dividend in {r,u1,u0} */
+
+ umul_ppmm (q1d,q0d, u1, di0);
+ umul_ppmm (q2b,q1b, u1, di1);
+ q2b++; /* cannot spill */
+ add_sssaaaa (r,q2b,q1b, q2b,q1b, u1,u0);
+
+ umul_ppmm (q2c,q1c, u2, di0);
+ add_sssaaaa (r,q2b,q1b, q2b,q1b, q2c,q1c);
+ umul_ppmm (q3a,q2a, u2, di1);
+
+ add_sssaaaa (r,q2b,q1b, q2b,q1b, q2a,q1d);
+
+ q3 += r;
+
+ r = u0 - q2 * d0;
+
+ cnd = (r >= q1);
+ r += d0 & -cnd;
+ sub_ddmmss (q3,q2, q3,q2, 0,cnd);
+
+ if (UNLIKELY (r >= d0))
+ {
+ r -= d0;
+ add_ssaaaa (q3,q2, q3,q2, 0,1);
+ }
+
+ qp[0] = q2;
+ qp[1] = q3;
+
+ up -= 2;
+ qp -= 2;
+ }
+
+ if ((un & 1) == 0)
+ {
+ u2 = r;
+ u1 = up[1];
+
+ udiv_qrnnd_preinv (q3, r, u2, u1, d0, di1);
+ qp[1] = q3;
+ }
+
+ return r;
+
+#undef q3
+#undef q2
+#undef q1
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/div_qr_1u_pi2.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/div_qr_1u_pi2.c
new file mode 100644
index 00000000000..83d66ef29e3
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/div_qr_1u_pi2.c
@@ -0,0 +1,228 @@
+/* mpn_div_qr_1u_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.
+
+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/. */
+
+/* ISSUES:
+
+ * Can we really use the high pi2 inverse limb for udiv_qrnnd_preinv?
+
+ * Are there any problems with generating n quotient limbs in the q area? It
+ surely simplifies things.
+
+ * 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.
+*/
+#if defined (__GNUC__) && ! defined (__INTEL_COMPILER)
+
+#if HAVE_HOST_CPU_FAMILY_x86 && W_TYPE_SIZE == 32
+#define add_sssaaaa(s2, s1, s0, a1, a0, b1, b0) \
+ __asm__ ("add\t%7, %k2\n\tadc\t%5, %k1\n\tadc\t$0, %k0" \
+ : "=r" (s2), "=&r" (s1), "=&r" (s0) \
+ : "0" ((USItype)(s2)), \
+ "1" ((USItype)(a1)), "g" ((USItype)(b1)), \
+ "%2" ((USItype)(a0)), "g" ((USItype)(b0)))
+#endif
+
+#if defined (__amd64__) && W_TYPE_SIZE == 64
+#define add_sssaaaa(s2, s1, s0, a1, a0, b1, b0) \
+ __asm__ ("add\t%7, %q2\n\tadc\t%5, %q1\n\tadc\t$0, %q0" \
+ : "=r" (s2), "=&r" (s1), "=&r" (s0) \
+ : "0" ((UDItype)(s2)), \
+ "1" ((UDItype)(a1)), "rme" ((UDItype)(b1)), \
+ "%2" ((UDItype)(a0)), "rme" ((UDItype)(b0)))
+#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" \
+ : "=r" (s2), "=&r" (s1), "=&r" (s0) \
+ : "r" (s2), "r" (a1), "r" (b1), "%r" (a0), "rI" (b0))
+#endif
+
+#endif /* __GNUC__ */
+
+#ifndef add_sssaaaa
+#define add_sssaaaa(s2, s1, s0, a1, a0, b1, b0) \
+ do { \
+ UWtype __s0, __s1, __c0, __c1; \
+ __s0 = (a0) + (b0); \
+ __s1 = (a1) + (b1); \
+ __c0 = __s0 < (a0); \
+ __c1 = __s1 < (a1); \
+ (s0) = __s0; \
+ __s1 = __s1 + __c0; \
+ (s1) = __s1; \
+ (s2) += __c1 + (__s1 < __c0); \
+ } while (0)
+#endif
+
+struct precomp_div_1_pi2
+{
+ mp_limb_t dip[2];
+ mp_limb_t d;
+ int norm_cnt;
+};
+
+mp_limb_t
+mpn_div_qr_1u_pi2 (mp_ptr qp,
+ mp_srcptr up, mp_size_t un,
+ struct precomp_div_1_pi2 *pd)
+{
+ mp_size_t i;
+ mp_limb_t r, u2, u1, u0;
+ mp_limb_t d0, di1, di0;
+ mp_limb_t q3a, q2a, q2b, q1b, q2c, q1c, q1d, q0d;
+ mp_limb_t cnd;
+ int cnt;
+
+ ASSERT (un >= 2);
+ ASSERT ((pd->d & GMP_NUMB_HIGHBIT) == 0);
+ ASSERT (! MPN_OVERLAP_P (qp, un-2, up, un) || qp+2 >= up);
+ ASSERT_MPN (up, un);
+
+#define q3 q3a
+#define q2 q2b
+#define q1 q1b
+
+ up += un - 3;
+ cnt = pd->norm_cnt;
+ r = up[2] >> (GMP_NUMB_BITS - cnt);
+ d0 = pd->d << cnt;
+
+ qp += un - 2;
+
+ di1 = pd->dip[1];
+ di0 = pd->dip[0];
+
+ for (i = un - 3; i >= 0; i -= 2)
+ {
+ u2 = r;
+ u1 = (up[2] << cnt) | (up[1] >> (GMP_NUMB_BITS - cnt));
+ u0 = (up[1] << cnt) | (up[0] >> (GMP_NUMB_BITS - cnt));
+
+ /* Dividend in {r,u1,u0} */
+
+ umul_ppmm (q1d,q0d, u1, di0);
+ umul_ppmm (q2b,q1b, u1, di1);
+ q2b++; /* cannot spill */
+ add_sssaaaa (r,q2b,q1b, q2b,q1b, u1,u0);
+
+ umul_ppmm (q2c,q1c, u2, di0);
+ add_sssaaaa (r,q2b,q1b, q2b,q1b, q2c,q1c);
+ umul_ppmm (q3a,q2a, u2, di1);
+
+ add_sssaaaa (r,q2b,q1b, q2b,q1b, q2a,q1d);
+
+ q3 += r;
+
+ r = u0 - q2 * d0;
+
+ cnd = (r >= q1);
+ r += d0 & -cnd;
+ sub_ddmmss (q3,q2, q3,q2, 0,cnd);
+
+ if (UNLIKELY (r >= d0))
+ {
+ r -= d0;
+ add_ssaaaa (q3,q2, q3,q2, 0,1);
+ }
+
+ qp[0] = q2;
+ qp[1] = q3;
+
+ up -= 2;
+ qp -= 2;
+ }
+
+ if ((un & 1) != 0)
+ {
+ u2 = r;
+ u1 = (up[2] << cnt);
+
+ udiv_qrnnd_preinv (q3, r, u2, u1, d0, di1);
+ qp[1] = q3;
+ }
+ else
+ {
+ u2 = r;
+ u1 = (up[2] << cnt) | (up[1] >> (GMP_NUMB_BITS - cnt));
+ u0 = (up[1] << cnt);
+
+ /* Dividend in {r,u1,u0} */
+
+ umul_ppmm (q1d,q0d, u1, di0);
+ umul_ppmm (q2b,q1b, u1, di1);
+ q2b++; /* cannot spill */
+ add_sssaaaa (r,q2b,q1b, q2b,q1b, u1,u0);
+
+ umul_ppmm (q2c,q1c, u2, di0);
+ add_sssaaaa (r,q2b,q1b, q2b,q1b, q2c,q1c);
+ umul_ppmm (q3a,q2a, u2, di1);
+
+ add_sssaaaa (r,q2b,q1b, q2b,q1b, q2a,q1d);
+
+ q3 += r;
+
+ r = u0 - q2 * d0;
+
+ cnd = (r >= q1);
+ r += d0 & -cnd;
+ sub_ddmmss (q3,q2, q3,q2, 0,cnd);
+
+ if (UNLIKELY (r >= d0))
+ {
+ r -= d0;
+ add_ssaaaa (q3,q2, q3,q2, 0,1);
+ }
+
+ qp[0] = q2;
+ qp[1] = q3;
+ }
+
+ return r >> cnt;
+
+#undef q3
+#undef q2
+#undef q1
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/div_qr_2.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/div_qr_2.c
new file mode 100644
index 00000000000..cb07e0e3b42
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/div_qr_2.c
@@ -0,0 +1,332 @@
+/* mpn_div_qr_2 -- Divide natural numbers, producing both remainder and
+ quotient. The divisor is two limbs.
+
+ Contributed to the GNU project by Torbjorn Granlund and Niels Möller
+
+ THIS FILE CONTAINS 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 GNU MP RELEASE.
+
+
+Copyright 1993-1996, 1999-2002, 2011 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.h"
+#include "gmp-impl.h"
+#include "longlong.h"
+
+#ifndef DIV_QR_2_PI2_THRESHOLD
+/* Disabled unless explicitly tuned. */
+#define DIV_QR_2_PI2_THRESHOLD MP_LIMB_T_MAX
+#endif
+
+#ifndef SANITY_CHECK
+#define SANITY_CHECK 0
+#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".
+*/
+#if defined (__GNUC__) && ! defined (__INTEL_COMPILER)
+
+#if HAVE_HOST_CPU_FAMILY_x86 && W_TYPE_SIZE == 32
+#define add_sssaaaa(s2, s1, s0, a1, a0, b1, b0) \
+ __asm__ ("add\t%7, %k2\n\tadc\t%5, %k1\n\tadc\t$0, %k0" \
+ : "=r" (s2), "=&r" (s1), "=&r" (s0) \
+ : "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
+#define add_sssaaaa(s2, s1, s0, a1, a0, b1, b0) \
+ __asm__ ("add\t%7, %q2\n\tadc\t%5, %q1\n\tadc\t$0, %q0" \
+ : "=r" (s2), "=&r" (s1), "=&r" (s0) \
+ : "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 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" \
+ : "=r" (s2), "=&r" (s1), "=&r" (s0) \
+ : "r" (s2), "r" (a1), "r" (b1), "%r" (a0), "rI" (b0))
+#endif
+
+#endif /* __GNUC__ */
+
+#ifndef add_sssaaaa
+#define add_sssaaaa(s2, s1, s0, a1, a0, b1, b0) \
+ do { \
+ UWtype __s0, __s1, __c0, __c1; \
+ __s0 = (a0) + (b0); \
+ __s1 = (a1) + (b1); \
+ __c0 = __s0 < (a0); \
+ __c1 = __s1 < (a1); \
+ (s0) = __s0; \
+ __s1 = __s1 + __c0; \
+ (s1) = __s1; \
+ (s2) += __c1 + (__s1 < __c0); \
+ } 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) \
+ do { \
+ mp_limb_t _q3, _q2a, _q2, _q1, _q2c, _q1c, _q1d, _q0; \
+ mp_limb_t _t1, _t0; \
+ mp_limb_t _c, _mask; \
+ \
+ umul_ppmm (_q3,_q2a, n3, di1); \
+ umul_ppmm (_q2,_q1, n2, di1); \
+ umul_ppmm (_q2c,_q1c, n3, di0); \
+ add_sssaaaa (_q3,_q2,_q1, _q2,_q1, _q2c,_q1c); \
+ umul_ppmm (_q1d,_q0, n2, di0); \
+ add_sssaaaa (_q3,_q2,_q1, _q2,_q1, _q2a,_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; \
+ \
+ sub_ddmmss (r1, r0, n1, n0, _t1, _t0); \
+ \
+ _mask = -(mp_limb_t) (r1 >= _q1 & (r1 > _q1 | r0 >= _q0)); /* (r1,r0) >= (q1,q0) */ \
+ add_ssaaaa (r1, r0, r1, r0, d1 & _mask, d0 & _mask); \
+ sub_ddmmss (_q3, _q2, _q3, _q2, CNST_LIMB(0), -_mask); \
+ \
+ if (UNLIKELY (r1 >= d1)) \
+ { \
+ if (r1 > d1 || r0 >= d0) \
+ { \
+ sub_ddmmss (r1, r0, r1, r0, d1, d0); \
+ add_ssaaaa (_q3, _q2, _q3, _q2, CNST_LIMB(0), CNST_LIMB(1));\
+ } \
+ } \
+ (q1) = _q3; \
+ (q0) = _q2; \
+ } while (0)
+
+static void
+invert_4by2 (mp_ptr di, mp_limb_t d1, mp_limb_t d0)
+{
+ mp_limb_t v1, v0, p1, t1, t0, p0, mask;
+ invert_limb (v1, d1);
+ p1 = d1 * v1;
+ /* <1, v1> * d1 = <B-1, p1> */
+ p1 += d0;
+ if (p1 < d0)
+ {
+ v1--;
+ mask = -(mp_limb_t) (p1 >= d1);
+ p1 -= d1;
+ v1 += mask;
+ p1 -= mask & d1;
+ }
+ /* <1, v1> * d1 + d0 = <B-1, p1> */
+ umul_ppmm (t1, p0, d0, v1);
+ p1 += t1;
+ if (p1 < t1)
+ {
+ if (UNLIKELY (p1 >= d1))
+ {
+ if (p1 > d1 || p0 >= d0)
+ {
+ sub_ddmmss (p1, p0, p1, p0, d1, d0);
+ v1--;
+ }
+ }
+ sub_ddmmss (p1, p0, p1, p0, d1, d0);
+ v1--;
+ }
+ /* Now v1 is the 3/2 inverse, <1, v1> * <d1, d0> = <B-1, p1, p0>,
+ * with <p1, p0> + <d1, d0> >= B^2.
+ *
+ * The 4/2 inverse is (B^4 - 1) / <d1, d0> = <1, v1, v0>. The
+ * partial remainder after <1, v1> is
+ *
+ * B^4 - 1 - B <1, v1> <d1, d0> = <B-1, B-1, B-1, B-1> - <B-1, p1, p0, 0>
+ * = <~p1, ~p0, B-1>
+ */
+ udiv_qr_3by2 (v0, t1, t0, ~p1, ~p0, MP_LIMB_T_MAX, d1, d0, v1);
+ di[0] = v0;
+ di[1] = v1;
+
+#if SANITY_CHECK
+ {
+ mp_limb_t tp[4];
+ mp_limb_t dp[2];
+ dp[0] = d0;
+ dp[1] = d1;
+ mpn_mul_n (tp, dp, di, 2);
+ ASSERT_ALWAYS (mpn_add_n (tp+2, tp+2, dp, 2) == 0);
+ ASSERT_ALWAYS (tp[2] == MP_LIMB_T_MAX);
+ ASSERT_ALWAYS (tp[3] == MP_LIMB_T_MAX);
+ ASSERT_ALWAYS (mpn_add_n (tp, tp, dp, 2) == 1);
+ }
+#endif
+}
+
+static mp_limb_t
+mpn_div_qr_2n_pi2 (mp_ptr qp, mp_ptr rp, mp_srcptr np, mp_size_t nn,
+ mp_limb_t d1, mp_limb_t d0, mp_limb_t di1, mp_limb_t di0)
+{
+ mp_limb_t qh;
+ mp_size_t i;
+ mp_limb_t r1, r0;
+
+ ASSERT (nn >= 2);
+ ASSERT (d1 & GMP_NUMB_HIGHBIT);
+
+ r1 = np[nn-1];
+ r0 = np[nn-2];
+
+ qh = 0;
+ if (r1 >= d1 && (r1 > d1 || r0 >= d0))
+ {
+#if GMP_NAIL_BITS == 0
+ sub_ddmmss (r1, r0, r1, r0, d1, d0);
+#else
+ r0 = r0 - d0;
+ r1 = r1 - d1 - (r0 >> GMP_LIMB_BITS - 1);
+ r0 &= GMP_NUMB_MASK;
+#endif
+ qh = 1;
+ }
+
+ for (i = nn - 2; i >= 2; i -= 2)
+ {
+ mp_limb_t n1, n0, q1, q0;
+ n1 = np[i-1];
+ n0 = np[i-2];
+ udiv_qr_4by2 (q1, q0, r1, r0, r1, r0, n1, n0, d1, d0, di1, di0);
+ qp[i-1] = q1;
+ qp[i-2] = q0;
+ }
+
+ if (i > 0)
+ {
+ mp_limb_t q;
+ udiv_qr_3by2 (q, r1, r0, r1, r0, np[0], d1, d0, di1);
+ qp[0] = q;
+ }
+ rp[1] = r1;
+ rp[0] = r0;
+
+ return qh;
+}
+
+
+/* Divide num {np,nn} by den {dp,2} and write the nn-2 least
+ significant quotient limbs at qp and the 2 long remainder at np.
+ Return the most significant limb of the quotient.
+
+ Preconditions:
+ 1. qp must either not overlap with the input 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.
+ 2. nn >= 2. */
+
+mp_limb_t
+mpn_div_qr_2 (mp_ptr qp, mp_ptr rp, mp_srcptr np, mp_size_t nn,
+ mp_srcptr dp)
+{
+ mp_limb_t d1;
+ mp_limb_t d0;
+ gmp_pi1_t dinv;
+
+ ASSERT (nn >= 2);
+ ASSERT (! MPN_OVERLAP_P (qp, nn-2, np, nn) || qp >= np + 2);
+ ASSERT_MPN (np, nn);
+ ASSERT_MPN (dp, 2);
+
+ d1 = dp[1]; d0 = dp[0];
+
+ ASSERT (d1 > 0);
+
+ if (UNLIKELY (d1 & GMP_NUMB_HIGHBIT))
+ {
+ if (BELOW_THRESHOLD (nn, DIV_QR_2_PI2_THRESHOLD))
+ {
+ gmp_pi1_t dinv;
+ invert_pi1 (dinv, d1, d0);
+ return mpn_div_qr_2n_pi1 (qp, rp, np, nn, d1, d0, dinv.inv32);
+ }
+ else
+ {
+ mp_limb_t di[2];
+ invert_4by2 (di, d1, d0);
+ return mpn_div_qr_2n_pi2 (qp, rp, np, nn, d1, d0, di[1], di[0]);
+ }
+ }
+ else
+ {
+ int shift;
+ count_leading_zeros (shift, d1);
+ d1 = (d1 << shift) | (d0 >> (GMP_LIMB_BITS - shift));
+ d0 <<= shift;
+ invert_pi1 (dinv, d1, d0);
+ return mpn_div_qr_2u_pi1 (qp, rp, np, nn, d1, d0, shift, dinv.inv32);
+ }
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/div_qr_2n_pi1.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/div_qr_2n_pi1.c
new file mode 100644
index 00000000000..da500e2170e
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/div_qr_2n_pi1.c
@@ -0,0 +1,85 @@
+/* mpn_div_qr_2n_pi1
+
+ Contributed to the GNU project by Torbjorn Granlund and Niels Möller
+
+ THIS FILE CONTAINS 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 GNU MP RELEASE.
+
+
+Copyright 1993-1996, 1999-2002, 2011 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.h"
+#include "gmp-impl.h"
+#include "longlong.h"
+
+
+/* 3/2 loop, for normalized divisor */
+mp_limb_t
+mpn_div_qr_2n_pi1 (mp_ptr qp, mp_ptr rp, mp_srcptr np, mp_size_t nn,
+ mp_limb_t d1, mp_limb_t d0, mp_limb_t di)
+{
+ mp_limb_t qh;
+ mp_size_t i;
+ mp_limb_t r1, r0;
+
+ ASSERT (nn >= 2);
+ ASSERT (d1 & GMP_NUMB_HIGHBIT);
+
+ np += nn - 2;
+ r1 = np[1];
+ r0 = np[0];
+
+ qh = 0;
+ if (r1 >= d1 && (r1 > d1 || r0 >= d0))
+ {
+#if GMP_NAIL_BITS == 0
+ sub_ddmmss (r1, r0, r1, r0, d1, d0);
+#else
+ r0 = r0 - d0;
+ r1 = r1 - d1 - (r0 >> GMP_LIMB_BITS - 1);
+ r0 &= GMP_NUMB_MASK;
+#endif
+ qh = 1;
+ }
+
+ for (i = nn - 2 - 1; i >= 0; i--)
+ {
+ mp_limb_t n0, q;
+ n0 = np[-1];
+ udiv_qr_3by2 (q, r1, r0, r1, r0, n0, d1, d0, di);
+ np--;
+ qp[i] = q;
+ }
+
+ rp[1] = r1;
+ rp[0] = r0;
+
+ return qh;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/div_qr_2u_pi1.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/div_qr_2u_pi1.c
new file mode 100644
index 00000000000..0b9ddf57532
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/div_qr_2u_pi1.c
@@ -0,0 +1,77 @@
+/* mpn_div_qr_2u_pi1
+
+ Contributed to the GNU project by Niels Möller
+
+ THIS FILE CONTAINS 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 GNU MP RELEASE.
+
+
+Copyright 2011 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.h"
+#include "gmp-impl.h"
+#include "longlong.h"
+
+
+/* 3/2 loop, for unnormalized divisor. Caller must pass shifted d1 and
+ d0, while {np,nn} is shifted on the fly. */
+mp_limb_t
+mpn_div_qr_2u_pi1 (mp_ptr qp, mp_ptr rp, mp_srcptr np, mp_size_t nn,
+ mp_limb_t d1, mp_limb_t d0, int shift, mp_limb_t di)
+{
+ mp_limb_t qh;
+ mp_limb_t r2, r1, r0;
+ mp_size_t i;
+
+ ASSERT (nn >= 2);
+ ASSERT (d1 & GMP_NUMB_HIGHBIT);
+ ASSERT (shift > 0);
+
+ r2 = np[nn-1] >> (GMP_LIMB_BITS - shift);
+ r1 = (np[nn-1] << shift) | (np[nn-2] >> (GMP_LIMB_BITS - shift));
+ r0 = np[nn-2] << shift;
+
+ udiv_qr_3by2 (qh, r2, r1, r2, r1, r0, d1, d0, di);
+
+ for (i = nn - 2 - 1; i >= 0; i--)
+ {
+ mp_limb_t q;
+ r0 = np[i];
+ r1 |= r0 >> (GMP_LIMB_BITS - shift);
+ r0 <<= shift;
+ udiv_qr_3by2 (q, r2, r1, r2, r1, r0, d1, d0, di);
+ qp[i] = q;
+ }
+
+ rp[0] = (r1 >> shift) | (r2 << (GMP_LIMB_BITS - shift));
+ rp[1] = r2 >> shift;
+
+ return qh;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/dive_1.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/dive_1.c
new file mode 100644
index 00000000000..1c0a4e894db
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/dive_1.c
@@ -0,0 +1,148 @@
+/* mpn_divexact_1 -- mpn by limb exact division.
+
+ 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 2000-2003, 2005, 2013 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.h"
+#include "gmp-impl.h"
+#include "longlong.h"
+
+
+
+/* Divide a={src,size} by d=divisor and store the quotient in q={dst,size}.
+ q will only be correct if d divides a exactly.
+
+ A separate loop is used for shift==0 because n<<GMP_LIMB_BITS doesn't
+ give zero on all CPUs (for instance it doesn't on the x86s). This
+ separate loop might run faster too, helping odd divisors.
+
+ Possibilities:
+
+ mpn_divexact_1c could be created, accepting and returning c. This would
+ let a long calculation be done piece by piece. Currently there's no
+ particular need for that, and not returning c means that a final umul can
+ be skipped.
+
+ Another use for returning c would be letting the caller know whether the
+ division was in fact exact. It would work just to return the carry bit
+ "c=(l>s)" and let the caller do a final umul if interested.
+
+ When the divisor is even, the factors of two could be handled with a
+ separate mpn_rshift, instead of shifting on the fly. That might be
+ faster on some CPUs and would mean just the shift==0 style loop would be
+ needed.
+
+ If n<<GMP_LIMB_BITS gives zero on a particular CPU then the separate
+ shift==0 loop is unnecessary, and could be eliminated if there's no great
+ speed difference.
+
+ It's not clear whether "/" is the best way to handle size==1. Alpha gcc
+ 2.95 for instance has a poor "/" and might prefer the modular method.
+ Perhaps a tuned parameter should control this.
+
+ If src[size-1] < divisor then dst[size-1] will be zero, and one divide
+ step could be skipped. A test at last step for s<divisor (or ls in the
+ even case) might be a good way to do that. But if this code is often
+ used with small divisors then it might not be worth bothering */
+
+void
+mpn_divexact_1 (mp_ptr dst, mp_srcptr src, mp_size_t size, mp_limb_t divisor)
+{
+ mp_size_t i;
+ mp_limb_t c, h, l, ls, s, s_next, inverse, dummy;
+ unsigned shift;
+
+ ASSERT (size >= 1);
+ ASSERT (divisor != 0);
+ ASSERT (MPN_SAME_OR_SEPARATE_P (dst, src, size));
+ ASSERT_MPN (src, size);
+ ASSERT_LIMB (divisor);
+
+ if ((divisor & 1) == 0)
+ {
+ count_trailing_zeros (shift, divisor);
+ divisor >>= shift;
+ }
+ else
+ shift = 0;
+
+ binvert_limb (inverse, divisor);
+ divisor <<= GMP_NAIL_BITS;
+
+ if (shift != 0)
+ {
+ c = 0;
+
+ s = src[0];
+
+ for (i = 1; i < size; i++)
+ {
+ s_next = src[i];
+ ls = ((s >> shift) | (s_next << (GMP_NUMB_BITS-shift))) & GMP_NUMB_MASK;
+ s = s_next;
+
+ SUBC_LIMB (c, l, ls, c);
+
+ l = (l * inverse) & GMP_NUMB_MASK;
+ dst[i - 1] = l;
+
+ umul_ppmm (h, dummy, l, divisor);
+ c += h;
+ }
+ while (i < size);
+
+ ls = s >> shift;
+ l = ls - c;
+ l = (l * inverse) & GMP_NUMB_MASK;
+ dst[size - 1] = l;
+ }
+ else
+ {
+ s = src[0];
+
+ l = (s * inverse) & GMP_NUMB_MASK;
+ dst[0] = l;
+ c = 0;
+
+ for (i = 1; i < size; i++)
+ {
+ umul_ppmm (h, dummy, l, divisor);
+ c += h;
+
+ s = src[i];
+ SUBC_LIMB (c, l, s, c);
+
+ l = (l * inverse) & GMP_NUMB_MASK;
+ dst[i] = l;
+ }
+ }
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/diveby3.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/diveby3.c
new file mode 100644
index 00000000000..2ffd9fe777d
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/diveby3.c
@@ -0,0 +1,174 @@
+/* mpn_divexact_by3c -- mpn exact division by 3.
+
+Copyright 2000-2003, 2008 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.h"
+#include "gmp-impl.h"
+
+#if DIVEXACT_BY3_METHOD == 0
+
+mp_limb_t
+mpn_divexact_by3c (mp_ptr rp, mp_srcptr up, mp_size_t un, mp_limb_t c)
+{
+ mp_limb_t r;
+ r = mpn_bdiv_dbm1c (rp, up, un, GMP_NUMB_MASK / 3, GMP_NUMB_MASK / 3 * c);
+
+ /* Possible bdiv_dbm1 return values are C * (GMP_NUMB_MASK / 3), 0 <= C < 3.
+ We want to return C. We compute the remainder mod 4 and notice that the
+ inverse of (2^(2k)-1)/3 mod 4 is 1. */
+ return r & 3;
+}
+
+#endif
+
+#if DIVEXACT_BY3_METHOD == 1
+
+/* The algorithm here is basically the same as mpn_divexact_1, as described
+ in the manual. Namely at each step q = (src[i]-c)*inverse, and new c =
+ borrow(src[i]-c) + high(divisor*q). But because the divisor is just 3,
+ high(divisor*q) can be determined with two comparisons instead of a
+ multiply.
+
+ The "c += ..."s add the high limb of 3*l to c. That high limb will be 0,
+ 1 or 2. Doing two separate "+="s seems to give better code on gcc (as of
+ 2.95.2 at least).
+
+ It will be noted that the new c is formed by adding three values each 0
+ or 1. But the total is only 0, 1 or 2. When the subtraction src[i]-c
+ causes a borrow, that leaves a limb value of either 0xFF...FF or
+ 0xFF...FE. The multiply by MODLIMB_INVERSE_3 gives 0x55...55 or
+ 0xAA...AA respectively, and in those cases high(3*q) is only 0 or 1
+ respectively, hence a total of no more than 2.
+
+ Alternatives:
+
+ This implementation has each multiply on the dependent chain, due to
+ "l=s-c". See below for alternative code which avoids that. */
+
+mp_limb_t
+mpn_divexact_by3c (mp_ptr restrict rp, mp_srcptr restrict up, mp_size_t un, mp_limb_t c)
+{
+ mp_limb_t l, q, s;
+ mp_size_t i;
+
+ ASSERT (un >= 1);
+ ASSERT (c == 0 || c == 1 || c == 2);
+ ASSERT (MPN_SAME_OR_SEPARATE_P (rp, up, un));
+
+ i = 0;
+ do
+ {
+ s = up[i];
+ SUBC_LIMB (c, l, s, c);
+
+ q = (l * MODLIMB_INVERSE_3) & GMP_NUMB_MASK;
+ rp[i] = q;
+
+ c += (q >= GMP_NUMB_CEIL_MAX_DIV3);
+ c += (q >= GMP_NUMB_CEIL_2MAX_DIV3);
+ }
+ while (++i < un);
+
+ ASSERT (c == 0 || c == 1 || c == 2);
+ return c;
+}
+
+
+#endif
+
+#if DIVEXACT_BY3_METHOD == 2
+
+/* The following alternative code re-arranges the quotient calculation from
+ (src[i]-c)*inverse to instead
+
+ q = src[i]*inverse - c*inverse
+
+ thereby allowing src[i]*inverse to be scheduled back as far as desired,
+ making full use of multiplier throughput and leaving just some carry
+ handing on the dependent chain.
+
+ The carry handling consists of determining the c for the next iteration.
+ This is the same as described above, namely look for any borrow from
+ src[i]-c, and at the high of 3*q.
+
+ high(3*q) is done with two comparisons as above (in c2 and c3). The
+ borrow from src[i]-c is incorporated into those by noting that if there's
+ a carry then then we have src[i]-c == 0xFF..FF or 0xFF..FE, in turn
+ giving q = 0x55..55 or 0xAA..AA. Adding 1 to either of those q values is
+ enough to make high(3*q) come out 1 bigger, as required.
+
+ l = -c*inverse is calculated at the same time as c, since for most chips
+ it can be more conveniently derived from separate c1/c2/c3 values than
+ from a combined c equal to 0, 1 or 2.
+
+ The net effect is that with good pipelining this loop should be able to
+ run at perhaps 4 cycles/limb, depending on available execute resources
+ etc.
+
+ Usage:
+
+ This code is not used by default, since we really can't rely on the
+ compiler generating a good software pipeline, nor on such an approach
+ even being worthwhile on all CPUs.
+
+ Itanium is one chip where this algorithm helps though, see
+ mpn/ia64/diveby3.asm. */
+
+mp_limb_t
+mpn_divexact_by3c (mp_ptr restrict rp, mp_srcptr restrict up, mp_size_t un, mp_limb_t cy)
+{
+ mp_limb_t s, sm, cl, q, qx, c2, c3;
+ mp_size_t i;
+
+ ASSERT (un >= 1);
+ ASSERT (cy == 0 || cy == 1 || cy == 2);
+ ASSERT (MPN_SAME_OR_SEPARATE_P (rp, up, un));
+
+ cl = cy == 0 ? 0 : cy == 1 ? -MODLIMB_INVERSE_3 : -2*MODLIMB_INVERSE_3;
+
+ for (i = 0; i < un; i++)
+ {
+ s = up[i];
+ sm = (s * MODLIMB_INVERSE_3) & GMP_NUMB_MASK;
+
+ q = (cl + sm) & GMP_NUMB_MASK;
+ rp[i] = q;
+ qx = q + (s < cy);
+
+ c2 = qx >= GMP_NUMB_CEIL_MAX_DIV3;
+ c3 = qx >= GMP_NUMB_CEIL_2MAX_DIV3 ;
+
+ cy = c2 + c3;
+ cl = (-c2 & -MODLIMB_INVERSE_3) + (-c3 & -MODLIMB_INVERSE_3);
+ }
+
+ return cy;
+}
+
+#endif
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/divexact.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/divexact.c
new file mode 100644
index 00000000000..47a47e3d80a
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/divexact.c
@@ -0,0 +1,294 @@
+/* mpn_divexact(qp,np,nn,dp,dn,tp) -- Divide N = {np,nn} by D = {dp,dn} storing
+ the result in Q = {qp,nn-dn+1} expecting no remainder. Overlap allowed
+ between Q and N; all other overlap disallowed.
+
+ 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 GMP RELEASE.
+
+Copyright 2006, 2007, 2009 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.h"
+#include "gmp-impl.h"
+#include "longlong.h"
+
+#if 1
+void
+mpn_divexact (mp_ptr qp,
+ mp_srcptr np, mp_size_t nn,
+ mp_srcptr dp, mp_size_t dn)
+{
+ unsigned shift;
+ mp_size_t qn;
+ mp_ptr tp;
+ TMP_DECL;
+
+ ASSERT (dn > 0);
+ ASSERT (nn >= dn);
+ ASSERT (dp[dn-1] > 0);
+
+ while (dp[0] == 0)
+ {
+ ASSERT (np[0] == 0);
+ dp++;
+ np++;
+ dn--;
+ nn--;
+ }
+
+ if (dn == 1)
+ {
+ MPN_DIVREM_OR_DIVEXACT_1 (qp, np, nn, dp[0]);
+ return;
+ }
+
+ TMP_MARK;
+
+ qn = nn + 1 - dn;
+ count_trailing_zeros (shift, dp[0]);
+
+ if (shift > 0)
+ {
+ mp_ptr wp;
+ mp_size_t ss;
+ ss = (dn > qn) ? qn + 1 : dn;
+
+ tp = TMP_ALLOC_LIMBS (ss);
+ mpn_rshift (tp, dp, ss, shift);
+ dp = tp;
+
+ /* Since we have excluded dn == 1, we have nn > qn, and we need
+ to shift one limb beyond qn. */
+ wp = TMP_ALLOC_LIMBS (qn + 1);
+ mpn_rshift (wp, np, qn + 1, shift);
+ np = wp;
+ }
+
+ if (dn > qn)
+ dn = qn;
+
+ tp = TMP_ALLOC_LIMBS (mpn_bdiv_q_itch (qn, dn));
+ mpn_bdiv_q (qp, np, qn, dp, dn, tp);
+ TMP_FREE;
+}
+
+#else
+
+/* We use the Jebelean's bidirectional exact division algorithm. This is
+ somewhat naively implemented, with equal quotient parts done by 2-adic
+ division and truncating division. Since 2-adic division is faster, it
+ should be used for a larger chunk.
+
+ This code is horrendously ugly, in all sorts of ways.
+
+ * It was hacked without much care or thought, but with a testing program.
+ * It handles scratch space frivolously, and furthermore the itch function
+ is broken.
+ * Doesn't provide any measures to deal with mu_divappr_q's +3 error. We
+ have yet to provoke an error due to this, though.
+ * Algorithm selection leaves a lot to be desired. In particular, the choice
+ between DC and MU isn't a point, but we treat it like one.
+ * It makes the msb part 1 or 2 limbs larger than the lsb part, in spite of
+ that the latter is faster. We should at least reverse this, but perhaps
+ we should make the lsb part considerably larger. (How do we tune this?)
+*/
+
+mp_size_t
+mpn_divexact_itch (mp_size_t nn, mp_size_t dn)
+{
+ return nn + dn; /* FIXME this is not right */
+}
+
+void
+mpn_divexact (mp_ptr qp,
+ mp_srcptr np, mp_size_t nn,
+ mp_srcptr dp, mp_size_t dn,
+ mp_ptr scratch)
+{
+ mp_size_t qn;
+ mp_size_t nn0, qn0;
+ mp_size_t nn1, qn1;
+ mp_ptr tp;
+ mp_limb_t qml;
+ mp_limb_t qh;
+ int cnt;
+ mp_ptr xdp;
+ mp_limb_t di;
+ mp_limb_t cy;
+ gmp_pi1_t dinv;
+ TMP_DECL;
+
+ TMP_MARK;
+
+ qn = nn - dn + 1;
+
+ /* For small divisors, and small quotients, don't use Jebelean's algorithm. */
+ if (dn < DIVEXACT_JEB_THRESHOLD || qn < DIVEXACT_JEB_THRESHOLD)
+ {
+ tp = scratch;
+ MPN_COPY (tp, np, qn);
+ binvert_limb (di, dp[0]); di = -di;
+ dn = MIN (dn, qn);
+ mpn_sbpi1_bdiv_q (qp, tp, qn, dp, dn, di);
+ TMP_FREE;
+ return;
+ }
+
+ qn0 = ((nn - dn) >> 1) + 1; /* low quotient size */
+
+ /* If quotient is much larger than the divisor, the bidirectional algorithm
+ does not work as currently implemented. Fall back to plain bdiv. */
+ if (qn0 > dn)
+ {
+ if (BELOW_THRESHOLD (dn, DC_BDIV_Q_THRESHOLD))
+ {
+ tp = scratch;
+ MPN_COPY (tp, np, qn);
+ binvert_limb (di, dp[0]); di = -di;
+ dn = MIN (dn, qn);
+ mpn_sbpi1_bdiv_q (qp, tp, qn, dp, dn, di);
+ }
+ else if (BELOW_THRESHOLD (dn, MU_BDIV_Q_THRESHOLD))
+ {
+ tp = scratch;
+ MPN_COPY (tp, np, qn);
+ binvert_limb (di, dp[0]); di = -di;
+ mpn_dcpi1_bdiv_q (qp, tp, qn, dp, dn, di);
+ }
+ else
+ {
+ mpn_mu_bdiv_q (qp, np, qn, dp, dn, scratch);
+ }
+ TMP_FREE;
+ return;
+ }
+
+ nn0 = qn0 + qn0;
+
+ nn1 = nn0 - 1 + ((nn-dn) & 1);
+ qn1 = qn0;
+ if (LIKELY (qn0 != dn))
+ {
+ nn1 = nn1 + 1;
+ qn1 = qn1 + 1;
+ if (UNLIKELY (dp[dn - 1] == 1 && qn1 != dn))
+ {
+ /* If the leading divisor limb == 1, i.e. has just one bit, we have
+ to include an extra limb in order to get the needed overlap. */
+ /* FIXME: Now with the mu_divappr_q function, we should really need
+ more overlap. That indicates one of two things: (1) The test code
+ is not good. (2) We actually overlap too much by default. */
+ nn1 = nn1 + 1;
+ qn1 = qn1 + 1;
+ }
+ }
+
+ tp = TMP_ALLOC_LIMBS (nn1 + 1);
+
+ count_leading_zeros (cnt, dp[dn - 1]);
+
+ /* Normalize divisor, store into tmp area. */
+ if (cnt != 0)
+ {
+ xdp = TMP_ALLOC_LIMBS (qn1);
+ mpn_lshift (xdp, dp + dn - qn1, qn1, cnt);
+ }
+ else
+ {
+ xdp = (mp_ptr) dp + dn - qn1;
+ }
+
+ /* Shift dividend according to the divisor normalization. */
+ /* FIXME: We compute too much here for XX_divappr_q, but these functions'
+ interfaces want a pointer to the imaginative least significant limb, not
+ to the least significant *used* limb. Of course, we could leave nn1-qn1
+ rubbish limbs in the low part, to save some time. */
+ if (cnt != 0)
+ {
+ cy = mpn_lshift (tp, np + nn - nn1, nn1, cnt);
+ if (cy != 0)
+ {
+ tp[nn1] = cy;
+ nn1++;
+ }
+ }
+ else
+ {
+ /* FIXME: This copy is not needed for mpn_mu_divappr_q, except when the
+ mpn_sub_n right before is executed. */
+ MPN_COPY (tp, np + nn - nn1, nn1);
+ }
+
+ invert_pi1 (dinv, xdp[qn1 - 1], xdp[qn1 - 2]);
+ if (BELOW_THRESHOLD (qn1, DC_DIVAPPR_Q_THRESHOLD))
+ {
+ qp[qn0 - 1 + nn1 - qn1] = mpn_sbpi1_divappr_q (qp + qn0 - 1, tp, nn1, xdp, qn1, dinv.inv32);
+ }
+ else if (BELOW_THRESHOLD (qn1, MU_DIVAPPR_Q_THRESHOLD))
+ {
+ qp[qn0 - 1 + nn1 - qn1] = mpn_dcpi1_divappr_q (qp + qn0 - 1, tp, nn1, xdp, qn1, &dinv);
+ }
+ else
+ {
+ /* FIXME: mpn_mu_divappr_q doesn't handle qh != 0. Work around it with a
+ conditional subtraction here. */
+ qh = mpn_cmp (tp + nn1 - qn1, xdp, qn1) >= 0;
+ if (qh)
+ mpn_sub_n (tp + nn1 - qn1, tp + nn1 - qn1, xdp, qn1);
+ mpn_mu_divappr_q (qp + qn0 - 1, tp, nn1, xdp, qn1, scratch);
+ qp[qn0 - 1 + nn1 - qn1] = qh;
+ }
+ qml = qp[qn0 - 1];
+
+ binvert_limb (di, dp[0]); di = -di;
+
+ if (BELOW_THRESHOLD (qn0, DC_BDIV_Q_THRESHOLD))
+ {
+ MPN_COPY (tp, np, qn0);
+ mpn_sbpi1_bdiv_q (qp, tp, qn0, dp, qn0, di);
+ }
+ else if (BELOW_THRESHOLD (qn0, MU_BDIV_Q_THRESHOLD))
+ {
+ MPN_COPY (tp, np, qn0);
+ mpn_dcpi1_bdiv_q (qp, tp, qn0, dp, qn0, di);
+ }
+ else
+ {
+ mpn_mu_bdiv_q (qp, np, qn0, dp, qn0, scratch);
+ }
+
+ if (qml < qp[qn0 - 1])
+ mpn_decr_u (qp + qn0, 1);
+
+ TMP_FREE;
+}
+#endif
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/divis.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/divis.c
new file mode 100644
index 00000000000..9e162e60d2d
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/divis.c
@@ -0,0 +1,201 @@
+/* mpn_divisible_p -- mpn by mpn divisibility test
+
+ 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 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.h"
+#include "gmp-impl.h"
+#include "longlong.h"
+
+
+/* Determine whether A={ap,an} is divisible by D={dp,dn}. Must have both
+ operands normalized, meaning high limbs non-zero, except that an==0 is
+ allowed.
+
+ There usually won't be many low zero bits on D, but the checks for this
+ are fast and might pick up a few operand combinations, in particular they
+ might reduce D to fit the single-limb mod_1/modexact_1 code.
+
+ Future:
+
+ Getting the remainder limb by limb would make an early exit possible on
+ finding a non-zero. This would probably have to be bdivmod style so
+ there's no addback, but it would need a multi-precision inverse and so
+ might be slower than the plain method (on small sizes at least).
+
+ When D must be normalized (shifted to low bit set), it's possible to
+ suppress the bit-shifting of A down, as long as it's already been checked
+ that A has at least as many trailing zero bits as D. */
+
+int
+mpn_divisible_p (mp_srcptr ap, mp_size_t an,
+ mp_srcptr dp, mp_size_t dn)
+{
+ mp_limb_t alow, dlow, dmask;
+ mp_ptr qp, rp, tp;
+ mp_size_t i;
+ mp_limb_t di;
+ unsigned twos;
+ TMP_DECL;
+
+ ASSERT (an >= 0);
+ ASSERT (an == 0 || ap[an-1] != 0);
+ ASSERT (dn >= 1);
+ ASSERT (dp[dn-1] != 0);
+ ASSERT_MPN (ap, an);
+ ASSERT_MPN (dp, dn);
+
+ /* When a<d only a==0 is divisible.
+ Notice this test covers all cases of an==0. */
+ if (an < dn)
+ return (an == 0);
+
+ /* Strip low zero limbs from d, requiring a==0 on those. */
+ for (;;)
+ {
+ alow = *ap;
+ dlow = *dp;
+
+ if (dlow != 0)
+ break;
+
+ if (alow != 0)
+ return 0; /* a has fewer low zero limbs than d, so not divisible */
+
+ /* a!=0 and d!=0 so won't get to n==0 */
+ an--; ASSERT (an >= 1);
+ dn--; ASSERT (dn >= 1);
+ ap++;
+ dp++;
+ }
+
+ /* a must have at least as many low zero bits as d */
+ dmask = LOW_ZEROS_MASK (dlow);
+ if ((alow & dmask) != 0)
+ return 0;
+
+ if (dn == 1)
+ {
+ if (ABOVE_THRESHOLD (an, BMOD_1_TO_MOD_1_THRESHOLD))
+ return mpn_mod_1 (ap, an, dlow) == 0;
+
+ count_trailing_zeros (twos, dlow);
+ dlow >>= twos;
+ return mpn_modexact_1_odd (ap, an, dlow) == 0;
+ }
+
+ if (dn == 2)
+ {
+ mp_limb_t dsecond = dp[1];
+ if (dsecond <= dmask)
+ {
+ count_trailing_zeros (twos, dlow);
+ dlow = (dlow >> twos) | (dsecond << (GMP_NUMB_BITS-twos));
+ ASSERT_LIMB (dlow);
+ return MPN_MOD_OR_MODEXACT_1_ODD (ap, an, dlow) == 0;
+ }
+ }
+
+ /* Should we compute Q = A * D^(-1) mod B^k,
+ R = A - Q * D mod B^k
+ here, for some small values of k? Then check if R = 0 (mod B^k). */
+
+ /* We could also compute A' = A mod T and D' = D mod P, for some
+ P = 3 * 5 * 7 * 11 ..., and then check if any prime factor from P
+ dividing D' also divides A'. */
+
+ TMP_MARK;
+
+ rp = TMP_ALLOC_LIMBS (an + 1);
+ qp = TMP_ALLOC_LIMBS (an - dn + 1); /* FIXME: Could we avoid this? */
+
+ count_trailing_zeros (twos, dp[0]);
+
+ if (twos != 0)
+ {
+ tp = TMP_ALLOC_LIMBS (dn);
+ ASSERT_NOCARRY (mpn_rshift (tp, dp, dn, twos));
+ dp = tp;
+
+ ASSERT_NOCARRY (mpn_rshift (rp, ap, an, twos));
+ }
+ else
+ {
+ MPN_COPY (rp, ap, an);
+ }
+ if (rp[an - 1] >= dp[dn - 1])
+ {
+ rp[an] = 0;
+ an++;
+ }
+ else if (an == dn)
+ {
+ TMP_FREE;
+ return 0;
+ }
+
+ ASSERT (an > dn); /* requirement of functions below */
+
+ if (BELOW_THRESHOLD (dn, DC_BDIV_QR_THRESHOLD) ||
+ BELOW_THRESHOLD (an - dn, DC_BDIV_QR_THRESHOLD))
+ {
+ binvert_limb (di, dp[0]);
+ mpn_sbpi1_bdiv_qr (qp, rp, an, dp, dn, -di);
+ rp += an - dn;
+ }
+ else if (BELOW_THRESHOLD (dn, MU_BDIV_QR_THRESHOLD))
+ {
+ binvert_limb (di, dp[0]);
+ mpn_dcpi1_bdiv_qr (qp, rp, an, dp, dn, -di);
+ rp += an - dn;
+ }
+ else
+ {
+ tp = TMP_ALLOC_LIMBS (mpn_mu_bdiv_qr_itch (an, dn));
+ 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);
+
+ TMP_FREE;
+ return 1;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/divrem.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/divrem.c
new file mode 100644
index 00000000000..f420992746e
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/divrem.c
@@ -0,0 +1,108 @@
+/* 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.
+
+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.h"
+#include "gmp-impl.h"
+#include "longlong.h"
+
+mp_limb_t
+mpn_divrem (mp_ptr qp, mp_size_t qxn,
+ mp_ptr np, mp_size_t nn,
+ mp_srcptr dp, mp_size_t dn)
+{
+ ASSERT (qxn >= 0);
+ ASSERT (nn >= dn);
+ ASSERT (dn >= 1);
+ ASSERT (dp[dn-1] & GMP_NUMB_HIGHBIT);
+ ASSERT (! MPN_OVERLAP_P (np, nn, dp, dn));
+ ASSERT (! MPN_OVERLAP_P (qp, nn-dn+qxn, np, nn) || qp==np+dn+qxn);
+ ASSERT (! MPN_OVERLAP_P (qp, nn-dn+qxn, dp, dn));
+ ASSERT_MPN (np, nn);
+ ASSERT_MPN (dp, dn);
+
+ if (dn == 1)
+ {
+ mp_limb_t ret;
+ mp_ptr q2p;
+ mp_size_t qn;
+ TMP_DECL;
+
+ TMP_MARK;
+ q2p = TMP_ALLOC_LIMBS (nn + qxn);
+
+ np[0] = mpn_divrem_1 (q2p, qxn, np, nn, dp[0]);
+ qn = nn + qxn - 1;
+ MPN_COPY (qp, q2p, qn);
+ ret = q2p[qn];
+
+ TMP_FREE;
+ return ret;
+ }
+ else if (dn == 2)
+ {
+ return mpn_divrem_2 (qp, qxn, np, nn, dp);
+ }
+ else
+ {
+ mp_ptr rp, q2p;
+ mp_limb_t qhl;
+ mp_size_t qn;
+ TMP_DECL;
+
+ TMP_MARK;
+ if (UNLIKELY (qxn != 0))
+ {
+ mp_ptr n2p;
+ n2p = TMP_ALLOC_LIMBS (nn + qxn);
+ 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);
+ qn = nn - dn + qxn;
+ MPN_COPY (qp, q2p, qn);
+ qhl = q2p[qn];
+ }
+ 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 */
+ qn = nn - dn;
+ MPN_COPY (qp, q2p, qn);
+ qhl = q2p[qn];
+ }
+ TMP_FREE;
+ return qhl;
+ }
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/divrem_1.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/divrem_1.c
new file mode 100644
index 00000000000..9157b5735e2
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/divrem_1.c
@@ -0,0 +1,255 @@
+/* mpn_divrem_1 -- mpn by limb division.
+
+Copyright 1991, 1993, 1994, 1996, 1998-2000, 2002, 2003 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.h"
+#include "gmp-impl.h"
+#include "longlong.h"
+
+
+/* The size where udiv_qrnnd_preinv should be used rather than udiv_qrnnd,
+ meaning the quotient size where that should happen, the quotient size
+ being how many udiv divisions will be done.
+
+ The default is to use preinv always, CPUs where this doesn't suit have
+ tuned thresholds. Note in particular that preinv should certainly be
+ used if that's the only division available (USE_PREINV_ALWAYS). */
+
+#ifndef DIVREM_1_NORM_THRESHOLD
+#define DIVREM_1_NORM_THRESHOLD 0
+#endif
+#ifndef DIVREM_1_UNNORM_THRESHOLD
+#define DIVREM_1_UNNORM_THRESHOLD 0
+#endif
+
+
+
+/* If the cpu only has multiply-by-inverse division (eg. alpha), then NORM
+ and UNNORM thresholds are 0 and only the inversion code is included.
+
+ If multiply-by-inverse is never viable, then NORM and UNNORM thresholds
+ will be MP_SIZE_T_MAX and only the plain division code is included.
+
+ Otherwise mul-by-inverse is better than plain division above some
+ threshold, and best results are obtained by having code for both present.
+
+ The main reason for separating the norm and unnorm cases is that not all
+ CPUs give zero for "n0 >> GMP_LIMB_BITS" which would arise in the unnorm
+ code used on an already normalized divisor.
+
+ If UDIV_NEEDS_NORMALIZATION is false then plain division uses the same
+ non-shifting code for both the norm and unnorm cases, though with
+ different criteria for skipping a division, and with different thresholds
+ of course. And in fact if inversion is never viable, then that simple
+ non-shifting division would be all that's left.
+
+ The NORM and UNNORM thresholds might not differ much, but if there's
+ going to be separate code for norm and unnorm then it makes sense to have
+ separate thresholds. One thing that's possible is that the
+ mul-by-inverse might be better only for normalized divisors, due to that
+ case not needing variable bit shifts.
+
+ Notice that the thresholds are tested after the decision to possibly skip
+ one divide step, so they're based on the actual number of divisions done.
+
+ For the unnorm case, it would be possible to call mpn_lshift to adjust
+ the dividend all in one go (into the quotient space say), rather than
+ limb-by-limb in the loop. This might help if mpn_lshift is a lot faster
+ than what the compiler can generate for EXTRACT. But this is left to CPU
+ specific implementations to consider, especially since EXTRACT isn't on
+ the dependent chain. */
+
+mp_limb_t
+mpn_divrem_1 (mp_ptr qp, mp_size_t qxn,
+ mp_srcptr up, mp_size_t un, mp_limb_t d)
+{
+ mp_size_t n;
+ mp_size_t i;
+ mp_limb_t n1, n0;
+ mp_limb_t r = 0;
+
+ ASSERT (qxn >= 0);
+ ASSERT (un >= 0);
+ ASSERT (d != 0);
+ /* FIXME: What's the correct overlap rule when qxn!=0? */
+ ASSERT (MPN_SAME_OR_SEPARATE_P (qp+qxn, up, un));
+
+ n = un + qxn;
+ if (n == 0)
+ return 0;
+
+ d <<= GMP_NAIL_BITS;
+
+ qp += (n - 1); /* Make qp point at most significant quotient limb */
+
+ if ((d & GMP_LIMB_HIGHBIT) != 0)
+ {
+ if (un != 0)
+ {
+ /* High quotient limb is 0 or 1, skip a divide step. */
+ mp_limb_t q;
+ r = up[un - 1] << GMP_NAIL_BITS;
+ q = (r >= d);
+ *qp-- = q;
+ r -= (d & -q);
+ r >>= GMP_NAIL_BITS;
+ n--;
+ un--;
+ }
+
+ if (BELOW_THRESHOLD (n, DIVREM_1_NORM_THRESHOLD))
+ {
+ plain:
+ for (i = un - 1; i >= 0; i--)
+ {
+ n0 = up[i] << GMP_NAIL_BITS;
+ udiv_qrnnd (*qp, r, r, n0, d);
+ r >>= GMP_NAIL_BITS;
+ qp--;
+ }
+ for (i = qxn - 1; i >= 0; i--)
+ {
+ udiv_qrnnd (*qp, r, r, CNST_LIMB(0), d);
+ r >>= GMP_NAIL_BITS;
+ qp--;
+ }
+ return r;
+ }
+ else
+ {
+ /* Multiply-by-inverse, divisor already normalized. */
+ mp_limb_t dinv;
+ invert_limb (dinv, d);
+
+ for (i = un - 1; i >= 0; i--)
+ {
+ n0 = up[i] << GMP_NAIL_BITS;
+ udiv_qrnnd_preinv (*qp, r, r, n0, d, dinv);
+ r >>= GMP_NAIL_BITS;
+ qp--;
+ }
+ for (i = qxn - 1; i >= 0; i--)
+ {
+ udiv_qrnnd_preinv (*qp, r, r, CNST_LIMB(0), d, dinv);
+ r >>= GMP_NAIL_BITS;
+ qp--;
+ }
+ return r;
+ }
+ }
+ else
+ {
+ /* Most significant bit of divisor == 0. */
+ int cnt;
+
+ /* Skip a division if high < divisor (high quotient 0). Testing here
+ before normalizing will still skip as often as possible. */
+ if (un != 0)
+ {
+ n1 = up[un - 1] << GMP_NAIL_BITS;
+ if (n1 < d)
+ {
+ r = n1 >> GMP_NAIL_BITS;
+ *qp-- = 0;
+ n--;
+ if (n == 0)
+ return r;
+ un--;
+ }
+ }
+
+ if (! UDIV_NEEDS_NORMALIZATION
+ && BELOW_THRESHOLD (n, DIVREM_1_UNNORM_THRESHOLD))
+ goto plain;
+
+ count_leading_zeros (cnt, d);
+ d <<= cnt;
+ r <<= cnt;
+
+ if (UDIV_NEEDS_NORMALIZATION
+ && BELOW_THRESHOLD (n, DIVREM_1_UNNORM_THRESHOLD))
+ {
+ mp_limb_t nshift;
+ if (un != 0)
+ {
+ n1 = up[un - 1] << GMP_NAIL_BITS;
+ r |= (n1 >> (GMP_LIMB_BITS - cnt));
+ for (i = un - 2; i >= 0; i--)
+ {
+ n0 = up[i] << GMP_NAIL_BITS;
+ nshift = (n1 << cnt) | (n0 >> (GMP_NUMB_BITS - cnt));
+ udiv_qrnnd (*qp, r, r, nshift, d);
+ r >>= GMP_NAIL_BITS;
+ qp--;
+ n1 = n0;
+ }
+ udiv_qrnnd (*qp, r, r, n1 << cnt, d);
+ r >>= GMP_NAIL_BITS;
+ qp--;
+ }
+ for (i = qxn - 1; i >= 0; i--)
+ {
+ udiv_qrnnd (*qp, r, r, CNST_LIMB(0), d);
+ r >>= GMP_NAIL_BITS;
+ qp--;
+ }
+ return r >> cnt;
+ }
+ else
+ {
+ mp_limb_t dinv, nshift;
+ invert_limb (dinv, d);
+ if (un != 0)
+ {
+ n1 = up[un - 1] << GMP_NAIL_BITS;
+ r |= (n1 >> (GMP_LIMB_BITS - cnt));
+ for (i = un - 2; i >= 0; i--)
+ {
+ n0 = up[i] << GMP_NAIL_BITS;
+ nshift = (n1 << cnt) | (n0 >> (GMP_NUMB_BITS - cnt));
+ udiv_qrnnd_preinv (*qp, r, r, nshift, d, dinv);
+ r >>= GMP_NAIL_BITS;
+ qp--;
+ n1 = n0;
+ }
+ udiv_qrnnd_preinv (*qp, r, r, n1 << cnt, d, dinv);
+ r >>= GMP_NAIL_BITS;
+ qp--;
+ }
+ for (i = qxn - 1; i >= 0; i--)
+ {
+ udiv_qrnnd_preinv (*qp, r, r, CNST_LIMB(0), d, dinv);
+ r >>= GMP_NAIL_BITS;
+ qp--;
+ }
+ return r >> cnt;
+ }
+ }
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/divrem_2.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/divrem_2.c
new file mode 100644
index 00000000000..30d24bb1025
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/divrem_2.c
@@ -0,0 +1,119 @@
+/* mpn_divrem_2 -- Divide natural numbers, producing both remainder and
+ quotient. The divisor is two limbs.
+
+ THIS FILE CONTAINS 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 GNU MP RELEASE.
+
+
+Copyright 1993-1996, 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/. */
+
+#include "gmp.h"
+#include "gmp-impl.h"
+#include "longlong.h"
+
+
+/* Divide num {np,nn} by den {dp,2} and write the nn-2 least significant
+ quotient limbs at qp and the 2 long remainder at np. If qxn is non-zero,
+ generate that many fraction bits and append them after the other quotient
+ limbs. Return the most significant limb of the quotient, this is always 0
+ or 1.
+
+ Preconditions:
+ 1. The most significant bit of the divisor must be set.
+ 2. qp must either not overlap with the input 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.
+ 3. nn >= 2, even if qxn is non-zero. */
+
+mp_limb_t
+mpn_divrem_2 (mp_ptr qp, mp_size_t qxn,
+ mp_ptr np, mp_size_t nn,
+ mp_srcptr dp)
+{
+ mp_limb_t most_significant_q_limb;
+ mp_size_t i;
+ mp_limb_t r1, r0, d1, d0;
+ gmp_pi1_t di;
+
+ ASSERT (nn >= 2);
+ ASSERT (qxn >= 0);
+ ASSERT (dp[1] & GMP_NUMB_HIGHBIT);
+ ASSERT (! MPN_OVERLAP_P (qp, nn-2+qxn, np, nn) || qp >= np+2);
+ ASSERT_MPN (np, nn);
+ ASSERT_MPN (dp, 2);
+
+ np += nn - 2;
+ d1 = dp[1];
+ d0 = dp[0];
+ r1 = np[1];
+ r0 = np[0];
+
+ most_significant_q_limb = 0;
+ if (r1 >= d1 && (r1 > d1 || r0 >= d0))
+ {
+#if GMP_NAIL_BITS == 0
+ sub_ddmmss (r1, r0, r1, r0, d1, d0);
+#else
+ r0 = r0 - d0;
+ r1 = r1 - d1 - (r0 >> GMP_LIMB_BITS - 1);
+ r0 &= GMP_NUMB_MASK;
+#endif
+ most_significant_q_limb = 1;
+ }
+
+ invert_pi1 (di, d1, d0);
+
+ qp += qxn;
+
+ for (i = nn - 2 - 1; i >= 0; i--)
+ {
+ mp_limb_t n0, q;
+ n0 = np[-1];
+ udiv_qr_3by2 (q, r1, r0, r1, r0, n0, d1, d0, di.inv32);
+ np--;
+ qp[i] = q;
+ }
+
+ if (UNLIKELY (qxn != 0))
+ {
+ qp -= qxn;
+ for (i = qxn - 1; i >= 0; i--)
+ {
+ mp_limb_t q;
+ udiv_qr_3by2 (q, r1, r0, r1, r0, CNST_LIMB(0), d1, d0, di.inv32);
+ qp[i] = q;
+ }
+ }
+
+ np[1] = r1;
+ np[0] = r0;
+
+ return most_significant_q_limb;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/dump.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/dump.c
new file mode 100644
index 00000000000..3a73fe49e31
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/dump.c
@@ -0,0 +1,100 @@
+/* THIS IS AN INTERNAL FUNCTION WITH A MUTABLE INTERFACE. IT IS NOT SAFE TO
+ CALL THIS FUNCTION DIRECTLY. IN FACT, IT IS ALMOST GUARANTEED THAT THIS
+ FUNCTION WILL CHANGE OR DISAPPEAR IN A FUTURE GNU MP RELEASE.
+
+
+Copyright 1996, 2000-2002, 2005 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.h"
+#include "gmp-impl.h"
+
+#if GMP_NUMB_BITS % 4 == 0
+void
+mpn_dump (mp_srcptr ptr, mp_size_t n)
+{
+ MPN_NORMALIZE (ptr, n);
+
+ if (n == 0)
+ printf ("0\n");
+ else
+ {
+ n--;
+#if _LONG_LONG_LIMB
+ if ((ptr[n] >> GMP_LIMB_BITS / 2) != 0)
+ {
+ printf ("%lX", (unsigned long) (ptr[n] >> GMP_LIMB_BITS / 2));
+ printf ("%0*lX", (GMP_LIMB_BITS / 2 / 4), (unsigned long) ptr[n]);
+ }
+ else
+#endif
+ printf ("%lX", (unsigned long) ptr[n]);
+
+ while (n)
+ {
+ n--;
+#if _LONG_LONG_LIMB
+ printf ("%0*lX", (GMP_NUMB_BITS - GMP_LIMB_BITS / 2) / 4,
+ (unsigned long) (ptr[n] >> GMP_LIMB_BITS / 2));
+ printf ("%0*lX", GMP_LIMB_BITS / 2 / 4, (unsigned long) ptr[n]);
+#else
+ printf ("%0*lX", GMP_NUMB_BITS / 4, (unsigned long) ptr[n]);
+#endif
+ }
+ printf ("\n");
+ }
+}
+
+#else
+
+static void
+mpn_recdump (mp_ptr p, mp_size_t n)
+{
+ mp_limb_t lo;
+ if (n != 0)
+ {
+ lo = p[0] & 0xf;
+ mpn_rshift (p, p, n, 4);
+ mpn_recdump (p, n);
+ printf ("%lX", lo);
+ }
+}
+
+void
+mpn_dump (mp_srcptr p, mp_size_t n)
+{
+ mp_ptr tp;
+ TMP_DECL;
+ TMP_MARK;
+ tp = TMP_ALLOC_LIMBS (n);
+ MPN_COPY (tp, p, n);
+ TMP_FREE;
+}
+
+#endif
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/fib2_ui.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/fib2_ui.c
new file mode 100644
index 00000000000..eb6e56e736e
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/fib2_ui.c
@@ -0,0 +1,189 @@
+/* mpn_fib2_ui -- calculate Fibonacci numbers.
+
+ 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 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.h"
+#include "gmp-impl.h"
+
+/* change this to "#define TRACE(x) x" for diagnostics */
+#define TRACE(x)
+
+
+/* Store F[n] at fp and F[n-1] at f1p. fp and f1p should have room for
+ MPN_FIB2_SIZE(n) limbs.
+
+ The return value is the actual number of limbs stored, this will be at
+ least 1. fp[size-1] will be non-zero, except when n==0, in which case
+ 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:
+
+ 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.
+*/
+
+mp_size_t
+mpn_fib2_ui (mp_ptr fp, mp_ptr f1p, unsigned long int n)
+{
+ mp_size_t size;
+ unsigned long nfirst, mask;
+
+ TRACE (printf ("mpn_fib2_ui n=%lu\n", n));
+
+ ASSERT (! MPN_OVERLAP_P (fp, MPN_FIB2_SIZE(n), f1p, MPN_FIB2_SIZE(n)));
+
+ /* Take a starting pair from the table. */
+ mask = 1;
+ for (nfirst = n; nfirst > FIB_TABLE_LIMIT; nfirst /= 2)
+ mask <<= 1;
+ TRACE (printf ("nfirst=%lu mask=0x%lX\n", nfirst, mask));
+
+ f1p[0] = FIB_TABLE ((int) nfirst - 1);
+ fp[0] = FIB_TABLE (nfirst);
+ size = 1;
+
+ /* Skip to the end if the table lookup gives the final answer. */
+ if (mask != 1)
+ {
+ mp_size_t alloc;
+ mp_ptr xp;
+ TMP_DECL;
+
+ TMP_MARK;
+ alloc = MPN_FIB2_SIZE (n);
+ xp = TMP_ALLOC_LIMBS (alloc);
+
+ do
+ {
+ /* Here fp==F[k] and f1p==F[k-1], with k being the bits of n from
+ n&mask upwards.
+
+ The next bit of n is n&(mask>>1) and 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. */
+
+ TRACE (printf ("k=%lu mask=0x%lX size=%ld alloc=%ld\n",
+ n >> refmpn_count_trailing_zeros(mask),
+ mask, size, alloc);
+ mpn_trace ("fp ", fp, size);
+ mpn_trace ("f1p", f1p, size));
+
+ /* fp normalized, f1p at most one high zero */
+ ASSERT (fp[size-1] != 0);
+ ASSERT (f1p[size-1] != 0 || f1p[size-2] != 0);
+
+ /* f1p[size-1] might be zero, but this occurs rarely, so it's not
+ worth bothering checking for it */
+ ASSERT (alloc >= 2*size);
+ mpn_sqr (xp, fp, size);
+ mpn_sqr (fp, f1p, size);
+ size *= 2;
+
+ /* Shrink if possible. Since fp was normalized there'll be at
+ most one high zero on xp (and if there is then there's one on
+ yp too). */
+ ASSERT (xp[size-1] != 0 || fp[size-1] == 0);
+ size -= (xp[size-1] == 0);
+ ASSERT (xp[size-1] != 0); /* only one xp high zero */
+
+ /* Calculate F[2k-1] = F[k]^2 + F[k-1]^2. */
+ f1p[size] = mpn_add_n (f1p, xp, fp, size);
+
+ /* 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. */
+#if HAVE_NATIVE_mpn_rsblsh2_n || HAVE_NATIVE_mpn_rsblsh_n
+#if HAVE_NATIVE_mpn_rsblsh2_n
+ fp[size] = mpn_rsblsh2_n (fp, fp, xp, size);
+#else /* HAVE_NATIVE_mpn_rsblsh_n */
+ fp[size] = mpn_rsblsh_n (fp, fp, xp, size, 2);
+#endif
+ if ((n & mask) == 0)
+ MPN_INCR_U(fp, size + 1, 2); /* possible +2 */
+ else
+ {
+ ASSERT (fp[0] >= 2);
+ fp[0] -= 2; /* possible -2 */
+ }
+#else
+ {
+ mp_limb_t c;
+
+ 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
+ ASSERT (alloc >= size+1);
+ size += (fp[size] != 0);
+
+ /* now n&mask is the new bit of n being considered */
+ mask >>= 1;
+
+ /* Calculate F[2k] = F[2k+1] - F[2k-1], replacing the unwanted one of
+ F[2k+1] and F[2k-1]. */
+ if (n & mask)
+ ASSERT_NOCARRY (mpn_sub_n (f1p, fp, f1p, size));
+ else {
+ ASSERT_NOCARRY (mpn_sub_n ( fp, fp, f1p, size));
+
+ /* Can have a high zero after replacing F[2k+1] with F[2k].
+ f1p will have a high zero if fp does. */
+ ASSERT (fp[size-1] != 0 || f1p[size-1] == 0);
+ size -= (fp[size-1] == 0);
+ }
+ }
+ while (mask != 1);
+
+ TMP_FREE;
+ }
+
+ TRACE (printf ("done size=%ld\n", size);
+ mpn_trace ("fp ", fp, size);
+ mpn_trace ("f1p", f1p, size));
+
+ return size;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/gcd.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/gcd.c
new file mode 100644
index 00000000000..b14e1ad888f
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/gcd.c
@@ -0,0 +1,310 @@
+/* mpn/gcd.c: mpn_gcd for gcd of two odd integers.
+
+Copyright 1991, 1993-1998, 2000-2005, 2008, 2010, 2012 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.h"
+#include "gmp-impl.h"
+#include "longlong.h"
+
+/* Uses the HGCD operation described in
+
+ N. Möller, On Schönhage's algorithm and subquadratic integer gcd
+ computation, Math. Comp. 77 (2008), 589-607.
+
+ to reduce inputs until they are of size below GCD_DC_THRESHOLD, and
+ then uses Lehmer's algorithm.
+*/
+
+/* Some reasonable choices are n / 2 (same as in hgcd), and p = (n +
+ * 2)/3, which gives a balanced multiplication in
+ * mpn_hgcd_matrix_adjust. However, p = 2 n/3 gives slightly better
+ * performance. The matrix-vector multiplication is then
+ * 4:1-unbalanced, with matrix elements of size n/6, and vector
+ * elements of size p = 2n/3. */
+
+/* From analysis of the theoretical running time, it appears that when
+ * multiplication takes time O(n^alpha), p should be chosen so that
+ * the ratio of the time for the mpn_hgcd call, and the time for the
+ * multiplication in mpn_hgcd_matrix_adjust, is roughly 1/(alpha -
+ * 1). */
+#ifdef TUNE_GCD_P
+#define P_TABLE_SIZE 10000
+mp_size_t p_table[P_TABLE_SIZE];
+#define CHOOSE_P(n) ( (n) < P_TABLE_SIZE ? p_table[n] : 2*(n)/3)
+#else
+#define CHOOSE_P(n) (2*(n) / 3)
+#endif
+
+struct gcd_ctx
+{
+ mp_ptr gp;
+ mp_size_t gn;
+};
+
+static void
+gcd_hook (void *p, mp_srcptr gp, mp_size_t gn,
+ mp_srcptr qp, mp_size_t qn, int d)
+{
+ struct gcd_ctx *ctx = (struct gcd_ctx *) p;
+ MPN_COPY (ctx->gp, gp, gn);
+ 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)
+{
+ mp_size_t talloc;
+ mp_size_t scratch;
+ mp_size_t matrix_scratch;
+
+ struct gcd_ctx ctx;
+ mp_ptr tp;
+ TMP_DECL;
+
+ ASSERT (usize >= n);
+ ASSERT (n > 0);
+ ASSERT (vp[n-1] > 0);
+
+ /* FIXME: Check for small sizes first, before setting up temporary
+ storage etc. */
+ talloc = MPN_GCD_SUBDIV_STEP_ITCH(n);
+
+ /* For initial division */
+ scratch = usize - n + 1;
+ if (scratch > talloc)
+ talloc = scratch;
+
+#if TUNE_GCD_P
+ if (CHOOSE_P (n) > 0)
+#else
+ if (ABOVE_THRESHOLD (n, GCD_DC_THRESHOLD))
+#endif
+ {
+ mp_size_t hgcd_scratch;
+ mp_size_t update_scratch;
+ mp_size_t p = CHOOSE_P (n);
+ mp_size_t scratch;
+#if TUNE_GCD_P
+ /* Worst case, since we don't guarantee that n - CHOOSE_P(n)
+ is increasing */
+ matrix_scratch = MPN_HGCD_MATRIX_INIT_ITCH (n);
+ hgcd_scratch = mpn_hgcd_itch (n);
+ update_scratch = 2*(n - 1);
+#else
+ matrix_scratch = MPN_HGCD_MATRIX_INIT_ITCH (n - p);
+ hgcd_scratch = mpn_hgcd_itch (n - p);
+ update_scratch = p + n - 1;
+#endif
+ scratch = matrix_scratch + MAX(hgcd_scratch, update_scratch);
+ if (scratch > talloc)
+ talloc = scratch;
+ }
+
+ TMP_MARK;
+ tp = TMP_ALLOC_LIMBS(talloc);
+
+ if (usize > n)
+ {
+ mpn_tdiv_qr (tp, up, 0, up, usize, vp, n);
+
+ if (mpn_zero_p (up, n))
+ {
+ MPN_COPY (gp, vp, n);
+ ctx.gn = n;
+ goto done;
+ }
+ }
+
+ ctx.gp = gp;
+
+#if TUNE_GCD_P
+ while (CHOOSE_P (n) > 0)
+#else
+ while (ABOVE_THRESHOLD (n, GCD_DC_THRESHOLD))
+#endif
+ {
+ struct hgcd_matrix M;
+ mp_size_t p = CHOOSE_P (n);
+ mp_size_t matrix_scratch = MPN_HGCD_MATRIX_INIT_ITCH (n - p);
+ mp_size_t nn;
+ mpn_hgcd_matrix_init (&M, n - p, tp);
+ nn = mpn_hgcd (up + p, vp + p, n - p, &M, tp + matrix_scratch);
+ if (nn > 0)
+ {
+ ASSERT (M.n <= (n - p - 1)/2);
+ ASSERT (M.n + p <= (p + n - 1) / 2);
+ /* Temporary storage 2 (p + M->n) <= p + n - 1. */
+ n = mpn_hgcd_matrix_adjust (&M, p + nn, up, vp, p, tp + matrix_scratch);
+ }
+ else
+ {
+ /* Temporary storage n */
+ n = mpn_gcd_subdiv_step (up, vp, n, 0, gcd_hook, &ctx, tp);
+ if (n == 0)
+ goto done;
+ }
+ }
+
+ while (n > 2)
+ {
+ struct hgcd_matrix1 M;
+ mp_limb_t uh, ul, vh, vl;
+ mp_limb_t mask;
+
+ mask = up[n-1] | vp[n-1];
+ ASSERT (mask > 0);
+
+ if (mask & GMP_NUMB_HIGHBIT)
+ {
+ uh = up[n-1]; ul = up[n-2];
+ vh = vp[n-1]; vl = vp[n-2];
+ }
+ else
+ {
+ int shift;
+
+ count_leading_zeros (shift, mask);
+ uh = MPN_EXTRACT_NUMB (shift, up[n-1], up[n-2]);
+ ul = MPN_EXTRACT_NUMB (shift, up[n-2], up[n-3]);
+ vh = MPN_EXTRACT_NUMB (shift, vp[n-1], vp[n-2]);
+ vl = MPN_EXTRACT_NUMB (shift, vp[n-2], vp[n-3]);
+ }
+
+ /* Try an mpn_hgcd2 step */
+ if (mpn_hgcd2 (uh, ul, vh, vl, &M))
+ {
+ n = mpn_matrix22_mul1_inverse_vector (&M, tp, up, vp, n);
+ MP_PTR_SWAP (up, tp);
+ }
+ else
+ {
+ /* mpn_hgcd2 has failed. Then either one of a or b is very
+ small, or the difference is very small. Perform one
+ subtraction followed by one division. */
+
+ /* Temporary storage n */
+ n = mpn_gcd_subdiv_step (up, vp, n, 0, &gcd_hook, &ctx, tp);
+ if (n == 0)
+ goto done;
+ }
+ }
+
+ 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))
+ MP_PTR_SWAP (up, vp);
+
+ ASSERT (up[0] & 1);
+
+ 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;
+ }
+
+ ctx.gn = gcd_2(gp, up, vp);
+
+done:
+ TMP_FREE;
+ return ctx.gn;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/gcd_1.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/gcd_1.c
new file mode 100644
index 00000000000..f6dcb4a2eb8
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/gcd_1.c
@@ -0,0 +1,199 @@
+/* mpn_gcd_1 -- mpn and limb greatest common divisor.
+
+Copyright 1994, 1996, 2000, 2001, 2009, 2012 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.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.
+
+ The threshold for doing u%v when size==1 will vary by CPU according to
+ the speed of a division and the code generated for the main loop. Any
+ tuning for this is left to a CPU specific implementation. */
+
+mp_limb_t
+mpn_gcd_1 (mp_srcptr up, mp_size_t size, mp_limb_t vlimb)
+{
+ mp_limb_t ulimb;
+ unsigned long zero_bits, u_low_zero_bits;
+
+ ASSERT (size >= 1);
+ ASSERT (vlimb != 0);
+ ASSERT_MPN_NONZERO_P (up, size);
+
+ ulimb = up[0];
+
+ /* Need vlimb odd for modexact, want it odd to get common zeros. */
+ count_trailing_zeros (zero_bits, vlimb);
+ vlimb >>= zero_bits;
+
+ if (size > 1)
+ {
+ /* Must get common zeros before the mod reduction. If ulimb==0 then
+ vlimb already gives the common zeros. */
+ if (ulimb != 0)
+ {
+ count_trailing_zeros (u_low_zero_bits, ulimb);
+ zero_bits = MIN (zero_bits, u_low_zero_bits);
+ }
+
+ ulimb = MPN_MOD_OR_MODEXACT_1_ODD (up, size, 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);
+
+ /* 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)
+ {
+ ulimb %= vlimb;
+ if (ulimb == 0)
+ goto done;
+ goto strip_u_maybe;
+ }
+
+ ASSERT (ulimb & 1);
+ ASSERT (vlimb & 1);
+
+#if GCD_1_METHOD == 1
+ while (ulimb != vlimb)
+ {
+ ASSERT (ulimb & 1);
+ ASSERT (vlimb & 1);
+
+ if (ulimb > 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 >>= 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];
+ }
+#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
+
+ done:
+ return vlimb << zero_bits;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/gcd_subdiv_step.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/gcd_subdiv_step.c
new file mode 100644
index 00000000000..18634bec9fa
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/gcd_subdiv_step.c
@@ -0,0 +1,205 @@
+/* gcd_subdiv_step.c.
+
+ 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'LL CHANGE OR DISAPPEAR IN A FUTURE GNU MP RELEASE.
+
+Copyright 2003-2005, 2008, 2010, 2011 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 <stdlib.h> /* for NULL */
+
+#include "gmp.h"
+#include "gmp-impl.h"
+#include "longlong.h"
+
+/* Used when mpn_hgcd or mpn_hgcd2 has failed. Then either one of a or
+ b is small, or the difference is small. Perform one subtraction
+ followed by one division. The normal case is to compute the reduced
+ a and b, and return the new size.
+
+ If s == 0 (used for gcd and gcdext), returns zero if the gcd is
+ found.
+
+ If s > 0, don't reduce to size <= s, and return zero if no
+ reduction is possible (if either a, b or |a-b| is of size <= s). */
+
+/* The hook function is called as
+
+ hook(ctx, gp, gn, qp, qn, d)
+
+ in the following cases:
+
+ + If A = B at the start, G is the gcd, Q is NULL, d = -1.
+
+ + If one input is zero at the start, G is the gcd, Q is NULL,
+ d = 0 if A = G and d = 1 if B = G.
+
+ Otherwise, if d = 0 we have just subtracted a multiple of A from B,
+ and if d = 1 we have subtracted a multiple of B from A.
+
+ + If A = B after subtraction, G is the gcd, Q is NULL.
+
+ + If we get a zero remainder after division, G is the gcd, Q is the
+ quotient.
+
+ + Otherwise, G is NULL, Q is the quotient (often 1).
+
+ */
+
+mp_size_t
+mpn_gcd_subdiv_step (mp_ptr ap, mp_ptr bp, mp_size_t n, mp_size_t s,
+ gcd_subdiv_step_hook *hook, void *ctx,
+ mp_ptr tp)
+{
+ static const mp_limb_t one = CNST_LIMB(1);
+ mp_size_t an, bn, qn;
+
+ int swapped;
+
+ ASSERT (n > 0);
+ ASSERT (ap[n-1] > 0 || bp[n-1] > 0);
+
+ an = bn = n;
+ MPN_NORMALIZE (ap, an);
+ MPN_NORMALIZE (bp, bn);
+
+ swapped = 0;
+
+ /* Arrange so that a < b, subtract b -= a, and maintain
+ normalization. */
+ if (an == bn)
+ {
+ int c;
+ MPN_CMP (c, ap, bp, an);
+ if (UNLIKELY (c == 0))
+ {
+ /* For gcdext, return the smallest of the two cofactors, so
+ pass d = -1. */
+ if (s == 0)
+ hook (ctx, ap, an, NULL, 0, -1);
+ return 0;
+ }
+ else if (c > 0)
+ {
+ MP_PTR_SWAP (ap, bp);
+ swapped ^= 1;
+ }
+ }
+ else
+ {
+ if (an > bn)
+ {
+ MPN_PTR_SWAP (ap, an, bp, bn);
+ swapped ^= 1;
+ }
+ }
+ if (an <= s)
+ {
+ if (s == 0)
+ hook (ctx, bp, bn, NULL, 0, swapped ^ 1);
+ return 0;
+ }
+
+ ASSERT_NOCARRY (mpn_sub (bp, bp, bn, ap, an));
+ MPN_NORMALIZE (bp, bn);
+ ASSERT (bn > 0);
+
+ if (bn <= s)
+ {
+ /* Undo subtraction. */
+ mp_limb_t cy = mpn_add (bp, ap, an, bp, bn);
+ if (cy > 0)
+ bp[an] = cy;
+ return 0;
+ }
+
+ /* Arrange so that a < b */
+ if (an == bn)
+ {
+ int c;
+ MPN_CMP (c, ap, bp, an);
+ if (UNLIKELY (c == 0))
+ {
+ if (s > 0)
+ /* Just record subtraction and return */
+ hook (ctx, NULL, 0, &one, 1, swapped);
+ else
+ /* Found gcd. */
+ hook (ctx, bp, bn, NULL, 0, swapped);
+ return 0;
+ }
+
+ hook (ctx, NULL, 0, &one, 1, swapped);
+
+ if (c > 0)
+ {
+ MP_PTR_SWAP (ap, bp);
+ swapped ^= 1;
+ }
+ }
+ else
+ {
+ hook (ctx, NULL, 0, &one, 1, swapped);
+
+ if (an > bn)
+ {
+ MPN_PTR_SWAP (ap, an, bp, bn);
+ swapped ^= 1;
+ }
+ }
+
+ mpn_tdiv_qr (tp, bp, 0, bp, bn, ap, an);
+ qn = bn - an + 1;
+ bn = an;
+ MPN_NORMALIZE (bp, bn);
+
+ if (UNLIKELY (bn <= s))
+ {
+ if (s == 0)
+ {
+ hook (ctx, ap, an, tp, qn, swapped);
+ return 0;
+ }
+
+ /* Quotient is one too large, so decrement it and add back A. */
+ if (bn > 0)
+ {
+ mp_limb_t cy = mpn_add (bp, ap, an, bp, bn);
+ if (cy)
+ bp[an++] = cy;
+ }
+ else
+ MPN_COPY (bp, ap, an);
+
+ MPN_DECR_U (tp, qn, 1);
+ }
+
+ hook (ctx, NULL, 0, tp, qn, swapped);
+ return an;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/gcdext.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/gcdext.c
new file mode 100644
index 00000000000..1c4ff75aab8
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/gcdext.c
@@ -0,0 +1,558 @@
+/* mpn_gcdext -- Extended Greatest Common Divisor.
+
+Copyright 1996, 1998, 2000-2005, 2008, 2009, 2012 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.h"
+#include "gmp-impl.h"
+#include "longlong.h"
+
+/* Computes (r;b) = (a; b) M. Result is of size n + M->n +/- 1, and
+ the size is returned (if inputs are non-normalized, result may be
+ non-normalized too). Temporary space needed is M->n + n.
+ */
+static size_t
+hgcd_mul_matrix_vector (struct hgcd_matrix *M,
+ mp_ptr rp, mp_srcptr ap, mp_ptr bp, mp_size_t n, mp_ptr tp)
+{
+ mp_limb_t ah, bh;
+
+ /* Compute (r,b) <-- (u00 a + u10 b, u01 a + u11 b) as
+
+ t = u00 * a
+ r = u10 * b
+ r += t;
+
+ t = u11 * b
+ b = u01 * a
+ b += t;
+ */
+
+ if (M->n >= n)
+ {
+ mpn_mul (tp, M->p[0][0], M->n, ap, n);
+ mpn_mul (rp, M->p[1][0], M->n, bp, n);
+ }
+ else
+ {
+ mpn_mul (tp, ap, n, M->p[0][0], M->n);
+ mpn_mul (rp, bp, n, M->p[1][0], M->n);
+ }
+
+ ah = mpn_add_n (rp, rp, tp, n + M->n);
+
+ if (M->n >= n)
+ {
+ mpn_mul (tp, M->p[1][1], M->n, bp, n);
+ mpn_mul (bp, M->p[0][1], M->n, ap, n);
+ }
+ else
+ {
+ mpn_mul (tp, bp, n, M->p[1][1], M->n);
+ mpn_mul (bp, ap, n, M->p[0][1], M->n);
+ }
+ bh = mpn_add_n (bp, bp, tp, n + M->n);
+
+ n += M->n;
+ if ( (ah | bh) > 0)
+ {
+ rp[n] = ah;
+ bp[n] = bh;
+ n++;
+ }
+ else
+ {
+ /* Normalize */
+ while ( (rp[n-1] | bp[n-1]) == 0)
+ n--;
+ }
+
+ return n;
+}
+
+#define COMPUTE_V_ITCH(n) (2*(n))
+
+/* Computes |v| = |(g - u a)| / b, where u may be positive or
+ negative, and v is of the opposite sign. max(a, b) is of size n, u and
+ v at most size n, and v must have space for n+1 limbs. */
+static mp_size_t
+compute_v (mp_ptr vp,
+ mp_srcptr ap, mp_srcptr bp, mp_size_t n,
+ mp_srcptr gp, mp_size_t gn,
+ mp_srcptr up, mp_size_t usize,
+ mp_ptr tp)
+{
+ mp_size_t size;
+ mp_size_t an;
+ mp_size_t bn;
+ mp_size_t vn;
+
+ ASSERT (n > 0);
+ ASSERT (gn > 0);
+ ASSERT (usize != 0);
+
+ size = ABS (usize);
+ ASSERT (size <= n);
+ ASSERT (up[size-1] > 0);
+
+ an = n;
+ MPN_NORMALIZE (ap, an);
+ ASSERT (gn <= an);
+
+ if (an >= size)
+ mpn_mul (tp, ap, an, up, size);
+ else
+ mpn_mul (tp, up, size, ap, an);
+
+ size += an;
+
+ if (usize > 0)
+ {
+ /* |v| = -v = (u a - g) / b */
+
+ ASSERT_NOCARRY (mpn_sub (tp, tp, size, gp, gn));
+ MPN_NORMALIZE (tp, size);
+ if (size == 0)
+ return 0;
+ }
+ else
+ { /* |v| = v = (g - u a) / b = (g + |u| a) / b. Since g <= a,
+ (g + |u| a) always fits in (|usize| + an) limbs. */
+
+ ASSERT_NOCARRY (mpn_add (tp, tp, size, gp, gn));
+ size -= (tp[size - 1] == 0);
+ }
+
+ /* Now divide t / b. There must be no remainder */
+ bn = n;
+ MPN_NORMALIZE (bp, bn);
+ ASSERT (size >= bn);
+
+ vn = size + 1 - bn;
+ ASSERT (vn <= n + 1);
+
+ mpn_divexact (vp, tp, size, bp, bn);
+ vn -= (vp[vn-1] == 0);
+
+ return vn;
+}
+
+/* Temporary storage:
+
+ Initial division: Quotient of at most an - n + 1 <= an limbs.
+
+ Storage for u0 and u1: 2(n+1).
+
+ Storage for hgcd matrix M, with input ceil(n/2): 5 * ceil(n/4)
+
+ Storage for hgcd, input (n + 1)/2: 9 n/4 plus some.
+
+ When hgcd succeeds: 1 + floor(3n/2) for adjusting a and b, and 2(n+1) for the cofactors.
+
+ When hgcd fails: 2n + 1 for mpn_gcdext_subdiv_step, which is less.
+
+ For the lehmer call after the loop, Let T denote
+ GCDEXT_DC_THRESHOLD. For the gcdext_lehmer call, we need T each for
+ u, a and b, and 4T+3 scratch space. Next, for compute_v, we need T
+ for u, T+1 for v and 2T scratch space. In all, 7T + 3 is
+ sufficient for both operations.
+
+*/
+
+/* Optimal choice of p seems difficult. In each iteration the division
+ * of work between hgcd and the updates of u0 and u1 depends on the
+ * current size of the u. It may be desirable to use a different
+ * choice of p in each iteration. Also the input size seems to matter;
+ * choosing p = n / 3 in the first iteration seems to improve
+ * performance slightly for input size just above the threshold, but
+ * degrade performance for larger inputs. */
+#define CHOOSE_P_1(n) ((n) / 2)
+#define CHOOSE_P_2(n) ((n) / 3)
+
+mp_size_t
+mpn_gcdext (mp_ptr gp, mp_ptr up, mp_size_t *usizep,
+ mp_ptr ap, mp_size_t an, mp_ptr bp, mp_size_t n)
+{
+ mp_size_t talloc;
+ mp_size_t scratch;
+ mp_size_t matrix_scratch;
+ mp_size_t ualloc = n + 1;
+
+ struct gcdext_ctx ctx;
+ mp_size_t un;
+ mp_ptr u0;
+ mp_ptr u1;
+
+ mp_ptr tp;
+
+ TMP_DECL;
+
+ ASSERT (an >= n);
+ ASSERT (n > 0);
+ ASSERT (bp[n-1] > 0);
+
+ TMP_MARK;
+
+ /* FIXME: Check for small sizes first, before setting up temporary
+ storage etc. */
+ talloc = MPN_GCDEXT_LEHMER_N_ITCH(n);
+
+ /* For initial division */
+ scratch = an - n + 1;
+ if (scratch > talloc)
+ talloc = scratch;
+
+ if (ABOVE_THRESHOLD (n, GCDEXT_DC_THRESHOLD))
+ {
+ /* For hgcd loop. */
+ mp_size_t hgcd_scratch;
+ mp_size_t update_scratch;
+ mp_size_t p1 = CHOOSE_P_1 (n);
+ mp_size_t p2 = CHOOSE_P_2 (n);
+ mp_size_t min_p = MIN(p1, p2);
+ mp_size_t max_p = MAX(p1, p2);
+ matrix_scratch = MPN_HGCD_MATRIX_INIT_ITCH (n - min_p);
+ hgcd_scratch = mpn_hgcd_itch (n - min_p);
+ update_scratch = max_p + n - 1;
+
+ scratch = matrix_scratch + MAX(hgcd_scratch, update_scratch);
+ if (scratch > talloc)
+ talloc = scratch;
+
+ /* Final mpn_gcdext_lehmer_n call. Need space for u and for
+ copies of a and b. */
+ scratch = MPN_GCDEXT_LEHMER_N_ITCH (GCDEXT_DC_THRESHOLD)
+ + 3*GCDEXT_DC_THRESHOLD;
+
+ if (scratch > talloc)
+ talloc = scratch;
+
+ /* Cofactors u0 and u1 */
+ talloc += 2*(n+1);
+ }
+
+ tp = TMP_ALLOC_LIMBS(talloc);
+
+ if (an > n)
+ {
+ mpn_tdiv_qr (tp, ap, 0, ap, an, bp, n);
+
+ if (mpn_zero_p (ap, n))
+ {
+ MPN_COPY (gp, bp, n);
+ *usizep = 0;
+ TMP_FREE;
+ return n;
+ }
+ }
+
+ if (BELOW_THRESHOLD (n, GCDEXT_DC_THRESHOLD))
+ {
+ mp_size_t gn = mpn_gcdext_lehmer_n(gp, up, usizep, ap, bp, n, tp);
+
+ TMP_FREE;
+ return gn;
+ }
+
+ MPN_ZERO (tp, 2*ualloc);
+ u0 = tp; tp += ualloc;
+ u1 = tp; tp += ualloc;
+
+ ctx.gp = gp;
+ ctx.up = up;
+ ctx.usize = usizep;
+
+ {
+ /* For the first hgcd call, there are no u updates, and it makes
+ some sense to use a different choice for p. */
+
+ /* FIXME: We could trim use of temporary storage, since u0 and u1
+ are not used yet. For the hgcd call, we could swap in the u0
+ and u1 pointers for the relevant matrix elements. */
+
+ struct hgcd_matrix M;
+ mp_size_t p = CHOOSE_P_1 (n);
+ mp_size_t nn;
+
+ mpn_hgcd_matrix_init (&M, n - p, tp);
+ nn = mpn_hgcd (ap + p, bp + p, n - p, &M, tp + matrix_scratch);
+ if (nn > 0)
+ {
+ ASSERT (M.n <= (n - p - 1)/2);
+ ASSERT (M.n + p <= (p + n - 1) / 2);
+
+ /* Temporary storage 2 (p + M->n) <= p + n - 1 */
+ n = mpn_hgcd_matrix_adjust (&M, p + nn, ap, bp, p, tp + matrix_scratch);
+
+ MPN_COPY (u0, M.p[1][0], M.n);
+ MPN_COPY (u1, M.p[1][1], M.n);
+ un = M.n;
+ while ( (u0[un-1] | u1[un-1] ) == 0)
+ un--;
+ }
+ else
+ {
+ /* mpn_hgcd has failed. Then either one of a or b is very
+ small, or the difference is very small. Perform one
+ subtraction followed by one division. */
+ u1[0] = 1;
+
+ ctx.u0 = u0;
+ ctx.u1 = u1;
+ ctx.tp = tp + n; /* ualloc */
+ ctx.un = 1;
+
+ /* Temporary storage n */
+ n = mpn_gcd_subdiv_step (ap, bp, n, 0, mpn_gcdext_hook, &ctx, tp);
+ if (n == 0)
+ {
+ TMP_FREE;
+ return ctx.gn;
+ }
+
+ un = ctx.un;
+ ASSERT (un < ualloc);
+ }
+ }
+
+ while (ABOVE_THRESHOLD (n, GCDEXT_DC_THRESHOLD))
+ {
+ struct hgcd_matrix M;
+ mp_size_t p = CHOOSE_P_2 (n);
+ mp_size_t nn;
+
+ mpn_hgcd_matrix_init (&M, n - p, tp);
+ nn = mpn_hgcd (ap + p, bp + p, n - p, &M, tp + matrix_scratch);
+ if (nn > 0)
+ {
+ mp_ptr t0;
+
+ t0 = tp + matrix_scratch;
+ ASSERT (M.n <= (n - p - 1)/2);
+ ASSERT (M.n + p <= (p + n - 1) / 2);
+
+ /* Temporary storage 2 (p + M->n) <= p + n - 1 */
+ n = mpn_hgcd_matrix_adjust (&M, p + nn, ap, bp, p, t0);
+
+ /* By the same analysis as for mpn_hgcd_matrix_mul */
+ ASSERT (M.n + un <= ualloc);
+
+ /* FIXME: This copying could be avoided by some swapping of
+ * pointers. May need more temporary storage, though. */
+ MPN_COPY (t0, u0, un);
+
+ /* Temporary storage ualloc */
+ un = hgcd_mul_matrix_vector (&M, u0, t0, u1, un, t0 + un);
+
+ ASSERT (un < ualloc);
+ ASSERT ( (u0[un-1] | u1[un-1]) > 0);
+ }
+ else
+ {
+ /* mpn_hgcd has failed. Then either one of a or b is very
+ small, or the difference is very small. Perform one
+ subtraction followed by one division. */
+ ctx.u0 = u0;
+ ctx.u1 = u1;
+ ctx.tp = tp + n; /* ualloc */
+ ctx.un = un;
+
+ /* Temporary storage n */
+ n = mpn_gcd_subdiv_step (ap, bp, n, 0, mpn_gcdext_hook, &ctx, tp);
+ if (n == 0)
+ {
+ TMP_FREE;
+ return ctx.gn;
+ }
+
+ un = ctx.un;
+ ASSERT (un < ualloc);
+ }
+ }
+ /* We have A = ... a + ... b
+ B = u0 a + u1 b
+
+ a = u1 A + ... B
+ b = -u0 A + ... B
+
+ with bounds
+
+ |u0|, |u1| <= B / min(a, b)
+
+ We always have u1 > 0, and u0 == 0 is possible only if u1 == 1,
+ in which case the only reduction done so far is a = A - k B for
+ some k.
+
+ Compute g = u a + v b = (u u1 - v u0) A + (...) B
+ Here, u, v are bounded by
+
+ |u| <= b,
+ |v| <= a
+ */
+
+ ASSERT ( (ap[n-1] | bp[n-1]) > 0);
+
+ if (UNLIKELY (mpn_cmp (ap, bp, n) == 0))
+ {
+ /* Must return the smallest cofactor, +u1 or -u0 */
+ int c;
+
+ MPN_COPY (gp, ap, n);
+
+ MPN_CMP (c, u0, u1, un);
+ /* c == 0 can happen only when A = (2k+1) G, B = 2 G. And in
+ this case we choose the cofactor + 1, corresponding to G = A
+ - k B, rather than -1, corresponding to G = - A + (k+1) B. */
+ ASSERT (c != 0 || (un == 1 && u0[0] == 1 && u1[0] == 1));
+ if (c < 0)
+ {
+ MPN_NORMALIZE (u0, un);
+ MPN_COPY (up, u0, un);
+ *usizep = -un;
+ }
+ else
+ {
+ MPN_NORMALIZE_NOT_ZERO (u1, un);
+ MPN_COPY (up, u1, un);
+ *usizep = un;
+ }
+
+ TMP_FREE;
+ return n;
+ }
+ else if (UNLIKELY (u0[0] == 0) && un == 1)
+ {
+ mp_size_t gn;
+ ASSERT (u1[0] == 1);
+
+ /* g = u a + v b = (u u1 - v u0) A + (...) B = u A + (...) B */
+ gn = mpn_gcdext_lehmer_n (gp, up, usizep, ap, bp, n, tp);
+
+ TMP_FREE;
+ return gn;
+ }
+ else
+ {
+ mp_size_t u0n;
+ mp_size_t u1n;
+ mp_size_t lehmer_un;
+ mp_size_t lehmer_vn;
+ mp_size_t gn;
+
+ mp_ptr lehmer_up;
+ mp_ptr lehmer_vp;
+ int negate;
+
+ lehmer_up = tp; tp += n;
+
+ /* Call mpn_gcdext_lehmer_n with copies of a and b. */
+ MPN_COPY (tp, ap, n);
+ MPN_COPY (tp + n, bp, n);
+ gn = mpn_gcdext_lehmer_n (gp, lehmer_up, &lehmer_un, tp, tp + n, n, tp + 2*n);
+
+ u0n = un;
+ MPN_NORMALIZE (u0, u0n);
+ ASSERT (u0n > 0);
+
+ if (lehmer_un == 0)
+ {
+ /* u == 0 ==> v = g / b == 1 ==> g = - u0 A + (...) B */
+ MPN_COPY (up, u0, u0n);
+ *usizep = -u0n;
+
+ TMP_FREE;
+ return gn;
+ }
+
+ lehmer_vp = tp;
+ /* Compute v = (g - u a) / b */
+ lehmer_vn = compute_v (lehmer_vp,
+ ap, bp, n, gp, gn, lehmer_up, lehmer_un, tp + n + 1);
+
+ if (lehmer_un > 0)
+ negate = 0;
+ else
+ {
+ lehmer_un = -lehmer_un;
+ negate = 1;
+ }
+
+ u1n = un;
+ MPN_NORMALIZE (u1, u1n);
+ ASSERT (u1n > 0);
+
+ ASSERT (lehmer_un + u1n <= ualloc);
+ ASSERT (lehmer_vn + u0n <= ualloc);
+
+ /* We may still have v == 0 */
+
+ /* Compute u u0 */
+ if (lehmer_un <= u1n)
+ /* Should be the common case */
+ mpn_mul (up, u1, u1n, lehmer_up, lehmer_un);
+ else
+ mpn_mul (up, lehmer_up, lehmer_un, u1, u1n);
+
+ un = u1n + lehmer_un;
+ un -= (up[un - 1] == 0);
+
+ if (lehmer_vn > 0)
+ {
+ mp_limb_t cy;
+
+ /* Overwrites old u1 value */
+ if (lehmer_vn <= u0n)
+ /* Should be the common case */
+ mpn_mul (u1, u0, u0n, lehmer_vp, lehmer_vn);
+ else
+ mpn_mul (u1, lehmer_vp, lehmer_vn, u0, u0n);
+
+ u1n = u0n + lehmer_vn;
+ u1n -= (u1[u1n - 1] == 0);
+
+ if (u1n <= un)
+ {
+ cy = mpn_add (up, up, un, u1, u1n);
+ }
+ else
+ {
+ cy = mpn_add (up, u1, u1n, up, un);
+ un = u1n;
+ }
+ up[un] = cy;
+ un += (cy != 0);
+
+ ASSERT (un < ualloc);
+ }
+ *usizep = negate ? -un : un;
+
+ TMP_FREE;
+ return gn;
+ }
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/gcdext_1.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/gcdext_1.c
new file mode 100644
index 00000000000..ea46cceb729
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/gcdext_1.c
@@ -0,0 +1,328 @@
+/* mpn_gcdext -- Extended Greatest Common Divisor.
+
+Copyright 1996, 1998, 2000-2005, 2008, 2009 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.h"
+#include "gmp-impl.h"
+#include "longlong.h"
+
+#ifndef GCDEXT_1_USE_BINARY
+#define GCDEXT_1_USE_BINARY 0
+#endif
+
+#ifndef GCDEXT_1_BINARY_METHOD
+#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)
+{
+ /* Maintain
+
+ U = t1 u + t0 v
+ V = s1 u + s0 v
+
+ where U, V are the inputs (without any shared power of two),
+ and the matrix has determinant ± 2^{shift}.
+ */
+ mp_limb_t s0 = 1;
+ mp_limb_t t0 = 0;
+ mp_limb_t s1 = 0;
+ mp_limb_t t1 = 1;
+ mp_limb_t ug;
+ mp_limb_t vg;
+ mp_limb_t ugh;
+ mp_limb_t vgh;
+ unsigned zero_bits;
+ unsigned shift;
+ unsigned i;
+#if GCDEXT_1_BINARY_METHOD == 2
+ mp_limb_t det_sign;
+#endif
+
+ ASSERT (u > 0);
+ ASSERT (v > 0);
+
+ count_trailing_zeros (zero_bits, u | v);
+ u >>= zero_bits;
+ v >>= zero_bits;
+
+ if ((u & 1) == 0)
+ {
+ count_trailing_zeros (shift, u);
+ u >>= shift;
+ t1 <<= shift;
+ }
+ else if ((v & 1) == 0)
+ {
+ count_trailing_zeros (shift, v);
+ v >>= shift;
+ s0 <<= shift;
+ }
+ else
+ shift = 0;
+
+#if GCDEXT_1_BINARY_METHOD == 1
+ while (u != v)
+ {
+ unsigned count;
+ 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;
+ }
+ 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;
+ }
+ shift += count;
+ }
+#else
+# if GCDEXT_1_BINARY_METHOD == 2
+ u >>= 1;
+ v >>= 1;
+
+ det_sign = 0;
+
+ while (u != v)
+ {
+ unsigned count;
+ mp_limb_t d = u - v;
+ mp_limb_t vgtu = LIMB_HIGHBIT_TO_MASK (d);
+ mp_limb_t sx;
+ mp_limb_t tx;
+
+ /* When v <= u (vgtu == 0), the updates are:
+
+ (u; v) <-- ( (u - v) >> count; v) (det = +(1<<count) for corr. M factor)
+ (t1, t0) <-- (t1 << count, t0 + t1)
+
+ and when v > 0, the updates are
+
+ (u; v) <-- ( (v - u) >> count; u) (det = -(1<<count))
+ (t1, t0) <-- (t0 << count, t0 + t1)
+
+ and similarly for s1, s0
+ */
+
+ /* v <-- min (u, v) */
+ v += (vgtu & d);
+
+ /* u <-- |u - v| */
+ u = (d ^ vgtu) - vgtu;
+
+ /* 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);
+ sx = vgtu & (s0 - s1);
+ t0 += t1;
+ s0 += s1;
+ t1 += tx;
+ s1 += sx;
+
+ count++;
+ u >>= count;
+ t1 <<= count;
+ s1 <<= count;
+ shift += count;
+ }
+ u = (u << 1) + 1;
+# else /* GCDEXT_1_BINARY_METHOD == 2 */
+# error Unknown GCDEXT_1_BINARY_METHOD
+# endif
+#endif
+
+ /* Now u = v = g = gcd (u,v). Compute U/g and V/g */
+ ug = t0 + t1;
+ vg = s0 + s1;
+
+ ugh = ug/2 + (ug & 1);
+ vgh = vg/2 + (vg & 1);
+
+ /* 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++)
+ {
+ mp_limb_t mask = - ( (s0 | t0) & 1);
+
+ s0 /= 2;
+ t0 /= 2;
+ s0 += mask & vgh;
+ t0 += mask & ugh;
+ }
+ /* FIXME: Try simplifying this condition. */
+ if ( (s0 > 1 && 2*s0 >= vg) || (t0 > 1 && 2*t0 >= ug) )
+ {
+ s0 -= vg;
+ t0 -= ug;
+ }
+#if GCDEXT_1_BINARY_METHOD == 2
+ /* Conditional negation. */
+ s0 = (s0 ^ det_sign) - det_sign;
+ t0 = (t0 ^ det_sign) - det_sign;
+#endif
+ *sp = s0;
+ *tp = -t0;
+
+ return u << zero_bits;
+}
+
+#else /* !GCDEXT_1_USE_BINARY */
+
+
+/* FIXME: Takes two single-word limbs. It could be extended to a
+ * function that accepts a bignum for the first input, and only
+ * returns the first co-factor. */
+
+mp_limb_t
+mpn_gcdext_1 (mp_limb_signed_t *up, mp_limb_signed_t *vp,
+ mp_limb_t a, mp_limb_t b)
+{
+ /* Maintain
+
+ a = u0 A + v0 B
+ b = u1 A + v1 B
+
+ where A, B are the original inputs.
+ */
+ mp_limb_signed_t u0 = 1;
+ mp_limb_signed_t v0 = 0;
+ mp_limb_signed_t u1 = 0;
+ mp_limb_signed_t v1 = 1;
+
+ ASSERT (a > 0);
+ ASSERT (b > 0);
+
+ if (a < b)
+ goto divide_by_b;
+
+ for (;;)
+ {
+ mp_limb_t q;
+
+ q = a / b;
+ a -= q * b;
+
+ if (a == 0)
+ {
+ *up = u1;
+ *vp = v1;
+ return b;
+ }
+ u0 -= q * u1;
+ v0 -= q * v1;
+
+ divide_by_b:
+ q = b / a;
+ b -= q * a;
+
+ if (b == 0)
+ {
+ *up = u0;
+ *vp = v0;
+ return a;
+ }
+ u1 -= q * u0;
+ v1 -= q * v0;
+ }
+}
+#endif /* !GCDEXT_1_USE_BINARY */
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/gcdext_lehmer.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/gcdext_lehmer.c
new file mode 100644
index 00000000000..547f69a4098
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/gcdext_lehmer.c
@@ -0,0 +1,337 @@
+/* mpn_gcdext -- Extended Greatest Common Divisor.
+
+Copyright 1996, 1998, 2000-2005, 2008, 2009, 2012 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.h"
+#include "gmp-impl.h"
+#include "longlong.h"
+
+/* Here, d is the index of the cofactor to update. FIXME: Could use qn
+ = 0 for the common case q = 1. */
+void
+mpn_gcdext_hook (void *p, mp_srcptr gp, mp_size_t gn,
+ mp_srcptr qp, mp_size_t qn, int d)
+{
+ struct gcdext_ctx *ctx = (struct gcdext_ctx *) p;
+ mp_size_t un = ctx->un;
+
+ if (gp)
+ {
+ mp_srcptr up;
+
+ ASSERT (gn > 0);
+ ASSERT (gp[gn-1] > 0);
+
+ MPN_COPY (ctx->gp, gp, gn);
+ ctx->gn = gn;
+
+ if (d < 0)
+ {
+ int c;
+
+ /* Must return the smallest cofactor, +u1 or -u0 */
+ MPN_CMP (c, ctx->u0, ctx->u1, un);
+ ASSERT (c != 0 || (un == 1 && ctx->u0[0] == 1 && ctx->u1[0] == 1));
+
+ d = c < 0;
+ }
+
+ up = d ? ctx->u0 : ctx->u1;
+
+ MPN_NORMALIZE (up, un);
+ MPN_COPY (ctx->up, up, un);
+
+ *ctx->usize = d ? -un : un;
+ }
+ else
+ {
+ mp_limb_t cy;
+ mp_ptr u0 = ctx->u0;
+ mp_ptr u1 = ctx->u1;
+
+ ASSERT (d >= 0);
+
+ if (d)
+ MP_PTR_SWAP (u0, u1);
+
+ qn -= (qp[qn-1] == 0);
+
+ /* Update u0 += q * u1 */
+ if (qn == 1)
+ {
+ mp_limb_t q = qp[0];
+
+ if (q == 1)
+ /* A common case. */
+ cy = mpn_add_n (u0, u0, u1, un);
+ else
+ cy = mpn_addmul_1 (u0, u1, un, q);
+ }
+ else
+ {
+ mp_size_t u1n;
+ mp_ptr tp;
+
+ u1n = un;
+ MPN_NORMALIZE (u1, u1n);
+
+ if (u1n == 0)
+ return;
+
+ /* Should always have u1n == un here, and u1 >= u0. The
+ reason is that we alternate adding u0 to u1 and u1 to u0
+ (corresponding to subtractions a - b and b - a), and we
+ can get a large quotient only just after a switch, which
+ means that we'll add (a multiple of) the larger u to the
+ smaller. */
+
+ tp = ctx->tp;
+
+ if (qn > u1n)
+ mpn_mul (tp, qp, qn, u1, u1n);
+ else
+ mpn_mul (tp, u1, u1n, qp, qn);
+
+ u1n += qn;
+ u1n -= tp[u1n-1] == 0;
+
+ if (u1n >= un)
+ {
+ cy = mpn_add (u0, tp, u1n, u0, un);
+ un = u1n;
+ }
+ else
+ /* Note: Unlikely case, maybe never happens? */
+ cy = mpn_add (u0, u0, un, tp, u1n);
+
+ }
+ u0[un] = cy;
+ ctx->un = un + (cy > 0);
+ }
+}
+
+/* Temporary storage: 3*(n+1) for u. If hgcd2 succeeds, we need n for
+ the matrix-vector multiplication adjusting a, b. If hgcd fails, we
+ need at most n for the quotient and n+1 for the u update (reusing
+ the extra u). In all, 4n + 3. */
+
+mp_size_t
+mpn_gcdext_lehmer_n (mp_ptr gp, mp_ptr up, mp_size_t *usize,
+ mp_ptr ap, mp_ptr bp, mp_size_t n,
+ mp_ptr tp)
+{
+ mp_size_t ualloc = n + 1;
+
+ /* Keeps track of the second row of the reduction matrix
+ *
+ * M = (v0, v1 ; u0, u1)
+ *
+ * which correspond to the first column of the inverse
+ *
+ * M^{-1} = (u1, -v1; -u0, v0)
+ *
+ * This implies that
+ *
+ * a = u1 A (mod B)
+ * b = -u0 A (mod B)
+ *
+ * where A, B denotes the input values.
+ */
+
+ struct gcdext_ctx ctx;
+ mp_size_t un;
+ mp_ptr u0;
+ mp_ptr u1;
+ mp_ptr u2;
+
+ MPN_ZERO (tp, 3*ualloc);
+ u0 = tp; tp += ualloc;
+ u1 = tp; tp += ualloc;
+ u2 = tp; tp += ualloc;
+
+ u1[0] = 1; un = 1;
+
+ ctx.gp = gp;
+ ctx.up = up;
+ ctx.usize = usize;
+
+ /* FIXME: Handle n == 2 differently, after the loop? */
+ while (n >= 2)
+ {
+ struct hgcd_matrix1 M;
+ mp_limb_t ah, al, bh, bl;
+ mp_limb_t mask;
+
+ mask = ap[n-1] | bp[n-1];
+ ASSERT (mask > 0);
+
+ if (mask & GMP_NUMB_HIGHBIT)
+ {
+ ah = ap[n-1]; al = ap[n-2];
+ bh = bp[n-1]; bl = bp[n-2];
+ }
+ else if (n == 2)
+ {
+ /* We use the full inputs without truncation, so we can
+ safely shift left. */
+ int shift;
+
+ count_leading_zeros (shift, mask);
+ ah = MPN_EXTRACT_NUMB (shift, ap[1], ap[0]);
+ al = ap[0] << shift;
+ bh = MPN_EXTRACT_NUMB (shift, bp[1], bp[0]);
+ bl = bp[0] << shift;
+ }
+ else
+ {
+ int shift;
+
+ count_leading_zeros (shift, mask);
+ ah = MPN_EXTRACT_NUMB (shift, ap[n-1], ap[n-2]);
+ al = MPN_EXTRACT_NUMB (shift, ap[n-2], ap[n-3]);
+ bh = MPN_EXTRACT_NUMB (shift, bp[n-1], bp[n-2]);
+ bl = MPN_EXTRACT_NUMB (shift, bp[n-2], bp[n-3]);
+ }
+
+ /* Try an mpn_nhgcd2 step */
+ if (mpn_hgcd2 (ah, al, bh, bl, &M))
+ {
+ n = mpn_matrix22_mul1_inverse_vector (&M, tp, ap, bp, n);
+ MP_PTR_SWAP (ap, tp);
+ un = mpn_hgcd_mul_matrix1_vector(&M, u2, u0, u1, un);
+ MP_PTR_SWAP (u0, u2);
+ }
+ else
+ {
+ /* mpn_hgcd2 has failed. Then either one of a or b is very
+ small, or the difference is very small. Perform one
+ subtraction followed by one division. */
+ ctx.u0 = u0;
+ ctx.u1 = u1;
+ ctx.tp = u2;
+ ctx.un = un;
+
+ /* Temporary storage n for the quotient and ualloc for the
+ new cofactor. */
+ n = mpn_gcd_subdiv_step (ap, bp, n, 0, mpn_gcdext_hook, &ctx, tp);
+ if (n == 0)
+ return ctx.gn;
+
+ un = ctx.un;
+ }
+ }
+ ASSERT_ALWAYS (ap[0] > 0);
+ ASSERT_ALWAYS (bp[0] > 0);
+
+ if (ap[0] == bp[0])
+ {
+ int c;
+
+ /* Which cofactor to return now? Candidates are +u1 and -u0,
+ depending on which of a and b was most recently reduced,
+ which we don't keep track of. So compare and get the smallest
+ one. */
+
+ gp[0] = ap[0];
+
+ MPN_CMP (c, u0, u1, un);
+ ASSERT (c != 0 || (un == 1 && u0[0] == 1 && u1[0] == 1));
+ if (c < 0)
+ {
+ MPN_NORMALIZE (u0, un);
+ MPN_COPY (up, u0, un);
+ *usize = -un;
+ }
+ else
+ {
+ MPN_NORMALIZE_NOT_ZERO (u1, un);
+ MPN_COPY (up, u1, un);
+ *usize = un;
+ }
+ return 1;
+ }
+ else
+ {
+ mp_limb_t uh, vh;
+ mp_limb_signed_t u;
+ mp_limb_signed_t v;
+ int negate;
+
+ gp[0] = mpn_gcdext_1 (&u, &v, ap[0], bp[0]);
+
+ /* Set up = u u1 - v u0. Keep track of size, un grows by one or
+ two limbs. */
+
+ if (u == 0)
+ {
+ ASSERT (v == 1);
+ MPN_NORMALIZE (u0, un);
+ MPN_COPY (up, u0, un);
+ *usize = -un;
+ return 1;
+ }
+ else if (v == 0)
+ {
+ ASSERT (u == 1);
+ MPN_NORMALIZE (u1, un);
+ MPN_COPY (up, u1, un);
+ *usize = un;
+ return 1;
+ }
+ else if (u > 0)
+ {
+ negate = 0;
+ ASSERT (v < 0);
+ v = -v;
+ }
+ else
+ {
+ negate = 1;
+ ASSERT (v > 0);
+ u = -u;
+ }
+
+ uh = mpn_mul_1 (up, u1, un, u);
+ vh = mpn_addmul_1 (up, u0, un, v);
+
+ if ( (uh | vh) > 0)
+ {
+ uh += vh;
+ up[un++] = uh;
+ if (uh < vh)
+ up[un++] = 1;
+ }
+
+ MPN_NORMALIZE_NOT_ZERO (up, un);
+
+ *usize = negate ? -un : un;
+ return 1;
+ }
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/get_d.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/get_d.c
new file mode 100644
index 00000000000..d73d314856c
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/get_d.c
@@ -0,0 +1,412 @@
+/* mpn_get_d -- limbs to double conversion.
+
+ 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 2003, 2004, 2007, 2009, 2010, 2012 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.h"
+#include "gmp-impl.h"
+#include "longlong.h"
+
+#ifndef _GMP_IEEE_FLOATS
+#define _GMP_IEEE_FLOATS 0
+#endif
+
+/* To force use of the generic C code for testing, put
+ "#define _GMP_IEEE_FLOATS 0" at this point. */
+
+
+/* In alpha gcc prior to 3.4, signed DI comparisons involving constants are
+ rearranged from "x < n" to "x+(-n) < 0", which is of course hopelessly
+ wrong if that addition overflows.
+
+ The workaround here avoids this bug by ensuring n is not a literal constant.
+ Note that this is alpha specific. The offending transformation is/was in
+ alpha.c alpha_emit_conditional_branch() under "We want to use cmpcc/bcc".
+
+ Bizarrely, this happens also with Cray cc on alphaev5-cray-unicosmk2.0.6.X,
+ and has the same solution. Don't know why or how. */
+
+#if HAVE_HOST_CPU_FAMILY_alpha \
+ && ((defined (__GNUC__) && ! __GMP_GNUC_PREREQ(3,4)) \
+ || defined (_CRAY))
+static volatile const long CONST_1024 = 1024;
+static volatile const long CONST_NEG_1023 = -1023;
+static volatile const long CONST_NEG_1022_SUB_53 = -1022 - 53;
+#else
+#define CONST_1024 (1024)
+#define CONST_NEG_1023 (-1023)
+#define CONST_NEG_1022_SUB_53 (-1022 - 53)
+#endif
+
+
+/* Return the value {ptr,size}*2^exp, and negative if sign<0. Must have
+ size>=1, and a non-zero high limb ptr[size-1].
+
+ When we know the fp format, the result is truncated towards zero. This is
+ consistent with other gmp conversions, like mpz_set_f or mpz_set_q, and is
+ easy to implement and test.
+
+ When we do not know the format, such truncation seems much harder. One
+ would need to defeat any rounding mode, including round-up.
+
+ It's felt that GMP is not primarily concerned with hardware floats, and
+ really isn't enhanced by getting involved with hardware rounding modes
+ (which could even be some weird unknown style), so something unambiguous and
+ straightforward is best.
+
+
+ The IEEE code below is the usual case, it knows either a 32-bit or 64-bit
+ limb and is done with shifts and masks. The 64-bit case in particular
+ should come out nice and compact.
+
+ The generic code used to work one bit at a time, which was not only slow,
+ but implicitly relied upon denorms for intermediates, since the lowest bits'
+ weight of a perfectly valid fp number underflows in non-denorm. Therefore,
+ the generic code now works limb-per-limb, initially creating a number x such
+ that 1 <= x <= BASE. (BASE is reached only as result of rounding.) Then
+ x's exponent is scaled with explicit code (not ldexp to avoid libm
+ dependency). It is a tap-dance to avoid underflow or overflow, beware!
+
+
+ Traps:
+
+ Hardware traps for overflow to infinity, underflow to zero, or unsupported
+ denorms may or may not be taken. The IEEE code works bitwise and so
+ probably won't trigger them, the generic code works by float operations and
+ so probably will. This difference might be thought less than ideal, but
+ again its felt straightforward code is better than trying to get intimate
+ with hardware exceptions (of perhaps unknown nature).
+
+
+ Not done:
+
+ mpz_get_d in the past handled size==1 with a cast limb->double. This might
+ still be worthwhile there (for up to the mantissa many bits), but for
+ mpn_get_d here, the cost of applying "exp" to the resulting exponent would
+ probably use up any benefit a cast may have over bit twiddling. Also, if
+ the exponent is pushed into denorm range then bit twiddling is the only
+ option, to ensure the desired truncation is obtained.
+
+
+ Other:
+
+ For reference, note that HPPA 8000, 8200, 8500 and 8600 trap FCNV,UDW,DBL
+ to the kernel for values >= 2^63. This makes it slow, and worse the kernel
+ Linux (what versions?) apparently uses untested code in its trap handling
+ routines, and gets the sign wrong. We don't use such a limb-to-double
+ cast, neither in the IEEE or generic code. */
+
+
+
+#undef FORMAT_RECOGNIZED
+
+double
+mpn_get_d (mp_srcptr up, mp_size_t size, mp_size_t sign, long exp)
+{
+ int lshift, nbits;
+ mp_limb_t x, mhi, mlo;
+
+ ASSERT (size >= 0);
+ ASSERT_MPN (up, size);
+ ASSERT (size == 0 || up[size-1] != 0);
+
+ if (size == 0)
+ return 0.0;
+
+ /* Adjust exp to a radix point just above {up,size}, guarding against
+ overflow. After this exp can of course be reduced to anywhere within
+ the {up,size} region without underflow. */
+ if (UNLIKELY ((unsigned long) (GMP_NUMB_BITS * size)
+ > ((unsigned long) LONG_MAX - exp)))
+ {
+#if _GMP_IEEE_FLOATS
+ goto ieee_infinity;
+#endif
+
+ /* generic */
+ exp = LONG_MAX;
+ }
+ else
+ {
+ exp += GMP_NUMB_BITS * size;
+ }
+
+#if _GMP_IEEE_FLOATS
+ {
+ union ieee_double_extract u;
+
+ up += size;
+
+#if GMP_LIMB_BITS == 64
+ mlo = up[-1];
+ count_leading_zeros (lshift, mlo);
+
+ exp -= (lshift - GMP_NAIL_BITS) + 1;
+ mlo <<= lshift;
+
+ nbits = GMP_LIMB_BITS - lshift;
+
+ if (nbits < 53 && size > 1)
+ {
+ x = up[-2];
+ x <<= GMP_NAIL_BITS;
+ x >>= nbits;
+ mlo |= x;
+ nbits += GMP_NUMB_BITS;
+
+ if (LIMBS_PER_DOUBLE >= 3 && nbits < 53 && size > 2)
+ {
+ x = up[-3];
+ x <<= GMP_NAIL_BITS;
+ x >>= nbits;
+ mlo |= x;
+ nbits += GMP_NUMB_BITS;
+ }
+ }
+ mhi = mlo >> (32 + 11);
+ mlo = mlo >> 11; /* later implicitly truncated to 32 bits */
+#endif
+#if GMP_LIMB_BITS == 32
+ x = *--up;
+ count_leading_zeros (lshift, x);
+
+ exp -= (lshift - GMP_NAIL_BITS) + 1;
+ x <<= lshift;
+ mhi = x >> 11;
+
+ if (lshift < 11) /* FIXME: never true if NUMB < 20 bits */
+ {
+ /* All 20 bits in mhi */
+ mlo = x << 21;
+ /* >= 1 bit in mlo */
+ nbits = GMP_LIMB_BITS - lshift - 21;
+ }
+ else
+ {
+ if (size > 1)
+ {
+ nbits = GMP_LIMB_BITS - lshift;
+
+ x = *--up, size--;
+ x <<= GMP_NAIL_BITS;
+ mhi |= x >> nbits >> 11;
+
+ mlo = x << GMP_LIMB_BITS - nbits - 11;
+ nbits = nbits + 11 - GMP_NAIL_BITS;
+ }
+ else
+ {
+ mlo = 0;
+ goto done;
+ }
+ }
+
+ /* Now all needed bits in mhi have been accumulated. Add bits to mlo. */
+
+ if (LIMBS_PER_DOUBLE >= 2 && nbits < 32 && size > 1)
+ {
+ x = up[-1];
+ x <<= GMP_NAIL_BITS;
+ x >>= nbits;
+ mlo |= x;
+ nbits += GMP_NUMB_BITS;
+
+ if (LIMBS_PER_DOUBLE >= 3 && nbits < 32 && size > 2)
+ {
+ x = up[-2];
+ x <<= GMP_NAIL_BITS;
+ x >>= nbits;
+ mlo |= x;
+ nbits += GMP_NUMB_BITS;
+
+ if (LIMBS_PER_DOUBLE >= 4 && nbits < 32 && size > 3)
+ {
+ x = up[-3];
+ x <<= GMP_NAIL_BITS;
+ x >>= nbits;
+ mlo |= x;
+ nbits += GMP_NUMB_BITS;
+ }
+ }
+ }
+
+ done:;
+
+#endif
+ if (UNLIKELY (exp >= CONST_1024))
+ {
+ /* overflow, return infinity */
+ ieee_infinity:
+ mhi = 0;
+ mlo = 0;
+ exp = 1024;
+ }
+ else if (UNLIKELY (exp <= CONST_NEG_1023))
+ {
+ int rshift;
+
+ if (LIKELY (exp <= CONST_NEG_1022_SUB_53))
+ return 0.0; /* denorm underflows to zero */
+
+ rshift = -1022 - exp;
+ ASSERT (rshift > 0 && rshift < 53);
+#if GMP_LIMB_BITS > 53
+ mlo >>= rshift;
+ mhi = mlo >> 32;
+#else
+ if (rshift >= 32)
+ {
+ mlo = mhi;
+ mhi = 0;
+ rshift -= 32;
+ }
+ lshift = GMP_LIMB_BITS - rshift;
+ mlo = (mlo >> rshift) | (rshift == 0 ? 0 : mhi << lshift);
+ mhi >>= rshift;
+#endif
+ exp = -1023;
+ }
+ u.s.manh = mhi;
+ u.s.manl = mlo;
+ u.s.exp = exp + 1023;
+ u.s.sig = (sign < 0);
+ return u.d;
+ }
+#define FORMAT_RECOGNIZED 1
+#endif
+
+#if HAVE_DOUBLE_VAX_D
+ {
+ union double_extract u;
+
+ up += size;
+
+ mhi = up[-1];
+
+ count_leading_zeros (lshift, mhi);
+ exp -= lshift;
+ mhi <<= lshift;
+
+ mlo = 0;
+ if (size > 1)
+ {
+ mlo = up[-2];
+ if (lshift != 0)
+ mhi += mlo >> (GMP_LIMB_BITS - lshift);
+ mlo <<= lshift;
+
+ if (size > 2 && lshift > 8)
+ {
+ x = up[-3];
+ mlo += x >> (GMP_LIMB_BITS - lshift);
+ }
+ }
+
+ if (UNLIKELY (exp >= 128))
+ {
+ /* overflow, return maximum number */
+ mhi = 0xffffffff;
+ mlo = 0xffffffff;
+ exp = 127;
+ }
+ else if (UNLIKELY (exp < -128))
+ {
+ return 0.0; /* underflows to zero */
+ }
+
+ u.s.man3 = mhi >> 24; /* drop msb, since implicit */
+ u.s.man2 = mhi >> 8;
+ u.s.man1 = (mhi << 8) + (mlo >> 24);
+ u.s.man0 = mlo >> 8;
+ u.s.exp = exp + 128;
+ u.s.sig = sign < 0;
+ return u.d;
+ }
+#define FORMAT_RECOGNIZED 1
+#endif
+
+#if ! FORMAT_RECOGNIZED
+ { /* Non-IEEE or strange limb size, do something generic. */
+ mp_size_t i;
+ double d, weight;
+ unsigned long uexp;
+
+ /* 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--)
+ {
+ d += up[i] * weight;
+ weight /= MP_BASE_AS_DOUBLE;
+ if (weight == 0)
+ break;
+ }
+
+ /* Now apply exp. */
+ exp -= GMP_NUMB_BITS;
+ if (exp > 0)
+ {
+ weight = 2.0;
+ uexp = exp;
+ }
+ else
+ {
+ weight = 0.5;
+ uexp = 1 - (unsigned long) (exp + 1);
+ }
+#if 1
+ /* Square-and-multiply exponentiation. */
+ if (uexp & 1)
+ d *= weight;
+ while (uexp >>= 1)
+ {
+ weight *= weight;
+ if (uexp & 1)
+ d *= weight;
+ }
+#else
+ /* Plain exponentiation. */
+ while (uexp > 0)
+ {
+ d *= weight;
+ uexp--;
+ }
+#endif
+
+ return sign >= 0 ? d : -d;
+ }
+#endif
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/get_str.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/get_str.c
new file mode 100644
index 00000000000..42e93c9cee4
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/get_str.c
@@ -0,0 +1,553 @@
+/* mpn_get_str -- Convert {UP,USIZE} to a base BASE string in STR.
+
+ 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.
+
+Copyright 1991-1994, 1996, 2000-2002, 2004, 2006-2008, 2011, 2012 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.h"
+#include "gmp-impl.h"
+#include "longlong.h"
+
+/* Conversion of U {up,un} to a string in base b. Internally, we convert to
+ base B = b^m, the largest power of b that fits a limb. Basic algorithms:
+
+ 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.)
+
+ 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
+ come out from left to right. (Currently not used herein, except for in
+ code for converting single limbs to individual digits.)
+
+ C) Compute B^1, B^2, B^4, ..., B^s, for s such that B^s is just above
+ sqrt(U). Then divide U by B^s, generating quotient and remainder.
+ Recursively convert the quotient, then the remainder, using the
+ precomputed powers. Digits come out from left to right. (Used in
+ mpn_dc_get_str.)
+
+ When using algorithm C, algorithm B might be suitable for basecase code,
+ since the required b^g power will be readily accessible.
+
+ Optimization ideas:
+ 1. The recursive function of (C) could use less temporary memory. The powtab
+ allocation could be trimmed with some computation, and the tmp area could
+ be reduced, or perhaps eliminated if up is reused for both quotient and
+ remainder (it is currently used just for remainder).
+ 2. Store the powers of (C) in normalized form, with the normalization count.
+ Quotients will usually need to be left-shifted before each divide, and
+ remainders will either need to be left-shifted of right-shifted.
+ 3. In the code for developing digits from a single limb, we could avoid using
+ a full umul_ppmm except for the first (or first few) digits, provided base
+ is even. Subsequent digits can be developed using plain multiplication.
+ (This saves on register-starved machines (read x86) and on all machines
+ that generate the upper product half using a separate instruction (alpha,
+ powerpc, IA-64) or lacks such support altogether (sparc64, hppa64).
+ 4. Separate mpn_dc_get_str basecase code from code for small conversions. The
+ former code will have the exact right power readily available in the
+ powtab parameter for dividing the current number into a fraction. Convert
+ that using algorithm B.
+ 5. Completely avoid division. Compute the inverses of the powers now in
+ powtab instead of the actual powers.
+ 6. Decrease powtab allocation for even bases. E.g. for base 10 we could save
+ about 30% (1-log(5)/log(10)).
+
+ Basic structure of (C):
+ mpn_get_str:
+ if POW2_P (n)
+ ...
+ else
+ if (un < GET_STR_PRECOMPUTE_THRESHOLD)
+ mpn_sb_get_str (str, base, up, un);
+ else
+ precompute_power_tables
+ mpn_dc_get_str
+
+ mpn_dc_get_str:
+ mpn_tdiv_qr
+ if (qn < GET_STR_DC_THRESHOLD)
+ mpn_sb_get_str
+ else
+ mpn_dc_get_str
+ if (rn < GET_STR_DC_THRESHOLD)
+ mpn_sb_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. */
+
+
+/* The x86s and m68020 have a quotient and remainder "div" instruction and
+ gcc recognises an adjacent "/" and "%" can be combined using that.
+ Elsewhere "/" and "%" are either separate instructions, or separate
+ libgcc calls (which unfortunately gcc as of version 3.0 doesn't combine).
+ A multiply and subtract should be faster than a "%" in those cases. */
+#if HAVE_HOST_CPU_FAMILY_x86 \
+ || HAVE_HOST_CPU_m68020 \
+ || HAVE_HOST_CPU_m68030 \
+ || HAVE_HOST_CPU_m68040 \
+ || HAVE_HOST_CPU_m68060 \
+ || HAVE_HOST_CPU_m68360 /* CPU32 */
+#define udiv_qrnd_unnorm(q,r,n,d) \
+ do { \
+ mp_limb_t __q = (n) / (d); \
+ mp_limb_t __r = (n) % (d); \
+ (q) = __q; \
+ (r) = __r; \
+ } while (0)
+#else
+#define udiv_qrnd_unnorm(q,r,n,d) \
+ do { \
+ mp_limb_t __q = (n) / (d); \
+ mp_limb_t __r = (n) - __q*(d); \
+ (q) = __q; \
+ (r) = __r; \
+ } while (0)
+#endif
+
+
+/* Convert {up,un} to a string in base base, and put the result in str.
+ Generate len characters, possibly padding with zeros to the left. If len is
+ zero, generate as many characters as required. Return a pointer immediately
+ 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,
+ mp_ptr up, mp_size_t un, int base)
+{
+ mp_limb_t rl, ul;
+ unsigned char *s;
+ size_t l;
+ /* Allocate memory for largest possible string, given that we only get here
+ for operands with un < GET_STR_PRECOMPUTE_THRESHOLD and that the smallest
+ base is 3. 7/11 is an approximation to 1/log2(3). */
+#if TUNE_PROGRAM_BUILD
+#define BUF_ALLOC (GET_STR_THRESHOLD_LIMIT * GMP_LIMB_BITS * 7 / 11)
+#else
+#define BUF_ALLOC (GET_STR_PRECOMPUTE_THRESHOLD * GMP_LIMB_BITS * 7 / 11)
+#endif
+ unsigned char buf[BUF_ALLOC];
+#if TUNE_PROGRAM_BUILD
+ mp_limb_t rp[GET_STR_THRESHOLD_LIMIT];
+#else
+ mp_limb_t rp[GET_STR_PRECOMPUTE_THRESHOLD];
+#endif
+
+ if (base == 10)
+ {
+ /* Special case code for base==10 so that the compiler has a chance to
+ optimize things. */
+
+ MPN_COPY (rp + 1, up, un);
+
+ s = buf + BUF_ALLOC;
+ while (un > 1)
+ {
+ int i;
+ mp_limb_t frac, digit;
+ MPN_DIVREM_OR_PREINV_DIVREM_1 (rp, (mp_size_t) 1, rp + 1, un,
+ MP_BASES_BIG_BASE_10,
+ MP_BASES_BIG_BASE_INVERTED_10,
+ MP_BASES_NORMALIZATION_STEPS_10);
+ un -= rp[un] == 0;
+ frac = (rp[0] + 1) << GMP_NAIL_BITS;
+ s -= MP_BASES_CHARS_PER_LIMB_10;
+#if HAVE_HOST_CPU_FAMILY_x86
+ /* The code below turns out to be a bit slower for x86 using gcc.
+ Use plain code. */
+ i = MP_BASES_CHARS_PER_LIMB_10;
+ do
+ {
+ umul_ppmm (digit, frac, frac, 10);
+ *s++ = digit;
+ }
+ while (--i);
+#else
+ /* Use the fact that 10 in binary is 1010, with the lowest bit 0.
+ After a few umul_ppmm, we will have accumulated enough low zeros
+ to use a plain multiply. */
+ if (MP_BASES_NORMALIZATION_STEPS_10 == 0)
+ {
+ umul_ppmm (digit, frac, frac, 10);
+ *s++ = digit;
+ }
+ if (MP_BASES_NORMALIZATION_STEPS_10 <= 1)
+ {
+ umul_ppmm (digit, frac, frac, 10);
+ *s++ = digit;
+ }
+ if (MP_BASES_NORMALIZATION_STEPS_10 <= 2)
+ {
+ umul_ppmm (digit, frac, frac, 10);
+ *s++ = digit;
+ }
+ if (MP_BASES_NORMALIZATION_STEPS_10 <= 3)
+ {
+ umul_ppmm (digit, frac, frac, 10);
+ *s++ = digit;
+ }
+ i = (MP_BASES_CHARS_PER_LIMB_10 - ((MP_BASES_NORMALIZATION_STEPS_10 < 4)
+ ? (4-MP_BASES_NORMALIZATION_STEPS_10)
+ : 0));
+ frac = (frac + 0xf) >> 4;
+ do
+ {
+ frac *= 10;
+ digit = frac >> (GMP_LIMB_BITS - 4);
+ *s++ = digit;
+ frac &= (~(mp_limb_t) 0) >> 4;
+ }
+ while (--i);
+#endif
+ s -= MP_BASES_CHARS_PER_LIMB_10;
+ }
+
+ ul = rp[1];
+ while (ul != 0)
+ {
+ udiv_qrnd_unnorm (ul, rl, ul, 10);
+ *--s = rl;
+ }
+ }
+ else /* not base 10 */
+ {
+ unsigned chars_per_limb;
+ mp_limb_t big_base, big_base_inverted;
+ unsigned normalization_steps;
+
+ chars_per_limb = mp_bases[base].chars_per_limb;
+ big_base = mp_bases[base].big_base;
+ big_base_inverted = mp_bases[base].big_base_inverted;
+ count_leading_zeros (normalization_steps, big_base);
+
+ MPN_COPY (rp + 1, up, un);
+
+ s = buf + BUF_ALLOC;
+ while (un > 1)
+ {
+ int i;
+ mp_limb_t frac;
+ MPN_DIVREM_OR_PREINV_DIVREM_1 (rp, (mp_size_t) 1, rp + 1, un,
+ big_base, big_base_inverted,
+ normalization_steps);
+ un -= rp[un] == 0;
+ frac = (rp[0] + 1) << GMP_NAIL_BITS;
+ s -= chars_per_limb;
+ i = chars_per_limb;
+ do
+ {
+ mp_limb_t digit;
+ umul_ppmm (digit, frac, frac, base);
+ *s++ = digit;
+ }
+ while (--i);
+ s -= chars_per_limb;
+ }
+
+ ul = rp[1];
+ while (ul != 0)
+ {
+ udiv_qrnd_unnorm (ul, rl, ul, base);
+ *--s = rl;
+ }
+ }
+
+ l = buf + BUF_ALLOC - s;
+ while (l < len)
+ {
+ *str++ = 0;
+ len--;
+ }
+ while (l != 0)
+ {
+ *str++ = *s++;
+ l--;
+ }
+ return str;
+}
+
+
+/* Convert {UP,UN} to a string with a base as represented in POWTAB, and put
+ the string in STR. Generate LEN characters, possibly padding with zeros to
+ the left. If LEN is zero, generate as many characters as required.
+ Return a pointer immediately after the last digit of the result string.
+ This uses divide-and-conquer and is intended for large conversions. */
+static unsigned char *
+mpn_dc_get_str (unsigned char *str, size_t len,
+ mp_ptr up, mp_size_t un,
+ const powers_t *powtab, mp_ptr tmp)
+{
+ if (BELOW_THRESHOLD (un, GET_STR_DC_THRESHOLD))
+ {
+ if (un != 0)
+ str = mpn_sb_get_str (str, len, up, un, powtab->base);
+ else
+ {
+ while (len != 0)
+ {
+ *str++ = 0;
+ len--;
+ }
+ }
+ }
+ else
+ {
+ mp_ptr pwp, qp, rp;
+ mp_size_t pwn, qn;
+ mp_size_t sn;
+
+ pwp = powtab->p;
+ pwn = powtab->n;
+ sn = powtab->shift;
+
+ if (un < pwn + sn || (un == pwn + sn && mpn_cmp (up + sn, pwp, un - sn) < 0))
+ {
+ str = mpn_dc_get_str (str, len, up, un, powtab - 1, tmp);
+ }
+ else
+ {
+ qp = tmp; /* (un - pwn + 1) limbs for qp */
+ rp = up; /* pwn limbs for rp; overwrite up area */
+
+ mpn_tdiv_qr (qp, rp + sn, 0L, up + sn, un - sn, pwp, pwn);
+ qn = un - sn - pwn; qn += qp[qn] != 0; /* quotient size */
+
+ ASSERT (qn < pwn + sn || (qn == pwn + sn && mpn_cmp (qp + sn, pwp, pwn) < 0));
+
+ if (len != 0)
+ len = len - powtab->digits_in_base;
+
+ str = mpn_dc_get_str (str, len, qp, qn, powtab - 1, tmp + qn);
+ str = mpn_dc_get_str (str, powtab->digits_in_base, rp, pwn + sn, powtab - 1, tmp);
+ }
+ }
+ 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. */
+
+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;
+ 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;
+
+ /* Special case zero, as the code below doesn't handle it. */
+ if (un == 0)
+ {
+ str[0] = 0;
+ return 1;
+ }
+
+ if (POW2_P (base))
+ {
+ /* The base is a power of 2. Convert from most significant end. */
+ mp_limb_t n1, n0;
+ int bits_per_digit = mp_bases[base].big_base;
+ int cnt;
+ int bit_pos;
+ mp_size_t i;
+ unsigned char *s = str;
+ mp_bitcnt_t bits;
+
+ n1 = up[un - 1];
+ count_leading_zeros (cnt, n1);
+
+ /* BIT_POS should be R when input ends in least significant nibble,
+ R + bits_per_digit * n when input ends in nth least significant
+ nibble. */
+
+ bits = (mp_bitcnt_t) GMP_NUMB_BITS * un - cnt + GMP_NAIL_BITS;
+ cnt = bits % bits_per_digit;
+ if (cnt != 0)
+ bits += bits_per_digit - cnt;
+ bit_pos = bits - (mp_bitcnt_t) (un - 1) * GMP_NUMB_BITS;
+
+ /* Fast loop for bit output. */
+ i = un - 1;
+ for (;;)
+ {
+ bit_pos -= bits_per_digit;
+ while (bit_pos >= 0)
+ {
+ *s++ = (n1 >> bit_pos) & ((1 << bits_per_digit) - 1);
+ bit_pos -= bits_per_digit;
+ }
+ i--;
+ if (i < 0)
+ break;
+ n0 = (n1 << -bit_pos) & ((1 << bits_per_digit) - 1);
+ n1 = up[i];
+ bit_pos += GMP_NUMB_BITS;
+ *s++ = n0 | (n1 >> bit_pos);
+ }
+
+ return s - str;
+ }
+
+ /* 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;
+
+ 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;
+
+ /* Compute a table of powers, were the largest power is >= sqrt(U). */
+
+ big_base = mp_bases[base].big_base;
+ digits_in_base = mp_bases[base].chars_per_limb;
+
+ {
+ 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;
+ TMP_FREE;
+
+ return out_len;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/gmp-mparam.h b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/gmp-mparam.h
new file mode 100644
index 00000000000..7dc057aa0c3
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/gmp-mparam.h
@@ -0,0 +1,33 @@
+/* Generic C gmp-mparam.h -- Compiler/machine parameter header file.
+
+Copyright 1991, 1993, 1994, 2000 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/. */
+
+
+/* Values for GMP_LIMB_BITS etc will be determined by ./configure and put
+ in config.h. */
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/hgcd.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/hgcd.c
new file mode 100644
index 00000000000..e27a9bdd820
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/hgcd.c
@@ -0,0 +1,183 @@
+/* hgcd.c.
+
+ 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'LL CHANGE OR DISAPPEAR IN A FUTURE GNU MP RELEASE.
+
+Copyright 2003-2005, 2008, 2011, 2012 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.h"
+#include "gmp-impl.h"
+#include "longlong.h"
+
+
+/* Size analysis for hgcd:
+
+ For the recursive calls, we have n1 <= ceil(n / 2). Then the
+ storage need is determined by the storage for the recursive call
+ computing M1, and hgcd_matrix_adjust and hgcd_matrix_mul calls that use M1
+ (after this, the storage needed for M1 can be recycled).
+
+ Let S(r) denote the required storage. For M1 we need 4 * (ceil(n1/2) + 1)
+ = 4 * (ceil(n/4) + 1), for the hgcd_matrix_adjust call, we need n + 2,
+ and for the hgcd_matrix_mul, we may need 3 ceil(n/2) + 8. In total,
+ 4 * ceil(n/4) + 3 ceil(n/2) + 12 <= 10 ceil(n/4) + 12.
+
+ For the recursive call, we need S(n1) = S(ceil(n/2)).
+
+ S(n) <= 10*ceil(n/4) + 12 + S(ceil(n/2))
+ <= 10*(ceil(n/4) + ... + ceil(n/2^(1+k))) + 12k + S(ceil(n/2^k))
+ <= 10*(2 ceil(n/4) + k) + 12k + S(ceil(n/2^k))
+ <= 20 ceil(n/4) + 22k + S(ceil(n/2^k))
+*/
+
+mp_size_t
+mpn_hgcd_itch (mp_size_t n)
+{
+ unsigned k;
+ int count;
+ mp_size_t nscaled;
+
+ if (BELOW_THRESHOLD (n, HGCD_THRESHOLD))
+ return n;
+
+ /* Get the recursion depth. */
+ nscaled = (n - 1) / (HGCD_THRESHOLD - 1);
+ count_leading_zeros (count, nscaled);
+ k = GMP_LIMB_BITS - count;
+
+ return 20 * ((n+3) / 4) + 22 * k + HGCD_THRESHOLD;
+}
+
+/* Reduces a,b until |a-b| fits in n/2 + 1 limbs. Constructs matrix M
+ with elements of size at most (n+1)/2 - 1. Returns new size of a,
+ b, or zero if no reduction is possible. */
+
+mp_size_t
+mpn_hgcd (mp_ptr ap, mp_ptr bp, mp_size_t n,
+ struct hgcd_matrix *M, mp_ptr tp)
+{
+ mp_size_t s = n/2 + 1;
+
+ mp_size_t nn;
+ int success = 0;
+
+ if (n <= s)
+ /* Happens when n <= 2, a fairly uninteresting case but exercised
+ by the random inputs of the testsuite. */
+ return 0;
+
+ ASSERT ((ap[n-1] | bp[n-1]) > 0);
+
+ ASSERT ((n+1)/2 - 1 < M->alloc);
+
+ if (ABOVE_THRESHOLD (n, HGCD_THRESHOLD))
+ {
+ mp_size_t n2 = (3*n)/4 + 1;
+ mp_size_t p = n/2;
+
+ nn = mpn_hgcd_reduce (M, ap, bp, n, p, tp);
+ if (nn)
+ {
+ n = nn;
+ success = 1;
+ }
+
+ /* NOTE: It appears this loop never runs more than once (at
+ least when not recursing to hgcd_appr). */
+ while (n > n2)
+ {
+ /* Needs n + 1 storage */
+ nn = mpn_hgcd_step (n, ap, bp, s, M, tp);
+ if (!nn)
+ return success ? n : 0;
+
+ n = nn;
+ success = 1;
+ }
+
+ if (n > s + 2)
+ {
+ struct hgcd_matrix M1;
+ mp_size_t scratch;
+
+ p = 2*s - n + 1;
+ scratch = MPN_HGCD_MATRIX_INIT_ITCH (n-p);
+
+ mpn_hgcd_matrix_init(&M1, n - p, tp);
+
+ /* FIXME: Should use hgcd_reduce, but that may require more
+ scratch space, which requires review. */
+
+ nn = mpn_hgcd (ap + p, bp + p, n - p, &M1, tp + scratch);
+ if (nn > 0)
+ {
+ /* We always have max(M) > 2^{-(GMP_NUMB_BITS + 1)} max(M1) */
+ ASSERT (M->n + 2 >= M1.n);
+
+ /* Furthermore, assume M ends with a quotient (1, q; 0, 1),
+ then either q or q + 1 is a correct quotient, and M1 will
+ start with either (1, 0; 1, 1) or (2, 1; 1, 1). This
+ rules out the case that the size of M * M1 is much
+ smaller than the expected M->n + M1->n. */
+
+ ASSERT (M->n + M1.n < M->alloc);
+
+ /* Needs 2 (p + M->n) <= 2 (2*s - n2 + 1 + n2 - s - 1)
+ = 2*s <= 2*(floor(n/2) + 1) <= n + 2. */
+ n = mpn_hgcd_matrix_adjust (&M1, p + nn, ap, bp, p, tp + scratch);
+
+ /* We need a bound for of M->n + M1.n. Let n be the original
+ input size. Then
+
+ ceil(n/2) - 1 >= size of product >= M.n + M1.n - 2
+
+ and it follows that
+
+ M.n + M1.n <= ceil(n/2) + 1
+
+ Then 3*(M.n + M1.n) + 5 <= 3 * ceil(n/2) + 8 is the
+ amount of needed scratch space. */
+ mpn_hgcd_matrix_mul (M, &M1, tp + scratch);
+ success = 1;
+ }
+ }
+ }
+
+ for (;;)
+ {
+ /* Needs s+3 < n */
+ nn = mpn_hgcd_step (n, ap, bp, s, M, tp);
+ if (!nn)
+ return success ? n : 0;
+
+ n = nn;
+ success = 1;
+ }
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/hgcd2.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/hgcd2.c
new file mode 100644
index 00000000000..129637063f9
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/hgcd2.c
@@ -0,0 +1,447 @@
+/* hgcd2.c
+
+ 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'LL CHANGE OR DISAPPEAR IN A FUTURE GNU MP RELEASE.
+
+Copyright 1996, 1998, 2000-2004, 2008, 2012 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.h"
+#include "gmp-impl.h"
+#include "longlong.h"
+
+#if GMP_NAIL_BITS == 0
+
+/* Copied from the old mpn/generic/gcdext.c, and modified slightly to return
+ the remainder. */
+
+/* Single-limb division optimized for small quotients. */
+static inline mp_limb_t
+div1 (mp_ptr rp,
+ mp_limb_t n0,
+ mp_limb_t d0)
+{
+ mp_limb_t q = 0;
+
+ if ((mp_limb_signed_t) n0 < 0)
+ {
+ int cnt;
+ for (cnt = 1; (mp_limb_signed_t) d0 >= 0; cnt++)
+ {
+ d0 = d0 << 1;
+ }
+
+ q = 0;
+ while (cnt)
+ {
+ q <<= 1;
+ if (n0 >= d0)
+ {
+ n0 = n0 - d0;
+ q |= 1;
+ }
+ d0 = d0 >> 1;
+ cnt--;
+ }
+ }
+ else
+ {
+ int cnt;
+ for (cnt = 0; n0 >= d0; cnt++)
+ {
+ d0 = d0 << 1;
+ }
+
+ q = 0;
+ while (cnt)
+ {
+ d0 = d0 >> 1;
+ q <<= 1;
+ if (n0 >= d0)
+ {
+ n0 = n0 - d0;
+ q |= 1;
+ }
+ cnt--;
+ }
+ }
+ *rp = n0;
+ return q;
+}
+
+/* Two-limb division optimized for small quotients. */
+static inline 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 q = 0;
+
+ if ((mp_limb_signed_t) nh < 0)
+ {
+ int cnt;
+ for (cnt = 1; (mp_limb_signed_t) dh >= 0; cnt++)
+ {
+ dh = (dh << 1) | (dl >> (GMP_LIMB_BITS - 1));
+ dl = dl << 1;
+ }
+
+ 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--;
+ }
+ }
+ else
+ {
+ int cnt;
+ for (cnt = 0; nh > dh || (nh == dh && nl >= dl); cnt++)
+ {
+ dh = (dh << 1) | (dl >> (GMP_LIMB_BITS - 1));
+ dl = dl << 1;
+ }
+
+ 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--;
+ }
+ }
+
+ rp[0] = nl;
+ rp[1] = nh;
+
+ 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
+div2 (mp_ptr rp,
+ mp_limb_t nh, mp_limb_t nl,
+ mp_limb_t dh, mp_limb_t dl)
+{
+ mp_limb_t q = 0;
+ int ncnt;
+ int dcnt;
+
+ count_leading_zeros (ncnt, nh);
+ count_leading_zeros (dcnt, dh);
+ dcnt -= ncnt;
+
+ dh = (dh << dcnt) + (-(dcnt > 0) & (dl >> (GMP_LIMB_BITS - dcnt)));
+ dl <<= dcnt;
+
+ do
+ {
+ mp_limb_t bit;
+ q <<= 1;
+ if (UNLIKELY (nh == dh))
+ bit = (nl >= dl);
+ else
+ bit = (nh > dh);
+
+ q |= bit;
+
+ sub_ddmmss (nh, nl, nh, nl, (-bit) & dh, (-bit) & dl);
+
+ dl = (dh << (GMP_LIMB_BITS - 1)) | (dl >> 1);
+ dh = dh >> 1;
+ }
+ while (dcnt--);
+
+ rp[0] = nl;
+ rp[1] = nh;
+
+ return q;
+}
+#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. */
+
+/* FIXME: Possible optimizations:
+
+ The div2 function starts with checking the most significant bit of
+ the numerator. We can maintained normalized operands here, call
+ hgcd with normalized operands only, which should make the code
+ simpler and possibly faster.
+
+ Experiment with table lookups on the most significant bits.
+
+ This function is also a candidate for assembler implementation.
+*/
+int
+mpn_hgcd2 (mp_limb_t ah, mp_limb_t al, mp_limb_t bh, mp_limb_t bl,
+ struct hgcd_matrix1 *M)
+{
+ mp_limb_t u00, u01, u10, u11;
+
+ if (ah < 2 || bh < 2)
+ return 0;
+
+ if (ah > bh || (ah == bh && al > bl))
+ {
+ sub_ddmmss (ah, al, ah, al, bh, bl);
+ if (ah < 2)
+ return 0;
+
+ u00 = u01 = u11 = 1;
+ u10 = 0;
+ }
+ else
+ {
+ sub_ddmmss (bh, bl, bh, bl, ah, al);
+ if (bh < 2)
+ return 0;
+
+ u00 = u10 = u11 = 1;
+ u01 = 0;
+ }
+
+ if (ah < bh)
+ goto subtract_a;
+
+ for (;;)
+ {
+ ASSERT (ah >= bh);
+ if (ah == bh)
+ goto done;
+
+ if (ah < (CNST_LIMB(1) << (GMP_LIMB_BITS / 2)))
+ {
+ ah = (ah << (GMP_LIMB_BITS / 2) ) + (al >> (GMP_LIMB_BITS / 2));
+ bh = (bh << (GMP_LIMB_BITS / 2) ) + (bl >> (GMP_LIMB_BITS / 2));
+
+ break;
+ }
+
+ /* Subtract a -= q b, and multiply M from the right by (1 q ; 0
+ 1), affecting the second column of M. */
+ ASSERT (ah > bh);
+ sub_ddmmss (ah, al, ah, al, bh, bl);
+
+ if (ah < 2)
+ goto done;
+
+ if (ah <= bh)
+ {
+ /* Use q = 1 */
+ u01 += u00;
+ u11 += u10;
+ }
+ else
+ {
+ mp_limb_t r[2];
+ mp_limb_t q = div2 (r, ah, al, bh, bl);
+ al = r[0]; ah = r[1];
+ if (ah < 2)
+ {
+ /* A is too small, but q is correct. */
+ u01 += q * u00;
+ u11 += q * u10;
+ goto done;
+ }
+ q++;
+ u01 += q * u00;
+ u11 += q * u10;
+ }
+ subtract_a:
+ ASSERT (bh >= ah);
+ if (ah == bh)
+ goto done;
+
+ if (bh < (CNST_LIMB(1) << (GMP_LIMB_BITS / 2)))
+ {
+ ah = (ah << (GMP_LIMB_BITS / 2) ) + (al >> (GMP_LIMB_BITS / 2));
+ bh = (bh << (GMP_LIMB_BITS / 2) ) + (bl >> (GMP_LIMB_BITS / 2));
+
+ goto subtract_a1;
+ }
+
+ /* Subtract b -= q a, and multiply M from the right by (1 0 ; q
+ 1), affecting the first column of M. */
+ sub_ddmmss (bh, bl, bh, bl, ah, al);
+
+ if (bh < 2)
+ goto done;
+
+ if (bh <= ah)
+ {
+ /* Use q = 1 */
+ u00 += u01;
+ u10 += u11;
+ }
+ else
+ {
+ mp_limb_t r[2];
+ mp_limb_t q = div2 (r, bh, bl, ah, al);
+ bl = r[0]; bh = r[1];
+ if (bh < 2)
+ {
+ /* B is too small, but q is correct. */
+ u00 += q * u01;
+ u10 += q * u11;
+ goto done;
+ }
+ q++;
+ u00 += q * u01;
+ u10 += q * u11;
+ }
+ }
+
+ /* 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 (;;)
+ {
+ ASSERT (ah >= bh);
+
+ ah -= bh;
+ if (ah < (CNST_LIMB (1) << (GMP_LIMB_BITS / 2 + 1)))
+ break;
+
+ if (ah <= bh)
+ {
+ /* Use q = 1 */
+ u01 += u00;
+ u11 += u10;
+ }
+ else
+ {
+ mp_limb_t r;
+ mp_limb_t q = div1 (&r, ah, bh);
+ ah = r;
+ if (ah < (CNST_LIMB(1) << (GMP_LIMB_BITS / 2 + 1)))
+ {
+ /* A is too small, but q is correct. */
+ u01 += q * u00;
+ u11 += q * u10;
+ break;
+ }
+ q++;
+ u01 += q * u00;
+ u11 += q * u10;
+ }
+ subtract_a1:
+ ASSERT (bh >= ah);
+
+ bh -= ah;
+ if (bh < (CNST_LIMB (1) << (GMP_LIMB_BITS / 2 + 1)))
+ break;
+
+ if (bh <= ah)
+ {
+ /* Use q = 1 */
+ u00 += u01;
+ u10 += u11;
+ }
+ else
+ {
+ mp_limb_t r;
+ mp_limb_t q = div1 (&r, bh, ah);
+ bh = r;
+ if (bh < (CNST_LIMB(1) << (GMP_LIMB_BITS / 2 + 1)))
+ {
+ /* B is too small, but q is correct. */
+ u00 += q * u01;
+ u10 += q * u11;
+ break;
+ }
+ q++;
+ u00 += q * u01;
+ u10 += q * u11;
+ }
+ }
+
+ done:
+ M->u[0][0] = u00; M->u[0][1] = u01;
+ M->u[1][0] = u10; M->u[1][1] = u11;
+
+ return 1;
+}
+
+/* Sets (r;b) = (a;b) M, with M = (u00, u01; u10, u11). Vector must
+ * have space for n + 1 limbs. Uses three buffers to avoid a copy*/
+mp_size_t
+mpn_hgcd_mul_matrix1_vector (const struct hgcd_matrix1 *M,
+ mp_ptr rp, mp_srcptr ap, mp_ptr bp, mp_size_t n)
+{
+ mp_limb_t ah, bh;
+
+ /* Compute (r,b) <-- (u00 a + u10 b, u01 a + u11 b) as
+
+ r = u00 * a
+ r += u10 * b
+ b *= u11
+ b += u01 * a
+ */
+
+#if HAVE_NATIVE_mpn_addaddmul_1msb0
+ ah = mpn_addaddmul_1msb0 (rp, ap, bp, n, M->u[0][0], M->u[1][0]);
+ bh = mpn_addaddmul_1msb0 (bp, bp, ap, n, M->u[1][1], M->u[0][1]);
+#else
+ ah = mpn_mul_1 (rp, ap, n, M->u[0][0]);
+ ah += mpn_addmul_1 (rp, bp, n, M->u[1][0]);
+
+ bh = mpn_mul_1 (bp, bp, n, M->u[1][1]);
+ bh += mpn_addmul_1 (bp, ap, n, M->u[0][1]);
+#endif
+ rp[n] = ah;
+ bp[n] = bh;
+
+ n += (ah | bh) > 0;
+ return n;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/hgcd2_jacobi.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/hgcd2_jacobi.c
new file mode 100644
index 00000000000..e59c32a3414
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/hgcd2_jacobi.c
@@ -0,0 +1,366 @@
+/* hgcd2_jacobi.c
+
+ 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'LL CHANGE OR DISAPPEAR IN A FUTURE GNU MP RELEASE.
+
+Copyright 1996, 1998, 2000-2004, 2008, 2011 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.h"
+#include "gmp-impl.h"
+#include "longlong.h"
+
+#if GMP_NAIL_BITS > 0
+#error Nails not supported.
+#endif
+
+/* FIXME: Duplicated in hgcd2.c. Should move to gmp-impl.h, and
+ possibly be renamed. */
+static inline mp_limb_t
+div1 (mp_ptr rp,
+ mp_limb_t n0,
+ mp_limb_t d0)
+{
+ mp_limb_t q = 0;
+
+ if ((mp_limb_signed_t) n0 < 0)
+ {
+ int cnt;
+ for (cnt = 1; (mp_limb_signed_t) d0 >= 0; cnt++)
+ {
+ d0 = d0 << 1;
+ }
+
+ q = 0;
+ while (cnt)
+ {
+ q <<= 1;
+ if (n0 >= d0)
+ {
+ n0 = n0 - d0;
+ q |= 1;
+ }
+ d0 = d0 >> 1;
+ cnt--;
+ }
+ }
+ else
+ {
+ int cnt;
+ for (cnt = 0; n0 >= d0; cnt++)
+ {
+ d0 = d0 << 1;
+ }
+
+ q = 0;
+ while (cnt)
+ {
+ d0 = d0 >> 1;
+ q <<= 1;
+ if (n0 >= d0)
+ {
+ n0 = n0 - d0;
+ q |= 1;
+ }
+ cnt--;
+ }
+ }
+ *rp = n0;
+ return q;
+}
+
+/* Two-limb division optimized for small quotients. */
+static inline 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 q = 0;
+
+ if ((mp_limb_signed_t) nh < 0)
+ {
+ int cnt;
+ for (cnt = 1; (mp_limb_signed_t) dh >= 0; cnt++)
+ {
+ dh = (dh << 1) | (dl >> (GMP_LIMB_BITS - 1));
+ dl = dl << 1;
+ }
+
+ 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--;
+ }
+ }
+ else
+ {
+ int cnt;
+ for (cnt = 0; nh > dh || (nh == dh && nl >= dl); cnt++)
+ {
+ dh = (dh << 1) | (dl >> (GMP_LIMB_BITS - 1));
+ dl = dl << 1;
+ }
+
+ 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--;
+ }
+ }
+
+ rp[0] = nl;
+ rp[1] = nh;
+
+ return q;
+}
+
+int
+mpn_hgcd2_jacobi (mp_limb_t ah, mp_limb_t al, mp_limb_t bh, mp_limb_t bl,
+ struct hgcd_matrix1 *M, unsigned *bitsp)
+{
+ mp_limb_t u00, u01, u10, u11;
+ unsigned bits = *bitsp;
+
+ if (ah < 2 || bh < 2)
+ return 0;
+
+ if (ah > bh || (ah == bh && al > bl))
+ {
+ sub_ddmmss (ah, al, ah, al, bh, bl);
+ if (ah < 2)
+ return 0;
+
+ u00 = u01 = u11 = 1;
+ u10 = 0;
+ bits = mpn_jacobi_update (bits, 1, 1);
+ }
+ else
+ {
+ sub_ddmmss (bh, bl, bh, bl, ah, al);
+ if (bh < 2)
+ return 0;
+
+ u00 = u10 = u11 = 1;
+ u01 = 0;
+ bits = mpn_jacobi_update (bits, 0, 1);
+ }
+
+ if (ah < bh)
+ goto subtract_a;
+
+ for (;;)
+ {
+ ASSERT (ah >= bh);
+ if (ah == bh)
+ goto done;
+
+ if (ah < (CNST_LIMB(1) << (GMP_LIMB_BITS / 2)))
+ {
+ ah = (ah << (GMP_LIMB_BITS / 2) ) + (al >> (GMP_LIMB_BITS / 2));
+ bh = (bh << (GMP_LIMB_BITS / 2) ) + (bl >> (GMP_LIMB_BITS / 2));
+
+ break;
+ }
+
+ /* Subtract a -= q b, and multiply M from the right by (1 q ; 0
+ 1), affecting the second column of M. */
+ ASSERT (ah > bh);
+ sub_ddmmss (ah, al, ah, al, bh, bl);
+
+ if (ah < 2)
+ goto done;
+
+ if (ah <= bh)
+ {
+ /* Use q = 1 */
+ u01 += u00;
+ u11 += u10;
+ bits = mpn_jacobi_update (bits, 1, 1);
+ }
+ else
+ {
+ mp_limb_t r[2];
+ mp_limb_t q = div2 (r, ah, al, bh, bl);
+ al = r[0]; ah = r[1];
+ if (ah < 2)
+ {
+ /* A is too small, but q is correct. */
+ u01 += q * u00;
+ u11 += q * u10;
+ bits = mpn_jacobi_update (bits, 1, q & 3);
+ goto done;
+ }
+ q++;
+ u01 += q * u00;
+ u11 += q * u10;
+ bits = mpn_jacobi_update (bits, 1, q & 3);
+ }
+ subtract_a:
+ ASSERT (bh >= ah);
+ if (ah == bh)
+ goto done;
+
+ if (bh < (CNST_LIMB(1) << (GMP_LIMB_BITS / 2)))
+ {
+ ah = (ah << (GMP_LIMB_BITS / 2) ) + (al >> (GMP_LIMB_BITS / 2));
+ bh = (bh << (GMP_LIMB_BITS / 2) ) + (bl >> (GMP_LIMB_BITS / 2));
+
+ goto subtract_a1;
+ }
+
+ /* Subtract b -= q a, and multiply M from the right by (1 0 ; q
+ 1), affecting the first column of M. */
+ sub_ddmmss (bh, bl, bh, bl, ah, al);
+
+ if (bh < 2)
+ goto done;
+
+ if (bh <= ah)
+ {
+ /* Use q = 1 */
+ u00 += u01;
+ u10 += u11;
+ bits = mpn_jacobi_update (bits, 0, 1);
+ }
+ else
+ {
+ mp_limb_t r[2];
+ mp_limb_t q = div2 (r, bh, bl, ah, al);
+ bl = r[0]; bh = r[1];
+ if (bh < 2)
+ {
+ /* B is too small, but q is correct. */
+ u00 += q * u01;
+ u10 += q * u11;
+ bits = mpn_jacobi_update (bits, 0, q & 3);
+ goto done;
+ }
+ q++;
+ u00 += q * u01;
+ u10 += q * u11;
+ bits = mpn_jacobi_update (bits, 0, q & 3);
+ }
+ }
+
+ /* 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 (;;)
+ {
+ ASSERT (ah >= bh);
+ if (ah == bh)
+ break;
+
+ ah -= bh;
+ if (ah < (CNST_LIMB (1) << (GMP_LIMB_BITS / 2 + 1)))
+ break;
+
+ if (ah <= bh)
+ {
+ /* Use q = 1 */
+ u01 += u00;
+ u11 += u10;
+ bits = mpn_jacobi_update (bits, 1, 1);
+ }
+ else
+ {
+ mp_limb_t r;
+ mp_limb_t q = div1 (&r, ah, bh);
+ ah = r;
+ if (ah < (CNST_LIMB(1) << (GMP_LIMB_BITS / 2 + 1)))
+ {
+ /* A is too small, but q is correct. */
+ u01 += q * u00;
+ u11 += q * u10;
+ bits = mpn_jacobi_update (bits, 1, q & 3);
+ break;
+ }
+ q++;
+ u01 += q * u00;
+ u11 += q * u10;
+ bits = mpn_jacobi_update (bits, 1, q & 3);
+ }
+ subtract_a1:
+ ASSERT (bh >= ah);
+ if (ah == bh)
+ break;
+
+ bh -= ah;
+ if (bh < (CNST_LIMB (1) << (GMP_LIMB_BITS / 2 + 1)))
+ break;
+
+ if (bh <= ah)
+ {
+ /* Use q = 1 */
+ u00 += u01;
+ u10 += u11;
+ bits = mpn_jacobi_update (bits, 0, 1);
+ }
+ else
+ {
+ mp_limb_t r;
+ mp_limb_t q = div1 (&r, bh, ah);
+ bh = r;
+ if (bh < (CNST_LIMB(1) << (GMP_LIMB_BITS / 2 + 1)))
+ {
+ /* B is too small, but q is correct. */
+ u00 += q * u01;
+ u10 += q * u11;
+ bits = mpn_jacobi_update (bits, 0, q & 3);
+ break;
+ }
+ q++;
+ u00 += q * u01;
+ u10 += q * u11;
+ bits = mpn_jacobi_update (bits, 0, q & 3);
+ }
+ }
+
+ done:
+ M->u[0][0] = u00; M->u[0][1] = u01;
+ M->u[1][0] = u10; M->u[1][1] = u11;
+ *bitsp = bits;
+
+ return 1;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/hgcd_appr.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/hgcd_appr.c
new file mode 100644
index 00000000000..660219372f8
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/hgcd_appr.c
@@ -0,0 +1,268 @@
+/* hgcd_appr.c.
+
+ 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'LL CHANGE OR DISAPPEAR IN A FUTURE GNU MP RELEASE.
+
+Copyright 2011, 2012 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.h"
+#include "gmp-impl.h"
+#include "longlong.h"
+
+/* Identical to mpn_hgcd_itch. FIXME: Do we really need to add
+ HGCD_THRESHOLD at the end? */
+mp_size_t
+mpn_hgcd_appr_itch (mp_size_t n)
+{
+ if (BELOW_THRESHOLD (n, HGCD_APPR_THRESHOLD))
+ return n;
+ else
+ {
+ unsigned k;
+ int count;
+ mp_size_t nscaled;
+
+ /* Get the recursion depth. */
+ nscaled = (n - 1) / (HGCD_APPR_THRESHOLD - 1);
+ count_leading_zeros (count, nscaled);
+ k = GMP_LIMB_BITS - count;
+
+ return 20 * ((n+3) / 4) + 22 * k + HGCD_THRESHOLD;
+ }
+}
+
+/* Destroys inputs. */
+int
+mpn_hgcd_appr (mp_ptr ap, mp_ptr bp, mp_size_t n,
+ struct hgcd_matrix *M, mp_ptr tp)
+{
+ mp_size_t s;
+ int success = 0;
+
+ ASSERT (n > 0);
+
+ ASSERT ((ap[n-1] | bp[n-1]) != 0);
+
+ if (n <= 2)
+ /* Implies s = n. A fairly uninteresting case but exercised by the
+ random inputs of the testsuite. */
+ return 0;
+
+ ASSERT ((n+1)/2 - 1 < M->alloc);
+
+ /* We aim for reduction of to GMP_NUMB_BITS * s bits. But each time
+ we discard some of the least significant limbs, we must keep one
+ additional bit to account for the truncation error. We maintain
+ the GMP_NUMB_BITS * s - extra_bits as the current target size. */
+
+ s = n/2 + 1;
+ if (BELOW_THRESHOLD (n, HGCD_APPR_THRESHOLD))
+ {
+ unsigned extra_bits = 0;
+
+ while (n > 2)
+ {
+ mp_size_t nn;
+
+ ASSERT (n > s);
+ ASSERT (n <= 2*s);
+
+ nn = mpn_hgcd_step (n, ap, bp, s, M, tp);
+ if (!nn)
+ break;
+
+ n = nn;
+ success = 1;
+
+ /* We can truncate and discard the lower p bits whenever nbits <=
+ 2*sbits - p. To account for the truncation error, we must
+ adjust
+
+ sbits <-- sbits + 1 - p,
+
+ rather than just sbits <-- sbits - p. This adjustment makes
+ the produced matrix slightly smaller than it could be. */
+
+ if (GMP_NUMB_BITS * (n + 1) + 2 * extra_bits <= 2*GMP_NUMB_BITS * s)
+ {
+ mp_size_t p = (GMP_NUMB_BITS * (2*s - n) - 2*extra_bits) / GMP_NUMB_BITS;
+
+ if (extra_bits == 0)
+ {
+ /* We cross a limb boundary and bump s. We can't do that
+ if the result is that it makes makes min(U, V)
+ smaller than 2^{GMP_NUMB_BITS} s. */
+ if (s + 1 == n
+ || mpn_zero_p (ap + s + 1, n - s - 1)
+ || mpn_zero_p (bp + s + 1, n - s - 1))
+ continue;
+
+ extra_bits = GMP_NUMB_BITS - 1;
+ s++;
+ }
+ else
+ {
+ extra_bits--;
+ }
+
+ /* Drop the p least significant limbs */
+ ap += p; bp += p; n -= p; s -= p;
+ }
+ }
+
+ ASSERT (s > 0);
+
+ if (extra_bits > 0)
+ {
+ /* We can get here only of we have dropped at least one of the least
+ significant bits, so we can decrement ap and bp. We can then shift
+ left extra bits using mpn_rshift. */
+ /* NOTE: In the unlikely case that n is large, it would be preferable
+ to do an initial subdiv step to reduce the size before shifting,
+ but that would mean duplicating mpn_gcd_subdiv_step with a bit
+ count rather than a limb count. */
+ ap--; bp--;
+ ap[0] = mpn_rshift (ap+1, ap+1, n, GMP_NUMB_BITS - extra_bits);
+ bp[0] = mpn_rshift (bp+1, bp+1, n, GMP_NUMB_BITS - extra_bits);
+ n += (ap[n] | bp[n]) > 0;
+
+ ASSERT (success);
+
+ while (n > 2)
+ {
+ mp_size_t nn;
+
+ ASSERT (n > s);
+ ASSERT (n <= 2*s);
+
+ nn = mpn_hgcd_step (n, ap, bp, s, M, tp);
+
+ if (!nn)
+ return 1;
+
+ n = nn;
+ }
+ }
+
+ if (n == 2)
+ {
+ struct hgcd_matrix1 M1;
+ ASSERT (s == 1);
+
+ if (mpn_hgcd2 (ap[1], ap[0], bp[1], bp[0], &M1))
+ {
+ /* Multiply M <- M * M1 */
+ mpn_hgcd_matrix_mul_1 (M, &M1, tp);
+ success = 1;
+ }
+ }
+ return success;
+ }
+ else
+ {
+ mp_size_t n2 = (3*n)/4 + 1;
+ mp_size_t p = n/2;
+ mp_size_t nn;
+
+ nn = mpn_hgcd_reduce (M, ap, bp, n, p, tp);
+ if (nn)
+ {
+ n = nn;
+ /* FIXME: Discard some of the low limbs immediately? */
+ success = 1;
+ }
+
+ while (n > n2)
+ {
+ mp_size_t nn;
+
+ /* Needs n + 1 storage */
+ nn = mpn_hgcd_step (n, ap, bp, s, M, tp);
+ if (!nn)
+ return success;
+
+ n = nn;
+ success = 1;
+ }
+ if (n > s + 2)
+ {
+ struct hgcd_matrix M1;
+ mp_size_t scratch;
+
+ p = 2*s - n + 1;
+ scratch = MPN_HGCD_MATRIX_INIT_ITCH (n-p);
+
+ mpn_hgcd_matrix_init(&M1, n - p, tp);
+ if (mpn_hgcd_appr (ap + p, bp + p, n - p, &M1, tp + scratch))
+ {
+ /* We always have max(M) > 2^{-(GMP_NUMB_BITS + 1)} max(M1) */
+ ASSERT (M->n + 2 >= M1.n);
+
+ /* Furthermore, assume M ends with a quotient (1, q; 0, 1),
+ then either q or q + 1 is a correct quotient, and M1 will
+ start with either (1, 0; 1, 1) or (2, 1; 1, 1). This
+ rules out the case that the size of M * M1 is much
+ smaller than the expected M->n + M1->n. */
+
+ ASSERT (M->n + M1.n < M->alloc);
+
+ /* We need a bound for of M->n + M1.n. Let n be the original
+ input size. Then
+
+ ceil(n/2) - 1 >= size of product >= M.n + M1.n - 2
+
+ and it follows that
+
+ M.n + M1.n <= ceil(n/2) + 1
+
+ Then 3*(M.n + M1.n) + 5 <= 3 * ceil(n/2) + 8 is the
+ amount of needed scratch space. */
+ mpn_hgcd_matrix_mul (M, &M1, tp + scratch);
+ return 1;
+ }
+ }
+
+ for(;;)
+ {
+ mp_size_t nn;
+
+ ASSERT (n > s);
+ ASSERT (n <= 2*s);
+
+ nn = mpn_hgcd_step (n, ap, bp, s, M, tp);
+
+ if (!nn)
+ return success;
+
+ n = nn;
+ success = 1;
+ }
+ }
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/hgcd_jacobi.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/hgcd_jacobi.c
new file mode 100644
index 00000000000..0a49e5b3a78
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/hgcd_jacobi.c
@@ -0,0 +1,244 @@
+/* hgcd_jacobi.c.
+
+ 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'LL CHANGE OR DISAPPEAR IN A FUTURE GNU MP RELEASE.
+
+Copyright 2003-2005, 2008, 2011, 2012 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.h"
+#include "gmp-impl.h"
+#include "longlong.h"
+
+/* This file is almost a copy of hgcd.c, with some added calls to
+ mpn_jacobi_update */
+
+struct hgcd_jacobi_ctx
+{
+ struct hgcd_matrix *M;
+ unsigned *bitsp;
+};
+
+static void
+hgcd_jacobi_hook (void *p, mp_srcptr gp, mp_size_t gn,
+ mp_srcptr qp, mp_size_t qn, int d)
+{
+ ASSERT (!gp);
+ ASSERT (d >= 0);
+
+ MPN_NORMALIZE (qp, qn);
+ if (qn > 0)
+ {
+ struct hgcd_jacobi_ctx *ctx = (struct hgcd_jacobi_ctx *) p;
+ /* NOTES: This is a bit ugly. A tp area is passed to
+ gcd_subdiv_step, which stores q at the start of that area. We
+ now use the rest. */
+ mp_ptr tp = (mp_ptr) qp + qn;
+
+ mpn_hgcd_matrix_update_q (ctx->M, qp, qn, d, tp);
+ *ctx->bitsp = mpn_jacobi_update (*ctx->bitsp, d, qp[0] & 3);
+ }
+}
+
+/* Perform a few steps, using some of mpn_hgcd2, subtraction and
+ division. Reduces the size by almost one limb or more, but never
+ below the given size s. Return new size for a and b, or 0 if no
+ more steps are possible.
+
+ If hgcd2 succeeds, needs temporary space for hgcd_matrix_mul_1, M->n
+ limbs, and hgcd_mul_matrix1_inverse_vector, n limbs. If hgcd2
+ fails, needs space for the quotient, qn <= n - s + 1 limbs, for and
+ hgcd_matrix_update_q, qn + (size of the appropriate column of M) <=
+ resulting size of M.
+
+ If N is the input size to the calling hgcd, then s = floor(N/2) +
+ 1, M->n < N, qn + matrix size <= n - s + 1 + n - s = 2 (n - s) + 1
+ < N, so N is sufficient.
+*/
+
+static mp_size_t
+hgcd_jacobi_step (mp_size_t n, mp_ptr ap, mp_ptr bp, mp_size_t s,
+ struct hgcd_matrix *M, unsigned *bitsp, mp_ptr tp)
+{
+ struct hgcd_matrix1 M1;
+ mp_limb_t mask;
+ mp_limb_t ah, al, bh, bl;
+
+ ASSERT (n > s);
+
+ mask = ap[n-1] | bp[n-1];
+ ASSERT (mask > 0);
+
+ if (n == s + 1)
+ {
+ if (mask < 4)
+ goto subtract;
+
+ ah = ap[n-1]; al = ap[n-2];
+ bh = bp[n-1]; bl = bp[n-2];
+ }
+ else if (mask & GMP_NUMB_HIGHBIT)
+ {
+ ah = ap[n-1]; al = ap[n-2];
+ bh = bp[n-1]; bl = bp[n-2];
+ }
+ else
+ {
+ int shift;
+
+ count_leading_zeros (shift, mask);
+ ah = MPN_EXTRACT_NUMB (shift, ap[n-1], ap[n-2]);
+ al = MPN_EXTRACT_NUMB (shift, ap[n-2], ap[n-3]);
+ bh = MPN_EXTRACT_NUMB (shift, bp[n-1], bp[n-2]);
+ bl = MPN_EXTRACT_NUMB (shift, bp[n-2], bp[n-3]);
+ }
+
+ /* Try an mpn_hgcd2 step */
+ if (mpn_hgcd2_jacobi (ah, al, bh, bl, &M1, bitsp))
+ {
+ /* Multiply M <- M * M1 */
+ mpn_hgcd_matrix_mul_1 (M, &M1, tp);
+
+ /* Can't swap inputs, so we need to copy. */
+ MPN_COPY (tp, ap, n);
+ /* Multiply M1^{-1} (a;b) */
+ return mpn_matrix22_mul1_inverse_vector (&M1, ap, tp, bp, n);
+ }
+
+ subtract:
+ {
+ struct hgcd_jacobi_ctx ctx;
+ ctx.M = M;
+ ctx.bitsp = bitsp;
+
+ return mpn_gcd_subdiv_step (ap, bp, n, s, hgcd_jacobi_hook, &ctx, tp);
+ }
+}
+
+/* Reduces a,b until |a-b| fits in n/2 + 1 limbs. Constructs matrix M
+ with elements of size at most (n+1)/2 - 1. Returns new size of a,
+ b, or zero if no reduction is possible. */
+
+/* Same scratch requirements as for mpn_hgcd. */
+mp_size_t
+mpn_hgcd_jacobi (mp_ptr ap, mp_ptr bp, mp_size_t n,
+ struct hgcd_matrix *M, unsigned *bitsp, mp_ptr tp)
+{
+ mp_size_t s = n/2 + 1;
+
+ mp_size_t nn;
+ int success = 0;
+
+ if (n <= s)
+ /* Happens when n <= 2, a fairly uninteresting case but exercised
+ by the random inputs of the testsuite. */
+ return 0;
+
+ ASSERT ((ap[n-1] | bp[n-1]) > 0);
+
+ ASSERT ((n+1)/2 - 1 < M->alloc);
+
+ if (ABOVE_THRESHOLD (n, HGCD_THRESHOLD))
+ {
+ mp_size_t n2 = (3*n)/4 + 1;
+ mp_size_t p = n/2;
+
+ nn = mpn_hgcd_jacobi (ap + p, bp + p, n - p, M, bitsp, tp);
+ if (nn > 0)
+ {
+ /* Needs 2*(p + M->n) <= 2*(floor(n/2) + ceil(n/2) - 1)
+ = 2 (n - 1) */
+ n = mpn_hgcd_matrix_adjust (M, p + nn, ap, bp, p, tp);
+ success = 1;
+ }
+ while (n > n2)
+ {
+ /* Needs n + 1 storage */
+ nn = hgcd_jacobi_step (n, ap, bp, s, M, bitsp, tp);
+ if (!nn)
+ return success ? n : 0;
+ n = nn;
+ success = 1;
+ }
+
+ if (n > s + 2)
+ {
+ struct hgcd_matrix M1;
+ mp_size_t scratch;
+
+ p = 2*s - n + 1;
+ scratch = MPN_HGCD_MATRIX_INIT_ITCH (n-p);
+
+ mpn_hgcd_matrix_init(&M1, n - p, tp);
+ nn = mpn_hgcd_jacobi (ap + p, bp + p, n - p, &M1, bitsp, tp + scratch);
+ if (nn > 0)
+ {
+ /* We always have max(M) > 2^{-(GMP_NUMB_BITS + 1)} max(M1) */
+ ASSERT (M->n + 2 >= M1.n);
+
+ /* Furthermore, assume M ends with a quotient (1, q; 0, 1),
+ then either q or q + 1 is a correct quotient, and M1 will
+ start with either (1, 0; 1, 1) or (2, 1; 1, 1). This
+ rules out the case that the size of M * M1 is much
+ smaller than the expected M->n + M1->n. */
+
+ ASSERT (M->n + M1.n < M->alloc);
+
+ /* Needs 2 (p + M->n) <= 2 (2*s - n2 + 1 + n2 - s - 1)
+ = 2*s <= 2*(floor(n/2) + 1) <= n + 2. */
+ n = mpn_hgcd_matrix_adjust (&M1, p + nn, ap, bp, p, tp + scratch);
+
+ /* We need a bound for of M->n + M1.n. Let n be the original
+ input size. Then
+
+ ceil(n/2) - 1 >= size of product >= M.n + M1.n - 2
+
+ and it follows that
+
+ M.n + M1.n <= ceil(n/2) + 1
+
+ Then 3*(M.n + M1.n) + 5 <= 3 * ceil(n/2) + 8 is the
+ amount of needed scratch space. */
+ mpn_hgcd_matrix_mul (M, &M1, tp + scratch);
+ success = 1;
+ }
+ }
+ }
+
+ for (;;)
+ {
+ /* Needs s+3 < n */
+ nn = hgcd_jacobi_step (n, ap, bp, s, M, bitsp, tp);
+ if (!nn)
+ return success ? n : 0;
+
+ n = nn;
+ success = 1;
+ }
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/hgcd_matrix.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/hgcd_matrix.c
new file mode 100644
index 00000000000..d9db331603b
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/hgcd_matrix.c
@@ -0,0 +1,266 @@
+/* hgcd_matrix.c.
+
+ 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'LL CHANGE OR DISAPPEAR IN A FUTURE GNU MP RELEASE.
+
+Copyright 2003-2005, 2008, 2012 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.h"
+#include "gmp-impl.h"
+#include "longlong.h"
+
+/* For input of size n, matrix elements are of size at most ceil(n/2)
+ - 1, but we need two limbs extra. */
+void
+mpn_hgcd_matrix_init (struct hgcd_matrix *M, mp_size_t n, mp_ptr p)
+{
+ mp_size_t s = (n+1)/2 + 1;
+ M->alloc = s;
+ M->n = 1;
+ MPN_ZERO (p, 4 * s);
+ M->p[0][0] = p;
+ M->p[0][1] = p + s;
+ M->p[1][0] = p + 2 * s;
+ M->p[1][1] = p + 3 * s;
+
+ M->p[0][0][0] = M->p[1][1][0] = 1;
+}
+
+/* Update column COL, adding in Q * column (1-COL). Temporary storage:
+ * qn + n <= M->alloc, where n is the size of the largest element in
+ * column 1 - COL. */
+void
+mpn_hgcd_matrix_update_q (struct hgcd_matrix *M, mp_srcptr qp, mp_size_t qn,
+ unsigned col, mp_ptr tp)
+{
+ ASSERT (col < 2);
+
+ if (qn == 1)
+ {
+ mp_limb_t q = qp[0];
+ mp_limb_t c0, c1;
+
+ c0 = mpn_addmul_1 (M->p[0][col], M->p[0][1-col], M->n, q);
+ c1 = mpn_addmul_1 (M->p[1][col], M->p[1][1-col], M->n, q);
+
+ M->p[0][col][M->n] = c0;
+ M->p[1][col][M->n] = c1;
+
+ M->n += (c0 | c1) != 0;
+ }
+ else
+ {
+ unsigned row;
+
+ /* Carries for the unlikely case that we get both high words
+ from the multiplication and carries from the addition. */
+ mp_limb_t c[2];
+ mp_size_t n;
+
+ /* The matrix will not necessarily grow in size by qn, so we
+ need normalization in order not to overflow M. */
+
+ for (n = M->n; n + qn > M->n; n--)
+ {
+ ASSERT (n > 0);
+ if (M->p[0][1-col][n-1] > 0 || M->p[1][1-col][n-1] > 0)
+ break;
+ }
+
+ ASSERT (qn + n <= M->alloc);
+
+ for (row = 0; row < 2; row++)
+ {
+ if (qn <= n)
+ mpn_mul (tp, M->p[row][1-col], n, qp, qn);
+ else
+ mpn_mul (tp, qp, qn, M->p[row][1-col], n);
+
+ ASSERT (n + qn >= M->n);
+ c[row] = mpn_add (M->p[row][col], tp, n + qn, M->p[row][col], M->n);
+ }
+
+ n += qn;
+
+ if (c[0] | c[1])
+ {
+ M->p[0][col][n] = c[0];
+ M->p[1][col][n] = c[1];
+ n++;
+ }
+ else
+ {
+ n -= (M->p[0][col][n-1] | M->p[1][col][n-1]) == 0;
+ ASSERT (n >= M->n);
+ }
+ M->n = n;
+ }
+
+ ASSERT (M->n < M->alloc);
+}
+
+/* Multiply M by M1 from the right. Since the M1 elements fit in
+ GMP_NUMB_BITS - 1 bits, M grows by at most one limb. Needs
+ temporary space M->n */
+void
+mpn_hgcd_matrix_mul_1 (struct hgcd_matrix *M, const struct hgcd_matrix1 *M1,
+ mp_ptr tp)
+{
+ mp_size_t n0, n1;
+
+ /* Could avoid copy by some swapping of pointers. */
+ MPN_COPY (tp, M->p[0][0], M->n);
+ n0 = mpn_hgcd_mul_matrix1_vector (M1, M->p[0][0], tp, M->p[0][1], M->n);
+ MPN_COPY (tp, M->p[1][0], M->n);
+ n1 = mpn_hgcd_mul_matrix1_vector (M1, M->p[1][0], tp, M->p[1][1], M->n);
+
+ /* Depends on zero initialization */
+ M->n = MAX(n0, n1);
+ ASSERT (M->n < M->alloc);
+}
+
+/* Multiply M by M1 from the right. Needs 3*(M->n + M1->n) + 5 limbs
+ of temporary storage (see mpn_matrix22_mul_itch). */
+void
+mpn_hgcd_matrix_mul (struct hgcd_matrix *M, const struct hgcd_matrix *M1,
+ mp_ptr tp)
+{
+ mp_size_t n;
+
+ /* About the new size of M:s elements. Since M1's diagonal elements
+ are > 0, no element can decrease. The new elements are of size
+ M->n + M1->n, one limb more or less. The computation of the
+ matrix product produces elements of size M->n + M1->n + 1. But
+ the true size, after normalization, may be three limbs smaller.
+
+ The reason that the product has normalized size >= M->n + M1->n -
+ 2 is subtle. It depends on the fact that M and M1 can be factored
+ as products of (1,1; 0,1) and (1,0; 1,1), and that we can't have
+ M ending with a large power and M1 starting with a large power of
+ the same matrix. */
+
+ /* FIXME: Strassen multiplication gives only a small speedup. In FFT
+ multiplication range, this function could be sped up quite a lot
+ using invariance. */
+ ASSERT (M->n + M1->n < M->alloc);
+
+ ASSERT ((M->p[0][0][M->n-1] | M->p[0][1][M->n-1]
+ | M->p[1][0][M->n-1] | M->p[1][1][M->n-1]) > 0);
+
+ ASSERT ((M1->p[0][0][M1->n-1] | M1->p[0][1][M1->n-1]
+ | M1->p[1][0][M1->n-1] | M1->p[1][1][M1->n-1]) > 0);
+
+ mpn_matrix22_mul (M->p[0][0], M->p[0][1],
+ M->p[1][0], M->p[1][1], M->n,
+ M1->p[0][0], M1->p[0][1],
+ M1->p[1][0], M1->p[1][1], M1->n, tp);
+
+ /* Index of last potentially non-zero limb, size is one greater. */
+ n = M->n + M1->n;
+
+ n -= ((M->p[0][0][n] | M->p[0][1][n] | M->p[1][0][n] | M->p[1][1][n]) == 0);
+ n -= ((M->p[0][0][n] | M->p[0][1][n] | M->p[1][0][n] | M->p[1][1][n]) == 0);
+ n -= ((M->p[0][0][n] | M->p[0][1][n] | M->p[1][0][n] | M->p[1][1][n]) == 0);
+
+ ASSERT ((M->p[0][0][n] | M->p[0][1][n] | M->p[1][0][n] | M->p[1][1][n]) > 0);
+
+ M->n = n + 1;
+}
+
+/* Multiplies the least significant p limbs of (a;b) by M^-1.
+ Temporary space needed: 2 * (p + M->n)*/
+mp_size_t
+mpn_hgcd_matrix_adjust (const struct hgcd_matrix *M,
+ mp_size_t n, mp_ptr ap, mp_ptr bp,
+ mp_size_t p, mp_ptr tp)
+{
+ /* M^-1 (a;b) = (r11, -r01; -r10, r00) (a ; b)
+ = (r11 a - r01 b; - r10 a + r00 b */
+
+ mp_ptr t0 = tp;
+ mp_ptr t1 = tp + p + M->n;
+ mp_limb_t ah, bh;
+ mp_limb_t cy;
+
+ ASSERT (p + M->n < n);
+
+ /* First compute the two values depending on a, before overwriting a */
+
+ if (M->n >= p)
+ {
+ mpn_mul (t0, M->p[1][1], M->n, ap, p);
+ mpn_mul (t1, M->p[1][0], M->n, ap, p);
+ }
+ else
+ {
+ mpn_mul (t0, ap, p, M->p[1][1], M->n);
+ mpn_mul (t1, ap, p, M->p[1][0], M->n);
+ }
+
+ /* Update a */
+ MPN_COPY (ap, t0, p);
+ ah = mpn_add (ap + p, ap + p, n - p, t0 + p, M->n);
+
+ if (M->n >= p)
+ mpn_mul (t0, M->p[0][1], M->n, bp, p);
+ else
+ mpn_mul (t0, bp, p, M->p[0][1], M->n);
+
+ cy = mpn_sub (ap, ap, n, t0, p + M->n);
+ ASSERT (cy <= ah);
+ ah -= cy;
+
+ /* Update b */
+ if (M->n >= p)
+ mpn_mul (t0, M->p[0][0], M->n, bp, p);
+ else
+ mpn_mul (t0, bp, p, M->p[0][0], M->n);
+
+ MPN_COPY (bp, t0, p);
+ bh = mpn_add (bp + p, bp + p, n - p, t0 + p, M->n);
+ cy = mpn_sub (bp, bp, n, t1, p + M->n);
+ ASSERT (cy <= bh);
+ bh -= cy;
+
+ if (ah > 0 || bh > 0)
+ {
+ ap[n] = ah;
+ bp[n] = bh;
+ n++;
+ }
+ else
+ {
+ /* The subtraction can reduce the size by at most one limb. */
+ if (ap[n-1] == 0 && bp[n-1] == 0)
+ n--;
+ }
+ ASSERT (ap[n-1] > 0 || bp[n-1] > 0);
+ return n;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/hgcd_reduce.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/hgcd_reduce.c
new file mode 100644
index 00000000000..6f3d61eceab
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/hgcd_reduce.c
@@ -0,0 +1,247 @@
+/* hgcd_reduce.c.
+
+ 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'LL CHANGE OR DISAPPEAR IN A FUTURE GNU MP RELEASE.
+
+Copyright 2011, 2012 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.h"
+#include "gmp-impl.h"
+#include "longlong.h"
+
+/* Computes R -= A * B. Result must be non-negative. Normalized down
+ to size an, and resulting size is returned. */
+static mp_size_t
+submul (mp_ptr rp, mp_size_t rn,
+ mp_srcptr ap, mp_size_t an, mp_srcptr bp, mp_size_t bn)
+{
+ mp_ptr tp;
+ TMP_DECL;
+
+ ASSERT (bn > 0);
+ ASSERT (an >= bn);
+ ASSERT (rn >= an);
+ ASSERT (an + bn <= rn + 1);
+
+ TMP_MARK;
+ tp = TMP_ALLOC_LIMBS (an + bn);
+
+ mpn_mul (tp, ap, an, bp, bn);
+ if (an + bn > rn)
+ {
+ ASSERT (tp[rn] == 0);
+ bn--;
+ }
+ ASSERT_NOCARRY (mpn_sub (rp, rp, rn, tp, an + bn));
+ TMP_FREE;
+
+ while (rn > an && (rp[rn-1] == 0))
+ rn--;
+
+ return rn;
+}
+
+/* Computes (a, b) <-- M^{-1} (a; b) */
+/* FIXME:
+ x Take scratch parameter, and figure out scratch need.
+
+ x Use some fallback for small M->n?
+*/
+static mp_size_t
+hgcd_matrix_apply (const struct hgcd_matrix *M,
+ mp_ptr ap, mp_ptr bp,
+ mp_size_t n)
+{
+ mp_size_t an, bn, un, vn, nn;
+ mp_size_t mn[2][2];
+ mp_size_t modn;
+ mp_ptr tp, sp, scratch;
+ mp_limb_t cy;
+ unsigned i, j;
+
+ TMP_DECL;
+
+ ASSERT ( (ap[n-1] | bp[n-1]) > 0);
+
+ an = n;
+ MPN_NORMALIZE (ap, an);
+ bn = n;
+ MPN_NORMALIZE (bp, bn);
+
+ for (i = 0; i < 2; i++)
+ for (j = 0; j < 2; j++)
+ {
+ mp_size_t k;
+ k = M->n;
+ MPN_NORMALIZE (M->p[i][j], k);
+ mn[i][j] = k;
+ }
+
+ ASSERT (mn[0][0] > 0);
+ ASSERT (mn[1][1] > 0);
+ ASSERT ( (mn[0][1] | mn[1][0]) > 0);
+
+ TMP_MARK;
+
+ if (mn[0][1] == 0)
+ {
+ /* A unchanged, M = (1, 0; q, 1) */
+ ASSERT (mn[0][0] == 1);
+ ASSERT (M->p[0][0][0] == 1);
+ ASSERT (mn[1][1] == 1);
+ ASSERT (M->p[1][1][0] == 1);
+
+ /* Put B <-- B - q A */
+ nn = submul (bp, bn, ap, an, M->p[1][0], mn[1][0]);
+ }
+ else if (mn[1][0] == 0)
+ {
+ /* B unchanged, M = (1, q; 0, 1) */
+ ASSERT (mn[0][0] == 1);
+ ASSERT (M->p[0][0][0] == 1);
+ ASSERT (mn[1][1] == 1);
+ ASSERT (M->p[1][1][0] == 1);
+
+ /* Put A <-- A - q * B */
+ nn = submul (ap, an, bp, bn, M->p[0][1], mn[0][1]);
+ }
+ else
+ {
+ /* A = m00 a + m01 b ==> a <= A / m00, b <= A / m01.
+ B = m10 a + m11 b ==> a <= B / m10, b <= B / m11. */
+ un = MIN (an - mn[0][0], bn - mn[1][0]) + 1;
+ vn = MIN (an - mn[0][1], bn - mn[1][1]) + 1;
+
+ nn = MAX (un, vn);
+ /* In the range of interest, mulmod_bnm1 should always beat mullo. */
+ modn = mpn_mulmod_bnm1_next_size (nn + 1);
+
+ scratch = TMP_ALLOC_LIMBS (mpn_mulmod_bnm1_itch (modn, modn, M->n));
+ tp = TMP_ALLOC_LIMBS (modn);
+ sp = TMP_ALLOC_LIMBS (modn);
+
+ ASSERT (n <= 2*modn);
+
+ if (n > modn)
+ {
+ cy = mpn_add (ap, ap, modn, ap + modn, n - modn);
+ MPN_INCR_U (ap, modn, cy);
+
+ cy = mpn_add (bp, bp, modn, bp + modn, n - modn);
+ MPN_INCR_U (bp, modn, cy);
+
+ n = modn;
+ }
+
+ mpn_mulmod_bnm1 (tp, modn, ap, n, M->p[1][1], mn[1][1], scratch);
+ mpn_mulmod_bnm1 (sp, modn, bp, n, M->p[0][1], mn[0][1], scratch);
+
+ /* FIXME: Handle the small n case in some better way. */
+ if (n + mn[1][1] < modn)
+ MPN_ZERO (tp + n + mn[1][1], modn - n - mn[1][1]);
+ if (n + mn[0][1] < modn)
+ MPN_ZERO (sp + n + mn[0][1], modn - n - mn[0][1]);
+
+ cy = mpn_sub_n (tp, tp, sp, modn);
+ MPN_DECR_U (tp, modn, cy);
+
+ ASSERT (mpn_zero_p (tp + nn, modn - nn));
+
+ mpn_mulmod_bnm1 (sp, modn, ap, n, M->p[1][0], mn[1][0], scratch);
+ MPN_COPY (ap, tp, nn);
+ mpn_mulmod_bnm1 (tp, modn, bp, n, M->p[0][0], mn[0][0], scratch);
+
+ if (n + mn[1][0] < modn)
+ MPN_ZERO (sp + n + mn[1][0], modn - n - mn[1][0]);
+ if (n + mn[0][0] < modn)
+ MPN_ZERO (tp + n + mn[0][0], modn - n - mn[0][0]);
+
+ cy = mpn_sub_n (tp, tp, sp, modn);
+ MPN_DECR_U (tp, modn, cy);
+
+ ASSERT (mpn_zero_p (tp + nn, modn - nn));
+ MPN_COPY (bp, tp, nn);
+
+ while ( (ap[nn-1] | bp[nn-1]) == 0)
+ {
+ nn--;
+ ASSERT (nn > 0);
+ }
+ }
+ TMP_FREE;
+
+ return nn;
+}
+
+mp_size_t
+mpn_hgcd_reduce_itch (mp_size_t n, mp_size_t p)
+{
+ mp_size_t itch;
+ if (BELOW_THRESHOLD (n, HGCD_REDUCE_THRESHOLD))
+ {
+ itch = mpn_hgcd_itch (n-p);
+
+ /* For arbitrary p, the storage for _adjust is 2*(p + M->n) = 2 *
+ (p + ceil((n-p)/2) - 1 <= n + p - 1 */
+ if (itch < n + p - 1)
+ itch = n + p - 1;
+ }
+ else
+ {
+ itch = 2*(n-p) + mpn_hgcd_itch (n-p);
+ /* Currently, hgcd_matrix_apply allocates its own storage. */
+ }
+ return itch;
+}
+
+/* FIXME: Document storage need. */
+mp_size_t
+mpn_hgcd_reduce (struct hgcd_matrix *M,
+ mp_ptr ap, mp_ptr bp, mp_size_t n, mp_size_t p,
+ mp_ptr tp)
+{
+ mp_size_t nn;
+ if (BELOW_THRESHOLD (n, HGCD_REDUCE_THRESHOLD))
+ {
+ nn = mpn_hgcd (ap + p, bp + p, n - p, M, tp);
+ if (nn > 0)
+ /* Needs 2*(p + M->n) <= 2*(floor(n/2) + ceil(n/2) - 1)
+ = 2 (n - 1) */
+ return mpn_hgcd_matrix_adjust (M, p + nn, ap, bp, p, tp);
+ }
+ else
+ {
+ MPN_COPY (tp, ap + p, n - p);
+ MPN_COPY (tp + n - p, bp + p, n - p);
+ if (mpn_hgcd_appr (tp, tp + n - p, n - p, M, tp + 2*(n-p)))
+ return hgcd_matrix_apply (M, ap, bp, n);
+ }
+ return 0;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/hgcd_step.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/hgcd_step.c
new file mode 100644
index 00000000000..e58894ff3b4
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/hgcd_step.c
@@ -0,0 +1,128 @@
+/* hgcd_step.c.
+
+ 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'LL CHANGE OR DISAPPEAR IN A FUTURE GNU MP RELEASE.
+
+Copyright 2003-2005, 2008, 2011, 2012 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.h"
+#include "gmp-impl.h"
+#include "longlong.h"
+
+
+static void
+hgcd_hook (void *p, mp_srcptr gp, mp_size_t gn,
+ mp_srcptr qp, mp_size_t qn, int d)
+{
+ ASSERT (!gp);
+ ASSERT (d >= 0);
+ ASSERT (d <= 1);
+
+ MPN_NORMALIZE (qp, qn);
+ if (qn > 0)
+ {
+ struct hgcd_matrix *M = (struct hgcd_matrix *) p;
+ /* NOTES: This is a bit ugly. A tp area is passed to
+ gcd_subdiv_step, which stores q at the start of that area. We
+ now use the rest. */
+ mp_ptr tp = (mp_ptr) qp + qn;
+ mpn_hgcd_matrix_update_q (M, qp, qn, d, tp);
+ }
+}
+
+/* Perform a few steps, using some of mpn_hgcd2, subtraction and
+ division. Reduces the size by almost one limb or more, but never
+ below the given size s. Return new size for a and b, or 0 if no
+ more steps are possible.
+
+ If hgcd2 succeeds, needs temporary space for hgcd_matrix_mul_1, M->n
+ limbs, and hgcd_mul_matrix1_inverse_vector, n limbs. If hgcd2
+ fails, needs space for the quotient, qn <= n - s limbs, for and
+ hgcd_matrix_update_q, qn + (size of the appropriate column of M) <=
+ (resulting size of M) + 1.
+
+ If N is the input size to the calling hgcd, then s = floor(N/2) +
+ 1, M->n < N, qn + product size <= n - s + n - s + 1 = 2 (n - s) + 1
+ <= N.
+*/
+
+mp_size_t
+mpn_hgcd_step (mp_size_t n, mp_ptr ap, mp_ptr bp, mp_size_t s,
+ struct hgcd_matrix *M, mp_ptr tp)
+{
+ struct hgcd_matrix1 M1;
+ mp_limb_t mask;
+ mp_limb_t ah, al, bh, bl;
+
+ ASSERT (n > s);
+
+ mask = ap[n-1] | bp[n-1];
+ ASSERT (mask > 0);
+
+ if (n == s + 1)
+ {
+ if (mask < 4)
+ goto subtract;
+
+ ah = ap[n-1]; al = ap[n-2];
+ bh = bp[n-1]; bl = bp[n-2];
+ }
+ else if (mask & GMP_NUMB_HIGHBIT)
+ {
+ ah = ap[n-1]; al = ap[n-2];
+ bh = bp[n-1]; bl = bp[n-2];
+ }
+ else
+ {
+ int shift;
+
+ count_leading_zeros (shift, mask);
+ ah = MPN_EXTRACT_NUMB (shift, ap[n-1], ap[n-2]);
+ al = MPN_EXTRACT_NUMB (shift, ap[n-2], ap[n-3]);
+ bh = MPN_EXTRACT_NUMB (shift, bp[n-1], bp[n-2]);
+ bl = MPN_EXTRACT_NUMB (shift, bp[n-2], bp[n-3]);
+ }
+
+ /* Try an mpn_hgcd2 step */
+ if (mpn_hgcd2 (ah, al, bh, bl, &M1))
+ {
+ /* Multiply M <- M * M1 */
+ mpn_hgcd_matrix_mul_1 (M, &M1, tp);
+
+ /* Can't swap inputs, so we need to copy. */
+ MPN_COPY (tp, ap, n);
+ /* Multiply M1^{-1} (a;b) */
+ return mpn_matrix22_mul1_inverse_vector (&M1, ap, tp, bp, n);
+ }
+
+ subtract:
+
+ return mpn_gcd_subdiv_step (ap, bp, n, s, hgcd_hook, M, tp);
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/invert.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/invert.c
new file mode 100644
index 00000000000..4bc459d728b
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/invert.c
@@ -0,0 +1,91 @@
+/* invert.c -- Compute floor((B^{2n}-1)/U) - B^n.
+
+ Contributed to the GNU project by Marco Bodrato.
+
+ 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 GMP RELEASE.
+
+Copyright (C) 2007, 2009, 2010, 2012 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.h"
+#include "gmp-impl.h"
+#include "longlong.h"
+
+void
+mpn_invert (mp_ptr ip, mp_srcptr dp, mp_size_t n, mp_ptr scratch)
+{
+ ASSERT (n > 0);
+ ASSERT (dp[n-1] & GMP_NUMB_HIGHBIT);
+ ASSERT (! MPN_OVERLAP_P (ip, n, dp, n));
+ ASSERT (! MPN_OVERLAP_P (ip, n, scratch, mpn_invertappr_itch(n)));
+ ASSERT (! MPN_OVERLAP_P (dp, n, scratch, mpn_invertappr_itch(n)));
+
+ if (n == 1)
+ invert_limb (*ip, *dp);
+ else {
+ TMP_DECL;
+
+ TMP_MARK;
+ 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 */
+ for (i = n - 1; i >= 0; i--)
+ xp[i] = GMP_NUMB_MAX;
+ mpn_com (xp + n, dp, n);
+ if (n == 2) {
+ mpn_divrem_2 (ip, 0, xp, 4, dp);
+ } else {
+ gmp_pi1_t inv;
+ invert_pi1 (inv, dp[n-1], dp[n-2]);
+ /* FIXME: should we use dcpi1_div_q, for big sizes? */
+ mpn_sbpi1_div_q (ip, xp, 2 * n, dp, n, inv.inv32);
+ }
+ }
+ else { /* Use approximated inverse; correct the result if needed. */
+ mp_limb_t e; /* The possible error in the approximate inverse */
+
+ ASSERT ( mpn_invert_itch (n) >= mpn_invertappr_itch (n) );
+ e = mpn_ni_invertappr (ip, dp, n, scratch);
+
+ if (UNLIKELY (e)) { /* Assume the error can only be "0" (no error) or "1". */
+ /* Code to detect and correct the "off by one" approximation. */
+ mpn_mul_n (scratch, ip, dp, n);
+ ASSERT_NOCARRY (mpn_add_n (scratch + n, scratch + n, dp, n));
+ if (! mpn_add (scratch, scratch, 2*n, dp, n))
+ MPN_INCR_U (ip, n, 1); /* The value was wrong, correct it. */
+ }
+ }
+ TMP_FREE;
+ }
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/invertappr.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/invertappr.c
new file mode 100644
index 00000000000..12326b8b75c
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/invertappr.c
@@ -0,0 +1,314 @@
+/* mpn_invertappr and helper functions. Compute I such that
+ floor((B^{2n}-1)/U - 1 <= I + B^n <= floor((B^{2n}-1)/U.
+
+ Contributed to the GNU project by Marco Bodrato.
+
+ The algorithm used here was inspired by ApproximateReciprocal from "Modern
+ Computer Arithmetic", by Richard P. Brent and Paul Zimmermann. Special
+ thanks to Paul Zimmermann for his very valuable suggestions on all the
+ theoretical aspects during the work on this code.
+
+ 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 GMP RELEASE.
+
+Copyright (C) 2007, 2009, 2010, 2012 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/. */
+
+/* FIXME: Remove NULL and TMP_*, as soon as all the callers properly
+ allocate and pass the scratch to the function. */
+#include <stdlib.h> /* for NULL */
+
+#include "gmp.h"
+#include "gmp-impl.h"
+#include "longlong.h"
+
+/* FIXME: The iterative version splits the operand in two slightly unbalanced
+ parts, the use of log_2 (or counting the bits) underestimate the maximum
+ number of iterations. */
+
+#if TUNE_PROGRAM_BUILD
+#define NPOWS \
+ ((sizeof(mp_size_t) > 6 ? 48 : 8*sizeof(mp_size_t)))
+#define MAYBE_dcpi1_divappr 1
+#else
+#define NPOWS \
+ ((sizeof(mp_size_t) > 6 ? 48 : 8*sizeof(mp_size_t)) - LOG2C (INV_NEWTON_THRESHOLD))
+#define MAYBE_dcpi1_divappr \
+ (INV_NEWTON_THRESHOLD < DC_DIVAPPR_Q_THRESHOLD)
+#if (INV_NEWTON_THRESHOLD > INV_MULMOD_BNM1_THRESHOLD) && \
+ (INV_APPR_THRESHOLD > INV_MULMOD_BNM1_THRESHOLD)
+#undef INV_MULMOD_BNM1_THRESHOLD
+#define INV_MULMOD_BNM1_THRESHOLD 0 /* always when Newton */
+#endif
+#endif
+
+/* All the three functions mpn{,_bc,_ni}_invertappr (ip, dp, n, scratch), take
+ the strictly normalised value {dp,n} (i.e., most significant bit must be set)
+ as an input, and compute {ip,n}: the approximate reciprocal of {dp,n}.
+
+ Let e = mpn*_invertappr (ip, dp, n, scratch) be the returned value; the
+ following conditions are satisfied by the output:
+ 0 <= e <= 1;
+ {dp,n}*(B^n+{ip,n}) < B^{2n} <= {dp,n}*(B^n+{ip,n}+1+e) .
+ I.e. e=0 means that the result {ip,n} equals the one given by mpn_invert.
+ e=1 means that the result _may_ be one less than expected.
+
+ The _bc version returns e=1 most of the time.
+ The _ni version should return e=0 most of the time; only about 1% of
+ possible random input should give e=1.
+
+ When the strict result is needed, i.e., e=0 in the relation above:
+ {dp,n}*(B^n+{ip,n}) < B^{2n} <= {dp,n}*(B^n+{ip,n}+1) ;
+ the function mpn_invert (ip, dp, n, scratch) should be used instead. */
+
+/* Maximum scratch needed by this branch (at tp): 3*n + 2 */
+static mp_limb_t
+mpn_bc_invertappr (mp_ptr ip, mp_srcptr dp, mp_size_t n, mp_ptr tp)
+{
+ mp_ptr xp;
+
+ ASSERT (n > 0);
+ ASSERT (dp[n-1] & GMP_NUMB_HIGHBIT);
+ ASSERT (! MPN_OVERLAP_P (ip, n, dp, n));
+ ASSERT (! MPN_OVERLAP_P (ip, n, tp, mpn_invertappr_itch(n)));
+ ASSERT (! MPN_OVERLAP_P (dp, n, tp, mpn_invertappr_itch(n)));
+
+ /* Compute a base value of r limbs. */
+ if (n == 1)
+ invert_limb (*ip, *dp);
+ else {
+ mp_size_t i;
+ xp = tp + n + 2; /* 2 * n limbs */
+
+ for (i = n - 1; i >= 0; i--)
+ xp[i] = GMP_NUMB_MAX;
+ mpn_com (xp + n, dp, n);
+
+ /* Now xp contains B^2n - {dp,n}*B^n - 1 */
+
+ /* FIXME: if mpn_*pi1_divappr_q handles n==2, use it! */
+ if (n == 2) {
+ mpn_divrem_2 (ip, 0, xp, 4, dp);
+ } else {
+ gmp_pi1_t inv;
+ invert_pi1 (inv, dp[n-1], dp[n-2]);
+ if (! MAYBE_dcpi1_divappr
+ || BELOW_THRESHOLD (n, DC_DIVAPPR_Q_THRESHOLD))
+ mpn_sbpi1_divappr_q (ip, xp, 2 * n, dp, n, inv.inv32);
+ else
+ mpn_dcpi1_divappr_q (ip, xp, 2 * n, dp, n, &inv);
+ MPN_DECR_U(ip, n, 1);
+ return 1;
+ }
+ }
+ return 0;
+}
+
+/* mpn_ni_invertappr: computes the approximate reciprocal using Newton's
+ iterations (at least one).
+
+ Inspired by Algorithm "ApproximateReciprocal", published in "Modern Computer
+ Arithmetic" by Richard P. Brent and Paul Zimmermann, algorithm 3.5, page 121
+ in version 0.4 of the book.
+
+ Some adaptations were introduced, to allow product mod B^m-1 and return the
+ value e.
+
+ USE_MUL_N = 1 (default) introduces a correction in such a way that "the
+ value of B^{n+h}-T computed at step 8 cannot exceed B^n-1" (the book reads
+ "2B^n-1"). This correction should not require to modify the proof.
+
+ We use a wrapped product modulo B^m-1. NOTE: is there any normalisation
+ problem for the [0] class? It shouldn't: we compute 2*|A*X_h - B^{n+h}| <
+ B^m-1. We may get [0] if and only if we get AX_h = B^{n+h}. This can
+ happen only if A=B^{n}/2, but this implies X_h = B^{h}*2-1 i.e., AX_h =
+ B^{n+h} - A, then we get into the "negative" branch, where X_h is not
+ incremented (because A < B^n).
+
+ FIXME: the scratch for mulmod_bnm1 does not currently fit in the scratch, it
+ is allocated apart. */
+
+#define USE_MUL_N 1
+
+mp_limb_t
+mpn_ni_invertappr (mp_ptr ip, mp_srcptr dp, mp_size_t n, mp_ptr scratch)
+{
+ mp_limb_t cy;
+ mp_ptr xp;
+ mp_size_t rn, mn;
+ mp_size_t sizes[NPOWS], *sizp;
+ mp_ptr tp;
+ TMP_DECL;
+#define rp scratch
+
+ ASSERT (n > 2);
+ ASSERT (dp[n-1] & GMP_NUMB_HIGHBIT);
+ ASSERT (! MPN_OVERLAP_P (ip, n, dp, n));
+ ASSERT (! MPN_OVERLAP_P (ip, n, scratch, mpn_invertappr_itch(n)));
+ ASSERT (! MPN_OVERLAP_P (dp, n, scratch, mpn_invertappr_itch(n)));
+
+ /* Compute the computation precisions from highest to lowest, leaving the
+ base case size in 'rn'. */
+ sizp = sizes;
+ rn = n;
+ do {
+ *sizp = rn;
+ rn = ((rn) >> 1) + 1;
+ sizp ++;
+ } while (ABOVE_THRESHOLD (rn, INV_NEWTON_THRESHOLD));
+
+ /* We search the inverse of 0.{dp,n}, we compute it as 1.{ip,n} */
+ dp += n;
+ ip += n;
+
+ /* Compute a base value of rn limbs. */
+ mpn_bc_invertappr (ip - rn, dp - rn, rn, scratch);
+
+ TMP_MARK;
+
+ if (ABOVE_THRESHOLD (n, INV_MULMOD_BNM1_THRESHOLD))
+ {
+ mn = mpn_mulmod_bnm1_next_size (n + 1);
+ tp = TMP_ALLOC_LIMBS (mpn_mulmod_bnm1_itch (mn, n, (n >> 1) + 1));
+ }
+ /* Use Newton's iterations to get the desired precision.*/
+
+ /* define rp scratch; 2rn + 1 limbs <= 2(n>>1 + 1) + 1 <= n + 3 limbs */
+ /* Maximum scratch needed by this branch <= 3*n + 2 */
+ xp = scratch + n + 3; /* n + rn limbs */
+ while (1) {
+ mp_limb_t method;
+
+ n = *--sizp;
+ /*
+ v n v
+ +----+--+
+ ^ rn ^
+ */
+
+ /* Compute i_jd . */
+ if (BELOW_THRESHOLD (n, INV_MULMOD_BNM1_THRESHOLD)
+ || ((mn = mpn_mulmod_bnm1_next_size (n + 1)) > (n + rn))) {
+ /* FIXME: We do only need {xp,n+1}*/
+ mpn_mul (xp, dp - n, n, ip - rn, rn);
+ mpn_add_n (xp + rn, xp + rn, dp - n, n - rn + 1);
+ method = 1; /* Remember we used (truncated) product */
+ /* We computed cy.{xp,rn+n} <- 1.{ip,rn} * 0.{dp,n} */
+ } else { /* Use B^n-1 wraparound */
+ mpn_mulmod_bnm1 (xp, mn, dp - n, n, ip - rn, rn, tp);
+ /* We computed {xp,mn} <- {ip,rn} * {dp,n} mod (B^mn-1) */
+ /* We know that 2*|ip*dp + dp*B^rn - B^{rn+n}| < B^mn-1 */
+ /* Add dp*B^rn mod (B^mn-1) */
+ ASSERT (n >= mn - rn);
+ xp[mn] = 1 + mpn_add_n (xp + rn, xp + rn, dp - n, mn - rn);
+ cy = mpn_add_n (xp, xp, dp - (n - (mn - rn)), n - (mn - rn));
+ MPN_INCR_U (xp + n - (mn - rn), mn + 1 - n + (mn - rn), cy);
+ ASSERT (n + rn >= mn);
+ /* Subtract B^{rn+n} */
+ MPN_DECR_U (xp + rn + n - mn, 2*mn + 1 - rn - n, 1);
+ if (xp[mn])
+ MPN_INCR_U (xp, mn, xp[mn] - 1);
+ else
+ MPN_DECR_U (xp, mn, 1);
+ method = 0; /* Remember we are working Mod B^m-1 */
+ }
+
+ if (xp[n] < 2) { /* "positive" residue class */
+ cy = 1;
+ while (xp[n] || mpn_cmp (xp, dp - n, n)>0) {
+ xp[n] -= mpn_sub_n (xp, xp, dp - n, n);
+ cy ++;
+ }
+ MPN_DECR_U(ip - rn, rn, cy);
+ ASSERT (cy <= 4); /* at most 3 cycles for the while above */
+ ASSERT_NOCARRY (mpn_sub_n (xp, dp - n, xp, n));
+ ASSERT (xp[n] == 0);
+ } else { /* "negative" residue class */
+ mpn_com (xp, xp, n + 1);
+ MPN_INCR_U(xp, n + 1, method);
+ ASSERT (xp[n] <= 1);
+#if USE_MUL_N
+ if (xp[n]) {
+ MPN_INCR_U(ip - rn, rn, 1);
+ ASSERT_CARRY (mpn_sub_n (xp, xp, dp - n, n));
+ }
+#endif
+ }
+
+ /* Compute x_ju_j. FIXME:We need {rp+rn,rn}, mulhi? */
+#if USE_MUL_N
+ mpn_mul_n (rp, xp + n - rn, ip - rn, rn);
+#else
+ rp[2*rn] = 0;
+ mpn_mul (rp, xp + n - rn, rn + xp[n], ip - rn, rn);
+#endif
+ /* We need _only_ the carry from the next addition */
+ /* Anyway 2rn-n <= 2... we don't need to optimise. */
+ cy = mpn_add_n (rp + rn, rp + rn, xp + n - rn, 2*rn - n);
+ cy = mpn_add_nc (ip - n, rp + 3*rn - n, xp + rn, n - rn, cy);
+ MPN_INCR_U (ip - rn, rn, cy + (1-USE_MUL_N)*(rp[2*rn] + xp[n]));
+ if (sizp == sizes) { /* Get out of the cycle */
+ /* Check for possible carry propagation from below. */
+ cy = rp[3*rn - n - 1] > GMP_NUMB_MAX - 7; /* Be conservative. */
+/* cy = mpn_add_1 (rp + rn, rp + rn, 2*rn - n, 4); */
+ break;
+ }
+ rn = n;
+ }
+ TMP_FREE;
+
+ return cy;
+#undef rp
+}
+
+mp_limb_t
+mpn_invertappr (mp_ptr ip, mp_srcptr dp, mp_size_t n, mp_ptr scratch)
+{
+ mp_limb_t res;
+ TMP_DECL;
+
+ TMP_MARK;
+
+ if (scratch == NULL)
+ scratch = TMP_ALLOC_LIMBS (mpn_invertappr_itch (n));
+
+ ASSERT (n > 0);
+ ASSERT (dp[n-1] & GMP_NUMB_HIGHBIT);
+ ASSERT (! MPN_OVERLAP_P (ip, n, dp, n));
+ ASSERT (! MPN_OVERLAP_P (ip, n, scratch, mpn_invertappr_itch(n)));
+ ASSERT (! MPN_OVERLAP_P (dp, n, scratch, mpn_invertappr_itch(n)));
+
+ if (BELOW_THRESHOLD (n, INV_NEWTON_THRESHOLD))
+ res = mpn_bc_invertappr (ip, dp, n, scratch);
+ else
+ res = mpn_ni_invertappr (ip, dp, n, scratch);
+
+ TMP_FREE;
+ return res;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/jacbase.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/jacbase.c
new file mode 100644
index 00000000000..cd52bc95133
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/jacbase.c
@@ -0,0 +1,243 @@
+/* mpn_jacobi_base -- limb/limb Jacobi symbol with restricted arguments.
+
+ THIS INTERFACE IS PRELIMINARY AND MIGHT DISAPPEAR OR BE SUBJECT TO
+ INCOMPATIBLE CHANGES IN A FUTURE RELEASE OF GMP.
+
+Copyright 1999-2002, 2010 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.h"
+#include "gmp-impl.h"
+#include "longlong.h"
+
+
+/* Use the simple loop by default. The generic count_trailing_zeros is not
+ very fast, and the extra trickery of method 3 has proven to be less use
+ than might have been though. */
+#ifndef JACOBI_BASE_METHOD
+#define JACOBI_BASE_METHOD 2
+#endif
+
+
+/* Use count_trailing_zeros. */
+#if JACOBI_BASE_METHOD == 1
+#define PROCESS_TWOS_ANY \
+ { \
+ mp_limb_t twos; \
+ count_trailing_zeros (twos, a); \
+ result_bit1 ^= JACOBI_TWOS_U_BIT1 (twos, b); \
+ a >>= twos; \
+ }
+#define PROCESS_TWOS_EVEN PROCESS_TWOS_ANY
+#endif
+
+/* Use a simple loop. A disadvantage of this is that there's a branch on a
+ 50/50 chance of a 0 or 1 low bit. */
+#if JACOBI_BASE_METHOD == 2
+#define PROCESS_TWOS_EVEN \
+ { \
+ int two; \
+ two = JACOBI_TWO_U_BIT1 (b); \
+ do \
+ { \
+ a >>= 1; \
+ result_bit1 ^= two; \
+ ASSERT (a != 0); \
+ } \
+ while ((a & 1) == 0); \
+ }
+#define PROCESS_TWOS_ANY \
+ if ((a & 1) == 0) \
+ PROCESS_TWOS_EVEN;
+#endif
+
+/* Process one bit arithmetically, then a simple loop. This cuts the loop
+ condition down to a 25/75 chance, which should branch predict better.
+ The CPU will need a reasonable variable left shift. */
+#if JACOBI_BASE_METHOD == 3
+#define PROCESS_TWOS_EVEN \
+ { \
+ int two, mask, shift; \
+ \
+ two = JACOBI_TWO_U_BIT1 (b); \
+ mask = (~a & 2); \
+ a >>= 1; \
+ \
+ shift = (~a & 1); \
+ a >>= shift; \
+ result_bit1 ^= two ^ (two & mask); \
+ \
+ while ((a & 1) == 0) \
+ { \
+ a >>= 1; \
+ result_bit1 ^= two; \
+ ASSERT (a != 0); \
+ } \
+ }
+#define PROCESS_TWOS_ANY \
+ { \
+ int two, mask, shift; \
+ \
+ two = JACOBI_TWO_U_BIT1 (b); \
+ shift = (~a & 1); \
+ a >>= shift; \
+ \
+ mask = shift << 1; \
+ result_bit1 ^= (two & mask); \
+ \
+ while ((a & 1) == 0) \
+ { \
+ a >>= 1; \
+ result_bit1 ^= two; \
+ ASSERT (a != 0); \
+ } \
+ }
+#endif
+
+#if JACOBI_BASE_METHOD < 4
+/* Calculate the value of the Jacobi symbol (a/b) of two mp_limb_t's, but
+ with a restricted range of inputs accepted, namely b>1, b odd.
+
+ The initial result_bit1 is taken as a parameter for the convenience of
+ mpz_kronecker_ui() et al. The sign changes both here and in those
+ routines accumulate nicely in bit 1, see the JACOBI macros.
+
+ The return value here is the normal +1, 0, or -1. Note that +1 and -1
+ have bit 1 in the "BIT1" sense, which could be useful if the caller is
+ accumulating it into some extended calculation.
+
+ Duplicating the loop body to avoid the MP_LIMB_T_SWAP(a,b) would be
+ possible, but a couple of tests suggest it's not a significant speedup,
+ and may even be a slowdown, so what's here is good enough for now. */
+
+int
+mpn_jacobi_base (mp_limb_t a, mp_limb_t b, int result_bit1)
+{
+ ASSERT (b & 1); /* b odd */
+ ASSERT (b != 1);
+
+ if (a == 0)
+ return 0;
+
+ PROCESS_TWOS_ANY;
+ if (a == 1)
+ goto done;
+
+ if (a >= b)
+ goto a_gt_b;
+
+ for (;;)
+ {
+ result_bit1 ^= JACOBI_RECIP_UU_BIT1 (a, b);
+ MP_LIMB_T_SWAP (a, b);
+
+ a_gt_b:
+ do
+ {
+ /* working on (a/b), a,b odd, a>=b */
+ ASSERT (a & 1);
+ ASSERT (b & 1);
+ ASSERT (a >= b);
+
+ if ((a -= b) == 0)
+ return 0;
+
+ PROCESS_TWOS_EVEN;
+ if (a == 1)
+ goto done;
+ }
+ while (a >= b);
+ }
+
+ done:
+ return JACOBI_BIT1_TO_PN (result_bit1);
+}
+#endif
+
+#if JACOBI_BASE_METHOD == 4
+/* Computes (a/b) for odd b > 1 and any a. The initial bit is taken as a
+ * parameter. We have no need for the convention that the sign is in
+ * bit 1, internally we use bit 0. */
+
+/* FIXME: Could try table-based count_trailing_zeros. */
+int
+mpn_jacobi_base (mp_limb_t a, mp_limb_t b, int bit)
+{
+ int c;
+
+ ASSERT (b & 1);
+ ASSERT (b > 1);
+
+ if (a == 0)
+ /* This is the only line which depends on b > 1 */
+ return 0;
+
+ bit >>= 1;
+
+ /* Below, we represent a and b shifted right so that the least
+ significant one bit is implicit. */
+
+ b >>= 1;
+
+ count_trailing_zeros (c, a);
+ bit ^= c & (b ^ (b >> 1));
+
+ /* We may have c==GMP_LIMB_BITS-1, so we can't use a>>c+1. */
+ a >>= c;
+ a >>= 1;
+
+ do
+ {
+ mp_limb_t t = a - b;
+ mp_limb_t bgta = LIMB_HIGHBIT_TO_MASK (t);
+
+ if (t == 0)
+ return 0;
+
+ /* If b > a, invoke reciprocity */
+ bit ^= (bgta & a & b);
+
+ /* b <-- min (a, b) */
+ b += (bgta & t);
+
+ /* a <-- |a - b| */
+ a = (t ^ bgta) - bgta;
+
+ /* Number of trailing zeros is the same no matter if we look at
+ * t or a, but using t gives more parallelism. */
+ count_trailing_zeros (c, t);
+ c ++;
+ /* (2/b) = -1 if b = 3 or 5 mod 8 */
+ bit ^= c & (b ^ (b >> 1));
+ a >>= c;
+ }
+ while (b > 0);
+
+ return 1-2*(bit & 1);
+}
+#endif /* JACOBI_BASE_METHOD == 4 */
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/jacobi.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/jacobi.c
new file mode 100644
index 00000000000..bdc3ec67da1
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/jacobi.c
@@ -0,0 +1,295 @@
+/* jacobi.c
+
+ 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'LL CHANGE OR DISAPPEAR IN A FUTURE GNU MP RELEASE.
+
+Copyright 1996, 1998, 2000-2004, 2008, 2010, 2011 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.h"
+#include "gmp-impl.h"
+#include "longlong.h"
+
+#ifndef JACOBI_DC_THRESHOLD
+#define JACOBI_DC_THRESHOLD GCD_DC_THRESHOLD
+#endif
+
+/* Schönhage's rules:
+ *
+ * Assume r0 = r1 q1 + r2, with r0 odd, and r1 = q2 r2 + r3
+ *
+ * If r1 is odd, then
+ *
+ * (r1 | r0) = s(r1, r0) (r0 | r1) = s(r1, r0) (r2, r1)
+ *
+ * where s(x,y) = (-1)^{(x-1)(y-1)/4} = (-1)^[x = y = 3 (mod 4)].
+ *
+ * If r1 is even, r2 must be odd. We have
+ *
+ * (r1 | r0) = (r1 - r0 | r0) = (-1)^(r0-1)/2 (r0 - r1 | r0)
+ * = (-1)^(r0-1)/2 s(r0, r0 - r1) (r0 | r0 - r1)
+ * = (-1)^(r0-1)/2 s(r0, r0 - r1) (r1 | r0 - r1)
+ *
+ * Now, if r1 = 0 (mod 4), then the sign factor is +1, and repeating
+ * q1 times gives
+ *
+ * (r1 | r0) = (r1 | r2) = (r3 | r2)
+ *
+ * On the other hand, if r1 = 2 (mod 4), the sign factor is
+ * (-1)^{(r0-1)/2}, and repeating q1 times gives the exponent
+ *
+ * (r0-1)/2 + (r0-r1-1)/2 + ... + (r0 - (q1-1) r1)/2
+ * = q1 (r0-1)/2 + q1 (q1-1)/2
+ *
+ * and we can summarize the even case as
+ *
+ * (r1 | r0) = t(r1, r0, q1) (r3 | r2)
+ *
+ * where t(x,y,q) = (-1)^{[x = 2 (mod 4)] (q(y-1)/2 + y(q-1)/2)}
+ *
+ * What about termination? The remainder sequence ends with (0|1) = 1
+ * (or (0 | r) = 0 if r != 1). What are the possible cases? If r1 is
+ * odd, r2 may be zero. If r1 is even, then r2 = r0 - q1 r1 is odd and
+ * hence non-zero. We may have r3 = r1 - q2 r2 = 0.
+ *
+ * Examples: (11|15) = - (15|11) = - (4|11)
+ * (4|11) = (4| 3) = (1| 3)
+ * (1| 3) = (3|1) = (0|1) = 1
+ *
+ * (2|7) = (2|1) = (0|1) = 1
+ *
+ * Detail: (2|7) = (2-7|7) = (-1|7)(5|7) = -(7|5) = -(2|5)
+ * (2|5) = (2-5|5) = (-1|5)(3|5) = (5|3) = (2|3)
+ * (2|3) = (2-3|3) = (-1|3)(1|3) = -(3|1) = -(2|1)
+ *
+ */
+
+/* In principle, the state consists of four variables: e (one bit), a,
+ b (two bits each), d (one bit). Collected factors are (-1)^e. a and
+ b are the least significant bits of the current remainders. d
+ (denominator) is 0 if we're currently subtracting multiplies of a
+ from b, and 1 if we're subtracting b from a.
+
+ e is stored in the least significant bit, while a, b and d are
+ coded as only 13 distinct values in bits 1-4, according to the
+ following table. For rows not mentioning d, the value is either
+ implied, or it doesn't matter. */
+
+#if WANT_ASSERT
+static const struct
+{
+ unsigned char a;
+ unsigned char b;
+} decode_table[13] = {
+ /* 0 */ { 0, 1 },
+ /* 1 */ { 0, 3 },
+ /* 2 */ { 1, 1 },
+ /* 3 */ { 1, 3 },
+ /* 4 */ { 2, 1 },
+ /* 5 */ { 2, 3 },
+ /* 6 */ { 3, 1 },
+ /* 7 */ { 3, 3 }, /* d = 1 */
+ /* 8 */ { 1, 0 },
+ /* 9 */ { 1, 2 },
+ /* 10 */ { 3, 0 },
+ /* 11 */ { 3, 2 },
+ /* 12 */ { 3, 3 }, /* d = 0 */
+};
+#define JACOBI_A(bits) (decode_table[(bits)>>1].a)
+#define JACOBI_B(bits) (decode_table[(bits)>>1].b)
+#endif /* WANT_ASSERT */
+
+const unsigned char jacobi_table[208] = {
+#include "jacobitab.h"
+};
+
+#define BITS_FAIL 31
+
+static void
+jacobi_hook (void *p, mp_srcptr gp, mp_size_t gn,
+ mp_srcptr qp, mp_size_t qn, int d)
+{
+ unsigned *bitsp = (unsigned *) p;
+
+ if (gp)
+ {
+ ASSERT (gn > 0);
+ if (gn != 1 || gp[0] != 1)
+ {
+ *bitsp = BITS_FAIL;
+ return;
+ }
+ }
+
+ if (qp)
+ {
+ ASSERT (qn > 0);
+ ASSERT (d >= 0);
+ *bitsp = mpn_jacobi_update (*bitsp, d, qp[0] & 3);
+ }
+}
+
+#define CHOOSE_P(n) (2*(n) / 3)
+
+int
+mpn_jacobi_n (mp_ptr ap, mp_ptr bp, mp_size_t n, unsigned bits)
+{
+ mp_size_t scratch;
+ mp_size_t matrix_scratch;
+ mp_ptr tp;
+
+ TMP_DECL;
+
+ ASSERT (n > 0);
+ ASSERT ( (ap[n-1] | bp[n-1]) > 0);
+ ASSERT ( (bp[0] | ap[0]) & 1);
+
+ /* FIXME: Check for small sizes first, before setting up temporary
+ storage etc. */
+ scratch = MPN_GCD_SUBDIV_STEP_ITCH(n);
+
+ if (ABOVE_THRESHOLD (n, GCD_DC_THRESHOLD))
+ {
+ mp_size_t hgcd_scratch;
+ mp_size_t update_scratch;
+ mp_size_t p = CHOOSE_P (n);
+ mp_size_t dc_scratch;
+
+ matrix_scratch = MPN_HGCD_MATRIX_INIT_ITCH (n - p);
+ hgcd_scratch = mpn_hgcd_itch (n - p);
+ update_scratch = p + n - 1;
+
+ dc_scratch = matrix_scratch + MAX(hgcd_scratch, update_scratch);
+ if (dc_scratch > scratch)
+ scratch = dc_scratch;
+ }
+
+ TMP_MARK;
+ tp = TMP_ALLOC_LIMBS(scratch);
+
+ while (ABOVE_THRESHOLD (n, JACOBI_DC_THRESHOLD))
+ {
+ struct hgcd_matrix M;
+ mp_size_t p = 2*n/3;
+ mp_size_t matrix_scratch = MPN_HGCD_MATRIX_INIT_ITCH (n - p);
+ mp_size_t nn;
+ mpn_hgcd_matrix_init (&M, n - p, tp);
+
+ nn = mpn_hgcd_jacobi (ap + p, bp + p, n - p, &M, &bits,
+ tp + matrix_scratch);
+ if (nn > 0)
+ {
+ ASSERT (M.n <= (n - p - 1)/2);
+ ASSERT (M.n + p <= (p + n - 1) / 2);
+ /* Temporary storage 2 (p + M->n) <= p + n - 1. */
+ n = mpn_hgcd_matrix_adjust (&M, p + nn, ap, bp, p, tp + matrix_scratch);
+ }
+ else
+ {
+ /* Temporary storage n */
+ n = mpn_gcd_subdiv_step (ap, bp, n, 0, jacobi_hook, &bits, tp);
+ if (!n)
+ {
+ TMP_FREE;
+ return bits == BITS_FAIL ? 0 : mpn_jacobi_finish (bits);
+ }
+ }
+ }
+
+ while (n > 2)
+ {
+ struct hgcd_matrix1 M;
+ mp_limb_t ah, al, bh, bl;
+ mp_limb_t mask;
+
+ mask = ap[n-1] | bp[n-1];
+ ASSERT (mask > 0);
+
+ if (mask & GMP_NUMB_HIGHBIT)
+ {
+ ah = ap[n-1]; al = ap[n-2];
+ bh = bp[n-1]; bl = bp[n-2];
+ }
+ else
+ {
+ int shift;
+
+ count_leading_zeros (shift, mask);
+ ah = MPN_EXTRACT_NUMB (shift, ap[n-1], ap[n-2]);
+ al = MPN_EXTRACT_NUMB (shift, ap[n-2], ap[n-3]);
+ bh = MPN_EXTRACT_NUMB (shift, bp[n-1], bp[n-2]);
+ bl = MPN_EXTRACT_NUMB (shift, bp[n-2], bp[n-3]);
+ }
+
+ /* Try an mpn_nhgcd2 step */
+ if (mpn_hgcd2_jacobi (ah, al, bh, bl, &M, &bits))
+ {
+ n = mpn_matrix22_mul1_inverse_vector (&M, tp, ap, bp, n);
+ MP_PTR_SWAP (ap, tp);
+ }
+ else
+ {
+ /* mpn_hgcd2 has failed. Then either one of a or b is very
+ small, or the difference is very small. Perform one
+ subtraction followed by one division. */
+ n = mpn_gcd_subdiv_step (ap, bp, n, 0, &jacobi_hook, &bits, tp);
+ if (!n)
+ {
+ TMP_FREE;
+ return bits == BITS_FAIL ? 0 : mpn_jacobi_finish (bits);
+ }
+ }
+ }
+
+ if (bits >= 16)
+ MP_PTR_SWAP (ap, bp);
+
+ ASSERT (bp[0] & 1);
+
+ if (n == 1)
+ {
+ mp_limb_t al, bl;
+ al = ap[0];
+ bl = bp[0];
+
+ TMP_FREE;
+ if (bl == 1)
+ return 1 - 2*(bits & 1);
+ else
+ return mpn_jacobi_base (al, bl, bits << 1);
+ }
+
+ else
+ {
+ int res = mpn_jacobi_2 (ap, bp, bits & 1);
+ TMP_FREE;
+ return res;
+ }
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/jacobi_2.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/jacobi_2.c
new file mode 100644
index 00000000000..9f480f7834a
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/jacobi_2.c
@@ -0,0 +1,352 @@
+/* jacobi_2.c
+
+ 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'LL CHANGE OR DISAPPEAR IN A FUTURE GNU MP RELEASE.
+
+Copyright 1996, 1998, 2000-2004, 2008, 2010 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.h"
+#include "gmp-impl.h"
+#include "longlong.h"
+
+#ifndef JACOBI_2_METHOD
+#define JACOBI_2_METHOD 2
+#endif
+
+/* Computes (a / b) where b is odd, and a and b are otherwise arbitrary
+ two-limb numbers. */
+#if JACOBI_2_METHOD == 1
+int
+mpn_jacobi_2 (mp_srcptr ap, mp_srcptr bp, unsigned bit)
+{
+ mp_limb_t ah, al, bh, bl;
+ int c;
+
+ al = ap[0];
+ ah = ap[1];
+ bl = bp[0];
+ bh = bp[1];
+
+ ASSERT (bl & 1);
+
+ bl = ((bh << (GMP_NUMB_BITS - 1)) & GMP_NUMB_MASK) | (bl >> 1);
+ bh >>= 1;
+
+ if ( (bh | bl) == 0)
+ return 1 - 2*(bit & 1);
+
+ if ( (ah | al) == 0)
+ return 0;
+
+ if (al == 0)
+ {
+ al = ah;
+ ah = 0;
+ bit ^= GMP_NUMB_BITS & (bl ^ (bl >> 1));
+ }
+ count_trailing_zeros (c, al);
+ bit ^= c & (bl ^ (bl >> 1));
+
+ c++;
+ if (UNLIKELY (c == GMP_NUMB_BITS))
+ {
+ al = ah;
+ ah = 0;
+ }
+ else
+ {
+ al = ((ah << (GMP_NUMB_BITS - c)) & GMP_NUMB_MASK) | (al >> c);
+ ah >>= c;
+ }
+ while ( (ah | bh) > 0)
+ {
+ mp_limb_t th, tl;
+ mp_limb_t bgta;
+
+ sub_ddmmss (th, tl, ah, al, bh, bl);
+ if ( (tl | th) == 0)
+ return 0;
+
+ bgta = LIMB_HIGHBIT_TO_MASK (th);
+
+ /* If b > a, invoke reciprocity */
+ bit ^= (bgta & al & bl);
+
+ /* b <-- min (a, b) */
+ add_ssaaaa (bh, bl, bh, bl, th & bgta, tl & bgta);
+
+ if ( (bh | bl) == 0)
+ return 1 - 2*(bit & 1);
+
+ /* a <-- |a - b| */
+ al = (bgta ^ tl) - bgta;
+ ah = (bgta ^ th);
+
+ if (UNLIKELY (al == 0))
+ {
+ /* If b > a, al == 0 implies that we have a carry to
+ propagate. */
+ al = ah - bgta;
+ ah = 0;
+ bit ^= GMP_NUMB_BITS & (bl ^ (bl >> 1));
+ }
+ count_trailing_zeros (c, al);
+ c++;
+ bit ^= c & (bl ^ (bl >> 1));
+
+ if (UNLIKELY (c == GMP_NUMB_BITS))
+ {
+ al = ah;
+ ah = 0;
+ }
+ else
+ {
+ al = ((ah << (GMP_NUMB_BITS - c)) & GMP_NUMB_MASK) | (al >> c);
+ ah >>= c;
+ }
+ }
+
+ ASSERT (bl > 0);
+
+ while ( (al | bl) & GMP_LIMB_HIGHBIT)
+ {
+ /* Need an extra comparison to get the mask. */
+ mp_limb_t t = al - bl;
+ mp_limb_t bgta = - (bl > al);
+
+ if (t == 0)
+ return 0;
+
+ /* If b > a, invoke reciprocity */
+ bit ^= (bgta & al & bl);
+
+ /* b <-- min (a, b) */
+ bl += (bgta & t);
+
+ /* a <-- |a - b| */
+ al = (t ^ bgta) - bgta;
+
+ /* Number of trailing zeros is the same no matter if we look at
+ * t or a, but using t gives more parallelism. */
+ count_trailing_zeros (c, t);
+ c ++;
+ /* (2/b) = -1 if b = 3 or 5 mod 8 */
+ bit ^= c & (bl ^ (bl >> 1));
+
+ if (UNLIKELY (c == GMP_NUMB_BITS))
+ return 1 - 2*(bit & 1);
+
+ al >>= c;
+ }
+
+ /* Here we have a little impedance mismatch. Better to inline it? */
+ return mpn_jacobi_base (2*al+1, 2*bl+1, bit << 1);
+}
+#elif JACOBI_2_METHOD == 2
+int
+mpn_jacobi_2 (mp_srcptr ap, mp_srcptr bp, unsigned bit)
+{
+ mp_limb_t ah, al, bh, bl;
+ int c;
+
+ al = ap[0];
+ ah = ap[1];
+ bl = bp[0];
+ bh = bp[1];
+
+ ASSERT (bl & 1);
+
+ /* Use bit 1. */
+ bit <<= 1;
+
+ if (bh == 0 && bl == 1)
+ /* (a|1) = 1 */
+ return 1 - (bit & 2);
+
+ if (al == 0)
+ {
+ if (ah == 0)
+ /* (0|b) = 0, b > 1 */
+ return 0;
+
+ count_trailing_zeros (c, ah);
+ bit ^= ((GMP_NUMB_BITS + c) << 1) & (bl ^ (bl >> 1));
+
+ al = bl;
+ bl = ah >> c;
+
+ if (bl == 1)
+ /* (1|b) = 1 */
+ return 1 - (bit & 2);
+
+ ah = bh;
+
+ bit ^= al & bl;
+
+ goto b_reduced;
+ }
+ if ( (al & 1) == 0)
+ {
+ count_trailing_zeros (c, al);
+
+ al = ((ah << (GMP_NUMB_BITS - c)) & GMP_NUMB_MASK) | (al >> c);
+ ah >>= c;
+ bit ^= (c << 1) & (bl ^ (bl >> 1));
+ }
+ if (ah == 0)
+ {
+ if (bh > 0)
+ {
+ bit ^= al & bl;
+ MP_LIMB_T_SWAP (al, bl);
+ ah = bh;
+ goto b_reduced;
+ }
+ goto ab_reduced;
+ }
+
+ while (bh > 0)
+ {
+ /* Compute (a|b) */
+ while (ah > bh)
+ {
+ sub_ddmmss (ah, al, ah, al, bh, bl);
+ if (al == 0)
+ {
+ count_trailing_zeros (c, ah);
+ bit ^= ((GMP_NUMB_BITS + c) << 1) & (bl ^ (bl >> 1));
+
+ al = bl;
+ bl = ah >> c;
+ ah = bh;
+
+ bit ^= al & bl;
+ goto b_reduced;
+ }
+ count_trailing_zeros (c, al);
+ bit ^= (c << 1) & (bl ^ (bl >> 1));
+ al = ((ah << (GMP_NUMB_BITS - c)) & GMP_NUMB_MASK) | (al >> c);
+ ah >>= c;
+ }
+ if (ah == bh)
+ goto cancel_hi;
+
+ if (ah == 0)
+ {
+ bit ^= al & bl;
+ MP_LIMB_T_SWAP (al, bl);
+ ah = bh;
+ break;
+ }
+
+ bit ^= al & bl;
+
+ /* Compute (b|a) */
+ while (bh > ah)
+ {
+ sub_ddmmss (bh, bl, bh, bl, ah, al);
+ if (bl == 0)
+ {
+ count_trailing_zeros (c, bh);
+ bit ^= ((GMP_NUMB_BITS + c) << 1) & (al ^ (al >> 1));
+
+ bl = bh >> c;
+ bit ^= al & bl;
+ goto b_reduced;
+ }
+ count_trailing_zeros (c, bl);
+ bit ^= (c << 1) & (al ^ (al >> 1));
+ bl = ((bh << (GMP_NUMB_BITS - c)) & GMP_NUMB_MASK) | (bl >> c);
+ bh >>= c;
+ }
+ bit ^= al & bl;
+
+ /* Compute (a|b) */
+ if (ah == bh)
+ {
+ cancel_hi:
+ if (al < bl)
+ {
+ MP_LIMB_T_SWAP (al, bl);
+ bit ^= al & bl;
+ }
+ al -= bl;
+ if (al == 0)
+ return 0;
+
+ count_trailing_zeros (c, al);
+ bit ^= (c << 1) & (bl ^ (bl >> 1));
+ al >>= c;
+
+ if (al == 1)
+ return 1 - (bit & 2);
+
+ MP_LIMB_T_SWAP (al, bl);
+ bit ^= al & bl;
+ break;
+ }
+ }
+
+ b_reduced:
+ /* Compute (a|b), with b a single limb. */
+ ASSERT (bl & 1);
+
+ if (bl == 1)
+ /* (a|1) = 1 */
+ return 1 - (bit & 2);
+
+ while (ah > 0)
+ {
+ ah -= (al < bl);
+ al -= bl;
+ if (al == 0)
+ {
+ if (ah == 0)
+ return 0;
+ count_trailing_zeros (c, ah);
+ bit ^= ((GMP_NUMB_BITS + c) << 1) & (bl ^ (bl >> 1));
+ al = ah >> c;
+ goto ab_reduced;
+ }
+ count_trailing_zeros (c, al);
+
+ al = ((ah << (GMP_NUMB_BITS - c)) & GMP_NUMB_MASK) | (al >> c);
+ ah >>= c;
+ bit ^= (c << 1) & (bl ^ (bl >> 1));
+ }
+ ab_reduced:
+ ASSERT (bl & 1);
+ ASSERT (bl > 1);
+
+ return mpn_jacobi_base (al, bl, bit);
+}
+#else
+#error Unsupported value for JACOBI_2_METHOD
+#endif
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/logops_n.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/logops_n.c
new file mode 100644
index 00000000000..1b534ff4ba5
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/logops_n.c
@@ -0,0 +1,78 @@
+/* mpn_and_n, mpn_ior_n, etc -- mpn logical operations.
+
+Copyright 2009 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.h"
+#include "gmp-impl.h"
+
+#ifdef OPERATION_and_n
+#define func __MPN(and_n)
+#define call mpn_and_n
+#endif
+
+#ifdef OPERATION_andn_n
+#define func __MPN(andn_n)
+#define call mpn_andn_n
+#endif
+
+#ifdef OPERATION_nand_n
+#define func __MPN(nand_n)
+#define call mpn_nand_n
+#endif
+
+#ifdef OPERATION_ior_n
+#define func __MPN(ior_n)
+#define call mpn_ior_n
+#endif
+
+#ifdef OPERATION_iorn_n
+#define func __MPN(iorn_n)
+#define call mpn_iorn_n
+#endif
+
+#ifdef OPERATION_nior_n
+#define func __MPN(nior_n)
+#define call mpn_nior_n
+#endif
+
+#ifdef OPERATION_xor_n
+#define func __MPN(xor_n)
+#define call mpn_xor_n
+#endif
+
+#ifdef OPERATION_xnor_n
+#define func __MPN(xnor_n)
+#define call mpn_xnor_n
+#endif
+
+void
+func (mp_ptr rp, mp_srcptr up, mp_srcptr vp, mp_size_t n)
+{
+ call (rp, up, vp, n);
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/lshift.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/lshift.c
new file mode 100644
index 00000000000..5182632976c
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/lshift.c
@@ -0,0 +1,73 @@
+/* mpn_lshift -- Shift left low level.
+
+Copyright 1991, 1993, 1994, 1996, 2000-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/. */
+
+#include "gmp.h"
+#include "gmp-impl.h"
+
+/* Shift U (pointed to by up and n limbs long) cnt bits to the left
+ and store the n least significant limbs of the result at rp.
+ Return the bits shifted out from the most significant limb.
+
+ Argument constraints:
+ 1. 0 < cnt < GMP_NUMB_BITS.
+ 2. If the result is to be written over the input, rp must be >= up.
+*/
+
+mp_limb_t
+mpn_lshift (mp_ptr rp, mp_srcptr up, mp_size_t n, unsigned int cnt)
+{
+ mp_limb_t high_limb, low_limb;
+ unsigned int tnc;
+ mp_size_t i;
+ mp_limb_t retval;
+
+ ASSERT (n >= 1);
+ ASSERT (cnt >= 1);
+ ASSERT (cnt < GMP_NUMB_BITS);
+ ASSERT (MPN_SAME_OR_DECR_P (rp, up, n));
+
+ up += n;
+ rp += n;
+
+ tnc = GMP_NUMB_BITS - cnt;
+ low_limb = *--up;
+ retval = low_limb >> tnc;
+ high_limb = (low_limb << cnt) & GMP_NUMB_MASK;
+
+ for (i = n - 1; i != 0; i--)
+ {
+ low_limb = *--up;
+ *--rp = high_limb | (low_limb >> tnc);
+ high_limb = (low_limb << cnt) & GMP_NUMB_MASK;
+ }
+ *--rp = high_limb;
+
+ return retval;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/lshiftc.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/lshiftc.c
new file mode 100644
index 00000000000..e8051b7b931
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/lshiftc.c
@@ -0,0 +1,74 @@
+/* mpn_lshiftc -- Shift left low level with complement.
+
+Copyright 1991, 1993, 1994, 1996, 2000-2002, 2009 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.h"
+#include "gmp-impl.h"
+
+/* Shift U (pointed to by up and n limbs long) cnt bits to the left
+ and store the n least significant limbs of the result at rp.
+ Return the bits shifted out from the most significant limb.
+
+ Argument constraints:
+ 1. 0 < cnt < GMP_NUMB_BITS.
+ 2. If the result is to be written over the input, rp must be >= up.
+*/
+
+mp_limb_t
+mpn_lshiftc (mp_ptr rp, mp_srcptr up, mp_size_t n, unsigned int cnt)
+{
+ mp_limb_t high_limb, low_limb;
+ unsigned int tnc;
+ mp_size_t i;
+ mp_limb_t retval;
+
+ ASSERT (n >= 1);
+ ASSERT (cnt >= 1);
+ ASSERT (cnt < GMP_NUMB_BITS);
+ ASSERT (MPN_SAME_OR_DECR_P (rp, up, n));
+
+ up += n;
+ rp += n;
+
+ tnc = GMP_NUMB_BITS - cnt;
+ low_limb = *--up;
+ retval = low_limb >> tnc;
+ high_limb = (low_limb << cnt);
+
+ for (i = n - 1; i != 0; i--)
+ {
+ low_limb = *--up;
+ *--rp = (~(high_limb | (low_limb >> tnc))) & GMP_NUMB_MASK;
+ high_limb = low_limb << cnt;
+ }
+ *--rp = (~high_limb) & GMP_NUMB_MASK;
+
+ return retval;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/matrix22_mul.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/matrix22_mul.c
new file mode 100644
index 00000000000..59531eb1b26
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/matrix22_mul.c
@@ -0,0 +1,322 @@
+/* matrix22_mul.c.
+
+ Contributed by Niels Möller and Marco Bodrato.
+
+ 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'LL CHANGE OR DISAPPEAR IN A FUTURE GNU MP RELEASE.
+
+Copyright 2003-2005, 2008, 2009 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.h"
+#include "gmp-impl.h"
+#include "longlong.h"
+
+#define MUL(rp, ap, an, bp, bn) do { \
+ if (an >= bn) \
+ mpn_mul (rp, ap, an, bp, bn); \
+ else \
+ mpn_mul (rp, bp, bn, ap, an); \
+} while (0)
+
+/* Inputs are unsigned. */
+static int
+abs_sub_n (mp_ptr rp, mp_srcptr ap, mp_srcptr bp, mp_size_t n)
+{
+ int c;
+ MPN_CMP (c, ap, bp, n);
+ if (c >= 0)
+ {
+ mpn_sub_n (rp, ap, bp, n);
+ return 0;
+ }
+ else
+ {
+ mpn_sub_n (rp, bp, ap, n);
+ return 1;
+ }
+}
+
+static int
+add_signed_n (mp_ptr rp,
+ mp_srcptr ap, int as, mp_srcptr bp, int bs, mp_size_t n)
+{
+ if (as != bs)
+ return as ^ abs_sub_n (rp, ap, bp, n);
+ else
+ {
+ ASSERT_NOCARRY (mpn_add_n (rp, ap, bp, n));
+ return as;
+ }
+}
+
+mp_size_t
+mpn_matrix22_mul_itch (mp_size_t rn, mp_size_t mn)
+{
+ if (BELOW_THRESHOLD (rn, MATRIX22_STRASSEN_THRESHOLD)
+ || BELOW_THRESHOLD (mn, MATRIX22_STRASSEN_THRESHOLD))
+ return 3*rn + 2*mn;
+ else
+ return 3*(rn + mn) + 5;
+}
+
+/* Algorithm:
+
+ / s0 \ / 1 0 0 0 \ / r0 \
+ | s1 | | 0 1 0 1 | | r1 |
+ | s2 | | 0 0 -1 1 | | r2 |
+ | s3 | = | 0 1 -1 1 | \ r3 /
+ | s4 | | -1 1 -1 1 |
+ | s5 | | 0 1 0 0 |
+ \ s6 / \ 0 0 1 0 /
+
+ / t0 \ / 1 0 0 0 \ / m0 \
+ | t1 | | 0 1 0 1 | | m1 |
+ | t2 | | 0 0 -1 1 | | m2 |
+ | t3 | = | 0 1 -1 1 | \ m3 /
+ | t4 | | -1 1 -1 1 |
+ | t5 | | 0 1 0 0 |
+ \ t6 / \ 0 0 1 0 /
+
+ Note: the two matrices above are the same, but s_i and t_i are used
+ in the same product, only for i<4, see "A Strassen-like Matrix
+ Multiplication suited for squaring and higher power computation" by
+ M. Bodrato, in Proceedings of ISSAC 2010.
+
+ / r0 \ / 1 0 0 0 0 1 0 \ / s0*t0 \
+ | r1 | = | 0 0 -1 1 -1 1 0 | | s1*t1 |
+ | r2 | | 0 1 0 -1 0 -1 -1 | | s2*t2 |
+ \ r3 / \ 0 1 1 -1 0 -1 0 / | s3*t3 |
+ | s4*t5 |
+ | s5*t6 |
+ \ s6*t4 /
+
+ The scheduling uses two temporaries U0 and U1 to store products, and
+ two, S0 and T0, to store combinations of entries of the two
+ operands.
+*/
+
+/* Computes R = R * M. Elements are numbers R = (r0, r1; r2, r3).
+ *
+ * Resulting elements are of size up to rn + mn + 1.
+ *
+ * Temporary storage: 3 rn + 3 mn + 5. */
+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)
+{
+ mp_ptr s0, t0, u0, u1;
+ int r1s, r3s, s0s, t0s, u1s;
+ s0 = tp; tp += rn + 1;
+ t0 = tp; tp += mn + 1;
+ u0 = tp; tp += rn + mn + 1;
+ u1 = tp; /* rn + mn + 2 */
+
+ MUL (u0, r1, rn, m2, mn); /* u5 = s5 * t6 */
+ r3s = abs_sub_n (r3, r3, r2, rn); /* r3 - r2 */
+ if (r3s)
+ {
+ r1s = abs_sub_n (r1, r1, r3, rn);
+ r1[rn] = 0;
+ }
+ else
+ {
+ r1[rn] = mpn_add_n (r1, r1, r3, rn);
+ r1s = 0; /* r1 - r2 + r3 */
+ }
+ if (r1s)
+ {
+ s0[rn] = mpn_add_n (s0, r1, r0, rn);
+ s0s = 0;
+ }
+ else if (r1[rn] != 0)
+ {
+ s0[rn] = r1[rn] - mpn_sub_n (s0, r1, r0, rn);
+ s0s = 1; /* s4 = -r0 + r1 - r2 + r3 */
+ /* Reverse sign! */
+ }
+ else
+ {
+ s0s = abs_sub_n (s0, r0, r1, rn);
+ s0[rn] = 0;
+ }
+ MUL (u1, r0, rn, m0, mn); /* u0 = s0 * t0 */
+ r0[rn+mn] = mpn_add_n (r0, u0, u1, rn + mn);
+ ASSERT (r0[rn+mn] < 2); /* u0 + u5 */
+
+ t0s = abs_sub_n (t0, m3, m2, mn);
+ u1s = r3s^t0s^1; /* Reverse sign! */
+ MUL (u1, r3, rn, t0, mn); /* u2 = s2 * t2 */
+ u1[rn+mn] = 0;
+ if (t0s)
+ {
+ t0s = abs_sub_n (t0, m1, t0, mn);
+ t0[mn] = 0;
+ }
+ else
+ {
+ t0[mn] = mpn_add_n (t0, t0, m1, mn);
+ }
+
+ /* FIXME: Could be simplified if we had space for rn + mn + 2 limbs
+ at r3. I'd expect that for matrices of random size, the high
+ words t0[mn] and r1[rn] are non-zero with a pretty small
+ probability. If that can be confirmed this should be done as an
+ unconditional rn x (mn+1) followed by an if (UNLIKELY (r1[rn]))
+ add_n. */
+ if (t0[mn] != 0)
+ {
+ MUL (r3, r1, rn, t0, mn + 1); /* u3 = s3 * t3 */
+ ASSERT (r1[rn] < 2);
+ if (r1[rn] != 0)
+ mpn_add_n (r3 + rn, r3 + rn, t0, mn + 1);
+ }
+ else
+ {
+ MUL (r3, r1, rn + 1, t0, mn);
+ }
+
+ ASSERT (r3[rn+mn] < 4);
+
+ u0[rn+mn] = 0;
+ if (r1s^t0s)
+ {
+ r3s = abs_sub_n (r3, u0, r3, rn + mn + 1);
+ }
+ else
+ {
+ ASSERT_NOCARRY (mpn_add_n (r3, r3, u0, rn + mn + 1));
+ r3s = 0; /* u3 + u5 */
+ }
+
+ if (t0s)
+ {
+ t0[mn] = mpn_add_n (t0, t0, m0, mn);
+ }
+ else if (t0[mn] != 0)
+ {
+ t0[mn] -= mpn_sub_n (t0, t0, m0, mn);
+ }
+ else
+ {
+ t0s = abs_sub_n (t0, t0, m0, mn);
+ }
+ MUL (u0, r2, rn, t0, mn + 1); /* u6 = s6 * t4 */
+ ASSERT (u0[rn+mn] < 2);
+ if (r1s)
+ {
+ ASSERT_NOCARRY (mpn_sub_n (r1, r2, r1, rn));
+ }
+ else
+ {
+ r1[rn] += mpn_add_n (r1, r1, r2, rn);
+ }
+ rn++;
+ t0s = add_signed_n (r2, r3, r3s, u0, t0s, rn + mn);
+ /* u3 + u5 + u6 */
+ ASSERT (r2[rn+mn-1] < 4);
+ r3s = add_signed_n (r3, r3, r3s, u1, u1s, rn + mn);
+ /* -u2 + u3 + u5 */
+ ASSERT (r3[rn+mn-1] < 3);
+ MUL (u0, s0, rn, m1, mn); /* u4 = s4 * t5 */
+ ASSERT (u0[rn+mn-1] < 2);
+ t0[mn] = mpn_add_n (t0, m3, m1, mn);
+ MUL (u1, r1, rn, t0, mn + 1); /* u1 = s1 * t1 */
+ mn += rn;
+ ASSERT (u1[mn-1] < 4);
+ ASSERT (u1[mn] == 0);
+ ASSERT_NOCARRY (add_signed_n (r1, r3, r3s, u0, s0s, mn));
+ /* -u2 + u3 - u4 + u5 */
+ ASSERT (r1[mn-1] < 2);
+ if (r3s)
+ {
+ ASSERT_NOCARRY (mpn_add_n (r3, u1, r3, mn));
+ }
+ else
+ {
+ ASSERT_NOCARRY (mpn_sub_n (r3, u1, r3, mn));
+ /* u1 + u2 - u3 - u5 */
+ }
+ ASSERT (r3[mn-1] < 2);
+ if (t0s)
+ {
+ ASSERT_NOCARRY (mpn_add_n (r2, u1, r2, mn));
+ }
+ else
+ {
+ ASSERT_NOCARRY (mpn_sub_n (r2, u1, r2, mn));
+ /* u1 - u3 - u5 - u6 */
+ }
+ ASSERT (r2[mn-1] < 2);
+}
+
+void
+mpn_matrix22_mul (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)
+{
+ if (BELOW_THRESHOLD (rn, MATRIX22_STRASSEN_THRESHOLD)
+ || BELOW_THRESHOLD (mn, MATRIX22_STRASSEN_THRESHOLD))
+ {
+ mp_ptr p0, p1;
+ unsigned i;
+
+ /* Temporary storage: 3 rn + 2 mn */
+ p0 = tp + rn;
+ p1 = p0 + rn + mn;
+
+ for (i = 0; i < 2; i++)
+ {
+ MPN_COPY (tp, r0, rn);
+
+ if (rn >= mn)
+ {
+ mpn_mul (p0, r0, rn, m0, mn);
+ mpn_mul (p1, r1, rn, m3, mn);
+ mpn_mul (r0, r1, rn, m2, mn);
+ mpn_mul (r1, tp, rn, m1, mn);
+ }
+ else
+ {
+ mpn_mul (p0, m0, mn, r0, rn);
+ mpn_mul (p1, m3, mn, r1, rn);
+ mpn_mul (r0, m2, mn, r1, rn);
+ mpn_mul (r1, m1, mn, tp, rn);
+ }
+ r0[rn+mn] = mpn_add_n (r0, r0, p0, rn + mn);
+ r1[rn+mn] = mpn_add_n (r1, r1, p1, rn + mn);
+
+ r0 = r2; r1 = r3;
+ }
+ }
+ else
+ mpn_matrix22_mul_strassen (r0, r1, r2, r3, rn,
+ m0, m1, m2, m3, mn, tp);
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/matrix22_mul1_inverse_vector.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/matrix22_mul1_inverse_vector.c
new file mode 100644
index 00000000000..83b2fb51343
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/matrix22_mul1_inverse_vector.c
@@ -0,0 +1,65 @@
+/* matrix22_mul1_inverse_vector.c
+
+ 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'LL CHANGE OR DISAPPEAR IN A FUTURE GNU MP RELEASE.
+
+Copyright 2008, 2010 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.h"
+#include "gmp-impl.h"
+#include "longlong.h"
+
+/* Sets (r;b) = M^{-1}(a;b), with M^{-1} = (u11, -u01; -u10, u00) from
+ the left. Uses three buffers, to avoid a copy. */
+mp_size_t
+mpn_matrix22_mul1_inverse_vector (const struct hgcd_matrix1 *M,
+ mp_ptr rp, mp_srcptr ap, mp_ptr bp, mp_size_t n)
+{
+ mp_limb_t h0, h1;
+
+ /* Compute (r;b) <-- (u11 a - u01 b; -u10 a + u00 b) as
+
+ r = u11 * a
+ r -= u01 * b
+ b *= u00
+ b -= u10 * a
+ */
+
+ h0 = mpn_mul_1 (rp, ap, n, M->u[1][1]);
+ h1 = mpn_submul_1 (rp, bp, n, M->u[0][1]);
+ ASSERT (h0 == h1);
+
+ h0 = mpn_mul_1 (bp, bp, n, M->u[0][0]);
+ h1 = mpn_submul_1 (bp, ap, n, M->u[1][0]);
+ ASSERT (h0 == h1);
+
+ n -= (rp[n-1] | bp[n-1]) == 0;
+ return n;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/mod_1.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/mod_1.c
new file mode 100644
index 00000000000..0212020201f
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/mod_1.c
@@ -0,0 +1,281 @@
+/* mpn_mod_1(dividend_ptr, dividend_size, divisor_limb) --
+ Divide (DIVIDEND_PTR,,DIVIDEND_SIZE) by DIVISOR_LIMB.
+ Return the single-limb remainder.
+ There are no constraints on the value of the divisor.
+
+Copyright 1991, 1993, 1994, 1999, 2000, 2002, 2007-2009, 2012 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.h"
+#include "gmp-impl.h"
+#include "longlong.h"
+
+
+/* The size where udiv_qrnnd_preinv should be used rather than udiv_qrnnd,
+ meaning the quotient size where that should happen, the quotient size
+ being how many udiv divisions will be done.
+
+ The default is to use preinv always, CPUs where this doesn't suit have
+ tuned thresholds. Note in particular that preinv should certainly be
+ used if that's the only division available (USE_PREINV_ALWAYS). */
+
+#ifndef MOD_1_NORM_THRESHOLD
+#define MOD_1_NORM_THRESHOLD 0
+#endif
+
+#ifndef MOD_1_UNNORM_THRESHOLD
+#define MOD_1_UNNORM_THRESHOLD 0
+#endif
+
+#ifndef MOD_1U_TO_MOD_1_1_THRESHOLD
+#define MOD_1U_TO_MOD_1_1_THRESHOLD MP_SIZE_T_MAX /* default is not to use mpn_mod_1s */
+#endif
+
+#ifndef MOD_1N_TO_MOD_1_1_THRESHOLD
+#define MOD_1N_TO_MOD_1_1_THRESHOLD MP_SIZE_T_MAX /* default is not to use mpn_mod_1s */
+#endif
+
+#ifndef MOD_1_1_TO_MOD_1_2_THRESHOLD
+#define MOD_1_1_TO_MOD_1_2_THRESHOLD 10
+#endif
+
+#ifndef MOD_1_2_TO_MOD_1_4_THRESHOLD
+#define MOD_1_2_TO_MOD_1_4_THRESHOLD 20
+#endif
+
+#if TUNE_PROGRAM_BUILD && !HAVE_NATIVE_mpn_mod_1_1p
+/* Duplicates declarations in tune/speed.h */
+mp_limb_t mpn_mod_1_1p_1 (mp_srcptr, mp_size_t, mp_limb_t, mp_limb_t [4]);
+mp_limb_t mpn_mod_1_1p_2 (mp_srcptr, mp_size_t, mp_limb_t, mp_limb_t [4]);
+
+void mpn_mod_1_1p_cps_1 (mp_limb_t [4], mp_limb_t);
+void mpn_mod_1_1p_cps_2 (mp_limb_t [4], mp_limb_t);
+
+#undef mpn_mod_1_1p
+#define mpn_mod_1_1p(ap, n, b, pre) \
+ (mod_1_1p_method == 1 ? mpn_mod_1_1p_1 (ap, n, b, pre) \
+ : (mod_1_1p_method == 2 ? mpn_mod_1_1p_2 (ap, n, b, pre) \
+ : __gmpn_mod_1_1p (ap, n, b, pre)))
+
+#undef mpn_mod_1_1p_cps
+#define mpn_mod_1_1p_cps(pre, b) \
+ (mod_1_1p_method == 1 ? mpn_mod_1_1p_cps_1 (pre, b) \
+ : (mod_1_1p_method == 2 ? mpn_mod_1_1p_cps_2 (pre, b) \
+ : __gmpn_mod_1_1p_cps (pre, b)))
+#endif /* TUNE_PROGRAM_BUILD && !HAVE_NATIVE_mpn_mod_1_1p */
+
+
+/* The comments in mpn/generic/divrem_1.c apply here too.
+
+ As noted in the algorithms section of the manual, the shifts in the loop
+ for the unnorm case can be avoided by calculating r = a%(d*2^n), followed
+ by a final (r*2^n)%(d*2^n). In fact if it happens that a%(d*2^n) can
+ skip a division where (a*2^n)%(d*2^n) can't then there's the same number
+ of divide steps, though how often that happens depends on the assumed
+ distributions of dividend and divisor. In any case this idea is left to
+ CPU specific implementations to consider. */
+
+static mp_limb_t
+mpn_mod_1_unnorm (mp_srcptr up, mp_size_t un, mp_limb_t d)
+{
+ mp_size_t i;
+ mp_limb_t n1, n0, r;
+ mp_limb_t dummy;
+ int cnt;
+
+ ASSERT (un > 0);
+ ASSERT (d != 0);
+
+ d <<= GMP_NAIL_BITS;
+
+ /* Skip a division if high < divisor. Having the test here before
+ normalizing will still skip as often as possible. */
+ r = up[un - 1] << GMP_NAIL_BITS;
+ if (r < d)
+ {
+ r >>= GMP_NAIL_BITS;
+ un--;
+ if (un == 0)
+ return r;
+ }
+ else
+ r = 0;
+
+ /* If udiv_qrnnd doesn't need a normalized divisor, can use the simple
+ code above. */
+ if (! UDIV_NEEDS_NORMALIZATION
+ && BELOW_THRESHOLD (un, MOD_1_UNNORM_THRESHOLD))
+ {
+ for (i = un - 1; i >= 0; i--)
+ {
+ n0 = up[i] << GMP_NAIL_BITS;
+ udiv_qrnnd (dummy, r, r, n0, d);
+ r >>= GMP_NAIL_BITS;
+ }
+ return r;
+ }
+
+ count_leading_zeros (cnt, d);
+ d <<= cnt;
+
+ n1 = up[un - 1] << GMP_NAIL_BITS;
+ r = (r << cnt) | (n1 >> (GMP_LIMB_BITS - cnt));
+
+ if (UDIV_NEEDS_NORMALIZATION
+ && BELOW_THRESHOLD (un, MOD_1_UNNORM_THRESHOLD))
+ {
+ mp_limb_t nshift;
+ for (i = un - 2; i >= 0; i--)
+ {
+ n0 = up[i] << GMP_NAIL_BITS;
+ nshift = (n1 << cnt) | (n0 >> (GMP_NUMB_BITS - cnt));
+ udiv_qrnnd (dummy, r, r, nshift, d);
+ r >>= GMP_NAIL_BITS;
+ n1 = n0;
+ }
+ udiv_qrnnd (dummy, r, r, n1 << cnt, d);
+ r >>= GMP_NAIL_BITS;
+ return r >> cnt;
+ }
+ else
+ {
+ mp_limb_t inv, nshift;
+ invert_limb (inv, d);
+
+ for (i = un - 2; i >= 0; i--)
+ {
+ n0 = up[i] << GMP_NAIL_BITS;
+ nshift = (n1 << cnt) | (n0 >> (GMP_NUMB_BITS - cnt));
+ udiv_rnnd_preinv (r, r, nshift, d, inv);
+ r >>= GMP_NAIL_BITS;
+ n1 = n0;
+ }
+ udiv_rnnd_preinv (r, r, n1 << cnt, d, inv);
+ r >>= GMP_NAIL_BITS;
+ return r >> cnt;
+ }
+}
+
+static mp_limb_t
+mpn_mod_1_norm (mp_srcptr up, mp_size_t un, mp_limb_t d)
+{
+ mp_size_t i;
+ mp_limb_t n0, r;
+ mp_limb_t dummy;
+
+ ASSERT (un > 0);
+
+ d <<= GMP_NAIL_BITS;
+
+ ASSERT (d & GMP_LIMB_HIGHBIT);
+
+ /* High limb is initial remainder, possibly with one subtract of
+ d to get r<d. */
+ r = up[un - 1] << GMP_NAIL_BITS;
+ if (r >= d)
+ r -= d;
+ r >>= GMP_NAIL_BITS;
+ un--;
+ if (un == 0)
+ return r;
+
+ if (BELOW_THRESHOLD (un, MOD_1_NORM_THRESHOLD))
+ {
+ for (i = un - 1; i >= 0; i--)
+ {
+ n0 = up[i] << GMP_NAIL_BITS;
+ udiv_qrnnd (dummy, r, r, n0, d);
+ r >>= GMP_NAIL_BITS;
+ }
+ return r;
+ }
+ else
+ {
+ mp_limb_t inv;
+ invert_limb (inv, d);
+ for (i = un - 1; i >= 0; i--)
+ {
+ n0 = up[i] << GMP_NAIL_BITS;
+ udiv_rnnd_preinv (r, r, n0, d, inv);
+ r >>= GMP_NAIL_BITS;
+ }
+ return r;
+ }
+}
+
+mp_limb_t
+mpn_mod_1 (mp_srcptr ap, mp_size_t n, mp_limb_t b)
+{
+ ASSERT (n >= 0);
+ ASSERT (b != 0);
+
+ /* Should this be handled at all? Rely on callers? Note un==0 is currently
+ required by mpz/fdiv_r_ui.c and possibly other places. */
+ if (n == 0)
+ return 0;
+
+ if (UNLIKELY ((b & GMP_NUMB_HIGHBIT) != 0))
+ {
+ if (BELOW_THRESHOLD (n, MOD_1N_TO_MOD_1_1_THRESHOLD))
+ {
+ return mpn_mod_1_norm (ap, n, b);
+ }
+ else
+ {
+ mp_limb_t pre[4];
+ mpn_mod_1_1p_cps (pre, b);
+ return mpn_mod_1_1p (ap, n, b, pre);
+ }
+ }
+ else
+ {
+ if (BELOW_THRESHOLD (n, MOD_1U_TO_MOD_1_1_THRESHOLD))
+ {
+ return mpn_mod_1_unnorm (ap, n, b);
+ }
+ else if (BELOW_THRESHOLD (n, MOD_1_1_TO_MOD_1_2_THRESHOLD))
+ {
+ mp_limb_t pre[4];
+ mpn_mod_1_1p_cps (pre, b);
+ return mpn_mod_1_1p (ap, n, b << pre[1], pre);
+ }
+ else if (BELOW_THRESHOLD (n, MOD_1_2_TO_MOD_1_4_THRESHOLD) || UNLIKELY (b > GMP_NUMB_MASK / 4))
+ {
+ mp_limb_t pre[5];
+ mpn_mod_1s_2p_cps (pre, b);
+ return mpn_mod_1s_2p (ap, n, b << pre[1], pre);
+ }
+ else
+ {
+ mp_limb_t pre[7];
+ mpn_mod_1s_4p_cps (pre, b);
+ return mpn_mod_1s_4p (ap, n, b << pre[1], pre);
+ }
+ }
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/mod_1_1.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/mod_1_1.c
new file mode 100644
index 00000000000..2e111399eda
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/mod_1_1.c
@@ -0,0 +1,332 @@
+/* mpn_mod_1_1p (ap, n, b, cps)
+ Divide (ap,,n) by b. Return the single-limb remainder.
+
+ Contributed to the GNU project by Torbjorn Granlund and Niels Möller.
+ Based on a suggestion by Peter L. Montgomery.
+
+ 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 2008-2011, 2013 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.h"
+#include "gmp-impl.h"
+#include "longlong.h"
+
+#ifndef MOD_1_1P_METHOD
+# define MOD_1_1P_METHOD 1 /* need to make sure this is 2 for asm testing */
+#endif
+
+/* Define some longlong.h-style macros, but for wider operations.
+ * add_mssaaaa is like longlong.h's add_ssaaaa, but also generates
+ * carry out, in the form of a mask. */
+
+#if defined (__GNUC__)
+
+#if HAVE_HOST_CPU_FAMILY_x86 && W_TYPE_SIZE == 32
+#define add_mssaaaa(m, s1, s0, a1, a0, b1, b0) \
+ __asm__ ( "add %6, %k2\n\t" \
+ "adc %4, %k1\n\t" \
+ "sbb %k0, %k0" \
+ : "=r" (m), "=r" (s1), "=&r" (s0) \
+ : "1" ((USItype)(a1)), "g" ((USItype)(b1)), \
+ "%2" ((USItype)(a0)), "g" ((USItype)(b0)))
+#endif
+
+#if HAVE_HOST_CPU_FAMILY_x86_64 && W_TYPE_SIZE == 64
+#define add_mssaaaa(m, s1, s0, a1, a0, b1, b0) \
+ __asm__ ( "add %6, %q2\n\t" \
+ "adc %4, %q1\n\t" \
+ "sbb %q0, %q0" \
+ : "=r" (m), "=r" (s1), "=&r" (s0) \
+ : "1" ((UDItype)(a1)), "rme" ((UDItype)(b1)), \
+ "%2" ((UDItype)(a0)), "rme" ((UDItype)(b0)))
+#endif
+
+#if defined (__sparc__) && W_TYPE_SIZE == 32
+#define add_mssaaaa(m, sh, sl, ah, al, bh, bl) \
+ __asm__ ( "addcc %r5, %6, %2\n\t" \
+ "addxcc %r3, %4, %1\n\t" \
+ "subx %%g0, %%g0, %0" \
+ : "=r" (m), "=r" (sh), "=&r" (sl) \
+ : "rJ" (ah), "rI" (bh), "%rJ" (al), "rI" (bl) \
+ __CLOBBER_CC)
+#endif
+
+#if defined (__sparc__) && W_TYPE_SIZE == 64
+#define add_mssaaaa(m, sh, sl, ah, al, bh, bl) \
+ __asm__ ( "addcc %r5, %6, %2\n\t" \
+ "addccc %r7, %8, %%g0\n\t" \
+ "addccc %r3, %4, %1\n\t" \
+ "clr %0\n\t" \
+ "movcs %%xcc, -1, %0" \
+ : "=r" (m), "=r" (sh), "=&r" (sl) \
+ : "rJ" (ah), "rI" (bh), "%rJ" (al), "rI" (bl), \
+ "rJ" ((al) >> 32), "rI" ((bl) >> 32) \
+ __CLOBBER_CC)
+#if __VIS__ >= 0x300
+#undef add_mssaaaa
+#define add_mssaaaa(m, sh, sl, ah, al, bh, bl) \
+ __asm__ ( "addcc %r5, %6, %2\n\t" \
+ "addxccc %r3, %4, %1\n\t" \
+ "clr %0\n\t" \
+ "movcs %%xcc, -1, %0" \
+ : "=r" (m), "=r" (sh), "=&r" (sl) \
+ : "rJ" (ah), "rI" (bh), "%rJ" (al), "rI" (bl) \
+ __CLOBBER_CC)
+#endif
+#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_mssaaaa(m, s1, s0, a1, a0, b1, b0) \
+ __asm__ ( "add%I6c %2, %5, %6\n\t" \
+ "adde %1, %3, %4\n\t" \
+ "subfe %0, %0, %0\n\t" \
+ "nor %0, %0, %0" \
+ : "=r" (m), "=r" (s1), "=&r" (s0) \
+ : "r" (a1), "r" (b1), "%r" (a0), "rI" (b0))
+#endif
+
+#if defined (__s390x__) && W_TYPE_SIZE == 64
+#define add_mssaaaa(m, s1, s0, a1, a0, b1, b0) \
+ __asm__ ( "algr %2, %6\n\t" \
+ "alcgr %1, %4\n\t" \
+ "lghi %0, 0\n\t" \
+ "alcgr %0, %0\n\t" \
+ "lcgr %0, %0" \
+ : "=r" (m), "=r" (s1), "=&r" (s0) \
+ : "1" ((UDItype)(a1)), "r" ((UDItype)(b1)), \
+ "%2" ((UDItype)(a0)), "r" ((UDItype)(b0)) __CLOBBER_CC)
+#endif
+
+#if defined (__arm__) && W_TYPE_SIZE == 32
+#define add_mssaaaa(m, sh, sl, ah, al, bh, bl) \
+ __asm__ ( "adds %2, %5, %6\n\t" \
+ "adcs %1, %3, %4\n\t" \
+ "movcc %0, #0\n\t" \
+ "movcs %0, #-1" \
+ : "=r" (m), "=r" (sh), "=&r" (sl) \
+ : "r" (ah), "rI" (bh), "%r" (al), "rI" (bl) __CLOBBER_CC)
+#endif
+#endif /* defined (__GNUC__) */
+
+#ifndef add_mssaaaa
+#define add_mssaaaa(m, s1, s0, a1, a0, b1, b0) \
+ do { \
+ UWtype __s0, __s1, __c0, __c1; \
+ __s0 = (a0) + (b0); \
+ __s1 = (a1) + (b1); \
+ __c0 = __s0 < (a0); \
+ __c1 = __s1 < (a1); \
+ (s0) = __s0; \
+ __s1 = __s1 + __c0; \
+ (s1) = __s1; \
+ (m) = - (__c1 + (__s1 < __c0)); \
+ } while (0)
+#endif
+
+#if MOD_1_1P_METHOD == 1
+void
+mpn_mod_1_1p_cps (mp_limb_t cps[4], mp_limb_t b)
+{
+ mp_limb_t bi;
+ mp_limb_t B1modb, B2modb;
+ int cnt;
+
+ count_leading_zeros (cnt, b);
+
+ b <<= cnt;
+ invert_limb (bi, b);
+
+ cps[0] = bi;
+ cps[1] = cnt;
+
+ B1modb = -b;
+ if (LIKELY (cnt != 0))
+ B1modb *= ((bi >> (GMP_LIMB_BITS-cnt)) | (CNST_LIMB(1) << cnt));
+ ASSERT (B1modb <= b); /* NB: not fully reduced mod b */
+ cps[2] = B1modb >> cnt;
+
+ /* In the normalized case, this can be simplified to
+ *
+ * B2modb = - b * bi;
+ * ASSERT (B2modb <= b); // NB: equality iff b = B/2
+ */
+ udiv_rnnd_preinv (B2modb, B1modb, CNST_LIMB(0), b, bi);
+ cps[3] = B2modb >> cnt;
+}
+
+mp_limb_t
+mpn_mod_1_1p (mp_srcptr ap, mp_size_t n, mp_limb_t b, const mp_limb_t bmodb[4])
+{
+ mp_limb_t rh, rl, bi, ph, pl, r;
+ mp_limb_t B1modb, B2modb;
+ mp_size_t i;
+ int cnt;
+ mp_limb_t mask;
+
+ ASSERT (n >= 2); /* fix tuneup.c if this is changed */
+
+ B1modb = bmodb[2];
+ B2modb = bmodb[3];
+
+ rl = ap[n - 1];
+ umul_ppmm (ph, pl, rl, B1modb);
+ add_ssaaaa (rh, rl, ph, pl, CNST_LIMB(0), ap[n - 2]);
+
+ for (i = n - 3; i >= 0; i -= 1)
+ {
+ /* rr = ap[i] < B
+ + LO(rr) * (B mod b) <= (B-1)(b-1)
+ + HI(rr) * (B^2 mod b) <= (B-1)(b-1)
+ */
+ umul_ppmm (ph, pl, rl, B1modb);
+ add_ssaaaa (ph, pl, ph, pl, CNST_LIMB(0), ap[i]);
+
+ umul_ppmm (rh, rl, rh, B2modb);
+ add_ssaaaa (rh, rl, rh, rl, ph, pl);
+ }
+
+ cnt = bmodb[1];
+ bi = bmodb[0];
+
+ if (LIKELY (cnt != 0))
+ rh = (rh << cnt) | (rl >> (GMP_LIMB_BITS - cnt));
+
+ mask = -(mp_limb_t) (rh >= b);
+ rh -= mask & b;
+
+ udiv_rnnd_preinv (r, rh, rl << cnt, b, bi);
+
+ return r >> cnt;
+}
+#endif /* MOD_1_1P_METHOD == 1 */
+
+#if MOD_1_1P_METHOD == 2
+void
+mpn_mod_1_1p_cps (mp_limb_t cps[4], mp_limb_t b)
+{
+ mp_limb_t bi;
+ mp_limb_t B2modb;
+ int cnt;
+
+ count_leading_zeros (cnt, b);
+
+ b <<= cnt;
+ invert_limb (bi, b);
+
+ cps[0] = bi;
+ cps[1] = cnt;
+
+ if (LIKELY (cnt != 0))
+ {
+ mp_limb_t B1modb = -b;
+ B1modb *= ((bi >> (GMP_LIMB_BITS-cnt)) | (CNST_LIMB(1) << cnt));
+ ASSERT (B1modb <= b); /* NB: not fully reduced mod b */
+ cps[2] = B1modb >> cnt;
+ }
+ B2modb = - b * bi;
+ ASSERT (B2modb <= b); // NB: equality iff b = B/2
+ cps[3] = B2modb;
+}
+
+mp_limb_t
+mpn_mod_1_1p (mp_srcptr ap, mp_size_t n, mp_limb_t b, const mp_limb_t bmodb[4])
+{
+ int cnt;
+ mp_limb_t bi, B1modb;
+ mp_limb_t r0, r1;
+ mp_limb_t r;
+
+ ASSERT (n >= 2); /* fix tuneup.c if this is changed */
+
+ r0 = ap[n-2];
+ r1 = ap[n-1];
+
+ if (n > 2)
+ {
+ mp_limb_t B2modb, B2mb;
+ mp_limb_t p0, p1;
+ mp_limb_t r2;
+ mp_size_t j;
+
+ B2modb = bmodb[3];
+ B2mb = B2modb - b;
+
+ umul_ppmm (p1, p0, r1, B2modb);
+ add_mssaaaa (r2, r1, r0, r0, ap[n-3], p1, p0);
+
+ for (j = n-4; j >= 0; j--)
+ {
+ mp_limb_t cy;
+ /* mp_limb_t t = r0 + B2mb; */
+ umul_ppmm (p1, p0, r1, B2modb);
+
+ ADDC_LIMB (cy, r0, r0, r2 & B2modb);
+ /* Alternative, for cmov: if (cy) r0 = t; */
+ r0 -= (-cy) & b;
+ add_mssaaaa (r2, r1, r0, r0, ap[j], p1, p0);
+ }
+
+ r1 -= (r2 & b);
+ }
+
+ cnt = bmodb[1];
+
+ if (LIKELY (cnt != 0))
+ {
+ mp_limb_t t;
+ mp_limb_t B1modb = bmodb[2];
+
+ umul_ppmm (r1, t, r1, B1modb);
+ r0 += t;
+ r1 += (r0 < t);
+
+ /* Normalize */
+ r1 = (r1 << cnt) | (r0 >> (GMP_LIMB_BITS - cnt));
+ r0 <<= cnt;
+
+ /* NOTE: Might get r1 == b here, but udiv_rnnd_preinv allows that. */
+ }
+ else
+ {
+ mp_limb_t mask = -(mp_limb_t) (r1 >= b);
+ r1 -= mask & b;
+ }
+
+ bi = bmodb[0];
+
+ udiv_rnnd_preinv (r, r1, r0, b, bi);
+ return r >> cnt;
+}
+#endif /* MOD_1_1P_METHOD == 2 */
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/mod_1_2.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/mod_1_2.c
new file mode 100644
index 00000000000..7acf3dbdd10
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/mod_1_2.c
@@ -0,0 +1,149 @@
+/* mpn_mod_1s_2p (ap, n, b, cps)
+ Divide (ap,,n) by b. Return the single-limb remainder.
+ Requires that b < B / 2.
+
+ Contributed to the GNU project by Torbjorn Granlund.
+ Based on a suggestion by Peter L. Montgomery.
+
+ 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 2008-2010 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.h"
+#include "gmp-impl.h"
+#include "longlong.h"
+
+void
+mpn_mod_1s_2p_cps (mp_limb_t cps[5], mp_limb_t b)
+{
+ mp_limb_t bi;
+ mp_limb_t B1modb, B2modb, B3modb;
+ int cnt;
+
+ ASSERT (b <= (~(mp_limb_t) 0) / 2);
+
+ count_leading_zeros (cnt, b);
+
+ b <<= cnt;
+ invert_limb (bi, b);
+
+ cps[0] = bi;
+ cps[1] = cnt;
+
+ B1modb = -b * ((bi >> (GMP_LIMB_BITS-cnt)) | (CNST_LIMB(1) << cnt));
+ ASSERT (B1modb <= b); /* NB: not fully reduced mod b */
+ cps[2] = B1modb >> cnt;
+
+ udiv_rnnd_preinv (B2modb, B1modb, CNST_LIMB(0), b, bi);
+ cps[3] = B2modb >> cnt;
+
+ udiv_rnnd_preinv (B3modb, B2modb, CNST_LIMB(0), b, bi);
+ cps[4] = B3modb >> cnt;
+
+#if WANT_ASSERT
+ {
+ int i;
+ b = cps[2];
+ for (i = 3; i <= 4; i++)
+ {
+ b += cps[i];
+ ASSERT (b >= cps[i]);
+ }
+ }
+#endif
+}
+
+mp_limb_t
+mpn_mod_1s_2p (mp_srcptr ap, mp_size_t n, mp_limb_t b, const mp_limb_t cps[5])
+{
+ mp_limb_t rh, rl, bi, ph, pl, ch, cl, r;
+ mp_limb_t B1modb, B2modb, B3modb;
+ mp_size_t i;
+ int cnt;
+
+ ASSERT (n >= 1);
+
+ B1modb = cps[2];
+ B2modb = cps[3];
+ B3modb = cps[4];
+
+ if ((n & 1) != 0)
+ {
+ if (n == 1)
+ {
+ rl = ap[n - 1];
+ bi = cps[0];
+ cnt = cps[1];
+ udiv_rnnd_preinv (r, rl >> (GMP_LIMB_BITS - cnt),
+ rl << cnt, b, bi);
+ return r >> cnt;
+ }
+
+ umul_ppmm (ph, pl, ap[n - 2], B1modb);
+ add_ssaaaa (ph, pl, ph, pl, CNST_LIMB(0), ap[n - 3]);
+ umul_ppmm (rh, rl, ap[n - 1], B2modb);
+ add_ssaaaa (rh, rl, rh, rl, ph, pl);
+ n--;
+ }
+ else
+ {
+ rh = ap[n - 1];
+ rl = ap[n - 2];
+ }
+
+ for (i = n - 4; i >= 0; i -= 2)
+ {
+ /* rr = ap[i] < B
+ + ap[i+1] * (B mod b) <= (B-1)(b-1)
+ + LO(rr) * (B^2 mod b) <= (B-1)(b-1)
+ + HI(rr) * (B^3 mod b) <= (B-1)(b-1)
+ */
+ umul_ppmm (ph, pl, ap[i + 1], B1modb);
+ add_ssaaaa (ph, pl, ph, pl, CNST_LIMB(0), ap[i + 0]);
+
+ umul_ppmm (ch, cl, rl, B2modb);
+ add_ssaaaa (ph, pl, ph, pl, ch, cl);
+
+ umul_ppmm (rh, rl, rh, B3modb);
+ add_ssaaaa (rh, rl, rh, rl, ph, pl);
+ }
+
+ umul_ppmm (rh, cl, rh, B1modb);
+ add_ssaaaa (rh, rl, rh, rl, CNST_LIMB(0), cl);
+
+ cnt = cps[1];
+ bi = cps[0];
+
+ r = (rh << cnt) | (rl >> (GMP_LIMB_BITS - cnt));
+ udiv_rnnd_preinv (r, r, rl << cnt, b, bi);
+
+ return r >> cnt;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/mod_1_3.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/mod_1_3.c
new file mode 100644
index 00000000000..f4137f43155
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/mod_1_3.c
@@ -0,0 +1,157 @@
+/* mpn_mod_1s_3p (ap, n, b, cps)
+ Divide (ap,,n) by b. Return the single-limb remainder.
+ Requires that d < B / 3.
+
+ Contributed to the GNU project by Torbjorn Granlund.
+ Based on a suggestion by Peter L. Montgomery.
+
+ 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 2008-2010, 2013 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.h"
+#include "gmp-impl.h"
+#include "longlong.h"
+
+void
+mpn_mod_1s_3p_cps (mp_limb_t cps[6], mp_limb_t b)
+{
+ mp_limb_t bi;
+ mp_limb_t B1modb, B2modb, B3modb, B4modb;
+ int cnt;
+
+ ASSERT (b <= (~(mp_limb_t) 0) / 3);
+
+ count_leading_zeros (cnt, b);
+
+ b <<= cnt;
+ invert_limb (bi, b);
+
+ cps[0] = bi;
+ cps[1] = cnt;
+
+ B1modb = -b * ((bi >> (GMP_LIMB_BITS-cnt)) | (CNST_LIMB(1) << cnt));
+ ASSERT (B1modb <= b); /* NB: not fully reduced mod b */
+ cps[2] = B1modb >> cnt;
+
+ udiv_rnnd_preinv (B2modb, B1modb, CNST_LIMB(0), b, bi);
+ cps[3] = B2modb >> cnt;
+
+ udiv_rnnd_preinv (B3modb, B2modb, CNST_LIMB(0), b, bi);
+ cps[4] = B3modb >> cnt;
+
+ udiv_rnnd_preinv (B4modb, B3modb, CNST_LIMB(0), b, bi);
+ cps[5] = B4modb >> cnt;
+
+#if WANT_ASSERT
+ {
+ int i;
+ b = cps[2];
+ for (i = 3; i <= 5; i++)
+ {
+ b += cps[i];
+ ASSERT (b >= cps[i]);
+ }
+ }
+#endif
+}
+
+mp_limb_t
+mpn_mod_1s_3p (mp_srcptr ap, mp_size_t n, mp_limb_t b, const mp_limb_t cps[6])
+{
+ mp_limb_t rh, rl, bi, ph, pl, ch, cl, r;
+ mp_limb_t B1modb, B2modb, B3modb, B4modb;
+ mp_size_t i;
+ int cnt;
+
+ ASSERT (n >= 1);
+
+ B1modb = cps[2];
+ B2modb = cps[3];
+ B3modb = cps[4];
+ B4modb = cps[5];
+
+ /* We compute n mod 3 in a tricky way, which works except for when n is so
+ close to the maximum size that we don't need to support it. The final
+ cast to int is a workaround for HP cc. */
+ switch ((int) ((mp_limb_t) n * MODLIMB_INVERSE_3 >> (GMP_NUMB_BITS - 2)))
+ {
+ case 0:
+ umul_ppmm (ph, pl, ap[n - 2], B1modb);
+ add_ssaaaa (ph, pl, ph, pl, CNST_LIMB(0), ap[n - 3]);
+ umul_ppmm (rh, rl, ap[n - 1], B2modb);
+ add_ssaaaa (rh, rl, rh, rl, ph, pl);
+ n -= 3;
+ break;
+ case 2: /* n mod 3 = 1 */
+ rh = 0;
+ rl = ap[n - 1];
+ n -= 1;
+ break;
+ case 1: /* n mod 3 = 2 */
+ rh = ap[n - 1];
+ rl = ap[n - 2];
+ n -= 2;
+ break;
+ }
+
+ for (i = n - 3; i >= 0; i -= 3)
+ {
+ /* rr = ap[i] < B
+ + ap[i+1] * (B mod b) <= (B-1)(b-1)
+ + ap[i+2] * (B^2 mod b) <= (B-1)(b-1)
+ + LO(rr) * (B^3 mod b) <= (B-1)(b-1)
+ + HI(rr) * (B^4 mod b) <= (B-1)(b-1)
+ */
+ umul_ppmm (ph, pl, ap[i + 1], B1modb);
+ add_ssaaaa (ph, pl, ph, pl, CNST_LIMB(0), ap[i + 0]);
+
+ umul_ppmm (ch, cl, ap[i + 2], B2modb);
+ add_ssaaaa (ph, pl, ph, pl, ch, cl);
+
+ umul_ppmm (ch, cl, rl, B3modb);
+ add_ssaaaa (ph, pl, ph, pl, ch, cl);
+
+ umul_ppmm (rh, rl, rh, B4modb);
+ add_ssaaaa (rh, rl, rh, rl, ph, pl);
+ }
+
+ umul_ppmm (rh, cl, rh, B1modb);
+ add_ssaaaa (rh, rl, rh, rl, CNST_LIMB(0), cl);
+
+ cnt = cps[1];
+ bi = cps[0];
+
+ r = (rh << cnt) | (rl >> (GMP_LIMB_BITS - cnt));
+ udiv_rnnd_preinv (r, r, rl << cnt, b, bi);
+
+ return r >> cnt;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/mod_1_4.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/mod_1_4.c
new file mode 100644
index 00000000000..716a0c66de4
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/mod_1_4.c
@@ -0,0 +1,171 @@
+/* mpn_mod_1s_4p (ap, n, b, cps)
+ Divide (ap,,n) by b. Return the single-limb remainder.
+ Requires that d < B / 4.
+
+ Contributed to the GNU project by Torbjorn Granlund.
+ Based on a suggestion by Peter L. Montgomery.
+
+ 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 2008-2010 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.h"
+#include "gmp-impl.h"
+#include "longlong.h"
+
+void
+mpn_mod_1s_4p_cps (mp_limb_t cps[7], mp_limb_t b)
+{
+ mp_limb_t bi;
+ mp_limb_t B1modb, B2modb, B3modb, B4modb, B5modb;
+ int cnt;
+
+ ASSERT (b <= (~(mp_limb_t) 0) / 4);
+
+ count_leading_zeros (cnt, b);
+
+ b <<= cnt;
+ invert_limb (bi, b);
+
+ cps[0] = bi;
+ cps[1] = cnt;
+
+ B1modb = -b * ((bi >> (GMP_LIMB_BITS-cnt)) | (CNST_LIMB(1) << cnt));
+ ASSERT (B1modb <= b); /* NB: not fully reduced mod b */
+ cps[2] = B1modb >> cnt;
+
+ udiv_rnnd_preinv (B2modb, B1modb, CNST_LIMB(0), b, bi);
+ cps[3] = B2modb >> cnt;
+
+ udiv_rnnd_preinv (B3modb, B2modb, CNST_LIMB(0), b, bi);
+ cps[4] = B3modb >> cnt;
+
+ udiv_rnnd_preinv (B4modb, B3modb, CNST_LIMB(0), b, bi);
+ cps[5] = B4modb >> cnt;
+
+ udiv_rnnd_preinv (B5modb, B4modb, CNST_LIMB(0), b, bi);
+ cps[6] = B5modb >> cnt;
+
+#if WANT_ASSERT
+ {
+ int i;
+ b = cps[2];
+ for (i = 3; i <= 6; i++)
+ {
+ b += cps[i];
+ ASSERT (b >= cps[i]);
+ }
+ }
+#endif
+}
+
+mp_limb_t
+mpn_mod_1s_4p (mp_srcptr ap, mp_size_t n, mp_limb_t b, const mp_limb_t cps[7])
+{
+ mp_limb_t rh, rl, bi, ph, pl, ch, cl, r;
+ mp_limb_t B1modb, B2modb, B3modb, B4modb, B5modb;
+ mp_size_t i;
+ int cnt;
+
+ ASSERT (n >= 1);
+
+ B1modb = cps[2];
+ B2modb = cps[3];
+ B3modb = cps[4];
+ B4modb = cps[5];
+ B5modb = cps[6];
+
+ switch (n & 3)
+ {
+ case 0:
+ umul_ppmm (ph, pl, ap[n - 3], B1modb);
+ add_ssaaaa (ph, pl, ph, pl, CNST_LIMB(0), ap[n - 4]);
+ umul_ppmm (ch, cl, ap[n - 2], B2modb);
+ add_ssaaaa (ph, pl, ph, pl, ch, cl);
+ umul_ppmm (rh, rl, ap[n - 1], B3modb);
+ add_ssaaaa (rh, rl, rh, rl, ph, pl);
+ n -= 4;
+ break;
+ case 1:
+ rh = 0;
+ rl = ap[n - 1];
+ n -= 1;
+ break;
+ case 2:
+ rh = ap[n - 1];
+ rl = ap[n - 2];
+ n -= 2;
+ break;
+ case 3:
+ umul_ppmm (ph, pl, ap[n - 2], B1modb);
+ add_ssaaaa (ph, pl, ph, pl, CNST_LIMB(0), ap[n - 3]);
+ umul_ppmm (rh, rl, ap[n - 1], B2modb);
+ add_ssaaaa (rh, rl, rh, rl, ph, pl);
+ n -= 3;
+ break;
+ }
+
+ for (i = n - 4; i >= 0; i -= 4)
+ {
+ /* rr = ap[i] < B
+ + ap[i+1] * (B mod b) <= (B-1)(b-1)
+ + ap[i+2] * (B^2 mod b) <= (B-1)(b-1)
+ + ap[i+3] * (B^3 mod b) <= (B-1)(b-1)
+ + LO(rr) * (B^4 mod b) <= (B-1)(b-1)
+ + HI(rr) * (B^5 mod b) <= (B-1)(b-1)
+ */
+ umul_ppmm (ph, pl, ap[i + 1], B1modb);
+ add_ssaaaa (ph, pl, ph, pl, CNST_LIMB(0), ap[i + 0]);
+
+ umul_ppmm (ch, cl, ap[i + 2], B2modb);
+ add_ssaaaa (ph, pl, ph, pl, ch, cl);
+
+ umul_ppmm (ch, cl, ap[i + 3], B3modb);
+ add_ssaaaa (ph, pl, ph, pl, ch, cl);
+
+ umul_ppmm (ch, cl, rl, B4modb);
+ add_ssaaaa (ph, pl, ph, pl, ch, cl);
+
+ umul_ppmm (rh, rl, rh, B5modb);
+ add_ssaaaa (rh, rl, rh, rl, ph, pl);
+ }
+
+ umul_ppmm (rh, cl, rh, B1modb);
+ add_ssaaaa (rh, rl, rh, rl, CNST_LIMB(0), cl);
+
+ cnt = cps[1];
+ bi = cps[0];
+
+ r = (rh << cnt) | (rl >> (GMP_LIMB_BITS - cnt));
+ udiv_rnnd_preinv (r, r, rl << cnt, b, bi);
+
+ return r >> cnt;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/mod_34lsub1.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/mod_34lsub1.c
new file mode 100644
index 00000000000..7c07af7acc2
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/mod_34lsub1.c
@@ -0,0 +1,131 @@
+/* mpn_mod_34lsub1 -- remainder modulo 2^(GMP_NUMB_BITS*3/4)-1.
+
+ 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 2000-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/. */
+
+
+#include "gmp.h"
+#include "gmp-impl.h"
+
+
+/* Calculate a remainder from {p,n} divided by 2^(GMP_NUMB_BITS*3/4)-1.
+ The remainder is not fully reduced, it's any limb value congruent to
+ {p,n} modulo that divisor.
+
+ This implementation is only correct when GMP_NUMB_BITS is a multiple of
+ 4.
+
+ FIXME: If GMP_NAIL_BITS is some silly big value during development then
+ it's possible the carry accumulators c0,c1,c2 could overflow.
+
+ General notes:
+
+ The basic idea is to use a set of N accumulators (N=3 in this case) to
+ effectively get a remainder mod 2^(GMP_NUMB_BITS*N)-1 followed at the end
+ by a reduction to GMP_NUMB_BITS*N/M bits (M=4 in this case) for a
+ remainder mod 2^(GMP_NUMB_BITS*N/M)-1. N and M are chosen to give a good
+ set of small prime factors in 2^(GMP_NUMB_BITS*N/M)-1.
+
+ N=3 M=4 suits GMP_NUMB_BITS==32 and GMP_NUMB_BITS==64 quite well, giving
+ a few more primes than a single accumulator N=1 does, and for no extra
+ cost (assuming the processor has a decent number of registers).
+
+ For strange nailified values of GMP_NUMB_BITS the idea would be to look
+ for what N and M give good primes. With GMP_NUMB_BITS not a power of 2
+ the choices for M may be opened up a bit. But such things are probably
+ best done in separate code, not grafted on here. */
+
+#if GMP_NUMB_BITS % 4 == 0
+
+#define B1 (GMP_NUMB_BITS / 4)
+#define B2 (B1 * 2)
+#define B3 (B1 * 3)
+
+#define M1 ((CNST_LIMB(1) << B1) - 1)
+#define M2 ((CNST_LIMB(1) << B2) - 1)
+#define M3 ((CNST_LIMB(1) << B3) - 1)
+
+#define LOW0(n) ((n) & M3)
+#define HIGH0(n) ((n) >> B3)
+
+#define LOW1(n) (((n) & M2) << B1)
+#define HIGH1(n) ((n) >> B2)
+
+#define LOW2(n) (((n) & M1) << B2)
+#define HIGH2(n) ((n) >> B1)
+
+#define PARTS0(n) (LOW0(n) + HIGH0(n))
+#define PARTS1(n) (LOW1(n) + HIGH1(n))
+#define PARTS2(n) (LOW2(n) + HIGH2(n))
+
+#define ADD(c,a,val) \
+ do { \
+ mp_limb_t new_c; \
+ ADDC_LIMB (new_c, a, a, val); \
+ (c) += new_c; \
+ } while (0)
+
+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 a0, a1, a2;
+
+ ASSERT (n >= 1);
+ ASSERT (n/3 < GMP_NUMB_MAX);
+
+ a0 = a1 = a2 = 0;
+ c0 = c1 = c2 = 0;
+
+ while ((n -= 3) >= 0)
+ {
+ ADD (c0, a0, p[0]);
+ ADD (c1, a1, p[1]);
+ ADD (c2, a2, p[2]);
+ p += 3;
+ }
+
+ if (n != -3)
+ {
+ ADD (c0, a0, p[0]);
+ if (n != -2)
+ ADD (c1, a1, p[1]);
+ }
+
+ return
+ PARTS0 (a0) + PARTS1 (a1) + PARTS2 (a2)
+ + PARTS1 (c0) + PARTS2 (c1) + PARTS0 (c2);
+}
+
+#endif
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/mode1o.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/mode1o.c
new file mode 100644
index 00000000000..ec91da223d4
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/mode1o.c
@@ -0,0 +1,236 @@
+/* mpn_modexact_1c_odd -- mpn by limb exact division style remainder.
+
+ 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 2000-2004 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.h"
+#include "gmp-impl.h"
+#include "longlong.h"
+
+
+/* Calculate an r satisfying
+
+ r*B^k + a - c == q*d
+
+ where B=2^GMP_LIMB_BITS, a is {src,size}, k is either size or size-1
+ (the caller won't know which), and q is the quotient (discarded). d must
+ be odd, c can be any limb value.
+
+ If c<d then r will be in the range 0<=r<d, or if c>=d then 0<=r<=d.
+
+ This slightly strange function suits the initial Nx1 reduction for GCDs
+ or Jacobi symbols since the factors of 2 in B^k can be ignored, leaving
+ -r == a mod d (by passing c=0). For a GCD the factor of -1 on r can be
+ ignored, or for the Jacobi symbol it can be accounted for. The function
+ also suits divisibility and congruence testing since if r=0 (or r=d) is
+ obtained then a==c mod d.
+
+
+ r is a bit like the remainder returned by mpn_divexact_by3c, and is the
+ sort of remainder mpn_divexact_1 might return. Like mpn_divexact_by3c, r
+ represents a borrow, since effectively quotient limbs are chosen so that
+ subtracting that multiple of d from src at each step will produce a zero
+ limb.
+
+ A long calculation can be done piece by piece from low to high by passing
+ the return value from one part as the carry parameter to the next part.
+ The effective final k becomes anything between size and size-n, if n
+ pieces are used.
+
+
+ A similar sort of routine could be constructed based on adding multiples
+ of d at each limb, much like redc in mpz_powm does. Subtracting however
+ has a small advantage that when subtracting to cancel out l there's never
+ a borrow into h, whereas using an addition would put a carry into h
+ depending whether l==0 or l!=0.
+
+
+ In terms of efficiency, this function is similar to a mul-by-inverse
+ mpn_mod_1. Both are essentially two multiplies and are best suited to
+ CPUs with low latency multipliers (in comparison to a divide instruction
+ at least.) But modexact has a few less supplementary operations, only
+ needs low part and high part multiplies, and has fewer working quantities
+ (helping CPUs with few registers).
+
+
+ In the main loop it will be noted that the new carry (call it r) is the
+ sum of the high product h and any borrow from l=s-c. If c<d then we will
+ have r<d too, for the following reasons. Let q=l*inverse be the quotient
+ limb, so that q*d = B*h + l, where B=2^GMP_NUMB_BITS. Now if h=d-1 then
+
+ l = q*d - B*(d-1) <= (B-1)*d - B*(d-1) = B-d
+
+ But if l=s-c produces a borrow when c<d, then l>=B-d+1 and hence will
+ never have h=d-1 and so r=h+borrow <= d-1.
+
+ When c>=d, on the other hand, h=d-1 can certainly occur together with a
+ borrow, thereby giving only r<=d, as per the function definition above.
+
+ As a design decision it's left to the caller to check for r=d if it might
+ be passing c>=d. Several applications have c<d initially so the extra
+ test is often unnecessary, for example the GCDs or a plain divisibility
+ d|a test will pass c=0.
+
+
+ The special case for size==1 is so that it can be assumed c<=d in the
+ high<=divisor test at the end. c<=d is only guaranteed after at least
+ one iteration of the main loop. There's also a decent chance one % is
+ faster than a binvert_limb, though that will depend on the processor.
+
+ A CPU specific implementation might want to omit the size==1 code or the
+ high<divisor test. mpn/x86/k6/mode1o.asm for instance finds neither
+ useful. */
+
+
+mp_limb_t
+mpn_modexact_1c_odd (mp_srcptr src, mp_size_t size, mp_limb_t d,
+ mp_limb_t orig_c)
+{
+ mp_limb_t s, h, l, inverse, dummy, dmul, ret;
+ mp_limb_t c = orig_c;
+ mp_size_t i;
+
+ ASSERT (size >= 1);
+ ASSERT (d & 1);
+ ASSERT_MPN (src, size);
+ ASSERT_LIMB (d);
+ ASSERT_LIMB (c);
+
+ if (size == 1)
+ {
+ s = src[0];
+ if (s > c)
+ {
+ l = s-c;
+ h = l % d;
+ if (h != 0)
+ h = d - h;
+ }
+ else
+ {
+ l = c-s;
+ h = l % d;
+ }
+ return h;
+ }
+
+
+ binvert_limb (inverse, d);
+ dmul = d << GMP_NAIL_BITS;
+
+ i = 0;
+ do
+ {
+ s = src[i];
+ SUBC_LIMB (c, l, s, c);
+ l = (l * inverse) & GMP_NUMB_MASK;
+ umul_ppmm (h, dummy, l, dmul);
+ c += h;
+ }
+ while (++i < size-1);
+
+
+ s = src[i];
+ if (s <= d)
+ {
+ /* With high<=d the final step can be a subtract and addback. If c==0
+ then the addback will restore to l>=0. If c==d then will get l==d
+ if s==0, but that's ok per the function definition. */
+
+ l = c - s;
+ if (c < s)
+ l += d;
+
+ ret = l;
+ }
+ else
+ {
+ /* Can't skip a divide, just do the loop code once more. */
+
+ SUBC_LIMB (c, l, s, c);
+ l = (l * inverse) & GMP_NUMB_MASK;
+ umul_ppmm (h, dummy, l, dmul);
+ c += h;
+ ret = c;
+ }
+
+ ASSERT (orig_c < d ? ret < d : ret <= d);
+ return ret;
+}
+
+
+
+#if 0
+
+/* The following is an alternate form that might shave one cycle on a
+ superscalar processor since it takes c+=h off the dependent chain,
+ leaving just a low product, high product, and a subtract.
+
+ This is for CPU specific implementations to consider. A special case for
+ high<divisor and/or size==1 can be added if desired.
+
+ Notice that c is only ever 0 or 1, since if s-c produces a borrow then
+ x=0xFF..FF and x-h cannot produce a borrow. The c=(x>s) could become
+ c=(x==0xFF..FF) too, if that helped. */
+
+mp_limb_t
+mpn_modexact_1c_odd (mp_srcptr src, mp_size_t size, mp_limb_t d, mp_limb_t h)
+{
+ mp_limb_t s, x, y, inverse, dummy, dmul, c1, c2;
+ mp_limb_t c = 0;
+ mp_size_t i;
+
+ ASSERT (size >= 1);
+ ASSERT (d & 1);
+
+ binvert_limb (inverse, d);
+ dmul = d << GMP_NAIL_BITS;
+
+ for (i = 0; i < size; i++)
+ {
+ ASSERT (c==0 || c==1);
+
+ s = src[i];
+ SUBC_LIMB (c1, x, s, c);
+
+ SUBC_LIMB (c2, y, x, h);
+ c = c1 + c2;
+
+ y = (y * inverse) & GMP_NUMB_MASK;
+ umul_ppmm (h, dummy, y, dmul);
+ }
+
+ h += c;
+ return h;
+}
+
+#endif
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/mu_bdiv_q.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/mu_bdiv_q.c
new file mode 100644
index 00000000000..0a8010ec153
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/mu_bdiv_q.c
@@ -0,0 +1,271 @@
+/* mpn_mu_bdiv_q(qp,np,nn,dp,dn,tp) -- Compute {np,nn} / {dp,dn} mod B^nn.
+ storing the result in {qp,nn}. Overlap allowed between Q and N; all other
+ overlap disallowed.
+
+ 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 GMP RELEASE.
+
+Copyright 2005-2007, 2009, 2010 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/. */
+
+
+/*
+ The idea of the algorithm used herein is to compute a smaller inverted value
+ than used in the standard Barrett algorithm, and thus save time in the
+ Newton iterations, and pay just a small price when using the inverted value
+ for developing quotient bits. This algorithm was presented at ICMS 2006.
+*/
+
+#include "gmp.h"
+#include "gmp-impl.h"
+
+
+/* N = {np,nn}
+ D = {dp,dn}
+
+ Requirements: N >= D
+ D >= 1
+ D odd
+ dn >= 2
+ nn >= 2
+ scratch space as determined by mpn_mu_bdiv_q_itch(nn,dn).
+
+ Write quotient to Q = {qp,nn}.
+
+ FIXME: When iterating, perhaps do the small step before loop, not after.
+ FIXME: Try to avoid the scalar divisions when computing inverse size.
+ 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.
+ FIXME: Trim final quotient calculation to qn limbs of precision.
+*/
+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)
+{
+ mp_size_t qn;
+ mp_size_t in;
+ int cy, c0;
+ mp_size_t tn, wn;
+
+ qn = nn;
+
+ ASSERT (dn >= 2);
+ ASSERT (qn >= 2);
+
+ if (qn > dn)
+ {
+ mp_size_t b;
+
+ /* |_______________________| dividend
+ |________| divisor */
+
+#define ip scratch /* in */
+#define rp (scratch + in) /* dn or rest >= binvert_itch(in) */
+#define tp (scratch + in + dn) /* dn+in or next_size(dn) */
+#define scratch_out (scratch + in + dn + tn) /* mulmod_bnm1_itch(next_size(dn)) */
+
+ /* Compute an inverse size that is a nice partition of the quotient. */
+ b = (qn - 1) / dn + 1; /* ceil(qn/dn), number of blocks */
+ in = (qn - 1) / b + 1; /* ceil(qn/b) = ceil(qn / ceil(qn/dn)) */
+
+ /* Some notes on allocation:
+
+ When in = dn, R dies when mpn_mullo returns, if in < dn the low in
+ limbs of R dies at that point. We could save memory by letting T live
+ just under R, and let the upper part of T expand into R. These changes
+ should reduce itch to perhaps 3dn.
+ */
+
+ mpn_binvert (ip, dp, in, rp);
+
+ cy = 0;
+
+ MPN_COPY (rp, np, dn);
+ np += dn;
+ mpn_mullo_n (qp, rp, ip, in);
+ qn -= in;
+
+ while (qn > in)
+ {
+ if (BELOW_THRESHOLD (in, MUL_TO_MULMOD_BNM1_FOR_2NXN_THRESHOLD))
+ mpn_mul (tp, dp, dn, qp, in); /* mulhi, need tp[dn+in-1...in] */
+ else
+ {
+ tn = mpn_mulmod_bnm1_next_size (dn);
+ mpn_mulmod_bnm1 (tp, tn, dp, dn, qp, in, scratch_out);
+ wn = dn + in - tn; /* number of wrapped limbs */
+ if (wn > 0)
+ {
+ c0 = mpn_sub_n (tp + tn, tp, rp, wn);
+ mpn_decr_u (tp + wn, c0);
+ }
+ }
+
+ qp += in;
+ if (dn != in)
+ {
+ /* Subtract tp[dn-1...in] from partial remainder. */
+ cy += mpn_sub_n (rp, rp + in, tp + in, dn - in);
+ if (cy == 2)
+ {
+ mpn_incr_u (tp + dn, 1);
+ cy = 1;
+ }
+ }
+ /* Subtract tp[dn+in-1...dn] from dividend. */
+ cy = mpn_sub_nc (rp + dn - in, np, tp + dn, in, cy);
+ np += in;
+ mpn_mullo_n (qp, rp, ip, in);
+ qn -= in;
+ }
+
+ /* Generate last qn limbs.
+ FIXME: It should be possible to limit precision here, since qn is
+ typically somewhat smaller than dn. No big gains expected. */
+
+ if (BELOW_THRESHOLD (in, MUL_TO_MULMOD_BNM1_FOR_2NXN_THRESHOLD))
+ mpn_mul (tp, dp, dn, qp, in); /* mulhi, need tp[qn+in-1...in] */
+ else
+ {
+ tn = mpn_mulmod_bnm1_next_size (dn);
+ mpn_mulmod_bnm1 (tp, tn, dp, dn, qp, in, scratch_out);
+ wn = dn + in - tn; /* number of wrapped limbs */
+ if (wn > 0)
+ {
+ c0 = mpn_sub_n (tp + tn, tp, rp, wn);
+ mpn_decr_u (tp + wn, c0);
+ }
+ }
+
+ qp += in;
+ if (dn != in)
+ {
+ cy += mpn_sub_n (rp, rp + in, tp + in, dn - in);
+ if (cy == 2)
+ {
+ mpn_incr_u (tp + dn, 1);
+ cy = 1;
+ }
+ }
+
+ mpn_sub_nc (rp + dn - in, np, tp + dn, qn - (dn - in), cy);
+ mpn_mullo_n (qp, rp, ip, qn);
+
+#undef ip
+#undef rp
+#undef tp
+#undef scratch_out
+ }
+ else
+ {
+ /* |_______________________| dividend
+ |________________| divisor */
+
+#define ip scratch /* in */
+#define tp (scratch + in) /* qn+in or next_size(qn) or rest >= binvert_itch(in) */
+#define scratch_out (scratch + in + tn)/* mulmod_bnm1_itch(next_size(qn)) */
+
+ /* Compute half-sized inverse. */
+ in = qn - (qn >> 1);
+
+ mpn_binvert (ip, dp, in, tp);
+
+ mpn_mullo_n (qp, np, ip, in); /* low `in' quotient limbs */
+
+ if (BELOW_THRESHOLD (in, MUL_TO_MULMOD_BNM1_FOR_2NXN_THRESHOLD))
+ mpn_mul (tp, dp, qn, qp, in); /* mulhigh */
+ else
+ {
+ tn = mpn_mulmod_bnm1_next_size (qn);
+ mpn_mulmod_bnm1 (tp, tn, dp, qn, qp, in, scratch_out);
+ wn = qn + in - tn; /* number of wrapped limbs */
+ if (wn > 0)
+ {
+ c0 = mpn_cmp (tp, np, wn) < 0;
+ mpn_decr_u (tp + wn, c0);
+ }
+ }
+
+ mpn_sub_n (tp, np + in, tp + in, qn - in);
+ mpn_mullo_n (qp + in, tp, ip, qn - in); /* high qn-in quotient limbs */
+
+#undef ip
+#undef tp
+#undef scratch_out
+ }
+}
+
+mp_size_t
+mpn_mu_bdiv_q_itch (mp_size_t nn, mp_size_t dn)
+{
+ mp_size_t qn, in, tn, itch_binvert, itch_out, itches;
+ mp_size_t b;
+
+ qn = nn;
+
+ if (qn > dn)
+ {
+ b = (qn - 1) / dn + 1; /* ceil(qn/dn), number of blocks */
+ in = (qn - 1) / b + 1; /* ceil(qn/b) = ceil(qn / ceil(qn/dn)) */
+ if (BELOW_THRESHOLD (in, MUL_TO_MULMOD_BNM1_FOR_2NXN_THRESHOLD))
+ {
+ tn = dn + in;
+ itch_out = 0;
+ }
+ else
+ {
+ tn = mpn_mulmod_bnm1_next_size (dn);
+ itch_out = mpn_mulmod_bnm1_itch (tn, dn, in);
+ }
+ itch_binvert = mpn_binvert_itch (in);
+ itches = dn + tn + itch_out;
+ return in + MAX (itches, itch_binvert);
+ }
+ else
+ {
+ in = qn - (qn >> 1);
+ if (BELOW_THRESHOLD (in, MUL_TO_MULMOD_BNM1_FOR_2NXN_THRESHOLD))
+ {
+ tn = qn + in;
+ itch_out = 0;
+ }
+ else
+ {
+ tn = mpn_mulmod_bnm1_next_size (qn);
+ itch_out = mpn_mulmod_bnm1_itch (tn, qn, in);
+ }
+ itch_binvert = mpn_binvert_itch (in);
+ itches = tn + itch_out;
+ return in + MAX (itches, itch_binvert);
+ }
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/mu_bdiv_qr.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/mu_bdiv_qr.c
new file mode 100644
index 00000000000..d265440f2ba
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/mu_bdiv_qr.c
@@ -0,0 +1,289 @@
+/* mpn_mu_bdiv_qr(qp,rp,np,nn,dp,dn,tp) -- Compute {np,nn} / {dp,dn} mod B^qn,
+ where qn = nn-dn, storing the result in {qp,qn}. Overlap allowed between Q
+ and N; all other overlap disallowed.
+
+ 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 GMP RELEASE.
+
+Copyright 2005-2007, 2009, 2010, 2012 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/. */
+
+
+/*
+ The idea of the algorithm used herein is to compute a smaller inverted value
+ than used in the standard Barrett algorithm, and thus save time in the
+ Newton iterations, and pay just a small price when using the inverted value
+ for developing quotient bits. This algorithm was presented at ICMS 2006.
+*/
+
+#include "gmp.h"
+#include "gmp-impl.h"
+
+
+/* N = {np,nn}
+ D = {dp,dn}
+
+ Requirements: N >= D
+ D >= 1
+ D odd
+ dn >= 2
+ nn >= 2
+ scratch space as determined by mpn_mu_bdiv_qr_itch(nn,dn).
+
+ Write quotient to Q = {qp,nn-dn}.
+
+ FIXME: When iterating, perhaps do the small step before loop, not after.
+ FIXME: Try to avoid the scalar divisions when computing inverse size.
+ 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)
+{
+ mp_size_t qn;
+ mp_size_t in;
+ mp_limb_t cy, c0;
+ mp_size_t tn, wn;
+
+ qn = nn - dn;
+
+ ASSERT (dn >= 2);
+ ASSERT (qn >= 2);
+
+ if (qn > dn)
+ {
+ mp_size_t b;
+
+ /* |_______________________| dividend
+ |________| divisor */
+
+#define ip scratch /* in */
+#define tp (scratch + in) /* dn+in or next_size(dn) or rest >= binvert_itch(in) */
+#define scratch_out (scratch + in + tn)/* mulmod_bnm1_itch(next_size(dn)) */
+
+ /* Compute an inverse size that is a nice partition of the quotient. */
+ b = (qn - 1) / dn + 1; /* ceil(qn/dn), number of blocks */
+ in = (qn - 1) / b + 1; /* ceil(qn/b) = ceil(qn / ceil(qn/dn)) */
+
+ /* Some notes on allocation:
+
+ When in = dn, R dies when mpn_mullo returns, if in < dn the low in
+ limbs of R dies at that point. We could save memory by letting T live
+ just under R, and let the upper part of T expand into R. These changes
+ should reduce itch to perhaps 3dn.
+ */
+
+ mpn_binvert (ip, dp, in, tp);
+
+ MPN_COPY (rp, np, dn);
+ np += dn;
+ cy = 0;
+
+ while (qn > in)
+ {
+ mpn_mullo_n (qp, rp, ip, in);
+
+ if (BELOW_THRESHOLD (in, MUL_TO_MULMOD_BNM1_FOR_2NXN_THRESHOLD))
+ mpn_mul (tp, dp, dn, qp, in); /* mulhi, need tp[dn+in-1...in] */
+ else
+ {
+ tn = mpn_mulmod_bnm1_next_size (dn);
+ mpn_mulmod_bnm1 (tp, tn, dp, dn, qp, in, scratch_out);
+ wn = dn + in - tn; /* number of wrapped limbs */
+ if (wn > 0)
+ {
+ c0 = mpn_sub_n (tp + tn, tp, rp, wn);
+ mpn_decr_u (tp + wn, c0);
+ }
+ }
+
+ qp += in;
+ qn -= in;
+
+ if (dn != in)
+ {
+ /* Subtract tp[dn-1...in] from partial remainder. */
+ cy += mpn_sub_n (rp, rp + in, tp + in, dn - in);
+ if (cy == 2)
+ {
+ mpn_incr_u (tp + dn, 1);
+ cy = 1;
+ }
+ }
+ /* Subtract tp[dn+in-1...dn] from dividend. */
+ cy = mpn_sub_nc (rp + dn - in, np, tp + dn, in, cy);
+ np += in;
+ }
+
+ /* Generate last qn limbs. */
+ mpn_mullo_n (qp, rp, ip, qn);
+
+ if (BELOW_THRESHOLD (qn, MUL_TO_MULMOD_BNM1_FOR_2NXN_THRESHOLD))
+ mpn_mul (tp, dp, dn, qp, qn); /* mulhi, need tp[qn+in-1...in] */
+ else
+ {
+ tn = mpn_mulmod_bnm1_next_size (dn);
+ mpn_mulmod_bnm1 (tp, tn, dp, dn, qp, qn, scratch_out);
+ wn = dn + qn - tn; /* number of wrapped limbs */
+ if (wn > 0)
+ {
+ c0 = mpn_sub_n (tp + tn, tp, rp, wn);
+ mpn_decr_u (tp + wn, c0);
+ }
+ }
+
+ if (dn != qn)
+ {
+ cy += mpn_sub_n (rp, rp + qn, tp + qn, dn - qn);
+ if (cy == 2)
+ {
+ mpn_incr_u (tp + dn, 1);
+ cy = 1;
+ }
+ }
+ return mpn_sub_nc (rp + dn - qn, np, tp + dn, qn, cy);
+
+#undef ip
+#undef tp
+#undef scratch_out
+ }
+ else
+ {
+ /* |_______________________| dividend
+ |________________| divisor */
+
+#define ip scratch /* in */
+#define tp (scratch + in) /* dn+in or next_size(dn) or rest >= binvert_itch(in) */
+#define scratch_out (scratch + in + tn)/* mulmod_bnm1_itch(next_size(dn)) */
+
+ /* Compute half-sized inverse. */
+ in = qn - (qn >> 1);
+
+ mpn_binvert (ip, dp, in, tp);
+
+ mpn_mullo_n (qp, np, ip, in); /* low `in' quotient limbs */
+
+ if (BELOW_THRESHOLD (in, MUL_TO_MULMOD_BNM1_FOR_2NXN_THRESHOLD))
+ mpn_mul (tp, dp, dn, qp, in); /* mulhigh */
+ else
+ {
+ tn = mpn_mulmod_bnm1_next_size (dn);
+ mpn_mulmod_bnm1 (tp, tn, dp, dn, qp, in, scratch_out);
+ wn = dn + in - tn; /* number of wrapped limbs */
+ if (wn > 0)
+ {
+ c0 = mpn_sub_n (tp + tn, tp, np, wn);
+ mpn_decr_u (tp + wn, c0);
+ }
+ }
+
+ qp += in;
+ qn -= in;
+
+ cy = mpn_sub_n (rp, np + in, tp + in, dn);
+ mpn_mullo_n (qp, rp, ip, qn); /* high qn quotient limbs */
+
+ if (BELOW_THRESHOLD (qn, MUL_TO_MULMOD_BNM1_FOR_2NXN_THRESHOLD))
+ mpn_mul (tp, dp, dn, qp, qn); /* mulhigh */
+ else
+ {
+ tn = mpn_mulmod_bnm1_next_size (dn);
+ mpn_mulmod_bnm1 (tp, tn, dp, dn, qp, qn, scratch_out);
+ wn = dn + qn - tn; /* number of wrapped limbs */
+ if (wn > 0)
+ {
+ c0 = mpn_sub_n (tp + tn, tp, rp, wn);
+ mpn_decr_u (tp + wn, c0);
+ }
+ }
+
+ cy += mpn_sub_n (rp, rp + qn, tp + qn, dn - qn);
+ if (cy == 2)
+ {
+ mpn_incr_u (tp + dn, 1);
+ cy = 1;
+ }
+ return mpn_sub_nc (rp + dn - qn, np + dn + in, tp + dn, qn, cy);
+
+#undef ip
+#undef tp
+#undef scratch_out
+ }
+}
+
+mp_size_t
+mpn_mu_bdiv_qr_itch (mp_size_t nn, mp_size_t dn)
+{
+ mp_size_t qn, in, tn, itch_binvert, itch_out, itches;
+ mp_size_t b;
+
+ qn = nn - dn;
+
+ if (qn > dn)
+ {
+ b = (qn - 1) / dn + 1; /* ceil(qn/dn), number of blocks */
+ in = (qn - 1) / b + 1; /* ceil(qn/b) = ceil(qn / ceil(qn/dn)) */
+ if (BELOW_THRESHOLD (in, MUL_TO_MULMOD_BNM1_FOR_2NXN_THRESHOLD))
+ {
+ tn = dn + in;
+ itch_out = 0;
+ }
+ else
+ {
+ tn = mpn_mulmod_bnm1_next_size (dn);
+ itch_out = mpn_mulmod_bnm1_itch (tn, dn, in);
+ }
+ itch_binvert = mpn_binvert_itch (in);
+ itches = tn + itch_out;
+ return in + MAX (itches, itch_binvert);
+ }
+ else
+ {
+ in = qn - (qn >> 1);
+ if (BELOW_THRESHOLD (in, MUL_TO_MULMOD_BNM1_FOR_2NXN_THRESHOLD))
+ {
+ tn = dn + in;
+ itch_out = 0;
+ }
+ else
+ {
+ tn = mpn_mulmod_bnm1_next_size (dn);
+ itch_out = mpn_mulmod_bnm1_itch (tn, dn, in);
+ }
+ }
+ itch_binvert = mpn_binvert_itch (in);
+ itches = tn + itch_out;
+ return in + MAX (itches, itch_binvert);
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/mu_div_q.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/mu_div_q.c
new file mode 100644
index 00000000000..8768ba6c60c
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/mu_div_q.c
@@ -0,0 +1,185 @@
+/* mpn_mu_div_q.
+
+ Contributed to the GNU project by Torbjorn Granlund and Marco Bodrato.
+
+ 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 GMP RELEASE.
+
+Copyright 2005-2007, 2009, 2010, 2013 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/. */
+
+
+/*
+ The idea of the algorithm used herein is to compute a smaller inverted value
+ than used in the standard Barrett algorithm, and thus save time in the
+ Newton iterations, and pay just a small price when using the inverted value
+ for developing quotient bits. This algorithm was presented at ICMS 2006.
+*/
+
+/*
+ Things to work on:
+
+ 1. This is a rudimentary implementation of mpn_mu_div_q. The algorithm is
+ probably close to optimal, except when mpn_mu_divappr_q fails.
+
+ 2. We used to fall back to mpn_mu_div_qr when we detect a possible
+ mpn_mu_divappr_q rounding problem, now we multiply and compare.
+ Unfortunately, since mpn_mu_divappr_q does not return the partial
+ remainder, this also doesn't become optimal. A mpn_mu_divappr_qr could
+ solve that.
+
+ 3. The allocations done here should be made from the scratch area, which
+ then would need to be amended.
+*/
+
+#include <stdlib.h> /* for NULL */
+#include "gmp.h"
+#include "gmp-impl.h"
+
+
+mp_limb_t
+mpn_mu_div_q (mp_ptr qp,
+ mp_srcptr np, mp_size_t nn,
+ mp_srcptr dp, mp_size_t dn,
+ mp_ptr scratch)
+{
+ mp_ptr tp, rp;
+ mp_size_t qn;
+ mp_limb_t cy, qh;
+ TMP_DECL;
+
+ TMP_MARK;
+
+ qn = nn - dn;
+
+ tp = TMP_BALLOC_LIMBS (qn + 1);
+
+ if (qn >= dn) /* nn >= 2*dn + 1 */
+ {
+ /* |_______________________| dividend
+ |________| divisor */
+
+ rp = TMP_BALLOC_LIMBS (nn + 1);
+ MPN_COPY (rp + 1, np, nn);
+ rp[0] = 0;
+
+ qh = mpn_cmp (rp + 1 + nn - dn, dp, dn) >= 0;
+ if (qh != 0)
+ mpn_sub_n (rp + 1 + nn - dn, rp + 1 + nn - dn, dp, dn);
+
+ cy = mpn_mu_divappr_q (tp, rp, nn + 1, dp, dn, scratch);
+
+ if (UNLIKELY (cy != 0))
+ {
+ /* Since the partial remainder fed to mpn_preinv_mu_divappr_q was
+ canonically reduced, replace the returned value of B^(qn-dn)+eps
+ by the largest possible value. */
+ mp_size_t i;
+ for (i = 0; i < qn + 1; i++)
+ tp[i] = GMP_NUMB_MAX;
+ }
+
+ /* The max error of mpn_mu_divappr_q is +4. If the low quotient limb is
+ greater than the max error, we cannot trust the quotient. */
+ if (tp[0] > 4)
+ {
+ MPN_COPY (qp, tp + 1, qn);
+ }
+ else
+ {
+ mp_limb_t cy;
+ mp_ptr pp;
+
+ pp = rp;
+ mpn_mul (pp, tp + 1, qn, dp, dn);
+
+ cy = (qh != 0) ? mpn_add_n (pp + qn, pp + qn, dp, dn) : 0;
+
+ if (cy || mpn_cmp (pp, np, nn) > 0) /* At most is wrong by one, no cycle. */
+ qh -= mpn_sub_1 (qp, tp + 1, qn, 1);
+ else /* Same as above */
+ MPN_COPY (qp, tp + 1, qn);
+ }
+ }
+ else
+ {
+ /* |_______________________| dividend
+ |________________| divisor */
+
+ /* FIXME: When nn = 2dn-1, qn becomes dn-1, and the numerator size passed
+ here becomes 2dn, i.e., more than nn. This shouldn't hurt, since only
+ the most significant dn-1 limbs will actually be read, but it is not
+ pretty. */
+
+ qh = mpn_mu_divappr_q (tp, np + nn - (2 * qn + 2), 2 * qn + 2,
+ dp + dn - (qn + 1), qn + 1, scratch);
+
+ /* The max error of mpn_mu_divappr_q is +4, but we get an additional
+ error from the divisor truncation. */
+ if (tp[0] > 6)
+ {
+ MPN_COPY (qp, tp + 1, qn);
+ }
+ else
+ {
+ mp_limb_t cy;
+
+ /* FIXME: a shorter product should be enough; we may use already
+ allocated space... */
+ rp = TMP_BALLOC_LIMBS (nn);
+ mpn_mul (rp, dp, dn, tp + 1, qn);
+
+ cy = (qh != 0) ? mpn_add_n (rp + qn, rp + qn, dp, dn) : 0;
+
+ if (cy || mpn_cmp (rp, np, nn) > 0) /* At most is wrong by one, no cycle. */
+ qh -= mpn_sub_1 (qp, tp + 1, qn, 1);
+ else /* Same as above */
+ MPN_COPY (qp, tp + 1, qn);
+ }
+ }
+
+ TMP_FREE;
+ return qh;
+}
+
+mp_size_t
+mpn_mu_div_q_itch (mp_size_t nn, mp_size_t dn, int mua_k)
+{
+ mp_size_t qn;
+
+ qn = nn - dn;
+ if (qn >= dn)
+ {
+ return mpn_mu_divappr_q_itch (nn + 1, dn, mua_k);
+ }
+ else
+ {
+ return mpn_mu_divappr_q_itch (2 * qn + 2, qn + 1, mua_k);
+ }
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/mu_div_qr.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/mu_div_qr.c
new file mode 100644
index 00000000000..f4700a1ea67
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/mu_div_qr.c
@@ -0,0 +1,416 @@
+/* mpn_mu_div_qr, mpn_preinv_mu_div_qr.
+
+ Compute Q = floor(N / D) and R = N-QD. N is nn limbs and D is dn limbs and
+ must be normalized, and Q must be nn-dn limbs. The requirement that Q is
+ nn-dn limbs (and not nn-dn+1 limbs) was put in place in order to allow us to
+ let N be unmodified during the operation.
+
+ 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 GMP RELEASE.
+
+Copyright 2005-2007, 2009, 2010 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/. */
+
+
+/*
+ The idea of the algorithm used herein is to compute a smaller inverted value
+ than used in the standard Barrett algorithm, and thus save time in the
+ Newton iterations, and pay just a small price when using the inverted value
+ for developing quotient bits. This algorithm was presented at ICMS 2006.
+*/
+
+/* CAUTION: This code and the code in mu_divappr_q.c should be edited in sync.
+
+ Things to work on:
+
+ * This isn't optimal when the quotient isn't needed, as it might take a lot
+ of space. The computation is always needed, though, so there is no time to
+ save with special code.
+
+ * The itch/scratch scheme isn't perhaps such a good idea as it once seemed,
+ demonstrated by the fact that the mpn_invertappr function's scratch needs
+ mean that we need to keep a large allocation long after it is needed.
+ Things are worse as mpn_mul_fft does not accept any scratch parameter,
+ which means we'll have a large memory hole while in mpn_mul_fft. In
+ general, a peak scratch need in the beginning of a function isn't
+ well-handled by the itch/scratch scheme.
+*/
+
+#ifdef STAT
+#undef STAT
+#define STAT(x) x
+#else
+#define STAT(x)
+#endif
+
+#include <stdlib.h> /* for NULL */
+#include "gmp.h"
+#include "gmp-impl.h"
+
+
+/* FIXME: The MU_DIV_QR_SKEW_THRESHOLD was not analysed properly. It gives a
+ speedup according to old measurements, but does the decision mechanism
+ really make sense? It seem like the quotient between dn and qn might be
+ what we really should be checking. */
+#ifndef MU_DIV_QR_SKEW_THRESHOLD
+#define MU_DIV_QR_SKEW_THRESHOLD 100
+#endif
+
+#ifdef CHECK /* FIXME: Enable in minithres */
+#undef MU_DIV_QR_SKEW_THRESHOLD
+#define MU_DIV_QR_SKEW_THRESHOLD 1
+#endif
+
+
+static mp_limb_t mpn_mu_div_qr2 (mp_ptr, mp_ptr, mp_srcptr, mp_size_t, mp_srcptr, mp_size_t, mp_ptr);
+
+
+mp_limb_t
+mpn_mu_div_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_size_t qn;
+ mp_limb_t cy, qh;
+
+ qn = nn - dn;
+ if (qn + MU_DIV_QR_SKEW_THRESHOLD < dn)
+ {
+ /* |______________|_ign_first__| dividend nn
+ |_______|_ign_first__| divisor dn
+
+ |______| quotient (prel) qn
+
+ |___________________| quotient * ignored-divisor-part dn-1
+ */
+
+ /* Compute a preliminary quotient and a partial remainder by dividing the
+ most significant limbs of each operand. */
+ qh = mpn_mu_div_qr2 (qp, rp + nn - (2 * qn + 1),
+ np + nn - (2 * qn + 1), 2 * qn + 1,
+ dp + dn - (qn + 1), qn + 1,
+ scratch);
+
+ /* Multiply the quotient by the divisor limbs ignored above. */
+ if (dn - (qn + 1) > qn)
+ mpn_mul (scratch, dp, dn - (qn + 1), qp, qn); /* prod is dn-1 limbs */
+ else
+ mpn_mul (scratch, qp, qn, dp, dn - (qn + 1)); /* prod is dn-1 limbs */
+
+ if (qh)
+ cy = mpn_add_n (scratch + qn, scratch + qn, dp, dn - (qn + 1));
+ else
+ cy = 0;
+ scratch[dn - 1] = cy;
+
+ cy = mpn_sub_n (rp, np, scratch, nn - (2 * qn + 1));
+ cy = mpn_sub_nc (rp + nn - (2 * qn + 1),
+ rp + nn - (2 * qn + 1),
+ scratch + nn - (2 * qn + 1),
+ qn + 1, cy);
+ if (cy)
+ {
+ qh -= mpn_sub_1 (qp, qp, qn, 1);
+ mpn_add_n (rp, rp, dp, dn);
+ }
+ }
+ else
+ {
+ qh = mpn_mu_div_qr2 (qp, rp, np, nn, dp, dn, scratch);
+ }
+
+ return qh;
+}
+
+static mp_limb_t
+mpn_mu_div_qr2 (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, in;
+ mp_limb_t cy, qh;
+ mp_ptr ip, tp;
+
+ ASSERT (dn > 1);
+
+ qn = nn - dn;
+
+ /* Compute the inverse size. */
+ in = mpn_mu_div_qr_choose_in (qn, dn, 0);
+ ASSERT (in <= dn);
+
+#if 1
+ /* This alternative inverse computation method gets slightly more accurate
+ results. FIXMEs: (1) Temp allocation needs not analysed (2) itch function
+ not adapted (3) mpn_invertappr scratch needs not met. */
+ ip = scratch;
+ tp = scratch + in + 1;
+
+ /* compute an approximate inverse on (in+1) limbs */
+ if (dn == in)
+ {
+ MPN_COPY (tp + 1, dp, in);
+ tp[0] = 1;
+ mpn_invertappr (ip, tp, in + 1, NULL);
+ MPN_COPY_INCR (ip, ip + 1, in);
+ }
+ else
+ {
+ cy = mpn_add_1 (tp, dp + dn - (in + 1), in + 1, 1);
+ if (UNLIKELY (cy != 0))
+ MPN_ZERO (ip, in);
+ else
+ {
+ mpn_invertappr (ip, tp, in + 1, NULL);
+ MPN_COPY_INCR (ip, ip + 1, in);
+ }
+ }
+#else
+ /* This older inverse computation method gets slightly worse results than the
+ one above. */
+ ip = scratch;
+ tp = scratch + in;
+
+ /* Compute inverse of D to in+1 limbs, then round to 'in' limbs. Ideally the
+ inversion function should do this automatically. */
+ if (dn == in)
+ {
+ tp[in + 1] = 0;
+ MPN_COPY (tp + in + 2, dp, in);
+ mpn_invertappr (tp, tp + in + 1, in + 1, NULL);
+ }
+ else
+ {
+ mpn_invertappr (tp, dp + dn - (in + 1), in + 1, NULL);
+ }
+ cy = mpn_sub_1 (tp, tp, in + 1, GMP_NUMB_HIGHBIT);
+ if (UNLIKELY (cy != 0))
+ MPN_ZERO (tp + 1, in);
+ MPN_COPY (ip, tp + 1, in);
+#endif
+
+ qh = mpn_preinv_mu_div_qr (qp, rp, np, nn, dp, dn, ip, in, scratch + in);
+
+ return qh;
+}
+
+mp_limb_t
+mpn_preinv_mu_div_qr (mp_ptr qp,
+ mp_ptr rp,
+ mp_srcptr np,
+ mp_size_t nn,
+ mp_srcptr dp,
+ mp_size_t dn,
+ mp_srcptr ip,
+ mp_size_t in,
+ mp_ptr scratch)
+{
+ mp_size_t qn;
+ mp_limb_t cy, cx, qh;
+ mp_limb_t r;
+ mp_size_t tn, wn;
+
+#define tp scratch
+#define scratch_out (scratch + tn)
+
+ qn = nn - dn;
+
+ np += qn;
+ qp += qn;
+
+ qh = mpn_cmp (np, dp, dn) >= 0;
+ if (qh != 0)
+ mpn_sub_n (rp, np, dp, dn);
+ else
+ MPN_COPY_INCR (rp, np, dn);
+
+ if (qn == 0)
+ return qh; /* Degenerate use. Should we allow this? */
+
+ while (qn > 0)
+ {
+ if (qn < in)
+ {
+ ip += in - qn;
+ in = qn;
+ }
+ np -= in;
+ qp -= in;
+
+ /* Compute the next block of quotient limbs by multiplying the inverse I
+ by the upper part of the partial remainder R. */
+ mpn_mul_n (tp, rp + dn - in, ip, in); /* mulhi */
+ cy = mpn_add_n (qp, tp + in, rp + dn - in, in); /* I's msb implicit */
+ ASSERT_ALWAYS (cy == 0);
+
+ qn -= in;
+
+ /* Compute the product of the quotient block and the divisor D, to be
+ subtracted from the partial remainder combined with new limbs from the
+ dividend N. We only really need the low dn+1 limbs. */
+
+ if (BELOW_THRESHOLD (in, MUL_TO_MULMOD_BNM1_FOR_2NXN_THRESHOLD))
+ mpn_mul (tp, dp, dn, qp, in); /* dn+in limbs, high 'in' cancels */
+ else
+ {
+ tn = mpn_mulmod_bnm1_next_size (dn + 1);
+ mpn_mulmod_bnm1 (tp, tn, dp, dn, qp, in, scratch_out);
+ wn = dn + in - tn; /* number of wrapped limbs */
+ if (wn > 0)
+ {
+ cy = mpn_sub_n (tp, tp, rp + dn - wn, wn);
+ cy = mpn_sub_1 (tp + wn, tp + wn, tn - wn, cy);
+ cx = mpn_cmp (rp + dn - in, tp + dn, tn - dn) < 0;
+ ASSERT_ALWAYS (cx >= cy);
+ mpn_incr_u (tp, cx - cy);
+ }
+ }
+
+ r = rp[dn - in] - tp[dn];
+
+ /* Subtract the product from the partial remainder combined with new
+ limbs from the dividend N, generating a new partial remainder R. */
+ if (dn != in)
+ {
+ cy = mpn_sub_n (tp, np, tp, in); /* get next 'in' limbs from N */
+ cy = mpn_sub_nc (tp + in, rp, tp + in, dn - in, cy);
+ MPN_COPY (rp, tp, dn); /* FIXME: try to avoid this */
+ }
+ else
+ {
+ cy = mpn_sub_n (rp, np, tp, in); /* get next 'in' limbs from N */
+ }
+
+ STAT (int i; int err = 0;
+ static int errarr[5]; static int err_rec; static int tot);
+
+ /* Check the remainder R and adjust the quotient as needed. */
+ r -= cy;
+ while (r != 0)
+ {
+ /* We loop 0 times with about 69% probability, 1 time with about 31%
+ probability, 2 times with about 0.6% probability, if inverse is
+ computed as recommended. */
+ mpn_incr_u (qp, 1);
+ cy = mpn_sub_n (rp, rp, dp, dn);
+ r -= cy;
+ STAT (err++);
+ }
+ if (mpn_cmp (rp, dp, dn) >= 0)
+ {
+ /* This is executed with about 76% probability. */
+ mpn_incr_u (qp, 1);
+ cy = mpn_sub_n (rp, rp, dp, dn);
+ STAT (err++);
+ }
+
+ STAT (
+ tot++;
+ errarr[err]++;
+ if (err > err_rec)
+ err_rec = err;
+ if (tot % 0x10000 == 0)
+ {
+ for (i = 0; i <= err_rec; i++)
+ printf (" %d(%.1f%%)", errarr[i], 100.0*errarr[i]/tot);
+ printf ("\n");
+ }
+ );
+ }
+
+ return qh;
+}
+
+/* In case k=0 (automatic choice), we distinguish 3 cases:
+ (a) dn < qn: in = ceil(qn / ceil(qn/dn))
+ (b) dn/3 < qn <= dn: in = ceil(qn / 2)
+ (c) qn < dn/3: in = qn
+ In all cases we have in <= dn.
+ */
+mp_size_t
+mpn_mu_div_qr_choose_in (mp_size_t qn, mp_size_t dn, int k)
+{
+ mp_size_t in;
+
+ if (k == 0)
+ {
+ mp_size_t b;
+ if (qn > dn)
+ {
+ /* Compute an inverse size that is a nice partition of the quotient. */
+ b = (qn - 1) / dn + 1; /* ceil(qn/dn), number of blocks */
+ in = (qn - 1) / b + 1; /* ceil(qn/b) = ceil(qn / ceil(qn/dn)) */
+ }
+ else if (3 * qn > dn)
+ {
+ in = (qn - 1) / 2 + 1; /* b = 2 */
+ }
+ else
+ {
+ in = (qn - 1) / 1 + 1; /* b = 1 */
+ }
+ }
+ else
+ {
+ mp_size_t xn;
+ xn = MIN (dn, qn);
+ in = (xn - 1) / k + 1;
+ }
+
+ return in;
+}
+
+mp_size_t
+mpn_mu_div_qr_itch (mp_size_t nn, mp_size_t dn, int mua_k)
+{
+ mp_size_t itch_local = mpn_mulmod_bnm1_next_size (dn + 1);
+ mp_size_t in = mpn_mu_div_qr_choose_in (nn - dn, dn, mua_k);
+ mp_size_t itch_out = mpn_mulmod_bnm1_itch (itch_local, dn, in);
+
+ return in + itch_local + itch_out;
+}
+
+mp_size_t
+mpn_preinv_mu_div_qr_itch (mp_size_t nn, mp_size_t dn, mp_size_t in)
+{
+ mp_size_t itch_local = mpn_mulmod_bnm1_next_size (dn + 1);
+ mp_size_t itch_out = mpn_mulmod_bnm1_itch (itch_local, dn, in);
+
+ return itch_local + itch_out;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/mu_divappr_q.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/mu_divappr_q.c
new file mode 100644
index 00000000000..c218b59fee4
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/mu_divappr_q.c
@@ -0,0 +1,363 @@
+/* mpn_mu_divappr_q, mpn_preinv_mu_divappr_q.
+
+ Compute Q = floor(N / D) + e. N is nn limbs, D is dn limbs and must be
+ normalized, and Q must be nn-dn limbs, 0 <= e <= 4. The requirement that Q
+ is nn-dn limbs (and not nn-dn+1 limbs) was put in place in order to allow us
+ to let N be unmodified during the operation.
+
+ 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 GMP RELEASE.
+
+Copyright 2005-2007, 2009, 2010 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/. */
+
+
+/*
+ The idea of the algorithm used herein is to compute a smaller inverted value
+ than used in the standard Barrett algorithm, and thus save time in the
+ Newton iterations, and pay just a small price when using the inverted value
+ for developing quotient bits. This algorithm was presented at ICMS 2006.
+*/
+
+/* CAUTION: This code and the code in mu_div_qr.c should be edited in sync.
+
+ Things to work on:
+
+ * The itch/scratch scheme isn't perhaps such a good idea as it once seemed,
+ demonstrated by the fact that the mpn_invertappr function's scratch needs
+ mean that we need to keep a large allocation long after it is needed.
+ Things are worse as mpn_mul_fft does not accept any scratch parameter,
+ which means we'll have a large memory hole while in mpn_mul_fft. In
+ general, a peak scratch need in the beginning of a function isn't
+ well-handled by the itch/scratch scheme.
+*/
+
+#ifdef STAT
+#undef STAT
+#define STAT(x) x
+#else
+#define STAT(x)
+#endif
+
+#include <stdlib.h> /* for NULL */
+#include "gmp.h"
+#include "gmp-impl.h"
+
+
+mp_limb_t
+mpn_mu_divappr_q (mp_ptr qp,
+ mp_srcptr np,
+ mp_size_t nn,
+ mp_srcptr dp,
+ mp_size_t dn,
+ mp_ptr scratch)
+{
+ mp_size_t qn, in;
+ mp_limb_t cy, qh;
+ mp_ptr ip, tp;
+
+ ASSERT (dn > 1);
+
+ qn = nn - dn;
+
+ /* If Q is smaller than D, truncate operands. */
+ if (qn + 1 < dn)
+ {
+ np += dn - (qn + 1);
+ nn -= dn - (qn + 1);
+ dp += dn - (qn + 1);
+ dn = qn + 1;
+ }
+
+ /* Compute the inverse size. */
+ in = mpn_mu_divappr_q_choose_in (qn, dn, 0);
+ ASSERT (in <= dn);
+
+#if 1
+ /* This alternative inverse computation method gets slightly more accurate
+ results. FIXMEs: (1) Temp allocation needs not analysed (2) itch function
+ not adapted (3) mpn_invertappr scratch needs not met. */
+ ip = scratch;
+ tp = scratch + in + 1;
+
+ /* compute an approximate inverse on (in+1) limbs */
+ if (dn == in)
+ {
+ MPN_COPY (tp + 1, dp, in);
+ tp[0] = 1;
+ mpn_invertappr (ip, tp, in + 1, NULL);
+ MPN_COPY_INCR (ip, ip + 1, in);
+ }
+ else
+ {
+ cy = mpn_add_1 (tp, dp + dn - (in + 1), in + 1, 1);
+ if (UNLIKELY (cy != 0))
+ MPN_ZERO (ip, in);
+ else
+ {
+ mpn_invertappr (ip, tp, in + 1, NULL);
+ MPN_COPY_INCR (ip, ip + 1, in);
+ }
+ }
+#else
+ /* This older inverse computation method gets slightly worse results than the
+ one above. */
+ ip = scratch;
+ tp = scratch + in;
+
+ /* Compute inverse of D to in+1 limbs, then round to 'in' limbs. Ideally the
+ inversion function should do this automatically. */
+ if (dn == in)
+ {
+ tp[in + 1] = 0;
+ MPN_COPY (tp + in + 2, dp, in);
+ mpn_invertappr (tp, tp + in + 1, in + 1, NULL);
+ }
+ else
+ {
+ mpn_invertappr (tp, dp + dn - (in + 1), in + 1, NULL);
+ }
+ cy = mpn_sub_1 (tp, tp, in + 1, GMP_NUMB_HIGHBIT);
+ if (UNLIKELY (cy != 0))
+ MPN_ZERO (tp + 1, in);
+ MPN_COPY (ip, tp + 1, in);
+#endif
+
+ qh = mpn_preinv_mu_divappr_q (qp, np, nn, dp, dn, ip, in, scratch + in);
+
+ return qh;
+}
+
+mp_limb_t
+mpn_preinv_mu_divappr_q (mp_ptr qp,
+ mp_srcptr np,
+ mp_size_t nn,
+ mp_srcptr dp,
+ mp_size_t dn,
+ mp_srcptr ip,
+ mp_size_t in,
+ mp_ptr scratch)
+{
+ mp_size_t qn;
+ mp_limb_t cy, cx, qh;
+ mp_limb_t r;
+ mp_size_t tn, wn;
+
+#define rp scratch
+#define tp (scratch + dn)
+#define scratch_out (scratch + dn + tn)
+
+ qn = nn - dn;
+
+ np += qn;
+ qp += qn;
+
+ qh = mpn_cmp (np, dp, dn) >= 0;
+ if (qh != 0)
+ mpn_sub_n (rp, np, dp, dn);
+ else
+ MPN_COPY (rp, np, dn);
+
+ if (qn == 0)
+ return qh; /* Degenerate use. Should we allow this? */
+
+ while (qn > 0)
+ {
+ if (qn < in)
+ {
+ ip += in - qn;
+ in = qn;
+ }
+ np -= in;
+ qp -= in;
+
+ /* Compute the next block of quotient limbs by multiplying the inverse I
+ by the upper part of the partial remainder R. */
+ mpn_mul_n (tp, rp + dn - in, ip, in); /* mulhi */
+ cy = mpn_add_n (qp, tp + in, rp + dn - in, in); /* I's msb implicit */
+ ASSERT_ALWAYS (cy == 0);
+
+ qn -= in;
+ if (qn == 0)
+ break;
+
+ /* Compute the product of the quotient block and the divisor D, to be
+ subtracted from the partial remainder combined with new limbs from the
+ dividend N. We only really need the low dn limbs. */
+
+ if (BELOW_THRESHOLD (in, MUL_TO_MULMOD_BNM1_FOR_2NXN_THRESHOLD))
+ mpn_mul (tp, dp, dn, qp, in); /* dn+in limbs, high 'in' cancels */
+ else
+ {
+ tn = mpn_mulmod_bnm1_next_size (dn + 1);
+ mpn_mulmod_bnm1 (tp, tn, dp, dn, qp, in, scratch_out);
+ wn = dn + in - tn; /* number of wrapped limbs */
+ if (wn > 0)
+ {
+ cy = mpn_sub_n (tp, tp, rp + dn - wn, wn);
+ cy = mpn_sub_1 (tp + wn, tp + wn, tn - wn, cy);
+ cx = mpn_cmp (rp + dn - in, tp + dn, tn - dn) < 0;
+ ASSERT_ALWAYS (cx >= cy);
+ mpn_incr_u (tp, cx - cy);
+ }
+ }
+
+ r = rp[dn - in] - tp[dn];
+
+ /* Subtract the product from the partial remainder combined with new
+ limbs from the dividend N, generating a new partial remainder R. */
+ if (dn != in)
+ {
+ cy = mpn_sub_n (tp, np, tp, in); /* get next 'in' limbs from N */
+ cy = mpn_sub_nc (tp + in, rp, tp + in, dn - in, cy);
+ MPN_COPY (rp, tp, dn); /* FIXME: try to avoid this */
+ }
+ else
+ {
+ cy = mpn_sub_n (rp, np, tp, in); /* get next 'in' limbs from N */
+ }
+
+ STAT (int i; int err = 0;
+ static int errarr[5]; static int err_rec; static int tot);
+
+ /* Check the remainder R and adjust the quotient as needed. */
+ r -= cy;
+ while (r != 0)
+ {
+ /* We loop 0 times with about 69% probability, 1 time with about 31%
+ probability, 2 times with about 0.6% probability, if inverse is
+ computed as recommended. */
+ mpn_incr_u (qp, 1);
+ cy = mpn_sub_n (rp, rp, dp, dn);
+ r -= cy;
+ STAT (err++);
+ }
+ if (mpn_cmp (rp, dp, dn) >= 0)
+ {
+ /* This is executed with about 76% probability. */
+ mpn_incr_u (qp, 1);
+ cy = mpn_sub_n (rp, rp, dp, dn);
+ STAT (err++);
+ }
+
+ STAT (
+ tot++;
+ errarr[err]++;
+ if (err > err_rec)
+ err_rec = err;
+ if (tot % 0x10000 == 0)
+ {
+ for (i = 0; i <= err_rec; i++)
+ printf (" %d(%.1f%%)", errarr[i], 100.0*errarr[i]/tot);
+ printf ("\n");
+ }
+ );
+ }
+
+ /* FIXME: We should perhaps be somewhat more elegant in our rounding of the
+ quotient. For now, just make sure the returned quotient is >= the real
+ quotient; add 3 with saturating arithmetic. */
+ qn = nn - dn;
+ cy += mpn_add_1 (qp, qp, qn, 3);
+ if (cy != 0)
+ {
+ if (qh != 0)
+ {
+ /* Return a quotient of just 1-bits, with qh set. */
+ mp_size_t i;
+ for (i = 0; i < qn; i++)
+ qp[i] = GMP_NUMB_MAX;
+ }
+ else
+ {
+ /* Propagate carry into qh. */
+ qh = 1;
+ }
+ }
+
+ return qh;
+}
+
+/* In case k=0 (automatic choice), we distinguish 3 cases:
+ (a) dn < qn: in = ceil(qn / ceil(qn/dn))
+ (b) dn/3 < qn <= dn: in = ceil(qn / 2)
+ (c) qn < dn/3: in = qn
+ In all cases we have in <= dn.
+ */
+mp_size_t
+mpn_mu_divappr_q_choose_in (mp_size_t qn, mp_size_t dn, int k)
+{
+ mp_size_t in;
+
+ if (k == 0)
+ {
+ mp_size_t b;
+ if (qn > dn)
+ {
+ /* Compute an inverse size that is a nice partition of the quotient. */
+ b = (qn - 1) / dn + 1; /* ceil(qn/dn), number of blocks */
+ in = (qn - 1) / b + 1; /* ceil(qn/b) = ceil(qn / ceil(qn/dn)) */
+ }
+ else if (3 * qn > dn)
+ {
+ in = (qn - 1) / 2 + 1; /* b = 2 */
+ }
+ else
+ {
+ in = (qn - 1) / 1 + 1; /* b = 1 */
+ }
+ }
+ else
+ {
+ mp_size_t xn;
+ xn = MIN (dn, qn);
+ in = (xn - 1) / k + 1;
+ }
+
+ return in;
+}
+
+mp_size_t
+mpn_mu_divappr_q_itch (mp_size_t nn, mp_size_t dn, int mua_k)
+{
+ mp_size_t qn, in, itch_local, itch_out;
+
+ qn = nn - dn;
+ if (qn + 1 < dn)
+ {
+ dn = qn + 1;
+ }
+ in = mpn_mu_divappr_q_choose_in (qn, dn, mua_k);
+
+ itch_local = mpn_mulmod_bnm1_next_size (dn + 1);
+ itch_out = mpn_mulmod_bnm1_itch (itch_local, dn, in);
+ return in + dn + itch_local + itch_out;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/mul.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/mul.c
new file mode 100644
index 00000000000..2d72df3d4d4
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/mul.c
@@ -0,0 +1,428 @@
+/* mpn_mul -- Multiply two natural numbers.
+
+ Contributed to the GNU project by Torbjorn Granlund.
+
+Copyright 1991, 1993, 1994, 1996, 1997, 1999-2003, 2005-2007, 2009, 2010, 2012
+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.h"
+#include "gmp-impl.h"
+
+
+#ifndef MUL_BASECASE_MAX_UN
+#define MUL_BASECASE_MAX_UN 500
+#endif
+
+/* Areas where the different toom algorithms can be called (extracted
+ from the t-toom*.c files, and ignoring small constant offsets):
+
+ 1/6 1/5 1/4 4/13 1/3 3/8 2/5 5/11 1/2 3/5 2/3 3/4 4/5 1 vn/un
+ 4/7 6/7
+ 6/11
+ |--------------------| toom22 (small)
+ || toom22 (large)
+ |xxxx| toom22 called
+ |-------------------------------------| toom32
+ |xxxxxxxxxxxxxxxx| | toom32 called
+ |------------| toom33
+ |x| toom33 called
+ |---------------------------------| | toom42
+ |xxxxxxxxxxxxxxxxxxxxxxxx| | toom42 called
+ |--------------------| toom43
+ |xxxxxxxxxx| toom43 called
+ |-----------------------------| toom52 (unused)
+ |--------| toom44
+ |xxxxxxxx| toom44 called
+ |--------------------| | toom53
+ |xxxxxx| toom53 called
+ |-------------------------| toom62 (unused)
+ |----------------| toom54 (unused)
+ |--------------------| toom63
+ |xxxxxxxxx| | toom63 called
+ |---------------------------------| toom6h
+ |xxxxxxxx| toom6h called
+ |-------------------------| toom8h (32 bit)
+ |------------------------------------------| toom8h (64 bit)
+ |xxxxxxxx| toom8h called
+*/
+
+#define TOOM33_OK(an,bn) (6 + 2 * an < 3 * bn)
+#define TOOM44_OK(an,bn) (12 + 3 * an < 4 * bn)
+
+/* Multiply the natural numbers u (pointed to by UP, with UN limbs) and v
+ (pointed to by VP, with VN limbs), and store the result at PRODP. The
+ result is UN + VN limbs. Return the most significant limb of the result.
+
+ NOTE: The space pointed to by PRODP is overwritten before finished with U
+ and V, so overlap is an error.
+
+ Argument constraints:
+ 1. UN >= VN.
+ 2. PRODP != UP and PRODP != VP, i.e. the destination must be distinct from
+ the multiplier and the multiplicand. */
+
+/*
+ * The cutoff lines in the toomX2 and toomX3 code are now exactly between the
+ ideal lines of the surrounding algorithms. Is that optimal?
+
+ * The toomX3 code now uses a structure similar to the one of toomX2, except
+ that it loops longer in the unbalanced case. The result is that the
+ remaining area might have un < vn. Should we fix the toomX2 code in a
+ similar way?
+
+ * The toomX3 code is used for the largest non-FFT unbalanced operands. It
+ therefore calls mpn_mul recursively for certain cases.
+
+ * Allocate static temp space using THRESHOLD variables (except for toom44
+ when !WANT_FFT). That way, we can typically have no TMP_ALLOC at all.
+
+ * We sort ToomX2 algorithms together, assuming the toom22, toom32, toom42
+ have the same vn threshold. This is not true, we should actually use
+ mul_basecase for slightly larger operands for toom32 than for toom22, and
+ even larger for toom42.
+
+ * 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,
+ mp_srcptr vp, mp_size_t vn)
+{
+ ASSERT (un >= vn);
+ ASSERT (vn >= 1);
+ ASSERT (! MPN_OVERLAP_P (prodp, un+vn, up, un));
+ ASSERT (! MPN_OVERLAP_P (prodp, un+vn, vp, vn));
+
+ if (un == vn)
+ {
+ if (up == vp)
+ mpn_sqr (prodp, up, un);
+ else
+ mpn_mul_n (prodp, up, vp, un);
+ }
+ else if (vn < MUL_TOOM22_THRESHOLD)
+ { /* plain schoolbook multiplication */
+
+ /* Unless un is very large, or else if have an applicable mpn_mul_N,
+ perform basecase multiply directly. */
+ if (un <= MUL_BASECASE_MAX_UN
+#if HAVE_NATIVE_mpn_mul_2
+ || vn <= 2
+#else
+ || vn == 1
+#endif
+ )
+ mpn_mul_basecase (prodp, up, un, vp, vn);
+ else
+ {
+ /* We have un >> MUL_BASECASE_MAX_UN > vn. For better memory
+ locality, split up[] into MUL_BASECASE_MAX_UN pieces and multiply
+ these pieces with the vp[] operand. After each such partial
+ multiplication (but the last) we copy the most significant vn
+ limbs into a temporary buffer since that part would otherwise be
+ overwritten by the next multiplication. After the next
+ multiplication, we add it back. This illustrates the situation:
+
+ -->vn<--
+ | |<------- un ------->|
+ _____________________|
+ X /|
+ /XX__________________/ |
+ _____________________ |
+ X / |
+ /XX__________________/ |
+ _____________________ |
+ / / |
+ /____________________/ |
+ ==================================================================
+
+ The parts marked with X are the parts whose sums are copied into
+ the temporary buffer. */
+
+ mp_limb_t tp[MUL_TOOM22_THRESHOLD_LIMIT];
+ mp_limb_t cy;
+ ASSERT (MUL_TOOM22_THRESHOLD <= MUL_TOOM22_THRESHOLD_LIMIT);
+
+ mpn_mul_basecase (prodp, up, MUL_BASECASE_MAX_UN, vp, vn);
+ prodp += MUL_BASECASE_MAX_UN;
+ MPN_COPY (tp, prodp, vn); /* preserve high triangle */
+ up += MUL_BASECASE_MAX_UN;
+ un -= MUL_BASECASE_MAX_UN;
+ while (un > MUL_BASECASE_MAX_UN)
+ {
+ mpn_mul_basecase (prodp, up, MUL_BASECASE_MAX_UN, vp, vn);
+ cy = mpn_add_n (prodp, prodp, tp, vn); /* add back preserved triangle */
+ mpn_incr_u (prodp + vn, cy);
+ prodp += MUL_BASECASE_MAX_UN;
+ MPN_COPY (tp, prodp, vn); /* preserve high triangle */
+ up += MUL_BASECASE_MAX_UN;
+ un -= MUL_BASECASE_MAX_UN;
+ }
+ if (un > vn)
+ {
+ mpn_mul_basecase (prodp, up, un, vp, vn);
+ }
+ else
+ {
+ ASSERT (un > 0);
+ mpn_mul_basecase (prodp, vp, vn, up, un);
+ }
+ cy = mpn_add_n (prodp, prodp, tp, vn); /* add back preserved triangle */
+ mpn_incr_u (prodp + vn, cy);
+ }
+ }
+ else if (BELOW_THRESHOLD (vn, MUL_TOOM33_THRESHOLD))
+ {
+ /* Use ToomX2 variants */
+ mp_ptr scratch;
+ TMP_SDECL; TMP_SMARK;
+
+ scratch = TMP_SALLOC_LIMBS (ITCH);
+
+ /* FIXME: This condition (repeated in the loop below) leaves from a vn*vn
+ square to a (3vn-1)*vn rectangle. Leaving such a rectangle is hardly
+ wise; we would get better balance by slightly moving the bound. We
+ will sometimes end up with un < vn, like in the X3 arm below. */
+ if (un >= 3 * vn)
+ {
+ mp_limb_t cy;
+ mp_ptr ws;
+
+ /* The maximum ws usage is for the mpn_mul result. */
+ ws = TMP_SALLOC_LIMBS (4 * vn);
+
+ mpn_toom42_mul (prodp, up, 2 * vn, vp, vn, scratch);
+ un -= 2 * vn;
+ up += 2 * vn;
+ prodp += 2 * vn;
+
+ while (un >= 3 * vn)
+ {
+ mpn_toom42_mul (ws, up, 2 * vn, vp, vn, scratch);
+ un -= 2 * vn;
+ up += 2 * vn;
+ cy = mpn_add_n (prodp, prodp, ws, vn);
+ MPN_COPY (prodp + vn, ws + vn, 2 * vn);
+ mpn_incr_u (prodp + vn, cy);
+ prodp += 2 * vn;
+ }
+
+ /* vn <= un < 3vn */
+
+ if (4 * un < 5 * vn)
+ mpn_toom22_mul (ws, up, un, vp, vn, scratch);
+ else if (4 * un < 7 * vn)
+ mpn_toom32_mul (ws, up, un, vp, vn, scratch);
+ else
+ mpn_toom42_mul (ws, up, un, vp, vn, scratch);
+
+ cy = mpn_add_n (prodp, prodp, ws, vn);
+ MPN_COPY (prodp + vn, ws + vn, un);
+ mpn_incr_u (prodp + vn, cy);
+ }
+ else
+ {
+ if (4 * un < 5 * vn)
+ mpn_toom22_mul (prodp, up, un, vp, vn, scratch);
+ else if (4 * un < 7 * vn)
+ mpn_toom32_mul (prodp, up, un, vp, vn, scratch);
+ else
+ mpn_toom42_mul (prodp, up, un, vp, vn, scratch);
+ }
+ TMP_SFREE;
+ }
+ else if (BELOW_THRESHOLD ((un + vn) >> 1, MUL_FFT_THRESHOLD) ||
+ BELOW_THRESHOLD (3 * vn, MUL_FFT_THRESHOLD))
+ {
+ /* Handle the largest operands that are not in the FFT range. The 2nd
+ condition makes very unbalanced operands avoid the FFT code (except
+ perhaps as coefficient products of the Toom code. */
+
+ if (BELOW_THRESHOLD (vn, MUL_TOOM44_THRESHOLD) || !TOOM44_OK (un, vn))
+ {
+ /* Use ToomX3 variants */
+ mp_ptr scratch;
+ TMP_SDECL; TMP_SMARK;
+
+ scratch = TMP_SALLOC_LIMBS (ITCH);
+
+ if (2 * un >= 5 * vn)
+ {
+ mp_limb_t cy;
+ mp_ptr ws;
+
+ /* The maximum ws usage is for the mpn_mul result. */
+ ws = TMP_SALLOC_LIMBS (7 * vn >> 1);
+
+ if (BELOW_THRESHOLD (vn, MUL_TOOM42_TO_TOOM63_THRESHOLD))
+ mpn_toom42_mul (prodp, up, 2 * vn, vp, vn, scratch);
+ else
+ mpn_toom63_mul (prodp, up, 2 * vn, vp, vn, scratch);
+ un -= 2 * vn;
+ up += 2 * vn;
+ prodp += 2 * vn;
+
+ while (2 * un >= 5 * vn) /* un >= 2.5vn */
+ {
+ if (BELOW_THRESHOLD (vn, MUL_TOOM42_TO_TOOM63_THRESHOLD))
+ mpn_toom42_mul (ws, up, 2 * vn, vp, vn, scratch);
+ else
+ mpn_toom63_mul (ws, up, 2 * vn, vp, vn, scratch);
+ un -= 2 * vn;
+ up += 2 * vn;
+ cy = mpn_add_n (prodp, prodp, ws, vn);
+ MPN_COPY (prodp + vn, ws + vn, 2 * vn);
+ mpn_incr_u (prodp + vn, cy);
+ prodp += 2 * vn;
+ }
+
+ /* vn / 2 <= un < 2.5vn */
+
+ if (un < vn)
+ mpn_mul (ws, vp, vn, up, un);
+ else
+ mpn_mul (ws, up, un, vp, vn);
+
+ cy = mpn_add_n (prodp, prodp, ws, vn);
+ MPN_COPY (prodp + vn, ws + vn, un);
+ mpn_incr_u (prodp + vn, cy);
+ }
+ else
+ {
+ if (6 * un < 7 * vn)
+ mpn_toom33_mul (prodp, up, un, vp, vn, scratch);
+ else if (2 * un < 3 * vn)
+ {
+ if (BELOW_THRESHOLD (vn, MUL_TOOM32_TO_TOOM43_THRESHOLD))
+ mpn_toom32_mul (prodp, up, un, vp, vn, scratch);
+ else
+ mpn_toom43_mul (prodp, up, un, vp, vn, scratch);
+ }
+ else if (6 * un < 11 * vn)
+ {
+ if (4 * un < 7 * vn)
+ {
+ if (BELOW_THRESHOLD (vn, MUL_TOOM32_TO_TOOM53_THRESHOLD))
+ mpn_toom32_mul (prodp, up, un, vp, vn, scratch);
+ else
+ mpn_toom53_mul (prodp, up, un, vp, vn, scratch);
+ }
+ else
+ {
+ if (BELOW_THRESHOLD (vn, MUL_TOOM42_TO_TOOM53_THRESHOLD))
+ mpn_toom42_mul (prodp, up, un, vp, vn, scratch);
+ else
+ mpn_toom53_mul (prodp, up, un, vp, vn, scratch);
+ }
+ }
+ else
+ {
+ if (BELOW_THRESHOLD (vn, MUL_TOOM42_TO_TOOM63_THRESHOLD))
+ mpn_toom42_mul (prodp, up, un, vp, vn, scratch);
+ else
+ mpn_toom63_mul (prodp, up, un, vp, vn, scratch);
+ }
+ }
+ TMP_SFREE;
+ }
+ else
+ {
+ mp_ptr scratch;
+ TMP_DECL; TMP_MARK;
+
+ if (BELOW_THRESHOLD (vn, MUL_TOOM6H_THRESHOLD))
+ {
+ scratch = TMP_ALLOC_LIMBS (mpn_toom44_mul_itch (un, vn));
+ mpn_toom44_mul (prodp, up, un, vp, vn, scratch);
+ }
+ else if (BELOW_THRESHOLD (vn, MUL_TOOM8H_THRESHOLD))
+ {
+ scratch = TMP_ALLOC_LIMBS (mpn_toom6h_mul_itch (un, vn));
+ mpn_toom6h_mul (prodp, up, un, vp, vn, scratch);
+ }
+ else
+ {
+ scratch = TMP_ALLOC_LIMBS (mpn_toom8h_mul_itch (un, vn));
+ mpn_toom8h_mul (prodp, up, un, vp, vn, scratch);
+ }
+ TMP_FREE;
+ }
+ }
+ else
+ {
+ if (un >= 8 * vn)
+ {
+ mp_limb_t cy;
+ mp_ptr ws;
+ TMP_DECL; TMP_MARK;
+
+ /* The maximum ws usage is for the mpn_mul result. */
+ ws = TMP_BALLOC_LIMBS (9 * vn >> 1);
+
+ mpn_fft_mul (prodp, up, 3 * vn, vp, vn);
+ un -= 3 * vn;
+ up += 3 * vn;
+ prodp += 3 * vn;
+
+ while (2 * un >= 7 * vn) /* un >= 3.5vn */
+ {
+ mpn_fft_mul (ws, up, 3 * vn, vp, vn);
+ un -= 3 * vn;
+ up += 3 * vn;
+ cy = mpn_add_n (prodp, prodp, ws, vn);
+ MPN_COPY (prodp + vn, ws + vn, 3 * vn);
+ mpn_incr_u (prodp + vn, cy);
+ prodp += 3 * vn;
+ }
+
+ /* vn / 2 <= un < 3.5vn */
+
+ if (un < vn)
+ mpn_mul (ws, vp, vn, up, un);
+ else
+ mpn_mul (ws, up, un, vp, vn);
+
+ cy = mpn_add_n (prodp, prodp, ws, vn);
+ MPN_COPY (prodp + vn, ws + vn, un);
+ mpn_incr_u (prodp + vn, cy);
+
+ TMP_FREE;
+ }
+ else
+ mpn_fft_mul (prodp, up, un, vp, vn);
+ }
+
+ return prodp[un + vn - 1]; /* historic */
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/mul_1.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/mul_1.c
new file mode 100644
index 00000000000..6b2ee59a2c9
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/mul_1.c
@@ -0,0 +1,97 @@
+/* mpn_mul_1 -- Multiply a limb vector with a single limb and store the
+ product in a second limb vector.
+
+Copyright 1991-1994, 1996, 2000-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/. */
+
+#include "gmp.h"
+#include "gmp-impl.h"
+#include "longlong.h"
+
+
+#if GMP_NAIL_BITS == 0
+
+mp_limb_t
+mpn_mul_1 (mp_ptr rp, mp_srcptr up, mp_size_t n, mp_limb_t vl)
+{
+ mp_limb_t ul, cl, hpl, lpl;
+
+ ASSERT (n >= 1);
+ ASSERT (MPN_SAME_OR_INCR_P (rp, up, n));
+
+ cl = 0;
+ do
+ {
+ ul = *up++;
+ umul_ppmm (hpl, lpl, ul, vl);
+
+ lpl += cl;
+ cl = (lpl < cl) + hpl;
+
+ *rp++ = lpl;
+ }
+ while (--n != 0);
+
+ return cl;
+}
+
+#endif
+
+#if GMP_NAIL_BITS >= 1
+
+mp_limb_t
+mpn_mul_1 (mp_ptr rp, mp_srcptr up, mp_size_t n, mp_limb_t vl)
+{
+ mp_limb_t shifted_vl, ul, lpl, hpl, prev_hpl, xw, cl, xl;
+
+ ASSERT (n >= 1);
+ ASSERT (MPN_SAME_OR_INCR_P (rp, up, n));
+ ASSERT_MPN (up, n);
+ ASSERT_LIMB (vl);
+
+ shifted_vl = vl << GMP_NAIL_BITS;
+ cl = 0;
+ prev_hpl = 0;
+ do
+ {
+ ul = *up++;
+
+ umul_ppmm (hpl, lpl, ul, shifted_vl);
+ lpl >>= GMP_NAIL_BITS;
+ xw = prev_hpl + lpl + cl;
+ cl = xw >> GMP_NUMB_BITS;
+ xl = xw & GMP_NUMB_MASK;
+ *rp++ = xl;
+ prev_hpl = hpl;
+ }
+ while (--n != 0);
+
+ return prev_hpl + cl;
+}
+
+#endif
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/mul_basecase.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/mul_basecase.c
new file mode 100644
index 00000000000..9309ef72c88
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/mul_basecase.c
@@ -0,0 +1,166 @@
+/* mpn_mul_basecase -- Internal routine to multiply two natural numbers
+ of length m and n.
+
+ THIS IS AN INTERNAL FUNCTION WITH A MUTABLE INTERFACE. IT IS ONLY
+ SAFE TO REACH THIS FUNCTION THROUGH DOCUMENTED INTERFACES.
+
+Copyright 1991-1994, 1996, 1997, 2000-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/. */
+
+#include "gmp.h"
+#include "gmp-impl.h"
+
+
+/* Multiply {up,usize} by {vp,vsize} and write the result to
+ {prodp,usize+vsize}. Must have usize>=vsize.
+
+ Note that prodp gets usize+vsize limbs stored, even if the actual result
+ only needs usize+vsize-1.
+
+ There's no good reason to call here with vsize>=MUL_TOOM22_THRESHOLD.
+ Currently this is allowed, but it might not be in the future.
+
+ This is the most critical code for multiplication. All multiplies rely
+ on this, both small and huge. Small ones arrive here immediately, huge
+ ones arrive here as this is the base case for Karatsuba's recursive
+ algorithm. */
+
+void
+mpn_mul_basecase (mp_ptr rp,
+ mp_srcptr up, mp_size_t un,
+ mp_srcptr vp, mp_size_t vn)
+{
+ ASSERT (un >= vn);
+ ASSERT (vn >= 1);
+ ASSERT (! MPN_OVERLAP_P (rp, un+vn, up, un));
+ ASSERT (! MPN_OVERLAP_P (rp, un+vn, vp, vn));
+
+ /* We first multiply by the low order limb (or depending on optional function
+ availability, limbs). This result can be stored, not added, to rp. We
+ also avoid a loop for zeroing this way. */
+
+#if HAVE_NATIVE_mpn_mul_2
+ if (vn >= 2)
+ {
+ rp[un + 1] = mpn_mul_2 (rp, up, un, vp);
+ rp += 2, vp += 2, vn -= 2;
+ }
+ else
+ {
+ rp[un] = mpn_mul_1 (rp, up, un, vp[0]);
+ return;
+ }
+#else
+ rp[un] = mpn_mul_1 (rp, up, un, vp[0]);
+ rp += 1, vp += 1, vn -= 1;
+#endif
+
+ /* Now accumulate the product of up[] and the next higher limb (or depending
+ on optional function availability, limbs) from vp[]. */
+
+#define MAX_LEFT MP_SIZE_T_MAX /* Used to simplify loops into if statements */
+
+
+#if HAVE_NATIVE_mpn_addmul_6
+ while (vn >= 6)
+ {
+ rp[un + 6 - 1] = mpn_addmul_6 (rp, up, un, vp);
+ if (MAX_LEFT == 6)
+ return;
+ rp += 6, vp += 6, vn -= 6;
+ if (MAX_LEFT < 2 * 6)
+ break;
+ }
+#undef MAX_LEFT
+#define MAX_LEFT (6 - 1)
+#endif
+
+#if HAVE_NATIVE_mpn_addmul_5
+ while (vn >= 5)
+ {
+ rp[un + 5 - 1] = mpn_addmul_5 (rp, up, un, vp);
+ if (MAX_LEFT == 5)
+ return;
+ rp += 5, vp += 5, vn -= 5;
+ if (MAX_LEFT < 2 * 5)
+ break;
+ }
+#undef MAX_LEFT
+#define MAX_LEFT (5 - 1)
+#endif
+
+#if HAVE_NATIVE_mpn_addmul_4
+ while (vn >= 4)
+ {
+ rp[un + 4 - 1] = mpn_addmul_4 (rp, up, un, vp);
+ if (MAX_LEFT == 4)
+ return;
+ rp += 4, vp += 4, vn -= 4;
+ if (MAX_LEFT < 2 * 4)
+ break;
+ }
+#undef MAX_LEFT
+#define MAX_LEFT (4 - 1)
+#endif
+
+#if HAVE_NATIVE_mpn_addmul_3
+ while (vn >= 3)
+ {
+ rp[un + 3 - 1] = mpn_addmul_3 (rp, up, un, vp);
+ if (MAX_LEFT == 3)
+ return;
+ rp += 3, vp += 3, vn -= 3;
+ if (MAX_LEFT < 2 * 3)
+ break;
+ }
+#undef MAX_LEFT
+#define MAX_LEFT (3 - 1)
+#endif
+
+#if HAVE_NATIVE_mpn_addmul_2
+ while (vn >= 2)
+ {
+ rp[un + 2 - 1] = mpn_addmul_2 (rp, up, un, vp);
+ if (MAX_LEFT == 2)
+ return;
+ rp += 2, vp += 2, vn -= 2;
+ if (MAX_LEFT < 2 * 2)
+ break;
+ }
+#undef MAX_LEFT
+#define MAX_LEFT (2 - 1)
+#endif
+
+ while (vn >= 1)
+ {
+ rp[un] = mpn_addmul_1 (rp, up, un, vp[0]);
+ if (MAX_LEFT == 1)
+ return;
+ rp += 1, vp += 1, vn -= 1;
+ }
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/mul_fft.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/mul_fft.c
new file mode 100644
index 00000000000..5e763a3a736
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/mul_fft.c
@@ -0,0 +1,1014 @@
+/* Schoenhage's fast multiplication modulo 2^N+1.
+
+ Contributed by Paul Zimmermann.
+
+ 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 1998-2010, 2012, 2013 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/. */
+
+
+/* References:
+
+ Schnelle Multiplikation grosser Zahlen, by Arnold Schoenhage and Volker
+ Strassen, Computing 7, p. 281-292, 1971.
+
+ Asymptotically fast algorithms for the numerical multiplication and division
+ of polynomials with complex coefficients, by Arnold Schoenhage, Computer
+ Algebra, EUROCAM'82, LNCS 144, p. 3-15, 1982.
+
+ Tapes versus Pointers, a study in implementing fast algorithms, by Arnold
+ Schoenhage, Bulletin of the EATCS, 30, p. 23-32, 1986.
+
+ TODO:
+
+ Implement some of the tricks published at ISSAC'2007 by Gaudry, Kruppa, and
+ Zimmermann.
+
+ It might be possible to avoid a small number of MPN_COPYs by using a
+ rotating temporary or two.
+
+ Cleanup and simplify the code!
+*/
+
+#ifdef TRACE
+#undef TRACE
+#define TRACE(x) x
+#include <stdio.h>
+#else
+#define TRACE(x)
+#endif
+
+#include "gmp.h"
+#include "gmp-impl.h"
+
+#ifdef WANT_ADDSUB
+#include "generic/add_n_sub_n.c"
+#define HAVE_NATIVE_mpn_add_n_sub_n 1
+#endif
+
+static mp_limb_t mpn_mul_fft_internal (mp_ptr, mp_size_t, int, mp_ptr *,
+ mp_ptr *, mp_ptr, mp_ptr, mp_size_t,
+ mp_size_t, mp_size_t, int **, mp_ptr, int);
+static void mpn_mul_fft_decompose (mp_ptr, mp_ptr *, mp_size_t, mp_size_t, mp_srcptr,
+ mp_size_t, mp_size_t, mp_size_t, mp_ptr);
+
+
+/* Find the best k to use for a mod 2^(m*GMP_NUMB_BITS)+1 FFT for m >= n.
+ We have sqr=0 if for a multiply, sqr=1 for a square.
+ There are three generations of this code; we keep the old ones as long as
+ some gmp-mparam.h is not updated. */
+
+
+/*****************************************************************************/
+
+#if TUNE_PROGRAM_BUILD || (defined (MUL_FFT_TABLE3) && defined (SQR_FFT_TABLE3))
+
+#ifndef FFT_TABLE3_SIZE /* When tuning this is defined in gmp-impl.h */
+#if defined (MUL_FFT_TABLE3_SIZE) && defined (SQR_FFT_TABLE3_SIZE)
+#if MUL_FFT_TABLE3_SIZE > SQR_FFT_TABLE3_SIZE
+#define FFT_TABLE3_SIZE MUL_FFT_TABLE3_SIZE
+#else
+#define FFT_TABLE3_SIZE SQR_FFT_TABLE3_SIZE
+#endif
+#endif
+#endif
+
+#ifndef FFT_TABLE3_SIZE
+#define FFT_TABLE3_SIZE 200
+#endif
+
+FFT_TABLE_ATTRS struct fft_table_nk mpn_fft_table3[2][FFT_TABLE3_SIZE] =
+{
+ MUL_FFT_TABLE3,
+ SQR_FFT_TABLE3
+};
+
+int
+mpn_fft_best_k (mp_size_t n, int sqr)
+{
+ FFT_TABLE_ATTRS struct fft_table_nk *fft_tab, *tab;
+ mp_size_t tab_n, thres;
+ int last_k;
+
+ fft_tab = mpn_fft_table3[sqr];
+ last_k = fft_tab->k;
+ for (tab = fft_tab + 1; ; tab++)
+ {
+ tab_n = tab->n;
+ thres = tab_n << last_k;
+ if (n <= thres)
+ break;
+ last_k = tab->k;
+ }
+ return last_k;
+}
+
+#define MPN_FFT_BEST_READY 1
+#endif
+
+/*****************************************************************************/
+
+#if ! defined (MPN_FFT_BEST_READY)
+FFT_TABLE_ATTRS mp_size_t mpn_fft_table[2][MPN_FFT_TABLE_SIZE] =
+{
+ MUL_FFT_TABLE,
+ SQR_FFT_TABLE
+};
+
+int
+mpn_fft_best_k (mp_size_t n, int sqr)
+{
+ int i;
+
+ for (i = 0; mpn_fft_table[sqr][i] != 0; i++)
+ if (n < mpn_fft_table[sqr][i])
+ return i + FFT_FIRST_K;
+
+ /* treat 4*last as one further entry */
+ if (i == 0 || n < 4 * mpn_fft_table[sqr][i - 1])
+ return i + FFT_FIRST_K;
+ else
+ return i + FFT_FIRST_K + 1;
+}
+#endif
+
+/*****************************************************************************/
+
+
+/* Returns smallest possible number of limbs >= pl for a fft of size 2^k,
+ i.e. smallest multiple of 2^k >= pl.
+
+ Don't declare static: needed by tuneup.
+*/
+
+mp_size_t
+mpn_fft_next_size (mp_size_t pl, int k)
+{
+ pl = 1 + ((pl - 1) >> k); /* ceil (pl/2^k) */
+ return pl << k;
+}
+
+
+/* Initialize l[i][j] with bitrev(j) */
+static void
+mpn_fft_initl (int **l, int k)
+{
+ int i, j, K;
+ int *li;
+
+ l[0][0] = 0;
+ for (i = 1, K = 1; i <= k; i++, K *= 2)
+ {
+ li = l[i];
+ for (j = 0; j < K; j++)
+ {
+ li[j] = 2 * l[i - 1][j];
+ li[K + j] = 1 + li[j];
+ }
+ }
+}
+
+
+/* r <- a*2^d mod 2^(n*GMP_NUMB_BITS)+1 with a = {a, n+1}
+ Assumes a is semi-normalized, i.e. a[n] <= 1.
+ r and a must have n+1 limbs, and not overlap.
+*/
+static void
+mpn_fft_mul_2exp_modF (mp_ptr r, mp_srcptr a, mp_bitcnt_t d, mp_size_t n)
+{
+ unsigned int sh;
+ mp_size_t m;
+ mp_limb_t cc, rd;
+
+ sh = d % GMP_NUMB_BITS;
+ m = d / GMP_NUMB_BITS;
+
+ if (m >= n) /* negate */
+ {
+ /* r[0..m-1] <-- lshift(a[n-m]..a[n-1], sh)
+ r[m..n-1] <-- -lshift(a[0]..a[n-m-1], sh) */
+
+ m -= n;
+ if (sh != 0)
+ {
+ /* no out shift below since a[n] <= 1 */
+ mpn_lshift (r, a + n - m, m + 1, sh);
+ rd = r[m];
+ cc = mpn_lshiftc (r + m, a, n - m, sh);
+ }
+ else
+ {
+ MPN_COPY (r, a + n - m, m);
+ rd = a[n];
+ mpn_com (r + m, a, n - m);
+ cc = 0;
+ }
+
+ /* add cc to r[0], and add rd to r[m] */
+
+ /* now add 1 in r[m], subtract 1 in r[n], i.e. add 1 in r[0] */
+
+ r[n] = 0;
+ /* cc < 2^sh <= 2^(GMP_NUMB_BITS-1) thus no overflow here */
+ cc++;
+ mpn_incr_u (r, cc);
+
+ rd++;
+ /* rd might overflow when sh=GMP_NUMB_BITS-1 */
+ cc = (rd == 0) ? 1 : rd;
+ r = r + m + (rd == 0);
+ mpn_incr_u (r, cc);
+ }
+ else
+ {
+ /* r[0..m-1] <-- -lshift(a[n-m]..a[n-1], sh)
+ r[m..n-1] <-- lshift(a[0]..a[n-m-1], sh) */
+ if (sh != 0)
+ {
+ /* no out bits below since a[n] <= 1 */
+ mpn_lshiftc (r, a + n - m, m + 1, sh);
+ rd = ~r[m];
+ /* {r, m+1} = {a+n-m, m+1} << sh */
+ cc = mpn_lshift (r + m, a, n - m, sh); /* {r+m, n-m} = {a, n-m}<<sh */
+ }
+ else
+ {
+ /* r[m] is not used below, but we save a test for m=0 */
+ mpn_com (r, a + n - m, m + 1);
+ rd = a[n];
+ MPN_COPY (r + m, a, n - m);
+ cc = 0;
+ }
+
+ /* now complement {r, m}, subtract cc from r[0], subtract rd from r[m] */
+
+ /* if m=0 we just have r[0]=a[n] << sh */
+ if (m != 0)
+ {
+ /* now add 1 in r[0], subtract 1 in r[m] */
+ if (cc-- == 0) /* then add 1 to r[0] */
+ cc = mpn_add_1 (r, r, n, CNST_LIMB(1));
+ cc = mpn_sub_1 (r, r, m, cc) + 1;
+ /* add 1 to cc instead of rd since rd might overflow */
+ }
+
+ /* now subtract cc and rd from r[m..n] */
+
+ r[n] = -mpn_sub_1 (r + m, r + m, n - m, cc);
+ r[n] -= mpn_sub_1 (r + m, r + m, n - m, rd);
+ if (r[n] & GMP_LIMB_HIGHBIT)
+ r[n] = mpn_add_1 (r, r, n, CNST_LIMB(1));
+ }
+}
+
+
+/* r <- a+b mod 2^(n*GMP_NUMB_BITS)+1.
+ Assumes a and b are semi-normalized.
+*/
+static inline void
+mpn_fft_add_modF (mp_ptr r, mp_srcptr a, mp_srcptr b, mp_size_t n)
+{
+ mp_limb_t c, x;
+
+ c = a[n] + b[n] + mpn_add_n (r, a, b, n);
+ /* 0 <= c <= 3 */
+
+#if 1
+ /* GCC 4.1 outsmarts most expressions here, and generates a 50% branch. The
+ result is slower code, of course. But the following outsmarts GCC. */
+ x = (c - 1) & -(c != 0);
+ r[n] = c - x;
+ MPN_DECR_U (r, n + 1, x);
+#endif
+#if 0
+ if (c > 1)
+ {
+ r[n] = 1; /* r[n] - c = 1 */
+ MPN_DECR_U (r, n + 1, c - 1);
+ }
+ else
+ {
+ r[n] = c;
+ }
+#endif
+}
+
+/* r <- a-b mod 2^(n*GMP_NUMB_BITS)+1.
+ Assumes a and b are semi-normalized.
+*/
+static inline void
+mpn_fft_sub_modF (mp_ptr r, mp_srcptr a, mp_srcptr b, mp_size_t n)
+{
+ mp_limb_t c, x;
+
+ c = a[n] - b[n] - mpn_sub_n (r, a, b, n);
+ /* -2 <= c <= 1 */
+
+#if 1
+ /* GCC 4.1 outsmarts most expressions here, and generates a 50% branch. The
+ result is slower code, of course. But the following outsmarts GCC. */
+ x = (-c) & -((c & GMP_LIMB_HIGHBIT) != 0);
+ r[n] = x + c;
+ MPN_INCR_U (r, n + 1, x);
+#endif
+#if 0
+ if ((c & GMP_LIMB_HIGHBIT) != 0)
+ {
+ r[n] = 0;
+ MPN_INCR_U (r, n + 1, -c);
+ }
+ else
+ {
+ r[n] = c;
+ }
+#endif
+}
+
+/* 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
+ output: A[inc*l[k][i]] <- \sum (2^omega)^(ij) A[inc*j] mod 2^N+1 */
+
+static void
+mpn_fft_fft (mp_ptr *Ap, mp_size_t K, int **ll,
+ mp_size_t omega, mp_size_t n, mp_size_t inc, mp_ptr tp)
+{
+ if (K == 2)
+ {
+ mp_limb_t cy;
+#if HAVE_NATIVE_mpn_add_n_sub_n
+ cy = mpn_add_n_sub_n (Ap[0], Ap[inc], Ap[0], Ap[inc], n + 1) & 1;
+#else
+ MPN_COPY (tp, Ap[0], n + 1);
+ mpn_add_n (Ap[0], Ap[0], Ap[inc], n + 1);
+ cy = mpn_sub_n (Ap[inc], tp, Ap[inc], n + 1);
+#endif
+ if (Ap[0][n] > 1) /* can be 2 or 3 */
+ Ap[0][n] = 1 - mpn_sub_1 (Ap[0], Ap[0], n, Ap[0][n] - 1);
+ if (cy) /* Ap[inc][n] can be -1 or -2 */
+ Ap[inc][n] = mpn_add_1 (Ap[inc], Ap[inc], n, ~Ap[inc][n] + 1);
+ }
+ else
+ {
+ mp_size_t j, K2 = K >> 1;
+ int *lk = *ll;
+
+ mpn_fft_fft (Ap, K2, ll-1, 2 * omega, n, inc * 2, tp);
+ mpn_fft_fft (Ap+inc, K2, ll-1, 2 * omega, n, inc * 2, tp);
+ /* A[2*j*inc] <- A[2*j*inc] + omega^l[k][2*j*inc] A[(2j+1)inc]
+ A[(2j+1)inc] <- A[2*j*inc] + omega^l[k][(2j+1)inc] A[(2j+1)inc] */
+ for (j = 0; j < K2; j++, lk += 2, Ap += 2 * inc)
+ {
+ /* 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);
+ mpn_fft_sub_modF (Ap[inc], Ap[0], tp, n);
+ mpn_fft_add_modF (Ap[0], Ap[0], tp, 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
+ output: A[inc*l[k][i]] <- \sum (2^omega)^(ij) A[inc*j] mod 2^N+1
+ tp must have space for 2*(n+1) limbs.
+*/
+
+
+/* Given ap[0..n] with ap[n]<=1, reduce it modulo 2^(n*GMP_NUMB_BITS)+1,
+ by subtracting that modulus if necessary.
+
+ If ap[0..n] is exactly 2^(n*GMP_NUMB_BITS) then mpn_sub_1 produces a
+ borrow and the limbs must be zeroed out again. This will occur very
+ infrequently. */
+
+static inline void
+mpn_fft_normalize (mp_ptr ap, mp_size_t n)
+{
+ if (ap[n] != 0)
+ {
+ MPN_DECR_U (ap, n + 1, CNST_LIMB(1));
+ if (ap[n] == 0)
+ {
+ /* This happens with very low probability; we have yet to trigger it,
+ and thereby make sure this code is correct. */
+ MPN_ZERO (ap, n);
+ ap[n] = 1;
+ }
+ else
+ ap[n] = 0;
+ }
+}
+
+/* a[i] <- a[i]*b[i] mod 2^(n*GMP_NUMB_BITS)+1 for 0 <= i < K */
+static void
+mpn_fft_mul_modF_K (mp_ptr *ap, mp_ptr *bp, mp_size_t n, mp_size_t K)
+{
+ int i;
+ int sqr = (ap == bp);
+ TMP_DECL;
+
+ TMP_MARK;
+
+ if (n >= (sqr ? SQR_FFT_MODF_THRESHOLD : MUL_FFT_MODF_THRESHOLD))
+ {
+ mp_size_t K2, nprime2, Nprime2, M2, maxLK, l, Mp2;
+ int k;
+ int **fft_l, *tmp;
+ mp_ptr *Ap, *Bp, A, B, T;
+
+ k = mpn_fft_best_k (n, sqr);
+ K2 = (mp_size_t) 1 << k;
+ ASSERT_ALWAYS((n & (K2 - 1)) == 0);
+ maxLK = (K2 > GMP_NUMB_BITS) ? K2 : GMP_NUMB_BITS;
+ M2 = n * GMP_NUMB_BITS >> k;
+ l = n >> k;
+ Nprime2 = ((2 * M2 + k + 2 + maxLK) / maxLK) * maxLK;
+ /* Nprime2 = ceil((2*M2+k+3)/maxLK)*maxLK*/
+ nprime2 = Nprime2 / GMP_NUMB_BITS;
+
+ /* we should ensure that nprime2 is a multiple of the next K */
+ if (nprime2 >= (sqr ? SQR_FFT_MODF_THRESHOLD : MUL_FFT_MODF_THRESHOLD))
+ {
+ mp_size_t K3;
+ for (;;)
+ {
+ K3 = (mp_size_t) 1 << mpn_fft_best_k (nprime2, sqr);
+ if ((nprime2 & (K3 - 1)) == 0)
+ break;
+ nprime2 = (nprime2 + K3 - 1) & -K3;
+ Nprime2 = nprime2 * GMP_LIMB_BITS;
+ /* warning: since nprime2 changed, K3 may change too! */
+ }
+ }
+ ASSERT_ALWAYS(nprime2 < n); /* otherwise we'll loop */
+
+ Mp2 = Nprime2 >> k;
+
+ Ap = TMP_BALLOC_MP_PTRS (K2);
+ Bp = TMP_BALLOC_MP_PTRS (K2);
+ A = TMP_BALLOC_LIMBS (2 * (nprime2 + 1) << k);
+ T = TMP_BALLOC_LIMBS (2 * (nprime2 + 1));
+ B = A + ((nprime2 + 1) << k);
+ fft_l = TMP_BALLOC_TYPE (k + 1, int *);
+ tmp = TMP_BALLOC_TYPE ((size_t) 2 << k, int);
+ for (i = 0; i <= k; i++)
+ {
+ fft_l[i] = tmp;
+ tmp += (mp_size_t) 1 << i;
+ }
+
+ mpn_fft_initl (fft_l, k);
+
+ TRACE (printf ("recurse: %ldx%ld limbs -> %ld times %ldx%ld (%1.2f)\n", n,
+ n, K2, nprime2, nprime2, 2.0*(double)n/nprime2/K2));
+ for (i = 0; i < K; i++, ap++, bp++)
+ {
+ mp_limb_t cy;
+ mpn_fft_normalize (*ap, n);
+ if (!sqr)
+ mpn_fft_normalize (*bp, n);
+
+ mpn_mul_fft_decompose (A, Ap, K2, nprime2, *ap, (l << k) + 1, l, Mp2, T);
+ if (!sqr)
+ mpn_mul_fft_decompose (B, Bp, K2, nprime2, *bp, (l << k) + 1, l, Mp2, T);
+
+ cy = mpn_mul_fft_internal (*ap, n, k, Ap, Bp, A, B, nprime2,
+ l, Mp2, fft_l, T, sqr);
+ (*ap)[n] = cy;
+ }
+ }
+ else
+ {
+ mp_ptr a, b, tp, tpn;
+ mp_limb_t cc;
+ mp_size_t n2 = 2 * n;
+ tp = TMP_BALLOC_LIMBS (n2);
+ tpn = tp + n;
+ TRACE (printf (" mpn_mul_n %ld of %ld limbs\n", K, n));
+ for (i = 0; i < K; i++)
+ {
+ a = *ap++;
+ b = *bp++;
+ if (sqr)
+ mpn_sqr (tp, a, n);
+ else
+ mpn_mul_n (tp, b, a, n);
+ if (a[n] != 0)
+ cc = mpn_add_n (tpn, tpn, b, n);
+ else
+ cc = 0;
+ if (b[n] != 0)
+ cc += mpn_add_n (tpn, tpn, a, n) + a[n];
+ if (cc != 0)
+ {
+ /* FIXME: use MPN_INCR_U here, since carry is not expected. */
+ cc = mpn_add_1 (tp, tp, n2, cc);
+ ASSERT (cc == 0);
+ }
+ a[n] = mpn_sub_n (a, tp, tpn, n) && mpn_add_1 (a, a, n, CNST_LIMB(1));
+ }
+ }
+ TMP_FREE;
+}
+
+
+/* input: A^[l[k][0]] A^[l[k][1]] ... A^[l[k][K-1]]
+ output: K*A[0] K*A[K-1] ... K*A[1].
+ Assumes the Ap[] are pseudo-normalized, i.e. 0 <= Ap[][n] <= 1.
+ This condition is also fulfilled at exit.
+*/
+static void
+mpn_fft_fftinv (mp_ptr *Ap, mp_size_t K, mp_size_t omega, mp_size_t n, mp_ptr tp)
+{
+ if (K == 2)
+ {
+ mp_limb_t cy;
+#if HAVE_NATIVE_mpn_add_n_sub_n
+ cy = mpn_add_n_sub_n (Ap[0], Ap[1], Ap[0], Ap[1], n + 1) & 1;
+#else
+ MPN_COPY (tp, Ap[0], n + 1);
+ mpn_add_n (Ap[0], Ap[0], Ap[1], n + 1);
+ cy = mpn_sub_n (Ap[1], tp, Ap[1], n + 1);
+#endif
+ if (Ap[0][n] > 1) /* can be 2 or 3 */
+ Ap[0][n] = 1 - mpn_sub_1 (Ap[0], Ap[0], n, Ap[0][n] - 1);
+ if (cy) /* Ap[1][n] can be -1 or -2 */
+ Ap[1][n] = mpn_add_1 (Ap[1], Ap[1], n, ~Ap[1][n] + 1);
+ }
+ else
+ {
+ mp_size_t j, K2 = K >> 1;
+
+ mpn_fft_fftinv (Ap, K2, 2 * omega, n, tp);
+ mpn_fft_fftinv (Ap + K2, K2, 2 * omega, n, tp);
+ /* A[j] <- A[j] + omega^j A[j+K/2]
+ A[j+K/2] <- A[j] + omega^(j+K/2) A[j+K/2] */
+ for (j = 0; j < K2; j++, Ap++)
+ {
+ /* 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);
+ mpn_fft_sub_modF (Ap[K2], Ap[0], tp, n);
+ mpn_fft_add_modF (Ap[0], Ap[0], tp, n);
+ }
+ }
+}
+
+
+/* R <- A/2^k mod 2^(n*GMP_NUMB_BITS)+1 */
+static void
+mpn_fft_div_2exp_modF (mp_ptr r, mp_srcptr a, mp_bitcnt_t k, mp_size_t n)
+{
+ mp_bitcnt_t i;
+
+ ASSERT (r != a);
+ i = (mp_bitcnt_t) 2 * n * GMP_NUMB_BITS - k;
+ mpn_fft_mul_2exp_modF (r, a, i, n);
+ /* 1/2^k = 2^(2nL-k) mod 2^(n*GMP_NUMB_BITS)+1 */
+ /* normalize so that R < 2^(n*GMP_NUMB_BITS)+1 */
+ mpn_fft_normalize (r, n);
+}
+
+
+/* {rp,n} <- {ap,an} mod 2^(n*GMP_NUMB_BITS)+1, n <= an <= 3*n.
+ Returns carry out, i.e. 1 iff {ap,an} = -1 mod 2^(n*GMP_NUMB_BITS)+1,
+ then {rp,n}=0.
+*/
+static mp_size_t
+mpn_fft_norm_modF (mp_ptr rp, mp_size_t n, mp_ptr ap, mp_size_t an)
+{
+ mp_size_t l, m, rpn;
+ mp_limb_t cc;
+
+ ASSERT ((n <= an) && (an <= 3 * n));
+ m = an - 2 * n;
+ if (m > 0)
+ {
+ l = n;
+ /* add {ap, m} and {ap+2n, m} in {rp, m} */
+ cc = mpn_add_n (rp, ap, ap + 2 * n, m);
+ /* copy {ap+m, n-m} to {rp+m, n-m} */
+ rpn = mpn_add_1 (rp + m, ap + m, n - m, cc);
+ }
+ else
+ {
+ l = an - n; /* l <= n */
+ MPN_COPY (rp, ap, n);
+ rpn = 0;
+ }
+
+ /* remains to subtract {ap+n, l} from {rp, n+1} */
+ cc = mpn_sub_n (rp, rp, ap + n, l);
+ rpn -= mpn_sub_1 (rp + l, rp + l, n - l, cc);
+ if (rpn < 0) /* necessarily rpn = -1 */
+ rpn = mpn_add_1 (rp, rp, n, CNST_LIMB(1));
+ return rpn;
+}
+
+/* store in A[0..nprime] the first M bits from {n, nl},
+ in A[nprime+1..] the following M bits, ...
+ Assumes M is a multiple of GMP_NUMB_BITS (M = l * GMP_NUMB_BITS).
+ T must have space for at least (nprime + 1) limbs.
+ We must have nl <= 2*K*l.
+*/
+static void
+mpn_mul_fft_decompose (mp_ptr A, mp_ptr *Ap, mp_size_t K, mp_size_t nprime,
+ mp_srcptr n, mp_size_t nl, mp_size_t l, mp_size_t Mp,
+ mp_ptr T)
+{
+ mp_size_t i, j;
+ mp_ptr tmp;
+ mp_size_t Kl = K * l;
+ TMP_DECL;
+ TMP_MARK;
+
+ if (nl > Kl) /* normalize {n, nl} mod 2^(Kl*GMP_NUMB_BITS)+1 */
+ {
+ mp_size_t dif = nl - Kl;
+ mp_limb_signed_t cy;
+
+ tmp = TMP_BALLOC_LIMBS(Kl + 1);
+
+ if (dif > Kl)
+ {
+ int subp = 0;
+
+ cy = mpn_sub_n (tmp, n, n + Kl, Kl);
+ n += 2 * Kl;
+ dif -= Kl;
+
+ /* now dif > 0 */
+ while (dif > Kl)
+ {
+ if (subp)
+ cy += mpn_sub_n (tmp, tmp, n, Kl);
+ else
+ cy -= mpn_add_n (tmp, tmp, n, Kl);
+ subp ^= 1;
+ n += Kl;
+ dif -= Kl;
+ }
+ /* now dif <= Kl */
+ if (subp)
+ cy += mpn_sub (tmp, tmp, Kl, n, dif);
+ else
+ cy -= mpn_add (tmp, tmp, Kl, n, dif);
+ if (cy >= 0)
+ cy = mpn_add_1 (tmp, tmp, Kl, cy);
+ else
+ cy = mpn_sub_1 (tmp, tmp, Kl, -cy);
+ }
+ else /* dif <= Kl, i.e. nl <= 2 * Kl */
+ {
+ cy = mpn_sub (tmp, n, Kl, n + Kl, dif);
+ cy = mpn_add_1 (tmp, tmp, Kl, cy);
+ }
+ tmp[Kl] = cy;
+ nl = Kl + 1;
+ n = tmp;
+ }
+ for (i = 0; i < K; i++)
+ {
+ Ap[i] = A;
+ /* store the next M bits of n into A[0..nprime] */
+ if (nl > 0) /* nl is the number of remaining limbs */
+ {
+ j = (l <= nl && i < K - 1) ? l : nl; /* store j next limbs */
+ nl -= j;
+ MPN_COPY (T, n, j);
+ MPN_ZERO (T + j, nprime + 1 - j);
+ n += l;
+ mpn_fft_mul_2exp_modF (A, T, i * Mp, nprime);
+ }
+ else
+ MPN_ZERO (A, nprime + 1);
+ A += nprime + 1;
+ }
+ ASSERT_ALWAYS (nl == 0);
+ TMP_FREE;
+}
+
+/* op <- n*m mod 2^N+1 with fft of size 2^k where N=pl*GMP_NUMB_BITS
+ op is pl limbs, its high bit is returned.
+ One must have pl = mpn_fft_next_size (pl, k).
+ T must have space for 2 * (nprime + 1) limbs.
+*/
+
+static mp_limb_t
+mpn_mul_fft_internal (mp_ptr op, mp_size_t pl, int k,
+ mp_ptr *Ap, mp_ptr *Bp, mp_ptr A, mp_ptr B,
+ mp_size_t nprime, mp_size_t l, mp_size_t Mp,
+ int **fft_l, mp_ptr T, int sqr)
+{
+ mp_size_t K, i, pla, lo, sh, j;
+ mp_ptr p;
+ mp_limb_t cc;
+
+ K = (mp_size_t) 1 << k;
+
+ /* direct fft's */
+ mpn_fft_fft (Ap, K, fft_l + k, 2 * Mp, nprime, 1, T);
+ if (!sqr)
+ mpn_fft_fft (Bp, K, fft_l + k, 2 * Mp, nprime, 1, T);
+
+ /* term to term multiplications */
+ mpn_fft_mul_modF_K (Ap, sqr ? Ap : Bp, nprime, K);
+
+ /* inverse fft's */
+ mpn_fft_fftinv (Ap, K, 2 * Mp, nprime, T);
+
+ /* division of terms after inverse fft */
+ Bp[0] = T + nprime + 1;
+ mpn_fft_div_2exp_modF (Bp[0], Ap[0], k, nprime);
+ for (i = 1; i < K; i++)
+ {
+ Bp[i] = Ap[i - 1];
+ mpn_fft_div_2exp_modF (Bp[i], Ap[i], k + (K - i) * Mp, nprime);
+ }
+
+ /* addition of terms in result p */
+ MPN_ZERO (T, nprime + 1);
+ pla = l * (K - 1) + nprime + 1; /* number of required limbs for p */
+ p = B; /* B has K*(n' + 1) limbs, which is >= pla, i.e. enough */
+ MPN_ZERO (p, pla);
+ cc = 0; /* will accumulate the (signed) carry at p[pla] */
+ for (i = K - 1, lo = l * i + nprime,sh = l * i; i >= 0; i--,lo -= l,sh -= l)
+ {
+ mp_ptr n = p + sh;
+
+ j = (K - i) & (K - 1);
+
+ if (mpn_add_n (n, n, Bp[j], nprime + 1))
+ cc += mpn_add_1 (n + nprime + 1, n + nprime + 1,
+ pla - sh - nprime - 1, CNST_LIMB(1));
+ T[2 * l] = i + 1; /* T = (i + 1)*2^(2*M) */
+ if (mpn_cmp (Bp[j], T, nprime + 1) > 0)
+ { /* subtract 2^N'+1 */
+ cc -= mpn_sub_1 (n, n, pla - sh, CNST_LIMB(1));
+ cc -= mpn_sub_1 (p + lo, p + lo, pla - lo, CNST_LIMB(1));
+ }
+ }
+ if (cc == -CNST_LIMB(1))
+ {
+ if ((cc = mpn_add_1 (p + pla - pl, p + pla - pl, pl, CNST_LIMB(1))))
+ {
+ /* p[pla-pl]...p[pla-1] are all zero */
+ mpn_sub_1 (p + pla - pl - 1, p + pla - pl - 1, pl + 1, CNST_LIMB(1));
+ mpn_sub_1 (p + pla - 1, p + pla - 1, 1, CNST_LIMB(1));
+ }
+ }
+ else if (cc == 1)
+ {
+ if (pla >= 2 * pl)
+ {
+ while ((cc = mpn_add_1 (p + pla - 2 * pl, p + pla - 2 * pl, 2 * pl, cc)))
+ ;
+ }
+ else
+ {
+ cc = mpn_sub_1 (p + pla - pl, p + pla - pl, pl, cc);
+ ASSERT (cc == 0);
+ }
+ }
+ else
+ ASSERT (cc == 0);
+
+ /* here p < 2^(2M) [K 2^(M(K-1)) + (K-1) 2^(M(K-2)) + ... ]
+ < K 2^(2M) [2^(M(K-1)) + 2^(M(K-2)) + ... ]
+ < K 2^(2M) 2^(M(K-1))*2 = 2^(M*K+M+k+1) */
+ return mpn_fft_norm_modF (op, pl, p, pla);
+}
+
+/* return the lcm of a and 2^k */
+static mp_bitcnt_t
+mpn_mul_fft_lcm (mp_bitcnt_t a, int k)
+{
+ mp_bitcnt_t l = k;
+
+ while (a % 2 == 0 && k > 0)
+ {
+ a >>= 1;
+ k --;
+ }
+ return a << l;
+}
+
+
+mp_limb_t
+mpn_mul_fft (mp_ptr op, mp_size_t pl,
+ mp_srcptr n, mp_size_t nl,
+ mp_srcptr m, mp_size_t ml,
+ int k)
+{
+ int i;
+ mp_size_t K, maxLK;
+ mp_size_t N, Nprime, nprime, M, Mp, l;
+ mp_ptr *Ap, *Bp, A, T, B;
+ int **fft_l, *tmp;
+ int sqr = (n == m && nl == ml);
+ mp_limb_t h;
+ TMP_DECL;
+
+ TRACE (printf ("\nmpn_mul_fft pl=%ld nl=%ld ml=%ld k=%d\n", pl, nl, ml, k));
+ ASSERT_ALWAYS (mpn_fft_next_size (pl, k) == pl);
+
+ TMP_MARK;
+ N = pl * GMP_NUMB_BITS;
+ fft_l = TMP_BALLOC_TYPE (k + 1, int *);
+ tmp = TMP_BALLOC_TYPE ((size_t) 2 << k, int);
+ for (i = 0; i <= k; i++)
+ {
+ fft_l[i] = tmp;
+ tmp += (mp_size_t) 1 << i;
+ }
+
+ mpn_fft_initl (fft_l, k);
+ K = (mp_size_t) 1 << k;
+ M = N >> k; /* N = 2^k M */
+ l = 1 + (M - 1) / GMP_NUMB_BITS;
+ maxLK = mpn_mul_fft_lcm (GMP_NUMB_BITS, k); /* lcm (GMP_NUMB_BITS, 2^k) */
+
+ Nprime = (1 + (2 * M + k + 2) / maxLK) * maxLK;
+ /* Nprime = ceil((2*M+k+3)/maxLK)*maxLK; */
+ nprime = Nprime / GMP_NUMB_BITS;
+ TRACE (printf ("N=%ld K=%ld, M=%ld, l=%ld, maxLK=%ld, Np=%ld, np=%ld\n",
+ N, K, M, l, maxLK, Nprime, nprime));
+ /* we should ensure that recursively, nprime is a multiple of the next K */
+ if (nprime >= (sqr ? SQR_FFT_MODF_THRESHOLD : MUL_FFT_MODF_THRESHOLD))
+ {
+ mp_size_t K2;
+ for (;;)
+ {
+ K2 = (mp_size_t) 1 << mpn_fft_best_k (nprime, sqr);
+ if ((nprime & (K2 - 1)) == 0)
+ break;
+ nprime = (nprime + K2 - 1) & -K2;
+ Nprime = nprime * GMP_LIMB_BITS;
+ /* warning: since nprime changed, K2 may change too! */
+ }
+ TRACE (printf ("new maxLK=%ld, Np=%ld, np=%ld\n", maxLK, Nprime, nprime));
+ }
+ ASSERT_ALWAYS (nprime < pl); /* otherwise we'll loop */
+
+ T = TMP_BALLOC_LIMBS (2 * (nprime + 1));
+ Mp = Nprime >> k;
+
+ TRACE (printf ("%ldx%ld limbs -> %ld times %ldx%ld limbs (%1.2f)\n",
+ pl, pl, K, nprime, nprime, 2.0 * (double) N / Nprime / K);
+ printf (" temp space %ld\n", 2 * K * (nprime + 1)));
+
+ A = TMP_BALLOC_LIMBS (K * (nprime + 1));
+ Ap = TMP_BALLOC_MP_PTRS (K);
+ mpn_mul_fft_decompose (A, Ap, K, nprime, n, nl, l, Mp, T);
+ if (sqr)
+ {
+ mp_size_t pla;
+ pla = l * (K - 1) + nprime + 1; /* number of required limbs for p */
+ B = TMP_BALLOC_LIMBS (pla);
+ Bp = TMP_BALLOC_MP_PTRS (K);
+ }
+ else
+ {
+ B = TMP_BALLOC_LIMBS (K * (nprime + 1));
+ Bp = TMP_BALLOC_MP_PTRS (K);
+ mpn_mul_fft_decompose (B, Bp, K, nprime, m, ml, l, Mp, T);
+ }
+ h = mpn_mul_fft_internal (op, pl, k, Ap, Bp, A, B, nprime, l, Mp, fft_l, T, sqr);
+
+ TMP_FREE;
+ return h;
+}
+
+#if WANT_OLD_FFT_FULL
+/* multiply {n, nl} by {m, ml}, and put the result in {op, nl+ml} */
+void
+mpn_mul_fft_full (mp_ptr op,
+ mp_srcptr n, mp_size_t nl,
+ mp_srcptr m, mp_size_t ml)
+{
+ mp_ptr pad_op;
+ mp_size_t pl, pl2, pl3, l;
+ mp_size_t cc, c2, oldcc;
+ int k2, k3;
+ int sqr = (n == m && nl == ml);
+
+ pl = nl + ml; /* total number of limbs of the result */
+
+ /* perform a fft mod 2^(2N)+1 and one mod 2^(3N)+1.
+ We must have pl3 = 3/2 * pl2, with pl2 a multiple of 2^k2, and
+ pl3 a multiple of 2^k3. Since k3 >= k2, both are multiples of 2^k2,
+ and pl2 must be an even multiple of 2^k2. Thus (pl2,pl3) =
+ (2*j*2^k2,3*j*2^k2), which works for 3*j <= pl/2^k2 <= 5*j.
+ We need that consecutive intervals overlap, i.e. 5*j >= 3*(j+1),
+ which requires j>=2. Thus this scheme requires pl >= 6 * 2^FFT_FIRST_K. */
+
+ /* ASSERT_ALWAYS(pl >= 6 * (1 << FFT_FIRST_K)); */
+
+ pl2 = (2 * pl - 1) / 5; /* ceil (2pl/5) - 1 */
+ do
+ {
+ pl2++;
+ k2 = mpn_fft_best_k (pl2, sqr); /* best fft size for pl2 limbs */
+ pl2 = mpn_fft_next_size (pl2, k2);
+ pl3 = 3 * pl2 / 2; /* since k>=FFT_FIRST_K=4, pl2 is a multiple of 2^4,
+ thus pl2 / 2 is exact */
+ k3 = mpn_fft_best_k (pl3, sqr);
+ }
+ while (mpn_fft_next_size (pl3, k3) != pl3);
+
+ TRACE (printf ("mpn_mul_fft_full nl=%ld ml=%ld -> pl2=%ld pl3=%ld k=%d\n",
+ nl, ml, pl2, pl3, k2));
+
+ ASSERT_ALWAYS(pl3 <= pl);
+ cc = mpn_mul_fft (op, pl3, n, nl, m, ml, k3); /* mu */
+ ASSERT(cc == 0);
+ pad_op = __GMP_ALLOCATE_FUNC_LIMBS (pl2);
+ cc = mpn_mul_fft (pad_op, pl2, n, nl, m, ml, k2); /* lambda */
+ cc = -cc + mpn_sub_n (pad_op, pad_op, op, pl2); /* lambda - low(mu) */
+ /* 0 <= cc <= 1 */
+ ASSERT(0 <= cc && cc <= 1);
+ l = pl3 - pl2; /* l = pl2 / 2 since pl3 = 3/2 * pl2 */
+ c2 = mpn_add_n (pad_op, pad_op, op + pl2, l);
+ cc = mpn_add_1 (pad_op + l, pad_op + l, l, (mp_limb_t) c2) - cc;
+ ASSERT(-1 <= cc && cc <= 1);
+ if (cc < 0)
+ cc = mpn_add_1 (pad_op, pad_op, pl2, (mp_limb_t) -cc);
+ ASSERT(0 <= cc && cc <= 1);
+ /* now lambda-mu = {pad_op, pl2} - cc mod 2^(pl2*GMP_NUMB_BITS)+1 */
+ 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
+ {
+ mp_ptr tmp;
+ TMP_DECL;
+
+ TMP_MARK;
+ tmp = TMP_BALLOC_LIMBS (l);
+ MPN_COPY (tmp, pad_op, l);
+ c2 = mpn_sub_n (pad_op, pad_op, pad_op + l, l);
+ cc += mpn_add_n (pad_op + l, tmp, pad_op + l, l);
+ TMP_FREE;
+ }
+#endif
+ c2 += oldcc;
+ /* first normalize {pad_op, pl2} before dividing by 2: c2 is the borrow
+ at pad_op + l, cc is the carry at pad_op + pl2 */
+ /* 0 <= cc <= 2 */
+ cc -= mpn_sub_1 (pad_op + l, pad_op + l, l, (mp_limb_t) c2);
+ /* -1 <= cc <= 2 */
+ if (cc > 0)
+ cc = -mpn_sub_1 (pad_op, pad_op, pl2, (mp_limb_t) cc);
+ /* now -1 <= cc <= 0 */
+ if (cc < 0)
+ cc = mpn_add_1 (pad_op, pad_op, pl2, (mp_limb_t) -cc);
+ /* now {pad_op, pl2} is normalized, with 0 <= cc <= 1 */
+ if (pad_op[0] & 1) /* if odd, add 2^(pl2*GMP_NUMB_BITS)+1 */
+ cc += 1 + mpn_add_1 (pad_op, pad_op, pl2, CNST_LIMB(1));
+ /* now 0 <= cc <= 2, but cc=2 cannot occur since it would give a carry
+ out below */
+ mpn_rshift (pad_op, pad_op, pl2, 1); /* divide by two */
+ if (cc) /* then cc=1 */
+ pad_op [pl2 - 1] |= (mp_limb_t) 1 << (GMP_NUMB_BITS - 1);
+ /* now {pad_op,pl2}-cc = (lambda-mu)/(1-2^(l*GMP_NUMB_BITS))
+ mod 2^(pl2*GMP_NUMB_BITS) + 1 */
+ c2 = mpn_add_n (op, op, pad_op, pl2); /* no need to add cc (is 0) */
+ /* since pl2+pl3 >= pl, necessary the extra limbs (including cc) are zero */
+ MPN_COPY (op + pl3, pad_op, pl - pl3);
+ ASSERT_MPN_ZERO_P (pad_op + pl - pl3, pl2 + pl3 - pl);
+ __GMP_FREE_FUNC_LIMBS (pad_op, pl2);
+ /* since the final result has at most pl limbs, no carry out below */
+ mpn_add_1 (op + pl2, op + pl2, pl - pl2, (mp_limb_t) c2);
+}
+#endif
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/mul_n.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/mul_n.c
new file mode 100644
index 00000000000..5df8b16fa01
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/mul_n.c
@@ -0,0 +1,97 @@
+/* mpn_mul_n -- multiply natural numbers.
+
+Copyright 1991, 1993, 1994, 1996-2003, 2005, 2008, 2009 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.h"
+#include "gmp-impl.h"
+#include "longlong.h"
+
+void
+mpn_mul_n (mp_ptr p, mp_srcptr a, mp_srcptr b, mp_size_t n)
+{
+ ASSERT (n >= 1);
+ ASSERT (! MPN_OVERLAP_P (p, 2 * n, a, n));
+ ASSERT (! MPN_OVERLAP_P (p, 2 * n, b, n));
+
+ if (BELOW_THRESHOLD (n, MUL_TOOM22_THRESHOLD))
+ {
+ mpn_mul_basecase (p, a, n, b, n);
+ }
+ else if (BELOW_THRESHOLD (n, MUL_TOOM33_THRESHOLD))
+ {
+ /* Allocate workspace of fixed size on stack: fast! */
+ mp_limb_t ws[mpn_toom22_mul_itch (MUL_TOOM33_THRESHOLD_LIMIT-1,
+ MUL_TOOM33_THRESHOLD_LIMIT-1)];
+ ASSERT (MUL_TOOM33_THRESHOLD <= MUL_TOOM33_THRESHOLD_LIMIT);
+ mpn_toom22_mul (p, a, n, b, n, ws);
+ }
+ else if (BELOW_THRESHOLD (n, MUL_TOOM44_THRESHOLD))
+ {
+ mp_ptr ws;
+ TMP_SDECL;
+ TMP_SMARK;
+ ws = TMP_SALLOC_LIMBS (mpn_toom33_mul_itch (n, n));
+ mpn_toom33_mul (p, a, n, b, n, ws);
+ TMP_SFREE;
+ }
+ else if (BELOW_THRESHOLD (n, MUL_TOOM6H_THRESHOLD))
+ {
+ mp_ptr ws;
+ TMP_SDECL;
+ TMP_SMARK;
+ ws = TMP_SALLOC_LIMBS (mpn_toom44_mul_itch (n, n));
+ mpn_toom44_mul (p, a, n, b, n, ws);
+ TMP_SFREE;
+ }
+ else if (BELOW_THRESHOLD (n, MUL_TOOM8H_THRESHOLD))
+ {
+ mp_ptr ws;
+ TMP_SDECL;
+ TMP_SMARK;
+ ws = TMP_SALLOC_LIMBS (mpn_toom6_mul_n_itch (n));
+ mpn_toom6h_mul (p, a, n, b, n, ws);
+ TMP_SFREE;
+ }
+ else if (BELOW_THRESHOLD (n, MUL_FFT_THRESHOLD))
+ {
+ mp_ptr ws;
+ TMP_DECL;
+ TMP_MARK;
+ ws = TMP_ALLOC_LIMBS (mpn_toom8_mul_n_itch (n));
+ mpn_toom8h_mul (p, a, n, b, n, ws);
+ TMP_FREE;
+ }
+ else
+ {
+ /* The current FFT code allocates its own space. That should probably
+ change. */
+ mpn_fft_mul (p, a, n, b, n);
+ }
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/mullo_basecase.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/mullo_basecase.c
new file mode 100644
index 00000000000..2120f44c3d8
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/mullo_basecase.c
@@ -0,0 +1,52 @@
+/* mpn_mullo_basecase -- Internal routine to multiply two natural
+ numbers of length m and n and return the low part.
+
+ THIS IS AN INTERNAL FUNCTION WITH A MUTABLE INTERFACE. IT IS ONLY
+ SAFE TO REACH THIS FUNCTION THROUGH DOCUMENTED INTERFACES.
+
+
+Copyright (C) 2000, 2002, 2004 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.h"
+#include "gmp-impl.h"
+
+/*
+ FIXME: Should use mpn_addmul_2 (and higher).
+*/
+
+void
+mpn_mullo_basecase (mp_ptr rp, mp_srcptr up, mp_srcptr vp, mp_size_t n)
+{
+ mp_size_t i;
+
+ mpn_mul_1 (rp, up, n, vp[0]);
+
+ for (i = 1; i < n; i++)
+ mpn_addmul_1 (rp + i, up, n - i, vp[i]);
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/mullo_n.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/mullo_n.c
new file mode 100644
index 00000000000..dad75ee8f76
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/mullo_n.c
@@ -0,0 +1,256 @@
+/* mpn_mullo_n -- multiply two n-limb numbers and return the low n limbs
+ of their products.
+
+ Contributed to the GNU project by Torbjorn Granlund and Marco Bodrato.
+
+ THIS IS (FOR NOW) AN INTERNAL FUNCTION. IT IS ONLY SAFE TO REACH THIS
+ FUNCTION THROUGH DOCUMENTED INTERFACES. IN FACT, IT IS ALMOST GUARANTEED
+ THAT IT'LL CHANGE OR DISAPPEAR IN A FUTURE GNU MP RELEASE.
+
+Copyright 2004, 2005, 2009, 2010, 2012 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.h"
+#include "gmp-impl.h"
+
+
+#ifndef MULLO_BASECASE_THRESHOLD
+#define MULLO_BASECASE_THRESHOLD 0 /* never use mpn_mul_basecase */
+#endif
+
+#ifndef MULLO_DC_THRESHOLD
+#define MULLO_DC_THRESHOLD 3*MUL_TOOM22_THRESHOLD
+#endif
+
+#ifndef MULLO_MUL_N_THRESHOLD
+#define MULLO_MUL_N_THRESHOLD MUL_FFT_THRESHOLD
+#endif
+
+#if TUNE_PROGRAM_BUILD || WANT_FAT_BINARY
+#define MAYBE_range_basecase 1
+#define MAYBE_range_toom22 1
+#else
+#define MAYBE_range_basecase \
+ ((MULLO_DC_THRESHOLD == 0 ? MULLO_BASECASE_THRESHOLD : MULLO_DC_THRESHOLD) < MUL_TOOM22_THRESHOLD*36/(36-11))
+#define MAYBE_range_toom22 \
+ ((MULLO_DC_THRESHOLD == 0 ? MULLO_BASECASE_THRESHOLD : MULLO_DC_THRESHOLD) < MUL_TOOM33_THRESHOLD*36/(36-11) )
+#endif
+
+/* THINK: The DC strategy uses different constants in different Toom's
+ ranges. Something smoother?
+*/
+
+/*
+ Compute the least significant half of the product {xy,n}*{yp,n}, or
+ formally {rp,n} = {xy,n}*{yp,n} Mod (B^n).
+
+ Above the given threshold, the Divide and Conquer strategy is used.
+ The operands are split in two, and a full product plus two mullo
+ are used to obtain the final result. The more natural strategy is to
+ split in two halves, but this is far from optimal when a
+ sub-quadratic multiplication is used.
+
+ Mulders suggests an unbalanced split in favour of the full product,
+ split n = n1 + n2, where an = n1 <= n2 = (1-a)n; i.e. 0 < a <= 1/2.
+
+ To compute the value of a, we assume that the cost of mullo for a
+ given size ML(n) is a fraction of the cost of a full product with
+ same size M(n), and the cost M(n)=n^e for some exponent 1 < e <= 2;
+ then we can write:
+
+ ML(n) = 2*ML(an) + M((1-a)n) => k*M(n) = 2*k*M(n)*a^e + M(n)*(1-a)^e
+
+ Given a value for e, want to minimise the value of k, i.e. the
+ function k=(1-a)^e/(1-2*a^e).
+
+ With e=2, the exponent for schoolbook multiplication, the minimum is
+ given by the values a=1-a=1/2.
+
+ With e=log(3)/log(2), the exponent for Karatsuba (aka toom22),
+ Mulders compute (1-a) = 0.694... and we approximate a with 11/36.
+
+ Other possible approximations follow:
+ e=log(5)/log(3) [Toom-3] -> a ~= 9/40
+ e=log(7)/log(4) [Toom-4] -> a ~= 7/39
+ e=log(11)/log(6) [Toom-6] -> a ~= 1/8
+ e=log(15)/log(8) [Toom-8] -> a ~= 1/10
+
+ The values above where obtained with the following trivial commands
+ in the gp-pari shell:
+
+fun(e,a)=(1-a)^e/(1-2*a^e)
+mul(a,b,c)={local(m,x,p);if(b-c<1/10000,(b+c)/2,m=1;x=b;forstep(p=c,b,(b-c)/8,if(fun(a,p)<m,m=fun(a,p);x=p));mul(a,(b+x)/2,(c+x)/2))}
+contfracpnqn(contfrac(mul(log(2*2-1)/log(2),1/2,0),5))
+contfracpnqn(contfrac(mul(log(3*2-1)/log(3),1/2,0),5))
+contfracpnqn(contfrac(mul(log(4*2-1)/log(4),1/2,0),5))
+contfracpnqn(contfrac(mul(log(6*2-1)/log(6),1/2,0),3))
+contfracpnqn(contfrac(mul(log(8*2-1)/log(8),1/2,0),3))
+
+ ,
+ |\
+ | \
+ +----,
+ | |
+ | |
+ | |\
+ | | \
+ +----+--`
+ ^ n2 ^n1^
+
+ For an actual implementation, the assumption that M(n)=n^e is
+ incorrect, as a consequence also the assumption that ML(n)=k*M(n)
+ with a constant k is wrong.
+
+ But theory suggest us two things:
+ - the best the multiplication product is (lower e), the more k
+ approaches 1, and a approaches 0.
+
+ - A value for a smaller than optimal is probably less bad than a
+ bigger one: e.g. let e=log(3)/log(2), a=0.3058_ the optimal
+ value, and k(a)=0.808_ the mul/mullo speed ratio. We get
+ k(a+1/6)=0.929_ but k(a-1/6)=0.865_.
+*/
+
+static mp_size_t
+mpn_mullo_n_itch (mp_size_t n)
+{
+ return 2*n;
+}
+
+/*
+ mpn_dc_mullo_n requires a scratch space of 2*n limbs at tp.
+ It accepts tp == rp.
+*/
+static void
+mpn_dc_mullo_n (mp_ptr rp, mp_srcptr xp, mp_srcptr yp, mp_size_t n, mp_ptr tp)
+{
+ mp_size_t n2, n1;
+ ASSERT (n >= 2);
+ ASSERT (! MPN_OVERLAP_P (rp, n, xp, n));
+ ASSERT (! MPN_OVERLAP_P (rp, n, yp, n));
+ ASSERT (MPN_SAME_OR_SEPARATE2_P(rp, n, tp, 2*n));
+
+ /* Divide-and-conquer */
+
+ /* We need fractional approximation of the value 0 < a <= 1/2
+ giving the minimum in the function k=(1-a)^e/(1-2*a^e).
+ */
+ if (MAYBE_range_basecase && BELOW_THRESHOLD (n, MUL_TOOM22_THRESHOLD*36/(36-11)))
+ n1 = n >> 1;
+ else if (MAYBE_range_toom22 && BELOW_THRESHOLD (n, MUL_TOOM33_THRESHOLD*36/(36-11)))
+ n1 = n * 11 / (size_t) 36; /* n1 ~= n*(1-.694...) */
+ else if (BELOW_THRESHOLD (n, MUL_TOOM44_THRESHOLD*40/(40-9)))
+ n1 = n * 9 / (size_t) 40; /* n1 ~= n*(1-.775...) */
+ else if (BELOW_THRESHOLD (n, MUL_TOOM8H_THRESHOLD*10/9))
+ n1 = n * 7 / (size_t) 39; /* n1 ~= n*(1-.821...) */
+ /* n1 = n * 4 / (size_t) 31; // n1 ~= n*(1-.871...) [TOOM66] */
+ else
+ n1 = n / (size_t) 10; /* n1 ~= n*(1-.899...) [TOOM88] */
+
+ n2 = n - n1;
+
+ /* Split as x = x1 2^(n2 GMP_NUMB_BITS) + x0,
+ y = y1 2^(n2 GMP_NUMB_BITS) + y0 */
+
+ /* x0 * y0 */
+ mpn_mul_n (tp, xp, yp, n2);
+ MPN_COPY (rp, tp, n2);
+
+ /* x1 * y0 * 2^(n2 GMP_NUMB_BITS) */
+ if (BELOW_THRESHOLD (n1, MULLO_BASECASE_THRESHOLD))
+ mpn_mul_basecase (tp + n, xp + n2, n1, yp, n1);
+ else if (BELOW_THRESHOLD (n1, MULLO_DC_THRESHOLD))
+ mpn_mullo_basecase (tp + n, xp + n2, yp, n1);
+ else
+ mpn_dc_mullo_n (tp + n, xp + n2, yp, n1, tp + n);
+ mpn_add_n (rp + n2, tp + n2, tp + n, n1);
+
+ /* x0 * y1 * 2^(n2 GMP_NUMB_BITS) */
+ if (BELOW_THRESHOLD (n1, MULLO_BASECASE_THRESHOLD))
+ mpn_mul_basecase (tp + n, xp, n1, yp + n2, n1);
+ else if (BELOW_THRESHOLD (n1, MULLO_DC_THRESHOLD))
+ mpn_mullo_basecase (tp + n, xp, yp + n2, n1);
+ else
+ mpn_dc_mullo_n (tp + n, xp, yp + n2, n1, tp + n);
+ mpn_add_n (rp + n2, rp + n2, tp + n, n1);
+}
+
+/* Avoid zero allocations when MULLO_BASECASE_THRESHOLD is 0. */
+#define MUL_BASECASE_ALLOC \
+ (MULLO_BASECASE_THRESHOLD_LIMIT == 0 ? 1 : 2*MULLO_BASECASE_THRESHOLD_LIMIT)
+
+/* FIXME: This function should accept a temporary area; dc_mullow_n
+ accepts a pointer tp, and handle the case tp == rp, do the same here.
+ Maybe recombine the two functions.
+ THINK: If mpn_mul_basecase is always faster than mpn_mullo_basecase
+ (typically thanks to mpn_addmul_2) should we unconditionally use
+ mpn_mul_n?
+*/
+
+void
+mpn_mullo_n (mp_ptr rp, mp_srcptr xp, mp_srcptr yp, mp_size_t n)
+{
+ ASSERT (n >= 1);
+ ASSERT (! MPN_OVERLAP_P (rp, n, xp, n));
+ ASSERT (! MPN_OVERLAP_P (rp, n, yp, n));
+
+ if (BELOW_THRESHOLD (n, MULLO_BASECASE_THRESHOLD))
+ {
+ /* Allocate workspace of fixed size on stack: fast! */
+ mp_limb_t tp[MUL_BASECASE_ALLOC];
+ mpn_mul_basecase (tp, xp, n, yp, n);
+ MPN_COPY (rp, tp, n);
+ }
+ else if (BELOW_THRESHOLD (n, MULLO_DC_THRESHOLD))
+ {
+ mpn_mullo_basecase (rp, xp, yp, n);
+ }
+ else
+ {
+ mp_ptr tp;
+ TMP_DECL;
+ TMP_MARK;
+ tp = TMP_ALLOC_LIMBS (mpn_mullo_n_itch (n));
+ if (BELOW_THRESHOLD (n, MULLO_MUL_N_THRESHOLD))
+ {
+ mpn_dc_mullo_n (rp, xp, yp, n, tp);
+ }
+ else
+ {
+ /* For really large operands, use plain mpn_mul_n but throw away upper n
+ limbs of result. */
+#if !TUNE_PROGRAM_BUILD && (MULLO_MUL_N_THRESHOLD > MUL_FFT_THRESHOLD)
+ mpn_fft_mul (tp, xp, n, yp, n);
+#else
+ mpn_mul_n (tp, xp, yp, n);
+#endif
+ MPN_COPY (rp, tp, n);
+ }
+ TMP_FREE;
+ }
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/mulmid.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/mulmid.c
new file mode 100644
index 00000000000..6b4ea3253dc
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/mulmid.c
@@ -0,0 +1,256 @@
+/* mpn_mulmid -- middle product
+
+ Contributed by David Harvey.
+
+ THE FUNCTION IN THIS FILE IS INTERNAL 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 2011 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.h"
+#include "gmp-impl.h"
+
+
+#define CHUNK (200 + MULMID_TOOM42_THRESHOLD)
+
+
+void
+mpn_mulmid (mp_ptr rp,
+ mp_srcptr ap, mp_size_t an,
+ mp_srcptr bp, mp_size_t bn)
+{
+ mp_size_t rn, k;
+ mp_ptr scratch, temp;
+
+ ASSERT (an >= bn);
+ ASSERT (bn >= 1);
+ ASSERT (! MPN_OVERLAP_P (rp, an - bn + 3, ap, an));
+ ASSERT (! MPN_OVERLAP_P (rp, an - bn + 3, bp, bn));
+
+ if (bn < MULMID_TOOM42_THRESHOLD)
+ {
+ /* region not tall enough to make toom42 worthwhile for any portion */
+
+ if (an < CHUNK)
+ {
+ /* region not too wide either, just call basecase directly */
+ mpn_mulmid_basecase (rp, ap, an, bp, bn);
+ return;
+ }
+
+ /* Region quite wide. For better locality, use basecase on chunks:
+
+ AAABBBCC..
+ .AAABBBCC.
+ ..AAABBBCC
+ */
+
+ k = CHUNK - bn + 1; /* number of diagonals per chunk */
+
+ /* first chunk (marked A in the above diagram) */
+ mpn_mulmid_basecase (rp, ap, CHUNK, bp, bn);
+
+ /* remaining chunks (B, C, etc) */
+ an -= k;
+
+ while (an >= CHUNK)
+ {
+ mp_limb_t t0, t1, cy;
+ ap += k, rp += k;
+ t0 = rp[0], t1 = rp[1];
+ mpn_mulmid_basecase (rp, ap, CHUNK, bp, bn);
+ ADDC_LIMB (cy, rp[0], rp[0], t0); /* add back saved limbs */
+ MPN_INCR_U (rp + 1, k + 1, t1 + cy);
+ an -= k;
+ }
+
+ if (an >= bn)
+ {
+ /* last remaining chunk */
+ mp_limb_t t0, t1, cy;
+ ap += k, rp += k;
+ t0 = rp[0], t1 = rp[1];
+ mpn_mulmid_basecase (rp, ap, an, bp, bn);
+ ADDC_LIMB (cy, rp[0], rp[0], t0);
+ MPN_INCR_U (rp + 1, an - bn + 2, t1 + cy);
+ }
+
+ return;
+ }
+
+ /* region is tall enough for toom42 */
+
+ rn = an - bn + 1;
+
+ if (rn < MULMID_TOOM42_THRESHOLD)
+ {
+ /* region not wide enough to make toom42 worthwhile for any portion */
+
+ TMP_DECL;
+
+ if (bn < CHUNK)
+ {
+ /* region not too tall either, just call basecase directly */
+ mpn_mulmid_basecase (rp, ap, an, bp, bn);
+ return;
+ }
+
+ /* Region quite tall. For better locality, use basecase on chunks:
+
+ AAAAA....
+ .AAAAA...
+ ..BBBBB..
+ ...BBBBB.
+ ....CCCCC
+ */
+
+ TMP_MARK;
+
+ temp = TMP_ALLOC_LIMBS (rn + 2);
+
+ /* first chunk (marked A in the above diagram) */
+ bp += bn - CHUNK, an -= bn - CHUNK;
+ mpn_mulmid_basecase (rp, ap, an, bp, CHUNK);
+
+ /* remaining chunks (B, C, etc) */
+ bn -= CHUNK;
+
+ while (bn >= CHUNK)
+ {
+ ap += CHUNK, bp -= CHUNK;
+ mpn_mulmid_basecase (temp, ap, an, bp, CHUNK);
+ mpn_add_n (rp, rp, temp, rn + 2);
+ bn -= CHUNK;
+ }
+
+ if (bn)
+ {
+ /* last remaining chunk */
+ ap += CHUNK, bp -= bn;
+ mpn_mulmid_basecase (temp, ap, rn + bn - 1, bp, bn);
+ mpn_add_n (rp, rp, temp, rn + 2);
+ }
+
+ TMP_FREE;
+ return;
+ }
+
+ /* we're definitely going to use toom42 somewhere */
+
+ if (bn > rn)
+ {
+ /* slice region into chunks, use toom42 on all chunks except possibly
+ the last:
+
+ AA....
+ .AA...
+ ..BB..
+ ...BB.
+ ....CC
+ */
+
+ TMP_DECL;
+ TMP_MARK;
+
+ temp = TMP_ALLOC_LIMBS (rn + 2 + mpn_toom42_mulmid_itch (rn));
+ scratch = temp + rn + 2;
+
+ /* first chunk (marked A in the above diagram) */
+ bp += bn - rn;
+ mpn_toom42_mulmid (rp, ap, bp, rn, scratch);
+
+ /* remaining chunks (B, C, etc) */
+ bn -= rn;
+
+ while (bn >= rn)
+ {
+ ap += rn, bp -= rn;
+ mpn_toom42_mulmid (temp, ap, bp, rn, scratch);
+ mpn_add_n (rp, rp, temp, rn + 2);
+ bn -= rn;
+ }
+
+ if (bn)
+ {
+ /* last remaining chunk */
+ ap += rn, bp -= bn;
+ mpn_mulmid (temp, ap, rn + bn - 1, bp, bn);
+ mpn_add_n (rp, rp, temp, rn + 2);
+ }
+
+ TMP_FREE;
+ }
+ else
+ {
+ /* slice region into chunks, use toom42 on all chunks except possibly
+ the last:
+
+ AAABBBCC..
+ .AAABBBCC.
+ ..AAABBBCC
+ */
+
+ TMP_DECL;
+ TMP_MARK;
+
+ scratch = TMP_ALLOC_LIMBS (mpn_toom42_mulmid_itch (bn));
+
+ /* first chunk (marked A in the above diagram) */
+ mpn_toom42_mulmid (rp, ap, bp, bn, scratch);
+
+ /* remaining chunks (B, C, etc) */
+ rn -= bn;
+
+ while (rn >= bn)
+ {
+ mp_limb_t t0, t1, cy;
+ ap += bn, rp += bn;
+ t0 = rp[0], t1 = rp[1];
+ mpn_toom42_mulmid (rp, ap, bp, bn, scratch);
+ ADDC_LIMB (cy, rp[0], rp[0], t0); /* add back saved limbs */
+ MPN_INCR_U (rp + 1, bn + 1, t1 + cy);
+ rn -= bn;
+ }
+
+ TMP_FREE;
+
+ if (rn)
+ {
+ /* last remaining chunk */
+ mp_limb_t t0, t1, cy;
+ ap += bn, rp += bn;
+ t0 = rp[0], t1 = rp[1];
+ mpn_mulmid (rp, ap, rn + bn - 1, bp, bn);
+ ADDC_LIMB (cy, rp[0], rp[0], t0);
+ MPN_INCR_U (rp + 1, rn + 1, t1 + cy);
+ }
+ }
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/mulmid_basecase.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/mulmid_basecase.c
new file mode 100644
index 00000000000..400e9764240
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/mulmid_basecase.c
@@ -0,0 +1,83 @@
+/* mpn_mulmid_basecase -- classical middle product algorithm
+
+ Contributed by David Harvey.
+
+ THE FUNCTION IN THIS FILE IS INTERNAL 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 2011 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.h"
+#include "gmp-impl.h"
+#include "longlong.h"
+
+/* Middle product of {up,un} and {vp,vn}, write result to {rp,un-vn+3}.
+ Must have un >= vn >= 1.
+
+ Neither input buffer may overlap with the output buffer. */
+
+void
+mpn_mulmid_basecase (mp_ptr rp,
+ mp_srcptr up, mp_size_t un,
+ mp_srcptr vp, mp_size_t vn)
+{
+ mp_limb_t lo, hi; /* last two limbs of output */
+ mp_limb_t cy;
+
+ ASSERT (un >= vn);
+ ASSERT (vn >= 1);
+ ASSERT (! MPN_OVERLAP_P (rp, un - vn + 3, up, un));
+ ASSERT (! MPN_OVERLAP_P (rp, un - vn + 3, vp, vn));
+
+ up += vn - 1;
+ un -= vn - 1;
+
+ /* multiply by first limb, store result */
+ lo = mpn_mul_1 (rp, up, un, vp[0]);
+ hi = 0;
+
+ /* accumulate remaining rows */
+ for (vn--; vn; vn--)
+ {
+ up--, vp++;
+ cy = mpn_addmul_1 (rp, up, un, vp[0]);
+ add_ssaaaa (hi, lo, hi, lo, CNST_LIMB(0), cy);
+ }
+
+ /* store final limbs */
+#if GMP_NAIL_BITS != 0
+ hi = (hi << GMP_NAIL_BITS) + (lo >> GMP_NUMB_BITS);
+ lo &= GMP_NUMB_MASK;
+#endif
+
+ rp[un] = lo;
+ rp[un + 1] = hi;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/mulmid_n.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/mulmid_n.c
new file mode 100644
index 00000000000..2280ba3a366
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/mulmid_n.c
@@ -0,0 +1,62 @@
+/* mpn_mulmid_n -- balanced middle product
+
+ Contributed by David Harvey.
+
+ THE FUNCTION IN THIS FILE IS INTERNAL 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 2011 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.h"
+#include "gmp-impl.h"
+
+
+void
+mpn_mulmid_n (mp_ptr rp, mp_srcptr ap, mp_srcptr bp, mp_size_t n)
+{
+ ASSERT (n >= 1);
+ ASSERT (! MPN_OVERLAP_P (rp, n + 2, ap, 2*n - 1));
+ ASSERT (! MPN_OVERLAP_P (rp, n + 2, bp, n));
+
+ if (n < MULMID_TOOM42_THRESHOLD)
+ {
+ mpn_mulmid_basecase (rp, ap, 2*n - 1, bp, n);
+ }
+ else
+ {
+ mp_ptr scratch;
+ TMP_DECL;
+ TMP_MARK;
+ scratch = TMP_ALLOC_LIMBS (mpn_toom42_mulmid_itch (n));
+ mpn_toom42_mulmid (rp, ap, bp, n, scratch);
+ TMP_FREE;
+ }
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/mulmod_bnm1.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/mulmod_bnm1.c
new file mode 100644
index 00000000000..87103245838
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/mulmod_bnm1.c
@@ -0,0 +1,355 @@
+/* mulmod_bnm1.c -- multiplication mod B^n-1.
+
+ Contributed to the GNU project by Niels Möller, Torbjorn Granlund and
+ Marco Bodrato.
+
+ 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 2009, 2010, 2012, 2013 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.h"
+#include "gmp-impl.h"
+#include "longlong.h"
+
+/* Inputs are {ap,rn} and {bp,rn}; output is {rp,rn}, computation is
+ mod B^rn - 1, and values are semi-normalised; zero is represented
+ as either 0 or B^n - 1. Needs a scratch of 2rn limbs at tp.
+ tp==rp is allowed. */
+void
+mpn_bc_mulmod_bnm1 (mp_ptr rp, mp_srcptr ap, mp_srcptr bp, mp_size_t rn,
+ mp_ptr tp)
+{
+ mp_limb_t cy;
+
+ ASSERT (0 < rn);
+
+ mpn_mul_n (tp, ap, bp, rn);
+ cy = mpn_add_n (rp, tp, tp + rn, rn);
+ /* If cy == 1, then the value of rp is at most B^rn - 2, so there can
+ * be no overflow when adding in the carry. */
+ MPN_INCR_U (rp, rn, cy);
+}
+
+
+/* Inputs are {ap,rn+1} and {bp,rn+1}; output is {rp,rn+1}, in
+ semi-normalised representation, computation is mod B^rn + 1. Needs
+ a scratch area of 2rn + 2 limbs at tp; tp == rp is allowed.
+ Output is normalised. */
+static void
+mpn_bc_mulmod_bnp1 (mp_ptr rp, mp_srcptr ap, mp_srcptr bp, mp_size_t rn,
+ mp_ptr tp)
+{
+ mp_limb_t cy;
+
+ ASSERT (0 < rn);
+
+ mpn_mul_n (tp, ap, bp, rn + 1);
+ ASSERT (tp[2*rn+1] == 0);
+ 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 );
+}
+
+
+/* Computes {rp,MIN(rn,an+bn)} <- {ap,an}*{bp,bn} Mod(B^rn-1)
+ *
+ * The result is expected to be ZERO if and only if one of the operand
+ * already is. Otherwise the class [0] Mod(B^rn-1) is represented by
+ * B^rn-1. This should not be a problem if mulmod_bnm1 is used to
+ * combine results and obtain a natural number when one knows in
+ * advance that the final value is less than (B^rn-1).
+ * Moreover it should not be a problem if mulmod_bnm1 is used to
+ * compute the full product with an+bn <= rn, because this condition
+ * implies (B^an-1)(B^bn-1) < (B^rn-1) .
+ *
+ * Requires 0 < bn <= an <= rn and an + bn > rn/2
+ * Scratch need: rn + (need for recursive call OR rn + 4). This gives
+ *
+ * S(n) <= rn + MAX (rn + 4, S(n/2)) <= 2rn + 4
+ */
+void
+mpn_mulmod_bnm1 (mp_ptr rp, mp_size_t rn, mp_srcptr ap, mp_size_t an, mp_srcptr bp, mp_size_t bn, mp_ptr tp)
+{
+ ASSERT (0 < bn);
+ ASSERT (bn <= an);
+ ASSERT (an <= rn);
+
+ if ((rn & 1) != 0 || BELOW_THRESHOLD (rn, MULMOD_BNM1_THRESHOLD))
+ {
+ if (UNLIKELY (bn < rn))
+ {
+ if (UNLIKELY (an + bn <= rn))
+ {
+ mpn_mul (rp, ap, an, bp, bn);
+ }
+ else
+ {
+ mp_limb_t cy;
+ mpn_mul (tp, ap, an, bp, bn);
+ cy = mpn_add (rp, tp, rn, tp + rn, an + bn - rn);
+ MPN_INCR_U (rp, rn, cy);
+ }
+ }
+ else
+ mpn_bc_mulmod_bnm1 (rp, ap, bp, rn, tp);
+ }
+ else
+ {
+ mp_size_t n;
+ mp_limb_t cy;
+ mp_limb_t hi;
+
+ n = rn >> 1;
+
+ /* We need at least an + bn >= n, to be able to fit one of the
+ recursive products at rp. Requiring strict inequality makes
+ the coded slightly simpler. If desired, we could avoid this
+ restriction by initially halving rn as long as rn is even and
+ an + bn <= rn/2. */
+
+ ASSERT (an + bn > n);
+
+ /* Compute xm = a*b mod (B^n - 1), xp = a*b mod (B^n + 1)
+ and crt together as
+
+ x = -xp * B^n + (B^n + 1) * [ (xp + xm)/2 mod (B^n-1)]
+ */
+
+#define a0 ap
+#define a1 (ap + n)
+#define b0 bp
+#define b1 (bp + n)
+
+#define xp tp /* 2n + 2 */
+ /* am1 maybe in {xp, n} */
+ /* bm1 maybe in {xp + n, n} */
+#define sp1 (tp + 2*n + 2)
+ /* ap1 maybe in {sp1, n + 1} */
+ /* bp1 maybe in {sp1 + n + 1, n + 1} */
+
+ {
+ mp_srcptr am1, bm1;
+ mp_size_t anm, bnm;
+ mp_ptr so;
+
+ bm1 = b0;
+ bnm = bn;
+ if (LIKELY (an > n))
+ {
+ am1 = xp;
+ cy = mpn_add (xp, a0, n, a1, an - n);
+ MPN_INCR_U (xp, n, cy);
+ anm = n;
+ so = xp + n;
+ if (LIKELY (bn > n))
+ {
+ bm1 = so;
+ cy = mpn_add (so, b0, n, b1, bn - n);
+ MPN_INCR_U (so, n, cy);
+ bnm = n;
+ so += n;
+ }
+ }
+ else
+ {
+ so = xp;
+ am1 = a0;
+ anm = an;
+ }
+
+ mpn_mulmod_bnm1 (rp, n, am1, anm, bm1, bnm, so);
+ }
+
+ {
+ int k;
+ mp_srcptr ap1, bp1;
+ mp_size_t anp, bnp;
+
+ bp1 = b0;
+ bnp = bn;
+ if (LIKELY (an > n)) {
+ ap1 = sp1;
+ cy = mpn_sub (sp1, a0, n, a1, an - n);
+ sp1[n] = 0;
+ MPN_INCR_U (sp1, n + 1, cy);
+ anp = n + ap1[n];
+ if (LIKELY (bn > n)) {
+ bp1 = sp1 + n + 1;
+ cy = mpn_sub (sp1 + n + 1, b0, n, b1, bn - n);
+ sp1[2*n+1] = 0;
+ MPN_INCR_U (sp1 + n + 1, n + 1, cy);
+ bnp = n + bp1[n];
+ }
+ } else {
+ ap1 = a0;
+ anp = an;
+ }
+
+ if (BELOW_THRESHOLD (n, MUL_FFT_MODF_THRESHOLD))
+ k=0;
+ else
+ {
+ int mask;
+ k = mpn_fft_best_k (n, 0);
+ mask = (1<<k) - 1;
+ while (n & mask) {k--; mask >>=1;};
+ }
+ if (k >= FFT_FIRST_K)
+ xp[n] = mpn_mul_fft (xp, n, ap1, anp, bp1, bnp, k);
+ else if (UNLIKELY (bp1 == b0))
+ {
+ ASSERT (anp + bnp <= 2*n+1);
+ ASSERT (anp + bnp > n);
+ ASSERT (anp >= bnp);
+ mpn_mul (xp, ap1, anp, bp1, bnp);
+ anp = anp + bnp - n;
+ ASSERT (anp <= n || xp[2*n]==0);
+ anp-= anp > n;
+ cy = mpn_sub (xp, xp, n, xp + n, anp);
+ xp[n] = 0;
+ MPN_INCR_U (xp, n+1, cy);
+ }
+ else
+ mpn_bc_mulmod_bnp1 (xp, ap1, bp1, n, xp);
+ }
+
+ /* Here the CRT recomposition begins.
+
+ xm <- (xp + xm)/2 = (xp + xm)B^n/2 mod (B^n-1)
+ Division by 2 is a bitwise rotation.
+
+ Assumes xp normalised mod (B^n+1).
+
+ The residue class [0] is represented by [B^n-1]; except when
+ both input are ZERO.
+ */
+
+#if HAVE_NATIVE_mpn_rsh1add_n || HAVE_NATIVE_mpn_rsh1add_nc
+#if HAVE_NATIVE_mpn_rsh1add_nc
+ cy = mpn_rsh1add_nc(rp, rp, xp, n, xp[n]); /* B^n = 1 */
+ hi = cy << (GMP_NUMB_BITS - 1);
+ cy = 0;
+ /* next update of rp[n-1] will set cy = 1 only if rp[n-1]+=hi
+ overflows, i.e. a further increment will not overflow again. */
+#else /* ! _nc */
+ cy = xp[n] + mpn_rsh1add_n(rp, rp, xp, n); /* B^n = 1 */
+ hi = (cy<<(GMP_NUMB_BITS-1))&GMP_NUMB_MASK; /* (cy&1) << ... */
+ cy >>= 1;
+ /* cy = 1 only if xp[n] = 1 i.e. {xp,n} = ZERO, this implies that
+ the rsh1add was a simple rshift: the top bit is 0. cy=1 => hi=0. */
+#endif
+#if GMP_NAIL_BITS == 0
+ add_ssaaaa(cy, rp[n-1], cy, rp[n-1], 0, hi);
+#else
+ cy += (hi & rp[n-1]) >> (GMP_NUMB_BITS-1);
+ rp[n-1] ^= hi;
+#endif
+#else /* ! HAVE_NATIVE_mpn_rsh1add_n */
+#if HAVE_NATIVE_mpn_add_nc
+ cy = mpn_add_nc(rp, rp, xp, n, xp[n]);
+#else /* ! _nc */
+ cy = xp[n] + mpn_add_n(rp, rp, xp, n); /* xp[n] == 1 implies {xp,n} == ZERO */
+#endif
+ cy += (rp[0]&1);
+ mpn_rshift(rp, rp, n, 1);
+ ASSERT (cy <= 2);
+ hi = (cy<<(GMP_NUMB_BITS-1))&GMP_NUMB_MASK; /* (cy&1) << ... */
+ cy >>= 1;
+ /* We can have cy != 0 only if hi = 0... */
+ ASSERT ((rp[n-1] & GMP_NUMB_HIGHBIT) == 0);
+ rp[n-1] |= hi;
+ /* ... rp[n-1] + cy can not overflow, the following INCR is correct. */
+#endif
+ ASSERT (cy <= 1);
+ /* Next increment can not overflow, read the previous comments about cy. */
+ ASSERT ((cy == 0) || ((rp[n-1] & GMP_NUMB_HIGHBIT) == 0));
+ MPN_INCR_U(rp, n, cy);
+
+ /* Compute the highest half:
+ ([(xp + xm)/2 mod (B^n-1)] - xp ) * B^n
+ */
+ if (UNLIKELY (an + bn < rn))
+ {
+ /* Note that in this case, the only way the result can equal
+ zero mod B^{rn} - 1 is if one of the inputs is zero, and
+ then the output of both the recursive calls and this CRT
+ reconstruction is zero, not B^{rn} - 1. Which is good,
+ since the latter representation doesn't fit in the output
+ area.*/
+ cy = mpn_sub_n (rp + n, rp, xp, an + bn - n);
+
+ /* FIXME: This subtraction of the high parts is not really
+ necessary, we do it to get the carry out, and for sanity
+ checking. */
+ cy = xp[n] + mpn_sub_nc (xp + an + bn - n, rp + an + bn - n,
+ xp + an + bn - n, rn - (an + bn), cy);
+ ASSERT (an + bn == rn - 1 ||
+ mpn_zero_p (xp + an + bn - n + 1, rn - 1 - (an + bn)));
+ cy = mpn_sub_1 (rp, rp, an + bn, cy);
+ ASSERT (cy == (xp + an + bn - n)[0]);
+ }
+ else
+ {
+ cy = xp[n] + mpn_sub_n (rp + n, rp, xp, n);
+ /* cy = 1 only if {xp,n+1} is not ZERO, i.e. {rp,n} is not ZERO.
+ DECR will affect _at most_ the lowest n limbs. */
+ MPN_DECR_U (rp, 2*n, cy);
+ }
+#undef a0
+#undef a1
+#undef b0
+#undef b1
+#undef xp
+#undef sp1
+ }
+}
+
+mp_size_t
+mpn_mulmod_bnm1_next_size (mp_size_t n)
+{
+ mp_size_t nh;
+
+ if (BELOW_THRESHOLD (n, MULMOD_BNM1_THRESHOLD))
+ return n;
+ if (BELOW_THRESHOLD (n, 4 * (MULMOD_BNM1_THRESHOLD - 1) + 1))
+ return (n + (2-1)) & (-2);
+ if (BELOW_THRESHOLD (n, 8 * (MULMOD_BNM1_THRESHOLD - 1) + 1))
+ return (n + (4-1)) & (-4);
+
+ nh = (n + 1) >> 1;
+
+ if (BELOW_THRESHOLD (nh, MUL_FFT_MODF_THRESHOLD))
+ return (n + (8-1)) & (-8);
+
+ return 2 * mpn_fft_next_size (nh, mpn_fft_best_k (nh, 0));
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/neg.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/neg.c
new file mode 100644
index 00000000000..2d752e912d1
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/neg.c
@@ -0,0 +1,34 @@
+/* mpn_neg - negate an mpn.
+
+Copyright 2001, 2009 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_FORCE_mpn_neg 1
+
+#include "gmp.h"
+#include "gmp-impl.h"
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/nussbaumer_mul.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/nussbaumer_mul.c
new file mode 100644
index 00000000000..d2bf19ad56a
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/nussbaumer_mul.c
@@ -0,0 +1,71 @@
+/* mpn_nussbaumer_mul -- Multiply {ap,an} and {bp,bn} using
+ Nussbaumer's negacyclic convolution.
+
+ Contributed to the GNU project by Marco Bodrato.
+
+ THE FUNCTION IN THIS FILE IS INTERNAL WITH A MUTABLE INTERFACE. IT IS ONLY
+ 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 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.h"
+#include "gmp-impl.h"
+
+/* Multiply {ap,an} by {bp,bn}, and put the result in {pp, an+bn} */
+void
+mpn_nussbaumer_mul (mp_ptr pp,
+ mp_srcptr ap, mp_size_t an,
+ mp_srcptr bp, mp_size_t bn)
+{
+ mp_size_t rn;
+ mp_ptr tp;
+ TMP_DECL;
+
+ ASSERT (an >= bn);
+ ASSERT (bn > 0);
+
+ TMP_MARK;
+
+ if ((ap == bp) && (an == bn))
+ {
+ rn = mpn_sqrmod_bnm1_next_size (2*an);
+ tp = TMP_ALLOC_LIMBS (mpn_sqrmod_bnm1_itch (rn, an));
+ mpn_sqrmod_bnm1 (pp, rn, ap, an, tp);
+ }
+ else
+ {
+ rn = mpn_mulmod_bnm1_next_size (an + bn);
+ tp = TMP_ALLOC_LIMBS (mpn_mulmod_bnm1_itch (rn, an, bn));
+ mpn_mulmod_bnm1 (pp, rn, ap, an, bp, bn, tp);
+ }
+
+ TMP_FREE;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/perfpow.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/perfpow.c
new file mode 100644
index 00000000000..bbed6309d52
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/perfpow.c
@@ -0,0 +1,417 @@
+/* mpn_perfect_power_p -- mpn perfect power detection.
+
+ Contributed to the GNU project by Martin Boij.
+
+Copyright 2009, 2010, 2012 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.h"
+#include "gmp-impl.h"
+#include "longlong.h"
+
+#define SMALL 20
+#define MEDIUM 100
+
+/* Return non-zero if {np,nn} == {xp,xn} ^ k.
+ Algorithm:
+ For s = 1, 2, 4, ..., s_max, compute the s least significant limbs of
+ {xp,xn}^k. Stop if they don't match the s least significant limbs of
+ {np,nn}.
+
+ FIXME: Low xn limbs can be expected to always match, if computed as a mod
+ B^{xn} root. So instead of using mpn_powlo, compute an approximation of the
+ most significant (normalized) limb of {xp,xn} ^ k (and an error bound), and
+ compare to {np, nn}. Or use an even cruder approximation based on fix-point
+ base 2 logarithm. */
+static int
+pow_equals (mp_srcptr np, mp_size_t n,
+ mp_srcptr xp,mp_size_t xn,
+ mp_limb_t k, mp_bitcnt_t f,
+ mp_ptr tp)
+{
+ mp_limb_t *tp2;
+ mp_bitcnt_t y, z;
+ mp_size_t i, bn;
+ int ans;
+ mp_limb_t h, l;
+ TMP_DECL;
+
+ ASSERT (n > 1 || (n == 1 && np[0] > 1));
+ ASSERT (np[n - 1] > 0);
+ ASSERT (xn > 0);
+
+ if (xn == 1 && xp[0] == 1)
+ return 0;
+
+ z = 1 + (n >> 1);
+ for (bn = 1; bn < z; bn <<= 1)
+ {
+ mpn_powlo (tp, xp, &k, 1, bn, tp + bn);
+ if (mpn_cmp (tp, np, bn) != 0)
+ return 0;
+ }
+
+ TMP_MARK;
+
+ /* Final check. Estimate the size of {xp,xn}^k before computing the power
+ with full precision. Optimization: It might pay off to make a more
+ accurate estimation of the logarithm of {xp,xn}, rather than using the
+ index of the MSB. */
+
+ MPN_SIZEINBASE_2EXP(y, xp, xn, 1);
+ y -= 1; /* msb_index (xp, xn) */
+
+ umul_ppmm (h, l, k, y);
+ h -= l == 0; l--; /* two-limb decrement */
+
+ z = f - 1; /* msb_index (np, n) */
+ if (h == 0 && l <= z)
+ {
+ mp_limb_t size;
+ size = l + k;
+ ASSERT_ALWAYS (size >= k);
+
+ y = 2 + size / GMP_LIMB_BITS;
+ tp2 = TMP_ALLOC_LIMBS (y);
+
+ i = mpn_pow_1 (tp, xp, xn, k, tp2);
+ if (i == n && mpn_cmp (tp, np, n) == 0)
+ ans = 1;
+ else
+ ans = 0;
+ }
+ else
+ {
+ ans = 0;
+ }
+
+ TMP_FREE;
+ return ans;
+}
+
+
+/* Return non-zero if N = {np,n} is a kth power.
+ I = {ip,n} = N^(-1) mod B^n. */
+static int
+is_kth_power (mp_ptr rp, mp_srcptr np,
+ mp_limb_t k, mp_srcptr ip,
+ mp_size_t n, mp_bitcnt_t f,
+ mp_ptr tp)
+{
+ mp_bitcnt_t b;
+ mp_size_t rn, xn;
+
+ ASSERT (n > 0);
+ ASSERT ((k & 1) != 0 || k == 2);
+ ASSERT ((np[0] & 1) != 0);
+
+ if (k == 2)
+ {
+ b = (f + 1) >> 1;
+ rn = 1 + b / GMP_LIMB_BITS;
+ if (mpn_bsqrtinv (rp, ip, b, tp) != 0)
+ {
+ rp[rn - 1] &= (CNST_LIMB(1) << (b % GMP_LIMB_BITS)) - 1;
+ xn = rn;
+ MPN_NORMALIZE (rp, xn);
+ if (pow_equals (np, n, rp, xn, k, f, tp) != 0)
+ return 1;
+
+ /* Check if (2^b - r)^2 == n */
+ mpn_neg (rp, rp, rn);
+ rp[rn - 1] &= (CNST_LIMB(1) << (b % GMP_LIMB_BITS)) - 1;
+ MPN_NORMALIZE (rp, rn);
+ if (pow_equals (np, n, rp, rn, k, f, tp) != 0)
+ return 1;
+ }
+ }
+ else
+ {
+ b = 1 + (f - 1) / k;
+ rn = 1 + (b - 1) / GMP_LIMB_BITS;
+ mpn_brootinv (rp, ip, rn, k, tp);
+ if ((b % GMP_LIMB_BITS) != 0)
+ rp[rn - 1] &= (CNST_LIMB(1) << (b % GMP_LIMB_BITS)) - 1;
+ MPN_NORMALIZE (rp, rn);
+ if (pow_equals (np, n, rp, rn, k, f, tp) != 0)
+ return 1;
+ }
+ MPN_ZERO (rp, rn); /* Untrash rp */
+ return 0;
+}
+
+static int
+perfpow (mp_srcptr np, mp_size_t n,
+ mp_limb_t ub, mp_limb_t g,
+ mp_bitcnt_t f, int neg)
+{
+ mp_ptr ip, tp, rp;
+ mp_limb_t k;
+ int ans;
+ mp_bitcnt_t b;
+ gmp_primesieve_t ps;
+ TMP_DECL;
+
+ ASSERT (n > 0);
+ ASSERT ((np[0] & 1) != 0);
+ ASSERT (ub > 0);
+
+ TMP_MARK;
+ gmp_init_primesieve (&ps);
+ b = (f + 3) >> 1;
+
+ ip = TMP_ALLOC_LIMBS (n);
+ rp = TMP_ALLOC_LIMBS (n);
+ tp = TMP_ALLOC_LIMBS (5 * n); /* FIXME */
+ MPN_ZERO (rp, n);
+
+ /* FIXME: It seems the inverse in ninv is needed only to get non-inverted
+ roots. I.e., is_kth_power computes n^{1/2} as (n^{-1})^{-1/2} and
+ similarly for nth roots. It should be more efficient to compute n^{1/2} as
+ n * n^{-1/2}, with a mullo instead of a binvert. And we can do something
+ similar for kth roots if we switch to an iteration converging to n^{1/k -
+ 1}, and we can then eliminate this binvert call. */
+ mpn_binvert (ip, np, 1 + (b - 1) / GMP_LIMB_BITS, tp);
+ if (b % GMP_LIMB_BITS)
+ ip[(b - 1) / GMP_LIMB_BITS] &= (CNST_LIMB(1) << (b % GMP_LIMB_BITS)) - 1;
+
+ if (neg)
+ gmp_nextprime (&ps);
+
+ ans = 0;
+ if (g > 0)
+ {
+ ub = MIN (ub, g + 1);
+ while ((k = gmp_nextprime (&ps)) < ub)
+ {
+ if ((g % k) == 0)
+ {
+ if (is_kth_power (rp, np, k, ip, n, f, tp) != 0)
+ {
+ ans = 1;
+ goto ret;
+ }
+ }
+ }
+ }
+ else
+ {
+ while ((k = gmp_nextprime (&ps)) < ub)
+ {
+ if (is_kth_power (rp, np, k, ip, n, f, tp) != 0)
+ {
+ ans = 1;
+ goto ret;
+ }
+ }
+ }
+ ret:
+ TMP_FREE;
+ return ans;
+}
+
+static const unsigned short nrtrial[] = { 100, 500, 1000 };
+
+/* Table of (log_{p_i} 2) values, where p_i is the (nrtrial[i] + 1)'th prime
+ number. */
+static const double logs[] =
+ { 0.1099457228193620, 0.0847016403115322, 0.0772048195144415 };
+
+int
+mpn_perfect_power_p (mp_srcptr np, mp_size_t n)
+{
+ mp_size_t ncn, s, pn, xn;
+ mp_limb_t *nc, factor, g;
+ mp_limb_t exp, *prev, *next, d, l, r, c, *tp, cry;
+ mp_bitcnt_t twos, count;
+ int ans, where, neg, trial;
+ TMP_DECL;
+
+ nc = (mp_ptr) np;
+
+ neg = 0;
+ if (n < 0)
+ {
+ neg = 1;
+ n = -n;
+ }
+
+ if (n == 0 || (n == 1 && np[0] == 1))
+ return 1;
+
+ TMP_MARK;
+
+ g = 0;
+
+ ncn = n;
+ twos = mpn_scan1 (np, 0);
+ if (twos > 0)
+ {
+ if (twos == 1)
+ {
+ ans = 0;
+ goto ret;
+ }
+ s = twos / GMP_LIMB_BITS;
+ if (s + 1 == n && POW2_P (np[s]))
+ {
+ ans = ! (neg && POW2_P (twos));
+ goto ret;
+ }
+ count = twos % GMP_LIMB_BITS;
+ ncn = n - s;
+ nc = TMP_ALLOC_LIMBS (ncn);
+ if (count > 0)
+ {
+ mpn_rshift (nc, np + s, ncn, count);
+ ncn -= (nc[ncn - 1] == 0);
+ }
+ else
+ {
+ MPN_COPY (nc, np + s, ncn);
+ }
+ g = twos;
+ }
+
+ if (ncn <= SMALL)
+ trial = 0;
+ else if (ncn <= MEDIUM)
+ trial = 1;
+ else
+ trial = 2;
+
+ where = 0;
+ factor = mpn_trialdiv (nc, ncn, nrtrial[trial], &where);
+
+ if (factor != 0)
+ {
+ if (twos == 0)
+ {
+ nc = TMP_ALLOC_LIMBS (ncn);
+ MPN_COPY (nc, np, ncn);
+ }
+
+ /* Remove factors found by trialdiv. Optimization: Perhaps better to use
+ the strategy in mpz_remove (). */
+ prev = TMP_ALLOC_LIMBS (ncn + 2);
+ next = TMP_ALLOC_LIMBS (ncn + 2);
+ tp = TMP_ALLOC_LIMBS (4 * ncn);
+
+ do
+ {
+ binvert_limb (d, factor);
+ prev[0] = d;
+ pn = 1;
+ exp = 1;
+ while (2 * pn - 1 <= ncn)
+ {
+ mpn_sqr (next, prev, pn);
+ xn = 2 * pn;
+ xn -= (next[xn - 1] == 0);
+
+ if (mpn_divisible_p (nc, ncn, next, xn) == 0)
+ break;
+
+ exp <<= 1;
+ pn = xn;
+ MP_PTR_SWAP (next, prev);
+ }
+
+ /* Binary search for the exponent */
+ l = exp + 1;
+ r = 2 * exp - 1;
+ while (l <= r)
+ {
+ c = (l + r) >> 1;
+ if (c - exp > 1)
+ {
+ xn = mpn_pow_1 (tp, &d, 1, c - exp, next);
+ if (pn + xn - 1 > ncn)
+ {
+ r = c - 1;
+ continue;
+ }
+ mpn_mul (next, prev, pn, tp, xn);
+ xn += pn;
+ xn -= (next[xn - 1] == 0);
+ }
+ else
+ {
+ cry = mpn_mul_1 (next, prev, pn, d);
+ next[pn] = cry;
+ xn = pn + (cry != 0);
+ }
+
+ if (mpn_divisible_p (nc, ncn, next, xn) == 0)
+ {
+ r = c - 1;
+ }
+ else
+ {
+ exp = c;
+ l = c + 1;
+ MP_PTR_SWAP (next, prev);
+ pn = xn;
+ }
+ }
+
+ if (g == 0)
+ g = exp;
+ else
+ g = mpn_gcd_1 (&g, 1, exp);
+
+ if (g == 1)
+ {
+ ans = 0;
+ goto ret;
+ }
+
+ mpn_divexact (next, nc, ncn, prev, pn);
+ ncn = ncn - pn;
+ ncn += next[ncn] != 0;
+ MPN_COPY (nc, next, ncn);
+
+ if (ncn == 1 && nc[0] == 1)
+ {
+ ans = ! (neg && POW2_P (g));
+ goto ret;
+ }
+
+ factor = mpn_trialdiv (nc, ncn, nrtrial[trial], &where);
+ }
+ while (factor != 0);
+ }
+
+ MPN_SIZEINBASE_2EXP(count, nc, ncn, 1); /* log (nc) + 1 */
+ d = (mp_limb_t) (count * logs[trial] + 1e-9) + 1;
+ ans = perfpow (nc, ncn, d, g, count, neg);
+
+ ret:
+ TMP_FREE;
+ return ans;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/perfsqr.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/perfsqr.c
new file mode 100644
index 00000000000..bdd82ccd96e
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/perfsqr.c
@@ -0,0 +1,240 @@
+/* mpn_perfect_square_p(u,usize) -- Return non-zero if U is a perfect square,
+ zero otherwise.
+
+Copyright 1991, 1993, 1994, 1996, 1997, 2000-2002, 2005, 2012 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> /* for NULL */
+#include "gmp.h"
+#include "gmp-impl.h"
+#include "longlong.h"
+
+#include "perfsqr.h"
+
+
+/* change this to "#define TRACE(x) x" for diagnostics */
+#define TRACE(x)
+
+
+
+/* PERFSQR_MOD_* detects non-squares using residue tests.
+
+ A macro PERFSQR_MOD_TEST is setup by gen-psqr.c in perfsqr.h. It takes
+ {up,usize} modulo a selected modulus to get a remainder r. For 32-bit or
+ 64-bit limbs this modulus will be 2^24-1 or 2^48-1 using PERFSQR_MOD_34,
+ or for other limb or nail sizes a PERFSQR_PP is chosen and PERFSQR_MOD_PP
+ used. PERFSQR_PP_NORM and PERFSQR_PP_INVERTED are pre-calculated in this
+ case too.
+
+ PERFSQR_MOD_TEST then makes various calls to PERFSQR_MOD_1 or
+ PERFSQR_MOD_2 with divisors d which are factors of the modulus, and table
+ data indicating residues and non-residues modulo those divisors. The
+ table data is in 1 or 2 limbs worth of bits respectively, per the size of
+ each d.
+
+ A "modexact" style remainder is taken to reduce r modulo d.
+ PERFSQR_MOD_IDX implements this, producing an index "idx" for use with
+ the table data. Notice there's just one multiplication by a constant
+ "inv", for each d.
+
+ The modexact doesn't produce a true r%d remainder, instead idx satisfies
+ "-(idx<<PERFSQR_MOD_BITS) == r mod d". Because d is odd, this factor
+ -2^PERFSQR_MOD_BITS is a one-to-one mapping between r and idx, and is
+ accounted for by having the table data suitably permuted.
+
+ The remainder r fits within PERFSQR_MOD_BITS which is less than a limb.
+ In fact the GMP_LIMB_BITS - PERFSQR_MOD_BITS spare bits are enough to fit
+ each divisor d meaning the modexact multiply can take place entirely
+ within one limb, giving the compiler the chance to optimize it, in a way
+ that say umul_ppmm would not give.
+
+ There's no need for the divisors d to be prime, in fact gen-psqr.c makes
+ a deliberate effort to combine factors so as to reduce the number of
+ separate tests done on r. But such combining is limited to d <=
+ 2*GMP_LIMB_BITS so that the table data fits in at most 2 limbs.
+
+ Alternatives:
+
+ It'd be possible to use bigger divisors d, and more than 2 limbs of table
+ data, but this doesn't look like it would be of much help to the prime
+ factors in the usual moduli 2^24-1 or 2^48-1.
+
+ The moduli 2^24-1 or 2^48-1 are nothing particularly special, they're
+ just easy to calculate (see mpn_mod_34lsub1) and have a nice set of prime
+ factors. 2^32-1 and 2^64-1 would be equally easy to calculate, but have
+ fewer prime factors.
+
+ The nails case usually ends up using mpn_mod_1, which is a lot slower
+ than mpn_mod_34lsub1. Perhaps other such special moduli could be found
+ for the nails case. Two-term things like 2^30-2^15-1 might be
+ candidates. Or at worst some on-the-fly de-nailing would allow the plain
+ 2^24-1 to be used. Currently nails are too preliminary to be worried
+ about.
+
+*/
+
+#define PERFSQR_MOD_MASK ((CNST_LIMB(1) << PERFSQR_MOD_BITS) - 1)
+
+#define MOD34_BITS (GMP_NUMB_BITS / 4 * 3)
+#define MOD34_MASK ((CNST_LIMB(1) << MOD34_BITS) - 1)
+
+#define PERFSQR_MOD_34(r, up, usize) \
+ do { \
+ (r) = mpn_mod_34lsub1 (up, usize); \
+ (r) = ((r) & MOD34_MASK) + ((r) >> MOD34_BITS); \
+ } while (0)
+
+/* FIXME: The %= here isn't good, and might destroy any savings from keeping
+ the PERFSQR_MOD_IDX stuff within a limb (rather than needing umul_ppmm).
+ Maybe a new sort of mpn_preinv_mod_1 could accept an unnormalized divisor
+ and a shift count, like mpn_preinv_divrem_1. But mod_34lsub1 is our
+ normal case, so lets not worry too much about mod_1. */
+#define PERFSQR_MOD_PP(r, up, usize) \
+ do { \
+ if (BELOW_THRESHOLD (usize, PREINV_MOD_1_TO_MOD_1_THRESHOLD)) \
+ { \
+ (r) = mpn_preinv_mod_1 (up, usize, PERFSQR_PP_NORM, \
+ PERFSQR_PP_INVERTED); \
+ (r) %= PERFSQR_PP; \
+ } \
+ else \
+ { \
+ (r) = mpn_mod_1 (up, usize, PERFSQR_PP); \
+ } \
+ } while (0)
+
+#define PERFSQR_MOD_IDX(idx, r, d, inv) \
+ do { \
+ mp_limb_t q; \
+ ASSERT ((r) <= PERFSQR_MOD_MASK); \
+ ASSERT ((((inv) * (d)) & PERFSQR_MOD_MASK) == 1); \
+ ASSERT (MP_LIMB_T_MAX / (d) >= PERFSQR_MOD_MASK); \
+ \
+ q = ((r) * (inv)) & PERFSQR_MOD_MASK; \
+ ASSERT (r == ((q * (d)) & PERFSQR_MOD_MASK)); \
+ (idx) = (q * (d)) >> PERFSQR_MOD_BITS; \
+ } while (0)
+
+#define PERFSQR_MOD_1(r, d, inv, mask) \
+ do { \
+ unsigned idx; \
+ ASSERT ((d) <= GMP_LIMB_BITS); \
+ PERFSQR_MOD_IDX(idx, r, d, inv); \
+ TRACE (printf (" PERFSQR_MOD_1 d=%u r=%lu idx=%u\n", \
+ d, r%d, idx)); \
+ if ((((mask) >> idx) & 1) == 0) \
+ { \
+ TRACE (printf (" non-square\n")); \
+ return 0; \
+ } \
+ } while (0)
+
+/* The expression "(int) idx - GMP_LIMB_BITS < 0" lets the compiler use the
+ sign bit from "idx-GMP_LIMB_BITS", which might help avoid a branch. */
+#define PERFSQR_MOD_2(r, d, inv, mhi, mlo) \
+ do { \
+ mp_limb_t m; \
+ unsigned idx; \
+ ASSERT ((d) <= 2*GMP_LIMB_BITS); \
+ \
+ PERFSQR_MOD_IDX (idx, r, d, inv); \
+ TRACE (printf (" PERFSQR_MOD_2 d=%u r=%lu idx=%u\n", \
+ d, r%d, idx)); \
+ m = ((int) idx - GMP_LIMB_BITS < 0 ? (mlo) : (mhi)); \
+ idx %= GMP_LIMB_BITS; \
+ if (((m >> idx) & 1) == 0) \
+ { \
+ TRACE (printf (" non-square\n")); \
+ return 0; \
+ } \
+ } while (0)
+
+
+int
+mpn_perfect_square_p (mp_srcptr up, mp_size_t usize)
+{
+ ASSERT (usize >= 1);
+
+ TRACE (gmp_printf ("mpn_perfect_square_p %Nd\n", up, usize));
+
+ /* The first test excludes 212/256 (82.8%) of the perfect square candidates
+ in O(1) time. */
+ {
+ unsigned idx = up[0] % 0x100;
+ if (((sq_res_0x100[idx / GMP_LIMB_BITS]
+ >> (idx % GMP_LIMB_BITS)) & 1) == 0)
+ return 0;
+ }
+
+#if 0
+ /* Check that we have even multiplicity of 2, and then check that the rest is
+ a possible perfect square. Leave disabled until we can determine this
+ really is an improvement. It it is, it could completely replace the
+ simple probe above, since this should throw out more non-squares, but at
+ the expense of somewhat more cycles. */
+ {
+ mp_limb_t lo;
+ int cnt;
+ lo = up[0];
+ while (lo == 0)
+ up++, lo = up[0], usize--;
+ count_trailing_zeros (cnt, lo);
+ if ((cnt & 1) != 0)
+ return 0; /* return of not even multiplicity of 2 */
+ lo >>= cnt; /* shift down to align lowest non-zero bit */
+ lo >>= 1; /* shift away lowest non-zero bit */
+ if ((lo & 3) != 0)
+ return 0;
+ }
+#endif
+
+
+ /* The second test uses mpn_mod_34lsub1 or mpn_mod_1 to detect non-squares
+ according to their residues modulo small primes (or powers of
+ primes). See perfsqr.h. */
+ PERFSQR_MOD_TEST (up, usize);
+
+
+ /* For the third and last test, we finally compute the square root,
+ to make sure we've really got a perfect square. */
+ {
+ mp_ptr root_ptr;
+ int res;
+ TMP_DECL;
+
+ TMP_MARK;
+ root_ptr = TMP_ALLOC_LIMBS ((usize + 1) / 2);
+
+ /* Iff mpn_sqrtrem returns zero, the square is perfect. */
+ res = ! mpn_sqrtrem (root_ptr, NULL, up, usize);
+ TMP_FREE;
+
+ return res;
+ }
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/popham.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/popham.c
new file mode 100644
index 00000000000..13e529b7cda
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/popham.c
@@ -0,0 +1,126 @@
+/* mpn_popcount, mpn_hamdist -- mpn bit population count/hamming distance.
+
+Copyright 1994, 1996, 2000-2002, 2005, 2011, 2012 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.h"
+#include "gmp-impl.h"
+
+#if OPERATION_popcount
+#define FNAME mpn_popcount
+#define POPHAM(u,v) u
+#endif
+
+#if OPERATION_hamdist
+#define FNAME mpn_hamdist
+#define POPHAM(u,v) u ^ v
+#endif
+
+mp_bitcnt_t
+FNAME (mp_srcptr up,
+#if OPERATION_hamdist
+ mp_srcptr vp,
+#endif
+ mp_size_t n) __GMP_NOTHROW
+{
+ mp_bitcnt_t result = 0;
+ mp_limb_t p0, p1, p2, p3, x, p01, p23;
+ mp_size_t i;
+
+ ASSERT (n >= 1); /* Actually, this code handles any n, but some
+ assembly implementations do not. */
+
+ for (i = n >> 2; i != 0; i--)
+ {
+ p0 = POPHAM (up[0], vp[0]);
+ p0 -= (p0 >> 1) & MP_LIMB_T_MAX/3; /* 2 0-2 */
+ p0 = ((p0 >> 2) & MP_LIMB_T_MAX/5) + (p0 & MP_LIMB_T_MAX/5); /* 4 0-4 */
+
+ p1 = POPHAM (up[1], vp[1]);
+ p1 -= (p1 >> 1) & MP_LIMB_T_MAX/3; /* 2 0-2 */
+ p1 = ((p1 >> 2) & MP_LIMB_T_MAX/5) + (p1 & MP_LIMB_T_MAX/5); /* 4 0-4 */
+
+ p01 = p0 + p1; /* 8 0-8 */
+ p01 = ((p01 >> 4) & MP_LIMB_T_MAX/17) + (p01 & MP_LIMB_T_MAX/17); /* 8 0-16 */
+
+ p2 = POPHAM (up[2], vp[2]);
+ p2 -= (p2 >> 1) & MP_LIMB_T_MAX/3; /* 2 0-2 */
+ p2 = ((p2 >> 2) & MP_LIMB_T_MAX/5) + (p2 & MP_LIMB_T_MAX/5); /* 4 0-4 */
+
+ p3 = POPHAM (up[3], vp[3]);
+ p3 -= (p3 >> 1) & MP_LIMB_T_MAX/3; /* 2 0-2 */
+ p3 = ((p3 >> 2) & MP_LIMB_T_MAX/5) + (p3 & MP_LIMB_T_MAX/5); /* 4 0-4 */
+
+ p23 = p2 + p3; /* 8 0-8 */
+ p23 = ((p23 >> 4) & MP_LIMB_T_MAX/17) + (p23 & MP_LIMB_T_MAX/17); /* 8 0-16 */
+
+ x = p01 + p23; /* 8 0-32 */
+ x = (x >> 8) + x; /* 8 0-64 */
+ x = (x >> 16) + x; /* 8 0-128 */
+#if GMP_LIMB_BITS > 32
+ x = ((x >> 32) & 0xff) + (x & 0xff); /* 8 0-256 */
+ result += x;
+#else
+ result += x & 0xff;
+#endif
+ up += 4;
+#if OPERATION_hamdist
+ vp += 4;
+#endif
+ }
+
+ n &= 3;
+ if (n != 0)
+ {
+ x = 0;
+ do
+ {
+ p0 = POPHAM (up[0], vp[0]);
+ p0 -= (p0 >> 1) & MP_LIMB_T_MAX/3; /* 2 0-2 */
+ p0 = ((p0 >> 2) & MP_LIMB_T_MAX/5) + (p0 & MP_LIMB_T_MAX/5); /* 4 0-4 */
+ p0 = ((p0 >> 4) + p0) & MP_LIMB_T_MAX/17; /* 8 0-8 */
+
+ x += p0;
+ up += 1;
+#if OPERATION_hamdist
+ vp += 1;
+#endif
+ }
+ while (--n);
+
+ x = (x >> 8) + x;
+ x = (x >> 16) + x;
+#if GMP_LIMB_BITS > 32
+ x = (x >> 32) + x;
+#endif
+ result += x & 0xff;
+ }
+
+ return result;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/pow_1.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/pow_1.c
new file mode 100644
index 00000000000..2333206554c
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/pow_1.c
@@ -0,0 +1,134 @@
+/* mpn_pow_1 -- Compute powers R = U^exp.
+
+ 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 2002, 2014 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.h"
+#include "gmp-impl.h"
+#include "longlong.h"
+
+mp_size_t
+mpn_pow_1 (mp_ptr rp, mp_srcptr bp, mp_size_t bn, mp_limb_t exp, mp_ptr tp)
+{
+ mp_limb_t x;
+ int cnt, i;
+ mp_size_t rn;
+ int par;
+
+ ASSERT (bn >= 1);
+ /* FIXME: Add operand overlap criteria */
+
+ if (exp <= 1)
+ {
+ if (exp == 0)
+ {
+ rp[0] = 1;
+ return 1;
+ }
+ else
+ {
+ MPN_COPY (rp, bp, bn);
+ return bn;
+ }
+ }
+
+ /* Count number of bits in exp, and compute where to put initial square in
+ order to magically get results in the entry rp. Use simple code,
+ optimized for small exp. For large exp, the bignum operations will take
+ so much time that the slowness of this code will be negligible. */
+ par = 0;
+ cnt = GMP_LIMB_BITS;
+ x = exp;
+ do
+ {
+ par ^= x;
+ cnt--;
+ x >>= 1;
+ } while (x != 0);
+ exp <<= cnt;
+
+ if (bn == 1)
+ {
+ mp_limb_t 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;
+
+ for (i = GMP_LIMB_BITS - cnt - 1;;)
+ {
+ exp <<= 1;
+ if ((exp & GMP_LIMB_HIGHBIT) != 0)
+ {
+ rp[rn] = mpn_mul_1 (rp, rp, rn, bl);
+ rn += rp[rn] != 0;
+ }
+
+ if (--i == 0)
+ break;
+
+ mpn_sqr (tp, rp, rn);
+ rn = 2 * rn; rn -= tp[rn - 1] == 0;
+ MP_PTR_SWAP (rp, tp);
+ }
+ }
+ else
+ {
+ if (((par ^ cnt) & 1) == 0)
+ MP_PTR_SWAP (rp, tp);
+
+ mpn_sqr (rp, bp, bn);
+ rn = 2 * bn; rn -= rp[rn - 1] == 0;
+
+ for (i = GMP_LIMB_BITS - cnt - 1;;)
+ {
+ exp <<= 1;
+ if ((exp & GMP_LIMB_HIGHBIT) != 0)
+ {
+ rn = rn + bn - (mpn_mul (tp, rp, rn, bp, bn) == 0);
+ MP_PTR_SWAP (rp, tp);
+ }
+
+ if (--i == 0)
+ break;
+
+ mpn_sqr (tp, rp, rn);
+ rn = 2 * rn; rn -= tp[rn - 1] == 0;
+ MP_PTR_SWAP (rp, tp);
+ }
+ }
+
+ return rn;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/powlo.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/powlo.c
new file mode 100644
index 00000000000..adcd96eb518
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/powlo.c
@@ -0,0 +1,174 @@
+/* mpn_powlo -- Compute R = U^E mod B^n, where B is the limb base.
+
+Copyright 2007-2009, 2012 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.h"
+#include "gmp-impl.h"
+#include "longlong.h"
+
+
+#define getbit(p,bi) \
+ ((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)
+{
+ int nbits_in_r;
+ mp_limb_t r;
+ mp_size_t i;
+
+ if (bi < nbits)
+ {
+ return p[0] & (((mp_limb_t) 1 << bi) - 1);
+ }
+ else
+ {
+ bi -= nbits; /* bit index of low bit to extract */
+ i = bi / GMP_NUMB_BITS; /* word index of low bit to extract */
+ bi %= GMP_NUMB_BITS; /* bit index in low word */
+ r = p[i] >> bi; /* extract (low) bits */
+ 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);
+ }
+}
+
+static inline int
+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};
+ for (k = 0; eb > x[k]; k++)
+ ;
+ return k;
+}
+
+/* rp[n-1..0] = bp[n-1..0] ^ ep[en-1..0] mod B^n, B is the limb base.
+ Requires that ep[en-1] is non-zero.
+ Uses scratch space tp[3n-1..0], i.e., 3n words. */
+void
+mpn_powlo (mp_ptr rp, mp_srcptr bp,
+ mp_srcptr ep, mp_size_t en,
+ mp_size_t n, mp_ptr tp)
+{
+ int cnt;
+ mp_bitcnt_t ebi;
+ int windowsize, this_windowsize;
+ mp_limb_t expbits;
+ mp_limb_t *pp, *this_pp, *last_pp;
+ mp_limb_t *b2p;
+ long i;
+ TMP_DECL;
+
+ ASSERT (en > 1 || (en == 1 && ep[0] > 1));
+
+ TMP_MARK;
+
+ MPN_SIZEINBASE_2EXP(ebi, ep, en, 1);
+
+ windowsize = win_size (ebi);
+
+ pp = TMP_ALLOC_LIMBS ((n << (windowsize - 1)) + n); /* + n is for mullo ign part */
+
+ this_pp = pp;
+
+ MPN_COPY (this_pp, bp, n);
+
+ b2p = tp + 2*n;
+
+ /* Store b^2 in b2. */
+ mpn_sqr (tp, bp, n); /* FIXME: Use "mpn_sqrlo" */
+ MPN_COPY (b2p, tp, n);
+
+ /* Precompute odd powers of b and put them in the temporary area at pp. */
+ for (i = (1 << (windowsize - 1)) - 1; i > 0; i--)
+ {
+ last_pp = this_pp;
+ this_pp += n;
+ mpn_mullo_n (this_pp, last_pp, b2p, n);
+ }
+
+ expbits = getbits (ep, ebi, windowsize);
+ if (ebi < windowsize)
+ ebi = 0;
+ else
+ ebi -= windowsize;
+
+ count_trailing_zeros (cnt, expbits);
+ ebi += cnt;
+ expbits >>= cnt;
+
+ MPN_COPY (rp, pp + n * (expbits >> 1), n);
+
+ while (ebi != 0)
+ {
+ while (getbit (ep, ebi) == 0)
+ {
+ mpn_sqr (tp, rp, n); /* FIXME: Use "mpn_sqrlo" */
+ MPN_COPY (rp, tp, n);
+ ebi--;
+ if (ebi == 0)
+ goto done;
+ }
+
+ /* The next bit of the exponent is 1. Now extract the largest block of
+ 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;
+
+ count_trailing_zeros (cnt, expbits);
+ this_windowsize -= cnt;
+ ebi += cnt;
+ expbits >>= cnt;
+
+ do
+ {
+ mpn_sqr (tp, rp, n);
+ MPN_COPY (rp, tp, n);
+ this_windowsize--;
+ }
+ while (this_windowsize != 0);
+
+ mpn_mullo_n (tp, rp, pp + n * (expbits >> 1), n);
+ MPN_COPY (rp, tp, n);
+ }
+
+ done:
+ TMP_FREE;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/powm.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/powm.c
new file mode 100644
index 00000000000..9968116016b
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/powm.c
@@ -0,0 +1,590 @@
+/* mpn_powm -- Compute R = U^E mod M.
+
+ 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 2007-2012 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/. */
+
+
+/*
+ BASIC ALGORITHM, Compute U^E mod M, where M < B^n is odd.
+
+ 1. W <- U
+
+ 2. T <- (B^n * U) mod M Convert to REDC form
+
+ 3. Compute table U^1, U^3, U^5... of E-dependent size
+
+ 4. While there are more bits in E
+ W <- power left-to-right base-k
+
+
+ TODO:
+
+ * Make getbits a macro, thereby allowing it to update the index operand.
+ That will simplify the code using getbits. (Perhaps make getbits' sibling
+ getbit then have similar form, for symmetry.)
+
+ * Write an itch function. Or perhaps get rid of tp parameter since the huge
+ pp area is allocated locally anyway?
+
+ * Choose window size without looping. (Superoptimize or think(tm).)
+
+ * Handle small bases with initial, reduction-free exponentiation.
+
+ * Call new division functions, not mpn_tdiv_qr.
+
+ * Consider special code for one-limb M.
+
+ * How should we handle the redc1/redc2/redc_n choice?
+ - redc1: T(binvert_1limb) + e * (n) * (T(mullo-1x1) + n*T(addmul_1))
+ - redc2: T(binvert_2limbs) + e * (n/2) * (T(mullo-2x2) + n*T(addmul_2))
+ - redc_n: T(binvert_nlimbs) + e * (T(mullo-nxn) + T(M(n)))
+ This disregards the addmul_N constant term, but we could think of
+ that as part of the respective mullo.
+
+ * When U (the base) is small, we should start the exponentiation with plain
+ operations, then convert that partial result to REDC form.
+
+ * When U is just one limb, should it be handled without the k-ary tricks?
+ We could keep a factor of B^n in W, but use U' = BU as base. After
+ multiplying by this (pseudo two-limb) number, we need to multiply by 1/B
+ mod M.
+*/
+
+#include "gmp.h"
+#include "gmp-impl.h"
+#include "longlong.h"
+
+#undef MPN_REDC_1
+#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)
+
+#undef MPN_REDC_2
+#define MPN_REDC_2(rp, up, mp, n, mip) \
+ do { \
+ mp_limb_t cy; \
+ cy = mpn_redc_2 (rp, up, mp, n, mip); \
+ if (cy != 0) \
+ mpn_sub_n (rp, rp, mp, n); \
+ } while (0)
+
+#if HAVE_NATIVE_mpn_addmul_2 || HAVE_NATIVE_mpn_redc_2
+#define WANT_REDC_2 1
+#endif
+
+#define getbit(p,bi) \
+ ((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)
+{
+ int nbits_in_r;
+ mp_limb_t r;
+ mp_size_t i;
+
+ if (bi < nbits)
+ {
+ return p[0] & (((mp_limb_t) 1 << bi) - 1);
+ }
+ else
+ {
+ bi -= nbits; /* bit index of low bit to extract */
+ i = bi / GMP_NUMB_BITS; /* word index of low bit to extract */
+ bi %= GMP_NUMB_BITS; /* bit index in low word */
+ r = p[i] >> bi; /* extract (low) bits */
+ 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);
+ }
+}
+
+static inline int
+win_size (mp_bitcnt_t eb)
+{
+ int k;
+ static mp_bitcnt_t x[] = {0,7,25,81,241,673,1793,4609,11521,28161,~(mp_bitcnt_t)0};
+ for (k = 1; eb > x[k]; k++)
+ ;
+ return k;
+}
+
+/* Convert U to REDC form, U_r = B^n * U mod M */
+static void
+redcify (mp_ptr rp, mp_srcptr up, mp_size_t un, mp_srcptr mp, mp_size_t n)
+{
+ mp_ptr tp, qp;
+ TMP_DECL;
+ TMP_MARK;
+
+ tp = TMP_ALLOC_LIMBS (un + n);
+ qp = TMP_ALLOC_LIMBS (un + 1); /* FIXME: Put at tp+? */
+
+ MPN_ZERO (tp, n);
+ MPN_COPY (tp + n, up, un);
+ mpn_tdiv_qr (qp, rp, 0L, tp, un + n, mp, n);
+ TMP_FREE;
+}
+
+/* rp[n-1..0] = bp[bn-1..0] ^ ep[en-1..0] mod mp[n-1..0]
+ Requires that mp[n-1..0] is odd.
+ Requires that ep[en-1..0] is > 1.
+ Uses scratch space at tp of MAX(mpn_binvert_itch(n),2n) limbs. */
+void
+mpn_powm (mp_ptr rp, mp_srcptr bp, mp_size_t bn,
+ mp_srcptr ep, mp_size_t en,
+ mp_srcptr mp, mp_size_t n, mp_ptr tp)
+{
+ mp_limb_t ip[2], *mip;
+ int cnt;
+ mp_bitcnt_t ebi;
+ int windowsize, this_windowsize;
+ mp_limb_t expbits;
+ mp_ptr pp, this_pp;
+ long i;
+ TMP_DECL;
+
+ ASSERT (en > 1 || (en == 1 && ep[0] > 1));
+ ASSERT (n >= 1 && ((mp[0] & 1) != 0));
+
+ TMP_MARK;
+
+ MPN_SIZEINBASE_2EXP(ebi, ep, en, 1);
+
+#if 0
+ if (bn < n)
+ {
+ /* Do the first few exponent bits without mod reductions,
+ until the result is greater than the mod argument. */
+ for (;;)
+ {
+ mpn_sqr (tp, this_pp, tn);
+ tn = tn * 2 - 1, tn += tp[tn] != 0;
+ if (getbit (ep, ebi) != 0)
+ mpn_mul (..., tp, tn, bp, bn);
+ ebi--;
+ }
+ }
+#endif
+
+ windowsize = win_size (ebi);
+
+#if WANT_REDC_2
+ if (BELOW_THRESHOLD (n, REDC_1_TO_REDC_2_THRESHOLD))
+ {
+ mip = ip;
+ binvert_limb (mip[0], mp[0]);
+ mip[0] = -mip[0];
+ }
+ else if (BELOW_THRESHOLD (n, REDC_2_TO_REDC_N_THRESHOLD))
+ {
+ mip = ip;
+ mpn_binvert (mip, mp, 2, tp);
+ mip[0] = -mip[0]; mip[1] = ~mip[1];
+ }
+#else
+ if (BELOW_THRESHOLD (n, REDC_1_TO_REDC_N_THRESHOLD))
+ {
+ mip = ip;
+ binvert_limb (mip[0], mp[0]);
+ mip[0] = -mip[0];
+ }
+#endif
+ else
+ {
+ mip = TMP_ALLOC_LIMBS (n);
+ mpn_binvert (mip, mp, n, tp);
+ }
+
+ pp = TMP_ALLOC_LIMBS (n << (windowsize - 1));
+
+ this_pp = pp;
+ redcify (this_pp, bp, bn, mp, n);
+
+ /* Store b^2 at rp. */
+ mpn_sqr (tp, this_pp, n);
+#if WANT_REDC_2
+ if (BELOW_THRESHOLD (n, REDC_1_TO_REDC_2_THRESHOLD))
+ MPN_REDC_1 (rp, tp, mp, n, mip[0]);
+ else if (BELOW_THRESHOLD (n, REDC_2_TO_REDC_N_THRESHOLD))
+ MPN_REDC_2 (rp, tp, mp, n, mip);
+#else
+ if (BELOW_THRESHOLD (n, REDC_1_TO_REDC_N_THRESHOLD))
+ MPN_REDC_1 (rp, tp, mp, n, mip[0]);
+#endif
+ else
+ mpn_redc_n (rp, tp, mp, n, mip);
+
+ /* Precompute odd powers of b and put them in the temporary area at pp. */
+ for (i = (1 << (windowsize - 1)) - 1; i > 0; i--)
+ {
+ mpn_mul_n (tp, this_pp, rp, n);
+ this_pp += n;
+#if WANT_REDC_2
+ if (BELOW_THRESHOLD (n, REDC_1_TO_REDC_2_THRESHOLD))
+ MPN_REDC_1 (this_pp, tp, mp, n, mip[0]);
+ else if (BELOW_THRESHOLD (n, REDC_2_TO_REDC_N_THRESHOLD))
+ MPN_REDC_2 (this_pp, tp, mp, n, mip);
+#else
+ if (BELOW_THRESHOLD (n, REDC_1_TO_REDC_N_THRESHOLD))
+ MPN_REDC_1 (this_pp, tp, mp, n, mip[0]);
+#endif
+ else
+ mpn_redc_n (this_pp, tp, mp, n, mip);
+ }
+
+ expbits = getbits (ep, ebi, windowsize);
+ if (ebi < windowsize)
+ ebi = 0;
+ else
+ ebi -= windowsize;
+
+ count_trailing_zeros (cnt, expbits);
+ ebi += cnt;
+ expbits >>= cnt;
+
+ MPN_COPY (rp, pp + n * (expbits >> 1), n);
+
+#define INNERLOOP \
+ while (ebi != 0) \
+ { \
+ while (getbit (ep, ebi) == 0) \
+ { \
+ MPN_SQR (tp, rp, n); \
+ MPN_REDUCE (rp, tp, mp, n, mip); \
+ ebi--; \
+ if (ebi == 0) \
+ goto done; \
+ } \
+ \
+ /* The next bit of the exponent is 1. Now extract the largest \
+ block of 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; \
+ \
+ count_trailing_zeros (cnt, expbits); \
+ this_windowsize -= cnt; \
+ ebi += cnt; \
+ expbits >>= cnt; \
+ \
+ do \
+ { \
+ MPN_SQR (tp, rp, n); \
+ MPN_REDUCE (rp, tp, mp, n, mip); \
+ this_windowsize--; \
+ } \
+ while (this_windowsize != 0); \
+ \
+ MPN_MUL_N (tp, rp, pp + n * (expbits >> 1), n); \
+ MPN_REDUCE (rp, tp, mp, n, mip); \
+ }
+
+
+#if WANT_REDC_2
+ if (REDC_1_TO_REDC_2_THRESHOLD < MUL_TOOM22_THRESHOLD)
+ {
+ if (BELOW_THRESHOLD (n, REDC_1_TO_REDC_2_THRESHOLD))
+ {
+ if (REDC_1_TO_REDC_2_THRESHOLD < SQR_BASECASE_THRESHOLD
+ || BELOW_THRESHOLD (n, SQR_BASECASE_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_mul_basecase (r,a,n,a,n)
+#define MPN_REDUCE(rp,tp,mp,n,mip) MPN_REDC_1 (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_1 (rp, tp, mp, n, mip[0])
+ INNERLOOP;
+ }
+ }
+ else if (BELOW_THRESHOLD (n, MUL_TOOM22_THRESHOLD))
+ {
+ if (MUL_TOOM22_THRESHOLD < SQR_BASECASE_THRESHOLD
+ || BELOW_THRESHOLD (n, SQR_BASECASE_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_mul_basecase (r,a,n,a,n)
+#define MPN_REDUCE(rp,tp,mp,n,mip) MPN_REDC_2 (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_2 (rp, tp, mp, n, mip)
+ INNERLOOP;
+ }
+ }
+ else if (BELOW_THRESHOLD (n, REDC_2_TO_REDC_N_THRESHOLD))
+ {
+#undef MPN_MUL_N
+#undef MPN_SQR
+#undef MPN_REDUCE
+#define MPN_MUL_N(r,a,b,n) mpn_mul_n (r,a,b,n)
+#define MPN_SQR(r,a,n) mpn_sqr (r,a,n)
+#define MPN_REDUCE(rp,tp,mp,n,mip) MPN_REDC_2 (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_n (r,a,b,n)
+#define MPN_SQR(r,a,n) mpn_sqr (r,a,n)
+#define MPN_REDUCE(rp,tp,mp,n,mip) mpn_redc_n (rp, tp, mp, n, mip)
+ INNERLOOP;
+ }
+ }
+ else
+ {
+ if (BELOW_THRESHOLD (n, MUL_TOOM22_THRESHOLD))
+ {
+ if (MUL_TOOM22_THRESHOLD < SQR_BASECASE_THRESHOLD
+ || BELOW_THRESHOLD (n, SQR_BASECASE_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_mul_basecase (r,a,n,a,n)
+#define MPN_REDUCE(rp,tp,mp,n,mip) MPN_REDC_1 (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_1 (rp, tp, mp, n, mip[0])
+ INNERLOOP;
+ }
+ }
+ else 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_n (r,a,b,n)
+#define MPN_SQR(r,a,n) mpn_sqr (r,a,n)
+#define MPN_REDUCE(rp,tp,mp,n,mip) MPN_REDC_1 (rp, tp, mp, n, mip[0])
+ INNERLOOP;
+ }
+ else if (BELOW_THRESHOLD (n, REDC_2_TO_REDC_N_THRESHOLD))
+ {
+#undef MPN_MUL_N
+#undef MPN_SQR
+#undef MPN_REDUCE
+#define MPN_MUL_N(r,a,b,n) mpn_mul_n (r,a,b,n)
+#define MPN_SQR(r,a,n) mpn_sqr (r,a,n)
+#define MPN_REDUCE(rp,tp,mp,n,mip) MPN_REDC_2 (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_n (r,a,b,n)
+#define MPN_SQR(r,a,n) mpn_sqr (r,a,n)
+#define MPN_REDUCE(rp,tp,mp,n,mip) mpn_redc_n (rp, tp, mp, n, mip)
+ INNERLOOP;
+ }
+ }
+
+#else /* WANT_REDC_2 */
+
+ if (REDC_1_TO_REDC_N_THRESHOLD < MUL_TOOM22_THRESHOLD)
+ {
+ if (BELOW_THRESHOLD (n, REDC_1_TO_REDC_N_THRESHOLD))
+ {
+ if (REDC_1_TO_REDC_N_THRESHOLD < SQR_BASECASE_THRESHOLD
+ || BELOW_THRESHOLD (n, SQR_BASECASE_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_mul_basecase (r,a,n,a,n)
+#define MPN_REDUCE(rp,tp,mp,n,mip) MPN_REDC_1 (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_1 (rp, tp, mp, n, mip[0])
+ INNERLOOP;
+ }
+ }
+ else if (BELOW_THRESHOLD (n, MUL_TOOM22_THRESHOLD))
+ {
+ if (MUL_TOOM22_THRESHOLD < SQR_BASECASE_THRESHOLD
+ || BELOW_THRESHOLD (n, SQR_BASECASE_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_mul_basecase (r,a,n,a,n)
+#define MPN_REDUCE(rp,tp,mp,n,mip) mpn_redc_n (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_n (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_n (r,a,b,n)
+#define MPN_SQR(r,a,n) mpn_sqr (r,a,n)
+#define MPN_REDUCE(rp,tp,mp,n,mip) mpn_redc_n (rp, tp, mp, n, mip)
+ INNERLOOP;
+ }
+ }
+ else
+ {
+ if (BELOW_THRESHOLD (n, MUL_TOOM22_THRESHOLD))
+ {
+ if (MUL_TOOM22_THRESHOLD < SQR_BASECASE_THRESHOLD
+ || BELOW_THRESHOLD (n, SQR_BASECASE_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_mul_basecase (r,a,n,a,n)
+#define MPN_REDUCE(rp,tp,mp,n,mip) MPN_REDC_1 (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_1 (rp, tp, mp, n, mip[0])
+ INNERLOOP;
+ }
+ }
+ else if (BELOW_THRESHOLD (n, REDC_1_TO_REDC_N_THRESHOLD))
+ {
+#undef MPN_MUL_N
+#undef MPN_SQR
+#undef MPN_REDUCE
+#define MPN_MUL_N(r,a,b,n) mpn_mul_n (r,a,b,n)
+#define MPN_SQR(r,a,n) mpn_sqr (r,a,n)
+#define MPN_REDUCE(rp,tp,mp,n,mip) MPN_REDC_1 (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_n (r,a,b,n)
+#define MPN_SQR(r,a,n) mpn_sqr (r,a,n)
+#define MPN_REDUCE(rp,tp,mp,n,mip) mpn_redc_n (rp, tp, mp, n, mip)
+ INNERLOOP;
+ }
+ }
+#endif /* WANT_REDC_2 */
+
+ done:
+
+ 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 (rp, tp, mp, n, mip[0]);
+ else if (BELOW_THRESHOLD (n, REDC_2_TO_REDC_N_THRESHOLD))
+ MPN_REDC_2 (rp, tp, mp, n, mip);
+#else
+ if (BELOW_THRESHOLD (n, REDC_1_TO_REDC_N_THRESHOLD))
+ MPN_REDC_1 (rp, tp, mp, n, mip[0]);
+#endif
+ else
+ mpn_redc_n (rp, tp, mp, n, mip);
+
+ if (mpn_cmp (rp, mp, n) >= 0)
+ mpn_sub_n (rp, rp, mp, n);
+
+ TMP_FREE;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/pre_divrem_1.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/pre_divrem_1.c
new file mode 100644
index 00000000000..8027f0216e5
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/pre_divrem_1.c
@@ -0,0 +1,146 @@
+/* mpn_preinv_divrem_1 -- mpn by limb division with pre-inverted divisor.
+
+ 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 2000-2003 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.h"
+#include "gmp-impl.h"
+#include "longlong.h"
+
+
+/* Don't bloat a shared library with unused code. */
+#if USE_PREINV_DIVREM_1
+
+/* Same test here for skipping one divide step as in mpn_divrem_1.
+
+ The main reason for a separate shift==0 case is that not all CPUs give
+ zero for "n0 >> GMP_LIMB_BITS" which would arise in the general case
+ code used on shift==0. shift==0 is also reasonably common in mp_bases
+ big_base, for instance base==10 on a 64-bit limb.
+
+ Under shift!=0 it would be possible to call mpn_lshift to adjust the
+ dividend all in one go (into the quotient space say), rather than
+ limb-by-limb in the loop. This might help if mpn_lshift is a lot faster
+ than what the compiler can generate for EXTRACT. But this is left to CPU
+ specific implementations to consider, especially since EXTRACT isn't on
+ the dependent chain.
+
+ If size==0 then the result is simply xsize limbs of zeros, but nothing
+ special is done for that, since it wouldn't be a usual call, and
+ certainly never arises from mpn_get_str which is our main caller. */
+
+mp_limb_t
+mpn_preinv_divrem_1 (mp_ptr qp, mp_size_t xsize,
+ mp_srcptr ap, mp_size_t size, mp_limb_t d_unnorm,
+ mp_limb_t dinv, int shift)
+{
+ mp_limb_t ahigh, qhigh, r;
+ mp_size_t i;
+ mp_limb_t n1, n0;
+ mp_limb_t d;
+
+ ASSERT (xsize >= 0);
+ ASSERT (size >= 1);
+ ASSERT (d_unnorm != 0);
+#if WANT_ASSERT
+ {
+ int want_shift;
+ mp_limb_t want_dinv;
+ count_leading_zeros (want_shift, d_unnorm);
+ ASSERT (shift == want_shift);
+ invert_limb (want_dinv, d_unnorm << shift);
+ ASSERT (dinv == want_dinv);
+ }
+#endif
+ /* FIXME: What's the correct overlap rule when xsize!=0? */
+ ASSERT (MPN_SAME_OR_SEPARATE_P (qp+xsize, ap, size));
+
+ ahigh = ap[size-1];
+ d = d_unnorm << shift;
+ qp += (size + xsize - 1); /* dest high limb */
+
+ if (shift == 0)
+ {
+ /* High quotient limb is 0 or 1, and skip a divide step. */
+ r = ahigh;
+ qhigh = (r >= d);
+ r = (qhigh ? r-d : r);
+ *qp-- = qhigh;
+ size--;
+
+ for (i = size-1; i >= 0; i--)
+ {
+ n0 = ap[i];
+ udiv_qrnnd_preinv (*qp, r, r, n0, d, dinv);
+ qp--;
+ }
+ }
+ else
+ {
+ r = 0;
+ if (ahigh < d_unnorm)
+ {
+ r = ahigh << shift;
+ *qp-- = 0;
+ size--;
+ if (size == 0)
+ goto done_integer;
+ }
+
+ n1 = ap[size-1];
+ r |= n1 >> (GMP_LIMB_BITS - shift);
+
+ for (i = size-2; i >= 0; i--)
+ {
+ ASSERT (r < d);
+ n0 = ap[i];
+ udiv_qrnnd_preinv (*qp, r, r,
+ ((n1 << shift) | (n0 >> (GMP_LIMB_BITS - shift))),
+ d, dinv);
+ qp--;
+ n1 = n0;
+ }
+ udiv_qrnnd_preinv (*qp, r, r, n1 << shift, d, dinv);
+ qp--;
+ }
+
+ done_integer:
+ for (i = 0; i < xsize; i++)
+ {
+ udiv_qrnnd_preinv (*qp, r, r, CNST_LIMB(0), d, dinv);
+ qp--;
+ }
+
+ return r >> shift;
+}
+
+#endif /* USE_PREINV_DIVREM_1 */
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/pre_mod_1.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/pre_mod_1.c
new file mode 100644
index 00000000000..cb38f4a48f4
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/pre_mod_1.c
@@ -0,0 +1,62 @@
+/* mpn_preinv_mod_1 (up, un, d, dinv) -- Divide (UP,,UN) by the normalized D.
+ DINV should be 2^(2*GMP_LIMB_BITS) / D - 2^GMP_LIMB_BITS.
+ Return the single-limb remainder.
+
+Copyright 1991, 1993, 1994, 2000-2002, 2004, 2005 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.h"
+#include "gmp-impl.h"
+#include "longlong.h"
+
+
+/* This function used to be documented, but is now considered obsolete. It
+ continues to exist for binary compatibility, even when not required
+ internally. */
+
+mp_limb_t
+mpn_preinv_mod_1 (mp_srcptr up, mp_size_t un, mp_limb_t d, mp_limb_t dinv)
+{
+ mp_size_t i;
+ mp_limb_t n0, r;
+
+ ASSERT (un >= 1);
+ ASSERT (d & GMP_LIMB_HIGHBIT);
+
+ r = up[un - 1];
+ if (r >= d)
+ r -= d;
+
+ for (i = un - 2; i >= 0; i--)
+ {
+ n0 = up[i];
+ udiv_rnnd_preinv (r, r, n0, d, dinv);
+ }
+ return r;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/random.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/random.c
new file mode 100644
index 00000000000..5489becf4dc
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/random.c
@@ -0,0 +1,51 @@
+/* mpn_random -- Generate random numbers.
+
+Copyright 2001, 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/. */
+
+#include "gmp.h"
+#include "gmp-impl.h"
+
+void
+mpn_random (mp_ptr ptr, mp_size_t size)
+{
+ gmp_randstate_ptr rands;
+
+ /* FIXME: Is size==0 supposed to be allowed? */
+ ASSERT (size >= 0);
+
+ if (size == 0)
+ return;
+
+ rands = RANDS;
+ _gmp_rand (ptr, rands, size * GMP_NUMB_BITS);
+
+ /* Make sure the most significant limb is non-zero. */
+ while (ptr[size-1] == 0)
+ _gmp_rand (&ptr[size-1], rands, GMP_NUMB_BITS);
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/random2.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/random2.c
new file mode 100644
index 00000000000..980b15367fc
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/random2.c
@@ -0,0 +1,106 @@
+/* mpn_random2 -- Generate random numbers with relatively long strings
+ of ones and zeroes. Suitable for border testing.
+
+Copyright 1992-1994, 1996, 2000-2002, 2004, 2012 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.h"
+#include "gmp-impl.h"
+
+static void gmp_rrandomb (mp_ptr, gmp_randstate_t, mp_bitcnt_t);
+
+/* Ask _gmp_rand for 32 bits per call unless that's more than a limb can hold.
+ Thus, we get the same random number sequence in the common cases.
+ FIXME: We should always generate the same random number sequence! */
+#if GMP_NUMB_BITS < 32
+#define BITS_PER_RANDCALL GMP_NUMB_BITS
+#else
+#define BITS_PER_RANDCALL 32
+#endif
+
+void
+mpn_random2 (mp_ptr rp, mp_size_t n)
+{
+ gmp_randstate_ptr rstate = RANDS;
+ int bit_pos; /* bit number of least significant bit where
+ next bit field to be inserted */
+ mp_limb_t ran, ranm; /* buffer for random bits */
+
+ /* FIXME: Is n==0 supposed to be allowed? */
+ ASSERT (n >= 0);
+
+ _gmp_rand (&ranm, rstate, BITS_PER_RANDCALL);
+ ran = ranm;
+
+ /* Start off at a random bit position in the most significant limb. */
+ bit_pos = ran % GMP_NUMB_BITS;
+
+ gmp_rrandomb (rp, rstate, n * GMP_NUMB_BITS - bit_pos);
+}
+
+static void
+gmp_rrandomb (mp_ptr rp, gmp_randstate_t rstate, mp_bitcnt_t nbits)
+{
+ mp_bitcnt_t bi;
+ mp_limb_t ranm; /* buffer for random bits */
+ unsigned cap_chunksize, chunksize;
+ mp_size_t i;
+
+ /* Set entire result to 111..1 */
+ i = BITS_TO_LIMBS (nbits) - 1;
+ rp[i] = GMP_NUMB_MAX >> (GMP_NUMB_BITS - (nbits % GMP_NUMB_BITS)) % GMP_NUMB_BITS;
+ for (i = i - 1; i >= 0; i--)
+ rp[i] = GMP_NUMB_MAX;
+
+ _gmp_rand (&ranm, rstate, BITS_PER_RANDCALL);
+ cap_chunksize = nbits / (ranm % 4 + 1);
+ cap_chunksize += cap_chunksize == 0; /* make it at least 1 */
+
+ bi = nbits;
+
+ for (;;)
+ {
+ _gmp_rand (&ranm, rstate, BITS_PER_RANDCALL);
+ chunksize = 1 + ranm % cap_chunksize;
+ bi = (bi < chunksize) ? 0 : bi - chunksize;
+
+ if (bi == 0)
+ break; /* low chunk is ...1 */
+
+ rp[bi / GMP_NUMB_BITS] ^= CNST_LIMB (1) << bi % GMP_NUMB_BITS;
+
+ _gmp_rand (&ranm, rstate, BITS_PER_RANDCALL);
+ chunksize = 1 + ranm % cap_chunksize;
+ bi = (bi < chunksize) ? 0 : bi - chunksize;
+
+ mpn_incr_u (rp + bi / GMP_NUMB_BITS, CNST_LIMB (1) << bi % GMP_NUMB_BITS);
+
+ if (bi == 0)
+ break; /* low chunk is ...0 */
+ }
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/redc_1.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/redc_1.c
new file mode 100644
index 00000000000..0d33421f634
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/redc_1.c
@@ -0,0 +1,57 @@
+/* mpn_redc_1. Set rp[] <- up[]/R^n mod mp[]. Clobber up[].
+ mp[] is n limbs; up[] is 2n limbs.
+
+ THIS IS AN INTERNAL FUNCTION WITH A MUTABLE INTERFACE. IT IS ONLY
+ SAFE TO REACH THIS FUNCTION THROUGH DOCUMENTED INTERFACES.
+
+Copyright (C) 2000-2002, 2004, 2008, 2009, 2012 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.h"
+#include "gmp-impl.h"
+
+mp_limb_t
+mpn_redc_1 (mp_ptr rp, mp_ptr up, mp_srcptr mp, mp_size_t n, mp_limb_t invm)
+{
+ mp_size_t j;
+ mp_limb_t cy;
+
+ ASSERT (n > 0);
+ ASSERT_MPN (up, 2*n);
+
+ for (j = n - 1; j >= 0; j--)
+ {
+ cy = mpn_addmul_1 (up, mp, n, (up[0] * invm) & GMP_NUMB_MASK);
+ ASSERT (up[0] == 0);
+ up[0] = cy;
+ up++;
+ }
+
+ cy = mpn_add_n (rp, up, up - n, n);
+ return cy;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/redc_2.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/redc_2.c
new file mode 100644
index 00000000000..07d90fa20d1
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/redc_2.c
@@ -0,0 +1,110 @@
+/* mpn_redc_2. Set rp[] <- up[]/R^n mod mp[]. Clobber up[].
+ mp[] is n limbs; up[] is 2n limbs.
+
+ THIS IS AN INTERNAL FUNCTION WITH A MUTABLE INTERFACE. IT IS ONLY
+ SAFE TO REACH THIS FUNCTION THROUGH DOCUMENTED INTERFACES.
+
+Copyright (C) 2000-2002, 2004, 2008, 2012 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.h"
+#include "gmp-impl.h"
+#include "longlong.h"
+
+
+#if GMP_NAIL_BITS != 0
+you lose
+#endif
+
+/* For testing purposes, define our own mpn_addmul_2 if there is none already
+ available. */
+#ifndef HAVE_NATIVE_mpn_addmul_2
+#undef mpn_addmul_2
+static mp_limb_t
+mpn_addmul_2 (mp_ptr rp, mp_srcptr up, mp_size_t n, mp_srcptr vp)
+{
+ rp[n] = mpn_addmul_1 (rp, up, n, vp[0]);
+ return mpn_addmul_1 (rp + 1, up, n, vp[1]);
+}
+#endif
+
+#if defined (__GNUC__) && defined (__ia64) && W_TYPE_SIZE == 64
+#define umul2low(ph, pl, uh, ul, vh, vl) \
+ do { \
+ mp_limb_t _ph, _pl; \
+ __asm__ ("xma.hu %0 = %3, %5, f0\n\t" \
+ "xma.l %1 = %3, %5, f0\n\t" \
+ ";;\n\t" \
+ "xma.l %0 = %3, %4, %0\n\t" \
+ ";;\n\t" \
+ "xma.l %0 = %2, %5, %0" \
+ : "=&f" (ph), "=&f" (pl) \
+ : "f" (uh), "f" (ul), "f" (vh), "f" (vl)); \
+ } while (0)
+#endif
+
+#ifndef umul2low
+#define umul2low(ph, pl, uh, ul, vh, vl) \
+ do { \
+ mp_limb_t _ph, _pl; \
+ umul_ppmm (_ph, _pl, ul, vl); \
+ (ph) = _ph + (ul) * (vh) + (uh) * (vl); \
+ (pl) = _pl; \
+ } while (0)
+#endif
+
+mp_limb_t
+mpn_redc_2 (mp_ptr rp, mp_ptr up, mp_srcptr mp, mp_size_t n, mp_srcptr mip)
+{
+ mp_limb_t q[2];
+ mp_size_t j;
+ mp_limb_t upn;
+ mp_limb_t cy;
+
+ ASSERT (n > 0);
+ ASSERT_MPN (up, 2*n);
+
+ if ((n & 1) != 0)
+ {
+ up[0] = mpn_addmul_1 (up, mp, n, (up[0] * mip[0]) & GMP_NUMB_MASK);
+ up++;
+ }
+
+ for (j = n - 2; j >= 0; j -= 2)
+ {
+ umul2low (q[1], q[0], mip[1], mip[0], up[1], up[0]);
+ upn = up[n]; /* mpn_addmul_2 overwrites this */
+ up[1] = mpn_addmul_2 (up, mp, n, q);
+ up[0] = up[n];
+ up[n] = upn;
+ up += 2;
+ }
+
+ cy = mpn_add_n (rp, up, up - n, n);
+ return cy;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/redc_n.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/redc_n.c
new file mode 100644
index 00000000000..c3d0cfe7fa3
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/redc_n.c
@@ -0,0 +1,81 @@
+/* mpn_redc_n. Set rp[] <- up[]/R^n mod mp[]. Clobber up[].
+ mp[] is n limbs; up[] is 2n limbs, the inverse ip[] is n limbs.
+
+ THIS IS AN INTERNAL FUNCTION WITH A MUTABLE INTERFACE. IT IS ONLY
+ SAFE TO REACH THIS FUNCTION THROUGH DOCUMENTED INTERFACES.
+
+Copyright 2009, 2012 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.h"
+#include "gmp-impl.h"
+
+/*
+ TODO
+
+ * We assume mpn_mulmod_bnm1 is always faster than plain mpn_mul_n (or a
+ future mpn_mulhi) for the range we will be called. Follow up that
+ assumption.
+
+ * Decrease scratch usage.
+
+ * Consider removing the residue canonicalisation.
+*/
+
+void
+mpn_redc_n (mp_ptr rp, mp_ptr up, mp_srcptr mp, mp_size_t n, mp_srcptr ip)
+{
+ mp_ptr xp, yp, scratch;
+ mp_limb_t cy;
+ mp_size_t rn;
+ TMP_DECL;
+ TMP_MARK;
+
+ ASSERT (n > 8);
+
+ rn = mpn_mulmod_bnm1_next_size (n);
+
+ scratch = TMP_ALLOC_LIMBS (n + rn + mpn_mulmod_bnm1_itch (rn, n, n));
+
+ xp = scratch;
+ mpn_mullo_n (xp, up, ip, n);
+
+ yp = scratch + n;
+ mpn_mulmod_bnm1 (yp, rn, xp, n, mp, n, scratch + n + rn);
+
+ ASSERT_ALWAYS (2 * n > rn); /* could handle this */
+
+ cy = mpn_sub_n (yp + rn, yp, up, 2*n - rn); /* undo wrap around */
+ MPN_DECR_U (yp + 2*n - rn, rn, cy);
+
+ cy = mpn_sub_n (rp, up + n, yp + n, n);
+ if (cy != 0)
+ mpn_add_n (rp, rp, mp, n);
+
+ TMP_FREE;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/remove.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/remove.c
new file mode 100644
index 00000000000..ef1a06ea143
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/remove.c
@@ -0,0 +1,172 @@
+/* mpn_remove -- divide out all multiples of odd mpn number from another mpn
+ number.
+
+ Contributed to the GNU project by Torbjorn Granlund.
+
+ THE FUNCTION IN THIS FILE IS INTERNAL WITH A MUTABLE INTERFACE. IT IS ONLY
+ 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, 2013 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.h"
+#include "gmp-impl.h"
+
+#if GMP_LIMB_BITS > 50
+#define LOG 50
+#else
+#define LOG GMP_LIMB_BITS
+#endif
+
+
+/* Input: U = {up,un}, V = {vp,vn} must be odd, cap
+ Ouput W = {wp,*wn} allocation need is exactly *wn
+
+ Set W = U / V^k, where k is the largest integer <= cap such that the
+ division yields an integer.
+
+ FIXME: We currently allow any operand overlap. This is quite non mpn-ish
+ and might be changed, since it cost significant temporary space.
+ * If we require W to have space for un + 1 limbs, we could save qp or qp2
+ (but we will still need to copy things into wp 50% of the time).
+ * If we allow ourselves to clobber U, we could save the other of qp and qp2,
+ and the initial COPY (but also here we would need un + 1 limbs).
+*/
+
+/* FIXME: We need to wrap mpn_bdiv_qr due to the itch interface. This need
+ indicates a flaw in the current itch mechanism: Which operands not greater
+ than un,un will incur the worst itch? We need a parallel foo_maxitch set
+ of functions. */
+static void
+mpn_bdiv_qr_wrap (mp_ptr qp, mp_ptr rp,
+ mp_srcptr np, mp_size_t nn,
+ mp_srcptr dp, mp_size_t dn)
+{
+ mp_ptr scratch_out;
+ TMP_DECL;
+
+ TMP_MARK;
+ scratch_out = TMP_ALLOC_LIMBS (mpn_bdiv_qr_itch (nn, dn));
+ mpn_bdiv_qr (qp, rp, np, nn, dp, dn, scratch_out);
+
+ TMP_FREE;
+}
+
+mp_bitcnt_t
+mpn_remove (mp_ptr wp, mp_size_t *wn,
+ mp_ptr up, mp_size_t un, mp_ptr vp, mp_size_t vn,
+ mp_bitcnt_t cap)
+{
+ mp_ptr pwpsp[LOG];
+ mp_size_t pwpsn[LOG];
+ mp_size_t npowers;
+ mp_ptr tp, qp, np, pp, qp2;
+ mp_size_t pn, nn, qn, i;
+ mp_bitcnt_t pwr;
+ TMP_DECL;
+
+ ASSERT (un > 0);
+ ASSERT (vn > 0);
+ ASSERT (vp[0] % 2 != 0); /* 2-adic division wants odd numbers */
+ ASSERT (vn > 1 || vp[0] > 1); /* else we would loop indefinitely */
+
+ TMP_MARK;
+
+ tp = TMP_ALLOC_LIMBS ((un + 1 + vn) / 2); /* remainder */
+ qp = TMP_ALLOC_LIMBS (un + 1); /* quotient, alternating */
+ qp2 = TMP_ALLOC_LIMBS (un + 1); /* quotient, alternating */
+ pp = vp;
+ pn = vn;
+
+ MPN_COPY (qp, up, un);
+ qn = un;
+
+ npowers = 0;
+ while (qn >= pn)
+ {
+ 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 */
+
+ MP_PTR_SWAP (qp, qp2);
+ qn = qn - pn;
+ qn += qp[qn] != 0;
+
+ pwpsp[npowers] = pp;
+ pwpsn[npowers] = pn;
+ npowers++;
+
+ if (((mp_bitcnt_t) 2 << npowers) - 1 > cap)
+ break;
+
+ nn = 2 * pn - 1; /* next power will be at least this large */
+ if (nn > qn)
+ break; /* next power would be overlarge */
+
+ if (npowers == 1) /* Alloc once, but only if it's needed */
+ np = TMP_ALLOC_LIMBS (qn + LOG); /* powers of V */
+ else
+ np += pn;
+
+ mpn_sqr (np, pp, pn);
+ pn = nn + (np[nn] != 0);
+ pp = np;
+ }
+
+ pwr = ((mp_bitcnt_t) 1 << npowers) - 1;
+
+ for (i = npowers - 1; i >= 0; i--)
+ {
+ pn = pwpsn[i];
+ if (qn < pn)
+ continue;
+
+ if (pwr + ((mp_bitcnt_t) 1 << i) > cap)
+ continue; /* V^i would bring us past cap */
+
+ 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 */
+
+ MP_PTR_SWAP (qp, qp2);
+ qn = qn - pn;
+ qn += qp[qn] != 0;
+
+ pwr += (mp_bitcnt_t) 1 << i;
+ }
+
+ MPN_COPY (wp, qp, qn);
+ *wn = qn;
+
+ TMP_FREE;
+
+ return pwr;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/rootrem.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/rootrem.c
new file mode 100644
index 00000000000..2edc74baa36
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/rootrem.c
@@ -0,0 +1,415 @@
+/* mpn_rootrem(rootp,remp,ap,an,nth) -- Compute the nth root of {ap,an}, and
+ store the truncated integer part at rootp and the remainder at remp.
+
+ Contributed by Paul Zimmermann (algorithm) and
+ Paul Zimmermann and Torbjorn Granlund (implementation).
+
+ 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
+ GUARANTEED THAT THEY'LL CHANGE OR DISAPPEAR IN A FUTURE GNU MP RELEASE.
+
+Copyright 2002, 2005, 2009-2012 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/. */
+
+/* FIXME:
+ This implementation is not optimal when remp == NULL, since the complexity
+ is M(n), whereas it should be M(n/k) on average.
+*/
+
+#include <stdio.h> /* for NULL */
+
+#include "gmp.h"
+#include "gmp-impl.h"
+#include "longlong.h"
+
+static mp_size_t mpn_rootrem_internal (mp_ptr, mp_ptr, mp_srcptr, mp_size_t,
+ mp_limb_t, int);
+
+#define MPN_RSHIFT(cy,rp,up,un,cnt) \
+ do { \
+ if ((cnt) != 0) \
+ cy = mpn_rshift (rp, up, un, cnt); \
+ else \
+ { \
+ MPN_COPY_INCR (rp, up, un); \
+ cy = 0; \
+ } \
+ } while (0)
+
+#define MPN_LSHIFT(cy,rp,up,un,cnt) \
+ do { \
+ if ((cnt) != 0) \
+ cy = mpn_lshift (rp, up, un, cnt); \
+ else \
+ { \
+ MPN_COPY_DECR (rp, up, un); \
+ cy = 0; \
+ } \
+ } while (0)
+
+
+/* Put in {rootp, ceil(un/k)} the kth root of {up, un}, rounded toward zero.
+ If remp <> NULL, put in {remp, un} the remainder.
+ Return the size (in limbs) of the remainder if remp <> NULL,
+ or a non-zero value iff the remainder is non-zero when remp = NULL.
+ Assumes:
+ (a) up[un-1] is not zero
+ (b) rootp has at least space for ceil(un/k) limbs
+ (c) remp has at least space for un limbs (in case remp <> NULL)
+ (d) the operands do not overlap.
+
+ The auxiliary memory usage is 3*un+2 if remp = NULL,
+ and 2*un+2 if remp <> NULL. FIXME: This is an incorrect comment.
+*/
+mp_size_t
+mpn_rootrem (mp_ptr rootp, mp_ptr remp,
+ mp_srcptr up, mp_size_t un, mp_limb_t k)
+{
+ mp_size_t m;
+ ASSERT (un > 0);
+ ASSERT (up[un - 1] != 0);
+ ASSERT (k > 1);
+
+ m = (un - 1) / k; /* ceil(un/k) - 1 */
+ if (remp == NULL && m > 2)
+ /* Pad {up,un} with k zero limbs. This will produce an approximate root
+ with one more limb, allowing us to compute the exact integral result. */
+ {
+ mp_ptr sp, wp;
+ mp_size_t rn, sn, wn;
+ TMP_DECL;
+ TMP_MARK;
+ wn = un + k;
+ wp = TMP_ALLOC_LIMBS (wn); /* will contain the padded input */
+ sn = m + 2; /* ceil(un/k) + 1 */
+ sp = TMP_ALLOC_LIMBS (sn); /* approximate root of padded input */
+ MPN_COPY (wp + k, up, un);
+ MPN_ZERO (wp, k);
+ rn = mpn_rootrem_internal (sp, NULL, wp, wn, k, 1);
+ /* The approximate root S = {sp,sn} is either the correct root of
+ {sp,sn}, or 1 too large. Thus unless the least significant limb of
+ S is 0 or 1, we can deduce the root of {up,un} is S truncated by one
+ limb. (In case sp[0]=1, we can deduce the root, but not decide
+ whether it is exact or not.) */
+ MPN_COPY (rootp, sp + 1, sn - 1);
+ TMP_FREE;
+ return rn;
+ }
+ else
+ {
+ return mpn_rootrem_internal (rootp, remp, up, un, k, 0);
+ }
+}
+
+/* if approx is non-zero, does not compute the final remainder */
+static mp_size_t
+mpn_rootrem_internal (mp_ptr rootp, mp_ptr remp, mp_srcptr up, mp_size_t un,
+ mp_limb_t k, int approx)
+{
+ mp_ptr qp, rp, sp, wp, scratch;
+ mp_size_t qn, rn, sn, wn, nl, bn;
+ mp_limb_t save, save2, cy;
+ unsigned long int unb; /* number of significant bits of {up,un} */
+ unsigned long int xnb; /* number of significant bits of the result */
+ unsigned long b, kk;
+ unsigned long sizes[GMP_NUMB_BITS + 1];
+ int ni, i;
+ int c;
+ int logk;
+ TMP_DECL;
+
+ TMP_MARK;
+
+ if (remp == NULL)
+ {
+ rp = TMP_ALLOC_LIMBS (un + 1); /* will contain the remainder */
+ scratch = rp; /* used by mpn_div_q */
+ }
+ else
+ {
+ scratch = TMP_ALLOC_LIMBS (un + 1); /* used by mpn_div_q */
+ rp = remp;
+ }
+ sp = rootp;
+
+ MPN_SIZEINBASE_2EXP(unb, up, un, 1);
+ /* unb is the number of bits of the input U */
+
+ xnb = (unb - 1) / k + 1; /* ceil (unb / k) */
+ /* xnb is the number of bits of the root R */
+
+ if (xnb == 1) /* root is 1 */
+ {
+ if (remp == NULL)
+ remp = rp;
+ mpn_sub_1 (remp, up, un, (mp_limb_t) 1);
+ MPN_NORMALIZE (remp, un); /* There should be at most one zero limb,
+ if we demand u to be normalized */
+ rootp[0] = 1;
+ TMP_FREE;
+ return un;
+ }
+
+ /* We initialize the algorithm with a 1-bit approximation to zero: since we
+ know the root has exactly xnb bits, we write r0 = 2^(xnb-1), so that
+ r0^k = 2^(k*(xnb-1)), that we subtract to the input. */
+ kk = k * (xnb - 1); /* number of truncated bits in the input */
+ rn = un - kk / GMP_NUMB_BITS; /* number of limbs of the non-truncated part */
+ MPN_RSHIFT (cy, rp, up + kk / GMP_NUMB_BITS, rn, kk % GMP_NUMB_BITS);
+ mpn_sub_1 (rp, rp, rn, 1); /* subtract the initial approximation: since
+ the non-truncated part is less than 2^k, it
+ is <= k bits: rn <= ceil(k/GMP_NUMB_BITS) */
+ sp[0] = 1; /* initial approximation */
+ sn = 1; /* it has one limb */
+
+ for (logk = 1; ((k - 1) >> logk) != 0; logk++)
+ ;
+ /* logk = ceil(log(k)/log(2)) */
+
+ b = xnb - 1; /* number of remaining bits to determine in the kth root */
+ ni = 0;
+ while (b != 0)
+ {
+ /* invariant: here we want b+1 total bits for the kth root */
+ sizes[ni] = b;
+ /* if c is the new value of b, this means that we'll go from a root
+ of c+1 bits (say s') to a root of b+1 bits.
+ It is proved in the book "Modern Computer Arithmetic" from Brent
+ and Zimmermann, Chapter 1, that
+ if s' >= k*beta, then at most one correction is necessary.
+ Here beta = 2^(b-c), and s' >= 2^c, thus it suffices that
+ c >= ceil((b + log2(k))/2). */
+ b = (b + logk + 1) / 2;
+ if (b >= sizes[ni])
+ b = sizes[ni] - 1; /* add just one bit at a time */
+ ni++;
+ }
+ sizes[ni] = 0;
+ ASSERT_ALWAYS (ni < GMP_NUMB_BITS + 1);
+ /* We have sizes[0] = b > sizes[1] > ... > sizes[ni] = 0 with
+ sizes[i] <= 2 * sizes[i+1].
+ Newton iteration will first compute sizes[ni-1] extra bits,
+ then sizes[ni-2], ..., then sizes[0] = b. */
+
+ /* qp and wp need enough space to store S'^k where S' is an approximate
+ root. Since S' can be as large as S+2, the worst case is when S=2 and
+ S'=4. But then since we know the number of bits of S in advance, S'
+ can only be 3 at most. Similarly for S=4, then S' can be 6 at most.
+ So the worst case is S'/S=3/2, thus S'^k <= (3/2)^k * S^k. Since S^k
+ fits in un limbs, the number of extra limbs needed is bounded by
+ ceil(k*log2(3/2)/GMP_NUMB_BITS). */
+#define EXTRA 2 + (mp_size_t) (0.585 * (double) k / (double) GMP_NUMB_BITS)
+ qp = TMP_ALLOC_LIMBS (un + EXTRA); /* will contain quotient and remainder
+ of R/(k*S^(k-1)), and S^k */
+ wp = TMP_ALLOC_LIMBS (un + EXTRA); /* will contain S^(k-1), k*S^(k-1),
+ and temporary for mpn_pow_1 */
+
+ wp[0] = 1; /* {sp,sn}^(k-1) = 1 */
+ wn = 1;
+ for (i = ni; i != 0; i--)
+ {
+ /* 1: loop invariant:
+ {sp, sn} is the current approximation of the root, which has
+ exactly 1 + sizes[ni] bits.
+ {rp, rn} is the current remainder
+ {wp, wn} = {sp, sn}^(k-1)
+ kk = number of truncated bits of the input
+ */
+ b = sizes[i - 1] - sizes[i]; /* number of bits to compute in that
+ iteration */
+
+ /* Reinsert a low zero limb if we normalized away the entire remainder */
+ if (rn == 0)
+ {
+ rp[0] = 0;
+ rn = 1;
+ }
+
+ /* first multiply the remainder by 2^b */
+ MPN_LSHIFT (cy, rp + b / GMP_NUMB_BITS, rp, rn, b % GMP_NUMB_BITS);
+ rn = rn + b / GMP_NUMB_BITS;
+ if (cy != 0)
+ {
+ rp[rn] = cy;
+ rn++;
+ }
+
+ kk = kk - b;
+
+ /* 2: current buffers: {sp,sn}, {rp,rn}, {wp,wn} */
+
+ /* Now insert bits [kk,kk+b-1] from the input U */
+ bn = b / GMP_NUMB_BITS; /* lowest limb from high part of rp[] */
+ save = rp[bn];
+ /* nl is the number of limbs in U which contain bits [kk,kk+b-1] */
+ nl = 1 + (kk + b - 1) / GMP_NUMB_BITS - (kk / GMP_NUMB_BITS);
+ /* nl = 1 + floor((kk + b - 1) / GMP_NUMB_BITS)
+ - floor(kk / GMP_NUMB_BITS)
+ <= 1 + (kk + b - 1) / GMP_NUMB_BITS
+ - (kk - GMP_NUMB_BITS + 1) / GMP_NUMB_BITS
+ = 2 + (b - 2) / GMP_NUMB_BITS
+ thus since nl is an integer:
+ nl <= 2 + floor(b/GMP_NUMB_BITS) <= 2 + bn. */
+ /* we have to save rp[bn] up to rp[nl-1], i.e. 1 or 2 limbs */
+ if (nl - 1 > bn)
+ save2 = rp[bn + 1];
+ MPN_RSHIFT (cy, rp, up + kk / GMP_NUMB_BITS, nl, kk % GMP_NUMB_BITS);
+ /* set to zero high bits of rp[bn] */
+ rp[bn] &= ((mp_limb_t) 1 << (b % GMP_NUMB_BITS)) - 1;
+ /* restore corresponding bits */
+ rp[bn] |= save;
+ if (nl - 1 > bn)
+ rp[bn + 1] = save2; /* the low b bits go in rp[0..bn] only, since
+ they start by bit 0 in rp[0], so they use
+ at most ceil(b/GMP_NUMB_BITS) limbs */
+
+ /* 3: current buffers: {sp,sn}, {rp,rn}, {wp,wn} */
+
+ /* compute {wp, wn} = k * {sp, sn}^(k-1) */
+ cy = mpn_mul_1 (wp, wp, wn, k);
+ wp[wn] = cy;
+ wn += cy != 0;
+
+ /* 4: current buffers: {sp,sn}, {rp,rn}, {wp,wn} */
+
+ /* now divide {rp, rn} by {wp, wn} to get the low part of the root */
+ if (rn < wn)
+ {
+ qn = 0;
+ }
+ else
+ {
+ qn = rn - wn; /* expected quotient size */
+ mpn_div_q (qp, rp, rn, wp, wn, scratch);
+ qn += qp[qn] != 0;
+ }
+
+ /* 5: current buffers: {sp,sn}, {qp,qn}.
+ Note: {rp,rn} is not needed any more since we'll compute it from
+ scratch at the end of the loop.
+ */
+
+ /* Number of limbs used by b bits, when least significant bit is
+ aligned to least limb */
+ bn = (b - 1) / GMP_NUMB_BITS + 1;
+
+ /* the quotient should be smaller than 2^b, since the previous
+ approximation was correctly rounded toward zero */
+ if (qn > bn || (qn == bn && (b % GMP_NUMB_BITS != 0) &&
+ qp[qn - 1] >= ((mp_limb_t) 1 << (b % GMP_NUMB_BITS))))
+ {
+ qn = b / GMP_NUMB_BITS + 1; /* b+1 bits */
+ MPN_ZERO (qp, qn);
+ qp[qn - 1] = (mp_limb_t) 1 << (b % GMP_NUMB_BITS);
+ MPN_DECR_U (qp, qn, 1);
+ qn -= qp[qn - 1] == 0;
+ }
+
+ /* 6: current buffers: {sp,sn}, {qp,qn} */
+
+ /* multiply the root approximation by 2^b */
+ MPN_LSHIFT (cy, sp + b / GMP_NUMB_BITS, sp, sn, b % GMP_NUMB_BITS);
+ sn = sn + b / GMP_NUMB_BITS;
+ if (cy != 0)
+ {
+ sp[sn] = cy;
+ sn++;
+ }
+
+ /* 7: current buffers: {sp,sn}, {qp,qn} */
+
+ ASSERT_ALWAYS (bn >= qn); /* this is ok since in the case qn > bn
+ above, q is set to 2^b-1, which has
+ exactly bn limbs */
+
+ /* Combine sB and q to form sB + q. */
+ save = sp[b / GMP_NUMB_BITS];
+ MPN_COPY (sp, qp, qn);
+ MPN_ZERO (sp + qn, bn - qn);
+ sp[b / GMP_NUMB_BITS] |= save;
+
+ /* 8: current buffer: {sp,sn} */
+
+ /* Since each iteration treats b bits from the root and thus k*b bits
+ from the input, and we already considered b bits from the input,
+ we now have to take another (k-1)*b bits from the input. */
+ kk -= (k - 1) * b; /* remaining input bits */
+ /* {rp, rn} = floor({up, un} / 2^kk) */
+ MPN_RSHIFT (cy, rp, up + kk / GMP_NUMB_BITS, un - kk / GMP_NUMB_BITS, kk % GMP_NUMB_BITS);
+ rn = un - kk / GMP_NUMB_BITS;
+ rn -= rp[rn - 1] == 0;
+
+ /* 9: current buffers: {sp,sn}, {rp,rn} */
+
+ for (c = 0;; c++)
+ {
+ /* Compute S^k in {qp,qn}. */
+ if (i == 1)
+ {
+ /* Last iteration: we don't need W anymore. */
+ /* mpn_pow_1 requires that both qp and wp have enough space to
+ store the result {sp,sn}^k + 1 limb */
+ approx = approx && (sp[0] > 1);
+ qn = (approx == 0) ? mpn_pow_1 (qp, sp, sn, k, wp) : 0;
+ }
+ else
+ {
+ /* W <- S^(k-1) for the next iteration,
+ and S^k = W * S. */
+ wn = mpn_pow_1 (wp, sp, sn, k - 1, qp);
+ mpn_mul (qp, wp, wn, sp, sn);
+ qn = wn + sn;
+ qn -= qp[qn - 1] == 0;
+ }
+
+ /* if S^k > floor(U/2^kk), the root approximation was too large */
+ if (qn > rn || (qn == rn && mpn_cmp (qp, rp, rn) > 0))
+ MPN_DECR_U (sp, sn, 1);
+ else
+ break;
+ }
+
+ /* 10: current buffers: {sp,sn}, {rp,rn}, {qp,qn}, {wp,wn} */
+
+ ASSERT_ALWAYS (c <= 1);
+ ASSERT_ALWAYS (rn >= qn);
+
+ /* R = R - Q = floor(U/2^kk) - S^k */
+ if (i > 1 || approx == 0)
+ {
+ mpn_sub (rp, rp, rn, qp, qn);
+ MPN_NORMALIZE (rp, rn);
+ }
+ /* otherwise we have rn > 0, thus the return value is ok */
+
+ /* 11: current buffers: {sp,sn}, {rp,rn}, {wp,wn} */
+ }
+
+ TMP_FREE;
+ return rn;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/rshift.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/rshift.c
new file mode 100644
index 00000000000..ec61f2f7e24
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/rshift.c
@@ -0,0 +1,70 @@
+/* mpn_rshift -- Shift right low level.
+
+Copyright 1991, 1993, 1994, 1996, 2000-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/. */
+
+#include "gmp.h"
+#include "gmp-impl.h"
+
+/* Shift U (pointed to by up and N limbs long) cnt bits to the right
+ and store the n least significant limbs of the result at rp.
+ The bits shifted out to the right are returned.
+
+ Argument constraints:
+ 1. 0 < cnt < GMP_NUMB_BITS.
+ 2. If the result is to be written over the input, rp must be <= up.
+*/
+
+mp_limb_t
+mpn_rshift (mp_ptr rp, mp_srcptr up, mp_size_t n, unsigned int cnt)
+{
+ mp_limb_t high_limb, low_limb;
+ unsigned int tnc;
+ mp_size_t i;
+ mp_limb_t retval;
+
+ ASSERT (n >= 1);
+ ASSERT (cnt >= 1);
+ ASSERT (cnt < GMP_NUMB_BITS);
+ ASSERT (MPN_SAME_OR_INCR_P (rp, up, n));
+
+ tnc = GMP_NUMB_BITS - cnt;
+ high_limb = *up++;
+ retval = (high_limb << tnc) & GMP_NUMB_MASK;
+ low_limb = high_limb >> cnt;
+
+ for (i = n - 1; i != 0; i--)
+ {
+ high_limb = *up++;
+ *rp++ = low_limb | ((high_limb << tnc) & GMP_NUMB_MASK);
+ low_limb = high_limb >> cnt;
+ }
+ *rp = low_limb;
+
+ return retval;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/sbpi1_bdiv_q.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/sbpi1_bdiv_q.c
new file mode 100644
index 00000000000..645b1d9b6a4
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/sbpi1_bdiv_q.c
@@ -0,0 +1,100 @@
+/* mpn_sbpi1_bdiv_q -- schoolbook Hensel division with precomputed inverse,
+ returning quotient only.
+
+ Contributed to the GNU project by Niels Möller.
+
+ 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.
+
+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.h"
+#include "gmp-impl.h"
+
+
+/* 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_srcptr dp, mp_size_t dn,
+ mp_limb_t dinv)
+{
+ mp_size_t i;
+ mp_limb_t cy, q;
+
+ ASSERT (dn > 0);
+ ASSERT (nn >= 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. */
+
+ for (i = nn - dn; i > 0; i--)
+ {
+ 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++;
+ }
+
+ 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++;
+ }
+
+ /* Final limb */
+ q = dinv * np[0];
+ qp[0] = ~q;
+ mpn_add_1 (qp - nn + 1, qp - nn + 1, nn, 1);
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/sbpi1_bdiv_qr.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/sbpi1_bdiv_qr.c
new file mode 100644
index 00000000000..0e56f581487
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/sbpi1_bdiv_qr.c
@@ -0,0 +1,119 @@
+/* mpn_sbpi1_bdiv_qr -- schoolbook Hensel division with precomputed inverse,
+ returning quotient and remainder.
+
+ Contributed to the GNU project by Niels Möller.
+
+ 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.
+
+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.h"
+#include "gmp-impl.h"
+
+
+/* Computes a binary quotient of size qn = nn - dn.
+ Output:
+
+ Q = N * D^{-1} mod B^qn,
+
+ R = (N - 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.
+
+ 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_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;
+
+ ASSERT (dn > 0);
+ ASSERT (nn > 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. */
+
+ qn = nn - dn;
+
+ rh = 0;
+
+ /* To complete the negation, this value is added to q. */
+ ql = 1;
+ while (qn > dn)
+ {
+ for (i = 0; i < dn; 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 (np + dn, np + dn, qn, np, dn);
+ ql = mpn_add_1 (qp, qp, dn, ql);
+
+ qp += dn; qn -= dn;
+ np += dn; nn -= dn;
+ }
+
+ 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;
+ }
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/sbpi1_div_q.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/sbpi1_div_q.c
new file mode 100644
index 00000000000..3abbd579336
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/sbpi1_div_q.c
@@ -0,0 +1,303 @@
+/* mpn_sbpi1_div_q -- Schoolbook division using the Möller-Granlund 3/2
+ division algorithm.
+
+ Contributed to the GNU project by Torbjorn Granlund.
+
+ THE FUNCTION IN THIS FILE IS INTERNAL WITH A MUTABLE INTERFACE. IT IS ONLY
+ 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 2007, 2009 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.h"
+#include "gmp-impl.h"
+#include "longlong.h"
+
+mp_limb_t
+mpn_sbpi1_div_q (mp_ptr qp,
+ mp_ptr np, mp_size_t nn,
+ mp_srcptr dp, mp_size_t dn,
+ mp_limb_t dinv)
+{
+ mp_limb_t qh;
+ mp_size_t qn, i;
+ mp_limb_t n1, n0;
+ mp_limb_t d1, d0;
+ mp_limb_t cy, cy1;
+ mp_limb_t q;
+ mp_limb_t flag;
+
+ mp_size_t dn_orig = dn;
+ mp_srcptr dp_orig = dp;
+ mp_ptr np_orig = np;
+
+ ASSERT (dn > 2);
+ ASSERT (nn >= dn);
+ ASSERT ((dp[dn-1] & GMP_NUMB_HIGHBIT) != 0);
+
+ np += nn;
+
+ qn = nn - dn;
+ if (qn + 1 < dn)
+ {
+ dp += dn - (qn + 1);
+ dn = qn + 1;
+ }
+
+ qh = mpn_cmp (np - dn, dp, dn) >= 0;
+ if (qh != 0)
+ mpn_sub_n (np - dn, np - dn, dp, dn);
+
+ qp += qn;
+
+ dn -= 2; /* offset dn by 2 for main division loops,
+ saving two iterations in mpn_submul_1. */
+ d1 = dp[dn + 1];
+ d0 = dp[dn + 0];
+
+ np -= 2;
+
+ n1 = np[1];
+
+ for (i = qn - (dn + 2); i >= 0; i--)
+ {
+ np--;
+ if (UNLIKELY (n1 == d1) && np[1] == d0)
+ {
+ q = GMP_NUMB_MASK;
+ mpn_submul_1 (np - dn, dp, dn + 2, q);
+ n1 = np[1]; /* update n1, last loop's value will now be invalid */
+ }
+ else
+ {
+ udiv_qr_3by2 (q, n1, n0, n1, np[1], np[0], d1, d0, dinv);
+
+ cy = mpn_submul_1 (np - dn, dp, dn, q);
+
+ cy1 = n0 < cy;
+ n0 = (n0 - cy) & GMP_NUMB_MASK;
+ cy = n1 < cy1;
+ n1 -= cy1;
+ np[0] = n0;
+
+ if (UNLIKELY (cy != 0))
+ {
+ n1 += d1 + mpn_add_n (np - dn, np - dn, dp, dn + 1);
+ q--;
+ }
+ }
+
+ *--qp = q;
+ }
+
+ flag = ~CNST_LIMB(0);
+
+ if (dn >= 0)
+ {
+ for (i = dn; i > 0; i--)
+ {
+ np--;
+ if (UNLIKELY (n1 >= (d1 & flag)))
+ {
+ q = GMP_NUMB_MASK;
+ cy = mpn_submul_1 (np - dn, dp, dn + 2, q);
+
+ if (UNLIKELY (n1 != cy))
+ {
+ if (n1 < (cy & flag))
+ {
+ q--;
+ mpn_add_n (np - dn, np - dn, dp, dn + 2);
+ }
+ else
+ flag = 0;
+ }
+ n1 = np[1];
+ }
+ else
+ {
+ udiv_qr_3by2 (q, n1, n0, n1, np[1], np[0], d1, d0, dinv);
+
+ cy = mpn_submul_1 (np - dn, dp, dn, q);
+
+ cy1 = n0 < cy;
+ n0 = (n0 - cy) & GMP_NUMB_MASK;
+ cy = n1 < cy1;
+ n1 -= cy1;
+ np[0] = n0;
+
+ if (UNLIKELY (cy != 0))
+ {
+ n1 += d1 + mpn_add_n (np - dn, np - dn, dp, dn + 1);
+ q--;
+ }
+ }
+
+ *--qp = q;
+
+ /* Truncate operands. */
+ dn--;
+ dp++;
+ }
+
+ np--;
+ if (UNLIKELY (n1 >= (d1 & flag)))
+ {
+ q = GMP_NUMB_MASK;
+ cy = mpn_submul_1 (np, dp, 2, q);
+
+ if (UNLIKELY (n1 != cy))
+ {
+ if (n1 < (cy & flag))
+ {
+ q--;
+ add_ssaaaa (np[1], np[0], np[1], np[0], dp[1], dp[0]);
+ }
+ else
+ flag = 0;
+ }
+ n1 = np[1];
+ }
+ else
+ {
+ udiv_qr_3by2 (q, n1, n0, n1, np[1], np[0], d1, d0, dinv);
+
+ np[0] = n0;
+ np[1] = n1;
+ }
+
+ *--qp = q;
+ }
+ ASSERT_ALWAYS (np[1] == n1);
+ np += 2;
+
+
+ dn = dn_orig;
+ if (UNLIKELY (n1 < (dn & flag)))
+ {
+ mp_limb_t q, x;
+
+ /* The quotient may be too large if the remainder is small. Recompute
+ for above ignored operand parts, until the remainder spills.
+
+ FIXME: The quality of this code isn't the same as the code above.
+ 1. We don't compute things in an optimal order, high-to-low, in order
+ to terminate as quickly as possible.
+ 2. We mess with pointers and sizes, adding and subtracting and
+ adjusting to get things right. It surely could be streamlined.
+ 3. The only termination criteria are that we determine that the
+ quotient needs to be adjusted, or that we have recomputed
+ everything. We should stop when the remainder is so large
+ that no additional subtracting could make it spill.
+ 4. If nothing else, we should not do two loops of submul_1 over the
+ data, instead handle both the triangularization and chopping at
+ once. */
+
+ x = n1;
+
+ if (dn > 2)
+ {
+ /* Compensate for triangularization. */
+ mp_limb_t y;
+
+ dp = dp_orig;
+ if (qn + 1 < dn)
+ {
+ dp += dn - (qn + 1);
+ dn = qn + 1;
+ }
+
+ y = np[-2];
+
+ for (i = dn - 3; i >= 0; i--)
+ {
+ q = qp[i];
+ cy = mpn_submul_1 (np - (dn - i), dp, dn - i - 2, q);
+
+ if (y < cy)
+ {
+ if (x == 0)
+ {
+ cy = mpn_sub_1 (qp, qp, qn, 1);
+ ASSERT_ALWAYS (cy == 0);
+ return qh - cy;
+ }
+ x--;
+ }
+ y -= cy;
+ }
+ np[-2] = y;
+ }
+
+ dn = dn_orig;
+ if (qn + 1 < dn)
+ {
+ /* Compensate for ignored dividend and divisor tails. */
+
+ dp = dp_orig;
+ np = np_orig;
+
+ if (qh != 0)
+ {
+ cy = mpn_sub_n (np + qn, np + qn, dp, dn - (qn + 1));
+ if (cy != 0)
+ {
+ if (x == 0)
+ {
+ if (qn != 0)
+ cy = mpn_sub_1 (qp, qp, qn, 1);
+ return qh - cy;
+ }
+ x--;
+ }
+ }
+
+ if (qn == 0)
+ return qh;
+
+ for (i = dn - qn - 2; i >= 0; i--)
+ {
+ cy = mpn_submul_1 (np + i, qp, qn, dp[i]);
+ cy = mpn_sub_1 (np + qn + i, np + qn + i, dn - qn - i - 1, cy);
+ if (cy != 0)
+ {
+ if (x == 0)
+ {
+ cy = mpn_sub_1 (qp, qp, qn, 1);
+ return qh;
+ }
+ x--;
+ }
+ }
+ }
+ }
+
+ return qh;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/sbpi1_div_qr.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/sbpi1_div_qr.c
new file mode 100644
index 00000000000..0c3e4cb7298
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/sbpi1_div_qr.c
@@ -0,0 +1,110 @@
+/* mpn_sbpi1_div_qr -- Schoolbook division using the Möller-Granlund 3/2
+ division algorithm.
+
+ Contributed to the GNU project by Torbjorn Granlund.
+
+ THE FUNCTION IN THIS FILE IS INTERNAL WITH A MUTABLE INTERFACE. IT IS ONLY
+ 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 2007, 2009 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.h"
+#include "gmp-impl.h"
+#include "longlong.h"
+
+mp_limb_t
+mpn_sbpi1_div_qr (mp_ptr qp,
+ mp_ptr np, mp_size_t nn,
+ mp_srcptr dp, mp_size_t dn,
+ mp_limb_t dinv)
+{
+ mp_limb_t qh;
+ mp_size_t i;
+ mp_limb_t n1, n0;
+ mp_limb_t d1, d0;
+ mp_limb_t cy, cy1;
+ mp_limb_t q;
+
+ ASSERT (dn > 2);
+ ASSERT (nn >= dn);
+ ASSERT ((dp[dn-1] & GMP_NUMB_HIGHBIT) != 0);
+
+ np += nn;
+
+ qh = mpn_cmp (np - dn, dp, dn) >= 0;
+ if (qh != 0)
+ mpn_sub_n (np - dn, np - dn, dp, dn);
+
+ qp += nn - dn;
+
+ dn -= 2; /* offset dn by 2 for main division loops,
+ saving two iterations in mpn_submul_1. */
+ d1 = dp[dn + 1];
+ d0 = dp[dn + 0];
+
+ np -= 2;
+
+ n1 = np[1];
+
+ for (i = nn - (dn + 2); i > 0; i--)
+ {
+ np--;
+ if (UNLIKELY (n1 == d1) && np[1] == d0)
+ {
+ q = GMP_NUMB_MASK;
+ mpn_submul_1 (np - dn, dp, dn + 2, q);
+ n1 = np[1]; /* update n1, last loop's value will now be invalid */
+ }
+ else
+ {
+ udiv_qr_3by2 (q, n1, n0, n1, np[1], np[0], d1, d0, dinv);
+
+ cy = mpn_submul_1 (np - dn, dp, dn, q);
+
+ cy1 = n0 < cy;
+ n0 = (n0 - cy) & GMP_NUMB_MASK;
+ cy = n1 < cy1;
+ n1 = (n1 - cy1) & GMP_NUMB_MASK;
+ np[0] = n0;
+
+ if (UNLIKELY (cy != 0))
+ {
+ n1 += d1 + mpn_add_n (np - dn, np - dn, dp, dn + 1);
+ q--;
+ }
+ }
+
+ *--qp = q;
+ }
+ np[1] = n1;
+
+ return qh;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/sbpi1_divappr_q.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/sbpi1_divappr_q.c
new file mode 100644
index 00000000000..3e7cf91ba61
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/sbpi1_divappr_q.c
@@ -0,0 +1,199 @@
+/* mpn_sbpi1_divappr_q -- Schoolbook division using the Möller-Granlund 3/2
+ division algorithm, returning approximate quotient. The quotient returned
+ is either correct, or one too large.
+
+ Contributed to the GNU project by Torbjorn Granlund.
+
+ THE FUNCTION IN THIS FILE IS INTERNAL WITH A MUTABLE INTERFACE. IT IS ONLY
+ 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 2007, 2009 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.h"
+#include "gmp-impl.h"
+#include "longlong.h"
+
+mp_limb_t
+mpn_sbpi1_divappr_q (mp_ptr qp,
+ mp_ptr np, mp_size_t nn,
+ mp_srcptr dp, mp_size_t dn,
+ mp_limb_t dinv)
+{
+ mp_limb_t qh;
+ mp_size_t qn, i;
+ mp_limb_t n1, n0;
+ mp_limb_t d1, d0;
+ mp_limb_t cy, cy1;
+ mp_limb_t q;
+ mp_limb_t flag;
+
+ ASSERT (dn > 2);
+ ASSERT (nn >= dn);
+ ASSERT ((dp[dn-1] & GMP_NUMB_HIGHBIT) != 0);
+
+ np += nn;
+
+ qn = nn - dn;
+ if (qn + 1 < dn)
+ {
+ dp += dn - (qn + 1);
+ dn = qn + 1;
+ }
+
+ qh = mpn_cmp (np - dn, dp, dn) >= 0;
+ if (qh != 0)
+ mpn_sub_n (np - dn, np - dn, dp, dn);
+
+ qp += qn;
+
+ dn -= 2; /* offset dn by 2 for main division loops,
+ saving two iterations in mpn_submul_1. */
+ d1 = dp[dn + 1];
+ d0 = dp[dn + 0];
+
+ np -= 2;
+
+ n1 = np[1];
+
+ for (i = qn - (dn + 2); i >= 0; i--)
+ {
+ np--;
+ if (UNLIKELY (n1 == d1) && np[1] == d0)
+ {
+ q = GMP_NUMB_MASK;
+ mpn_submul_1 (np - dn, dp, dn + 2, q);
+ n1 = np[1]; /* update n1, last loop's value will now be invalid */
+ }
+ else
+ {
+ udiv_qr_3by2 (q, n1, n0, n1, np[1], np[0], d1, d0, dinv);
+
+ cy = mpn_submul_1 (np - dn, dp, dn, q);
+
+ cy1 = n0 < cy;
+ n0 = (n0 - cy) & GMP_NUMB_MASK;
+ cy = n1 < cy1;
+ n1 -= cy1;
+ np[0] = n0;
+
+ if (UNLIKELY (cy != 0))
+ {
+ n1 += d1 + mpn_add_n (np - dn, np - dn, dp, dn + 1);
+ q--;
+ }
+ }
+
+ *--qp = q;
+ }
+
+ flag = ~CNST_LIMB(0);
+
+ if (dn >= 0)
+ {
+ for (i = dn; i > 0; i--)
+ {
+ np--;
+ if (UNLIKELY (n1 >= (d1 & flag)))
+ {
+ q = GMP_NUMB_MASK;
+ cy = mpn_submul_1 (np - dn, dp, dn + 2, q);
+
+ if (UNLIKELY (n1 != cy))
+ {
+ if (n1 < (cy & flag))
+ {
+ q--;
+ mpn_add_n (np - dn, np - dn, dp, dn + 2);
+ }
+ else
+ flag = 0;
+ }
+ n1 = np[1];
+ }
+ else
+ {
+ udiv_qr_3by2 (q, n1, n0, n1, np[1], np[0], d1, d0, dinv);
+
+ cy = mpn_submul_1 (np - dn, dp, dn, q);
+
+ cy1 = n0 < cy;
+ n0 = (n0 - cy) & GMP_NUMB_MASK;
+ cy = n1 < cy1;
+ n1 -= cy1;
+ np[0] = n0;
+
+ if (UNLIKELY (cy != 0))
+ {
+ n1 += d1 + mpn_add_n (np - dn, np - dn, dp, dn + 1);
+ q--;
+ }
+ }
+
+ *--qp = q;
+
+ /* Truncate operands. */
+ dn--;
+ dp++;
+ }
+
+ np--;
+ if (UNLIKELY (n1 >= (d1 & flag)))
+ {
+ q = GMP_NUMB_MASK;
+ cy = mpn_submul_1 (np, dp, 2, q);
+
+ if (UNLIKELY (n1 != cy))
+ {
+ if (n1 < (cy & flag))
+ {
+ q--;
+ add_ssaaaa (np[1], np[0], np[1], np[0], dp[1], dp[0]);
+ }
+ else
+ flag = 0;
+ }
+ n1 = np[1];
+ }
+ else
+ {
+ udiv_qr_3by2 (q, n1, n0, n1, np[1], np[0], d1, d0, dinv);
+
+ np[1] = n1;
+ np[0] = n0;
+ }
+
+ *--qp = q;
+ }
+
+ ASSERT_ALWAYS (np[1] == n1);
+
+ return qh;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/scan0.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/scan0.c
new file mode 100644
index 00000000000..8171fd5afee
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/scan0.c
@@ -0,0 +1,60 @@
+/* mpn_scan0 -- Scan from a given bit position for the next clear bit.
+
+Copyright 1994, 1996, 2001, 2002, 2004 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.h"
+#include "gmp-impl.h"
+#include "longlong.h"
+
+/* Argument constraints:
+ 1. U must sooner or later have a limb with a clear bit.
+ */
+
+mp_bitcnt_t
+mpn_scan0 (mp_srcptr up, mp_bitcnt_t starting_bit)
+{
+ mp_size_t starting_word;
+ mp_limb_t alimb;
+ int cnt;
+ mp_srcptr p;
+
+ /* Start at the word implied by STARTING_BIT. */
+ starting_word = starting_bit / GMP_NUMB_BITS;
+ p = up + starting_word;
+ alimb = *p++ ^ GMP_NUMB_MASK;
+
+ /* Mask off any bits before STARTING_BIT in the first limb. */
+ alimb &= - (mp_limb_t) 1 << (starting_bit % GMP_NUMB_BITS);
+
+ while (alimb == 0)
+ alimb = *p++ ^ GMP_NUMB_MASK;
+
+ count_trailing_zeros (cnt, alimb);
+ return (p - up - 1) * GMP_NUMB_BITS + cnt;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/scan1.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/scan1.c
new file mode 100644
index 00000000000..e22ad5d827a
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/scan1.c
@@ -0,0 +1,60 @@
+/* mpn_scan1 -- Scan from a given bit position for the next set bit.
+
+Copyright 1994, 1996, 2001, 2002, 2004 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.h"
+#include "gmp-impl.h"
+#include "longlong.h"
+
+/* Argument constraints:
+ 1. U must sooner or later have a limb != 0.
+ */
+
+mp_bitcnt_t
+mpn_scan1 (mp_srcptr up, mp_bitcnt_t starting_bit)
+{
+ mp_size_t starting_word;
+ mp_limb_t alimb;
+ int cnt;
+ mp_srcptr p;
+
+ /* Start at the word implied by STARTING_BIT. */
+ starting_word = starting_bit / GMP_NUMB_BITS;
+ p = up + starting_word;
+ alimb = *p++;
+
+ /* Mask off any bits before STARTING_BIT in the first limb. */
+ alimb &= - (mp_limb_t) 1 << (starting_bit % GMP_NUMB_BITS);
+
+ while (alimb == 0)
+ alimb = *p++;
+
+ count_trailing_zeros (cnt, alimb);
+ return (p - up - 1) * GMP_NUMB_BITS + cnt;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/sec_aors_1.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/sec_aors_1.c
new file mode 100644
index 00000000000..d789a5792e8
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/sec_aors_1.c
@@ -0,0 +1,60 @@
+/* mpn_sec_add_1, mpn_sec_sub_1
+
+ Contributed to the GNU project by Niels Möller
+
+Copyright 2013, 2014 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.h"
+#include "gmp-impl.h"
+
+#if OPERATION_sec_add_1
+#define FNAME mpn_sec_add_1
+#define FNAME_itch mpn_sec_add_1_itch
+#define OP_N mpn_add_n
+#endif
+#if OPERATION_sec_sub_1
+#define FNAME mpn_sec_sub_1
+#define FNAME_itch mpn_sec_sub_1_itch
+#define OP_N mpn_sub_n
+#endif
+
+/* It's annoying to that we need scratch space */
+mp_size_t
+FNAME_itch (mp_size_t n)
+{
+ return n;
+}
+
+mp_limb_t
+FNAME (mp_ptr rp, mp_srcptr ap, mp_size_t n, mp_limb_t b, mp_ptr scratch)
+{
+ scratch[0] = b;
+ MPN_ZERO (scratch + 1, n-1);
+ return OP_N (rp, ap, scratch, n);
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/sec_div.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/sec_div.c
new file mode 100644
index 00000000000..483b118d0dd
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/sec_div.c
@@ -0,0 +1,133 @@
+/* mpn_sec_div_qr, mpn_sec_div_r -- Compute Q = floor(U / V), U = U mod V.
+ Side-channel silent under the assumption that the used instructions are
+ side-channel silent.
+
+ Contributed to the GNU project by Torbjörn Granlund.
+
+Copyright 2011-2014 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.h"
+#include "gmp-impl.h"
+#include "longlong.h"
+
+#if OPERATION_sec_div_qr
+#define FNAME mpn_sec_div_qr
+#define FNAME_itch mpn_sec_div_qr_itch
+#define Q(q) q,
+#define RETTYPE mp_limb_t
+#endif
+#if OPERATION_sec_div_r
+#define FNAME mpn_sec_div_r
+#define FNAME_itch mpn_sec_div_r_itch
+#define Q(q)
+#define RETTYPE void
+#endif
+
+mp_size_t
+FNAME_itch (mp_size_t nn, mp_size_t dn)
+{
+#if OPERATION_sec_div_qr
+/* Needs (nn + dn + 1) + mpn_sec_pi1_div_qr's needs of (2nn' - dn + 1) for a
+ total of 3nn + 4 limbs at tp. Note that mpn_sec_pi1_div_qr's nn is one
+ greater than ours, therefore +4 and not just +2. */
+ return 3 * nn + 4;
+#endif
+#if OPERATION_sec_div_r
+/* Needs (nn + dn + 1) + mpn_sec_pi1_div_r's needs of (dn + 1) for a total of
+ nn + 2dn + 2 limbs at tp. */
+ return nn + 2 * dn + 2;
+#endif
+}
+
+RETTYPE
+FNAME (Q(mp_ptr qp)
+ mp_ptr np, mp_size_t nn,
+ mp_srcptr dp, mp_size_t dn,
+ mp_ptr tp)
+{
+ mp_limb_t d1, d0;
+ unsigned int cnt;
+ gmp_pi1_t dinv;
+ mp_limb_t inv32;
+
+ ASSERT (dn >= 1);
+ ASSERT (nn >= dn);
+ ASSERT (dp[dn - 1] != 0);
+
+ d1 = dp[dn - 1];
+ count_leading_zeros (cnt, d1);
+
+ if (cnt != 0)
+ {
+ mp_limb_t qh, cy;
+ mp_ptr np2, dp2;
+ dp2 = tp; /* dn limbs */
+ mpn_lshift (dp2, dp, dn, cnt);
+
+ np2 = tp + dn; /* (nn + 1) limbs */
+ cy = mpn_lshift (np2, np, nn, cnt);
+ np2[nn++] = cy;
+
+ d0 = dp2[dn - 1];
+ d0 += (~d0 != 0);
+ invert_limb (inv32, d0);
+
+ /* We add nn + dn to tp here, not nn + 1 + dn, as expected. This is
+ since nn here will have been incremented. */
+#if OPERATION_sec_div_qr
+ qh = mpn_sec_pi1_div_qr (np2 + dn, np2, nn, dp2, dn, inv32, tp + nn + dn);
+ ASSERT (qh == 0); /* FIXME: this indicates inefficiency! */
+ MPN_COPY (qp, np2 + dn, nn - dn - 1);
+ qh = np2[nn - 1];
+#else
+ mpn_sec_pi1_div_r (np2, nn, dp2, dn, inv32, tp + nn + dn);
+#endif
+
+ mpn_rshift (np, np2, dn, cnt);
+
+#if OPERATION_sec_div_qr
+ return qh;
+#endif
+ }
+ else
+ {
+ /* FIXME: Consider copying np => np2 here, adding a 0-limb at the top.
+ That would simplify the underlying pi1 function, since then it could
+ assume nn > dn. */
+ d0 = dp[dn - 1];
+ d0 += (~d0 != 0);
+ invert_limb (inv32, d0);
+
+#if OPERATION_sec_div_qr
+ return mpn_sec_pi1_div_qr (qp, np, nn, dp, dn, inv32, tp);
+#else
+ mpn_sec_pi1_div_r (np, nn, dp, dn, inv32, tp);
+#endif
+ }
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/sec_invert.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/sec_invert.c
new file mode 100644
index 00000000000..43a578b2a19
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/sec_invert.c
@@ -0,0 +1,195 @@
+/* mpn_sec_invert
+
+ Contributed to the GNU project by Niels Möller
+
+Copyright 2013 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.h"
+#include "gmp-impl.h"
+
+#if 0
+/* Currently unused. Should be resurrected once mpn_cnd_neg is
+ advertised. */
+static mp_size_t
+mpn_cnd_neg_itch (mp_size_t n)
+{
+ return n;
+}
+#endif
+
+/* FIXME: Ought to return carry */
+static void
+mpn_cnd_neg (int cnd, mp_limb_t *rp, const mp_limb_t *ap, mp_size_t n,
+ mp_ptr scratch)
+{
+ mpn_lshift (scratch, ap, n, 1);
+ mpn_cnd_sub_n (cnd, rp, ap, scratch, n);
+}
+
+static void
+mpn_cnd_swap (int cnd, volatile mp_limb_t *ap, volatile mp_limb_t *bp,
+ mp_size_t n)
+{
+ volatile mp_limb_t mask = - (mp_limb_t) (cnd != 0);
+ mp_size_t i;
+ for (i = 0; i < n; i++)
+ {
+ mp_limb_t a, b, t;
+ a = ap[i];
+ b = bp[i];
+ t = (a ^ b) & mask;
+ ap[i] = a ^ t;
+ bp[i] = b ^ t;
+ }
+}
+
+static int
+mpn_sec_eq_ui (mp_srcptr ap, mp_size_t n, mp_limb_t b)
+{
+ mp_limb_t d;
+ ASSERT (n > 0);
+
+ d = ap[0] ^ b;
+
+ while (--n > 0)
+ d |= ap[n];
+
+ return d == 0;
+}
+
+mp_size_t
+mpn_sec_invert_itch (mp_size_t n)
+{
+ return 4*n;
+}
+
+/* Compute V <-- A^{-1} (mod M), in data-independent time. M must be
+ odd. Returns 1 on success, and 0 on failure (i.e., if gcd (A, m) !=
+ 1). Inputs and outputs of size n, and no overlap allowed. The {ap,
+ n} area is destroyed. For arbitrary inputs, bit_size should be
+ 2*n*GMP_NUMB_BITS, but if A or M are known to be smaller, e.g., if
+ M = 2^521 - 1 and A < M, bit_size can be any bound on the sum of
+ the bit sizes of A and M. */
+int
+mpn_sec_invert (mp_ptr vp, mp_ptr ap, mp_srcptr mp,
+ mp_size_t n, mp_bitcnt_t bit_size,
+ mp_ptr scratch)
+{
+ ASSERT (n > 0);
+ ASSERT (bit_size > 0);
+ ASSERT (mp[0] & 1);
+ ASSERT (! MPN_OVERLAP_P (ap, n, vp, n));
+#define bp (scratch + n)
+#define up (scratch + 2*n)
+#define m1hp (scratch + 3*n)
+
+ /* Maintain
+
+ a = u * orig_a (mod m)
+ b = v * orig_a (mod m)
+
+ and b odd at all times. Initially,
+
+ a = a_orig, u = 1
+ b = m, v = 0
+ */
+
+
+ up[0] = 1;
+ mpn_zero (up+1, n - 1);
+ mpn_copyi (bp, mp, n);
+ mpn_zero (vp, n);
+
+ ASSERT_CARRY (mpn_rshift (m1hp, mp, n, 1));
+ ASSERT_NOCARRY (mpn_sec_add_1 (m1hp, m1hp, n, 1, scratch));
+
+ while (bit_size-- > 0)
+ {
+ mp_limb_t odd, swap, cy;
+
+ /* Always maintain b odd. The logic of the iteration is as
+ follows. For a, b:
+
+ odd = a & 1
+ a -= odd * b
+ if (underflow from a-b)
+ {
+ b += a, assigns old a
+ a = B^n-a
+ }
+
+ a /= 2
+
+ For u, v:
+
+ if (underflow from a - b)
+ swap u, v
+ u -= odd * v
+ if (underflow from u - v)
+ u += m
+
+ u /= 2
+ if (a one bit was shifted out)
+ u += (m+1)/2
+
+ As long as a > 0, the quantity
+
+ (bitsize of a) + (bitsize of b)
+
+ is reduced by at least one bit per iteration, hence after (bit_size of
+ orig_a) + (bit_size of m) - 1 iterations we surely have a = 0. Then b
+ = gcd(orig_a, m) and if b = 1 then also v = orig_a^{-1} (mod m).
+ */
+
+ ASSERT (bp[0] & 1);
+ odd = ap[0] & 1;
+
+ swap = mpn_cnd_sub_n (odd, ap, ap, bp, n);
+ mpn_cnd_add_n (swap, bp, bp, ap, n);
+ mpn_cnd_neg (swap, ap, ap, n, scratch);
+
+ mpn_cnd_swap (swap, up, vp, n);
+ cy = mpn_cnd_sub_n (odd, up, up, vp, n);
+ cy -= mpn_cnd_add_n (cy, up, up, mp, n);
+ ASSERT (cy == 0);
+
+ cy = mpn_rshift (ap, ap, n, 1);
+ ASSERT (cy == 0);
+ cy = mpn_rshift (up, up, n, 1);
+ cy = mpn_cnd_add_n (cy, up, up, m1hp, n);
+ ASSERT (cy == 0);
+ }
+ /* Should be all zeros, but check only extreme limbs */
+ ASSERT ( (ap[0] | ap[n-1]) == 0);
+ /* Check if indeed gcd == 1. */
+ return mpn_sec_eq_ui (bp, n, 1);
+#undef bp
+#undef up
+#undef m1hp
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/sec_mul.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/sec_mul.c
new file mode 100644
index 00000000000..2cd87fab1de
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/sec_mul.c
@@ -0,0 +1,49 @@
+/* mpn_sec_mul.
+
+ Contributed to the GNU project by Torbjörn Granlund.
+
+Copyright 2013 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.h"
+#include "gmp-impl.h"
+
+void
+mpn_sec_mul (mp_ptr rp,
+ mp_srcptr ap, mp_size_t an,
+ mp_srcptr bp, mp_size_t bn,
+ mp_ptr tp)
+{
+ mpn_mul_basecase (rp, ap, an, bp, bn);
+}
+
+mp_size_t
+mpn_sec_mul_itch (mp_size_t an, mp_size_t bn)
+{
+ return 0;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/sec_pi1_div.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/sec_pi1_div.c
new file mode 100644
index 00000000000..1e075daf732
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/sec_pi1_div.c
@@ -0,0 +1,173 @@
+/* mpn_sec_pi1_div_qr, mpn_sec_pi1_div_r -- Compute Q = floor(U / V), U = U
+ mod V. Side-channel silent under the assumption that the used instructions
+ are side-channel silent.
+
+ Contributed to the GNU project by Torbjörn 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 2011-2013 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.h"
+#include "gmp-impl.h"
+#include "longlong.h"
+
+/* This side-channel silent division algorithm reduces the partial remainder by
+ GMP_NUMB_BITS/2 bits at a time, compared to GMP_NUMB_BITS for the main
+ division algorithm. We actually do not insist on reducing by exactly
+ GMP_NUMB_BITS/2, but may leave a partial remainder that is D*B^i to 3D*B^i
+ too large (B is the limb base, D is the divisor, and i is the induction
+ variable); the subsequent step will handle the extra partial remainder bits.
+
+ With that partial remainder reduction, each step generates a quotient "half
+ limb". The outer loop generates two quotient half limbs, an upper (q1h) and
+ a lower (q0h) which are stored sparsely in separate limb arrays. These
+ arrays are added at the end; using separate arrays avoids data-dependent
+ carry propagation which could else pose a side-channel leakage problem.
+
+ The quotient half limbs may be between -3 to 0 from the accurate value
+ ("accurate" being the one which corresponds to a reduction to a principal
+ partial remainder). Too small quotient half limbs correspond to too large
+ remainders, which we reduce later, as described above.
+
+ In order to keep quotients from getting too big, corresponding to a negative
+ partial remainder, we use an inverse which is slightly smaller than usually.
+*/
+
+#if OPERATION_sec_pi1_div_qr
+/* Needs (dn + 1) + (nn - dn) + (nn - dn) = 2nn - dn + 1 limbs at tp. */
+#define FNAME mpn_sec_pi1_div_qr
+#define Q(q) q,
+#define RETTYPE mp_limb_t
+#endif
+#if OPERATION_sec_pi1_div_r
+/* Needs (dn + 1) limbs at tp. */
+#define FNAME mpn_sec_pi1_div_r
+#define Q(q)
+#define RETTYPE void
+#endif
+
+RETTYPE
+FNAME (Q(mp_ptr qp)
+ mp_ptr np, mp_size_t nn,
+ mp_srcptr dp, mp_size_t dn,
+ mp_limb_t dinv,
+ mp_ptr tp)
+{
+ mp_limb_t nh, cy, q1h, q0h, dummy, cnd;
+ mp_size_t i;
+ mp_ptr hp;
+#if OPERATION_sec_pi1_div_qr
+ mp_limb_t qh;
+ mp_ptr qlp, qhp;
+#endif
+
+ ASSERT (dn >= 1);
+ ASSERT (nn >= dn);
+ ASSERT ((dp[dn - 1] & GMP_NUMB_HIGHBIT) != 0);
+
+ if (nn == dn)
+ {
+ cy = mpn_sub_n (np, np, dp, dn);
+ mpn_cnd_add_n (cy, np, np, dp, dn);
+#if OPERATION_sec_pi1_div_qr
+ return 1 - cy;
+#else
+ return;
+#endif
+ }
+
+ /* Create a divisor copy shifted half a limb. */
+ hp = tp; /* (dn + 1) limbs */
+ hp[dn] = mpn_lshift (hp, dp, dn, GMP_NUMB_BITS / 2);
+
+#if OPERATION_sec_pi1_div_qr
+ qlp = tp + (dn + 1); /* (nn - dn) limbs */
+ qhp = tp + (nn + 1); /* (nn - dn) limbs */
+#endif
+
+ np += nn - dn;
+ nh = 0;
+
+ for (i = nn - dn - 1; i >= 0; i--)
+ {
+ np--;
+
+ nh = (nh << GMP_NUMB_BITS/2) + (np[dn] >> GMP_NUMB_BITS/2);
+ umul_ppmm (q1h, dummy, nh, dinv);
+ q1h += nh;
+#if OPERATION_sec_pi1_div_qr
+ qhp[i] = q1h;
+#endif
+ mpn_submul_1 (np, hp, dn + 1, q1h);
+
+ nh = np[dn];
+ umul_ppmm (q0h, dummy, nh, dinv);
+ q0h += nh;
+#if OPERATION_sec_pi1_div_qr
+ qlp[i] = q0h;
+#endif
+ nh -= mpn_submul_1 (np, dp, dn, q0h);
+ }
+
+ /* 1st adjustment depends on extra high remainder limb. */
+ cnd = nh != 0; /* FIXME: cmp-to-int */
+#if OPERATION_sec_pi1_div_qr
+ qlp[0] += cnd;
+#endif
+ nh -= mpn_cnd_sub_n (cnd, np, np, dp, dn);
+
+ /* 2nd adjustment depends on remainder/divisor comparison as well as whether
+ extra remainder limb was nullified by previous subtract. */
+ cy = mpn_sub_n (np, np, dp, dn);
+ cy = cy - nh;
+#if OPERATION_sec_pi1_div_qr
+ qlp[0] += 1 - cy;
+#endif
+ mpn_cnd_add_n (cy, np, np, dp, dn);
+
+ /* 3rd adjustment depends on remainder/divisor comparison. */
+ cy = mpn_sub_n (np, np, dp, dn);
+#if OPERATION_sec_pi1_div_qr
+ qlp[0] += 1 - cy;
+#endif
+ mpn_cnd_add_n (cy, np, np, dp, dn);
+
+#if OPERATION_sec_pi1_div_qr
+ /* Combine quotient halves into final quotient. */
+ qh = mpn_lshift (qhp, qhp, nn - dn, GMP_NUMB_BITS/2);
+ qh += mpn_add_n (qp, qhp, qlp, nn - dn);
+
+ return qh;
+#else
+ return;
+#endif
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/sec_powm.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/sec_powm.c
new file mode 100644
index 00000000000..67de44e10af
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/sec_powm.c
@@ -0,0 +1,438 @@
+/* mpn_sec_powm -- Compute R = U^E mod M. Secure variant, side-channel silent
+ under the assumption that the multiply instruction is side channel silent.
+
+ Contributed to the GNU project by Torbjörn Granlund.
+
+Copyright 2007-2009, 2011, 2012, 2013 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/. */
+
+
+/*
+ BASIC ALGORITHM, Compute U^E mod M, where M < B^n is odd.
+
+ 1. T <- (B^n * U) mod M Convert to REDC form
+
+ 2. Compute table U^0, U^1, U^2... of E-dependent size
+
+ 3. While there are more bits in E
+ W <- power left-to-right base-k
+
+
+ TODO:
+
+ * Make getbits a macro, thereby allowing it to update the index operand.
+ That will simplify the code using getbits. (Perhaps make getbits' sibling
+ getbit then have similar form, for symmetry.)
+
+ * Choose window size without looping. (Superoptimize or think(tm).)
+
+ * REDC_1_TO_REDC_2_THRESHOLD might actually represent the cutoff between
+ redc_1 and redc_n. On such systems, we will switch to redc_2 causing
+ slowdown.
+*/
+
+#include "gmp.h"
+#include "gmp-impl.h"
+#include "longlong.h"
+
+#undef MPN_REDC_1_SEC
+#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)
+
+#undef MPN_REDC_2_SEC
+#define MPN_REDC_2_SEC(rp, up, mp, n, mip) \
+ do { \
+ mp_limb_t cy; \
+ 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
+#endif
+
+/* Define our own mpn squaring function. We do this since we cannot use a
+ native mpn_sqr_basecase over TUNE_SQR_TOOM2_MAX, or a non-native one over
+ 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
+#endif
+
+#if HAVE_NATIVE_mpn_sqr_basecase
+#ifdef TUNE_SQR_TOOM2_MAX
+/* We slightly abuse TUNE_SQR_TOOM2_MAX here. If it is set for an assembly
+ mpn_sqr_basecase, it comes from SQR_TOOM2_THRESHOLD_MAX in the assembly
+ file. An assembly mpn_sqr_basecase that does not define it, should allow
+ any size. */
+#define SQR_BASECASE_LIM SQR_TOOM2_THRESHOLD
+#endif
+#endif
+
+#ifdef WANT_FAT_BINARY
+/* For fat builds, we use SQR_TOOM2_THRESHOLD which will expand to a read from
+ __gmpn_cpuvec. Perhaps any possible sqr_basecase.asm allow any size, and we
+ limit the use unnecessarily. We cannot tell, so play it safe. FIXME. */
+#define SQR_BASECASE_LIM SQR_TOOM2_THRESHOLD
+#endif
+
+#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
+/* Define our own squaring function, which uses mpn_sqr_basecase for its
+ allowed sizes, but its own code for larger sizes. */
+static void
+mpn_local_sqr (mp_ptr rp, mp_srcptr up, mp_size_t n, mp_ptr tp)
+{
+ mp_size_t i;
+
+ ASSERT (n >= 1);
+ ASSERT (! MPN_OVERLAP_P (rp, 2*n, up, n));
+
+ if (BELOW_THRESHOLD (n, SQR_BASECASE_LIM))
+ {
+ mpn_sqr_basecase (rp, up, n);
+ return;
+ }
+
+ {
+ 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)
+ {
+ mp_limb_t cy;
+
+ cy = mpn_mul_1 (tp, up + 1, n - 1, up[0]);
+ tp[n - 1] = cy;
+ for (i = 2; i < n; i++)
+ {
+ mp_limb_t cy;
+ cy = mpn_addmul_1 (tp + 2 * i - 2, up + i, n - i, up[i - 1]);
+ tp[n + i - 2] = cy;
+ }
+ MPN_SQR_DIAGONAL (rp + 2, up + 1, n - 1);
+
+ {
+ mp_limb_t cy;
+#if HAVE_NATIVE_mpn_addlsh1_n
+ cy = mpn_addlsh1_n (rp + 1, rp + 1, tp, 2 * n - 2);
+#else
+ cy = mpn_lshift (tp, tp, 2 * n - 2, 1);
+ cy += mpn_add_n (rp + 1, rp + 1, tp, 2 * n - 2);
+#endif
+ rp[2 * n - 1] += cy;
+ }
+ }
+}
+#endif
+
+#define getbit(p,bi) \
+ ((p[(bi - 1) / GMP_NUMB_BITS] >> (bi - 1) % GMP_NUMB_BITS) & 1)
+
+/* FIXME: Maybe some things would get simpler if all callers ensure
+ that bi >= nbits. As far as I understand, with the current code bi
+ < nbits can happen only for the final iteration. */
+static inline mp_limb_t
+getbits (const mp_limb_t *p, mp_bitcnt_t bi, int nbits)
+{
+ int nbits_in_r;
+ mp_limb_t r;
+ mp_size_t i;
+
+ if (bi < nbits)
+ {
+ return p[0] & (((mp_limb_t) 1 << bi) - 1);
+ }
+ else
+ {
+ bi -= nbits; /* bit index of low bit to extract */
+ i = bi / GMP_NUMB_BITS; /* word index of low bit to extract */
+ bi %= GMP_NUMB_BITS; /* bit index in low word */
+ r = p[i] >> bi; /* extract (low) bits */
+ 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);
+ }
+}
+
+#ifndef POWM_SEC_TABLE
+#if GMP_NUMB_BITS < 50
+#define POWM_SEC_TABLE 2,33,96,780,2741
+#else
+#define POWM_SEC_TABLE 2,130,524,2578
+#endif
+#endif
+
+#if TUNE_PROGRAM_BUILD
+extern int win_size (mp_bitcnt_t);
+#else
+static inline int
+win_size (mp_bitcnt_t enb)
+{
+ int k;
+ /* Find k, such that x[k-1] < enb <= x[k].
+
+ We require that x[k] >= k, then it follows that enb > x[k-1] >=
+ k-1, which implies k <= enb.
+ */
+ static const mp_bitcnt_t x[] = {0,POWM_SEC_TABLE,~(mp_bitcnt_t)0};
+ for (k = 1; enb > x[k]; k++)
+ ;
+ ASSERT (k <= enb);
+ return k;
+}
+#endif
+
+/* Convert U to REDC form, U_r = B^n * U mod M.
+ Uses scratch space at tp of size 2un + n + 1. */
+static void
+redcify (mp_ptr rp, mp_srcptr up, mp_size_t un, mp_srcptr mp, mp_size_t n, mp_ptr tp)
+{
+ MPN_ZERO (tp, n);
+ MPN_COPY (tp + n, up, un);
+
+ mpn_sec_div_r (tp, un + n, mp, n, tp + un + n);
+ MPN_COPY (rp, tp, n);
+}
+
+/* {rp, n} <-- {bp, bn} ^ {ep, en} mod {mp, n},
+ where en = ceil (enb / GMP_NUMB_BITS)
+ Requires that {mp, n} is odd (and hence also mp[0] odd).
+ Uses scratch space at tp as defined by mpn_sec_powm_itch. */
+void
+mpn_sec_powm (mp_ptr rp, mp_srcptr bp, mp_size_t bn,
+ mp_srcptr ep, mp_bitcnt_t enb,
+ mp_srcptr mp, mp_size_t n, mp_ptr tp)
+{
+ mp_limb_t ip[2], *mip;
+ int windowsize, this_windowsize;
+ mp_limb_t expbits;
+ mp_ptr pp, this_pp;
+ long i;
+ int cnd;
+
+ ASSERT (enb > 0);
+ ASSERT (n > 0);
+ /* The code works for bn = 0, but the defined scratch space is 2 limbs
+ greater than we supply, when converting 1 to redc form . */
+ ASSERT (bn > 0);
+ ASSERT ((mp[0] & 1) != 0);
+
+ windowsize = win_size (enb);
+
+#if WANT_REDC_2
+ if (BELOW_THRESHOLD (n, REDC_1_TO_REDC_2_THRESHOLD))
+ {
+ mip = ip;
+ binvert_limb (mip[0], mp[0]);
+ mip[0] = -mip[0];
+ }
+ else
+ {
+ mip = ip;
+ 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 */
+
+ /* Compute pp[0] table entry */
+ /* scratch: | n | 1 | n+2 | */
+ /* | pp[0] | 1 | redcify | */
+ this_pp = pp;
+ this_pp[n] = 1;
+ redcify (this_pp, this_pp + n, 1, mp, n, this_pp + n + 1);
+ this_pp += n;
+
+ /* Compute pp[1] table entry. To avoid excessive scratch usage in the
+ degenerate situation where B >> M, we let redcify use scratch space which
+ will later be used by the pp table (element 2 and up). */
+ /* scratch: | n | n | bn + n + 1 | */
+ /* | pp[0] | pp[1] | redcify | */
+ redcify (this_pp, bp, bn, mp, n, this_pp + n);
+
+ /* 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--)
+ {
+ 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
+ }
+
+ expbits = getbits (ep, enb, windowsize);
+ ASSERT_ALWAYS (enb >= windowsize);
+ enb -= windowsize;
+
+ mpn_sec_tabselect (rp, pp, n, 1 << windowsize, expbits);
+
+ /* Main exponentiation loop. */
+ /* scratch: | n | n | ... | | 3n-4n | */
+ /* | pp[0] | pp[1] | ... | pp[2^windowsize-1] | loop scratch | */
+
+#define INNERLOOP \
+ while (enb != 0) \
+ { \
+ expbits = getbits (ep, enb, windowsize); \
+ this_windowsize = windowsize; \
+ if (enb < windowsize) \
+ { \
+ this_windowsize -= windowsize - enb; \
+ enb = 0; \
+ } \
+ else \
+ enb -= windowsize; \
+ \
+ do \
+ { \
+ mpn_local_sqr (tp, rp, n, tp + 2 * n); \
+ MPN_REDUCE (rp, tp, mp, n, mip); \
+ this_windowsize--; \
+ } \
+ while (this_windowsize != 0); \
+ \
+ mpn_sec_tabselect (tp + 2*n, pp, n, 1 << windowsize, expbits); \
+ mpn_mul_basecase (tp, rp, n, tp + 2*n, n); \
+ \
+ 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);
+}
+
+mp_size_t
+mpn_sec_powm_itch (mp_size_t bn, mp_bitcnt_t enb, mp_size_t n)
+{
+ int windowsize;
+ mp_size_t redcify_itch, itch;
+
+ /* 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
+ mpn_sqr_basecase. We assume 4n always for now.) */
+
+ windowsize = win_size (enb);
+
+ /* The 2n term is due to pp[0] and pp[1] at the time of the 2nd redcify call,
+ the (bn + n) term is due to redcify's own usage, and the rest is due to
+ mpn_sec_div_r's usage when called from redcify. */
+ redcify_itch = (2 * n) + (bn + n) + ((bn + n) + 2 * n + 2);
+
+ /* The n * 2^windowsize term is due to the power table, the 4n term is due to
+ scratch needs of squaring/multiplication in the exponentiation loop. */
+ itch = (n << windowsize) + (4 * n);
+
+ return MAX (itch, redcify_itch);
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/sec_sqr.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/sec_sqr.c
new file mode 100644
index 00000000000..736924cc222
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/sec_sqr.c
@@ -0,0 +1,48 @@
+/* mpn_sec_sqr.
+
+ Contributed to the GNU project by Torbjörn Granlund.
+
+Copyright 2013 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.h"
+#include "gmp-impl.h"
+
+void
+mpn_sec_sqr (mp_ptr rp,
+ mp_srcptr ap, mp_size_t an,
+ mp_ptr tp)
+{
+ mpn_sqr_basecase (rp, ap, an);
+}
+
+mp_size_t
+mpn_sec_sqr_itch (mp_size_t an)
+{
+ return 0;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/sec_tabselect.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/sec_tabselect.c
new file mode 100644
index 00000000000..7ea2ffda63b
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/sec_tabselect.c
@@ -0,0 +1,55 @@
+/* mpn_sec_tabselect.
+
+Copyright 2007-2009, 2011, 2013 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.h"
+#include "gmp-impl.h"
+
+
+/* Select entry `which' from table `tab', which has nents entries, each `n'
+ limbs. Store the selected entry at rp. Reads entire table to avoid
+ side-channel information leaks. O(n*nents). */
+void
+mpn_sec_tabselect (volatile mp_limb_t *rp, volatile const mp_limb_t *tab,
+ mp_size_t n, mp_size_t nents, mp_size_t which)
+{
+ mp_size_t k, i;
+ mp_limb_t mask;
+ volatile const mp_limb_t *tp;
+
+ for (k = 0; k < nents; k++)
+ {
+ mask = -(mp_limb_t) (which == k);
+ tp = tab + n * k;
+ for (i = 0; i < n; i++)
+ {
+ rp[i] = (rp[i] & ~mask) | (tp[i] & mask);
+ }
+ }
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/set_str.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/set_str.c
new file mode 100644
index 00000000000..71034e34bf9
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/set_str.c
@@ -0,0 +1,374 @@
+/* mpn_set_str (mp_ptr res_ptr, const char *str, size_t str_len, int base) --
+ Convert a STR_LEN long base BASE byte string pointed to by STR to a limb
+ vector pointed to by RES_PTR. Return the number of limbs in RES_PTR.
+
+ 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.
+
+Copyright 1991-1994, 1996, 2000-2002, 2004, 2006-2008, 2012, 2013 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/. */
+
+
+/* TODO:
+
+ Perhaps do not compute the highest power?
+ Instead, multiply twice by the 2nd highest power:
+
+ _______
+ |_______| hp
+ |_______| pow
+ _______________
+ |_______________| final result
+
+
+ _______
+ |_______| hp
+ |___| pow[-1]
+ ___________
+ |___________| intermediate result
+ |___| pow[-1]
+ _______________
+ |_______________| final result
+
+ Generalizing that idea, perhaps we should make powtab contain successive
+ 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)
+{
+ if (POW2_P (base))
+ {
+ /* The base is a power of 2. Read the input string from least to most
+ significant character/digit. */
+
+ const unsigned char *s;
+ int next_bitpos;
+ mp_limb_t res_digit;
+ mp_size_t size;
+ int bits_per_indigit = mp_bases[base].big_base;
+
+ size = 0;
+ res_digit = 0;
+ next_bitpos = 0;
+
+ for (s = str + str_len - 1; s >= str; s--)
+ {
+ int inp_digit = *s;
+
+ res_digit |= ((mp_limb_t) inp_digit << next_bitpos) & GMP_NUMB_MASK;
+ next_bitpos += bits_per_indigit;
+ if (next_bitpos >= GMP_NUMB_BITS)
+ {
+ rp[size++] = res_digit;
+ next_bitpos -= GMP_NUMB_BITS;
+ res_digit = inp_digit >> (bits_per_indigit - next_bitpos);
+ }
+ }
+
+ if (res_digit != 0)
+ rp[size++] = res_digit;
+ return size;
+ }
+
+ if (BELOW_THRESHOLD (str_len, SET_STR_PRECOMPUTE_THRESHOLD))
+ return mpn_bc_set_str (rp, str, str_len, base);
+ else
+ {
+ mp_ptr powtab_mem, tp;
+ powers_t powtab[GMP_LIMB_BITS];
+ int chars_per_limb;
+ mp_size_t size;
+ mp_size_t un;
+ TMP_DECL;
+
+ TMP_MARK;
+
+ chars_per_limb = mp_bases[base].chars_per_limb;
+
+ un = str_len / chars_per_limb + 1;
+
+ /* Allocate one large block for the powers of big_base. */
+ powtab_mem = TMP_BALLOC_LIMBS (mpn_dc_set_str_powtab_alloc (un));
+
+ mpn_set_str_compute_powtab (powtab, powtab_mem, un, base);
+
+ tp = TMP_BALLOC_LIMBS (mpn_dc_set_str_itch (un));
+ size = mpn_dc_set_str (rp, str, str_len, powtab, tp);
+
+ TMP_FREE;
+ return size;
+ }
+}
+
+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)
+{
+ size_t len_lo, len_hi;
+ mp_limb_t cy;
+ mp_size_t ln, hn, n, sn;
+
+ len_lo = powtab->digits_in_base;
+
+ if (str_len <= len_lo)
+ {
+ 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);
+ }
+
+ len_hi = str_len - len_lo;
+ ASSERT (len_lo >= len_hi);
+
+ 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);
+
+ sn = powtab->shift;
+
+ if (hn == 0)
+ {
+ /* Zero +1 limb here, to avoid reading an allocated but uninitialised
+ limb in mpn_incr_u below. */
+ MPN_ZERO (rp, powtab->n + sn + 1);
+ }
+ else
+ {
+ if (powtab->n > hn)
+ mpn_mul (rp + sn, powtab->p, powtab->n, tp, hn);
+ else
+ mpn_mul (rp + sn, tp, hn, powtab->p, powtab->n);
+ MPN_ZERO (rp, sn);
+ }
+
+ str = str + str_len - len_lo;
+ 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);
+
+ if (ln != 0)
+ {
+ cy = mpn_add_n (rp, rp, tp, ln);
+ mpn_incr_u (rp + ln, cy);
+ }
+ n = hn + powtab->n + sn;
+ return n - (rp[n - 1] == 0);
+}
+
+mp_size_t
+mpn_bc_set_str (mp_ptr rp, const unsigned char *str, size_t str_len, int base)
+{
+ mp_size_t size;
+ size_t i;
+ long j;
+ mp_limb_t cy_limb;
+
+ mp_limb_t big_base;
+ int chars_per_limb;
+ mp_limb_t res_digit;
+
+ ASSERT (base >= 2);
+ ASSERT (base < numberof (mp_bases));
+ ASSERT (str_len >= 1);
+
+ big_base = mp_bases[base].big_base;
+ chars_per_limb = mp_bases[base].chars_per_limb;
+
+ size = 0;
+ for (i = chars_per_limb; i < str_len; i += chars_per_limb)
+ {
+ res_digit = *str++;
+ if (base == 10)
+ { /* This is a common case.
+ Help the compiler to avoid multiplication. */
+ for (j = MP_BASES_CHARS_PER_LIMB_10 - 1; j != 0; j--)
+ res_digit = res_digit * 10 + *str++;
+ }
+ else
+ {
+ for (j = chars_per_limb - 1; j != 0; j--)
+ res_digit = res_digit * base + *str++;
+ }
+
+ if (size == 0)
+ {
+ if (res_digit != 0)
+ {
+ rp[0] = res_digit;
+ size = 1;
+ }
+ }
+ else
+ {
+#if HAVE_NATIVE_mpn_mul_1c
+ cy_limb = mpn_mul_1c (rp, rp, size, big_base, res_digit);
+#else
+ cy_limb = mpn_mul_1 (rp, rp, size, big_base);
+ cy_limb += mpn_add_1 (rp, rp, size, res_digit);
+#endif
+ if (cy_limb != 0)
+ rp[size++] = cy_limb;
+ }
+ }
+
+ big_base = base;
+ res_digit = *str++;
+ if (base == 10)
+ { /* This is a common case.
+ Help the compiler to avoid multiplication. */
+ for (j = str_len - (i - MP_BASES_CHARS_PER_LIMB_10) - 1; j > 0; j--)
+ {
+ res_digit = res_digit * 10 + *str++;
+ big_base *= 10;
+ }
+ }
+ else
+ {
+ for (j = str_len - (i - chars_per_limb) - 1; j > 0; j--)
+ {
+ res_digit = res_digit * base + *str++;
+ big_base *= base;
+ }
+ }
+
+ if (size == 0)
+ {
+ if (res_digit != 0)
+ {
+ rp[0] = res_digit;
+ size = 1;
+ }
+ }
+ else
+ {
+#if HAVE_NATIVE_mpn_mul_1c
+ cy_limb = mpn_mul_1c (rp, rp, size, big_base, res_digit);
+#else
+ cy_limb = mpn_mul_1 (rp, rp, size, big_base);
+ cy_limb += mpn_add_1 (rp, rp, size, res_digit);
+#endif
+ if (cy_limb != 0)
+ rp[size++] = cy_limb;
+ }
+ return size;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/sizeinbase.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/sizeinbase.c
new file mode 100644
index 00000000000..16633569ec2
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/sizeinbase.c
@@ -0,0 +1,50 @@
+/* mpn_sizeinbase -- approximation to chars required for an mpn.
+
+ 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 1991, 1993-1995, 2001, 2002, 2011, 2012 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.h"
+#include "gmp-impl.h"
+#include "longlong.h"
+
+
+/* Same as mpz_sizeinbase, meaning exact for power-of-2 bases, and either
+ exact or 1 too big for other bases. */
+
+size_t
+mpn_sizeinbase (mp_srcptr xp, mp_size_t xsize, int base)
+{
+ size_t result;
+ MPN_SIZEINBASE (result, xp, xsize, base);
+ return result;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/sqr.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/sqr.c
new file mode 100644
index 00000000000..3743761f784
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/sqr.c
@@ -0,0 +1,99 @@
+/* mpn_sqr -- square natural numbers.
+
+Copyright 1991, 1993, 1994, 1996-2003, 2005, 2008, 2009 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.h"
+#include "gmp-impl.h"
+#include "longlong.h"
+
+void
+mpn_sqr (mp_ptr p, mp_srcptr a, mp_size_t n)
+{
+ ASSERT (n >= 1);
+ ASSERT (! MPN_OVERLAP_P (p, 2 * n, a, n));
+
+ if (BELOW_THRESHOLD (n, SQR_BASECASE_THRESHOLD))
+ { /* mul_basecase is faster than sqr_basecase on small sizes sometimes */
+ mpn_mul_basecase (p, a, n, a, n);
+ }
+ else if (BELOW_THRESHOLD (n, SQR_TOOM2_THRESHOLD))
+ {
+ mpn_sqr_basecase (p, a, n);
+ }
+ else if (BELOW_THRESHOLD (n, SQR_TOOM3_THRESHOLD))
+ {
+ /* Allocate workspace of fixed size on stack: fast! */
+ mp_limb_t ws[mpn_toom2_sqr_itch (SQR_TOOM3_THRESHOLD_LIMIT-1)];
+ ASSERT (SQR_TOOM3_THRESHOLD <= SQR_TOOM3_THRESHOLD_LIMIT);
+ mpn_toom2_sqr (p, a, n, ws);
+ }
+ else if (BELOW_THRESHOLD (n, SQR_TOOM4_THRESHOLD))
+ {
+ mp_ptr ws;
+ TMP_SDECL;
+ TMP_SMARK;
+ ws = TMP_SALLOC_LIMBS (mpn_toom3_sqr_itch (n));
+ mpn_toom3_sqr (p, a, n, ws);
+ TMP_SFREE;
+ }
+ else if (BELOW_THRESHOLD (n, SQR_TOOM6_THRESHOLD))
+ {
+ mp_ptr ws;
+ TMP_SDECL;
+ TMP_SMARK;
+ ws = TMP_SALLOC_LIMBS (mpn_toom4_sqr_itch (n));
+ mpn_toom4_sqr (p, a, n, ws);
+ TMP_SFREE;
+ }
+ else if (BELOW_THRESHOLD (n, SQR_TOOM8_THRESHOLD))
+ {
+ mp_ptr ws;
+ TMP_SDECL;
+ TMP_SMARK;
+ ws = TMP_SALLOC_LIMBS (mpn_toom6_sqr_itch (n));
+ mpn_toom6_sqr (p, a, n, ws);
+ TMP_SFREE;
+ }
+ else if (BELOW_THRESHOLD (n, SQR_FFT_THRESHOLD))
+ {
+ mp_ptr ws;
+ TMP_DECL;
+ TMP_MARK;
+ ws = TMP_ALLOC_LIMBS (mpn_toom8_sqr_itch (n));
+ mpn_toom8_sqr (p, a, n, ws);
+ TMP_FREE;
+ }
+ else
+ {
+ /* The current FFT code allocates its own space. That should probably
+ change. */
+ mpn_fft_mul (p, a, n, a, n);
+ }
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/sqr_basecase.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/sqr_basecase.c
new file mode 100644
index 00000000000..fc6a043a946
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/sqr_basecase.c
@@ -0,0 +1,325 @@
+/* mpn_sqr_basecase -- Internal routine to square a natural number
+ of length n.
+
+ THIS IS AN INTERNAL FUNCTION WITH A MUTABLE INTERFACE. IT IS ONLY
+ SAFE TO REACH THIS FUNCTION THROUGH DOCUMENTED INTERFACES.
+
+
+Copyright 1991-1994, 1996, 1997, 2000-2005, 2008, 2010, 2011 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.h"
+#include "gmp-impl.h"
+#include "longlong.h"
+
+
+#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_diag_addlsh1
+#define MPN_SQR_DIAG_ADDLSH1(rp, tp, up, n) \
+ mpn_sqr_diag_addlsh1 (rp, tp, up, n)
+#else
+#if HAVE_NATIVE_mpn_addlsh1_n
+#define MPN_SQR_DIAG_ADDLSH1(rp, tp, up, n) \
+ do { \
+ mp_limb_t cy; \
+ MPN_SQR_DIAGONAL (rp, up, n); \
+ cy = mpn_addlsh1_n (rp + 1, rp + 1, tp, 2 * n - 2); \
+ rp[2 * n - 1] += cy; \
+ } while (0)
+#else
+#define MPN_SQR_DIAG_ADDLSH1(rp, tp, up, n) \
+ do { \
+ mp_limb_t cy; \
+ MPN_SQR_DIAGONAL (rp, up, n); \
+ cy = mpn_lshift (tp, tp, 2 * n - 2, 1); \
+ cy += mpn_add_n (rp + 1, rp + 1, tp, 2 * n - 2); \
+ rp[2 * n - 1] += cy; \
+ } while (0)
+#endif
+#endif
+
+
+#undef READY_WITH_mpn_sqr_basecase
+
+
+#if ! defined (READY_WITH_mpn_sqr_basecase) && HAVE_NATIVE_mpn_addmul_2s
+void
+mpn_sqr_basecase (mp_ptr rp, mp_srcptr up, mp_size_t n)
+{
+ mp_size_t i;
+ mp_limb_t tarr[2 * SQR_TOOM2_THRESHOLD];
+ mp_ptr tp = tarr;
+ mp_limb_t cy;
+
+ /* must fit 2*n limbs in tarr */
+ ASSERT (n <= SQR_TOOM2_THRESHOLD);
+
+ if ((n & 1) != 0)
+ {
+ 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;
+ return;
+ }
+
+ MPN_ZERO (tp, n);
+
+ for (i = 0; i <= n - 2; i += 2)
+ {
+ cy = mpn_addmul_2s (tp + 2 * i, up + i + 1, n - (i + 1), up + i);
+ tp[n + i] = cy;
+ }
+ }
+ else
+ {
+ if (n == 2)
+ {
+#if HAVE_NATIVE_mpn_mul_2
+ rp[3] = mpn_mul_2 (rp, up, 2, up);
+#else
+ rp[0] = 0;
+ rp[1] = 0;
+ rp[3] = mpn_addmul_2 (rp, up, 2, up);
+#endif
+ return;
+ }
+
+ MPN_ZERO (tp, n);
+
+ for (i = 0; i <= n - 4; i += 2)
+ {
+ cy = mpn_addmul_2s (tp + 2 * i, up + i + 1, n - (i + 1), up + i);
+ tp[n + i] = cy;
+ }
+ cy = mpn_addmul_1 (tp + 2 * n - 4, up + n - 1, 1, up[n - 2]);
+ tp[2 * n - 3] = cy;
+ }
+
+ MPN_SQR_DIAG_ADDLSH1 (rp, tp, up, n);
+}
+#define READY_WITH_mpn_sqr_basecase
+#endif
+
+
+#if ! defined (READY_WITH_mpn_sqr_basecase) && HAVE_NATIVE_mpn_addmul_2
+
+/* mpn_sqr_basecase using plain mpn_addmul_2.
+
+ This is tricky, since we have to let mpn_addmul_2 make some undesirable
+ multiplies, u[k]*u[k], that we would like to let mpn_sqr_diagonal handle.
+ This forces us to conditionally add or subtract the mpn_sqr_diagonal
+ results. Examples of the product we form:
+
+ n = 4 n = 5 n = 6
+ u1u0 * u3u2u1 u1u0 * u4u3u2u1 u1u0 * u5u4u3u2u1
+ u2 * u3 u3u2 * u4u3 u3u2 * u5u4u3
+ u4 * u5
+ add: u0 u2 u3 add: u0 u2 u4 add: u0 u2 u4 u5
+ sub: u1 sub: u1 u3 sub: u1 u3
+*/
+
+void
+mpn_sqr_basecase (mp_ptr rp, mp_srcptr up, mp_size_t n)
+{
+ mp_size_t i;
+ mp_limb_t tarr[2 * SQR_TOOM2_THRESHOLD];
+ mp_ptr tp = tarr;
+ mp_limb_t cy;
+
+ /* must fit 2*n limbs in tarr */
+ ASSERT (n <= SQR_TOOM2_THRESHOLD);
+
+ if ((n & 1) != 0)
+ {
+ mp_limb_t x0, x1;
+
+ 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;
+ return;
+ }
+
+ /* The code below doesn't like unnormalized operands. Since such
+ operands are unusual, handle them with a dumb recursion. */
+ if (up[n - 1] == 0)
+ {
+ rp[2 * n - 2] = 0;
+ rp[2 * n - 1] = 0;
+ mpn_sqr_basecase (rp, up, n - 1);
+ return;
+ }
+
+ MPN_ZERO (tp, n);
+
+ for (i = 0; i <= n - 2; i += 2)
+ {
+ cy = mpn_addmul_2 (tp + 2 * i, up + i + 1, n - (i + 1), up + i);
+ tp[n + i] = cy;
+ }
+
+ MPN_SQR_DIAGONAL (rp, up, n);
+
+ for (i = 2;; i += 4)
+ {
+ x0 = rp[i + 0];
+ rp[i + 0] = (-x0) & GMP_NUMB_MASK;
+ x1 = rp[i + 1];
+ rp[i + 1] = (-x1 - (x0 != 0)) & GMP_NUMB_MASK;
+ __GMPN_SUB_1 (cy, rp + i + 2, rp + i + 2, 2, (x1 | x0) != 0);
+ if (i + 4 >= 2 * n)
+ break;
+ mpn_incr_u (rp + i + 4, cy);
+ }
+ }
+ else
+ {
+ mp_limb_t x0, x1;
+
+ if (n == 2)
+ {
+#if HAVE_NATIVE_mpn_mul_2
+ rp[3] = mpn_mul_2 (rp, up, 2, up);
+#else
+ rp[0] = 0;
+ rp[1] = 0;
+ rp[3] = mpn_addmul_2 (rp, up, 2, up);
+#endif
+ return;
+ }
+
+ /* The code below doesn't like unnormalized operands. Since such
+ operands are unusual, handle them with a dumb recursion. */
+ if (up[n - 1] == 0)
+ {
+ rp[2 * n - 2] = 0;
+ rp[2 * n - 1] = 0;
+ mpn_sqr_basecase (rp, up, n - 1);
+ return;
+ }
+
+ MPN_ZERO (tp, n);
+
+ for (i = 0; i <= n - 4; i += 2)
+ {
+ cy = mpn_addmul_2 (tp + 2 * i, up + i + 1, n - (i + 1), up + i);
+ tp[n + i] = cy;
+ }
+ cy = mpn_addmul_1 (tp + 2 * n - 4, up + n - 1, 1, up[n - 2]);
+ tp[2 * n - 3] = cy;
+
+ MPN_SQR_DIAGONAL (rp, up, n);
+
+ for (i = 2;; i += 4)
+ {
+ x0 = rp[i + 0];
+ rp[i + 0] = (-x0) & GMP_NUMB_MASK;
+ x1 = rp[i + 1];
+ rp[i + 1] = (-x1 - (x0 != 0)) & GMP_NUMB_MASK;
+ if (i + 6 >= 2 * n)
+ break;
+ __GMPN_SUB_1 (cy, rp + i + 2, rp + i + 2, 2, (x1 | x0) != 0);
+ mpn_incr_u (rp + i + 4, cy);
+ }
+ mpn_decr_u (rp + i + 2, (x1 | x0) != 0);
+ }
+
+#if HAVE_NATIVE_mpn_addlsh1_n
+ cy = mpn_addlsh1_n (rp + 1, rp + 1, tp, 2 * n - 2);
+#else
+ cy = mpn_lshift (tp, tp, 2 * n - 2, 1);
+ cy += mpn_add_n (rp + 1, rp + 1, tp, 2 * n - 2);
+#endif
+ rp[2 * n - 1] += cy;
+}
+#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)
+{
+ mp_size_t i;
+
+ 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)
+ {
+ mp_limb_t tarr[2 * SQR_TOOM2_THRESHOLD];
+ mp_ptr tp = tarr;
+ mp_limb_t cy;
+
+ /* must fit 2*n limbs in tarr */
+ ASSERT (n <= SQR_TOOM2_THRESHOLD);
+
+ cy = mpn_mul_1 (tp, up + 1, n - 1, up[0]);
+ tp[n - 1] = cy;
+ for (i = 2; i < n; i++)
+ {
+ mp_limb_t cy;
+ cy = mpn_addmul_1 (tp + 2 * i - 2, up + i, n - i, up[i - 1]);
+ tp[n + i - 2] = cy;
+ }
+
+ MPN_SQR_DIAG_ADDLSH1 (rp, tp, up, n);
+ }
+}
+#endif
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/sqrmod_bnm1.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/sqrmod_bnm1.c
new file mode 100644
index 00000000000..fd0868b90b7
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/sqrmod_bnm1.c
@@ -0,0 +1,313 @@
+/* sqrmod_bnm1.c -- squaring mod B^n-1.
+
+ Contributed to the GNU project by Niels Möller, Torbjorn Granlund and
+ Marco Bodrato.
+
+ 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 2009, 2010, 2012 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.h"
+#include "gmp-impl.h"
+#include "longlong.h"
+
+/* Input is {ap,rn}; output is {rp,rn}, computation is
+ mod B^rn - 1, and values are semi-normalised; zero is represented
+ as either 0 or B^n - 1. Needs a scratch of 2rn limbs at tp.
+ tp==rp is allowed. */
+static void
+mpn_bc_sqrmod_bnm1 (mp_ptr rp, mp_srcptr ap, mp_size_t rn, mp_ptr tp)
+{
+ mp_limb_t cy;
+
+ ASSERT (0 < rn);
+
+ mpn_sqr (tp, ap, rn);
+ cy = mpn_add_n (rp, tp, tp + rn, rn);
+ /* If cy == 1, then the value of rp is at most B^rn - 2, so there can
+ * be no overflow when adding in the carry. */
+ MPN_INCR_U (rp, rn, cy);
+}
+
+
+/* Input is {ap,rn+1}; output is {rp,rn+1}, in
+ semi-normalised representation, computation is mod B^rn + 1. Needs
+ a scratch area of 2rn + 2 limbs at tp; tp == rp is allowed.
+ Output is normalised. */
+static void
+mpn_bc_sqrmod_bnp1 (mp_ptr rp, mp_srcptr ap, mp_size_t rn, mp_ptr tp)
+{
+ mp_limb_t cy;
+
+ ASSERT (0 < rn);
+
+ mpn_sqr (tp, ap, rn + 1);
+ ASSERT (tp[2*rn+1] == 0);
+ 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 );
+}
+
+
+/* Computes {rp,MIN(rn,2an)} <- {ap,an}^2 Mod(B^rn-1)
+ *
+ * The result is expected to be ZERO if and only if the operand
+ * already is. Otherwise the class [0] Mod(B^rn-1) is represented by
+ * B^rn-1.
+ * It should not be a problem if sqrmod_bnm1 is used to
+ * compute the full square with an <= 2*rn, because this condition
+ * implies (B^an-1)^2 < (B^rn-1) .
+ *
+ * Requires rn/4 < an <= rn
+ * Scratch need: rn/2 + (need for recursive call OR rn + 3). This gives
+ *
+ * S(n) <= rn/2 + MAX (rn + 4, S(n/2)) <= 3/2 rn + 4
+ */
+void
+mpn_sqrmod_bnm1 (mp_ptr rp, mp_size_t rn, mp_srcptr ap, mp_size_t an, mp_ptr tp)
+{
+ ASSERT (0 < an);
+ ASSERT (an <= rn);
+
+ if ((rn & 1) != 0 || BELOW_THRESHOLD (rn, SQRMOD_BNM1_THRESHOLD))
+ {
+ if (UNLIKELY (an < rn))
+ {
+ if (UNLIKELY (2*an <= rn))
+ {
+ mpn_sqr (rp, ap, an);
+ }
+ else
+ {
+ mp_limb_t cy;
+ mpn_sqr (tp, ap, an);
+ cy = mpn_add (rp, tp, rn, tp + rn, 2*an - rn);
+ MPN_INCR_U (rp, rn, cy);
+ }
+ }
+ else
+ mpn_bc_sqrmod_bnm1 (rp, ap, rn, tp);
+ }
+ else
+ {
+ mp_size_t n;
+ mp_limb_t cy;
+ mp_limb_t hi;
+
+ n = rn >> 1;
+
+ ASSERT (2*an > n);
+
+ /* Compute xm = a^2 mod (B^n - 1), xp = a^2 mod (B^n + 1)
+ and crt together as
+
+ x = -xp * B^n + (B^n + 1) * [ (xp + xm)/2 mod (B^n-1)]
+ */
+
+#define a0 ap
+#define a1 (ap + n)
+
+#define xp tp /* 2n + 2 */
+ /* am1 maybe in {xp, n} */
+#define sp1 (tp + 2*n + 2)
+ /* ap1 maybe in {sp1, n + 1} */
+
+ {
+ mp_srcptr am1;
+ mp_size_t anm;
+ mp_ptr so;
+
+ if (LIKELY (an > n))
+ {
+ so = xp + n;
+ am1 = xp;
+ cy = mpn_add (xp, a0, n, a1, an - n);
+ MPN_INCR_U (xp, n, cy);
+ anm = n;
+ }
+ else
+ {
+ so = xp;
+ am1 = a0;
+ anm = an;
+ }
+
+ mpn_sqrmod_bnm1 (rp, n, am1, anm, so);
+ }
+
+ {
+ int k;
+ mp_srcptr ap1;
+ mp_size_t anp;
+
+ if (LIKELY (an > n)) {
+ ap1 = sp1;
+ cy = mpn_sub (sp1, a0, n, a1, an - n);
+ sp1[n] = 0;
+ MPN_INCR_U (sp1, n + 1, cy);
+ anp = n + ap1[n];
+ } else {
+ ap1 = a0;
+ anp = an;
+ }
+
+ if (BELOW_THRESHOLD (n, MUL_FFT_MODF_THRESHOLD))
+ k=0;
+ else
+ {
+ int mask;
+ k = mpn_fft_best_k (n, 1);
+ mask = (1<<k) -1;
+ while (n & mask) {k--; mask >>=1;};
+ }
+ if (k >= FFT_FIRST_K)
+ xp[n] = mpn_mul_fft (xp, n, ap1, anp, ap1, anp, k);
+ else if (UNLIKELY (ap1 == a0))
+ {
+ ASSERT (anp <= n);
+ ASSERT (2*anp > n);
+ mpn_sqr (xp, a0, an);
+ anp = 2*an - n;
+ cy = mpn_sub (xp, xp, n, xp + n, anp);
+ xp[n] = 0;
+ MPN_INCR_U (xp, n+1, cy);
+ }
+ else
+ mpn_bc_sqrmod_bnp1 (xp, ap1, n, xp);
+ }
+
+ /* Here the CRT recomposition begins.
+
+ xm <- (xp + xm)/2 = (xp + xm)B^n/2 mod (B^n-1)
+ Division by 2 is a bitwise rotation.
+
+ Assumes xp normalised mod (B^n+1).
+
+ The residue class [0] is represented by [B^n-1]; except when
+ both input are ZERO.
+ */
+
+#if HAVE_NATIVE_mpn_rsh1add_n || HAVE_NATIVE_mpn_rsh1add_nc
+#if HAVE_NATIVE_mpn_rsh1add_nc
+ cy = mpn_rsh1add_nc(rp, rp, xp, n, xp[n]); /* B^n = 1 */
+ hi = cy << (GMP_NUMB_BITS - 1);
+ cy = 0;
+ /* next update of rp[n-1] will set cy = 1 only if rp[n-1]+=hi
+ overflows, i.e. a further increment will not overflow again. */
+#else /* ! _nc */
+ cy = xp[n] + mpn_rsh1add_n(rp, rp, xp, n); /* B^n = 1 */
+ hi = (cy<<(GMP_NUMB_BITS-1))&GMP_NUMB_MASK; /* (cy&1) << ... */
+ cy >>= 1;
+ /* cy = 1 only if xp[n] = 1 i.e. {xp,n} = ZERO, this implies that
+ the rsh1add was a simple rshift: the top bit is 0. cy=1 => hi=0. */
+#endif
+#if GMP_NAIL_BITS == 0
+ add_ssaaaa(cy, rp[n-1], cy, rp[n-1], CNST_LIMB(0), hi);
+#else
+ cy += (hi & rp[n-1]) >> (GMP_NUMB_BITS-1);
+ rp[n-1] ^= hi;
+#endif
+#else /* ! HAVE_NATIVE_mpn_rsh1add_n */
+#if HAVE_NATIVE_mpn_add_nc
+ cy = mpn_add_nc(rp, rp, xp, n, xp[n]);
+#else /* ! _nc */
+ cy = xp[n] + mpn_add_n(rp, rp, xp, n); /* xp[n] == 1 implies {xp,n} == ZERO */
+#endif
+ cy += (rp[0]&1);
+ mpn_rshift(rp, rp, n, 1);
+ ASSERT (cy <= 2);
+ hi = (cy<<(GMP_NUMB_BITS-1))&GMP_NUMB_MASK; /* (cy&1) << ... */
+ cy >>= 1;
+ /* We can have cy != 0 only if hi = 0... */
+ ASSERT ((rp[n-1] & GMP_NUMB_HIGHBIT) == 0);
+ rp[n-1] |= hi;
+ /* ... rp[n-1] + cy can not overflow, the following INCR is correct. */
+#endif
+ ASSERT (cy <= 1);
+ /* Next increment can not overflow, read the previous comments about cy. */
+ ASSERT ((cy == 0) || ((rp[n-1] & GMP_NUMB_HIGHBIT) == 0));
+ MPN_INCR_U(rp, n, cy);
+
+ /* Compute the highest half:
+ ([(xp + xm)/2 mod (B^n-1)] - xp ) * B^n
+ */
+ if (UNLIKELY (2*an < rn))
+ {
+ /* Note that in this case, the only way the result can equal
+ zero mod B^{rn} - 1 is if the input is zero, and
+ then the output of both the recursive calls and this CRT
+ reconstruction is zero, not B^{rn} - 1. */
+ cy = mpn_sub_n (rp + n, rp, xp, 2*an - n);
+
+ /* FIXME: This subtraction of the high parts is not really
+ necessary, we do it to get the carry out, and for sanity
+ checking. */
+ cy = xp[n] + mpn_sub_nc (xp + 2*an - n, rp + 2*an - n,
+ xp + 2*an - n, rn - 2*an, cy);
+ ASSERT (mpn_zero_p (xp + 2*an - n+1, rn - 1 - 2*an));
+ cy = mpn_sub_1 (rp, rp, 2*an, cy);
+ ASSERT (cy == (xp + 2*an - n)[0]);
+ }
+ else
+ {
+ cy = xp[n] + mpn_sub_n (rp + n, rp, xp, n);
+ /* cy = 1 only if {xp,n+1} is not ZERO, i.e. {rp,n} is not ZERO.
+ DECR will affect _at most_ the lowest n limbs. */
+ MPN_DECR_U (rp, 2*n, cy);
+ }
+#undef a0
+#undef a1
+#undef xp
+#undef sp1
+ }
+}
+
+mp_size_t
+mpn_sqrmod_bnm1_next_size (mp_size_t n)
+{
+ mp_size_t nh;
+
+ if (BELOW_THRESHOLD (n, SQRMOD_BNM1_THRESHOLD))
+ return n;
+ if (BELOW_THRESHOLD (n, 4 * (SQRMOD_BNM1_THRESHOLD - 1) + 1))
+ return (n + (2-1)) & (-2);
+ if (BELOW_THRESHOLD (n, 8 * (SQRMOD_BNM1_THRESHOLD - 1) + 1))
+ return (n + (4-1)) & (-4);
+
+ nh = (n + 1) >> 1;
+
+ if (BELOW_THRESHOLD (nh, SQR_FFT_MODF_THRESHOLD))
+ return (n + (8-1)) & (-8);
+
+ return 2 * mpn_fft_next_size (nh, mpn_fft_best_k (nh, 1));
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/sqrtrem.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/sqrtrem.c
new file mode 100644
index 00000000000..7d0f1200017
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/sqrtrem.c
@@ -0,0 +1,357 @@
+/* mpn_sqrtrem -- square root and remainder
+
+ Contributed to the GNU project by Paul Zimmermann (most code) and
+ Torbjorn Granlund (mpn_sqrtrem1).
+
+ 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.
+
+Copyright 1999-2002, 2004, 2005, 2008, 2010, 2012 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/. */
+
+
+/* See "Karatsuba Square Root", reference in gmp.texi. */
+
+
+#include <stdio.h>
+#include <stdlib.h>
+
+#include "gmp.h"
+#include "gmp-impl.h"
+#include "longlong.h"
+
+static const unsigned char invsqrttab[384] = /* The common 0x100 was removed */
+{
+ 0xff,0xfd,0xfb,0xf9,0xf7,0xf5,0xf3,0xf2, /* sqrt(1/80)..sqrt(1/87) */
+ 0xf0,0xee,0xec,0xea,0xe9,0xe7,0xe5,0xe4, /* sqrt(1/88)..sqrt(1/8f) */
+ 0xe2,0xe0,0xdf,0xdd,0xdb,0xda,0xd8,0xd7, /* sqrt(1/90)..sqrt(1/97) */
+ 0xd5,0xd4,0xd2,0xd1,0xcf,0xce,0xcc,0xcb, /* sqrt(1/98)..sqrt(1/9f) */
+ 0xc9,0xc8,0xc6,0xc5,0xc4,0xc2,0xc1,0xc0, /* sqrt(1/a0)..sqrt(1/a7) */
+ 0xbe,0xbd,0xbc,0xba,0xb9,0xb8,0xb7,0xb5, /* sqrt(1/a8)..sqrt(1/af) */
+ 0xb4,0xb3,0xb2,0xb0,0xaf,0xae,0xad,0xac, /* sqrt(1/b0)..sqrt(1/b7) */
+ 0xaa,0xa9,0xa8,0xa7,0xa6,0xa5,0xa4,0xa3, /* sqrt(1/b8)..sqrt(1/bf) */
+ 0xa2,0xa0,0x9f,0x9e,0x9d,0x9c,0x9b,0x9a, /* sqrt(1/c0)..sqrt(1/c7) */
+ 0x99,0x98,0x97,0x96,0x95,0x94,0x93,0x92, /* sqrt(1/c8)..sqrt(1/cf) */
+ 0x91,0x90,0x8f,0x8e,0x8d,0x8c,0x8c,0x8b, /* sqrt(1/d0)..sqrt(1/d7) */
+ 0x8a,0x89,0x88,0x87,0x86,0x85,0x84,0x83, /* sqrt(1/d8)..sqrt(1/df) */
+ 0x83,0x82,0x81,0x80,0x7f,0x7e,0x7e,0x7d, /* sqrt(1/e0)..sqrt(1/e7) */
+ 0x7c,0x7b,0x7a,0x79,0x79,0x78,0x77,0x76, /* sqrt(1/e8)..sqrt(1/ef) */
+ 0x76,0x75,0x74,0x73,0x72,0x72,0x71,0x70, /* sqrt(1/f0)..sqrt(1/f7) */
+ 0x6f,0x6f,0x6e,0x6d,0x6d,0x6c,0x6b,0x6a, /* sqrt(1/f8)..sqrt(1/ff) */
+ 0x6a,0x69,0x68,0x68,0x67,0x66,0x66,0x65, /* sqrt(1/100)..sqrt(1/107) */
+ 0x64,0x64,0x63,0x62,0x62,0x61,0x60,0x60, /* sqrt(1/108)..sqrt(1/10f) */
+ 0x5f,0x5e,0x5e,0x5d,0x5c,0x5c,0x5b,0x5a, /* sqrt(1/110)..sqrt(1/117) */
+ 0x5a,0x59,0x59,0x58,0x57,0x57,0x56,0x56, /* sqrt(1/118)..sqrt(1/11f) */
+ 0x55,0x54,0x54,0x53,0x53,0x52,0x52,0x51, /* sqrt(1/120)..sqrt(1/127) */
+ 0x50,0x50,0x4f,0x4f,0x4e,0x4e,0x4d,0x4d, /* sqrt(1/128)..sqrt(1/12f) */
+ 0x4c,0x4b,0x4b,0x4a,0x4a,0x49,0x49,0x48, /* sqrt(1/130)..sqrt(1/137) */
+ 0x48,0x47,0x47,0x46,0x46,0x45,0x45,0x44, /* sqrt(1/138)..sqrt(1/13f) */
+ 0x44,0x43,0x43,0x42,0x42,0x41,0x41,0x40, /* sqrt(1/140)..sqrt(1/147) */
+ 0x40,0x3f,0x3f,0x3e,0x3e,0x3d,0x3d,0x3c, /* sqrt(1/148)..sqrt(1/14f) */
+ 0x3c,0x3b,0x3b,0x3a,0x3a,0x39,0x39,0x39, /* sqrt(1/150)..sqrt(1/157) */
+ 0x38,0x38,0x37,0x37,0x36,0x36,0x35,0x35, /* sqrt(1/158)..sqrt(1/15f) */
+ 0x35,0x34,0x34,0x33,0x33,0x32,0x32,0x32, /* sqrt(1/160)..sqrt(1/167) */
+ 0x31,0x31,0x30,0x30,0x2f,0x2f,0x2f,0x2e, /* sqrt(1/168)..sqrt(1/16f) */
+ 0x2e,0x2d,0x2d,0x2d,0x2c,0x2c,0x2b,0x2b, /* sqrt(1/170)..sqrt(1/177) */
+ 0x2b,0x2a,0x2a,0x29,0x29,0x29,0x28,0x28, /* sqrt(1/178)..sqrt(1/17f) */
+ 0x27,0x27,0x27,0x26,0x26,0x26,0x25,0x25, /* sqrt(1/180)..sqrt(1/187) */
+ 0x24,0x24,0x24,0x23,0x23,0x23,0x22,0x22, /* sqrt(1/188)..sqrt(1/18f) */
+ 0x21,0x21,0x21,0x20,0x20,0x20,0x1f,0x1f, /* sqrt(1/190)..sqrt(1/197) */
+ 0x1f,0x1e,0x1e,0x1e,0x1d,0x1d,0x1d,0x1c, /* sqrt(1/198)..sqrt(1/19f) */
+ 0x1c,0x1b,0x1b,0x1b,0x1a,0x1a,0x1a,0x19, /* sqrt(1/1a0)..sqrt(1/1a7) */
+ 0x19,0x19,0x18,0x18,0x18,0x18,0x17,0x17, /* sqrt(1/1a8)..sqrt(1/1af) */
+ 0x17,0x16,0x16,0x16,0x15,0x15,0x15,0x14, /* sqrt(1/1b0)..sqrt(1/1b7) */
+ 0x14,0x14,0x13,0x13,0x13,0x12,0x12,0x12, /* sqrt(1/1b8)..sqrt(1/1bf) */
+ 0x12,0x11,0x11,0x11,0x10,0x10,0x10,0x0f, /* sqrt(1/1c0)..sqrt(1/1c7) */
+ 0x0f,0x0f,0x0f,0x0e,0x0e,0x0e,0x0d,0x0d, /* sqrt(1/1c8)..sqrt(1/1cf) */
+ 0x0d,0x0c,0x0c,0x0c,0x0c,0x0b,0x0b,0x0b, /* sqrt(1/1d0)..sqrt(1/1d7) */
+ 0x0a,0x0a,0x0a,0x0a,0x09,0x09,0x09,0x09, /* sqrt(1/1d8)..sqrt(1/1df) */
+ 0x08,0x08,0x08,0x07,0x07,0x07,0x07,0x06, /* sqrt(1/1e0)..sqrt(1/1e7) */
+ 0x06,0x06,0x06,0x05,0x05,0x05,0x04,0x04, /* sqrt(1/1e8)..sqrt(1/1ef) */
+ 0x04,0x04,0x03,0x03,0x03,0x03,0x02,0x02, /* sqrt(1/1f0)..sqrt(1/1f7) */
+ 0x02,0x02,0x01,0x01,0x01,0x01,0x00,0x00 /* sqrt(1/1f8)..sqrt(1/1ff) */
+};
+
+/* Compute s = floor(sqrt(a0)), and *rp = a0 - s^2. */
+
+#if GMP_NUMB_BITS > 32
+#define MAGIC CNST_LIMB(0x10000000000) /* 0xffe7debbfc < MAGIC < 0x232b1850f410 */
+#else
+#define MAGIC CNST_LIMB(0x100000) /* 0xfee6f < MAGIC < 0x29cbc8 */
+#endif
+
+static mp_limb_t
+mpn_sqrtrem1 (mp_ptr rp, mp_limb_t a0)
+{
+#if GMP_NUMB_BITS > 32
+ mp_limb_t a1;
+#endif
+ mp_limb_t x0, t2, t, x2;
+ unsigned abits;
+
+ ASSERT_ALWAYS (GMP_NAIL_BITS == 0);
+ ASSERT_ALWAYS (GMP_LIMB_BITS == 32 || GMP_LIMB_BITS == 64);
+ ASSERT (a0 >= GMP_NUMB_HIGHBIT / 2);
+
+ /* Use Newton iterations for approximating 1/sqrt(a) instead of sqrt(a),
+ since we can do the former without division. As part of the last
+ iteration convert from 1/sqrt(a) to sqrt(a). */
+
+ abits = a0 >> (GMP_LIMB_BITS - 1 - 8); /* extract bits for table lookup */
+ x0 = 0x100 | invsqrttab[abits - 0x80]; /* initial 1/sqrt(a) */
+
+ /* x0 is now an 8 bits approximation of 1/sqrt(a0) */
+
+#if GMP_NUMB_BITS > 32
+ a1 = a0 >> (GMP_LIMB_BITS - 1 - 32);
+ t = (mp_limb_signed_t) (CNST_LIMB(0x2000000000000) - 0x30000 - a1 * x0 * x0) >> 16;
+ x0 = (x0 << 16) + ((mp_limb_signed_t) (x0 * t) >> (16+2));
+
+ /* x0 is now a 16 bits approximation of 1/sqrt(a0) */
+
+ t2 = x0 * (a0 >> (32-8));
+ t = t2 >> 25;
+ t = ((mp_limb_signed_t) ((a0 << 14) - t * t - MAGIC) >> (32-8));
+ x0 = t2 + ((mp_limb_signed_t) (x0 * t) >> 15);
+ x0 >>= 32;
+#else
+ t2 = x0 * (a0 >> (16-8));
+ t = t2 >> 13;
+ t = ((mp_limb_signed_t) ((a0 << 6) - t * t - MAGIC) >> (16-8));
+ x0 = t2 + ((mp_limb_signed_t) (x0 * t) >> 7);
+ x0 >>= 16;
+#endif
+
+ /* x0 is now a full limb approximation of sqrt(a0) */
+
+ x2 = x0 * x0;
+ if (x2 + 2*x0 <= a0 - 1)
+ {
+ x2 += 2*x0 + 1;
+ x0++;
+ }
+
+ *rp = a0 - x2;
+ return x0;
+}
+
+
+#define Prec (GMP_NUMB_BITS >> 1)
+
+/* 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] */
+static mp_limb_t
+mpn_sqrtrem2 (mp_ptr sp, mp_ptr rp, mp_srcptr np)
+{
+ mp_limb_t qhl, q, u, np0, sp0, rp0, q2;
+ int cc;
+
+ ASSERT (np[1] >= GMP_NUMB_HIGHBIT / 2);
+
+ np0 = np[0];
+ sp0 = mpn_sqrtrem1 (rp, np[1]);
+ qhl = 0;
+ rp0 = rp[0];
+ while (rp0 >= sp0)
+ {
+ qhl++;
+ rp0 -= sp0;
+ }
+ /* now rp0 < sp0 < 2^Prec */
+ rp0 = (rp0 << Prec) + (np0 >> Prec);
+ u = 2 * sp0;
+ q = rp0 / u;
+ u = rp0 - q * u;
+ q += (qhl & 1) << (Prec - 1);
+ qhl >>= 1; /* if qhl=1, necessary q=0 as qhl*2^Prec + q <= 2^Prec */
+ /* now we have (initial rp0)<<Prec + np0>>Prec = (qhl<<Prec + q) * (2sp0) + u */
+ sp0 = ((sp0 + qhl) << Prec) + q;
+ cc = u >> Prec;
+ rp0 = ((u << Prec) & GMP_NUMB_MASK) + (np0 & (((mp_limb_t) 1 << Prec) - 1));
+ /* subtract q * q or qhl*2^(2*Prec) from rp */
+ q2 = q * q;
+ cc -= (rp0 < q2) + qhl;
+ rp0 -= q2;
+ /* now subtract 2*q*2^Prec + 2^(2*Prec) if qhl is set */
+ if (cc < 0)
+ {
+ if (sp0 != 0)
+ {
+ rp0 += sp0;
+ cc += rp0 < sp0;
+ }
+ else
+ cc++;
+ --sp0;
+ rp0 += sp0;
+ cc += rp0 < sp0;
+ }
+
+ rp[0] = rp0;
+ sp[0] = sp0;
+ return cc;
+}
+
+/* writes in {sp, n} the square root (rounded towards zero) of {np, 2n},
+ and in {np, n} the low n limbs of the remainder, returns the high
+ limb of the remainder (which is 0 or 1).
+ Assumes {np, 2n} is normalized, i.e. np[2n-1] >= B/4
+ where B=2^GMP_NUMB_BITS. */
+static mp_limb_t
+mpn_dc_sqrtrem (mp_ptr sp, mp_ptr np, mp_size_t n)
+{
+ mp_limb_t q; /* carry out of {sp, n} */
+ int c, b; /* carry out of remainder */
+ mp_size_t l, h;
+
+ ASSERT (np[2 * n - 1] >= GMP_NUMB_HIGHBIT / 2);
+
+ if (n == 1)
+ c = mpn_sqrtrem2 (sp, np, np);
+ else
+ {
+ l = n / 2;
+ h = n - l;
+ q = mpn_dc_sqrtrem (sp + l, np + 2 * l, h);
+ if (q != 0)
+ mpn_sub_n (np + 2 * l, np + 2 * l, sp + l, h);
+ q += mpn_divrem (sp, 0, np + l, n, sp + l, h);
+ c = sp[0] & 1;
+ mpn_rshift (sp, sp, l, 1);
+ sp[l - 1] |= (q << (GMP_NUMB_BITS - 1)) & GMP_NUMB_MASK;
+ q >>= 1;
+ if (c != 0)
+ c = mpn_add_n (np + l, np + l, sp + l, h);
+ 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);
+ q = mpn_add_1 (sp + l, sp + l, h, q);
+
+ if (c < 0)
+ {
+#if HAVE_NATIVE_mpn_addlsh1_n
+ c += mpn_addlsh1_n (np, np, sp, n) + 2 * q;
+#else
+ 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));
+ }
+ }
+
+ return c;
+}
+
+
+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;
+ int c;
+ mp_size_t rn, tn;
+ TMP_DECL;
+
+ ASSERT (nn >= 0);
+ ASSERT_MPN (np, nn);
+
+ /* If OP is zero, both results are zero. */
+ if (nn == 0)
+ return 0;
+
+ ASSERT (np[nn - 1] != 0);
+ ASSERT (rp == NULL || MPN_SAME_OR_SEPARATE_P (np, rp, nn));
+ ASSERT (rp == NULL || ! MPN_OVERLAP_P (sp, (nn + 1) / 2, rp, nn));
+ ASSERT (! MPN_OVERLAP_P (sp, (nn + 1) / 2, np, nn));
+
+ high = np[nn - 1];
+ if (nn == 1 && (high & GMP_NUMB_HIGHBIT))
+ {
+ mp_limb_t r;
+ sp[0] = mpn_sqrtrem1 (&r, high);
+ if (rp != NULL)
+ rp[0] = r;
+ return r != 0;
+ }
+ count_leading_zeros (c, high);
+ c -= GMP_NAIL_BITS;
+
+ c = c / 2; /* we have to shift left by 2c bits to normalize {np, nn} */
+ tn = (nn + 1) / 2; /* 2*tn is the smallest even integer >= nn */
+
+ TMP_MARK;
+ if (nn % 2 != 0 || c > 0)
+ {
+ tp = TMP_ALLOC_LIMBS (2 * tn);
+ tp[0] = 0; /* needed only when 2*tn > nn, but saves a test */
+ if (c != 0)
+ mpn_lshift (tp + 2 * tn - nn, np, nn, 2 * c);
+ else
+ MPN_COPY (tp + 2 * tn - nn, np, nn);
+ rl = mpn_dc_sqrtrem (sp, tp, tn);
+ /* We have 2^(2k)*N = S^2 + R where k = c + (2tn-nn)*GMP_NUMB_BITS/2,
+ thus 2^(2k)*N = (S-s0)^2 + 2*S*s0 - s0^2 + R where s0=S mod 2^k */
+ c += (nn % 2) * GMP_NUMB_BITS / 2; /* c now represents k */
+ s0[0] = sp[0] & (((mp_limb_t) 1 << c) - 1); /* S mod 2^k */
+ rl += mpn_addmul_1 (tp, sp, tn, 2 * s0[0]); /* R = R + 2*s0*S */
+ cc = mpn_submul_1 (tp, s0, 1, s0[0]);
+ rl -= (tn > 1) ? mpn_sub_1 (tp + 1, tp + 1, tn - 1, cc) : cc;
+ mpn_rshift (sp, sp, tn, c);
+ tp[tn] = rl;
+ if (rp == NULL)
+ rp = tp;
+ c = c << 1;
+ if (c < GMP_NUMB_BITS)
+ tn++;
+ else
+ {
+ tp++;
+ c -= GMP_NUMB_BITS;
+ }
+ if (c != 0)
+ mpn_rshift (rp, tp, tn, c);
+ else
+ MPN_COPY_INCR (rp, tp, tn);
+ rn = tn;
+ }
+ else
+ {
+ if (rp == NULL)
+ rp = TMP_ALLOC_LIMBS (nn);
+ if (rp != np)
+ MPN_COPY (rp, np, nn);
+ rn = tn + (rp[tn] = mpn_dc_sqrtrem (sp, rp, tn));
+ }
+
+ MPN_NORMALIZE (rp, rn);
+
+ TMP_FREE;
+ return rn;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/sub.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/sub.c
new file mode 100644
index 00000000000..3fbcbbe98b4
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/sub.c
@@ -0,0 +1,34 @@
+/* mpn_sub - subtract mpn from mpn.
+
+Copyright 2001 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_FORCE_mpn_sub 1
+
+#include "gmp.h"
+#include "gmp-impl.h"
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/sub_1.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/sub_1.c
new file mode 100644
index 00000000000..db2e6f948f5
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/sub_1.c
@@ -0,0 +1,34 @@
+/* mpn_sub_1 - subtract limb from mpn.
+
+Copyright 2001 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_FORCE_mpn_sub_1 1
+
+#include "gmp.h"
+#include "gmp-impl.h"
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/sub_err1_n.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/sub_err1_n.c
new file mode 100644
index 00000000000..340313a323a
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/sub_err1_n.c
@@ -0,0 +1,101 @@
+/* mpn_sub_err1_n -- sub_n with one error term
+
+ Contributed by David Harvey.
+
+ THE FUNCTION IN THIS FILE IS INTERNAL 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 2011 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.h"
+#include "gmp-impl.h"
+
+/*
+ Computes:
+
+ (1) {rp,n} := {up,n} - {vp,n} (just like mpn_sub_n) with incoming borrow cy,
+ return value is borrow out.
+
+ (2) Let c[i+1] = borrow from i-th limb subtraction (c[0] = cy).
+ Computes c[1]*yp[n-1] + ... + c[n]*yp[0], stores two-limb result at ep.
+
+ Requires n >= 1.
+
+ None of the outputs may overlap each other or any of the inputs, except
+ that {rp,n} may be equal to {up,n} or {vp,n}.
+*/
+mp_limb_t
+mpn_sub_err1_n (mp_ptr rp, mp_srcptr up, mp_srcptr vp,
+ mp_ptr ep, mp_srcptr yp,
+ mp_size_t n, mp_limb_t cy)
+{
+ mp_limb_t el, eh, ul, vl, yl, zl, rl, sl, cy1, cy2;
+
+ ASSERT (n >= 1);
+ ASSERT (MPN_SAME_OR_SEPARATE_P (rp, up, n));
+ ASSERT (MPN_SAME_OR_SEPARATE_P (rp, vp, n));
+ ASSERT (! MPN_OVERLAP_P (rp, n, yp, n));
+ ASSERT (! MPN_OVERLAP_P (ep, 2, up, n));
+ ASSERT (! MPN_OVERLAP_P (ep, 2, vp, n));
+ ASSERT (! MPN_OVERLAP_P (ep, 2, yp, n));
+ ASSERT (! MPN_OVERLAP_P (ep, 2, rp, n));
+
+ yp += n - 1;
+ el = eh = 0;
+
+ do
+ {
+ yl = *yp--;
+ ul = *up++;
+ vl = *vp++;
+
+ /* ordinary sub_n */
+ SUBC_LIMB (cy1, sl, ul, vl);
+ SUBC_LIMB (cy2, rl, sl, cy);
+ cy = cy1 | cy2;
+ *rp++ = rl;
+
+ /* update (eh:el) */
+ zl = (-cy) & yl;
+ el += zl;
+ eh += el < zl;
+ }
+ while (--n);
+
+#if GMP_NAIL_BITS != 0
+ eh = (eh << GMP_NAIL_BITS) + (el >> GMP_NUMB_BITS);
+ el &= GMP_NUMB_MASK;
+#endif
+
+ ep[0] = el;
+ ep[1] = eh;
+
+ return cy;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/sub_err2_n.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/sub_err2_n.c
new file mode 100644
index 00000000000..63ea2451b49
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/sub_err2_n.c
@@ -0,0 +1,117 @@
+/* mpn_sub_err2_n -- sub_n with two error terms
+
+ Contributed by David Harvey.
+
+ THE FUNCTION IN THIS FILE IS INTERNAL 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 2011 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.h"
+#include "gmp-impl.h"
+
+/*
+ Computes:
+
+ (1) {rp,n} := {up,n} - {vp,n} (just like mpn_sub_n) with incoming borrow cy,
+ return value is borrow out.
+
+ (2) Let c[i+1] = borrow from i-th limb subtraction (c[0] = cy).
+ Computes c[1]*yp1[n-1] + ... + c[n]*yp1[0],
+ c[1]*yp2[n-1] + ... + c[n]*yp2[0],
+ stores two-limb results at {ep,2} and {ep+2,2} respectively.
+
+ Requires n >= 1.
+
+ None of the outputs may overlap each other or any of the inputs, except
+ that {rp,n} may be equal to {up,n} or {vp,n}.
+*/
+mp_limb_t
+mpn_sub_err2_n (mp_ptr rp, mp_srcptr up, mp_srcptr vp,
+ mp_ptr ep, mp_srcptr yp1, mp_srcptr yp2,
+ mp_size_t n, mp_limb_t cy)
+{
+ mp_limb_t el1, eh1, el2, eh2, ul, vl, yl1, yl2, zl1, zl2, rl, sl, cy1, cy2;
+
+ ASSERT (n >= 1);
+ ASSERT (MPN_SAME_OR_SEPARATE_P (rp, up, n));
+ ASSERT (MPN_SAME_OR_SEPARATE_P (rp, vp, n));
+ ASSERT (! MPN_OVERLAP_P (rp, n, yp1, n));
+ ASSERT (! MPN_OVERLAP_P (rp, n, yp2, n));
+ ASSERT (! MPN_OVERLAP_P (ep, 4, up, n));
+ ASSERT (! MPN_OVERLAP_P (ep, 4, vp, n));
+ ASSERT (! MPN_OVERLAP_P (ep, 4, yp1, n));
+ ASSERT (! MPN_OVERLAP_P (ep, 4, yp2, n));
+ ASSERT (! MPN_OVERLAP_P (ep, 4, rp, n));
+
+ yp1 += n - 1;
+ yp2 += n - 1;
+ el1 = eh1 = 0;
+ el2 = eh2 = 0;
+
+ do
+ {
+ yl1 = *yp1--;
+ yl2 = *yp2--;
+ ul = *up++;
+ vl = *vp++;
+
+ /* ordinary sub_n */
+ SUBC_LIMB (cy1, sl, ul, vl);
+ SUBC_LIMB (cy2, rl, sl, cy);
+ cy = cy1 | cy2;
+ *rp++ = rl;
+
+ /* update (eh1:el1) */
+ zl1 = (-cy) & yl1;
+ el1 += zl1;
+ eh1 += el1 < zl1;
+
+ /* update (eh2:el2) */
+ zl2 = (-cy) & yl2;
+ el2 += zl2;
+ eh2 += el2 < zl2;
+ }
+ while (--n);
+
+#if GMP_NAIL_BITS != 0
+ eh1 = (eh1 << GMP_NAIL_BITS) + (el1 >> GMP_NUMB_BITS);
+ el1 &= GMP_NUMB_MASK;
+ eh2 = (eh2 << GMP_NAIL_BITS) + (el2 >> GMP_NUMB_BITS);
+ el2 &= GMP_NUMB_MASK;
+#endif
+
+ ep[0] = el1;
+ ep[1] = eh1;
+ ep[2] = el2;
+ ep[3] = eh2;
+
+ return cy;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/sub_err3_n.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/sub_err3_n.c
new file mode 100644
index 00000000000..a80e05d0d96
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/sub_err3_n.c
@@ -0,0 +1,132 @@
+/* mpn_sub_err3_n -- sub_n with three error terms
+
+ Contributed by David Harvey.
+
+ THE FUNCTION IN THIS FILE IS INTERNAL 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 2011 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.h"
+#include "gmp-impl.h"
+
+/*
+ Computes:
+
+ (1) {rp,n} := {up,n} - {vp,n} (just like mpn_sub_n) with incoming borrow cy,
+ return value is borrow out.
+
+ (2) Let c[i+1] = borrow from i-th limb subtraction (c[0] = cy).
+ Computes c[1]*yp1[n-1] + ... + c[n]*yp1[0],
+ c[1]*yp2[n-1] + ... + c[n]*yp2[0],
+ c[1]*yp3[n-1] + ... + c[n]*yp3[0],
+ stores two-limb results at {ep,2}, {ep+2,2} and {ep+4,2} respectively.
+
+ Requires n >= 1.
+
+ None of the outputs may overlap each other or any of the inputs, except
+ that {rp,n} may be equal to {up,n} or {vp,n}.
+*/
+mp_limb_t
+mpn_sub_err3_n (mp_ptr rp, mp_srcptr up, mp_srcptr vp,
+ mp_ptr ep, mp_srcptr yp1, mp_srcptr yp2, mp_srcptr yp3,
+ mp_size_t n, mp_limb_t cy)
+{
+ mp_limb_t el1, eh1, el2, eh2, el3, eh3, ul, vl, yl1, yl2, yl3, zl1, zl2, zl3, rl, sl, cy1, cy2;
+
+ ASSERT (n >= 1);
+ ASSERT (MPN_SAME_OR_SEPARATE_P (rp, up, n));
+ ASSERT (MPN_SAME_OR_SEPARATE_P (rp, vp, n));
+ ASSERT (! MPN_OVERLAP_P (rp, n, yp1, n));
+ ASSERT (! MPN_OVERLAP_P (rp, n, yp2, n));
+ ASSERT (! MPN_OVERLAP_P (rp, n, yp3, n));
+ ASSERT (! MPN_OVERLAP_P (ep, 6, up, n));
+ ASSERT (! MPN_OVERLAP_P (ep, 6, vp, n));
+ ASSERT (! MPN_OVERLAP_P (ep, 6, yp1, n));
+ ASSERT (! MPN_OVERLAP_P (ep, 6, yp2, n));
+ ASSERT (! MPN_OVERLAP_P (ep, 6, yp3, n));
+ ASSERT (! MPN_OVERLAP_P (ep, 6, rp, n));
+
+ yp1 += n - 1;
+ yp2 += n - 1;
+ yp3 += n - 1;
+ el1 = eh1 = 0;
+ el2 = eh2 = 0;
+ el3 = eh3 = 0;
+
+ do
+ {
+ yl1 = *yp1--;
+ yl2 = *yp2--;
+ yl3 = *yp3--;
+ ul = *up++;
+ vl = *vp++;
+
+ /* ordinary sub_n */
+ SUBC_LIMB (cy1, sl, ul, vl);
+ SUBC_LIMB (cy2, rl, sl, cy);
+ cy = cy1 | cy2;
+ *rp++ = rl;
+
+ /* update (eh1:el1) */
+ zl1 = (-cy) & yl1;
+ el1 += zl1;
+ eh1 += el1 < zl1;
+
+ /* update (eh2:el2) */
+ zl2 = (-cy) & yl2;
+ el2 += zl2;
+ eh2 += el2 < zl2;
+
+ /* update (eh3:el3) */
+ zl3 = (-cy) & yl3;
+ el3 += zl3;
+ eh3 += el3 < zl3;
+ }
+ while (--n);
+
+#if GMP_NAIL_BITS != 0
+ eh1 = (eh1 << GMP_NAIL_BITS) + (el1 >> GMP_NUMB_BITS);
+ el1 &= GMP_NUMB_MASK;
+ eh2 = (eh2 << GMP_NAIL_BITS) + (el2 >> GMP_NUMB_BITS);
+ el2 &= GMP_NUMB_MASK;
+ eh3 = (eh3 << GMP_NAIL_BITS) + (el3 >> GMP_NUMB_BITS);
+ el3 &= GMP_NUMB_MASK;
+#endif
+
+ ep[0] = el1;
+ ep[1] = eh1;
+ ep[2] = el2;
+ ep[3] = eh2;
+ ep[4] = el3;
+ ep[5] = eh3;
+
+ return cy;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/sub_n.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/sub_n.c
new file mode 100644
index 00000000000..29de2d2d891
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/sub_n.c
@@ -0,0 +1,90 @@
+/* mpn_sub_n -- Subtract equal length limb vectors.
+
+Copyright 1992-1994, 1996, 2000, 2002, 2009 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.h"
+#include "gmp-impl.h"
+
+
+#if GMP_NAIL_BITS == 0
+
+mp_limb_t
+mpn_sub_n (mp_ptr rp, mp_srcptr up, mp_srcptr vp, mp_size_t n)
+{
+ mp_limb_t ul, vl, sl, rl, cy, cy1, cy2;
+
+ ASSERT (n >= 1);
+ ASSERT (MPN_SAME_OR_INCR_P (rp, up, n));
+ ASSERT (MPN_SAME_OR_INCR_P (rp, vp, n));
+
+ cy = 0;
+ do
+ {
+ ul = *up++;
+ vl = *vp++;
+ sl = ul - vl;
+ cy1 = sl > ul;
+ rl = sl - cy;
+ cy2 = rl > sl;
+ cy = cy1 | cy2;
+ *rp++ = rl;
+ }
+ while (--n != 0);
+
+ return cy;
+}
+
+#endif
+
+#if GMP_NAIL_BITS >= 1
+
+mp_limb_t
+mpn_sub_n (mp_ptr rp, mp_srcptr up, mp_srcptr vp, mp_size_t n)
+{
+ mp_limb_t ul, vl, rl, cy;
+
+ ASSERT (n >= 1);
+ ASSERT (MPN_SAME_OR_INCR_P (rp, up, n));
+ ASSERT (MPN_SAME_OR_INCR_P (rp, vp, n));
+
+ cy = 0;
+ do
+ {
+ ul = *up++;
+ vl = *vp++;
+ rl = ul - vl - cy;
+ cy = rl >> (GMP_LIMB_BITS - 1);
+ *rp++ = rl & GMP_NUMB_MASK;
+ }
+ while (--n != 0);
+
+ return cy;
+}
+
+#endif
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/submul_1.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/submul_1.c
new file mode 100644
index 00000000000..fbc3501389d
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/submul_1.c
@@ -0,0 +1,139 @@
+/* mpn_submul_1 -- multiply the N long limb vector pointed to by UP by VL,
+ subtract the N least significant limbs of the product from the limb
+ vector pointed to by RP. Return the most significant limb of the
+ product, adjusted for carry-out from the subtraction.
+
+Copyright 1992-1994, 1996, 2000, 2002, 2004 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.h"
+#include "gmp-impl.h"
+#include "longlong.h"
+
+
+#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)
+{
+ mp_limb_t ul, cl, hpl, lpl, rl;
+
+ ASSERT (n >= 1);
+ ASSERT (MPN_SAME_OR_SEPARATE_P (rp, up, n));
+
+ cl = 0;
+ do
+ {
+ ul = *up++;
+ umul_ppmm (hpl, lpl, ul, vl);
+
+ lpl += cl;
+ cl = (lpl < cl) + hpl;
+
+ rl = *rp;
+ lpl = rl - lpl;
+ cl += lpl > rl;
+ *rp++ = lpl;
+ }
+ while (--n != 0);
+
+ return cl;
+}
+
+#endif
+
+#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)
+{
+ mp_limb_t shifted_vl, ul, rl, lpl, hpl, prev_hpl, 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);
+
+ shifted_vl = vl << GMP_NAIL_BITS;
+ cl = 0;
+ prev_hpl = 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);
+ SUBC_LIMB (c3, xl, xl, cl);
+ cl = c1 + c2 + c3;
+ *rp++ = xl;
+ prev_hpl = hpl;
+ }
+ while (--n != 0);
+
+ return prev_hpl + cl;
+}
+
+#endif
+
+#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)
+{
+ mp_limb_t shifted_vl, ul, rl, lpl, hpl, prev_hpl, 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);
+
+ shifted_vl = vl << GMP_NAIL_BITS;
+ cl = 0;
+ prev_hpl = 0;
+ do
+ {
+ ul = *up++;
+ rl = *rp;
+ umul_ppmm (hpl, lpl, ul, shifted_vl);
+ lpl >>= GMP_NAIL_BITS;
+ xw = rl - (prev_hpl + lpl) + cl;
+ cl = (mp_limb_signed_t) xw >> GMP_NUMB_BITS; /* FIXME: non-portable */
+ xl = xw & GMP_NUMB_MASK;
+ *rp++ = xl;
+ prev_hpl = hpl;
+ }
+ while (--n != 0);
+
+ return prev_hpl - cl;
+}
+
+#endif
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/tdiv_qr.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/tdiv_qr.c
new file mode 100644
index 00000000000..be213b04673
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/tdiv_qr.c
@@ -0,0 +1,389 @@
+/* mpn_tdiv_qr -- Divide the numerator (np,nn) by the denominator (dp,dn) and
+ write the nn-dn+1 quotient limbs at qp and the dn remainder limbs at rp. If
+ qxn is non-zero, generate that many fraction limbs and append them after the
+ other quotient limbs, and update the remainder accordingly. The input
+ operands are unaffected.
+
+ Preconditions:
+ 1. The most significant limb of 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.
+
+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.h"
+#include "gmp-impl.h"
+#include "longlong.h"
+
+
+void
+mpn_tdiv_qr (mp_ptr qp, mp_ptr rp, mp_size_t qxn,
+ mp_srcptr np, mp_size_t nn, mp_srcptr dp, mp_size_t dn)
+{
+ ASSERT_ALWAYS (qxn == 0);
+
+ ASSERT (nn >= 0);
+ ASSERT (dn >= 0);
+ ASSERT (dn == 0 || dp[dn - 1] != 0);
+ ASSERT (! MPN_OVERLAP_P (qp, nn - dn + 1 + qxn, np, nn));
+ ASSERT (! MPN_OVERLAP_P (qp, nn - dn + 1 + qxn, dp, dn));
+
+ switch (dn)
+ {
+ case 0:
+ DIVIDE_BY_ZERO;
+
+ case 1:
+ {
+ rp[0] = mpn_divrem_1 (qp, (mp_size_t) 0, np, nn, dp[0]);
+ return;
+ }
+
+ case 2:
+ {
+ mp_ptr n2p, d2p;
+ mp_limb_t qhl, cy;
+ TMP_DECL;
+ TMP_MARK;
+ if ((dp[1] & GMP_NUMB_HIGHBIT) == 0)
+ {
+ int cnt;
+ mp_limb_t dtmp[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);
+ cy = mpn_lshift (n2p, np, nn, cnt);
+ n2p[nn] = cy;
+ qhl = mpn_divrem_2 (qp, 0L, n2p, nn + (cy != 0), d2p);
+ if (cy == 0)
+ qp[nn - 2] = qhl; /* always store nn-2+1 quotient limbs */
+ rp[0] = (n2p[0] >> cnt)
+ | ((n2p[1] << (GMP_NUMB_BITS - cnt)) & GMP_NUMB_MASK);
+ rp[1] = (n2p[1] >> cnt);
+ }
+ else
+ {
+ d2p = (mp_ptr) dp;
+ n2p = TMP_ALLOC_LIMBS (nn);
+ MPN_COPY (n2p, np, nn);
+ qhl = mpn_divrem_2 (qp, 0L, n2p, nn, d2p);
+ qp[nn - 2] = qhl; /* always store nn-2+1 quotient limbs */
+ rp[0] = n2p[0];
+ rp[1] = n2p[1];
+ }
+ TMP_FREE;
+ return;
+ }
+
+ default:
+ {
+ int adjust;
+ gmp_pi1_t dinv;
+ TMP_DECL;
+ TMP_MARK;
+ adjust = np[nn - 1] >= dp[dn - 1]; /* conservative tests for quotient size */
+ if (nn + adjust >= 2 * dn)
+ {
+ mp_ptr n2p, d2p;
+ mp_limb_t cy;
+ int cnt;
+
+ qp[nn - dn] = 0; /* zero high quotient limb */
+ if ((dp[dn - 1] & GMP_NUMB_HIGHBIT) == 0) /* normalize divisor */
+ {
+ count_leading_zeros (cnt, dp[dn - 1]);
+ cnt -= GMP_NAIL_BITS;
+ d2p = TMP_ALLOC_LIMBS (dn);
+ mpn_lshift (d2p, dp, dn, cnt);
+ n2p = TMP_ALLOC_LIMBS (nn + 1);
+ cy = mpn_lshift (n2p, np, nn, cnt);
+ n2p[nn] = cy;
+ nn += adjust;
+ }
+ else
+ {
+ cnt = 0;
+ d2p = (mp_ptr) dp;
+ n2p = TMP_ALLOC_LIMBS (nn + 1);
+ MPN_COPY (n2p, np, nn);
+ n2p[nn] = 0;
+ nn += adjust;
+ }
+
+ invert_pi1 (dinv, d2p[dn - 1], d2p[dn - 2]);
+ if (BELOW_THRESHOLD (dn, DC_DIV_QR_THRESHOLD))
+ mpn_sbpi1_div_qr (qp, n2p, nn, d2p, dn, dinv.inv32);
+ else if (BELOW_THRESHOLD (dn, MUPI_DIV_QR_THRESHOLD) || /* fast condition */
+ BELOW_THRESHOLD (nn, 2 * MU_DIV_QR_THRESHOLD) || /* fast condition */
+ (double) (2 * (MU_DIV_QR_THRESHOLD - MUPI_DIV_QR_THRESHOLD)) * dn /* slow... */
+ + (double) MUPI_DIV_QR_THRESHOLD * nn > (double) dn * nn) /* ...condition */
+ mpn_dcpi1_div_qr (qp, n2p, nn, d2p, dn, &dinv);
+ else
+ {
+ mp_size_t itch = mpn_mu_div_qr_itch (nn, dn, 0);
+ mp_ptr scratch = TMP_ALLOC_LIMBS (itch);
+ mpn_mu_div_qr (qp, rp, n2p, nn, d2p, dn, scratch);
+ n2p = rp;
+ }
+
+ if (cnt != 0)
+ mpn_rshift (rp, n2p, dn, cnt);
+ else
+ MPN_COPY (rp, n2p, dn);
+ TMP_FREE;
+ return;
+ }
+
+ /* When we come here, the numerator/partial remainder is less
+ than twice the size of the denominator. */
+
+ {
+ /* Problem:
+
+ Divide a numerator N with nn limbs by a denominator D with dn
+ limbs forming a quotient of qn=nn-dn+1 limbs. When qn is small
+ compared to dn, conventional division algorithms perform poorly.
+ We want an algorithm that has an expected running time that is
+ dependent only on qn.
+
+ Algorithm (very informally stated):
+
+ 1) Divide the 2 x qn most significant limbs from the numerator
+ by the qn most significant limbs from the denominator. Call
+ the result qest. This is either the correct quotient, but
+ might be 1 or 2 too large. Compute the remainder from the
+ division. (This step is implemented by a mpn_divrem call.)
+
+ 2) Is the most significant limb from the remainder < p, where p
+ is the product of the most significant limb from the quotient
+ and the next(d)? (Next(d) denotes the next ignored limb from
+ the denominator.) If it is, decrement qest, and adjust the
+ remainder accordingly.
+
+ 3) Is the remainder >= qest? If it is, qest is the desired
+ quotient. The algorithm terminates.
+
+ 4) Subtract qest x next(d) from the remainder. If there is
+ borrow out, decrement qest, and adjust the remainder
+ accordingly.
+
+ 5) Skip one word from the denominator (i.e., let next(d) denote
+ the next less significant limb. */
+
+ mp_size_t qn;
+ mp_ptr n2p, d2p;
+ mp_ptr tp;
+ mp_limb_t cy;
+ mp_size_t in, rn;
+ mp_limb_t quotient_too_large;
+ unsigned int cnt;
+
+ qn = nn - dn;
+ qp[qn] = 0; /* zero high quotient limb */
+ qn += adjust; /* qn cannot become bigger */
+
+ if (qn == 0)
+ {
+ MPN_COPY (rp, np, dn);
+ TMP_FREE;
+ return;
+ }
+
+ in = dn - qn; /* (at least partially) ignored # of limbs in ops */
+ /* Normalize denominator by shifting it to the left such that its
+ most significant bit is set. Then shift the numerator the same
+ amount, to mathematically preserve quotient. */
+ if ((dp[dn - 1] & GMP_NUMB_HIGHBIT) == 0)
+ {
+ count_leading_zeros (cnt, dp[dn - 1]);
+ cnt -= GMP_NAIL_BITS;
+
+ d2p = TMP_ALLOC_LIMBS (qn);
+ mpn_lshift (d2p, dp + in, qn, cnt);
+ d2p[0] |= dp[in - 1] >> (GMP_NUMB_BITS - cnt);
+
+ n2p = TMP_ALLOC_LIMBS (2 * qn + 1);
+ cy = mpn_lshift (n2p, np + nn - 2 * qn, 2 * qn, cnt);
+ if (adjust)
+ {
+ n2p[2 * qn] = cy;
+ n2p++;
+ }
+ else
+ {
+ n2p[0] |= np[nn - 2 * qn - 1] >> (GMP_NUMB_BITS - cnt);
+ }
+ }
+ else
+ {
+ cnt = 0;
+ d2p = (mp_ptr) dp + in;
+
+ n2p = TMP_ALLOC_LIMBS (2 * qn + 1);
+ MPN_COPY (n2p, np + nn - 2 * qn, 2 * qn);
+ if (adjust)
+ {
+ n2p[2 * qn] = 0;
+ n2p++;
+ }
+ }
+
+ /* Get an approximate quotient using the extracted operands. */
+ if (qn == 1)
+ {
+ mp_limb_t q0, r0;
+ udiv_qrnnd (q0, r0, n2p[1], n2p[0] << GMP_NAIL_BITS, d2p[0] << GMP_NAIL_BITS);
+ n2p[0] = r0 >> GMP_NAIL_BITS;
+ qp[0] = q0;
+ }
+ else if (qn == 2)
+ mpn_divrem_2 (qp, 0L, n2p, 4L, d2p); /* FIXME: obsolete function */
+ else
+ {
+ invert_pi1 (dinv, d2p[qn - 1], d2p[qn - 2]);
+ if (BELOW_THRESHOLD (qn, DC_DIV_QR_THRESHOLD))
+ mpn_sbpi1_div_qr (qp, n2p, 2 * qn, d2p, qn, dinv.inv32);
+ else if (BELOW_THRESHOLD (qn, MU_DIV_QR_THRESHOLD))
+ mpn_dcpi1_div_qr (qp, n2p, 2 * qn, d2p, qn, &dinv);
+ else
+ {
+ mp_size_t itch = mpn_mu_div_qr_itch (2 * qn, qn, 0);
+ mp_ptr scratch = TMP_ALLOC_LIMBS (itch);
+ mp_ptr r2p = rp;
+ if (np == r2p) /* If N and R share space, put ... */
+ r2p += nn - qn; /* intermediate remainder at N's upper end. */
+ mpn_mu_div_qr (qp, r2p, n2p, 2 * qn, d2p, qn, scratch);
+ MPN_COPY (n2p, r2p, qn);
+ }
+ }
+
+ rn = qn;
+ /* Multiply the first ignored divisor limb by the most significant
+ quotient limb. If that product is > the partial remainder's
+ most significant limb, we know the quotient is too large. This
+ test quickly catches most cases where the quotient is too large;
+ it catches all cases where the quotient is 2 too large. */
+ {
+ mp_limb_t dl, x;
+ mp_limb_t h, dummy;
+
+ if (in - 2 < 0)
+ dl = 0;
+ else
+ dl = dp[in - 2];
+
+#if GMP_NAIL_BITS == 0
+ x = (dp[in - 1] << cnt) | ((dl >> 1) >> ((~cnt) % GMP_LIMB_BITS));
+#else
+ x = (dp[in - 1] << cnt) & GMP_NUMB_MASK;
+ if (cnt != 0)
+ x |= dl >> (GMP_NUMB_BITS - cnt);
+#endif
+ umul_ppmm (h, dummy, x, qp[qn - 1] << GMP_NAIL_BITS);
+
+ if (n2p[qn - 1] < h)
+ {
+ mp_limb_t cy;
+
+ mpn_decr_u (qp, (mp_limb_t) 1);
+ cy = mpn_add_n (n2p, n2p, d2p, qn);
+ if (cy)
+ {
+ /* The partial remainder is safely large. */
+ n2p[qn] = cy;
+ ++rn;
+ }
+ }
+ }
+
+ quotient_too_large = 0;
+ if (cnt != 0)
+ {
+ mp_limb_t cy1, cy2;
+
+ /* Append partially used numerator limb to partial remainder. */
+ cy1 = mpn_lshift (n2p, n2p, rn, GMP_NUMB_BITS - cnt);
+ n2p[0] |= np[in - 1] & (GMP_NUMB_MASK >> cnt);
+
+ /* Update partial remainder with partially used divisor limb. */
+ cy2 = mpn_submul_1 (n2p, qp, qn, dp[in - 1] & (GMP_NUMB_MASK >> cnt));
+ if (qn != rn)
+ {
+ ASSERT_ALWAYS (n2p[qn] >= cy2);
+ n2p[qn] -= cy2;
+ }
+ else
+ {
+ n2p[qn] = cy1 - cy2; /* & GMP_NUMB_MASK; */
+
+ quotient_too_large = (cy1 < cy2);
+ ++rn;
+ }
+ --in;
+ }
+ /* True: partial remainder now is neutral, i.e., it is not shifted up. */
+
+ tp = TMP_ALLOC_LIMBS (dn);
+
+ if (in < qn)
+ {
+ if (in == 0)
+ {
+ MPN_COPY (rp, n2p, rn);
+ ASSERT_ALWAYS (rn == dn);
+ goto foo;
+ }
+ mpn_mul (tp, qp, qn, dp, in);
+ }
+ else
+ mpn_mul (tp, dp, in, qp, qn);
+
+ cy = mpn_sub (n2p, n2p, rn, tp + in, qn);
+ MPN_COPY (rp + in, n2p, dn - in);
+ quotient_too_large |= cy;
+ cy = mpn_sub_n (rp, np, tp, in);
+ cy = mpn_sub_1 (rp + in, rp + in, rn, cy);
+ quotient_too_large |= cy;
+ foo:
+ if (quotient_too_large)
+ {
+ mpn_decr_u (qp, (mp_limb_t) 1);
+ mpn_add_n (rp, rp, dp, dn);
+ }
+ }
+ TMP_FREE;
+ return;
+ }
+ }
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/toom22_mul.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/toom22_mul.c
new file mode 100644
index 00000000000..36ac29b72d4
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/toom22_mul.c
@@ -0,0 +1,210 @@
+/* mpn_toom22_mul -- Multiply {ap,an} and {bp,bn} where an >= bn. Or more
+ accurately, bn <= an < 2bn.
+
+ Contributed to the GNU project by Torbjorn Granlund.
+
+ THE FUNCTION IN THIS FILE IS INTERNAL WITH A MUTABLE INTERFACE. IT IS ONLY
+ 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.
+
+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.h"
+#include "gmp-impl.h"
+
+/* Evaluate in: -1, 0, +inf
+
+ <-s--><--n-->
+ ____ ______
+ |_a1_|___a0_|
+ |b1_|___b0_|
+ <-t-><--n-->
+
+ v0 = a0 * b0 # A(0)*B(0)
+ vm1 = (a0- a1)*(b0- b1) # A(-1)*B(-1)
+ vinf= a1 * b1 # A(inf)*B(inf)
+*/
+
+#if TUNE_PROGRAM_BUILD || WANT_FAT_BINARY
+#define MAYBE_mul_toom22 1
+#else
+#define MAYBE_mul_toom22 \
+ (MUL_TOOM33_THRESHOLD >= 2 * MUL_TOOM22_THRESHOLD)
+#endif
+
+#define TOOM22_MUL_N_REC(p, a, b, n, ws) \
+ do { \
+ if (! MAYBE_mul_toom22 \
+ || BELOW_THRESHOLD (n, MUL_TOOM22_THRESHOLD)) \
+ mpn_mul_basecase (p, a, n, b, n); \
+ else \
+ mpn_toom22_mul (p, a, n, b, n, ws); \
+ } while (0)
+
+/* Normally, this calls mul_basecase or toom22_mul. But when when the fraction
+ MUL_TOOM33_THRESHOLD / MUL_TOOM22_THRESHOLD is large, an initially small
+ relative unbalance will become a larger and larger relative unbalance with
+ each recursion (the difference s-t will be invariant over recursive calls).
+ Therefore, we need to call toom32_mul. FIXME: Suppress depending on
+ MUL_TOOM33_THRESHOLD / MUL_TOOM22_THRESHOLD and on MUL_TOOM22_THRESHOLD. */
+#define TOOM22_MUL_REC(p, a, an, b, bn, ws) \
+ do { \
+ if (! MAYBE_mul_toom22 \
+ || BELOW_THRESHOLD (bn, MUL_TOOM22_THRESHOLD)) \
+ mpn_mul_basecase (p, a, an, b, bn); \
+ else if (4 * an < 5 * bn) \
+ mpn_toom22_mul (p, a, an, b, bn, ws); \
+ else \
+ mpn_toom32_mul (p, a, an, b, bn, ws); \
+ } while (0)
+
+void
+mpn_toom22_mul (mp_ptr pp,
+ mp_srcptr ap, mp_size_t an,
+ mp_srcptr bp, mp_size_t bn,
+ mp_ptr scratch)
+{
+ const int __gmpn_cpuvec_initialized = 1;
+ mp_size_t n, s, t;
+ int vm1_neg;
+ mp_limb_t cy, cy2;
+ mp_ptr asm1;
+ mp_ptr bsm1;
+
+#define a0 ap
+#define a1 (ap + n)
+#define b0 bp
+#define b1 (bp + n)
+
+ s = an >> 1;
+ n = an - s;
+ t = bn - n;
+
+ ASSERT (an >= bn);
+
+ ASSERT (0 < s && s <= n);
+ ASSERT (0 < t && t <= s);
+
+ asm1 = pp;
+ bsm1 = pp + n;
+
+ vm1_neg = 0;
+
+ /* Compute asm1. */
+ if (s == n)
+ {
+ if (mpn_cmp (a0, a1, n) < 0)
+ {
+ mpn_sub_n (asm1, a1, a0, n);
+ vm1_neg = 1;
+ }
+ else
+ {
+ mpn_sub_n (asm1, a0, a1, n);
+ }
+ }
+ else
+ {
+ if (mpn_zero_p (a0 + s, n - s) && mpn_cmp (a0, a1, s) < 0)
+ {
+ mpn_sub_n (asm1, a1, a0, s);
+ MPN_ZERO (asm1 + s, n - s);
+ vm1_neg = 1;
+ }
+ else
+ {
+ mpn_sub (asm1, a0, n, a1, s);
+ }
+ }
+
+ /* Compute bsm1. */
+ if (t == n)
+ {
+ if (mpn_cmp (b0, b1, n) < 0)
+ {
+ mpn_sub_n (bsm1, b1, b0, n);
+ vm1_neg ^= 1;
+ }
+ else
+ {
+ mpn_sub_n (bsm1, b0, b1, n);
+ }
+ }
+ else
+ {
+ if (mpn_zero_p (b0 + t, n - t) && mpn_cmp (b0, b1, t) < 0)
+ {
+ mpn_sub_n (bsm1, b1, b0, t);
+ MPN_ZERO (bsm1 + t, n - t);
+ vm1_neg ^= 1;
+ }
+ else
+ {
+ mpn_sub (bsm1, b0, n, b1, t);
+ }
+ }
+
+#define v0 pp /* 2n */
+#define vinf (pp + 2 * n) /* s+t */
+#define vm1 scratch /* 2n */
+#define scratch_out scratch + 2 * n
+
+ /* vm1, 2n limbs */
+ TOOM22_MUL_N_REC (vm1, asm1, bsm1, n, scratch_out);
+
+ if (s > t) TOOM22_MUL_REC (vinf, a1, s, b1, t, scratch_out);
+ else TOOM22_MUL_N_REC (vinf, a1, b1, s, scratch_out);
+
+ /* v0, 2n limbs */
+ TOOM22_MUL_N_REC (v0, ap, bp, n, scratch_out);
+
+ /* H(v0) + L(vinf) */
+ cy = mpn_add_n (pp + 2 * n, v0 + n, vinf, n);
+
+ /* L(v0) + H(v0) */
+ cy2 = cy + mpn_add_n (pp + n, pp + 2 * n, v0, n);
+
+ /* L(vinf) + H(vinf) */
+ cy += mpn_add (pp + 2 * n, pp + 2 * n, n, vinf + n, s + t - n);
+
+ if (vm1_neg)
+ cy += mpn_add_n (pp + n, pp + n, vm1, 2 * n);
+ else
+ cy -= mpn_sub_n (pp + n, pp + n, vm1, 2 * n);
+
+ ASSERT (cy + 1 <= 3);
+ ASSERT (cy2 <= 2);
+
+ mpn_incr_u (pp + 2 * n, cy2);
+ if (LIKELY (cy <= 2))
+ mpn_incr_u (pp + 3 * n, cy);
+ else
+ mpn_decr_u (pp + 3 * n, 1);
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/toom2_sqr.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/toom2_sqr.c
new file mode 100644
index 00000000000..2f2fdaee6f2
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/toom2_sqr.c
@@ -0,0 +1,146 @@
+/* mpn_toom2_sqr -- Square {ap,an}.
+
+ Contributed to the GNU project by Torbjorn Granlund.
+
+ THE FUNCTION IN THIS FILE IS INTERNAL WITH A MUTABLE INTERFACE. IT IS ONLY
+ 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.
+
+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.h"
+#include "gmp-impl.h"
+
+/* Evaluate in: -1, 0, +inf
+
+ <-s--><--n-->
+ ____ ______
+ |_a1_|___a0_|
+
+ v0 = a0 ^2 # A(0)^2
+ vm1 = (a0- a1)^2 # A(-1)^2
+ vinf= a1 ^2 # A(inf)^2
+*/
+
+#if TUNE_PROGRAM_BUILD || WANT_FAT_BINARY
+#define MAYBE_sqr_toom2 1
+#else
+#define MAYBE_sqr_toom2 \
+ (SQR_TOOM3_THRESHOLD >= 2 * SQR_TOOM2_THRESHOLD)
+#endif
+
+#define TOOM2_SQR_REC(p, a, n, ws) \
+ do { \
+ if (! MAYBE_sqr_toom2 \
+ || BELOW_THRESHOLD (n, SQR_TOOM2_THRESHOLD)) \
+ mpn_sqr_basecase (p, a, n); \
+ else \
+ mpn_toom2_sqr (p, a, n, ws); \
+ } while (0)
+
+void
+mpn_toom2_sqr (mp_ptr pp,
+ mp_srcptr ap, mp_size_t an,
+ mp_ptr scratch)
+{
+ const int __gmpn_cpuvec_initialized = 1;
+ mp_size_t n, s;
+ mp_limb_t cy, cy2;
+ mp_ptr asm1;
+
+#define a0 ap
+#define a1 (ap + n)
+
+ s = an >> 1;
+ n = an - s;
+
+ ASSERT (0 < s && s <= n);
+
+ asm1 = pp;
+
+ /* Compute asm1. */
+ if (s == n)
+ {
+ if (mpn_cmp (a0, a1, n) < 0)
+ {
+ mpn_sub_n (asm1, a1, a0, n);
+ }
+ else
+ {
+ mpn_sub_n (asm1, a0, a1, n);
+ }
+ }
+ else
+ {
+ if (mpn_zero_p (a0 + s, n - s) && mpn_cmp (a0, a1, s) < 0)
+ {
+ mpn_sub_n (asm1, a1, a0, s);
+ MPN_ZERO (asm1 + s, n - s);
+ }
+ else
+ {
+ mpn_sub (asm1, a0, n, a1, s);
+ }
+ }
+
+#define v0 pp /* 2n */
+#define vinf (pp + 2 * n) /* s+s */
+#define vm1 scratch /* 2n */
+#define scratch_out scratch + 2 * n
+
+ /* vm1, 2n limbs */
+ TOOM2_SQR_REC (vm1, asm1, n, scratch_out);
+
+ /* vinf, s+s limbs */
+ TOOM2_SQR_REC (vinf, a1, s, scratch_out);
+
+ /* v0, 2n limbs */
+ TOOM2_SQR_REC (v0, ap, n, scratch_out);
+
+ /* H(v0) + L(vinf) */
+ cy = mpn_add_n (pp + 2 * n, v0 + n, vinf, n);
+
+ /* L(v0) + H(v0) */
+ cy2 = cy + mpn_add_n (pp + n, pp + 2 * n, v0, n);
+
+ /* L(vinf) + H(vinf) */
+ cy += mpn_add (pp + 2 * n, pp + 2 * n, n, vinf + n, s + s - n);
+
+ cy -= mpn_sub_n (pp + n, pp + n, vm1, 2 * n);
+
+ ASSERT (cy + 1 <= 3);
+ ASSERT (cy2 <= 2);
+
+ mpn_incr_u (pp + 2 * n, cy2);
+ if (LIKELY (cy <= 2))
+ mpn_incr_u (pp + 3 * n, cy);
+ else
+ mpn_decr_u (pp + 3 * n, 1);
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/toom32_mul.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/toom32_mul.c
new file mode 100644
index 00000000000..0b05669cc4e
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/toom32_mul.c
@@ -0,0 +1,323 @@
+/* mpn_toom32_mul -- Multiply {ap,an} and {bp,bn} where an is nominally 1.5
+ times as large as bn. Or more accurately, bn < an < 3bn.
+
+ Contributed to the GNU project by Torbjorn Granlund.
+ Improvements by Marco Bodrato and Niels Möller.
+
+ The idea of applying toom to unbalanced multiplication is due to Marco
+ Bodrato and Alberto Zanoni.
+
+ THE FUNCTION IN THIS FILE IS INTERNAL WITH A MUTABLE INTERFACE. IT IS ONLY
+ 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 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.h"
+#include "gmp-impl.h"
+
+/* Evaluate in: -1, 0, +1, +inf
+
+ <-s-><--n--><--n-->
+ ___ ______ ______
+ |a2_|___a1_|___a0_|
+ |_b1_|___b0_|
+ <-t--><--n-->
+
+ v0 = a0 * b0 # A(0)*B(0)
+ v1 = (a0+ a1+ a2)*(b0+ b1) # A(1)*B(1) ah <= 2 bh <= 1
+ vm1 = (a0- a1+ a2)*(b0- b1) # A(-1)*B(-1) |ah| <= 1 bh = 0
+ vinf= a2 * b1 # A(inf)*B(inf)
+*/
+
+#define TOOM32_MUL_N_REC(p, a, b, n, ws) \
+ do { \
+ mpn_mul_n (p, a, b, n); \
+ } while (0)
+
+void
+mpn_toom32_mul (mp_ptr pp,
+ mp_srcptr ap, mp_size_t an,
+ mp_srcptr bp, mp_size_t bn,
+ mp_ptr scratch)
+{
+ mp_size_t n, s, t;
+ int vm1_neg;
+ mp_limb_t cy;
+ mp_limb_signed_t hi;
+ mp_limb_t ap1_hi, bp1_hi;
+
+#define a0 ap
+#define a1 (ap + n)
+#define a2 (ap + 2 * n)
+#define b0 bp
+#define b1 (bp + n)
+
+ /* Required, to ensure that s + t >= n. */
+ ASSERT (bn + 2 <= an && an + 6 <= 3*bn);
+
+ n = 1 + (2 * an >= 3 * bn ? (an - 1) / (size_t) 3 : (bn - 1) >> 1);
+
+ s = an - 2 * n;
+ t = bn - n;
+
+ ASSERT (0 < s && s <= n);
+ ASSERT (0 < t && t <= n);
+ ASSERT (s + t >= n);
+
+ /* Product area of size an + bn = 3*n + s + t >= 4*n + 2. */
+#define ap1 (pp) /* n, most significant limb in ap1_hi */
+#define bp1 (pp + n) /* n, most significant bit in bp1_hi */
+#define am1 (pp + 2*n) /* n, most significant bit in hi */
+#define bm1 (pp + 3*n) /* n */
+#define v1 (scratch) /* 2n + 1 */
+#define vm1 (pp) /* 2n + 1 */
+#define scratch_out (scratch + 2*n + 1) /* Currently unused. */
+
+ /* Scratch need: 2*n + 1 + scratch for the recursive multiplications. */
+
+ /* FIXME: Keep v1[2*n] and vm1[2*n] in scalar variables? */
+
+ /* Compute ap1 = a0 + a1 + a3, am1 = a0 - a1 + a3 */
+ 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)
+ {
+ ap1_hi = mpn_add_n_sub_n (ap1, am1, a1, ap1, n) >> 1;
+ hi = 0;
+ vm1_neg = 1;
+ }
+ else
+ {
+ cy = mpn_add_n_sub_n (ap1, am1, ap1, a1, n);
+ hi = ap1_hi - (cy & 1);
+ ap1_hi += (cy >> 1);
+ vm1_neg = 0;
+ }
+#else
+ if (ap1_hi == 0 && mpn_cmp (ap1, a1, n) < 0)
+ {
+ ASSERT_NOCARRY (mpn_sub_n (am1, a1, ap1, n));
+ hi = 0;
+ vm1_neg = 1;
+ }
+ else
+ {
+ hi = ap1_hi - mpn_sub_n (am1, ap1, a1, n);
+ vm1_neg = 0;
+ }
+ ap1_hi += mpn_add_n (ap1, ap1, a1, n);
+#endif
+
+ /* Compute bp1 = b0 + b1 and bm1 = b0 - b1. */
+ if (t == n)
+ {
+#if HAVE_NATIVE_mpn_add_n_sub_n
+ if (mpn_cmp (b0, b1, n) < 0)
+ {
+ cy = mpn_add_n_sub_n (bp1, bm1, b1, b0, n);
+ vm1_neg ^= 1;
+ }
+ else
+ {
+ cy = mpn_add_n_sub_n (bp1, bm1, b0, b1, n);
+ }
+ bp1_hi = cy >> 1;
+#else
+ bp1_hi = mpn_add_n (bp1, b0, b1, n);
+
+ if (mpn_cmp (b0, b1, n) < 0)
+ {
+ ASSERT_NOCARRY (mpn_sub_n (bm1, b1, b0, n));
+ vm1_neg ^= 1;
+ }
+ else
+ {
+ ASSERT_NOCARRY (mpn_sub_n (bm1, b0, b1, n));
+ }
+#endif
+ }
+ else
+ {
+ /* FIXME: Should still use mpn_add_n_sub_n for the main part. */
+ bp1_hi = mpn_add (bp1, b0, n, b1, t);
+
+ if (mpn_zero_p (b0 + t, n - t) && mpn_cmp (b0, b1, t) < 0)
+ {
+ ASSERT_NOCARRY (mpn_sub_n (bm1, b1, b0, t));
+ MPN_ZERO (bm1 + t, n - t);
+ vm1_neg ^= 1;
+ }
+ else
+ {
+ ASSERT_NOCARRY (mpn_sub (bm1, b0, n, b1, t));
+ }
+ }
+
+ TOOM32_MUL_N_REC (v1, ap1, bp1, n, scratch_out);
+ if (ap1_hi == 1)
+ {
+ cy = bp1_hi + mpn_add_n (v1 + n, v1 + n, bp1, n);
+ }
+ else if (ap1_hi == 2)
+ {
+#if HAVE_NATIVE_mpn_addlsh1_n
+ cy = 2 * bp1_hi + mpn_addlsh1_n (v1 + n, v1 + n, bp1, n);
+#else
+ cy = 2 * bp1_hi + mpn_addmul_1 (v1 + n, bp1, n, CNST_LIMB(2));
+#endif
+ }
+ else
+ cy = 0;
+ if (bp1_hi != 0)
+ cy += mpn_add_n (v1 + n, v1 + n, ap1, n);
+ v1[2 * n] = cy;
+
+ TOOM32_MUL_N_REC (vm1, am1, bm1, n, scratch_out);
+ if (hi)
+ hi = mpn_add_n (vm1+n, vm1+n, bm1, n);
+
+ vm1[2*n] = hi;
+
+ /* v1 <-- (v1 + vm1) / 2 = x0 + x2 */
+ if (vm1_neg)
+ {
+#if HAVE_NATIVE_mpn_rsh1sub_n
+ mpn_rsh1sub_n (v1, v1, vm1, 2*n+1);
+#else
+ mpn_sub_n (v1, v1, vm1, 2*n+1);
+ ASSERT_NOCARRY (mpn_rshift (v1, v1, 2*n+1, 1));
+#endif
+ }
+ else
+ {
+#if HAVE_NATIVE_mpn_rsh1add_n
+ mpn_rsh1add_n (v1, v1, vm1, 2*n+1);
+#else
+ mpn_add_n (v1, v1, vm1, 2*n+1);
+ ASSERT_NOCARRY (mpn_rshift (v1, v1, 2*n+1, 1));
+#endif
+ }
+
+ /* We get x1 + x3 = (x0 + x2) - (x0 - x1 + x2 - x3), and hence
+
+ y = x1 + x3 + (x0 + x2) * B
+ = (x0 + x2) * B + (x0 + x2) - vm1.
+
+ y is 3*n + 1 limbs, y = y0 + y1 B + y2 B^2. We store them as
+ follows: y0 at scratch, y1 at pp + 2*n, and y2 at scratch + n
+ (already in place, except for carry propagation).
+
+ We thus add
+
+ B^3 B^2 B 1
+ | | | |
+ +-----+----+
+ + | x0 + x2 |
+ +----+-----+----+
+ + | x0 + x2 |
+ +----------+
+ - | vm1 |
+ --+----++----+----+-
+ | y2 | y1 | y0 |
+ +-----+----+----+
+
+ Since we store y0 at the same location as the low half of x0 + x2, we
+ need to do the middle sum first. */
+
+ hi = vm1[2*n];
+ cy = mpn_add_n (pp + 2*n, v1, v1 + n, n);
+ MPN_INCR_U (v1 + n, n + 1, cy + v1[2*n]);
+
+ /* FIXME: Can we get rid of this second vm1_neg conditional by
+ swapping the location of +1 and -1 values? */
+ if (vm1_neg)
+ {
+ cy = mpn_add_n (v1, v1, vm1, n);
+ hi += mpn_add_nc (pp + 2*n, pp + 2*n, vm1 + n, n, cy);
+ MPN_INCR_U (v1 + n, n+1, hi);
+ }
+ else
+ {
+ cy = mpn_sub_n (v1, v1, vm1, n);
+ hi += mpn_sub_nc (pp + 2*n, pp + 2*n, vm1 + n, n, cy);
+ MPN_DECR_U (v1 + n, n+1, hi);
+ }
+
+ TOOM32_MUL_N_REC (pp, a0, b0, n, scratch_out);
+ /* vinf, s+t limbs. Use mpn_mul for now, to handle unbalanced operands */
+ if (s > t) mpn_mul (pp+3*n, a2, s, b1, t);
+ else mpn_mul (pp+3*n, b1, t, a2, s);
+
+ /* Remaining interpolation.
+
+ y * B + x0 + x3 B^3 - x0 B^2 - x3 B
+ = (x1 + x3) B + (x0 + x2) B^2 + x0 + x3 B^3 - x0 B^2 - x3 B
+ = y0 B + y1 B^2 + y3 B^3 + Lx0 + H x0 B
+ + L x3 B^3 + H x3 B^4 - Lx0 B^2 - H x0 B^3 - L x3 B - H x3 B^2
+ = L x0 + (y0 + H x0 - L x3) B + (y1 - L x0 - H x3) B^2
+ + (y2 - (H x0 - L x3)) B^3 + H x3 B^4
+
+ B^4 B^3 B^2 B 1
+ | | | | | |
+ +-------+ +---------+---------+
+ | Hx3 | | Hx0-Lx3 | Lx0 |
+ +------+----------+---------+---------+---------+
+ | y2 | y1 | y0 |
+ ++---------+---------+---------+
+ -| Hx0-Lx3 | - Lx0 |
+ +---------+---------+
+ | - Hx3 |
+ +--------+
+
+ We must take into account the carry from Hx0 - Lx3.
+ */
+
+ cy = mpn_sub_n (pp + n, pp + n, pp+3*n, n);
+ hi = scratch[2*n] + cy;
+
+ cy = mpn_sub_nc (pp + 2*n, pp + 2*n, pp, n, cy);
+ hi -= mpn_sub_nc (pp + 3*n, scratch + n, pp + n, n, cy);
+
+ hi += mpn_add (pp + n, pp + n, 3*n, scratch, n);
+
+ /* FIXME: Is support for s + t == n needed? */
+ if (LIKELY (s + t > n))
+ {
+ hi -= mpn_sub (pp + 2*n, pp + 2*n, 2*n, pp + 4*n, s+t-n);
+
+ if (hi < 0)
+ MPN_DECR_U (pp + 4*n, s+t-n, -hi);
+ else
+ MPN_INCR_U (pp + 4*n, s+t-n, hi);
+ }
+ else
+ ASSERT (hi == 0);
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/toom33_mul.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/toom33_mul.c
new file mode 100644
index 00000000000..655355c39a3
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/toom33_mul.c
@@ -0,0 +1,316 @@
+/* mpn_toom33_mul -- Multiply {ap,an} and {p,bn} where an and bn are close in
+ size. Or more accurately, bn <= an < (3/2)bn.
+
+ Contributed to the GNU project by Torbjorn Granlund.
+ Additional improvements by Marco Bodrato.
+
+ THE FUNCTION IN THIS FILE IS INTERNAL WITH A MUTABLE INTERFACE. IT IS ONLY
+ 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.
+
+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.h"
+#include "gmp-impl.h"
+
+/* Evaluate in: -1, 0, +1, +2, +inf
+
+ <-s--><--n--><--n-->
+ ____ ______ ______
+ |_a2_|___a1_|___a0_|
+ |b2_|___b1_|___b0_|
+ <-t-><--n--><--n-->
+
+ v0 = a0 * b0 # A(0)*B(0)
+ v1 = (a0+ a1+ a2)*(b0+ b1+ b2) # A(1)*B(1) ah <= 2 bh <= 2
+ vm1 = (a0- a1+ a2)*(b0- b1+ b2) # A(-1)*B(-1) |ah| <= 1 bh <= 1
+ v2 = (a0+2a1+4a2)*(b0+2b1+4b2) # A(2)*B(2) ah <= 6 bh <= 6
+ vinf= a2 * b2 # A(inf)*B(inf)
+*/
+
+#if TUNE_PROGRAM_BUILD || WANT_FAT_BINARY
+#define MAYBE_mul_basecase 1
+#define MAYBE_mul_toom33 1
+#else
+#define MAYBE_mul_basecase \
+ (MUL_TOOM33_THRESHOLD < 3 * MUL_TOOM22_THRESHOLD)
+#define MAYBE_mul_toom33 \
+ (MUL_TOOM44_THRESHOLD >= 3 * MUL_TOOM33_THRESHOLD)
+#endif
+
+/* FIXME: TOOM33_MUL_N_REC is not quite right for a balanced
+ multiplication at the infinity point. We may have
+ MAYBE_mul_basecase == 0, and still get s just below
+ MUL_TOOM22_THRESHOLD. If MUL_TOOM33_THRESHOLD == 7, we can even get
+ s == 1 and mpn_toom22_mul will crash.
+*/
+
+#define TOOM33_MUL_N_REC(p, a, b, n, ws) \
+ do { \
+ if (MAYBE_mul_basecase \
+ && BELOW_THRESHOLD (n, MUL_TOOM22_THRESHOLD)) \
+ mpn_mul_basecase (p, a, n, b, n); \
+ else if (! MAYBE_mul_toom33 \
+ || BELOW_THRESHOLD (n, MUL_TOOM33_THRESHOLD)) \
+ mpn_toom22_mul (p, a, n, b, n, ws); \
+ else \
+ mpn_toom33_mul (p, a, n, b, n, ws); \
+ } while (0)
+
+void
+mpn_toom33_mul (mp_ptr pp,
+ mp_srcptr ap, mp_size_t an,
+ mp_srcptr bp, mp_size_t bn,
+ mp_ptr scratch)
+{
+ const int __gmpn_cpuvec_initialized = 1;
+ mp_size_t n, s, t;
+ int vm1_neg;
+ mp_limb_t cy, vinf0;
+ mp_ptr gp;
+ mp_ptr as1, asm1, as2;
+ mp_ptr bs1, bsm1, bs2;
+
+#define a0 ap
+#define a1 (ap + n)
+#define a2 (ap + 2*n)
+#define b0 bp
+#define b1 (bp + n)
+#define b2 (bp + 2*n)
+
+ n = (an + 2) / (size_t) 3;
+
+ s = an - 2 * n;
+ t = bn - 2 * n;
+
+ ASSERT (an >= bn);
+
+ ASSERT (0 < s && s <= n);
+ ASSERT (0 < t && t <= n);
+
+ as1 = scratch + 4 * n + 4;
+ asm1 = scratch + 2 * n + 2;
+ as2 = pp + n + 1;
+
+ bs1 = pp;
+ bsm1 = scratch + 3 * n + 3; /* we need 4n+4 <= 4n+s+t */
+ bs2 = pp + 2 * n + 2;
+
+ gp = scratch;
+
+ vm1_neg = 0;
+
+ /* Compute as1 and asm1. */
+ cy = mpn_add (gp, a0, n, a2, s);
+#if HAVE_NATIVE_mpn_add_n_sub_n
+ if (cy == 0 && mpn_cmp (gp, a1, n) < 0)
+ {
+ cy = mpn_add_n_sub_n (as1, asm1, a1, gp, n);
+ as1[n] = cy >> 1;
+ asm1[n] = 0;
+ vm1_neg = 1;
+ }
+ else
+ {
+ mp_limb_t cy2;
+ cy2 = mpn_add_n_sub_n (as1, asm1, gp, a1, n);
+ as1[n] = cy + (cy2 >> 1);
+ asm1[n] = cy - (cy2 & 1);
+ }
+#else
+ as1[n] = cy + mpn_add_n (as1, gp, a1, n);
+ if (cy == 0 && mpn_cmp (gp, a1, n) < 0)
+ {
+ mpn_sub_n (asm1, a1, gp, n);
+ asm1[n] = 0;
+ vm1_neg = 1;
+ }
+ else
+ {
+ cy -= mpn_sub_n (asm1, gp, a1, n);
+ asm1[n] = cy;
+ }
+#endif
+
+ /* Compute as2. */
+#if HAVE_NATIVE_mpn_rsblsh1_n
+ cy = mpn_add_n (as2, a2, as1, s);
+ if (s != n)
+ cy = mpn_add_1 (as2 + s, as1 + s, n - s, cy);
+ cy += as1[n];
+ cy = 2 * cy + mpn_rsblsh1_n (as2, a0, as2, n);
+#else
+#if HAVE_NATIVE_mpn_addlsh1_n
+ cy = mpn_addlsh1_n (as2, a1, a2, s);
+ if (s != n)
+ cy = mpn_add_1 (as2 + s, a1 + s, n - s, cy);
+ cy = 2 * cy + mpn_addlsh1_n (as2, a0, as2, n);
+#else
+ cy = mpn_add_n (as2, a2, as1, s);
+ if (s != n)
+ cy = mpn_add_1 (as2 + s, as1 + s, n - s, cy);
+ cy += as1[n];
+ cy = 2 * cy + mpn_lshift (as2, as2, n, 1);
+ cy -= mpn_sub_n (as2, as2, a0, n);
+#endif
+#endif
+ as2[n] = cy;
+
+ /* Compute bs1 and bsm1. */
+ cy = mpn_add (gp, b0, n, b2, t);
+#if HAVE_NATIVE_mpn_add_n_sub_n
+ if (cy == 0 && mpn_cmp (gp, b1, n) < 0)
+ {
+ cy = mpn_add_n_sub_n (bs1, bsm1, b1, gp, n);
+ bs1[n] = cy >> 1;
+ bsm1[n] = 0;
+ vm1_neg ^= 1;
+ }
+ else
+ {
+ mp_limb_t cy2;
+ cy2 = mpn_add_n_sub_n (bs1, bsm1, gp, b1, n);
+ bs1[n] = cy + (cy2 >> 1);
+ bsm1[n] = cy - (cy2 & 1);
+ }
+#else
+ bs1[n] = cy + mpn_add_n (bs1, gp, b1, n);
+ if (cy == 0 && mpn_cmp (gp, b1, n) < 0)
+ {
+ mpn_sub_n (bsm1, b1, gp, n);
+ bsm1[n] = 0;
+ vm1_neg ^= 1;
+ }
+ else
+ {
+ cy -= mpn_sub_n (bsm1, gp, b1, n);
+ bsm1[n] = cy;
+ }
+#endif
+
+ /* Compute bs2. */
+#if HAVE_NATIVE_mpn_rsblsh1_n
+ cy = mpn_add_n (bs2, b2, bs1, t);
+ if (t != n)
+ cy = mpn_add_1 (bs2 + t, bs1 + t, n - t, cy);
+ cy += bs1[n];
+ cy = 2 * cy + mpn_rsblsh1_n (bs2, b0, bs2, n);
+#else
+#if HAVE_NATIVE_mpn_addlsh1_n
+ cy = mpn_addlsh1_n (bs2, b1, b2, t);
+ if (t != n)
+ cy = mpn_add_1 (bs2 + t, b1 + t, n - t, cy);
+ cy = 2 * cy + mpn_addlsh1_n (bs2, b0, bs2, n);
+#else
+ cy = mpn_add_n (bs2, bs1, b2, t);
+ if (t != n)
+ cy = mpn_add_1 (bs2 + t, bs1 + t, n - t, cy);
+ cy += bs1[n];
+ cy = 2 * cy + mpn_lshift (bs2, bs2, n, 1);
+ cy -= mpn_sub_n (bs2, bs2, b0, n);
+#endif
+#endif
+ bs2[n] = cy;
+
+ ASSERT (as1[n] <= 2);
+ ASSERT (bs1[n] <= 2);
+ ASSERT (asm1[n] <= 1);
+ ASSERT (bsm1[n] <= 1);
+ ASSERT (as2[n] <= 6);
+ ASSERT (bs2[n] <= 6);
+
+#define v0 pp /* 2n */
+#define v1 (pp + 2 * n) /* 2n+1 */
+#define vinf (pp + 4 * n) /* s+t */
+#define vm1 scratch /* 2n+1 */
+#define v2 (scratch + 2 * n + 1) /* 2n+2 */
+#define scratch_out (scratch + 5 * n + 5)
+
+ /* vm1, 2n+1 limbs */
+#ifdef SMALLER_RECURSION
+ TOOM33_MUL_N_REC (vm1, asm1, bsm1, n, scratch_out);
+ cy = 0;
+ if (asm1[n] != 0)
+ cy = bsm1[n] + mpn_add_n (vm1 + n, vm1 + n, bsm1, n);
+ if (bsm1[n] != 0)
+ cy += mpn_add_n (vm1 + n, vm1 + n, asm1, n);
+ vm1[2 * n] = cy;
+#else
+ TOOM33_MUL_N_REC (vm1, asm1, bsm1, n + 1, scratch_out);
+#endif
+
+ TOOM33_MUL_N_REC (v2, as2, bs2, n + 1, scratch_out); /* v2, 2n+1 limbs */
+
+ /* vinf, s+t limbs */
+ if (s > t) mpn_mul (vinf, a2, s, b2, t);
+ else TOOM33_MUL_N_REC (vinf, a2, b2, s, scratch_out);
+
+ vinf0 = vinf[0]; /* v1 overlaps with this */
+
+#ifdef SMALLER_RECURSION
+ /* v1, 2n+1 limbs */
+ TOOM33_MUL_N_REC (v1, as1, bs1, n, scratch_out);
+ if (as1[n] == 1)
+ {
+ cy = bs1[n] + mpn_add_n (v1 + n, v1 + n, bs1, n);
+ }
+ else if (as1[n] != 0)
+ {
+#if HAVE_NATIVE_mpn_addlsh1_n
+ cy = 2 * bs1[n] + mpn_addlsh1_n (v1 + n, v1 + n, bs1, n);
+#else
+ cy = 2 * bs1[n] + mpn_addmul_1 (v1 + n, bs1, n, CNST_LIMB(2));
+#endif
+ }
+ else
+ cy = 0;
+ if (bs1[n] == 1)
+ {
+ cy += mpn_add_n (v1 + n, v1 + n, as1, n);
+ }
+ else if (bs1[n] != 0)
+ {
+#if HAVE_NATIVE_mpn_addlsh1_n
+ cy += mpn_addlsh1_n (v1 + n, v1 + n, as1, n);
+#else
+ cy += mpn_addmul_1 (v1 + n, as1, n, CNST_LIMB(2));
+#endif
+ }
+ v1[2 * n] = cy;
+#else
+ cy = vinf[1];
+ TOOM33_MUL_N_REC (v1, as1, bs1, n + 1, scratch_out);
+ vinf[1] = cy;
+#endif
+
+ TOOM33_MUL_N_REC (v0, ap, bp, n, scratch_out); /* v0, 2n limbs */
+
+ mpn_toom_interpolate_5pts (pp, v2, vm1, n, s + t, vm1_neg, vinf0);
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/toom3_sqr.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/toom3_sqr.c
new file mode 100644
index 00000000000..6117c67ca68
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/toom3_sqr.c
@@ -0,0 +1,226 @@
+/* mpn_toom3_sqr -- Square {ap,an}.
+
+ Contributed to the GNU project by Torbjorn Granlund.
+ Additional improvements by Marco Bodrato.
+
+ THE FUNCTION IN THIS FILE IS INTERNAL WITH A MUTABLE INTERFACE. IT IS ONLY
+ 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.
+
+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.h"
+#include "gmp-impl.h"
+
+/* Evaluate in: -1, 0, +1, +2, +inf
+
+ <-s--><--n--><--n-->
+ ____ ______ ______
+ |_a2_|___a1_|___a0_|
+
+ v0 = a0 ^2 # A(0)^2
+ v1 = (a0+ a1+ a2)^2 # A(1)^2 ah <= 2
+ vm1 = (a0- a1+ a2)^2 # A(-1)^2 |ah| <= 1
+ v2 = (a0+2a1+4a2)^2 # A(2)^2 ah <= 6
+ vinf= a2 ^2 # A(inf)^2
+*/
+
+#if TUNE_PROGRAM_BUILD || WANT_FAT_BINARY
+#define MAYBE_sqr_basecase 1
+#define MAYBE_sqr_toom3 1
+#else
+#define MAYBE_sqr_basecase \
+ (SQR_TOOM3_THRESHOLD < 3 * SQR_TOOM2_THRESHOLD)
+#define MAYBE_sqr_toom3 \
+ (SQR_TOOM4_THRESHOLD >= 3 * SQR_TOOM3_THRESHOLD)
+#endif
+
+#define TOOM3_SQR_REC(p, a, n, ws) \
+ do { \
+ if (MAYBE_sqr_basecase \
+ && BELOW_THRESHOLD (n, SQR_TOOM2_THRESHOLD)) \
+ mpn_sqr_basecase (p, a, n); \
+ else if (! MAYBE_sqr_toom3 \
+ || BELOW_THRESHOLD (n, SQR_TOOM3_THRESHOLD)) \
+ mpn_toom2_sqr (p, a, n, ws); \
+ else \
+ mpn_toom3_sqr (p, a, n, ws); \
+ } while (0)
+
+void
+mpn_toom3_sqr (mp_ptr pp,
+ mp_srcptr ap, mp_size_t an,
+ mp_ptr scratch)
+{
+ const int __gmpn_cpuvec_initialized = 1;
+ mp_size_t n, s;
+ mp_limb_t cy, vinf0;
+ mp_ptr gp;
+ mp_ptr as1, asm1, as2;
+
+#define a0 ap
+#define a1 (ap + n)
+#define a2 (ap + 2*n)
+
+ n = (an + 2) / (size_t) 3;
+
+ s = an - 2 * n;
+
+ ASSERT (0 < s && s <= n);
+
+ as1 = scratch + 4 * n + 4;
+ asm1 = scratch + 2 * n + 2;
+ as2 = pp + n + 1;
+
+ gp = scratch;
+
+ /* Compute as1 and asm1. */
+ cy = mpn_add (gp, a0, n, a2, s);
+#if HAVE_NATIVE_mpn_add_n_sub_n
+ if (cy == 0 && mpn_cmp (gp, a1, n) < 0)
+ {
+ cy = mpn_add_n_sub_n (as1, asm1, a1, gp, n);
+ as1[n] = cy >> 1;
+ asm1[n] = 0;
+ }
+ else
+ {
+ mp_limb_t cy2;
+ cy2 = mpn_add_n_sub_n (as1, asm1, gp, a1, n);
+ as1[n] = cy + (cy2 >> 1);
+ asm1[n] = cy - (cy2 & 1);
+ }
+#else
+ as1[n] = cy + mpn_add_n (as1, gp, a1, n);
+ if (cy == 0 && mpn_cmp (gp, a1, n) < 0)
+ {
+ mpn_sub_n (asm1, a1, gp, n);
+ asm1[n] = 0;
+ }
+ else
+ {
+ cy -= mpn_sub_n (asm1, gp, a1, n);
+ asm1[n] = cy;
+ }
+#endif
+
+ /* Compute as2. */
+#if HAVE_NATIVE_mpn_rsblsh1_n
+ cy = mpn_add_n (as2, a2, as1, s);
+ if (s != n)
+ cy = mpn_add_1 (as2 + s, as1 + s, n - s, cy);
+ cy += as1[n];
+ cy = 2 * cy + mpn_rsblsh1_n (as2, a0, as2, n);
+#else
+#if HAVE_NATIVE_mpn_addlsh1_n
+ cy = mpn_addlsh1_n (as2, a1, a2, s);
+ if (s != n)
+ cy = mpn_add_1 (as2 + s, a1 + s, n - s, cy);
+ cy = 2 * cy + mpn_addlsh1_n (as2, a0, as2, n);
+#else
+ cy = mpn_add_n (as2, a2, as1, s);
+ if (s != n)
+ cy = mpn_add_1 (as2 + s, as1 + s, n - s, cy);
+ cy += as1[n];
+ cy = 2 * cy + mpn_lshift (as2, as2, n, 1);
+ cy -= mpn_sub_n (as2, as2, a0, n);
+#endif
+#endif
+ as2[n] = cy;
+
+ ASSERT (as1[n] <= 2);
+ ASSERT (asm1[n] <= 1);
+
+#define v0 pp /* 2n */
+#define v1 (pp + 2 * n) /* 2n+1 */
+#define vinf (pp + 4 * n) /* s+s */
+#define vm1 scratch /* 2n+1 */
+#define v2 (scratch + 2 * n + 1) /* 2n+2 */
+#define scratch_out (scratch + 5 * n + 5)
+
+ /* vm1, 2n+1 limbs */
+#ifdef SMALLER_RECURSION
+ TOOM3_SQR_REC (vm1, asm1, n, scratch_out);
+ cy = 0;
+ if (asm1[n] != 0)
+ cy = asm1[n] + mpn_add_n (vm1 + n, vm1 + n, asm1, n);
+ if (asm1[n] != 0)
+ cy += mpn_add_n (vm1 + n, vm1 + n, asm1, n);
+ vm1[2 * n] = cy;
+#else
+ TOOM3_SQR_REC (vm1, asm1, n + 1, scratch_out);
+#endif
+
+ TOOM3_SQR_REC (v2, as2, n + 1, scratch_out); /* v2, 2n+1 limbs */
+
+ TOOM3_SQR_REC (vinf, a2, s, scratch_out); /* vinf, s+s limbs */
+
+ vinf0 = vinf[0]; /* v1 overlaps with this */
+
+#ifdef SMALLER_RECURSION
+ /* v1, 2n+1 limbs */
+ TOOM3_SQR_REC (v1, as1, n, scratch_out);
+ if (as1[n] == 1)
+ {
+ cy = as1[n] + mpn_add_n (v1 + n, v1 + n, as1, n);
+ }
+ else if (as1[n] != 0)
+ {
+#if HAVE_NATIVE_mpn_addlsh1_n
+ cy = 2 * as1[n] + mpn_addlsh1_n (v1 + n, v1 + n, as1, n);
+#else
+ cy = 2 * as1[n] + mpn_addmul_1 (v1 + n, as1, n, CNST_LIMB(2));
+#endif
+ }
+ else
+ cy = 0;
+ if (as1[n] == 1)
+ {
+ cy += mpn_add_n (v1 + n, v1 + n, as1, n);
+ }
+ else if (as1[n] != 0)
+ {
+#if HAVE_NATIVE_mpn_addlsh1_n
+ cy += mpn_addlsh1_n (v1 + n, v1 + n, as1, n);
+#else
+ cy += mpn_addmul_1 (v1 + n, as1, n, CNST_LIMB(2));
+#endif
+ }
+ v1[2 * n] = cy;
+#else
+ cy = vinf[1];
+ TOOM3_SQR_REC (v1, as1, n + 1, scratch_out);
+ vinf[1] = cy;
+#endif
+
+ TOOM3_SQR_REC (v0, ap, n, scratch_out); /* v0, 2n limbs */
+
+ mpn_toom_interpolate_5pts (pp, v2, vm1, n, s + s, 0, vinf0);
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/toom42_mul.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/toom42_mul.c
new file mode 100644
index 00000000000..9b1e7d491bf
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/toom42_mul.c
@@ -0,0 +1,234 @@
+/* mpn_toom42_mul -- Multiply {ap,an} and {bp,bn} where an is nominally twice
+ as large as bn. Or more accurately, (3/2)bn < an < 4bn.
+
+ Contributed to the GNU project by Torbjorn Granlund.
+ Additional improvements by Marco Bodrato.
+
+ The idea of applying toom to unbalanced multiplication is due to Marco
+ Bodrato and Alberto Zanoni.
+
+ THE FUNCTION IN THIS FILE IS INTERNAL WITH A MUTABLE INTERFACE. IT IS ONLY
+ 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 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.h"
+#include "gmp-impl.h"
+
+/* Evaluate in: -1, 0, +1, +2, +inf
+
+ <-s-><--n--><--n--><--n-->
+ ___ ______ ______ ______
+ |a3_|___a2_|___a1_|___a0_|
+ |_b1_|___b0_|
+ <-t--><--n-->
+
+ v0 = a0 * b0 # A(0)*B(0)
+ v1 = (a0+ a1+ a2+ a3)*(b0+ b1) # A(1)*B(1) ah <= 3 bh <= 1
+ vm1 = (a0- a1+ a2- a3)*(b0- b1) # A(-1)*B(-1) |ah| <= 1 bh = 0
+ v2 = (a0+2a1+4a2+8a3)*(b0+2b1) # A(2)*B(2) ah <= 14 bh <= 2
+ vinf= a3 * b1 # A(inf)*B(inf)
+*/
+
+#define TOOM42_MUL_N_REC(p, a, b, n, ws) \
+ do { \
+ mpn_mul_n (p, a, b, n); \
+ } while (0)
+
+void
+mpn_toom42_mul (mp_ptr pp,
+ mp_srcptr ap, mp_size_t an,
+ mp_srcptr bp, mp_size_t bn,
+ mp_ptr scratch)
+{
+ mp_size_t n, s, t;
+ int vm1_neg;
+ mp_limb_t cy, vinf0;
+ mp_ptr a0_a2;
+ mp_ptr as1, asm1, as2;
+ mp_ptr bs1, bsm1, bs2;
+ TMP_DECL;
+
+#define a0 ap
+#define a1 (ap + n)
+#define a2 (ap + 2*n)
+#define a3 (ap + 3*n)
+#define b0 bp
+#define b1 (bp + n)
+
+ n = an >= 2 * bn ? (an + 3) >> 2 : (bn + 1) >> 1;
+
+ s = an - 3 * n;
+ t = bn - n;
+
+ ASSERT (0 < s && s <= n);
+ ASSERT (0 < t && t <= n);
+
+ TMP_MARK;
+
+ as1 = TMP_SALLOC_LIMBS (n + 1);
+ asm1 = TMP_SALLOC_LIMBS (n + 1);
+ as2 = TMP_SALLOC_LIMBS (n + 1);
+
+ bs1 = TMP_SALLOC_LIMBS (n + 1);
+ bsm1 = TMP_SALLOC_LIMBS (n);
+ bs2 = TMP_SALLOC_LIMBS (n + 1);
+
+ a0_a2 = pp;
+
+ /* Compute as1 and asm1. */
+ vm1_neg = mpn_toom_eval_dgr3_pm1 (as1, asm1, ap, n, s, a0_a2) & 1;
+
+ /* Compute as2. */
+#if HAVE_NATIVE_mpn_addlsh1_n
+ cy = mpn_addlsh1_n (as2, a2, a3, s);
+ if (s != n)
+ cy = mpn_add_1 (as2 + s, a2 + s, n - s, cy);
+ cy = 2 * cy + mpn_addlsh1_n (as2, a1, as2, n);
+ cy = 2 * cy + mpn_addlsh1_n (as2, a0, as2, n);
+#else
+ cy = mpn_lshift (as2, a3, s, 1);
+ cy += mpn_add_n (as2, a2, as2, s);
+ if (s != n)
+ cy = mpn_add_1 (as2 + s, a2 + s, n - s, cy);
+ cy = 2 * cy + mpn_lshift (as2, as2, n, 1);
+ cy += mpn_add_n (as2, a1, as2, n);
+ cy = 2 * cy + mpn_lshift (as2, as2, n, 1);
+ cy += mpn_add_n (as2, a0, as2, n);
+#endif
+ as2[n] = cy;
+
+ /* Compute bs1 and bsm1. */
+ if (t == n)
+ {
+#if HAVE_NATIVE_mpn_add_n_sub_n
+ if (mpn_cmp (b0, b1, n) < 0)
+ {
+ cy = mpn_add_n_sub_n (bs1, bsm1, b1, b0, n);
+ vm1_neg ^= 1;
+ }
+ else
+ {
+ cy = mpn_add_n_sub_n (bs1, bsm1, b0, b1, n);
+ }
+ bs1[n] = cy >> 1;
+#else
+ bs1[n] = mpn_add_n (bs1, b0, b1, n);
+
+ if (mpn_cmp (b0, b1, n) < 0)
+ {
+ mpn_sub_n (bsm1, b1, b0, n);
+ vm1_neg ^= 1;
+ }
+ else
+ {
+ mpn_sub_n (bsm1, b0, b1, n);
+ }
+#endif
+ }
+ else
+ {
+ bs1[n] = mpn_add (bs1, b0, n, b1, t);
+
+ if (mpn_zero_p (b0 + t, n - t) && mpn_cmp (b0, b1, t) < 0)
+ {
+ mpn_sub_n (bsm1, b1, b0, t);
+ MPN_ZERO (bsm1 + t, n - t);
+ vm1_neg ^= 1;
+ }
+ else
+ {
+ mpn_sub (bsm1, b0, n, b1, t);
+ }
+ }
+
+ /* Compute bs2, recycling bs1. bs2=bs1+b1 */
+ mpn_add (bs2, bs1, n + 1, b1, t);
+
+ ASSERT (as1[n] <= 3);
+ ASSERT (bs1[n] <= 1);
+ ASSERT (asm1[n] <= 1);
+/*ASSERT (bsm1[n] == 0);*/
+ ASSERT (as2[n] <= 14);
+ ASSERT (bs2[n] <= 2);
+
+#define v0 pp /* 2n */
+#define v1 (pp + 2 * n) /* 2n+1 */
+#define vinf (pp + 4 * n) /* s+t */
+#define vm1 scratch /* 2n+1 */
+#define v2 (scratch + 2 * n + 1) /* 2n+2 */
+#define scratch_out scratch + 4 * n + 4 /* Currently unused. */
+
+ /* vm1, 2n+1 limbs */
+ TOOM42_MUL_N_REC (vm1, asm1, bsm1, n, scratch_out);
+ cy = 0;
+ if (asm1[n] != 0)
+ cy = mpn_add_n (vm1 + n, vm1 + n, bsm1, n);
+ vm1[2 * n] = cy;
+
+ TOOM42_MUL_N_REC (v2, as2, bs2, n + 1, scratch_out); /* v2, 2n+1 limbs */
+
+ /* vinf, s+t limbs */
+ if (s > t) mpn_mul (vinf, a3, s, b1, t);
+ else mpn_mul (vinf, b1, t, a3, s);
+
+ vinf0 = vinf[0]; /* v1 overlaps with this */
+
+ /* v1, 2n+1 limbs */
+ TOOM42_MUL_N_REC (v1, as1, bs1, n, scratch_out);
+ if (as1[n] == 1)
+ {
+ cy = bs1[n] + mpn_add_n (v1 + n, v1 + n, bs1, n);
+ }
+ else if (as1[n] == 2)
+ {
+#if HAVE_NATIVE_mpn_addlsh1_n
+ cy = 2 * bs1[n] + mpn_addlsh1_n (v1 + n, v1 + n, bs1, n);
+#else
+ cy = 2 * bs1[n] + mpn_addmul_1 (v1 + n, bs1, n, CNST_LIMB(2));
+#endif
+ }
+ else if (as1[n] == 3)
+ {
+ cy = 3 * bs1[n] + mpn_addmul_1 (v1 + n, bs1, n, CNST_LIMB(3));
+ }
+ else
+ cy = 0;
+ if (bs1[n] != 0)
+ cy += mpn_add_n (v1 + n, v1 + n, as1, n);
+ v1[2 * n] = cy;
+
+ TOOM42_MUL_N_REC (v0, ap, bp, n, scratch_out); /* v0, 2n limbs */
+
+ mpn_toom_interpolate_5pts (pp, v2, vm1, n, s + t, vm1_neg, vinf0);
+
+ TMP_FREE;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/toom42_mulmid.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/toom42_mulmid.c
new file mode 100644
index 00000000000..0251a6d7ed3
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/toom42_mulmid.c
@@ -0,0 +1,238 @@
+/* mpn_toom42_mulmid -- toom42 middle product
+
+ Contributed by David Harvey.
+
+ THE FUNCTION IN THIS FILE IS INTERNAL 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 2011 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.h"
+#include "gmp-impl.h"
+
+
+
+/*
+ Middle product of {ap,2n-1} and {bp,n}, output written to {rp,n+2}.
+
+ Neither ap nor bp may overlap rp.
+
+ Must have n >= 4.
+
+ Amount of scratch space required is given by mpn_toom42_mulmid_itch().
+
+ FIXME: this code assumes that n is small compared to GMP_NUMB_MAX. The exact
+ requirements should be clarified.
+*/
+void
+mpn_toom42_mulmid (mp_ptr rp, mp_srcptr ap, mp_srcptr bp, mp_size_t n,
+ mp_ptr scratch)
+{
+ mp_limb_t cy, e[12], zh, zl;
+ mp_size_t m;
+ int neg;
+
+ ASSERT (n >= 4);
+ ASSERT (! MPN_OVERLAP_P (rp, n + 2, ap, 2*n - 1));
+ ASSERT (! MPN_OVERLAP_P (rp, n + 2, bp, n));
+
+ ap += n & 1; /* handle odd row and diagonal later */
+ m = n / 2;
+
+ /* (e0h:e0l) etc are correction terms, in 2's complement */
+#define e0l (e[0])
+#define e0h (e[1])
+#define e1l (e[2])
+#define e1h (e[3])
+#define e2l (e[4])
+#define e2h (e[5])
+#define e3l (e[6])
+#define e3h (e[7])
+#define e4l (e[8])
+#define e4h (e[9])
+#define e5l (e[10])
+#define e5h (e[11])
+
+#define s (scratch + 2)
+#define t (rp + m + 2)
+#define p0 rp
+#define p1 scratch
+#define p2 (rp + m)
+#define next_scratch (scratch + 3*m + 1)
+
+ /*
+ rp scratch
+ |---------|-----------| |---------|---------|----------|
+ 0 m 2m+2 0 m 2m 3m+1
+ <----p2----> <-------------s------------->
+ <----p0----><---t----> <----p1---->
+ */
+
+ /* compute {s,3m-1} = {a,3m-1} + {a+m,3m-1} and error terms e0, e1, e2, e3 */
+ cy = mpn_add_err1_n (s, ap, ap + m, &e0l, bp + m, m - 1, 0);
+ cy = mpn_add_err2_n (s + m - 1, ap + m - 1, ap + 2*m - 1, &e1l,
+ bp + m, bp, m, cy);
+ mpn_add_err1_n (s + 2*m - 1, ap + 2*m - 1, ap + 3*m - 1, &e3l, bp, m, cy);
+
+ /* compute t = (-1)^neg * ({b,m} - {b+m,m}) and error terms e4, e5 */
+ if (mpn_cmp (bp + m, bp, m) < 0)
+ {
+ ASSERT_NOCARRY (mpn_sub_err2_n (t, bp, bp + m, &e4l,
+ ap + m - 1, ap + 2*m - 1, m, 0));
+ neg = 1;
+ }
+ else
+ {
+ ASSERT_NOCARRY (mpn_sub_err2_n (t, bp + m, bp, &e4l,
+ ap + m - 1, ap + 2*m - 1, m, 0));
+ neg = 0;
+ }
+
+ /* recursive middle products. The picture is:
+
+ b[2m-1] A A A B B B - - - - -
+ ... - A A A B B B - - - -
+ b[m] - - A A A B B B - - -
+ b[m-1] - - - C C C D D D - -
+ ... - - - - C C C D D D -
+ b[0] - - - - - C C C D D D
+ a[0] ... a[m] ... a[2m] ... a[4m-2]
+ */
+
+ if (m < MULMID_TOOM42_THRESHOLD)
+ {
+ /* A + B */
+ mpn_mulmid_basecase (p0, s, 2*m - 1, bp + m, m);
+ /* accumulate high limbs of p0 into e1 */
+ ADDC_LIMB (cy, e1l, e1l, p0[m]);
+ e1h += p0[m + 1] + cy;
+ /* (-1)^neg * (B - C) (overwrites first m limbs of s) */
+ mpn_mulmid_basecase (p1, ap + m, 2*m - 1, t, m);
+ /* C + D (overwrites t) */
+ mpn_mulmid_basecase (p2, s + m, 2*m - 1, bp, m);
+ }
+ else
+ {
+ /* as above, but use toom42 instead */
+ mpn_toom42_mulmid (p0, s, bp + m, m, next_scratch);
+ ADDC_LIMB (cy, e1l, e1l, p0[m]);
+ e1h += p0[m + 1] + cy;
+ mpn_toom42_mulmid (p1, ap + m, t, m, next_scratch);
+ mpn_toom42_mulmid (p2, s + m, bp, m, next_scratch);
+ }
+
+ /* apply error terms */
+
+ /* -e0 at rp[0] */
+ SUBC_LIMB (cy, rp[0], rp[0], e0l);
+ SUBC_LIMB (cy, rp[1], rp[1], e0h + cy);
+ if (UNLIKELY (cy))
+ {
+ cy = (m > 2) ? mpn_sub_1 (rp + 2, rp + 2, m - 2, 1) : 1;
+ SUBC_LIMB (cy, e1l, e1l, cy);
+ e1h -= cy;
+ }
+
+ /* z = e1 - e2 + high(p0) */
+ SUBC_LIMB (cy, zl, e1l, e2l);
+ zh = e1h - e2h - cy;
+
+ /* z at rp[m] */
+ ADDC_LIMB (cy, rp[m], rp[m], zl);
+ zh = (zh + cy) & GMP_NUMB_MASK;
+ ADDC_LIMB (cy, rp[m + 1], rp[m + 1], zh);
+ cy -= (zh >> (GMP_NUMB_BITS - 1));
+ if (UNLIKELY (cy))
+ {
+ if (cy == 1)
+ mpn_add_1 (rp + m + 2, rp + m + 2, m, 1);
+ else /* cy == -1 */
+ mpn_sub_1 (rp + m + 2, rp + m + 2, m, 1);
+ }
+
+ /* e3 at rp[2*m] */
+ ADDC_LIMB (cy, rp[2*m], rp[2*m], e3l);
+ rp[2*m + 1] = (rp[2*m + 1] + e3h + cy) & GMP_NUMB_MASK;
+
+ /* e4 at p1[0] */
+ ADDC_LIMB (cy, p1[0], p1[0], e4l);
+ ADDC_LIMB (cy, p1[1], p1[1], e4h + cy);
+ if (UNLIKELY (cy))
+ mpn_add_1 (p1 + 2, p1 + 2, m, 1);
+
+ /* -e5 at p1[m] */
+ SUBC_LIMB (cy, p1[m], p1[m], e5l);
+ p1[m + 1] = (p1[m + 1] - e5h - cy) & GMP_NUMB_MASK;
+
+ /* adjustment if p1 ends up negative */
+ cy = (p1[m + 1] >> (GMP_NUMB_BITS - 1));
+
+ /* add (-1)^neg * (p1 - B^m * p1) to output */
+ if (neg)
+ {
+ mpn_sub_1 (rp + m + 2, rp + m + 2, m, cy);
+ mpn_add (rp, rp, 2*m + 2, p1, m + 2); /* A + C */
+ mpn_sub_n (rp + m, rp + m, p1, m + 2); /* B + D */
+ }
+ else
+ {
+ mpn_add_1 (rp + m + 2, rp + m + 2, m, cy);
+ mpn_sub (rp, rp, 2*m + 2, p1, m + 2); /* A + C */
+ mpn_add_n (rp + m, rp + m, p1, m + 2); /* B + D */
+ }
+
+ /* odd row and diagonal */
+ if (n & 1)
+ {
+ /*
+ Products marked E are already done. We need to do products marked O.
+
+ OOOOO----
+ -EEEEO---
+ --EEEEO--
+ ---EEEEO-
+ ----EEEEO
+ */
+
+ /* first row of O's */
+ cy = mpn_addmul_1 (rp, ap - 1, n, bp[n - 1]);
+ ADDC_LIMB (rp[n + 1], rp[n], rp[n], cy);
+
+ /* O's on diagonal */
+ /* FIXME: should probably define an interface "mpn_mulmid_diag_1"
+ that can handle the sum below. Currently we're relying on
+ mulmid_basecase being pretty fast for a diagonal sum like this,
+ which is true at least for the K8 asm version, but surely false
+ for the generic version. */
+ mpn_mulmid_basecase (e, ap + n - 1, n - 1, bp, n - 1);
+ mpn_add_n (rp + n - 1, rp + n - 1, e, 3);
+ }
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/toom43_mul.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/toom43_mul.c
new file mode 100644
index 00000000000..59d45576b8b
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/toom43_mul.c
@@ -0,0 +1,234 @@
+/* mpn_toom43_mul -- Multiply {ap,an} and {bp,bn} where an is nominally 4/3
+ times as large as bn. Or more accurately, bn < an < 2 bn.
+
+ Contributed to the GNU project by Marco Bodrato.
+
+ The idea of applying toom to unbalanced multiplication is due to Marco
+ Bodrato and Alberto Zanoni.
+
+ THE FUNCTION IN THIS FILE IS INTERNAL WITH A MUTABLE INTERFACE. IT IS ONLY
+ 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 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.h"
+#include "gmp-impl.h"
+
+/* Evaluate in: -2, -1, 0, +1, +2, +inf
+
+ <-s-><--n--><--n--><--n-->
+ ___ ______ ______ ______
+ |a3_|___a2_|___a1_|___a0_|
+ |_b2_|___b1_|___b0_|
+ <-t--><--n--><--n-->
+
+ v0 = a0 * b0 # A(0)*B(0)
+ v1 = (a0+ a1+ a2+ a3)*(b0+ b1+ b2) # A(1)*B(1) ah <= 3 bh <= 2
+ vm1 = (a0- a1+ a2- a3)*(b0- b1+ b2) # A(-1)*B(-1) |ah| <= 1 |bh|<= 1
+ v2 = (a0+2a1+4a2+8a3)*(b0+2b1+4b2) # A(2)*B(2) ah <= 14 bh <= 6
+ vm2 = (a0-2a1+4a2-8a3)*(b0-2b1+4b2) # A(-2)*B(-2) |ah| <= 9 |bh|<= 4
+ vinf= a3 * b2 # A(inf)*B(inf)
+*/
+
+void
+mpn_toom43_mul (mp_ptr pp,
+ mp_srcptr ap, mp_size_t an,
+ mp_srcptr bp, mp_size_t bn, mp_ptr scratch)
+{
+ mp_size_t n, s, t;
+ enum toom6_flags flags;
+ mp_limb_t cy;
+
+#define a0 ap
+#define a1 (ap + n)
+#define a2 (ap + 2 * n)
+#define a3 (ap + 3 * n)
+#define b0 bp
+#define b1 (bp + n)
+#define b2 (bp + 2 * n)
+
+ n = 1 + (3 * an >= 4 * bn ? (an - 1) >> 2 : (bn - 1) / (size_t) 3);
+
+ s = an - 3 * n;
+ t = bn - 2 * n;
+
+ ASSERT (0 < s && s <= n);
+ ASSERT (0 < t && t <= n);
+
+ /* This is true whenever an >= 25 or bn >= 19, I think. It
+ guarantees that we can fit 5 values of size n+1 in the product
+ area. */
+ ASSERT (s+t >= 5);
+
+#define v0 pp /* 2n */
+#define vm1 (scratch) /* 2n+1 */
+#define v1 (pp + 2*n) /* 2n+1 */
+#define vm2 (scratch + 2 * n + 1) /* 2n+1 */
+#define v2 (scratch + 4 * n + 2) /* 2n+1 */
+#define vinf (pp + 5 * n) /* s+t */
+#define bs1 pp /* n+1 */
+#define bsm1 (scratch + 2 * n + 2) /* n+1 */
+#define asm1 (scratch + 3 * n + 3) /* n+1 */
+#define asm2 (scratch + 4 * n + 4) /* n+1 */
+#define bsm2 (pp + n + 1) /* n+1 */
+#define bs2 (pp + 2 * n + 2) /* n+1 */
+#define as2 (pp + 3 * n + 3) /* n+1 */
+#define as1 (pp + 4 * n + 4) /* n+1 */
+
+ /* Total sccratch need is 6 * n + 3 + 1; we allocate one extra
+ limb, because products will overwrite 2n+2 limbs. */
+
+#define a0a2 scratch
+#define b0b2 scratch
+#define a1a3 asm1
+#define b1d bsm1
+
+ /* Compute as2 and asm2. */
+ flags = (enum toom6_flags) (toom6_vm2_neg & mpn_toom_eval_dgr3_pm2 (as2, asm2, ap, n, s, a1a3));
+
+ /* Compute bs2 and bsm2. */
+ b1d[n] = mpn_lshift (b1d, b1, n, 1); /* 2b1 */
+ cy = mpn_lshift (b0b2, b2, t, 2); /* 4b2 */
+ cy += mpn_add_n (b0b2, b0b2, b0, t); /* 4b2 + b0 */
+ if (t != n)
+ cy = mpn_add_1 (b0b2 + t, b0 + t, n - t, cy);
+ b0b2[n] = cy;
+
+#if HAVE_NATIVE_mpn_add_n_sub_n
+ if (mpn_cmp (b0b2, b1d, n+1) < 0)
+ {
+ mpn_add_n_sub_n (bs2, bsm2, b1d, b0b2, n+1);
+ flags = (enum toom6_flags) (flags ^ toom6_vm2_neg);
+ }
+ else
+ {
+ mpn_add_n_sub_n (bs2, bsm2, b0b2, b1d, n+1);
+ }
+#else
+ mpn_add_n (bs2, b0b2, b1d, n+1);
+ if (mpn_cmp (b0b2, b1d, n+1) < 0)
+ {
+ mpn_sub_n (bsm2, b1d, b0b2, n+1);
+ flags = (enum toom6_flags) (flags ^ toom6_vm2_neg);
+ }
+ else
+ {
+ mpn_sub_n (bsm2, b0b2, b1d, n+1);
+ }
+#endif
+
+ /* Compute as1 and asm1. */
+ flags = (enum toom6_flags) (flags ^ toom6_vm1_neg & mpn_toom_eval_dgr3_pm1 (as1, asm1, ap, n, s, a0a2));
+
+ /* Compute bs1 and bsm1. */
+ bsm1[n] = mpn_add (bsm1, b0, n, b2, t);
+#if HAVE_NATIVE_mpn_add_n_sub_n
+ if (bsm1[n] == 0 && mpn_cmp (bsm1, b1, n) < 0)
+ {
+ cy = mpn_add_n_sub_n (bs1, bsm1, b1, bsm1, n);
+ bs1[n] = cy >> 1;
+ flags = (enum toom6_flags) (flags ^ toom6_vm1_neg);
+ }
+ else
+ {
+ cy = mpn_add_n_sub_n (bs1, bsm1, bsm1, b1, n);
+ bs1[n] = bsm1[n] + (cy >> 1);
+ bsm1[n]-= cy & 1;
+ }
+#else
+ bs1[n] = bsm1[n] + mpn_add_n (bs1, bsm1, b1, n);
+ if (bsm1[n] == 0 && mpn_cmp (bsm1, b1, n) < 0)
+ {
+ mpn_sub_n (bsm1, b1, bsm1, n);
+ flags = (enum toom6_flags) (flags ^ toom6_vm1_neg);
+ }
+ else
+ {
+ bsm1[n] -= mpn_sub_n (bsm1, bsm1, b1, n);
+ }
+#endif
+
+ ASSERT (as1[n] <= 3);
+ ASSERT (bs1[n] <= 2);
+ ASSERT (asm1[n] <= 1);
+ ASSERT (bsm1[n] <= 1);
+ ASSERT (as2[n] <=14);
+ ASSERT (bs2[n] <= 6);
+ ASSERT (asm2[n] <= 9);
+ ASSERT (bsm2[n] <= 4);
+
+ /* vm1, 2n+1 limbs */
+ mpn_mul_n (vm1, asm1, bsm1, n+1); /* W4 */
+
+ /* vm2, 2n+1 limbs */
+ mpn_mul_n (vm2, asm2, bsm2, n+1); /* W2 */
+
+ /* v2, 2n+1 limbs */
+ mpn_mul_n (v2, as2, bs2, n+1); /* W1 */
+
+ /* v1, 2n+1 limbs */
+ mpn_mul_n (v1, as1, bs1, n+1); /* W3 */
+
+ /* vinf, s+t limbs */ /* W0 */
+ if (s > t) mpn_mul (vinf, a3, s, b2, t);
+ else mpn_mul (vinf, b2, t, a3, s);
+
+ /* v0, 2n limbs */
+ mpn_mul_n (v0, ap, bp, n); /* W5 */
+
+ mpn_toom_interpolate_6pts (pp, n, flags, vm1, vm2, v2, t + s);
+
+#undef v0
+#undef vm1
+#undef v1
+#undef vm2
+#undef v2
+#undef vinf
+#undef bs1
+#undef bs2
+#undef bsm1
+#undef bsm2
+#undef asm1
+#undef asm2
+/* #undef as1 */
+/* #undef as2 */
+#undef a0a2
+#undef b0b2
+#undef a1a3
+#undef b1d
+#undef a0
+#undef a1
+#undef a2
+#undef a3
+#undef b0
+#undef b1
+#undef b2
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/toom44_mul.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/toom44_mul.c
new file mode 100644
index 00000000000..5abf2d14a99
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/toom44_mul.c
@@ -0,0 +1,236 @@
+/* mpn_toom44_mul -- Multiply {ap,an} and {bp,bn} where an and bn are close in
+ size. Or more accurately, bn <= an < (4/3)bn.
+
+ Contributed to the GNU project by Torbjorn Granlund and Marco Bodrato.
+
+ THE FUNCTION IN THIS FILE IS INTERNAL WITH A MUTABLE INTERFACE. IT IS ONLY
+ 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, 2013 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.h"
+#include "gmp-impl.h"
+
+/* Evaluate in: 0, +1, -1, +2, -2, 1/2, +inf
+
+ <-s--><--n--><--n--><--n-->
+ ____ ______ ______ ______
+ |_a3_|___a2_|___a1_|___a0_|
+ |b3_|___b2_|___b1_|___b0_|
+ <-t-><--n--><--n--><--n-->
+
+ v0 = a0 * b0 # A(0)*B(0)
+ v1 = ( a0+ a1+ a2+ a3)*( b0+ b1+ b2+ b3) # A(1)*B(1) ah <= 3 bh <= 3
+ vm1 = ( a0- a1+ a2- a3)*( b0- b1+ b2- b3) # A(-1)*B(-1) |ah| <= 1 |bh| <= 1
+ v2 = ( a0+2a1+4a2+8a3)*( b0+2b1+4b2+8b3) # A(2)*B(2) ah <= 14 bh <= 14
+ vm2 = ( a0-2a1+4a2-8a3)*( b0-2b1+4b2-8b3) # A(2)*B(2) ah <= 9 |bh| <= 9
+ vh = (8a0+4a1+2a2+ a3)*(8b0+4b1+2b2+ b3) # A(1/2)*B(1/2) ah <= 14 bh <= 14
+ vinf= a3 * b2 # A(inf)*B(inf)
+*/
+
+#if TUNE_PROGRAM_BUILD
+#define MAYBE_mul_basecase 1
+#define MAYBE_mul_toom22 1
+#define MAYBE_mul_toom44 1
+#else
+#define MAYBE_mul_basecase \
+ (MUL_TOOM44_THRESHOLD < 4 * MUL_TOOM22_THRESHOLD)
+#define MAYBE_mul_toom22 \
+ (MUL_TOOM44_THRESHOLD < 4 * MUL_TOOM33_THRESHOLD)
+#define MAYBE_mul_toom44 \
+ (MUL_TOOM6H_THRESHOLD >= 4 * MUL_TOOM44_THRESHOLD)
+#endif
+
+#define TOOM44_MUL_N_REC(p, a, b, n, ws) \
+ do { \
+ if (MAYBE_mul_basecase \
+ && BELOW_THRESHOLD (n, MUL_TOOM22_THRESHOLD)) \
+ mpn_mul_basecase (p, a, n, b, n); \
+ else if (MAYBE_mul_toom22 \
+ && BELOW_THRESHOLD (n, MUL_TOOM33_THRESHOLD)) \
+ mpn_toom22_mul (p, a, n, b, n, ws); \
+ else if (! MAYBE_mul_toom44 \
+ || BELOW_THRESHOLD (n, MUL_TOOM44_THRESHOLD)) \
+ mpn_toom33_mul (p, a, n, b, n, ws); \
+ else \
+ mpn_toom44_mul (p, a, n, b, n, ws); \
+ } while (0)
+
+/* Use of scratch space. In the product area, we store
+
+ ___________________
+ |vinf|____|_v1_|_v0_|
+ s+t 2n-1 2n+1 2n
+
+ The other recursive products, vm1, v2, vm2, vh are stored in the
+ scratch area. When computing them, we use the product area for
+ intermediate values.
+
+ Next, we compute v1. We can store the intermediate factors at v0
+ and at vh + 2n + 2.
+
+ Finally, for v0 and vinf, factors are parts of the input operands,
+ and we need scratch space only for the recursive multiplication.
+
+ In all, if S(an) is the scratch need, the needed space is bounded by
+
+ S(an) <= 4 (2*ceil(an/4) + 1) + 1 + S(ceil(an/4) + 1)
+
+ which should give S(n) = 8 n/3 + c log(n) for some constant c.
+*/
+
+void
+mpn_toom44_mul (mp_ptr pp,
+ mp_srcptr ap, mp_size_t an,
+ mp_srcptr bp, mp_size_t bn,
+ mp_ptr scratch)
+{
+ mp_size_t n, s, t;
+ mp_limb_t cy;
+ enum toom7_flags flags;
+
+#define a0 ap
+#define a1 (ap + n)
+#define a2 (ap + 2*n)
+#define a3 (ap + 3*n)
+#define b0 bp
+#define b1 (bp + n)
+#define b2 (bp + 2*n)
+#define b3 (bp + 3*n)
+
+ ASSERT (an >= bn);
+
+ n = (an + 3) >> 2;
+
+ s = an - 3 * n;
+ t = bn - 3 * n;
+
+ ASSERT (0 < s && s <= n);
+ ASSERT (0 < t && t <= n);
+ ASSERT (s >= t);
+
+ /* NOTE: The multiplications to v2, vm2, vh and vm1 overwrites the
+ * following limb, so these must be computed in order, and we need a
+ * one limb gap to tp. */
+#define v0 pp /* 2n */
+#define v1 (pp + 2 * n) /* 2n+1 */
+#define vinf (pp + 6 * n) /* s+t */
+#define v2 scratch /* 2n+1 */
+#define vm2 (scratch + 2 * n + 1) /* 2n+1 */
+#define vh (scratch + 4 * n + 2) /* 2n+1 */
+#define vm1 (scratch + 6 * n + 3) /* 2n+1 */
+#define tp (scratch + 8*n + 5)
+
+ /* apx and bpx must not overlap with v1 */
+#define apx pp /* n+1 */
+#define amx (pp + n + 1) /* n+1 */
+#define bmx (pp + 2*n + 2) /* n+1 */
+#define bpx (pp + 4*n + 2) /* n+1 */
+
+ /* Total scratch need: 8*n + 5 + scratch for recursive calls. This
+ gives roughly 32 n/3 + log term. */
+
+ /* Compute apx = a0 + 2 a1 + 4 a2 + 8 a3 and amx = a0 - 2 a1 + 4 a2 - 8 a3. */
+ flags = (enum toom7_flags) (toom7_w1_neg & mpn_toom_eval_dgr3_pm2 (apx, amx, ap, n, s, tp));
+
+ /* Compute bpx = b0 + 2 b1 + 4 b2 + 8 b3 and bmx = b0 - 2 b1 + 4 b2 - 8 b3. */
+ flags = (enum toom7_flags) (flags ^ toom7_w1_neg & mpn_toom_eval_dgr3_pm2 (bpx, bmx, bp, n, t, tp));
+
+ TOOM44_MUL_N_REC (v2, apx, bpx, n + 1, tp); /* v2, 2n+1 limbs */
+ TOOM44_MUL_N_REC (vm2, amx, bmx, n + 1, tp); /* vm2, 2n+1 limbs */
+
+ /* Compute apx = 8 a0 + 4 a1 + 2 a2 + a3 = (((2*a0 + a1) * 2 + a2) * 2 + a3 */
+#if HAVE_NATIVE_mpn_addlsh1_n
+ cy = mpn_addlsh1_n (apx, a1, a0, n);
+ cy = 2*cy + mpn_addlsh1_n (apx, a2, apx, n);
+ if (s < n)
+ {
+ mp_limb_t cy2;
+ cy2 = mpn_addlsh1_n (apx, a3, apx, s);
+ apx[n] = 2*cy + mpn_lshift (apx + s, apx + s, n - s, 1);
+ MPN_INCR_U (apx + s, n+1-s, cy2);
+ }
+ else
+ apx[n] = 2*cy + mpn_addlsh1_n (apx, a3, apx, n);
+#else
+ cy = mpn_lshift (apx, a0, n, 1);
+ cy += mpn_add_n (apx, apx, a1, n);
+ cy = 2*cy + mpn_lshift (apx, apx, n, 1);
+ cy += mpn_add_n (apx, apx, a2, n);
+ cy = 2*cy + mpn_lshift (apx, apx, n, 1);
+ apx[n] = cy + mpn_add (apx, apx, n, a3, s);
+#endif
+
+ /* Compute bpx = 8 b0 + 4 b1 + 2 b2 + b3 = (((2*b0 + b1) * 2 + b2) * 2 + b3 */
+#if HAVE_NATIVE_mpn_addlsh1_n
+ cy = mpn_addlsh1_n (bpx, b1, b0, n);
+ cy = 2*cy + mpn_addlsh1_n (bpx, b2, bpx, n);
+ if (t < n)
+ {
+ mp_limb_t cy2;
+ cy2 = mpn_addlsh1_n (bpx, b3, bpx, t);
+ bpx[n] = 2*cy + mpn_lshift (bpx + t, bpx + t, n - t, 1);
+ MPN_INCR_U (bpx + t, n+1-t, cy2);
+ }
+ else
+ bpx[n] = 2*cy + mpn_addlsh1_n (bpx, b3, bpx, n);
+#else
+ cy = mpn_lshift (bpx, b0, n, 1);
+ cy += mpn_add_n (bpx, bpx, b1, n);
+ cy = 2*cy + mpn_lshift (bpx, bpx, n, 1);
+ cy += mpn_add_n (bpx, bpx, b2, n);
+ cy = 2*cy + mpn_lshift (bpx, bpx, n, 1);
+ bpx[n] = cy + mpn_add (bpx, bpx, n, b3, t);
+#endif
+
+ ASSERT (apx[n] < 15);
+ ASSERT (bpx[n] < 15);
+
+ TOOM44_MUL_N_REC (vh, apx, bpx, n + 1, tp); /* vh, 2n+1 limbs */
+
+ /* Compute apx = a0 + a1 + a2 + a3 and amx = a0 - a1 + a2 - a3. */
+ flags = (enum toom7_flags) (flags | toom7_w3_neg & mpn_toom_eval_dgr3_pm1 (apx, amx, ap, n, s, tp));
+
+ /* Compute bpx = b0 + b1 + b2 + b3 bnd bmx = b0 - b1 + b2 - b3. */
+ flags = (enum toom7_flags) (flags ^ toom7_w3_neg & mpn_toom_eval_dgr3_pm1 (bpx, bmx, bp, n, t, tp));
+
+ TOOM44_MUL_N_REC (vm1, amx, bmx, n + 1, tp); /* vm1, 2n+1 limbs */
+ /* Clobbers amx, bmx. */
+ TOOM44_MUL_N_REC (v1, apx, bpx, n + 1, tp); /* v1, 2n+1 limbs */
+
+ TOOM44_MUL_N_REC (v0, a0, b0, n, tp);
+ if (s > t)
+ mpn_mul (vinf, a3, s, b3, t);
+ else
+ TOOM44_MUL_N_REC (vinf, a3, b3, s, tp); /* vinf, s+t limbs */
+
+ mpn_toom_interpolate_7pts (pp, n, flags, vm2, vm1, v2, vh, s + t, tp);
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/toom4_sqr.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/toom4_sqr.c
new file mode 100644
index 00000000000..b4154ba83fb
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/toom4_sqr.c
@@ -0,0 +1,164 @@
+/* mpn_toom4_sqr -- Square {ap,an}.
+
+ Contributed to the GNU project by Torbjorn Granlund and Marco Bodrato.
+
+ THE FUNCTION IN THIS FILE IS INTERNAL WITH A MUTABLE INTERFACE. IT IS ONLY
+ 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, 2013 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.h"
+#include "gmp-impl.h"
+
+/* Evaluate in: -1, -1/2, 0, +1/2, +1, +2, +inf
+
+ <-s--><--n--><--n--><--n-->
+ ____ ______ ______ ______
+ |_a3_|___a2_|___a1_|___a0_|
+
+ v0 = a0 ^2 # A(0)^2
+ v1 = ( a0+ a1+ a2+ a3)^2 # A(1)^2 ah <= 3
+ vm1 = ( a0- a1+ a2- a3)^2 # A(-1)^2 |ah| <= 1
+ v2 = ( a0+2a1+4a2+8a3)^2 # A(2)^2 ah <= 14
+ vh = (8a0+4a1+2a2+ a3)^2 # A(1/2)^2 ah <= 14
+ vmh = (8a0-4a1+2a2- a3)^2 # A(-1/2)^2 -4<=ah<=9
+ vinf= a3 ^2 # A(inf)^2
+*/
+
+#if TUNE_PROGRAM_BUILD
+#define MAYBE_sqr_basecase 1
+#define MAYBE_sqr_toom2 1
+#define MAYBE_sqr_toom4 1
+#else
+#define MAYBE_sqr_basecase \
+ (SQR_TOOM4_THRESHOLD < 4 * SQR_TOOM2_THRESHOLD)
+#define MAYBE_sqr_toom2 \
+ (SQR_TOOM4_THRESHOLD < 4 * SQR_TOOM3_THRESHOLD)
+#define MAYBE_sqr_toom4 \
+ (SQR_TOOM6_THRESHOLD >= 4 * SQR_TOOM4_THRESHOLD)
+#endif
+
+#define TOOM4_SQR_REC(p, a, n, ws) \
+ do { \
+ if (MAYBE_sqr_basecase \
+ && BELOW_THRESHOLD (n, SQR_TOOM2_THRESHOLD)) \
+ mpn_sqr_basecase (p, a, n); \
+ else if (MAYBE_sqr_toom2 \
+ && BELOW_THRESHOLD (n, SQR_TOOM3_THRESHOLD)) \
+ mpn_toom2_sqr (p, a, n, ws); \
+ else if (! MAYBE_sqr_toom4 \
+ || BELOW_THRESHOLD (n, SQR_TOOM4_THRESHOLD)) \
+ mpn_toom3_sqr (p, a, n, ws); \
+ else \
+ mpn_toom4_sqr (p, a, n, ws); \
+ } while (0)
+
+void
+mpn_toom4_sqr (mp_ptr pp,
+ mp_srcptr ap, mp_size_t an,
+ mp_ptr scratch)
+{
+ mp_size_t n, s;
+ mp_limb_t cy;
+
+#define a0 ap
+#define a1 (ap + n)
+#define a2 (ap + 2*n)
+#define a3 (ap + 3*n)
+
+ n = (an + 3) >> 2;
+
+ s = an - 3 * n;
+
+ ASSERT (0 < s && s <= n);
+
+ /* NOTE: The multiplications to v2, vm2, vh and vm1 overwrites the
+ * following limb, so these must be computed in order, and we need a
+ * one limb gap to tp. */
+#define v0 pp /* 2n */
+#define v1 (pp + 2 * n) /* 2n+1 */
+#define vinf (pp + 6 * n) /* s+t */
+#define v2 scratch /* 2n+1 */
+#define vm2 (scratch + 2 * n + 1) /* 2n+1 */
+#define vh (scratch + 4 * n + 2) /* 2n+1 */
+#define vm1 (scratch + 6 * n + 3) /* 2n+1 */
+#define tp (scratch + 8*n + 5)
+
+ /* No overlap with v1 */
+#define apx pp /* n+1 */
+#define amx (pp + 4*n + 2) /* n+1 */
+
+ /* Total scratch need: 8*n + 5 + scratch for recursive calls. This
+ gives roughly 32 n/3 + log term. */
+
+ /* Compute apx = a0 + 2 a1 + 4 a2 + 8 a3 and amx = a0 - 2 a1 + 4 a2 - 8 a3. */
+ mpn_toom_eval_dgr3_pm2 (apx, amx, ap, n, s, tp);
+
+ TOOM4_SQR_REC (v2, apx, n + 1, tp); /* v2, 2n+1 limbs */
+ TOOM4_SQR_REC (vm2, amx, n + 1, tp); /* vm2, 2n+1 limbs */
+
+ /* Compute apx = 8 a0 + 4 a1 + 2 a2 + a3 = (((2*a0 + a1) * 2 + a2) * 2 + a3 */
+#if HAVE_NATIVE_mpn_addlsh1_n
+ cy = mpn_addlsh1_n (apx, a1, a0, n);
+ cy = 2*cy + mpn_addlsh1_n (apx, a2, apx, n);
+ if (s < n)
+ {
+ mp_limb_t cy2;
+ cy2 = mpn_addlsh1_n (apx, a3, apx, s);
+ apx[n] = 2*cy + mpn_lshift (apx + s, apx + s, n - s, 1);
+ MPN_INCR_U (apx + s, n+1-s, cy2);
+ }
+ else
+ apx[n] = 2*cy + mpn_addlsh1_n (apx, a3, apx, n);
+#else
+ cy = mpn_lshift (apx, a0, n, 1);
+ cy += mpn_add_n (apx, apx, a1, n);
+ cy = 2*cy + mpn_lshift (apx, apx, n, 1);
+ cy += mpn_add_n (apx, apx, a2, n);
+ cy = 2*cy + mpn_lshift (apx, apx, n, 1);
+ apx[n] = cy + mpn_add (apx, apx, n, a3, s);
+#endif
+
+ ASSERT (apx[n] < 15);
+
+ TOOM4_SQR_REC (vh, apx, n + 1, tp); /* vh, 2n+1 limbs */
+
+ /* Compute apx = a0 + a1 + a2 + a3 and amx = a0 - a1 + a2 - a3. */
+ mpn_toom_eval_dgr3_pm1 (apx, amx, ap, n, s, tp);
+
+ TOOM4_SQR_REC (v1, apx, n + 1, tp); /* v1, 2n+1 limbs */
+ TOOM4_SQR_REC (vm1, amx, n + 1, tp); /* vm1, 2n+1 limbs */
+
+ TOOM4_SQR_REC (v0, a0, n, tp);
+ TOOM4_SQR_REC (vinf, a3, s, tp); /* vinf, 2s limbs */
+
+ mpn_toom_interpolate_7pts (pp, n, (enum toom7_flags) 0, vm2, vm1, v2, vh, 2*s, tp);
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/toom52_mul.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/toom52_mul.c
new file mode 100644
index 00000000000..e15b5833aa0
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/toom52_mul.c
@@ -0,0 +1,257 @@
+/* mpn_toom52_mul -- Multiply {ap,an} and {bp,bn} where an is nominally 4/3
+ times as large as bn. Or more accurately, bn < an < 2 bn.
+
+ Contributed to the GNU project by Marco Bodrato.
+
+ The idea of applying toom to unbalanced multiplication is due to Marco
+ Bodrato and Alberto Zanoni.
+
+ THE FUNCTION IN THIS FILE IS INTERNAL WITH A MUTABLE INTERFACE. IT IS ONLY
+ 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 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.h"
+#include "gmp-impl.h"
+
+/* Evaluate in: -2, -1, 0, +1, +2, +inf
+
+ <-s-><--n--><--n--><--n--><--n-->
+ ___ ______ ______ ______ ______
+ |a4_|___a3_|___a2_|___a1_|___a0_|
+ |b1|___b0_|
+ <t-><--n-->
+
+ v0 = a0 * b0 # A(0)*B(0)
+ v1 = (a0+ a1+ a2+ a3+ a4)*(b0+ b1) # A(1)*B(1) ah <= 4 bh <= 1
+ vm1 = (a0- a1+ a2- a3+ a4)*(b0- b1) # A(-1)*B(-1) |ah| <= 2 bh = 0
+ v2 = (a0+2a1+4a2+8a3+16a4)*(b0+2b1) # A(2)*B(2) ah <= 30 bh <= 2
+ vm2 = (a0-2a1+4a2-8a3+16a4)*(b0-2b1) # A(-2)*B(-2) |ah| <= 20 |bh|<= 1
+ vinf= a4 * b1 # A(inf)*B(inf)
+
+ Some slight optimization in evaluation are taken from the paper:
+ "Towards Optimal Toom-Cook Multiplication for Univariate and
+ Multivariate Polynomials in Characteristic 2 and 0."
+*/
+
+void
+mpn_toom52_mul (mp_ptr pp,
+ mp_srcptr ap, mp_size_t an,
+ mp_srcptr bp, mp_size_t bn, mp_ptr scratch)
+{
+ mp_size_t n, s, t;
+ enum toom6_flags flags;
+
+#define a0 ap
+#define a1 (ap + n)
+#define a2 (ap + 2 * n)
+#define a3 (ap + 3 * n)
+#define a4 (ap + 4 * n)
+#define b0 bp
+#define b1 (bp + n)
+
+ n = 1 + (2 * an >= 5 * bn ? (an - 1) / (size_t) 5 : (bn - 1) >> 1);
+
+ s = an - 4 * n;
+ t = bn - n;
+
+ ASSERT (0 < s && s <= n);
+ ASSERT (0 < t && t <= n);
+
+ /* Ensures that 5 values of n+1 limbs each fits in the product area.
+ Borderline cases are an = 32, bn = 8, n = 7, and an = 36, bn = 9,
+ n = 8. */
+ ASSERT (s+t >= 5);
+
+#define v0 pp /* 2n */
+#define vm1 (scratch) /* 2n+1 */
+#define v1 (pp + 2 * n) /* 2n+1 */
+#define vm2 (scratch + 2 * n + 1) /* 2n+1 */
+#define v2 (scratch + 4 * n + 2) /* 2n+1 */
+#define vinf (pp + 5 * n) /* s+t */
+#define bs1 pp /* n+1 */
+#define bsm1 (scratch + 2 * n + 2) /* n */
+#define asm1 (scratch + 3 * n + 3) /* n+1 */
+#define asm2 (scratch + 4 * n + 4) /* n+1 */
+#define bsm2 (pp + n + 1) /* n+1 */
+#define bs2 (pp + 2 * n + 2) /* n+1 */
+#define as2 (pp + 3 * n + 3) /* n+1 */
+#define as1 (pp + 4 * n + 4) /* n+1 */
+
+ /* Scratch need is 6 * n + 3 + 1. We need one extra limb, because
+ products will overwrite 2n+2 limbs. */
+
+#define a0a2 scratch
+#define a1a3 asm1
+
+ /* Compute as2 and asm2. */
+ flags = (enum toom6_flags) (toom6_vm2_neg & mpn_toom_eval_pm2 (as2, asm2, 4, ap, n, s, a1a3));
+
+ /* Compute bs1 and bsm1. */
+ if (t == n)
+ {
+#if HAVE_NATIVE_mpn_add_n_sub_n
+ mp_limb_t cy;
+
+ if (mpn_cmp (b0, b1, n) < 0)
+ {
+ cy = mpn_add_n_sub_n (bs1, bsm1, b1, b0, n);
+ flags = (enum toom6_flags) (flags ^ toom6_vm1_neg);
+ }
+ else
+ {
+ cy = mpn_add_n_sub_n (bs1, bsm1, b0, b1, n);
+ }
+ bs1[n] = cy >> 1;
+#else
+ bs1[n] = mpn_add_n (bs1, b0, b1, n);
+ if (mpn_cmp (b0, b1, n) < 0)
+ {
+ mpn_sub_n (bsm1, b1, b0, n);
+ flags = (enum toom6_flags) (flags ^ toom6_vm1_neg);
+ }
+ else
+ {
+ mpn_sub_n (bsm1, b0, b1, n);
+ }
+#endif
+ }
+ else
+ {
+ bs1[n] = mpn_add (bs1, b0, n, b1, t);
+ if (mpn_zero_p (b0 + t, n - t) && mpn_cmp (b0, b1, t) < 0)
+ {
+ mpn_sub_n (bsm1, b1, b0, t);
+ MPN_ZERO (bsm1 + t, n - t);
+ flags = (enum toom6_flags) (flags ^ toom6_vm1_neg);
+ }
+ else
+ {
+ mpn_sub (bsm1, b0, n, b1, t);
+ }
+ }
+
+ /* 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 )
+ {
+ bsm2[n] = mpn_add (bsm2, bsm1, n, b1, t);
+ flags = (enum toom6_flags) (flags ^ toom6_vm2_neg);
+ }
+ else
+ {
+ bsm2[n] = 0;
+ if (t == n)
+ {
+ if (mpn_cmp (bsm1, b1, n) < 0)
+ {
+ mpn_sub_n (bsm2, b1, bsm1, n);
+ flags = (enum toom6_flags) (flags ^ toom6_vm2_neg);
+ }
+ else
+ {
+ mpn_sub_n (bsm2, bsm1, b1, n);
+ }
+ }
+ else
+ {
+ if (mpn_zero_p (bsm1 + t, n - t) && mpn_cmp (bsm1, b1, t) < 0)
+ {
+ mpn_sub_n (bsm2, b1, bsm1, t);
+ MPN_ZERO (bsm2 + t, n - t);
+ flags = (enum toom6_flags) (flags ^ toom6_vm2_neg);
+ }
+ else
+ {
+ mpn_sub (bsm2, bsm1, n, b1, t);
+ }
+ }
+ }
+
+ /* Compute as1 and asm1. */
+ flags = (enum toom6_flags) (flags ^ toom6_vm1_neg & mpn_toom_eval_pm1 (as1, asm1, 4, ap, n, s, a0a2));
+
+ ASSERT (as1[n] <= 4);
+ ASSERT (bs1[n] <= 1);
+ ASSERT (asm1[n] <= 2);
+/* ASSERT (bsm1[n] <= 1); */
+ ASSERT (as2[n] <=30);
+ ASSERT (bs2[n] <= 2);
+ ASSERT (asm2[n] <= 20);
+ ASSERT (bsm2[n] <= 1);
+
+ /* vm1, 2n+1 limbs */
+ mpn_mul (vm1, asm1, n+1, bsm1, n); /* W4 */
+
+ /* vm2, 2n+1 limbs */
+ mpn_mul_n (vm2, asm2, bsm2, n+1); /* W2 */
+
+ /* v2, 2n+1 limbs */
+ mpn_mul_n (v2, as2, bs2, n+1); /* W1 */
+
+ /* v1, 2n+1 limbs */
+ mpn_mul_n (v1, as1, bs1, n+1); /* W3 */
+
+ /* vinf, s+t limbs */ /* W0 */
+ if (s > t) mpn_mul (vinf, a4, s, b1, t);
+ else mpn_mul (vinf, b1, t, a4, s);
+
+ /* v0, 2n limbs */
+ mpn_mul_n (v0, ap, bp, n); /* W5 */
+
+ mpn_toom_interpolate_6pts (pp, n, flags, vm1, vm2, v2, t + s);
+
+#undef v0
+#undef vm1
+#undef v1
+#undef vm2
+#undef v2
+#undef vinf
+#undef bs1
+#undef bs2
+#undef bsm1
+#undef bsm2
+#undef asm1
+#undef asm2
+#undef as1
+#undef as2
+#undef a0a2
+#undef b0b2
+#undef a1a3
+#undef a0
+#undef a1
+#undef a2
+#undef a3
+#undef b0
+#undef b1
+#undef b2
+
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/toom53_mul.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/toom53_mul.c
new file mode 100644
index 00000000000..41274d48e01
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/toom53_mul.c
@@ -0,0 +1,331 @@
+/* mpn_toom53_mul -- Multiply {ap,an} and {bp,bn} where an is nominally 5/3
+ times as large as bn. Or more accurately, (4/3)bn < an < (5/2)bn.
+
+ Contributed to the GNU project by Torbjorn Granlund and Marco Bodrato.
+
+ The idea of applying toom to unbalanced multiplication is due to Marco
+ Bodrato and Alberto Zanoni.
+
+ THE FUNCTION IN THIS FILE IS INTERNAL WITH A MUTABLE INTERFACE. IT IS ONLY
+ 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 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.h"
+#include "gmp-impl.h"
+
+/* Evaluate in: 0, +1, -1, +2, -2, 1/2, +inf
+
+ <-s-><--n--><--n--><--n--><--n-->
+ ___ ______ ______ ______ ______
+ |a4_|___a3_|___a2_|___a1_|___a0_|
+ |__b2|___b1_|___b0_|
+ <-t--><--n--><--n-->
+
+ v0 = a0 * b0 # A(0)*B(0)
+ v1 = ( a0+ a1+ a2+ a3+ a4)*( b0+ b1+ b2) # A(1)*B(1) ah <= 4 bh <= 2
+ vm1 = ( a0- a1+ a2- a3+ a4)*( b0- b1+ b2) # A(-1)*B(-1) |ah| <= 2 bh <= 1
+ v2 = ( a0+2a1+4a2+8a3+16a4)*( b0+2b1+4b2) # A(2)*B(2) ah <= 30 bh <= 6
+ vm2 = ( a0-2a1+4a2-8a3+16a4)*( b0-2b1+4b2) # A(2)*B(2) -9<=ah<=20 -1<=bh<=4
+ vh = (16a0+8a1+4a2+2a3+ a4)*(4b0+2b1+ b2) # A(1/2)*B(1/2) ah <= 30 bh <= 6
+ vinf= a4 * b2 # A(inf)*B(inf)
+*/
+
+void
+mpn_toom53_mul (mp_ptr pp,
+ mp_srcptr ap, mp_size_t an,
+ mp_srcptr bp, mp_size_t bn,
+ mp_ptr scratch)
+{
+ mp_size_t n, s, t;
+ mp_limb_t cy;
+ mp_ptr gp;
+ mp_ptr as1, asm1, as2, asm2, ash;
+ mp_ptr bs1, bsm1, bs2, bsm2, bsh;
+ enum toom7_flags flags;
+ TMP_DECL;
+
+#define a0 ap
+#define a1 (ap + n)
+#define a2 (ap + 2*n)
+#define a3 (ap + 3*n)
+#define a4 (ap + 4*n)
+#define b0 bp
+#define b1 (bp + n)
+#define b2 (bp + 2*n)
+
+ n = 1 + (3 * an >= 5 * bn ? (an - 1) / (size_t) 5 : (bn - 1) / (size_t) 3);
+
+ s = an - 4 * n;
+ t = bn - 2 * n;
+
+ ASSERT (0 < s && s <= n);
+ ASSERT (0 < t && t <= n);
+
+ TMP_MARK;
+
+ as1 = TMP_SALLOC_LIMBS (n + 1);
+ asm1 = TMP_SALLOC_LIMBS (n + 1);
+ as2 = TMP_SALLOC_LIMBS (n + 1);
+ asm2 = TMP_SALLOC_LIMBS (n + 1);
+ ash = TMP_SALLOC_LIMBS (n + 1);
+
+ bs1 = TMP_SALLOC_LIMBS (n + 1);
+ bsm1 = TMP_SALLOC_LIMBS (n + 1);
+ bs2 = TMP_SALLOC_LIMBS (n + 1);
+ bsm2 = TMP_SALLOC_LIMBS (n + 1);
+ bsh = TMP_SALLOC_LIMBS (n + 1);
+
+ gp = pp;
+
+ /* Compute as1 and asm1. */
+ flags = (enum toom7_flags) (toom7_w3_neg & mpn_toom_eval_pm1 (as1, asm1, 4, ap, n, s, gp));
+
+ /* Compute as2 and asm2. */
+ flags = (enum toom7_flags) (flags | toom7_w1_neg & mpn_toom_eval_pm2 (as2, asm2, 4, ap, n, s, gp));
+
+ /* Compute ash = 16 a0 + 8 a1 + 4 a2 + 2 a3 + a4
+ = 2*(2*(2*(2*a0 + a1) + a2) + a3) + a4 */
+#if HAVE_NATIVE_mpn_addlsh1_n
+ cy = mpn_addlsh1_n (ash, a1, a0, n);
+ cy = 2*cy + mpn_addlsh1_n (ash, a2, ash, n);
+ cy = 2*cy + mpn_addlsh1_n (ash, a3, ash, n);
+ if (s < n)
+ {
+ mp_limb_t cy2;
+ cy2 = mpn_addlsh1_n (ash, a4, ash, s);
+ ash[n] = 2*cy + mpn_lshift (ash + s, ash + s, n - s, 1);
+ MPN_INCR_U (ash + s, n+1-s, cy2);
+ }
+ else
+ ash[n] = 2*cy + mpn_addlsh1_n (ash, a4, ash, n);
+#else
+ cy = mpn_lshift (ash, a0, n, 1);
+ cy += mpn_add_n (ash, ash, a1, n);
+ cy = 2*cy + mpn_lshift (ash, ash, n, 1);
+ cy += mpn_add_n (ash, ash, a2, n);
+ cy = 2*cy + mpn_lshift (ash, ash, n, 1);
+ cy += mpn_add_n (ash, ash, a3, n);
+ cy = 2*cy + mpn_lshift (ash, ash, n, 1);
+ ash[n] = cy + mpn_add (ash, ash, n, a4, s);
+#endif
+
+ /* Compute bs1 and bsm1. */
+ bs1[n] = mpn_add (bs1, b0, n, b2, t); /* b0 + b2 */
+#if HAVE_NATIVE_mpn_add_n_sub_n
+ if (bs1[n] == 0 && mpn_cmp (bs1, b1, n) < 0)
+ {
+ bs1[n] = mpn_add_n_sub_n (bs1, bsm1, b1, bs1, n) >> 1;
+ bsm1[n] = 0;
+ flags = (enum toom7_flags) (flags ^ toom7_w3_neg);
+ }
+ else
+ {
+ cy = mpn_add_n_sub_n (bs1, bsm1, bs1, b1, n);
+ bsm1[n] = bs1[n] - (cy & 1);
+ bs1[n] += (cy >> 1);
+ }
+#else
+ if (bs1[n] == 0 && mpn_cmp (bs1, b1, n) < 0)
+ {
+ mpn_sub_n (bsm1, b1, bs1, n);
+ bsm1[n] = 0;
+ flags = (enum toom7_flags) (flags ^ toom7_w3_neg);
+ }
+ else
+ {
+ bsm1[n] = bs1[n] - mpn_sub_n (bsm1, bs1, b1, n);
+ }
+ bs1[n] += mpn_add_n (bs1, bs1, b1, n); /* b0+b1+b2 */
+#endif
+
+ /* Compute bs2 and bsm2. */
+#if HAVE_NATIVE_mpn_addlsh_n || HAVE_NATIVE_mpn_addlsh2_n
+#if HAVE_NATIVE_mpn_addlsh2_n
+ cy = mpn_addlsh2_n (bs2, b0, b2, t);
+#else /* HAVE_NATIVE_mpn_addlsh_n */
+ cy = mpn_addlsh_n (bs2, b0, b2, t, 2);
+#endif
+ if (t < n)
+ cy = mpn_add_1 (bs2 + t, b0 + t, n - t, cy);
+ bs2[n] = cy;
+#else
+ cy = mpn_lshift (gp, b2, t, 2);
+ bs2[n] = mpn_add (bs2, b0, n, gp, t);
+ MPN_INCR_U (bs2 + t, n+1-t, cy);
+#endif
+
+ gp[n] = mpn_lshift (gp, b1, n, 1);
+
+#if HAVE_NATIVE_mpn_add_n_sub_n
+ if (mpn_cmp (bs2, gp, n+1) < 0)
+ {
+ ASSERT_NOCARRY (mpn_add_n_sub_n (bs2, bsm2, gp, bs2, n+1));
+ flags = (enum toom7_flags) (flags ^ toom7_w1_neg);
+ }
+ else
+ {
+ ASSERT_NOCARRY (mpn_add_n_sub_n (bs2, bsm2, bs2, gp, n+1));
+ }
+#else
+ if (mpn_cmp (bs2, gp, n+1) < 0)
+ {
+ ASSERT_NOCARRY (mpn_sub_n (bsm2, gp, bs2, n+1));
+ flags = (enum toom7_flags) (flags ^ toom7_w1_neg);
+ }
+ else
+ {
+ ASSERT_NOCARRY (mpn_sub_n (bsm2, bs2, gp, n+1));
+ }
+ mpn_add_n (bs2, bs2, gp, n+1);
+#endif
+
+ /* Compute bsh = 4 b0 + 2 b1 + b2 = 2*(2*b0 + b1)+b2. */
+#if HAVE_NATIVE_mpn_addlsh1_n
+ cy = mpn_addlsh1_n (bsh, b1, b0, n);
+ if (t < n)
+ {
+ mp_limb_t cy2;
+ cy2 = mpn_addlsh1_n (bsh, b2, bsh, t);
+ bsh[n] = 2*cy + mpn_lshift (bsh + t, bsh + t, n - t, 1);
+ MPN_INCR_U (bsh + t, n+1-t, cy2);
+ }
+ else
+ bsh[n] = 2*cy + mpn_addlsh1_n (bsh, b2, bsh, n);
+#else
+ cy = mpn_lshift (bsh, b0, n, 1);
+ cy += mpn_add_n (bsh, bsh, b1, n);
+ cy = 2*cy + mpn_lshift (bsh, bsh, n, 1);
+ bsh[n] = cy + mpn_add (bsh, bsh, n, b2, t);
+#endif
+
+ ASSERT (as1[n] <= 4);
+ ASSERT (bs1[n] <= 2);
+ ASSERT (asm1[n] <= 2);
+ ASSERT (bsm1[n] <= 1);
+ ASSERT (as2[n] <= 30);
+ ASSERT (bs2[n] <= 6);
+ ASSERT (asm2[n] <= 20);
+ ASSERT (bsm2[n] <= 4);
+ ASSERT (ash[n] <= 30);
+ ASSERT (bsh[n] <= 6);
+
+#define v0 pp /* 2n */
+#define v1 (pp + 2 * n) /* 2n+1 */
+#define vinf (pp + 6 * n) /* s+t */
+#define v2 scratch /* 2n+1 */
+#define vm2 (scratch + 2 * n + 1) /* 2n+1 */
+#define vh (scratch + 4 * n + 2) /* 2n+1 */
+#define vm1 (scratch + 6 * n + 3) /* 2n+1 */
+#define scratch_out (scratch + 8 * n + 4) /* 2n+1 */
+ /* Total scratch need: 10*n+5 */
+
+ /* Must be in allocation order, as they overwrite one limb beyond
+ * 2n+1. */
+ mpn_mul_n (v2, as2, bs2, n + 1); /* v2, 2n+1 limbs */
+ mpn_mul_n (vm2, asm2, bsm2, n + 1); /* vm2, 2n+1 limbs */
+ mpn_mul_n (vh, ash, bsh, n + 1); /* vh, 2n+1 limbs */
+
+ /* vm1, 2n+1 limbs */
+#ifdef SMALLER_RECURSION
+ mpn_mul_n (vm1, asm1, bsm1, n);
+ if (asm1[n] == 1)
+ {
+ cy = bsm1[n] + mpn_add_n (vm1 + n, vm1 + n, bsm1, n);
+ }
+ else if (asm1[n] == 2)
+ {
+#if HAVE_NATIVE_mpn_addlsh1_n
+ cy = 2 * bsm1[n] + mpn_addlsh1_n (vm1 + n, vm1 + n, bsm1, n);
+#else
+ cy = 2 * bsm1[n] + mpn_addmul_1 (vm1 + n, bsm1, n, CNST_LIMB(2));
+#endif
+ }
+ else
+ cy = 0;
+ if (bsm1[n] != 0)
+ cy += mpn_add_n (vm1 + n, vm1 + n, asm1, n);
+ vm1[2 * n] = cy;
+#else /* SMALLER_RECURSION */
+ vm1[2 * n] = 0;
+ mpn_mul_n (vm1, asm1, bsm1, n + ((asm1[n] | bsm1[n]) != 0));
+#endif /* SMALLER_RECURSION */
+
+ /* v1, 2n+1 limbs */
+#ifdef SMALLER_RECURSION
+ mpn_mul_n (v1, as1, bs1, n);
+ if (as1[n] == 1)
+ {
+ cy = bs1[n] + mpn_add_n (v1 + n, v1 + n, bs1, n);
+ }
+ else if (as1[n] == 2)
+ {
+#if HAVE_NATIVE_mpn_addlsh1_n
+ cy = 2 * bs1[n] + mpn_addlsh1_n (v1 + n, v1 + n, bs1, n);
+#else
+ cy = 2 * bs1[n] + mpn_addmul_1 (v1 + n, bs1, n, CNST_LIMB(2));
+#endif
+ }
+ else if (as1[n] != 0)
+ {
+ cy = as1[n] * bs1[n] + mpn_addmul_1 (v1 + n, bs1, n, as1[n]);
+ }
+ else
+ cy = 0;
+ if (bs1[n] == 1)
+ {
+ cy += mpn_add_n (v1 + n, v1 + n, as1, n);
+ }
+ else if (bs1[n] == 2)
+ {
+#if HAVE_NATIVE_mpn_addlsh1_n
+ cy += mpn_addlsh1_n (v1 + n, v1 + n, as1, n);
+#else
+ cy += mpn_addmul_1 (v1 + n, as1, n, CNST_LIMB(2));
+#endif
+ }
+ v1[2 * n] = cy;
+#else /* SMALLER_RECURSION */
+ v1[2 * n] = 0;
+ mpn_mul_n (v1, as1, bs1, n + ((as1[n] | bs1[n]) != 0));
+#endif /* SMALLER_RECURSION */
+
+ mpn_mul_n (v0, a0, b0, n); /* v0, 2n limbs */
+
+ /* vinf, s+t limbs */
+ if (s > t) mpn_mul (vinf, a4, s, b2, t);
+ else mpn_mul (vinf, b2, t, a4, s);
+
+ mpn_toom_interpolate_7pts (pp, n, flags, vm2, vm1, v2, vh, s + t,
+ scratch_out);
+
+ TMP_FREE;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/toom54_mul.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/toom54_mul.c
new file mode 100644
index 00000000000..939bb53ab68
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/toom54_mul.c
@@ -0,0 +1,143 @@
+/* Implementation of the algorithm for Toom-Cook 4.5-way.
+
+ Contributed to the GNU project by Marco Bodrato.
+
+ THE FUNCTION IN THIS FILE IS INTERNAL WITH A MUTABLE INTERFACE. IT IS ONLY
+ 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, 2012 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.h"
+#include "gmp-impl.h"
+
+
+/* Toom-4.5, the splitting 5x4 unbalanced version.
+ Evaluate in: infinity, +4, -4, +2, -2, +1, -1, 0.
+
+ <--s-><--n--><--n--><--n--><--n-->
+ ____ ______ ______ ______ ______
+ |_a4_|__a3__|__a2__|__a1__|__a0__|
+ |b3_|__b2__|__b1__|__b0__|
+ <-t-><--n--><--n--><--n-->
+
+*/
+#define TOOM_54_MUL_N_REC(p, a, b, n, ws) \
+ do { mpn_mul_n (p, a, b, n); \
+ } while (0)
+
+#define TOOM_54_MUL_REC(p, a, na, b, nb, ws) \
+ do { mpn_mul (p, a, na, b, nb); \
+ } while (0)
+
+void
+mpn_toom54_mul (mp_ptr pp,
+ mp_srcptr ap, mp_size_t an,
+ mp_srcptr bp, mp_size_t bn, mp_ptr scratch)
+{
+ mp_size_t n, s, t;
+ int sign;
+
+ /***************************** decomposition *******************************/
+#define a4 (ap + 4 * n)
+#define b3 (bp + 3 * n)
+
+ ASSERT (an >= bn);
+ n = 1 + (4 * an >= 5 * bn ? (an - 1) / (size_t) 5 : (bn - 1) / (size_t) 4);
+
+ s = an - 4 * n;
+ t = bn - 3 * n;
+
+ ASSERT (0 < s && s <= n);
+ ASSERT (0 < t && t <= n);
+ /* Required by mpn_toom_interpolate_8pts. */
+ ASSERT ( s + t >= n );
+ ASSERT ( s + t > 4);
+ ASSERT ( n > 2);
+
+#define r8 pp /* 2n */
+#define r7 scratch /* 3n+1 */
+#define r5 (pp + 3*n) /* 3n+1 */
+#define v0 (pp + 3*n) /* n+1 */
+#define v1 (pp + 4*n+1) /* n+1 */
+#define v2 (pp + 5*n+2) /* n+1 */
+#define v3 (pp + 6*n+3) /* n+1 */
+#define r3 (scratch + 3 * n + 1) /* 3n+1 */
+#define r1 (pp + 7*n) /* s+t <= 2*n */
+#define ws (scratch + 6 * n + 2) /* ??? */
+
+ /* Alloc also 3n+1 limbs for ws... mpn_toom_interpolate_8pts may
+ need all of them, when DO_mpn_sublsh_n usea a scratch */
+ /********************** evaluation and recursive calls *********************/
+ /* $\pm4$ */
+ sign = mpn_toom_eval_pm2exp (v2, v0, 4, ap, n, s, 2, pp)
+ ^ mpn_toom_eval_pm2exp (v3, v1, 3, bp, n, t, 2, pp);
+ TOOM_54_MUL_N_REC(pp, v0, v1, n + 1, ws); /* A(-4)*B(-4) */
+ TOOM_54_MUL_N_REC(r3, v2, v3, n + 1, ws); /* A(+4)*B(+4) */
+ mpn_toom_couple_handling (r3, 2*n+1, pp, sign, n, 2, 4);
+
+ /* $\pm1$ */
+ sign = mpn_toom_eval_pm1 (v2, v0, 4, ap, n, s, pp)
+ ^ mpn_toom_eval_dgr3_pm1 (v3, v1, bp, n, t, pp);
+ TOOM_54_MUL_N_REC(pp, v0, v1, n + 1, ws); /* A(-1)*B(-1) */
+ TOOM_54_MUL_N_REC(r7, v2, v3, n + 1, ws); /* A(1)*B(1) */
+ mpn_toom_couple_handling (r7, 2*n+1, pp, sign, n, 0, 0);
+
+ /* $\pm2$ */
+ sign = mpn_toom_eval_pm2 (v2, v0, 4, ap, n, s, pp)
+ ^ mpn_toom_eval_dgr3_pm2 (v3, v1, bp, n, t, pp);
+ TOOM_54_MUL_N_REC(pp, v0, v1, n + 1, ws); /* A(-2)*B(-2) */
+ TOOM_54_MUL_N_REC(r5, v2, v3, n + 1, ws); /* A(+2)*B(+2) */
+ mpn_toom_couple_handling (r5, 2*n+1, pp, sign, n, 1, 2);
+
+ /* A(0)*B(0) */
+ TOOM_54_MUL_N_REC(pp, ap, bp, n, ws);
+
+ /* Infinity */
+ if (s > t) {
+ TOOM_54_MUL_REC(r1, a4, s, b3, t, ws);
+ } else {
+ TOOM_54_MUL_REC(r1, b3, t, a4, s, ws);
+ };
+
+ mpn_toom_interpolate_8pts (pp, n, r3, r7, s + t, ws);
+
+#undef a4
+#undef b3
+#undef r1
+#undef r3
+#undef r5
+#undef v0
+#undef v1
+#undef v2
+#undef v3
+#undef r7
+#undef r8
+#undef ws
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/toom62_mul.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/toom62_mul.c
new file mode 100644
index 00000000000..3759e3cb3ca
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/toom62_mul.c
@@ -0,0 +1,311 @@
+/* mpn_toom62_mul -- Multiply {ap,an} and {bp,bn} where an is nominally 3 times
+ as large as bn. Or more accurately, (5/2)bn < an < 6bn.
+
+ Contributed to the GNU project by Torbjorn Granlund and Marco Bodrato.
+
+ The idea of applying toom to unbalanced multiplication is due to Marco
+ Bodrato and Alberto Zanoni.
+
+ THE FUNCTION IN THIS FILE IS INTERNAL WITH A MUTABLE INTERFACE. IT IS ONLY
+ 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 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.h"
+#include "gmp-impl.h"
+
+/* Evaluate in:
+ 0, +1, -1, +2, -2, 1/2, +inf
+
+ <-s-><--n--><--n--><--n--><--n--><--n-->
+ ___ ______ ______ ______ ______ ______
+ |a5_|___a4_|___a3_|___a2_|___a1_|___a0_|
+ |_b1_|___b0_|
+ <-t--><--n-->
+
+ v0 = a0 * b0 # A(0)*B(0)
+ v1 = ( a0+ a1+ a2+ a3+ a4+ a5)*( b0+ b1) # A(1)*B(1) ah <= 5 bh <= 1
+ vm1 = ( a0- a1+ a2- a3+ a4- a5)*( b0- b1) # A(-1)*B(-1) |ah| <= 2 bh = 0
+ v2 = ( a0+ 2a1+4a2+8a3+16a4+32a5)*( b0+2b1) # A(2)*B(2) ah <= 62 bh <= 2
+ vm2 = ( a0- 2a1+4a2-8a3+16a4-32a5)*( b0-2b1) # A(-2)*B(-2) -41<=ah<=20 -1<=bh<=0
+ vh = (32a0+16a1+8a2+4a3+ 2a4+ a5)*(2b0+ b1) # A(1/2)*B(1/2) ah <= 62 bh <= 2
+ vinf= a5 * b1 # A(inf)*B(inf)
+*/
+
+void
+mpn_toom62_mul (mp_ptr pp,
+ mp_srcptr ap, mp_size_t an,
+ mp_srcptr bp, mp_size_t bn,
+ mp_ptr scratch)
+{
+ mp_size_t n, s, t;
+ mp_limb_t cy;
+ mp_ptr as1, asm1, as2, asm2, ash;
+ mp_ptr bs1, bsm1, bs2, bsm2, bsh;
+ mp_ptr gp;
+ enum toom7_flags aflags, bflags;
+ TMP_DECL;
+
+#define a0 ap
+#define a1 (ap + n)
+#define a2 (ap + 2*n)
+#define a3 (ap + 3*n)
+#define a4 (ap + 4*n)
+#define a5 (ap + 5*n)
+#define b0 bp
+#define b1 (bp + n)
+
+ n = 1 + (an >= 3 * bn ? (an - 1) / (size_t) 6 : (bn - 1) >> 1);
+
+ s = an - 5 * n;
+ t = bn - n;
+
+ ASSERT (0 < s && s <= n);
+ ASSERT (0 < t && t <= n);
+
+ TMP_MARK;
+
+ as1 = TMP_SALLOC_LIMBS (n + 1);
+ asm1 = TMP_SALLOC_LIMBS (n + 1);
+ as2 = TMP_SALLOC_LIMBS (n + 1);
+ asm2 = TMP_SALLOC_LIMBS (n + 1);
+ ash = TMP_SALLOC_LIMBS (n + 1);
+
+ bs1 = TMP_SALLOC_LIMBS (n + 1);
+ bsm1 = TMP_SALLOC_LIMBS (n);
+ bs2 = TMP_SALLOC_LIMBS (n + 1);
+ bsm2 = TMP_SALLOC_LIMBS (n + 1);
+ bsh = TMP_SALLOC_LIMBS (n + 1);
+
+ gp = pp;
+
+ /* Compute as1 and asm1. */
+ aflags = (enum toom7_flags) (toom7_w3_neg & mpn_toom_eval_pm1 (as1, asm1, 5, ap, n, s, gp));
+
+ /* Compute as2 and asm2. */
+ aflags = (enum toom7_flags) (aflags | toom7_w1_neg & mpn_toom_eval_pm2 (as2, asm2, 5, ap, n, s, gp));
+
+ /* Compute ash = 32 a0 + 16 a1 + 8 a2 + 4 a3 + 2 a4 + a5
+ = 2*(2*(2*(2*(2*a0 + a1) + a2) + a3) + a4) + a5 */
+
+#if HAVE_NATIVE_mpn_addlsh1_n
+ cy = mpn_addlsh1_n (ash, a1, a0, n);
+ cy = 2*cy + mpn_addlsh1_n (ash, a2, ash, n);
+ cy = 2*cy + mpn_addlsh1_n (ash, a3, ash, n);
+ cy = 2*cy + mpn_addlsh1_n (ash, a4, ash, n);
+ if (s < n)
+ {
+ mp_limb_t cy2;
+ cy2 = mpn_addlsh1_n (ash, a5, ash, s);
+ ash[n] = 2*cy + mpn_lshift (ash + s, ash + s, n - s, 1);
+ MPN_INCR_U (ash + s, n+1-s, cy2);
+ }
+ else
+ ash[n] = 2*cy + mpn_addlsh1_n (ash, a5, ash, n);
+#else
+ cy = mpn_lshift (ash, a0, n, 1);
+ cy += mpn_add_n (ash, ash, a1, n);
+ cy = 2*cy + mpn_lshift (ash, ash, n, 1);
+ cy += mpn_add_n (ash, ash, a2, n);
+ cy = 2*cy + mpn_lshift (ash, ash, n, 1);
+ cy += mpn_add_n (ash, ash, a3, n);
+ cy = 2*cy + mpn_lshift (ash, ash, n, 1);
+ cy += mpn_add_n (ash, ash, a4, n);
+ cy = 2*cy + mpn_lshift (ash, ash, n, 1);
+ ash[n] = cy + mpn_add (ash, ash, n, a5, s);
+#endif
+
+ /* Compute bs1 and bsm1. */
+ if (t == n)
+ {
+#if HAVE_NATIVE_mpn_add_n_sub_n
+ if (mpn_cmp (b0, b1, n) < 0)
+ {
+ cy = mpn_add_n_sub_n (bs1, bsm1, b1, b0, n);
+ bflags = toom7_w3_neg;
+ }
+ else
+ {
+ cy = mpn_add_n_sub_n (bs1, bsm1, b0, b1, n);
+ bflags = (enum toom7_flags) 0;
+ }
+ bs1[n] = cy >> 1;
+#else
+ bs1[n] = mpn_add_n (bs1, b0, b1, n);
+ if (mpn_cmp (b0, b1, n) < 0)
+ {
+ mpn_sub_n (bsm1, b1, b0, n);
+ bflags = toom7_w3_neg;
+ }
+ else
+ {
+ mpn_sub_n (bsm1, b0, b1, n);
+ bflags = (enum toom7_flags) 0;
+ }
+#endif
+ }
+ else
+ {
+ bs1[n] = mpn_add (bs1, b0, n, b1, t);
+ if (mpn_zero_p (b0 + t, n - t) && mpn_cmp (b0, b1, t) < 0)
+ {
+ mpn_sub_n (bsm1, b1, b0, t);
+ MPN_ZERO (bsm1 + t, n - t);
+ bflags = toom7_w3_neg;
+ }
+ else
+ {
+ mpn_sub (bsm1, b0, n, b1, t);
+ bflags = (enum toom7_flags) 0;
+ }
+ }
+
+ /* Compute bs2 and bsm2. Recycling bs1 and bsm1; bs2=bs1+b1, bsm2 =
+ bsm1 - b1 */
+ mpn_add (bs2, bs1, n + 1, b1, t);
+ if (bflags & toom7_w3_neg)
+ {
+ bsm2[n] = mpn_add (bsm2, bsm1, n, b1, t);
+ bflags = (enum toom7_flags) (bflags | toom7_w1_neg);
+ }
+ else
+ {
+ /* FIXME: Simplify this logic? */
+ if (t < n)
+ {
+ if (mpn_zero_p (bsm1 + t, n - t) && mpn_cmp (bsm1, b1, t) < 0)
+ {
+ ASSERT_NOCARRY (mpn_sub_n (bsm2, b1, bsm1, t));
+ MPN_ZERO (bsm2 + t, n + 1 - t);
+ bflags = (enum toom7_flags) (bflags | toom7_w1_neg);
+ }
+ else
+ {
+ ASSERT_NOCARRY (mpn_sub (bsm2, bsm1, n, b1, t));
+ bsm2[n] = 0;
+ }
+ }
+ else
+ {
+ if (mpn_cmp (bsm1, b1, n) < 0)
+ {
+ ASSERT_NOCARRY (mpn_sub_n (bsm2, b1, bsm1, n));
+ bflags = (enum toom7_flags) (bflags | toom7_w1_neg);
+ }
+ else
+ {
+ ASSERT_NOCARRY (mpn_sub_n (bsm2, bsm1, b1, n));
+ }
+ bsm2[n] = 0;
+ }
+ }
+
+ /* Compute bsh, recycling bs1. bsh=bs1+b0; */
+ bsh[n] = bs1[n] + mpn_add_n (bsh, bs1, b0, n);
+
+ ASSERT (as1[n] <= 5);
+ ASSERT (bs1[n] <= 1);
+ ASSERT (asm1[n] <= 2);
+ ASSERT (as2[n] <= 62);
+ ASSERT (bs2[n] <= 2);
+ ASSERT (asm2[n] <= 41);
+ ASSERT (bsm2[n] <= 1);
+ ASSERT (ash[n] <= 62);
+ ASSERT (bsh[n] <= 2);
+
+#define v0 pp /* 2n */
+#define v1 (pp + 2 * n) /* 2n+1 */
+#define vinf (pp + 6 * n) /* s+t */
+#define v2 scratch /* 2n+1 */
+#define vm2 (scratch + 2 * n + 1) /* 2n+1 */
+#define vh (scratch + 4 * n + 2) /* 2n+1 */
+#define vm1 (scratch + 6 * n + 3) /* 2n+1 */
+#define scratch_out (scratch + 8 * n + 4) /* 2n+1 */
+ /* Total scratch need: 10*n+5 */
+
+ /* Must be in allocation order, as they overwrite one limb beyond
+ * 2n+1. */
+ mpn_mul_n (v2, as2, bs2, n + 1); /* v2, 2n+1 limbs */
+ mpn_mul_n (vm2, asm2, bsm2, n + 1); /* vm2, 2n+1 limbs */
+ mpn_mul_n (vh, ash, bsh, n + 1); /* vh, 2n+1 limbs */
+
+ /* vm1, 2n+1 limbs */
+ mpn_mul_n (vm1, asm1, bsm1, n);
+ cy = 0;
+ if (asm1[n] == 1)
+ {
+ cy = mpn_add_n (vm1 + n, vm1 + n, bsm1, n);
+ }
+ else if (asm1[n] == 2)
+ {
+#if HAVE_NATIVE_mpn_addlsh1_n
+ cy = mpn_addlsh1_n (vm1 + n, vm1 + n, bsm1, n);
+#else
+ cy = mpn_addmul_1 (vm1 + n, bsm1, n, CNST_LIMB(2));
+#endif
+ }
+ vm1[2 * n] = cy;
+
+ /* v1, 2n+1 limbs */
+ mpn_mul_n (v1, as1, bs1, n);
+ if (as1[n] == 1)
+ {
+ cy = bs1[n] + mpn_add_n (v1 + n, v1 + n, bs1, n);
+ }
+ else if (as1[n] == 2)
+ {
+#if HAVE_NATIVE_mpn_addlsh1_n
+ cy = 2 * bs1[n] + mpn_addlsh1_n (v1 + n, v1 + n, bs1, n);
+#else
+ cy = 2 * bs1[n] + mpn_addmul_1 (v1 + n, bs1, n, CNST_LIMB(2));
+#endif
+ }
+ else if (as1[n] != 0)
+ {
+ cy = as1[n] * bs1[n] + mpn_addmul_1 (v1 + n, bs1, n, as1[n]);
+ }
+ else
+ cy = 0;
+ if (bs1[n] != 0)
+ cy += mpn_add_n (v1 + n, v1 + n, as1, n);
+ v1[2 * n] = cy;
+
+ mpn_mul_n (v0, a0, b0, n); /* v0, 2n limbs */
+
+ /* vinf, s+t limbs */
+ if (s > t) mpn_mul (vinf, a5, s, b1, t);
+ else mpn_mul (vinf, b1, t, a5, s);
+
+ mpn_toom_interpolate_7pts (pp, n, (enum toom7_flags) (aflags ^ bflags),
+ vm2, vm1, v2, vh, s + t, scratch_out);
+
+ TMP_FREE;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/toom63_mul.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/toom63_mul.c
new file mode 100644
index 00000000000..57c5d3e3dd8
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/toom63_mul.c
@@ -0,0 +1,232 @@
+/* Implementation of the algorithm for Toom-Cook 4.5-way.
+
+ Contributed to the GNU project by Marco Bodrato.
+
+ THE FUNCTION IN THIS FILE IS INTERNAL WITH A MUTABLE INTERFACE. IT IS ONLY
+ 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, 2012 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.h"
+#include "gmp-impl.h"
+
+/* Stores |{ap,n}-{bp,n}| in {rp,n}, returns the sign. */
+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)
+ {
+ mpn_sub_n (rp, ap, bp, n);
+ return 0;
+ }
+ else
+ {
+ mpn_sub_n (rp, bp, ap, n);
+ return ~0;
+ }
+ }
+ rp[n] = 0;
+ }
+ return 0;
+}
+
+static int
+abs_sub_add_n (mp_ptr rm, mp_ptr rp, mp_srcptr rs, mp_size_t n) {
+ int result;
+ result = abs_sub_n (rm, rp, rs, n);
+ ASSERT_NOCARRY(mpn_add_n (rp, rp, rs, n));
+ return result;
+}
+
+
+/* Toom-4.5, the splitting 6x3 unbalanced version.
+ Evaluate in: infinity, +4, -4, +2, -2, +1, -1, 0.
+
+ <--s-><--n--><--n--><--n--><--n--><--n-->
+ ____ ______ ______ ______ ______ ______
+ |_a5_|__a4__|__a3__|__a2__|__a1__|__a0__|
+ |b2_|__b1__|__b0__|
+ <-t-><--n--><--n-->
+
+*/
+#define TOOM_63_MUL_N_REC(p, a, b, n, ws) \
+ do { mpn_mul_n (p, a, b, n); \
+ } while (0)
+
+#define TOOM_63_MUL_REC(p, a, na, b, nb, ws) \
+ do { mpn_mul (p, a, na, b, nb); \
+ } while (0)
+
+void
+mpn_toom63_mul (mp_ptr pp,
+ mp_srcptr ap, mp_size_t an,
+ mp_srcptr bp, mp_size_t bn, mp_ptr scratch)
+{
+ mp_size_t n, s, t;
+ mp_limb_t cy;
+ int sign;
+
+ /***************************** decomposition *******************************/
+#define a5 (ap + 5 * n)
+#define b0 (bp + 0 * n)
+#define b1 (bp + 1 * n)
+#define b2 (bp + 2 * n)
+
+ ASSERT (an >= bn);
+ n = 1 + (an >= 2 * bn ? (an - 1) / (size_t) 6 : (bn - 1) / (size_t) 3);
+
+ s = an - 5 * n;
+ t = bn - 2 * n;
+
+ ASSERT (0 < s && s <= n);
+ ASSERT (0 < t && t <= n);
+ /* WARNING! it assumes s+t>=n */
+ ASSERT ( s + t >= n );
+ ASSERT ( s + t > 4);
+ /* WARNING! it assumes n>1 */
+ ASSERT ( n > 2);
+
+#define r8 pp /* 2n */
+#define r7 scratch /* 3n+1 */
+#define r5 (pp + 3*n) /* 3n+1 */
+#define v0 (pp + 3*n) /* n+1 */
+#define v1 (pp + 4*n+1) /* n+1 */
+#define v2 (pp + 5*n+2) /* n+1 */
+#define v3 (pp + 6*n+3) /* n+1 */
+#define r3 (scratch + 3 * n + 1) /* 3n+1 */
+#define r1 (pp + 7*n) /* s+t <= 2*n */
+#define ws (scratch + 6 * n + 2) /* ??? */
+
+ /* Alloc also 3n+1 limbs for ws... mpn_toom_interpolate_8pts may
+ need all of them, when DO_mpn_sublsh_n usea a scratch */
+/* if (scratch == NULL) scratch = TMP_SALLOC_LIMBS (9 * n + 3); */
+
+ /********************** evaluation and recursive calls *********************/
+ /* $\pm4$ */
+ sign = mpn_toom_eval_pm2exp (v2, v0, 5, ap, n, s, 2, pp);
+ pp[n] = mpn_lshift (pp, b1, n, 2); /* 4b1 */
+ /* FIXME: use addlsh */
+ v3[t] = mpn_lshift (v3, b2, t, 4);/* 16b2 */
+ if ( n == t )
+ v3[n]+= mpn_add_n (v3, v3, b0, n); /* 16b2+b0 */
+ else
+ v3[n] = mpn_add (v3, b0, n, v3, t+1); /* 16b2+b0 */
+ sign ^= abs_sub_add_n (v1, v3, pp, n + 1);
+ TOOM_63_MUL_N_REC(pp, v0, v1, n + 1, ws); /* A(-4)*B(-4) */
+ TOOM_63_MUL_N_REC(r3, v2, v3, n + 1, ws); /* A(+4)*B(+4) */
+ mpn_toom_couple_handling (r3, 2*n+1, pp, sign, n, 2, 4);
+
+ /* $\pm1$ */
+ sign = mpn_toom_eval_pm1 (v2, v0, 5, ap, n, s, pp);
+ /* Compute bs1 and bsm1. Code taken from toom33 */
+ cy = mpn_add (ws, b0, n, b2, t);
+#if HAVE_NATIVE_mpn_add_n_sub_n
+ if (cy == 0 && mpn_cmp (ws, b1, n) < 0)
+ {
+ cy = mpn_add_n_sub_n (v3, v1, b1, ws, n);
+ v3[n] = cy >> 1;
+ v1[n] = 0;
+ sign = ~sign;
+ }
+ else
+ {
+ mp_limb_t cy2;
+ cy2 = mpn_add_n_sub_n (v3, v1, ws, b1, n);
+ v3[n] = cy + (cy2 >> 1);
+ v1[n] = cy - (cy2 & 1);
+ }
+#else
+ v3[n] = cy + mpn_add_n (v3, ws, b1, n);
+ if (cy == 0 && mpn_cmp (ws, b1, n) < 0)
+ {
+ mpn_sub_n (v1, b1, ws, n);
+ v1[n] = 0;
+ sign = ~sign;
+ }
+ else
+ {
+ cy -= mpn_sub_n (v1, ws, b1, n);
+ v1[n] = cy;
+ }
+#endif
+ TOOM_63_MUL_N_REC(pp, v0, v1, n + 1, ws); /* A(-1)*B(-1) */
+ TOOM_63_MUL_N_REC(r7, v2, v3, n + 1, ws); /* A(1)*B(1) */
+ mpn_toom_couple_handling (r7, 2*n+1, pp, sign, n, 0, 0);
+
+ /* $\pm2$ */
+ sign = mpn_toom_eval_pm2 (v2, v0, 5, ap, n, s, pp);
+ pp[n] = mpn_lshift (pp, b1, n, 1); /* 2b1 */
+ /* FIXME: use addlsh or addlsh2 */
+ v3[t] = mpn_lshift (v3, b2, t, 2);/* 4b2 */
+ if ( n == t )
+ v3[n]+= mpn_add_n (v3, v3, b0, n); /* 4b2+b0 */
+ else
+ v3[n] = mpn_add (v3, b0, n, v3, t+1); /* 4b2+b0 */
+ sign ^= abs_sub_add_n (v1, v3, pp, n + 1);
+ TOOM_63_MUL_N_REC(pp, v0, v1, n + 1, ws); /* A(-2)*B(-2) */
+ TOOM_63_MUL_N_REC(r5, v2, v3, n + 1, ws); /* A(+2)*B(+2) */
+ mpn_toom_couple_handling (r5, 2*n+1, pp, sign, n, 1, 2);
+
+ /* A(0)*B(0) */
+ TOOM_63_MUL_N_REC(pp, ap, bp, n, ws);
+
+ /* Infinity */
+ if (s > t) {
+ TOOM_63_MUL_REC(r1, a5, s, b2, t, ws);
+ } else {
+ TOOM_63_MUL_REC(r1, b2, t, a5, s, ws);
+ };
+
+ mpn_toom_interpolate_8pts (pp, n, r3, r7, s + t, ws);
+
+#undef a5
+#undef b0
+#undef b1
+#undef b2
+#undef r1
+#undef r3
+#undef r5
+#undef v0
+#undef v1
+#undef v2
+#undef v3
+#undef r7
+#undef r8
+#undef ws
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/toom6_sqr.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/toom6_sqr.c
new file mode 100644
index 00000000000..e5ab7dcd1d2
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/toom6_sqr.c
@@ -0,0 +1,182 @@
+/* Implementation of the squaring algorithm with Toom-Cook 6.5-way.
+
+ Contributed to the GNU project by Marco Bodrato.
+
+ THE FUNCTION IN THIS FILE IS INTERNAL WITH A MUTABLE INTERFACE. IT IS ONLY
+ 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 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.h"
+#include "gmp-impl.h"
+
+
+#if GMP_NUMB_BITS < 21
+#error Not implemented.
+#endif
+
+
+#if TUNE_PROGRAM_BUILD
+#define MAYBE_sqr_basecase 1
+#define MAYBE_sqr_above_basecase 1
+#define MAYBE_sqr_toom2 1
+#define MAYBE_sqr_above_toom2 1
+#define MAYBE_sqr_toom3 1
+#define MAYBE_sqr_above_toom3 1
+#define MAYBE_sqr_above_toom4 1
+#else
+#ifdef SQR_TOOM8_THRESHOLD
+#define SQR_TOOM6_MAX ((SQR_TOOM8_THRESHOLD+6*2-1+5)/6)
+#else
+#define SQR_TOOM6_MAX \
+ ((SQR_FFT_THRESHOLD <= MP_SIZE_T_MAX - (6*2-1+5)) ? \
+ ((SQR_FFT_THRESHOLD+6*2-1+5)/6) \
+ : MP_SIZE_T_MAX )
+#endif
+#define MAYBE_sqr_basecase \
+ (SQR_TOOM6_THRESHOLD < 6 * SQR_TOOM2_THRESHOLD)
+#define MAYBE_sqr_above_basecase \
+ (SQR_TOOM6_MAX >= SQR_TOOM2_THRESHOLD)
+#define MAYBE_sqr_toom2 \
+ (SQR_TOOM6_THRESHOLD < 6 * SQR_TOOM3_THRESHOLD)
+#define MAYBE_sqr_above_toom2 \
+ (SQR_TOOM6_MAX >= SQR_TOOM3_THRESHOLD)
+#define MAYBE_sqr_toom3 \
+ (SQR_TOOM6_THRESHOLD < 6 * SQR_TOOM4_THRESHOLD)
+#define MAYBE_sqr_above_toom3 \
+ (SQR_TOOM6_MAX >= SQR_TOOM4_THRESHOLD)
+#define MAYBE_sqr_above_toom4 \
+ (SQR_TOOM6_MAX >= SQR_TOOM6_THRESHOLD)
+#endif
+
+#define TOOM6_SQR_REC(p, a, n, ws) \
+ do { \
+ if (MAYBE_sqr_basecase && ( !MAYBE_sqr_above_basecase \
+ || BELOW_THRESHOLD (n, SQR_TOOM2_THRESHOLD))) \
+ mpn_sqr_basecase (p, a, n); \
+ else if (MAYBE_sqr_toom2 && ( !MAYBE_sqr_above_toom2 \
+ || BELOW_THRESHOLD (n, SQR_TOOM3_THRESHOLD))) \
+ mpn_toom2_sqr (p, a, n, ws); \
+ else if (MAYBE_sqr_toom3 && ( !MAYBE_sqr_above_toom3 \
+ || BELOW_THRESHOLD (n, SQR_TOOM4_THRESHOLD))) \
+ mpn_toom3_sqr (p, a, n, ws); \
+ else if (! MAYBE_sqr_above_toom4 \
+ || BELOW_THRESHOLD (n, SQR_TOOM6_THRESHOLD)) \
+ mpn_toom4_sqr (p, a, n, ws); \
+ else \
+ mpn_toom6_sqr (p, a, n, ws); \
+ } while (0)
+
+void
+mpn_toom6_sqr (mp_ptr pp, mp_srcptr ap, mp_size_t an, mp_ptr scratch)
+{
+ mp_size_t n, s;
+
+ /***************************** decomposition *******************************/
+
+ ASSERT( an >= 18 );
+
+ n = 1 + (an - 1) / (size_t) 6;
+
+ s = an - 5 * n;
+
+ ASSERT (0 < s && s <= n);
+
+#define r4 (pp + 3 * n) /* 3n+1 */
+#define r2 (pp + 7 * n) /* 3n+1 */
+#define r0 (pp +11 * n) /* s+t <= 2*n */
+#define r5 (scratch) /* 3n+1 */
+#define r3 (scratch + 3 * n + 1) /* 3n+1 */
+#define r1 (scratch + 6 * n + 2) /* 3n+1 */
+#define v0 (pp + 7 * n) /* n+1 */
+#define v2 (pp + 9 * n+2) /* n+1 */
+#define wse (scratch + 9 * n + 3) /* 3n+1 */
+
+ /* Alloc also 3n+1 limbs for ws... toom_interpolate_12pts may
+ need all of them, when DO_mpn_sublsh_n usea a scratch */
+/* if (scratch== NULL) */
+/* scratch = TMP_SALLOC_LIMBS (12 * n + 6); */
+
+ /********************** evaluation and recursive calls *********************/
+ /* $\pm1/2$ */
+ mpn_toom_eval_pm2rexp (v2, v0, 5, ap, n, s, 1, pp);
+ TOOM6_SQR_REC(pp, v0, n + 1, wse); /* A(-1/2)*B(-1/2)*2^. */
+ TOOM6_SQR_REC(r5, v2, n + 1, wse); /* A(+1/2)*B(+1/2)*2^. */
+ mpn_toom_couple_handling (r5, 2 * n + 1, pp, 0, n, 1, 0);
+
+ /* $\pm1$ */
+ mpn_toom_eval_pm1 (v2, v0, 5, ap, n, s, pp);
+ TOOM6_SQR_REC(pp, v0, n + 1, wse); /* A(-1)*B(-1) */
+ TOOM6_SQR_REC(r3, v2, n + 1, wse); /* A(1)*B(1) */
+ mpn_toom_couple_handling (r3, 2 * n + 1, pp, 0, n, 0, 0);
+
+ /* $\pm4$ */
+ mpn_toom_eval_pm2exp (v2, v0, 5, ap, n, s, 2, pp);
+ TOOM6_SQR_REC(pp, v0, n + 1, wse); /* A(-4)*B(-4) */
+ TOOM6_SQR_REC(r1, v2, n + 1, wse); /* A(+4)*B(+4) */
+ mpn_toom_couple_handling (r1, 2 * n + 1, pp, 0, n, 2, 4);
+
+ /* $\pm1/4$ */
+ mpn_toom_eval_pm2rexp (v2, v0, 5, ap, n, s, 2, pp);
+ TOOM6_SQR_REC(pp, v0, n + 1, wse); /* A(-1/4)*B(-1/4)*4^. */
+ TOOM6_SQR_REC(r4, v2, n + 1, wse); /* A(+1/4)*B(+1/4)*4^. */
+ mpn_toom_couple_handling (r4, 2 * n + 1, pp, 0, n, 2, 0);
+
+ /* $\pm2$ */
+ mpn_toom_eval_pm2 (v2, v0, 5, ap, n, s, pp);
+ TOOM6_SQR_REC(pp, v0, n + 1, wse); /* A(-2)*B(-2) */
+ TOOM6_SQR_REC(r2, v2, n + 1, wse); /* A(+2)*B(+2) */
+ mpn_toom_couple_handling (r2, 2 * n + 1, pp, 0, n, 1, 2);
+
+#undef v0
+#undef v2
+
+ /* A(0)*B(0) */
+ TOOM6_SQR_REC(pp, ap, n, wse);
+
+ mpn_toom_interpolate_12pts (pp, r1, r3, r5, n, 2 * s, 0, wse);
+
+#undef r0
+#undef r1
+#undef r2
+#undef r3
+#undef r4
+#undef r5
+
+}
+#undef TOOM6_SQR_REC
+#undef MAYBE_sqr_basecase
+#undef MAYBE_sqr_above_basecase
+#undef MAYBE_sqr_toom2
+#undef MAYBE_sqr_above_toom2
+#undef MAYBE_sqr_toom3
+#undef MAYBE_sqr_above_toom3
+#undef MAYBE_sqr_above_toom4
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/toom6h_mul.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/toom6h_mul.c
new file mode 100644
index 00000000000..420895be8f9
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/toom6h_mul.c
@@ -0,0 +1,263 @@
+/* Implementation of the multiplication algorithm for Toom-Cook 6.5-way.
+
+ Contributed to the GNU project by Marco Bodrato.
+
+ THE FUNCTION IN THIS FILE IS INTERNAL WITH A MUTABLE INTERFACE. IT IS ONLY
+ 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.
+
+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.h"
+#include "gmp-impl.h"
+
+
+#if GMP_NUMB_BITS < 21
+#error Not implemented.
+#endif
+
+#if TUNE_PROGRAM_BUILD
+#define MAYBE_mul_basecase 1
+#define MAYBE_mul_toom22 1
+#define MAYBE_mul_toom33 1
+#define MAYBE_mul_toom6h 1
+#else
+#define MAYBE_mul_basecase \
+ (MUL_TOOM6H_THRESHOLD < 6 * MUL_TOOM22_THRESHOLD)
+#define MAYBE_mul_toom22 \
+ (MUL_TOOM6H_THRESHOLD < 6 * MUL_TOOM33_THRESHOLD)
+#define MAYBE_mul_toom33 \
+ (MUL_TOOM6H_THRESHOLD < 6 * MUL_TOOM44_THRESHOLD)
+#define MAYBE_mul_toom6h \
+ (MUL_FFT_THRESHOLD >= 6 * MUL_TOOM6H_THRESHOLD)
+#endif
+
+#define TOOM6H_MUL_N_REC(p, a, b, f, p2, a2, b2, n, ws) \
+ do { \
+ if (MAYBE_mul_basecase \
+ && BELOW_THRESHOLD (n, MUL_TOOM22_THRESHOLD)) { \
+ mpn_mul_basecase (p, a, n, b, n); \
+ if (f) \
+ mpn_mul_basecase (p2, a2, n, b2, n); \
+ } else if (MAYBE_mul_toom22 \
+ && BELOW_THRESHOLD (n, MUL_TOOM33_THRESHOLD)) { \
+ mpn_toom22_mul (p, a, n, b, n, ws); \
+ if (f) \
+ mpn_toom22_mul (p2, a2, n, b2, n, ws); \
+ } else if (MAYBE_mul_toom33 \
+ && BELOW_THRESHOLD (n, MUL_TOOM44_THRESHOLD)) { \
+ mpn_toom33_mul (p, a, n, b, n, ws); \
+ if (f) \
+ mpn_toom33_mul (p2, a2, n, b2, n, ws); \
+ } else if (! MAYBE_mul_toom6h \
+ || BELOW_THRESHOLD (n, MUL_TOOM6H_THRESHOLD)) { \
+ mpn_toom44_mul (p, a, n, b, n, ws); \
+ if (f) \
+ mpn_toom44_mul (p2, a2, n, b2, n, ws); \
+ } else { \
+ mpn_toom6h_mul (p, a, n, b, n, ws); \
+ if (f) \
+ mpn_toom6h_mul (p2, a2, n, b2, n, ws); \
+ } \
+ } while (0)
+
+#define TOOM6H_MUL_REC(p, a, na, b, nb, ws) \
+ do { mpn_mul (p, a, na, b, nb); \
+ } while (0)
+
+/* Toom-6.5 , compute the product {pp,an+bn} <- {ap,an} * {bp,bn}
+ With: an >= bn >= 46, an*6 < bn * 17.
+ It _may_ work with bn<=46 and bn*17 < an*6 < bn*18
+
+ Evaluate in: infinity, +4, -4, +2, -2, +1, -1, +1/2, -1/2, +1/4, -1/4, 0.
+*/
+/* Estimate on needed scratch:
+ S(n) <= (n+5)\6*10+4+MAX(S((n+5)\6),1+2*(n+5)\6),
+ since n>42; S(n) <= ceil(log(n)/log(6))*(10+4)+n*12\6 < n*2 + lg2(n)*6
+ */
+
+void
+mpn_toom6h_mul (mp_ptr pp,
+ mp_srcptr ap, mp_size_t an,
+ mp_srcptr bp, mp_size_t bn, mp_ptr scratch)
+{
+ mp_size_t n, s, t;
+ int p, q, half;
+ int sign;
+
+ /***************************** decomposition *******************************/
+
+ ASSERT (an >= bn);
+ /* Can not handle too much unbalancement */
+ ASSERT (bn >= 42);
+ /* Can not handle too much unbalancement */
+ ASSERT ((an*3 < bn * 8) || (bn >= 46 && an * 6 < bn * 17));
+
+ /* Limit num/den is a rational number between
+ (12/11)^(log(4)/log(2*4-1)) and (12/11)^(log(6)/log(2*6-1)) */
+#define LIMIT_numerator (18)
+#define LIMIT_denominat (17)
+
+ if (LIKELY (an * LIMIT_denominat < LIMIT_numerator * bn)) /* is 6*... < 6*... */
+ {
+ n = 1 + (an - 1) / (size_t) 6;
+ p = q = 5;
+ half = 0;
+
+ s = an - 5 * n;
+ t = bn - 5 * n;
+ }
+ else {
+ if (an * 5 * LIMIT_numerator < LIMIT_denominat * 7 * bn)
+ { p = 7; q = 6; }
+ else if (an * 5 * LIMIT_denominat < LIMIT_numerator * 7 * bn)
+ { p = 7; q = 5; }
+ else if (an * LIMIT_numerator < LIMIT_denominat * 2 * bn) /* is 4*... < 8*... */
+ { p = 8; q = 5; }
+ else if (an * LIMIT_denominat < LIMIT_numerator * 2 * bn) /* is 4*... < 8*... */
+ { p = 8; q = 4; }
+ else
+ { p = 9; q = 4; }
+
+ half = (p ^ q) & 1;
+ n = 1 + (q * an >= p * bn ? (an - 1) / (size_t) p : (bn - 1) / (size_t) q);
+ p--; q--;
+
+ s = an - p * n;
+ t = bn - q * n;
+
+ /* With LIMIT = 16/15, the following recover is needed only if bn<=73*/
+ if (half) { /* Recover from badly chosen splitting */
+ if (UNLIKELY (s<1)) {p--; s+=n; half=0;}
+ else if (UNLIKELY (t<1)) {q--; t+=n; half=0;}
+ }
+ }
+#undef LIMIT_numerator
+#undef LIMIT_denominat
+
+ ASSERT (0 < s && s <= n);
+ ASSERT (0 < t && t <= n);
+ ASSERT (half || s + t > 3);
+ ASSERT (n > 2);
+
+#define r4 (pp + 3 * n) /* 3n+1 */
+#define r2 (pp + 7 * n) /* 3n+1 */
+#define r0 (pp +11 * n) /* s+t <= 2*n */
+#define r5 (scratch) /* 3n+1 */
+#define r3 (scratch + 3 * n + 1) /* 3n+1 */
+#define r1 (scratch + 6 * n + 2) /* 3n+1 */
+#define v0 (pp + 7 * n) /* n+1 */
+#define v1 (pp + 8 * n+1) /* n+1 */
+#define v2 (pp + 9 * n+2) /* n+1 */
+#define v3 (scratch + 9 * n + 3) /* n+1 */
+#define wsi (scratch + 9 * n + 3) /* 3n+1 */
+#define wse (scratch +10 * n + 4) /* 2n+1 */
+
+ /* Alloc also 3n+1 limbs for wsi... toom_interpolate_12pts may
+ need all of them */
+/* if (scratch == NULL) */
+/* scratch = TMP_SALLOC_LIMBS(mpn_toom6_sqr_itch(n * 6)); */
+ ASSERT (12 * n + 6 <= mpn_toom6h_mul_itch(an,bn));
+ ASSERT (12 * n + 6 <= mpn_toom6_sqr_itch(n * 6));
+
+ /********************** evaluation and recursive calls *********************/
+ /* $\pm1/2$ */
+ sign = mpn_toom_eval_pm2rexp (v2, v0, p, ap, n, s, 1, pp) ^
+ mpn_toom_eval_pm2rexp (v3, v1, q, bp, n, t, 1, pp);
+ /* A(-1/2)*B(-1/2)*2^. */ /* A(+1/2)*B(+1/2)*2^. */
+ TOOM6H_MUL_N_REC(pp, v0, v1, 2, r5, v2, v3, n + 1, wse);
+ mpn_toom_couple_handling (r5, 2 * n + 1, pp, sign, n, 1+half , half);
+
+ /* $\pm1$ */
+ sign = mpn_toom_eval_pm1 (v2, v0, p, ap, n, s, pp);
+ if (UNLIKELY (q == 3))
+ sign ^= mpn_toom_eval_dgr3_pm1 (v3, v1, bp, n, t, pp);
+ else
+ sign ^= mpn_toom_eval_pm1 (v3, v1, q, bp, n, t, pp);
+ /* A(-1)*B(-1) */ /* A(1)*B(1) */
+ TOOM6H_MUL_N_REC(pp, v0, v1, 2, r3, v2, v3, n + 1, wse);
+ mpn_toom_couple_handling (r3, 2 * n + 1, pp, sign, n, 0, 0);
+
+ /* $\pm4$ */
+ sign = mpn_toom_eval_pm2exp (v2, v0, p, ap, n, s, 2, pp) ^
+ mpn_toom_eval_pm2exp (v3, v1, q, bp, n, t, 2, pp);
+ /* A(-4)*B(-4) */
+ TOOM6H_MUL_N_REC(pp, v0, v1, 2, r1, v2, v3, n + 1, wse); /* A(+4)*B(+4) */
+ mpn_toom_couple_handling (r1, 2 * n + 1, pp, sign, n, 2, 4);
+
+ /* $\pm1/4$ */
+ sign = mpn_toom_eval_pm2rexp (v2, v0, p, ap, n, s, 2, pp) ^
+ mpn_toom_eval_pm2rexp (v3, v1, q, bp, n, t, 2, pp);
+ /* A(-1/4)*B(-1/4)*4^. */ /* A(+1/4)*B(+1/4)*4^. */
+ TOOM6H_MUL_N_REC(pp, v0, v1, 2, r4, v2, v3, n + 1, wse);
+ mpn_toom_couple_handling (r4, 2 * n + 1, pp, sign, n, 2*(1+half), 2*(half));
+
+ /* $\pm2$ */
+ sign = mpn_toom_eval_pm2 (v2, v0, p, ap, n, s, pp) ^
+ mpn_toom_eval_pm2 (v3, v1, q, bp, n, t, pp);
+ /* A(-2)*B(-2) */ /* A(+2)*B(+2) */
+ TOOM6H_MUL_N_REC(pp, v0, v1, 2, r2, v2, v3, n + 1, wse);
+ mpn_toom_couple_handling (r2, 2 * n + 1, pp, sign, n, 1, 2);
+
+#undef v0
+#undef v1
+#undef v2
+#undef v3
+#undef wse
+
+ /* A(0)*B(0) */
+ TOOM6H_MUL_N_REC(pp, ap, bp, 0, pp, ap, bp, n, wsi);
+
+ /* Infinity */
+ if (UNLIKELY (half != 0)) {
+ if (s > t) {
+ TOOM6H_MUL_REC(r0, ap + p * n, s, bp + q * n, t, wsi);
+ } else {
+ TOOM6H_MUL_REC(r0, bp + q * n, t, ap + p * n, s, wsi);
+ };
+ };
+
+ mpn_toom_interpolate_12pts (pp, r1, r3, r5, n, s+t, half, wsi);
+
+#undef r0
+#undef r1
+#undef r2
+#undef r3
+#undef r4
+#undef r5
+#undef wsi
+}
+
+#undef TOOM6H_MUL_N_REC
+#undef TOOM6H_MUL_REC
+#undef MAYBE_mul_basecase
+#undef MAYBE_mul_toom22
+#undef MAYBE_mul_toom33
+#undef MAYBE_mul_toom6h
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/toom8_sqr.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/toom8_sqr.c
new file mode 100644
index 00000000000..0c936788159
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/toom8_sqr.c
@@ -0,0 +1,226 @@
+/* Implementation of the squaring algorithm with Toom-Cook 8.5-way.
+
+ Contributed to the GNU project by Marco Bodrato.
+
+ THE FUNCTION IN THIS FILE IS INTERNAL WITH A MUTABLE INTERFACE. IT IS ONLY
+ 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, 2012 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.h"
+#include "gmp-impl.h"
+
+#if GMP_NUMB_BITS < 29
+#error Not implemented.
+#endif
+
+#if GMP_NUMB_BITS < 43
+#define BIT_CORRECTION 1
+#define CORRECTION_BITS GMP_NUMB_BITS
+#else
+#define BIT_CORRECTION 0
+#define CORRECTION_BITS 0
+#endif
+
+#ifndef SQR_TOOM8_THRESHOLD
+#define SQR_TOOM8_THRESHOLD MUL_TOOM8H_THRESHOLD
+#endif
+
+#ifndef SQR_TOOM6_THRESHOLD
+#define SQR_TOOM6_THRESHOLD MUL_TOOM6H_THRESHOLD
+#endif
+
+#if TUNE_PROGRAM_BUILD
+#define MAYBE_sqr_basecase 1
+#define MAYBE_sqr_above_basecase 1
+#define MAYBE_sqr_toom2 1
+#define MAYBE_sqr_above_toom2 1
+#define MAYBE_sqr_toom3 1
+#define MAYBE_sqr_above_toom3 1
+#define MAYBE_sqr_toom4 1
+#define MAYBE_sqr_above_toom4 1
+#define MAYBE_sqr_above_toom6 1
+#else
+#define SQR_TOOM8_MAX \
+ ((SQR_FFT_THRESHOLD <= MP_SIZE_T_MAX - (8*2-1+7)) ? \
+ ((SQR_FFT_THRESHOLD+8*2-1+7)/8) \
+ : MP_SIZE_T_MAX )
+#define MAYBE_sqr_basecase \
+ (SQR_TOOM8_THRESHOLD < 8 * SQR_TOOM2_THRESHOLD)
+#define MAYBE_sqr_above_basecase \
+ (SQR_TOOM8_MAX >= SQR_TOOM2_THRESHOLD)
+#define MAYBE_sqr_toom2 \
+ (SQR_TOOM8_THRESHOLD < 8 * SQR_TOOM3_THRESHOLD)
+#define MAYBE_sqr_above_toom2 \
+ (SQR_TOOM8_MAX >= SQR_TOOM3_THRESHOLD)
+#define MAYBE_sqr_toom3 \
+ (SQR_TOOM8_THRESHOLD < 8 * SQR_TOOM4_THRESHOLD)
+#define MAYBE_sqr_above_toom3 \
+ (SQR_TOOM8_MAX >= SQR_TOOM4_THRESHOLD)
+#define MAYBE_sqr_toom4 \
+ (SQR_TOOM8_THRESHOLD < 8 * SQR_TOOM6_THRESHOLD)
+#define MAYBE_sqr_above_toom4 \
+ (SQR_TOOM8_MAX >= SQR_TOOM6_THRESHOLD)
+#define MAYBE_sqr_above_toom6 \
+ (SQR_TOOM8_MAX >= SQR_TOOM8_THRESHOLD)
+#endif
+
+#define TOOM8_SQR_REC(p, a, f, p2, a2, n, ws) \
+ do { \
+ if (MAYBE_sqr_basecase && ( !MAYBE_sqr_above_basecase \
+ || BELOW_THRESHOLD (n, SQR_TOOM2_THRESHOLD))) { \
+ mpn_sqr_basecase (p, a, n); \
+ if (f) mpn_sqr_basecase (p2, a2, n); \
+ } else if (MAYBE_sqr_toom2 && ( !MAYBE_sqr_above_toom2 \
+ || BELOW_THRESHOLD (n, SQR_TOOM3_THRESHOLD))) { \
+ mpn_toom2_sqr (p, a, n, ws); \
+ if (f) mpn_toom2_sqr (p2, a2, n, ws); \
+ } else if (MAYBE_sqr_toom3 && ( !MAYBE_sqr_above_toom3 \
+ || BELOW_THRESHOLD (n, SQR_TOOM4_THRESHOLD))) { \
+ mpn_toom3_sqr (p, a, n, ws); \
+ if (f) mpn_toom3_sqr (p2, a2, n, ws); \
+ } else if (MAYBE_sqr_toom4 && ( !MAYBE_sqr_above_toom4 \
+ || BELOW_THRESHOLD (n, SQR_TOOM6_THRESHOLD))) { \
+ mpn_toom4_sqr (p, a, n, ws); \
+ if (f) mpn_toom4_sqr (p2, a2, n, ws); \
+ } else if (! MAYBE_sqr_above_toom6 \
+ || BELOW_THRESHOLD (n, SQR_TOOM8_THRESHOLD)) { \
+ mpn_toom6_sqr (p, a, n, ws); \
+ if (f) mpn_toom6_sqr (p2, a2, n, ws); \
+ } else { \
+ mpn_toom8_sqr (p, a, n, ws); \
+ if (f) mpn_toom8_sqr (p2, a2, n, ws); \
+ } \
+ } while (0)
+
+void
+mpn_toom8_sqr (mp_ptr pp, mp_srcptr ap, mp_size_t an, mp_ptr scratch)
+{
+ mp_size_t n, s;
+
+ /***************************** decomposition *******************************/
+
+ ASSERT ( an >= 40 );
+
+ n = 1 + ((an - 1)>>3);
+
+ s = an - 7 * n;
+
+ ASSERT (0 < s && s <= n);
+ ASSERT ( s + s > 3 );
+
+#define r6 (pp + 3 * n) /* 3n+1 */
+#define r4 (pp + 7 * n) /* 3n+1 */
+#define r2 (pp +11 * n) /* 3n+1 */
+#define r0 (pp +15 * n) /* s+t <= 2*n */
+#define r7 (scratch) /* 3n+1 */
+#define r5 (scratch + 3 * n + 1) /* 3n+1 */
+#define r3 (scratch + 6 * n + 2) /* 3n+1 */
+#define r1 (scratch + 9 * n + 3) /* 3n+1 */
+#define v0 (pp +11 * n) /* n+1 */
+#define v2 (pp +13 * n+2) /* n+1 */
+#define wse (scratch +12 * n + 4) /* 3n+1 */
+
+ /* Alloc also 3n+1 limbs for ws... toom_interpolate_16pts may
+ need all of them, when DO_mpn_sublsh_n usea a scratch */
+/* if (scratch == NULL) */
+/* scratch = TMP_SALLOC_LIMBS (30 * n + 6); */
+
+ /********************** evaluation and recursive calls *********************/
+ /* $\pm1/8$ */
+ mpn_toom_eval_pm2rexp (v2, v0, 7, ap, n, s, 3, pp);
+ /* A(-1/8)*B(-1/8)*8^. */ /* A(+1/8)*B(+1/8)*8^. */
+ TOOM8_SQR_REC(pp, v0, 2, r7, v2, n + 1, wse);
+ mpn_toom_couple_handling (r7, 2 * n + 1 + BIT_CORRECTION, pp, 0, n, 3, 0);
+
+ /* $\pm1/4$ */
+ mpn_toom_eval_pm2rexp (v2, v0, 7, ap, n, s, 2, pp);
+ /* A(-1/4)*B(-1/4)*4^. */ /* A(+1/4)*B(+1/4)*4^. */
+ TOOM8_SQR_REC(pp, v0, 2, r5, v2, n + 1, wse);
+ mpn_toom_couple_handling (r5, 2 * n + 1, pp, 0, n, 2, 0);
+
+ /* $\pm2$ */
+ mpn_toom_eval_pm2 (v2, v0, 7, ap, n, s, pp);
+ /* A(-2)*B(-2) */ /* A(+2)*B(+2) */
+ TOOM8_SQR_REC(pp, v0, 2, r3, v2, n + 1, wse);
+ mpn_toom_couple_handling (r3, 2 * n + 1, pp, 0, n, 1, 2);
+
+ /* $\pm8$ */
+ mpn_toom_eval_pm2exp (v2, v0, 7, ap, n, s, 3, pp);
+ /* A(-8)*B(-8) */ /* A(+8)*B(+8) */
+ TOOM8_SQR_REC(pp, v0, 2, r1, v2, n + 1, wse);
+ mpn_toom_couple_handling (r1, 2 * n + 1 + BIT_CORRECTION, pp, 0, n, 3, 6);
+
+ /* $\pm1/2$ */
+ mpn_toom_eval_pm2rexp (v2, v0, 7, ap, n, s, 1, pp);
+ /* A(-1/2)*B(-1/2)*2^. */ /* A(+1/2)*B(+1/2)*2^. */
+ TOOM8_SQR_REC(pp, v0, 2, r6, v2, n + 1, wse);
+ mpn_toom_couple_handling (r6, 2 * n + 1, pp, 0, n, 1, 0);
+
+ /* $\pm1$ */
+ mpn_toom_eval_pm1 (v2, v0, 7, ap, n, s, pp);
+ /* A(-1)*B(-1) */ /* A(1)*B(1) */
+ TOOM8_SQR_REC(pp, v0, 2, r4, v2, n + 1, wse);
+ mpn_toom_couple_handling (r4, 2 * n + 1, pp, 0, n, 0, 0);
+
+ /* $\pm4$ */
+ mpn_toom_eval_pm2exp (v2, v0, 7, ap, n, s, 2, pp);
+ /* A(-4)*B(-4) */ /* A(+4)*B(+4) */
+ TOOM8_SQR_REC(pp, v0, 2, r2, v2, n + 1, wse);
+ mpn_toom_couple_handling (r2, 2 * n + 1, pp, 0, n, 2, 4);
+
+#undef v0
+#undef v2
+
+ /* A(0)*B(0) */
+ TOOM8_SQR_REC(pp, ap, 0, pp, ap, n, wse);
+
+ mpn_toom_interpolate_16pts (pp, r1, r3, r5, r7, n, 2 * s, 0, wse);
+
+#undef r0
+#undef r1
+#undef r2
+#undef r3
+#undef r4
+#undef r5
+#undef r6
+#undef wse
+
+}
+
+#undef TOOM8_SQR_REC
+#undef MAYBE_sqr_basecase
+#undef MAYBE_sqr_above_basecase
+#undef MAYBE_sqr_toom2
+#undef MAYBE_sqr_above_toom2
+#undef MAYBE_sqr_toom3
+#undef MAYBE_sqr_above_toom3
+#undef MAYBE_sqr_above_toom4
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/toom8h_mul.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/toom8h_mul.c
new file mode 100644
index 00000000000..8f593903f59
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/toom8h_mul.c
@@ -0,0 +1,306 @@
+/* Implementation of the multiplication algorithm for Toom-Cook 8.5-way.
+
+ Contributed to the GNU project by Marco Bodrato.
+
+ THE FUNCTION IN THIS FILE IS INTERNAL WITH A MUTABLE INTERFACE. IT IS ONLY
+ 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.
+
+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.h"
+#include "gmp-impl.h"
+
+
+#if GMP_NUMB_BITS < 29
+#error Not implemented.
+#endif
+
+#if GMP_NUMB_BITS < 43
+#define BIT_CORRECTION 1
+#define CORRECTION_BITS GMP_NUMB_BITS
+#else
+#define BIT_CORRECTION 0
+#define CORRECTION_BITS 0
+#endif
+
+
+#if TUNE_PROGRAM_BUILD
+#define MAYBE_mul_basecase 1
+#define MAYBE_mul_toom22 1
+#define MAYBE_mul_toom33 1
+#define MAYBE_mul_toom44 1
+#define MAYBE_mul_toom8h 1
+#else
+#define MAYBE_mul_basecase \
+ (MUL_TOOM8H_THRESHOLD < 8 * MUL_TOOM22_THRESHOLD)
+#define MAYBE_mul_toom22 \
+ (MUL_TOOM8H_THRESHOLD < 8 * MUL_TOOM33_THRESHOLD)
+#define MAYBE_mul_toom33 \
+ (MUL_TOOM8H_THRESHOLD < 8 * MUL_TOOM44_THRESHOLD)
+#define MAYBE_mul_toom44 \
+ (MUL_TOOM8H_THRESHOLD < 8 * MUL_TOOM6H_THRESHOLD)
+#define MAYBE_mul_toom8h \
+ (MUL_FFT_THRESHOLD >= 8 * MUL_TOOM8H_THRESHOLD)
+#endif
+
+#define TOOM8H_MUL_N_REC(p, a, b, f, p2, a2, b2, n, ws) \
+ do { \
+ if (MAYBE_mul_basecase \
+ && BELOW_THRESHOLD (n, MUL_TOOM22_THRESHOLD)) { \
+ mpn_mul_basecase (p, a, n, b, n); \
+ if (f) mpn_mul_basecase (p2, a2, n, b2, n); \
+ } else if (MAYBE_mul_toom22 \
+ && BELOW_THRESHOLD (n, MUL_TOOM33_THRESHOLD)) { \
+ mpn_toom22_mul (p, a, n, b, n, ws); \
+ if (f) mpn_toom22_mul (p2, a2, n, b2, n, ws); \
+ } else if (MAYBE_mul_toom33 \
+ && BELOW_THRESHOLD (n, MUL_TOOM44_THRESHOLD)) { \
+ mpn_toom33_mul (p, a, n, b, n, ws); \
+ if (f) mpn_toom33_mul (p2, a2, n, b2, n, ws); \
+ } else if (MAYBE_mul_toom44 \
+ && BELOW_THRESHOLD (n, MUL_TOOM6H_THRESHOLD)) { \
+ mpn_toom44_mul (p, a, n, b, n, ws); \
+ if (f) mpn_toom44_mul (p2, a2, n, b2, n, ws); \
+ } else if (! MAYBE_mul_toom8h \
+ || BELOW_THRESHOLD (n, MUL_TOOM8H_THRESHOLD)) { \
+ mpn_toom6h_mul (p, a, n, b, n, ws); \
+ if (f) mpn_toom6h_mul (p2, a2, n, b2, n, ws); \
+ } else { \
+ mpn_toom8h_mul (p, a, n, b, n, ws); \
+ if (f) mpn_toom8h_mul (p2, a2, n, b2, n, ws); \
+ } \
+ } while (0)
+
+#define TOOM8H_MUL_REC(p, a, na, b, nb, ws) \
+ do { mpn_mul (p, a, na, b, nb); } while (0)
+
+/* Toom-8.5 , compute the product {pp,an+bn} <- {ap,an} * {bp,bn}
+ With: an >= bn >= 86, an*5 < bn * 11.
+ It _may_ work with bn<=?? and bn*?? < an*? < bn*??
+
+ Evaluate in: infinity, +8,-8,+4,-4,+2,-2,+1,-1,+1/2,-1/2,+1/4,-1/4,+1/8,-1/8,0.
+*/
+/* Estimate on needed scratch:
+ S(n) <= (n+7)\8*13+5+MAX(S((n+7)\8),1+2*(n+7)\8),
+ since n>80; S(n) <= ceil(log(n/10)/log(8))*(13+5)+n*15\8 < n*15\8 + lg2(n)*6
+ */
+
+void
+mpn_toom8h_mul (mp_ptr pp,
+ mp_srcptr ap, mp_size_t an,
+ mp_srcptr bp, mp_size_t bn, mp_ptr scratch)
+{
+ mp_size_t n, s, t;
+ int p, q, half;
+ int sign;
+
+ /***************************** decomposition *******************************/
+
+ ASSERT (an >= bn);
+ /* Can not handle too small operands */
+ ASSERT (bn >= 86);
+ /* Can not handle too much unbalancement */
+ ASSERT (an <= bn*4);
+ ASSERT (GMP_NUMB_BITS > 11*3 || an*4 <= bn*11);
+ ASSERT (GMP_NUMB_BITS > 10*3 || an*1 <= bn* 2);
+ ASSERT (GMP_NUMB_BITS > 9*3 || an*2 <= bn* 3);
+
+ /* Limit num/den is a rational number between
+ (16/15)^(log(6)/log(2*6-1)) and (16/15)^(log(8)/log(2*8-1)) */
+#define LIMIT_numerator (21)
+#define LIMIT_denominat (20)
+
+ if (LIKELY (an == bn) || an * (LIMIT_denominat>>1) < LIMIT_numerator * (bn>>1) ) /* is 8*... < 8*... */
+ {
+ half = 0;
+ n = 1 + ((an - 1)>>3);
+ p = q = 7;
+ s = an - 7 * n;
+ t = bn - 7 * n;
+ }
+ else
+ {
+ if (an * 13 < 16 * bn) /* (an*7*LIMIT_numerator<LIMIT_denominat*9*bn) */
+ { p = 9; q = 8; }
+ else if (GMP_NUMB_BITS <= 9*3 ||
+ an *(LIMIT_denominat>>1) < (LIMIT_numerator/7*9) * (bn>>1))
+ { p = 9; q = 7; }
+ else if (an * 10 < 33 * (bn>>1)) /* (an*3*LIMIT_numerator<LIMIT_denominat*5*bn) */
+ { p =10; q = 7; }
+ else if (GMP_NUMB_BITS <= 10*3 ||
+ an * (LIMIT_denominat/5) < (LIMIT_numerator/3) * bn)
+ { p =10; q = 6; }
+ else if (an * 6 < 13 * bn) /*(an * 5 * LIMIT_numerator < LIMIT_denominat *11 * bn)*/
+ { p =11; q = 6; }
+ else if (GMP_NUMB_BITS <= 11*3 ||
+ an * 4 < 9 * bn)
+ { p =11; q = 5; }
+ else if (an *(LIMIT_numerator/3) < LIMIT_denominat * bn) /* is 4*... <12*... */
+ { p =12; q = 5; }
+ else if (GMP_NUMB_BITS <= 12*3 ||
+ an * 9 < 28 * bn ) /* is 4*... <12*... */
+ { p =12; q = 4; }
+ else
+ { p =13; q = 4; }
+
+ half = (p+q)&1;
+ n = 1 + (q * an >= p * bn ? (an - 1) / (size_t) p : (bn - 1) / (size_t) q);
+ p--; q--;
+
+ s = an - p * n;
+ t = bn - q * n;
+
+ if(half) { /* Recover from badly chosen splitting */
+ if (UNLIKELY (s<1)) {p--; s+=n; half=0;}
+ else if (UNLIKELY (t<1)) {q--; t+=n; half=0;}
+ }
+ }
+#undef LIMIT_numerator
+#undef LIMIT_denominat
+
+ ASSERT (0 < s && s <= n);
+ ASSERT (0 < t && t <= n);
+ ASSERT (half || s + t > 3);
+ ASSERT (n > 2);
+
+#define r6 (pp + 3 * n) /* 3n+1 */
+#define r4 (pp + 7 * n) /* 3n+1 */
+#define r2 (pp +11 * n) /* 3n+1 */
+#define r0 (pp +15 * n) /* s+t <= 2*n */
+#define r7 (scratch) /* 3n+1 */
+#define r5 (scratch + 3 * n + 1) /* 3n+1 */
+#define r3 (scratch + 6 * n + 2) /* 3n+1 */
+#define r1 (scratch + 9 * n + 3) /* 3n+1 */
+#define v0 (pp +11 * n) /* n+1 */
+#define v1 (pp +12 * n+1) /* n+1 */
+#define v2 (pp +13 * n+2) /* n+1 */
+#define v3 (scratch +12 * n + 4) /* n+1 */
+#define wsi (scratch +12 * n + 4) /* 3n+1 */
+#define wse (scratch +13 * n + 5) /* 2n+1 */
+
+ /* Alloc also 3n+1 limbs for wsi... toom_interpolate_16pts may
+ need all of them */
+/* if (scratch == NULL) */
+/* scratch = TMP_SALLOC_LIMBS(mpn_toom8_sqr_itch(n * 8)); */
+ ASSERT (15 * n + 6 <= mpn_toom8h_mul_itch (an, bn));
+ ASSERT (15 * n + 6 <= mpn_toom8_sqr_itch (n * 8));
+
+ /********************** evaluation and recursive calls *********************/
+
+ /* $\pm1/8$ */
+ sign = mpn_toom_eval_pm2rexp (v2, v0, p, ap, n, s, 3, pp) ^
+ mpn_toom_eval_pm2rexp (v3, v1, q, bp, n, t, 3, pp);
+ /* A(-1/8)*B(-1/8)*8^. */ /* A(+1/8)*B(+1/8)*8^. */
+ TOOM8H_MUL_N_REC(pp, v0, v1, 2, r7, v2, v3, n + 1, wse);
+ mpn_toom_couple_handling (r7, 2 * n + 1 + BIT_CORRECTION, pp, sign, n, 3*(1+half), 3*(half));
+
+ /* $\pm1/4$ */
+ sign = mpn_toom_eval_pm2rexp (v2, v0, p, ap, n, s, 2, pp) ^
+ mpn_toom_eval_pm2rexp (v3, v1, q, bp, n, t, 2, pp);
+ /* A(-1/4)*B(-1/4)*4^. */ /* A(+1/4)*B(+1/4)*4^. */
+ TOOM8H_MUL_N_REC(pp, v0, v1, 2, r5, v2, v3, n + 1, wse);
+ mpn_toom_couple_handling (r5, 2 * n + 1, pp, sign, n, 2*(1+half), 2*(half));
+
+ /* $\pm2$ */
+ sign = mpn_toom_eval_pm2 (v2, v0, p, ap, n, s, pp) ^
+ mpn_toom_eval_pm2 (v3, v1, q, bp, n, t, pp);
+ /* A(-2)*B(-2) */ /* A(+2)*B(+2) */
+ TOOM8H_MUL_N_REC(pp, v0, v1, 2, r3, v2, v3, n + 1, wse);
+ mpn_toom_couple_handling (r3, 2 * n + 1, pp, sign, n, 1, 2);
+
+ /* $\pm8$ */
+ sign = mpn_toom_eval_pm2exp (v2, v0, p, ap, n, s, 3, pp) ^
+ mpn_toom_eval_pm2exp (v3, v1, q, bp, n, t, 3, pp);
+ /* A(-8)*B(-8) */ /* A(+8)*B(+8) */
+ TOOM8H_MUL_N_REC(pp, v0, v1, 2, r1, v2, v3, n + 1, wse);
+ mpn_toom_couple_handling (r1, 2 * n + 1 + BIT_CORRECTION, pp, sign, n, 3, 6);
+
+ /* $\pm1/2$ */
+ sign = mpn_toom_eval_pm2rexp (v2, v0, p, ap, n, s, 1, pp) ^
+ mpn_toom_eval_pm2rexp (v3, v1, q, bp, n, t, 1, pp);
+ /* A(-1/2)*B(-1/2)*2^. */ /* A(+1/2)*B(+1/2)*2^. */
+ TOOM8H_MUL_N_REC(pp, v0, v1, 2, r6, v2, v3, n + 1, wse);
+ mpn_toom_couple_handling (r6, 2 * n + 1, pp, sign, n, 1+half, half);
+
+ /* $\pm1$ */
+ sign = mpn_toom_eval_pm1 (v2, v0, p, ap, n, s, pp);
+ if (GMP_NUMB_BITS > 12*3 && UNLIKELY (q == 3))
+ sign ^= mpn_toom_eval_dgr3_pm1 (v3, v1, bp, n, t, pp);
+ else
+ sign ^= mpn_toom_eval_pm1 (v3, v1, q, bp, n, t, pp);
+ /* A(-1)*B(-1) */ /* A(1)*B(1) */
+ TOOM8H_MUL_N_REC(pp, v0, v1, 2, r4, v2, v3, n + 1, wse);
+ mpn_toom_couple_handling (r4, 2 * n + 1, pp, sign, n, 0, 0);
+
+ /* $\pm4$ */
+ sign = mpn_toom_eval_pm2exp (v2, v0, p, ap, n, s, 2, pp) ^
+ mpn_toom_eval_pm2exp (v3, v1, q, bp, n, t, 2, pp);
+ /* A(-4)*B(-4) */ /* A(+4)*B(+4) */
+ TOOM8H_MUL_N_REC(pp, v0, v1, 2, r2, v2, v3, n + 1, wse);
+ mpn_toom_couple_handling (r2, 2 * n + 1, pp, sign, n, 2, 4);
+
+#undef v0
+#undef v1
+#undef v2
+#undef v3
+#undef wse
+
+ /* A(0)*B(0) */
+ TOOM8H_MUL_N_REC(pp, ap, bp, 0, pp, ap, bp, n, wsi);
+
+ /* Infinity */
+ if (UNLIKELY (half != 0)) {
+ if (s > t) {
+ TOOM8H_MUL_REC(r0, ap + p * n, s, bp + q * n, t, wsi);
+ } else {
+ TOOM8H_MUL_REC(r0, bp + q * n, t, ap + p * n, s, wsi);
+ };
+ };
+
+ mpn_toom_interpolate_16pts (pp, r1, r3, r5, r7, n, s+t, half, wsi);
+
+#undef r0
+#undef r1
+#undef r2
+#undef r3
+#undef r4
+#undef r5
+#undef r6
+#undef wsi
+}
+
+#undef TOOM8H_MUL_N_REC
+#undef TOOM8H_MUL_REC
+#undef MAYBE_mul_basecase
+#undef MAYBE_mul_toom22
+#undef MAYBE_mul_toom33
+#undef MAYBE_mul_toom44
+#undef MAYBE_mul_toom8h
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/toom_couple_handling.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/toom_couple_handling.c
new file mode 100644
index 00000000000..9e62bcba1c9
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/toom_couple_handling.c
@@ -0,0 +1,81 @@
+/* Helper function for high degree Toom-Cook algorithms.
+
+ Contributed to the GNU project by Marco Bodrato.
+
+ THE FUNCTION IN THIS FILE IS INTERNAL WITH A MUTABLE INTERFACE. IT IS ONLY
+ 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 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.h"
+#include "gmp-impl.h"
+
+/* Gets {pp,n} and (sign?-1:1)*{np,n}. Computes at once:
+ {pp,n} <- ({pp,n}+{np,n})/2^{ps+1}
+ {pn,n} <- ({pp,n}-{np,n})/2^{ns+1}
+ Finally recompose them obtaining:
+ {pp,n+off} <- {pp,n}+{np,n}*2^{off*GMP_NUMB_BITS}
+*/
+void
+mpn_toom_couple_handling (mp_ptr pp, mp_size_t n, mp_ptr np,
+ int nsign, mp_size_t off, int ps, int ns)
+{
+ if (nsign) {
+#ifdef HAVE_NATIVE_mpn_rsh1sub_n
+ mpn_rsh1sub_n (np, pp, np, n);
+#else
+ mpn_sub_n (np, pp, np, n);
+ mpn_rshift (np, np, n, 1);
+#endif
+ } else {
+#ifdef HAVE_NATIVE_mpn_rsh1add_n
+ mpn_rsh1add_n (np, pp, np, n);
+#else
+ mpn_add_n (np, pp, np, n);
+ mpn_rshift (np, np, n, 1);
+#endif
+ }
+
+#ifdef HAVE_NATIVE_mpn_rsh1sub_n
+ if (ps == 1)
+ mpn_rsh1sub_n (pp, pp, np, n);
+ else
+#endif
+ {
+ mpn_sub_n (pp, pp, np, n);
+ if (ps > 0)
+ mpn_rshift (pp, pp, n, ps);
+ }
+ if (ns > 0)
+ mpn_rshift (np, np, n, ns);
+ pp[n] = mpn_add_n (pp+off, pp+off, np, n-off);
+ ASSERT_NOCARRY (mpn_add_1(pp+n, np+n-off, off, pp[n]) );
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/toom_eval_dgr3_pm1.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/toom_eval_dgr3_pm1.c
new file mode 100644
index 00000000000..50411bd3ca6
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/toom_eval_dgr3_pm1.c
@@ -0,0 +1,73 @@
+/* mpn_toom_eval_dgr3_pm1 -- Evaluate a degree 3 polynomial in +1 and -1
+
+ Contributed to the GNU project by Niels Möller
+
+ THE FUNCTION IN THIS FILE IS INTERNAL WITH A MUTABLE INTERFACE. IT IS ONLY
+ 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 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.h"
+#include "gmp-impl.h"
+
+int
+mpn_toom_eval_dgr3_pm1 (mp_ptr xp1, mp_ptr xm1,
+ mp_srcptr xp, mp_size_t n, mp_size_t x3n, mp_ptr tp)
+{
+ int neg;
+
+ ASSERT (x3n > 0);
+ ASSERT (x3n <= n);
+
+ xp1[n] = mpn_add_n (xp1, xp, xp + 2*n, n);
+ tp[n] = mpn_add (tp, xp + n, n, xp + 3*n, x3n);
+
+ neg = (mpn_cmp (xp1, tp, n + 1) < 0) ? ~0 : 0;
+
+#if HAVE_NATIVE_mpn_add_n_sub_n
+ if (neg)
+ mpn_add_n_sub_n (xp1, xm1, tp, xp1, n + 1);
+ else
+ mpn_add_n_sub_n (xp1, xm1, xp1, tp, n + 1);
+#else
+ if (neg)
+ mpn_sub_n (xm1, tp, xp1, n + 1);
+ else
+ mpn_sub_n (xm1, xp1, tp, n + 1);
+
+ mpn_add_n (xp1, xp1, tp, n + 1);
+#endif
+
+ ASSERT (xp1[n] <= 3);
+ ASSERT (xm1[n] <= 1);
+
+ return neg;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/toom_eval_dgr3_pm2.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/toom_eval_dgr3_pm2.c
new file mode 100644
index 00000000000..3ba6d15f3dd
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/toom_eval_dgr3_pm2.c
@@ -0,0 +1,98 @@
+/* mpn_toom_eval_dgr3_pm2 -- Evaluate a degree 3 polynomial in +2 and -2
+
+ Contributed to the GNU project by Niels Möller
+
+ THE FUNCTION IN THIS FILE IS INTERNAL WITH A MUTABLE INTERFACE. IT IS ONLY
+ 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 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.h"
+#include "gmp-impl.h"
+
+/* Needs n+1 limbs of temporary storage. */
+int
+mpn_toom_eval_dgr3_pm2 (mp_ptr xp2, mp_ptr xm2,
+ mp_srcptr xp, mp_size_t n, mp_size_t x3n, mp_ptr tp)
+{
+ mp_limb_t cy;
+ int neg;
+
+ ASSERT (x3n > 0);
+ ASSERT (x3n <= n);
+
+ /* (x0 + 4 * x2) +/- (2 x1 + 8 x_3) */
+#if HAVE_NATIVE_mpn_addlsh_n || HAVE_NATIVE_mpn_addlsh2_n
+#if HAVE_NATIVE_mpn_addlsh2_n
+ xp2[n] = mpn_addlsh2_n (xp2, xp, xp + 2*n, n);
+
+ cy = mpn_addlsh2_n (tp, xp + n, xp + 3*n, x3n);
+#else /* HAVE_NATIVE_mpn_addlsh_n */
+ xp2[n] = mpn_addlsh_n (xp2, xp, xp + 2*n, n, 2);
+
+ cy = mpn_addlsh_n (tp, xp + n, xp + 3*n, x3n, 2);
+#endif
+ if (x3n < n)
+ cy = mpn_add_1 (tp + x3n, xp + n + x3n, n - x3n, cy);
+ tp[n] = cy;
+#else
+ cy = mpn_lshift (tp, xp + 2*n, n, 2);
+ xp2[n] = cy + mpn_add_n (xp2, tp, xp, n);
+
+ tp[x3n] = mpn_lshift (tp, xp + 3*n, x3n, 2);
+ if (x3n < n)
+ tp[n] = mpn_add (tp, xp + n, n, tp, x3n + 1);
+ else
+ tp[n] += mpn_add_n (tp, xp + n, tp, n);
+#endif
+ mpn_lshift (tp, tp, n+1, 1);
+
+ neg = (mpn_cmp (xp2, tp, n + 1) < 0) ? ~0 : 0;
+
+#if HAVE_NATIVE_mpn_add_n_sub_n
+ if (neg)
+ mpn_add_n_sub_n (xp2, xm2, tp, xp2, n + 1);
+ else
+ mpn_add_n_sub_n (xp2, xm2, xp2, tp, n + 1);
+#else
+ if (neg)
+ mpn_sub_n (xm2, tp, xp2, n + 1);
+ else
+ mpn_sub_n (xm2, xp2, tp, n + 1);
+
+ mpn_add_n (xp2, xp2, tp, n + 1);
+#endif
+
+ ASSERT (xp2[n] < 15);
+ ASSERT (xm2[n] < 10);
+
+ return neg;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/toom_eval_pm1.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/toom_eval_pm1.c
new file mode 100644
index 00000000000..2334b0aff4a
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/toom_eval_pm1.c
@@ -0,0 +1,90 @@
+/* mpn_toom_eval_pm1 -- Evaluate a polynomial in +1 and -1
+
+ Contributed to the GNU project by Niels Möller
+
+ THE FUNCTION IN THIS FILE IS INTERNAL WITH A MUTABLE INTERFACE. IT IS ONLY
+ 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 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.h"
+#include "gmp-impl.h"
+
+/* Evaluates a polynomial of degree k > 3, in the points +1 and -1. */
+int
+mpn_toom_eval_pm1 (mp_ptr xp1, mp_ptr xm1, unsigned k,
+ mp_srcptr xp, mp_size_t n, mp_size_t hn, mp_ptr tp)
+{
+ unsigned i;
+ int neg;
+
+ ASSERT (k >= 4);
+
+ ASSERT (hn > 0);
+ ASSERT (hn <= n);
+
+ /* The degree k is also the number of full-size coefficients, so
+ * that last coefficient, of size hn, starts at xp + k*n. */
+
+ xp1[n] = mpn_add_n (xp1, xp, xp + 2*n, n);
+ for (i = 4; i < k; i += 2)
+ ASSERT_NOCARRY (mpn_add (xp1, xp1, n+1, xp+i*n, n));
+
+ tp[n] = mpn_add_n (tp, xp + n, xp + 3*n, n);
+ for (i = 5; i < k; i += 2)
+ ASSERT_NOCARRY (mpn_add (tp, tp, n+1, xp+i*n, n));
+
+ if (k & 1)
+ ASSERT_NOCARRY (mpn_add (tp, tp, n+1, xp+k*n, hn));
+ else
+ ASSERT_NOCARRY (mpn_add (xp1, xp1, n+1, xp+k*n, hn));
+
+ neg = (mpn_cmp (xp1, tp, n + 1) < 0) ? ~0 : 0;
+
+#if HAVE_NATIVE_mpn_add_n_sub_n
+ if (neg)
+ mpn_add_n_sub_n (xp1, xm1, tp, xp1, n + 1);
+ else
+ mpn_add_n_sub_n (xp1, xm1, xp1, tp, n + 1);
+#else
+ if (neg)
+ mpn_sub_n (xm1, tp, xp1, n + 1);
+ else
+ mpn_sub_n (xm1, xp1, tp, n + 1);
+
+ mpn_add_n (xp1, xp1, tp, n + 1);
+#endif
+
+ ASSERT (xp1[n] <= k);
+ ASSERT (xm1[n] <= k/2 + 1);
+
+ return neg;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/toom_eval_pm2.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/toom_eval_pm2.c
new file mode 100644
index 00000000000..67afcc638ef
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/toom_eval_pm2.c
@@ -0,0 +1,131 @@
+/* mpn_toom_eval_pm2 -- Evaluate a polynomial in +2 and -2
+
+ Contributed to the GNU project by Niels Möller and Marco Bodrato
+
+ THE FUNCTION IN THIS FILE IS INTERNAL WITH A MUTABLE INTERFACE. IT IS ONLY
+ 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 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.h"
+#include "gmp-impl.h"
+
+/* DO_addlsh2(d,a,b,n,cy) computes cy,{d,n} <- {a,n} + 4*(cy,{b,n}), it
+ can be used as DO_addlsh2(d,a,d,n,d[n]), for accumulation on {d,n+1}. */
+#if HAVE_NATIVE_mpn_addlsh2_n
+#define DO_addlsh2(d, a, b, n, cy) \
+do { \
+ (cy) <<= 2; \
+ (cy) += mpn_addlsh2_n(d, a, b, n); \
+} while (0)
+#else
+#if HAVE_NATIVE_mpn_addlsh_n
+#define DO_addlsh2(d, a, b, n, cy) \
+do { \
+ (cy) <<= 2; \
+ (cy) += mpn_addlsh_n(d, a, b, n, 2); \
+} while (0)
+#else
+/* The following is not a general substitute for addlsh2.
+ It is correct if d == b, but it is not if d == a. */
+#define DO_addlsh2(d, a, b, n, cy) \
+do { \
+ (cy) <<= 2; \
+ (cy) += mpn_lshift(d, b, n, 2); \
+ (cy) += mpn_add_n(d, d, a, n); \
+} while (0)
+#endif
+#endif
+
+/* Evaluates a polynomial of degree 2 < k < GMP_NUMB_BITS, in the
+ points +2 and -2. */
+int
+mpn_toom_eval_pm2 (mp_ptr xp2, mp_ptr xm2, unsigned k,
+ mp_srcptr xp, mp_size_t n, mp_size_t hn, mp_ptr tp)
+{
+ int i;
+ int neg;
+ mp_limb_t cy;
+
+ ASSERT (k >= 3);
+ ASSERT (k < GMP_NUMB_BITS);
+
+ ASSERT (hn > 0);
+ ASSERT (hn <= n);
+
+ /* The degree k is also the number of full-size coefficients, so
+ * that last coefficient, of size hn, starts at xp + k*n. */
+
+ cy = 0;
+ DO_addlsh2 (xp2, xp + (k-2) * n, xp + k * n, hn, cy);
+ if (hn != n)
+ cy = mpn_add_1 (xp2 + hn, xp + (k-2) * n + hn, n - hn, cy);
+ for (i = k - 4; i >= 0; i -= 2)
+ DO_addlsh2 (xp2, xp + i * n, xp2, n, cy);
+ xp2[n] = cy;
+
+ k--;
+
+ cy = 0;
+ DO_addlsh2 (tp, xp + (k-2) * n, xp + k * n, n, cy);
+ for (i = k - 4; i >= 0; i -= 2)
+ DO_addlsh2 (tp, xp + i * n, tp, n, cy);
+ tp[n] = cy;
+
+ if (k & 1)
+ ASSERT_NOCARRY(mpn_lshift (tp , tp , n + 1, 1));
+ else
+ ASSERT_NOCARRY(mpn_lshift (xp2, xp2, n + 1, 1));
+
+ neg = (mpn_cmp (xp2, tp, n + 1) < 0) ? ~0 : 0;
+
+#if HAVE_NATIVE_mpn_add_n_sub_n
+ if (neg)
+ mpn_add_n_sub_n (xp2, xm2, tp, xp2, n + 1);
+ else
+ mpn_add_n_sub_n (xp2, xm2, xp2, tp, n + 1);
+#else /* !HAVE_NATIVE_mpn_add_n_sub_n */
+ if (neg)
+ mpn_sub_n (xm2, tp, xp2, n + 1);
+ else
+ mpn_sub_n (xm2, xp2, tp, n + 1);
+
+ mpn_add_n (xp2, xp2, tp, n + 1);
+#endif /* !HAVE_NATIVE_mpn_add_n_sub_n */
+
+ ASSERT (xp2[n] < (1<<(k+2))-1);
+ ASSERT (xm2[n] < ((1<<(k+3))-1 - (1^k&1))/3);
+
+ neg ^= ((k & 1) - 1);
+
+ return neg;
+}
+
+#undef DO_addlsh2
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/toom_eval_pm2exp.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/toom_eval_pm2exp.c
new file mode 100644
index 00000000000..b178fcac244
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/toom_eval_pm2exp.c
@@ -0,0 +1,128 @@
+/* mpn_toom_eval_pm2exp -- Evaluate a polynomial in +2^k and -2^k
+
+ Contributed to the GNU project by Niels Möller
+
+ THE FUNCTION IN THIS FILE IS INTERNAL WITH A MUTABLE INTERFACE. IT IS ONLY
+ 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 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.h"
+#include "gmp-impl.h"
+
+/* Evaluates a polynomial of degree k > 2, in the points +2^shift and -2^shift. */
+int
+mpn_toom_eval_pm2exp (mp_ptr xp2, mp_ptr xm2, unsigned k,
+ mp_srcptr xp, mp_size_t n, mp_size_t hn, unsigned shift,
+ mp_ptr tp)
+{
+ unsigned i;
+ int neg;
+#if HAVE_NATIVE_mpn_addlsh_n
+ mp_limb_t cy;
+#endif
+
+ ASSERT (k >= 3);
+ ASSERT (shift*k < GMP_NUMB_BITS);
+
+ ASSERT (hn > 0);
+ ASSERT (hn <= n);
+
+ /* The degree k is also the number of full-size coefficients, so
+ * that last coefficient, of size hn, starts at xp + k*n. */
+
+#if HAVE_NATIVE_mpn_addlsh_n
+ xp2[n] = mpn_addlsh_n (xp2, xp, xp + 2*n, n, 2*shift);
+ for (i = 4; i < k; i += 2)
+ xp2[n] += mpn_addlsh_n (xp2, xp2, xp + i*n, n, i*shift);
+
+ tp[n] = mpn_lshift (tp, xp+n, n, shift);
+ for (i = 3; i < k; i+= 2)
+ tp[n] += mpn_addlsh_n (tp, tp, xp+i*n, n, i*shift);
+
+ if (k & 1)
+ {
+ cy = mpn_addlsh_n (tp, tp, xp+k*n, hn, k*shift);
+ MPN_INCR_U (tp + hn, n+1 - hn, cy);
+ }
+ else
+ {
+ cy = mpn_addlsh_n (xp2, xp2, xp+k*n, hn, k*shift);
+ MPN_INCR_U (xp2 + hn, n+1 - hn, cy);
+ }
+
+#else /* !HAVE_NATIVE_mpn_addlsh_n */
+ xp2[n] = mpn_lshift (tp, xp+2*n, n, 2*shift);
+ xp2[n] += mpn_add_n (xp2, xp, tp, n);
+ for (i = 4; i < k; i += 2)
+ {
+ xp2[n] += mpn_lshift (tp, xp + i*n, n, i*shift);
+ xp2[n] += mpn_add_n (xp2, xp2, tp, n);
+ }
+
+ tp[n] = mpn_lshift (tp, xp+n, n, shift);
+ for (i = 3; i < k; i+= 2)
+ {
+ tp[n] += mpn_lshift (xm2, xp + i*n, n, i*shift);
+ tp[n] += mpn_add_n (tp, tp, xm2, n);
+ }
+
+ xm2[hn] = mpn_lshift (xm2, xp + k*n, hn, k*shift);
+ if (k & 1)
+ mpn_add (tp, tp, n+1, xm2, hn+1);
+ else
+ mpn_add (xp2, xp2, n+1, xm2, hn+1);
+#endif /* !HAVE_NATIVE_mpn_addlsh_n */
+
+ neg = (mpn_cmp (xp2, tp, n + 1) < 0) ? ~0 : 0;
+
+#if HAVE_NATIVE_mpn_add_n_sub_n
+ if (neg)
+ mpn_add_n_sub_n (xp2, xm2, tp, xp2, n + 1);
+ else
+ mpn_add_n_sub_n (xp2, xm2, xp2, tp, n + 1);
+#else /* !HAVE_NATIVE_mpn_add_n_sub_n */
+ if (neg)
+ mpn_sub_n (xm2, tp, xp2, n + 1);
+ else
+ mpn_sub_n (xm2, xp2, tp, n + 1);
+
+ mpn_add_n (xp2, xp2, tp, n + 1);
+#endif /* !HAVE_NATIVE_mpn_add_n_sub_n */
+
+ /* FIXME: the following asserts are useless if (k+1)*shift >= GMP_LIMB_BITS */
+ ASSERT ((k+1)*shift >= GMP_LIMB_BITS ||
+ xp2[n] < ((CNST_LIMB(1)<<((k+1)*shift))-1)/((CNST_LIMB(1)<<shift)-1));
+ ASSERT ((k+2)*shift >= GMP_LIMB_BITS ||
+ xm2[n] < ((CNST_LIMB(1)<<((k+2)*shift))-((k&1)?(CNST_LIMB(1)<<shift):1))/((CNST_LIMB(1)<<(2*shift))-1));
+
+ return neg;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/toom_eval_pm2rexp.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/toom_eval_pm2rexp.c
new file mode 100644
index 00000000000..3cac46bd905
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/toom_eval_pm2rexp.c
@@ -0,0 +1,102 @@
+/* mpn_toom_eval_pm2rexp -- Evaluate a polynomial in +2^-k and -2^-k
+
+ Contributed to the GNU project by Marco Bodrato
+
+ THE FUNCTION IN THIS FILE IS INTERNAL WITH A MUTABLE INTERFACE. IT IS ONLY
+ 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 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.h"
+#include "gmp-impl.h"
+
+#if HAVE_NATIVE_mpn_addlsh_n
+#define DO_mpn_addlsh_n(dst,src,n,s,ws) mpn_addlsh_n(dst,dst,src,n,s)
+#else
+static mp_limb_t
+DO_mpn_addlsh_n(mp_ptr dst, mp_srcptr src, mp_size_t n, unsigned int s, mp_ptr ws)
+{
+#if USE_MUL_1 && 0
+ return mpn_addmul_1(dst,src,n,CNST_LIMB(1) <<(s));
+#else
+ mp_limb_t __cy;
+ __cy = mpn_lshift(ws,src,n,s);
+ return __cy + mpn_add_n(dst,dst,ws,n);
+#endif
+}
+#endif
+
+/* Evaluates a polynomial of degree k >= 3. */
+int
+mpn_toom_eval_pm2rexp (mp_ptr rp, mp_ptr rm,
+ unsigned int q, mp_srcptr ap, mp_size_t n, mp_size_t t,
+ unsigned int s, mp_ptr ws)
+{
+ unsigned int i;
+ int neg;
+ /* {ap,q*n+t} -> {rp,n+1} {rm,n+1} , with {ws, n+1}*/
+ ASSERT (n >= t);
+ ASSERT (s != 0); /* or _eval_pm1 should be used */
+ ASSERT (q > 1);
+ ASSERT (s*q < GMP_NUMB_BITS);
+ rp[n] = mpn_lshift(rp, ap, n, s*q);
+ ws[n] = mpn_lshift(ws, ap+n, n, s*(q-1));
+ if( (q & 1) != 0) {
+ ASSERT_NOCARRY(mpn_add(ws,ws,n+1,ap+n*q,t));
+ rp[n] += DO_mpn_addlsh_n(rp, ap+n*(q-1), n, s, rm);
+ } else {
+ ASSERT_NOCARRY(mpn_add(rp,rp,n+1,ap+n*q,t));
+ }
+ for(i=2; i<q-1; i++)
+ {
+ rp[n] += DO_mpn_addlsh_n(rp, ap+n*i, n, s*(q-i), rm);
+ i++;
+ ws[n] += DO_mpn_addlsh_n(ws, ap+n*i, n, s*(q-i), rm);
+ };
+
+ neg = (mpn_cmp (rp, ws, n + 1) < 0) ? ~0 : 0;
+
+#if HAVE_NATIVE_mpn_add_n_sub_n
+ if (neg)
+ mpn_add_n_sub_n (rp, rm, ws, rp, n + 1);
+ else
+ mpn_add_n_sub_n (rp, rm, rp, ws, n + 1);
+#else /* !HAVE_NATIVE_mpn_add_n_sub_n */
+ if (neg)
+ mpn_sub_n (rm, ws, rp, n + 1);
+ else
+ mpn_sub_n (rm, rp, ws, n + 1);
+
+ ASSERT_NOCARRY (mpn_add_n (rp, rp, ws, n + 1));
+#endif /* !HAVE_NATIVE_mpn_add_n_sub_n */
+
+ return neg;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/toom_interpolate_12pts.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/toom_interpolate_12pts.c
new file mode 100644
index 00000000000..180b0329a36
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/toom_interpolate_12pts.c
@@ -0,0 +1,361 @@
+/* Interpolation for the algorithm Toom-Cook 6.5-way.
+
+ Contributed to the GNU project by Marco Bodrato.
+
+ THE FUNCTION IN THIS FILE IS INTERNAL WITH A MUTABLE INTERFACE. IT IS ONLY
+ 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.
+
+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.h"
+#include "gmp-impl.h"
+
+
+#if HAVE_NATIVE_mpn_sublsh_n
+#define DO_mpn_sublsh_n(dst,src,n,s,ws) mpn_sublsh_n(dst,dst,src,n,s)
+#else
+static mp_limb_t
+DO_mpn_sublsh_n(mp_ptr dst, mp_srcptr src, mp_size_t n, unsigned int s, mp_ptr ws)
+{
+#if USE_MUL_1 && 0
+ return mpn_submul_1(dst,src,n,CNST_LIMB(1) <<(s));
+#else
+ mp_limb_t __cy;
+ __cy = mpn_lshift(ws,src,n,s);
+ return __cy + mpn_sub_n(dst,dst,ws,n);
+#endif
+}
+#endif
+
+#if HAVE_NATIVE_mpn_addlsh_n
+#define DO_mpn_addlsh_n(dst,src,n,s,ws) mpn_addlsh_n(dst,dst,src,n,s)
+#else
+static mp_limb_t
+DO_mpn_addlsh_n(mp_ptr dst, mp_srcptr src, mp_size_t n, unsigned int s, mp_ptr ws)
+{
+#if USE_MUL_1 && 0
+ return mpn_addmul_1(dst,src,n,CNST_LIMB(1) <<(s));
+#else
+ mp_limb_t __cy;
+ __cy = mpn_lshift(ws,src,n,s);
+ return __cy + mpn_add_n(dst,dst,ws,n);
+#endif
+}
+#endif
+
+#if HAVE_NATIVE_mpn_subrsh
+#define DO_mpn_subrsh(dst,nd,src,ns,s,ws) mpn_subrsh(dst,nd,src,ns,s)
+#else
+/* FIXME: This is not a correct definition, it assumes no carry */
+#define DO_mpn_subrsh(dst,nd,src,ns,s,ws) \
+do { \
+ mp_limb_t __cy; \
+ MPN_DECR_U (dst, nd, src[0] >> s); \
+ __cy = DO_mpn_sublsh_n (dst, src + 1, ns - 1, GMP_NUMB_BITS - s, ws); \
+ MPN_DECR_U (dst + ns - 1, nd - ns + 1, __cy); \
+} while (0)
+#endif
+
+
+#if GMP_NUMB_BITS < 21
+#error Not implemented: Both sublsh_n(,,,20) should be corrected.
+#endif
+
+#if GMP_NUMB_BITS < 16
+#error Not implemented: divexact_by42525 needs splitting.
+#endif
+
+#if GMP_NUMB_BITS < 12
+#error Not implemented: Hard to adapt...
+#endif
+
+/* FIXME: tuneup should decide the best variant */
+#ifndef AORSMUL_FASTER_AORS_AORSLSH
+#define AORSMUL_FASTER_AORS_AORSLSH 1
+#endif
+#ifndef AORSMUL_FASTER_AORS_2AORSLSH
+#define AORSMUL_FASTER_AORS_2AORSLSH 1
+#endif
+#ifndef AORSMUL_FASTER_2AORSLSH
+#define AORSMUL_FASTER_2AORSLSH 1
+#endif
+#ifndef AORSMUL_FASTER_3AORSLSH
+#define AORSMUL_FASTER_3AORSLSH 1
+#endif
+
+#define BINVERT_9 \
+ ((((GMP_NUMB_MAX / 9) << (6 - GMP_NUMB_BITS % 6)) * 8 & GMP_NUMB_MAX) | 0x39)
+
+#define BINVERT_255 \
+ (GMP_NUMB_MAX - ((GMP_NUMB_MAX / 255) << (8 - GMP_NUMB_BITS % 8)))
+
+ /* FIXME: find some more general expressions for 2835^-1, 42525^-1 */
+#if GMP_LIMB_BITS == 32
+#define BINVERT_2835 (GMP_NUMB_MASK & CNST_LIMB(0x53E3771B))
+#define BINVERT_42525 (GMP_NUMB_MASK & CNST_LIMB(0x9F314C35))
+#else
+#if GMP_LIMB_BITS == 64
+#define BINVERT_2835 (GMP_NUMB_MASK & CNST_LIMB(0x938CC70553E3771B))
+#define BINVERT_42525 (GMP_NUMB_MASK & CNST_LIMB(0xE7B40D449F314C35))
+#endif
+#endif
+
+#ifndef mpn_divexact_by255
+#if GMP_NUMB_BITS % 8 == 0
+#define mpn_divexact_by255(dst,src,size) \
+ (255 & 1 * mpn_bdiv_dbm1 (dst, src, size, __GMP_CAST (mp_limb_t, GMP_NUMB_MASK / 255)))
+#else
+#if HAVE_NATIVE_mpn_pi1_bdiv_q_1
+#define mpn_divexact_by255(dst,src,size) mpn_pi1_bdiv_q_1(dst,src,size,CNST_LIMB(255),BINVERT_255,0)
+#else
+#define mpn_divexact_by255(dst,src,size) mpn_divexact_1(dst,src,size,CNST_LIMB(255))
+#endif
+#endif
+#endif
+
+#ifndef mpn_divexact_by9x4
+#if HAVE_NATIVE_mpn_pi1_bdiv_q_1
+#define mpn_divexact_by9x4(dst,src,size) mpn_pi1_bdiv_q_1(dst,src,size,CNST_LIMB(9),BINVERT_9,2)
+#else
+#define mpn_divexact_by9x4(dst,src,size) mpn_divexact_1(dst,src,size,CNST_LIMB(9)<<2)
+#endif
+#endif
+
+#ifndef mpn_divexact_by42525
+#if HAVE_NATIVE_mpn_pi1_bdiv_q_1 && defined(BINVERT_42525)
+#define mpn_divexact_by42525(dst,src,size) mpn_pi1_bdiv_q_1(dst,src,size,CNST_LIMB(42525),BINVERT_42525,0)
+#else
+#define mpn_divexact_by42525(dst,src,size) mpn_divexact_1(dst,src,size,CNST_LIMB(42525))
+#endif
+#endif
+
+#ifndef mpn_divexact_by2835x4
+#if HAVE_NATIVE_mpn_pi1_bdiv_q_1 && defined(BINVERT_2835)
+#define mpn_divexact_by2835x4(dst,src,size) mpn_pi1_bdiv_q_1(dst,src,size,CNST_LIMB(2835),BINVERT_2835,2)
+#else
+#define mpn_divexact_by2835x4(dst,src,size) mpn_divexact_1(dst,src,size,CNST_LIMB(2835)<<2)
+#endif
+#endif
+
+/* Interpolation for Toom-6.5 (or Toom-6), using the evaluation
+ points: infinity(6.5 only), +-4, +-2, +-1, +-1/4, +-1/2, 0. More precisely,
+ 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,
+ r1 = f(4),f(-4),
+ r2 = f(2),f(-2),
+ r3 = f(1),f(-1),
+ r4 = f(1/4),f(-1/4),
+ r5 = f(1/2),f(-1/2),
+ r6 = f(0).
+
+ All couples of the form f(n),f(-n) must be already mixed with
+ toom_couple_handling(f(n),...,f(-n),...)
+
+ The result is stored in {pp, spt + 7*n (or 6*n)}.
+ At entry, r6 is stored at {pp, 2n},
+ r4 is stored at {pp + 3n, 3n + 1}.
+ r2 is stored at {pp + 7n, 3n + 1}.
+ r0 is stored at {pp +11n, spt}.
+
+ The other values are 3n+1 limbs each (with most significant limbs small).
+
+ Negative intermediate results are stored two-complemented.
+ Inputs are destroyed.
+*/
+
+void
+mpn_toom_interpolate_12pts (mp_ptr pp, mp_ptr r1, mp_ptr r3, mp_ptr r5,
+ mp_size_t n, mp_size_t spt, int half, mp_ptr wsi)
+{
+ mp_limb_t cy;
+ mp_size_t n3;
+ mp_size_t n3p1;
+ n3 = 3 * n;
+ n3p1 = n3 + 1;
+
+#define r4 (pp + n3) /* 3n+1 */
+#define r2 (pp + 7 * n) /* 3n+1 */
+#define r0 (pp +11 * n) /* s+t <= 2*n */
+
+ /******************************* interpolation *****************************/
+ if (half != 0) {
+ cy = mpn_sub_n (r3, r3, r0, spt);
+ MPN_DECR_U (r3 + spt, n3p1 - spt, cy);
+
+ cy = DO_mpn_sublsh_n (r2, r0, spt, 10, wsi);
+ MPN_DECR_U (r2 + spt, n3p1 - spt, cy);
+ DO_mpn_subrsh(r5, n3p1, r0, spt, 2, wsi);
+
+ cy = DO_mpn_sublsh_n (r1, r0, spt, 20, wsi);
+ MPN_DECR_U (r1 + spt, n3p1 - spt, cy);
+ DO_mpn_subrsh(r4, n3p1, r0, spt, 4, wsi);
+ };
+
+ r4[n3] -= DO_mpn_sublsh_n (r4 + n, pp, 2 * n, 20, wsi);
+ DO_mpn_subrsh(r1 + n, 2 * n + 1, pp, 2 * n, 4, wsi);
+
+#if HAVE_NATIVE_mpn_add_n_sub_n
+ mpn_add_n_sub_n (r1, r4, r4, r1, n3p1);
+#else
+ ASSERT_NOCARRY(mpn_add_n (wsi, r1, r4, n3p1));
+ mpn_sub_n (r4, r4, r1, n3p1); /* can be negative */
+ MP_PTR_SWAP(r1, wsi);
+#endif
+
+ r5[n3] -= DO_mpn_sublsh_n (r5 + n, pp, 2 * n, 10, wsi);
+ DO_mpn_subrsh(r2 + n, 2 * n + 1, pp, 2 * n, 2, wsi);
+
+#if HAVE_NATIVE_mpn_add_n_sub_n
+ mpn_add_n_sub_n (r2, r5, r5, r2, n3p1);
+#else
+ mpn_sub_n (wsi, r5, r2, n3p1); /* can be negative */
+ ASSERT_NOCARRY(mpn_add_n (r2, r2, r5, n3p1));
+ MP_PTR_SWAP(r5, wsi);
+#endif
+
+ r3[n3] -= mpn_sub_n (r3+n, r3+n, pp, 2 * n);
+
+#if AORSMUL_FASTER_AORS_AORSLSH
+ mpn_submul_1 (r4, r5, n3p1, 257); /* can be negative */
+#else
+ mpn_sub_n (r4, r4, r5, n3p1); /* can be negative */
+ DO_mpn_sublsh_n (r4, r5, n3p1, 8, wsi); /* can be negative */
+#endif
+ /* A division by 2835x4 follows. Warning: the operand can be negative! */
+ mpn_divexact_by2835x4(r4, r4, n3p1);
+ if ((r4[n3] & (GMP_NUMB_MAX << (GMP_NUMB_BITS-3))) != 0)
+ r4[n3] |= (GMP_NUMB_MAX << (GMP_NUMB_BITS-2));
+
+#if AORSMUL_FASTER_2AORSLSH
+ mpn_addmul_1 (r5, r4, n3p1, 60); /* can be negative */
+#else
+ DO_mpn_sublsh_n (r5, r4, n3p1, 2, wsi); /* can be negative */
+ DO_mpn_addlsh_n (r5, r4, n3p1, 6, wsi); /* can give a carry */
+#endif
+ mpn_divexact_by255(r5, r5, n3p1);
+
+ ASSERT_NOCARRY(DO_mpn_sublsh_n (r2, r3, n3p1, 5, wsi));
+
+#if AORSMUL_FASTER_3AORSLSH
+ ASSERT_NOCARRY(mpn_submul_1 (r1, r2, n3p1, 100));
+#else
+ ASSERT_NOCARRY(DO_mpn_sublsh_n (r1, r2, n3p1, 6, wsi));
+ ASSERT_NOCARRY(DO_mpn_sublsh_n (r1, r2, n3p1, 5, wsi));
+ ASSERT_NOCARRY(DO_mpn_sublsh_n (r1, r2, n3p1, 2, wsi));
+#endif
+ ASSERT_NOCARRY(DO_mpn_sublsh_n (r1, r3, n3p1, 9, wsi));
+ mpn_divexact_by42525(r1, r1, n3p1);
+
+#if AORSMUL_FASTER_AORS_2AORSLSH
+ ASSERT_NOCARRY(mpn_submul_1 (r2, r1, n3p1, 225));
+#else
+ ASSERT_NOCARRY(mpn_sub_n (r2, r2, r1, n3p1));
+ ASSERT_NOCARRY(DO_mpn_addlsh_n (r2, r1, n3p1, 5, wsi));
+ ASSERT_NOCARRY(DO_mpn_sublsh_n (r2, r1, n3p1, 8, wsi));
+#endif
+ mpn_divexact_by9x4(r2, r2, n3p1);
+
+ ASSERT_NOCARRY(mpn_sub_n (r3, r3, r2, n3p1));
+
+ mpn_sub_n (r4, r2, r4, n3p1);
+ ASSERT_NOCARRY(mpn_rshift(r4, r4, n3p1, 1));
+ ASSERT_NOCARRY(mpn_sub_n (r2, r2, r4, n3p1));
+
+ mpn_add_n (r5, r5, r1, n3p1);
+ ASSERT_NOCARRY(mpn_rshift(r5, r5, n3p1, 1));
+
+ /* last interpolation steps... */
+ ASSERT_NOCARRY(mpn_sub_n (r3, r3, r1, n3p1));
+ ASSERT_NOCARRY(mpn_sub_n (r1, r1, r5, n3p1));
+ /* ... could be mixed with recomposition
+ ||H-r5|M-r5|L-r5| ||H-r1|M-r1|L-r1|
+ */
+
+ /***************************** recomposition *******************************/
+ /*
+ pp[] prior to operations:
+ |M r0|L r0|___||H r2|M r2|L r2|___||H r4|M r4|L r4|____|H_r6|L r6|pp
+
+ summation scheme for remaining operations:
+ |__12|n_11|n_10|n__9|n__8|n__7|n__6|n__5|n__4|n__3|n__2|n___|n___|pp
+ |M r0|L r0|___||H r2|M r2|L r2|___||H r4|M r4|L r4|____|H_r6|L r6|pp
+ ||H r1|M r1|L r1| ||H r3|M r3|L r3| ||H_r5|M_r5|L_r5|
+ */
+
+ cy = mpn_add_n (pp + n, pp + n, r5, n);
+ cy = mpn_add_1 (pp + 2 * n, r5 + n, n, cy);
+#if HAVE_NATIVE_mpn_add_nc
+ cy = r5[n3] + mpn_add_nc(pp + n3, pp + n3, r5 + 2 * n, n, cy);
+#else
+ MPN_INCR_U (r5 + 2 * n, n + 1, cy);
+ cy = r5[n3] + mpn_add_n (pp + n3, pp + n3, r5 + 2 * n, n);
+#endif
+ MPN_INCR_U (pp + n3 + n, 2 * n + 1, cy);
+
+ pp[2 * n3]+= mpn_add_n (pp + 5 * n, pp + 5 * n, r3, n);
+ cy = mpn_add_1 (pp + 2 * n3, r3 + n, n, pp[2 * n3]);
+#if HAVE_NATIVE_mpn_add_nc
+ cy = r3[n3] + mpn_add_nc(pp + 7 * n, pp + 7 * n, r3 + 2 * n, n, cy);
+#else
+ MPN_INCR_U (r3 + 2 * n, n + 1, cy);
+ cy = r3[n3] + mpn_add_n (pp + 7 * n, pp + 7 * n, r3 + 2 * n, n);
+#endif
+ MPN_INCR_U (pp + 8 * n, 2 * n + 1, cy);
+
+ pp[10*n]+=mpn_add_n (pp + 9 * n, pp + 9 * n, r1, n);
+ if (half) {
+ cy = mpn_add_1 (pp + 10 * n, r1 + n, n, pp[10 * n]);
+#if HAVE_NATIVE_mpn_add_nc
+ if (LIKELY (spt > n)) {
+ cy = r1[n3] + mpn_add_nc(pp + 11 * n, pp + 11 * n, r1 + 2 * n, n, cy);
+ MPN_INCR_U (pp + 4 * n3, spt - n, cy);
+ } else {
+ ASSERT_NOCARRY(mpn_add_nc(pp + 11 * n, pp + 11 * n, r1 + 2 * n, spt, cy));
+ }
+#else
+ MPN_INCR_U (r1 + 2 * n, n + 1, cy);
+ if (LIKELY (spt > n)) {
+ cy = r1[n3] + mpn_add_n (pp + 11 * n, pp + 11 * n, r1 + 2 * n, n);
+ MPN_INCR_U (pp + 4 * n3, spt - n, cy);
+ } else {
+ ASSERT_NOCARRY(mpn_add_n (pp + 11 * n, pp + 11 * n, r1 + 2 * n, spt));
+ }
+#endif
+ } else {
+ ASSERT_NOCARRY(mpn_add_1 (pp + 10 * n, r1 + n, spt, pp[10 * n]));
+ }
+
+#undef r0
+#undef r2
+#undef r4
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/toom_interpolate_16pts.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/toom_interpolate_16pts.c
new file mode 100644
index 00000000000..5afe6641f67
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/toom_interpolate_16pts.c
@@ -0,0 +1,527 @@
+/* Interpolation for the algorithm Toom-Cook 8.5-way.
+
+ Contributed to the GNU project by Marco Bodrato.
+
+ THE FUNCTION IN THIS FILE IS INTERNAL WITH A MUTABLE INTERFACE. IT IS ONLY
+ 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.
+
+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.h"
+#include "gmp-impl.h"
+
+#if GMP_NUMB_BITS < 29
+#error Not implemented: Both sublsh_n(,,,28) should be corrected; r2 and r5 need one more LIMB.
+#endif
+
+#if GMP_NUMB_BITS < 28
+#error Not implemented: divexact_by188513325 and _by182712915 will not work.
+#endif
+
+
+#if HAVE_NATIVE_mpn_sublsh_n
+#define DO_mpn_sublsh_n(dst,src,n,s,ws) mpn_sublsh_n(dst,dst,src,n,s)
+#else
+static mp_limb_t
+DO_mpn_sublsh_n(mp_ptr dst, mp_srcptr src, mp_size_t n, unsigned int s, mp_ptr ws)
+{
+#if USE_MUL_1 && 0
+ return mpn_submul_1(dst,src,n,CNST_LIMB(1) <<(s));
+#else
+ mp_limb_t __cy;
+ __cy = mpn_lshift(ws,src,n,s);
+ return __cy + mpn_sub_n(dst,dst,ws,n);
+#endif
+}
+#endif
+
+#if HAVE_NATIVE_mpn_addlsh_n
+#define DO_mpn_addlsh_n(dst,src,n,s,ws) mpn_addlsh_n(dst,dst,src,n,s)
+#else
+static mp_limb_t
+DO_mpn_addlsh_n(mp_ptr dst, mp_srcptr src, mp_size_t n, unsigned int s, mp_ptr ws)
+{
+#if USE_MUL_1 && 0
+ return mpn_addmul_1(dst,src,n,CNST_LIMB(1) <<(s));
+#else
+ mp_limb_t __cy;
+ __cy = mpn_lshift(ws,src,n,s);
+ return __cy + mpn_add_n(dst,dst,ws,n);
+#endif
+}
+#endif
+
+#if HAVE_NATIVE_mpn_subrsh
+#define DO_mpn_subrsh(dst,nd,src,ns,s,ws) mpn_subrsh(dst,nd,src,ns,s)
+#else
+/* FIXME: This is not a correct definition, it assumes no carry */
+#define DO_mpn_subrsh(dst,nd,src,ns,s,ws) \
+do { \
+ mp_limb_t __cy; \
+ MPN_DECR_U (dst, nd, src[0] >> s); \
+ __cy = DO_mpn_sublsh_n (dst, src + 1, ns - 1, GMP_NUMB_BITS - s, ws); \
+ MPN_DECR_U (dst + ns - 1, nd - ns + 1, __cy); \
+} while (0)
+#endif
+
+
+/* FIXME: tuneup should decide the best variant */
+#ifndef AORSMUL_FASTER_AORS_AORSLSH
+#define AORSMUL_FASTER_AORS_AORSLSH 1
+#endif
+#ifndef AORSMUL_FASTER_AORS_2AORSLSH
+#define AORSMUL_FASTER_AORS_2AORSLSH 1
+#endif
+#ifndef AORSMUL_FASTER_2AORSLSH
+#define AORSMUL_FASTER_2AORSLSH 1
+#endif
+#ifndef AORSMUL_FASTER_3AORSLSH
+#define AORSMUL_FASTER_3AORSLSH 1
+#endif
+
+#if GMP_NUMB_BITS < 43
+#define BIT_CORRECTION 1
+#define CORRECTION_BITS GMP_NUMB_BITS
+#else
+#define BIT_CORRECTION 0
+#define CORRECTION_BITS 0
+#endif
+
+#define BINVERT_9 \
+ ((((GMP_NUMB_MAX / 9) << (6 - GMP_NUMB_BITS % 6)) * 8 & GMP_NUMB_MAX) | 0x39)
+
+#define BINVERT_255 \
+ (GMP_NUMB_MAX - ((GMP_NUMB_MAX / 255) << (8 - GMP_NUMB_BITS % 8)))
+
+ /* FIXME: find some more general expressions for inverses */
+#if GMP_LIMB_BITS == 32
+#define BINVERT_2835 (GMP_NUMB_MASK & CNST_LIMB(0x53E3771B))
+#define BINVERT_42525 (GMP_NUMB_MASK & CNST_LIMB(0x9F314C35))
+#define BINVERT_182712915 (GMP_NUMB_MASK & CNST_LIMB(0x550659DB))
+#define BINVERT_188513325 (GMP_NUMB_MASK & CNST_LIMB(0xFBC333A5))
+#define BINVERT_255x182712915L (GMP_NUMB_MASK & CNST_LIMB(0x6FC4CB25))
+#define BINVERT_255x188513325L (GMP_NUMB_MASK & CNST_LIMB(0x6864275B))
+#if GMP_NAIL_BITS == 0
+#define BINVERT_255x182712915H CNST_LIMB(0x1B649A07)
+#define BINVERT_255x188513325H CNST_LIMB(0x06DB993A)
+#else /* GMP_NAIL_BITS != 0 */
+#define BINVERT_255x182712915H \
+ (GMP_NUMB_MASK & CNST_LIMB((0x1B649A07<<GMP_NAIL_BITS) | (0x6FC4CB25>>GMP_NUMB_BITS)))
+#define BINVERT_255x188513325H \
+ (GMP_NUMB_MASK & CNST_LIMB((0x06DB993A<<GMP_NAIL_BITS) | (0x6864275B>>GMP_NUMB_BITS)))
+#endif
+#else
+#if GMP_LIMB_BITS == 64
+#define BINVERT_2835 (GMP_NUMB_MASK & CNST_LIMB(0x938CC70553E3771B))
+#define BINVERT_42525 (GMP_NUMB_MASK & CNST_LIMB(0xE7B40D449F314C35))
+#define BINVERT_255x182712915 (GMP_NUMB_MASK & CNST_LIMB(0x1B649A076FC4CB25))
+#define BINVERT_255x188513325 (GMP_NUMB_MASK & CNST_LIMB(0x06DB993A6864275B))
+#endif
+#endif
+
+#ifndef mpn_divexact_by255
+#if GMP_NUMB_BITS % 8 == 0
+#define mpn_divexact_by255(dst,src,size) \
+ (255 & 1 * mpn_bdiv_dbm1 (dst, src, size, __GMP_CAST (mp_limb_t, GMP_NUMB_MASK / 255)))
+#else
+#if HAVE_NATIVE_mpn_pi1_bdiv_q_1
+#define mpn_divexact_by255(dst,src,size) mpn_pi1_bdiv_q_1(dst,src,size,CNST_LIMB(255),BINVERT_255,0)
+#else
+#define mpn_divexact_by255(dst,src,size) mpn_divexact_1(dst,src,size,CNST_LIMB(255))
+#endif
+#endif
+#endif
+
+#ifndef mpn_divexact_by255x4
+#if HAVE_NATIVE_mpn_pi1_bdiv_q_1
+#define mpn_divexact_by255x4(dst,src,size) mpn_pi1_bdiv_q_1(dst,src,size,CNST_LIMB(255),BINVERT_255,2)
+#else
+#define mpn_divexact_by255x4(dst,src,size) mpn_divexact_1(dst,src,size,CNST_LIMB(255)<<2)
+#endif
+#endif
+
+#ifndef mpn_divexact_by9x16
+#if HAVE_NATIVE_mpn_pi1_bdiv_q_1
+#define mpn_divexact_by9x16(dst,src,size) mpn_pi1_bdiv_q_1(dst,src,size,CNST_LIMB(9),BINVERT_9,4)
+#else
+#define mpn_divexact_by9x16(dst,src,size) mpn_divexact_1(dst,src,size,CNST_LIMB(9)<<4)
+#endif
+#endif
+
+#ifndef mpn_divexact_by42525x16
+#if HAVE_NATIVE_mpn_pi1_bdiv_q_1 && defined(BINVERT_42525)
+#define mpn_divexact_by42525x16(dst,src,size) mpn_pi1_bdiv_q_1(dst,src,size,CNST_LIMB(42525),BINVERT_42525,4)
+#else
+#define mpn_divexact_by42525x16(dst,src,size) mpn_divexact_1(dst,src,size,CNST_LIMB(42525)<<4)
+#endif
+#endif
+
+#ifndef mpn_divexact_by2835x64
+#if HAVE_NATIVE_mpn_pi1_bdiv_q_1 && defined(BINVERT_2835)
+#define mpn_divexact_by2835x64(dst,src,size) mpn_pi1_bdiv_q_1(dst,src,size,CNST_LIMB(2835),BINVERT_2835,6)
+#else
+#define mpn_divexact_by2835x64(dst,src,size) mpn_divexact_1(dst,src,size,CNST_LIMB(2835)<<6)
+#endif
+#endif
+
+#ifndef mpn_divexact_by255x182712915
+#if GMP_NUMB_BITS < 36
+#if HAVE_NATIVE_mpn_bdiv_q_2_pi2 && defined(BINVERT_255x182712915H)
+/* FIXME: use mpn_bdiv_q_2_pi2 */
+#endif
+#if HAVE_NATIVE_mpn_pi1_bdiv_q_1 && defined(BINVERT_182712915)
+#define mpn_divexact_by255x182712915(dst,src,size) \
+ do { \
+ mpn_pi1_bdiv_q_1(dst,src,size,CNST_LIMB(182712915),BINVERT_182712915,0); \
+ mpn_divexact_by255(dst,dst,size); \
+ } while(0)
+#else
+#define mpn_divexact_by255x182712915(dst,src,size) \
+ do { \
+ mpn_divexact_1(dst,src,size,CNST_LIMB(182712915)); \
+ mpn_divexact_by255(dst,dst,size); \
+ } while(0)
+#endif
+#else /* GMP_NUMB_BITS > 35 */
+#if HAVE_NATIVE_mpn_pi1_bdiv_q_1 && defined(BINVERT_255x182712915)
+#define mpn_divexact_by255x182712915(dst,src,size) \
+ mpn_pi1_bdiv_q_1(dst,src,size,255*CNST_LIMB(182712915),BINVERT_255x182712915,0)
+#else
+#define mpn_divexact_by255x182712915(dst,src,size) mpn_divexact_1(dst,src,size,255*CNST_LIMB(182712915))
+#endif
+#endif /* GMP_NUMB_BITS >?< 36 */
+#endif
+
+#ifndef mpn_divexact_by255x188513325
+#if GMP_NUMB_BITS < 36
+#if HAVE_NATIVE_mpn_bdiv_q_1_pi2 && defined(BINVERT_255x188513325H)
+/* FIXME: use mpn_bdiv_q_1_pi2 */
+#endif
+#if HAVE_NATIVE_mpn_pi1_bdiv_q_1 && defined(BINVERT_188513325)
+#define mpn_divexact_by255x188513325(dst,src,size) \
+ do { \
+ mpn_pi1_bdiv_q_1(dst,src,size,CNST_LIMB(188513325),BINVERT_188513325,0); \
+ mpn_divexact_by255(dst,dst,size); \
+ } while(0)
+#else
+#define mpn_divexact_by255x188513325(dst,src,size) \
+ do { \
+ mpn_divexact_1(dst,src,size,CNST_LIMB(188513325)); \
+ mpn_divexact_by255(dst,dst,size); \
+ } while(0)
+#endif
+#else /* GMP_NUMB_BITS > 35 */
+#if HAVE_NATIVE_mpn_pi1_bdiv_q_1 && defined(BINVERT_255x188513325)
+#define mpn_divexact_by255x188513325(dst,src,size) \
+ mpn_pi1_bdiv_q_1(dst,src,size,255*CNST_LIMB(188513325),BINVERT_255x188513325,0)
+#else
+#define mpn_divexact_by255x188513325(dst,src,size) mpn_divexact_1(dst,src,size,255*CNST_LIMB(188513325))
+#endif
+#endif /* GMP_NUMB_BITS >?< 36 */
+#endif
+
+/* Interpolation for Toom-8.5 (or Toom-8), using the evaluation
+ points: infinity(8.5 only), +-8, +-4, +-2, +-1, +-1/4, +-1/2,
+ +-1/8, 0. More precisely, we want to compute
+ 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,
+ r1 = f(8),f(-8),
+ r2 = f(4),f(-4),
+ r3 = f(2),f(-2),
+ r4 = f(1),f(-1),
+ r5 = f(1/4),f(-1/4),
+ r6 = f(1/2),f(-1/2),
+ r7 = f(1/8),f(-1/8),
+ r8 = f(0).
+
+ All couples of the form f(n),f(-n) must be already mixed with
+ toom_couple_handling(f(n),...,f(-n),...)
+
+ The result is stored in {pp, spt + 7*n (or 8*n)}.
+ At entry, r8 is stored at {pp, 2n},
+ r6 is stored at {pp + 3n, 3n + 1}.
+ r4 is stored at {pp + 7n, 3n + 1}.
+ r2 is stored at {pp +11n, 3n + 1}.
+ r0 is stored at {pp +15n, spt}.
+
+ The other values are 3n+1 limbs each (with most significant limbs small).
+
+ Negative intermediate results are stored two-complemented.
+ Inputs are destroyed.
+*/
+
+void
+mpn_toom_interpolate_16pts (mp_ptr pp, mp_ptr r1, mp_ptr r3, mp_ptr r5, mp_ptr r7,
+ mp_size_t n, mp_size_t spt, int half, mp_ptr wsi)
+{
+ mp_limb_t cy;
+ mp_size_t n3;
+ mp_size_t n3p1;
+ n3 = 3 * n;
+ n3p1 = n3 + 1;
+
+#define r6 (pp + n3) /* 3n+1 */
+#define r4 (pp + 7 * n) /* 3n+1 */
+#define r2 (pp +11 * n) /* 3n+1 */
+#define r0 (pp +15 * n) /* s+t <= 2*n */
+
+ ASSERT( spt <= 2 * n );
+ /******************************* interpolation *****************************/
+ if( half != 0) {
+ cy = mpn_sub_n (r4, r4, r0, spt);
+ MPN_DECR_U (r4 + spt, n3p1 - spt, cy);
+
+ cy = DO_mpn_sublsh_n (r3, r0, spt, 14, wsi);
+ MPN_DECR_U (r3 + spt, n3p1 - spt, cy);
+ DO_mpn_subrsh(r6, n3p1, r0, spt, 2, wsi);
+
+ cy = DO_mpn_sublsh_n (r2, r0, spt, 28, wsi);
+ MPN_DECR_U (r2 + spt, n3p1 - spt, cy);
+ DO_mpn_subrsh(r5, n3p1, r0, spt, 4, wsi);
+
+ cy = DO_mpn_sublsh_n (r1 + BIT_CORRECTION, r0, spt, 42 - CORRECTION_BITS, wsi);
+#if BIT_CORRECTION
+ cy = mpn_sub_1 (r1 + spt + BIT_CORRECTION, r1 + spt + BIT_CORRECTION,
+ n3p1 - spt - BIT_CORRECTION, cy);
+ ASSERT (BIT_CORRECTION > 0 || cy == 0);
+ /* FIXME: assumes r7[n3p1] is writable (it is if r5 follows). */
+ cy = r7[n3p1];
+ r7[n3p1] = 0x80;
+#else
+ MPN_DECR_U (r1 + spt + BIT_CORRECTION, n3p1 - spt - BIT_CORRECTION, cy);
+#endif
+ DO_mpn_subrsh(r7, n3p1 + BIT_CORRECTION, r0, spt, 6, wsi);
+#if BIT_CORRECTION
+ /* FIXME: assumes r7[n3p1] is writable. */
+ ASSERT ( BIT_CORRECTION > 0 || r7[n3p1] == 0x80 );
+ r7[n3p1] = cy;
+#endif
+ };
+
+ r5[n3] -= DO_mpn_sublsh_n (r5 + n, pp, 2 * n, 28, wsi);
+ DO_mpn_subrsh(r2 + n, 2 * n + 1, pp, 2 * n, 4, wsi);
+
+#if HAVE_NATIVE_mpn_add_n_sub_n
+ mpn_add_n_sub_n (r2, r5, r5, r2, n3p1);
+#else
+ mpn_sub_n (wsi, r5, r2, n3p1); /* can be negative */
+ ASSERT_NOCARRY(mpn_add_n (r2, r2, r5, n3p1));
+ MP_PTR_SWAP(r5, wsi);
+#endif
+
+ r6[n3] -= DO_mpn_sublsh_n (r6 + n, pp, 2 * n, 14, wsi);
+ DO_mpn_subrsh(r3 + n, 2 * n + 1, pp, 2 * n, 2, wsi);
+
+#if HAVE_NATIVE_mpn_add_n_sub_n
+ mpn_add_n_sub_n (r3, r6, r6, r3, n3p1);
+#else
+ ASSERT_NOCARRY(mpn_add_n (wsi, r3, r6, n3p1));
+ mpn_sub_n (r6, r6, r3, n3p1); /* can be negative */
+ MP_PTR_SWAP(r3, wsi);
+#endif
+
+ cy = DO_mpn_sublsh_n (r7 + n + BIT_CORRECTION, pp, 2 * n, 42 - CORRECTION_BITS, wsi);
+#if BIT_CORRECTION
+ MPN_DECR_U (r1 + n, 2 * n + 1, pp[0] >> 6);
+ cy = DO_mpn_sublsh_n (r1 + n, pp + 1, 2 * n - 1, GMP_NUMB_BITS - 6, wsi);
+ cy = mpn_sub_1(r1 + 3 * n - 1, r1 + 3 * n - 1, 2, cy);
+ ASSERT ( BIT_CORRECTION > 0 || cy != 0 );
+#else
+ r7[n3] -= cy;
+ DO_mpn_subrsh(r1 + n, 2 * n + 1, pp, 2 * n, 6, wsi);
+#endif
+
+#if HAVE_NATIVE_mpn_add_n_sub_n
+ mpn_add_n_sub_n (r1, r7, r7, r1, n3p1);
+#else
+ mpn_sub_n (wsi, r7, r1, n3p1); /* can be negative */
+ mpn_add_n (r1, r1, r7, n3p1); /* if BIT_CORRECTION != 0, can give a carry. */
+ MP_PTR_SWAP(r7, wsi);
+#endif
+
+ r4[n3] -= mpn_sub_n (r4+n, r4+n, pp, 2 * n);
+
+#if AORSMUL_FASTER_2AORSLSH
+ mpn_submul_1 (r5, r6, n3p1, 1028); /* can be negative */
+#else
+ DO_mpn_sublsh_n (r5, r6, n3p1, 2, wsi); /* can be negative */
+ DO_mpn_sublsh_n (r5, r6, n3p1,10, wsi); /* can be negative */
+#endif
+
+ mpn_submul_1 (r7, r5, n3p1, 1300); /* can be negative */
+#if AORSMUL_FASTER_3AORSLSH
+ mpn_submul_1 (r7, r6, n3p1, 1052688); /* can be negative */
+#else
+ DO_mpn_sublsh_n (r7, r6, n3p1, 4, wsi); /* can be negative */
+ DO_mpn_sublsh_n (r7, r6, n3p1,12, wsi); /* can be negative */
+ DO_mpn_sublsh_n (r7, r6, n3p1,20, wsi); /* can be negative */
+#endif
+ mpn_divexact_by255x188513325(r7, r7, n3p1);
+
+ mpn_submul_1 (r5, r7, n3p1, 12567555); /* can be negative */
+ /* A division by 2835x64 follows. Warning: the operand can be negative! */
+ mpn_divexact_by2835x64(r5, r5, n3p1);
+ if ((r5[n3] & (GMP_NUMB_MAX << (GMP_NUMB_BITS-7))) != 0)
+ r5[n3] |= (GMP_NUMB_MAX << (GMP_NUMB_BITS-6));
+
+#if AORSMUL_FASTER_AORS_AORSLSH
+ mpn_submul_1 (r6, r7, n3p1, 4095); /* can be negative */
+#else
+ mpn_add_n (r6, r6, r7, n3p1); /* can give a carry */
+ DO_mpn_sublsh_n (r6, r7, n3p1, 12, wsi); /* can be negative */
+#endif
+#if AORSMUL_FASTER_2AORSLSH
+ mpn_addmul_1 (r6, r5, n3p1, 240); /* can be negative */
+#else
+ DO_mpn_addlsh_n (r6, r5, n3p1, 8, wsi); /* can give a carry */
+ DO_mpn_sublsh_n (r6, r5, n3p1, 4, wsi); /* can be negative */
+#endif
+ /* A division by 255x4 follows. Warning: the operand can be negative! */
+ mpn_divexact_by255x4(r6, r6, n3p1);
+ if ((r6[n3] & (GMP_NUMB_MAX << (GMP_NUMB_BITS-3))) != 0)
+ r6[n3] |= (GMP_NUMB_MAX << (GMP_NUMB_BITS-2));
+
+ ASSERT_NOCARRY(DO_mpn_sublsh_n (r3, r4, n3p1, 7, wsi));
+
+ ASSERT_NOCARRY(DO_mpn_sublsh_n (r2, r4, n3p1, 13, wsi));
+ ASSERT_NOCARRY(mpn_submul_1 (r2, r3, n3p1, 400));
+
+ /* If GMP_NUMB_BITS < 42 next operations on r1 can give a carry!*/
+ DO_mpn_sublsh_n (r1, r4, n3p1, 19, wsi);
+ mpn_submul_1 (r1, r2, n3p1, 1428);
+ mpn_submul_1 (r1, r3, n3p1, 112896);
+ mpn_divexact_by255x182712915(r1, r1, n3p1);
+
+ ASSERT_NOCARRY(mpn_submul_1 (r2, r1, n3p1, 15181425));
+ mpn_divexact_by42525x16(r2, r2, n3p1);
+
+#if AORSMUL_FASTER_AORS_2AORSLSH
+ ASSERT_NOCARRY(mpn_submul_1 (r3, r1, n3p1, 3969));
+#else
+ ASSERT_NOCARRY(mpn_sub_n (r3, r3, r1, n3p1));
+ ASSERT_NOCARRY(DO_mpn_addlsh_n (r3, r1, n3p1, 7, wsi));
+ ASSERT_NOCARRY(DO_mpn_sublsh_n (r3, r1, n3p1, 12, wsi));
+#endif
+ ASSERT_NOCARRY(mpn_submul_1 (r3, r2, n3p1, 900));
+ mpn_divexact_by9x16(r3, r3, n3p1);
+
+ ASSERT_NOCARRY(mpn_sub_n (r4, r4, r1, n3p1));
+ ASSERT_NOCARRY(mpn_sub_n (r4, r4, r3, n3p1));
+ ASSERT_NOCARRY(mpn_sub_n (r4, r4, r2, n3p1));
+
+ mpn_add_n (r6, r2, r6, n3p1);
+ ASSERT_NOCARRY(mpn_rshift(r6, r6, n3p1, 1));
+ ASSERT_NOCARRY(mpn_sub_n (r2, r2, r6, n3p1));
+
+ mpn_sub_n (r5, r3, r5, n3p1);
+ ASSERT_NOCARRY(mpn_rshift(r5, r5, n3p1, 1));
+ ASSERT_NOCARRY(mpn_sub_n (r3, r3, r5, n3p1));
+
+ mpn_add_n (r7, r1, r7, n3p1);
+ ASSERT_NOCARRY(mpn_rshift(r7, r7, n3p1, 1));
+ ASSERT_NOCARRY(mpn_sub_n (r1, r1, r7, n3p1));
+
+ /* last interpolation steps... */
+ /* ... could be mixed with recomposition
+ ||H-r7|M-r7|L-r7| ||H-r5|M-r5|L-r5|
+ */
+
+ /***************************** recomposition *******************************/
+ /*
+ pp[] prior to operations:
+ |M r0|L r0|___||H r2|M r2|L r2|___||H r4|M r4|L r4|___||H r6|M r6|L r6|____|H_r8|L r8|pp
+
+ summation scheme for remaining operations:
+ |__16|n_15|n_14|n_13|n_12|n_11|n_10|n__9|n__8|n__7|n__6|n__5|n__4|n__3|n__2|n___|n___|pp
+ |M r0|L r0|___||H r2|M r2|L r2|___||H r4|M r4|L r4|___||H r6|M r6|L r6|____|H_r8|L r8|pp
+ ||H r1|M r1|L r1| ||H r3|M r3|L r3| ||H_r5|M_r5|L_r5| ||H r7|M r7|L r7|
+ */
+
+ cy = mpn_add_n (pp + n, pp + n, r7, n);
+ cy = mpn_add_1 (pp + 2 * n, r7 + n, n, cy);
+#if HAVE_NATIVE_mpn_add_nc
+ cy = r7[n3] + mpn_add_nc(pp + n3, pp + n3, r7 + 2 * n, n, cy);
+#else
+ MPN_INCR_U (r7 + 2 * n, n + 1, cy);
+ cy = r7[n3] + mpn_add_n (pp + n3, pp + n3, r7 + 2 * n, n);
+#endif
+ MPN_INCR_U (pp + 4 * n, 2 * n + 1, cy);
+
+ pp[2 * n3]+= mpn_add_n (pp + 5 * n, pp + 5 * n, r5, n);
+ cy = mpn_add_1 (pp + 2 * n3, r5 + n, n, pp[2 * n3]);
+#if HAVE_NATIVE_mpn_add_nc
+ cy = r5[n3] + mpn_add_nc(pp + 7 * n, pp + 7 * n, r5 + 2 * n, n, cy);
+#else
+ MPN_INCR_U (r5 + 2 * n, n + 1, cy);
+ cy = r5[n3] + mpn_add_n (pp + 7 * n, pp + 7 * n, r5 + 2 * n, n);
+#endif
+ MPN_INCR_U (pp + 8 * n, 2 * n + 1, cy);
+
+ pp[10 * n]+= mpn_add_n (pp + 9 * n, pp + 9 * n, r3, n);
+ cy = mpn_add_1 (pp + 10 * n, r3 + n, n, pp[10 * n]);
+#if HAVE_NATIVE_mpn_add_nc
+ cy = r3[n3] + mpn_add_nc(pp +11 * n, pp +11 * n, r3 + 2 * n, n, cy);
+#else
+ MPN_INCR_U (r3 + 2 * n, n + 1, cy);
+ cy = r3[n3] + mpn_add_n (pp +11 * n, pp +11 * n, r3 + 2 * n, n);
+#endif
+ MPN_INCR_U (pp +12 * n, 2 * n + 1, cy);
+
+ pp[14 * n]+=mpn_add_n (pp +13 * n, pp +13 * n, r1, n);
+ if ( half ) {
+ cy = mpn_add_1 (pp + 14 * n, r1 + n, n, pp[14 * n]);
+#if HAVE_NATIVE_mpn_add_nc
+ if(LIKELY(spt > n)) {
+ cy = r1[n3] + mpn_add_nc(pp + 15 * n, pp + 15 * n, r1 + 2 * n, n, cy);
+ MPN_INCR_U (pp + 16 * n, spt - n, cy);
+ } else {
+ ASSERT_NOCARRY(mpn_add_nc(pp + 15 * n, pp + 15 * n, r1 + 2 * n, spt, cy));
+ }
+#else
+ MPN_INCR_U (r1 + 2 * n, n + 1, cy);
+ if(LIKELY(spt > n)) {
+ cy = r1[n3] + mpn_add_n (pp + 15 * n, pp + 15 * n, r1 + 2 * n, n);
+ MPN_INCR_U (pp + 16 * n, spt - n, cy);
+ } else {
+ ASSERT_NOCARRY(mpn_add_n (pp + 15 * n, pp + 15 * n, r1 + 2 * n, spt));
+ }
+#endif
+ } else {
+ ASSERT_NOCARRY(mpn_add_1 (pp + 14 * n, r1 + n, spt, pp[14 * n]));
+ }
+
+#undef r0
+#undef r2
+#undef r4
+#undef r6
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/toom_interpolate_5pts.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/toom_interpolate_5pts.c
new file mode 100644
index 00000000000..9fa5f0b7a60
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/toom_interpolate_5pts.c
@@ -0,0 +1,199 @@
+/* mpn_toom_interpolate_5pts -- Interpolate for toom3, 33, 42.
+
+ Contributed to the GNU project by Robert Harley.
+ Improvements by Paul Zimmermann and Marco Bodrato.
+
+ THE FUNCTION IN THIS FILE IS INTERNAL WITH A MUTABLE INTERFACE. IT IS ONLY
+ 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 2000-2003, 2005-2007, 2009 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.h"
+#include "gmp-impl.h"
+
+void
+mpn_toom_interpolate_5pts (mp_ptr c, mp_ptr v2, mp_ptr vm1,
+ mp_size_t k, mp_size_t twor, int sa,
+ mp_limb_t vinf0)
+{
+ mp_limb_t cy, saved;
+ mp_size_t twok;
+ mp_size_t kk1;
+ mp_ptr c1, v1, c3, vinf;
+
+ twok = k + k;
+ kk1 = twok + 1;
+
+ c1 = c + k;
+ v1 = c1 + k;
+ c3 = v1 + k;
+ vinf = c3 + k;
+
+#define v0 (c)
+ /* (1) v2 <- v2-vm1 < v2+|vm1|, (16 8 4 2 1) - (1 -1 1 -1 1) =
+ thus 0 <= v2 < 50*B^(2k) < 2^6*B^(2k) (15 9 3 3 0)
+ */
+ if (sa)
+ ASSERT_NOCARRY (mpn_add_n (v2, v2, vm1, kk1));
+ else
+ ASSERT_NOCARRY (mpn_sub_n (v2, v2, vm1, kk1));
+
+ /* {c,2k} {c+2k,2k+1} {c+4k+1,2r-1} {t,2k+1} {t+2k+1,2k+1} {t+4k+2,2r}
+ v0 v1 hi(vinf) |vm1| v2-vm1 EMPTY */
+
+ ASSERT_NOCARRY (mpn_divexact_by3 (v2, v2, kk1)); /* v2 <- v2 / 3 */
+ /* (5 3 1 1 0)*/
+
+ /* {c,2k} {c+2k,2k+1} {c+4k+1,2r-1} {t,2k+1} {t+2k+1,2k+1} {t+4k+2,2r}
+ v0 v1 hi(vinf) |vm1| (v2-vm1)/3 EMPTY */
+
+ /* (2) vm1 <- tm1 := (v1 - vm1) / 2 [(1 1 1 1 1) - (1 -1 1 -1 1)] / 2 =
+ tm1 >= 0 (0 1 0 1 0)
+ No carry comes out from {v1, kk1} +/- {vm1, kk1},
+ and the division by two is exact.
+ If (sa!=0) the sign of vm1 is negative */
+ if (sa)
+ {
+#ifdef HAVE_NATIVE_mpn_rsh1add_n
+ mpn_rsh1add_n (vm1, v1, vm1, kk1);
+#else
+ ASSERT_NOCARRY (mpn_add_n (vm1, v1, vm1, kk1));
+ ASSERT_NOCARRY (mpn_rshift (vm1, vm1, kk1, 1));
+#endif
+ }
+ else
+ {
+#ifdef HAVE_NATIVE_mpn_rsh1sub_n
+ mpn_rsh1sub_n (vm1, v1, vm1, kk1);
+#else
+ ASSERT_NOCARRY (mpn_sub_n (vm1, v1, vm1, kk1));
+ ASSERT_NOCARRY (mpn_rshift (vm1, vm1, kk1, 1));
+#endif
+ }
+
+ /* {c,2k} {c+2k,2k+1} {c+4k+1,2r-1} {t,2k+1} {t+2k+1,2k+1} {t+4k+2,2r}
+ v0 v1 hi(vinf) tm1 (v2-vm1)/3 EMPTY */
+
+ /* (3) v1 <- t1 := v1 - v0 (1 1 1 1 1) - (0 0 0 0 1) = (1 1 1 1 0)
+ t1 >= 0
+ */
+ vinf[0] -= mpn_sub_n (v1, v1, c, twok);
+
+ /* {c,2k} {c+2k,2k+1} {c+4k+1,2r-1} {t,2k+1} {t+2k+1,2k+1} {t+4k+2,2r}
+ v0 v1-v0 hi(vinf) tm1 (v2-vm1)/3 EMPTY */
+
+ /* (4) v2 <- t2 := ((v2-vm1)/3-t1)/2 = (v2-vm1-3*t1)/6
+ t2 >= 0 [(5 3 1 1 0) - (1 1 1 1 0)]/2 = (2 1 0 0 0)
+ */
+#ifdef HAVE_NATIVE_mpn_rsh1sub_n
+ mpn_rsh1sub_n (v2, v2, v1, kk1);
+#else
+ ASSERT_NOCARRY (mpn_sub_n (v2, v2, v1, kk1));
+ ASSERT_NOCARRY (mpn_rshift (v2, v2, kk1, 1));
+#endif
+
+ /* {c,2k} {c+2k,2k+1} {c+4k+1,2r-1} {t,2k+1} {t+2k+1,2k+1} {t+4k+2,2r}
+ v0 v1-v0 hi(vinf) tm1 (v2-vm1-3t1)/6 EMPTY */
+
+ /* (5) v1 <- t1-tm1 (1 1 1 1 0) - (0 1 0 1 0) = (1 0 1 0 0)
+ result is v1 >= 0
+ */
+ ASSERT_NOCARRY (mpn_sub_n (v1, v1, vm1, kk1));
+
+ /* We do not need to read the value in vm1, so we add it in {c+k, ...} */
+ cy = mpn_add_n (c1, c1, vm1, kk1);
+ MPN_INCR_U (c3 + 1, twor + k - 1, cy); /* 2n-(3k+1) = 2r+k-1 */
+ /* Memory allocated for vm1 is now free, it can be recycled ...*/
+
+ /* (6) v2 <- v2 - 2*vinf, (2 1 0 0 0) - 2*(1 0 0 0 0) = (0 1 0 0 0)
+ result is v2 >= 0 */
+ saved = vinf[0]; /* Remember v1's highest byte (will be overwritten). */
+ vinf[0] = vinf0; /* Set the right value for vinf0 */
+#ifdef HAVE_NATIVE_mpn_sublsh1_n_ip1
+ cy = mpn_sublsh1_n_ip1 (v2, vinf, twor);
+#else
+ /* Overwrite unused vm1 */
+ cy = mpn_lshift (vm1, vinf, twor, 1);
+ cy += mpn_sub_n (v2, v2, vm1, twor);
+#endif
+ MPN_DECR_U (v2 + twor, kk1 - twor, cy);
+
+ /* Current matrix is
+ [1 0 0 0 0; vinf
+ 0 1 0 0 0; v2
+ 1 0 1 0 0; v1
+ 0 1 0 1 0; vm1
+ 0 0 0 0 1] v0
+ Some values already are in-place (we added vm1 in the correct position)
+ | vinf| v1 | v0 |
+ | vm1 |
+ One still is in a separated area
+ | +v2 |
+ We have to compute v1-=vinf; vm1 -= v2,
+ |-vinf|
+ | -v2 |
+ Carefully reordering operations we can avoid to compute twice the sum
+ of the high half of v2 plus the low half of vinf.
+ */
+
+ /* Add the high half of t2 in {vinf} */
+ if ( LIKELY(twor > k + 1) ) { /* This is the expected flow */
+ cy = mpn_add_n (vinf, vinf, v2 + k, k + 1);
+ MPN_INCR_U (c3 + kk1, twor - k - 1, cy); /* 2n-(5k+1) = 2r-k-1 */
+ } else { /* triggered only by very unbalanced cases like
+ (k+k+(k-2))x(k+k+1) , should be handled by toom32 */
+ ASSERT_NOCARRY (mpn_add_n (vinf, vinf, v2 + k, twor));
+ }
+ /* (7) v1 <- v1 - vinf, (1 0 1 0 0) - (1 0 0 0 0) = (0 0 1 0 0)
+ result is >= 0 */
+ /* Side effect: we also subtracted (high half) vm1 -= v2 */
+ cy = mpn_sub_n (v1, v1, vinf, twor); /* vinf is at most twor long. */
+ vinf0 = vinf[0]; /* Save again the right value for vinf0 */
+ vinf[0] = saved;
+ MPN_DECR_U (v1 + twor, kk1 - twor, cy); /* Treat the last bytes. */
+
+ /* (8) vm1 <- vm1-v2 (0 1 0 1 0) - (0 1 0 0 0) = (0 0 0 1 0)
+ Operate only on the low half.
+ */
+ cy = mpn_sub_n (c1, c1, v2, k);
+ MPN_DECR_U (v1, kk1, cy);
+
+ /********************* Beginning the final phase **********************/
+
+ /* Most of the recomposition was done */
+
+ /* add t2 in {c+3k, ...}, but only the low half */
+ cy = mpn_add_n (c3, c3, v2, k);
+ vinf[0] += cy;
+ ASSERT(vinf[0] >= cy); /* No carry */
+ MPN_INCR_U (vinf, twor, vinf0); /* Add vinf0, propagate carry. */
+
+#undef v0
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/toom_interpolate_6pts.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/toom_interpolate_6pts.c
new file mode 100644
index 00000000000..bdb2e95b892
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/toom_interpolate_6pts.c
@@ -0,0 +1,240 @@
+/* mpn_toom_interpolate_6pts -- Interpolate for toom43, 52
+
+ Contributed to the GNU project by Marco Bodrato.
+
+ THE FUNCTION IN THIS FILE IS INTERNAL WITH A MUTABLE INTERFACE. IT IS ONLY
+ 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.
+
+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.h"
+#include "gmp-impl.h"
+
+/* 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)
+#else
+#define mpn_divexact_by3(dst,src,size) mpn_divexact_1(dst,src,size,3)
+#endif
+#endif
+
+/* Interpolation for Toom-3.5, using the evaluation points: infinity,
+ 1, -1, 2, -2. More precisely, we want to compute
+ f(2^(GMP_NUMB_BITS * n)) for a polynomial f of degree 5, given the
+ six values
+
+ w5 = f(0),
+ w4 = f(-1),
+ w3 = f(1)
+ w2 = f(-2),
+ w1 = f(2),
+ w0 = limit at infinity of f(x) / x^5,
+
+ The result is stored in {pp, 5*n + w0n}. At entry, w5 is stored at
+ {pp, 2n}, w3 is stored at {pp + 2n, 2n+1}, and w0 is stored at
+ {pp + 5n, w0n}. The other values are 2n + 1 limbs each (with most
+ significant limbs small). f(-1) and f(-2) may be negative, signs
+ determined by the flag bits. All intermediate results are positive.
+ Inputs are destroyed.
+
+ Interpolation sequence was taken from the paper: "Integer and
+ Polynomial Multiplication: Towards Optimal Toom-Cook Matrices".
+ Some slight variations were introduced: adaptation to "gmp
+ instruction set", and a final saving of an operation by interlacing
+ interpolation and recomposition phases.
+*/
+
+void
+mpn_toom_interpolate_6pts (mp_ptr pp, mp_size_t n, enum toom6_flags flags,
+ mp_ptr w4, mp_ptr w2, mp_ptr w1,
+ mp_size_t w0n)
+{
+ mp_limb_t cy;
+ /* cy6 can be stored in w1[2*n], cy4 in w4[0], embankment in w2[0] */
+ mp_limb_t cy4, cy6, embankment;
+
+ ASSERT( n > 0 );
+ ASSERT( 2*n >= w0n && w0n > 0 );
+
+#define w5 pp /* 2n */
+#define w3 (pp + 2 * n) /* 2n+1 */
+#define w0 (pp + 5 * n) /* w0n */
+
+ /* Interpolate with sequence:
+ W2 =(W1 - W2)>>2
+ W1 =(W1 - W5)>>1
+ W1 =(W1 - W2)>>1
+ W4 =(W3 - W4)>>1
+ W2 =(W2 - W4)/3
+ W3 = W3 - W4 - W5
+ W1 =(W1 - W3)/3
+ // Last steps are mixed with recomposition...
+ W2 = W2 - W0<<2
+ W4 = W4 - W2
+ W3 = W3 - W1
+ W2 = W2 - W0
+ */
+
+ /* W2 =(W1 - W2)>>2 */
+ if (flags & toom6_vm2_neg)
+ mpn_add_n (w2, w1, w2, 2 * n + 1);
+ else
+ mpn_sub_n (w2, w1, w2, 2 * n + 1);
+ mpn_rshift (w2, w2, 2 * n + 1, 2);
+
+ /* W1 =(W1 - W5)>>1 */
+ w1[2*n] -= mpn_sub_n (w1, w1, w5, 2*n);
+ mpn_rshift (w1, w1, 2 * n + 1, 1);
+
+ /* W1 =(W1 - W2)>>1 */
+#if HAVE_NATIVE_mpn_rsh1sub_n
+ mpn_rsh1sub_n (w1, w1, w2, 2 * n + 1);
+#else
+ mpn_sub_n (w1, w1, w2, 2 * n + 1);
+ mpn_rshift (w1, w1, 2 * n + 1, 1);
+#endif
+
+ /* W4 =(W3 - W4)>>1 */
+ if (flags & toom6_vm1_neg)
+ {
+#if HAVE_NATIVE_mpn_rsh1add_n
+ mpn_rsh1add_n (w4, w3, w4, 2 * n + 1);
+#else
+ mpn_add_n (w4, w3, w4, 2 * n + 1);
+ mpn_rshift (w4, w4, 2 * n + 1, 1);
+#endif
+ }
+ else
+ {
+#if HAVE_NATIVE_mpn_rsh1sub_n
+ mpn_rsh1sub_n (w4, w3, w4, 2 * n + 1);
+#else
+ mpn_sub_n (w4, w3, w4, 2 * n + 1);
+ mpn_rshift (w4, w4, 2 * n + 1, 1);
+#endif
+ }
+
+ /* W2 =(W2 - W4)/3 */
+ mpn_sub_n (w2, w2, w4, 2 * n + 1);
+ mpn_divexact_by3 (w2, w2, 2 * n + 1);
+
+ /* W3 = W3 - W4 - W5 */
+ mpn_sub_n (w3, w3, w4, 2 * n + 1);
+ w3[2 * n] -= mpn_sub_n (w3, w3, w5, 2 * n);
+
+ /* W1 =(W1 - W3)/3 */
+ mpn_sub_n (w1, w1, w3, 2 * n + 1);
+ mpn_divexact_by3 (w1, w1, 2 * n + 1);
+
+ /*
+ [1 0 0 0 0 0;
+ 0 1 0 0 0 0;
+ 1 0 1 0 0 0;
+ 0 1 0 1 0 0;
+ 1 0 1 0 1 0;
+ 0 0 0 0 0 1]
+
+ pp[] prior to operations:
+ |_H w0__|_L w0__|______||_H w3__|_L w3__|_H w5__|_L w5__|
+
+ summation scheme for remaining operations:
+ |______________5|n_____4|n_____3|n_____2|n______|n______|pp
+ |_H w0__|_L w0__|______||_H w3__|_L w3__|_H w5__|_L w5__|
+ || H w4 | L w4 |
+ || H w2 | L w2 |
+ || H w1 | L w1 |
+ ||-H w1 |-L w1 |
+ |-H w0 |-L w0 ||-H w2 |-L w2 |
+ */
+ cy = mpn_add_n (pp + n, pp + n, w4, 2 * n + 1);
+ MPN_INCR_U (pp + 3 * n + 1, n, cy);
+
+ /* W2 -= W0<<2 */
+#if HAVE_NATIVE_mpn_sublsh_n || HAVE_NATIVE_mpn_sublsh2_n_ip1
+#if HAVE_NATIVE_mpn_sublsh2_n_ip1
+ cy = mpn_sublsh2_n_ip1 (w2, w0, w0n);
+#else
+ cy = mpn_sublsh_n (w2, w2, w0, w0n, 2);
+#endif
+#else
+ /* {W4,2*n+1} is now free and can be overwritten. */
+ cy = mpn_lshift(w4, w0, w0n, 2);
+ cy+= mpn_sub_n(w2, w2, w4, w0n);
+#endif
+ MPN_DECR_U (w2 + w0n, 2 * n + 1 - w0n, cy);
+
+ /* W4L = W4L - W2L */
+ cy = mpn_sub_n (pp + n, pp + n, w2, n);
+ MPN_DECR_U (w3, 2 * n + 1, cy);
+
+ /* W3H = W3H + W2L */
+ cy4 = w3[2 * n] + mpn_add_n (pp + 3 * n, pp + 3 * n, w2, n);
+ /* W1L + W2H */
+ cy = w2[2 * n] + mpn_add_n (pp + 4 * n, w1, w2 + n, n);
+ MPN_INCR_U (w1 + n, n + 1, cy);
+
+ /* W0 = W0 + W1H */
+ if (LIKELY (w0n > n))
+ cy6 = w1[2 * n] + mpn_add_n (w0, w0, w1 + n, n);
+ else
+ cy6 = mpn_add_n (w0, w0, w1 + n, w0n);
+
+ /*
+ summation scheme for the next operation:
+ |...____5|n_____4|n_____3|n_____2|n______|n______|pp
+ |...w0___|_w1_w2_|_H w3__|_L w3__|_H w5__|_L w5__|
+ ...-w0___|-w1_w2 |
+ */
+ /* if(LIKELY(w0n>n)) the two operands below DO overlap! */
+ cy = mpn_sub_n (pp + 2 * n, pp + 2 * n, pp + 4 * n, n + w0n);
+
+ /* embankment is a "dirty trick" to avoid carry/borrow propagation
+ beyond allocated memory */
+ embankment = w0[w0n - 1] - 1;
+ w0[w0n - 1] = 1;
+ if (LIKELY (w0n > n)) {
+ if (cy4 > cy6)
+ MPN_INCR_U (pp + 4 * n, w0n + n, cy4 - cy6);
+ else
+ MPN_DECR_U (pp + 4 * n, w0n + n, cy6 - cy4);
+ MPN_DECR_U (pp + 3 * n + w0n, 2 * n, cy);
+ MPN_INCR_U (w0 + n, w0n - n, cy6);
+ } else {
+ MPN_INCR_U (pp + 4 * n, w0n + n, cy4);
+ MPN_DECR_U (pp + 3 * n + w0n, 2 * n, cy + cy6);
+ }
+ w0[w0n - 1] += embankment;
+
+#undef w5
+#undef w3
+#undef w0
+
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/toom_interpolate_7pts.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/toom_interpolate_7pts.c
new file mode 100644
index 00000000000..2a67dba82f3
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/toom_interpolate_7pts.c
@@ -0,0 +1,266 @@
+/* mpn_toom_interpolate_7pts -- Interpolate for toom44, 53, 62.
+
+ Contributed to the GNU project by Niels Möller.
+ Improvements by Marco Bodrato.
+
+ THE FUNCTION IN THIS FILE IS INTERNAL WITH A MUTABLE INTERFACE. IT IS ONLY
+ 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 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.h"
+#include "gmp-impl.h"
+
+#define BINVERT_3 MODLIMB_INVERSE_3
+
+#define BINVERT_9 \
+ ((((GMP_NUMB_MAX / 9) << (6 - GMP_NUMB_BITS % 6)) * 8 & GMP_NUMB_MAX) | 0x39)
+
+#define BINVERT_15 \
+ ((((GMP_NUMB_MAX >> (GMP_NUMB_BITS % 4)) / 15) * 14 * 16 & GMP_NUMB_MAX) + 15)
+
+/* For the various mpn_divexact_byN here, fall back to using either
+ mpn_pi1_bdiv_q_1 or mpn_divexact_1. The former has less overhead and is
+ many faster if it is native. For now, since mpn_divexact_1 is native on
+ several platforms where mpn_pi1_bdiv_q_1 does not yet exist, do not use
+ mpn_pi1_bdiv_q_1 unconditionally. FIXME. */
+
+/* For odd divisors, mpn_divexact_1 works fine with two's complement. */
+#ifndef mpn_divexact_by3
+#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
+#endif
+
+#ifndef mpn_divexact_by9
+#if HAVE_NATIVE_mpn_pi1_bdiv_q_1
+#define mpn_divexact_by9(dst,src,size) mpn_pi1_bdiv_q_1(dst,src,size,9,BINVERT_9,0)
+#else
+#define mpn_divexact_by9(dst,src,size) mpn_divexact_1(dst,src,size,9)
+#endif
+#endif
+
+#ifndef mpn_divexact_by15
+#if HAVE_NATIVE_mpn_pi1_bdiv_q_1
+#define mpn_divexact_by15(dst,src,size) mpn_pi1_bdiv_q_1(dst,src,size,15,BINVERT_15,0)
+#else
+#define mpn_divexact_by15(dst,src,size) mpn_divexact_1(dst,src,size,15)
+#endif
+#endif
+
+/* Interpolation for toom4, using the evaluation points 0, infinity,
+ 1, -1, 2, -2, 1/2. More precisely, we want to compute
+ f(2^(GMP_NUMB_BITS * n)) for a polynomial f of degree 6, given the
+ seven values
+
+ w0 = f(0),
+ w1 = f(-2),
+ w2 = f(1),
+ w3 = f(-1),
+ w4 = f(2)
+ w5 = 64 * f(1/2)
+ w6 = limit at infinity of f(x) / x^6,
+
+ The result is 6*n + w6n limbs. At entry, w0 is stored at {rp, 2n },
+ w2 is stored at { rp + 2n, 2n+1 }, and w6 is stored at { rp + 6n,
+ w6n }. The other values are 2n + 1 limbs each (with most
+ significant limbs small). f(-1) and f(-1/2) may be negative, signs
+ determined by the flag bits. Inputs are destroyed.
+
+ Needs (2*n + 1) limbs of temporary storage.
+*/
+
+void
+mpn_toom_interpolate_7pts (mp_ptr rp, mp_size_t n, enum toom7_flags flags,
+ mp_ptr w1, mp_ptr w3, mp_ptr w4, mp_ptr w5,
+ mp_size_t w6n, mp_ptr tp)
+{
+ mp_size_t m;
+ mp_limb_t cy;
+
+ m = 2*n + 1;
+#define w0 rp
+#define w2 (rp + 2*n)
+#define w6 (rp + 6*n)
+
+ ASSERT (w6n > 0);
+ ASSERT (w6n <= 2*n);
+
+ /* Using formulas similar to Marco Bodrato's
+
+ W5 = W5 + W4
+ W1 =(W4 - W1)/2
+ W4 = W4 - W0
+ W4 =(W4 - W1)/4 - W6*16
+ W3 =(W2 - W3)/2
+ W2 = W2 - W3
+
+ W5 = W5 - W2*65 May be negative.
+ W2 = W2 - W6 - W0
+ W5 =(W5 + W2*45)/2 Now >= 0 again.
+ W4 =(W4 - W2)/3
+ W2 = W2 - W4
+
+ W1 = W5 - W1 May be negative.
+ W5 =(W5 - W3*8)/9
+ W3 = W3 - W5
+ W1 =(W1/15 + W5)/2 Now >= 0 again.
+ W5 = W5 - W1
+
+ where W0 = f(0), W1 = f(-2), W2 = f(1), W3 = f(-1),
+ W4 = f(2), W5 = f(1/2), W6 = f(oo),
+
+ Note that most intermediate results are positive; the ones that
+ may be negative are represented in two's complement. We must
+ never shift right a value that may be negative, since that would
+ invalidate the sign bit. On the other hand, divexact by odd
+ numbers work fine with two's complement.
+ */
+
+ mpn_add_n (w5, w5, w4, m);
+ if (flags & toom7_w1_neg)
+ {
+#ifdef HAVE_NATIVE_mpn_rsh1add_n
+ mpn_rsh1add_n (w1, w1, w4, m);
+#else
+ mpn_add_n (w1, w1, w4, m); ASSERT (!(w1[0] & 1));
+ mpn_rshift (w1, w1, m, 1);
+#endif
+ }
+ else
+ {
+#ifdef HAVE_NATIVE_mpn_rsh1sub_n
+ mpn_rsh1sub_n (w1, w4, w1, m);
+#else
+ mpn_sub_n (w1, w4, w1, m); ASSERT (!(w1[0] & 1));
+ mpn_rshift (w1, w1, m, 1);
+#endif
+ }
+ mpn_sub (w4, w4, m, w0, 2*n);
+ mpn_sub_n (w4, w4, w1, m); ASSERT (!(w4[0] & 3));
+ mpn_rshift (w4, w4, m, 2); /* w4>=0 */
+
+ tp[w6n] = mpn_lshift (tp, w6, w6n, 4);
+ mpn_sub (w4, w4, m, tp, w6n+1);
+
+ if (flags & toom7_w3_neg)
+ {
+#ifdef HAVE_NATIVE_mpn_rsh1add_n
+ mpn_rsh1add_n (w3, w3, w2, m);
+#else
+ mpn_add_n (w3, w3, w2, m); ASSERT (!(w3[0] & 1));
+ mpn_rshift (w3, w3, m, 1);
+#endif
+ }
+ else
+ {
+#ifdef HAVE_NATIVE_mpn_rsh1sub_n
+ mpn_rsh1sub_n (w3, w2, w3, m);
+#else
+ mpn_sub_n (w3, w2, w3, m); ASSERT (!(w3[0] & 1));
+ mpn_rshift (w3, w3, m, 1);
+#endif
+ }
+
+ mpn_sub_n (w2, w2, w3, m);
+
+ mpn_submul_1 (w5, w2, m, 65);
+ mpn_sub (w2, w2, m, w6, w6n);
+ mpn_sub (w2, w2, m, w0, 2*n);
+
+ mpn_addmul_1 (w5, w2, m, 45); ASSERT (!(w5[0] & 1));
+ mpn_rshift (w5, w5, m, 1);
+ mpn_sub_n (w4, w4, w2, m);
+
+ mpn_divexact_by3 (w4, w4, m);
+ mpn_sub_n (w2, w2, w4, m);
+
+ mpn_sub_n (w1, w5, w1, m);
+ mpn_lshift (tp, w3, m, 3);
+ mpn_sub_n (w5, w5, tp, m);
+ mpn_divexact_by9 (w5, w5, m);
+ mpn_sub_n (w3, w3, w5, m);
+
+ mpn_divexact_by15 (w1, w1, m);
+ mpn_add_n (w1, w1, w5, m); ASSERT (!(w1[0] & 1));
+ mpn_rshift (w1, w1, m, 1); /* w1>=0 now */
+ mpn_sub_n (w5, w5, w1, m);
+
+ /* These bounds are valid for the 4x4 polynomial product of toom44,
+ * and they are conservative for toom53 and toom62. */
+ ASSERT (w1[2*n] < 2);
+ ASSERT (w2[2*n] < 3);
+ ASSERT (w3[2*n] < 4);
+ ASSERT (w4[2*n] < 3);
+ ASSERT (w5[2*n] < 2);
+
+ /* Addition chain. Note carries and the 2n'th limbs that need to be
+ * added in.
+ *
+ * Special care is needed for w2[2n] and the corresponding carry,
+ * since the "simple" way of adding it all together would overwrite
+ * the limb at wp[2*n] and rp[4*n] (same location) with the sum of
+ * the high half of w3 and the low half of w4.
+ *
+ * 7 6 5 4 3 2 1 0
+ * | | | | | | | | |
+ * ||w3 (2n+1)|
+ * ||w4 (2n+1)|
+ * ||w5 (2n+1)| ||w1 (2n+1)|
+ * + | w6 (w6n)| ||w2 (2n+1)| w0 (2n) | (share storage with r)
+ * -----------------------------------------------
+ * r | | | | | | | | |
+ * c7 c6 c5 c4 c3 Carries to propagate
+ */
+
+ cy = mpn_add_n (rp + n, rp + n, w1, m);
+ MPN_INCR_U (w2 + n + 1, n , cy);
+ cy = mpn_add_n (rp + 3*n, rp + 3*n, w3, n);
+ MPN_INCR_U (w3 + n, n + 1, w2[2*n] + cy);
+ cy = mpn_add_n (rp + 4*n, w3 + n, w4, n);
+ MPN_INCR_U (w4 + n, n + 1, w3[2*n] + cy);
+ cy = mpn_add_n (rp + 5*n, w4 + n, w5, n);
+ MPN_INCR_U (w5 + n, n + 1, w4[2*n] + cy);
+ if (w6n > n + 1)
+ ASSERT_NOCARRY (mpn_add (rp + 6*n, rp + 6*n, w6n, w5 + n, n + 1));
+ else
+ {
+ ASSERT_NOCARRY (mpn_add_n (rp + 6*n, rp + 6*n, w5 + n, w6n));
+#if WANT_ASSERT
+ {
+ mp_size_t i;
+ for (i = w6n; i <= n; i++)
+ ASSERT (w5[n + i] == 0);
+ }
+#endif
+ }
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/toom_interpolate_8pts.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/toom_interpolate_8pts.c
new file mode 100644
index 00000000000..9e8808334eb
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/toom_interpolate_8pts.c
@@ -0,0 +1,212 @@
+/* mpn_toom_interpolate_8pts -- Interpolate for toom54, 63, 72.
+
+ Contributed to the GNU project by Marco Bodrato.
+
+ THE FUNCTION IN THIS FILE IS INTERNAL WITH A MUTABLE INTERFACE. IT IS ONLY
+ 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, 2011, 2012 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.h"
+#include "gmp-impl.h"
+
+#define BINVERT_3 MODLIMB_INVERSE_3
+
+#define BINVERT_15 \
+ ((((GMP_NUMB_MAX >> (GMP_NUMB_BITS % 4)) / 15) * 14 * 16 & GMP_NUMB_MAX) + 15)
+
+#define BINVERT_45 ((BINVERT_15 * BINVERT_3) & GMP_NUMB_MASK)
+
+#ifndef mpn_divexact_by3
+#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
+#endif
+
+#ifndef mpn_divexact_by45
+#if GMP_NUMB_BITS % 12 == 0
+#define mpn_divexact_by45(dst,src,size) \
+ (63 & 19 * mpn_bdiv_dbm1 (dst, src, size, __GMP_CAST (mp_limb_t, GMP_NUMB_MASK / 45)))
+#else
+#if HAVE_NATIVE_mpn_pi1_bdiv_q_1
+#define mpn_divexact_by45(dst,src,size) mpn_pi1_bdiv_q_1(dst,src,size,45,BINVERT_45,0)
+#else
+#define mpn_divexact_by45(dst,src,size) mpn_divexact_1(dst,src,size,45)
+#endif
+#endif
+#endif
+
+#if HAVE_NATIVE_mpn_sublsh2_n_ip1
+#define DO_mpn_sublsh2_n(dst,src,n,ws) mpn_sublsh2_n_ip1(dst,src,n)
+#else
+#define DO_mpn_sublsh2_n(dst,src,n,ws) DO_mpn_sublsh_n(dst,src,n,2,ws)
+#endif
+
+#if HAVE_NATIVE_mpn_sublsh_n
+#define DO_mpn_sublsh_n(dst,src,n,s,ws) mpn_sublsh_n (dst,dst,src,n,s)
+#else
+static mp_limb_t
+DO_mpn_sublsh_n (mp_ptr dst, mp_srcptr src, mp_size_t n, unsigned int s, mp_ptr ws)
+{
+#if USE_MUL_1 && 0
+ return mpn_submul_1(dst,src,n,CNST_LIMB(1) <<(s));
+#else
+ mp_limb_t __cy;
+ __cy = mpn_lshift (ws,src,n,s);
+ return __cy + mpn_sub_n (dst,dst,ws,n);
+#endif
+}
+#endif
+
+
+#if HAVE_NATIVE_mpn_subrsh
+#define DO_mpn_subrsh(dst,nd,src,ns,s,ws) mpn_subrsh (dst,nd,src,ns,s)
+#else
+/* This is not a correct definition, it assumes no carry */
+#define DO_mpn_subrsh(dst,nd,src,ns,s,ws) \
+do { \
+ mp_limb_t __cy; \
+ MPN_DECR_U (dst, nd, src[0] >> s); \
+ __cy = DO_mpn_sublsh_n (dst, src + 1, ns - 1, GMP_NUMB_BITS - s, ws); \
+ MPN_DECR_U (dst + ns - 1, nd - ns + 1, __cy); \
+} while (0)
+#endif
+
+/* Interpolation for Toom-4.5 (or Toom-4), using the evaluation
+ points: infinity(4.5 only), 4, -4, 2, -2, 1, -1, 0. More precisely,
+ we want to compute f(2^(GMP_NUMB_BITS * n)) for a polynomial f of
+ degree 7 (or 6), given the 8 (rsp. 7) values:
+
+ r1 = limit at infinity of f(x) / x^7,
+ r2 = f(4),
+ r3 = f(-4),
+ r4 = f(2),
+ r5 = f(-2),
+ r6 = f(1),
+ r7 = f(-1),
+ r8 = f(0).
+
+ All couples of the form f(n),f(-n) must be already mixed with
+ toom_couple_handling(f(n),...,f(-n),...)
+
+ The result is stored in {pp, spt + 7*n (or 6*n)}.
+ At entry, r8 is stored at {pp, 2n},
+ r5 is stored at {pp + 3n, 3n + 1}.
+
+ The other values are 2n+... limbs each (with most significant limbs small).
+
+ All intermediate results are positive.
+ Inputs are destroyed.
+*/
+
+void
+mpn_toom_interpolate_8pts (mp_ptr pp, mp_size_t n,
+ mp_ptr r3, mp_ptr r7,
+ mp_size_t spt, mp_ptr ws)
+{
+ mp_limb_signed_t cy;
+ mp_ptr r5, r1;
+ r5 = (pp + 3 * n); /* 3n+1 */
+ r1 = (pp + 7 * n); /* spt */
+
+ /******************************* interpolation *****************************/
+
+ DO_mpn_subrsh(r3+n, 2 * n + 1, pp, 2 * n, 4, ws);
+ cy = DO_mpn_sublsh_n (r3, r1, spt, 12, ws);
+ MPN_DECR_U (r3 + spt, 3 * n + 1 - spt, cy);
+
+ DO_mpn_subrsh(r5+n, 2 * n + 1, pp, 2 * n, 2, ws);
+ cy = DO_mpn_sublsh_n (r5, r1, spt, 6, ws);
+ MPN_DECR_U (r5 + spt, 3 * n + 1 - spt, cy);
+
+ r7[3*n] -= mpn_sub_n (r7+n, r7+n, pp, 2 * n);
+ cy = mpn_sub_n (r7, r7, r1, spt);
+ MPN_DECR_U (r7 + spt, 3 * n + 1 - spt, cy);
+
+ ASSERT_NOCARRY(mpn_sub_n (r3, r3, r5, 3 * n + 1));
+ ASSERT_NOCARRY(mpn_rshift(r3, r3, 3 * n + 1, 2));
+
+ ASSERT_NOCARRY(mpn_sub_n (r5, r5, r7, 3 * n + 1));
+
+ ASSERT_NOCARRY(mpn_sub_n (r3, r3, r5, 3 * n + 1));
+
+ mpn_divexact_by45 (r3, r3, 3 * n + 1);
+
+ ASSERT_NOCARRY(mpn_divexact_by3 (r5, r5, 3 * n + 1));
+
+ ASSERT_NOCARRY(DO_mpn_sublsh2_n (r5, r3, 3 * n + 1, ws));
+
+ /* last interpolation steps... */
+ /* ... are mixed with recomposition */
+
+ /***************************** recomposition *******************************/
+ /*
+ pp[] prior to operations:
+ |_H r1|_L r1|____||_H r5|_M_r5|_L r5|_____|_H r8|_L r8|pp
+
+ summation scheme for remaining operations:
+ |____8|n___7|n___6|n___5|n___4|n___3|n___2|n____|n____|pp
+ |_H r1|_L r1|____||_H*r5|_M r5|_L r5|_____|_H_r8|_L r8|pp
+ ||_H r3|_M r3|_L*r3|
+ ||_H_r7|_M_r7|_L_r7|
+ ||-H r3|-M r3|-L*r3|
+ ||-H*r5|-M_r5|-L_r5|
+ */
+
+ 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);
+
+ cy = mpn_sub_n (pp + 2*n, r7 + n, r5 + n, n); /* 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 */
+ r5[3*n]+= mpn_add_n (r5 + 2*n, r5 + 2*n, r3, n); /* Hr5+Lr3 */
+ cy-= mpn_sub_n (pp + 3*n, pp + 3*n, r5 + 2*n, n+1); /* Hr7-Hr5+Lr5-Lr3 */
+ if (UNLIKELY(0 > cy))
+ MPN_DECR_U (r5 + n + 1, 2*n, 1);
+ else
+ MPN_INCR_U (r5 + n + 1, 2*n, cy);
+
+ ASSERT_NOCARRY(mpn_sub_n(pp + 4*n, r5 + n, r3 + n, 2*n +1)); /* Mr5-Mr3,Hr5-Hr3 */
+
+ cy = mpn_add_1 (pp + 6*n, r3 + n, n, pp[6*n]);
+ MPN_INCR_U (r3 + 2*n, n + 1, cy);
+ cy = mpn_add_n (pp + 7*n, pp + 7*n, r3 + 2*n, n);
+ if (LIKELY(spt != n))
+ MPN_INCR_U (pp + 8*n, spt - n, cy + r3[3*n]);
+ else
+ ASSERT (r3[3*n] | cy == 0);
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/trialdiv.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/trialdiv.c
new file mode 100644
index 00000000000..cad159c3a09
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/trialdiv.c
@@ -0,0 +1,132 @@
+/* mpn_trialdiv -- find small factors of an mpn number using trial division.
+
+ Contributed to the GNU project by Torbjorn Granlund.
+
+ THE FUNCTION IN THIS FILE IS INTERNAL WITH A MUTABLE INTERFACE. IT IS ONLY
+ 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, 2013 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/. */
+
+/*
+ This function finds the first (smallest) factor represented in
+ trialdivtab.h. It does not stop the factoring effort just because it has
+ reached some sensible limit, such as the square root of the input number.
+
+ The caller can limit the factoring effort by passing NPRIMES. The function
+ will then divide until that limit, or perhaps a few primes more. A position
+ which only mpn_trialdiv can make sense of is returned in the WHERE
+ parameter. It can be used for restarting the factoring effort; the first
+ call should pass 0 here.
+
+ Input: 1. A non-negative number T = {tp,tn}
+ 2. NPRIMES as described above,
+ 3. *WHERE as described above.
+ Output: 1. *WHERE updated as described above.
+ 2. Return value is non-zero if we found a factor, else zero
+ To get the actual prime factor, compute the mod B inverse
+ of the return value.
+*/
+
+#include "gmp.h"
+#include "gmp-impl.h"
+
+struct gmp_primes_dtab {
+ mp_limb_t binv;
+ mp_limb_t lim;
+};
+
+struct gmp_primes_ptab {
+ mp_limb_t ppp; /* primes, multiplied together */
+ mp_limb_t cps[7]; /* ppp values pre-computed for mpn_mod_1s_4p */
+ unsigned int idx:24; /* index of first primes in dtab */
+ unsigned int np :8; /* number of primes related to this entry */
+};
+
+
+static const struct gmp_primes_dtab gmp_primes_dtab[] =
+{
+#define WANT_dtab
+#define P(p,inv,lim) {inv,lim}
+#include "trialdivtab.h"
+#undef WANT_dtab
+#undef P
+ {0,0}
+};
+
+static const struct gmp_primes_ptab gmp_primes_ptab[] =
+{
+#define WANT_ptab
+#include "trialdivtab.h"
+#undef WANT_ptab
+};
+
+#define PTAB_LINES (sizeof (gmp_primes_ptab) / sizeof (gmp_primes_ptab[0]))
+
+/* FIXME: We could optimize out one of the outer loop conditions if we
+ had a final ptab entry with a huge nd field. */
+mp_limb_t
+mpn_trialdiv (mp_srcptr tp, mp_size_t tn, mp_size_t nprimes, int *where)
+{
+ mp_limb_t ppp;
+ const mp_limb_t *cps;
+ const struct gmp_primes_dtab *dp;
+ long i, j, idx, np;
+ mp_limb_t r, q;
+
+ ASSERT (tn >= 1);
+
+ for (i = *where; i < PTAB_LINES; i++)
+ {
+ ppp = gmp_primes_ptab[i].ppp;
+ cps = gmp_primes_ptab[i].cps;
+
+ r = mpn_mod_1s_4p (tp, tn, ppp << cps[1], cps);
+
+ idx = gmp_primes_ptab[i].idx;
+ np = gmp_primes_ptab[i].np;
+
+ /* Check divisibility by individual primes. */
+ dp = &gmp_primes_dtab[idx] + np;
+ for (j = -np; j < 0; j++)
+ {
+ q = r * dp[j].binv;
+ if (q <= dp[j].lim)
+ {
+ *where = i;
+ return dp[j].binv;
+ }
+ }
+
+ nprimes -= np;
+ if (nprimes <= 0)
+ return 0;
+ }
+ return 0;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/udiv_w_sdiv.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/udiv_w_sdiv.c
new file mode 100644
index 00000000000..7136429f0f8
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/udiv_w_sdiv.c
@@ -0,0 +1,142 @@
+/* mpn_udiv_w_sdiv -- implement udiv_qrnnd on machines with only signed
+ division.
+
+ Contributed by Peter L. Montgomery.
+
+ THIS IS AN INTERNAL FUNCTION WITH A MUTABLE INTERFACE. IT IS ONLY SAFE
+ TO REACH THIS FUNCTION THROUGH DOCUMENTED INTERFACES. IN FACT, IT IS
+ ALMOST GUARANTEED THAT THIS FUNCTION WILL CHANGE OR DISAPPEAR IN A FUTURE
+ GNU MP RELEASE.
+
+
+Copyright 1992, 1994, 1996, 2000, 2011, 2012 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.h"
+#include "gmp-impl.h"
+#include "longlong.h"
+
+mp_limb_t
+mpn_udiv_w_sdiv (mp_limb_t *rp, mp_limb_t a1, mp_limb_t a0, mp_limb_t d)
+{
+ mp_limb_t q, r;
+ mp_limb_t c0, c1, b1;
+
+ ASSERT (d != 0);
+ ASSERT (a1 < d);
+
+ if ((mp_limb_signed_t) d >= 0)
+ {
+ if (a1 < d - a1 - (a0 >> (GMP_LIMB_BITS - 1)))
+ {
+ /* dividend, divisor, and quotient are nonnegative */
+ sdiv_qrnnd (q, r, a1, a0, d);
+ }
+ else
+ {
+ /* Compute c1*2^32 + c0 = a1*2^32 + a0 - 2^31*d */
+ sub_ddmmss (c1, c0, a1, a0, d >> 1, d << (GMP_LIMB_BITS - 1));
+ /* Divide (c1*2^32 + c0) by d */
+ sdiv_qrnnd (q, r, c1, c0, d);
+ /* Add 2^31 to quotient */
+ q += (mp_limb_t) 1 << (GMP_LIMB_BITS - 1);
+ }
+ }
+ else
+ {
+ b1 = d >> 1; /* d/2, between 2^30 and 2^31 - 1 */
+ c1 = a1 >> 1; /* A/2 */
+ c0 = (a1 << (GMP_LIMB_BITS - 1)) + (a0 >> 1);
+
+ if (a1 < b1) /* A < 2^32*b1, so A/2 < 2^31*b1 */
+ {
+ sdiv_qrnnd (q, r, c1, c0, b1); /* (A/2) / (d/2) */
+
+ r = 2*r + (a0 & 1); /* Remainder from A/(2*b1) */
+ if ((d & 1) != 0)
+ {
+ if (r >= q)
+ r = r - q;
+ else if (q - r <= d)
+ {
+ r = r - q + d;
+ q--;
+ }
+ else
+ {
+ r = r - q + 2*d;
+ q -= 2;
+ }
+ }
+ }
+ else if (c1 < b1) /* So 2^31 <= (A/2)/b1 < 2^32 */
+ {
+ c1 = (b1 - 1) - c1;
+ c0 = ~c0; /* logical NOT */
+
+ sdiv_qrnnd (q, r, c1, c0, b1); /* (A/2) / (d/2) */
+
+ q = ~q; /* (A/2)/b1 */
+ r = (b1 - 1) - r;
+
+ r = 2*r + (a0 & 1); /* A/(2*b1) */
+
+ if ((d & 1) != 0)
+ {
+ if (r >= q)
+ r = r - q;
+ else if (q - r <= d)
+ {
+ r = r - q + d;
+ q--;
+ }
+ else
+ {
+ r = r - q + 2*d;
+ q -= 2;
+ }
+ }
+ }
+ else /* Implies c1 = b1 */
+ { /* Hence a1 = d - 1 = 2*b1 - 1 */
+ if (a0 >= -d)
+ {
+ q = -CNST_LIMB(1);
+ r = a0 + d;
+ }
+ else
+ {
+ q = -CNST_LIMB(2);
+ r = a0 + 2*d;
+ }
+ }
+ }
+
+ *rp = r;
+ return q;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/zero.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/zero.c
new file mode 100644
index 00000000000..e6e7fd3101e
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/generic/zero.c
@@ -0,0 +1,42 @@
+/* mpn_zero
+
+Copyright 2009 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.h"
+#include "gmp-impl.h"
+
+void
+mpn_zero (mp_ptr rp, mp_size_t n)
+{
+ mp_size_t i;
+
+ rp += n;
+ for (i = -n; i != 0; i++)
+ rp[i] = 0;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/ia64/README b/Build/source/libs/gmp/gmp-6.0.0/mpn/ia64/README
new file mode 100644
index 00000000000..45c2d6337fe
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/ia64/README
@@ -0,0 +1,281 @@
+Copyright 2000-2005 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/.
+
+
+
+ IA-64 MPN SUBROUTINES
+
+
+This directory contains mpn functions for the IA-64 architecture.
+
+
+CODE ORGANIZATION
+
+ mpn/ia64 itanium-2, and generic ia64
+
+The code here has been optimized primarily for Itanium 2. Very few Itanium 1
+chips were ever sold, and Itanium 2 is more powerful, so the latter is what
+we concentrate on.
+
+
+
+CHIP NOTES
+
+The IA-64 ISA keeps instructions three and three in 128 bit bundles.
+Programmers/compilers need to put explicit breaks `;;' when there are WAW or
+RAW dependencies, with some notable exceptions. Such "breaks" are typically
+at the end of a bundle, but can be put between operations within some bundle
+types too.
+
+The Itanium 1 and Itanium 2 implementations can under ideal conditions
+execute two bundles per cycle. The Itanium 1 allows 4 of these instructions
+to do integer operations, while the Itanium 2 allows all 6 to be integer
+operations.
+
+Taken cloop branches seem to insert a bubble into the pipeline most of the
+time on Itanium 1.
+
+Loads to the fp registers bypass the L1 cache and thus get extremely long
+latencies, 9 cycles on the Itanium 1 and 6 cycles on the Itanium 2.
+
+The software pipeline stuff using br.ctop instruction causes delays, since
+many issue slots are taken up by instructions with zero predicates, and
+since many extra instructions are needed to set things up. These features
+are clearly designed for code density, not speed.
+
+Misc pipeline limitations (Itanium 1):
+* The getf.sig instruction can only execute in M0.
+* At most four integer instructions/cycle.
+* Nops take up resources like any plain instructions.
+
+Misc pipeline limitations (Itanium 2):
+* The getf.sig instruction can only execute in M0.
+* Nops take up resources like any plain instructions.
+
+
+ASSEMBLY SYNTAX
+
+.align pads with nops in a text segment, but gas 2.14 and earlier
+incorrectly byte-swaps its nop bundle in big endian mode (eg. hpux), making
+it come out as break instructions. We use the ALIGN() macro in
+mpn/ia64/ia64-defs.m4 when it might be executed across. That macro
+suppresses any .align if the problem is detected by configure. Lack of
+alignment might hurt performance but will at least be correct.
+
+foo:: to create a global symbol is not accepted by gas. Use separate
+".global foo" and "foo:" instead.
+
+.global is the standard global directive. gas accepts .globl, but hpux "as"
+doesn't.
+
+.proc / .endp generates the appropriate .type and .size information for ELF,
+so the latter directives don't need to be given explicitly.
+
+.pred.rel "mutex"... is standard for annotating predicate register
+relationships. gas also accepts .pred.rel.mutex, but hpux "as" doesn't.
+
+.pred directives can't be put on a line with a label, like
+".Lfoo: .pred ...", the HP assembler on HP-UX 11.23 rejects that.
+gas is happy with it, and past versions of HP had seemed ok.
+
+// is the standard comment sequence, but we prefer "C" since it inhibits m4
+macro expansion. See comments in ia64-defs.m4.
+
+
+REGISTER USAGE
+
+Special:
+ r0: constant 0
+ r1: global pointer (gp)
+ r8: return value
+ r12: stack pointer (sp)
+ r13: thread pointer (tp)
+Caller-saves: r8-r11 r14-r31 f6-f15 f32-f127
+Caller-saves but rotating: r32-
+
+
+================================================================
+mpn_add_n, mpn_sub_n:
+
+The current code runs at 1.25 c/l on Itanium 2.
+
+================================================================
+mpn_mul_1:
+
+The current code runs at 2 c/l on Itanium 2.
+
+Using a blocked approach, working off of 4 separate places in the operands,
+one could make use of the xma accumulation, and approach 1 c/l.
+
+ ldf8 [up]
+ xma.l
+ xma.hu
+ stf8 [wrp]
+
+================================================================
+mpn_addmul_1:
+
+The current code runs at 2 c/l on Itanium 2.
+
+It seems possible to use a blocked approach, as with mpn_mul_1. We should
+read rp[] to integer registers, allowing for just one getf.sig per cycle.
+
+ ld8 [rp]
+ ldf8 [up]
+ xma.l
+ xma.hu
+ getf.sig
+ add+add+cmp+cmp
+ st8 [wrp]
+
+These 10 instructions can be scheduled to approach 1.667 cycles, and with
+the 4 cycle latency of xma, this means we need at least 3 blocks. Using
+ldfp8 we could approach 1.583 c/l.
+
+================================================================
+mpn_submul_1:
+
+The current code runs at 2.25 c/l on Itanium 2. Getting to 2 c/l requires
+ldfp8 with all alignment headache that implies.
+
+================================================================
+mpn_addmul_N
+
+For best speed, we need to give up using mpn_addmul_2 as the main multiply
+building block, and instead take multiple v limbs per loop. For the Itanium
+1, we need to take about 8 limbs at a time for full speed. For the Itanium
+2, something like mpn_addmul_4 should be enough.
+
+The add+cmp+cmp+add we use on the other codes is optimal for shortening
+recurrencies (1 cycle) but the sequence takes up 4 execution slots. When
+recurrency depth is not critical, a more standard 3-cycle add+cmp+add is
+better.
+
+/* First load the 8 values from v */
+ ldfp8 v0, v1 = [r35], 16;;
+ ldfp8 v2, v3 = [r35], 16;;
+ ldfp8 v4, v5 = [r35], 16;;
+ ldfp8 v6, v7 = [r35], 16;;
+
+/* In the inner loop, get a new U limb and store a result limb. */
+ mov lc = un
+Loop: ldf8 u0 = [r33], 8
+ ld8 r0 = [r32]
+ xma.l lp0 = v0, u0, hp0
+ xma.hu hp0 = v0, u0, hp0
+ xma.l lp1 = v1, u0, hp1
+ xma.hu hp1 = v1, u0, hp1
+ xma.l lp2 = v2, u0, hp2
+ xma.hu hp2 = v2, u0, hp2
+ xma.l lp3 = v3, u0, hp3
+ xma.hu hp3 = v3, u0, hp3
+ xma.l lp4 = v4, u0, hp4
+ xma.hu hp4 = v4, u0, hp4
+ xma.l lp5 = v5, u0, hp5
+ xma.hu hp5 = v5, u0, hp5
+ xma.l lp6 = v6, u0, hp6
+ xma.hu hp6 = v6, u0, hp6
+ xma.l lp7 = v7, u0, hp7
+ xma.hu hp7 = v7, u0, hp7
+ getf.sig l0 = lp0
+ getf.sig l1 = lp1
+ getf.sig l2 = lp2
+ getf.sig l3 = lp3
+ getf.sig l4 = lp4
+ getf.sig l5 = lp5
+ getf.sig l6 = lp6
+ add+cmp+add xx, l0, r0
+ add+cmp+add acc0, acc1, l1
+ add+cmp+add acc1, acc2, l2
+ add+cmp+add acc2, acc3, l3
+ add+cmp+add acc3, acc4, l4
+ add+cmp+add acc4, acc5, l5
+ add+cmp+add acc5, acc6, l6
+ getf.sig acc6 = lp7
+ st8 [r32] = xx, 8
+ br.cloop Loop
+
+ 49 insn at max 6 insn/cycle: 8.167 cycles/limb8
+ 11 memops at max 2 memops/cycle: 5.5 cycles/limb8
+ 16 fpops at max 2 fpops/cycle: 8 cycles/limb8
+ 21 intops at max 4 intops/cycle: 5.25 cycles/limb8
+ 11+21 memops+intops at max 4/cycle 8 cycles/limb8
+
+================================================================
+mpn_lshift, mpn_rshift
+
+The current code runs at 1 cycle/limb on Itanium 2.
+
+Using 63 separate loops, we could use the double-word shrp instruction.
+That instruction has a plain single-cycle latency. We need 63 loops since
+this instruction only accept immediate count. That would lead to a somewhat
+silly code size, but the speed would be 0.75 c/l on Itanium 2 (by using shrp
+each cycle plus shl/shr going down I1 for a further limb every second
+cycle).
+
+================================================================
+mpn_copyi, mpn_copyd
+
+The current code runs at 0.5 c/l on Itanium 2. But that is just for L1
+cache hit. The 4-way unrolled loop takes just 2 cycles, and thus load-use
+scheduling isn't great. It might be best to actually use modulo scheduled
+loops, since that will allow us to do better load-use scheduling without too
+much unrolling.
+
+Depending on size or operand alignment, we get 1 c/l or 0.5 c/l on Itanium
+2, according to tune/speed. Cache bank conflicts?
+
+
+
+REFERENCES
+
+Intel Itanium Architecture Software Developer's Manual, volumes 1 to 3,
+Intel document 245317-004, 245318-004, 245319-004 October 2002. Volume 1
+includes an Itanium optimization guide.
+
+Intel Itanium Processor-specific Application Binary Interface (ABI), Intel
+document 245370-003, May 2001. Describes C type sizes, dynamic linking,
+etc.
+
+Intel Itanium Architecture Assembly Language Reference Guide, Intel document
+248801-004, 2000-2002. Describes assembly instruction syntax and other
+directives.
+
+Itanium Software Conventions and Runtime Architecture Guide, Intel document
+245358-003, May 2001. Describes calling conventions, including stack
+unwinding requirements.
+
+Intel Itanium Processor Reference Manual for Software Optimization, Intel
+document 245473-003, November 2001.
+
+Intel Itanium-2 Processor Reference Manual for Software Development and
+Optimization, Intel document 251110-003, May 2004.
+
+All the above documents can be found online at
+
+ http://developer.intel.com/design/itanium/manuals.htm
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/ia64/add_n_sub_n.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/ia64/add_n_sub_n.asm
new file mode 100644
index 00000000000..34a506568f5
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/ia64/add_n_sub_n.asm
@@ -0,0 +1,309 @@
+dnl IA-64 mpn_add_n_sub_n -- mpn parallel addition and subtraction.
+
+dnl Contributed to the GNU project by Torbjorn Granlund.
+
+dnl Copyright 2010 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 Itanium: ?
+C Itanium 2: 2.25
+
+C INPUT PARAMETERS
+define(`sp', `r32')
+define(`dp', `r33')
+define(`up', `r34')
+define(`vp', `r35')
+define(`n', `r36')
+
+C Some useful aliases for registers we use
+define(`u0',`r16') define(`u1',`r17') define(`u2',`r18') define(`u3',`r19')
+define(`v0',`r20') define(`v1',`r21') define(`v2',`r22') define(`v3',`r23')
+define(`s0',`r24') define(`s1',`r25') define(`s2',`r26') define(`s3',`r27')
+define(`d0',`r28') define(`d1',`r29') define(`d2',`r30') define(`d3',`r31')
+define(`up0',`up')
+define(`up1',`r14')
+define(`vp0',`vp')
+define(`vp1',`r15')
+
+define(`cmpltu', `cmp.ltu')
+define(`cmpeqor', `cmp.eq.or')
+
+ASM_START()
+PROLOGUE(mpn_add_n_sub_n)
+ .prologue
+ .save ar.lc, r2
+ .body
+ifdef(`HAVE_ABI_32',`
+ addp4 sp = 0, sp C M I
+ addp4 dp = 0, dp C M I
+ nop.i 0
+ addp4 up = 0, up C M I
+ addp4 vp = 0, vp C M I
+ zxt4 n = n C I
+ ;;
+')
+
+ and r9 = 3, n C M I
+ mov.i r2 = ar.lc C I0
+ add up1 = 8, up0 C M I
+ add vp1 = 8, vp0 C M I
+ add r8 = -2, n C M I
+ add r10 = 256, up C M I
+ ;;
+ shr.u r8 = r8, 2 C I0
+ cmp.eq p10, p0 = 0, r9 C M I
+ cmp.eq p11, p0 = 2, r9 C M I
+ cmp.eq p12, p0 = 3, r9 C M I
+ add r11 = 256, vp C M I
+ ;;
+ mov.i ar.lc = r8 C I0
+ (p10) br L(b0) C B
+ (p11) br L(b2) C B
+ (p12) br L(b3) C B
+
+L(b1): ld8 u3 = [up0], 8 C M01
+ add up1 = 8, up1 C M I
+ cmpltu p14, p15 = 4, n C M I
+ ld8 v3 = [vp0], 8 C M01
+ add vp1 = 8, vp1 C M I
+ ;;
+ add s3 = u3, v3 C M I
+ sub d3 = u3, v3 C M I
+ mov r8 = 0 C M I
+ ;;
+ cmpltu p9, p0 = s3, v3 C carry from add3 M I
+ cmpltu p13, p0 = u3, v3 C borrow from sub3 M I
+ (p15) br L(cj1) C B
+ st8 [sp] = s3, 8 C M23
+ st8 [dp] = d3, 8 C M23
+ br L(c0) C B
+
+L(b0): cmp.ne p9, p0 = r0, r0 C M I
+ cmp.ne p13, p0 = r0, r0 C M I
+L(c0): ld8 u0 = [up0], 16 C M01
+ ld8 u1 = [up1], 16 C M01
+ ;;
+ ld8 v0 = [vp0], 16 C M01
+ ld8 v1 = [vp1], 16 C M01
+ ;;
+ ld8 u2 = [up0], 16 C M01
+ ld8 u3 = [up1], 16 C M01
+ ;;
+ ld8 v2 = [vp0], 16 C M01
+ ld8 v3 = [vp1], 16 C M01
+ ;;
+ add s0 = u0, v0 C M I
+ add s1 = u1, v1 C M I
+ sub d0 = u0, v0 C M I
+ sub d1 = u1, v1 C M I
+ ;;
+ cmpltu p6, p0 = s0, v0 C carry from add0 M I
+ cmpltu p7, p0 = s1, v1 C carry from add1 M I
+ cmpltu p10, p0 = u0, v0 C borrow from sub0 M I
+ cmpltu p11, p0 = u1, v1 C borrow from sub1 M I
+ ;;
+ nop 0 C
+ br.cloop.dptk L(top) C B
+ br L(end) C B
+
+L(b3): ld8 u1 = [up0], 8 C M01
+ add up1 = 8, up1 C M I
+ ld8 v1 = [vp0], 8 C M01
+ ;;
+ add vp1 = 8, vp1 C M I
+ add s1 = u1, v1 C M I
+ sub d1 = u1, v1 C M I
+ ;;
+ cmpltu p7, p0 = s1, v1 C carry from add1 M I
+ cmpltu p11, p0 = u1, v1 C borrow from sub1 M I
+ ;;
+ st8 [sp] = s1, 8 C M23
+ st8 [dp] = d1, 8 C M23
+ br L(c2) C B
+
+ ALIGN(32)
+L(b2): cmp.ne p7, p0 = r0, r0 C M I
+ cmp.ne p11, p0 = r0, r0 C M I
+ nop 0
+L(c2): ld8 u2 = [up0], 16 C M01
+ ld8 u3 = [up1], 16 C M01
+ cmpltu p14, p0 = 4, n C M I
+ ;;
+ ld8 v2 = [vp0], 16 C M01
+ ld8 v3 = [vp1], 16 C M01
+ (p14) br L(gt4) C B
+ ;;
+ add s2 = u2, v2 C M I
+ add s3 = u3, v3 C M I
+ sub d2 = u2, v2 C M I
+ sub d3 = u3, v3 C M I
+ ;;
+ cmpltu p8, p0 = s2, v2 C carry from add0 M I
+ cmpltu p9, p0 = s3, v3 C carry from add3 M I
+ cmpltu p12, p0 = u2, v2 C borrow from sub2 M I
+ cmpltu p13, p0 = u3, v3 C borrow from sub3 M I
+ br L(cj2) C B
+ ;;
+L(gt4): ld8 u0 = [up0], 16 C M01
+ ld8 u1 = [up1], 16 C M01
+ ;;
+ ld8 v0 = [vp0], 16 C M01
+ ld8 v1 = [vp1], 16 C M01
+ ;;
+ add s2 = u2, v2 C M I
+ add s3 = u3, v3 C M I
+ sub d2 = u2, v2 C M I
+ sub d3 = u3, v3 C M I
+ ;;
+ cmpltu p8, p0 = s2, v2 C carry from add0 M I
+ cmpltu p9, p0 = s3, v3 C carry from add1 M I
+ cmpltu p12, p0 = u2, v2 C borrow from sub0 M I
+ cmpltu p13, p0 = u3, v3 C borrow from sub1 M I
+ br.cloop.dptk L(mid) C B
+
+ ALIGN(32)
+L(top):
+ ld8 u0 = [up0], 16 C M01
+ ld8 u1 = [up1], 16 C M01
+ (p9) cmpeqor p6, p0 = -1, s0 C M I
+ (p9) add s0 = 1, s0 C M I
+ (p13) cmpeqor p10, p0 = 0, d0 C M I
+ (p13) add d0 = -1, d0 C M I
+ ;;
+ ld8 v0 = [vp0], 16 C M01
+ ld8 v1 = [vp1], 16 C M01
+ (p6) cmpeqor p7, p0 = -1, s1 C M I
+ (p6) add s1 = 1, s1 C M I
+ (p10) cmpeqor p11, p0 = 0, d1 C M I
+ (p10) add d1 = -1, d1 C M I
+ ;;
+ st8 [sp] = s0, 8 C M23
+ st8 [dp] = d0, 8 C M23
+ add s2 = u2, v2 C M I
+ add s3 = u3, v3 C M I
+ sub d2 = u2, v2 C M I
+ sub d3 = u3, v3 C M I
+ ;;
+ st8 [sp] = s1, 8 C M23
+ st8 [dp] = d1, 8 C M23
+ cmpltu p8, p0 = s2, v2 C carry from add2 M I
+ cmpltu p9, p0 = s3, v3 C carry from add3 M I
+ cmpltu p12, p0 = u2, v2 C borrow from sub2 M I
+ cmpltu p13, p0 = u3, v3 C borrow from sub3 M I
+ ;;
+L(mid):
+ ld8 u2 = [up0], 16 C M01
+ ld8 u3 = [up1], 16 C M01
+ (p7) cmpeqor p8, p0 = -1, s2 C M I
+ (p7) add s2 = 1, s2 C M I
+ (p11) cmpeqor p12, p0 = 0, d2 C M I
+ (p11) add d2 = -1, d2 C M I
+ ;;
+ ld8 v2 = [vp0], 16 C M01
+ ld8 v3 = [vp1], 16 C M01
+ (p8) cmpeqor p9, p0 = -1, s3 C M I
+ (p8) add s3 = 1, s3 C M I
+ (p12) cmpeqor p13, p0 = 0, d3 C M I
+ (p12) add d3 = -1, d3 C M I
+ ;;
+ st8 [sp] = s2, 8 C M23
+ st8 [dp] = d2, 8 C M23
+ add s0 = u0, v0 C M I
+ add s1 = u1, v1 C M I
+ sub d0 = u0, v0 C M I
+ sub d1 = u1, v1 C M I
+ ;;
+ st8 [sp] = s3, 8 C M23
+ st8 [dp] = d3, 8 C M23
+ cmpltu p6, p0 = s0, v0 C carry from add0 M I
+ cmpltu p7, p0 = s1, v1 C carry from add1 M I
+ cmpltu p10, p0 = u0, v0 C borrow from sub0 M I
+ cmpltu p11, p0 = u1, v1 C borrow from sub1 M I
+ ;;
+ lfetch [r10], 32 C M?
+ lfetch [r11], 32 C M?
+ br.cloop.dptk L(top) C B
+ ;;
+
+L(end):
+ nop 0
+ nop 0
+ (p9) cmpeqor p6, p0 = -1, s0 C M I
+ (p9) add s0 = 1, s0 C M I
+ (p13) cmpeqor p10, p0 = 0, d0 C M I
+ (p13) add d0 = -1, d0 C M I
+ ;;
+ nop 0
+ nop 0
+ (p6) cmpeqor p7, p0 = -1, s1 C M I
+ (p6) add s1 = 1, s1 C M I
+ (p10) cmpeqor p11, p0 = 0, d1 C M I
+ (p10) add d1 = -1, d1 C M I
+ ;;
+ st8 [sp] = s0, 8 C M23
+ st8 [dp] = d0, 8 C M23
+ add s2 = u2, v2 C M I
+ add s3 = u3, v3 C M I
+ sub d2 = u2, v2 C M I
+ sub d3 = u3, v3 C M I
+ ;;
+ st8 [sp] = s1, 8 C M23
+ st8 [dp] = d1, 8 C M23
+ cmpltu p8, p0 = s2, v2 C carry from add2 M I
+ cmpltu p9, p0 = s3, v3 C carry from add3 M I
+ cmpltu p12, p0 = u2, v2 C borrow from sub2 M I
+ cmpltu p13, p0 = u3, v3 C borrow from sub3 M I
+ ;;
+L(cj2):
+ (p7) cmpeqor p8, p0 = -1, s2 C M I
+ (p7) add s2 = 1, s2 C M I
+ (p11) cmpeqor p12, p0 = 0, d2 C M I
+ (p11) add d2 = -1, d2 C M I
+ mov r8 = 0 C M I
+ nop 0
+ ;;
+ st8 [sp] = s2, 8 C M23
+ st8 [dp] = d2, 8 C M23
+ (p8) cmpeqor p9, p0 = -1, s3 C M I
+ (p8) add s3 = 1, s3 C M I
+ (p12) cmpeqor p13, p0 = 0, d3 C M I
+ (p12) add d3 = -1, d3 C M I
+ ;;
+L(cj1):
+ (p9) mov r8 = 2 C M I
+ ;;
+ mov.i ar.lc = r2 C I0
+ (p13) add r8 = 1, r8 C M I
+ st8 [sp] = s3 C M23
+ st8 [dp] = d3 C M23
+ br.ret.sptk.many b0 C B
+EPILOGUE()
+ASM_END()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/ia64/addmul_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/ia64/addmul_1.asm
new file mode 100644
index 00000000000..ffa3297763c
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/ia64/addmul_1.asm
@@ -0,0 +1,602 @@
+dnl IA-64 mpn_addmul_1 -- Multiply a limb vector with a limb and add the
+dnl result to a second limb vector.
+
+dnl Contributed to the GNU project by Torbjorn Granlund.
+
+dnl Copyright 2000-2005, 2007 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 Itanium: 3.0
+C Itanium 2: 2.0
+
+C TODO
+C * Further optimize feed-in and wind-down code, both for speed and code size.
+C * Handle low limb input and results specially, using a common stf8 in the
+C epilogue.
+C * Use 1 c/l carry propagation scheme in wind-down code.
+C * Use extra pointer registers for `up' and rp to speed up feed-in loads.
+C * Work out final differences with mul_1.asm. That function is 300 bytes
+C smaller than this due to better loop scheduling and thus simpler feed-in
+C code.
+
+C INPUT PARAMETERS
+define(`rp', `r32')
+define(`up', `r33')
+define(`n', `r34')
+define(`vl', `r35')
+
+ASM_START()
+PROLOGUE(mpn_addmul_1)
+ .prologue
+ .save ar.lc, r2
+ .body
+
+ifdef(`HAVE_ABI_32',
+` addp4 rp = 0, rp C M I
+ addp4 up = 0, up C M I
+ zxt4 n = n C I
+ ;;
+')
+{.mmi
+ adds r15 = -1, n C M I
+ mov r20 = rp C M I
+ mov.i r2 = ar.lc C I0
+}
+{.mmi
+ ldf8 f7 = [up], 8 C M
+ ldf8 f8 = [rp], 8 C M
+ and r14 = 3, n C M I
+ ;;
+}
+{.mmi
+ setf.sig f6 = vl C M2 M3
+ cmp.eq p10, p0 = 0, r14 C M I
+ shr.u r31 = r15, 2 C I0
+}
+{.mmi
+ cmp.eq p11, p0 = 2, r14 C M I
+ cmp.eq p12, p0 = 3, r14 C M I
+ nop.i 0 C I
+ ;;
+}
+{.mii
+ cmp.ne p6, p7 = r0, r0 C M I
+ mov.i ar.lc = r31 C I0
+ cmp.ne p8, p9 = r0, r0 C M I
+}
+{.bbb
+ (p10) br.dptk .Lb00 C B
+ (p11) br.dptk .Lb10 C B
+ (p12) br.dptk .Lb11 C B
+ ;;
+}
+
+.Lb01: br.cloop.dptk .grt1 C B
+
+ xma.l f39 = f7, f6, f8 C F
+ xma.hu f43 = f7, f6, f8 C F
+ ;;
+ getf.sig r8 = f43 C M2
+ stf8 [r20] = f39 C M2 M3
+ mov.i ar.lc = r2 C I0
+ br.ret.sptk.many b0 C B
+
+.grt1:
+ ldf8 f32 = [up], 8
+ ldf8 f44 = [rp], 8
+ ;;
+ ldf8 f33 = [up], 8
+ ldf8 f45 = [rp], 8
+ ;;
+ ldf8 f34 = [up], 8
+ xma.l f39 = f7, f6, f8
+ ldf8 f46 = [rp], 8
+ xma.hu f43 = f7, f6, f8
+ ;;
+ ldf8 f35 = [up], 8
+ ldf8 f47 = [rp], 8
+ br.cloop.dptk .grt5
+
+ xma.l f36 = f32, f6, f44
+ xma.hu f40 = f32, f6, f44
+ ;;
+ stf8 [r20] = f39, 8
+ xma.l f37 = f33, f6, f45
+ xma.hu f41 = f33, f6, f45
+ ;;
+ getf.sig r31 = f43
+ getf.sig r24 = f36
+ xma.l f38 = f34, f6, f46
+ xma.hu f42 = f34, f6, f46
+ ;;
+ getf.sig r28 = f40
+ getf.sig r25 = f37
+ xma.l f39 = f35, f6, f47
+ xma.hu f43 = f35, f6, f47
+ ;;
+ getf.sig r29 = f41
+ getf.sig r26 = f38
+ br .Lcj5
+
+.grt5:
+ mov r30 = 0
+ xma.l f36 = f32, f6, f44
+ xma.hu f40 = f32, f6, f44
+ ;;
+ ldf8 f32 = [up], 8
+ xma.l f37 = f33, f6, f45
+ ldf8 f44 = [rp], 8
+ xma.hu f41 = f33, f6, f45
+ ;;
+ ldf8 f33 = [up], 8
+ getf.sig r27 = f39
+ ;;
+ getf.sig r31 = f43
+ xma.l f38 = f34, f6, f46
+ ldf8 f45 = [rp], 8
+ xma.hu f42 = f34, f6, f46
+ ;;
+ ldf8 f34 = [up], 8
+ getf.sig r24 = f36
+ ;;
+ getf.sig r28 = f40
+ xma.l f39 = f35, f6, f47
+ ldf8 f46 = [rp], 8
+ xma.hu f43 = f35, f6, f47
+ ;;
+ ldf8 f35 = [up], 8
+ getf.sig r25 = f37
+ br.cloop.dptk .Loop
+ br .Le0
+
+
+.Lb10: ldf8 f35 = [up], 8
+ ldf8 f47 = [rp], 8
+ br.cloop.dptk .grt2
+
+ xma.l f38 = f7, f6, f8
+ xma.hu f42 = f7, f6, f8
+ ;;
+ xma.l f39 = f35, f6, f47
+ xma.hu f43 = f35, f6, f47
+ ;;
+ getf.sig r30 = f42
+ stf8 [r20] = f38, 8
+ getf.sig r27 = f39
+ getf.sig r8 = f43
+ br .Lcj2
+
+.grt2:
+ ldf8 f32 = [up], 8
+ ldf8 f44 = [rp], 8
+ ;;
+ ldf8 f33 = [up], 8
+ xma.l f38 = f7, f6, f8
+ ldf8 f45 = [rp], 8
+ xma.hu f42 = f7, f6, f8
+ ;;
+ ldf8 f34 = [up], 8
+ xma.l f39 = f35, f6, f47
+ ldf8 f46 = [rp], 8
+ xma.hu f43 = f35, f6, f47
+ ;;
+ ldf8 f35 = [up], 8
+ ldf8 f47 = [rp], 8
+ br.cloop.dptk .grt6
+
+ stf8 [r20] = f38, 8
+ xma.l f36 = f32, f6, f44
+ xma.hu f40 = f32, f6, f44
+ ;;
+ getf.sig r30 = f42
+ getf.sig r27 = f39
+ xma.l f37 = f33, f6, f45
+ xma.hu f41 = f33, f6, f45
+ ;;
+ getf.sig r31 = f43
+ getf.sig r24 = f36
+ xma.l f38 = f34, f6, f46
+ xma.hu f42 = f34, f6, f46
+ ;;
+ getf.sig r28 = f40
+ getf.sig r25 = f37
+ xma.l f39 = f35, f6, f47
+ xma.hu f43 = f35, f6, f47
+ br .Lcj6
+
+.grt6:
+ mov r29 = 0
+ xma.l f36 = f32, f6, f44
+ xma.hu f40 = f32, f6, f44
+ ;;
+ ldf8 f32 = [up], 8
+ getf.sig r26 = f38
+ ;;
+ getf.sig r30 = f42
+ xma.l f37 = f33, f6, f45
+ ldf8 f44 = [rp], 8
+ xma.hu f41 = f33, f6, f45
+ ;;
+ ldf8 f33 = [up], 8
+ getf.sig r27 = f39
+ ;;
+ getf.sig r31 = f43
+ xma.l f38 = f34, f6, f46
+ ldf8 f45 = [rp], 8
+ xma.hu f42 = f34, f6, f46
+ ;;
+ ldf8 f34 = [up], 8
+ getf.sig r24 = f36
+ br .LL10
+
+
+.Lb11: ldf8 f34 = [up], 8
+ ldf8 f46 = [rp], 8
+ ;;
+ ldf8 f35 = [up], 8
+ ldf8 f47 = [rp], 8
+ br.cloop.dptk .grt3
+ ;;
+
+ xma.l f37 = f7, f6, f8
+ xma.hu f41 = f7, f6, f8
+ xma.l f38 = f34, f6, f46
+ xma.hu f42 = f34, f6, f46
+ xma.l f39 = f35, f6, f47
+ xma.hu f43 = f35, f6, f47
+ ;;
+ getf.sig r29 = f41
+ stf8 [r20] = f37, 8
+ getf.sig r26 = f38
+ getf.sig r30 = f42
+ getf.sig r27 = f39
+ getf.sig r8 = f43
+ br .Lcj3
+
+.grt3:
+ ldf8 f32 = [up], 8
+ xma.l f37 = f7, f6, f8
+ ldf8 f44 = [rp], 8
+ xma.hu f41 = f7, f6, f8
+ ;;
+ ldf8 f33 = [up], 8
+ xma.l f38 = f34, f6, f46
+ ldf8 f45 = [rp], 8
+ xma.hu f42 = f34, f6, f46
+ ;;
+ ldf8 f34 = [up], 8
+ xma.l f39 = f35, f6, f47
+ ldf8 f46 = [rp], 8
+ xma.hu f43 = f35, f6, f47
+ ;;
+ ldf8 f35 = [up], 8
+ getf.sig r25 = f37 C FIXME
+ ldf8 f47 = [rp], 8
+ br.cloop.dptk .grt7
+
+ getf.sig r29 = f41
+ stf8 [r20] = f37, 8 C FIXME
+ xma.l f36 = f32, f6, f44
+ getf.sig r26 = f38
+ xma.hu f40 = f32, f6, f44
+ ;;
+ getf.sig r30 = f42
+ xma.l f37 = f33, f6, f45
+ getf.sig r27 = f39
+ xma.hu f41 = f33, f6, f45
+ ;;
+ getf.sig r31 = f43
+ xma.l f38 = f34, f6, f46
+ getf.sig r24 = f36
+ xma.hu f42 = f34, f6, f46
+ br .Lcj7
+
+.grt7:
+ getf.sig r29 = f41
+ xma.l f36 = f32, f6, f44
+ mov r28 = 0
+ xma.hu f40 = f32, f6, f44
+ ;;
+ ldf8 f32 = [up], 8
+ getf.sig r26 = f38
+ ;;
+ getf.sig r30 = f42
+ xma.l f37 = f33, f6, f45
+ ldf8 f44 = [rp], 8
+ xma.hu f41 = f33, f6, f45
+ ;;
+ ldf8 f33 = [up], 8
+ getf.sig r27 = f39
+ br .LL11
+
+
+.Lb00: ldf8 f33 = [up], 8
+ ldf8 f45 = [rp], 8
+ ;;
+ ldf8 f34 = [up], 8
+ ldf8 f46 = [rp], 8
+ ;;
+ ldf8 f35 = [up], 8
+ xma.l f36 = f7, f6, f8
+ ldf8 f47 = [rp], 8
+ xma.hu f40 = f7, f6, f8
+ br.cloop.dptk .grt4
+
+ xma.l f37 = f33, f6, f45
+ xma.hu f41 = f33, f6, f45
+ xma.l f38 = f34, f6, f46
+ xma.hu f42 = f34, f6, f46
+ ;;
+ getf.sig r28 = f40
+ stf8 [r20] = f36, 8
+ xma.l f39 = f35, f6, f47
+ getf.sig r25 = f37
+ xma.hu f43 = f35, f6, f47
+ ;;
+ getf.sig r29 = f41
+ getf.sig r26 = f38
+ getf.sig r30 = f42
+ getf.sig r27 = f39
+ br .Lcj4
+
+.grt4:
+ ldf8 f32 = [up], 8
+ xma.l f37 = f33, f6, f45
+ ldf8 f44 = [rp], 8
+ xma.hu f41 = f33, f6, f45
+ ;;
+ ldf8 f33 = [up], 8
+ xma.l f38 = f34, f6, f46
+ ldf8 f45 = [rp], 8
+ xma.hu f42 = f34, f6, f46
+ ;;
+ ldf8 f34 = [up], 8
+ getf.sig r24 = f36 C FIXME
+ xma.l f39 = f35, f6, f47
+ ldf8 f46 = [rp], 8
+ getf.sig r28 = f40
+ xma.hu f43 = f35, f6, f47
+ ;;
+ ldf8 f35 = [up], 8
+ getf.sig r25 = f37
+ ldf8 f47 = [rp], 8
+ br.cloop.dptk .grt8
+
+ getf.sig r29 = f41
+ stf8 [r20] = f36, 8 C FIXME
+ xma.l f36 = f32, f6, f44
+ getf.sig r26 = f38
+ getf.sig r30 = f42
+ xma.hu f40 = f32, f6, f44
+ ;;
+ xma.l f37 = f33, f6, f45
+ getf.sig r27 = f39
+ xma.hu f41 = f33, f6, f45
+ br .Lcj8
+
+.grt8:
+ getf.sig r29 = f41
+ xma.l f36 = f32, f6, f44
+ mov r31 = 0
+ xma.hu f40 = f32, f6, f44
+ ;;
+ ldf8 f32 = [up], 8
+ getf.sig r26 = f38
+ br .LL00
+
+
+C *** MAIN LOOP START ***
+ ALIGN(32) C insn fed cycle #
+.Loop:
+ .pred.rel "mutex", p6, p7 C num by i1 i2
+ getf.sig r29 = f41 C 00 16 0 0
+ xma.l f36 = f32, f6, f44 C 01 06,15 0 0
+ (p6) add r14 = r30, r27, 1 C 02 0 0
+ ldf8 f47 = [rp], 8 C 03 0 0
+ xma.hu f40 = f32, f6, f44 C 04 06,15 0 0
+ (p7) add r14 = r30, r27 C 05 0 0
+ ;;
+ .pred.rel "mutex", p6, p7
+ ldf8 f32 = [up], 8 C 06 1 1
+ (p6) cmp.leu p8, p9 = r14, r27 C 07 1 1
+ (p7) cmp.ltu p8, p9 = r14, r27 C 08 1 1
+ getf.sig r26 = f38 C 09 25 2 1
+ st8 [r20] = r14, 8 C 10 2 1
+ nop.b 0 C 11 2 1
+ ;;
+.LL00:
+ .pred.rel "mutex", p8, p9
+ getf.sig r30 = f42 C 12 28 3 2
+ xma.l f37 = f33, f6, f45 C 13 18,27 3 2
+ (p8) add r16 = r31, r24, 1 C 14 3 2
+ ldf8 f44 = [rp], 8 C 15 3 2
+ xma.hu f41 = f33, f6, f45 C 16 18,27 3 2
+ (p9) add r16 = r31, r24 C 17 3 2
+ ;;
+ .pred.rel "mutex", p8, p9
+ ldf8 f33 = [up], 8 C 18 4 3
+ (p8) cmp.leu p6, p7 = r16, r24 C 19 4 3
+ (p9) cmp.ltu p6, p7 = r16, r24 C 20 4 3
+ getf.sig r27 = f39 C 21 37 5 3
+ st8 [r20] = r16, 8 C 22 5 3
+ nop.b 0 C 23 5 3
+ ;;
+.LL11:
+ .pred.rel "mutex", p6, p7
+ getf.sig r31 = f43 C 24 40 6 4
+ xma.l f38 = f34, f6, f46 C 25 30,39 6 4
+ (p6) add r14 = r28, r25, 1 C 26 6 4
+ ldf8 f45 = [rp], 8 C 27 6 4
+ xma.hu f42 = f34, f6, f46 C 28 30,39 6 4
+ (p7) add r14 = r28, r25 C 29 6 4
+ ;;
+ .pred.rel "mutex", p6, p7
+ ldf8 f34 = [up], 8 C 30 7 5
+ (p6) cmp.leu p8, p9 = r14, r25 C 31 7 5
+ (p7) cmp.ltu p8, p9 = r14, r25 C 32 7 5
+ getf.sig r24 = f36 C 33 01 8 5
+ st8 [r20] = r14, 8 C 34 8 5
+ nop.b 0 C 35 8 5
+ ;;
+.LL10:
+ .pred.rel "mutex", p8, p9
+ getf.sig r28 = f40 C 36 04 9 6
+ xma.l f39 = f35, f6, f47 C 37 42,03 9 6
+ (p8) add r16 = r29, r26, 1 C 38 9 6
+ ldf8 f46 = [rp], 8 C 39 9 6
+ xma.hu f43 = f35, f6, f47 C 40 42,03 9 6
+ (p9) add r16 = r29, r26 C 41 9 6
+ ;;
+ .pred.rel "mutex", p8, p9
+ ldf8 f35 = [up], 8 C 42 10 7
+ (p8) cmp.leu p6, p7 = r16, r26 C 43 10 7
+ (p9) cmp.ltu p6, p7 = r16, r26 C 44 10 7
+ getf.sig r25 = f37 C 45 13 11 7
+ st8 [r20] = r16, 8 C 46 11 7
+ br.cloop.dptk .Loop C 47 11 7
+C *** MAIN LOOP END ***
+ ;;
+.Le0:
+ .pred.rel "mutex", p6, p7
+ getf.sig r29 = f41 C
+ xma.l f36 = f32, f6, f44 C
+ (p6) add r14 = r30, r27, 1 C
+ ldf8 f47 = [rp], 8 C
+ xma.hu f40 = f32, f6, f44 C
+ (p7) add r14 = r30, r27 C
+ ;;
+ .pred.rel "mutex", p6, p7
+ (p6) cmp.leu p8, p9 = r14, r27 C
+ (p7) cmp.ltu p8, p9 = r14, r27 C
+ getf.sig r26 = f38 C
+ st8 [r20] = r14, 8 C
+ ;;
+ .pred.rel "mutex", p8, p9
+ getf.sig r30 = f42 C
+ xma.l f37 = f33, f6, f45 C
+ (p8) add r16 = r31, r24, 1 C
+ xma.hu f41 = f33, f6, f45 C
+ (p9) add r16 = r31, r24 C
+ ;;
+ .pred.rel "mutex", p8, p9
+ (p8) cmp.leu p6, p7 = r16, r24 C
+ (p9) cmp.ltu p6, p7 = r16, r24 C
+ getf.sig r27 = f39 C
+ st8 [r20] = r16, 8 C
+ ;;
+.Lcj8:
+ .pred.rel "mutex", p6, p7
+ getf.sig r31 = f43 C
+ xma.l f38 = f34, f6, f46 C
+ (p6) add r14 = r28, r25, 1 C
+ xma.hu f42 = f34, f6, f46 C
+ (p7) add r14 = r28, r25 C
+ ;;
+ .pred.rel "mutex", p6, p7
+ (p6) cmp.leu p8, p9 = r14, r25 C
+ (p7) cmp.ltu p8, p9 = r14, r25 C
+ getf.sig r24 = f36 C
+ st8 [r20] = r14, 8 C
+ ;;
+.Lcj7:
+ .pred.rel "mutex", p8, p9
+ getf.sig r28 = f40 C
+ xma.l f39 = f35, f6, f47 C
+ (p8) add r16 = r29, r26, 1 C
+ xma.hu f43 = f35, f6, f47 C
+ (p9) add r16 = r29, r26 C
+ ;;
+ .pred.rel "mutex", p8, p9
+ (p8) cmp.leu p6, p7 = r16, r26 C
+ (p9) cmp.ltu p6, p7 = r16, r26 C
+ getf.sig r25 = f37 C
+ st8 [r20] = r16, 8 C
+ ;;
+.Lcj6:
+ .pred.rel "mutex", p6, p7
+ getf.sig r29 = f41 C
+ (p6) add r14 = r30, r27, 1 C
+ (p7) add r14 = r30, r27 C
+ ;;
+ .pred.rel "mutex", p6, p7
+ (p6) cmp.leu p8, p9 = r14, r27 C
+ (p7) cmp.ltu p8, p9 = r14, r27 C
+ getf.sig r26 = f38 C
+ st8 [r20] = r14, 8 C
+ ;;
+.Lcj5:
+ .pred.rel "mutex", p8, p9
+ getf.sig r30 = f42 C
+ (p8) add r16 = r31, r24, 1 C
+ (p9) add r16 = r31, r24 C
+ ;;
+ .pred.rel "mutex", p8, p9
+ (p8) cmp.leu p6, p7 = r16, r24 C
+ (p9) cmp.ltu p6, p7 = r16, r24 C
+ getf.sig r27 = f39 C
+ st8 [r20] = r16, 8 C
+ ;;
+.Lcj4:
+ .pred.rel "mutex", p6, p7
+ getf.sig r8 = f43 C
+ (p6) add r14 = r28, r25, 1 C
+ (p7) add r14 = r28, r25 C
+ ;;
+ .pred.rel "mutex", p6, p7
+ st8 [r20] = r14, 8 C
+ (p6) cmp.leu p8, p9 = r14, r25 C
+ (p7) cmp.ltu p8, p9 = r14, r25 C
+ ;;
+.Lcj3:
+ .pred.rel "mutex", p8, p9
+ (p8) add r16 = r29, r26, 1 C
+ (p9) add r16 = r29, r26 C
+ ;;
+ .pred.rel "mutex", p8, p9
+ st8 [r20] = r16, 8 C
+ (p8) cmp.leu p6, p7 = r16, r26 C
+ (p9) cmp.ltu p6, p7 = r16, r26 C
+ ;;
+.Lcj2:
+ .pred.rel "mutex", p6, p7
+ (p6) add r14 = r30, r27, 1 C
+ (p7) add r14 = r30, r27 C
+ ;;
+ .pred.rel "mutex", p6, p7
+ st8 [r20] = r14 C
+ (p6) cmp.leu p8, p9 = r14, r27 C
+ (p7) cmp.ltu p8, p9 = r14, r27 C
+ ;;
+ (p8) add r8 = 1, r8 C M I
+ mov.i ar.lc = r2 C I0
+ br.ret.sptk.many b0 C B
+EPILOGUE()
+ASM_END()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/ia64/addmul_2.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/ia64/addmul_2.asm
new file mode 100644
index 00000000000..f5bc46b75df
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/ia64/addmul_2.asm
@@ -0,0 +1,708 @@
+dnl IA-64 mpn_addmul_2 -- Multiply a n-limb number with a 2-limb number and
+dnl add the result to a (n+1)-limb number.
+
+dnl Contributed to the GNU project by Torbjorn Granlund.
+
+dnl Copyright 2004, 2005, 2011 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 Itanium: 3.65
+C Itanium 2: 1.625
+
+C TODO
+C * Clean up variable names, and try to decrease the number of distinct
+C registers used.
+C * Clean up feed-in code to not require zeroing several registers.
+C * Make sure we don't depend on uninitialised predicate registers.
+C * Could perhaps save a few cycles by using 1 c/l carry propagation in
+C wind-down code.
+C * Ultimately rewrite. The problem with this code is that it first uses a
+C loaded u value in one xma pair, then leaves it live over several unrelated
+C xma pairs, before it uses it again. It should actually be quite possible
+C to just swap some aligned xma pairs around. But we should then schedule
+C u loads further from the first use.
+
+C INPUT PARAMETERS
+define(`rp',`r32')
+define(`up',`r33')
+define(`n',`r34')
+define(`vp',`r35')
+
+define(`srp',`r3')
+
+define(`v0',`f6')
+define(`v1',`f7')
+
+define(`s0',`r14')
+define(`acc0',`r15')
+
+define(`pr0_0',`r16') define(`pr0_1',`r17')
+define(`pr0_2',`r18') define(`pr0_3',`r19')
+
+define(`pr1_0',`r20') define(`pr1_1',`r21')
+define(`pr1_2',`r22') define(`pr1_3',`r23')
+
+define(`acc1_0',`r24') define(`acc1_1',`r25')
+define(`acc1_2',`r26') define(`acc1_3',`r27')
+
+dnl define(`',`r28')
+dnl define(`',`r29')
+dnl define(`',`r30')
+dnl define(`',`r31')
+
+define(`fp0b_0',`f8') define(`fp0b_1',`f9')
+define(`fp0b_2',`f10') define(`fp0b_3',`f11')
+
+define(`fp1a_0',`f12') define(`fp1a_1',`f13')
+define(`fp1a_2',`f14') define(`fp1a_3',`f15')
+
+define(`fp1b_0',`f32') define(`fp1b_1',`f33')
+define(`fp1b_2',`f34') define(`fp1b_3',`f35')
+
+define(`fp2a_0',`f36') define(`fp2a_1',`f37')
+define(`fp2a_2',`f38') define(`fp2a_3',`f39')
+
+define(`r_0',`f40') define(`r_1',`f41')
+define(`r_2',`f42') define(`r_3',`f43')
+
+define(`u_0',`f44') define(`u_1',`f45')
+define(`u_2',`f46') define(`u_3',`f47')
+
+define(`rx',`f48')
+define(`ux',`f49')
+define(`ry',`f50')
+define(`uy',`f51')
+
+ASM_START()
+PROLOGUE(mpn_addmul_2s)
+ .prologue
+ .save ar.lc, r2
+ .body
+
+ifdef(`HAVE_ABI_32',`
+.mmi; addp4 rp = 0, rp C M I
+ addp4 up = 0, up C M I
+ addp4 vp = 0, vp C M I
+.mmi; nop 1
+ nop 1
+ zxt4 n = n C I
+ ;;')
+
+.mmi; ldf8 ux = [up], 8 C M
+ ldf8 v0 = [vp], 8 C M
+ mov r2 = ar.lc C I0
+.mmi; ldf8 rx = [rp], 8 C M
+ and r14 = 3, n C M I
+ add n = -2, n C M I
+ ;;
+.mmi; ldf8 uy = [up], 8 C M
+ ldf8 v1 = [vp] C M
+ shr.u n = n, 2 C I0
+.mmi; ldf8 ry = [rp], -8 C M
+ cmp.eq p14, p0 = 1, r14 C M I
+ cmp.eq p11, p0 = 2, r14 C M I
+ ;;
+.mmi; add srp = 16, rp C M I
+ cmp.eq p15, p0 = 3, r14 C M I
+ mov ar.lc = n C I0
+.bbb; (p14) br.dptk L(x01) C B
+ (p11) br.dptk L(x10) C B
+ (p15) br.dptk L(x11) C B
+ ;;
+
+L(x00): cmp.ne p6, p0 = r0, r0 C suppress initial xma pair
+ mov fp2a_3 = f0
+ br L(b00)
+L(x01): cmp.ne p14, p0 = r0, r0 C suppress initial xma pair
+ mov fp2a_2 = f0
+ br L(b01)
+L(x10): cmp.ne p11, p0 = r0, r0 C suppress initial xma pair
+ mov fp2a_1 = f0
+ br L(b10)
+L(x11): cmp.ne p15, p0 = r0, r0 C suppress initial xma pair
+ mov fp2a_0 = f0
+ br L(b11)
+
+EPILOGUE()
+
+PROLOGUE(mpn_addmul_2)
+ .prologue
+ .save ar.lc, r2
+ .body
+
+ifdef(`HAVE_ABI_32',`
+.mmi; addp4 rp = 0, rp C M I
+ addp4 up = 0, up C M I
+ addp4 vp = 0, vp C M I
+.mmi; nop 1
+ nop 1
+ zxt4 n = n C I
+ ;;')
+
+.mmi; ldf8 ux = [up], 8 C M
+ ldf8 v0 = [vp], 8 C M
+ mov r2 = ar.lc C I0
+.mmi; ldf8 rx = [rp], 8 C M
+ and r14 = 3, n C M I
+ add n = -2, n C M I
+ ;;
+.mmi; ldf8 uy = [up], 8 C M
+ ldf8 v1 = [vp] C M
+ shr.u n = n, 2 C I0
+.mmi; ldf8 ry = [rp], -8 C M
+ cmp.eq p14, p0 = 1, r14 C M I
+ cmp.eq p11, p0 = 2, r14 C M I
+ ;;
+.mmi; add srp = 16, rp C M I
+ cmp.eq p15, p6 = 3, r14 C M I
+ mov ar.lc = n C I0
+.bbb; (p14) br.dptk L(b01) C B
+ (p11) br.dptk L(b10) C B
+ (p15) br.dptk L(b11) C B
+ ;;
+
+ ALIGN(32)
+L(b00):
+.mmi; ldf8 r_1 = [srp], 8
+ ldf8 u_1 = [up], 8
+ mov acc1_2 = 0
+.mmi; mov pr1_2 = 0
+ mov pr0_3 = 0
+ cmp.ne p8, p9 = r0, r0
+ ;;
+.mfi; ldf8 r_2 = [srp], 8
+ xma.l fp0b_3 = ux, v0, rx
+ cmp.ne p12, p13 = r0, r0
+.mfb; ldf8 u_2 = [up], 8
+ xma.hu fp1b_3 = ux, v0, rx
+ br.cloop.dptk L(gt4)
+
+ xma.l fp0b_0 = uy, v0, ry
+ xma.hu fp1a_0 = uy, v0, ry
+ ;;
+ getfsig acc0 = fp0b_3
+ (p6) xma.hu fp2a_3 = ux, v1, fp1b_3 C suppressed for addmul_2s
+ (p6) xma.l fp1b_3 = ux, v1, fp1b_3 C suppressed for addmul_2s
+ ;;
+ xma.l fp0b_1 = u_1, v0, r_1
+ xma.hu fp1a_1 = u_1, v0, r_1
+ ;;
+ getfsig pr0_0 = fp0b_0
+ xma.l fp1b_0 = uy, v1, fp1a_0
+ xma.hu fp2a_0 = uy, v1, fp1a_0
+ ;;
+ getfsig pr1_3 = fp1b_3
+ getfsig acc1_3 = fp2a_3
+ xma.l fp0b_2 = u_2, v0, r_2
+ xma.hu fp1a_2 = u_2, v0, r_2
+ br L(cj4)
+
+L(gt4): xma.l fp0b_0 = uy, v0, ry
+ xma.hu fp1a_0 = uy, v0, ry
+ ;;
+ ldf8 r_3 = [srp], 8
+ getfsig acc0 = fp0b_3
+ (p6) xma.hu fp2a_3 = ux, v1, fp1b_3 C suppressed for addmul_2s
+ ldf8 u_3 = [up], 8
+ (p6) xma.l fp1b_3 = ux, v1, fp1b_3 C suppressed for addmul_2s
+ ;;
+ xma.l fp0b_1 = u_1, v0, r_1
+ xma.hu fp1a_1 = u_1, v0, r_1
+ ;;
+ ldf8 r_0 = [srp], 8
+ getfsig pr0_0 = fp0b_0
+ xma.l fp1b_0 = uy, v1, fp1a_0
+ xma.hu fp2a_0 = uy, v1, fp1a_0
+ ;;
+ ldf8 u_0 = [up], 8
+ getfsig pr1_3 = fp1b_3
+ xma.l fp0b_2 = u_2, v0, r_2
+ ;;
+ getfsig acc1_3 = fp2a_3
+ xma.hu fp1a_2 = u_2, v0, r_2
+ br L(00)
+
+
+ ALIGN(32)
+L(b01):
+.mmi; ldf8 r_0 = [srp], 8 C M
+ ldf8 u_0 = [up], 8 C M
+ mov acc1_1 = 0 C M I
+.mmi; mov pr1_1 = 0 C M I
+ mov pr0_2 = 0 C M I
+ cmp.ne p6, p7 = r0, r0 C M I
+ ;;
+.mfi; ldf8 r_1 = [srp], 8 C M
+ xma.l fp0b_2 = ux, v0, rx C F
+ cmp.ne p10, p11 = r0, r0 C M I
+.mfi; ldf8 u_1 = [up], 8 C M
+ xma.hu fp1b_2 = ux, v0, rx C F
+ nop 1
+ ;;
+ xma.l fp0b_3 = uy, v0, ry C F
+ xma.hu fp1a_3 = uy, v0, ry C F
+ ;;
+.mmf; getfsig acc0 = fp0b_2 C M
+ ldf8 r_2 = [srp], 8 C M
+ (p14) xma.hu fp2a_2 = ux, v1,fp1b_2 C F suppressed for addmul_2s
+.mfb; ldf8 u_2 = [up], 8 C M
+ (p14) xma.l fp1b_2 = ux, v1,fp1b_2 C F suppressed for addmul_2s
+ br.cloop.dptk L(gt5)
+
+ xma.l fp0b_0 = u_0, v0, r_0 C F
+ xma.hu fp1a_0 = u_0, v0, r_0 C F
+ ;;
+ getfsig pr0_3 = fp0b_3 C M
+ xma.l fp1b_3 = uy, v1,fp1a_3 C F
+ xma.hu fp2a_3 = uy, v1,fp1a_3 C F
+ ;;
+ getfsig pr1_2 = fp1b_2 C M
+ getfsig acc1_2 = fp2a_2 C M
+ xma.l fp0b_1 = u_1, v0, r_1 C F
+ xma.hu fp1a_1 = u_1, v0, r_1 C F
+ br L(cj5)
+
+L(gt5): xma.l fp0b_0 = u_0, v0, r_0
+ xma.hu fp1a_0 = u_0, v0, r_0
+ ;;
+ getfsig pr0_3 = fp0b_3
+ ldf8 r_3 = [srp], 8
+ xma.l fp1b_3 = uy, v1, fp1a_3
+ xma.hu fp2a_3 = uy, v1, fp1a_3
+ ;;
+ ldf8 u_3 = [up], 8
+ getfsig pr1_2 = fp1b_2
+ xma.l fp0b_1 = u_1, v0, r_1
+ ;;
+ getfsig acc1_2 = fp2a_2
+ xma.hu fp1a_1 = u_1, v0, r_1
+ br L(01)
+
+
+ ALIGN(32)
+L(b10): br.cloop.dptk L(gt2)
+ xma.l fp0b_1 = ux, v0, rx
+ xma.hu fp1b_1 = ux, v0, rx
+ ;;
+ xma.l fp0b_2 = uy, v0, ry
+ xma.hu fp1a_2 = uy, v0, ry
+ ;;
+ stf8 [rp] = fp0b_1, 8
+ (p11) xma.hu fp2a_1 = ux, v1, fp1b_1 C suppressed for addmul_2s
+ (p11) xma.l fp1b_1 = ux, v1, fp1b_1 C suppressed for addmul_2s
+ ;;
+ getfsig acc0 = fp0b_2
+ xma.l fp1b_2 = uy, v1, fp1a_2
+ xma.hu fp2a_2 = uy, v1, fp1a_2
+ ;;
+ getfsig pr1_1 = fp1b_1
+ getfsig acc1_1 = fp2a_1
+ mov ar.lc = r2
+ getfsig pr1_2 = fp1b_2
+ getfsig r8 = fp2a_2
+ ;;
+ add s0 = pr1_1, acc0
+ ;;
+ st8 [rp] = s0, 8
+ cmp.ltu p8, p9 = s0, pr1_1
+ sub r31 = -1, acc1_1
+ ;;
+ .pred.rel "mutex", p8, p9
+ (p8) add acc0 = pr1_2, acc1_1, 1
+ (p9) add acc0 = pr1_2, acc1_1
+ (p8) cmp.leu p10, p0 = r31, pr1_2
+ (p9) cmp.ltu p10, p0 = r31, pr1_2
+ ;;
+ st8 [rp] = acc0, 8
+ (p10) add r8 = 1, r8
+ br.ret.sptk.many b0
+
+
+L(gt2):
+.mmi; ldf8 r_3 = [srp], 8
+ ldf8 u_3 = [up], 8
+ mov acc1_0 = 0
+ ;;
+.mfi; ldf8 r_0 = [srp], 8
+ xma.l fp0b_1 = ux, v0, rx
+ mov pr1_0 = 0
+.mfi; ldf8 u_0 = [up], 8
+ xma.hu fp1b_1 = ux, v0, rx
+ mov pr0_1 = 0
+ ;;
+ xma.l fp0b_2 = uy, v0, ry
+ xma.hu fp1a_2 = uy, v0, ry
+ ;;
+ getfsig acc0 = fp0b_1
+ ldf8 r_1 = [srp], 8
+ (p11) xma.hu fp2a_1 = ux, v1, fp1b_1 C suppressed for addmul_2s
+ (p11) xma.l fp1b_1 = ux, v1, fp1b_1 C suppressed for addmul_2s
+ ;;
+ ldf8 u_1 = [up], 8
+ xma.l fp0b_3 = u_3, v0, r_3
+ xma.hu fp1a_3 = u_3, v0, r_3
+ ;;
+ getfsig pr0_2 = fp0b_2
+ ldf8 r_2 = [srp], 8
+ xma.l fp1b_2 = uy, v1, fp1a_2
+ xma.hu fp2a_2 = uy, v1, fp1a_2
+ ;;
+ ldf8 u_2 = [up], 8
+ getfsig pr1_1 = fp1b_1
+ ;;
+.mfi; getfsig acc1_1 = fp2a_1
+ xma.l fp0b_0 = u_0, v0, r_0
+ cmp.ne p8, p9 = r0, r0
+.mfb; cmp.ne p12, p13 = r0, r0
+ xma.hu fp1a_0 = u_0, v0, r_0
+ br.cloop.sptk.clr L(top)
+ br.many L(end)
+
+
+ ALIGN(32)
+L(b11): ldf8 r_2 = [srp], 8
+ mov pr1_3 = 0
+ mov pr0_0 = 0
+ ;;
+ ldf8 u_2 = [up], 8
+ mov acc1_3 = 0
+ br.cloop.dptk L(gt3)
+ ;;
+ cmp.ne p6, p7 = r0, r0
+ xma.l fp0b_0 = ux, v0, rx
+ xma.hu fp1b_0 = ux, v0, rx
+ ;;
+ cmp.ne p10, p11 = r0, r0
+ xma.l fp0b_1 = uy, v0, ry
+ xma.hu fp1a_1 = uy, v0, ry
+ ;;
+ getfsig acc0 = fp0b_0
+ (p15) xma.hu fp2a_0 = ux, v1, fp1b_0 C suppressed for addmul_2s
+ (p15) xma.l fp1b_0 = ux, v1, fp1b_0 C suppressed for addmul_2s
+ ;;
+ xma.l fp0b_2 = uy, v1, r_2
+ xma.hu fp1a_2 = uy, v1, r_2
+ ;;
+ getfsig pr0_1 = fp0b_1
+ xma.l fp1b_1 = u_2, v0, fp1a_1
+ xma.hu fp2a_1 = u_2, v0, fp1a_1
+ ;;
+ getfsig pr1_0 = fp1b_0
+ getfsig acc1_0 = fp2a_0
+ br L(cj3)
+
+L(gt3): ldf8 r_3 = [srp], 8
+ xma.l fp0b_0 = ux, v0, rx
+ cmp.ne p10, p11 = r0, r0
+ ldf8 u_3 = [up], 8
+ xma.hu fp1b_0 = ux, v0, rx
+ cmp.ne p6, p7 = r0, r0
+ ;;
+ xma.l fp0b_1 = uy, v0, ry
+ xma.hu fp1a_1 = uy, v0, ry
+ ;;
+ getfsig acc0 = fp0b_0
+ ldf8 r_0 = [srp], 8
+ (p15) xma.hu fp2a_0 = ux, v1, fp1b_0 C suppressed for addmul_2s
+ ldf8 u_0 = [up], 8
+ (p15) xma.l fp1b_0 = ux, v1, fp1b_0 C suppressed for addmul_2s
+ ;;
+ xma.l fp0b_2 = u_2, v0, r_2
+ xma.hu fp1a_2 = u_2, v0, r_2
+ ;;
+ getfsig pr0_1 = fp0b_1
+ ldf8 r_1 = [srp], 8
+ xma.l fp1b_1 = uy, v1, fp1a_1
+ xma.hu fp2a_1 = uy, v1, fp1a_1
+ ;;
+ ldf8 u_1 = [up], 8
+ getfsig pr1_0 = fp1b_0
+ ;;
+ getfsig acc1_0 = fp2a_0
+ xma.l fp0b_3 = u_3, v0, r_3
+ xma.hu fp1a_3 = u_3, v0, r_3
+ br L(11)
+
+
+C *** MAIN LOOP START ***
+ ALIGN(32)
+L(top): C 00
+ .pred.rel "mutex", p12, p13
+ getfsig pr0_3 = fp0b_3
+ ldf8 r_3 = [srp], 8
+ xma.l fp1b_3 = u_3, v1, fp1a_3
+ (p12) add s0 = pr1_0, acc0, 1
+ (p13) add s0 = pr1_0, acc0
+ xma.hu fp2a_3 = u_3, v1, fp1a_3
+ ;; C 01
+ .pred.rel "mutex", p8, p9
+ .pred.rel "mutex", p12, p13
+ ldf8 u_3 = [up], 8
+ getfsig pr1_2 = fp1b_2
+ (p8) cmp.leu p6, p7 = acc0, pr0_1
+ (p9) cmp.ltu p6, p7 = acc0, pr0_1
+ (p12) cmp.leu p10, p11 = s0, pr1_0
+ (p13) cmp.ltu p10, p11 = s0, pr1_0
+ ;; C 02
+ .pred.rel "mutex", p6, p7
+ getfsig acc1_2 = fp2a_2
+ st8 [rp] = s0, 8
+ xma.l fp0b_1 = u_1, v0, r_1
+ (p6) add acc0 = pr0_2, acc1_0, 1
+ (p7) add acc0 = pr0_2, acc1_0
+ xma.hu fp1a_1 = u_1, v0, r_1
+ ;; C 03
+L(01):
+ .pred.rel "mutex", p10, p11
+ getfsig pr0_0 = fp0b_0
+ ldf8 r_0 = [srp], 8
+ xma.l fp1b_0 = u_0, v1, fp1a_0
+ (p10) add s0 = pr1_1, acc0, 1
+ (p11) add s0 = pr1_1, acc0
+ xma.hu fp2a_0 = u_0, v1, fp1a_0
+ ;; C 04
+ .pred.rel "mutex", p6, p7
+ .pred.rel "mutex", p10, p11
+ ldf8 u_0 = [up], 8
+ getfsig pr1_3 = fp1b_3
+ (p6) cmp.leu p8, p9 = acc0, pr0_2
+ (p7) cmp.ltu p8, p9 = acc0, pr0_2
+ (p10) cmp.leu p12, p13 = s0, pr1_1
+ (p11) cmp.ltu p12, p13 = s0, pr1_1
+ ;; C 05
+ .pred.rel "mutex", p8, p9
+ getfsig acc1_3 = fp2a_3
+ st8 [rp] = s0, 8
+ xma.l fp0b_2 = u_2, v0, r_2
+ (p8) add acc0 = pr0_3, acc1_1, 1
+ (p9) add acc0 = pr0_3, acc1_1
+ xma.hu fp1a_2 = u_2, v0, r_2
+ ;; C 06
+L(00):
+ .pred.rel "mutex", p12, p13
+ getfsig pr0_1 = fp0b_1
+ ldf8 r_1 = [srp], 8
+ xma.l fp1b_1 = u_1, v1, fp1a_1
+ (p12) add s0 = pr1_2, acc0, 1
+ (p13) add s0 = pr1_2, acc0
+ xma.hu fp2a_1 = u_1, v1, fp1a_1
+ ;; C 07
+ .pred.rel "mutex", p8, p9
+ .pred.rel "mutex", p12, p13
+ ldf8 u_1 = [up], 8
+ getfsig pr1_0 = fp1b_0
+ (p8) cmp.leu p6, p7 = acc0, pr0_3
+ (p9) cmp.ltu p6, p7 = acc0, pr0_3
+ (p12) cmp.leu p10, p11 = s0, pr1_2
+ (p13) cmp.ltu p10, p11 = s0, pr1_2
+ ;; C 08
+ .pred.rel "mutex", p6, p7
+ getfsig acc1_0 = fp2a_0
+ st8 [rp] = s0, 8
+ xma.l fp0b_3 = u_3, v0, r_3
+ (p6) add acc0 = pr0_0, acc1_2, 1
+ (p7) add acc0 = pr0_0, acc1_2
+ xma.hu fp1a_3 = u_3, v0, r_3
+ ;; C 09
+L(11):
+ .pred.rel "mutex", p10, p11
+ getfsig pr0_2 = fp0b_2
+ ldf8 r_2 = [srp], 8
+ xma.l fp1b_2 = u_2, v1, fp1a_2
+ (p10) add s0 = pr1_3, acc0, 1
+ (p11) add s0 = pr1_3, acc0
+ xma.hu fp2a_2 = u_2, v1, fp1a_2
+ ;; C 10
+ .pred.rel "mutex", p6, p7
+ .pred.rel "mutex", p10, p11
+ ldf8 u_2 = [up], 8
+ getfsig pr1_1 = fp1b_1
+ (p6) cmp.leu p8, p9 = acc0, pr0_0
+ (p7) cmp.ltu p8, p9 = acc0, pr0_0
+ (p10) cmp.leu p12, p13 = s0, pr1_3
+ (p11) cmp.ltu p12, p13 = s0, pr1_3
+ ;; C 11
+ .pred.rel "mutex", p8, p9
+ getfsig acc1_1 = fp2a_1
+ st8 [rp] = s0, 8
+ xma.l fp0b_0 = u_0, v0, r_0
+ (p8) add acc0 = pr0_1, acc1_3, 1
+ (p9) add acc0 = pr0_1, acc1_3
+ xma.hu fp1a_0 = u_0, v0, r_0
+L(10): br.cloop.sptk.clr L(top) C 12
+ ;;
+C *** MAIN LOOP END ***
+L(end):
+ .pred.rel "mutex", p12, p13
+.mfi; getfsig pr0_3 = fp0b_3
+ xma.l fp1b_3 = u_3, v1, fp1a_3
+ (p12) add s0 = pr1_0, acc0, 1
+.mfi; (p13) add s0 = pr1_0, acc0
+ xma.hu fp2a_3 = u_3, v1, fp1a_3
+ nop 1
+ ;;
+ .pred.rel "mutex", p8, p9
+ .pred.rel "mutex", p12, p13
+.mmi; getfsig pr1_2 = fp1b_2
+ st8 [rp] = s0, 8
+ (p8) cmp.leu p6, p7 = acc0, pr0_1
+.mmi; (p9) cmp.ltu p6, p7 = acc0, pr0_1
+ (p12) cmp.leu p10, p11 = s0, pr1_0
+ (p13) cmp.ltu p10, p11 = s0, pr1_0
+ ;;
+ .pred.rel "mutex", p6, p7
+.mfi; getfsig acc1_2 = fp2a_2
+ xma.l fp0b_1 = u_1, v0, r_1
+ nop 1
+.mmf; (p6) add acc0 = pr0_2, acc1_0, 1
+ (p7) add acc0 = pr0_2, acc1_0
+ xma.hu fp1a_1 = u_1, v0, r_1
+ ;;
+L(cj5):
+ .pred.rel "mutex", p10, p11
+.mfi; getfsig pr0_0 = fp0b_0
+ xma.l fp1b_0 = u_0, v1, fp1a_0
+ (p10) add s0 = pr1_1, acc0, 1
+.mfi; (p11) add s0 = pr1_1, acc0
+ xma.hu fp2a_0 = u_0, v1, fp1a_0
+ nop 1
+ ;;
+ .pred.rel "mutex", p6, p7
+ .pred.rel "mutex", p10, p11
+.mmi; getfsig pr1_3 = fp1b_3
+ st8 [rp] = s0, 8
+ (p6) cmp.leu p8, p9 = acc0, pr0_2
+.mmi; (p7) cmp.ltu p8, p9 = acc0, pr0_2
+ (p10) cmp.leu p12, p13 = s0, pr1_1
+ (p11) cmp.ltu p12, p13 = s0, pr1_1
+ ;;
+ .pred.rel "mutex", p8, p9
+.mfi; getfsig acc1_3 = fp2a_3
+ xma.l fp0b_2 = u_2, v0, r_2
+ nop 1
+.mmf; (p8) add acc0 = pr0_3, acc1_1, 1
+ (p9) add acc0 = pr0_3, acc1_1
+ xma.hu fp1a_2 = u_2, v0, r_2
+ ;;
+L(cj4):
+ .pred.rel "mutex", p12, p13
+.mfi; getfsig pr0_1 = fp0b_1
+ xma.l fp1b_1 = u_1, v1, fp1a_1
+ (p12) add s0 = pr1_2, acc0, 1
+.mfi; (p13) add s0 = pr1_2, acc0
+ xma.hu fp2a_1 = u_1, v1, fp1a_1
+ nop 1
+ ;;
+ .pred.rel "mutex", p8, p9
+ .pred.rel "mutex", p12, p13
+.mmi; getfsig pr1_0 = fp1b_0
+ st8 [rp] = s0, 8
+ (p8) cmp.leu p6, p7 = acc0, pr0_3
+.mmi; (p9) cmp.ltu p6, p7 = acc0, pr0_3
+ (p12) cmp.leu p10, p11 = s0, pr1_2
+ (p13) cmp.ltu p10, p11 = s0, pr1_2
+ ;;
+ .pred.rel "mutex", p6, p7
+.mmi; getfsig acc1_0 = fp2a_0
+ (p6) add acc0 = pr0_0, acc1_2, 1
+ (p7) add acc0 = pr0_0, acc1_2
+ ;;
+L(cj3):
+ .pred.rel "mutex", p10, p11
+.mfi; getfsig pr0_2 = fp0b_2
+ xma.l fp1b_2 = u_2, v1, fp1a_2
+ (p10) add s0 = pr1_3, acc0, 1
+.mfi; (p11) add s0 = pr1_3, acc0
+ xma.hu fp2a_2 = u_2, v1, fp1a_2
+ nop 1
+ ;;
+ .pred.rel "mutex", p6, p7
+ .pred.rel "mutex", p10, p11
+.mmi; getfsig pr1_1 = fp1b_1
+ st8 [rp] = s0, 8
+ (p6) cmp.leu p8, p9 = acc0, pr0_0
+.mmi; (p7) cmp.ltu p8, p9 = acc0, pr0_0
+ (p10) cmp.leu p12, p13 = s0, pr1_3
+ (p11) cmp.ltu p12, p13 = s0, pr1_3
+ ;;
+ .pred.rel "mutex", p8, p9
+.mmi; getfsig acc1_1 = fp2a_1
+ (p8) add acc0 = pr0_1, acc1_3, 1
+ (p9) add acc0 = pr0_1, acc1_3
+ ;;
+ .pred.rel "mutex", p12, p13
+.mmi; (p12) add s0 = pr1_0, acc0, 1
+ (p13) add s0 = pr1_0, acc0
+ nop 1
+ ;;
+ .pred.rel "mutex", p8, p9
+ .pred.rel "mutex", p12, p13
+.mmi; getfsig pr1_2 = fp1b_2
+ st8 [rp] = s0, 8
+ (p8) cmp.leu p6, p7 = acc0, pr0_1
+.mmi; (p9) cmp.ltu p6, p7 = acc0, pr0_1
+ (p12) cmp.leu p10, p11 = s0, pr1_0
+ (p13) cmp.ltu p10, p11 = s0, pr1_0
+ ;;
+ .pred.rel "mutex", p6, p7
+.mmi; getfsig r8 = fp2a_2
+ (p6) add acc0 = pr0_2, acc1_0, 1
+ (p7) add acc0 = pr0_2, acc1_0
+ ;;
+ .pred.rel "mutex", p10, p11
+.mmi; (p10) add s0 = pr1_1, acc0, 1
+ (p11) add s0 = pr1_1, acc0
+ (p6) cmp.leu p8, p9 = acc0, pr0_2
+ ;;
+ .pred.rel "mutex", p10, p11
+.mmi; (p7) cmp.ltu p8, p9 = acc0, pr0_2
+ (p10) cmp.leu p12, p13 = s0, pr1_1
+ (p11) cmp.ltu p12, p13 = s0, pr1_1
+ ;;
+ .pred.rel "mutex", p8, p9
+.mmi; st8 [rp] = s0, 8
+ (p8) add acc0 = pr1_2, acc1_1, 1
+ (p9) add acc0 = pr1_2, acc1_1
+ ;;
+ .pred.rel "mutex", p8, p9
+.mmi; (p8) cmp.leu p10, p11 = acc0, pr1_2
+ (p9) cmp.ltu p10, p11 = acc0, pr1_2
+ (p12) add acc0 = 1, acc0
+ ;;
+.mmi; st8 [rp] = acc0, 8
+ (p12) cmpeqor p10, p0 = 0, acc0
+ nop 1
+ ;;
+.mib; (p10) add r8 = 1, r8
+ mov ar.lc = r2
+ br.ret.sptk.many b0
+EPILOGUE()
+ASM_END()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/ia64/aors_n.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/ia64/aors_n.asm
new file mode 100644
index 00000000000..81be6061903
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/ia64/aors_n.asm
@@ -0,0 +1,856 @@
+dnl IA-64 mpn_add_n/mpn_sub_n -- mpn addition and subtraction.
+
+dnl Contributed to the GNU project by Torbjorn Granlund.
+
+dnl Copyright 2003-2005, 2010, 2011 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 Itanium: 2.67
+C Itanium 2: 1.25
+
+C TODO
+C * Consider using special code for small n, using something like
+C "switch (8 * (n >= 8) + (n mod 8))" to enter it and feed-in code.
+C * The non-nc code was trimmed cycle for cycle to its current state. It is
+C probably hard to save more that an odd cycle there. The nc code is much
+C cruder (since tune/speed doesn't have any applicable direct measurements).
+C * Without the nc entry points, this becomes around 1800 bytes of object
+C code; the nc code adds over 1000 bytes. We should perhaps sacrifice a
+C few cycles for the non-nc code and let it fall into the nc code.
+
+C INPUT PARAMETERS
+define(`rp', `r32')
+define(`up', `r33')
+define(`vp', `r34')
+define(`n', `r35')
+define(`cy', `r36')
+
+ifdef(`OPERATION_add_n',`
+ define(ADDSUB, add)
+ define(CND, ltu)
+ define(INCR, 1)
+ define(LIM, -1)
+ define(LIM2, 0)
+ define(func, mpn_add_n)
+ define(func_nc, mpn_add_nc)
+')
+ifdef(`OPERATION_sub_n',`
+ define(ADDSUB, sub)
+ define(CND, gtu)
+ define(INCR, -1)
+ define(LIM, 0)
+ define(LIM2, -1)
+ define(func, mpn_sub_n)
+ define(func_nc, mpn_sub_nc)
+')
+
+define(cmpeqor, `cmp.eq.or')
+define(PFDIST, 500)
+
+C Some useful aliases for registers we use
+define(`u0',`r14') define(`u1',`r15') define(`u2',`r16') define(`u3',`r17')
+define(`v0',`r24') define(`v1',`r25') define(`v2',`r26') define(`v3',`r27')
+define(`w0',`r28') define(`w1',`r29') define(`w2',`r30') define(`w3',`r31')
+define(`rpx',`r3')
+define(`upadv',`r20') define(`vpadv',`r21')
+
+MULFUNC_PROLOGUE(mpn_add_n mpn_add_nc mpn_sub_n mpn_sub_nc)
+
+ASM_START()
+PROLOGUE(func_nc)
+ .prologue
+ .save ar.lc, r2
+ .body
+ifdef(`HAVE_ABI_32',`
+ addp4 rp = 0, rp C M I
+ addp4 up = 0, up C M I
+ nop.i 0
+ addp4 vp = 0, vp C M I
+ nop.m 0
+ zxt4 n = n C I
+ ;;
+')
+
+ {.mmi; ld8 r11 = [vp], 8 C M01
+ ld8 r10 = [up], 8 C M01
+ mov r2 = ar.lc C I0
+}{.mmi; and r14 = 7, n C M I
+ cmp.lt p15, p14 = 8, n C M I
+ add n = -6, n C M I
+ ;;
+}
+.mmi; add upadv = PFDIST, up C Merging these lines into the feed-in
+ add vpadv = PFDIST, vp C code could save a cycle per call at
+ mov r23 = cy C the expense of code size.
+ ;;
+{.mmi; cmp.eq p6, p0 = 1, r14 C M I
+ cmp.eq p7, p0 = 2, r14 C M I
+ cmp.eq p8, p0 = 3, r14 C M I
+}{.bbb
+ (p6) br.dptk .Lc001 C B
+ (p7) br.dptk .Lc010 C B
+ (p8) br.dptk .Lc011 C B
+ ;;
+}{.mmi; cmp.eq p9, p0 = 4, r14 C M I
+ cmp.eq p10, p0 = 5, r14 C M I
+ cmp.eq p11, p0 = 6, r14 C M I
+}{.bbb
+ (p9) br.dptk .Lc100 C B
+ (p10) br.dptk .Lc101 C B
+ (p11) br.dptk .Lc110 C B
+ ;;
+}{.mmi; ld8 r19 = [vp], 8 C M01
+ ld8 r18 = [up], 8 C M01
+ cmp.ne p13, p0 = 0, cy C copy cy to p13 M I
+}{.mmb; cmp.eq p12, p0 = 7, r14 C M I
+ nop 0
+ (p12) br.dptk .Lc111 C B
+ ;;
+}
+
+.Lc000:
+.mmi; ld8 v3 = [vp], 8 C M01
+ ld8 u3 = [up], 8 C M01
+ shr.u n = n, 3 C I0
+ ;;
+.mmi; add vpadv = PFDIST, vp C M I
+ ld8 v0 = [vp], 8 C M01
+ mov ar.lc = n C I0
+.mmi; ld8 u0 = [up], 8 C M01
+ ADDSUB w1 = r10, r11 C M I
+ nop 0
+ ;;
+.mmi; add upadv = PFDIST, up C M I
+ ld8 v1 = [vp], 8 C M01
+ cmp.CND p7, p0 = w1, r10 C M I
+.mmi; ld8 u1 = [up], 8 C M01
+ ADDSUB w2 = r18, r19 C M I
+ add rpx = 8, rp C M I
+ ;;
+.mmi; ld8 v2 = [vp], 8 C M01
+ cmp.CND p8, p0 = w2, r18 C M I
+ (p13) cmpeqor p7, p0 = LIM, w1 C M I
+.mmi; ld8 u2 = [up], 8 C M01
+ (p13) add w1 = INCR, w1 C M I
+ ADDSUB w3 = u3, v3 C M I
+ ;;
+.mmi; ld8 v3 = [vp], 8 C M01
+ cmp.CND p9, p0 = w3, u3 C M I
+ (p7) cmpeqor p8, p0 = LIM, w2 C M I
+.mmb; ld8 u3 = [up], 8 C M01
+ (p7) add w2 = INCR, w2 C M I
+ br L(m0)
+
+
+.Lc001:
+.mmi;
+ (p15) ld8 v1 = [vp], 8 C M01
+ (p15) ld8 u1 = [up], 8 C M01
+ ADDSUB w0 = r10, r11 C M I
+.mmb; nop 0
+ nop 0
+ (p15) br 1f
+ ;;
+.mmi; cmp.ne p9, p0 = 0, r23 C M I
+ mov r8 = 0
+ cmp.CND p6, p0 = w0, r10 C M I
+ ;;
+.mmb;
+ (p9) cmpeqor p6, p0 = LIM, w0 C M I
+ (p9) add w0 = INCR, w0 C M I
+ br L(cj1) C B
+1:
+.mmi; ld8 v2 = [vp], 8 C M01
+ ld8 u2 = [up], 8 C M01
+ shr.u n = n, 3 C I0
+ ;;
+.mmi; ld8 v3 = [vp], 8 C M01
+ ld8 u3 = [up], 8 C M01
+ mov ar.lc = n C I0
+.mmi; nop 0
+ cmp.ne p9, p0 = 0, r23 C M I
+ nop 0
+ ;;
+.mmi; ld8 v0 = [vp], 8 C M01
+ cmp.CND p6, p0 = w0, r10 C M I
+ add rpx = 16, rp C M I
+.mmb; ld8 u0 = [up], 8 C M01
+ ADDSUB w1 = u1, v1 C M I
+ br L(c1) C B
+
+
+.Lc010:
+.mmi; ld8 v0 = [vp], 8 C M01
+ ld8 u0 = [up], 8 C M01
+ mov r8 = 0 C M I
+.mmb; ADDSUB w3 = r10, r11 C M I
+ cmp.ne p8, p0 = 0, r23 C M I
+ (p15) br 1f C B
+ ;;
+.mmi; cmp.CND p9, p0 = w3, r10 C M I
+ ADDSUB w0 = u0, v0 C M I
+ (p8) add w3 = INCR, w3 C M I
+ ;;
+.mmb; cmp.CND p6, p0 = w0, u0 C M I
+ (p8) cmpeqor p9, p0 = LIM2, w3 C M I
+ br L(cj2) C B
+1:
+.mmi; ld8 v1 = [vp], 8 C M01
+ ld8 u1 = [up], 8 C M01
+ shr.u n = n, 3 C I0
+ ;;
+.mmi; ld8 v2 = [vp], 8 C M01
+ ld8 u2 = [up], 8 C M01
+ mov ar.lc = n C I0
+ ;;
+.mmi; ld8 v3 = [vp], 8 C M01
+ ld8 u3 = [up], 8 C M01
+ cmp.CND p9, p0 = w3, r10 C M I
+ ;;
+.mmi;
+ (p8) cmpeqor p9, p0 = LIM, w3 C M I
+ (p8) add w3 = INCR, w3 C M I
+ ADDSUB w0 = u0, v0 C M I
+.mmb; add rpx = 24, rp C M I
+ nop 0
+ br L(m23) C B
+
+
+.Lc011:
+.mmi; ld8 v3 = [vp], 8 C M01
+ ld8 u3 = [up], 8 C M01
+ shr.u n = n, 3 C I0
+.mmi; ADDSUB w2 = r10, r11 C M I
+ cmp.ne p7, p0 = 0, r23 C M I
+ nop 0
+ ;;
+.mmb; ld8 v0 = [vp], 8 C M01
+ ld8 u0 = [up], 8 C M01
+ (p15) br 1f C B
+.mmi; cmp.CND p8, p0 = w2, r10 C M I
+ ADDSUB w3 = u3, v3 C M I
+ nop 0
+ ;;
+.mmb;
+ (p7) cmpeqor p8, p0 = LIM, w2 C M I
+ (p7) add w2 = INCR, w2 C M I
+ br L(cj3) C B
+1:
+.mmi; ld8 v1 = [vp], 8 C M01
+ ld8 u1 = [up], 8 C M01
+ ADDSUB w3 = u3, v3 C M I
+ ;;
+.mmi; ld8 v2 = [vp], 8 C M01
+ ld8 u2 = [up], 8 C M01
+ cmp.CND p8, p0 = w2, r10 C M I
+ ;;
+.mmi; ld8 v3 = [vp], 8 C M01
+ cmp.CND p9, p0 = w3, u3 C M I
+ mov ar.lc = n C I0
+.mmi; ld8 u3 = [up], 8 C M01
+ (p7) cmpeqor p8, p0 = LIM, w2 C M I
+ (p7) add w2 = INCR, w2 C M I
+ ;;
+.mmi; add rpx = 32, rp C M I
+ st8 [rp] = w2, 8 C M23
+ (p8) cmpeqor p9, p0 = LIM, w3 C M I
+.mmb;
+ (p8) add w3 = INCR, w3 C M I
+ ADDSUB w0 = u0, v0 C M I
+ br L(m23)
+
+
+.Lc100:
+.mmi; ld8 v2 = [vp], 8 C M01
+ ld8 u2 = [up], 8 C M01
+ shr.u n = n, 3 C I0
+.mmi; ADDSUB w1 = r10, r11 C M I
+ nop 0
+ nop 0
+ ;;
+.mmi; ld8 v3 = [vp], 8 C M01
+ ld8 u3 = [up], 8 C M01
+ add rpx = 8, rp C M I
+.mmi; cmp.ne p6, p0 = 0, r23 C M I
+ cmp.CND p7, p0 = w1, r10 C M I
+ nop 0
+ ;;
+.mmi; ld8 v0 = [vp], 8 C M01
+ ld8 u0 = [up], 8 C M01
+ ADDSUB w2 = u2, v2 C M I
+.mmb;
+ (p6) cmpeqor p7, p0 = LIM, w1 C M I
+ (p6) add w1 = INCR, w1 C M I
+ (p14) br L(cj4)
+ ;;
+.mmi; ld8 v1 = [vp], 8 C M01
+ ld8 u1 = [up], 8 C M01
+ mov ar.lc = n C I0
+ ;;
+.mmi; ld8 v2 = [vp], 8 C M01
+ cmp.CND p8, p0 = w2, u2 C M I
+ nop 0
+.mmi; ld8 u2 = [up], 8 C M01
+ nop 0
+ ADDSUB w3 = u3, v3 C M I
+ ;;
+.mmi; ld8 v3 = [vp], 8 C M01
+ cmp.CND p9, p0 = w3, u3 C M I
+ (p7) cmpeqor p8, p0 = LIM, w2 C M I
+.mmb; ld8 u3 = [up], 8 C M01
+ (p7) add w2 = INCR, w2 C M I
+ br L(m4)
+
+
+.Lc101:
+.mmi; ld8 v1 = [vp], 8 C M01
+ ld8 u1 = [up], 8 C M01
+ shr.u n = n, 3 C I0
+ ;;
+.mmi; ld8 v2 = [vp], 8 C M01
+ ld8 u2 = [up], 8 C M01
+ mov ar.lc = n C I0
+ ;;
+.mmi; ld8 v3 = [vp], 8 C M01
+ ld8 u3 = [up], 8 C M01
+ ADDSUB w0 = r10, r11 C M I
+.mmi; cmp.ne p9, p0 = 0, r23 C M I
+ add rpx = 16, rp C M I
+ nop 0
+ ;;
+.mmi; ld8 v0 = [vp], 8 C M01
+ ld8 u0 = [up], 8 C M01
+ cmp.CND p6, p0 = w0, r10 C M I
+.mbb; ADDSUB w1 = u1, v1 C M I
+ (p15) br L(c5) C B
+ br L(end) C B
+
+
+.Lc110:
+.mmi; ld8 v0 = [vp], 8 C M01
+ ld8 u0 = [up], 8 C M01
+ shr.u n = n, 3 C I0
+ ;;
+.mmi; add upadv = PFDIST, up C M I
+ add vpadv = PFDIST, vp C M I
+ mov ar.lc = n C I0
+.mmi; ld8 v1 = [vp], 8 C M01
+ ld8 u1 = [up], 8 C M01
+ ADDSUB w3 = r10, r11 C M I
+ ;;
+.mmi; ld8 v2 = [vp], 8 C M01
+ ld8 u2 = [up], 8 C M01
+ ADDSUB w0 = u0, v0 C M I
+.mmi; cmp.CND p9, p0 = w3, r10 C M I
+ cmp.ne p8, p0 = 0, r23 C M I
+ add rpx = 24, rp C M I
+ ;;
+.mmi; ld8 v3 = [vp], 8 C M01
+ ld8 u3 = [up], 8 C M01
+ nop 0
+.mmb;
+ (p8) cmpeqor p9, p0 = LIM, w3 C M I
+ (p8) add w3 = INCR, w3 C M I
+ br L(m67) C B
+
+
+.Lc111:
+.mmi; ld8 v0 = [vp], 8 C M01
+ ld8 u0 = [up], 8 C M01
+ shr.u n = n, 3 C I0
+ ;;
+.mmi; add upadv = PFDIST, up C M I
+ ld8 v1 = [vp], 8 C M01
+ mov ar.lc = n C I0
+.mmi; ld8 u1 = [up], 8 C M01
+ ADDSUB w2 = r10, r11 C M I
+ nop 0
+ ;;
+.mmi; add vpadv = PFDIST, vp C M I
+ ld8 v2 = [vp], 8 C M01
+ cmp.CND p8, p0 = w2, r10 C M I
+.mmi; ld8 u2 = [up], 8 C M01
+ ADDSUB w3 = r18, r19 C M I
+ nop 0
+ ;;
+.mmi; ld8 v3 = [vp], 8 C M01
+ cmp.CND p9, p0 = w3, r18 C M I
+ (p13) cmpeqor p8, p0 = LIM, w2 C M I
+.mmi; ld8 u3 = [up], 8 C M01
+ (p13) add w2 = INCR, w2 C M I
+ nop 0
+ ;;
+.mmi; add rpx = 32, rp C M I
+ st8 [rp] = w2, 8 C M23
+ (p8) cmpeqor p9, p0 = LIM, w3 C M I
+.mmb;
+ (p8) add w3 = INCR, w3 C M I
+ ADDSUB w0 = u0, v0 C M I
+ br L(m67)
+
+EPILOGUE()
+
+PROLOGUE(func)
+ .prologue
+ .save ar.lc, r2
+ .body
+ifdef(`HAVE_ABI_32',`
+ addp4 rp = 0, rp C M I
+ addp4 up = 0, up C M I
+ nop.i 0
+ addp4 vp = 0, vp C M I
+ nop.m 0
+ zxt4 n = n C I
+ ;;
+')
+
+ {.mmi; ld8 r11 = [vp], 8 C M01
+ ld8 r10 = [up], 8 C M01
+ mov r2 = ar.lc C I0
+}{.mmi; and r14 = 7, n C M I
+ cmp.lt p15, p14 = 8, n C M I
+ add n = -6, n C M I
+ ;;
+}{.mmi; cmp.eq p6, p0 = 1, r14 C M I
+ cmp.eq p7, p0 = 2, r14 C M I
+ cmp.eq p8, p0 = 3, r14 C M I
+}{.bbb
+ (p6) br.dptk .Lb001 C B
+ (p7) br.dptk .Lb010 C B
+ (p8) br.dptk .Lb011 C B
+ ;;
+}{.mmi; cmp.eq p9, p0 = 4, r14 C M I
+ cmp.eq p10, p0 = 5, r14 C M I
+ cmp.eq p11, p0 = 6, r14 C M I
+}{.bbb
+ (p9) br.dptk .Lb100 C B
+ (p10) br.dptk .Lb101 C B
+ (p11) br.dptk .Lb110 C B
+ ;;
+}{.mmi; ld8 r19 = [vp], 8 C M01
+ ld8 r18 = [up], 8 C M01
+ cmp.ne p13, p0 = r0, r0 C clear "CF" M I
+}{.mmb; cmp.eq p12, p0 = 7, r14 C M I
+ mov r23 = 0 C M I
+ (p12) br.dptk .Lb111 C B
+ ;;
+}
+
+.Lb000:
+.mmi; ld8 v3 = [vp], 8 C M01
+ ld8 u3 = [up], 8 C M01
+ shr.u n = n, 3 C I0
+ ;;
+.mmi; ld8 v0 = [vp], 8 C M01
+ ld8 u0 = [up], 8 C M01
+ ADDSUB w1 = r10, r11 C M I
+ ;;
+.mmi; ld8 v1 = [vp], 8 C M01
+ cmp.CND p7, p0 = w1, r10 C M I
+ mov ar.lc = n C I0
+.mmi; ld8 u1 = [up], 8 C M01
+ ADDSUB w2 = r18, r19 C M I
+ add rpx = 8, rp C M I
+ ;;
+.mmi; add upadv = PFDIST, up
+ add vpadv = PFDIST, vp
+ cmp.CND p8, p0 = w2, r18 C M I
+.mmi; ld8 v2 = [vp], 8 C M01
+ ld8 u2 = [up], 8 C M01
+ ADDSUB w3 = u3, v3 C M I
+ ;;
+.mmi; ld8 v3 = [vp], 8 C M01
+ cmp.CND p9, p0 = w3, u3 C M I
+ (p7) cmpeqor p8, p0 = LIM, w2 C M I
+.mmb; ld8 u3 = [up], 8 C M01
+ (p7) add w2 = INCR, w2 C M I
+ br L(m0) C B
+
+
+ ALIGN(32)
+.Lb001:
+.mmi; ADDSUB w0 = r10, r11 C M I
+ (p15) ld8 v1 = [vp], 8 C M01
+ mov r8 = 0 C M I
+ ;;
+.mmb; cmp.CND p6, p0 = w0, r10 C M I
+ (p15) ld8 u1 = [up], 8 C M01
+ (p14) br L(cj1) C B
+ ;;
+.mmi; add upadv = PFDIST, up
+ add vpadv = PFDIST, vp
+ shr.u n = n, 3 C I0
+.mmi; ld8 v2 = [vp], 8 C M01
+ ld8 u2 = [up], 8 C M01
+ cmp.CND p6, p0 = w0, r10 C M I
+ ;;
+.mmi; ld8 v3 = [vp], 8 C M01
+ ld8 u3 = [up], 8 C M01
+ mov ar.lc = n C I0
+ ;;
+.mmi; ld8 v0 = [vp], 8 C M01
+ ld8 u0 = [up], 8 C M01
+ ADDSUB w1 = u1, v1 C M I
+ ;;
+.mmi; ld8 v1 = [vp], 8 C M01
+ cmp.CND p7, p0 = w1, u1 C M I
+ ADDSUB w2 = u2, v2 C M I
+.mmb; ld8 u1 = [up], 8 C M01
+ add rpx = 16, rp C M I
+ br L(m1) C B
+
+
+ ALIGN(32)
+.Lb010:
+.mmi; ld8 v0 = [vp], 8 C M01
+ ld8 u0 = [up], 8 C M01
+ shr.u n = n, 3 C I0
+.mmb; ADDSUB w3 = r10, r11 C M I
+ nop 0
+ (p15) br L(gt2) C B
+ ;;
+.mmi; cmp.CND p9, p0 = w3, r10 C M I
+ ADDSUB w0 = u0, v0 C M I
+ mov r8 = 0 C M I
+ ;;
+.mmb; nop 0
+ cmp.CND p6, p0 = w0, u0 C M I
+ br L(cj2) C B
+L(gt2):
+.mmi; ld8 v1 = [vp], 8 C M01
+ ld8 u1 = [up], 8 C M01
+ nop 0
+ ;;
+.mmi; add upadv = PFDIST, up
+ add vpadv = PFDIST, vp
+ mov ar.lc = n C I0
+.mmi; ld8 v2 = [vp], 8 C M01
+ ld8 u2 = [up], 8 C M01
+ nop 0
+ ;;
+.mmi; ld8 v3 = [vp], 8 C M01
+ cmp.CND p9, p0 = w3, r10 C M I
+ ADDSUB w0 = u0, v0 C M I
+.mmb; ld8 u3 = [up], 8 C M01
+ add rpx = 24, rp C M I
+ br L(m23) C B
+
+
+ ALIGN(32)
+.Lb011:
+.mmi; ld8 v3 = [vp], 8 C M01
+ ld8 u3 = [up], 8 C M01
+ ADDSUB w2 = r10, r11 C M I
+ ;;
+.mmb; ld8 v0 = [vp], 8 C M01
+ ld8 u0 = [up], 8 C M01
+ (p15) br 1f C B
+.mmb; cmp.CND p8, p0 = w2, r10 C M I
+ ADDSUB w3 = u3, v3 C M I
+ br L(cj3) C B
+1:
+.mmi; ld8 v1 = [vp], 8 C M01
+ ld8 u1 = [up], 8 C M01
+ shr.u n = n, 3 C I0
+ ;;
+.mmi; add upadv = PFDIST, up
+ add vpadv = PFDIST, vp
+ ADDSUB w3 = u3, v3 C M I
+.mmi; ld8 v2 = [vp], 8 C M01
+ ld8 u2 = [up], 8 C M01
+ cmp.CND p8, p0 = w2, r10 C M I
+ ;;
+.mmi; ld8 v3 = [vp], 8 C M01
+ cmp.CND p9, p0 = w3, u3 C M I
+ mov ar.lc = n C I0
+.mmi; ld8 u3 = [up], 8 C M01
+ nop 0
+ nop 0
+ ;;
+.mmi; add rpx = 32, rp C M I
+ st8 [rp] = w2, 8 C M23
+ (p8) cmpeqor p9, p0 = LIM, w3 C M I
+.mmb;
+ (p8) add w3 = INCR, w3 C M I
+ ADDSUB w0 = u0, v0 C M I
+ br L(m23) C B
+
+
+ ALIGN(32)
+.Lb100:
+.mmi; ld8 v2 = [vp], 8 C M01
+ ld8 u2 = [up], 8 C M01
+ shr.u n = n, 3 C I0
+ ;;
+.mmi; ld8 v3 = [vp], 8 C M01
+ ld8 u3 = [up], 8 C M01
+ ADDSUB w1 = r10, r11 C M I
+ ;;
+.mmi; ld8 v0 = [vp], 8 C M01
+ ld8 u0 = [up], 8 C M01
+ cmp.CND p7, p0 = w1, r10 C M I
+.mmb; nop 0
+ ADDSUB w2 = u2, v2 C M I
+ (p14) br L(cj4) C B
+ ;;
+L(gt4):
+.mmi; add upadv = PFDIST, up
+ add vpadv = PFDIST, vp
+ mov ar.lc = n C I0
+.mmi; ld8 v1 = [vp], 8 C M01
+ ld8 u1 = [up], 8 C M01
+ nop 0
+ ;;
+.mmi; ld8 v2 = [vp], 8 C M01
+ cmp.CND p8, p0 = w2, u2 C M I
+ nop 0
+.mmi; ld8 u2 = [up], 8 C M01
+ ADDSUB w3 = u3, v3 C M I
+ add rpx = 8, rp C M I
+ ;;
+.mmi; ld8 v3 = [vp], 8 C M01
+ cmp.CND p9, p0 = w3, u3 C M I
+ (p7) cmpeqor p8, p0 = LIM, w2 C M I
+.mmb; ld8 u3 = [up], 8 C M01
+ (p7) add w2 = INCR, w2 C M I
+ br L(m4) C B
+
+
+ ALIGN(32)
+.Lb101:
+.mmi; ld8 v1 = [vp], 8 C M01
+ ld8 u1 = [up], 8 C M01
+ shr.u n = n, 3 C I0
+ ;;
+.mmi; ld8 v2 = [vp], 8 C M01
+ ld8 u2 = [up], 8 C M01
+ ADDSUB w0 = r10, r11 C M I
+ ;;
+.mmi; add upadv = PFDIST, up
+ add vpadv = PFDIST, vp
+ add rpx = 16, rp C M I
+.mmi; ld8 v3 = [vp], 8 C M01
+ ld8 u3 = [up], 8 C M01
+ nop 0
+ ;;
+.mmi; ld8 v0 = [vp], 8 C M01
+ cmp.CND p6, p0 = w0, r10 C M I
+ nop 0
+.mmb; ld8 u0 = [up], 8 C M01
+ ADDSUB w1 = u1, v1 C M I
+ (p14) br L(cj5) C B
+ ;;
+L(gt5):
+.mmi; ld8 v1 = [vp], 8 C M01
+ cmp.CND p7, p0 = w1, u1 C M I
+ mov ar.lc = n C I0
+.mmb; ld8 u1 = [up], 8 C M01
+ ADDSUB w2 = u2, v2 C M I
+ br L(m5) C B
+
+
+ ALIGN(32)
+.Lb110:
+.mmi; ld8 v0 = [vp], 8 C M01
+ ld8 u0 = [up], 8 C M01
+ shr.u n = n, 3 C I0
+ ;;
+.mmi; ld8 v1 = [vp], 8 C M01
+ ld8 u1 = [up], 8 C M01
+ ADDSUB w3 = r10, r11 C M I
+ ;;
+.mmi; add upadv = PFDIST, up
+ add vpadv = PFDIST, vp
+ mov ar.lc = n C I0
+.mmi; ld8 v2 = [vp], 8 C M01
+ ld8 u2 = [up], 8 C M01
+ nop 0
+ ;;
+.mmi; ld8 v3 = [vp], 8 C M01
+ cmp.CND p9, p0 = w3, r10 C M I
+ ADDSUB w0 = u0, v0 C M I
+.mmb; ld8 u3 = [up], 8 C M01
+ add rpx = 24, rp C M I
+ br L(m67) C B
+
+
+ ALIGN(32)
+.Lb111:
+.mmi; ld8 v0 = [vp], 8 C M01
+ ld8 u0 = [up], 8 C M01
+ shr.u n = n, 3 C I0
+ ;;
+.mmi; ld8 v1 = [vp], 8 C M01
+ ld8 u1 = [up], 8 C M01
+ ADDSUB w2 = r10, r11 C M I
+ ;;
+.mmi; ld8 v2 = [vp], 8 C M01
+ cmp.CND p8, p0 = w2, r10 C M I
+ mov ar.lc = n C I0
+.mmi; ld8 u2 = [up], 8 C M01
+ ADDSUB w3 = r18, r19 C M I
+ nop 0
+ ;;
+.mmi; add upadv = PFDIST, up
+ add vpadv = PFDIST, vp
+ nop 0
+.mmi; ld8 v3 = [vp], 8 C M01
+ ld8 u3 = [up], 8 C M01
+ cmp.CND p9, p0 = w3, r18 C M I
+ ;;
+.mmi; add rpx = 32, rp C M I
+ st8 [rp] = w2, 8 C M23
+ (p8) cmpeqor p9, p0 = LIM, w3 C M I
+.mmb;
+ (p8) add w3 = INCR, w3 C M I
+ ADDSUB w0 = u0, v0 C M I
+ br L(m67) C B
+
+
+C *** MAIN LOOP START ***
+ ALIGN(32)
+L(top):
+L(c5): ld8 v1 = [vp], 8 C M01
+ cmp.CND p7, p0 = w1, u1 C M I
+ (p9) cmpeqor p6, p0 = LIM, w0 C M I
+ ld8 u1 = [up], 8 C M01
+ (p9) add w0 = INCR, w0 C M I
+ ADDSUB w2 = u2, v2 C M I
+ ;;
+L(m5): ld8 v2 = [vp], 8 C M01
+ cmp.CND p8, p0 = w2, u2 C M I
+ (p6) cmpeqor p7, p0 = LIM, w1 C M I
+ ld8 u2 = [up], 8 C M01
+ (p6) add w1 = INCR, w1 C M I
+ ADDSUB w3 = u3, v3 C M I
+ ;;
+ st8 [rp] = w0, 8 C M23
+ ld8 v3 = [vp], 8 C M01
+ cmp.CND p9, p0 = w3, u3 C M I
+ (p7) cmpeqor p8, p0 = LIM, w2 C M I
+ ld8 u3 = [up], 8 C M01
+ (p7) add w2 = INCR, w2 C M I
+ ;;
+L(m4): st8 [rp] = w1, 16 C M23
+ st8 [rpx] = w2, 32 C M23
+ (p8) cmpeqor p9, p0 = LIM, w3 C M I
+ lfetch [upadv], 64
+ (p8) add w3 = INCR, w3 C M I
+ ADDSUB w0 = u0, v0 C M I
+ ;;
+L(m23): st8 [rp] = w3, 8 C M23
+ ld8 v0 = [vp], 8 C M01
+ cmp.CND p6, p0 = w0, u0 C M I
+ ld8 u0 = [up], 8 C M01
+ ADDSUB w1 = u1, v1 C M I
+ nop.b 0
+ ;;
+L(c1): ld8 v1 = [vp], 8 C M01
+ cmp.CND p7, p0 = w1, u1 C M I
+ (p9) cmpeqor p6, p0 = LIM, w0 C M I
+ ld8 u1 = [up], 8 C M01
+ (p9) add w0 = INCR, w0 C M I
+ ADDSUB w2 = u2, v2 C M I
+ ;;
+L(m1): ld8 v2 = [vp], 8 C M01
+ cmp.CND p8, p0 = w2, u2 C M I
+ (p6) cmpeqor p7, p0 = LIM, w1 C M I
+ ld8 u2 = [up], 8 C M01
+ (p6) add w1 = INCR, w1 C M I
+ ADDSUB w3 = u3, v3 C M I
+ ;;
+ st8 [rp] = w0, 8 C M23
+ ld8 v3 = [vp], 8 C M01
+ cmp.CND p9, p0 = w3, u3 C M I
+ (p7) cmpeqor p8, p0 = LIM, w2 C M I
+ ld8 u3 = [up], 8 C M01
+ (p7) add w2 = INCR, w2 C M I
+ ;;
+L(m0): st8 [rp] = w1, 16 C M23
+ st8 [rpx] = w2, 32 C M23
+ (p8) cmpeqor p9, p0 = LIM, w3 C M I
+ lfetch [vpadv], 64
+ (p8) add w3 = INCR, w3 C M I
+ ADDSUB w0 = u0, v0 C M I
+ ;;
+L(m67): st8 [rp] = w3, 8 C M23
+ ld8 v0 = [vp], 8 C M01
+ cmp.CND p6, p0 = w0, u0 C M I
+ ld8 u0 = [up], 8 C M01
+ ADDSUB w1 = u1, v1 C M I
+ br.cloop.dptk L(top) C B
+ ;;
+C *** MAIN LOOP END ***
+
+L(end):
+.mmi;
+ (p9) cmpeqor p6, p0 = LIM, w0 C M I
+ (p9) add w0 = INCR, w0 C M I
+ mov ar.lc = r2 C I0
+L(cj5):
+.mmi; cmp.CND p7, p0 = w1, u1 C M I
+ ADDSUB w2 = u2, v2 C M I
+ nop 0
+ ;;
+.mmi; st8 [rp] = w0, 8 C M23
+ (p6) cmpeqor p7, p0 = LIM, w1 C M I
+ (p6) add w1 = INCR, w1 C M I
+L(cj4):
+.mmi; cmp.CND p8, p0 = w2, u2 C M I
+ ADDSUB w3 = u3, v3 C M I
+ nop 0
+ ;;
+.mmi; st8 [rp] = w1, 8 C M23
+ (p7) cmpeqor p8, p0 = LIM, w2 C M I
+ (p7) add w2 = INCR, w2 C M I
+L(cj3):
+.mmi; cmp.CND p9, p0 = w3, u3 C M I
+ ADDSUB w0 = u0, v0 C M I
+ nop 0
+ ;;
+.mmi; st8 [rp] = w2, 8 C M23
+ (p8) cmpeqor p9, p0 = LIM, w3 C M I
+ (p8) add w3 = INCR, w3 C M I
+.mmi; cmp.CND p6, p0 = w0, u0 C M I
+ nop 0
+ mov r8 = 0 C M I
+ ;;
+L(cj2):
+.mmi; st8 [rp] = w3, 8 C M23
+ (p9) cmpeqor p6, p0 = LIM, w0 C M I
+ (p9) add w0 = INCR, w0 C M I
+ ;;
+L(cj1):
+.mmb; st8 [rp] = w0, 8 C M23
+ (p6) mov r8 = 1 C M I
+ br.ret.sptk.many b0 C B
+EPILOGUE()
+ASM_END()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/ia64/aorsorrlsh1_n.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/ia64/aorsorrlsh1_n.asm
new file mode 100644
index 00000000000..9b58b9e11f0
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/ia64/aorsorrlsh1_n.asm
@@ -0,0 +1,48 @@
+dnl IA-64 mpn_addlsh1_n, mpn_sublsh1_n, mpn_rsblsh1_n
+
+dnl Contributed to the GNU project by Torbjörn Granlund.
+
+dnl Copyright 2003-2005, 2010, 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/limb
+C Itanium: 3.0
+C Itanium 2: 1.5
+
+
+define(LSH, 1)
+
+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(`ia64/aorsorrlshC_n.asm')
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/ia64/aorsorrlsh2_n.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/ia64/aorsorrlsh2_n.asm
new file mode 100644
index 00000000000..39b384a91bb
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/ia64/aorsorrlsh2_n.asm
@@ -0,0 +1,48 @@
+dnl IA-64 mpn_addlsh2_n, mpn_sublsh2_n, mpn_rsblsh2_n
+
+dnl Contributed to the GNU project by Torbjörn Granlund.
+
+dnl Copyright 2003-2005, 2010, 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/limb
+C Itanium: 3.0
+C Itanium 2: 1.5
+
+
+define(LSH, 2)
+
+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(`ia64/aorsorrlshC_n.asm')
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/ia64/aorsorrlshC_n.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/ia64/aorsorrlshC_n.asm
new file mode 100644
index 00000000000..d327838402c
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/ia64/aorsorrlshC_n.asm
@@ -0,0 +1,397 @@
+dnl IA-64 mpn_addlshC_n, mpn_sublshC_n, mpn_rsblshC_n.
+
+dnl Contributed to the GNU project by Torbjörn Granlund.
+
+dnl Copyright 2003-2005, 2010, 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/.
+
+C cycles/limb
+C Itanium: ?
+C Itanium 2: 1.5
+
+C TODO
+C * Use shladd in feed-in code (for mpn_addlshC_n).
+C * Rewrite loop to schedule loads closer to use, since we do prefetch.
+
+C INPUT PARAMETERS
+define(`rp', `r32')
+define(`up', `r33')
+define(`vp', `r34')
+define(`n', `r35')
+
+ifdef(`DO_add', `
+ define(`ADDSUB', `add $1 = $2, $3')
+ define(`CMP', `cmp.ltu $1,p0 = $2, $3')
+ define(`INCR', 1)
+ define(`LIM', -1)
+ define(`func', mpn_addlsh`'LSH`'_n)')
+ifdef(`DO_sub', `
+ define(`ADDSUB', `sub $1 = $2, $3')
+ define(`CMP', `cmp.gtu $1,p0 = $2, $3')
+ define(`INCR', -1)
+ define(`LIM', 0)
+ define(`func', mpn_sublsh`'LSH`'_n)')
+ifdef(`DO_rsb', `
+ define(`ADDSUB', `sub $1 = $3, $2')
+ define(`CMP', `cmp.gtu $1,p0 = $2, $4')
+ define(`INCR', -1)
+ define(`LIM', 0)
+ define(`func', mpn_rsblsh`'LSH`'_n)')
+
+define(cmpeqor, `cmp.eq.or')
+define(PFDIST, 500)
+
+define(`u0',`r14') define(`u1',`r15') define(`u2',`r16') define(`u3',`r17')
+define(`v0',`r18') define(`v1',`r19') define(`v2',`r20') define(`v3',`r21')
+define(`w0',`r22') define(`w1',`r23') define(`w2',`r24') define(`w3',`r25')
+define(`s0',`r26') define(`s1',`r27') define(`s2',`r28') define(`s3',`r29')
+define(`x0',`r30') define(`x1',`r31') define(`x2',`r3') define(`x3',`r9')
+
+C r3 r8 r9 r10 r11
+
+ASM_START()
+PROLOGUE(func)
+ .prologue
+ .save ar.lc, r2
+ .body
+ifdef(`HAVE_ABI_32',`
+ addp4 rp = 0, rp C M I
+ addp4 up = 0, up C M I
+ nop.i 0
+ addp4 vp = 0, vp C M I
+ nop.m 0
+ zxt4 n = n C I
+ ;;
+')
+ {.mmi; ld8 r11 = [vp], 8 C M01
+ ld8 r10 = [up], 8 C M01
+ mov.i r2 = ar.lc C I0
+}{.mmi; and r14 = 3, n C M I
+ cmp.lt p15, p0 = 4, n C M I
+ add n = -5, n C M I
+ ;;
+}{.mmi; cmp.eq p6, p0 = 1, r14 C M I
+ cmp.eq p7, p0 = 2, r14 C M I
+ cmp.eq p8, p0 = 3, r14 C M I
+}{.bbb
+ (p6) br.dptk .Lb01 C B
+ (p7) br.dptk .Lb10 C B
+ (p8) br.dptk .Lb11 C B
+}
+
+.Lb00: ld8 v0 = [vp], 8 C M01
+ ld8 u0 = [up], 8 C M01
+ shr.u n = n, 2 C I0
+ ;;
+.mmi; ld8 v1 = [vp], 8 C M01
+ ld8 u1 = [up], 8 C M01
+ shl x3 = r11, LSH C I0
+ ;;
+.mmi; ld8 v2 = [vp], 8 C M01
+ ld8 u2 = [up], 8 C M01
+ shrp x0 = v0, r11, 64-LSH C I0
+.mmb; ADDSUB( w3, r10, x3) C M I
+ nop 0
+ (p15) br.dpnt .grt4 C B
+ ;;
+.mii; CMP( p7, w3, r10, x3) C M II0
+ shrp x1 = v1, v0, 64-LSH C I0
+ ADDSUB( w0, u0, x0) C M I
+ ;;
+.mii; CMP( p8, w0, u0, x0) C M I
+ shrp x2 = v2, v1, 64-LSH C I0
+ ADDSUB( w1, u1, x1) C M I
+.mmb; nop 0
+ nop 0
+ br .Lcj4 C B
+
+ALIGN(32)
+.grt4: ld8 v3 = [vp], 8 C M01
+ shrp x0 = v0, r11, 64-LSH C I0
+ CMP( p8, w3, r10, x3) C M I
+ ;;
+.mmi; ld8 u3 = [up], 8 C M01
+ add r11 = PFDIST, vp
+ shrp x1 = v1, v0, 64-LSH C I0
+.mmi; ld8 v0 = [vp], 8 C M01
+ ADDSUB( w0, u0, x0) C M I
+ nop 0
+ ;;
+.mmi; CMP( p6, w0, u0, x0) C M I
+ add r10 = PFDIST, up
+ mov.i ar.lc = n C I0
+.mmb; ADDSUB( w1, u1, x1) C M I
+ ld8 u0 = [up], 8 C M01
+ br .LL00 C B
+
+
+ ALIGN(32)
+.Lb01:
+ifdef(`DO_add',
+` shladd w2 = r11, LSH, r10 C M I
+ shr.u r8 = r11, 64-LSH C retval I0
+ (p15) br.dpnt .grt1 C B
+ ;;
+',`
+ shl x2 = r11, LSH C I0
+ (p15) br.dpnt .grt1 C B
+ ;;
+ ADDSUB( w2, r10, x2) C M I
+ shr.u r8 = r11, 64-LSH C retval I0
+ ;;
+')
+ CMP( p6, w2, r10, x2) C M I
+ br .Lcj1
+
+.grt1: ld8 v3 = [vp], 8 C M01
+ ld8 u3 = [up], 8 C M01
+ shr.u n = n, 2 C I0
+ ;;
+ ld8 v0 = [vp], 8 C M01
+ ld8 u0 = [up], 8 C M01
+ mov.i ar.lc = n C FIXME swap with next I0
+ifdef(`DO_add',
+`',`
+ ADDSUB( w2, r10, x2)
+')
+ ;;
+.mmi; ld8 v1 = [vp], 8 C M01
+ ld8 u1 = [up], 8 C M01
+ shrp x3 = v3, r11, 64-LSH C I0
+ ;;
+.mmi; ld8 v2 = [vp], 8 C M01
+ ld8 u2 = [up], 8 C M01
+ shrp x0 = v0, v3, 64-LSH C I0
+.mmb; CMP( p6, w2, r10, x2) C M I
+ ADDSUB( w3, u3, x3) C M I
+ br.cloop.dptk .grt5 C B
+ ;;
+.mmi; CMP( p7, w3, u3, x3) C M I
+ ADDSUB( w0, u0, x0) C M I
+ shrp x1 = v1, v0, 64-LSH C I0
+.mmb; nop 0
+ nop 0
+ br .Lcj5 C B
+.grt5:
+.mmi; add r10 = PFDIST, up
+ add r11 = PFDIST, vp
+ shrp x0 = v0, v3, 64-LSH C I0
+.mmb; ld8 v3 = [vp], 8 C M01
+ CMP( p8, w3, u3, x3) C M I
+ br .LL01 C B
+
+ ALIGN(32)
+.Lb10: ld8 v2 = [vp], 8 C M01
+ ld8 u2 = [up], 8 C M01
+ shl x1 = r11, LSH C I0
+.mmb; nop 0
+ nop 0
+ (p15) br.dpnt .grt2 C B
+ ;;
+.mmi; ADDSUB( w1, r10, x1) C M I
+ nop 0
+ shrp x2 = v2, r11, 64-LSH C I0
+ ;;
+.mmi; CMP( p9, w1, r10, x1) C M I
+ ADDSUB( w2, u2, x2) C M I
+ shr.u r8 = v2, 64-LSH C retval I0
+ ;;
+.mmb; CMP( p6, w2, u2, x2) C M I
+ nop 0
+ br .Lcj2 C B
+
+.grt2: ld8 v3 = [vp], 8 C M01
+ ld8 u3 = [up], 8 C M01
+ shr.u n = n, 2 C I0
+ ;;
+.mmi; ld8 v0 = [vp], 8 C M01
+ ld8 u0 = [up], 8 C M01
+ mov.i ar.lc = n C I0
+.mmi; ADDSUB( w1, r10, x1) C M I
+ nop 0
+ nop 0
+ ;;
+.mii; ld8 v1 = [vp], 8 C M01
+ shrp x2 = v2, r11, 64-LSH C I0
+ CMP( p8, w1, r10, x1) C M I
+ ;;
+.mmi; add r10 = PFDIST, up
+ ld8 u1 = [up], 8 C M01
+ shrp x3 = v3, v2, 64-LSH C I0
+.mmi; add r11 = PFDIST, vp
+ ld8 v2 = [vp], 8 C M01
+ ADDSUB( w2, u2, x2) C M I
+ ;;
+.mmi; CMP( p6, w2, u2, x2) C M I
+ ld8 u2 = [up], 8 C M01
+ shrp x0 = v0, v3, 64-LSH C I0
+.mbb; ADDSUB( w3, u3, x3) C M I
+ br.cloop.dpnt L(top) C B
+ br L(end) C B
+
+.Lb11: ld8 v1 = [vp], 8 C M01
+ ld8 u1 = [up], 8 C M01
+ shl x0 = r11, LSH C I0
+ ;;
+.mmi; ld8 v2 = [vp], 8 C M01
+ ld8 u2 = [up], 8 C M01
+ shr.u n = n, 2 C I0
+.mmb; nop 0
+ nop 0
+ (p15) br.dpnt .grt3 C B
+ ;;
+.mii; nop 0
+ shrp x1 = v1, r11, 64-LSH C I0
+ ADDSUB( w0, r10, x0) C M I
+ ;;
+.mii; CMP( p8, w0, r10, x0) C M I
+ shrp x2 = v2, v1, 64-LSH C I0
+ ADDSUB( w1, u1, x1) C M I
+ ;;
+.mmb; CMP( p9, w1, u1, x1) C M I
+ ADDSUB( w2, u2, x2) C M I
+ br .Lcj3 C B
+.grt3:
+.mmi; ld8 v3 = [vp], 8 C M01
+ ld8 u3 = [up], 8 C M01
+ shrp x1 = v1, r11, 64-LSH C I0
+.mmi; ADDSUB( w0, r10, x0) C M I
+ nop 0
+ nop 0
+ ;;
+.mmi; ld8 v0 = [vp], 8 C M01
+ CMP( p6, w0, r10, x0) C M I
+ mov.i ar.lc = n C I0
+.mmi; ld8 u0 = [up], 8 C M01
+ ADDSUB( w1, u1, x1) C M I
+ nop 0
+ ;;
+.mmi; add r10 = PFDIST, up
+ add r11 = PFDIST, vp
+ shrp x2 = v2, v1, 64-LSH C I0
+.mmb; ld8 v1 = [vp], 8 C M01
+ CMP( p8, w1, u1, x1) C M I
+ br .LL11 C B
+
+
+C *** MAIN LOOP START ***
+ ALIGN(32)
+L(top): st8 [rp] = w1, 8 C M23
+ lfetch [r10], 32
+ (p8) cmpeqor p6, p0 = LIM, w2 C M I
+ (p8) add w2 = INCR, w2 C M I
+ ld8 v3 = [vp], 8 C M01
+ CMP( p8, w3, u3, x3) C M I
+ ;;
+.LL01: ld8 u3 = [up], 8 C M01
+ shrp x1 = v1, v0, 64-LSH C I0
+ (p6) cmpeqor p8, p0 = LIM, w3 C M I
+ (p6) add w3 = INCR, w3 C M I
+ ld8 v0 = [vp], 8 C M01
+ ADDSUB( w0, u0, x0) C M I
+ ;;
+ st8 [rp] = w2, 8 C M23
+ CMP( p6, w0, u0, x0) C M I
+ nop.b 0
+ ld8 u0 = [up], 8 C M01
+ lfetch [r11], 32
+ ADDSUB( w1, u1, x1) C M I
+ ;;
+.LL00: st8 [rp] = w3, 8 C M23
+ shrp x2 = v2, v1, 64-LSH C I0
+ (p8) cmpeqor p6, p0 = LIM, w0 C M I
+ (p8) add w0 = INCR, w0 C M I
+ ld8 v1 = [vp], 8 C M01
+ CMP( p8, w1, u1, x1) C M I
+ ;;
+.LL11: ld8 u1 = [up], 8 C M01
+ shrp x3 = v3, v2, 64-LSH C I0
+ (p6) cmpeqor p8, p0 = LIM, w1 C M I
+ (p6) add w1 = INCR, w1 C M I
+ ld8 v2 = [vp], 8 C M01
+ ADDSUB( w2, u2, x2) C M I
+ ;;
+.mmi; st8 [rp] = w0, 8 C M23
+ CMP( p6, w2, u2, x2) C M I
+ shrp x0 = v0, v3, 64-LSH C I0
+ ld8 u2 = [up], 8 C M01
+ ADDSUB( w3, u3, x3) C M I
+ br.cloop.dptk L(top) C B
+ ;;
+C *** MAIN LOOP END ***
+
+L(end):
+.mmi; st8 [rp] = w1, 8 C M23
+ (p8) cmpeqor p6, p0 = LIM, w2 C M I
+ shrp x1 = v1, v0, 64-LSH C I0
+.mmi;
+ (p8) add w2 = INCR, w2 C M I
+ CMP( p7, w3, u3, x3) C M I
+ ADDSUB( w0, u0, x0) C M I
+ ;;
+.Lcj5:
+.mmi; st8 [rp] = w2, 8 C M23
+ (p6) cmpeqor p7, p0 = LIM, w3 C M I
+ shrp x2 = v2, v1, 64-LSH C I0
+.mmi;
+ (p6) add w3 = INCR, w3 C M I
+ CMP( p8, w0, u0, x0) C M I
+ ADDSUB( w1, u1, x1) C M I
+ ;;
+.Lcj4:
+.mmi; st8 [rp] = w3, 8 C M23
+ (p7) cmpeqor p8, p0 = LIM, w0 C M I
+ mov.i ar.lc = r2 C I0
+.mmi;
+ (p7) add w0 = INCR, w0 C M I
+ CMP( p9, w1, u1, x1) C M I
+ ADDSUB( w2, u2, x2) C M I
+ ;;
+.Lcj3:
+.mmi; st8 [rp] = w0, 8 C M23
+ (p8) cmpeqor p9, p0 = LIM, w1 C M I
+ shr.u r8 = v2, 64-LSH C I0
+.mmi;
+ (p8) add w1 = INCR, w1 C M I
+ CMP( p6, w2, u2, x2) C M I
+ nop 0
+ ;;
+.Lcj2:
+.mmi; st8 [rp] = w1, 8 C M23
+ (p9) cmpeqor p6, p0 = LIM, w2 C M I
+ (p9) add w2 = INCR, w2 C M I
+ ;;
+.Lcj1:
+.mmb; st8 [rp] = w2 C M23
+ifdef(`DO_rsb',`
+ (p6) add r8 = -1, r8 C M I
+',`
+ (p6) add r8 = 1, r8 C M I
+') br.ret.sptk.many b0 C B
+EPILOGUE()
+ASM_END()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/ia64/bdiv_dbm1c.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/ia64/bdiv_dbm1c.asm
new file mode 100644
index 00000000000..47e4553cda5
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/ia64/bdiv_dbm1c.asm
@@ -0,0 +1,516 @@
+dnl IA-64 mpn_bdiv_dbm1.
+
+dnl Contributed to the GNU project by Torbjorn Granlund.
+
+dnl Copyright 2008, 2009 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 Itanium: 4
+C Itanium 2: 2
+
+C TODO
+C * Optimize feed-in and wind-down code, both for speed and code size.
+
+C INPUT PARAMETERS
+define(`rp', `r32')
+define(`up', `r33')
+define(`n', `r34')
+define(`bd', `r35')
+
+ASM_START()
+PROLOGUE(mpn_bdiv_dbm1c)
+ .prologue
+ .save ar.lc, r2
+ .body
+
+ifdef(`HAVE_ABI_32',
+` addp4 rp = 0, rp C M I
+ addp4 up = 0, up C M I
+ zxt4 n = n C I
+ ;;
+')
+{.mmb
+ mov r15 = r36 C M I
+ ldf8 f9 = [up], 8 C M
+ nop.b 0 C B
+}
+.Lcommon:
+{.mii
+ adds r16 = -1, n C M I
+ mov r2 = ar.lc C I0
+ and r14 = 3, n C M I
+ ;;
+}
+{.mii
+ setf.sig f6 = bd C M2 M3
+ shr.u r31 = r16, 2 C I0
+ cmp.eq p10, p0 = 0, r14 C M I
+}
+{.mii
+ nop.m 0 C M
+ cmp.eq p11, p0 = 2, r14 C M I
+ cmp.eq p12, p0 = 3, r14 C M I
+ ;;
+}
+{.mii
+ cmp.ne p6, p7 = r0, r0 C M I
+ mov.i ar.lc = r31 C I0
+ cmp.ne p8, p9 = r0, r0 C M I
+}
+{.bbb
+ (p10) br.dptk .Lb00 C B
+ (p11) br.dptk .Lb10 C B
+ (p12) br.dptk .Lb11 C B
+ ;;
+}
+
+.Lb01: br.cloop.dptk .grt1
+ ;;
+ xma.l f38 = f9, f6, f0
+ xma.hu f39 = f9, f6, f0
+ ;;
+ getf.sig r26 = f38
+ getf.sig r27 = f39
+ br .Lcj1
+
+.grt1: ldf8 f10 = [r33], 8
+ ;;
+ ldf8 f11 = [r33], 8
+ ;;
+ ldf8 f12 = [r33], 8
+ ;;
+ xma.l f38 = f9, f6, f0
+ xma.hu f39 = f9, f6, f0
+ ;;
+ ldf8 f13 = [r33], 8
+ ;;
+ xma.l f32 = f10, f6, f0
+ xma.hu f33 = f10, f6, f0
+ br.cloop.dptk .grt5
+
+ ;;
+ getf.sig r26 = f38
+ xma.l f34 = f11, f6, f0
+ xma.hu f35 = f11, f6, f0
+ ;;
+ getf.sig r27 = f39
+ ;;
+ getf.sig r20 = f32
+ xma.l f36 = f12, f6, f0
+ xma.hu f37 = f12, f6, f0
+ ;;
+ getf.sig r21 = f33
+ ;;
+ getf.sig r22 = f34
+ xma.l f38 = f13, f6, f0
+ xma.hu f39 = f13, f6, f0
+ br .Lcj5
+
+.grt5: ldf8 f10 = [r33], 8
+ ;;
+ getf.sig r26 = f38
+ xma.l f34 = f11, f6, f0
+ xma.hu f35 = f11, f6, f0
+ ;;
+ getf.sig r27 = f39
+ ldf8 f11 = [r33], 8
+ ;;
+ getf.sig r20 = f32
+ xma.l f36 = f12, f6, f0
+ xma.hu f37 = f12, f6, f0
+ ;;
+ getf.sig r21 = f33
+ ldf8 f12 = [r33], 8
+ ;;
+ getf.sig r22 = f34
+ xma.l f38 = f13, f6, f0
+ xma.hu f39 = f13, f6, f0
+ br .LL01
+
+.Lb10: ldf8 f13 = [r33], 8
+ br.cloop.dptk .grt2
+ ;;
+
+ xma.l f36 = f9, f6, f0
+ xma.hu f37 = f9, f6, f0
+ ;;
+ xma.l f38 = f13, f6, f0
+ xma.hu f39 = f13, f6, f0
+ ;;
+ getf.sig r24 = f36
+ ;;
+ getf.sig r25 = f37
+ ;;
+ getf.sig r26 = f38
+ ;;
+ getf.sig r27 = f39
+ br .Lcj2
+
+.grt2: ldf8 f10 = [r33], 8
+ ;;
+ ldf8 f11 = [r33], 8
+ ;;
+ xma.l f36 = f9, f6, f0
+ xma.hu f37 = f9, f6, f0
+ ;;
+ ldf8 f12 = [r33], 8
+ ;;
+ xma.l f38 = f13, f6, f0
+ xma.hu f39 = f13, f6, f0
+ ;;
+ ldf8 f13 = [r33], 8
+ ;;
+ getf.sig r24 = f36
+ xma.l f32 = f10, f6, f0
+ xma.hu f33 = f10, f6, f0
+ br.cloop.dptk .grt6
+
+ getf.sig r25 = f37
+ ;;
+ getf.sig r26 = f38
+ xma.l f34 = f11, f6, f0
+ xma.hu f35 = f11, f6, f0
+ ;;
+ getf.sig r27 = f39
+ ;;
+ getf.sig r20 = f32
+ xma.l f36 = f12, f6, f0
+ xma.hu f37 = f12, f6, f0
+ br .Lcj6
+
+.grt6: getf.sig r25 = f37
+ ldf8 f10 = [r33], 8
+ ;;
+ getf.sig r26 = f38
+ xma.l f34 = f11, f6, f0
+ xma.hu f35 = f11, f6, f0
+ ;;
+ getf.sig r27 = f39
+ ldf8 f11 = [r33], 8
+ ;;
+ getf.sig r20 = f32
+ xma.l f36 = f12, f6, f0
+ xma.hu f37 = f12, f6, f0
+ br .LL10
+
+
+.Lb11: ldf8 f12 = [r33], 8
+ ;;
+ ldf8 f13 = [r33], 8
+ br.cloop.dptk .grt3
+ ;;
+
+ xma.l f34 = f9, f6, f0
+ xma.hu f35 = f9, f6, f0
+ ;;
+ xma.l f36 = f12, f6, f0
+ xma.hu f37 = f12, f6, f0
+ ;;
+ getf.sig r22 = f34
+ xma.l f38 = f13, f6, f0
+ xma.hu f39 = f13, f6, f0
+ ;;
+ getf.sig r23 = f35
+ ;;
+ getf.sig r24 = f36
+ ;;
+ getf.sig r25 = f37
+ ;;
+ getf.sig r26 = f38
+ br .Lcj3
+
+.grt3: ldf8 f10 = [r33], 8
+ ;;
+ xma.l f34 = f9, f6, f0
+ xma.hu f35 = f9, f6, f0
+ ;;
+ ldf8 f11 = [r33], 8
+ ;;
+ xma.l f36 = f12, f6, f0
+ xma.hu f37 = f12, f6, f0
+ ;;
+ ldf8 f12 = [r33], 8
+ ;;
+ getf.sig r22 = f34
+ xma.l f38 = f13, f6, f0
+ xma.hu f39 = f13, f6, f0
+ ;;
+ getf.sig r23 = f35
+ ldf8 f13 = [r33], 8
+ ;;
+ getf.sig r24 = f36
+ xma.l f32 = f10, f6, f0
+ xma.hu f33 = f10, f6, f0
+ br.cloop.dptk .grt7
+
+ getf.sig r25 = f37
+ ;;
+ getf.sig r26 = f38
+ xma.l f34 = f11, f6, f0
+ xma.hu f35 = f11, f6, f0
+ br .Lcj7
+
+.grt7: getf.sig r25 = f37
+ ldf8 f10 = [r33], 8
+ ;;
+ getf.sig r26 = f38
+ xma.l f34 = f11, f6, f0
+ xma.hu f35 = f11, f6, f0
+ br .LL11
+
+
+.Lb00: ldf8 f11 = [r33], 8
+ ;;
+ ldf8 f12 = [r33], 8
+ ;;
+ ldf8 f13 = [r33], 8
+ br.cloop.dptk .grt4
+ ;;
+
+ xma.l f32 = f9, f6, f0
+ xma.hu f33 = f9, f6, f0
+ ;;
+ xma.l f34 = f11, f6, f0
+ xma.hu f35 = f11, f6, f0
+ ;;
+ getf.sig r20 = f32
+ xma.l f36 = f12, f6, f0
+ xma.hu f37 = f12, f6, f0
+ ;;
+ getf.sig r21 = f33
+ ;;
+ getf.sig r22 = f34
+ xma.l f38 = f13, f6, f0
+ xma.hu f39 = f13, f6, f0
+ ;;
+ getf.sig r23 = f35
+ ;;
+ getf.sig r24 = f36
+ br .Lcj4
+
+.grt4: xma.l f32 = f9, f6, f0
+ xma.hu f33 = f9, f6, f0
+ ;;
+ ldf8 f10 = [r33], 8
+ ;;
+ xma.l f34 = f11, f6, f0
+ xma.hu f35 = f11, f6, f0
+ ;;
+ ldf8 f11 = [r33], 8
+ ;;
+ getf.sig r20 = f32
+ xma.l f36 = f12, f6, f0
+ xma.hu f37 = f12, f6, f0
+ ;;
+ getf.sig r21 = f33
+ ldf8 f12 = [r33], 8
+ ;;
+ getf.sig r22 = f34
+ xma.l f38 = f13, f6, f0
+ xma.hu f39 = f13, f6, f0
+ ;;
+ getf.sig r23 = f35
+ ldf8 f13 = [r33], 8
+ ;;
+ getf.sig r24 = f36
+ xma.l f32 = f10, f6, f0
+ xma.hu f33 = f10, f6, f0
+ br.cloop.dptk .LL00
+ br .Lcj8
+
+C *** MAIN LOOP START ***
+ ALIGN(32)
+.Ltop:
+ .pred.rel "mutex",p6,p7
+C .mfi
+ getf.sig r24 = f36
+ xma.l f32 = f10, f6, f0
+ (p6) sub r15 = r19, r27, 1
+C .mfi
+ st8 [r32] = r19, 8
+ xma.hu f33 = f10, f6, f0
+ (p7) sub r15 = r19, r27
+ ;;
+.LL00:
+C .mfi
+ getf.sig r25 = f37
+ nop.f 0
+ cmp.ltu p6, p7 = r15, r20
+C .mib
+ ldf8 f10 = [r33], 8
+ sub r16 = r15, r20
+ nop.b 0
+ ;;
+
+C .mfi
+ getf.sig r26 = f38
+ xma.l f34 = f11, f6, f0
+ (p6) sub r15 = r16, r21, 1
+C .mfi
+ st8 [r32] = r16, 8
+ xma.hu f35 = f11, f6, f0
+ (p7) sub r15 = r16, r21
+ ;;
+.LL11:
+C .mfi
+ getf.sig r27 = f39
+ nop.f 0
+ cmp.ltu p6, p7 = r15, r22
+C .mib
+ ldf8 f11 = [r33], 8
+ sub r17 = r15, r22
+ nop.b 0
+ ;;
+
+C .mfi
+ getf.sig r20 = f32
+ xma.l f36 = f12, f6, f0
+ (p6) sub r15 = r17, r23, 1
+C .mfi
+ st8 [r32] = r17, 8
+ xma.hu f37 = f12, f6, f0
+ (p7) sub r15 = r17, r23
+ ;;
+.LL10:
+C .mfi
+ getf.sig r21 = f33
+ nop.f 0
+ cmp.ltu p6, p7 = r15, r24
+C .mib
+ ldf8 f12 = [r33], 8
+ sub r18 = r15, r24
+ nop.b 0
+ ;;
+
+C .mfi
+ getf.sig r22 = f34
+ xma.l f38 = f13, f6, f0
+ (p6) sub r15 = r18, r25, 1
+C .mfi
+ st8 [r32] = r18, 8
+ xma.hu f39 = f13, f6, f0
+ (p7) sub r15 = r18, r25
+ ;;
+.LL01:
+C .mfi
+ getf.sig r23 = f35
+ nop.f 0
+ cmp.ltu p6, p7 = r15, r26
+C .mib
+ ldf8 f13 = [r33], 8
+ sub r19 = r15, r26
+ br.cloop.sptk.few .Ltop
+C *** MAIN LOOP END ***
+ ;;
+
+ getf.sig r24 = f36
+ xma.l f32 = f10, f6, f0
+ (p6) sub r15 = r19, r27, 1
+ st8 [r32] = r19, 8
+ xma.hu f33 = f10, f6, f0
+ (p7) sub r15 = r19, r27
+ ;;
+.Lcj8: getf.sig r25 = f37
+ cmp.ltu p6, p7 = r15, r20
+ sub r16 = r15, r20
+ ;;
+ getf.sig r26 = f38
+ xma.l f34 = f11, f6, f0
+ (p6) sub r15 = r16, r21, 1
+ st8 [r32] = r16, 8
+ xma.hu f35 = f11, f6, f0
+ (p7) sub r15 = r16, r21
+ ;;
+.Lcj7: getf.sig r27 = f39
+ cmp.ltu p6, p7 = r15, r22
+ sub r17 = r15, r22
+ ;;
+ getf.sig r20 = f32
+ xma.l f36 = f12, f6, f0
+ (p6) sub r15 = r17, r23, 1
+ st8 [r32] = r17, 8
+ xma.hu f37 = f12, f6, f0
+ (p7) sub r15 = r17, r23
+ ;;
+.Lcj6: getf.sig r21 = f33
+ cmp.ltu p6, p7 = r15, r24
+ sub r18 = r15, r24
+ ;;
+ getf.sig r22 = f34
+ xma.l f38 = f13, f6, f0
+ (p6) sub r15 = r18, r25, 1
+ st8 [r32] = r18, 8
+ xma.hu f39 = f13, f6, f0
+ (p7) sub r15 = r18, r25
+ ;;
+.Lcj5: getf.sig r23 = f35
+ cmp.ltu p6, p7 = r15, r26
+ sub r19 = r15, r26
+ ;;
+ getf.sig r24 = f36
+ (p6) sub r15 = r19, r27, 1
+ st8 [r32] = r19, 8
+ (p7) sub r15 = r19, r27
+ ;;
+.Lcj4: getf.sig r25 = f37
+ cmp.ltu p6, p7 = r15, r20
+ sub r16 = r15, r20
+ ;;
+ getf.sig r26 = f38
+ (p6) sub r15 = r16, r21, 1
+ st8 [r32] = r16, 8
+ (p7) sub r15 = r16, r21
+ ;;
+.Lcj3: getf.sig r27 = f39
+ cmp.ltu p6, p7 = r15, r22
+ sub r17 = r15, r22
+ ;;
+ (p6) sub r15 = r17, r23, 1
+ st8 [r32] = r17, 8
+ (p7) sub r15 = r17, r23
+ ;;
+.Lcj2: cmp.ltu p6, p7 = r15, r24
+ sub r18 = r15, r24
+ ;;
+ (p6) sub r15 = r18, r25, 1
+ st8 [r32] = r18, 8
+ (p7) sub r15 = r18, r25
+ ;;
+.Lcj1: cmp.ltu p6, p7 = r15, r26
+ sub r19 = r15, r26
+ ;;
+ (p6) sub r8 = r19, r27, 1
+ st8 [r32] = r19
+ (p7) sub r8 = r19, r27
+ mov ar.lc = r2
+ br.ret.sptk.many b0
+EPILOGUE()
+ASM_END()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/ia64/cnd_aors_n.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/ia64/cnd_aors_n.asm
new file mode 100644
index 00000000000..dc4a937403e
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/ia64/cnd_aors_n.asm
@@ -0,0 +1,259 @@
+dnl IA-64 mpn_cnd_add_n/mpn_cnd_sub_n.
+
+dnl Contributed to the GNU project by Torbjörn Granlund.
+
+dnl Copyright 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/limb
+C Itanium: ?
+C Itanium 2: 1.5
+
+C INPUT PARAMETERS
+define(`cnd', `r32')
+define(`rp', `r33')
+define(`up', `r34')
+define(`vp', `r35')
+define(`n', `r36')
+
+ifdef(`OPERATION_cnd_add_n',`
+ define(ADDSUB, add)
+ define(CND, ltu)
+ define(INCR, 1)
+ define(LIM, -1)
+ define(func, mpn_cnd_add_n)
+')
+ifdef(`OPERATION_cnd_sub_n',`
+ define(ADDSUB, sub)
+ define(CND, gtu)
+ define(INCR, -1)
+ define(LIM, 0)
+ define(func, mpn_cnd_sub_n)
+')
+
+define(cmpeqor, `cmp.eq.or')
+define(PFDIST, 160)
+
+C Some useful aliases for registers we use
+define(`u0',`r14') define(`u1',`r15') define(`u2',`r16') define(`u3',`r17')
+define(`x0',`r20') define(`x1',`r21') define(`x2',`r22') define(`x3',`r23')
+define(`v0',`r24') define(`v1',`r25') define(`v2',`r26') define(`v3',`r27')
+define(`w0',`r28') define(`w1',`r29') define(`w2',`r30') define(`w3',`r31')
+define(`up1',`up') define(`up2',`r8') define(`upadv',`r1')
+define(`vp1',`vp') define(`vp2',`r9') define(`vpadv',`r11')
+define(`rp1',`rp') define(`rp2',`r10')
+
+MULFUNC_PROLOGUE(mpn_cnd_add_n mpn_cnd_sub_n)
+
+ASM_START()
+PROLOGUE(func)
+ .prologue
+ .save ar.lc, r2
+ .body
+ifdef(`HAVE_ABI_32',`
+ addp4 rp = 0, rp C M I
+ addp4 up = 0, up C M I
+ nop.i 0
+ addp4 vp = 0, vp C M I
+ nop.m 0
+ zxt4 n = n C I
+ ;;
+')
+.mmi; and r3 = 3, n C M I
+ add n = -1, n C M I
+ mov r2 = ar.lc C I0
+.mmi; cmp.ne p6, p7 = 0, cnd C M I
+ add vp2 = 8, vp C M I
+ add up2 = 8, up C M I
+ ;;
+.mmi; add upadv = PFDIST, up C M I
+ add vpadv = PFDIST, vp C M I
+ shr.u n = n, 2 C I0
+ .pred.rel "mutex", p6, p7
+.mmi; add rp2 = 8, rp C M I
+ (p6) mov cnd = -1 C M I
+ (p7) mov cnd = 0 C M I
+ ;;
+ cmp.eq p9, p0 = 1, r3 C M I
+ cmp.eq p7, p0 = 2, r3 C M I
+ cmp.eq p8, p0 = 3, r3 C M I
+ (p9) br L(b1) C B
+ (p7) br L(b2) C B
+ (p8) br L(b3) C B
+ ;;
+L(b0):
+.mmi; ld8 v2 = [vp1], 16 C M01
+ ld8 v3 = [vp2], 16 C M01
+ mov ar.lc = n C I0
+ ;;
+ ld8 u2 = [up1], 16 C M01
+ ld8 u3 = [up2], 16 C M01
+ and x2 = v2, cnd C M I
+ and x3 = v3, cnd C M I
+ ;;
+ ADDSUB w2 = u2, x2 C M I
+ ADDSUB w3 = u3, x3 C M I
+ ;;
+ ld8 v0 = [vp1], 16 C M01
+ ld8 v1 = [vp2], 16 C M01
+ cmp.CND p8, p0 = w2, u2 C M I
+ cmp.CND p9, p0 = w3, u3 C M I
+ br L(lo0)
+
+L(b1): ld8 v1 = [vp1], 8 C M01
+ add vp2 = 8, vp2 C M I
+ add rp2 = 8, rp2 C M I
+ ;;
+ ld8 u1 = [up1], 8 C M01
+ add up2 = 8, up2 C M I
+ and x1 = v1, cnd C M I
+ ;;
+ ADDSUB w1 = u1, x1 C M I
+ cmp.ne p10, p0 = 0, n
+ add n = -1, n
+ ;;
+ cmp.CND p7, p0 = w1, u1 C M I
+ st8 [rp1] = w1, 8 C M23
+ (p10) br L(b0)
+ ;;
+ mov r8 = 0 C M I
+ br L(e1)
+
+L(b3): ld8 v3 = [vp1], 8 C M01
+ add vp2 = 8, vp2 C M I
+ add rp2 = 8, rp2 C M I
+ ;;
+ ld8 u3 = [up1], 8 C M01
+ add up2 = 8, up2 C M I
+ and x3 = v3, cnd C M I
+ ;;
+ ADDSUB w3 = u3, x3 C M I
+ ;;
+ cmp.CND p9, p0 = w3, u3 C M I
+ st8 [rp1] = w3, 8 C M23
+ C fall through
+
+L(b2):
+.mmi; ld8 v0 = [vp1], 16 C M01
+ ld8 v1 = [vp2], 16 C M01
+ mov ar.lc = n C I0
+ ;;
+ ld8 u0 = [up1], 16 C M01
+ ld8 u1 = [up2], 16 C M01
+ and x0 = v0, cnd C M I
+ and x1 = v1, cnd C M I
+ ;;
+ ADDSUB w0 = u0, x0 C M I
+ ADDSUB w1 = u1, x1 C M I
+ br.cloop.dptk L(gt2) C B
+ ;;
+ cmp.CND p6, p0 = w0, u0 C M I
+ br L(e2) C B
+L(gt2):
+ ld8 v2 = [vp1], 16 C M01
+ ld8 v3 = [vp2], 16 C M01
+ cmp.CND p6, p0 = w0, u0 C M I
+ cmp.CND p7, p0 = w1, u1 C M I
+ br L(lo2) C B
+
+
+C *** MAIN LOOP START ***
+C ALIGN(32)
+L(top):
+.mmi; ld8 v2 = [vp1], 16 C M01
+ ld8 v3 = [vp2], 16 C M01
+ cmp.CND p6, p0 = w0, u0 C M I
+.mmi; st8 [rp1] = w2, 16 C M23
+ st8 [rp2] = w3, 16 C M23
+ cmp.CND p7, p0 = w1, u1 C M I
+ ;;
+L(lo2):
+.mmi; ld8 u2 = [up1], 16 C M01
+ ld8 u3 = [up2], 16 C M01
+ (p9) cmpeqor p6, p0 = LIM, w0 C M I
+.mmi; and x2 = v2, cnd C M I
+ and x3 = v3, cnd C M I
+ (p9) add w0 = INCR, w0 C M I
+ ;;
+.mmi; ADDSUB w2 = u2, x2 C M I
+ (p6) cmpeqor p7, p0 = LIM, w1 C M I
+ (p6) add w1 = INCR, w1 C M I
+.mmi; ADDSUB w3 = u3, x3 C M I
+ lfetch [upadv], 32
+ nop 0
+ ;;
+.mmi; ld8 v0 = [vp1], 16 C M01
+ ld8 v1 = [vp2], 16 C M01
+ cmp.CND p8, p0 = w2, u2 C M I
+.mmi; st8 [rp1] = w0, 16 C M23
+ st8 [rp2] = w1, 16 C M23
+ cmp.CND p9, p0 = w3, u3 C M I
+ ;;
+L(lo0):
+.mmi; ld8 u0 = [up1], 16 C M01
+ ld8 u1 = [up2], 16 C M01
+ (p7) cmpeqor p8, p0 = LIM, w2 C M I
+.mmi; and x0 = v0, cnd C M I
+ and x1 = v1, cnd C M I
+ (p7) add w2 = INCR, w2 C M I
+ ;;
+.mmi; ADDSUB w0 = u0, x0 C M I
+ (p8) cmpeqor p9, p0 = LIM, w3 C M I
+ (p8) add w3 = INCR, w3 C M I
+.mmb; ADDSUB w1 = u1, x1 C M I
+ lfetch [vpadv], 32
+ br.cloop.dptk L(top) C B
+ ;;
+C *** MAIN LOOP END ***
+
+
+L(end):
+.mmi; st8 [rp1] = w2, 16 C M23
+ st8 [rp2] = w3, 16 C M23
+ cmp.CND p6, p0 = w0, u0 C M I
+ ;;
+L(e2):
+.mmi; cmp.CND p7, p0 = w1, u1 C M I
+ (p9) cmpeqor p6, p0 = LIM, w0 C M I
+ (p9) add w0 = INCR, w0 C M I
+ ;;
+.mmi; mov r8 = 0 C M I
+ (p6) cmpeqor p7, p0 = LIM, w1 C M I
+ (p6) add w1 = INCR, w1 C M I
+ ;;
+.mmi; st8 [rp1] = w0, 16 C M23
+ st8 [rp2] = w1, 16 C M23
+ mov ar.lc = r2 C I0
+L(e1):
+.mmb; nop 0
+ (p7) mov r8 = 1 C M I
+ br.ret.sptk.many b0 C B
+EPILOGUE()
+ASM_END()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/ia64/copyd.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/ia64/copyd.asm
new file mode 100644
index 00000000000..b94a1af3624
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/ia64/copyd.asm
@@ -0,0 +1,186 @@
+dnl IA-64 mpn_copyd -- copy limb vector, decrementing.
+
+dnl Contributed to the GNU project by Torbjorn Granlund.
+
+dnl Copyright 2001, 2002, 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 cycles/limb
+C Itanium: 1
+C Itanium 2: 0.5
+
+C INPUT PARAMETERS
+C rp = r32
+C sp = r33
+C n = r34
+
+ASM_START()
+PROLOGUE(mpn_copyd)
+ .prologue
+ .save ar.lc, r2
+ .body
+ifdef(`HAVE_ABI_32',
+` addp4 r32 = 0, r32
+ addp4 r33 = 0, r33
+ sxt4 r34 = r34
+ ;;
+')
+{.mmi
+ shladd r32 = r34, 3, r32
+ shladd r33 = r34, 3, r33
+ mov.i r2 = ar.lc
+}
+{.mmi
+ and r14 = 3, r34
+ cmp.ge p14, p15 = 3, r34
+ add r34 = -4, r34
+ ;;
+}
+{.mmi
+ cmp.eq p8, p0 = 1, r14
+ cmp.eq p10, p0 = 2, r14
+ cmp.eq p12, p0 = 3, r14
+}
+{.bbb
+ (p8) br.dptk .Lb01
+ (p10) br.dptk .Lb10
+ (p12) br.dptk .Lb11
+}
+
+.Lb00: C n = 0, 4, 8, 12, ...
+ add r32 = -8, r32
+ add r33 = -8, r33
+ (p14) br.dptk .Ls00
+ ;;
+ add r21 = -8, r33
+ ld8 r16 = [r33], -16
+ shr r15 = r34, 2
+ ;;
+ ld8 r17 = [r21], -16
+ mov.i ar.lc = r15
+ ld8 r18 = [r33], -16
+ add r20 = -8, r32
+ ;;
+ ld8 r19 = [r21], -16
+ br.cloop.dptk .Loop
+ ;;
+ br.sptk .Lend
+ ;;
+
+.Lb01: C n = 1, 5, 9, 13, ...
+ add r21 = -8, r33
+ add r20 = -8, r32
+ add r33 = -16, r33
+ add r32 = -16, r32
+ ;;
+ ld8 r19 = [r21], -16
+ shr r15 = r34, 2
+ (p14) br.dptk .Ls01
+ ;;
+ ld8 r16 = [r33], -16
+ mov.i ar.lc = r15
+ ;;
+ ld8 r17 = [r21], -16
+ ld8 r18 = [r33], -16
+ br.sptk .Li01
+ ;;
+
+.Lb10: C n = 2,6, 10, 14, ...
+ add r21 = -16, r33
+ shr r15 = r34, 2
+ add r20 = -16, r32
+ add r32 = -8, r32
+ add r33 = -8, r33
+ ;;
+ ld8 r18 = [r33], -16
+ ld8 r19 = [r21], -16
+ mov.i ar.lc = r15
+ (p14) br.dptk .Ls10
+ ;;
+ ld8 r16 = [r33], -16
+ ld8 r17 = [r21], -16
+ br.sptk .Li10
+ ;;
+
+.Lb11: C n = 3, 7, 11, 15, ...
+ add r21 = -8, r33
+ add r20 = -8, r32
+ add r33 = -16, r33
+ add r32 = -16, r32
+ ;;
+ ld8 r17 = [r21], -16
+ shr r15 = r34, 2
+ ;;
+ ld8 r18 = [r33], -16
+ mov.i ar.lc = r15
+ ld8 r19 = [r21], -16
+ (p14) br.dptk .Ls11
+ ;;
+ ld8 r16 = [r33], -16
+ br.sptk .Li11
+ ;;
+
+ ALIGN(32)
+.Loop:
+.Li00:
+{.mmb
+ st8 [r32] = r16, -16
+ ld8 r16 = [r33], -16
+ nop.b 0
+}
+.Li11:
+{.mmb
+ st8 [r20] = r17, -16
+ ld8 r17 = [r21], -16
+ nop.b 0
+ ;;
+}
+.Li10:
+{.mmb
+ st8 [r32] = r18, -16
+ ld8 r18 = [r33], -16
+ nop.b 0
+}
+.Li01:
+{.mmb
+ st8 [r20] = r19, -16
+ ld8 r19 = [r21], -16
+ br.cloop.dptk .Loop
+ ;;
+}
+.Lend: st8 [r32] = r16, -16
+.Ls11: st8 [r20] = r17, -16
+ ;;
+.Ls10: st8 [r32] = r18, -16
+.Ls01: st8 [r20] = r19, -16
+.Ls00: mov.i ar.lc = r2
+ br.ret.sptk.many b0
+EPILOGUE()
+ASM_END()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/ia64/copyi.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/ia64/copyi.asm
new file mode 100644
index 00000000000..49ed192021a
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/ia64/copyi.asm
@@ -0,0 +1,182 @@
+dnl IA-64 mpn_copyi -- copy limb vector, incrementing.
+
+dnl Contributed to the GNU project by Torbjorn Granlund.
+
+dnl Copyright 2001, 2002, 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 cycles/limb
+C Itanium: 1
+C Itanium 2: 0.5
+
+C INPUT PARAMETERS
+C rp = r32
+C sp = r33
+C n = r34
+
+ASM_START()
+PROLOGUE(mpn_copyi)
+ .prologue
+ .save ar.lc, r2
+ .body
+ifdef(`HAVE_ABI_32',
+` addp4 r32 = 0, r32
+ addp4 r33 = 0, r33
+ sxt4 r34 = r34
+ ;;
+')
+{.mmi
+ nop 0
+ nop 0
+ mov.i r2 = ar.lc
+}
+{.mmi
+ and r14 = 3, r34
+ cmp.ge p14, p15 = 3, r34
+ add r34 = -4, r34
+ ;;
+}
+{.mmi
+ cmp.eq p8, p0 = 1, r14
+ cmp.eq p10, p0 = 2, r14
+ cmp.eq p12, p0 = 3, r14
+}
+{.bbb
+ (p8) br.dptk .Lb01
+ (p10) br.dptk .Lb10
+ (p12) br.dptk .Lb11
+}
+
+.Lb00: C n = 0, 4, 8, 12, ...
+ (p14) br.dptk .Ls00
+ ;;
+ add r21 = 8, r33
+ ld8 r16 = [r33], 16
+ shr r15 = r34, 2
+ ;;
+ ld8 r17 = [r21], 16
+ mov.i ar.lc = r15
+ ld8 r18 = [r33], 16
+ add r20 = 8, r32
+ ;;
+ ld8 r19 = [r21], 16
+ br.cloop.dptk .Loop
+ ;;
+ br.sptk .Lend
+ ;;
+
+.Lb01: C n = 1, 5, 9, 13, ...
+ add r21 = 0, r33
+ add r20 = 0, r32
+ add r33 = 8, r33
+ add r32 = 8, r32
+ ;;
+ ld8 r19 = [r21], 16
+ shr r15 = r34, 2
+ (p14) br.dptk .Ls01
+ ;;
+ ld8 r16 = [r33], 16
+ mov.i ar.lc = r15
+ ;;
+ ld8 r17 = [r21], 16
+ ld8 r18 = [r33], 16
+ br.sptk .Li01
+ ;;
+
+.Lb10: C n = 2,6, 10, 14, ...
+ add r21 = 8, r33
+ add r20 = 8, r32
+ ld8 r18 = [r33], 16
+ shr r15 = r34, 2
+ ;;
+ ld8 r19 = [r21], 16
+ mov.i ar.lc = r15
+ (p14) br.dptk .Ls10
+ ;;
+ ld8 r16 = [r33], 16
+ ld8 r17 = [r21], 16
+ br.sptk .Li10
+ ;;
+
+.Lb11: C n = 3, 7, 11, 15, ...
+ add r21 = 0, r33
+ add r20 = 0, r32
+ add r33 = 8, r33
+ add r32 = 8, r32
+ ;;
+ ld8 r17 = [r21], 16
+ shr r15 = r34, 2
+ ;;
+ ld8 r18 = [r33], 16
+ mov.i ar.lc = r15
+ ld8 r19 = [r21], 16
+ (p14) br.dptk .Ls11
+ ;;
+ ld8 r16 = [r33], 16
+ br.sptk .Li11
+ ;;
+
+ ALIGN(32)
+.Loop:
+.Li00:
+{.mmb
+ st8 [r32] = r16, 16
+ ld8 r16 = [r33], 16
+ nop.b 0
+}
+.Li11:
+{.mmb
+ st8 [r20] = r17, 16
+ ld8 r17 = [r21], 16
+ nop.b 0
+ ;;
+}
+.Li10:
+{.mmb
+ st8 [r32] = r18, 16
+ ld8 r18 = [r33], 16
+ nop.b 0
+}
+.Li01:
+{.mmb
+ st8 [r20] = r19, 16
+ ld8 r19 = [r21], 16
+ br.cloop.dptk .Loop
+ ;;
+}
+.Lend: st8 [r32] = r16, 16
+.Ls11: st8 [r20] = r17, 16
+ ;;
+.Ls10: st8 [r32] = r18, 16
+.Ls01: st8 [r20] = r19, 16
+.Ls00: mov.i ar.lc = r2
+ br.ret.sptk.many b0
+EPILOGUE()
+ASM_END()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/ia64/dive_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/ia64/dive_1.asm
new file mode 100644
index 00000000000..5e4a273530c
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/ia64/dive_1.asm
@@ -0,0 +1,236 @@
+dnl IA-64 mpn_divexact_1 -- mpn by limb exact division.
+
+dnl Contributed to the GNU project by Torbjorn Granlund and Kevin Ryde.
+
+dnl Copyright 2003-2005, 2010 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 Itanium: 16
+C Itanium 2: 8
+
+C INPUT PARAMETERS
+define(`rp', `r32')
+define(`up', `r33')
+define(`n', `r34')
+define(`divisor', `r35')
+
+define(`lshift', `r24')
+define(`rshift', `r25')
+
+C This code is a bit messy, and not as similar to mode1o.asm as desired.
+
+C The critical path during initialization is for computing the inverse of the
+C divisor. Since odd divisors are probably common, we conditionally execute
+C the initial count_trailing_zeros code and the downshift.
+
+C Possible improvement: Merge more of the feed-in code into the inverse
+C computation.
+
+ASM_START()
+ .text
+ .align 32
+.Ltab:
+data1 0,0x01, 0,0xAB, 0,0xCD, 0,0xB7, 0,0x39, 0,0xA3, 0,0xC5, 0,0xEF
+data1 0,0xF1, 0,0x1B, 0,0x3D, 0,0xA7, 0,0x29, 0,0x13, 0,0x35, 0,0xDF
+data1 0,0xE1, 0,0x8B, 0,0xAD, 0,0x97, 0,0x19, 0,0x83, 0,0xA5, 0,0xCF
+data1 0,0xD1, 0,0xFB, 0,0x1D, 0,0x87, 0,0x09, 0,0xF3, 0,0x15, 0,0xBF
+data1 0,0xC1, 0,0x6B, 0,0x8D, 0,0x77, 0,0xF9, 0,0x63, 0,0x85, 0,0xAF
+data1 0,0xB1, 0,0xDB, 0,0xFD, 0,0x67, 0,0xE9, 0,0xD3, 0,0xF5, 0,0x9F
+data1 0,0xA1, 0,0x4B, 0,0x6D, 0,0x57, 0,0xD9, 0,0x43, 0,0x65, 0,0x8F
+data1 0,0x91, 0,0xBB, 0,0xDD, 0,0x47, 0,0xC9, 0,0xB3, 0,0xD5, 0,0x7F
+data1 0,0x81, 0,0x2B, 0,0x4D, 0,0x37, 0,0xB9, 0,0x23, 0,0x45, 0,0x6F
+data1 0,0x71, 0,0x9B, 0,0xBD, 0,0x27, 0,0xA9, 0,0x93, 0,0xB5, 0,0x5F
+data1 0,0x61, 0,0x0B, 0,0x2D, 0,0x17, 0,0x99, 0,0x03, 0,0x25, 0,0x4F
+data1 0,0x51, 0,0x7B, 0,0x9D, 0,0x07, 0,0x89, 0,0x73, 0,0x95, 0,0x3F
+data1 0,0x41, 0,0xEB, 0,0x0D, 0,0xF7, 0,0x79, 0,0xE3, 0,0x05, 0,0x2F
+data1 0,0x31, 0,0x5B, 0,0x7D, 0,0xE7, 0,0x69, 0,0x53, 0,0x75, 0,0x1F
+data1 0,0x21, 0,0xCB, 0,0xED, 0,0xD7, 0,0x59, 0,0xC3, 0,0xE5, 0,0x0F
+data1 0,0x11, 0,0x3B, 0,0x5D, 0,0xC7, 0,0x49, 0,0x33, 0,0x55, 0,0xFF
+
+
+PROLOGUE(mpn_divexact_1)
+ .prologue
+ .save ar.lc, r2
+ .body
+
+ {.mmi; add r8 = -1, divisor C M0
+ nop 0 C M1
+ tbit.z p8, p9 = divisor, 0 C I0
+}
+ifdef(`HAVE_ABI_32',
+` addp4 rp = 0, rp C M2 rp extend
+ addp4 up = 0, up C M3 up extend
+ sxt4 n = n') C I1 size extend
+ ;;
+.Lhere:
+ {.mmi; ld8 r20 = [up], 8 C M0 up[0]
+ (p8) andcm r8 = r8, divisor C M1
+ mov r15 = ip C I0 .Lhere
+ ;;
+}{.mii
+ .pred.rel "mutex", p8, p9
+ (p9) mov rshift = 0 C M0
+ (p8) popcnt rshift = r8 C I0 r8 = cnt_lo_zeros(divisor)
+ cmp.eq p6, p10 = 1, n C I1
+ ;;
+}{.mii; add r9 = .Ltab-.Lhere, r15 C M0
+ (p8) shr.u divisor = divisor, rshift C I0
+ nop 0 C I1
+ ;;
+}{.mmi; add n = -4, n C M0 size-1
+ (p10) ld8 r21 = [up], 8 C M1 up[1]
+ mov r14 = 2 C M1 2
+}{.mfi; setf.sig f6 = divisor C M2 divisor
+ mov f9 = f0 C M3 carry FIXME
+ zxt1 r3 = divisor C I1 divisor low byte
+ ;;
+}{.mmi; add r3 = r9, r3 C M0 table offset ip and index
+ sub r16 = 0, divisor C M1 -divisor
+ mov r2 = ar.lc C I0
+}{.mmi; sub lshift = 64, rshift C M2
+ setf.sig f13 = r14 C M3 2 in significand
+ mov r17 = -1 C I1 -1
+ ;;
+}{.mmi; ld1 r3 = [r3] C M0 inverse, 8 bits
+ nop 0 C M1
+ mov ar.lc = n C I0 size-1 loop count
+}{.mmi; setf.sig f12 = r16 C M2 -divisor
+ setf.sig f8 = r17 C M3 -1
+ cmp.eq p7, p0 = -2, n C I1
+ ;;
+}{.mmi; setf.sig f7 = r3 C M2 inverse, 8 bits
+ cmp.eq p8, p0 = -1, n C M0
+ shr.u r23 = r20, rshift C I0
+ ;;
+}
+
+ C f6 divisor
+ C f7 inverse, being calculated
+ C f8 -1, will be -inverse
+ C f9 carry
+ C f12 -divisor
+ C f13 2
+ C f14 scratch
+
+ xmpy.l f14 = f13, f7 C Newton 2*i
+ xmpy.l f7 = f7, f7 C Newton i*i
+ ;;
+ xma.l f7 = f7, f12, f14 C Newton i*i*-d + 2*i, 16 bits
+ ;;
+ setf.sig f10 = r23 C speculative, used iff n = 1
+ xmpy.l f14 = f13, f7 C Newton 2*i
+ shl r22 = r21, lshift C speculative, used iff n > 1
+ xmpy.l f7 = f7, f7 C Newton i*i
+ ;;
+ or r31 = r22, r23 C speculative, used iff n > 1
+ xma.l f7 = f7, f12, f14 C Newton i*i*-d + 2*i, 32 bits
+ shr.u r23 = r21, rshift C speculative, used iff n > 1
+ ;;
+ setf.sig f11 = r31 C speculative, used iff n > 1
+ xmpy.l f14 = f13, f7 C Newton 2*i
+ xmpy.l f7 = f7, f7 C Newton i*i
+ ;;
+ xma.l f7 = f7, f12, f14 C Newton i*i*-d + 2*i, 64 bits
+
+ (p7) br.cond.dptk .Ln2
+ (p10) br.cond.dptk .grt3
+ ;;
+
+.Ln1: xmpy.l f12 = f10, f7 C q = ulimb * inverse
+ br .Lx1
+
+.Ln2:
+ xmpy.l f8 = f7, f8 C -inverse = inverse * -1
+ xmpy.l f12 = f11, f7 C q = ulimb * inverse
+ setf.sig f11 = r23
+ br .Lx2
+
+.grt3:
+ ld8 r21 = [up], 8 C up[2]
+ xmpy.l f8 = f7, f8 C -inverse = inverse * -1
+ ;;
+ shl r22 = r21, lshift
+ ;;
+ xmpy.l f12 = f11, f7 C q = ulimb * inverse
+ ;;
+ or r31 = r22, r23
+ shr.u r23 = r21, rshift
+ ;;
+ setf.sig f11 = r31
+ (p8) br.cond.dptk .Lx3 C branch for n = 3
+ ;;
+ ld8 r21 = [up], 8
+ br .Lent
+
+.Ltop: ld8 r21 = [up], 8
+ xma.l f12 = f9, f8, f10 C q = c * -inverse + si
+ nop.b 0
+ ;;
+.Lent: add r16 = 160, up
+ shl r22 = r21, lshift
+ nop.b 0
+ ;;
+ stf8 [rp] = f12, 8
+ xma.hu f9 = f12, f6, f9 C c = high(q * divisor + c)
+ nop.b 0
+ nop.m 0
+ xmpy.l f10 = f11, f7 C si = ulimb * inverse
+ nop.b 0
+ ;;
+ or r31 = r22, r23
+ shr.u r23 = r21, rshift
+ nop.b 0
+ ;;
+ lfetch [r16]
+ setf.sig f11 = r31
+ br.cloop.sptk.few.clr .Ltop
+
+
+ xma.l f12 = f9, f8, f10 C q = c * -inverse + si
+ ;;
+.Lx3: stf8 [rp] = f12, 8
+ xma.hu f9 = f12, f6, f9 C c = high(q * divisor + c)
+ xmpy.l f10 = f11, f7 C si = ulimb * inverse
+ ;;
+ setf.sig f11 = r23
+ ;;
+ xma.l f12 = f9, f8, f10 C q = c * -inverse + si
+ ;;
+.Lx2: stf8 [rp] = f12, 8
+ xma.hu f9 = f12, f6, f9 C c = high(q * divisor + c)
+ xmpy.l f10 = f11, f7 C si = ulimb * inverse
+ ;;
+ xma.l f12 = f9, f8, f10 C q = c * -inverse + si
+ ;;
+.Lx1: stf8 [rp] = f12, 8
+ mov ar.lc = r2 C I0
+ br.ret.sptk.many b0
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/ia64/divrem_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/ia64/divrem_1.asm
new file mode 100644
index 00000000000..e8878209db7
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/ia64/divrem_1.asm
@@ -0,0 +1,477 @@
+dnl IA-64 mpn_divrem_1 and mpn_preinv_divrem_1 -- Divide an mpn number by an
+dnl unnormalized limb.
+
+dnl Contributed to the GNU project by Torbjorn Granlund.
+
+dnl Copyright 2002, 2004, 2005 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 Itanium: 40-42
+C Itanium 2: 29-30
+
+C This was generated by gcc, then the loops were optimized. The preinv entry
+C point was shoehorned into the file. Lots of things outside the loops could
+C be streamlined. It would probably be a good idea to merge the loops for
+C normalized and unnormalized divisor, since the shifting stuff is done for
+C free in parallel with other operations. It would even be possible to merge
+C all loops, if the ld8 were made conditional.
+
+C TODO
+C * Consider delaying inversion for normalized mpn_divrem_1 entry till after
+C computing leading limb.
+C * Inline and interleave limb inversion code with loop setup code.
+
+ASM_START()
+
+C HP's assembler requires these declarations for importing mpn_invert_limb
+ .global mpn_invert_limb
+ .type mpn_invert_limb,@function
+
+C INPUT PARAMETERS
+C rp = r32
+C qxn = r33
+C up = r34
+C n = r35
+C vl = r36
+C vlinv = r37 (preinv only)
+C cnt = r38 (preinv only)
+
+PROLOGUE(mpn_preinv_divrem_1)
+ .prologue
+ .save ar.pfs, r42
+ alloc r42 = ar.pfs, 7, 8, 1, 0
+ .save ar.lc, r44
+ mov r44 = ar.lc
+ .save rp, r41
+ mov r41 = b0
+ .body
+ifdef(`HAVE_ABI_32',
+` addp4 r32 = 0, r32
+ sxt4 r33 = r33
+ addp4 r34 = 0, r34
+ sxt4 r35 = r35
+ ;;
+')
+ mov r40 = r38
+ shladd r34 = r35, 3, r34
+ ;;
+ adds r34 = -8, r34
+ ;;
+ ld8 r39 = [r34], -8
+ ;;
+
+ add r15 = r35, r33
+ ;;
+ mov r8 = r37
+ shladd r32 = r15, 3, r32 C r32 = rp + n + qxn
+ cmp.le p8, p0 = 0, r36
+ ;;
+ adds r32 = -8, r32 C r32 = rp + n + qxn - 1
+ cmp.leu p6, p7 = r36, r39
+ (p8) br.cond.dpnt .Lpunnorm
+ ;;
+
+ (p6) addl r15 = 1, r0
+ (p7) mov r15 = r0
+ ;;
+ (p6) sub r38 = r39, r36
+ (p7) mov r38 = r39
+ st8 [r32] = r15, -8
+ adds r35 = -2, r35 C un -= 2
+ br .Lpn
+
+.Lpunnorm:
+ (p6) add r34 = 8, r34
+ mov r38 = 0 C r = 0
+ shl r36 = r36, r40
+ (p6) br.cond.dptk .Lpu
+ ;;
+ shl r38 = r39, r40 C r = ahigh << cnt
+ cmp.ne p8, p0 = 1, r35
+ st8 [r32] = r0, -8
+ adds r35 = -1, r35 C un--
+ (p8) br.cond.dpnt .Lpu
+
+ mov r23 = 1
+ ;;
+ setf.sig f6 = r8
+ setf.sig f12 = r23
+ br .L435
+EPILOGUE()
+
+
+PROLOGUE(mpn_divrem_1)
+ .prologue
+ .save ar.pfs, r42
+ alloc r42 = ar.pfs, 5, 8, 1, 0
+ .save ar.lc, r44
+ mov r44 = ar.lc
+ .save rp, r41
+ mov r41 = b0
+ .body
+ifdef(`HAVE_ABI_32',
+` addp4 r32 = 0, r32
+ sxt4 r33 = r33
+ addp4 r34 = 0, r34
+ sxt4 r35 = r35
+ ;;
+')
+ mov r38 = r0
+ add r15 = r35, r33
+ ;;
+ cmp.ne p6, p7 = 0, r15
+ ;;
+ (p7) mov r8 = r0
+ (p7) br.cond.dpnt .Lret
+ shladd r14 = r15, 3, r32 C r14 = rp + n + qxn
+ cmp.le p6, p7 = 0, r36
+ ;;
+ adds r32 = -8, r14 C r32 = rp + n + qxn - 1
+ (p6) br.cond.dpnt .Lunnorm
+ cmp.eq p6, p7 = 0, r35
+ (p6) br.cond.dpnt .L179
+ shladd r14 = r35, 3, r34
+ ;;
+ adds r14 = -8, r14
+ adds r35 = -1, r35
+ ;;
+ ld8 r38 = [r14]
+ ;;
+ cmp.leu p6, p7 = r36, r38
+ ;;
+ (p6) addl r15 = 1, r0
+ (p7) mov r15 = r0
+ ;;
+ st8 [r32] = r15, -8
+ (p6) sub r38 = r38, r36
+
+.L179:
+ mov r45 = r36
+ adds r35 = -1, r35
+ br.call.sptk.many b0 = mpn_invert_limb
+ ;;
+ shladd r34 = r35, 3, r34
+.Lpn:
+ mov r23 = 1
+ ;;
+ setf.sig f6 = r8
+ setf.sig f12 = r23
+ cmp.le p6, p7 = 0, r35
+ mov r40 = 0
+ (p7) br.cond.dpnt .L435
+ setf.sig f10 = r36
+ mov ar.lc = r35
+ setf.sig f7 = r38
+ ;;
+ sub r28 = -1, r36
+C Develop quotient limbs for normalized divisor
+.Loop1: C 00 C q=r18 nh=r38/f7
+ ld8 r20 = [r34], -8
+ xma.hu f11 = f7, f6, f0
+ ;; C 04
+ xma.l f8 = f11, f12, f7 C q = q + nh
+ ;; C 08
+ getf.sig r18 = f8
+ xma.hu f9 = f8, f10, f0
+ xma.l f8 = f8, f10, f0
+ ;; C 12
+ getf.sig r16 = f9
+ C 13
+ getf.sig r15 = f8
+ ;; C 18
+ cmp.ltu p6, p7 = r20, r15
+ sub r15 = r20, r15
+ sub r16 = r38, r16
+ ;; C 19
+ (p6) cmp.ne p8, p9 = 1, r16 C is rH != 0?
+ (p7) cmp.ne p8, p9 = 0, r16 C is rH != 0?
+ (p6) add r16 = -1, r16
+ (p0) cmp.ne.unc p6, p7 = r0, r0
+ ;; C 20
+ (p8) cmp.ltu p6, p7 = r15, r36
+ (p8) sub r15 = r15, r36
+ (p8) add r18 = 1, r18 C q = q + 1; done if: rH > 0
+ ;; C 21
+ .pred.rel "mutex",p6,p7
+ (p6) cmp.ne p8, p9 = 1, r16 C is rH != 0 still?
+ (p7) cmp.ne p8, p9 = 0, r16 C is rH != 0 still?
+ cmp.ltu p6, p7 = r15, r36 C speculative
+ sub r28 = r15, r36 C speculative, just for cmp
+ ;; C 22
+ (p8) cmp.ltu p6, p7 = r28, r36 C redo last cmp if needed
+ (p8) mov r15 = r28
+ (p8) add r18 = 1, r18 C q = q + 1; done if: rH > 0
+ ;; C 23
+ (p6) setf.sig f7 = r15
+ (p7) sub r15 = r15, r36
+ (p7) add r18 = 1, r18 C q = q + 1; done if: rH > 0
+ ;; C 24
+ (p7) setf.sig f7 = r15
+ st8 [r32] = r18, -8
+ mov r38 = r15
+ br.cloop.dptk .Loop1
+ C 29/30
+ br.sptk .L435
+ ;;
+.Lunnorm:
+ mux1 r16 = r36, @rev
+ cmp.eq p6, p7 = 0, r35
+ (p6) br.cond.dpnt .L322
+ shladd r34 = r35, 3, r34
+ ;;
+ adds r34 = -8, r34
+ ;;
+ ld8 r39 = [r34]
+ ;;
+ cmp.leu p6, p7 = r36, r39
+ (p6) br.cond.dptk .L322
+ adds r34 = -8, r34
+ ;;
+ mov r38 = r39
+ ;;
+ cmp.ne p6, p7 = 1, r15
+ st8 [r32] = r0, -8
+ ;;
+ (p7) mov r8 = r38
+ (p7) br.cond.dpnt .Lret
+ adds r35 = -1, r35
+.L322:
+ sub r14 = r0, r16
+ ;;
+ or r14 = r16, r14
+ ;;
+ mov r16 = -8
+ czx1.l r14 = r14
+ ;;
+ shladd r16 = r14, 3, r16
+ ;;
+ shr.u r14 = r36, r16
+ ;;
+ cmp.geu p6, p7 = 15, r14
+ ;;
+ (p7) shr.u r14 = r14, 4
+ (p7) adds r16 = 4, r16
+ ;;
+ cmp.geu p6, p7 = 3, r14
+ ;;
+ (p7) shr.u r14 = r14, 2
+ (p7) adds r16 = 2, r16
+ ;;
+ tbit.nz p6, p7 = r14, 1
+ ;;
+ .pred.rel "mutex",p6,p7
+ (p6) sub r40 = 62, r16
+ (p7) sub r40 = 63, r16
+ ;;
+ shl r45 = r36, r40
+ shl r36 = r36, r40
+ shl r38 = r38, r40
+ br.call.sptk.many b0 = mpn_invert_limb
+ ;;
+.Lpu:
+ mov r23 = 1
+ ;;
+ setf.sig f6 = r8
+ setf.sig f12 = r23
+ cmp.eq p6, p7 = 0, r35
+ (p6) br.cond.dpnt .L435
+ sub r16 = 64, r40
+ adds r35 = -2, r35
+ ;;
+ ld8 r39 = [r34], -8
+ cmp.le p6, p7 = 0, r35
+ ;;
+ shr.u r14 = r39, r16
+ ;;
+ or r38 = r14, r38
+ (p7) br.cond.dpnt .Lend3
+ ;;
+ mov r22 = r16
+ setf.sig f10 = r36
+ setf.sig f7 = r38
+ mov ar.lc = r35
+ ;;
+C Develop quotient limbs for unnormalized divisor
+.Loop3:
+ ld8 r14 = [r34], -8
+ xma.hu f11 = f7, f6, f0
+ ;;
+ xma.l f8 = f11, f12, f7 C q = q + nh
+ ;;
+ getf.sig r18 = f8
+ xma.hu f9 = f8, f10, f0
+ shl r20 = r39, r40
+ xma.l f8 = f8, f10, f0
+ shr.u r24 = r14, r22
+ ;;
+ getf.sig r16 = f9
+ getf.sig r15 = f8
+ or r20 = r24, r20
+ ;;
+ cmp.ltu p6, p7 = r20, r15
+ sub r15 = r20, r15
+ sub r16 = r38, r16
+ ;;
+ (p6) cmp.ne p8, p9 = 1, r16 C is rH != 0?
+ (p7) cmp.ne p8, p9 = 0, r16 C is rH != 0?
+ (p6) add r16 = -1, r16
+ (p0) cmp.ne.unc p6, p7 = r0, r0
+ ;;
+ (p8) cmp.ltu p6, p7 = r15, r36
+ (p8) sub r15 = r15, r36
+ (p8) add r18 = 1, r18 C q = q + 1; done if: rH > 0
+ ;;
+ .pred.rel "mutex",p6,p7
+ (p6) cmp.ne p8, p9 = 1, r16 C is rH != 0 still?
+ (p7) cmp.ne p8, p9 = 0, r16 C is rH != 0 still?
+ cmp.ltu p6, p7 = r15, r36 C speculative
+ sub r28 = r15, r36 C speculative, just for cmp
+ ;;
+ (p8) cmp.ltu p6, p7 = r28, r36 C redo last cmp if needed
+ (p8) mov r15 = r28
+ (p8) add r18 = 1, r18 C q = q + 1; done if: rH > 0
+ ;;
+ (p6) setf.sig f7 = r15
+ (p7) sub r15 = r15, r36
+ (p7) add r18 = 1, r18 C q = q + 1; done if: rH > 0
+ ;;
+ (p7) setf.sig f7 = r15
+ st8 [r32] = r18, -8
+ mov r39 = r14
+ mov r38 = r15
+ br.cloop.dptk .Loop3
+ ;;
+.Lend3:
+ setf.sig f10 = r36
+ setf.sig f7 = r38
+ ;;
+ xma.hu f11 = f7, f6, f0
+ ;;
+ xma.l f8 = f11, f12, f7 C q = q + nh
+ ;;
+ getf.sig r18 = f8
+ xma.hu f9 = f8, f10, f0
+ shl r20 = r39, r40
+ xma.l f8 = f8, f10, f0
+ ;;
+ getf.sig r16 = f9
+ getf.sig r15 = f8
+ ;;
+ cmp.ltu p6, p7 = r20, r15
+ sub r15 = r20, r15
+ sub r16 = r38, r16
+ ;;
+ (p6) cmp.ne p8, p9 = 1, r16 C is rH != 0?
+ (p7) cmp.ne p8, p9 = 0, r16 C is rH != 0?
+ (p6) add r16 = -1, r16
+ (p0) cmp.ne.unc p6, p7 = r0, r0
+ ;;
+ (p8) cmp.ltu p6, p7 = r15, r36
+ (p8) sub r15 = r15, r36
+ (p8) add r18 = 1, r18 C q = q + 1; done if: rH > 0
+ ;;
+ .pred.rel "mutex",p6,p7
+ (p6) cmp.ne p8, p9 = 1, r16 C is rH != 0 still?
+ (p7) cmp.ne p8, p9 = 0, r16 C is rH != 0 still?
+ ;;
+ (p8) sub r15 = r15, r36
+ (p8) add r18 = 1, r18 C q = q + 1; done if: rH > 0
+ ;;
+ cmp.ltu p6, p7 = r15, r36
+ ;;
+ (p7) sub r15 = r15, r36
+ (p7) add r18 = 1, r18 C q = q + 1; done if: rH > 0
+ ;;
+ st8 [r32] = r18, -8
+ mov r38 = r15
+.L435:
+ adds r35 = -1, r33
+ cmp.le p6, p7 = 1, r33
+ (p7) br.cond.dpnt .Lend4
+ ;;
+ setf.sig f7 = r38
+ setf.sig f10 = r36
+ mov ar.lc = r35
+ ;;
+.Loop4:
+ xma.hu f11 = f7, f6, f0
+ ;;
+ xma.l f8 = f11, f12, f7 C q = q + nh
+ ;;
+ getf.sig r18 = f8
+ xma.hu f9 = f8, f10, f0
+ xma.l f8 = f8, f10, f0
+ ;;
+ getf.sig r16 = f9
+ getf.sig r15 = f8
+ ;;
+ cmp.ltu p6, p7 = 0, r15
+ sub r15 = 0, r15
+ sub r16 = r38, r16
+ ;;
+ (p6) cmp.ne p8, p9 = 1, r16 C is rH != 0?
+ (p7) cmp.ne p8, p9 = 0, r16 C is rH != 0?
+ (p6) add r16 = -1, r16
+ (p0) cmp.ne.unc p6, p7 = r0, r0
+ ;;
+ (p8) cmp.ltu p6, p7 = r15, r36
+ (p8) sub r15 = r15, r36
+ (p8) add r18 = 1, r18 C q = q + 1; done if: rH > 0
+ ;;
+ .pred.rel "mutex",p6,p7
+ (p6) cmp.ne p8, p9 = 1, r16 C is rH != 0 still?
+ (p7) cmp.ne p8, p9 = 0, r16 C is rH != 0 still?
+ cmp.ltu p6, p7 = r15, r36 C speculative
+ sub r28 = r15, r36 C speculative, just for cmp
+ ;;
+ (p8) cmp.ltu p6, p7 = r28, r36 C redo last cmp if needed
+ (p8) mov r15 = r28
+ (p8) add r18 = 1, r18 C q = q + 1; done if: rH > 0
+ ;;
+ (p6) setf.sig f7 = r15
+ (p7) sub r15 = r15, r36
+ (p7) add r18 = 1, r18 C q = q + 1; done if: rH > 0
+ ;;
+ (p7) setf.sig f7 = r15
+ st8 [r32] = r18, -8
+ mov r38 = r15
+ br.cloop.dptk .Loop4
+ ;;
+.Lend4:
+ shr.u r8 = r38, r40
+.Lret:
+ mov ar.pfs = r42
+ mov ar.lc = r44
+ mov b0 = r41
+ br.ret.sptk.many b0
+EPILOGUE()
+ASM_END()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/ia64/divrem_2.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/ia64/divrem_2.asm
new file mode 100644
index 00000000000..9864311278c
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/ia64/divrem_2.asm
@@ -0,0 +1,280 @@
+dnl IA-64 mpn_divrem_2 -- Divide an mpn number by a normalized 2-limb number.
+
+dnl Copyright 2010, 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 norm frac
+C itanium 1
+C itanium 2 29 29
+
+
+C TODO
+C * Inline and interleave limb inversion code with loop setup code.
+C * We should use explicit bundling in much of the code, since it typically
+C cuts some cycles with the GNU assembler.
+
+
+ASM_START()
+
+C HP's assembler requires these declarations for importing mpn_invert_limb
+ .global mpn_invert_limb
+ .type mpn_invert_limb,@function
+
+C INPUT PARAMETERS
+C qp = r32
+C fn = r33
+C np = r34
+C nn = r35
+C dp = r36
+
+define(`f0x1', `f15')
+
+ASM_START()
+PROLOGUE(mpn_divrem_2)
+ .prologue
+ifdef(`HAVE_ABI_32',
+` addp4 r32 = 0, r32 C M I
+ addp4 r34 = 0, r34 C M I
+ zxt4 r35 = r35 C I
+ addp4 r36 = 0, r36 C M I
+ nop.m 0
+ zxt4 r33 = r33 C I
+ ;;
+')
+ .save ar.pfs, r42
+ alloc r42 = ar.pfs, 5, 9, 1, 0
+ shladd r34 = r35, 3, r34
+ adds r14 = 8, r36
+ mov r43 = r1
+ ;;
+ adds r15 = -8, r34
+ ld8 r39 = [r14]
+ .save ar.lc, r45
+ mov r45 = ar.lc
+ adds r14 = -16, r34
+ mov r40 = r0
+ adds r34 = -24, r34
+ ;;
+ ld8 r38 = [r15]
+ .save rp, r41
+ mov r41 = b0
+ .body
+ ld8 r36 = [r36]
+ ld8 r37 = [r14]
+ ;;
+ cmp.gtu p6, p7 = r39, r38
+ (p6) br.cond.dptk .L8
+ ;;
+ cmp.leu p8, p9 = r36, r37
+ cmp.geu p6, p7 = r39, r38
+ ;;
+ (p8) cmp4.ne.and.orcm p6, p7 = 0, r0
+ (p7) br.cond.dptk .L51
+.L8:
+ add r14 = r33, r35 // un + fn
+ mov r46 = r39 // argument to mpn_invert_limb
+ ;;
+ adds r35 = -3, r14
+ ;;
+ cmp.gt p12, p0 = r0, r35
+ (p12) br.cond.dpnt L(end)
+ br.call.sptk.many b0 = mpn_invert_limb
+ ;;
+ setf.sig f11 = r8 // di (non-final)
+ setf.sig f34 = r39 // d1
+ setf.sig f33 = r36 // d0
+ mov r1 = r43
+ ;;
+ mov r17 = 1
+ setf.sig f9 = r38 // n2
+ xma.l f6 = f11, f34, f0 // t0 = LO(di * d1)
+ ;;
+ setf.sig f10 = r37 // n1
+ setf.sig f15 = r17 // 1
+ xma.hu f8 = f11, f33, f0 // s0 = HI(di * d0)
+ ;;
+ getf.sig r17 = f6
+ getf.sig r16 = f8
+ mov ar.lc = r35
+ ;;
+ sub r18 = r0, r39 // -d1
+ add r14 = r17, r36
+ ;;
+ setf.sig f14 = r18 // -d1
+ cmp.leu p8, p9 = r17, r14
+ add r16 = r14, r16
+ ;;
+ (p9) adds r19 = 0, r0
+ (p8) adds r19 = -1, r0
+ cmp.gtu p6, p7 = r14, r16
+ ;;
+ (p6) adds r19 = 1, r19
+ ;;
+ifelse(1,1,`
+ cmp.gt p7, p6 = r0, r19
+ ;;
+ (p6) adds r8 = -1, r8 // di--
+ (p6) sub r14 = r16, r39 // t0 -= d1
+ (p6) cmp.ltu p6, p7 = r16, r39 // cy for: t0 - d1
+ ;;
+ (p6) cmp.gt p9, p8 = 1, r19
+ (p7) cmp.gt p9, p8 = 0, r19
+ (p6) adds r19 = -1, r19 // t1 -= cy
+ mov r16 = r14
+ ;;
+ (p8) adds r8 = -1, r8 // di--
+ (p8) sub r14 = r16, r39 // t0 -= d1
+ (p8) cmp.ltu p8, p9 = r16, r39 // cy for: t0 - d1
+ ;;
+ (p8) cmp.gt p7, p6 = 1, r19
+ (p9) cmp.gt p7, p6 = 0, r19
+ (p8) adds r19 = -1, r19 // t1 -= cy
+ mov r16 = r14
+ ;;
+ (p6) adds r8 = -1, r8 // di--
+ (p6) sub r14 = r16, r39 // t0 -= d1
+ (p6) cmp.ltu p6, p7 = r16, r39 // cy for: t0 - d1
+ ;;
+ (p6) cmp.gt p9, p8 = 1, r19
+ (p7) cmp.gt p9, p8 = 0, r19
+ (p6) adds r19 = -1, r19 // t1 -= cy
+ mov r16 = r14
+ ;;
+ (p8) adds r8 = -1, r8 // di--
+ (p8) sub r14 = r16, r39 // t0 -= d1
+ (p8) cmp.ltu p8, p9 = r16, r39 // cy for: t0 - d1
+ ;;
+ (p8) adds r19 = -1, r19 // t1 -= cy
+ mov r16 = r14
+',`
+ cmp.gt p8, p9 = r0, r19
+ (p8) br.cond.dpnt .L46
+.L52:
+ cmp.leu p6, p7 = r39, r16
+ sub r14 = r16, r39
+ adds r8 = -1, r8
+ ;;
+ (p7) adds r19 = -1, r19
+ mov r16 = r14
+ ;;
+ (p7) cmp.gt p8, p9 = r0, r19
+ (p9) br.cond.dptk .L52
+.L46:
+')
+ setf.sig f32 = r8 // di
+ shladd r32 = r35, 3, r32
+ ;;
+
+ ALIGN(16)
+L(top): nop 0
+ nop 0
+ cmp.gt p8, p9 = r33, r35
+ ;;
+ (p8) mov r37 = r0
+ (p9) ld8 r37 = [r34], -8
+ xma.hu f8 = f9, f32, f10 // 0,29
+ xma.l f12 = f9, f32, f10 // 0
+ ;;
+ getf.sig r20 = f12 // q0 4
+ xma.l f13 = f15, f8, f9 // q += n2 4
+ sub r8 = -1, r36 // bitnot d0
+ ;;
+ getf.sig r18 = f13 // 8
+ xma.l f7 = f14, f13, f10 // 8
+ xma.l f6 = f33, f13, f33 // t0 = LO(d0*q+d0) 8
+ xma.hu f9 = f33, f13, f33 // t1 = HI(d0*q+d0) 9
+ ;;
+ getf.sig r38 = f7 // n1 12
+ getf.sig r16 = f6 // 13
+ getf.sig r19 = f9 // 14
+ ;;
+ sub r38 = r38, r39 // n1 -= d1 17
+ ;;
+ cmp.ne p9, p0 = r0, r0 // clear p9
+ cmp.leu p10, p11 = r16, r37 // cy for: n0 - t0 18
+ ;;
+ sub r37 = r37, r16 // n0 -= t0 19
+ (p11) sub r38 = r38, r19, 1 // n1 -= t1 - cy 19
+ (p10) sub r38 = r38, r19 // n1 -= t1 19
+ ;;
+ cmp.gtu p6, p7 = r20, r38 // n1 >= q0 20
+ ;;
+ (p7) cmp.ltu p9, p0 = r8, r37 // 21
+ (p6) add r18 = 1, r18 //
+ (p7) add r37 = r37, r36 // 21
+ (p7) add r38 = r38, r39 // 21
+ ;;
+ setf.sig f10 = r37 // n1 22
+ (p9) add r38 = 1, r38 // 22
+ ;;
+ setf.sig f9 = r38 // n2 23
+ cmp.gtu p6, p7 = r39, r38 // 23
+ (p7) br.cond.spnt L(fix)
+L(bck): st8 [r32] = r18, -8
+ adds r35 = -1, r35
+ br.cloop.sptk.few L(top)
+ ;;
+
+L(end): add r14 = 8, r34
+ add r15 = 16, r34
+ mov b0 = r41
+ ;;
+ st8 [r14] = r37
+ st8 [r15] = r38
+ mov ar.pfs = r42
+ mov r8 = r40
+ mov ar.lc = r45
+ br.ret.sptk.many b0
+ ;;
+.L51:
+ .pred.rel "mutex", p8, p9
+ sub r37 = r37, r36
+ (p9) sub r38 = r38, r39, 1
+ (p8) sub r38 = r38, r39
+ adds r40 = 1, r0
+ br .L8
+ ;;
+
+L(fix): cmp.geu p6, p7 = r39, r38
+ cmp.leu p8, p9 = r36, r37
+ ;;
+ (p8) cmp4.ne.and.orcm p6, p7 = 0, r0
+ (p6) br.cond.dptk L(bck)
+ sub r37 = r37, r36
+ (p9) sub r38 = r38, r39, 1
+ (p8) sub r38 = r38, r39
+ adds r18 = 1, r18
+ ;;
+ setf.sig f9 = r38 // n2
+ setf.sig f10 = r37 // n1
+ br L(bck)
+
+EPILOGUE()
+ASM_END()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/ia64/gcd_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/ia64/gcd_1.asm
new file mode 100644
index 00000000000..28e9a63ca39
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/ia64/gcd_1.asm
@@ -0,0 +1,234 @@
+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 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,@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))
+
+ .section ".rodata"
+ ALIGN(m4_lshift(1,MAXSHIFT)) C align table to allow using dep
+ctz_table:
+ .byte MAXSHIFT
+forloop(i,1,MASK,
+` .byte 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
+}{ .body
+ add r10 = -1, y C M3 y-1
+} ;;
+
+{ .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
+} ;;
+
+ mov out_carry = 0
+
+ popcnt y_twos = y_twos C I0 y twos
+ ;;
+
+{ .mmi; add x_orig_one = -1, x_orig C M0 orig x-1
+ shr.u out_divisor = y, y_twos C I0 y without twos
+}{ 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
+ mov b0 = save_rp C I0
+} ;;
+
+ popcnt x_orig = x_orig C I0 orig x twos
+ popcnt r9 = r9 C I0 x twos
+ ;;
+
+{ cmp.lt p7,p0 = x_orig, y_twos C M0 orig x_twos < y_twos
+ shr.u x = x, r9 C I0 x odd
+} ;;
+
+{ (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
+} ;;
+
+ addl r22 = @ltoffx(ctz_table#), r1
+ mov r25 = m4_lshift(MASK, MAXSHIFT)
+ ;;
+ ld8.mov r22 = [r22], ctz_table#
+ 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)
+
+
+ C result is y
+L(done_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()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/ia64/gmp-mparam.h b/Build/source/libs/gmp/gmp-6.0.0/mpn/ia64/gmp-mparam.h
new file mode 100644
index 00000000000..bdbd62d9746
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/ia64/gmp-mparam.h
@@ -0,0 +1,204 @@
+/* gmp-mparam.h -- Compiler/machine parameter header file.
+
+Copyright 2000-2005, 2009-2011, 2014 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
+
+/* 900MHz Itanium2 (titanic.gmplib.org) */
+/* FFT tuning limit = 25000000 */
+/* Generated by tuneup.c, 2014-03-12, gcc 4.4 */
+
+#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 5
+#define MOD_1_1_TO_MOD_1_2_THRESHOLD 26
+#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 USE_PREINV_DIVREM_1 1 /* native */
+#define DIV_QR_1N_PI1_METHOD 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 12
+#define DIVEXACT_1_THRESHOLD 0 /* always (native) */
+#define BMOD_1_TO_MOD_1_THRESHOLD MP_SIZE_T_MAX /* never */
+
+#define MUL_TOOM22_THRESHOLD 40
+#define MUL_TOOM33_THRESHOLD 129
+#define MUL_TOOM44_THRESHOLD 212
+#define MUL_TOOM6H_THRESHOLD 318
+#define MUL_TOOM8H_THRESHOLD 430
+
+#define MUL_TOOM32_TO_TOOM43_THRESHOLD 97
+#define MUL_TOOM32_TO_TOOM53_THRESHOLD 153
+#define MUL_TOOM42_TO_TOOM53_THRESHOLD 129
+#define MUL_TOOM42_TO_TOOM63_THRESHOLD 151
+#define MUL_TOOM43_TO_TOOM54_THRESHOLD 208
+
+#define SQR_BASECASE_THRESHOLD 11
+#define SQR_TOOM2_THRESHOLD 82
+#define SQR_TOOM3_THRESHOLD 131
+#define SQR_TOOM4_THRESHOLD 494
+#define SQR_TOOM6_THRESHOLD 0 /* always */
+#define SQR_TOOM8_THRESHOLD 0 /* always */
+
+#define MULMID_TOOM42_THRESHOLD 98
+
+#define MULMOD_BNM1_THRESHOLD 23
+#define SQRMOD_BNM1_THRESHOLD 19
+
+#define MUL_FFT_MODF_THRESHOLD 500 /* k = 5 */
+#define MUL_FFT_TABLE3 \
+ { { 500, 5}, { 27, 6}, { 14, 5}, { 29, 6}, \
+ { 31, 7}, { 16, 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}, { 31, 8}, { 63, 9}, { 43,10}, \
+ { 23, 9}, { 59,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}, { 95,10}, { 199,11}, \
+ { 111,12}, { 63,11}, { 143,10}, { 287,11}, \
+ { 159,12}, { 95,11}, { 191,10}, { 399,11}, \
+ { 207,10}, { 415,13}, { 63,12}, { 127,11}, \
+ { 271,10}, { 543,11}, { 287,10}, { 575,12}, \
+ { 159,11}, { 335,10}, { 671,11}, { 367,12}, \
+ { 191,11}, { 399,10}, { 799,11}, { 431,12}, \
+ { 223,11}, { 447,13}, { 127,12}, { 255,11}, \
+ { 543,12}, { 287,11}, { 607,12}, { 319,11}, \
+ { 671,12}, { 351,11}, { 703,13}, { 191,12}, \
+ { 383,11}, { 799,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}, { 511,12}, { 1055,13}, { 575,12}, \
+ { 1215,13}, { 639,12}, { 1279,13}, { 703,14}, \
+ { 383,13}, { 767,12}, { 1535,13}, { 831,12}, \
+ { 1727,13}, { 895,12}, { 1791,13}, { 959,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}, { 1855,15}, { 511,14}, \
+ { 1023,13}, { 2111,12}, { 4223,13}, { 2175,14}, \
+ { 1151,13}, { 2431,14}, { 1279,13}, { 2687,14}, \
+ { 1407,15}, { 32768,16}, { 65536,17}, { 131072,18}, \
+ { 262144,19}, { 524288,20}, {1048576,21}, {2097152,22}, \
+ {4194304,23}, {8388608,24} }
+#define MUL_FFT_TABLE3_SIZE 150
+#define MUL_FFT_THRESHOLD 6272
+
+#define SQR_FFT_MODF_THRESHOLD 468 /* k = 5 */
+#define SQR_FFT_TABLE3 \
+ { { 468, 5}, { 29, 6}, { 15, 5}, { 31, 6}, \
+ { 35, 7}, { 18, 6}, { 37, 7}, { 37, 8}, \
+ { 19, 7}, { 40, 8}, { 29, 9}, { 15, 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}, { 143,11}, \
+ { 79,10}, { 167,11}, { 95,10}, { 191,11}, \
+ { 111,12}, { 63,11}, { 127,10}, { 255,11}, \
+ { 143,10}, { 287, 9}, { 575,10}, { 303,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,10}, { 863,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}, { 383,11}, { 799,12}, \
+ { 415,11}, { 863,12}, { 447,11}, { 895,14}, \
+ { 127,13}, { 255,12}, { 543,11}, { 1087,12}, \
+ { 607,13}, { 319,12}, { 735,13}, { 383,12}, \
+ { 863,13}, { 447,12}, { 959,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,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}, { 1663,14}, { 895,13}, \
+ { 1919,15}, { 511,14}, { 1023,13}, { 2175,14}, \
+ { 1151,13}, { 2431,14}, { 1279,13}, { 2687,14}, \
+ { 1407,15}, { 32768,16}, { 65536,17}, { 131072,18}, \
+ { 262144,19}, { 524288,20}, {1048576,21}, {2097152,22}, \
+ {4194304,23}, {8388608,24} }
+#define SQR_FFT_TABLE3_SIZE 154
+#define SQR_FFT_THRESHOLD 4032
+
+#define MULLO_BASECASE_THRESHOLD 0 /* always */
+#define MULLO_DC_THRESHOLD 62
+#define MULLO_MUL_N_THRESHOLD 11616
+
+#define DC_DIV_QR_THRESHOLD 61
+#define DC_DIVAPPR_Q_THRESHOLD 222
+#define DC_BDIV_QR_THRESHOLD 95
+#define DC_BDIV_Q_THRESHOLD 264
+
+#define INV_MULMOD_BNM1_THRESHOLD 78
+#define INV_NEWTON_THRESHOLD 133
+#define INV_APPR_THRESHOLD 141
+
+#define BINV_NEWTON_THRESHOLD 248
+#define REDC_1_TO_REDC_2_THRESHOLD 0 /* always */
+#define REDC_2_TO_REDC_N_THRESHOLD 148
+
+#define MU_DIV_QR_THRESHOLD 1187
+#define MU_DIVAPPR_Q_THRESHOLD 1142
+#define MUPI_DIV_QR_THRESHOLD 0 /* always */
+#define MU_BDIV_QR_THRESHOLD 1308
+#define MU_BDIV_Q_THRESHOLD 1470
+
+#define POWM_SEC_TABLE 1,28,251,1925
+
+#define MATRIX22_STRASSEN_THRESHOLD 23
+#define HGCD_THRESHOLD 120
+#define HGCD_APPR_THRESHOLD 77
+#define HGCD_REDUCE_THRESHOLD 3389
+#define GCD_DC_THRESHOLD 393
+#define GCDEXT_DC_THRESHOLD 440
+#define JACOBI_BASE_METHOD 4
+
+#define GET_STR_DC_THRESHOLD 14
+#define GET_STR_PRECOMPUTE_THRESHOLD 20
+#define SET_STR_DC_THRESHOLD 1216
+#define SET_STR_PRECOMPUTE_THRESHOLD 3170
+
+#define FAC_DSC_THRESHOLD 746
+#define FAC_ODD_THRESHOLD 0 /* always */
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/ia64/hamdist.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/ia64/hamdist.asm
new file mode 100644
index 00000000000..477df4cd718
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/ia64/hamdist.asm
@@ -0,0 +1,365 @@
+dnl IA-64 mpn_hamdist -- mpn hamming distance.
+
+dnl Contributed to the GNU project by Torbjorn Granlund.
+
+dnl Copyright 2003-2005 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 Itanium: 2
+C Itanium 2: 1
+
+C INPUT PARAMETERS
+define(`up', `r32')
+define(`vp', `r33')
+define(`n', `r34')
+
+define(`u0',`r16') define(`u1',`r17') define(`u2',`r18') define(`u3',`r19')
+define(`v0',`r20') define(`v1',`r21') define(`v2',`r22') define(`v3',`r23')
+define(`x0',`r24') define(`x1',`r25') define(`x2',`r26') define(`x3',`r27')
+define(`c0',`r28') define(`c1',`r29') define(`c2',`r30') define(`c3',`r31')
+define(`s',`r8')
+
+
+ASM_START()
+PROLOGUE(mpn_hamdist)
+ .prologue
+ifdef(`HAVE_ABI_32',
+` addp4 up = 0, up C M I
+ addp4 vp = 0, vp C M I
+ zxt4 n = n C I
+ ;;
+')
+
+ {.mmi; ld8 r10 = [up], 8 C load first ulimb M01
+ ld8 r11 = [vp], 8 C load first vlimb M01
+ mov.i r2 = ar.lc C save ar.lc I0
+}{.mmi; and r14 = 3, n C M I
+ cmp.lt p15, p0 = 4, n C small count? M I
+ add n = -5, n C M I
+ ;;
+}{.mmi; cmp.eq p6, p0 = 1, r14 C M I
+ cmp.eq p7, p0 = 2, r14 C M I
+ cmp.eq p8, p0 = 3, r14 C M I
+}{.bbb
+ (p6) br.dptk .Lb01 C B
+ (p7) br.dptk .Lb10 C B
+ (p8) br.dptk .Lb11 C B
+}
+
+
+.Lb00: ld8 u1 = [up], 8 C M01
+ ld8 v1 = [vp], 8 C M01
+ shr.u n = n, 2 C I0
+ xor x0 = r10, r11 C M I
+ ;;
+ ld8 u2 = [up], 8 C M01
+ ld8 v2 = [vp], 8 C M01
+ mov.i ar.lc = n C I0
+ xor x1 = u1, v1 C M I
+ ;;
+ ld8 u3 = [up], 8 C M01
+ ld8 v3 = [vp], 8 C M01
+ xor x2 = u2, v2 C M I
+ mov s = 0 C M I
+ (p15) br.cond.dptk .grt4 C B
+ ;;
+ popcnt c0 = x0 C I0
+ xor x3 = u3, v3 C M I
+ ;;
+ popcnt c1 = x1 C I0
+ ;;
+ popcnt c2 = x2 C I0
+ br .Lcj4 C B
+
+.grt4: ld8 u0 = [up], 8 C M01
+ ld8 v0 = [vp], 8 C M01
+ xor x1 = u1, v1 C M I
+ ;;
+ ld8 u1 = [up], 8 C M01
+ ld8 v1 = [vp], 8 C M01
+ xor x2 = u2, v2 C M I
+ ;;
+ ld8 u2 = [up], 8 C M01
+ ld8 v2 = [vp], 8 C M01
+ popcnt c0 = x0 C I0
+ xor x3 = u3, v3 C M I
+ ;;
+ ld8 u3 = [up], 8 C M01
+ ld8 v3 = [vp], 8 C M01
+ popcnt c1 = x1 C I0
+ xor x0 = u0, v0 C M I
+ br.cloop.dpnt .grt8 C B
+
+ popcnt c2 = x2 C I0
+ xor x1 = u1, v1 C M I
+ br .Lcj8 C B
+
+.grt8: ld8 u0 = [up], 8 C M01
+ ld8 v0 = [vp], 8 C M01
+ popcnt c2 = x2 C I0
+ xor x1 = u1, v1 C M I
+ br .LL00 C B
+
+
+.Lb01: xor x3 = r10, r11 C M I
+ shr.u n = n, 2 C I0
+ (p15) br.cond.dptk .grt1 C B
+ ;;
+ popcnt r8 = x3 C I0
+ br.ret.sptk.many b0 C B
+
+.grt1: ld8 u0 = [up], 8 C M01
+ ld8 v0 = [vp], 8 C M01
+ mov.i ar.lc = n C I0
+ ;;
+ ld8 u1 = [up], 8 C M01
+ ld8 v1 = [vp], 8 C M01
+ mov s = 0 C M I
+ ;;
+ ld8 u2 = [up], 8 C M01
+ ld8 v2 = [vp], 8 C M01
+ ;;
+ ld8 u3 = [up], 8 C M01
+ ld8 v3 = [vp], 8 C M01
+ xor x0 = u0, v0 C M I
+ br.cloop.dpnt .grt5 C B
+
+ xor x1 = u1, v1 C M I
+ ;;
+ popcnt c3 = x3 C I0
+ xor x2 = u2, v2 C M I
+ ;;
+ popcnt c0 = x0 C I0
+ xor x3 = u3, v3 C M I
+ ;;
+ popcnt c1 = x1 C I0
+ br .Lcj5 C B
+
+.grt5: ld8 u0 = [up], 8 C M01
+ ld8 v0 = [vp], 8 C M01
+ xor x1 = u1, v1 C M I
+ ;;
+ ld8 u1 = [up], 8 C M01
+ ld8 v1 = [vp], 8 C M01
+ popcnt c3 = x3 C I0
+ xor x2 = u2, v2 C M I
+ ;;
+ ld8 u2 = [up], 8 C M01
+ ld8 v2 = [vp], 8 C M01
+ popcnt c0 = x0 C I0
+ xor x3 = u3, v3 C M I
+ ;;
+ ld8 u3 = [up], 8 C M01
+ ld8 v3 = [vp], 8 C M01
+ popcnt c1 = x1 C I0
+ xor x0 = u0, v0 C M I
+ br.cloop.dpnt .Loop C B
+ br .Lend C B
+
+
+.Lb10: ld8 u3 = [up], 8 C M01
+ ld8 v3 = [vp], 8 C M01
+ xor x2 = r10, r11 C M I
+ (p15) br.cond.dptk .grt2 C B
+ ;;
+ xor x3 = u3, v3 C M I
+ ;;
+ popcnt c2 = x2 C I0
+ ;;
+ popcnt c3 = x3 C I0
+ ;;
+ add s = c2, c3 C M I
+ br.ret.sptk.many b0 C B
+
+.grt2: ld8 u0 = [up], 8 C M01
+ ld8 v0 = [vp], 8 C M01
+ shr.u n = n, 2 C I0
+ ;;
+ ld8 u1 = [up], 8 C M01
+ ld8 v1 = [vp], 8 C M01
+ mov.i ar.lc = n C I0
+ mov s = 0 C M I
+ ;;
+ ld8 u2 = [up], 8 C M01
+ ld8 v2 = [vp], 8 C M01
+ xor x3 = u3, v3 C M I
+ ;;
+ ld8 u3 = [up], 8 C M01
+ ld8 v3 = [vp], 8 C M01
+ xor x0 = u0, v0 C M I
+ br.cloop.dptk .grt6 C B
+
+ popcnt c2 = x2 C I0
+ xor x1 = u1, v1 C M I
+ ;;
+ popcnt c3 = x3 C I0
+ xor x2 = u2, v2 C M I
+ ;;
+ popcnt c0 = x0 C I0
+ xor x3 = u3, v3 C M I
+ br .Lcj6 C B
+
+.grt6: ld8 u0 = [up], 8 C M01
+ ld8 v0 = [vp], 8 C M01
+ popcnt c2 = x2 C I0
+ xor x1 = u1, v1 C M I
+ ;;
+ ld8 u1 = [up], 8 C M01
+ ld8 v1 = [vp], 8 C M01
+ popcnt c3 = x3 C I0
+ xor x2 = u2, v2 C M I
+ ;;
+ ld8 u2 = [up], 8 C M01
+ ld8 v2 = [vp], 8 C M01
+ popcnt c0 = x0 C I0
+ xor x3 = u3, v3 C M I
+ br .LL10 C B
+
+
+.Lb11: ld8 u2 = [up], 8 C M01
+ ld8 v2 = [vp], 8 C M01
+ shr.u n = n, 2 C I0
+ xor x1 = r10, r11 C M I
+ ;;
+ ld8 u3 = [up], 8 C M01
+ ld8 v3 = [vp], 8 C M01
+ xor x2 = u2, v2 C M I
+ (p15) br.cond.dptk .grt3 C B
+ ;;
+ xor x3 = u3, v3 C M I
+ ;;
+ popcnt c1 = x1 C I0
+ ;;
+ popcnt c2 = x2 C I0
+ ;;
+ popcnt c3 = x3 C I0
+ ;;
+ add s = c1, c2 C M I
+ ;;
+ add s = s, c3 C M I
+ br.ret.sptk.many b0 C B
+
+.grt3: ld8 u0 = [up], 8 C M01
+ ld8 v0 = [vp], 8 C M01
+ mov.i ar.lc = n C I0
+ ;;
+ ld8 u1 = [up], 8 C M01
+ ld8 v1 = [vp], 8 C M01
+ mov s = 0 C M I
+ ;;
+ ld8 u2 = [up], 8 C M01
+ ld8 v2 = [vp], 8 C M01
+ xor x3 = u3, v3 C M I
+ ;;
+ ld8 u3 = [up], 8 C M01
+ ld8 v3 = [vp], 8 C M01
+ popcnt c1 = x1 C I0
+ xor x0 = u0, v0 C M I
+ br.cloop.dptk .grt7 C B
+ popcnt c2 = x2 C I0
+ xor x1 = u1, v1 C M I
+ ;;
+ popcnt c3 = x3 C I0
+ xor x2 = u2, v2 C M I
+ br .Lcj7 C B
+
+.grt7: ld8 u0 = [up], 8 C M01
+ ld8 v0 = [vp], 8 C M01
+ popcnt c2 = x2 C I0
+ xor x1 = u1, v1 C M I
+ ;;
+ ld8 u1 = [up], 8 C M01
+ ld8 v1 = [vp], 8 C M01
+ popcnt c3 = x3 C I0
+ xor x2 = u2, v2 C M I
+ br .LL11 C B
+
+
+ ALIGN(32)
+.Loop: ld8 u0 = [up], 8 C M01
+ ld8 v0 = [vp], 8 C M01
+ popcnt c2 = x2 C I0
+ add s = s, c3 C M I
+ xor x1 = u1, v1 C M I
+ nop.b 1 C -
+ ;;
+.LL00: ld8 u1 = [up], 8 C M01
+ ld8 v1 = [vp], 8 C M01
+ popcnt c3 = x3 C I0
+ add s = s, c0 C M I
+ xor x2 = u2, v2 C M I
+ nop.b 1 C -
+ ;;
+.LL11: ld8 u2 = [up], 8 C M01
+ ld8 v2 = [vp], 8 C M01
+ popcnt c0 = x0 C I0
+ add s = s, c1 C M I
+ xor x3 = u3, v3 C M I
+ nop.b 1 C -
+ ;;
+.LL10: ld8 u3 = [up], 8 C M01
+ ld8 v3 = [vp], 8 C M01
+ popcnt c1 = x1 C I0
+ add s = s, c2 C M I
+ xor x0 = u0, v0 C M I
+ br.cloop.dptk .Loop C B
+ ;;
+
+.Lend: popcnt c2 = x2 C I0
+ add s = s, c3 C M I
+ xor x1 = u1, v1 C M I
+ ;;
+.Lcj8: popcnt c3 = x3 C I0
+ add s = s, c0 C M I
+ xor x2 = u2, v2 C M I
+ ;;
+.Lcj7: popcnt c0 = x0 C I0
+ add s = s, c1 C M I
+ xor x3 = u3, v3 C M I
+ ;;
+.Lcj6: popcnt c1 = x1 C I0
+ add s = s, c2 C M I
+ ;;
+.Lcj5: popcnt c2 = x2 C I0
+ add s = s, c3 C M I
+ ;;
+.Lcj4: popcnt c3 = x3 C I0
+ add s = s, c0 C M I
+ ;;
+ add s = s, c1 C M I
+ ;;
+ add s = s, c2 C M I
+ ;;
+ add s = s, c3 C M I
+ mov.i ar.lc = r2 C I0
+ br.ret.sptk.many b0 C B
+EPILOGUE()
+ASM_END()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/ia64/ia64-defs.m4 b/Build/source/libs/gmp/gmp-6.0.0/mpn/ia64/ia64-defs.m4
new file mode 100644
index 00000000000..f71d280b179
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/ia64/ia64-defs.m4
@@ -0,0 +1,147 @@
+divert(-1)
+
+
+dnl Copyright 2000, 2002, 2003 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 ia64 assembler comments are C++ style "//" to the end of line. gas
+dnl also accepts "#" as a comment, if it's the first non-blank on a line.
+dnl
+dnl BSD m4 can't handle a multi-character comment like "//" (see notes in
+dnl mpn/asm-defs.m4). For now the default "#" is left, but with care taken
+dnl not to put any macros after "foo#" (since of course they won't expand).
+
+
+define(`ASM_START',
+m4_assert_numargs(0)
+`')
+
+
+dnl Called: PROLOGUE_cpu(GSYM_PREFIX`'foo)
+dnl EPILOGUE_cpu(GSYM_PREFIX`'foo)
+dnl
+dnl 32-byte alignment is used for the benefit of itanium-2, where the code
+dnl fetcher will only take 2 bundles from a 32-byte aligned target. At
+dnl 16mod32 it only reads 1 in the first cycle. This might not make any
+dnl difference if the rotate buffers are full or there's other work holding
+dnl up execution, but we use 32-bytes to give the best chance of peak
+dnl throughput.
+dnl
+dnl We can use .align here despite the gas bug noted in mpn/ia64/README,
+dnl since we're not expecting to execute across a PROLOGUE(), at least not
+dnl currently.
+
+define(`PROLOGUE_cpu',
+m4_assert_numargs(1)
+ `
+ .text
+ .align 32
+ .global $1#
+ .proc $1#
+$1:')
+
+define(`EPILOGUE_cpu',
+m4_assert_numargs(1)
+ `
+ .endp $1#
+')
+
+define(`DATASTART',
+ `dnl
+ DATA
+$1:')
+define(`DATAEND',`dnl')
+
+define(`ASM_END',`dnl')
+
+
+dnl Usage: ALIGN(bytes)
+dnl
+dnl Emit a ".align" directive. "bytes" is eval()ed, so can be an
+dnl expression.
+dnl
+dnl This version overrides the definition in mpn/asm-defs.m4. We suppress
+dnl any .align if the gas byte-swapped-nops bug was detected by configure
+dnl GMP_ASM_IA64_ALIGN_OK.
+
+define(`ALIGN',
+m4_assert_numargs(1)
+m4_assert_defined(`IA64_ALIGN_OK')
+`ifelse(IA64_ALIGN_OK,no,,
+`.align eval($1)')')
+
+
+dnl Usage: ASSERT([pr] [,code])
+dnl
+dnl Require that the given predicate register is true after executing the
+dnl test code. For example,
+dnl
+dnl ASSERT(p6,
+dnl ` cmp.eq p6,p0 = r3, r4')
+dnl
+dnl If the predicate register argument is empty then nothing is tested, the
+dnl code is just executed. This can be used for setups required by later
+dnl ASSERTs. The code argument can be omitted to just test a predicate
+dnl with no special setup code.
+dnl
+dnl For convenience, stops are inserted before and after the code emitted.
+
+define(ASSERT,
+m4_assert_numargs_range(1,2)
+m4_assert_defined(`WANT_ASSERT')
+`ifelse(WANT_ASSERT,1,
+` ;;
+ifelse(`$2',,,
+`$2
+ ;;
+')
+ifelse(`$1',,,
+`($1) br .LASSERTok`'ASSERT_label_counter ;;
+ cmp.ne p6,p6 = r0, r0 C illegal instruction
+ ;;
+.LASSERTok`'ASSERT_label_counter:
+define(`ASSERT_label_counter',eval(ASSERT_label_counter+1))
+')
+')')
+define(`ASSERT_label_counter',1)
+
+define(`getfsig', `getf.sig')
+define(`setfsig', `setf.sig')
+define(`cmpeq', `cmp.eq')
+define(`cmpne', `cmp.ne')
+define(`cmpltu', `cmp.ltu')
+define(`cmpleu', `cmp.leu')
+define(`cmpgtu', `cmp.gtu')
+define(`cmpgeu', `cmp.geu')
+define(`cmple', `cmp.le')
+define(`cmpgt', `cmp.gt')
+define(`cmpeqor', `cmp.eq.or')
+define(`cmpequc', `cmp.eq.unc')
+
+divert
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/ia64/invert_limb.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/ia64/invert_limb.asm
new file mode 100644
index 00000000000..5effdda815c
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/ia64/invert_limb.asm
@@ -0,0 +1,105 @@
+dnl IA-64 mpn_invert_limb -- Invert a normalized limb.
+
+dnl Contributed to the GNU project by Torbjorn Granlund and Kevin Ryde.
+
+dnl Copyright 2000, 2002, 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 INPUT PARAMETERS
+C d = r32
+
+C cycles
+C Itanium: 74
+C Itanium 2: 50+6
+
+C It should be possible to avoid the xmpy.hu and the following tests by
+C explicitly chopping in the last fma. That would save about 10 cycles.
+
+ASM_START()
+ .sdata
+ .align 16
+ifdef(`HAVE_DOUBLE_IEEE_LITTLE_ENDIAN',`
+.LC0: data4 0x00000000, 0x80000000, 0x0000403f, 0x00000000 C 2^64
+.LC1: data4 0x00000000, 0x80000000, 0x0000407f, 0x00000000 C 2^128
+
+',`ifdef(`HAVE_DOUBLE_IEEE_BIG_ENDIAN',`
+.LC0: data4 0x403f8000, 0x00000000, 0x00000000, 0x00000000 C 2^64
+.LC1: data4 0x407f8000, 0x00000000, 0x00000000, 0x00000000 C 2^128
+
+',`m4_error(`Oops, need to know float endianness
+')')')
+
+
+PROLOGUE(mpn_invert_limb)
+ C 00
+ addl r14 = @gprel(.LC0), gp
+ addl r15 = @gprel(.LC1), gp
+ setf.sig f7 = r32
+ add r9 = r32, r32 C check for d = 2^63
+ ;; C 01
+ ldfe f10 = [r14] C 2^64
+ ldfe f8 = [r15] C 2^128
+ cmp.eq p6, p0 = 0, r9 C check for d = 2^63
+ mov r8 = -1 C retval for 2^63
+ (p6) br.ret.spnt.many b0
+ ;; C 07
+ fmpy.s1 f11 = f7, f10 C f11 = d * 2^64
+ fnma.s1 f6 = f7, f10, f8 C f6 = 2^128 - d * 2^64
+ ;; C 11
+ frcpa.s1 f8, p6 = f6, f7
+ ;; C 15
+ (p6) fnma.s1 f9 = f7, f8, f1
+ (p6) fmpy.s1 f10 = f6, f8
+ ;; C 19
+ (p6) fmpy.s1 f11 = f9, f9
+ (p6) fma.s1 f10 = f9, f10, f10
+ ;; C 23
+ (p6) fma.s1 f8 = f9, f8, f8
+ (p6) fma.s1 f9 = f11, f10, f10
+ ;; C 27
+ (p6) fma.s1 f8 = f11, f8, f8
+ (p6) fnma.s1 f10 = f7, f9, f6
+ ;; C 31
+ (p6) fma.s1 f8 = f10, f8, f9
+ ;; C 35
+ fcvt.fxu.trunc.s1 f8 = f8
+ ;; C 39
+ getf.sig r8 = f8
+ xmpy.hu f10 = f8, f7 C di * d
+ ;; C 43
+ getf.sig r14 = f10
+ andcm r9 = -1, r32 C one's complement
+ ;; C 48
+ cmp.ltu p6, p0 = r9, r14 C got overflow?
+ ;; C 49
+ (p6) add r8 = -1, r8 C adjust di down
+ br.ret.sptk.many b0
+EPILOGUE()
+ASM_END()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/ia64/logops_n.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/ia64/logops_n.asm
new file mode 100644
index 00000000000..e4a2f61cce5
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/ia64/logops_n.asm
@@ -0,0 +1,292 @@
+dnl IA-64 mpn_and_n, mpn_andn_n, mpn_nand_n, mpn_ior_n, mpn_iorn_n,
+dnl mpn_nior_n, mpn_xor_n, mpn_xnor_n -- mpn bitwise logical operations.
+
+dnl Contributed to the GNU project by Torbjorn Granlund.
+
+dnl Copyright 2003-2005 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 Itanium: 2
+C Itanium 2: 1
+
+C TODO
+C * Use rp,rpx scheme of aors_n.asm to allow parallel stores (useful in
+C wind-down code).
+
+C INPUT PARAMETERS
+define(`rp', `r32')
+define(`up', `r33')
+define(`vp', `r34')
+define(`n', `r35')
+
+ifdef(`OPERATION_and_n',
+` define(`func',`mpn_and_n')
+ define(`logop', `and $1 = $2, $3')
+ define(`notormov', `mov $1 = $2')')
+ifdef(`OPERATION_andn_n',
+` define(`func',`mpn_andn_n')
+ define(`logop', `andcm $1 = $2, $3')
+ define(`notormov', `mov $1 = $2')')
+ifdef(`OPERATION_nand_n',
+` define(`func',`mpn_nand_n')
+ define(`logop', `and $1 = $2, $3')
+ define(`notormov', `sub $1 = -1, $2')')
+ifdef(`OPERATION_ior_n',
+` define(`func',`mpn_ior_n')
+ define(`logop', `or $1 = $2, $3')
+ define(`notormov', `mov $1 = $2')')
+ifdef(`OPERATION_iorn_n',
+` define(`func',`mpn_iorn_n')
+ define(`logop', `andcm $1 = $3, $2')
+ define(`notormov', `sub $1 = -1, $2')')
+ifdef(`OPERATION_nior_n',
+` define(`func',`mpn_nior_n')
+ define(`logop', `or $1 = $2, $3')
+ define(`notormov', `sub $1 = -1, $2')')
+ifdef(`OPERATION_xor_n',
+` define(`func',`mpn_xor_n')
+ define(`logop', `xor $1 = $2, $3')
+ define(`notormov', `mov $1 = $2')')
+ifdef(`OPERATION_xnor_n',
+` define(`func',`mpn_xnor_n')
+ define(`logop', `xor $1 = $2, $3')
+ define(`notormov', `sub $1 = -1, $2')')
+
+MULFUNC_PROLOGUE(mpn_and_n mpn_andn_n mpn_nand_n mpn_ior_n mpn_iorn_n mpn_nior_n mpn_xor_n mpn_xnor_n)
+
+ASM_START()
+PROLOGUE(func)
+ .prologue
+ .save ar.lc, r2
+ .body
+ifdef(`HAVE_ABI_32',
+` addp4 rp = 0, rp C M I
+ addp4 up = 0, up C M I
+ addp4 vp = 0, vp C M I
+ nop.m 0
+ nop.m 0
+ zxt4 n = n C I
+ ;;
+')
+{.mmi
+ ld8 r10 = [up], 8 C M
+ ld8 r11 = [vp], 8 C M
+ mov.i r2 = ar.lc C I0
+}
+{.mmi
+ and r14 = 3, n C M I
+ cmp.lt p15, p14 = 4, n C M I
+ shr.u n = n, 2 C I0
+ ;;
+}
+{.mmi
+ cmp.eq p6, p0 = 1, r14 C M I
+ cmp.eq p7, p0 = 2, r14 C M I
+ cmp.eq p8, p0 = 3, r14 C M I
+}
+{.bbb
+ (p6) br.dptk .Lb01 C B
+ (p7) br.dptk .Lb10 C B
+ (p8) br.dptk .Lb11 C B
+}
+
+.Lb00: ld8 r17 = [up], 8 C M
+ ld8 r21 = [vp], 8 C M
+ add n = -2, n C M I
+ ;;
+ ld8 r18 = [up], 8 C M
+ ld8 r22 = [vp], 8 C M
+ ;;
+ ld8 r19 = [up], 8 C M
+ ld8 r23 = [vp], 8 C M
+ (p15) br.cond.dpnt .grt4 C B
+
+ logop( r14, r10, r11) C M I
+ ;;
+ logop( r15, r17, r21) C M I
+ notormov( r8, r14) C M I
+ br .Lcj4 C B
+
+.grt4: logop( r14, r10, r11) C M I
+ ld8 r16 = [up], 8 C M
+ ld8 r20 = [vp], 8 C M
+ ;;
+ logop( r15, r17, r21) C M I
+ ld8 r17 = [up], 8 C M
+ mov.i ar.lc = n C I0
+ notormov( r8, r14) C M I
+ ld8 r21 = [vp], 8 C M
+ br .LL00 C B
+
+.Lb01: add n = -1, n C M I
+ logop( r15, r10, r11) C M I
+ (p15) br.cond.dpnt .grt1 C B
+ ;;
+
+ notormov( r9, r15) C M I
+ br .Lcj1 C B
+
+.grt1: ld8 r16 = [up], 8 C M
+ ld8 r20 = [vp], 8 C M
+ ;;
+ ld8 r17 = [up], 8 C M
+ ld8 r21 = [vp], 8 C M
+ mov.i ar.lc = n C I0
+ ;;
+ ld8 r18 = [up], 8 C M
+ ld8 r22 = [vp], 8 C M
+ ;;
+ ld8 r19 = [up], 8 C M
+ ld8 r23 = [vp], 8 C M
+ br.cloop.dptk .grt5 C B
+ ;;
+
+ logop( r14, r16, r20) C M I
+ notormov( r9, r15) C M I
+ br .Lcj5 C B
+
+.grt5: logop( r14, r16, r20) C M I
+ ld8 r16 = [up], 8 C M
+ notormov( r9, r15) C M I
+ ld8 r20 = [vp], 8 C M
+ br .LL01 C B
+
+.Lb10: ld8 r19 = [up], 8 C M
+ ld8 r23 = [vp], 8 C M
+ (p15) br.cond.dpnt .grt2 C B
+
+ logop( r14, r10, r11) C M I
+ ;;
+ logop( r15, r19, r23) C M I
+ notormov( r8, r14) C M I
+ br .Lcj2 C B
+
+.grt2: ld8 r16 = [up], 8 C M
+ ld8 r20 = [vp], 8 C M
+ add n = -1, n C M I
+ ;;
+ ld8 r17 = [up], 8 C M
+ ld8 r21 = [vp], 8 C M
+ logop( r14, r10, r11) C M I
+ ;;
+ ld8 r18 = [up], 8 C M
+ ld8 r22 = [vp], 8 C M
+ mov.i ar.lc = n C I0
+ ;;
+ logop( r15, r19, r23) C M I
+ ld8 r19 = [up], 8 C M
+ notormov( r8, r14) C M I
+ ld8 r23 = [vp], 8 C M
+ br.cloop.dptk .Loop C B
+ br .Lcj6 C B
+
+.Lb11: ld8 r18 = [up], 8 C M
+ ld8 r22 = [vp], 8 C M
+ add n = -1, n C M I
+ ;;
+ ld8 r19 = [up], 8 C M
+ ld8 r23 = [vp], 8 C M
+ logop( r15, r10, r11) C M I
+ (p15) br.cond.dpnt .grt3 C B
+ ;;
+
+ logop( r14, r18, r22) C M I
+ notormov( r9, r15) C M I
+ br .Lcj3 C B
+
+.grt3: ld8 r16 = [up], 8 C M
+ ld8 r20 = [vp], 8 C M
+ ;;
+ ld8 r17 = [up], 8 C M
+ ld8 r21 = [vp], 8 C M
+ mov.i ar.lc = n C I0
+ ;;
+ logop( r14, r18, r22) C M I
+ ld8 r18 = [up], 8 C M
+ notormov( r9, r15) C M I
+ ld8 r22 = [vp], 8 C M
+ br .LL11 C B
+
+C *** MAIN LOOP START ***
+ ALIGN(32)
+.Loop: st8 [rp] = r8, 8 C M
+ logop( r14, r16, r20) C M I
+ notormov( r9, r15) C M I
+ ld8 r16 = [up], 8 C M
+ ld8 r20 = [vp], 8 C M
+ nop.b 0
+ ;;
+.LL01: st8 [rp] = r9, 8 C M
+ logop( r15, r17, r21) C M I
+ notormov( r8, r14) C M I
+ ld8 r17 = [up], 8 C M
+ ld8 r21 = [vp], 8 C M
+ nop.b 0
+ ;;
+.LL00: st8 [rp] = r8, 8 C M
+ logop( r14, r18, r22) C M I
+ notormov( r9, r15) C M I
+ ld8 r18 = [up], 8 C M
+ ld8 r22 = [vp], 8 C M
+ nop.b 0
+ ;;
+.LL11: st8 [rp] = r9, 8 C M
+ logop( r15, r19, r23) C M I
+ notormov( r8, r14) C M I
+ ld8 r19 = [up], 8 C M
+ ld8 r23 = [vp], 8 C M
+ br.cloop.dptk .Loop ;; C B
+C *** MAIN LOOP END ***
+
+.Lcj6: st8 [rp] = r8, 8 C M
+ logop( r14, r16, r20) C M I
+ notormov( r9, r15) C M I
+ ;;
+.Lcj5: st8 [rp] = r9, 8 C M
+ logop( r15, r17, r21) C M I
+ notormov( r8, r14) C M I
+ ;;
+.Lcj4: st8 [rp] = r8, 8 C M
+ logop( r14, r18, r22) C M I
+ notormov( r9, r15) C M I
+ ;;
+.Lcj3: st8 [rp] = r9, 8 C M
+ logop( r15, r19, r23) C M I
+ notormov( r8, r14) C M I
+ ;;
+.Lcj2: st8 [rp] = r8, 8 C M
+ notormov( r9, r15) C M I
+ ;;
+.Lcj1: st8 [rp] = r9, 8 C M
+ mov.i ar.lc = r2 C I0
+ br.ret.sptk.many b0 C B
+EPILOGUE()
+ASM_END()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/ia64/lorrshift.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/ia64/lorrshift.asm
new file mode 100644
index 00000000000..694aaf0f400
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/ia64/lorrshift.asm
@@ -0,0 +1,358 @@
+dnl IA-64 mpn_lshift/mpn_rshift.
+
+dnl Contributed to the GNU project by Torbjorn Granlund.
+
+dnl Copyright 2000-2005 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 Itanium: 2
+C Itanium 2: 1
+
+C This code is scheduled deeply since the plain shift instructions shr and shl
+C have a latency of 4 (on Itanium) or 3 (on Itanium 2). Poor scheduling of
+C these instructions cause a 10 cycle replay trap on Itanium.
+
+C The ld8 scheduling should probably be decreased to make the function smaller.
+C Good lfetch will make sure we never stall anyway.
+
+C We should actually issue the first ld8 at cycle 0, and the first BSH/FSH pair
+C at cycle 2. Judicious use of predicates could allow us to issue more ld8's
+C in the prologue.
+
+
+C INPUT PARAMETERS
+define(`rp', `r32')
+define(`up', `r33')
+define(`n', `r34')
+define(`cnt',`r35')
+
+define(`tnc',`r9')
+
+ifdef(`OPERATION_lshift',`
+ define(`FSH',`shl')
+ define(`BSH',`shr.u')
+ define(`UPD',`-8')
+ define(`POFF',`-512')
+ define(`PUPD',`-32')
+ define(`func',`mpn_lshift')
+')
+ifdef(`OPERATION_rshift',`
+ define(`FSH',`shr.u')
+ define(`BSH',`shl')
+ define(`UPD',`8')
+ define(`POFF',`512')
+ define(`PUPD',`32')
+ define(`func',`mpn_rshift')
+')
+
+MULFUNC_PROLOGUE(mpn_lshift mpn_rshift)
+
+ASM_START()
+PROLOGUE(func)
+ .prologue
+ .save ar.lc, r2
+ .body
+ifdef(`HAVE_ABI_32',
+` addp4 rp = 0, rp C M I
+ addp4 up = 0, up C M I
+ sxt4 n = n C M I
+ nop.m 0
+ nop.m 0
+ zxt4 cnt = cnt C I
+ ;;
+')
+
+ {.mmi; cmp.lt p14, p15 = 4, n C M I
+ and r14 = 3, n C M I
+ mov.i r2 = ar.lc C I0
+}{.mmi; add r15 = -1, n C M I
+ sub tnc = 64, cnt C M I
+ add r16 = -5, n
+ ;;
+}{.mmi; cmp.eq p6, p0 = 1, r14 C M I
+ cmp.eq p7, p0 = 2, r14 C M I
+ shr.u n = r16, 2 C I0
+}{.mmi; cmp.eq p8, p0 = 3, r14 C M I
+ifdef(`OPERATION_lshift',
+` shladd up = r15, 3, up C M I
+ shladd rp = r15, 3, rp') C M I
+ ;;
+}{.mmi; add r11 = POFF, up C M I
+ ld8 r10 = [up], UPD C M01
+ mov.i ar.lc = n C I0
+}{.bbb;
+ (p6) br.dptk .Lb01
+ (p7) br.dptk .Lb10
+ (p8) br.dptk .Lb11
+ ;; }
+
+.Lb00: ld8 r19 = [up], UPD
+ ;;
+ ld8 r16 = [up], UPD
+ ;;
+ ld8 r17 = [up], UPD
+ BSH r8 = r10, tnc C function return value
+ ;;
+ FSH r24 = r10, cnt
+ BSH r25 = r19, tnc
+ (p14) br.cond.dptk .grt4
+ ;;
+ FSH r26 = r19, cnt
+ BSH r27 = r16, tnc
+ ;;
+ FSH r20 = r16, cnt
+ BSH r21 = r17, tnc
+ ;;
+ or r14 = r25, r24
+ FSH r22 = r17, cnt
+ BSH r23 = r10, tnc
+ br .Lr4
+
+.grt4: ld8 r18 = [up], UPD
+ FSH r26 = r19, cnt
+ BSH r27 = r16, tnc
+ ;;
+ ld8 r19 = [up], UPD
+ FSH r20 = r16, cnt
+ BSH r21 = r17, tnc
+ ;;
+ ld8 r16 = [up], UPD
+ FSH r22 = r17, cnt
+ BSH r23 = r18, tnc
+ ;;
+ or r14 = r25, r24
+ ld8 r17 = [up], UPD
+ br.cloop.dpnt .Ltop
+ br .Lbot
+
+.Lb01:
+ (p15) BSH r8 = r10, tnc C function return value I
+ (p15) FSH r22 = r10, cnt C I
+ (p15) br.cond.dptk .Lr1 C return B
+
+.grt1: ld8 r18 = [up], UPD
+ ;;
+ ld8 r19 = [up], UPD
+ BSH r8 = r10, tnc C function return value
+ ;;
+ ld8 r16 = [up], UPD
+ FSH r22 = r10, cnt
+ BSH r23 = r18, tnc
+ ;;
+ ld8 r17 = [up], UPD
+ FSH r24 = r18, cnt
+ BSH r25 = r19, tnc
+ br.cloop.dpnt .grt5
+ ;;
+ or r15 = r23, r22
+ FSH r26 = r19, cnt
+ BSH r27 = r16, tnc
+ ;;
+ FSH r20 = r16, cnt
+ BSH r21 = r17, tnc
+ br .Lr5
+
+.grt5: ld8 r18 = [up], UPD
+ FSH r26 = r19, cnt
+ BSH r27 = r16, tnc
+ ;;
+ ld8 r19 = [up], UPD
+ FSH r20 = r16, cnt
+ BSH r21 = r17, tnc
+ ;;
+ or r15 = r23, r22
+ ld8 r16 = [up], UPD
+ br .LL01
+
+
+.Lb10: ld8 r17 = [up], UPD
+ (p14) br.cond.dptk .grt2
+
+ BSH r8 = r10, tnc C function return value
+ ;;
+ FSH r20 = r10, cnt
+ BSH r21 = r17, tnc
+ ;;
+ or r14 = r21, r20
+ FSH r22 = r17, cnt
+ br .Lr2 C return
+
+.grt2: ld8 r18 = [up], UPD
+ BSH r8 = r10, tnc C function return value
+ ;;
+ ld8 r19 = [up], UPD
+ FSH r20 = r10, cnt
+ BSH r21 = r17, tnc
+ ;;
+ ld8 r16 = [up], UPD
+ FSH r22 = r17, cnt
+ BSH r23 = r18, tnc
+ ;;
+ {.mmi; ld8 r17 = [up], UPD
+ or r14 = r21, r20
+ FSH r24 = r18, cnt
+}{.mib; nop 0
+ BSH r25 = r19, tnc
+ br.cloop.dpnt .grt6
+ ;; }
+
+ FSH r26 = r19, cnt
+ BSH r27 = r16, tnc
+ br .Lr6
+
+.grt6: ld8 r18 = [up], UPD
+ FSH r26 = r19, cnt
+ BSH r27 = r16, tnc
+ ;;
+ ld8 r19 = [up], UPD
+ br .LL10
+
+
+.Lb11: ld8 r16 = [up], UPD
+ ;;
+ ld8 r17 = [up], UPD
+ BSH r8 = r10, tnc C function return value
+ (p14) br.cond.dptk .grt3
+ ;;
+
+ FSH r26 = r10, cnt
+ BSH r27 = r16, tnc
+ ;;
+ FSH r20 = r16, cnt
+ BSH r21 = r17, tnc
+ ;;
+ or r15 = r27, r26
+ FSH r22 = r17, cnt
+ br .Lr3 C return
+
+.grt3: ld8 r18 = [up], UPD
+ FSH r26 = r10, cnt
+ BSH r27 = r16, tnc
+ ;;
+ ld8 r19 = [up], UPD
+ FSH r20 = r16, cnt
+ BSH r21 = r17, tnc
+ ;;
+ ld8 r16 = [up], UPD
+ FSH r22 = r17, cnt
+ BSH r23 = r18, tnc
+ ;;
+ ld8 r17 = [up], UPD
+ br.cloop.dpnt .grt7
+
+ or r15 = r27, r26
+ FSH r24 = r18, cnt
+ BSH r25 = r19, tnc
+ br .Lr7
+
+.grt7: or r15 = r27, r26
+ FSH r24 = r18, cnt
+ BSH r25 = r19, tnc
+ ld8 r18 = [up], UPD
+ br .LL11
+
+C *** MAIN LOOP START ***
+ ALIGN(32)
+.Ltop:
+ {.mmi; st8 [rp] = r14, UPD C M2
+ or r15 = r27, r26 C M3
+ FSH r24 = r18, cnt C I0
+}{.mmi; ld8 r18 = [up], UPD C M1
+ lfetch [r11], PUPD
+ BSH r25 = r19, tnc C I1
+ ;; }
+.LL11:
+ {.mmi; st8 [rp] = r15, UPD
+ or r14 = r21, r20
+ FSH r26 = r19, cnt
+}{.mmi; ld8 r19 = [up], UPD
+ nop.m 0
+ BSH r27 = r16, tnc
+ ;; }
+.LL10:
+ {.mmi; st8 [rp] = r14, UPD
+ or r15 = r23, r22
+ FSH r20 = r16, cnt
+}{.mmi; ld8 r16 = [up], UPD
+ nop.m 0
+ BSH r21 = r17, tnc
+ ;; }
+.LL01:
+ {.mmi; st8 [rp] = r15, UPD
+ or r14 = r25, r24
+ FSH r22 = r17, cnt
+}{.mib; ld8 r17 = [up], UPD
+ BSH r23 = r18, tnc
+ br.cloop.dptk .Ltop
+ ;; }
+C *** MAIN LOOP END ***
+
+.Lbot:
+ {.mmi; st8 [rp] = r14, UPD
+ or r15 = r27, r26
+ FSH r24 = r18, cnt
+}{.mib; nop 0
+ BSH r25 = r19, tnc
+ nop 0
+ ;; }
+.Lr7:
+ {.mmi; st8 [rp] = r15, UPD
+ or r14 = r21, r20
+ FSH r26 = r19, cnt
+}{.mib; nop 0
+ BSH r27 = r16, tnc
+ nop 0
+ ;; }
+.Lr6:
+ {.mmi; st8 [rp] = r14, UPD
+ or r15 = r23, r22
+ FSH r20 = r16, cnt
+}{.mib; nop 0
+ BSH r21 = r17, tnc
+ nop 0
+ ;; }
+.Lr5: st8 [rp] = r15, UPD
+ or r14 = r25, r24
+ FSH r22 = r17, cnt
+ ;;
+.Lr4: st8 [rp] = r14, UPD
+ or r15 = r27, r26
+ ;;
+.Lr3: st8 [rp] = r15, UPD
+ or r14 = r21, r20
+ ;;
+.Lr2: st8 [rp] = r14, UPD
+ ;;
+.Lr1: st8 [rp] = r22, UPD C M23
+ mov ar.lc = r2 C I0
+ br.ret.sptk.many b0 C B
+EPILOGUE(func)
+ASM_END()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/ia64/lshiftc.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/ia64/lshiftc.asm
new file mode 100644
index 00000000000..c4024864846
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/ia64/lshiftc.asm
@@ -0,0 +1,463 @@
+dnl IA-64 mpn_lshiftc.
+
+dnl Contributed to the GNU project by Torbjorn Granlund.
+
+dnl Copyright 2000-2005, 2010 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 Itanium: ?
+C Itanium 2: 1.25
+
+C This code is scheduled deeply since the plain shift instructions shr and shl
+C have a latency of 4 (on Itanium) or 3 (on Itanium 2). Poor scheduling of
+C these instructions cause a 10 cycle replay trap on Itanium.
+
+C The ld8 scheduling should probably be decreased to make the function smaller.
+C Good lfetch will make sure we never stall anyway.
+
+C We should actually issue the first ld8 at cycle 0, and the first BSH/FSH pair
+C at cycle 2. Judicious use of predicates could allow us to issue more ld8's
+C in the prologue.
+
+
+C INPUT PARAMETERS
+define(`rp', `r32')
+define(`up', `r33')
+define(`n', `r34')
+define(`cnt',`r35')
+
+define(`tnc',`r9')
+
+define(`FSH',`shl')
+define(`BSH',`shr.u')
+define(`UPD',`-8')
+define(`POFF',`-512')
+define(`PUPD',`-32')
+define(`func',`mpn_lshiftc')
+
+ASM_START()
+PROLOGUE(mpn_lshiftc)
+ .prologue
+ .save ar.lc, r2
+ .body
+ifdef(`HAVE_ABI_32',
+` addp4 rp = 0, rp C M I
+ addp4 up = 0, up C M I
+ sxt4 n = n C M I
+ nop.m 0
+ nop.m 0
+ zxt4 cnt = cnt C I
+ ;;
+')
+
+ {.mmi; nop 0 C M I
+ and r14 = 3, n C M I
+ mov.i r2 = ar.lc C I0
+}{.mmi; add r15 = -1, n C M I
+ sub tnc = 64, cnt C M I
+ nop 0
+ ;;
+}{.mmi; cmp.eq p6, p0 = 1, r14 C M I
+ cmp.eq p7, p0 = 2, r14 C M I
+ shr.u n = r15, 2 C I0
+}{.mmi; cmp.eq p8, p0 = 3, r14 C M I
+ shladd up = r15, 3, up C M I
+ shladd rp = r15, 3, rp C M I
+ ;;
+}{.mmi; add r11 = POFF, up C M I
+ ld8 r10 = [up], UPD C M01
+ mov.i ar.lc = n C I0
+}{.bbb;
+ (p6) br.dptk .Lb01
+ (p7) br.dptk .Lb10
+ (p8) br.dptk .Lb11
+ ;; }
+
+.Lb00:
+ ld8 r19 = [up], UPD
+ ;;
+ ld8 r16 = [up], UPD
+ ;;
+ ld8 r17 = [up], UPD
+ BSH r8 = r10, tnc
+ br.cloop.dptk L(gt4)
+ ;;
+ FSH r24 = r10, cnt
+ BSH r25 = r19, tnc
+ ;;
+ FSH r26 = r19, cnt
+ BSH r27 = r16, tnc
+ ;;
+ FSH r20 = r16, cnt
+ BSH r21 = r17, tnc
+ ;;
+ or r14 = r25, r24
+ FSH r22 = r17, cnt
+ ;;
+ or r15 = r27, r26
+ sub r31 = -1, r14
+ br .Lr4
+
+L(gt4):
+ {.mmi; nop 0
+ nop 0
+ FSH r24 = r10, cnt
+}{.mmi; ld8 r18 = [up], UPD
+ nop 0
+ BSH r25 = r19, tnc
+ ;; }
+ {.mmi; nop 0
+ nop 0
+ FSH r26 = r19, cnt
+}{.mmi; ld8 r19 = [up], UPD
+ nop 0
+ BSH r27 = r16, tnc
+ ;; }
+ {.mmi; nop 0
+ nop 0
+ FSH r20 = r16, cnt
+}{.mmi; ld8 r16 = [up], UPD
+ nop 0
+ BSH r21 = r17, tnc
+ ;; }
+ {.mmi; nop 0
+ or r14 = r25, r24
+ FSH r22 = r17, cnt
+}{.mib; ld8 r17 = [up], UPD
+ BSH r23 = r18, tnc
+ br.cloop.dptk L(gt8)
+ ;; }
+ {.mmi; nop 0
+ or r15 = r27, r26
+ FSH r24 = r18, cnt
+}{.mib; sub r31 = -1, r14
+ BSH r25 = r19, tnc
+ br .Lr8 }
+
+L(gt8):
+ or r15 = r27, r26
+ FSH r24 = r18, cnt
+ ld8 r18 = [up], UPD
+ sub r31 = -1, r14
+ BSH r25 = r19, tnc
+ br .LL00
+
+.Lb01:
+ br.cloop.dptk L(gt1)
+ ;;
+ BSH r8 = r10, tnc
+ FSH r22 = r10, cnt
+ ;;
+ sub r31 = -1, r22
+ br .Lr1
+ ;;
+L(gt1):
+ ld8 r18 = [up], UPD
+ BSH r8 = r10, tnc
+ FSH r22 = r10, cnt
+ ;;
+ ld8 r19 = [up], UPD
+ ;;
+ ld8 r16 = [up], UPD
+ ;;
+ ld8 r17 = [up], UPD
+ BSH r23 = r18, tnc
+ br.cloop.dptk L(gt5)
+ ;;
+ nop 0
+ FSH r24 = r18, cnt
+ BSH r25 = r19, tnc
+ ;;
+ nop 0
+ FSH r26 = r19, cnt
+ BSH r27 = r16, tnc
+ ;;
+ or r15 = r23, r22
+ FSH r20 = r16, cnt
+ BSH r21 = r17, tnc
+ ;;
+ or r14 = r25, r24
+ FSH r22 = r17, cnt
+ sub r31 = -1, r15
+ br .Lr5
+
+L(gt5):
+ {.mmi; nop 0
+ nop 0
+ FSH r24 = r18, cnt
+}{.mmi; ld8 r18 = [up], UPD
+ nop 0
+ BSH r25 = r19, tnc
+ ;; }
+ {.mmi; nop 0
+ nop 0
+ FSH r26 = r19, cnt
+}{.mmi; ld8 r19 = [up], UPD
+ nop 0
+ BSH r27 = r16, tnc
+ ;; }
+ {.mmi; nop 0
+ or r15 = r23, r22
+ FSH r20 = r16, cnt
+}{.mmi; ld8 r16 = [up], UPD
+ nop 0
+ BSH r21 = r17, tnc
+ ;; }
+ {.mmi; or r14 = r25, r24
+ sub r31 = -1, r15
+ FSH r22 = r17, cnt
+}{.mib; ld8 r17 = [up], UPD
+ BSH r23 = r18, tnc
+ br L(end)
+ ;; }
+
+.Lb10:
+ ld8 r17 = [up], UPD
+ br.cloop.dptk L(gt2)
+ ;;
+ BSH r8 = r10, tnc
+ FSH r20 = r10, cnt
+ ;;
+ BSH r21 = r17, tnc
+ FSH r22 = r17, cnt
+ ;;
+ or r14 = r21, r20
+ ;;
+ sub r31 = -1, r14
+ br .Lr2
+ ;;
+L(gt2):
+ ld8 r18 = [up], UPD
+ BSH r8 = r10, tnc
+ FSH r20 = r10, cnt
+ ;;
+ ld8 r19 = [up], UPD
+ ;;
+ ld8 r16 = [up], UPD
+ BSH r21 = r17, tnc
+ FSH r22 = r17, cnt
+ ;;
+ ld8 r17 = [up], UPD
+ BSH r23 = r18, tnc
+ br.cloop.dptk L(gt6)
+ ;;
+ nop 0
+ FSH r24 = r18, cnt
+ BSH r25 = r19, tnc
+ ;;
+ or r14 = r21, r20
+ FSH r26 = r19, cnt
+ BSH r27 = r16, tnc
+ ;;
+ {.mmi; nop 0
+ or r15 = r23, r22
+ FSH r20 = r16, cnt
+}{.mib; sub r31 = -1, r14
+ BSH r21 = r17, tnc
+ br .Lr6
+ ;; }
+L(gt6):
+ {.mmi; nop 0
+ nop 0
+ FSH r24 = r18, cnt
+}{.mmi; ld8 r18 = [up], UPD
+ nop 0
+ BSH r25 = r19, tnc
+ ;; }
+ {.mmi; nop 0
+ or r14 = r21, r20
+ FSH r26 = r19, cnt
+}{.mmi; ld8 r19 = [up], UPD
+ nop 0
+ BSH r27 = r16, tnc
+ ;; }
+ {.mmi; or r15 = r23, r22
+ sub r31 = -1, r14
+ FSH r20 = r16, cnt
+}{.mib; ld8 r16 = [up], UPD
+ BSH r21 = r17, tnc
+ br .LL10
+}
+
+.Lb11:
+ ld8 r16 = [up], UPD
+ ;;
+ ld8 r17 = [up], UPD
+ BSH r8 = r10, tnc
+ FSH r26 = r10, cnt
+ br.cloop.dptk L(gt3)
+ ;;
+ BSH r27 = r16, tnc
+ ;;
+ FSH r20 = r16, cnt
+ BSH r21 = r17, tnc
+ ;;
+ FSH r22 = r17, cnt
+ ;;
+ or r15 = r27, r26
+ ;;
+ or r14 = r21, r20
+ sub r31 = -1, r15
+ br .Lr3
+ ;;
+L(gt3):
+ ld8 r18 = [up], UPD
+ ;;
+ ld8 r19 = [up], UPD
+ BSH r27 = r16, tnc
+ ;;
+ {.mmi; nop 0
+ nop 0
+ FSH r20 = r16, cnt
+}{.mmi; ld8 r16 = [up], UPD
+ nop 0
+ BSH r21 = r17, tnc
+ ;; }
+ {.mmi nop 0
+ nop 0
+ FSH r22 = r17, cnt
+}{.mib; ld8 r17 = [up], UPD
+ BSH r23 = r18, tnc
+ br.cloop.dptk L(gt7)
+ ;; }
+ or r15 = r27, r26
+ FSH r24 = r18, cnt
+ BSH r25 = r19, tnc
+ ;;
+ {.mmi; nop 0
+ or r14 = r21, r20
+ FSH r26 = r19, cnt
+}{.mib; sub r31 = -1, r15
+ BSH r27 = r16, tnc
+ br .Lr7
+}
+L(gt7):
+ {.mmi; nop 0
+ or r15 = r27, r26
+ FSH r24 = r18, cnt
+}{.mmi; ld8 r18 = [up], UPD
+ nop 0
+ BSH r25 = r19, tnc
+ ;; }
+ {.mmi; or r14 = r21, r20
+ sub r31 = -1, r15
+ FSH r26 = r19, cnt
+}{.mib; ld8 r19 = [up], UPD
+ BSH r27 = r16, tnc
+ br .LL11
+}
+
+C *** MAIN LOOP START ***
+ ALIGN(32)
+L(top):
+.LL01:
+ {.mmi; st8 [rp] = r31, UPD C M2
+ or r15 = r27, r26 C M3
+ FSH r24 = r18, cnt C I0
+}{.mmi; ld8 r18 = [up], UPD C M0
+ sub r31 = -1, r14 C M1
+ BSH r25 = r19, tnc C I1
+ ;; }
+.LL00:
+ {.mmi; st8 [rp] = r31, UPD
+ or r14 = r21, r20
+ FSH r26 = r19, cnt
+}{.mmi; ld8 r19 = [up], UPD
+ sub r31 = -1, r15
+ BSH r27 = r16, tnc
+ ;; }
+.LL11:
+ {.mmi; st8 [rp] = r31, UPD
+ or r15 = r23, r22
+ FSH r20 = r16, cnt
+}{.mmi; ld8 r16 = [up], UPD
+ sub r31 = -1, r14
+ BSH r21 = r17, tnc
+ ;; }
+.LL10:
+ {.mmi; st8 [rp] = r31, UPD
+ or r14 = r25, r24
+ FSH r22 = r17, cnt
+}{.mmi; ld8 r17 = [up], UPD
+ sub r31 = -1, r15
+ BSH r23 = r18, tnc
+ ;; }
+L(end): lfetch [r11], PUPD
+ br.cloop.dptk L(top)
+C *** MAIN LOOP END ***
+
+ {.mmi; st8 [rp] = r31, UPD
+ or r15 = r27, r26
+ FSH r24 = r18, cnt
+}{.mib; sub r31 = -1, r14
+ BSH r25 = r19, tnc
+ nop 0
+ ;; }
+.Lr8:
+ {.mmi; st8 [rp] = r31, UPD
+ or r14 = r21, r20
+ FSH r26 = r19, cnt
+}{.mib; sub r31 = -1, r15
+ BSH r27 = r16, tnc
+ nop 0
+ ;; }
+.Lr7:
+ {.mmi; st8 [rp] = r31, UPD
+ or r15 = r23, r22
+ FSH r20 = r16, cnt
+}{.mib; sub r31 = -1, r14
+ BSH r21 = r17, tnc
+ nop 0
+ ;; }
+.Lr6: st8 [rp] = r31, UPD
+ or r14 = r25, r24
+ FSH r22 = r17, cnt
+ sub r31 = -1, r15
+ ;;
+.Lr5: st8 [rp] = r31, UPD
+ or r15 = r27, r26
+ sub r31 = -1, r14
+ ;;
+.Lr4: st8 [rp] = r31, UPD
+ or r14 = r21, r20
+ sub r31 = -1, r15
+ ;;
+.Lr3: st8 [rp] = r31, UPD
+ sub r31 = -1, r14
+ ;;
+.Lr2: st8 [rp] = r31, UPD
+ sub r31 = -1, r22
+ ;;
+.Lr1: st8 [rp] = r31, UPD C M23
+ mov ar.lc = r2 C I0
+ br.ret.sptk.many b0 C B
+EPILOGUE(func)
+ASM_END()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/ia64/mod_34lsub1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/ia64/mod_34lsub1.asm
new file mode 100644
index 00000000000..edf3602c4c0
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/ia64/mod_34lsub1.asm
@@ -0,0 +1,236 @@
+dnl IA-64 mpn_mod_34lsub1
+
+dnl Contributed to the GNU project by Torbjorn Granlund.
+
+dnl Copyright 2003-2005, 2010 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 Itanium: ?
+C Itanium 2: 1
+
+
+C INPUT PARAMETERS
+define(`up', `r32')
+define(`n', `r33')
+
+C Some useful aliases for registers we use
+define(`u0',`r14') define(`u1',`r15') define(`u2',`r16')
+define(`a0',`r17') define(`a1',`r18') define(`a2',`r19')
+define(`c0',`r20') define(`c1',`r21') define(`c2',`r22')
+
+C This is a fairly simple-minded implementation. One could approach 0.67 c/l
+C with a more sophisticated implementation. If we're really crazy, we could
+C super-unroll, storing carries just in predicate registers, then copy them to
+C a general register, and population count them from there. That'd bring us
+C close to 3 insn/limb, for nearly 0.5 c/l.
+
+C Computing n/3 needs 16 cycles, which is a lot of startup overhead.
+C We therefore use a plain while-style loop:
+C add n = -3, n
+C cmp.le p9, p0 = 3, n
+C (p9) br.cond .Loop
+C Alternatively, we could table n/3 for, say, n < 256, and predicate the
+C 16-cycle code.
+
+C The summing-up code at the end was written quickly, and could surely be
+C vastly improved.
+
+ASM_START()
+PROLOGUE(mpn_mod_34lsub1)
+ .prologue
+ .save ar.lc, r2
+ .body
+ifdef(`HAVE_ABI_32',`
+ addp4 up = 0, up C M I
+ nop.m 0
+ zxt4 n = n C I
+ ;;
+')
+
+ifelse(0,1,`
+ movl r14 = 0xAAAAAAAAAAAAAAAB
+ ;;
+ setf.sig f6 = r14
+ setf.sig f7 = r33
+ ;;
+ xmpy.hu f6 = f6, f7
+ ;;
+ getf.sig r8 = f6
+ ;;
+ shr.u r8 = r8, 1 C Loop count
+ ;;
+ mov.i ar.lc = r8
+')
+
+ ld8 u0 = [up], 8
+ cmp.ne p9, p0 = 1, n
+ (p9) br L(gt1)
+ ;;
+ shr.u r8 = u0, 48
+ dep.z r27 = u0, 0, 48
+ ;;
+ add r8 = r8, r27
+ br.ret.sptk.many b0
+
+
+L(gt1):
+.mmi; nop.m 0
+ mov a0 = 0
+ add n = -2, n
+.mmi; mov c0 = 0
+ mov c1 = 0
+ mov c2 = 0
+ ;;
+.mmi; ld8 u1 = [up], 8
+ mov a1 = 0
+ cmp.ltu p6, p0 = r0, r0 C clear p6
+.mmb; cmp.gt p9, p0 = 3, n
+ mov a2 = 0
+ (p9) br.cond.dptk L(end)
+ ;;
+
+ ALIGN(32)
+L(top):
+.mmi; ld8 u2 = [up], 8
+ (p6) add c0 = 1, c0
+ cmp.ltu p7, p0 = a0, u0
+.mmb; sub a0 = a0, u0
+ add n = -3, n
+ nop.b 0
+ ;;
+.mmi; ld8 u0 = [up], 8
+ (p7) add c1 = 1, c1
+ cmp.ltu p8, p0 = a1, u1
+.mmb; sub a1 = a1, u1
+ cmp.le p9, p0 = 3, n
+ nop.b 0
+ ;;
+.mmi; ld8 u1 = [up], 8
+ (p8) add c2 = 1, c2
+ cmp.ltu p6, p0 = a2, u2
+.mmb; sub a2 = a2, u2
+ nop.m 0
+dnl br.cloop.dptk L(top)
+ (p9) br.cond.dptk L(top)
+ ;;
+
+L(end):
+ cmp.eq p10, p0 = 0, n
+ cmp.eq p11, p0 = 1, n
+ (p10) br L(0)
+
+L(2):
+.mmi; ld8 u2 = [up], 8
+ (p6) add c0 = 1, c0
+ cmp.ltu p7, p0 = a0, u0
+.mmb; sub a0 = a0, u0
+ nop.m 0
+ (p11) br L(1)
+ ;;
+ ld8 u0 = [up], 8
+ (p7) add c1 = 1, c1
+ cmp.ltu p8, p0 = a1, u1
+ sub a1 = a1, u1
+ ;;
+ (p8) add c2 = 1, c2
+ cmp.ltu p6, p0 = a2, u2
+ sub a2 = a2, u2
+ ;;
+ (p6) add c0 = 1, c0
+ cmp.ltu p7, p0 = a0, u0
+ sub a0 = a0, u0
+ ;;
+ (p7) add c1 = 1, c1
+ br L(com)
+
+
+L(1):
+ (p7) add c1 = 1, c1
+ cmp.ltu p8, p0 = a1, u1
+ sub a1 = a1, u1
+ ;;
+ (p8) add c2 = 1, c2
+ cmp.ltu p6, p0 = a2, u2
+ sub a2 = a2, u2
+ ;;
+ (p6) add c0 = 1, c0
+ br L(com)
+
+
+L(0):
+ (p6) add c0 = 1, c0
+ cmp.ltu p7, p0 = a0, u0
+ sub a0 = a0, u0
+ ;;
+ (p7) add c1 = 1, c1
+ cmp.ltu p8, p0 = a1, u1
+ sub a1 = a1, u1
+ ;;
+ (p8) add c2 = 1, c2
+
+L(com):
+C | a2 | a1 | a0 |
+C | | | | |
+ shr.u r24 = a0, 48 C 16 bits
+ shr.u r25 = a1, 32 C 32 bits
+ shr.u r26 = a2, 16 C 48 bits
+ ;;
+ shr.u r10 = c0, 48 C 16 bits, always zero
+ shr.u r11 = c1, 32 C 32 bits
+ shr.u r30 = c2, 16 C 48 bits
+ ;;
+ dep.z r27 = a0, 0, 48 C 48 bits
+ dep.z r28 = a1, 16, 32 C 48 bits
+ dep.z r29 = a2, 32, 16 C 48 bits
+ dep.z r31 = c0, 0, 48 C 48 bits
+ dep.z r14 = c1, 16, 32 C 48 bits
+ dep.z r15 = c2, 32, 16 C 48 bits
+ ;;
+.mmi; add r24 = r24, r25
+ add r26 = r26, r27
+ add r28 = r28, r29
+.mmi; add r10 = r10, r11
+ add r30 = r30, r31
+ add r14 = r14, r15
+ ;;
+ movl r8 = 0xffffffffffff0
+ add r24 = r24, r26
+ add r10 = r10, r30
+ ;;
+ add r24 = r24, r28
+ add r10 = r10, r14
+ ;;
+ sub r8 = r8, r24
+ ;;
+ add r8 = r8, r10
+ br.ret.sptk.many b0
+EPILOGUE()
+ASM_END()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/ia64/mode1o.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/ia64/mode1o.asm
new file mode 100644
index 00000000000..14d5e816029
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/ia64/mode1o.asm
@@ -0,0 +1,342 @@
+dnl Itanium-2 mpn_modexact_1c_odd -- mpn by 1 exact remainder.
+
+dnl Contributed to the GNU project by Kevin Ryde.
+
+dnl Copyright 2003-2005 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 Itanium: 15
+C Itanium 2: 8
+
+
+dnl Usage: ABI32(`code')
+dnl
+dnl Emit the given code only under HAVE_ABI_32.
+dnl
+define(ABI32,
+m4_assert_onearg()
+`ifdef(`HAVE_ABI_32',`$1')')
+
+
+C mp_limb_t mpn_modexact_1c_odd (mp_srcptr src, mp_size_t size,
+C mp_limb_t divisor, mp_limb_t carry);
+C
+C The modexact algorithm is usually conceived as a dependent chain
+C
+C l = src[i] - c
+C q = low(l * inverse)
+C c = high(q*divisor) + (src[i]<c)
+C
+C but we can work the src[i]-c into an xma by calculating si=src[i]*inverse
+C separately (off the dependent chain) and using
+C
+C q = low(c * inverse + si)
+C c = high(q*divisor + c)
+C
+C This means the dependent chain is simply xma.l followed by xma.hu, for a
+C total 8 cycles/limb on itanium-2.
+C
+C The reason xma.hu works for the new c is that the low of q*divisor is
+C src[i]-c (being the whole purpose of the q generated, and it can be
+C verified algebraically). If there was an underflow from src[i]-c, then
+C there will be an overflow from (src-c)+c, thereby adding 1 to the new c
+C the same as the borrow bit (src[i]<c) gives in the first style shown.
+C
+C Incidentally, fcmp is not an option for treating src[i]-c, since it
+C apparently traps to the kernel for unnormalized operands like those used
+C and generated by ldf8 and xma. On one GNU/Linux system it took about 1200
+C cycles.
+C
+C
+C First Limb:
+C
+C The first limb uses q = (src[0]-c) * inverse shown in the first style.
+C This lets us get the first q as soon as the inverse is ready, without
+C going through si=s*inverse. Basically at the start we have c and can use
+C it while waiting for the inverse, whereas for the second and subsequent
+C limbs it's the other way around, ie. we have the inverse and are waiting
+C for c.
+C
+C At .Lentry the first two instructions in the loop have been done already.
+C The load of f11=src[1] at the start (predicated on size>=2), and the
+C calculation of q by the initial different scheme.
+C
+C
+C Entry Sequence:
+C
+C In the entry sequence, the critical path is the calculation of the
+C inverse, so this is begun first and optimized. Apart from that, ar.lc is
+C established nice and early so the br.cloop's should predict perfectly.
+C And the load for the low limbs src[0] and src[1] can be initiated long
+C ahead of where they're needed.
+C
+C
+C Inverse Calculation:
+C
+C The initial 8-bit inverse is calculated using a table lookup. If it hits
+C L1 (which is likely if we're called several times) then it should take a
+C total 4 cycles, otherwise hopefully L2 for 9 cycles. This is considered
+C the best approach, on balance. It could be done bitwise, but that would
+C probably be about 14 cycles (2 per bit beyond the first couple). Or it
+C could be taken from 4 bits to 8 with xmpy doubling as used beyond 8 bits,
+C but that would be about 11 cycles.
+C
+C The table is not the same as binvert_limb_table, instead it's 256 bytes,
+C designed to be indexed by the low byte of the divisor. The divisor is
+C always odd, so the relevant data is every second byte in the table. The
+C padding lets us use zxt1 instead of extr.u, the latter would cost an extra
+C cycle because it must go down I0, and we're using the first I0 slot to get
+C ip. The extra 128 bytes of padding should be insignificant compared to
+C typical ia64 code bloat.
+C
+C Having the table in .text allows us to use IP-relative addressing,
+C avoiding a fetch from ltoff. .rodata is apparently not suitable for use
+C IP-relative, it gets a linker relocation overflow on GNU/Linux.
+C
+C
+C Load Scheduling:
+C
+C In the main loop, the data loads are scheduled for an L2 hit, which means
+C 6 cycles for the data ready to use. In fact we end up 7 cycles ahead. In
+C any case that scheduling is achieved simply by doing the load (and xmpy.l
+C for "si") in the immediately preceding iteration.
+C
+C The main loop requires size >= 2, and we handle size==1 by an initial
+C br.cloop to enter the loop only if size>1. Since ar.lc is established
+C early, this should predict perfectly.
+C
+C
+C Not done:
+C
+C Consideration was given to using a plain "(src[0]-c) % divisor" for
+C size==1, but cycle counting suggests about 50 for the sort of approach
+C taken by gcc __umodsi3, versus about 47 for the modexact. (Both assuming
+C L1 hits for their respective fetching.)
+C
+C Consideration was given to a test for high<divisor and replacing the last
+C loop iteration with instead c-=src[size-1] followed by c+=d if underflow.
+C Branching on high<divisor wouldn't be good since a mispredict would cost
+C more than the loop iteration saved, and the condition is of course data
+C dependent. So the theory would be to shorten the loop count if
+C high<divisor, and predicate extra operations at the end. That would mean
+C a gain of 6 when high<divisor, or a cost of 2 if not.
+C
+C Whether such a tradeoff is a win on average depends on assumptions about
+C how many bits in the high and the divisor. If both are uniformly
+C distributed then high<divisor about 50% of the time. But smallish
+C divisors (less chance of high<divisor) might be more likely from
+C applications (mpz_divisible_ui, mpz_gcd_ui, etc). Though biggish divisors
+C would be normal internally from say mpn/generic/perfsqr.c. On balance,
+C for the moment, it's felt the gain is not really enough to be worth the
+C trouble.
+C
+C
+C Enhancement:
+C
+C Process two source limbs per iteration using a two-limb inverse and a
+C sequence like
+C
+C ql = low (c * il + sil) quotient low limb
+C qlc = high(c * il + sil)
+C qh1 = low (c * ih + sih) quotient high, partial
+C
+C cl = high (ql * d + c) carry out of low
+C qh = low (qlc * 1 + qh1) quotient high limb
+C
+C new c = high (qh * d + cl) carry out of high
+C
+C This would be 13 cycles/iteration, giving 6.5 cycles/limb. The two limb
+C s*inverse as sih:sil = sh:sl * ih:il would be calculated off the dependent
+C chain with 4 multiplies. The bigger inverse would take extra time to
+C calculate, but a one limb iteration to handle an odd size could be done as
+C soon as 64-bits of inverse were ready.
+C
+C Perhaps this could even extend to a 3 limb inverse, which might promise 17
+C or 18 cycles for 3 limbs, giving 5.66 or 6.0 cycles/limb.
+C
+
+ASM_START()
+ .explicit
+
+ .text
+ .align 32
+.Ltable:
+data1 0,0x01, 0,0xAB, 0,0xCD, 0,0xB7, 0,0x39, 0,0xA3, 0,0xC5, 0,0xEF
+data1 0,0xF1, 0,0x1B, 0,0x3D, 0,0xA7, 0,0x29, 0,0x13, 0,0x35, 0,0xDF
+data1 0,0xE1, 0,0x8B, 0,0xAD, 0,0x97, 0,0x19, 0,0x83, 0,0xA5, 0,0xCF
+data1 0,0xD1, 0,0xFB, 0,0x1D, 0,0x87, 0,0x09, 0,0xF3, 0,0x15, 0,0xBF
+data1 0,0xC1, 0,0x6B, 0,0x8D, 0,0x77, 0,0xF9, 0,0x63, 0,0x85, 0,0xAF
+data1 0,0xB1, 0,0xDB, 0,0xFD, 0,0x67, 0,0xE9, 0,0xD3, 0,0xF5, 0,0x9F
+data1 0,0xA1, 0,0x4B, 0,0x6D, 0,0x57, 0,0xD9, 0,0x43, 0,0x65, 0,0x8F
+data1 0,0x91, 0,0xBB, 0,0xDD, 0,0x47, 0,0xC9, 0,0xB3, 0,0xD5, 0,0x7F
+data1 0,0x81, 0,0x2B, 0,0x4D, 0,0x37, 0,0xB9, 0,0x23, 0,0x45, 0,0x6F
+data1 0,0x71, 0,0x9B, 0,0xBD, 0,0x27, 0,0xA9, 0,0x93, 0,0xB5, 0,0x5F
+data1 0,0x61, 0,0x0B, 0,0x2D, 0,0x17, 0,0x99, 0,0x03, 0,0x25, 0,0x4F
+data1 0,0x51, 0,0x7B, 0,0x9D, 0,0x07, 0,0x89, 0,0x73, 0,0x95, 0,0x3F
+data1 0,0x41, 0,0xEB, 0,0x0D, 0,0xF7, 0,0x79, 0,0xE3, 0,0x05, 0,0x2F
+data1 0,0x31, 0,0x5B, 0,0x7D, 0,0xE7, 0,0x69, 0,0x53, 0,0x75, 0,0x1F
+data1 0,0x21, 0,0xCB, 0,0xED, 0,0xD7, 0,0x59, 0,0xC3, 0,0xE5, 0,0x0F
+data1 0,0x11, 0,0x3B, 0,0x5D, 0,0xC7, 0,0x49, 0,0x33, 0,0x55, 0,0xFF
+
+
+PROLOGUE(mpn_modexact_1c_odd)
+
+ C r32 src
+ C r33 size
+ C r34 divisor
+ C r35 carry
+
+ .prologue
+.Lhere:
+{ .mmi; add r33 = -1, r33 C M0 size-1
+ mov r14 = 2 C M1 2
+ mov r15 = ip C I0 .Lhere
+}{.mmi; setf.sig f6 = r34 C M2 divisor
+ setf.sig f9 = r35 C M3 carry
+ zxt1 r3 = r34 C I1 divisor low byte
+} ;;
+
+{ .mmi; add r3 = .Ltable-.Lhere, r3 C M0 table offset ip and index
+ sub r16 = 0, r34 C M1 -divisor
+ .save ar.lc, r2
+ mov r2 = ar.lc C I0
+}{.mmi; .body
+ setf.sig f13 = r14 C M2 2 in significand
+ mov r17 = -1 C M3 -1
+ABI32(` zxt4 r33 = r33') C I1 size extend
+} ;;
+
+{ .mmi; add r3 = r3, r15 C M0 table entry address
+ABI32(` addp4 r32 = 0, r32') C M1 src extend
+ mov ar.lc = r33 C I0 size-1 loop count
+}{.mmi; setf.sig f12 = r16 C M2 -divisor
+ setf.sig f8 = r17 C M3 -1
+} ;;
+
+{ .mmi; ld1 r3 = [r3] C M0 inverse, 8 bits
+ ldf8 f10 = [r32], 8 C M1 src[0]
+ cmp.ne p6,p0 = 0, r33 C I0 test size!=1
+} ;;
+
+ C Wait for table load.
+ C Hope for an L1 hit of 1 cycles to ALU, but could be more.
+ setf.sig f7 = r3 C M2 inverse, 8 bits
+(p6) ldf8 f11 = [r32], 8 C M1 src[1], if size!=1
+ ;;
+
+ C 5 cycles
+
+ C f6 divisor
+ C f7 inverse, being calculated
+ C f8 -1, will be -inverse
+ C f9 carry
+ C f10 src[0]
+ C f11 src[1]
+ C f12 -divisor
+ C f13 2
+ C f14 scratch
+
+ xmpy.l f14 = f13, f7 C 2*i
+ xmpy.l f7 = f7, f7 C i*i
+ ;;
+ xma.l f7 = f7, f12, f14 C i*i*-d + 2*i, inverse 16 bits
+ ;;
+
+ xmpy.l f14 = f13, f7 C 2*i
+ xmpy.l f7 = f7, f7 C i*i
+ ;;
+ xma.l f7 = f7, f12, f14 C i*i*-d + 2*i, inverse 32 bits
+ ;;
+
+ xmpy.l f14 = f13, f7 C 2*i
+ xmpy.l f7 = f7, f7 C i*i
+ ;;
+
+ xma.l f7 = f7, f12, f14 C i*i*-d + 2*i, inverse 64 bits
+ xma.l f10 = f9, f8, f10 C sc = c * -1 + src[0]
+ ;;
+ASSERT(p6, `
+ xmpy.l f15 = f6, f7 ;; C divisor*inverse
+ getf.sig r31 = f15 ;;
+ cmp.eq p6,p0 = 1, r31 C should == 1
+')
+
+ xmpy.l f10 = f10, f7 C q = sc * inverse
+ xmpy.l f8 = f7, f8 C -inverse = inverse * -1
+ br.cloop.sptk.few.clr .Lentry C main loop, if size > 1
+ ;;
+
+ C size==1, finish up now
+ xma.hu f9 = f10, f6, f9 C c = high(q * divisor + c)
+ mov ar.lc = r2 C I0
+ ;;
+ getf.sig r8 = f9 C M2 return c
+ br.ret.sptk.many b0
+
+
+
+.Ltop:
+ C r2 saved ar.lc
+ C f6 divisor
+ C f7 inverse
+ C f8 -inverse
+ C f9 carry
+ C f10 src[i] * inverse
+ C f11 scratch src[i+1]
+
+ add r16 = 160, r32
+ ldf8 f11 = [r32], 8 C src[i+1]
+ ;;
+ C 2 cycles
+
+ lfetch [r16]
+ xma.l f10 = f9, f8, f10 C q = c * -inverse + si
+ ;;
+ C 3 cycles
+
+.Lentry:
+ xma.hu f9 = f10, f6, f9 C c = high(q * divisor + c)
+ xmpy.l f10 = f11, f7 C si = src[i] * inverse
+ br.cloop.sptk.few.clr .Ltop
+ ;;
+
+
+
+ xma.l f10 = f9, f8, f10 C q = c * -inverse + si
+ mov ar.lc = r2 C I0
+ ;;
+ xma.hu f9 = f10, f6, f9 C c = high(q * divisor + c)
+ ;;
+ getf.sig r8 = f9 C M2 return c
+ br.ret.sptk.many b0
+
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/ia64/mul_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/ia64/mul_1.asm
new file mode 100644
index 00000000000..21bf6d0e14f
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/ia64/mul_1.asm
@@ -0,0 +1,584 @@
+dnl IA-64 mpn_mul_1, mpn_mul_1c -- Multiply a limb vector with a limb and
+dnl store the result in a second limb vector.
+
+dnl Contributed to the GNU project by Torbjorn Granlund.
+
+dnl Copyright 2000-2004, 2006, 2007 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 Itanium: 4.0
+C Itanium 2: 2.0
+
+C TODO
+C * Further optimize feed-in and wind-down code, both for speed and code size.
+C * Handle low limb input and results specially, using a common stf8 in the
+C epilogue.
+C * Use 1 c/l carry propagation scheme in wind-down code.
+C * Use extra pointer register for `up' to speed up feed-in loads.
+C * Work out final differences with addmul_1.asm.
+
+C INPUT PARAMETERS
+define(`rp', `r32')
+define(`up', `r33')
+define(`n', `r34')
+define(`vl', `r35')
+define(`cy', `r36') C for mpn_mul_1c
+
+ASM_START()
+PROLOGUE(mpn_mul_1)
+ .prologue
+ .save ar.lc, r2
+ .body
+
+ifdef(`HAVE_ABI_32',
+` addp4 rp = 0, rp C M I
+ addp4 up = 0, up C M I
+ zxt4 n = n C I
+ ;;
+')
+{.mfi
+ adds r15 = -1, n C M I
+ mov f9 = f0 C F
+ mov.i r2 = ar.lc C I0
+}
+{.mmi
+ ldf8 f7 = [up], 8 C M
+ nop.m 0 C M
+ and r14 = 3, n C M I
+ ;;
+}
+.Lcommon:
+{.mii
+ setf.sig f6 = vl C M2 M3
+ shr.u r31 = r15, 2 C I0
+ cmp.eq p10, p0 = 0, r14 C M I
+}
+{.mii
+ cmp.eq p11, p0 = 2, r14 C M I
+ cmp.eq p12, p0 = 3, r14 C M I
+ nop.i 0 C I
+ ;;
+}
+{.mii
+ cmp.ne p6, p7 = r0, r0 C M I
+ mov.i ar.lc = r31 C I0
+ cmp.ne p8, p9 = r0, r0 C M I
+}
+{.bbb
+ (p10) br.dptk .Lb00 C B
+ (p11) br.dptk .Lb10 C B
+ (p12) br.dptk .Lb11 C B
+ ;;
+}
+
+.Lb01: mov r20 = 0
+ br.cloop.dptk .grt1 C B
+
+ xma.l f39 = f7, f6, f9 C F
+ xma.hu f43 = f7, f6, f9 C F
+ ;;
+ getf.sig r8 = f43 C M2
+ stf8 [rp] = f39 C M2 M3
+ mov.i ar.lc = r2 C I0
+ br.ret.sptk.many b0 C B
+
+.grt1:
+ ldf8 f32 = [up], 8
+ ;;
+ ldf8 f33 = [up], 8
+ ;;
+ ldf8 f34 = [up], 8
+ xma.l f39 = f7, f6, f9
+ xma.hu f43 = f7, f6, f9
+ ;;
+ ldf8 f35 = [up], 8
+ br.cloop.dptk .grt5
+
+ xma.l f36 = f32, f6, f0
+ xma.hu f40 = f32, f6, f0
+ ;;
+ stf8 [rp] = f39, 8
+ xma.l f37 = f33, f6, f0
+ xma.hu f41 = f33, f6, f0
+ ;;
+ getf.sig r21 = f43
+ getf.sig r18 = f36
+ xma.l f38 = f34, f6, f0
+ xma.hu f42 = f34, f6, f0
+ ;;
+ getf.sig r22 = f40
+ getf.sig r19 = f37
+ xma.l f39 = f35, f6, f0
+ xma.hu f43 = f35, f6, f0
+ ;;
+ getf.sig r23 = f41
+ getf.sig r16 = f38
+ br .Lcj5
+
+.grt5:
+ xma.l f36 = f32, f6, f0
+ xma.hu f40 = f32, f6, f0
+ ;;
+ getf.sig r17 = f39
+ ldf8 f32 = [up], 8
+ xma.l f37 = f33, f6, f0
+ xma.hu f41 = f33, f6, f0
+ ;;
+ getf.sig r21 = f43
+ ldf8 f33 = [up], 8
+ xma.l f38 = f34, f6, f0
+ ;;
+ getf.sig r18 = f36
+ xma.hu f42 = f34, f6, f0
+ ;;
+ getf.sig r22 = f40
+ ldf8 f34 = [up], 8
+ xma.l f39 = f35, f6, f0
+ ;;
+ getf.sig r19 = f37
+ xma.hu f43 = f35, f6, f0
+ br .LL01
+
+
+.Lb10: ldf8 f35 = [up], 8
+ mov r23 = 0
+ br.cloop.dptk .grt2
+
+ xma.l f38 = f7, f6, f9
+ xma.hu f42 = f7, f6, f9
+ ;;
+ stf8 [rp] = f38, 8
+ xma.l f39 = f35, f6, f42
+ xma.hu f43 = f35, f6, f42
+ ;;
+ getf.sig r8 = f43
+ stf8 [rp] = f39
+ mov.i ar.lc = r2
+ br.ret.sptk.many b0
+
+
+.grt2:
+ ldf8 f32 = [up], 8
+ ;;
+ ldf8 f33 = [up], 8
+ xma.l f38 = f7, f6, f9
+ xma.hu f42 = f7, f6, f9
+ ;;
+ ldf8 f34 = [up], 8
+ xma.l f39 = f35, f6, f0
+ xma.hu f43 = f35, f6, f0
+ ;;
+ ldf8 f35 = [up], 8
+ br.cloop.dptk .grt6
+
+ stf8 [rp] = f38, 8
+ xma.l f36 = f32, f6, f0
+ xma.hu f40 = f32, f6, f0
+ ;;
+ getf.sig r20 = f42
+ getf.sig r17 = f39
+ xma.l f37 = f33, f6, f0
+ xma.hu f41 = f33, f6, f0
+ ;;
+ getf.sig r21 = f43
+ getf.sig r18 = f36
+ xma.l f38 = f34, f6, f0
+ xma.hu f42 = f34, f6, f0
+ ;;
+ getf.sig r22 = f40
+ getf.sig r19 = f37
+ xma.l f39 = f35, f6, f0
+ xma.hu f43 = f35, f6, f0
+ br .Lcj6
+
+.grt6:
+ getf.sig r16 = f38
+ xma.l f36 = f32, f6, f0
+ xma.hu f40 = f32, f6, f0
+ ;;
+ getf.sig r20 = f42
+ ldf8 f32 = [up], 8
+ xma.l f37 = f33, f6, f0
+ ;;
+ getf.sig r17 = f39
+ xma.hu f41 = f33, f6, f0
+ ;;
+ getf.sig r21 = f43
+ ldf8 f33 = [up], 8
+ xma.l f38 = f34, f6, f0
+ ;;
+ getf.sig r18 = f36
+ xma.hu f42 = f34, f6, f0
+ br .LL10
+
+
+.Lb11: ldf8 f34 = [up], 8
+ mov r22 = 0
+ ;;
+ ldf8 f35 = [up], 8
+ br.cloop.dptk .grt3
+ ;;
+
+ xma.l f37 = f7, f6, f9
+ xma.hu f41 = f7, f6, f9
+ xma.l f38 = f34, f6, f0
+ xma.hu f42 = f34, f6, f0
+ xma.l f39 = f35, f6, f0
+ xma.hu f43 = f35, f6, f0
+ ;;
+ getf.sig r23 = f41
+ stf8 [rp] = f37, 8
+ getf.sig r16 = f38
+ getf.sig r20 = f42
+ getf.sig r17 = f39
+ getf.sig r8 = f43
+ br .Lcj3
+
+.grt3:
+ ldf8 f32 = [up], 8
+ xma.l f37 = f7, f6, f9
+ xma.hu f41 = f7, f6, f9
+ ;;
+ ldf8 f33 = [up], 8
+ xma.l f38 = f34, f6, f0
+ xma.hu f42 = f34, f6, f0
+ ;;
+ getf.sig r19 = f37
+ ldf8 f34 = [up], 8
+ xma.l f39 = f35, f6, f0
+ xma.hu f43 = f35, f6, f0
+ ;;
+ getf.sig r23 = f41
+ ldf8 f35 = [up], 8
+ br.cloop.dptk .grt7
+
+ getf.sig r16 = f38
+ xma.l f36 = f32, f6, f0
+ getf.sig r20 = f42
+ xma.hu f40 = f32, f6, f0
+ ;;
+ getf.sig r17 = f39
+ xma.l f37 = f33, f6, f0
+ getf.sig r21 = f43
+ xma.hu f41 = f33, f6, f0
+ ;;
+ getf.sig r18 = f36
+ st8 [rp] = r19, 8
+ xma.l f38 = f34, f6, f0
+ xma.hu f42 = f34, f6, f0
+ br .Lcj7
+
+.grt7:
+ getf.sig r16 = f38
+ xma.l f36 = f32, f6, f0
+ xma.hu f40 = f32, f6, f0
+ ;;
+ getf.sig r20 = f42
+ ldf8 f32 = [up], 8
+ xma.l f37 = f33, f6, f0
+ ;;
+ getf.sig r17 = f39
+ xma.hu f41 = f33, f6, f0
+ br .LL11
+
+
+.Lb00: ldf8 f33 = [up], 8
+ mov r21 = 0
+ ;;
+ ldf8 f34 = [up], 8
+ ;;
+ ldf8 f35 = [up], 8
+ xma.l f36 = f7, f6, f9
+ xma.hu f40 = f7, f6, f9
+ br.cloop.dptk .grt4
+
+ xma.l f37 = f33, f6, f0
+ xma.hu f41 = f33, f6, f0
+ xma.l f38 = f34, f6, f0
+ xma.hu f42 = f34, f6, f0
+ ;;
+ getf.sig r22 = f40
+ stf8 [rp] = f36, 8
+ xma.l f39 = f35, f6, f0
+ getf.sig r19 = f37
+ xma.hu f43 = f35, f6, f0
+ ;;
+ getf.sig r23 = f41
+ getf.sig r16 = f38
+ getf.sig r20 = f42
+ getf.sig r17 = f39
+ br .Lcj4
+
+.grt4:
+ ldf8 f32 = [up], 8
+ xma.l f37 = f33, f6, f0
+ xma.hu f41 = f33, f6, f0
+ ;;
+ getf.sig r18 = f36
+ ldf8 f33 = [up], 8
+ xma.l f38 = f34, f6, f0
+ xma.hu f42 = f34, f6, f0
+ ;;
+ getf.sig r22 = f40
+ ldf8 f34 = [up], 8
+ xma.l f39 = f35, f6, f0
+ ;;
+ getf.sig r19 = f37
+ getf.sig r23 = f41
+ xma.hu f43 = f35, f6, f0
+ ldf8 f35 = [up], 8
+ br.cloop.dptk .grt8
+
+ getf.sig r16 = f38
+ xma.l f36 = f32, f6, f0
+ getf.sig r20 = f42
+ xma.hu f40 = f32, f6, f0
+ ;;
+ getf.sig r17 = f39
+ st8 [rp] = r18, 8
+ xma.l f37 = f33, f6, f0
+ xma.hu f41 = f33, f6, f0
+ br .Lcj8
+
+.grt8:
+ getf.sig r16 = f38
+ xma.l f36 = f32, f6, f0
+ xma.hu f40 = f32, f6, f0
+ br .LL00
+
+
+C *** MAIN LOOP START ***
+ ALIGN(32)
+.Loop:
+ .pred.rel "mutex",p6,p7
+ getf.sig r16 = f38
+ xma.l f36 = f32, f6, f0
+ (p6) cmp.leu p8, p9 = r24, r17
+ st8 [rp] = r24, 8
+ xma.hu f40 = f32, f6, f0
+ (p7) cmp.ltu p8, p9 = r24, r17
+ ;;
+.LL00:
+ .pred.rel "mutex",p8,p9
+ getf.sig r20 = f42
+ (p8) add r24 = r18, r21, 1
+ nop.b 0
+ ldf8 f32 = [up], 8
+ (p9) add r24 = r18, r21
+ nop.b 0
+ ;;
+ .pred.rel "mutex",p8,p9
+ getf.sig r17 = f39
+ xma.l f37 = f33, f6, f0
+ (p8) cmp.leu p6, p7 = r24, r18
+ st8 [rp] = r24, 8
+ xma.hu f41 = f33, f6, f0
+ (p9) cmp.ltu p6, p7 = r24, r18
+ ;;
+.LL11:
+ .pred.rel "mutex",p6,p7
+ getf.sig r21 = f43
+ (p6) add r24 = r19, r22, 1
+ nop.b 0
+ ldf8 f33 = [up], 8
+ (p7) add r24 = r19, r22
+ nop.b 0
+ ;;
+ .pred.rel "mutex",p6,p7
+ getf.sig r18 = f36
+ xma.l f38 = f34, f6, f0
+ (p6) cmp.leu p8, p9 = r24, r19
+ st8 [rp] = r24, 8
+ xma.hu f42 = f34, f6, f0
+ (p7) cmp.ltu p8, p9 = r24, r19
+ ;;
+.LL10:
+ .pred.rel "mutex",p8,p9
+ getf.sig r22 = f40
+ (p8) add r24 = r16, r23, 1
+ nop.b 0
+ ldf8 f34 = [up], 8
+ (p9) add r24 = r16, r23
+ nop.b 0
+ ;;
+ .pred.rel "mutex",p8,p9
+ getf.sig r19 = f37
+ xma.l f39 = f35, f6, f0
+ (p8) cmp.leu p6, p7 = r24, r16
+ st8 [rp] = r24, 8
+ xma.hu f43 = f35, f6, f0
+ (p9) cmp.ltu p6, p7 = r24, r16
+ ;;
+.LL01:
+ .pred.rel "mutex",p6,p7
+ getf.sig r23 = f41
+ (p6) add r24 = r17, r20, 1
+ nop.b 0
+ ldf8 f35 = [up], 8
+ (p7) add r24 = r17, r20
+ br.cloop.dptk .Loop
+C *** MAIN LOOP END ***
+ ;;
+
+.Lcj9:
+ .pred.rel "mutex",p6,p7
+ getf.sig r16 = f38
+ xma.l f36 = f32, f6, f0
+ (p6) cmp.leu p8, p9 = r24, r17
+ st8 [rp] = r24, 8
+ xma.hu f40 = f32, f6, f0
+ (p7) cmp.ltu p8, p9 = r24, r17
+ ;;
+ .pred.rel "mutex",p8,p9
+ getf.sig r20 = f42
+ (p8) add r24 = r18, r21, 1
+ (p9) add r24 = r18, r21
+ ;;
+ .pred.rel "mutex",p8,p9
+ getf.sig r17 = f39
+ xma.l f37 = f33, f6, f0
+ (p8) cmp.leu p6, p7 = r24, r18
+ st8 [rp] = r24, 8
+ xma.hu f41 = f33, f6, f0
+ (p9) cmp.ltu p6, p7 = r24, r18
+ ;;
+.Lcj8:
+ .pred.rel "mutex",p6,p7
+ getf.sig r21 = f43
+ (p6) add r24 = r19, r22, 1
+ (p7) add r24 = r19, r22
+ ;;
+ .pred.rel "mutex",p6,p7
+ getf.sig r18 = f36
+ xma.l f38 = f34, f6, f0
+ (p6) cmp.leu p8, p9 = r24, r19
+ st8 [rp] = r24, 8
+ xma.hu f42 = f34, f6, f0
+ (p7) cmp.ltu p8, p9 = r24, r19
+ ;;
+.Lcj7:
+ .pred.rel "mutex",p8,p9
+ getf.sig r22 = f40
+ (p8) add r24 = r16, r23, 1
+ (p9) add r24 = r16, r23
+ ;;
+ .pred.rel "mutex",p8,p9
+ getf.sig r19 = f37
+ xma.l f39 = f35, f6, f0
+ (p8) cmp.leu p6, p7 = r24, r16
+ st8 [rp] = r24, 8
+ xma.hu f43 = f35, f6, f0
+ (p9) cmp.ltu p6, p7 = r24, r16
+ ;;
+.Lcj6:
+ .pred.rel "mutex",p6,p7
+ getf.sig r23 = f41
+ (p6) add r24 = r17, r20, 1
+ (p7) add r24 = r17, r20
+ ;;
+ .pred.rel "mutex",p6,p7
+ (p6) cmp.leu p8, p9 = r24, r17
+ (p7) cmp.ltu p8, p9 = r24, r17
+ getf.sig r16 = f38
+ st8 [rp] = r24, 8
+ ;;
+.Lcj5:
+ .pred.rel "mutex",p8,p9
+ getf.sig r20 = f42
+ (p8) add r24 = r18, r21, 1
+ (p9) add r24 = r18, r21
+ ;;
+ .pred.rel "mutex",p8,p9
+ (p8) cmp.leu p6, p7 = r24, r18
+ (p9) cmp.ltu p6, p7 = r24, r18
+ getf.sig r17 = f39
+ st8 [rp] = r24, 8
+ ;;
+.Lcj4:
+ .pred.rel "mutex",p6,p7
+ getf.sig r8 = f43
+ (p6) add r24 = r19, r22, 1
+ (p7) add r24 = r19, r22
+ ;;
+ .pred.rel "mutex",p6,p7
+ st8 [rp] = r24, 8
+ (p6) cmp.leu p8, p9 = r24, r19
+ (p7) cmp.ltu p8, p9 = r24, r19
+ ;;
+.Lcj3:
+ .pred.rel "mutex",p8,p9
+ (p8) add r24 = r16, r23, 1
+ (p9) add r24 = r16, r23
+ ;;
+ .pred.rel "mutex",p8,p9
+ st8 [rp] = r24, 8
+ (p8) cmp.leu p6, p7 = r24, r16
+ (p9) cmp.ltu p6, p7 = r24, r16
+ ;;
+.Lcj2:
+ .pred.rel "mutex",p6,p7
+ (p6) add r24 = r17, r20, 1
+ (p7) add r24 = r17, r20
+ ;;
+ .pred.rel "mutex",p6,p7
+ st8 [rp] = r24, 8
+ (p6) cmp.leu p8, p9 = r24, r17
+ (p7) cmp.ltu p8, p9 = r24, r17
+ ;;
+ (p8) add r8 = 1, r8
+ mov.i ar.lc = r2
+ br.ret.sptk.many b0
+EPILOGUE()
+
+PROLOGUE(mpn_mul_1c)
+ .prologue
+ .save ar.lc, r2
+ .body
+
+ifdef(`HAVE_ABI_32',
+` addp4 rp = 0, rp C M I
+ addp4 up = 0, up C M I
+ zxt4 n = n C I
+ ;;
+')
+{.mmi
+ adds r15 = -1, n C M I
+ setf.sig f9 = cy C M2 M3
+ mov.i r2 = ar.lc C I0
+}
+{.mmb
+ ldf8 f7 = [up], 8 C M
+ and r14 = 3, n C M I
+ br.sptk .Lcommon
+ ;;
+}
+EPILOGUE()
+ASM_END()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/ia64/mul_2.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/ia64/mul_2.asm
new file mode 100644
index 00000000000..2bbce972673
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/ia64/mul_2.asm
@@ -0,0 +1,620 @@
+dnl IA-64 mpn_mul_2 -- Multiply a n-limb number with a 2-limb number and store
+dnl store the result to a (n+1)-limb number.
+
+dnl Contributed to the GNU project by Torbjorn Granlund.
+
+dnl Copyright 2004, 2011 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 Itanium: ?
+C Itanium 2: 1.5
+
+C TODO
+C * Clean up variable names, and try to decrease the number of distinct
+C registers used.
+C * Clean up feed-in code to not require zeroing several registers.
+C * Make sure we don't depend on uninitialized predicate registers.
+C * Could perhaps save a few cycles by using 1 c/l carry propagation in
+C wind-down code.
+C * Ultimately rewrite. The problem with this code is that it first uses a
+C loaded u value in one xma pair, then leaves it live over several unrelated
+C xma pairs, before it uses it again. It should actually be quite possible
+C to just swap some aligned xma pairs around. But we should then schedule
+C u loads further from the first use.
+
+C INPUT PARAMETERS
+define(`rp',`r32')
+define(`up',`r33')
+define(`n',`r34')
+define(`vp',`r35')
+
+define(`srp',`r3')
+
+define(`v0',`f6')
+define(`v1',`f7')
+
+define(`s0',`r14')
+define(`acc0',`r15')
+
+define(`pr0_0',`r16') define(`pr0_1',`r17')
+define(`pr0_2',`r18') define(`pr0_3',`r19')
+
+define(`pr1_0',`r20') define(`pr1_1',`r21')
+define(`pr1_2',`r22') define(`pr1_3',`r23')
+
+define(`acc1_0',`r24') define(`acc1_1',`r25')
+define(`acc1_2',`r26') define(`acc1_3',`r27')
+
+dnl define(`',`r28')
+dnl define(`',`r29')
+dnl define(`',`r30')
+dnl define(`',`r31')
+
+define(`fp0b_0',`f8') define(`fp0b_1',`f9')
+define(`fp0b_2',`f10') define(`fp0b_3',`f11')
+
+define(`fp1a_0',`f12') define(`fp1a_1',`f13')
+define(`fp1a_2',`f14') define(`fp1a_3',`f15')
+
+define(`fp1b_0',`f32') define(`fp1b_1',`f33')
+define(`fp1b_2',`f34') define(`fp1b_3',`f35')
+
+define(`fp2a_0',`f36') define(`fp2a_1',`f37')
+define(`fp2a_2',`f38') define(`fp2a_3',`f39')
+
+define(`u_0',`f44') define(`u_1',`f45')
+define(`u_2',`f46') define(`u_3',`f47')
+
+define(`ux',`f49')
+define(`uy',`f51')
+
+ASM_START()
+PROLOGUE(mpn_mul_2)
+ .prologue
+ .save ar.lc, r2
+ .body
+
+ifdef(`HAVE_ABI_32',`
+.mmi; addp4 rp = 0, rp C M I
+ addp4 up = 0, up C M I
+ addp4 vp = 0, vp C M I
+.mmi; nop 1
+ nop 1
+ zxt4 n = n C I
+ ;;')
+
+.mmi; ldf8 ux = [up], 8 C M
+ ldf8 v0 = [vp], 8 C M
+ mov r2 = ar.lc C I0
+.mmi; nop 1 C M
+ and r14 = 3, n C M I
+ add n = -2, n C M I
+ ;;
+.mmi; ldf8 uy = [up], 8 C M
+ ldf8 v1 = [vp] C M
+ shr.u n = n, 2 C I0
+.mmi; nop 1 C M
+ cmp.eq p10, p0 = 1, r14 C M I
+ cmp.eq p11, p0 = 2, r14 C M I
+ ;;
+.mmi; nop 1 C M
+ cmp.eq p12, p0 = 3, r14 C M I
+ mov ar.lc = n C I0
+.bbb; (p10) br.dptk L(b01) C B
+ (p11) br.dptk L(b10) C B
+ (p12) br.dptk L(b11) C B
+ ;;
+
+ ALIGN(32)
+L(b00): ldf8 u_1 = [up], 8
+ mov acc1_2 = 0
+ mov pr1_2 = 0
+ mov pr0_3 = 0
+ cmp.ne p8, p9 = r0, r0
+ ;;
+ xma.l fp0b_3 = ux, v0, f0
+ cmp.ne p12, p13 = r0, r0
+ ldf8 u_2 = [up], 8
+ xma.hu fp1a_3 = ux, v0, f0
+ br.cloop.dptk L(gt4)
+
+ xma.l fp0b_0 = uy, v0, f0
+ xma.hu fp1a_0 = uy, v0, f0
+ ;;
+ getfsig acc0 = fp0b_3
+ xma.l fp1b_3 = ux, v1, fp1a_3
+ xma.hu fp2a_3 = ux, v1, fp1a_3
+ ;;
+ xma.l fp0b_1 = u_1, v0, f0
+ xma.hu fp1a_1 = u_1, v0, f0
+ ;;
+ getfsig pr0_0 = fp0b_0
+ xma.l fp1b_0 = uy, v1, fp1a_0
+ xma.hu fp2a_0 = uy, v1, fp1a_0
+ ;;
+ getfsig pr1_3 = fp1b_3
+ getfsig acc1_3 = fp2a_3
+ xma.l fp0b_2 = u_2, v0, f0
+ xma.hu fp1a_2 = u_2, v0, f0
+ br L(cj4)
+
+L(gt4): xma.l fp0b_0 = uy, v0, f0
+ xma.hu fp1a_0 = uy, v0, f0
+ ;;
+ getfsig acc0 = fp0b_3
+ xma.l fp1b_3 = ux, v1, fp1a_3
+ ldf8 u_3 = [up], 8
+ xma.hu fp2a_3 = ux, v1, fp1a_3
+ ;;
+ xma.l fp0b_1 = u_1, v0, f0
+ xma.hu fp1a_1 = u_1, v0, f0
+ ;;
+ getfsig pr0_0 = fp0b_0
+ xma.l fp1b_0 = uy, v1, fp1a_0
+ xma.hu fp2a_0 = uy, v1, fp1a_0
+ ;;
+ ldf8 u_0 = [up], 8
+ getfsig pr1_3 = fp1b_3
+ xma.l fp0b_2 = u_2, v0, f0
+ ;;
+ getfsig acc1_3 = fp2a_3
+ xma.hu fp1a_2 = u_2, v0, f0
+ br L(00)
+
+
+ ALIGN(32)
+L(b01): ldf8 u_0 = [up], 8 C M
+ mov acc1_1 = 0 C M I
+ mov pr1_1 = 0 C M I
+ mov pr0_2 = 0 C M I
+ cmp.ne p6, p7 = r0, r0 C M I
+ ;;
+ xma.l fp0b_2 = ux, v0, f0 C F
+ cmp.ne p10, p11 = r0, r0 C M I
+ ldf8 u_1 = [up], 8 C M
+ xma.hu fp1a_2 = ux, v0, f0 C F
+ ;;
+ xma.l fp0b_3 = uy, v0, f0 C F
+ xma.hu fp1a_3 = uy, v0, f0 C F
+ ;;
+ getfsig acc0 = fp0b_2 C M
+ xma.l fp1b_2 = ux, v1,fp1a_2 C F
+ ldf8 u_2 = [up], 8 C M
+ xma.hu fp2a_2 = ux, v1,fp1a_2 C F
+ br.cloop.dptk L(gt5)
+
+ xma.l fp0b_0 = u_0, v0, f0 C F
+ xma.hu fp1a_0 = u_0, v0, f0 C F
+ ;;
+ getfsig pr0_3 = fp0b_3 C M
+ xma.l fp1b_3 = uy, v1,fp1a_3 C F
+ xma.hu fp2a_3 = uy, v1,fp1a_3 C F
+ ;;
+ getfsig pr1_2 = fp1b_2 C M
+ getfsig acc1_2 = fp2a_2 C M
+ xma.l fp0b_1 = u_1, v0, f0 C F
+ xma.hu fp1a_1 = u_1, v0, f0 C F
+ br L(cj5)
+
+L(gt5): xma.l fp0b_0 = u_0, v0, f0
+ xma.hu fp1a_0 = u_0, v0, f0
+ ;;
+ getfsig pr0_3 = fp0b_3
+ xma.l fp1b_3 = uy, v1, fp1a_3
+ xma.hu fp2a_3 = uy, v1, fp1a_3
+ ;;
+ ldf8 u_3 = [up], 8
+ getfsig pr1_2 = fp1b_2
+ xma.l fp0b_1 = u_1, v0, f0
+ ;;
+ getfsig acc1_2 = fp2a_2
+ xma.hu fp1a_1 = u_1, v0, f0
+ br L(01)
+
+
+ ALIGN(32)
+L(b10): br.cloop.dptk L(gt2)
+ xma.l fp0b_1 = ux, v0, f0
+ xma.hu fp1a_1 = ux, v0, f0
+ ;;
+ xma.l fp0b_2 = uy, v0, f0
+ xma.hu fp1a_2 = uy, v0, f0
+ ;;
+ stf8 [rp] = fp0b_1, 8
+ xma.l fp1b_1 = ux, v1, fp1a_1
+ xma.hu fp2a_1 = ux, v1, fp1a_1
+ ;;
+ getfsig acc0 = fp0b_2
+ xma.l fp1b_2 = uy, v1, fp1a_2
+ xma.hu fp2a_2 = uy, v1, fp1a_2
+ ;;
+ getfsig pr1_1 = fp1b_1
+ getfsig acc1_1 = fp2a_1
+ mov ar.lc = r2
+ getfsig pr1_2 = fp1b_2
+ getfsig r8 = fp2a_2
+ ;;
+ add s0 = pr1_1, acc0
+ ;;
+ st8 [rp] = s0, 8
+ cmp.ltu p8, p9 = s0, pr1_1
+ sub r31 = -1, acc1_1
+ ;;
+ .pred.rel "mutex", p8, p9
+ (p8) add acc0 = pr1_2, acc1_1, 1
+ (p9) add acc0 = pr1_2, acc1_1
+ (p8) cmp.leu p10, p0 = r31, pr1_2
+ (p9) cmp.ltu p10, p0 = r31, pr1_2
+ ;;
+ st8 [rp] = acc0, 8
+ (p10) add r8 = 1, r8
+ br.ret.sptk.many b0
+
+L(gt2): ldf8 u_3 = [up], 8
+ mov acc1_0 = 0
+ mov pr1_0 = 0
+ ;;
+ mov pr0_1 = 0
+ xma.l fp0b_1 = ux, v0, f0
+ ldf8 u_0 = [up], 8
+ xma.hu fp1a_1 = ux, v0, f0
+ ;;
+ xma.l fp0b_2 = uy, v0, f0
+ xma.hu fp1a_2 = uy, v0, f0
+ ;;
+ getfsig acc0 = fp0b_1
+ xma.l fp1b_1 = ux, v1, fp1a_1
+ xma.hu fp2a_1 = ux, v1, fp1a_1
+ ;;
+ ldf8 u_1 = [up], 8
+ xma.l fp0b_3 = u_3, v0, f0
+ xma.hu fp1a_3 = u_3, v0, f0
+ ;;
+ getfsig pr0_2 = fp0b_2
+ xma.l fp1b_2 = uy, v1, fp1a_2
+ xma.hu fp2a_2 = uy, v1, fp1a_2
+ ;;
+ ldf8 u_2 = [up], 8
+ getfsig pr1_1 = fp1b_1
+ ;;
+.mfi; getfsig acc1_1 = fp2a_1
+ xma.l fp0b_0 = u_0, v0, f0
+ cmp.ne p8, p9 = r0, r0
+.mfb; cmp.ne p12, p13 = r0, r0
+ xma.hu fp1a_0 = u_0, v0, f0
+ br L(10)
+
+
+ ALIGN(32)
+L(b11): mov acc1_3 = 0
+ mov pr1_3 = 0
+ mov pr0_0 = 0
+ ldf8 u_2 = [up], 8
+ cmp.ne p6, p7 = r0, r0
+ br.cloop.dptk L(gt3)
+ ;;
+ xma.l fp0b_0 = ux, v0, f0
+ xma.hu fp1a_0 = ux, v0, f0
+ ;;
+ cmp.ne p10, p11 = r0, r0
+ xma.l fp0b_1 = uy, v0, f0
+ xma.hu fp1a_1 = uy, v0, f0
+ ;;
+ getfsig acc0 = fp0b_0
+ xma.l fp1b_0 = ux, v1, fp1a_0
+ xma.hu fp2a_0 = ux, v1, fp1a_0
+ ;;
+ xma.l fp0b_2 = u_2, v0, f0
+ xma.hu fp1a_2 = u_2, v0, f0
+ ;;
+ getfsig pr0_1 = fp0b_1
+ xma.l fp1b_1 = uy, v1, fp1a_1
+ xma.hu fp2a_1 = uy, v1, fp1a_1
+ ;;
+ getfsig pr1_0 = fp1b_0
+ getfsig acc1_0 = fp2a_0
+ br L(cj3)
+
+L(gt3): xma.l fp0b_0 = ux, v0, f0
+ cmp.ne p10, p11 = r0, r0
+ ldf8 u_3 = [up], 8
+ xma.hu fp1a_0 = ux, v0, f0
+ ;;
+ xma.l fp0b_1 = uy, v0, f0
+ xma.hu fp1a_1 = uy, v0, f0
+ ;;
+ getfsig acc0 = fp0b_0
+ xma.l fp1b_0 = ux, v1, fp1a_0
+ ldf8 u_0 = [up], 8
+ xma.hu fp2a_0 = ux, v1, fp1a_0
+ ;;
+ xma.l fp0b_2 = u_2, v0, f0
+ xma.hu fp1a_2 = u_2, v0, f0
+ ;;
+ getfsig pr0_1 = fp0b_1
+ xma.l fp1b_1 = uy, v1, fp1a_1
+ xma.hu fp2a_1 = uy, v1, fp1a_1
+ ;;
+ ldf8 u_1 = [up], 8
+ getfsig pr1_0 = fp1b_0
+ ;;
+ getfsig acc1_0 = fp2a_0
+ xma.l fp0b_3 = u_3, v0, f0
+ xma.hu fp1a_3 = u_3, v0, f0
+ br L(11)
+
+
+C *** MAIN LOOP START ***
+ ALIGN(32)
+L(top): C 00
+ .pred.rel "mutex", p8, p9
+ .pred.rel "mutex", p12, p13
+ ldf8 u_3 = [up], 8
+ getfsig pr1_2 = fp1b_2
+ (p8) cmp.leu p6, p7 = acc0, pr0_1
+ (p9) cmp.ltu p6, p7 = acc0, pr0_1
+ (p12) cmp.leu p10, p11 = s0, pr1_0
+ (p13) cmp.ltu p10, p11 = s0, pr1_0
+ ;; C 01
+ .pred.rel "mutex", p6, p7
+ getfsig acc1_2 = fp2a_2
+ st8 [rp] = s0, 8
+ xma.l fp0b_1 = u_1, v0, f0
+ (p6) add acc0 = pr0_2, acc1_0, 1
+ (p7) add acc0 = pr0_2, acc1_0
+ xma.hu fp1a_1 = u_1, v0, f0
+ ;; C 02
+L(01):
+ .pred.rel "mutex", p10, p11
+ getfsig pr0_0 = fp0b_0
+ xma.l fp1b_0 = u_0, v1, fp1a_0
+ (p10) add s0 = pr1_1, acc0, 1
+ (p11) add s0 = pr1_1, acc0
+ xma.hu fp2a_0 = u_0, v1, fp1a_0
+ nop 1
+ ;; C 03
+ .pred.rel "mutex", p6, p7
+ .pred.rel "mutex", p10, p11
+ ldf8 u_0 = [up], 8
+ getfsig pr1_3 = fp1b_3
+ (p6) cmp.leu p8, p9 = acc0, pr0_2
+ (p7) cmp.ltu p8, p9 = acc0, pr0_2
+ (p10) cmp.leu p12, p13 = s0, pr1_1
+ (p11) cmp.ltu p12, p13 = s0, pr1_1
+ ;; C 04
+ .pred.rel "mutex", p8, p9
+ getfsig acc1_3 = fp2a_3
+ st8 [rp] = s0, 8
+ xma.l fp0b_2 = u_2, v0, f0
+ (p8) add acc0 = pr0_3, acc1_1, 1
+ (p9) add acc0 = pr0_3, acc1_1
+ xma.hu fp1a_2 = u_2, v0, f0
+ ;; C 05
+L(00):
+ .pred.rel "mutex", p12, p13
+ getfsig pr0_1 = fp0b_1
+ xma.l fp1b_1 = u_1, v1, fp1a_1
+ (p12) add s0 = pr1_2, acc0, 1
+ (p13) add s0 = pr1_2, acc0
+ xma.hu fp2a_1 = u_1, v1, fp1a_1
+ nop 1
+ ;; C 06
+ .pred.rel "mutex", p8, p9
+ .pred.rel "mutex", p12, p13
+ ldf8 u_1 = [up], 8
+ getfsig pr1_0 = fp1b_0
+ (p8) cmp.leu p6, p7 = acc0, pr0_3
+ (p9) cmp.ltu p6, p7 = acc0, pr0_3
+ (p12) cmp.leu p10, p11 = s0, pr1_2
+ (p13) cmp.ltu p10, p11 = s0, pr1_2
+ ;; C 07
+ .pred.rel "mutex", p6, p7
+ getfsig acc1_0 = fp2a_0
+ st8 [rp] = s0, 8
+ xma.l fp0b_3 = u_3, v0, f0
+ (p6) add acc0 = pr0_0, acc1_2, 1
+ (p7) add acc0 = pr0_0, acc1_2
+ xma.hu fp1a_3 = u_3, v0, f0
+ ;; C 08
+L(11):
+ .pred.rel "mutex", p10, p11
+ getfsig pr0_2 = fp0b_2
+ xma.l fp1b_2 = u_2, v1, fp1a_2
+ (p10) add s0 = pr1_3, acc0, 1
+ (p11) add s0 = pr1_3, acc0
+ xma.hu fp2a_2 = u_2, v1, fp1a_2
+ nop 1
+ ;; C 09
+ .pred.rel "mutex", p6, p7
+ .pred.rel "mutex", p10, p11
+ ldf8 u_2 = [up], 8
+ getfsig pr1_1 = fp1b_1
+ (p6) cmp.leu p8, p9 = acc0, pr0_0
+ (p7) cmp.ltu p8, p9 = acc0, pr0_0
+ (p10) cmp.leu p12, p13 = s0, pr1_3
+ (p11) cmp.ltu p12, p13 = s0, pr1_3
+ ;; C 10
+ .pred.rel "mutex", p8, p9
+ getfsig acc1_1 = fp2a_1
+ st8 [rp] = s0, 8
+ xma.l fp0b_0 = u_0, v0, f0
+ (p8) add acc0 = pr0_1, acc1_3, 1
+ (p9) add acc0 = pr0_1, acc1_3
+ xma.hu fp1a_0 = u_0, v0, f0
+ ;; C 11
+L(10):
+ .pred.rel "mutex", p12, p13
+ getfsig pr0_3 = fp0b_3
+ xma.l fp1b_3 = u_3, v1, fp1a_3
+ (p12) add s0 = pr1_0, acc0, 1
+ (p13) add s0 = pr1_0, acc0
+ xma.hu fp2a_3 = u_3, v1, fp1a_3
+ br.cloop.dptk L(top)
+ ;;
+C *** MAIN LOOP END ***
+
+ .pred.rel "mutex", p8, p9
+ .pred.rel "mutex", p12, p13
+.mmi; getfsig pr1_2 = fp1b_2
+ st8 [rp] = s0, 8
+ (p8) cmp.leu p6, p7 = acc0, pr0_1
+.mmi; (p9) cmp.ltu p6, p7 = acc0, pr0_1
+ (p12) cmp.leu p10, p11 = s0, pr1_0
+ (p13) cmp.ltu p10, p11 = s0, pr1_0
+ ;;
+ .pred.rel "mutex", p6, p7
+.mfi; getfsig acc1_2 = fp2a_2
+ xma.l fp0b_1 = u_1, v0, f0
+ nop 1
+.mmf; (p6) add acc0 = pr0_2, acc1_0, 1
+ (p7) add acc0 = pr0_2, acc1_0
+ xma.hu fp1a_1 = u_1, v0, f0
+ ;;
+L(cj5):
+ .pred.rel "mutex", p10, p11
+.mfi; getfsig pr0_0 = fp0b_0
+ xma.l fp1b_0 = u_0, v1, fp1a_0
+ (p10) add s0 = pr1_1, acc0, 1
+.mfi; (p11) add s0 = pr1_1, acc0
+ xma.hu fp2a_0 = u_0, v1, fp1a_0
+ nop 1
+ ;;
+ .pred.rel "mutex", p6, p7
+ .pred.rel "mutex", p10, p11
+.mmi; getfsig pr1_3 = fp1b_3
+ st8 [rp] = s0, 8
+ (p6) cmp.leu p8, p9 = acc0, pr0_2
+.mmi; (p7) cmp.ltu p8, p9 = acc0, pr0_2
+ (p10) cmp.leu p12, p13 = s0, pr1_1
+ (p11) cmp.ltu p12, p13 = s0, pr1_1
+ ;;
+ .pred.rel "mutex", p8, p9
+.mfi; getfsig acc1_3 = fp2a_3
+ xma.l fp0b_2 = u_2, v0, f0
+ nop 1
+.mmf; (p8) add acc0 = pr0_3, acc1_1, 1
+ (p9) add acc0 = pr0_3, acc1_1
+ xma.hu fp1a_2 = u_2, v0, f0
+ ;;
+L(cj4):
+ .pred.rel "mutex", p12, p13
+.mfi; getfsig pr0_1 = fp0b_1
+ xma.l fp1b_1 = u_1, v1, fp1a_1
+ (p12) add s0 = pr1_2, acc0, 1
+.mfi; (p13) add s0 = pr1_2, acc0
+ xma.hu fp2a_1 = u_1, v1, fp1a_1
+ nop 1
+ ;;
+ .pred.rel "mutex", p8, p9
+ .pred.rel "mutex", p12, p13
+.mmi; getfsig pr1_0 = fp1b_0
+ st8 [rp] = s0, 8
+ (p8) cmp.leu p6, p7 = acc0, pr0_3
+.mmi; (p9) cmp.ltu p6, p7 = acc0, pr0_3
+ (p12) cmp.leu p10, p11 = s0, pr1_2
+ (p13) cmp.ltu p10, p11 = s0, pr1_2
+ ;;
+ .pred.rel "mutex", p6, p7
+.mmi; getfsig acc1_0 = fp2a_0
+ (p6) add acc0 = pr0_0, acc1_2, 1
+ (p7) add acc0 = pr0_0, acc1_2
+ ;;
+L(cj3):
+ .pred.rel "mutex", p10, p11
+.mfi; getfsig pr0_2 = fp0b_2
+ xma.l fp1b_2 = u_2, v1, fp1a_2
+ (p10) add s0 = pr1_3, acc0, 1
+.mfi; (p11) add s0 = pr1_3, acc0
+ xma.hu fp2a_2 = u_2, v1, fp1a_2
+ nop 1
+ ;;
+ .pred.rel "mutex", p6, p7
+ .pred.rel "mutex", p10, p11
+.mmi; getfsig pr1_1 = fp1b_1
+ st8 [rp] = s0, 8
+ (p6) cmp.leu p8, p9 = acc0, pr0_0
+.mmi; (p7) cmp.ltu p8, p9 = acc0, pr0_0
+ (p10) cmp.leu p12, p13 = s0, pr1_3
+ (p11) cmp.ltu p12, p13 = s0, pr1_3
+ ;;
+ .pred.rel "mutex", p8, p9
+.mmi; getfsig acc1_1 = fp2a_1
+ (p8) add acc0 = pr0_1, acc1_3, 1
+ (p9) add acc0 = pr0_1, acc1_3
+ ;;
+ .pred.rel "mutex", p12, p13
+.mmi; (p12) add s0 = pr1_0, acc0, 1
+ (p13) add s0 = pr1_0, acc0
+ nop 1
+ ;;
+ .pred.rel "mutex", p8, p9
+ .pred.rel "mutex", p12, p13
+.mmi; getfsig pr1_2 = fp1b_2
+ st8 [rp] = s0, 8
+ (p8) cmp.leu p6, p7 = acc0, pr0_1
+.mmi; (p9) cmp.ltu p6, p7 = acc0, pr0_1
+ (p12) cmp.leu p10, p11 = s0, pr1_0
+ (p13) cmp.ltu p10, p11 = s0, pr1_0
+ ;;
+ .pred.rel "mutex", p6, p7
+.mmi; getfsig r8 = fp2a_2
+ (p6) add acc0 = pr0_2, acc1_0, 1
+ (p7) add acc0 = pr0_2, acc1_0
+ ;;
+ .pred.rel "mutex", p10, p11
+.mmi; (p10) add s0 = pr1_1, acc0, 1
+ (p11) add s0 = pr1_1, acc0
+ (p6) cmp.leu p8, p9 = acc0, pr0_2
+ ;;
+ .pred.rel "mutex", p10, p11
+.mmi; (p7) cmp.ltu p8, p9 = acc0, pr0_2
+ (p10) cmp.leu p12, p13 = s0, pr1_1
+ (p11) cmp.ltu p12, p13 = s0, pr1_1
+ ;;
+ .pred.rel "mutex", p8, p9
+.mmi; st8 [rp] = s0, 8
+ (p8) add acc0 = pr1_2, acc1_1, 1
+ (p9) add acc0 = pr1_2, acc1_1
+ ;;
+ .pred.rel "mutex", p8, p9
+.mmi; (p8) cmp.leu p10, p11 = acc0, pr1_2
+ (p9) cmp.ltu p10, p11 = acc0, pr1_2
+ (p12) add acc0 = 1, acc0
+ ;;
+.mmi; st8 [rp] = acc0, 8
+ (p12) cmpeqor p10, p0 = 0, acc0
+ nop 1
+ ;;
+.mib; (p10) add r8 = 1, r8
+ mov ar.lc = r2
+ br.ret.sptk.many b0
+EPILOGUE()
+ASM_END()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/ia64/popcount.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/ia64/popcount.asm
new file mode 100644
index 00000000000..c0b5c5c1cfa
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/ia64/popcount.asm
@@ -0,0 +1,200 @@
+dnl IA-64 mpn_popcount -- mpn population count.
+
+dnl Contributed to the GNU project by Torbjorn Granlund.
+
+dnl Copyright 2000-2005 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 Itanium: 1.5
+C Itanium 2: 1
+
+C INPUT PARAMETERS
+define(`up', `r32')
+define(`n', `r33')
+
+define(`u0',`r16') define(`u1',`r17') define(`u2',`r18') define(`u3',`r19')
+define(`c0',`r28') define(`c1',`r29') define(`c2',`r30') define(`c3',`r31')
+define(`s',`r8')
+
+
+ASM_START()
+PROLOGUE(mpn_popcount)
+ .prologue
+ifdef(`HAVE_ABI_32',
+` addp4 up = 0, up C M I
+ nop.m 0
+ zxt4 n = n C I
+ ;;
+')
+
+ {.mmi; add r9 = 512, up C prefetch pointer M I
+ ld8 r10 = [up], 8 C load first limb M01
+ mov.i r2 = ar.lc C save ar.lc I0
+}{.mmi; and r14 = 3, n C M I
+ cmp.lt p15, p14 = 4, n C small count? M I
+ add n = -5, n C M I
+ ;;
+}{.mmi; cmp.eq p6, p0 = 1, r14 C M I
+ cmp.eq p7, p0 = 2, r14 C M I
+ cmp.eq p8, p0 = 3, r14 C M I
+}{.bbb
+ (p6) br.dptk .Lb01 C B
+ (p7) br.dptk .Lb10 C B
+ (p8) br.dptk .Lb11 C B
+}
+
+
+.Lb00: ld8 u1 = [up], 8 C M01
+ shr.u n = n, 2 C I0
+ mov s = 0 C M I
+ ;;
+ ld8 u2 = [up], 8 C M01
+ popcnt c0 = r10 C I0
+ mov.i ar.lc = n C I0
+ ;;
+ ld8 u3 = [up], 8 C M01
+ popcnt c1 = u1 C I0
+ (p15) br.cond.dptk .grt4 C B
+ ;;
+ nop.m 0 C -
+ nop.m 0 C -
+ popcnt c2 = u2 C I0
+ ;;
+ mov s = c0 C M I
+ popcnt c3 = u3 C I0
+ br .Lcj4 C B
+
+.grt4: ld8 u0 = [up], 8 C M01
+ popcnt c2 = u2 C I0
+ br .LL00 C B
+
+
+.Lb01:
+ popcnt s = r10 C I0
+ (p14) br.ret.sptk.many b0 C B
+
+.grt1: ld8 u0 = [up], 8 C M01
+ shr.u n = n, 2 C I0
+ ;;
+ ld8 u1 = [up], 8 C M01
+ mov.i ar.lc = n C I0
+ ;;
+ ld8 u2 = [up], 8 C M01
+ popcnt c0 = u0 C I0
+ mov c3 = 0 C I0
+
+ ;;
+ ld8 u3 = [up], 8 C M01
+ popcnt c1 = u1 C I0
+ br.cloop.dptk .Loop C B
+ br .Lend C B
+
+
+.Lb10: ld8 u3 = [up], 8 C M01
+ shr.u n = n, 2 C I0
+ (p15) br.cond.dptk .grt2 C B
+
+ popcnt s = r10 C I0
+ ;;
+ popcnt c3 = u3 C I0
+ br .Lcj2 C B
+
+.grt2: ld8 u0 = [up], 8 C M01
+ mov.i ar.lc = n C I0
+ popcnt c2 = r10 C I0
+ ;;
+ ld8 u1 = [up], 8 C M01
+ popcnt c3 = u3 C I0
+ mov s = 0 C M I
+ ;;
+ ld8 u2 = [up], 8 C M01
+ popcnt c0 = u0 C I0
+ br .LL10 C B
+
+
+.Lb11: ld8 u2 = [up], 8 C M01
+ shr.u n = n, 2 C I0
+ mov s = 0 C M I
+ ;;
+ ld8 u3 = [up], 8 C M01
+ popcnt s = r10 C I0
+ (p15) br.cond.dptk .grt3 C B
+
+ popcnt c2 = u2 C I0
+ ;;
+ popcnt c3 = u3 C I0
+ br .Lcj3 C B
+
+.grt3: ld8 u0 = [up], 8 C M01
+ popcnt c2 = u2 C I0
+ mov.i ar.lc = n C I0
+ mov c1 = 0
+ ;;
+ ld8 u1 = [up], 8 C M01
+ popcnt c3 = u3 C I0
+ br .LL11 C B
+
+
+.Loop: ld8 u0 = [up], 8 C M01
+ popcnt c2 = u2 C I0
+ add s = s, c3 C M I
+ ;;
+.LL00: ld8 u1 = [up], 8 C M01
+ popcnt c3 = u3 C I0
+ add s = s, c0 C M I
+ ;;
+.LL11: ld8 u2 = [up], 8 C M01
+ popcnt c0 = u0 C I0
+ add s = s, c1 C M I
+ ;;
+.LL10: ld8 u3 = [up], 8 C M01
+ popcnt c1 = u1 C I0
+ add s = s, c2 C M I
+ lfetch [r9], 32 C M01
+ nop.m 0 C -
+ br.cloop.dptk .Loop C B
+ ;;
+
+.Lend: popcnt c2 = u2 C I0
+ add s = s, c3 C M I
+ ;;
+ popcnt c3 = u3 C I0
+ add s = s, c0 C M I
+ ;;
+.Lcj4: add s = s, c1 C M I
+ ;;
+.Lcj3: add s = s, c2 C M I
+ ;;
+.Lcj2: add s = s, c3 C M I
+ mov.i ar.lc = r2 C I0
+ br.ret.sptk.many b0 C B
+EPILOGUE()
+ASM_END()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/ia64/rsh1aors_n.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/ia64/rsh1aors_n.asm
new file mode 100644
index 00000000000..3c7defb0bae
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/ia64/rsh1aors_n.asm
@@ -0,0 +1,447 @@
+dnl IA-64 mpn_rsh1add_n/mpn_rsh1sub_n -- rp[] = (up[] +- vp[]) >> 1.
+
+dnl Contributed to the GNU project by Torbjorn Granlund.
+
+dnl Copyright 2003-2005 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 Itanium: 2.5
+C Itanium 2: 1.5
+
+C TODO
+C * Rewrite function entry code using aorslsh1_n.asm style.
+C * Micro-optimize feed-in and wind-down code.
+
+C INPUT PARAMETERS
+define(`rp',`r32')
+define(`up',`r33')
+define(`vp',`r34')
+define(`n',`r35')
+
+ifdef(`OPERATION_rsh1add_n',`
+ define(ADDSUB, add)
+ define(PRED, ltu)
+ define(INCR, 1)
+ define(LIM, -1)
+ define(func, mpn_rsh1add_n)
+')
+ifdef(`OPERATION_rsh1sub_n',`
+ define(ADDSUB, sub)
+ define(PRED, gtu)
+ define(INCR, -1)
+ define(LIM, 0)
+ define(func, mpn_rsh1sub_n)
+')
+
+C Some useful aliases for registers we use
+define(`u0',`r14') define(`u1',`r15') define(`u2',`r16') define(`u3',`r17')
+define(`v0',`r18') define(`v1',`r19') define(`v2',`r20') define(`v3',`r21')
+define(`w0',`r22') define(`w1',`r23') define(`w2',`r24') define(`w3',`r25')
+define(`x0',`r26') define(`x1',`r9') define(`x2',`r30') define(`x3',`r31')
+
+MULFUNC_PROLOGUE(mpn_rsh1add_n mpn_rsh1sub_n)
+
+ASM_START()
+PROLOGUE(func)
+ .prologue
+ .save ar.lc, r2
+ .body
+ifdef(`HAVE_ABI_32',`
+ addp4 rp = 0, rp C M I
+ addp4 up = 0, up C M I
+ addp4 vp = 0, vp C M I
+ nop.m 0
+ nop.m 0
+ zxt4 n = n C I
+ ;;
+')
+ {.mmi; ld8 r11 = [vp], 8 C M01
+ ld8 r10 = [up], 8 C M01
+ mov.i r2 = ar.lc C I0
+}{.mmi; and r14 = 3, n C M I
+ cmp.lt p15, p0 = 4, n C M I
+ add n = -4, n C M I
+ ;;
+}{.mmi; cmp.eq p6, p0 = 1, r14 C M I
+ cmp.eq p7, p0 = 2, r14 C M I
+ cmp.eq p8, p0 = 3, r14 C M I
+}{.bbb
+ (p6) br.dptk .Lb01 C B
+ (p7) br.dptk .Lb10 C B
+ (p8) br.dptk .Lb11 C B
+}
+
+.Lb00: ld8 v0 = [vp], 8 C M01
+ ld8 u0 = [up], 8 C M01
+ shr.u n = n, 2 C I0
+ ;;
+ ld8 v1 = [vp], 8 C M01
+ ld8 u1 = [up], 8 C M01
+ ADDSUB w3 = r10, r11 C M I
+ ;;
+ ld8 v2 = [vp], 8 C M01
+ ld8 u2 = [up], 8 C M01
+ (p15) br.dpnt .grt4 C B
+ ;;
+
+ cmp.PRED p7, p0 = w3, r10 C M I
+ and r8 = 1, w3 C M I
+ ADDSUB w0 = u0, v0 C M I
+ ;;
+ cmp.PRED p8, p0 = w0, u0 C M I
+ ADDSUB w1 = u1, v1 C M I
+ ;;
+ cmp.PRED p9, p0 = w1, u1 C M I
+ (p7) cmp.eq.or p8, p0 = LIM, w0 C M I
+ (p7) add w0 = INCR, w0 C M I
+ ;;
+ shrp x3 = w0, w3, 1 C I0
+ ADDSUB w2 = u2, v2 C M I
+ (p8) cmp.eq.or p9, p0 = LIM, w1 C M I
+ (p8) add w1 = INCR, w1 C M I
+ br .Lcj4 C B
+
+.grt4: ld8 v3 = [vp], 8 C M01
+ cmp.PRED p7, p0 = w3, r10 C M I
+ ld8 u3 = [up], 8 C M01
+ and r8 = 1, w3 C M I
+ ;;
+ ADDSUB w0 = u0, v0 C M I
+ ld8 v0 = [vp], 8 C M01
+ add n = -1, n
+ ;;
+ cmp.PRED p8, p0 = w0, u0 C M I
+ ld8 u0 = [up], 8 C M01
+ ADDSUB w1 = u1, v1 C M I
+ ;;
+ ld8 v1 = [vp], 8 C M01
+ mov.i ar.lc = n C I0
+ cmp.PRED p9, p0 = w1, u1 C M I
+ ld8 u1 = [up], 8 C M01
+ (p7) cmp.eq.or p8, p0 = LIM, w0 C M I
+ (p7) add w0 = INCR, w0 C M I
+ ;;
+ ADDSUB w2 = u2, v2 C M I
+ ld8 v2 = [vp], 8 C M01
+ shrp x3 = w0, w3, 1 C I0
+ (p8) cmp.eq.or p9, p0 = LIM, w1 C M I
+ (p8) add w1 = INCR, w1 C M I
+ br .LL00 C B
+
+
+.Lb01: ADDSUB w2 = r10, r11 C M I
+ shr.u n = n, 2 C I0
+ (p15) br.dpnt .grt1 C B
+ ;;
+
+ cmp.PRED p6, p7 = w2, r10 C M I
+ shr.u x2 = w2, 1 C I0
+ and r8 = 1, w2 C M I
+ ;;
+ (p6) dep x2 = -1, x2, 63, 1 C I0
+ br .Lcj1 C B
+
+.grt1: ld8 v3 = [vp], 8 C M01
+ ld8 u3 = [up], 8 C M01
+ ;;
+ ld8 v0 = [vp], 8 C M01
+ ld8 u0 = [up], 8 C M01
+ mov.i ar.lc = n C FIXME swap with next I0
+ ;;
+ ld8 v1 = [vp], 8 C M01
+ ld8 u1 = [up], 8 C M01
+ ;;
+ ld8 v2 = [vp], 8 C M01
+ ld8 u2 = [up], 8 C M01
+ cmp.PRED p6, p0 = w2, r10 C M I
+ and r8 = 1, w2 C M I
+ ADDSUB w3 = u3, v3 C M I
+ br.cloop.dptk .grt5 C B
+ ;;
+
+ cmp.PRED p7, p0 = w3, u3 C M I
+ ;;
+ ADDSUB w0 = u0, v0 C M I
+ (p6) cmp.eq.or p7, p0 = LIM, w3 C M I
+ (p6) add w3 = INCR, w3 C M I
+ ;;
+ cmp.PRED p8, p0 = w0, u0 C M I
+ shrp x2 = w3, w2, 1 C I0
+ ADDSUB w1 = u1, v1 C M I
+ ;;
+ cmp.PRED p9, p0 = w1, u1 C M I
+ (p7) cmp.eq.or p8, p0 = LIM, w0 C M I
+ (p7) add w0 = INCR, w0 C M I
+ br .Lcj5 C B
+
+.grt5: ld8 v3 = [vp], 8 C M01
+ cmp.PRED p7, p0 = w3, u3 C M I
+ ld8 u3 = [up], 8 C M01
+ ;;
+ ADDSUB w0 = u0, v0 C M I
+ ld8 v0 = [vp], 8 C M01
+ (p6) cmp.eq.or p7, p0 = LIM, w3 C M I
+ (p6) add w3 = INCR, w3 C M I
+ ;;
+ cmp.PRED p8, p0 = w0, u0 C M I
+ shrp x2 = w3, w2, 1 C I0
+ ld8 u0 = [up], 8 C M01
+ ADDSUB w1 = u1, v1 C M I
+ ;;
+ ld8 v1 = [vp], 8 C M01
+ cmp.PRED p9, p0 = w1, u1 C M I
+ ld8 u1 = [up], 8 C M01
+ (p7) cmp.eq.or p8, p0 = LIM, w0 C M I
+ (p7) add w0 = INCR, w0 C M I
+ br .LL01 C B
+
+
+.Lb10: ld8 v2 = [vp], 8 C M01
+ ld8 u2 = [up], 8 C M01
+ shr.u n = n, 2 C I0
+ ADDSUB w1 = r10, r11 C M I
+ (p15) br.dpnt .grt2 C B
+ ;;
+
+ cmp.PRED p9, p0 = w1, r10 C M I
+ and r8 = 1, w1 C M I
+ ADDSUB w2 = u2, v2 C M I
+ ;;
+ cmp.PRED p6, p0 = w2, u2 C M I
+ ;;
+ (p9) cmp.eq.or p6, p0 = LIM, w2 C M I
+ (p9) add w2 = INCR, w2 C M I
+ ;;
+ shrp x1 = w2, w1, 1 C I0
+ shr.u x2 = w2, 1 C I0
+ br .Lcj2 C B
+
+.grt2: ld8 v3 = [vp], 8 C M01
+ ld8 u3 = [up], 8 C M01
+ ;;
+ ld8 v0 = [vp], 8 C M01
+ ld8 u0 = [up], 8 C M01
+ mov.i ar.lc = n C I0
+ ;;
+ ld8 v1 = [vp], 8 C M01
+ cmp.PRED p9, p0 = w1, r10 C M I
+ ld8 u1 = [up], 8 C M01
+ and r8 = 1, w1 C M I
+ ;;
+ ADDSUB w2 = u2, v2 C M I
+ ld8 v2 = [vp], 8 C M01
+ ;;
+ cmp.PRED p6, p0 = w2, u2 C M I
+ ld8 u2 = [up], 8 C M01
+ ADDSUB w3 = u3, v3 C M I
+ br.cloop.dptk .grt6 C B
+ ;;
+
+ cmp.PRED p7, p0 = w3, u3 C M I
+ (p9) cmp.eq.or p6, p0 = LIM, w2 C M I
+ (p9) add w2 = INCR, w2 C M I
+ ;;
+ shrp x1 = w2, w1, 1 C I0
+ ADDSUB w0 = u0, v0 C M I
+ (p6) cmp.eq.or p7, p0 = LIM, w3 C M I
+ (p6) add w3 = INCR, w3 C M I
+ br .Lcj6 C B
+
+.grt6: ld8 v3 = [vp], 8 C M01
+ cmp.PRED p7, p0 = w3, u3 C M I
+ ld8 u3 = [up], 8 C M01
+ (p9) cmp.eq.or p6, p0 = LIM, w2 C M I
+ (p9) add w2 = INCR, w2 C M I
+ ;;
+ shrp x1 = w2, w1, 1 C I0
+ ADDSUB w0 = u0, v0 C M I
+ ld8 v0 = [vp], 8 C M01
+ (p6) cmp.eq.or p7, p0 = LIM, w3 C M I
+ (p6) add w3 = INCR, w3 C M I
+ br .LL10 C B
+
+
+.Lb11: ld8 v1 = [vp], 8 C M01
+ ld8 u1 = [up], 8 C M01
+ shr.u n = n, 2 C I0
+ ;;
+ ld8 v2 = [vp], 8 C M01
+ ld8 u2 = [up], 8 C M01
+ ADDSUB w0 = r10, r11 C M I
+ (p15) br.dpnt .grt3 C B
+ ;;
+
+ cmp.PRED p8, p0 = w0, r10 C M I
+ ADDSUB w1 = u1, v1 C M I
+ and r8 = 1, w0 C M I
+ ;;
+ cmp.PRED p9, p0 = w1, u1 C M I
+ ;;
+ ADDSUB w2 = u2, v2 C M I
+ (p8) cmp.eq.or p9, p0 = LIM, w1 C M I
+ (p8) add w1 = INCR, w1 C M I
+ ;;
+ cmp.PRED p6, p0 = w2, u2 C M I
+ shrp x0 = w1, w0, 1 C I0
+ ;;
+ (p9) cmp.eq.or p6, p0 = LIM, w2 C M I
+ (p9) add w2 = INCR, w2 C M I
+ br .Lcj3 C B
+
+.grt3: ld8 v3 = [vp], 8 C M01
+ ld8 u3 = [up], 8 C M01
+ ;;
+ ld8 v0 = [vp], 8 C M01
+ mov.i ar.lc = n C I0
+ cmp.PRED p8, p0 = w0, r10 C M I
+ ld8 u0 = [up], 8 C M01
+ ADDSUB w1 = u1, v1 C M I
+ and r8 = 1, w0 C M I
+ ;;
+ ld8 v1 = [vp], 8 C M01
+ cmp.PRED p9, p0 = w1, u1 C M I
+ ld8 u1 = [up], 8 C M01
+ ;;
+ ADDSUB w2 = u2, v2 C M I
+ ld8 v2 = [vp], 8 C M01
+ (p8) cmp.eq.or p9, p0 = LIM, w1 C M I
+ (p8) add w1 = INCR, w1 C M I
+ ;;
+ cmp.PRED p6, p0 = w2, u2 C M I
+ shrp x0 = w1, w0, 1 C I0
+ ld8 u2 = [up], 8 C M01
+ ADDSUB w3 = u3, v3 C M I
+ br.cloop.dptk .grt7 C B
+ ;;
+
+ cmp.PRED p7, p0 = w3, u3 C M I
+ (p9) cmp.eq.or p6, p0 = LIM, w2 C M I
+ (p9) add w2 = INCR, w2 C M I
+ br .Lcj7 C B
+
+.grt7: ld8 v3 = [vp], 8 C M01
+ cmp.PRED p7, p0 = w3, u3 C M I
+ ld8 u3 = [up], 8 C M01
+ (p9) cmp.eq.or p6, p0 = LIM, w2 C M I
+ (p9) add w2 = INCR, w2 C M I
+ br .LL11 C B
+
+
+C *** MAIN LOOP START ***
+ ALIGN(32)
+.Loop: st8 [rp] = x3, 8 C M23
+ ld8 v3 = [vp], 8 C M01
+ cmp.PRED p7, p0 = w3, u3 C M I
+ ld8 u3 = [up], 8 C M01
+ (p9) cmp.eq.or p6, p0 = LIM, w2 C M I
+ (p9) add w2 = INCR, w2 C M I
+ ;;
+.LL11: st8 [rp] = x0, 8 C M23
+ shrp x1 = w2, w1, 1 C I0
+ ADDSUB w0 = u0, v0 C M I
+ ld8 v0 = [vp], 8 C M01
+ (p6) cmp.eq.or p7, p0 = LIM, w3 C M I
+ (p6) add w3 = INCR, w3 C M I
+ ;;
+.LL10: cmp.PRED p8, p0 = w0, u0 C M I
+ shrp x2 = w3, w2, 1 C I0
+ nop.b 0
+ ld8 u0 = [up], 8 C M01
+ ADDSUB w1 = u1, v1 C M I
+ nop.b 0
+ ;;
+ st8 [rp] = x1, 8 C M23
+ ld8 v1 = [vp], 8 C M01
+ cmp.PRED p9, p0 = w1, u1 C M I
+ ld8 u1 = [up], 8 C M01
+ (p7) cmp.eq.or p8, p0 = LIM, w0 C M I
+ (p7) add w0 = INCR, w0 C M I
+ ;;
+.LL01: st8 [rp] = x2, 8 C M23
+ shrp x3 = w0, w3, 1 C I0
+ ADDSUB w2 = u2, v2 C M I
+ ld8 v2 = [vp], 8 C M01
+ (p8) cmp.eq.or p9, p0 = LIM, w1 C M I
+ (p8) add w1 = INCR, w1 C M I
+ ;;
+.LL00: cmp.PRED p6, p0 = w2, u2 C M I
+ shrp x0 = w1, w0, 1 C I0
+ nop.b 0
+ ld8 u2 = [up], 8 C M01
+ ADDSUB w3 = u3, v3 C M I
+ br.cloop.dptk .Loop C B
+ ;;
+C *** MAIN LOOP END ***
+
+.Lskip: st8 [rp] = x3, 8 C M23
+ cmp.PRED p7, p0 = w3, u3 C M I
+ (p9) cmp.eq.or p6, p0 = LIM, w2 C M I
+ (p9) add w2 = INCR, w2 C M I
+ ;;
+.Lcj7: st8 [rp] = x0, 8 C M23
+ shrp x1 = w2, w1, 1 C I0
+ ADDSUB w0 = u0, v0 C M I
+ (p6) cmp.eq.or p7, p0 = LIM, w3 C M I
+ (p6) add w3 = INCR, w3 C M I
+ ;;
+.Lcj6: cmp.PRED p8, p0 = w0, u0 C M I
+ shrp x2 = w3, w2, 1 C I0
+ ADDSUB w1 = u1, v1 C M I
+ ;;
+ st8 [rp] = x1, 8 C M23
+ cmp.PRED p9, p0 = w1, u1 C M I
+ (p7) cmp.eq.or p8, p0 = LIM, w0 C M I
+ (p7) add w0 = INCR, w0 C M I
+ ;;
+.Lcj5: st8 [rp] = x2, 8 C M23
+ shrp x3 = w0, w3, 1 C I0
+ ADDSUB w2 = u2, v2 C M I
+ (p8) cmp.eq.or p9, p0 = LIM, w1 C M I
+ (p8) add w1 = INCR, w1 C M I
+ ;;
+.Lcj4: cmp.PRED p6, p0 = w2, u2 C M I
+ shrp x0 = w1, w0, 1 C I0
+ ;;
+ st8 [rp] = x3, 8 C M23
+ (p9) cmp.eq.or p6, p0 = LIM, w2 C M I
+ (p9) add w2 = INCR, w2 C M I
+ ;;
+.Lcj3: st8 [rp] = x0, 8 C M23
+ shrp x1 = w2, w1, 1 C I0
+ shr.u x2 = w2, 1 C I0
+ ;;
+.Lcj2: st8 [rp] = x1, 8 C M23
+ (p6) dep x2 = -1, x2, 63, 1 C I0
+ ;;
+.Lcj1: st8 [rp] = x2 C M23
+ mov.i ar.lc = r2 C I0
+ br.ret.sptk.many b0 C B
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/ia64/sec_tabselect.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/ia64/sec_tabselect.asm
new file mode 100644
index 00000000000..f116ea38435
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/ia64/sec_tabselect.asm
@@ -0,0 +1,150 @@
+dnl IA-64 mpn_sec_tabselect.
+
+dnl Copyright 2011 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 Itanium: ?
+C Itanium 2: 2.5
+
+C NOTES
+C * Using software pipelining could trivially yield 2 c/l without unrolling,
+C or 1+epsilon with unrolling. (This code was modelled after the powerpc64
+C code, for simplicity.)
+
+C mpn_sec_tabselect (mp_limb_t *rp, mp_limb_t *tp, mp_size_t n, mp_size_t nents, mp_size_t which)
+define(`rp', `r32')
+define(`tp', `r33')
+define(`n', `r34')
+define(`nents', `r35')
+define(`which', `r36')
+
+define(`mask', `r8')
+
+define(`rp1', `r32')
+define(`tp1', `r33')
+define(`rp2', `r14')
+define(`tp2', `r15')
+
+ASM_START()
+ TEXT
+ ALIGN(16)
+PROLOGUE(mpn_sec_tabselect)
+ .prologue
+ .save ar.lc, r2
+ .body
+ifdef(`HAVE_ABI_32',`
+.mmi; addp4 rp = 0, rp C M I
+ addp4 tp = 0, tp C M I
+ zxt4 n = n C I
+.mii; nop 0
+ zxt4 nents = nents C I
+ zxt4 which = which C I
+ ;;
+')
+.mmi; add rp2 = 8, rp1
+ add tp2 = 8, tp1
+ add r6 = -2, n
+ ;;
+.mmi; cmp.eq p10, p0 = 1, n
+ and r9 = 1, n C set cr0 for use in inner loop
+ shr.u r6 = r6, 1 C inner loop count
+ ;;
+.mmi; cmp.eq p8, p0 = 0, r9
+ sub which = nents, which
+ shl n = n, 3
+ ;;
+
+L(outer):
+.mmi cmp.eq p6, p7 = which, nents C are we at the selected table entry?
+ nop 0
+ mov ar.lc = r6 C I0
+ ;;
+.mmb;
+ (p6) mov mask = -1
+ (p7) mov mask = 0
+ (p8) br.dptk L(top) C branch to loop entry if n even
+ ;;
+
+.mmi; ld8 r16 = [tp1], 8
+ add tp2 = 8, tp2
+ nop 0
+ ;;
+.mmi; ld8 r18 = [rp1]
+ and r16 = r16, mask
+ nop 0
+ ;;
+.mmi; andcm r18 = r18, mask
+ ;;
+ or r16 = r16, r18
+ nop 0
+ ;;
+.mmb; st8 [rp1] = r16, 8
+ add rp2 = 8, rp2
+ (p10) br.dpnt L(end)
+
+ ALIGN(32)
+L(top):
+.mmi; ld8 r16 = [tp1], 16
+ ld8 r17 = [tp2], 16
+ nop 0
+ ;;
+.mmi; ld8 r18 = [rp1]
+ and r16 = r16, mask
+ nop 0
+.mmi; ld8 r19 = [rp2]
+ and r17 = r17, mask
+ nop 0
+ ;;
+.mmi; andcm r18 = r18, mask
+ andcm r19 = r19, mask
+ nop 0
+ ;;
+.mmi; or r16 = r16, r18
+ or r17 = r17, r19
+ nop 0
+ ;;
+.mmb; st8 [rp1] = r16, 16
+ st8 [rp2] = r17, 16
+ br.cloop.dptk L(top)
+ ;;
+L(end):
+.mmi; sub rp1 = rp1, n C move rp back to beginning
+ sub rp2 = rp2, n C move rp back to beginning
+ cmp.ne p9, p0 = 1, nents
+.mmb; add nents = -1, nents
+ nop 0
+ (p9) br.dptk L(outer)
+ ;;
+
+.mib; nop 0
+ nop 0
+ br.ret.sptk.many b0
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/ia64/sqr_diag_addlsh1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/ia64/sqr_diag_addlsh1.asm
new file mode 100644
index 00000000000..f9288298b36
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/ia64/sqr_diag_addlsh1.asm
@@ -0,0 +1,144 @@
+dnl IA-64 mpn_sqr_diag_addlsh1
+
+dnl Contributed to the GNU project by Torbjorn Granlund.
+
+dnl Copyright 2010, 2011 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 Itanium: ?
+C Itanium 2: 2 Unrolling could bring it to 1.5 + epsilon
+
+C Exact performance table. The 2nd line is this code, the 3rd line is ctop-
+C less code. In an assembly sqr_basecase, the ctop-full numbers will become a
+C few cycles better since we can mitigate the many I0 instructions.
+C
+C 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
+C - 20 22 24 26 28 30 32 34 36 38 40 42 44 46 48 50 52 54 56 Needs updating
+C - 13 16 17 18 20 21 23 25 26 30 31 31 33 34 36 38 39 42 43
+
+C We should keep in mind that this code takes linear time in a O(n^2) context
+C and that it will only be used under SQR_TOOM2_THRESHOLD, which might become
+C around 60. Keeping overhead down for smallish operands (< 10) is more
+C important than optimal cycle counts.
+
+C TODO
+C * Make sure we don't depend on uninitialised r-registers, f-registers, or
+C * p-registers.
+C * Optimise by doing first two loop iterations in function header.
+
+C INPUT PARAMETERS
+define(`rp_param', `r32') define(`rp', `r14') C size: 2n
+define(`tp_param', `r33') define(`tp', `r15') C size: 2n - 2
+define(`up_param', `r34') define(`up', `r31') C size: n
+define(`n', `r35')
+
+
+ASM_START()
+PROLOGUE(mpn_sqr_diag_addlsh1)
+
+ .prologue
+ .save ar.pfs, r2
+ .save ar.lc, r3
+ .body
+
+.mmi; alloc r2 = ar.pfs, 4,24,0,24 C M
+ nop 4711
+ mov r3 = ar.lc C I0
+.mmi; mov tp = tp_param C M I
+ mov up = up_param C M I
+ mov rp = rp_param C M I
+ ;;
+.mmi; ld8 r36 = [tp], 8 C M
+ add r20 = -2, n C M I
+ mov r9 = ar.ec C I0
+ ;;
+.mmi; ld8 r32 = [tp], 8 C M
+ mov r16 = 0 C M I
+ mov ar.ec = 7 C I0
+ ;;
+.mmi; nop 4711
+ mov r44 = 0 C M I
+ mov ar.lc = r20 C I0
+ ;;
+.mii; mov r33 = 0
+ mov r10 = pr C I0
+ mov pr.rot = 0x30000 C I0
+ ;;
+ br.cexit.spnt.few.clr L(end)
+
+dnl *** MAIN LOOP START ***
+ ALIGN(32)
+L(top):
+.mfi; (p18) ldf8 f33 = [up], 8 C M
+ (p20) xma.l f36 = f35, f35, f42 C F
+ (p41) cmpequc p50, p0 = -1, r44 C M I
+.mfi; setfsig f40 = r16 C M23
+ (p20) xma.hu f38 = f35, f35, f42 C F
+ (p23) add r50 = r41, r49 C M I
+ ;;
+.mmi; (p16) ld8 r36 = [tp], 8 C M
+ (p23) cmpltu p40, p0 = r50, r41 C cyout hi M I
+ (p19) shrp r45 = r38, r35, 63 C non-critical I0
+.mmi; (p21) getfsig r39 = f39 C hi M2
+ (p24) st8 [rp] = r51, 8 C hi M23
+ (p41) add r44 = 1, r44 C M I
+ ;;
+.mmi; (p16) ld8 r32 = [tp], 8 C M
+ (p50) cmpeqor p40, p0 = -1, r50 C cyout hi M I
+ (p17) shrp r16 = r33, r37, 63 C critical I0
+.mmi; (p21) getfsig r42 = f37 C lo M2
+ (p23) st8 [rp] = r44, 8 C lo M23
+ (p50) add r50 = 1, r50 C M I
+ ;;
+ br.ctop.sptk.few.clr L(top) C B
+dnl *** MAIN LOOP END ***
+ ;;
+L(end):
+.mmi; nop 4711
+ (p41) add r44 = 1, r44 C M I
+ shr.u r48 = r39, 63 C I0
+ ;;
+.mmi; st8 [rp] = r51, 8 C M23
+ (p41) cmpequc p6, p0 = 0, r44 C M I
+ add r50 = r41, r48 C M I
+ ;;
+.mmi; st8 [rp] = r44, 8 C M23
+ (p6) add r50 = 1, r50 C M I
+ mov ar.lc = r3 C I0
+ ;;
+.mii; st8 [rp] = r50 C M23
+ mov ar.ec = r9 C I0
+ mov pr = r10 C I0
+ ;;
+.mib; nop 4711
+ mov ar.pfs = r2 C I0
+ br.ret.sptk.many b0 C B
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/ia64/submul_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/ia64/submul_1.asm
new file mode 100644
index 00000000000..cb2a5525b5a
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/ia64/submul_1.asm
@@ -0,0 +1,647 @@
+dnl IA-64 mpn_submul_1 -- Multiply a limb vector with a limb and subtract the
+dnl result from a second limb vector.
+
+dnl Contributed to the GNU project by Torbjorn Granlund.
+
+dnl Copyright 2000-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 cycles/limb
+C Itanium: 4.0
+C Itanium 2: 2.25 (alignment dependent, sometimes it seems to need 3 c/l)
+
+C TODO
+C * Optimize feed-in and wind-down code, both for speed and code size.
+C * Handle low limb input and results specially, using a common stf8 in the
+C epilogue.
+C * Delay r8, r10 initialization, put cmp-p6 in 1st bundle and br .Ldone in
+C 2nd bundle. This will allow the bbb bundle to be one cycle earlier and
+C save a cycle.
+
+C INPUT PARAMETERS
+define(`rp', `r32')
+define(`up', `r33')
+define(`n', `r34')
+define(`vl', `r35')
+
+ASM_START()
+PROLOGUE(mpn_submul_1)
+ .prologue
+ .save ar.lc, r2
+ .body
+
+ifdef(`HAVE_ABI_32',
+` addp4 rp = 0, rp C M I
+ addp4 up = 0, up C M I
+ zxt4 n = n C I
+ ;;
+')
+{.mmi
+ mov r10 = rp C M I
+ mov r9 = up C M I
+ sub vl = r0, vl C M I negate vl
+}
+{.mmi
+ ldf8 f8 = [rp], 8 C M
+ ldf8 f7 = [up], 8 C M
+ add r19 = -1, n C M I n - 1
+ ;;
+}
+{.mmi
+ cmp.eq p6, p0 = 0, vl C M I
+ mov r8 = 0 C M I zero cylimb
+ mov r2 = ar.lc C I0
+}
+{.mmi
+ setf.sig f6 = vl C M2 M3
+ and r14 = 3, n C M I
+ shr.u r19 = r19, 2 C I0
+ ;;
+}
+{.mmb
+ nop 0
+ cmp.eq p10, p0 = 0, r14 C M I
+ (p6) br.spnt .Ldone C B vl == 0
+}
+{.mmi
+ cmp.eq p11, p0 = 2, r14 C M I
+ cmp.eq p12, p0 = 3, r14 C M I
+ mov ar.lc = r19 C I0
+}
+{.bbb
+ (p10) br.dptk .Lb00 C B
+ (p11) br.dptk .Lb10 C B
+ (p12) br.dptk .Lb11 C B
+ ;;
+}
+
+.Lb01: br.cloop.dptk .grt1
+
+ xma.l f39 = f7, f6, f8
+ xma.hu f43 = f7, f6, f8
+ ;;
+ getf.sig r27 = f39 C lo
+ getf.sig r31 = f43 C hi
+ ld8 r20 = [r9], 8
+ br .Lcj1
+
+.grt1: ldf8 f44 = [rp], 8
+ ldf8 f32 = [up], 8
+ ;;
+ ldf8 f45 = [rp], 8
+ ldf8 f33 = [up], 8
+ ;;
+ ldf8 f46 = [rp], 8
+ xma.l f39 = f7, f6, f8
+ ldf8 f34 = [up], 8
+ xma.hu f43 = f7, f6, f8
+ ;;
+ ldf8 f47 = [rp], 8
+ xma.l f36 = f32, f6, f44
+ ldf8 f35 = [up], 8
+ xma.hu f40 = f32, f6, f44
+ br.cloop.dptk .grt5
+ ;;
+
+ getf.sig r27 = f39 C lo
+ xma.l f37 = f33, f6, f45
+ ld8 r20 = [r9], 8
+ xma.hu f41 = f33, f6, f45
+ ;;
+ getf.sig r31 = f43 C hi
+ getf.sig r24 = f36 C lo
+ xma.l f38 = f34, f6, f46
+ ld8 r21 = [r9], 8
+ xma.hu f42 = f34, f6, f46
+ ;;
+ getf.sig r28 = f40 C hi
+ getf.sig r25 = f37 C lo
+ xma.l f39 = f35, f6, f47
+ ld8 r22 = [r9], 8
+ xma.hu f43 = f35, f6, f47
+ ;;
+ getf.sig r29 = f41 C hi
+ getf.sig r26 = f38 C lo
+ ld8 r23 = [r9], 8
+ br .Lcj5
+
+.grt5: ldf8 f44 = [rp], 8
+ ldf8 f32 = [up], 8
+ ;;
+ getf.sig r27 = f39 C lo
+ xma.l f37 = f33, f6, f45
+ ld8 r20 = [r9], 8
+ xma.hu f41 = f33, f6, f45
+ ;;
+ ldf8 f45 = [rp], 8
+ getf.sig r31 = f43 C hi
+ ldf8 f33 = [up], 8
+ ;;
+ getf.sig r24 = f36 C lo
+ xma.l f38 = f34, f6, f46
+ ld8 r21 = [r9], 8
+ xma.hu f42 = f34, f6, f46
+ ;;
+ ldf8 f46 = [rp], 8
+ getf.sig r28 = f40 C hi
+ ldf8 f34 = [up], 8
+ ;;
+ getf.sig r25 = f37 C lo
+ xma.l f39 = f35, f6, f47
+ ld8 r22 = [r9], 8
+ xma.hu f43 = f35, f6, f47
+ ;;
+ ldf8 f47 = [rp], 8
+ getf.sig r29 = f41 C hi
+ ldf8 f35 = [up], 8
+ ;;
+ getf.sig r26 = f38 C lo
+ xma.l f36 = f32, f6, f44
+ ld8 r23 = [r9], 8
+ xma.hu f40 = f32, f6, f44
+ br.cloop.dptk .Loop
+ br .Lend
+
+
+.Lb10: ldf8 f47 = [rp], 8
+ ldf8 f35 = [up], 8
+ br.cloop.dptk .grt2
+
+ xma.l f38 = f7, f6, f8
+ xma.hu f42 = f7, f6, f8
+ ;;
+ xma.l f39 = f35, f6, f47
+ xma.hu f43 = f35, f6, f47
+ ;;
+ getf.sig r26 = f38 C lo
+ getf.sig r30 = f42 C hi
+ ld8 r23 = [r9], 8
+ ;;
+ getf.sig r27 = f39 C lo
+ getf.sig r31 = f43 C hi
+ ld8 r20 = [r9], 8
+ br .Lcj2
+
+.grt2: ldf8 f44 = [rp], 8
+ ldf8 f32 = [up], 8
+ ;;
+ ldf8 f45 = [rp], 8
+ ldf8 f33 = [up], 8
+ xma.l f38 = f7, f6, f8
+ xma.hu f42 = f7, f6, f8
+ ;;
+ ldf8 f46 = [rp], 8
+ ldf8 f34 = [up], 8
+ xma.l f39 = f35, f6, f47
+ xma.hu f43 = f35, f6, f47
+ ;;
+ ldf8 f47 = [rp], 8
+ ldf8 f35 = [up], 8
+ ;;
+ getf.sig r26 = f38 C lo
+ xma.l f36 = f32, f6, f44
+ ld8 r23 = [r9], 8
+ xma.hu f40 = f32, f6, f44
+ br.cloop.dptk .grt6
+
+ getf.sig r30 = f42 C hi
+ ;;
+ getf.sig r27 = f39 C lo
+ xma.l f37 = f33, f6, f45
+ ld8 r20 = [r9], 8
+ xma.hu f41 = f33, f6, f45
+ ;;
+ getf.sig r31 = f43 C hi
+ getf.sig r24 = f36 C lo
+ xma.l f38 = f34, f6, f46
+ ld8 r21 = [r9], 8
+ xma.hu f42 = f34, f6, f46
+ ;;
+ getf.sig r28 = f40 C hi
+ getf.sig r25 = f37 C lo
+ xma.l f39 = f35, f6, f47
+ ld8 r22 = [r9], 8
+ xma.hu f43 = f35, f6, f47
+ br .Lcj6
+
+.grt6: ldf8 f44 = [rp], 8
+ getf.sig r30 = f42 C hi
+ ldf8 f32 = [up], 8
+ ;;
+ getf.sig r27 = f39 C lo
+ xma.l f37 = f33, f6, f45
+ ld8 r20 = [r9], 8
+ xma.hu f41 = f33, f6, f45
+ ;;
+ ldf8 f45 = [rp], 8
+ getf.sig r31 = f43 C hi
+ ldf8 f33 = [up], 8
+ ;;
+ getf.sig r24 = f36 C lo
+ xma.l f38 = f34, f6, f46
+ ld8 r21 = [r9], 8
+ xma.hu f42 = f34, f6, f46
+ ;;
+ ldf8 f46 = [rp], 8
+ getf.sig r28 = f40 C hi
+ ldf8 f34 = [up], 8
+ ;;
+ getf.sig r25 = f37 C lo
+ xma.l f39 = f35, f6, f47
+ ld8 r22 = [r9], 8
+ xma.hu f43 = f35, f6, f47
+ br .LL10
+
+
+.Lb11: ldf8 f46 = [rp], 8
+ ldf8 f34 = [up], 8
+ ;;
+ ldf8 f47 = [rp], 8
+ ldf8 f35 = [up], 8
+ br.cloop.dptk .grt3
+
+ xma.l f37 = f7, f6, f8
+ xma.hu f41 = f7, f6, f8
+ ;;
+ xma.l f38 = f34, f6, f46
+ xma.hu f42 = f34, f6, f46
+ ;;
+ getf.sig r25 = f37 C lo
+ xma.l f39 = f35, f6, f47
+ xma.hu f43 = f35, f6, f47
+ ;;
+ getf.sig r29 = f41 C hi
+ ld8 r22 = [r9], 8
+ ;;
+ getf.sig r26 = f38 C lo
+ getf.sig r30 = f42 C hi
+ ld8 r23 = [r9], 8
+ ;;
+ getf.sig r27 = f39 C lo
+ getf.sig r31 = f43 C hi
+ ld8 r20 = [r9], 8
+ br .Lcj3
+
+.grt3: ldf8 f44 = [rp], 8
+ xma.l f37 = f7, f6, f8
+ ldf8 f32 = [up], 8
+ xma.hu f41 = f7, f6, f8
+ ;;
+ ldf8 f45 = [rp], 8
+ xma.l f38 = f34, f6, f46
+ ldf8 f33 = [up], 8
+ xma.hu f42 = f34, f6, f46
+ ;;
+ ldf8 f46 = [rp], 8
+ ldf8 f34 = [up], 8
+ ;;
+ getf.sig r25 = f37 C lo
+ xma.l f39 = f35, f6, f47
+ ld8 r22 = [r9], 8
+ xma.hu f43 = f35, f6, f47
+ ;;
+ ldf8 f47 = [rp], 8
+ getf.sig r29 = f41 C hi
+ ldf8 f35 = [up], 8
+ ;;
+ getf.sig r26 = f38 C lo
+ xma.l f36 = f32, f6, f44
+ ld8 r23 = [r9], 8
+ xma.hu f40 = f32, f6, f44
+ br.cloop.dptk .grt7
+ ;;
+
+ getf.sig r30 = f42 C hi
+ getf.sig r27 = f39 C lo
+ xma.l f37 = f33, f6, f45
+ ld8 r20 = [r9], 8
+ xma.hu f41 = f33, f6, f45
+ ;;
+ getf.sig r31 = f43 C hi
+ getf.sig r24 = f36 C lo
+ xma.l f38 = f34, f6, f46
+ ld8 r21 = [r9], 8
+ xma.hu f42 = f34, f6, f46
+ br .Lcj7
+
+.grt7: ldf8 f44 = [rp], 8
+ getf.sig r30 = f42 C hi
+ ldf8 f32 = [up], 8
+ ;;
+ getf.sig r27 = f39 C lo
+ xma.l f37 = f33, f6, f45
+ ld8 r20 = [r9], 8
+ xma.hu f41 = f33, f6, f45
+ ;;
+ ldf8 f45 = [rp], 8
+ getf.sig r31 = f43 C hi
+ ldf8 f33 = [up], 8
+ ;;
+ getf.sig r24 = f36 C lo
+ xma.l f38 = f34, f6, f46
+ ld8 r21 = [r9], 8
+ xma.hu f42 = f34, f6, f46
+ br .LL11
+
+
+.Lb00: ldf8 f45 = [rp], 8
+ ldf8 f33 = [up], 8
+ ;;
+ ldf8 f46 = [rp], 8
+ ldf8 f34 = [up], 8
+ ;;
+ ldf8 f47 = [rp], 8
+ xma.l f36 = f7, f6, f8
+ ldf8 f35 = [up], 8
+ xma.hu f40 = f7, f6, f8
+ br.cloop.dptk .grt4
+
+ xma.l f37 = f33, f6, f45
+ xma.hu f41 = f33, f6, f45
+ ;;
+ getf.sig r24 = f36 C lo
+ xma.l f38 = f34, f6, f46
+ ld8 r21 = [r9], 8
+ xma.hu f42 = f34, f6, f46
+ ;;
+ getf.sig r28 = f40 C hi
+ xma.l f39 = f35, f6, f47
+ getf.sig r25 = f37 C lo
+ ld8 r22 = [r9], 8
+ xma.hu f43 = f35, f6, f47
+ ;;
+ getf.sig r29 = f41 C hi
+ getf.sig r26 = f38 C lo
+ ld8 r23 = [r9], 8
+ ;;
+ getf.sig r30 = f42 C hi
+ getf.sig r27 = f39 C lo
+ ld8 r20 = [r9], 8
+ br .Lcj4
+
+.grt4: ldf8 f44 = [rp], 8
+ xma.l f37 = f33, f6, f45
+ ldf8 f32 = [up], 8
+ xma.hu f41 = f33, f6, f45
+ ;;
+ ldf8 f45 = [rp], 8
+ ldf8 f33 = [up], 8
+ xma.l f38 = f34, f6, f46
+ getf.sig r24 = f36 C lo
+ ld8 r21 = [r9], 8
+ xma.hu f42 = f34, f6, f46
+ ;;
+ ldf8 f46 = [rp], 8
+ getf.sig r28 = f40 C hi
+ ldf8 f34 = [up], 8
+ xma.l f39 = f35, f6, f47
+ getf.sig r25 = f37 C lo
+ ld8 r22 = [r9], 8
+ xma.hu f43 = f35, f6, f47
+ ;;
+ ldf8 f47 = [rp], 8
+ getf.sig r29 = f41 C hi
+ ldf8 f35 = [up], 8
+ ;;
+ getf.sig r26 = f38 C lo
+ xma.l f36 = f32, f6, f44
+ ld8 r23 = [r9], 8
+ xma.hu f40 = f32, f6, f44
+ br.cloop.dptk .grt8
+ ;;
+
+ getf.sig r30 = f42 C hi
+ getf.sig r27 = f39 C lo
+ xma.l f37 = f33, f6, f45
+ ld8 r20 = [r9], 8
+ xma.hu f41 = f33, f6, f45
+ br .Lcj8
+
+.grt8: ldf8 f44 = [rp], 8
+ getf.sig r30 = f42 C hi
+ ldf8 f32 = [up], 8
+ ;;
+ getf.sig r27 = f39 C lo
+ xma.l f37 = f33, f6, f45
+ ld8 r20 = [r9], 8
+ xma.hu f41 = f33, f6, f45
+ br .LL00
+
+ ALIGN(32)
+.Loop:
+{.mmi
+ ldf8 f44 = [rp], 8
+ cmp.ltu p6, p0 = r27, r8 C lo cmp
+ sub r14 = r27, r8 C lo sub
+}
+{.mmi
+ getf.sig r30 = f42 C hi
+ ldf8 f32 = [up], 8
+ sub r8 = r20, r31 C hi sub
+ ;; C 01
+}
+{.mmf
+ getf.sig r27 = f39 C lo
+ st8 [r10] = r14, 8
+ xma.l f37 = f33, f6, f45
+}
+{.mfi
+ ld8 r20 = [r9], 8
+ xma.hu f41 = f33, f6, f45
+ (p6) add r8 = 1, r8
+ ;; C 02
+}
+{.mmi
+.LL00: ldf8 f45 = [rp], 8
+ cmp.ltu p6, p0 = r24, r8
+ sub r14 = r24, r8
+}
+{.mmi
+ getf.sig r31 = f43 C hi
+ ldf8 f33 = [up], 8
+ sub r8 = r21, r28
+ ;; C 03
+}
+{.mmf
+ getf.sig r24 = f36 C lo
+ st8 [r10] = r14, 8
+ xma.l f38 = f34, f6, f46
+}
+{.mfi
+ ld8 r21 = [r9], 8
+ xma.hu f42 = f34, f6, f46
+ (p6) add r8 = 1, r8
+ ;; C 04
+}
+{.mmi
+.LL11: ldf8 f46 = [rp], 8
+ cmp.ltu p6, p0 = r25, r8
+ sub r14 = r25, r8
+}
+{.mmi
+ getf.sig r28 = f40 C hi
+ ldf8 f34 = [up], 8
+ sub r8 = r22, r29
+ ;; C 05
+}
+{.mmf
+ getf.sig r25 = f37 C lo
+ st8 [r10] = r14, 8
+ xma.l f39 = f35, f6, f47
+}
+{.mfi
+ ld8 r22 = [r9], 8
+ xma.hu f43 = f35, f6, f47
+ (p6) add r8 = 1, r8
+ ;; C 06
+}
+{.mmi
+.LL10: ldf8 f47 = [rp], 8
+ cmp.ltu p6, p0 = r26, r8
+ sub r14 = r26, r8
+}
+{.mmi
+ getf.sig r29 = f41 C hi
+ ldf8 f35 = [up], 8
+ sub r8 = r23, r30
+ ;; C 07
+}
+{.mmf
+ getf.sig r26 = f38 C lo
+ st8 [r10] = r14, 8
+ xma.l f36 = f32, f6, f44
+}
+{.mfi
+ ld8 r23 = [r9], 8
+ xma.hu f40 = f32, f6, f44
+ (p6) add r8 = 1, r8
+}
+ br.cloop.dptk .Loop
+ ;;
+
+.Lend:
+ cmp.ltu p6, p0 = r27, r8
+ sub r14 = r27, r8
+ getf.sig r30 = f42
+ sub r8 = r20, r31
+ ;;
+ getf.sig r27 = f39
+ st8 [r10] = r14, 8
+ xma.l f37 = f33, f6, f45
+ ld8 r20 = [r9], 8
+ xma.hu f41 = f33, f6, f45
+ (p6) add r8 = 1, r8
+ ;;
+.Lcj8:
+ cmp.ltu p6, p0 = r24, r8
+ sub r14 = r24, r8
+ getf.sig r31 = f43
+ sub r8 = r21, r28
+ ;;
+ getf.sig r24 = f36
+ st8 [r10] = r14, 8
+ xma.l f38 = f34, f6, f46
+ ld8 r21 = [r9], 8
+ xma.hu f42 = f34, f6, f46
+ (p6) add r8 = 1, r8
+ ;;
+.Lcj7:
+ cmp.ltu p6, p0 = r25, r8
+ sub r14 = r25, r8
+ getf.sig r28 = f40
+ sub r8 = r22, r29
+ ;;
+ getf.sig r25 = f37
+ st8 [r10] = r14, 8
+ xma.l f39 = f35, f6, f47
+ ld8 r22 = [r9], 8
+ xma.hu f43 = f35, f6, f47
+ (p6) add r8 = 1, r8
+ ;;
+.Lcj6:
+ cmp.ltu p6, p0 = r26, r8
+ sub r14 = r26, r8
+ getf.sig r29 = f41
+ sub r8 = r23, r30
+ ;;
+ getf.sig r26 = f38
+ st8 [r10] = r14, 8
+ ld8 r23 = [r9], 8
+ (p6) add r8 = 1, r8
+ ;;
+.Lcj5:
+ cmp.ltu p6, p0 = r27, r8
+ sub r14 = r27, r8
+ getf.sig r30 = f42
+ sub r8 = r20, r31
+ ;;
+ getf.sig r27 = f39
+ st8 [r10] = r14, 8
+ ld8 r20 = [r9], 8
+ (p6) add r8 = 1, r8
+ ;;
+.Lcj4:
+ cmp.ltu p6, p0 = r24, r8
+ sub r14 = r24, r8
+ getf.sig r31 = f43
+ sub r8 = r21, r28
+ ;;
+ st8 [r10] = r14, 8
+ (p6) add r8 = 1, r8
+ ;;
+.Lcj3:
+ cmp.ltu p6, p0 = r25, r8
+ sub r14 = r25, r8
+ sub r8 = r22, r29
+ ;;
+ st8 [r10] = r14, 8
+ (p6) add r8 = 1, r8
+ ;;
+.Lcj2:
+ cmp.ltu p6, p0 = r26, r8
+ sub r14 = r26, r8
+ sub r8 = r23, r30
+ ;;
+ st8 [r10] = r14, 8
+ (p6) add r8 = 1, r8
+ ;;
+.Lcj1:
+ cmp.ltu p6, p0 = r27, r8
+ sub r14 = r27, r8
+ sub r8 = r20, r31
+ ;;
+ st8 [r10] = r14, 8
+ mov ar.lc = r2
+ (p6) add r8 = 1, r8
+ br.ret.sptk.many b0
+.Ldone: mov ar.lc = r2
+ br.ret.sptk.many b0
+EPILOGUE()
+ASM_END()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/lisp/gmpasm-mode.el b/Build/source/libs/gmp/gmp-6.0.0/mpn/lisp/gmpasm-mode.el
new file mode 100644
index 00000000000..06b74bd6ce7
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/lisp/gmpasm-mode.el
@@ -0,0 +1,385 @@
+;;; gmpasm-mode.el -- GNU MP asm and m4 editing mode.
+
+
+;; 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/.
+
+
+;;; Commentary:
+;;
+;; gmpasm-mode is a major mode for editing m4 processed assembler code and
+;; m4 macro files in GMP. It's similar to m4-mode, but has a number of
+;; settings better suited to GMP.
+;;
+;;
+;; Install
+;; -------
+;;
+;; To make M-x gmpasm-mode available, put gmpasm-mode.el somewhere in your
+;; load-path and the following in your .emacs
+;;
+;; (autoload 'gmpasm-mode "gmpasm-mode" nil t)
+;;
+;; To use gmpasm-mode automatically on all .asm and .m4 files, put the
+;; following in your .emacs
+;;
+;; (add-to-list 'auto-mode-alist '("\\.asm\\'" . gmpasm-mode))
+;; (add-to-list 'auto-mode-alist '("\\.m4\\'" . gmpasm-mode))
+;;
+;; To have gmpasm-mode only on gmp files, try instead something like the
+;; following, which uses it only in a directory starting with "gmp", or a
+;; sub-directory of such.
+;;
+;; (add-to-list 'auto-mode-alist
+;; '("/gmp.*/.*\\.\\(asm\\|m4\\)\\'" . gmpasm-mode))
+;;
+;; Byte compiling will slightly speed up loading. If you want a docstring
+;; in the autoload you can use M-x update-file-autoloads if you set it up
+;; right.
+;;
+;;
+;; Emacsen
+;; -------
+;;
+;; GNU Emacs 20.x, 21.x and XEmacs 20.x all work well. GNU Emacs 19.x
+;; should work if replacements for the various 20.x-isms are available,
+;; though comment-region with "C" doesn't do the right thing.
+
+
+;;; Code:
+
+(defgroup gmpasm nil
+ "GNU MP m4 and asm editing."
+ :prefix "gmpasm-"
+ :group 'languages)
+
+(defcustom gmpasm-mode-hook nil
+ "*Hook called by `gmpasm-mode'."
+ :type 'hook
+ :group 'gmpasm)
+
+(defcustom gmpasm-comment-start-regexp "\\([#;!@*|C]\\|//\\)"
+ "*Regexp matching possible comment styles.
+See `gmpasm-mode' docstring for how this is used.
+
+Commenting styles within GMP include
+ # - alpha, i386, i960, vax, traditional unix
+ ; - a29k, clipper, hppa, m88k, ppc
+ ! - sh, sparc, z8000
+ | - m68k
+ @ - arm
+ * - cray
+ C - GMP m4, see mpn/asm-defs.m4
+ // - ia64"
+ :type 'regexp
+ :group 'gmpasm)
+
+
+(defun gmpasm-add-to-list-second (list-var element)
+ "(gmpasm-add-to-list-second LIST-VAR ELEMENT)
+
+Add ELEMENT to LIST-VAR as the second element in the list, if it isn't
+already in the list. If LIST-VAR is nil, then ELEMENT is just added as the
+sole element in the list.
+
+This is like `add-to-list', but it puts the new value second in the list.
+
+The first cons cell is copied rather than changed in-place, so references to
+the list elsewhere won't be affected."
+
+ (if (member element (symbol-value list-var))
+ (symbol-value list-var)
+ (set list-var
+ (if (symbol-value list-var)
+ (cons (car (symbol-value list-var))
+ (cons element
+ (cdr (symbol-value list-var))))
+ (list element)))))
+
+
+(defun gmpasm-remove-from-list (list-var element)
+ "(gmpasm-remove-from-list LIST-VAR ELEMENT)
+
+Remove ELEMENT from LIST-VAR, using `copy-sequence' and `delete'.
+This is vaguely like `add-to-list', but the element is removed from the list.
+The list is copied rather than changed in-place, so references to it elsewhere
+aren't affected."
+
+;; Only the portion of the list up to the removed element needs to be
+;; copied, but there's no need to bother arranging that, since this function
+;; is only used for a couple of initializations.
+
+ (set list-var (delete element (copy-sequence (symbol-value list-var)))))
+
+
+(defvar gmpasm-mode-map
+ (let ((map (make-sparse-keymap)))
+
+ ;; assembler and dnl commenting
+ (define-key map "\C-c\C-c" 'comment-region)
+ (define-key map "\C-c\C-d" 'gmpasm-comment-region-dnl)
+
+ ;; kill an M-x compile, since it's not hard to put m4 into an infinite
+ ;; loop
+ (define-key map "\C-c\C-k" 'kill-compilation)
+
+ map)
+ "Keymap for `gmpasm-mode'.")
+
+
+(defvar gmpasm-mode-syntax-table
+ (let ((table (make-syntax-table)))
+ ;; underscore left as a symbol char, like C mode
+
+ ;; m4 quotes
+ (modify-syntax-entry ?` "('" table)
+ (modify-syntax-entry ?' ")`" table)
+
+ table)
+ "Syntax table used in `gmpasm-mode'.
+
+'#' and '\n' aren't set as comment syntax. In m4 these are a comment
+outside quotes, but not inside. Omitting a syntax entry ensures that when
+inside quotes emacs treats parentheses and apostrophes the same way that m4
+does. When outside quotes this is not quite right, but having it right when
+nesting expressions is more important.
+
+'*', '!' or '|' aren't setup as comment syntax either, on CPUs which use
+these for comments. The GMP macro setups don't set them in m4 changecom(),
+since that prevents them being used in eval() expressions, and on that basis
+they don't change the way quotes and parentheses are treated by m4 and
+should be treated by emacs.")
+
+
+(defvar gmpasm-font-lock-keywords
+ (eval-when-compile
+ (list
+ (cons
+ (concat
+ "\\b"
+ (regexp-opt
+ '("deflit" "defreg" "defframe" "defframe_pushl"
+ "define_not_for_expansion"
+ "m4_error" "m4_warning"
+ "ASM_START" "ASM_END"
+ "PROLOGUE" "PROLOGUE_GP" "MULFUNC_PROLOGUE" "EPILOGUE"
+ "DATASTART" "DATAEND"
+ "forloop"
+ "TEXT" "DATA" "ALIGN" "W32" "FLOAT64"
+ "builtin" "changecom" "changequote" "changeword" "debugfile"
+ "debugmode" "decr" "define" "defn" "divert" "divnum" "dumpdef"
+ "errprint" "esyscmd" "eval" "__file__" "format" "gnu" "ifdef"
+ "ifelse" "include" "incr" "index" "indir" "len" "__line__"
+ "m4exit" "m4wrap" "maketemp" "patsubst" "popdef" "pushdef"
+ "regexp" "shift" "sinclude" "substr" "syscmd" "sysval"
+ "traceoff" "traceon" "translit" "undefine" "undivert" "unix")
+ t)
+ "\\b") 'font-lock-keyword-face)))
+
+ "`font-lock-keywords' for `gmpasm-mode'.
+
+The keywords are m4 builtins and some of the GMP macros used in asm files.
+L doesn't look good fontified, so it's omitted.
+
+The right assembler comment regexp is added dynamically buffer-local (with
+dnl too).")
+
+
+;; Initialized if gmpasm-mode finds filladapt loaded.
+(defvar gmpasm-filladapt-token-table nil
+ "Filladapt token table used in `gmpasm-mode'.")
+(defvar gmpasm-filladapt-token-match-table nil
+ "Filladapt token match table used in `gmpasm-mode'.")
+(defvar gmpasm-filladapt-token-conversion-table nil
+ "Filladapt token conversion table used in `gmpasm-mode'.")
+
+
+;;;###autoload
+(defun gmpasm-mode ()
+ "A major mode for editing GNU MP asm and m4 files.
+
+\\{gmpasm-mode-map}
+`comment-start' and `comment-end' are set buffer-local to assembler
+commenting appropriate for the CPU by looking for something matching
+`gmpasm-comment-start-regexp' at the start of a line, or \"#\" is used if
+there's no match (if \"#\" isn't what you want, type in a desired comment
+and do \\[gmpasm-mode] to reinitialize).
+
+`adaptive-fill-regexp' is set buffer-local to the standard regexp with
+`comment-start' and dnl added. If filladapt.el has been loaded it similarly
+gets `comment-start' and dnl added as buffer-local fill prefixes.
+
+Font locking has the m4 builtins, some of the GMP macros, m4 dnl commenting,
+and assembler commenting (based on the `comment-start' determined).
+
+Note that `gmpasm-comment-start-regexp' is only matched as a whole word, so
+the `C' in it is only matched as a whole word, not on something that happens
+to start with `C'. Also it's only the particular `comment-start' determined
+that's added for filling etc, not the whole `gmpasm-comment-start-regexp'.
+
+`gmpasm-mode-hook' is run after initializations are complete."
+
+ (interactive)
+ (kill-all-local-variables)
+ (setq major-mode 'gmpasm-mode
+ mode-name "gmpasm")
+ (use-local-map gmpasm-mode-map)
+ (set-syntax-table gmpasm-mode-syntax-table)
+ (setq fill-column 76)
+
+ ;; Short instructions might fit with 32, but anything with labels or
+ ;; expressions soon needs the comments pushed out to column 40.
+ (setq comment-column 40)
+
+ ;; Don't want to find out the hard way which dumb assemblers don't like a
+ ;; missing final newline.
+ (set (make-local-variable 'require-final-newline) t)
+
+ ;; The first match of gmpasm-comment-start-regexp at the start of a line
+ ;; determines comment-start, or "#" if no match.
+ (set (make-local-variable 'comment-start)
+ (save-excursion
+ (goto-char (point-min))
+ (if (re-search-forward
+ (concat "^\\(" gmpasm-comment-start-regexp "\\)\\(\\s-\\|$\\)")
+ nil t)
+ (match-string 1)
+ "#")))
+ (set (make-local-variable 'comment-end) "")
+
+ ;; If comment-start ends in an alphanumeric then \b is used to match it
+ ;; only as a separate word. The test is for an alphanumeric rather than
+ ;; \w since we might try # or ! as \w characters but without wanting \b on
+ ;; them.
+ (let ((comment-regexp
+ (concat (regexp-quote comment-start)
+ (if (string-match "[a-zA-Z0-9]\\'" comment-start) "\\b"))))
+
+ ;; Whitespace is required before a comment-start so m4 $# doesn't match
+ ;; when comment-start is "#".
+ (set (make-local-variable 'comment-start-skip)
+ (concat "\\(^\\|\\s-\\)\\(\\<dnl\\>\\|" comment-regexp "\\)[ \t]*"))
+
+ ;; Comment fontification based on comment-start, and always with dnl.
+ ;; Same treatment of a space before "#" as in comment-start-skip, but
+ ;; don't fontify that space.
+ (add-to-list (make-local-variable 'gmpasm-font-lock-keywords)
+ (list (concat "\\(^\\|\\s-\\)\\(\\(\\<dnl\\>\\|"
+ comment-regexp
+ "\\).*$\\)")
+ 2 'font-lock-comment-face))
+
+ (set (make-local-variable 'font-lock-defaults)
+ '(gmpasm-font-lock-keywords
+ t ; no syntactic fontification (of strings etc)
+ nil ; no case-fold
+ ((?_ . "w")) ; _ part of a word while fontifying
+ ))
+
+ ;; Paragraphs are separated by blank lines, or lines with only dnl or
+ ;; comment-start.
+ (set (make-local-variable 'paragraph-separate)
+ (concat "[ \t\f]*\\(\\(" comment-regexp "\\|dnl\\)[ \t]*\\)*$"))
+ (set (make-local-variable 'paragraph-start)
+ (concat "\f\\|" paragraph-separate))
+
+ ;; Some sort of "def...(" m4 define, possibly with ` for quoting.
+ ;; Could do something with PROLOGUE here, but in GMP the filename is
+ ;; enough, it's not normally necessary to say the function name.
+ (set (make-local-variable 'add-log-current-defun-header-regexp)
+ "^def[a-z0-9_]+(`?\\([a-zA-Z0-9_]+\\)")
+
+ ;; Adaptive fill gets dnl and comment-start as comment style prefixes on
+ ;; top of the standard regexp (which has # and ; already actually).
+ (set (make-local-variable 'adaptive-fill-regexp)
+ (concat "[ \t]*\\(\\("
+ comment-regexp
+ "\\|dnl\\|[-|#;>*]+\\|(?[0-9]+[.)]\\)[ \t]*\\)*"))
+ (set (make-local-variable 'adaptive-fill-first-line-regexp)
+ "\\`\\([ \t]*dnl\\)?[ \t]*\\'")
+
+ (when (fboundp 'filladapt-mode)
+ (unless gmpasm-filladapt-token-table
+ (setq gmpasm-filladapt-token-table
+ filladapt-token-table)
+ (setq gmpasm-filladapt-token-match-table
+ filladapt-token-match-table)
+ (setq gmpasm-filladapt-token-conversion-table
+ filladapt-token-conversion-table)
+
+ ;; Numbered bullet points like "2.1" get matched at the start of a
+ ;; line when it's really something like "2.1 cycles/limb", so remove
+ ;; this from the list. The regexp for "1.", "2." etc is left
+ ;; though.
+ (gmpasm-remove-from-list 'gmpasm-filladapt-token-table
+ '("[0-9]+\\(\\.[0-9]+\\)+[ \t]"
+ bullet))
+
+ ;; "%" as a comment prefix interferes with register names on some
+ ;; CPUs, like %eax on x86, so remove this.
+ (gmpasm-remove-from-list 'gmpasm-filladapt-token-table
+ '("%+" postscript-comment))
+
+ (add-to-list 'gmpasm-filladapt-token-match-table
+ '(gmpasm-comment gmpasm-comment))
+ (add-to-list 'gmpasm-filladapt-token-conversion-table
+ '(gmpasm-comment . exact)))
+
+ (set (make-local-variable 'filladapt-token-table)
+ gmpasm-filladapt-token-table)
+ (set (make-local-variable 'filladapt-token-match-table)
+ gmpasm-filladapt-token-match-table)
+ (set (make-local-variable 'filladapt-token-conversion-table)
+ gmpasm-filladapt-token-conversion-table)
+
+ ;; Add dnl and comment-start as fill prefixes.
+ ;; Comments in filladapt.el say filladapt-token-table must begin
+ ;; with ("^" beginning-of-line), so put our addition second.
+ (gmpasm-add-to-list-second 'filladapt-token-table
+ (list (concat "dnl[ \t]\\|" comment-regexp)
+ 'gmpasm-comment))))
+
+ (run-hooks 'gmpasm-mode-hook))
+
+
+(defun gmpasm-comment-region-dnl (beg end &optional arg)
+ "(gmpasm-comment-region-dnl BEG END &optional ARG)
+
+Comment or uncomment each line in the region using `dnl'.
+With \\[universal-argument] prefix arg, uncomment each line in region.
+This is `comment-region', but using \"dnl\"."
+
+ (interactive "r\nP")
+ (let ((comment-start "dnl")
+ (comment-end ""))
+ (comment-region beg end arg)))
+
+
+(provide 'gmpasm-mode)
+
+;;; gmpasm-mode.el ends here
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/m4-ccas b/Build/source/libs/gmp/gmp-6.0.0/mpn/m4-ccas
new file mode 100755
index 00000000000..16d80c6f51b
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/m4-ccas
@@ -0,0 +1,107 @@
+#!/bin/sh
+#
+# A helper script for Makeasm.am .asm.lo rule.
+
+# Copyright 2001 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/.
+
+
+# Usage: m4-ccas --m4=M4 CC ... file.asm ...
+#
+# Process file.asm with the given M4 plus any -D arguments, then
+# assemble with the given CC plus all arguments.
+#
+# The M4 command must be in a single --m4= argument, and will be split
+# on whitespace. When CC is invoked file.asm is replaced with a
+# temporary .s file which is the M4 output.
+#
+# To allow parallel builds, the temp file name is based on the .asm
+# file name, which will be the output object filename for all uses we
+# put this script to.
+
+M4=
+CC=
+DEFS=
+ASM=
+SEEN_O=no
+
+for i in "$@"; do
+ case $i in
+ --m4=*)
+ M4=`echo "$i" | sed 's/^--m4=//'`
+ ;;
+ -D*)
+ DEFS="$DEFS $i"
+ CC="$CC $i"
+ ;;
+ *.asm)
+ if test -n "$ASM"; then
+ echo "Only one .asm file permitted"
+ exit 1
+ fi
+ BASENAME=`echo "$i" | sed -e 's/\.asm$//' -e 's/^.*[\\/:]//'`
+ TMP=tmp-$BASENAME.s
+ ASM=$i
+ CC="$CC $TMP"
+ ;;
+ -o)
+ SEEN_O=yes
+ CC="$CC $i"
+ ;;
+ *)
+ CC="$CC $i"
+ ;;
+ esac
+done
+
+if test -z "$M4"; then
+ echo "No --m4 specified"
+ exit 1
+fi
+
+if test -z "$ASM"; then
+ echo "No .asm specified"
+ exit 1
+fi
+
+# Libtool adds it's own -o when sending output to .libs/foo.o, but not
+# when just wanting foo.o in the current directory. We need an
+# explicit -o in both cases since we're assembling tmp-foo.s.
+#
+if test $SEEN_O = no; then
+ CC="$CC -o $BASENAME.o"
+fi
+
+echo "$M4 $DEFS $ASM >$TMP"
+$M4 $DEFS $ASM >$TMP || exit
+
+echo "$CC"
+$CC || exit
+
+# Comment this out to preserve .s intermediates
+rm -f $TMP
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/m68k/README b/Build/source/libs/gmp/gmp-6.0.0/mpn/m68k/README
new file mode 100644
index 00000000000..5261564df2b
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/m68k/README
@@ -0,0 +1,138 @@
+Copyright 2001, 2003, 2004 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/.
+
+
+
+
+
+ M68K MPN SUBROUTINES
+
+
+This directory contains mpn functions for various m68k family chips.
+
+
+CODE ORGANIZATION
+
+ m68k m68000, m68010, m68060
+ m68k/mc68020 m68020, m68030, m68040, and CPU32
+
+
+The m5200 "coldfire", which is m68000 less a few instructions, currently has
+no assembler code support.
+
+
+STATUS
+
+The code herein is old and poorly maintained. If somebody really cared, it
+could be optimized substantially. For example,
+
+* mpn_add_n and mpn_sub_n could, with more unrolling be improved from 6 to
+ close to 4 c/l (on m68040).
+
+* The multiplication loops could be sped up by using the FPU.
+
+* mpn_lshift by 31 should use the special-case mpn_rshift by 1 code, and
+ vice versa mpn_rshift by 31 use the special lshift by 1, when operand
+ overlap permits.
+
+* On 68000, mpn_mul_1, mpn_addmul_1 and mpn_submul_1 could check for a
+ 16-bit multiplier and use two multiplies per limb, not four.
+
+ Similarly various other _1 operations like mpn_mod_1, mpn_divrem_1,
+ mpn_divexact_1, mpn_modexact_1c_odd.
+
+* On 68000, mpn_lshift and mpn_rshift could use a roll and mask instead of
+ lsrl and lsll. This promises to be a speedup, effectively trading a 6+2*n
+ shift for one or two 4 cycle masks. Suggested by Jean-Charles Meyrignac.
+
+* config.guess detects 68000, 68010, CPU32 and 68020 by running some code,
+ but relies on system information for 030, 040 and 060. Can they be
+ identified by running some code? Currently this only makes a difference
+ to the compiler options selected, since we have no specific asm code for
+ those chips.
+
+One novel idea for 68000 would be to use a 16-bit limb instead of 32-bits.
+This would suit the native 16x16 multiply, but might make it difficult to
+get full value from the native 32x32 add/sub/etc. This would be an ABI
+option, and would select "__GMP_SHORT_LIMB" in gmp.h.
+
+Naturally an entirely new set of asm subroutines would be needed for a
+16-bit limb. Also there's various places in the C code assuming limb>=long,
+which would need to be updated, eg. mpz_set_ui. Some of the nails changes
+may have helped cover some of this.
+
+
+ASM FILES
+
+The .asm files are put through m4 for macro processing, and with the help of
+configure give either MIT or Motorola syntax. The generic mpn/asm-defs.m4
+is used, together with mpn/m68k/m68k-defs.m4. See comments in those files.
+
+Not all possible syntax variations are covered. GCC config/m68k for
+instance has things like $ for immediates on CRDS or reversed cmp order for
+AT&T SGS. These could probably be handled if anyone really needs it.
+
+
+CALLING CONVENTIONS
+
+The SVR4 standard has an int of 32 bits, and all parameters 32-bit aligned
+on the stack.
+
+PalmOS and perhaps various embedded systems intended for 68000 however use
+an int of 16 bits and parameters only 16-bit aligned on the stack. This is
+generated by "gcc -mshort" (and is the default for the PalmOS gcc port, we
+believe).
+
+The asm files adapt to these two ABIs by checking sizeof(unsigned), coming
+through config.m4 as SIZEOF_UNSIGNED. Only mpn_lshift and mpn_rshift are
+affected, all other routines take longs and pointers, which are 32-bits in
+both cases.
+
+Strictly speaking the size of an int doesn't determine the stack padding
+convention. But if int is 16 bits then we can definitely say the host
+system is not SVR4, and therefore may as well assume we're in 16-bit stack
+alignment.
+
+
+REFERENCES
+
+"Motorola M68000 Family Programmer's Reference Manual", available online,
+
+ http://e-www.motorola.com/brdata/PDFDB/docs/M68000PM.pdf
+
+"System V Application Binary Interface: Motorola 68000 Processor Family
+Supplement", AT&T, 1990, ISBN 0-13-877553-6. Has details of calling
+conventions and ELF style PIC coding.
+
+
+
+----------------
+Local variables:
+mode: text
+fill-column: 76
+End:
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/m68k/aors_n.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/m68k/aors_n.asm
new file mode 100644
index 00000000000..f7d379ec013
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/m68k/aors_n.asm
@@ -0,0 +1,99 @@
+dnl mc68020 mpn_add_n, mpn_sub_n -- add or subtract limb vectors
+
+dnl Copyright 1992, 1994, 1996, 1999-2003, 2005 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 68040: 6
+
+ifdef(`OPERATION_add_n',`
+ define(M4_inst, addxl)
+ define(M4_function_n, mpn_add_n)
+',`ifdef(`OPERATION_sub_n',`
+ define(M4_inst, subxl)
+ define(M4_function_n, mpn_sub_n)
+',
+`m4_error(`Need OPERATION_add_n or OPERATION_sub_n
+')')')
+
+MULFUNC_PROLOGUE(mpn_add_n mpn_sub_n)
+
+
+C INPUT PARAMETERS
+C res_ptr (sp + 4)
+C s1_ptr (sp + 8)
+C s2_ptr (sp + 12)
+C size (sp + 16)
+
+
+PROLOGUE(M4_function_n)
+
+C Save used registers on the stack.
+ movel d2, M(-,sp)
+ movel a2, M(-,sp)
+
+C Copy the arguments to registers. Better use movem?
+ movel M(sp,12), a2
+ movel M(sp,16), a0
+ movel M(sp,20), a1
+ movel M(sp,24), d2
+
+ eorw #1, d2
+ lsrl #1, d2
+ bcc L(L1)
+ subql #1, d2 C clears cy as side effect
+
+L(Loop):
+ movel M(a0,+), d0
+ movel M(a1,+), d1
+ M4_inst d1, d0
+ movel d0, M(a2,+)
+L(L1): movel M(a0,+), d0
+ movel M(a1,+), d1
+ M4_inst d1, d0
+ movel d0, M(a2,+)
+
+ dbf d2, L(Loop) C loop until 16 lsb of %4 == -1
+ subxl d0, d0 C d0 <= -cy; save cy as 0 or -1 in d0
+ subl #0x10000, d2
+ bcs L(L2)
+ addl d0, d0 C restore cy
+ bra L(Loop)
+
+L(L2):
+ negl d0
+
+C Restore used registers from stack frame.
+ movel M(sp,+), a2
+ movel M(sp,+), d2
+
+ rts
+
+EPILOGUE(M4_function_n)
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/m68k/gmp-mparam.h b/Build/source/libs/gmp/gmp-6.0.0/mpn/m68k/gmp-mparam.h
new file mode 100644
index 00000000000..9ac7b410197
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/m68k/gmp-mparam.h
@@ -0,0 +1,76 @@
+/* gmp-mparam.h -- Compiler/machine parameter header file.
+
+Copyright 2000-2004 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
+
+
+/* 25MHz 68040 */
+
+/* Generated by tuneup.c, 2004-02-05, gcc 3.2 */
+
+#define MUL_TOOM22_THRESHOLD 14
+#define MUL_TOOM33_THRESHOLD 90
+
+#define SQR_BASECASE_THRESHOLD 5
+#define SQR_TOOM2_THRESHOLD 28
+#define SQR_TOOM3_THRESHOLD 98
+
+#define DIV_SB_PREINV_THRESHOLD MP_SIZE_T_MAX /* never */
+#define DIV_DC_THRESHOLD 55
+#define POWM_THRESHOLD 65
+
+#define HGCD_THRESHOLD 116
+#define GCD_ACCEL_THRESHOLD 3
+#define GCD_DC_THRESHOLD 590
+#define JACOBI_BASE_METHOD 2
+
+#define DIVREM_1_NORM_THRESHOLD MP_SIZE_T_MAX /* never */
+#define DIVREM_1_UNNORM_THRESHOLD MP_SIZE_T_MAX /* never */
+#define MOD_1_NORM_THRESHOLD MP_SIZE_T_MAX /* never */
+#define MOD_1_UNNORM_THRESHOLD MP_SIZE_T_MAX /* never */
+#define USE_PREINV_DIVREM_1 0
+#define USE_PREINV_MOD_1 0
+#define DIVREM_2_THRESHOLD MP_SIZE_T_MAX /* never */
+#define DIVEXACT_1_THRESHOLD MP_SIZE_T_MAX /* never */
+#define MODEXACT_1_ODD_THRESHOLD MP_SIZE_T_MAX /* never */
+
+#define GET_STR_DC_THRESHOLD 18
+#define GET_STR_PRECOMPUTE_THRESHOLD 43
+#define SET_STR_THRESHOLD 937
+
+#define MUL_FFT_TABLE { 336, 672, 1408, 3584, 10240, 24576, 0 }
+#define MUL_FFT_MODF_THRESHOLD 296
+#define MUL_FFT_THRESHOLD 1728
+
+#define SQR_FFT_TABLE { 336, 736, 1408, 3584, 10240, 24576, 0 }
+#define SQR_FFT_MODF_THRESHOLD 296
+#define SQR_FFT_THRESHOLD 2304
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/m68k/lshift.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/m68k/lshift.asm
new file mode 100644
index 00000000000..f202abfe434
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/m68k/lshift.asm
@@ -0,0 +1,175 @@
+dnl mc68020 mpn_lshift -- mpn left shift.
+
+dnl Copyright 1996, 1999-2003 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 shift==1 shift>1
+C 68040: 5 12
+
+
+C mp_limb_t mpn_lshift (mp_ptr res_ptr, mp_srcptr s_ptr, mp_size_t s_size,
+C unsigned cnt);
+C
+C The "cnt" parameter is either 16 bits or 32 bits depending on
+C SIZEOF_UNSIGNED (see ABI notes in mpn/m68k/README). The value is of
+C course only 1 to 31. When loaded as 16 bits there's garbage in the upper
+C half, hence the use of cmpw. The shift instructions take the their count
+C modulo 64, so the upper part doesn't matter to them either.
+C
+
+C INPUT PARAMETERS
+C res_ptr (sp + 4)
+C s_ptr (sp + 8)
+C s_size (sp + 12)
+C cnt (sp + 16)
+
+define(res_ptr, `a1')
+define(s_ptr, `a0')
+define(s_size, `d6')
+define(cnt, `d4')
+
+ifdef(`SIZEOF_UNSIGNED',,
+`m4_error(`SIZEOF_UNSIGNED not defined, should be in config.m4
+')')
+
+PROLOGUE(mpn_lshift)
+C Save used registers on the stack.
+ moveml d2-d6/a2, M(-,sp)
+
+C Copy the arguments to registers.
+ movel M(sp,28), res_ptr
+ movel M(sp,32), s_ptr
+ movel M(sp,36), s_size
+ifelse(SIZEOF_UNSIGNED,2,
+` movew M(sp,40), cnt',
+` movel M(sp,40), cnt')
+
+ moveql #1, d5
+ cmpw d5, cnt
+ bne L(Lnormal)
+ cmpl s_ptr, res_ptr
+ bls L(Lspecial) C jump if s_ptr >= res_ptr
+
+ifelse(scale_available_p,1,`
+ lea M(s_ptr,s_size,l,4), a2
+',`
+ movel s_size, d0
+ asll #2, d0
+ lea M(s_ptr,d0,l), a2
+')
+ cmpl res_ptr, a2
+ bls L(Lspecial) C jump if res_ptr >= s_ptr + s_size
+
+L(Lnormal):
+ moveql #32, d5
+ subl cnt, d5
+
+ifelse(scale_available_p,1,`
+ lea M(s_ptr,s_size,l,4), s_ptr
+ lea M(res_ptr,s_size,l,4), res_ptr
+',`
+ movel s_size, d0
+ asll #2, d0
+ addl d0, s_ptr
+ addl d0, res_ptr
+')
+ movel M(-,s_ptr), d2
+ movel d2, d0
+ lsrl d5, d0 C compute carry limb
+
+ lsll cnt, d2
+ movel d2, d1
+ subql #1, s_size
+ beq L(Lend)
+ lsrl #1, s_size
+ bcs L(L1)
+ subql #1, s_size
+
+L(Loop):
+ movel M(-,s_ptr), d2
+ movel d2, d3
+ lsrl d5, d3
+ orl d3, d1
+ movel d1, M(-,res_ptr)
+ lsll cnt, d2
+L(L1):
+ movel M(-,s_ptr), d1
+ movel d1, d3
+ lsrl d5, d3
+ orl d3, d2
+ movel d2, M(-,res_ptr)
+ lsll cnt, d1
+
+ dbf s_size, L(Loop)
+ subl #0x10000, s_size
+ bcc L(Loop)
+
+L(Lend):
+ movel d1, M(-,res_ptr) C store least significant limb
+
+C Restore used registers from stack frame.
+ moveml M(sp,+), d2-d6/a2
+ rts
+
+C We loop from least significant end of the arrays, which is only
+C permissable if the source and destination don't overlap, since the
+C function is documented to work for overlapping source and destination.
+
+L(Lspecial):
+ clrl d0 C initialize carry
+ eorw #1, s_size
+ lsrl #1, s_size
+ bcc L(LL1)
+ subql #1, s_size
+
+L(LLoop):
+ movel M(s_ptr,+), d2
+ addxl d2, d2
+ movel d2, M(res_ptr,+)
+L(LL1):
+ movel M(s_ptr,+), d2
+ addxl d2, d2
+ movel d2, M(res_ptr,+)
+
+ dbf s_size, L(LLoop)
+ addxl d0, d0 C save cy in lsb
+ subl #0x10000, s_size
+ bcs L(LLend)
+ lsrl #1, d0 C restore cy
+ bra L(LLoop)
+
+L(LLend):
+C Restore used registers from stack frame.
+ moveml M(sp,+), d2-d6/a2
+ rts
+
+EPILOGUE(mpn_lshift)
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/m68k/m68k-defs.m4 b/Build/source/libs/gmp/gmp-6.0.0/mpn/m68k/m68k-defs.m4
new file mode 100644
index 00000000000..15289f676fc
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/m68k/m68k-defs.m4
@@ -0,0 +1,230 @@
+divert(-1)
+
+dnl m4 macros for 68k assembler.
+
+dnl Copyright 2001-2003 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 The default m4 `#' commenting interferes with the assembler syntax for
+dnl immediates. `|' would be correct, but it interferes with "||" in
+dnl eval(). Would like to disable commenting, but that's not possible (see
+dnl mpn/asm-defs.m4), so use `;' which should be harmless.
+
+changecom(;)
+
+
+dnl Called: PROLOGUE_cpu(GSYM_PREFIX`'foo)
+dnl
+dnl Same as the standard PROLOGUE, but align to 2 bytes not 4.
+
+define(`PROLOGUE_cpu',
+m4_assert_numargs(1)
+` TEXT
+ ALIGN(2)
+ GLOBL `$1' GLOBL_ATTR
+ TYPE(`$1',`function')
+`$1'LABEL_SUFFIX')
+
+
+dnl Usage: d0, etc
+dnl
+dnl Expand to d0 or %d0 according to the assembler's requirements.
+dnl
+dnl Actually d0 expands to `d0' or %`d0', the quotes protecting against
+dnl further expansion. Definitions are made even if d0 is to be just `d0',
+dnl so that any m4 quoting problems will show up everywhere, not just on a
+dnl %d0 system.
+dnl
+dnl Care must be taken with quoting when using these in a definition. For
+dnl instance the quotes in the following are essential or two %'s will be
+dnl produced when `counter' is used.
+dnl
+dnl define(counter, `d7')
+dnl
+
+dnl Called: m68k_reg(r)
+define(m68k_reg,
+m4_assert_numargs(1)
+m4_assert_defined(`WANT_REGISTER_PERCENT')
+`ifelse(WANT_REGISTER_PERCENT,yes,%)`$1'')
+
+dnl Usage: m68k_defreg(r)
+define(m68k_defreg,
+m4_assert_numargs(1)
+`deflit($1,`m68k_reg(`$1')')')
+
+m68k_defreg(d0)
+m68k_defreg(d1)
+m68k_defreg(d2)
+m68k_defreg(d3)
+m68k_defreg(d4)
+m68k_defreg(d5)
+m68k_defreg(d6)
+m68k_defreg(d7)
+
+m68k_defreg(a0)
+m68k_defreg(a1)
+m68k_defreg(a2)
+m68k_defreg(a3)
+m68k_defreg(a4)
+m68k_defreg(a5)
+m68k_defreg(a6)
+m68k_defreg(a7)
+
+m68k_defreg(sp)
+m68k_defreg(pc)
+
+
+dnl Usage: M(base)
+dnl M(base,displacement)
+dnl M(base,index,size)
+dnl M(base,index,size,scale)
+dnl M(base,+)
+dnl M(-,base)
+dnl
+dnl `base' is an address register, `index' is a data register, `size' is w
+dnl or l, and scale is 1, 2, 4 or 8.
+dnl
+dnl M(-,base) has it's arguments that way around to emphasise it's a
+dnl pre-decrement, as opposed to M(base,+) a post-increment.
+dnl
+dnl Enhancement: Add the memory indirect modes, if/when they're needed.
+
+define(M,
+m4_assert_numargs_range(1,4)
+m4_assert_defined(`WANT_ADDRESSING')
+`ifelse(WANT_ADDRESSING,mit,
+`ifelse($#,1, ``$1'@')dnl
+ifelse($#,2,
+`ifelse($2,+, ``$1'@+',
+`ifelse($1,-, ``$2'@-',
+ ``$1'@($2)')')')dnl
+ifelse($#,3, ``$1'@(`$2':`$3')')dnl
+ifelse($#,4, ``$1'@(`$2':`$3':$4)')',
+
+dnl WANT_ADDRESSING `motorola'
+`ifelse($#,1, `(`$1')')dnl
+ifelse($#,2,
+`ifelse($2,+, `(`$1')+',
+`ifelse($1,-, `-(`$2')',
+ `$2(`$1')')')')dnl
+ifelse($#,3, `(`$1',`$2'.$3)')dnl
+ifelse($#,4, `(`$1',`$2'.$3*$4)')')')
+
+
+dnl Usage: addl etc
+dnl
+dnl m68k instructions with special handling for the suffix, with for
+dnl instance addl expanding to addl or add.l as necessary.
+dnl
+dnl See also t-m68k-defs.pl which verifies all mnemonics used in the asm
+dnl files have entries here.
+
+dnl Called: m68k_insn(mnemonic,suffix)
+define(m68k_insn,
+m4_assert_numargs(2)
+m4_assert_defined(`WANT_DOT_SIZE')
+`ifelse(WANT_DOT_SIZE,yes, ``$1'.``$2''',
+ ``$1$2'')')
+
+dnl Usage: m68k_definsn(mnemonic,suffix)
+define(m68k_definsn,
+m4_assert_numargs(2)
+`deflit($1`'$2,`m68k_insn(`$1',`$2')')')
+
+m68k_definsn(add, l)
+m68k_definsn(addx, l)
+m68k_definsn(addq, l)
+m68k_definsn(asl, l)
+m68k_definsn(cmp, l)
+m68k_definsn(cmp, w)
+m68k_definsn(clr, l)
+m68k_definsn(divu, l)
+m68k_definsn(eor, w)
+m68k_definsn(lsl, l)
+m68k_definsn(lsr, l)
+m68k_definsn(move, l)
+m68k_definsn(move, w)
+m68k_definsn(movem,l)
+m68k_definsn(moveq,l)
+m68k_definsn(mulu, l)
+m68k_definsn(neg, l)
+m68k_definsn(or, l)
+m68k_definsn(roxl, l)
+m68k_definsn(roxr, l)
+m68k_definsn(sub, l)
+m68k_definsn(subx, l)
+m68k_definsn(subq, l)
+
+
+dnl Usage: bra etc
+dnl
+dnl Expand to `bra', `jra' or `jbra' according to what the assembler will
+dnl accept. The latter two give variable-sized branches in gas.
+dnl
+dnl See also t-m68k-defs.pl which verifies all the bXX branches used in the
+dnl asm files have entries here.
+
+dnl Called: m68k_branch(cond)
+define(m68k_branch,
+m4_assert_numargs(1)
+m4_assert_defined(`WANT_BRANCHES')
+`ifelse(WANT_BRANCHES,jra, `j$1',
+`ifelse(WANT_BRANCHES,jbra,`jb$1',
+ ``b$1'')')')
+
+dnl Called: m68k_defbranch(cond)
+define(m68k_defbranch,
+m4_assert_numargs(1)
+`deflit(b$1,`m68k_branch(`$1')')')
+
+m68k_defbranch(ra)
+m68k_defbranch(cc)
+m68k_defbranch(cs)
+m68k_defbranch(ls)
+m68k_defbranch(eq)
+m68k_defbranch(ne)
+
+
+dnl Usage: scale_available_p
+dnl
+dnl Expand to 1 if a scale factor can be used in addressing modes, or 0 if
+dnl not. M(a0,d0,l,4), meaning a0+d0*4, is not available in 68000 or
+dnl 68010, but is in CPU32 and in 68020 and up.
+
+define(scale_available_p,
+`m4_ifdef_anyof_p(
+`HAVE_HOST_CPU_m68360'
+`HAVE_HOST_CPU_m68020'
+`HAVE_HOST_CPU_m68030'
+`HAVE_HOST_CPU_m68040'
+`HAVE_HOST_CPU_m68060')')
+
+
+divert
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/m68k/mc68020/aorsmul_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/m68k/mc68020/aorsmul_1.asm
new file mode 100644
index 00000000000..4ee30ad9b30
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/m68k/mc68020/aorsmul_1.asm
@@ -0,0 +1,101 @@
+dnl mc68020 mpn_addmul_1, mpn_submul_1 -- add or subtract mpn multiple.
+
+dnl Copyright 1992, 1994, 1996, 1999-2002, 2011 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 68040: 25
+
+ifdef(`OPERATION_addmul_1',`
+ define(M4_inst, addl)
+ define(M4_function_1, mpn_addmul_1)
+',`ifdef(`OPERATION_submul_1',`
+ define(M4_inst, subl)
+ define(M4_function_1, mpn_submul_1)
+',
+`m4_error(`Need OPERATION_addmul_1 or OPERATION_submul_1
+')')')
+
+
+C INPUT PARAMETERS
+C res_ptr (sp + 4)
+C s1_ptr (sp + 8)
+C s1_size (sp + 12)
+C s2_limb (sp + 16)
+
+define(res_ptr, `a0')
+define(s1_ptr, `a1')
+define(s1_size, `d2')
+define(s2_limb, `d4')
+
+MULFUNC_PROLOGUE(mpn_addmul_1 mpn_submul_1)
+
+PROLOGUE(M4_function_1)
+
+C Save used registers on the stack.
+ moveml d2-d5, M(-,sp)
+
+C Copy the arguments to registers. Better use movem?
+ movel M(sp,20), res_ptr
+ movel M(sp,24), s1_ptr
+ movel M(sp,28), s1_size
+ movel M(sp,32), s2_limb
+
+ eorw #1, s1_size
+ clrl d1
+ clrl d5
+ lsrl #1, s1_size
+ bcc L(L1)
+ subql #1, s1_size
+ subl d0, d0 C (d0,cy) <= (0,0)
+
+L(Loop):
+ movel M(s1_ptr,+), d3
+ mulul s2_limb, d1:d3
+ addxl d0, d3
+ addxl d5, d1
+ M4_inst d3, M(res_ptr,+)
+L(L1): movel M(s1_ptr,+), d3
+ mulul s2_limb, d0:d3
+ addxl d1, d3
+ addxl d5, d0
+ M4_inst d3, M(res_ptr,+)
+
+ dbf s1_size, L(Loop)
+ addxl d5, d0
+ subl #0x10000, s1_size
+ bcc L(Loop)
+
+C Restore used registers from stack frame.
+ moveml M(sp,+), d2-d5
+
+ rts
+
+EPILOGUE(M4_function_1)
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/m68k/mc68020/mul_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/m68k/mc68020/mul_1.asm
new file mode 100644
index 00000000000..f5fbb3063b6
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/m68k/mc68020/mul_1.asm
@@ -0,0 +1,96 @@
+dnl mc68020 mpn_mul_1 -- mpn by limb multiply
+
+dnl Copyright 1992, 1994, 1996, 1999-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 cycles/limb
+C 68040: 24
+
+C INPUT PARAMETERS
+C res_ptr (sp + 4)
+C s1_ptr (sp + 8)
+C s1_size (sp + 12)
+C s2_limb (sp + 16)
+
+
+define(res_ptr, `a0')
+define(s1_ptr, `a1')
+define(s1_size, `d2')
+define(s2_limb, `d4')
+
+
+PROLOGUE(mpn_mul_1)
+
+C Save used registers on the stack.
+ moveml d2-d4, M(-,sp)
+
+C movel d2, M(-,sp)
+C movel d3, M(-,sp)
+C movel d4, M(-,sp)
+
+C Copy the arguments to registers. Better use movem?
+ movel M(sp,16), res_ptr
+ movel M(sp,20), s1_ptr
+ movel M(sp,24), s1_size
+ movel M(sp,28), s2_limb
+
+ eorw #1, s1_size
+ clrl d1
+ lsrl #1, s1_size
+ bcc L(L1)
+ subql #1, s1_size
+ subl d0, d0 C (d0,cy) <= (0,0)
+
+L(Loop):
+ movel M(s1_ptr,+), d3
+ mulul s2_limb, d1:d3
+ addxl d0, d3
+ movel d3, M(res_ptr,+)
+L(L1): movel M(s1_ptr,+), d3
+ mulul s2_limb, d0:d3
+ addxl d1, d3
+ movel d3, M(res_ptr,+)
+
+ dbf s1_size, L(Loop)
+ clrl d3
+ addxl d3, d0
+ subl #0x10000, s1_size
+ bcc L(Loop)
+
+C Restore used registers from stack frame.
+ moveml M(sp,+), d2-d4
+
+C movel M(sp,+),d4
+C movel M(sp,+),d3
+C movel M(sp,+),d2
+
+ rts
+
+EPILOGUE(mpn_mul_1)
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/m68k/mc68020/udiv.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/m68k/mc68020/udiv.asm
new file mode 100644
index 00000000000..aadeab999ae
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/m68k/mc68020/udiv.asm
@@ -0,0 +1,45 @@
+dnl mc68020 mpn_udiv_qrnnd -- 2x1 limb division
+
+dnl Copyright 1999-2001 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 mp_limb_t mpn_udiv_qrnnd (mp_limb_t *rp,
+C mp_limb_t nh, mp_limb_t nl, mp_limb_t d);
+C
+
+PROLOGUE(mpn_udiv_qrnnd)
+ movel M(sp,4), a0 C rp
+ movel M(sp,8), d1 C nh
+ movel M(sp,12), d0 C nl
+ divul M(sp,16), d1:d0
+ movel d1, M(a0) C r
+ rts
+EPILOGUE(mpn_udiv_qrnnd)
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/m68k/mc68020/umul.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/m68k/mc68020/umul.asm
new file mode 100644
index 00000000000..f19314e9bbb
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/m68k/mc68020/umul.asm
@@ -0,0 +1,44 @@
+dnl mc68020 mpn_umul_ppmm -- limb by limb multiplication
+
+dnl Copyright 1999-2001 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 mp_limb_t mpn_umul_ppmm (mp_limb_t *lp, mp_limb_t x, mp_limb_t y);
+C
+
+PROLOGUE(mpn_umul_ppmm)
+ movel M(sp,4), a0 C lp
+ movel M(sp,8), d1 C x
+ movel M(sp,12), d0 C y
+ mulul d0, d0:d1
+ movel d1, M(a0) C low
+ rts
+EPILOGUE(mpn_umul_ppmm)
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/m68k/rshift.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/m68k/rshift.asm
new file mode 100644
index 00000000000..21b5f89f483
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/m68k/rshift.asm
@@ -0,0 +1,175 @@
+dnl mc68020 mpn_rshift -- mpn right shift.
+
+dnl Copyright 1996, 1999-2003 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 shift==1 shift>1
+C 68040: 9 12
+
+
+C mp_limb_t mpn_rshift (mp_ptr res_ptr, mp_srcptr s_ptr, mp_size_t s_size,
+C unsigned cnt);
+C
+C The "cnt" parameter is either 16 bits or 32 bits depending on
+C SIZEOF_UNSIGNED (see ABI notes in mpn/m68k/README). The value is of
+C course only 1 to 31. When loaded as 16 bits there's garbage in the upper
+C half, hence the use of cmpw. The shift instructions take the their count
+C modulo 64, so the upper part doesn't matter to them either.
+C
+
+C INPUT PARAMETERS
+C res_ptr (sp + 4)
+C s_ptr (sp + 8)
+C s_size (sp + 12)
+C cnt (sp + 16)
+
+define(res_ptr, `a1')
+define(s_ptr, `a0')
+define(s_size, `d6')
+define(cnt, `d4')
+
+ifdef(`SIZEOF_UNSIGNED',,
+`m4_error(`SIZEOF_UNSIGNED not defined, should be in config.m4
+')')
+
+PROLOGUE(mpn_rshift)
+C Save used registers on the stack.
+ moveml d2-d6/a2, M(-,sp)
+
+C Copy the arguments to registers.
+ movel M(sp,28), res_ptr
+ movel M(sp,32), s_ptr
+ movel M(sp,36), s_size
+ifelse(SIZEOF_UNSIGNED,2,
+` movew M(sp,40), cnt',
+` movel M(sp,40), cnt')
+
+ moveql #1, d5
+ cmpw d5, cnt
+ bne L(Lnormal)
+ cmpl res_ptr, s_ptr
+ bls L(Lspecial) C jump if res_ptr >= s_ptr
+
+ifelse(scale_available_p,1,`
+ lea M(res_ptr,s_size,l,4), a2
+',`
+ movel s_size, d0
+ asll #2, d0
+ lea M(res_ptr,d0,l), a2
+')
+ cmpl s_ptr, a2
+ bls L(Lspecial) C jump if s_ptr >= res_ptr + s_size
+
+L(Lnormal):
+ moveql #32, d5
+ subl cnt, d5
+ movel M(s_ptr,+), d2
+ movel d2, d0
+ lsll d5, d0 C compute carry limb
+
+ lsrl cnt, d2
+ movel d2, d1
+ subql #1, s_size
+ beq L(Lend)
+ lsrl #1, s_size
+ bcs L(L1)
+ subql #1, s_size
+
+L(Loop):
+ movel M(s_ptr,+), d2
+ movel d2, d3
+ lsll d5, d3
+ orl d3, d1
+ movel d1, M(res_ptr,+)
+ lsrl cnt, d2
+L(L1):
+ movel M(s_ptr,+), d1
+ movel d1, d3
+ lsll d5, d3
+ orl d3, d2
+ movel d2, M(res_ptr,+)
+ lsrl cnt, d1
+
+ dbf s_size, L(Loop)
+ subl #0x10000, s_size
+ bcc L(Loop)
+
+L(Lend):
+ movel d1, M(res_ptr) C store most significant limb
+
+C Restore used registers from stack frame.
+ moveml M(sp,+), d2-d6/a2
+ rts
+
+C We loop from most significant end of the arrays, which is only permissable
+C if the source and destination don't overlap, since the function is
+C documented to work for overlapping source and destination.
+
+L(Lspecial):
+ifelse(scale_available_p,1,`
+ lea M(s_ptr,s_size,l,4), s_ptr
+ lea M(res_ptr,s_size,l,4), res_ptr
+',`
+ movel s_size, d0
+ asll #2, d0
+ addl d0, s_ptr
+ addl d0, res_ptr
+')
+
+ clrl d0 C initialize carry
+ eorw #1, s_size
+ lsrl #1, s_size
+ bcc L(LL1)
+ subql #1, s_size
+
+L(LLoop):
+ movel M(-,s_ptr), d2
+ roxrl #1, d2
+ movel d2, M(-,res_ptr)
+L(LL1):
+ movel M(-,s_ptr), d2
+ roxrl #1, d2
+ movel d2, M(-,res_ptr)
+
+ dbf s_size, L(LLoop)
+ roxrl #1, d0 C save cy in msb
+ subl #0x10000, s_size
+ bcs L(LLend)
+ addl d0, d0 C restore cy
+ bra L(LLoop)
+
+L(LLend):
+C Restore used registers from stack frame.
+ moveml M(sp,+), d2-d6/a2
+ rts
+
+EPILOGUE(mpn_rshift)
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/m68k/t-m68k-defs.pl b/Build/source/libs/gmp/gmp-6.0.0/mpn/m68k/t-m68k-defs.pl
new file mode 100644
index 00000000000..91c21fa1f8a
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/m68k/t-m68k-defs.pl
@@ -0,0 +1,91 @@
+#! /usr/bin/perl -w
+
+# Copyright 2001, 2003 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/.
+
+
+# Usage: perl t-m68k-defs.pl [-t]
+#
+# Run this in the mpn/m68k source directory to check that m68k-defs.m4 has
+# m68k_defbranch()s or m68k_definsn()s for each instruction used in *.asm
+# and */*.asm. Print nothing if everything is ok. The -t option prints
+# some diagnostic traces.
+
+use strict;
+use Getopt::Std;
+
+my %opt;
+getopts('t', \%opt);
+
+my %branch;
+my %insn;
+
+open(FD, "<m68k-defs.m4")
+ or die "Cannot open m68k-defs.m4: $!\nIs this the mpn/m68k source directory?\n";
+my ($srcdir, $top_srcdir);
+while (<FD>) {
+ if (/^m68k_defbranch\(\s*(.*)\)/) { $branch{"b".$1} = 1; }
+ if (/^m68k_definsn\(\s*(.*),\s*(.*)\)/) { $insn{$1.$2} = 1; }
+}
+close(FD);
+
+print "branches: ", join(" ",keys(%branch)), "\n" if $opt{'t'};
+print "insns: ", join(" ",keys(%insn)), "\n" if $opt{'t'};
+
+
+foreach my $file (glob("*.asm"), glob("*/*.asm")) {
+ print "file $file\n" if $opt{'t'};
+
+ open(FD, "<$file") or die "Cannot open $file: $!";
+ while (<FD>) {
+ if (/^[ \t]*C/) { next; };
+ if (/^\t([a-z0-9]+)/) {
+ my $opcode = $1;
+ print "opcode $1\n" if $opt{'t'};
+
+ # instructions with an l, w or b suffix should have a definsn
+ # (unless they're already a defbranch)
+ if ($opcode =~ /[lwb]$/
+ && ! defined $insn{$opcode}
+ && ! defined $branch{$opcode})
+ {
+ print "$file: $.: missing m68k_definsn: $opcode\n";
+ }
+
+ # instructions bXX should have a defbranch (unless they're
+ # already a definsn)
+ if ($opcode =~ /^b/
+ && ! defined $insn{$opcode}
+ && ! defined $branch{$opcode})
+ {
+ print "$file: $.: missing m68k_defbranch: $opcode\n";
+ }
+ }
+ }
+ close(FD);
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/m88k/README b/Build/source/libs/gmp/gmp-6.0.0/mpn/m88k/README
new file mode 100644
index 00000000000..1b51e83079e
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/m88k/README
@@ -0,0 +1,61 @@
+Copyright 2003 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/.
+
+
+
+
+
+ M88K MPN SUBROUTINES
+
+This directory contains mpn functions for various m88k family chips.
+
+CODE ORGANIZATION
+
+ m88k m88000, m88100
+ m88k/mc88110 m88110
+
+STATUS
+
+The code herein is old and poorly maintained.
+
+* The .s files assume the system uses a "_" underscore prefix, which
+ should be controlled by configure.
+
+* The mc88110/*.S files are using the defunct "sysdep.h" configuration
+ scheme and won't compile.
+
+Conversion to the current m4 .asm style wouldn't be difficult.
+
+
+
+
+----------------
+Local variables:
+mode: text
+fill-column: 76
+End:
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/m88k/add_n.s b/Build/source/libs/gmp/gmp-6.0.0/mpn/m88k/add_n.s
new file mode 100644
index 00000000000..dbdb22f8888
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/m88k/add_n.s
@@ -0,0 +1,113 @@
+; mc88100 mpn_add_n -- Add two limb vectors of the same length > 0 and store
+; sum in a third limb vector.
+
+; Copyright 1992, 1994, 1995, 2000 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/.
+
+
+; INPUT PARAMETERS
+; res_ptr r2
+; s1_ptr r3
+; s2_ptr r4
+; size r5
+
+; This code has been optimized to run one instruction per clock, avoiding
+; load stalls and writeback contention. As a result, the instruction
+; order is not always natural.
+
+; The speed is about 4.6 clocks/limb + 18 clocks/limb-vector on an 88100,
+; but on the 88110, it seems to run much slower, 6.6 clocks/limb.
+
+ text
+ align 16
+ global ___gmpn_add_n
+___gmpn_add_n:
+ ld r6,r3,0 ; read first limb from s1_ptr
+ extu r10,r5,3
+ ld r7,r4,0 ; read first limb from s2_ptr
+
+ subu.co r5,r0,r5 ; (clear carry as side effect)
+ mak r5,r5,3<4>
+ bcnd eq0,r5,Lzero
+
+ or r12,r0,lo16(Lbase)
+ or.u r12,r12,hi16(Lbase)
+ addu r12,r12,r5 ; r12 is address for entering in loop
+
+ extu r5,r5,2 ; divide by 4
+ subu r2,r2,r5 ; adjust res_ptr
+ subu r3,r3,r5 ; adjust s1_ptr
+ subu r4,r4,r5 ; adjust s2_ptr
+
+ or r8,r6,r0
+
+ jmp.n r12
+ or r9,r7,r0
+
+Loop: addu r3,r3,32
+ st r8,r2,28
+ addu r4,r4,32
+ ld r6,r3,0
+ addu r2,r2,32
+ ld r7,r4,0
+Lzero: subu r10,r10,1 ; add 0 + 8r limbs (adj loop cnt)
+Lbase: ld r8,r3,4
+ addu.cio r6,r6,r7
+ ld r9,r4,4
+ st r6,r2,0
+ ld r6,r3,8 ; add 7 + 8r limbs
+ addu.cio r8,r8,r9
+ ld r7,r4,8
+ st r8,r2,4
+ ld r8,r3,12 ; add 6 + 8r limbs
+ addu.cio r6,r6,r7
+ ld r9,r4,12
+ st r6,r2,8
+ ld r6,r3,16 ; add 5 + 8r limbs
+ addu.cio r8,r8,r9
+ ld r7,r4,16
+ st r8,r2,12
+ ld r8,r3,20 ; add 4 + 8r limbs
+ addu.cio r6,r6,r7
+ ld r9,r4,20
+ st r6,r2,16
+ ld r6,r3,24 ; add 3 + 8r limbs
+ addu.cio r8,r8,r9
+ ld r7,r4,24
+ st r8,r2,20
+ ld r8,r3,28 ; add 2 + 8r limbs
+ addu.cio r6,r6,r7
+ ld r9,r4,28
+ st r6,r2,24
+ bcnd.n ne0,r10,Loop ; add 1 + 8r limbs
+ addu.cio r8,r8,r9
+
+ st r8,r2,28 ; store most significant limb
+
+ jmp.n r1
+ addu.ci r2,r0,r0 ; return carry-out from most sign. limb
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/m88k/mc88110/add_n.S b/Build/source/libs/gmp/gmp-6.0.0/mpn/m88k/mc88110/add_n.S
new file mode 100644
index 00000000000..c3b12b3cd05
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/m88k/mc88110/add_n.S
@@ -0,0 +1,209 @@
+; mc88110 __gmpn_add_n -- Add two limb vectors of the same length > 0 and store
+; sum in a third limb vector.
+
+; Copyright 1995, 1996, 2000 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/.
+
+
+; INPUT PARAMETERS
+#define res_ptr r2
+#define s1_ptr r3
+#define s2_ptr r4
+#define size r5
+
+#include "sysdep.h"
+
+ text
+ align 16
+ global C_SYMBOL_NAME(__gmpn_add_n)
+C_SYMBOL_NAME(__gmpn_add_n):
+ addu.co r0,r0,r0 ; clear cy flag
+ xor r12,s2_ptr,res_ptr
+ bb1 2,r12,L1
+; ** V1a **
+L0: bb0 2,res_ptr,L_v1 ; branch if res_ptr is aligned?
+/* Add least significant limb separately to align res_ptr and s2_ptr */
+ ld r10,s1_ptr,0
+ addu s1_ptr,s1_ptr,4
+ ld r8,s2_ptr,0
+ addu s2_ptr,s2_ptr,4
+ subu size,size,1
+ addu.co r6,r10,r8
+ st r6,res_ptr,0
+ addu res_ptr,res_ptr,4
+L_v1: cmp r12,size,2
+ bb1 lt,r12,Lend2
+
+ ld r10,s1_ptr,0
+ ld r12,s1_ptr,4
+ ld.d r8,s2_ptr,0
+ subu size,size,10
+ bcnd lt0,size,Lfin1
+/* Add blocks of 8 limbs until less than 8 limbs remain */
+ align 8
+Loop1: subu size,size,8
+ addu.cio r6,r10,r8
+ ld r10,s1_ptr,8
+ addu.cio r7,r12,r9
+ ld r12,s1_ptr,12
+ ld.d r8,s2_ptr,8
+ st.d r6,res_ptr,0
+ addu.cio r6,r10,r8
+ ld r10,s1_ptr,16
+ addu.cio r7,r12,r9
+ ld r12,s1_ptr,20
+ ld.d r8,s2_ptr,16
+ st.d r6,res_ptr,8
+ addu.cio r6,r10,r8
+ ld r10,s1_ptr,24
+ addu.cio r7,r12,r9
+ ld r12,s1_ptr,28
+ ld.d r8,s2_ptr,24
+ st.d r6,res_ptr,16
+ addu.cio r6,r10,r8
+ ld r10,s1_ptr,32
+ addu.cio r7,r12,r9
+ ld r12,s1_ptr,36
+ addu s1_ptr,s1_ptr,32
+ ld.d r8,s2_ptr,32
+ addu s2_ptr,s2_ptr,32
+ st.d r6,res_ptr,24
+ addu res_ptr,res_ptr,32
+ bcnd ge0,size,Loop1
+
+Lfin1: addu size,size,8-2
+ bcnd lt0,size,Lend1
+/* Add blocks of 2 limbs until less than 2 limbs remain */
+Loope1: addu.cio r6,r10,r8
+ ld r10,s1_ptr,8
+ addu.cio r7,r12,r9
+ ld r12,s1_ptr,12
+ ld.d r8,s2_ptr,8
+ st.d r6,res_ptr,0
+ subu size,size,2
+ addu s1_ptr,s1_ptr,8
+ addu s2_ptr,s2_ptr,8
+ addu res_ptr,res_ptr,8
+ bcnd ge0,size,Loope1
+Lend1: addu.cio r6,r10,r8
+ addu.cio r7,r12,r9
+ st.d r6,res_ptr,0
+
+ bb0 0,size,Lret1
+/* Add last limb */
+ ld r10,s1_ptr,8
+ ld r8,s2_ptr,8
+ addu.cio r6,r10,r8
+ st r6,res_ptr,8
+
+Lret1: jmp.n r1
+ addu.ci r2,r0,r0 ; return carry-out from most sign. limb
+
+L1: xor r12,s1_ptr,res_ptr
+ bb1 2,r12,L2
+; ** V1b **
+ or r12,r0,s2_ptr
+ or s2_ptr,r0,s1_ptr
+ or s1_ptr,r0,r12
+ br L0
+
+; ** V2 **
+/* If we come here, the alignment of s1_ptr and res_ptr as well as the
+ alignment of s2_ptr and res_ptr differ. Since there are only two ways
+ things can be aligned (that we care about) we now know that the alignment
+ of s1_ptr and s2_ptr are the same. */
+
+L2: cmp r12,size,1
+ bb1 eq,r12,Ljone
+ bb0 2,s1_ptr,L_v2 ; branch if s1_ptr is aligned
+/* Add least significant limb separately to align res_ptr and s2_ptr */
+ ld r10,s1_ptr,0
+ addu s1_ptr,s1_ptr,4
+ ld r8,s2_ptr,0
+ addu s2_ptr,s2_ptr,4
+ subu size,size,1
+ addu.co r6,r10,r8
+ st r6,res_ptr,0
+ addu res_ptr,res_ptr,4
+
+L_v2: subu size,size,8
+ bcnd lt0,size,Lfin2
+/* Add blocks of 8 limbs until less than 8 limbs remain */
+ align 8
+Loop2: subu size,size,8
+ ld.d r8,s1_ptr,0
+ ld.d r6,s2_ptr,0
+ addu.cio r8,r8,r6
+ st r8,res_ptr,0
+ addu.cio r9,r9,r7
+ st r9,res_ptr,4
+ ld.d r8,s1_ptr,8
+ ld.d r6,s2_ptr,8
+ addu.cio r8,r8,r6
+ st r8,res_ptr,8
+ addu.cio r9,r9,r7
+ st r9,res_ptr,12
+ ld.d r8,s1_ptr,16
+ ld.d r6,s2_ptr,16
+ addu.cio r8,r8,r6
+ st r8,res_ptr,16
+ addu.cio r9,r9,r7
+ st r9,res_ptr,20
+ ld.d r8,s1_ptr,24
+ ld.d r6,s2_ptr,24
+ addu.cio r8,r8,r6
+ st r8,res_ptr,24
+ addu.cio r9,r9,r7
+ st r9,res_ptr,28
+ addu s1_ptr,s1_ptr,32
+ addu s2_ptr,s2_ptr,32
+ addu res_ptr,res_ptr,32
+ bcnd ge0,size,Loop2
+
+Lfin2: addu size,size,8-2
+ bcnd lt0,size,Lend2
+Loope2: ld.d r8,s1_ptr,0
+ ld.d r6,s2_ptr,0
+ addu.cio r8,r8,r6
+ st r8,res_ptr,0
+ addu.cio r9,r9,r7
+ st r9,res_ptr,4
+ subu size,size,2
+ addu s1_ptr,s1_ptr,8
+ addu s2_ptr,s2_ptr,8
+ addu res_ptr,res_ptr,8
+ bcnd ge0,size,Loope2
+Lend2: bb0 0,size,Lret2
+/* Add last limb */
+Ljone: ld r10,s1_ptr,0
+ ld r8,s2_ptr,0
+ addu.cio r6,r10,r8
+ st r6,res_ptr,0
+
+Lret2: jmp.n r1
+ addu.ci r2,r0,r0 ; return carry-out from most sign. limb
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/m88k/mc88110/addmul_1.s b/Build/source/libs/gmp/gmp-6.0.0/mpn/m88k/mc88110/addmul_1.s
new file mode 100644
index 00000000000..321221f23ca
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/m88k/mc88110/addmul_1.s
@@ -0,0 +1,70 @@
+; mc88110 __gmpn_addmul_1 -- Multiply a limb vector with a single limb and
+; store the product in a second limb vector.
+
+; Copyright 1996, 2000 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/.
+
+
+; INPUT PARAMETERS
+; res_ptr r2
+; s1_ptr r3
+; size r4
+; s2_limb r5
+
+ text
+ align 16
+ global ___gmpn_addmul_1
+___gmpn_addmul_1:
+ lda r3,r3[r4]
+ lda r8,r2[r4] ; RES_PTR in r8 since r2 is retval
+ subu r4,r0,r4
+ addu.co r2,r0,r0 ; r2 = cy = 0
+
+ ld r6,r3[r4]
+ addu r4,r4,1
+ subu r8,r8,4
+ bcnd.n eq0,r4,Lend
+ mulu.d r10,r6,r5
+
+Loop: ld r7,r8[r4]
+ ld r6,r3[r4]
+ addu.cio r9,r11,r2
+ addu.ci r2,r10,r0
+ addu.co r9,r9,r7
+ st r9,r8[r4]
+ addu r4,r4,1
+ mulu.d r10,r6,r5
+ bcnd ne0,r4,Loop
+
+Lend: ld r7,r8,0
+ addu.cio r9,r11,r2
+ addu.ci r2,r10,r0
+ addu.co r9,r9,r7
+ st r9,r8,0
+ jmp.n r1
+ addu.ci r2,r2,r0
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/m88k/mc88110/mul_1.s b/Build/source/libs/gmp/gmp-6.0.0/mpn/m88k/mc88110/mul_1.s
new file mode 100644
index 00000000000..28fd14b77b1
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/m88k/mc88110/mul_1.s
@@ -0,0 +1,68 @@
+; mc88110 __gmpn_mul_1 -- Multiply a limb vector with a single limb and
+; store the product in a second limb vector.
+
+; Copyright 1992, 1994, 1995, 2000 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/.
+
+
+; INPUT PARAMETERS
+; res_ptr r2
+; s1_ptr r3
+; size r4
+; s2_limb r5
+
+ text
+ align 16
+ global ___gmpn_mul_1
+___gmpn_mul_1:
+ ; Make S1_PTR and RES_PTR point at the end of their blocks
+ ; and negate SIZE.
+ lda r3,r3[r4]
+ lda r8,r2[r4] ; RES_PTR in r8 since r2 is retval
+ subu r4,r0,r4
+
+ addu.co r2,r0,r0 ; r2 = cy = 0
+
+ ld r6,r3[r4]
+ addu r4,r4,1
+ mulu.d r10,r6,r5
+ bcnd.n eq0,r4,Lend
+ subu r8,r8,8
+
+Loop: ld r6,r3[r4]
+ addu.cio r9,r11,r2
+ or r2,r10,r0 ; could be avoided if unrolled
+ addu r4,r4,1
+ mulu.d r10,r6,r5
+ bcnd.n ne0,r4,Loop
+ st r9,r8[r4]
+
+Lend: addu.cio r9,r11,r2
+ st r9,r8,4
+ jmp.n r1
+ addu.ci r2,r10,r0
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/m88k/mc88110/sub_n.S b/Build/source/libs/gmp/gmp-6.0.0/mpn/m88k/mc88110/sub_n.S
new file mode 100644
index 00000000000..f0a8ecb3f06
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/m88k/mc88110/sub_n.S
@@ -0,0 +1,285 @@
+; mc88110 __gmpn_sub_n -- Subtract two limb vectors of the same length > 0 and
+; store difference in a third limb vector.
+
+; Copyright 1995, 1996, 2000 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/.
+
+
+; INPUT PARAMETERS
+#define res_ptr r2
+#define s1_ptr r3
+#define s2_ptr r4
+#define size r5
+
+#include "sysdep.h"
+
+ text
+ align 16
+ global C_SYMBOL_NAME(__gmpn_sub_n)
+C_SYMBOL_NAME(__gmpn_sub_n):
+ subu.co r0,r0,r0 ; set cy flag
+ xor r12,s2_ptr,res_ptr
+ bb1 2,r12,L1
+; ** V1a **
+L0: bb0 2,res_ptr,L_v1 ; branch if res_ptr is aligned
+/* Add least significant limb separately to align res_ptr and s2_ptr */
+ ld r10,s1_ptr,0
+ addu s1_ptr,s1_ptr,4
+ ld r8,s2_ptr,0
+ addu s2_ptr,s2_ptr,4
+ subu size,size,1
+ subu.co r6,r10,r8
+ st r6,res_ptr,0
+ addu res_ptr,res_ptr,4
+L_v1: cmp r12,size,2
+ bb1 lt,r12,Lend2
+
+ ld r10,s1_ptr,0
+ ld r12,s1_ptr,4
+ ld.d r8,s2_ptr,0
+ subu size,size,10
+ bcnd lt0,size,Lfin1
+/* Add blocks of 8 limbs until less than 8 limbs remain */
+ align 8
+Loop1: subu size,size,8
+ subu.cio r6,r10,r8
+ ld r10,s1_ptr,8
+ subu.cio r7,r12,r9
+ ld r12,s1_ptr,12
+ ld.d r8,s2_ptr,8
+ st.d r6,res_ptr,0
+ subu.cio r6,r10,r8
+ ld r10,s1_ptr,16
+ subu.cio r7,r12,r9
+ ld r12,s1_ptr,20
+ ld.d r8,s2_ptr,16
+ st.d r6,res_ptr,8
+ subu.cio r6,r10,r8
+ ld r10,s1_ptr,24
+ subu.cio r7,r12,r9
+ ld r12,s1_ptr,28
+ ld.d r8,s2_ptr,24
+ st.d r6,res_ptr,16
+ subu.cio r6,r10,r8
+ ld r10,s1_ptr,32
+ subu.cio r7,r12,r9
+ ld r12,s1_ptr,36
+ addu s1_ptr,s1_ptr,32
+ ld.d r8,s2_ptr,32
+ addu s2_ptr,s2_ptr,32
+ st.d r6,res_ptr,24
+ addu res_ptr,res_ptr,32
+ bcnd ge0,size,Loop1
+
+Lfin1: addu size,size,8-2
+ bcnd lt0,size,Lend1
+/* Add blocks of 2 limbs until less than 2 limbs remain */
+Loope1: subu.cio r6,r10,r8
+ ld r10,s1_ptr,8
+ subu.cio r7,r12,r9
+ ld r12,s1_ptr,12
+ ld.d r8,s2_ptr,8
+ st.d r6,res_ptr,0
+ subu size,size,2
+ addu s1_ptr,s1_ptr,8
+ addu s2_ptr,s2_ptr,8
+ addu res_ptr,res_ptr,8
+ bcnd ge0,size,Loope1
+Lend1: subu.cio r6,r10,r8
+ subu.cio r7,r12,r9
+ st.d r6,res_ptr,0
+
+ bb0 0,size,Lret1
+/* Add last limb */
+ ld r10,s1_ptr,8
+ ld r8,s2_ptr,8
+ subu.cio r6,r10,r8
+ st r6,res_ptr,8
+
+Lret1: addu.ci r2,r0,r0 ; return carry-out from most sign. limb
+ jmp.n r1
+ xor r2,r2,1
+
+L1: xor r12,s1_ptr,res_ptr
+ bb1 2,r12,L2
+; ** V1b **
+ bb0 2,res_ptr,L_v1b ; branch if res_ptr is aligned
+/* Add least significant limb separately to align res_ptr and s1_ptr */
+ ld r10,s2_ptr,0
+ addu s2_ptr,s2_ptr,4
+ ld r8,s1_ptr,0
+ addu s1_ptr,s1_ptr,4
+ subu size,size,1
+ subu.co r6,r8,r10
+ st r6,res_ptr,0
+ addu res_ptr,res_ptr,4
+L_v1b: cmp r12,size,2
+ bb1 lt,r12,Lend2
+
+ ld r10,s2_ptr,0
+ ld r12,s2_ptr,4
+ ld.d r8,s1_ptr,0
+ subu size,size,10
+ bcnd lt0,size,Lfin1b
+/* Add blocks of 8 limbs until less than 8 limbs remain */
+ align 8
+Loop1b: subu size,size,8
+ subu.cio r6,r8,r10
+ ld r10,s2_ptr,8
+ subu.cio r7,r9,r12
+ ld r12,s2_ptr,12
+ ld.d r8,s1_ptr,8
+ st.d r6,res_ptr,0
+ subu.cio r6,r8,r10
+ ld r10,s2_ptr,16
+ subu.cio r7,r9,r12
+ ld r12,s2_ptr,20
+ ld.d r8,s1_ptr,16
+ st.d r6,res_ptr,8
+ subu.cio r6,r8,r10
+ ld r10,s2_ptr,24
+ subu.cio r7,r9,r12
+ ld r12,s2_ptr,28
+ ld.d r8,s1_ptr,24
+ st.d r6,res_ptr,16
+ subu.cio r6,r8,r10
+ ld r10,s2_ptr,32
+ subu.cio r7,r9,r12
+ ld r12,s2_ptr,36
+ addu s2_ptr,s2_ptr,32
+ ld.d r8,s1_ptr,32
+ addu s1_ptr,s1_ptr,32
+ st.d r6,res_ptr,24
+ addu res_ptr,res_ptr,32
+ bcnd ge0,size,Loop1b
+
+Lfin1b: addu size,size,8-2
+ bcnd lt0,size,Lend1b
+/* Add blocks of 2 limbs until less than 2 limbs remain */
+Loope1b:subu.cio r6,r8,r10
+ ld r10,s2_ptr,8
+ subu.cio r7,r9,r12
+ ld r12,s2_ptr,12
+ ld.d r8,s1_ptr,8
+ st.d r6,res_ptr,0
+ subu size,size,2
+ addu s1_ptr,s1_ptr,8
+ addu s2_ptr,s2_ptr,8
+ addu res_ptr,res_ptr,8
+ bcnd ge0,size,Loope1b
+Lend1b: subu.cio r6,r8,r10
+ subu.cio r7,r9,r12
+ st.d r6,res_ptr,0
+
+ bb0 0,size,Lret1b
+/* Add last limb */
+ ld r10,s2_ptr,8
+ ld r8,s1_ptr,8
+ subu.cio r6,r8,r10
+ st r6,res_ptr,8
+
+Lret1b: addu.ci r2,r0,r0 ; return carry-out from most sign. limb
+ jmp.n r1
+ xor r2,r2,1
+
+; ** V2 **
+/* If we come here, the alignment of s1_ptr and res_ptr as well as the
+ alignment of s2_ptr and res_ptr differ. Since there are only two ways
+ things can be aligned (that we care about) we now know that the alignment
+ of s1_ptr and s2_ptr are the same. */
+
+L2: cmp r12,size,1
+ bb1 eq,r12,Ljone
+ bb0 2,s1_ptr,L_v2 ; branch if s1_ptr is aligned
+/* Add least significant limb separately to align res_ptr and s2_ptr */
+ ld r10,s1_ptr,0
+ addu s1_ptr,s1_ptr,4
+ ld r8,s2_ptr,0
+ addu s2_ptr,s2_ptr,4
+ subu size,size,1
+ subu.co r6,r10,r8
+ st r6,res_ptr,0
+ addu res_ptr,res_ptr,4
+
+L_v2: subu size,size,8
+ bcnd lt0,size,Lfin2
+/* Add blocks of 8 limbs until less than 8 limbs remain */
+ align 8
+Loop2: subu size,size,8
+ ld.d r8,s1_ptr,0
+ ld.d r6,s2_ptr,0
+ subu.cio r8,r8,r6
+ st r8,res_ptr,0
+ subu.cio r9,r9,r7
+ st r9,res_ptr,4
+ ld.d r8,s1_ptr,8
+ ld.d r6,s2_ptr,8
+ subu.cio r8,r8,r6
+ st r8,res_ptr,8
+ subu.cio r9,r9,r7
+ st r9,res_ptr,12
+ ld.d r8,s1_ptr,16
+ ld.d r6,s2_ptr,16
+ subu.cio r8,r8,r6
+ st r8,res_ptr,16
+ subu.cio r9,r9,r7
+ st r9,res_ptr,20
+ ld.d r8,s1_ptr,24
+ ld.d r6,s2_ptr,24
+ subu.cio r8,r8,r6
+ st r8,res_ptr,24
+ subu.cio r9,r9,r7
+ st r9,res_ptr,28
+ addu s1_ptr,s1_ptr,32
+ addu s2_ptr,s2_ptr,32
+ addu res_ptr,res_ptr,32
+ bcnd ge0,size,Loop2
+
+Lfin2: addu size,size,8-2
+ bcnd lt0,size,Lend2
+Loope2: ld.d r8,s1_ptr,0
+ ld.d r6,s2_ptr,0
+ subu.cio r8,r8,r6
+ st r8,res_ptr,0
+ subu.cio r9,r9,r7
+ st r9,res_ptr,4
+ subu size,size,2
+ addu s1_ptr,s1_ptr,8
+ addu s2_ptr,s2_ptr,8
+ addu res_ptr,res_ptr,8
+ bcnd ge0,size,Loope2
+Lend2: bb0 0,size,Lret2
+/* Add last limb */
+Ljone: ld r10,s1_ptr,0
+ ld r8,s2_ptr,0
+ subu.cio r6,r10,r8
+ st r6,res_ptr,0
+
+Lret2: addu.ci r2,r0,r0 ; return carry-out from most sign. limb
+ jmp.n r1
+ xor r2,r2,1
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/m88k/mul_1.s b/Build/source/libs/gmp/gmp-6.0.0/mpn/m88k/mul_1.s
new file mode 100644
index 00000000000..c8abdc0b7f4
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/m88k/mul_1.s
@@ -0,0 +1,136 @@
+; mc88100 __gmpn_mul_1 -- Multiply a limb vector with a single limb and
+; store the product in a second limb vector.
+
+; Copyright 1992, 1994, 1995, 2000 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/.
+
+
+; INPUT PARAMETERS
+; res_ptr r2
+; s1_ptr r3
+; size r4
+; s2_limb r5
+
+; Common overhead is about 11 cycles/invocation.
+
+; The speed for S2_LIMB >= 0x10000 is approximately 21 cycles/limb. (The
+; pipeline stalls 2 cycles due to WB contention.)
+
+; The speed for S2_LIMB < 0x10000 is approximately 16 cycles/limb. (The
+; pipeline stalls 2 cycles due to WB contention and 1 cycle due to latency.)
+
+; To enhance speed:
+; 1. Unroll main loop 4-8 times.
+; 2. Schedule code to avoid WB contention. It might be tempting to move the
+; ld instruction in the loops down to save 2 cycles (less WB contention),
+; but that looses because the ultimate value will be read from outside
+; the allocated space. But if we handle the ultimate multiplication in
+; the tail, we can do this.
+; 3. Make the multiplication with less instructions. I think the code for
+; (S2_LIMB >= 0x10000) is not minimal.
+; With these techniques the (S2_LIMB >= 0x10000) case would run in 17 or
+; less cycles/limb; the (S2_LIMB < 0x10000) case would run in 11
+; cycles/limb. (Assuming infinite unrolling.)
+
+ text
+ align 16
+ global ___gmpn_mul_1
+___gmpn_mul_1:
+
+ ; Make S1_PTR and RES_PTR point at the end of their blocks
+ ; and negate SIZE.
+ lda r3,r3[r4]
+ lda r6,r2[r4] ; RES_PTR in r6 since r2 is retval
+ subu r4,r0,r4
+
+ addu.co r2,r0,r0 ; r2 = cy = 0
+ ld r9,r3[r4]
+ mask r7,r5,0xffff ; r7 = lo(S2_LIMB)
+ extu r8,r5,16 ; r8 = hi(S2_LIMB)
+ bcnd.n eq0,r8,Lsmall ; jump if (hi(S2_LIMB) == 0)
+ subu r6,r6,4
+
+; General code for any value of S2_LIMB.
+
+ ; Make a stack frame and save r25 and r26
+ subu r31,r31,16
+ st.d r25,r31,8
+
+ ; Enter the loop in the middle
+ br.n L1
+ addu r4,r4,1
+
+Loop: ld r9,r3[r4]
+ st r26,r6[r4]
+; bcnd ne0,r0,0 ; bubble
+ addu r4,r4,1
+L1: mul r26,r9,r5 ; low word of product mul_1 WB ld
+ mask r12,r9,0xffff ; r12 = lo(s1_limb) mask_1
+ mul r11,r12,r7 ; r11 = prod_0 mul_2 WB mask_1
+ mul r10,r12,r8 ; r10 = prod_1a mul_3
+ extu r13,r9,16 ; r13 = hi(s1_limb) extu_1 WB mul_1
+ mul r12,r13,r7 ; r12 = prod_1b mul_4 WB extu_1
+ mul r25,r13,r8 ; r25 = prod_2 mul_5 WB mul_2
+ extu r11,r11,16 ; r11 = hi(prod_0) extu_2 WB mul_3
+ addu r10,r10,r11 ; addu_1 WB extu_2
+; bcnd ne0,r0,0 ; bubble WB addu_1
+ addu.co r10,r10,r12 ; WB mul_4
+ mask.u r10,r10,0xffff ; move the 16 most significant bits...
+ addu.ci r10,r10,r0 ; ...to the low half of the word...
+ rot r10,r10,16 ; ...and put carry in pos 16.
+ addu.co r26,r26,r2 ; add old carry limb
+ bcnd.n ne0,r4,Loop
+ addu.ci r2,r25,r10 ; compute new carry limb
+
+ st r26,r6[r4]
+ ld.d r25,r31,8
+ jmp.n r1
+ addu r31,r31,16
+
+; Fast code for S2_LIMB < 0x10000
+Lsmall:
+ ; Enter the loop in the middle
+ br.n SL1
+ addu r4,r4,1
+
+SLoop: ld r9,r3[r4] ;
+ st r8,r6[r4] ;
+ addu r4,r4,1 ;
+SL1: mul r8,r9,r5 ; low word of product
+ mask r12,r9,0xffff ; r12 = lo(s1_limb)
+ extu r13,r9,16 ; r13 = hi(s1_limb)
+ mul r11,r12,r7 ; r11 = prod_0
+ mul r12,r13,r7 ; r12 = prod_1b
+ addu.cio r8,r8,r2 ; add old carry limb
+ extu r10,r11,16 ; r11 = hi(prod_0)
+ addu r10,r10,r12 ;
+ bcnd.n ne0,r4,SLoop
+ extu r2,r10,16 ; r2 = new carry limb
+
+ jmp.n r1
+ st r8,r6[r4]
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/m88k/sub_n.s b/Build/source/libs/gmp/gmp-6.0.0/mpn/m88k/sub_n.s
new file mode 100644
index 00000000000..2bd8f09ca3d
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/m88k/sub_n.s
@@ -0,0 +1,115 @@
+; mc88100 mpn_sub_n -- Subtract two limb vectors of the same length > 0 and
+; store difference in a third limb vector.
+
+; Copyright 1992, 1994, 1996, 2000 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/.
+
+
+; INPUT PARAMETERS
+; res_ptr r2
+; s1_ptr r3
+; s2_ptr r4
+; size r5
+
+; This code has been optimized to run one instruction per clock, avoiding
+; load stalls and writeback contention. As a result, the instruction
+; order is not always natural.
+
+; The speed is about 4.6 clocks/limb + 18 clocks/limb-vector on an 88100,
+; but on the 88110, it seems to run much slower, 6.6 clocks/limb.
+
+ text
+ align 16
+ global ___gmpn_sub_n
+___gmpn_sub_n:
+ ld r6,r3,0 ; read first limb from s1_ptr
+ extu r10,r5,3
+ ld r7,r4,0 ; read first limb from s2_ptr
+
+ subu r5,r0,r5
+ mak r5,r5,3<4>
+ bcnd.n eq0,r5,Lzero
+ subu.co r0,r0,r0 ; initialize carry
+
+ or r12,r0,lo16(Lbase)
+ or.u r12,r12,hi16(Lbase)
+ addu r12,r12,r5 ; r12 is address for entering in loop
+
+ extu r5,r5,2 ; divide by 4
+ subu r2,r2,r5 ; adjust res_ptr
+ subu r3,r3,r5 ; adjust s1_ptr
+ subu r4,r4,r5 ; adjust s2_ptr
+
+ or r8,r6,r0
+
+ jmp.n r12
+ or r9,r7,r0
+
+Loop: addu r3,r3,32
+ st r8,r2,28
+ addu r4,r4,32
+ ld r6,r3,0
+ addu r2,r2,32
+ ld r7,r4,0
+Lzero: subu r10,r10,1 ; subtract 0 + 8r limbs (adj loop cnt)
+Lbase: ld r8,r3,4
+ subu.cio r6,r6,r7
+ ld r9,r4,4
+ st r6,r2,0
+ ld r6,r3,8 ; subtract 7 + 8r limbs
+ subu.cio r8,r8,r9
+ ld r7,r4,8
+ st r8,r2,4
+ ld r8,r3,12 ; subtract 6 + 8r limbs
+ subu.cio r6,r6,r7
+ ld r9,r4,12
+ st r6,r2,8
+ ld r6,r3,16 ; subtract 5 + 8r limbs
+ subu.cio r8,r8,r9
+ ld r7,r4,16
+ st r8,r2,12
+ ld r8,r3,20 ; subtract 4 + 8r limbs
+ subu.cio r6,r6,r7
+ ld r9,r4,20
+ st r6,r2,16
+ ld r6,r3,24 ; subtract 3 + 8r limbs
+ subu.cio r8,r8,r9
+ ld r7,r4,24
+ st r8,r2,20
+ ld r8,r3,28 ; subtract 2 + 8r limbs
+ subu.cio r6,r6,r7
+ ld r9,r4,28
+ st r6,r2,24
+ bcnd.n ne0,r10,Loop ; subtract 1 + 8r limbs
+ subu.cio r8,r8,r9
+
+ st r8,r2,28 ; store most significant limb
+
+ addu.ci r2,r0,r0 ; return carry-out from most sign. limb
+ jmp.n r1
+ xor r2,r2,1
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/minithres/gmp-mparam.h b/Build/source/libs/gmp/gmp-6.0.0/mpn/minithres/gmp-mparam.h
new file mode 100644
index 00000000000..1b8f3115160
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/minithres/gmp-mparam.h
@@ -0,0 +1,109 @@
+/* Minimal values gmp-mparam.h -- Compiler/machine parameter header file.
+
+Copyright 1991, 1993, 1994, 2000, 2006, 2008-2010, 2012 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/. */
+
+/* The values in this file are not currently minimal.
+ Trimming them further would be good. */
+
+#define MOD_1_NORM_THRESHOLD 0 /* always */
+#define MOD_1_UNNORM_THRESHOLD 0 /* always */
+#define MOD_1N_TO_MOD_1_1_THRESHOLD 2
+#define MOD_1U_TO_MOD_1_1_THRESHOLD 2
+#define MOD_1_1_TO_MOD_1_2_THRESHOLD 3
+#define MOD_1_2_TO_MOD_1_4_THRESHOLD 4
+#define PREINV_MOD_1_TO_MOD_1_THRESHOLD 1
+#define USE_PREINV_DIVREM_1 1 /* native */
+#define DIVEXACT_1_THRESHOLD 0 /* always (native) */
+#define BMOD_1_TO_MOD_1_THRESHOLD 3
+
+#define MUL_TOOM22_THRESHOLD 8
+#define MUL_TOOM33_THRESHOLD 20
+#define MUL_TOOM44_THRESHOLD 24
+#define MUL_TOOM6H_THRESHOLD 70 /* FIXME */
+#define MUL_TOOM8H_THRESHOLD 86
+
+#define MUL_TOOM32_TO_TOOM43_THRESHOLD 50 /* FIXME */
+#define MUL_TOOM32_TO_TOOM53_THRESHOLD 50 /* FIXME */
+#define MUL_TOOM42_TO_TOOM53_THRESHOLD 50 /* FIXME */
+#define MUL_TOOM42_TO_TOOM63_THRESHOLD 50 /* FIXME */
+
+#define SQR_BASECASE_THRESHOLD 0
+#define SQR_TOOM2_THRESHOLD 8
+#define SQR_TOOM3_THRESHOLD 20
+#define SQR_TOOM4_THRESHOLD 24
+#define SQR_TOOM6H_THRESHOLD 70 /* FIXME */
+#define SQR_TOOM8H_THRESHOLD 86
+
+#define MULMOD_BNM1_THRESHOLD 10
+#define SQRMOD_BNM1_THRESHOLD 10
+
+#define MUL_FFT_TABLE {64, 256, 1024, 4096, 8192, 65536, 0}
+#define MUL_FFT_MODF_THRESHOLD 65
+#define MUL_FFT_THRESHOLD 200
+
+#define SQR_FFT_TABLE {64, 256, 1024, 4096, 8192, 65536, 0}
+#define SQR_FFT_MODF_THRESHOLD 65
+#define SQR_FFT_THRESHOLD 200
+
+#define MULLO_BASECASE_THRESHOLD 0
+#define MULLO_DC_THRESHOLD 2
+#define MULLO_MUL_N_THRESHOLD 4
+
+#define DC_DIV_QR_THRESHOLD 6
+#define DC_DIVAPPR_Q_THRESHOLD 6
+#define DC_BDIV_QR_THRESHOLD 4
+#define DC_BDIV_Q_THRESHOLD 4
+
+#define INV_MULMOD_BNM1_THRESHOLD 2
+#define INV_NEWTON_THRESHOLD 6
+#define INV_APPR_THRESHOLD 4
+
+#define BINV_NEWTON_THRESHOLD 6
+#define REDC_1_TO_REDC_N_THRESHOLD 9
+
+#define MU_DIV_QR_THRESHOLD 8
+#define MU_DIVAPPR_Q_THRESHOLD 8
+#define MUPI_DIV_QR_THRESHOLD 8
+#define MU_BDIV_QR_THRESHOLD 8
+#define MU_BDIV_Q_THRESHOLD 8
+
+#define MATRIX22_STRASSEN_THRESHOLD 2
+#define HGCD_THRESHOLD 10
+#define GCD_DC_THRESHOLD 20
+#define GCDEXT_SCHOENHAGE_THRESHOLD 20
+#define JACOBI_BASE_METHOD 1
+
+#define GET_STR_DC_THRESHOLD 4
+#define GET_STR_PRECOMPUTE_THRESHOLD 10
+#define SET_STR_THRESHOLD 64
+#define SET_STR_PRECOMPUTE_THRESHOLD 100
+
+#define FAC_ODD_THRESHOLD 0 /* always */
+#define FAC_DSC_THRESHOLD 70
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/mips32/add_n.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/mips32/add_n.asm
new file mode 100644
index 00000000000..e7d4c48f480
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/mips32/add_n.asm
@@ -0,0 +1,124 @@
+dnl MIPS32 mpn_add_n -- Add two limb vectors of the same length > 0 and store
+dnl sum in a third limb vector.
+
+dnl Copyright 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 s2_ptr $6
+C size $7
+
+ASM_START()
+PROLOGUE(mpn_add_n)
+
+ lw $10,0($5)
+ lw $11,0($6)
+
+ addiu $7,$7,-1
+ and $9,$7,4-1 C number of limbs in first loop
+ beq $9,$0,.L0 C if multiple of 4 limbs, skip first loop
+ move $2,$0
+
+ subu $7,$7,$9
+
+.Loop0: addiu $9,$9,-1
+ lw $12,4($5)
+ addu $11,$11,$2
+ lw $13,4($6)
+ sltu $8,$11,$2
+ addu $11,$10,$11
+ sltu $2,$11,$10
+ sw $11,0($4)
+ or $2,$2,$8
+
+ addiu $5,$5,4
+ addiu $6,$6,4
+ move $10,$12
+ move $11,$13
+ bne $9,$0,.Loop0
+ addiu $4,$4,4
+
+.L0: beq $7,$0,.Lend
+ nop
+
+.Loop: addiu $7,$7,-4
+
+ lw $12,4($5)
+ addu $11,$11,$2
+ lw $13,4($6)
+ sltu $8,$11,$2
+ addu $11,$10,$11
+ sltu $2,$11,$10
+ sw $11,0($4)
+ or $2,$2,$8
+
+ lw $10,8($5)
+ addu $13,$13,$2
+ lw $11,8($6)
+ sltu $8,$13,$2
+ addu $13,$12,$13
+ sltu $2,$13,$12
+ sw $13,4($4)
+ or $2,$2,$8
+
+ lw $12,12($5)
+ addu $11,$11,$2
+ lw $13,12($6)
+ sltu $8,$11,$2
+ addu $11,$10,$11
+ sltu $2,$11,$10
+ sw $11,8($4)
+ or $2,$2,$8
+
+ lw $10,16($5)
+ addu $13,$13,$2
+ lw $11,16($6)
+ sltu $8,$13,$2
+ addu $13,$12,$13
+ sltu $2,$13,$12
+ sw $13,12($4)
+ or $2,$2,$8
+
+ addiu $5,$5,16
+ addiu $6,$6,16
+
+ bne $7,$0,.Loop
+ addiu $4,$4,16
+
+.Lend: addu $11,$11,$2
+ sltu $8,$11,$2
+ addu $11,$10,$11
+ sltu $2,$11,$10
+ sw $11,0($4)
+ j $31
+ or $2,$2,$8
+EPILOGUE(mpn_add_n)
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/mips32/addmul_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/mips32/addmul_1.asm
new file mode 100644
index 00000000000..9aa9e163ce8
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/mips32/addmul_1.asm
@@ -0,0 +1,101 @@
+dnl MIPS32 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, 1996, 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
+ lw $8,0($5)
+
+C feed-in phase 1
+ addiu $5,$5,4
+ multu $8,$7
+
+ addiu $6,$6,-1
+ beq $6,$0,$LC0
+ move $2,$0 C zero cy2
+
+ addiu $6,$6,-1
+ beq $6,$0,$LC1
+ lw $8,0($5) C load new s1 limb as early as possible
+
+Loop: lw $10,0($4)
+ mflo $3
+ mfhi $9
+ addiu $5,$5,4
+ addu $3,$3,$2 C add old carry limb to low product limb
+ multu $8,$7
+ lw $8,0($5) C load new s1 limb as early as possible
+ addiu $6,$6,-1 C decrement loop counter
+ sltu $2,$3,$2 C carry from previous addition -> $2
+ addu $3,$10,$3
+ sltu $10,$3,$10
+ addu $2,$2,$10
+ sw $3,0($4)
+ addiu $4,$4,4
+ bne $6,$0,Loop
+ addu $2,$9,$2 C add high product limb and carry from addition
+
+C wind-down phase 1
+$LC1: lw $10,0($4)
+ mflo $3
+ mfhi $9
+ addu $3,$3,$2
+ sltu $2,$3,$2
+ multu $8,$7
+ addu $3,$10,$3
+ sltu $10,$3,$10
+ addu $2,$2,$10
+ sw $3,0($4)
+ addiu $4,$4,4
+ addu $2,$9,$2 C add high product limb and carry from addition
+
+C wind-down phase 0
+$LC0: lw $10,0($4)
+ mflo $3
+ mfhi $9
+ addu $3,$3,$2
+ sltu $2,$3,$2
+ addu $3,$10,$3
+ sltu $10,$3,$10
+ addu $2,$2,$10
+ sw $3,0($4)
+ j $31
+ addu $2,$9,$2 C add high product limb and carry from addition
+EPILOGUE(mpn_addmul_1)
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/mips32/gmp-mparam.h b/Build/source/libs/gmp/gmp-6.0.0/mpn/mips32/gmp-mparam.h
new file mode 100644
index 00000000000..986135df964
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/mips32/gmp-mparam.h
@@ -0,0 +1,72 @@
+/* gmp-mparam.h -- Compiler/machine parameter header file.
+
+Copyright 1991, 1993, 1994, 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/. */
+
+
+#define GMP_LIMB_BITS 32
+#define GMP_LIMB_BYTES 4
+
+
+/* Generated by tuneup.c, 2002-02-20, gcc 2.95 (R3000) */
+
+#define MUL_TOOM22_THRESHOLD 20
+#define MUL_TOOM33_THRESHOLD 50
+
+#define SQR_BASECASE_THRESHOLD 7
+#define SQR_TOOM2_THRESHOLD 57
+#define SQR_TOOM3_THRESHOLD 78
+
+#define DIV_SB_PREINV_THRESHOLD 0 /* always */
+#define DIV_DC_THRESHOLD 57
+#define POWM_THRESHOLD 78
+
+#define GCD_ACCEL_THRESHOLD 3
+#define JACOBI_BASE_METHOD 2
+
+#define DIVREM_1_NORM_THRESHOLD 0 /* always */
+#define DIVREM_1_UNNORM_THRESHOLD 0 /* always */
+#define MOD_1_NORM_THRESHOLD 0 /* always */
+#define MOD_1_UNNORM_THRESHOLD 0 /* always */
+#define USE_PREINV_DIVREM_1 1
+#define USE_PREINV_MOD_1 1
+#define DIVREM_2_THRESHOLD 0 /* always */
+#define DIVEXACT_1_THRESHOLD 0 /* always */
+#define MODEXACT_1_ODD_THRESHOLD 0 /* always */
+
+#define GET_STR_DC_THRESHOLD 19
+#define GET_STR_PRECOMPUTE_THRESHOLD 25
+#define SET_STR_THRESHOLD 309
+
+#define MUL_FFT_TABLE { 496, 1056, 2176, 5632, 14336, 40960, 0 }
+#define MUL_FFT_MODF_THRESHOLD 624
+#define MUL_FFT_THRESHOLD 5888
+
+#define SQR_FFT_TABLE { 496, 1184, 2176, 5632, 14336, 40960, 0 }
+#define SQR_FFT_MODF_THRESHOLD 560
+#define SQR_FFT_THRESHOLD 5376
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/mips32/lshift.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/mips32/lshift.asm
new file mode 100644
index 00000000000..6a58bb4579b
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/mips32/lshift.asm
@@ -0,0 +1,99 @@
+dnl MIPS32 mpn_lshift -- Left shift.
+
+dnl Copyright 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 src_ptr $5
+C size $6
+C cnt $7
+
+ASM_START()
+PROLOGUE(mpn_lshift)
+ sll $2,$6,2
+ addu $5,$5,$2 C make r5 point at end of src
+ lw $10,-4($5) C load first limb
+ subu $13,$0,$7
+ addu $4,$4,$2 C make r4 point at end of res
+ addiu $6,$6,-1
+ and $9,$6,4-1 C number of limbs in first loop
+ beq $9,$0,.L0 C if multiple of 4 limbs, skip first loop
+ srl $2,$10,$13 C compute function result
+
+ subu $6,$6,$9
+
+.Loop0: lw $3,-8($5)
+ addiu $4,$4,-4
+ addiu $5,$5,-4
+ addiu $9,$9,-1
+ sll $11,$10,$7
+ srl $12,$3,$13
+ move $10,$3
+ or $8,$11,$12
+ bne $9,$0,.Loop0
+ sw $8,0($4)
+
+.L0: beq $6,$0,.Lend
+ nop
+
+.Loop: lw $3,-8($5)
+ addiu $4,$4,-16
+ addiu $6,$6,-4
+ sll $11,$10,$7
+ srl $12,$3,$13
+
+ lw $10,-12($5)
+ sll $14,$3,$7
+ or $8,$11,$12
+ sw $8,12($4)
+ srl $9,$10,$13
+
+ lw $3,-16($5)
+ sll $11,$10,$7
+ or $8,$14,$9
+ sw $8,8($4)
+ srl $12,$3,$13
+
+ lw $10,-20($5)
+ sll $14,$3,$7
+ or $8,$11,$12
+ sw $8,4($4)
+ srl $9,$10,$13
+
+ addiu $5,$5,-16
+ or $8,$14,$9
+ bgtz $6,.Loop
+ sw $8,0($4)
+
+.Lend: sll $8,$10,$7
+ j $31
+ sw $8,-4($4)
+EPILOGUE(mpn_lshift)
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/mips32/mips-defs.m4 b/Build/source/libs/gmp/gmp-6.0.0/mpn/mips32/mips-defs.m4
new file mode 100644
index 00000000000..5fa89eca35d
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/mips32/mips-defs.m4
@@ -0,0 +1,80 @@
+divert(-1)
+
+dnl m4 macros for MIPS assembly code (both 32-bit and 64-bit).
+
+
+dnl Copyright 2000-2002 Free Software Foundation, Inc.
+dnl
+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 Usage: ASM_START()
+define(`ASM_START',
+m4_assert_numargs(0)
+` .set noreorder
+ .set nomacro')
+
+dnl Usage: X(value)
+define(`X',
+m4_assert_numargs(1)
+`0x$1')
+
+dnl Called: PROLOGUE_cpu(GSYM_PREFIX`'foo)
+dnl EPILOGUE_cpu(GSYM_PREFIX`'foo)
+
+define(`PROLOGUE_cpu',
+m4_assert_numargs(1)
+` .text
+ .align 4
+ .globl $1
+ .ent $1
+$1:')
+
+define(`EPILOGUE_cpu',
+m4_assert_numargs(1)
+` .end $1')
+
+
+dnl Usage: r0 ... r31
+dnl f0 ... f31
+dnl
+dnl Map register names r0 to $0, and f0 to $f0, etc.
+dnl
+dnl defreg() is used to protect the $ in $0 (otherwise it would represent a
+dnl macro argument). Double quoting is used to protect the f0 in $f0
+dnl (otherwise it would be an infinite recursion).
+
+forloop(i,0,31,`defreg(`r'i,$i)')
+forloop(i,0,31,`deflit(`f'i,``$f''i)')
+
+
+dnl Usage: ASM_END()
+define(`ASM_END',
+m4_assert_numargs(0)
+)
+
+divert
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/mips32/mips.m4 b/Build/source/libs/gmp/gmp-6.0.0/mpn/mips32/mips.m4
new file mode 100644
index 00000000000..8b49e575e41
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/mips32/mips.m4
@@ -0,0 +1,80 @@
+divert(-1)
+
+dnl m4 macros for MIPS assembly code.
+
+
+dnl Copyright 2000-2002 Free Software Foundation, Inc.
+dnl
+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 Usage: ASM_START()
+define(`ASM_START',
+m4_assert_numargs(0)
+` .set noreorder
+ .set nomacro')
+
+dnl Usage: X(value)
+define(`X',
+m4_assert_numargs(1)
+`0x$1')
+
+dnl Called: PROLOGUE_cpu(GSYM_PREFIX`'foo)
+dnl EPILOGUE_cpu(GSYM_PREFIX`'foo)
+
+define(`PROLOGUE_cpu',
+m4_assert_numargs(1)
+` .text
+ .align 4
+ .globl $1
+ .ent $1
+$1:')
+
+define(`EPILOGUE_cpu',
+m4_assert_numargs(1)
+` .end $1')
+
+
+dnl Usage: r0 ... r31
+dnl f0 ... f31
+dnl
+dnl Map register names r0 to $0, and f0 to $f0, etc.
+dnl
+dnl defreg() is used to protect the $ in $0 (otherwise it would represent a
+dnl macro argument). Double quoting is used to protect the f0 in $f0
+dnl (otherwise it would be an infinite recursion).
+
+forloop(i,0,31,`defreg(`r'i,$i)')
+forloop(i,0,31,`deflit(`f'i,``$f''i)')
+
+
+dnl Usage: ASM_END()
+define(`ASM_END',
+m4_assert_numargs(0)
+)
+
+divert
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/mips32/mul_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/mips32/mul_1.asm
new file mode 100644
index 00000000000..4337bc2bd40
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/mips32/mul_1.asm
@@ -0,0 +1,89 @@
+dnl MIPS32 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, 1996, 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
+ lw $8,0($5)
+
+C feed-in phase 1
+ addiu $5,$5,4
+ multu $8,$7
+
+ addiu $6,$6,-1
+ beq $6,$0,$LC0
+ move $2,$0 C zero cy2
+
+ addiu $6,$6,-1
+ beq $6,$0,$LC1
+ lw $8,0($5) C load new s1 limb as early as possible
+
+Loop: mflo $10
+ mfhi $9
+ addiu $5,$5,4
+ addu $10,$10,$2 C add old carry limb to low product limb
+ multu $8,$7
+ lw $8,0($5) C load new s1 limb as early as possible
+ addiu $6,$6,-1 C decrement loop counter
+ sltu $2,$10,$2 C carry from previous addition -> $2
+ sw $10,0($4)
+ addiu $4,$4,4
+ bne $6,$0,Loop
+ addu $2,$9,$2 C add high product limb and carry from addition
+
+C wind-down phase 1
+$LC1: mflo $10
+ mfhi $9
+ addu $10,$10,$2
+ sltu $2,$10,$2
+ multu $8,$7
+ sw $10,0($4)
+ addiu $4,$4,4
+ addu $2,$9,$2 C add high product limb and carry from addition
+
+C wind-down phase 0
+$LC0: mflo $10
+ mfhi $9
+ addu $10,$10,$2
+ sltu $2,$10,$2
+ sw $10,0($4)
+ j $31
+ addu $2,$9,$2 C add high product limb and carry from addition
+EPILOGUE(mpn_mul_1)
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/mips32/rshift.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/mips32/rshift.asm
new file mode 100644
index 00000000000..4b54510408f
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/mips32/rshift.asm
@@ -0,0 +1,96 @@
+dnl MIPS32 mpn_rshift -- Right shift.
+
+dnl Copyright 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 src_ptr $5
+C size $6
+C cnt $7
+
+ASM_START()
+PROLOGUE(mpn_rshift)
+ lw $10,0($5) C load first limb
+ subu $13,$0,$7
+ addiu $6,$6,-1
+ and $9,$6,4-1 C number of limbs in first loop
+ beq $9,$0,.L0 C if multiple of 4 limbs, skip first loop
+ sll $2,$10,$13 C compute function result
+
+ subu $6,$6,$9
+
+.Loop0: lw $3,4($5)
+ addiu $4,$4,4
+ addiu $5,$5,4
+ addiu $9,$9,-1
+ srl $11,$10,$7
+ sll $12,$3,$13
+ move $10,$3
+ or $8,$11,$12
+ bne $9,$0,.Loop0
+ sw $8,-4($4)
+
+.L0: beq $6,$0,.Lend
+ nop
+
+.Loop: lw $3,4($5)
+ addiu $4,$4,16
+ addiu $6,$6,-4
+ srl $11,$10,$7
+ sll $12,$3,$13
+
+ lw $10,8($5)
+ srl $14,$3,$7
+ or $8,$11,$12
+ sw $8,-16($4)
+ sll $9,$10,$13
+
+ lw $3,12($5)
+ srl $11,$10,$7
+ or $8,$14,$9
+ sw $8,-12($4)
+ sll $12,$3,$13
+
+ lw $10,16($5)
+ srl $14,$3,$7
+ or $8,$11,$12
+ sw $8,-8($4)
+ sll $9,$10,$13
+
+ addiu $5,$5,16
+ or $8,$14,$9
+ bgtz $6,.Loop
+ sw $8,-4($4)
+
+.Lend: srl $8,$10,$7
+ j $31
+ sw $8,0($4)
+EPILOGUE(mpn_rshift)
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/mips32/sub_n.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/mips32/sub_n.asm
new file mode 100644
index 00000000000..a962ce1b79d
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/mips32/sub_n.asm
@@ -0,0 +1,123 @@
+dnl MIPS32 mpn_sub_n -- Subtract two limb vectors of the same length > 0 and
+dnl store difference in a third limb vector.
+
+dnl Copyright 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 s2_ptr $6
+C size $7
+
+ASM_START()
+PROLOGUE(mpn_sub_n)
+ lw $10,0($5)
+ lw $11,0($6)
+
+ addiu $7,$7,-1
+ and $9,$7,4-1 C number of limbs in first loop
+ beq $9,$0,.L0 C if multiple of 4 limbs, skip first loop
+ move $2,$0
+
+ subu $7,$7,$9
+
+.Loop0: addiu $9,$9,-1
+ lw $12,4($5)
+ addu $11,$11,$2
+ lw $13,4($6)
+ sltu $8,$11,$2
+ subu $11,$10,$11
+ sltu $2,$10,$11
+ sw $11,0($4)
+ or $2,$2,$8
+
+ addiu $5,$5,4
+ addiu $6,$6,4
+ move $10,$12
+ move $11,$13
+ bne $9,$0,.Loop0
+ addiu $4,$4,4
+
+.L0: beq $7,$0,.Lend
+ nop
+
+.Loop: addiu $7,$7,-4
+
+ lw $12,4($5)
+ addu $11,$11,$2
+ lw $13,4($6)
+ sltu $8,$11,$2
+ subu $11,$10,$11
+ sltu $2,$10,$11
+ sw $11,0($4)
+ or $2,$2,$8
+
+ lw $10,8($5)
+ addu $13,$13,$2
+ lw $11,8($6)
+ sltu $8,$13,$2
+ subu $13,$12,$13
+ sltu $2,$12,$13
+ sw $13,4($4)
+ or $2,$2,$8
+
+ lw $12,12($5)
+ addu $11,$11,$2
+ lw $13,12($6)
+ sltu $8,$11,$2
+ subu $11,$10,$11
+ sltu $2,$10,$11
+ sw $11,8($4)
+ or $2,$2,$8
+
+ lw $10,16($5)
+ addu $13,$13,$2
+ lw $11,16($6)
+ sltu $8,$13,$2
+ subu $13,$12,$13
+ sltu $2,$12,$13
+ sw $13,12($4)
+ or $2,$2,$8
+
+ addiu $5,$5,16
+ addiu $6,$6,16
+
+ bne $7,$0,.Loop
+ addiu $4,$4,16
+
+.Lend: addu $11,$11,$2
+ sltu $8,$11,$2
+ subu $11,$10,$11
+ sltu $2,$10,$11
+ sw $11,0($4)
+ j $31
+ or $2,$2,$8
+EPILOGUE(mpn_sub_n)
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/mips32/submul_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/mips32/submul_1.asm
new file mode 100644
index 00000000000..335722b4e57
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/mips32/submul_1.asm
@@ -0,0 +1,101 @@
+dnl MIPS32 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, 1996, 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
+ lw $8,0($5)
+
+C feed-in phase 1
+ addiu $5,$5,4
+ multu $8,$7
+
+ addiu $6,$6,-1
+ beq $6,$0,$LC0
+ move $2,$0 C zero cy2
+
+ addiu $6,$6,-1
+ beq $6,$0,$LC1
+ lw $8,0($5) C load new s1 limb as early as possible
+
+Loop: lw $10,0($4)
+ mflo $3
+ mfhi $9
+ addiu $5,$5,4
+ addu $3,$3,$2 C add old carry limb to low product limb
+ multu $8,$7
+ lw $8,0($5) C load new s1 limb as early as possible
+ addiu $6,$6,-1 C decrement loop counter
+ sltu $2,$3,$2 C carry from previous addition -> $2
+ subu $3,$10,$3
+ sgtu $10,$3,$10
+ addu $2,$2,$10
+ sw $3,0($4)
+ addiu $4,$4,4
+ bne $6,$0,Loop
+ addu $2,$9,$2 C add high product limb and carry from addition
+
+C wind-down phase 1
+$LC1: lw $10,0($4)
+ mflo $3
+ mfhi $9
+ addu $3,$3,$2
+ sltu $2,$3,$2
+ multu $8,$7
+ subu $3,$10,$3
+ sgtu $10,$3,$10
+ addu $2,$2,$10
+ sw $3,0($4)
+ addiu $4,$4,4
+ addu $2,$9,$2 C add high product limb and carry from addition
+
+C wind-down phase 0
+$LC0: lw $10,0($4)
+ mflo $3
+ mfhi $9
+ addu $3,$3,$2
+ sltu $2,$3,$2
+ subu $3,$10,$3
+ sgtu $10,$3,$10
+ addu $2,$2,$10
+ sw $3,0($4)
+ j $31
+ addu $2,$9,$2 C add high product limb and carry from addition
+EPILOGUE(mpn_submul_1)
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/mips32/umul.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/mips32/umul.asm
new file mode 100644
index 00000000000..1ced0eb883e
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/mips32/umul.asm
@@ -0,0 +1,45 @@
+dnl MIPS32 umul_ppmm -- longlong.h support.
+
+dnl Copyright 1999, 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)
+ multu $5,$6
+ mflo $3
+ mfhi $2
+ j $31
+ sw $3,0($4)
+EPILOGUE(mpn_umul_ppmm)
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/mips64/README b/Build/source/libs/gmp/gmp-6.0.0/mpn/mips64/README
new file mode 100644
index 00000000000..7ddd0e572c7
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/mips64/README
@@ -0,0 +1,60 @@
+Copyright 1996 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/.
+
+
+
+
+
+This directory contains mpn functions optimized for MIPS3. Example of
+processors that implement MIPS3 are R4000, R4400, R4600, R4700, and R8000.
+
+RELEVANT OPTIMIZATION ISSUES
+
+1. On the R4000 and R4400, branches, both the plain and the "likely" ones,
+ take 3 cycles to execute. (The fastest possible loop will take 4 cycles,
+ because of the delay insn.)
+
+ On the R4600, branches takes a single cycle
+
+ On the R8000, branches often take no noticeable cycles, as they are
+ executed in a separate function unit..
+
+2. The R4000 and R4400 have a load latency of 4 cycles.
+
+3. On the R4000 and R4400, multiplies take a data-dependent number of
+ cycles, contrary to the SGI documentation. There seem to be 3 or 4
+ possible latencies.
+
+4. The R1x000 processors can issue one floating-point operation, two integer
+ operations, and one memory operation per cycle. The FPU has very short
+ latencies, while the integer multiply unit is non-pipelined. We should
+ therefore write fp based mpn_Xmul_1.
+
+STATUS
+
+Good...
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/mips64/add_n.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/mips64/add_n.asm
new file mode 100644
index 00000000000..6856407efdb
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/mips64/add_n.asm
@@ -0,0 +1,134 @@
+dnl MIPS64 mpn_add_n -- Add two limb vectors of the same length > 0 and store
+dnl sum in a third limb vector.
+
+dnl Copyright 1995, 2000-2002, 2011 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 s2_ptr $6
+C size $7
+
+ASM_START()
+PROLOGUE(mpn_add_nc)
+ ld $10,0($5)
+ ld $11,0($6)
+
+ daddiu $7,$7,-1
+ and $9,$7,4-1 C number of limbs in first loop
+ beq $9,$0,.L0 C if multiple of 4 limbs, skip first loop
+ move $2,$8
+ b .Loop0
+ dsubu $7,$7,$9
+EPILOGUE()
+PROLOGUE(mpn_add_n)
+ ld $10,0($5)
+ ld $11,0($6)
+
+ daddiu $7,$7,-1
+ and $9,$7,4-1 C number of limbs in first loop
+ beq $9,$0,.L0 C if multiple of 4 limbs, skip first loop
+ move $2,$0
+
+ dsubu $7,$7,$9
+
+.Loop0: daddiu $9,$9,-1
+ ld $12,8($5)
+ daddu $11,$11,$2
+ ld $13,8($6)
+ sltu $8,$11,$2
+ daddu $11,$10,$11
+ sltu $2,$11,$10
+ sd $11,0($4)
+ or $2,$2,$8
+
+ daddiu $5,$5,8
+ daddiu $6,$6,8
+ move $10,$12
+ move $11,$13
+ bne $9,$0,.Loop0
+ daddiu $4,$4,8
+
+.L0: beq $7,$0,.Lend
+ nop
+
+.Loop: daddiu $7,$7,-4
+
+ ld $12,8($5)
+ daddu $11,$11,$10
+ ld $13,8($6)
+ sltu $8,$11,$10
+ daddu $11,$11,$2
+ sltu $2,$11,$2
+ sd $11,0($4)
+ or $2,$2,$8
+
+ ld $10,16($5)
+ daddu $13,$13,$12
+ ld $11,16($6)
+ sltu $8,$13,$12
+ daddu $13,$13,$2
+ sltu $2,$13,$2
+ sd $13,8($4)
+ or $2,$2,$8
+
+ ld $12,24($5)
+ daddu $11,$11,$10
+ ld $13,24($6)
+ sltu $8,$11,$10
+ daddu $11,$11,$2
+ sltu $2,$11,$2
+ sd $11,16($4)
+ or $2,$2,$8
+
+ ld $10,32($5)
+ daddu $13,$13,$12
+ ld $11,32($6)
+ sltu $8,$13,$12
+ daddu $13,$13,$2
+ sltu $2,$13,$2
+ sd $13,24($4)
+ or $2,$2,$8
+
+ daddiu $5,$5,32
+ daddiu $6,$6,32
+
+ bne $7,$0,.Loop
+ daddiu $4,$4,32
+
+.Lend: daddu $11,$11,$2
+ sltu $8,$11,$2
+ daddu $11,$10,$11
+ sltu $2,$11,$10
+ sd $11,0($4)
+ j $31
+ or $2,$2,$8
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/mips64/addmul_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/mips64/addmul_1.asm
new file mode 100644
index 00000000000..8ff0976e252
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/mips64/addmul_1.asm
@@ -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)
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/mips64/gmp-mparam.h b/Build/source/libs/gmp/gmp-6.0.0/mpn/mips64/gmp-mparam.h
new file mode 100644
index 00000000000..b7fcf24a413
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/mips64/gmp-mparam.h
@@ -0,0 +1,72 @@
+/* gmp-mparam.h -- Compiler/machine parameter header file.
+
+Copyright 1991, 1993, 1994, 1999-2004 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
+
+
+/* Generated by tuneup.c, 2004-02-10, gcc 3.2 & MIPSpro C 7.2.1 (R1x000) */
+
+#define MUL_TOOM22_THRESHOLD 16
+#define MUL_TOOM33_THRESHOLD 89
+
+#define SQR_BASECASE_THRESHOLD 6
+#define SQR_TOOM2_THRESHOLD 32
+#define SQR_TOOM3_THRESHOLD 98
+
+#define DIV_SB_PREINV_THRESHOLD 0 /* always */
+#define DIV_DC_THRESHOLD 53
+#define POWM_THRESHOLD 61
+
+#define HGCD_THRESHOLD 116
+#define GCD_ACCEL_THRESHOLD 3
+#define GCD_DC_THRESHOLD 492
+#define JACOBI_BASE_METHOD 2
+
+#define MOD_1_NORM_THRESHOLD 0 /* always */
+#define MOD_1_UNNORM_THRESHOLD 0 /* always */
+#define USE_PREINV_DIVREM_1 1
+#define USE_PREINV_MOD_1 1
+#define DIVREM_2_THRESHOLD 0 /* always */
+#define DIVEXACT_1_THRESHOLD 0 /* always */
+#define MODEXACT_1_ODD_THRESHOLD 0 /* always */
+
+#define GET_STR_DC_THRESHOLD 21
+#define GET_STR_PRECOMPUTE_THRESHOLD 26
+#define SET_STR_THRESHOLD 3962
+
+#define MUL_FFT_TABLE { 368, 736, 1600, 3328, 7168, 20480, 49152, 0 }
+#define MUL_FFT_MODF_THRESHOLD 264
+#define MUL_FFT_THRESHOLD 1920
+
+#define SQR_FFT_TABLE { 368, 736, 1856, 3328, 7168, 20480, 49152, 0 }
+#define SQR_FFT_MODF_THRESHOLD 280
+#define SQR_FFT_THRESHOLD 1920
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/mips64/lshift.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/mips64/lshift.asm
new file mode 100644
index 00000000000..3440eaf80b5
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/mips64/lshift.asm
@@ -0,0 +1,99 @@
+dnl MIPS64 mpn_lshift -- Left shift.
+
+dnl Copyright 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 src_ptr $5
+C size $6
+C cnt $7
+
+ASM_START()
+PROLOGUE(mpn_lshift)
+ dsll $2,$6,3
+ daddu $5,$5,$2 C make r5 point at end of src
+ ld $10,-8($5) C load first limb
+ dsubu $13,$0,$7
+ daddu $4,$4,$2 C make r4 point at end of res
+ daddiu $6,$6,-1
+ and $9,$6,4-1 C number of limbs in first loop
+ beq $9,$0,.L0 C if multiple of 4 limbs, skip first loop
+ dsrl $2,$10,$13 C compute function result
+
+ dsubu $6,$6,$9
+
+.Loop0: ld $3,-16($5)
+ daddiu $4,$4,-8
+ daddiu $5,$5,-8
+ daddiu $9,$9,-1
+ dsll $11,$10,$7
+ dsrl $12,$3,$13
+ move $10,$3
+ or $8,$11,$12
+ bne $9,$0,.Loop0
+ sd $8,0($4)
+
+.L0: beq $6,$0,.Lend
+ nop
+
+.Loop: ld $3,-16($5)
+ daddiu $4,$4,-32
+ daddiu $6,$6,-4
+ dsll $11,$10,$7
+ dsrl $12,$3,$13
+
+ ld $10,-24($5)
+ dsll $14,$3,$7
+ or $8,$11,$12
+ sd $8,24($4)
+ dsrl $9,$10,$13
+
+ ld $3,-32($5)
+ dsll $11,$10,$7
+ or $8,$14,$9
+ sd $8,16($4)
+ dsrl $12,$3,$13
+
+ ld $10,-40($5)
+ dsll $14,$3,$7
+ or $8,$11,$12
+ sd $8,8($4)
+ dsrl $9,$10,$13
+
+ daddiu $5,$5,-32
+ or $8,$14,$9
+ bgtz $6,.Loop
+ sd $8,0($4)
+
+.Lend: dsll $8,$10,$7
+ j $31
+ sd $8,-8($4)
+EPILOGUE(mpn_lshift)
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/mips64/mul_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/mips64/mul_1.asm
new file mode 100644
index 00000000000..77acf0ac257
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/mips64/mul_1.asm
@@ -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)
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/mips64/rshift.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/mips64/rshift.asm
new file mode 100644
index 00000000000..9253cb51d85
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/mips64/rshift.asm
@@ -0,0 +1,96 @@
+dnl MIPS64 mpn_rshift -- Right shift.
+
+dnl Copyright 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 src_ptr $5
+C size $6
+C cnt $7
+
+ASM_START()
+PROLOGUE(mpn_rshift)
+ ld $10,0($5) C load first limb
+ dsubu $13,$0,$7
+ daddiu $6,$6,-1
+ and $9,$6,4-1 C number of limbs in first loop
+ beq $9,$0,.L0 C if multiple of 4 limbs, skip first loop
+ dsll $2,$10,$13 C compute function result
+
+ dsubu $6,$6,$9
+
+.Loop0: ld $3,8($5)
+ daddiu $4,$4,8
+ daddiu $5,$5,8
+ daddiu $9,$9,-1
+ dsrl $11,$10,$7
+ dsll $12,$3,$13
+ move $10,$3
+ or $8,$11,$12
+ bne $9,$0,.Loop0
+ sd $8,-8($4)
+
+.L0: beq $6,$0,.Lend
+ nop
+
+.Loop: ld $3,8($5)
+ daddiu $4,$4,32
+ daddiu $6,$6,-4
+ dsrl $11,$10,$7
+ dsll $12,$3,$13
+
+ ld $10,16($5)
+ dsrl $14,$3,$7
+ or $8,$11,$12
+ sd $8,-32($4)
+ dsll $9,$10,$13
+
+ ld $3,24($5)
+ dsrl $11,$10,$7
+ or $8,$14,$9
+ sd $8,-24($4)
+ dsll $12,$3,$13
+
+ ld $10,32($5)
+ dsrl $14,$3,$7
+ or $8,$11,$12
+ sd $8,-16($4)
+ dsll $9,$10,$13
+
+ daddiu $5,$5,32
+ or $8,$14,$9
+ bgtz $6,.Loop
+ sd $8,-8($4)
+
+.Lend: dsrl $8,$10,$7
+ j $31
+ sd $8,0($4)
+EPILOGUE(mpn_rshift)
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/mips64/sqr_diagonal.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/mips64/sqr_diagonal.asm
new file mode 100644
index 00000000000..dcb87dc21f1
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/mips64/sqr_diagonal.asm
@@ -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)
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/mips64/sub_n.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/mips64/sub_n.asm
new file mode 100644
index 00000000000..6a698976eba
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/mips64/sub_n.asm
@@ -0,0 +1,134 @@
+dnl MIPS64 mpn_sub_n -- Subtract two limb vectors of the same length > 0 and
+dnl store difference in a third limb vector.
+
+dnl Copyright 1995, 2000-2002, 2011 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 s2_ptr $6
+C size $7
+
+ASM_START()
+PROLOGUE(mpn_sub_nc)
+ ld $10,0($5)
+ ld $11,0($6)
+
+ daddiu $7,$7,-1
+ and $9,$7,4-1 C number of limbs in first loop
+ beq $9,$0,.L0 C if multiple of 4 limbs, skip first loop
+ move $2,$8
+ b .Loop0
+ dsubu $7,$7,$9
+EPILOGUE()
+PROLOGUE(mpn_sub_n)
+ ld $10,0($5)
+ ld $11,0($6)
+
+ daddiu $7,$7,-1
+ and $9,$7,4-1 C number of limbs in first loop
+ beq $9,$0,.L0 C if multiple of 4 limbs, skip first loop
+ move $2,$0
+
+ dsubu $7,$7,$9
+
+.Loop0: daddiu $9,$9,-1
+ ld $12,8($5)
+ daddu $11,$11,$2
+ ld $13,8($6)
+ sltu $8,$11,$2
+ dsubu $11,$10,$11
+ sltu $2,$10,$11
+ sd $11,0($4)
+ or $2,$2,$8
+
+ daddiu $5,$5,8
+ daddiu $6,$6,8
+ move $10,$12
+ move $11,$13
+ bne $9,$0,.Loop0
+ daddiu $4,$4,8
+
+.L0: beq $7,$0,.Lend
+ nop
+
+.Loop: daddiu $7,$7,-4
+
+ ld $12,8($5)
+ dsubu $11,$10,$11
+ ld $13,8($6)
+ sltu $8,$10,$11
+ dsubu $14,$11,$2
+ sltu $2,$11,$14
+ sd $14,0($4)
+ or $2,$2,$8
+
+ ld $10,16($5)
+ dsubu $13,$12,$13
+ ld $11,16($6)
+ sltu $8,$12,$13
+ dsubu $14,$13,$2
+ sltu $2,$13,$14
+ sd $14,8($4)
+ or $2,$2,$8
+
+ ld $12,24($5)
+ dsubu $11,$10,$11
+ ld $13,24($6)
+ sltu $8,$10,$11
+ dsubu $14,$11,$2
+ sltu $2,$11,$14
+ sd $14,16($4)
+ or $2,$2,$8
+
+ ld $10,32($5)
+ dsubu $13,$12,$13
+ ld $11,32($6)
+ sltu $8,$12,$13
+ dsubu $14,$13,$2
+ sltu $2,$13,$14
+ sd $14,24($4)
+ or $2,$2,$8
+
+ daddiu $5,$5,32
+ daddiu $6,$6,32
+
+ bne $7,$0,.Loop
+ daddiu $4,$4,32
+
+.Lend: daddu $11,$11,$2
+ sltu $8,$11,$2
+ dsubu $11,$10,$11
+ sltu $2,$10,$11
+ sd $11,0($4)
+ j $31
+ or $2,$2,$8
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/mips64/submul_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/mips64/submul_1.asm
new file mode 100644
index 00000000000..089589cd736
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/mips64/submul_1.asm
@@ -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)
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/mips64/umul.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/mips64/umul.asm
new file mode 100644
index 00000000000..b9aac575912
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/mips64/umul.asm
@@ -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)
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/pa32/README b/Build/source/libs/gmp/gmp-6.0.0/mpn/pa32/README
new file mode 100644
index 00000000000..4323390c9b8
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/pa32/README
@@ -0,0 +1,162 @@
+Copyright 1996, 1999, 2001, 2002, 2004 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/.
+
+
+
+
+
+
+This directory contains mpn functions for various HP PA-RISC chips. Code
+that runs faster on the PA7100 and later implementations, is in the pa7100
+directory.
+
+RELEVANT OPTIMIZATION ISSUES
+
+ Load and Store timing
+
+On the PA7000 no memory instructions can issue the two cycles after a store.
+For the PA7100, this is reduced to one cycle.
+
+The PA7100 has a lookup-free cache, so it helps to schedule loads and the
+dependent instruction really far from each other.
+
+STATUS
+
+1. mpn_mul_1 could be improved to 6.5 cycles/limb on the PA7100, using the
+ instructions below (but some sw pipelining is needed to avoid the
+ xmpyu-fstds delay):
+
+ fldds s1_ptr
+
+ xmpyu
+ fstds N(%r30)
+ xmpyu
+ fstds N(%r30)
+
+ ldws N(%r30)
+ ldws N(%r30)
+ ldws N(%r30)
+ ldws N(%r30)
+
+ addc
+ stws res_ptr
+ addc
+ stws res_ptr
+
+ addib Loop
+
+2. mpn_addmul_1 could be improved from the current 10 to 7.5 cycles/limb
+ (asymptotically) on the PA7100, using the instructions below. With proper
+ sw pipelining and the unrolling level below, the speed becomes 8
+ cycles/limb.
+
+ fldds s1_ptr
+ fldds s1_ptr
+
+ xmpyu
+ fstds N(%r30)
+ xmpyu
+ fstds N(%r30)
+ xmpyu
+ fstds N(%r30)
+ xmpyu
+ fstds N(%r30)
+
+ ldws N(%r30)
+ ldws N(%r30)
+ ldws N(%r30)
+ ldws N(%r30)
+ ldws N(%r30)
+ ldws N(%r30)
+ ldws N(%r30)
+ ldws N(%r30)
+ addc
+ addc
+ addc
+ addc
+ addc %r0,%r0,cy-limb
+
+ ldws res_ptr
+ ldws res_ptr
+ ldws res_ptr
+ ldws res_ptr
+ add
+ stws res_ptr
+ addc
+ stws res_ptr
+ addc
+ stws res_ptr
+ addc
+ stws res_ptr
+
+ addib
+
+3. For the PA8000 we have to stick to using 32-bit limbs before compiler
+ support emerges. But we want to use 64-bit operations whenever possible,
+ in particular for loads and stores. It is possible to handle mpn_add_n
+ efficiently by rotating (when s1/s2 are aligned), masking+bit field
+ inserting when (they are not). The speed should double compared to the
+ code used today.
+
+
+
+
+LABEL SYNTAX
+
+The HP-UX assembler takes labels starting in column 0 with no colon,
+
+ L$loop ldws,mb -4(0,%r25),%r22
+
+Gas on hppa GNU/Linux however requires a colon,
+
+ L$loop: ldws,mb -4(0,%r25),%r22
+
+This is covered by using LDEF() from asm-defs.m4. An alternative would be
+to use ".label" which is accepted by both,
+
+ .label L$loop
+ ldws,mb -4(0,%r25),%r22
+
+but that's not as nice to look at, not if you're used to assembler code
+having labels in column 0.
+
+
+
+
+REFERENCES
+
+Hewlett Packard, "HP Assembler Reference Manual", 9th edition, June 1998,
+part number 92432-90012.
+
+
+
+----------------
+Local variables:
+mode: text
+fill-column: 76
+End:
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/pa32/add_n.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/pa32/add_n.asm
new file mode 100644
index 00000000000..46f39377ea8
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/pa32/add_n.asm
@@ -0,0 +1,63 @@
+dnl HP-PA mpn_add_n -- Add two limb vectors of the same length > 0 and store
+dnl sum in a third limb vector.
+
+dnl Copyright 1992, 1994, 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 gr26
+C s1_ptr gr25
+C s2_ptr gr24
+C size gr23
+
+C One might want to unroll this as for other processors, but it turns out that
+C the data cache contention after a store makes such unrolling useless. We
+C can't come under 5 cycles/limb anyway.
+
+ASM_START()
+PROLOGUE(mpn_add_n)
+ ldws,ma 4(0,%r25),%r20
+ ldws,ma 4(0,%r24),%r19
+
+ addib,= -1,%r23,L(end) C check for (SIZE == 1)
+ add %r20,%r19,%r28 C add first limbs ignoring cy
+
+LDEF(loop)
+ ldws,ma 4(0,%r25),%r20
+ ldws,ma 4(0,%r24),%r19
+ stws,ma %r28,4(0,%r26)
+ addib,<> -1,%r23,L(loop)
+ addc %r20,%r19,%r28
+
+LDEF(end)
+ stws %r28,0(0,%r26)
+ bv 0(%r2)
+ addc %r0,%r0,%r28
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/pa32/gmp-mparam.h b/Build/source/libs/gmp/gmp-6.0.0/mpn/pa32/gmp-mparam.h
new file mode 100644
index 00000000000..377efcb1565
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/pa32/gmp-mparam.h
@@ -0,0 +1,61 @@
+/* HP-PA 1.0 gmp-mparam.h -- Compiler/machine parameter header file.
+
+Copyright 1991, 1993, 1994, 1999-2002, 2012 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
+
+/* These values are for the PA7100 using GCC. */
+/* Generated by tuneup.c, 2000-10-27. */
+
+#ifndef MUL_TOOM22_THRESHOLD
+#define MUL_TOOM22_THRESHOLD 30
+#endif
+#ifndef MUL_TOOM33_THRESHOLD
+#define MUL_TOOM33_THRESHOLD 141
+#endif
+
+#ifndef SQR_TOOM2_THRESHOLD
+#define SQR_TOOM2_THRESHOLD 59
+#endif
+#ifndef SQR_TOOM3_THRESHOLD
+#define SQR_TOOM3_THRESHOLD 177
+#endif
+
+#ifndef DIV_DC_THRESHOLD
+#define DIV_DC_THRESHOLD 108
+#endif
+
+#ifndef POWM_THRESHOLD
+#define POWM_THRESHOLD 18
+#endif
+
+#ifndef GCDEXT_THRESHOLD
+#define GCDEXT_THRESHOLD 33
+#endif
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/pa32/hppa1_1/addmul_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/pa32/hppa1_1/addmul_1.asm
new file mode 100644
index 00000000000..ec2f2198e84
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/pa32/hppa1_1/addmul_1.asm
@@ -0,0 +1,106 @@
+dnl HP-PA 1.1 mpn_addmul_1 -- Multiply a limb vector with a limb and add the
+dnl result to a second limb vector.
+
+dnl Copyright 1992-1994, 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 r26
+C s1_ptr r25
+C size r24
+C s2_limb r23
+
+C This runs at 11 cycles/limb on a PA7000. With the used instructions, it can
+C not become faster due to data cache contention after a store. On the PA7100
+C it runs at 10 cycles/limb.
+
+C There are some ideas described in mul_1.asm that applies to this code too.
+
+ASM_START()
+PROLOGUE(mpn_addmul_1)
+C .callinfo frame=64,no_calls
+
+ ldo 64(%r30),%r30
+ fldws,ma 4(%r25),%fr5
+ stw %r23,-16(%r30) C move s2_limb ...
+ addib,= -1,%r24,L(just_one_limb)
+ fldws -16(%r30),%fr4 C ... into fr4
+ add %r0,%r0,%r0 C clear carry
+ xmpyu %fr4,%fr5,%fr6
+ fldws,ma 4(%r25),%fr7
+ fstds %fr6,-16(%r30)
+ xmpyu %fr4,%fr7,%fr8
+ ldw -12(%r30),%r19 C least significant limb in product
+ ldw -16(%r30),%r28
+
+ fstds %fr8,-16(%r30)
+ addib,= -1,%r24,L(end)
+ ldw -12(%r30),%r1
+
+C Main loop
+LDEF(loop)
+ ldws 0(%r26),%r29
+ fldws,ma 4(%r25),%fr5
+ add %r29,%r19,%r19
+ stws,ma %r19,4(%r26)
+ addc %r28,%r1,%r19
+ xmpyu %fr4,%fr5,%fr6
+ ldw -16(%r30),%r28
+ fstds %fr6,-16(%r30)
+ addc %r0,%r28,%r28
+ addib,<> -1,%r24,L(loop)
+ ldw -12(%r30),%r1
+
+LDEF(end)
+ ldw 0(%r26),%r29
+ add %r29,%r19,%r19
+ stws,ma %r19,4(%r26)
+ addc %r28,%r1,%r19
+ ldw -16(%r30),%r28
+ ldws 0(%r26),%r29
+ addc %r0,%r28,%r28
+ add %r29,%r19,%r19
+ stws,ma %r19,4(%r26)
+ addc %r0,%r28,%r28
+ bv 0(%r2)
+ ldo -64(%r30),%r30
+
+LDEF(just_one_limb)
+ xmpyu %fr4,%fr5,%fr6
+ ldw 0(%r26),%r29
+ fstds %fr6,-16(%r30)
+ ldw -12(%r30),%r1
+ ldw -16(%r30),%r28
+ add %r29,%r1,%r19
+ stw %r19,0(%r26)
+ addc %r0,%r28,%r28
+ bv 0(%r2)
+ ldo -64(%r30),%r30
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/pa32/hppa1_1/gmp-mparam.h b/Build/source/libs/gmp/gmp-6.0.0/mpn/pa32/hppa1_1/gmp-mparam.h
new file mode 100644
index 00000000000..1261b24c83e
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/pa32/hppa1_1/gmp-mparam.h
@@ -0,0 +1,72 @@
+/* HP-PA 1.1 gmp-mparam.h -- Compiler/machine parameter header file.
+
+Copyright 1991, 1993, 1994, 1999-2002, 2004 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
+
+/* Generated by tuneup.c, 2004-02-07, gcc 2.8 (pa7100/100MHz) */
+
+#define MUL_TOOM22_THRESHOLD 30
+#define MUL_TOOM33_THRESHOLD 89
+
+#define SQR_BASECASE_THRESHOLD 4
+#define SQR_TOOM2_THRESHOLD 55
+#define SQR_TOOM3_THRESHOLD 101
+
+#define DIV_SB_PREINV_THRESHOLD 0 /* always */
+#define DIV_DC_THRESHOLD 84
+#define POWM_THRESHOLD 166
+
+#define HGCD_THRESHOLD 231
+#define GCD_ACCEL_THRESHOLD 3
+#define GCD_DC_THRESHOLD 823
+#define JACOBI_BASE_METHOD 2
+
+#define DIVREM_1_NORM_THRESHOLD 5
+#define DIVREM_1_UNNORM_THRESHOLD 11
+#define MOD_1_NORM_THRESHOLD 5
+#define MOD_1_UNNORM_THRESHOLD 10
+#define USE_PREINV_DIVREM_1 1
+#define USE_PREINV_MOD_1 1
+#define DIVREM_2_THRESHOLD 0 /* always */
+#define DIVEXACT_1_THRESHOLD 0 /* always */
+#define MODEXACT_1_ODD_THRESHOLD 0 /* always */
+
+#define GET_STR_DC_THRESHOLD 13
+#define GET_STR_PRECOMPUTE_THRESHOLD 23
+#define SET_STR_THRESHOLD 6589
+
+#define MUL_FFT_TABLE { 464, 928, 1920, 4608, 14336, 40960, 0 }
+#define MUL_FFT_MODF_THRESHOLD 480
+#define MUL_FFT_THRESHOLD 3328
+
+#define SQR_FFT_TABLE { 528, 1184, 2176, 5632, 14336, 40960, 0 }
+#define SQR_FFT_MODF_THRESHOLD 520
+#define SQR_FFT_THRESHOLD 3328
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/pa32/hppa1_1/mul_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/pa32/hppa1_1/mul_1.asm
new file mode 100644
index 00000000000..6e60c2f61fe
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/pa32/hppa1_1/mul_1.asm
@@ -0,0 +1,102 @@
+dnl HP-PA 1.1 mpn_mul_1 -- Multiply a limb vector with a limb and store the
+dnl result in a second limb vector.
+
+dnl Copyright 1992-1994, 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 r26
+C s1_ptr r25
+C size r24
+C s2_limb r23
+
+C This runs at 9 cycles/limb on a PA7000. With the used instructions, it can
+C not become faster due to data cache contention after a store. On the PA7100
+C it runs at 7 cycles/limb.
+
+C We could use fldds to read two limbs at a time from the S1 array, and that
+C could bring down the times to 8.5 and 6.5 cycles/limb for the PA7000 and
+C PA7100, respectively. We don't do that since it does not seem worth the
+C (alignment) troubles...
+
+C At least the PA7100 is rumored to be able to deal with cache-misses without
+C stalling instruction issue. If this is true, and the cache is actually also
+C lockup-free, we should use a deeper software pipeline, and load from S1 very
+C early! (The loads and stores to -12(sp) will surely be in the cache.)
+
+ASM_START()
+PROLOGUE(mpn_mul_1)
+C .callinfo frame=64,no_calls
+
+ ldo 64(%r30),%r30
+ fldws,ma 4(%r25),%fr5
+ stw %r23,-16(%r30) C move s2_limb ...
+ addib,= -1,%r24,L(just_one_limb)
+ fldws -16(%r30),%fr4 C ... into fr4
+ add %r0,%r0,%r0 C clear carry
+ xmpyu %fr4,%fr5,%fr6
+ fldws,ma 4(%r25),%fr7
+ fstds %fr6,-16(%r30)
+ xmpyu %fr4,%fr7,%fr8
+ ldw -12(%r30),%r19 C least significant limb in product
+ ldw -16(%r30),%r28
+
+ fstds %fr8,-16(%r30)
+ addib,= -1,%r24,L(end)
+ ldw -12(%r30),%r1
+
+C Main loop
+LDEF(loop)
+ fldws,ma 4(%r25),%fr5
+ stws,ma %r19,4(%r26)
+ addc %r28,%r1,%r19
+ xmpyu %fr4,%fr5,%fr6
+ ldw -16(%r30),%r28
+ fstds %fr6,-16(%r30)
+ addib,<> -1,%r24,L(loop)
+ ldw -12(%r30),%r1
+
+LDEF(end)
+ stws,ma %r19,4(%r26)
+ addc %r28,%r1,%r19
+ ldw -16(%r30),%r28
+ stws,ma %r19,4(%r26)
+ addc %r0,%r28,%r28
+ bv 0(%r2)
+ ldo -64(%r30),%r30
+
+LDEF(just_one_limb)
+ xmpyu %fr4,%fr5,%fr6
+ fstds %fr6,-16(%r30)
+ ldw -16(%r30),%r28
+ ldo -64(%r30),%r30
+ bv 0(%r2)
+ fstws %fr6R,0(%r26)
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/pa32/hppa1_1/pa7100/add_n.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/pa32/hppa1_1/pa7100/add_n.asm
new file mode 100644
index 00000000000..b96d4038268
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/pa32/hppa1_1/pa7100/add_n.asm
@@ -0,0 +1,83 @@
+dnl HP-PA mpn_add_n -- Add two limb vectors of the same length > 0 and store
+dnl sum in a third limb vector. Optimized for the PA7100, where is runs at
+dnl 4.25 cycles/limb.
+
+dnl Copyright 1992, 1994, 2000-2003 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 r26
+C s1_ptr r25
+C s2_ptr r24
+C size r23
+
+ASM_START()
+PROLOGUE(mpn_add_n)
+ ldws,ma 4(0,%r25),%r20
+ ldws,ma 4(0,%r24),%r19
+
+ addib,<= -5,%r23,L(rest)
+ add %r20,%r19,%r28 C add first limbs ignoring cy
+
+LDEF(loop)
+ ldws,ma 4(0,%r25),%r20
+ ldws,ma 4(0,%r24),%r19
+ stws,ma %r28,4(0,%r26)
+ addc %r20,%r19,%r28
+ ldws,ma 4(0,%r25),%r20
+ ldws,ma 4(0,%r24),%r19
+ stws,ma %r28,4(0,%r26)
+ addc %r20,%r19,%r28
+ ldws,ma 4(0,%r25),%r20
+ ldws,ma 4(0,%r24),%r19
+ stws,ma %r28,4(0,%r26)
+ addc %r20,%r19,%r28
+ ldws,ma 4(0,%r25),%r20
+ ldws,ma 4(0,%r24),%r19
+ stws,ma %r28,4(0,%r26)
+ addib,> -4,%r23,L(loop)
+ addc %r20,%r19,%r28
+
+LDEF(rest)
+ addib,= 4,%r23,L(end)
+ nop
+
+LDEF(eloop)
+ ldws,ma 4(0,%r25),%r20
+ ldws,ma 4(0,%r24),%r19
+ stws,ma %r28,4(0,%r26)
+ addib,> -1,%r23,L(eloop)
+ addc %r20,%r19,%r28
+
+LDEF(end)
+ stws %r28,0(0,%r26)
+ bv 0(%r2)
+ addc %r0,%r0,%r28
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/pa32/hppa1_1/pa7100/addmul_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/pa32/hppa1_1/pa7100/addmul_1.asm
new file mode 100644
index 00000000000..fb16100d83d
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/pa32/hppa1_1/pa7100/addmul_1.asm
@@ -0,0 +1,201 @@
+dnl HP-PA 7100/7200 mpn_addmul_1 -- Multiply a limb vector with a limb and
+dnl add the result to a second limb vector.
+
+dnl Copyright 1995, 2000-2003 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(`res_ptr',`%r26')
+define(`s1_ptr',`%r25')
+define(`size_param',`%r24')
+define(`s2_limb',`%r23')
+
+define(`cylimb',`%r28')
+define(`s0',`%r19')
+define(`s1',`%r20')
+define(`s2',`%r3')
+define(`s3',`%r4')
+define(`lo0',`%r21')
+define(`lo1',`%r5')
+define(`lo2',`%r6')
+define(`lo3',`%r7')
+define(`hi0',`%r22')
+define(`hi1',`%r23') C safe to reuse
+define(`hi2',`%r29')
+define(`hi3',`%r1')
+
+ASM_START()
+PROLOGUE(mpn_addmul_1)
+C .callinfo frame=128,no_calls
+
+ ldo 128(%r30),%r30
+ stws s2_limb,-16(%r30)
+ add %r0,%r0,cylimb C clear cy and cylimb
+ addib,< -4,size_param,L(few_limbs)
+ fldws -16(%r30),%fr31R
+
+ ldo -112(%r30),%r31
+ stw %r3,-96(%r30)
+ stw %r4,-92(%r30)
+ stw %r5,-88(%r30)
+ stw %r6,-84(%r30)
+ stw %r7,-80(%r30)
+
+ bb,>=,n s1_ptr,29,L(0)
+
+ fldws,ma 4(s1_ptr),%fr4
+ ldws 0(res_ptr),s0
+ xmpyu %fr4,%fr31R,%fr5
+ fstds %fr5,-16(%r31)
+ ldws -16(%r31),cylimb
+ ldws -12(%r31),lo0
+ add s0,lo0,s0
+ addib,< -1,size_param,L(few_limbs)
+ stws,ma s0,4(res_ptr)
+
+C start software pipeline ----------------------------------------------------
+LDEF(0)
+ fldds,ma 8(s1_ptr),%fr4
+ fldds,ma 8(s1_ptr),%fr8
+
+ xmpyu %fr4L,%fr31R,%fr5
+ xmpyu %fr4R,%fr31R,%fr6
+ xmpyu %fr8L,%fr31R,%fr9
+ xmpyu %fr8R,%fr31R,%fr10
+
+ fstds %fr5,-16(%r31)
+ fstds %fr6,-8(%r31)
+ fstds %fr9,0(%r31)
+ fstds %fr10,8(%r31)
+
+ ldws -16(%r31),hi0
+ ldws -12(%r31),lo0
+ ldws -8(%r31),hi1
+ ldws -4(%r31),lo1
+ ldws 0(%r31),hi2
+ ldws 4(%r31),lo2
+ ldws 8(%r31),hi3
+ ldws 12(%r31),lo3
+
+ addc lo0,cylimb,lo0
+ addc lo1,hi0,lo1
+ addc lo2,hi1,lo2
+ addc lo3,hi2,lo3
+
+ addib,< -4,size_param,L(end)
+ addc %r0,hi3,cylimb C propagate carry into cylimb
+C main loop ------------------------------------------------------------------
+LDEF(loop)
+ fldds,ma 8(s1_ptr),%fr4
+ fldds,ma 8(s1_ptr),%fr8
+
+ ldws 0(res_ptr),s0
+ xmpyu %fr4L,%fr31R,%fr5
+ ldws 4(res_ptr),s1
+ xmpyu %fr4R,%fr31R,%fr6
+ ldws 8(res_ptr),s2
+ xmpyu %fr8L,%fr31R,%fr9
+ ldws 12(res_ptr),s3
+ xmpyu %fr8R,%fr31R,%fr10
+
+ fstds %fr5,-16(%r31)
+ add s0,lo0,s0
+ fstds %fr6,-8(%r31)
+ addc s1,lo1,s1
+ fstds %fr9,0(%r31)
+ addc s2,lo2,s2
+ fstds %fr10,8(%r31)
+ addc s3,lo3,s3
+
+ ldws -16(%r31),hi0
+ ldws -12(%r31),lo0
+ ldws -8(%r31),hi1
+ ldws -4(%r31),lo1
+ ldws 0(%r31),hi2
+ ldws 4(%r31),lo2
+ ldws 8(%r31),hi3
+ ldws 12(%r31),lo3
+
+ addc lo0,cylimb,lo0
+ stws,ma s0,4(res_ptr)
+ addc lo1,hi0,lo1
+ stws,ma s1,4(res_ptr)
+ addc lo2,hi1,lo2
+ stws,ma s2,4(res_ptr)
+ addc lo3,hi2,lo3
+ stws,ma s3,4(res_ptr)
+
+ addib,>= -4,size_param,L(loop)
+ addc %r0,hi3,cylimb C propagate carry into cylimb
+C finish software pipeline ---------------------------------------------------
+LDEF(end)
+ ldws 0(res_ptr),s0
+ ldws 4(res_ptr),s1
+ ldws 8(res_ptr),s2
+ ldws 12(res_ptr),s3
+
+ add s0,lo0,s0
+ stws,ma s0,4(res_ptr)
+ addc s1,lo1,s1
+ stws,ma s1,4(res_ptr)
+ addc s2,lo2,s2
+ stws,ma s2,4(res_ptr)
+ addc s3,lo3,s3
+ stws,ma s3,4(res_ptr)
+
+C restore callee-saves registers ---------------------------------------------
+ ldw -96(%r30),%r3
+ ldw -92(%r30),%r4
+ ldw -88(%r30),%r5
+ ldw -84(%r30),%r6
+ ldw -80(%r30),%r7
+
+LDEF(few_limbs)
+ addib,=,n 4,size_param,L(ret)
+
+LDEF(loop2)
+ fldws,ma 4(s1_ptr),%fr4
+ ldws 0(res_ptr),s0
+ xmpyu %fr4,%fr31R,%fr5
+ fstds %fr5,-16(%r30)
+ ldws -16(%r30),hi0
+ ldws -12(%r30),lo0
+ addc lo0,cylimb,lo0
+ addc %r0,hi0,cylimb
+ add s0,lo0,s0
+ stws,ma s0,4(res_ptr)
+ addib,<> -1,size_param,L(loop2)
+ nop
+
+LDEF(ret)
+ addc %r0,cylimb,cylimb
+ bv 0(%r2)
+ ldo -128(%r30),%r30
+EPILOGUE(mpn_addmul_1)
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/pa32/hppa1_1/pa7100/lshift.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/pa32/hppa1_1/pa7100/lshift.asm
new file mode 100644
index 00000000000..d65db2a76bf
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/pa32/hppa1_1/pa7100/lshift.asm
@@ -0,0 +1,95 @@
+dnl HP-PA mpn_lshift -- Shift a number left.
+dnl Optimized for the PA7100, where is runs at 3.25 cycles/limb.
+
+dnl Copyright 1992, 1994, 2000-2003 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 r26
+C s_ptr r25
+C size r24
+C cnt r23
+
+ASM_START()
+PROLOGUE(mpn_lshift)
+ sh2add %r24,%r25,%r25
+ sh2add %r24,%r26,%r26
+ ldws,mb -4(0,%r25),%r22
+ subi 32,%r23,%r1
+ mtsar %r1
+ addib,= -1,%r24,L(0004)
+ vshd %r0,%r22,%r28 C compute carry out limb
+ ldws,mb -4(0,%r25),%r29
+ addib,<= -5,%r24,L(rest)
+ vshd %r22,%r29,%r20
+
+LDEF(loop)
+ ldws,mb -4(0,%r25),%r22
+ stws,mb %r20,-4(0,%r26)
+ vshd %r29,%r22,%r20
+ ldws,mb -4(0,%r25),%r29
+ stws,mb %r20,-4(0,%r26)
+ vshd %r22,%r29,%r20
+ ldws,mb -4(0,%r25),%r22
+ stws,mb %r20,-4(0,%r26)
+ vshd %r29,%r22,%r20
+ ldws,mb -4(0,%r25),%r29
+ stws,mb %r20,-4(0,%r26)
+ addib,> -4,%r24,L(loop)
+ vshd %r22,%r29,%r20
+
+LDEF(rest)
+ addib,= 4,%r24,L(end1)
+ nop
+
+LDEF(eloop)
+ ldws,mb -4(0,%r25),%r22
+ stws,mb %r20,-4(0,%r26)
+ addib,<= -1,%r24,L(end2)
+ vshd %r29,%r22,%r20
+ ldws,mb -4(0,%r25),%r29
+ stws,mb %r20,-4(0,%r26)
+ addib,> -1,%r24,L(eloop)
+ vshd %r22,%r29,%r20
+
+LDEF(end1)
+ stws,mb %r20,-4(0,%r26)
+ vshd %r29,%r0,%r20
+ bv 0(%r2)
+ stw %r20,-4(0,%r26)
+
+LDEF(end2)
+ stws,mb %r20,-4(0,%r26)
+
+LDEF(0004)
+ vshd %r22,%r0,%r20
+ bv 0(%r2)
+ stw %r20,-4(0,%r26)
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/pa32/hppa1_1/pa7100/rshift.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/pa32/hppa1_1/pa7100/rshift.asm
new file mode 100644
index 00000000000..f7896fc949b
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/pa32/hppa1_1/pa7100/rshift.asm
@@ -0,0 +1,92 @@
+dnl HP-PA mpn_rshift -- Shift a number right.
+dnl Optimized for the PA7100, where is runs at 3.25 cycles/limb.
+
+dnl Copyright 1992, 1994, 2000-2003 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 r26
+C s_ptr r25
+C size r24
+C cnt r23
+
+ASM_START()
+PROLOGUE(mpn_rshift)
+ ldws,ma 4(0,%r25),%r22
+ mtsar %r23
+ addib,= -1,%r24,L(0004)
+ vshd %r22,%r0,%r28 C compute carry out limb
+ ldws,ma 4(0,%r25),%r29
+ addib,<= -5,%r24,L(rest)
+ vshd %r29,%r22,%r20
+
+LDEF(loop)
+ ldws,ma 4(0,%r25),%r22
+ stws,ma %r20,4(0,%r26)
+ vshd %r22,%r29,%r20
+ ldws,ma 4(0,%r25),%r29
+ stws,ma %r20,4(0,%r26)
+ vshd %r29,%r22,%r20
+ ldws,ma 4(0,%r25),%r22
+ stws,ma %r20,4(0,%r26)
+ vshd %r22,%r29,%r20
+ ldws,ma 4(0,%r25),%r29
+ stws,ma %r20,4(0,%r26)
+ addib,> -4,%r24,L(loop)
+ vshd %r29,%r22,%r20
+
+LDEF(rest)
+ addib,= 4,%r24,L(end1)
+ nop
+
+LDEF(eloop)
+ ldws,ma 4(0,%r25),%r22
+ stws,ma %r20,4(0,%r26)
+ addib,<= -1,%r24,L(end2)
+ vshd %r22,%r29,%r20
+ ldws,ma 4(0,%r25),%r29
+ stws,ma %r20,4(0,%r26)
+ addib,> -1,%r24,L(eloop)
+ vshd %r29,%r22,%r20
+
+LDEF(end1)
+ stws,ma %r20,4(0,%r26)
+ vshd %r0,%r29,%r20
+ bv 0(%r2)
+ stw %r20,0(0,%r26)
+
+LDEF(end2)
+ stws,ma %r20,4(0,%r26)
+
+LDEF(0004)
+ vshd %r0,%r22,%r20
+ bv 0(%r2)
+ stw %r20,0(0,%r26)
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/pa32/hppa1_1/pa7100/sub_n.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/pa32/hppa1_1/pa7100/sub_n.asm
new file mode 100644
index 00000000000..df3f6e8b819
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/pa32/hppa1_1/pa7100/sub_n.asm
@@ -0,0 +1,84 @@
+dnl HP-PA mpn_sub_n -- Subtract two limb vectors of the same length > 0 and
+dnl store difference in a third limb vector. Optimized for the PA7100, where
+dnl is runs at 4.25 cycles/limb.
+
+dnl Copyright 1992, 1994, 2000-2003 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 r26
+C s1_ptr r25
+C s2_ptr r24
+C size r23
+
+ASM_START()
+PROLOGUE(mpn_sub_n)
+ ldws,ma 4(0,%r25),%r20
+ ldws,ma 4(0,%r24),%r19
+
+ addib,<= -5,%r23,L(rest)
+ sub %r20,%r19,%r28 C subtract first limbs ignoring cy
+
+LDEF(loop)
+ ldws,ma 4(0,%r25),%r20
+ ldws,ma 4(0,%r24),%r19
+ stws,ma %r28,4(0,%r26)
+ subb %r20,%r19,%r28
+ ldws,ma 4(0,%r25),%r20
+ ldws,ma 4(0,%r24),%r19
+ stws,ma %r28,4(0,%r26)
+ subb %r20,%r19,%r28
+ ldws,ma 4(0,%r25),%r20
+ ldws,ma 4(0,%r24),%r19
+ stws,ma %r28,4(0,%r26)
+ subb %r20,%r19,%r28
+ ldws,ma 4(0,%r25),%r20
+ ldws,ma 4(0,%r24),%r19
+ stws,ma %r28,4(0,%r26)
+ addib,> -4,%r23,L(loop)
+ subb %r20,%r19,%r28
+
+LDEF(rest)
+ addib,= 4,%r23,L(end)
+ nop
+
+LDEF(eloop)
+ ldws,ma 4(0,%r25),%r20
+ ldws,ma 4(0,%r24),%r19
+ stws,ma %r28,4(0,%r26)
+ addib,> -1,%r23,L(eloop)
+ subb %r20,%r19,%r28
+
+LDEF(end)
+ stws %r28,0(0,%r26)
+ addc %r0,%r0,%r28
+ bv 0(%r2)
+ subi 1,%r28,%r28
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/pa32/hppa1_1/pa7100/submul_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/pa32/hppa1_1/pa7100/submul_1.asm
new file mode 100644
index 00000000000..5ea08cbee55
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/pa32/hppa1_1/pa7100/submul_1.asm
@@ -0,0 +1,207 @@
+dnl HP-PA 7100/7200 mpn_submul_1 -- Multiply a limb vector with a limb and
+dnl subtract the result from a second limb vector.
+
+dnl Copyright 1995, 2000-2003 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(`res_ptr',`%r26')
+define(`s1_ptr',`%r25')
+define(`size_param',`%r24')
+define(`s2_limb',`%r23')
+
+define(`cylimb',`%r28')
+define(`s0',`%r19')
+define(`s1',`%r20')
+define(`s2',`%r3')
+define(`s3',`%r4')
+define(`lo0',`%r21')
+define(`lo1',`%r5')
+define(`lo2',`%r6')
+define(`lo3',`%r7')
+define(`hi0',`%r22')
+define(`hi1',`%r23') C safe to reuse
+define(`hi2',`%r29')
+define(`hi3',`%r1')
+
+ASM_START()
+PROLOGUE(mpn_submul_1)
+C .callinfo frame=128,no_calls
+
+ ldo 128(%r30),%r30
+ stws s2_limb,-16(%r30)
+ add %r0,%r0,cylimb C clear cy and cylimb
+ addib,< -4,size_param,L(few_limbs)
+ fldws -16(%r30),%fr31R
+
+ ldo -112(%r30),%r31
+ stw %r3,-96(%r30)
+ stw %r4,-92(%r30)
+ stw %r5,-88(%r30)
+ stw %r6,-84(%r30)
+ stw %r7,-80(%r30)
+
+ bb,>=,n s1_ptr,29,L(0)
+
+ fldws,ma 4(s1_ptr),%fr4
+ ldws 0(res_ptr),s0
+ xmpyu %fr4,%fr31R,%fr5
+ fstds %fr5,-16(%r31)
+ ldws -16(%r31),cylimb
+ ldws -12(%r31),lo0
+ sub s0,lo0,s0
+ add s0,lo0,%r0 C invert cy
+ addib,< -1,size_param,L(few_limbs)
+ stws,ma s0,4(res_ptr)
+
+C start software pipeline ----------------------------------------------------
+LDEF(0)
+ fldds,ma 8(s1_ptr),%fr4
+ fldds,ma 8(s1_ptr),%fr8
+
+ xmpyu %fr4L,%fr31R,%fr5
+ xmpyu %fr4R,%fr31R,%fr6
+ xmpyu %fr8L,%fr31R,%fr9
+ xmpyu %fr8R,%fr31R,%fr10
+
+ fstds %fr5,-16(%r31)
+ fstds %fr6,-8(%r31)
+ fstds %fr9,0(%r31)
+ fstds %fr10,8(%r31)
+
+ ldws -16(%r31),hi0
+ ldws -12(%r31),lo0
+ ldws -8(%r31),hi1
+ ldws -4(%r31),lo1
+ ldws 0(%r31),hi2
+ ldws 4(%r31),lo2
+ ldws 8(%r31),hi3
+ ldws 12(%r31),lo3
+
+ addc lo0,cylimb,lo0
+ addc lo1,hi0,lo1
+ addc lo2,hi1,lo2
+ addc lo3,hi2,lo3
+
+ addib,< -4,size_param,L(end)
+ addc %r0,hi3,cylimb C propagate carry into cylimb
+C main loop ------------------------------------------------------------------
+LDEF(loop)
+ fldds,ma 8(s1_ptr),%fr4
+ fldds,ma 8(s1_ptr),%fr8
+
+ ldws 0(res_ptr),s0
+ xmpyu %fr4L,%fr31R,%fr5
+ ldws 4(res_ptr),s1
+ xmpyu %fr4R,%fr31R,%fr6
+ ldws 8(res_ptr),s2
+ xmpyu %fr8L,%fr31R,%fr9
+ ldws 12(res_ptr),s3
+ xmpyu %fr8R,%fr31R,%fr10
+
+ fstds %fr5,-16(%r31)
+ sub s0,lo0,s0
+ fstds %fr6,-8(%r31)
+ subb s1,lo1,s1
+ fstds %fr9,0(%r31)
+ subb s2,lo2,s2
+ fstds %fr10,8(%r31)
+ subb s3,lo3,s3
+ subb %r0,%r0,lo0 C these two insns ...
+ add lo0,lo0,%r0 C ... just invert cy
+
+ ldws -16(%r31),hi0
+ ldws -12(%r31),lo0
+ ldws -8(%r31),hi1
+ ldws -4(%r31),lo1
+ ldws 0(%r31),hi2
+ ldws 4(%r31),lo2
+ ldws 8(%r31),hi3
+ ldws 12(%r31),lo3
+
+ addc lo0,cylimb,lo0
+ stws,ma s0,4(res_ptr)
+ addc lo1,hi0,lo1
+ stws,ma s1,4(res_ptr)
+ addc lo2,hi1,lo2
+ stws,ma s2,4(res_ptr)
+ addc lo3,hi2,lo3
+ stws,ma s3,4(res_ptr)
+
+ addib,>= -4,size_param,L(loop)
+ addc %r0,hi3,cylimb C propagate carry into cylimb
+C finish software pipeline ---------------------------------------------------
+LDEF(end)
+ ldws 0(res_ptr),s0
+ ldws 4(res_ptr),s1
+ ldws 8(res_ptr),s2
+ ldws 12(res_ptr),s3
+
+ sub s0,lo0,s0
+ stws,ma s0,4(res_ptr)
+ subb s1,lo1,s1
+ stws,ma s1,4(res_ptr)
+ subb s2,lo2,s2
+ stws,ma s2,4(res_ptr)
+ subb s3,lo3,s3
+ stws,ma s3,4(res_ptr)
+ subb %r0,%r0,lo0 C these two insns ...
+ add lo0,lo0,%r0 C ... invert cy
+
+C restore callee-saves registers ---------------------------------------------
+ ldw -96(%r30),%r3
+ ldw -92(%r30),%r4
+ ldw -88(%r30),%r5
+ ldw -84(%r30),%r6
+ ldw -80(%r30),%r7
+
+LDEF(few_limbs)
+ addib,=,n 4,size_param,L(ret)
+
+LDEF(loop2)
+ fldws,ma 4(s1_ptr),%fr4
+ ldws 0(res_ptr),s0
+ xmpyu %fr4,%fr31R,%fr5
+ fstds %fr5,-16(%r30)
+ ldws -16(%r30),hi0
+ ldws -12(%r30),lo0
+ addc lo0,cylimb,lo0
+ addc %r0,hi0,cylimb
+ sub s0,lo0,s0
+ add s0,lo0,%r0 C invert cy
+ stws,ma s0,4(res_ptr)
+ addib,<> -1,size_param,L(loop2)
+ nop
+
+LDEF(ret)
+ addc %r0,cylimb,cylimb
+ bv 0(%r2)
+ ldo -128(%r30),%r30
+EPILOGUE(mpn_submul_1)
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/pa32/hppa1_1/sqr_diagonal.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/pa32/hppa1_1/sqr_diagonal.asm
new file mode 100644
index 00000000000..1c7a18e37d6
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/pa32/hppa1_1/sqr_diagonal.asm
@@ -0,0 +1,60 @@
+dnl HP-PA 1.1 32-bit 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/.
+
+include(`../config.m4')
+
+C This code runs at 6 cycles/limb on the PA7100 and 2.5 cycles/limb on PA8x00.
+C 2-way unrolling wouldn't help the PA7100; it could however bring times down
+C to 2.0 cycles/limb for the PA8x00.
+
+C INPUT PARAMETERS
+define(`rp',`%r26')
+define(`up',`%r25')
+define(`n',`%r24')
+
+ASM_START()
+PROLOGUE(mpn_sqr_diagonal)
+ ldo 4(rp),rp
+ fldws,ma 4(up),%fr4r
+ addib,= -1,n,L(exit)
+ xmpyu %fr4r,%fr4r,%fr5
+
+LDEF(loop)
+ fldws,ma 4(up),%fr4r
+ fstws %fr5r,-4(rp)
+ fstws,ma %fr5l,8(rp)
+ addib,<> -1,n,L(loop)
+ xmpyu %fr4r,%fr4r,%fr5
+
+LDEF(exit)
+ fstws %fr5r,-4(rp)
+ bv 0(%r2)
+ fstws %fr5l,0(rp)
+EPILOGUE(mpn_sqr_diagonal)
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/pa32/hppa1_1/submul_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/pa32/hppa1_1/submul_1.asm
new file mode 100644
index 00000000000..a9b11d24a89
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/pa32/hppa1_1/submul_1.asm
@@ -0,0 +1,115 @@
+dnl HP-PA 1.1 mpn_submul_1 -- Multiply a limb vector with a limb and subtract
+dnl the result from a second limb vector.
+
+dnl Copyright 1992-1994, 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 r26
+C s1_ptr r25
+C size r24
+C s2_limb r23
+
+C This runs at 12 cycles/limb on a PA7000. With the used instructions, it can
+C not become faster due to data cache contention after a store. On the PA7100
+C it runs at 11 cycles/limb.
+
+C There are some ideas described in mul_1.asm that applies to this code too.
+
+C It seems possible to make this run as fast as mpn_addmul_1, if we use
+C sub,>>= %r29,%r19,%r22
+C addi 1,%r28,%r28
+C but that requires reworking the hairy software pipeline...
+
+ASM_START()
+PROLOGUE(mpn_submul_1)
+C .callinfo frame=64,no_calls
+
+ ldo 64(%r30),%r30
+ fldws,ma 4(%r25),%fr5
+ stw %r23,-16(%r30) C move s2_limb ...
+ addib,= -1,%r24,L(just_one_limb)
+ fldws -16(%r30),%fr4 C ... into fr4
+ add %r0,%r0,%r0 C clear carry
+ xmpyu %fr4,%fr5,%fr6
+ fldws,ma 4(%r25),%fr7
+ fstds %fr6,-16(%r30)
+ xmpyu %fr4,%fr7,%fr8
+ ldw -12(%r30),%r19 C least significant limb in product
+ ldw -16(%r30),%r28
+
+ fstds %fr8,-16(%r30)
+ addib,= -1,%r24,L(end)
+ ldw -12(%r30),%r1
+
+C Main loop
+LDEF(loop)
+ ldws 0(%r26),%r29
+ fldws,ma 4(%r25),%fr5
+ sub %r29,%r19,%r22
+ add %r22,%r19,%r0
+ stws,ma %r22,4(%r26)
+ addc %r28,%r1,%r19
+ xmpyu %fr4,%fr5,%fr6
+ ldw -16(%r30),%r28
+ fstds %fr6,-16(%r30)
+ addc %r0,%r28,%r28
+ addib,<> -1,%r24,L(loop)
+ ldw -12(%r30),%r1
+
+LDEF(end)
+ ldw 0(%r26),%r29
+ sub %r29,%r19,%r22
+ add %r22,%r19,%r0
+ stws,ma %r22,4(%r26)
+ addc %r28,%r1,%r19
+ ldw -16(%r30),%r28
+ ldws 0(%r26),%r29
+ addc %r0,%r28,%r28
+ sub %r29,%r19,%r22
+ add %r22,%r19,%r0
+ stws,ma %r22,4(%r26)
+ addc %r0,%r28,%r28
+ bv 0(%r2)
+ ldo -64(%r30),%r30
+
+LDEF(just_one_limb)
+ xmpyu %fr4,%fr5,%fr6
+ ldw 0(%r26),%r29
+ fstds %fr6,-16(%r30)
+ ldw -12(%r30),%r1
+ ldw -16(%r30),%r28
+ sub %r29,%r1,%r22
+ add %r22,%r1,%r0
+ stw %r22,0(%r26)
+ addc %r0,%r28,%r28
+ bv 0(%r2)
+ ldo -64(%r30),%r30
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/pa32/hppa1_1/udiv.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/pa32/hppa1_1/udiv.asm
new file mode 100644
index 00000000000..626ecd202b0
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/pa32/hppa1_1/udiv.asm
@@ -0,0 +1,102 @@
+dnl HP-PA __udiv_qrnnd division support, used from longlong.h.
+dnl This version runs fast on PA 7000 and later.
+
+dnl Copyright 1993, 1994, 2000, 2001, 2003 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 rem_ptr gr26
+C n1 gr25
+C n0 gr24
+C d gr23
+
+C This file has caused a lot of trouble, since it demands PIC reference to
+C static data, which triggers bugs in gas (at least version 2.7 through
+C 2.11.2). When the bug is triggered, many bogus relocs are generated. The
+C current solution is to stuff data right into the code, and refer it using
+C absolute offsets. Fragile to be sure, but nothing else seems to work.
+
+ASM_START()
+ifdef(`PIC',`',
+` RODATA
+ INT64(0000, 0x43f00000, 0x0) C 2^64
+')
+
+PROLOGUE(mpn_udiv_qrnnd)
+C .callinfo frame=64,no_calls
+
+ ldo 64(%r30),%r30
+
+ stws %r25,-16(0,%r30) C n_hi
+ stws %r24,-12(0,%r30) C n_lo
+
+ifdef(`PIC',
+` bl .+20,%r31
+ dep %r0,31,2,%r31
+ .word 0x0 C padding for alignment
+ .word 0x43f00000, 0x0 C 2^64
+ ldo 4(%r31),%r31',
+` ldil `L'%L(0000),%r31
+ ldo R%L(0000)(%r31),%r31')
+
+ fldds -16(0,%r30),%fr5
+ stws %r23,-12(0,%r30)
+ comib,<= 0,%r25,L(1)
+ fcnvxf,dbl,dbl %fr5,%fr5
+ fldds 0(0,%r31),%fr4
+ fadd,dbl %fr4,%fr5,%fr5
+
+LDEF(1)
+ fcpy,sgl %fr0,%fr6L
+ fldws -12(0,%r30),%fr6R
+ fcnvxf,dbl,dbl %fr6,%fr4
+
+ fdiv,dbl %fr5,%fr4,%fr5
+
+ fcnvfx,dbl,dbl %fr5,%fr4
+ fstws %fr4R,-16(%r30)
+ xmpyu %fr4R,%fr6R,%fr6
+ ldws -16(%r30),%r28
+ fstds %fr6,-16(0,%r30)
+ ldws -12(0,%r30),%r21
+ ldws -16(0,%r30),%r20
+ sub %r24,%r21,%r22
+ subb %r25,%r20,%r20
+ comib,= 0,%r20,L(2)
+ ldo -64(%r30),%r30
+
+ add %r22,%r23,%r22
+ ldo -1(%r28),%r28
+
+LDEF(2)
+ bv 0(%r2)
+ stws %r22,0(0,%r26)
+
+EPILOGUE(mpn_udiv_qrnnd)
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/pa32/hppa1_1/umul.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/pa32/hppa1_1/umul.asm
new file mode 100644
index 00000000000..18b923cd5a9
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/pa32/hppa1_1/umul.asm
@@ -0,0 +1,47 @@
+dnl Copyright 1999, 2001 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')
+
+ASM_START()
+PROLOGUE(mpn_umul_ppmm)
+C .callinfo frame=64,no_calls
+
+ ldo 64(%r30),%r30
+ stw %r25,-16(0,%r30)
+ fldws -16(0,%r30),%fr22R
+ stw %r24,-16(0,%r30)
+ fldws -16(0,%r30),%fr22L
+ xmpyu %fr22R,%fr22L,%fr22
+ fstds %fr22,-16(0,%r30)
+ ldw -16(0,%r30),%r28
+ ldw -12(0,%r30),%r29
+ stw %r29,0(0,%r26)
+ bv 0(%r2)
+ ldo -64(%r30),%r30
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/pa32/hppa2_0/add_n.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/pa32/hppa2_0/add_n.asm
new file mode 100644
index 00000000000..8d881b8b086
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/pa32/hppa2_0/add_n.asm
@@ -0,0 +1,107 @@
+dnl HP-PA 2.0 32-bit mpn_add_n -- Add two limb vectors of the same length > 0
+dnl and store sum in a third limb vector.
+
+dnl Copyright 1997, 1998, 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 gr26
+C s1_ptr gr25
+C s2_ptr gr24
+C size gr23
+
+C This runs at 2 cycles/limb on PA8000.
+
+ASM_START()
+PROLOGUE(mpn_add_n)
+ sub %r0,%r23,%r22
+ zdep %r22,30,3,%r28 C r28 = 2 * (-n & 7)
+ zdep %r22,29,3,%r22 C r22 = 4 * (-n & 7)
+ sub %r25,%r22,%r25 C offset s1_ptr
+ sub %r24,%r22,%r24 C offset s2_ptr
+ sub %r26,%r22,%r26 C offset res_ptr
+ blr %r28,%r0 C branch into loop
+ add %r0,%r0,%r0 C reset carry
+
+LDEF(loop)
+ ldw 0(%r25),%r20
+ ldw 0(%r24),%r31
+ addc %r20,%r31,%r20
+ stw %r20,0(%r26)
+
+LDEF(7)
+ ldw 4(%r25),%r21
+ ldw 4(%r24),%r19
+ addc %r21,%r19,%r21
+ stw %r21,4(%r26)
+
+LDEF(6)
+ ldw 8(%r25),%r20
+ ldw 8(%r24),%r31
+ addc %r20,%r31,%r20
+ stw %r20,8(%r26)
+
+LDEF(5)
+ ldw 12(%r25),%r21
+ ldw 12(%r24),%r19
+ addc %r21,%r19,%r21
+ stw %r21,12(%r26)
+
+LDEF(4)
+ ldw 16(%r25),%r20
+ ldw 16(%r24),%r31
+ addc %r20,%r31,%r20
+ stw %r20,16(%r26)
+
+LDEF(3)
+ ldw 20(%r25),%r21
+ ldw 20(%r24),%r19
+ addc %r21,%r19,%r21
+ stw %r21,20(%r26)
+
+LDEF(2)
+ ldw 24(%r25),%r20
+ ldw 24(%r24),%r31
+ addc %r20,%r31,%r20
+ stw %r20,24(%r26)
+
+LDEF(1)
+ ldw 28(%r25),%r21
+ ldo 32(%r25),%r25
+ ldw 28(%r24),%r19
+ addc %r21,%r19,%r21
+ stw %r21,28(%r26)
+ ldo 32(%r24),%r24
+ addib,> -8,%r23,L(loop)
+ ldo 32(%r26),%r26
+
+ bv (%r2)
+ addc %r0,%r0,%r28
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/pa32/hppa2_0/gmp-mparam.h b/Build/source/libs/gmp/gmp-6.0.0/mpn/pa32/hppa2_0/gmp-mparam.h
new file mode 100644
index 00000000000..6016274714d
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/pa32/hppa2_0/gmp-mparam.h
@@ -0,0 +1,167 @@
+/* gmp-mparam.h -- Compiler/machine parameter header file.
+
+Copyright 1991, 1993, 1994, 1999-2002, 2009, 2010 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
+
+/* 552 MHz PA8600 (gcc61.fsffrance.org) */
+
+#define DIVREM_1_NORM_THRESHOLD 3
+#define DIVREM_1_UNNORM_THRESHOLD 3
+#define MOD_1_NORM_THRESHOLD 3
+#define MOD_1_UNNORM_THRESHOLD 4
+#define MOD_1N_TO_MOD_1_1_THRESHOLD 11
+#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 22
+#define PREINV_MOD_1_TO_MOD_1_THRESHOLD 28
+#define USE_PREINV_DIVREM_1 1
+#define DIVEXACT_1_THRESHOLD 0 /* always */
+#define BMOD_1_TO_MOD_1_THRESHOLD 36
+
+#define MUL_TOOM22_THRESHOLD 18
+#define MUL_TOOM33_THRESHOLD 65
+#define MUL_TOOM44_THRESHOLD 166
+#define MUL_TOOM6H_THRESHOLD 202
+#define MUL_TOOM8H_THRESHOLD 333
+
+#define MUL_TOOM32_TO_TOOM43_THRESHOLD 105
+#define MUL_TOOM32_TO_TOOM53_THRESHOLD 138
+#define MUL_TOOM42_TO_TOOM53_THRESHOLD 105
+#define MUL_TOOM42_TO_TOOM63_THRESHOLD 102
+
+#define SQR_BASECASE_THRESHOLD 7
+#define SQR_TOOM2_THRESHOLD 55
+#define SQR_TOOM3_THRESHOLD 93
+#define SQR_TOOM4_THRESHOLD 250
+#define SQR_TOOM6_THRESHOLD 306
+#define SQR_TOOM8_THRESHOLD 527
+
+#define MULMOD_BNM1_THRESHOLD 13
+#define SQRMOD_BNM1_THRESHOLD 15
+
+#define MUL_FFT_MODF_THRESHOLD 244 /* k = 5 */
+#define MUL_FFT_TABLE3 \
+ { { 244, 5}, { 8, 4}, { 17, 5}, { 13, 6}, \
+ { 7, 5}, { 17, 6}, { 9, 5}, { 19, 6}, \
+ { 13, 7}, { 7, 6}, { 17, 7}, { 9, 6}, \
+ { 19, 7}, { 11, 6}, { 24, 7}, { 13, 8}, \
+ { 7, 7}, { 19, 8}, { 11, 7}, { 25, 8}, \
+ { 15, 7}, { 33, 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, 9}, { 135, 8}, { 271, 9}, { 143,10}, \
+ { 79, 9}, { 159, 8}, { 319, 9}, { 175, 8}, \
+ { 351,10}, { 95, 9}, { 191, 8}, { 383, 9}, \
+ { 207,11}, { 63,10}, { 127, 9}, { 255, 8}, \
+ { 511, 9}, { 271,10}, { 143, 9}, { 287, 8}, \
+ { 575,10}, { 159, 9}, { 319,10}, { 175, 9}, \
+ { 351,11}, { 95,10}, { 191, 9}, { 383,10}, \
+ { 207, 9}, { 415,12}, { 63,11}, { 127,10}, \
+ { 255, 9}, { 511,10}, { 271, 9}, { 543, 8}, \
+ { 1087,10}, { 287, 9}, { 575,10}, { 303,11}, \
+ { 159,10}, { 351, 9}, { 703, 8}, { 1407,11}, \
+ { 191,10}, { 415, 9}, { 831,11}, { 223, 9}, \
+ { 895,10}, { 479,12}, { 127,11}, { 255,10}, \
+ { 543, 9}, { 1087,11}, { 287,10}, { 607, 9}, \
+ { 1215,11}, { 351,10}, { 703, 9}, { 1407,12}, \
+ { 191,11}, { 415,10}, { 831,11}, { 479,13}, \
+ { 8192,14}, { 16384,15}, { 32768,16} }
+#define MUL_FFT_TABLE3_SIZE 107
+#define MUL_FFT_THRESHOLD 2112
+
+#define SQR_FFT_MODF_THRESHOLD 240 /* k = 5 */
+#define SQR_FFT_TABLE3 \
+ { { 240, 5}, { 8, 4}, { 17, 5}, { 19, 6}, \
+ { 17, 7}, { 9, 6}, { 20, 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, 9}, { 79,10}, \
+ { 47,11}, { 31,10}, { 63, 9}, { 127, 8}, \
+ { 255, 7}, { 511, 9}, { 135, 8}, { 271, 9}, \
+ { 143,10}, { 79, 9}, { 159, 8}, { 319, 9}, \
+ { 175, 8}, { 351, 7}, { 703,10}, { 95, 9}, \
+ { 191, 8}, { 383, 9}, { 207,11}, { 63,10}, \
+ { 127, 9}, { 255, 8}, { 511, 9}, { 271,10}, \
+ { 143, 9}, { 287, 8}, { 575,10}, { 159, 9}, \
+ { 319,10}, { 175, 9}, { 351, 8}, { 703,11}, \
+ { 95,10}, { 191, 9}, { 383,10}, { 207, 9}, \
+ { 415,12}, { 63,11}, { 127,10}, { 255, 9}, \
+ { 511,10}, { 271, 9}, { 543, 8}, { 1087,10}, \
+ { 287, 9}, { 575,11}, { 159,10}, { 319, 9}, \
+ { 639,10}, { 351, 9}, { 703, 8}, { 1407,11}, \
+ { 191,10}, { 415, 9}, { 831,11}, { 223, 8}, \
+ { 1791,10}, { 479, 9}, { 959,12}, { 127,11}, \
+ { 255,10}, { 543,11}, { 287,10}, { 607,11}, \
+ { 319,10}, { 639,11}, { 351,10}, { 703, 9}, \
+ { 1407,12}, { 191,11}, { 415,10}, { 831,11}, \
+ { 479,10}, { 959,13}, { 8192,14}, { 16384,15}, \
+ { 32768,16} }
+#define SQR_FFT_TABLE3_SIZE 109
+#define SQR_FFT_THRESHOLD 1600
+
+#define MULLO_BASECASE_THRESHOLD 0 /* always */
+#define MULLO_DC_THRESHOLD 116
+#define MULLO_MUL_N_THRESHOLD 3574
+
+#define DC_DIV_QR_THRESHOLD 100
+#define DC_DIVAPPR_Q_THRESHOLD 348
+#define DC_BDIV_QR_THRESHOLD 109
+#define DC_BDIV_Q_THRESHOLD 254
+
+#define INV_MULMOD_BNM1_THRESHOLD 34
+#define INV_NEWTON_THRESHOLD 276
+#define INV_APPR_THRESHOLD 276
+
+#define BINV_NEWTON_THRESHOLD 278
+#define REDC_1_TO_REDC_N_THRESHOLD 78
+
+#define MU_DIV_QR_THRESHOLD 979
+#define MU_DIVAPPR_Q_THRESHOLD 263
+#define MUPI_DIV_QR_THRESHOLD 102
+#define MU_BDIV_QR_THRESHOLD 807
+#define MU_BDIV_Q_THRESHOLD 1187
+
+#define MATRIX22_STRASSEN_THRESHOLD 11
+#define HGCD_THRESHOLD 100
+#define GCD_DC_THRESHOLD 379
+#define GCDEXT_DC_THRESHOLD 249
+#define JACOBI_BASE_METHOD 2
+
+#define GET_STR_DC_THRESHOLD 7
+#define GET_STR_PRECOMPUTE_THRESHOLD 16
+#define SET_STR_DC_THRESHOLD 270
+#define SET_STR_PRECOMPUTE_THRESHOLD 782
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/pa32/hppa2_0/sqr_diagonal.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/pa32/hppa2_0/sqr_diagonal.asm
new file mode 100644
index 00000000000..c55112fac53
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/pa32/hppa2_0/sqr_diagonal.asm
@@ -0,0 +1,112 @@
+dnl HP-PA 32-bit mpn_sqr_diagonal optimized for the PA8x00.
+
+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/.
+
+include(`../config.m4')
+
+C This code runs at 6 cycles/limb on the PA7100 and 2 cycles/limb on PA8x00.
+C The 2-way unrolling is actually not helping the PA7100.
+
+C INPUT PARAMETERS
+define(`rp',`%r26')
+define(`up',`%r25')
+define(`n',`%r24')
+
+ASM_START()
+PROLOGUE(mpn_sqr_diagonal)
+
+ fldws,ma 4(up),%fr4r
+ addib,= -1,n,L(end1)
+ ldo 4(rp),rp
+
+ fldws,ma 4(up),%fr6r
+ addib,= -1,n,L(end2)
+ xmpyu %fr4r,%fr4r,%fr5
+
+ fldws,ma 4(up),%fr4r
+ addib,= -1,n,L(end3)
+ xmpyu %fr6r,%fr6r,%fr7
+
+
+LDEF(loop)
+ fldws,ma 4(up),%fr6r
+ fstws %fr5r,-4(rp)
+ fstws,ma %fr5l,8(rp)
+ addib,= -1,n,L(exite)
+ xmpyu %fr4r,%fr4r,%fr5
+ fldws,ma 4(up),%fr4r
+ fstws %fr7r,-4(rp)
+ fstws,ma %fr7l,8(rp)
+ addib,<> -1,n,L(loop)
+ xmpyu %fr6r,%fr6r,%fr7
+
+LDEF(exito)
+ fstws %fr5r,-4(rp)
+ fstws %fr5l,0(rp)
+ xmpyu %fr4r,%fr4r,%fr5
+ fstws %fr7r,4(rp)
+ fstws %fr7l,8(rp)
+ fstws,mb %fr5r,12(rp)
+ bv 0(%r2)
+ fstws %fr5l,4(rp)
+
+LDEF(exite)
+ fstws %fr7r,-4(rp)
+ fstws %fr7l,0(rp)
+ xmpyu %fr6r,%fr6r,%fr7
+ fstws %fr5r,4(rp)
+ fstws %fr5l,8(rp)
+ fstws,mb %fr7r,12(rp)
+ bv 0(%r2)
+ fstws %fr7l,4(rp)
+
+LDEF(end1)
+ xmpyu %fr4r,%fr4r,%fr5
+ fstws %fr5r,-4(rp)
+ bv 0(%r2)
+ fstws,ma %fr5l,8(rp)
+
+LDEF(end2)
+ xmpyu %fr6r,%fr6r,%fr7
+ fstws %fr5r,-4(rp)
+ fstws %fr5l,0(rp)
+ fstws %fr7r,4(rp)
+ bv 0(%r2)
+ fstws %fr7l,8(rp)
+
+LDEF(end3)
+ fstws %fr5r,-4(rp)
+ fstws %fr5l,0(rp)
+ xmpyu %fr4r,%fr4r,%fr5
+ fstws %fr7r,4(rp)
+ fstws %fr7l,8(rp)
+ fstws,mb %fr5r,12(rp)
+ bv 0(%r2)
+ fstws %fr5l,4(rp)
+EPILOGUE(mpn_sqr_diagonal)
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/pa32/hppa2_0/sub_n.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/pa32/hppa2_0/sub_n.asm
new file mode 100644
index 00000000000..47b3163fe3c
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/pa32/hppa2_0/sub_n.asm
@@ -0,0 +1,107 @@
+dnl HP-PA 2.0 32-bit mpn_sub_n -- Subtract two limb vectors of the same
+dnl length > 0 and store difference in a third limb vector.
+
+dnl Copyright 1997, 1998, 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 gr26
+C s1_ptr gr25
+C s2_ptr gr24
+C size gr23
+
+C This runs at 2 cycles/limb on PA8000.
+
+ASM_START()
+PROLOGUE(mpn_sub_n)
+ sub %r0,%r23,%r22
+ zdep %r22,30,3,%r28 C r28 = 2 * (-n & 7)
+ zdep %r22,29,3,%r22 C r22 = 4 * (-n & 7)
+ sub %r25,%r22,%r25 C offset s1_ptr
+ sub %r24,%r22,%r24 C offset s2_ptr
+ blr %r28,%r0 C branch into loop
+ sub %r26,%r22,%r26 C offset res_ptr and set carry
+
+LDEF(loop)
+ ldw 0(%r25),%r20
+ ldw 0(%r24),%r31
+ subb %r20,%r31,%r20
+ stw %r20,0(%r26)
+
+LDEF(7)
+ ldw 4(%r25),%r21
+ ldw 4(%r24),%r19
+ subb %r21,%r19,%r21
+ stw %r21,4(%r26)
+
+LDEF(6)
+ ldw 8(%r25),%r20
+ ldw 8(%r24),%r31
+ subb %r20,%r31,%r20
+ stw %r20,8(%r26)
+
+LDEF(5)
+ ldw 12(%r25),%r21
+ ldw 12(%r24),%r19
+ subb %r21,%r19,%r21
+ stw %r21,12(%r26)
+
+LDEF(4)
+ ldw 16(%r25),%r20
+ ldw 16(%r24),%r31
+ subb %r20,%r31,%r20
+ stw %r20,16(%r26)
+
+LDEF(3)
+ ldw 20(%r25),%r21
+ ldw 20(%r24),%r19
+ subb %r21,%r19,%r21
+ stw %r21,20(%r26)
+
+LDEF(2)
+ ldw 24(%r25),%r20
+ ldw 24(%r24),%r31
+ subb %r20,%r31,%r20
+ stw %r20,24(%r26)
+
+LDEF(1)
+ ldw 28(%r25),%r21
+ ldo 32(%r25),%r25
+ ldw 28(%r24),%r19
+ subb %r21,%r19,%r21
+ stw %r21,28(%r26)
+ ldo 32(%r24),%r24
+ addib,> -8,%r23,L(loop)
+ ldo 32(%r26),%r26
+
+ addc %r0,%r0,%r28
+ bv (%r2)
+ subi 1,%r28,%r28
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/pa32/lshift.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/pa32/lshift.asm
new file mode 100644
index 00000000000..5ea497c1f19
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/pa32/lshift.asm
@@ -0,0 +1,75 @@
+dnl HP-PA mpn_lshift -- Shift a number left.
+
+dnl Copyright 1992, 1994, 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 gr26
+C s_ptr gr25
+C size gr24
+C cnt gr23
+
+ASM_START()
+PROLOGUE(mpn_lshift)
+ sh2add %r24,%r25,%r25
+ sh2add %r24,%r26,%r26
+ ldws,mb -4(0,%r25),%r22
+ subi 32,%r23,%r1
+ mtsar %r1
+ addib,= -1,%r24,L(0004)
+ vshd %r0,%r22,%r28 C compute carry out limb
+ ldws,mb -4(0,%r25),%r29
+ addib,= -1,%r24,L(0002)
+ vshd %r22,%r29,%r20
+
+LDEF(loop)
+ ldws,mb -4(0,%r25),%r22
+ stws,mb %r20,-4(0,%r26)
+ addib,= -1,%r24,L(0003)
+ vshd %r29,%r22,%r20
+ ldws,mb -4(0,%r25),%r29
+ stws,mb %r20,-4(0,%r26)
+ addib,<> -1,%r24,L(loop)
+ vshd %r22,%r29,%r20
+
+LDEF(0002)
+ stws,mb %r20,-4(0,%r26)
+ vshd %r29,%r0,%r20
+ bv 0(%r2)
+ stw %r20,-4(0,%r26)
+
+LDEF(0003)
+ stws,mb %r20,-4(0,%r26)
+
+LDEF(0004)
+ vshd %r22,%r0,%r20
+ bv 0(%r2)
+ stw %r20,-4(0,%r26)
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/pa32/pa-defs.m4 b/Build/source/libs/gmp/gmp-6.0.0/mpn/pa32/pa-defs.m4
new file mode 100644
index 00000000000..b26e715fc5b
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/pa32/pa-defs.m4
@@ -0,0 +1,64 @@
+divert(-1)
+
+dnl m4 macros for HPPA assembler.
+
+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/.
+
+
+dnl hppa assembler comments are introduced with ";".
+dnl
+dnl For cooperation with cpp, apparently lines "# 123" set the line number,
+dnl and other lines starting with a "#" are ignored.
+
+changecom(;)
+
+
+dnl Called: PROLOGUE_cpu(GSYM_PREFIX`'foo)
+dnl EPILOGUE_cpu(GSYM_PREFIX`'foo)
+dnl
+dnl These are the same as the basic PROLOGUE_cpu and EPILOGUE_cpu in
+dnl mpn/asm-defs.m4, but using .proc / .procend. These are standard and on
+dnl an ELF system they do what .type and .size normally do.
+
+define(`PROLOGUE_cpu',
+m4_assert_numargs(1)
+ `.code
+ ALIGN(8)
+ .export `$1',entry
+`$1'LABEL_SUFFIX'
+ .proc
+ .callinfo) dnl This is really bogus, but allows us to compile
+ dnl again on hppa machines.
+
+
+define(`EPILOGUE_cpu',
+m4_assert_numargs(1)
+` .procend')
+
+divert
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/pa32/rshift.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/pa32/rshift.asm
new file mode 100644
index 00000000000..c5eac830c9b
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/pa32/rshift.asm
@@ -0,0 +1,72 @@
+dnl HP-PA mpn_rshift -- Shift a number right.
+
+dnl Copyright 1992, 1994, 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 gr26
+C s_ptr gr25
+C size gr24
+C cnt gr23
+
+ASM_START()
+PROLOGUE(mpn_rshift)
+ ldws,ma 4(0,%r25),%r22
+ mtsar %r23
+ addib,= -1,%r24,L(0004)
+ vshd %r22,%r0,%r28 C compute carry out limb
+ ldws,ma 4(0,%r25),%r29
+ addib,= -1,%r24,L(0002)
+ vshd %r29,%r22,%r20
+
+LDEF(loop)
+ ldws,ma 4(0,%r25),%r22
+ stws,ma %r20,4(0,%r26)
+ addib,= -1,%r24,L(0003)
+ vshd %r22,%r29,%r20
+ ldws,ma 4(0,%r25),%r29
+ stws,ma %r20,4(0,%r26)
+ addib,<> -1,%r24,L(loop)
+ vshd %r29,%r22,%r20
+
+LDEF(0002)
+ stws,ma %r20,4(0,%r26)
+ vshd %r0,%r29,%r20
+ bv 0(%r2)
+ stw %r20,0(0,%r26)
+
+LDEF(0003)
+ stws,ma %r20,4(0,%r26)
+
+LDEF(0004)
+ vshd %r0,%r22,%r20
+ bv 0(%r2)
+ stw %r20,0(0,%r26)
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/pa32/sub_n.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/pa32/sub_n.asm
new file mode 100644
index 00000000000..9c71655b983
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/pa32/sub_n.asm
@@ -0,0 +1,64 @@
+dnl HP-PA mpn_sub_n -- Subtract two limb vectors of the same length > 0 and
+dnl store difference in a third limb vector.
+
+dnl Copyright 1992, 1994, 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 gr26
+C s1_ptr gr25
+C s2_ptr gr24
+C size gr23
+
+C One might want to unroll this as for other processors, but it turns out that
+C the data cache contention after a store makes such unrolling useless. We
+C can't come under 5 cycles/limb anyway.
+
+ASM_START()
+PROLOGUE(mpn_sub_n)
+ ldws,ma 4(0,%r25),%r20
+ ldws,ma 4(0,%r24),%r19
+
+ addib,= -1,%r23,L(end) C check for (SIZE == 1)
+ sub %r20,%r19,%r28 C subtract first limbs ignoring cy
+
+LDEF(loop)
+ ldws,ma 4(0,%r25),%r20
+ ldws,ma 4(0,%r24),%r19
+ stws,ma %r28,4(0,%r26)
+ addib,<> -1,%r23,L(loop)
+ subb %r20,%r19,%r28
+
+LDEF(end)
+ stws %r28,0(0,%r26)
+ addc %r0,%r0,%r28
+ bv 0(%r2)
+ subi 1,%r28,%r28
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/pa32/udiv.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/pa32/udiv.asm
new file mode 100644
index 00000000000..addbf41ef51
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/pa32/udiv.asm
@@ -0,0 +1,291 @@
+dnl HP-PA __udiv_qrnnd division support, used from longlong.h.
+dnl This version runs fast on pre-PA7000 CPUs.
+
+dnl Copyright 1993, 1994, 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 rem_ptr gr26
+C n1 gr25
+C n0 gr24
+C d gr23
+
+C The code size is a bit excessive. We could merge the last two ds;addc
+C sequences by simply moving the "bb,< Odd" instruction down. The only
+C trouble is the FFFFFFFF code that would need some hacking.
+
+ASM_START()
+PROLOGUE(mpn_udiv_qrnnd)
+ comb,< %r23,0,L(largedivisor)
+ sub %r0,%r23,%r1 C clear cy as side-effect
+ ds %r0,%r1,%r0
+ addc %r24,%r24,%r24
+ ds %r25,%r23,%r25
+ addc %r24,%r24,%r24
+ ds %r25,%r23,%r25
+ addc %r24,%r24,%r24
+ ds %r25,%r23,%r25
+ addc %r24,%r24,%r24
+ ds %r25,%r23,%r25
+ addc %r24,%r24,%r24
+ ds %r25,%r23,%r25
+ addc %r24,%r24,%r24
+ ds %r25,%r23,%r25
+ addc %r24,%r24,%r24
+ ds %r25,%r23,%r25
+ addc %r24,%r24,%r24
+ ds %r25,%r23,%r25
+ addc %r24,%r24,%r24
+ ds %r25,%r23,%r25
+ addc %r24,%r24,%r24
+ ds %r25,%r23,%r25
+ addc %r24,%r24,%r24
+ ds %r25,%r23,%r25
+ addc %r24,%r24,%r24
+ ds %r25,%r23,%r25
+ addc %r24,%r24,%r24
+ ds %r25,%r23,%r25
+ addc %r24,%r24,%r24
+ ds %r25,%r23,%r25
+ addc %r24,%r24,%r24
+ ds %r25,%r23,%r25
+ addc %r24,%r24,%r24
+ ds %r25,%r23,%r25
+ addc %r24,%r24,%r24
+ ds %r25,%r23,%r25
+ addc %r24,%r24,%r24
+ ds %r25,%r23,%r25
+ addc %r24,%r24,%r24
+ ds %r25,%r23,%r25
+ addc %r24,%r24,%r24
+ ds %r25,%r23,%r25
+ addc %r24,%r24,%r24
+ ds %r25,%r23,%r25
+ addc %r24,%r24,%r24
+ ds %r25,%r23,%r25
+ addc %r24,%r24,%r24
+ ds %r25,%r23,%r25
+ addc %r24,%r24,%r24
+ ds %r25,%r23,%r25
+ addc %r24,%r24,%r24
+ ds %r25,%r23,%r25
+ addc %r24,%r24,%r24
+ ds %r25,%r23,%r25
+ addc %r24,%r24,%r24
+ ds %r25,%r23,%r25
+ addc %r24,%r24,%r24
+ ds %r25,%r23,%r25
+ addc %r24,%r24,%r24
+ ds %r25,%r23,%r25
+ addc %r24,%r24,%r24
+ ds %r25,%r23,%r25
+ addc %r24,%r24,%r24
+ ds %r25,%r23,%r25
+ addc %r24,%r24,%r28
+ ds %r25,%r23,%r25
+ comclr,>= %r25,%r0,%r0
+ addl %r25,%r23,%r25
+ stws %r25,0(0,%r26)
+ bv 0(%r2)
+ addc %r28,%r28,%r28
+
+LDEF(largedivisor)
+ extru %r24,31,1,%r19 C r19 = n0 & 1
+ bb,< %r23,31,L(odd)
+ extru %r23,30,31,%r22 C r22 = d >> 1
+ shd %r25,%r24,1,%r24 C r24 = new n0
+ extru %r25,30,31,%r25 C r25 = new n1
+ sub %r0,%r22,%r21
+ ds %r0,%r21,%r0
+ addc %r24,%r24,%r24
+ ds %r25,%r22,%r25
+ addc %r24,%r24,%r24
+ ds %r25,%r22,%r25
+ addc %r24,%r24,%r24
+ ds %r25,%r22,%r25
+ addc %r24,%r24,%r24
+ ds %r25,%r22,%r25
+ addc %r24,%r24,%r24
+ ds %r25,%r22,%r25
+ addc %r24,%r24,%r24
+ ds %r25,%r22,%r25
+ addc %r24,%r24,%r24
+ ds %r25,%r22,%r25
+ addc %r24,%r24,%r24
+ ds %r25,%r22,%r25
+ addc %r24,%r24,%r24
+ ds %r25,%r22,%r25
+ addc %r24,%r24,%r24
+ ds %r25,%r22,%r25
+ addc %r24,%r24,%r24
+ ds %r25,%r22,%r25
+ addc %r24,%r24,%r24
+ ds %r25,%r22,%r25
+ addc %r24,%r24,%r24
+ ds %r25,%r22,%r25
+ addc %r24,%r24,%r24
+ ds %r25,%r22,%r25
+ addc %r24,%r24,%r24
+ ds %r25,%r22,%r25
+ addc %r24,%r24,%r24
+ ds %r25,%r22,%r25
+ addc %r24,%r24,%r24
+ ds %r25,%r22,%r25
+ addc %r24,%r24,%r24
+ ds %r25,%r22,%r25
+ addc %r24,%r24,%r24
+ ds %r25,%r22,%r25
+ addc %r24,%r24,%r24
+ ds %r25,%r22,%r25
+ addc %r24,%r24,%r24
+ ds %r25,%r22,%r25
+ addc %r24,%r24,%r24
+ ds %r25,%r22,%r25
+ addc %r24,%r24,%r24
+ ds %r25,%r22,%r25
+ addc %r24,%r24,%r24
+ ds %r25,%r22,%r25
+ addc %r24,%r24,%r24
+ ds %r25,%r22,%r25
+ addc %r24,%r24,%r24
+ ds %r25,%r22,%r25
+ addc %r24,%r24,%r24
+ ds %r25,%r22,%r25
+ addc %r24,%r24,%r24
+ ds %r25,%r22,%r25
+ addc %r24,%r24,%r24
+ ds %r25,%r22,%r25
+ addc %r24,%r24,%r24
+ ds %r25,%r22,%r25
+ addc %r24,%r24,%r24
+ ds %r25,%r22,%r25
+ addc %r24,%r24,%r24
+ ds %r25,%r22,%r25
+ comclr,>= %r25,%r0,%r0
+ addl %r25,%r22,%r25
+ sh1addl %r25,%r19,%r25
+ stws %r25,0(0,%r26)
+ bv 0(%r2)
+ addc %r24,%r24,%r28
+
+LDEF(odd)
+ addib,sv,n 1,%r22,L(FFFFFFFF) C r22 = (d / 2 + 1)
+ shd %r25,%r24,1,%r24 C r24 = new n0
+ extru %r25,30,31,%r25 C r25 = new n1
+ sub %r0,%r22,%r21
+ ds %r0,%r21,%r0
+ addc %r24,%r24,%r24
+ ds %r25,%r22,%r25
+ addc %r24,%r24,%r24
+ ds %r25,%r22,%r25
+ addc %r24,%r24,%r24
+ ds %r25,%r22,%r25
+ addc %r24,%r24,%r24
+ ds %r25,%r22,%r25
+ addc %r24,%r24,%r24
+ ds %r25,%r22,%r25
+ addc %r24,%r24,%r24
+ ds %r25,%r22,%r25
+ addc %r24,%r24,%r24
+ ds %r25,%r22,%r25
+ addc %r24,%r24,%r24
+ ds %r25,%r22,%r25
+ addc %r24,%r24,%r24
+ ds %r25,%r22,%r25
+ addc %r24,%r24,%r24
+ ds %r25,%r22,%r25
+ addc %r24,%r24,%r24
+ ds %r25,%r22,%r25
+ addc %r24,%r24,%r24
+ ds %r25,%r22,%r25
+ addc %r24,%r24,%r24
+ ds %r25,%r22,%r25
+ addc %r24,%r24,%r24
+ ds %r25,%r22,%r25
+ addc %r24,%r24,%r24
+ ds %r25,%r22,%r25
+ addc %r24,%r24,%r24
+ ds %r25,%r22,%r25
+ addc %r24,%r24,%r24
+ ds %r25,%r22,%r25
+ addc %r24,%r24,%r24
+ ds %r25,%r22,%r25
+ addc %r24,%r24,%r24
+ ds %r25,%r22,%r25
+ addc %r24,%r24,%r24
+ ds %r25,%r22,%r25
+ addc %r24,%r24,%r24
+ ds %r25,%r22,%r25
+ addc %r24,%r24,%r24
+ ds %r25,%r22,%r25
+ addc %r24,%r24,%r24
+ ds %r25,%r22,%r25
+ addc %r24,%r24,%r24
+ ds %r25,%r22,%r25
+ addc %r24,%r24,%r24
+ ds %r25,%r22,%r25
+ addc %r24,%r24,%r24
+ ds %r25,%r22,%r25
+ addc %r24,%r24,%r24
+ ds %r25,%r22,%r25
+ addc %r24,%r24,%r24
+ ds %r25,%r22,%r25
+ addc %r24,%r24,%r24
+ ds %r25,%r22,%r25
+ addc %r24,%r24,%r24
+ ds %r25,%r22,%r25
+ addc %r24,%r24,%r24
+ ds %r25,%r22,%r25
+ addc %r24,%r24,%r24
+ ds %r25,%r22,%r25
+ addc %r24,%r24,%r28
+ comclr,>= %r25,%r0,%r0
+ addl %r25,%r22,%r25
+ sh1addl %r25,%r19,%r25
+C We have computed (n1,,n0) / (d + 1), q' = r28, r' = r25
+ add,nuv %r28,%r25,%r25
+ addl %r25,%r1,%r25
+ addc %r0,%r28,%r28
+ sub,<< %r25,%r23,%r0
+ addl %r25,%r1,%r25
+ stws %r25,0(0,%r26)
+ bv 0(%r2)
+ addc %r0,%r28,%r28
+
+C This is just a special case of the code above.
+C We come here when d == 0xFFFFFFFF
+LDEF(FFFFFFFF)
+ add,uv %r25,%r24,%r24
+ sub,<< %r24,%r23,%r0
+ ldo 1(%r24),%r24
+ stws %r24,0(0,%r26)
+ bv 0(%r2)
+ addc %r0,%r25,%r28
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/pa64/README b/Build/source/libs/gmp/gmp-6.0.0/mpn/pa64/README
new file mode 100644
index 00000000000..a51ce028a4e
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/pa64/README
@@ -0,0 +1,78 @@
+Copyright 1999, 2001, 2002, 2004 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/.
+
+
+
+
+This directory contains mpn functions for 64-bit PA-RISC 2.0.
+
+PIPELINE SUMMARY
+
+The PA8x00 processors have an orthogonal 4-way out-of-order pipeline. Each
+cycle two ALU operations and two MEM operations can issue, but just one of the
+MEM operations may be a store. The two ALU operations can be almost any
+combination of non-memory operations. Unlike every other processor, integer
+and fp operations are completely equal here; they both count as just ALU
+operations.
+
+Unfortunately, some operations cause hickups in the pipeline. Combining
+carry-consuming operations like ADD,DC with operations that does not set carry
+like ADD,L cause long delays. Skip operations also seem to cause hickups. If
+several ADD,DC are issued consecutively, or if plain carry-generating ADD feed
+ADD,DC, stalling does not occur. We can effectively issue two ADD,DC
+operations/cycle.
+
+Latency scheduling is not as important as making sure to have a mix of ALU and
+MEM operations, but for full pipeline utilization, it is still a good idea to
+do some amount of latency scheduling.
+
+Like for all other processors, RAW memory scheduling is critically important.
+Since integer multiplication takes place in the floating-point unit, the GMP
+code needs to handle this problem frequently.
+
+STATUS
+
+* mpn_lshift and mpn_rshift run at 1.5 cycles/limb on PA8000 and at 1.0
+ cycles/limb on PA8500. With latency scheduling, the numbers could
+ probably be improved to 1.0 cycles/limb for all PA8x00 chips.
+
+* mpn_add_n and mpn_sub_n run at 2.0 cycles/limb on PA8000 and at about
+ 1.6875 cycles/limb on PA8500. With latency scheduling, this could
+ probably be improved to get close to 1.5 cycles/limb. A problem is the
+ stalling of carry-inputting instructions after instructions that do not
+ write to carry.
+
+* mpn_mul_1, mpn_addmul_1, and mpn_submul_1 run at between 5.625 and 6.375
+ on PA8500 and later, and about a cycle/limb slower on older chips. The
+ code uses ADD,DC for adjacent limbs, and relies heavily on reordering.
+
+
+REFERENCES
+
+Hewlett Packard, "64-Bit Runtime Architecture for PA-RISC 2.0", version 3.3,
+October 1997.
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/pa64/addmul_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/pa64/addmul_1.asm
new file mode 100644
index 00000000000..2cb9af9f147
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/pa64/addmul_1.asm
@@ -0,0 +1,693 @@
+dnl HP-PA 2.0 64-bit mpn_addmul_1 -- Multiply a limb vector with a limb and
+dnl add the result to a second limb vector.
+
+dnl Copyright 1998-2000, 2002, 2003 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 8000,8200: 7
+C 8500,8600,8700: 6.375
+
+C The feed-in and wind-down code has not yet been scheduled. Many cycles
+C could be saved there per call.
+
+C DESCRIPTION:
+C The main loop "BIG" is 4-way unrolled, mainly to allow
+C effective use of ADD,DC. Delays in moving data via the cache from the FP
+C registers to the IU registers, have demanded a deep software pipeline, and
+C a lot of stack slots for partial products in flight.
+C
+C CODE STRUCTURE:
+C save-some-registers
+C do 0, 1, 2, or 3 limbs
+C if done, restore-some-regs and return
+C save-many-regs
+C do 4, 8, ... limb
+C restore-all-regs
+
+C STACK LAYOUT:
+C HP-PA stack grows upwards. We could allocate 8 fewer slots by using the
+C slots marked FREE, as well as some slots in the caller's "frame marker".
+C
+C -00 <- r30
+C -08 FREE
+C -10 tmp
+C -18 tmp
+C -20 tmp
+C -28 tmp
+C -30 tmp
+C -38 tmp
+C -40 tmp
+C -48 tmp
+C -50 tmp
+C -58 tmp
+C -60 tmp
+C -68 tmp
+C -70 tmp
+C -78 tmp
+C -80 tmp
+C -88 tmp
+C -90 FREE
+C -98 FREE
+C -a0 FREE
+C -a8 FREE
+C -b0 r13
+C -b8 r12
+C -c0 r11
+C -c8 r10
+C -d0 r8
+C -d8 r8
+C -e0 r7
+C -e8 r6
+C -f0 r5
+C -f8 r4
+C -100 r3
+C Previous frame:
+C [unused area]
+C -38/-138 vlimb home slot. For 2.0N, the vlimb arg will arrive here.
+
+
+include(`../config.m4')
+
+C INPUT PARAMETERS:
+define(`rp',`%r26') C
+define(`up',`%r25') C
+define(`n',`%r24') C
+define(`vlimb',`%r23') C
+
+define(`climb',`%r23') C
+
+ifdef(`HAVE_ABI_2_0w',
+` .level 2.0w
+',` .level 2.0
+')
+PROLOGUE(mpn_addmul_1)
+
+ifdef(`HAVE_ABI_2_0w',
+` std vlimb, -0x38(%r30) C store vlimb into "home" slot
+')
+ std,ma %r3, 0x100(%r30)
+ std %r4, -0xf8(%r30)
+ std %r5, -0xf0(%r30)
+ ldo 0(%r0), climb C clear climb
+ fldd -0x138(%r30), %fr8 C put vlimb in fp register
+
+define(`p032a1',`%r1') C
+define(`p032a2',`%r19') C
+
+define(`m032',`%r20') C
+define(`m096',`%r21') C
+
+define(`p000a',`%r22') C
+define(`p064a',`%r29') C
+
+define(`s000',`%r31') C
+
+define(`ma000',`%r4') C
+define(`ma064',`%r20') C
+
+define(`r000',`%r3') C
+
+ extrd,u n, 63, 2, %r5
+ cmpb,= %r5, %r0, L(BIG)
+ nop
+
+ fldd 0(up), %fr4
+ ldo 8(up), up
+ xmpyu %fr8R, %fr4L, %fr22
+ xmpyu %fr8L, %fr4R, %fr23
+ fstd %fr22, -0x78(%r30) C mid product to -0x78..-0x71
+ xmpyu %fr8R, %fr4R, %fr24
+ xmpyu %fr8L, %fr4L, %fr25
+ fstd %fr23, -0x70(%r30) C mid product to -0x70..-0x69
+ fstd %fr24, -0x80(%r30) C low product to -0x80..-0x79
+ addib,<> -1, %r5, L(two_or_more)
+ fstd %fr25, -0x68(%r30) C high product to -0x68..-0x61
+LDEF(one)
+ ldd -0x78(%r30), p032a1
+ ldd -0x70(%r30), p032a2
+ ldd -0x80(%r30), p000a
+ b L(0_one_out)
+ ldd -0x68(%r30), p064a
+
+LDEF(two_or_more)
+ fldd 0(up), %fr4
+ ldo 8(up), up
+ xmpyu %fr8R, %fr4L, %fr22
+ xmpyu %fr8L, %fr4R, %fr23
+ ldd -0x78(%r30), p032a1
+ fstd %fr22, -0x78(%r30) C mid product to -0x78..-0x71
+ xmpyu %fr8R, %fr4R, %fr24
+ xmpyu %fr8L, %fr4L, %fr25
+ ldd -0x70(%r30), p032a2
+ fstd %fr23, -0x70(%r30) C mid product to -0x70..-0x69
+ ldd -0x80(%r30), p000a
+ fstd %fr24, -0x80(%r30) C low product to -0x80..-0x79
+ ldd -0x68(%r30), p064a
+ addib,<> -1, %r5, L(three_or_more)
+ fstd %fr25, -0x68(%r30) C high product to -0x68..-0x61
+LDEF(two)
+ add p032a1, p032a2, m032
+ add,dc %r0, %r0, m096
+ depd,z m032, 31, 32, ma000
+ extrd,u m032, 31, 32, ma064
+ ldd 0(rp), r000
+ b L(0_two_out)
+ depd m096, 31, 32, ma064
+
+LDEF(three_or_more)
+ fldd 0(up), %fr4
+ add p032a1, p032a2, m032
+ add,dc %r0, %r0, m096
+ depd,z m032, 31, 32, ma000
+ extrd,u m032, 31, 32, ma064
+ ldd 0(rp), r000
+C addib,= -1, %r5, L(0_out)
+ depd m096, 31, 32, ma064
+LDEF(loop0)
+C xmpyu %fr8R, %fr4L, %fr22
+C xmpyu %fr8L, %fr4R, %fr23
+C ldd -0x78(%r30), p032a1
+C fstd %fr22, -0x78(%r30) C mid product to -0x78..-0x71
+C
+C xmpyu %fr8R, %fr4R, %fr24
+C xmpyu %fr8L, %fr4L, %fr25
+C ldd -0x70(%r30), p032a2
+C fstd %fr23, -0x70(%r30) C mid product to -0x70..-0x69
+C
+C ldo 8(rp), rp
+C add climb, p000a, s000
+C ldd -0x80(%r30), p000a
+C fstd %fr24, -0x80(%r30) C low product to -0x80..-0x79
+C
+C add,dc p064a, %r0, climb
+C ldo 8(up), up
+C ldd -0x68(%r30), p064a
+C fstd %fr25, -0x68(%r30) C high product to -0x68..-0x61
+C
+C add ma000, s000, s000
+C add,dc ma064, climb, climb
+C fldd 0(up), %fr4
+C
+C add r000, s000, s000
+C add,dc %r0, climb, climb
+C std s000, -8(rp)
+C
+C add p032a1, p032a2, m032
+C add,dc %r0, %r0, m096
+C
+C depd,z m032, 31, 32, ma000
+C extrd,u m032, 31, 32, ma064
+C ldd 0(rp), r000
+C addib,<> -1, %r5, L(loop0)
+C depd m096, 31, 32, ma064
+LDEF(0_out)
+ ldo 8(up), up
+ xmpyu %fr8R, %fr4L, %fr22
+ xmpyu %fr8L, %fr4R, %fr23
+ ldd -0x78(%r30), p032a1
+ fstd %fr22, -0x78(%r30) C mid product to -0x78..-0x71
+ xmpyu %fr8R, %fr4R, %fr24
+ xmpyu %fr8L, %fr4L, %fr25
+ ldd -0x70(%r30), p032a2
+ fstd %fr23, -0x70(%r30) C mid product to -0x70..-0x69
+ ldo 8(rp), rp
+ add climb, p000a, s000
+ ldd -0x80(%r30), p000a
+ fstd %fr24, -0x80(%r30) C low product to -0x80..-0x79
+ add,dc p064a, %r0, climb
+ ldd -0x68(%r30), p064a
+ fstd %fr25, -0x68(%r30) C high product to -0x68..-0x61
+ add ma000, s000, s000
+ add,dc ma064, climb, climb
+ add r000, s000, s000
+ add,dc %r0, climb, climb
+ std s000, -8(rp)
+ add p032a1, p032a2, m032
+ add,dc %r0, %r0, m096
+ depd,z m032, 31, 32, ma000
+ extrd,u m032, 31, 32, ma064
+ ldd 0(rp), r000
+ depd m096, 31, 32, ma064
+LDEF(0_two_out)
+ ldd -0x78(%r30), p032a1
+ ldd -0x70(%r30), p032a2
+ ldo 8(rp), rp
+ add climb, p000a, s000
+ ldd -0x80(%r30), p000a
+ add,dc p064a, %r0, climb
+ ldd -0x68(%r30), p064a
+ add ma000, s000, s000
+ add,dc ma064, climb, climb
+ add r000, s000, s000
+ add,dc %r0, climb, climb
+ std s000, -8(rp)
+LDEF(0_one_out)
+ add p032a1, p032a2, m032
+ add,dc %r0, %r0, m096
+ depd,z m032, 31, 32, ma000
+ extrd,u m032, 31, 32, ma064
+ ldd 0(rp), r000
+ depd m096, 31, 32, ma064
+
+ add climb, p000a, s000
+ add,dc p064a, %r0, climb
+ add ma000, s000, s000
+ add,dc ma064, climb, climb
+ add r000, s000, s000
+ add,dc %r0, climb, climb
+ std s000, 0(rp)
+
+ cmpib,>= 4, n, L(done)
+ ldo 8(rp), rp
+
+C 4-way unrolled code.
+
+LDEF(BIG)
+
+define(`p032a1',`%r1') C
+define(`p032a2',`%r19') C
+define(`p096b1',`%r20') C
+define(`p096b2',`%r21') C
+define(`p160c1',`%r22') C
+define(`p160c2',`%r29') C
+define(`p224d1',`%r31') C
+define(`p224d2',`%r3') C
+ C
+define(`m032',`%r4') C
+define(`m096',`%r5') C
+define(`m160',`%r6') C
+define(`m224',`%r7') C
+define(`m288',`%r8') C
+ C
+define(`p000a',`%r1') C
+define(`p064a',`%r19') C
+define(`p064b',`%r20') C
+define(`p128b',`%r21') C
+define(`p128c',`%r22') C
+define(`p192c',`%r29') C
+define(`p192d',`%r31') C
+define(`p256d',`%r3') C
+ C
+define(`s000',`%r10') C
+define(`s064',`%r11') C
+define(`s128',`%r12') C
+define(`s192',`%r13') C
+ C
+define(`ma000',`%r9') C
+define(`ma064',`%r4') C
+define(`ma128',`%r5') C
+define(`ma192',`%r6') C
+define(`ma256',`%r7') C
+ C
+define(`r000',`%r1') C
+define(`r064',`%r19') C
+define(`r128',`%r20') C
+define(`r192',`%r21') C
+
+ std %r6, -0xe8(%r30)
+ std %r7, -0xe0(%r30)
+ std %r8, -0xd8(%r30)
+ std %r9, -0xd0(%r30)
+ std %r10, -0xc8(%r30)
+ std %r11, -0xc0(%r30)
+ std %r12, -0xb8(%r30)
+ std %r13, -0xb0(%r30)
+
+ifdef(`HAVE_ABI_2_0w',
+` extrd,u n, 61, 62, n C right shift 2
+',` extrd,u n, 61, 30, n C right shift 2, zero extend
+')
+
+LDEF(4_or_more)
+ fldd 0(up), %fr4
+ fldd 8(up), %fr5
+ fldd 16(up), %fr6
+ fldd 24(up), %fr7
+ xmpyu %fr8R, %fr4L, %fr22
+ xmpyu %fr8L, %fr4R, %fr23
+ xmpyu %fr8R, %fr5L, %fr24
+ xmpyu %fr8L, %fr5R, %fr25
+ xmpyu %fr8R, %fr6L, %fr26
+ xmpyu %fr8L, %fr6R, %fr27
+ fstd %fr22, -0x78(%r30) C mid product to -0x78..-0x71
+ xmpyu %fr8R, %fr7L, %fr28
+ xmpyu %fr8L, %fr7R, %fr29
+ fstd %fr23, -0x70(%r30) C mid product to -0x70..-0x69
+ xmpyu %fr8R, %fr4R, %fr30
+ xmpyu %fr8L, %fr4L, %fr31
+ fstd %fr24, -0x38(%r30) C mid product to -0x38..-0x31
+ xmpyu %fr8R, %fr5R, %fr22
+ xmpyu %fr8L, %fr5L, %fr23
+ fstd %fr25, -0x30(%r30) C mid product to -0x30..-0x29
+ xmpyu %fr8R, %fr6R, %fr24
+ xmpyu %fr8L, %fr6L, %fr25
+ fstd %fr26, -0x58(%r30) C mid product to -0x58..-0x51
+ xmpyu %fr8R, %fr7R, %fr26
+ fstd %fr27, -0x50(%r30) C mid product to -0x50..-0x49
+ addib,<> -1, n, L(8_or_more)
+ xmpyu %fr8L, %fr7L, %fr27
+ fstd %fr28, -0x18(%r30) C mid product to -0x18..-0x11
+ fstd %fr29, -0x10(%r30) C mid product to -0x10..-0x09
+ fstd %fr30, -0x80(%r30) C low product to -0x80..-0x79
+ fstd %fr31, -0x68(%r30) C high product to -0x68..-0x61
+ fstd %fr22, -0x40(%r30) C low product to -0x40..-0x39
+ fstd %fr23, -0x28(%r30) C high product to -0x28..-0x21
+ fstd %fr24, -0x60(%r30) C low product to -0x60..-0x59
+ fstd %fr25, -0x48(%r30) C high product to -0x48..-0x41
+ fstd %fr26, -0x20(%r30) C low product to -0x20..-0x19
+ fstd %fr27, -0x88(%r30) C high product to -0x88..-0x81
+ ldd -0x78(%r30), p032a1
+ ldd -0x70(%r30), p032a2
+ ldd -0x38(%r30), p096b1
+ ldd -0x30(%r30), p096b2
+ ldd -0x58(%r30), p160c1
+ ldd -0x50(%r30), p160c2
+ ldd -0x18(%r30), p224d1
+ ldd -0x10(%r30), p224d2
+ b L(end1)
+ nop
+
+LDEF(8_or_more)
+ fstd %fr28, -0x18(%r30) C mid product to -0x18..-0x11
+ fstd %fr29, -0x10(%r30) C mid product to -0x10..-0x09
+ ldo 32(up), up
+ fstd %fr30, -0x80(%r30) C low product to -0x80..-0x79
+ fstd %fr31, -0x68(%r30) C high product to -0x68..-0x61
+ fstd %fr22, -0x40(%r30) C low product to -0x40..-0x39
+ fstd %fr23, -0x28(%r30) C high product to -0x28..-0x21
+ fstd %fr24, -0x60(%r30) C low product to -0x60..-0x59
+ fstd %fr25, -0x48(%r30) C high product to -0x48..-0x41
+ fstd %fr26, -0x20(%r30) C low product to -0x20..-0x19
+ fstd %fr27, -0x88(%r30) C high product to -0x88..-0x81
+ fldd 0(up), %fr4
+ fldd 8(up), %fr5
+ fldd 16(up), %fr6
+ fldd 24(up), %fr7
+ xmpyu %fr8R, %fr4L, %fr22
+ ldd -0x78(%r30), p032a1
+ xmpyu %fr8L, %fr4R, %fr23
+ xmpyu %fr8R, %fr5L, %fr24
+ ldd -0x70(%r30), p032a2
+ xmpyu %fr8L, %fr5R, %fr25
+ xmpyu %fr8R, %fr6L, %fr26
+ ldd -0x38(%r30), p096b1
+ xmpyu %fr8L, %fr6R, %fr27
+ fstd %fr22, -0x78(%r30) C mid product to -0x78..-0x71
+ xmpyu %fr8R, %fr7L, %fr28
+ ldd -0x30(%r30), p096b2
+ xmpyu %fr8L, %fr7R, %fr29
+ fstd %fr23, -0x70(%r30) C mid product to -0x70..-0x69
+ xmpyu %fr8R, %fr4R, %fr30
+ ldd -0x58(%r30), p160c1
+ xmpyu %fr8L, %fr4L, %fr31
+ fstd %fr24, -0x38(%r30) C mid product to -0x38..-0x31
+ xmpyu %fr8R, %fr5R, %fr22
+ ldd -0x50(%r30), p160c2
+ xmpyu %fr8L, %fr5L, %fr23
+ fstd %fr25, -0x30(%r30) C mid product to -0x30..-0x29
+ xmpyu %fr8R, %fr6R, %fr24
+ ldd -0x18(%r30), p224d1
+ xmpyu %fr8L, %fr6L, %fr25
+ fstd %fr26, -0x58(%r30) C mid product to -0x58..-0x51
+ xmpyu %fr8R, %fr7R, %fr26
+ ldd -0x10(%r30), p224d2
+ fstd %fr27, -0x50(%r30) C mid product to -0x50..-0x49
+ addib,= -1, n, L(end2)
+ xmpyu %fr8L, %fr7L, %fr27
+LDEF(loop)
+ add p032a1, p032a2, m032
+ ldd -0x80(%r30), p000a
+ add,dc p096b1, p096b2, m096
+ fstd %fr28, -0x18(%r30) C mid product to -0x18..-0x11
+
+ add,dc p160c1, p160c2, m160
+ ldd -0x68(%r30), p064a
+ add,dc p224d1, p224d2, m224
+ fstd %fr29, -0x10(%r30) C mid product to -0x10..-0x09
+
+ add,dc %r0, %r0, m288
+ ldd -0x40(%r30), p064b
+ ldo 32(up), up
+ fstd %fr30, -0x80(%r30) C low product to -0x80..-0x79
+
+ depd,z m032, 31, 32, ma000
+ ldd -0x28(%r30), p128b
+ extrd,u m032, 31, 32, ma064
+ fstd %fr31, -0x68(%r30) C high product to -0x68..-0x61
+
+ depd m096, 31, 32, ma064
+ ldd -0x60(%r30), p128c
+ extrd,u m096, 31, 32, ma128
+ fstd %fr22, -0x40(%r30) C low product to -0x40..-0x39
+
+ depd m160, 31, 32, ma128
+ ldd -0x48(%r30), p192c
+ extrd,u m160, 31, 32, ma192
+ fstd %fr23, -0x28(%r30) C high product to -0x28..-0x21
+
+ depd m224, 31, 32, ma192
+ ldd -0x20(%r30), p192d
+ extrd,u m224, 31, 32, ma256
+ fstd %fr24, -0x60(%r30) C low product to -0x60..-0x59
+
+ depd m288, 31, 32, ma256
+ ldd -0x88(%r30), p256d
+ add climb, p000a, s000
+ fstd %fr25, -0x48(%r30) C high product to -0x48..-0x41
+
+ add,dc p064a, p064b, s064
+ ldd 0(rp), r000
+ add,dc p128b, p128c, s128
+ fstd %fr26, -0x20(%r30) C low product to -0x20..-0x19
+
+ add,dc p192c, p192d, s192
+ ldd 8(rp), r064
+ add,dc p256d, %r0, climb
+ fstd %fr27, -0x88(%r30) C high product to -0x88..-0x81
+
+ ldd 16(rp), r128
+ add ma000, s000, s000 C accum mid 0
+ ldd 24(rp), r192
+ add,dc ma064, s064, s064 C accum mid 1
+
+ add,dc ma128, s128, s128 C accum mid 2
+ fldd 0(up), %fr4
+ add,dc ma192, s192, s192 C accum mid 3
+ fldd 8(up), %fr5
+
+ add,dc ma256, climb, climb
+ fldd 16(up), %fr6
+ add r000, s000, s000 C accum rlimb 0
+ fldd 24(up), %fr7
+
+ add,dc r064, s064, s064 C accum rlimb 1
+ add,dc r128, s128, s128 C accum rlimb 2
+ std s000, 0(rp)
+
+ add,dc r192, s192, s192 C accum rlimb 3
+ add,dc %r0, climb, climb
+ std s064, 8(rp)
+
+ xmpyu %fr8R, %fr4L, %fr22
+ ldd -0x78(%r30), p032a1
+ xmpyu %fr8L, %fr4R, %fr23
+ std s128, 16(rp)
+
+ xmpyu %fr8R, %fr5L, %fr24
+ ldd -0x70(%r30), p032a2
+ xmpyu %fr8L, %fr5R, %fr25
+ std s192, 24(rp)
+
+ xmpyu %fr8R, %fr6L, %fr26
+ ldd -0x38(%r30), p096b1
+ xmpyu %fr8L, %fr6R, %fr27
+ fstd %fr22, -0x78(%r30) C mid product to -0x78..-0x71
+
+ xmpyu %fr8R, %fr7L, %fr28
+ ldd -0x30(%r30), p096b2
+ xmpyu %fr8L, %fr7R, %fr29
+ fstd %fr23, -0x70(%r30) C mid product to -0x70..-0x69
+
+ xmpyu %fr8R, %fr4R, %fr30
+ ldd -0x58(%r30), p160c1
+ xmpyu %fr8L, %fr4L, %fr31
+ fstd %fr24, -0x38(%r30) C mid product to -0x38..-0x31
+
+ xmpyu %fr8R, %fr5R, %fr22
+ ldd -0x50(%r30), p160c2
+ xmpyu %fr8L, %fr5L, %fr23
+ fstd %fr25, -0x30(%r30) C mid product to -0x30..-0x29
+
+ xmpyu %fr8R, %fr6R, %fr24
+ ldd -0x18(%r30), p224d1
+ xmpyu %fr8L, %fr6L, %fr25
+ fstd %fr26, -0x58(%r30) C mid product to -0x58..-0x51
+
+ xmpyu %fr8R, %fr7R, %fr26
+ ldd -0x10(%r30), p224d2
+ fstd %fr27, -0x50(%r30) C mid product to -0x50..-0x49
+ xmpyu %fr8L, %fr7L, %fr27
+
+ addib,<> -1, n, L(loop)
+ ldo 32(rp), rp
+
+LDEF(end2)
+ add p032a1, p032a2, m032
+ ldd -0x80(%r30), p000a
+ add,dc p096b1, p096b2, m096
+ fstd %fr28, -0x18(%r30) C mid product to -0x18..-0x11
+ add,dc p160c1, p160c2, m160
+ ldd -0x68(%r30), p064a
+ add,dc p224d1, p224d2, m224
+ fstd %fr29, -0x10(%r30) C mid product to -0x10..-0x09
+ add,dc %r0, %r0, m288
+ ldd -0x40(%r30), p064b
+ fstd %fr30, -0x80(%r30) C low product to -0x80..-0x79
+ depd,z m032, 31, 32, ma000
+ ldd -0x28(%r30), p128b
+ extrd,u m032, 31, 32, ma064
+ fstd %fr31, -0x68(%r30) C high product to -0x68..-0x61
+ depd m096, 31, 32, ma064
+ ldd -0x60(%r30), p128c
+ extrd,u m096, 31, 32, ma128
+ fstd %fr22, -0x40(%r30) C low product to -0x40..-0x39
+ depd m160, 31, 32, ma128
+ ldd -0x48(%r30), p192c
+ extrd,u m160, 31, 32, ma192
+ fstd %fr23, -0x28(%r30) C high product to -0x28..-0x21
+ depd m224, 31, 32, ma192
+ ldd -0x20(%r30), p192d
+ extrd,u m224, 31, 32, ma256
+ fstd %fr24, -0x60(%r30) C low product to -0x60..-0x59
+ depd m288, 31, 32, ma256
+ ldd -0x88(%r30), p256d
+ add climb, p000a, s000
+ fstd %fr25, -0x48(%r30) C high product to -0x48..-0x41
+ add,dc p064a, p064b, s064
+ ldd 0(rp), r000
+ add,dc p128b, p128c, s128
+ fstd %fr26, -0x20(%r30) C low product to -0x20..-0x19
+ add,dc p192c, p192d, s192
+ ldd 8(rp), r064
+ add,dc p256d, %r0, climb
+ fstd %fr27, -0x88(%r30) C high product to -0x88..-0x81
+ ldd 16(rp), r128
+ add ma000, s000, s000 C accum mid 0
+ ldd 24(rp), r192
+ add,dc ma064, s064, s064 C accum mid 1
+ add,dc ma128, s128, s128 C accum mid 2
+ add,dc ma192, s192, s192 C accum mid 3
+ add,dc ma256, climb, climb
+ add r000, s000, s000 C accum rlimb 0
+ add,dc r064, s064, s064 C accum rlimb 1
+ add,dc r128, s128, s128 C accum rlimb 2
+ std s000, 0(rp)
+ add,dc r192, s192, s192 C accum rlimb 3
+ add,dc %r0, climb, climb
+ std s064, 8(rp)
+ ldd -0x78(%r30), p032a1
+ std s128, 16(rp)
+ ldd -0x70(%r30), p032a2
+ std s192, 24(rp)
+ ldd -0x38(%r30), p096b1
+ ldd -0x30(%r30), p096b2
+ ldd -0x58(%r30), p160c1
+ ldd -0x50(%r30), p160c2
+ ldd -0x18(%r30), p224d1
+ ldd -0x10(%r30), p224d2
+ ldo 32(rp), rp
+
+LDEF(end1)
+ add p032a1, p032a2, m032
+ ldd -0x80(%r30), p000a
+ add,dc p096b1, p096b2, m096
+ add,dc p160c1, p160c2, m160
+ ldd -0x68(%r30), p064a
+ add,dc p224d1, p224d2, m224
+ add,dc %r0, %r0, m288
+ ldd -0x40(%r30), p064b
+ depd,z m032, 31, 32, ma000
+ ldd -0x28(%r30), p128b
+ extrd,u m032, 31, 32, ma064
+ depd m096, 31, 32, ma064
+ ldd -0x60(%r30), p128c
+ extrd,u m096, 31, 32, ma128
+ depd m160, 31, 32, ma128
+ ldd -0x48(%r30), p192c
+ extrd,u m160, 31, 32, ma192
+ depd m224, 31, 32, ma192
+ ldd -0x20(%r30), p192d
+ extrd,u m224, 31, 32, ma256
+ depd m288, 31, 32, ma256
+ ldd -0x88(%r30), p256d
+ add climb, p000a, s000
+ add,dc p064a, p064b, s064
+ ldd 0(rp), r000
+ add,dc p128b, p128c, s128
+ add,dc p192c, p192d, s192
+ ldd 8(rp), r064
+ add,dc p256d, %r0, climb
+ ldd 16(rp), r128
+ add ma000, s000, s000 C accum mid 0
+ ldd 24(rp), r192
+ add,dc ma064, s064, s064 C accum mid 1
+ add,dc ma128, s128, s128 C accum mid 2
+ add,dc ma192, s192, s192 C accum mid 3
+ add,dc ma256, climb, climb
+ add r000, s000, s000 C accum rlimb 0
+ add,dc r064, s064, s064 C accum rlimb 1
+ add,dc r128, s128, s128 C accum rlimb 2
+ std s000, 0(rp)
+ add,dc r192, s192, s192 C accum rlimb 3
+ add,dc %r0, climb, climb
+ std s064, 8(rp)
+ std s128, 16(rp)
+ std s192, 24(rp)
+
+ ldd -0xb0(%r30), %r13
+ ldd -0xb8(%r30), %r12
+ ldd -0xc0(%r30), %r11
+ ldd -0xc8(%r30), %r10
+ ldd -0xd0(%r30), %r9
+ ldd -0xd8(%r30), %r8
+ ldd -0xe0(%r30), %r7
+ ldd -0xe8(%r30), %r6
+LDEF(done)
+ifdef(`HAVE_ABI_2_0w',
+` copy climb, %r28
+',` extrd,u climb, 63, 32, %r29
+ extrd,u climb, 31, 32, %r28
+')
+ ldd -0xf0(%r30), %r5
+ ldd -0xf8(%r30), %r4
+ bve (%r2)
+ ldd,mb -0x100(%r30), %r3
+EPILOGUE(mpn_addmul_1)
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/pa64/aors_n.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/pa64/aors_n.asm
new file mode 100644
index 00000000000..ab4536fefba
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/pa64/aors_n.asm
@@ -0,0 +1,130 @@
+dnl HP-PA 2.0 mpn_add_n, mpn_sub_n
+
+dnl Copyright 1997, 2000, 2002, 2003, 2009, 2010 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/.
+
+
+dnl This runs at 2 cycles/limb on PA8000 and 1.6875 cycles/limb on PA8500. It
+dnl should be possible to reach the cache bandwidth 1.5 cycles/limb at least
+dnl with PA8500. The problem now is stalling of the first ADD,DC after LDO,
+dnl where the processor gets confused about where carry comes from.
+
+include(`../config.m4')
+
+dnl INPUT PARAMETERS
+define(`rp',`%r26')
+define(`up',`%r25')
+define(`vp',`%r24')
+define(`n',`%r23')
+
+ifdef(`OPERATION_add_n', `
+ define(ADCSBC, `add,dc')
+ define(INITCY, `addi -1,%r22,%r0')
+ define(func, mpn_add_n)
+ define(func_nc, mpn_add_nc)')
+ifdef(`OPERATION_sub_n', `
+ define(ADCSBC, `sub,db')
+ define(INITCY, `subi 0,%r22,%r0')
+ define(func, mpn_sub_n)
+ define(func_nc, mpn_sub_nc)')
+
+MULFUNC_PROLOGUE(mpn_add_n mpn_add_nc mpn_sub_n mpn_sub_nc)
+
+ifdef(`HAVE_ABI_2_0w',
+` .level 2.0w
+',` .level 2.0
+')
+PROLOGUE(func_nc)
+ifdef(`HAVE_ABI_2_0w',
+` b L(com)
+ nop
+',` b L(com)
+ ldw -52(%r30), %r22
+')
+EPILOGUE()
+PROLOGUE(func)
+ ldi 0, %r22
+LDEF(com)
+ sub %r0, n, %r21
+ depw,z %r21, 30, 3, %r28 C r28 = 2 * (-n & 7)
+ depw,z %r21, 28, 3, %r21 C r21 = 8 * (-n & 7)
+ sub up, %r21, up C offset up
+ sub vp, %r21, vp C offset vp
+ sub rp, %r21, rp C offset rp
+ blr %r28, %r0 C branch into loop
+ INITCY
+
+LDEF(loop)
+ ldd 0(up), %r20
+ ldd 0(vp), %r31
+ ADCSBC %r20, %r31, %r20
+ std %r20, 0(rp)
+LDEF(7) ldd 8(up), %r21
+ ldd 8(vp), %r19
+ ADCSBC %r21, %r19, %r21
+ std %r21, 8(rp)
+LDEF(6) ldd 16(up), %r20
+ ldd 16(vp), %r31
+ ADCSBC %r20, %r31, %r20
+ std %r20, 16(rp)
+LDEF(5) ldd 24(up), %r21
+ ldd 24(vp), %r19
+ ADCSBC %r21, %r19, %r21
+ std %r21, 24(rp)
+LDEF(4) ldd 32(up), %r20
+ ldd 32(vp), %r31
+ ADCSBC %r20, %r31, %r20
+ std %r20, 32(rp)
+LDEF(3) ldd 40(up), %r21
+ ldd 40(vp), %r19
+ ADCSBC %r21, %r19, %r21
+ std %r21, 40(rp)
+LDEF(2) ldd 48(up), %r20
+ ldd 48(vp), %r31
+ ADCSBC %r20, %r31, %r20
+ std %r20, 48(rp)
+LDEF(1) ldd 56(up), %r21
+ ldd 56(vp), %r19
+ ADCSBC %r21, %r19, %r21
+ ldo 64(up), up
+ std %r21, 56(rp)
+ ldo 64(vp), vp
+ addib,> -8, n, L(loop)
+ ldo 64(rp), rp
+
+ add,dc %r0, %r0, %r29
+ifdef(`OPERATION_sub_n',`
+ subi 1, %r29, %r29
+')
+ bve (%r2)
+ifdef(`HAVE_ABI_2_0w',
+` copy %r29, %r28
+',` ldi 0, %r28
+')
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/pa64/aorslsh1_n.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/pa64/aorslsh1_n.asm
new file mode 100644
index 00000000000..2a55ddea30f
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/pa64/aorslsh1_n.asm
@@ -0,0 +1,228 @@
+dnl PA64 mpn_addlsh1_n/mpn_sublsh1_n -- rp[] = up[] +- (vp[] << 1).
+
+dnl Copyright 2003 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 8000,8200: 2
+C 8500,8600,8700: 1.75
+
+C TODO
+C * Write special feed-in code for each (n mod 8). (See the ia64 code.)
+C * Try to make this run at closer to 1.5 c/l.
+C * Set up register aliases (define(`u0',`%r19')).
+C * Explicitly align loop.
+
+dnl INPUT PARAMETERS
+define(`rp',`%r26')
+define(`up',`%r25')
+define(`vp',`%r24')
+define(`n',`%r23')
+
+ifdef(`OPERATION_addlsh1_n',`
+ define(ADCSBC, `add,dc')
+ define(INITC, `ldi 0,')
+ define(func, mpn_addlsh1_n)
+')
+ifdef(`OPERATION_sublsh1_n',`
+ define(ADCSBC, `sub,db')
+ define(INITC, `ldi 1,')
+ define(func, mpn_sublsh1_n)
+')
+
+MULFUNC_PROLOGUE(mpn_addlsh1_n mpn_sublsh1_n)
+
+ifdef(`HAVE_ABI_2_0w',`
+ define(LEVEL, `.level 2.0w')
+ define(RETREG, `%r28')
+ define(CLRRET1, `dnl')
+')
+ifdef(`HAVE_ABI_2_0n',`
+ define(LEVEL, `.level 2.0')
+ define(RETREG, `%r29')
+ define(CLRRET1, `ldi 0, %r28')
+')
+
+ LEVEL
+PROLOGUE(func)
+ std,ma %r3, 0x100(%r30) C save reg
+
+ INITC %r1 C init saved cy
+
+C Primitive code for the first (n mod 8) limbs:
+ extrd,u n, 63, 3, %r22 C count for loop0
+ comib,= 0, %r22, L(unrolled) C skip loop0?
+ copy %r0, %r28
+LDEF(loop0)
+ ldd 0(vp), %r21
+ ldo 8(vp), vp
+ ldd 0(up), %r19
+ ldo 8(up), up
+ shrpd %r21, %r28, 63, %r31
+ addi -1, %r1, %r0 C restore cy
+ ADCSBC %r19, %r31, %r29
+ std %r29, 0(rp)
+ add,dc %r0, %r0, %r1 C save cy
+ copy %r21, %r28
+ addib,> -1, %r22, L(loop0)
+ ldo 8(rp), rp
+
+ addib,>= -8, n, L(unrolled)
+ addi -1, %r1, %r0 C restore cy
+
+ shrpd %r0, %r28, 63, %r28
+ ADCSBC %r0, %r28, RETREG
+ifdef(`OPERATION_sublsh1_n',
+` sub %r0, RETREG, RETREG')
+ CLRRET1
+
+ bve (%r2)
+ ldd,mb -0x100(%r30), %r3
+
+
+LDEF(unrolled)
+ std %r4, -0xf8(%r30) C save reg
+ ldd 0(vp), %r4
+ std %r5, -0xf0(%r30) C save reg
+ ldd 8(vp), %r5
+ std %r6, -0xe8(%r30) C save reg
+ ldd 16(vp), %r6
+ std %r7, -0xe0(%r30) C save reg
+
+ ldd 24(vp), %r7
+ shrpd %r4, %r28, 63, %r31
+ std %r8, -0xd8(%r30) C save reg
+ ldd 32(vp), %r8
+ shrpd %r5, %r4, 63, %r4
+ std %r9, -0xd0(%r30) C save reg
+ ldd 40(vp), %r9
+ shrpd %r6, %r5, 63, %r5
+ ldd 48(vp), %r3
+ shrpd %r7, %r6, 63, %r6
+ ldd 56(vp), %r28
+ shrpd %r8, %r7, 63, %r7
+ ldd 0(up), %r19
+ shrpd %r9, %r8, 63, %r8
+ ldd 8(up), %r20
+ shrpd %r3, %r9, 63, %r9
+ ldd 16(up), %r21
+ shrpd %r28, %r3, 63, %r3
+ ldd 24(up), %r22
+
+ nop C alignment FIXME
+ addib,<= -8, n, L(end)
+ addi -1, %r1, %r0 C restore cy
+LDEF(loop)
+ ADCSBC %r19, %r31, %r29
+ ldd 32(up), %r19
+ std %r29, 0(rp)
+ ADCSBC %r20, %r4, %r29
+ ldd 40(up), %r20
+ std %r29, 8(rp)
+ ADCSBC %r21, %r5, %r29
+ ldd 48(up), %r21
+ std %r29, 16(rp)
+ ADCSBC %r22, %r6, %r29
+ ldd 56(up), %r22
+ std %r29, 24(rp)
+ ADCSBC %r19, %r7, %r29
+ ldd 64(vp), %r4
+ std %r29, 32(rp)
+ ADCSBC %r20, %r8, %r29
+ ldd 72(vp), %r5
+ std %r29, 40(rp)
+ ADCSBC %r21, %r9, %r29
+ ldd 80(vp), %r6
+ std %r29, 48(rp)
+ ADCSBC %r22, %r3, %r29
+ std %r29, 56(rp)
+
+ add,dc %r0, %r0, %r1 C save cy
+
+ ldd 88(vp), %r7
+ shrpd %r4, %r28, 63, %r31
+ ldd 96(vp), %r8
+ shrpd %r5, %r4, 63, %r4
+ ldd 104(vp), %r9
+ shrpd %r6, %r5, 63, %r5
+ ldd 112(vp), %r3
+ shrpd %r7, %r6, 63, %r6
+ ldd 120(vp), %r28
+ shrpd %r8, %r7, 63, %r7
+ ldd 64(up), %r19
+ shrpd %r9, %r8, 63, %r8
+ ldd 72(up), %r20
+ shrpd %r3, %r9, 63, %r9
+ ldd 80(up), %r21
+ shrpd %r28, %r3, 63, %r3
+ ldd 88(up), %r22
+
+ ldo 64(vp), vp
+ ldo 64(rp), rp
+ ldo 64(up), up
+ addib,> -8, n, L(loop)
+ addi -1, %r1, %r0 C restore cy
+LDEF(end)
+ ADCSBC %r19, %r31, %r29
+ ldd 32(up), %r19
+ std %r29, 0(rp)
+ ADCSBC %r20, %r4, %r29
+ ldd 40(up), %r20
+ std %r29, 8(rp)
+ ADCSBC %r21, %r5, %r29
+ ldd 48(up), %r21
+ std %r29, 16(rp)
+ ADCSBC %r22, %r6, %r29
+ ldd 56(up), %r22
+ std %r29, 24(rp)
+ ADCSBC %r19, %r7, %r29
+ ldd -0xf8(%r30), %r4 C restore reg
+ std %r29, 32(rp)
+ ADCSBC %r20, %r8, %r29
+ ldd -0xf0(%r30), %r5 C restore reg
+ std %r29, 40(rp)
+ ADCSBC %r21, %r9, %r29
+ ldd -0xe8(%r30), %r6 C restore reg
+ std %r29, 48(rp)
+ ADCSBC %r22, %r3, %r29
+ ldd -0xe0(%r30), %r7 C restore reg
+ std %r29, 56(rp)
+
+ shrpd %r0, %r28, 63, %r28
+ ldd -0xd8(%r30), %r8 C restore reg
+ ADCSBC %r0, %r28, RETREG
+ifdef(`OPERATION_sublsh1_n',
+` sub %r0, RETREG, RETREG')
+ CLRRET1
+
+ ldd -0xd0(%r30), %r9 C restore reg
+ bve (%r2)
+ ldd,mb -0x100(%r30), %r3 C restore reg
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/pa64/gmp-mparam.h b/Build/source/libs/gmp/gmp-6.0.0/mpn/pa64/gmp-mparam.h
new file mode 100644
index 00000000000..c2719c3c897
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/pa64/gmp-mparam.h
@@ -0,0 +1,247 @@
+/* gmp-mparam.h -- Compiler/machine parameter header file.
+
+Copyright 1991, 1993, 1994, 1999-2004, 2008-2010 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
+
+/* 440MHz PA8200 */
+
+#define DIVREM_1_NORM_THRESHOLD 0 /* always */
+#define DIVREM_1_UNNORM_THRESHOLD 0 /* always */
+#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 4
+#define MOD_1U_TO_MOD_1_1_THRESHOLD 10
+#define MOD_1_1_TO_MOD_1_2_THRESHOLD 0 /* never mpn_mod_1_1p */
+#define MOD_1_2_TO_MOD_1_4_THRESHOLD 14
+#define PREINV_MOD_1_TO_MOD_1_THRESHOLD 11
+#define USE_PREINV_DIVREM_1 1
+#define DIV_QR_2_PI2_THRESHOLD 21
+#define DIVEXACT_1_THRESHOLD 0 /* always */
+#define BMOD_1_TO_MOD_1_THRESHOLD MP_SIZE_T_MAX /* never */
+
+#define MUL_TOOM22_THRESHOLD 31
+#define MUL_TOOM33_THRESHOLD 114
+#define MUL_TOOM44_THRESHOLD 179
+#define MUL_TOOM6H_THRESHOLD 222
+#define MUL_TOOM8H_THRESHOLD 296
+
+#define MUL_TOOM32_TO_TOOM43_THRESHOLD 130
+#define MUL_TOOM32_TO_TOOM53_THRESHOLD 229
+#define MUL_TOOM42_TO_TOOM53_THRESHOLD 129
+#define MUL_TOOM42_TO_TOOM63_THRESHOLD 54
+
+#define SQR_BASECASE_THRESHOLD 5
+#define SQR_TOOM2_THRESHOLD 58
+#define SQR_TOOM3_THRESHOLD 153
+#define SQR_TOOM4_THRESHOLD 278
+#define SQR_TOOM6_THRESHOLD 0 /* always */
+#define SQR_TOOM8_THRESHOLD 0 /* always */
+
+#define MULMID_TOOM42_THRESHOLD 56
+
+#define MULMOD_BNM1_THRESHOLD 15
+#define SQRMOD_BNM1_THRESHOLD 19
+
+#define POWM_SEC_TABLE 2,23,228,1084
+
+#define MUL_FFT_MODF_THRESHOLD 336 /* k = 5 */
+#define MUL_FFT_TABLE3 \
+ { { 336, 5}, { 11, 4}, { 23, 5}, { 21, 6}, \
+ { 11, 5}, { 23, 6}, { 21, 7}, { 11, 6}, \
+ { 23, 7}, { 15, 6}, { 31, 7}, { 21, 8}, \
+ { 11, 7}, { 24, 8}, { 13, 7}, { 27, 8}, \
+ { 15, 7}, { 31, 8}, { 19, 7}, { 39, 8}, \
+ { 27, 9}, { 15, 8}, { 33, 9}, { 19, 8}, \
+ { 39, 9}, { 23, 8}, { 47, 9}, { 27,10}, \
+ { 15, 9}, { 39,10}, { 23, 9}, { 51,10}, \
+ { 31, 9}, { 67,10}, { 39, 9}, { 79,10}, \
+ { 47, 9}, { 95,10}, { 55,11}, { 31,10}, \
+ { 63, 9}, { 127,10}, { 71, 8}, { 287,10}, \
+ { 79,11}, { 47,10}, { 95, 9}, { 191, 8}, \
+ { 383, 7}, { 767,10}, { 103, 9}, { 207, 8}, \
+ { 415, 7}, { 831,12}, { 31,11}, { 63,10}, \
+ { 127, 9}, { 255, 8}, { 543, 7}, { 1087, 6}, \
+ { 2175,10}, { 143, 9}, { 287, 8}, { 575,11}, \
+ { 79, 9}, { 319, 8}, { 639, 7}, { 1279, 9}, \
+ { 335, 8}, { 671,10}, { 175, 9}, { 351, 8}, \
+ { 703,11}, { 95,10}, { 191, 9}, { 383, 8}, \
+ { 767,10}, { 207, 9}, { 415, 8}, { 831, 7}, \
+ { 1663,11}, { 111,10}, { 223, 9}, { 447, 8}, \
+ { 895,12}, { 63,11}, { 127,10}, { 255, 9}, \
+ { 543, 8}, { 1087, 7}, { 2175,10}, { 287, 9}, \
+ { 575, 8}, { 1215, 7}, { 2431,10}, { 319, 9}, \
+ { 639, 8}, { 1279,10}, { 335, 9}, { 671, 8}, \
+ { 1343, 9}, { 703, 8}, { 1407,12}, { 95,11}, \
+ { 191,10}, { 383,11}, { 207, 9}, { 831, 8}, \
+ { 1663,11}, { 223,10}, { 447, 9}, { 959,13}, \
+ { 63,12}, { 127,11}, { 255, 8}, { 2047,11}, \
+ { 271,10}, { 543, 9}, { 1087, 8}, { 2175,11}, \
+ { 287,10}, { 575, 9}, { 1215, 8}, { 2431,11}, \
+ { 319,10}, { 671, 9}, { 1343, 8}, { 2687,11}, \
+ { 351,10}, { 703, 9}, { 1471, 8}, { 2943,12}, \
+ { 191,11}, { 383, 8}, { 3071,11}, { 415,10}, \
+ { 831, 9}, { 1663,11}, { 479,10}, { 959, 9}, \
+ { 1919, 8}, { 3839,13}, { 127,12}, { 255,11}, \
+ { 543,10}, { 1087, 9}, { 2175,12}, { 287,11}, \
+ { 607,10}, { 1215, 9}, { 2431, 8}, { 4863,12}, \
+ { 319,11}, { 671,10}, { 1343,13}, { 191, 9}, \
+ { 3071,12}, { 415,11}, { 831,10}, { 1663, 8}, \
+ { 6655, 9}, { 3455,12}, { 447, 9}, { 3583,13}, \
+ { 255,12}, { 511,11}, { 1023,10}, { 2175,13}, \
+ { 319,11}, { 1279,12}, { 671,10}, { 2815,12}, \
+ { 735,10}, { 2943, 9}, { 5887,13}, { 383,12}, \
+ { 767,11}, { 1535,10}, { 3071,13}, { 447,10}, \
+ { 3583,12}, { 959,13}, { 511,12}, { 1087,13}, \
+ { 639,12}, { 1343,13}, { 767,11}, { 3071,13}, \
+ { 831,12}, { 1663,11}, { 3455,10}, { 6911,13}, \
+ { 895,14}, { 511,13}, { 1023,12}, { 2047,13}, \
+ { 1087,12}, { 2303,13}, { 1215,12}, { 2431,14}, \
+ { 639,13}, { 1279,12}, { 2559,13}, { 1343,12}, \
+ { 2687,11}, { 5375,13}, { 1407,12}, { 2815,11}, \
+ { 5631,12}, { 2943,13}, { 1535,12}, { 3199,13}, \
+ { 1663,12}, { 3327,13}, { 1727,14}, { 895,13}, \
+ { 1791,12}, { 3583,13}, { 1919,15}, { 511,14}, \
+ { 1023,13}, { 2047,12}, { 4095,14}, { 1151,13}, \
+ { 2431,14}, { 1279,13}, { 2687,14}, { 1407,13}, \
+ { 2815,12}, { 5631,15}, { 767,14}, { 1535,13}, \
+ { 3071,14}, { 1663,13}, { 3327,14}, { 1791,13}, \
+ { 3583,14}, { 1919,15}, { 1023,14}, { 2303,13}, \
+ { 4607,14}, { 2431,13}, { 4863,15}, { 32768,16}, \
+ { 65536,17}, { 131072,18}, { 262144,19}, { 524288,20}, \
+ {1048576,21}, {2097152,22}, {4194304,23}, {8388608,24} }
+#define MUL_FFT_TABLE3_SIZE 252
+#define MUL_FFT_THRESHOLD 2368
+
+#define SQR_FFT_MODF_THRESHOLD 284 /* k = 5 */
+#define SQR_FFT_TABLE3 \
+ { { 284, 5}, { 9, 4}, { 21, 5}, { 21, 6}, \
+ { 11, 5}, { 23, 6}, { 25, 7}, { 25, 8}, \
+ { 13, 7}, { 27, 8}, { 15, 7}, { 31, 8}, \
+ { 27, 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}, { 63, 8}, { 255, 7}, { 511,10}, \
+ { 71, 8}, { 287, 7}, { 575,10}, { 79,11}, \
+ { 47,10}, { 95, 9}, { 191, 8}, { 383, 7}, \
+ { 767,10}, { 103, 9}, { 207, 8}, { 415,12}, \
+ { 31,11}, { 63,10}, { 127, 9}, { 255, 8}, \
+ { 543, 7}, { 1087, 8}, { 575, 7}, { 1151,11}, \
+ { 79, 8}, { 639, 7}, { 1279, 9}, { 335, 8}, \
+ { 671, 7}, { 1343,10}, { 175, 8}, { 703, 7}, \
+ { 1407,11}, { 95,10}, { 191, 9}, { 383, 8}, \
+ { 767,10}, { 207, 9}, { 415, 8}, { 831, 7}, \
+ { 1663, 9}, { 447, 8}, { 895,12}, { 63,11}, \
+ { 127,10}, { 255, 9}, { 543, 8}, { 1087, 7}, \
+ { 2175, 9}, { 575, 8}, { 1151,10}, { 303, 9}, \
+ { 607, 8}, { 1215, 7}, { 2431,10}, { 319, 9}, \
+ { 639, 8}, { 1279, 9}, { 671, 8}, { 1343, 7}, \
+ { 2687,10}, { 351, 9}, { 703, 8}, { 1407,12}, \
+ { 95,11}, { 191,10}, { 383, 9}, { 767,11}, \
+ { 207,10}, { 415, 9}, { 831, 8}, { 1663,11}, \
+ { 223,10}, { 447, 9}, { 895,13}, { 63,11}, \
+ { 255,10}, { 543, 8}, { 2175,11}, { 287,10}, \
+ { 575, 9}, { 1151,10}, { 607, 9}, { 1215, 8}, \
+ { 2431,11}, { 319, 9}, { 1279,10}, { 671, 9}, \
+ { 1343, 8}, { 2687,11}, { 351,10}, { 703, 9}, \
+ { 1407,10}, { 735,12}, { 191,11}, { 383,10}, \
+ { 831, 9}, { 1663,12}, { 223,11}, { 447,10}, \
+ { 895,11}, { 479, 9}, { 1919, 8}, { 3839,12}, \
+ { 255,11}, { 511,10}, { 1023,11}, { 543,10}, \
+ { 1087, 9}, { 2175,12}, { 287,11}, { 575,10}, \
+ { 1151,11}, { 607,10}, { 1215, 9}, { 2431, 8}, \
+ { 4863,10}, { 1279,11}, { 671,10}, { 1343, 9}, \
+ { 2687,12}, { 351,11}, { 703,10}, { 1407,11}, \
+ { 735,13}, { 191, 9}, { 3071, 7}, { 12287,11}, \
+ { 799,12}, { 415,11}, { 831,10}, { 1663,12}, \
+ { 447, 8}, { 7167,12}, { 479, 9}, { 3839,14}, \
+ { 127,13}, { 255,12}, { 511,11}, { 1023,12}, \
+ { 543,10}, { 2175, 9}, { 4607,11}, { 1215,10}, \
+ { 2431,11}, { 1279,10}, { 2559,13}, { 383,12}, \
+ { 767,11}, { 1535,12}, { 799,10}, { 3199, 9}, \
+ { 6399,12}, { 895,13}, { 511,12}, { 1023,11}, \
+ { 2047,12}, { 1087,13}, { 575,12}, { 1151,10}, \
+ { 4607,13}, { 639,12}, { 1279,11}, { 2687,14}, \
+ { 383,13}, { 767,11}, { 3071,12}, { 1599,13}, \
+ { 895,12}, { 1791,11}, { 3583,13}, { 959,15}, \
+ { 255,12}, { 2175,13}, { 1215,14}, { 639,13}, \
+ { 1279,12}, { 2559,13}, { 1343,12}, { 2687,13}, \
+ { 1471,11}, { 5887,14}, { 767,13}, { 1535,12}, \
+ { 3071,13}, { 1599,12}, { 3199,13}, { 1663,12}, \
+ { 3327,13}, { 1727,14}, { 895,13}, { 1791,12}, \
+ { 3583,15}, { 511,14}, { 1023,13}, { 2175,14}, \
+ { 1151,12}, { 4607,13}, { 2431,14}, { 1279,13}, \
+ { 2687,14}, { 1407,13}, { 2815,15}, { 767,13}, \
+ { 3199,14}, { 1663,13}, { 3327,14}, { 1791,13}, \
+ { 3583,14}, { 1919,15}, { 1023,14}, { 2047,13}, \
+ { 4095,14}, { 2303,13}, { 4607,14}, { 2431,15}, \
+ { 32768,16}, { 65536,17}, { 131072,18}, { 262144,19}, \
+ { 524288,20}, {1048576,21}, {2097152,22}, {4194304,23}, \
+ {8388608,24} }
+#define SQR_FFT_TABLE3_SIZE 257
+#define SQR_FFT_THRESHOLD 1856
+
+#define MULLO_BASECASE_THRESHOLD 0 /* always */
+#define MULLO_DC_THRESHOLD 113
+#define MULLO_MUL_N_THRESHOLD 4658
+
+#define DC_DIV_QR_THRESHOLD 123
+#define DC_DIVAPPR_Q_THRESHOLD 372
+#define DC_BDIV_QR_THRESHOLD 142
+#define DC_BDIV_Q_THRESHOLD 312
+
+#define INV_MULMOD_BNM1_THRESHOLD 58
+#define INV_NEWTON_THRESHOLD 315
+#define INV_APPR_THRESHOLD 315
+
+#define BINV_NEWTON_THRESHOLD 360
+#define REDC_1_TO_REDC_N_THRESHOLD 101
+
+#define MU_DIV_QR_THRESHOLD 979
+#define MU_DIVAPPR_Q_THRESHOLD 1142
+#define MUPI_DIV_QR_THRESHOLD 93
+#define MU_BDIV_QR_THRESHOLD 889
+#define MU_BDIV_Q_THRESHOLD 1187
+
+#define MATRIX22_STRASSEN_THRESHOLD 9
+#define HGCD_THRESHOLD 234
+#define HGCD_APPR_THRESHOLD 300
+#define HGCD_REDUCE_THRESHOLD 1553
+#define GCD_DC_THRESHOLD 684
+#define GCDEXT_DC_THRESHOLD 525
+#define JACOBI_BASE_METHOD 2
+
+#define GET_STR_DC_THRESHOLD 21
+#define GET_STR_PRECOMPUTE_THRESHOLD 24
+#define SET_STR_DC_THRESHOLD 1951
+#define SET_STR_PRECOMPUTE_THRESHOLD 4034
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/pa64/lshift.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/pa64/lshift.asm
new file mode 100644
index 00000000000..c0fc2921c16
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/pa64/lshift.asm
@@ -0,0 +1,114 @@
+dnl HP-PA 2.0 mpn_lshift -- Left shift.
+
+dnl Copyright 1997, 2000, 2002, 2003 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 This runs at 1.5 cycles/limb on PA8000 and 1.0 cycles/limb on PA8500.
+
+include(`../config.m4')
+
+dnl INPUT PARAMETERS
+define(`rp',`%r26')
+define(`up',`%r25')
+define(`n',`%r24')
+define(`cnt',`%r23')
+
+ifdef(`HAVE_ABI_2_0w',
+` .level 2.0w
+',` .level 2.0
+')
+PROLOGUE(mpn_lshift)
+ shladd n, 3, up, up
+ shladd n, 3, rp, rp
+ subi 64, cnt, cnt
+ mtsar cnt
+ ldd -8(up), %r21
+ addib,= -1, n, L(end)
+ shrpd %r0, %r21, %sar, %r29 C compute carry out limb
+ depw,z n, 31, 3, %r28 C r28 = (size & 7)
+ sub %r0, n, %r22
+ depw,z %r22, 28, 3, %r22 C r22 = 8 * (-size & 7)
+ add up, %r22, up C offset up
+ blr %r28, %r0 C branch into jump table
+ add rp, %r22, rp C offset rp
+ b L(0)
+ nop
+ b L(1)
+ copy %r21, %r20
+ b L(2)
+ nop
+ b L(3)
+ copy %r21, %r20
+ b L(4)
+ nop
+ b L(5)
+ copy %r21, %r20
+ b L(6)
+ nop
+ b L(7)
+ copy %r21, %r20
+
+LDEF(loop)
+LDEF(0) ldd -16(up), %r20
+ shrpd %r21, %r20, %sar, %r21
+ std %r21, -8(rp)
+LDEF(7) ldd -24(up), %r21
+ shrpd %r20, %r21, %sar, %r20
+ std %r20, -16(rp)
+LDEF(6) ldd -32(up), %r20
+ shrpd %r21, %r20, %sar, %r21
+ std %r21, -24(rp)
+LDEF(5) ldd -40(up), %r21
+ shrpd %r20, %r21, %sar, %r20
+ std %r20, -32(rp)
+LDEF(4) ldd -48(up), %r20
+ shrpd %r21, %r20, %sar, %r21
+ std %r21, -40(rp)
+LDEF(3) ldd -56(up), %r21
+ shrpd %r20, %r21, %sar, %r20
+ std %r20, -48(rp)
+LDEF(2) ldd -64(up), %r20
+ shrpd %r21, %r20, %sar, %r21
+ std %r21, -56(rp)
+LDEF(1) ldd -72(up), %r21
+ ldo -64(up), up
+ shrpd %r20, %r21, %sar, %r20
+ std %r20, -64(rp)
+ addib,> -8, n, L(loop)
+ ldo -64(rp), rp
+
+LDEF(end)
+ shrpd %r21, %r0, %sar, %r21
+ std %r21, -8(rp)
+ bve (%r2)
+ifdef(`HAVE_ABI_2_0w',
+` copy %r29,%r28
+',` extrd,u %r29, 31, 32, %r28
+')
+EPILOGUE(mpn_lshift)
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/pa64/mul_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/pa64/mul_1.asm
new file mode 100644
index 00000000000..6935c23ccd7
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/pa64/mul_1.asm
@@ -0,0 +1,646 @@
+dnl HP-PA 2.0 64-bit mpn_mul_1 -- Multiply a limb vector with a limb and store
+dnl the result in a second limb vector.
+
+dnl Copyright 1998-2000, 2002, 2003 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 8000,8200: 6.5
+C 8500,8600,8700: 5.625
+
+C The feed-in and wind-down code has not yet been scheduled. Many cycles
+C could be saved there per call.
+
+C DESCRIPTION:
+C The main loop "BIG" is 4-way unrolled, mainly to allow
+C effective use of ADD,DC. Delays in moving data via the cache from the FP
+C registers to the IU registers, have demanded a deep software pipeline, and
+C a lot of stack slots for partial products in flight.
+C
+C CODE STRUCTURE:
+C save-some-registers
+C do 0, 1, 2, or 3 limbs
+C if done, restore-some-regs and return
+C save-many-regs
+C do 4, 8, ... limb
+C restore-all-regs
+
+C STACK LAYOUT:
+C HP-PA stack grows upwards. We could allocate 8 fewer slots by using the
+C slots marked FREE, as well as some slots in the caller's "frame marker".
+C
+C -00 <- r30
+C -08 FREE
+C -10 tmp
+C -18 tmp
+C -20 tmp
+C -28 tmp
+C -30 tmp
+C -38 tmp
+C -40 tmp
+C -48 tmp
+C -50 tmp
+C -58 tmp
+C -60 tmp
+C -68 tmp
+C -70 tmp
+C -78 tmp
+C -80 tmp
+C -88 tmp
+C -90 FREE
+C -98 FREE
+C -a0 FREE
+C -a8 FREE
+C -b0 r13
+C -b8 r12
+C -c0 r11
+C -c8 r10
+C -d0 r8
+C -d8 r8
+C -e0 r7
+C -e8 r6
+C -f0 r5
+C -f8 r4
+C -100 r3
+C Previous frame:
+C [unused area]
+C -38/-138 vlimb home slot. For 2.0N, the vlimb arg will arrive here.
+
+
+include(`../config.m4')
+
+C INPUT PARAMETERS:
+define(`rp',`%r26') C
+define(`up',`%r25') C
+define(`n',`%r24') C
+define(`vlimb',`%r23') C
+
+define(`climb',`%r23') C
+
+ifdef(`HAVE_ABI_2_0w',
+` .level 2.0w
+',` .level 2.0
+')
+PROLOGUE(mpn_mul_1)
+
+ifdef(`HAVE_ABI_2_0w',
+` std vlimb, -0x38(%r30) C store vlimb into "home" slot
+')
+ std,ma %r3, 0x100(%r30)
+ std %r4, -0xf8(%r30)
+ std %r5, -0xf0(%r30)
+ ldo 0(%r0), climb C clear climb
+ fldd -0x138(%r30), %fr8 C put vlimb in fp register
+
+define(`p032a1',`%r1') C
+define(`p032a2',`%r19') C
+
+define(`m032',`%r20') C
+define(`m096',`%r21') C
+
+define(`p000a',`%r22') C
+define(`p064a',`%r29') C
+
+define(`s000',`%r31') C
+
+define(`ma000',`%r4') C
+define(`ma064',`%r20') C
+
+C define(`r000',`%r3') C FIXME don't save r3 for n < 4.
+
+ extrd,u n, 63, 2, %r5
+ cmpb,= %r5, %r0, L(BIG)
+ nop
+
+ fldd 0(up), %fr4
+ ldo 8(up), up
+ xmpyu %fr8R, %fr4L, %fr22
+ xmpyu %fr8L, %fr4R, %fr23
+ fstd %fr22, -0x78(%r30) C mid product to -0x78..-0x71
+ xmpyu %fr8R, %fr4R, %fr24
+ xmpyu %fr8L, %fr4L, %fr25
+ fstd %fr23, -0x70(%r30) C mid product to -0x70..-0x69
+ fstd %fr24, -0x80(%r30) C low product to -0x80..-0x79
+ addib,<> -1, %r5, L(two_or_more)
+ fstd %fr25, -0x68(%r30) C high product to -0x68..-0x61
+LDEF(one)
+ ldd -0x78(%r30), p032a1
+ ldd -0x70(%r30), p032a2
+ ldd -0x80(%r30), p000a
+ b L(0_one_out)
+ ldd -0x68(%r30), p064a
+
+LDEF(two_or_more)
+ fldd 0(up), %fr4
+ ldo 8(up), up
+ xmpyu %fr8R, %fr4L, %fr22
+ xmpyu %fr8L, %fr4R, %fr23
+ ldd -0x78(%r30), p032a1
+ fstd %fr22, -0x78(%r30) C mid product to -0x78..-0x71
+ xmpyu %fr8R, %fr4R, %fr24
+ xmpyu %fr8L, %fr4L, %fr25
+ ldd -0x70(%r30), p032a2
+ fstd %fr23, -0x70(%r30) C mid product to -0x70..-0x69
+ ldd -0x80(%r30), p000a
+ fstd %fr24, -0x80(%r30) C low product to -0x80..-0x79
+ ldd -0x68(%r30), p064a
+ addib,<> -1, %r5, L(three_or_more)
+ fstd %fr25, -0x68(%r30) C high product to -0x68..-0x61
+LDEF(two)
+ add p032a1, p032a2, m032
+ add,dc %r0, %r0, m096
+ depd,z m032, 31, 32, ma000
+ extrd,u m032, 31, 32, ma064
+ b L(0_two_out)
+ depd m096, 31, 32, ma064
+
+LDEF(three_or_more)
+ fldd 0(up), %fr4
+ add p032a1, p032a2, m032
+ add,dc %r0, %r0, m096
+ depd,z m032, 31, 32, ma000
+ extrd,u m032, 31, 32, ma064
+C addib,= -1, %r5, L(0_out)
+ depd m096, 31, 32, ma064
+LDEF(loop0)
+C xmpyu %fr8R, %fr4L, %fr22
+C xmpyu %fr8L, %fr4R, %fr23
+C ldd -0x78(%r30), p032a1
+C fstd %fr22, -0x78(%r30) C mid product to -0x78..-0x71
+C
+C xmpyu %fr8R, %fr4R, %fr24
+C xmpyu %fr8L, %fr4L, %fr25
+C ldd -0x70(%r30), p032a2
+C fstd %fr23, -0x70(%r30) C mid product to -0x70..-0x69
+C
+C ldo 8(rp), rp
+C add climb, p000a, s000
+C ldd -0x80(%r30), p000a
+C fstd %fr24, -0x80(%r30) C low product to -0x80..-0x79
+C
+C add,dc p064a, %r0, climb
+C ldo 8(up), up
+C ldd -0x68(%r30), p064a
+C fstd %fr25, -0x68(%r30) C high product to -0x68..-0x61
+C
+C add ma000, s000, s000
+C add,dc ma064, climb, climb
+C fldd 0(up), %fr4
+C
+C std s000, -8(rp)
+C
+C add p032a1, p032a2, m032
+C add,dc %r0, %r0, m096
+C
+C depd,z m032, 31, 32, ma000
+C extrd,u m032, 31, 32, ma064
+C addib,<> -1, %r5, L(loop0)
+C depd m096, 31, 32, ma064
+LDEF(0_out)
+ ldo 8(up), up
+ xmpyu %fr8R, %fr4L, %fr22
+ xmpyu %fr8L, %fr4R, %fr23
+ ldd -0x78(%r30), p032a1
+ fstd %fr22, -0x78(%r30) C mid product to -0x78..-0x71
+ xmpyu %fr8R, %fr4R, %fr24
+ xmpyu %fr8L, %fr4L, %fr25
+ ldd -0x70(%r30), p032a2
+ fstd %fr23, -0x70(%r30) C mid product to -0x70..-0x69
+ ldo 8(rp), rp
+ add climb, p000a, s000
+ ldd -0x80(%r30), p000a
+ fstd %fr24, -0x80(%r30) C low product to -0x80..-0x79
+ add,dc p064a, %r0, climb
+ ldd -0x68(%r30), p064a
+ fstd %fr25, -0x68(%r30) C high product to -0x68..-0x61
+ add ma000, s000, s000
+ add,dc ma064, climb, climb
+ std s000, -8(rp)
+ add p032a1, p032a2, m032
+ add,dc %r0, %r0, m096
+ depd,z m032, 31, 32, ma000
+ extrd,u m032, 31, 32, ma064
+ depd m096, 31, 32, ma064
+LDEF(0_two_out)
+ ldd -0x78(%r30), p032a1
+ ldd -0x70(%r30), p032a2
+ ldo 8(rp), rp
+ add climb, p000a, s000
+ ldd -0x80(%r30), p000a
+ add,dc p064a, %r0, climb
+ ldd -0x68(%r30), p064a
+ add ma000, s000, s000
+ add,dc ma064, climb, climb
+ std s000, -8(rp)
+LDEF(0_one_out)
+ add p032a1, p032a2, m032
+ add,dc %r0, %r0, m096
+ depd,z m032, 31, 32, ma000
+ extrd,u m032, 31, 32, ma064
+ depd m096, 31, 32, ma064
+
+ add climb, p000a, s000
+ add,dc p064a, %r0, climb
+ add ma000, s000, s000
+ add,dc ma064, climb, climb
+ std s000, 0(rp)
+
+ cmpib,>= 4, n, L(done)
+ ldo 8(rp), rp
+
+C 4-way unrolled code.
+
+LDEF(BIG)
+
+define(`p032a1',`%r1') C
+define(`p032a2',`%r19') C
+define(`p096b1',`%r20') C
+define(`p096b2',`%r21') C
+define(`p160c1',`%r22') C
+define(`p160c2',`%r29') C
+define(`p224d1',`%r31') C
+define(`p224d2',`%r3') C
+ C
+define(`m032',`%r4') C
+define(`m096',`%r5') C
+define(`m160',`%r6') C
+define(`m224',`%r7') C
+define(`m288',`%r8') C
+ C
+define(`p000a',`%r1') C
+define(`p064a',`%r19') C
+define(`p064b',`%r20') C
+define(`p128b',`%r21') C
+define(`p128c',`%r22') C
+define(`p192c',`%r29') C
+define(`p192d',`%r31') C
+define(`p256d',`%r3') C
+ C
+define(`s000',`%r10') C
+define(`s064',`%r11') C
+define(`s128',`%r12') C
+define(`s192',`%r13') C
+ C
+define(`ma000',`%r9') C
+define(`ma064',`%r4') C
+define(`ma128',`%r5') C
+define(`ma192',`%r6') C
+define(`ma256',`%r7') C
+
+ std %r6, -0xe8(%r30)
+ std %r7, -0xe0(%r30)
+ std %r8, -0xd8(%r30)
+ std %r9, -0xd0(%r30)
+ std %r10, -0xc8(%r30)
+ std %r11, -0xc0(%r30)
+ std %r12, -0xb8(%r30)
+ std %r13, -0xb0(%r30)
+
+ifdef(`HAVE_ABI_2_0w',
+` extrd,u n, 61, 62, n C right shift 2
+',` extrd,u n, 61, 30, n C right shift 2, zero extend
+')
+
+LDEF(4_or_more)
+ fldd 0(up), %fr4
+ fldd 8(up), %fr5
+ fldd 16(up), %fr6
+ fldd 24(up), %fr7
+ xmpyu %fr8R, %fr4L, %fr22
+ xmpyu %fr8L, %fr4R, %fr23
+ xmpyu %fr8R, %fr5L, %fr24
+ xmpyu %fr8L, %fr5R, %fr25
+ xmpyu %fr8R, %fr6L, %fr26
+ xmpyu %fr8L, %fr6R, %fr27
+ fstd %fr22, -0x78(%r30) C mid product to -0x78..-0x71
+ xmpyu %fr8R, %fr7L, %fr28
+ xmpyu %fr8L, %fr7R, %fr29
+ fstd %fr23, -0x70(%r30) C mid product to -0x70..-0x69
+ xmpyu %fr8R, %fr4R, %fr30
+ xmpyu %fr8L, %fr4L, %fr31
+ fstd %fr24, -0x38(%r30) C mid product to -0x38..-0x31
+ xmpyu %fr8R, %fr5R, %fr22
+ xmpyu %fr8L, %fr5L, %fr23
+ fstd %fr25, -0x30(%r30) C mid product to -0x30..-0x29
+ xmpyu %fr8R, %fr6R, %fr24
+ xmpyu %fr8L, %fr6L, %fr25
+ fstd %fr26, -0x58(%r30) C mid product to -0x58..-0x51
+ xmpyu %fr8R, %fr7R, %fr26
+ fstd %fr27, -0x50(%r30) C mid product to -0x50..-0x49
+ addib,<> -1, n, L(8_or_more)
+ xmpyu %fr8L, %fr7L, %fr27
+ fstd %fr28, -0x18(%r30) C mid product to -0x18..-0x11
+ fstd %fr29, -0x10(%r30) C mid product to -0x10..-0x09
+ fstd %fr30, -0x80(%r30) C low product to -0x80..-0x79
+ fstd %fr31, -0x68(%r30) C high product to -0x68..-0x61
+ fstd %fr22, -0x40(%r30) C low product to -0x40..-0x39
+ fstd %fr23, -0x28(%r30) C high product to -0x28..-0x21
+ fstd %fr24, -0x60(%r30) C low product to -0x60..-0x59
+ fstd %fr25, -0x48(%r30) C high product to -0x48..-0x41
+ fstd %fr26, -0x20(%r30) C low product to -0x20..-0x19
+ fstd %fr27, -0x88(%r30) C high product to -0x88..-0x81
+ ldd -0x78(%r30), p032a1
+ ldd -0x70(%r30), p032a2
+ ldd -0x38(%r30), p096b1
+ ldd -0x30(%r30), p096b2
+ ldd -0x58(%r30), p160c1
+ ldd -0x50(%r30), p160c2
+ ldd -0x18(%r30), p224d1
+ ldd -0x10(%r30), p224d2
+ b L(end1)
+ nop
+
+LDEF(8_or_more)
+ fstd %fr28, -0x18(%r30) C mid product to -0x18..-0x11
+ fstd %fr29, -0x10(%r30) C mid product to -0x10..-0x09
+ ldo 32(up), up
+ fstd %fr30, -0x80(%r30) C low product to -0x80..-0x79
+ fstd %fr31, -0x68(%r30) C high product to -0x68..-0x61
+ fstd %fr22, -0x40(%r30) C low product to -0x40..-0x39
+ fstd %fr23, -0x28(%r30) C high product to -0x28..-0x21
+ fstd %fr24, -0x60(%r30) C low product to -0x60..-0x59
+ fstd %fr25, -0x48(%r30) C high product to -0x48..-0x41
+ fstd %fr26, -0x20(%r30) C low product to -0x20..-0x19
+ fstd %fr27, -0x88(%r30) C high product to -0x88..-0x81
+ fldd 0(up), %fr4
+ fldd 8(up), %fr5
+ fldd 16(up), %fr6
+ fldd 24(up), %fr7
+ xmpyu %fr8R, %fr4L, %fr22
+ ldd -0x78(%r30), p032a1
+ xmpyu %fr8L, %fr4R, %fr23
+ xmpyu %fr8R, %fr5L, %fr24
+ ldd -0x70(%r30), p032a2
+ xmpyu %fr8L, %fr5R, %fr25
+ xmpyu %fr8R, %fr6L, %fr26
+ ldd -0x38(%r30), p096b1
+ xmpyu %fr8L, %fr6R, %fr27
+ fstd %fr22, -0x78(%r30) C mid product to -0x78..-0x71
+ xmpyu %fr8R, %fr7L, %fr28
+ ldd -0x30(%r30), p096b2
+ xmpyu %fr8L, %fr7R, %fr29
+ fstd %fr23, -0x70(%r30) C mid product to -0x70..-0x69
+ xmpyu %fr8R, %fr4R, %fr30
+ ldd -0x58(%r30), p160c1
+ xmpyu %fr8L, %fr4L, %fr31
+ fstd %fr24, -0x38(%r30) C mid product to -0x38..-0x31
+ xmpyu %fr8R, %fr5R, %fr22
+ ldd -0x50(%r30), p160c2
+ xmpyu %fr8L, %fr5L, %fr23
+ fstd %fr25, -0x30(%r30) C mid product to -0x30..-0x29
+ xmpyu %fr8R, %fr6R, %fr24
+ ldd -0x18(%r30), p224d1
+ xmpyu %fr8L, %fr6L, %fr25
+ fstd %fr26, -0x58(%r30) C mid product to -0x58..-0x51
+ xmpyu %fr8R, %fr7R, %fr26
+ ldd -0x10(%r30), p224d2
+ fstd %fr27, -0x50(%r30) C mid product to -0x50..-0x49
+ addib,= -1, n, L(end2)
+ xmpyu %fr8L, %fr7L, %fr27
+LDEF(loop)
+ add p032a1, p032a2, m032
+ ldd -0x80(%r30), p000a
+ add,dc p096b1, p096b2, m096
+ fstd %fr28, -0x18(%r30) C mid product to -0x18..-0x11
+
+ add,dc p160c1, p160c2, m160
+ ldd -0x68(%r30), p064a
+ add,dc p224d1, p224d2, m224
+ fstd %fr29, -0x10(%r30) C mid product to -0x10..-0x09
+
+ add,dc %r0, %r0, m288
+ ldd -0x40(%r30), p064b
+ ldo 32(up), up
+ fstd %fr30, -0x80(%r30) C low product to -0x80..-0x79
+
+ depd,z m032, 31, 32, ma000
+ ldd -0x28(%r30), p128b
+ extrd,u m032, 31, 32, ma064
+ fstd %fr31, -0x68(%r30) C high product to -0x68..-0x61
+
+ depd m096, 31, 32, ma064
+ ldd -0x60(%r30), p128c
+ extrd,u m096, 31, 32, ma128
+ fstd %fr22, -0x40(%r30) C low product to -0x40..-0x39
+
+ depd m160, 31, 32, ma128
+ ldd -0x48(%r30), p192c
+ extrd,u m160, 31, 32, ma192
+ fstd %fr23, -0x28(%r30) C high product to -0x28..-0x21
+
+ depd m224, 31, 32, ma192
+ ldd -0x20(%r30), p192d
+ extrd,u m224, 31, 32, ma256
+ fstd %fr24, -0x60(%r30) C low product to -0x60..-0x59
+
+ depd m288, 31, 32, ma256
+ ldd -0x88(%r30), p256d
+ add climb, p000a, s000
+ fstd %fr25, -0x48(%r30) C high product to -0x48..-0x41
+
+ add,dc p064a, p064b, s064
+ add,dc p128b, p128c, s128
+ fstd %fr26, -0x20(%r30) C low product to -0x20..-0x19
+
+ add,dc p192c, p192d, s192
+ add,dc p256d, %r0, climb
+ fstd %fr27, -0x88(%r30) C high product to -0x88..-0x81
+
+ add ma000, s000, s000 C accum mid 0
+ fldd 0(up), %fr4
+ add,dc ma064, s064, s064 C accum mid 1
+ std s000, 0(rp)
+
+ add,dc ma128, s128, s128 C accum mid 2
+ fldd 8(up), %fr5
+ add,dc ma192, s192, s192 C accum mid 3
+ std s064, 8(rp)
+
+ add,dc ma256, climb, climb
+ fldd 16(up), %fr6
+ std s128, 16(rp)
+
+ xmpyu %fr8R, %fr4L, %fr22
+ ldd -0x78(%r30), p032a1
+ xmpyu %fr8L, %fr4R, %fr23
+ fldd 24(up), %fr7
+
+ xmpyu %fr8R, %fr5L, %fr24
+ ldd -0x70(%r30), p032a2
+ xmpyu %fr8L, %fr5R, %fr25
+ std s192, 24(rp)
+
+ xmpyu %fr8R, %fr6L, %fr26
+ ldd -0x38(%r30), p096b1
+ xmpyu %fr8L, %fr6R, %fr27
+ fstd %fr22, -0x78(%r30) C mid product to -0x78..-0x71
+
+ xmpyu %fr8R, %fr7L, %fr28
+ ldd -0x30(%r30), p096b2
+ xmpyu %fr8L, %fr7R, %fr29
+ fstd %fr23, -0x70(%r30) C mid product to -0x70..-0x69
+
+ xmpyu %fr8R, %fr4R, %fr30
+ ldd -0x58(%r30), p160c1
+ xmpyu %fr8L, %fr4L, %fr31
+ fstd %fr24, -0x38(%r30) C mid product to -0x38..-0x31
+
+ xmpyu %fr8R, %fr5R, %fr22
+ ldd -0x50(%r30), p160c2
+ xmpyu %fr8L, %fr5L, %fr23
+ fstd %fr25, -0x30(%r30) C mid product to -0x30..-0x29
+
+ xmpyu %fr8R, %fr6R, %fr24
+ ldd -0x18(%r30), p224d1
+ xmpyu %fr8L, %fr6L, %fr25
+ fstd %fr26, -0x58(%r30) C mid product to -0x58..-0x51
+
+ xmpyu %fr8R, %fr7R, %fr26
+ ldd -0x10(%r30), p224d2
+ fstd %fr27, -0x50(%r30) C mid product to -0x50..-0x49
+ xmpyu %fr8L, %fr7L, %fr27
+
+ addib,<> -1, n, L(loop)
+ ldo 32(rp), rp
+
+LDEF(end2)
+ add p032a1, p032a2, m032
+ ldd -0x80(%r30), p000a
+ add,dc p096b1, p096b2, m096
+ fstd %fr28, -0x18(%r30) C mid product to -0x18..-0x11
+ add,dc p160c1, p160c2, m160
+ ldd -0x68(%r30), p064a
+ add,dc p224d1, p224d2, m224
+ fstd %fr29, -0x10(%r30) C mid product to -0x10..-0x09
+ add,dc %r0, %r0, m288
+ ldd -0x40(%r30), p064b
+ fstd %fr30, -0x80(%r30) C low product to -0x80..-0x79
+ depd,z m032, 31, 32, ma000
+ ldd -0x28(%r30), p128b
+ extrd,u m032, 31, 32, ma064
+ fstd %fr31, -0x68(%r30) C high product to -0x68..-0x61
+ depd m096, 31, 32, ma064
+ ldd -0x60(%r30), p128c
+ extrd,u m096, 31, 32, ma128
+ fstd %fr22, -0x40(%r30) C low product to -0x40..-0x39
+ depd m160, 31, 32, ma128
+ ldd -0x48(%r30), p192c
+ extrd,u m160, 31, 32, ma192
+ fstd %fr23, -0x28(%r30) C high product to -0x28..-0x21
+ depd m224, 31, 32, ma192
+ ldd -0x20(%r30), p192d
+ extrd,u m224, 31, 32, ma256
+ fstd %fr24, -0x60(%r30) C low product to -0x60..-0x59
+ depd m288, 31, 32, ma256
+ ldd -0x88(%r30), p256d
+ add climb, p000a, s000
+ fstd %fr25, -0x48(%r30) C high product to -0x48..-0x41
+ add,dc p064a, p064b, s064
+ add,dc p128b, p128c, s128
+ fstd %fr26, -0x20(%r30) C low product to -0x20..-0x19
+ add,dc p192c, p192d, s192
+ add,dc p256d, %r0, climb
+ fstd %fr27, -0x88(%r30) C high product to -0x88..-0x81
+ add ma000, s000, s000 C accum mid 0
+ add,dc ma064, s064, s064 C accum mid 1
+ add,dc ma128, s128, s128 C accum mid 2
+ add,dc ma192, s192, s192 C accum mid 3
+ add,dc ma256, climb, climb
+ std s000, 0(rp)
+ std s064, 8(rp)
+ ldd -0x78(%r30), p032a1
+ std s128, 16(rp)
+ ldd -0x70(%r30), p032a2
+ std s192, 24(rp)
+ ldd -0x38(%r30), p096b1
+ ldd -0x30(%r30), p096b2
+ ldd -0x58(%r30), p160c1
+ ldd -0x50(%r30), p160c2
+ ldd -0x18(%r30), p224d1
+ ldd -0x10(%r30), p224d2
+ ldo 32(rp), rp
+
+LDEF(end1)
+ add p032a1, p032a2, m032
+ ldd -0x80(%r30), p000a
+ add,dc p096b1, p096b2, m096
+ add,dc p160c1, p160c2, m160
+ ldd -0x68(%r30), p064a
+ add,dc p224d1, p224d2, m224
+ add,dc %r0, %r0, m288
+ ldd -0x40(%r30), p064b
+ depd,z m032, 31, 32, ma000
+ ldd -0x28(%r30), p128b
+ extrd,u m032, 31, 32, ma064
+ depd m096, 31, 32, ma064
+ ldd -0x60(%r30), p128c
+ extrd,u m096, 31, 32, ma128
+ depd m160, 31, 32, ma128
+ ldd -0x48(%r30), p192c
+ extrd,u m160, 31, 32, ma192
+ depd m224, 31, 32, ma192
+ ldd -0x20(%r30), p192d
+ extrd,u m224, 31, 32, ma256
+ depd m288, 31, 32, ma256
+ ldd -0x88(%r30), p256d
+ add climb, p000a, s000
+ add,dc p064a, p064b, s064
+ add,dc p128b, p128c, s128
+ add,dc p192c, p192d, s192
+ add,dc p256d, %r0, climb
+ add ma000, s000, s000 C accum mid 0
+ add,dc ma064, s064, s064 C accum mid 1
+ add,dc ma128, s128, s128 C accum mid 2
+ add,dc ma192, s192, s192 C accum mid 3
+ add,dc ma256, climb, climb
+ std s000, 0(rp)
+ std s064, 8(rp)
+ std s128, 16(rp)
+ std s192, 24(rp)
+
+ ldd -0xb0(%r30), %r13
+ ldd -0xb8(%r30), %r12
+ ldd -0xc0(%r30), %r11
+ ldd -0xc8(%r30), %r10
+ ldd -0xd0(%r30), %r9
+ ldd -0xd8(%r30), %r8
+ ldd -0xe0(%r30), %r7
+ ldd -0xe8(%r30), %r6
+LDEF(done)
+ifdef(`HAVE_ABI_2_0w',
+` copy climb, %r28
+',` extrd,u climb, 63, 32, %r29
+ extrd,u climb, 31, 32, %r28
+')
+ ldd -0xf0(%r30), %r5
+ ldd -0xf8(%r30), %r4
+ bve (%r2)
+ ldd,mb -0x100(%r30), %r3
+EPILOGUE(mpn_mul_1)
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/pa64/rshift.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/pa64/rshift.asm
new file mode 100644
index 00000000000..cfc242ea9ca
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/pa64/rshift.asm
@@ -0,0 +1,111 @@
+dnl HP-PA 2.0 mpn_rshift -- Right shift.
+
+dnl Copyright 1997, 2000, 2002, 2003 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 This runs at 1.5 cycles/limb on PA8000 and 1.0 cycles/limb on PA8500.
+
+include(`../config.m4')
+
+dnl INPUT PARAMETERS
+define(`rp',`%r26')
+define(`up',`%r25')
+define(`n',`%r24')
+define(`cnt',`%r23')
+
+ifdef(`HAVE_ABI_2_0w',
+` .level 2.0w
+',` .level 2.0
+')
+PROLOGUE(mpn_rshift)
+ mtsar cnt
+ ldd 0(up), %r21
+ addib,= -1, n, L(end)
+ shrpd %r21, %r0, %sar, %r29 C compute carry out limb
+ depw,z n, 31, 3, %r28 C r28 = (size & 7)
+ sub %r0, n, %r22
+ depw,z %r22, 28, 3, %r22 C r22 = 8 * (-size & 7)
+ sub up, %r22, up C offset up
+ blr %r28, %r0 C branch into jump table
+ sub rp, %r22, rp C offset rp
+ b L(0)
+ nop
+ b L(1)
+ copy %r21, %r20
+ b L(2)
+ nop
+ b L(3)
+ copy %r21, %r20
+ b L(4)
+ nop
+ b L(5)
+ copy %r21, %r20
+ b L(6)
+ nop
+ b L(7)
+ copy %r21, %r20
+
+LDEF(loop)
+LDEF(0) ldd 8(up), %r20
+ shrpd %r20, %r21, %sar, %r21
+ std %r21, 0(rp)
+LDEF(7) ldd 16(up), %r21
+ shrpd %r21, %r20, %sar, %r20
+ std %r20, 8(rp)
+LDEF(6) ldd 24(up), %r20
+ shrpd %r20, %r21, %sar, %r21
+ std %r21, 16(rp)
+LDEF(5) ldd 32(up), %r21
+ shrpd %r21, %r20, %sar, %r20
+ std %r20, 24(rp)
+LDEF(4) ldd 40(up), %r20
+ shrpd %r20, %r21, %sar, %r21
+ std %r21, 32(rp)
+LDEF(3) ldd 48(up), %r21
+ shrpd %r21, %r20, %sar, %r20
+ std %r20, 40(rp)
+LDEF(2) ldd 56(up), %r20
+ shrpd %r20, %r21, %sar, %r21
+ std %r21, 48(rp)
+LDEF(1) ldd 64(up), %r21
+ ldo 64(up), up
+ shrpd %r21, %r20, %sar, %r20
+ std %r20, 56(rp)
+ addib,> -8, n, L(loop)
+ ldo 64(rp), rp
+
+LDEF(end)
+ shrpd %r0, %r21, %sar, %r21
+ std %r21, 0(rp)
+ bve (%r2)
+ifdef(`HAVE_ABI_2_0w',
+` copy %r29,%r28
+',` extrd,u %r29, 31, 32, %r28
+')
+EPILOGUE(mpn_rshift)
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/pa64/sqr_diagonal.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/pa64/sqr_diagonal.asm
new file mode 100644
index 00000000000..f6fadc93c63
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/pa64/sqr_diagonal.asm
@@ -0,0 +1,191 @@
+dnl HP-PA 2.0 64-bit mpn_sqr_diagonal.
+
+dnl Copyright 2001-2003 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 This code runs at 7.25 cycles/limb on PA8000 and 7.75 cycles/limb on
+dnl PA8500. The cache would saturate at 5 cycles/limb, so there is some room
+dnl for optimization.
+
+include(`../config.m4')
+
+C INPUT PARAMETERS
+define(`rp',`%r26')
+define(`up',`%r25')
+define(`n',`%r24')
+
+define(`p00',`%r28')
+define(`p32',`%r29')
+define(`p64',`%r31')
+define(`t0',`%r19')
+define(`t1',`%r20')
+
+ifdef(`HAVE_ABI_2_0w',
+` .level 2.0w
+',` .level 2.0
+')
+PROLOGUE(mpn_sqr_diagonal)
+ ldo 128(%r30),%r30
+
+ fldds,ma 8(up),%fr8
+ addib,= -1,n,L(end1)
+ nop
+ fldds,ma 8(up),%fr4
+ xmpyu %fr8l,%fr8r,%fr10
+ fstd %fr10,-120(%r30)
+ xmpyu %fr8r,%fr8r,%fr9
+ fstd %fr9,0(rp)
+ xmpyu %fr8l,%fr8l,%fr11
+ fstd %fr11,8(rp)
+ addib,= -1,n,L(end2)
+ ldo 16(rp),rp
+
+LDEF(loop)
+ fldds,ma 8(up),%fr8 C load next up limb
+ xmpyu %fr4l,%fr4r,%fr6
+ fstd %fr6,-128(%r30)
+ xmpyu %fr4r,%fr4r,%fr5 C multiply in fp regs
+ fstd %fr5,0(rp)
+ xmpyu %fr4l,%fr4l,%fr7
+ fstd %fr7,8(rp)
+ ldd -120(%r30),p32
+ ldd -16(rp),p00 C accumulate in int regs
+ ldd -8(rp),p64
+ depd,z p32,30,31,t0
+ add t0,p00,p00
+ std p00,-16(rp)
+ extrd,u p32,32,33,t1
+ add,dc t1,p64,p64
+ std p64,-8(rp)
+ addib,= -1,n,L(exit)
+ ldo 16(rp),rp
+
+ fldds,ma 8(up),%fr4
+ xmpyu %fr8l,%fr8r,%fr10
+ fstd %fr10,-120(%r30)
+ xmpyu %fr8r,%fr8r,%fr9
+ fstd %fr9,0(rp)
+ xmpyu %fr8l,%fr8l,%fr11
+ fstd %fr11,8(rp)
+ ldd -128(%r30),p32
+ ldd -16(rp),p00
+ ldd -8(rp),p64
+ depd,z p32,30,31,t0
+ add t0,p00,p00
+ std p00,-16(rp)
+ extrd,u p32,32,33,t1
+ add,dc t1,p64,p64
+ std p64,-8(rp)
+ addib,<> -1,n,L(loop)
+ ldo 16(rp),rp
+
+LDEF(end2)
+ xmpyu %fr4l,%fr4r,%fr6
+ fstd %fr6,-128(%r30)
+ xmpyu %fr4r,%fr4r,%fr5
+ fstd %fr5,0(rp)
+ xmpyu %fr4l,%fr4l,%fr7
+ fstd %fr7,8(rp)
+ ldd -120(%r30),p32
+ ldd -16(rp),p00
+ ldd -8(rp),p64
+ depd,z p32,30,31,t0
+ add t0,p00,p00
+ std p00,-16(rp)
+ extrd,u p32,32,33,t1
+ add,dc t1,p64,p64
+ std p64,-8(rp)
+ ldo 16(rp),rp
+ ldd -128(%r30),p32
+ ldd -16(rp),p00
+ ldd -8(rp),p64
+ depd,z p32,30,31,t0
+ add t0,p00,p00
+ std p00,-16(rp)
+ extrd,u p32,32,33,t1
+ add,dc t1,p64,p64
+ std p64,-8(rp)
+ bve (%r2)
+ ldo -128(%r30),%r30
+
+LDEF(exit)
+ xmpyu %fr8l,%fr8r,%fr10
+ fstd %fr10,-120(%r30)
+ xmpyu %fr8r,%fr8r,%fr9
+ fstd %fr9,0(rp)
+ xmpyu %fr8l,%fr8l,%fr11
+ fstd %fr11,8(rp)
+ ldd -128(%r30),p32
+ ldd -16(rp),p00
+ ldd -8(rp),p64
+ depd,z p32,31,32,t0
+ add t0,p00,p00
+ extrd,u p32,31,32,t1
+ add,dc t1,p64,p64
+ add t0,p00,p00
+ add,dc t1,p64,p64
+ std p00,-16(rp)
+ std p64,-8(rp)
+ ldo 16(rp),rp
+ ldd -120(%r30),p32
+ ldd -16(rp),p00
+ ldd -8(rp),p64
+ depd,z p32,31,32,t0
+ add t0,p00,p00
+ extrd,u p32,31,32,t1
+ add,dc t1,p64,p64
+ add t0,p00,p00
+ add,dc t1,p64,p64
+ std p00,-16(rp)
+ std p64,-8(rp)
+ bve (%r2)
+ ldo -128(%r30),%r30
+
+LDEF(end1)
+ xmpyu %fr8l,%fr8r,%fr10
+ fstd %fr10,-128(%r30)
+ xmpyu %fr8r,%fr8r,%fr9
+ fstd %fr9,0(rp)
+ xmpyu %fr8l,%fr8l,%fr11
+ fstd %fr11,8(rp)
+ ldo 16(rp),rp
+ ldd -128(%r30),p32
+ ldd -16(rp),p00
+ ldd -8(rp),p64
+ depd,z p32,31,32,t0
+ add t0,p00,p00
+ extrd,u p32,31,32,t1
+ add,dc t1,p64,p64
+ add t0,p00,p00
+ add,dc t1,p64,p64
+ std p00,-16(rp)
+ std p64,-8(rp)
+ bve (%r2)
+ ldo -128(%r30),%r30
+EPILOGUE(mpn_sqr_diagonal)
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/pa64/submul_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/pa64/submul_1.asm
new file mode 100644
index 00000000000..f8a1968e45b
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/pa64/submul_1.asm
@@ -0,0 +1,700 @@
+dnl HP-PA 2.0 64-bit mpn_submul_1 -- Multiply a limb vector with a limb and
+dnl subtract the result from a second limb vector.
+
+dnl Copyright 1998-2000, 2002, 2003 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 8000,8200: 7
+C 8500,8600,8700: 6.5
+
+C The feed-in and wind-down code has not yet been scheduled. Many cycles
+C could be saved there per call.
+
+C DESCRIPTION:
+C The main loop "BIG" is 4-way unrolled, mainly to allow
+C effective use of ADD,DC. Delays in moving data via the cache from the FP
+C registers to the IU registers, have demanded a deep software pipeline, and
+C a lot of stack slots for partial products in flight.
+C
+C CODE STRUCTURE:
+C save-some-registers
+C do 0, 1, 2, or 3 limbs
+C if done, restore-some-regs and return
+C save-many-regs
+C do 4, 8, ... limb
+C restore-all-regs
+
+C STACK LAYOUT:
+C HP-PA stack grows upwards. We could allocate 8 fewer slots by using the
+C slots marked FREE, as well as some slots in the caller's "frame marker".
+C
+C -00 <- r30
+C -08 FREE
+C -10 tmp
+C -18 tmp
+C -20 tmp
+C -28 tmp
+C -30 tmp
+C -38 tmp
+C -40 tmp
+C -48 tmp
+C -50 tmp
+C -58 tmp
+C -60 tmp
+C -68 tmp
+C -70 tmp
+C -78 tmp
+C -80 tmp
+C -88 tmp
+C -90 FREE
+C -98 FREE
+C -a0 FREE
+C -a8 FREE
+C -b0 r13
+C -b8 r12
+C -c0 r11
+C -c8 r10
+C -d0 r8
+C -d8 r8
+C -e0 r7
+C -e8 r6
+C -f0 r5
+C -f8 r4
+C -100 r3
+C Previous frame:
+C [unused area]
+C -38/-138 vlimb home slot. For 2.0N, the vlimb arg will arrive here.
+
+
+include(`../config.m4')
+
+C INPUT PARAMETERS:
+define(`rp',`%r26') C
+define(`up',`%r25') C
+define(`n',`%r24') C
+define(`vlimb',`%r23') C
+
+define(`climb',`%r23') C
+
+ifdef(`HAVE_ABI_2_0w',
+` .level 2.0w
+',` .level 2.0
+')
+PROLOGUE(mpn_submul_1)
+
+ifdef(`HAVE_ABI_2_0w',
+` std vlimb, -0x38(%r30) C store vlimb into "home" slot
+')
+ std,ma %r3, 0x100(%r30)
+ std %r4, -0xf8(%r30)
+ std %r5, -0xf0(%r30)
+ ldo 0(%r0), climb C clear climb
+ fldd -0x138(%r30), %fr8 C put vlimb in fp register
+
+define(`p032a1',`%r1') C
+define(`p032a2',`%r19') C
+
+define(`m032',`%r20') C
+define(`m096',`%r21') C
+
+define(`p000a',`%r22') C
+define(`p064a',`%r29') C
+
+define(`s000',`%r31') C
+
+define(`ma000',`%r4') C
+define(`ma064',`%r20') C
+
+define(`r000',`%r3') C
+
+ extrd,u n, 63, 2, %r5
+ cmpb,= %r5, %r0, L(BIG)
+ nop
+
+ fldd 0(up), %fr4
+ ldo 8(up), up
+ xmpyu %fr8R, %fr4L, %fr22
+ xmpyu %fr8L, %fr4R, %fr23
+ fstd %fr22, -0x78(%r30) C mid product to -0x78..-0x71
+ xmpyu %fr8R, %fr4R, %fr24
+ xmpyu %fr8L, %fr4L, %fr25
+ fstd %fr23, -0x70(%r30) C mid product to -0x70..-0x69
+ fstd %fr24, -0x80(%r30) C low product to -0x80..-0x79
+ addib,<> -1, %r5, L(two_or_more)
+ fstd %fr25, -0x68(%r30) C high product to -0x68..-0x61
+LDEF(one)
+ ldd -0x78(%r30), p032a1
+ ldd -0x70(%r30), p032a2
+ ldd -0x80(%r30), p000a
+ b L(0_one_out)
+ ldd -0x68(%r30), p064a
+
+LDEF(two_or_more)
+ fldd 0(up), %fr4
+ ldo 8(up), up
+ xmpyu %fr8R, %fr4L, %fr22
+ xmpyu %fr8L, %fr4R, %fr23
+ ldd -0x78(%r30), p032a1
+ fstd %fr22, -0x78(%r30) C mid product to -0x78..-0x71
+ xmpyu %fr8R, %fr4R, %fr24
+ xmpyu %fr8L, %fr4L, %fr25
+ ldd -0x70(%r30), p032a2
+ fstd %fr23, -0x70(%r30) C mid product to -0x70..-0x69
+ ldd -0x80(%r30), p000a
+ fstd %fr24, -0x80(%r30) C low product to -0x80..-0x79
+ ldd -0x68(%r30), p064a
+ addib,<> -1, %r5, L(three_or_more)
+ fstd %fr25, -0x68(%r30) C high product to -0x68..-0x61
+LDEF(two)
+ add p032a1, p032a2, m032
+ add,dc %r0, %r0, m096
+ depd,z m032, 31, 32, ma000
+ extrd,u m032, 31, 32, ma064
+ ldd 0(rp), r000
+ b L(0_two_out)
+ depd m096, 31, 32, ma064
+
+LDEF(three_or_more)
+ fldd 0(up), %fr4
+ add p032a1, p032a2, m032
+ add,dc %r0, %r0, m096
+ depd,z m032, 31, 32, ma000
+ extrd,u m032, 31, 32, ma064
+ ldd 0(rp), r000
+C addib,= -1, %r5, L(0_out)
+ depd m096, 31, 32, ma064
+LDEF(loop0)
+C xmpyu %fr8R, %fr4L, %fr22
+C xmpyu %fr8L, %fr4R, %fr23
+C ldd -0x78(%r30), p032a1
+C fstd %fr22, -0x78(%r30) C mid product to -0x78..-0x71
+C
+C xmpyu %fr8R, %fr4R, %fr24
+C xmpyu %fr8L, %fr4L, %fr25
+C ldd -0x70(%r30), p032a2
+C fstd %fr23, -0x70(%r30) C mid product to -0x70..-0x69
+C
+C ldo 8(rp), rp
+C add climb, p000a, s000
+C ldd -0x80(%r30), p000a
+C fstd %fr24, -0x80(%r30) C low product to -0x80..-0x79
+C
+C add,dc p064a, %r0, climb
+C ldo 8(up), up
+C ldd -0x68(%r30), p064a
+C fstd %fr25, -0x68(%r30) C high product to -0x68..-0x61
+C
+C add ma000, s000, s000
+C add,dc ma064, climb, climb
+C fldd 0(up), %fr4
+C
+C sub r000, s000, s000
+C sub,db %r0, climb, climb
+C sub %r0, climb, climb
+C std s000, -8(rp)
+C
+C add p032a1, p032a2, m032
+C add,dc %r0, %r0, m096
+C
+C depd,z m032, 31, 32, ma000
+C extrd,u m032, 31, 32, ma064
+C ldd 0(rp), r000
+C addib,<> -1, %r5, L(loop0)
+C depd m096, 31, 32, ma064
+LDEF(0_out)
+ ldo 8(up), up
+ xmpyu %fr8R, %fr4L, %fr22
+ xmpyu %fr8L, %fr4R, %fr23
+ ldd -0x78(%r30), p032a1
+ fstd %fr22, -0x78(%r30) C mid product to -0x78..-0x71
+ xmpyu %fr8R, %fr4R, %fr24
+ xmpyu %fr8L, %fr4L, %fr25
+ ldd -0x70(%r30), p032a2
+ fstd %fr23, -0x70(%r30) C mid product to -0x70..-0x69
+ ldo 8(rp), rp
+ add climb, p000a, s000
+ ldd -0x80(%r30), p000a
+ fstd %fr24, -0x80(%r30) C low product to -0x80..-0x79
+ add,dc p064a, %r0, climb
+ ldd -0x68(%r30), p064a
+ fstd %fr25, -0x68(%r30) C high product to -0x68..-0x61
+ add ma000, s000, s000
+ add,dc ma064, climb, climb
+ sub r000, s000, s000
+ sub,db %r0, climb, climb
+ sub %r0, climb, climb
+ std s000, -8(rp)
+ add p032a1, p032a2, m032
+ add,dc %r0, %r0, m096
+ depd,z m032, 31, 32, ma000
+ extrd,u m032, 31, 32, ma064
+ ldd 0(rp), r000
+ depd m096, 31, 32, ma064
+LDEF(0_two_out)
+ ldd -0x78(%r30), p032a1
+ ldd -0x70(%r30), p032a2
+ ldo 8(rp), rp
+ add climb, p000a, s000
+ ldd -0x80(%r30), p000a
+ add,dc p064a, %r0, climb
+ ldd -0x68(%r30), p064a
+ add ma000, s000, s000
+ add,dc ma064, climb, climb
+ sub r000, s000, s000
+ sub,db %r0, climb, climb
+ sub %r0, climb, climb
+ std s000, -8(rp)
+LDEF(0_one_out)
+ add p032a1, p032a2, m032
+ add,dc %r0, %r0, m096
+ depd,z m032, 31, 32, ma000
+ extrd,u m032, 31, 32, ma064
+ ldd 0(rp), r000
+ depd m096, 31, 32, ma064
+
+ add climb, p000a, s000
+ add,dc p064a, %r0, climb
+ add ma000, s000, s000
+ add,dc ma064, climb, climb
+ sub r000, s000, s000
+ sub,db %r0, climb, climb
+ sub %r0, climb, climb
+ std s000, 0(rp)
+
+ cmpib,>= 4, n, L(done)
+ ldo 8(rp), rp
+
+C 4-way unrolled code.
+
+LDEF(BIG)
+
+define(`p032a1',`%r1') C
+define(`p032a2',`%r19') C
+define(`p096b1',`%r20') C
+define(`p096b2',`%r21') C
+define(`p160c1',`%r22') C
+define(`p160c2',`%r29') C
+define(`p224d1',`%r31') C
+define(`p224d2',`%r3') C
+ C
+define(`m032',`%r4') C
+define(`m096',`%r5') C
+define(`m160',`%r6') C
+define(`m224',`%r7') C
+define(`m288',`%r8') C
+ C
+define(`p000a',`%r1') C
+define(`p064a',`%r19') C
+define(`p064b',`%r20') C
+define(`p128b',`%r21') C
+define(`p128c',`%r22') C
+define(`p192c',`%r29') C
+define(`p192d',`%r31') C
+define(`p256d',`%r3') C
+ C
+define(`s000',`%r10') C
+define(`s064',`%r11') C
+define(`s128',`%r12') C
+define(`s192',`%r13') C
+ C
+define(`ma000',`%r9') C
+define(`ma064',`%r4') C
+define(`ma128',`%r5') C
+define(`ma192',`%r6') C
+define(`ma256',`%r7') C
+ C
+define(`r000',`%r1') C
+define(`r064',`%r19') C
+define(`r128',`%r20') C
+define(`r192',`%r21') C
+
+ std %r6, -0xe8(%r30)
+ std %r7, -0xe0(%r30)
+ std %r8, -0xd8(%r30)
+ std %r9, -0xd0(%r30)
+ std %r10, -0xc8(%r30)
+ std %r11, -0xc0(%r30)
+ std %r12, -0xb8(%r30)
+ std %r13, -0xb0(%r30)
+
+ifdef(`HAVE_ABI_2_0w',
+` extrd,u n, 61, 62, n C right shift 2
+',` extrd,u n, 61, 30, n C right shift 2, zero extend
+')
+
+LDEF(4_or_more)
+ fldd 0(up), %fr4
+ fldd 8(up), %fr5
+ fldd 16(up), %fr6
+ fldd 24(up), %fr7
+ xmpyu %fr8R, %fr4L, %fr22
+ xmpyu %fr8L, %fr4R, %fr23
+ xmpyu %fr8R, %fr5L, %fr24
+ xmpyu %fr8L, %fr5R, %fr25
+ xmpyu %fr8R, %fr6L, %fr26
+ xmpyu %fr8L, %fr6R, %fr27
+ fstd %fr22, -0x78(%r30) C mid product to -0x78..-0x71
+ xmpyu %fr8R, %fr7L, %fr28
+ xmpyu %fr8L, %fr7R, %fr29
+ fstd %fr23, -0x70(%r30) C mid product to -0x70..-0x69
+ xmpyu %fr8R, %fr4R, %fr30
+ xmpyu %fr8L, %fr4L, %fr31
+ fstd %fr24, -0x38(%r30) C mid product to -0x38..-0x31
+ xmpyu %fr8R, %fr5R, %fr22
+ xmpyu %fr8L, %fr5L, %fr23
+ fstd %fr25, -0x30(%r30) C mid product to -0x30..-0x29
+ xmpyu %fr8R, %fr6R, %fr24
+ xmpyu %fr8L, %fr6L, %fr25
+ fstd %fr26, -0x58(%r30) C mid product to -0x58..-0x51
+ xmpyu %fr8R, %fr7R, %fr26
+ fstd %fr27, -0x50(%r30) C mid product to -0x50..-0x49
+ addib,<> -1, n, L(8_or_more)
+ xmpyu %fr8L, %fr7L, %fr27
+ fstd %fr28, -0x18(%r30) C mid product to -0x18..-0x11
+ fstd %fr29, -0x10(%r30) C mid product to -0x10..-0x09
+ fstd %fr30, -0x80(%r30) C low product to -0x80..-0x79
+ fstd %fr31, -0x68(%r30) C high product to -0x68..-0x61
+ fstd %fr22, -0x40(%r30) C low product to -0x40..-0x39
+ fstd %fr23, -0x28(%r30) C high product to -0x28..-0x21
+ fstd %fr24, -0x60(%r30) C low product to -0x60..-0x59
+ fstd %fr25, -0x48(%r30) C high product to -0x48..-0x41
+ fstd %fr26, -0x20(%r30) C low product to -0x20..-0x19
+ fstd %fr27, -0x88(%r30) C high product to -0x88..-0x81
+ ldd -0x78(%r30), p032a1
+ ldd -0x70(%r30), p032a2
+ ldd -0x38(%r30), p096b1
+ ldd -0x30(%r30), p096b2
+ ldd -0x58(%r30), p160c1
+ ldd -0x50(%r30), p160c2
+ ldd -0x18(%r30), p224d1
+ ldd -0x10(%r30), p224d2
+ b L(end1)
+ nop
+
+LDEF(8_or_more)
+ fstd %fr28, -0x18(%r30) C mid product to -0x18..-0x11
+ fstd %fr29, -0x10(%r30) C mid product to -0x10..-0x09
+ ldo 32(up), up
+ fstd %fr30, -0x80(%r30) C low product to -0x80..-0x79
+ fstd %fr31, -0x68(%r30) C high product to -0x68..-0x61
+ fstd %fr22, -0x40(%r30) C low product to -0x40..-0x39
+ fstd %fr23, -0x28(%r30) C high product to -0x28..-0x21
+ fstd %fr24, -0x60(%r30) C low product to -0x60..-0x59
+ fstd %fr25, -0x48(%r30) C high product to -0x48..-0x41
+ fstd %fr26, -0x20(%r30) C low product to -0x20..-0x19
+ fstd %fr27, -0x88(%r30) C high product to -0x88..-0x81
+ fldd 0(up), %fr4
+ fldd 8(up), %fr5
+ fldd 16(up), %fr6
+ fldd 24(up), %fr7
+ xmpyu %fr8R, %fr4L, %fr22
+ ldd -0x78(%r30), p032a1
+ xmpyu %fr8L, %fr4R, %fr23
+ xmpyu %fr8R, %fr5L, %fr24
+ ldd -0x70(%r30), p032a2
+ xmpyu %fr8L, %fr5R, %fr25
+ xmpyu %fr8R, %fr6L, %fr26
+ ldd -0x38(%r30), p096b1
+ xmpyu %fr8L, %fr6R, %fr27
+ fstd %fr22, -0x78(%r30) C mid product to -0x78..-0x71
+ xmpyu %fr8R, %fr7L, %fr28
+ ldd -0x30(%r30), p096b2
+ xmpyu %fr8L, %fr7R, %fr29
+ fstd %fr23, -0x70(%r30) C mid product to -0x70..-0x69
+ xmpyu %fr8R, %fr4R, %fr30
+ ldd -0x58(%r30), p160c1
+ xmpyu %fr8L, %fr4L, %fr31
+ fstd %fr24, -0x38(%r30) C mid product to -0x38..-0x31
+ xmpyu %fr8R, %fr5R, %fr22
+ ldd -0x50(%r30), p160c2
+ xmpyu %fr8L, %fr5L, %fr23
+ fstd %fr25, -0x30(%r30) C mid product to -0x30..-0x29
+ xmpyu %fr8R, %fr6R, %fr24
+ ldd -0x18(%r30), p224d1
+ xmpyu %fr8L, %fr6L, %fr25
+ fstd %fr26, -0x58(%r30) C mid product to -0x58..-0x51
+ xmpyu %fr8R, %fr7R, %fr26
+ ldd -0x10(%r30), p224d2
+ fstd %fr27, -0x50(%r30) C mid product to -0x50..-0x49
+ addib,= -1, n, L(end2)
+ xmpyu %fr8L, %fr7L, %fr27
+LDEF(loop)
+ add p032a1, p032a2, m032
+ ldd -0x80(%r30), p000a
+ add,dc p096b1, p096b2, m096
+ fstd %fr28, -0x18(%r30) C mid product to -0x18..-0x11
+
+ add,dc p160c1, p160c2, m160
+ ldd -0x68(%r30), p064a
+ add,dc p224d1, p224d2, m224
+ fstd %fr29, -0x10(%r30) C mid product to -0x10..-0x09
+
+ add,dc %r0, %r0, m288
+ ldd -0x40(%r30), p064b
+ ldo 32(up), up
+ fstd %fr30, -0x80(%r30) C low product to -0x80..-0x79
+
+ depd,z m032, 31, 32, ma000
+ ldd -0x28(%r30), p128b
+ extrd,u m032, 31, 32, ma064
+ fstd %fr31, -0x68(%r30) C high product to -0x68..-0x61
+
+ depd m096, 31, 32, ma064
+ ldd -0x60(%r30), p128c
+ extrd,u m096, 31, 32, ma128
+ fstd %fr22, -0x40(%r30) C low product to -0x40..-0x39
+
+ depd m160, 31, 32, ma128
+ ldd -0x48(%r30), p192c
+ extrd,u m160, 31, 32, ma192
+ fstd %fr23, -0x28(%r30) C high product to -0x28..-0x21
+
+ depd m224, 31, 32, ma192
+ ldd -0x20(%r30), p192d
+ extrd,u m224, 31, 32, ma256
+ fstd %fr24, -0x60(%r30) C low product to -0x60..-0x59
+
+ depd m288, 31, 32, ma256
+ ldd -0x88(%r30), p256d
+ add climb, p000a, s000
+ fstd %fr25, -0x48(%r30) C high product to -0x48..-0x41
+
+ add,dc p064a, p064b, s064
+ ldd 0(rp), r000
+ add,dc p128b, p128c, s128
+ fstd %fr26, -0x20(%r30) C low product to -0x20..-0x19
+
+ add,dc p192c, p192d, s192
+ ldd 8(rp), r064
+ add,dc p256d, %r0, climb
+ fstd %fr27, -0x88(%r30) C high product to -0x88..-0x81
+
+ ldd 16(rp), r128
+ add ma000, s000, s000 C accum mid 0
+ ldd 24(rp), r192
+ add,dc ma064, s064, s064 C accum mid 1
+
+ add,dc ma128, s128, s128 C accum mid 2
+ fldd 0(up), %fr4
+ add,dc ma192, s192, s192 C accum mid 3
+ fldd 8(up), %fr5
+
+ add,dc ma256, climb, climb
+ fldd 16(up), %fr6
+ sub r000, s000, s000 C accum rlimb 0
+ fldd 24(up), %fr7
+
+ sub,db r064, s064, s064 C accum rlimb 1
+ sub,db r128, s128, s128 C accum rlimb 2
+ std s000, 0(rp)
+
+ sub,db r192, s192, s192 C accum rlimb 3
+ sub,db %r0, climb, climb
+ sub %r0, climb, climb
+ std s064, 8(rp)
+
+ xmpyu %fr8R, %fr4L, %fr22
+ ldd -0x78(%r30), p032a1
+ xmpyu %fr8L, %fr4R, %fr23
+ std s128, 16(rp)
+
+ xmpyu %fr8R, %fr5L, %fr24
+ ldd -0x70(%r30), p032a2
+ xmpyu %fr8L, %fr5R, %fr25
+ std s192, 24(rp)
+
+ xmpyu %fr8R, %fr6L, %fr26
+ ldd -0x38(%r30), p096b1
+ xmpyu %fr8L, %fr6R, %fr27
+ fstd %fr22, -0x78(%r30) C mid product to -0x78..-0x71
+
+ xmpyu %fr8R, %fr7L, %fr28
+ ldd -0x30(%r30), p096b2
+ xmpyu %fr8L, %fr7R, %fr29
+ fstd %fr23, -0x70(%r30) C mid product to -0x70..-0x69
+
+ xmpyu %fr8R, %fr4R, %fr30
+ ldd -0x58(%r30), p160c1
+ xmpyu %fr8L, %fr4L, %fr31
+ fstd %fr24, -0x38(%r30) C mid product to -0x38..-0x31
+
+ xmpyu %fr8R, %fr5R, %fr22
+ ldd -0x50(%r30), p160c2
+ xmpyu %fr8L, %fr5L, %fr23
+ fstd %fr25, -0x30(%r30) C mid product to -0x30..-0x29
+
+ xmpyu %fr8R, %fr6R, %fr24
+ ldd -0x18(%r30), p224d1
+ xmpyu %fr8L, %fr6L, %fr25
+ fstd %fr26, -0x58(%r30) C mid product to -0x58..-0x51
+
+ xmpyu %fr8R, %fr7R, %fr26
+ ldd -0x10(%r30), p224d2
+ fstd %fr27, -0x50(%r30) C mid product to -0x50..-0x49
+ xmpyu %fr8L, %fr7L, %fr27
+
+ addib,<> -1, n, L(loop)
+ ldo 32(rp), rp
+
+LDEF(end2)
+ add p032a1, p032a2, m032
+ ldd -0x80(%r30), p000a
+ add,dc p096b1, p096b2, m096
+ fstd %fr28, -0x18(%r30) C mid product to -0x18..-0x11
+ add,dc p160c1, p160c2, m160
+ ldd -0x68(%r30), p064a
+ add,dc p224d1, p224d2, m224
+ fstd %fr29, -0x10(%r30) C mid product to -0x10..-0x09
+ add,dc %r0, %r0, m288
+ ldd -0x40(%r30), p064b
+ fstd %fr30, -0x80(%r30) C low product to -0x80..-0x79
+ depd,z m032, 31, 32, ma000
+ ldd -0x28(%r30), p128b
+ extrd,u m032, 31, 32, ma064
+ fstd %fr31, -0x68(%r30) C high product to -0x68..-0x61
+ depd m096, 31, 32, ma064
+ ldd -0x60(%r30), p128c
+ extrd,u m096, 31, 32, ma128
+ fstd %fr22, -0x40(%r30) C low product to -0x40..-0x39
+ depd m160, 31, 32, ma128
+ ldd -0x48(%r30), p192c
+ extrd,u m160, 31, 32, ma192
+ fstd %fr23, -0x28(%r30) C high product to -0x28..-0x21
+ depd m224, 31, 32, ma192
+ ldd -0x20(%r30), p192d
+ extrd,u m224, 31, 32, ma256
+ fstd %fr24, -0x60(%r30) C low product to -0x60..-0x59
+ depd m288, 31, 32, ma256
+ ldd -0x88(%r30), p256d
+ add climb, p000a, s000
+ fstd %fr25, -0x48(%r30) C high product to -0x48..-0x41
+ add,dc p064a, p064b, s064
+ ldd 0(rp), r000
+ add,dc p128b, p128c, s128
+ fstd %fr26, -0x20(%r30) C low product to -0x20..-0x19
+ add,dc p192c, p192d, s192
+ ldd 8(rp), r064
+ add,dc p256d, %r0, climb
+ fstd %fr27, -0x88(%r30) C high product to -0x88..-0x81
+ ldd 16(rp), r128
+ add ma000, s000, s000 C accum mid 0
+ ldd 24(rp), r192
+ add,dc ma064, s064, s064 C accum mid 1
+ add,dc ma128, s128, s128 C accum mid 2
+ add,dc ma192, s192, s192 C accum mid 3
+ add,dc ma256, climb, climb
+ sub r000, s000, s000 C accum rlimb 0
+ sub,db r064, s064, s064 C accum rlimb 1
+ sub,db r128, s128, s128 C accum rlimb 2
+ std s000, 0(rp)
+ sub,db r192, s192, s192 C accum rlimb 3
+ sub,db %r0, climb, climb
+ sub %r0, climb, climb
+ std s064, 8(rp)
+ ldd -0x78(%r30), p032a1
+ std s128, 16(rp)
+ ldd -0x70(%r30), p032a2
+ std s192, 24(rp)
+ ldd -0x38(%r30), p096b1
+ ldd -0x30(%r30), p096b2
+ ldd -0x58(%r30), p160c1
+ ldd -0x50(%r30), p160c2
+ ldd -0x18(%r30), p224d1
+ ldd -0x10(%r30), p224d2
+ ldo 32(rp), rp
+
+LDEF(end1)
+ add p032a1, p032a2, m032
+ ldd -0x80(%r30), p000a
+ add,dc p096b1, p096b2, m096
+ add,dc p160c1, p160c2, m160
+ ldd -0x68(%r30), p064a
+ add,dc p224d1, p224d2, m224
+ add,dc %r0, %r0, m288
+ ldd -0x40(%r30), p064b
+ depd,z m032, 31, 32, ma000
+ ldd -0x28(%r30), p128b
+ extrd,u m032, 31, 32, ma064
+ depd m096, 31, 32, ma064
+ ldd -0x60(%r30), p128c
+ extrd,u m096, 31, 32, ma128
+ depd m160, 31, 32, ma128
+ ldd -0x48(%r30), p192c
+ extrd,u m160, 31, 32, ma192
+ depd m224, 31, 32, ma192
+ ldd -0x20(%r30), p192d
+ extrd,u m224, 31, 32, ma256
+ depd m288, 31, 32, ma256
+ ldd -0x88(%r30), p256d
+ add climb, p000a, s000
+ add,dc p064a, p064b, s064
+ ldd 0(rp), r000
+ add,dc p128b, p128c, s128
+ add,dc p192c, p192d, s192
+ ldd 8(rp), r064
+ add,dc p256d, %r0, climb
+ ldd 16(rp), r128
+ add ma000, s000, s000 C accum mid 0
+ ldd 24(rp), r192
+ add,dc ma064, s064, s064 C accum mid 1
+ add,dc ma128, s128, s128 C accum mid 2
+ add,dc ma192, s192, s192 C accum mid 3
+ add,dc ma256, climb, climb
+ sub r000, s000, s000 C accum rlimb 0
+ sub,db r064, s064, s064 C accum rlimb 1
+ sub,db r128, s128, s128 C accum rlimb 2
+ std s000, 0(rp)
+ sub,db r192, s192, s192 C accum rlimb 3
+ sub,db %r0, climb, climb
+ sub %r0, climb, climb
+ std s064, 8(rp)
+ std s128, 16(rp)
+ std s192, 24(rp)
+
+ ldd -0xb0(%r30), %r13
+ ldd -0xb8(%r30), %r12
+ ldd -0xc0(%r30), %r11
+ ldd -0xc8(%r30), %r10
+ ldd -0xd0(%r30), %r9
+ ldd -0xd8(%r30), %r8
+ ldd -0xe0(%r30), %r7
+ ldd -0xe8(%r30), %r6
+LDEF(done)
+ifdef(`HAVE_ABI_2_0w',
+` copy climb, %r28
+',` extrd,u climb, 63, 32, %r29
+ extrd,u climb, 31, 32, %r28
+')
+ ldd -0xf0(%r30), %r5
+ ldd -0xf8(%r30), %r4
+ bve (%r2)
+ ldd,mb -0x100(%r30), %r3
+EPILOGUE(mpn_submul_1)
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/pa64/udiv.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/pa64/udiv.asm
new file mode 100644
index 00000000000..1380a85932e
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/pa64/udiv.asm
@@ -0,0 +1,125 @@
+dnl HP-PA 2.0 64-bit mpn_udiv_qrnnd_r.
+
+dnl Copyright 2001-2003 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 This runs at about 280 cycles on both PA8000 and PA8500, corresponding to a
+C bit more than 4 cycles/bit.
+
+C INPUT PARAMETERS
+define(`n1',`%r26')
+define(`n0',`%r25')
+define(`d',`%r24')
+define(`remptr',`%r23')
+
+define(`q',`%r28')
+define(`dn',`%r29')
+
+define(`old_divstep',
+ `add,dc n0,n0,n0
+ add,dc n1,n1,n1
+ sub,*<< n1,d,%r22
+ copy %r22,n1')
+
+define(`divstep',
+ `add n0,n0,n0
+ add,dc n1,n1,n1
+ sub n1,d,%r1
+ add,dc q,q,q
+ cmpclr,*<< n1,d,%r0
+ copy %r1,n1
+')
+
+ifdef(`HAVE_ABI_2_0w',
+` .level 2.0w
+',` .level 2.0
+')
+PROLOGUE(mpn_udiv_qrnnd_r)
+ifdef(`HAVE_ABI_2_0n',
+` depd %r25,31,32,%r26
+ depd %r23,31,32,%r24
+ copy %r24,%r25
+ ldd -56(%r30),%r24
+ ldw -60(%r30),%r23
+')
+ ldi 0,q
+ cmpib,*>= 0,d,L(large_divisor)
+ ldi 8,%r31 C setup loop counter
+
+ sub %r0,d,dn
+LDEF(Loop)
+ divstep divstep divstep divstep divstep divstep divstep divstep
+ addib,<> -1,%r31,L(Loop)
+ nop
+
+ifdef(`HAVE_ABI_2_0n',
+` copy %r28,%r29
+ extrd,u %r28,31,32,%r28
+')
+ bve (%r2)
+ std n1,0(remptr) C store remainder
+
+LDEF(large_divisor)
+ extrd,u n0,63,1,%r19 C save lsb of dividend
+ shrpd n1,n0,1,n0 C n0 = lo(n1n0 >> 1)
+ shrpd %r0,n1,1,n1 C n1 = hi(n1n0 >> 1)
+ extrd,u d,63,1,%r20 C save lsb of divisor
+ shrpd %r0,d,1,d C d = floor(orig_d / 2)
+ add,l %r20,d,d C d = ceil(orig_d / 2)
+
+ sub %r0,d,dn
+LDEF(Loop2)
+ divstep divstep divstep divstep divstep divstep divstep divstep
+ addib,<> -1,%r31,L(Loop2)
+ nop
+
+ cmpib,*= 0,%r20,L(even_divisor)
+ shladd n1,1,%r19,n1 C shift in omitted dividend lsb
+
+ add d,d,d C restore orig...
+ sub d,%r20,d C ...d value
+ sub %r0,d,dn C r21 = -d
+
+ add,*nuv n1,q,n1 C fix remainder for omitted divisor lsb
+ add,l n1,dn,n1 C adjust remainder if rem. fix carried
+ add,dc %r0,q,q C adjust quotient accordingly
+
+ sub,*<< n1,d,%r0 C remainder >= divisor?
+ add,l n1,dn,n1 C adjust remainder
+ add,dc %r0,q,q C adjust quotient
+
+LDEF(even_divisor)
+ifdef(`HAVE_ABI_2_0n',
+` copy %r28,%r29
+ extrd,u %r28,31,32,%r28
+')
+ bve (%r2)
+ std n1,0(remptr) C store remainder
+EPILOGUE(mpn_udiv_qrnnd_r)
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/pa64/umul.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/pa64/umul.asm
new file mode 100644
index 00000000000..c3341ecfe60
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/pa64/umul.asm
@@ -0,0 +1,98 @@
+dnl Copyright 1999, 2000, 2002, 2003 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 Optimizations:
+dnl * Avoid skip instructions
+dnl * Put carry-generating and carry-consuming insns consecutively
+dnl * Don't allocate any stack, "home" positions for parameters could be used.
+
+include(`../config.m4')
+
+define(`p0',`%r28')
+define(`p1',`%r29')
+define(`t32',`%r19')
+define(`t0',`%r20')
+define(`t1',`%r21')
+define(`x',`%r22')
+define(`m0',`%r23')
+define(`m1',`%r24')
+
+ifdef(`HAVE_ABI_2_0w',
+` .level 2.0w
+',` .level 2.0
+')
+PROLOGUE(mpn_umul_ppmm_r)
+ ldo 128(%r30),%r30
+ifdef(`HAVE_ABI_2_0w',
+` std %r26,-64(%r30)
+ std %r25,-56(%r30)
+ copy %r24,%r31
+',`
+ depd %r25,31,32,%r26
+ std %r26,-64(%r30)
+ depd %r23,31,32,%r24
+ std %r24,-56(%r30)
+ ldw -180(%r30),%r31
+')
+
+ fldd -64(%r30),%fr4
+ fldd -56(%r30),%fr5
+
+ xmpyu %fr5R,%fr4R,%fr6
+ fstd %fr6,-128(%r30)
+ xmpyu %fr5R,%fr4L,%fr7
+ fstd %fr7,-120(%r30)
+ xmpyu %fr5L,%fr4R,%fr8
+ fstd %fr8,-112(%r30)
+ xmpyu %fr5L,%fr4L,%fr9
+ fstd %fr9,-104(%r30)
+
+ depdi,z 1,31,1,t32 C t32 = 2^32
+
+ ldd -128(%r30),p0 C lo = low 64 bit of product
+ ldd -120(%r30),m0 C m0 = mid0 64 bit of product
+ ldd -112(%r30),m1 C m1 = mid1 64 bit of product
+ ldd -104(%r30),p1 C hi = high 64 bit of product
+
+ add,l,*nuv m0,m1,x C x = m1+m0
+ add,l t32,p1,p1 C propagate carry to mid of p1
+ depd,z x,31,32,t0 C lo32(m1+m0)
+ add t0,p0,p0
+ extrd,u x,31,32,t1 C hi32(m1+m0)
+ add,dc t1,p1,p1
+
+ std p0,0(%r31) C store low half of product
+ifdef(`HAVE_ABI_2_0w',
+` copy p1,%r28 C return val in %r28
+',` extrd,u p1,31,32,%r28 C return val in %r28,%r29
+')
+ bve (%r2)
+ ldo -128(%r30),%r30
+EPILOGUE(mpn_umul_ppmm_r)
+
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/power/add_n.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/power/add_n.asm
new file mode 100644
index 00000000000..6d6ca73da98
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/power/add_n.asm
@@ -0,0 +1,83 @@
+dnl IBM POWER mpn_add_n -- Add two limb vectors of equal, non-zero length.
+
+dnl Copyright 1992, 1994-1996, 1999-2001, 2005 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 res_ptr r3
+dnl s1_ptr r4
+dnl s2_ptr r5
+dnl size r6
+
+include(`../config.m4')
+
+ASM_START()
+PROLOGUE(mpn_add_n)
+ andil. 10,6,1 C odd or even number of limbs?
+ l 8,0(4) C load least significant s1 limb
+ l 0,0(5) C load least significant s2 limb
+ cal 3,-4(3) C offset res_ptr, it's updated before it's used
+ sri 10,6,1 C count for unrolled loop
+ a 7,0,8 C add least significant limbs, set cy
+ mtctr 10 C copy count into CTR
+ beq 0,Leven C branch if even # of limbs (# of limbs >= 2)
+
+C We have an odd # of limbs. Add the first limbs separately.
+ cmpi 1,10,0 C is count for unrolled loop zero?
+ bc 4,6,L1 C bne cr1,L1 (misassembled by gas)
+ st 7,4(3)
+ aze 3,10 C use the fact that r10 is zero...
+ br C return
+
+C We added least significant limbs. Now reload the next limbs to enter loop.
+L1: lu 8,4(4) C load s1 limb and update s1_ptr
+ lu 0,4(5) C load s2 limb and update s2_ptr
+ stu 7,4(3)
+ ae 7,0,8 C add limbs, set cy
+Leven: lu 9,4(4) C load s1 limb and update s1_ptr
+ lu 10,4(5) C load s2 limb and update s2_ptr
+ bdz Lend C If done, skip loop
+
+Loop: lu 8,4(4) C load s1 limb and update s1_ptr
+ lu 0,4(5) C load s2 limb and update s2_ptr
+ ae 11,10,9 C add previous limbs with cy, set cy
+ stu 7,4(3) C
+ lu 9,4(4) C load s1 limb and update s1_ptr
+ lu 10,4(5) C load s2 limb and update s2_ptr
+ ae 7,0,8 C add previous limbs with cy, set cy
+ stu 11,4(3) C
+ bdn Loop C decrement CTR and loop back
+
+Lend: ae 11,10,9 C add limbs with cy, set cy
+ st 7,4(3) C
+ st 11,8(3) C
+ lil 3,0 C load cy into ...
+ aze 3,3 C ... return value register
+ br
+EPILOGUE(mpn_add_n)
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/power/addmul_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/power/addmul_1.asm
new file mode 100644
index 00000000000..76d8df3c76c
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/power/addmul_1.asm
@@ -0,0 +1,126 @@
+dnl IBM POWER mpn_addmul_1 -- Multiply a limb vector with a limb and add the
+dnl result to a second limb vector.
+
+dnl Copyright 1992, 1994, 1999-2001 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 res_ptr r3
+dnl s1_ptr r4
+dnl size r5
+dnl s2_limb r6
+
+dnl The POWER architecture has no unsigned 32x32->64 bit multiplication
+dnl instruction. To obtain that operation, we have to use the 32x32->64
+dnl signed multiplication instruction, and add the appropriate compensation to
+dnl the high limb of the result. We add the multiplicand if the multiplier
+dnl has its most significant bit set, and we add the multiplier if the
+dnl multiplicand has its most significant bit set. We need to preserve the
+dnl carry flag between each iteration, so we have to compute the compensation
+dnl carefully (the natural, srai+and doesn't work). Since all POWER can
+dnl branch in zero cycles, we use conditional branches for the compensation.
+
+include(`../config.m4')
+
+ASM_START()
+PROLOGUE(mpn_addmul_1)
+ cal 3,-4(3)
+ l 0,0(4)
+ cmpi 0,6,0
+ mtctr 5
+ mul 9,0,6
+ srai 7,0,31
+ and 7,7,6
+ mfmq 8
+ cax 9,9,7
+ l 7,4(3)
+ a 8,8,7 C add res_limb
+ blt Lneg
+Lpos: bdz Lend
+
+Lploop: lu 0,4(4)
+ stu 8,4(3)
+ cmpi 0,0,0
+ mul 10,0,6
+ mfmq 0
+ ae 8,0,9 C low limb + old_cy_limb + old cy
+ l 7,4(3)
+ aze 10,10 C propagate cy to new cy_limb
+ a 8,8,7 C add res_limb
+ bge Lp0
+ cax 10,10,6 C adjust high limb for negative limb from s1
+Lp0: bdz Lend0
+ lu 0,4(4)
+ stu 8,4(3)
+ cmpi 0,0,0
+ mul 9,0,6
+ mfmq 0
+ ae 8,0,10
+ l 7,4(3)
+ aze 9,9
+ a 8,8,7
+ bge Lp1
+ cax 9,9,6 C adjust high limb for negative limb from s1
+Lp1: bdn Lploop
+
+ b Lend
+
+Lneg: cax 9,9,0
+ bdz Lend
+Lnloop: lu 0,4(4)
+ stu 8,4(3)
+ cmpi 0,0,0
+ mul 10,0,6
+ mfmq 7
+ ae 8,7,9
+ l 7,4(3)
+ ae 10,10,0 C propagate cy to new cy_limb
+ a 8,8,7 C add res_limb
+ bge Ln0
+ cax 10,10,6 C adjust high limb for negative limb from s1
+Ln0: bdz Lend0
+ lu 0,4(4)
+ stu 8,4(3)
+ cmpi 0,0,0
+ mul 9,0,6
+ mfmq 7
+ ae 8,7,10
+ l 7,4(3)
+ ae 9,9,0 C propagate cy to new cy_limb
+ a 8,8,7 C add res_limb
+ bge Ln1
+ cax 9,9,6 C adjust high limb for negative limb from s1
+Ln1: bdn Lnloop
+ b Lend
+
+Lend0: cal 9,0(10)
+Lend: st 8,4(3)
+ aze 3,9
+ br
+EPILOGUE(mpn_addmul_1)
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/power/gmp-mparam.h b/Build/source/libs/gmp/gmp-6.0.0/mpn/power/gmp-mparam.h
new file mode 100644
index 00000000000..7cb36f963e7
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/power/gmp-mparam.h
@@ -0,0 +1,69 @@
+/* POWER gmp-mparam.h -- Compiler/machine parameter header file.
+
+Copyright 2002-2004 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/. */
+
+/* Generated by tuneup.c, 2003-02-10, gcc 3.2, POWER2 66.7MHz */
+
+#define MUL_TOOM22_THRESHOLD 12
+#define MUL_TOOM33_THRESHOLD 75
+
+#define SQR_BASECASE_THRESHOLD 7
+#define SQR_TOOM2_THRESHOLD 28
+#define SQR_TOOM3_THRESHOLD 86
+
+#define DIV_SB_PREINV_THRESHOLD MP_SIZE_T_MAX /* never */
+#define DIV_DC_THRESHOLD 36
+#define POWM_THRESHOLD 69
+
+#define HGCD_THRESHOLD 97
+#define GCD_ACCEL_THRESHOLD 3
+#define GCD_DC_THRESHOLD 590
+#define JACOBI_BASE_METHOD 2
+
+#define DIVREM_1_NORM_THRESHOLD 12
+#define DIVREM_1_UNNORM_THRESHOLD MP_SIZE_T_MAX /* never */
+#define MOD_1_NORM_THRESHOLD 10
+#define MOD_1_UNNORM_THRESHOLD MP_SIZE_T_MAX /* never */
+#define USE_PREINV_DIVREM_1 0
+#define USE_PREINV_MOD_1 1
+#define DIVREM_2_THRESHOLD 11
+#define DIVEXACT_1_THRESHOLD 0 /* always */
+#define MODEXACT_1_ODD_THRESHOLD 0 /* always */
+
+#define GET_STR_DC_THRESHOLD 10
+#define GET_STR_PRECOMPUTE_THRESHOLD 20
+#define SET_STR_THRESHOLD 2899
+
+#define MUL_FFT_TABLE { 336, 800, 1408, 3584, 10240, 24576, 0 }
+#define MUL_FFT_MODF_THRESHOLD 296
+#define MUL_FFT_THRESHOLD 2304
+
+#define SQR_FFT_TABLE { 336, 800, 1408, 3584, 10240, 24576, 0 }
+#define SQR_FFT_MODF_THRESHOLD 296
+#define SQR_FFT_THRESHOLD 2304
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/power/lshift.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/power/lshift.asm
new file mode 100644
index 00000000000..efa210556d0
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/power/lshift.asm
@@ -0,0 +1,61 @@
+dnl IBM POWER mpn_lshift -- Shift a number left.
+
+dnl Copyright 1992, 1994, 1999-2001 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 res_ptr r3
+dnl s_ptr r4
+dnl size r5
+dnl cnt r6
+
+include(`../config.m4')
+
+ASM_START()
+PROLOGUE(mpn_lshift)
+ sli 0,5,2
+ cax 9,3,0
+ cax 4,4,0
+ sfi 8,6,32
+ mtctr 5 C put limb count in CTR loop register
+ lu 0,-4(4) C read most significant limb
+ sre 3,0,8 C compute carry out limb, and init MQ register
+ bdz Lend2 C if just one limb, skip loop
+ lu 0,-4(4) C read 2:nd most significant limb
+ sreq 7,0,8 C compute most significant limb of result
+ bdz Lend C if just two limb, skip loop
+Loop: lu 0,-4(4) C load next lower limb
+ stu 7,-4(9) C store previous result during read latency
+ sreq 7,0,8 C compute result limb
+ bdn Loop C loop back until CTR is zero
+Lend: stu 7,-4(9) C store 2:nd least significant limb
+Lend2: sle 7,0,6 C compute least significant limb
+ st 7,-4(9) C store it
+ br
+EPILOGUE(mpn_lshift)
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/power/mul_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/power/mul_1.asm
new file mode 100644
index 00000000000..38b7b66be0b
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/power/mul_1.asm
@@ -0,0 +1,113 @@
+dnl IBM POWER mpn_mul_1 -- Multiply a limb vector with a limb and store the
+dnl result in a second limb vector.
+
+dnl Copyright 1992, 1994, 1999-2001 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 res_ptr r3
+dnl s1_ptr r4
+dnl size r5
+dnl s2_limb r6
+
+dnl The POWER architecture has no unsigned 32x32->64 bit multiplication
+dnl instruction. To obtain that operation, we have to use the 32x32->64
+dnl signed multiplication instruction, and add the appropriate compensation to
+dnl the high limb of the result. We add the multiplicand if the multiplier
+dnl has its most significant bit set, and we add the multiplier if the
+dnl multiplicand has its most significant bit set. We need to preserve the
+dnl carry flag between each iteration, so we have to compute the compensation
+dnl carefully (the natural, srai+and doesn't work). Since all POWER can
+dnl branch in zero cycles, we use conditional branches for the compensation.
+
+include(`../config.m4')
+
+ASM_START()
+PROLOGUE(mpn_mul_1)
+ cal 3,-4(3)
+ l 0,0(4)
+ cmpi 0,6,0
+ mtctr 5
+ mul 9,0,6
+ srai 7,0,31
+ and 7,7,6
+ mfmq 8
+ ai 0,0,0 C reset carry
+ cax 9,9,7
+ blt Lneg
+Lpos: bdz Lend
+Lploop: lu 0,4(4)
+ stu 8,4(3)
+ cmpi 0,0,0
+ mul 10,0,6
+ mfmq 0
+ ae 8,0,9
+ bge Lp0
+ cax 10,10,6 C adjust high limb for negative limb from s1
+Lp0: bdz Lend0
+ lu 0,4(4)
+ stu 8,4(3)
+ cmpi 0,0,0
+ mul 9,0,6
+ mfmq 0
+ ae 8,0,10
+ bge Lp1
+ cax 9,9,6 C adjust high limb for negative limb from s1
+Lp1: bdn Lploop
+ b Lend
+
+Lneg: cax 9,9,0
+ bdz Lend
+Lnloop: lu 0,4(4)
+ stu 8,4(3)
+ cmpi 0,0,0
+ mul 10,0,6
+ cax 10,10,0 C adjust high limb for negative s2_limb
+ mfmq 0
+ ae 8,0,9
+ bge Ln0
+ cax 10,10,6 C adjust high limb for negative limb from s1
+Ln0: bdz Lend0
+ lu 0,4(4)
+ stu 8,4(3)
+ cmpi 0,0,0
+ mul 9,0,6
+ cax 9,9,0 C adjust high limb for negative s2_limb
+ mfmq 0
+ ae 8,0,10
+ bge Ln1
+ cax 9,9,6 C adjust high limb for negative limb from s1
+Ln1: bdn Lnloop
+ b Lend
+
+Lend0: cal 9,0(10)
+Lend: st 8,4(3)
+ aze 3,9
+ br
+EPILOGUE(mpn_mul_1)
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/power/rshift.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/power/rshift.asm
new file mode 100644
index 00000000000..1d1815ccb51
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/power/rshift.asm
@@ -0,0 +1,59 @@
+dnl IBM POWER mpn_rshift -- Shift a number right.
+
+dnl Copyright 1992, 1994, 1999-2001 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 res_ptr r3
+dnl s_ptr r4
+dnl size r5
+dnl cnt r6
+
+include(`../config.m4')
+
+ASM_START()
+PROLOGUE(mpn_rshift)
+ sfi 8,6,32
+ mtctr 5 C put limb count in CTR loop register
+ l 0,0(4) C read least significant limb
+ ai 9,3,-4 C adjust res_ptr since it's offset in the stu:s
+ sle 3,0,8 C compute carry limb, and init MQ register
+ bdz Lend2 C if just one limb, skip loop
+ lu 0,4(4) C read 2:nd least significant limb
+ sleq 7,0,8 C compute least significant limb of result
+ bdz Lend C if just two limb, skip loop
+Loop: lu 0,4(4) C load next higher limb
+ stu 7,4(9) C store previous result during read latency
+ sleq 7,0,8 C compute result limb
+ bdn Loop C loop back until CTR is zero
+Lend: stu 7,4(9) C store 2:nd most significant limb
+Lend2: sre 7,0,6 C compute most significant limb
+ st 7,4(9) C store it
+ br
+EPILOGUE(mpn_rshift)
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/power/sdiv.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/power/sdiv.asm
new file mode 100644
index 00000000000..4a9ed143b8a
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/power/sdiv.asm
@@ -0,0 +1,39 @@
+dnl Copyright 1999, 2001 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')
+
+ASM_START()
+PROLOGUE(mpn_sdiv_qrnnd)
+ mtmq 5
+ div 0,4,6
+ mfmq 9
+ st 9,0(3)
+ mr 3,0
+ br
+EPILOGUE(mpn_sdiv_qrnnd)
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/power/sub_n.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/power/sub_n.asm
new file mode 100644
index 00000000000..390c802d8bc
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/power/sub_n.asm
@@ -0,0 +1,85 @@
+dnl IBM POWER mpn_sub_n -- Subtract two limb vectors of equal, non-zero
+dnl length.
+
+dnl Copyright 1992, 1994-1996, 1999-2001, 2005 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 res_ptr r3
+dnl s1_ptr r4
+dnl s2_ptr r5
+dnl size r6
+
+include(`../config.m4')
+
+ASM_START()
+PROLOGUE(mpn_sub_n)
+ andil. 10,6,1 C odd or even number of limbs?
+ l 8,0(4) C load least significant s1 limb
+ l 0,0(5) C load least significant s2 limb
+ cal 3,-4(3) C offset res_ptr, it's updated before it's used
+ sri 10,6,1 C count for unrolled loop
+ sf 7,0,8 C subtract least significant limbs, set cy
+ mtctr 10 C copy count into CTR
+ beq 0,Leven C branch if even # of limbs (# of limbs >= 2)
+
+C We have an odd # of limbs. Add the first limbs separately.
+ cmpi 1,10,0 C is count for unrolled loop zero?
+ bc 4,6,L1 C bne cr1,L1 (misassembled by gas)
+ st 7,4(3)
+ sfe 3,0,0 C load !cy into ...
+ sfi 3,3,0 C ... return value register
+ br C return
+
+C We added least significant limbs. Now reload the next limbs to enter loop.
+L1: lu 8,4(4) C load s1 limb and update s1_ptr
+ lu 0,4(5) C load s2 limb and update s2_ptr
+ stu 7,4(3)
+ sfe 7,0,8 C subtract limbs, set cy
+Leven: lu 9,4(4) C load s1 limb and update s1_ptr
+ lu 10,4(5) C load s2 limb and update s2_ptr
+ bdz Lend C If done, skip loop
+
+Loop: lu 8,4(4) C load s1 limb and update s1_ptr
+ lu 0,4(5) C load s2 limb and update s2_ptr
+ sfe 11,10,9 C subtract previous limbs with cy, set cy
+ stu 7,4(3) C
+ lu 9,4(4) C load s1 limb and update s1_ptr
+ lu 10,4(5) C load s2 limb and update s2_ptr
+ sfe 7,0,8 C subtract previous limbs with cy, set cy
+ stu 11,4(3) C
+ bdn Loop C decrement CTR and loop back
+
+Lend: sfe 11,10,9 C subtract limbs with cy, set cy
+ st 7,4(3) C
+ st 11,8(3) C
+ sfe 3,0,0 C load !cy into ...
+ sfi 3,3,0 C ... return value register
+ br
+EPILOGUE(mpn_sub_n)
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/power/submul_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/power/submul_1.asm
new file mode 100644
index 00000000000..1788e0d4f4f
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/power/submul_1.asm
@@ -0,0 +1,131 @@
+dnl IBM POWER mpn_submul_1 -- Multiply a limb vector with a limb and subtract
+dnl the result from a second limb vector.
+
+dnl Copyright 1992, 1994, 1999-2001 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 res_ptr r3
+dnl s1_ptr r4
+dnl size r5
+dnl s2_limb r6
+
+dnl The POWER architecture has no unsigned 32x32->64 bit multiplication
+dnl instruction. To obtain that operation, we have to use the 32x32->64
+dnl signed multiplication instruction, and add the appropriate compensation to
+dnl the high limb of the result. We add the multiplicand if the multiplier
+dnl has its most significant bit set, and we add the multiplier if the
+dnl multiplicand has its most significant bit set. We need to preserve the
+dnl carry flag between each iteration, so we have to compute the compensation
+dnl carefully (the natural, srai+and doesn't work). Since all POWER can
+dnl branch in zero cycles, we use conditional branches for the compensation.
+
+include(`../config.m4')
+
+ASM_START()
+PROLOGUE(mpn_submul_1)
+ cal 3,-4(3)
+ l 0,0(4)
+ cmpi 0,6,0
+ mtctr 5
+ mul 9,0,6
+ srai 7,0,31
+ and 7,7,6
+ mfmq 11
+ cax 9,9,7
+ l 7,4(3)
+ sf 8,11,7 C add res_limb
+ a 11,8,11 C invert cy (r11 is junk)
+ blt Lneg
+Lpos: bdz Lend
+
+Lploop: lu 0,4(4)
+ stu 8,4(3)
+ cmpi 0,0,0
+ mul 10,0,6
+ mfmq 0
+ ae 11,0,9 C low limb + old_cy_limb + old cy
+ l 7,4(3)
+ aze 10,10 C propagate cy to new cy_limb
+ sf 8,11,7 C add res_limb
+ a 11,8,11 C invert cy (r11 is junk)
+ bge Lp0
+ cax 10,10,6 C adjust high limb for negative limb from s1
+Lp0: bdz Lend0
+ lu 0,4(4)
+ stu 8,4(3)
+ cmpi 0,0,0
+ mul 9,0,6
+ mfmq 0
+ ae 11,0,10
+ l 7,4(3)
+ aze 9,9
+ sf 8,11,7
+ a 11,8,11 C invert cy (r11 is junk)
+ bge Lp1
+ cax 9,9,6 C adjust high limb for negative limb from s1
+Lp1: bdn Lploop
+
+ b Lend
+
+Lneg: cax 9,9,0
+ bdz Lend
+Lnloop: lu 0,4(4)
+ stu 8,4(3)
+ cmpi 0,0,0
+ mul 10,0,6
+ mfmq 7
+ ae 11,7,9
+ l 7,4(3)
+ ae 10,10,0 C propagate cy to new cy_limb
+ sf 8,11,7 C add res_limb
+ a 11,8,11 C invert cy (r11 is junk)
+ bge Ln0
+ cax 10,10,6 C adjust high limb for negative limb from s1
+Ln0: bdz Lend0
+ lu 0,4(4)
+ stu 8,4(3)
+ cmpi 0,0,0
+ mul 9,0,6
+ mfmq 7
+ ae 11,7,10
+ l 7,4(3)
+ ae 9,9,0 C propagate cy to new cy_limb
+ sf 8,11,7 C add res_limb
+ a 11,8,11 C invert cy (r11 is junk)
+ bge Ln1
+ cax 9,9,6 C adjust high limb for negative limb from s1
+Ln1: bdn Lnloop
+ b Lend
+
+Lend0: cal 9,0(10)
+Lend: st 8,4(3)
+ aze 3,9
+ br
+EPILOGUE(mpn_submul_1)
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/power/umul.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/power/umul.asm
new file mode 100644
index 00000000000..5a0599e21d9
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/power/umul.asm
@@ -0,0 +1,43 @@
+dnl Copyright 1999, 2001 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')
+
+ASM_START()
+PROLOGUE(mpn_umul_ppmm)
+ mul 9,4,5
+ srai 0,4,31
+ and 0,0,5
+ srai 5,5,31
+ and 5,5,4
+ cax 0,0,5
+ mfmq 11
+ st 11,0(3)
+ cax 3,9,0
+ br
+EPILOGUE(mpn_umul_ppmm)
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc32/750/com.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc32/750/com.asm
new file mode 100644
index 00000000000..1b8b574b9cc
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc32/750/com.asm
@@ -0,0 +1,79 @@
+dnl PowerPC 750 mpn_com -- mpn bitwise one's complement
+
+dnl Copyright 2002, 2003 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 603e: ?
+C 604e: 3.0
+C 75x (G3): 2.0
+C 7400,7410 (G4): 2.0
+C 744x,745x (G4+): 3.0
+
+C void mpn_com (mp_ptr dst, mp_srcptr src, mp_size_t size);
+C
+C This loop form is necessary for the claimed speed.
+
+ASM_START()
+PROLOGUE(mpn_com)
+
+ C r3 dst
+ C r4 src
+ C r5 size
+
+ mtctr r5 C size
+ lwz r5, 0(r4) C src low limb
+
+ sub r4, r4, r3 C src-dst
+ subi r3, r3, 4 C dst-4
+
+ addi r4, r4, 8 C src-dst+8
+ bdz L(one)
+
+L(top):
+ C r3 &dst[i-1]
+ C r4 src-dst
+ C r5 src[i]
+ C r6 scratch
+
+ not r6, r5 C ~src[i]
+ lwzx r5, r4,r3 C src[i+1]
+
+ stwu r6, 4(r3) C dst[i]
+ bdnz L(top)
+
+L(one):
+ not r6, r5
+
+ stw r6, 4(r3) C dst[size-1]
+ blr
+
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc32/750/gmp-mparam.h b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc32/750/gmp-mparam.h
new file mode 100644
index 00000000000..3667e8596d2
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc32/750/gmp-mparam.h
@@ -0,0 +1,192 @@
+/* PowerPC-32 gmp-mparam.h -- Compiler/machine parameter header file.
+
+Copyright 2002, 2004, 2009, 2010 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
+
+
+/* This file is used for 75x (G3) and for 7400/7410 (G4), both which have
+ much slow multiply instructions. */
+
+/* 450 MHz PPC 7400 */
+
+#define DIVREM_1_NORM_THRESHOLD 0 /* always */
+#define DIVREM_1_UNNORM_THRESHOLD 0 /* always */
+#define MOD_1_NORM_THRESHOLD 3
+#define MOD_1_UNNORM_THRESHOLD 0 /* always */
+#define MOD_1N_TO_MOD_1_1_THRESHOLD 11
+#define MOD_1U_TO_MOD_1_1_THRESHOLD 7
+#define MOD_1_1_TO_MOD_1_2_THRESHOLD 11
+#define MOD_1_2_TO_MOD_1_4_THRESHOLD 18
+#define PREINV_MOD_1_TO_MOD_1_THRESHOLD 38
+#define USE_PREINV_DIVREM_1 1
+#define DIVEXACT_1_THRESHOLD 0 /* always */
+#define BMOD_1_TO_MOD_1_THRESHOLD MP_SIZE_T_MAX /* never */
+
+#define MUL_TOOM22_THRESHOLD 10
+#define MUL_TOOM33_THRESHOLD 38
+#define MUL_TOOM44_THRESHOLD 99
+#define MUL_TOOM6H_THRESHOLD 141
+#define MUL_TOOM8H_THRESHOLD 212
+
+#define MUL_TOOM32_TO_TOOM43_THRESHOLD 65
+#define MUL_TOOM32_TO_TOOM53_THRESHOLD 69
+#define MUL_TOOM42_TO_TOOM53_THRESHOLD 65
+#define MUL_TOOM42_TO_TOOM63_THRESHOLD 66
+
+#define SQR_BASECASE_THRESHOLD 4
+#define SQR_TOOM2_THRESHOLD 18
+#define SQR_TOOM3_THRESHOLD 57
+#define SQR_TOOM4_THRESHOLD 142
+#define SQR_TOOM6_THRESHOLD 173
+#define SQR_TOOM8_THRESHOLD 309
+
+#define MULMOD_BNM1_THRESHOLD 9
+#define SQRMOD_BNM1_THRESHOLD 11
+
+#define MUL_FFT_MODF_THRESHOLD 220 /* k = 5 */
+#define MUL_FFT_TABLE3 \
+ { { 220, 5}, { 13, 6}, { 7, 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}, { 23, 9}, \
+ { 7, 8}, { 15, 7}, { 33, 8}, { 19, 7}, \
+ { 39, 8}, { 23, 9}, { 15, 8}, { 39, 9}, \
+ { 23, 8}, { 47,10}, { 15, 9}, { 31, 8}, \
+ { 67, 9}, { 55,10}, { 31, 9}, { 63, 8}, \
+ { 127, 7}, { 255, 9}, { 71, 8}, { 143, 7}, \
+ { 287, 9}, { 79,10}, { 47, 9}, { 95,11}, \
+ { 31,10}, { 63, 9}, { 127, 8}, { 255, 9}, \
+ { 143, 8}, { 287,10}, { 79, 9}, { 159, 8}, \
+ { 319, 9}, { 175, 8}, { 351, 7}, { 703,10}, \
+ { 95, 9}, { 191, 8}, { 383, 9}, { 207,10}, \
+ { 111,11}, { 63,10}, { 127, 9}, { 255,10}, \
+ { 143, 9}, { 287, 8}, { 575,10}, { 159, 9}, \
+ { 319,10}, { 175, 9}, { 351, 8}, { 703,11}, \
+ { 95,10}, { 191, 9}, { 383,10}, { 207, 9}, \
+ { 415, 8}, { 831,12}, { 63,11}, { 127,10}, \
+ { 255, 9}, { 511,10}, { 271, 9}, { 543,10}, \
+ { 287, 9}, { 575,11}, { 159,10}, { 351, 9}, \
+ { 703, 8}, { 1407,11}, { 191,10}, { 415, 9}, \
+ { 831,11}, { 223,10}, { 447, 9}, { 895,12}, \
+ { 127,11}, { 255,10}, { 543,11}, { 287,10}, \
+ { 575,11}, { 351,10}, { 703, 9}, { 1407,12}, \
+ { 191,11}, { 415,10}, { 831,11}, { 447,10}, \
+ { 895,13}, { 127,12}, { 255,11}, { 543,10}, \
+ { 1087,11}, { 575,12}, { 319,11}, { 703,10}, \
+ { 1407,12}, { 383,11}, { 831,12}, { 447,11}, \
+ { 895,10}, { 1791,11}, { 959,13}, { 255,12}, \
+ { 511,11}, { 1087,12}, { 575,11}, { 1215,12}, \
+ { 703,11}, { 1407,13}, { 383,12}, { 895,11}, \
+ { 1791,12}, { 959,14}, { 255,13}, { 511,12}, \
+ { 1215,13}, { 639,12}, { 1407,13}, { 895,12}, \
+ { 1919,14}, { 511,13}, { 1023,12}, { 2047,13}, \
+ { 1151,12}, { 2303,13}, { 1407,14}, { 767,13}, \
+ { 1919,10}, { 15359,12}, { 4096,13}, { 8192,14}, \
+ { 16384,15}, { 32768,16} }
+#define MUL_FFT_TABLE3_SIZE 154
+#define MUL_FFT_THRESHOLD 2688
+
+#define SQR_FFT_MODF_THRESHOLD 184 /* k = 5 */
+#define SQR_FFT_TABLE3 \
+ { { 184, 5}, { 6, 4}, { 13, 5}, { 13, 6}, \
+ { 7, 5}, { 15, 6}, { 13, 7}, { 7, 6}, \
+ { 16, 7}, { 9, 6}, { 19, 7}, { 11, 6}, \
+ { 23, 7}, { 13, 8}, { 7, 7}, { 19, 8}, \
+ { 11, 7}, { 25, 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, 8}, { 95,10}, { 31, 9}, { 63, 8}, \
+ { 127, 7}, { 255, 9}, { 71, 8}, { 143, 7}, \
+ { 287, 9}, { 79, 8}, { 159,10}, { 47, 9}, \
+ { 95,11}, { 31,10}, { 63, 9}, { 127, 8}, \
+ { 255, 9}, { 143, 8}, { 287, 7}, { 575,10}, \
+ { 79, 9}, { 159, 8}, { 319, 9}, { 175, 8}, \
+ { 351,10}, { 95, 9}, { 191, 8}, { 383, 9}, \
+ { 207,10}, { 111,11}, { 63,10}, { 127, 9}, \
+ { 255,10}, { 143, 9}, { 287, 8}, { 575,10}, \
+ { 159, 9}, { 319,10}, { 175, 9}, { 351,11}, \
+ { 95,10}, { 191, 9}, { 383,10}, { 207, 9}, \
+ { 415, 8}, { 831,10}, { 223,12}, { 63,11}, \
+ { 127,10}, { 255, 9}, { 511,10}, { 287, 9}, \
+ { 575,11}, { 159,10}, { 351, 9}, { 703,11}, \
+ { 191,10}, { 415, 9}, { 831,11}, { 223,10}, \
+ { 447, 9}, { 895,12}, { 127,11}, { 255,10}, \
+ { 511,11}, { 287,10}, { 575,11}, { 319,10}, \
+ { 639,11}, { 351,10}, { 703, 9}, { 1407,12}, \
+ { 191,11}, { 383,10}, { 767,11}, { 415,10}, \
+ { 831,11}, { 447,10}, { 895,13}, { 127,12}, \
+ { 255,11}, { 511,10}, { 1023,11}, { 575,12}, \
+ { 319,11}, { 703,10}, { 1407,12}, { 383,11}, \
+ { 831,12}, { 447,11}, { 895,10}, { 1791,11}, \
+ { 959,13}, { 255,12}, { 511,11}, { 1023,12}, \
+ { 575,11}, { 1215,12}, { 703,11}, { 1407,13}, \
+ { 383,12}, { 895,11}, { 1791,12}, { 959,14}, \
+ { 255,13}, { 511,12}, { 1215,13}, { 639,12}, \
+ { 1471,13}, { 767,12}, { 1535,13}, { 895,12}, \
+ { 1919,14}, { 511,13}, { 1151,12}, { 2431,13}, \
+ { 1407,14}, { 767,13}, { 1919,15}, { 32768,16} }
+#define SQR_FFT_TABLE3_SIZE 152
+#define SQR_FFT_THRESHOLD 1728
+
+#define MULLO_BASECASE_THRESHOLD 0 /* always */
+#define MULLO_DC_THRESHOLD 33
+#define MULLO_MUL_N_THRESHOLD 5240
+
+#define DC_DIV_QR_THRESHOLD 31
+#define DC_DIVAPPR_Q_THRESHOLD 108
+#define DC_BDIV_QR_THRESHOLD 35
+#define DC_BDIV_Q_THRESHOLD 88
+
+#define INV_MULMOD_BNM1_THRESHOLD 42
+#define INV_NEWTON_THRESHOLD 149
+#define INV_APPR_THRESHOLD 125
+
+#define BINV_NEWTON_THRESHOLD 156
+#define REDC_1_TO_REDC_N_THRESHOLD 39
+
+#define MU_DIV_QR_THRESHOLD 807
+#define MU_DIVAPPR_Q_THRESHOLD 807
+#define MUPI_DIV_QR_THRESHOLD 66
+#define MU_BDIV_QR_THRESHOLD 667
+#define MU_BDIV_Q_THRESHOLD 807
+
+#define MATRIX22_STRASSEN_THRESHOLD 11
+#define HGCD_THRESHOLD 87
+#define GCD_DC_THRESHOLD 233
+#define GCDEXT_DC_THRESHOLD 198
+#define JACOBI_BASE_METHOD 1
+
+#define GET_STR_DC_THRESHOLD 12
+#define GET_STR_PRECOMPUTE_THRESHOLD 28
+#define SET_STR_DC_THRESHOLD 390
+#define SET_STR_PRECOMPUTE_THRESHOLD 814
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc32/750/lshift.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc32/750/lshift.asm
new file mode 100644
index 00000000000..3a1c1a7212e
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc32/750/lshift.asm
@@ -0,0 +1,155 @@
+dnl PowerPC 750 mpn_lshift -- mpn left shift.
+
+dnl Copyright 2002, 2003 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 750: 3.0
+C 7400: 3.0
+
+
+C mp_limb_t mpn_lshift (mp_ptr dst, mp_srcptr src, mp_size_t size,
+C unsigned shift);
+C
+C This code is the same per-limb speed as mpn/powerpc32/lshift.asm, but
+C smaller and saving about 30 or so cycles of overhead.
+
+ASM_START()
+PROLOGUE(mpn_lshift)
+
+ C r3 dst
+ C r4 src
+ C r5 size
+ C r6 shift
+
+ mtctr r5 C size
+ slwi r5, r5, 2 C 4*size
+
+ subfic r7, r6, 32 C 32-shift
+ add r4, r4, r5 C &src[size]
+
+ add r5, r3, r5 C &dst[size]
+ lwz r8, -4(r4) C src[size-1]
+ bdz L(one)
+
+ lwzu r9, -8(r4) C src[size-2]
+
+ srw r3, r8, r7 C return value
+ slw r8, r8, r6 C src[size-1] << shift
+ bdz L(two)
+
+
+L(top):
+ C r3 return value
+ C r4 src, incrementing
+ C r5 dst, incrementing
+ C r6 lshift
+ C r7 32-shift
+ C r8 src[i+1] << shift
+ C r9 src[i]
+ C r10
+
+ lwzu r10, -4(r4)
+ srw r11, r9, r7
+
+ or r8, r8, r11
+ stwu r8, -4(r5)
+
+ slw r8, r9, r6
+ bdz L(odd)
+
+ C r8 src[i+1] << shift
+ C r9
+ C r10 src[i]
+
+ lwzu r9, -4(r4)
+ srw r11, r10, r7
+
+ or r8, r8, r11
+ stwu r8, -4(r5)
+
+ slw r8, r10, r6
+ bdnz L(top)
+
+
+L(two):
+ C r3 return value
+ C r4
+ C r5 &dst[2]
+ C r6 shift
+ C r7 32-shift
+ C r8 src[1] << shift
+ C r9 src[0]
+ C r10
+
+ srw r11, r9, r7
+ slw r12, r9, r6 C src[0] << shift
+
+ or r8, r8, r11
+ stw r12, -8(r5) C dst[0]
+
+ stw r8, -4(r5) C dst[1]
+ blr
+
+
+L(odd):
+ C r3 return value
+ C r4
+ C r5 &dst[2]
+ C r6 shift
+ C r7 32-shift
+ C r8 src[1] << shift
+ C r9
+ C r10 src[0]
+
+ srw r11, r10, r7
+ slw r12, r10, r6
+
+ or r8, r8, r11
+ stw r12, -8(r5) C dst[0]
+
+ stw r8, -4(r5) C dst[1]
+ blr
+
+
+L(one):
+ C r5 &dst[1]
+ C r6 shift
+ C r7 32-shift
+ C r8 src[0]
+
+ srw r3, r8, r7 C return value
+ slw r8, r8, r6 C src[size-1] << shift
+
+ stw r8, -4(r5) C dst[0]
+ blr
+
+EPILOGUE(mpn_lshift)
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc32/750/rshift.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc32/750/rshift.asm
new file mode 100644
index 00000000000..4825fee6183
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc32/750/rshift.asm
@@ -0,0 +1,153 @@
+dnl PowerPC 750 mpn_rshift -- mpn right shift.
+
+dnl Copyright 2002, 2003 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 750: 3.0
+C 7400: 3.0
+
+
+C mp_limb_t mpn_rshift (mp_ptr dst, mp_srcptr src, mp_size_t size,
+C unsigned shift);
+C
+C This code is the same per-limb speed as mpn/powerpc32/rshift.asm, but
+C smaller and saving about 30 or so cycles of overhead.
+
+ASM_START()
+PROLOGUE(mpn_rshift)
+
+ C r3 dst
+ C r4 src
+ C r5 size
+ C r6 shift
+
+ mtctr r5 C size
+ lwz r8, 0(r4) C src[0]
+
+ subfic r7, r6, 32 C 32-shift
+ addi r5, r3, -4 C dst-4
+
+ slw r3, r8, r7 C return value
+ bdz L(one)
+
+ lwzu r9, 4(r4) C src[1]
+ srw r8, r8, r6 C src[0] >> shift
+ bdz L(two)
+
+
+L(top):
+ C r3 return value
+ C r4 src, incrementing
+ C r5 dst, incrementing
+ C r6 shift
+ C r7 32-shift
+ C r8 src[i-1] >> shift
+ C r9 src[i]
+ C r10
+
+ lwzu r10, 4(r4)
+ slw r11, r9, r7
+
+ or r8, r8, r11
+ stwu r8, 4(r5)
+
+ srw r8, r9, r6
+ bdz L(odd)
+
+ C r8 src[i-1] >> shift
+ C r9
+ C r10 src[i]
+
+ lwzu r9, 4(r4)
+ slw r11, r10, r7
+
+ or r8, r8, r11
+ stwu r8, 4(r5)
+
+ srw r8, r10, r6
+ bdnz L(top)
+
+
+L(two):
+ C r3 return value
+ C r4
+ C r5 &dst[size-2]
+ C r6 shift
+ C r7 32-shift
+ C r8 src[size-2] >> shift
+ C r9 src[size-1]
+ C r10
+
+ slw r11, r9, r7
+ srw r12, r9, r6 C src[size-1] >> shift
+
+ or r8, r8, r11
+ stw r12, 8(r5) C dst[size-1]
+
+ stw r8, 4(r5) C dst[size-2]
+ blr
+
+
+L(odd):
+ C r3 return value
+ C r4
+ C r5 &dst[size-2]
+ C r6 shift
+ C r7 32-shift
+ C r8 src[size-2] >> shift
+ C r9
+ C r10 src[size-1]
+
+ slw r11, r10, r7
+ srw r12, r10, r6
+
+ or r8, r8, r11
+ stw r12, 8(r5) C dst[size-1]
+
+ stw r8, 4(r5) C dst[size-2]
+ blr
+
+
+L(one):
+ C r3 return value
+ C r4
+ C r5 dst-4
+ C r6 shift
+ C r7
+ C r8 src[0]
+
+ srw r8, r8, r6
+
+ stw r8, 4(r5) C dst[0]
+ blr
+
+EPILOGUE(mpn_rshift)
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc32/README b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc32/README
new file mode 100644
index 00000000000..887e78b2903
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc32/README
@@ -0,0 +1,180 @@
+Copyright 2002, 2005 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/.
+
+
+
+
+
+ POWERPC 32-BIT MPN SUBROUTINES
+
+
+This directory contains mpn functions for various 32-bit PowerPC chips.
+
+
+CODE ORGANIZATION
+
+ directory used for
+ ================================================
+ powerpc generic, 604, 604e, 744x, 745x
+ powerpc/750 740, 750, 7400, 7410
+
+
+The top-level powerpc directory is currently mostly aimed at 604/604e but
+should be reasonable on all powerpcs.
+
+
+
+STATUS
+
+The code is quite well optimized for the 604e, other chips have had less
+attention.
+
+Altivec SIMD available in 74xx might hold some promise, but unfortunately
+GMP only guarantees 32-bit data alignment, so there's lots of fiddling
+around with partial operations at the start and end of limb vectors. A
+128-bit limb would be a novel idea, but is unlikely to be practical, since
+it would have to work with ordinary +, -, * etc in the C code.
+
+Also, Altivec isn't very well suited for the GMP multiplication needs.
+Using floating-point based multiplication has much better better performance
+potential for all current powerpcs, both the ones with slow integer multiply
+units (603, 740, 750, 7400, 7410) and those with fast (604, 604e, 744x,
+745x). This is because all powerpcs do some level of pipelining in the FPU:
+
+603 and 750 can sustain one fmadd every 2nd cycle.
+604 and 604e can sustain one fmadd per cycle.
+7400 and 7410 can sustain 3 fmadd in 4 cycles.
+744x and 745x can sustain 4 fmadd in 5 cycles.
+
+
+
+REGISTER NAMES
+
+The normal powerpc convention is to give registers as plain numbers, like
+"mtctr 6", but on Apple MacOS X (powerpc*-*-rhapsody* and
+powerpc*-*-darwin*) the assembler demands an "r" like "mtctr r6". Note
+however when register 0 in an instruction means a literal zero the "r" is
+omitted, for instance "lwzx r6,0,r7".
+
+The GMP code uses the "r" forms, powerpc-defs.m4 transforms them to plain
+numbers according to what GMP_ASM_POWERPC_R_REGISTERS finds is needed.
+(Note that this style isn't fully general, as the identifier r4 and the
+register r4 will not be distinguishable on some systems. However, this is
+not a problem for the limited GMP assembly usage.)
+
+
+
+GLOBAL REFERENCES
+
+Linux non-PIC
+ lis 9, __gmp_binvert_limb_table@ha
+ rlwinm 11, 5, 31, 25, 31
+ la 9, __gmp_binvert_limb_table@l(9)
+ lbzx 11, 9, 11
+
+Linux PIC (FIXME)
+.LCL0:
+ .long .LCTOC1-.LCF0
+ bcl 20, 31, .LCF0
+.LCF0:
+ mflr 30
+ lwz 7, .LCL0-.LCF0(30)
+ add 30, 7, 30
+ lwz 11, .LC0-.LCTOC1(30)
+ rlwinm 3, 5, 31, 25, 31
+ lbzx 7, 11, 3
+
+AIX (always PIC)
+LC..0:
+ .tc __gmp_binvert_limb_table[TC],__gmp_binvert_limb_table[RW]
+ lwz 9, LC..0(2)
+ rlwinm 0, 5, 31, 25, 31
+ lbzx 0, 9, 0
+
+Darwin (non-PIC)
+ lis r2, ha16(___gmp_binvert_limb_table)
+ rlwinm r9, r5, 31, 25, 31
+ la r2, lo16(___gmp_binvert_limb_table)(r2)
+ lbzx r0, r2, r9
+Darwin (PIC)
+ mflr r0
+ bcl 20, 31, L0001$pb
+L0001$pb:
+ mflr r7
+ mtlr r0
+ addis r2, r7, ha16(L___gmp_binvert_limb_table$non_lazy_ptr-L0001$pb)
+ rlwinm r9, r5, 31, 25, 31
+ lwz r2, lo16(L___gmp_binvert_limb_table$non_lazy_ptr-L0001$pb)(r2)
+ lbzx r0, r2, r9
+------
+ .non_lazy_symbol_pointer
+L___gmp_binvert_limb_table$non_lazy_ptr:
+ .indirect_symbol ___gmp_binvert_limb_table
+ .long 0
+ .subsections_via_symbols
+
+
+For GNU/Linux and Darwin, we might want to duplicate __gmp_binvert_limb_table
+into the text section in this file. We should thus be able to reach it like
+this:
+
+ blr L0
+L0: mflr r2
+ rlwinm r9, r5, 31, 25, 31
+ addi r9, r9, lo16(local_binvert_table-L0)
+ lbzx r0, r2, r9
+
+
+
+REFERENCES
+
+PowerPC Microprocessor Family: The Programming Environments for 32-bit
+Microprocessors, IBM document G522-0290-01, 2000.
+
+PowerPC 604e RISC Microprocessor User's Manual with Supplement for PowerPC
+604 Microprocessor, IBM document G552-0330-00, Freescale document
+MPC604EUM/AD, 3/1998.
+
+MPC7410/MPC7400 RISC Microprocessor User's Manual, Freescale document
+MPC7400UM/D, rev 1, 11/2002.
+
+MPC7450 RISC Microprocessor Family Reference Manual, Freescale document
+MPC7450UM, rev 5, 1/2005.
+
+The above are available online from
+
+ http://www.ibm.com/chips/techlib/techlib.nsf/productfamilies/PowerPC
+ http://www.freescale.com/PowerPC
+
+
+
+----------------
+Local variables:
+mode: text
+fill-column: 76
+End:
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc32/addlsh1_n.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc32/addlsh1_n.asm
new file mode 100644
index 00000000000..71645c3ec32
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc32/addlsh1_n.asm
@@ -0,0 +1,100 @@
+dnl PowerPC-32 mpn_addlsh1_n -- rp[] = up[] + (vp[] << 1)
+
+dnl Copyright 2003, 2005, 2007 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 603e: ?
+C 604e: 4.0
+C 75x (G3): 5.0
+C 7400,7410 (G4): 5.0
+C 744x,745x (G4+): 5.0
+C power4/ppc970: 4.25
+C power5: 5.0
+
+C INPUT PARAMETERS
+C rp r3
+C up r4
+C vp r5
+C n r6
+
+define(`rp',`r3')
+define(`up',`r4')
+define(`vp',`r5')
+
+define(`s0',`r6')
+define(`s1',`r7')
+define(`u0',`r8')
+define(`v0',`r10')
+define(`v1',`r11')
+
+ASM_START()
+PROLOGUE(mpn_addlsh1_n)
+ mtctr r6 C copy n in ctr
+ addic r31, r31, 0 C clear cy
+
+ lwz v0, 0(vp) C load v limb
+ lwz u0, 0(up) C load u limb
+ addi up, up, -4 C update up
+ addi rp, rp, -4 C update rp
+ slwi s1, v0, 1
+ bdz L(end) C If done, skip loop
+
+L(loop):
+ lwz v1, 4(vp) C load v limb
+ adde s1, s1, u0 C add limbs with cy, set cy
+ srwi s0, v0, 31 C shift down previous v limb
+ stw s1, 4(rp) C store result limb
+ lwzu u0, 8(up) C load u limb and update up
+ rlwimi s0, v1, 1, 0,30 C left shift v limb and merge with prev v limb
+
+ bdz L(exit) C decrement ctr and exit if done
+
+ lwzu v0, 8(vp) C load v limb and update vp
+ adde s0, s0, u0 C add limbs with cy, set cy
+ srwi s1, v1, 31 C shift down previous v limb
+ stwu s0, 8(rp) C store result limb and update rp
+ lwz u0, 4(up) C load u limb
+ rlwimi s1, v0, 1, 0,30 C left shift v limb and merge with prev v limb
+
+ bdnz L(loop) C decrement ctr and loop back
+
+L(end): adde r7, s1, u0
+ srwi r4, v0, 31
+ stw r7, 4(rp) C store last result limb
+ addze r3, r4
+ blr
+L(exit):
+ adde r7, s0, u0
+ srwi r4, v1, 31
+ stw r7, 8(rp) C store last result limb
+ addze r3, r4
+ blr
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc32/addmul_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc32/addmul_1.asm
new file mode 100644
index 00000000000..7f47ab2ce72
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc32/addmul_1.asm
@@ -0,0 +1,155 @@
+dnl PowerPC-32 mpn_addmul_1 -- Multiply a limb vector with a limb and add the
+dnl result to a second limb vector.
+
+dnl Copyright 1995, 1997, 1998, 2000-2003, 2005 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 603e: ?
+C 604e: 6.75
+C 75x (G3): 8.7-14.3
+C 7400,7410 (G4): 8.7-14.3
+C 744x,745x (G4+): 9.5
+C power4/ppc970: 6.25
+C power5: 6.25
+
+C INPUT PARAMETERS
+C rp r3
+C up r4
+C n r5
+C vl r6
+
+C This is optimized for the PPC604. It has not been tuned for other
+C PowerPC processors.
+C
+C Loop Analysis for the 604:
+C 12 mem insn
+C 8 serializing insn
+C 8 int multiply
+C 25 int reg write
+C 9 int ops (8 of which serialize)
+C
+C The multiply insns need 16 cycles/4limb.
+C The integer register writes will need 13 cycles/4limb.
+C All-in-all, it should be possible to get to 4 or 5 cycles/limb on PPC604,
+C but that will require some clever FPNOPS and BNOPS for exact
+C issue control.
+
+
+ASM_START()
+PROLOGUE(mpn_addmul_1)
+ cmpwi cr0,r5,9 C more than 9 limbs?
+ bgt cr0,L(big) C branch if more than 9 limbs
+
+ mtctr r5
+ lwz r0,0(r4)
+ mullw r7,r0,r6
+ mulhwu r10,r0,r6
+ lwz r9,0(r3)
+ addc r8,r7,r9
+ addi r3,r3,-4
+ bdz L(end)
+L(loop):
+ lwzu r0,4(r4)
+ stwu r8,4(r3)
+ mullw r8,r0,r6
+ adde r7,r8,r10
+ mulhwu r10,r0,r6
+ lwz r9,4(r3)
+ addze r10,r10
+ addc r8,r7,r9
+ bdnz L(loop)
+L(end): stw r8,4(r3)
+ addze r3,r10
+ blr
+
+L(big): stmw r30,-32(r1)
+ addi r5,r5,-1
+ srwi r0,r5,2
+ mtctr r0
+
+ lwz r7,0(r4)
+ mullw r8,r7,r6
+ mulhwu r0,r7,r6
+ lwz r7,0(r3)
+ addc r8,r8,r7
+ stw r8,0(r3)
+
+L(loopU):
+ lwz r7,4(r4)
+ lwz r12,8(r4)
+ lwz r30,12(r4)
+ lwzu r31,16(r4)
+ mullw r8,r7,r6
+ mullw r9,r12,r6
+ mullw r10,r30,r6
+ mullw r11,r31,r6
+ adde r8,r8,r0 C add cy_limb
+ mulhwu r0,r7,r6
+ lwz r7,4(r3)
+ adde r9,r9,r0
+ mulhwu r0,r12,r6
+ lwz r12,8(r3)
+ adde r10,r10,r0
+ mulhwu r0,r30,r6
+ lwz r30,12(r3)
+ adde r11,r11,r0
+ mulhwu r0,r31,r6
+ lwz r31,16(r3)
+ addze r0,r0 C new cy_limb
+ addc r8,r8,r7
+ stw r8,4(r3)
+ adde r9,r9,r12
+ stw r9,8(r3)
+ adde r10,r10,r30
+ stw r10,12(r3)
+ adde r11,r11,r31
+ stwu r11,16(r3)
+ bdnz L(loopU)
+
+ andi. r31,r5,3
+ mtctr r31
+ beq cr0,L(endx)
+
+L(loopE):
+ lwzu r7,4(r4)
+ mullw r8,r7,r6
+ adde r8,r8,r0 C add cy_limb
+ mulhwu r0,r7,r6
+ lwz r7,4(r3)
+ addze r0,r0 C new cy_limb
+ addc r8,r8,r7
+ stwu r8,4(r3)
+ bdnz L(loopE)
+L(endx):
+ addze r3,r0
+ lmw r30,-32(r1)
+ blr
+EPILOGUE(mpn_addmul_1)
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc32/aix.m4 b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc32/aix.m4
new file mode 100644
index 00000000000..fde20200b24
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc32/aix.m4
@@ -0,0 +1,82 @@
+divert(-1)
+dnl m4 macros for AIX 32-bit assembly.
+
+dnl Copyright 2000-2002, 2005, 2006 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/.
+
+define(`ASM_START',
+` .toc')
+
+dnl Called: PROLOGUE_cpu(GSYM_PREFIX`'foo)
+dnl EPILOGUE_cpu(GSYM_PREFIX`'foo)
+dnl
+dnl Don't want ELF style .size in the epilogue.
+
+define(`PROLOGUE_cpu',
+m4_assert_numargs(1)
+ `
+ .globl $1
+ .globl .$1
+ .csect [DS], 2
+$1:
+ .long .$1, TOC[tc0], 0
+ .csect [PR]
+ .align 2
+.$1:')
+
+define(`EPILOGUE_cpu',
+m4_assert_numargs(1)
+`')
+
+define(`TOC_ENTRY', `')
+
+define(`LEA',
+m4_assert_numargs(2)
+`define(`TOC_ENTRY',
+` .toc
+tc$2:
+ .tc $2[TC], $2')'
+` lwz $1, tc$2(2)')
+
+define(`EXTERN',
+m4_assert_numargs(1)
+` .globl $1')
+
+define(`DEF_OBJECT',
+m4_assert_numargs_range(1,2)
+` .csect [RO], 3
+ ALIGN(ifelse($#,1,2,$2))
+$1:
+')
+
+define(`END_OBJECT',
+m4_assert_numargs(1))
+
+define(`ASM_END', `TOC_ENTRY')
+
+divert
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc32/aors_n.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc32/aors_n.asm
new file mode 100644
index 00000000000..25ece0966e9
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc32/aors_n.asm
@@ -0,0 +1,157 @@
+dnl PowerPC-32 mpn_add_n and mpn_sub_n.
+
+dnl Copyright 2002, 2005, 2007 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 603e: ?
+C 604e: ? old: 3.25
+C 75x (G3): ? old: 3.5
+C 7400,7410 (G4): 3.25
+C 744x,745x (G4+): 4
+C POWER3/PPC630 2
+C POWER4/PPC970 2.4
+C POWER5 2.75
+C POWER6 40-140
+C POWER7 3
+
+C INPUT PARAMETERS
+define(`rp', `r3')
+define(`up', `r4')
+define(`vp', `r5')
+define(`n', `r6')
+define(`cy', `r7')
+
+ifdef(`OPERATION_add_n', `
+ define(ADCSBC, adde)
+ define(func, mpn_add_n)
+ define(func_nc, mpn_add_nc)
+ define(IFADD, `$1')
+ define(IFSUB, `')')
+ifdef(`OPERATION_sub_n', `
+ define(ADCSBC, subfe)
+ define(func, mpn_sub_n)
+ define(func_nc, mpn_sub_nc)
+ define(IFADD, `')
+ define(IFSUB, `$1')')
+
+MULFUNC_PROLOGUE(mpn_add_n mpn_add_nc mpn_sub_n mpn_sub_nc)
+
+ASM_START()
+
+PROLOGUE(func_nc)
+IFADD(` addic r0, cy, -1') C set carry from argument
+IFSUB(` subfic r0, cy, 0') C set carry from argument
+ b L(ent)
+EPILOGUE()
+
+PROLOGUE(func)
+IFADD(` addic r0, n, 0') C clear carry
+IFSUB(` addic r0, n, -1') C set carry
+L(ent): andi. r0, n, 3
+ addi r3, r3, -12
+ addi n, n, 1
+ cmpwi cr7, r0, 2
+ srwi r0, n, 2
+ sub r4, r4, r3
+ sub r5, r5, r3
+ mtctr r0
+ bne cr0, L(n00)
+
+ lwzx r7, r4, r3 C n = 4, 8, 12, ...
+ lwzx r8, r5, r3
+ addi r3, r3, 4
+ lwzx r9, r4, r3
+ ADCSBC r7, r8, r7
+ lwzx r10, r5, r3
+ addi r3, r3, 4
+ b L(00)
+
+L(n00): bge cr7, L(n01)
+ cmpwi cr0, r0, 0 C n = 1, 5, 9, 13, ...
+ lwzx r0, r4, r3
+ lwzx r6, r5, r3
+ addi r3, r3, 4
+ ADCSBC r0, r6, r0
+ ble L(ret)
+L(gt1): lwzx r7, r4, r3
+ lwzx r8, r5, r3
+ addi r3, r3, 4
+ b L(01)
+
+L(n10):
+ lwzx r9, r4, r3 C n = 3, 7, 11, 15, ...
+ lwzx r10, r5, r3
+ addi r3, r3, 4
+ lwzx r11, r4, r3
+ ADCSBC r9, r10, r9
+ lwzx r12, r5, r3
+ addi r3, r3, 4
+ b L(11)
+
+L(n01): bne cr7, L(n10)
+ cmpwi cr0, r0, 0 C n = 2, 6, 10, 14, ...
+ lwzx r11, r4, r3
+ lwzx r12, r5, r3
+ addi r3, r3, 4
+ lwzx r0, r4, r3
+ ADCSBC r11, r12, r11
+ lwzx r6, r5, r3
+ addi r3, r3, 4
+ ble cr0, L(end)
+
+
+L(lp): lwzx r7, r4, r3
+ ADCSBC r0, r6, r0
+ lwzx r8, r5, r3
+ stwu r11, 4(r3)
+L(01): lwzx r9, r4, r3
+ ADCSBC r7, r8, r7
+ lwzx r10, r5, r3
+ stwu r0, 4(r3)
+L(00): lwzx r11, r4, r3
+ ADCSBC r9, r10, r9
+ lwzx r12, r5, r3
+ stwu r7, 4(r3)
+L(11): lwzx r0, r4, r3
+ ADCSBC r11, r12, r11
+ lwzx r6, r5, r3
+ stwu r9, 4(r3)
+ bdnz L(lp)
+
+L(end): ADCSBC r0, r6, r0
+ stw r11, 4(r3)
+L(ret): stw r0, 8(r3)
+IFADD(` li r3, 0 ')
+IFADD(` addze r3, r3 ')
+IFSUB(` subfe r3, r0, r0')
+IFSUB(` neg r3, r3')
+ blr
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc32/bdiv_dbm1c.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc32/bdiv_dbm1c.asm
new file mode 100644
index 00000000000..72b2c482e4d
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc32/bdiv_dbm1c.asm
@@ -0,0 +1,131 @@
+dnl PPC32 mpn_bdiv_dbm1c.
+
+dnl Copyright 2008 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 603e: ?
+C 604e: ?
+C 75x (G3): ?
+C 7400,7410 (G4): 9.43
+C 744x,745x (G4+): 6.28
+C power4/ppc970: ?
+C power5: ?
+
+C TODO
+C * Nothing to do...
+
+C INPUT PARAMETERS
+define(`rp', `r3')
+define(`up', `r4')
+define(`n', `r5')
+define(`bd', `r6')
+define(`cy', `r7')
+
+ASM_START()
+PROLOGUE(mpn_bdiv_dbm1c)
+ lwz r0, 0(r4)
+
+ rlwinm. r12, r5, 0,30,31
+ cmplwi cr6, r12, 2
+ cmplwi cr7, r5, 4
+ addi r5, r5, 1
+ srwi r5, r5, 2
+ mtctr r5
+ beq cr0, L(b00)
+ blt cr6, L(b01)
+ beq cr6, L(b10)
+
+L(b11): mullw r5, r0, r6
+ mulhwu r12, r0, r6
+ lwz r0, 4(r4)
+ addi r4, r4, -12
+ addi r3, r3, -12
+ b L(3)
+
+L(b00): mullw r9, r0, r6
+ mulhwu r8, r0, r6
+ lwz r0, 4(r4)
+ addi r4, r4, -8
+ addi r3, r3, -8
+ b L(0)
+
+L(b01): mullw r5, r0, r6
+ mulhwu r12, r0, r6
+ addi r3, r3, -4
+ ble cr7, L(e1)
+ lwz r0, 4(r4)
+ addi r4, r4, -4
+ b L(1)
+
+L(b10): mullw r9, r0, r6
+ mulhwu r8, r0, r6
+ lwz r0, 4(r4)
+ ble cr7, L(e2)
+
+ ALIGN(16)
+L(top): mullw r5, r0, r6
+ mulhwu r12, r0, r6
+ subfc r11, r9, r7
+ lwz r0, 8(r4)
+ subfe r7, r8, r11
+ stw r11, 0(r3)
+L(1): mullw r9, r0, r6
+ mulhwu r8, r0, r6
+ subfc r11, r5, r7
+ lwz r0, 12(r4)
+ subfe r7, r12, r11
+ stw r11, 4(r3)
+L(0): mullw r5, r0, r6
+ mulhwu r12, r0, r6
+ subfc r11, r9, r7
+ lwz r0, 16(r4)
+ subfe r7, r8, r11
+ stw r11, 8(r3)
+L(3): mullw r9, r0, r6
+ mulhwu r8, r0, r6
+ subfc r11, r5, r7
+ lwz r0, 20(r4)
+ subfe r7, r12, r11
+ stw r11, 12(r3)
+ addi r4, r4, 16
+ addi r3, r3, 16
+ bdnz L(top)
+
+L(e2): mullw r5, r0, r6
+ mulhwu r12, r0, r6
+ subfc r11, r9, r7
+ subfe r7, r8, r11
+ stw r11, 0(r3)
+L(e1): subfc r11, r5, r7
+ stw r11, 4(r3)
+ subfe r3, r12, r11
+ blr
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc32/darwin.m4 b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc32/darwin.m4
new file mode 100644
index 00000000000..db4226800b3
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc32/darwin.m4
@@ -0,0 +1,91 @@
+divert(-1)
+dnl m4 macros for Mac OS 32-bit assembly.
+
+dnl Copyright 2005, 2006 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/.
+
+define(`ASM_START',`')
+
+dnl Called: PROLOGUE_cpu(GSYM_PREFIX`'foo[,toc])
+dnl EPILOGUE_cpu(GSYM_PREFIX`'foo)
+dnl
+
+define(`PROLOGUE_cpu',
+m4_assert_numargs_range(1,2)
+`ifelse(`$2',toc,,
+`ifelse(`$2',,,`m4_error(`Unrecognised PROLOGUE parameter')')')dnl
+ .text
+ .globl $1
+ .align 3
+$1:')
+
+define(`EPILOGUE_cpu',
+m4_assert_numargs(1))
+
+
+dnl LEA -- Load Effective Address.
+
+define(`LEA',
+m4_assert_numargs(2)
+`ifdef(`PIC',
+` mflr r0 C save return address
+ bcl 20, 31, 1f
+1: mflr $1
+ addis $1, $1, ha16($2-1b)
+ la $1, lo16($2-1b)($1)
+ mtlr r0 C restore return address
+',`
+ lis $1, ha16($2)
+ la $1, lo16($2)($1)
+')')
+
+define(`LEAL',
+m4_assert_numargs(2)
+`LEA($1,$2)')
+
+
+define(`EXTERN',
+m4_assert_numargs(1)
+`dnl')
+
+define(`DEF_OBJECT',
+m4_assert_numargs_range(1,2)
+` .const
+ ALIGN(ifelse($#,1,2,$2))
+$1:
+')
+
+define(`END_OBJECT',
+m4_assert_numargs(1))
+
+define(`ASM_END', `dnl')
+
+ifdef(`PIC',`
+define(`PIC_SLOW')')
+
+divert
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc32/diveby3.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc32/diveby3.asm
new file mode 100644
index 00000000000..288a7d30ac8
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc32/diveby3.asm
@@ -0,0 +1,93 @@
+dnl PowerPC-32 mpn_divexact_by3 -- mpn by 3 exact division
+
+dnl Copyright 2002, 2003, 2005, 2006 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 603e: ?
+C 604e: 5
+C 75x (G3): ?
+C 7400,7410 (G4): 8
+C 744x,745x (G4+): 6
+C power4/ppc970: 12
+C power5: ?
+
+C void mpn_divexact_by3 (mp_ptr dst, mp_srcptr src, mp_size_t size);
+C
+C We avoid the slow subfe instruction and instead rely on an extremely unlikely
+C branch.
+C
+C The mullw has the inverse in the first operand, since 0xAA..AB won't allow
+C any early-out. The src[] data normally won't either, but there's at least
+C a chance, whereas 0xAA..AB never will. If, for instance, src[] is all
+C zeros (not a sensible input of course) we run at 7.0 c/l on ppc750.
+C
+C The mulhwu has the "3" multiplier in the second operand, which lets 750 and
+C 7400 use an early-out.
+
+C INPUT PARAMETERS
+define(`rp', `r3')
+define(`up', `r4')
+define(`n', `r5')
+define(`cy', `r6')
+
+ASM_START()
+PROLOGUE(mpn_divexact_by3c)
+ lwz r11, 0(up)
+ mtctr n
+ lis r12, 0xAAAA
+ ori r12, r12, 0xAAAB
+ li r10, 3
+
+ cmplw cr7, cy, r11
+ subf r11, cy, r11
+
+ mullw r0, r11, r12
+ stw r0, 0(rp)
+ bdz L(one)
+
+L(top): lwzu r9, 4(up)
+ mulhwu r7, r0, r10
+ bgt- cr7, L(adj) C very unlikely branch
+L(bko): cmplw cr7, r7, r9
+ subf r0, r7, r9
+ mullw r0, r12, r0
+ stwu r0, 4(rp)
+ bdnz L(top)
+
+L(one): mulhwu r3, r0, r10
+ blelr+ cr7
+ addi r3, r3, 1
+ blr
+
+L(adj): addi r7, r7, 1
+ b L(bko)
+EPILOGUE()
+ASM_END()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc32/divrem_2.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc32/divrem_2.asm
new file mode 100644
index 00000000000..c6e64efe233
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc32/divrem_2.asm
@@ -0,0 +1,182 @@
+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 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 frac
+C 7410 ~36.5 ~36.5
+C 744x, 745x 29 29
+
+C INPUT PARAMETERS
+C qp = r3
+C fn = r4
+C up = r5
+C un = r6
+C d = r7
+
+C TODO
+C * Decrease register usage.
+C * Make sure mul operands and optimal for early-out.
+C * Check that things work well for a shared library build.
+C * Write an invert_limb, perhaps inline, perhaps as a private call. Or at
+C least vastly improve the current __udiv_qrnnd_c based code.
+
+
+ASM_START()
+PROLOGUE(mpn_divrem_2)
+ stwu r1, -32(r1)
+ slwi r0, r6, 2
+ add r5, r5, r0
+ stmw r28, 8(r1)
+ addi r29, r5, -8 C up = up_param + un - 2
+ lwz r10, 4(r7)
+ lwz r12, 4(r29)
+ addi r8, r3, -12
+ lwz r7, 0(r7)
+ cmplw cr7, r12, r10
+ lwz r28, 0(r29)
+ blt- cr7, L(2)
+ bgt+ cr7, L(4)
+ cmplw cr7, r28, r7
+ blt- cr7, L(2)
+L(4): subfc r28, r7, r28
+ subfe r12, r10, r12
+ li r3, 1
+ b L(6)
+L(2): li r3, 0
+
+L(6): add r0, r4, r6
+ addic. r30, r0, -2
+ ble- cr0, L(ret)
+
+ slwi r9, r0, 2
+ add r8, r8, r9 C rp += un + fn
+ mtctr r30
+
+C Compute di from d1
+ srwi r11, r10, 16
+ nor r0, r10, r10
+ divwu r31, r0, r11
+ rlwinm r5, r10, 0, 16, 31
+ mullw r9, r11, r31
+ mullw r6, r5, r31
+ subf r0, r9, r0
+ slwi r0, r0, 16
+ ori r0, r0, 65535
+ cmplw cr7, r0, r6
+ bge- cr7, L(9)
+ add r0, r0, r10
+ cmplw cr7, r0, r10
+ cmplw cr6, r6, r0
+ addi r31, r31, -1 C q1--
+ crorc 28, 28, 25
+ bc+ 12, 28, L(9)
+ addi r31, r31, -1 C q1--
+ add r0, r0, r10
+L(9): subf r0, r6, r0
+ divwu r6, r0, r11
+ mullw r9, r11, r6
+ mullw r11, r5, r6
+ subf r0, r9, r0
+ slwi r0, r0, 16
+ ori r0, r0, 65535
+ cmplw cr7, r0, r11
+ bge- cr7, L(13)
+ add r0, r0, r10
+ cmplw cr7, r0, r10
+ cmplw cr6, r11, r0
+ addi r6, r6, -1 C q0--
+ crorc 28, 28, 25
+ bc+ 12, 28, 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
+
+C Adjust di by including d0
+ mullw r9, r10, r6 C t0 = LO(di * d1)
+ addc r11, r9, r7
+ subfe r0, r1, r1
+ mulhwu r9, r6, r7 C s1 = HI(di * d0)
+ addc r9, r11, r9
+ addze. r0, r0
+ blt cr0, L(17)
+L(18): subfc r9, r10, r9
+ addi r6, r6, -1
+ addme. r0, r0
+ bge+ cr0, L(18)
+L(17):
+
+C r0 r3 r4 r5 r6 r7 r8 r9 r10 r11 r12 r28 r29 r30 r31
+C msl di d0 qp d1 fn up un
+L(loop):
+ mullw r0, r12, r6 C q0 = LO(n2 * di)
+ cmpw cr7, r30, r4
+ addc r31, r0, r28 C q0 += n1
+ mulhwu r9, r12, r6 C q = HI(n2 * di)
+ adde r12, r9, r12 C q += n2
+ addi r30, r30, -1
+ mullw r0, r10, r12 C d1 * q
+ li r9, 0
+ subf r0, r0, r28 C n1 -= d1 * q
+ addi r5, r12, 1
+ ble- cr7, L(23)
+ lwzu r9, -4(r29)
+L(23): mullw r11, r12, r7 C t0 = LO(d0 * q)
+ subfc r28, r7, r9 C n0 -= d0
+ subfe r0, r10, r0 C n1 -= d1
+ mulhwu r12, r12, r7 C t1 = HI(d0 * q)
+ subfc r28, r11, r28 C n0 -= t0
+ subfe r12, r12, r0 C n1 -= t1
+ cmplw cr7, r12, r31
+ blt+ cr7, L(24)
+ addc r28, r28, r7
+ adde r12, r12, r10
+ addi r5, r5, -1
+L(24): cmplw cr7, r12, r10
+ bge- cr7, L(fix)
+L(bck): stw r5, 0(r8)
+ addi r8, r8, -4
+ bdnz L(loop)
+
+L(ret): stw r28, 0(r29)
+ stw r12, 4(r29)
+ lmw r28, 8(r1)
+ addi r1, r1, 32
+ blr
+
+L(fix): cmplw cr6, r28, r7
+ bgt+ cr7, L(28)
+ blt- cr6, L(bck)
+L(28): subfc r28, r7, r28
+ subfe r12, r10, r12
+ addi r5, r5, 1
+ b L(bck)
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc32/eabi.m4 b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc32/eabi.m4
new file mode 100644
index 00000000000..cd7633c6330
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc32/eabi.m4
@@ -0,0 +1,86 @@
+divert(-1)
+dnl m4 macros for powerpc32 eABI assembly.
+
+dnl Copyright 2003, 2005, 2006 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/.
+
+define(`ASM_START',`')
+
+dnl Called: PROLOGUE_cpu(GSYM_PREFIX`'foo)
+dnl EPILOGUE_cpu(GSYM_PREFIX`'foo)
+dnl
+
+define(`PROLOGUE_cpu',
+m4_assert_numargs(1)
+ `
+ .section ".text"
+ .align 3
+ .globl $1
+ .type $1, @function
+$1:')
+
+define(`EPILOGUE_cpu',
+m4_assert_numargs(1)
+` .size $1, .-$1')
+
+dnl This ought to support PIC, but it is unclear how that is done for eABI
+define(`LEA',
+m4_assert_numargs(2)
+`
+ lis $1, $2@ha
+ la $1, $2@l($1)
+')
+
+define(`EXTERN',
+m4_assert_numargs(1)
+`dnl')
+
+define(`DEF_OBJECT',
+m4_assert_numargs_range(1,2)
+`
+ .section .rodata
+ ALIGN(ifelse($#,1,2,$2))
+ .type $1, @object
+$1:
+')
+
+define(`END_OBJECT',
+m4_assert_numargs(1)
+` .size $1, .-$1')
+
+define(`ASM_END', `dnl')
+
+ifdef(`PIC',`
+define(`PIC_SLOW')')
+
+dnl 64-bit "long long" parameters are put in an even-odd pair, skipping an
+dnl even register if that was in turn. I wish somebody could explain why that
+dnl is a good idea.
+define(`BROKEN_LONGLONG_PARAM')
+
+divert
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc32/elf.m4 b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc32/elf.m4
new file mode 100644
index 00000000000..a64a1271ff8
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc32/elf.m4
@@ -0,0 +1,97 @@
+divert(-1)
+dnl m4 macros for powerpc32 GNU/Linux assembly.
+
+dnl Copyright 2003, 2005, 2006 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/.
+
+define(`ASM_START',`')
+
+dnl Called: PROLOGUE_cpu(GSYM_PREFIX`'foo[,toc])
+dnl EPILOGUE_cpu(GSYM_PREFIX`'foo)
+dnl
+
+define(`PROLOGUE_cpu',
+m4_assert_numargs_range(1,2)
+`ifelse(`$2',toc,,
+`ifelse(`$2',,,`m4_error(`Unrecognised PROLOGUE parameter')')')dnl
+ .section ".text"
+ .align 3
+ .globl $1
+ .type $1, @function
+$1:')
+
+define(`EPILOGUE_cpu',
+m4_assert_numargs(1)
+` .size $1, .-$1')
+
+define(`LEA',
+m4_assert_numargs(2)
+`ifdef(`PIC',`
+ mflr r0
+ bl _GLOBAL_OFFSET_TABLE_@local-4
+ mflr $1
+ mtlr r0
+ lwz $1, $2@got($1)
+',`
+ lis $1, $2@ha
+ la $1, $2@l($1)
+')')
+
+define(`LEAL',
+m4_assert_numargs(2)
+`LEA($1,$2)')
+
+
+define(`EXTERN',
+m4_assert_numargs(1)
+`dnl')
+
+define(`DEF_OBJECT',
+m4_assert_numargs_range(1,2)
+`
+ .section .rodata
+ ALIGN(ifelse($#,1,2,$2))
+ .type $1, @object
+$1:
+')
+
+define(`END_OBJECT',
+m4_assert_numargs(1)
+` .size $1, .-$1')
+
+define(`ASM_END', `dnl')
+
+ifdef(`PIC',`
+define(`PIC_SLOW')')
+
+dnl 64-bit "long long" parameters are put in an even-odd pair, skipping an
+dnl even register if that was in turn. I wish somebody could explain why that
+dnl is a good idea.
+define(`BROKEN_LONGLONG_PARAM')
+
+divert
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc32/gmp-mparam.h b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc32/gmp-mparam.h
new file mode 100644
index 00000000000..784a6d7b747
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc32/gmp-mparam.h
@@ -0,0 +1,217 @@
+/* PowerPC-32 gmp-mparam.h -- Compiler/machine parameter header file.
+
+Copyright 1991, 1993, 1994, 1999-2004, 2008-2010, 2014 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
+
+
+/* This file is supposed to be used for 604, 604e, 744x/745x/747x (G4+), i.e.,
+ 32-bit PowerPC processors with reasonably fast integer multiply insns. The
+ values below are chosen to be best for the latter processors, since 604 is
+ largely irrelevant today.
+
+ In mpn/powerpc32/750/gmp-mparam.h there are values for 75x (G3) and for
+ 7400/7410 (G4), both which have much slower multiply instructions. */
+
+/* 1417 MHz PPC 7447A */
+/* FFT tuning limit = 12500000 */
+/* Generated by tuneup.c, 2014-03-12, gcc 4.6 */
+
+#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 8
+#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 49
+#define PREINV_MOD_1_TO_MOD_1_THRESHOLD 18
+#define USE_PREINV_DIVREM_1 1
+#define DIV_QR_1N_PI1_METHOD 1
+#define DIV_QR_1_NORM_THRESHOLD 2
+#define DIV_QR_1_UNNORM_THRESHOLD 1
+#define DIV_QR_2_PI2_THRESHOLD MP_SIZE_T_MAX /* never */
+#define DIVEXACT_1_THRESHOLD 0 /* always */
+#define BMOD_1_TO_MOD_1_THRESHOLD 69
+
+#define MUL_TOOM22_THRESHOLD 14
+#define MUL_TOOM33_THRESHOLD 73
+#define MUL_TOOM44_THRESHOLD 106
+#define MUL_TOOM6H_THRESHOLD 156
+#define MUL_TOOM8H_THRESHOLD 236
+
+#define MUL_TOOM32_TO_TOOM43_THRESHOLD 73
+#define MUL_TOOM32_TO_TOOM53_THRESHOLD 71
+#define MUL_TOOM42_TO_TOOM53_THRESHOLD 73
+#define MUL_TOOM42_TO_TOOM63_THRESHOLD 72
+#define MUL_TOOM43_TO_TOOM54_THRESHOLD 82
+
+#define SQR_BASECASE_THRESHOLD 0 /* always */
+#define SQR_TOOM2_THRESHOLD 22
+#define SQR_TOOM3_THRESHOLD 74
+#define SQR_TOOM4_THRESHOLD 130
+#define SQR_TOOM6_THRESHOLD 189
+#define SQR_TOOM8_THRESHOLD 284
+
+#define MULMID_TOOM42_THRESHOLD 32
+
+#define MULMOD_BNM1_THRESHOLD 9
+#define SQRMOD_BNM1_THRESHOLD 14
+
+#define MUL_FFT_MODF_THRESHOLD 284 /* k = 5 */
+#define MUL_FFT_TABLE3 \
+ { { 284, 5}, { 15, 6}, { 8, 5}, { 17, 6}, \
+ { 17, 7}, { 9, 6}, { 20, 7}, { 11, 6}, \
+ { 23, 7}, { 13, 8}, { 7, 7}, { 19, 8}, \
+ { 11, 7}, { 25, 9}, { 7, 8}, { 15, 7}, \
+ { 33, 8}, { 19, 7}, { 39, 8}, { 23, 7}, \
+ { 47, 8}, { 27, 9}, { 15, 8}, { 39, 9}, \
+ { 23, 8}, { 47,10}, { 15, 9}, { 31, 8}, \
+ { 67, 9}, { 39, 8}, { 79, 9}, { 47, 8}, \
+ { 95,10}, { 31, 9}, { 71, 8}, { 143, 9}, \
+ { 79,10}, { 47, 9}, { 95,11}, { 31,10}, \
+ { 63, 9}, { 127, 8}, { 255, 9}, { 135, 8}, \
+ { 271, 9}, { 143,10}, { 79, 9}, { 159, 8}, \
+ { 319, 9}, { 175,10}, { 95, 9}, { 191, 8}, \
+ { 383, 9}, { 207, 8}, { 415,11}, { 63,10}, \
+ { 127, 9}, { 255, 8}, { 511, 9}, { 271,10}, \
+ { 143, 9}, { 287, 8}, { 575,10}, { 159, 9}, \
+ { 319,10}, { 175,11}, { 95,10}, { 191, 9}, \
+ { 383,10}, { 207, 9}, { 415, 8}, { 831,12}, \
+ { 63,11}, { 127,10}, { 255, 9}, { 511,10}, \
+ { 271, 9}, { 543, 8}, { 1087,10}, { 287, 9}, \
+ { 575,11}, { 159,10}, { 319, 9}, { 639,10}, \
+ { 351, 9}, { 703,11}, { 191,10}, { 415, 9}, \
+ { 831,11}, { 223,10}, { 447, 9}, { 895,10}, \
+ { 479, 9}, { 959,12}, { 127,11}, { 255,10}, \
+ { 543, 9}, { 1087,11}, { 287,10}, { 575,11}, \
+ { 319,10}, { 639,11}, { 351,10}, { 703, 9}, \
+ { 1407,12}, { 191,11}, { 383,10}, { 767,11}, \
+ { 415,10}, { 831,11}, { 447,10}, { 895,11}, \
+ { 479,10}, { 959,13}, { 127,12}, { 255,11}, \
+ { 543,10}, { 1087,11}, { 607,12}, { 319,11}, \
+ { 639,10}, { 1279,11}, { 703,10}, { 1407,12}, \
+ { 383,11}, { 831,12}, { 447,11}, { 959,13}, \
+ { 255,12}, { 511,11}, { 1087,12}, { 575,11}, \
+ { 1215,10}, { 2431,12}, { 639,11}, { 1279,12}, \
+ { 703,11}, { 1407,13}, { 383,12}, { 895,11}, \
+ { 1791,12}, { 959,14}, { 255,13}, { 511,12}, \
+ { 1215,11}, { 2431,13}, { 639,12}, { 1471,13}, \
+ { 767,12}, { 1599,13}, { 895,12}, { 1919,14}, \
+ { 511,13}, { 1023,12}, { 2111,13}, { 1151,12}, \
+ { 2431,13}, { 1407,14}, { 16384,15}, { 32768,16} }
+#define MUL_FFT_TABLE3_SIZE 160
+#define MUL_FFT_THRESHOLD 3712
+
+#define SQR_FFT_MODF_THRESHOLD 248 /* k = 5 */
+#define SQR_FFT_TABLE3 \
+ { { 248, 5}, { 17, 6}, { 9, 5}, { 19, 6}, \
+ { 17, 7}, { 9, 6}, { 20, 7}, { 11, 6}, \
+ { 23, 7}, { 13, 8}, { 7, 7}, { 19, 8}, \
+ { 11, 7}, { 25, 9}, { 7, 8}, { 15, 7}, \
+ { 33, 8}, { 19, 7}, { 39, 8}, { 27, 9}, \
+ { 15, 8}, { 39, 9}, { 23, 8}, { 47,10}, \
+ { 15, 9}, { 31, 8}, { 67, 9}, { 39, 8}, \
+ { 79, 9}, { 47, 8}, { 95,10}, { 31, 9}, \
+ { 63, 8}, { 127, 9}, { 71, 8}, { 143, 9}, \
+ { 79,10}, { 47, 9}, { 95,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, 9}, { 207, 8}, { 415, 7}, { 831,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,10}, { 207, 9}, { 415, 8}, \
+ { 831,12}, { 63,11}, { 127,10}, { 255, 9}, \
+ { 511,10}, { 271, 9}, { 543,10}, { 287, 9}, \
+ { 575,11}, { 159,10}, { 319, 9}, { 639,10}, \
+ { 351, 9}, { 703,11}, { 191,10}, { 383, 9}, \
+ { 767,10}, { 415, 9}, { 831,11}, { 223,10}, \
+ { 447, 9}, { 895,12}, { 127,11}, { 255,10}, \
+ { 543,11}, { 287,10}, { 607,11}, { 319,10}, \
+ { 639,11}, { 351,10}, { 703, 9}, { 1407,12}, \
+ { 191,11}, { 383,10}, { 767,11}, { 415,10}, \
+ { 831,11}, { 447,10}, { 895,11}, { 479,13}, \
+ { 127,12}, { 255,11}, { 543,10}, { 1087,11}, \
+ { 607,12}, { 319,11}, { 639,10}, { 1279,11}, \
+ { 703,10}, { 1407,12}, { 383,11}, { 831,12}, \
+ { 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}, { 1919,14}, { 511,13}, { 1023,12}, \
+ { 2111,13}, { 1151,12}, { 2431,13}, { 1407,14}, \
+ { 16384,15}, { 32768,16} }
+#define SQR_FFT_TABLE3_SIZE 154
+#define SQR_FFT_THRESHOLD 2688
+
+#define MULLO_BASECASE_THRESHOLD 0 /* always */
+#define MULLO_DC_THRESHOLD 45
+#define MULLO_MUL_N_THRESHOLD 6633
+
+#define DC_DIV_QR_THRESHOLD 44
+#define DC_DIVAPPR_Q_THRESHOLD 142
+#define DC_BDIV_QR_THRESHOLD 54
+#define DC_BDIV_Q_THRESHOLD 124
+
+#define INV_MULMOD_BNM1_THRESHOLD 43
+#define INV_NEWTON_THRESHOLD 179
+#define INV_APPR_THRESHOLD 157
+
+#define BINV_NEWTON_THRESHOLD 214
+#define REDC_1_TO_REDC_N_THRESHOLD 55
+
+#define MU_DIV_QR_THRESHOLD 998
+#define MU_DIVAPPR_Q_THRESHOLD 1078
+#define MUPI_DIV_QR_THRESHOLD 84
+#define MU_BDIV_QR_THRESHOLD 872
+#define MU_BDIV_Q_THRESHOLD 1078
+
+#define POWM_SEC_TABLE 1,19,102,428,1378
+
+#define MATRIX22_STRASSEN_THRESHOLD 12
+#define HGCD_THRESHOLD 120
+#define HGCD_APPR_THRESHOLD 166
+#define HGCD_REDUCE_THRESHOLD 1679
+#define GCD_DC_THRESHOLD 339
+#define GCDEXT_DC_THRESHOLD 273
+#define JACOBI_BASE_METHOD 4
+
+#define GET_STR_DC_THRESHOLD 12
+#define GET_STR_PRECOMPUTE_THRESHOLD 27
+#define SET_STR_DC_THRESHOLD 781
+#define SET_STR_PRECOMPUTE_THRESHOLD 1505
+
+#define FAC_DSC_THRESHOLD 141
+#define FAC_ODD_THRESHOLD 29
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc32/invert_limb.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc32/invert_limb.asm
new file mode 100644
index 00000000000..612bfe523c7
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc32/invert_limb.asm
@@ -0,0 +1,142 @@
+dnl PowerPC-32 mpn_invert_limb -- Invert a normalized limb.
+
+dnl Copyright 2011 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 603e: ?
+C 604e: ?
+C 75x (G3): ?
+C 7400,7410 (G4): ?
+C 744x,745x (G4+): 32
+C power4/ppc970: ?
+C power5: ?
+
+EXTERN(approx_tab)
+
+ASM_START()
+PROLOGUE(mpn_invert_limb)
+ rlwinm r6, r3, 11, 22, 30 C extract bits 30..22 to pos 2^1
+ srwi r10, r3, 11 C extract bits 31..11
+ LEA( r9, approx_tab) C N.B. clobbers r0 for ELF and Darwin
+ lhzx r9, r9, r6 C w2
+ addi r0, r10, 1
+ mullw r11, r9, r9
+ slwi r9, r9, 4
+ mulhwu r7, r11, r0
+ rlwinm r11, r3, 0, 31, 31 C extract bit 0
+ addi r0, r9, -1
+ srwi r9, r3, 1 C d >> 1
+ subf r0, r7, r0 C w1
+ add r9, r9, r11 C d31
+ mullw r9, r0, r9 C w1 * d31
+ srwi r10, r0, 1 C w1 >> 1
+ neg r11, r11
+ and r11, r10, r11
+ subf r11, r9, r11
+ mulhwu r9, r11, r0
+ slwi r0, r0, 15
+ srwi r9, r9, 1
+ add r0, r9, r0 C w0
+ mullw r10, r0, r3
+ mulhwu r9, r0, r3
+ addc r11, r10, r3
+ adde r3, r9, r3
+ subf r3, r3, r0
+ blr
+EPILOGUE()
+
+DEF_OBJECT(approx_tab)
+ .short 0x7fe1,0x7fa1,0x7f61,0x7f22,0x7ee3,0x7ea4,0x7e65,0x7e27
+ .short 0x7de9,0x7dab,0x7d6d,0x7d30,0x7cf3,0x7cb6,0x7c79,0x7c3d
+ .short 0x7c00,0x7bc4,0x7b89,0x7b4d,0x7b12,0x7ad7,0x7a9c,0x7a61
+ .short 0x7a27,0x79ec,0x79b2,0x7979,0x793f,0x7906,0x78cc,0x7894
+ .short 0x785b,0x7822,0x77ea,0x77b2,0x777a,0x7742,0x770b,0x76d3
+ .short 0x769c,0x7665,0x762f,0x75f8,0x75c2,0x758c,0x7556,0x7520
+ .short 0x74ea,0x74b5,0x7480,0x744b,0x7416,0x73e2,0x73ad,0x7379
+ .short 0x7345,0x7311,0x72dd,0x72aa,0x7277,0x7243,0x7210,0x71de
+ .short 0x71ab,0x7179,0x7146,0x7114,0x70e2,0x70b1,0x707f,0x704e
+ .short 0x701c,0x6feb,0x6fba,0x6f8a,0x6f59,0x6f29,0x6ef9,0x6ec8
+ .short 0x6e99,0x6e69,0x6e39,0x6e0a,0x6ddb,0x6dab,0x6d7d,0x6d4e
+ .short 0x6d1f,0x6cf1,0x6cc2,0x6c94,0x6c66,0x6c38,0x6c0a,0x6bdd
+ .short 0x6bb0,0x6b82,0x6b55,0x6b28,0x6afb,0x6acf,0x6aa2,0x6a76
+ .short 0x6a49,0x6a1d,0x69f1,0x69c6,0x699a,0x696e,0x6943,0x6918
+ .short 0x68ed,0x68c2,0x6897,0x686c,0x6842,0x6817,0x67ed,0x67c3
+ .short 0x6799,0x676f,0x6745,0x671b,0x66f2,0x66c8,0x669f,0x6676
+ .short 0x664d,0x6624,0x65fc,0x65d3,0x65aa,0x6582,0x655a,0x6532
+ .short 0x650a,0x64e2,0x64ba,0x6493,0x646b,0x6444,0x641c,0x63f5
+ .short 0x63ce,0x63a7,0x6381,0x635a,0x6333,0x630d,0x62e7,0x62c1
+ .short 0x629a,0x6275,0x624f,0x6229,0x6203,0x61de,0x61b8,0x6193
+ .short 0x616e,0x6149,0x6124,0x60ff,0x60da,0x60b6,0x6091,0x606d
+ .short 0x6049,0x6024,0x6000,0x5fdc,0x5fb8,0x5f95,0x5f71,0x5f4d
+ .short 0x5f2a,0x5f07,0x5ee3,0x5ec0,0x5e9d,0x5e7a,0x5e57,0x5e35
+ .short 0x5e12,0x5def,0x5dcd,0x5dab,0x5d88,0x5d66,0x5d44,0x5d22
+ .short 0x5d00,0x5cde,0x5cbd,0x5c9b,0x5c7a,0x5c58,0x5c37,0x5c16
+ .short 0x5bf5,0x5bd4,0x5bb3,0x5b92,0x5b71,0x5b51,0x5b30,0x5b10
+ .short 0x5aef,0x5acf,0x5aaf,0x5a8f,0x5a6f,0x5a4f,0x5a2f,0x5a0f
+ .short 0x59ef,0x59d0,0x59b0,0x5991,0x5972,0x5952,0x5933,0x5914
+ .short 0x58f5,0x58d6,0x58b7,0x5899,0x587a,0x585b,0x583d,0x581f
+ .short 0x5800,0x57e2,0x57c4,0x57a6,0x5788,0x576a,0x574c,0x572e
+ .short 0x5711,0x56f3,0x56d5,0x56b8,0x569b,0x567d,0x5660,0x5643
+ .short 0x5626,0x5609,0x55ec,0x55cf,0x55b2,0x5596,0x5579,0x555d
+ .short 0x5540,0x5524,0x5507,0x54eb,0x54cf,0x54b3,0x5497,0x547b
+ .short 0x545f,0x5443,0x5428,0x540c,0x53f0,0x53d5,0x53b9,0x539e
+ .short 0x5383,0x5368,0x534c,0x5331,0x5316,0x52fb,0x52e0,0x52c6
+ .short 0x52ab,0x5290,0x5276,0x525b,0x5240,0x5226,0x520c,0x51f1
+ .short 0x51d7,0x51bd,0x51a3,0x5189,0x516f,0x5155,0x513b,0x5121
+ .short 0x5108,0x50ee,0x50d5,0x50bb,0x50a2,0x5088,0x506f,0x5056
+ .short 0x503c,0x5023,0x500a,0x4ff1,0x4fd8,0x4fbf,0x4fa6,0x4f8e
+ .short 0x4f75,0x4f5c,0x4f44,0x4f2b,0x4f13,0x4efa,0x4ee2,0x4eca
+ .short 0x4eb1,0x4e99,0x4e81,0x4e69,0x4e51,0x4e39,0x4e21,0x4e09
+ .short 0x4df1,0x4dda,0x4dc2,0x4daa,0x4d93,0x4d7b,0x4d64,0x4d4d
+ .short 0x4d35,0x4d1e,0x4d07,0x4cf0,0x4cd8,0x4cc1,0x4caa,0x4c93
+ .short 0x4c7d,0x4c66,0x4c4f,0x4c38,0x4c21,0x4c0b,0x4bf4,0x4bde
+ .short 0x4bc7,0x4bb1,0x4b9a,0x4b84,0x4b6e,0x4b58,0x4b41,0x4b2b
+ .short 0x4b15,0x4aff,0x4ae9,0x4ad3,0x4abd,0x4aa8,0x4a92,0x4a7c
+ .short 0x4a66,0x4a51,0x4a3b,0x4a26,0x4a10,0x49fb,0x49e5,0x49d0
+ .short 0x49bb,0x49a6,0x4990,0x497b,0x4966,0x4951,0x493c,0x4927
+ .short 0x4912,0x48fe,0x48e9,0x48d4,0x48bf,0x48ab,0x4896,0x4881
+ .short 0x486d,0x4858,0x4844,0x482f,0x481b,0x4807,0x47f3,0x47de
+ .short 0x47ca,0x47b6,0x47a2,0x478e,0x477a,0x4766,0x4752,0x473e
+ .short 0x472a,0x4717,0x4703,0x46ef,0x46db,0x46c8,0x46b4,0x46a1
+ .short 0x468d,0x467a,0x4666,0x4653,0x4640,0x462c,0x4619,0x4606
+ .short 0x45f3,0x45e0,0x45cd,0x45ba,0x45a7,0x4594,0x4581,0x456e
+ .short 0x455b,0x4548,0x4536,0x4523,0x4510,0x44fe,0x44eb,0x44d8
+ .short 0x44c6,0x44b3,0x44a1,0x448f,0x447c,0x446a,0x4458,0x4445
+ .short 0x4433,0x4421,0x440f,0x43fd,0x43eb,0x43d9,0x43c7,0x43b5
+ .short 0x43a3,0x4391,0x437f,0x436d,0x435c,0x434a,0x4338,0x4327
+ .short 0x4315,0x4303,0x42f2,0x42e0,0x42cf,0x42bd,0x42ac,0x429b
+ .short 0x4289,0x4278,0x4267,0x4256,0x4244,0x4233,0x4222,0x4211
+ .short 0x4200,0x41ef,0x41de,0x41cd,0x41bc,0x41ab,0x419a,0x418a
+ .short 0x4179,0x4168,0x4157,0x4147,0x4136,0x4125,0x4115,0x4104
+ .short 0x40f4,0x40e3,0x40d3,0x40c2,0x40b2,0x40a2,0x4091,0x4081
+ .short 0x4071,0x4061,0x4050,0x4040,0x4030,0x4020,0x4010,0x4000
+END_OBJECT(approx_tab)
+ASM_END()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc32/lshift.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc32/lshift.asm
new file mode 100644
index 00000000000..948f8c6cf3e
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc32/lshift.asm
@@ -0,0 +1,166 @@
+dnl PowerPC-32 mpn_lshift -- Shift a number left.
+
+dnl Copyright 1995, 1998, 2000, 2002-2005 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 603e: ?
+C 604e: 3.0
+C 75x (G3): 3.0
+C 7400,7410 (G4): 3.0
+C 7445,7455 (G4+): 2.5
+C 7447,7457 (G4+): 2.25
+C power4/ppc970: 2.5
+C power5: 2.5
+
+C INPUT PARAMETERS
+C rp r3
+C up r4
+C n r5
+C cnt r6
+
+ASM_START()
+PROLOGUE(mpn_lshift)
+ cmpwi cr0, r5, 30 C more than 30 limbs?
+ slwi r0, r5, 2
+ add r4, r4, r0 C make r4 point at end of s1
+ add r7, r3, r0 C make r7 point at end of res
+ bgt L(BIG) C branch if more than 12 limbs
+
+ mtctr r5 C copy size into CTR
+ subfic r8, r6, 32
+ lwzu r11, -4(r4) C load first s1 limb
+ srw r3, r11, r8 C compute function return value
+ bdz L(end1)
+
+L(oop): lwzu r10, -4(r4)
+ slw r9, r11, r6
+ srw r12, r10, r8
+ or r9, r9, r12
+ stwu r9, -4(r7)
+ bdz L(end2)
+ lwzu r11, -4(r4)
+ slw r9, r10, r6
+ srw r12, r11, r8
+ or r9, r9, r12
+ stwu r9, -4(r7)
+ bdnz L(oop)
+
+L(end1):
+ slw r0, r11, r6
+ stw r0, -4(r7)
+ blr
+L(end2):
+ slw r0, r10, r6
+ stw r0, -4(r7)
+ blr
+
+L(BIG):
+ stmw r24, -32(r1) C save registers we are supposed to preserve
+ lwzu r9, -4(r4)
+ subfic r8, r6, 32
+ srw r3, r9, r8 C compute function return value
+ slw r0, r9, r6
+ addi r5, r5, -1
+
+ andi. r10, r5, 3 C count for spill loop
+ beq L(e)
+ mtctr r10
+ lwzu r28, -4(r4)
+ bdz L(xe0)
+
+L(loop0):
+ slw r12, r28, r6
+ srw r24, r28, r8
+ lwzu r28, -4(r4)
+ or r24, r0, r24
+ stwu r24, -4(r7)
+ mr r0, r12
+ bdnz L(loop0) C taken at most once!
+
+L(xe0): slw r12, r28, r6
+ srw r24, r28, r8
+ or r24, r0, r24
+ stwu r24, -4(r7)
+ mr r0, r12
+
+L(e): srwi r5, r5, 2 C count for unrolled loop
+ addi r5, r5, -1
+ mtctr r5
+ lwz r28, -4(r4)
+ lwz r29, -8(r4)
+ lwz r30, -12(r4)
+ lwzu r31, -16(r4)
+
+L(loopU):
+ slw r9, r28, r6
+ srw r24, r28, r8
+ lwz r28, -4(r4)
+ slw r10, r29, r6
+ srw r25, r29, r8
+ lwz r29, -8(r4)
+ slw r11, r30, r6
+ srw r26, r30, r8
+ lwz r30, -12(r4)
+ slw r12, r31, r6
+ srw r27, r31, r8
+ lwzu r31, -16(r4)
+ or r24, r0, r24
+ stw r24, -4(r7)
+ or r25, r9, r25
+ stw r25, -8(r7)
+ or r26, r10, r26
+ stw r26, -12(r7)
+ or r27, r11, r27
+ stwu r27, -16(r7)
+ mr r0, r12
+ bdnz L(loopU)
+
+ slw r9, r28, r6
+ srw r24, r28, r8
+ slw r10, r29, r6
+ srw r25, r29, r8
+ slw r11, r30, r6
+ srw r26, r30, r8
+ slw r12, r31, r6
+ srw r27, r31, r8
+ or r24, r0, r24
+ stw r24, -4(r7)
+ or r25, r9, r25
+ stw r25, -8(r7)
+ or r26, r10, r26
+ stw r26, -12(r7)
+ or r27, r11, r27
+ stw r27, -16(r7)
+
+ stw r12, -20(r7)
+ lmw r24, -32(r1) C restore registers
+ blr
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc32/lshiftc.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc32/lshiftc.asm
new file mode 100644
index 00000000000..61606d1b66e
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc32/lshiftc.asm
@@ -0,0 +1,168 @@
+dnl PowerPC-32 mpn_lshiftc.
+
+dnl Copyright 1995, 1998, 2000, 2002-2005, 2010 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 603e: ?
+C 604e: 3.0
+C 75x (G3): 3.0
+C 7400,7410 (G4): 3.0
+C 7445,7455 (G4+): 2.5
+C 7447,7457 (G4+): 2.25
+C power4/ppc970: 2.5
+C power5: 2.5
+
+C INPUT PARAMETERS
+C rp r3
+C up r4
+C n r5
+C cnt r6
+
+ASM_START()
+PROLOGUE(mpn_lshiftc)
+ cmpwi cr0, r5, 30 C more than 30 limbs?
+ slwi r0, r5, 2
+ add r4, r4, r0 C make r4 point at end of s1
+ add r7, r3, r0 C make r7 point at end of res
+ bgt L(BIG) C branch if more than 12 limbs
+
+ mtctr r5 C copy size into CTR
+ subfic r8, r6, 32
+ lwzu r11, -4(r4) C load first s1 limb
+ srw r3, r11, r8 C compute function return value
+ bdz L(end1)
+
+L(oop): lwzu r10, -4(r4)
+ slw r9, r11, r6
+ srw r12, r10, r8
+ nor r9, r9, r12
+ stwu r9, -4(r7)
+ bdz L(end2)
+ lwzu r11, -4(r4)
+ slw r9, r10, r6
+ srw r12, r11, r8
+ nor r9, r9, r12
+ stwu r9, -4(r7)
+ bdnz L(oop)
+
+L(end1):
+ slw r0, r11, r6
+ nor r0, r0, r0
+ stw r0, -4(r7)
+ blr
+L(end2):
+ slw r0, r10, r6
+ nor r0, r0, r0
+ stw r0, -4(r7)
+ blr
+
+L(BIG):
+ stmw r24, -32(r1) C save registers we are supposed to preserve
+ lwzu r9, -4(r4)
+ subfic r8, r6, 32
+ srw r3, r9, r8 C compute function return value
+ slw r0, r9, r6
+ addi r5, r5, -1
+
+ andi. r10, r5, 3 C count for spill loop
+ beq L(e)
+ mtctr r10
+ lwzu r28, -4(r4)
+ bdz L(xe0)
+
+L(loop0):
+ slw r12, r28, r6
+ srw r24, r28, r8
+ lwzu r28, -4(r4)
+ nor r24, r0, r24
+ stwu r24, -4(r7)
+ mr r0, r12
+ bdnz L(loop0) C taken at most once!
+
+L(xe0): slw r12, r28, r6
+ srw r24, r28, r8
+ nor r24, r0, r24
+ stwu r24, -4(r7)
+ mr r0, r12
+
+L(e): srwi r5, r5, 2 C count for unrolled loop
+ addi r5, r5, -1
+ mtctr r5
+ lwz r28, -4(r4)
+ lwz r29, -8(r4)
+ lwz r30, -12(r4)
+ lwzu r31, -16(r4)
+
+L(loopU):
+ slw r9, r28, r6
+ srw r24, r28, r8
+ lwz r28, -4(r4)
+ slw r10, r29, r6
+ srw r25, r29, r8
+ lwz r29, -8(r4)
+ slw r11, r30, r6
+ srw r26, r30, r8
+ lwz r30, -12(r4)
+ slw r12, r31, r6
+ srw r27, r31, r8
+ lwzu r31, -16(r4)
+ nor r24, r0, r24
+ stw r24, -4(r7)
+ nor r25, r9, r25
+ stw r25, -8(r7)
+ nor r26, r10, r26
+ stw r26, -12(r7)
+ nor r27, r11, r27
+ stwu r27, -16(r7)
+ mr r0, r12
+ bdnz L(loopU)
+
+ slw r9, r28, r6
+ srw r24, r28, r8
+ slw r10, r29, r6
+ srw r25, r29, r8
+ slw r11, r30, r6
+ srw r26, r30, r8
+ slw r12, r31, r6
+ srw r27, r31, r8
+ nor r24, r0, r24
+ stw r24, -4(r7)
+ nor r25, r9, r25
+ stw r25, -8(r7)
+ nor r26, r10, r26
+ stw r26, -12(r7)
+ nor r27, r11, r27
+ stw r27, -16(r7)
+ nor r12, r12, r12
+ stw r12, -20(r7)
+ lmw r24, -32(r1) C restore registers
+ blr
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc32/mod_34lsub1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc32/mod_34lsub1.asm
new file mode 100644
index 00000000000..6d7fe4d0890
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc32/mod_34lsub1.asm
@@ -0,0 +1,145 @@
+dnl PowerPC-32 mpn_mod_34lsub1 -- mpn remainder mod 2^24-1.
+
+dnl Copyright 2002, 2003, 2005 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 603e: ?
+C 604e: 3
+C 75x (G3): 3
+C 7400,7410 (G4): 3
+C 744x,745x (G4+): 3
+C power4/ppc970: 2.5
+C power5: 2.5
+
+C mp_limb_t mpn_mod_34lsub1 (mp_srcptr src, mp_size_t size)
+C
+C There seems no need to schedule the loads back, the code is still 3.0 c/l
+C on 750/7400 no matter where they're placed.
+C
+C Alternatives:
+C
+C Fetching half words would allow add instead for accumulating, instead of
+C adde and its serialization. An outer loop would be required though, since
+C 2^16 halfwords can overflow. lhz+add would be 2.0 c/l, but if there's
+C also a bdz or bdnz for each and a pointer update say every three limbs
+C then the total would be 2.67 c/l which isn't much faster than the current
+C simpler code.
+
+ASM_START()
+PROLOGUE(mpn_mod_34lsub1)
+
+ C r3 src
+ C r4 size
+
+ mtctr r4
+ addic r6, r3, 8 C &src[2], and clear CA
+
+ lwz r3, 0(r3) C acc0 = src[0]
+ bdz L(done)
+
+ lwz r4, -4(r6) C acc1 = src[1]
+ bdz L(two)
+
+ lwz r5, 0(r6) C acc2 = src[2]
+ lis r7, 0 C no carry if just three limbs
+
+ bdz L(three)
+ lis r7, 1 C 0x10000 carry pos
+
+L(top):
+ C r3 acc0
+ C r4 acc1
+ C r5 acc2
+ C r6 src, incrementing
+ C r7 carry pos
+
+ lwz r0, 4(r6)
+ adde r3, r3, r0
+ bdz L(end0)
+
+ lwz r0, 8(r6)
+ adde r4, r4, r0
+ bdz L(end1)
+
+ lwzu r0, 12(r6)
+ adde r5, r5, r0
+ bdnz L(top)
+
+
+ srwi r7, r7, 8
+L(end0):
+ srwi r7, r7, 8
+L(end1):
+ subfe r0, r0, r0 C -1 if not CA
+
+ andc r7, r7, r0 C final carry, 0x10000, 0x100, 1 or 0
+L(three):
+ rlwinm r6, r3, 0,8,31 C acc0 low
+
+ add r7, r7, r6
+ rlwinm r6, r3, 8,24,31 C acc0 high
+
+ add r7, r7, r6
+ rlwinm r6, r4, 8,8,23 C acc1 low
+
+ add r7, r7, r6
+ rlwinm r6, r4, 16,16,31 C acc1 high
+
+ add r7, r7, r6
+ rlwinm r6, r5, 16,8,15 C acc2 low
+
+ add r7, r7, r6
+ rlwinm r6, r5, 24,8,31 C acc2 high
+
+ add r3, r7, r6
+
+L(done):
+ blr
+
+L(two):
+ C r3 acc0
+ C r4 acc1
+
+ rlwinm r5, r3, 8,24,31 C acc0 high
+ rlwinm r3, r3, 0,8,31 C acc0 low
+
+ add r3, r3, r5 C acc0 high + low
+ rlwinm r5, r4, 16,16,31 C acc1 high
+
+ add r3, r3, r5 C add acc1 high
+ rlwinm r5, r4, 8,8,23 C acc1 low
+
+ add r3, r3, r5 C add acc1 low
+
+ blr
+
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc32/mode1o.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc32/mode1o.asm
new file mode 100644
index 00000000000..e8a6b5e28ad
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc32/mode1o.asm
@@ -0,0 +1,127 @@
+dnl PowerPC-32 mpn_modexact_1_odd -- mpn by limb exact remainder.
+
+dnl Copyright 2002, 2003, 2005, 2006 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 603e: ?
+C 604e: 6.0
+C 75x (G3): 6.0-13.0, depending on divisor
+C 7400,7410 (G4): 6.0-13.0, depending on divisor
+C 744x,745x (G4+): 8.0-10.0, depending on divisor
+C power4/ppc970: 12.0
+C power5: 12.0
+
+
+C mp_limb_t mpn_modexact_1_odd (mp_srcptr src, mp_size_t size,
+C mp_limb_t divisor);
+C mp_limb_t mpn_modexact_1c_odd (mp_srcptr src, mp_size_t size,
+C mp_limb_t divisor, mp_limb_t carry);
+C
+C For PIC, the inverse is established arithmetically since it measures about
+C 5 cycles faster than the nonsense needed to access binvert_limb_table in
+C SVR4 or Darwin style PIC. AIX might be better, since it avoids bl/mflr to
+C get at the GOT/TOC/whatever.
+C
+C Using divwu for size==1 measured about 10 cycles slower on 604e, or about
+C 3-5 cycles faster on 750. For now it doesn't seem worth bothering with.
+C
+C The loop allows an early-out on mullw for the inverse, and on mulhwu for
+C the divisor. So the fastest is for instance divisor==1 (inverse==-1), and
+C the slowest is anything giving a full 32-bits in both, such as
+C divisor==0xDEADBEEF (inverse==0x904B300F). These establish the stated
+C range above for 750 and 7400.
+
+
+ASM_START()
+
+EXTERN(binvert_limb_table)
+
+PROLOGUE(mpn_modexact_1_odd)
+ li r6, 0
+
+PROLOGUE(mpn_modexact_1c_odd)
+
+ mtctr r4 C size
+
+ifdef(`PIC_SLOW',`
+C Load from our table with PIC is so slow on Linux and Darwin that we avoid it
+ rlwinm r7, r5, 1,28,28 C (divisor << 1) & 8
+ rlwinm r8, r5, 2,28,28 C (divisor << 2) & 8
+ xor r7, r7, r8 C ((divisor << 1) ^ (divisor << 2)) & 8
+ rlwinm r4, r5, 0,28,31 C divisor low 4 bits, speedup mullw
+ xor r4, r4, r7 C inverse, 4 bits
+ mullw r7, r4, r4 C i*i
+ slwi r4, r4, 1 C 2*i
+ rlwinm r8, r5, 0,24,31 C divisor low 8 bits, speedup mullw
+ mullw r7, r7, r8 C i*i*d
+ sub r4, r4, r7 C inverse, 8 bits
+',`
+ LEA( r7, binvert_limb_table)
+ rlwinm r4, r5, 31,25,31 C (divisor/2) & 0x7F
+ lbzx r4, r4,r7 C inverse, 8 bits
+')
+
+ mullw r7, r4, r4 C i*i
+ slwi r4, r4, 1 C 2*i
+ mullw r7, r5, r7 C i*i*d [i*i is 16 bits, so second operand]
+ sub r4, r4, r7 C inverse, 16 bits
+ mullw r7, r4, r4 C i*i
+ slwi r4, r4, 1 C 2*i
+ mullw r7, r7, r5 C i*i*d
+ lwz r0, 0(r3) C src[0]
+ sub r4, r4, r7 C inverse, 32 bits
+ subfc r7, r6, r0 C l = src[0] - carry
+
+ mullw r7, r7, r4 C q = l * inverse
+ bdz L(one)
+
+ lwzu r0, 4(r3) C src[1]
+ mulhwu r6, r7, r5 C carry = high(q*divisor)
+ subfe r7, r6, r0 C l = src[1] - carry
+ bdz L(two)
+
+L(top):
+ mullw r7, r7, r4 C q = l * inverse
+ lwzu r0, 4(r3) C src[i]
+ mulhwu r6, r7, r5 C carry = high(q*divisor)
+ subfe r7, r6, r0 C l = src[i] - carry
+ bdnz L(top)
+
+L(two): mullw r7, r7, r4 C q = l * inverse
+L(one): subfe r3, r3, r3 C ca 0 or -1
+ mulhwu r6, r7, r5 C carry = high(q*divisor)
+ subf r3, r3, r6 C carry + ca
+ blr
+
+EPILOGUE(mpn_modexact_1c_odd)
+EPILOGUE(mpn_modexact_1_odd)
+ASM_END()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc32/mul_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc32/mul_1.asm
new file mode 100644
index 00000000000..e42087cfa8b
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc32/mul_1.asm
@@ -0,0 +1,101 @@
+dnl PowerPC-32 mpn_mul_1 -- Multiply a limb vector with a limb and store the
+dnl result in a second limb vector.
+
+dnl Copyright 1995, 1997, 2000, 2002, 2003, 2005 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 603e: ?
+C 604e: 4.0
+C 75x (G3): 4.5-11
+C 7400,7410 (G4): 4.5-11
+C 744x,745x (G4+): 6.0
+C power4/ppc970: 6.0
+C power5: 5.63
+
+C INPUT PARAMETERS
+C rp r3
+C up r4
+C n r5
+C vl r6
+
+ASM_START()
+PROLOGUE(mpn_mul_1)
+ mtctr r5
+ addi r3,r3,-4 C adjust res_ptr, it's offset before it's used
+ li r12,0 C clear upper product reg
+ addic r0,r0,0 C clear cy
+C Start software pipeline
+ lwz r8,0(r4)
+ bdz L(end3)
+ lwzu r9,4(r4)
+ mullw r11,r8,r6
+ mulhwu r0,r8,r6
+ bdz L(end1)
+C Software pipelined main loop
+L(loop):
+ lwz r8,4(r4)
+ mullw r10,r9,r6
+ adde r5,r11,r12
+ mulhwu r12,r9,r6
+ stw r5,4(r3)
+ bdz L(end2)
+ lwzu r9,8(r4)
+ mullw r11,r8,r6
+ adde r7,r10,r0
+ mulhwu r0,r8,r6
+ stwu r7,8(r3)
+ bdnz L(loop)
+C Finish software pipeline
+L(end1):
+ mullw r10,r9,r6
+ adde r5,r11,r12
+ mulhwu r12,r9,r6
+ stw r5,4(r3)
+ adde r7,r10,r0
+ stwu r7,8(r3)
+ addze r3,r12
+ blr
+L(end2):
+ mullw r11,r8,r6
+ adde r7,r10,r0
+ mulhwu r0,r8,r6
+ stwu r7,8(r3)
+ adde r5,r11,r12
+ stw r5,4(r3)
+ addze r3,r0
+ blr
+L(end3):
+ mullw r11,r8,r6
+ stw r11,4(r3)
+ mulhwu r3,r8,r6
+ blr
+EPILOGUE(mpn_mul_1)
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc32/p3-p7/aors_n.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc32/p3-p7/aors_n.asm
new file mode 100644
index 00000000000..c44df8fa509
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc32/p3-p7/aors_n.asm
@@ -0,0 +1,186 @@
+dnl PowerPC-32 mpn_add_n/mpn_sub_n -- mpn addition and subtraction.
+
+dnl Copyright 1999-2001, 2003-2005, 2007, 2011 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 1.5
+C POWER4/PPC970 2
+C POWER5 2
+C POWER6 2.78
+C POWER7 2.15-2.87
+
+C This code is based on powerpc64/aors_n.asm.
+
+C INPUT PARAMETERS
+C rp r3
+C up r4
+C vp r5
+C n r6
+
+ifdef(`OPERATION_add_n',`
+ define(ADDSUBC, adde)
+ define(ADDSUB, addc)
+ define(func, mpn_add_n)
+ define(func_nc, mpn_add_nc)
+ define(GENRVAL, `addi r3, r3, 1')
+ define(SETCBR, `addic r0, $1, -1')
+ define(CLRCB, `addic r0, r0, 0')
+')
+ifdef(`OPERATION_sub_n',`
+ define(ADDSUBC, subfe)
+ define(ADDSUB, subfc)
+ define(func, mpn_sub_n)
+ define(func_nc, mpn_sub_nc)
+ define(GENRVAL, `neg r3, r3')
+ define(SETCBR, `subfic r0, $1, 0')
+ define(CLRCB, `addic r0, r1, -1')
+')
+
+MULFUNC_PROLOGUE(mpn_add_n mpn_add_nc mpn_sub_n mpn_sub_nc)
+
+ASM_START()
+PROLOGUE(func_nc)
+ SETCBR(r7)
+ b L(ent)
+EPILOGUE()
+
+PROLOGUE(func)
+ CLRCB
+L(ent): stw r31, -4(r1)
+ stw r30, -8(r1)
+ stw r29, -12(r1)
+ stw r28, -16(r1)
+
+ rlwinm. r0, r6, 0,30,31 C r0 = n & 3, set cr0
+ cmpwi cr6, r0, 2
+ addi r6, r6, 3 C compute count...
+ srwi r6, r6, 2 C ...for ctr
+ mtctr r6 C copy count into ctr
+ beq cr0, L(b00)
+ blt cr6, L(b01)
+ beq cr6, L(b10)
+
+L(b11): lwz r8, 0(r4) C load s1 limb
+ lwz r9, 0(r5) C load s2 limb
+ lwz r10, 4(r4) C load s1 limb
+ lwz r11, 4(r5) C load s2 limb
+ lwz r12, 8(r4) C load s1 limb
+ addi r4, r4, 12
+ lwz r0, 8(r5) C load s2 limb
+ addi r5, r5, 12
+ ADDSUBC r29, r9, r8
+ ADDSUBC r30, r11, r10
+ ADDSUBC r31, r0, r12
+ stw r29, 0(r3)
+ stw r30, 4(r3)
+ stw r31, 8(r3)
+ addi r3, r3, 12
+ bdnz L(go)
+ b L(ret)
+
+L(b01): lwz r12, 0(r4) C load s1 limb
+ addi r4, r4, 4
+ lwz r0, 0(r5) C load s2 limb
+ addi r5, r5, 4
+ ADDSUBC r31, r0, r12 C add
+ stw r31, 0(r3)
+ addi r3, r3, 4
+ bdnz L(go)
+ b L(ret)
+
+L(b10): lwz r10, 0(r4) C load s1 limb
+ lwz r11, 0(r5) C load s2 limb
+ lwz r12, 4(r4) C load s1 limb
+ addi r4, r4, 8
+ lwz r0, 4(r5) C load s2 limb
+ addi r5, r5, 8
+ ADDSUBC r30, r11, r10 C add
+ ADDSUBC r31, r0, r12 C add
+ stw r30, 0(r3)
+ stw r31, 4(r3)
+ addi r3, r3, 8
+ bdnz L(go)
+ b L(ret)
+
+L(b00): C INITCY C clear/set cy
+L(go): lwz r6, 0(r4) C load s1 limb
+ lwz r7, 0(r5) C load s2 limb
+ lwz r8, 4(r4) C load s1 limb
+ lwz r9, 4(r5) C load s2 limb
+ lwz r10, 8(r4) C load s1 limb
+ lwz r11, 8(r5) C load s2 limb
+ lwz r12, 12(r4) C load s1 limb
+ lwz r0, 12(r5) C load s2 limb
+ bdz L(end)
+
+ addi r4, r4, 16
+ addi r5, r5, 16
+
+ ALIGN(16)
+L(top): ADDSUBC r28, r7, r6
+ lwz r6, 0(r4) C load s1 limb
+ lwz r7, 0(r5) C load s2 limb
+ ADDSUBC r29, r9, r8
+ lwz r8, 4(r4) C load s1 limb
+ lwz r9, 4(r5) C load s2 limb
+ ADDSUBC r30, r11, r10
+ lwz r10, 8(r4) C load s1 limb
+ lwz r11, 8(r5) C load s2 limb
+ ADDSUBC r31, r0, r12
+ lwz r12, 12(r4) C load s1 limb
+ lwz r0, 12(r5) C load s2 limb
+ stw r28, 0(r3)
+ addi r4, r4, 16
+ stw r29, 4(r3)
+ addi r5, r5, 16
+ stw r30, 8(r3)
+ stw r31, 12(r3)
+ addi r3, r3, 16
+ bdnz L(top) C decrement ctr and loop back
+
+L(end): ADDSUBC r28, r7, r6
+ ADDSUBC r29, r9, r8
+ ADDSUBC r30, r11, r10
+ ADDSUBC r31, r0, r12
+ stw r28, 0(r3)
+ stw r29, 4(r3)
+ stw r30, 8(r3)
+ stw r31, 12(r3)
+
+L(ret): lwz r31, -4(r1)
+ lwz r30, -8(r1)
+ lwz r29, -12(r1)
+ lwz r28, -16(r1)
+
+ subfe r3, r0, r0 C -cy
+ GENRVAL
+ blr
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc32/p3/gmp-mparam.h b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc32/p3/gmp-mparam.h
new file mode 100644
index 00000000000..33826956a2e
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc32/p3/gmp-mparam.h
@@ -0,0 +1,155 @@
+/* PowerPC-32 gmp-mparam.h -- Compiler/machine parameter header file.
+
+Copyright 1991, 1993, 1994, 1999-2004, 2008-2011 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
+
+/* 450 MHz POWER3 */
+
+#define DIVREM_1_NORM_THRESHOLD 0 /* always */
+#define DIVREM_1_UNNORM_THRESHOLD 0 /* always */
+#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 2
+#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 8
+#define USE_PREINV_DIVREM_1 1
+#define DIVEXACT_1_THRESHOLD 0 /* always */
+#define BMOD_1_TO_MOD_1_THRESHOLD MP_SIZE_T_MAX /* never */
+
+#define MUL_TOOM22_THRESHOLD 10
+#define MUL_TOOM33_THRESHOLD 38
+#define MUL_TOOM44_THRESHOLD 58
+#define MUL_TOOM6H_THRESHOLD 129
+#define MUL_TOOM8H_THRESHOLD 212
+
+#define MUL_TOOM32_TO_TOOM43_THRESHOLD 65
+#define MUL_TOOM32_TO_TOOM53_THRESHOLD 63
+#define MUL_TOOM42_TO_TOOM53_THRESHOLD 59
+#define MUL_TOOM42_TO_TOOM63_THRESHOLD 64
+
+#define SQR_BASECASE_THRESHOLD 0 /* always */
+#define SQR_TOOM2_THRESHOLD 14
+#define SQR_TOOM3_THRESHOLD 53
+#define SQR_TOOM4_THRESHOLD 76
+#define SQR_TOOM6_THRESHOLD 106
+#define SQR_TOOM8_THRESHOLD 284
+
+#define MULMOD_BNM1_THRESHOLD 9
+#define SQRMOD_BNM1_THRESHOLD 9
+
+#define MUL_FFT_MODF_THRESHOLD 220 /* k = 5 */
+#define MUL_FFT_TABLE3 \
+ { { 220, 5}, { 13, 6}, { 7, 5}, { 15, 6}, \
+ { 9, 5}, { 19, 6}, { 13, 7}, { 7, 6}, \
+ { 16, 7}, { 13, 8}, { 7, 7}, { 19, 8}, \
+ { 11, 7}, { 23, 9}, { 7, 8}, { 15, 7}, \
+ { 33, 8}, { 23, 9}, { 15, 8}, { 35, 9}, \
+ { 23,10}, { 15, 9}, { 31, 8}, { 67, 9}, \
+ { 39, 8}, { 79, 9}, { 47,10}, { 31, 9}, \
+ { 63, 8}, { 127, 9}, { 71, 8}, { 143, 9}, \
+ { 79,10}, { 47,11}, { 31,10}, { 63, 9}, \
+ { 127, 8}, { 255, 9}, { 143,10}, { 79, 9}, \
+ { 159, 8}, { 319, 9}, { 175, 8}, { 351,10}, \
+ { 95, 9}, { 191, 8}, { 383,10}, { 111,11}, \
+ { 63,10}, { 127, 9}, { 255,10}, { 143, 9}, \
+ { 287, 8}, { 575,10}, { 159, 9}, { 319,10}, \
+ { 175, 9}, { 351,11}, { 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,11}, { 223,10}, \
+ { 447, 9}, { 895,12}, { 4096,13}, { 8192,14}, \
+ { 16384,15}, { 32768,16} }
+#define MUL_FFT_TABLE3_SIZE 82
+#define MUL_FFT_THRESHOLD 2688
+
+#define SQR_FFT_MODF_THRESHOLD 176 /* k = 5 */
+#define SQR_FFT_TABLE3 \
+ { { 176, 5}, { 13, 6}, { 7, 5}, { 15, 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}, { 23, 9}, \
+ { 15, 8}, { 39, 9}, { 23,10}, { 15, 9}, \
+ { 31, 8}, { 63, 9}, { 39, 8}, { 79, 9}, \
+ { 47, 8}, { 95,10}, { 31, 9}, { 63, 8}, \
+ { 127, 9}, { 71, 8}, { 143, 7}, { 287, 6}, \
+ { 575, 9}, { 79, 8}, { 159,10}, { 47, 9}, \
+ { 95,11}, { 31,10}, { 63, 9}, { 127, 8}, \
+ { 255, 9}, { 143, 8}, { 287, 7}, { 575,10}, \
+ { 79, 9}, { 159, 8}, { 319, 9}, { 175,10}, \
+ { 95, 9}, { 191, 8}, { 383,10}, { 111, 9}, \
+ { 223,11}, { 63,10}, { 127, 9}, { 255,10}, \
+ { 143, 9}, { 287, 8}, { 575,10}, { 159, 9}, \
+ { 319,10}, { 175,11}, { 95,10}, { 191, 9}, \
+ { 383,10}, { 223,12}, { 63,11}, { 127,10}, \
+ { 287, 9}, { 575,11}, { 159,10}, { 351, 9}, \
+ { 703, 8}, { 1407,11}, { 191,10}, { 383,11}, \
+ { 223,10}, { 447, 9}, { 895,12}, { 4096,13}, \
+ { 8192,14}, { 16384,15}, { 32768,16} }
+#define SQR_FFT_TABLE3_SIZE 87
+#define SQR_FFT_THRESHOLD 1728
+
+#define MULLO_BASECASE_THRESHOLD 2
+#define MULLO_DC_THRESHOLD 33
+#define MULLO_MUL_N_THRESHOLD 5240
+
+#define DC_DIV_QR_THRESHOLD 32
+#define DC_DIVAPPR_Q_THRESHOLD 123
+#define DC_BDIV_QR_THRESHOLD 34
+#define DC_BDIV_Q_THRESHOLD 84
+
+#define INV_MULMOD_BNM1_THRESHOLD 42
+#define INV_NEWTON_THRESHOLD 129
+#define INV_APPR_THRESHOLD 124
+
+#define BINV_NEWTON_THRESHOLD 148
+#define REDC_1_TO_REDC_N_THRESHOLD 38
+
+#define MU_DIV_QR_THRESHOLD 748
+#define MU_DIVAPPR_Q_THRESHOLD 748
+#define MUPI_DIV_QR_THRESHOLD 59
+#define MU_BDIV_QR_THRESHOLD 562
+#define MU_BDIV_Q_THRESHOLD 654
+
+#define MATRIX22_STRASSEN_THRESHOLD 11
+#define HGCD_THRESHOLD 76
+#define GCD_DC_THRESHOLD 205
+#define GCDEXT_DC_THRESHOLD 174
+#define JACOBI_BASE_METHOD 1
+
+#define GET_STR_DC_THRESHOLD 14
+#define GET_STR_PRECOMPUTE_THRESHOLD 27
+#define SET_STR_DC_THRESHOLD 181
+#define SET_STR_PRECOMPUTE_THRESHOLD 525
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc32/p4/gmp-mparam.h b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc32/p4/gmp-mparam.h
new file mode 100644
index 00000000000..20830a0bd72
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc32/p4/gmp-mparam.h
@@ -0,0 +1,204 @@
+/* PowerPC-32 gmp-mparam.h -- Compiler/machine parameter header file.
+
+Copyright 1991, 1993, 1994, 1999-2004, 2008-2011, 2014 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/. */
+
+/* 1800 MHz PowerPC-970 */
+/* FFT tuning limit = 10000000 */
+/* Generated by tuneup.c, 2014-03-12, gcc 4.0 */
+
+#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 MOD_1U_TO_MOD_1_1_THRESHOLD 5
+#define MOD_1_1_TO_MOD_1_2_THRESHOLD 9
+#define MOD_1_2_TO_MOD_1_4_THRESHOLD 42
+#define PREINV_MOD_1_TO_MOD_1_THRESHOLD 14
+#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_2_PI2_THRESHOLD MP_SIZE_T_MAX /* never */
+#define DIVEXACT_1_THRESHOLD 0 /* always */
+#define BMOD_1_TO_MOD_1_THRESHOLD 45
+
+#define MUL_TOOM22_THRESHOLD 20
+#define MUL_TOOM33_THRESHOLD 73
+#define MUL_TOOM44_THRESHOLD 130
+#define MUL_TOOM6H_THRESHOLD 222
+#define MUL_TOOM8H_THRESHOLD 333
+
+#define MUL_TOOM32_TO_TOOM43_THRESHOLD 107
+#define MUL_TOOM32_TO_TOOM53_THRESHOLD 108
+#define MUL_TOOM42_TO_TOOM53_THRESHOLD 89
+#define MUL_TOOM42_TO_TOOM63_THRESHOLD 92
+#define MUL_TOOM43_TO_TOOM54_THRESHOLD 100
+
+#define SQR_BASECASE_THRESHOLD 5
+#define SQR_TOOM2_THRESHOLD 30
+#define SQR_TOOM3_THRESHOLD 85
+#define SQR_TOOM4_THRESHOLD 160
+#define SQR_TOOM6_THRESHOLD 197
+#define SQR_TOOM8_THRESHOLD 357
+
+#define MULMID_TOOM42_THRESHOLD 32
+
+#define MULMOD_BNM1_THRESHOLD 15
+#define SQRMOD_BNM1_THRESHOLD 16
+
+#define MUL_FFT_MODF_THRESHOLD 444 /* k = 5 */
+#define MUL_FFT_TABLE3 \
+ { { 444, 5}, { 17, 6}, { 9, 5}, { 21, 6}, \
+ { 11, 5}, { 23, 6}, { 21, 7}, { 11, 6}, \
+ { 24, 7}, { 13, 6}, { 28, 7}, { 15, 6}, \
+ { 31, 7}, { 21, 8}, { 11, 7}, { 27, 8}, \
+ { 15, 7}, { 33, 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}, \
+ { 47, 8}, { 95,10}, { 31, 9}, { 63, 8}, \
+ { 127, 9}, { 79,10}, { 47, 9}, { 95,11}, \
+ { 31,10}, { 63, 9}, { 135,10}, { 79, 9}, \
+ { 167,10}, { 95, 9}, { 191, 8}, { 383,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, 8}, \
+ { 1087,10}, { 287, 9}, { 575,10}, { 303,11}, \
+ { 159,10}, { 335, 9}, { 671, 8}, { 1343,10}, \
+ { 351, 9}, { 703,11}, { 191,10}, { 383, 9}, \
+ { 767,10}, { 415, 9}, { 831,11}, { 223,10}, \
+ { 447,12}, { 127,11}, { 255,10}, { 543, 9}, \
+ { 1087,11}, { 287,10}, { 607, 9}, { 1215,11}, \
+ { 319,10}, { 671, 9}, { 1343,11}, { 351,10}, \
+ { 703, 9}, { 1407,12}, { 191,11}, { 383,10}, \
+ { 767,11}, { 415,10}, { 831,11}, { 447,13}, \
+ { 127,12}, { 255,11}, { 543,10}, { 1087,11}, \
+ { 607,10}, { 1215,12}, { 319,11}, { 671,10}, \
+ { 1343,11}, { 703,10}, { 1407,11}, { 735,12}, \
+ { 383,11}, { 767,10}, { 1535,11}, { 831,12}, \
+ { 447,10}, { 1791,11}, { 959,13}, { 255,12}, \
+ { 511,11}, { 1087,12}, { 575,11}, { 1215,10}, \
+ { 2431,12}, { 639,11}, { 1343,12}, { 703,11}, \
+ { 1407,13}, { 383,12}, { 767,11}, { 1535,12}, \
+ { 831,11}, { 1727,10}, { 3455,11}, { 1791,12}, \
+ { 959,14}, { 255,13}, { 511,12}, { 1215,11}, \
+ { 2431,13}, { 639,12}, { 1471,13}, { 767,12}, \
+ { 1727,11}, { 3455,12}, { 1791,14}, { 511,13}, \
+ { 1151,12}, { 2431,13}, { 8192,14}, { 16384,15}, \
+ { 32768,16} }
+#define MUL_FFT_TABLE3_SIZE 157
+#define MUL_FFT_THRESHOLD 6784
+
+#define SQR_FFT_MODF_THRESHOLD 340 /* k = 5 */
+#define SQR_FFT_TABLE3 \
+ { { 340, 5}, { 21, 6}, { 11, 5}, { 23, 6}, \
+ { 21, 7}, { 11, 6}, { 24, 7}, { 13, 6}, \
+ { 28, 7}, { 21, 8}, { 11, 7}, { 27, 8}, \
+ { 15, 7}, { 33, 8}, { 19, 7}, { 39, 8}, \
+ { 23, 7}, { 47, 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, 9}, \
+ { 95,11}, { 31,10}, { 63, 9}, { 127, 8}, \
+ { 255, 9}, { 135,10}, { 79, 9}, { 159, 8}, \
+ { 319,10}, { 95, 9}, { 191, 8}, { 383, 9}, \
+ { 207,11}, { 63,10}, { 127, 9}, { 255, 8}, \
+ { 511, 9}, { 271,10}, { 143, 9}, { 287, 8}, \
+ { 575, 9}, { 303, 8}, { 607,10}, { 159, 9}, \
+ { 319,10}, { 175,11}, { 95,10}, { 191, 9}, \
+ { 383,10}, { 207,12}, { 63,11}, { 127,10}, \
+ { 255, 9}, { 511,10}, { 271, 9}, { 543, 8}, \
+ { 1087,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, 9}, \
+ { 831,11}, { 223,10}, { 447,12}, { 127,11}, \
+ { 255,10}, { 543, 9}, { 1087,11}, { 287,10}, \
+ { 607, 9}, { 1215,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,10}, { 1215,12}, { 319,11}, { 671,10}, \
+ { 1343,11}, { 703,10}, { 1407,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,11}, \
+ { 1407,13}, { 383,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}, { 8192,14}, \
+ { 16384,15}, { 32768,16} }
+#define SQR_FFT_TABLE3_SIZE 150
+#define SQR_FFT_THRESHOLD 4736
+
+#define MULLO_BASECASE_THRESHOLD 0 /* always */
+#define MULLO_DC_THRESHOLD 55
+#define MULLO_MUL_N_THRESHOLD 13463
+
+#define DC_DIV_QR_THRESHOLD 50
+#define DC_DIVAPPR_Q_THRESHOLD 196
+#define DC_BDIV_QR_THRESHOLD 51
+#define DC_BDIV_Q_THRESHOLD 166
+
+#define INV_MULMOD_BNM1_THRESHOLD 50
+#define INV_NEWTON_THRESHOLD 226
+#define INV_APPR_THRESHOLD 202
+
+#define BINV_NEWTON_THRESHOLD 228
+#define REDC_1_TO_REDC_N_THRESHOLD 67
+
+#define MU_DIV_QR_THRESHOLD 1187
+#define MU_DIVAPPR_Q_THRESHOLD 1308
+#define MUPI_DIV_QR_THRESHOLD 114
+#define MU_BDIV_QR_THRESHOLD 998
+#define MU_BDIV_Q_THRESHOLD 1142
+
+#define POWM_SEC_TABLE 3,28,78,480,1099
+
+#define MATRIX22_STRASSEN_THRESHOLD 9
+#define HGCD_THRESHOLD 93
+#define HGCD_APPR_THRESHOLD 109
+#define HGCD_REDUCE_THRESHOLD 2479
+#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
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc32/p5/gmp-mparam.h b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc32/p5/gmp-mparam.h
new file mode 100644
index 00000000000..faa1e81da41
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc32/p5/gmp-mparam.h
@@ -0,0 +1,156 @@
+/* PowerPC-32 gmp-mparam.h -- Compiler/machine parameter header file.
+
+Copyright 1991, 1993, 1994, 1999-2004, 2008-2011 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
+
+/* 1650 MHz POWER5 */
+
+#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 8
+#define MOD_1U_TO_MOD_1_1_THRESHOLD 6
+#define MOD_1_1_TO_MOD_1_2_THRESHOLD 9
+#define MOD_1_2_TO_MOD_1_4_THRESHOLD 50
+#define PREINV_MOD_1_TO_MOD_1_THRESHOLD 18
+#define USE_PREINV_DIVREM_1 1
+#define DIV_QR_2_PI2_THRESHOLD MP_SIZE_T_MAX /* never */
+#define DIVEXACT_1_THRESHOLD 0 /* always */
+#define BMOD_1_TO_MOD_1_THRESHOLD 61
+
+#define MUL_TOOM22_THRESHOLD 22
+#define MUL_TOOM33_THRESHOLD 57
+#define MUL_TOOM44_THRESHOLD 130
+#define MUL_TOOM6H_THRESHOLD 189
+#define MUL_TOOM8H_THRESHOLD 309
+
+#define MUL_TOOM32_TO_TOOM43_THRESHOLD 89
+#define MUL_TOOM32_TO_TOOM53_THRESHOLD 99
+#define MUL_TOOM42_TO_TOOM53_THRESHOLD 83
+#define MUL_TOOM42_TO_TOOM63_THRESHOLD 88
+
+#define SQR_BASECASE_THRESHOLD 6
+#define SQR_TOOM2_THRESHOLD 40
+#define SQR_TOOM3_THRESHOLD 77
+#define SQR_TOOM4_THRESHOLD 124
+#define SQR_TOOM6_THRESHOLD 140
+#define SQR_TOOM8_THRESHOLD 238
+
+#define MULMID_TOOM42_THRESHOLD 40
+
+#define MULMOD_BNM1_THRESHOLD 15
+#define SQRMOD_BNM1_THRESHOLD 16
+
+#define POWM_SEC_TABLE 4,29,252,840,2080
+
+#define MUL_FFT_MODF_THRESHOLD 412 /* k = 5 */
+#define MUL_FFT_TABLE3 \
+ { { 412, 5}, { 21, 6}, { 11, 5}, { 23, 6}, \
+ { 12, 5}, { 25, 6}, { 21, 7}, { 11, 6}, \
+ { 25, 7}, { 13, 6}, { 27, 7}, { 21, 8}, \
+ { 11, 7}, { 27, 8}, { 15, 7}, { 33, 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}, { 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,10}, \
+ { 191,12}, { 63,11}, { 127,10}, { 255, 9}, \
+ { 511,10}, { 271, 9}, { 543,10}, { 287,11}, \
+ { 159,10}, { 335, 9}, { 671,10}, { 351, 9}, \
+ { 703,11}, { 191,10}, { 383, 9}, { 767,10}, \
+ { 415, 9}, { 831,11}, { 223,12}, { 4096,13}, \
+ { 8192,14}, { 16384,15}, { 32768,16} }
+#define MUL_FFT_TABLE3_SIZE 71
+#define MUL_FFT_THRESHOLD 4736
+
+#define SQR_FFT_MODF_THRESHOLD 340 /* k = 5 */
+#define SQR_FFT_TABLE3 \
+ { { 340, 5}, { 21, 6}, { 11, 5}, { 23, 6}, \
+ { 21, 7}, { 11, 6}, { 24, 7}, { 13, 6}, \
+ { 27, 7}, { 21, 8}, { 11, 7}, { 27, 8}, \
+ { 15, 7}, { 33, 8}, { 19, 7}, { 39, 8}, \
+ { 23, 7}, { 47, 8}, { 27, 9}, { 15, 8}, \
+ { 39, 9}, { 23, 8}, { 47,10}, { 15, 9}, \
+ { 31, 8}, { 67, 9}, { 47,10}, { 31, 9}, \
+ { 71,10}, { 47,11}, { 31,10}, { 63, 9}, \
+ { 127, 8}, { 255, 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,10}, { 287, 9}, { 575,10}, { 303,11}, \
+ { 159,10}, { 319, 9}, { 639,10}, { 335, 9}, \
+ { 671,10}, { 351,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 76
+#define SQR_FFT_THRESHOLD 3712
+
+#define MULLO_BASECASE_THRESHOLD 2
+#define MULLO_DC_THRESHOLD 68
+#define MULLO_MUL_N_THRESHOLD 9236
+
+#define DC_DIV_QR_THRESHOLD 69
+#define DC_DIVAPPR_Q_THRESHOLD 220
+#define DC_BDIV_QR_THRESHOLD 75
+#define DC_BDIV_Q_THRESHOLD 188
+
+#define INV_MULMOD_BNM1_THRESHOLD 54
+#define INV_NEWTON_THRESHOLD 230
+#define INV_APPR_THRESHOLD 230
+
+#define BINV_NEWTON_THRESHOLD 278
+#define REDC_1_TO_REDC_N_THRESHOLD 87
+
+#define MU_DIV_QR_THRESHOLD 1210
+#define MU_DIVAPPR_Q_THRESHOLD 1308
+#define MUPI_DIV_QR_THRESHOLD 106
+#define MU_BDIV_QR_THRESHOLD 1017
+#define MU_BDIV_Q_THRESHOLD 1210
+
+#define MATRIX22_STRASSEN_THRESHOLD 14
+#define HGCD_THRESHOLD 110
+#define HGCD_APPR_THRESHOLD 138
+#define HGCD_REDUCE_THRESHOLD 2578
+#define GCD_DC_THRESHOLD 408
+#define GCDEXT_DC_THRESHOLD 298
+#define JACOBI_BASE_METHOD 4
+
+#define GET_STR_DC_THRESHOLD 13
+#define GET_STR_PRECOMPUTE_THRESHOLD 24
+#define SET_STR_DC_THRESHOLD 527
+#define SET_STR_PRECOMPUTE_THRESHOLD 1090
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc32/p6/gmp-mparam.h b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc32/p6/gmp-mparam.h
new file mode 100644
index 00000000000..c9504b63b31
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc32/p6/gmp-mparam.h
@@ -0,0 +1,165 @@
+/* PowerPC-32 gmp-mparam.h -- Compiler/machine parameter header file.
+
+Copyright 1991, 1993, 1994, 1999-2004, 2008-2011 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
+
+/* 3500 MHz POWER6 */
+
+#define DIVREM_1_NORM_THRESHOLD 0 /* always */
+#define DIVREM_1_UNNORM_THRESHOLD 0 /* always */
+#define MOD_1_1P_METHOD 2
+#define MOD_1_NORM_THRESHOLD 3
+#define MOD_1_UNNORM_THRESHOLD 0 /* always */
+#define MOD_1N_TO_MOD_1_1_THRESHOLD 3
+#define MOD_1U_TO_MOD_1_1_THRESHOLD 3
+#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 8
+#define USE_PREINV_DIVREM_1 1
+#define DIV_QR_2_PI2_THRESHOLD MP_SIZE_T_MAX /* never */
+#define DIVEXACT_1_THRESHOLD 0 /* always */
+#define BMOD_1_TO_MOD_1_THRESHOLD MP_SIZE_T_MAX /* never */
+
+#define MUL_TOOM22_THRESHOLD 19
+#define MUL_TOOM33_THRESHOLD 55
+#define MUL_TOOM44_THRESHOLD 88
+#define MUL_TOOM6H_THRESHOLD 137
+#define MUL_TOOM8H_THRESHOLD 181
+
+#define MUL_TOOM32_TO_TOOM43_THRESHOLD 57
+#define MUL_TOOM32_TO_TOOM53_THRESHOLD 56
+#define MUL_TOOM42_TO_TOOM53_THRESHOLD 57
+#define MUL_TOOM42_TO_TOOM63_THRESHOLD 56
+
+#define SQR_BASECASE_THRESHOLD 0 /* always */
+#define SQR_TOOM2_THRESHOLD 30
+#define SQR_TOOM3_THRESHOLD 56
+#define SQR_TOOM4_THRESHOLD 130
+#define SQR_TOOM6_THRESHOLD 189
+#define SQR_TOOM8_THRESHOLD 296
+
+#define MULMID_TOOM42_THRESHOLD 26
+
+#define MULMOD_BNM1_THRESHOLD 7
+#define SQRMOD_BNM1_THRESHOLD 12
+
+#define POWM_SEC_TABLE 2,26,127,453,1068
+
+#define MUL_FFT_MODF_THRESHOLD 212 /* k = 5 */
+#define MUL_FFT_TABLE3 \
+ { { 212, 5}, { 13, 6}, { 7, 5}, { 15, 6}, \
+ { 13, 7}, { 7, 6}, { 16, 7}, { 9, 6}, \
+ { 19, 7}, { 13, 8}, { 7, 7}, { 19, 8}, \
+ { 11, 7}, { 25, 9}, { 7, 8}, { 15, 7}, \
+ { 31, 8}, { 19, 7}, { 39, 8}, { 23, 9}, \
+ { 15, 8}, { 39, 9}, { 23, 8}, { 47,10}, \
+ { 15, 9}, { 31, 8}, { 63, 9}, { 39, 8}, \
+ { 79, 9}, { 47,10}, { 31, 9}, { 63, 8}, \
+ { 127, 9}, { 71, 8}, { 143, 7}, { 287, 9}, \
+ { 79,10}, { 47,11}, { 31,10}, { 63, 9}, \
+ { 127, 8}, { 255, 7}, { 511, 9}, { 143, 8}, \
+ { 287,10}, { 79, 9}, { 159, 8}, { 319, 9}, \
+ { 175, 8}, { 351,10}, { 95, 9}, { 191, 8}, \
+ { 383, 9}, { 207,10}, { 111,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,10}, { 207, 9}, { 415,12}, { 63,11}, \
+ { 127,10}, { 255, 9}, { 511,10}, { 287, 9}, \
+ { 575,11}, { 159,10}, { 351, 9}, { 703,11}, \
+ { 191,10}, { 415, 9}, { 831,11}, { 223,10}, \
+ { 447,12}, { 4096,13}, { 8192,14}, { 16384,15}, \
+ { 32768,16} }
+#define MUL_FFT_TABLE3_SIZE 89
+#define MUL_FFT_THRESHOLD 1728
+
+#define SQR_FFT_MODF_THRESHOLD 184 /* k = 5 */
+#define SQR_FFT_TABLE3 \
+ { { 184, 5}, { 6, 4}, { 13, 5}, { 13, 6}, \
+ { 7, 5}, { 15, 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}, { 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, 7}, \
+ { 255, 9}, { 71, 8}, { 143, 7}, { 287, 6}, \
+ { 575, 9}, { 79,10}, { 47,11}, { 31,10}, \
+ { 63, 9}, { 127, 8}, { 255, 9}, { 143, 8}, \
+ { 287, 7}, { 575,10}, { 79, 9}, { 159, 8}, \
+ { 319, 9}, { 175, 8}, { 351,10}, { 95, 9}, \
+ { 191, 8}, { 383, 9}, { 207,10}, { 111, 9}, \
+ { 223,11}, { 63,10}, { 127, 9}, { 255,10}, \
+ { 143, 9}, { 287, 8}, { 575,10}, { 159, 9}, \
+ { 319,10}, { 175, 9}, { 351,11}, { 95,10}, \
+ { 191, 9}, { 383,10}, { 207, 9}, { 415,10}, \
+ { 223,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,12}, \
+ { 4096,13}, { 8192,14}, { 16384,15}, { 32768,16} }
+#define SQR_FFT_TABLE3_SIZE 92
+#define SQR_FFT_THRESHOLD 1600
+
+#define MULLO_BASECASE_THRESHOLD 2
+#define MULLO_DC_THRESHOLD 57
+#define MULLO_MUL_N_THRESHOLD 3176
+
+#define DC_DIV_QR_THRESHOLD 52
+#define DC_DIVAPPR_Q_THRESHOLD 187
+#define DC_BDIV_QR_THRESHOLD 64
+#define DC_BDIV_Q_THRESHOLD 146
+
+#define INV_MULMOD_BNM1_THRESHOLD 68
+#define INV_NEWTON_THRESHOLD 182
+#define INV_APPR_THRESHOLD 182
+
+#define BINV_NEWTON_THRESHOLD 186
+#define REDC_1_TO_REDC_N_THRESHOLD 60
+
+#define MU_DIV_QR_THRESHOLD 924
+#define MU_DIVAPPR_Q_THRESHOLD 807
+#define MUPI_DIV_QR_THRESHOLD 73
+#define MU_BDIV_QR_THRESHOLD 667
+#define MU_BDIV_Q_THRESHOLD 823
+
+#define MATRIX22_STRASSEN_THRESHOLD 8
+#define HGCD_THRESHOLD 61
+#define HGCD_APPR_THRESHOLD 50
+#define HGCD_REDUCE_THRESHOLD 974
+#define GCD_DC_THRESHOLD 195
+#define GCDEXT_DC_THRESHOLD 134
+#define JACOBI_BASE_METHOD 4
+
+#define GET_STR_DC_THRESHOLD 9
+#define GET_STR_PRECOMPUTE_THRESHOLD 21
+#define SET_STR_DC_THRESHOLD 190
+#define SET_STR_PRECOMPUTE_THRESHOLD 411
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc32/p7/gmp-mparam.h b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc32/p7/gmp-mparam.h
new file mode 100644
index 00000000000..35bb61dca26
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc32/p7/gmp-mparam.h
@@ -0,0 +1,159 @@
+/* PowerPC-32 gmp-mparam.h -- Compiler/machine parameter header file.
+
+Copyright 1991, 1993, 1994, 1999-2004, 2008-2011 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
+
+/* 3550 MHz POWER7/T4 */
+
+#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 MOD_1U_TO_MOD_1_1_THRESHOLD 7
+#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 USE_PREINV_DIVREM_1 1
+#define DIV_QR_2_PI2_THRESHOLD MP_SIZE_T_MAX /* never */
+#define DIVEXACT_1_THRESHOLD 0 /* always */
+#define BMOD_1_TO_MOD_1_THRESHOLD 34
+
+#define MUL_TOOM22_THRESHOLD 20
+#define MUL_TOOM33_THRESHOLD 89
+#define MUL_TOOM44_THRESHOLD 130
+#define MUL_TOOM6H_THRESHOLD 286
+#define MUL_TOOM8H_THRESHOLD 363
+
+#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 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 MULMID_TOOM42_THRESHOLD 40
+
+#define MULMOD_BNM1_THRESHOLD 18
+#define SQRMOD_BNM1_THRESHOLD 17
+
+#define POWM_SEC_TABLE 4,35,225,780,2212
+
+#define MUL_FFT_MODF_THRESHOLD 476 /* 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}, \
+ { 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}, \
+ { 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
+
+#define SQR_FFT_MODF_THRESHOLD 344 /* k = 5 */
+#define SQR_FFT_TABLE3 \
+ { { 344, 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}, \
+ { 8192,14}, { 16384,15}, { 32768,16} }
+#define SQR_FFT_TABLE3_SIZE 79
+#define SQR_FFT_THRESHOLD 3712
+
+#define MULLO_BASECASE_THRESHOLD 2
+#define MULLO_DC_THRESHOLD 34
+#define MULLO_MUL_N_THRESHOLD 10323
+
+#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 INV_MULMOD_BNM1_THRESHOLD 66
+#define INV_NEWTON_THRESHOLD 226
+#define INV_APPR_THRESHOLD 189
+
+#define BINV_NEWTON_THRESHOLD 292
+#define REDC_1_TO_REDC_N_THRESHOLD 79
+
+#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 MATRIX22_STRASSEN_THRESHOLD 16
+#define HGCD_THRESHOLD 126
+#define HGCD_APPR_THRESHOLD 139
+#define HGCD_REDUCE_THRESHOLD 2681
+#define GCD_DC_THRESHOLD 573
+#define GCDEXT_DC_THRESHOLD 448
+#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
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc32/powerpc-defs.m4 b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc32/powerpc-defs.m4
new file mode 100644
index 00000000000..0c142a2e0cf
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc32/powerpc-defs.m4
@@ -0,0 +1,104 @@
+divert(-1)
+
+dnl m4 macros for PowerPC assembler (32 and 64 bit).
+
+dnl Copyright 2000, 2002, 2003 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 Called: PROLOGUE_cpu(GSYM_PREFIX`'foo)
+dnl
+dnl This is the same as the default in mpn/asm-defs.m4, but with ALIGN(4)
+dnl not 8.
+dnl
+dnl 4-byte alignment is normally enough, certainly it's what gcc gives. We
+dnl don't want bigger alignment within PROLOGUE since it can introduce
+dnl padding into multiple-entrypoint routines, and with gas such padding is
+dnl zero words, which are not valid instructions.
+
+define(`PROLOGUE_cpu',
+m4_assert_numargs(1)
+` TEXT
+ ALIGN(4)
+ GLOBL `$1' GLOBL_ATTR
+ TYPE(`$1',`function')
+`$1'LABEL_SUFFIX')
+
+
+dnl Usage: r0 ... r31, cr0 ... cr7
+dnl
+dnl Registers names, either left as "r0" etc or mapped to plain 0 etc,
+dnl according to the result of the GMP_ASM_POWERPC_REGISTERS configure
+dnl test.
+
+ifelse(WANT_R_REGISTERS,no,`
+forloop(i,0,31,`deflit(`r'i,i)')
+forloop(i,0,31,`deflit(`v'i,i)')
+forloop(i,0,31,`deflit(`f'i,i)')
+forloop(i,0,7, `deflit(`cr'i,i)')
+')
+
+
+dnl Usage: ASSERT(cond,instructions)
+dnl
+dnl If WANT_ASSERT is 1, output the given instructions and expect the given
+dnl flags condition to then be satisfied. For example,
+dnl
+dnl ASSERT(eq, `cmpwi r6, 123')
+dnl
+dnl The instructions can be omitted to just assert a flags condition with
+dnl no extra calculation. For example,
+dnl
+dnl ASSERT(ne)
+dnl
+dnl The condition can be omitted to just output the given instructions when
+dnl assertion checking is wanted. For example,
+dnl
+dnl ASSERT(, `mr r11, r0')
+dnl
+dnl Using a zero word for an illegal instruction is probably not ideal,
+dnl since it marks the beginning of a traceback table in the 64-bit ABI.
+dnl But assertions are only for development, so it doesn't matter too much.
+
+define(ASSERT,
+m4_assert_numargs_range(1,2)
+m4_assert_defined(`WANT_ASSERT')
+`ifelse(WANT_ASSERT,1,
+ `C ASSERT
+ $2
+ifelse(`$1',,,
+` b$1 L(ASSERT_ok`'ASSERT_counter)
+ W32 0 C assertion failed
+L(ASSERT_ok`'ASSERT_counter):
+define(`ASSERT_counter',incr(ASSERT_counter))
+')')')
+
+define(ASSERT_counter,1)
+
+
+divert
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc32/rshift.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc32/rshift.asm
new file mode 100644
index 00000000000..cb0046d5ee9
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc32/rshift.asm
@@ -0,0 +1,164 @@
+dnl PowerPC-32 mpn_rshift -- Shift a number right.
+
+dnl Copyright 1995, 1998, 2000, 2002-2005 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 603e: ?
+C 604e: 3.0
+C 75x (G3): 3.0
+C 7400,7410 (G4): 3.0
+C 7445,7455 (G4+): 2.5
+C 7447,7457 (G4+): 2.25
+C power4/ppc970: 2.5
+C power5: 2.5
+
+C INPUT PARAMETERS
+C rp r3
+C up r4
+C n r5
+C cnt r6
+
+ASM_START()
+PROLOGUE(mpn_rshift)
+ cmpwi cr0, r5, 30 C more than 30 limbs?
+ addi r7, r3, -4 C dst-4
+ bgt L(BIG) C branch if more than 12 limbs
+
+ mtctr r5 C copy size into CTR
+ subfic r8, r6, 32
+ lwz r11, 0(r4) C load first s1 limb
+ slw r3, r11, r8 C compute function return value
+ bdz L(end1)
+
+L(oop): lwzu r10, 4(r4)
+ srw r9, r11, r6
+ slw r12, r10, r8
+ or r9, r9, r12
+ stwu r9, 4(r7)
+ bdz L(end2)
+ lwzu r11, 4(r4)
+ srw r9, r10, r6
+ slw r12, r11, r8
+ or r9, r9, r12
+ stwu r9, 4(r7)
+ bdnz L(oop)
+
+L(end1):
+ srw r0, r11, r6
+ stw r0, 4(r7)
+ blr
+L(end2):
+ srw r0, r10, r6
+ stw r0, 4(r7)
+ blr
+
+L(BIG):
+ stmw r24, -32(r1) C save registers we are supposed to preserve
+ lwz r9, 0(r4)
+ subfic r8, r6, 32
+ slw r3, r9, r8 C compute function return value
+ srw r0, r9, r6
+ addi r5, r5, -1
+
+ andi. r10, r5, 3 C count for spill loop
+ beq L(e)
+ mtctr r10
+ lwzu r28, 4(r4)
+ bdz L(xe0)
+
+L(loop0):
+ srw r12, r28, r6
+ slw r24, r28, r8
+ lwzu r28, 4(r4)
+ or r24, r0, r24
+ stwu r24, 4(r7)
+ mr r0, r12
+ bdnz L(loop0) C taken at most once!
+
+L(xe0): srw r12, r28, r6
+ slw r24, r28, r8
+ or r24, r0, r24
+ stwu r24, 4(r7)
+ mr r0, r12
+
+L(e): srwi r5, r5, 2 C count for unrolled loop
+ addi r5, r5, -1
+ mtctr r5
+ lwz r28, 4(r4)
+ lwz r29, 8(r4)
+ lwz r30, 12(r4)
+ lwzu r31, 16(r4)
+
+L(loopU):
+ srw r9, r28, r6
+ slw r24, r28, r8
+ lwz r28, 4(r4)
+ srw r10, r29, r6
+ slw r25, r29, r8
+ lwz r29, 8(r4)
+ srw r11, r30, r6
+ slw r26, r30, r8
+ lwz r30, 12(r4)
+ srw r12, r31, r6
+ slw r27, r31, r8
+ lwzu r31, 16(r4)
+ or r24, r0, r24
+ stw r24, 4(r7)
+ or r25, r9, r25
+ stw r25, 8(r7)
+ or r26, r10, r26
+ stw r26, 12(r7)
+ or r27, r11, r27
+ stwu r27, 16(r7)
+ mr r0, r12
+ bdnz L(loopU)
+
+ srw r9, r28, r6
+ slw r24, r28, r8
+ srw r10, r29, r6
+ slw r25, r29, r8
+ srw r11, r30, r6
+ slw r26, r30, r8
+ srw r12, r31, r6
+ slw r27, r31, r8
+ or r24, r0, r24
+ stw r24, 4(r7)
+ or r25, r9, r25
+ stw r25, 8(r7)
+ or r26, r10, r26
+ stw r26, 12(r7)
+ or r27, r11, r27
+ stw r27, 16(r7)
+
+ stw r12, 20(r7)
+ lmw r24, -32(r1) C restore registers
+ blr
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc32/sec_tabselect.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc32/sec_tabselect.asm
new file mode 100644
index 00000000000..a3f24d56780
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc32/sec_tabselect.asm
@@ -0,0 +1,141 @@
+dnl PowerPC-32 mpn_sec_tabselect.
+
+dnl Contributed to the GNU project by Torbjörn Granlund.
+
+dnl Copyright 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/limb
+C 603e: ?
+C 604e: ?
+C 75x (G3): ?
+C 7400,7410 (G4): 2.5
+C 744x,745x (G4+): 2.0
+C power4/ppc970: 2.0
+C power5: ?
+
+define(`rp', `r3')
+define(`tp', `r4')
+define(`n', `r5')
+define(`nents', `r6')
+define(`which', `r7')
+
+define(`i', `r8')
+define(`j', `r9')
+define(`stride', `r12')
+define(`mask', `r11')
+
+
+ASM_START()
+PROLOGUE(mpn_sec_tabselect)
+ addic. j, n, -4 C outer loop induction variable
+ stmw r27, -32(r1)
+ slwi stride, n, 2
+
+ blt cr0, L(outer_end)
+L(outer_top):
+ mtctr nents
+ mr r10, tp
+ li r28, 0
+ li r29, 0
+ li r30, 0
+ li r31, 0
+ addic. j, j, -4 C outer loop induction variable
+ mr i, which
+
+ ALIGN(16)
+L(top): addic i, i, -1 C set carry iff i != 0
+ subfe mask, mask, mask
+ lwz r0, 0(tp)
+ lwz r27, 4(tp)
+ and r0, r0, mask
+ and r27, r27, mask
+ or r28, r28, r0
+ or r29, r29, r27
+ lwz r0, 8(tp)
+ lwz r27, 12(tp)
+ and r0, r0, mask
+ and r27, r27, mask
+ or r30, r30, r0
+ or r31, r31, r27
+ add tp, tp, stride
+ bdnz L(top)
+
+ stw r28, 0(rp)
+ stw r29, 4(rp)
+ stw r30, 8(rp)
+ stw r31, 12(rp)
+ addi tp, r10, 16
+ addi rp, rp, 16
+ bge cr0, L(outer_top)
+L(outer_end):
+
+ andi. r0, n, 2
+ beq cr0, L(b0x)
+L(b1x): mtctr nents
+ mr r10, tp
+ li r28, 0
+ li r29, 0
+ mr i, which
+ ALIGN(16)
+L(tp2): addic i, i, -1
+ subfe mask, mask, mask
+ lwz r0, 0(tp)
+ lwz r27, 4(tp)
+ and r0, r0, mask
+ and r27, r27, mask
+ or r28, r28, r0
+ or r29, r29, r27
+ add tp, tp, stride
+ bdnz L(tp2)
+ stw r28, 0(rp)
+ stw r29, 4(rp)
+ addi tp, r10, 8
+ addi rp, rp, 8
+
+L(b0x): andi. r0, n, 1
+ beq cr0, L(b00)
+L(b01): mtctr nents
+ mr r10, tp
+ li r28, 0
+ mr i, which
+ ALIGN(16)
+L(tp1): addic i, i, -1
+ subfe mask, mask, mask
+ lwz r0, 0(tp)
+ and r0, r0, mask
+ or r28, r28, r0
+ add tp, tp, stride
+ bdnz L(tp1)
+ stw r28, 0(rp)
+
+L(b00): lmw r27, -32(r1)
+ blr
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc32/sqr_diag_addlsh1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc32/sqr_diag_addlsh1.asm
new file mode 100644
index 00000000000..f7aba33ee59
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc32/sqr_diag_addlsh1.asm
@@ -0,0 +1,80 @@
+dnl PowerPC-32 mpn_sqr_diag_addlsh1.
+
+dnl Copyright 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/limb
+C 603e ?
+C 604e ?
+C 75x (G3) ?
+C 7400,7410 (G4) ?
+C 744x,745x (G4+) 6
+C power4/ppc970 ?
+C power5 ?
+
+C This has been feebly optimised for 7447 but not for any other CPU.
+
+define(`rp', r3)
+define(`tp', r4)
+define(`up', r5)
+define(`n', r6)
+
+ASM_START()
+PROLOGUE(mpn_sqr_diag_addlsh1)
+ addi n, n, -1
+ addi tp, tp, -4
+ mtctr n
+ lwz r0, 0(up)
+ li r10, 0
+ mullw r7, r0, r0
+ stw r7, 0(rp)
+ mulhwu r6, r0, r0
+ addic r31, r31, 0 C clear CF
+
+ ALIGN(16)
+L(top): lwzu r0, 4(up)
+ mullw r7, r0, r0
+ lwz r8, 4(tp)
+ lwzu r9, 8(tp)
+ rlwimi r10, r8, 1,0,30
+ srwi r11, r8, 31
+ rlwimi r11, r9, 1,0,30
+ adde r10, r10, r6
+ adde r11, r11, r7
+ stw r10, 4(rp)
+ srwi r10, r9, 31
+ mulhwu r6, r0, r0
+ stwu r11, 8(rp)
+ bdnz L(top)
+
+ adde r10, r10, r6
+ stw r10, 4(rp)
+ blr
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc32/sublsh1_n.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc32/sublsh1_n.asm
new file mode 100644
index 00000000000..6dc6460016f
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc32/sublsh1_n.asm
@@ -0,0 +1,101 @@
+dnl PowerPC-32 mpn_sublsh1_n -- rp[] = up[] - (vp[] << 1)
+
+dnl Copyright 2003, 2005, 2007 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 603e: ?
+C 604e: 4.0
+C 75x (G3): 5.0
+C 7400,7410 (G4): 5.0
+C 744x,745x (G4+): 5.0
+C power4/ppc970: 4.25
+C power5: 5.0
+
+C INPUT PARAMETERS
+C rp r3
+C up r4
+C vp r5
+C n r6
+
+define(`rp',`r3')
+define(`up',`r4')
+define(`vp',`r5')
+
+define(`s0',`r6')
+define(`s1',`r7')
+define(`u0',`r8')
+define(`v0',`r10')
+define(`v1',`r11')
+
+ASM_START()
+PROLOGUE(mpn_sublsh1_n)
+ mtctr r6 C copy n in ctr
+
+ lwz v0, 0(vp) C load v limb
+ lwz u0, 0(up) C load u limb
+ addic up, up, -4 C update up; set cy
+ addi rp, rp, -4 C update rp
+ slwi s1, v0, 1
+ bdz L(end) C If done, skip loop
+
+L(loop):
+ lwz v1, 4(vp) C load v limb
+ subfe s1, s1, u0 C add limbs with cy, set cy
+ srwi s0, v0, 31 C shift down previous v limb
+ stw s1, 4(rp) C store result limb
+ lwzu u0, 8(up) C load u limb and update up
+ rlwimi s0, v1, 1, 0,30 C left shift v limb and merge with prev v limb
+
+ bdz L(exit) C decrement ctr and exit if done
+
+ lwzu v0, 8(vp) C load v limb and update vp
+ subfe s0, s0, u0 C add limbs with cy, set cy
+ srwi s1, v1, 31 C shift down previous v limb
+ stwu s0, 8(rp) C store result limb and update rp
+ lwz u0, 4(up) C load u limb
+ rlwimi s1, v0, 1, 0,30 C left shift v limb and merge with prev v limb
+
+ bdnz L(loop) C decrement ctr and loop back
+
+L(end): subfe r7, s1, u0
+ srwi r4, v0, 31
+ stw r7, 4(rp) C store last result limb
+ subfze r3, r4
+ neg r3, r3
+ blr
+L(exit):
+ subfe r7, s0, u0
+ srwi r4, v1, 31
+ stw r7, 8(rp) C store last result limb
+ subfze r3, r4
+ neg r3, r3
+ blr
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc32/submul_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc32/submul_1.asm
new file mode 100644
index 00000000000..9fcdaa291b0
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc32/submul_1.asm
@@ -0,0 +1,147 @@
+dnl PowerPC-32 mpn_submul_1 -- Multiply a limb vector with a limb and subtract
+dnl the result from a second limb vector.
+
+dnl Copyright 1995, 1997, 1998, 2000, 2002, 2005 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 603e: ?
+C 604e: 7.5
+C 75x (G3): 9.3-15
+C 7400,7410 (G4): 9.3-15
+C 744x,745x (G4+): 10.5
+C power4/ppc970: 6.75
+C power5: 6.5
+
+C INPUT PARAMETERS
+C rp r3
+C up r4
+C n r5
+C vl r6
+
+C This is optimized for the PPC604. See addmul_1.asm for additional comments.
+
+ASM_START()
+PROLOGUE(mpn_submul_1)
+ cmpwi cr0,r5,9 C more than 9 limbs?
+ bgt cr0,L(big) C branch if more than 9 limbs
+
+ mtctr r5
+ lwz r0,0(r4)
+ mullw r7,r0,r6
+ mulhwu r10,r0,r6
+ lwz r9,0(r3)
+ subfc r8,r7,r9
+ addc r7,r7,r8 C invert cy (r7 is junk)
+ addi r3,r3,-4
+ bdz L(end)
+L(loop):
+ lwzu r0,4(r4)
+ stwu r8,4(r3)
+ mullw r8,r0,r6
+ adde r7,r8,r10
+ mulhwu r10,r0,r6
+ lwz r9,4(r3)
+ addze r10,r10
+ subfc r8,r7,r9
+ addc r7,r7,r8 C invert cy (r7 is junk)
+ bdnz L(loop)
+L(end): stw r8,4(r3)
+ addze r3,r10
+ blr
+
+L(big): stmw r30,-32(r1)
+ addi r5,r5,-1
+ srwi r0,r5,2
+ mtctr r0
+
+ lwz r7,0(r4)
+ mullw r8,r7,r6
+ mulhwu r0,r7,r6
+ lwz r7,0(r3)
+ subfc r7,r8,r7
+ addc r8,r8,r7
+ stw r7,0(r3)
+
+L(loopU):
+ lwz r7,4(r4)
+ lwz r12,8(r4)
+ lwz r30,12(r4)
+ lwzu r31,16(r4)
+ mullw r8,r7,r6
+ mullw r9,r12,r6
+ mullw r10,r30,r6
+ mullw r11,r31,r6
+ adde r8,r8,r0 C add cy_limb
+ mulhwu r0,r7,r6
+ lwz r7,4(r3)
+ adde r9,r9,r0
+ mulhwu r0,r12,r6
+ lwz r12,8(r3)
+ adde r10,r10,r0
+ mulhwu r0,r30,r6
+ lwz r30,12(r3)
+ adde r11,r11,r0
+ mulhwu r0,r31,r6
+ lwz r31,16(r3)
+ addze r0,r0 C new cy_limb
+ subfc r7,r8,r7
+ stw r7,4(r3)
+ subfe r12,r9,r12
+ stw r12,8(r3)
+ subfe r30,r10,r30
+ stw r30,12(r3)
+ subfe r31,r11,r31
+ stwu r31,16(r3)
+ subfe r11,r11,r11 C invert ...
+ addic r11,r11,1 C ... carry
+ bdnz L(loopU)
+
+ andi. r31,r5,3
+ mtctr r31
+ beq cr0,L(endx)
+
+L(loopE):
+ lwzu r7,4(r4)
+ mullw r8,r7,r6
+ adde r8,r8,r0 C add cy_limb
+ mulhwu r0,r7,r6
+ lwz r7,4(r3)
+ addze r0,r0 C new cy_limb
+ subfc r7,r8,r7
+ addc r8,r8,r7
+ stwu r7,4(r3)
+ bdnz L(loopE)
+L(endx):
+ addze r3,r0
+ lmw r30,-32(r1)
+ blr
+EPILOGUE(mpn_submul_1)
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc32/umul.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc32/umul.asm
new file mode 100644
index 00000000000..a5811e1651f
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc32/umul.asm
@@ -0,0 +1,50 @@
+dnl PowerPC-32 umul_ppmm -- support for longlong.h
+
+dnl Copyright 2000, 2001 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 mp_limb_t mpn_umul_ppmm (mp_limb_t *lowptr, mp_limb_t m1, mp_limb_t m2);
+C
+
+ASM_START()
+PROLOGUE(mpn_umul_ppmm)
+
+ C r3 lowptr
+ C r4 m1
+ C r5 m2
+
+ mullw r0, r4, r5
+ mulhwu r9, r4, r5
+ stw r0, 0(r3)
+ mr r3, r9
+ blr
+
+EPILOGUE(mpn_umul_ppmm)
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc32/vmx/copyd.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc32/vmx/copyd.asm
new file mode 100644
index 00000000000..6aac6b83896
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc32/vmx/copyd.asm
@@ -0,0 +1,203 @@
+dnl PowerPC-32/VMX and PowerPC-64/VMX mpn_copyd.
+
+dnl Copyright 2006 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 16-byte coaligned unaligned
+C cycles/limb cycles/limb
+C 7400,7410 (G4): 0.5 0.64
+C 744x,745x (G4+): 0.75 0.82
+C 970 (G5): 0.78 1.02 (64-bit limbs)
+
+C STATUS
+C * Works for all sizes and alignments.
+
+C TODO
+C * Optimize unaligned case. Some basic tests with 2-way and 4-way unrolling
+C indicate that we can reach 0.56 c/l for 7400, 0.75 c/l for 745x, and 0.80
+C c/l for 970.
+C * Consider using VMX instructions also for head and tail, by using some
+C read-modify-write tricks.
+C * The VMX code is used from the smallest sizes it handles, but measurements
+C show a large speed bump at the cutoff points. Small copying (perhaps
+C using some read-modify-write technique) should be optimized.
+C * Make a mpn_com based on this code.
+
+define(`GMP_LIMB_BYTES', eval(GMP_LIMB_BITS/8))
+define(`LIMBS_PER_VR', eval(16/GMP_LIMB_BYTES))
+define(`LIMBS_PER_2VR', eval(32/GMP_LIMB_BYTES))
+
+
+ifelse(GMP_LIMB_BITS,32,`
+ define(`LIMB32',` $1')
+ define(`LIMB64',`')
+',`
+ define(`LIMB32',`')
+ define(`LIMB64',` $1')
+')
+
+C INPUT PARAMETERS
+define(`rp', `r3')
+define(`up', `r4')
+define(`n', `r5')
+
+define(`us', `v4')
+
+
+ASM_START()
+PROLOGUE(mpn_copyd)
+
+LIMB32(`slwi. r0, n, 2 ')
+LIMB64(`sldi. r0, n, 3 ')
+ add rp, rp, r0
+ add up, up, r0
+
+LIMB32(`cmpi cr7, n, 11 ')
+LIMB64(`cmpdi cr7, n, 5 ')
+ bge cr7, L(big)
+
+ beqlr cr0
+
+C Handle small cases with plain operations
+ mtctr n
+L(topS):
+LIMB32(`lwz r0, -4(up) ')
+LIMB64(`ld r0, -8(up) ')
+ addi up, up, -GMP_LIMB_BYTES
+LIMB32(`stw r0, -4(rp) ')
+LIMB64(`std r0, -8(rp) ')
+ addi rp, rp, -GMP_LIMB_BYTES
+ bdnz L(topS)
+ blr
+
+C Handle large cases with VMX operations
+L(big):
+ addi rp, rp, -16
+ addi up, up, -16
+ mfspr r12, 256
+ oris r0, r12, 0xf800 C Set VRSAVE bit 0-4
+ mtspr 256, r0
+
+LIMB32(`rlwinm. r7, rp, 30,30,31') C (rp >> 2) mod 4
+LIMB64(`rlwinm. r7, rp, 29,31,31') C (rp >> 3) mod 2
+ beq L(rp_aligned)
+
+ subf n, r7, n
+L(top0):
+LIMB32(`lwz r0, 12(up) ')
+LIMB64(`ld r0, 8(up) ')
+ addi up, up, -GMP_LIMB_BYTES
+LIMB32(`addic. r7, r7, -1 ')
+LIMB32(`stw r0, 12(rp) ')
+LIMB64(`std r0, 8(rp) ')
+ addi rp, rp, -GMP_LIMB_BYTES
+LIMB32(`bne L(top0) ')
+
+L(rp_aligned):
+
+LIMB32(`rlwinm. r0, up, 30,30,31') C (up >> 2) mod 4
+LIMB64(`rlwinm. r0, up, 29,31,31') C (up >> 3) mod 2
+
+LIMB64(`srdi r7, n, 2 ') C loop count corresponding to n
+LIMB32(`srwi r7, n, 3 ') C loop count corresponding to n
+ mtctr r7 C copy n to count register
+
+ li r10, -16
+
+ beq L(up_aligned)
+
+ lvsl us, 0, up
+
+ addi up, up, 16
+LIMB32(`andi. r0, n, 0x4 ')
+LIMB64(`andi. r0, n, 0x2 ')
+ beq L(1)
+ lvx v0, 0, up
+ lvx v2, r10, up
+ vperm v3, v2, v0, us
+ stvx v3, 0, rp
+ addi up, up, -32
+ addi rp, rp, -16
+ b L(lpu)
+L(1): lvx v2, 0, up
+ addi up, up, -16
+ b L(lpu)
+
+ ALIGN(32)
+L(lpu): lvx v0, 0, up
+ vperm v3, v0, v2, us
+ stvx v3, 0, rp
+ lvx v2, r10, up
+ addi up, up, -32
+ vperm v3, v2, v0, us
+ stvx v3, r10, rp
+ addi rp, rp, -32
+ bdnz L(lpu)
+
+ b L(tail)
+
+L(up_aligned):
+
+LIMB32(`andi. r0, n, 0x4 ')
+LIMB64(`andi. r0, n, 0x2 ')
+ beq L(lpa)
+ lvx v0, 0, up
+ stvx v0, 0, rp
+ addi up, up, -16
+ addi rp, rp, -16
+ b L(lpa)
+
+ ALIGN(32)
+L(lpa): lvx v0, 0, up
+ lvx v1, r10, up
+ addi up, up, -32
+ nop
+ stvx v0, 0, rp
+ stvx v1, r10, rp
+ addi rp, rp, -32
+ bdnz L(lpa)
+
+L(tail):
+LIMB32(`rlwinm. r7, n, 0,30,31 ') C r7 = n mod 4
+LIMB64(`rlwinm. r7, n, 0,31,31 ') C r7 = n mod 2
+ beq L(ret)
+LIMB32(`li r10, 12 ')
+L(top2):
+LIMB32(`lwzx r0, r10, up ')
+LIMB64(`ld r0, 8(up) ')
+LIMB32(`addic. r7, r7, -1 ')
+LIMB32(`stwx r0, r10, rp ')
+LIMB64(`std r0, 8(rp) ')
+LIMB32(`addi r10, r10, -GMP_LIMB_BYTES')
+LIMB32(`bne L(top2) ')
+
+L(ret): mtspr 256, r12
+ blr
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc32/vmx/copyi.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc32/vmx/copyi.asm
new file mode 100644
index 00000000000..a97a0fa6dc8
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc32/vmx/copyi.asm
@@ -0,0 +1,198 @@
+dnl PowerPC-32/VMX and PowerPC-64/VMX mpn_copyi.
+
+dnl Copyright 2006 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 16-byte coaligned unaligned
+C cycles/limb cycles/limb
+C 7400,7410 (G4): 0.5 0.64
+C 744x,745x (G4+): 0.75 0.82
+C 970 (G5): 0.78 1.02 (64-bit limbs)
+
+C STATUS
+C * Works for all sizes and alignments.
+
+C TODO
+C * Optimize unaligned case. Some basic tests with 2-way and 4-way unrolling
+C indicate that we can reach 0.56 c/l for 7400, 0.75 c/l for 745x, and 0.80
+C c/l for 970.
+C * Consider using VMX instructions also for head and tail, by using some
+C read-modify-write tricks.
+C * The VMX code is used from the smallest sizes it handles, but measurements
+C show a large speed bump at the cutoff points. Small copying (perhaps
+C using some read-modify-write technique) should be optimized.
+C * Make a mpn_com based on this code.
+
+define(`GMP_LIMB_BYTES', eval(GMP_LIMB_BITS/8))
+define(`LIMBS_PER_VR', eval(16/GMP_LIMB_BYTES))
+define(`LIMBS_PER_2VR', eval(32/GMP_LIMB_BYTES))
+
+
+ifelse(GMP_LIMB_BITS,32,`
+ define(`LIMB32',` $1')
+ define(`LIMB64',`')
+',`
+ define(`LIMB32',`')
+ define(`LIMB64',` $1')
+')
+
+C INPUT PARAMETERS
+define(`rp', `r3')
+define(`up', `r4')
+define(`n', `r5')
+
+define(`us', `v4')
+
+
+ASM_START()
+PROLOGUE(mpn_copyi)
+
+LIMB32(`cmpi cr7, n, 11 ')
+LIMB64(`cmpdi cr7, n, 5 ')
+ bge cr7, L(big)
+
+ or. r0, n, n
+ beqlr cr0
+
+C Handle small cases with plain operations
+ mtctr n
+L(topS):
+LIMB32(`lwz r0, 0(up) ')
+LIMB64(`ld r0, 0(up) ')
+ addi up, up, GMP_LIMB_BYTES
+LIMB32(`stw r0, 0(rp) ')
+LIMB64(`std r0, 0(rp) ')
+ addi rp, rp, GMP_LIMB_BYTES
+ bdnz L(topS)
+ blr
+
+C Handle large cases with VMX operations
+L(big):
+ mfspr r12, 256
+ oris r0, r12, 0xf800 C Set VRSAVE bit 0-4
+ mtspr 256, r0
+
+LIMB32(`rlwinm. r7, rp, 30,30,31') C (rp >> 2) mod 4
+LIMB64(`rlwinm. r7, rp, 29,31,31') C (rp >> 3) mod 2
+ beq L(rp_aligned)
+
+ subfic r7, r7, LIMBS_PER_VR
+ subf n, r7, n
+L(top0):
+LIMB32(`lwz r0, 0(up) ')
+LIMB64(`ld r0, 0(up) ')
+ addi up, up, GMP_LIMB_BYTES
+LIMB32(`addic. r7, r7, -1 ')
+LIMB32(`stw r0, 0(rp) ')
+LIMB64(`std r0, 0(rp) ')
+ addi rp, rp, GMP_LIMB_BYTES
+LIMB32(`bne L(top0) ')
+
+L(rp_aligned):
+
+LIMB32(`rlwinm. r0, up, 30,30,31') C (up >> 2) mod 4
+LIMB64(`rlwinm. r0, up, 29,31,31') C (up >> 3) mod 2
+
+LIMB64(`srdi r7, n, 2 ') C loop count corresponding to n
+LIMB32(`srwi r7, n, 3 ') C loop count corresponding to n
+ mtctr r7 C copy n to count register
+
+ li r10, 16
+
+ beq L(up_aligned)
+
+ lvsl us, 0, up
+
+LIMB32(`andi. r0, n, 0x4 ')
+LIMB64(`andi. r0, n, 0x2 ')
+ beq L(1)
+ lvx v0, 0, up
+ lvx v2, r10, up
+ vperm v3, v0, v2, us
+ stvx v3, 0, rp
+ addi up, up, 32
+ addi rp, rp, 16
+ b L(lpu)
+L(1): lvx v2, 0, up
+ addi up, up, 16
+ b L(lpu)
+
+ ALIGN(32)
+L(lpu): lvx v0, 0, up
+ vperm v3, v2, v0, us
+ stvx v3, 0, rp
+ lvx v2, r10, up
+ addi up, up, 32
+ vperm v3, v0, v2, us
+ stvx v3, r10, rp
+ addi rp, rp, 32
+ bdnz L(lpu)
+
+ addi up, up, -16
+ b L(tail)
+
+L(up_aligned):
+
+LIMB32(`andi. r0, n, 0x4 ')
+LIMB64(`andi. r0, n, 0x2 ')
+ beq L(lpa)
+ lvx v0, 0, up
+ stvx v0, 0, rp
+ addi up, up, 16
+ addi rp, rp, 16
+ b L(lpa)
+
+ ALIGN(32)
+L(lpa): lvx v0, 0, up
+ lvx v1, r10, up
+ addi up, up, 32
+ nop
+ stvx v0, 0, rp
+ stvx v1, r10, rp
+ addi rp, rp, 32
+ bdnz L(lpa)
+
+L(tail):
+LIMB32(`rlwinm. r7, n, 0,30,31 ') C r7 = n mod 4
+LIMB64(`rlwinm. r7, n, 0,31,31 ') C r7 = n mod 2
+ beq L(ret)
+LIMB32(`li r10, 0 ')
+L(top2):
+LIMB32(`lwzx r0, r10, up ')
+LIMB64(`ld r0, 0(up) ')
+LIMB32(`addic. r7, r7, -1 ')
+LIMB32(`stwx r0, r10, rp ')
+LIMB64(`std r0, 0(rp) ')
+LIMB32(`addi r10, r10, GMP_LIMB_BYTES')
+LIMB32(`bne L(top2) ')
+
+L(ret): mtspr 256, r12
+ blr
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc32/vmx/logops_n.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc32/vmx/logops_n.asm
new file mode 100644
index 00000000000..d656d3b73f7
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc32/vmx/logops_n.asm
@@ -0,0 +1,310 @@
+dnl PowerPC-32/VMX and PowerPC-64/VMX mpn_and_n, mpn_andn_n, mpn_nand_n,
+dnl mpn_ior_n, mpn_iorn_n, mpn_nior_n, mpn_xor_n, mpn_xnor_n -- mpn bitwise
+dnl logical operations.
+
+dnl Copyright 2006 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 and,ior,andn,nior,xor iorn,xnor nand
+C cycles/limb cycles/limb cycles/limb
+C 7400,7410 (G4): 1.39 ? ?
+C 744x,745x (G4+): 1.14 1.39 1.39
+C 970: 1.7 2.0 2.0
+
+C STATUS
+C * Works for all sizes and alignment for 32-bit limbs.
+C * Works for n >= 4 for 64-bit limbs; untested for smaller operands.
+C * Current performance makes this pointless for 970
+
+C TODO
+C * Might want to make variants when just one of the source operands needs
+C vperm, and when neither needs it. The latter runs 50% faster on 7400.
+C * Idea: If the source operands are equally aligned, we could do the logops
+C first, then vperm before storing! That means we never need more than one
+C vperm, ever!
+C * Perhaps align `rp' after initial alignment loop?
+C * Instead of having scalar code in the beginning and end, consider using
+C read-modify-write vector code.
+C * Software pipeline? Hopefully not too important, this is hairy enough
+C already.
+C * At least be more clever about operand loading, i.e., load v operands before
+C u operands, since v operands are sometimes negated.
+
+define(`GMP_LIMB_BYTES', eval(GMP_LIMB_BITS/8))
+define(`LIMBS_PER_VR', eval(16/GMP_LIMB_BYTES))
+define(`LIMBS_PER_2VR', eval(32/GMP_LIMB_BYTES))
+
+define(`vnegb', `') C default neg-before to null
+define(`vnega', `') C default neg-before to null
+
+ifdef(`OPERATION_and_n',
+` define(`func', `mpn_and_n')
+ define(`logopS',`and $1,$2,$3')
+ define(`logop', `vand $1,$2,$3')')
+ifdef(`OPERATION_andn_n',
+` define(`func', `mpn_andn_n')
+ define(`logopS',`andc $1,$2,$3')
+ define(`logop', `vandc $1,$2,$3')')
+ifdef(`OPERATION_nand_n',
+` define(`func', `mpn_nand_n')
+ define(`logopS',`nand $1,$2,$3')
+ define(`logop', `vand $1,$2,$3')
+ define(`vnega', `vnor $1,$2,$2')')
+ifdef(`OPERATION_ior_n',
+` define(`func', `mpn_ior_n')
+ define(`logopS',`or $1,$2,$3')
+ define(`logop', `vor $1,$2,$3')')
+ifdef(`OPERATION_iorn_n',
+` define(`func', `mpn_iorn_n')
+ define(`logopS',`orc $1,$2,$3')
+ define(`vnegb', `vnor $1,$2,$2')
+ define(`logop', `vor $1,$2,$3')')
+ifdef(`OPERATION_nior_n',
+` define(`func', `mpn_nior_n')
+ define(`logopS',`nor $1,$2,$3')
+ define(`logop', `vnor $1,$2,$3')')
+ifdef(`OPERATION_xor_n',
+` define(`func', `mpn_xor_n')
+ define(`logopS',`xor $1,$2,$3')
+ define(`logop', `vxor $1,$2,$3')')
+ifdef(`OPERATION_xnor_n',
+` define(`func',`mpn_xnor_n')
+ define(`logopS',`eqv $1,$2,$3')
+ define(`vnegb', `vnor $1,$2,$2')
+ define(`logop', `vxor $1,$2,$3')')
+
+ifelse(GMP_LIMB_BITS,`32',`
+ define(`LIMB32',` $1')
+ define(`LIMB64',`')
+',`
+ define(`LIMB32',`')
+ define(`LIMB64',` $1')
+')
+
+C INPUT PARAMETERS
+define(`rp', `r3')
+define(`up', `r4')
+define(`vp', `r5')
+define(`n', `r6')
+
+define(`us', `v8')
+define(`vs', `v9')
+
+MULFUNC_PROLOGUE(mpn_and_n mpn_andn_n mpn_nand_n mpn_ior_n mpn_iorn_n mpn_nior_n mpn_xor_n mpn_xnor_n)
+
+ASM_START()
+PROLOGUE(func)
+
+LIMB32(`cmpwi cr0, n, 8 ')
+LIMB64(`cmpdi cr0, n, 4 ')
+ bge L(big)
+
+ mtctr n
+
+LIMB32(`lwz r8, 0(up) ')
+LIMB32(`lwz r9, 0(vp) ')
+LIMB32(`logopS( r0, r8, r9) ')
+LIMB32(`stw r0, 0(rp) ')
+LIMB32(`bdz L(endS) ')
+
+L(topS):
+LIMB32(`lwzu r8, 4(up) ')
+LIMB64(`ld r8, 0(up) ')
+LIMB64(`addi up, up, GMP_LIMB_BYTES ')
+LIMB32(`lwzu r9, 4(vp) ')
+LIMB64(`ld r9, 0(vp) ')
+LIMB64(`addi vp, vp, GMP_LIMB_BYTES ')
+ logopS( r0, r8, r9)
+LIMB32(`stwu r0, 4(rp) ')
+LIMB64(`std r0, 0(rp) ')
+LIMB64(`addi rp, rp, GMP_LIMB_BYTES ')
+ bdnz L(topS)
+L(endS):
+ blr
+
+L(big): mfspr r12, 256
+ oris r0, r12, 0xfffc C Set VRSAVE bit 0-13 FIXME
+ mtspr 256, r0
+
+C First loop until the destination is 16-byte aligned. This will execute 0 or 1
+C times for 64-bit machines, and 0 to 3 times for 32-bit machines.
+
+LIMB32(`rlwinm. r0, rp, 30,30,31') C (rp >> 2) mod 4
+LIMB64(`rlwinm. r0, rp, 29,31,31') C (rp >> 3) mod 2
+ beq L(aligned)
+
+ subfic r7, r0, LIMBS_PER_VR
+LIMB32(`li r10, 0 ')
+ subf n, r7, n
+L(top0):
+LIMB32(`lwz r8, 0(up) ')
+LIMB64(`ld r8, 0(up) ')
+ addi up, up, GMP_LIMB_BYTES
+LIMB32(`lwz r9, 0(vp) ')
+LIMB64(`ld r9, 0(vp) ')
+ addi vp, vp, GMP_LIMB_BYTES
+LIMB32(`addic. r7, r7, -1 ')
+ logopS( r0, r8, r9)
+LIMB32(`stwx r0, r10, rp ')
+LIMB64(`std r0, 0(rp) ')
+LIMB32(`addi r10, r10, GMP_LIMB_BYTES')
+LIMB32(`bne L(top0) ')
+
+ addi rp, rp, 16 C update rp, but preserve its alignment
+
+L(aligned):
+LIMB64(`srdi r7, n, 1 ') C loop count corresponding to n
+LIMB32(`srwi r7, n, 2 ') C loop count corresponding to n
+ mtctr r7 C copy n to count register
+
+ li r10, 16
+ lvsl us, 0, up
+ lvsl vs, 0, vp
+
+ lvx v2, 0, up
+ lvx v3, 0, vp
+ bdnz L(gt1)
+ lvx v0, r10, up
+ lvx v1, r10, vp
+ vperm v4, v2, v0, us
+ vperm v5, v3, v1, vs
+ vnegb( v5, v5)
+ logop( v6, v4, v5)
+ vnega( v6, v6)
+ stvx v6, 0, rp
+ addi up, up, 16
+ addi vp, vp, 16
+ addi rp, rp, 4
+ b L(tail)
+
+L(gt1): addi up, up, 16
+ addi vp, vp, 16
+
+L(top): lvx v0, 0, up
+ lvx v1, 0, vp
+ vperm v4, v2, v0, us
+ vperm v5, v3, v1, vs
+ vnegb( v5, v5)
+ logop( v6, v4, v5)
+ vnega( v6, v6)
+ stvx v6, 0, rp
+ bdz L(end)
+ lvx v2, r10, up
+ lvx v3, r10, vp
+ vperm v4, v0, v2, us
+ vperm v5, v1, v3, vs
+ vnegb( v5, v5)
+ logop( v6, v4, v5)
+ vnega( v6, v6)
+ stvx v6, r10, rp
+ addi up, up, 32
+ addi vp, vp, 32
+ addi rp, rp, 32
+ bdnz L(top)
+
+ andi. r0, up, 15
+ vxor v0, v0, v0
+ beq 1f
+ lvx v0, 0, up
+1: andi. r0, vp, 15
+ vxor v1, v1, v1
+ beq 1f
+ lvx v1, 0, vp
+1: vperm v4, v2, v0, us
+ vperm v5, v3, v1, vs
+ vnegb( v5, v5)
+ logop( v6, v4, v5)
+ vnega( v6, v6)
+ stvx v6, 0, rp
+ addi rp, rp, 4
+ b L(tail)
+
+L(end): andi. r0, up, 15
+ vxor v2, v2, v2
+ beq 1f
+ lvx v2, r10, up
+1: andi. r0, vp, 15
+ vxor v3, v3, v3
+ beq 1f
+ lvx v3, r10, vp
+1: vperm v4, v0, v2, us
+ vperm v5, v1, v3, vs
+ vnegb( v5, v5)
+ logop( v6, v4, v5)
+ vnega( v6, v6)
+ stvx v6, r10, rp
+
+ addi up, up, 16
+ addi vp, vp, 16
+ addi rp, rp, 20
+
+L(tail):
+LIMB32(`rlwinm. r7, n, 0,30,31 ') C r7 = n mod 4
+LIMB64(`rlwinm. r7, n, 0,31,31 ') C r7 = n mod 2
+ beq L(ret)
+ addi rp, rp, 15
+LIMB32(`rlwinm rp, rp, 0,0,27 ')
+LIMB64(`rldicr rp, rp, 0,59 ')
+ li r10, 0
+L(top2):
+LIMB32(`lwzx r8, r10, up ')
+LIMB64(`ldx r8, r10, up ')
+LIMB32(`lwzx r9, r10, vp ')
+LIMB64(`ldx r9, r10, vp ')
+LIMB32(`addic. r7, r7, -1 ')
+ logopS( r0, r8, r9)
+LIMB32(`stwx r0, r10, rp ')
+LIMB64(`std r0, 0(rp) ')
+LIMB32(`addi r10, r10, GMP_LIMB_BYTES')
+LIMB32(`bne L(top2) ')
+
+L(ret): mtspr 256, r12
+ blr
+EPILOGUE()
+
+C This works for 64-bit PowerPC, since a limb ptr can only be aligned
+C in 2 relevant ways, which means we can always find a pair of aligned
+C pointers of rp, up, and vp.
+C process words until rp is 16-byte aligned
+C if (((up | vp) & 15) == 0)
+C process with VMX without any vperm
+C else if ((up & 15) != 0 && (vp & 15) != 0)
+C process with VMX using vperm on store data
+C else if ((up & 15) != 0)
+C process with VMX using vperm on up data
+C else
+C process with VMX using vperm on vp data
+C
+C rlwinm, r0, up, 0,28,31
+C rlwinm r0, vp, 0,28,31
+C cmpwi cr7, r0, 0
+C cror cr6, cr0, cr7
+C crand cr0, cr0, cr7
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc32/vmx/mod_34lsub1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc32/vmx/mod_34lsub1.asm
new file mode 100644
index 00000000000..9b7e4f1a503
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc32/vmx/mod_34lsub1.asm
@@ -0,0 +1,386 @@
+dnl PowerPC-32 mpn_mod_34lsub1 -- mpn remainder mod 2^24-1.
+
+dnl Copyright 2002, 2003, 2005-2007, 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/limb
+C 603e: -
+C 604e: -
+C 75x (G3): -
+C 7400,7410 (G4): 1 simple load-use scheduling results in 0.75
+C 744x,745x (G4+): 0.75
+C ppc970: 0.75
+C power4: -
+C power5: -
+
+C TODO
+C * Either start using the low-end masking constants, or remove them.
+C * Merge multiple feed-in cases into a parameterized code block.
+C * Reduce register usage. It should be possible to almost halve it.
+
+define(`up', `r3')
+define(`n', `r4')
+
+define(`a0', `v3')
+define(`a1', `v4')
+define(`a2', `v5')
+define(`c0', `v6')
+define(`c1', `v7')
+define(`c2', `v8')
+define(`z', `v9')
+define(`x0', `v10')
+define(`x1', `v11')
+define(`x2', `v12')
+define(`x3', `v13')
+define(`pv', `v14')
+define(`y0', `v0')
+define(`y1', `v1')
+define(`y2', `v2')
+define(`y3', `v15')
+
+ASM_START()
+PROLOGUE(mpn_mod_34lsub1)
+ cmpwi cr0, n, 20 C tuned cutoff point
+ bge L(large)
+
+ li r9, 0 C result accumulator
+ mulli r10, n, 0xb C 0xb = ceil(32/3)
+ srwi. r10, r10, 5 C r10 = floor(n/3), n < 32
+ beq L(small_tail)
+ mtctr r10
+ lwz r6, 0(up)
+ lwz r7, 4(up)
+ lwzu r8, 8(up)
+ subf n, r10, n
+ subf n, r10, n
+ subf n, r10, n
+ bdz L(small_end)
+
+ ALIGN(16)
+L(los): rlwinm r0, r6, 0,8,31
+ add r9, r9, r0 C add 24b from u0
+ srwi r0, r6, 24
+ lwz r6, 4(up)
+ rlwimi r0, r7, 8, 0x00ffff00 C --111100
+ add r9, r9, r0 C add 8b from u0 and 16b from u1
+ srwi r0, r7, 16
+ lwz r7, 8(up)
+ rlwimi r0, r8, 16, 0x00ff0000 C --221111
+ add r9, r9, r0 C add 16b from u1 and 8b from u2
+ srwi r0, r8, 8 C --222222
+ lwzu r8, 12(up)
+ add r9, r9, r0 C add 24b from u2
+ bdnz L(los)
+L(small_end):
+ rlwinm r0, r6, 0,8,31
+ add r9, r9, r0 C add 24b from u0
+ srwi r0, r6, 24
+ rlwimi r0, r7, 8, 0x00ffff00 C --111100
+ add r9, r9, r0 C add 8b from u0 and 16b from u1
+ srwi r0, r7, 16
+ rlwimi r0, r8, 16, 0x00ff0000 C --221111
+ add r9, r9, r0 C add 16b from u1 and 8b from u2
+ srwi r0, r8, 8 C --222222
+ add r9, r9, r0 C add 24b from u2
+
+ addi up, up, 4
+ rlwinm r0, r9, 0,8,31
+ srwi r9, r9, 24
+ add r9, r9, r0
+
+L(small_tail):
+ cmpi cr0, n, 1
+ blt L(ret)
+
+ lwz r6, 0(up)
+ rlwinm r0, r6, 0,8,31
+ srwi r6, r6, 24
+ add r9, r9, r0
+ add r9, r9, r6
+
+ beq L(ret)
+
+ lwz r6, 4(up)
+ rlwinm r0, r6, 8,8,23
+ srwi r6, r6, 16
+ add r9, r9, r0
+ add r9, r9, r6
+
+L(ret): mr r3, r9
+ blr
+
+
+L(large):
+ mfspr r10, 256
+ oris r0, r10, 0xffff C Set VRSAVE bit 0-15
+ mtspr 256, r0
+
+ andi. r7, up, 15
+ vxor a0, v0, v0
+ lis r9, 0xaaaa
+ vxor a1, v0, v0
+ ori r9, r9, 0xaaab
+ vxor a2, v0, v0
+ li r5, 16
+ vxor c0, v0, v0
+ li r6, 32
+ vxor c1, v0, v0
+ LEAL( r11, cnsts) C CAUTION clobbers r0 for elf, darwin
+ vxor c2, v0, v0
+ vxor z, v0, v0
+
+ beq L(aligned16)
+
+ cmpwi cr7, r7, 8
+ bge cr7, L(na4)
+
+ lvx a2, 0, up
+ addi up, up, 16
+ vsldoi a2, a2, z, 4
+ vsldoi a2, z, a2, 12
+
+ addi n, n, 9
+ mulhwu r0, n, r9
+ srwi r0, r0, 3 C r0 = floor(n/12)
+ mtctr r0
+
+ mulli r8, r0, 12
+ subf n, r8, n
+ b L(2)
+
+L(na4): bne cr7, L(na8)
+
+ lvx a1, 0, up
+ addi up, up, -16
+ vsldoi a1, a1, z, 8
+ vsldoi a1, z, a1, 8
+
+ addi n, n, 6
+ mulhwu r0, n, r9
+ srwi r0, r0, 3 C r0 = floor(n/12)
+ mtctr r0
+
+ mulli r8, r0, 12
+ subf n, r8, n
+ b L(1)
+
+L(na8):
+ lvx a0, 0, up
+ vsldoi a0, a0, z, 12
+ vsldoi a0, z, a0, 4
+
+ addi n, n, 3
+ mulhwu r0, n, r9
+ srwi r0, r0, 3 C r0 = floor(n/12)
+ mtctr r0
+
+ mulli r8, r0, 12
+ subf n, r8, n
+ b L(0)
+
+L(aligned16):
+ mulhwu r0, n, r9
+ srwi r0, r0, 3 C r0 = floor(n/12)
+ mtctr r0
+
+ mulli r8, r0, 12
+ subf n, r8, n
+
+ lvx a0, 0, up
+L(0): lvx a1, r5, up
+L(1): lvx a2, r6, up
+ addi up, up, 48
+L(2): bdz L(end)
+ li r12, 256
+ li r9, 288
+ ALIGN(32)
+L(top):
+ lvx v0, 0, up
+ vaddcuw v10, a0, v0
+ vadduwm a0, a0, v0
+ vadduwm c0, c0, v10
+
+ lvx v1, r5, up
+ vaddcuw v10, a1, v1
+ vadduwm a1, a1, v1
+ vadduwm c1, c1, v10
+
+ lvx v2, r6, up
+ dcbt up, r12
+ dcbt up, r9
+ addi up, up, 48
+ vaddcuw v10, a2, v2
+ vadduwm a2, a2, v2
+ vadduwm c2, c2, v10
+ bdnz L(top)
+
+L(end):
+C n = 0...11
+ cmpwi cr0, n, 0
+ beq L(sum)
+ cmpwi cr0, n, 4
+ ble L(tail.1..4)
+ cmpwi cr0, n, 8
+ ble L(tail.5..8)
+
+L(tail.9..11):
+ lvx v0, 0, up
+ vaddcuw v10, a0, v0
+ vadduwm a0, a0, v0
+ vadduwm c0, c0, v10
+
+ lvx v1, r5, up
+ vaddcuw v10, a1, v1
+ vadduwm a1, a1, v1
+ vadduwm c1, c1, v10
+
+ lvx v2, r6, up
+
+ addi r8, r11, 96
+ rlwinm r3, n ,4,26,27
+ lvx v11, r3, r8
+ vand v2, v2, v11
+
+ vaddcuw v10, a2, v2
+ vadduwm a2, a2, v2
+ vadduwm c2, c2, v10
+ b L(sum)
+
+L(tail.5..8):
+ lvx v0, 0, up
+ vaddcuw v10, a0, v0
+ vadduwm a0, a0, v0
+ vadduwm c0, c0, v10
+
+ lvx v1, r5, up
+
+ addi r8, r11, 96
+ rlwinm r3, n ,4,26,27
+ lvx v11, r3, r8
+ vand v1, v1, v11
+
+ vaddcuw v10, a1, v1
+ vadduwm a1, a1, v1
+ vadduwm c1, c1, v10
+ b L(sum)
+
+L(tail.1..4):
+ lvx v0, 0, up
+
+ addi r8, r11, 96
+ rlwinm r3, n ,4,26,27
+ lvx v11, r3, r8
+ vand v0, v0, v11
+
+ vaddcuw v10, a0, v0
+ vadduwm a0, a0, v0
+ vadduwm c0, c0, v10
+
+L(sum): lvx pv, 0, r11
+ vperm x0, a0, z, pv C extract 4 24-bit field from a0
+ vperm y0, c2, z, pv
+ lvx pv, r5, r11
+ vperm x1, a1, z, pv C extract 4 24-bit field from a1
+ vperm y1, c0, z, pv C extract 4 24-bit field from a1
+ lvx pv, r6, r11
+ vperm x2, a2, z, pv C extract 4 24-bit field from a1
+ vperm y2, c1, z, pv C extract 4 24-bit field from a1
+ li r10, 48
+ lvx pv, r10, r11
+ vperm x3, a0, z, pv C extract remaining/partial a0 fields
+ vperm y3, c2, z, pv C extract remaining/partial a0 fields
+ li r10, 64
+ lvx pv, r10, r11
+ vperm x3, a1, x3, pv C insert remaining/partial a1 fields
+ vperm y3, c0, y3, pv C insert remaining/partial a1 fields
+ li r10, 80
+ lvx pv, r10, r11
+ vperm x3, a2, x3, pv C insert remaining/partial a2 fields
+ vperm y3, c1, y3, pv C insert remaining/partial a2 fields
+
+C We now have 4 128-bit accumulators to sum
+ vadduwm x0, x0, x1
+ vadduwm x2, x2, x3
+ vadduwm x0, x0, x2
+
+ vadduwm y0, y0, y1
+ vadduwm y2, y2, y3
+ vadduwm y0, y0, y2
+
+ vadduwm x0, x0, y0
+
+C Reduce 32-bit fields
+ vsumsws x0, x0, z
+
+ li r7, -16 C FIXME: does all ppc32 ABIs...
+ stvx x0, r7, r1 C FIXME: ...support storing below sp?
+ lwz r3, -4(r1)
+
+ mtspr 256, r10
+ blr
+EPILOGUE()
+
+C load | v0 | v1 | v2 |
+C acc | a0 | a1 | a2 |
+C carry | c0 | c1 | c2 |
+C | 0 1 2 3 | 4 5 6 7 | 8 9 10 11 | 128
+C |---|---|---|---|---|---|---|---|---|---|---|---| 32
+C | | | | | | | | | | | | | | | | | 24
+C | | | | | | | | | 48
+
+C $---------------$---------------$---------------$---------------$
+C | . . . . . . . . . . . . . . . |
+C |_______________________________________________________________|
+C | | | | | | |
+C <-hi16-> <--- 24 --> <--- 24 --> <--- 24 --> <--- 24 --> <-lo16->
+
+
+DEF_OBJECT(cnsts,16)
+C Permutation vectors in the order they are used above
+C # 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f
+ .byte 0x10,0x01,0x02,0x03, 0x10,0x06,0x07,0x00, 0x10,0x0b,0x04,0x05, 0x10,0x08,0x09,0x0a C a0
+ .byte 0x10,0x07,0x00,0x01, 0x10,0x04,0x05,0x06, 0x10,0x09,0x0a,0x0b, 0x10,0x0e,0x0f,0x08 C a1
+ .byte 0x10,0x00,0x01,0x02, 0x10,0x05,0x06,0x07, 0x10,0x0a,0x0b,0x04, 0x10,0x0f,0x08,0x09 C a2
+ .byte 0x10,0x0d,0x0e,0x0f, 0x10,0x10,0x10,0x0c, 0x10,0x10,0x10,0x10, 0x10,0x10,0x10,0x10 C part a0
+ .byte 0x10,0x11,0x12,0x13, 0x10,0x02,0x03,0x17, 0x10,0x10,0x0c,0x0d, 0x10,0x10,0x10,0x10 C part a1
+ .byte 0x10,0x11,0x12,0x13, 0x10,0x15,0x16,0x17, 0x10,0x03,0x1a,0x1b, 0x10,0x0c,0x0d,0x0e C part a2
+C Masks for high end of number
+ .byte 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff
+ .byte 0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+ .byte 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+ .byte 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00
+C Masks for low end of number
+C .byte 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff
+C .byte 0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff
+C .byte 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff
+C .byte 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff
+END_OBJECT(cnsts)
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc32/vmx/popcount.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc32/vmx/popcount.asm
new file mode 100644
index 00000000000..943c92d1273
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc32/vmx/popcount.asm
@@ -0,0 +1,34 @@
+dnl PowerPC-32/VMX mpn_popcount.
+
+dnl Copyright 2006 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_popcount)
+include_mpn(`powerpc64/vmx/popcount.asm')
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/README b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/README
new file mode 100644
index 00000000000..50dd3995c3d
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/README
@@ -0,0 +1,166 @@
+Copyright 1999-2001, 2003-2005 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/.
+
+
+
+ POWERPC-64 MPN SUBROUTINES
+
+
+This directory contains mpn functions for 64-bit PowerPC chips.
+
+
+CODE ORGANIZATION
+
+ mpn/powerpc64 mode-neutral code
+ mpn/powerpc64/mode32 code for mode32
+ mpn/powerpc64/mode64 code for mode64
+
+
+The mode32 and mode64 sub-directories contain code which is for use in the
+respective chip mode, 32 or 64. The top-level directory is code that's
+unaffected by the mode.
+
+The "adde" instruction is the main difference between mode32 and mode64. It
+operates on either on a 32-bit or 64-bit quantity according to the chip mode.
+Other instructions have an operand size in their opcode and hence don't vary.
+
+
+
+POWER3/PPC630 pipeline information:
+
+Decoding is 4-way + branch and issue is 8-way with some out-of-order
+capability.
+
+Functional units:
+LS1 - ld/st unit 1
+LS2 - ld/st unit 2
+FXU1 - integer unit 1, handles any simple integer instruction
+FXU2 - integer unit 2, handles any simple integer instruction
+FXU3 - integer unit 3, handles integer multiply and divide
+FPU1 - floating-point unit 1
+FPU2 - floating-point unit 2
+
+Memory: Any two memory operations can issue, but memory subsystem
+ can sustain just one store per cycle. No need for data
+ prefetch; the hardware has very sophisticated prefetch logic.
+Simple integer: 2 operations (such as add, rl*)
+Integer multiply: 1 operation every 9th cycle worst case; exact timing depends
+ on 2nd operand's most significant bit position (10 bits per
+ cycle). Multiply unit is not pipelined, only one multiply
+ operation in progress is allowed.
+Integer divide: ?
+Floating-point: Any plain 2 arithmetic instructions (such as fmul, fadd, and
+ fmadd), latency 4 cycles.
+Floating-point divide:
+ ?
+Floating-point square root:
+ ?
+
+POWER3/PPC630 best possible times for the main loops:
+shift: 1.5 cycles limited by integer unit contention.
+ With 63 special loops, one for each shift count, we could
+ reduce the needed integer instructions to 2, which would
+ reduce the best possible time to 1 cycle.
+add/sub: 1.5 cycles, limited by ld/st unit contention.
+mul: 18 cycles (average) unless floating-point operations are used,
+ but that would only help for multiplies of perhaps 10 and more
+ limbs.
+addmul/submul:Same situation as for mul.
+
+
+POWER4/PPC970 and POWER5 pipeline information:
+
+This is a very odd pipeline, it is basically a VLIW masquerading as a plain
+architecture. Its issue rules are not made public, and since it is so weird,
+it is very hard to figure out any useful information from experimentation.
+An example:
+
+ A well-aligned loop with nop's take 3, 4, 6, 7, ... cycles.
+ 3 cycles for 0, 1, 2, 3, 4, 5, 6, 7 nop's
+ 4 cycles for 8, 9, 10, 11, 12, 13, 14, 15 nop's
+ 6 cycles for 16, 17, 18, 19, 20, 21, 22, 23 nop's
+ 7 cycles for 24, 25, 26, 27 nop's
+ 8 cycles for 28, 29, 30, 31 nop's
+ ... continues regularly
+
+
+Functional units:
+LS1 - ld/st unit 1
+LS2 - ld/st unit 2
+FXU1 - integer unit 1, handles any integer instruction
+FXU2 - integer unit 2, handles any integer instruction
+FPU1 - floating-point unit 1
+FPU2 - floating-point unit 2
+
+While this is one integer unit less than POWER3/PPC630, the remaining units
+are more powerful; here they handle multiply and divide.
+
+Memory: 2 ld/st. Stores go to the L2 cache, which can sustain just
+ one store per cycle.
+ L1 load latency: to gregs 3-4 cycles, to fregs 5-6 cycles.
+ Operations that modify the address register might be split
+ to use also an integer issue slot.
+Simple integer: 2 operations every cycle, latency 2.
+Integer multiply: 2 operations every 6th cycle, latency 7 cycles.
+Integer divide: ?
+Floating-point: Any plain 2 arithmetic instructions (such as fmul, fadd, and
+ fmadd), latency 6 cycles.
+Floating-point divide:
+ ?
+Floating-point square root:
+ ?
+
+
+IDEAS
+
+*mul_1: Handling one limb using mulld/mulhdu and two limbs using floating-
+point operations should give performance of about 20 cycles for 3 limbs, or 7
+cycles/limb.
+
+We should probably split the single-limb operand in 32-bit chunks, and the
+multi-limb operand in 16-bit chunks, allowing us to accumulate well in fp
+registers.
+
+Problem is to get 32-bit or 16-bit words to the fp registers. Only 64-bit fp
+memops copies bits without fiddling with them. We might therefore need to
+load to integer registers with zero extension, store as 64 bits into temp
+space, and then load to fp regs. Alternatively, load directly to fp space
+and add well-chosen constants to get cancellation. (Other part after given by
+subsequent subtraction.)
+
+Possible code mix for load-via-intregs variant:
+
+lwz,std,lfd
+fmadd,fmadd,fmul,fmul
+fctidz,stfd,ld,fctidz,stfd,ld
+add,adde
+lwz,std,lfd
+fmadd,fmadd,fmul,fmul
+fctidz,stfd,ld,fctidz,stfd,ld
+add,adde
+srd,sld,add,adde,add,adde
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/aix.m4 b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/aix.m4
new file mode 100644
index 00000000000..bf6517d69d9
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/aix.m4
@@ -0,0 +1,97 @@
+divert(-1)
+dnl m4 macros for AIX 64-bit assembly.
+
+dnl Copyright 2000-2002, 2005, 2006, 2010, 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/.
+
+define(`ASM_START',
+ `.machine "any"
+ .toc')
+
+dnl Called: PROLOGUE_cpu(GSYM_PREFIX`'foo[,toc])
+dnl EPILOGUE_cpu(GSYM_PREFIX`'foo)
+dnl
+dnl Don't want ELF style .size in the epilogue.
+
+define(`PROLOGUE_cpu',
+m4_assert_numargs_range(1,2)
+`ifelse(`$2',toc,,
+`ifelse(`$2',,,`m4_error(`Unrecognised PROLOGUE parameter')')')dnl
+ .globl $1
+ .globl .$1
+ .csect [DS], 3
+$1:
+ .llong .$1, TOC[tc0], 0
+ .csect .$1[PR], 6
+.$1:')
+
+define(`EPILOGUE_cpu',
+m4_assert_numargs(1)
+`')
+
+define(`TOC_ENTRY', `')
+
+define(`LEA',
+m4_assert_numargs(2)
+`define(`TOC_ENTRY',
+` .toc
+..$2: .tc $2[TC], $2')'
+ `ld $1, ..$2(2)')
+
+define(`LEAL',
+m4_assert_numargs(2)
+`LEA($1,$2)')
+
+
+define(`EXTERN',
+m4_assert_numargs(1)
+` .globl $1')
+
+define(`EXTERN_FUNC',
+m4_assert_numargs(1)
+` .globl .$1')
+
+define(`DEF_OBJECT',
+m4_assert_numargs_range(1,2)
+` .csect [RO], 3
+ ALIGN(ifelse($#,1,2,$2))
+$1:
+')
+
+define(`END_OBJECT',
+m4_assert_numargs(1))
+
+define(`CALL',
+ `bl .$1
+ nop')
+
+define(`ASM_END', `TOC_ENTRY')
+
+undefine(`EXTRA_REGISTER')
+
+divert
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/com.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/com.asm
new file mode 100644
index 00000000000..074b7ff6e4f
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/com.asm
@@ -0,0 +1,136 @@
+dnl PowerPC-64 mpn_com.
+
+dnl Copyright 2004, 2005, 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/limb
+C POWER3/PPC630 ?
+C POWER4/PPC970 1.25
+C POWER5 ?
+C POWER6 1.32
+C POWER7 1.13
+
+C INPUT PARAMETERS
+define(`rp', `r3')
+define(`up', `r4')
+define(`n', `r5')
+
+ASM_START()
+PROLOGUE(mpn_com)
+
+ifdef(`HAVE_ABI_mode32',
+` rldicl n, n, 0,32')
+
+ cmpdi cr0, n, 4
+ blt L(sml)
+
+ addi r10, n, 4
+ srdi r10, r10, 3
+ mtctr r10
+
+ andi. r0, n, 1
+ rlwinm r11, n, 0,30,30
+ rlwinm r12, n, 0,29,29
+ cmpdi cr6, r11, 0
+ cmpdi cr7, r12, 0
+
+ beq cr0, L(xx0)
+L(xx1): ld r6, 0(up)
+ addi up, up, 8
+ nor r6, r6, r6
+ std r6, 0(rp)
+ addi rp, rp, 8
+
+L(xx0): bne cr6, L(x10)
+L(x00): ld r6, 0(r4)
+ ld r7, 8(r4)
+ bne cr7, L(100)
+L(000): addi rp, rp, -32
+ b L(lo0)
+L(100): addi up, up, -32
+ b L(lo4)
+L(x10): ld r8, 0(r4)
+ ld r9, 8(r4)
+ bne cr7, L(110)
+L(010): addi up, up, 16
+ addi rp, rp, -16
+ b L(lo2)
+L(110): addi up, up, -16
+ addi rp, rp, -48
+ b L(lo6)
+
+L(sml): mtctr n
+L(t): ld r6, 0(up)
+ addi up, up, 8
+ nor r6, r6, r6
+ std r6, 0(rp)
+ addi rp, rp, 8
+ bdnz L(t)
+ blr
+
+ ALIGN(32)
+L(top): nor r6, r6, r6
+ nor r7, r7, r7
+ std r6, 0(rp)
+ std r7, 8(rp)
+L(lo2): ld r6, 0(up)
+ ld r7, 8(up)
+ nor r8, r8, r8
+ nor r9, r9, r9
+ std r8, 16(rp)
+ std r9, 24(rp)
+L(lo0): ld r8, 16(up)
+ ld r9, 24(up)
+ nor r6, r6, r6
+ nor r7, r7, r7
+ std r6, 32(rp)
+ std r7, 40(rp)
+L(lo6): ld r6, 32(up)
+ ld r7, 40(up)
+ nor r8, r8, r8
+ nor r9, r9, r9
+ std r8, 48(rp)
+ std r9, 56(rp)
+ addi rp, rp, 64
+L(lo4): ld r8, 48(up)
+ ld r9, 56(up)
+ addi up, up, 64
+ bdnz L(top)
+
+L(end): nor r6, r6, r6
+ nor r7, r7, r7
+ std r6, 0(rp)
+ std r7, 8(rp)
+ nor r8, r8, r8
+ nor r9, r9, r9
+ std r8, 16(rp)
+ std r9, 24(rp)
+ blr
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/copyd.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/copyd.asm
new file mode 100644
index 00000000000..c6ce9309f1d
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/copyd.asm
@@ -0,0 +1,84 @@
+dnl PowerPC-64 mpn_copyd
+
+dnl Copyright 2004, 2005 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 1
+C POWER4/PPC970 1
+C POWER5 ?
+C POWER6 ?
+C POWER7 1.4
+
+C INPUT PARAMETERS
+C rp r3
+C up r4
+C n r5
+
+ASM_START()
+PROLOGUE(mpn_copyd)
+ rldic. r0, r5, 3, 59 C r0 = (r5 & 3) << 3; cr0 = (n == 4t)?
+ cmpldi cr6, r0, 16 C cr6 = (n cmp 4t + 2)?
+
+ifdef(`HAVE_ABI_mode32',
+` rldic r6, r5, 3, 32', C byte count corresponding to n
+` rldicr r6, r5, 3, 60') C byte count corresponding to n
+
+ addi r5, r5, 4 C compute...
+ifdef(`HAVE_ABI_mode32',
+` rldicl r5, r5, 62,34', C ...branch count
+` rldicl r5, r5, 62, 2') C ...branch count
+ mtctr r5
+
+ add r4, r4, r6
+ add r3, r3, r6
+ sub r4, r4, r0 C offset up
+ sub r3, r3, r0 C offset rp
+
+ beq cr0, L(L00)
+ blt cr6, L(L01)
+ beq cr6, L(L10)
+ b L(L11)
+
+ ALIGN(16)
+L(oop): ld r6, 24(r4)
+ std r6, 24(r3)
+L(L11): ld r6, 16(r4)
+ std r6, 16(r3)
+L(L10): ld r6, 8(r4)
+ std r6, 8(r3)
+L(L01): ld r6, 0(r4)
+ std r6, 0(r3)
+L(L00): addi r4, r4, -32
+ addi r3, r3, -32
+ bdnz L(oop)
+
+ blr
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/copyi.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/copyi.asm
new file mode 100644
index 00000000000..9a86cb21cc6
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/copyi.asm
@@ -0,0 +1,78 @@
+dnl PowerPC-64 mpn_copyi.
+
+dnl Copyright 2004, 2005 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 1
+C POWER4/PPC970 1
+C POWER5 ?
+C POWER6 ?
+C POWER7 1.4
+
+C INPUT PARAMETERS
+C rp r3
+C up r4
+C n r5
+
+ASM_START()
+PROLOGUE(mpn_copyi)
+ rldic. r0, r5, 3, 59 C r0 = (r5 & 3) << 3; cr0 = (n == 4t)?
+ cmpldi cr6, r0, 16 C cr6 = (n cmp 4t + 2)?
+
+ addi r5, r5, 4 C compute...
+ifdef(`HAVE_ABI_mode32',
+` rldicl r5, r5, 62,34', C ...branch count
+` rldicl r5, r5, 62, 2') C ...branch count
+ mtctr r5
+
+ add r4, r4, r0 C offset up
+ add r3, r3, r0 C offset rp
+
+ beq cr0, L(L00)
+ blt cr6, L(L01)
+ beq cr6, L(L10)
+ b L(L11)
+
+ ALIGN(16)
+L(oop): ld r6, -32(r4)
+ std r6, -32(r3)
+L(L11): ld r6, -24(r4)
+ std r6, -24(r3)
+L(L10): ld r6, -16(r4)
+ std r6, -16(r3)
+L(L01): ld r6, -8(r4)
+ std r6, -8(r3)
+L(L00): addi r4, r4, 32
+ addi r3, r3, 32
+ bdnz L(oop)
+
+ blr
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/darwin.m4 b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/darwin.m4
new file mode 100644
index 00000000000..a3180e48fd7
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/darwin.m4
@@ -0,0 +1,119 @@
+divert(-1)
+dnl m4 macros for Mac OS 64-bit assembly.
+
+dnl Copyright 2005, 2006 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/.
+
+define(`ASM_START',`')
+
+dnl Called: PROLOGUE_cpu(GSYM_PREFIX`'foo[,toc])
+dnl EPILOGUE_cpu(GSYM_PREFIX`'foo)
+dnl
+
+define(`DARWIN')
+
+define(`PROLOGUE_cpu',
+m4_assert_numargs_range(1,2)
+`ifelse(`$2',toc,,
+`ifelse(`$2',,,`m4_error(`Unrecognised PROLOGUE parameter')')')dnl
+ .text
+ .globl $1
+ .align 5
+$1:')
+
+define(`EPILOGUE_cpu',
+m4_assert_numargs(1))
+
+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
+dnl symbols.
+
+define(`LEAL',
+m4_assert_numargs(2)
+`ifdef(`PIC',
+`
+ mflr r0 C save return address
+ bcl 20, 31, 1f
+1: mflr $1
+ addis $1, $1, ha16($2-1b)
+ la $1, lo16($2-1b)($1)
+ mtlr r0 C restore return address
+',`
+ lis $1, ha16($2)
+ la $1, lo16($2)($1)
+')')
+
+dnl LEA -- Load Effective Address. This is to be used for symbols defined in
+dnl another file. It will not work for locally defined symbols.
+
+define(`LEA',
+m4_assert_numargs(2)
+`ifdef(`PIC',
+`define(`EPILOGUE_cpu',
+` .non_lazy_symbol_pointer
+`L'$2`'$non_lazy_ptr:
+ .indirect_symbol $2
+ .quad 0
+')
+ mflr r0 C save return address
+ bcl 20, 31, 1f
+1: mflr $1
+ addis $1, $1, ha16(`L'$2`'$non_lazy_ptr-1b)
+ ld $1, lo16(`L'$2`'$non_lazy_ptr-1b)($1)
+ mtlr r0 C restore return address
+',`
+ lis $1, ha16($2)
+ la $1, lo16($2)($1)
+')')
+
+define(`EXTERN',
+m4_assert_numargs(1)
+`dnl')
+
+define(`EXTERN_FUNC',
+m4_assert_numargs(1)
+`dnl')
+
+define(`DEF_OBJECT',
+m4_assert_numargs_range(1,2)
+` .const
+ ALIGN(ifelse($#,1,2,$2))
+$1:
+')
+
+define(`END_OBJECT',
+m4_assert_numargs(1))
+
+define(`CALL',
+ `bl GSYM_PREFIX`'$1')
+
+define(`ASM_END', `dnl')
+
+define(`EXTRA_REGISTER', r2)
+
+divert
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/elf.m4 b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/elf.m4
new file mode 100644
index 00000000000..ddb5a8ed79d
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/elf.m4
@@ -0,0 +1,123 @@
+divert(-1)
+dnl m4 macros for powerpc64 GNU/Linux assembly.
+
+dnl Copyright 2003, 2005, 2006 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/.
+
+define(`ASM_START',
+`ifdef(`ELFv2_ABI',
+`
+ .abiversion 2
+')')
+
+dnl Called: PROLOGUE_cpu(GSYM_PREFIX`'foo[,toc])
+dnl EPILOGUE_cpu(GSYM_PREFIX`'foo)
+dnl
+
+define(`PROLOGUE_cpu',
+m4_assert_numargs_range(1,2)
+`ifelse(`$2',toc,,
+`ifelse(`$2',,,`m4_error(`Unrecognised PROLOGUE parameter')')')dnl
+ifdef(`ELFv2_ABI',
+`
+ .globl $1
+ .type $1, @function
+ .section ".text"
+ .align 5
+$1:
+ifelse(`$2',toc,`
+0: addis 2, 12, (.TOC.-0b)@ha
+ addi 2, 2, (.TOC.-0b)@l
+ .localentry $1, .-$1
+',)
+',`
+ .globl $1
+ .globl .$1
+ .section ".opd","aw"
+ .align 3
+$1:
+ .llong .$1, .TOC.@tocbase, 0
+ .size $1, 24
+ .type .$1, @function
+ .section ".text"
+ .align 5
+.$1:
+')')
+
+define(`EPILOGUE_cpu',
+m4_assert_numargs(1)
+`ifdef(`ELFv2_ABI',`
+ .size $1, .-$1
+',`
+ .size .$1, .-.$1
+')')
+
+define(`TOC_ENTRY', `')
+
+define(`LEA',
+m4_assert_numargs(2)
+`define(`TOC_ENTRY',
+` .section ".toc", "aw"
+..$2: .tc $2[TC], $2')'
+ `ld $1, ..$2@toc(2)')
+
+define(`LEAL',
+m4_assert_numargs(2)
+`LEA($1,$2)')
+
+
+define(`EXTERN',
+m4_assert_numargs(1)
+`dnl')
+
+define(`EXTERN_FUNC',
+m4_assert_numargs(1)
+`dnl')
+
+define(`DEF_OBJECT',
+m4_assert_numargs_range(1,2)
+`
+ .section .rodata
+ ALIGN(ifelse($#,1,2,$2))
+ .type $1, @object
+$1:
+')
+
+define(`END_OBJECT',
+m4_assert_numargs(1)
+` .size $1, .-$1')
+
+define(`CALL',
+ `bl GSYM_PREFIX`'$1
+ nop')
+
+define(`ASM_END', `TOC_ENTRY')
+
+undefine(`EXTRA_REGISTER')
+
+divert
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/logops_n.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/logops_n.asm
new file mode 100644
index 00000000000..2fa6985d7a4
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/logops_n.asm
@@ -0,0 +1,151 @@
+dnl PowerPC-64 mpn_and_n, mpn_andn_n, mpn_nand_n, mpn_ior_n, mpn_iorn_n,
+dnl mpn_nior_n, mpn_xor_n, mpn_xnor_n -- mpn bitwise logical operations.
+
+dnl Copyright 2003-2005 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 1.75
+C POWER4/PPC970 2.10
+C POWER5 ?
+C POWER6 ?
+C POWER7 1.75
+
+C n POWER3/PPC630 POWER4/PPC970
+C 1 15.00 15.33
+C 2 7.50 7.99
+C 3 5.33 6.00
+C 4 4.50 4.74
+C 5 4.20 4.39
+C 6 3.50 3.99
+C 7 3.14 3.64
+C 8 3.00 3.36
+C 9 3.00 3.36
+C 10 2.70 3.25
+C 11 2.63 3.11
+C 12 2.58 3.00
+C 13 2.61 3.02
+C 14 2.42 2.82
+C 15 2.40 2.79
+C 50 2.08 2.67
+C 100 1.85 2.31
+C 200 1.80 2.18
+C 400 1.77 2.14
+C 1000 1.76 2.10#
+C 2000 1.75# 2.13
+C 4000 2.30 2.57
+C 8000 2.62 2.58
+C 16000 2.52 4.25
+C 32000 2.49 16.25
+C 64000 2.66 18.76
+
+ifdef(`OPERATION_and_n',
+` define(`func',`mpn_and_n')
+ define(`logop', `and')')
+ifdef(`OPERATION_andn_n',
+` define(`func',`mpn_andn_n')
+ define(`logop', `andc')')
+ifdef(`OPERATION_nand_n',
+` define(`func',`mpn_nand_n')
+ define(`logop', `nand')')
+ifdef(`OPERATION_ior_n',
+` define(`func',`mpn_ior_n')
+ define(`logop', `or')')
+ifdef(`OPERATION_iorn_n',
+` define(`func',`mpn_iorn_n')
+ define(`logop', `orc')')
+ifdef(`OPERATION_nior_n',
+` define(`func',`mpn_nior_n')
+ define(`logop', `nor')')
+ifdef(`OPERATION_xor_n',
+` define(`func',`mpn_xor_n')
+ define(`logop', `xor')')
+ifdef(`OPERATION_xnor_n',
+` define(`func',`mpn_xnor_n')
+ define(`logop', `eqv')')
+
+C INPUT PARAMETERS
+C rp r3
+C up r4
+C vp r5
+C n r6
+
+MULFUNC_PROLOGUE(mpn_and_n mpn_andn_n mpn_nand_n mpn_ior_n mpn_iorn_n mpn_nior_n mpn_xor_n mpn_xnor_n)
+
+ASM_START()
+PROLOGUE(func)
+ ld r8, 0(r4) C read lowest u limb
+ ld r9, 0(r5) C read lowest v limb
+ addi r6, r6, 3 C compute branch count (1)
+ rldic. r0, r6, 3, 59 C r0 = (n-1 & 3) << 3; cr0 = (n == 4(t+1))?
+ cmpldi cr6, r0, 16 C cr6 = (n cmp 4t + 3)
+
+ifdef(`HAVE_ABI_mode32',
+` rldicl r6, r6, 62,34', C ...branch count
+` rldicl r6, r6, 62, 2') C ...branch count
+ mtctr r6
+
+ ld r6, 0(r4) C read lowest u limb (again)
+ ld r7, 0(r5) C read lowest v limb (again)
+
+ add r5, r5, r0 C offset vp
+ add r4, r4, r0 C offset up
+ add r3, r3, r0 C offset rp
+
+ beq cr0, L(L01)
+ blt cr6, L(L10)
+ beq cr6, L(L11)
+ b L(L00)
+
+L(oop): ld r8, -24(r4)
+ ld r9, -24(r5)
+ logop r10, r6, r7
+ std r10, -32(r3)
+L(L00): ld r6, -16(r4)
+ ld r7, -16(r5)
+ logop r10, r8, r9
+ std r10, -24(r3)
+L(L11): ld r8, -8(r4)
+ ld r9, -8(r5)
+ logop r10, r6, r7
+ std r10, -16(r3)
+L(L10): ld r6, 0(r4)
+ ld r7, 0(r5)
+ logop r10, r8, r9
+ std r10, -8(r3)
+L(L01): addi r5, r5, 32
+ addi r4, r4, 32
+ addi r3, r3, 32
+ bdnz L(oop)
+
+ logop r10, r6, r7
+ std r10, -32(r3)
+ blr
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/lshift.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/lshift.asm
new file mode 100644
index 00000000000..880944a4aed
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/lshift.asm
@@ -0,0 +1,207 @@
+dnl PowerPC-64 mpn_lshift -- rp[] = up[] << cnt
+
+dnl Copyright 2003, 2005, 2010, 2011 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 2.25
+C POWER6 9.75
+C POWER7 2.15
+
+C TODO
+C * Try to reduce the number of needed live registers
+C * Micro-optimise header code
+C * Keep in synch with rshift.asm and lshiftc.asm
+
+C INPUT PARAMETERS
+define(`rp', `r3')
+define(`up', `r4')
+define(`n', `r5')
+define(`cnt', `r6')
+
+define(`tnc',`r0')
+define(`u0',`r30')
+define(`u1',`r31')
+define(`retval',`r5')
+
+ASM_START()
+PROLOGUE(mpn_lshift)
+ std r31, -8(r1)
+ std r30, -16(r1)
+ subfic tnc, cnt, 64
+ sldi r7, n, 3 C byte count corresponding to n
+ add up, up, r7 C up = up + n
+ add rp, rp, r7 C rp = rp + n
+ rldicl. r30, n, 0,62 C r30 = n & 3, set cr0
+ cmpdi cr6, r30, 2
+ addi r31, n, 3 C compute count...
+ ld r10, -8(up) C load 1st limb for b00...b11
+ srd retval, r10, tnc
+ifdef(`HAVE_ABI_mode32',
+` rldicl r31, r31, 62,34', C ...branch count
+` srdi r31, r31, 2') C ...for ctr
+ mtctr r31 C copy count into ctr
+ beq cr0, L(b00)
+ blt cr6, L(b01)
+ ld r11, -16(up) C load 2nd limb for b10 and b11
+ beq cr6, L(b10)
+
+ ALIGN(16)
+L(b11): sld r8, r10, cnt
+ srd r9, r11, tnc
+ ld u1, -24(up)
+ addi up, up, -24
+ sld r12, r11, cnt
+ srd r7, u1, tnc
+ addi rp, rp, 16
+ bdnz L(gt3)
+
+ or r11, r8, r9
+ sld r8, u1, cnt
+ b L(cj3)
+
+ ALIGN(16)
+L(gt3): ld u0, -8(up)
+ or r11, r8, r9
+ sld r8, u1, cnt
+ srd r9, u0, tnc
+ ld u1, -16(up)
+ or r10, r12, r7
+ b L(L11)
+
+ ALIGN(32)
+L(b10): sld r12, r10, cnt
+ addi rp, rp, 24
+ srd r7, r11, tnc
+ bdnz L(gt2)
+
+ sld r8, r11, cnt
+ or r10, r12, r7
+ b L(cj2)
+
+L(gt2): ld u0, -24(up)
+ sld r8, r11, cnt
+ srd r9, u0, tnc
+ ld u1, -32(up)
+ or r10, r12, r7
+ sld r12, u0, cnt
+ srd r7, u1, tnc
+ ld u0, -40(up)
+ or r11, r8, r9
+ addi up, up, -16
+ b L(L10)
+
+ ALIGN(16)
+L(b00): ld u1, -16(up)
+ sld r12, r10, cnt
+ srd r7, u1, tnc
+ ld u0, -24(up)
+ sld r8, u1, cnt
+ srd r9, u0, tnc
+ ld u1, -32(up)
+ or r10, r12, r7
+ sld r12, u0, cnt
+ srd r7, u1, tnc
+ addi rp, rp, 8
+ bdz L(cj4)
+
+L(gt4): addi up, up, -32
+ ld u0, -8(up)
+ or r11, r8, r9
+ b L(L00)
+
+ ALIGN(16)
+L(b01): bdnz L(gt1)
+ sld r8, r10, cnt
+ std r8, -8(rp)
+ b L(ret)
+
+L(gt1): ld u0, -16(up)
+ sld r8, r10, cnt
+ srd r9, u0, tnc
+ ld u1, -24(up)
+ sld r12, u0, cnt
+ srd r7, u1, tnc
+ ld u0, -32(up)
+ or r11, r8, r9
+ sld r8, u1, cnt
+ srd r9, u0, tnc
+ ld u1, -40(up)
+ addi up, up, -40
+ or r10, r12, r7
+ bdz L(end)
+
+ ALIGN(32)
+L(top): sld r12, u0, cnt
+ srd r7, u1, tnc
+ ld u0, -8(up)
+ std r11, -8(rp)
+ or r11, r8, r9
+L(L00): sld r8, u1, cnt
+ srd r9, u0, tnc
+ ld u1, -16(up)
+ std r10, -16(rp)
+ or r10, r12, r7
+L(L11): sld r12, u0, cnt
+ srd r7, u1, tnc
+ ld u0, -24(up)
+ std r11, -24(rp)
+ or r11, r8, r9
+L(L10): sld r8, u1, cnt
+ srd r9, u0, tnc
+ ld u1, -32(up)
+ addi up, up, -32
+ std r10, -32(rp)
+ addi rp, rp, -32
+ or r10, r12, r7
+ bdnz L(top)
+
+ ALIGN(32)
+L(end): sld r12, u0, cnt
+ srd r7, u1, tnc
+ std r11, -8(rp)
+L(cj4): or r11, r8, r9
+ sld r8, u1, cnt
+ std r10, -16(rp)
+L(cj3): or r10, r12, r7
+ std r11, -24(rp)
+L(cj2): std r10, -32(rp)
+ std r8, -40(rp)
+
+L(ret): ld r31, -8(r1)
+ ld r30, -16(r1)
+ifdef(`HAVE_ABI_mode32',
+` srdi r3, retval, 32
+ mr r4, retval
+',` mr r3, retval')
+ blr
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/lshiftc.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/lshiftc.asm
new file mode 100644
index 00000000000..7cf6a83428c
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/lshiftc.asm
@@ -0,0 +1,210 @@
+dnl PowerPC-64 mpn_lshiftc -- rp[] = ~up[] << cnt
+
+dnl Copyright 2003, 2005, 2010 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 2.25
+C POWER6 9.5
+C POWER7 2.15
+
+C TODO
+C * Try to reduce the number of needed live registers
+C * Micro-optimise header code
+C * Keep in synch with lshift.asm and rshift.asm
+C * Could the long-scheduled std insns be less scheduled?
+
+C INPUT PARAMETERS
+define(`rp', `r3')
+define(`up', `r4')
+define(`n', `r5')
+define(`cnt', `r6')
+
+define(`tnc',`r0')
+define(`u0',`r30')
+define(`u1',`r31')
+define(`retval',`r5')
+
+ASM_START()
+PROLOGUE(mpn_lshiftc)
+ std r31, -8(r1)
+ std r30, -16(r1)
+ subfic tnc, cnt, 64
+ sldi r7, n, 3 C byte count corresponding to n
+ add up, up, r7 C up = up + n
+ add rp, rp, r7 C rp = rp + n
+ rldicl. r30, n, 0,62 C r30 = n & 3, set cr0
+ cmpdi cr6, r30, 2
+ addi r31, n, 3 C compute count...
+ ld r10, -8(up) C load 1st limb for b00...b11
+ srd retval, r10, tnc
+ srdi r31, r31, 2 C ...for ctr
+ mtctr r31 C copy count into ctr
+ beq cr0, L(b00)
+ blt cr6, L(b01)
+ ld r11, -16(up) C load 2nd limb for b10 and b11
+ beq cr6, L(b10)
+
+ ALIGN(16)
+L(b11): sld r8, r10, cnt
+ srd r9, r11, tnc
+ ld u1, -24(up)
+ addi up, up, -24
+ sld r12, r11, cnt
+ srd r7, u1, tnc
+ addi rp, rp, 16
+ bdnz L(gt3)
+
+ nor r11, r8, r9
+ sld r8, u1, cnt
+ nor r8, r8, r8
+ b L(cj3)
+
+ ALIGN(16)
+L(gt3): ld u0, -8(up)
+ nor r11, r8, r9
+ sld r8, u1, cnt
+ srd r9, u0, tnc
+ ld u1, -16(up)
+ nor r10, r12, r7
+ b L(L11)
+
+ ALIGN(32)
+L(b10): sld r12, r10, cnt
+ addi rp, rp, 24
+ srd r7, r11, tnc
+ bdnz L(gt2)
+
+ sld r8, r11, cnt
+ nor r10, r12, r7
+ nor r8, r8, r8
+ b L(cj2)
+
+L(gt2): ld u0, -24(up)
+ sld r8, r11, cnt
+ srd r9, u0, tnc
+ ld u1, -32(up)
+ nor r10, r12, r7
+ sld r12, u0, cnt
+ srd r7, u1, tnc
+ ld u0, -40(up)
+ nor r11, r8, r9
+ addi up, up, -16
+ b L(L10)
+
+ ALIGN(16)
+L(b00): ld u1, -16(up)
+ sld r12, r10, cnt
+ srd r7, u1, tnc
+ ld u0, -24(up)
+ sld r8, u1, cnt
+ srd r9, u0, tnc
+ ld u1, -32(up)
+ nor r10, r12, r7
+ sld r12, u0, cnt
+ srd r7, u1, tnc
+ addi rp, rp, 8
+ bdz L(cj4)
+
+L(gt4): addi up, up, -32
+ ld u0, -8(up)
+ nor r11, r8, r9
+ b L(L00)
+
+ ALIGN(16)
+L(b01): bdnz L(gt1)
+ sld r8, r10, cnt
+ nor r8, r8, r8
+ std r8, -8(rp)
+ b L(ret)
+
+L(gt1): ld u0, -16(up)
+ sld r8, r10, cnt
+ srd r9, u0, tnc
+ ld u1, -24(up)
+ sld r12, u0, cnt
+ srd r7, u1, tnc
+ ld u0, -32(up)
+ nor r11, r8, r9
+ sld r8, u1, cnt
+ srd r9, u0, tnc
+ ld u1, -40(up)
+ addi up, up, -40
+ nor r10, r12, r7
+ bdz L(end)
+
+ ALIGN(32)
+L(top): sld r12, u0, cnt
+ srd r7, u1, tnc
+ ld u0, -8(up)
+ std r11, -8(rp)
+ nor r11, r8, r9
+L(L00): sld r8, u1, cnt
+ srd r9, u0, tnc
+ ld u1, -16(up)
+ std r10, -16(rp)
+ nor r10, r12, r7
+L(L11): sld r12, u0, cnt
+ srd r7, u1, tnc
+ ld u0, -24(up)
+ std r11, -24(rp)
+ nor r11, r8, r9
+L(L10): sld r8, u1, cnt
+ srd r9, u0, tnc
+ ld u1, -32(up)
+ addi up, up, -32
+ std r10, -32(rp)
+ addi rp, rp, -32
+ nor r10, r12, r7
+ bdnz L(top)
+
+ ALIGN(32)
+L(end): sld r12, u0, cnt
+ srd r7, u1, tnc
+ std r11, -8(rp)
+L(cj4): nor r11, r8, r9
+ sld r8, u1, cnt
+ std r10, -16(rp)
+ nor r8, r8, r8
+L(cj3): nor r10, r12, r7
+ std r11, -24(rp)
+L(cj2): std r10, -32(rp)
+ std r8, -40(rp)
+
+L(ret): ld r31, -8(r1)
+ ld r30, -16(r1)
+ifdef(`HAVE_ABI_mode32',
+` srdi r3, retval, 32
+ mr r4, retval
+',` mr r3, retval')
+ blr
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/mode32/add_n.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/mode32/add_n.asm
new file mode 100644
index 00000000000..1da8087fe13
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/mode32/add_n.asm
@@ -0,0 +1,86 @@
+dnl PowerPC-64/mode32 mpn_add_n -- Add two limb vectors of the same length > 0
+dnl and store sum in a third limb vector.
+
+dnl Copyright 1999-2001, 2003, 2005 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: 4.25
+
+C INPUT PARAMETERS
+C rp r3
+C up r4
+C vp r5
+C n r6
+
+ASM_START()
+PROLOGUE(mpn_add_n)
+ mtctr r6 C copy size into CTR
+ addic r0, r0, 0 C clear cy
+ ld r8, 0(r4) C load least significant s1 limb
+ ld r0, 0(r5) C load least significant s2 limb
+ addi r3, r3, -8 C offset res_ptr, it's updated before it's used
+ bdz L(end) C If done, skip loop
+
+L(oop): ld r9, 8(r4) C load s1 limb
+ ld r10, 8(r5) C load s2 limb
+ adde r7, r0, r8 C add limbs with cy, set cy
+ srdi r6, r0, 32
+ srdi r11, r8, 32
+ adde r6, r6, r11 C add high limb parts, set cy
+ std r7, 8(r3) C store result limb
+ bdz L(exit) C decrement CTR and exit if done
+ ldu r8, 16(r4) C load s1 limb and update s1_ptr
+ ldu r0, 16(r5) C load s2 limb and update s2_ptr
+ adde r7, r10, r9 C add limbs with cy, set cy
+ srdi r6, r10, 32
+ srdi r11, r9, 32
+ adde r6, r6, r11 C add high limb parts, set cy
+ stdu r7, 16(r3) C store result limb and update res_ptr
+ bdnz L(oop) C decrement CTR and loop back
+
+L(end): adde r7, r0, r8
+ srdi r6, r0, 32
+ srdi r11, r8, 32
+ adde r6, r6, r11 C add limbs with cy, set cy
+ std r7, 8(r3) C store ultimate result limb
+ li r3, 0 C load cy into ...
+ addze r4, r3 C ... return value register
+ blr
+L(exit): adde r7, r10, r9
+ srdi r6, r10, 32
+ srdi r11, r9, 32
+ adde r6, r6, r11 C add limbs with cy, set cy
+ std r7, 16(r3)
+ li r3, 0 C load cy into ...
+ addze r4, r3 C ... return value register
+ blr
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/mode32/addmul_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/mode32/addmul_1.asm
new file mode 100644
index 00000000000..bdc39512ac5
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/mode32/addmul_1.asm
@@ -0,0 +1,79 @@
+dnl PowerPC-64 mpn_addmul_1 -- Multiply a limb vector with a limb and add
+dnl the result to a second limb vector.
+
+dnl Copyright 1999-2001, 2003, 2005 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: 12.5
+
+C INPUT PARAMETERS
+C rp r3
+C up r4
+C n r5
+C v r6,r7 or r7,r8
+
+ASM_START()
+PROLOGUE(mpn_addmul_1)
+
+ifdef(`BROKEN_LONGLONG_PARAM',
+` rldimi r8, r7, 32,0 C assemble vlimb from separate 32-bit arguments
+ mr r6, r8
+',`
+ rldimi r7, r6, 32,0 C assemble vlimb from separate 32-bit arguments
+ mr r6, r7
+')
+ li r7, 0 C cy_limb = 0
+ mtctr r5
+ addic r0, r0, 0
+ addi r3, r3, -8
+ addi r4, r4, -8
+
+L(oop): ldu r0, 8(r4)
+ mulld r9, r0, r6
+ adde r12, r9, r7 C add old high limb and new low limb
+ srdi r5, r9, 32
+ srdi r11, r7, 32
+ adde r5, r5, r11 C add high limb parts, set cy
+ mulhdu r7, r0, r6
+ addze r7, r7
+ ld r10, 8(r3)
+ addc r9, r12, r10
+ srdi r5, r12, 32
+ srdi r11, r10, 32
+ adde r5, r5, r11 C add high limb parts, set cy
+ stdu r9, 8(r3)
+ bdnz L(oop)
+
+ addze r4, r7
+ srdi r3, r4, 32
+ blr
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/mode32/mul_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/mode32/mul_1.asm
new file mode 100644
index 00000000000..3a17e987972
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/mode32/mul_1.asm
@@ -0,0 +1,73 @@
+dnl PowerPC-64 mpn_mul_1 -- Multiply a limb vector with a limb and add
+dnl the result to a second limb vector.
+
+dnl Copyright 1999-2001, 2003, 2005 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: 10
+
+C INPUT PARAMETERS
+C rp r3
+C up r4
+C n r5
+C v r6,r7 or r7,r8
+
+ASM_START()
+PROLOGUE(mpn_mul_1)
+
+ifdef(`BROKEN_LONGLONG_PARAM',
+` rldimi r8, r7, 32,0 C assemble vlimb from separate 32-bit arguments
+ mr r6, r8
+',`
+ rldimi r7, r6, 32,0 C assemble vlimb from separate 32-bit arguments
+ mr r6, r7
+')
+ li r7, 0 C cy_limb = 0
+ mtctr r5
+ addic r0, r0, 0
+ addi r3, r3, -8
+ addi r4, r4, -8
+
+L(oop): ldu r0, 8(r4)
+ mulld r9, r0, r6
+ adde r12, r9, r7 C add old high limb and new low limb
+ srdi r5, r9, 32
+ srdi r11, r7, 32
+ adde r5, r5, r11 C add high limb parts, set cy
+ mulhdu r7, r0, r6
+ stdu r12, 8(r3)
+ bdnz L(oop)
+
+ addze r4, r7
+ srdi r3, r4, 32
+ blr
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/mode32/p4/gmp-mparam.h b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/mode32/p4/gmp-mparam.h
new file mode 100644
index 00000000000..a7271381c5c
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/mode32/p4/gmp-mparam.h
@@ -0,0 +1,173 @@
+/* PowerPC-64 gmp-mparam.h -- Compiler/machine parameter header file.
+
+Copyright 2008, 2009, 2011 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/. */
+
+/* 1800 MHz PPC970 */
+
+#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 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 USE_PREINV_DIVREM_1 1
+#define DIV_QR_2_PI2_THRESHOLD 12
+#define DIVEXACT_1_THRESHOLD 0 /* always */
+#define BMOD_1_TO_MOD_1_THRESHOLD 90
+
+#define MUL_TOOM22_THRESHOLD 16
+#define MUL_TOOM33_THRESHOLD 57
+#define MUL_TOOM44_THRESHOLD 94
+#define MUL_TOOM6H_THRESHOLD 125
+#define MUL_TOOM8H_THRESHOLD 187
+
+#define MUL_TOOM32_TO_TOOM43_THRESHOLD 65
+#define MUL_TOOM32_TO_TOOM53_THRESHOLD 99
+#define MUL_TOOM42_TO_TOOM53_THRESHOLD 61
+#define MUL_TOOM42_TO_TOOM63_THRESHOLD 56
+#define MUL_TOOM43_TO_TOOM54_THRESHOLD 70
+
+#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_TOOM8_THRESHOLD 272
+
+#define MULMID_TOOM42_THRESHOLD 34
+
+#define MULMOD_BNM1_THRESHOLD 12
+#define SQRMOD_BNM1_THRESHOLD 13
+
+#define MUL_FFT_MODF_THRESHOLD 244 /* k = 5 */
+#define MUL_FFT_TABLE3 \
+ { { 244, 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}, { 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}, \
+ { 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
+
+#define SQR_FFT_MODF_THRESHOLD 212 /* 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}, \
+ { 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}, \
+ { 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
+
+#define MULLO_BASECASE_THRESHOLD 0 /* always */
+#define MULLO_DC_THRESHOLD 55
+#define MULLO_MUL_N_THRESHOLD 5240
+
+#define DC_DIV_QR_THRESHOLD 27
+#define DC_DIVAPPR_Q_THRESHOLD 108
+#define DC_BDIV_QR_THRESHOLD 51
+#define DC_BDIV_Q_THRESHOLD 126
+
+#define INV_MULMOD_BNM1_THRESHOLD 38
+#define INV_NEWTON_THRESHOLD 129
+#define INV_APPR_THRESHOLD 116
+
+#define BINV_NEWTON_THRESHOLD 198
+#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 MU_BDIV_QR_THRESHOLD 748
+#define MU_BDIV_Q_THRESHOLD 872
+
+#define POWM_SEC_TABLE 4,35,152,780,2145
+
+#define MATRIX22_STRASSEN_THRESHOLD 11
+#define HGCD_THRESHOLD 104
+#define HGCD_APPR_THRESHOLD 118
+#define HGCD_REDUCE_THRESHOLD 1329
+#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
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/mode32/sqr_diagonal.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/mode32/sqr_diagonal.asm
new file mode 100644
index 00000000000..ff5f4b3cfba
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/mode32/sqr_diagonal.asm
@@ -0,0 +1,117 @@
+dnl PowerPC-64 mpn_sqr_diagonal.
+
+dnl Copyright 2001-2003, 2005, 2006, 20010 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 18
+C POWER4/PPC970 ?
+C POWER5 7.25
+C POWER6 9.5
+
+C INPUT PARAMETERS
+define(`rp', r3)
+define(`up', r4)
+define(`n', r5)
+
+ASM_START()
+PROLOGUE(mpn_sqr_diagonal)
+ifdef(`HAVE_ABI_mode32',
+` rldicl n, n, 0, 32') C zero extend n
+
+ rldicl. r0, n, 0,62 C r0 = n & 3, set cr0
+ addi n, n, 3 C compute count...
+ cmpdi cr6, r0, 2
+ srdi n, n, 2 C ...for ctr
+ mtctr n C copy count into ctr
+ beq cr0, L(b00)
+ blt cr6, L(b01)
+ beq cr6, L(b10)
+
+L(b11): ld r0, 0(up)
+ ld r10, 8(up)
+ ld r12, 16(up)
+ addi rp, rp, -16
+ mulld r7, r0, r0
+ mulhdu r8, r0, r0
+ mulld r9, r10, r10
+ mulhdu r10, r10, r10
+ mulld r11, r12, r12
+ mulhdu r12, r12, r12
+ addi up, up, 24
+ b L(11)
+
+ ALIGN(16)
+L(b01): ld r0, 0(up)
+ addi rp, rp, -48
+ addi up, up, 8
+ mulld r11, r0, r0
+ mulhdu r12, r0, r0
+ b L(01)
+
+ ALIGN(16)
+L(b10): ld r0, 0(up)
+ ld r12, 8(up)
+ addi rp, rp, -32
+ addi up, up, 16
+ mulld r9, r0, r0
+ mulhdu r10, r0, r0
+ mulld r11, r12, r12
+ mulhdu r12, r12, r12
+ b L(10)
+
+ ALIGN(32)
+L(b00):
+L(top): ld r0, 0(up)
+ ld r8, 8(up)
+ ld r10, 16(up)
+ ld r12, 24(up)
+ mulld r5, r0, r0
+ mulhdu r6, r0, r0
+ mulld r7, r8, r8
+ mulhdu r8, r8, r8
+ mulld r9, r10, r10
+ mulhdu r10, r10, r10
+ mulld r11, r12, r12
+ mulhdu r12, r12, r12
+ addi up, up, 32
+ std r5, 0(rp)
+ std r6, 8(rp)
+L(11): std r7, 16(rp)
+ std r8, 24(rp)
+L(10): std r9, 32(rp)
+ std r10, 40(rp)
+L(01): std r11, 48(rp)
+ std r12, 56(rp)
+ addi rp, rp, 64
+ bdnz L(top)
+
+ blr
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/mode32/sub_n.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/mode32/sub_n.asm
new file mode 100644
index 00000000000..6fdc1d47197
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/mode32/sub_n.asm
@@ -0,0 +1,88 @@
+dnl PowerPC-64/mode32 mpn_sub_n -- Subtract two limb vectors of the same
+dnl length and store difference in a third limb vector.
+
+dnl Copyright 1999-2001, 2003, 2005 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: 4.25
+
+C INPUT PARAMETERS
+C rp r3
+C up r4
+C vp r5
+C n r6
+
+ASM_START()
+PROLOGUE(mpn_sub_n)
+ mtctr r6 C copy size into CTR
+ addic r0, r6, -1 C set cy
+ ld r8, 0(r4) C load least significant s1 limb
+ ld r0, 0(r5) C load least significant s2 limb
+ addi r3, r3, -8 C offset res_ptr, it's updated before it's used
+ bdz L(end) C If done, skip loop
+
+L(oop): ld r9, 8(r4) C load s1 limb
+ ld r10, 8(r5) C load s2 limb
+ subfe r7, r0, r8 C subtract limbs with cy, set cy
+ srdi r6, r0, 32
+ srdi r11, r8, 32
+ subfe r6, r6, r11
+ std r7, 8(r3) C store result limb
+ bdz L(exit) C decrement CTR and exit if done
+ ldu r8, 16(r4) C load s1 limb and update s1_ptr
+ ldu r0, 16(r5) C load s2 limb and update s2_ptr
+ subfe r7, r10, r9 C subtract limbs with cy, set cy
+ srdi r6, r10, 32
+ srdi r11, r9, 32
+ subfe r6, r6, r11
+ stdu r7, 16(r3) C store result limb and update res_ptr
+ bdnz L(oop) C decrement CTR and loop back
+
+L(end): subfe r7, r0, r8
+ srdi r6, r0, 32
+ srdi r11, r8, 32
+ subfe r6, r6, r11
+ std r7, 8(r3) C store ultimate result limb
+ subfe r3, r0, r0 C load !cy into ...
+ subfic r4, r3, 0 C ... return value register
+ li r3, 0 C zero extend return value
+ blr
+L(exit): subfe r7, r10, r9
+ srdi r6, r10, 32
+ srdi r11, r9, 32
+ subfe r6, r6, r11
+ std r7, 16(r3)
+ subfe r3, r0, r0 C load !cy into ...
+ subfic r4, r3, 0 C ... return value register
+ li r3, 0 C zero extend return value
+ blr
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/mode32/submul_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/mode32/submul_1.asm
new file mode 100644
index 00000000000..22601c417e2
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/mode32/submul_1.asm
@@ -0,0 +1,82 @@
+dnl PowerPC-64 mpn_submul_1 -- Multiply a limb vector with a limb and subtract
+dnl the result from a second limb vector.
+
+dnl Copyright 1999-2001, 2003, 2005 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: 16
+
+C INPUT PARAMETERS
+C rp r3
+C up r4
+C n r5
+C v r6,r7 or r7,r8
+
+ASM_START()
+PROLOGUE(mpn_submul_1)
+
+ifdef(`BROKEN_LONGLONG_PARAM',
+` rldimi r8, r7, 32,0 C assemble vlimb from separate 32-bit arguments
+ mr r6, r8
+',`
+ rldimi r7, r6, 32,0 C assemble vlimb from separate 32-bit arguments
+ mr r6, r7
+')
+ li r7, 0 C cy_limb = 0
+ mtctr r5
+ addic r0, r0, 0
+ addi r3, r3, -8
+ addi r4, r4, -8
+
+L(oop): ldu r0, 8(r4)
+ mulld r9, r0, r6
+ adde r12, r9, r7 C add old high limb and new low limb
+ srdi r5, r9, 32
+ srdi r11, r7, 32
+ adde r5, r5, r11 C add high limb parts, set cy
+ mulhdu r7, r0, r6
+ addze r7, r7
+ ld r10, 8(r3)
+ subfc r9, r12, r10
+ srdi r5, r12, 32
+ srdi r11, r10, 32
+ subfe r5, r5, r11 C subtract high limb parts, set cy
+ stdu r9, 8(r3)
+ subfe r11, r11, r11 C invert ...
+ addic r11, r11, 1 C ... carry
+ bdnz L(oop)
+
+ addze r4, r7
+ srdi r3, r4, 32
+ blr
+EPILOGUE()
+
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/mode64/aors_n.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/mode64/aors_n.asm
new file mode 100644
index 00000000000..0e8474fdcc2
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/mode64/aors_n.asm
@@ -0,0 +1,189 @@
+dnl PowerPC-64 mpn_add_n/mpn_sub_n -- mpn addition and subtraction.
+
+dnl Copyright 1999-2001, 2003-2005, 2007, 2011 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 1.5
+C POWER4/PPC970 2
+C POWER5 2
+C POWER6 2.63
+C POWER7 2.25-2.87
+
+C This code is a little bit slower for POWER3/PPC630 than the simple code used
+C previously, but it is much faster for POWER4/PPC970. The reason for the
+C POWER3/PPC630 slowdown can be attributed to the saving and restoring of 4
+C registers.
+
+C INPUT PARAMETERS
+C rp r3
+C up r4
+C vp r5
+C n r6
+
+ifdef(`OPERATION_add_n',`
+ define(ADDSUBC, adde)
+ define(ADDSUB, addc)
+ define(func, mpn_add_n)
+ define(func_nc, mpn_add_nc)
+ define(GENRVAL, `addi r3, r3, 1')
+ define(SETCBR, `addic r0, $1, -1')
+ define(CLRCB, `addic r0, r0, 0')
+')
+ifdef(`OPERATION_sub_n',`
+ define(ADDSUBC, subfe)
+ define(ADDSUB, subfc)
+ define(func, mpn_sub_n)
+ define(func_nc, mpn_sub_nc)
+ define(GENRVAL, `neg r3, r3')
+ define(SETCBR, `subfic r0, $1, 0')
+ define(CLRCB, `addic r0, r1, -1')
+')
+
+MULFUNC_PROLOGUE(mpn_add_n mpn_add_nc mpn_sub_n mpn_sub_nc)
+
+ASM_START()
+PROLOGUE(func_nc)
+ SETCBR(r7)
+ b L(ent)
+EPILOGUE()
+
+PROLOGUE(func)
+ CLRCB
+L(ent): std r31, -8(r1)
+ std r30, -16(r1)
+ std r29, -24(r1)
+ std r28, -32(r1)
+
+ rldicl. r0, r6, 0,62 C r0 = n & 3, set cr0
+ cmpdi cr6, r0, 2
+ addi r6, r6, 3 C compute count...
+ srdi r6, r6, 2 C ...for ctr
+ mtctr r6 C copy count into ctr
+ beq cr0, L(b00)
+ blt cr6, L(b01)
+ beq cr6, L(b10)
+
+L(b11): ld r8, 0(r4) C load s1 limb
+ ld r9, 0(r5) C load s2 limb
+ ld r10, 8(r4) C load s1 limb
+ ld r11, 8(r5) C load s2 limb
+ ld r12, 16(r4) C load s1 limb
+ addi r4, r4, 24
+ ld r0, 16(r5) C load s2 limb
+ addi r5, r5, 24
+ ADDSUBC r29, r9, r8
+ ADDSUBC r30, r11, r10
+ ADDSUBC r31, r0, r12
+ std r29, 0(r3)
+ std r30, 8(r3)
+ std r31, 16(r3)
+ addi r3, r3, 24
+ bdnz L(go)
+ b L(ret)
+
+L(b01): ld r12, 0(r4) C load s1 limb
+ addi r4, r4, 8
+ ld r0, 0(r5) C load s2 limb
+ addi r5, r5, 8
+ ADDSUBC r31, r0, r12 C add
+ std r31, 0(r3)
+ addi r3, r3, 8
+ bdnz L(go)
+ b L(ret)
+
+L(b10): ld r10, 0(r4) C load s1 limb
+ ld r11, 0(r5) C load s2 limb
+ ld r12, 8(r4) C load s1 limb
+ addi r4, r4, 16
+ ld r0, 8(r5) C load s2 limb
+ addi r5, r5, 16
+ ADDSUBC r30, r11, r10 C add
+ ADDSUBC r31, r0, r12 C add
+ std r30, 0(r3)
+ std r31, 8(r3)
+ addi r3, r3, 16
+ bdnz L(go)
+ b L(ret)
+
+L(b00): C INITCY C clear/set cy
+L(go): ld r6, 0(r4) C load s1 limb
+ ld r7, 0(r5) C load s2 limb
+ ld r8, 8(r4) C load s1 limb
+ ld r9, 8(r5) C load s2 limb
+ ld r10, 16(r4) C load s1 limb
+ ld r11, 16(r5) C load s2 limb
+ ld r12, 24(r4) C load s1 limb
+ ld r0, 24(r5) C load s2 limb
+ bdz L(end)
+
+ addi r4, r4, 32
+ addi r5, r5, 32
+
+ ALIGN(16)
+L(top): ADDSUBC r28, r7, r6
+ ld r6, 0(r4) C load s1 limb
+ ld r7, 0(r5) C load s2 limb
+ ADDSUBC r29, r9, r8
+ ld r8, 8(r4) C load s1 limb
+ ld r9, 8(r5) C load s2 limb
+ ADDSUBC r30, r11, r10
+ ld r10, 16(r4) C load s1 limb
+ ld r11, 16(r5) C load s2 limb
+ ADDSUBC r31, r0, r12
+ ld r12, 24(r4) C load s1 limb
+ ld r0, 24(r5) C load s2 limb
+ std r28, 0(r3)
+ addi r4, r4, 32
+ std r29, 8(r3)
+ addi r5, r5, 32
+ std r30, 16(r3)
+ std r31, 24(r3)
+ addi r3, r3, 32
+ bdnz L(top) C decrement ctr and loop back
+
+L(end): ADDSUBC r28, r7, r6
+ ADDSUBC r29, r9, r8
+ ADDSUBC r30, r11, r10
+ ADDSUBC r31, r0, r12
+ std r28, 0(r3)
+ std r29, 8(r3)
+ std r30, 16(r3)
+ std r31, 24(r3)
+
+L(ret): ld r31, -8(r1)
+ ld r30, -16(r1)
+ ld r29, -24(r1)
+ ld r28, -32(r1)
+
+ subfe r3, r0, r0 C -cy
+ GENRVAL
+ blr
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/mode64/aorsmul_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/mode64/aorsmul_1.asm
new file mode 100644
index 00000000000..0c12f9b6608
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/mode64/aorsmul_1.asm
@@ -0,0 +1,225 @@
+dnl PowerPC-64 mpn_addmul_1 and mpn_submul_1.
+
+dnl Copyright 1999-2001, 2003-2006, 2010-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 mpn_addmul_1 mpn_submul_1
+C cycles/limb cycles/limb
+C POWER3/PPC630 6-18 6-18
+C POWER4/PPC970 8 8.3
+C POWER5 8 8.25
+C POWER6 16.25 16.75
+C POWER7 3.77 4.9
+
+C TODO
+C * Try to reduce the number of needed live registers
+C * Add support for _1c entry points
+
+C INPUT PARAMETERS
+define(`rp', `r3')
+define(`up', `r4')
+define(`n', `r5')
+define(`vl', `r6')
+
+ifdef(`OPERATION_addmul_1',`
+ define(ADDSUBC, adde)
+ define(ADDSUB, addc)
+ define(func, mpn_addmul_1)
+ define(func_nc, mpn_addmul_1c) C FIXME: not really supported
+ define(SM, `')
+')
+ifdef(`OPERATION_submul_1',`
+ define(ADDSUBC, subfe)
+ define(ADDSUB, subfc)
+ define(func, mpn_submul_1)
+ define(func_nc, mpn_submul_1c) C FIXME: not really supported
+ define(SM, `$1')
+')
+
+MULFUNC_PROLOGUE(mpn_addmul_1 mpn_submul_1)
+
+ASM_START()
+PROLOGUE(func)
+ std r31, -8(r1)
+ rldicl. r0, n, 0,62 C r0 = n & 3, set cr0
+ std r30, -16(r1)
+ cmpdi cr6, r0, 2
+ std r29, -24(r1)
+ addi n, n, 3 C compute count...
+ std r28, -32(r1)
+ srdi n, n, 2 C ...for ctr
+ std r27, -40(r1)
+ mtctr n C copy count into ctr
+ beq cr0, L(b00)
+ blt cr6, L(b01)
+ beq cr6, L(b10)
+
+L(b11): ld r9, 0(up)
+ ld r28, 0(rp)
+ mulld r0, r9, r6
+ mulhdu r12, r9, r6
+ ADDSUB r0, r0, r28
+ std r0, 0(rp)
+ addi rp, rp, 8
+ ld r9, 8(up)
+ ld r27, 16(up)
+ addi up, up, 24
+SM(` subfe r11, r11, r11 ')
+ b L(bot)
+
+ ALIGN(16)
+L(b00): ld r9, 0(up)
+ ld r27, 8(up)
+ ld r28, 0(rp)
+ ld r29, 8(rp)
+ mulld r0, r9, r6
+ mulhdu r5, r9, r6
+ mulld r7, r27, r6
+ mulhdu r8, r27, r6
+ addc r7, r7, r5
+ addze r12, r8
+ ADDSUB r0, r0, r28
+ std r0, 0(rp)
+ ADDSUBC r7, r7, r29
+ std r7, 8(rp)
+ addi rp, rp, 16
+ ld r9, 16(up)
+ ld r27, 24(up)
+ addi up, up, 32
+SM(` subfe r11, r11, r11 ')
+ b L(bot)
+
+ ALIGN(16)
+L(b01): bdnz L(gt1)
+ ld r9, 0(up)
+ ld r11, 0(rp)
+ mulld r0, r9, r6
+ mulhdu r8, r9, r6
+ ADDSUB r0, r0, r11
+ std r0, 0(rp)
+SM(` subfe r11, r11, r11 ')
+SM(` addic r11, r11, 1 ')
+ addze r3, r8
+ blr
+L(gt1): ld r9, 0(up)
+ ld r27, 8(up)
+ mulld r0, r9, r6
+ mulhdu r5, r9, r6
+ mulld r7, r27, r6
+ mulhdu r8, r27, r6
+ ld r9, 16(up)
+ ld r28, 0(rp)
+ ld r29, 8(rp)
+ ld r30, 16(rp)
+ mulld r11, r9, r6
+ mulhdu r10, r9, r6
+ addc r7, r7, r5
+ adde r11, r11, r8
+ addze r12, r10
+ ADDSUB r0, r0, r28
+ std r0, 0(rp)
+ ADDSUBC r7, r7, r29
+ std r7, 8(rp)
+ ADDSUBC r11, r11, r30
+ std r11, 16(rp)
+ addi rp, rp, 24
+ ld r9, 24(up)
+ ld r27, 32(up)
+ addi up, up, 40
+SM(` subfe r11, r11, r11 ')
+ b L(bot)
+
+L(b10): addic r0, r0, 0
+ li r12, 0 C cy_limb = 0
+ ld r9, 0(up)
+ ld r27, 8(up)
+ bdz L(end)
+ addi up, up, 16
+
+ ALIGN(16)
+L(top): mulld r0, r9, r6
+ mulhdu r5, r9, r6 C 9
+ mulld r7, r27, r6
+ mulhdu r8, r27, r6 C 27
+ ld r9, 0(up)
+ ld r28, 0(rp)
+ ld r27, 8(up)
+ ld r29, 8(rp)
+ adde r0, r0, r12 C 0 12
+ adde r7, r7, r5 C 5 7
+ mulld r5, r9, r6
+ mulhdu r10, r9, r6 C 9
+ mulld r11, r27, r6
+ mulhdu r12, r27, r6 C 27
+ ld r9, 16(up)
+ ld r30, 16(rp)
+ ld r27, 24(up)
+ ld r31, 24(rp)
+ adde r5, r5, r8 C 8 5
+ adde r11, r11, r10 C 10 11
+ addze r12, r12 C 12
+ ADDSUB r0, r0, r28 C 0 28
+ std r0, 0(rp) C 0
+ ADDSUBC r7, r7, r29 C 7 29
+ std r7, 8(rp) C 7
+ ADDSUBC r5, r5, r30 C 5 30
+ std r5, 16(rp) C 5
+ ADDSUBC r11, r11, r31 C 11 31
+ std r11, 24(rp) C 11
+ addi up, up, 32
+SM(` subfe r11, r11, r11 ')
+ addi rp, rp, 32
+L(bot):
+SM(` addic r11, r11, 1 ')
+ bdnz L(top)
+
+L(end): mulld r0, r9, r6
+ mulhdu r5, r9, r6
+ mulld r7, r27, r6
+ mulhdu r8, r27, r6
+ ld r28, 0(rp)
+ ld r29, 8(rp)
+ adde r0, r0, r12
+ adde r7, r7, r5
+ addze r8, r8
+ ADDSUB r0, r0, r28
+ std r0, 0(rp)
+ ADDSUBC r7, r7, r29
+ std r7, 8(rp)
+SM(` subfe r11, r11, r11 ')
+SM(` addic r11, r11, 1 ')
+ addze r3, r8
+ ld r31, -8(r1)
+ ld r30, -16(r1)
+ ld r29, -24(r1)
+ ld r28, -32(r1)
+ ld r27, -40(r1)
+ blr
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/mode64/aorsorrlsh1_n.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/mode64/aorsorrlsh1_n.asm
new file mode 100644
index 00000000000..2c5400ab526
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/mode64/aorsorrlsh1_n.asm
@@ -0,0 +1,43 @@
+dnl PowerPC-64 mpn_addlsh1_n, mpn_sublsh1_n, mpn_rsblsh1_n.
+
+dnl Copyright 2003, 2005, 2009, 2010, 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')
+
+
+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(`powerpc64/mode64/aorsorrlshC_n.asm')
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/mode64/aorsorrlsh2_n.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/mode64/aorsorrlsh2_n.asm
new file mode 100644
index 00000000000..447791abb06
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/mode64/aorsorrlsh2_n.asm
@@ -0,0 +1,43 @@
+dnl PowerPC-64 mpn_addlsh2_n, mpn_sublsh2_n, mpn_rsblsh2_n.
+
+dnl Copyright 2003, 2005, 2009, 2010, 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')
+
+
+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(`powerpc64/mode64/aorsorrlshC_n.asm')
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/mode64/aorsorrlshC_n.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/mode64/aorsorrlshC_n.asm
new file mode 100644
index 00000000000..6158f541fc0
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/mode64/aorsorrlshC_n.asm
@@ -0,0 +1,187 @@
+dnl PowerPC-64 mpn_addlshC_n, mpn_sublshC_n, mpn_rsblshC_n.
+
+dnl Copyright 2003, 2005, 2009, 2010, 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/.
+
+C cycles/limb
+C POWER3/PPC630 1.83 (1.5 c/l should be possible)
+C POWER4/PPC970 3 (2.0 c/l should be possible)
+C POWER5 3
+C POWER6 3.5-47
+C POWER7 3
+
+C STATUS
+C * Try combining upx+up, and vpx+vp.
+C * The worst case 47 c/l for POWER6 happens if the 3rd operand for ldx is
+C greater than the 2nd operand. Yes, this addition is non-commutative wrt
+C performance.
+
+C INPUT PARAMETERS
+define(`rp', `r3')
+define(`up', `r4')
+define(`vp', `r5')
+define(`n', `r6')
+
+ifdef(`DO_add', `
+ define(`ADDSUBC', `addc $1, $2, $3')
+ define(`ADDSUBE', `adde $1, $2, $3')
+ define(INITCY, `addic $1, r1, 0')
+ define(RETVAL, `addze r3, $1')
+ define(`func', mpn_addlsh`'LSH`'_n)')
+ifdef(`DO_sub', `
+ define(`ADDSUBC', `subfc $1, $2, $3')
+ define(`ADDSUBE', `subfe $1, $2, $3')
+ define(INITCY, `addic $1, r1, -1')
+ define(RETVAL, `subfze r3, $1
+ neg r3, r3')
+ define(`func', mpn_sublsh`'LSH`'_n)')
+ifdef(`DO_rsb', `
+ define(`ADDSUBC', `subfc $1, $3, $2')
+ define(`ADDSUBE', `subfe $1, $3, $2')
+ define(INITCY, `addic $1, r1, -1')
+ define(RETVAL, `addme r3, $1')
+ define(`func', mpn_rsblsh`'LSH`'_n)')
+
+define(`rpx', `r6')
+define(`upx', `r7')
+define(`vpx', `r12')
+
+define(`s0', `r0') define(`s1', `r9')
+define(`u0', `r8')
+define(`v0', `r10') define(`v1', `r11')
+
+
+ASM_START()
+PROLOGUE(func)
+ cmpldi cr0, n, 13
+ bgt L(big)
+
+ mtctr n C copy n in ctr
+ INITCY( r0) C clear cy
+
+ ld v0, 0(vp) C load v limb
+ ld u0, 0(up) C load u limb
+ addi up, up, -8 C update up
+ addi rp, rp, -8 C update rp
+ sldi s1, v0, LSH
+ bdz L(ex1) C If done, skip loop
+
+ ALIGN(16)
+L(lo0): ld v1, 8(vp) C load v limb
+ ADDSUBE(s1, s1, u0) C add limbs with cy, set cy
+ ldu u0, 16(up) C load u limb and update up
+ srdi s0, v0, RSH C shift down previous v limb
+ std s1, 8(rp) C store result limb
+ rldimi s0, v1, LSH, 0 C left shift v limb and merge with prev v limb
+ bdz L(ex0) C decrement ctr and exit if done
+ ldu v0, 16(vp) C load v limb and update vp
+ ADDSUBE(s0, s0, u0) C add limbs with cy, set cy
+ ld u0, 8(up) C load u limb
+ srdi s1, v1, RSH C shift down previous v limb
+ stdu s0, 16(rp) C store result limb and update rp
+ rldimi s1, v0, LSH, 0 C left shift v limb and merge with prev v limb
+ bdnz L(lo0) C decrement ctr and loop back
+
+L(ex1): ADDSUBE(r7, s1, u0)
+ std r7, 8(rp) C store last result limb
+ srdi r0, v0, RSH
+ RETVAL( r0)
+ blr
+L(ex0): ADDSUBE(r7, s0, u0)
+ std r7, 16(rp) C store last result limb
+ srdi r0, v1, RSH
+ RETVAL( r0)
+ blr
+
+
+L(big): rldicl. r0, n, 0,63 C r0 = n & 1, set cr0
+ addi r6, n, -1 C ...for ctr
+ srdi r6, r6, 1 C ...for ctr
+ mtctr r6 C copy count into ctr
+ beq cr0, L(b0)
+
+L(b1): ld v1, 0(vp)
+ ld u0, 0(up)
+ sldi s1, v1, LSH
+ srdi s0, v1, RSH
+ ld v0, 8(vp)
+ ADDSUBC(s1, s1, u0) C add limbs without cy, set cy
+ addi rpx, rp, -16
+ addi rp, rp, -8
+ sub upx, up, rp
+ sub vpx, vp, rp
+ sub up, up, rpx
+ sub vp, vp, rpx
+ addi up, up, 8
+ addi upx, upx, 16
+ addi vp, vp, 16
+ addi vpx, vpx, 24
+ b L(mid)
+
+L(b0): ld v0, 0(vp)
+ ld u0, 0(up)
+ sldi s0, v0, LSH
+ srdi s1, v0, RSH
+ ld v1, 8(vp)
+ ADDSUBC(s0, s0, u0) C add limbs without cy, set cy
+ addi rpx, rp, -8
+ addi rp, rp, -16
+ sub upx, up, rpx
+ sub vpx, vp, rpx
+ sub up, up, rp
+ sub vp, vp, rp
+ addi up, up, 8
+ addi upx, upx, 16
+ addi vp, vp, 16
+ addi vpx, vpx, 24
+
+ ALIGN(32)
+L(top): ldx u0, rp, up
+ ldx v0, rp, vp
+ rldimi s1, v1, LSH, 0
+ stdu s0, 16(rp)
+ srdi s0, v1, RSH
+ ADDSUBE(s1, s1, u0) C add limbs with cy, set cy
+L(mid): ldx u0, rpx, upx
+ ldx v1, rpx, vpx
+ rldimi s0, v0, LSH, 0
+ stdu s1, 16(rpx)
+ srdi s1, v0, RSH
+ ADDSUBE(s0, s0, u0) C add limbs with cy, set cy
+ bdnz L(top) C decrement CTR and loop back
+
+ ldx u0, rp, up
+ rldimi s1, v1, LSH, 0
+ std s0, 16(rp)
+ srdi s0, v1, RSH
+ ADDSUBE(s1, s1, u0) C add limbs with cy, set cy
+ std s1, 24(rp)
+
+ RETVAL( s0)
+ blr
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/mode64/bdiv_dbm1c.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/mode64/bdiv_dbm1c.asm
new file mode 100644
index 00000000000..45cded97159
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/mode64/bdiv_dbm1c.asm
@@ -0,0 +1,132 @@
+dnl PPC64 mpn_bdiv_dbm1c.
+
+dnl Copyright 2008, 2010 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 6-18
+C POWER4/PPC970 8.25
+C POWER5 8.5 fluctuating as function of n % 3
+C POWER6 15
+C POWER7 4.75
+
+C TODO
+C * Nothing to do...
+
+C INPUT PARAMETERS
+define(`rp', `r3')
+define(`up', `r4')
+define(`n', `r5')
+define(`bd', `r6')
+define(`cy', `r7')
+
+ASM_START()
+PROLOGUE(mpn_bdiv_dbm1c)
+ ld r0, 0(r4)
+
+ rldicl. r12, r5, 0,62
+ cmpldi cr6, r12, 2
+ cmpldi cr7, r5, 4
+ addi r5, r5, 1
+ srwi r5, r5, 2
+ mtctr r5
+ beq cr0, L(b00)
+ blt cr6, L(b01)
+ beq cr6, L(b10)
+
+ ALIGN(16)
+L(b11): mulld r5, r0, r6
+ mulhdu r12, r0, r6
+ ld r0, 8(r4)
+ addi r4, r4, -24
+ addi r3, r3, -24
+ b L(3)
+
+ ALIGN(16)
+L(b00): mulld r9, r0, r6
+ mulhdu r8, r0, r6
+ addi r4, r4, -16
+ addi r3, r3, -16
+ b L(0)
+
+ ALIGN(16)
+L(b01): mulld r5, r0, r6
+ mulhdu r12, r0, r6
+ addi r3, r3, -8
+ ble cr7, L(e1)
+ ld r0, 8(r4)
+ addi r4, r4, -8
+ b L(1)
+
+ ALIGN(16)
+L(b10): mulld r9, r0, r6
+ mulhdu r8, r0, r6
+ ble cr7, L(e2)
+
+ ALIGN(16)
+L(top): subfc r11, r9, r7
+ ld r10, 8(r4)
+ ld r0, 16(r4)
+ subfe r7, r8, r11
+ std r11, 0(r3)
+ mulld r5, r10, r6
+ mulhdu r12, r10, r6
+L(1): mulld r9, r0, r6
+ mulhdu r8, r0, r6
+ subfc r11, r5, r7
+ subfe r7, r12, r11
+ std r11, 8(r3)
+L(0): subfc r11, r9, r7
+ ld r10, 24(r4)
+ ld r0, 32(r4)
+ subfe r7, r8, r11
+ std r11, 16(r3)
+ mulld r5, r10, r6
+ mulhdu r12, r10, r6
+L(3): mulld r9, r0, r6
+ mulhdu r8, r0, r6
+ subfc r11, r5, r7
+ subfe r7, r12, r11
+ std r11, 24(r3)
+ addi r4, r4, 32
+ addi r3, r3, 32
+ bdnz L(top)
+
+L(e2): ld r10, 8(r4)
+ mulld r5, r10, r6
+ mulhdu r12, r10, r6
+ subfc r11, r9, r7
+ subfe r7, r8, r11
+ std r11, 0(r3)
+L(e1): subfc r11, r5, r7
+ std r11, 8(r3)
+ subfe r3, r12, r11
+ blr
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/mode64/cnd_aors_n.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/mode64/cnd_aors_n.asm
new file mode 100644
index 00000000000..24968c19125
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/mode64/cnd_aors_n.asm
@@ -0,0 +1,196 @@
+dnl PowerPC-64 mpn_cnd_add_n/mpn_cnd_sub_n.
+
+dnl Copyright 1999-2001, 2003-2005, 2007, 2011, 2012 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 2.25
+C POWER5 ?
+C POWER6 3
+C POWER7 2
+
+C INPUT PARAMETERS
+define(`cnd', `r3')
+define(`rp', `r4')
+define(`up', `r5')
+define(`vp', `r6')
+define(`n', `r7')
+
+ifdef(`OPERATION_cnd_add_n',`
+ define(ADDSUBC, adde)
+ define(ADDSUB, addc)
+ define(func, mpn_cnd_add_n)
+ define(GENRVAL, `addi r3, r3, 1')
+ define(SETCBR, `addic r0, $1, -1')
+ define(CLRCB, `addic r0, r0, 0')
+')
+ifdef(`OPERATION_cnd_sub_n',`
+ define(ADDSUBC, subfe)
+ define(ADDSUB, subfc)
+ define(func, mpn_cnd_sub_n)
+ define(GENRVAL, `neg r3, r3')
+ define(SETCBR, `subfic r0, $1, 0')
+ define(CLRCB, `addic r0, r1, -1')
+')
+
+MULFUNC_PROLOGUE(mpn_cnd_add_n mpn_cnd_sub_n)
+
+ASM_START()
+PROLOGUE(func)
+ std r31, -8(r1)
+ std r30, -16(r1)
+ std r29, -24(r1)
+ std r28, -32(r1)
+ std r27, -40(r1)
+
+ subfic cnd, cnd, 0
+ subfe cnd, cnd, cnd
+
+ rldicl. r0, n, 0,62 C r0 = n & 3, set cr0
+ cmpdi cr6, r0, 2
+ addi n, n, 3 C compute count...
+ srdi n, n, 2 C ...for ctr
+ mtctr n C copy count into ctr
+ beq cr0, L(b00)
+ blt cr6, L(b01)
+ beq cr6, L(b10)
+
+L(b11): ld r8, 0(up) C load s1 limb
+ ld r9, 0(vp) C load s2 limb
+ ld r10, 8(up) C load s1 limb
+ ld r11, 8(vp) C load s2 limb
+ ld r12, 16(up) C load s1 limb
+ addi up, up, 24
+ ld r0, 16(vp) C load s2 limb
+ addi vp, vp, 24
+ and r9, r9, cnd
+ and r11, r11, cnd
+ and r0, r0, cnd
+ ADDSUB r29, r9, r8
+ ADDSUBC r30, r11, r10
+ ADDSUBC r31, r0, r12
+ std r29, 0(rp)
+ std r30, 8(rp)
+ std r31, 16(rp)
+ addi rp, rp, 24
+ bdnz L(go)
+ b L(ret)
+
+L(b01): ld r12, 0(up) C load s1 limb
+ addi up, up, 8
+ ld r0, 0(vp) C load s2 limb
+ addi vp, vp, 8
+ and r0, r0, cnd
+ ADDSUB r31, r0, r12 C add
+ std r31, 0(rp)
+ addi rp, rp, 8
+ bdnz L(go)
+ b L(ret)
+
+L(b10): ld r10, 0(up) C load s1 limb
+ ld r11, 0(vp) C load s2 limb
+ ld r12, 8(up) C load s1 limb
+ addi up, up, 16
+ ld r0, 8(vp) C load s2 limb
+ addi vp, vp, 16
+ and r11, r11, cnd
+ and r0, r0, cnd
+ ADDSUB r30, r11, r10 C add
+ ADDSUBC r31, r0, r12 C add
+ std r30, 0(rp)
+ std r31, 8(rp)
+ addi rp, rp, 16
+ bdnz L(go)
+ b L(ret)
+
+L(b00): CLRCB C clear/set cy
+L(go): ld r7, 0(up) C load s1 limb
+ ld r27, 0(vp) C load s2 limb
+ ld r8, 8(up) C load s1 limb
+ ld r9, 8(vp) C load s2 limb
+ ld r10, 16(up) C load s1 limb
+ ld r11, 16(vp) C load s2 limb
+ ld r12, 24(up) C load s1 limb
+ ld r0, 24(vp) C load s2 limb
+ and r27, r27, cnd
+ and r9, r9, cnd
+ and r11, r11, cnd
+ and r0, r0, cnd
+ bdz L(end)
+
+ addi up, up, 32
+ addi vp, vp, 32
+
+L(top): ADDSUBC r28, r27, r7
+ ld r7, 0(up) C load s1 limb
+ ld r27, 0(vp) C load s2 limb
+ ADDSUBC r29, r9, r8
+ ld r8, 8(up) C load s1 limb
+ ld r9, 8(vp) C load s2 limb
+ ADDSUBC r30, r11, r10
+ ld r10, 16(up) C load s1 limb
+ ld r11, 16(vp) C load s2 limb
+ ADDSUBC r31, r0, r12
+ ld r12, 24(up) C load s1 limb
+ ld r0, 24(vp) C load s2 limb
+ std r28, 0(rp)
+ addi up, up, 32
+ std r29, 8(rp)
+ addi vp, vp, 32
+ std r30, 16(rp)
+ std r31, 24(rp)
+ addi rp, rp, 32
+ and r27, r27, cnd
+ and r9, r9, cnd
+ and r11, r11, cnd
+ and r0, r0, cnd
+ bdnz L(top) C decrement ctr and loop back
+
+L(end): ADDSUBC r28, r27, r7
+ ADDSUBC r29, r9, r8
+ ADDSUBC r30, r11, r10
+ ADDSUBC r31, r0, r12
+ std r28, 0(rp)
+ std r29, 8(rp)
+ std r30, 16(rp)
+ std r31, 24(rp)
+
+L(ret): ld r31, -8(r1)
+ ld r30, -16(r1)
+ ld r29, -24(r1)
+ ld r28, -32(r1)
+ ld r27, -40(r1)
+
+ subfe r3, r0, r0 C -cy
+ GENRVAL
+ blr
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/mode64/dive_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/mode64/dive_1.asm
new file mode 100644
index 00000000000..434dde9145c
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/mode64/dive_1.asm
@@ -0,0 +1,132 @@
+dnl PowerPC-64 mpn_divexact_1 -- mpn by limb exact division.
+
+dnl Copyright 2006, 2010 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 TODO
+C * Check if n=1 code is really an improvement. It probably isn't.
+C * Make more similar to mode1o.asm.
+
+C INPUT PARAMETERS
+define(`rp', `r3')
+define(`up', `r4')
+define(`n', `r5')
+define(`d', `r6')
+
+
+ASM_START()
+
+EXTERN(binvert_limb_table)
+
+PROLOGUE(mpn_divexact_1,toc)
+ addic. n, n, -1
+ ld r12, 0(up)
+ bne cr0, L(2)
+ divdu r0, r12, d
+ std r0, 0(rp)
+ blr
+L(2):
+ rldicl. r0, d, 0, 63
+ li r10, 0
+ bne cr0, L(7)
+ neg r0, d
+ and r0, d, r0
+ cntlzd r0, r0
+ subfic r0, r0, 63
+ rldicl r10, r0, 0, 32
+ srd d, d, r0
+L(7):
+ mtctr n
+ LEA( r5, binvert_limb_table)
+ rldicl r11, d, 63, 57
+ lbzx r0, r5, r11
+ mulld r9, r0, r0
+ sldi r0, r0, 1
+ mulld r9, d, r9
+ subf r0, r9, r0
+ mulld r5, r0, r0
+ sldi r0, r0, 1
+ mulld r5, d, r5
+ subf r0, r5, r0
+ mulld r9, r0, r0
+ 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
+ srd r11, r12, r10
+
+ ALIGN(16)
+L(loop0):
+ ld r12, 8(up)
+ nop
+ addi up, up, 8
+ sld r0, r12, r8
+ or r11, r11, r0
+ subfe r9, r5, r11
+ srd r11, r12, r10
+ mulld r0, r7, r9
+ mulhdu r5, r0, d
+ std r0, 0(rp)
+ addi rp, rp, 8
+ bdnz L(loop0)
+
+ subfe r0, r5, r11
+ mulld r0, r7, r0
+ std r0, 0(rp)
+ blr
+
+ ALIGN(16)
+L(norm):
+ mulld r11, r12, r7
+ mulhdu r5, r11, d
+ std r11, 0(rp)
+ ALIGN(16)
+L(loop1):
+ ld r9, 8(up)
+ addi up, up, 8
+ subfe r5, r5, r9
+ mulld r11, r7, r5
+ mulhdu r5, r11, d C result not used
+ std r11, 8(rp)
+ addi rp, rp, 8
+ bdnz L(loop1)
+ blr
+EPILOGUE()
+ASM_END()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/mode64/divrem_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/mode64/divrem_1.asm
new file mode 100644
index 00000000000..b2838770064
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/mode64/divrem_1.asm
@@ -0,0 +1,274 @@
+dnl PowerPC-64 mpn_divrem_1 -- Divide an mpn number by an unnormalized limb.
+
+dnl Copyright 2003-2005, 2007, 2008, 2010, 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/limb
+C norm unorm frac
+C POWER3/PPC630 16-34 16-34 ~11 outdated figures
+C POWER4/PPC970 28 28 19
+C POWER5 29 29 ~19
+C POWER6 49 59 ~42
+C POWER7 24.5 23 ~14
+
+C INPUT PARAMETERS
+C qp = r3
+C fn = r4
+C up = r5
+C un = r6
+C d = r7
+
+C We use a not very predictable branch in the frac code, therefore the cycle
+C count wobbles somewhat. With the alternative branch-free code, things run
+C considerably slower on POWER4/PPC970 and POWER5.
+
+C Add preinv entry point.
+
+
+ASM_START()
+
+EXTERN_FUNC(mpn_invert_limb)
+
+PROLOGUE(mpn_divrem_1,toc)
+
+ mfcr r12
+ add. r10, r6, r4
+ std r25, -56(r1)
+ mr r25, r4
+ mflr r0
+ std r26, -48(r1)
+ mr r26, r5
+ std r28, -32(r1)
+ mr r28, r6
+ std r29, -24(r1)
+ mr r29, r3
+ li r3, 0
+ std r30, -16(r1)
+ mr r30, r7
+ std r31, -8(r1)
+ li r31, 0
+ std r27, -40(r1)
+ std r0, 16(r1)
+ stw r12, 8(r1)
+ stdu r1, -176(r1)
+ beq- cr0, L(1)
+ cmpdi cr7, r7, 0
+ sldi r0, r10, 3
+ add r11, r0, r29
+ addi r29, r11, -8
+ blt- cr7, L(162)
+ cmpdi cr4, r6, 0
+ beq+ cr4, L(71)
+L(163):
+ sldi r9, r6, 3
+ add r9, r9, r5
+ ld r7, -8(r9)
+ cmpld cr7, r7, r30
+ bge- cr7, L(71)
+ cmpdi cr7, r10, 1
+ li r0, 0
+ mr r31, r7
+ std r0, -8(r11)
+ addi r29, r29, -8
+ mr r3, r7
+ beq- cr7, L(1)
+ addi r28, r6, -1
+ cmpdi cr4, r28, 0
+L(71):
+ cntlzd r27, r30
+ sld r30, r30, r27
+ sld r31, r31, r27
+ mr r3, r30
+ CALL( mpn_invert_limb)
+ beq- cr4, L(110)
+ sldi r9, r28, 3
+ addic. r6, r28, -2
+ add r9, r9, r26
+ subfic r5, r27, 64
+ ld r8, -8(r9)
+ srd r0, r8, r5
+ or r31, r31, r0
+ sld r7, r8, r27
+ blt- cr0, L(154)
+ addi r28, r28, -1
+ mtctr r28
+ sldi r6, r6, 3
+ ALIGN(16)
+L(uloop):
+ ldx r8, r26, r6
+ nop
+ mulld r0, r31, r3
+ mulhdu r10, r31, r3
+ addi r11, r31, 1
+ srd r9, r8, r5
+ addi r6, r6, -8
+ or r9, r7, r9
+ addc r0, r0, r9
+ adde r10, r10, r11
+ mulld r31, r10, r30
+ subf r31, r31, r9
+ subfc r0, r31, r0 C r <= ql
+ subfe r0, r0, r0 C r0 = -(r <= ql)
+ and r9, r30, r0
+ add r31, r31, r9
+ add r10, r0, r10 C qh -= (r >= ql)
+ cmpld cr7, r31, r30
+ bge- cr7, L(164)
+L(123):
+ std r10, 0(r29)
+ addi r29, r29, -8
+ sld r7, r8, r27
+ bdnz L(uloop)
+L(154):
+ addi r11, r31, 1
+ nop
+ mulld r0, r31, r3
+ mulhdu r8, r31, r3
+ addc r0, r0, r7
+ adde r8, r8, r11
+ mulld r31, r8, r30
+ subf r31, r31, r7
+ subfc r0, r0, r31 C r >= ql
+ subfe r0, r0, r0 C r0 = -(r >= ql)
+ not r7, r0
+ add r8, r7, r8 C qh -= (r >= ql)
+ andc r0, r30, r0
+ add r31, r31, r0
+ cmpld cr7, r31, r30
+ bge- cr7, L(165)
+L(134):
+ std r8, 0(r29)
+ addi r29, r29, -8
+L(110):
+ addic. r0, r25, -1
+ blt- cr0, L(156)
+ mtctr r25
+ neg r9, r30
+ ALIGN(16)
+L(ufloop):
+ addi r11, r31, 1
+ nop
+ mulld r0, r3, r31
+ mulhdu r10, r3, r31
+ add r10, r10, r11
+ mulld r31, r9, r10
+ifelse(0,1,`
+ subfc r0, r0, r31
+ subfe r0, r0, r0 C r0 = -(r >= ql)
+ not r7, r0
+ add r10, r7, r10 C qh -= (r >= ql)
+ andc r0, r30, r0
+ add r31, r31, r0
+',`
+ cmpld cr7, r31, r0
+ blt cr7, L(29)
+ add r31, r30, r31
+ addi r10, r10, -1
+L(29):
+')
+ std r10, 0(r29)
+ addi r29, r29, -8
+ bdnz L(ufloop)
+L(156):
+ srd r3, r31, r27
+L(1):
+ addi r1, r1, 176
+ ld r0, 16(r1)
+ lwz r12, 8(r1)
+ mtlr r0
+ ld r25, -56(r1)
+ ld r26, -48(r1)
+ mtcrf 8, r12
+ ld r27, -40(r1)
+ ld r28, -32(r1)
+ ld r29, -24(r1)
+ ld r30, -16(r1)
+ ld r31, -8(r1)
+ blr
+L(162):
+ cmpdi cr7, r6, 0
+ beq- cr7, L(8)
+ sldi r9, r6, 3
+ addi r29, r29, -8
+ add r9, r9, r5
+ addi r28, r6, -1
+ ld r31, -8(r9)
+ subfc r9, r7, r31
+ li r9, 0
+ adde r9, r9, r9
+ neg r0, r9
+ std r9, -8(r11)
+ and r0, r0, r7
+ subf r31, r0, r31
+L(8):
+ mr r3, r30
+ CALL( mpn_invert_limb)
+ li r27, 0
+ addic. r6, r28, -1
+ blt- cr0, L(110)
+ mtctr r28
+ sldi r6, r6, 3
+ ALIGN(16)
+L(nloop):
+ addi r11, r31, 1
+ ldx r8, r26, r6
+ mulld r0, r31, r3
+ mulhdu r10, r31, r3
+ addi r6, r6, -8
+ addc r0, r0, r8
+ adde r10, r10, r11
+ mulld r31, r10, r30
+ subf r31, r31, r8 C r = nl - qh * d
+ subfc r0, r31, r0 C r <= ql
+ subfe r0, r0, r0 C r0 = -(r <= ql)
+ and r9, r30, r0
+ add r31, r31, r9
+ add r10, r0, r10 C qh -= (r >= ql)
+ cmpld cr7, r31, r30
+ bge- cr7, L(167)
+L(51):
+ std r10, 0(r29)
+ addi r29, r29, -8
+ bdnz L(nloop)
+ b L(110)
+
+L(164):
+ subf r31, r30, r31
+ addi r10, r10, 1
+ b L(123)
+L(167):
+ subf r31, r30, r31
+ addi r10, r10, 1
+ b L(51)
+L(165):
+ subf r31, r30, r31
+ addi r8, r8, 1
+ b L(134)
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/mode64/divrem_2.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/mode64/divrem_2.asm
new file mode 100644
index 00000000000..73ec23c94d5
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/mode64/divrem_2.asm
@@ -0,0 +1,187 @@
+dnl PPC-64 mpn_divrem_2 -- Divide an mpn number by a normalized 2-limb number.
+
+dnl Copyright 2007, 2008 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 frac
+C POWER3/PPC630
+C POWER4/PPC970 ? ?
+C POWER5 37 ?
+C POWER6 62 ?
+C POWER6 30.5 ?
+
+C INPUT PARAMETERS
+C qp = r3
+C fn = r4
+C up = r5
+C un = r6
+C dp = r7
+
+
+ifdef(`DARWIN',,`
+define(`r2',`r31')') C FIXME!
+
+ASM_START()
+
+EXTERN_FUNC(mpn_invert_limb)
+
+PROLOGUE(mpn_divrem_2,toc)
+ mflr r0
+ 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)
+ std r0, 16(r1)
+ stdu r1, -192(r1)
+ mr r24, r3
+ mr r25, r4
+ sldi r0, r6, 3
+ add r26, r5, r0
+ addi r26, r26, -24
+ ld r30, 8(r7)
+ ld r28, 0(r7)
+ ld r29, 16(r26)
+ ld r31, 8(r26)
+
+ifelse(0,1,`
+ li r23, 0
+ cmpld cr7, r29, r30
+ blt cr7, L(8)
+ bgt cr7, L(9)
+ cmpld cr0, r31, r28
+ blt cr0, L(8)
+L(9): subfc r31, r28, r31
+ subfe r29, r30, r29
+ li r23, 1
+',`
+ li r23, 0
+ cmpld cr7, r29, r30
+ blt cr7, L(8)
+ mfcr r0
+ rlwinm r0, r0, 30, 1
+ subfc r9, r28, r31
+ addze. r0, r0
+ nop
+ beq cr0, L(8)
+ subfc r31, r28, r31
+ subfe r29, r30, r29
+ li r23, 1
+')
+
+L(8):
+ add r27, r25, r6
+ addic. r27, r27, -3
+ blt cr0, L(18)
+ mr r3, r30
+ CALL( mpn_invert_limb)
+ mulld r10, r3, r30
+ mulhdu r0, r3, r28
+ addc r8, r10, r28
+ subfe r11, r1, r1
+ addc r10, r8, r0
+ addze. r11, r11
+ blt cr0, L(91)
+L(40):
+ subfc r10, r30, r10
+ addme. r11, r11
+ addi r3, r3, -1
+ bge cr0, L(40)
+L(91):
+ addi r5, r27, 1
+ mtctr r5
+ sldi r0, r27, 3
+ add r24, r24, r0
+ ALIGN(16)
+L(loop):
+ mulhdu r8, r29, r3
+ mulld r6, r29, r3
+ addc r6, r6, r31
+ adde r8, r8, r29
+ cmpd cr7, r27, r25
+ mulld r0, r30, r8
+ mulhdu r11, r28, r8
+ mulld r10, r28, r8
+ subf r31, r0, r31
+ li r7, 0
+ blt cr7, L(60)
+ ld r7, 0(r26)
+ addi r26, r26, -8
+ nop
+L(60): subfc r7, r28, r7
+ subfe r31, r30, r31
+ subfc r7, r10, r7
+ subfe r4, r11, r31
+ subfc r9, r6, r4
+ subfe r9, r1, r1
+ andc r6, r28, r9
+ andc r0, r30, r9
+ addc r31, r7, r6
+ adde r29, r4, r0
+ subf r8, r9, r8
+ cmpld cr7, r29, r30
+ bge- cr7, L(fix)
+L(bck): std r8, 0(r24)
+ addi r24, r24, -8
+ addi r27, r27, -1
+ bdnz L(loop)
+L(18):
+ std r31, 8(r26)
+ std r29, 16(r26)
+ mr r3, r23
+ addi r1, r1, 192
+ ld r0, 16(r1)
+ mtlr r0
+ 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
+L(fix):
+ mfcr r0
+ rlwinm r0, r0, 30, 1
+ subfc r9, r28, r31
+ addze. r0, r0
+ beq cr0, L(bck)
+ subfc r31, r28, r31
+ subfe r29, r30, r29
+ addi r8, r8, 1
+ b L(bck)
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/mode64/gcd_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/mode64/gcd_1.asm
new file mode 100644
index 00000000000..8762bbbef50
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/mode64/gcd_1.asm
@@ -0,0 +1,122 @@
+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')
+
+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()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/mode64/gmp-mparam.h b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/mode64/gmp-mparam.h
new file mode 100644
index 00000000000..f8305f47202
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/mode64/gmp-mparam.h
@@ -0,0 +1,82 @@
+/* PowerPC-64 gmp-mparam.h -- Compiler/machine parameter header file.
+
+Copyright 2008, 2009 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
+
+/* 1600MHz PPC970 */
+
+/* Generated by tuneup.c, 2009-01-14, gcc 4.0 */
+
+#define MUL_TOOM22_THRESHOLD 14
+#define MUL_TOOM33_THRESHOLD 93
+#define MUL_TOOM44_THRESHOLD 135
+
+#define SQR_BASECASE_THRESHOLD 6
+#define SQR_TOOM2_THRESHOLD 32
+#define SQR_TOOM3_THRESHOLD 74
+#define SQR_TOOM4_THRESHOLD 136
+
+#define MULLO_BASECASE_THRESHOLD 0 /* always */
+#define MULLO_DC_THRESHOLD 44
+#define MULLO_MUL_N_THRESHOLD 234
+
+#define DIV_SB_PREINV_THRESHOLD 0 /* always */
+#define DIV_DC_THRESHOLD 33
+#define POWM_THRESHOLD 89
+
+#define MATRIX22_STRASSEN_THRESHOLD 15
+#define HGCD_THRESHOLD 93
+#define GCD_DC_THRESHOLD 237
+#define GCDEXT_DC_THRESHOLD 273
+#define JACOBI_BASE_METHOD 1
+
+#define MOD_1_NORM_THRESHOLD 0 /* always */
+#define MOD_1_UNNORM_THRESHOLD 0 /* always */
+#define MOD_1_1_THRESHOLD 6
+#define MOD_1_2_THRESHOLD 9
+#define MOD_1_4_THRESHOLD 23
+#define USE_PREINV_DIVREM_1 0
+#define USE_PREINV_MOD_1 0
+#define DIVEXACT_1_THRESHOLD 0 /* always (native) */
+#define MODEXACT_1_ODD_THRESHOLD 0 /* always (native) */
+
+#define GET_STR_DC_THRESHOLD 12
+#define GET_STR_PRECOMPUTE_THRESHOLD 24
+#define SET_STR_DC_THRESHOLD 650
+#define SET_STR_PRECOMPUTE_THRESHOLD 1713
+
+#define MUL_FFT_TABLE { 336, 672, 1856, 2816, 7168, 20480, 81920, 327680, 0 }
+#define MUL_FFT_MODF_THRESHOLD 304
+#define MUL_FFT_THRESHOLD 4224
+
+#define SQR_FFT_TABLE { 272, 672, 1600, 2816, 7168, 20480, 81920, 327680, 786432, 0 }
+#define SQR_FFT_MODF_THRESHOLD 272
+#define SQR_FFT_THRESHOLD 2688
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/mode64/invert_limb.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/mode64/invert_limb.asm
new file mode 100644
index 00000000000..dfdba6451ed
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/mode64/invert_limb.asm
@@ -0,0 +1,88 @@
+dnl PowerPC-64 mpn_invert_limb -- Invert a normalized limb.
+
+dnl Copyright 2004-2006, 2008, 2010, 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/limb (approximate)
+C POWER3/PPC630 80
+C POWER4/PPC970 86
+C POWER5 86
+C POWER6 170
+C POWER7 66
+
+ASM_START()
+PROLOGUE(mpn_invert_limb,toc)
+ LEAL( r12, approx_tab)
+ srdi r9, r3, 32
+ rlwinm r9, r9, 10, 23, 30 C (d >> 55) & 0x1fe
+ srdi r10, r3, 24 C d >> 24
+ lis r11, 0x1000
+ rldicl r8, r3, 0, 63 C d mod 2
+ addi r10, r10, 1 C d40
+ sldi r11, r11, 32 C 2^60
+ srdi r7, r3, 1 C d/2
+ add r7, r7, r8 C d63 = ceil(d/2)
+ neg r8, r8 C mask = -(d mod 2)
+ lhzx r0, r9, r12
+ mullw r9, r0, r0 C v0*v0
+ sldi r6, r0, 11 C v0 << 11
+ addi r0, r6, -1 C (v0 << 11) - 1
+ mulld r9, r9, r10 C v0*v0*d40
+ srdi r9, r9, 40 C v0*v0*d40 >> 40
+ subf r9, r9, r0 C v1 = (v0 << 11) - (v0*v0*d40 >> 40) - 1
+ mulld r0, r9, r10 C v1*d40
+ sldi r6, r9, 13 C v1 << 13
+ subf r0, r0, r11 C 2^60 - v1*d40
+ mulld r0, r0, r9 C v1 * (2^60 - v1*d40)
+ srdi r0, r0, 47 C v1 * (2^60 - v1*d40) >> 47
+ add r0, r0, r6 C v2 = (v1 << 13) + (v1 * (2^60 - v1*d40) >> 47)
+ mulld r11, r0, r7 C v2 * d63
+ srdi r10, r0, 1 C v2 >> 1
+ sldi r9, r0, 31 C v2 << 31
+ and r8, r10, r8 C (v2 >> 1) & mask
+ subf r8, r11, r8 C ((v2 >> 1) & mask) - v2 * d63
+ mulhdu r0, r8, r0 C p1 = v2 * (((v2 >> 1) & mask) - v2 * d63)
+ srdi r0, r0, 1 C p1 >> 1
+ add r0, r0, r9 C v3 = (v2 << 31) + (p1 >> 1)
+ nop
+ mulld r11, r0, r3
+ mulhdu r9, r0, r3
+ addc r10, r11, r3
+ adde r3, r9, r3
+ subf r3, r3, r0
+ blr
+EPILOGUE()
+
+DEF_OBJECT(approx_tab)
+forloop(i,256,512-1,dnl
+` .short eval(0x7fd00/i)
+')dnl
+END_OBJECT(approx_tab)
+ASM_END()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/mode64/mod_1_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/mode64/mod_1_1.asm
new file mode 100644
index 00000000000..873373054f5
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/mode64/mod_1_1.asm
@@ -0,0 +1,164 @@
+dnl PowerPC-64 mpn_mod_1_1p
+
+dnl Copyright 2010, 2011 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 17
+C POWER5 16
+C POWER6 30
+C POWER7 10.2
+
+C TODO
+C * Optimise, in particular the cps function. This was compiler-generated and
+C then hand optimised.
+
+C INPUT PARAMETERS
+define(`ap', `r3')
+define(`n', `r4')
+define(`d', `r5')
+define(`cps', `r6')
+
+ASM_START()
+
+EXTERN_FUNC(mpn_invert_limb)
+
+PROLOGUE(mpn_mod_1_1p)
+ sldi r10, r4, 3
+ addi r4, r4, -1
+ add r3, r3, r10
+ ld r0, 16(r6) C B1modb
+ ld r12, 24(r6) C B2modb
+ ld r9, -8(r3)
+ ld r10, -16(r3)
+ mtctr r4
+ mulhdu r8, r9, r0
+ mulld r7, r9, r0
+ addc r11, r7, r10
+ addze r9, r8
+ bdz L(end)
+
+ ALIGN(16)
+L(top): ld r4, -24(r3)
+ addi r3, r3, -8
+ nop
+ mulld r10, r11, r0
+ mulld r8, r9, r12
+ mulhdu r11, r11, r0
+ mulhdu r9, r9, r12
+ addc r7, r10, r4
+ addze r10, r11
+ addc r11, r8, r7
+ adde r9, r9, r10
+ bdnz L(top)
+
+L(end):
+ifdef(`HAVE_LIMB_LITTLE_ENDIAN',
+` lwz r0, 8(r6)',
+` lwz r0, 12(r6)')
+ ld r3, 0(r6)
+ cmpdi cr7, r0, 0
+ beq- cr7, L(4)
+ subfic r10, r0, 64
+ sld r9, r9, r0
+ srd r10, r11, r10
+ or r9, r10, r9
+L(4): subfc r10, r5, r9
+ subfe r10, r10, r10
+ nand r10, r10, r10
+ sld r11, r11, r0
+ and r10, r10, r5
+ subf r9, r10, r9
+ mulhdu r10, r9, r3
+ mulld r3, r9, r3
+ addi r9, r9, 1
+ addc r8, r3, r11
+ adde r3, r10, r9
+ mulld r3, r3, r5
+ subf r3, r3, r11
+ cmpld cr7, r8, r3
+ bge cr7, L(5) C FIXME: Make branch-less
+ add r3, r3, r5
+L(5): cmpld cr7, r3, r5
+ bge- cr7, L(10)
+ srd r3, r3, r0
+ blr
+
+L(10): subf r3, r5, r3
+ srd r3, r3, r0
+ blr
+EPILOGUE()
+
+PROLOGUE(mpn_mod_1_1p_cps,toc)
+ mflr r0
+ std r29, -24(r1)
+ std r30, -16(r1)
+ std r31, -8(r1)
+ cntlzd r31, r4
+ std r0, 16(r1)
+ extsw r31, r31
+ mr r29, r3
+ stdu r1, -144(r1)
+ sld r30, r4, r31
+ mr r3, r30
+ CALL( mpn_invert_limb)
+ cmpdi cr7, r31, 0
+ neg r0, r30
+ beq- cr7, L(13)
+ subfic r11, r31, 64
+ li r0, 1
+ neg r9, r30
+ srd r11, r3, r11
+ sld r0, r0, r31
+ or r0, r11, r0
+ mulld r0, r0, r9
+L(13): mulhdu r9, r0, r3
+ mulld r11, r0, r3
+ add r9, r0, r9
+ nor r9, r9, r9
+ mulld r9, r9, r30
+ cmpld cr7, r11, r9
+ bge cr7, L(14)
+ add r9, r9, r30
+L(14): addi r1, r1, 144
+ srd r0, r0, r31
+ std r31, 8(r29)
+ std r3, 0(r29)
+ std r0, 16(r29)
+ ld r0, 16(r1)
+ srd r9, r9, r31
+ ld r30, -16(r1)
+ ld r31, -8(r1)
+ std r9, 24(r29)
+ ld r29, -24(r1)
+ mtlr r0
+ blr
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/mode64/mod_1_4.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/mode64/mod_1_4.asm
new file mode 100644
index 00000000000..0b7d6bf6997
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/mode64/mod_1_4.asm
@@ -0,0 +1,270 @@
+dnl PowerPC-64 mpn_mod_1s_4p
+
+dnl Copyright 2010, 2011 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 9
+C POWER5 9
+C POWER6 13
+C POWER7 3.5
+
+C TODO
+C * Optimise, in particular the cps function. This was compiler-generated and
+C then hand optimised.
+
+C INPUT PARAMETERS
+define(`ap', `r3')
+define(`n', `r4')
+define(`d', `r5')
+define(`cps', `r6')
+
+ASM_START()
+
+EXTERN_FUNC(mpn_invert_limb)
+
+PROLOGUE(mpn_mod_1s_4p)
+ std r23, -72(r1)
+ ld r23, 48(cps)
+ std r24, -64(r1)
+ std r25, -56(r1)
+ ld r24, 32(cps)
+ ld r25, 24(cps)
+ std r26, -48(r1)
+ std r27, -40(r1)
+ ld r26, 16(cps)
+ std r28, -32(r1)
+ std r29, -24(r1)
+ std r30, -16(r1)
+ std r31, -8(r1)
+ ld r30, 40(cps)
+
+ rldicl. r0, n, 0,62
+ sldi r31, n, 3
+ add ap, ap, r31 C make ap point at end of operand
+
+ cmpdi cr7, r0, 2
+ beq cr0, L(b00)
+ blt cr7, L(b01)
+ beq cr7, L(b10)
+
+L(b11): ld r11, -16(ap)
+ ld r9, -8(ap)
+ ld r0, -24(ap)
+ mulhdu r27, r11, r26
+ mulld r8, r11, r26
+ mulhdu r11, r9, r25
+ mulld r9, r9, r25
+ addc r31, r8, r0
+ addze r10, r27
+ addc r0, r9, r31
+ adde r9, r11, r10
+ addi ap, ap, -40
+ b L(6)
+
+ ALIGN(16)
+L(b00): ld r11, -24(ap)
+ ld r10, -16(ap)
+ ld r9, -8(ap)
+ ld r0, -32(ap)
+ mulld r8, r11, r26
+ mulhdu r7, r10, r25
+ mulhdu r27, r11, r26
+ mulhdu r11, r9, r24
+ mulld r10, r10, r25
+ mulld r9, r9, r24
+ addc r31, r8, r0
+ addze r0, r27
+ addc r8, r31, r10
+ adde r10, r0, r7
+ addc r0, r9, r8
+ adde r9, r11, r10
+ addi ap, ap, -48
+ b L(6)
+
+ ALIGN(16)
+L(b01): li r9, 0
+ ld r0, -8(ap)
+ addi ap, ap, -24
+ b L(6)
+
+ ALIGN(16)
+L(b10): ld r9, -8(ap)
+ ld r0, -16(ap)
+ addi ap, ap, -32
+
+ ALIGN(16)
+L(6): addi r10, n, 3
+ srdi r7, r10, 2
+ mtctr r7
+ bdz L(end)
+
+ ALIGN(16)
+L(top): ld r31, -16(ap)
+ ld r10, -8(ap)
+ ld r11, 8(ap)
+ ld r12, 0(ap)
+ mulld r29, r0, r30 C rl * B4modb
+ mulhdu r0, r0, r30 C rl * B4modb
+ mulhdu r27, r10, r26
+ mulld r10, r10, r26
+ mulhdu r7, r9, r23 C rh * B5modb
+ mulld r9, r9, r23 C rh * B5modb
+ mulhdu r28, r11, r24
+ mulld r11, r11, r24
+ mulhdu r4, r12, r25
+ mulld r12, r12, r25
+ addc r8, r10, r31
+ addze r10, r27
+ addi ap, ap, -32
+ addc r27, r8, r12
+ adde r12, r10, r4
+ addc r11, r27, r11
+ adde r31, r12, r28
+ addc r12, r11, r29
+ adde r4, r31, r0
+ addc r0, r9, r12
+ adde r9, r7, r4
+ bdnz L(top)
+
+L(end):
+ifdef(`HAVE_LIMB_LITTLE_ENDIAN',
+` lwz r3, 8(cps)',
+` lwz r3, 12(cps)')
+ mulld r10, r9, r26
+ mulhdu r9, r9, r26
+ addc r11, r0, r10
+ addze r9, r9
+ ld r10, 0(cps)
+ subfic r8, r3, 64
+ sld r9, r9, r3
+ srd r8, r11, r8
+ sld r11, r11, r3
+ or r9, r8, r9
+ mulld r0, r9, r10
+ mulhdu r10, r9, r10
+ addi r9, r9, 1
+ addc r8, r0, r11
+ adde r0, r10, r9
+ mulld r0, r0, d
+ subf r0, r0, r11
+ cmpld cr7, r8, r0
+ bge cr7, L(9)
+ add r0, r0, d
+L(9): cmpld cr7, r0, d
+ bge- cr7, L(16)
+L(10): srd r3, r0, r3
+ 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
+
+L(16): subf r0, d, r0
+ b L(10)
+EPILOGUE()
+
+PROLOGUE(mpn_mod_1s_4p_cps,toc)
+ mflr r0
+ std r29, -24(r1)
+ std r30, -16(r1)
+ mr r29, r3
+ std r0, 16(r1)
+ std r31, -8(r1)
+ stdu r1, -144(r1)
+ cntlzd r31, r4
+ sld r30, r4, r31
+ mr r3, r30
+ CALL( mpn_invert_limb)
+ subfic r9, r31, 64
+ li r10, 1
+ sld r10, r10, r31
+ srd r9, r3, r9
+ neg r0, r30
+ or r10, r10, r9
+ mulld r10, r10, r0
+ mulhdu r11, r10, r3
+ nor r11, r11, r11
+ subf r11, r10, r11
+ mulld r11, r11, r30
+ mulld r0, r10, r3
+ cmpld cr7, r0, r11
+ bge cr7, L(18)
+ add r11, r11, r30
+L(18): mulhdu r9, r11, r3
+ add r9, r11, r9
+ nor r9, r9, r9
+ mulld r9, r9, r30
+ mulld r0, r11, r3
+ cmpld cr7, r0, r9
+ bge cr7, L(19)
+ add r9, r9, r30
+L(19): mulhdu r0, r9, r3
+ add r0, r9, r0
+ nor r0, r0, r0
+ mulld r0, r0, r30
+ mulld r8, r9, r3
+ cmpld cr7, r8, r0
+ bge cr7, L(20)
+ add r0, r0, r30
+L(20): mulhdu r8, r0, r3
+ add r8, r0, r8
+ nor r8, r8, r8
+ mulld r8, r8, r30
+ mulld r7, r0, r3
+ cmpld cr7, r7, r8
+ bge cr7, L(21)
+ add r8, r8, r30
+L(21): srd r0, r0, r31
+ addi r1, r1, 144
+ srd r8, r8, r31
+ srd r10, r10, r31
+ srd r11, r11, r31
+ std r0, 40(r29)
+ std r31, 8(r29)
+ srd r9, r9, r31
+ ld r0, 16(r1)
+ ld r30, -16(r1)
+ std r8, 48(r29)
+ std r3, 0(r29)
+ mtlr r0
+ ld r31, -8(r1)
+ std r10, 16(r29)
+ std r11, 24(r29)
+ std r9, 32(r29)
+ ld r29, -24(r1)
+ blr
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/mode64/mod_34lsub1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/mode64/mod_34lsub1.asm
new file mode 100644
index 00000000000..c35e0e37a4a
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/mode64/mod_34lsub1.asm
@@ -0,0 +1,132 @@
+dnl PowerPC-64 mpn_mod_34lsub1 -- modulo 2^48-1.
+
+dnl Copyright 2005 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 1.33
+C POWER4/PPC970 1.5
+C POWER5 1.32
+C POWER6 2.35
+C POWER7 1
+
+C INPUT PARAMETERS
+define(`up',`r3')
+define(`n',`r4')
+
+ASM_START()
+PROLOGUE(mpn_mod_34lsub1)
+ li r8, 0
+ li r9, 0
+ li r10, 0
+ li r11, 0
+
+ cmpdi cr6, n, 3
+ blt cr6, L(lt3)
+
+ li r0, -0x5556 C 0xFFFFFFFFFFFFAAAA
+ rldimi r0, r0, 16, 32 C 0xFFFFFFFFAAAAAAAA
+ rldimi r0, r0, 32, 63 C 0xAAAAAAAAAAAAAAAB
+ mulhdu r0, r0, n
+ srdi r0, r0, 1 C r0 = [n / 3]
+ mtctr r0
+
+ ld r5, 0(up)
+ ld r6, 8(up)
+ ld r7, 16(up)
+ addi up, up, 24
+ bdz L(end)
+
+ ALIGN(16)
+L(top): addc r8, r8, r5
+ nop
+ ld r5, 0(up)
+ adde r9, r9, r6
+ ld r6, 8(up)
+ adde r10, r10, r7
+ ld r7, 16(up)
+ addi up, up, 48
+ addze r11, r11
+ bdz L(endx)
+ addc r8, r8, r5
+ nop
+ ld r5, -24(up)
+ adde r9, r9, r6
+ ld r6, -16(up)
+ adde r10, r10, r7
+ ld r7, -8(up)
+ addze r11, r11
+ bdnz L(top)
+
+ addi up, up, 24
+L(endx):
+ addi up, up, -24
+
+L(end): addc r8, r8, r5
+ adde r9, r9, r6
+ adde r10, r10, r7
+ addze r11, r11
+
+ sldi r5, r0, 1
+ add r5, r5, r0 C r11 = n / 3 * 3
+ sub n, n, r5 C n = n mod 3
+L(lt3): cmpdi cr6, n, 1
+ blt cr6, L(2)
+
+ ld r5, 0(up)
+ addc r8, r8, r5
+ li r6, 0
+ beq cr6, L(1)
+
+ ld r6, 8(up)
+L(1): adde r9, r9, r6
+ addze r10, r10
+ addze r11, r11
+
+L(2): rldicl r0, r8, 0, 16 C r0 = r8 mod 2^48
+ srdi r3, r8, 48 C r3 = r8 div 2^48
+ rldic r4, r9, 16, 16 C r4 = (r9 mod 2^32) << 16
+ srdi r5, r9, 32 C r5 = r9 div 2^32
+ rldic r6, r10, 32, 16 C r6 = (r10 mod 2^16) << 32
+ srdi r7, r10, 16 C r7 = r10 div 2^16
+
+ add r0, r0, r3
+ add r4, r4, r5
+ add r6, r6, r7
+
+ add r0, r0, r4
+ add r6, r6, r11
+
+ add r3, r0, r6
+ blr
+EPILOGUE()
+
+C |__r10__|__r9___|__r8___|
+C |-----|-----|-----|-----|
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/mode64/mode1o.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/mode64/mode1o.asm
new file mode 100644
index 00000000000..726339a9310
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/mode64/mode1o.asm
@@ -0,0 +1,117 @@
+dnl PowerPC-64 mpn_modexact_1_odd -- mpn by limb exact remainder.
+
+dnl Copyright 2006 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 13-19
+C POWER4/PPC970 16
+C POWER5 16
+C POWER6 ?
+C POWER7 12
+
+C TODO
+C * Check if n=1 code is really an improvement. It probably isn't.
+C * Make more similar to dive_1.asm.
+
+C INPUT PARAMETERS
+define(`up', `r3')
+define(`n', `r4')
+define(`d', `r5')
+define(`cy', `r6')
+
+
+ASM_START()
+
+EXTERN(binvert_limb_table)
+
+PROLOGUE(mpn_modexact_1c_odd,toc)
+ addic. n, n, -1 C set carry as side effect
+ ld r8, 0(up)
+ bne cr0, L(2)
+ cmpld cr7, r6, r8
+ bge cr7, L(4)
+ subf r8, r6, r8
+ divdu r3, r8, d
+ mulld r3, r3, d
+ subf. r3, r3, r8
+ beqlr cr0
+ subf r3, r3, d
+ blr
+
+L(4): subf r3, r8, r6
+ divdu r8, r3, d
+ mulld r8, r8, d
+ subf r3, r8, r3
+ blr
+
+L(2): LEA( r7, binvert_limb_table)
+ rldicl r9, d, 63, 57
+ mtctr n
+ lbzx r0, r7, r9
+ mulld r7, r0, r0
+ sldi r0, r0, 1
+ mulld r7, d, r7
+ subf r0, r7, r0
+ mulld r9, r0, r0
+ sldi r0, r0, 1
+ mulld r9, d, r9
+ subf r0, r9, r0
+ mulld r7, r0, r0
+ sldi r0, r0, 1
+ mulld r7, d, r7
+ subf r9, r7, r0
+
+ ALIGN(16)
+L(loop):
+ subfe r0, r6, r8
+ ld r8, 8(up)
+ addi up, up, 8
+ mulld r0, r9, r0
+ mulhdu r6, r0, d
+ bdnz L(loop)
+
+ cmpld cr7, d, r8
+ blt cr7, L(10)
+
+ subfe r0, r0, r0
+ subf r6, r0, r6
+ cmpld cr7, r6, r8
+ subf r3, r8, r6
+ bgelr cr7
+ add r3, d, r3
+ blr
+
+L(10): subfe r0, r6, r8
+ mulld r0, r9, r0
+ mulhdu r3, r0, d
+ blr
+EPILOGUE()
+ASM_END()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/mode64/mul_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/mode64/mul_1.asm
new file mode 100644
index 00000000000..27a8f8fb4d1
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/mode64/mul_1.asm
@@ -0,0 +1,168 @@
+dnl PowerPC-64 mpn_mul_1 -- Multiply a limb vector with a limb and store
+dnl the result in a second limb vector.
+
+dnl Copyright 1999-2001, 2003-2006, 2010 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 6-18
+C POWER4/PPC970 7.25? not updated for last file revision
+C POWER5 7.25
+C POWER6 14
+C POWER7 2.9
+
+C TODO
+C * Try to reduce the number of needed live registers (at least r5 and r10
+C could be combined)
+C * Optimize feed-in code, for speed and size.
+C * Clean up r12/r7 usage in feed-in code.
+
+C INPUT PARAMETERS
+define(`rp', `r3')
+define(`up', `r4')
+define(`n', `r5')
+define(`vl', `r6')
+
+ASM_START()
+PROLOGUE(mpn_mul_1c)
+ std r27, -40(r1)
+ std r26, -48(r1)
+ mr r12, r7
+ b L(ent)
+EPILOGUE()
+PROLOGUE(mpn_mul_1)
+ std r27, -40(r1)
+ std r26, -48(r1)
+ li r12, 0 C cy_limb = 0
+L(ent): ld r26, 0(up)
+
+ rldicl. r0, n, 0,62 C r0 = n & 3, set cr0
+ cmpdi cr6, r0, 2
+ addic n, n, 3 C compute count...
+ srdi n, n, 2 C ...for ctr
+ mtctr n C copy count into ctr
+ beq cr0, L(b00)
+ blt cr6, L(b01)
+ beq cr6, L(b10)
+
+L(b11): mr r7, r12
+ mulld r0, r26, r6
+ mulhdu r12, r26, r6
+ addi up, up, 8
+ addc r0, r0, r7
+ std r0, 0(rp)
+ addi rp, rp, 8
+ b L(fic)
+
+L(b00): ld r27, 8(up)
+ addi up, up, 16
+ mulld r0, r26, r6
+ mulhdu r5, r26, r6
+ mulld r7, r27, r6
+ mulhdu r8, r27, r6
+ addc r0, r0, r12
+ adde r7, r7, r5
+ addze r12, r8
+ std r0, 0(rp)
+ std r7, 8(rp)
+ addi rp, rp, 16
+ b L(fic)
+
+ nop C alignment
+L(b01): bdnz L(gt1)
+ mulld r0, r26, r6
+ mulhdu r8, r26, r6
+ addc r0, r0, r12
+ std r0, 0(rp)
+ b L(ret)
+L(gt1): ld r27, 8(up)
+ nop
+ mulld r0, r26, r6
+ mulhdu r5, r26, r6
+ ld r26, 16(up)
+ mulld r7, r27, r6
+ mulhdu r8, r27, r6
+ mulld r9, r26, r6
+ mulhdu r10, r26, r6
+ addc r0, r0, r12
+ adde r7, r7, r5
+ adde r9, r9, r8
+ addze r12, r10
+ std r0, 0(rp)
+ std r7, 8(rp)
+ std r9, 16(rp)
+ addi up, up, 24
+ addi rp, rp, 24
+ b L(fic)
+
+ nop
+L(fic): ld r26, 0(up)
+L(b10): ld r27, 8(up)
+ addi up, up, 16
+ bdz L(end)
+
+L(top): mulld r0, r26, r6
+ mulhdu r5, r26, r6
+ mulld r7, r27, r6
+ mulhdu r8, r27, r6
+ ld r26, 0(up)
+ ld r27, 8(up)
+ adde r0, r0, r12
+ adde r7, r7, r5
+ mulld r9, r26, r6
+ mulhdu r10, r26, r6
+ mulld r11, r27, r6
+ mulhdu r12, r27, r6
+ ld r26, 16(up)
+ ld r27, 24(up)
+ std r0, 0(rp)
+ adde r9, r9, r8
+ std r7, 8(rp)
+ adde r11, r11, r10
+ std r9, 16(rp)
+ addi up, up, 32
+ std r11, 24(rp)
+
+ addi rp, rp, 32
+ bdnz L(top)
+
+L(end): mulld r0, r26, r6
+ mulhdu r5, r26, r6
+ mulld r7, r27, r6
+ mulhdu r8, r27, r6
+ adde r0, r0, r12
+ adde r7, r7, r5
+ std r0, 0(rp)
+ std r7, 8(rp)
+L(ret): addze r3, r8
+ ld r27, -40(r1)
+ ld r26, -48(r1)
+ blr
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/mode64/mul_basecase.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/mode64/mul_basecase.asm
new file mode 100644
index 00000000000..18731879e4b
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/mode64/mul_basecase.asm
@@ -0,0 +1,708 @@
+dnl PowerPC-64 mpn_mul_basecase.
+
+dnl Copyright 1999-2001, 2003-2006, 2008 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 6-18
+C POWER4/PPC970 8
+C POWER5 8
+C POWER6 24
+
+C INPUT PARAMETERS
+define(`rp', `r3')
+define(`up', `r4')
+define(`un', `r5')
+define(`vp', `r6')
+define(`vn', `r7')
+
+define(`v0', `r25')
+define(`outer_rp', `r22')
+define(`outer_up', `r23')
+
+ASM_START()
+PROLOGUE(mpn_mul_basecase)
+
+C Special code for un <= 2, for efficiency of these important cases,
+C and since it simplifies the default code.
+ 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)
+ nop
+ 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 r31, -8(r1)
+ std r30, -16(r1)
+ std r29, -24(r1)
+ std r28, -32(r1)
+ std r27, -40(r1)
+ std r26, -48(r1)
+ std r25, -56(r1)
+ std r24, -64(r1)
+ std r23, -72(r1)
+ std r22, -80(r1)
+
+ mr outer_rp, rp
+ mr outer_up, up
+
+ ld v0, 0(vp) C new v limb
+ addi vp, vp, 8
+ ld r26, 0(up)
+
+ rldicl. r0, un, 0,62 C r0 = n & 3, set cr0
+ cmpdi cr6, r0, 2
+ addi un, un, 1 C compute count...
+ srdi un, un, 2 C ...for ctr
+ mtctr un C copy inner loop count into ctr
+ beq cr0, L(b0)
+ blt cr6, L(b1)
+ beq cr6, L(b2)
+
+
+ ALIGN(16)
+L(b3): mulld r0, r26, v0
+ mulhdu r12, r26, v0
+ addic r0, r0, 0
+ std r0, 0(rp)
+ ld r26, 8(up)
+ ld r27, 16(up)
+ bdz L(end_m_3)
+
+ ALIGN(16)
+L(lo_m_3):
+ mulld r0, r26, v0
+ mulhdu r31, r26, v0
+ ld r26, 24(up)
+ nop
+ mulld r24, r27, v0
+ mulhdu r8, r27, v0
+ ld r27, 32(up)
+ nop
+ adde r0, r0, r12
+ adde r24, r24, r31
+ mulld r9, r26, v0
+ mulhdu r10, r26, v0
+ ld r26, 40(up)
+ nop
+ mulld r11, r27, v0
+ mulhdu r12, r27, v0
+ ld r27, 48(up)
+ std r0, 8(rp)
+ adde r9, r9, r8
+ std r24, 16(rp)
+ adde r11, r11, r10
+ std r9, 24(rp)
+ addi up, up, 32
+ std r11, 32(rp)
+ addi rp, rp, 32
+ bdnz L(lo_m_3)
+
+ ALIGN(16)
+L(end_m_3):
+ mulld r0, r26, v0
+ mulhdu r31, r26, v0
+
+ mulld r24, r27, v0
+ mulhdu r8, r27, v0
+
+ adde r0, r0, r12
+ adde r24, r24, r31
+
+ std r0, 8(rp)
+ std r24, 16(rp)
+ addze r8, r8
+ std r8, 24(rp)
+ addic. vn, vn, -1
+ beq L(ret)
+
+ ALIGN(16)
+L(outer_lo_3):
+ mtctr un C copy inner loop count into ctr
+ addi rp, outer_rp, 8
+ mr up, outer_up
+ addi outer_rp, outer_rp, 8
+ ld v0, 0(vp) C new v limb
+ addi vp, vp, 8
+ ld r26, 0(up)
+ ld r28, 0(rp)
+ mulld r0, r26, v0
+ mulhdu r12, r26, v0
+ addc r0, r0, r28
+ std r0, 0(rp)
+ ld r26, 8(up)
+ ld r27, 16(up)
+ bdz L(end_3)
+
+ ALIGN(16) C registers dying
+L(lo_3):
+ mulld r0, r26, v0 C
+ mulhdu r10, r26, v0 C 26
+ ld r26, 24(up) C
+ ld r28, 8(rp) C
+ mulld r24, r27, v0 C
+ mulhdu r8, r27, v0 C 27
+ ld r27, 32(up) C
+ ld r29, 16(rp) C
+ adde r0, r0, r12 C 0 12
+ adde r24, r24, r10 C 24 10
+ mulld r9, r26, v0 C
+ mulhdu r10, r26, v0 C 26
+ ld r26, 40(up) C
+ ld r30, 24(rp) C
+ mulld r11, r27, v0 C
+ mulhdu r12, r27, v0 C 27
+ ld r27, 48(up) C
+ ld r31, 32(rp) C
+ adde r9, r9, r8 C 8 9
+ adde r11, r11, r10 C 10 11
+ addze r12, r12 C 12
+ addc r0, r0, r28 C 0 28
+ std r0, 8(rp) C 0
+ adde r24, r24, r29 C 7 29
+ std r24, 16(rp) C 7
+ adde r9, r9, r30 C 9 30
+ std r9, 24(rp) C 9
+ adde r11, r11, r31 C 11 31
+ std r11, 32(rp) C 11
+ addi up, up, 32 C
+ addi rp, rp, 32 C
+ bdnz L(lo_3) C
+
+ ALIGN(16)
+L(end_3):
+ mulld r0, r26, v0
+ mulhdu r10, r26, v0
+ ld r28, 8(rp)
+ nop
+ mulld r24, r27, v0
+ mulhdu r8, r27, v0
+ ld r29, 16(rp)
+ nop
+ adde r0, r0, r12
+ adde r24, r24, r10
+ addze r8, r8
+ addc r0, r0, r28
+ std r0, 8(rp)
+ adde r24, r24, r29
+ std r24, 16(rp)
+ addze r8, r8
+ std r8, 24(rp)
+
+ addic. vn, vn, -1
+ bne L(outer_lo_3)
+ b L(ret)
+
+
+ ALIGN(16)
+L(b0): ld r27, 8(up)
+ addi up, up, 8
+ mulld r0, r26, v0
+ mulhdu r10, r26, v0
+ mulld r24, r27, v0
+ mulhdu r8, r27, v0
+ addc r24, r24, r10
+ addze r12, r8
+ std r0, 0(rp)
+ std r24, 8(rp)
+ addi rp, rp, 8
+ ld r26, 8(up)
+ ld r27, 16(up)
+ bdz L(end_m_0)
+
+ ALIGN(16)
+L(lo_m_0):
+ mulld r0, r26, v0
+ mulhdu r31, r26, v0
+ ld r26, 24(up)
+ nop
+ mulld r24, r27, v0
+ mulhdu r8, r27, v0
+ ld r27, 32(up)
+ nop
+ adde r0, r0, r12
+ adde r24, r24, r31
+ mulld r9, r26, v0
+ mulhdu r10, r26, v0
+ ld r26, 40(up)
+ nop
+ mulld r11, r27, v0
+ mulhdu r12, r27, v0
+ ld r27, 48(up)
+ std r0, 8(rp)
+ adde r9, r9, r8
+ std r24, 16(rp)
+ adde r11, r11, r10
+ std r9, 24(rp)
+ addi up, up, 32
+ std r11, 32(rp)
+ addi rp, rp, 32
+ bdnz L(lo_m_0)
+
+ ALIGN(16)
+L(end_m_0):
+ mulld r0, r26, v0
+ mulhdu r31, r26, v0
+
+ mulld r24, r27, v0
+ mulhdu r8, r27, v0
+
+ adde r0, r0, r12
+ adde r24, r24, r31
+
+ std r0, 8(rp)
+ addze r8, r8
+ std r24, 16(rp)
+ addic. vn, vn, -1
+ std r8, 24(rp)
+ nop
+ beq L(ret)
+
+ ALIGN(16)
+L(outer_lo_0):
+ mtctr un C copy inner loop count into ctr
+ addi rp, outer_rp, 16
+ addi up, outer_up, 8
+ addi outer_rp, outer_rp, 8
+ ld v0, 0(vp) C new v limb
+ addi vp, vp, 8
+ ld r26, -8(up)
+ ld r27, 0(up)
+ ld r28, -8(rp)
+ ld r29, 0(rp)
+ nop
+ nop
+ mulld r0, r26, v0
+ mulhdu r10, r26, v0
+ mulld r24, r27, v0
+ mulhdu r8, r27, v0
+ addc r24, r24, r10
+ addze r12, r8
+ addc r0, r0, r28
+ std r0, -8(rp)
+ adde r24, r24, r29
+ std r24, 0(rp)
+ ld r26, 8(up)
+ ld r27, 16(up)
+ bdz L(end_0)
+
+ ALIGN(16) C registers dying
+L(lo_0):
+ mulld r0, r26, v0 C
+ mulhdu r10, r26, v0 C 26
+ ld r26, 24(up) C
+ ld r28, 8(rp) C
+ mulld r24, r27, v0 C
+ mulhdu r8, r27, v0 C 27
+ ld r27, 32(up) C
+ ld r29, 16(rp) C
+ adde r0, r0, r12 C 0 12
+ adde r24, r24, r10 C 24 10
+ mulld r9, r26, v0 C
+ mulhdu r10, r26, v0 C 26
+ ld r26, 40(up) C
+ ld r30, 24(rp) C
+ mulld r11, r27, v0 C
+ mulhdu r12, r27, v0 C 27
+ ld r27, 48(up) C
+ ld r31, 32(rp) C
+ adde r9, r9, r8 C 8 9
+ adde r11, r11, r10 C 10 11
+ addze r12, r12 C 12
+ addc r0, r0, r28 C 0 28
+ std r0, 8(rp) C 0
+ adde r24, r24, r29 C 7 29
+ std r24, 16(rp) C 7
+ adde r9, r9, r30 C 9 30
+ std r9, 24(rp) C 9
+ adde r11, r11, r31 C 11 31
+ std r11, 32(rp) C 11
+ addi up, up, 32 C
+ addi rp, rp, 32 C
+ bdnz L(lo_0) C
+
+ ALIGN(16)
+L(end_0):
+ mulld r0, r26, v0
+ mulhdu r10, r26, v0
+ ld r28, 8(rp)
+ nop
+ mulld r24, r27, v0
+ mulhdu r8, r27, v0
+ ld r29, 16(rp)
+ nop
+ adde r0, r0, r12
+ adde r24, r24, r10
+ addze r8, r8
+ addic. vn, vn, -1
+ addc r0, r0, r28
+ std r0, 8(rp)
+ adde r24, r24, r29
+ std r24, 16(rp)
+ addze r8, r8
+ std r8, 24(rp)
+ bne L(outer_lo_0)
+ b L(ret)
+
+
+ ALIGN(16)
+L(b1): ld r27, 8(up)
+ nop
+ mulld r0, r26, v0
+ mulhdu r31, r26, v0
+ ld r26, 16(up)
+ mulld r24, r27, v0
+ mulhdu r8, r27, v0
+ mulld r9, r26, v0
+ mulhdu r10, r26, v0
+ addc r24, r24, r31
+ adde r9, r9, r8
+ addze r12, r10
+ std r0, 0(rp)
+ std r24, 8(rp)
+ std r9, 16(rp)
+ addi up, up, 16
+ addi rp, rp, 16
+ ld r26, 8(up)
+ ld r27, 16(up)
+ bdz L(end_m_1)
+
+ ALIGN(16)
+L(lo_m_1):
+ mulld r0, r26, v0
+ mulhdu r31, r26, v0
+ ld r26, 24(up)
+ nop
+ mulld r24, r27, v0
+ mulhdu r8, r27, v0
+ ld r27, 32(up)
+ nop
+ adde r0, r0, r12
+ adde r24, r24, r31
+ mulld r9, r26, v0
+ mulhdu r10, r26, v0
+ ld r26, 40(up)
+ nop
+ mulld r11, r27, v0
+ mulhdu r12, r27, v0
+ ld r27, 48(up)
+ std r0, 8(rp)
+ adde r9, r9, r8
+ std r24, 16(rp)
+ adde r11, r11, r10
+ std r9, 24(rp)
+ addi up, up, 32
+ std r11, 32(rp)
+ addi rp, rp, 32
+ bdnz L(lo_m_1)
+
+ ALIGN(16)
+L(end_m_1):
+ mulld r0, r26, v0
+ mulhdu r31, r26, v0
+
+ mulld r24, r27, v0
+ mulhdu r8, r27, v0
+
+ adde r0, r0, r12
+ adde r24, r24, r31
+
+ std r0, 8(rp)
+ addze r8, r8
+ std r24, 16(rp)
+ addic. vn, vn, -1
+ std r8, 24(rp)
+ nop
+ beq L(ret)
+
+ ALIGN(16)
+L(outer_lo_1):
+ mtctr un C copy inner loop count into ctr
+ addi rp, outer_rp, 24
+ addi up, outer_up, 16
+ addi outer_rp, outer_rp, 8
+ ld v0, 0(vp) C new v limb
+ addi vp, vp, 8
+ ld r26, -16(up)
+ ld r27, -8(up)
+ mulld r0, r26, v0
+ mulhdu r31, r26, v0
+ ld r26, 0(up)
+ ld r28, -16(rp)
+ mulld r24, r27, v0
+ mulhdu r8, r27, v0
+ ld r29, -8(rp)
+ ld r30, 0(rp)
+ mulld r9, r26, v0
+ mulhdu r10, r26, v0
+ addc r24, r24, r31
+ adde r9, r9, r8
+ addze r12, r10
+ addc r0, r0, r28
+ std r0, -16(rp)
+ adde r24, r24, r29
+ std r24, -8(rp)
+ adde r9, r9, r30
+ std r9, 0(rp)
+ ld r26, 8(up)
+ ld r27, 16(up)
+ bdz L(end_1)
+
+ ALIGN(16) C registers dying
+L(lo_1):
+ mulld r0, r26, v0 C
+ mulhdu r10, r26, v0 C 26
+ ld r26, 24(up) C
+ ld r28, 8(rp) C
+ mulld r24, r27, v0 C
+ mulhdu r8, r27, v0 C 27
+ ld r27, 32(up) C
+ ld r29, 16(rp) C
+ adde r0, r0, r12 C 0 12
+ adde r24, r24, r10 C 24 10
+ mulld r9, r26, v0 C
+ mulhdu r10, r26, v0 C 26
+ ld r26, 40(up) C
+ ld r30, 24(rp) C
+ mulld r11, r27, v0 C
+ mulhdu r12, r27, v0 C 27
+ ld r27, 48(up) C
+ ld r31, 32(rp) C
+ adde r9, r9, r8 C 8 9
+ adde r11, r11, r10 C 10 11
+ addze r12, r12 C 12
+ addc r0, r0, r28 C 0 28
+ std r0, 8(rp) C 0
+ adde r24, r24, r29 C 7 29
+ std r24, 16(rp) C 7
+ adde r9, r9, r30 C 9 30
+ std r9, 24(rp) C 9
+ adde r11, r11, r31 C 11 31
+ std r11, 32(rp) C 11
+ addi up, up, 32 C
+ addi rp, rp, 32 C
+ bdnz L(lo_1) C
+
+ ALIGN(16)
+L(end_1):
+ mulld r0, r26, v0
+ mulhdu r10, r26, v0
+ ld r28, 8(rp)
+ nop
+ mulld r24, r27, v0
+ mulhdu r8, r27, v0
+ ld r29, 16(rp)
+ nop
+ adde r0, r0, r12
+ adde r24, r24, r10
+ addze r8, r8
+ addic. vn, vn, -1
+ addc r0, r0, r28
+ std r0, 8(rp)
+ adde r24, r24, r29
+ std r24, 16(rp)
+ addze r8, r8
+ std r8, 24(rp)
+ bne L(outer_lo_1)
+ b L(ret)
+
+
+ ALIGN(16)
+L(b2): ld r27, 8(up)
+ addi up, up, -8
+ addi rp, rp, -8
+ li r12, 0
+ addic r12, r12, 0
+
+ ALIGN(16)
+L(lo_m_2):
+ mulld r0, r26, v0
+ mulhdu r31, r26, v0
+ ld r26, 24(up)
+ nop
+ mulld r24, r27, v0
+ mulhdu r8, r27, v0
+ ld r27, 32(up)
+ nop
+ adde r0, r0, r12
+ adde r24, r24, r31
+ mulld r9, r26, v0
+ mulhdu r10, r26, v0
+ ld r26, 40(up)
+ nop
+ mulld r11, r27, v0
+ mulhdu r12, r27, v0
+ ld r27, 48(up)
+ std r0, 8(rp)
+ adde r9, r9, r8
+ std r24, 16(rp)
+ adde r11, r11, r10
+ std r9, 24(rp)
+ addi up, up, 32
+ std r11, 32(rp)
+
+ addi rp, rp, 32
+ bdnz L(lo_m_2)
+
+ ALIGN(16)
+L(end_m_2):
+ mulld r0, r26, v0
+ mulhdu r31, r26, v0
+
+ mulld r24, r27, v0
+ mulhdu r8, r27, v0
+
+ adde r0, r0, r12
+ adde r24, r24, r31
+
+ std r0, 8(rp)
+ addze r8, r8
+ std r24, 16(rp)
+ addic. vn, vn, -1
+ std r8, 24(rp)
+ nop
+ beq L(ret)
+
+ ALIGN(16)
+L(outer_lo_2):
+ mtctr un C copy inner loop count into ctr
+ addi rp, outer_rp, 0
+ addi up, outer_up, -8
+ addi outer_rp, outer_rp, 8
+ ld v0, 0(vp) C new v limb
+ addi vp, vp, 8
+ ld r26, 8(up)
+ ld r27, 16(up)
+ li r12, 0
+ addic r12, r12, 0
+
+ ALIGN(16) C registers dying
+L(lo_2):
+ mulld r0, r26, v0 C
+ mulhdu r10, r26, v0 C 26
+ ld r26, 24(up) C
+ ld r28, 8(rp) C
+ mulld r24, r27, v0 C
+ mulhdu r8, r27, v0 C 27
+ ld r27, 32(up) C
+ ld r29, 16(rp) C
+ adde r0, r0, r12 C 0 12
+ adde r24, r24, r10 C 24 10
+ mulld r9, r26, v0 C
+ mulhdu r10, r26, v0 C 26
+ ld r26, 40(up) C
+ ld r30, 24(rp) C
+ mulld r11, r27, v0 C
+ mulhdu r12, r27, v0 C 27
+ ld r27, 48(up) C
+ ld r31, 32(rp) C
+ adde r9, r9, r8 C 8 9
+ adde r11, r11, r10 C 10 11
+ addze r12, r12 C 12
+ addc r0, r0, r28 C 0 28
+ std r0, 8(rp) C 0
+ adde r24, r24, r29 C 7 29
+ std r24, 16(rp) C 7
+ adde r9, r9, r30 C 9 30
+ std r9, 24(rp) C 9
+ adde r11, r11, r31 C 11 31
+ std r11, 32(rp) C 11
+ addi up, up, 32 C
+ addi rp, rp, 32 C
+ bdnz L(lo_2) C
+
+ ALIGN(16)
+L(end_2):
+ mulld r0, r26, v0
+ mulhdu r10, r26, v0
+ ld r28, 8(rp)
+ nop
+ mulld r24, r27, v0
+ mulhdu r8, r27, v0
+ ld r29, 16(rp)
+ nop
+ adde r0, r0, r12
+ adde r24, r24, r10
+ addze r8, r8
+ addic. vn, vn, -1
+ addc r0, r0, r28
+ std r0, 8(rp)
+ adde r24, r24, r29
+ std r24, 16(rp)
+ addze r8, r8
+ std r8, 24(rp)
+ bne L(outer_lo_2)
+ b L(ret)
+
+
+L(ret): ld r31, -8(r1)
+ ld r30, -16(r1)
+ ld r29, -24(r1)
+ ld r28, -32(r1)
+ ld r27, -40(r1)
+ ld r26, -48(r1)
+ ld r25, -56(r1)
+ ld r24, -64(r1)
+ ld r23, -72(r1)
+ ld r22, -80(r1)
+ blr
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/mode64/p3/gmp-mparam.h b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/mode64/p3/gmp-mparam.h
new file mode 100644
index 00000000000..61a437b6e6c
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/mode64/p3/gmp-mparam.h
@@ -0,0 +1,179 @@
+/* POWER3/PowerPC630 gmp-mparam.h -- Compiler/machine parameter header file.
+
+Copyright 2008-2010 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
+
+
+#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 3
+#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 17
+#define USE_PREINV_DIVREM_1 0
+#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 MP_SIZE_T_MAX /* never */
+
+#define MUL_TOOM22_THRESHOLD 10
+#define MUL_TOOM33_THRESHOLD 33
+#define MUL_TOOM44_THRESHOLD 46
+#define MUL_TOOM6H_THRESHOLD 77
+#define MUL_TOOM8H_THRESHOLD 139
+
+#define MUL_TOOM32_TO_TOOM43_THRESHOLD 49
+#define MUL_TOOM32_TO_TOOM53_THRESHOLD 47
+#define MUL_TOOM42_TO_TOOM53_THRESHOLD 49
+#define MUL_TOOM42_TO_TOOM63_THRESHOLD 49
+#define MUL_TOOM43_TO_TOOM54_THRESHOLD 34
+
+#define SQR_BASECASE_THRESHOLD 0 /* always (native) */
+#define SQR_TOOM2_THRESHOLD 14
+#define SQR_TOOM3_THRESHOLD 45
+#define SQR_TOOM4_THRESHOLD 64
+#define SQR_TOOM6_THRESHOLD 85
+#define SQR_TOOM8_THRESHOLD 139
+
+#define MULMID_TOOM42_THRESHOLD 22
+
+#define MULMOD_BNM1_THRESHOLD 8
+#define SQRMOD_BNM1_THRESHOLD 10
+
+#define MUL_FFT_MODF_THRESHOLD 220 /* k = 5 */
+#define MUL_FFT_TABLE3 \
+ { { 220, 5}, { 9, 6}, { 5, 5}, { 11, 6}, \
+ { 13, 7}, { 7, 6}, { 15, 7}, { 13, 8}, \
+ { 7, 7}, { 15, 8}, { 13, 9}, { 7, 8}, \
+ { 19, 9}, { 11, 8}, { 23,10}, { 7, 9}, \
+ { 15, 8}, { 33, 9}, { 23,10}, { 15, 9}, \
+ { 35, 8}, { 71,10}, { 23, 9}, { 47,11}, \
+ { 15,10}, { 31, 9}, { 71,10}, { 39, 9}, \
+ { 79,10}, { 55,11}, { 31,10}, { 63, 9}, \
+ { 127,10}, { 71, 9}, { 143, 8}, { 287,10}, \
+ { 79,11}, { 47,10}, { 95, 9}, { 191,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,11}, { 95,10}, { 191, 9}, { 383,11}, \
+ { 111,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,12}, { 95,11}, { 191,10}, \
+ { 383, 9}, { 767,11}, { 223,13}, { 63,12}, \
+ { 127,11}, { 255,10}, { 511,11}, { 287,10}, \
+ { 575, 9}, { 1151,12}, { 159,11}, { 319,10}, \
+ { 639,11}, { 351,12}, { 191,11}, { 383,10}, \
+ { 767,12}, { 223,11}, { 447,10}, { 895,13}, \
+ { 127,12}, { 255,11}, { 511,12}, { 287,11}, \
+ { 575,10}, { 1151,12}, { 319,11}, { 639,12}, \
+ { 351,11}, { 703,13}, { 191,12}, { 383,11}, \
+ { 767,12}, { 415,11}, { 831,10}, { 1663,12}, \
+ { 447,11}, { 895,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 120
+#define MUL_FFT_THRESHOLD 2688
+
+#define SQR_FFT_MODF_THRESHOLD 188 /* k = 5 */
+#define SQR_FFT_TABLE3 \
+ { { 188, 5}, { 9, 6}, { 5, 5}, { 11, 6}, \
+ { 13, 7}, { 13, 8}, { 7, 7}, { 16, 8}, \
+ { 9, 7}, { 19, 8}, { 13, 9}, { 7, 8}, \
+ { 19, 9}, { 11, 8}, { 23,10}, { 7, 9}, \
+ { 15, 8}, { 31, 9}, { 19, 8}, { 39, 9}, \
+ { 23,10}, { 15, 9}, { 39,10}, { 23,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,11}, { 47,10}, { 95, 9}, \
+ { 191,12}, { 31,11}, { 63,10}, { 127, 9}, \
+ { 255, 8}, { 511,10}, { 143, 9}, { 287,11}, \
+ { 79,10}, { 159, 9}, { 319, 8}, { 639,10}, \
+ { 175,11}, { 95,10}, { 191, 9}, { 383,11}, \
+ { 111,10}, { 223,12}, { 63,11}, { 127,10}, \
+ { 255, 9}, { 511,11}, { 143,10}, { 287, 9}, \
+ { 575,11}, { 159,10}, { 319, 9}, { 639,11}, \
+ { 175,12}, { 95,11}, { 191,10}, { 383, 9}, \
+ { 767,11}, { 223,13}, { 63,12}, { 127,11}, \
+ { 255,10}, { 511,11}, { 287,10}, { 575,12}, \
+ { 159,11}, { 319,10}, { 639,11}, { 351,12}, \
+ { 191,11}, { 383,10}, { 767,12}, { 223,11}, \
+ { 447,10}, { 895,13}, { 127,12}, { 255,11}, \
+ { 511,12}, { 287,11}, { 575,10}, { 1151,12}, \
+ { 319,11}, { 639,12}, { 351,13}, { 191,12}, \
+ { 383,11}, { 767,12}, { 447,11}, { 895,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 118
+#define SQR_FFT_THRESHOLD 1728
+
+#define MULLO_BASECASE_THRESHOLD 2
+#define MULLO_DC_THRESHOLD 27
+#define MULLO_MUL_N_THRESHOLD 2511
+
+#define DC_DIV_QR_THRESHOLD 23
+#define DC_DIVAPPR_Q_THRESHOLD 87
+#define DC_BDIV_QR_THRESHOLD 27
+#define DC_BDIV_Q_THRESHOLD 60
+
+#define INV_MULMOD_BNM1_THRESHOLD 27
+#define INV_NEWTON_THRESHOLD 91
+#define INV_APPR_THRESHOLD 91
+
+#define BINV_NEWTON_THRESHOLD 115
+#define REDC_1_TO_REDC_N_THRESHOLD 31
+
+#define MU_DIV_QR_THRESHOLD 551
+#define MU_DIVAPPR_Q_THRESHOLD 551
+#define MUPI_DIV_QR_THRESHOLD 42
+#define MU_BDIV_QR_THRESHOLD 483
+#define MU_BDIV_Q_THRESHOLD 492
+
+#define POWM_SEC_TABLE 2,23,140,556,713,746
+
+#define MATRIX22_STRASSEN_THRESHOLD 8
+#define HGCD_THRESHOLD 56
+#define HGCD_APPR_THRESHOLD 51
+#define HGCD_REDUCE_THRESHOLD 688
+#define GCD_DC_THRESHOLD 333
+#define GCDEXT_DC_THRESHOLD 126
+#define JACOBI_BASE_METHOD 1
+
+#define GET_STR_DC_THRESHOLD 17
+#define GET_STR_PRECOMPUTE_THRESHOLD 28
+#define SET_STR_DC_THRESHOLD 375
+#define SET_STR_PRECOMPUTE_THRESHOLD 812
+
+#define FAC_DSC_THRESHOLD 351
+#define FAC_ODD_THRESHOLD 0 /* always */
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/mode64/p4/gmp-mparam.h b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/mode64/p4/gmp-mparam.h
new file mode 100644
index 00000000000..d909b292bb3
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/mode64/p4/gmp-mparam.h
@@ -0,0 +1,208 @@
+/* POWER4/PowerPC970 gmp-mparam.h -- Compiler/machine parameter header file.
+
+Copyright 2008-2010, 2014 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 PPC970 */
+/* FFT tuning limit = 10000000 */
+/* Generated by tuneup.c, 2014-03-12, gcc 4.0 */
+
+#define MOD_1_NORM_THRESHOLD 0 /* always */
+#define MOD_1_UNNORM_THRESHOLD 0 /* always */
+#define MOD_1N_TO_MOD_1_1_THRESHOLD 6
+#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 22
+#define PREINV_MOD_1_TO_MOD_1_THRESHOLD 16
+#define USE_PREINV_DIVREM_1 0
+#define DIV_QR_1N_PI1_METHOD 1
+#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 34
+
+#define MUL_TOOM22_THRESHOLD 14
+#define MUL_TOOM33_THRESHOLD 53
+#define MUL_TOOM44_THRESHOLD 136
+#define MUL_TOOM6H_THRESHOLD 197
+#define MUL_TOOM8H_THRESHOLD 296
+
+#define MUL_TOOM32_TO_TOOM43_THRESHOLD 89
+#define MUL_TOOM32_TO_TOOM53_THRESHOLD 91
+#define MUL_TOOM42_TO_TOOM53_THRESHOLD 89
+#define MUL_TOOM42_TO_TOOM63_THRESHOLD 96
+#define MUL_TOOM43_TO_TOOM54_THRESHOLD 79
+
+#define SQR_BASECASE_THRESHOLD 0 /* always (native) */
+#define SQR_TOOM2_THRESHOLD 24
+#define SQR_TOOM3_THRESHOLD 85
+#define SQR_TOOM4_THRESHOLD 142
+#define SQR_TOOM6_THRESHOLD 270
+#define SQR_TOOM8_THRESHOLD 430
+
+#define MULMID_TOOM42_THRESHOLD 32
+
+#define MULMOD_BNM1_THRESHOLD 11
+#define SQRMOD_BNM1_THRESHOLD 15
+
+#define MUL_FFT_MODF_THRESHOLD 380 /* k = 5 */
+#define MUL_FFT_TABLE3 \
+ { { 380, 5}, { 13, 6}, { 7, 5}, { 17, 6}, \
+ { 9, 5}, { 19, 6}, { 10, 5}, { 21, 6}, \
+ { 13, 5}, { 28, 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}, { 21, 9}, { 11, 8}, \
+ { 27, 9}, { 15, 8}, { 35, 9}, { 19, 8}, \
+ { 39, 9}, { 23, 8}, { 47, 9}, { 27,10}, \
+ { 15, 9}, { 39,10}, { 23, 9}, { 55,11}, \
+ { 15,10}, { 31, 9}, { 71,10}, { 39, 9}, \
+ { 83,10}, { 47, 9}, { 95,10}, { 55,11}, \
+ { 31,10}, { 63, 9}, { 127,10}, { 87,11}, \
+ { 47,10}, { 95, 9}, { 191,10}, { 103,12}, \
+ { 31,11}, { 63,10}, { 127, 9}, { 255, 8}, \
+ { 511,10}, { 135, 9}, { 271,11}, { 79,10}, \
+ { 159, 9}, { 319,10}, { 167, 9}, { 335,11}, \
+ { 95,10}, { 191, 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}, \
+ { 303, 9}, { 607,10}, { 319, 9}, { 639,10}, \
+ { 335, 9}, { 671,10}, { 351,12}, { 95,11}, \
+ { 191,10}, { 383, 9}, { 767,11}, { 207,10}, \
+ { 415, 9}, { 831,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}, { 335,10}, { 671,11}, \
+ { 351,10}, { 703,12}, { 191,11}, { 383,10}, \
+ { 767,11}, { 415,10}, { 831,12}, { 223,10}, \
+ { 895,11}, { 479,13}, { 127,12}, { 255,11}, \
+ { 543,12}, { 287,11}, { 607,12}, { 319,11}, \
+ { 671,12}, { 351,11}, { 703,13}, { 191,12}, \
+ { 383,11}, { 767,12}, { 415,11}, { 895,12}, \
+ { 479,14}, { 127,13}, { 255,12}, { 607,13}, \
+ { 319,12}, { 703,13}, { 383,12}, { 895,14}, \
+ { 255,13}, { 511,12}, { 1023,13}, { 575,12}, \
+ { 1151,13}, { 703,14}, { 383,13}, { 895,15}, \
+ { 255,14}, { 511,13}, { 1023,12}, { 2047,13}, \
+ { 1087,12}, { 2175,13}, { 1151,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 165
+#define MUL_FFT_THRESHOLD 9088
+
+#define SQR_FFT_MODF_THRESHOLD 308 /* k = 5 */
+#define SQR_FFT_TABLE3 \
+ { { 308, 5}, { 17, 6}, { 9, 5}, { 19, 6}, \
+ { 13, 5}, { 28, 6}, { 21, 7}, { 11, 6}, \
+ { 23, 7}, { 14, 6}, { 29, 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}, \
+ { 39, 9}, { 23, 8}, { 47, 9}, { 27,10}, \
+ { 15, 9}, { 39,10}, { 23, 9}, { 51,11}, \
+ { 15,10}, { 31, 9}, { 67,10}, { 39, 9}, \
+ { 83,10}, { 47, 9}, { 95,10}, { 55,11}, \
+ { 31,10}, { 79,11}, { 47,10}, { 95, 9}, \
+ { 191, 8}, { 383,12}, { 31,11}, { 63,10}, \
+ { 127, 9}, { 255, 8}, { 511,10}, { 135, 9}, \
+ { 271, 8}, { 543,11}, { 79,10}, { 159, 9}, \
+ { 319, 8}, { 639,10}, { 175, 9}, { 351,11}, \
+ { 95,10}, { 191, 9}, { 383, 8}, { 767,10}, \
+ { 207, 9}, { 415,11}, { 111,12}, { 63,11}, \
+ { 127,10}, { 255, 9}, { 511,10}, { 271, 9}, \
+ { 543,10}, { 287, 9}, { 575,10}, { 303,11}, \
+ { 159,10}, { 319, 9}, { 639,11}, { 175,10}, \
+ { 351,12}, { 95,11}, { 191,10}, { 383, 9}, \
+ { 767,11}, { 207,10}, { 415, 9}, { 831,11}, \
+ { 223,13}, { 63,12}, { 127,11}, { 255,10}, \
+ { 511,11}, { 271,10}, { 543,11}, { 287,10}, \
+ { 575,11}, { 303,10}, { 607,12}, { 159,11}, \
+ { 319,10}, { 639,11}, { 351,10}, { 703,12}, \
+ { 191,11}, { 383,10}, { 767,11}, { 415,10}, \
+ { 831,12}, { 223,10}, { 895,11}, { 479,13}, \
+ { 127,12}, { 255,11}, { 543,12}, { 287,11}, \
+ { 607,12}, { 319,11}, { 639,12}, { 351,11}, \
+ { 703,13}, { 191,12}, { 383,11}, { 767,12}, \
+ { 415,11}, { 895,12}, { 479,14}, { 127,13}, \
+ { 255,12}, { 607,13}, { 319,12}, { 703,13}, \
+ { 383,12}, { 927,14}, { 255,13}, { 511,12}, \
+ { 1023,13}, { 575,12}, { 1151,13}, { 639,12}, \
+ { 1279,13}, { 703,14}, { 383,13}, { 895,12}, \
+ { 1791,15}, { 255,14}, { 511,13}, { 1023,12}, \
+ { 2047,13}, { 1087,12}, { 2175,13}, { 1151,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 162
+#define SQR_FFT_THRESHOLD 6272
+
+#define MULLO_BASECASE_THRESHOLD 5
+#define MULLO_DC_THRESHOLD 44
+#define MULLO_MUL_N_THRESHOLD 18087
+
+#define DC_DIV_QR_THRESHOLD 42
+#define DC_DIVAPPR_Q_THRESHOLD 167
+#define DC_BDIV_QR_THRESHOLD 46
+#define DC_BDIV_Q_THRESHOLD 110
+
+#define INV_MULMOD_BNM1_THRESHOLD 30
+#define INV_NEWTON_THRESHOLD 181
+#define INV_APPR_THRESHOLD 173
+
+#define BINV_NEWTON_THRESHOLD 214
+#define REDC_1_TO_REDC_N_THRESHOLD 56
+
+#define MU_DIV_QR_THRESHOLD 998
+#define MU_DIVAPPR_Q_THRESHOLD 1017
+#define MUPI_DIV_QR_THRESHOLD 92
+#define MU_BDIV_QR_THRESHOLD 889
+#define MU_BDIV_Q_THRESHOLD 1017
+
+#define POWM_SEC_TABLE 2,22,87,579,1925
+
+#define MATRIX22_STRASSEN_THRESHOLD 15
+#define HGCD_THRESHOLD 109
+#define HGCD_APPR_THRESHOLD 115
+#define HGCD_REDUCE_THRESHOLD 4633
+#define GCD_DC_THRESHOLD 318
+#define GCDEXT_DC_THRESHOLD 242
+#define JACOBI_BASE_METHOD 4
+
+#define GET_STR_DC_THRESHOLD 11
+#define GET_STR_PRECOMPUTE_THRESHOLD 23
+#define SET_STR_DC_THRESHOLD 802
+#define SET_STR_PRECOMPUTE_THRESHOLD 1712
+
+#define FAC_DSC_THRESHOLD 507
+#define FAC_ODD_THRESHOLD 25
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/mode64/p5/gmp-mparam.h b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/mode64/p5/gmp-mparam.h
new file mode 100644
index 00000000000..15b009c357a
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/mode64/p5/gmp-mparam.h
@@ -0,0 +1,219 @@
+/* POWER5 gmp-mparam.h -- Compiler/machine parameter header file.
+
+Copyright 1991, 1993, 1994, 1999-2003, 2009, 2010 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
+
+/* POWER5 (friggms.hpc.ntnu.no) */
+
+#define MOD_1_NORM_THRESHOLD 0 /* always */
+#define MOD_1_UNNORM_THRESHOLD 0 /* always */
+#define MOD_1N_TO_MOD_1_1_THRESHOLD 6
+#define MOD_1U_TO_MOD_1_1_THRESHOLD 5
+#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 USE_PREINV_DIVREM_1 0
+#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 40
+
+#define MUL_TOOM22_THRESHOLD 21
+#define MUL_TOOM33_THRESHOLD 24
+#define MUL_TOOM44_THRESHOLD 70
+#define MUL_TOOM6H_THRESHOLD 262
+#define MUL_TOOM8H_THRESHOLD 393
+
+#define MUL_TOOM32_TO_TOOM43_THRESHOLD 49
+#define MUL_TOOM32_TO_TOOM53_THRESHOLD 126
+#define MUL_TOOM42_TO_TOOM53_THRESHOLD 85
+#define MUL_TOOM42_TO_TOOM63_THRESHOLD 94
+#define MUL_TOOM43_TO_TOOM54_THRESHOLD 70
+
+#define SQR_BASECASE_THRESHOLD 0 /* always (native) */
+#define SQR_TOOM2_THRESHOLD 24
+#define SQR_TOOM3_THRESHOLD 81
+#define SQR_TOOM4_THRESHOLD 142
+#define SQR_TOOM6_THRESHOLD 189
+#define SQR_TOOM8_THRESHOLD 284
+
+#define MULMID_TOOM42_THRESHOLD 36
+
+#define MULMOD_BNM1_THRESHOLD 12
+#define SQRMOD_BNM1_THRESHOLD 15
+
+#define MUL_FFT_MODF_THRESHOLD 304 /* k = 5 */
+#define MUL_FFT_TABLE3 \
+ { { 348, 5}, { 17, 6}, { 9, 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}, { 21, 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}, { 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}, { 127, 9}, { 255,10}, \
+ { 135,11}, { 79,10}, { 159, 9}, { 319,11}, \
+ { 95,10}, { 191, 9}, { 383,12}, { 63,11}, \
+ { 127,10}, { 255, 9}, { 511,10}, { 271,11}, \
+ { 143,10}, { 287, 9}, { 575,10}, { 319,12}, \
+ { 95,11}, { 191,10}, { 383,13}, { 63,12}, \
+ { 127,11}, { 255,10}, { 511,11}, { 271,10}, \
+ { 543,11}, { 287,10}, { 575, 9}, { 1151,11}, \
+ { 319,10}, { 639,11}, { 351,10}, { 703,12}, \
+ { 191,11}, { 383,10}, { 767,11}, { 415,12}, \
+ { 223,11}, { 447,13}, { 127,12}, { 255,11}, \
+ { 511,10}, { 1023,11}, { 543,10}, { 1087,12}, \
+ { 287,11}, { 575,10}, { 1151,12}, { 319,11}, \
+ { 639,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}, { 543,11}, { 1087,10}, \
+ { 2175,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,13}, { 447,12}, \
+ { 959,11}, { 1919,14}, { 255,13}, { 511,12}, \
+ { 1087,11}, { 2175,13}, { 575,12}, { 1215,11}, \
+ { 2431,10}, { 4863,13}, { 639,12}, { 1343,13}, \
+ { 703,12}, { 1407,14}, { 383,13}, { 767,12}, \
+ { 1535,13}, { 831,12}, { 1663,13}, { 959,12}, \
+ { 1919,11}, { 3839,15}, { 255,14}, { 511,13}, \
+ { 1087,12}, { 2175,13}, { 1215,12}, { 2431,11}, \
+ { 4863,14}, { 639,13}, { 1343,12}, { 2687,13}, \
+ { 1407,12}, { 2815,13}, { 1471,12}, { 2943,14}, \
+ { 767,13}, { 1599,12}, { 3199,13}, { 1663,14}, \
+ { 895,13}, { 1919,12}, { 3839,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}, { 3327,14}, { 1919,13}, { 3839,16}, \
+ { 511,15}, { 1023,14}, { 2431,13}, { 4863,15}, \
+ { 1279,14}, { 2943,12}, { 11775,15}, { 1535,14}, \
+ { 3327,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 208
+#define MUL_FFT_THRESHOLD 4224
+
+#define SQR_FFT_MODF_THRESHOLD 284 /* k = 5 */
+#define SQR_FFT_TABLE3 \
+ { { 272, 5}, { 15, 6}, { 8, 5}, { 17, 6}, \
+ { 19, 7}, { 17, 8}, { 9, 7}, { 21, 8}, \
+ { 11, 7}, { 24, 8}, { 13, 7}, { 27, 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}, { 39,10}, { 23, 9}, { 47,11}, \
+ { 15,10}, { 31, 9}, { 63,10}, { 47,11}, \
+ { 31,10}, { 71, 9}, { 143,10}, { 79,11}, \
+ { 47,10}, { 95,12}, { 31,11}, { 63,10}, \
+ { 127, 9}, { 255, 8}, { 511, 9}, { 271,10}, \
+ { 143,11}, { 79,10}, { 159, 9}, { 319,10}, \
+ { 175, 9}, { 351,11}, { 95,10}, { 191, 9}, \
+ { 383,10}, { 207, 9}, { 415,12}, { 63,11}, \
+ { 127,10}, { 255, 9}, { 511,10}, { 271,11}, \
+ { 143,10}, { 287, 9}, { 575,11}, { 159,10}, \
+ { 319,11}, { 175,10}, { 351,12}, { 95,11}, \
+ { 191,10}, { 383,11}, { 207,10}, { 415,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,12}, { 191,11}, { 383,10}, { 767,11}, \
+ { 415,12}, { 223,11}, { 447,10}, { 895,11}, \
+ { 479,10}, { 959,12}, { 255,11}, { 511,10}, \
+ { 1023,11}, { 543,12}, { 287,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,11}, \
+ { 959,13}, { 255,12}, { 511,11}, { 1023,12}, \
+ { 543,11}, { 1087,12}, { 575,13}, { 319,12}, \
+ { 639,11}, { 1279,12}, { 703,11}, { 1407,13}, \
+ { 383,12}, { 831,13}, { 447,12}, { 959,14}, \
+ { 255,13}, { 511,12}, { 1087,13}, { 575,12}, \
+ { 1215,13}, { 639,12}, { 1279,13}, { 703,12}, \
+ { 1407,14}, { 383,13}, { 831,12}, { 1663,13}, \
+ { 959,12}, { 1919,15}, { 255,14}, { 511,13}, \
+ { 1023,12}, { 2047,13}, { 1087,12}, { 2175,13}, \
+ { 1215,14}, { 639,13}, { 1407,12}, { 2815,14}, \
+ { 767,13}, { 1663,14}, { 895,13}, { 1919,15}, \
+ { 511,14}, { 1023,13}, { 2175,14}, { 1151,13}, \
+ { 2431,12}, { 4863,14}, { 1407,13}, { 2815,15}, \
+ { 767,14}, { 1663,13}, { 3327,14}, { 1919,13}, \
+ { 3839,16}, { 511,15}, { 1023,14}, { 2431,13}, \
+ { 4863,15}, { 1279,14}, { 2943,13}, { 5887,12}, \
+ { 11775,15}, { 1535,14}, { 3327,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 190
+#define SQR_FFT_THRESHOLD 3264
+
+#define MULLO_BASECASE_THRESHOLD 6
+#define MULLO_DC_THRESHOLD 60
+#define MULLO_MUL_N_THRESHOLD 7463
+
+#define DC_DIV_QR_THRESHOLD 58
+#define DC_DIVAPPR_Q_THRESHOLD 232
+#define DC_BDIV_QR_THRESHOLD 78
+#define DC_BDIV_Q_THRESHOLD 238
+
+#define INV_MULMOD_BNM1_THRESHOLD 92
+#define INV_NEWTON_THRESHOLD 155
+#define INV_APPR_THRESHOLD 157
+
+#define BINV_NEWTON_THRESHOLD 155
+#define REDC_1_TO_REDC_N_THRESHOLD 61
+
+#define MU_DIV_QR_THRESHOLD 998
+#define MU_DIVAPPR_Q_THRESHOLD 979
+#define MUPI_DIV_QR_THRESHOLD 79
+#define MU_BDIV_QR_THRESHOLD 823
+#define MU_BDIV_Q_THRESHOLD 942
+
+#define MATRIX22_STRASSEN_THRESHOLD 14
+#define HGCD_THRESHOLD 74
+#define HGCD_APPR_THRESHOLD 155
+#define HGCD_REDUCE_THRESHOLD 2479
+#define GCD_DC_THRESHOLD 351
+#define GCDEXT_DC_THRESHOLD 288
+#define JACOBI_BASE_METHOD 4
+
+#define GET_STR_DC_THRESHOLD 12
+#define GET_STR_PRECOMPUTE_THRESHOLD 21
+#define SET_STR_DC_THRESHOLD 650
+#define SET_STR_PRECOMPUTE_THRESHOLD 1585
+
+#define FAC_DSC_THRESHOLD 662
+#define FAC_ODD_THRESHOLD 28
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/mode64/p6/aorsmul_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/mode64/p6/aorsmul_1.asm
new file mode 100644
index 00000000000..5a85f84f4a8
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/mode64/p6/aorsmul_1.asm
@@ -0,0 +1,183 @@
+dnl PowerPC-64 mpn_addmul_1 and mpn_submul_1 optimised for power6.
+
+dnl Copyright 1999-2001, 2003-2006, 2008, 2010, 2011 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 mpn_addmul_1 mpn_submul_1
+C cycles/limb cycles/limb
+C POWER3/PPC630 ? ?
+C POWER4/PPC970 ? ?
+C POWER5 ? ?
+C POWER6 12.25 12.8
+C POWER7 ? ?
+
+C TODO
+C * Reduce register usage.
+C * Schedule function entry code.
+C * Unroll more. 8-way unrolling would bring us to 10 c/l, 16-way unrolling
+C would bring us to 9 c/l.
+C * Handle n = 1 and perhaps n = 2 separately, without saving any registers.
+
+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(func_nc, mpn_addmul_1c) C FIXME: not really supported
+ define(AM, `$1')
+ define(SM, `')
+ define(CLRRSC, `addic $1, r0, 0')
+')
+ifdef(`OPERATION_submul_1',`
+ define(ADDSUBC, subfe)
+ define(ADDSUB, subfc)
+ define(func, mpn_submul_1)
+ define(func_nc, mpn_submul_1c) C FIXME: not really supported
+ define(AM, `')
+ define(SM, `$1')
+ define(CLRRSC, `subfc $1, r0, r0')
+')
+
+ASM_START()
+PROLOGUE(func)
+ std r31, -8(r1)
+ std r30, -16(r1)
+ std r29, -24(r1)
+ std r28, -32(r1)
+ std r27, -40(r1)
+
+ rldicl. r0, n, 0,62 C r0 = n & 3, set cr0
+ cmpdi cr6, r0, 2
+ addi n, n, 3 C compute count...
+ srdi n, n, 2 C ...for ctr
+ mtctr n C copy loop count into ctr
+ beq cr0, L(b0)
+ blt cr6, L(b1)
+ beq cr6, L(b2)
+
+L(b3): ld r8, 0(up)
+ ld r7, 8(up)
+ ld r27, 16(up)
+ addi up, up, 16
+ addi rp, rp, 16
+ mulld r5, r8, v0
+ mulhdu r8, r8, v0
+ mulld r9, r7, v0
+ mulhdu r7, r7, v0
+ mulld r11, r27, v0
+ mulhdu r27, r27, v0
+ ld r29, -16(rp)
+ ld r30, -8(rp)
+ ld r31, 0(rp)
+ addc r9, r9, r8
+ adde r11, r11, r7
+ addze r12, r27
+ ADDSUB r5, r5, r29
+ b L(l3)
+
+L(b2): ld r7, 0(up)
+ ld r27, 8(up)
+ addi up, up, 8
+ addi rp, rp, 8
+ mulld r9, r7, v0
+ mulhdu r7, r7, v0
+ mulld r11, r27, v0
+ mulhdu r27, r27, v0
+ ld r30, -8(rp)
+ ld r31, 0(rp)
+ addc r11, r11, r7
+ addze r12, r27
+ ADDSUB r9, r9, r30
+ b L(l2)
+
+L(b1): ld r27, 0(up)
+ ld r31, 0(rp)
+ mulld r11, r27, v0
+ mulhdu r12, r27, v0
+ ADDSUB r11, r11, r31
+ b L(l1)
+
+L(b0): addi up, up, -8
+ addi rp, rp, -8
+ CLRRSC( r12) C clear r12 and clr/set cy
+
+ ALIGN(32)
+L(top):
+SM(` subfe r11, r0, r0') C complement...
+SM(` addic r11, r11, 1') C ...carry flag
+ ld r10, 8(up)
+ ld r8, 16(up)
+ ld r7, 24(up)
+ ld r27, 32(up)
+ addi up, up, 32
+ addi rp, rp, 32
+ mulld r0, r10, v0
+ mulhdu r10, r10, v0
+ mulld r5, r8, v0
+ mulhdu r8, r8, v0
+ mulld r9, r7, v0
+ mulhdu r7, r7, v0
+ mulld r11, r27, v0
+ mulhdu r27, r27, v0
+ ld r28, -24(rp)
+ adde r0, r0, r12
+ ld r29, -16(rp)
+ adde r5, r5, r10
+ ld r30, -8(rp)
+ ld r31, 0(rp)
+ adde r9, r9, r8
+ adde r11, r11, r7
+ addze r12, r27
+ ADDSUB r0, r0, r28
+ std r0, -24(rp)
+ ADDSUBC r5, r5, r29
+L(l3): std r5, -16(rp)
+ ADDSUBC r9, r9, r30
+L(l2): std r9, -8(rp)
+ ADDSUBC r11, r11, r31
+L(l1): std r11, 0(rp)
+ bdnz L(top)
+
+AM(` addze r3, r12')
+SM(` subfe r11, r0, r0') C complement...
+ ld r31, -8(r1)
+SM(` subf r3, r11, r12')
+ ld r30, -16(r1)
+ ld r29, -24(r1)
+ ld r28, -32(r1)
+ ld r27, -40(r1)
+ blr
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/mode64/p6/gmp-mparam.h b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/mode64/p6/gmp-mparam.h
new file mode 100644
index 00000000000..c7e2f894ad4
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/mode64/p6/gmp-mparam.h
@@ -0,0 +1,160 @@
+/* POWER6 gmp-mparam.h -- Compiler/machine parameter header file.
+
+Copyright 1991, 1993, 1994, 1999-2003, 2009-2011 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
+
+/* 3500 MHz POWER6 (kolga.bibsys.no) */
+
+#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 3
+#define MOD_1_1_TO_MOD_1_2_THRESHOLD 12
+#define MOD_1_2_TO_MOD_1_4_THRESHOLD 0 /* never mpn_mod_1s_2p */
+#define PREINV_MOD_1_TO_MOD_1_THRESHOLD 6
+#define USE_PREINV_DIVREM_1 0
+#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 21
+
+#define MUL_TOOM22_THRESHOLD 20
+#define MUL_TOOM33_THRESHOLD 50
+#define MUL_TOOM44_THRESHOLD 106
+#define MUL_TOOM6H_THRESHOLD 274
+#define MUL_TOOM8H_THRESHOLD 339
+
+#define MUL_TOOM32_TO_TOOM43_THRESHOLD 62
+#define MUL_TOOM32_TO_TOOM53_THRESHOLD 76
+#define MUL_TOOM42_TO_TOOM53_THRESHOLD 73
+#define MUL_TOOM42_TO_TOOM63_THRESHOLD 66
+#define MUL_TOOM43_TO_TOOM54_THRESHOLD 88
+
+#define SQR_BASECASE_THRESHOLD 0 /* always (native) */
+#define SQR_TOOM2_THRESHOLD 24
+#define SQR_TOOM3_THRESHOLD 49
+#define SQR_TOOM4_THRESHOLD 130
+#define SQR_TOOM6_THRESHOLD 226
+#define SQR_TOOM8_THRESHOLD 272
+
+#define MULMID_TOOM42_THRESHOLD 36
+
+#define MULMOD_BNM1_THRESHOLD 14
+#define SQRMOD_BNM1_THRESHOLD 14
+
+#define MUL_FFT_MODF_THRESHOLD 380 /* k = 5 */
+#define MUL_FFT_TABLE3 \
+ { { 340, 5}, { 19, 6}, { 10, 5}, { 21, 6}, \
+ { 11, 5}, { 23, 6}, { 21, 7}, { 11, 6}, \
+ { 23, 7}, { 12, 6}, { 25, 7}, { 21, 8}, \
+ { 11, 7}, { 24, 8}, { 13, 7}, { 27, 8}, \
+ { 21, 9}, { 11, 8}, { 25, 9}, { 15, 8}, \
+ { 33, 9}, { 23, 8}, { 47, 9}, { 27,10}, \
+ { 15, 9}, { 39,10}, { 23, 9}, { 47,11}, \
+ { 15,10}, { 31, 9}, { 63,10}, { 47,11}, \
+ { 31,10}, { 71,11}, { 47,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,10}, { 255, 9}, \
+ { 511,10}, { 271, 9}, { 543,11}, { 143,10}, \
+ { 287, 9}, { 575,10}, { 303, 9}, { 607,10}, \
+ { 319, 9}, { 639,11}, { 175,12}, { 95,11}, \
+ { 191,10}, { 383,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 79
+#define MUL_FFT_THRESHOLD 3520
+
+#define SQR_FFT_MODF_THRESHOLD 308 /* k = 5 */
+#define SQR_FFT_TABLE3 \
+ { { 280, 5}, { 17, 6}, { 9, 5}, { 19, 6}, \
+ { 21, 7}, { 11, 6}, { 23, 7}, { 21, 8}, \
+ { 11, 7}, { 24, 8}, { 13, 7}, { 27, 8}, \
+ { 21, 9}, { 11, 8}, { 25, 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,10}, { 47,11}, { 31,10}, { 71, 9}, \
+ { 143,11}, { 47,12}, { 31,11}, { 63, 9}, \
+ { 255, 8}, { 511, 9}, { 271,10}, { 143,11}, \
+ { 79,10}, { 159, 9}, { 319,10}, { 175, 9}, \
+ { 351,11}, { 95,10}, { 191, 9}, { 383,10}, \
+ { 207,12}, { 63,11}, { 127,10}, { 255, 9}, \
+ { 511, 8}, { 1023,10}, { 271, 9}, { 543,11}, \
+ { 143,10}, { 287, 9}, { 575,11}, { 159,10}, \
+ { 319, 9}, { 639,11}, { 175,10}, { 351,12}, \
+ { 95,11}, { 191,10}, { 383,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 80
+#define SQR_FFT_THRESHOLD 2752
+
+#define MULLO_BASECASE_THRESHOLD 5
+#define MULLO_DC_THRESHOLD 62
+#define MULLO_MUL_N_THRESHOLD 2995
+
+#define DC_DIV_QR_THRESHOLD 59
+#define DC_DIVAPPR_Q_THRESHOLD 200
+#define DC_BDIV_QR_THRESHOLD 70
+#define DC_BDIV_Q_THRESHOLD 168
+
+#define INV_MULMOD_BNM1_THRESHOLD 53
+#define INV_NEWTON_THRESHOLD 170
+#define INV_APPR_THRESHOLD 166
+
+#define BINV_NEWTON_THRESHOLD 220
+#define REDC_1_TO_REDC_N_THRESHOLD 67
+
+#define MU_DIV_QR_THRESHOLD 998
+#define MU_DIVAPPR_Q_THRESHOLD 942
+#define MUPI_DIV_QR_THRESHOLD 57
+#define MU_BDIV_QR_THRESHOLD 889
+#define MU_BDIV_Q_THRESHOLD 1078
+
+#define POWM_SEC_TABLE 4,26,216,804,1731
+
+#define MATRIX22_STRASSEN_THRESHOLD 13
+#define HGCD_THRESHOLD 106
+#define HGCD_APPR_THRESHOLD 109
+#define HGCD_REDUCE_THRESHOLD 2205
+#define GCD_DC_THRESHOLD 492
+#define GCDEXT_DC_THRESHOLD 327
+#define JACOBI_BASE_METHOD 4
+
+#define GET_STR_DC_THRESHOLD 16
+#define GET_STR_PRECOMPUTE_THRESHOLD 28
+#define SET_STR_DC_THRESHOLD 537
+#define SET_STR_PRECOMPUTE_THRESHOLD 1576
+
+#define FAC_DSC_THRESHOLD 426
+#define FAC_ODD_THRESHOLD 0 /* always */
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/mode64/p6/mul_basecase.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/mode64/p6/mul_basecase.asm
new file mode 100644
index 00000000000..3d32b46c353
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/mode64/p6/mul_basecase.asm
@@ -0,0 +1,589 @@
+dnl PowerPC-64 mpn_mul_basecase.
+
+dnl Copyright 1999-2001, 2003-2006, 2008, 2010 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 12.25
+
+C TODO
+C * Reduce register usage. At least 4 register less can be used.
+C * Unroll more. 8-way unrolling would bring us to 10 c/l, 16-way unrolling
+C would bring us to 9 c/l.
+C * The bdz insns for b1 and b2 will never branch,
+C * Align things better, perhaps by moving things like pointer updates from
+C before to after loops.
+
+C INPUT PARAMETERS
+define(`rp', `r3')
+define(`up', `r4')
+define(`un', `r5')
+define(`vp', `r6')
+define(`vn', `r7')
+
+define(`v0', `r25')
+define(`outer_rp', `r22')
+define(`outer_up', `r23')
+
+ASM_START()
+PROLOGUE(mpn_mul_basecase)
+
+C Special code for un <= 2, for efficiency of these important cases,
+C and since it simplifies the default code.
+ 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)
+ nop
+ mulld r8, r5, r6 C weight 1
+ mulhdu r11, r5, r6 C weight 2
+ mulld r12, r0, r6 C weight 2
+ mulhdu r0, r0, r6 C weight 3
+ addc r9, r9, r8
+ std r9, 8(rp)
+ adde r11, r11, r10
+ addze r0, r0
+ addc r11, r11, r12
+ addze r0, r0
+ std r11, 16(rp)
+ std r0, 24(rp)
+ blr
+
+L(un_gt2):
+ std r31, -8(r1)
+ std r30, -16(r1)
+ std r29, -24(r1)
+ std r28, -32(r1)
+ std r27, -40(r1)
+ std r26, -48(r1)
+ std r25, -56(r1)
+ std r24, -64(r1)
+ std r23, -72(r1)
+ std r22, -80(r1)
+ std r21, -88(r1)
+ std r20, -96(r1)
+
+ mr outer_rp, rp
+ mr outer_up, up
+
+ ld v0, 0(vp) C new v limb
+ addi vp, vp, 8
+ ld r26, 0(up)
+
+ rldicl. r0, un, 0,62 C r0 = n & 3, set cr0
+ cmpdi cr6, r0, 2
+ addi un, un, 4 C compute count...
+ srdi un, un, 2 C ...for ctr
+ mtctr un C copy inner loop count into ctr
+ beq cr0, L(b0)
+ blt cr6, L(b1)
+ beq cr6, L(b2)
+
+
+ ALIGN(16)
+L(b3):
+ ld r27, 8(up)
+ ld r20, 16(up)
+ mulld r0, r26, v0
+ mulhdu r31, r26, v0
+ mulld r24, r27, v0
+ mulhdu r8, r27, v0
+ mulld r9, r20, v0
+ mulhdu r10, r20, v0
+ addc r24, r24, r31
+ adde r9, r9, r8
+ addze r12, r10
+ std r0, 0(rp)
+ std r24, 8(rp)
+ std r9, 16(rp)
+ addi up, up, 16
+ addi rp, rp, 16
+ bdz L(end_m_3)
+
+ ALIGN(32)
+L(lo_m_3):
+ ld r26, 8(up)
+ ld r27, 16(up)
+ ld r20, 24(up)
+ ld r21, 32(up)
+ mulld r0, r26, v0
+ mulhdu r31, r26, v0
+ mulld r24, r27, v0
+ mulhdu r8, r27, v0
+ mulld r9, r20, v0
+ mulhdu r27, r20, v0
+ mulld r11, r21, v0
+ mulhdu r26, r21, v0
+ adde r0, r0, r12
+ adde r24, r24, r31
+ std r0, 8(rp)
+ adde r9, r9, r8
+ std r24, 16(rp)
+ adde r11, r11, r27
+ std r9, 24(rp)
+ addi up, up, 32
+ std r11, 32(rp)
+ addi rp, rp, 32
+ mr r12, r26
+ bdnz L(lo_m_3)
+
+ ALIGN(16)
+L(end_m_3):
+ addze r12, r12
+ addic. vn, vn, -1
+ std r12, 8(rp)
+ beq L(ret)
+
+ ALIGN(16)
+L(outer_lo_3):
+ mtctr un C copy inner loop count into ctr
+ addi rp, outer_rp, 24
+ addi up, outer_up, 16
+ addi outer_rp, outer_rp, 8
+ ld v0, 0(vp) C new v limb
+ addi vp, vp, 8
+ ld r26, -16(up)
+ ld r27, -8(up)
+ ld r20, 0(up)
+ mulld r0, r26, v0
+ mulhdu r31, r26, v0
+ mulld r24, r27, v0
+ mulhdu r8, r27, v0
+ mulld r9, r20, v0
+ mulhdu r10, r20, v0
+ ld r28, -16(rp)
+ ld r29, -8(rp)
+ ld r30, 0(rp)
+ addc r24, r24, r31
+ adde r9, r9, r8
+ addze r12, r10
+ addc r0, r0, r28
+ std r0, -16(rp)
+ adde r24, r24, r29
+ std r24, -8(rp)
+ adde r9, r9, r30
+ std r9, 0(rp)
+ bdz L(end_3)
+
+ ALIGN(32) C registers dying
+L(lo_3):
+ ld r26, 8(up)
+ ld r27, 16(up)
+ ld r20, 24(up) C
+ ld r21, 32(up) C
+ addi up, up, 32 C
+ addi rp, rp, 32 C
+ mulld r0, r26, v0 C
+ mulhdu r10, r26, v0 C 26
+ mulld r24, r27, v0 C
+ mulhdu r8, r27, v0 C 27
+ mulld r9, r20, v0 C
+ mulhdu r27, r20, v0 C 26
+ mulld r11, r21, v0 C
+ mulhdu r26, r21, v0 C 27
+ ld r28, -24(rp) C
+ adde r0, r0, r12 C 0 12
+ ld r29, -16(rp) C
+ adde r24, r24, r10 C 24 10
+ ld r30, -8(rp) C
+ ld r31, 0(rp) C
+ adde r9, r9, r8 C 8 9
+ adde r11, r11, r27 C 27 11
+ addze r12, r26 C 26
+ addc r0, r0, r28 C 0 28
+ std r0, -24(rp) C 0
+ adde r24, r24, r29 C 7 29
+ std r24, -16(rp) C 7
+ adde r9, r9, r30 C 9 30
+ std r9, -8(rp) C 9
+ adde r11, r11, r31 C 11 31
+ std r11, 0(rp) C 11
+ bdnz L(lo_3) C
+
+ ALIGN(16)
+L(end_3):
+ addze r12, r12
+ addic. vn, vn, -1
+ std r12, 8(rp)
+ bne L(outer_lo_3)
+ b L(ret)
+
+
+ ALIGN(16)
+L(b1):
+ mulld r0, r26, v0
+ mulhdu r12, r26, v0
+ addic r0, r0, 0
+ std r0, 0(rp)
+ bdz L(end_m_1)
+
+ ALIGN(16)
+L(lo_m_1):
+ ld r26, 8(up)
+ ld r27, 16(up)
+ ld r20, 24(up)
+ ld r21, 32(up)
+ mulld r0, r26, v0
+ mulhdu r31, r26, v0
+ mulld r24, r27, v0
+ mulhdu r8, r27, v0
+ mulld r9, r20, v0
+ mulhdu r27, r20, v0
+ mulld r11, r21, v0
+ mulhdu r26, r21, v0
+ adde r0, r0, r12
+ adde r24, r24, r31
+ std r0, 8(rp)
+ adde r9, r9, r8
+ std r24, 16(rp)
+ adde r11, r11, r27
+ std r9, 24(rp)
+ addi up, up, 32
+ std r11, 32(rp)
+ addi rp, rp, 32
+ mr r12, r26
+ bdnz L(lo_m_1)
+
+ ALIGN(16)
+L(end_m_1):
+ addze r12, r12
+ addic. vn, vn, -1
+ std r12, 8(rp)
+ beq L(ret)
+
+ ALIGN(16)
+L(outer_lo_1):
+ mtctr un C copy inner loop count into ctr
+ addi rp, outer_rp, 8
+ mr up, outer_up
+ addi outer_rp, outer_rp, 8
+ ld v0, 0(vp) C new v limb
+ addi vp, vp, 8
+ ld r26, 0(up)
+ ld r28, 0(rp)
+ mulld r0, r26, v0
+ mulhdu r12, r26, v0
+ addc r0, r0, r28
+ std r0, 0(rp)
+ bdz L(end_1)
+
+ ALIGN(32) C registers dying
+L(lo_1):
+ ld r26, 8(up)
+ ld r27, 16(up)
+ ld r20, 24(up) C
+ ld r21, 32(up) C
+ addi up, up, 32 C
+ addi rp, rp, 32 C
+ mulld r0, r26, v0 C
+ mulhdu r10, r26, v0 C 26
+ mulld r24, r27, v0 C
+ mulhdu r8, r27, v0 C 27
+ mulld r9, r20, v0 C
+ mulhdu r27, r20, v0 C 26
+ mulld r11, r21, v0 C
+ mulhdu r26, r21, v0 C 27
+ ld r28, -24(rp) C
+ adde r0, r0, r12 C 0 12
+ ld r29, -16(rp) C
+ adde r24, r24, r10 C 24 10
+ ld r30, -8(rp) C
+ ld r31, 0(rp) C
+ adde r9, r9, r8 C 8 9
+ adde r11, r11, r27 C 27 11
+ addze r12, r26 C 26
+ addc r0, r0, r28 C 0 28
+ std r0, -24(rp) C 0
+ adde r24, r24, r29 C 7 29
+ std r24, -16(rp) C 7
+ adde r9, r9, r30 C 9 30
+ std r9, -8(rp) C 9
+ adde r11, r11, r31 C 11 31
+ std r11, 0(rp) C 11
+ bdnz L(lo_1) C
+
+ ALIGN(16)
+L(end_1):
+ addze r12, r12
+ addic. vn, vn, -1
+ std r12, 8(rp)
+ bne L(outer_lo_1)
+ b L(ret)
+
+
+ ALIGN(16)
+L(b0):
+ addi up, up, -8
+ addi rp, rp, -8
+ li r12, 0
+ addic r12, r12, 0
+ bdz L(end_m_0)
+
+ ALIGN(16)
+L(lo_m_0):
+ ld r26, 8(up)
+ ld r27, 16(up)
+ ld r20, 24(up)
+ ld r21, 32(up)
+ mulld r0, r26, v0
+ mulhdu r31, r26, v0
+ mulld r24, r27, v0
+ mulhdu r8, r27, v0
+ mulld r9, r20, v0
+ mulhdu r27, r20, v0
+ mulld r11, r21, v0
+ mulhdu r26, r21, v0
+ adde r0, r0, r12
+ adde r24, r24, r31
+ std r0, 8(rp)
+ adde r9, r9, r8
+ std r24, 16(rp)
+ adde r11, r11, r27
+ std r9, 24(rp)
+ addi up, up, 32
+ std r11, 32(rp)
+ addi rp, rp, 32
+ mr r12, r26
+ bdnz L(lo_m_0)
+
+ ALIGN(16)
+L(end_m_0):
+ addze r12, r12
+ addic. vn, vn, -1
+ std r12, 8(rp)
+ beq L(ret)
+
+ ALIGN(16)
+L(outer_lo_0):
+ mtctr un C copy inner loop count into ctr
+ addi rp, outer_rp, 0
+ addi up, outer_up, -8
+ addi outer_rp, outer_rp, 8
+ ld v0, 0(vp) C new v limb
+ addi vp, vp, 8
+ li r12, 0
+ addic r12, r12, 0
+ bdz L(end_0)
+
+ ALIGN(32) C registers dying
+L(lo_0):
+ ld r26, 8(up)
+ ld r27, 16(up)
+ ld r20, 24(up) C
+ ld r21, 32(up) C
+ addi up, up, 32 C
+ addi rp, rp, 32 C
+ mulld r0, r26, v0 C
+ mulhdu r10, r26, v0 C 26
+ mulld r24, r27, v0 C
+ mulhdu r8, r27, v0 C 27
+ mulld r9, r20, v0 C
+ mulhdu r27, r20, v0 C 26
+ mulld r11, r21, v0 C
+ mulhdu r26, r21, v0 C 27
+ ld r28, -24(rp) C
+ adde r0, r0, r12 C 0 12
+ ld r29, -16(rp) C
+ adde r24, r24, r10 C 24 10
+ ld r30, -8(rp) C
+ ld r31, 0(rp) C
+ adde r9, r9, r8 C 8 9
+ adde r11, r11, r27 C 27 11
+ addze r12, r26 C 26
+ addc r0, r0, r28 C 0 28
+ std r0, -24(rp) C 0
+ adde r24, r24, r29 C 7 29
+ std r24, -16(rp) C 7
+ adde r9, r9, r30 C 9 30
+ std r9, -8(rp) C 9
+ adde r11, r11, r31 C 11 31
+ std r11, 0(rp) C 11
+ bdnz L(lo_0) C
+
+ ALIGN(16)
+L(end_0):
+ addze r12, r12
+ addic. vn, vn, -1
+ std r12, 8(rp)
+ bne L(outer_lo_0)
+ b L(ret)
+
+
+ ALIGN(16)
+L(b2): ld r27, 8(up)
+ addi up, up, 8
+ mulld r0, r26, v0
+ mulhdu r10, r26, v0
+ mulld r24, r27, v0
+ mulhdu r8, r27, v0
+ addc r24, r24, r10
+ addze r12, r8
+ std r0, 0(rp)
+ std r24, 8(rp)
+ addi rp, rp, 8
+ bdz L(end_m_2)
+
+ ALIGN(16)
+L(lo_m_2):
+ ld r26, 8(up)
+ ld r27, 16(up)
+ ld r20, 24(up)
+ ld r21, 32(up)
+ mulld r0, r26, v0
+ mulhdu r31, r26, v0
+ mulld r24, r27, v0
+ mulhdu r8, r27, v0
+ mulld r9, r20, v0
+ mulhdu r27, r20, v0
+ mulld r11, r21, v0
+ mulhdu r26, r21, v0
+ adde r0, r0, r12
+ adde r24, r24, r31
+ std r0, 8(rp)
+ adde r9, r9, r8
+ std r24, 16(rp)
+ adde r11, r11, r27
+ std r9, 24(rp)
+ addi up, up, 32
+ std r11, 32(rp)
+ addi rp, rp, 32
+ mr r12, r26
+ bdnz L(lo_m_2)
+
+ ALIGN(16)
+L(end_m_2):
+ addze r12, r12
+ addic. vn, vn, -1
+ std r12, 8(rp)
+ beq L(ret)
+
+ ALIGN(16)
+L(outer_lo_2):
+ mtctr un C copy inner loop count into ctr
+ addi rp, outer_rp, 16
+ addi up, outer_up, 8
+ addi outer_rp, outer_rp, 8
+ ld v0, 0(vp) C new v limb
+ addi vp, vp, 8
+ ld r26, -8(up)
+ ld r27, 0(up)
+ ld r28, -8(rp)
+ ld r29, 0(rp)
+ mulld r0, r26, v0
+ mulhdu r10, r26, v0
+ mulld r24, r27, v0
+ mulhdu r8, r27, v0
+ addc r24, r24, r10
+ addze r12, r8
+ addc r0, r0, r28
+ std r0, -8(rp)
+ adde r24, r24, r29
+ std r24, 0(rp)
+ bdz L(end_2)
+
+ ALIGN(16) C registers dying
+L(lo_2):
+ ld r26, 8(up)
+ ld r27, 16(up)
+ ld r20, 24(up) C
+ ld r21, 32(up) C
+ addi up, up, 32 C
+ addi rp, rp, 32 C
+ mulld r0, r26, v0 C
+ mulhdu r10, r26, v0 C 26
+ mulld r24, r27, v0 C
+ mulhdu r8, r27, v0 C 27
+ mulld r9, r20, v0 C
+ mulhdu r27, r20, v0 C 26
+ mulld r11, r21, v0 C
+ mulhdu r26, r21, v0 C 27
+ ld r28, -24(rp) C
+ adde r0, r0, r12 C 0 12
+ ld r29, -16(rp) C
+ adde r24, r24, r10 C 24 10
+ ld r30, -8(rp) C
+ ld r31, 0(rp) C
+ adde r9, r9, r8 C 8 9
+ adde r11, r11, r27 C 27 11
+ addze r12, r26 C 26
+ addc r0, r0, r28 C 0 28
+ std r0, -24(rp) C 0
+ adde r24, r24, r29 C 7 29
+ std r24, -16(rp) C 7
+ adde r9, r9, r30 C 9 30
+ std r9, -8(rp) C 9
+ adde r11, r11, r31 C 11 31
+ std r11, 0(rp) C 11
+ bdnz L(lo_2) C
+
+ ALIGN(16)
+L(end_2):
+ addze r12, r12
+ addic. vn, vn, -1
+ std r12, 8(rp)
+ bne L(outer_lo_2)
+C b L(ret)
+
+L(ret): ld r31, -8(r1)
+ ld r30, -16(r1)
+ ld r29, -24(r1)
+ ld r28, -32(r1)
+ ld r27, -40(r1)
+ ld r26, -48(r1)
+ ld r25, -56(r1)
+ ld r24, -64(r1)
+ ld r23, -72(r1)
+ ld r22, -80(r1)
+ ld r21, -88(r1)
+ ld r20, -96(r1)
+ blr
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/mode64/p7/aormul_2.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/mode64/p7/aormul_2.asm
new file mode 100644
index 00000000000..8731e01a894
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/mode64/p7/aormul_2.asm
@@ -0,0 +1,135 @@
+dnl PowerPC-64 mpn_mul_2 and mpn_addmul_2.
+
+dnl Copyright 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/limb cycles/limb
+C mul_2 addmul_2
+C POWER3/PPC630 ? ?
+C POWER4/PPC970 ? ?
+C POWER5 ? ?
+C POWER6 ? ?
+C POWER7-SMT4 3 3
+C POWER7-SMT2 ? ?
+C POWER7-SMT1 ? ?
+
+C INPUT PARAMETERS
+define(`rp', `r3')
+define(`up', `r4')
+define(`n', `r5')
+define(`vp', `r6')
+
+define(`cy0', `r10')
+ifdef(`EXTRA_REGISTER',
+` define(`cy1', EXTRA_REGISTER)',
+` define(`cy1', `r31')')
+
+ifdef(`OPERATION_mul_2',`
+ define(`AM', `')
+ define(`ADDX', `addc')
+ define(`func', `mpn_mul_2')
+')
+ifdef(`OPERATION_addmul_2',`
+ define(`AM', `$1')
+ define(`ADDX', `adde')
+ define(`func', `mpn_addmul_2')
+')
+
+MULFUNC_PROLOGUE(mpn_mul_2 mpn_addmul_2)
+
+ASM_START()
+PROLOGUE(func)
+
+ifdef(`EXTRA_REGISTER',,`
+ std r31, -8(r1)
+')
+ andi. r12, n, 1
+ addi r0, n, 1
+ srdi r0, r0, 1
+ mtctr r0
+ ld r11, 0(vp) C v0
+ li cy0, 0
+ ld r12, 8(vp) C v1
+ li cy1, 0
+ ld r5, 0(up)
+ beq L(lo0)
+ addi up, up, -8
+ addi rp, rp, -8
+ b L(lo1)
+
+ ALIGN(32)
+L(top):
+AM(` ld r0, -8(rp)')
+ ld r5, 0(up)
+AM(` addc r6, r6, r0')
+ ADDX r7, r7, r8
+ addze r9, r9
+ addc r6, r6, cy0
+ adde cy0, r7, cy1
+ std r6, -8(rp)
+ addze cy1, r9
+L(lo0): mulld r6, r11, r5 C v0 * u[i] weight 0
+ mulhdu r7, r11, r5 C v0 * u[i] weight 1
+ mulld r8, r12, r5 C v1 * u[i] weight 1
+ mulhdu r9, r12, r5 C v1 * u[i] weight 2
+AM(` ld r0, 0(rp)')
+ ld r5, 8(up)
+AM(` addc r6, r6, r0')
+ ADDX r7, r7, r8
+ addze r9, r9
+ addc r6, r6, cy0
+ adde cy0, r7, cy1
+ std r6, 0(rp)
+ addze cy1, r9
+L(lo1): mulld r6, r11, r5 C v0 * u[i] weight 0
+ mulhdu r7, r11, r5 C v0 * u[i] weight 1
+ addi up, up, 16
+ addi rp, rp, 16
+ mulld r8, r12, r5 C v1 * u[i] weight 1
+ mulhdu r9, r12, r5 C v1 * u[i] weight 2
+ bdnz L(top)
+
+L(end):
+AM(` ld r0, -8(rp)')
+AM(` addc r6, r6, r0')
+ ADDX r7, r7, r8
+ addze r9, r9
+ addc r6, r6, cy0
+ std r6, -8(rp)
+ adde cy0, r7, cy1
+ addze cy1, r9
+ std cy0, 0(rp)
+ mr r3, cy1
+
+ifdef(`EXTRA_REGISTER',,`
+ ld r31, -8(r1)
+')
+ blr
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/mode64/p7/aors_n.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/mode64/p7/aors_n.asm
new file mode 100644
index 00000000000..857c701dec3
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/mode64/p7/aors_n.asm
@@ -0,0 +1,128 @@
+dnl PowerPC-64 mpn_add_n, mpn_sub_n optimised for POWER7.
+
+dnl Copyright 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/limb
+C POWER3/PPC630 ?
+C POWER4/PPC970 ?
+C POWER5 ?
+C POWER6 ?
+C POWER7 2.18
+
+C This is a tad bit slower than the cnd_aors_n.asm code, which is of course an
+C anomaly.
+
+ifdef(`OPERATION_add_n',`
+ define(ADDSUBC, adde)
+ define(ADDSUB, addc)
+ define(func, mpn_add_n)
+ define(func_nc, mpn_add_nc)
+ define(GENRVAL, `addi r3, r3, 1')
+ define(SETCBR, `addic r0, $1, -1')
+ define(CLRCB, `addic r0, r0, 0')
+')
+ifdef(`OPERATION_sub_n',`
+ define(ADDSUBC, subfe)
+ define(ADDSUB, subfc)
+ define(func, mpn_sub_n)
+ define(func_nc, mpn_sub_nc)
+ define(GENRVAL, `neg r3, r3')
+ define(SETCBR, `subfic r0, $1, 0')
+ define(CLRCB, `addic r0, r1, -1')
+')
+
+MULFUNC_PROLOGUE(mpn_add_n mpn_add_nc mpn_sub_n mpn_sub_nc)
+
+C INPUT PARAMETERS
+define(`rp', `r3')
+define(`up', `r4')
+define(`vp', `r5')
+define(`n', `r6')
+
+ASM_START()
+PROLOGUE(func_nc)
+ SETCBR(r7)
+ b L(ent)
+EPILOGUE()
+
+PROLOGUE(func)
+ CLRCB
+L(ent):
+ andi. r7, n, 1
+ beq L(bx0)
+
+L(bx1): ld r7, 0(up)
+ ld r9, 0(vp)
+ ADDSUBC r11, r9, r7
+ std r11, 0(rp)
+ cmpldi cr6, n, 1
+ beq cr6, L(end)
+ addi up, up, 8
+ addi vp, vp, 8
+ addi rp, rp, 8
+
+L(bx0): addi r0, n, 2 C compute branch...
+ srdi r0, r0, 2 C ...count
+ mtctr r0
+
+ andi. r7, n, 2
+ bne L(mid)
+
+ addi up, up, 16
+ addi vp, vp, 16
+ addi rp, rp, 16
+
+ ALIGN(32)
+L(top): ld r6, -16(up)
+ ld r7, -8(up)
+ ld r8, -16(vp)
+ ld r9, -8(vp)
+ ADDSUBC r10, r8, r6
+ ADDSUBC r11, r9, r7
+ std r10, -16(rp)
+ std r11, -8(rp)
+L(mid): ld r6, 0(up)
+ ld r7, 8(up)
+ ld r8, 0(vp)
+ ld r9, 8(vp)
+ ADDSUBC r10, r8, r6
+ ADDSUBC r11, r9, r7
+ std r10, 0(rp)
+ std r11, 8(rp)
+ addi up, up, 32
+ addi vp, vp, 32
+ addi rp, rp, 32
+ bdnz L(top)
+
+L(end): subfe r3, r0, r0 C -cy
+ GENRVAL
+ blr
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/mode64/p7/aorsorrlsh1_n.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/mode64/p7/aorsorrlsh1_n.asm
new file mode 100644
index 00000000000..ddf5fd84b10
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/mode64/p7/aorsorrlsh1_n.asm
@@ -0,0 +1,43 @@
+dnl PowerPC-64 mpn_addlsh1_n, mpn_sublsh1_n, mpn_rsblsh1_n.
+
+dnl Copyright 2003, 2005, 2009, 2010, 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')
+
+
+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(`powerpc64/mode64/p7/aorsorrlshC_n.asm')
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/mode64/p7/aorsorrlsh2_n.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/mode64/p7/aorsorrlsh2_n.asm
new file mode 100644
index 00000000000..3f9d88d6ca6
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/mode64/p7/aorsorrlsh2_n.asm
@@ -0,0 +1,43 @@
+dnl PowerPC-64 mpn_addlsh2_n, mpn_sublsh2_n, mpn_rsblsh2_n.
+
+dnl Copyright 2003, 2005, 2009, 2010, 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')
+
+
+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(`powerpc64/mode64/p7/aorsorrlshC_n.asm')
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/mode64/p7/aorsorrlshC_n.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/mode64/p7/aorsorrlshC_n.asm
new file mode 100644
index 00000000000..525120262fc
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/mode64/p7/aorsorrlshC_n.asm
@@ -0,0 +1,129 @@
+dnl PowerPC-64 mpn_addlshC_n, mpn_sublshC_n, mpn_rsblshC_n.
+
+dnl Copyright 2003, 2005, 2009, 2010, 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/.
+
+C cycles/limb
+C POWER3/PPC630 ?
+C POWER4/PPC970 ?
+C POWER5 ?
+C POWER6 ?
+C POWER7 2.5
+
+C INPUT PARAMETERS
+define(`rp', `r3')
+define(`up', `r4')
+define(`vp', `r5')
+define(`n', `r6')
+
+ifdef(`DO_add', `
+ define(`ADDSUBC', `addc $1, $2, $3')
+ define(`ADDSUBE', `adde $1, $2, $3')
+ define(INITCY, `addic $1, r1, 0')
+ define(RETVAL, `addze r3, $1')
+ define(`func', mpn_addlsh`'LSH`'_n)')
+ifdef(`DO_sub', `
+ define(`ADDSUBC', `subfc $1, $2, $3')
+ define(`ADDSUBE', `subfe $1, $2, $3')
+ define(INITCY, `addic $1, r1, -1')
+ define(RETVAL, `subfze r3, $1
+ neg r3, r3')
+ define(`func', mpn_sublsh`'LSH`'_n)')
+ifdef(`DO_rsb', `
+ define(`ADDSUBC', `subfc $1, $3, $2')
+ define(`ADDSUBE', `subfe $1, $3, $2')
+ define(INITCY, `addic $1, r1, -1')
+ define(RETVAL, `addme r3, $1')
+ define(`func', mpn_rsblsh`'LSH`'_n)')
+
+define(`s0', `r0') define(`s1', `r9')
+define(`u0', `r6') define(`u1', `r7')
+define(`v0', `r10') define(`v1', `r11')
+
+
+ASM_START()
+PROLOGUE(func)
+ rldic r7, n, 3, 59
+ add up, up, r7
+ add vp, vp, r7
+ add rp, rp, r7
+
+ifdef(`DO_add', `
+ addic r0, n, 3 C set cy flag as side effect
+',`
+ subfc r0, r0, r0 C set cy flag
+ addi r0, n, 3
+')
+ srdi r0, r0, 2
+ mtctr r0
+
+ andi. r0, n, 1
+ beq L(bx0)
+
+L(bx1): andi. r0, n, 2
+ li s0, 0
+ bne L(lo3)
+ b L(lo1)
+
+L(bx0): andi. r0, n, 2
+ li s1, 0
+ bne L(lo2)
+
+ ALIGN(32)
+L(top): addi rp, rp, 32
+ ld v0, 0(vp)
+ addi vp, vp, 32
+ rldimi s1, v0, LSH, 0
+ ld u0, 0(up)
+ addi up, up, 32
+ srdi s0, v0, RSH
+ ADDSUBE(s1, s1, u0)
+ std s1, -32(rp)
+L(lo3): ld v1, -24(vp)
+ rldimi s0, v1, LSH, 0
+ ld u1, -24(up)
+ srdi s1, v1, RSH
+ ADDSUBE(s0, s0, u1)
+ std s0, -24(rp)
+L(lo2): ld v0, -16(vp)
+ rldimi s1, v0, LSH, 0
+ ld u0, -16(up)
+ srdi s0, v0, RSH
+ ADDSUBE(s1, s1, u0)
+ std s1, -16(rp)
+L(lo1): ld v1, -8(vp)
+ rldimi s0, v1, LSH, 0
+ ld u1, -8(up)
+ srdi s1, v1, RSH
+ ADDSUBE(s0, s0, u1)
+ std s0, -8(rp)
+ bdnz L(top) C decrement CTR and loop back
+
+ RETVAL( s1)
+ blr
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/mode64/p7/gcd_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/mode64/p7/gcd_1.asm
new file mode 100644
index 00000000000..47cb40bdc55
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/mode64/p7/gcd_1.asm
@@ -0,0 +1,110 @@
+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()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/mode64/p7/gmp-mparam.h b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/mode64/p7/gmp-mparam.h
new file mode 100644
index 00000000000..7e719e8aac8
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/mode64/p7/gmp-mparam.h
@@ -0,0 +1,243 @@
+/* POWER7 gmp-mparam.h -- Compiler/machine parameter header file.
+
+Copyright 1991, 1993, 1994, 1999-2003, 2009-2011, 2013, 2014 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
+
+/* 3700 MHz POWER7/SMT4 (gcc111.fsffrance.org) */
+/* FFT tuning limit = 40000000 */
+/* Generated by tuneup.c, 2014-03-13, 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 6
+#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 24
+#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 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 28
+
+#define MUL_TOOM22_THRESHOLD 22
+#define MUL_TOOM33_THRESHOLD 72
+#define MUL_TOOM44_THRESHOLD 200
+#define MUL_TOOM6H_THRESHOLD 298
+#define MUL_TOOM8H_THRESHOLD 406
+
+#define MUL_TOOM32_TO_TOOM43_THRESHOLD 69
+#define MUL_TOOM32_TO_TOOM53_THRESHOLD 140
+#define MUL_TOOM42_TO_TOOM53_THRESHOLD 132
+#define MUL_TOOM42_TO_TOOM63_THRESHOLD 138
+#define MUL_TOOM43_TO_TOOM54_THRESHOLD 124
+
+#define SQR_BASECASE_THRESHOLD 0 /* always (native) */
+#define SQR_TOOM2_THRESHOLD 36
+#define SQR_TOOM3_THRESHOLD 109
+#define SQR_TOOM4_THRESHOLD 196
+#define SQR_TOOM6_THRESHOLD 414
+#define SQR_TOOM8_THRESHOLD 547
+
+#define MULMID_TOOM42_THRESHOLD 58
+
+#define MULMOD_BNM1_THRESHOLD 15
+#define SQRMOD_BNM1_THRESHOLD 20
+
+#define MUL_FFT_MODF_THRESHOLD 412 /* k = 5 */
+#define MUL_FFT_TABLE3 \
+ { { 412, 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}, { 28, 8}, { 15, 7}, { 33, 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}, { 43,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,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, 9}, { 767,13}, { 63,12}, { 127,11}, \
+ { 255,10}, { 511,11}, { 271,10}, { 543, 9}, \
+ { 1087,11}, { 287,10}, { 575,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,12}, \
+ { 287,11}, { 575,10}, { 1151,11}, { 607,12}, \
+ { 319,11}, { 639,10}, { 1279,11}, { 671,12}, \
+ { 351,11}, { 703,12}, { 383,11}, { 767,12}, \
+ { 415,11}, { 831,10}, { 1663,12}, { 447,11}, \
+ { 895,12}, { 479,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,10}, { 2687,12}, { 703,11}, \
+ { 1407,13}, { 383,12}, { 767,11}, { 1535,12}, \
+ { 799,11}, { 1599,12}, { 831,11}, { 1663,13}, \
+ { 447,12}, { 895,11}, { 1791,12}, { 959,11}, \
+ { 1919,14}, { 255,13}, { 511,12}, { 1087,11}, \
+ { 2175,13}, { 575,12}, { 1215,11}, { 2431,13}, \
+ { 639,12}, { 1343,11}, { 2687,13}, { 703,12}, \
+ { 1407,11}, { 2815,14}, { 383,13}, { 767,12}, \
+ { 1599,13}, { 831,12}, { 1663,13}, { 895,12}, \
+ { 1791,13}, { 959,12}, { 1919,11}, { 3839,14}, \
+ { 511,13}, { 1023,12}, { 2047,13}, { 1087,12}, \
+ { 2175,13}, { 1215,12}, { 2431,11}, { 4863,14}, \
+ { 639,13}, { 1279,12}, { 2559,13}, { 1343,12}, \
+ { 2687,13}, { 1407,12}, { 2815,13}, { 1471,12}, \
+ { 2943,14}, { 767,13}, { 1599,12}, { 3199,13}, \
+ { 1663,14}, { 895,13}, { 1791,12}, { 3583,13}, \
+ { 1919,12}, { 3839,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,12}, { 6911,14}, { 1919,13}, { 3839,16}, \
+ { 511,15}, { 1023,14}, { 2175,13}, { 4351,14}, \
+ { 2431,13}, { 4863,15}, { 32768,16}, { 65536,17}, \
+ { 131072,18}, { 262144,19}, { 524288,20}, {1048576,21}, \
+ {2097152,22}, {4194304,23}, {8388608,24} }
+#define MUL_FFT_TABLE3_SIZE 231
+#define MUL_FFT_THRESHOLD 4288
+
+#define SQR_FFT_MODF_THRESHOLD 368 /* k = 5 */
+#define SQR_FFT_TABLE3 \
+ { { 368, 5}, { 19, 6}, { 10, 5}, { 21, 6}, \
+ { 21, 7}, { 11, 6}, { 23, 7}, { 12, 6}, \
+ { 25, 7}, { 15, 6}, { 31, 7}, { 21, 8}, \
+ { 11, 7}, { 25, 8}, { 13, 7}, { 28, 8}, \
+ { 15, 7}, { 32, 8}, { 17, 7}, { 35, 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}, { 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,12}, { 63,11}, { 127,10}, { 255, 9}, \
+ { 511,10}, { 271,11}, { 143,10}, { 287, 9}, \
+ { 575,10}, { 303,11}, { 159,10}, { 319, 9}, \
+ { 639,12}, { 95,11}, { 191,10}, { 383,11}, \
+ { 207,13}, { 63,12}, { 127,11}, { 255,10}, \
+ { 511,11}, { 271,10}, { 543, 9}, { 1087,11}, \
+ { 287,10}, { 575, 9}, { 1151,11}, { 303,10}, \
+ { 607,12}, { 159,11}, { 319,10}, { 639,11}, \
+ { 335,10}, { 671,11}, { 351,10}, { 703,12}, \
+ { 191,11}, { 383,10}, { 767,11}, { 415,10}, \
+ { 831,12}, { 223,11}, { 447,10}, { 895,11}, \
+ { 479,13}, { 127,12}, { 255,11}, { 543,10}, \
+ { 1087,12}, { 287,11}, { 575,10}, { 1151,11}, \
+ { 607,12}, { 319,11}, { 639,10}, { 1279,11}, \
+ { 671,12}, { 351,11}, { 703,13}, { 191,12}, \
+ { 383,11}, { 767,12}, { 415,11}, { 831,10}, \
+ { 1663,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}, \
+ { 703,11}, { 1407,10}, { 2815,13}, { 383,12}, \
+ { 767,11}, { 1535,12}, { 799,11}, { 1599,12}, \
+ { 831,11}, { 1663,13}, { 447,12}, { 895,11}, \
+ { 1791,12}, { 959,11}, { 1919,10}, { 3839,14}, \
+ { 255,13}, { 511,12}, { 1087,13}, { 575,12}, \
+ { 1215,11}, { 2431,13}, { 639,12}, { 1343,11}, \
+ { 2687,13}, { 703,12}, { 1407,14}, { 383,13}, \
+ { 767,12}, { 1599,13}, { 831,12}, { 1663,13}, \
+ { 895,12}, { 1791,13}, { 959,12}, { 1919,14}, \
+ { 511,13}, { 1087,12}, { 2175,13}, { 1151,12}, \
+ { 2303,13}, { 1215,12}, { 2431,14}, { 639,13}, \
+ { 1279,12}, { 2559,13}, { 1343,12}, { 2687,13}, \
+ { 1407,12}, { 2815,13}, { 1471,14}, { 767,13}, \
+ { 1663,12}, { 3327,13}, { 1727,14}, { 895,13}, \
+ { 1791,12}, { 3583,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,14}, { 1791,13}, { 3583,14}, \
+ { 1919,13}, { 3839,16}, { 511,15}, { 1023,14}, \
+ { 2175,13}, { 4479,14}, { 2303,13}, { 4607,14}, \
+ { 2431,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 34
+#define MULLO_MUL_N_THRESHOLD 9174
+
+#define DC_DIV_QR_THRESHOLD 33
+#define DC_DIVAPPR_Q_THRESHOLD 126
+#define DC_BDIV_QR_THRESHOLD 63
+#define DC_BDIV_Q_THRESHOLD 152
+
+#define INV_MULMOD_BNM1_THRESHOLD 54
+#define INV_NEWTON_THRESHOLD 155
+#define INV_APPR_THRESHOLD 125
+
+#define BINV_NEWTON_THRESHOLD 294
+#define REDC_1_TO_REDC_2_THRESHOLD 17
+#define REDC_2_TO_REDC_N_THRESHOLD 115
+
+#define MU_DIV_QR_THRESHOLD 1334
+#define MU_DIVAPPR_Q_THRESHOLD 1334
+#define MUPI_DIV_QR_THRESHOLD 54
+#define MU_BDIV_QR_THRESHOLD 1142
+#define MU_BDIV_Q_THRESHOLD 1470
+
+#define POWM_SEC_TABLE 1,14,62,642,960
+
+#define MATRIX22_STRASSEN_THRESHOLD 14
+#define HGCD_THRESHOLD 126
+#define HGCD_APPR_THRESHOLD 184
+#define HGCD_REDUCE_THRESHOLD 3014
+#define GCD_DC_THRESHOLD 440
+#define GCDEXT_DC_THRESHOLD 386
+#define JACOBI_BASE_METHOD 4
+
+#define GET_STR_DC_THRESHOLD 11
+#define GET_STR_PRECOMPUTE_THRESHOLD 17
+#define SET_STR_DC_THRESHOLD 1655
+#define SET_STR_PRECOMPUTE_THRESHOLD 3417
+
+#define FAC_DSC_THRESHOLD 1138
+#define FAC_ODD_THRESHOLD 27
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/mode64/rsh1aors_n.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/mode64/rsh1aors_n.asm
new file mode 100644
index 00000000000..7f7734bcef7
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/mode64/rsh1aors_n.asm
@@ -0,0 +1,172 @@
+dnl PowerPC-64 mpn_rsh1add_n, mpn_rsh1sub_n
+
+dnl Copyright 2003, 2005, 2010, 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/limb
+C POWER3/PPC630 ?
+C POWER4/PPC970 2.9
+C POWER5 ?
+C POWER6 3.5
+C POWER7 2.25
+
+define(`rp', `r3')
+define(`up', `r4')
+define(`vp', `r5')
+define(`n', `r6')
+
+ifdef(`OPERATION_rsh1add_n', `
+ define(`ADDSUBC', `addc')
+ define(`ADDSUBE', `adde')
+ define(INITCY, `addic $1, r1, 0')
+ define(`func', mpn_rsh1add_n)')
+ifdef(`OPERATION_rsh1sub_n', `
+ define(`ADDSUBC', `subfc')
+ define(`ADDSUBE', `subfe')
+ define(INITCY, `addic $1, r1, -1')
+ define(`func', mpn_rsh1sub_n)')
+
+define(`s0', `r9')
+define(`s1', `r7')
+define(`x0', `r0')
+define(`x1', `r12')
+define(`u0', `r8')
+define(`v0', `r10')
+
+
+ASM_START()
+PROLOGUE(func)
+ ld u0, 0(up)
+ ld v0, 0(vp)
+
+ cmpdi cr6, n, 2
+
+ addi r0, n, 1
+ srdi r0, r0, 2
+ mtctr r0 C copy size to count register
+
+ andi. r0, n, 1
+ bne cr0, L(bx1)
+
+L(bx0): ADDSUBC x1, v0, u0
+ ld u0, 8(up)
+ ld v0, 8(vp)
+ ADDSUBE x0, v0, u0
+ ble cr6, L(n2)
+ ld u0, 16(up)
+ ld v0, 16(vp)
+ srdi s0, x1, 1
+ rldicl r11, x1, 0, 63 C return value
+ ADDSUBE x1, v0, u0
+ andi. n, n, 2
+ bne cr0, L(b10)
+L(b00): addi rp, rp, -24
+ b L(lo0)
+L(b10): addi up, up, 16
+ addi vp, vp, 16
+ addi rp, rp, -8
+ b L(lo2)
+
+ ALIGN(16)
+L(bx1): ADDSUBC x0, v0, u0
+ ble cr6, L(n1)
+ ld u0, 8(up)
+ ld v0, 8(vp)
+ ADDSUBE x1, v0, u0
+ ld u0, 16(up)
+ ld v0, 16(vp)
+ srdi s1, x0, 1
+ rldicl r11, x0, 0, 63 C return value
+ ADDSUBE x0, v0, u0
+ andi. n, n, 2
+ bne cr0, L(b11)
+L(b01): addi up, up, 8
+ addi vp, vp, 8
+ addi rp, rp, -16
+ b L(lo1)
+L(b11): addi up, up, 24
+ addi vp, vp, 24
+ bdz L(end)
+
+ ALIGN(32)
+L(top): ld u0, 0(up)
+ ld v0, 0(vp)
+ srdi s0, x1, 1
+ rldimi s1, x1, 63, 0
+ std s1, 0(rp)
+ ADDSUBE x1, v0, u0
+L(lo2): ld u0, 8(up)
+ ld v0, 8(vp)
+ srdi s1, x0, 1
+ rldimi s0, x0, 63, 0
+ std s0, 8(rp)
+ ADDSUBE x0, v0, u0
+L(lo1): ld u0, 16(up)
+ ld v0, 16(vp)
+ srdi s0, x1, 1
+ rldimi s1, x1, 63, 0
+ std s1, 16(rp)
+ ADDSUBE x1, v0, u0
+L(lo0): ld u0, 24(up)
+ ld v0, 24(vp)
+ srdi s1, x0, 1
+ rldimi s0, x0, 63, 0
+ std s0, 24(rp)
+ ADDSUBE x0, v0, u0
+ addi up, up, 32
+ addi vp, vp, 32
+ addi rp, rp, 32
+ bdnz L(top)
+
+L(end): srdi s0, x1, 1
+ rldimi s1, x1, 63, 0
+ std s1, 0(rp)
+L(cj2): srdi s1, x0, 1
+ rldimi s0, x0, 63, 0
+ std s0, 8(rp)
+L(cj1): ADDSUBE x1, x1, x1 C pseudo-depends on x1
+ rldimi s1, x1, 63, 0
+ std s1, 16(rp)
+ mr r3, r11
+ blr
+
+L(n1): srdi s1, x0, 1
+ rldicl r11, x0, 0, 63 C return value
+ ADDSUBE x1, x1, x1 C pseudo-depends on x1
+ rldimi s1, x1, 63, 0
+ std s1, 0(rp)
+ mr r3, r11
+ blr
+
+L(n2): addi rp, rp, -8
+ srdi s0, x1, 1
+ rldicl r11, x1, 0, 63 C return value
+ b L(cj2)
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/mode64/sqr_basecase.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/mode64/sqr_basecase.asm
new file mode 100644
index 00000000000..e76bb8878d8
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/mode64/sqr_basecase.asm
@@ -0,0 +1,863 @@
+dnl PowerPC-64 mpn_sqr_basecase.
+
+dnl Contributed to the GNU project by Torbjorn Granlund.
+
+dnl Copyright 1999-2001, 2003-2006, 2008, 2010, 2011 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 6-18
+C POWER4/PPC970 8
+C POWER5 8
+C POWER6 16.25
+C POWER7 3.77
+
+C NOTES
+C * This is very crude, cleanup!
+C * Try to reduce the number of needed live registers.
+C * Rewrite for POWER6 to use 8 consecutive muls, not 2 groups of 4. The
+C cost will be more live registers.
+C * Rewrite for POWER7 to use addmul_2 building blocks; this will reduce code
+C size a lot and speed things up perhaps 25%.
+C * Use computed goto in order to compress the code.
+C * Implement a larger final corner.
+C * Schedule callee-saves register saves into other insns. This could save
+C about 5 cycles/call. (We cannot analogously optimise the restores, since
+C the sqr_diag_addlsh1 loop has no wind-down code as currently written.)
+C * Should the alternating std/adde sequences be split? Some pipelines handle
+C adde poorly, and might sequentialise all these instructions.
+C * The sqr_diag_addlsh1 loop was written for POWER6 and its preferences for
+C adjacent integer multiply insns. Except for the multiply insns, the code
+C was not carefully optimised for POWER6 or any other CPU.
+C * Perform cross-jumping in sqr_diag_addlsh1's feed-in code, into the loop.
+
+C INPUT PARAMETERS
+define(`rp', `r3')
+define(`up', `r4')
+define(`n', `r5')
+
+define(`rp_outer', `r25')
+define(`up_outer', `r21')
+define(`rp_saved', `r22')
+define(`up_saved', `r23')
+define(`n_saved', `r24')
+
+ASM_START()
+PROLOGUE(mpn_sqr_basecase)
+ cmpdi cr0, n, 2
+ bge cr0, L(ge2)
+ ld r5, 0(up) C n = 1
+ nop
+ mulld r8, r5, r5 C weight 0
+ mulhdu r9, r5, r5 C weight 1
+ std r8, 0(rp)
+ std r9, 8(rp)
+ blr
+ ALIGN(16)
+L(ge2): bgt cr0, L(gt2)
+ ld r0, 0(up) C n = 2
+ nop
+ mulld r8, r0, r0 C u0 * u0
+ mulhdu r9, r0, r0 C u0 * u0
+ 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 r8, 0(rp)
+ std r9, 8(rp)
+ std r10, 16(rp)
+ std r11, 24(rp)
+ blr
+
+ ALIGN(16)
+L(gt2): std r31, -8(r1)
+ std r30, -16(r1)
+ std r29, -24(r1)
+ std r28, -32(r1)
+ std r27, -40(r1)
+ std r26, -48(r1)
+ std r25, -56(r1)
+ std r24, -64(r1)
+ std r23, -72(r1)
+ std r22, -80(r1)
+ std r21, -88(r1)
+
+ mr rp_saved, rp
+ mr up_saved, up
+ mr n_saved, n
+ mr rp_outer, rp
+ mr up_outer, up
+
+ rldicl. r0, n, 0,62 C r0 = n & 3, set cr0
+ cmpdi cr6, r0, 2
+ addic r7, n, 2 C compute count...
+ srdi r7, r7, 2 C ...for ctr
+ mtctr r7 C copy count into ctr
+ beq- cr0, L(b0)
+ blt- cr6, L(b1)
+ beq- cr6, L(b2)
+
+L(b3): ld r6, 0(up)
+ ld r9, 8(up)
+ ld r27, 16(up)
+ addi up, up, 24
+ li r12, 0 C carry limb
+ bdz L(em3)
+
+ ALIGN(16)
+L(tm3): mulld r0, r9, r6
+ mulhdu r26, r9, r6
+ mulld r7, r27, r6
+ mulhdu r8, r27, r6
+ ld r9, 0(up)
+ ld r27, 8(up)
+ adde r0, r0, r12
+ adde r7, r7, r26
+ mulld r26, r9, r6
+ mulhdu r10, r9, r6
+ mulld r11, r27, r6
+ mulhdu r12, r27, r6
+ ld r9, 16(up)
+ ld r27, 24(up)
+ std r0, 8(rp)
+ adde r26, r26, r8
+ std r7, 16(rp)
+ adde r11, r11, r10
+ std r26, 24(rp)
+ addi up, up, 32
+ std r11, 32(rp)
+ addi rp, rp, 32
+ bdnz L(tm3)
+
+L(em3): mulld r0, r9, r6
+ mulhdu r26, r9, r6
+ mulld r7, r27, r6
+ mulhdu r8, r27, r6
+ adde r0, r0, r12
+ adde r7, r7, r26
+ std r0, 8(rp)
+ std r7, 16(rp)
+ addze r8, r8
+ std r8, 24(rp)
+ addi n, n, 2
+ b L(outer_loop)
+
+L(b0): ld r6, 0(up)
+ ld r27, 8(up)
+ mulld r7, r27, r6
+ mulhdu r12, r27, r6
+ std r7, 8(rp)
+ addi rp, rp, 8
+ ld r9, 16(up)
+ ld r27, 24(up)
+ addi up, up, 32
+ bdz L(em0)
+
+ ALIGN(16)
+L(tm0): mulld r0, r9, r6
+ mulhdu r26, r9, r6
+ mulld r7, r27, r6
+ mulhdu r8, r27, r6
+ ld r9, 0(up)
+ ld r27, 8(up)
+ adde r0, r0, r12
+ adde r7, r7, r26
+ mulld r26, r9, r6
+ mulhdu r10, r9, r6
+ mulld r11, r27, r6
+ mulhdu r12, r27, r6
+ ld r9, 16(up)
+ ld r27, 24(up)
+ std r0, 8(rp)
+ adde r26, r26, r8
+ std r7, 16(rp)
+ adde r11, r11, r10
+ std r26, 24(rp)
+ addi up, up, 32
+ std r11, 32(rp)
+ addi rp, rp, 32
+ bdnz L(tm0)
+
+L(em0): mulld r0, r9, r6
+ mulhdu r26, r9, r6
+ mulld r7, r27, r6
+ mulhdu r8, r27, r6
+ adde r0, r0, r12
+ adde r7, r7, r26
+ std r0, 8(rp)
+ std r7, 16(rp)
+ addze r8, r8
+ std r8, 24(rp)
+ addi n, n, 2
+ b L(outer_loop_ent_2)
+
+L(b1): ld r6, 0(up)
+ ld r9, 8(up)
+ ld r27, 16(up)
+ mulld r0, r9, r6
+ mulhdu r26, r9, r6
+ mulld r7, r27, r6
+ mulhdu r12, r27, r6
+ addc r7, r7, r26
+ std r0, 8(rp)
+ std r7, 16(rp)
+ addi rp, rp, 16
+ ld r9, 24(up)
+ ld r27, 32(up)
+ addi up, up, 40
+ bdz L(em1)
+
+ ALIGN(16)
+L(tm1): mulld r0, r9, r6
+ mulhdu r26, r9, r6
+ mulld r7, r27, r6
+ mulhdu r8, r27, r6
+ ld r9, 0(up)
+ ld r27, 8(up)
+ adde r0, r0, r12
+ adde r7, r7, r26
+ mulld r26, r9, r6
+ mulhdu r10, r9, r6
+ mulld r11, r27, r6
+ mulhdu r12, r27, r6
+ ld r9, 16(up)
+ ld r27, 24(up)
+ std r0, 8(rp)
+ adde r26, r26, r8
+ std r7, 16(rp)
+ adde r11, r11, r10
+ std r26, 24(rp)
+ addi up, up, 32
+ std r11, 32(rp)
+ addi rp, rp, 32
+ bdnz L(tm1)
+
+L(em1): mulld r0, r9, r6
+ mulhdu r26, r9, r6
+ mulld r7, r27, r6
+ mulhdu r8, r27, r6
+ adde r0, r0, r12
+ adde r7, r7, r26
+ std r0, 8(rp)
+ std r7, 16(rp)
+ addze r8, r8
+ std r8, 24(rp)
+ addi n, n, 2
+ b L(outer_loop_ent_3)
+
+L(b2): addi r7, r7, -1 C FIXME
+ mtctr r7 C FIXME
+ ld r6, 0(up)
+ ld r9, 8(up)
+ ld r27, 16(up)
+ mulld r0, r9, r6
+ mulhdu r26, r9, r6
+ mulld r7, r27, r6
+ mulhdu r8, r27, r6
+ ld r9, 24(up)
+ mulld r11, r9, r6
+ mulhdu r10, r9, r6
+ addc r7, r7, r26
+ adde r11, r11, r8
+ addze r12, r10
+ std r0, 8(rp)
+ std r7, 16(rp)
+ std r11, 24(rp)
+ addi rp, rp, 24
+ ld r9, 32(up)
+ ld r27, 40(up)
+ addi up, up, 48
+ bdz L(em2)
+
+ ALIGN(16)
+L(tm2): mulld r0, r9, r6
+ mulhdu r26, r9, r6
+ mulld r7, r27, r6
+ mulhdu r8, r27, r6
+ ld r9, 0(up)
+ ld r27, 8(up)
+ adde r0, r0, r12
+ adde r7, r7, r26
+ mulld r26, r9, r6
+ mulhdu r10, r9, r6
+ mulld r11, r27, r6
+ mulhdu r12, r27, r6
+ ld r9, 16(up)
+ ld r27, 24(up)
+ std r0, 8(rp)
+ adde r26, r26, r8
+ std r7, 16(rp)
+ adde r11, r11, r10
+ std r26, 24(rp)
+ addi up, up, 32
+ std r11, 32(rp)
+ addi rp, rp, 32
+ bdnz L(tm2)
+
+L(em2): mulld r0, r9, r6
+ mulhdu r26, r9, r6
+ mulld r7, r27, r6
+ mulhdu r8, r27, r6
+ adde r0, r0, r12
+ adde r7, r7, r26
+ std r0, 8(rp)
+ std r7, 16(rp)
+ addze r8, r8
+ std r8, 24(rp)
+ addi n, n, 2
+ b L(outer_loop_ent_0)
+
+
+L(outer_loop):
+ addi n, n, -1
+ addi up_outer, up_outer, 8
+ addi rp_outer, rp_outer, 16
+
+ mr up, up_outer
+ addi rp, rp_outer, 8
+
+ srdi r0, n, 2
+ mtctr r0
+
+ bdz L(outer_end)
+
+ ld r6, 0(up)
+ ld r9, 8(up)
+ ld r27, 16(up)
+ mulld r0, r9, r6
+ mulhdu r26, r9, r6
+ mulld r7, r27, r6
+ mulhdu r8, r27, r6
+ ld r9, 24(up)
+ ld r28, 0(rp)
+ ld r29, 8(rp)
+ ld r30, 16(rp)
+ mulld r11, r9, r6
+ mulhdu r10, r9, r6
+ addc r7, r7, r26
+ adde r11, r11, r8
+ addze r12, r10
+ addc r0, r0, r28
+ std r0, 0(rp)
+ adde r7, r7, r29
+ std r7, 8(rp)
+ adde r11, r11, r30
+ std r11, 16(rp)
+ addi rp, rp, 24
+ ld r9, 32(up)
+ ld r27, 40(up)
+ addi up, up, 48
+ bdz L(ea1)
+
+ ALIGN(16)
+L(ta1): mulld r0, r9, r6
+ mulhdu r26, r9, r6 C 9
+ mulld r7, r27, r6
+ mulhdu r8, r27, r6 C 27
+ ld r9, 0(up)
+ ld r28, 0(rp)
+ ld r27, 8(up)
+ ld r29, 8(rp)
+ adde r0, r0, r12 C 0 12
+ adde r7, r7, r26 C 5 7
+ mulld r26, r9, r6
+ mulhdu r10, r9, r6 C 9
+ mulld r11, r27, r6
+ mulhdu r12, r27, r6 C 27
+ ld r9, 16(up)
+ ld r30, 16(rp)
+ ld r27, 24(up)
+ ld r31, 24(rp)
+ adde r26, r26, r8 C 8 5
+ adde r11, r11, r10 C 10 11
+ addze r12, r12 C 12
+ addc r0, r0, r28 C 0 28
+ std r0, 0(rp) C 0
+ adde r7, r7, r29 C 7 29
+ std r7, 8(rp) C 7
+ adde r26, r26, r30 C 5 30
+ std r26, 16(rp) C 5
+ adde r11, r11, r31 C 11 31
+ std r11, 24(rp) C 11
+ addi up, up, 32
+ addi rp, rp, 32
+ bdnz L(ta1)
+
+L(ea1): mulld r0, r9, r6
+ mulhdu r26, r9, r6
+ mulld r7, r27, r6
+ mulhdu r8, r27, r6
+ ld r28, 0(rp)
+ ld r29, 8(rp)
+ adde r0, r0, r12
+ adde r7, r7, r26
+ addze r8, r8
+ addc r0, r0, r28
+ std r0, 0(rp)
+ adde r7, r7, r29
+ std r7, 8(rp)
+ addze r8, r8
+ std r8, 16(rp)
+
+L(outer_loop_ent_0):
+ addi n, n, -1
+ addi up_outer, up_outer, 8
+ addi rp_outer, rp_outer, 16
+
+ mr up, up_outer
+ addi rp, rp_outer, 8
+
+ srdi r0, n, 2
+ mtctr r0
+
+ ld r6, 0(up)
+ ld r9, 8(up)
+ ld r27, 16(up)
+ ld r28, 0(rp)
+ ld r29, 8(rp)
+ mulld r0, r9, r6
+ mulhdu r26, r9, r6
+ mulld r7, r27, r6
+ mulhdu r8, r27, r6
+ addc r0, r0, r28
+ adde r7, r7, r26
+ addze r12, r8
+ std r0, 0(rp)
+ adde r7, r7, r29
+ std r7, 8(rp)
+ addi rp, rp, 16
+ ld r9, 24(up)
+ ld r27, 32(up)
+ addi up, up, 40
+ bdz L(ea0)
+
+ ALIGN(16)
+L(ta0): mulld r0, r9, r6
+ mulhdu r26, r9, r6 C 9
+ mulld r7, r27, r6
+ mulhdu r8, r27, r6 C 27
+ ld r9, 0(up)
+ ld r28, 0(rp)
+ ld r27, 8(up)
+ ld r29, 8(rp)
+ adde r0, r0, r12 C 0 12
+ adde r7, r7, r26 C 5 7
+ mulld r26, r9, r6
+ mulhdu r10, r9, r6 C 9
+ mulld r11, r27, r6
+ mulhdu r12, r27, r6 C 27
+ ld r9, 16(up)
+ ld r30, 16(rp)
+ ld r27, 24(up)
+ ld r31, 24(rp)
+ adde r26, r26, r8 C 8 5
+ adde r11, r11, r10 C 10 11
+ addze r12, r12 C 12
+ addc r0, r0, r28 C 0 28
+ std r0, 0(rp) C 0
+ adde r7, r7, r29 C 7 29
+ std r7, 8(rp) C 7
+ adde r26, r26, r30 C 5 30
+ std r26, 16(rp) C 5
+ adde r11, r11, r31 C 11 31
+ std r11, 24(rp) C 11
+ addi up, up, 32
+ addi rp, rp, 32
+ bdnz L(ta0)
+
+L(ea0): mulld r0, r9, r6
+ mulhdu r26, r9, r6
+ mulld r7, r27, r6
+ mulhdu r8, r27, r6
+ ld r28, 0(rp)
+ ld r29, 8(rp)
+ adde r0, r0, r12
+ adde r7, r7, r26
+ addze r8, r8
+ addc r0, r0, r28
+ std r0, 0(rp)
+ adde r7, r7, r29
+ std r7, 8(rp)
+ addze r8, r8
+ std r8, 16(rp)
+
+L(outer_loop_ent_3):
+ addi n, n, -1
+ addi up_outer, up_outer, 8
+ addi rp_outer, rp_outer, 16
+
+ mr up, up_outer
+ addi rp, rp_outer, 8
+
+ srdi r0, n, 2
+ mtctr r0
+
+ ld r6, 0(up)
+ ld r9, 8(up)
+ ld r28, 0(rp)
+ mulld r0, r9, r6
+ mulhdu r12, r9, r6
+ addc r0, r0, r28
+ std r0, 0(rp)
+ addi rp, rp, 8
+ ld r9, 16(up)
+ ld r27, 24(up)
+ addi up, up, 32
+ bdz L(ea3)
+
+ ALIGN(16)
+L(ta3): mulld r0, r9, r6
+ mulhdu r26, r9, r6 C 9
+ mulld r7, r27, r6
+ mulhdu r8, r27, r6 C 27
+ ld r9, 0(up)
+ ld r28, 0(rp)
+ ld r27, 8(up)
+ ld r29, 8(rp)
+ adde r0, r0, r12 C 0 12
+ adde r7, r7, r26 C 5 7
+ mulld r26, r9, r6
+ mulhdu r10, r9, r6 C 9
+ mulld r11, r27, r6
+ mulhdu r12, r27, r6 C 27
+ ld r9, 16(up)
+ ld r30, 16(rp)
+ ld r27, 24(up)
+ ld r31, 24(rp)
+ adde r26, r26, r8 C 8 5
+ adde r11, r11, r10 C 10 11
+ addze r12, r12 C 12
+ addc r0, r0, r28 C 0 28
+ std r0, 0(rp) C 0
+ adde r7, r7, r29 C 7 29
+ std r7, 8(rp) C 7
+ adde r26, r26, r30 C 5 30
+ std r26, 16(rp) C 5
+ adde r11, r11, r31 C 11 31
+ std r11, 24(rp) C 11
+ addi up, up, 32
+ addi rp, rp, 32
+ bdnz L(ta3)
+
+L(ea3): mulld r0, r9, r6
+ mulhdu r26, r9, r6
+ mulld r7, r27, r6
+ mulhdu r8, r27, r6
+ ld r28, 0(rp)
+ ld r29, 8(rp)
+ adde r0, r0, r12
+ adde r7, r7, r26
+ addze r8, r8
+ addc r0, r0, r28
+ std r0, 0(rp)
+ adde r7, r7, r29
+ std r7, 8(rp)
+ addze r8, r8
+ std r8, 16(rp)
+
+
+L(outer_loop_ent_2):
+ addi n, n, -1
+ addi up_outer, up_outer, 8
+ addi rp_outer, rp_outer, 16
+
+ mr up, up_outer
+ addi rp, rp_outer, 8
+
+ srdi r0, n, 2
+ mtctr r0
+
+ addic r0, r0, 0
+ li r12, 0 C cy_limb = 0
+ ld r6, 0(up)
+ ld r9, 8(up)
+ ld r27, 16(up)
+ bdz L(ea2)
+ addi up, up, 24
+
+ ALIGN(16)
+L(ta2): mulld r0, r9, r6
+ mulhdu r26, r9, r6 C 9
+ mulld r7, r27, r6
+ mulhdu r8, r27, r6 C 27
+ ld r9, 0(up)
+ ld r28, 0(rp)
+ ld r27, 8(up)
+ ld r29, 8(rp)
+ adde r0, r0, r12 C 0 12
+ adde r7, r7, r26 C 5 7
+ mulld r26, r9, r6
+ mulhdu r10, r9, r6 C 9
+ mulld r11, r27, r6
+ mulhdu r12, r27, r6 C 27
+ ld r9, 16(up)
+ ld r30, 16(rp)
+ ld r27, 24(up)
+ ld r31, 24(rp)
+ adde r26, r26, r8 C 8 5
+ adde r11, r11, r10 C 10 11
+ addze r12, r12 C 12
+ addc r0, r0, r28 C 0 28
+ std r0, 0(rp) C 0
+ adde r7, r7, r29 C 7 29
+ std r7, 8(rp) C 7
+ adde r26, r26, r30 C 5 30
+ std r26, 16(rp) C 5
+ adde r11, r11, r31 C 11 31
+ std r11, 24(rp) C 11
+ addi up, up, 32
+ addi rp, rp, 32
+ bdnz L(ta2)
+
+L(ea2): mulld r0, r9, r6
+ mulhdu r26, r9, r6
+ mulld r7, r27, r6
+ mulhdu r8, r27, r6
+ ld r28, 0(rp)
+ ld r29, 8(rp)
+ adde r0, r0, r12
+ adde r7, r7, r26
+ addze r8, r8
+ addc r0, r0, r28
+ std r0, 0(rp)
+ adde r7, r7, r29
+ std r7, 8(rp)
+ addze r8, r8
+ std r8, 16(rp)
+
+ b L(outer_loop)
+
+L(outer_end):
+ ld r6, 0(up)
+ ld r9, 8(up)
+ ld r11, 0(rp)
+ mulld r0, r9, r6
+ mulhdu r8, r9, r6
+ addc r0, r0, r11
+ std r0, 0(rp)
+ addze r8, r8
+ std r8, 8(rp)
+
+define(`rp', `rp_saved')
+define(`up', `r5')
+define(`n', `r6')
+define(`climb', `r0')
+
+ addi r4, rp_saved, 8
+ mr r5, up_saved
+ mr r6, n_saved
+
+ rldicl. r0, n, 0,62 C r0 = n & 3, set cr0
+ cmpdi cr6, r0, 2
+ addi n, n, 2 C compute count...
+ srdi n, n, 2 C ...for ctr
+ mtctr n C put loop count into ctr
+ beq cr0, L(xb0)
+ blt cr6, L(xb1)
+ beq cr6, L(xb2)
+
+L(xb3): ld r6, 0(up)
+ ld r7, 8(up)
+ ld r12, 16(up)
+ addi up, up, 24
+ mulld r24, r6, r6
+ mulhdu r25, r6, r6
+ mulld r26, r7, r7
+ mulhdu r27, r7, r7
+ mulld r28, r12, r12
+ mulhdu r29, r12, r12
+ ld r10, 8(rp)
+ ld r11, 16(rp)
+ ld r6, 24(rp)
+ ld r7, 32(rp)
+ addc r10, r10, r10
+ adde r11, r11, r11
+ adde r6, r6, r6
+ adde r7, r7, r7
+ addze climb, r29
+ addc r10, r10, r25
+ adde r11, r11, r26
+ adde r6, r6, r27
+ adde r7, r7, r28
+ std r24, 0(rp)
+ std r10, 8(rp)
+ std r11, 16(rp)
+ std r6, 24(rp)
+ std r7, 32(rp)
+ addi rp, rp, 40
+ bdnz L(top)
+ b L(end)
+
+L(xb2): ld r6, 0(up)
+ ld r7, 8(up)
+ addi up, up, 16
+ mulld r24, r6, r6
+ mulhdu r25, r6, r6
+ mulld r26, r7, r7
+ mulhdu r27, r7, r7
+ ld r10, 8(rp)
+ ld r11, 16(rp)
+ addc r10, r10, r10
+ adde r11, r11, r11
+ addze climb, r27
+ addc r10, r10, r25
+ adde r11, r11, r26
+ std r24, 0(rp)
+ std r10, 8(rp)
+ std r11, 16(rp)
+ addi rp, rp, 24
+ bdnz L(top)
+ b L(end)
+
+L(xb0): ld r6, 0(up)
+ ld r7, 8(up)
+ ld r12, 16(up)
+ ld r23, 24(up)
+ addi up, up, 32
+ mulld r24, r6, r6
+ mulhdu r25, r6, r6
+ mulld r26, r7, r7
+ mulhdu r27, r7, r7
+ mulld r28, r12, r12
+ mulhdu r29, r12, r12
+ mulld r30, r23, r23
+ mulhdu r31, r23, r23
+ ld r10, 8(rp)
+ ld r11, 16(rp)
+ ld r6, 24(rp)
+ ld r7, 32(rp)
+ ld r12, 40(rp)
+ ld r23, 48(rp)
+ addc r10, r10, r10
+ adde r11, r11, r11
+ adde r6, r6, r6
+ adde r7, r7, r7
+ adde r12, r12, r12
+ adde r23, r23, r23
+ addze climb, r31
+ std r24, 0(rp)
+ addc r10, r10, r25
+ std r10, 8(rp)
+ adde r11, r11, r26
+ std r11, 16(rp)
+ adde r6, r6, r27
+ std r6, 24(rp)
+ adde r7, r7, r28
+ std r7, 32(rp)
+ adde r12, r12, r29
+ std r12, 40(rp)
+ adde r23, r23, r30
+ std r23, 48(rp)
+ addi rp, rp, 56
+ bdnz L(top)
+ b L(end)
+
+L(xb1): ld r6, 0(up)
+ addi up, up, 8
+ mulld r24, r6, r6
+ mulhdu climb, r6, r6
+ std r24, 0(rp)
+ addic rp, rp, 8 C clear carry as side-effect
+
+ ALIGN(32)
+L(top): ld r6, 0(up)
+ ld r7, 8(up)
+ ld r12, 16(up)
+ ld r23, 24(up)
+ addi up, up, 32
+ mulld r24, r6, r6
+ mulhdu r25, r6, r6
+ mulld r26, r7, r7
+ mulhdu r27, r7, r7
+ mulld r28, r12, r12
+ mulhdu r29, r12, r12
+ mulld r30, r23, r23
+ mulhdu r31, r23, r23
+ ld r8, 0(rp)
+ ld r9, 8(rp)
+ adde r8, r8, r8
+ adde r9, r9, r9
+ ld r10, 16(rp)
+ ld r11, 24(rp)
+ adde r10, r10, r10
+ adde r11, r11, r11
+ ld r6, 32(rp)
+ ld r7, 40(rp)
+ adde r6, r6, r6
+ adde r7, r7, r7
+ ld r12, 48(rp)
+ ld r23, 56(rp)
+ adde r12, r12, r12
+ adde r23, r23, r23
+ addze r31, r31
+ addc r8, r8, climb
+ std r8, 0(rp)
+ adde r9, r9, r24
+ std r9, 8(rp)
+ adde r10, r10, r25
+ std r10, 16(rp)
+ adde r11, r11, r26
+ std r11, 24(rp)
+ adde r6, r6, r27
+ std r6, 32(rp)
+ adde r7, r7, r28
+ std r7, 40(rp)
+ adde r12, r12, r29
+ std r12, 48(rp)
+ adde r23, r23, r30
+ std r23, 56(rp)
+ mr climb, r31
+ addi rp, rp, 64
+ bdnz L(top)
+
+L(end): addze climb, climb
+ std climb, 0(rp)
+
+ ld r31, -8(r1)
+ ld r30, -16(r1)
+ ld r29, -24(r1)
+ ld r28, -32(r1)
+ ld r27, -40(r1)
+ ld r26, -48(r1)
+ ld r25, -56(r1)
+ ld r24, -64(r1)
+ ld r23, -72(r1)
+ ld r22, -80(r1)
+ ld r21, -88(r1)
+ blr
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/p6/lshift.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/p6/lshift.asm
new file mode 100644
index 00000000000..1a200fb3463
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/p6/lshift.asm
@@ -0,0 +1,132 @@
+dnl PowerPC-64 mpn_lshift -- rp[] = up[] << cnt
+
+dnl Copyright 2003, 2005, 2010, 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/limb
+C POWER3/PPC630 ?
+C POWER4/PPC970 ?
+C POWER5 2.25
+C POWER6 4
+
+C TODO
+C * Micro-optimise header code
+C * Perhaps do 4-way unrolling, for 2.5 c/l on POWER6. The code is 4236
+C bytes, 4-way code would become about 50% larger.
+
+C INPUT PARAMETERS
+define(`rp_param', `r3')
+define(`up', `r4')
+define(`n', `r5')
+define(`cnt', `r6')
+
+define(`tnc',`r0')
+define(`retval',`r3')
+define(`rp', `r7')
+
+ASM_START()
+PROLOGUE(mpn_lshift,toc)
+
+ifdef(`HAVE_ABI_mode32',`
+ rldicl n, n, 0,32 C FIXME: avoid this zero extend
+')
+ mflr r12
+ sldi r8, n, 3
+ sldi r10, cnt, 6 C multiply cnt by size of a SHIFT block
+ LEAL( r11, L(e1)) C address of L(e1) label in SHIFT(1)
+ add up, up, r8 C make up point at end of up[]
+ add r11, r11, r10 C address of L(oN) for N = cnt
+ srdi r10, n, 1
+ add rp, rp_param, r8 C make rp point at end of rp[]
+ subfic tnc, cnt, 64
+ rlwinm. r8, n, 0,31,31 C extract bit 0
+ mtctr r10
+ beq L(evn)
+
+L(odd): ld r9, -8(up)
+ cmpdi cr0, n, 1 C n = 1?
+ beq L(1)
+ ld r8, -16(up)
+ addi r11, r11, -84 C L(o1) - L(e1) - 64
+ mtlr r11
+ srd r3, r9, tnc C retval
+ addi up, up, 8
+ addi rp, rp, -8
+ blr C branch to L(oN)
+
+L(evn): ld r8, -8(up)
+ ld r9, -16(up)
+ addi r11, r11, -64
+ mtlr r11
+ srd r3, r8, tnc C retval
+ blr C branch to L(eN)
+
+L(1): srd r3, r9, tnc C retval
+ sld r8, r9, cnt
+ std r8, -8(rp)
+ mtlr r12
+ifdef(`HAVE_ABI_mode32',
+` mr r4, r3
+ srdi r3, r3, 32
+')
+ blr
+
+
+define(SHIFT,`
+L(lo$1):ld r8, -24(up)
+ std r11, -8(rp)
+ addi rp, rp, -16
+L(o$1): srdi r10, r8, eval(64-$1)
+ rldimi r10, r9, $1, 0
+ ld r9, -32(up)
+ addi up, up, -16
+ std r10, 0(rp)
+L(e$1): srdi r11, r9, eval(64-$1)
+ rldimi r11, r8, $1, 0
+ bdnz L(lo$1)
+ std r11, -8(rp)
+ sldi r10, r9, $1
+ b L(com)
+ nop
+ nop
+')
+
+ ALIGN(64)
+forloop(`i',1,63,`SHIFT(i)')
+
+L(com): std r10, -16(rp)
+ mtlr r12
+ifdef(`HAVE_ABI_mode32',
+` mr r4, r3
+ srdi r3, r3, 32
+')
+ blr
+EPILOGUE()
+ASM_END()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/p6/lshiftc.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/p6/lshiftc.asm
new file mode 100644
index 00000000000..e4b3caaab8a
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/p6/lshiftc.asm
@@ -0,0 +1,136 @@
+dnl PowerPC-64 mpn_lshiftc -- rp[] = ~up[] << cnt
+
+dnl Copyright 2003, 2005, 2010, 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/limb
+C POWER3/PPC630 ?
+C POWER4/PPC970 ?
+C POWER5 2.25
+C POWER6 4
+
+C TODO
+C * Micro-optimise header code
+C * Perhaps do 4-way unrolling, for 2.5 c/l on POWER6. The code is 4236
+C bytes, 4-way code would become about 50% larger.
+
+C INPUT PARAMETERS
+define(`rp_param', `r3')
+define(`up', `r4')
+define(`n', `r5')
+define(`cnt', `r6')
+
+define(`tnc',`r0')
+define(`retval',`r3')
+define(`rp', `r7')
+
+ASM_START()
+PROLOGUE(mpn_lshiftc,toc)
+
+ifdef(`HAVE_ABI_mode32',`
+ rldicl n, n, 0,32 C FIXME: avoid this zero extend
+')
+ mflr r12
+ sldi r8, n, 3
+ sldi r10, cnt, 6 C multiply cnt by size of a SHIFT block
+ LEAL( r11, L(e1)) C address of L(e1) label in SHIFT(1)
+ add up, up, r8 C make up point at end of up[]
+ add r11, r11, r10 C address of L(oN) for N = cnt
+ srdi r10, n, 1
+ add rp, rp_param, r8 C make rp point at end of rp[]
+ subfic tnc, cnt, 64
+ rlwinm. r8, n, 0,31,31 C extract bit 0
+ mtctr r10
+ beq L(evn)
+
+L(odd): ld r9, -8(up)
+ cmpdi cr0, n, 1 C n = 1?
+ beq L(1)
+ ld r8, -16(up)
+ addi r11, r11, -88 C L(o1) - L(e1) - 64
+ mtlr r11
+ srd r3, r9, tnc C retval
+ addi up, up, 8
+ addi rp, rp, -8
+ blr C branch to L(oN)
+
+L(evn): ld r8, -8(up)
+ ld r9, -16(up)
+ addi r11, r11, -64
+ mtlr r11
+ srd r3, r8, tnc C retval
+ blr C branch to L(eN)
+
+L(1): srd r3, r9, tnc C retval
+ sld r8, r9, cnt
+ nor r8, r8, r8
+ std r8, -8(rp)
+ mtlr r12
+ifdef(`HAVE_ABI_mode32',
+` mr r4, r3
+ srdi r3, r3, 32
+')
+ blr
+
+
+define(SHIFT,`
+L(lo$1):ld r8, -24(up)
+ nor r11, r11, r11
+ std r11, -8(rp)
+ addi rp, rp, -16
+L(o$1): srdi r10, r8, eval(64-$1)
+ rldimi r10, r9, $1, 0
+ ld r9, -32(up)
+ addi up, up, -16
+ nor r10, r10, r10
+ std r10, 0(rp)
+L(e$1): srdi r11, r9, eval(64-$1)
+ rldimi r11, r8, $1, 0
+ bdnz L(lo$1)
+ sldi r10, r9, $1
+ b L(com)
+ nop
+')
+
+ ALIGN(64)
+forloop(`i',1,63,`SHIFT(i)')
+
+L(com): nor r11, r11, r11
+ nor r10, r10, r10
+ std r11, -8(rp)
+ std r10, -16(rp)
+ mtlr r12
+ifdef(`HAVE_ABI_mode32',
+` mr r4, r3
+ srdi r3, r3, 32
+')
+ blr
+EPILOGUE()
+ASM_END()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/p6/rshift.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/p6/rshift.asm
new file mode 100644
index 00000000000..9e848c1fc78
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/p6/rshift.asm
@@ -0,0 +1,131 @@
+dnl PowerPC-64 mpn_rshift -- rp[] = up[] << cnt
+
+dnl Copyright 2003, 2005, 2010, 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/limb
+C POWER3/PPC630 ?
+C POWER4/PPC970 ?
+C POWER5 2
+C POWER6 3.5 (mysteriously 3.0 for cnt=1)
+
+C TODO
+C * Micro-optimise header code
+C * Perhaps do 4-way unrolling, for 2.5 c/l on POWER6. The code is 4248
+C bytes, 4-way code would become about 50% larger.
+
+C INPUT PARAMETERS
+define(`rp_param', `r3')
+define(`up', `r4')
+define(`n', `r5')
+define(`cnt', `r6')
+
+define(`tnc',`r0')
+define(`retval',`r3')
+define(`rp', `r7')
+
+ASM_START()
+PROLOGUE(mpn_rshift,toc)
+
+ifdef(`HAVE_ABI_mode32',`
+ rldicl n, n, 0,32 C FIXME: avoid this zero extend
+')
+ mflr r12
+ LEAL( r11, L(e1)) C address of L(e1) label in SHIFT(1)
+ sldi r10, cnt, 6 C multiply cnt by size of a SHIFT block
+ add r11, r11, r10 C address of L(oN) for N = cnt
+ srdi r10, n, 1
+ mr rp, rp_param
+ subfic tnc, cnt, 64
+ rlwinm. r8, n, 0,31,31 C extract bit 0
+ mtctr r10
+ beq L(evn)
+
+L(odd): ld r9, 0(up)
+ cmpdi cr0, n, 1 C n = 1?
+ beq L(1)
+ ld r8, 8(up)
+ addi r11, r11, -84 C L(o1) - L(e1) - 64
+ mtlr r11
+ sld r3, r9, tnc C retval
+ addi up, up, 8
+ addi rp, rp, 8
+ blr C branch to L(oN)
+
+L(evn): ld r8, 0(up)
+ ld r9, 8(up)
+ addi r11, r11, -64
+ mtlr r11
+ sld r3, r8, tnc C retval
+ addi up, up, 16
+ blr C branch to L(eN)
+
+L(1): sld r3, r9, tnc C retval
+ srd r8, r9, cnt
+ std r8, 0(rp)
+ mtlr r12
+ifdef(`HAVE_ABI_mode32',
+` mr r4, r3
+ srdi r3, r3, 32
+')
+ blr
+
+
+define(SHIFT,`
+L(lo$1):ld r8, 0(up)
+ std r11, 0(rp)
+ addi rp, rp, 16
+L(o$1): srdi r10, r9, $1
+ rldimi r10, r8, eval(64-$1), 0
+ ld r9, 8(up)
+ addi up, up, 16
+ std r10, -8(rp)
+L(e$1): srdi r11, r8, $1
+ rldimi r11, r9, eval(64-$1), 0
+ bdnz L(lo$1)
+ std r11, 0(rp)
+ srdi r10, r9, $1
+ b L(com)
+ nop
+ nop
+')
+
+ ALIGN(64)
+forloop(`i',1,63,`SHIFT(i)')
+
+L(com): std r10, 8(rp)
+ mtlr r12
+ifdef(`HAVE_ABI_mode32',
+` mr r4, r3
+ srdi r3, r3, 32
+')
+ blr
+EPILOGUE()
+ASM_END()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/p7/copyd.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/p7/copyd.asm
new file mode 100644
index 00000000000..f04ca586e88
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/p7/copyd.asm
@@ -0,0 +1,128 @@
+dnl PowerPC-64 mpn_copyd.
+
+dnl Copyright 2004, 2005, 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/limb
+C POWER3/PPC630 ?
+C POWER4/PPC970 ?
+C POWER5 ?
+C POWER6 1.25
+C POWER7 1.09
+
+C INPUT PARAMETERS
+define(`rp', `r3')
+define(`up', `r4')
+define(`n', `r5')
+
+ASM_START()
+PROLOGUE(mpn_copyd)
+
+ifdef(`HAVE_ABI_mode32',
+` rldicl n, n, 0,32')
+
+ sldi r0, n, 3
+ add up, up, r0 C point at u[] end
+ add rp, rp, r0 C point at r[] end
+
+ cmpdi cr0, n, 4
+ blt L(sml)
+
+ addi r10, n, 4
+ srdi r10, r10, 3
+ mtctr r10
+
+ andi. r0, n, 1
+ rlwinm r11, n, 0,30,30
+ rlwinm r12, n, 0,29,29
+ cmpdi cr6, r11, 0
+ cmpdi cr7, r12, 0
+
+ beq cr0, L(xx0)
+L(xx1): ld r6, -8(up)
+ addi up, up, -8
+ std r6, -8(rp)
+ addi rp, rp, -8
+
+L(xx0): bne cr6, L(x10)
+L(x00): ld r6, -8(up)
+ ld r7, -16(up)
+ bne cr7, L(100)
+L(000): addi rp, rp, 32
+ b L(lo0)
+L(100): addi up, up, 32
+ b L(lo4)
+L(x10): ld r8, -8(up)
+ ld r9, -16(up)
+ bne cr7, L(110)
+L(010): addi up, up, -16
+ addi rp, rp, 16
+ b L(lo2)
+L(110): addi up, up, 16
+ addi rp, rp, 48
+ b L(lo6)
+
+L(sml): cmpdi cr0, n, 0
+ beqlr- cr0
+ mtctr n
+L(t): ld r6, -8(up)
+ addi up, up, -8
+ std r6, -8(rp)
+ addi rp, rp, -8
+ bdnz L(t)
+ blr
+
+ ALIGN(32)
+L(top): std r6, -8(rp)
+ std r7, -16(rp)
+L(lo2): ld r6, -8(up)
+ ld r7, -16(up)
+ std r8, -24(rp)
+ std r9, -32(rp)
+L(lo0): ld r8, -24(up)
+ ld r9, -32(up)
+ std r6, -40(rp)
+ std r7, -48(rp)
+L(lo6): ld r6, -40(up)
+ ld r7, -48(up)
+ std r8, -56(rp)
+ std r9, -64(rp)
+ addi rp, rp, -64
+L(lo4): ld r8, -56(up)
+ ld r9, -64(up)
+ addi up, up, -64
+ bdnz L(top)
+
+L(end): std r6, -8(rp)
+ std r7, -16(rp)
+ std r8, -24(rp)
+ std r9, -32(rp)
+ blr
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/p7/copyi.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/p7/copyi.asm
new file mode 100644
index 00000000000..854cf9f8090
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/p7/copyi.asm
@@ -0,0 +1,129 @@
+dnl PowerPC-64 mpn_copyi.
+
+dnl Copyright 2004, 2005, 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/limb
+C POWER3/PPC630 ?
+C POWER4/PPC970 ?
+C POWER5 ?
+C POWER6 1.25
+C POWER7 1.09
+
+C INPUT PARAMETERS
+define(`rp', `r3')
+define(`up', `r4')
+define(`n', `r5')
+
+C TODO
+C * Try rolling the two loop leading std to the end, allowing the code to
+C handle also n = 2.
+C * Consider using 4 pointers, schedule ptr update early wrt use.
+
+ASM_START()
+PROLOGUE(mpn_copyi)
+
+ifdef(`HAVE_ABI_mode32',
+` rldicl n, n, 0,32')
+
+ cmpdi cr0, n, 4
+ blt L(sml)
+
+ addi r10, n, 4
+ srdi r10, r10, 3
+ mtctr r10
+
+ andi. r0, n, 1
+ rlwinm r11, n, 0,30,30
+ rlwinm r12, n, 0,29,29
+ cmpdi cr6, r11, 0
+ cmpdi cr7, r12, 0
+
+ beq cr0, L(xx0)
+L(xx1): ld r6, 0(up)
+ addi up, up, 8
+ std r6, 0(rp)
+ addi rp, rp, 8
+
+L(xx0): bne cr6, L(x10)
+L(x00): ld r6, 0(up)
+ ld r7, 8(up)
+ bne cr7, L(100)
+L(000): addi rp, rp, -32
+ b L(lo0)
+L(100): addi up, up, -32
+ b L(lo4)
+L(x10): ld r8, 0(up)
+ ld r9, 8(up)
+ bne cr7, L(110)
+L(010): addi up, up, 16
+ addi rp, rp, -16
+ b L(lo2)
+L(110): addi up, up, -16
+ addi rp, rp, -48
+ b L(lo6)
+
+L(sml): cmpdi cr0, n, 0
+ beqlr- cr0
+ mtctr n
+L(t): ld r6, 0(up)
+ addi up, up, 8
+ std r6, 0(rp)
+ addi rp, rp, 8
+ bdnz L(t)
+ blr
+
+ ALIGN(32)
+L(top): std r6, 0(rp)
+ std r7, 8(rp)
+L(lo2): ld r6, 0(up)
+ ld r7, 8(up)
+ std r8, 16(rp)
+ std r9, 24(rp)
+L(lo0): ld r8, 16(up)
+ ld r9, 24(up)
+ std r6, 32(rp)
+ std r7, 40(rp)
+L(lo6): ld r6, 32(up)
+ ld r7, 40(up)
+ std r8, 48(rp)
+ std r9, 56(rp)
+ addi rp, rp, 64
+L(lo4): ld r8, 48(up)
+ ld r9, 56(up)
+ addi up, up, 64
+ bdnz L(top)
+
+L(end): std r6, 0(rp)
+ std r7, 8(rp)
+ std r8, 16(rp)
+ std r9, 24(rp)
+ blr
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/p7/hamdist.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/p7/hamdist.asm
new file mode 100644
index 00000000000..5af98946f75
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/p7/hamdist.asm
@@ -0,0 +1,110 @@
+dnl PowerPC-64 mpn_hamdist.
+
+dnl Copyright 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/limb
+C POWER3/PPC630 -
+C POWER4/PPC970 -
+C POWER5 -
+C POWER6 -
+C POWER7 2.87
+
+define(`up', r3)
+define(`vp', r4)
+define(`n', r5)
+
+ASM_START()
+PROLOGUE(mpn_hamdist)
+ std r30, -16(r1)
+ std r31, -8(r1)
+
+ addi r0, n, 1
+ifdef(`HAVE_ABI_mode32',
+` rldicl r0, r0, 63,33', C ...branch count
+` srdi r0, r0, 1') C ...for ctr
+ mtctr r0
+
+ andi. r0, n, 1
+
+ li r0, 0
+ li r12, 0
+
+ beq L(evn)
+
+L(odd): ld r6, 0(up)
+ addi up, up, 8
+ ld r8, 0(vp)
+ addi vp, vp, 8
+ xor r10, r6, r8
+ popcntd r0, r10
+ bdz L(e1)
+
+L(evn): ld r6, 0(up)
+ ld r8, 0(vp)
+ ld r7, 8(up)
+ ld r9, 8(vp)
+ xor r10, r6, r8
+ addi up, up, 16
+ addi vp, vp, 16
+ li r30, 0
+ li r31, 0
+ bdz L(end)
+
+ nop
+ nop
+C ALIGN(16)
+L(top): add r0, r0, r30
+ ld r6, 0(up)
+ ld r8, 0(vp)
+ xor r11, r7, r9
+ popcntd r30, r10
+ add r12, r12, r31
+ ld r7, 8(up)
+ ld r9, 8(vp)
+ xor r10, r6, r8
+ popcntd r31, r11
+ addi up, up, 16
+ addi vp, vp, 16
+ bdnz L(top)
+
+L(end): add r0, r0, r30
+ xor r11, r7, r9
+ popcntd r30, r10
+ add r12, r12, r31
+ popcntd r31, r11
+
+ add r0, r0, r30
+ add r12, r12, r31
+L(e1): add r3, r0, r12
+ ld r30, -16(r1)
+ ld r31, -8(r1)
+ blr
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/p7/popcount.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/p7/popcount.asm
new file mode 100644
index 00000000000..eac72a64935
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/p7/popcount.asm
@@ -0,0 +1,90 @@
+dnl PowerPC-64 mpn_popcount.
+
+dnl Copyright 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/limb
+C POWER3/PPC630 -
+C POWER4/PPC970 -
+C POWER5 -
+C POWER6 -
+C POWER7 2
+
+define(`up', r3)
+define(`n', r4)
+
+ASM_START()
+PROLOGUE(mpn_popcount)
+ addi r0, n, 1
+ifdef(`HAVE_ABI_mode32',
+` rldicl r0, r0, 63,33', C ...branch count
+` srdi r0, r0, 1') C ...for ctr
+ mtctr r0
+
+ andi. r0, n, 1
+
+ li r0, 0
+ li r12, 0
+ beq L(evn)
+
+L(odd): ld r4, 0(up)
+ addi up, up, 8
+ popcntd r0, r4
+ bdz L(e1)
+
+L(evn): ld r4, 0(up)
+ ld r5, 8(up)
+ popcntd r8, r4
+ popcntd r9, r5
+ bdz L(e2)
+
+ ld r4, 16(up)
+ ld r5, 24(up)
+ bdz L(e4)
+ addi up, up, 32
+
+L(top): add r0, r0, r8
+ popcntd r8, r4
+ ld r4, 0(up)
+ add r12, r12, r9
+ popcntd r9, r5
+ ld r5, 8(up)
+ addi up, up, 16
+ bdnz L(top)
+
+L(e4): add r0, r0, r8
+ popcntd r8, r4
+ add r12, r12, r9
+ popcntd r9, r5
+L(e2): add r0, r0, r8
+ add r12, r12, r9
+L(e1): add r3, r0, r12
+ blr
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/rshift.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/rshift.asm
new file mode 100644
index 00000000000..7654a16ae8c
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/rshift.asm
@@ -0,0 +1,207 @@
+dnl PowerPC-64 mpn_rshift -- rp[] = up[] >> cnt
+
+dnl Copyright 2003, 2005, 2010, 2011 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 2.25
+C POWER6 9.75
+C POWER7 2.15
+
+C TODO
+C * Try to reduce the number of needed live registers
+C * Micro-optimise header code
+C * Keep in synch with lshift.asm and lshiftc.asm
+
+C INPUT PARAMETERS
+define(`rp', `r3')
+define(`up', `r4')
+define(`n', `r5')
+define(`cnt', `r6')
+
+define(`tnc',`r0')
+define(`u0',`r30')
+define(`u1',`r31')
+define(`retval',`r5')
+
+ASM_START()
+PROLOGUE(mpn_rshift)
+ std r31, -8(r1)
+ std r30, -16(r1)
+ subfic tnc, cnt, 64
+C sldi r30, n, 3 C byte count corresponding to n
+C add rp, rp, r30 C rp = rp + n
+C add up, up, r30 C up = up + n
+ rldicl. r30, n, 0,62 C r30 = n & 3, set cr0
+ cmpdi cr6, r30, 2
+ addi r31, n, 3 C compute count...
+ ld r10, 0(up) C load 1st limb for b00...b11
+ sld retval, r10, tnc
+ifdef(`HAVE_ABI_mode32',
+` rldicl r31, r31, 62,34', C ...branch count
+` srdi r31, r31, 2') C ...for ctr
+ mtctr r31 C copy count into ctr
+ beq cr0, L(b00)
+ blt cr6, L(b01)
+ ld r11, 8(up) C load 2nd limb for b10 and b11
+ beq cr6, L(b10)
+
+ ALIGN(16)
+L(b11): srd r8, r10, cnt
+ sld r9, r11, tnc
+ ld u1, 16(up)
+ addi up, up, 24
+ srd r12, r11, cnt
+ sld r7, u1, tnc
+ addi rp, rp, -16
+ bdnz L(gt3)
+
+ or r11, r8, r9
+ srd r8, u1, cnt
+ b L(cj3)
+
+ ALIGN(16)
+L(gt3): ld u0, 0(up)
+ or r11, r8, r9
+ srd r8, u1, cnt
+ sld r9, u0, tnc
+ ld u1, 8(up)
+ or r10, r12, r7
+ b L(L11)
+
+ ALIGN(32)
+L(b10): srd r12, r10, cnt
+ addi rp, rp, -24
+ sld r7, r11, tnc
+ bdnz L(gt2)
+
+ srd r8, r11, cnt
+ or r10, r12, r7
+ b L(cj2)
+
+L(gt2): ld u0, 16(up)
+ srd r8, r11, cnt
+ sld r9, u0, tnc
+ ld u1, 24(up)
+ or r10, r12, r7
+ srd r12, u0, cnt
+ sld r7, u1, tnc
+ ld u0, 32(up)
+ or r11, r8, r9
+ addi up, up, 16
+ b L(L10)
+
+ ALIGN(16)
+L(b00): ld u1, 8(up)
+ srd r12, r10, cnt
+ sld r7, u1, tnc
+ ld u0, 16(up)
+ srd r8, u1, cnt
+ sld r9, u0, tnc
+ ld u1, 24(up)
+ or r10, r12, r7
+ srd r12, u0, cnt
+ sld r7, u1, tnc
+ addi rp, rp, -8
+ bdz L(cj4)
+
+L(gt4): addi up, up, 32
+ ld u0, 0(up)
+ or r11, r8, r9
+ b L(L00)
+
+ ALIGN(16)
+L(b01): bdnz L(gt1)
+ srd r8, r10, cnt
+ std r8, 0(rp)
+ b L(ret)
+
+L(gt1): ld u0, 8(up)
+ srd r8, r10, cnt
+ sld r9, u0, tnc
+ ld u1, 16(up)
+ srd r12, u0, cnt
+ sld r7, u1, tnc
+ ld u0, 24(up)
+ or r11, r8, r9
+ srd r8, u1, cnt
+ sld r9, u0, tnc
+ ld u1, 32(up)
+ addi up, up, 40
+ or r10, r12, r7
+ bdz L(end)
+
+ ALIGN(32)
+L(top): srd r12, u0, cnt
+ sld r7, u1, tnc
+ ld u0, 0(up)
+ std r11, 0(rp)
+ or r11, r8, r9
+L(L00): srd r8, u1, cnt
+ sld r9, u0, tnc
+ ld u1, 8(up)
+ std r10, 8(rp)
+ or r10, r12, r7
+L(L11): srd r12, u0, cnt
+ sld r7, u1, tnc
+ ld u0, 16(up)
+ std r11, 16(rp)
+ or r11, r8, r9
+L(L10): srd r8, u1, cnt
+ sld r9, u0, tnc
+ ld u1, 24(up)
+ addi up, up, 32
+ std r10, 24(rp)
+ addi rp, rp, 32
+ or r10, r12, r7
+ bdnz L(top)
+
+ ALIGN(32)
+L(end): srd r12, u0, cnt
+ sld r7, u1, tnc
+ std r11, 0(rp)
+L(cj4): or r11, r8, r9
+ srd r8, u1, cnt
+ std r10, 8(rp)
+L(cj3): or r10, r12, r7
+ std r11, 16(rp)
+L(cj2): std r10, 24(rp)
+ std r8, 32(rp)
+
+L(ret): ld r31, -8(r1)
+ ld r30, -16(r1)
+ifdef(`HAVE_ABI_mode32',
+` srdi r3, retval, 32
+ mr r4, retval
+',` mr r3, retval')
+ blr
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/sec_tabselect.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/sec_tabselect.asm
new file mode 100644
index 00000000000..085577ca9be
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/sec_tabselect.asm
@@ -0,0 +1,147 @@
+dnl PowerPC-64 mpn_sec_tabselect.
+
+dnl Contributed to the GNU project by Torbjörn Granlund.
+
+dnl Copyright 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/limb
+C POWER3/PPC630 1.75
+C POWER4/PPC970 2.0
+C POWER5 ?
+C POWER6 5.0
+C POWER7 1.75
+
+define(`rp', `r3')
+define(`tp', `r4')
+define(`n', `r5')
+define(`nents', `r6')
+define(`which', `r7')
+
+define(`i', `r8')
+define(`j', `r9')
+define(`stride', `r12')
+define(`mask', `r11')
+
+
+ASM_START()
+PROLOGUE(mpn_sec_tabselect)
+ addic. j, n, -4 C outer loop induction variable
+ std r31, -8(r1)
+ std r30, -16(r1)
+ std r29, -24(r1)
+ std r28, -32(r1)
+ std r27, -40(r1)
+ sldi stride, n, 3
+
+ blt cr0, L(outer_end)
+L(outer_top):
+ mtctr nents
+ mr r10, tp
+ li r28, 0
+ li r29, 0
+ li r30, 0
+ li r31, 0
+ addic. j, j, -4 C outer loop induction variable
+ mr i, which
+
+ ALIGN(16)
+L(top): addic i, i, -1 C set carry iff i != 0
+ subfe mask, mask, mask
+ ld r0, 0(tp)
+ ld r27, 8(tp)
+ and r0, r0, mask
+ and r27, r27, mask
+ or r28, r28, r0
+ or r29, r29, r27
+ ld r0, 16(tp)
+ ld r27, 24(tp)
+ and r0, r0, mask
+ and r27, r27, mask
+ or r30, r30, r0
+ or r31, r31, r27
+ add tp, tp, stride
+ bdnz L(top)
+
+ std r28, 0(rp)
+ std r29, 8(rp)
+ std r30, 16(rp)
+ std r31, 24(rp)
+ addi tp, r10, 32
+ addi rp, rp, 32
+ bge cr0, L(outer_top)
+L(outer_end):
+
+ rldicl. r0, n, 63, 63
+ beq cr0, L(b0x)
+L(b1x): mtctr nents
+ mr r10, tp
+ li r28, 0
+ li r29, 0
+ mr i, which
+ ALIGN(16)
+L(tp2): addic i, i, -1
+ subfe mask, mask, mask
+ ld r0, 0(tp)
+ ld r27, 8(tp)
+ and r0, r0, mask
+ and r27, r27, mask
+ or r28, r28, r0
+ or r29, r29, r27
+ add tp, tp, stride
+ bdnz L(tp2)
+ std r28, 0(rp)
+ std r29, 8(rp)
+ addi tp, r10, 16
+ addi rp, rp, 16
+
+L(b0x): rldicl. r0, n, 0, 63
+ beq cr0, L(b00)
+L(b01): mtctr nents
+ mr r10, tp
+ li r28, 0
+ mr i, which
+ ALIGN(16)
+L(tp1): addic i, i, -1
+ subfe mask, mask, mask
+ ld r0, 0(tp)
+ and r0, r0, mask
+ or r28, r28, r0
+ add tp, tp, stride
+ bdnz L(tp1)
+ std r28, 0(rp)
+
+L(b00): ld r31, -8(r1)
+ ld r30, -16(r1)
+ ld r29, -24(r1)
+ ld r28, -32(r1)
+ ld r27, -40(r1)
+ blr
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/umul.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/umul.asm
new file mode 100644
index 00000000000..7fcc72f18f5
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/umul.asm
@@ -0,0 +1,53 @@
+dnl PowerPC-64 umul_ppmm -- support for longlong.h
+
+dnl Copyright 2000, 2001, 2005 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 mp_limb_t mpn_umul_ppmm (mp_limb_t *lowptr, mp_limb_t m1, mp_limb_t m2);
+C
+
+ASM_START()
+PROLOGUE(mpn_umul_ppmm)
+
+ C r3 lowptr
+ C r4 m1
+ C r5 m2
+
+ mulld r0, r4, r5
+ mulhdu r4, r4, r5
+ std r0, 0(r3)
+ifdef(`HAVE_ABI_mode32',
+` srdi r3, r4, 32
+',` mr r3, r4
+')
+ blr
+
+EPILOGUE(mpn_umul_ppmm)
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/vmx/popcount.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/vmx/popcount.asm
new file mode 100644
index 00000000000..b95fb88b1ae
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/powerpc64/vmx/popcount.asm
@@ -0,0 +1,230 @@
+dnl PowerPC-32/VMX and PowerPC-64/VMX mpn_popcount.
+
+dnl Copyright 2006, 2010 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 7400,7410 (G4): ?
+C 744x,745x (G4+): 1.125
+C 970 (G5): 2.25
+
+C TODO
+C * Rewrite the awkward huge n outer loop code.
+C * Two lvx, two vperm, and two vxor could make us a similar hamdist.
+C * Compress cnsts table in 64-bit mode, only half the values are needed.
+
+define(`GMP_LIMB_BYTES', eval(GMP_LIMB_BITS/8))
+define(`LIMBS_PER_VR', eval(16/GMP_LIMB_BYTES))
+define(`LIMBS_PER_2VR', eval(32/GMP_LIMB_BYTES))
+
+define(`OPERATION_popcount')
+
+define(`ap', `r3')
+define(`n', `r4')
+
+define(`rtab', `v10')
+define(`cnt4', `v11')
+
+ifelse(GMP_LIMB_BITS,32,`
+ define(`LIMB32',` $1')
+ define(`LIMB64',`')
+',`
+ define(`LIMB32',`')
+ define(`LIMB64',` $1')
+')
+
+C The inner loop handles up to 2^34 bits, i.e., 2^31 64-limbs, due to overflow
+C in vsum4ubs. For large operands, we work in chunks, of size LIMBS_PER_CHUNK.
+define(`LIMBS_PER_CHUNK', 0x1000)
+define(`LIMBS_CHUNK_THRES', 0x1001)
+
+ASM_START()
+PROLOGUE(mpn_popcount,toc)
+ mfspr r10, 256
+ oris r0, r10, 0xfffc C Set VRSAVE bit 0-13
+ mtspr 256, r0
+
+ifdef(`HAVE_ABI_mode32',
+` rldicl n, n, 0, 32') C zero extend n
+
+C Load various constants into vector registers
+ LEAL( r11, cnsts)
+ li r12, 16
+ vspltisb cnt4, 4 C 0x0404...04 used as shift count
+
+ li r7, 160
+ lvx rtab, 0, r11
+
+LIMB64(`lis r0, LIMBS_CHUNK_THRES ')
+LIMB64(`cmpd cr7, n, r0 ')
+
+ lvx v0, 0, ap
+ addi r7, r11, 80
+ rlwinm r6, ap, 2,26,29
+ lvx v8, r7, r6
+ vand v0, v0, v8
+
+LIMB32(`rlwinm r8, ap, 30,30,31 ')
+LIMB64(`rlwinm r8, ap, 29,31,31 ')
+ add n, n, r8 C compensate n for rounded down `ap'
+
+ vxor v1, v1, v1
+ li r8, 0 C grand total count
+
+ vxor v12, v12, v12 C zero total count
+ vxor v13, v13, v13 C zero total count
+
+ addic. n, n, -LIMBS_PER_VR
+ ble L(sum)
+
+ addic. n, n, -LIMBS_PER_VR
+ ble L(lsum)
+
+C For 64-bit machines, handle huge n that would overflow vsum4ubs
+LIMB64(`ble cr7, L(small) ')
+LIMB64(`addis r9, n, -LIMBS_PER_CHUNK ') C remaining n
+LIMB64(`lis n, LIMBS_PER_CHUNK ')
+
+ ALIGN(16)
+L(small):
+LIMB32(`srwi r7, n, 3 ') C loop count corresponding to n
+LIMB64(`srdi r7, n, 2 ') C loop count corresponding to n
+ addi r7, r7, 1
+ mtctr r7 C copy n to count register
+ b L(ent)
+
+ ALIGN(16)
+L(top):
+ lvx v0, 0, ap
+L(ent): lvx v1, r12, ap
+ addi ap, ap, 32
+ vsrb v8, v0, cnt4
+ vsrb v9, v1, cnt4
+ vperm v2, rtab, rtab, v0
+ vperm v3, rtab, rtab, v8
+ vperm v4, rtab, rtab, v1
+ vperm v5, rtab, rtab, v9
+ vaddubm v6, v2, v3
+ vaddubm v7, v4, v5
+ vsum4ubs v12, v6, v12
+ vsum4ubs v13, v7, v13
+ bdnz L(top)
+
+ andi. n, n, eval(LIMBS_PER_2VR-1)
+ beq L(rt)
+
+ lvx v0, 0, ap
+ vxor v1, v1, v1
+ cmpwi n, LIMBS_PER_VR
+ ble L(sum)
+L(lsum):
+ vor v1, v0, v0
+ lvx v0, r12, ap
+L(sum):
+LIMB32(`rlwinm r6, n, 4,26,27 ')
+LIMB64(`rlwinm r6, n, 5,26,26 ')
+ addi r7, r11, 16
+ lvx v8, r7, r6
+ vand v0, v0, v8
+ vsrb v8, v0, cnt4
+ vsrb v9, v1, cnt4
+ vperm v2, rtab, rtab, v0
+ vperm v3, rtab, rtab, v8
+ vperm v4, rtab, rtab, v1
+ vperm v5, rtab, rtab, v9
+ vaddubm v6, v2, v3
+ vaddubm v7, v4, v5
+ vsum4ubs v12, v6, v12
+ vsum4ubs v13, v7, v13
+
+ ALIGN(16)
+L(rt): vadduwm v3, v12, v13
+ li r7, -16 C FIXME: does all ppc32 and ppc64 ABIs
+ stvx v3, r7, r1 C FIXME: ...support storing below sp?
+
+ lwz r7, -16(r1)
+ add r8, r8, r7
+ lwz r7, -12(r1)
+ add r8, r8, r7
+ lwz r7, -8(r1)
+ add r8, r8, r7
+ lwz r7, -4(r1)
+ add r8, r8, r7
+
+C Handle outer loop for huge n. We inherit cr7 and r0 from above.
+LIMB64(`ble cr7, L(ret)
+ vxor v12, v12, v12 C zero total count
+ vxor v13, v13, v13 C zero total count
+ mr n, r9
+ cmpd cr7, n, r0
+ ble cr7, L(2)
+ addis r9, n, -LIMBS_PER_CHUNK C remaining n
+ lis n, LIMBS_PER_CHUNK
+L(2): srdi r7, n, 2 C loop count corresponding to n
+ mtctr r7 C copy n to count register
+ b L(top)
+')
+
+ ALIGN(16)
+L(ret): mr r3, r8
+ mtspr 256, r10
+ blr
+EPILOGUE()
+
+DEF_OBJECT(cnsts,16)
+C Counts for vperm
+ .byte 0x00,0x01,0x01,0x02,0x01,0x02,0x02,0x03
+ .byte 0x01,0x02,0x02,0x03,0x02,0x03,0x03,0x04
+C Masks for high end of number
+ .byte 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff
+ .byte 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff
+
+ .byte 0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00
+ .byte 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+
+ .byte 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff
+ .byte 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+
+ .byte 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff
+ .byte 0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00
+C Masks for low end of number
+ .byte 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff
+ .byte 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff
+
+ .byte 0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff
+ .byte 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff
+
+ .byte 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+ .byte 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff
+
+ .byte 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+ .byte 0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff
+END_OBJECT(cnsts)
+ASM_END()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/s390_32/README b/Build/source/libs/gmp/gmp-6.0.0/mpn/s390_32/README
new file mode 100644
index 00000000000..59519ba5384
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/s390_32/README
@@ -0,0 +1,37 @@
+All current (2001) S/390 and z/Architecture machines are single-issue,
+but some newer machines have a deep pipeline. Software-pipelining is
+therefore beneficial.
+
+* mpn_add_n, mpn_sub_n: Use code along the lines below. Two-way unrolling
+ would be adequate.
+
+ mp_limb_t
+ mpn_add_n (mp_ptr rp, mp_srcptr up, mp_srcptr vp, mp_size_t n)
+ {
+ mp_limb_t a, b, r, cy;
+ mp_size_t i;
+ mp_limb_t mm = -1;
+
+ cy = 0;
+ up += n;
+ vp += n;
+ rp += n;
+ i = -n;
+ do
+ {
+ a = up[i];
+ b = vp[i];
+ r = a + b + cy;
+ rp[i] = r;
+ cy = (((a & b) | ((a | b) & (r ^ mm)))) >> 31;
+ i++;
+ }
+ while (i < 0);
+ return cy;
+ }
+
+* mpn_lshift, mpn_rshift: Use SLDL/SRDL, and two-way unrolling.
+
+* mpn_mul_1, mpn_addmul_1, mpn_submul_1: For machines with just signed
+ multiply (MR), use two loops, similar to the corresponding VAX or
+ POWER functions. Handle carry like for mpn_add_n.
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/s390_32/addmul_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/s390_32/addmul_1.asm
new file mode 100644
index 00000000000..97189a8e765
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/s390_32/addmul_1.asm
@@ -0,0 +1,93 @@
+dnl S/390 mpn_addmul_1 -- Multiply a limb vector with a limb and add the
+dnl result to a second limb vector.
+
+dnl Copyright 2001 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(`rp',2)
+define(`up',3)
+define(`n',4)
+define(`vlimb',5)
+define(`cylimb',7)
+
+ASM_START()
+PROLOGUE(mpn_addmul_1)
+ stm 6,7,24(15)
+ slr cylimb,cylimb # clear cylimb
+ ltr vlimb,vlimb
+ jnl .Loopp
+
+.Loopn: l 1,0(up) # load from u
+ lr 6,1 #
+ mr 0,vlimb # multiply signed
+ alr 0,6 # add vlimb to phi
+ sra 6,31 # make mask
+ nr 6,vlimb # 0 or vlimb
+ alr 0,6 # conditionally add vlimb to phi
+ alr 1,cylimb # add carry limb to plo
+ brc 8+4,+8 # branch if not carry
+ ahi 0,1 # increment phi
+ l 6,0(rp) # load r limb
+ alr 6,1 # add u limb to plo
+ brc 8+4,+8 # branch if not carry
+ ahi 0,1 # increment phi
+ lr cylimb,0 # new cylimb
+ st 6,0(rp) # store
+ la up,4(,up)
+ la rp,4(,rp)
+ brct n,.Loopn
+
+ lr 2,cylimb
+ lm 6,7,24(15)
+ br 14
+
+.Loopp: l 1,0(up) # load from u
+ lr 6,1 #
+ mr 0,vlimb # multiply signed
+ sra 6,31 # make mask
+ nr 6,vlimb # 0 or vlimb
+ alr 0,6 # conditionally add vlimb to phi
+ alr 1,cylimb # add carry limb to plo
+ brc 8+4,+8 # branch if not carry
+ ahi 0,1 # increment phi
+ l 6,0(rp) # load r limb
+ alr 6,1 # add u limb to plo
+ brc 8+4,+8 # branch if not carry
+ ahi 0,1 # increment phi
+ lr cylimb,0 # new cylimb
+ st 6,0(rp) # store
+ la up,4(,up)
+ la rp,4(,rp)
+ brct n,.Loopp
+
+ lr 2,cylimb
+ lm 6,7,24(15)
+ br 14
+EPILOGUE(mpn_addmul_1)
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/s390_32/copyd.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/s390_32/copyd.asm
new file mode 100644
index 00000000000..ff252bc1a6e
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/s390_32/copyd.asm
@@ -0,0 +1,145 @@
+dnl S/390-32 mpn_copyd
+
+dnl Copyright 2011 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 cycles/limb
+C z900 1.65
+C z990 1.125
+C z9 ?
+C z10 ?
+C z196 ?
+
+C FIXME:
+C * Avoid saving/restoring callee-saves registers for n < 3. This could be
+C done by setting rp=r1, up=r2, i=r0 and r3,r4,r5 for clock regs.
+C We could then use r3...r10 in main loop.
+
+C INPUT PARAMETERS
+define(`rp_param', `%r2')
+define(`up_param', `%r3')
+define(`n', `%r4')
+
+define(`rp', `%r8')
+define(`up', `%r9')
+
+ASM_START()
+PROLOGUE(mpn_copyd)
+ stm %r6, %r11, 24(%r15)
+
+ lr %r1, n
+ sll %r1, 2
+ la %r10, 8(n)
+ ahi %r1, -32
+ srl %r10, 3
+ lhi %r11, -32
+
+ la rp, 0(%r1,rp_param) C FIXME use lay on z990 and later
+ la up, 0(%r1,up_param) C FIXME use lay on z990 and later
+
+ lhi %r7, 7
+ nr %r7, n C n mod 8
+ chi %r7, 2
+ jh L(b34567)
+ chi %r7, 1
+ je L(b1)
+ jh L(b2)
+
+L(b0): brct %r10, L(top)
+ j L(end)
+
+L(b1): l %r0, 28(up)
+ ahi up, -4
+ st %r0, 28(rp)
+ ahi rp, -4
+ brct %r10, L(top)
+ j L(end)
+
+L(b2): lm %r0, %r1, 24(up)
+ ahi up, -8
+ stm %r0, %r1, 24(rp)
+ ahi rp, -8
+ brct %r10, L(top)
+ j L(end)
+
+L(b34567):
+ chi %r7, 4
+ jl L(b3)
+ je L(b4)
+ chi %r7, 6
+ je L(b6)
+ jh L(b7)
+
+L(b5): lm %r0, %r4, 12(up)
+ ahi up, -20
+ stm %r0, %r4, 12(rp)
+ ahi rp, -20
+ brct %r10, L(top)
+ j L(end)
+
+L(b3): lm %r0, %r2, 20(up)
+ ahi up, -12
+ stm %r0, %r2, 20(rp)
+ ahi rp, -12
+ brct %r10, L(top)
+ j L(end)
+
+L(b4): lm %r0, %r3, 16(up)
+ ahi up, -16
+ stm %r0, %r3, 16(rp)
+ ahi rp, -16
+ brct %r10, L(top)
+ j L(end)
+
+L(b6): lm %r0, %r5, 8(up)
+ ahi up, -24
+ stm %r0, %r5, 8(rp)
+ ahi rp, -24
+ brct %r10, L(top)
+ j L(end)
+
+L(b7): lm %r0, %r6, 4(up)
+ ahi up, -28
+ stm %r0, %r6, 4(rp)
+ ahi rp, -28
+ brct %r10, L(top)
+ j L(end)
+
+L(top): lm %r0, %r7, 0(up)
+ la up, 0(%r11,up)
+ stm %r0, %r7, 0(rp)
+ la rp, 0(%r11,rp)
+ brct %r10, L(top)
+
+L(end): lm %r6, %r11, 24(%r15)
+ br %r14
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/s390_32/copyi.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/s390_32/copyi.asm
new file mode 100644
index 00000000000..1df32f100e5
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/s390_32/copyi.asm
@@ -0,0 +1,69 @@
+dnl S/390-32 mpn_copyi
+
+dnl Copyright 2011 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 z900 0.75
+C z990 0.375
+C z9 ?
+C z10 ?
+C z196 ?
+
+C NOTE
+C * This is based on GNU libc memcpy which was written by Martin Schwidefsky.
+
+C INPUT PARAMETERS
+define(`rp', `%r2')
+define(`up', `%r3')
+define(`n', `%r4')
+
+ASM_START()
+PROLOGUE(mpn_copyi)
+ ltr %r4, %r4
+ sll %r4, 2
+ je L(rtn)
+ ahi %r4, -1
+ lr %r5, %r4
+ srl %r5, 8
+ ltr %r5, %r5 C < 256 bytes to copy?
+ je L(1)
+
+L(top): mvc 0(256, rp), 0(up)
+ la rp, 256(rp)
+ la up, 256(up)
+ brct %r5, L(top)
+
+L(1): bras %r5, L(2) C make r5 point to mvc insn
+ mvc 0(1, rp), 0(up)
+L(2): ex %r4, 0(%r5) C execute mvc with length ((n-1) mod 256)+1
+L(rtn): br %r14
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/s390_32/esame/addmul_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/s390_32/esame/addmul_1.asm
new file mode 100644
index 00000000000..4375b74ae09
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/s390_32/esame/addmul_1.asm
@@ -0,0 +1,72 @@
+dnl S/390-32 mpn_addmul_1 for systems with MLR instruction
+
+dnl Copyright 2011 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 z900 18.5
+C z990 10
+C z9 ?
+C z10 ?
+C z196 ?
+
+C INPUT PARAMETERS
+define(`rp', `%r2')
+define(`up', `%r3')
+define(`n', `%r4')
+define(`v0', `%r5')
+
+define(`z', `%r9')
+
+ASM_START()
+PROLOGUE(mpn_addmul_1)
+ stm %r9, %r12, 36(%r15)
+ lhi %r12, 0 C zero index register
+ ahi %r12, 0 C clear carry fla
+ lhi %r11, 0 C clear carry limb
+ lhi z, 0 C clear carry limb
+
+L(top): l %r1, 0(%r12,up)
+ l %r10, 0(%r12,rp)
+ mlr %r0, v0
+ alcr %r1, %r10
+ alcr %r0, z
+ alr %r1, %r11
+ lr %r11, %r0
+ st %r1, 0(%r12,rp)
+ la %r12, 4(%r12)
+ brct n, L(top)
+
+ lhi %r2, 0
+ alcr %r2, %r11
+
+ lm %r9, %r12, 36(%r15)
+ br %r14
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/s390_32/esame/aors_n.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/s390_32/esame/aors_n.asm
new file mode 100644
index 00000000000..98b0dbc7b08
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/s390_32/esame/aors_n.asm
@@ -0,0 +1,137 @@
+dnl S/390-32 mpn_add_n and mpn_sub_n.
+
+dnl Copyright 2011 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 z900 ?
+C z990 2.75-3 (fast for even n, slow for odd n)
+C z9 ?
+C z10 ?
+C z196 ?
+
+C TODO
+C * Optimise for small n
+C * Use r0 and save/restore one less register
+C * Using logops_n's v1 inner loop operand order make the loop about 20%
+C faster, at the expense of highly alignment-dependent performance.
+
+C INPUT PARAMETERS
+define(`rp', `%r2')
+define(`up', `%r3')
+define(`vp', `%r4')
+define(`n', `%r5')
+
+ifdef(`OPERATION_add_n', `
+ define(ADSB, al)
+ define(ADSBCR, alcr)
+ define(ADSBC, alc)
+ define(RETVAL,`dnl
+ lhi %r2, 0
+ alcr %r2, %r2')
+ define(func, mpn_add_n)
+ define(func_nc, mpn_add_nc)')
+ifdef(`OPERATION_sub_n', `
+ define(ADSB, sl)
+ define(ADSBCR, slbr)
+ define(ADSBC, slb)
+ define(RETVAL,`dnl
+ slbr %r2, %r2
+ lcr %r2, %r2')
+ define(func, mpn_sub_n)
+ define(func_nc, mpn_sub_nc)')
+
+MULFUNC_PROLOGUE(mpn_add_n mpn_sub_n)
+
+ASM_START()
+PROLOGUE(func)
+ stm %r6, %r8, 24(%r15)
+
+ ahi n, 3
+ lhi %r7, 3
+ lr %r1, n
+ srl %r1, 2
+ nr %r7, n C n mod 4
+ je L(b1)
+ chi %r7, 2
+ jl L(b2)
+ jne L(b0)
+
+L(b3): lm %r5, %r7, 0(up)
+ la up, 12(up)
+ ADSB %r5, 0(vp)
+ ADSBC %r6, 4(vp)
+ ADSBC %r7, 8(vp)
+ la vp, 12(vp)
+ stm %r5, %r7, 0(rp)
+ la rp, 12(rp)
+ brct %r1, L(top)
+ j L(end)
+
+L(b0): lm %r5, %r8, 0(up) C This redundant insns is no mistake,
+ la up, 16(up) C it is needed to make main loop run
+ ADSB %r5, 0(vp) C fast for n = 0 (mod 4).
+ ADSBC %r6, 4(vp)
+ j L(m0)
+
+L(b1): l %r5, 0(up)
+ la up, 4(up)
+ ADSB %r5, 0(vp)
+ la vp, 4(vp)
+ st %r5, 0(rp)
+ la rp, 4(rp)
+ brct %r1, L(top)
+ j L(end)
+
+L(b2): lm %r5, %r6, 0(up)
+ la up, 8(up)
+ ADSB %r5, 0(vp)
+ ADSBC %r6, 4(vp)
+ la vp, 8(vp)
+ stm %r5, %r6, 0(rp)
+ la rp, 8(rp)
+ brct %r1, L(top)
+ j L(end)
+
+L(top): lm %r5, %r8, 0(up)
+ la up, 16(up)
+ ADSBC %r5, 0(vp)
+ ADSBC %r6, 4(vp)
+L(m0): ADSBC %r7, 8(vp)
+ ADSBC %r8, 12(vp)
+ la vp, 16(vp)
+ stm %r5, %r8, 0(rp)
+ la rp, 16(rp)
+ brct %r1, L(top)
+
+L(end): RETVAL
+ lm %r6, %r8, 24(%r15)
+ br %r14
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/s390_32/esame/aorslsh1_n.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/s390_32/esame/aorslsh1_n.asm
new file mode 100644
index 00000000000..f2b222b121d
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/s390_32/esame/aorslsh1_n.asm
@@ -0,0 +1,173 @@
+dnl S/390-32 mpn_addlsh1_n
+
+dnl Copyright 2011 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 z900 9.25
+C z990 5
+C z9 ?
+C z10 ?
+C z196 ?
+
+C TODO
+C * Optimise for small n
+C * Compute RETVAL for sublsh1_n less stupidly
+
+C INPUT PARAMETERS
+define(`rp', `%r2')
+define(`up', `%r3')
+define(`vp', `%r4')
+define(`n', `%r5')
+
+ifdef(`OPERATION_addlsh1_n',`
+ define(ADDSUBC, alr)
+ define(ADDSUBE, alcr)
+ define(INITCY, `lhi %r13, -1')
+ define(RETVAL, `alr %r1, %r13
+ lhi %r2, 2
+ alr %r2, %r1')
+ define(func, mpn_addlsh1_n)
+')
+ifdef(`OPERATION_sublsh1_n',`
+ define(ADDSUBC, slr)
+ define(ADDSUBE, slbr)
+ define(INITCY, `lhi %r13, 0')
+ define(RETVAL, `slr %r1, %r13
+ lhi %r2, 1
+ alr %r2, %r1')
+ define(func, mpn_sublsh1_n)
+')
+
+MULFUNC_PROLOGUE(mpn_addlsh1_n mpn_sublsh1_n)
+
+ASM_START()
+PROLOGUE(func)
+ stm %r6, %r13, 24(%r15)
+
+ la %r0, 3(n)
+ lhi %r7, 3
+ srl %r0, 2
+ nr %r7, n C n mod 4
+ je L(b0)
+ chi %r7, 2
+ jl L(b1)
+ je L(b2)
+
+L(b3): lm %r5, %r7, 0(up)
+ la up, 12(up)
+ lm %r9, %r11, 0(vp)
+ la vp, 12(vp)
+
+ alr %r9, %r9
+ alcr %r10, %r10
+ alcr %r11, %r11
+ slbr %r1, %r1
+
+ ADDSUBC %r5, %r9
+ ADDSUBE %r6, %r10
+ ADDSUBE %r7, %r11
+ slbr %r13, %r13
+
+ stm %r5, %r7, 0(rp)
+ la rp, 12(rp)
+ brct %r0, L(top)
+ j L(end)
+
+L(b0): lhi %r1, -1
+ INITCY
+ j L(top)
+
+L(b1): l %r5, 0(up)
+ la up, 4(up)
+ l %r9, 0(vp)
+ la vp, 4(vp)
+
+ alr %r9, %r9
+ slbr %r1, %r1
+ ADDSUBC %r5, %r9
+ slbr %r13, %r13
+
+ st %r5, 0(rp)
+ la rp, 4(rp)
+ brct %r0, L(top)
+ j L(end)
+
+L(b2): lm %r5, %r6, 0(up)
+ la up, 8(up)
+ lm %r9, %r10, 0(vp)
+ la vp, 8(vp)
+
+ alr %r9, %r9
+ alcr %r10, %r10
+ slbr %r1, %r1
+
+ ADDSUBC %r5, %r9
+ ADDSUBE %r6, %r10
+ slbr %r13, %r13
+
+ stm %r5, %r6, 0(rp)
+ la rp, 8(rp)
+ brct %r0, L(top)
+ j L(end)
+
+L(top): lm %r9, %r12, 0(vp)
+ la vp, 16(vp)
+
+ ahi %r1, 1 C restore carry
+
+ alcr %r9, %r9
+ alcr %r10, %r10
+ alcr %r11, %r11
+ alcr %r12, %r12
+
+ slbr %r1, %r1 C save carry
+
+ lm %r5, %r8, 0(up)
+ la up, 16(up)
+
+ ahi %r13, 1 C restore carry
+
+ ADDSUBE %r5, %r9
+ ADDSUBE %r6, %r10
+ ADDSUBE %r7, %r11
+ ADDSUBE %r8, %r12
+
+ slbr %r13, %r13
+
+ stm %r5, %r8, 0(rp)
+ la rp, 16(rp)
+ brct %r0, L(top)
+
+L(end):
+ RETVAL
+ lm %r6, %r13, 24(%r15)
+ br %r14
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/s390_32/esame/bdiv_dbm1c.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/s390_32/esame/bdiv_dbm1c.asm
new file mode 100644
index 00000000000..568a2a44e8f
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/s390_32/esame/bdiv_dbm1c.asm
@@ -0,0 +1,65 @@
+dnl S/390-32 mpn_bdiv_dbm1c for systems with MLR instruction.
+
+dnl Copyright 2011 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 z900 14
+C z990 10
+C z9 ?
+C z10 ?
+C z196 ?
+
+C INPUT PARAMETERS
+define(`qp', `%r2')
+define(`up', `%r3')
+define(`n', `%r4')
+define(`bd', `%r5')
+define(`cy', `%r6')
+
+ASM_START()
+ TEXT
+ ALIGN(16)
+PROLOGUE(mpn_bdiv_dbm1c)
+ stm %r6, %r7, 24(%r15)
+ lhi %r7, 0 C zero index register
+
+L(top): l %r1, 0(%r7,up)
+ mlr %r0, bd
+ slr %r6, %r1
+ st %r6, 0(%r7,qp)
+ slbr %r6, %r0
+ la %r7, 4(%r7)
+ brct n, L(top)
+
+ lr %r2, %r6
+ lm %r6, %r7, 24(%r15)
+ br %r14
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/s390_32/esame/gmp-mparam.h b/Build/source/libs/gmp/gmp-6.0.0/mpn/s390_32/esame/gmp-mparam.h
new file mode 100644
index 00000000000..a805fa1492d
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/s390_32/esame/gmp-mparam.h
@@ -0,0 +1,207 @@
+/* S/390-32 gmp-mparam.h -- Compiler/machine parameter header file.
+
+Copyright 1991, 1993, 1994, 2000-2008-2011, 2014 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
+
+/* 4400 MHz IBM z10 running in 32-bit mode */
+/* FFT tuning limit = 15000000 */
+/* Generated by tuneup.c, 2014-03-12, gcc 4.7 */
+
+#define DIVREM_1_NORM_THRESHOLD 3
+#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_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 DIV_QR_1N_PI1_METHOD 1
+#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 */
+#define BMOD_1_TO_MOD_1_THRESHOLD 56
+
+#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 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 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 MULMID_TOOM42_THRESHOLD 24
+
+#define MULMOD_BNM1_THRESHOLD 12
+#define SQRMOD_BNM1_THRESHOLD 10
+
+#define MUL_FFT_MODF_THRESHOLD 252 /* 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}, \
+ { 32768,16} }
+#define MUL_FFT_TABLE3_SIZE 149
+#define MUL_FFT_THRESHOLD 2240
+
+#define SQR_FFT_MODF_THRESHOLD 244 /* 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}, \
+ { 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
+
+#define MULLO_BASECASE_THRESHOLD 0 /* always */
+#define MULLO_DC_THRESHOLD 33
+#define MULLO_MUL_N_THRESHOLD 4392
+
+#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 INV_MULMOD_BNM1_THRESHOLD 14
+#define INV_NEWTON_THRESHOLD 165
+#define INV_APPR_THRESHOLD 149
+
+#define BINV_NEWTON_THRESHOLD 147
+#define REDC_1_TO_REDC_N_THRESHOLD 43
+
+#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 POWM_SEC_TABLE 3,32,126,692,1486
+
+#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 9
+#define GET_STR_PRECOMPUTE_THRESHOLD 20
+#define SET_STR_DC_THRESHOLD 532
+#define SET_STR_PRECOMPUTE_THRESHOLD 999
+
+#define FAC_DSC_THRESHOLD 156
+#define FAC_ODD_THRESHOLD 24
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/s390_32/esame/mul_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/s390_32/esame/mul_1.asm
new file mode 100644
index 00000000000..04be9636518
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/s390_32/esame/mul_1.asm
@@ -0,0 +1,66 @@
+dnl S/390-32 mpn_mul_1 for systems with MLR instruction
+
+dnl Copyright 2011 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 z900 14
+C z990 9
+C z9 ?
+C z10 ?
+C z196 ?
+
+C INPUT PARAMETERS
+define(`rp', `%r2')
+define(`up', `%r3')
+define(`n', `%r4')
+define(`v0', `%r5')
+
+ASM_START()
+PROLOGUE(mpn_mul_1)
+ stm %r11, %r12, 44(%r15)
+ lhi %r12, 0 C zero index register
+ ahi %r12, 0 C clear carry flag
+ lhi %r11, 0 C clear carry limb
+
+L(top): l %r1, 0(%r12,up)
+ mlr %r0, v0
+ alcr %r1, %r11
+ lr %r11, %r0 C copy high part to carry limb
+ st %r1, 0(%r12,rp)
+ la %r12, 4(%r12)
+ brct n, L(top)
+
+ lhi %r2, 0
+ alcr %r2, %r11
+
+ lm %r11, %r12, 44(%r15)
+ br %r14
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/s390_32/esame/mul_basecase.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/s390_32/esame/mul_basecase.asm
new file mode 100644
index 00000000000..2c8138d8d28
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/s390_32/esame/mul_basecase.asm
@@ -0,0 +1,130 @@
+dnl S/390-32/esame mpn_mul_basecase.
+
+dnl Copyright 2011 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 z900 ?
+C z990 ?
+C z9 ?
+C z10 ?
+C z196 ?
+
+C TODO
+C * Perhaps add special case for un <= 2.
+C * Replace loops by faster code. The mul_1 and addmul_1 loops could be sped
+C up by about 10%.
+
+C INPUT PARAMETERS
+define(`rp', `%r2')
+define(`up', `%r3')
+define(`un', `%r4')
+define(`vp', `%r5')
+define(`vn', `%r6')
+
+define(`zero', `%r8')
+
+ASM_START()
+PROLOGUE(mpn_mul_basecase)
+ chi un, 2
+ jhe L(ge2)
+
+C un = vn = 1
+ l %r1, 0(vp)
+ ml %r0, 0(up)
+ st %r1, 0(rp)
+ st %r0, 4(rp)
+ br %r14
+
+L(ge2): C jne L(gen)
+
+
+L(gen):
+C mul_1 =======================================================================
+
+ stm %r6, %r12, 24(%r15)
+ lhi zero, 0
+ ahi un, -1
+
+ l %r7, 0(vp)
+ l %r11, 0(up)
+ lhi %r12, 4 C init index register
+ mlr %r10, %r7
+ lr %r9, un
+ st %r11, 0(rp)
+ cr %r15, %r15 C clear carry flag
+
+L(tm): l %r1, 0(%r12,up)
+ mlr %r0, %r7
+ alcr %r1, %r10
+ lr %r10, %r0 C copy high part to carry limb
+ st %r1, 0(%r12,rp)
+ la %r12, 4(%r12)
+ brct %r9, L(tm)
+
+ alcr %r0, zero
+ st %r0, 0(%r12,rp)
+
+C addmul_1 loop ===============================================================
+
+ ahi vn, -1
+ je L(outer_end)
+L(outer_loop):
+
+ la rp, 4(rp) C rp += 1
+ la vp, 4(vp) C up += 1
+ l %r7, 0(vp)
+ l %r11, 0(up)
+ lhi %r12, 4 C init index register
+ mlr %r10, %r7
+ lr %r9, un
+ al %r11, 0(rp)
+ st %r11, 0(rp)
+
+L(tam): l %r1, 0(%r12,up)
+ l %r11, 0(%r12,rp)
+ mlr %r0, %r7
+ alcr %r1, %r11
+ alcr %r0, zero
+ alr %r1, %r10
+ lr %r10, %r0
+ st %r1, 0(%r12,rp)
+ la %r12, 4(%r12)
+ brct %r9, L(tam)
+
+ alcr %r0, zero
+ st %r0, 0(%r12,rp)
+
+ brct vn, L(outer_loop)
+L(outer_end):
+
+ lm %r6, %r12, 24(%r15)
+ br %r14
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/s390_32/esame/sqr_basecase.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/s390_32/esame/sqr_basecase.asm
new file mode 100644
index 00000000000..dcc13112bf3
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/s390_32/esame/sqr_basecase.asm
@@ -0,0 +1,203 @@
+dnl S/390-32 mpn_sqr_basecase.
+
+dnl Copyright 2011 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 z900 ?
+C z990 23
+C z9 ?
+C z10 ?
+C z196 ?
+
+C TODO
+C * Clean up.
+C * Stop iterating addmul_1 loop at latest for n = 2, implement longer tail.
+C This will ask for basecase handling of n = 3.
+C * Update counters and pointers more straightforwardly, possibly lowering
+C register usage.
+C * Should we use this allocation-free style for more sqr_basecase asm
+C implementations? The only disadvantage is that it requires R != U.
+C * Replace loops by faster code. The mul_1 and addmul_1 loops could be sped
+C up by about 10%. The sqr_diag_addlsh1 loop could probably be sped up even
+C more.
+
+C INPUT PARAMETERS
+define(`rp', `%r2')
+define(`up', `%r3')
+define(`n', `%r4')
+
+define(`zero', `%r8')
+define(`rp_saved', `%r9')
+define(`up_saved', `%r13')
+define(`n_saved', `%r14')
+
+ASM_START()
+PROLOGUE(mpn_sqr_basecase)
+ ahi n, -2
+ jhe L(ge2)
+
+C n = 1
+ l %r5, 0(up)
+ mlr %r4, %r5
+ st %r5, 0(rp)
+ st %r4, 4(rp)
+ br %r14
+
+L(ge2): jne L(gen)
+
+C n = 2
+ stm %r6, %r8, 24(%r15)
+ lhi zero, 0
+
+ l %r5, 0(up)
+ mlr %r4, %r5 C u0 * u0
+ l %r1, 4(up)
+ mlr %r0, %r1 C u1 * u1
+ st %r5, 0(rp)
+
+ l %r7, 0(up)
+ ml %r6, 4(up) C u0 * u1
+ alr %r7, %r7
+ alcr %r6, %r6
+ alcr %r0, zero
+
+ alr %r4, %r7
+ alcr %r1, %r6
+ alcr %r0, zero
+ st %r4, 4(rp)
+ st %r1, 8(rp)
+ st %r0, 12(rp)
+
+ lm %r6, %r8, 24(%r15)
+ br %r14
+
+L(gen):
+C mul_1 =======================================================================
+
+ stm %r6, %r14, 24(%r15)
+ lhi zero, 0
+ lr up_saved, up
+ lr rp_saved, rp
+ lr n_saved, n
+
+ l %r6, 0(up)
+ l %r11, 4(up)
+ lhi %r12, 8 C init index register
+ mlr %r10, %r6
+ lr %r5, n
+ st %r11, 4(rp)
+ cr %r15, %r15 C clear carry flag
+
+L(tm): l %r1, 0(%r12,up)
+ mlr %r0, %r6
+ alcr %r1, %r10
+ lr %r10, %r0 C copy high part to carry limb
+ st %r1, 0(%r12,rp)
+ la %r12, 4(%r12)
+ brct %r5, L(tm)
+
+ alcr %r0, zero
+ st %r0, 0(%r12,rp)
+
+C addmul_1 loop ===============================================================
+
+ ahi n, -1
+ je L(outer_end)
+L(outer_loop):
+
+ la rp, 8(rp) C rp += 2
+ la up, 4(up) C up += 1
+ l %r6, 0(up)
+ l %r11, 4(up)
+ lhi %r12, 8 C init index register
+ mlr %r10, %r6
+ lr %r5, n
+ al %r11, 4(rp)
+ st %r11, 4(rp)
+
+L(tam): l %r1, 0(%r12,up)
+ l %r7, 0(%r12,rp)
+ mlr %r0, %r6
+ alcr %r1, %r7
+ alcr %r0, zero
+ alr %r1, %r10
+ lr %r10, %r0
+ st %r1, 0(%r12,rp)
+ la %r12, 4(%r12)
+ brct %r5, L(tam)
+
+ alcr %r0, zero
+ st %r0, 0(%r12,rp)
+
+ brct n, L(outer_loop)
+L(outer_end):
+
+ l %r6, 4(up)
+ l %r1, 8(up)
+ lr %r7, %r0 C Same as: l %r7, 12(,rp)
+ mlr %r0, %r6
+ alr %r1, %r7
+ alcr %r0, zero
+ st %r1, 12(rp)
+ st %r0, 16(rp)
+
+C sqr_dia_addlsh1 ============================================================
+
+define(`up', `up_saved')
+define(`rp', `rp_saved')
+ la n, 1(n_saved)
+
+ l %r1, 0(up)
+ mlr %r0, %r1
+ st %r1, 0(rp)
+C clr %r15, %r15 C clear carry (already clear per above)
+
+L(top): l %r11, 4(up)
+ la up, 4(up)
+ l %r6, 4(rp)
+ l %r7, 8(rp)
+ mlr %r10, %r11
+ alcr %r6, %r6
+ alcr %r7, %r7
+ alcr %r10, zero C propagate carry to high product limb
+ alr %r6, %r0
+ alcr %r7, %r11
+ stm %r6, %r7, 4(rp)
+ la rp, 8(rp)
+ lr %r0, %r10 C copy carry limb
+ brct n, L(top)
+
+ alcr %r0, zero
+ st %r0, 4(rp)
+
+ lm %r6, %r14, 24(%r15)
+ br %r14
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/s390_32/esame/submul_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/s390_32/esame/submul_1.asm
new file mode 100644
index 00000000000..a71e57e2307
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/s390_32/esame/submul_1.asm
@@ -0,0 +1,70 @@
+dnl S/390-32 mpn_submul_1 for systems with MLR instruction.
+
+dnl Copyright 2011 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 z900 20
+C z990 11
+C z9 ?
+C z10 ?
+C z196 ?
+
+C INPUT PARAMETERS
+define(`rp', `%r2')
+define(`up', `%r3')
+define(`n', `%r4')
+define(`v0', `%r5')
+
+ASM_START()
+PROLOGUE(mpn_submul_1)
+ stm %r9, %r12, 36(%r15)
+ lhi %r12, 0
+ slr %r11, %r11
+
+L(top): l %r1, 0(%r12, up)
+ l %r10, 0(%r12, rp)
+ mlr %r0, v0
+ slbr %r10, %r1
+ slbr %r9, %r9
+ slr %r0, %r9 C conditional incr
+ slr %r10, %r11
+ lr %r11, %r0
+ st %r10, 0(%r12, rp)
+ la %r12, 4(%r12)
+ brct %r4, L(top)
+
+ lr %r2, %r11
+ slbr %r9, %r9
+ slr %r2, %r9
+
+ lm %r9, %r12, 36(%r15)
+ br %r14
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/s390_32/gmp-mparam.h b/Build/source/libs/gmp/gmp-6.0.0/mpn/s390_32/gmp-mparam.h
new file mode 100644
index 00000000000..1aca74a8188
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/s390_32/gmp-mparam.h
@@ -0,0 +1,138 @@
+/* S/390-32 gmp-mparam.h -- Compiler/machine parameter header file.
+
+Copyright 1991, 1993, 1994, 2000-2011 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
+
+/* 770 MHz IBM z900 running in 32-bit mode, using just traditional insns */
+
+#define DIVREM_1_NORM_THRESHOLD 0 /* always */
+#define DIVREM_1_UNNORM_THRESHOLD 5
+#define MOD_1_1P_METHOD 2
+#define MOD_1_NORM_THRESHOLD 0 /* always */
+#define MOD_1_UNNORM_THRESHOLD 5
+#define MOD_1N_TO_MOD_1_1_THRESHOLD MP_SIZE_T_MAX /* never */
+#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 30
+#define PREINV_MOD_1_TO_MOD_1_THRESHOLD MP_SIZE_T_MAX /* never */
+#define USE_PREINV_DIVREM_1 1
+#define DIV_QR_2_PI2_THRESHOLD MP_SIZE_T_MAX /* never */
+#define DIVEXACT_1_THRESHOLD 0 /* always */
+#define BMOD_1_TO_MOD_1_THRESHOLD MP_SIZE_T_MAX /* never */
+
+#define MUL_TOOM22_THRESHOLD 19
+#define MUL_TOOM33_THRESHOLD 114
+#define MUL_TOOM44_THRESHOLD 166
+#define MUL_TOOM6H_THRESHOLD 226
+#define MUL_TOOM8H_THRESHOLD 333
+
+#define MUL_TOOM32_TO_TOOM43_THRESHOLD 106
+#define MUL_TOOM32_TO_TOOM53_THRESHOLD 122
+#define MUL_TOOM42_TO_TOOM53_THRESHOLD 105
+#define MUL_TOOM42_TO_TOOM63_THRESHOLD 113
+
+#define SQR_BASECASE_THRESHOLD 7
+#define SQR_TOOM2_THRESHOLD 40
+#define SQR_TOOM3_THRESHOLD 126
+#define SQR_TOOM4_THRESHOLD 192
+#define SQR_TOOM6_THRESHOLD 246
+#define SQR_TOOM8_THRESHOLD 357
+
+#define MULMID_TOOM42_THRESHOLD 28
+
+#define MULMOD_BNM1_THRESHOLD 12
+#define SQRMOD_BNM1_THRESHOLD 18
+
+#define MUL_FFT_MODF_THRESHOLD 244 /* k = 5 */
+#define MUL_FFT_TABLE3 \
+ { { 244, 5}, { 13, 6}, { 7, 5}, { 15, 6}, \
+ { 8, 5}, { 17, 6}, { 13, 7}, { 7, 6}, \
+ { 16, 7}, { 9, 6}, { 19, 7}, { 11, 6}, \
+ { 23, 7}, { 13, 8}, { 7, 7}, { 19, 8}, \
+ { 11, 7}, { 25, 9}, { 7, 8}, { 15, 7}, \
+ { 33, 8}, { 19, 7}, { 39, 8}, { 23, 7}, \
+ { 47, 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}, { 63, 8}, { 127, 9}, { 71, 8}, \
+ { 143, 9}, { 79,10}, { 47,11}, { 2048,12}, \
+ { 4096,13}, { 8192,14}, { 16384,15}, { 32768,16} }
+#define MUL_FFT_TABLE3_SIZE 48
+#define MUL_FFT_THRESHOLD 2688
+
+#define SQR_FFT_MODF_THRESHOLD 216 /* k = 5 */
+#define SQR_FFT_TABLE3 \
+ { { 216, 5}, { 7, 4}, { 15, 5}, { 17, 6}, \
+ { 13, 7}, { 7, 6}, { 17, 7}, { 9, 6}, \
+ { 20, 7}, { 11, 6}, { 23, 7}, { 13, 8}, \
+ { 7, 7}, { 19, 8}, { 11, 7}, { 25, 9}, \
+ { 7, 8}, { 15, 7}, { 33, 8}, { 19, 7}, \
+ { 39, 8}, { 23, 9}, { 15, 8}, { 39, 9}, \
+ { 23, 8}, { 47,10}, { 15, 9}, { 31, 8}, \
+ { 63, 9}, { 39, 8}, { 79, 9}, { 47,10}, \
+ { 31, 9}, { 63, 8}, { 127, 9}, { 71, 8}, \
+ { 143, 9}, { 79,10}, { 47,11}, { 2048,12}, \
+ { 4096,13}, { 8192,14}, { 16384,15}, { 32768,16} }
+#define SQR_FFT_TABLE3_SIZE 44
+#define SQR_FFT_THRESHOLD 1856
+
+#define MULLO_BASECASE_THRESHOLD 0 /* always */
+#define MULLO_DC_THRESHOLD 61
+#define MULLO_MUL_N_THRESHOLD 5240
+
+#define DC_DIV_QR_THRESHOLD 70
+#define DC_DIVAPPR_Q_THRESHOLD 234
+#define DC_BDIV_QR_THRESHOLD 59
+#define DC_BDIV_Q_THRESHOLD 137
+
+#define INV_MULMOD_BNM1_THRESHOLD 36
+#define INV_NEWTON_THRESHOLD 327
+#define INV_APPR_THRESHOLD 268
+
+#define BINV_NEWTON_THRESHOLD 324
+#define REDC_1_TO_REDC_N_THRESHOLD 63
+
+#define MU_DIV_QR_THRESHOLD 1099
+#define MU_DIVAPPR_Q_THRESHOLD 1360
+#define MUPI_DIV_QR_THRESHOLD 138
+#define MU_BDIV_QR_THRESHOLD 889
+#define MU_BDIV_Q_THRESHOLD 1234
+
+#define MATRIX22_STRASSEN_THRESHOLD 18
+#define HGCD_THRESHOLD 167
+#define GCD_DC_THRESHOLD 518
+#define GCDEXT_DC_THRESHOLD 378
+#define JACOBI_BASE_METHOD 2
+
+#define GET_STR_DC_THRESHOLD 14
+#define GET_STR_PRECOMPUTE_THRESHOLD 25
+#define SET_STR_DC_THRESHOLD 577
+#define SET_STR_PRECOMPUTE_THRESHOLD 1217
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/s390_32/logops_n.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/s390_32/logops_n.asm
new file mode 100644
index 00000000000..1f2cd2a8f63
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/s390_32/logops_n.asm
@@ -0,0 +1,295 @@
+dnl S/390-32 logops.
+
+dnl Copyright 2011 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 variant 1 variant 2 variant 3
+C rp!=up rp=up
+C z900 ? ? ? ?
+C z990 2.5 1 2.75 2.75
+C z9 ? ? ?
+C z10 ? ? ?
+C z196 ? ? ?
+
+C INPUT PARAMETERS
+define(`rp', `%r2')
+define(`up', `%r3')
+define(`vp', `%r4')
+define(`nn', `%r5')
+
+ifdef(`OPERATION_and_n',`
+ define(`func',`mpn_and_n')
+ define(`VARIANT_1')
+ define(`LOGOPC',`nc')
+ define(`LOGOP',`n')')
+ifdef(`OPERATION_andn_n',`
+ define(`func',`mpn_andn_n')
+ define(`VARIANT_2')
+ define(`LOGOP',`n')')
+ifdef(`OPERATION_nand_n',`
+ define(`func',`mpn_nand_n')
+ define(`VARIANT_3')
+ define(`LOGOP',`n')')
+ifdef(`OPERATION_ior_n',`
+ define(`func',`mpn_ior_n')
+ define(`VARIANT_1')
+ define(`LOGOPC',`oc')
+ define(`LOGOP',`o')')
+ifdef(`OPERATION_iorn_n',`
+ define(`func',`mpn_iorn_n')
+ define(`VARIANT_2')
+ define(`LOGOP',`o')')
+ifdef(`OPERATION_nior_n',`
+ define(`func',`mpn_nior_n')
+ define(`VARIANT_3')
+ define(`LOGOP',`o')')
+ifdef(`OPERATION_xor_n',`
+ define(`func',`mpn_xor_n')
+ define(`VARIANT_1')
+ define(`LOGOPC',`xc')
+ define(`LOGOP',`x')')
+ifdef(`OPERATION_xnor_n',`
+ define(`func',`mpn_xnor_n')
+ define(`VARIANT_2')
+ define(`LOGOP',`x')')
+
+MULFUNC_PROLOGUE(mpn_and_n mpn_andn_n mpn_nand_n mpn_ior_n mpn_iorn_n mpn_nior_n mpn_xor_n mpn_xnor_n)
+
+ASM_START()
+PROLOGUE(func)
+ifdef(`VARIANT_1',`
+ cr rp, up
+ jne L(normal)
+
+ sll nn, 2
+ ahi nn, -1
+ lr %r1, nn
+ srl %r1, 8
+ ltr %r1, %r1 C < 256 bytes to copy?
+ je L(1)
+
+L(tp): LOGOPC 0(256, rp), 0(vp)
+ la rp, 256(rp)
+ la vp, 256(vp)
+ brct %r1, L(tp)
+
+L(1): bras %r1, L(2) C make r1 point to mvc insn
+ LOGOPC 0(1, rp), 0(vp)
+L(2): ex nn, 0(%r1) C execute mvc with length ((nn-1) mod 256)+1
+L(rtn): br %r14
+
+
+L(normal):
+ stm %r6, %r8, 12(%r15)
+ ahi nn, 3
+ lhi %r7, 3
+ lr %r0, nn
+ srl %r0, 2
+ nr %r7, nn C nn mod 4
+ je L(b1)
+ chi %r7, 2
+ jl L(b2)
+ jne L(top)
+
+L(b3): lm %r5, %r7, 0(up)
+ la up, 12(up)
+ LOGOP %r5, 0(vp)
+ LOGOP %r6, 4(vp)
+ LOGOP %r7, 8(vp)
+ stm %r5, %r7, 0(rp)
+ la rp, 12(rp)
+ la vp, 12(vp)
+ j L(mid)
+
+L(b1): l %r5, 0(up)
+ la up, 4(up)
+ LOGOP %r5, 0(vp)
+ st %r5, 0(rp)
+ la rp, 4(rp)
+ la vp, 4(vp)
+ j L(mid)
+
+L(b2): lm %r5, %r6, 0(up)
+ la up, 8(up)
+ LOGOP %r5, 0(vp)
+ LOGOP %r6, 4(vp)
+ stm %r5, %r6, 0(rp)
+ la rp, 8(rp)
+ la vp, 8(vp)
+ j L(mid)
+
+L(top): lm %r5, %r8, 0(up)
+ la up, 16(up)
+ LOGOP %r5, 0(vp)
+ LOGOP %r6, 4(vp)
+ LOGOP %r7, 8(vp)
+ LOGOP %r8, 12(vp)
+ stm %r5, %r8, 0(rp)
+ la rp, 16(rp)
+ la vp, 16(vp)
+L(mid): brct %r0, L(top)
+
+ lm %r6, %r8, 12(%r15)
+ br %r14
+')
+
+ifdef(`VARIANT_2',`
+ stm %r6, %r8, 12(%r15)
+ lhi %r1, -1
+
+ ahi nn, 3
+ lhi %r7, 3
+ lr %r0, nn
+ srl %r0, 2
+ nr %r7, nn C nn mod 4
+ je L(b1)
+ chi %r7, 2
+ jl L(b2)
+ jne L(top)
+
+L(b3): lm %r5, %r7, 0(vp)
+ la vp, 12(vp)
+ xr %r5, %r1
+ xr %r6, %r1
+ xr %r7, %r1
+ LOGOP %r5, 0(up)
+ LOGOP %r6, 4(up)
+ LOGOP %r7, 8(up)
+ stm %r5, %r7, 0(rp)
+ la rp, 12(rp)
+ la up, 12(up)
+ j L(mid)
+
+L(b1): l %r5, 0(vp)
+ la vp, 4(vp)
+ xr %r5, %r1
+ LOGOP %r5, 0(up)
+ st %r5, 0(rp)
+ la rp, 4(rp)
+ la up, 4(up)
+ j L(mid)
+
+L(b2): lm %r5, %r6, 0(vp)
+ la vp, 8(vp)
+ xr %r5, %r1
+ xr %r6, %r1
+ LOGOP %r5, 0(up)
+ LOGOP %r6, 4(up)
+ stm %r5, %r6, 0(rp)
+ la rp, 8(rp)
+ la up, 8(up)
+ j L(mid)
+
+L(top): lm %r5, %r8, 0(vp)
+ la vp, 16(vp)
+ xr %r5, %r1
+ xr %r6, %r1
+ xr %r7, %r1
+ xr %r8, %r1
+ LOGOP %r5, 0(up)
+ LOGOP %r6, 4(up)
+ LOGOP %r7, 8(up)
+ LOGOP %r8, 12(up)
+ la up, 16(up)
+ stm %r5, %r8, 0(rp)
+ la rp, 16(rp)
+L(mid): brct %r0, L(top)
+
+ lm %r6, %r8, 12(%r15)
+ br %r14
+')
+
+ifdef(`VARIANT_3',`
+ stm %r6, %r8, 12(%r15)
+ lhi %r1, -1
+
+ ahi nn, 3
+ lhi %r7, 3
+ lr %r0, nn
+ srl %r0, 2
+ nr %r7, nn C nn mod 4
+ je L(b1)
+ chi %r7, 2
+ jl L(b2)
+ jne L(top)
+
+L(b3): lm %r5, %r7, 0(vp)
+ la vp, 12(vp)
+ LOGOP %r5, 0(up)
+ LOGOP %r6, 4(up)
+ xr %r5, %r1
+ xr %r6, %r1
+ LOGOP %r7, 8(up)
+ xr %r7, %r1
+ stm %r5, %r7, 0(rp)
+ la rp, 12(rp)
+ la up, 12(up)
+ j L(mid)
+
+L(b1): l %r5, 0(vp)
+ la vp, 4(vp)
+ LOGOP %r5, 0(up)
+ xr %r5, %r1
+ st %r5, 0(rp)
+ la rp, 4(rp)
+ la up, 4(up)
+ j L(mid)
+
+L(b2): lm %r5, %r6, 0(vp)
+ la vp, 8(vp)
+ LOGOP %r5, 0(up)
+ LOGOP %r6, 4(up)
+ xr %r5, %r1
+ xr %r6, %r1
+ stm %r5, %r6, 0(rp)
+ la rp, 8(rp)
+ la up, 8(up)
+ j L(mid)
+
+L(top): lm %r5, %r8, 0(vp)
+ la vp, 16(vp)
+ LOGOP %r5, 0(up)
+ LOGOP %r6, 4(up)
+ xr %r5, %r1
+ xr %r6, %r1
+ LOGOP %r7, 8(up)
+ LOGOP %r8, 12(up)
+ xr %r7, %r1
+ xr %r8, %r1
+ stm %r5, %r8, 0(rp)
+ la up, 16(up)
+ la rp, 16(rp)
+L(mid): brct %r0, L(top)
+
+ lm %r6, %r8, 12(%r15)
+ br %r14
+')
+
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/s390_32/lshift.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/s390_32/lshift.asm
new file mode 100644
index 00000000000..da7d76e844a
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/s390_32/lshift.asm
@@ -0,0 +1,144 @@
+dnl S/390-32 mpn_lshift.
+
+dnl Copyright 2011 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 z900 6
+C z990 3
+C z9 ?
+C z10 ?
+C z196 ?
+
+C TODO
+C *
+
+C INPUT PARAMETERS
+define(`rp', `%r2')
+define(`up', `%r3')
+define(`n', `%r4')
+define(`cnt', `%r5')
+
+ASM_START()
+PROLOGUE(mpn_lshift)
+ lr %r1, n
+ sll %r1, 2
+ stm %r6, %r12, 24(%r15)
+ la up, 0(%r1,up) C put up near end of U
+ la rp, 0(%r1,rp) C put rp near end of R
+ ahi up, -20
+ ahi rp, -16
+ lhi %r8, 32
+ sr %r8, cnt
+ l %r12, 16(up)
+ srl %r12, 0(%r8) C return value
+ lhi %r7, 3
+ nr %r7, n
+ srl n, 2
+ je L(b0)
+ chi %r7, 2
+ jl L(b1)
+ je L(b2)
+
+L(b3): l %r10, 16(up)
+ l %r11, 12(up)
+ l %r9, 8(up)
+ ahi up, -8
+ lr %r8, %r11
+ sldl %r10, 0(cnt)
+ sldl %r8, 0(cnt)
+ st %r10, 12(rp)
+ st %r8, 8(rp)
+ ahi rp, -8
+ ltr n, n
+ je L(end)
+ j L(top)
+
+L(b2): l %r10, 16(up)
+ l %r11, 12(up)
+ ahi up, -4
+ sldl %r10, 0(cnt)
+ st %r10, 12(rp)
+ ahi rp, -4
+ ltr n, n
+ je L(end)
+ j L(top)
+
+L(b1): ltr n, n
+ je L(end)
+ j L(top)
+
+L(b0): l %r10,16(up)
+ l %r8, 12(up)
+ l %r6, 8(up)
+ l %r0, 4(up)
+ ahi up, -12
+ lr %r11, %r8
+ lr %r9, %r6
+ lr %r7, %r0
+ sldl %r10,0(cnt)
+ sldl %r8, 0(cnt)
+ sldl %r6, 0(cnt)
+ st %r10, 12(rp)
+ st %r8, 8(rp)
+ st %r6, 4(rp)
+ ahi rp, -12
+ ahi n, -1
+ je L(end)
+
+ ALIGN(8)
+L(top): l %r10, 16(up)
+ l %r8, 12(up)
+ l %r6, 8(up)
+ l %r0, 4(up)
+ l %r1, 0(up)
+ lr %r11, %r8
+ lr %r9, %r6
+ lr %r7, %r0
+ ahi up, -16
+ sldl %r10, 0(cnt)
+ sldl %r8, 0(cnt)
+ sldl %r6, 0(cnt)
+ sldl %r0, 0(cnt)
+ st %r10, 12(rp)
+ st %r8, 8(rp)
+ st %r6, 4(rp)
+ st %r0, 0(rp)
+ ahi rp, -16
+ brct n, L(top)
+
+L(end): l %r10, 16(up)
+ sll %r10, 0(cnt)
+ st %r10, 12(rp)
+
+ lr %r2, %r12
+ lm %r6, %r12, 24(%r15)
+ br %r14
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/s390_32/lshiftc.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/s390_32/lshiftc.asm
new file mode 100644
index 00000000000..f6016732494
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/s390_32/lshiftc.asm
@@ -0,0 +1,156 @@
+dnl S/390-32 mpn_lshiftc.
+
+dnl Copyright 2011 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 z900 7
+C z990 3.375
+C z9 ?
+C z10 ?
+C z196 ?
+
+C TODO
+C *
+
+C INPUT PARAMETERS
+define(`rp', `%r2')
+define(`up', `%r3')
+define(`n', `%r4')
+define(`cnt', `%r5')
+
+ASM_START()
+PROLOGUE(mpn_lshiftc)
+ lr %r1, n
+ sll %r1, 2
+ stm %r6, %r13, 24(%r15)
+ la up, 0(%r1,up) C put up near end of U
+ la rp, 0(%r1,rp) C put rp near end of R
+ ahi up, -20
+ ahi rp, -16
+ lhi %r8, 32
+ sr %r8, cnt
+ l %r12, 16(up)
+ srl %r12, 0(%r8) C return value
+ lhi %r13, -1
+ lhi %r7, 3
+ nr %r7, n
+ srl n, 2
+ je L(b0)
+ chi %r7, 2
+ jl L(b1)
+ je L(b2)
+
+L(b3): l %r10, 16(up)
+ l %r11, 12(up)
+ l %r9, 8(up)
+ ahi up, -8
+ lr %r8, %r11
+ sldl %r10, 0(cnt)
+ sldl %r8, 0(cnt)
+ xr %r10, %r13
+ xr %r8, %r13
+ st %r10, 12(rp)
+ st %r8, 8(rp)
+ ahi rp, -8
+ ltr n, n
+ je L(end)
+ j L(top)
+
+L(b2): l %r10, 16(up)
+ l %r11, 12(up)
+ ahi up, -4
+ sldl %r10, 0(cnt)
+ xr %r10, %r13
+ st %r10, 12(rp)
+ ahi rp, -4
+ ltr n, n
+ je L(end)
+ j L(top)
+
+L(b1): ltr n, n
+ je L(end)
+ j L(top)
+
+L(b0): l %r10,16(up)
+ l %r8, 12(up)
+ l %r6, 8(up)
+ l %r0, 4(up)
+ ahi up, -12
+ lr %r11, %r8
+ lr %r9, %r6
+ lr %r7, %r0
+ sldl %r10,0(cnt)
+ sldl %r8, 0(cnt)
+ sldl %r6, 0(cnt)
+ xr %r10, %r13
+ xr %r8, %r13
+ xr %r6, %r13
+ st %r10, 12(rp)
+ st %r8, 8(rp)
+ st %r6, 4(rp)
+ ahi rp, -12
+ ahi n, -1
+ je L(end)
+
+ ALIGN(8)
+L(top): l %r10, 16(up)
+ l %r8, 12(up)
+ l %r6, 8(up)
+ l %r0, 4(up)
+ l %r1, 0(up)
+ lr %r11, %r8
+ lr %r9, %r6
+ lr %r7, %r0
+ ahi up, -16
+ sldl %r10, 0(cnt)
+ sldl %r8, 0(cnt)
+ sldl %r6, 0(cnt)
+ sldl %r0, 0(cnt)
+ xr %r10, %r13
+ xr %r8, %r13
+ xr %r6, %r13
+ xr %r0, %r13
+ st %r10, 12(rp)
+ st %r8, 8(rp)
+ st %r6, 4(rp)
+ st %r0, 0(rp)
+ ahi rp, -16
+ brct n, L(top)
+
+L(end): l %r10, 16(up)
+ sll %r10, 0(cnt)
+ xr %r10, %r13
+ st %r10, 12(rp)
+
+ lr %r2, %r12
+ lm %r6, %r13, 24(%r15)
+ br %r14
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/s390_32/mul_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/s390_32/mul_1.asm
new file mode 100644
index 00000000000..e3ad0c59d8c
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/s390_32/mul_1.asm
@@ -0,0 +1,85 @@
+dnl S/390 mpn_mul_1 -- Multiply a limb vector with a limb and store the
+dnl result in a second limb vector.
+
+dnl Copyright 2001 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(`rp',2)
+define(`up',3)
+define(`n',4)
+define(`vlimb',5)
+define(`cylimb',7)
+
+ASM_START()
+PROLOGUE(mpn_mul_1)
+ stm 6,7,24(15)
+ slr cylimb,cylimb # clear cylimb
+ ltr vlimb,vlimb
+ jnl .Loopp
+
+.Loopn: l 1,0(up) # load from u
+ lr 6,1 #
+ mr 0,vlimb # multiply signed
+ alr 0,6 # add vlimb to phi
+ sra 6,31 # make mask
+ nr 6,vlimb # 0 or vlimb
+ alr 0,6 # conditionally add vlimb to phi
+ alr 1,cylimb # add carry limb to plo
+ brc 8+4,+8 # branch if not carry
+ ahi 0,1 # increment phi
+ lr cylimb,0 # new cylimb
+ st 1,0(rp) # store
+ la up,4(,up)
+ la rp,4(,rp)
+ brct n,.Loopn
+
+ lr 2,cylimb
+ lm 6,7,24(15)
+ br 14
+
+.Loopp: l 1,0(up) # load from u
+ lr 6,1 #
+ mr 0,vlimb # multiply signed
+ sra 6,31 # make mask
+ nr 6,vlimb # 0 or vlimb
+ alr 0,6 # conditionally add vlimb to phi
+ alr 1,cylimb # add carry limb to plo
+ brc 8+4,+8 # branch if not carry
+ ahi 0,1 # increment phi
+ lr cylimb,0 # new cylimb
+ st 1,0(rp) # store
+ la up,4(,up)
+ la rp,4(,rp)
+ brct n,.Loopp
+
+ lr 2,cylimb
+ lm 6,7,24(15)
+ br 14
+EPILOGUE(mpn_mul_1)
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/s390_32/rshift.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/s390_32/rshift.asm
new file mode 100644
index 00000000000..5f2cf37ca0a
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/s390_32/rshift.asm
@@ -0,0 +1,138 @@
+dnl S/390-32 mpn_rshift.
+
+dnl Copyright 2011 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 z900 6
+C z990 3
+C z9 ?
+C z10 ?
+C z196 ?
+
+C TODO
+C *
+
+C INPUT PARAMETERS
+define(`rp', `%r2')
+define(`up', `%r3')
+define(`n', `%r4')
+define(`cnt', `%r5')
+
+ASM_START()
+PROLOGUE(mpn_rshift)
+ stm %r6, %r12, 24(%r15)
+ lhi %r8, 32
+ sr %r8, cnt
+ l %r12, 0(up)
+ sll %r12, 0(%r8) C return value
+ lhi %r7, 3
+ nr %r7, n
+ srl n, 2
+ je L(b0)
+ chi %r7, 2
+ jl L(b1)
+ je L(b2)
+
+L(b3): l %r11, 0(up)
+ l %r10, 4(up)
+ l %r8, 8(up)
+ ahi up, 8
+ lr %r9, %r10
+ srdl %r10, 0(cnt)
+ srdl %r8, 0(cnt)
+ st %r11, 0(rp)
+ st %r9, 4(rp)
+ ahi rp, 8
+ ltr n, n
+ je L(end)
+ j L(top)
+
+L(b2): l %r11, 0(up)
+ l %r10, 4(up)
+ ahi up, 4
+ srdl %r10, 0(cnt)
+ st %r11, 0(rp)
+ ahi rp, 4
+ ltr n, n
+ je L(end)
+ j L(top)
+
+L(b1): ltr n, n
+ je L(end)
+ j L(top)
+
+L(b0): l %r11, 0(up)
+ l %r9, 4(up)
+ l %r7, 8(up)
+ l %r1, 12(up)
+ ahi up, 12
+ lr %r10, %r9
+ lr %r8, %r7
+ lr %r6, %r1
+ srdl %r10, 0(cnt)
+ srdl %r8, 0(cnt)
+ srdl %r6, 0(cnt)
+ st %r11, 0(rp)
+ st %r9, 4(rp)
+ st %r7, 8(rp)
+ ahi rp, 12
+ ahi n, -1
+ je L(end)
+
+ ALIGN(8)
+L(top): l %r11, 0(up)
+ l %r9, 4(up)
+ l %r7, 8(up)
+ l %r1, 12(up)
+ l %r0, 16(up)
+ lr %r10, %r9
+ lr %r8, %r7
+ lr %r6, %r1
+ ahi up, 16
+ srdl %r10, 0(cnt)
+ srdl %r8, 0(cnt)
+ srdl %r6, 0(cnt)
+ srdl %r0, 0(cnt)
+ st %r11, 0(rp)
+ st %r9, 4(rp)
+ st %r7, 8(rp)
+ st %r1, 12(rp)
+ ahi rp, 16
+ brct n, L(top)
+
+L(end): l %r11, 0(up)
+ srl %r11, 0(cnt)
+ st %r11, 0(rp)
+
+ lr %r2, %r12
+ lm %r6, %r12, 24(%r15)
+ br %r14
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/s390_32/submul_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/s390_32/submul_1.asm
new file mode 100644
index 00000000000..da7d849d5d3
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/s390_32/submul_1.asm
@@ -0,0 +1,93 @@
+dnl S/390 mpn_submul_1 -- Multiply a limb vector with a limb and subtract the
+dnl result from a second limb vector.
+
+dnl Copyright 2001 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(`rp',2)
+define(`up',3)
+define(`n',4)
+define(`vlimb',5)
+define(`cylimb',7)
+
+ASM_START()
+PROLOGUE(mpn_submul_1)
+ stm 6,7,24(15)
+ slr cylimb,cylimb # clear cylimb
+ ltr vlimb,vlimb
+ jnl .Loopp
+
+.Loopn: l 1,0(up) # load from u
+ lr 6,1 #
+ mr 0,vlimb # multiply signed
+ alr 0,6 # add vlimb to phi
+ sra 6,31 # make mask
+ nr 6,vlimb # 0 or vlimb
+ alr 0,6 # conditionally add vlimb to phi
+ alr 1,cylimb # add carry limb to plo
+ brc 8+4,+8 # branch if not carry
+ ahi 0,1 # increment phi
+ l 6,0(rp) # load r limb
+ slr 6,1 # add u limb to plo
+ brc 2+1,+8 # branch if not carry
+ ahi 0,1 # increment phi
+ lr cylimb,0 # new cylimb
+ st 6,0(rp) # store
+ la up,4(,up)
+ la rp,4(,rp)
+ brct n,.Loopn
+
+ lr 2,cylimb
+ lm 6,7,24(15)
+ br 14
+
+.Loopp: l 1,0(up) # load from u
+ lr 6,1 #
+ mr 0,vlimb # multiply signed
+ sra 6,31 # make mask
+ nr 6,vlimb # 0 or vlimb
+ alr 0,6 # conditionally add vlimb to phi
+ alr 1,cylimb # add carry limb to plo
+ brc 8+4,+8 # branch if not carry
+ ahi 0,1 # increment phi
+ l 6,0(rp) # load r limb
+ slr 6,1 # add u limb to plo
+ brc 2+1,+8 # branch if not carry
+ ahi 0,1 # increment phi
+ lr cylimb,0 # new cylimb
+ st 6,0(rp) # store
+ la up,4(,up)
+ la rp,4(,rp)
+ brct n,.Loopp
+
+ lr 2,cylimb
+ lm 6,7,24(15)
+ br 14
+EPILOGUE(mpn_submul_1)
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/s390_64/README b/Build/source/libs/gmp/gmp-6.0.0/mpn/s390_64/README
new file mode 100644
index 00000000000..8f482a9cd29
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/s390_64/README
@@ -0,0 +1,88 @@
+Copyright 2011 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/.
+
+
+
+There are 5 generations of 64-but s390 processors, z900, z990, z9,
+z10, and z196. The current GMP code was optimised for the two oldest,
+z900 and z990.
+
+
+mpn_copyi
+
+This code makes use of a loop around MVC. It almost surely runs very
+close to optimally. A small improvement could be done by using one
+MVC for size 256 bytes, now we use two (we use an extra MVC when
+copying any multiple of 256 bytes).
+
+
+mpn_copyd
+
+We have tried several feed-in variants here, branch tree, jump table
+and computed goto. The fastest (on z990) turned out to be computed
+goto.
+
+An approach not tried is EX of LMG and STMG, modifying the register set
+on-the-fly. Using that trick, we could completely avoid using
+separate feed-in paths.
+
+
+mpn_lshift, mpn_rshift
+
+The current code runs at pipeline decode bandwith on z990.
+
+
+mpn_add_n, mpn_sub_n
+
+The current code is 4-way unrolled. It should be unrolled more, at
+least 8x, in order to reach 2.5 c/l.
+
+
+mpn_mul_1, mpn_addmul_1, mpn_submul_1
+
+The current code is very naive, but due to the non-pipelined nature of
+MLGR on z900 and z990, more sophisticated code would not gain much.
+
+On z10 one would need to cluster at least 4 MLGR together, in order to
+reduce stalling.
+
+On z196, one surely want to use unrolling and pipelining, to perhaps
+reach around 12 c/l. A major issue here and on z10 is ALCGR's 3 cycle
+stalling.
+
+
+mpn_mul_2, mpn_addmul_2
+
+At least for older machines (z900, z990) with very slow MLGR, we
+should use Karatsuba's algorithm on 2-limb units, making mul_2 and
+addmul_2 the main multiplication primitives. The newer machines might
+benefit less from this approach, perhaps in particular z10, where MLGR
+clustering is more important.
+
+With Karatsuba, one could hope for around 16 cycles per accumulated
+128 cross product, on z990.
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/s390_64/addmul_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/s390_64/addmul_1.asm
new file mode 100644
index 00000000000..84cca123613
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/s390_64/addmul_1.asm
@@ -0,0 +1,72 @@
+dnl S/390-64 mpn_addmul_1
+
+dnl Copyright 2011 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 z900 34
+C z990 23
+C z9 ?
+C z10 28
+C z196 ?
+
+C INPUT PARAMETERS
+define(`rp', `%r2')
+define(`up', `%r3')
+define(`n', `%r4')
+define(`v0', `%r5')
+
+define(`z', `%r9')
+
+ASM_START()
+PROLOGUE(mpn_addmul_1)
+ stmg %r9, %r12, 72(%r15)
+ lghi %r12, 0 C zero index register
+ aghi %r12, 0 C clear carry flag
+ lghi %r11, 0 C clear carry limb
+ lghi z, 0 C keep register zero
+
+L(top): lg %r1, 0(%r12,up)
+ lg %r10, 0(%r12,rp)
+ mlgr %r0, v0
+ alcgr %r1, %r10
+ alcgr %r0, z
+ algr %r1, %r11
+ lgr %r11, %r0
+ stg %r1, 0(%r12,rp)
+ la %r12, 8(%r12)
+ brctg n, L(top)
+
+ lghi %r2, 0
+ alcgr %r2, %r11
+
+ lmg %r9, %r12, 72(%r15)
+ br %r14
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/s390_64/aorrlsh1_n.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/s390_64/aorrlsh1_n.asm
new file mode 100644
index 00000000000..697259efefb
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/s390_64/aorrlsh1_n.asm
@@ -0,0 +1,168 @@
+dnl S/390-64 mpn_addlsh1_n and mpn_rsblsh1_n.
+
+dnl Copyright 2011 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 z900 9
+C z990 4.75
+C z9 ?
+C z10 11
+C z196 ?
+
+C TODO
+C * Optimise for small n, avoid 'la' like in aors_n.asm.
+C * Tune to reach 3.5 c/l. For addlsh1, we could let the main alcgr propagate
+C carry to the lsh1 alcgr.
+C * Compute RETVAL for sublsh1_n less stupidly.
+
+C INPUT PARAMETERS
+define(`rp', `%r2')
+define(`up', `%r3')
+define(`vp', `%r4')
+define(`n', `%r5')
+
+ifdef(`OPERATION_addlsh1_n',`
+ define(ADSB, alg)
+ define(ADSBC, alcg)
+ define(INITCY, `lghi %r9, -1')
+ define(RETVAL, `la %r2, 2(%r1,%r9)')
+ define(func, mpn_addlsh1_n)
+')
+ifdef(`OPERATION_rsblsh1_n',`
+ define(ADSB, slg)
+ define(ADSBC, slbg)
+ define(INITCY, `lghi %r9, 0')
+ define(RETVAL,`dnl
+ algr %r1, %r9
+ lghi %r2, 1
+ algr %r2, %r1')
+ define(func, mpn_rsblsh1_n)
+')
+
+MULFUNC_PROLOGUE(mpn_addlsh1_n mpn_rsblsh1_n)
+
+ASM_START()
+PROLOGUE(func)
+ stmg %r6, %r9, 48(%r15)
+
+ aghi n, 3
+ lghi %r7, 3
+ srlg %r0, n, 2
+ ngr %r7, n C n mod 4
+ je L(b1)
+ cghi %r7, 2
+ jl L(b2)
+ jne L(b0)
+
+L(b3): lmg %r5, %r7, 0(vp)
+ la vp, 24(vp)
+
+ algr %r5, %r5
+ alcgr %r6, %r6
+ alcgr %r7, %r7
+ slbgr %r1, %r1
+
+ ADSB %r5, 0(up)
+ ADSBC %r6, 8(up)
+ ADSBC %r7, 16(up)
+ la up, 24(up)
+ slbgr %r9, %r9
+
+ stmg %r5, %r7, 0(rp)
+ la rp, 24(rp)
+ brctg %r0, L(top)
+ j L(end)
+
+L(b0): lghi %r1, -1
+ INITCY
+ j L(top)
+
+L(b1): lg %r5, 0(vp)
+ la vp, 8(vp)
+
+ algr %r5, %r5
+ slbgr %r1, %r1
+ ADSB %r5, 0(up)
+ la up, 8(up)
+ slbgr %r9, %r9
+
+ stg %r5, 0(rp)
+ la rp, 8(rp)
+ brctg %r0, L(top)
+ j L(end)
+
+L(b2): lmg %r5, %r6, 0(vp)
+ la vp, 16(vp)
+
+ algr %r5, %r5
+ alcgr %r6, %r6
+ slbgr %r1, %r1
+
+ ADSB %r5, 0(up)
+ ADSBC %r6, 8(up)
+ la up, 16(up)
+ slbgr %r9, %r9
+
+ stmg %r5, %r6, 0(rp)
+ la rp, 16(rp)
+ brctg %r0, L(top)
+ j L(end)
+
+L(top): lmg %r5, %r8, 0(vp)
+ la vp, 32(vp)
+
+ aghi %r1, 1 C restore carry
+
+ alcgr %r5, %r5
+ alcgr %r6, %r6
+ alcgr %r7, %r7
+ alcgr %r8, %r8
+
+ slbgr %r1, %r1 C save carry
+
+ aghi %r9, 1 C restore carry
+
+ ADSBC %r5, 0(up)
+ ADSBC %r6, 8(up)
+ ADSBC %r7, 16(up)
+ ADSBC %r8, 24(up)
+ la up, 32(up)
+
+ slbgr %r9, %r9 C save carry
+
+ stmg %r5, %r8, 0(rp)
+ la rp, 32(rp)
+ brctg %r0, L(top)
+
+L(end): RETVAL
+ lmg %r6, %r9, 48(%r15)
+ br %r14
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/s390_64/aors_n.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/s390_64/aors_n.asm
new file mode 100644
index 00000000000..a3c3ca791c2
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/s390_64/aors_n.asm
@@ -0,0 +1,136 @@
+dnl S/390-64 mpn_add_n and mpn_sub_n.
+
+dnl Copyright 2011 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 z900 5.5
+C z990 3
+C z9 ?
+C z10 6
+C z196 ?
+
+C TODO
+C * Optimise for small n
+C * Use r0 and save/restore one less register
+C * Using logops_n's v1 inner loop operand order make the loop about 20%
+C faster, at the expense of highly alignment-dependent performance.
+
+C INPUT PARAMETERS
+define(`rp', `%r2')
+define(`up', `%r3')
+define(`vp', `%r4')
+define(`n', `%r5')
+
+ifdef(`OPERATION_add_n', `
+ define(ADSB, alg)
+ define(ADSBCR, alcgr)
+ define(ADSBC, alcg)
+ define(RETVAL,`dnl
+ lghi %r2, 0
+ alcgr %r2, %r2')
+ define(func, mpn_add_n)
+ define(func_nc, mpn_add_nc)')
+ifdef(`OPERATION_sub_n', `
+ define(ADSB, slg)
+ define(ADSBCR, slbgr)
+ define(ADSBC, slbg)
+ define(RETVAL,`dnl
+ slbgr %r2, %r2
+ lcgr %r2, %r2')
+ define(func, mpn_sub_n)
+ define(func_nc, mpn_sub_nc)')
+
+MULFUNC_PROLOGUE(mpn_add_n mpn_sub_n)
+
+ASM_START()
+PROLOGUE(func)
+ stmg %r6, %r8, 48(%r15)
+
+ aghi n, 3
+ lghi %r7, 3
+ srlg %r1, n, 2
+ ngr %r7, n C n mod 4
+ je L(b1)
+ cghi %r7, 2
+ jl L(b2)
+ jne L(b0)
+
+L(b3): lmg %r5, %r7, 0(up)
+ la up, 24(up)
+ ADSB %r5, 0(vp)
+ ADSBC %r6, 8(vp)
+ ADSBC %r7, 16(vp)
+ la vp, 24(vp)
+ stmg %r5, %r7, 0(rp)
+ la rp, 24(rp)
+ brctg %r1, L(top)
+ j L(end)
+
+L(b0): lmg %r5, %r8, 0(up) C This redundant insns is no mistake,
+ la up, 32(up) C it is needed to make main loop run
+ ADSB %r5, 0(vp) C fast for n = 0 (mod 4).
+ ADSBC %r6, 8(vp)
+ j L(m0)
+
+L(b1): lg %r5, 0(up)
+ la up, 8(up)
+ ADSB %r5, 0(vp)
+ la vp, 8(vp)
+ stg %r5, 0(rp)
+ la rp, 8(rp)
+ brctg %r1, L(top)
+ j L(end)
+
+L(b2): lmg %r5, %r6, 0(up)
+ la up, 16(up)
+ ADSB %r5, 0(vp)
+ ADSBC %r6, 8(vp)
+ la vp, 16(vp)
+ stmg %r5, %r6, 0(rp)
+ la rp, 16(rp)
+ brctg %r1, L(top)
+ j L(end)
+
+L(top): lmg %r5, %r8, 0(up)
+ la up, 32(up)
+ ADSBC %r5, 0(vp)
+ ADSBC %r6, 8(vp)
+L(m0): ADSBC %r7, 16(vp)
+ ADSBC %r8, 24(vp)
+ la vp, 32(vp)
+ stmg %r5, %r8, 0(rp)
+ la rp, 32(rp)
+ brctg %r1, L(top)
+
+L(end): RETVAL
+ lmg %r6, %r8, 48(%r15)
+ br %r14
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/s390_64/bdiv_dbm1c.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/s390_64/bdiv_dbm1c.asm
new file mode 100644
index 00000000000..35e900a2797
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/s390_64/bdiv_dbm1c.asm
@@ -0,0 +1,65 @@
+dnl S/390-64 mpn_bdiv_dbm1c
+
+dnl Copyright 2011 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 z900 29
+C z990 22
+C z9 ?
+C z10 19
+C z196 ?
+
+C INPUT PARAMETERS
+define(`qp', `%r2')
+define(`up', `%r3')
+define(`n', `%r4')
+define(`bd', `%r5')
+define(`cy', `%r6')
+
+ASM_START()
+ TEXT
+ ALIGN(16)
+PROLOGUE(mpn_bdiv_dbm1c)
+ stmg %r6, %r7, 48(%r15)
+ lghi %r7, 0 C zero index register
+
+L(top): lg %r1, 0(%r7,up)
+ mlgr %r0, bd
+ slgr %r6, %r1
+ stg %r6, 0(%r7,qp)
+ la %r7, 8(%r7)
+ slbgr %r6, %r0
+ brctg n, L(top)
+
+ lgr %r2, %r6
+ lmg %r6, %r7, 48(%r15)
+ br %r14
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/s390_64/copyd.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/s390_64/copyd.asm
new file mode 100644
index 00000000000..8631e19f008
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/s390_64/copyd.asm
@@ -0,0 +1,144 @@
+dnl S/390-64 mpn_copyd
+
+dnl Copyright 2011 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 z900 2.67
+C z990 1.5
+C z9 ?
+C z10 1.8
+C z196 ?
+
+C FIXME:
+C * Avoid saving/restoring callee-saves registers for n < 3. This could be
+C done by setting rp=r1, up=r2, i=r0 and r3,r4,r5 for clock regs.
+C We could then use r3...r10 in main loop.
+C * Could we use some EX trick, modifying lmg/stmg, for the feed-in code?
+
+C INPUT PARAMETERS
+define(`rp_param', `%r2')
+define(`up_param', `%r3')
+define(`n', `%r4')
+
+define(`rp', `%r8')
+define(`up', `%r9')
+
+ASM_START()
+PROLOGUE(mpn_copyd)
+ stmg %r6, %r11, 48(%r15)
+
+ sllg %r1, n, 3
+ la %r10, 8(n)
+ aghi %r1, -64
+ srlg %r10, %r10, 3
+ lghi %r11, -64
+
+ la rp, 0(%r1,rp_param) C FIXME use lay on z990 and later
+ la up, 0(%r1,up_param) C FIXME use lay on z990 and later
+
+ lghi %r7, 7
+ ngr %r7, n C n mod 8
+ cghi %r7, 2
+ jh L(b34567)
+ cghi %r7, 1
+ je L(b1)
+ jh L(b2)
+
+L(b0): brctg %r10, L(top)
+ j L(end)
+
+L(b1): lg %r0, 56(up)
+ aghi up, -8
+ stg %r0, 56(rp)
+ aghi rp, -8
+ brctg %r10, L(top)
+ j L(end)
+
+L(b2): lmg %r0, %r1, 48(up)
+ aghi up, -16
+ stmg %r0, %r1, 48(rp)
+ aghi rp, -16
+ brctg %r10, L(top)
+ j L(end)
+
+L(b34567):
+ cghi %r7, 4
+ jl L(b3)
+ je L(b4)
+ cghi %r7, 6
+ je L(b6)
+ jh L(b7)
+
+L(b5): lmg %r0, %r4, 24(up)
+ aghi up, -40
+ stmg %r0, %r4, 24(rp)
+ aghi rp, -40
+ brctg %r10, L(top)
+ j L(end)
+
+L(b3): lmg %r0, %r2, 40(up)
+ aghi up, -24
+ stmg %r0, %r2, 40(rp)
+ aghi rp, -24
+ brctg %r10, L(top)
+ j L(end)
+
+L(b4): lmg %r0, %r3, 32(up)
+ aghi up, -32
+ stmg %r0, %r3, 32(rp)
+ aghi rp, -32
+ brctg %r10, L(top)
+ j L(end)
+
+L(b6): lmg %r0, %r5, 16(up)
+ aghi up, -48
+ stmg %r0, %r5, 16(rp)
+ aghi rp, -48
+ brctg %r10, L(top)
+ j L(end)
+
+L(b7): lmg %r0, %r6, 8(up)
+ aghi up, -56
+ stmg %r0, %r6, 8(rp)
+ aghi rp, -56
+ brctg %r10, L(top)
+ j L(end)
+
+L(top): lmg %r0, %r7, 0(up)
+ la up, 0(%r11,up)
+ stmg %r0, %r7, 0(rp)
+ la rp, 0(%r11,rp)
+ brctg %r10, L(top)
+
+L(end): lmg %r6, %r11, 48(%r15)
+ br %r14
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/s390_64/copyi.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/s390_64/copyi.asm
new file mode 100644
index 00000000000..bfb88814eaa
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/s390_64/copyi.asm
@@ -0,0 +1,68 @@
+dnl S/390-64 mpn_copyi
+
+dnl Copyright 2011 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 z900 1.25
+C z990 0.75
+C z9 ?
+C z10 1
+C z196 ?
+
+C NOTE
+C * This is based on GNU libc memcpy which was written by Martin Schwidefsky.
+
+C INPUT PARAMETERS
+define(`rp', `%r2')
+define(`up', `%r3')
+define(`n', `%r4')
+
+ASM_START()
+PROLOGUE(mpn_copyi)
+ ltgr %r4, %r4
+ sllg %r4, %r4, 3
+ je L(rtn)
+ aghi %r4, -1
+ srlg %r5, %r4, 8
+ ltgr %r5, %r5 C < 256 bytes to copy?
+ je L(1)
+
+L(top): mvc 0(256, rp), 0(up)
+ la rp, 256(rp)
+ la up, 256(up)
+ brctg %r5, L(top)
+
+L(1): bras %r5, L(2) C make r5 point to mvc insn
+ mvc 0(1, rp), 0(up)
+L(2): ex %r4, 0(%r5) C execute mvc with length ((n-1) mod 256)+1
+L(rtn): br %r14
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/s390_64/gmp-mparam.h b/Build/source/libs/gmp/gmp-6.0.0/mpn/s390_64/gmp-mparam.h
new file mode 100644
index 00000000000..dacd9966a4b
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/s390_64/gmp-mparam.h
@@ -0,0 +1,175 @@
+/* S/390-64 gmp-mparam.h -- Compiler/machine parameter header file.
+
+Copyright 1991, 1993, 1994, 2000-2011 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
+
+/* 1200 MHz z990 */
+
+#define DIVREM_1_NORM_THRESHOLD 0 /* always */
+#define DIVREM_1_UNNORM_THRESHOLD 0 /* always */
+#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 DIV_QR_1N_PI1_METHOD 1
+#define DIV_QR_1_NORM_THRESHOLD 1
+#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 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 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 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 MULMID_TOOM42_THRESHOLD 20
+
+#define MULMOD_BNM1_THRESHOLD 10
+#define SQRMOD_BNM1_THRESHOLD 11
+
+#define MUL_FFT_MODF_THRESHOLD 220 /* 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}, \
+ { 13, 9}, { 7, 8}, { 19, 9}, { 11, 8}, \
+ { 25,10}, { 7, 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,10}, { 79,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
+
+#define MULLO_BASECASE_THRESHOLD 2
+#define MULLO_DC_THRESHOLD 33
+#define MULLO_MUL_N_THRESHOLD 3176
+
+#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 INV_MULMOD_BNM1_THRESHOLD 43
+#define INV_NEWTON_THRESHOLD 129
+#define INV_APPR_THRESHOLD 117
+
+#define BINV_NEWTON_THRESHOLD 149
+#define REDC_1_TO_REDC_N_THRESHOLD 38
+
+#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 POWM_SEC_TABLE 4,23,274,961,2783
+
+#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 GET_STR_DC_THRESHOLD 30
+#define GET_STR_PRECOMPUTE_THRESHOLD 41
+#define SET_STR_DC_THRESHOLD 402
+#define SET_STR_PRECOMPUTE_THRESHOLD 1104
+
+#define FAC_DSC_THRESHOLD 842
+#define FAC_ODD_THRESHOLD 0 /* always */
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/s390_64/invert_limb.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/s390_64/invert_limb.asm
new file mode 100644
index 00000000000..edcebddf1c0
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/s390_64/invert_limb.asm
@@ -0,0 +1,94 @@
+dnl S/390-64 mpn_invert_limb
+
+dnl Contributed to the GNU project by Torbjorn Granlund.
+
+dnl Copyright 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/limb
+C z900 142
+C z990 86
+C z9 ?
+C z10 120
+C z196 ?
+
+ASM_START()
+ TEXT
+ ALIGN(16)
+PROLOGUE(mpn_invert_limb)
+ stg %r9, 72(%r15)
+ srlg %r9, %r2, 55
+ agr %r9, %r9
+ larl %r4, approx_tab-512
+ srlg %r3, %r2, 24
+ aghi %r3, 1
+ lghi %r5, 1
+ llgh %r4, 0(%r9, %r4)
+ sllg %r9, %r4, 11
+ msgr %r4, %r4
+ msgr %r4, %r3
+ srlg %r4, %r4, 40
+ aghi %r9, -1
+ sgr %r9, %r4
+ sllg %r0, %r9, 60
+ sllg %r1, %r9, 13
+ msgr %r9, %r9
+ msgr %r9, %r3
+ sgr %r0, %r9
+ ngr %r5, %r2
+ srlg %r4, %r2, 1
+ srlg %r3, %r0, 47
+ agr %r3, %r1
+ agr %r4, %r5
+ msgr %r4, %r3
+ srlg %r1, %r3, 1
+ lcgr %r5, %r5
+ ngr %r1, %r5
+ sgr %r1, %r4
+ mlgr %r0, %r3
+ srlg %r9, %r0, 1
+ sllg %r4, %r3, 31
+ agr %r4, %r9
+ lgr %r1, %r4
+ mlgr %r0, %r2
+ algr %r1, %r2
+ alcgr %r0, %r2
+ lgr %r2, %r4
+ sgr %r2, %r0
+ lg %r9, 72(%r15)
+ br %r14
+EPILOGUE()
+ RODATA
+ ALIGN(2)
+approx_tab:
+forloop(i,256,512-1,dnl
+` .word eval(0x7fd00/i)
+')dnl
+ASM_END()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/s390_64/logops_n.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/s390_64/logops_n.asm
new file mode 100644
index 00000000000..914cfb6a415
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/s390_64/logops_n.asm
@@ -0,0 +1,291 @@
+dnl S/390-64 logops.
+
+dnl Copyright 2011 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 variant 1 variant 2 variant 3
+C rp!=up rp=up
+C z900 4.5 2.25 5.5 5.5
+C z990 2.75 2 3.25 3.25
+C z9 ? ? ?
+C z10 3.25 3.75 3.75
+C z196 ? ? ?
+
+C INPUT PARAMETERS
+define(`rp', `%r2')
+define(`up', `%r3')
+define(`vp', `%r4')
+define(`n', `%r5')
+
+ifdef(`OPERATION_and_n',`
+ define(`func',`mpn_and_n')
+ define(`VARIANT_1')
+ define(`LOGOPC',`nc')
+ define(`LOGOP',`ng')')
+ifdef(`OPERATION_andn_n',`
+ define(`func',`mpn_andn_n')
+ define(`VARIANT_2')
+ define(`LOGOP',`ng')')
+ifdef(`OPERATION_nand_n',`
+ define(`func',`mpn_nand_n')
+ define(`VARIANT_3')
+ define(`LOGOP',`ng')')
+ifdef(`OPERATION_ior_n',`
+ define(`func',`mpn_ior_n')
+ define(`VARIANT_1')
+ define(`LOGOPC',`oc')
+ define(`LOGOP',`og')')
+ifdef(`OPERATION_iorn_n',`
+ define(`func',`mpn_iorn_n')
+ define(`VARIANT_2')
+ define(`LOGOP',`og')')
+ifdef(`OPERATION_nior_n',`
+ define(`func',`mpn_nior_n')
+ define(`VARIANT_3')
+ define(`LOGOP',`og')')
+ifdef(`OPERATION_xor_n',`
+ define(`func',`mpn_xor_n')
+ define(`VARIANT_1')
+ define(`LOGOPC',`xc')
+ define(`LOGOP',`xg')')
+ifdef(`OPERATION_xnor_n',`
+ define(`func',`mpn_xnor_n')
+ define(`VARIANT_2')
+ define(`LOGOP',`xg')')
+
+MULFUNC_PROLOGUE(mpn_and_n mpn_andn_n mpn_nand_n mpn_ior_n mpn_iorn_n mpn_nior_n mpn_xor_n mpn_xnor_n)
+
+ASM_START()
+PROLOGUE(func)
+ifdef(`VARIANT_1',`
+ cgr rp, up
+ jne L(normal)
+
+ sllg n, n, 3
+ aghi n, -1
+ srlg %r1, n, 8
+ ltgr %r1, %r1 C < 256 bytes to copy?
+ je L(1)
+
+L(tp): LOGOPC 0(256, rp), 0(vp)
+ la rp, 256(rp)
+ la vp, 256(vp)
+ brctg %r1, L(tp)
+
+L(1): bras %r1, L(2) C make r1 point to mvc insn
+ LOGOPC 0(1, rp), 0(vp)
+L(2): ex n, 0(%r1) C execute mvc with length ((n-1) mod 256)+1
+L(rtn): br %r14
+
+
+L(normal):
+ stmg %r6, %r8, 48(%r15)
+ aghi n, 3
+ lghi %r7, 3
+ srlg %r0, n, 2
+ ngr %r7, n C n mod 4
+ je L(b1)
+ cghi %r7, 2
+ jl L(b2)
+ jne L(top)
+
+L(b3): lmg %r5, %r7, 0(up)
+ la up, 24(up)
+ LOGOP %r5, 0(vp)
+ LOGOP %r6, 8(vp)
+ LOGOP %r7, 16(vp)
+ stmg %r5, %r7, 0(rp)
+ la rp, 24(rp)
+ la vp, 24(vp)
+ j L(mid)
+
+L(b1): lg %r5, 0(up)
+ la up, 8(up)
+ LOGOP %r5, 0(vp)
+ stg %r5, 0(rp)
+ la rp, 8(rp)
+ la vp, 8(vp)
+ j L(mid)
+
+L(b2): lmg %r5, %r6, 0(up)
+ la up, 16(up)
+ LOGOP %r5, 0(vp)
+ LOGOP %r6, 8(vp)
+ stmg %r5, %r6, 0(rp)
+ la rp, 16(rp)
+ la vp, 16(vp)
+ j L(mid)
+
+L(top): lmg %r5, %r8, 0(up)
+ la up, 32(up)
+ LOGOP %r5, 0(vp)
+ LOGOP %r6, 8(vp)
+ LOGOP %r7, 16(vp)
+ LOGOP %r8, 24(vp)
+ stmg %r5, %r8, 0(rp)
+ la rp, 32(rp)
+ la vp, 32(vp)
+L(mid): brctg %r0, L(top)
+
+ lmg %r6, %r8, 48(%r15)
+ br %r14
+')
+
+ifdef(`VARIANT_2',`
+ stmg %r6, %r8, 48(%r15)
+ lghi %r1, -1
+
+ aghi n, 3
+ lghi %r7, 3
+ srlg %r0, n, 2
+ ngr %r7, n C n mod 4
+ je L(b1)
+ cghi %r7, 2
+ jl L(b2)
+ jne L(top)
+
+L(b3): lmg %r5, %r7, 0(vp)
+ la vp, 24(vp)
+ xgr %r5, %r1
+ xgr %r6, %r1
+ xgr %r7, %r1
+ LOGOP %r5, 0(up)
+ LOGOP %r6, 8(up)
+ LOGOP %r7, 16(up)
+ stmg %r5, %r7, 0(rp)
+ la rp, 24(rp)
+ la up, 24(up)
+ j L(mid)
+
+L(b1): lg %r5, 0(vp)
+ la vp, 8(vp)
+ xgr %r5, %r1
+ LOGOP %r5, 0(up)
+ stg %r5, 0(rp)
+ la rp, 8(rp)
+ la up, 8(up)
+ j L(mid)
+
+L(b2): lmg %r5, %r6, 0(vp)
+ la vp, 16(vp)
+ xgr %r5, %r1
+ xgr %r6, %r1
+ LOGOP %r5, 0(up)
+ LOGOP %r6, 8(up)
+ stmg %r5, %r6, 0(rp)
+ la rp, 16(rp)
+ la up, 16(up)
+ j L(mid)
+
+L(top): lmg %r5, %r8, 0(vp)
+ la vp, 32(vp)
+ xgr %r5, %r1
+ xgr %r6, %r1
+ xgr %r7, %r1
+ xgr %r8, %r1
+ LOGOP %r5, 0(up)
+ LOGOP %r6, 8(up)
+ LOGOP %r7, 16(up)
+ LOGOP %r8, 24(up)
+ la up, 32(up)
+ stmg %r5, %r8, 0(rp)
+ la rp, 32(rp)
+L(mid): brctg %r0, L(top)
+
+ lmg %r6, %r8, 48(%r15)
+ br %r14
+')
+
+ifdef(`VARIANT_3',`
+ stmg %r6, %r8, 48(%r15)
+ lghi %r1, -1
+
+ aghi n, 3
+ lghi %r7, 3
+ srlg %r0, n, 2
+ ngr %r7, n C n mod 4
+ je L(b1)
+ cghi %r7, 2
+ jl L(b2)
+ jne L(top)
+
+L(b3): lmg %r5, %r7, 0(vp)
+ la vp, 24(vp)
+ LOGOP %r5, 0(up)
+ LOGOP %r6, 8(up)
+ xgr %r5, %r1
+ xgr %r6, %r1
+ LOGOP %r7, 16(up)
+ xgr %r7, %r1
+ stmg %r5, %r7, 0(rp)
+ la rp, 24(rp)
+ la up, 24(up)
+ j L(mid)
+
+L(b1): lg %r5, 0(vp)
+ la vp, 8(vp)
+ LOGOP %r5, 0(up)
+ xgr %r5, %r1
+ stg %r5, 0(rp)
+ la rp, 8(rp)
+ la up, 8(up)
+ j L(mid)
+
+L(b2): lmg %r5, %r6, 0(vp)
+ la vp, 16(vp)
+ LOGOP %r5, 0(up)
+ LOGOP %r6, 8(up)
+ xgr %r5, %r1
+ xgr %r6, %r1
+ stmg %r5, %r6, 0(rp)
+ la rp, 16(rp)
+ la up, 16(up)
+ j L(mid)
+
+L(top): lmg %r5, %r8, 0(vp)
+ la vp, 32(vp)
+ LOGOP %r5, 0(up)
+ LOGOP %r6, 8(up)
+ xgr %r5, %r1
+ xgr %r6, %r1
+ LOGOP %r7, 16(up)
+ LOGOP %r8, 24(up)
+ xgr %r7, %r1
+ xgr %r8, %r1
+ stmg %r5, %r8, 0(rp)
+ la up, 32(up)
+ la rp, 32(rp)
+L(mid): brctg %r0, L(top)
+
+ lmg %r6, %r8, 48(%r15)
+ br %r14
+')
+
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/s390_64/lshift.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/s390_64/lshift.asm
new file mode 100644
index 00000000000..4dae035a62f
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/s390_64/lshift.asm
@@ -0,0 +1,196 @@
+dnl S/390-64 mpn_lshift.
+
+dnl Copyright 2011, 2012, 2014 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 z900 7
+C z990 3
+C z9 ?
+C z10 6
+C z196 ?
+
+C NOTES
+C * This uses discrete loads and stores in a software pipeline. Using lmg and
+C stmg is not faster.
+C * One could assume more pipelining could approach 2.5 c/l, but we have not
+C found any 8-way loop that runs better than the current 4-way loop.
+C * Consider using the same feed-in code for 1 <= n <= 3 as for n mod 4,
+C similarly to the x86_64 sqr_basecase feed-in.
+
+C INPUT PARAMETERS
+define(`rp', `%r2')
+define(`up', `%r3')
+define(`n', `%r4')
+define(`cnt', `%r5')
+
+define(`tnc', `%r6')
+
+ASM_START()
+PROLOGUE(mpn_lshift)
+ cghi n, 3
+ jh L(gt1)
+
+ stmg %r6, %r7, 48(%r15)
+ larl %r1, L(tab)-4
+ lcgr tnc, cnt
+ sllg n, n, 2
+ b 0(n,%r1)
+L(tab): j L(n1)
+ j L(n2)
+ j L(n3)
+
+L(n1): lg %r1, 0(up)
+ sllg %r0, %r1, 0(cnt)
+ stg %r0, 0(rp)
+ srlg %r2, %r1, 0(tnc)
+ lg %r6, 48(%r15) C restoring r7 not needed
+ br %r14
+
+L(n2): lg %r1, 8(up)
+ srlg %r4, %r1, 0(tnc)
+ sllg %r0, %r1, 0(cnt)
+ j L(cj)
+
+L(n3): lg %r1, 16(up)
+ srlg %r4, %r1, 0(tnc)
+ sllg %r0, %r1, 0(cnt)
+ lg %r1, 8(up)
+ srlg %r7, %r1, 0(tnc)
+ ogr %r7, %r0
+ sllg %r0, %r1, 0(cnt)
+ stg %r7, 16(rp)
+L(cj): lg %r1, 0(up)
+ srlg %r7, %r1, 0(tnc)
+ ogr %r7, %r0
+ sllg %r0, %r1, 0(cnt)
+ stg %r7, 8(rp)
+ stg %r0, 0(rp)
+ lgr %r2, %r4
+ lmg %r6, %r7, 48(%r15)
+ br %r14
+
+L(gt1): stmg %r6, %r13, 48(%r15)
+ lcgr tnc, cnt C tnc = -cnt
+
+ sllg %r1, n, 3
+ srlg %r0, n, 2 C loop count
+
+ agr up, %r1 C point up at end of U
+ agr rp, %r1 C point rp at end of R
+ aghi up, -56
+ aghi rp, -40
+
+ lghi %r7, 3
+ ngr %r7, n
+ je L(b0)
+ cghi %r7, 2
+ jl L(b1)
+ je L(b2)
+
+L(b3): lg %r7, 48(up)
+ srlg %r9, %r7, 0(tnc)
+ sllg %r11, %r7, 0(cnt)
+ lg %r8, 40(up)
+ lg %r7, 32(up)
+ srlg %r4, %r8, 0(tnc)
+ sllg %r13, %r8, 0(cnt)
+ ogr %r11, %r4
+ la rp, 16(rp)
+ j L(lm3)
+
+L(b2): lg %r8, 48(up)
+ lg %r7, 40(up)
+ srlg %r9, %r8, 0(tnc)
+ sllg %r13, %r8, 0(cnt)
+ la rp, 24(rp)
+ la up, 8(up)
+ j L(lm2)
+
+L(b1): lg %r7, 48(up)
+ srlg %r9, %r7, 0(tnc)
+ sllg %r11, %r7, 0(cnt)
+ lg %r8, 40(up)
+ lg %r7, 32(up)
+ srlg %r4, %r8, 0(tnc)
+ sllg %r10, %r8, 0(cnt)
+ ogr %r11, %r4
+ la rp, 32(rp)
+ la up, 16(up)
+ j L(lm1)
+
+L(b0): lg %r8, 48(up)
+ lg %r7, 40(up)
+ srlg %r9, %r8, 0(tnc)
+ sllg %r10, %r8, 0(cnt)
+ la rp, 40(rp)
+ la up, 24(up)
+ j L(lm0)
+
+ ALIGN(8)
+L(top): srlg %r4, %r8, 0(tnc)
+ sllg %r13, %r8, 0(cnt)
+ ogr %r11, %r4
+ stg %r10, 24(rp)
+L(lm3): stg %r11, 16(rp)
+L(lm2): srlg %r12, %r7, 0(tnc)
+ sllg %r11, %r7, 0(cnt)
+ lg %r8, 24(up)
+ lg %r7, 16(up)
+ ogr %r13, %r12
+ srlg %r4, %r8, 0(tnc)
+ sllg %r10, %r8, 0(cnt)
+ ogr %r11, %r4
+ stg %r13, 8(rp)
+L(lm1): stg %r11, 0(rp)
+L(lm0): srlg %r12, %r7, 0(tnc)
+ aghi rp, -32
+ sllg %r11, %r7, 0(cnt)
+ lg %r8, 8(up)
+ lg %r7, 0(up)
+ aghi up, -32
+ ogr %r10, %r12
+ brctg %r0, L(top)
+
+L(end): srlg %r4, %r8, 0(tnc)
+ sllg %r13, %r8, 0(cnt)
+ ogr %r11, %r4
+ stg %r10, 24(rp)
+ stg %r11, 16(rp)
+ srlg %r12, %r7, 0(tnc)
+ sllg %r11, %r7, 0(cnt)
+ ogr %r13, %r12
+ stg %r13, 8(rp)
+ stg %r11, 0(rp)
+ lgr %r2, %r9
+
+ lmg %r6, %r13, 48(%r15)
+ br %r14
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/s390_64/lshiftc.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/s390_64/lshiftc.asm
new file mode 100644
index 00000000000..92552d529a3
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/s390_64/lshiftc.asm
@@ -0,0 +1,207 @@
+dnl S/390-64 mpn_lshiftc.
+
+dnl Copyright 2011, 2014 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 z900 9
+C z990 3.5
+C z9 ?
+C z10 7
+C z196 ?
+
+C NOTES
+C * See notes in lshift.asm.
+
+C INPUT PARAMETERS
+define(`rp', `%r2')
+define(`up', `%r3')
+define(`n', `%r4')
+define(`cnt', `%r5')
+
+define(`tnc', `%r6')
+
+ASM_START()
+PROLOGUE(mpn_lshiftc)
+ cghi n, 3
+ jh L(gt1)
+
+ stmg %r6, %r8, 48(%r15)
+ larl %r1, L(tab)-4
+ lcgr tnc, cnt
+ sllg n, n, 2
+ lghi %r8, -1
+ b 0(n,%r1)
+L(tab): j L(n1)
+ j L(n2)
+ j L(n3)
+
+L(n1): lg %r1, 0(up)
+ sllg %r0, %r1, 0(cnt)
+ xgr %r0, %r8
+ stg %r0, 0(rp)
+ srlg %r2, %r1, 0(tnc)
+ lmg %r6, %r8, 48(%r15)
+ br %r14
+
+L(n2): lg %r1, 8(up)
+ srlg %r4, %r1, 0(tnc)
+ sllg %r0, %r1, 0(cnt)
+ j L(cj)
+
+L(n3): lg %r1, 16(up)
+ srlg %r4, %r1, 0(tnc)
+ sllg %r0, %r1, 0(cnt)
+ lg %r1, 8(up)
+ srlg %r7, %r1, 0(tnc)
+ ogr %r7, %r0
+ sllg %r0, %r1, 0(cnt)
+ xgr %r7, %r8
+ stg %r7, 16(rp)
+L(cj): lg %r1, 0(up)
+ srlg %r7, %r1, 0(tnc)
+ ogr %r7, %r0
+ sllg %r0, %r1, 0(cnt)
+ xgr %r7, %r8
+ xgr %r0, %r8
+ stg %r7, 8(rp)
+ stg %r0, 0(rp)
+ lgr %r2, %r4
+ lmg %r6, %r8, 48(%r15)
+ br %r14
+
+L(gt1): stmg %r6, %r14, 48(%r15)
+ lcgr tnc, cnt C tnc = -cnt
+
+ sllg %r1, n, 3
+ srlg %r0, n, 2 C loop count
+
+ agr up, %r1 C point up at end of U
+ agr rp, %r1 C point rp at end of R
+ aghi up, -56
+ aghi rp, -40
+
+ lghi %r7, 3
+ lghi %r14, -1
+ ngr %r7, n
+ je L(b0)
+ cghi %r7, 2
+ jl L(b1)
+ je L(b2)
+
+L(b3): lg %r7, 48(up)
+ srlg %r9, %r7, 0(tnc)
+ sllg %r11, %r7, 0(cnt)
+ lg %r8, 40(up)
+ lg %r7, 32(up)
+ srlg %r4, %r8, 0(tnc)
+ sllg %r13, %r8, 0(cnt)
+ ogr %r11, %r4
+ la rp, 16(rp)
+ xgr %r11, %r14
+ j L(lm3)
+
+L(b2): lg %r8, 48(up)
+ lg %r7, 40(up)
+ srlg %r9, %r8, 0(tnc)
+ sllg %r13, %r8, 0(cnt)
+ la rp, 24(rp)
+ la up, 8(up)
+ j L(lm2)
+
+L(b1): lg %r7, 48(up)
+ srlg %r9, %r7, 0(tnc)
+ sllg %r11, %r7, 0(cnt)
+ lg %r8, 40(up)
+ lg %r7, 32(up)
+ srlg %r4, %r8, 0(tnc)
+ sllg %r10, %r8, 0(cnt)
+ ogr %r11, %r4
+ la rp, 32(rp)
+ la up, 16(up)
+ xgr %r11, %r14
+ j L(lm1)
+
+L(b0): lg %r8, 48(up)
+ lg %r7, 40(up)
+ srlg %r9, %r8, 0(tnc)
+ sllg %r10, %r8, 0(cnt)
+ la rp, 40(rp)
+ la up, 24(up)
+ j L(lm0)
+
+ ALIGN(8)
+L(top): srlg %r4, %r8, 0(tnc)
+ sllg %r13, %r8, 0(cnt)
+ ogr %r11, %r4
+ xgr %r10, %r14
+ xgr %r11, %r14
+ stg %r10, 24(rp)
+L(lm3): stg %r11, 16(rp)
+L(lm2): srlg %r12, %r7, 0(tnc)
+ sllg %r11, %r7, 0(cnt)
+ lg %r8, 24(up)
+ lg %r7, 16(up)
+ ogr %r13, %r12
+ srlg %r4, %r8, 0(tnc)
+ sllg %r10, %r8, 0(cnt)
+ ogr %r11, %r4
+ xgr %r13, %r14
+ xgr %r11, %r14
+ stg %r13, 8(rp)
+L(lm1): stg %r11, 0(rp)
+L(lm0): srlg %r12, %r7, 0(tnc)
+ aghi rp, -32
+ sllg %r11, %r7, 0(cnt)
+ lg %r8, 8(up)
+ lg %r7, 0(up)
+ aghi up, -32
+ ogr %r10, %r12
+ brctg %r0, L(top)
+
+L(end): srlg %r4, %r8, 0(tnc)
+ sllg %r13, %r8, 0(cnt)
+ ogr %r11, %r4
+ xgr %r10, %r14
+ xgr %r11, %r14
+ stg %r10, 24(rp)
+ stg %r11, 16(rp)
+ srlg %r12, %r7, 0(tnc)
+ sllg %r11, %r7, 0(cnt)
+ ogr %r13, %r12
+ xgr %r13, %r14
+ xgr %r11, %r14
+ stg %r13, 8(rp)
+ stg %r11, 0(rp)
+ lgr %r2, %r9
+
+ lmg %r6, %r14, 48(%r15)
+ br %r14
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/s390_64/mod_34lsub1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/s390_64/mod_34lsub1.asm
new file mode 100644
index 00000000000..fd40011a8c7
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/s390_64/mod_34lsub1.asm
@@ -0,0 +1,109 @@
+dnl S/390-64 mpn_mod_34lsub1
+
+dnl Copyright 2011 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 z900 5.8
+C z990 2
+C z9 ?
+C z10 4.5
+C z196 ?
+
+C TODO
+C * Optimise summation code, see x86_64.
+
+C INPUT PARAMETERS
+define(`rp', `%r2')
+define(`n', `%r3')
+
+ASM_START()
+PROLOGUE(mpn_mod_34lsub1)
+ stmg %r7, %r12, 56(%r15)
+ lghi %r11, 0
+ lghi %r12, 0
+ lghi %r0, 0
+ lghi %r8, 0
+ lghi %r9, 0
+ lghi %r10, 0
+ lghi %r7, 0
+ aghi %r3, -3
+ jl .L3
+
+L(top): alg %r0, 0(%r2)
+ alcg %r12, 8(%r2)
+ alcg %r11, 16(%r2)
+ alcgr %r8, %r7
+ la %r2, 24(%r2)
+ aghi %r3, -3
+ jnl L(top)
+
+ lgr %r7, %r8
+ srlg %r1, %r11, 16
+ nihh %r7, 0 C 0xffffffffffff
+ agr %r7, %r1
+ srlg %r8, %r8, 48
+ agr %r7, %r8
+ sllg %r11, %r11, 32
+ nihh %r11, 0
+ agr %r7, %r11
+.L3:
+ cghi %r3, -3
+ je .L6
+ alg %r0, 0(%r2)
+ alcgr %r10, %r10
+ cghi %r3, -2
+ je .L6
+ alg %r12, 8(%r2)
+ alcgr %r9, %r9
+.L6:
+ srlg %r1, %r0, 48
+ nihh %r0, 0 C 0xffffffffffff
+ agr %r0, %r1
+ agr %r0, %r7
+ srlg %r1, %r12, 32
+ agr %r0, %r1
+ srlg %r1, %r10, 32
+ agr %r0, %r1
+ llgfr %r12, %r12
+ srlg %r1, %r9, 16
+ sllg %r12, %r12, 16
+ llgfr %r10, %r10
+ agr %r0, %r1
+ llill %r2, 65535
+ agr %r0, %r12
+ sllg %r10, %r10, 16
+ ngr %r2, %r9
+ agr %r0, %r10
+ sllg %r2, %r2, 32
+ agr %r2, %r0
+ lmg %r7, %r12, 56(%r15)
+ br %r14
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/s390_64/mul_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/s390_64/mul_1.asm
new file mode 100644
index 00000000000..a8f6da9a0fb
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/s390_64/mul_1.asm
@@ -0,0 +1,66 @@
+dnl S/390-64 mpn_mul_1
+
+dnl Copyright 2011 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 z900 29
+C z990 22
+C z9 ?
+C z10 20
+C z196 ?
+
+C INPUT PARAMETERS
+define(`rp', `%r2')
+define(`up', `%r3')
+define(`n', `%r4')
+define(`v0', `%r5')
+
+ASM_START()
+PROLOGUE(mpn_mul_1)
+ stmg %r11, %r12, 88(%r15)
+ lghi %r12, 0 C zero index register
+ aghi %r12, 0 C clear carry flag
+ lghi %r11, 0 C clear carry limb
+
+L(top): lg %r1, 0(%r12,up)
+ mlgr %r0, v0
+ alcgr %r1, %r11
+ lgr %r11, %r0 C copy high part to carry limb
+ stg %r1, 0(%r12,rp)
+ la %r12, 8(%r12)
+ brctg n, L(top)
+
+ lghi %r2, 0
+ alcgr %r2, %r11
+
+ lmg %r11, %r12, 88(%r15)
+ br %r14
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/s390_64/mul_basecase.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/s390_64/mul_basecase.asm
new file mode 100644
index 00000000000..7d14ea98d26
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/s390_64/mul_basecase.asm
@@ -0,0 +1,130 @@
+dnl S/390-64 mpn_mul_basecase.
+
+dnl Copyright 2011 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 z900 ?
+C z990 23
+C z9 ?
+C z10 28
+C z196 ?
+
+C TODO
+C * Perhaps add special case for un <= 2.
+C * Replace loops by faster code. The mul_1 and addmul_1 loops could be sped
+C up by about 10%.
+
+C INPUT PARAMETERS
+define(`rp', `%r2')
+define(`up', `%r3')
+define(`un', `%r4')
+define(`vp', `%r5')
+define(`vn', `%r6')
+
+define(`zero', `%r8')
+
+ASM_START()
+PROLOGUE(mpn_mul_basecase)
+ cghi un, 2
+ jhe L(ge2)
+
+C un = vn = 1
+ lg %r1, 0(vp)
+ mlg %r0, 0(up)
+ stg %r1, 0(rp)
+ stg %r0, 8(rp)
+ br %r14
+
+L(ge2): C jne L(gen)
+
+
+L(gen):
+C mul_1 =======================================================================
+
+ stmg %r6, %r12, 48(%r15)
+ lghi zero, 0
+ aghi un, -1
+
+ lg %r7, 0(vp)
+ lg %r11, 0(up)
+ lghi %r12, 8 C init index register
+ mlgr %r10, %r7
+ lgr %r9, un
+ stg %r11, 0(rp)
+ cr %r15, %r15 C clear carry flag
+
+L(tm): lg %r1, 0(%r12,up)
+ mlgr %r0, %r7
+ alcgr %r1, %r10
+ lgr %r10, %r0 C copy high part to carry limb
+ stg %r1, 0(%r12,rp)
+ la %r12, 8(%r12)
+ brctg %r9, L(tm)
+
+ alcgr %r0, zero
+ stg %r0, 0(%r12,rp)
+
+C addmul_1 loop ===============================================================
+
+ aghi vn, -1
+ je L(outer_end)
+L(outer_loop):
+
+ la rp, 8(rp) C rp += 1
+ la vp, 8(vp) C up += 1
+ lg %r7, 0(vp)
+ lg %r11, 0(up)
+ lghi %r12, 8 C init index register
+ mlgr %r10, %r7
+ lgr %r9, un
+ alg %r11, 0(rp)
+ stg %r11, 0(rp)
+
+L(tam): lg %r1, 0(%r12,up)
+ lg %r11, 0(%r12,rp)
+ mlgr %r0, %r7
+ alcgr %r1, %r11
+ alcgr %r0, zero
+ algr %r1, %r10
+ lgr %r10, %r0
+ stg %r1, 0(%r12,rp)
+ la %r12, 8(%r12)
+ brctg %r9, L(tam)
+
+ alcgr %r0, zero
+ stg %r0, 0(%r12,rp)
+
+ brctg vn, L(outer_loop)
+L(outer_end):
+
+ lmg %r6, %r12, 48(%r15)
+ br %r14
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/s390_64/rshift.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/s390_64/rshift.asm
new file mode 100644
index 00000000000..e870971650c
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/s390_64/rshift.asm
@@ -0,0 +1,195 @@
+dnl S/390-64 mpn_rshift.
+
+dnl Copyright 2011, 2014 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 z900 7
+C z990 3
+C z9 ?
+C z10 6
+C z196 ?
+
+C NOTES
+C * See notes in lshift.asm.
+
+C INPUT PARAMETERS
+define(`rp', `%r2')
+define(`up', `%r3')
+define(`n', `%r4')
+define(`cnt', `%r5')
+
+define(`tnc', `%r6')
+
+ASM_START()
+PROLOGUE(mpn_rshift)
+ cghi n, 3
+ jh L(gt1)
+
+ stmg %r6, %r7, 48(%r15)
+ larl %r1, L(tab)-4
+ lcgr tnc, cnt
+ sllg n, n, 2
+ b 0(n,%r1)
+L(tab): j L(n1)
+ j L(n2)
+ j L(n3)
+
+L(n1): lg %r1, 0(up)
+ srlg %r0, %r1, 0(cnt)
+ stg %r0, 0(rp)
+ sllg %r2, %r1, 0(tnc)
+ lg %r6, 48(%r15) C restoring r7 not needed
+ br %r14
+
+L(n2): lg %r1, 0(up)
+ sllg %r4, %r1, 0(tnc)
+ srlg %r0, %r1, 0(cnt)
+ lg %r1, 8(up)
+ sllg %r7, %r1, 0(tnc)
+ ogr %r7, %r0
+ srlg %r0, %r1, 0(cnt)
+ stg %r7, 0(rp)
+ stg %r0, 8(rp)
+ lgr %r2, %r4
+ lmg %r6, %r7, 48(%r15)
+ br %r14
+
+
+L(n3): lg %r1, 0(up)
+ sllg %r4, %r1, 0(tnc)
+ srlg %r0, %r1, 0(cnt)
+ lg %r1, 8(up)
+ sllg %r7, %r1, 0(tnc)
+ ogr %r7, %r0
+ srlg %r0, %r1, 0(cnt)
+ stg %r7, 0(rp)
+ lg %r1, 16(up)
+ sllg %r7, %r1, 0(tnc)
+ ogr %r7, %r0
+ srlg %r0, %r1, 0(cnt)
+ stg %r7, 8(rp)
+ stg %r0, 16(rp)
+ lgr %r2, %r4
+ lmg %r6, %r7, 48(%r15)
+ br %r14
+
+L(gt1): stmg %r6, %r13, 48(%r15)
+ lcgr tnc, cnt C tnc = -cnt
+
+ sllg %r1, n, 3
+ srlg %r0, n, 2 C loop count
+
+ lghi %r7, 3
+ ngr %r7, n
+ je L(b0)
+ cghi %r7, 2
+ jl L(b1)
+ je L(b2)
+
+L(b3): aghi rp, -8
+ lg %r7, 0(up)
+ sllg %r9, %r7, 0(tnc)
+ srlg %r11, %r7, 0(cnt)
+ lg %r8, 8(up)
+ lg %r7, 16(up)
+ sllg %r4, %r8, 0(tnc)
+ srlg %r13, %r8, 0(cnt)
+ ogr %r11, %r4
+ la up, 24(up)
+ j L(lm3)
+
+L(b2): aghi rp, -16
+ lg %r8, 0(up)
+ lg %r7, 8(up)
+ sllg %r9, %r8, 0(tnc)
+ srlg %r13, %r8, 0(cnt)
+ la up, 16(up)
+ j L(lm2)
+
+L(b1): aghi rp, -24
+ lg %r7, 0(up)
+ sllg %r9, %r7, 0(tnc)
+ srlg %r11, %r7, 0(cnt)
+ lg %r8, 8(up)
+ lg %r7, 16(up)
+ sllg %r4, %r8, 0(tnc)
+ srlg %r10, %r8, 0(cnt)
+ ogr %r11, %r4
+ la up, 8(up)
+ j L(lm1)
+
+L(b0): aghi rp, -32
+ lg %r8, 0(up)
+ lg %r7, 8(up)
+ sllg %r9, %r8, 0(tnc)
+ srlg %r10, %r8, 0(cnt)
+ j L(lm0)
+
+ ALIGN(8)
+L(top): sllg %r4, %r8, 0(tnc)
+ srlg %r13, %r8, 0(cnt)
+ ogr %r11, %r4
+ stg %r10, 0(rp)
+L(lm3): stg %r11, 8(rp)
+L(lm2): sllg %r12, %r7, 0(tnc)
+ srlg %r11, %r7, 0(cnt)
+ lg %r8, 0(up)
+ lg %r7, 8(up)
+ ogr %r13, %r12
+ sllg %r4, %r8, 0(tnc)
+ srlg %r10, %r8, 0(cnt)
+ ogr %r11, %r4
+ stg %r13, 16(rp)
+L(lm1): stg %r11, 24(rp)
+L(lm0): sllg %r12, %r7, 0(tnc)
+ aghi rp, 32
+ srlg %r11, %r7, 0(cnt)
+ lg %r8, 16(up)
+ lg %r7, 24(up)
+ aghi up, 32
+ ogr %r10, %r12
+ brctg %r0, L(top)
+
+L(end): sllg %r4, %r8, 0(tnc)
+ srlg %r13, %r8, 0(cnt)
+ ogr %r11, %r4
+ stg %r10, 0(rp)
+ stg %r11, 8(rp)
+ sllg %r12, %r7, 0(tnc)
+ srlg %r11, %r7, 0(cnt)
+ ogr %r13, %r12
+ stg %r13, 16(rp)
+ stg %r11, 24(rp)
+ lgr %r2, %r9
+
+ lmg %r6, %r13, 48(%r15)
+ br %r14
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/s390_64/sqr_basecase.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/s390_64/sqr_basecase.asm
new file mode 100644
index 00000000000..bf31bd55468
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/s390_64/sqr_basecase.asm
@@ -0,0 +1,203 @@
+dnl S/390-64 mpn_sqr_basecase.
+
+dnl Copyright 2011 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 z900 ?
+C z990 23
+C z9 ?
+C z10 28
+C z196 ?
+
+C TODO
+C * Clean up.
+C * Stop iterating addmul_1 loop at latest for n = 2, implement longer tail.
+C This will ask for basecase handling of n = 3.
+C * Update counters and pointers more straightforwardly, possibly lowering
+C register usage.
+C * Should we use this allocation-free style for more sqr_basecase asm
+C implementations? The only disadvantage is that it requires R != U.
+C * Replace loops by faster code. The mul_1 and addmul_1 loops could be sped
+C up by about 10%. The sqr_diag_addlsh1 loop could probably be sped up even
+C more.
+
+C INPUT PARAMETERS
+define(`rp', `%r2')
+define(`up', `%r3')
+define(`n', `%r4')
+
+define(`zero', `%r8')
+define(`rp_saved', `%r9')
+define(`up_saved', `%r13')
+define(`n_saved', `%r14')
+
+ASM_START()
+PROLOGUE(mpn_sqr_basecase)
+ aghi n, -2
+ jhe L(ge2)
+
+C n = 1
+ lg %r5, 0(up)
+ mlgr %r4, %r5
+ stg %r5, 0(rp)
+ stg %r4, 8(rp)
+ br %r14
+
+L(ge2): jne L(gen)
+
+C n = 2
+ stmg %r6, %r8, 48(%r15)
+ lghi zero, 0
+
+ lg %r5, 0(up)
+ mlgr %r4, %r5 C u0 * u0
+ lg %r1, 8(up)
+ mlgr %r0, %r1 C u1 * u1
+ stg %r5, 0(rp)
+
+ lg %r7, 0(up)
+ mlg %r6, 8(up) C u0 * u1
+ algr %r7, %r7
+ alcgr %r6, %r6
+ alcgr %r0, zero
+
+ algr %r4, %r7
+ alcgr %r1, %r6
+ alcgr %r0, zero
+ stg %r4, 8(rp)
+ stg %r1, 16(rp)
+ stg %r0, 24(rp)
+
+ lmg %r6, %r8, 48(%r15)
+ br %r14
+
+L(gen):
+C mul_1 =======================================================================
+
+ stmg %r6, %r14, 48(%r15)
+ lghi zero, 0
+ lgr up_saved, up
+ lgr rp_saved, rp
+ lgr n_saved, n
+
+ lg %r6, 0(up)
+ lg %r11, 8(up)
+ lghi %r12, 16 C init index register
+ mlgr %r10, %r6
+ lgr %r5, n
+ stg %r11, 8(rp)
+ cr %r15, %r15 C clear carry flag
+
+L(tm): lg %r1, 0(%r12,up)
+ mlgr %r0, %r6
+ alcgr %r1, %r10
+ lgr %r10, %r0 C copy high part to carry limb
+ stg %r1, 0(%r12,rp)
+ la %r12, 8(%r12)
+ brctg %r5, L(tm)
+
+ alcgr %r0, zero
+ stg %r0, 0(%r12,rp)
+
+C addmul_1 loop ===============================================================
+
+ aghi n, -1
+ je L(outer_end)
+L(outer_loop):
+
+ la rp, 16(rp) C rp += 2
+ la up, 8(up) C up += 1
+ lg %r6, 0(up)
+ lg %r11, 8(up)
+ lghi %r12, 16 C init index register
+ mlgr %r10, %r6
+ lgr %r5, n
+ alg %r11, 8(rp)
+ stg %r11, 8(rp)
+
+L(tam): lg %r1, 0(%r12,up)
+ lg %r7, 0(%r12,rp)
+ mlgr %r0, %r6
+ alcgr %r1, %r7
+ alcgr %r0, zero
+ algr %r1, %r10
+ lgr %r10, %r0
+ stg %r1, 0(%r12,rp)
+ la %r12, 8(%r12)
+ brctg %r5, L(tam)
+
+ alcgr %r0, zero
+ stg %r0, 0(%r12,rp)
+
+ brctg n, L(outer_loop)
+L(outer_end):
+
+ lg %r6, 8(up)
+ lg %r1, 16(up)
+ lgr %r7, %r0 C Same as: lg %r7, 24(,rp)
+ mlgr %r0, %r6
+ algr %r1, %r7
+ alcgr %r0, zero
+ stg %r1, 24(rp)
+ stg %r0, 32(rp)
+
+C sqr_diag_addlsh1 ============================================================
+
+define(`up', `up_saved')
+define(`rp', `rp_saved')
+ la n, 1(n_saved)
+
+ lg %r1, 0(up)
+ mlgr %r0, %r1
+ stg %r1, 0(rp)
+C clr %r15, %r15 C clear carry (already clear per above)
+
+L(top): lg %r11, 8(up)
+ la up, 8(up)
+ lg %r6, 8(rp)
+ lg %r7, 16(rp)
+ mlgr %r10, %r11
+ alcgr %r6, %r6
+ alcgr %r7, %r7
+ alcgr %r10, zero C propagate carry to high product limb
+ algr %r6, %r0
+ alcgr %r7, %r11
+ stmg %r6, %r7, 8(rp)
+ la rp, 16(rp)
+ lgr %r0, %r10 C copy carry limb
+ brctg n, L(top)
+
+ alcgr %r0, zero
+ stg %r0, 8(rp)
+
+ lmg %r6, %r14, 48(%r15)
+ br %r14
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/s390_64/sublsh1_n.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/s390_64/sublsh1_n.asm
new file mode 100644
index 00000000000..50f127acef9
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/s390_64/sublsh1_n.asm
@@ -0,0 +1,169 @@
+dnl S/390-64 mpn_sublsh1_n
+
+dnl Copyright 2011 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 z900 10
+C z990 5
+C z9 ?
+C z10 12
+C z196 ?
+
+C TODO
+C * Optimise for small n
+C * Compute RETVAL for sublsh1_n less stupidly
+
+C INPUT PARAMETERS
+define(`rp', `%r2')
+define(`up', `%r3')
+define(`vp', `%r4')
+define(`n', `%r5')
+
+ifdef(`OPERATION_addlsh1_n',`
+ define(ADSBR, algr)
+ define(ADSBCR, alcgr)
+ define(INITCY, `lghi %r13, -1')
+ define(RETVAL, `la %r2, 2(%r1,%r13)')
+ define(func, mpn_addlsh1_n)
+')
+ifdef(`OPERATION_sublsh1_n',`
+ define(ADSBR, slgr)
+ define(ADSBCR, slbgr)
+ define(INITCY, `lghi %r13, 0')
+ define(RETVAL,`dnl
+ slgr %r1, %r13
+ lghi %r2, 1
+ algr %r2, %r1')
+ define(func, mpn_sublsh1_n)
+')
+
+ASM_START()
+PROLOGUE(mpn_sublsh1_n)
+ stmg %r6, %r13, 48(%r15)
+
+ aghi n, 3
+ lghi %r7, 3
+ srlg %r0, n, 2
+ ngr %r7, n C n mod 4
+ je L(b1)
+ cghi %r7, 2
+ jl L(b2)
+ jne L(b0)
+
+L(b3): lmg %r5, %r7, 0(up)
+ la up, 24(up)
+ lmg %r9, %r11, 0(vp)
+ la vp, 24(vp)
+
+ algr %r9, %r9
+ alcgr %r10, %r10
+ alcgr %r11, %r11
+ slbgr %r1, %r1
+
+ ADSBR %r5, %r9
+ ADSBCR %r6, %r10
+ ADSBCR %r7, %r11
+ slbgr %r13, %r13
+
+ stmg %r5, %r7, 0(rp)
+ la rp, 24(rp)
+ brctg %r0, L(top)
+ j L(end)
+
+L(b0): lghi %r1, -1
+ INITCY
+ j L(top)
+
+L(b1): lg %r5, 0(up)
+ la up, 8(up)
+ lg %r9, 0(vp)
+ la vp, 8(vp)
+
+ algr %r9, %r9
+ slbgr %r1, %r1
+ ADSBR %r5, %r9
+ slbgr %r13, %r13
+
+ stg %r5, 0(rp)
+ la rp, 8(rp)
+ brctg %r0, L(top)
+ j L(end)
+
+L(b2): lmg %r5, %r6, 0(up)
+ la up, 16(up)
+ lmg %r9, %r10, 0(vp)
+ la vp, 16(vp)
+
+ algr %r9, %r9
+ alcgr %r10, %r10
+ slbgr %r1, %r1
+
+ ADSBR %r5, %r9
+ ADSBCR %r6, %r10
+ slbgr %r13, %r13
+
+ stmg %r5, %r6, 0(rp)
+ la rp, 16(rp)
+ brctg %r0, L(top)
+ j L(end)
+
+L(top): lmg %r9, %r12, 0(vp)
+ la vp, 32(vp)
+
+ aghi %r1, 1 C restore carry
+
+ alcgr %r9, %r9
+ alcgr %r10, %r10
+ alcgr %r11, %r11
+ alcgr %r12, %r12
+
+ slbgr %r1, %r1 C save carry
+
+ lmg %r5, %r8, 0(up)
+ la up, 32(up)
+
+ aghi %r13, 1 C restore carry
+
+ ADSBCR %r5, %r9
+ ADSBCR %r6, %r10
+ ADSBCR %r7, %r11
+ ADSBCR %r8, %r12
+
+ slbgr %r13, %r13 C save carry
+
+ stmg %r5, %r8, 0(rp)
+ la rp, 32(rp)
+ brctg %r0, L(top)
+
+L(end): RETVAL
+ lmg %r6, %r13, 48(%r15)
+ br %r14
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/s390_64/submul_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/s390_64/submul_1.asm
new file mode 100644
index 00000000000..91c4b06631b
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/s390_64/submul_1.asm
@@ -0,0 +1,70 @@
+dnl S/390-64 mpn_submul_1
+
+dnl Copyright 2011 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 z900 35
+C z990 24
+C z9 ?
+C z10 28
+C z196 ?
+
+C INPUT PARAMETERS
+define(`rp', `%r2')
+define(`up', `%r3')
+define(`n', `%r4')
+define(`v0', `%r5')
+
+ASM_START()
+PROLOGUE(mpn_submul_1)
+ stmg %r9, %r12, 72(%r15)
+ lghi %r12, 0
+ slgr %r11, %r11
+
+L(top): lg %r1, 0(%r12, up)
+ lg %r10, 0(%r12, rp)
+ mlgr %r0, v0
+ slbgr %r10, %r1
+ slbgr %r9, %r9
+ slgr %r0, %r9 C conditional incr
+ slgr %r10, %r11
+ lgr %r11, %r0
+ stg %r10, 0(%r12, rp)
+ la %r12, 8(%r12)
+ brctg %r4, L(top)
+
+ lgr %r2, %r11
+ slbgr %r9, %r9
+ slgr %r2, %r9
+
+ lmg %r9, %r12, 72(%r15)
+ br %r14
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/s390_64/z10/gmp-mparam.h b/Build/source/libs/gmp/gmp-6.0.0/mpn/s390_64/z10/gmp-mparam.h
new file mode 100644
index 00000000000..c034f9b3b60
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/s390_64/z10/gmp-mparam.h
@@ -0,0 +1,231 @@
+/* S/390-64 gmp-mparam.h -- Compiler/machine parameter header file.
+
+Copyright 1991, 1993, 1994, 2000-2011, 2014 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
+
+/* 4400 MHz IBM z10 */
+/* FFT tuning limit = 15000000 */
+/* Generated by tuneup.c, 2014-03-12, gcc 4.7 */
+
+#define DIVREM_1_NORM_THRESHOLD 0 /* always */
+#define DIVREM_1_UNNORM_THRESHOLD 4
+#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 7
+#define MOD_1U_TO_MOD_1_1_THRESHOLD 8
+#define MOD_1_1_TO_MOD_1_2_THRESHOLD 14
+#define MOD_1_2_TO_MOD_1_4_THRESHOLD 23
+#define PREINV_MOD_1_TO_MOD_1_THRESHOLD 29
+#define USE_PREINV_DIVREM_1 1
+#define DIV_QR_1N_PI1_METHOD 1
+#define DIV_QR_1_NORM_THRESHOLD 2
+#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 MUL_TOOM22_THRESHOLD 8
+#define MUL_TOOM33_THRESHOLD 65
+#define MUL_TOOM44_THRESHOLD 88
+#define MUL_TOOM6H_THRESHOLD 125
+#define MUL_TOOM8H_THRESHOLD 163
+
+#define MUL_TOOM32_TO_TOOM43_THRESHOLD 58
+#define MUL_TOOM32_TO_TOOM53_THRESHOLD 61
+#define MUL_TOOM42_TO_TOOM53_THRESHOLD 57
+#define MUL_TOOM42_TO_TOOM63_THRESHOLD 62
+#define MUL_TOOM43_TO_TOOM54_THRESHOLD 82
+
+#define SQR_BASECASE_THRESHOLD 0 /* always (native) */
+#define SQR_TOOM2_THRESHOLD 12
+#define SQR_TOOM3_THRESHOLD 89
+#define SQR_TOOM4_THRESHOLD 130
+#define SQR_TOOM6_THRESHOLD 189
+#define SQR_TOOM8_THRESHOLD 260
+
+#define MULMID_TOOM42_THRESHOLD 24
+
+#define MULMOD_BNM1_THRESHOLD 9
+#define SQRMOD_BNM1_THRESHOLD 9
+
+#define MUL_FFT_MODF_THRESHOLD 220 /* k = 5 */
+#define MUL_FFT_TABLE3 \
+ { { 220, 5}, { 7, 4}, { 15, 5}, { 9, 6}, \
+ { 5, 5}, { 11, 6}, { 6, 5}, { 13, 6}, \
+ { 11, 7}, { 6, 6}, { 13, 7}, { 7, 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}, { 23,10}, { 7, 9}, \
+ { 15, 8}, { 33, 9}, { 19, 8}, { 39, 9}, \
+ { 27,10}, { 15, 9}, { 39,10}, { 23,11}, \
+ { 15,10}, { 31, 9}, { 67,10}, { 39, 9}, \
+ { 83,10}, { 47,11}, { 31,10}, { 63, 9}, \
+ { 127, 8}, { 255, 7}, { 511,10}, { 71, 9}, \
+ { 143, 8}, { 287, 7}, { 575,10}, { 79,11}, \
+ { 47,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, 7}, \
+ { 1407, 6}, { 2815,10}, { 191, 9}, { 383, 8}, \
+ { 767, 9}, { 415,11}, { 111,10}, { 223, 9}, \
+ { 447, 8}, { 895,12}, { 63,11}, { 127,10}, \
+ { 255, 9}, { 511,11}, { 143,10}, { 287, 9}, \
+ { 575, 8}, { 1151,10}, { 319, 9}, { 639,11}, \
+ { 175, 9}, { 703, 8}, { 1407, 7}, { 2815,11}, \
+ { 191,10}, { 415, 9}, { 831,11}, { 223,13}, \
+ { 63,12}, { 127,11}, { 255,10}, { 511,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,10}, \
+ { 895, 9}, { 1791,11}, { 479,13}, { 127,12}, \
+ { 255,11}, { 511,10}, { 1023,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, 9}, { 3583,12}, { 479,14}, { 127,13}, \
+ { 255,12}, { 511,11}, { 1023,12}, { 575,11}, \
+ { 1151,13}, { 319,12}, { 703,11}, { 1407,10}, \
+ { 2815,13}, { 383,12}, { 767,11}, { 1535,12}, \
+ { 831,11}, { 1663,13}, { 447,12}, { 895,11}, \
+ { 1791,10}, { 3583,14}, { 255,13}, { 511,12}, \
+ { 1023,13}, { 575,12}, { 1151,13}, { 639,12}, \
+ { 1279,13}, { 703,12}, { 1407,11}, { 2815,14}, \
+ { 383,13}, { 767,12}, { 1535,13}, { 831,12}, \
+ { 1663,13}, { 895,12}, { 1791,11}, { 3583,15}, \
+ { 255,14}, { 511,13}, { 1151,14}, { 639,13}, \
+ { 1279,12}, { 2559,13}, { 1407,12}, { 2815,13}, \
+ { 1471,14}, { 767,13}, { 1663,14}, { 895,13}, \
+ { 1791,12}, { 3583,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 205
+#define MUL_FFT_THRESHOLD 1728
+
+#define SQR_FFT_MODF_THRESHOLD 212 /* k = 5 */
+#define SQR_FFT_TABLE3 \
+ { { 212, 5}, { 7, 4}, { 15, 5}, { 11, 6}, \
+ { 6, 5}, { 13, 6}, { 7, 5}, { 15, 6}, \
+ { 13, 7}, { 7, 6}, { 15, 7}, { 13, 8}, \
+ { 7, 7}, { 16, 8}, { 9, 7}, { 19, 8}, \
+ { 11, 7}, { 23, 8}, { 13, 9}, { 7, 8}, \
+ { 19, 9}, { 11, 8}, { 23,10}, { 7, 9}, \
+ { 15, 8}, { 31, 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, 7}, { 575,10}, { 79,11}, { 47,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,11}, { 111,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, 9}, { 767,11}, { 207,10}, { 415,13}, \
+ { 63,12}, { 127,11}, { 255,10}, { 511,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,12}, { 223,11}, { 447,10}, { 895, 9}, \
+ { 1791,13}, { 127,12}, { 255,11}, { 511,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,10}, \
+ { 1791, 9}, { 3583,12}, { 479,11}, { 959,10}, \
+ { 1919,14}, { 127,13}, { 255,12}, { 511,11}, \
+ { 1023,12}, { 575,11}, { 1151,13}, { 319,12}, \
+ { 639,11}, { 1279,12}, { 703,11}, { 1407,10}, \
+ { 2815,13}, { 383,12}, { 767,11}, { 1535,12}, \
+ { 831,11}, { 1663,13}, { 447,12}, { 895,11}, \
+ { 1791,12}, { 959,11}, { 1919,14}, { 255,13}, \
+ { 511,12}, { 1023,13}, { 575,12}, { 1151,13}, \
+ { 639,12}, { 1279,13}, { 703,12}, { 1407,11}, \
+ { 2815,14}, { 383,13}, { 767,12}, { 1535,13}, \
+ { 831,12}, { 1663,13}, { 895,12}, { 1791,11}, \
+ { 3583,13}, { 959,12}, { 1919,15}, { 255,14}, \
+ { 511,13}, { 1023,12}, { 2047,13}, { 1151,14}, \
+ { 639,13}, { 1279,12}, { 2559,13}, { 1407,12}, \
+ { 2815,14}, { 767,13}, { 1663,14}, { 895,13}, \
+ { 1791,12}, { 3583,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 201
+#define SQR_FFT_THRESHOLD 1728
+
+#define MULLO_BASECASE_THRESHOLD 0 /* always */
+#define MULLO_DC_THRESHOLD 34
+#define MULLO_MUL_N_THRESHOLD 3176
+
+#define DC_DIV_QR_THRESHOLD 39
+#define DC_DIVAPPR_Q_THRESHOLD 151
+#define DC_BDIV_QR_THRESHOLD 44
+#define DC_BDIV_Q_THRESHOLD 107
+
+#define INV_MULMOD_BNM1_THRESHOLD 14
+#define INV_NEWTON_THRESHOLD 163
+#define INV_APPR_THRESHOLD 154
+
+#define BINV_NEWTON_THRESHOLD 171
+#define REDC_1_TO_REDC_N_THRESHOLD 46
+
+#define MU_DIV_QR_THRESHOLD 792
+#define MU_DIVAPPR_Q_THRESHOLD 807
+#define MUPI_DIV_QR_THRESHOLD 81
+#define MU_BDIV_QR_THRESHOLD 654
+#define MU_BDIV_Q_THRESHOLD 792
+
+#define POWM_SEC_TABLE 3,19,194,946,2424
+
+#define MATRIX22_STRASSEN_THRESHOLD 17
+#define HGCD_THRESHOLD 117
+#define HGCD_APPR_THRESHOLD 145
+#define HGCD_REDUCE_THRESHOLD 1329
+#define GCD_DC_THRESHOLD 318
+#define GCDEXT_DC_THRESHOLD 265
+#define JACOBI_BASE_METHOD 4
+
+#define GET_STR_DC_THRESHOLD 17
+#define GET_STR_PRECOMPUTE_THRESHOLD 35
+#define SET_STR_DC_THRESHOLD 1015
+#define SET_STR_PRECOMPUTE_THRESHOLD 2047
+
+#define FAC_DSC_THRESHOLD 330
+#define FAC_ODD_THRESHOLD 23
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/sh/add_n.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/sh/add_n.asm
new file mode 100644
index 00000000000..79d17d01299
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/sh/add_n.asm
@@ -0,0 +1,59 @@
+dnl SH mpn_add_n -- Add two limb vectors of the same length > 0 and store sum
+dnl in a third limb vector.
+
+dnl Copyright 1995, 1997, 2000, 2011 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 rp r4
+C up r5
+C vp r6
+C n r7
+
+changecom(blah) C disable # to make all C comments below work
+
+ASM_START()
+PROLOGUE(mpn_add_n)
+ mov #0,r3 C clear cy save reg
+
+L(top): mov.l @r5+,r1
+ mov.l @r6+,r2
+ shlr r3 C restore cy
+ addc r2,r1
+ movt r3 C save cy
+ mov.l r1,@r4
+ dt r7
+ bf.s L(top)
+ add #4,r4
+
+ rts
+ mov r3,r0 C return carry-out from most significant limb
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/sh/sh2/addmul_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/sh/sh2/addmul_1.asm
new file mode 100644
index 00000000000..c914b29541e
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/sh/sh2/addmul_1.asm
@@ -0,0 +1,65 @@
+dnl SH2 mpn_addmul_1 -- Multiply a limb vector with a limb and add the result
+dnl to a second limb vector.
+
+dnl Copyright 1995, 2000, 2011 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 r4
+C s1_ptr r5
+C size r6
+C s2_limb r7
+
+changecom(blah) C disable # to make all C comments below work
+
+ASM_START()
+PROLOGUE(mpn_addmul_1)
+ mov #0,r2 C cy_limb = 0
+ mov #0,r0 C Keep r0 = 0 for entire loop
+ clrt
+
+L(top): mov.l @r5+,r3
+ dmulu.l r3,r7
+ sts macl,r1
+ addc r2,r1 C lo_prod += old cy_limb
+ sts mach,r2 C new cy_limb = hi_prod
+ mov.l @r4,r3
+ addc r0,r2 C cy_limb += T, T = 0
+ addc r3,r1
+ addc r0,r2 C cy_limb += T, T = 0
+ dt r6
+ mov.l r1,@r4
+ bf.s L(top)
+ add #4,r4
+
+ rts
+ mov r2,r0
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/sh/sh2/mul_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/sh/sh2/mul_1.asm
new file mode 100644
index 00000000000..83548a6953b
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/sh/sh2/mul_1.asm
@@ -0,0 +1,62 @@
+dnl SH2 mpn_mul_1 -- Multiply a limb vector with a limb and store the result
+dnl in a second limb vector.
+
+dnl Copyright 1995, 2000, 2011 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 r4
+C s1_ptr r5
+C size r6
+C s2_limb r7
+
+changecom(blah) C disable # to make all C comments below work
+
+ASM_START()
+PROLOGUE(mpn_mul_1)
+ mov #0,r2 C cy_limb = 0
+ mov #0,r0 C Keep r0 = 0 for entire loop
+ clrt
+
+L(top): mov.l @r5+,r3
+ dmulu.l r3,r7
+ sts macl,r1
+ addc r2,r1
+ sts mach,r2
+ addc r0,r2 C propagate carry to cy_limb (dt clobbers T)
+ dt r6
+ mov.l r1,@r4
+ bf.s L(top)
+ add #4,r4
+
+ rts
+ mov r2,r0
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/sh/sh2/submul_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/sh/sh2/submul_1.asm
new file mode 100644
index 00000000000..bef2abd9b25
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/sh/sh2/submul_1.asm
@@ -0,0 +1,65 @@
+dnl SH2 mpn_submul_1 -- Multiply a limb vector with a limb and subtract the
+dnl result from a second limb vector.
+
+dnl Copyright 1995, 2000, 2011 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 r4
+C s1_ptr r5
+C size r6
+C s2_limb r7
+
+changecom(blah) C disable # to make all C comments below work
+
+ASM_START()
+PROLOGUE(mpn_submul_1)
+ mov #0,r2 C cy_limb = 0
+ mov #0,r0 C Keep r0 = 0 for entire loop
+ clrt
+
+L(top): mov.l @r5+,r3
+ dmulu.l r3,r7
+ sts macl,r1
+ addc r2,r1 C lo_prod += old cy_limb
+ sts mach,r2 C new cy_limb = hi_prod
+ mov.l @r4,r3
+ addc r0,r2 C cy_limb += T, T = 0
+ subc r1,r3
+ addc r0,r2 C cy_limb += T, T = 0
+ dt r6
+ mov.l r3,@r4
+ bf.s L(top)
+ add #4,r4
+
+ rts
+ mov r2,r0
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/sh/sub_n.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/sh/sub_n.asm
new file mode 100644
index 00000000000..465bc806fa9
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/sh/sub_n.asm
@@ -0,0 +1,59 @@
+dnl SH mpn_sub_n -- Subtract two limb vectors of the same length > 0 and store
+dnl difference in a third limb vector.
+
+dnl Copyright 1995, 1997, 2000, 2011 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 rp r4
+C up r5
+C vp r6
+C n r7
+
+changecom(blah) C disable # to make all C comments below work
+
+ASM_START()
+PROLOGUE(mpn_sub_n)
+ mov #0,r3 C clear cy save reg
+
+L(top): mov.l @r5+,r1
+ mov.l @r6+,r2
+ shlr r3 C restore cy
+ subc r2,r1
+ movt r3 C save cy
+ mov.l r1,@r4
+ dt r7
+ bf.s L(top)
+ add #4,r4
+
+ rts
+ mov r3,r0 C return carry-out from most significant limb
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc32/README b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc32/README
new file mode 100644
index 00000000000..f2dd1160f79
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc32/README
@@ -0,0 +1,71 @@
+Copyright 1996, 2001 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/.
+
+
+
+
+
+This directory contains mpn functions for various SPARC chips. Code that
+runs only on version 8 SPARC implementations, is in the v8 subdirectory.
+
+RELEVANT OPTIMIZATION ISSUES
+
+ Load and Store timing
+
+On most early SPARC implementations, the ST instructions takes multiple
+cycles, while a STD takes just a single cycle more than an ST. For the CPUs
+in SPARCstation I and II, the times are 3 and 4 cycles, respectively.
+Therefore, combining two ST instructions into a STD when possible is a
+significant optimization.
+
+Later SPARC implementations have single cycle ST.
+
+For SuperSPARC, we can perform just one memory instruction per cycle, even
+if up to two integer instructions can be executed in its pipeline. For
+programs that perform so many memory operations that there are not enough
+non-memory operations to issue in parallel with all memory operations, using
+LDD and STD when possible helps.
+
+UltraSPARC-1/2 has very slow integer multiplication. In the v9 subdirectory,
+we therefore use floating-point multiplication.
+
+STATUS
+
+1. On a SuperSPARC, mpn_lshift and mpn_rshift run at 3 cycles/limb, or 2.5
+ cycles/limb asymptotically. We could optimize speed for special counts
+ by using ADDXCC.
+
+2. On a SuperSPARC, mpn_add_n and mpn_sub_n runs at 2.5 cycles/limb, or 2
+ cycles/limb asymptotically.
+
+3. mpn_mul_1 runs at what is believed to be optimal speed.
+
+4. On SuperSPARC, mpn_addmul_1 and mpn_submul_1 could both be improved by a
+ cycle by avoiding one of the add instructions. See a29k/addmul_1.
+
+The speed of the code for other SPARC implementations is uncertain.
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc32/add_n.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc32/add_n.asm
new file mode 100644
index 00000000000..8549195d92c
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc32/add_n.asm
@@ -0,0 +1,245 @@
+dnl SPARC mpn_add_n -- Add two limb vectors of the same length > 0 and store
+dnl sum in a third limb vector.
+
+dnl Copyright 1995, 1996, 2000 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(res_ptr,%o0)
+define(s1_ptr,%o1)
+define(s2_ptr,%o2)
+define(n,%o3)
+
+ASM_START()
+PROLOGUE(mpn_add_n)
+ xor s2_ptr,res_ptr,%g1
+ andcc %g1,4,%g0
+ bne L(1) C branch if alignment differs
+ nop
+C ** V1a **
+L(0): andcc res_ptr,4,%g0 C res_ptr unaligned? Side effect: cy=0
+ be L(v1) C if no, branch
+ nop
+C Add least significant limb separately to align res_ptr and s2_ptr
+ ld [s1_ptr],%g4
+ add s1_ptr,4,s1_ptr
+ ld [s2_ptr],%g2
+ add s2_ptr,4,s2_ptr
+ add n,-1,n
+ addcc %g4,%g2,%o4
+ st %o4,[res_ptr]
+ add res_ptr,4,res_ptr
+L(v1): addx %g0,%g0,%o4 C save cy in register
+ cmp n,2 C if n < 2 ...
+ bl L(end2) C ... branch to tail code
+ subcc %g0,%o4,%g0 C restore cy
+
+ ld [s1_ptr+0],%g4
+ addcc n,-10,n
+ ld [s1_ptr+4],%g1
+ ldd [s2_ptr+0],%g2
+ blt L(fin1)
+ subcc %g0,%o4,%g0 C restore cy
+C Add blocks of 8 limbs until less than 8 limbs remain
+L(loop1):
+ addxcc %g4,%g2,%o4
+ ld [s1_ptr+8],%g4
+ addxcc %g1,%g3,%o5
+ ld [s1_ptr+12],%g1
+ ldd [s2_ptr+8],%g2
+ std %o4,[res_ptr+0]
+ addxcc %g4,%g2,%o4
+ ld [s1_ptr+16],%g4
+ addxcc %g1,%g3,%o5
+ ld [s1_ptr+20],%g1
+ ldd [s2_ptr+16],%g2
+ std %o4,[res_ptr+8]
+ addxcc %g4,%g2,%o4
+ ld [s1_ptr+24],%g4
+ addxcc %g1,%g3,%o5
+ ld [s1_ptr+28],%g1
+ ldd [s2_ptr+24],%g2
+ std %o4,[res_ptr+16]
+ addxcc %g4,%g2,%o4
+ ld [s1_ptr+32],%g4
+ addxcc %g1,%g3,%o5
+ ld [s1_ptr+36],%g1
+ ldd [s2_ptr+32],%g2
+ std %o4,[res_ptr+24]
+ addx %g0,%g0,%o4 C save cy in register
+ addcc n,-8,n
+ add s1_ptr,32,s1_ptr
+ add s2_ptr,32,s2_ptr
+ add res_ptr,32,res_ptr
+ bge L(loop1)
+ subcc %g0,%o4,%g0 C restore cy
+
+L(fin1):
+ addcc n,8-2,n
+ blt L(end1)
+ subcc %g0,%o4,%g0 C restore cy
+C Add blocks of 2 limbs until less than 2 limbs remain
+L(loope1):
+ addxcc %g4,%g2,%o4
+ ld [s1_ptr+8],%g4
+ addxcc %g1,%g3,%o5
+ ld [s1_ptr+12],%g1
+ ldd [s2_ptr+8],%g2
+ std %o4,[res_ptr+0]
+ addx %g0,%g0,%o4 C save cy in register
+ addcc n,-2,n
+ add s1_ptr,8,s1_ptr
+ add s2_ptr,8,s2_ptr
+ add res_ptr,8,res_ptr
+ bge L(loope1)
+ subcc %g0,%o4,%g0 C restore cy
+L(end1):
+ addxcc %g4,%g2,%o4
+ addxcc %g1,%g3,%o5
+ std %o4,[res_ptr+0]
+ addx %g0,%g0,%o4 C save cy in register
+
+ andcc n,1,%g0
+ be L(ret1)
+ subcc %g0,%o4,%g0 C restore cy
+C Add last limb
+ ld [s1_ptr+8],%g4
+ ld [s2_ptr+8],%g2
+ addxcc %g4,%g2,%o4
+ st %o4,[res_ptr+8]
+
+L(ret1):
+ retl
+ addx %g0,%g0,%o0 C return carry-out from most sign. limb
+
+L(1): xor s1_ptr,res_ptr,%g1
+ andcc %g1,4,%g0
+ bne L(2)
+ nop
+C ** V1b **
+ mov s2_ptr,%g1
+ mov s1_ptr,s2_ptr
+ b L(0)
+ mov %g1,s1_ptr
+
+C ** V2 **
+C If we come here, the alignment of s1_ptr and res_ptr as well as the
+C alignment of s2_ptr and res_ptr differ. Since there are only two ways
+C things can be aligned (that we care about) we now know that the alignment
+C of s1_ptr and s2_ptr are the same.
+
+L(2): cmp n,1
+ be L(jone)
+ nop
+ andcc s1_ptr,4,%g0 C s1_ptr unaligned? Side effect: cy=0
+ be L(v2) C if no, branch
+ nop
+C Add least significant limb separately to align s1_ptr and s2_ptr
+ ld [s1_ptr],%g4
+ add s1_ptr,4,s1_ptr
+ ld [s2_ptr],%g2
+ add s2_ptr,4,s2_ptr
+ add n,-1,n
+ addcc %g4,%g2,%o4
+ st %o4,[res_ptr]
+ add res_ptr,4,res_ptr
+
+L(v2): addx %g0,%g0,%o4 C save cy in register
+ addcc n,-8,n
+ blt L(fin2)
+ subcc %g0,%o4,%g0 C restore cy
+C Add blocks of 8 limbs until less than 8 limbs remain
+L(loop2):
+ ldd [s1_ptr+0],%g2
+ ldd [s2_ptr+0],%o4
+ addxcc %g2,%o4,%g2
+ st %g2,[res_ptr+0]
+ addxcc %g3,%o5,%g3
+ st %g3,[res_ptr+4]
+ ldd [s1_ptr+8],%g2
+ ldd [s2_ptr+8],%o4
+ addxcc %g2,%o4,%g2
+ st %g2,[res_ptr+8]
+ addxcc %g3,%o5,%g3
+ st %g3,[res_ptr+12]
+ ldd [s1_ptr+16],%g2
+ ldd [s2_ptr+16],%o4
+ addxcc %g2,%o4,%g2
+ st %g2,[res_ptr+16]
+ addxcc %g3,%o5,%g3
+ st %g3,[res_ptr+20]
+ ldd [s1_ptr+24],%g2
+ ldd [s2_ptr+24],%o4
+ addxcc %g2,%o4,%g2
+ st %g2,[res_ptr+24]
+ addxcc %g3,%o5,%g3
+ st %g3,[res_ptr+28]
+ addx %g0,%g0,%o4 C save cy in register
+ addcc n,-8,n
+ add s1_ptr,32,s1_ptr
+ add s2_ptr,32,s2_ptr
+ add res_ptr,32,res_ptr
+ bge L(loop2)
+ subcc %g0,%o4,%g0 C restore cy
+
+L(fin2):
+ addcc n,8-2,n
+ blt L(end2)
+ subcc %g0,%o4,%g0 C restore cy
+L(loope2):
+ ldd [s1_ptr+0],%g2
+ ldd [s2_ptr+0],%o4
+ addxcc %g2,%o4,%g2
+ st %g2,[res_ptr+0]
+ addxcc %g3,%o5,%g3
+ st %g3,[res_ptr+4]
+ addx %g0,%g0,%o4 C save cy in register
+ addcc n,-2,n
+ add s1_ptr,8,s1_ptr
+ add s2_ptr,8,s2_ptr
+ add res_ptr,8,res_ptr
+ bge L(loope2)
+ subcc %g0,%o4,%g0 C restore cy
+L(end2):
+ andcc n,1,%g0
+ be L(ret2)
+ subcc %g0,%o4,%g0 C restore cy
+C Add last limb
+L(jone):
+ ld [s1_ptr],%g4
+ ld [s2_ptr],%g2
+ addxcc %g4,%g2,%o4
+ st %o4,[res_ptr]
+
+L(ret2):
+ retl
+ addx %g0,%g0,%o0 C return carry-out from most sign. limb
+EPILOGUE(mpn_add_n)
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc32/addmul_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc32/addmul_1.asm
new file mode 100644
index 00000000000..92d5d78d511
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc32/addmul_1.asm
@@ -0,0 +1,155 @@
+dnl SPARC mpn_addmul_1 -- Multiply a limb vector with a limb and add the
+dnl result to a second limb vector.
+
+dnl Copyright 1992-1994, 2000 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 o0
+C s1_ptr o1
+C size o2
+C s2_limb o3
+
+ASM_START()
+PROLOGUE(mpn_addmul_1)
+ C Make S1_PTR and RES_PTR point at the end of their blocks
+ C and put (- 4 x SIZE) in index/loop counter.
+ sll %o2,2,%o2
+ add %o0,%o2,%o4 C RES_PTR in o4 since o0 is retval
+ add %o1,%o2,%o1
+ sub %g0,%o2,%o2
+
+ cmp %o3,0xfff
+ bgu L(large)
+ nop
+
+ ld [%o1+%o2],%o5
+ mov 0,%o0
+ b L(0)
+ add %o4,-4,%o4
+L(loop0):
+ addcc %o5,%g1,%g1
+ ld [%o1+%o2],%o5
+ addx %o0,%g0,%o0
+ st %g1,[%o4+%o2]
+L(0): wr %g0,%o3,%y
+ sra %o5,31,%g2
+ and %o3,%g2,%g2
+ andcc %g1,0,%g1
+ mulscc %g1,%o5,%g1
+ mulscc %g1,%o5,%g1
+ mulscc %g1,%o5,%g1
+ mulscc %g1,%o5,%g1
+ mulscc %g1,%o5,%g1
+ mulscc %g1,%o5,%g1
+ mulscc %g1,%o5,%g1
+ mulscc %g1,%o5,%g1
+ mulscc %g1,%o5,%g1
+ mulscc %g1,%o5,%g1
+ mulscc %g1,%o5,%g1
+ mulscc %g1,%o5,%g1
+ mulscc %g1,0,%g1
+ sra %g1,20,%g4
+ sll %g1,12,%g1
+ rd %y,%g3
+ srl %g3,20,%g3
+ or %g1,%g3,%g1
+
+ addcc %g1,%o0,%g1
+ addx %g2,%g4,%o0 C add sign-compensation and cy to hi limb
+ addcc %o2,4,%o2 C loop counter
+ bne L(loop0)
+ ld [%o4+%o2],%o5
+
+ addcc %o5,%g1,%g1
+ addx %o0,%g0,%o0
+ retl
+ st %g1,[%o4+%o2]
+
+L(large):
+ ld [%o1+%o2],%o5
+ mov 0,%o0
+ sra %o3,31,%g4 C g4 = mask of ones iff S2_LIMB < 0
+ b L(1)
+ add %o4,-4,%o4
+L(loop):
+ addcc %o5,%g3,%g3
+ ld [%o1+%o2],%o5
+ addx %o0,%g0,%o0
+ st %g3,[%o4+%o2]
+L(1): wr %g0,%o5,%y
+ and %o5,%g4,%g2
+ andcc %g0,%g0,%g1
+ mulscc %g1,%o3,%g1
+ mulscc %g1,%o3,%g1
+ mulscc %g1,%o3,%g1
+ mulscc %g1,%o3,%g1
+ mulscc %g1,%o3,%g1
+ mulscc %g1,%o3,%g1
+ mulscc %g1,%o3,%g1
+ mulscc %g1,%o3,%g1
+ mulscc %g1,%o3,%g1
+ mulscc %g1,%o3,%g1
+ mulscc %g1,%o3,%g1
+ mulscc %g1,%o3,%g1
+ mulscc %g1,%o3,%g1
+ mulscc %g1,%o3,%g1
+ mulscc %g1,%o3,%g1
+ mulscc %g1,%o3,%g1
+ mulscc %g1,%o3,%g1
+ mulscc %g1,%o3,%g1
+ mulscc %g1,%o3,%g1
+ mulscc %g1,%o3,%g1
+ mulscc %g1,%o3,%g1
+ mulscc %g1,%o3,%g1
+ mulscc %g1,%o3,%g1
+ mulscc %g1,%o3,%g1
+ mulscc %g1,%o3,%g1
+ mulscc %g1,%o3,%g1
+ mulscc %g1,%o3,%g1
+ mulscc %g1,%o3,%g1
+ mulscc %g1,%o3,%g1
+ mulscc %g1,%o3,%g1
+ mulscc %g1,%o3,%g1
+ mulscc %g1,%o3,%g1
+ mulscc %g1,%g0,%g1
+ rd %y,%g3
+ addcc %g3,%o0,%g3
+ addx %g2,%g1,%o0
+ addcc %o2,4,%o2
+ bne L(loop)
+ ld [%o4+%o2],%o5
+
+ addcc %o5,%g3,%g3
+ addx %o0,%g0,%o0
+ retl
+ st %g3,[%o4+%o2]
+EPILOGUE(mpn_addmul_1)
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc32/gmp-mparam.h b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc32/gmp-mparam.h
new file mode 100644
index 00000000000..a3bc6125430
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc32/gmp-mparam.h
@@ -0,0 +1,67 @@
+/* SPARC v7 gmp-mparam.h -- Compiler/machine parameter header file.
+
+Copyright 1991, 1993, 1994, 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/. */
+
+/* Generated by tuneup.c, 2002-03-13, gcc 2.95, Weitek 8701 */
+
+#define MUL_TOOM22_THRESHOLD 8
+#define MUL_TOOM33_THRESHOLD 466
+
+#define SQR_BASECASE_THRESHOLD 4
+#define SQR_TOOM2_THRESHOLD 16
+#define SQR_TOOM3_THRESHOLD 258
+
+#define DIV_SB_PREINV_THRESHOLD 4
+#define DIV_DC_THRESHOLD 28
+#define POWM_THRESHOLD 28
+
+#define GCD_ACCEL_THRESHOLD 3
+#define JACOBI_BASE_METHOD 2
+
+#define DIVREM_1_NORM_THRESHOLD 3
+#define DIVREM_1_UNNORM_THRESHOLD 4
+#define MOD_1_NORM_THRESHOLD 3
+#define MOD_1_UNNORM_THRESHOLD 4
+#define USE_PREINV_DIVREM_1 1
+#define USE_PREINV_MOD_1 1
+#define DIVREM_2_THRESHOLD 0 /* always */
+#define DIVEXACT_1_THRESHOLD 120
+#define MODEXACT_1_ODD_THRESHOLD MP_SIZE_T_MAX /* never */
+
+#define GET_STR_DC_THRESHOLD 21
+#define GET_STR_PRECOMPUTE_THRESHOLD 25
+#define SET_STR_THRESHOLD 1012
+
+#define MUL_FFT_TABLE { 272, 672, 1152, 3584, 10240, 24576, 0 }
+#define MUL_FFT_MODF_THRESHOLD 264
+#define MUL_FFT_THRESHOLD 2304
+
+#define SQR_FFT_TABLE { 304, 736, 1152, 3584, 10240, 24576, 0 }
+#define SQR_FFT_MODF_THRESHOLD 248
+#define SQR_FFT_THRESHOLD 2304
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc32/lshift.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc32/lshift.asm
new file mode 100644
index 00000000000..8321343d6bb
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc32/lshift.asm
@@ -0,0 +1,105 @@
+dnl SPARC mpn_lshift -- Shift a number left.
+
+dnl Copyright 1995, 1996, 2000 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 %o0
+C src_ptr %o1
+C size %o2
+C cnt %o3
+
+ASM_START()
+PROLOGUE(mpn_lshift)
+ sll %o2,2,%g1
+ add %o1,%g1,%o1 C make %o1 point at end of src
+ ld [%o1-4],%g2 C load first limb
+ sub %g0,%o3,%o5 C negate shift count
+ add %o0,%g1,%o0 C make %o0 point at end of res
+ add %o2,-1,%o2
+ andcc %o2,4-1,%g4 C number of limbs in first loop
+ srl %g2,%o5,%g1 C compute function result
+ be L(0) C if multiple of 4 limbs, skip first loop
+ st %g1,[%sp+80]
+
+ sub %o2,%g4,%o2 C adjust count for main loop
+
+L(loop0):
+ ld [%o1-8],%g3
+ add %o0,-4,%o0
+ add %o1,-4,%o1
+ addcc %g4,-1,%g4
+ sll %g2,%o3,%o4
+ srl %g3,%o5,%g1
+ mov %g3,%g2
+ or %o4,%g1,%o4
+ bne L(loop0)
+ st %o4,[%o0+0]
+
+L(0): tst %o2
+ be L(end)
+ nop
+
+L(loop):
+ ld [%o1-8],%g3
+ add %o0,-16,%o0
+ addcc %o2,-4,%o2
+ sll %g2,%o3,%o4
+ srl %g3,%o5,%g1
+
+ ld [%o1-12],%g2
+ sll %g3,%o3,%g4
+ or %o4,%g1,%o4
+ st %o4,[%o0+12]
+ srl %g2,%o5,%g1
+
+ ld [%o1-16],%g3
+ sll %g2,%o3,%o4
+ or %g4,%g1,%g4
+ st %g4,[%o0+8]
+ srl %g3,%o5,%g1
+
+ ld [%o1-20],%g2
+ sll %g3,%o3,%g4
+ or %o4,%g1,%o4
+ st %o4,[%o0+4]
+ srl %g2,%o5,%g1
+
+ add %o1,-16,%o1
+ or %g4,%g1,%g4
+ bne L(loop)
+ st %g4,[%o0+0]
+
+L(end): sll %g2,%o3,%g2
+ st %g2,[%o0-4]
+ retl
+ ld [%sp+80],%o0
+EPILOGUE(mpn_lshift)
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc32/mul_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc32/mul_1.asm
new file mode 100644
index 00000000000..42b4168be14
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc32/mul_1.asm
@@ -0,0 +1,146 @@
+dnl SPARC mpn_mul_1 -- Multiply a limb vector with a limb and store
+dnl the result in a second limb vector.
+
+dnl Copyright 1992-1994, 2000 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 o0
+C s1_ptr o1
+C size o2
+C s2_limb o3
+
+ASM_START()
+PROLOGUE(mpn_mul_1)
+ C Make S1_PTR and RES_PTR point at the end of their blocks
+ C and put (- 4 x SIZE) in index/loop counter.
+ sll %o2,2,%o2
+ add %o0,%o2,%o4 C RES_PTR in o4 since o0 is retval
+ add %o1,%o2,%o1
+ sub %g0,%o2,%o2
+
+ cmp %o3,0xfff
+ bgu L(large)
+ nop
+
+ ld [%o1+%o2],%o5
+ mov 0,%o0
+ b L(0)
+ add %o4,-4,%o4
+L(loop0):
+ st %g1,[%o4+%o2]
+L(0): wr %g0,%o3,%y
+ sra %o5,31,%g2
+ and %o3,%g2,%g2
+ andcc %g1,0,%g1
+ mulscc %g1,%o5,%g1
+ mulscc %g1,%o5,%g1
+ mulscc %g1,%o5,%g1
+ mulscc %g1,%o5,%g1
+ mulscc %g1,%o5,%g1
+ mulscc %g1,%o5,%g1
+ mulscc %g1,%o5,%g1
+ mulscc %g1,%o5,%g1
+ mulscc %g1,%o5,%g1
+ mulscc %g1,%o5,%g1
+ mulscc %g1,%o5,%g1
+ mulscc %g1,%o5,%g1
+ mulscc %g1,0,%g1
+ sra %g1,20,%g4
+ sll %g1,12,%g1
+ rd %y,%g3
+ srl %g3,20,%g3
+ or %g1,%g3,%g1
+
+ addcc %g1,%o0,%g1
+ addx %g2,%g4,%o0 C add sign-compensation and cy to hi limb
+ addcc %o2,4,%o2 C loop counter
+ bne,a L(loop0)
+ ld [%o1+%o2],%o5
+
+ retl
+ st %g1,[%o4+%o2]
+
+
+L(large):
+ ld [%o1+%o2],%o5
+ mov 0,%o0
+ sra %o3,31,%g4 C g4 = mask of ones iff S2_LIMB < 0
+ b L(1)
+ add %o4,-4,%o4
+L(loop):
+ st %g3,[%o4+%o2]
+L(1): wr %g0,%o5,%y
+ and %o5,%g4,%g2 C g2 = S1_LIMB iff S2_LIMB < 0, else 0
+ andcc %g0,%g0,%g1
+ mulscc %g1,%o3,%g1
+ mulscc %g1,%o3,%g1
+ mulscc %g1,%o3,%g1
+ mulscc %g1,%o3,%g1
+ mulscc %g1,%o3,%g1
+ mulscc %g1,%o3,%g1
+ mulscc %g1,%o3,%g1
+ mulscc %g1,%o3,%g1
+ mulscc %g1,%o3,%g1
+ mulscc %g1,%o3,%g1
+ mulscc %g1,%o3,%g1
+ mulscc %g1,%o3,%g1
+ mulscc %g1,%o3,%g1
+ mulscc %g1,%o3,%g1
+ mulscc %g1,%o3,%g1
+ mulscc %g1,%o3,%g1
+ mulscc %g1,%o3,%g1
+ mulscc %g1,%o3,%g1
+ mulscc %g1,%o3,%g1
+ mulscc %g1,%o3,%g1
+ mulscc %g1,%o3,%g1
+ mulscc %g1,%o3,%g1
+ mulscc %g1,%o3,%g1
+ mulscc %g1,%o3,%g1
+ mulscc %g1,%o3,%g1
+ mulscc %g1,%o3,%g1
+ mulscc %g1,%o3,%g1
+ mulscc %g1,%o3,%g1
+ mulscc %g1,%o3,%g1
+ mulscc %g1,%o3,%g1
+ mulscc %g1,%o3,%g1
+ mulscc %g1,%o3,%g1
+ mulscc %g1,%g0,%g1
+ rd %y,%g3
+ addcc %g3,%o0,%g3
+ addx %g2,%g1,%o0 C add sign-compensation and cy to hi limb
+ addcc %o2,4,%o2 C loop counter
+ bne,a L(loop)
+ ld [%o1+%o2],%o5
+
+ retl
+ st %g3,[%o4+%o2]
+EPILOGUE(mpn_mul_1)
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc32/rshift.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc32/rshift.asm
new file mode 100644
index 00000000000..e1554766fe1
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc32/rshift.asm
@@ -0,0 +1,102 @@
+dnl SPARC mpn_rshift -- Shift a number right.
+
+dnl Copyright 1995, 1996, 2000 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 %o0
+C src_ptr %o1
+C size %o2
+C cnt %o3
+
+ASM_START()
+PROLOGUE(mpn_rshift)
+ ld [%o1],%g2 C load first limb
+ sub %g0,%o3,%o5 C negate shift count
+ add %o2,-1,%o2
+ andcc %o2,4-1,%g4 C number of limbs in first loop
+ sll %g2,%o5,%g1 C compute function result
+ be L(0) C if multiple of 4 limbs, skip first loop
+ st %g1,[%sp+80]
+
+ sub %o2,%g4,%o2 C adjust count for main loop
+
+L(loop0):
+ ld [%o1+4],%g3
+ add %o0,4,%o0
+ add %o1,4,%o1
+ addcc %g4,-1,%g4
+ srl %g2,%o3,%o4
+ sll %g3,%o5,%g1
+ mov %g3,%g2
+ or %o4,%g1,%o4
+ bne L(loop0)
+ st %o4,[%o0-4]
+
+L(0): tst %o2
+ be L(end)
+ nop
+
+L(loop):
+ ld [%o1+4],%g3
+ add %o0,16,%o0
+ addcc %o2,-4,%o2
+ srl %g2,%o3,%o4
+ sll %g3,%o5,%g1
+
+ ld [%o1+8],%g2
+ srl %g3,%o3,%g4
+ or %o4,%g1,%o4
+ st %o4,[%o0-16]
+ sll %g2,%o5,%g1
+
+ ld [%o1+12],%g3
+ srl %g2,%o3,%o4
+ or %g4,%g1,%g4
+ st %g4,[%o0-12]
+ sll %g3,%o5,%g1
+
+ ld [%o1+16],%g2
+ srl %g3,%o3,%g4
+ or %o4,%g1,%o4
+ st %o4,[%o0-8]
+ sll %g2,%o5,%g1
+
+ add %o1,16,%o1
+ or %g4,%g1,%g4
+ bne L(loop)
+ st %g4,[%o0-4]
+
+L(end): srl %g2,%o3,%g2
+ st %g2,[%o0-0]
+ retl
+ ld [%sp+80],%o0
+EPILOGUE(mpn_rshift)
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc32/sparc-defs.m4 b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc32/sparc-defs.m4
new file mode 100644
index 00000000000..5a0d4252047
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc32/sparc-defs.m4
@@ -0,0 +1,79 @@
+divert(-1)
+
+dnl m4 macros for SPARC assembler (32 and 64 bit).
+
+
+dnl Copyright 2002, 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/.
+
+
+changecom(;) dnl cannot use default # since that's used in REGISTER decls
+
+
+dnl Usage: REGISTER(reg,attr)
+dnl
+dnl Give a ".register reg,attr" directive, if the assembler supports it.
+dnl HAVE_REGISTER comes from the GMP_ASM_SPARC_REGISTER configure test.
+
+define(REGISTER,
+m4_assert_numargs(2)
+m4_assert_defined(`HAVE_REGISTER')
+`ifelse(HAVE_REGISTER,yes,
+`.register `$1',`$2'')')
+
+
+C Testing mechanism for running newer code on older processors
+ifdef(`FAKE_T3',`
+ include_mpn(`sparc64/ultrasparct3/missing.m4')
+',`
+ define(`addxccc', ``addxccc' $1, $2, $3')
+ define(`addxc', ``addxc' $1, $2, $3')
+ define(`umulxhi', ``umulxhi' $1, $2, $3')
+ define(`lzcnt', ``lzd' $1, $2')
+')
+
+dnl Usage: LEA64(symbol,reg,pic_reg)
+dnl
+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.
+
+define(LEA64,
+m4_assert_numargs(3)
+m4_assert_defined(`HAVE_GOTDATA')
+`ifdef(`PIC',`
+ rd %pc, %`$2'
+ 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'')')
+
+divert
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc32/sub_n.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc32/sub_n.asm
new file mode 100644
index 00000000000..24a576d82b8
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc32/sub_n.asm
@@ -0,0 +1,335 @@
+dnl SPARC mpn_sub_n -- Subtract two limb vectors of the same length > 0 and
+dnl store difference in a third limb vector.
+
+dnl Copyright 1995, 1996, 2000 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(res_ptr,%o0)
+define(s1_ptr,%o1)
+define(s2_ptr,%o2)
+define(n,%o3)
+
+ASM_START()
+PROLOGUE(mpn_sub_n)
+ xor s2_ptr,res_ptr,%g1
+ andcc %g1,4,%g0
+ bne L(1) C branch if alignment differs
+ nop
+C ** V1a **
+ andcc res_ptr,4,%g0 C res_ptr unaligned? Side effect: cy=0
+ be L(v1) C if no, branch
+ nop
+C Add least significant limb separately to align res_ptr and s2_ptr
+ ld [s1_ptr],%g4
+ add s1_ptr,4,s1_ptr
+ ld [s2_ptr],%g2
+ add s2_ptr,4,s2_ptr
+ add n,-1,n
+ subcc %g4,%g2,%o4
+ st %o4,[res_ptr]
+ add res_ptr,4,res_ptr
+L(v1): addx %g0,%g0,%o4 C save cy in register
+ cmp n,2 C if n < 2 ...
+ bl L(end2) C ... branch to tail code
+ subcc %g0,%o4,%g0 C restore cy
+
+ ld [s1_ptr+0],%g4
+ addcc n,-10,n
+ ld [s1_ptr+4],%g1
+ ldd [s2_ptr+0],%g2
+ blt L(fin1)
+ subcc %g0,%o4,%g0 C restore cy
+C Add blocks of 8 limbs until less than 8 limbs remain
+L(loop1):
+ subxcc %g4,%g2,%o4
+ ld [s1_ptr+8],%g4
+ subxcc %g1,%g3,%o5
+ ld [s1_ptr+12],%g1
+ ldd [s2_ptr+8],%g2
+ std %o4,[res_ptr+0]
+ subxcc %g4,%g2,%o4
+ ld [s1_ptr+16],%g4
+ subxcc %g1,%g3,%o5
+ ld [s1_ptr+20],%g1
+ ldd [s2_ptr+16],%g2
+ std %o4,[res_ptr+8]
+ subxcc %g4,%g2,%o4
+ ld [s1_ptr+24],%g4
+ subxcc %g1,%g3,%o5
+ ld [s1_ptr+28],%g1
+ ldd [s2_ptr+24],%g2
+ std %o4,[res_ptr+16]
+ subxcc %g4,%g2,%o4
+ ld [s1_ptr+32],%g4
+ subxcc %g1,%g3,%o5
+ ld [s1_ptr+36],%g1
+ ldd [s2_ptr+32],%g2
+ std %o4,[res_ptr+24]
+ addx %g0,%g0,%o4 C save cy in register
+ addcc n,-8,n
+ add s1_ptr,32,s1_ptr
+ add s2_ptr,32,s2_ptr
+ add res_ptr,32,res_ptr
+ bge L(loop1)
+ subcc %g0,%o4,%g0 C restore cy
+
+L(fin1):
+ addcc n,8-2,n
+ blt L(end1)
+ subcc %g0,%o4,%g0 C restore cy
+C Add blocks of 2 limbs until less than 2 limbs remain
+L(loope1):
+ subxcc %g4,%g2,%o4
+ ld [s1_ptr+8],%g4
+ subxcc %g1,%g3,%o5
+ ld [s1_ptr+12],%g1
+ ldd [s2_ptr+8],%g2
+ std %o4,[res_ptr+0]
+ addx %g0,%g0,%o4 C save cy in register
+ addcc n,-2,n
+ add s1_ptr,8,s1_ptr
+ add s2_ptr,8,s2_ptr
+ add res_ptr,8,res_ptr
+ bge L(loope1)
+ subcc %g0,%o4,%g0 C restore cy
+L(end1):
+ subxcc %g4,%g2,%o4
+ subxcc %g1,%g3,%o5
+ std %o4,[res_ptr+0]
+ addx %g0,%g0,%o4 C save cy in register
+
+ andcc n,1,%g0
+ be L(ret1)
+ subcc %g0,%o4,%g0 C restore cy
+C Add last limb
+ ld [s1_ptr+8],%g4
+ ld [s2_ptr+8],%g2
+ subxcc %g4,%g2,%o4
+ st %o4,[res_ptr+8]
+
+L(ret1):
+ retl
+ addx %g0,%g0,%o0 C return carry-out from most sign. limb
+
+L(1): xor s1_ptr,res_ptr,%g1
+ andcc %g1,4,%g0
+ bne L(2)
+ nop
+C ** V1b **
+ andcc res_ptr,4,%g0 C res_ptr unaligned? Side effect: cy=0
+ be L(v1b) C if no, branch
+ nop
+C Add least significant limb separately to align res_ptr and s1_ptr
+ ld [s2_ptr],%g4
+ add s2_ptr,4,s2_ptr
+ ld [s1_ptr],%g2
+ add s1_ptr,4,s1_ptr
+ add n,-1,n
+ subcc %g2,%g4,%o4
+ st %o4,[res_ptr]
+ add res_ptr,4,res_ptr
+L(v1b): addx %g0,%g0,%o4 C save cy in register
+ cmp n,2 C if n < 2 ...
+ bl L(end2) C ... branch to tail code
+ subcc %g0,%o4,%g0 C restore cy
+
+ ld [s2_ptr+0],%g4
+ addcc n,-10,n
+ ld [s2_ptr+4],%g1
+ ldd [s1_ptr+0],%g2
+ blt L(fin1b)
+ subcc %g0,%o4,%g0 C restore cy
+C Add blocks of 8 limbs until less than 8 limbs remain
+L(loop1b):
+ subxcc %g2,%g4,%o4
+ ld [s2_ptr+8],%g4
+ subxcc %g3,%g1,%o5
+ ld [s2_ptr+12],%g1
+ ldd [s1_ptr+8],%g2
+ std %o4,[res_ptr+0]
+ subxcc %g2,%g4,%o4
+ ld [s2_ptr+16],%g4
+ subxcc %g3,%g1,%o5
+ ld [s2_ptr+20],%g1
+ ldd [s1_ptr+16],%g2
+ std %o4,[res_ptr+8]
+ subxcc %g2,%g4,%o4
+ ld [s2_ptr+24],%g4
+ subxcc %g3,%g1,%o5
+ ld [s2_ptr+28],%g1
+ ldd [s1_ptr+24],%g2
+ std %o4,[res_ptr+16]
+ subxcc %g2,%g4,%o4
+ ld [s2_ptr+32],%g4
+ subxcc %g3,%g1,%o5
+ ld [s2_ptr+36],%g1
+ ldd [s1_ptr+32],%g2
+ std %o4,[res_ptr+24]
+ addx %g0,%g0,%o4 C save cy in register
+ addcc n,-8,n
+ add s1_ptr,32,s1_ptr
+ add s2_ptr,32,s2_ptr
+ add res_ptr,32,res_ptr
+ bge L(loop1b)
+ subcc %g0,%o4,%g0 C restore cy
+
+L(fin1b):
+ addcc n,8-2,n
+ blt L(end1b)
+ subcc %g0,%o4,%g0 C restore cy
+C Add blocks of 2 limbs until less than 2 limbs remain
+L(loope1b):
+ subxcc %g2,%g4,%o4
+ ld [s2_ptr+8],%g4
+ subxcc %g3,%g1,%o5
+ ld [s2_ptr+12],%g1
+ ldd [s1_ptr+8],%g2
+ std %o4,[res_ptr+0]
+ addx %g0,%g0,%o4 C save cy in register
+ addcc n,-2,n
+ add s1_ptr,8,s1_ptr
+ add s2_ptr,8,s2_ptr
+ add res_ptr,8,res_ptr
+ bge L(loope1b)
+ subcc %g0,%o4,%g0 C restore cy
+L(end1b):
+ subxcc %g2,%g4,%o4
+ subxcc %g3,%g1,%o5
+ std %o4,[res_ptr+0]
+ addx %g0,%g0,%o4 C save cy in register
+
+ andcc n,1,%g0
+ be L(ret1b)
+ subcc %g0,%o4,%g0 C restore cy
+C Add last limb
+ ld [s2_ptr+8],%g4
+ ld [s1_ptr+8],%g2
+ subxcc %g2,%g4,%o4
+ st %o4,[res_ptr+8]
+
+L(ret1b):
+ retl
+ addx %g0,%g0,%o0 C return carry-out from most sign. limb
+
+C ** V2 **
+C If we come here, the alignment of s1_ptr and res_ptr as well as the
+C alignment of s2_ptr and res_ptr differ. Since there are only two ways
+C things can be aligned (that we care about) we now know that the alignment
+C of s1_ptr and s2_ptr are the same.
+
+L(2): cmp n,1
+ be L(jone)
+ nop
+ andcc s1_ptr,4,%g0 C s1_ptr unaligned? Side effect: cy=0
+ be L(v2) C if no, branch
+ nop
+C Add least significant limb separately to align s1_ptr and s2_ptr
+ ld [s1_ptr],%g4
+ add s1_ptr,4,s1_ptr
+ ld [s2_ptr],%g2
+ add s2_ptr,4,s2_ptr
+ add n,-1,n
+ subcc %g4,%g2,%o4
+ st %o4,[res_ptr]
+ add res_ptr,4,res_ptr
+
+L(v2): addx %g0,%g0,%o4 C save cy in register
+ addcc n,-8,n
+ blt L(fin2)
+ subcc %g0,%o4,%g0 C restore cy
+C Add blocks of 8 limbs until less than 8 limbs remain
+L(loop2):
+ ldd [s1_ptr+0],%g2
+ ldd [s2_ptr+0],%o4
+ subxcc %g2,%o4,%g2
+ st %g2,[res_ptr+0]
+ subxcc %g3,%o5,%g3
+ st %g3,[res_ptr+4]
+ ldd [s1_ptr+8],%g2
+ ldd [s2_ptr+8],%o4
+ subxcc %g2,%o4,%g2
+ st %g2,[res_ptr+8]
+ subxcc %g3,%o5,%g3
+ st %g3,[res_ptr+12]
+ ldd [s1_ptr+16],%g2
+ ldd [s2_ptr+16],%o4
+ subxcc %g2,%o4,%g2
+ st %g2,[res_ptr+16]
+ subxcc %g3,%o5,%g3
+ st %g3,[res_ptr+20]
+ ldd [s1_ptr+24],%g2
+ ldd [s2_ptr+24],%o4
+ subxcc %g2,%o4,%g2
+ st %g2,[res_ptr+24]
+ subxcc %g3,%o5,%g3
+ st %g3,[res_ptr+28]
+ addx %g0,%g0,%o4 C save cy in register
+ addcc n,-8,n
+ add s1_ptr,32,s1_ptr
+ add s2_ptr,32,s2_ptr
+ add res_ptr,32,res_ptr
+ bge L(loop2)
+ subcc %g0,%o4,%g0 C restore cy
+
+L(fin2):
+ addcc n,8-2,n
+ blt L(end2)
+ subcc %g0,%o4,%g0 C restore cy
+L(loope2):
+ ldd [s1_ptr+0],%g2
+ ldd [s2_ptr+0],%o4
+ subxcc %g2,%o4,%g2
+ st %g2,[res_ptr+0]
+ subxcc %g3,%o5,%g3
+ st %g3,[res_ptr+4]
+ addx %g0,%g0,%o4 C save cy in register
+ addcc n,-2,n
+ add s1_ptr,8,s1_ptr
+ add s2_ptr,8,s2_ptr
+ add res_ptr,8,res_ptr
+ bge L(loope2)
+ subcc %g0,%o4,%g0 C restore cy
+L(end2):
+ andcc n,1,%g0
+ be L(ret2)
+ subcc %g0,%o4,%g0 C restore cy
+C Add last limb
+L(jone):
+ ld [s1_ptr],%g4
+ ld [s2_ptr],%g2
+ subxcc %g4,%g2,%o4
+ st %o4,[res_ptr]
+
+L(ret2):
+ retl
+ addx %g0,%g0,%o0 C return carry-out from most sign. limb
+EPILOGUE(mpn_sub_n)
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc32/submul_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc32/submul_1.asm
new file mode 100644
index 00000000000..73f93770067
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc32/submul_1.asm
@@ -0,0 +1,155 @@
+dnl SPARC mpn_submul_1 -- Multiply a limb vector with a limb and subtract
+dnl the result from a second limb vector.
+
+dnl Copyright 1992-1994, 2000 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 o0
+C s1_ptr o1
+C size o2
+C s2_limb o3
+
+ASM_START()
+PROLOGUE(mpn_submul_1)
+ C Make S1_PTR and RES_PTR point at the end of their blocks
+ C and put (- 4 x SIZE) in index/loop counter.
+ sll %o2,2,%o2
+ add %o0,%o2,%o4 C RES_PTR in o4 since o0 is retval
+ add %o1,%o2,%o1
+ sub %g0,%o2,%o2
+
+ cmp %o3,0xfff
+ bgu L(large)
+ nop
+
+ ld [%o1+%o2],%o5
+ mov 0,%o0
+ b L(0)
+ add %o4,-4,%o4
+L(loop0):
+ subcc %o5,%g1,%g1
+ ld [%o1+%o2],%o5
+ addx %o0,%g0,%o0
+ st %g1,[%o4+%o2]
+L(0): wr %g0,%o3,%y
+ sra %o5,31,%g2
+ and %o3,%g2,%g2
+ andcc %g1,0,%g1
+ mulscc %g1,%o5,%g1
+ mulscc %g1,%o5,%g1
+ mulscc %g1,%o5,%g1
+ mulscc %g1,%o5,%g1
+ mulscc %g1,%o5,%g1
+ mulscc %g1,%o5,%g1
+ mulscc %g1,%o5,%g1
+ mulscc %g1,%o5,%g1
+ mulscc %g1,%o5,%g1
+ mulscc %g1,%o5,%g1
+ mulscc %g1,%o5,%g1
+ mulscc %g1,%o5,%g1
+ mulscc %g1,0,%g1
+ sra %g1,20,%g4
+ sll %g1,12,%g1
+ rd %y,%g3
+ srl %g3,20,%g3
+ or %g1,%g3,%g1
+
+ addcc %g1,%o0,%g1
+ addx %g2,%g4,%o0 C add sign-compensation and cy to hi limb
+ addcc %o2,4,%o2 C loop counter
+ bne L(loop0)
+ ld [%o4+%o2],%o5
+
+ subcc %o5,%g1,%g1
+ addx %o0,%g0,%o0
+ retl
+ st %g1,[%o4+%o2]
+
+L(large):
+ ld [%o1+%o2],%o5
+ mov 0,%o0
+ sra %o3,31,%g4 C g4 = mask of ones iff S2_LIMB < 0
+ b L(1)
+ add %o4,-4,%o4
+L(loop):
+ subcc %o5,%g3,%g3
+ ld [%o1+%o2],%o5
+ addx %o0,%g0,%o0
+ st %g3,[%o4+%o2]
+L(1): wr %g0,%o5,%y
+ and %o5,%g4,%g2
+ andcc %g0,%g0,%g1
+ mulscc %g1,%o3,%g1
+ mulscc %g1,%o3,%g1
+ mulscc %g1,%o3,%g1
+ mulscc %g1,%o3,%g1
+ mulscc %g1,%o3,%g1
+ mulscc %g1,%o3,%g1
+ mulscc %g1,%o3,%g1
+ mulscc %g1,%o3,%g1
+ mulscc %g1,%o3,%g1
+ mulscc %g1,%o3,%g1
+ mulscc %g1,%o3,%g1
+ mulscc %g1,%o3,%g1
+ mulscc %g1,%o3,%g1
+ mulscc %g1,%o3,%g1
+ mulscc %g1,%o3,%g1
+ mulscc %g1,%o3,%g1
+ mulscc %g1,%o3,%g1
+ mulscc %g1,%o3,%g1
+ mulscc %g1,%o3,%g1
+ mulscc %g1,%o3,%g1
+ mulscc %g1,%o3,%g1
+ mulscc %g1,%o3,%g1
+ mulscc %g1,%o3,%g1
+ mulscc %g1,%o3,%g1
+ mulscc %g1,%o3,%g1
+ mulscc %g1,%o3,%g1
+ mulscc %g1,%o3,%g1
+ mulscc %g1,%o3,%g1
+ mulscc %g1,%o3,%g1
+ mulscc %g1,%o3,%g1
+ mulscc %g1,%o3,%g1
+ mulscc %g1,%o3,%g1
+ mulscc %g1,%g0,%g1
+ rd %y,%g3
+ addcc %g3,%o0,%g3
+ addx %g2,%g1,%o0
+ addcc %o2,4,%o2
+ bne L(loop)
+ ld [%o4+%o2],%o5
+
+ subcc %o5,%g3,%g3
+ addx %o0,%g0,%o0
+ retl
+ st %g3,[%o4+%o2]
+EPILOGUE(mpn_submul_1)
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc32/udiv.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc32/udiv.asm
new file mode 100644
index 00000000000..23ab3de1dbb
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc32/udiv.asm
@@ -0,0 +1,167 @@
+dnl SPARC v7 __udiv_qrnnd division support, used from longlong.h.
+dnl This is for v7 CPUs with a floating-point unit.
+
+dnl Copyright 1993, 1994, 1996, 2000 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 rem_ptr i0
+C n1 i1
+C n0 i2
+C d i3
+
+ASM_START()
+
+ifdef(`PIC',
+` TEXT
+L(getpc):
+ retl
+ nop')
+
+ TEXT
+ ALIGN(8)
+L(C0): .double 0r4294967296
+L(C1): .double 0r2147483648
+
+PROLOGUE(mpn_udiv_qrnnd)
+ save %sp,-104,%sp
+ st %i1,[%fp-8]
+ ld [%fp-8],%f10
+
+ifdef(`PIC',
+`L(pc): call L(getpc) C put address of this insn in %o7
+ ldd [%o7+L(C0)-L(pc)],%f8',
+` sethi %hi(L(C0)),%o7
+ ldd [%o7+%lo(L(C0))],%f8')
+
+ fitod %f10,%f4
+ cmp %i1,0
+ bge L(248)
+ mov %i0,%i5
+ faddd %f4,%f8,%f4
+L(248):
+ st %i2,[%fp-8]
+ ld [%fp-8],%f10
+ fmuld %f4,%f8,%f6
+ cmp %i2,0
+ bge L(249)
+ fitod %f10,%f2
+ faddd %f2,%f8,%f2
+L(249):
+ st %i3,[%fp-8]
+ faddd %f6,%f2,%f2
+ ld [%fp-8],%f10
+ cmp %i3,0
+ bge L(250)
+ fitod %f10,%f4
+ faddd %f4,%f8,%f4
+L(250):
+ fdivd %f2,%f4,%f2
+
+ifdef(`PIC',
+` ldd [%o7+L(C1)-L(pc)],%f4',
+` sethi %hi(L(C1)),%o7
+ ldd [%o7+%lo(L(C1))],%f4')
+
+ fcmped %f2,%f4
+ nop
+ fbge,a L(251)
+ fsubd %f2,%f4,%f2
+ fdtoi %f2,%f2
+ st %f2,[%fp-8]
+ b L(252)
+ ld [%fp-8],%i4
+L(251):
+ fdtoi %f2,%f2
+ st %f2,[%fp-8]
+ ld [%fp-8],%i4
+ sethi %hi(-2147483648),%g2
+ xor %i4,%g2,%i4
+L(252):
+ wr %g0,%i4,%y
+ sra %i3,31,%g2
+ and %i4,%g2,%g2
+ andcc %g0,0,%g1
+ mulscc %g1,%i3,%g1
+ mulscc %g1,%i3,%g1
+ mulscc %g1,%i3,%g1
+ mulscc %g1,%i3,%g1
+ mulscc %g1,%i3,%g1
+ mulscc %g1,%i3,%g1
+ mulscc %g1,%i3,%g1
+ mulscc %g1,%i3,%g1
+ mulscc %g1,%i3,%g1
+ mulscc %g1,%i3,%g1
+ mulscc %g1,%i3,%g1
+ mulscc %g1,%i3,%g1
+ mulscc %g1,%i3,%g1
+ mulscc %g1,%i3,%g1
+ mulscc %g1,%i3,%g1
+ mulscc %g1,%i3,%g1
+ mulscc %g1,%i3,%g1
+ mulscc %g1,%i3,%g1
+ mulscc %g1,%i3,%g1
+ mulscc %g1,%i3,%g1
+ mulscc %g1,%i3,%g1
+ mulscc %g1,%i3,%g1
+ mulscc %g1,%i3,%g1
+ mulscc %g1,%i3,%g1
+ mulscc %g1,%i3,%g1
+ mulscc %g1,%i3,%g1
+ mulscc %g1,%i3,%g1
+ mulscc %g1,%i3,%g1
+ mulscc %g1,%i3,%g1
+ mulscc %g1,%i3,%g1
+ mulscc %g1,%i3,%g1
+ mulscc %g1,%i3,%g1
+ mulscc %g1,0,%g1
+ add %g1,%g2,%i0
+ rd %y,%g3
+ subcc %i2,%g3,%o7
+ subxcc %i1,%i0,%g0
+ be L(253)
+ cmp %o7,%i3
+
+ add %i4,-1,%i0
+ add %o7,%i3,%o7
+ st %o7,[%i5]
+ ret
+ restore
+L(253):
+ blu L(246)
+ mov %i4,%i0
+ add %i4,1,%i0
+ sub %o7,%i3,%o7
+L(246):
+ st %o7,[%i5]
+ ret
+ restore
+EPILOGUE(mpn_udiv_qrnnd)
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc32/udiv_nfp.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc32/udiv_nfp.asm
new file mode 100644
index 00000000000..ebbb820639e
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc32/udiv_nfp.asm
@@ -0,0 +1,202 @@
+dnl SPARC v7 __udiv_qrnnd division support, used from longlong.h.
+dnl This is for v7 CPUs without a floating-point unit.
+
+dnl Copyright 1993, 1994, 1996, 2000 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 rem_ptr o0
+C n1 o1
+C n0 o2
+C d o3
+
+ASM_START()
+PROLOGUE(mpn_udiv_qrnnd)
+ tst %o3
+ bneg L(largedivisor)
+ mov 8,%g1
+
+ b L(p1)
+ addxcc %o2,%o2,%o2
+
+L(plop):
+ bcc L(n1)
+ addxcc %o2,%o2,%o2
+L(p1): addx %o1,%o1,%o1
+ subcc %o1,%o3,%o4
+ bcc L(n2)
+ addxcc %o2,%o2,%o2
+L(p2): addx %o1,%o1,%o1
+ subcc %o1,%o3,%o4
+ bcc L(n3)
+ addxcc %o2,%o2,%o2
+L(p3): addx %o1,%o1,%o1
+ subcc %o1,%o3,%o4
+ bcc L(n4)
+ addxcc %o2,%o2,%o2
+L(p4): addx %o1,%o1,%o1
+ addcc %g1,-1,%g1
+ bne L(plop)
+ subcc %o1,%o3,%o4
+ bcc L(n5)
+ addxcc %o2,%o2,%o2
+L(p5): st %o1,[%o0]
+ retl
+ xnor %g0,%o2,%o0
+
+L(nlop):
+ bcc L(p1)
+ addxcc %o2,%o2,%o2
+L(n1): addx %o4,%o4,%o4
+ subcc %o4,%o3,%o1
+ bcc L(p2)
+ addxcc %o2,%o2,%o2
+L(n2): addx %o4,%o4,%o4
+ subcc %o4,%o3,%o1
+ bcc L(p3)
+ addxcc %o2,%o2,%o2
+L(n3): addx %o4,%o4,%o4
+ subcc %o4,%o3,%o1
+ bcc L(p4)
+ addxcc %o2,%o2,%o2
+L(n4): addx %o4,%o4,%o4
+ addcc %g1,-1,%g1
+ bne L(nlop)
+ subcc %o4,%o3,%o1
+ bcc L(p5)
+ addxcc %o2,%o2,%o2
+L(n5): st %o4,[%o0]
+ retl
+ xnor %g0,%o2,%o0
+
+L(largedivisor):
+ and %o2,1,%o5 C %o5 = n0 & 1
+
+ srl %o2,1,%o2
+ sll %o1,31,%g2
+ or %g2,%o2,%o2 C %o2 = lo(n1n0 >> 1)
+ srl %o1,1,%o1 C %o1 = hi(n1n0 >> 1)
+
+ and %o3,1,%g2
+ srl %o3,1,%g3 C %g3 = floor(d / 2)
+ add %g3,%g2,%g3 C %g3 = ceil(d / 2)
+
+ b L(Lp1)
+ addxcc %o2,%o2,%o2
+
+L(Lplop):
+ bcc L(Ln1)
+ addxcc %o2,%o2,%o2
+L(Lp1): addx %o1,%o1,%o1
+ subcc %o1,%g3,%o4
+ bcc L(Ln2)
+ addxcc %o2,%o2,%o2
+L(Lp2): addx %o1,%o1,%o1
+ subcc %o1,%g3,%o4
+ bcc L(Ln3)
+ addxcc %o2,%o2,%o2
+L(Lp3): addx %o1,%o1,%o1
+ subcc %o1,%g3,%o4
+ bcc L(Ln4)
+ addxcc %o2,%o2,%o2
+L(Lp4): addx %o1,%o1,%o1
+ addcc %g1,-1,%g1
+ bne L(Lplop)
+ subcc %o1,%g3,%o4
+ bcc L(Ln5)
+ addxcc %o2,%o2,%o2
+L(Lp5): add %o1,%o1,%o1 C << 1
+ tst %g2
+ bne L(oddp)
+ add %o5,%o1,%o1
+ st %o1,[%o0]
+ retl
+ xnor %g0,%o2,%o0
+
+L(Lnlop):
+ bcc L(Lp1)
+ addxcc %o2,%o2,%o2
+L(Ln1): addx %o4,%o4,%o4
+ subcc %o4,%g3,%o1
+ bcc L(Lp2)
+ addxcc %o2,%o2,%o2
+L(Ln2): addx %o4,%o4,%o4
+ subcc %o4,%g3,%o1
+ bcc L(Lp3)
+ addxcc %o2,%o2,%o2
+L(Ln3): addx %o4,%o4,%o4
+ subcc %o4,%g3,%o1
+ bcc L(Lp4)
+ addxcc %o2,%o2,%o2
+L(Ln4): addx %o4,%o4,%o4
+ addcc %g1,-1,%g1
+ bne L(Lnlop)
+ subcc %o4,%g3,%o1
+ bcc L(Lp5)
+ addxcc %o2,%o2,%o2
+L(Ln5): add %o4,%o4,%o4 C << 1
+ tst %g2
+ bne L(oddn)
+ add %o5,%o4,%o4
+ st %o4,[%o0]
+ retl
+ xnor %g0,%o2,%o0
+
+L(oddp):
+ xnor %g0,%o2,%o2
+ C q' in %o2. r' in %o1
+ addcc %o1,%o2,%o1
+ bcc L(Lp6)
+ addx %o2,0,%o2
+ sub %o1,%o3,%o1
+L(Lp6): subcc %o1,%o3,%g0
+ bcs L(Lp7)
+ subx %o2,-1,%o2
+ sub %o1,%o3,%o1
+L(Lp7): st %o1,[%o0]
+ retl
+ mov %o2,%o0
+
+L(oddn):
+ xnor %g0,%o2,%o2
+ C q' in %o2. r' in %o4
+ addcc %o4,%o2,%o4
+ bcc L(Ln6)
+ addx %o2,0,%o2
+ sub %o4,%o3,%o4
+L(Ln6): subcc %o4,%o3,%g0
+ bcs L(Ln7)
+ subx %o2,-1,%o2
+ sub %o4,%o3,%o4
+L(Ln7): st %o4,[%o0]
+ retl
+ mov %o2,%o0
+EPILOGUE(mpn_udiv_qrnnd)
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc32/ultrasparct1/add_n.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc32/ultrasparct1/add_n.asm
new file mode 100644
index 00000000000..c781596dadc
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc32/ultrasparct1/add_n.asm
@@ -0,0 +1,70 @@
+dnl SPARC T1 32-bit mpn_add_n.
+
+dnl Copyright 2010 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', %o0)
+define(`ap', %o1)
+define(`bp', %o2)
+define(`n', %o3)
+define(`cy', %o4)
+
+define(`i', %o3)
+
+MULFUNC_PROLOGUE(mpn_add_n mpn_add_nc)
+
+ASM_START()
+PROLOGUE(mpn_add_nc)
+ b L(ent)
+ srl cy, 0, cy C strip any bogus high bits
+EPILOGUE()
+
+PROLOGUE(mpn_add_n)
+ mov 0, cy
+L(ent): srl n, 0, n C strip any bogus high bits
+ sll n, 2, n
+ add ap, n, ap
+ add bp, n, bp
+ add rp, n, rp
+ neg n, i
+
+L(top): lduw [ap+i], %g1
+ lduw [bp+i], %g2
+ add %g1, %g2, %g3
+ add %g3, cy, %g3
+ stw %g3, [rp+i]
+ add i, 4, i
+ brnz i, L(top)
+ srlx %g3, 32, cy
+
+ retl
+ mov cy, %o0 C return value
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc32/ultrasparct1/addmul_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc32/ultrasparct1/addmul_1.asm
new file mode 100644
index 00000000000..89da1864577
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc32/ultrasparct1/addmul_1.asm
@@ -0,0 +1,90 @@
+dnl SPARC T1 32-bit mpn_addmul_1.
+
+dnl Contributed to the GNU project by David Miller.
+
+dnl Copyright 2010, 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/limb
+C UltraSPARC T1: 24
+C UltraSPARC T2: 19
+C UltraSPARC T3: 19
+C UltraSPARC T4: 5
+
+C INPUT PARAMETERS
+define(`rp', `%i0')
+define(`up', `%i1')
+define(`n', `%i2')
+define(`v0', `%i3')
+
+ASM_START()
+PROLOGUE(mpn_addmul_1)
+ save %sp, -96, %sp
+ srl n, 0, %o4
+ srl v0, 0, %g1
+ subcc %o4, 1, %o4
+ be L(final_one)
+ clr %o5
+
+L(top): lduw [up+0], %l0
+ lduw [rp+0], %l2
+ lduw [up+4], %l1
+ lduw [rp+4], %l3
+ mulx %l0, %g1, %g3
+ add up, 8, up
+ mulx %l1, %g1, %o3
+ sub %o4, 2, %o4
+ add rp, 8, rp
+ add %l2, %g3, %g3
+ add %o5, %g3, %g3
+ stw %g3, [rp-8]
+ srlx %g3, 32, %o5
+ add %l3, %o3, %o3
+ add %o5, %o3, %o3
+ stw %o3, [rp-4]
+ brgz %o4, L(top)
+ srlx %o3, 32, %o5
+
+ brlz,pt %o4, L(done)
+ nop
+
+L(final_one):
+ lduw [up+0], %l0
+ lduw [rp+0], %l2
+ mulx %l0, %g1, %g3
+ add %l2, %g3, %g3
+ add %o5, %g3, %g3
+ stw %g3, [rp+0]
+ srlx %g3, 32, %o5
+
+L(done):
+ ret
+ restore %o5, 0, %o0
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc32/ultrasparct1/gmp-mparam.h b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc32/ultrasparct1/gmp-mparam.h
new file mode 100644
index 00000000000..6f9d5a44ca6
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc32/ultrasparct1/gmp-mparam.h
@@ -0,0 +1,153 @@
+/* UltraSPARC T 32-bit gmp-mparam.h -- Compiler/machine parameter header file.
+
+Copyright 1991, 1993, 1994, 2000-2011 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 DIVREM_1_NORM_THRESHOLD 0 /* always */
+#define DIVREM_1_UNNORM_THRESHOLD 3
+#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 10
+#define MOD_1_1_TO_MOD_1_2_THRESHOLD 0 /* never mpn_mod_1_1p */
+#define MOD_1_2_TO_MOD_1_4_THRESHOLD 21
+#define PREINV_MOD_1_TO_MOD_1_THRESHOLD 22
+#define USE_PREINV_DIVREM_1 1
+#define DIV_QR_2_PI2_THRESHOLD MP_SIZE_T_MAX /* never */
+#define DIVEXACT_1_THRESHOLD 0 /* always */
+#define BMOD_1_TO_MOD_1_THRESHOLD 35
+
+#define MUL_TOOM22_THRESHOLD 14
+#define MUL_TOOM33_THRESHOLD 98
+#define MUL_TOOM44_THRESHOLD 166
+#define MUL_TOOM6H_THRESHOLD 226
+#define MUL_TOOM8H_THRESHOLD 333
+
+#define MUL_TOOM32_TO_TOOM43_THRESHOLD 97
+#define MUL_TOOM32_TO_TOOM53_THRESHOLD 139
+#define MUL_TOOM42_TO_TOOM53_THRESHOLD 97
+#define MUL_TOOM42_TO_TOOM63_THRESHOLD 98
+#define MUL_TOOM43_TO_TOOM54_THRESHOLD 120
+
+#define SQR_BASECASE_THRESHOLD 6
+#define SQR_TOOM2_THRESHOLD 34
+#define SQR_TOOM3_THRESHOLD 110
+#define SQR_TOOM4_THRESHOLD 178
+#define SQR_TOOM6_THRESHOLD 240
+#define SQR_TOOM8_THRESHOLD 333
+
+#define MULMID_TOOM42_THRESHOLD 22
+
+#define MULMOD_BNM1_THRESHOLD 9
+#define SQRMOD_BNM1_THRESHOLD 13
+
+#define MUL_FFT_MODF_THRESHOLD 280 /* k = 5 */
+#define MUL_FFT_TABLE3 \
+ { { 280, 5}, { 15, 6}, { 8, 5}, { 17, 6}, \
+ { 9, 5}, { 19, 6}, { 13, 7}, { 7, 6}, \
+ { 17, 7}, { 9, 6}, { 20, 7}, { 11, 6}, \
+ { 23, 7}, { 13, 8}, { 7, 7}, { 21, 8}, \
+ { 11, 7}, { 25, 9}, { 7, 8}, { 15, 7}, \
+ { 33, 8}, { 19, 7}, { 41, 8}, { 23, 7}, \
+ { 49, 8}, { 27, 9}, { 15, 8}, { 31, 7}, \
+ { 63, 8}, { 39, 9}, { 23, 8}, { 47,10}, \
+ { 15, 9}, { 31, 8}, { 67, 9}, { 39, 8}, \
+ { 79, 9}, { 47,10}, { 31, 9}, { 79,10}, \
+ { 47,11}, { 31,10}, { 63, 9}, { 127, 8}, \
+ { 255,10}, { 79, 9}, { 159, 8}, { 319,10}, \
+ { 95, 9}, { 191, 8}, { 383,11}, { 63,10}, \
+ { 127, 9}, { 255,10}, { 143, 9}, { 287,10}, \
+ { 159, 9}, { 319,10}, { 175,11}, { 95,10}, \
+ { 191, 9}, { 383,12}, { 4096,13}, { 8192,14}, \
+ { 16384,15}, { 32768,16} }
+#define MUL_FFT_TABLE3_SIZE 66
+#define MUL_FFT_THRESHOLD 3712
+
+#define SQR_FFT_MODF_THRESHOLD 240 /* k = 5 */
+#define SQR_FFT_TABLE3 \
+ { { 240, 5}, { 15, 6}, { 8, 5}, { 17, 6}, \
+ { 13, 7}, { 7, 6}, { 17, 7}, { 9, 6}, \
+ { 20, 7}, { 11, 6}, { 23, 7}, { 13, 8}, \
+ { 7, 7}, { 19, 8}, { 11, 7}, { 25, 9}, \
+ { 7, 8}, { 15, 7}, { 33, 8}, { 19, 7}, \
+ { 39, 8}, { 23, 7}, { 47, 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}, { 63, 8}, \
+ { 127, 9}, { 71, 8}, { 143, 9}, { 79,10}, \
+ { 47,11}, { 31,10}, { 63, 9}, { 127, 8}, \
+ { 255, 9}, { 143,10}, { 79, 9}, { 159, 8}, \
+ { 319, 9}, { 175,10}, { 95, 9}, { 191, 8}, \
+ { 383, 9}, { 207,11}, { 63,10}, { 127, 9}, \
+ { 255,10}, { 143, 9}, { 287,10}, { 159, 9}, \
+ { 319,10}, { 175,11}, { 95,10}, { 191, 9}, \
+ { 383,10}, { 207,12}, { 4096,13}, { 8192,14}, \
+ { 16384,15}, { 32768,16} }
+#define SQR_FFT_TABLE3_SIZE 70
+#define SQR_FFT_THRESHOLD 2624
+
+#define MULLO_BASECASE_THRESHOLD 0 /* always */
+#define MULLO_DC_THRESHOLD 51
+#define MULLO_MUL_N_THRESHOLD 6633
+
+#define DC_DIV_QR_THRESHOLD 51
+#define DC_DIVAPPR_Q_THRESHOLD 202
+#define DC_BDIV_QR_THRESHOLD 47
+#define DC_BDIV_Q_THRESHOLD 124
+
+#define INV_MULMOD_BNM1_THRESHOLD 26
+#define INV_NEWTON_THRESHOLD 266
+#define INV_APPR_THRESHOLD 222
+
+#define BINV_NEWTON_THRESHOLD 296
+#define REDC_1_TO_REDC_N_THRESHOLD 59
+
+#define MU_DIV_QR_THRESHOLD 1334
+#define MU_DIVAPPR_Q_THRESHOLD 1499
+#define MUPI_DIV_QR_THRESHOLD 116
+#define MU_BDIV_QR_THRESHOLD 1057
+#define MU_BDIV_Q_THRESHOLD 1334
+
+#define POWM_SEC_TABLE 6,35,213,724,2618
+
+#define MATRIX22_STRASSEN_THRESHOLD 15
+#define HGCD_THRESHOLD 84
+#define HGCD_APPR_THRESHOLD 101
+#define HGCD_REDUCE_THRESHOLD 1437
+#define GCD_DC_THRESHOLD 372
+#define GCDEXT_DC_THRESHOLD 253
+#define JACOBI_BASE_METHOD 2
+
+#define GET_STR_DC_THRESHOLD 12
+#define GET_STR_PRECOMPUTE_THRESHOLD 27
+#define SET_STR_DC_THRESHOLD 399
+#define SET_STR_PRECOMPUTE_THRESHOLD 885
+
+#define FAC_DSC_THRESHOLD 179
+#define FAC_ODD_THRESHOLD 29
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc32/ultrasparct1/mul_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc32/ultrasparct1/mul_1.asm
new file mode 100644
index 00000000000..0239cd28cd3
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc32/ultrasparct1/mul_1.asm
@@ -0,0 +1,83 @@
+dnl SPARC T1 32-bit mpn_mul_1.
+
+dnl Contributed to the GNU project by David Miller.
+
+dnl Copyright 2010, 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/limb
+C UltraSPARC T1: 20
+C UltraSPARC T2: 18
+C UltraSPARC T3: 18
+C UltraSPARC T4: 4
+
+C INPUT PARAMETERS
+define(`rp', `%o0')
+define(`up', `%o1')
+define(`n', `%o2')
+define(`v0', `%o3')
+
+ASM_START()
+PROLOGUE(mpn_mul_1)
+ srl n, 0, n
+ srl v0, 0, v0
+ subcc n, 1, n
+ be L(final_one)
+ clr %o5
+
+L(top): lduw [up+0], %g1
+ lduw [up+4], %g2
+ mulx %g1, v0, %g3
+ add up, 8, up
+ mulx %g2, v0, %o4
+ sub n, 2, n
+ add rp, 8, rp
+ add %o5, %g3, %g3
+ stw %g3, [rp-8]
+ srlx %g3, 32, %o5
+ add %o5, %o4, %o4
+ stw %o4, [rp-4]
+ brgz n, L(top)
+ srlx %o4, 32, %o5
+
+ brlz,pt n, L(done)
+ nop
+
+L(final_one):
+ lduw [up+0], %g1
+ mulx %g1, v0, %g3
+ add %o5, %g3, %g3
+ stw %g3, [rp+0]
+ srlx %g3, 32, %o5
+
+L(done):
+ retl
+ mov %o5, %o0
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc32/ultrasparct1/sqr_diagonal.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc32/ultrasparct1/sqr_diagonal.asm
new file mode 100644
index 00000000000..3b906ef202e
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc32/ultrasparct1/sqr_diagonal.asm
@@ -0,0 +1,55 @@
+dnl SPARC T1 32-bit mpn_sqr_diagonal.
+
+dnl Copyright 2010 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', `%o0')
+define(`up', `%o1')
+define(`n', `%o2')
+
+ASM_START()
+PROLOGUE(mpn_sqr_diagonal)
+ deccc n C n--
+ nop
+
+L(top): lduw [up+0], %g1
+ add up, 4, up C up++
+ mulx %g1, %g1, %g3
+ stw %g3, [rp+0]
+ srlx %g3, 32, %g4
+ stw %g4, [rp+4]
+ add rp, 8, rp C rp += 2
+ bnz %icc, L(top)
+ deccc n C n--
+
+ retl
+ nop
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc32/ultrasparct1/sub_n.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc32/ultrasparct1/sub_n.asm
new file mode 100644
index 00000000000..946bc3ff8e2
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc32/ultrasparct1/sub_n.asm
@@ -0,0 +1,70 @@
+dnl SPARC T1 32-bit mpn_sub_n.
+
+dnl Copyright 2010 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', %o0)
+define(`ap', %o1)
+define(`bp', %o2)
+define(`n', %o3)
+define(`cy', %o4)
+
+define(`i', %o3)
+
+MULFUNC_PROLOGUE(mpn_sub_n mpn_sub_nc)
+
+ASM_START()
+PROLOGUE(mpn_sub_nc)
+ b L(ent)
+ srl cy, 0, cy C strip any bogus high bits
+EPILOGUE()
+
+PROLOGUE(mpn_sub_n)
+ mov 0, cy
+L(ent): srl n, 0, n C strip any bogus high bits
+ sll n, 2, n
+ add ap, n, ap
+ add bp, n, bp
+ add rp, n, rp
+ neg n, i
+
+L(top): lduw [ap+i], %g1
+ lduw [bp+i], %g2
+ sub %g1, %g2, %g3
+ sub %g3, cy, %g3
+ stw %g3, [rp+i]
+ add i, 4, i
+ brnz i, L(top)
+ srlx %g3, 63, cy
+
+ retl
+ mov cy, %o0 C return value
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc32/ultrasparct1/submul_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc32/ultrasparct1/submul_1.asm
new file mode 100644
index 00000000000..89200709c4c
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc32/ultrasparct1/submul_1.asm
@@ -0,0 +1,91 @@
+dnl SPARC T1 32-bit mpn_submul_1.
+
+dnl Contributed to the GNU project by David Miller.
+
+dnl Copyright 2010, 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/limb
+C UltraSPARC T1: 24
+C UltraSPARC T2: 19
+C UltraSPARC T3: 19
+C UltraSPARC T4: 5
+
+C INPUT PARAMETERS
+define(`rp', `%i0')
+define(`up', `%i1')
+define(`n', `%i2')
+define(`v0', `%i3')
+
+ASM_START()
+PROLOGUE(mpn_submul_1)
+ save %sp, -96, %sp
+ srl n, 0, %o4
+ srl v0, 0, %g1
+ subcc %o4, 1, %o4
+ be L(final_one)
+ subcc %g0, 0, %o5
+
+L(top): lduw [up+0], %l0
+ lduw [rp+0], %l2
+ lduw [up+4], %l1
+ lduw [rp+4], %l3
+ mulx %l0, %g1, %g3
+ add up, 8, up
+ mulx %l1, %g1, %o3
+ sub %o4, 2, %o4
+ add rp, 8, rp
+ addx %o5, %g3, %g3
+ srlx %g3, 32, %o5
+ subcc %l2, %g3, %g3
+ stw %g3, [rp-8]
+ addx %o5, %o3, %o3
+ srlx %o3, 32, %o5
+ subcc %l3, %o3, %o3
+ brgz %o4, L(top)
+ stw %o3, [rp-4]
+
+ brlz,pt %o4, L(done)
+ nop
+
+L(final_one):
+ lduw [up+0], %l0
+ lduw [rp+0], %l2
+ mulx %l0, %g1, %g3
+ addx %o5, %g3, %g3
+ srlx %g3, 32, %o5
+ subcc %l2, %g3, %g3
+ stw %g3, [rp+0]
+
+L(done):
+ addx %o5, 0, %o5
+ ret
+ restore %o5, 0, %o0
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc32/umul.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc32/umul.asm
new file mode 100644
index 00000000000..3a20b95cb50
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc32/umul.asm
@@ -0,0 +1,77 @@
+dnl SPARC mpn_umul_ppmm -- support for longlong.h for non-gcc.
+
+dnl Copyright 1995, 1996, 2000 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')
+
+ASM_START()
+PROLOGUE(mpn_umul_ppmm)
+ wr %g0,%o1,%y
+ sra %o2,31,%g2 C Don't move this insn
+ and %o1,%g2,%g2 C Don't move this insn
+ andcc %g0,0,%g1 C Don't move this insn
+ mulscc %g1,%o2,%g1
+ mulscc %g1,%o2,%g1
+ mulscc %g1,%o2,%g1
+ mulscc %g1,%o2,%g1
+ mulscc %g1,%o2,%g1
+ mulscc %g1,%o2,%g1
+ mulscc %g1,%o2,%g1
+ mulscc %g1,%o2,%g1
+ mulscc %g1,%o2,%g1
+ mulscc %g1,%o2,%g1
+ mulscc %g1,%o2,%g1
+ mulscc %g1,%o2,%g1
+ mulscc %g1,%o2,%g1
+ mulscc %g1,%o2,%g1
+ mulscc %g1,%o2,%g1
+ mulscc %g1,%o2,%g1
+ mulscc %g1,%o2,%g1
+ mulscc %g1,%o2,%g1
+ mulscc %g1,%o2,%g1
+ mulscc %g1,%o2,%g1
+ mulscc %g1,%o2,%g1
+ mulscc %g1,%o2,%g1
+ mulscc %g1,%o2,%g1
+ mulscc %g1,%o2,%g1
+ mulscc %g1,%o2,%g1
+ mulscc %g1,%o2,%g1
+ mulscc %g1,%o2,%g1
+ mulscc %g1,%o2,%g1
+ mulscc %g1,%o2,%g1
+ mulscc %g1,%o2,%g1
+ mulscc %g1,%o2,%g1
+ mulscc %g1,%o2,%g1
+ mulscc %g1,0,%g1
+ rd %y,%g3
+ st %g3,[%o0]
+ retl
+ add %g1,%g2,%o0
+EPILOGUE(mpn_umul_ppmm)
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc32/v8/addmul_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc32/v8/addmul_1.asm
new file mode 100644
index 00000000000..00520927843
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc32/v8/addmul_1.asm
@@ -0,0 +1,131 @@
+dnl SPARC v8 mpn_addmul_1 -- Multiply a limb vector with a limb and
+dnl add the result to a second limb vector.
+
+dnl Copyright 1992-1995, 2000 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 o0
+C s1_ptr o1
+C size o2
+C s2_limb o3
+
+ASM_START()
+PROLOGUE(mpn_addmul_1)
+ orcc %g0,%g0,%g2
+ ld [%o1+0],%o4 C 1
+
+ sll %o2,4,%g1
+ and %g1,(4-1)<<4,%g1
+ifdef(`PIC',
+` mov %o7,%g4 C Save return address register
+0: call 1f
+ add %o7,L(1)-0b,%g3
+1: mov %g4,%o7 C Restore return address register
+',
+` sethi %hi(L(1)),%g3
+ or %g3,%lo(L(1)),%g3
+')
+ jmp %g3+%g1
+ nop
+L(1):
+L(L00): add %o0,-4,%o0
+ b L(loop00) C 4, 8, 12, ...
+ add %o1,-4,%o1
+ nop
+L(L01): b L(loop01) C 1, 5, 9, ...
+ nop
+ nop
+ nop
+L(L10): add %o0,-12,%o0 C 2, 6, 10, ...
+ b L(loop10)
+ add %o1,4,%o1
+ nop
+L(L11): add %o0,-8,%o0 C 3, 7, 11, ...
+ b L(loop11)
+ add %o1,-8,%o1
+ nop
+
+L(loop):
+ addcc %g3,%g2,%g3 C 1
+ ld [%o1+4],%o4 C 2
+ rd %y,%g2 C 1
+ addx %g0,%g2,%g2
+ ld [%o0+0],%g1 C 2
+ addcc %g1,%g3,%g3
+ st %g3,[%o0+0] C 1
+L(loop00):
+ umul %o4,%o3,%g3 C 2
+ ld [%o0+4],%g1 C 2
+ addxcc %g3,%g2,%g3 C 2
+ ld [%o1+8],%o4 C 3
+ rd %y,%g2 C 2
+ addx %g0,%g2,%g2
+ nop
+ addcc %g1,%g3,%g3
+ st %g3,[%o0+4] C 2
+L(loop11):
+ umul %o4,%o3,%g3 C 3
+ addxcc %g3,%g2,%g3 C 3
+ ld [%o1+12],%o4 C 4
+ rd %y,%g2 C 3
+ add %o1,16,%o1
+ addx %g0,%g2,%g2
+ ld [%o0+8],%g1 C 2
+ addcc %g1,%g3,%g3
+ st %g3,[%o0+8] C 3
+L(loop10):
+ umul %o4,%o3,%g3 C 4
+ addxcc %g3,%g2,%g3 C 4
+ ld [%o1+0],%o4 C 1
+ rd %y,%g2 C 4
+ addx %g0,%g2,%g2
+ ld [%o0+12],%g1 C 2
+ addcc %g1,%g3,%g3
+ st %g3,[%o0+12] C 4
+ add %o0,16,%o0
+ addx %g0,%g2,%g2
+L(loop01):
+ addcc %o2,-4,%o2
+ bg L(loop)
+ umul %o4,%o3,%g3 C 1
+
+ addcc %g3,%g2,%g3 C 4
+ rd %y,%g2 C 4
+ addx %g0,%g2,%g2
+ ld [%o0+0],%g1 C 2
+ addcc %g1,%g3,%g3
+ st %g3,[%o0+0] C 4
+ addx %g0,%g2,%o0
+
+ retl
+ nop
+EPILOGUE(mpn_addmul_1)
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc32/v8/gmp-mparam.h b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc32/v8/gmp-mparam.h
new file mode 100644
index 00000000000..e57897b439d
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc32/v8/gmp-mparam.h
@@ -0,0 +1,73 @@
+/* SPARC v8 gmp-mparam.h -- Compiler/machine parameter header file.
+
+Copyright 1991, 1993, 1994, 1999-2004 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
+
+/* Generated by tuneup.c, 2004-02-07, gcc 2.95 */
+
+#define MUL_TOOM22_THRESHOLD 10
+#define MUL_TOOM33_THRESHOLD 65
+
+#define SQR_BASECASE_THRESHOLD 4
+#define SQR_TOOM2_THRESHOLD 18
+#define SQR_TOOM3_THRESHOLD 65
+
+#define DIV_SB_PREINV_THRESHOLD 5
+#define DIV_DC_THRESHOLD 24
+#define POWM_THRESHOLD 38
+
+#define HGCD_THRESHOLD 69
+#define GCD_ACCEL_THRESHOLD 3
+#define GCD_DC_THRESHOLD 498
+#define JACOBI_BASE_METHOD 2
+
+#define DIVREM_1_NORM_THRESHOLD 6
+#define DIVREM_1_UNNORM_THRESHOLD 11
+#define MOD_1_NORM_THRESHOLD 5
+#define MOD_1_UNNORM_THRESHOLD 9
+#define USE_PREINV_DIVREM_1 1
+#define USE_PREINV_MOD_1 1
+#define DIVREM_2_THRESHOLD 0 /* always */
+#define DIVEXACT_1_THRESHOLD 0 /* always */
+#define MODEXACT_1_ODD_THRESHOLD 4
+
+#define GET_STR_DC_THRESHOLD 14
+#define GET_STR_PRECOMPUTE_THRESHOLD 23
+#define SET_STR_THRESHOLD 1679
+
+#define MUL_FFT_TABLE { 272, 672, 1152, 2560, 10240, 24576, 0 }
+#define MUL_FFT_MODF_THRESHOLD 264
+#define MUL_FFT_THRESHOLD 1792
+
+#define SQR_FFT_TABLE { 304, 672, 1152, 3584, 10240, 24576, 0 }
+#define SQR_FFT_MODF_THRESHOLD 264
+#define SQR_FFT_THRESHOLD 1728
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc32/v8/mul_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc32/v8/mul_1.asm
new file mode 100644
index 00000000000..e26c853aed8
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc32/v8/mul_1.asm
@@ -0,0 +1,112 @@
+dnl SPARC v8 mpn_mul_1 -- Multiply a limb vector with a single limb and
+dnl store the product in a second limb vector.
+
+dnl Copyright 1992, 1994, 1995, 2000 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 o0
+C s1_ptr o1
+C size o2
+C s2_limb o3
+
+ASM_START()
+PROLOGUE(mpn_mul_1)
+ sll %o2,4,%g1
+ and %g1,(4-1)<<4,%g1
+ifdef(`PIC',
+` mov %o7,%g4 C Save return address register
+0: call 1f
+ add %o7,L(1)-0b,%g3
+1: mov %g4,%o7 C Restore return address register
+',
+` sethi %hi(L(1)),%g3
+ or %g3,%lo(L(1)),%g3
+')
+ jmp %g3+%g1
+ ld [%o1+0],%o4 C 1
+L(1):
+L(L00): add %o0,-4,%o0
+ add %o1,-4,%o1
+ b L(loop00) C 4, 8, 12, ...
+ orcc %g0,%g0,%g2
+L(L01): b L(loop01) C 1, 5, 9, ...
+ orcc %g0,%g0,%g2
+ nop
+ nop
+L(L10): add %o0,-12,%o0 C 2, 6, 10, ...
+ add %o1,4,%o1
+ b L(loop10)
+ orcc %g0,%g0,%g2
+ nop
+L(L11): add %o0,-8,%o0 C 3, 7, 11, ...
+ add %o1,-8,%o1
+ b L(loop11)
+ orcc %g0,%g0,%g2
+
+L(loop):
+ addcc %g3,%g2,%g3 C 1
+ ld [%o1+4],%o4 C 2
+ st %g3,[%o0+0] C 1
+ rd %y,%g2 C 1
+L(loop00):
+ umul %o4,%o3,%g3 C 2
+ addxcc %g3,%g2,%g3 C 2
+ ld [%o1+8],%o4 C 3
+ st %g3,[%o0+4] C 2
+ rd %y,%g2 C 2
+L(loop11):
+ umul %o4,%o3,%g3 C 3
+ addxcc %g3,%g2,%g3 C 3
+ ld [%o1+12],%o4 C 4
+ add %o1,16,%o1
+ st %g3,[%o0+8] C 3
+ rd %y,%g2 C 3
+L(loop10):
+ umul %o4,%o3,%g3 C 4
+ addxcc %g3,%g2,%g3 C 4
+ ld [%o1+0],%o4 C 1
+ st %g3,[%o0+12] C 4
+ add %o0,16,%o0
+ rd %y,%g2 C 4
+ addx %g0,%g2,%g2
+L(loop01):
+ addcc %o2,-4,%o2
+ bg L(loop)
+ umul %o4,%o3,%g3 C 1
+
+ addcc %g3,%g2,%g3 C 4
+ st %g3,[%o0+0] C 4
+ rd %y,%g2 C 4
+
+ retl
+ addx %g0,%g2,%o0
+EPILOGUE(mpn_mul_1)
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc32/v8/submul_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc32/v8/submul_1.asm
new file mode 100644
index 00000000000..187314eceff
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc32/v8/submul_1.asm
@@ -0,0 +1,67 @@
+dnl SPARC v8 mpn_submul_1 -- Multiply a limb vector with a limb and
+dnl subtract the result from a second limb vector.
+
+dnl Copyright 1992-1994, 2000 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 o0
+C s1_ptr o1
+C size o2
+C s2_limb o3
+
+ASM_START()
+PROLOGUE(mpn_submul_1)
+ sub %g0,%o2,%o2 C negate ...
+ sll %o2,2,%o2 C ... and scale size
+ sub %o1,%o2,%o1 C o1 is offset s1_ptr
+ sub %o0,%o2,%g1 C g1 is offset res_ptr
+
+ mov 0,%o0 C clear cy_limb
+
+L(loop):
+ ld [%o1+%o2],%o4
+ ld [%g1+%o2],%g2
+ umul %o4,%o3,%o5
+ rd %y,%g3
+ addcc %o5,%o0,%o5
+ addx %g3,0,%o0
+ subcc %g2,%o5,%g2
+ addx %o0,0,%o0
+ st %g2,[%g1+%o2]
+
+ addcc %o2,4,%o2
+ bne L(loop)
+ nop
+
+ retl
+ nop
+EPILOGUE(mpn_submul_1)
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc32/v8/supersparc/gmp-mparam.h b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc32/v8/supersparc/gmp-mparam.h
new file mode 100644
index 00000000000..1ac9239e3c5
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc32/v8/supersparc/gmp-mparam.h
@@ -0,0 +1,73 @@
+/* SuperSPARC gmp-mparam.h -- Compiler/machine parameter header file.
+
+Copyright 1991, 1993, 1994, 1999-2004 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
+
+/* Generated by tuneup.c, 2004-02-10, gcc 3.3 */
+
+#define MUL_TOOM22_THRESHOLD 14
+#define MUL_TOOM33_THRESHOLD 81
+
+#define SQR_BASECASE_THRESHOLD 5
+#define SQR_TOOM2_THRESHOLD 28
+#define SQR_TOOM3_THRESHOLD 86
+
+#define DIV_SB_PREINV_THRESHOLD 0 /* always */
+#define DIV_DC_THRESHOLD 26
+#define POWM_THRESHOLD 79
+
+#define HGCD_THRESHOLD 97
+#define GCD_ACCEL_THRESHOLD 3
+#define GCD_DC_THRESHOLD 470
+#define JACOBI_BASE_METHOD 2
+
+#define DIVREM_1_NORM_THRESHOLD 0 /* always */
+#define DIVREM_1_UNNORM_THRESHOLD 3
+#define MOD_1_NORM_THRESHOLD 0 /* always */
+#define MOD_1_UNNORM_THRESHOLD 3
+#define USE_PREINV_DIVREM_1 1
+#define USE_PREINV_MOD_1 1
+#define DIVREM_2_THRESHOLD 0 /* always */
+#define DIVEXACT_1_THRESHOLD 0 /* always */
+#define MODEXACT_1_ODD_THRESHOLD 0 /* always */
+
+#define GET_STR_DC_THRESHOLD 19
+#define GET_STR_PRECOMPUTE_THRESHOLD 34
+#define SET_STR_THRESHOLD 3524
+
+#define MUL_FFT_TABLE { 304, 800, 1408, 3584, 10240, 24576, 0 }
+#define MUL_FFT_MODF_THRESHOLD 264
+#define MUL_FFT_THRESHOLD 2304
+
+#define SQR_FFT_TABLE { 336, 800, 1408, 3584, 10240, 24576, 0 }
+#define SQR_FFT_MODF_THRESHOLD 280
+#define SQR_FFT_THRESHOLD 2304
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc32/v8/supersparc/udiv.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc32/v8/supersparc/udiv.asm
new file mode 100644
index 00000000000..12f66ce6a27
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc32/v8/supersparc/udiv.asm
@@ -0,0 +1,131 @@
+dnl SuperSPARC mpn_udiv_qrnnd division support, used from longlong.h.
+dnl This is for SuperSPARC only, to compensate for its semi-functional
+dnl udiv instruction.
+
+dnl Copyright 1993, 1994, 1996, 2000 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 rem_ptr i0
+C n1 i1
+C n0 i2
+C d i3
+
+ASM_START()
+
+ifdef(`PIC',
+` TEXT
+L(getpc):
+ retl
+ nop')
+
+ TEXT
+ ALIGN(8)
+L(C0): .double 0r4294967296
+L(C1): .double 0r2147483648
+
+PROLOGUE(mpn_udiv_qrnnd)
+ save %sp,-104,%sp
+ st %i1,[%fp-8]
+ ld [%fp-8],%f10
+
+ifdef(`PIC',
+`L(pc): call L(getpc) C put address of this insn in %o7
+ ldd [%o7+L(C0)-L(pc)],%f8',
+` sethi %hi(L(C0)),%o7
+ ldd [%o7+%lo(L(C0))],%f8')
+
+ fitod %f10,%f4
+ cmp %i1,0
+ bge L(248)
+ mov %i0,%i5
+ faddd %f4,%f8,%f4
+L(248):
+ st %i2,[%fp-8]
+ ld [%fp-8],%f10
+ fmuld %f4,%f8,%f6
+ cmp %i2,0
+ bge L(249)
+ fitod %f10,%f2
+ faddd %f2,%f8,%f2
+L(249):
+ st %i3,[%fp-8]
+ faddd %f6,%f2,%f2
+ ld [%fp-8],%f10
+ cmp %i3,0
+ bge L(250)
+ fitod %f10,%f4
+ faddd %f4,%f8,%f4
+L(250):
+ fdivd %f2,%f4,%f2
+
+ifdef(`PIC',
+` ldd [%o7+L(C1)-L(pc)],%f4',
+` sethi %hi(L(C1)),%o7
+ ldd [%o7+%lo(L(C1))],%f4')
+
+ fcmped %f2,%f4
+ nop
+ fbge,a L(251)
+ fsubd %f2,%f4,%f2
+ fdtoi %f2,%f2
+ st %f2,[%fp-8]
+ b L(252)
+ ld [%fp-8],%i4
+L(251):
+ fdtoi %f2,%f2
+ st %f2,[%fp-8]
+ ld [%fp-8],%i4
+ sethi %hi(-2147483648),%g2
+ xor %i4,%g2,%i4
+L(252):
+ umul %i3,%i4,%g3
+ rd %y,%i0
+ subcc %i2,%g3,%o7
+ subxcc %i1,%i0,%g0
+ be L(253)
+ cmp %o7,%i3
+
+ add %i4,-1,%i0
+ add %o7,%i3,%o7
+ st %o7,[%i5]
+ ret
+ restore
+L(253):
+ blu L(246)
+ mov %i4,%i0
+ add %i4,1,%i0
+ sub %o7,%i3,%o7
+L(246):
+ st %o7,[%i5]
+ ret
+ restore
+EPILOGUE(mpn_udiv_qrnnd)
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc32/v8/udiv.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc32/v8/udiv.asm
new file mode 100644
index 00000000000..12f66ce6a27
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc32/v8/udiv.asm
@@ -0,0 +1,131 @@
+dnl SuperSPARC mpn_udiv_qrnnd division support, used from longlong.h.
+dnl This is for SuperSPARC only, to compensate for its semi-functional
+dnl udiv instruction.
+
+dnl Copyright 1993, 1994, 1996, 2000 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 rem_ptr i0
+C n1 i1
+C n0 i2
+C d i3
+
+ASM_START()
+
+ifdef(`PIC',
+` TEXT
+L(getpc):
+ retl
+ nop')
+
+ TEXT
+ ALIGN(8)
+L(C0): .double 0r4294967296
+L(C1): .double 0r2147483648
+
+PROLOGUE(mpn_udiv_qrnnd)
+ save %sp,-104,%sp
+ st %i1,[%fp-8]
+ ld [%fp-8],%f10
+
+ifdef(`PIC',
+`L(pc): call L(getpc) C put address of this insn in %o7
+ ldd [%o7+L(C0)-L(pc)],%f8',
+` sethi %hi(L(C0)),%o7
+ ldd [%o7+%lo(L(C0))],%f8')
+
+ fitod %f10,%f4
+ cmp %i1,0
+ bge L(248)
+ mov %i0,%i5
+ faddd %f4,%f8,%f4
+L(248):
+ st %i2,[%fp-8]
+ ld [%fp-8],%f10
+ fmuld %f4,%f8,%f6
+ cmp %i2,0
+ bge L(249)
+ fitod %f10,%f2
+ faddd %f2,%f8,%f2
+L(249):
+ st %i3,[%fp-8]
+ faddd %f6,%f2,%f2
+ ld [%fp-8],%f10
+ cmp %i3,0
+ bge L(250)
+ fitod %f10,%f4
+ faddd %f4,%f8,%f4
+L(250):
+ fdivd %f2,%f4,%f2
+
+ifdef(`PIC',
+` ldd [%o7+L(C1)-L(pc)],%f4',
+` sethi %hi(L(C1)),%o7
+ ldd [%o7+%lo(L(C1))],%f4')
+
+ fcmped %f2,%f4
+ nop
+ fbge,a L(251)
+ fsubd %f2,%f4,%f2
+ fdtoi %f2,%f2
+ st %f2,[%fp-8]
+ b L(252)
+ ld [%fp-8],%i4
+L(251):
+ fdtoi %f2,%f2
+ st %f2,[%fp-8]
+ ld [%fp-8],%i4
+ sethi %hi(-2147483648),%g2
+ xor %i4,%g2,%i4
+L(252):
+ umul %i3,%i4,%g3
+ rd %y,%i0
+ subcc %i2,%g3,%o7
+ subxcc %i1,%i0,%g0
+ be L(253)
+ cmp %o7,%i3
+
+ add %i4,-1,%i0
+ add %o7,%i3,%o7
+ st %o7,[%i5]
+ ret
+ restore
+L(253):
+ blu L(246)
+ mov %i4,%i0
+ add %i4,1,%i0
+ sub %o7,%i3,%o7
+L(246):
+ st %o7,[%i5]
+ ret
+ restore
+EPILOGUE(mpn_udiv_qrnnd)
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc32/v8/umul.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc32/v8/umul.asm
new file mode 100644
index 00000000000..1a2e84b1f6e
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc32/v8/umul.asm
@@ -0,0 +1,40 @@
+dnl SPARC v8 mpn_umul_ppmm -- support for longlong.h for non-gcc.
+
+dnl Copyright 1995, 1996, 2000 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')
+
+ASM_START()
+PROLOGUE(mpn_umul_ppmm)
+ umul %o1,%o2,%g2
+ st %g2,[%o0]
+ retl
+ rd %y,%o0
+EPILOGUE(mpn_umul_ppmm)
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc32/v9/README b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc32/v9/README
new file mode 100644
index 00000000000..9b39713271d
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc32/v9/README
@@ -0,0 +1,4 @@
+Code for SPARC processors implementing version 9 of the SPARC architecture.
+This code is for systems that doesn't preserve the full 64-bit contents of
+integer register at context switch. For other systems (such as Solaris 7 or
+later) use the code in ../../sparc64.
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc32/v9/add_n.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc32/v9/add_n.asm
new file mode 100644
index 00000000000..7bd5974fd38
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc32/v9/add_n.asm
@@ -0,0 +1,129 @@
+dnl SPARC mpn_add_n -- Add two limb vectors of the same length > 0 and store
+dnl sum in a third limb vector.
+
+dnl Copyright 2001 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,%o0)
+define(s1p,%o1)
+define(s2p,%o2)
+define(n,%o3)
+define(cy,%g1)
+
+C This code uses 64-bit operations on `o' and `g' registers. It doesn't
+C require that `o' registers' upper 32 bits are preserved by the operating
+C system, but if they are not, they must be zeroed. That is indeed what
+C happens at least on Slowaris 2.5 and 2.6.
+
+C On UltraSPARC 1 and 2, this code runs at 3 cycles/limb from the Dcache and at
+C about 10 cycles/limb from the Ecache.
+
+ASM_START()
+PROLOGUE(mpn_add_n)
+ lduw [s1p+0],%o4
+ lduw [s2p+0],%o5
+ addcc n,-2,n
+ bl,pn %icc,L(end1)
+ lduw [s1p+4],%g2
+ lduw [s2p+4],%g3
+ be,pn %icc,L(end2)
+ mov 0,cy
+
+ .align 16
+L(loop):
+ add %o4,%o5,%g4
+ add rp,8,rp
+ lduw [s1p+8],%o4
+ fitod %f0,%f2
+C ---
+ add cy,%g4,%g4
+ addcc n,-1,n
+ lduw [s2p+8],%o5
+ fitod %f0,%f2
+C ---
+ srlx %g4,32,cy
+ add s2p,8,s2p
+ stw %g4,[rp-8]
+ be,pn %icc,L(exito)+4
+C ---
+ add %g2,%g3,%g4
+ addcc n,-1,n
+ lduw [s1p+12],%g2
+ fitod %f0,%f2
+C ---
+ add cy,%g4,%g4
+ add s1p,8,s1p
+ lduw [s2p+4],%g3
+ fitod %f0,%f2
+C ---
+ srlx %g4,32,cy
+ bne,pt %icc,L(loop)
+ stw %g4,[rp-4]
+C ---
+L(exite):
+ add %o4,%o5,%g4
+ add cy,%g4,%g4
+ srlx %g4,32,cy
+ stw %g4,[rp+0]
+ add %g2,%g3,%g4
+ add cy,%g4,%g4
+ stw %g4,[rp+4]
+ retl
+ srlx %g4,32,%o0
+
+L(exito):
+ add %g2,%g3,%g4
+ add cy,%g4,%g4
+ srlx %g4,32,cy
+ stw %g4,[rp-4]
+ add %o4,%o5,%g4
+ add cy,%g4,%g4
+ stw %g4,[rp+0]
+ retl
+ srlx %g4,32,%o0
+
+L(end1):
+ add %o4,%o5,%g4
+ stw %g4,[rp+0]
+ retl
+ srlx %g4,32,%o0
+
+L(end2):
+ add %o4,%o5,%g4
+ srlx %g4,32,cy
+ stw %g4,[rp+0]
+ add %g2,%g3,%g4
+ add cy,%g4,%g4
+ stw %g4,[rp+4]
+ retl
+ srlx %g4,32,%o0
+EPILOGUE(mpn_add_n)
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc32/v9/addmul_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc32/v9/addmul_1.asm
new file mode 100644
index 00000000000..2adf7a8a2f7
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc32/v9/addmul_1.asm
@@ -0,0 +1,306 @@
+dnl SPARC v9 32-bit mpn_addmul_1 -- Multiply a limb vector with a limb and add
+dnl the result to a second limb vector.
+
+dnl Copyright 1998, 2000, 2001, 2003 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 Algorithm: We use two floating-point multiplies per limb product, with the
+C invariant v operand split into two 16-bit pieces, and the u operand split
+C into 32-bit pieces. We convert the two 48-bit products and transfer them to
+C the integer unit.
+
+C cycles/limb
+C UltraSPARC 1&2: 6.5
+C UltraSPARC 3: ?
+
+C Possible optimizations:
+C 1. Combine 32-bit memory operations into 64-bit operations. Since we're
+C memory bandwidth limited, this could save 1.5 cycles/limb.
+C 2. Unroll the inner loop. Since we already use alternate temporary areas,
+C it is very straightforward to unroll, using an exit branch midways.
+C Unrolling would allow deeper scheduling which could improve speed for L2
+C cache case.
+C 3. For mpn_mul_1: Use more alternating temp areas. The std'es and ldx'es
+C aren't sufficiently apart-scheduled with just two temp areas.
+C 4. Specialize for particular v values. If its upper 16 bits are zero, we
+C could save many operations.
+
+C INPUT PARAMETERS
+C rp i0
+C up i1
+C n i2
+C v i3
+
+define(`FSIZE',224)
+
+ASM_START()
+PROLOGUE(mpn_addmul_1)
+ add %sp, -FSIZE, %sp
+ sethi %hi(0xffff), %g1
+ srl %o3, 16, %g2
+ or %g1, %lo(0xffff), %g1
+ and %o3, %g1, %g1
+ stx %g1, [%sp+104]
+ stx %g2, [%sp+112]
+ ldd [%sp+104], %f6
+ ldd [%sp+112], %f8
+ fxtod %f6, %f6
+ fxtod %f8, %f8
+ ld [%sp+104], %f10 C zero f10
+
+ mov 0, %g3 C cy = 0
+
+define(`fanop', `fitod %f18, %f0') C A quasi nop running in the FA pipe
+
+ add %sp, 160, %o5 C point in scratch area
+ and %o5, -32, %o5 C align at 0 (mod 32) in scratch area
+
+ subcc %o2, 1, %o2
+ ld [%o1], %f11 C read up[i]
+ add %o1, 4, %o1 C up++
+ bne,pt %icc, .L_two_or_more
+ fxtod %f10, %f2
+
+ fmuld %f2, %f8, %f16
+ fmuld %f2, %f6, %f4
+ fdtox %f16, %f14
+ fdtox %f4, %f12
+ std %f14, [%o5+16]
+ std %f12, [%o5+24]
+ ldx [%o5+16], %g2 C p16
+ ldx [%o5+24], %g1 C p0
+ lduw [%o0], %g5 C read rp[i]
+ b .L1
+ add %o0, -16, %o0
+
+ .align 16
+.L_two_or_more:
+ subcc %o2, 1, %o2
+ ld [%o1], %f11 C read up[i]
+ fmuld %f2, %f8, %f16
+ fmuld %f2, %f6, %f4
+ add %o1, 4, %o1 C up++
+ bne,pt %icc, .L_three_or_more
+ fxtod %f10, %f2
+
+ fdtox %f16, %f14
+ fdtox %f4, %f12
+ std %f14, [%o5+16]
+ fmuld %f2, %f8, %f16
+ std %f12, [%o5+24]
+ fmuld %f2, %f6, %f4
+ fdtox %f16, %f14
+ fdtox %f4, %f12
+ std %f14, [%o5+0]
+ std %f12, [%o5+8]
+ lduw [%o0], %g5 C read rp[i]
+ ldx [%o5+16], %g2 C p16
+ ldx [%o5+24], %g1 C p0
+ b .L2
+ add %o0, -12, %o0
+
+ .align 16
+.L_three_or_more:
+ subcc %o2, 1, %o2
+ ld [%o1], %f11 C read up[i]
+ fdtox %f16, %f14
+ fdtox %f4, %f12
+ std %f14, [%o5+16]
+ fmuld %f2, %f8, %f16
+ std %f12, [%o5+24]
+ fmuld %f2, %f6, %f4
+ add %o1, 4, %o1 C up++
+ bne,pt %icc, .L_four_or_more
+ fxtod %f10, %f2
+
+ fdtox %f16, %f14
+ fdtox %f4, %f12
+ std %f14, [%o5+0]
+ fmuld %f2, %f8, %f16
+ std %f12, [%o5+8]
+ fmuld %f2, %f6, %f4
+ fdtox %f16, %f14
+ ldx [%o5+16], %g2 C p16
+ fdtox %f4, %f12
+ ldx [%o5+24], %g1 C p0
+ std %f14, [%o5+16]
+ std %f12, [%o5+24]
+ lduw [%o0], %g5 C read rp[i]
+ b .L3
+ add %o0, -8, %o0
+
+ .align 16
+.L_four_or_more:
+ subcc %o2, 1, %o2
+ ld [%o1], %f11 C read up[i]
+ fdtox %f16, %f14
+ fdtox %f4, %f12
+ std %f14, [%o5+0]
+ fmuld %f2, %f8, %f16
+ std %f12, [%o5+8]
+ fmuld %f2, %f6, %f4
+ add %o1, 4, %o1 C up++
+ bne,pt %icc, .L_five_or_more
+ fxtod %f10, %f2
+
+ fdtox %f16, %f14
+ ldx [%o5+16], %g2 C p16
+ fdtox %f4, %f12
+ ldx [%o5+24], %g1 C p0
+ std %f14, [%o5+16]
+ fmuld %f2, %f8, %f16
+ std %f12, [%o5+24]
+ fmuld %f2, %f6, %f4
+ add %o1, 4, %o1 C up++
+ lduw [%o0], %g5 C read rp[i]
+ b .L4
+ add %o0, -4, %o0
+
+ .align 16
+.L_five_or_more:
+ subcc %o2, 1, %o2
+ ld [%o1], %f11 C read up[i]
+ fdtox %f16, %f14
+ ldx [%o5+16], %g2 C p16
+ fdtox %f4, %f12
+ ldx [%o5+24], %g1 C p0
+ std %f14, [%o5+16]
+ fmuld %f2, %f8, %f16
+ std %f12, [%o5+24]
+ fmuld %f2, %f6, %f4
+ add %o1, 4, %o1 C up++
+ lduw [%o0], %g5 C read rp[i]
+ bne,pt %icc, .Loop
+ fxtod %f10, %f2
+ b,a .L5
+
+C BEGIN MAIN LOOP
+ .align 16
+C -- 0
+.Loop: nop
+ subcc %o2, 1, %o2
+ ld [%o1], %f11 C read up[i]
+ fdtox %f16, %f14
+C -- 1
+ sllx %g2, 16, %g4 C (p16 << 16)
+ add %o0, 4, %o0 C rp++
+ ldx [%o5+0], %g2 C p16
+ fdtox %f4, %f12
+C -- 2
+ nop
+ add %g1, %g4, %g4 C p = p0 + (p16 << 16)
+ ldx [%o5+8], %g1 C p0
+ fanop
+C -- 3
+ nop
+ add %g3, %g4, %g4 C p += cy
+ std %f14, [%o5+0]
+ fmuld %f2, %f8, %f16
+C -- 4
+ nop
+ add %g5, %g4, %g4 C p += rp[i]
+ std %f12, [%o5+8]
+ fmuld %f2, %f6, %f4
+C -- 5
+ xor %o5, 16, %o5 C alternate scratch variables
+ add %o1, 4, %o1 C up++
+ stw %g4, [%o0-4]
+ fanop
+C -- 6
+ srlx %g4, 32, %g3 C new cy
+ lduw [%o0], %g5 C read rp[i]
+ bne,pt %icc, .Loop
+ fxtod %f10, %f2
+C END MAIN LOOP
+
+.L5: fdtox %f16, %f14
+ sllx %g2, 16, %g4 C (p16 << 16)
+ ldx [%o5+0], %g2 C p16
+ fdtox %f4, %f12
+ add %g1, %g4, %g4 C p = p0 + (p16 << 16)
+ ldx [%o5+8], %g1 C p0
+ add %g4, %g3, %g4 C p += cy
+ std %f14, [%o5+0]
+ fmuld %f2, %f8, %f16
+ add %g5, %g4, %g4 C p += rp[i]
+ std %f12, [%o5+8]
+ fmuld %f2, %f6, %f4
+ xor %o5, 16, %o5
+ stw %g4, [%o0+0]
+ srlx %g4, 32, %g3 C new cy
+ lduw [%o0+4], %g5 C read rp[i]
+
+.L4: fdtox %f16, %f14
+ sllx %g2, 16, %g4 C (p16 << 16)
+ ldx [%o5+0], %g2 C p16
+ fdtox %f4, %f12
+ add %g1, %g4, %g4 C p = p0 + (p16 << 16)
+ ldx [%o5+8], %g1 C p0
+ add %g3, %g4, %g4 C p += cy
+ std %f14, [%o5+0]
+ add %g5, %g4, %g4 C p += rp[i]
+ std %f12, [%o5+8]
+ xor %o5, 16, %o5
+ stw %g4, [%o0+4]
+ srlx %g4, 32, %g3 C new cy
+ lduw [%o0+8], %g5 C read rp[i]
+
+.L3: sllx %g2, 16, %g4 C (p16 << 16)
+ ldx [%o5+0], %g2 C p16
+ add %g1, %g4, %g4 C p = p0 + (p16 << 16)
+ ldx [%o5+8], %g1 C p0
+ add %g3, %g4, %g4 C p += cy
+ add %g5, %g4, %g4 C p += rp[i]
+ xor %o5, 16, %o5
+ stw %g4, [%o0+8]
+ srlx %g4, 32, %g3 C new cy
+ lduw [%o0+12], %g5 C read rp[i]
+
+.L2: sllx %g2, 16, %g4 C (p16 << 16)
+ ldx [%o5+0], %g2 C p16
+ add %g1, %g4, %g4 C p = p0 + (p16 << 16)
+ ldx [%o5+8], %g1 C p0
+ add %g3, %g4, %g4 C p += cy
+ add %g5, %g4, %g4 C p += rp[i]
+ stw %g4, [%o0+12]
+ srlx %g4, 32, %g3 C new cy
+ lduw [%o0+16], %g5 C read rp[i]
+
+.L1: sllx %g2, 16, %g4 C (p16 << 16)
+ add %g1, %g4, %g4 C p = p0 + (p16 << 16)
+ add %g3, %g4, %g4 C p += cy
+ add %g5, %g4, %g4 C p += rp[i]
+ stw %g4, [%o0+16]
+ srlx %g4, 32, %g3 C new cy
+
+ mov %g3, %o0
+ retl
+ sub %sp, -FSIZE, %sp
+EPILOGUE(mpn_addmul_1)
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc32/v9/gmp-mparam.h b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc32/v9/gmp-mparam.h
new file mode 100644
index 00000000000..f909e2cf18e
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc32/v9/gmp-mparam.h
@@ -0,0 +1,204 @@
+/* SPARC v9 32-bit gmp-mparam.h -- Compiler/machine parameter header file.
+
+Copyright 1991, 1993, 1994, 1999-2002, 2004, 2009-2011, 2014 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
+
+/* 1593 MHz ultrasparc3 running Solaris 10 (swift.nada.kth.se) */
+/* FFT tuning limit = 25000000 */
+/* Generated by tuneup.c, 2014-03-16, gcc 3.4 */
+
+#define DIVREM_1_NORM_THRESHOLD 3
+#define DIVREM_1_UNNORM_THRESHOLD 4
+#define MOD_1_1P_METHOD 2
+#define MOD_1_NORM_THRESHOLD 3
+#define MOD_1_UNNORM_THRESHOLD 4
+#define MOD_1N_TO_MOD_1_1_THRESHOLD 13
+#define MOD_1U_TO_MOD_1_1_THRESHOLD 12
+#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 32
+#define USE_PREINV_DIVREM_1 1
+#define DIV_QR_1N_PI1_METHOD 1
+#define DIV_QR_1_NORM_THRESHOLD 4
+#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 MP_SIZE_T_MAX /* never */
+
+#define MUL_TOOM22_THRESHOLD 28
+#define MUL_TOOM33_THRESHOLD 43
+#define MUL_TOOM44_THRESHOLD 126
+#define MUL_TOOM6H_THRESHOLD 161
+#define MUL_TOOM8H_THRESHOLD 208
+
+#define MUL_TOOM32_TO_TOOM43_THRESHOLD 73
+#define MUL_TOOM32_TO_TOOM53_THRESHOLD 80
+#define MUL_TOOM42_TO_TOOM53_THRESHOLD 85
+#define MUL_TOOM42_TO_TOOM63_THRESHOLD 55
+#define MUL_TOOM43_TO_TOOM54_THRESHOLD 72
+
+#define SQR_BASECASE_THRESHOLD 4
+#define SQR_TOOM2_THRESHOLD 64
+#define SQR_TOOM3_THRESHOLD 85
+#define SQR_TOOM4_THRESHOLD 152
+#define SQR_TOOM6_THRESHOLD 185
+#define SQR_TOOM8_THRESHOLD 324
+
+#define MULMID_TOOM42_THRESHOLD 64
+
+#define MULMOD_BNM1_THRESHOLD 12
+#define SQRMOD_BNM1_THRESHOLD 16
+
+#define MUL_FFT_MODF_THRESHOLD 288 /* k = 5 */
+#define MUL_FFT_TABLE3 \
+ { { 288, 5}, { 9, 4}, { 19, 5}, { 11, 6}, \
+ { 6, 5}, { 14, 6}, { 8, 5}, { 17, 6}, \
+ { 9, 5}, { 20, 6}, { 13, 7}, { 7, 6}, \
+ { 16, 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}, { 31, 7}, \
+ { 63, 8}, { 39, 9}, { 23, 8}, { 47,10}, \
+ { 15, 9}, { 31, 8}, { 67, 9}, { 39, 8}, \
+ { 79, 9}, { 47,10}, { 31, 9}, { 71, 8}, \
+ { 143, 9}, { 79,10}, { 47, 9}, { 95,11}, \
+ { 31,10}, { 63, 9}, { 135, 8}, { 271, 9}, \
+ { 143, 8}, { 287,10}, { 79, 9}, { 175,10}, \
+ { 95, 9}, { 191, 8}, { 383,10}, { 111,11}, \
+ { 63,10}, { 143, 9}, { 287, 8}, { 575,10}, \
+ { 175,11}, { 95,10}, { 191, 9}, { 415, 8}, \
+ { 831,12}, { 63,11}, { 127,10}, { 287, 9}, \
+ { 575,11}, { 159,10}, { 351, 9}, { 703,11}, \
+ { 191,10}, { 415, 9}, { 831,11}, { 223,10}, \
+ { 447, 9}, { 895, 8}, { 1791,12}, { 127,11}, \
+ { 287,10}, { 607, 9}, { 1215, 8}, { 2431,11}, \
+ { 319, 9}, { 1279,11}, { 351,12}, { 191,11}, \
+ { 415,10}, { 831,11}, { 447,10}, { 895, 9}, \
+ { 1791,11}, { 479,13}, { 127,12}, { 255,11}, \
+ { 575,10}, { 1151,11}, { 607,12}, { 319,11}, \
+ { 703,12}, { 383,11}, { 831,12}, { 447,11}, \
+ { 895,10}, { 1791,11}, { 959,13}, { 255,12}, \
+ { 575,11}, { 1215,10}, { 2431,12}, { 703,13}, \
+ { 383,12}, { 959,14}, { 255,13}, { 511,12}, \
+ { 1087,11}, { 2175,12}, { 1215,11}, { 2431,13}, \
+ { 639,12}, { 1407,11}, { 2943,13}, { 895,12}, \
+ { 1919,14}, { 511,13}, { 1151,12}, { 2431,13}, \
+ { 1407,14}, { 767,13}, { 1791,15}, { 511,14}, \
+ { 1023,13}, { 2431,14}, { 1279,13}, { 2943,12}, \
+ { 5887,14}, { 16384,15}, { 32768,16} }
+#define MUL_FFT_TABLE3_SIZE 143
+#define MUL_FFT_THRESHOLD 2240
+
+#define SQR_FFT_MODF_THRESHOLD 244 /* k = 5 */
+#define SQR_FFT_TABLE3 \
+ { { 244, 5}, { 8, 4}, { 17, 5}, { 17, 6}, \
+ { 9, 5}, { 19, 6}, { 17, 7}, { 9, 6}, \
+ { 20, 7}, { 11, 6}, { 23, 7}, { 13, 8}, \
+ { 7, 7}, { 19, 8}, { 11, 7}, { 25, 9}, \
+ { 7, 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, 7}, { 287, 9}, { 79,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,10}, { 95, 9}, { 191, 8}, { 383, 9}, \
+ { 207, 8}, { 415, 9}, { 223,11}, { 63,10}, \
+ { 127, 9}, { 271,10}, { 143, 9}, { 287, 8}, \
+ { 575,10}, { 159, 9}, { 319,10}, { 175, 9}, \
+ { 351, 8}, { 703,11}, { 95,10}, { 191, 9}, \
+ { 383,10}, { 207, 9}, { 415, 8}, { 831,10}, \
+ { 223,12}, { 63,11}, { 127,10}, { 271, 9}, \
+ { 543,10}, { 287, 9}, { 575,11}, { 159,10}, \
+ { 319, 9}, { 639,10}, { 351, 9}, { 703, 8}, \
+ { 1407,11}, { 191,10}, { 415, 9}, { 831,11}, \
+ { 223,10}, { 447, 9}, { 895,10}, { 479,12}, \
+ { 127,11}, { 255,10}, { 543,11}, { 287,10}, \
+ { 575,11}, { 319,10}, { 639,11}, { 351,10}, \
+ { 703,12}, { 191,11}, { 415,10}, { 831,11}, \
+ { 447,10}, { 895, 9}, { 1791,13}, { 127,12}, \
+ { 255,11}, { 575,12}, { 319,11}, { 703,10}, \
+ { 1407,12}, { 383,11}, { 831,12}, { 447,11}, \
+ { 959,10}, { 1919, 9}, { 3839,13}, { 255,12}, \
+ { 575,11}, { 1151,12}, { 703,11}, { 1407,13}, \
+ { 383,12}, { 959,14}, { 255,13}, { 511,12}, \
+ { 1215,11}, { 2431,13}, { 639,12}, { 1407,13}, \
+ { 767,12}, { 1599,13}, { 895,12}, { 1919,14}, \
+ { 511,13}, { 1151,12}, { 2431,13}, { 1407,12}, \
+ { 2815,14}, { 767,13}, { 1535,12}, { 3071,13}, \
+ { 1919,15}, { 511,14}, { 1023,13}, { 2431,14}, \
+ { 1279,13}, { 2943,12}, { 5887,14}, { 16384,15}, \
+ { 32768,16} }
+#define SQR_FFT_TABLE3_SIZE 153
+#define SQR_FFT_THRESHOLD 2112
+
+#define MULLO_BASECASE_THRESHOLD 0 /* always */
+#define MULLO_DC_THRESHOLD 144
+#define MULLO_MUL_N_THRESHOLD 4292
+
+#define DC_DIV_QR_THRESHOLD 74
+#define DC_DIVAPPR_Q_THRESHOLD 406
+#define DC_BDIV_QR_THRESHOLD 63
+#define DC_BDIV_Q_THRESHOLD 363
+
+#define INV_MULMOD_BNM1_THRESHOLD 108
+#define INV_NEWTON_THRESHOLD 351
+#define INV_APPR_THRESHOLD 303
+
+#define BINV_NEWTON_THRESHOLD 354
+#define REDC_1_TO_REDC_N_THRESHOLD 61
+
+#define MU_DIV_QR_THRESHOLD 998
+#define MU_DIVAPPR_Q_THRESHOLD 1099
+#define MUPI_DIV_QR_THRESHOLD 118
+#define MU_BDIV_QR_THRESHOLD 807
+#define MU_BDIV_Q_THRESHOLD 979
+
+#define POWM_SEC_TABLE 3,22,127,624,779,2351
+
+#define MATRIX22_STRASSEN_THRESHOLD 7
+#define HGCD_THRESHOLD 90
+#define HGCD_APPR_THRESHOLD 123
+#define HGCD_REDUCE_THRESHOLD 1494
+#define GCD_DC_THRESHOLD 283
+#define GCDEXT_DC_THRESHOLD 192
+#define JACOBI_BASE_METHOD 4
+
+#define GET_STR_DC_THRESHOLD 12
+#define GET_STR_PRECOMPUTE_THRESHOLD 27
+#define SET_STR_DC_THRESHOLD 290
+#define SET_STR_PRECOMPUTE_THRESHOLD 634
+
+#define FAC_DSC_THRESHOLD 156
+#define FAC_ODD_THRESHOLD 25
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc32/v9/mul_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc32/v9/mul_1.asm
new file mode 100644
index 00000000000..40aeffad4f3
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc32/v9/mul_1.asm
@@ -0,0 +1,287 @@
+dnl SPARC v9 32-bit mpn_mul_1 -- Multiply a limb vector with a limb and store
+dnl the result in a second limb vector.
+
+dnl Copyright 1998, 2000, 2001, 2003 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 Algorithm: We use two floating-point multiplies per limb product, with the
+C invariant v operand split into two 16-bit pieces, and the u operand split
+C into 32-bit pieces. We convert the two 48-bit products and transfer them to
+C the integer unit.
+
+C cycles/limb
+C UltraSPARC 1&2: 6.5
+C UltraSPARC 3: ?
+
+C Possible optimizations:
+C 1. Combine 32-bit memory operations into 64-bit operations. Since we're
+C memory bandwidth limited, this could save 1.5 cycles/limb.
+C 2. Unroll the inner loop. Since we already use alternate temporary areas,
+C it is very straightforward to unroll, using an exit branch midways.
+C Unrolling would allow deeper scheduling which could improve speed for L2
+C cache case.
+C 3. For mpn_mul_1: Use more alternating temp areas. The std'es and ldx'es
+C aren't sufficiently apart-scheduled with just two temp areas.
+C 4. Specialize for particular v values. If its upper 16 bits are zero, we
+C could save many operations.
+
+C INPUT PARAMETERS
+C rp i0
+C up i1
+C n i2
+C v i3
+
+define(`FSIZE',224)
+
+ASM_START()
+PROLOGUE(mpn_mul_1)
+ add %sp, -FSIZE, %sp
+ sethi %hi(0xffff), %g1
+ srl %o3, 16, %g2
+ or %g1, %lo(0xffff), %g1
+ and %o3, %g1, %g1
+ stx %g1, [%sp+104]
+ stx %g2, [%sp+112]
+ ldd [%sp+104], %f6
+ ldd [%sp+112], %f8
+ fxtod %f6, %f6
+ fxtod %f8, %f8
+ ld [%sp+104], %f10 C zero f10
+
+ mov 0, %g3 C cy = 0
+
+define(`fanop', `fitod %f18, %f0') C A quasi nop running in the FA pipe
+
+ add %sp, 160, %o5 C point in scratch area
+ and %o5, -32, %o5 C align at 0 (mod 32) in scratch area
+
+ subcc %o2, 1, %o2
+ ld [%o1], %f11 C read up[i]
+ add %o1, 4, %o1 C up++
+ bne,pt %icc, .L_two_or_more
+ fxtod %f10, %f2
+
+ fmuld %f2, %f8, %f16
+ fmuld %f2, %f6, %f4
+ fdtox %f16, %f14
+ fdtox %f4, %f12
+ std %f14, [%o5+16]
+ std %f12, [%o5+24]
+ ldx [%o5+16], %g2 C p16
+ ldx [%o5+24], %g1 C p0
+ b .L1
+ add %o0, -16, %o0
+
+ .align 16
+.L_two_or_more:
+ subcc %o2, 1, %o2
+ ld [%o1], %f11 C read up[i]
+ fmuld %f2, %f8, %f16
+ fmuld %f2, %f6, %f4
+ add %o1, 4, %o1 C up++
+ bne,pt %icc, .L_three_or_more
+ fxtod %f10, %f2
+
+ fdtox %f16, %f14
+ fdtox %f4, %f12
+ std %f14, [%o5+16]
+ fmuld %f2, %f8, %f16
+ std %f12, [%o5+24]
+ fmuld %f2, %f6, %f4
+ fdtox %f16, %f14
+ fdtox %f4, %f12
+ std %f14, [%o5+0]
+ std %f12, [%o5+8]
+ ldx [%o5+16], %g2 C p16
+ ldx [%o5+24], %g1 C p0
+ b .L2
+ add %o0, -12, %o0
+
+ .align 16
+.L_three_or_more:
+ subcc %o2, 1, %o2
+ ld [%o1], %f11 C read up[i]
+ fdtox %f16, %f14
+ fdtox %f4, %f12
+ std %f14, [%o5+16]
+ fmuld %f2, %f8, %f16
+ std %f12, [%o5+24]
+ fmuld %f2, %f6, %f4
+ add %o1, 4, %o1 C up++
+ bne,pt %icc, .L_four_or_more
+ fxtod %f10, %f2
+
+ fdtox %f16, %f14
+ fdtox %f4, %f12
+ std %f14, [%o5+0]
+ fmuld %f2, %f8, %f16
+ std %f12, [%o5+8]
+ fmuld %f2, %f6, %f4
+ fdtox %f16, %f14
+ ldx [%o5+16], %g2 C p16
+ fdtox %f4, %f12
+ ldx [%o5+24], %g1 C p0
+ std %f14, [%o5+16]
+ std %f12, [%o5+24]
+ b .L3
+ add %o0, -8, %o0
+
+ .align 16
+.L_four_or_more:
+ subcc %o2, 1, %o2
+ ld [%o1], %f11 C read up[i]
+ fdtox %f16, %f14
+ fdtox %f4, %f12
+ std %f14, [%o5+0]
+ fmuld %f2, %f8, %f16
+ std %f12, [%o5+8]
+ fmuld %f2, %f6, %f4
+ add %o1, 4, %o1 C up++
+ bne,pt %icc, .L_five_or_more
+ fxtod %f10, %f2
+
+ fdtox %f16, %f14
+ ldx [%o5+16], %g2 C p16
+ fdtox %f4, %f12
+ ldx [%o5+24], %g1 C p0
+ std %f14, [%o5+16]
+ fmuld %f2, %f8, %f16
+ std %f12, [%o5+24]
+ fmuld %f2, %f6, %f4
+ add %o1, 4, %o1 C up++
+ b .L4
+ add %o0, -4, %o0
+
+ .align 16
+.L_five_or_more:
+ subcc %o2, 1, %o2
+ ld [%o1], %f11 C read up[i]
+ fdtox %f16, %f14
+ ldx [%o5+16], %g2 C p16
+ fdtox %f4, %f12
+ ldx [%o5+24], %g1 C p0
+ std %f14, [%o5+16]
+ fmuld %f2, %f8, %f16
+ std %f12, [%o5+24]
+ fmuld %f2, %f6, %f4
+ add %o1, 4, %o1 C up++
+ bne,pt %icc, .Loop
+ fxtod %f10, %f2
+ b,a .L5
+
+C BEGIN MAIN LOOP
+ .align 16
+C -- 0
+.Loop: nop
+ subcc %o2, 1, %o2
+ ld [%o1], %f11 C read up[i]
+ fdtox %f16, %f14
+C -- 1
+ sllx %g2, 16, %g4 C (p16 << 16)
+ add %o0, 4, %o0 C rp++
+ ldx [%o5+0], %g2 C p16
+ fdtox %f4, %f12
+C -- 2
+ nop
+ add %g1, %g4, %g4 C p = p0 + (p16 << 16)
+ ldx [%o5+8], %g1 C p0
+ fanop
+C -- 3
+ nop
+ add %g3, %g4, %g4 C p += cy
+ std %f14, [%o5+0]
+ fmuld %f2, %f8, %f16
+C -- 4
+ srlx %g4, 32, %g3 C new cy
+ add %o1, 4, %o1 C up++
+ std %f12, [%o5+8]
+ fmuld %f2, %f6, %f4
+C -- 5
+ xor %o5, 16, %o5 C alternate scratch variables
+ stw %g4, [%o0-4]
+ bne,pt %icc, .Loop
+ fxtod %f10, %f2
+C END MAIN LOOP
+
+.L5: fdtox %f16, %f14
+ sllx %g2, 16, %g4 C (p16 << 16)
+ ldx [%o5+0], %g2 C p16
+ fdtox %f4, %f12
+ add %g1, %g4, %g4 C p = p0 + (p16 << 16)
+ ldx [%o5+8], %g1 C p0
+ add %g4, %g3, %g4 C p += cy
+ std %f14, [%o5+0]
+ fmuld %f2, %f8, %f16
+ std %f12, [%o5+8]
+ fmuld %f2, %f6, %f4
+ xor %o5, 16, %o5
+ stw %g4, [%o0+0]
+ srlx %g4, 32, %g3 C new cy
+
+.L4: fdtox %f16, %f14
+ sllx %g2, 16, %g4 C (p16 << 16)
+ ldx [%o5+0], %g2 C p16
+ fdtox %f4, %f12
+ add %g1, %g4, %g4 C p = p0 + (p16 << 16)
+ ldx [%o5+8], %g1 C p0
+ add %g3, %g4, %g4 C p += cy
+ std %f14, [%o5+0]
+ std %f12, [%o5+8]
+ xor %o5, 16, %o5
+ stw %g4, [%o0+4]
+ srlx %g4, 32, %g3 C new cy
+
+.L3: sllx %g2, 16, %g4 C (p16 << 16)
+ ldx [%o5+0], %g2 C p16
+ add %g1, %g4, %g4 C p = p0 + (p16 << 16)
+ ldx [%o5+8], %g1 C p0
+ add %g3, %g4, %g4 C p += cy
+ xor %o5, 16, %o5
+ stw %g4, [%o0+8]
+ srlx %g4, 32, %g3 C new cy
+
+.L2: sllx %g2, 16, %g4 C (p16 << 16)
+ ldx [%o5+0], %g2 C p16
+ add %g1, %g4, %g4 C p = p0 + (p16 << 16)
+ ldx [%o5+8], %g1 C p0
+ add %g3, %g4, %g4 C p += cy
+ stw %g4, [%o0+12]
+ srlx %g4, 32, %g3 C new cy
+
+.L1: sllx %g2, 16, %g4 C (p16 << 16)
+ add %g1, %g4, %g4 C p = p0 + (p16 << 16)
+ add %g3, %g4, %g4 C p += cy
+ stw %g4, [%o0+16]
+ srlx %g4, 32, %g3 C new cy
+
+ mov %g3, %o0
+ retl
+ sub %sp, -FSIZE, %sp
+EPILOGUE(mpn_mul_1)
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc32/v9/sqr_diagonal.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc32/v9/sqr_diagonal.asm
new file mode 100644
index 00000000000..e0242798496
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc32/v9/sqr_diagonal.asm
@@ -0,0 +1,462 @@
+dnl SPARC v9 32-bit mpn_sqr_diagonal.
+
+dnl Copyright 2001, 2003 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 rp i0
+C up i1
+C n i2
+
+C This code uses a very deep software pipeline, due to the need for moving data
+C forth and back between the integer registers and floating-point registers.
+C
+C A VIS variant of this code would make the pipeline less deep, since the
+C masking now done in the integer unit could take place in the floating-point
+C unit using the FAND instruction. It would be possible to save several cycles
+C too.
+C
+C On UltraSPARC 1 and 2, this code runs at 11 cycles/limb from the Dcache and
+C not much slower from the Ecache. It would perhaps be possible to shave off
+C one cycle, but not easily. We cannot do better than 10 cycles/limb with the
+C used instructions, since we have 10 memory operations per limb. But a VIS
+C variant could run three cycles faster than the corresponding non-VIS code.
+
+C This is non-pipelined code showing the algorithm:
+C
+C .Loop:
+C lduw [up+0],%g4 C 00000000hhhhllll
+C sllx %g4,16,%g3 C 0000hhhhllll0000
+C or %g3,%g4,%g2 C 0000hhhhXXXXllll
+C andn %g2,%g5,%g2 C 0000hhhh0000llll
+C stx %g2,[%fp+80]
+C ldd [%fp+80],%f0
+C fitod %f0,%f4 C hi16
+C fitod %f1,%f6 C lo16
+C ld [up+0],%f9
+C fxtod %f8,%f2
+C fmuld %f2,%f4,%f4
+C fmuld %f2,%f6,%f6
+C fdtox %f4,%f4
+C fdtox %f6,%f6
+C std %f4,[%fp-24]
+C std %f6,[%fp-16]
+C ldx [%fp-24],%g2
+C ldx [%fp-16],%g1
+C sllx %g2,16,%g2
+C add %g2,%g1,%g1
+C stw %g1,[rp+0]
+C srlx %g1,32,%l0
+C stw %l0,[rp+4]
+C add up,4,up
+C subcc n,1,n
+C bne,pt %icc,.Loop
+C add rp,8,rp
+
+define(`fanop',`fitod %f12,%f10') dnl A quasi nop running in the FA pipe
+
+ASM_START()
+
+ TEXT
+ ALIGN(4)
+.Lnoll:
+ .word 0
+
+PROLOGUE(mpn_sqr_diagonal)
+ save %sp,-256,%sp
+
+ifdef(`PIC',
+`.Lpc: rd %pc,%o7
+ ld [%o7+.Lnoll-.Lpc],%f8',
+` sethi %hi(.Lnoll),%g1
+ ld [%g1+%lo(.Lnoll)],%f8')
+
+ sethi %hi(0xffff0000),%g5
+ add %i1,-8,%i1
+
+ lduw [%i1+8],%g4
+ add %i1,4,%i1 C s1_ptr++
+ sllx %g4,16,%g3 C 0000hhhhllll0000
+ or %g3,%g4,%g2 C 0000hhhhXXXXllll
+ subcc %i2,1,%i2
+ bne,pt %icc,.L_grt_1
+ andn %g2,%g5,%g2 C 0000hhhh0000llll
+
+ add %i1,4,%i1 C s1_ptr++
+ stx %g2,[%fp+80]
+ ld [%i1],%f9
+ ldd [%fp+80],%f0
+ fxtod %f8,%f2
+ fitod %f0,%f4
+ fitod %f1,%f6
+ fmuld %f2,%f4,%f4
+ fmuld %f2,%f6,%f6
+ fdtox %f4,%f4
+ fdtox %f6,%f6
+ std %f4,[%fp-24]
+ std %f6,[%fp-16]
+
+ add %fp, 80, %l3
+ add %fp, -24, %l4
+ add %fp, 72, %l5
+ b .L1
+ add %fp, -40, %l6
+
+.L_grt_1:
+ stx %g2,[%fp+80]
+ lduw [%i1+8],%g4
+ add %i1,4,%i1 C s1_ptr++
+ sllx %g4,16,%g3 C 0000hhhhllll0000
+ or %g3,%g4,%g2 C 0000hhhhXXXXllll
+ subcc %i2,1,%i2
+ bne,pt %icc,.L_grt_2
+ andn %g2,%g5,%g2 C 0000hhhh0000llll
+
+ stx %g2,[%fp+72]
+ ld [%i1],%f9
+ add %i1,4,%i1 C s1_ptr++
+ ldd [%fp+80],%f0
+ fxtod %f8,%f2
+ fitod %f0,%f4
+ fitod %f1,%f6
+ fmuld %f2,%f4,%f4
+ ld [%i1],%f9
+ fmuld %f2,%f6,%f6
+ ldd [%fp+72],%f0
+ fdtox %f4,%f4
+ fdtox %f6,%f6
+ std %f4,[%fp-24]
+ fxtod %f8,%f2
+ std %f6,[%fp-16]
+ fitod %f0,%f4
+ fitod %f1,%f6
+ fmuld %f2,%f4,%f4
+ fmuld %f2,%f6,%f6
+ fdtox %f4,%f4
+
+ add %fp, 72, %l3
+ add %fp, -40, %l4
+ add %fp, 80, %l5
+ b .L2
+ add %fp, -24, %l6
+
+.L_grt_2:
+ stx %g2,[%fp+72]
+ lduw [%i1+8],%g4
+ ld [%i1],%f9
+ add %i1,4,%i1 C s1_ptr++
+ ldd [%fp+80],%f0
+ sllx %g4,16,%g3 C 0000hhhhllll0000
+ or %g3,%g4,%g2 C 0000hhhhXXXXllll
+ subcc %i2,1,%i2
+ fxtod %f8,%f2
+ bne,pt %icc,.L_grt_3
+ andn %g2,%g5,%g2 C 0000hhhh0000llll
+
+ stx %g2,[%fp+80]
+ fitod %f0,%f4
+ fitod %f1,%f6
+ fmuld %f2,%f4,%f4
+ ld [%i1],%f9
+ fmuld %f2,%f6,%f6
+ add %i1,4,%i1 C s1_ptr++
+ ldd [%fp+72],%f0
+ fdtox %f4,%f4
+ fdtox %f6,%f6
+ std %f4,[%fp-24]
+ fxtod %f8,%f2
+ std %f6,[%fp-16]
+ fitod %f0,%f4
+ fitod %f1,%f6
+ fmuld %f2,%f4,%f4
+ ld [%i1],%f9
+ add %fp, 80, %l3
+ fmuld %f2,%f6,%f6
+ add %fp, -24, %l4
+ ldd [%fp+80],%f0
+ add %fp, 72, %l5
+ fdtox %f4,%f4
+ b .L3
+ add %fp, -40, %l6
+
+.L_grt_3:
+ stx %g2,[%fp+80]
+ fitod %f0,%f4
+ lduw [%i1+8],%g4
+ fitod %f1,%f6
+ fmuld %f2,%f4,%f4
+ ld [%i1],%f9
+ fmuld %f2,%f6,%f6
+ add %i1,4,%i1 C s1_ptr++
+ ldd [%fp+72],%f0
+ fdtox %f4,%f4
+ sllx %g4,16,%g3 C 0000hhhhllll0000
+ fdtox %f6,%f6
+ or %g3,%g4,%g2 C 0000hhhhXXXXllll
+ subcc %i2,1,%i2
+ std %f4,[%fp-24]
+ fxtod %f8,%f2
+ std %f6,[%fp-16]
+ bne,pt %icc,.L_grt_4
+ andn %g2,%g5,%g2 C 0000hhhh0000llll
+
+ stx %g2,[%fp+72]
+ fitod %f0,%f4
+ fitod %f1,%f6
+ add %fp, 72, %l3
+ fmuld %f2,%f4,%f4
+ add %fp, -40, %l4
+ ld [%i1],%f9
+ fmuld %f2,%f6,%f6
+ add %i1,4,%i1 C s1_ptr++
+ ldd [%fp+80],%f0
+ add %fp, 80, %l5
+ fdtox %f4,%f4
+ b .L4
+ add %fp, -24, %l6
+
+.L_grt_4:
+ stx %g2,[%fp+72]
+ fitod %f0,%f4
+ lduw [%i1+8],%g4
+ fitod %f1,%f6
+ fmuld %f2,%f4,%f4
+ ld [%i1],%f9
+ fmuld %f2,%f6,%f6
+ add %i1,4,%i1 C s1_ptr++
+ ldd [%fp+80],%f0
+ fdtox %f4,%f4
+ sllx %g4,16,%g3 C 0000hhhhllll0000
+ fdtox %f6,%f6
+ or %g3,%g4,%g2 C 0000hhhhXXXXllll
+ subcc %i2,1,%i2
+ std %f4,[%fp-40]
+ fxtod %f8,%f2
+ std %f6,[%fp-32]
+ be,pn %icc,.L5
+ andn %g2,%g5,%g2 C 0000hhhh0000llll
+
+ b,a .Loop
+
+ .align 16
+C --- LOOP BEGIN
+.Loop: nop
+ nop
+ stx %g2,[%fp+80]
+ fitod %f0,%f4
+C ---
+ nop
+ nop
+ lduw [%i1+8],%g4
+ fitod %f1,%f6
+C ---
+ nop
+ nop
+ ldx [%fp-24],%g2 C p16
+ fanop
+C ---
+ nop
+ nop
+ ldx [%fp-16],%g1 C p0
+ fmuld %f2,%f4,%f4
+C ---
+ sllx %g2,16,%g2 C align p16
+ add %i0,8,%i0 C res_ptr++
+ ld [%i1],%f9
+ fmuld %f2,%f6,%f6
+C ---
+ add %g2,%g1,%g1 C add p16 to p0 (ADD1)
+ add %i1,4,%i1 C s1_ptr++
+ ldd [%fp+72],%f0
+ fanop
+C ---
+ srlx %g1,32,%l0
+ nop
+ stw %g1,[%i0-8]
+ fdtox %f4,%f4
+C ---
+ sllx %g4,16,%g3 C 0000hhhhllll0000
+ nop
+ stw %l0,[%i0-4]
+ fdtox %f6,%f6
+C ---
+ or %g3,%g4,%g2 C 0000hhhhXXXXllll
+ subcc %i2,1,%i2
+ std %f4,[%fp-24]
+ fxtod %f8,%f2
+C ---
+ std %f6,[%fp-16]
+ andn %g2,%g5,%g2 C 0000hhhh0000llll
+ be,pn %icc,.Lend
+ fanop
+C --- LOOP MIDDLE
+ nop
+ nop
+ stx %g2,[%fp+72]
+ fitod %f0,%f4
+C ---
+ nop
+ nop
+ lduw [%i1+8],%g4
+ fitod %f1,%f6
+C ---
+ nop
+ nop
+ ldx [%fp-40],%g2 C p16
+ fanop
+C ---
+ nop
+ nop
+ ldx [%fp-32],%g1 C p0
+ fmuld %f2,%f4,%f4
+C ---
+ sllx %g2,16,%g2 C align p16
+ add %i0,8,%i0 C res_ptr++
+ ld [%i1],%f9
+ fmuld %f2,%f6,%f6
+C ---
+ add %g2,%g1,%g1 C add p16 to p0 (ADD1)
+ add %i1,4,%i1 C s1_ptr++
+ ldd [%fp+80],%f0
+ fanop
+C ---
+ srlx %g1,32,%l0
+ nop
+ stw %g1,[%i0-8]
+ fdtox %f4,%f4
+C ---
+ sllx %g4,16,%g3 C 0000hhhhllll0000
+ nop
+ stw %l0,[%i0-4]
+ fdtox %f6,%f6
+C ---
+ or %g3,%g4,%g2 C 0000hhhhXXXXllll
+ subcc %i2,1,%i2
+ std %f4,[%fp-40]
+ fxtod %f8,%f2
+C ---
+ std %f6,[%fp-32]
+ andn %g2,%g5,%g2 C 0000hhhh0000llll
+ bne,pt %icc,.Loop
+ fanop
+C --- LOOP END
+
+.L5: add %fp, 80, %l3
+ add %fp, -24, %l4
+ add %fp, 72, %l5
+ b .Ltail
+ add %fp, -40, %l6
+
+.Lend: add %fp, 72, %l3
+ add %fp, -40, %l4
+ add %fp, 80, %l5
+ add %fp, -24, %l6
+.Ltail: stx %g2,[%l3]
+ fitod %f0,%f4
+ fitod %f1,%f6
+ ldx [%l4],%g2 C p16
+ ldx [%l4+8],%g1 C p0
+ fmuld %f2,%f4,%f4
+ sllx %g2,16,%g2 C align p16
+ add %i0,8,%i0 C res_ptr++
+ ld [%i1],%f9
+ fmuld %f2,%f6,%f6
+ add %g2,%g1,%g1 C add p16 to p0 (ADD1)
+ add %i1,4,%i1 C s1_ptr++
+ ldd [%l5],%f0
+ srlx %g1,32,%l0
+ stw %g1,[%i0-8]
+ fdtox %f4,%f4
+ stw %l0,[%i0-4]
+.L4: fdtox %f6,%f6
+ std %f4,[%l4]
+ fxtod %f8,%f2
+ std %f6,[%l4+8]
+
+ fitod %f0,%f4
+ fitod %f1,%f6
+ ldx [%l6],%g2 C p16
+ ldx [%l6+8],%g1 C p0
+ fmuld %f2,%f4,%f4
+ sllx %g2,16,%g2 C align p16
+ add %i0,8,%i0 C res_ptr++
+ ld [%i1],%f9
+ fmuld %f2,%f6,%f6
+ add %g2,%g1,%g1 C add p16 to p0 (ADD1)
+ ldd [%l3],%f0
+ srlx %g1,32,%l0
+ stw %g1,[%i0-8]
+ fdtox %f4,%f4
+ stw %l0,[%i0-4]
+.L3: fdtox %f6,%f6
+ std %f4,[%l6]
+ fxtod %f8,%f2
+ std %f6,[%l6+8]
+
+ fitod %f0,%f4
+ fitod %f1,%f6
+ ldx [%l4],%g2 C p16
+ ldx [%l4+8],%g1 C p0
+ fmuld %f2,%f4,%f4
+ sllx %g2,16,%g2 C align p16
+ add %i0,8,%i0 C res_ptr++
+ fmuld %f2,%f6,%f6
+ add %g2,%g1,%g1 C add p16 to p0 (ADD1)
+ srlx %g1,32,%l0
+ stw %g1,[%i0-8]
+ fdtox %f4,%f4
+ stw %l0,[%i0-4]
+.L2: fdtox %f6,%f6
+ std %f4,[%l4]
+ std %f6,[%l4+8]
+
+ ldx [%l6],%g2 C p16
+ ldx [%l6+8],%g1 C p0
+ sllx %g2,16,%g2 C align p16
+ add %i0,8,%i0 C res_ptr++
+ add %g2,%g1,%g1 C add p16 to p0 (ADD1)
+ srlx %g1,32,%l0
+ stw %g1,[%i0-8]
+ stw %l0,[%i0-4]
+
+.L1: ldx [%l4],%g2 C p16
+ ldx [%l4+8],%g1 C p0
+ sllx %g2,16,%g2 C align p16
+ add %i0,8,%i0 C res_ptr++
+ add %g2,%g1,%g1 C add p16 to p0 (ADD1)
+ srlx %g1,32,%l0
+ stw %g1,[%i0-8]
+ stw %l0,[%i0-4]
+
+ ret
+ restore %g0,%g0,%o0
+
+EPILOGUE(mpn_sqr_diagonal)
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc32/v9/sub_n.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc32/v9/sub_n.asm
new file mode 100644
index 00000000000..636c73bf35c
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc32/v9/sub_n.asm
@@ -0,0 +1,129 @@
+dnl SPARC mpn_sub_n -- Subtract two limb vectors of the same length > 0 and
+dnl store difference in a third limb vector.
+
+dnl Copyright 2001 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,%o0)
+define(s1p,%o1)
+define(s2p,%o2)
+define(n,%o3)
+define(cy,%g1)
+
+C This code uses 64-bit operations on `o' and `g' registers. It doesn't
+C require that `o' registers' upper 32 bits are preserved by the operating
+C system, but if they are not, they must be zeroed. That is indeed what
+C happens at least on Slowaris 2.5 and 2.6.
+
+C On UltraSPARC 1 and 2, this code runs at 3 cycles/limb from the Dcache and at
+C about 10 cycles/limb from the Ecache.
+
+ASM_START()
+PROLOGUE(mpn_sub_n)
+ lduw [s1p+0],%o4
+ lduw [s2p+0],%o5
+ addcc n,-2,n
+ bl,pn %icc,L(end1)
+ lduw [s1p+4],%g2
+ lduw [s2p+4],%g3
+ be,pn %icc,L(end2)
+ mov 0,cy
+
+ .align 16
+L(loop):
+ sub %o4,%o5,%g4
+ add rp,8,rp
+ lduw [s1p+8],%o4
+ fitod %f0,%f2
+C ---
+ sub %g4,cy,%g4
+ addcc n,-1,n
+ lduw [s2p+8],%o5
+ fitod %f0,%f2
+C ---
+ srlx %g4,63,cy
+ add s2p,8,s2p
+ stw %g4,[rp-8]
+ be,pn %icc,L(exito)+4
+C ---
+ sub %g2,%g3,%g4
+ addcc n,-1,n
+ lduw [s1p+12],%g2
+ fitod %f0,%f2
+C ---
+ sub %g4,cy,%g4
+ add s1p,8,s1p
+ lduw [s2p+4],%g3
+ fitod %f0,%f2
+C ---
+ srlx %g4,63,cy
+ bne,pt %icc,L(loop)
+ stw %g4,[rp-4]
+C ---
+L(exite):
+ sub %o4,%o5,%g4
+ sub %g4,cy,%g4
+ srlx %g4,63,cy
+ stw %g4,[rp+0]
+ sub %g2,%g3,%g4
+ sub %g4,cy,%g4
+ stw %g4,[rp+4]
+ retl
+ srlx %g4,63,%o0
+
+L(exito):
+ sub %g2,%g3,%g4
+ sub %g4,cy,%g4
+ srlx %g4,63,cy
+ stw %g4,[rp-4]
+ sub %o4,%o5,%g4
+ sub %g4,cy,%g4
+ stw %g4,[rp+0]
+ retl
+ srlx %g4,63,%o0
+
+L(end1):
+ sub %o4,%o5,%g4
+ stw %g4,[rp+0]
+ retl
+ srlx %g4,63,%o0
+
+L(end2):
+ sub %o4,%o5,%g4
+ srlx %g4,63,cy
+ stw %g4,[rp+0]
+ sub %g2,%g3,%g4
+ sub %g4,cy,%g4
+ stw %g4,[rp+4]
+ retl
+ srlx %g4,63,%o0
+EPILOGUE(mpn_sub_n)
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc32/v9/submul_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc32/v9/submul_1.asm
new file mode 100644
index 00000000000..92d0ce7db9e
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc32/v9/submul_1.asm
@@ -0,0 +1,316 @@
+dnl SPARC v9 32-bit mpn_submul_1 -- Multiply a limb vector with a limb and
+dnl subtract the result from a second limb vector.
+
+dnl Copyright 1998, 2000, 2001, 2003 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 Algorithm: We use two floating-point multiplies per limb product, with the
+C invariant v operand split into two 16-bit pieces, and the u operand split
+C into 32-bit pieces. We convert the two 48-bit products and transfer them to
+C the integer unit.
+
+C cycles/limb
+C UltraSPARC 1&2: 6.5
+C UltraSPARC 3: ?
+
+C Possible optimizations:
+C 1. Combine 32-bit memory operations into 64-bit operations. Since we're
+C memory bandwidth limited, this could save 1.5 cycles/limb.
+C 2. Unroll the inner loop. Since we already use alternate temporary areas,
+C it is very straightforward to unroll, using an exit branch midways.
+C Unrolling would allow deeper scheduling which could improve speed for L2
+C cache case.
+C 3. For mpn_mul_1: Use more alternating temp areas. The std'es and ldx'es
+C aren't sufficiently apart-scheduled with just two temp areas.
+C 4. Specialize for particular v values. If its upper 16 bits are zero, we
+C could save many operations.
+
+C INPUT PARAMETERS
+C rp i0
+C up i1
+C n i2
+C v i3
+
+define(`FSIZE',224)
+
+ASM_START()
+PROLOGUE(mpn_submul_1)
+ add %sp, -FSIZE, %sp
+ sethi %hi(0xffff), %g1
+ srl %o3, 16, %g2
+ or %g1, %lo(0xffff), %g1
+ and %o3, %g1, %g1
+ stx %g1, [%sp+104]
+ stx %g2, [%sp+112]
+ ldd [%sp+104], %f6
+ ldd [%sp+112], %f8
+ fxtod %f6, %f6
+ fxtod %f8, %f8
+ ld [%sp+104], %f10 C zero f10
+
+ mov 0, %g3 C cy = 0
+
+define(`fanop', `fitod %f18, %f0') C A quasi nop running in the FA pipe
+
+ add %sp, 160, %o5 C point in scratch area
+ and %o5, -32, %o5 C align at 0 (mod 32) in scratch area
+
+ subcc %o2, 1, %o2
+ ld [%o1], %f11 C read up[i]
+ add %o1, 4, %o1 C up++
+ bne,pt %icc, .L_two_or_more
+ fxtod %f10, %f2
+
+ fmuld %f2, %f8, %f16
+ fmuld %f2, %f6, %f4
+ fdtox %f16, %f14
+ fdtox %f4, %f12
+ std %f14, [%o5+16]
+ std %f12, [%o5+24]
+ ldx [%o5+16], %g2 C p16
+ ldx [%o5+24], %g1 C p0
+ lduw [%o0], %g5 C read rp[i]
+ b .L1
+ add %o0, -16, %o0
+
+ .align 16
+.L_two_or_more:
+ subcc %o2, 1, %o2
+ ld [%o1], %f11 C read up[i]
+ fmuld %f2, %f8, %f16
+ fmuld %f2, %f6, %f4
+ add %o1, 4, %o1 C up++
+ bne,pt %icc, .L_three_or_more
+ fxtod %f10, %f2
+
+ fdtox %f16, %f14
+ fdtox %f4, %f12
+ std %f14, [%o5+16]
+ fmuld %f2, %f8, %f16
+ std %f12, [%o5+24]
+ fmuld %f2, %f6, %f4
+ fdtox %f16, %f14
+ fdtox %f4, %f12
+ std %f14, [%o5+0]
+ std %f12, [%o5+8]
+ lduw [%o0], %g5 C read rp[i]
+ ldx [%o5+16], %g2 C p16
+ ldx [%o5+24], %g1 C p0
+ b .L2
+ add %o0, -12, %o0
+
+ .align 16
+.L_three_or_more:
+ subcc %o2, 1, %o2
+ ld [%o1], %f11 C read up[i]
+ fdtox %f16, %f14
+ fdtox %f4, %f12
+ std %f14, [%o5+16]
+ fmuld %f2, %f8, %f16
+ std %f12, [%o5+24]
+ fmuld %f2, %f6, %f4
+ add %o1, 4, %o1 C up++
+ bne,pt %icc, .L_four_or_more
+ fxtod %f10, %f2
+
+ fdtox %f16, %f14
+ fdtox %f4, %f12
+ std %f14, [%o5+0]
+ fmuld %f2, %f8, %f16
+ std %f12, [%o5+8]
+ fmuld %f2, %f6, %f4
+ fdtox %f16, %f14
+ ldx [%o5+16], %g2 C p16
+ fdtox %f4, %f12
+ ldx [%o5+24], %g1 C p0
+ std %f14, [%o5+16]
+ std %f12, [%o5+24]
+ lduw [%o0], %g5 C read rp[i]
+ b .L3
+ add %o0, -8, %o0
+
+ .align 16
+.L_four_or_more:
+ subcc %o2, 1, %o2
+ ld [%o1], %f11 C read up[i]
+ fdtox %f16, %f14
+ fdtox %f4, %f12
+ std %f14, [%o5+0]
+ fmuld %f2, %f8, %f16
+ std %f12, [%o5+8]
+ fmuld %f2, %f6, %f4
+ add %o1, 4, %o1 C up++
+ bne,pt %icc, .L_five_or_more
+ fxtod %f10, %f2
+
+ fdtox %f16, %f14
+ ldx [%o5+16], %g2 C p16
+ fdtox %f4, %f12
+ ldx [%o5+24], %g1 C p0
+ std %f14, [%o5+16]
+ fmuld %f2, %f8, %f16
+ std %f12, [%o5+24]
+ fmuld %f2, %f6, %f4
+ add %o1, 4, %o1 C up++
+ lduw [%o0], %g5 C read rp[i]
+ b .L4
+ add %o0, -4, %o0
+
+ .align 16
+.L_five_or_more:
+ subcc %o2, 1, %o2
+ ld [%o1], %f11 C read up[i]
+ fdtox %f16, %f14
+ ldx [%o5+16], %g2 C p16
+ fdtox %f4, %f12
+ ldx [%o5+24], %g1 C p0
+ std %f14, [%o5+16]
+ fmuld %f2, %f8, %f16
+ std %f12, [%o5+24]
+ fmuld %f2, %f6, %f4
+ add %o1, 4, %o1 C up++
+ lduw [%o0], %g5 C read rp[i]
+ bne,pt %icc, .Loop
+ fxtod %f10, %f2
+ b,a .L5
+
+C BEGIN MAIN LOOP
+ .align 16
+C -- 0
+.Loop: sub %g0, %g3, %g3
+ subcc %o2, 1, %o2
+ ld [%o1], %f11 C read up[i]
+ fdtox %f16, %f14
+C -- 1
+ sllx %g2, 16, %g4 C (p16 << 16)
+ add %o0, 4, %o0 C rp++
+ ldx [%o5+0], %g2 C p16
+ fdtox %f4, %f12
+C -- 2
+ srl %g3, 0, %g3 C zero most significant 32 bits
+ add %g1, %g4, %g4 C p = p0 + (p16 << 16)
+ ldx [%o5+8], %g1 C p0
+ fanop
+C -- 3
+ nop
+ add %g3, %g4, %g4 C p += cy
+ std %f14, [%o5+0]
+ fmuld %f2, %f8, %f16
+C -- 4
+ nop
+ sub %g5, %g4, %g4 C p += rp[i]
+ std %f12, [%o5+8]
+ fmuld %f2, %f6, %f4
+C -- 5
+ xor %o5, 16, %o5 C alternate scratch variables
+ add %o1, 4, %o1 C up++
+ stw %g4, [%o0-4]
+ fanop
+C -- 6
+ srlx %g4, 32, %g3 C new cy
+ lduw [%o0], %g5 C read rp[i]
+ bne,pt %icc, .Loop
+ fxtod %f10, %f2
+C END MAIN LOOP
+
+.L5: sub %g0, %g3, %g3
+ fdtox %f16, %f14
+ sllx %g2, 16, %g4 C (p16 << 16)
+ ldx [%o5+0], %g2 C p16
+ fdtox %f4, %f12
+ srl %g3, 0, %g3 C zero most significant 32 bits
+ add %g1, %g4, %g4 C p = p0 + (p16 << 16)
+ ldx [%o5+8], %g1 C p0
+ add %g4, %g3, %g4 C p += cy
+ std %f14, [%o5+0]
+ fmuld %f2, %f8, %f16
+ sub %g5, %g4, %g4 C p += rp[i]
+ std %f12, [%o5+8]
+ fmuld %f2, %f6, %f4
+ xor %o5, 16, %o5
+ stw %g4, [%o0+0]
+ srlx %g4, 32, %g3 C new cy
+ lduw [%o0+4], %g5 C read rp[i]
+
+ sub %g0, %g3, %g3
+.L4: fdtox %f16, %f14
+ sllx %g2, 16, %g4 C (p16 << 16)
+ ldx [%o5+0], %g2 C p16
+ fdtox %f4, %f12
+ srl %g3, 0, %g3 C zero most significant 32 bits
+ add %g1, %g4, %g4 C p = p0 + (p16 << 16)
+ ldx [%o5+8], %g1 C p0
+ add %g3, %g4, %g4 C p += cy
+ std %f14, [%o5+0]
+ sub %g5, %g4, %g4 C p += rp[i]
+ std %f12, [%o5+8]
+ xor %o5, 16, %o5
+ stw %g4, [%o0+4]
+ srlx %g4, 32, %g3 C new cy
+ lduw [%o0+8], %g5 C read rp[i]
+
+ sub %g0, %g3, %g3
+.L3: sllx %g2, 16, %g4 C (p16 << 16)
+ ldx [%o5+0], %g2 C p16
+ srl %g3, 0, %g3 C zero most significant 32 bits
+ add %g1, %g4, %g4 C p = p0 + (p16 << 16)
+ ldx [%o5+8], %g1 C p0
+ add %g3, %g4, %g4 C p += cy
+ sub %g5, %g4, %g4 C p += rp[i]
+ xor %o5, 16, %o5
+ stw %g4, [%o0+8]
+ srlx %g4, 32, %g3 C new cy
+ lduw [%o0+12], %g5 C read rp[i]
+
+ sub %g0, %g3, %g3
+.L2: sllx %g2, 16, %g4 C (p16 << 16)
+ ldx [%o5+0], %g2 C p16
+ srl %g3, 0, %g3 C zero most significant 32 bits
+ add %g1, %g4, %g4 C p = p0 + (p16 << 16)
+ ldx [%o5+8], %g1 C p0
+ add %g3, %g4, %g4 C p += cy
+ sub %g5, %g4, %g4 C p += rp[i]
+ stw %g4, [%o0+12]
+ srlx %g4, 32, %g3 C new cy
+ lduw [%o0+16], %g5 C read rp[i]
+
+ sub %g0, %g3, %g3
+.L1: sllx %g2, 16, %g4 C (p16 << 16)
+ srl %g3, 0, %g3 C zero most significant 32 bits
+ add %g1, %g4, %g4 C p = p0 + (p16 << 16)
+ add %g3, %g4, %g4 C p += cy
+ sub %g5, %g4, %g4 C p += rp[i]
+ stw %g4, [%o0+16]
+ srlx %g4, 32, %g3 C new cy
+
+ sub %g0, %g3, %o0
+ retl
+ sub %sp, -FSIZE, %sp
+EPILOGUE(mpn_submul_1)
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc32/v9/udiv.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc32/v9/udiv.asm
new file mode 100644
index 00000000000..61dde97a66e
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc32/v9/udiv.asm
@@ -0,0 +1,52 @@
+dnl SPARC v9 32-bit mpn_udiv_qrnnd - division support for longlong.h.
+
+dnl Copyright 2002, 2003 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 rem_ptr o0
+C n1 o1
+C n0 o2
+C d o3
+
+ASM_START()
+PROLOGUE(mpn_udiv_qrnnd)
+ sllx %o1, 32, %g1 C shift upper dividend limb
+ srl %o2, 0, %g2 C zero extend lower dividend limb
+ srl %o3, 0, %g3 C zero extend divisor
+ or %g2, %g1, %g1 C assemble 64-bit dividend
+ udivx %g1, %g3, %g1
+ mulx %g1, %g3, %g4
+ sub %g2, %g4, %g2
+ st %g2, [%o0] C store remainder
+ retl
+ mov %g1, %o0 C return quotient
+EPILOGUE(mpn_udiv_qrnnd)
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/README b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/README
new file mode 100644
index 00000000000..e2c051a02b8
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/README
@@ -0,0 +1,125 @@
+Copyright 1997, 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/.
+
+
+
+
+
+This directory contains mpn functions for 64-bit V9 SPARC
+
+RELEVANT OPTIMIZATION ISSUES
+
+Notation:
+ IANY = shift/add/sub/logical/sethi
+ IADDLOG = add/sub/logical/sethi
+ MEM = ld*/st*
+ FA = fadd*/fsub*/f*to*/fmov*
+ FM = fmul*
+
+UltraSPARC can issue four instructions per cycle, with these restrictions:
+* Two IANY instructions, but only one of these may be a shift. If there is a
+ shift and an IANY instruction, the shift must precede the IANY instruction.
+* One FA.
+* One FM.
+* One branch.
+* One MEM.
+* IANY/IADDLOG/MEM must be insn 1, 2, or 3 in an issue bundle. Taken branches
+ should not be in slot 4, since that makes the delay insn come from separate
+ bundle.
+* If two IANY/IADDLOG instructions are to be executed in the same cycle and one
+ of these is setting the condition codes, that instruction must be the second
+ one.
+
+To summarize, ignoring branches, these are the bundles that can reach the peak
+execution speed:
+
+insn1 iany iany mem iany iany mem iany iany mem
+insn2 iaddlog mem iany mem iaddlog iany mem iaddlog iany
+insn3 mem iaddlog iaddlog fa fa fa fm fm fm
+insn4 fa/fm fa/fm fa/fm fm fm fm fa fa fa
+
+The 64-bit integer multiply instruction mulx takes from 5 cycles to 35 cycles,
+depending on the position of the most significant bit of the first source
+operand. When used for 32x32->64 multiplication, it needs 20 cycles.
+Furthermore, it stalls the processor while executing. We stay away from that
+instruction, and instead use floating-point operations.
+
+Floating-point add and multiply units are fully pipelined. The latency for
+UltraSPARC-1/2 is 3 cycles and for UltraSPARC-3 it is 4 cycles.
+
+Integer conditional move instructions cannot dual-issue with other integer
+instructions. No conditional move can issue 1-5 cycles after a load. (This
+might have been fixed for UltraSPARC-3.)
+
+The UltraSPARC-3 pipeline is very simular to the one of UltraSPARC-1/2 , but is
+somewhat slower. Branches execute slower, and there may be other new stalls.
+But integer multiply doesn't stall the entire CPU and also has a much lower
+latency. But it's still not pipelined, and thus useless for our needs.
+
+STATUS
+
+* mpn_lshift, mpn_rshift: The current code runs at 2.0 cycles/limb on
+ UltraSPARC-1/2 and 2.65 on UltraSPARC-3. For UltraSPARC-1/2, the IEU0
+ functional unit is saturated with shifts.
+
+* mpn_add_n, mpn_sub_n: The current code runs at 4 cycles/limb on
+ UltraSPARC-1/2 and 4.5 cycles/limb on UltraSPARC-3. The 4 instruction
+ recurrency is the speed limiter.
+
+* mpn_addmul_1: The current code runs at 14 cycles/limb asymptotically on
+ UltraSPARC-1/2 and 17.5 cycles/limb on UltraSPARC-3. On UltraSPARC-1/2, the
+ code sustains 4 instructions/cycle. It might be possible to invent a better
+ way of summing the intermediate 49-bit operands, but it is unlikely that it
+ will save enough instructions to save an entire cycle.
+
+ The load-use of the u operand is not enough scheduled for good L2 cache
+ performance. The UltraSPARC-1/2 L1 cache is direct mapped, and since we use
+ temporary stack slots that will conflict with the u and r operands, we miss
+ to L2 very often. The load-use of the std/ldx pairs via the stack are
+ perhaps over-scheduled.
+
+ It would be possible to save two instructions: (1) The mov could be avoided
+ if the std/ldx were less scheduled. (2) The ldx of the r operand could be
+ split into two ld instructions, saving the shifts/masks.
+
+ It should be possible to reach 14 cycles/limb for UltraSPARC-3 if the fp
+ operations where rescheduled for this processor's 4-cycle latency.
+
+* mpn_mul_1: The current code is a straightforward edit of the mpn_addmul_1
+ code. It would be possible to shave one or two cycles from it, with some
+ labour.
+
+* mpn_submul_1: Simpleminded code just calling mpn_mul_1 + mpn_sub_n. This
+ means that it runs at 18 cycles/limb on UltraSPARC-1/2 and 23 cycles/limb on
+ UltraSPARC-3. It would be possible to either match the mpn_addmul_1
+ performance, or in the worst case use one more instruction group.
+
+* US1/US2 cache conflict resolving. The direct mapped L1 date cache of US1/US2
+ is a problem for mul_1, addmul_1 (and a prospective submul_1). We should
+ allocate a larger cache area, and put the stack temp area in a place that
+ doesn't cause cache conflicts.
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/copyd.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/copyd.asm
new file mode 100644
index 00000000000..ab105d39c78
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/copyd.asm
@@ -0,0 +1,89 @@
+dnl SPARC v9 mpn_copyd -- Copy a limb vector, decrementing.
+
+dnl Copyright 1999-2003 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 1&2: 2
+C UltraSPARC 3: 2.5
+C UltraSPARC T1: 17
+C UltraSPARC T3: 6
+C UltraSPARC T4/T5: 2
+
+C INPUT PARAMETERS
+C rptr %o0
+C sptr %o1
+C n %o2
+
+ASM_START()
+ REGISTER(%g2,#scratch)
+ REGISTER(%g3,#scratch)
+PROLOGUE(mpn_copyd)
+ sllx %o2,3,%g1
+ add %g1,%o0,%o0
+ add %g1,%o1,%o1
+ addcc %o2,-8,%o2
+ bl,pt %xcc,L(end01234567)
+ nop
+L(loop1):
+ ldx [%o1-8],%g1
+ ldx [%o1-16],%g2
+ ldx [%o1-24],%g3
+ ldx [%o1-32],%g4
+ ldx [%o1-40],%g5
+ ldx [%o1-48],%o3
+ ldx [%o1-56],%o4
+ ldx [%o1-64],%o5
+ add %o1,-64,%o1
+ stx %g1,[%o0-8]
+ stx %g2,[%o0-16]
+ stx %g3,[%o0-24]
+ stx %g4,[%o0-32]
+ stx %g5,[%o0-40]
+ stx %o3,[%o0-48]
+ stx %o4,[%o0-56]
+ stx %o5,[%o0-64]
+ addcc %o2,-8,%o2
+ bge,pt %xcc,L(loop1)
+ add %o0,-64,%o0
+L(end01234567):
+ addcc %o2,8,%o2
+ bz,pn %xcc,L(end)
+ nop
+L(loop2):
+ ldx [%o1-8],%g1
+ add %o1,-8,%o1
+ addcc %o2,-1,%o2
+ stx %g1,[%o0-8]
+ bg,pt %xcc,L(loop2)
+ add %o0,-8,%o0
+L(end): retl
+ nop
+EPILOGUE(mpn_copyd)
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/copyi.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/copyi.asm
new file mode 100644
index 00000000000..45663dc2a35
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/copyi.asm
@@ -0,0 +1,86 @@
+dnl SPARC v9 mpn_copyi -- Copy a limb vector, incrementing.
+
+dnl Copyright 1999-2003 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 1&2: 2
+C UltraSPARC 3: 2.5
+C UltraSPARC T1: 17
+C UltraSPARC T3: 6
+C UltraSPARC T4/T5: 2
+
+C INPUT PARAMETERS
+C rptr %o0
+C sptr %o1
+C n %o2
+
+ASM_START()
+ REGISTER(%g2,#scratch)
+ REGISTER(%g3,#scratch)
+PROLOGUE(mpn_copyi)
+ addcc %o2,-8,%o2
+ bl,pt %xcc,L(end01234567)
+ nop
+L(loop1):
+ ldx [%o1+0],%g1
+ ldx [%o1+8],%g2
+ ldx [%o1+16],%g3
+ ldx [%o1+24],%g4
+ ldx [%o1+32],%g5
+ ldx [%o1+40],%o3
+ ldx [%o1+48],%o4
+ ldx [%o1+56],%o5
+ add %o1,64,%o1
+ stx %g1,[%o0+0]
+ stx %g2,[%o0+8]
+ stx %g3,[%o0+16]
+ stx %g4,[%o0+24]
+ stx %g5,[%o0+32]
+ stx %o3,[%o0+40]
+ stx %o4,[%o0+48]
+ stx %o5,[%o0+56]
+ addcc %o2,-8,%o2
+ bge,pt %xcc,L(loop1)
+ add %o0,64,%o0
+L(end01234567):
+ addcc %o2,8,%o2
+ bz,pn %xcc,L(end)
+ nop
+L(loop2):
+ ldx [%o1+0],%g1
+ add %o1,8,%o1
+ addcc %o2,-1,%o2
+ stx %g1,[%o0+0]
+ bg,pt %xcc,L(loop2)
+ add %o0,8,%o0
+L(end): retl
+ nop
+EPILOGUE(mpn_copyi)
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/dive_1.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/dive_1.c
new file mode 100644
index 00000000000..c3fbf01b14c
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/dive_1.c
@@ -0,0 +1,158 @@
+/* UltraSPARC 64 mpn_divexact_1 -- mpn by limb exact division.
+
+ 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 2000, 2001, 2003 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.h"
+#include "gmp-impl.h"
+#include "longlong.h"
+
+#include "mpn/sparc64/sparc64.h"
+
+
+/* 64-bit divisor 32-bit divisor
+ cycles/limb cycles/limb
+ (approx) (approx)
+ Ultrasparc 2i: 110 70
+*/
+
+
+/* There are two key ideas here to reduce mulx's. Firstly when the divisor
+ is 32-bits the high of q*d can be calculated without the two 32x32->64
+ cross-products involving the high 32-bits of the divisor, that being zero
+ of course. Secondly umul_ppmm_lowequal and umul_ppmm_half_lowequal save
+ one mulx (each) knowing the low of q*d is equal to the input limb l.
+
+ For size==1, a simple udivx is used. This is faster than calculating an
+ inverse.
+
+ For a 32-bit divisor and small sizes, an attempt was made at a simple
+ udivx loop (two per 64-bit limb), but it turned out to be slower than
+ mul-by-inverse. At size==2 the inverse is about 260 cycles total
+ compared to a udivx at 291. Perhaps the latter would suit when size==2
+ but the high 32-bits of the second limb is zero (saving one udivx), but
+ it doesn't seem worth a special case just for that. */
+
+void
+mpn_divexact_1 (mp_ptr dst, mp_srcptr src, mp_size_t size, mp_limb_t divisor)
+{
+ mp_limb_t inverse, s, s_next, c, l, ls, q;
+ unsigned rshift, lshift;
+ mp_limb_t lshift_mask;
+ mp_limb_t divisor_h;
+
+ ASSERT (size >= 1);
+ ASSERT (divisor != 0);
+ ASSERT (MPN_SAME_OR_SEPARATE_P (dst, src, size));
+ ASSERT_MPN (src, size);
+ ASSERT_LIMB (divisor);
+
+ s = *src++; /* src low limb */
+ size--;
+ if (size == 0)
+ {
+ *dst = s / divisor;
+ return;
+ }
+
+ if ((divisor & 1) == 0)
+ {
+ count_trailing_zeros (rshift, divisor);
+ divisor >>= rshift;
+ }
+ else
+ rshift = 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);
+
+ if (divisor_h == 0)
+ {
+ /* 32-bit divisor */
+ do
+ {
+ s_next = *src++;
+ ls = (s >> rshift) | ((s_next << lshift) & lshift_mask);
+ s = s_next;
+
+ SUBC_LIMB (c, l, ls, c);
+
+ q = l * inverse;
+ *dst++ = q;
+
+ umul_ppmm_half_lowequal (l, q, divisor, l);
+ c += l;
+
+ size--;
+ }
+ while (size != 0);
+
+ ls = s >> rshift;
+ l = ls - c;
+ q = l * inverse;
+ *dst = q;
+ }
+ else
+ {
+ /* 64-bit divisor */
+ mp_limb_t divisor_l = LOW32 (divisor);
+ do
+ {
+ s_next = *src++;
+ ls = (s >> rshift) | ((s_next << lshift) & lshift_mask);
+ s = s_next;
+
+ SUBC_LIMB (c, l, ls, c);
+
+ q = l * inverse;
+ *dst++ = q;
+
+ umul_ppmm_lowequal (l, q, divisor, divisor_h, divisor_l, l);
+ c += l;
+
+ size--;
+ }
+ while (size != 0);
+
+ ls = s >> rshift;
+ l = ls - c;
+ q = l * inverse;
+ *dst = q;
+ }
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/divrem_1.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/divrem_1.c
new file mode 100644
index 00000000000..531494a94f6
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/divrem_1.c
@@ -0,0 +1,243 @@
+/* UltraSparc 64 mpn_divrem_1 -- mpn by limb division.
+
+Copyright 1991, 1993, 1994, 1996, 1998-2001, 2003 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.h"
+#include "gmp-impl.h"
+#include "longlong.h"
+
+#include "mpn/sparc64/sparc64.h"
+
+
+/* 64-bit divisor 32-bit divisor
+ cycles/limb cycles/limb
+ (approx) (approx)
+ integer fraction integer fraction
+ Ultrasparc 2i: 160 160 122 96
+*/
+
+
+/* 32-bit divisors are treated in special case code. This requires 4 mulx
+ per limb instead of 8 in the general case.
+
+ For big endian systems we need HALF_ENDIAN_ADJ included in the src[i]
+ addressing, to get the two halves of each limb read in the correct order.
+ This is kept in an adj variable. Doing that measures about 4 c/l faster
+ than just writing HALF_ENDIAN_ADJ(i) in the integer loop. The latter
+ shouldn't be 6 cycles worth of work, but perhaps it doesn't schedule well
+ (on gcc 3.2.1 at least). The fraction loop doesn't seem affected, but we
+ still use a variable since that ought to work out best. */
+
+mp_limb_t
+mpn_divrem_1 (mp_ptr qp_limbptr, mp_size_t xsize_limbs,
+ mp_srcptr ap_limbptr, mp_size_t size_limbs, mp_limb_t d_limb)
+{
+ mp_size_t total_size_limbs;
+ mp_size_t i;
+
+ ASSERT (xsize_limbs >= 0);
+ ASSERT (size_limbs >= 0);
+ ASSERT (d_limb != 0);
+ /* FIXME: What's the correct overlap rule when xsize!=0? */
+ ASSERT (MPN_SAME_OR_SEPARATE_P (qp_limbptr + xsize_limbs,
+ ap_limbptr, size_limbs));
+
+ total_size_limbs = size_limbs + xsize_limbs;
+ if (UNLIKELY (total_size_limbs == 0))
+ return 0;
+
+ /* udivx is good for total_size==1, and no need to bother checking
+ limb<divisor, since if that's likely the caller should check */
+ if (UNLIKELY (total_size_limbs == 1))
+ {
+ mp_limb_t a, q;
+ a = (LIKELY (size_limbs != 0) ? ap_limbptr[0] : 0);
+ q = a / d_limb;
+ qp_limbptr[0] = q;
+ return a - q*d_limb;
+ }
+
+ if (d_limb <= CNST_LIMB(0xFFFFFFFF))
+ {
+ mp_size_t size, xsize, total_size, adj;
+ unsigned *qp, n1, n0, q, r, nshift, norm_rmask;
+ mp_limb_t dinv_limb;
+ const unsigned *ap;
+ int norm, norm_rshift;
+
+ size = 2 * size_limbs;
+ xsize = 2 * xsize_limbs;
+ total_size = size + xsize;
+
+ ap = (unsigned *) ap_limbptr;
+ qp = (unsigned *) qp_limbptr;
+
+ qp += xsize;
+ r = 0; /* initial remainder */
+
+ if (LIKELY (size != 0))
+ {
+ n1 = ap[size-1 + HALF_ENDIAN_ADJ(1)];
+
+ /* If the length of the source is uniformly distributed, then
+ there's a 50% chance of the high 32-bits being zero, which we
+ can skip. */
+ if (n1 == 0)
+ {
+ n1 = ap[size-2 + HALF_ENDIAN_ADJ(0)];
+ total_size--;
+ size--;
+ ASSERT (size > 0); /* because always even */
+ qp[size + HALF_ENDIAN_ADJ(1)] = 0;
+ }
+
+ /* Skip a division if high < divisor (high quotient 0). Testing
+ here before before normalizing will still skip as often as
+ possible. */
+ if (n1 < d_limb)
+ {
+ r = n1;
+ size--;
+ qp[size + HALF_ENDIAN_ADJ(size)] = 0;
+ total_size--;
+ if (total_size == 0)
+ return r;
+ }
+ }
+
+ count_leading_zeros_32 (norm, d_limb);
+ norm -= 32;
+ d_limb <<= norm;
+ r <<= norm;
+
+ norm_rshift = 32 - norm;
+ norm_rmask = (norm == 0 ? 0 : 0xFFFFFFFF);
+
+ invert_half_limb (dinv_limb, d_limb);
+
+ if (LIKELY (size != 0))
+ {
+ i = size - 1;
+ adj = HALF_ENDIAN_ADJ (i);
+ n1 = ap[i + adj];
+ adj = -adj;
+ r |= ((n1 >> norm_rshift) & norm_rmask);
+ for ( ; i > 0; i--)
+ {
+ n0 = ap[i-1 + adj];
+ adj = -adj;
+ nshift = (n1 << norm) | ((n0 >> norm_rshift) & norm_rmask);
+ udiv_qrnnd_half_preinv (q, r, r, nshift, d_limb, dinv_limb);
+ qp[i + adj] = q;
+ n1 = n0;
+ }
+ nshift = n1 << norm;
+ udiv_qrnnd_half_preinv (q, r, r, nshift, d_limb, dinv_limb);
+ qp[0 + HALF_ENDIAN_ADJ(0)] = q;
+ }
+ qp -= xsize;
+ adj = HALF_ENDIAN_ADJ (0);
+ for (i = xsize-1; i >= 0; i--)
+ {
+ udiv_qrnnd_half_preinv (q, r, r, 0, d_limb, dinv_limb);
+ adj = -adj;
+ qp[i + adj] = q;
+ }
+
+ return r >> norm;
+ }
+ else
+ {
+ mp_srcptr ap;
+ mp_ptr qp;
+ mp_size_t size, xsize, total_size;
+ mp_limb_t d, n1, n0, q, r, dinv, nshift, norm_rmask;
+ int norm, norm_rshift;
+
+ ap = ap_limbptr;
+ qp = qp_limbptr;
+ size = size_limbs;
+ xsize = xsize_limbs;
+ total_size = total_size_limbs;
+ d = d_limb;
+
+ qp += total_size; /* above high limb */
+ r = 0; /* initial remainder */
+
+ if (LIKELY (size != 0))
+ {
+ /* Skip a division if high < divisor (high quotient 0). Testing
+ here before before normalizing will still skip as often as
+ possible. */
+ n1 = ap[size-1];
+ if (n1 < d)
+ {
+ r = n1;
+ *--qp = 0;
+ total_size--;
+ if (total_size == 0)
+ return r;
+ size--;
+ }
+ }
+
+ count_leading_zeros (norm, d);
+ d <<= norm;
+ r <<= norm;
+
+ norm_rshift = GMP_LIMB_BITS - norm;
+ norm_rmask = (norm == 0 ? 0 : ~CNST_LIMB(0));
+
+ invert_limb (dinv, d);
+
+ if (LIKELY (size != 0))
+ {
+ n1 = ap[size-1];
+ r |= ((n1 >> norm_rshift) & norm_rmask);
+ for (i = size-2; i >= 0; i--)
+ {
+ n0 = ap[i];
+ nshift = (n1 << norm) | ((n0 >> norm_rshift) & norm_rmask);
+ udiv_qrnnd_preinv (q, r, r, nshift, d, dinv);
+ *--qp = q;
+ n1 = n0;
+ }
+ nshift = n1 << norm;
+ udiv_qrnnd_preinv (q, r, r, nshift, d, dinv);
+ *--qp = q;
+ }
+ for (i = 0; i < xsize; i++)
+ {
+ udiv_qrnnd_preinv (q, r, r, CNST_LIMB(0), d, dinv);
+ *--qp = q;
+ }
+ return r >> norm;
+ }
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/gcd_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/gcd_1.asm
new file mode 100644
index 00000000000..e4d8de6a28e
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/gcd_1.asm
@@ -0,0 +1,135 @@
+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()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/gmp-mparam.h b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/gmp-mparam.h
new file mode 100644
index 00000000000..5ac2c461c5e
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/gmp-mparam.h
@@ -0,0 +1,139 @@
+/* Sparc64 gmp-mparam.h -- Compiler/machine parameter header file.
+
+Copyright 1991, 1993, 1994, 1999-2002, 2004, 2006, 2008-2010 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
+
+/* 500 MHz ultrasparc2 running GNU/Linux */
+
+#define DIVREM_1_NORM_THRESHOLD 3
+#define DIVREM_1_UNNORM_THRESHOLD 4
+#define MOD_1_NORM_THRESHOLD 3
+#define MOD_1_UNNORM_THRESHOLD 3
+#define MOD_1N_TO_MOD_1_1_THRESHOLD MP_SIZE_T_MAX /* never */
+#define MOD_1U_TO_MOD_1_1_THRESHOLD 22
+#define MOD_1_1_TO_MOD_1_2_THRESHOLD 0 /* never mpn_mod_1_1p */
+#define MOD_1_2_TO_MOD_1_4_THRESHOLD 27
+#define PREINV_MOD_1_TO_MOD_1_THRESHOLD MP_SIZE_T_MAX /* never */
+#define USE_PREINV_DIVREM_1 1
+#define DIVEXACT_1_THRESHOLD 0 /* always */
+#define BMOD_1_TO_MOD_1_THRESHOLD MP_SIZE_T_MAX /* never */
+
+#define MUL_TOOM22_THRESHOLD 30
+#define MUL_TOOM33_THRESHOLD 187
+#define MUL_TOOM44_THRESHOLD 278
+#define MUL_TOOM6H_THRESHOLD 278
+#define MUL_TOOM8H_THRESHOLD 357
+
+#define MUL_TOOM32_TO_TOOM43_THRESHOLD 201
+#define MUL_TOOM32_TO_TOOM53_THRESHOLD 199
+#define MUL_TOOM42_TO_TOOM53_THRESHOLD 154
+#define MUL_TOOM42_TO_TOOM63_THRESHOLD 107
+
+#define SQR_BASECASE_THRESHOLD 13
+#define SQR_TOOM2_THRESHOLD 69
+#define SQR_TOOM3_THRESHOLD 116
+#define SQR_TOOM4_THRESHOLD 336
+#define SQR_TOOM6_THRESHOLD 336
+#define SQR_TOOM8_THRESHOLD 454
+
+#define MULMOD_BNM1_THRESHOLD 17
+#define SQRMOD_BNM1_THRESHOLD 23
+
+#define MUL_FFT_MODF_THRESHOLD 248 /* k = 5 */
+#define MUL_FFT_TABLE3 \
+ { { 248, 5}, { 9, 4}, { 19, 6}, { 5, 5}, \
+ { 15, 6}, { 8, 5}, { 17, 6}, { 21, 7}, \
+ { 19, 8}, { 11, 7}, { 25, 8}, { 15, 7}, \
+ { 31, 8}, { 27, 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,11}, { 31,10}, { 63, 9}, { 127, 8}, \
+ { 255,10}, { 71, 9}, { 143, 8}, { 287,10}, \
+ { 79,11}, { 47,12}, { 4096,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 50
+#define MUL_FFT_THRESHOLD 1984
+
+#define SQR_FFT_MODF_THRESHOLD 236 /* k = 5 */
+#define SQR_FFT_TABLE3 \
+ { { 236, 5}, { 8, 4}, { 17, 5}, { 19, 6}, \
+ { 10, 5}, { 21, 6}, { 19, 7}, { 10, 6}, \
+ { 21, 7}, { 21, 8}, { 21, 9}, { 11, 8}, \
+ { 23, 9}, { 19, 8}, { 43, 9}, { 23,10}, \
+ { 15, 9}, { 43,10}, { 23,11}, { 15,10}, \
+ { 31, 9}, { 63,10}, { 47, 8}, { 191,11}, \
+ { 31,10}, { 63, 8}, { 255, 7}, { 511, 9}, \
+ { 135, 8}, { 271,10}, { 71, 9}, { 143, 8}, \
+ { 287, 7}, { 575,11}, { 47, 9}, { 191, 8}, \
+ { 383,12}, { 4096,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 49
+#define SQR_FFT_THRESHOLD 1120
+
+#define MULLO_BASECASE_THRESHOLD 16
+#define MULLO_DC_THRESHOLD 41
+#define MULLO_MUL_N_THRESHOLD 3791
+
+#define DC_DIV_QR_THRESHOLD 27
+#define DC_DIVAPPR_Q_THRESHOLD 100
+#define DC_BDIV_QR_THRESHOLD 47
+#define DC_BDIV_Q_THRESHOLD 174
+
+#define INV_MULMOD_BNM1_THRESHOLD 58
+#define INV_NEWTON_THRESHOLD 13
+#define INV_APPR_THRESHOLD 9
+
+#define BINV_NEWTON_THRESHOLD 187
+#define REDC_1_TO_REDC_2_THRESHOLD 10
+#define REDC_2_TO_REDC_N_THRESHOLD 115
+
+#define MU_DIV_QR_THRESHOLD 680
+#define MU_DIVAPPR_Q_THRESHOLD 618
+#define MUPI_DIV_QR_THRESHOLD 0 /* always */
+#define MU_BDIV_QR_THRESHOLD 748
+#define MU_BDIV_Q_THRESHOLD 889
+
+#define MATRIX22_STRASSEN_THRESHOLD 13
+#define HGCD_THRESHOLD 53
+#define GCD_DC_THRESHOLD 283
+#define GCDEXT_DC_THRESHOLD 186
+#define JACOBI_BASE_METHOD 2
+
+#define GET_STR_DC_THRESHOLD 13
+#define GET_STR_PRECOMPUTE_THRESHOLD 16
+#define SET_STR_DC_THRESHOLD 390
+#define SET_STR_PRECOMPUTE_THRESHOLD 1665
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/lshift.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/lshift.asm
new file mode 100644
index 00000000000..90bbb454f0c
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/lshift.asm
@@ -0,0 +1,140 @@
+dnl SPARC v9 mpn_lshift
+
+dnl Contributed to the GNU project by David Miller.
+
+dnl Copyright 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/limb
+C UltraSPARC 1&2: 2
+C UltraSPARC 3: 2.5
+C UltraSPARC T1: 17.5
+C UltraSPARC T3: 8
+C UltraSPARC T4: 3
+
+C INPUT PARAMETERS
+define(`rp', `%i0')
+define(`up', `%i1')
+define(`n', `%i2')
+define(`cnt', `%i3')
+
+define(`tcnt', `%i4')
+define(`retval', `%i5')
+define(`u0', `%l0')
+define(`u1', `%l1')
+define(`r0', `%l6')
+define(`r1', `%l7')
+define(`u0_off', `%o0')
+define(`u1_off', `%o1')
+define(`r0_off', `%o2')
+define(`r1_off', `%o3')
+
+ASM_START()
+ REGISTER(%g2,#scratch)
+ REGISTER(%g3,#scratch)
+PROLOGUE(mpn_lshift)
+ save %sp, -176, %sp
+
+ sllx n, 3, n
+ sub %g0, cnt, tcnt
+
+ sub up, 8, u1_off
+ add rp, (5 * 8), r1_off
+
+ ldx [n + u1_off], u1 C WAS: up - 8
+ add u1_off, (3 * 8), u1_off
+
+ sub r1_off, 8, r0_off
+ sub u1_off, 8, u0_off
+
+ subcc n, (3 * 8), n
+ srlx u1, tcnt, retval
+
+ bl,pn %xcc, L(end12)
+ sllx u1, cnt, %l3
+
+ ldx [n + u0_off], u0 C WAS: up - 16
+ subcc n, (2 * 8), n
+
+ ldx [n + u1_off], u1 C WAS: up - 24
+
+ bl,pn %xcc, L(end34)
+ srlx u0, tcnt, %l4
+
+ b,a L(top)
+ ALIGN(16)
+L(top):
+ sllx u0, cnt, %l2
+ or %l4, %l3, r0
+
+ ldx [n + u0_off], u0 C WAS: up - 16
+ srlx u1, tcnt, %l5
+
+ stx r0, [n + r0_off] C WAS: rp - 8
+ subcc n, (2 * 8), n
+
+ sllx u1, cnt, %l3
+ or %l2, %l5, r1
+
+ ldx [n + u1_off], u1 C WAS: up - 24
+ srlx u0, tcnt, %l4
+
+ bge,pt %xcc, L(top)
+ stx r1, [n + r1_off] C WAS: rp - 16
+
+L(end34):
+ sllx u0, cnt, %l2
+ or %l4, %l3, r0
+
+ srlx u1, tcnt, %l5
+ stx r0, [n + r0_off] C WAS: rp - 8
+
+ or %l2, %l5, r1
+ sub n, (2 * 8), %o5
+
+ sllx u1, cnt, %l3
+ stx r1, [%o5 + r1_off] C WAS: rp - 16
+
+L(end12):
+ andcc n, 8, %g0
+ bz,pn %xcc, L(done)
+ nop
+
+ ldx [n + u0_off], u1
+ srlx u1, tcnt, %l4
+ or %l4, %l3, r0
+ stx r0, [r0_off - 24]
+ sllx u1, cnt, %l3
+L(done):
+ stx %l3, [r0_off - 32]
+
+ ret
+ restore retval, 0, %o0
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/lshiftc.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/lshiftc.asm
new file mode 100644
index 00000000000..4a0f0a3e40c
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/lshiftc.asm
@@ -0,0 +1,147 @@
+dnl SPARC v9 mpn_lshiftc
+
+dnl Contributed to the GNU project by David Miller.
+
+dnl Copyright 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/limb
+C UltraSPARC 1&2: 3
+C UltraSPARC 3: 3
+C UltraSPARC T1: 17
+C UltraSPARC T3: 10
+C UltraSPARC T4: 3.5
+
+C INPUT PARAMETERS
+define(`rp', `%i0')
+define(`up', `%i1')
+define(`n', `%i2')
+define(`cnt', `%i3')
+
+define(`tcnt', `%i4')
+define(`retval', `%i5')
+define(`u0', `%l0')
+define(`u1', `%l1')
+define(`r0', `%l6')
+define(`r1', `%l7')
+define(`u0_off', `%o0')
+define(`u1_off', `%o1')
+define(`r0_off', `%o2')
+define(`r1_off', `%o3')
+
+ASM_START()
+ REGISTER(%g2,#scratch)
+ REGISTER(%g3,#scratch)
+PROLOGUE(mpn_lshiftc)
+ save %sp, -176, %sp
+
+ sllx n, 3, n
+ sub %g0, cnt, tcnt
+
+ sub up, 8, u1_off
+ add rp, (5 * 8), r1_off
+
+ ldx [n + u1_off], u1 C WAS: up - 8
+ add u1_off, (3 * 8), u1_off
+
+ sub r1_off, 8, r0_off
+ sub u1_off, 8, u0_off
+
+ subcc n, (3 * 8), n
+ srlx u1, tcnt, retval
+
+ bl,pn %xcc, L(end12)
+ sllx u1, cnt, %l3
+
+ ldx [n + u0_off], u0 C WAS: up - 16
+ subcc n, (2 * 8), n
+
+ ldx [n + u1_off], u1 C WAS: up - 24
+
+ bl,pn %xcc, L(end34)
+ srlx u0, tcnt, %l4
+
+ b,a L(top)
+ ALIGN(16)
+L(top):
+ not %l3, %l3
+ sllx u0, cnt, %l2
+
+ andn %l3, %l4, r0
+ ldx [n + u0_off], u0 C WAS: up - 16
+
+ srlx u1, tcnt, %l5
+ stx r0, [n + r0_off] C WAS: rp - 8
+
+ subcc n, (2 * 8), n
+ not %l2, %l2
+
+ sllx u1, cnt, %l3
+ andn %l2, %l5, r1
+
+ ldx [n + u1_off], u1 C WAS: up - 24
+ srlx u0, tcnt, %l4
+
+ bge,pt %xcc, L(top)
+ stx r1, [n + r1_off] C WAS: rp - 16
+
+L(end34):
+ not %l3, %l3
+ sllx u0, cnt, %l2
+
+ andn %l3, %l4, r0
+ srlx u1, tcnt, %l5
+
+ stx r0, [n + r0_off] C WAS: rp - 8
+ not %l2, %l2
+
+ andn %l2, %l5, r1
+ sub n, (2 * 8), %o5
+
+ sllx u1, cnt, %l3
+ stx r1, [%o5 + r1_off] C WAS: rp - 16
+
+L(end12):
+ andcc n, 8, %g0
+ bz %xcc, L(done)+4
+ not %l3, %l3
+
+ ldx [n + u0_off], u1
+ srlx u1, tcnt, %l4
+ andn %l3, %l4, r0
+ stx r0, [r0_off - 24]
+ sllx u1, cnt, %l3
+L(done):
+ not %l3, %l3
+ stx %l3, [r0_off - 32]
+
+ ret
+ restore retval, 0, %o0
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/mod_1.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/mod_1.c
new file mode 100644
index 00000000000..f1c51970d97
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/mod_1.c
@@ -0,0 +1,239 @@
+/* UltraSPARC 64 mpn_mod_1 -- mpn by limb remainder.
+
+Copyright 1991, 1993, 1994, 1999-2001, 2003, 2010 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.h"
+#include "gmp-impl.h"
+#include "longlong.h"
+
+#include "mpn/sparc64/sparc64.h"
+
+
+/* 64-bit divisor 32-bit divisor
+ cycles/limb cycles/limb
+ (approx) (approx)
+ Ultrasparc 2i: 160 120
+*/
+
+
+/* 32-bit divisors are treated in special case code. This requires 4 mulx
+ per limb instead of 8 in the general case.
+
+ For big endian systems we need HALF_ENDIAN_ADJ included in the src[i]
+ addressing, to get the two halves of each limb read in the correct order.
+ This is kept in an adj variable. Doing that measures about 6 c/l faster
+ than just writing HALF_ENDIAN_ADJ(i) in the loop. The latter shouldn't
+ be 6 cycles worth of work, but perhaps it doesn't schedule well (on gcc
+ 3.2.1 at least).
+
+ A simple udivx/umulx loop for the 32-bit case was attempted for small
+ sizes, but at size==2 it was only about the same speed and at size==3 was
+ slower. */
+
+static mp_limb_t
+mpn_mod_1_anynorm (mp_srcptr src_limbptr, mp_size_t size_limbs, mp_limb_t d_limb)
+{
+ int norm, norm_rshift;
+ mp_limb_t src_high_limb;
+ mp_size_t i;
+
+ ASSERT (size_limbs >= 0);
+ ASSERT (d_limb != 0);
+
+ if (UNLIKELY (size_limbs == 0))
+ return 0;
+
+ src_high_limb = src_limbptr[size_limbs-1];
+
+ /* udivx is good for size==1, and no need to bother checking limb<divisor,
+ since if that's likely the caller should check */
+ if (UNLIKELY (size_limbs == 1))
+ return src_high_limb % d_limb;
+
+ if (d_limb <= CNST_LIMB(0xFFFFFFFF))
+ {
+ unsigned *src, n1, n0, r, dummy_q, nshift, norm_rmask;
+ mp_size_t size, adj;
+ mp_limb_t dinv_limb;
+
+ size = 2 * size_limbs; /* halfwords */
+ src = (unsigned *) src_limbptr;
+
+ /* prospective initial remainder, if < d */
+ r = src_high_limb >> 32;
+
+ /* If the length of the source is uniformly distributed, then there's
+ a 50% chance of the high 32-bits being zero, which we can skip. */
+ if (r == 0)
+ {
+ r = (unsigned) src_high_limb;
+ size--;
+ ASSERT (size > 0); /* because always even */
+ }
+
+ /* Skip a division if high < divisor. Having the test here before
+ normalizing will still skip as often as possible. */
+ if (r < d_limb)
+ {
+ size--;
+ ASSERT (size > 0); /* because size==1 handled above */
+ }
+ else
+ r = 0;
+
+ count_leading_zeros_32 (norm, d_limb);
+ norm -= 32;
+ d_limb <<= norm;
+
+ norm_rshift = 32 - norm;
+ norm_rmask = (norm == 0 ? 0 : 0xFFFFFFFF);
+ i = size-1;
+ adj = HALF_ENDIAN_ADJ (i);
+ n1 = src [i + adj];
+ r = (r << norm) | ((n1 >> norm_rshift) & norm_rmask);
+
+ invert_half_limb (dinv_limb, d_limb);
+ adj = -adj;
+
+ for (i--; i >= 0; i--)
+ {
+ n0 = src [i + adj];
+ adj = -adj;
+ nshift = (n1 << norm) | ((n0 >> norm_rshift) & norm_rmask);
+ udiv_qrnnd_half_preinv (dummy_q, r, r, nshift, d_limb, dinv_limb);
+ n1 = n0;
+ }
+
+ /* same as loop, but without n0 */
+ nshift = n1 << norm;
+ udiv_qrnnd_half_preinv (dummy_q, r, r, nshift, d_limb, dinv_limb);
+
+ ASSERT ((r & ((1 << norm) - 1)) == 0);
+ return r >> norm;
+ }
+ else
+ {
+ mp_srcptr src;
+ mp_size_t size;
+ mp_limb_t n1, n0, r, dinv, dummy_q, nshift, norm_rmask;
+
+ src = src_limbptr;
+ size = size_limbs;
+ r = src_high_limb; /* initial remainder */
+
+ /* Skip a division if high < divisor. Having the test here before
+ normalizing will still skip as often as possible. */
+ if (r < d_limb)
+ {
+ size--;
+ ASSERT (size > 0); /* because size==1 handled above */
+ }
+ else
+ r = 0;
+
+ count_leading_zeros (norm, d_limb);
+ d_limb <<= norm;
+
+ norm_rshift = GMP_LIMB_BITS - norm;
+ norm_rmask = (norm == 0 ? 0 : 0xFFFFFFFF);
+
+ src += size;
+ n1 = *--src;
+ r = (r << norm) | ((n1 >> norm_rshift) & norm_rmask);
+
+ invert_limb (dinv, d_limb);
+
+ for (i = size-2; i >= 0; i--)
+ {
+ n0 = *--src;
+ nshift = (n1 << norm) | ((n0 >> norm_rshift) & norm_rmask);
+ udiv_qrnnd_preinv (dummy_q, r, r, nshift, d_limb, dinv);
+ n1 = n0;
+ }
+
+ /* same as loop, but without n0 */
+ nshift = n1 << norm;
+ udiv_qrnnd_preinv (dummy_q, r, r, nshift, d_limb, dinv);
+
+ ASSERT ((r & ((CNST_LIMB(1) << norm) - 1)) == 0);
+ return r >> norm;
+ }
+}
+
+mp_limb_t
+mpn_mod_1 (mp_srcptr ap, mp_size_t n, mp_limb_t b)
+{
+ ASSERT (n >= 0);
+ ASSERT (b != 0);
+
+ /* Should this be handled at all? Rely on callers? Note un==0 is currently
+ required by mpz/fdiv_r_ui.c and possibly other places. */
+ if (n == 0)
+ return 0;
+
+ if (UNLIKELY ((b & GMP_NUMB_HIGHBIT) != 0))
+ {
+ if (BELOW_THRESHOLD (n, MOD_1N_TO_MOD_1_1_THRESHOLD))
+ {
+ return mpn_mod_1_anynorm (ap, n, b);
+ }
+ else
+ {
+ mp_limb_t pre[4];
+ mpn_mod_1_1p_cps (pre, b);
+ return mpn_mod_1_1p (ap, n, b, pre);
+ }
+ }
+ else
+ {
+ if (BELOW_THRESHOLD (n, MOD_1U_TO_MOD_1_1_THRESHOLD))
+ {
+ return mpn_mod_1_anynorm (ap, n, b);
+ }
+ else if (BELOW_THRESHOLD (n, MOD_1_1_TO_MOD_1_2_THRESHOLD))
+ {
+ mp_limb_t pre[4];
+ mpn_mod_1_1p_cps (pre, b);
+ return mpn_mod_1_1p (ap, n, b << pre[1], pre);
+ }
+ else if (BELOW_THRESHOLD (n, MOD_1_2_TO_MOD_1_4_THRESHOLD) || UNLIKELY (b > GMP_NUMB_MASK / 4))
+ {
+ mp_limb_t pre[5];
+ mpn_mod_1s_2p_cps (pre, b);
+ return mpn_mod_1s_2p (ap, n, b << pre[1], pre);
+ }
+ else
+ {
+ mp_limb_t pre[7];
+ mpn_mod_1s_4p_cps (pre, b);
+ return mpn_mod_1s_4p (ap, n, b << pre[1], pre);
+ }
+ }
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/mod_1_4.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/mod_1_4.c
new file mode 100644
index 00000000000..cc1b9484bcc
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/mod_1_4.c
@@ -0,0 +1,236 @@
+/* mpn_mod_1s_4p (ap, n, b, cps)
+ Divide (ap,,n) by b. Return the single-limb remainder.
+ Requires that d < B / 4.
+
+ Contributed to the GNU project by Torbjorn Granlund.
+ Based on a suggestion by Peter L. Montgomery.
+
+ 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 2008-2010 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.h"
+#include "gmp-impl.h"
+#include "longlong.h"
+
+#include "mpn/sparc64/sparc64.h"
+
+void
+mpn_mod_1s_4p_cps (mp_limb_t cps[7], mp_limb_t b)
+{
+ mp_limb_t bi;
+ mp_limb_t B1modb, B2modb, B3modb, B4modb, B5modb;
+ int cnt;
+
+ ASSERT (b <= (~(mp_limb_t) 0) / 4);
+
+ count_leading_zeros (cnt, b);
+
+ b <<= cnt;
+ invert_limb (bi, b);
+
+ cps[0] = bi;
+ cps[1] = cnt;
+
+ B1modb = -b * ((bi >> (GMP_LIMB_BITS-cnt)) | (CNST_LIMB(1) << cnt));
+ ASSERT (B1modb <= b); /* NB: not fully reduced mod b */
+ cps[2] = B1modb >> cnt;
+
+ udiv_rnnd_preinv (B2modb, B1modb, CNST_LIMB(0), b, bi);
+ cps[3] = B2modb >> cnt;
+
+ udiv_rnnd_preinv (B3modb, B2modb, CNST_LIMB(0), b, bi);
+ cps[4] = B3modb >> cnt;
+
+ udiv_rnnd_preinv (B4modb, B3modb, CNST_LIMB(0), b, bi);
+ cps[5] = B4modb >> cnt;
+
+ udiv_rnnd_preinv (B5modb, B4modb, CNST_LIMB(0), b, bi);
+ cps[6] = B5modb >> cnt;
+
+#if WANT_ASSERT
+ {
+ int i;
+ b = cps[2];
+ for (i = 3; i <= 6; i++)
+ {
+ b += cps[i];
+ ASSERT (b >= cps[i]);
+ }
+ }
+#endif
+}
+
+mp_limb_t
+mpn_mod_1s_4p (mp_srcptr ap, mp_size_t n, mp_limb_t b, const mp_limb_t cps[7])
+{
+ mp_limb_t rh, rl, bi, ph, pl, ch, cl, r;
+ mp_limb_t B1modb, B2modb, B3modb, B4modb, B5modb;
+ mp_size_t i;
+ int cnt;
+
+ ASSERT (n >= 1);
+
+ B1modb = cps[2];
+ B2modb = cps[3];
+ B3modb = cps[4];
+ B4modb = cps[5];
+ B5modb = cps[6];
+
+ if ((b >> 32) == 0)
+ {
+ switch (n & 3)
+ {
+ case 0:
+ umul_ppmm_s (ph, pl, ap[n - 3], B1modb);
+ add_ssaaaa (ph, pl, ph, pl, CNST_LIMB(0), ap[n - 4]);
+ umul_ppmm_s (ch, cl, ap[n - 2], B2modb);
+ add_ssaaaa (ph, pl, ph, pl, ch, cl);
+ umul_ppmm_s (rh, rl, ap[n - 1], B3modb);
+ add_ssaaaa (rh, rl, rh, rl, ph, pl);
+ n -= 4;
+ break;
+ case 1:
+ rh = 0;
+ rl = ap[n - 1];
+ n -= 1;
+ break;
+ case 2:
+ rh = ap[n - 1];
+ rl = ap[n - 2];
+ n -= 2;
+ break;
+ case 3:
+ umul_ppmm_s (ph, pl, ap[n - 2], B1modb);
+ add_ssaaaa (ph, pl, ph, pl, CNST_LIMB(0), ap[n - 3]);
+ umul_ppmm_s (rh, rl, ap[n - 1], B2modb);
+ add_ssaaaa (rh, rl, rh, rl, ph, pl);
+ n -= 3;
+ break;
+ }
+
+ for (i = n - 4; i >= 0; i -= 4)
+ {
+ /* rr = ap[i] < B
+ + ap[i+1] * (B mod b) <= (B-1)(b-1)
+ + ap[i+2] * (B^2 mod b) <= (B-1)(b-1)
+ + ap[i+3] * (B^3 mod b) <= (B-1)(b-1)
+ + LO(rr) * (B^4 mod b) <= (B-1)(b-1)
+ + HI(rr) * (B^5 mod b) <= (B-1)(b-1)
+ */
+ umul_ppmm_s (ph, pl, ap[i + 1], B1modb);
+ add_ssaaaa (ph, pl, ph, pl, CNST_LIMB(0), ap[i + 0]);
+
+ umul_ppmm_s (ch, cl, ap[i + 2], B2modb);
+ add_ssaaaa (ph, pl, ph, pl, ch, cl);
+
+ umul_ppmm_s (ch, cl, ap[i + 3], B3modb);
+ add_ssaaaa (ph, pl, ph, pl, ch, cl);
+
+ umul_ppmm_s (ch, cl, rl, B4modb);
+ add_ssaaaa (ph, pl, ph, pl, ch, cl);
+
+ umul_ppmm_s (rh, rl, rh, B5modb);
+ add_ssaaaa (rh, rl, rh, rl, ph, pl);
+ }
+
+ umul_ppmm_s (rh, cl, rh, B1modb);
+ add_ssaaaa (rh, rl, rh, rl, CNST_LIMB(0), cl);
+ }
+ else
+ {
+ switch (n & 3)
+ {
+ case 0:
+ umul_ppmm (ph, pl, ap[n - 3], B1modb);
+ add_ssaaaa (ph, pl, ph, pl, 0, ap[n - 4]);
+ umul_ppmm (ch, cl, ap[n - 2], B2modb);
+ add_ssaaaa (ph, pl, ph, pl, ch, cl);
+ umul_ppmm (rh, rl, ap[n - 1], B3modb);
+ add_ssaaaa (rh, rl, rh, rl, ph, pl);
+ n -= 4;
+ break;
+ case 1:
+ rh = 0;
+ rl = ap[n - 1];
+ n -= 1;
+ break;
+ case 2:
+ rh = ap[n - 1];
+ rl = ap[n - 2];
+ n -= 2;
+ break;
+ case 3:
+ umul_ppmm (ph, pl, ap[n - 2], B1modb);
+ add_ssaaaa (ph, pl, ph, pl, 0, ap[n - 3]);
+ umul_ppmm (rh, rl, ap[n - 1], B2modb);
+ add_ssaaaa (rh, rl, rh, rl, ph, pl);
+ n -= 3;
+ break;
+ }
+
+ for (i = n - 4; i >= 0; i -= 4)
+ {
+ /* rr = ap[i] < B
+ + ap[i+1] * (B mod b) <= (B-1)(b-1)
+ + ap[i+2] * (B^2 mod b) <= (B-1)(b-1)
+ + ap[i+3] * (B^3 mod b) <= (B-1)(b-1)
+ + LO(rr) * (B^4 mod b) <= (B-1)(b-1)
+ + HI(rr) * (B^5 mod b) <= (B-1)(b-1)
+ */
+ umul_ppmm (ph, pl, ap[i + 1], B1modb);
+ add_ssaaaa (ph, pl, ph, pl, 0, ap[i + 0]);
+
+ umul_ppmm (ch, cl, ap[i + 2], B2modb);
+ add_ssaaaa (ph, pl, ph, pl, ch, cl);
+
+ umul_ppmm (ch, cl, ap[i + 3], B3modb);
+ add_ssaaaa (ph, pl, ph, pl, ch, cl);
+
+ umul_ppmm (ch, cl, rl, B4modb);
+ add_ssaaaa (ph, pl, ph, pl, ch, cl);
+
+ umul_ppmm (rh, rl, rh, B5modb);
+ add_ssaaaa (rh, rl, rh, rl, ph, pl);
+ }
+
+ umul_ppmm (rh, cl, rh, B1modb);
+ add_ssaaaa (rh, rl, rh, rl, 0, cl);
+ }
+
+ bi = cps[0];
+ cnt = cps[1];
+
+ r = (rh << cnt) | (rl >> (GMP_LIMB_BITS - cnt));
+ udiv_rnnd_preinv (r, r, rl << cnt, b, bi);
+
+ return r >> cnt;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/mode1o.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/mode1o.c
new file mode 100644
index 00000000000..7c8fc1cf3d8
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/mode1o.c
@@ -0,0 +1,197 @@
+/* UltraSPARC 64 mpn_modexact_1c_odd -- mpn by limb exact style remainder.
+
+ 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 2000-2003 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.h"
+#include "gmp-impl.h"
+#include "longlong.h"
+
+#include "mpn/sparc64/sparc64.h"
+
+
+/* 64-bit divisor 32-bit divisor
+ cycles/limb cycles/limb
+ (approx) (approx)
+ Ultrasparc 2i: ? ?
+*/
+
+
+/* This implementation reduces the number of multiplies done, knowing that
+ on ultrasparc 1 and 2 the mulx instruction stalls the whole chip.
+
+ The key idea is to use the fact that the low limb of q*d equals l, this
+ being the whole purpose of the q calculated. It means there's no need to
+ calculate the lowest 32x32->64 part of the q*d, instead it can be
+ inferred from l and the other three 32x32->64 parts. See sparc64.h for
+ details.
+
+ When d is 32-bits, the same applies, but in this case there's only one
+ other 32x32->64 part (ie. HIGH(q)*d).
+
+ The net effect is that for 64-bit divisor each limb is 4 mulx, or for
+ 32-bit divisor each is 2 mulx.
+
+ Enhancements:
+
+ No doubt this could be done in assembler, if that helped the scheduling,
+ or perhaps guaranteed good code irrespective of the compiler.
+
+ Alternatives:
+
+ It might be possibly to use floating point. The loop is dominated by
+ multiply latency, so not sure if floats would improve that. One
+ possibility would be to take two limbs at a time, with a 128 bit inverse,
+ if there's enough registers, which could effectively use float throughput
+ to reduce total latency across two limbs. */
+
+#define ASSERT_RETVAL(r) \
+ ASSERT (orig_c < d ? r < d : r <= d)
+
+mp_limb_t
+mpn_modexact_1c_odd (mp_srcptr src, mp_size_t size, mp_limb_t d, mp_limb_t orig_c)
+{
+ mp_limb_t c = orig_c;
+ mp_limb_t s, l, q, h, inverse;
+
+ ASSERT (size >= 1);
+ ASSERT (d & 1);
+ ASSERT_MPN (src, size);
+ ASSERT_LIMB (d);
+ ASSERT_LIMB (c);
+
+ /* udivx is faster than 10 or 12 mulx's for one limb via an inverse */
+ if (size == 1)
+ {
+ s = src[0];
+ if (s > c)
+ {
+ l = s-c;
+ h = l % d;
+ if (h != 0)
+ h = d - h;
+ }
+ else
+ {
+ l = c-s;
+ h = l % d;
+ }
+ return h;
+ }
+
+ binvert_limb (inverse, d);
+
+ if (d <= 0xFFFFFFFF)
+ {
+ s = *src++;
+ size--;
+ do
+ {
+ SUBC_LIMB (c, l, s, c);
+ s = *src++;
+ q = l * inverse;
+ umul_ppmm_half_lowequal (h, q, d, l);
+ c += h;
+ size--;
+ }
+ while (size != 0);
+
+ if (s <= d)
+ {
+ /* With high s <= d the final step can be a subtract and addback.
+ If c==0 then the addback will restore to l>=0. If c==d then
+ will get l==d if s==0, but that's ok per the function
+ definition. */
+
+ l = c - s;
+ l += (l > c ? d : 0);
+
+ ASSERT_RETVAL (l);
+ return l;
+ }
+ else
+ {
+ /* Can't skip a divide, just do the loop code once more. */
+ SUBC_LIMB (c, l, s, c);
+ q = l * inverse;
+ umul_ppmm_half_lowequal (h, q, d, l);
+ c += h;
+
+ ASSERT_RETVAL (c);
+ return c;
+ }
+ }
+ else
+ {
+ mp_limb_t dl = LOW32 (d);
+ mp_limb_t dh = HIGH32 (d);
+ long i;
+
+ s = *src++;
+ size--;
+ do
+ {
+ SUBC_LIMB (c, l, s, c);
+ s = *src++;
+ q = l * inverse;
+ umul_ppmm_lowequal (h, q, d, dh, dl, l);
+ c += h;
+ size--;
+ }
+ while (size != 0);
+
+ if (s <= d)
+ {
+ /* With high s <= d the final step can be a subtract and addback.
+ If c==0 then the addback will restore to l>=0. If c==d then
+ will get l==d if s==0, but that's ok per the function
+ definition. */
+
+ l = c - s;
+ l += (l > c ? d : 0);
+
+ ASSERT_RETVAL (l);
+ return l;
+ }
+ else
+ {
+ /* Can't skip a divide, just do the loop code once more. */
+ SUBC_LIMB (c, l, s, c);
+ q = l * inverse;
+ umul_ppmm_lowequal (h, q, d, dh, dl, l);
+ c += h;
+
+ ASSERT_RETVAL (c);
+ return c;
+ }
+ }
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/rshift.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/rshift.asm
new file mode 100644
index 00000000000..3f8e11fee7d
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/rshift.asm
@@ -0,0 +1,142 @@
+dnl SPARC v9 mpn_rshift
+
+dnl Contributed to the GNU project by David Miller.
+
+dnl Copyright 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/limb
+C UltraSPARC 1&2: 2
+C UltraSPARC 3: 2.5
+C UltraSPARC T1: 17.5
+C UltraSPARC T3: 8
+C UltraSPARC T4: 3
+
+C INPUT PARAMETERS
+define(`rp', `%i0')
+define(`up', `%i1')
+define(`n', `%i2')
+define(`cnt', `%i3')
+
+define(`tcnt', `%i4')
+define(`retval', `%i5')
+define(`u0', `%l0')
+define(`u1', `%l1')
+define(`r0', `%l6')
+define(`r1', `%l7')
+define(`u0_off', `%o0')
+define(`u1_off', `%o1')
+define(`r0_off', `%o2')
+define(`r1_off', `%o3')
+
+ASM_START()
+ REGISTER(%g2,#scratch)
+ REGISTER(%g3,#scratch)
+PROLOGUE(mpn_rshift)
+ save %sp, -176, %sp
+
+ sllx n, 3, n
+ sub %g0, cnt, tcnt
+
+ add up, n, up
+ add rp, n, rp
+
+ neg n, n
+ sub up, (2 * 8), u0_off
+ sub rp, (5 * 8), r0_off
+
+ ldx [n + up], u1 C WAS: up + 0
+ sub u0_off, (1 * 8), u1_off
+ sub r0_off, (1 * 8), r1_off
+
+ subcc n, -(3 * 8), n
+ sllx u1, tcnt, retval
+
+ bg,pn %xcc, L(end12)
+ srlx u1, cnt, %l3
+
+ ldx [n + u0_off], u0 C WAS: up + 0
+ subcc n, -(2 * 8), n
+
+ ldx [n + u1_off], u1 C WAS: up + 8
+
+ bg,pn %xcc, L(end34)
+ sllx u0, tcnt, %l4
+
+ b,a L(top)
+ ALIGN(16)
+L(top):
+ srlx u0, cnt, %l2
+ or %l3, %l4, r0
+
+ ldx [n + u0_off], u0 C WAS: up + 0
+ sllx u1, tcnt, %l5
+
+ stx r0, [n + r0_off] C WAS: rp + 0
+ subcc n, -(2 * 8), n
+
+ srlx u1, cnt, %l3
+ or %l2, %l5, r1
+
+ ldx [n + u1_off], u1 C WAS: up + 8
+ sllx u0, tcnt, %l4
+
+ ble,pt %xcc, L(top)
+ stx r1, [n + r1_off] C WAS: rp + 8
+
+L(end34):
+ srlx u0, cnt, %l2
+ or %l3, %l4, r0
+
+ sllx u1, tcnt, %l5
+ stx r0, [n + r0_off] C WAS: rp + 0
+
+ or %l2, %l5, r1
+ sub n, -(2 * 8), %o5
+
+ srlx u1, cnt, %l3
+ stx r1, [%o5 + r1_off] C WAS: rp + 8
+
+L(end12):
+ andcc n, 8, %g0
+ bz,pn %xcc, L(done)
+ nop
+
+ ldx [n + u0_off], u1
+ sllx u1, tcnt, %l4
+ or %l3, %l4, r0
+ stx r0, [r0_off + 24]
+ srlx u1, cnt, %l3
+L(done):
+ stx %l3, [r0_off + 32]
+
+ ret
+ restore retval, 0, %o0
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/sec_tabselect.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/sec_tabselect.asm
new file mode 100644
index 00000000000..22e0dc5ef12
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/sec_tabselect.asm
@@ -0,0 +1,162 @@
+dnl SPARC v9 mpn_sec_tabselect.
+
+dnl Contributed to the GNU project by Torbjörn Granlund and David Miller.
+
+dnl Copyright 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/limb
+C UltraSPARC 1&2: 2 hopefully
+C UltraSPARC 3: 3
+C UltraSPARC T1: 17
+C UltraSPARC T3: ?
+C UltraSPARC T4/T5: 2.25 hopefully
+
+C INPUT PARAMETERS
+define(`rp', `%i0')
+define(`tp', `%i1')
+define(`n', `%i2')
+define(`nents', `%i3')
+define(`which', `%i4')
+
+define(`i', `%g1')
+define(`j', `%g3')
+define(`stride', `%g4')
+define(`tporig', `%g5')
+define(`mask', `%o0')
+
+define(`data0', `%l0')
+define(`data1', `%l1')
+define(`data2', `%l2')
+define(`data3', `%l3')
+define(`t0', `%l4')
+define(`t1', `%l5')
+define(`t2', `%l6')
+define(`t3', `%l7')
+
+ASM_START()
+ REGISTER(%g2,#scratch)
+ REGISTER(%g3,#scratch)
+PROLOGUE(mpn_sec_tabselect)
+ save %sp, -176, %sp
+
+ sllx n, 3, stride
+ sub n, 4, j
+ brlz j, L(outer_end)
+ mov tp, tporig
+
+L(outer_loop):
+ clr data0
+ clr data1
+ clr data2
+ clr data3
+ mov tporig, tp
+ mov nents, i
+ mov which, %o1
+
+L(top): subcc %o1, 1, %o1 C set carry iff o1 = 0
+ ldx [tp + 0], t0
+ subc %g0, %g0, mask
+ ldx [tp + 8], t1
+ sub i, 1, i
+ ldx [tp + 16], t2
+ ldx [tp + 24], t3
+ add tp, stride, tp
+ and t0, mask, t0
+ and t1, mask, t1
+ or t0, data0, data0
+ and t2, mask, t2
+ or t1, data1, data1
+ and t3, mask, t3
+ or t2, data2, data2
+ brnz i, L(top)
+ or t3, data3, data3
+
+ stx data0, [rp + 0]
+ subcc j, 4, j
+ stx data1, [rp + 8]
+ stx data2, [rp + 16]
+ stx data3, [rp + 24]
+ add tporig, (4 * 8), tporig
+
+ brgez j, L(outer_loop)
+ add rp, (4 * 8), rp
+L(outer_end):
+
+
+ andcc n, 2, %g0
+ be L(b0x)
+ nop
+L(b1x): clr data0
+ clr data1
+ mov tporig, tp
+ mov nents, i
+ mov which, %o1
+
+L(tp2): subcc %o1, 1, %o1
+ ldx [tp + 0], t0
+ subc %g0, %g0, mask
+ ldx [tp + 8], t1
+ sub i, 1, i
+ add tp, stride, tp
+ and t0, mask, t0
+ and t1, mask, t1
+ or t0, data0, data0
+ brnz i, L(tp2)
+ or t1, data1, data1
+
+ stx data0, [rp + 0]
+ stx data1, [rp + 8]
+ add tporig, (2 * 8), tporig
+ add rp, (2 * 8), rp
+
+
+L(b0x): andcc n, 1, %g0
+ be L(b00)
+ nop
+L(b01): clr data0
+ mov tporig, tp
+ mov nents, i
+ mov which, %o1
+
+L(tp1): subcc %o1, 1, %o1
+ ldx [tp + 0], t0
+ subc %g0, %g0, mask
+ sub i, 1, i
+ add tp, stride, tp
+ and t0, mask, t0
+ brnz i, L(tp1)
+ or t0, data0, data0
+
+ stx data0, [rp + 0]
+
+L(b00): ret
+ restore
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/sparc64.h b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/sparc64.h
new file mode 100644
index 00000000000..09fc16d46a4
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/sparc64.h
@@ -0,0 +1,219 @@
+/* UltraSPARC 64 support macros.
+
+ 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 2003 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 LOW32(x) ((x) & 0xFFFFFFFF)
+#define HIGH32(x) ((x) >> 32)
+
+
+/* Halfword number i in src is accessed as src[i+HALF_ENDIAN_ADJ(i)].
+ Plain src[i] would be incorrect in big endian, HALF_ENDIAN_ADJ has the
+ effect of swapping the two halves in this case. */
+#if HAVE_LIMB_BIG_ENDIAN
+#define HALF_ENDIAN_ADJ(i) (1 - (((i) & 1) << 1)) /* +1 even, -1 odd */
+#endif
+#if HAVE_LIMB_LITTLE_ENDIAN
+#define HALF_ENDIAN_ADJ(i) 0 /* no adjust */
+#endif
+#ifndef HALF_ENDIAN_ADJ
+Error, error, unknown limb endianness;
+#endif
+
+
+/* umul_ppmm_lowequal sets h to the high limb of q*d, assuming the low limb
+ of that product is equal to l. dh and dl are the 32-bit halves of d.
+
+ |-----high----||----low-----|
+ +------+------+
+ | | ph = qh * dh
+ +------+------+
+ +------+------+
+ | | pm1 = ql * dh
+ +------+------+
+ +------+------+
+ | | pm2 = qh * dl
+ +------+------+
+ +------+------+
+ | | pl = ql * dl (not calculated)
+ +------+------+
+
+ Knowing that the low 64 bits is equal to l means that LOW(pm1) + LOW(pm2)
+ + HIGH(pl) == HIGH(l). The only thing we need from those product parts
+ is whether they produce a carry into the high.
+
+ pm_l = LOW(pm1)+LOW(pm2) is done to contribute its carry, then the only
+ time there's a further carry from LOW(pm_l)+HIGH(pl) is if LOW(pm_l) >
+ HIGH(l). pl is never actually calculated. */
+
+#define umul_ppmm_lowequal(h, q, d, dh, dl, l) \
+ do { \
+ mp_limb_t ql, qh, ph, pm1, pm2, pm_l; \
+ ASSERT (dh == HIGH32(d)); \
+ ASSERT (dl == LOW32(d)); \
+ ASSERT (q*d == l); \
+ \
+ ql = LOW32 (q); \
+ qh = HIGH32 (q); \
+ \
+ pm1 = ql * dh; \
+ pm2 = qh * dl; \
+ ph = qh * dh; \
+ \
+ pm_l = LOW32 (pm1) + LOW32 (pm2); \
+ \
+ (h) = ph + HIGH32 (pm1) + HIGH32 (pm2) \
+ + HIGH32 (pm_l) + ((pm_l << 32) > l); \
+ \
+ ASSERT_HIGH_PRODUCT (h, q, d); \
+ } while (0)
+
+
+/* Set h to the high of q*d, assuming the low limb of that product is equal
+ to l, and that d fits in 32-bits.
+
+ |-----high----||----low-----|
+ +------+------+
+ | | pm = qh * dl
+ +------+------+
+ +------+------+
+ | | pl = ql * dl (not calculated)
+ +------+------+
+
+ Knowing that LOW(pm) + HIGH(pl) == HIGH(l) (mod 2^32) means that the only
+ time there's a carry from that sum is when LOW(pm) > HIGH(l). There's no
+ need to calculate pl to determine this. */
+
+#define umul_ppmm_half_lowequal(h, q, d, l) \
+ do { \
+ mp_limb_t pm; \
+ ASSERT (q*d == l); \
+ ASSERT (HIGH32(d) == 0); \
+ \
+ pm = HIGH32(q) * d; \
+ (h) = HIGH32(pm) + ((pm << 32) > l); \
+ ASSERT_HIGH_PRODUCT (h, q, d); \
+ } while (0)
+
+
+/* check that h is the high limb of x*y */
+#if WANT_ASSERT
+#define ASSERT_HIGH_PRODUCT(h, x, y) \
+ do { \
+ mp_limb_t want_h, dummy; \
+ umul_ppmm (want_h, dummy, x, y); \
+ ASSERT (h == want_h); \
+ } while (0)
+#else
+#define ASSERT_HIGH_PRODUCT(h, q, d) \
+ do { } while (0)
+#endif
+
+
+/* Multiply u anv v, where v < 2^32. */
+#define umul_ppmm_s(w1, w0, u, v) \
+ do { \
+ UWtype __x0, __x2; \
+ UWtype __ul, __vl, __uh; \
+ UWtype __u = (u), __v = (v); \
+ \
+ __ul = __ll_lowpart (__u); \
+ __uh = __ll_highpart (__u); \
+ __vl = __ll_lowpart (__v); \
+ \
+ __x0 = (UWtype) __ul * __vl; \
+ __x2 = (UWtype) __uh * __vl; \
+ \
+ (w1) = (__x2 + (__x0 >> W_TYPE_SIZE/2)) >> W_TYPE_SIZE/2; \
+ (w0) = (__x2 << W_TYPE_SIZE/2) + __x0; \
+ } while (0)
+
+/* Count the leading zeros on a limb, but assuming it fits in 32 bits.
+ The count returned will be in the range 32 to 63.
+ This is the 32-bit generic C count_leading_zeros from longlong.h. */
+#define count_leading_zeros_32(count, x) \
+ do { \
+ mp_limb_t __xr = (x); \
+ unsigned __a; \
+ ASSERT ((x) != 0); \
+ ASSERT ((x) <= CNST_LIMB(0xFFFFFFFF)); \
+ __a = __xr < ((UWtype) 1 << 16) ? (__xr < ((UWtype) 1 << 8) ? 1 : 8 + 1) \
+ : (__xr < ((UWtype) 1 << 24) ? 16 + 1 : 24 + 1); \
+ \
+ (count) = W_TYPE_SIZE + 1 - __a - __clz_tab[__xr >> __a]; \
+ } while (0)
+
+
+/* Set inv to a 32-bit inverse floor((b*(b-d)-1) / d), knowing that d fits
+ 32 bits and is normalized (high bit set). */
+#define invert_half_limb(inv, d) \
+ do { \
+ mp_limb_t _n; \
+ ASSERT ((d) <= 0xFFFFFFFF); \
+ ASSERT ((d) & 0x80000000); \
+ _n = (((mp_limb_t) -(d)) << 32) - 1; \
+ (inv) = (mp_limb_t) (unsigned) (_n / (d)); \
+ } while (0)
+
+
+/* Divide nh:nl by d, setting q to the quotient and r to the remainder.
+ q, r, nh and nl are 32-bits each, d_limb is 32-bits but in an mp_limb_t,
+ dinv_limb is similarly a 32-bit inverse but in an mp_limb_t. */
+
+#define udiv_qrnnd_half_preinv(q, r, nh, nl, d_limb, dinv_limb) \
+ do { \
+ unsigned _n2, _n10, _n1, _nadj, _q11n, _xh, _r, _q; \
+ mp_limb_t _n, _x; \
+ ASSERT (d_limb <= 0xFFFFFFFF); \
+ ASSERT (dinv_limb <= 0xFFFFFFFF); \
+ ASSERT (d_limb & 0x80000000); \
+ ASSERT (nh < d_limb); \
+ _n10 = (nl); \
+ _n2 = (nh); \
+ _n1 = (int) _n10 >> 31; \
+ _nadj = _n10 + (_n1 & d_limb); \
+ _x = dinv_limb * (_n2 - _n1) + _nadj; \
+ _q11n = ~(_n2 + HIGH32 (_x)); /* -q1-1 */ \
+ _n = ((mp_limb_t) _n2 << 32) + _n10; \
+ _x = _n + d_limb * _q11n; /* n-q1*d-d */ \
+ _xh = HIGH32 (_x) - d_limb; /* high(n-q1*d-d) */ \
+ ASSERT (_xh == 0 || _xh == ~0); \
+ _r = _x + (d_limb & _xh); /* addback */ \
+ _q = _xh - _q11n; /* q1+1-addback */ \
+ ASSERT (_r < d_limb); \
+ ASSERT (d_limb * _q + _r == _n); \
+ (r) = _r; \
+ (q) = _q; \
+ } while (0)
+
+
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/ultrasparc1234/add_n.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/ultrasparc1234/add_n.asm
new file mode 100644
index 00000000000..92374d2552d
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/ultrasparc1234/add_n.asm
@@ -0,0 +1,241 @@
+dnl SPARC v9 mpn_add_n -- Add two limb vectors of the same length > 0 and
+dnl store sum in a third limb vector.
+
+dnl Copyright 2001-2003, 2011 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 1&2: 4
+C UltraSPARC 3: 4.5
+
+C Compute carry-out from the most significant bits of u,v, and r, where
+C r=u+v+carry_in, using logic operations.
+
+C This code runs at 4 cycles/limb on UltraSPARC 1 and 2. It has a 4 insn
+C recurrency, and the UltraSPARC 1 and 2 the IE units are 100% saturated.
+C Therefore, it seems futile to try to optimize this any further...
+
+C INPUT PARAMETERS
+define(`rp', `%i0')
+define(`up', `%i1')
+define(`vp', `%i2')
+define(`n', `%i3')
+
+define(`u0', `%l0')
+define(`u1', `%l2')
+define(`u2', `%l4')
+define(`u3', `%l6')
+define(`v0', `%l1')
+define(`v1', `%l3')
+define(`v2', `%l5')
+define(`v3', `%l7')
+
+define(`cy',`%i4')
+
+define(`fanop',`fitod %f0,%f2') dnl A quasi nop running in the FA pipe
+define(`fmnop',`fmuld %f0,%f0,%f4') dnl A quasi nop running in the FM pipe
+
+ASM_START()
+ REGISTER(%g2,#scratch)
+ REGISTER(%g3,#scratch)
+PROLOGUE(mpn_add_nc)
+ save %sp,-160,%sp
+
+ fitod %f0,%f0 C make sure f0 contains small, quiet number
+ subcc n,4,%g0
+ bl,pn %xcc,.Loop0
+ nop
+ b,a L(com)
+EPILOGUE()
+
+PROLOGUE(mpn_add_n)
+ save %sp,-160,%sp
+
+ fitod %f0,%f0 C make sure f0 contains small, quiet number
+ subcc n,4,%g0
+ bl,pn %xcc,.Loop0
+ mov 0,cy
+L(com):
+ ldx [up+0],u0
+ ldx [vp+0],v0
+ add up,32,up
+ ldx [up-24],u1
+ ldx [vp+8],v1
+ add vp,32,vp
+ ldx [up-16],u2
+ ldx [vp-16],v2
+ ldx [up-8],u3
+ ldx [vp-8],v3
+ subcc n,8,n
+ add u0,v0,%g1 C main add
+ add %g1,cy,%g5 C carry add
+ or u0,v0,%g2
+ bl,pn %xcc,.Lend4567
+ fanop
+ b,a .Loop
+
+ .align 16
+C START MAIN LOOP
+.Loop: andn %g2,%g5,%g2
+ and u0,v0,%g3
+ ldx [up+0],u0
+ fanop
+C --
+ or %g3,%g2,%g2
+ ldx [vp+0],v0
+ add up,32,up
+ fanop
+C --
+ srlx %g2,63,cy
+ add u1,v1,%g1
+ stx %g5,[rp+0]
+ fanop
+C --
+ add %g1,cy,%g5
+ or u1,v1,%g2
+ fmnop
+ fanop
+C --
+ andn %g2,%g5,%g2
+ and u1,v1,%g3
+ ldx [up-24],u1
+ fanop
+C --
+ or %g3,%g2,%g2
+ ldx [vp+8],v1
+ add vp,32,vp
+ fanop
+C --
+ srlx %g2,63,cy
+ add u2,v2,%g1
+ stx %g5,[rp+8]
+ fanop
+C --
+ add %g1,cy,%g5
+ or u2,v2,%g2
+ fmnop
+ fanop
+C --
+ andn %g2,%g5,%g2
+ and u2,v2,%g3
+ ldx [up-16],u2
+ fanop
+C --
+ or %g3,%g2,%g2
+ ldx [vp-16],v2
+ add rp,32,rp
+ fanop
+C --
+ srlx %g2,63,cy
+ add u3,v3,%g1
+ stx %g5,[rp-16]
+ fanop
+C --
+ add %g1,cy,%g5
+ or u3,v3,%g2
+ fmnop
+ fanop
+C --
+ andn %g2,%g5,%g2
+ and u3,v3,%g3
+ ldx [up-8],u3
+ fanop
+C --
+ or %g3,%g2,%g2
+ subcc n,4,n
+ ldx [vp-8],v3
+ fanop
+C --
+ srlx %g2,63,cy
+ add u0,v0,%g1
+ stx %g5,[rp-8]
+ fanop
+C --
+ add %g1,cy,%g5
+ or u0,v0,%g2
+ bge,pt %xcc,.Loop
+ fanop
+C END MAIN LOOP
+.Lend4567:
+ andn %g2,%g5,%g2
+ and u0,v0,%g3
+ or %g3,%g2,%g2
+ srlx %g2,63,cy
+ add u1,v1,%g1
+ stx %g5,[rp+0]
+ add %g1,cy,%g5
+ or u1,v1,%g2
+ andn %g2,%g5,%g2
+ and u1,v1,%g3
+ or %g3,%g2,%g2
+ srlx %g2,63,cy
+ add u2,v2,%g1
+ stx %g5,[rp+8]
+ add %g1,cy,%g5
+ or u2,v2,%g2
+ andn %g2,%g5,%g2
+ and u2,v2,%g3
+ or %g3,%g2,%g2
+ add rp,32,rp
+ srlx %g2,63,cy
+ add u3,v3,%g1
+ stx %g5,[rp-16]
+ add %g1,cy,%g5
+ or u3,v3,%g2
+ andn %g2,%g5,%g2
+ and u3,v3,%g3
+ or %g3,%g2,%g2
+ srlx %g2,63,cy
+ stx %g5,[rp-8]
+
+ addcc n,4,n
+ bz,pn %xcc,.Lret
+ fanop
+
+.Loop0: ldx [up],u0
+ add up,8,up
+ ldx [vp],v0
+ add vp,8,vp
+ add rp,8,rp
+ subcc n,1,n
+ add u0,v0,%g1
+ or u0,v0,%g2
+ add %g1,cy,%g5
+ and u0,v0,%g3
+ andn %g2,%g5,%g2
+ stx %g5,[rp-8]
+ or %g3,%g2,%g2
+ bnz,pt %xcc,.Loop0
+ srlx %g2,63,cy
+
+.Lret: mov cy,%i0
+ ret
+ restore
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/ultrasparc1234/addmul_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/ultrasparc1234/addmul_1.asm
new file mode 100644
index 00000000000..48a94146ff6
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/ultrasparc1234/addmul_1.asm
@@ -0,0 +1,606 @@
+dnl SPARC v9 64-bit mpn_addmul_1 -- Multiply a limb vector with a limb and add
+dnl the result to a second limb vector.
+
+dnl Copyright 1998, 2000-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 cycles/limb
+C UltraSPARC 1&2: 14
+C UltraSPARC 3: 17.5
+
+C Algorithm: We use eight floating-point multiplies per limb product, with the
+C invariant v operand split into four 16-bit pieces, and the up operand split
+C into 32-bit pieces. We sum pairs of 48-bit partial products using
+C floating-point add, then convert the four 49-bit product-sums and transfer
+C them to the integer unit.
+
+C Possible optimizations:
+C 0. Rewrite to use algorithm of mpn_addmul_2.
+C 1. Align the stack area where we transfer the four 49-bit product-sums
+C to a 32-byte boundary. That would minimize the cache collision.
+C (UltraSPARC-1/2 use a direct-mapped cache.) (Perhaps even better would
+C be to align the area to map to the area immediately before up?)
+C 2. Sum the 4 49-bit quantities using 32-bit operations, as in the
+C develop mpn_addmul_2. This would save many integer instructions.
+C 3. Unrolling. Questionable if it is worth the code expansion, given that
+C it could only save 1 cycle/limb.
+C 4. Specialize for particular v values. If its upper 32 bits are zero, we
+C could save many operations, in the FPU (fmuld), but more so in the IEU
+C since we'll be summing 48-bit quantities, which might be simpler.
+C 5. Ideally, we should schedule the f2/f3 and f4/f5 RAW further apart, and
+C the i00,i16,i32,i48 RAW less apart. The latter apart-scheduling should
+C not be greater than needed for L2 cache latency, and also not so great
+C that i16 needs to be copied.
+C 6. Avoid performing mem+fa+fm in the same cycle, at least not when we want
+C to get high IEU bandwidth. (12 of the 14 cycles will be free for 2 IEU
+C ops.)
+
+C Instruction classification (as per UltraSPARC-1/2 functional units):
+C 8 FM
+C 10 FA
+C 12 MEM
+C 10 ISHIFT + 14 IADDLOG
+C 1 BRANCH
+C 55 insns totally (plus one mov insn that should be optimized out)
+
+C The loop executes 56 instructions in 14 cycles on UltraSPARC-1/2, i.e we
+C sustain the peak execution rate of 4 instructions/cycle.
+
+C INPUT PARAMETERS
+C rp i0
+C up i1
+C n i2
+C v i3
+
+ASM_START()
+ REGISTER(%g2,#scratch)
+ REGISTER(%g3,#scratch)
+
+define(`p00', `%f8') define(`p16',`%f10') define(`p32',`%f12') define(`p48',`%f14')
+define(`r32',`%f16') define(`r48',`%f18') define(`r64',`%f20') define(`r80',`%f22')
+define(`v00',`%f24') define(`v16',`%f26') define(`v32',`%f28') define(`v48',`%f30')
+define(`u00',`%f32') define(`u32', `%f34')
+define(`a00',`%f36') define(`a16',`%f38') define(`a32',`%f40') define(`a48',`%f42')
+define(`cy',`%g1')
+define(`rlimb',`%g3')
+define(`i00',`%l0') define(`i16',`%l1') define(`i32',`%l2') define(`i48',`%l3')
+define(`xffffffff',`%l7')
+define(`xffff',`%o0')
+
+PROLOGUE(mpn_addmul_1)
+
+C Initialization. (1) Split v operand into four 16-bit chunks and store them
+C as IEEE double in fp registers. (2) Clear upper 32 bits of fp register pairs
+C f2 and f4. (3) Store masks in registers aliased to `xffff' and `xffffffff'.
+
+ save %sp, -256, %sp
+ mov -1, %g4
+ srlx %g4, 48, xffff C store mask in register `xffff'
+ and %i3, xffff, %g2
+ stx %g2, [%sp+2223+0]
+ srlx %i3, 16, %g3
+ and %g3, xffff, %g3
+ stx %g3, [%sp+2223+8]
+ srlx %i3, 32, %g2
+ and %g2, xffff, %g2
+ stx %g2, [%sp+2223+16]
+ srlx %i3, 48, %g3
+ stx %g3, [%sp+2223+24]
+ srlx %g4, 32, xffffffff C store mask in register `xffffffff'
+
+ sllx %i2, 3, %i2
+ mov 0, cy C clear cy
+ add %i0, %i2, %i0
+ add %i1, %i2, %i1
+ neg %i2
+ add %i1, 4, %i5
+ add %i0, -32, %i4
+ add %i0, -16, %i0
+
+ ldd [%sp+2223+0], v00
+ ldd [%sp+2223+8], v16
+ ldd [%sp+2223+16], v32
+ ldd [%sp+2223+24], v48
+ ld [%sp+2223+0],%f2 C zero f2
+ ld [%sp+2223+0],%f4 C zero f4
+ ld [%i5+%i2], %f3 C read low 32 bits of up[i]
+ ld [%i1+%i2], %f5 C read high 32 bits of up[i]
+ fxtod v00, v00
+ fxtod v16, v16
+ fxtod v32, v32
+ fxtod v48, v48
+
+C Start real work. (We sneakingly read f3 and f5 above...)
+C The software pipeline is very deep, requiring 4 feed-in stages.
+
+ fxtod %f2, u00
+ fxtod %f4, u32
+ fmuld u00, v00, a00
+ fmuld u00, v16, a16
+ fmuld u00, v32, p32
+ fmuld u32, v00, r32
+ fmuld u00, v48, p48
+ addcc %i2, 8, %i2
+ bnz,pt %xcc, .L_two_or_more
+ fmuld u32, v16, r48
+
+.L_one:
+ fmuld u32, v32, r64 C FIXME not urgent
+ faddd p32, r32, a32
+ fdtox a00, a00
+ faddd p48, r48, a48
+ fmuld u32, v48, r80 C FIXME not urgent
+ fdtox a16, a16
+ fdtox a32, a32
+ fdtox a48, a48
+ std a00, [%sp+2223+0]
+ std a16, [%sp+2223+8]
+ std a32, [%sp+2223+16]
+ std a48, [%sp+2223+24]
+ add %i2, 8, %i2
+
+ fdtox r64, a00
+ ldx [%i0+%i2], rlimb C read rp[i]
+ fdtox r80, a16
+ ldx [%sp+2223+0], i00
+ ldx [%sp+2223+8], i16
+ ldx [%sp+2223+16], i32
+ ldx [%sp+2223+24], i48
+ std a00, [%sp+2223+0]
+ std a16, [%sp+2223+8]
+ add %i2, 8, %i2
+
+ srlx rlimb, 32, %g4 C HI(rlimb)
+ and rlimb, xffffffff, %g5 C LO(rlimb)
+ add i00, %g5, %g5 C i00+ now in g5
+ ldx [%sp+2223+0], i00
+ srlx i16, 48, %l4 C (i16 >> 48)
+ mov i16, %g2
+ ldx [%sp+2223+8], i16
+ srlx i48, 16, %l5 C (i48 >> 16)
+ add i32, %g4, %g4 C i32+ now in g4
+ sllx i48, 32, %l6 C (i48 << 32)
+ srlx %g4, 32, %o3 C (i32 >> 32)
+ add %l5, %l4, %o1 C hi64- in %o1
+ std a00, [%sp+2223+0]
+ sllx %g4, 16, %o2 C (i32 << 16)
+ add %o3, %o1, %o1 C hi64 in %o1 1st ASSIGNMENT
+ std a16, [%sp+2223+8]
+ sllx %o1, 48, %o3 C (hi64 << 48)
+ add %g2, %o2, %o2 C mi64- in %o2
+ add %l6, %o2, %o2 C mi64- in %o2
+ sub %o2, %o3, %o2 C mi64 in %o2 1st ASSIGNMENT
+ add cy, %g5, %o4 C x = prev(i00) + cy
+ b .L_out_1
+ add %i2, 8, %i2
+
+.L_two_or_more:
+ ld [%i5+%i2], %f3 C read low 32 bits of up[i]
+ fmuld u32, v32, r64 C FIXME not urgent
+ faddd p32, r32, a32
+ ld [%i1+%i2], %f5 C read high 32 bits of up[i]
+ fdtox a00, a00
+ faddd p48, r48, a48
+ fmuld u32, v48, r80 C FIXME not urgent
+ fdtox a16, a16
+ fdtox a32, a32
+ fxtod %f2, u00
+ fxtod %f4, u32
+ fdtox a48, a48
+ std a00, [%sp+2223+0]
+ fmuld u00, v00, p00
+ std a16, [%sp+2223+8]
+ fmuld u00, v16, p16
+ std a32, [%sp+2223+16]
+ fmuld u00, v32, p32
+ std a48, [%sp+2223+24]
+ faddd p00, r64, a00
+ fmuld u32, v00, r32
+ faddd p16, r80, a16
+ fmuld u00, v48, p48
+ addcc %i2, 8, %i2
+ bnz,pt %xcc, .L_three_or_more
+ fmuld u32, v16, r48
+
+.L_two:
+ fmuld u32, v32, r64 C FIXME not urgent
+ faddd p32, r32, a32
+ fdtox a00, a00
+ ldx [%i0+%i2], rlimb C read rp[i]
+ faddd p48, r48, a48
+ fmuld u32, v48, r80 C FIXME not urgent
+ fdtox a16, a16
+ ldx [%sp+2223+0], i00
+ fdtox a32, a32
+ ldx [%sp+2223+8], i16
+ ldx [%sp+2223+16], i32
+ ldx [%sp+2223+24], i48
+ fdtox a48, a48
+ std a00, [%sp+2223+0]
+ std a16, [%sp+2223+8]
+ std a32, [%sp+2223+16]
+ std a48, [%sp+2223+24]
+ add %i2, 8, %i2
+
+ fdtox r64, a00
+ srlx rlimb, 32, %g4 C HI(rlimb)
+ and rlimb, xffffffff, %g5 C LO(rlimb)
+ ldx [%i0+%i2], rlimb C read rp[i]
+ add i00, %g5, %g5 C i00+ now in g5
+ fdtox r80, a16
+ ldx [%sp+2223+0], i00
+ srlx i16, 48, %l4 C (i16 >> 48)
+ mov i16, %g2
+ ldx [%sp+2223+8], i16
+ srlx i48, 16, %l5 C (i48 >> 16)
+ add i32, %g4, %g4 C i32+ now in g4
+ ldx [%sp+2223+16], i32
+ sllx i48, 32, %l6 C (i48 << 32)
+ ldx [%sp+2223+24], i48
+ srlx %g4, 32, %o3 C (i32 >> 32)
+ add %l5, %l4, %o1 C hi64- in %o1
+ std a00, [%sp+2223+0]
+ sllx %g4, 16, %o2 C (i32 << 16)
+ add %o3, %o1, %o1 C hi64 in %o1 1st ASSIGNMENT
+ std a16, [%sp+2223+8]
+ sllx %o1, 48, %o3 C (hi64 << 48)
+ add %g2, %o2, %o2 C mi64- in %o2
+ add %l6, %o2, %o2 C mi64- in %o2
+ sub %o2, %o3, %o2 C mi64 in %o2 1st ASSIGNMENT
+ add cy, %g5, %o4 C x = prev(i00) + cy
+ b .L_out_2
+ add %i2, 8, %i2
+
+.L_three_or_more:
+ ld [%i5+%i2], %f3 C read low 32 bits of up[i]
+ fmuld u32, v32, r64 C FIXME not urgent
+ faddd p32, r32, a32
+ ld [%i1+%i2], %f5 C read high 32 bits of up[i]
+ fdtox a00, a00
+ ldx [%i0+%i2], rlimb C read rp[i]
+ faddd p48, r48, a48
+ fmuld u32, v48, r80 C FIXME not urgent
+ fdtox a16, a16
+ ldx [%sp+2223+0], i00
+ fdtox a32, a32
+ ldx [%sp+2223+8], i16
+ fxtod %f2, u00
+ ldx [%sp+2223+16], i32
+ fxtod %f4, u32
+ ldx [%sp+2223+24], i48
+ fdtox a48, a48
+ std a00, [%sp+2223+0]
+ fmuld u00, v00, p00
+ std a16, [%sp+2223+8]
+ fmuld u00, v16, p16
+ std a32, [%sp+2223+16]
+ fmuld u00, v32, p32
+ std a48, [%sp+2223+24]
+ faddd p00, r64, a00
+ fmuld u32, v00, r32
+ faddd p16, r80, a16
+ fmuld u00, v48, p48
+ addcc %i2, 8, %i2
+ bnz,pt %xcc, .L_four_or_more
+ fmuld u32, v16, r48
+
+.L_three:
+ fmuld u32, v32, r64 C FIXME not urgent
+ faddd p32, r32, a32
+ fdtox a00, a00
+ srlx rlimb, 32, %g4 C HI(rlimb)
+ and rlimb, xffffffff, %g5 C LO(rlimb)
+ ldx [%i0+%i2], rlimb C read rp[i]
+ faddd p48, r48, a48
+ add i00, %g5, %g5 C i00+ now in g5
+ fmuld u32, v48, r80 C FIXME not urgent
+ fdtox a16, a16
+ ldx [%sp+2223+0], i00
+ fdtox a32, a32
+ srlx i16, 48, %l4 C (i16 >> 48)
+ mov i16, %g2
+ ldx [%sp+2223+8], i16
+ srlx i48, 16, %l5 C (i48 >> 16)
+ add i32, %g4, %g4 C i32+ now in g4
+ ldx [%sp+2223+16], i32
+ sllx i48, 32, %l6 C (i48 << 32)
+ ldx [%sp+2223+24], i48
+ fdtox a48, a48
+ srlx %g4, 32, %o3 C (i32 >> 32)
+ add %l5, %l4, %o1 C hi64- in %o1
+ std a00, [%sp+2223+0]
+ sllx %g4, 16, %o2 C (i32 << 16)
+ add %o3, %o1, %o1 C hi64 in %o1 1st ASSIGNMENT
+ std a16, [%sp+2223+8]
+ sllx %o1, 48, %o3 C (hi64 << 48)
+ add %g2, %o2, %o2 C mi64- in %o2
+ std a32, [%sp+2223+16]
+ add %l6, %o2, %o2 C mi64- in %o2
+ std a48, [%sp+2223+24]
+ sub %o2, %o3, %o2 C mi64 in %o2 1st ASSIGNMENT
+ add cy, %g5, %o4 C x = prev(i00) + cy
+ b .L_out_3
+ add %i2, 8, %i2
+
+.L_four_or_more:
+ ld [%i5+%i2], %f3 C read low 32 bits of up[i]
+ fmuld u32, v32, r64 C FIXME not urgent
+ faddd p32, r32, a32
+ ld [%i1+%i2], %f5 C read high 32 bits of up[i]
+ fdtox a00, a00
+ srlx rlimb, 32, %g4 C HI(rlimb)
+ and rlimb, xffffffff, %g5 C LO(rlimb)
+ ldx [%i0+%i2], rlimb C read rp[i]
+ faddd p48, r48, a48
+ add i00, %g5, %g5 C i00+ now in g5
+ fmuld u32, v48, r80 C FIXME not urgent
+ fdtox a16, a16
+ ldx [%sp+2223+0], i00
+ fdtox a32, a32
+ srlx i16, 48, %l4 C (i16 >> 48)
+ mov i16, %g2
+ ldx [%sp+2223+8], i16
+ fxtod %f2, u00
+ srlx i48, 16, %l5 C (i48 >> 16)
+ add i32, %g4, %g4 C i32+ now in g4
+ ldx [%sp+2223+16], i32
+ fxtod %f4, u32
+ sllx i48, 32, %l6 C (i48 << 32)
+ ldx [%sp+2223+24], i48
+ fdtox a48, a48
+ srlx %g4, 32, %o3 C (i32 >> 32)
+ add %l5, %l4, %o1 C hi64- in %o1
+ std a00, [%sp+2223+0]
+ fmuld u00, v00, p00
+ sllx %g4, 16, %o2 C (i32 << 16)
+ add %o3, %o1, %o1 C hi64 in %o1 1st ASSIGNMENT
+ std a16, [%sp+2223+8]
+ fmuld u00, v16, p16
+ sllx %o1, 48, %o3 C (hi64 << 48)
+ add %g2, %o2, %o2 C mi64- in %o2
+ std a32, [%sp+2223+16]
+ fmuld u00, v32, p32
+ add %l6, %o2, %o2 C mi64- in %o2
+ std a48, [%sp+2223+24]
+ faddd p00, r64, a00
+ fmuld u32, v00, r32
+ sub %o2, %o3, %o2 C mi64 in %o2 1st ASSIGNMENT
+ faddd p16, r80, a16
+ fmuld u00, v48, p48
+ add cy, %g5, %o4 C x = prev(i00) + cy
+ addcc %i2, 8, %i2
+ bnz,pt %xcc, .Loop
+ fmuld u32, v16, r48
+
+.L_four:
+ b,a .L_out_4
+
+C BEGIN MAIN LOOP
+ .align 16
+.Loop:
+C 00
+ srlx %o4, 16, %o5 C (x >> 16)
+ ld [%i5+%i2], %f3 C read low 32 bits of up[i]
+ fmuld u32, v32, r64 C FIXME not urgent
+ faddd p32, r32, a32
+C 01
+ add %o5, %o2, %o2 C mi64 in %o2 2nd ASSIGNMENT
+ and %o4, xffff, %o5 C (x & 0xffff)
+ ld [%i1+%i2], %f5 C read high 32 bits of up[i]
+ fdtox a00, a00
+C 02
+ srlx rlimb, 32, %g4 C HI(rlimb)
+ and rlimb, xffffffff, %g5 C LO(rlimb)
+ ldx [%i0+%i2], rlimb C read rp[i]
+ faddd p48, r48, a48
+C 03
+ srlx %o2, 48, %o7 C (mi64 >> 48)
+ add i00, %g5, %g5 C i00+ now in g5
+ fmuld u32, v48, r80 C FIXME not urgent
+ fdtox a16, a16
+C 04
+ sllx %o2, 16, %i3 C (mi64 << 16)
+ add %o7, %o1, cy C new cy
+ ldx [%sp+2223+0], i00
+ fdtox a32, a32
+C 05
+ srlx i16, 48, %l4 C (i16 >> 48)
+ mov i16, %g2
+ ldx [%sp+2223+8], i16
+ fxtod %f2, u00
+C 06
+ srlx i48, 16, %l5 C (i48 >> 16)
+ add i32, %g4, %g4 C i32+ now in g4
+ ldx [%sp+2223+16], i32
+ fxtod %f4, u32
+C 07
+ sllx i48, 32, %l6 C (i48 << 32)
+ or %i3, %o5, %o5
+ ldx [%sp+2223+24], i48
+ fdtox a48, a48
+C 08
+ srlx %g4, 32, %o3 C (i32 >> 32)
+ add %l5, %l4, %o1 C hi64- in %o1
+ std a00, [%sp+2223+0]
+ fmuld u00, v00, p00
+C 09
+ sllx %g4, 16, %o2 C (i32 << 16)
+ add %o3, %o1, %o1 C hi64 in %o1 1st ASSIGNMENT
+ std a16, [%sp+2223+8]
+ fmuld u00, v16, p16
+C 10
+ sllx %o1, 48, %o3 C (hi64 << 48)
+ add %g2, %o2, %o2 C mi64- in %o2
+ std a32, [%sp+2223+16]
+ fmuld u00, v32, p32
+C 11
+ add %l6, %o2, %o2 C mi64- in %o2
+ std a48, [%sp+2223+24]
+ faddd p00, r64, a00
+ fmuld u32, v00, r32
+C 12
+ sub %o2, %o3, %o2 C mi64 in %o2 1st ASSIGNMENT
+ stx %o5, [%i4+%i2]
+ faddd p16, r80, a16
+ fmuld u00, v48, p48
+C 13
+ add cy, %g5, %o4 C x = prev(i00) + cy
+ addcc %i2, 8, %i2
+ bnz,pt %xcc, .Loop
+ fmuld u32, v16, r48
+C END MAIN LOOP
+
+.L_out_4:
+ srlx %o4, 16, %o5 C (x >> 16)
+ fmuld u32, v32, r64 C FIXME not urgent
+ faddd p32, r32, a32
+ add %o5, %o2, %o2 C mi64 in %o2 2nd ASSIGNMENT
+ and %o4, xffff, %o5 C (x & 0xffff)
+ fdtox a00, a00
+ srlx rlimb, 32, %g4 C HI(rlimb)
+ and rlimb, xffffffff, %g5 C LO(rlimb)
+ ldx [%i0+%i2], rlimb C read rp[i]
+ faddd p48, r48, a48
+ srlx %o2, 48, %o7 C (mi64 >> 48)
+ add i00, %g5, %g5 C i00+ now in g5
+ fmuld u32, v48, r80 C FIXME not urgent
+ fdtox a16, a16
+ sllx %o2, 16, %i3 C (mi64 << 16)
+ add %o7, %o1, cy C new cy
+ ldx [%sp+2223+0], i00
+ fdtox a32, a32
+ srlx i16, 48, %l4 C (i16 >> 48)
+ mov i16, %g2
+ ldx [%sp+2223+8], i16
+ srlx i48, 16, %l5 C (i48 >> 16)
+ add i32, %g4, %g4 C i32+ now in g4
+ ldx [%sp+2223+16], i32
+ sllx i48, 32, %l6 C (i48 << 32)
+ or %i3, %o5, %o5
+ ldx [%sp+2223+24], i48
+ fdtox a48, a48
+ srlx %g4, 32, %o3 C (i32 >> 32)
+ add %l5, %l4, %o1 C hi64- in %o1
+ std a00, [%sp+2223+0]
+ sllx %g4, 16, %o2 C (i32 << 16)
+ add %o3, %o1, %o1 C hi64 in %o1 1st ASSIGNMENT
+ std a16, [%sp+2223+8]
+ sllx %o1, 48, %o3 C (hi64 << 48)
+ add %g2, %o2, %o2 C mi64- in %o2
+ std a32, [%sp+2223+16]
+ add %l6, %o2, %o2 C mi64- in %o2
+ std a48, [%sp+2223+24]
+ sub %o2, %o3, %o2 C mi64 in %o2 1st ASSIGNMENT
+ stx %o5, [%i4+%i2]
+ add cy, %g5, %o4 C x = prev(i00) + cy
+ add %i2, 8, %i2
+.L_out_3:
+ srlx %o4, 16, %o5 C (x >> 16)
+ add %o5, %o2, %o2 C mi64 in %o2 2nd ASSIGNMENT
+ and %o4, xffff, %o5 C (x & 0xffff)
+ fdtox r64, a00
+ srlx rlimb, 32, %g4 C HI(rlimb)
+ and rlimb, xffffffff, %g5 C LO(rlimb)
+ ldx [%i0+%i2], rlimb C read rp[i]
+ srlx %o2, 48, %o7 C (mi64 >> 48)
+ add i00, %g5, %g5 C i00+ now in g5
+ fdtox r80, a16
+ sllx %o2, 16, %i3 C (mi64 << 16)
+ add %o7, %o1, cy C new cy
+ ldx [%sp+2223+0], i00
+ srlx i16, 48, %l4 C (i16 >> 48)
+ mov i16, %g2
+ ldx [%sp+2223+8], i16
+ srlx i48, 16, %l5 C (i48 >> 16)
+ add i32, %g4, %g4 C i32+ now in g4
+ ldx [%sp+2223+16], i32
+ sllx i48, 32, %l6 C (i48 << 32)
+ or %i3, %o5, %o5
+ ldx [%sp+2223+24], i48
+ srlx %g4, 32, %o3 C (i32 >> 32)
+ add %l5, %l4, %o1 C hi64- in %o1
+ std a00, [%sp+2223+0]
+ sllx %g4, 16, %o2 C (i32 << 16)
+ add %o3, %o1, %o1 C hi64 in %o1 1st ASSIGNMENT
+ std a16, [%sp+2223+8]
+ sllx %o1, 48, %o3 C (hi64 << 48)
+ add %g2, %o2, %o2 C mi64- in %o2
+ add %l6, %o2, %o2 C mi64- in %o2
+ sub %o2, %o3, %o2 C mi64 in %o2 1st ASSIGNMENT
+ stx %o5, [%i4+%i2]
+ add cy, %g5, %o4 C x = prev(i00) + cy
+ add %i2, 8, %i2
+.L_out_2:
+ srlx %o4, 16, %o5 C (x >> 16)
+ add %o5, %o2, %o2 C mi64 in %o2 2nd ASSIGNMENT
+ and %o4, xffff, %o5 C (x & 0xffff)
+ srlx rlimb, 32, %g4 C HI(rlimb)
+ and rlimb, xffffffff, %g5 C LO(rlimb)
+ srlx %o2, 48, %o7 C (mi64 >> 48)
+ add i00, %g5, %g5 C i00+ now in g5
+ sllx %o2, 16, %i3 C (mi64 << 16)
+ add %o7, %o1, cy C new cy
+ ldx [%sp+2223+0], i00
+ srlx i16, 48, %l4 C (i16 >> 48)
+ mov i16, %g2
+ ldx [%sp+2223+8], i16
+ srlx i48, 16, %l5 C (i48 >> 16)
+ add i32, %g4, %g4 C i32+ now in g4
+ sllx i48, 32, %l6 C (i48 << 32)
+ or %i3, %o5, %o5
+ srlx %g4, 32, %o3 C (i32 >> 32)
+ add %l5, %l4, %o1 C hi64- in %o1
+ sllx %g4, 16, %o2 C (i32 << 16)
+ add %o3, %o1, %o1 C hi64 in %o1 1st ASSIGNMENT
+ sllx %o1, 48, %o3 C (hi64 << 48)
+ add %g2, %o2, %o2 C mi64- in %o2
+ add %l6, %o2, %o2 C mi64- in %o2
+ sub %o2, %o3, %o2 C mi64 in %o2 1st ASSIGNMENT
+ stx %o5, [%i4+%i2]
+ add cy, %g5, %o4 C x = prev(i00) + cy
+ add %i2, 8, %i2
+.L_out_1:
+ srlx %o4, 16, %o5 C (x >> 16)
+ add %o5, %o2, %o2 C mi64 in %o2 2nd ASSIGNMENT
+ and %o4, xffff, %o5 C (x & 0xffff)
+ srlx %o2, 48, %o7 C (mi64 >> 48)
+ sllx %o2, 16, %i3 C (mi64 << 16)
+ add %o7, %o1, cy C new cy
+ or %i3, %o5, %o5
+ stx %o5, [%i4+%i2]
+
+ sllx i00, 0, %g2
+ add %g2, cy, cy
+ sllx i16, 16, %g3
+ add %g3, cy, cy
+
+ return %i7+8
+ mov cy, %o0
+EPILOGUE(mpn_addmul_1)
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/ultrasparc1234/addmul_2.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/ultrasparc1234/addmul_2.asm
new file mode 100644
index 00000000000..37674d7423b
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/ultrasparc1234/addmul_2.asm
@@ -0,0 +1,551 @@
+dnl SPARC v9 64-bit mpn_addmul_2 -- Multiply an n limb number with 2-limb
+dnl number and add the result to a n limb vector.
+
+dnl Copyright 2002, 2003 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 1&2: 9
+C UltraSPARC 3: 10
+
+C Algorithm: We use 16 floating-point multiplies per limb product, with the
+C 2-limb v operand split into eight 16-bit pieces, and the n-limb u operand
+C split into 32-bit pieces. We sum four 48-bit partial products using
+C floating-point add, then convert the resulting four 50-bit quantities and
+C transfer them to the integer unit.
+
+C Possible optimizations:
+C 1. Align the stack area where we transfer the four 50-bit product-sums
+C to a 32-byte boundary. That would minimize the cache collision.
+C (UltraSPARC-1/2 use a direct-mapped cache.) (Perhaps even better would
+C be to align the area to map to the area immediately before up?)
+C 2. Perform two of the fp->int conversions with integer instructions. We
+C can get almost ten free IEU slots, if we clean up bookkeeping and the
+C silly carry-limb code.
+C 3. For an mpn_addmul_1 based on this, we need to fix the silly carry-limb
+C code.
+
+C OSP (Overlapping software pipeline) version of mpn_mul_basecase:
+C Operand swap will require 8 LDDA and 8 FXTOD, which will mean 8 cycles.
+C FI = 20
+C L = 9 x un * vn
+C WDFI = 10 x vn / 2
+C WD = 4
+
+C Instruction classification (as per UltraSPARC functional units).
+C Assuming silly carry code is fixed. Includes bookkeeping.
+C
+C mpn_addmul_X mpn_mul_X
+C 1 2 1 2
+C ========== ==========
+C FM 8 16 8 16
+C FA 10 18 10 18
+C MEM 12 12 10 10
+C ISHIFT 6 6 6 6
+C IADDLOG 11 11 10 10
+C BRANCH 1 1 1 1
+C
+C TOTAL IEU 17 17 16 16
+C TOTAL 48 64 45 61
+C
+C IEU cycles 8.5 8.5 8 8
+C MEM cycles 12 12 10 10
+C ISSUE cycles 12 16 11.25 15.25
+C FPU cycles 10 18 10 18
+C cycles/loop 12 18 12 18
+C cycles/limb 12 9 12 9
+
+
+C INPUT PARAMETERS
+C rp[n + 1] i0
+C up[n] i1
+C n i2
+C vp[2] i3
+
+
+ASM_START()
+ REGISTER(%g2,#scratch)
+ REGISTER(%g3,#scratch)
+
+C Combine registers:
+C u00_hi= u32_hi
+C u00_lo= u32_lo
+C a000 = out000
+C a016 = out016
+C Free: f52 f54
+
+
+define(`p000', `%f8') define(`p016',`%f10')
+define(`p032',`%f12') define(`p048',`%f14')
+define(`p064',`%f16') define(`p080',`%f18')
+define(`p096a',`%f20') define(`p112a',`%f22')
+define(`p096b',`%f56') define(`p112b',`%f58')
+
+define(`out000',`%f0') define(`out016',`%f6')
+
+define(`v000',`%f24') define(`v016',`%f26')
+define(`v032',`%f28') define(`v048',`%f30')
+define(`v064',`%f44') define(`v080',`%f46')
+define(`v096',`%f48') define(`v112',`%f50')
+
+define(`u00',`%f32') define(`u32', `%f34')
+
+define(`a000',`%f36') define(`a016',`%f38')
+define(`a032',`%f40') define(`a048',`%f42')
+define(`a064',`%f60') define(`a080',`%f62')
+
+define(`u00_hi',`%f2') define(`u32_hi',`%f4')
+define(`u00_lo',`%f3') define(`u32_lo',`%f5')
+
+define(`cy',`%g1')
+define(`rlimb',`%g3')
+define(`i00',`%l0') define(`i16',`%l1')
+define(`r00',`%l2') define(`r32',`%l3')
+define(`xffffffff',`%l7')
+define(`xffff',`%o0')
+
+
+PROLOGUE(mpn_addmul_2)
+
+C Initialization. (1) Split v operand into eight 16-bit chunks and store them
+C as IEEE double in fp registers. (2) Clear upper 32 bits of fp register pairs
+C f2 and f4. (3) Store masks in registers aliased to `xffff' and `xffffffff'.
+C This code could be better scheduled.
+
+ save %sp, -256, %sp
+
+ifdef(`HAVE_VIS',
+` mov -1, %g4
+ wr %g0, 0xD2, %asi
+ srlx %g4, 32, xffffffff C store mask in register `xffffffff'
+ ldda [%i3+6] %asi, v000
+ ldda [%i3+4] %asi, v016
+ ldda [%i3+2] %asi, v032
+ ldda [%i3+0] %asi, v048
+ fxtod v000, v000
+ ldda [%i3+14] %asi, v064
+ fxtod v016, v016
+ ldda [%i3+12] %asi, v080
+ fxtod v032, v032
+ ldda [%i3+10] %asi, v096
+ fxtod v048, v048
+ ldda [%i3+8] %asi, v112
+ fxtod v064, v064
+ fxtod v080, v080
+ fxtod v096, v096
+ fxtod v112, v112
+ fzero u00_hi
+ fzero u32_hi
+',
+` mov -1, %g4
+ ldx [%i3+0], %l0 C vp[0]
+ srlx %g4, 48, xffff C store mask in register `xffff'
+ ldx [%i3+8], %l1 C vp[1]
+
+ and %l0, xffff, %g2
+ stx %g2, [%sp+2223+0]
+ srlx %l0, 16, %g3
+ and %g3, xffff, %g3
+ stx %g3, [%sp+2223+8]
+ srlx %l0, 32, %g2
+ and %g2, xffff, %g2
+ stx %g2, [%sp+2223+16]
+ srlx %l0, 48, %g3
+ stx %g3, [%sp+2223+24]
+ and %l1, xffff, %g2
+ stx %g2, [%sp+2223+32]
+ srlx %l1, 16, %g3
+ and %g3, xffff, %g3
+ stx %g3, [%sp+2223+40]
+ srlx %l1, 32, %g2
+ and %g2, xffff, %g2
+ stx %g2, [%sp+2223+48]
+ srlx %l1, 48, %g3
+ stx %g3, [%sp+2223+56]
+
+ srlx %g4, 32, xffffffff C store mask in register `xffffffff'
+
+ ldd [%sp+2223+0], v000
+ ldd [%sp+2223+8], v016
+ ldd [%sp+2223+16], v032
+ ldd [%sp+2223+24], v048
+ fxtod v000, v000
+ ldd [%sp+2223+32], v064
+ fxtod v016, v016
+ ldd [%sp+2223+40], v080
+ fxtod v032, v032
+ ldd [%sp+2223+48], v096
+ fxtod v048, v048
+ ldd [%sp+2223+56], v112
+ fxtod v064, v064
+ ld [%sp+2223+0], u00_hi C zero u00_hi
+ fxtod v080, v080
+ ld [%sp+2223+0], u32_hi C zero u32_hi
+ fxtod v096, v096
+ fxtod v112, v112
+')
+C Initialization done.
+ mov 0, %g2
+ mov 0, rlimb
+ mov 0, %g4
+ add %i0, -8, %i0 C BOOKKEEPING
+
+C Start software pipeline.
+
+ ld [%i1+4], u00_lo C read low 32 bits of up[i]
+ fxtod u00_hi, u00
+C mid
+ ld [%i1+0], u32_lo C read high 32 bits of up[i]
+ fmuld u00, v000, a000
+ fmuld u00, v016, a016
+ fmuld u00, v032, a032
+ fmuld u00, v048, a048
+ add %i2, -1, %i2 C BOOKKEEPING
+ fmuld u00, v064, p064
+ add %i1, 8, %i1 C BOOKKEEPING
+ fxtod u32_hi, u32
+ fmuld u00, v080, p080
+ fmuld u00, v096, p096a
+ brnz,pt %i2, .L_2_or_more
+ fmuld u00, v112, p112a
+
+.L1: fdtox a000, out000
+ fmuld u32, v000, p000
+ fdtox a016, out016
+ fmuld u32, v016, p016
+ fmovd p064, a064
+ fmuld u32, v032, p032
+ fmovd p080, a080
+ fmuld u32, v048, p048
+ std out000, [%sp+2223+16]
+ faddd p000, a032, a000
+ fmuld u32, v064, p064
+ std out016, [%sp+2223+24]
+ fxtod u00_hi, u00
+ faddd p016, a048, a016
+ fmuld u32, v080, p080
+ faddd p032, a064, a032
+ fmuld u32, v096, p096b
+ faddd p048, a080, a048
+ fmuld u32, v112, p112b
+C mid
+ fdtox a000, out000
+ fdtox a016, out016
+ faddd p064, p096a, a064
+ faddd p080, p112a, a080
+ std out000, [%sp+2223+0]
+ b .L_wd2
+ std out016, [%sp+2223+8]
+
+.L_2_or_more:
+ ld [%i1+4], u00_lo C read low 32 bits of up[i]
+ fdtox a000, out000
+ fmuld u32, v000, p000
+ fdtox a016, out016
+ fmuld u32, v016, p016
+ fmovd p064, a064
+ fmuld u32, v032, p032
+ fmovd p080, a080
+ fmuld u32, v048, p048
+ std out000, [%sp+2223+16]
+ faddd p000, a032, a000
+ fmuld u32, v064, p064
+ std out016, [%sp+2223+24]
+ fxtod u00_hi, u00
+ faddd p016, a048, a016
+ fmuld u32, v080, p080
+ faddd p032, a064, a032
+ fmuld u32, v096, p096b
+ faddd p048, a080, a048
+ fmuld u32, v112, p112b
+C mid
+ ld [%i1+0], u32_lo C read high 32 bits of up[i]
+ fdtox a000, out000
+ fmuld u00, v000, p000
+ fdtox a016, out016
+ fmuld u00, v016, p016
+ faddd p064, p096a, a064
+ fmuld u00, v032, p032
+ faddd p080, p112a, a080
+ fmuld u00, v048, p048
+ add %i2, -1, %i2 C BOOKKEEPING
+ std out000, [%sp+2223+0]
+ faddd p000, a032, a000
+ fmuld u00, v064, p064
+ add %i1, 8, %i1 C BOOKKEEPING
+ std out016, [%sp+2223+8]
+ fxtod u32_hi, u32
+ faddd p016, a048, a016
+ fmuld u00, v080, p080
+ faddd p032, a064, a032
+ fmuld u00, v096, p096a
+ faddd p048, a080, a048
+ brnz,pt %i2, .L_3_or_more
+ fmuld u00, v112, p112a
+
+ b .Lend
+ nop
+
+C 64 32 0
+C . . .
+C . |__rXXX_| 32
+C . |___cy___| 34
+C . |_______i00__| 50
+C |_______i16__| . 50
+
+
+C BEGIN MAIN LOOP
+ .align 16
+.L_3_or_more:
+.Loop: ld [%i1+4], u00_lo C read low 32 bits of up[i]
+ and %g2, xffffffff, %g2
+ fdtox a000, out000
+ fmuld u32, v000, p000
+C
+ lduw [%i0+4+8], r00 C read low 32 bits of rp[i]
+ add %g2, rlimb, %l5
+ fdtox a016, out016
+ fmuld u32, v016, p016
+C
+ srlx %l5, 32, cy
+ ldx [%sp+2223+16], i00
+ faddd p064, p096b, a064
+ fmuld u32, v032, p032
+C
+ add %g4, cy, cy C new cy
+ ldx [%sp+2223+24], i16
+ faddd p080, p112b, a080
+ fmuld u32, v048, p048
+C
+ nop
+ std out000, [%sp+2223+16]
+ faddd p000, a032, a000
+ fmuld u32, v064, p064
+C
+ add i00, r00, rlimb
+ add %i0, 8, %i0 C BOOKKEEPING
+ std out016, [%sp+2223+24]
+ fxtod u00_hi, u00
+C
+ sllx i16, 16, %g2
+ add cy, rlimb, rlimb
+ faddd p016, a048, a016
+ fmuld u32, v080, p080
+C
+ srlx i16, 16, %g4
+ add %g2, rlimb, %l5
+ faddd p032, a064, a032
+ fmuld u32, v096, p096b
+C
+ stw %l5, [%i0+4]
+ nop
+ faddd p048, a080, a048
+ fmuld u32, v112, p112b
+C midloop
+ ld [%i1+0], u32_lo C read high 32 bits of up[i]
+ and %g2, xffffffff, %g2
+ fdtox a000, out000
+ fmuld u00, v000, p000
+C
+ lduw [%i0+0], r32 C read high 32 bits of rp[i]
+ add %g2, rlimb, %l5
+ fdtox a016, out016
+ fmuld u00, v016, p016
+C
+ srlx %l5, 32, cy
+ ldx [%sp+2223+0], i00
+ faddd p064, p096a, a064
+ fmuld u00, v032, p032
+C
+ add %g4, cy, cy C new cy
+ ldx [%sp+2223+8], i16
+ faddd p080, p112a, a080
+ fmuld u00, v048, p048
+C
+ add %i2, -1, %i2 C BOOKKEEPING
+ std out000, [%sp+2223+0]
+ faddd p000, a032, a000
+ fmuld u00, v064, p064
+C
+ add i00, r32, rlimb
+ add %i1, 8, %i1 C BOOKKEEPING
+ std out016, [%sp+2223+8]
+ fxtod u32_hi, u32
+C
+ sllx i16, 16, %g2
+ add cy, rlimb, rlimb
+ faddd p016, a048, a016
+ fmuld u00, v080, p080
+C
+ srlx i16, 16, %g4
+ add %g2, rlimb, %l5
+ faddd p032, a064, a032
+ fmuld u00, v096, p096a
+C
+ stw %l5, [%i0+0]
+ faddd p048, a080, a048
+ brnz,pt %i2, .Loop
+ fmuld u00, v112, p112a
+C END MAIN LOOP
+
+C WIND-DOWN PHASE 1
+.Lend: and %g2, xffffffff, %g2
+ fdtox a000, out000
+ fmuld u32, v000, p000
+ lduw [%i0+4+8], r00 C read low 32 bits of rp[i]
+ add %g2, rlimb, %l5
+ fdtox a016, out016
+ fmuld u32, v016, p016
+ srlx %l5, 32, cy
+ ldx [%sp+2223+16], i00
+ faddd p064, p096b, a064
+ fmuld u32, v032, p032
+ add %g4, cy, cy C new cy
+ ldx [%sp+2223+24], i16
+ faddd p080, p112b, a080
+ fmuld u32, v048, p048
+ std out000, [%sp+2223+16]
+ faddd p000, a032, a000
+ fmuld u32, v064, p064
+ add i00, r00, rlimb
+ add %i0, 8, %i0 C BOOKKEEPING
+ std out016, [%sp+2223+24]
+ sllx i16, 16, %g2
+ add cy, rlimb, rlimb
+ faddd p016, a048, a016
+ fmuld u32, v080, p080
+ srlx i16, 16, %g4
+ add %g2, rlimb, %l5
+ faddd p032, a064, a032
+ fmuld u32, v096, p096b
+ stw %l5, [%i0+4]
+ faddd p048, a080, a048
+ fmuld u32, v112, p112b
+C mid
+ and %g2, xffffffff, %g2
+ fdtox a000, out000
+ lduw [%i0+0], r32 C read high 32 bits of rp[i]
+ add %g2, rlimb, %l5
+ fdtox a016, out016
+ srlx %l5, 32, cy
+ ldx [%sp+2223+0], i00
+ faddd p064, p096a, a064
+ add %g4, cy, cy C new cy
+ ldx [%sp+2223+8], i16
+ faddd p080, p112a, a080
+ std out000, [%sp+2223+0]
+ add i00, r32, rlimb
+ std out016, [%sp+2223+8]
+ sllx i16, 16, %g2
+ add cy, rlimb, rlimb
+ srlx i16, 16, %g4
+ add %g2, rlimb, %l5
+ stw %l5, [%i0+0]
+
+C WIND-DOWN PHASE 2
+.L_wd2: and %g2, xffffffff, %g2
+ fdtox a032, out000
+ lduw [%i0+4+8], r00 C read low 32 bits of rp[i]
+ add %g2, rlimb, %l5
+ fdtox a048, out016
+ srlx %l5, 32, cy
+ ldx [%sp+2223+16], i00
+ add %g4, cy, cy C new cy
+ ldx [%sp+2223+24], i16
+ std out000, [%sp+2223+16]
+ add i00, r00, rlimb
+ add %i0, 8, %i0 C BOOKKEEPING
+ std out016, [%sp+2223+24]
+ sllx i16, 16, %g2
+ add cy, rlimb, rlimb
+ srlx i16, 16, %g4
+ add %g2, rlimb, %l5
+ stw %l5, [%i0+4]
+C mid
+ and %g2, xffffffff, %g2
+ fdtox a064, out000
+ lduw [%i0+0], r32 C read high 32 bits of rp[i]
+ add %g2, rlimb, %l5
+ fdtox a080, out016
+ srlx %l5, 32, cy
+ ldx [%sp+2223+0], i00
+ add %g4, cy, cy C new cy
+ ldx [%sp+2223+8], i16
+ std out000, [%sp+2223+0]
+ add i00, r32, rlimb
+ std out016, [%sp+2223+8]
+ sllx i16, 16, %g2
+ add cy, rlimb, rlimb
+ srlx i16, 16, %g4
+ add %g2, rlimb, %l5
+ stw %l5, [%i0+0]
+
+C WIND-DOWN PHASE 3
+.L_wd3: and %g2, xffffffff, %g2
+ fdtox p096b, out000
+ add %g2, rlimb, %l5
+ fdtox p112b, out016
+ srlx %l5, 32, cy
+ ldx [%sp+2223+16], rlimb
+ add %g4, cy, cy C new cy
+ ldx [%sp+2223+24], i16
+ std out000, [%sp+2223+16]
+ add %i0, 8, %i0 C BOOKKEEPING
+ std out016, [%sp+2223+24]
+ sllx i16, 16, %g2
+ add cy, rlimb, rlimb
+ srlx i16, 16, %g4
+ add %g2, rlimb, %l5
+ stw %l5, [%i0+4]
+C mid
+ and %g2, xffffffff, %g2
+ add %g2, rlimb, %l5
+ srlx %l5, 32, cy
+ ldx [%sp+2223+0], rlimb
+ add %g4, cy, cy C new cy
+ ldx [%sp+2223+8], i16
+ sllx i16, 16, %g2
+ add cy, rlimb, rlimb
+ srlx i16, 16, %g4
+ add %g2, rlimb, %l5
+ stw %l5, [%i0+0]
+
+ and %g2, xffffffff, %g2
+ add %g2, rlimb, %l5
+ srlx %l5, 32, cy
+ ldx [%sp+2223+16], i00
+ add %g4, cy, cy C new cy
+ ldx [%sp+2223+24], i16
+
+ sllx i16, 16, %g2
+ add i00, cy, cy
+ return %i7+8
+ add %g2, cy, %o0
+EPILOGUE(mpn_addmul_2)
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/ultrasparc1234/lshiftc.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/ultrasparc1234/lshiftc.asm
new file mode 100644
index 00000000000..47286d569e7
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/ultrasparc1234/lshiftc.asm
@@ -0,0 +1,165 @@
+dnl SPARC v9 mpn_lshiftc
+
+dnl Copyright 1996, 2000-2003, 2010 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 1&2: 3
+C UltraSPARC 3: 2.67
+
+C INPUT PARAMETERS
+define(`rp', `%i0')
+define(`up', `%i1')
+define(`n', `%i2')
+define(`cnt',`%i3')
+
+define(`u0', `%l0')
+define(`u1', `%l2')
+define(`u2', `%l4')
+define(`u3', `%l6')
+
+define(`tnc',`%i4')
+
+define(`fanop',`fitod %f0,%f2') dnl A quasi nop running in the FA pipe
+
+ASM_START()
+ REGISTER(%g2,#scratch)
+ REGISTER(%g3,#scratch)
+PROLOGUE(mpn_lshiftc)
+ save %sp,-160,%sp
+
+ sllx n,3,%g1
+ sub %g0,cnt,tnc C negate shift count
+ add up,%g1,up C make %o1 point at end of src
+ add rp,%g1,rp C make %o0 point at end of res
+ ldx [up-8],u3 C load first limb
+ subcc n,5,n
+ srlx u3,tnc,%i5 C compute function result
+ bl,pn %xcc,.Lend1234
+ sllx u3,cnt,%g3
+
+ subcc n,4,n
+ ldx [up-16],u0
+ ldx [up-24],u1
+ add up,-32,up
+ ldx [up-0],u2
+ ldx [up-8],u3
+ srlx u0,tnc,%g2
+ bl,pn %xcc,.Lend5678
+ not %g3, %g3
+
+ b,a .Loop
+ ALIGN(16)
+.Loop:
+ sllx u0,cnt,%g1
+ andn %g3,%g2,%g3
+ ldx [up-16],u0
+ fanop
+C --
+ srlx u1,tnc,%g2
+ subcc n,4,n
+ stx %g3,[rp-8]
+ not %g1, %g1
+C --
+ sllx u1,cnt,%g3
+ andn %g1,%g2,%g1
+ ldx [up-24],u1
+ fanop
+C --
+ srlx u2,tnc,%g2
+ stx %g1,[rp-16]
+ add up,-32,up
+ not %g3, %g3
+C --
+ sllx u2,cnt,%g1
+ andn %g3,%g2,%g3
+ ldx [up-0],u2
+ fanop
+C --
+ srlx u3,tnc,%g2
+ stx %g3,[rp-24]
+ add rp,-32,rp
+ not %g1, %g1
+C --
+ sllx u3,cnt,%g3
+ andn %g1,%g2,%g1
+ ldx [up-8],u3
+ fanop
+C --
+ srlx u0,tnc,%g2
+ stx %g1,[rp-0]
+ bge,pt %xcc,.Loop
+ not %g3, %g3
+C --
+.Lend5678:
+ sllx u0,cnt,%g1
+ andn %g3,%g2,%g3
+ srlx u1,tnc,%g2
+ stx %g3,[rp-8]
+ not %g1, %g1
+ sllx u1,cnt,%g3
+ andn %g1,%g2,%g1
+ srlx u2,tnc,%g2
+ stx %g1,[rp-16]
+ not %g3, %g3
+ sllx u2,cnt,%g1
+ andn %g3,%g2,%g3
+ srlx u3,tnc,%g2
+ stx %g3,[rp-24]
+ add rp,-32,rp
+ not %g1, %g1
+ sllx u3,cnt,%g3 C carry...
+ andn %g1,%g2,%g1
+ stx %g1,[rp-0]
+
+.Lend1234:
+ addcc n,4,n
+ bz,pn %xcc,.Lret
+ fanop
+.Loop0:
+ add rp,-8,rp
+ subcc n,1,n
+ ldx [up-16],u3
+ add up,-8,up
+ srlx u3,tnc,%g2
+ not %g3, %g3
+ andn %g3,%g2,%g3
+ stx %g3,[rp]
+ sllx u3,cnt,%g3
+ bnz,pt %xcc,.Loop0
+ fanop
+.Lret:
+ not %g3, %g3
+ stx %g3,[rp-8]
+ mov %i5,%i0
+ ret
+ restore
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/ultrasparc1234/mul_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/ultrasparc1234/mul_1.asm
new file mode 100644
index 00000000000..871d562fcb2
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/ultrasparc1234/mul_1.asm
@@ -0,0 +1,580 @@
+dnl SPARC v9 64-bit mpn_mul_1 -- Multiply a limb vector with a limb and store
+dnl the result in a second limb vector.
+
+dnl Copyright 1998, 2000-2003 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 1&2: 14
+C UltraSPARC 3: 18.5
+
+C Algorithm: We use eight floating-point multiplies per limb product, with the
+C invariant v operand split into four 16-bit pieces, and the s1 operand split
+C into 32-bit pieces. We sum pairs of 48-bit partial products using
+C floating-point add, then convert the four 49-bit product-sums and transfer
+C them to the integer unit.
+
+C Possible optimizations:
+C 1. Align the stack area where we transfer the four 49-bit product-sums
+C to a 32-byte boundary. That would minimize the cache collision.
+C (UltraSPARC-1/2 use a direct-mapped cache.) (Perhaps even better would
+C be to align the area to map to the area immediately before s1?)
+C 2. Sum the 4 49-bit quantities using 32-bit operations, as in the
+C develop mpn_addmul_2. This would save many integer instructions.
+C 3. Unrolling. Questionable if it is worth the code expansion, given that
+C it could only save 1 cycle/limb.
+C 4. Specialize for particular v values. If its upper 32 bits are zero, we
+C could save many operations, in the FPU (fmuld), but more so in the IEU
+C since we'll be summing 48-bit quantities, which might be simpler.
+C 5. Ideally, we should schedule the f2/f3 and f4/f5 RAW further apart, and
+C the i00,i16,i32,i48 RAW less apart. The latter apart-scheduling should
+C not be greater than needed for L2 cache latency, and also not so great
+C that i16 needs to be copied.
+C 6. Avoid performing mem+fa+fm in the same cycle, at least not when we want
+C to get high IEU bandwidth. (12 of the 14 cycles will be free for 2 IEU
+C ops.)
+
+C Instruction classification (as per UltraSPARC-1/2 functional units):
+C 8 FM
+C 10 FA
+C 11 MEM
+C 9 ISHIFT + 10? IADDLOG
+C 1 BRANCH
+C 49 insns totally (plus three mov insns that should be optimized out)
+
+C The loop executes 53 instructions in 14 cycles on UltraSPARC-1/2, i.e we
+C sustain 3.79 instructions/cycle.
+
+C INPUT PARAMETERS
+C rp i0
+C up i1
+C n i2
+C v i3
+
+ASM_START()
+ REGISTER(%g2,#scratch)
+ REGISTER(%g3,#scratch)
+
+define(`p00', `%f8') define(`p16',`%f10') define(`p32',`%f12') define(`p48',`%f14')
+define(`r32',`%f16') define(`r48',`%f18') define(`r64',`%f20') define(`r80',`%f22')
+define(`v00',`%f24') define(`v16',`%f26') define(`v32',`%f28') define(`v48',`%f30')
+define(`u00',`%f32') define(`u32', `%f34')
+define(`a00',`%f36') define(`a16',`%f38') define(`a32',`%f40') define(`a48',`%f42')
+define(`cy',`%g1')
+define(`rlimb',`%g3')
+define(`i00',`%l0') define(`i16',`%l1') define(`i32',`%l2') define(`i48',`%l3')
+define(`xffffffff',`%l7')
+define(`xffff',`%o0')
+
+PROLOGUE(mpn_mul_1)
+
+C Initialization. (1) Split v operand into four 16-bit chunks and store them
+C as IEEE double in fp registers. (2) Clear upper 32 bits of fp register pairs
+C f2 and f4. (3) Store masks in registers aliased to `xffff' and `xffffffff'.
+
+ save %sp, -256, %sp
+ mov -1, %g4
+ srlx %g4, 48, xffff C store mask in register `xffff'
+ and %i3, xffff, %g2
+ stx %g2, [%sp+2223+0]
+ srlx %i3, 16, %g3
+ and %g3, xffff, %g3
+ stx %g3, [%sp+2223+8]
+ srlx %i3, 32, %g2
+ and %g2, xffff, %g2
+ stx %g2, [%sp+2223+16]
+ srlx %i3, 48, %g3
+ stx %g3, [%sp+2223+24]
+ srlx %g4, 32, xffffffff C store mask in register `xffffffff'
+
+ sllx %i2, 3, %i2
+ mov 0, cy C clear cy
+ add %i0, %i2, %i0
+ add %i1, %i2, %i1
+ neg %i2
+ add %i1, 4, %i5
+ add %i0, -32, %i4
+ add %i0, -16, %i0
+
+ ldd [%sp+2223+0], v00
+ ldd [%sp+2223+8], v16
+ ldd [%sp+2223+16], v32
+ ldd [%sp+2223+24], v48
+ ld [%sp+2223+0],%f2 C zero f2
+ ld [%sp+2223+0],%f4 C zero f4
+ ld [%i5+%i2], %f3 C read low 32 bits of up[i]
+ ld [%i1+%i2], %f5 C read high 32 bits of up[i]
+ fxtod v00, v00
+ fxtod v16, v16
+ fxtod v32, v32
+ fxtod v48, v48
+
+C Start real work. (We sneakingly read f3 and f5 above...)
+C The software pipeline is very deep, requiring 4 feed-in stages.
+
+ fxtod %f2, u00
+ fxtod %f4, u32
+ fmuld u00, v00, a00
+ fmuld u00, v16, a16
+ fmuld u00, v32, p32
+ fmuld u32, v00, r32
+ fmuld u00, v48, p48
+ addcc %i2, 8, %i2
+ bnz,pt %xcc, .L_two_or_more
+ fmuld u32, v16, r48
+
+.L_one:
+ fmuld u32, v32, r64 C FIXME not urgent
+ faddd p32, r32, a32
+ fdtox a00, a00
+ faddd p48, r48, a48
+ fmuld u32, v48, r80 C FIXME not urgent
+ fdtox a16, a16
+ fdtox a32, a32
+ fdtox a48, a48
+ std a00, [%sp+2223+0]
+ std a16, [%sp+2223+8]
+ std a32, [%sp+2223+16]
+ std a48, [%sp+2223+24]
+ add %i2, 8, %i2
+
+ fdtox r64, a00
+ fdtox r80, a16
+ ldx [%sp+2223+0], i00
+ ldx [%sp+2223+8], i16
+ ldx [%sp+2223+16], i32
+ ldx [%sp+2223+24], i48
+ std a00, [%sp+2223+0]
+ std a16, [%sp+2223+8]
+ add %i2, 8, %i2
+
+ mov i00, %g5 C i00+ now in g5
+ ldx [%sp+2223+0], i00
+ srlx i16, 48, %l4 C (i16 >> 48)
+ mov i16, %g2
+ ldx [%sp+2223+8], i16
+ srlx i48, 16, %l5 C (i48 >> 16)
+ mov i32, %g4 C i32+ now in g4
+ sllx i48, 32, %l6 C (i48 << 32)
+ srlx %g4, 32, %o3 C (i32 >> 32)
+ add %l5, %l4, %o1 C hi64- in %o1
+ std a00, [%sp+2223+0]
+ sllx %g4, 16, %o2 C (i32 << 16)
+ add %o3, %o1, %o1 C hi64 in %o1 1st ASSIGNMENT
+ std a16, [%sp+2223+8]
+ sllx %o1, 48, %o3 C (hi64 << 48)
+ add %g2, %o2, %o2 C mi64- in %o2
+ add %l6, %o2, %o2 C mi64- in %o2
+ sub %o2, %o3, %o2 C mi64 in %o2 1st ASSIGNMENT
+ add cy, %g5, %o4 C x = prev(i00) + cy
+ b .L_out_1
+ add %i2, 8, %i2
+
+.L_two_or_more:
+ ld [%i5+%i2], %f3 C read low 32 bits of up[i]
+ fmuld u32, v32, r64 C FIXME not urgent
+ faddd p32, r32, a32
+ ld [%i1+%i2], %f5 C read high 32 bits of up[i]
+ fdtox a00, a00
+ faddd p48, r48, a48
+ fmuld u32, v48, r80 C FIXME not urgent
+ fdtox a16, a16
+ fdtox a32, a32
+ fxtod %f2, u00
+ fxtod %f4, u32
+ fdtox a48, a48
+ std a00, [%sp+2223+0]
+ fmuld u00, v00, p00
+ std a16, [%sp+2223+8]
+ fmuld u00, v16, p16
+ std a32, [%sp+2223+16]
+ fmuld u00, v32, p32
+ std a48, [%sp+2223+24]
+ faddd p00, r64, a00
+ fmuld u32, v00, r32
+ faddd p16, r80, a16
+ fmuld u00, v48, p48
+ addcc %i2, 8, %i2
+ bnz,pt %xcc, .L_three_or_more
+ fmuld u32, v16, r48
+
+.L_two:
+ fmuld u32, v32, r64 C FIXME not urgent
+ faddd p32, r32, a32
+ fdtox a00, a00
+ faddd p48, r48, a48
+ fmuld u32, v48, r80 C FIXME not urgent
+ fdtox a16, a16
+ ldx [%sp+2223+0], i00
+ fdtox a32, a32
+ ldx [%sp+2223+8], i16
+ ldx [%sp+2223+16], i32
+ ldx [%sp+2223+24], i48
+ fdtox a48, a48
+ std a00, [%sp+2223+0]
+ std a16, [%sp+2223+8]
+ std a32, [%sp+2223+16]
+ std a48, [%sp+2223+24]
+ add %i2, 8, %i2
+
+ fdtox r64, a00
+ mov i00, %g5 C i00+ now in g5
+ fdtox r80, a16
+ ldx [%sp+2223+0], i00
+ srlx i16, 48, %l4 C (i16 >> 48)
+ mov i16, %g2
+ ldx [%sp+2223+8], i16
+ srlx i48, 16, %l5 C (i48 >> 16)
+ mov i32, %g4 C i32+ now in g4
+ ldx [%sp+2223+16], i32
+ sllx i48, 32, %l6 C (i48 << 32)
+ ldx [%sp+2223+24], i48
+ srlx %g4, 32, %o3 C (i32 >> 32)
+ add %l5, %l4, %o1 C hi64- in %o1
+ std a00, [%sp+2223+0]
+ sllx %g4, 16, %o2 C (i32 << 16)
+ add %o3, %o1, %o1 C hi64 in %o1 1st ASSIGNMENT
+ std a16, [%sp+2223+8]
+ sllx %o1, 48, %o3 C (hi64 << 48)
+ add %g2, %o2, %o2 C mi64- in %o2
+ add %l6, %o2, %o2 C mi64- in %o2
+ sub %o2, %o3, %o2 C mi64 in %o2 1st ASSIGNMENT
+ add cy, %g5, %o4 C x = prev(i00) + cy
+ b .L_out_2
+ add %i2, 8, %i2
+
+.L_three_or_more:
+ ld [%i5+%i2], %f3 C read low 32 bits of up[i]
+ fmuld u32, v32, r64 C FIXME not urgent
+ faddd p32, r32, a32
+ ld [%i1+%i2], %f5 C read high 32 bits of up[i]
+ fdtox a00, a00
+ faddd p48, r48, a48
+ fmuld u32, v48, r80 C FIXME not urgent
+ fdtox a16, a16
+ ldx [%sp+2223+0], i00
+ fdtox a32, a32
+ ldx [%sp+2223+8], i16
+ fxtod %f2, u00
+ ldx [%sp+2223+16], i32
+ fxtod %f4, u32
+ ldx [%sp+2223+24], i48
+ fdtox a48, a48
+ std a00, [%sp+2223+0]
+ fmuld u00, v00, p00
+ std a16, [%sp+2223+8]
+ fmuld u00, v16, p16
+ std a32, [%sp+2223+16]
+ fmuld u00, v32, p32
+ std a48, [%sp+2223+24]
+ faddd p00, r64, a00
+ fmuld u32, v00, r32
+ faddd p16, r80, a16
+ fmuld u00, v48, p48
+ addcc %i2, 8, %i2
+ bnz,pt %xcc, .L_four_or_more
+ fmuld u32, v16, r48
+
+.L_three:
+ fmuld u32, v32, r64 C FIXME not urgent
+ faddd p32, r32, a32
+ fdtox a00, a00
+ faddd p48, r48, a48
+ mov i00, %g5 C i00+ now in g5
+ fmuld u32, v48, r80 C FIXME not urgent
+ fdtox a16, a16
+ ldx [%sp+2223+0], i00
+ fdtox a32, a32
+ srlx i16, 48, %l4 C (i16 >> 48)
+ mov i16, %g2
+ ldx [%sp+2223+8], i16
+ srlx i48, 16, %l5 C (i48 >> 16)
+ mov i32, %g4 C i32+ now in g4
+ ldx [%sp+2223+16], i32
+ sllx i48, 32, %l6 C (i48 << 32)
+ ldx [%sp+2223+24], i48
+ fdtox a48, a48
+ srlx %g4, 32, %o3 C (i32 >> 32)
+ add %l5, %l4, %o1 C hi64- in %o1
+ std a00, [%sp+2223+0]
+ sllx %g4, 16, %o2 C (i32 << 16)
+ add %o3, %o1, %o1 C hi64 in %o1 1st ASSIGNMENT
+ std a16, [%sp+2223+8]
+ sllx %o1, 48, %o3 C (hi64 << 48)
+ add %g2, %o2, %o2 C mi64- in %o2
+ std a32, [%sp+2223+16]
+ add %l6, %o2, %o2 C mi64- in %o2
+ std a48, [%sp+2223+24]
+ sub %o2, %o3, %o2 C mi64 in %o2 1st ASSIGNMENT
+ add cy, %g5, %o4 C x = prev(i00) + cy
+ b .L_out_3
+ add %i2, 8, %i2
+
+.L_four_or_more:
+ ld [%i5+%i2], %f3 C read low 32 bits of up[i]
+ fmuld u32, v32, r64 C FIXME not urgent
+ faddd p32, r32, a32
+ ld [%i1+%i2], %f5 C read high 32 bits of up[i]
+ fdtox a00, a00
+ faddd p48, r48, a48
+ mov i00, %g5 C i00+ now in g5
+ fmuld u32, v48, r80 C FIXME not urgent
+ fdtox a16, a16
+ ldx [%sp+2223+0], i00
+ fdtox a32, a32
+ srlx i16, 48, %l4 C (i16 >> 48)
+ mov i16, %g2
+ ldx [%sp+2223+8], i16
+ fxtod %f2, u00
+ srlx i48, 16, %l5 C (i48 >> 16)
+ mov i32, %g4 C i32+ now in g4
+ ldx [%sp+2223+16], i32
+ fxtod %f4, u32
+ sllx i48, 32, %l6 C (i48 << 32)
+ ldx [%sp+2223+24], i48
+ fdtox a48, a48
+ srlx %g4, 32, %o3 C (i32 >> 32)
+ add %l5, %l4, %o1 C hi64- in %o1
+ std a00, [%sp+2223+0]
+ fmuld u00, v00, p00
+ sllx %g4, 16, %o2 C (i32 << 16)
+ add %o3, %o1, %o1 C hi64 in %o1 1st ASSIGNMENT
+ std a16, [%sp+2223+8]
+ fmuld u00, v16, p16
+ sllx %o1, 48, %o3 C (hi64 << 48)
+ add %g2, %o2, %o2 C mi64- in %o2
+ std a32, [%sp+2223+16]
+ fmuld u00, v32, p32
+ add %l6, %o2, %o2 C mi64- in %o2
+ std a48, [%sp+2223+24]
+ faddd p00, r64, a00
+ fmuld u32, v00, r32
+ sub %o2, %o3, %o2 C mi64 in %o2 1st ASSIGNMENT
+ faddd p16, r80, a16
+ fmuld u00, v48, p48
+ add cy, %g5, %o4 C x = prev(i00) + cy
+ addcc %i2, 8, %i2
+ bnz,pt %xcc, .Loop
+ fmuld u32, v16, r48
+
+.L_four:
+ b,a .L_out_4
+
+C BEGIN MAIN LOOP
+ .align 16
+.Loop:
+C 00
+ srlx %o4, 16, %o5 C (x >> 16)
+ ld [%i5+%i2], %f3 C read low 32 bits of up[i]
+ fmuld u32, v32, r64 C FIXME not urgent
+ faddd p32, r32, a32
+C 01
+ add %o5, %o2, %o2 C mi64 in %o2 2nd ASSIGNMENT
+ and %o4, xffff, %o5 C (x & 0xffff)
+ ld [%i1+%i2], %f5 C read high 32 bits of up[i]
+ fdtox a00, a00
+C 02
+ faddd p48, r48, a48
+C 03
+ srlx %o2, 48, %o7 C (mi64 >> 48)
+ mov i00, %g5 C i00+ now in g5
+ fmuld u32, v48, r80 C FIXME not urgent
+ fdtox a16, a16
+C 04
+ sllx %o2, 16, %i3 C (mi64 << 16)
+ add %o7, %o1, cy C new cy
+ ldx [%sp+2223+0], i00
+ fdtox a32, a32
+C 05
+ srlx i16, 48, %l4 C (i16 >> 48)
+ mov i16, %g2
+ ldx [%sp+2223+8], i16
+ fxtod %f2, u00
+C 06
+ srlx i48, 16, %l5 C (i48 >> 16)
+ mov i32, %g4 C i32+ now in g4
+ ldx [%sp+2223+16], i32
+ fxtod %f4, u32
+C 07
+ sllx i48, 32, %l6 C (i48 << 32)
+ or %i3, %o5, %o5
+ ldx [%sp+2223+24], i48
+ fdtox a48, a48
+C 08
+ srlx %g4, 32, %o3 C (i32 >> 32)
+ add %l5, %l4, %o1 C hi64- in %o1
+ std a00, [%sp+2223+0]
+ fmuld u00, v00, p00
+C 09
+ sllx %g4, 16, %o2 C (i32 << 16)
+ add %o3, %o1, %o1 C hi64 in %o1 1st ASSIGNMENT
+ std a16, [%sp+2223+8]
+ fmuld u00, v16, p16
+C 10
+ sllx %o1, 48, %o3 C (hi64 << 48)
+ add %g2, %o2, %o2 C mi64- in %o2
+ std a32, [%sp+2223+16]
+ fmuld u00, v32, p32
+C 11
+ add %l6, %o2, %o2 C mi64- in %o2
+ std a48, [%sp+2223+24]
+ faddd p00, r64, a00
+ fmuld u32, v00, r32
+C 12
+ sub %o2, %o3, %o2 C mi64 in %o2 1st ASSIGNMENT
+ stx %o5, [%i4+%i2]
+ faddd p16, r80, a16
+ fmuld u00, v48, p48
+C 13
+ add cy, %g5, %o4 C x = prev(i00) + cy
+ addcc %i2, 8, %i2
+ bnz,pt %xcc, .Loop
+ fmuld u32, v16, r48
+C END MAIN LOOP
+
+.L_out_4:
+ srlx %o4, 16, %o5 C (x >> 16)
+ fmuld u32, v32, r64 C FIXME not urgent
+ faddd p32, r32, a32
+ add %o5, %o2, %o2 C mi64 in %o2 2nd ASSIGNMENT
+ and %o4, xffff, %o5 C (x & 0xffff)
+ fdtox a00, a00
+ faddd p48, r48, a48
+ srlx %o2, 48, %o7 C (mi64 >> 48)
+ mov i00, %g5 C i00+ now in g5
+ fmuld u32, v48, r80 C FIXME not urgent
+ fdtox a16, a16
+ sllx %o2, 16, %i3 C (mi64 << 16)
+ add %o7, %o1, cy C new cy
+ ldx [%sp+2223+0], i00
+ fdtox a32, a32
+ srlx i16, 48, %l4 C (i16 >> 48)
+ mov i16, %g2
+ ldx [%sp+2223+8], i16
+ srlx i48, 16, %l5 C (i48 >> 16)
+ mov i32, %g4 C i32+ now in g4
+ ldx [%sp+2223+16], i32
+ sllx i48, 32, %l6 C (i48 << 32)
+ or %i3, %o5, %o5
+ ldx [%sp+2223+24], i48
+ fdtox a48, a48
+ srlx %g4, 32, %o3 C (i32 >> 32)
+ add %l5, %l4, %o1 C hi64- in %o1
+ std a00, [%sp+2223+0]
+ sllx %g4, 16, %o2 C (i32 << 16)
+ add %o3, %o1, %o1 C hi64 in %o1 1st ASSIGNMENT
+ std a16, [%sp+2223+8]
+ sllx %o1, 48, %o3 C (hi64 << 48)
+ add %g2, %o2, %o2 C mi64- in %o2
+ std a32, [%sp+2223+16]
+ add %l6, %o2, %o2 C mi64- in %o2
+ std a48, [%sp+2223+24]
+ sub %o2, %o3, %o2 C mi64 in %o2 1st ASSIGNMENT
+ stx %o5, [%i4+%i2]
+ add cy, %g5, %o4 C x = prev(i00) + cy
+ add %i2, 8, %i2
+.L_out_3:
+ srlx %o4, 16, %o5 C (x >> 16)
+ add %o5, %o2, %o2 C mi64 in %o2 2nd ASSIGNMENT
+ and %o4, xffff, %o5 C (x & 0xffff)
+ fdtox r64, a00
+ srlx %o2, 48, %o7 C (mi64 >> 48)
+ mov i00, %g5 C i00+ now in g5
+ fdtox r80, a16
+ sllx %o2, 16, %i3 C (mi64 << 16)
+ add %o7, %o1, cy C new cy
+ ldx [%sp+2223+0], i00
+ srlx i16, 48, %l4 C (i16 >> 48)
+ mov i16, %g2
+ ldx [%sp+2223+8], i16
+ srlx i48, 16, %l5 C (i48 >> 16)
+ mov i32, %g4 C i32+ now in g4
+ ldx [%sp+2223+16], i32
+ sllx i48, 32, %l6 C (i48 << 32)
+ or %i3, %o5, %o5
+ ldx [%sp+2223+24], i48
+ srlx %g4, 32, %o3 C (i32 >> 32)
+ add %l5, %l4, %o1 C hi64- in %o1
+ std a00, [%sp+2223+0]
+ sllx %g4, 16, %o2 C (i32 << 16)
+ add %o3, %o1, %o1 C hi64 in %o1 1st ASSIGNMENT
+ std a16, [%sp+2223+8]
+ sllx %o1, 48, %o3 C (hi64 << 48)
+ add %g2, %o2, %o2 C mi64- in %o2
+ add %l6, %o2, %o2 C mi64- in %o2
+ sub %o2, %o3, %o2 C mi64 in %o2 1st ASSIGNMENT
+ stx %o5, [%i4+%i2]
+ add cy, %g5, %o4 C x = prev(i00) + cy
+ add %i2, 8, %i2
+.L_out_2:
+ srlx %o4, 16, %o5 C (x >> 16)
+ add %o5, %o2, %o2 C mi64 in %o2 2nd ASSIGNMENT
+ and %o4, xffff, %o5 C (x & 0xffff)
+ srlx %o2, 48, %o7 C (mi64 >> 48)
+ mov i00, %g5 C i00+ now in g5
+ sllx %o2, 16, %i3 C (mi64 << 16)
+ add %o7, %o1, cy C new cy
+ ldx [%sp+2223+0], i00
+ srlx i16, 48, %l4 C (i16 >> 48)
+ mov i16, %g2
+ ldx [%sp+2223+8], i16
+ srlx i48, 16, %l5 C (i48 >> 16)
+ mov i32, %g4 C i32+ now in g4
+ sllx i48, 32, %l6 C (i48 << 32)
+ or %i3, %o5, %o5
+ srlx %g4, 32, %o3 C (i32 >> 32)
+ add %l5, %l4, %o1 C hi64- in %o1
+ sllx %g4, 16, %o2 C (i32 << 16)
+ add %o3, %o1, %o1 C hi64 in %o1 1st ASSIGNMENT
+ sllx %o1, 48, %o3 C (hi64 << 48)
+ add %g2, %o2, %o2 C mi64- in %o2
+ add %l6, %o2, %o2 C mi64- in %o2
+ sub %o2, %o3, %o2 C mi64 in %o2 1st ASSIGNMENT
+ stx %o5, [%i4+%i2]
+ add cy, %g5, %o4 C x = prev(i00) + cy
+ add %i2, 8, %i2
+.L_out_1:
+ srlx %o4, 16, %o5 C (x >> 16)
+ add %o5, %o2, %o2 C mi64 in %o2 2nd ASSIGNMENT
+ and %o4, xffff, %o5 C (x & 0xffff)
+ srlx %o2, 48, %o7 C (mi64 >> 48)
+ sllx %o2, 16, %i3 C (mi64 << 16)
+ add %o7, %o1, cy C new cy
+ or %i3, %o5, %o5
+ stx %o5, [%i4+%i2]
+
+ sllx i00, 0, %g2
+ add %g2, cy, cy
+ sllx i16, 16, %g3
+ add %g3, cy, cy
+
+ return %i7+8
+ mov cy, %o0
+EPILOGUE(mpn_mul_1)
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/ultrasparc1234/sqr_diagonal.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/ultrasparc1234/sqr_diagonal.asm
new file mode 100644
index 00000000000..43c69d31d12
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/ultrasparc1234/sqr_diagonal.asm
@@ -0,0 +1,342 @@
+dnl SPARC v9 64-bit 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/.
+
+include(`../config.m4')
+
+C cycles/limb
+C UltraSPARC 1&2: 22
+C UltraSPARC 3: 36
+
+C This was generated by the Sun C compiler. It runs at 22 cycles/limb on the
+C UltraSPARC-1/2, three cycles slower than theoretically possible for optimal
+C code using the same algorithm. For 1-3 limbs, a special loop was generated,
+C which causes performance problems in particular for 2 and 3 limbs.
+C Ultimately, this should be replaced by hand-written code in the same software
+C pipeline style as e.g., addmul_1.asm.
+
+ASM_START()
+ REGISTER(%g2,#scratch)
+ REGISTER(%g3,#scratch)
+PROLOGUE(mpn_sqr_diagonal)
+ save %sp, -240, %sp
+
+ sethi %hi(0x1ffc00), %o0
+ sethi %hi(0x3ffc00), %o1
+ add %o0, 1023, %o7
+ cmp %i2, 4
+ add %o1, 1023, %o4
+ or %g0, %i1, %g1
+ or %g0, %i0, %o0
+ bl,pn %xcc, .Lsmall
+ or %g0, 0, %g2
+
+ ldx [%i1], %o1
+ add %i1, 24, %g1
+ or %g0, 3, %g2
+ srlx %o1, 42, %g3
+ stx %g3, [%sp+2279]
+ and %o1, %o7, %o2
+ stx %o2, [%sp+2263]
+ srlx %o1, 21, %o1
+ ldd [%sp+2279], %f0
+ and %o1, %o7, %o1
+ stx %o1, [%sp+2271]
+ ldx [%i1+8], %o2
+ fxtod %f0, %f12
+ srlx %o2, 21, %o1
+ and %o2, %o7, %g3
+ ldd [%sp+2263], %f2
+ fmuld %f12, %f12, %f10
+ srlx %o2, 42, %o2
+ ldd [%sp+2271], %f0
+ and %o1, %o7, %o1
+ fxtod %f2, %f8
+ stx %o2, [%sp+2279]
+ stx %o1, [%sp+2271]
+ fxtod %f0, %f0
+ stx %g3, [%sp+2263]
+ fdtox %f10, %f14
+ fmuld %f12, %f8, %f6
+ ldx [%i1+16], %o2
+ std %f14, [%sp+2255]
+ fmuld %f0, %f0, %f2
+ fmuld %f8, %f8, %f10
+ srlx %o2, 42, %o1
+ faddd %f6, %f6, %f6
+ fmuld %f12, %f0, %f12
+ fmuld %f0, %f8, %f8
+ ldd [%sp+2279], %f0
+ ldd [%sp+2263], %f4
+ fdtox %f10, %f10
+ std %f10, [%sp+2239]
+ faddd %f2, %f6, %f6
+ ldd [%sp+2271], %f2
+ fdtox %f12, %f12
+ std %f12, [%sp+2247]
+ fdtox %f8, %f8
+ std %f8, [%sp+2231]
+ fdtox %f6, %f6
+ std %f6, [%sp+2223]
+
+.Loop: srlx %o2, 21, %g3
+ stx %o1, [%sp+2279]
+ add %g2, 1, %g2
+ and %g3, %o7, %o1
+ ldx [%sp+2255], %g4
+ cmp %g2, %i2
+ stx %o1, [%sp+2271]
+ add %g1, 8, %g1
+ add %o0, 16, %o0
+ ldx [%sp+2239], %o1
+ fxtod %f0, %f10
+ fxtod %f4, %f14
+ ldx [%sp+2231], %i0
+ ldx [%sp+2223], %g5
+ ldx [%sp+2247], %g3
+ and %o2, %o7, %o2
+ fxtod %f2, %f8
+ fmuld %f10, %f10, %f0
+ stx %o2, [%sp+2263]
+ fmuld %f10, %f14, %f6
+ ldx [%g1-8], %o2
+ fmuld %f10, %f8, %f12
+ fdtox %f0, %f2
+ ldd [%sp+2279], %f0
+ fmuld %f8, %f8, %f4
+ faddd %f6, %f6, %f6
+ fmuld %f14, %f14, %f10
+ std %f2, [%sp+2255]
+ sllx %g4, 20, %g4
+ ldd [%sp+2271], %f2
+ fmuld %f8, %f14, %f8
+ sllx %i0, 22, %i1
+ fdtox %f12, %f12
+ std %f12, [%sp+2247]
+ sllx %g5, 42, %i0
+ add %o1, %i1, %o1
+ faddd %f4, %f6, %f6
+ ldd [%sp+2263], %f4
+ add %o1, %i0, %o1
+ add %g3, %g4, %g3
+ fdtox %f10, %f10
+ std %f10, [%sp+2239]
+ srlx %o1, 42, %g4
+ and %g5, %o4, %i0
+ fdtox %f8, %f8
+ std %f8, [%sp+2231]
+ srlx %g5, 22, %g5
+ sub %g4, %i0, %g4
+ fdtox %f6, %f6
+ std %f6, [%sp+2223]
+ srlx %g4, 63, %g4
+ add %g3, %g5, %g3
+ add %g3, %g4, %g3
+ stx %o1, [%o0-16]
+ srlx %o2, 42, %o1
+ bl,pt %xcc, .Loop
+ stx %g3, [%o0-8]
+
+ stx %o1, [%sp+2279]
+ srlx %o2, 21, %o1
+ fxtod %f0, %f16
+ ldx [%sp+2223], %g3
+ fxtod %f4, %f6
+ and %o2, %o7, %o3
+ stx %o3, [%sp+2263]
+ fxtod %f2, %f4
+ and %o1, %o7, %o1
+ ldx [%sp+2231], %o2
+ sllx %g3, 42, %g4
+ fmuld %f16, %f16, %f14
+ stx %o1, [%sp+2271]
+ fmuld %f16, %f6, %f8
+ add %o0, 48, %o0
+ ldx [%sp+2239], %o1
+ sllx %o2, 22, %o2
+ fmuld %f4, %f4, %f10
+ ldx [%sp+2255], %o3
+ fdtox %f14, %f14
+ fmuld %f4, %f6, %f2
+ std %f14, [%sp+2255]
+ faddd %f8, %f8, %f12
+ add %o1, %o2, %o2
+ fmuld %f16, %f4, %f4
+ ldd [%sp+2279], %f0
+ sllx %o3, 20, %g5
+ add %o2, %g4, %o2
+ fmuld %f6, %f6, %f6
+ srlx %o2, 42, %o3
+ and %g3, %o4, %g4
+ srlx %g3, 22, %g3
+ faddd %f10, %f12, %f16
+ ldd [%sp+2271], %f12
+ ldd [%sp+2263], %f8
+ fxtod %f0, %f0
+ sub %o3, %g4, %o3
+ ldx [%sp+2247], %o1
+ srlx %o3, 63, %o3
+ fdtox %f2, %f10
+ fxtod %f8, %f8
+ std %f10, [%sp+2231]
+ fdtox %f6, %f6
+ std %f6, [%sp+2239]
+ add %o1, %g5, %o1
+ fmuld %f0, %f0, %f2
+ fdtox %f16, %f16
+ std %f16, [%sp+2223]
+ add %o1, %g3, %o1
+ fdtox %f4, %f4
+ std %f4, [%sp+2247]
+ fmuld %f0, %f8, %f10
+ fxtod %f12, %f12
+ add %o1, %o3, %o1
+ stx %o2, [%o0-48]
+ fmuld %f8, %f8, %f6
+ stx %o1, [%o0-40]
+ fdtox %f2, %f2
+ ldx [%sp+2231], %o2
+ faddd %f10, %f10, %f10
+ ldx [%sp+2223], %g3
+ fmuld %f12, %f12, %f4
+ fdtox %f6, %f6
+ ldx [%sp+2239], %o1
+ sllx %o2, 22, %o2
+ fmuld %f12, %f8, %f8
+ sllx %g3, 42, %g5
+ ldx [%sp+2255], %o3
+ fmuld %f0, %f12, %f0
+ add %o1, %o2, %o2
+ faddd %f4, %f10, %f4
+ ldx [%sp+2247], %o1
+ add %o2, %g5, %o2
+ and %g3, %o4, %g4
+ fdtox %f8, %f8
+ sllx %o3, 20, %g5
+ std %f8, [%sp+2231]
+ fdtox %f0, %f0
+ srlx %o2, 42, %o3
+ add %o1, %g5, %o1
+ fdtox %f4, %f4
+ srlx %g3, 22, %g3
+ sub %o3, %g4, %o3
+ std %f6, [%sp+2239]
+ std %f4, [%sp+2223]
+ srlx %o3, 63, %o3
+ add %o1, %g3, %o1
+ std %f2, [%sp+2255]
+ add %o1, %o3, %o1
+ std %f0, [%sp+2247]
+ stx %o2, [%o0-32]
+ stx %o1, [%o0-24]
+ ldx [%sp+2231], %o2
+ ldx [%sp+2223], %o3
+ ldx [%sp+2239], %o1
+ sllx %o2, 22, %o2
+ sllx %o3, 42, %g5
+ ldx [%sp+2255], %g4
+ and %o3, %o4, %g3
+ add %o1, %o2, %o2
+ ldx [%sp+2247], %o1
+ add %o2, %g5, %o2
+ stx %o2, [%o0-16]
+ sllx %g4, 20, %g4
+ srlx %o2, 42, %o2
+ add %o1, %g4, %o1
+ srlx %o3, 22, %o3
+ sub %o2, %g3, %o2
+ srlx %o2, 63, %o2
+ add %o1, %o3, %o1
+ add %o1, %o2, %o1
+ stx %o1, [%o0-8]
+ ret
+ restore %g0, %g0, %g0
+.Lsmall:
+ ldx [%g1], %o2
+.Loop0:
+ and %o2, %o7, %o1
+ stx %o1, [%sp+2263]
+ add %g2, 1, %g2
+ srlx %o2, 21, %o1
+ add %g1, 8, %g1
+ srlx %o2, 42, %o2
+ stx %o2, [%sp+2279]
+ and %o1, %o7, %o1
+ ldd [%sp+2263], %f0
+ cmp %g2, %i2
+ stx %o1, [%sp+2271]
+ fxtod %f0, %f6
+ ldd [%sp+2279], %f0
+ ldd [%sp+2271], %f4
+ fxtod %f0, %f2
+ fmuld %f6, %f6, %f0
+ fxtod %f4, %f10
+ fmuld %f2, %f6, %f4
+ fdtox %f0, %f0
+ std %f0, [%sp+2239]
+ fmuld %f10, %f6, %f8
+ fmuld %f10, %f10, %f0
+ faddd %f4, %f4, %f6
+ fmuld %f2, %f2, %f4
+ fdtox %f8, %f8
+ std %f8, [%sp+2231]
+ fmuld %f2, %f10, %f2
+ faddd %f0, %f6, %f0
+ fdtox %f4, %f4
+ std %f4, [%sp+2255]
+ fdtox %f2, %f2
+ std %f2, [%sp+2247]
+ fdtox %f0, %f0
+ std %f0, [%sp+2223]
+ ldx [%sp+2239], %o1
+ ldx [%sp+2255], %g4
+ ldx [%sp+2231], %o2
+ sllx %g4, 20, %g4
+ ldx [%sp+2223], %o3
+ sllx %o2, 22, %o2
+ sllx %o3, 42, %g5
+ add %o1, %o2, %o2
+ ldx [%sp+2247], %o1
+ add %o2, %g5, %o2
+ stx %o2, [%o0]
+ and %o3, %o4, %g3
+ srlx %o2, 42, %o2
+ add %o1, %g4, %o1
+ srlx %o3, 22, %o3
+ sub %o2, %g3, %o2
+ srlx %o2, 63, %o2
+ add %o1, %o3, %o1
+ add %o1, %o2, %o1
+ stx %o1, [%o0+8]
+ add %o0, 16, %o0
+ bl,a,pt %xcc, .Loop0
+ ldx [%g1], %o2
+ ret
+ restore %g0, %g0, %g0
+EPILOGUE(mpn_sqr_diagonal)
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/ultrasparc1234/sub_n.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/ultrasparc1234/sub_n.asm
new file mode 100644
index 00000000000..9fb7f707475
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/ultrasparc1234/sub_n.asm
@@ -0,0 +1,241 @@
+dnl SPARC v9 mpn_sub_n -- Subtract two limb vectors of the same length > 0 and
+dnl store difference in a third limb vector.
+
+dnl Copyright 2001-2003, 2011 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 1&2: 4
+C UltraSPARC 3: 4.5
+
+C Compute carry-out from the most significant bits of u,v, and r, where
+C r=u-v-carry_in, using logic operations.
+
+C This code runs at 4 cycles/limb on UltraSPARC 1 and 2. It has a 4 insn
+C recurrency, and the UltraSPARC 1 and 2 the IE units are 100% saturated.
+C Therefore, it seems futile to try to optimize this any further...
+
+C INPUT PARAMETERS
+define(`rp',`%i0')
+define(`up',`%i1')
+define(`vp',`%i2')
+define(`n',`%i3')
+
+define(`u0',`%l0')
+define(`u1',`%l2')
+define(`u2',`%l4')
+define(`u3',`%l6')
+define(`v0',`%l1')
+define(`v1',`%l3')
+define(`v2',`%l5')
+define(`v3',`%l7')
+
+define(`cy',`%i4')
+
+define(`fanop',`fitod %f0,%f2') dnl A quasi nop running in the FA pipe
+define(`fmnop',`fmuld %f0,%f0,%f4') dnl A quasi nop running in the FM pipe
+
+ASM_START()
+ REGISTER(%g2,#scratch)
+ REGISTER(%g3,#scratch)
+PROLOGUE(mpn_sub_nc)
+ save %sp,-160,%sp
+
+ fitod %f0,%f0 C make sure f0 contains small, quiet number
+ subcc n,4,%g0
+ bl,pn %xcc,.Loop0
+ nop
+ b,a L(com)
+EPILOGUE()
+
+PROLOGUE(mpn_sub_n)
+ save %sp,-160,%sp
+
+ fitod %f0,%f0 C make sure f0 contains small, quiet number
+ subcc n,4,%g0
+ bl,pn %xcc,.Loop0
+ mov 0,cy
+L(com):
+ ldx [up+0],u0
+ ldx [vp+0],v0
+ add up,32,up
+ ldx [up-24],u1
+ ldx [vp+8],v1
+ add vp,32,vp
+ ldx [up-16],u2
+ ldx [vp-16],v2
+ ldx [up-8],u3
+ ldx [vp-8],v3
+ subcc n,8,n
+ sub u0,v0,%g1 C main sub
+ sub %g1,cy,%g5 C carry sub
+ orn u0,v0,%g2
+ bl,pn %xcc,.Lend4567
+ fanop
+ b,a .Loop
+
+ .align 16
+C START MAIN LOOP
+.Loop: orn %g5,%g2,%g2
+ andn u0,v0,%g3
+ ldx [up+0],u0
+ fanop
+C --
+ andn %g2,%g3,%g2
+ ldx [vp+0],v0
+ add up,32,up
+ fanop
+C --
+ srlx %g2,63,cy
+ sub u1,v1,%g1
+ stx %g5,[rp+0]
+ fanop
+C --
+ sub %g1,cy,%g5
+ orn u1,v1,%g2
+ fmnop
+ fanop
+C --
+ orn %g5,%g2,%g2
+ andn u1,v1,%g3
+ ldx [up-24],u1
+ fanop
+C --
+ andn %g2,%g3,%g2
+ ldx [vp+8],v1
+ add vp,32,vp
+ fanop
+C --
+ srlx %g2,63,cy
+ sub u2,v2,%g1
+ stx %g5,[rp+8]
+ fanop
+C --
+ sub %g1,cy,%g5
+ orn u2,v2,%g2
+ fmnop
+ fanop
+C --
+ orn %g5,%g2,%g2
+ andn u2,v2,%g3
+ ldx [up-16],u2
+ fanop
+C --
+ andn %g2,%g3,%g2
+ ldx [vp-16],v2
+ add rp,32,rp
+ fanop
+C --
+ srlx %g2,63,cy
+ sub u3,v3,%g1
+ stx %g5,[rp-16]
+ fanop
+C --
+ sub %g1,cy,%g5
+ orn u3,v3,%g2
+ fmnop
+ fanop
+C --
+ orn %g5,%g2,%g2
+ andn u3,v3,%g3
+ ldx [up-8],u3
+ fanop
+C --
+ andn %g2,%g3,%g2
+ subcc n,4,n
+ ldx [vp-8],v3
+ fanop
+C --
+ srlx %g2,63,cy
+ sub u0,v0,%g1
+ stx %g5,[rp-8]
+ fanop
+C --
+ sub %g1,cy,%g5
+ orn u0,v0,%g2
+ bge,pt %xcc,.Loop
+ fanop
+C END MAIN LOOP
+.Lend4567:
+ orn %g5,%g2,%g2
+ andn u0,v0,%g3
+ andn %g2,%g3,%g2
+ srlx %g2,63,cy
+ sub u1,v1,%g1
+ stx %g5,[rp+0]
+ sub %g1,cy,%g5
+ orn u1,v1,%g2
+ orn %g5,%g2,%g2
+ andn u1,v1,%g3
+ andn %g2,%g3,%g2
+ srlx %g2,63,cy
+ sub u2,v2,%g1
+ stx %g5,[rp+8]
+ sub %g1,cy,%g5
+ orn u2,v2,%g2
+ orn %g5,%g2,%g2
+ andn u2,v2,%g3
+ andn %g2,%g3,%g2
+ add rp,32,rp
+ srlx %g2,63,cy
+ sub u3,v3,%g1
+ stx %g5,[rp-16]
+ sub %g1,cy,%g5
+ orn u3,v3,%g2
+ orn %g5,%g2,%g2
+ andn u3,v3,%g3
+ andn %g2,%g3,%g2
+ srlx %g2,63,cy
+ stx %g5,[rp-8]
+
+ addcc n,4,n
+ bz,pn %xcc,.Lret
+ fanop
+
+.Loop0: ldx [up],u0
+ add up,8,up
+ ldx [vp],v0
+ add vp,8,vp
+ add rp,8,rp
+ subcc n,1,n
+ sub u0,v0,%g1
+ orn u0,v0,%g2
+ sub %g1,cy,%g5
+ andn u0,v0,%g3
+ orn %g5,%g2,%g2
+ stx %g5,[rp-8]
+ andn %g2,%g3,%g2
+ bnz,pt %xcc,.Loop0
+ srlx %g2,63,cy
+
+.Lret: mov cy,%i0
+ ret
+ restore
+EPILOGUE(mpn_sub_n)
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/ultrasparc1234/submul_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/ultrasparc1234/submul_1.asm
new file mode 100644
index 00000000000..0bdb566b9f3
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/ultrasparc1234/submul_1.asm
@@ -0,0 +1,68 @@
+dnl SPARC v9 64-bit mpn_submul_1 -- Multiply a limb vector with a limb and
+dnl subtract the result from a second limb vector.
+
+dnl Copyright 2001-2003 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 1&2: 18
+C UltraSPARC 3: 23
+
+C INPUT PARAMETERS
+C rp i0
+C up i1
+C n i2
+C v i3
+
+ASM_START()
+ REGISTER(%g2,#scratch)
+
+PROLOGUE(mpn_submul_1)
+ save %sp,-176,%sp
+
+ sllx %i2, 3, %g2
+ or %g0, %i1, %o1
+ add %g2, 15, %o0
+ or %g0, %i2, %o2
+ and %o0, -16, %o0
+ sub %sp, %o0, %sp
+ add %sp, 2223, %o0
+ or %g0, %o0, %l0
+ call mpn_mul_1
+ or %g0, %i3, %o3
+ or %g0, %o0, %l1 C preserve carry value from mpn_mul_1
+ or %g0, %i0, %o0
+ or %g0, %i0, %o1
+ or %g0, %l0, %o2
+ call mpn_sub_n
+ or %g0, %i2, %o3
+ ret
+ restore %l1, %o0, %o0 C sum carry values
+EPILOGUE(mpn_submul_1)
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/ultrasparc34/gmp-mparam.h b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/ultrasparc34/gmp-mparam.h
new file mode 100644
index 00000000000..0c525bbdcf5
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/ultrasparc34/gmp-mparam.h
@@ -0,0 +1,219 @@
+/* ultrasparc3/4 gmp-mparam.h -- Compiler/machine parameter header file.
+
+Copyright 1991, 1993, 1994, 1999-2002, 2004, 2006, 2008-2010, 2014 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
+
+/* 1593 MHz ultrasparc3 running Solaris 10 (swift.nada.kth.se) */
+/* FFT tuning limit = 60000000 */
+/* Generated by tuneup.c, 2014-03-14, gcc 3.4 */
+
+#define DIVREM_1_NORM_THRESHOLD 0 /* always */
+#define DIVREM_1_UNNORM_THRESHOLD 0 /* always */
+#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 6
+#define MOD_1U_TO_MOD_1_1_THRESHOLD 5
+#define MOD_1_1_TO_MOD_1_2_THRESHOLD 20
+#define MOD_1_2_TO_MOD_1_4_THRESHOLD 0 /* never mpn_mod_1s_2p */
+#define PREINV_MOD_1_TO_MOD_1_THRESHOLD 25
+#define USE_PREINV_DIVREM_1 1
+#define DIV_QR_1N_PI1_METHOD 1
+#define DIV_QR_1_NORM_THRESHOLD 2
+#define DIV_QR_1_UNNORM_THRESHOLD 1
+#define DIV_QR_2_PI2_THRESHOLD MP_SIZE_T_MAX /* never */
+#define DIVEXACT_1_THRESHOLD 0 /* always */
+#define BMOD_1_TO_MOD_1_THRESHOLD MP_SIZE_T_MAX /* never */
+
+#define MUL_TOOM22_THRESHOLD 28
+#define MUL_TOOM33_THRESHOLD 93
+#define MUL_TOOM44_THRESHOLD 139
+#define MUL_TOOM6H_THRESHOLD 165
+#define MUL_TOOM8H_THRESHOLD 278
+
+#define MUL_TOOM32_TO_TOOM43_THRESHOLD 93
+#define MUL_TOOM32_TO_TOOM53_THRESHOLD 104
+#define MUL_TOOM42_TO_TOOM53_THRESHOLD 85
+#define MUL_TOOM42_TO_TOOM63_THRESHOLD 51
+#define MUL_TOOM43_TO_TOOM54_THRESHOLD 67
+
+#define SQR_BASECASE_THRESHOLD 7
+#define SQR_TOOM2_THRESHOLD 71
+#define SQR_TOOM3_THRESHOLD 98
+#define SQR_TOOM4_THRESHOLD 175
+#define SQR_TOOM6_THRESHOLD 190
+#define SQR_TOOM8_THRESHOLD 339
+
+#define MULMID_TOOM42_THRESHOLD 40
+
+#define MULMOD_BNM1_THRESHOLD 15
+#define SQRMOD_BNM1_THRESHOLD 9
+
+#define MUL_FFT_MODF_THRESHOLD 220 /* k = 5 */
+#define MUL_FFT_TABLE3 \
+ { { 220, 5}, { 13, 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}, { 63, 8}, { 127, 7}, { 255, 9}, \
+ { 67,10}, { 39, 9}, { 79, 8}, { 159, 9}, \
+ { 83,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, 9}, \
+ { 159, 8}, { 319,11}, { 47,10}, { 95, 9}, \
+ { 191, 8}, { 383,10}, { 103, 9}, { 207, 8}, \
+ { 415,10}, { 111,12}, { 31,11}, { 63,10}, \
+ { 127, 9}, { 255,10}, { 143, 9}, { 287, 8}, \
+ { 575,11}, { 79,10}, { 175, 9}, { 351,11}, \
+ { 95,10}, { 191, 9}, { 383,10}, { 207, 9}, \
+ { 415,11}, { 111,10}, { 223,12}, { 63,11}, \
+ { 127,10}, { 255,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,10}, \
+ { 415,11}, { 223,10}, { 447,13}, { 63,12}, \
+ { 127,11}, { 287,10}, { 575,12}, { 159,11}, \
+ { 351,10}, { 703,12}, { 191,11}, { 415,12}, \
+ { 223,11}, { 479,13}, { 127,12}, { 287,11}, \
+ { 575,12}, { 351,13}, { 191,12}, { 415,11}, \
+ { 831,12}, { 479,14}, { 127,13}, { 255,12}, \
+ { 575,13}, { 319,12}, { 703,11}, { 1407,13}, \
+ { 383,12}, { 831,13}, { 447,12}, { 895,14}, \
+ { 255,13}, { 511,12}, { 1023,13}, { 575,12}, \
+ { 1215,13}, { 703,14}, { 383,13}, { 831,12}, \
+ { 1663,13}, { 895,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}, { 2303,14}, \
+ { 1407,15}, { 767,14}, { 1791,16}, { 511,15}, \
+ { 1023,14}, { 2303,15}, { 1279,14}, { 2815,15}, \
+ { 1535,14}, { 3199,15}, { 1791,14}, { 3583,16}, \
+ { 65536,17}, { 131072,18}, { 262144,19}, { 524288,20}, \
+ {1048576,21}, {2097152,22}, {4194304,23}, {8388608,24} }
+#define MUL_FFT_TABLE3_SIZE 172
+#define MUL_FFT_THRESHOLD 2240
+
+#define SQR_FFT_MODF_THRESHOLD 244 /* k = 5 */
+#define SQR_FFT_TABLE3 \
+ { { 244, 5}, { 8, 4}, { 17, 5}, { 15, 6}, \
+ { 8, 5}, { 17, 6}, { 17, 7}, { 9, 6}, \
+ { 19, 7}, { 10, 6}, { 21, 7}, { 17, 8}, \
+ { 9, 7}, { 20, 8}, { 11, 7}, { 23, 8}, \
+ { 21, 9}, { 11, 8}, { 25, 9}, { 15, 8}, \
+ { 31, 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}, { 95,10}, { 55,11}, \
+ { 31,10}, { 63, 9}, { 127, 8}, { 255,10}, \
+ { 71, 9}, { 143, 8}, { 287, 7}, { 575,10}, \
+ { 79, 9}, { 159, 8}, { 319,11}, { 47, 9}, \
+ { 191, 8}, { 383, 7}, { 767, 9}, { 207,12}, \
+ { 31,11}, { 63,10}, { 127, 9}, { 255, 8}, \
+ { 511, 9}, { 271,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, 8}, { 831,10}, { 223, 9}, { 447, 8}, \
+ { 895,12}, { 63,11}, { 127,10}, { 271,11}, \
+ { 143,10}, { 287, 9}, { 575, 8}, { 1215,11}, \
+ { 159,10}, { 319, 9}, { 639,11}, { 175,10}, \
+ { 351, 9}, { 703,11}, { 191,10}, { 383,11}, \
+ { 207,10}, { 415, 9}, { 831, 8}, { 1663,10}, \
+ { 447,13}, { 63,12}, { 127,11}, { 271,10}, \
+ { 543, 9}, { 1087,11}, { 287,10}, { 575, 9}, \
+ { 1151,12}, { 159,11}, { 319,10}, { 639,11}, \
+ { 351,10}, { 703,12}, { 191,11}, { 415,10}, \
+ { 831,12}, { 223,11}, { 447,13}, { 127,12}, \
+ { 255,11}, { 543,12}, { 287,11}, { 607,12}, \
+ { 319,11}, { 639,12}, { 351,11}, { 703,13}, \
+ { 191,12}, { 415,11}, { 831,12}, { 479,14}, \
+ { 127,13}, { 255,12}, { 607,13}, { 319,12}, \
+ { 703,11}, { 1407,13}, { 383,12}, { 831,13}, \
+ { 447,12}, { 959,14}, { 255,13}, { 511,12}, \
+ { 1023,13}, { 575,12}, { 1151,13}, { 639,12}, \
+ { 1279,13}, { 703,14}, { 383,13}, { 831,12}, \
+ { 1663,13}, { 895,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}, { 2303,14}, \
+ { 1407,15}, { 767,14}, { 1791,16}, { 511,15}, \
+ { 1023,14}, { 2303,15}, { 1279,14}, { 2815,15}, \
+ { 1535,14}, { 3199,15}, { 1791,16}, { 65536,17}, \
+ { 131072,18}, { 262144,19}, { 524288,20}, {1048576,21}, \
+ {2097152,22}, {4194304,23}, {8388608,24} }
+#define SQR_FFT_TABLE3_SIZE 183
+#define SQR_FFT_THRESHOLD 1728
+
+#define MULLO_BASECASE_THRESHOLD 19
+#define MULLO_DC_THRESHOLD 0 /* never mpn_mullo_basecase */
+#define MULLO_MUL_N_THRESHOLD 4392
+
+#define DC_DIV_QR_THRESHOLD 15
+#define DC_DIVAPPR_Q_THRESHOLD 64
+#define DC_BDIV_QR_THRESHOLD 29
+#define DC_BDIV_Q_THRESHOLD 86
+
+#define INV_MULMOD_BNM1_THRESHOLD 54
+#define INV_NEWTON_THRESHOLD 17
+#define INV_APPR_THRESHOLD 17
+
+#define BINV_NEWTON_THRESHOLD 111
+#define REDC_1_TO_REDC_2_THRESHOLD 0 /* always */
+#define REDC_2_TO_REDC_N_THRESHOLD 115
+
+#define MU_DIV_QR_THRESHOLD 680
+#define MU_DIVAPPR_Q_THRESHOLD 618
+#define MUPI_DIV_QR_THRESHOLD 0 /* always */
+#define MU_BDIV_QR_THRESHOLD 680
+#define MU_BDIV_Q_THRESHOLD 807
+
+#define POWM_SEC_TABLE 1,16,102,386,1985,2079
+
+#define MATRIX22_STRASSEN_THRESHOLD 12
+#define HGCD_THRESHOLD 46
+#define HGCD_APPR_THRESHOLD 50
+#define HGCD_REDUCE_THRESHOLD 1012
+#define GCD_DC_THRESHOLD 124
+#define GCDEXT_DC_THRESHOLD 138
+#define JACOBI_BASE_METHOD 4
+
+#define GET_STR_DC_THRESHOLD 20
+#define GET_STR_PRECOMPUTE_THRESHOLD 28
+#define SET_STR_DC_THRESHOLD 324
+#define SET_STR_PRECOMPUTE_THRESHOLD 1043
+
+#define FAC_DSC_THRESHOLD 422
+#define FAC_ODD_THRESHOLD 0 /* always */
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/ultrasparct1/add_n.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/ultrasparct1/add_n.asm
new file mode 100644
index 00000000000..954c7f6d357
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/ultrasparct1/add_n.asm
@@ -0,0 +1,68 @@
+dnl SPARC v9 mpn_add_n for T1/T2.
+
+dnl Copyright 2010 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 T1: ?
+C UltraSPARC T2: ?
+
+C INPUT PARAMETERS
+define(`rp', `%o0')
+define(`up', `%o1')
+define(`vp', `%o2')
+define(`n', `%o3')
+define(`cy', `%o4')
+
+ASM_START()
+ REGISTER(%g2,#scratch)
+ REGISTER(%g3,#scratch)
+PROLOGUE(mpn_add_nc)
+ b,a L(ent)
+EPILOGUE()
+PROLOGUE(mpn_add_n)
+ mov 0, cy
+L(ent): cmp %g0, cy
+L(top): ldx [up+0], %o4
+ add up, 8, up
+ ldx [vp+0], %o5
+ add vp, 8, vp
+ add rp, 8, rp
+ add n, -1, n
+ srlx %o4, 32, %g1
+ srlx %o5, 32, %g2
+ addccc %o4, %o5, %g3
+ addccc %g1, %g2, %g0
+ brgz n, L(top)
+ stx %g3, [rp-8]
+
+ retl
+ addc %g0, %g0, %o0
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/ultrasparct1/addlsh1_n.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/ultrasparct1/addlsh1_n.asm
new file mode 100644
index 00000000000..313479773fd
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/ultrasparct1/addlsh1_n.asm
@@ -0,0 +1,41 @@
+dnl SPARC v9 mpn_addlsh1_n for T1/T2.
+
+dnl Copyright 2010 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)
+
+define(func, mpn_addlsh1_n)
+
+MULFUNC_PROLOGUE(mpn_addlsh1_n)
+
+include_mpn(`sparc64/ultrasparct1/addlshC_n.asm')
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/ultrasparct1/addlsh2_n.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/ultrasparct1/addlsh2_n.asm
new file mode 100644
index 00000000000..ee1afd01160
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/ultrasparct1/addlsh2_n.asm
@@ -0,0 +1,41 @@
+dnl SPARC v9 mpn_addlsh2_n for T1/T2.
+
+dnl Copyright 2010 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)
+
+define(func, mpn_addlsh2_n)
+
+MULFUNC_PROLOGUE(mpn_addlsh2_n)
+
+include_mpn(`sparc64/ultrasparct1/addlshC_n.asm')
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/ultrasparct1/addlshC_n.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/ultrasparct1/addlshC_n.asm
new file mode 100644
index 00000000000..5be9a0d30aa
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/ultrasparct1/addlshC_n.asm
@@ -0,0 +1,69 @@
+dnl SPARC v9 mpn_addlshC_n for T1/T2.
+
+dnl Copyright 2010 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/.
+
+C cycles/limb
+C UltraSPARC T1: 21
+C UltraSPARC T2: ?
+
+C INPUT PARAMETERS
+define(`rp', `%o0')
+define(`up', `%o1')
+define(`vp', `%o2')
+define(`n', `%o3')
+define(`cy', `%o4')
+
+ASM_START()
+ REGISTER(%g2,#scratch)
+ REGISTER(%g3,#scratch)
+PROLOGUE(func)
+ mov 0, cy
+ mov 0, %g5
+ cmp %g0, cy
+L(top): ldx [up+0], %o4
+ add up, 8, up
+ ldx [vp+0], %o5
+ add vp, 8, vp
+ add rp, 8, rp
+
+ sllx %o5, LSH, %g4
+ add n, -1, n
+ or %g5, %g4, %g4
+ srlx %o5, RSH, %g5
+
+ srlx %o4, 32, %g1
+ srlx %g4, 32, %g2
+ addccc %o4, %g4, %g3
+ addccc %g1, %g2, %g0
+ brgz n, L(top)
+ stx %g3, [rp-8]
+
+ retl
+ addc %g5, %g0, %o0
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/ultrasparct1/addmul_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/ultrasparct1/addmul_1.asm
new file mode 100644
index 00000000000..29dba966f3d
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/ultrasparct1/addmul_1.asm
@@ -0,0 +1,86 @@
+dnl SPARC v9 mpn_addmul_1 for T1/T2.
+
+dnl Copyright 2010 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 T1: 74
+C UltraSPARC T2: ?
+
+C INPUT PARAMETERS
+define(`rp', `%i0')
+define(`up', `%i1')
+define(`n', `%i2')
+define(`v0', `%i3')
+
+ASM_START()
+ REGISTER(%g2,#scratch)
+ REGISTER(%g3,#scratch)
+PROLOGUE(mpn_addmul_1)
+ save %sp, -176, %sp
+ mov 1, %o2
+ mov %i0, %g2
+ srlx %i3, 32, %o4
+ sllx %o2, 32, %o2
+ srl %i3, 0, %i3
+ mov 0, %g3
+ mov 0, %i0
+
+L(top): ldx [%i1+%g3], %g1
+ srl %g1, 0, %g4
+ mulx %g4, %i3, %o5
+ srlx %g1, 32, %g1
+ mulx %g1, %i3, %g5
+ mulx %g4, %o4, %g4
+ mulx %g1, %o4, %g1
+ srlx %o5, 32, %o1
+ add %g5, %o1, %o1
+ addcc %o1, %g4, %g4
+ srl %o5, 0, %o0
+ ldx [%g2+%g3], %o5
+ sllx %g4, 32, %o1
+ add %g1, %o2, %l1
+ movlu %xcc, %l1, %g1
+ add %o1, %o0, %l0
+ addcc %l0, %i0, %g5
+ srlx %g4, 32, %i0
+ add %i0, 1, %g4
+ movlu %xcc, %g4, %i0
+ addcc %o5, %g5, %g5
+ stx %g5, [%g2+%g3]
+ add %i0, 1, %g4
+ movlu %xcc, %g4, %i0
+ add %i2, -1, %i2
+ add %i0, %g1, %i0
+ brnz,pt %i2, L(top)
+ add %g3, 8, %g3
+ return %i7+8
+ nop
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/ultrasparct1/gmp-mparam.h b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/ultrasparct1/gmp-mparam.h
new file mode 100644
index 00000000000..99db78ac0f2
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/ultrasparct1/gmp-mparam.h
@@ -0,0 +1,154 @@
+/* Sparc64 gmp-mparam.h -- Compiler/machine parameter header file.
+
+Copyright 1991, 1993, 1994, 1999-2002, 2004, 2006, 2008-2010 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
+
+/* 1000 MHz ultrasparc t1 running GNU/Linux */
+
+#define DIVREM_1_NORM_THRESHOLD 0 /* always */
+#define DIVREM_1_UNNORM_THRESHOLD 0 /* always */
+#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 13
+#define MOD_1U_TO_MOD_1_1_THRESHOLD MP_SIZE_T_MAX
+#define MOD_1_1_TO_MOD_1_2_THRESHOLD 0 /* never mpn_mod_1_1p */
+#define MOD_1_2_TO_MOD_1_4_THRESHOLD 0 /* never mpn_mod_1s_2p */
+#define PREINV_MOD_1_TO_MOD_1_THRESHOLD 34
+#define USE_PREINV_DIVREM_1 1
+#define DIV_QR_2_PI2_THRESHOLD MP_SIZE_T_MAX /* never */
+#define DIVEXACT_1_THRESHOLD 0 /* always */
+#define BMOD_1_TO_MOD_1_THRESHOLD MP_SIZE_T_MAX /* never */
+
+#define MUL_TOOM22_THRESHOLD 8
+#define MUL_TOOM33_THRESHOLD 50
+#define MUL_TOOM44_THRESHOLD 99
+#define MUL_TOOM6H_THRESHOLD 125
+#define MUL_TOOM8H_THRESHOLD 187
+
+#define MUL_TOOM32_TO_TOOM43_THRESHOLD 65
+#define MUL_TOOM32_TO_TOOM53_THRESHOLD 77
+#define MUL_TOOM42_TO_TOOM53_THRESHOLD 65
+#define MUL_TOOM42_TO_TOOM63_THRESHOLD 50
+#define MUL_TOOM43_TO_TOOM54_THRESHOLD 34
+
+#define SQR_BASECASE_THRESHOLD 0 /* always */
+#define SQR_TOOM2_THRESHOLD 14
+#define SQR_TOOM3_THRESHOLD 57
+#define SQR_TOOM4_THRESHOLD 133
+#define SQR_TOOM6_THRESHOLD 156
+#define SQR_TOOM8_THRESHOLD 260
+
+#define MULMID_TOOM42_THRESHOLD 12
+
+#define MULMOD_BNM1_THRESHOLD 7
+#define SQRMOD_BNM1_THRESHOLD 7
+
+#define MUL_FFT_MODF_THRESHOLD 176 /* k = 5 */
+#define MUL_FFT_TABLE3 \
+ { { 176, 5}, { 7, 6}, { 4, 5}, { 9, 6}, \
+ { 5, 5}, { 11, 6}, { 11, 7}, { 6, 6}, \
+ { 13, 7}, { 7, 6}, { 15, 7}, { 9, 8}, \
+ { 5, 7}, { 13, 8}, { 7, 7}, { 15, 6}, \
+ { 32, 7}, { 24, 8}, { 21, 9}, { 11, 8}, \
+ { 23,10}, { 7, 9}, { 15, 8}, { 33, 9}, \
+ { 19, 8}, { 39, 9}, { 23,10}, { 15, 9}, \
+ { 43,10}, { 23,11}, { 15,10}, { 31, 9}, \
+ { 63, 8}, { 127, 9}, { 67,10}, { 39, 9}, \
+ { 79, 8}, { 159,10}, { 47, 9}, { 95,11}, \
+ { 2048,12}, { 4096,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 53
+#define MUL_FFT_THRESHOLD 1728
+
+
+#define SQR_FFT_MODF_THRESHOLD 148 /* k = 5 */
+#define SQR_FFT_TABLE3 \
+ { { 148, 5}, { 7, 6}, { 4, 5}, { 9, 6}, \
+ { 5, 5}, { 11, 6}, { 11, 7}, { 6, 6}, \
+ { 13, 7}, { 7, 6}, { 15, 7}, { 13, 8}, \
+ { 7, 7}, { 16, 8}, { 9, 6}, { 38, 7}, \
+ { 20, 8}, { 11, 7}, { 24, 8}, { 13, 9}, \
+ { 7, 7}, { 30, 8}, { 19, 9}, { 11, 8}, \
+ { 25,10}, { 7, 9}, { 15, 8}, { 31, 9}, \
+ { 19, 8}, { 39, 9}, { 27,10}, { 15, 9}, \
+ { 39,10}, { 23, 9}, { 47, 8}, { 95, 9}, \
+ { 51,11}, { 15,10}, { 31, 8}, { 127,10}, \
+ { 39, 9}, { 79, 8}, { 159,10}, { 47, 9}, \
+ { 95,11}, { 2048,12}, { 4096,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 58
+#define SQR_FFT_THRESHOLD 1344
+
+#define MULLO_BASECASE_THRESHOLD 0 /* always */
+#define MULLO_DC_THRESHOLD 28
+#define MULLO_MUL_N_THRESHOLD 3176
+
+#define DC_DIV_QR_THRESHOLD 27
+#define DC_DIVAPPR_Q_THRESHOLD 106
+#define DC_BDIV_QR_THRESHOLD 27
+#define DC_BDIV_Q_THRESHOLD 62
+
+#define INV_MULMOD_BNM1_THRESHOLD 14
+#define INV_NEWTON_THRESHOLD 163
+#define INV_APPR_THRESHOLD 117
+
+#define BINV_NEWTON_THRESHOLD 166
+#define REDC_1_TO_REDC_N_THRESHOLD 31
+
+#define MU_DIV_QR_THRESHOLD 734
+#define MU_DIVAPPR_Q_THRESHOLD 748
+#define MUPI_DIV_QR_THRESHOLD 67
+#define MU_BDIV_QR_THRESHOLD 562
+#define MU_BDIV_Q_THRESHOLD 734
+
+#define POWM_SEC_TABLE 4,29,188,643,2741
+
+#define MATRIX22_STRASSEN_THRESHOLD 11
+#define HGCD_THRESHOLD 58
+#define HGCD_APPR_THRESHOLD 55
+#define HGCD_REDUCE_THRESHOLD 637
+#define GCD_DC_THRESHOLD 186
+#define GCDEXT_DC_THRESHOLD 140
+#define JACOBI_BASE_METHOD 3
+
+#define GET_STR_DC_THRESHOLD 20
+#define GET_STR_PRECOMPUTE_THRESHOLD 33
+#define SET_STR_DC_THRESHOLD 268
+#define SET_STR_PRECOMPUTE_THRESHOLD 960
+
+#define FAC_DSC_THRESHOLD 268
+#define FAC_ODD_THRESHOLD 0 /* always */
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/ultrasparct1/mul_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/ultrasparct1/mul_1.asm
new file mode 100644
index 00000000000..1fea2a19ef9
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/ultrasparct1/mul_1.asm
@@ -0,0 +1,82 @@
+dnl SPARC v9 mpn_mul_1 for T1/T2.
+
+dnl Copyright 2010 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 T1: 68
+C UltraSPARC T2: ?
+
+C INPUT PARAMETERS
+define(`rp', `%i0')
+define(`up', `%i1')
+define(`n', `%i2')
+define(`v0', `%i3')
+
+ASM_START()
+ REGISTER(%g2,#scratch)
+ REGISTER(%g3,#scratch)
+PROLOGUE(mpn_mul_1)
+ save %sp, -176, %sp
+ mov 1, %o2
+ mov %i0, %g2
+ srlx %i3, 32, %o4
+ sllx %o2, 32, %o2
+ srl %i3, 0, %i3
+ mov 0, %g3
+ mov 0, %i0
+
+L(top): ldx [%i1+%g3], %g1
+ srl %g1, 0, %g4
+ mulx %g4, %i3, %o5
+ srlx %g1, 32, %g1
+ mulx %g1, %i3, %g5
+ mulx %g4, %o4, %g4
+ mulx %g1, %o4, %g1
+ srlx %o5, 32, %o1
+ add %g5, %o1, %o1
+ addcc %o1, %g4, %g4
+ srl %o5, 0, %o0
+ sllx %g4, 32, %o1
+ add %g1, %o2, %l1
+ movlu %xcc, %l1, %g1
+ add %o1, %o0, %l0
+ addcc %l0, %i0, %g5
+ srlx %g4, 32, %i0
+ add %i0, 1, %g4
+ movlu %xcc, %g4, %i0
+ stx %g5, [%g2+%g3]
+ add %i2, -1, %i2
+ add %i0, %g1, %i0
+ brnz,pt %i2, L(top)
+ add %g3, 8, %g3
+ return %i7+8
+ nop
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/ultrasparct1/rsblsh1_n.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/ultrasparct1/rsblsh1_n.asm
new file mode 100644
index 00000000000..51bd4ab45b8
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/ultrasparct1/rsblsh1_n.asm
@@ -0,0 +1,41 @@
+dnl SPARC v9 mpn_rsblsh1_n for T1/T2.
+
+dnl Copyright 2010 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)
+
+define(func, mpn_rsblsh1_n)
+
+MULFUNC_PROLOGUE(mpn_rsblsh1_n)
+
+include_mpn(`sparc64/ultrasparct1/rsblshC_n.asm')
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/ultrasparct1/rsblsh2_n.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/ultrasparct1/rsblsh2_n.asm
new file mode 100644
index 00000000000..f0d208e198f
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/ultrasparct1/rsblsh2_n.asm
@@ -0,0 +1,41 @@
+dnl SPARC v9 mpn_rsblsh2_n for T1/T2.
+
+dnl Copyright 2010 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)
+
+define(func, mpn_rsblsh2_n)
+
+MULFUNC_PROLOGUE(mpn_rsblsh2_n)
+
+include_mpn(`sparc64/ultrasparct1/rsblshC_n.asm')
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/ultrasparct1/rsblshC_n.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/ultrasparct1/rsblshC_n.asm
new file mode 100644
index 00000000000..7c03e9f97f2
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/ultrasparct1/rsblshC_n.asm
@@ -0,0 +1,69 @@
+dnl SPARC v9 mpn_rsblshC_n for T1/T2.
+
+dnl Copyright 2010 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/.
+
+C cycles/limb
+C UltraSPARC T1: 21
+C UltraSPARC T2: ?
+
+C INPUT PARAMETERS
+define(`rp', `%o0')
+define(`up', `%o1')
+define(`vp', `%o2')
+define(`n', `%o3')
+define(`cy', `%o4')
+
+ASM_START()
+ REGISTER(%g2,#scratch)
+ REGISTER(%g3,#scratch)
+PROLOGUE(func)
+ mov 0, cy
+ mov 0, %g5
+ cmp %g0, cy
+L(top): ldx [up+0], %o4
+ add up, 8, up
+ ldx [vp+0], %o5
+ add vp, 8, vp
+ add rp, 8, rp
+
+ sllx %o5, LSH, %g4
+ add n, -1, n
+ or %g5, %g4, %g4
+ srlx %o5, RSH, %g5
+
+ srlx %o4, 32, %g1
+ srlx %g4, 32, %g2
+ subccc %g4, %o4, %g3
+ subccc %g2, %g1, %g0
+ brgz n, L(top)
+ stx %g3, [rp-8]
+
+ retl
+ subc %g5, %g0, %o0
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/ultrasparct1/sub_n.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/ultrasparct1/sub_n.asm
new file mode 100644
index 00000000000..c2af89f08f9
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/ultrasparct1/sub_n.asm
@@ -0,0 +1,68 @@
+dnl SPARC v9 mpn_sub_n for T1/T2.
+
+dnl Copyright 2010 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 T1: ?
+C UltraSPARC T2: ?
+
+C INPUT PARAMETERS
+define(`rp', `%o0')
+define(`up', `%o1')
+define(`vp', `%o2')
+define(`n', `%o3')
+define(`cy', `%o4')
+
+ASM_START()
+ REGISTER(%g2,#scratch)
+ REGISTER(%g3,#scratch)
+PROLOGUE(mpn_sub_nc)
+ b,a L(ent)
+EPILOGUE()
+PROLOGUE(mpn_sub_n)
+ mov 0, cy
+L(ent): cmp %g0, cy
+L(top): ldx [up+0], %o4
+ add up, 8, up
+ ldx [vp+0], %o5
+ add vp, 8, vp
+ add rp, 8, rp
+ add n, -1, n
+ srlx %o4, 32, %g1
+ srlx %o5, 32, %g2
+ subccc %o4, %o5, %g3
+ subccc %g1, %g2, %g0
+ brgz n, L(top)
+ stx %g3, [rp-8]
+
+ retl
+ addc %g0, %g0, %o0
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/ultrasparct1/sublsh1_n.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/ultrasparct1/sublsh1_n.asm
new file mode 100644
index 00000000000..8c8fa80401e
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/ultrasparct1/sublsh1_n.asm
@@ -0,0 +1,41 @@
+dnl SPARC v9 mpn_sublsh1_n for T1/T2.
+
+dnl Copyright 2010 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)
+
+define(func, mpn_sublsh1_n)
+
+MULFUNC_PROLOGUE(mpn_sublsh1_n)
+
+include_mpn(`sparc64/ultrasparct1/sublshC_n.asm')
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/ultrasparct1/sublsh2_n.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/ultrasparct1/sublsh2_n.asm
new file mode 100644
index 00000000000..2fd5eee71af
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/ultrasparct1/sublsh2_n.asm
@@ -0,0 +1,41 @@
+dnl SPARC v9 mpn_sublsh2_n for T1/T2.
+
+dnl Copyright 2010 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)
+
+define(func, mpn_sublsh2_n)
+
+MULFUNC_PROLOGUE(mpn_sublsh2_n)
+
+include_mpn(`sparc64/ultrasparct1/sublshC_n.asm')
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/ultrasparct1/sublshC_n.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/ultrasparct1/sublshC_n.asm
new file mode 100644
index 00000000000..01eafef1bce
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/ultrasparct1/sublshC_n.asm
@@ -0,0 +1,69 @@
+dnl SPARC v9 mpn_sublshC_n for T1/T2.
+
+dnl Copyright 2010 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/.
+
+C cycles/limb
+C UltraSPARC T1: 21
+C UltraSPARC T2: ?
+
+C INPUT PARAMETERS
+define(`rp', `%o0')
+define(`up', `%o1')
+define(`vp', `%o2')
+define(`n', `%o3')
+define(`cy', `%o4')
+
+ASM_START()
+ REGISTER(%g2,#scratch)
+ REGISTER(%g3,#scratch)
+PROLOGUE(func)
+ mov 0, cy
+ mov 0, %g5
+ cmp %g0, cy
+L(top): ldx [up+0], %o4
+ add up, 8, up
+ ldx [vp+0], %o5
+ add vp, 8, vp
+ add rp, 8, rp
+
+ sllx %o5, LSH, %g4
+ add n, -1, n
+ or %g5, %g4, %g4
+ srlx %o5, RSH, %g5
+
+ srlx %o4, 32, %g1
+ srlx %g4, 32, %g2
+ subccc %o4, %g4, %g3
+ subccc %g1, %g2, %g0
+ brgz n, L(top)
+ stx %g3, [rp-8]
+
+ retl
+ addc %g5, %g0, %o0
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/ultrasparct1/submul_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/ultrasparct1/submul_1.asm
new file mode 100644
index 00000000000..4f553a80638
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/ultrasparct1/submul_1.asm
@@ -0,0 +1,86 @@
+dnl SPARC v9 mpn_submul_1 for T1/T2.
+
+dnl Copyright 2010 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 T1: 74
+C UltraSPARC T2: ?
+
+C INPUT PARAMETERS
+define(`rp', `%i0')
+define(`up', `%i1')
+define(`n', `%i2')
+define(`v0', `%i3')
+
+ASM_START()
+ REGISTER(%g2,#scratch)
+ REGISTER(%g3,#scratch)
+PROLOGUE(mpn_submul_1)
+ save %sp, -176, %sp
+ mov 1, %o2
+ mov %i0, %g2
+ srlx %i3, 32, %o4
+ sllx %o2, 32, %o2
+ srl %i3, 0, %i3
+ mov 0, %g3
+ mov 0, %i0
+
+L(top): ldx [%i1+%g3], %g1
+ srl %g1, 0, %g4
+ mulx %g4, %i3, %o5
+ srlx %g1, 32, %g1
+ mulx %g1, %i3, %g5
+ mulx %g4, %o4, %g4
+ mulx %g1, %o4, %g1
+ srlx %o5, 32, %o1
+ add %g5, %o1, %o1
+ addcc %o1, %g4, %g4
+ srl %o5, 0, %o0
+ ldx [%g2+%g3], %o5
+ sllx %g4, 32, %o1
+ add %g1, %o2, %l1
+ movlu %xcc, %l1, %g1
+ add %o1, %o0, %l0
+ addcc %l0, %i0, %g5
+ srlx %g4, 32, %i0
+ add %i0, 1, %g4
+ movlu %xcc, %g4, %i0
+ subcc %o5, %g5, %g5
+ stx %g5, [%g2+%g3]
+ add %i0, 1, %g4
+ movlu %xcc, %g4, %i0
+ add %i2, -1, %i2
+ add %i0, %g1, %i0
+ brnz,pt %i2, L(top)
+ add %g3, 8, %g3
+ return %i7+8
+ nop
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/ultrasparct3/add_n.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/ultrasparct3/add_n.asm
new file mode 100644
index 00000000000..01707468956
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/ultrasparct3/add_n.asm
@@ -0,0 +1,126 @@
+dnl SPARC v9 mpn_add_n for T3/T4.
+
+dnl Contributed to the GNU project by David Miller.
+
+dnl Copyright 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/limb
+C UltraSPARC T3: 8
+C UltraSPARC T4: 3
+
+C INPUT PARAMETERS
+define(`rp', `%i0')
+define(`up', `%i1')
+define(`vp', `%i2')
+define(`n', `%i3')
+define(`cy', `%i4')
+
+define(`u0_off', `%l2')
+define(`u1_off', `%l3')
+define(`loop_n', `%l6')
+define(`tmp', `%l7')
+
+ASM_START()
+ REGISTER(%g2,#scratch)
+ REGISTER(%g3,#scratch)
+PROLOGUE(mpn_add_nc)
+ save %sp, -176, %sp
+ b,a L(ent)
+EPILOGUE()
+PROLOGUE(mpn_add_n)
+ save %sp, -176, %sp
+
+ mov 0, cy
+L(ent):
+ subcc n, 1, n
+ be L(final_one)
+ cmp %g0, cy
+
+ ldx [up + 0], %o4
+ sllx n, 3, tmp
+
+ ldx [vp + 0], %o5
+ add up, tmp, u0_off
+
+ ldx [up + 8], %g5
+ neg tmp, loop_n
+
+ ldx [vp + 8], %g1
+ add u0_off, 8, u1_off
+
+ sub loop_n, -(2 * 8), loop_n
+
+ brgez,pn loop_n, L(loop_tail)
+ add vp, (2 * 8), vp
+
+ b,a L(top)
+ ALIGN(16)
+L(top):
+ addxccc(%o4, %o5, tmp)
+ ldx [vp + 0], %o5
+
+ add rp, (2 * 8), rp
+ ldx [loop_n + u0_off], %o4
+
+ add vp, (2 * 8), vp
+ stx tmp, [rp - 16]
+
+ addxccc(%g1, %g5, tmp)
+ ldx [vp - 8], %g1
+
+ ldx [loop_n + u1_off], %g5
+ sub loop_n, -(2 * 8), loop_n
+
+ brlz loop_n, L(top)
+ stx tmp, [rp - 8]
+
+L(loop_tail):
+ addxccc(%o4, %o5, %g3)
+ add loop_n, u0_off, up
+
+ addxccc(%g1, %g5, %g5)
+ stx %g3, [rp + 0]
+
+ brgz,pt loop_n, L(done)
+ stx %g5, [rp + 8]
+
+ add rp, (2 * 8), rp
+L(final_one):
+ ldx [up+0], %o4
+ ldx [vp+0], %o5
+ addxccc(%o4, %o5, %g3)
+ stx %g3, [rp+0]
+
+L(done):
+ addxc(%g0, %g0, %i0)
+ ret
+ restore
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/ultrasparct3/addmul_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/ultrasparct3/addmul_1.asm
new file mode 100644
index 00000000000..939811e1ce2
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/ultrasparct3/addmul_1.asm
@@ -0,0 +1,182 @@
+dnl SPARC v9 mpn_addmul_1 for T3/T4/T5.
+
+dnl Contributed to the GNU project by David Miller and Torbjörn Granlund.
+
+dnl Copyright 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/limb
+C UltraSPARC T3: 26
+C UltraSPARC T4: 4.5
+
+C INPUT PARAMETERS
+define(`rp', `%i0')
+define(`up', `%i1')
+define(`n', `%i2')
+define(`v0', `%i3')
+
+define(`u0', `%l0')
+define(`u1', `%l1')
+define(`u2', `%l2')
+define(`u3', `%l3')
+define(`r0', `%l4')
+define(`r1', `%l5')
+define(`r2', `%l6')
+define(`r3', `%l7')
+
+ASM_START()
+ REGISTER(%g2,#scratch)
+ REGISTER(%g3,#scratch)
+PROLOGUE(mpn_addmul_1)
+ save %sp, -176, %sp
+ ldx [up+0], %g1
+
+ and n, 3, %g3
+ brz %g3, L(b0)
+ addcc %g0, %g0, %g5 C clear carry limb, flag
+ cmp %g3, 2
+ bcs %xcc, L(b01)
+ nop
+ be %xcc, L(b10)
+ ldx [up+8], %g5
+
+L(b11): ldx [up+16], u3
+ mulx %g1, v0, %o2
+ umulxhi(%g1, v0, %o3)
+ ldx [rp+0], r1
+ mulx %g5, v0, %o4
+ ldx [rp+8], r2
+ umulxhi(%g5, v0, %o5)
+ ldx [rp+16], r3
+ mulx u3, v0, %g4
+ umulxhi(u3, v0, %g5)
+ addcc %o3, %o4, %o4
+ addxccc(%o5, %g4, %g4)
+ addxc( %g0, %g5, %g5)
+ addcc r1, %o2, r1
+ stx r1, [rp+0]
+ addxccc(r2, %o4, r2)
+ stx r2, [rp+8]
+ addxccc(r3, %g4, r3)
+ stx r3, [rp+16]
+ add n, -3, n
+ add up, 24, up
+ brz n, L(xit)
+ add rp, 24, rp
+ b L(com)
+ nop
+
+L(b10): mulx %g1, v0, %o4
+ ldx [rp+0], r2
+ umulxhi(%g1, v0, %o5)
+ ldx [rp+8], r3
+ mulx %g5, v0, %g4
+ umulxhi(%g5, v0, %g5)
+ addcc %o5, %g4, %g4
+ addxc( %g0, %g5, %g5)
+ addcc r2, %o4, r2
+ stx r2, [rp+0]
+ addxccc(r3, %g4, r3)
+ stx r3, [rp+8]
+ add n, -2, n
+ add up, 16, up
+ brz n, L(xit)
+ add rp, 16, rp
+ b L(com)
+ nop
+
+L(b01): ldx [rp+0], r3
+ mulx %g1, v0, %g4
+ umulxhi(%g1, v0, %g5)
+ addcc r3, %g4, r3
+ stx r3, [rp+0]
+ add n, -1, n
+ add up, 8, up
+ brz n, L(xit)
+ add rp, 8, rp
+
+L(com): ldx [up+0], %g1
+L(b0): ldx [up+8], u1
+ ldx [up+16], u2
+ ldx [up+24], u3
+ mulx %g1, v0, %o0
+ umulxhi(%g1, v0, %o1)
+ b L(lo0)
+ nop
+
+ ALIGN(16)
+L(top): ldx [up+0], u0
+ addxc( %g0, %g5, %g5) C propagate carry into carry limb
+ ldx [up+8], u1
+ addcc r0, %o0, r0
+ ldx [up+16], u2
+ addxccc(r1, %o2, r1)
+ ldx [up+24], u3
+ addxccc(r2, %o4, r2)
+ stx r0, [rp-32]
+ addxccc(r3, %g4, r3)
+ stx r1, [rp-24]
+ mulx u0, v0, %o0
+ stx r2, [rp-16]
+ umulxhi(u0, v0, %o1)
+ stx r3, [rp-8]
+L(lo0): mulx u1, v0, %o2
+ ldx [rp+0], r0
+ umulxhi(u1, v0, %o3)
+ ldx [rp+8], r1
+ mulx u2, v0, %o4
+ ldx [rp+16], r2
+ umulxhi(u2, v0, %o5)
+ ldx [rp+24], r3
+ mulx u3, v0, %g4
+ addxccc(%g5, %o0, %o0)
+ umulxhi(u3, v0, %g5)
+ add up, 32, up
+ addxccc(%o1, %o2, %o2)
+ add rp, 32, rp
+ addxccc(%o3, %o4, %o4)
+ add n, -4, n
+ addxccc(%o5, %g4, %g4)
+ brgz n, L(top)
+ nop
+
+ addxc( %g0, %g5, %g5)
+ addcc r0, %o0, r0
+ stx r0, [rp-32]
+ addxccc(r1, %o2, r1)
+ stx r1, [rp-24]
+ addxccc(r2, %o4, r2)
+ stx r2, [rp-16]
+ addxccc(r3, %g4, r3)
+ stx r3, [rp-8]
+L(xit): addxc( %g0, %g5, %i0)
+ ret
+ restore
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/ultrasparct3/aormul_2.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/ultrasparct3/aormul_2.asm
new file mode 100644
index 00000000000..ccc6a4408d5
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/ultrasparct3/aormul_2.asm
@@ -0,0 +1,228 @@
+dnl SPARC v9 mpn_mul_2 and mpn_addmul_2 for T3/T4/T5.
+
+dnl Contributed to the GNU project by Torbjörn Granlund.
+
+dnl Copyright 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/limb cycles/limb
+C mul_2 addmul_2
+C UltraSPARC T3: 22.5 23.5
+C UltraSPARC T4: 3.25 3.75
+
+
+C The code is reasonably scheduled but also relies on OoO. There was hope that
+C this could run at around 3.0 and 3.5 c/l respectively, on T4. Two cycles per
+C iteration needs to be removed.
+C
+C We could almost use 2-way unrolling, but currently the wN registers live too
+C long. By changing add x,w1,w1 to add x,w1,w0, i.e. migrate the values down-
+C wards, 2-way unrolling should become possible. With n-indexed addressing it
+C should run no slower.
+C
+C The rp loads to g1/g3 are very much over-scheduled. Presumably, they could
+C be postponed a full way, and then just one register could be used.
+
+C INPUT PARAMETERS
+define(`rp', `%i0')
+define(`up', `%i1')
+define(`n', `%i2')
+define(`vp', `%i3')
+
+define(`v0', `%o0')
+define(`v1', `%o1')
+
+define(`w0', `%o2')
+define(`w1', `%o3')
+define(`w2', `%o4')
+define(`w3', `%o5')
+
+ifdef(`OPERATION_mul_2',`
+ define(`AM2', `')
+ define(`ADDX', `addcc`'$1')
+ define(`func', `mpn_mul_2')
+')
+ifdef(`OPERATION_addmul_2',`
+ define(`AM2', `$1')
+ define(`ADDX', `addxccc($1,$2,$3)')
+ define(`func', `mpn_addmul_2')
+')
+
+
+MULFUNC_PROLOGUE(mpn_mul_2 mpn_addmul_2)
+
+ASM_START()
+ REGISTER(%g2,#scratch)
+ REGISTER(%g3,#scratch)
+PROLOGUE(func)
+ save %sp, -176, %sp
+
+ ldx [vp+0], v0 C load v0
+ and n, 3, %g5
+ ldx [vp+8], v1 C load v1
+ add n, -6, n
+ ldx [up+0], %g4
+ brz %g5, L(b0)
+ cmp %g5, 2
+ bcs L(b1)
+ nop
+ be L(b2)
+ nop
+
+L(b3):
+AM2(` ldx [rp+0], %g1')
+ mulx %g4, v0, w2
+ umulxhi(%g4, v0, w3)
+ ldx [up+8], %i5
+ mulx %g4, v1, %l3
+ umulxhi(%g4, v1, %l7)
+AM2(` ldx [rp+8], %g3')
+ add up, -8, up
+ add rp, -8, rp
+ b L(lo3)
+ mov 0, w0
+
+L(b2):
+AM2(` ldx [rp+0], %g3')
+ mulx %g4, v0, w3
+ umulxhi(%g4, v0, w0)
+ ldx [up+8], %i4
+ mulx %g4, v1, %l1
+ umulxhi(%g4, v1, %l5)
+AM2(` ldx [rp+8], %g1')
+ add rp, 16, rp
+ brlz n, L(end)
+ mov 0, w1
+ ba L(top)
+ add up, 16, up
+
+L(b1):
+AM2(` ldx [rp+0], %g1')
+ mulx %g4, v0, w0
+ umulxhi(%g4, v0, w1)
+ ldx [up+8], %i5
+ mulx %g4, v1, %l3
+ umulxhi(%g4, v1, %l7)
+AM2(` ldx [rp+8], %g3')
+ add up, 8, up
+ add rp, 8, rp
+ b L(lo1)
+ mov 0, w2
+
+L(b0):
+AM2(` ldx [rp+0], %g3')
+ mulx %g4, v0, w1
+ umulxhi(%g4, v0, w2)
+ ldx [up+8], %i4
+ mulx %g4, v1, %l1
+ umulxhi(%g4, v1, %l5)
+AM2(` ldx [rp+8], %g1')
+ b L(lo0)
+ mov 0, w3
+
+ ALIGN(16) C cycle
+L(top): mulx %i4, v0, %l2 C 0->5
+ umulxhi(%i4, v0, %l6) C 0->5
+ ldx [up+0], %i5 C 1->6
+AM2(` addcc w3, %g3, w3') C 1
+ stx w3, [rp-16] C 2
+ ADDX(` %l1, w0, w0') C 2
+ addxccc(%l5, w1, w1) C 3
+ mulx %i4, v1, %l3 C 3->9
+ umulxhi(%i4, v1, %l7) C 4->9
+AM2(` ldx [rp+0], %g3') C 4
+ addcc %l2, w0, w0 C 5
+ addxccc(%l6, w1, w1) C 5
+ addxc( %g0, %g0, w2) C 6
+L(lo1): mulx %i5, v0, %l0 C 6
+ umulxhi(%i5, v0, %l4) C 7
+ ldx [up+8], %i4 C 7
+AM2(` addcc w0, %g1, w0') C 8
+ stx w0, [rp-8] C 8
+ ADDX(` %l3, w1, w1') C 9
+ addxccc(%l7, w2, w2) C 9
+ mulx %i5, v1, %l1 C 10
+ umulxhi(%i5, v1, %l5) C 10
+AM2(` ldx [rp+8], %g1') C 11
+ addcc %l0, w1, w1 C 11
+ addxccc(%l4, w2, w2) C 12
+ addxc( %g0, %g0, w3) C 12
+L(lo0): mulx %i4, v0, %l2 C 13
+ umulxhi(%i4, v0, %l6) C 13
+ ldx [up+16], %i5 C 14
+AM2(` addcc w1, %g3, w1') C 14
+ stx w1, [rp+0] C 15
+ ADDX(` %l1, w2, w2') C 15
+ addxccc(%l5, w3, w3) C 16
+ mulx %i4, v1, %l3 C 16
+ umulxhi(%i4, v1, %l7) C 17
+AM2(` ldx [rp+16], %g3') C 17
+ addcc %l2, w2, w2 C 18
+ addxccc(%l6, w3, w3) C 18
+ addxc( %g0, %g0, w0) C 19
+L(lo3): mulx %i5, v0, %l0 C 19
+ umulxhi(%i5, v0, %l4) C 20
+ ldx [up+24], %i4 C 20
+AM2(` addcc w2, %g1, w2') C 21
+ stx w2, [rp+8] C 21
+ ADDX(` %l3, w3, w3') C 22
+ addxccc(%l7, w0, w0) C 22
+ mulx %i5, v1, %l1 C 23
+ umulxhi(%i5, v1, %l5) C 23
+AM2(` ldx [rp+24], %g1') C 24
+ addcc %l0, w3, w3 C 24
+ addxccc(%l4, w0, w0) C 25
+ addxc( %g0, %g0, w1) C 25
+ add up, 32, up
+ add rp, 32, rp
+ brgz n, L(top)
+ add n, -4, n
+
+L(end): mulx %i4, v0, %l2
+ umulxhi(%i4, v0, %l6)
+AM2(` addcc w3, %g3, w3')
+ stx w3, [rp-16]
+ ADDX(` %l1, w0, w0')
+ addxccc(%l5, w1, w1)
+ mulx %i4, v1, %l3
+ umulxhi(%i4, v1, %l7)
+ addcc %l2, w0, w0
+ addxccc(%l6, w1, w1)
+ addxc( %g0, %g0, w2)
+AM2(` addcc w0, %g1, w0')
+ stx w0, [rp-8]
+ ADDX(` %l3, w1, w1')
+ stx w1, [rp+0]
+ addxc(%l7, w2, %i0)
+
+ ret
+ restore
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/ultrasparct3/aormul_4.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/ultrasparct3/aormul_4.asm
new file mode 100644
index 00000000000..845f6d6d692
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/ultrasparct3/aormul_4.asm
@@ -0,0 +1,219 @@
+dnl SPARC v9 mpn_mul_4 and mpn_addmul_4 for T3/T4/T5.
+
+dnl Contributed to the GNU project by Torbjörn Granlund.
+
+dnl Copyright 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/limb cycles/limb
+C mul_4 addmul_4
+C UltraSPARC T3: 21.5 22.0
+C UltraSPARC T4: 2.625 2.75
+
+
+C The code is well-scheduled and relies on OoO very little. There is hope that
+C this will run at around 2.5 and 2.75 c/l respectively, on T4.
+
+define(`rp', `%i0')
+define(`up', `%i1')
+define(`n', `%i2')
+define(`vp', `%i3')
+
+define(`v0', `%g1')
+define(`v1', `%o7')
+define(`v2', `%g2')
+define(`v3', `%i3')
+
+define(`w0', `%o0')
+define(`w1', `%o1')
+define(`w2', `%o2')
+define(`w3', `%o3')
+define(`w4', `%o4')
+
+define(`r0', `%o5')
+
+define(`u0', `%i4')
+define(`u1', `%i5')
+
+define(`rp0', `rp')
+define(`rp1', `%g3')
+define(`rp2', `%g4')
+define(`up0', `up')
+define(`up1', `%g5')
+
+ifdef(`OPERATION_mul_4',`
+ define(`AM4', `')
+ define(`ADDX', `addcc`'$1')
+ define(`func', `mpn_mul_4')
+')
+ifdef(`OPERATION_addmul_4',`
+ define(`AM4', `$1')
+ define(`ADDX', `addxccc($1,$2,$3)')
+ define(`func', `mpn_addmul_4')
+')
+
+
+MULFUNC_PROLOGUE(mpn_mul_4 mpn_addmul_4)
+
+ASM_START()
+ REGISTER(%g2,#scratch)
+ REGISTER(%g3,#scratch)
+PROLOGUE(func)
+ save %sp, -176, %sp
+
+ ldx [up + 0], u1 C load up[0] early
+ andcc n, 1, %g0 C is n odd?
+ ldx [vp + 0], v0
+ sllx n, 3, n
+ ldx [vp + 8], v1
+ add n, -28, n
+ ldx [vp + 16], v2
+ add rp, -16, rp
+ ldx [vp + 24], v3
+ add up, n, up0
+ add rp, n, rp0
+ add up0, 8, up1
+ add rp0, 8, rp1
+ add rp0, 16, rp2
+ mulx u1, v0, %l0
+ mov 0, w0
+ mulx u1, v1, %l1
+ mov 0, w1
+ mulx u1, v2, %l2
+ mov 0, w2
+ mulx u1, v3, %l3
+ mov 0, w3
+
+ be L(evn)
+ neg n, n
+
+L(odd): mov u1, u0
+ ldx [up1 + n], u1
+AM4(` ldx [rp2 + n], r0')
+ umulxhi(u0, v0, %l4)
+ umulxhi(u0, v1, %l5)
+ umulxhi(u0, v2, %l6)
+ umulxhi(u0, v3, %l7)
+ b L(mid)
+ add n, 8, n
+
+L(evn): ldx [up1 + n], u0
+AM4(` ldx [rp2 + n], r0')
+ umulxhi(u1, v0, %l4)
+ umulxhi(u1, v1, %l5)
+ umulxhi(u1, v2, %l6)
+ umulxhi(u1, v3, %l7)
+ add n, 16, n
+
+ ALIGN(16)
+L(top): addcc %l0, w0, w0
+ mulx u0, v0, %l0 C w 0
+ addxccc(%l1, w1, w1)
+ mulx u0, v1, %l1 C w 1
+ addxccc(%l2, w2, w2)
+ mulx u0, v2, %l2 C w 2
+ addxccc(%l3, w3, w3)
+ mulx u0, v3, %l3 C w 3
+ ldx [up0 + n], u1
+ addxc( %g0, %g0, w4)
+AM4(` addcc r0, w0, w0')
+ stx w0, [rp0 + n]
+ ADDX(` %l4, w1, w0')
+ umulxhi(u0, v0, %l4) C w 1
+AM4(` ldx [rp1 + n], r0')
+ addxccc(%l5, w2, w1)
+ umulxhi(u0, v1, %l5) C w 2
+ addxccc(%l6, w3, w2)
+ umulxhi(u0, v2, %l6) C w 3
+ addxc( %l7, w4, w3)
+ umulxhi(u0, v3, %l7) C w 4
+L(mid): addcc %l0, w0, w0
+ mulx u1, v0, %l0 C w 1
+ addxccc(%l1, w1, w1)
+ mulx u1, v1, %l1 C w 2
+ addxccc(%l2, w2, w2)
+ mulx u1, v2, %l2 C w 3
+ addxccc(%l3, w3, w3)
+ mulx u1, v3, %l3 C w 4
+ ldx [up1 + n], u0
+ addxc( %g0, %g0, w4)
+AM4(` addcc r0, w0, w0')
+ stx w0, [rp1 + n]
+ ADDX(` %l4, w1, w0')
+ umulxhi(u1, v0, %l4) C w 2
+AM4(` ldx [rp2 + n], r0')
+ addxccc(%l5, w2, w1)
+ umulxhi(u1, v1, %l5) C w 3
+ addxccc(%l6, w3, w2)
+ umulxhi(u1, v2, %l6) C w 4
+ addxc( %l7, w4, w3)
+ umulxhi(u1, v3, %l7) C w 5
+ brlz n, L(top)
+ add n, 16, n
+
+L(end): addcc %l0, w0, w0
+ mulx u0, v0, %l0
+ addxccc(%l1, w1, w1)
+ mulx u0, v1, %l1
+ addxccc(%l2, w2, w2)
+ mulx u0, v2, %l2
+ addxccc(%l3, w3, w3)
+ mulx u0, v3, %l3
+ addxc( %g0, %g0, w4)
+AM4(` addcc r0, w0, w0')
+ stx w0, [rp0 + n]
+ ADDX(` %l4, w1, w0')
+ umulxhi(u0, v0, %l4)
+AM4(` ldx [rp1 + n], r0')
+ addxccc(%l5, w2, w1)
+ umulxhi(u0, v1, %l5)
+ addxccc(%l6, w3, w2)
+ umulxhi(u0, v2, %l6)
+ addxc( %l7, w4, w3)
+ umulxhi(u0, v3, %l7)
+ addcc %l0, w0, w0
+ addxccc(%l1, w1, w1)
+ addxccc(%l2, w2, w2)
+ addxccc(%l3, w3, w3)
+ addxc( %g0, %g0, w4)
+AM4(` addcc r0, w0, w0')
+ stx w0, [rp1 + n]
+ ADDX(` %l4, w1, w0')
+ addxccc(%l5, w2, w1)
+ addxccc(%l6, w3, w2)
+ stx w0, [rp2 + n]
+ add n, 16, n
+ stx w1, [rp1 + n]
+ stx w2, [rp2 + n]
+ addxc( %l7, w4, %i0)
+ ret
+ restore
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/ultrasparct3/aorslsh_n.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/ultrasparct3/aorslsh_n.asm
new file mode 100644
index 00000000000..1014b1ba23a
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/ultrasparct3/aorslsh_n.asm
@@ -0,0 +1,147 @@
+dnl SPARC v9 mpn_addlsh_n and mpn_sublsh_n for T3/T4/T5.
+
+dnl Contributed to the GNU project by Torbjörn Granlund.
+
+dnl Copyright 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/limb
+C UltraSPARC T3: 11
+C UltraSPARC T4: 4
+
+C For sublsh_n we combine the two shifted limbs using xnor, using the identity
+C (a xor not b) = (not (a xor b)) which equals (not (a or b)) when (a and b) =
+C 0 as it is in our usage. This gives us the ones complement for free.
+C Unfortunately, the same trick will not work for rsblsh_n, which will instead
+C require a separate negation.
+C
+C FIXME: Add rsblsh_n to this file.
+
+define(`rp', `%i0')
+define(`up', `%i1')
+define(`vp', `%i2')
+define(`n', `%i3')
+define(`cnt',`%i4')
+
+define(`tnc',`%o5')
+
+ifdef(`OPERATION_addlsh_n',`
+ define(`INITCY', `subcc %g0, 0, %g0')
+ define(`MERGE', `or')
+ define(`func', `mpn_addlsh_n')
+')
+ifdef(`OPERATION_sublsh_n',`
+ define(`INITCY', `subcc %g0, 1, %g0')
+ define(`MERGE', `xnor')
+ define(`func', `mpn_sublsh_n')
+')
+
+define(`rp0', `rp')
+define(`rp1', `%o2')
+define(`up0', `up')
+define(`up1', `%o3')
+define(`vp0', `vp')
+define(`vp1', `%o4')
+
+MULFUNC_PROLOGUE(mpn_addlsh_n mpn_sublsh_n)
+ASM_START()
+ REGISTER(%g2,#scratch)
+ REGISTER(%g3,#scratch)
+PROLOGUE(func)
+ save %sp, -176, %sp
+ mov 64, tnc
+ sub tnc, cnt, tnc
+
+ andcc n, 1, %g0
+ sllx n, 3, n
+ add n, -16, n
+ add up, n, up0
+ add vp, n, vp0
+ add rp, n, rp0
+ add up0, 8, up1
+ add vp0, 8, vp1
+ add rp0, -8, rp1
+ add rp0, -16, rp0
+ neg n, n
+ be L(evn)
+ INITCY
+
+L(odd): ldx [vp0 + n], %l1
+ mov 0, %l2
+ ldx [up0 + n], %l5
+ sllx %l1, cnt, %g3
+ brgez n, L(wd1)
+ add n, 8, n
+ ldx [vp0 + n], %l0
+ b L(lo1)
+ sllx %l1, cnt, %g3
+
+L(evn): ldx [vp0 + n], %l0
+ mov 0, %l3
+ ldx [up0 + n], %l4
+ ldx [vp1 + n], %l1
+ b L(lo0)
+ sllx %l0, cnt, %g1
+
+L(top): addxccc(%l6, %l4, %o0)
+ ldx [vp0 + n], %l0
+ sllx %l1, cnt, %g3
+ stx %o0, [rp0 + n]
+L(lo1): srlx %l1, tnc, %l3
+ MERGE %l2, %g3, %l7
+ ldx [up0 + n], %l4
+ addxccc(%l7, %l5, %o1)
+ ldx [vp1 + n], %l1
+ sllx %l0, cnt, %g1
+ stx %o1, [rp1 + n]
+L(lo0): srlx %l0, tnc, %l2
+ MERGE %l3, %g1, %l6
+ ldx [up1 + n], %l5
+ brlz,pt n, L(top)
+ add n, 16, n
+
+ addxccc(%l6, %l4, %o0)
+ sllx %l1, cnt, %g3
+ stx %o0, [rp0 + n]
+L(wd1): srlx %l1, tnc, %l3
+ MERGE %l2, %g3, %l7
+ addxccc(%l7, %l5, %o1)
+ stx %o1, [rp1 + n]
+
+ifdef(`OPERATION_addlsh_n',
+` addxc( %l3, %g0, %i0)')
+ifdef(`OPERATION_sublsh_n',
+` addxc( %g0, %g0, %g1)
+ add %g1, -1, %g1
+ sub %l3, %g1, %i0')
+
+ ret
+ restore
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/ultrasparct3/bdiv_dbm1c.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/ultrasparct3/bdiv_dbm1c.asm
new file mode 100644
index 00000000000..550860d3689
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/ultrasparct3/bdiv_dbm1c.asm
@@ -0,0 +1,147 @@
+dnl SPARC T3/T4/T5 mpn_bdiv_dbm1c.
+
+dnl Contributed to the GNU project by Torbjörn Granlund.
+
+dnl Copyright 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/limb
+C UltraSPARC T3: 25
+C UltraSPARC T4/T5: 4
+
+C INPUT PARAMETERS
+define(`qp', `%i0')
+define(`ap', `%i1')
+define(`n', `%i2')
+define(`bd', `%i3')
+define(`h', `%i4')
+
+define(`plo0',`%g4') define(`plo1',`%g5')
+define(`phi0',`%l0') define(`phi1',`%l1')
+define(`a0', `%g1') define(`a1', `%g3')
+
+ASM_START()
+ REGISTER(%g2,#scratch)
+ REGISTER(%g3,#scratch)
+PROLOGUE(mpn_bdiv_dbm1c)
+ save %sp, -176, %sp
+
+ and n, 3, %g5
+ ldx [ap + 0], %g2
+ add n, -5, n
+ brz %g5, L(b0)
+ cmp %g5, 2
+ bcs %xcc, L(b1)
+ nop
+ be %xcc, L(b2)
+ nop
+
+L(b3): ldx [ap + 8], a0
+ mulx bd, %g2, plo1
+ umulxhi(bd, %g2, phi1)
+ ldx [ap + 16], a1
+ add qp, -24, qp
+ b L(lo3)
+ add ap, -8, ap
+
+L(b2): ldx [ap + 8], a1
+ mulx bd, %g2, plo0
+ umulxhi(bd, %g2, phi0)
+ brlz,pt n, L(wd2)
+ nop
+L(gt2): ldx [ap + 16], a0
+ add ap, 16, ap
+ b L(lo2)
+ add n, -1, n
+
+L(b1): mulx bd, %g2, plo1
+ umulxhi(bd, %g2, phi1)
+ brlz,pn n, L(wd1)
+ add qp, -8, qp
+L(gt1): ldx [ap + 8], a0
+ ldx [ap + 16], a1
+ b L(lo1)
+ add ap, 8, ap
+
+L(b0): ldx [ap + 8], a1
+ mulx bd, %g2, plo0
+ umulxhi(bd, %g2, phi0)
+ ldx [ap + 16], a0
+ b L(lo0)
+ add qp, -16, qp
+
+L(top): ldx [ap + 0], a0
+ sub h, phi1, h
+L(lo2): mulx bd, a1, plo1
+ umulxhi(bd, a1, phi1)
+ subcc h, plo0, h
+ addxc( phi0, %g0, phi0)
+ stx h, [qp + 0]
+ ldx [ap + 8], a1
+ sub h, phi0, h
+L(lo1): mulx bd, a0, plo0
+ umulxhi(bd, a0, phi0)
+ subcc h, plo1, h
+ addxc( phi1, %g0, phi1)
+ stx h, [qp + 8]
+ ldx [ap + 16], a0
+ sub h, phi1, h
+L(lo0): mulx bd, a1, plo1
+ umulxhi(bd, a1, phi1)
+ subcc h, plo0, h
+ addxc( phi0, %g0, phi0)
+ stx h, [qp + 16]
+ ldx [ap + 24], a1
+ sub h, phi0, h
+L(lo3): mulx bd, a0, plo0
+ umulxhi(bd, a0, phi0)
+ subcc h, plo1, h
+ addxc( phi1, %g0, phi1)
+ stx h, [qp + 24]
+ add ap, 32, ap
+ add qp, 32, qp
+ brgz,pt n, L(top)
+ add n, -4, n
+
+L(end): sub h, phi1, h
+L(wd2): mulx bd, a1, plo1
+ umulxhi(bd, a1, phi1)
+ subcc h, plo0, h
+ addxc( phi0, %g0, phi0)
+ stx h, [qp + 0]
+ sub h, phi0, h
+L(wd1): subcc h, plo1, h
+ addxc( phi1, %g0, phi1)
+ stx h, [qp + 8]
+ sub h, phi1, %i0
+
+ ret
+ restore
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/ultrasparct3/cnd_aors_n.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/ultrasparct3/cnd_aors_n.asm
new file mode 100644
index 00000000000..f10ee72c1ff
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/ultrasparct3/cnd_aors_n.asm
@@ -0,0 +1,143 @@
+dnl SPARC v9 mpn_cnd_add_n and mpn_cnd_sub_n for T3/T4/T5.
+
+dnl Contributed to the GNU project by David Miller and Torbjörn Granlund.
+
+dnl Copyright 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/limb
+C UltraSPARC T3: 8.5
+C UltraSPARC T4: 3
+
+C We use a double-pointer trick to allow indexed addressing. Its setup
+C cost might be a problem in these functions, since we don't expect huge n
+C arguments.
+C
+C For sub we need ~(a & mask) = (~a | ~mask) but by complementing mask we can
+C instead do ~(a & ~mask) = (~a | mask), allowing us to use the orn insn.
+
+C INPUT PARAMETERS
+define(`cnd', `%i0')
+define(`rp', `%i1')
+define(`up', `%i2')
+define(`vp', `%i3')
+define(`n', `%i4')
+
+define(`mask', `cnd')
+define(`up0', `%l0') define(`up1', `%l1')
+define(`vp0', `%l2') define(`vp1', `%l3')
+define(`rp0', `%g4') define(`rp1', `%g5')
+define(`u0', `%l4') define(`u1', `%l5')
+define(`v0', `%l6') define(`v1', `%l7')
+define(`x0', `%g1') define(`x1', `%g3')
+define(`w0', `%g1') define(`w1', `%g3')
+
+ifdef(`OPERATION_cnd_add_n',`
+ define(`LOGOP', `and $1, $2, $3')
+ define(`MAKEMASK',`cmp %g0, $1
+ subc %g0, %g0, $2')
+ define(`INITCY', `addcc %g0, 0, %g0')
+ define(`RETVAL', `addxc( %g0, %g0, %i0)')
+ define(`func', `mpn_cnd_add_n')
+')
+ifdef(`OPERATION_cnd_sub_n',`
+ define(`LOGOP', `orn $2, $1, $3')
+ define(`MAKEMASK',`cmp $1, 1
+ subc %g0, %g0, $2')
+ define(`INITCY', `subcc %g0, 1, %g0')
+ define(`RETVAL', `addxc( %g0, %g0, %i0)
+ xor %i0, 1, %i0')
+ define(`func', `mpn_cnd_sub_n')
+')
+
+MULFUNC_PROLOGUE(mpn_cnd_add_n mpn_cnd_sub_n)
+
+ASM_START()
+ REGISTER(%g2,#scratch)
+ REGISTER(%g3,#scratch)
+PROLOGUE(func)
+ save %sp, -176, %sp
+
+ MAKEMASK(cnd,mask)
+
+ andcc n, 1, %g0
+ sllx n, 3, n
+ add n, -16, n
+ add vp, n, vp0
+ add up, n, up0
+ add rp, n, rp0
+ neg n, n
+ be L(evn)
+ INITCY
+
+L(odd): ldx [vp0 + n], v1
+ ldx [up0 + n], u1
+ LOGOP( v1, mask, x1)
+ addxccc(u1, x1, w1)
+ stx w1, [rp0 + n]
+ add n, 8, n
+ brgz n, L(rtn)
+ nop
+
+L(evn): add vp0, 8, vp1
+ add up0, 8, up1
+ add rp0, -24, rp1
+ ldx [vp0 + n], v0
+ ldx [vp1 + n], v1
+ ldx [up0 + n], u0
+ ldx [up1 + n], u1
+ add n, 16, n
+ brgz n, L(end)
+ add rp0, -16, rp0
+
+L(top): LOGOP( v0, mask, x0)
+ ldx [vp0 + n], v0
+ LOGOP( v1, mask, x1)
+ ldx [vp1 + n], v1
+ addxccc(u0, x0, w0)
+ ldx [up0 + n], u0
+ addxccc(u1, x1, w1)
+ ldx [up1 + n], u1
+ stx w0, [rp0 + n]
+ add n, 16, n
+ brlez n, L(top)
+ stx w1, [rp1 + n]
+
+L(end): LOGOP( v0, mask, x0)
+ LOGOP( v1, mask, x1)
+ addxccc(u0, x0, w0)
+ addxccc(u1, x1, w1)
+ stx w0, [rp0 + n]
+ stx w1, [rp1 + 32]
+
+L(rtn): RETVAL
+ ret
+ restore
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/ultrasparct3/dive_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/ultrasparct3/dive_1.asm
new file mode 100644
index 00000000000..d7dbdf953c1
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/ultrasparct3/dive_1.asm
@@ -0,0 +1,129 @@
+dnl SPARC T3/T4/T5 mpn_divexact_1.
+
+dnl Contributed to the GNU project by Torbjörn Granlund.
+
+dnl Copyright 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/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',`%o4')
+
+ASM_START()
+ REGISTER(%g2,#scratch)
+ REGISTER(%g3,#scratch)
+PROLOGUE(mpn_divexact_1)
+ save %sp, -176, %sp
+ cmp n, 1
+ bne,pt %xcc, L(gt1)
+ ldx [ap], %o5
+ udivx %o5, d, %g1
+ stx %g1, [qp]
+ return %i7+8
+ nop
+
+L(gt1): add d, -1, %g1
+ andn %g1, d, %g1
+ popc %g1, %i4 C i4 = count_trailing_zeros(d)
+
+ srlx d, %i4, 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 %i4, L(norm)
+ sub %o7, %g1, dinv
+
+L(unnorm):
+ mov 0, %g4
+ sub %g0, %i4, %o2
+ srlx %o5, %i4, %o5
+L(top_unnorm):
+ ldx [ap+8], %g3
+ add ap, 8, ap
+ sllx %g3, %o2, %g5
+ or %g5, %o5, %g5
+ srlx %g3, %i4, %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(top_unnorm)
+ add n, -1, n
+
+ sub %o5, %g4, %g4
+ mulx %g4, dinv, %g1
+ stx %g1, [qp]
+ return %i7+8
+ nop
+
+L(norm):
+ mulx dinv, %o5, %g1
+ stx %g1, [qp]
+ add qp, 8, qp
+ addcc %g0, 0, %g4
+L(top_norm):
+ 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(top_norm)
+ add n, -1, n
+
+ return %i7+8
+ nop
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/ultrasparct3/hamdist.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/ultrasparct3/hamdist.asm
new file mode 100644
index 00000000000..20ed8bf15b2
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/ultrasparct3/hamdist.asm
@@ -0,0 +1,78 @@
+dnl SPARC v9 mpn_hamdist for T3/T4.
+
+dnl Contributed to the GNU project by David Miller.
+
+dnl Copyright 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/limb
+C UltraSPARC T3: 18
+C UltraSPARC T4: 3.5
+
+C INPUT PARAMETERS
+define(`up', `%o0')
+define(`vp', `%o1')
+define(`n', `%o2')
+define(`pcnt', `%o5')
+
+ASM_START()
+ REGISTER(%g2,#scratch)
+ REGISTER(%g3,#scratch)
+PROLOGUE(mpn_hamdist)
+ subcc n, 1, n
+ be L(final_one)
+ clr pcnt
+L(top):
+ ldx [up + 0], %g1
+ ldx [vp + 0], %g2
+ ldx [up + 8], %o4
+ ldx [vp + 8], %g3
+ sub n, 2, n
+ xor %g1, %g2, %g1
+ add up, 16, up
+ popc %g1, %g2
+ add vp, 16, vp
+ xor %o4, %g3, %o4
+ add pcnt, %g2, pcnt
+ popc %o4, %g3
+ brgz n, L(top)
+ add pcnt, %g3, pcnt
+ brlz,pt n, L(done)
+ nop
+L(final_one):
+ ldx [up + 0], %g1
+ ldx [vp + 0], %g2
+ xor %g1,%g2, %g1
+ popc %g1, %g2
+ add pcnt, %g2, pcnt
+L(done):
+ retl
+ mov pcnt, %o0
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/ultrasparct3/invert_limb.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/ultrasparct3/invert_limb.asm
new file mode 100644
index 00000000000..4da49cf0301
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/ultrasparct3/invert_limb.asm
@@ -0,0 +1,92 @@
+dnl SPARC T3/T4/T5 mpn_invert_limb.
+
+dnl Contributed to the GNU project by Torbjörn Granlund.
+
+dnl Copyright 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/limb
+C UltraSPARC T3: ?
+C UltraSPARC T4/T5: ?
+
+C INPUT PARAMETERS
+define(`d', `%o0')
+
+ASM_START()
+ REGISTER(%g2,#scratch)
+ REGISTER(%g3,#scratch)
+PROLOGUE(mpn_invert_limb)
+ srlx d, 54, %g1
+ LEA64(approx_tab, g2, g3)
+ and %g1, 0x1fe, %g1
+ srlx d, 24, %g4
+ lduh [%g2+%g1], %g3
+ add %g4, 1, %g4
+ sllx %g3, 11, %g2
+ add %g2, -1, %g2
+ mulx %g3, %g3, %g3
+ mulx %g3, %g4, %g3
+ srlx %g3, 40, %g3
+ sub %g2, %g3, %g2
+ sllx %g2, 60, %g1
+ mulx %g2, %g2, %g3
+ mulx %g3, %g4, %g4
+ sub %g1, %g4, %g1
+ srlx %g1, 47, %g1
+ sllx %g2, 13, %g2
+ add %g1, %g2, %g1
+ and d, 1, %g2
+ srlx %g1, 1, %g4
+ sub %g0, %g2, %g3
+ and %g4, %g3, %g3
+ srlx d, 1, %g4
+ add %g4, %g2, %g2
+ mulx %g1, %g2, %g2
+ sub %g3, %g2, %g2
+ umulxhi(%g1, %g2, %g2)
+ srlx %g2, 1, %g2
+ sllx %g1, 31, %g1
+ add %g2, %g1, %g1
+ mulx %g1, d, %g3
+ umulxhi(d, %g1, %g4)
+ addcc %g3, d, %g0
+ addxc( %g4, d, %o0)
+ jmp %o7+8
+ sub %g1, %o0, %o0
+EPILOGUE()
+
+ RODATA
+ ALIGN(2)
+ TYPE( approx_tab, object)
+ SIZE( approx_tab, 512)
+approx_tab:
+forloop(i,256,512-1,dnl
+` .half eval(0x7fd00/i)
+')dnl
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/ultrasparct3/missing.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/ultrasparct3/missing.asm
new file mode 100644
index 00000000000..c79032dd388
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/ultrasparct3/missing.asm
@@ -0,0 +1,77 @@
+dnl SPARC v9-2011 simulation support.
+
+dnl Contributed to the GNU project by Torbjörn Granlund.
+
+dnl Copyright 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')
+
+ASM_START()
+PROLOGUE(__gmpn_umulh)
+ save %sp, -176, %sp
+ ldx [%sp+2047+176+256], %o0
+ ldx [%sp+2047+176+256+8], %o1
+ rd %ccr, %o4
+ srl %o0, 0, %l4
+ srl %o1, 0, %l1
+ srlx %o1, 32, %o1
+ mulx %o1, %l4, %l2
+ srlx %o0, 32, %o0
+ mulx %o0, %l1, %l3
+ mulx %l1, %l4, %l1
+ srlx %l1, 32, %l1
+ add %l2, %l1, %l2
+ addcc %l2, %l3, %l2
+ mulx %o1, %o0, %o1
+ mov 0, %l1
+ movcs %xcc, 1, %l1
+ sllx %l1, 32, %l1
+ add %o1, %l1, %o1
+ srlx %l2, 32, %o0
+ add %o1, %o0, %o0
+ stx %o0, [%sp+2047+176+256]
+ wr %o4, 0, %ccr
+ ret
+ restore
+EPILOGUE()
+
+PROLOGUE(__gmpn_lzcnt)
+ save %sp, -176, %sp
+ ldx [%sp+2047+176+256], %o0
+ brz,a %o0, 2f
+ mov 64, %o1
+ brlz %o0, 2f
+ mov 0, %o1
+1: sllx %o0, 1, %o0
+ brgz %o0, 1b
+ add %o1, 1, %o1
+ stx %o1, [%sp+2047+176+256]
+2: ret
+ restore
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/ultrasparct3/missing.m4 b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/ultrasparct3/missing.m4
new file mode 100644
index 00000000000..e5d6d8e98e6
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/ultrasparct3/missing.m4
@@ -0,0 +1,88 @@
+dnl SPARC v9-2011 simulation support.
+
+dnl Contributed to the GNU project by Torbjörn Granlund.
+
+dnl Copyright 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/.
+
+
+dnl Usage addxccc(r1,r2,r3, t1)
+dnl 64-bit add with carry-in and carry-out
+dnl FIXME: Register g2 must not be destination
+
+define(`addxccc',`dnl
+ add %sp, -512, %sp
+ stx %g2, [%sp+2047+256+16]
+ mov 0, %g2
+ movcs %xcc, -1, %g2
+ addcc %g2, 1, %g0
+ addccc $1, $2, $3
+ ldx [%sp+2047+256+16], %g2
+ sub %sp, -512, %sp
+')
+
+
+dnl Usage addxc(r1,r2,r3, t1,t2)
+dnl 64-bit add with carry-in
+
+define(`addxc',`dnl
+ bcc %xcc, 1f
+ add $1, $2, $3
+ add $3, 1, $3
+1:
+')
+
+
+dnl Usage umulxhi(r1,r2,r3)
+dnl 64-bit multiply returning upper 64 bits
+dnl Calls __gmpn_umulh using a non-standard calling convention
+
+define(`umulxhi',`dnl
+ add %sp, -512, %sp
+ stx $1, [%sp+2047+256]
+ stx $2, [%sp+2047+256+8]
+ stx %o7, [%sp+2047+256+16]
+ call __gmpn_umulh
+ nop
+ ldx [%sp+2047+256+16], %o7
+ ldx [%sp+2047+256], $3
+ sub %sp, -512, %sp
+')
+dnl Usage lzcnt(r1,r2)
+dnl Plain count leading zeros
+dnl Calls __gmpn_lzcnt using a non-standard calling convention
+
+define(`lzcnt',`dnl
+ add %sp, -512, %sp
+ stx %o7, [%sp+2047+256+16]
+ call __gmpn_lzcnt
+ stx $1, [%sp+2047+256]
+ ldx [%sp+2047+256+16], %o7
+ ldx [%sp+2047+256], $2
+ sub %sp, -512, %sp
+')
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/ultrasparct3/mod_1_4.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/ultrasparct3/mod_1_4.asm
new file mode 100644
index 00000000000..08facbd1ccd
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/ultrasparct3/mod_1_4.asm
@@ -0,0 +1,233 @@
+dnl SPARC T3/T4/T5 mpn_mod_1s_4p.
+
+dnl Contributed to the GNU project by Torbjörn Granlund.
+
+dnl Copyright 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/limb
+C UltraSPARC T3: 30
+C UltraSPARC T4/T5: 4
+
+C INPUT PARAMETERS
+define(`ap', `%o0')
+define(`n', `%o1')
+define(`d', `%o2')
+define(`cps', `%o3')
+
+
+ASM_START()
+ REGISTER(%g2,#scratch)
+ REGISTER(%g3,#scratch)
+PROLOGUE(mpn_mod_1s_4p)
+ save %sp, -176, %sp
+ ldx [%i3+16], %o4
+ ldx [%i3+24], %o3
+ ldx [%i3+32], %o2
+ ldx [%i3+40], %o1
+ ldx [%i3+48], %o0
+
+ and %i1, 3, %g3
+ sllx %i1, 3, %g1
+ add %i0, %g1, %i0
+ brz %g3, L(b00)
+ cmp %g3, 2
+ bcs %xcc, L(b01)
+ nop
+ be %xcc, L(b10)
+ nop
+
+L(b11): ldx [%i0-16], %g2
+ mulx %g2, %o4, %g5
+ umulxhi(%g2, %o4, %g3)
+ ldx [%i0-24], %g4
+ addcc %g5, %g4, %g5
+ addxc( %g3, %g0, %g4)
+ ldx [%i0-8], %g2
+ mulx %g2, %o3, %g1
+ umulxhi(%g2, %o3, %g3)
+ addcc %g1, %g5, %g1
+ addxc( %g3, %g4, %g2)
+ ba,pt %xcc, .L8
+ add %i0, -32, %i0
+
+L(b00): ldx [%i0-24], %g3
+ mulx %g3, %o4, %g2
+ umulxhi(%g3, %o4, %g5)
+ ldx [%i0-32], %g4
+ addcc %g2, %g4, %g2
+ addxc( %g5, %g0, %g3)
+ ldx [%i0-16], %g4
+ mulx %g4, %o3, %g5
+ umulxhi(%g4, %o3, %i5)
+ addcc %g2, %g5, %g5
+ addxc( %g3, %i5, %g4)
+ ldx [%i0-8], %g2
+ mulx %g2, %o2, %g1
+ umulxhi(%g2, %o2, %g3)
+ addcc %g1, %g5, %g1
+ addxc( %g3, %g4, %g2)
+ ba,pt %xcc, .L8
+ add %i0, -40, %i0
+
+L(b01): ldx [%i0-8], %g1
+ mov 0, %g2
+ ba,pt %xcc, .L8
+ add %i0, -16, %i0
+
+L(b10): ldx [%i0-8], %g2
+ ldx [%i0-16], %g1
+ add %i0, -24, %i0
+
+.L8: add %i1, -5, %g3
+ brlz,pn %g3, L(end)
+ nop
+
+L(top): ldx [%i0-16], %i4
+ mulx %i4, %o4, %o5
+ umulxhi(%i4, %o4, %i1)
+ ldx [%i0-24], %i5
+ addcc %o5, %i5, %o5
+ addxc( %i1, %g0, %i4)
+ ldx [%i0-8], %i5
+ mulx %i5, %o3, %o7
+ umulxhi(%i5, %o3, %i1)
+ addcc %o5, %o7, %o7
+ addxc( %i4, %i1, %i5)
+ ldx [%i0+0], %g4
+ mulx %g4, %o2, %i1
+ umulxhi(%g4, %o2, %i4)
+ addcc %o7, %i1, %i1
+ addxc( %i5, %i4, %g4)
+ mulx %g1, %o1, %i5
+ umulxhi(%g1, %o1, %i4)
+ addcc %i1, %i5, %i5
+ addxc( %g4, %i4, %g5)
+ mulx %g2, %o0, %g1
+ umulxhi(%g2, %o0, %g4)
+ addcc %g1, %i5, %g1
+ addxc( %g4, %g5, %g2)
+ add %g3, -4, %g3
+ brgez,pt %g3, L(top)
+ add %i0, -32, %i0
+
+L(end): mulx %g2, %o4, %g5
+ umulxhi(%g2, %o4, %g3)
+ addcc %g1, %g5, %g5
+ addxc( %g3, %g0, %g2)
+ ldx [%i3+8], %i0
+ ldx [%i3], %g4
+ sub %g0, %i0, %i5
+ srlx %g5, %i5, %i5
+ sllx %g2, %i0, %g2
+ or %i5, %g2, %g1
+ mulx %g1, %g4, %l7
+ umulxhi(%g1, %g4, %g3)
+ sllx %g5, %i0, %g2
+ add %g1, 1, %g1
+ addcc %l7, %g2, %g5
+ addxc( %g3, %g1, %g1)
+ mulx %g1, %i2, %g1
+ sub %g2, %g1, %g2
+ cmp %g2, %g5
+ add %i2, %g2, %g1
+ movlu %xcc, %g2, %g1
+ subcc %g1, %i2, %g2
+ movgeu %xcc, %g2, %g1
+ return %i7+8
+ srlx %g1, %o0, %o0
+EPILOGUE()
+
+PROLOGUE(mpn_mod_1s_4p_cps)
+ save %sp, -176, %sp
+ lzcnt( %i1, %i5)
+ sllx %i1, %i5, %i1
+ call mpn_invert_limb, 0
+ mov %i1, %o0
+ stx %o0, [%i0]
+ sra %i5, 0, %g1
+ stx %g1, [%i0+8]
+ sub %g0, %i5, %g2
+ srlx %o0, %g2, %g2
+ mov 1, %g1
+ sllx %g1, %i5, %g1
+ or %g2, %g1, %g2
+ sub %g0, %i1, %g1
+ mulx %g2, %g1, %g2
+ srlx %g2, %i5, %g1
+ stx %g1, [%i0+16]
+
+ umulxhi(%o0, %g2, %g3)
+ add %g2, %g3, %g3
+ xnor %g0, %g3, %g3
+ mulx %g3, %i1, %g3
+ mulx %g2, %o0, %g2
+ cmp %g2, %g3
+ add %i1, %g3, %g1
+ movgeu %xcc, %g3, %g1
+ srlx %g1, %i5, %g2
+ stx %g2, [%i0+24]
+
+ umulxhi(%o0, %g1, %g3)
+ add %g1, %g3, %g3
+ xnor %g0, %g3, %g3
+ mulx %g3, %i1, %g3
+ mulx %g1, %o0, %g1
+ cmp %g1, %g3
+ add %i1, %g3, %g2
+ movgeu %xcc, %g3, %g2
+ srlx %g2, %i5, %g1
+ stx %g1, [%i0+32]
+
+ umulxhi(%o0, %g2, %g3)
+ add %g2, %g3, %g3
+ xnor %g0, %g3, %g3
+ mulx %g3, %i1, %g3
+ mulx %g2, %o0, %g2
+ cmp %g2, %g3
+ add %i1, %g3, %g1
+ movgeu %xcc, %g3, %g1
+ srlx %g1, %i5, %g2
+ stx %g2, [%i0+40]
+
+ umulxhi(%o0, %g1, %g2)
+ add %g1, %g2, %g2
+ xnor %g0, %g2, %g2
+ mulx %g2, %i1, %g2
+ mulx %g1, %o0, %o0
+ cmp %o0, %g2
+ add %i1, %g2, %g3
+ movgeu %xcc, %g2, %g3
+ srlx %g3, %i5, %i5
+ stx %i5, [%i0+48]
+
+ return %i7+8
+ nop
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/ultrasparct3/mod_34lsub1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/ultrasparct3/mod_34lsub1.asm
new file mode 100644
index 00000000000..874428069e8
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/ultrasparct3/mod_34lsub1.asm
@@ -0,0 +1,117 @@
+dnl SPARC v9 mpn_mod_34lsub1 for T3/T4/T5.
+
+dnl Copyright 2005, 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/limb
+C UltraSPARC T1: -
+C UltraSPARC T3: 5
+C UltraSPARC T4: 1.57
+
+C This is based on the powerpc64/mode64 code.
+
+C INPUT PARAMETERS
+define(`up', `%i0')
+define(`n', `%i1')
+
+ASM_START()
+ REGISTER(%g2,#scratch)
+ REGISTER(%g3,#scratch)
+PROLOGUE(mpn_mod_34lsub1)
+ save %sp, -176, %sp
+
+ mov 0, %g1
+ mov 0, %g3
+ mov 0, %g4
+ addcc %g0, 0, %g5
+
+ add n, -3, n
+ brlz n, L(lt3)
+ nop
+
+ add n, -3, n
+ ldx [up+0], %l5
+ ldx [up+8], %l6
+ ldx [up+16], %l7
+ brlz n, L(end)
+ add up, 24, up
+
+ ALIGN(16)
+L(top): addxccc(%g1, %l5, %g1)
+ ldx [up+0], %l5
+ addxccc(%g3, %l6, %g3)
+ ldx [up+8], %l6
+ addxccc(%g4, %l7, %g4)
+ ldx [up+16], %l7
+ add n, -3, n
+ brgez n, L(top)
+ add up, 24, up
+
+L(end): addxccc( %g1, %l5, %g1)
+ addxccc(%g3, %l6, %g3)
+ addxccc(%g4, %l7, %g4)
+ addxc( %g5, %g0, %g5)
+
+L(lt3): cmp n, -2
+ blt L(2)
+ nop
+
+ ldx [up+0], %l5
+ mov 0, %l6
+ beq L(1)
+ addcc %g1, %l5, %g1
+
+ ldx [up+8], %l6
+L(1): addxccc(%g3, %l6, %g3)
+ addxccc(%g4, %g0, %g4)
+ addxc( %g5, %g0, %g5)
+
+L(2): sllx %g1, 16, %l0
+ srlx %l0, 16, %l0 C %l0 = %g1 mod 2^48
+ srlx %g1, 48, %l3 C %l3 = %g1 div 2^48
+ srl %g3, 0, %g1
+ sllx %g1, 16, %l4 C %l4 = (%g3 mod 2^32) << 16
+ srlx %g3, 32, %l5 C %l5 = %g3 div 2^32
+ sethi %hi(0xffff0000), %g1
+ andn %g4, %g1, %g1
+ sllx %g1, 32, %l6 C %l6 = (%g4 mod 2^16) << 32
+ srlx %g4, 16, %l7 C %l7 = %g4 div 2^16
+
+ add %l0, %l3, %l0
+ add %l4, %l5, %l4
+ add %l6, %l7, %l6
+
+ add %l0, %l4, %l0
+ add %l6, %g5, %l6
+
+ add %l0, %l6, %i0
+ ret
+ restore
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/ultrasparct3/mode1o.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/ultrasparct3/mode1o.asm
new file mode 100644
index 00000000000..494e1d3f4f3
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/ultrasparct3/mode1o.asm
@@ -0,0 +1,82 @@
+dnl SPARC T3/T4/T5 mpn_modexact_1c_odd.
+
+dnl Contributed to the GNU project by Torbjörn Granlund.
+
+dnl Copyright 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/limb
+C UltraSPARC T3: 30
+C UltraSPARC T4/T5: 26
+
+C INPUT PARAMETERS
+define(`ap', `%o0')
+define(`n', `%o1')
+define(`d', `%o2')
+define(`cy', `%o3')
+
+define(`dinv',`%o5')
+define(`a0', `%g1')
+
+ASM_START()
+ REGISTER(%g2,#scratch)
+ REGISTER(%g3,#scratch)
+PROLOGUE(mpn_modexact_1c_odd)
+ 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, %o5
+ mulx %g1, %g1, %g1
+ mulx %g1, d, %g1
+ sub %o5, %g1, dinv
+ add n, -1, n
+
+L(top): ldx [ap], a0
+ add ap, 8, ap
+ subcc a0, cy, %g3
+ mulx %g3, dinv, %g5
+ umulxhi(d, %g5, %g5)
+ addxc( %g5, %g0, cy)
+ brnz,pt n, L(top)
+ add n, -1, n
+
+ retl
+ mov cy, %o0
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/ultrasparct3/mul_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/ultrasparct3/mul_1.asm
new file mode 100644
index 00000000000..af05d627bcf
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/ultrasparct3/mul_1.asm
@@ -0,0 +1,174 @@
+dnl SPARC v9 mpn_mul_1 for T3/T4/T5.
+
+dnl Contributed to the GNU project by David Miller and Torbjörn Granlund.
+
+dnl Copyright 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/limb
+C UltraSPARC T3: 23
+C UltraSPARC T4: 3
+
+C INPUT PARAMETERS
+define(`rp', `%i0')
+define(`up', `%i1')
+define(`n', `%i2')
+define(`v0', `%i3')
+
+ASM_START()
+ REGISTER(%g2,#scratch)
+ REGISTER(%g3,#scratch)
+PROLOGUE(mpn_mul_1)
+ save %sp, -176, %sp
+
+ and n, 3, %g5
+ add n, -4, n
+ brz %g5, L(b0)
+ cmp %g5, 2
+ bcs %xcc, L(b1)
+ nop
+ be %xcc, L(b2)
+ nop
+
+L(b3): addcc %g0, %g0, %i5
+ ldx [up+0], %l0
+ ldx [up+8], %l1
+ ldx [up+16], %l2
+ mulx %l0, v0, %o0
+ umulxhi(%l0, v0, %o1)
+ brgz n, L(gt3)
+ add rp, -8, rp
+ mulx %l1, v0, %o2
+ umulxhi(%l1, v0, %o3)
+ b L(wd3)
+ nop
+L(gt3): ldx [up+24], %l3
+ mulx %l1, v0, %o2
+ umulxhi(%l1, v0, %o3)
+ add up, 24, up
+ b L(lo3)
+ add n, -3, n
+
+L(b2): addcc %g0, %g0, %o1
+ ldx [up+0], %l1
+ ldx [up+8], %l2
+ brgz n, L(gt2)
+ add rp, -16, rp
+ mulx %l1, v0, %o2
+ umulxhi(%l1, v0, %o3)
+ mulx %l2, v0, %o4
+ umulxhi(%l2, v0, %o5)
+ b L(wd2)
+ nop
+L(gt2): ldx [up+16], %l3
+ mulx %l1, v0, %o2
+ umulxhi(%l1, v0, %o3)
+ ldx [up+24], %l0
+ mulx %l2, v0, %o4
+ umulxhi(%l2, v0, %o5)
+ add up, 16, up
+ b L(lo2)
+ add n, -2, n
+
+L(b1): addcc %g0, %g0, %o3
+ ldx [up+0], %l2
+ brgz n, L(gt1)
+ nop
+ mulx %l2, v0, %o4
+ stx %o4, [rp+0]
+ umulxhi(%l2, v0, %i0)
+ ret
+ restore
+L(gt1): ldx [up+8], %l3
+ ldx [up+16], %l0
+ mulx %l2, v0, %o4
+ umulxhi(%l2, v0, %o5)
+ ldx [up+24], %l1
+ mulx %l3, v0, %i4
+ umulxhi(%l3, v0, %i5)
+ add rp, -24, rp
+ add up, 8, up
+ b L(lo1)
+ add n, -1, n
+
+L(b0): addcc %g0, %g0, %o5
+ ldx [up+0], %l3
+ ldx [up+8], %l0
+ ldx [up+16], %l1
+ mulx %l3, v0, %i4
+ umulxhi(%l3, v0, %i5)
+ ldx [up+24], %l2
+ mulx %l0, v0, %o0
+ umulxhi(%l0, v0, %o1)
+ b L(lo0)
+ nop
+
+ ALIGN(16)
+L(top): ldx [up+0], %l3 C 0
+ addxccc(%i4, %o5, %i4) C 0
+ mulx %l1, v0, %o2 C 1
+ stx %i4, [rp+0] C 1
+ umulxhi(%l1, v0, %o3) C 2
+L(lo3): ldx [up+8], %l0 C 2
+ addxccc(%o0, %i5, %o0) C 3
+ mulx %l2, v0, %o4 C 3
+ stx %o0, [rp+8] C 4
+ umulxhi(%l2, v0, %o5) C 4
+L(lo2): ldx [up+16], %l1 C 5
+ addxccc(%o2, %o1, %o2) C 5
+ mulx %l3, v0, %i4 C 6
+ stx %o2, [rp+16] C 6
+ umulxhi(%l3, v0, %i5) C 7
+L(lo1): ldx [up+24], %l2 C 7
+ addxccc(%o4, %o3, %o4) C 8
+ mulx %l0, v0, %o0 C 8
+ stx %o4, [rp+24] C 9
+ umulxhi(%l0, v0, %o1) C 9
+ add rp, 32, rp C 10
+L(lo0): add up, 32, up C 10
+ brgz n, L(top) C 11
+ add n, -4, n C 11
+
+L(end): addxccc(%i4, %o5, %i4)
+ mulx %l1, v0, %o2
+ stx %i4, [rp+0]
+ umulxhi(%l1, v0, %o3)
+ addxccc(%o0, %i5, %o0)
+L(wd3): mulx %l2, v0, %o4
+ stx %o0, [rp+8]
+ umulxhi(%l2, v0, %o5)
+ addxccc(%o2, %o1, %o2)
+L(wd2): stx %o2, [rp+16]
+ addxccc(%o4, %o3, %o4)
+ stx %o4, [rp+24]
+ addxc( %g0, %o5, %i0)
+ ret
+ restore
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/ultrasparct3/popcount.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/ultrasparct3/popcount.asm
new file mode 100644
index 00000000000..de80f3c8098
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/ultrasparct3/popcount.asm
@@ -0,0 +1,70 @@
+dnl SPARC v9 mpn_popcount for T3/T4.
+
+dnl Contributed to the GNU project by David Miller.
+
+dnl Copyright 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/limb
+C UltraSPARC T3: 15
+C UltraSPARC T4: 2.5
+
+C INPUT PARAMETERS
+define(`up', `%o0')
+define(`n', `%o1')
+define(`pcnt', `%o5')
+
+ASM_START()
+ REGISTER(%g2,#scratch)
+ REGISTER(%g3,#scratch)
+PROLOGUE(mpn_popcount)
+ subcc n, 1, n
+ be L(final_one)
+ clr pcnt
+L(top):
+ ldx [up + 0], %g1
+ sub n, 2, n
+ ldx [up + 8], %o4
+ add up, 16, up
+ popc %g1, %g2
+ popc %o4, %g3
+ add pcnt, %g2, pcnt
+ brgz n, L(top)
+ add pcnt, %g3, pcnt
+ brlz,pt n, L(done)
+ nop
+L(final_one):
+ ldx [up + 0], %g1
+ popc %g1, %g2
+ add pcnt, %g2, pcnt
+L(done):
+ retl
+ mov pcnt, %o0
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/ultrasparct3/sqr_diag_addlsh1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/ultrasparct3/sqr_diag_addlsh1.asm
new file mode 100644
index 00000000000..216ddc0ba1e
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/ultrasparct3/sqr_diag_addlsh1.asm
@@ -0,0 +1,93 @@
+dnl SPARC v9 mpn_sqr_dial_addlsh1 for T3/T4/T5.
+
+dnl Contributed to the GNU project by Torbjörn Granlund.
+
+dnl Copyright 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/limb
+C UltraSPARC T3: ?
+C UltraSPARC T4: >= 4.5
+
+
+define(`rp', `%i0')
+define(`tp', `%i1')
+define(`up', `%i2')
+define(`n', `%i3')
+
+ASM_START()
+ REGISTER(%g2,#scratch)
+ REGISTER(%g3,#scratch)
+PROLOGUE(mpn_sqr_diag_addlsh1)
+ save %sp, -176, %sp
+
+ ldx [up+0], %g1
+ mulx %g1, %g1, %o0
+ umulxhi(%g1, %g1, %g2)
+ stx %o0, [rp+0]
+
+ ldx [up+8], %g1
+ ldx [tp+0], %g4
+ ldx [tp+8], %g5
+ mulx %g1, %g1, %o0
+ orcc %g0, %g0, %o5
+ b L(dm)
+ add n, -2, n
+
+ ALIGN(16)
+L(top): ldx [up+8], %g1
+ addcc %g4, %o2, %o2
+ addxccc(%g5, %o0, %g3)
+ ldx [tp+16], %g4
+ ldx [tp+24], %g5
+ mulx %g1, %g1, %o0
+ stx %o2, [rp+8]
+ stx %g3, [rp+16]
+ add rp, 16, rp
+ add tp, 16, tp
+L(dm): add %g2, %o5, %o2
+ umulxhi(%g1, %g1, %g2)
+ addxccc(%g4, %g4, %g4)
+ addxccc(%g5, %g5, %g5)
+ add up, 8, up
+ addxc( %g0, %g0, %o5)
+ brnz n, L(top)
+ add n, -1, n
+
+ addcc %o2, %g4, %g4
+ addxccc(%o0, %g5, %g5)
+ stx %g4, [rp+8]
+ stx %g5, [rp+16]
+ addxc( %o5, %g2, %g2)
+ stx %g2, [rp+24]
+
+ ret
+ restore
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/ultrasparct3/sub_n.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/ultrasparct3/sub_n.asm
new file mode 100644
index 00000000000..0e4bc939e30
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/ultrasparct3/sub_n.asm
@@ -0,0 +1,144 @@
+dnl SPARC v9 mpn_sub_n for T3/T4.
+
+dnl Contributed to the GNU project by David Miller.
+
+dnl Copyright 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/limb
+C UltraSPARC T3: 8
+C UltraSPARC T4: 3
+
+C INPUT PARAMETERS
+define(`rp', `%i0')
+define(`up', `%i1')
+define(`vp', `%i2')
+define(`n', `%i3')
+define(`cy', `%i4')
+
+define(`u0_off', `%l0')
+define(`u1_off', `%l1')
+define(`v0_off', `%l2')
+define(`v1_off', `%l3')
+define(`r0_off', `%l4')
+define(`r1_off', `%l5')
+define(`loop_n', `%l6')
+define(`tmp', `%l7')
+
+ASM_START()
+ REGISTER(%g2,#scratch)
+ REGISTER(%g3,#scratch)
+PROLOGUE(mpn_sub_nc)
+ save %sp, -176, %sp
+ ba,pt %xcc, L(ent)
+ xor cy, 1, cy
+EPILOGUE()
+PROLOGUE(mpn_sub_n)
+ save %sp, -176, %sp
+ mov 1, cy
+L(ent):
+ subcc n, 1, n
+ be L(final_one)
+ cmp %g0, cy
+
+ ldx [up + 0], %o4
+ sllx n, 3, tmp
+
+ ldx [vp + 0], %o5
+ add up, tmp, u0_off
+
+ ldx [up + 8], %g5
+ add vp, tmp, v0_off
+
+ ldx [vp + 8], %g1
+ add rp, tmp, r0_off
+
+ neg tmp, loop_n
+ add u0_off, 8, u1_off
+
+ add v0_off, 8, v1_off
+ sub loop_n, -(2 * 8), loop_n
+
+ sub r0_off, 16, r0_off
+ brgez,pn loop_n, L(loop_tail)
+ sub r0_off, 8, r1_off
+
+ b,a L(top)
+ ALIGN(16)
+L(top):
+ xnor %o5, 0, tmp
+ ldx [loop_n + v0_off], %o5
+
+ addxccc(%o4, tmp, %g3)
+ ldx [loop_n + u0_off], %o4
+
+ xnor %g1, 0, %g1
+ stx %g3, [loop_n + r0_off]
+
+ addxccc(%g5, %g1, tmp)
+ ldx [loop_n + v1_off], %g1
+
+ ldx [loop_n + u1_off], %g5
+ sub loop_n, -(2 * 8), loop_n
+
+ brlz loop_n, L(top)
+ stx tmp, [loop_n + r1_off]
+
+L(loop_tail):
+ xnor %o5, 0, tmp
+ xnor %g1, 0, %g1
+
+ addxccc(%o4, tmp, %g3)
+ add loop_n, u0_off, up
+
+ addxccc(%g5, %g1, %g5)
+ add loop_n, r0_off, rp
+
+ stx %g3, [rp + 0]
+ add loop_n, v0_off, vp
+
+ brgz,pt loop_n, L(done)
+ stx %g5, [rp + 8]
+
+ add rp, (2 * 8), rp
+
+L(final_one):
+ ldx [up+0], %o4
+ ldx [vp+0], %o5
+ xnor %o5, %g0, %o5
+ addxccc(%o4, %o5, %g3)
+ stx %g3, [rp+0]
+
+L(done):
+ clr %i0
+ movcc %xcc, 1, %i0
+ ret
+ restore
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/ultrasparct3/submul_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/ultrasparct3/submul_1.asm
new file mode 100644
index 00000000000..5635d1bdbd8
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/sparc64/ultrasparct3/submul_1.asm
@@ -0,0 +1,170 @@
+dnl SPARC v9 mpn_submul_1 for T3/T4/T5.
+
+dnl Contributed to the GNU project by David Miller and Torbjörn Granlund.
+
+dnl Copyright 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/limb
+C UltraSPARC T3: 26
+C UltraSPARC T4: 4.5
+
+C INPUT PARAMETERS
+define(`rp', `%i0')
+define(`up', `%i1')
+define(`n', `%i2')
+define(`v0', `%i3')
+
+ASM_START()
+ REGISTER(%g2,#scratch)
+ REGISTER(%g3,#scratch)
+PROLOGUE(mpn_submul_1)
+ save %sp, -176, %sp
+ ldx [up+0], %g1
+
+ and n, 3, %g5
+ add n, -4, n
+ brz %g5, L(b00)
+ cmp %g5, 2
+ bcs %xcc, L(b01)
+ nop
+ bne %xcc, L(b11)
+ ldx [up+8], %g4
+
+L(b10): add up, 16, up
+ addcc %g0, 0, %g3
+ mulx %g1, v0, %l4
+ umulxhi(%g1, v0, %l5)
+ ldx [rp+0], %o2
+ mulx %g4, v0, %l6
+ umulxhi(%g4, v0, %l7)
+ brlz n, L(wd2)
+ nop
+L(gt2): ldx [up+0], %o0
+ b L(lo2)
+ nop
+
+L(b00): add rp, -16, rp
+ addcc %g0, 0, %g3
+ ldx [up+8], %o1
+ mulx %g1, v0, %l0
+ umulxhi(%g1, v0, %l1)
+ ldx [up+16], %o0
+ ldx [rp+16], %o2
+ mulx %o1, v0, %l2
+ umulxhi(%o1, v0, %l3)
+ b L(lo0)
+ nop
+
+L(b01): add up, 8, up
+ add rp, -8, rp
+ addcc %g0, 0, %g3
+ ldx [rp+8], %o3
+ mulx %g1, v0, %l6
+ umulxhi(%g1, v0, %l7)
+ brlz n, L(wd1)
+ nop
+ ldx [up+0], %o0
+ ldx [up+8], %o1
+ mulx %o0, v0, %l0
+ umulxhi(%o0, v0, %l1)
+ b L(lo1)
+ nop
+
+L(b11): add up, 24, up
+ add rp, 8, rp
+ addcc %g0, 0, %g3
+ mulx %g1, v0, %l2
+ umulxhi(%g1, v0, %l3)
+ ldx [up-8], %o1
+ ldx [rp-8], %o3
+ mulx %g4, v0, %l4
+ umulxhi(%g4, v0, %l5)
+ brlz n, L(end)
+ nop
+
+ ALIGN(16)
+L(top): ldx [up+0], %o0
+ addxccc(%g3, %l2, %g1)
+ ldx [rp+0], %o2
+ addxc( %g0, %l3, %g3)
+ mulx %o1, v0, %l6
+ subcc %o3, %g1, %g4
+ umulxhi(%o1, v0, %l7)
+ stx %g4, [rp-8]
+L(lo2): ldx [up+8], %o1
+ addxccc(%g3, %l4, %g1)
+ ldx [rp+8], %o3
+ addxc( %g0, %l5, %g3)
+ mulx %o0, v0, %l0
+ subcc %o2, %g1, %g4
+ umulxhi(%o0, v0, %l1)
+ stx %g4, [rp+0]
+L(lo1): ldx [up+16], %o0
+ addxccc(%g3, %l6, %g1)
+ ldx [rp+16], %o2
+ addxc( %g0, %l7, %g3)
+ mulx %o1, v0, %l2
+ subcc %o3, %g1, %g4
+ umulxhi(%o1, v0, %l3)
+ stx %g4, [rp+8]
+L(lo0): ldx [up+24], %o1
+ addxccc(%g3, %l0, %g1)
+ ldx [rp+24], %o3
+ addxc( %g0, %l1, %g3)
+ mulx %o0, v0, %l4
+ subcc %o2, %g1, %g4
+ umulxhi(%o0, v0, %l5)
+ stx %g4, [rp+16]
+ add n, -4, n
+ add up, 32, up
+ brgez n, L(top)
+ add rp, 32, rp
+
+L(end): addxccc(%g3, %l2, %g1)
+ ldx [rp+0], %o2
+ addxc( %g0, %l3, %g3)
+ mulx %o1, v0, %l6
+ subcc %o3, %g1, %g4
+ umulxhi(%o1, v0, %l7)
+ stx %g4, [rp-8]
+L(wd2): addxccc(%g3, %l4, %g1)
+ ldx [rp+8], %o3
+ addxc( %g0, %l5, %g3)
+ subcc %o2, %g1, %g4
+ stx %g4, [rp+0]
+L(wd1): addxccc(%g3, %l6, %g1)
+ addxc( %g0, %l7, %g3)
+ subcc %o3, %g1, %g4
+ stx %g4, [rp+8]
+ addxc( %g0, %g3, %i0)
+ ret
+ restore
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/thumb/add_n.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/thumb/add_n.asm
new file mode 100644
index 00000000000..08ed60b9be0
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/thumb/add_n.asm
@@ -0,0 +1,63 @@
+dnl ARM/Thumb mpn_add_n.
+
+dnl Copyright 1997, 2000, 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 INPUT PARAMETERS
+define(`rp', r0)
+define(`up', r1)
+define(`vp', r2)
+define(`n', r3)
+
+ASM_START()
+ .thumb
+PROLOGUE(mpn_add_nc)
+ push {r4, r5, r6}
+ ldr r6, [sp, #12] C init carry save register
+ sub r6, #1
+ b L(top)
+EPILOGUE()
+PROLOGUE(mpn_add_n)
+ push {r4, r5, r6}
+ neg r6, n C init carry save register
+
+L(top): ldmia up!, {r4} C load next limb from S1
+ cmp n, r6 C tricky carry restore
+ ldmia vp!, {r5} C load next limb from S2
+ adc r4, r5
+ stmia rp!, {r4} C store result limb to RES
+ sbc r6, r6 C save negated carry
+ sub n, #1
+ bne L(top)
+
+ add r0, r6, #1
+ pop {r4, r5, r6}
+ bx lr
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/thumb/sub_n.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/thumb/sub_n.asm
new file mode 100644
index 00000000000..a38572048ee
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/thumb/sub_n.asm
@@ -0,0 +1,63 @@
+dnl ARM/Thumb mpn_sub_n.
+
+dnl Copyright 1997, 2000, 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 INPUT PARAMETERS
+define(`rp', r0)
+define(`up', r1)
+define(`vp', r2)
+define(`n', r3)
+
+ASM_START()
+ .thumb
+PROLOGUE(mpn_sub_nc)
+ push {r4, r5, r6}
+ ldr r6, [sp, #12] C init carry save register
+ neg r6, r6
+ b L(top)
+EPILOGUE()
+PROLOGUE(mpn_sub_n)
+ push {r4, r5, r6}
+ mov r6, n C init carry save register
+
+L(top): ldmia up!, {r4} C load next limb from S1
+ cmp n, r6 C tricky carry restore
+ ldmia vp!, {r5} C load next limb from S2
+ sbc r4, r5
+ stmia rp!, {r4} C store result limb to RES
+ sbc r6, r6 C save negated carry
+ sub n, #1
+ bne L(top)
+
+ neg r0, r6
+ pop {r4, r5, r6}
+ bx lr
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/vax/add_n.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/vax/add_n.asm
new file mode 100644
index 00000000000..0a0bf78ab34
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/vax/add_n.asm
@@ -0,0 +1,64 @@
+dnl VAX mpn_add_n -- Add two limb vectors of the same length > 0 and store sum
+dnl in a third limb vector.
+
+dnl Copyright 1999, 2000, 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')
+
+ASM_START()
+PROLOGUE(mpn_add_n)
+ .word 0x0
+ movl 16(ap), r0
+ movl 12(ap), r1
+ movl 8(ap), r2
+ movl 4(ap), r3
+ mnegl r0, r5
+ addl2 $3, r0
+ ashl $-2, r0, r0 C unroll loop count
+ bicl2 $-4, r5 C mask out low 2 bits
+ movaq (r5)[r5], r5 C 9x
+ jmp L(top)[r5]
+
+L(top): movl (r2)+, r4
+ adwc (r1)+, r4
+ movl r4, (r3)+
+ movl (r2)+, r4
+ adwc (r1)+, r4
+ movl r4, (r3)+
+ movl (r2)+, r4
+ adwc (r1)+, r4
+ movl r4, (r3)+
+ movl (r2)+, r4
+ adwc (r1)+, r4
+ movl r4, (r3)+
+ sobgtr r0, L(top)
+
+ adwc r0, r0
+ ret
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/vax/addmul_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/vax/addmul_1.asm
new file mode 100644
index 00000000000..8a6f636bdf0
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/vax/addmul_1.asm
@@ -0,0 +1,124 @@
+dnl VAX mpn_addmul_1 -- Multiply a limb vector with a limb and add the result
+dnl to a second limb vector.
+
+dnl Copyright 1992, 1994, 1996, 2000, 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')
+
+ASM_START()
+PROLOGUE(mpn_addmul_1)
+ .word 0xfc0
+ movl 12(ap), r4
+ movl 8(ap), r8
+ movl 4(ap), r9
+ clrl r3
+ incl r4
+ ashl $-1, r4, r7
+ clrl r11
+ movl 16(ap), r6
+ jlss L(v0_big)
+ jlbc r4, L(1)
+
+C Loop for v0 < 0x80000000
+L(tp1): movl (r8)+, r1
+ jlss L(1n0)
+ emul r1, r6, $0, r2
+ addl2 r11, r2
+ adwc $0, r3
+ addl2 r2, (r9)+
+ adwc $0, r3
+L(1): movl (r8)+, r1
+ jlss L(1n1)
+L(1p1): emul r1, r6, $0, r10
+ addl2 r3, r10
+ adwc $0, r11
+ addl2 r10, (r9)+
+ adwc $0, r11
+
+ sobgtr r7, L(tp1)
+ movl r11, r0
+ ret
+
+L(1n0): emul r1, r6, $0, r2
+ addl2 r11, r2
+ adwc r6, r3
+ addl2 r2, (r9)+
+ adwc $0, r3
+ movl (r8)+, r1
+ jgeq L(1p1)
+L(1n1): emul r1, r6, $0, r10
+ addl2 r3, r10
+ adwc r6, r11
+ addl2 r10, (r9)+
+ adwc $0, r11
+
+ sobgtr r7, L(tp1)
+ movl r11, r0
+ ret
+
+L(v0_big):
+ jlbc r4, L(2)
+
+C Loop for v0 >= 0x80000000
+L(tp2): movl (r8)+, r1
+ jlss L(2n0)
+ emul r1, r6, $0, r2
+ addl2 r11, r2
+ adwc r1, r3
+ addl2 r2, (r9)+
+ adwc $0, r3
+L(2): movl (r8)+, r1
+ jlss L(2n1)
+L(2p1): emul r1, r6, $0, r10
+ addl2 r3, r10
+ adwc r1, r11
+ addl2 r10, (r9)+
+ adwc $0, r11
+
+ sobgtr r7, L(tp2)
+ movl r11, r0
+ ret
+
+L(2n0): emul r1, r6, $0, r2
+ addl2 r11, r2
+ adwc r6, r3
+ addl2 r2, (r9)+
+ adwc r1, r3
+ movl (r8)+, r1
+ jgeq L(2p1)
+L(2n1): emul r1, r6, $0, r10
+ addl2 r3, r10
+ adwc r6, r11
+ addl2 r10, (r9)+
+ adwc r1, r11
+
+ sobgtr r7, L(tp2)
+ movl r11, r0
+ ret
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/vax/elf.m4 b/Build/source/libs/gmp/gmp-6.0.0/mpn/vax/elf.m4
new file mode 100644
index 00000000000..e04f0bafc9f
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/vax/elf.m4
@@ -0,0 +1,54 @@
+divert(-1)
+
+dnl m4 macros for VAX assembler.
+
+dnl Copyright 2001, 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/.
+
+
+defreg(r0,`%r``''0')
+defreg(r1,`%r``''1')
+defreg(r2,`%r``''2')
+defreg(r3,`%r``''3')
+defreg(r4,`%r``''4')
+defreg(r5,`%r``''5')
+defreg(r6,`%r``''6')
+defreg(r7,`%r``''7')
+defreg(r8,`%r``''8')
+defreg(r9,`%r``''9')
+defreg(r10,`%r``''10')
+defreg(r11,`%r``''11')
+defreg(r12,`%r``''12')
+defreg(r13,`%r``''13')
+defreg(r14,`%r``''14')
+defreg(r15,`%r``''15')
+defreg(ap,`%a``''p')
+
+define(`foo', blablabla)
+
+divert
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/vax/gmp-mparam.h b/Build/source/libs/gmp/gmp-6.0.0/mpn/vax/gmp-mparam.h
new file mode 100644
index 00000000000..9f20b9b783e
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/vax/gmp-mparam.h
@@ -0,0 +1,60 @@
+/* VAX gmp-mparam.h -- Compiler/machine parameter header file.
+
+Copyright 2000-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/. */
+
+/* These numbers were measured manually using the tune/speed program.
+ The standard tune/tuneup takes too long. (VAX 8800) */
+
+#define MUL_TOOM22_THRESHOLD 14
+#define MUL_TOOM33_THRESHOLD 110
+
+#define SQR_BASECASE_THRESHOLD 6
+#define SQR_TOOM2_THRESHOLD 42
+#define SQR_TOOM3_THRESHOLD 250
+
+/* #define DIV_SB_PREINV_THRESHOLD */
+/* #define DIV_DC_THRESHOLD */
+/* #define POWM_THRESHOLD */
+
+/* #define GCD_ACCEL_THRESHOLD */
+/* #define JACOBI_BASE_METHOD */
+
+/* #define DIVREM_1_NORM_THRESHOLD */
+/* #define DIVREM_1_UNNORM_THRESHOLD */
+/* #define MOD_1_NORM_THRESHOLD */
+/* #define MOD_1_UNNORM_THRESHOLD */
+/* #define USE_PREINV_DIVREM_1 */
+/* #define USE_PREINV_MOD_1 */
+/* #define DIVREM_2_THRESHOLD */
+/* #define DIVEXACT_1_THRESHOLD */
+/* #define MODEXACT_1_ODD_THRESHOLD */
+
+/* #define GET_STR_DC_THRESHOLD */
+/* #define GET_STR_PRECOMPUTE_THRESHOLD */
+#define SET_STR_THRESHOLD 3400
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/vax/lshift.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/vax/lshift.asm
new file mode 100644
index 00000000000..941e9994b87
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/vax/lshift.asm
@@ -0,0 +1,59 @@
+dnl VAX mpn_lshift -- left shift.
+
+dnl Copyright 1999-2001, 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')
+
+ASM_START()
+PROLOGUE(mpn_lshift)
+ .word 0x1c0
+ movl 4(ap), r7
+ movl 8(ap), r6
+ movl 12(ap), r1
+ movl 16(ap), r8
+
+ moval (r6)[r1], r6
+ moval (r7)[r1], r7
+ clrl r3
+ movl -(r6), r2
+ ashq r8, r2, r4
+ movl r5, r0
+ movl r2, r3
+ decl r1
+ jeql L(end)
+
+L(top): movl -(r6), r2
+ ashq r8, r2, r4
+ movl r5, -(r7)
+ movl r2, r3
+ sobgtr r1, L(top)
+
+L(end): movl r4, -4(r7)
+ ret
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/vax/mul_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/vax/mul_1.asm
new file mode 100644
index 00000000000..8e4dcd21775
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/vax/mul_1.asm
@@ -0,0 +1,118 @@
+dnl VAX mpn_mul_1 -- Multiply a limb vector with a limb and store the result
+dnl in a second limb vector.
+
+dnl Copyright 1992, 1994, 1996, 2000, 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')
+
+ASM_START()
+PROLOGUE(mpn_mul_1)
+ .word 0xfc0
+ movl 12(ap), r4
+ movl 8(ap), r8
+ movl 4(ap), r9
+ clrl r3
+ incl r4
+ ashl $-1, r4, r7
+ clrl r11
+ movl 16(ap), r6
+ jlss L(v0_big)
+ jlbc r4, L(1)
+
+C Loop for v0 < 0x80000000
+L(tp1): movl (r8)+, r1
+ jlss L(1n0)
+ emul r1, r6, $0, r2
+ addl2 r11, r2
+ adwc $0, r3
+ movl r2, (r9)+
+L(1): movl (r8)+, r1
+ jlss L(1n1)
+L(1p1): emul r1, r6, $0, r10
+ addl2 r3, r10
+ adwc $0, r11
+ movl r10, (r9)+
+
+ sobgtr r7, L(tp1)
+ movl r11, r0
+ ret
+
+L(1n0): emul r1, r6, $0, r2
+ addl2 r11, r2
+ adwc r6, r3
+ movl r2, (r9)+
+ movl (r8)+, r1
+ jgeq L(1p1)
+L(1n1): emul r1, r6, $0, r10
+ addl2 r3, r10
+ adwc r6, r11
+ movl r10, (r9)+
+
+ sobgtr r7, L(tp1)
+ movl r11, r0
+ ret
+
+L(v0_big):
+ jlbc r4, L(2)
+
+C Loop for v0 >= 0x80000000
+L(tp2): movl (r8)+, r1
+ jlss L(2n0)
+ emul r1, r6, $0, r2
+ addl2 r11, r2
+ adwc r1, r3
+ movl r2, (r9)+
+L(2): movl (r8)+, r1
+ jlss L(2n1)
+L(2p1): emul r1, r6, $0, r10
+ addl2 r3, r10
+ adwc r1, r11
+ movl r10, (r9)+
+
+ sobgtr r7, L(tp2)
+ movl r11, r0
+ ret
+
+L(2n0): emul r1, r6, $0, r2
+ addl2 r1, r3
+ addl2 r11, r2
+ adwc r6, r3
+ movl r2, (r9)+
+ movl (r8)+, r1
+ jgeq L(2p1)
+L(2n1): emul r1, r6, $0, r10
+ addl2 r1, r11
+ addl2 r3, r10
+ adwc r6, r11
+ movl r10, (r9)+
+
+ sobgtr r7, L(tp2)
+ movl r11, r0
+ ret
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/vax/rshift.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/vax/rshift.asm
new file mode 100644
index 00000000000..00b2daac01e
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/vax/rshift.asm
@@ -0,0 +1,57 @@
+dnl VAX mpn_rshift -- right shift.
+
+dnl Copyright 1999-2001, 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')
+
+ASM_START()
+PROLOGUE(mpn_rshift)
+ .word 0x1c0
+ movl 4(ap), r7
+ movl 8(ap), r6
+ movl 12(ap), r1
+ movl 16(ap), r8
+
+ movl (r6)+, r2
+ subl3 r8, $32, r8
+ ashl r8, r2, r0
+ decl r1
+ jeql L(end)
+
+L(top): movl (r6)+, r3
+ ashq r8, r2, r4
+ movl r5, (r7)+
+ movl r3, r2
+ sobgtr r1, L(top)
+
+L(end): clrl r3
+ ashq r8, r2, r4
+ movl r5, (r7)
+ ret
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/vax/sub_n.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/vax/sub_n.asm
new file mode 100644
index 00000000000..2844ef2cc1c
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/vax/sub_n.asm
@@ -0,0 +1,64 @@
+dnl VAX mpn_sub_n -- Subtract two limb vectors of the same length > 0 and
+dnl store difference in a third limb vector.
+
+dnl Copyright 1999, 2000, 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')
+
+ASM_START()
+PROLOGUE(mpn_sub_n)
+ .word 0x0
+ movl 16(ap), r0
+ movl 12(ap), r1
+ movl 8(ap), r2
+ movl 4(ap), r3
+ mnegl r0, r5
+ addl2 $3, r0
+ ashl $-2, r0, r0 C unroll loop count
+ bicl2 $-4, r5 C mask out low 2 bits
+ movaq (r5)[r5], r5 C 9x
+ jmp L(top)[r5]
+
+L(top): movl (r2)+, r4
+ sbwc (r1)+, r4
+ movl r4, (r3)+
+ movl (r2)+, r4
+ sbwc (r1)+, r4
+ movl r4, (r3)+
+ movl (r2)+, r4
+ sbwc (r1)+, r4
+ movl r4, (r3)+
+ movl (r2)+, r4
+ sbwc (r1)+, r4
+ movl r4, (r3)+
+ sobgtr r0, L(top)
+
+ adwc r0, r0
+ ret
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/vax/submul_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/vax/submul_1.asm
new file mode 100644
index 00000000000..60d47fcd6f7
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/vax/submul_1.asm
@@ -0,0 +1,124 @@
+dnl VAX mpn_submul_1 -- Multiply a limb vector with a limb and subtract the
+dnl result from a second limb vector.
+
+dnl Copyright 1992, 1994, 1996, 2000, 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')
+
+ASM_START()
+PROLOGUE(mpn_submul_1)
+ .word 0xfc0
+ movl 12(ap), r4
+ movl 8(ap), r8
+ movl 4(ap), r9
+ clrl r3
+ incl r4
+ ashl $-1, r4, r7
+ clrl r11
+ movl 16(ap), r6
+ jlss L(v0_big)
+ jlbc r4, L(1)
+
+C Loop for v0 < 0x80000000
+L(tp1): movl (r8)+, r1
+ jlss L(1n0)
+ emul r1, r6, $0, r2
+ addl2 r11, r2
+ adwc $0, r3
+ subl2 r2, (r9)+
+ adwc $0, r3
+L(1): movl (r8)+, r1
+ jlss L(1n1)
+L(1p1): emul r1, r6, $0, r10
+ addl2 r3, r10
+ adwc $0, r11
+ subl2 r10, (r9)+
+ adwc $0, r11
+
+ sobgtr r7, L(tp1)
+ movl r11, r0
+ ret
+
+L(1n0): emul r1, r6, $0, r2
+ addl2 r11, r2
+ adwc r6, r3
+ subl2 r2, (r9)+
+ adwc $0, r3
+ movl (r8)+, r1
+ jgeq L(1p1)
+L(1n1): emul r1, r6, $0, r10
+ addl2 r3, r10
+ adwc r6, r11
+ subl2 r10, (r9)+
+ adwc $0, r11
+
+ sobgtr r7, L(tp1)
+ movl r11, r0
+ ret
+
+L(v0_big):
+ jlbc r4, L(2)
+
+C Loop for v0 >= 0x80000000
+L(tp2): movl (r8)+, r1
+ jlss L(2n0)
+ emul r1, r6, $0, r2
+ addl2 r11, r2
+ adwc r1, r3
+ subl2 r2, (r9)+
+ adwc $0, r3
+L(2): movl (r8)+, r1
+ jlss L(2n1)
+L(2p1): emul r1, r6, $0, r10
+ addl2 r3, r10
+ adwc r1, r11
+ subl2 r10, (r9)+
+ adwc $0, r11
+
+ sobgtr r7, L(tp2)
+ movl r11, r0
+ ret
+
+L(2n0): emul r1, r6, $0, r2
+ addl2 r11, r2
+ adwc r6, r3
+ subl2 r2, (r9)+
+ adwc r1, r3
+ movl (r8)+, r1
+ jgeq L(2p1)
+L(2n1): emul r1, r6, $0, r10
+ addl2 r3, r10
+ adwc r6, r11
+ subl2 r10, (r9)+
+ adwc r1, r11
+
+ sobgtr r7, L(tp2)
+ movl r11, r0
+ ret
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/README b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/README
new file mode 100644
index 00000000000..8d7ac9080dd
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/README
@@ -0,0 +1,525 @@
+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/.
+
+
+
+
+
+ X86 MPN SUBROUTINES
+
+
+This directory contains mpn functions for various 80x86 chips.
+
+
+CODE ORGANIZATION
+
+ x86 i386, generic
+ x86/i486 i486
+ x86/pentium Intel Pentium (P5, P54)
+ x86/pentium/mmx Intel Pentium with MMX (P55)
+ x86/p6 Intel Pentium Pro
+ x86/p6/mmx Intel Pentium II, III
+ x86/p6/p3mmx Intel Pentium III
+ x86/k6 \ AMD K6
+ x86/k6/mmx /
+ x86/k6/k62mmx AMD K6-2
+ x86/k7 \ AMD Athlon
+ x86/k7/mmx /
+ x86/pentium4 \
+ x86/pentium4/mmx | Intel Pentium 4
+ x86/pentium4/sse2 /
+
+
+The top-level x86 directory contains blended style code, meant to be
+reasonable on all x86s.
+
+
+
+STATUS
+
+The code is well-optimized for AMD and Intel chips, but there's nothing
+specific for Cyrix chips, nor for actual 80386 and 80486 chips.
+
+
+
+ASM FILES
+
+The x86 .asm files are BSD style assembler code, first put through m4 for
+macro processing. The generic mpn/asm-defs.m4 is used, together with
+mpn/x86/x86-defs.m4. See comments in those files.
+
+The code is meant for use with GNU "gas" or a system "as". There's no
+support for assemblers that demand Intel style code.
+
+
+
+STACK FRAME
+
+m4 macros are used to define the parameters passed on the stack, and these
+act like comments on what the stack frame looks like too. For example,
+mpn_mul_1() has the following.
+
+ defframe(PARAM_MULTIPLIER, 16)
+ defframe(PARAM_SIZE, 12)
+ defframe(PARAM_SRC, 8)
+ defframe(PARAM_DST, 4)
+
+PARAM_MULTIPLIER becomes `FRAME+16(%esp)', and the others similarly. The
+return address is at offset 0, but there's not normally any need to access
+that.
+
+FRAME is redefined as necessary through the code so it's the number of bytes
+pushed on the stack, and hence the offsets in the parameter macros stay
+correct. At the start of a routine FRAME should be zero.
+
+ deflit(`FRAME',0)
+ ...
+ deflit(`FRAME',4)
+ ...
+ deflit(`FRAME',8)
+ ...
+
+Helper macros FRAME_pushl(), FRAME_popl(), FRAME_addl_esp() and
+FRAME_subl_esp() exist to adjust FRAME for the effect of those instructions,
+and can be used instead of explicit definitions if preferred.
+defframe_pushl() is a combination FRAME_pushl() and defframe().
+
+There's generally some slackness in redefining FRAME. If new values aren't
+going to get used then the redefinitions are omitted to keep from cluttering
+up the code. This happens for instance at the end of a routine, where there
+might be just four pops and then a ret, so FRAME isn't getting used.
+
+Local variables and saved registers can be similarly defined, with negative
+offsets representing stack space below the initial stack pointer. For
+example,
+
+ defframe(SAVE_ESI, -4)
+ defframe(SAVE_EDI, -8)
+ defframe(VAR_COUNTER,-12)
+
+ deflit(STACK_SPACE, 12)
+
+Here STACK_SPACE gets used in a "subl $STACK_SPACE, %esp" to allocate the
+space, and that instruction must be followed by a redefinition of FRAME
+(setting it equal to STACK_SPACE) to reflect the change in %esp.
+
+Definitions for pushed registers are only put in when they're going to be
+used. If registers are just saved and restored with pushes and pops then
+definitions aren't made.
+
+
+
+ASSEMBLER EXPRESSIONS
+
+Only addition and subtraction seem to be universally available, certainly
+that's all the Solaris 8 "as" seems to accept. If expressions are wanted
+then m4 eval() should be used.
+
+In particular note that a "/" anywhere in a line starts a comment in Solaris
+"as", and in some configurations of gas too.
+
+ addl $32/2, %eax <-- wrong
+
+ addl $eval(32/2), %eax <-- right
+
+Binutils gas/config/tc-i386.c has a choice between "/" being a comment
+anywhere in a line, or only at the start. FreeBSD patches 2.9.1 to select
+the latter, and from 2.9.5 it's the default for GNU/Linux too.
+
+
+
+ASSEMBLER COMMENTS
+
+Solaris "as" doesn't support "#" commenting, using /* */ instead. For that
+reason "C" commenting is used (see asm-defs.m4) and the intermediate ".s"
+files have no comments.
+
+Any comments before include(`../config.m4') must use m4 "dnl", since it's
+only after the include that "C" is available. By convention "dnl" is also
+used for comments about m4 macros.
+
+
+
+TEMPORARY LABELS
+
+Temporary numbered labels like "1:" used as "1f" or "1b" are available in
+"gas" and Solaris "as", but not in SCO "as". Normal L() labels should be
+used instead, possibly with a counter to make them unique, see jadcl0() in
+x86-defs.m4 for instance. A separate counter for each macro makes it
+possible to nest them, for instance movl_text_address() can be used within
+an ASSERT().
+
+"1:" etc must be avoided in gcc __asm__ blocks too. "%=" for generating a
+unique number looks like a good alternative, but is that actually a
+documented feature? In any case this problem doesn't currently arise.
+
+
+
+ZERO DISPLACEMENTS
+
+In a couple of places addressing modes like 0(%ebx) with a byte-sized zero
+displacement are wanted, rather than (%ebx) with no displacement. These are
+either for computed jumps or to get desirable code alignment. Explicit
+.byte sequences are used to ensure the assembler doesn't turn 0(%ebx) into
+(%ebx). The Zdisp() macro in x86-defs.m4 is used for this.
+
+Current gas 2.9.5 or recent 2.9.1 leave 0(%ebx) as written, but old gas
+1.92.3 changes it. In general changing would be the sort of "optimization"
+an assembler might perform, hence explicit ".byte"s are used where
+necessary.
+
+
+
+SHLD/SHRD INSTRUCTIONS
+
+The %cl count forms of double shift instructions like "shldl %cl,%eax,%ebx"
+must be written "shldl %eax,%ebx" for some assemblers. gas takes either,
+Solaris "as" doesn't allow %cl, gcc generates %cl for gas and NeXT (which is
+gas), and omits %cl elsewhere.
+
+For GMP an autoconf test GMP_ASM_X86_SHLDL_CL is used to determine whether
+%cl should be used, and the macros shldl, shrdl, shldw and shrdw in
+mpn/x86/x86-defs.m4 pass through or omit %cl as necessary. See the comments
+with those macros for usage.
+
+
+
+IMUL INSTRUCTION
+
+GCC config/i386/i386.md (cvs rev 1.187, 21 Oct 00) under *mulsi3_1 notes
+that the following two forms produce identical object code
+
+ imul $12, %eax
+ imul $12, %eax, %eax
+
+but that the former isn't accepted by some assemblers, in particular the SCO
+OSR5 COFF assembler. GMP follows GCC and uses only the latter form.
+
+(This applies only to immediate operands, the three operand form is only
+valid with an immediate.)
+
+
+
+DIRECTION FLAG
+
+The x86 calling conventions say that the direction flag should be clear at
+function entry and exit. (See iBCS2 and SVR4 ABI books, references below.)
+Although this has been so since the year dot, it's not absolutely clear
+whether it's universally respected. Since it's better to be safe than
+sorry, GMP follows glibc and does a "cld" if it depends on the direction
+flag being clear. This happens only in a few places.
+
+
+
+POSITION INDEPENDENT CODE
+
+ Coding Style
+
+ Defining the symbol PIC in m4 processing selects SVR4 / ELF style
+ position independent code. This is necessary for shared libraries
+ because they can be mapped into different processes at different virtual
+ addresses. Actually, relocations are allowed but text pages with
+ relocations aren't shared, defeating the purpose of a shared library.
+
+ The GOT is used to access global data, and the PLT is used for
+ functions. The use of the PLT adds a fixed cost to every function call,
+ and the GOT adds a cost to any function accessing global variables.
+ These are small but might be noticeable when working with small
+ operands.
+
+ Scope
+
+ It's intended, as a matter of policy, that references within libgmp are
+ resolved within libgmp. Certainly there's no need for an application to
+ replace any internals, and we take the view that there's no value in an
+ application subverting anything documented either.
+
+ Resolving references within libgmp in theory means calls can be made with a
+ plain PC-relative call instruction, which is faster and smaller than going
+ through the PLT, and data references can be similarly PC-relative, saving a
+ GOT entry and fetch from there. Unfortunately the normal linker behaviour
+ doesn't allow us to do this.
+
+ By default an R_386_PC32 PC-relative reference, either for a call or for
+ data, is left in libgmp.so by the linker so that it can be resolved at
+ runtime to a location in the application or another shared library. This
+ means a text segment relocation which we don't want.
+
+ -Bsymbolic
+
+ Under the "-Bsymbolic" option, the linker resolves references to symbols
+ within libgmp.so. This gives us the desired effect for R_386_PC32,
+ ie. it's resolved at link time. It also resolves R_386_PLT32 calls
+ directly to their target without creating a PLT entry (though if this is
+ done to normal compiler-generated code it still leaves a setup of %ebx
+ to _GLOBAL_OFFSET_TABLE_ which may then be unnecessary).
+
+ Unfortunately -Bsymbolic does bad things to global variables defined in
+ a shared library but accessed by non-PIC code from the mainline (or a
+ static library).
+
+ The problem is that the mainline needs a fixed data address to avoid
+ text segment relocations, so space is allocated in its data segment and
+ the value from the variable is copied from the shared library's data
+ segment when the library is loaded. Under -Bsymbolic, however,
+ references in the shared library are then resolved still to the shared
+ library data area. Not surprisingly it bombs badly to have mainline
+ code and library code accessing different locations for what should be
+ one variable.
+
+ Note that this -Bsymbolic effect for the shared library is not just for
+ R_386_PC32 offsets which might have been cooked up in assembler, but is
+ done also for the contents of GOT entries. -Bsymbolic simply applies a
+ general rule that symbols are resolved first from the local module.
+
+ Visibility Attributes
+
+ GCC __attribute__ ((visibility ("protected"))), which is available in
+ recent versions, eg. 3.3, is probably what we'd like to use. It makes
+ gcc generate plain PC-relative calls to indicated functions, and directs
+ the linker to resolve references to the given function within the link
+ module.
+
+ Unfortunately, as of debian binutils 2.13.90.0.16 at least, the
+ resulting libgmp.so comes out with text segment relocations, references
+ are not resolved at link time. If the gcc description is to be believed
+ this is this not how it should work. If a symbol cannot be overridden
+ by another module then surely references within that module can be
+ resolved immediately (ie. at link time).
+
+ Present
+
+ In any case, all this means that we have no optimizations we can
+ usefully make to function or variable usages, neither for assembler nor
+ C code. Perhaps in the future the visibility attribute will work as
+ we'd like.
+
+
+
+
+GLOBAL OFFSET TABLE
+
+The magic _GLOBAL_OFFSET_TABLE_ used by code establishing the address of the
+GOT sometimes requires an extra underscore prefix. SVR4 systems and NetBSD
+don't need a prefix, OpenBSD does need one. Note that NetBSD and OpenBSD
+are both a.out underscore systems, so the prefix for _GLOBAL_OFFSET_TABLE_
+is not simply the same as the prefix for ordinary globals.
+
+In any case in the asm code we write _GLOBAL_OFFSET_TABLE_ and let a macro
+in x86-defs.m4 add an extra underscore if required (according to a configure
+test).
+
+Old gas 1.92.3 which comes with FreeBSD 2.2.8 gets a segmentation fault when
+asked to assemble the following,
+
+ L1:
+ addl $_GLOBAL_OFFSET_TABLE_+[.-L1], %ebx
+
+It seems that using the label in the same instruction it refers to is the
+problem, since a nop in between works. But the simplest workaround is to
+follow gcc and omit the +[.-L1] since it does nothing,
+
+ addl $_GLOBAL_OFFSET_TABLE_, %ebx
+
+Current gas 2.10 generates incorrect object code when %eax is used in such a
+construction (with or without +[.-L1]),
+
+ addl $_GLOBAL_OFFSET_TABLE_, %eax
+
+The R_386_GOTPC gets a displacement of 2 rather than the 1 appropriate for
+the 1 byte opcode of "addl $n,%eax". The best workaround is just to use any
+other register, since then it's a two byte opcode+mod/rm. GCC for example
+always uses %ebx (which is needed for calls through the PLT).
+
+A similar problem occurs in an leal (again with or without a +[.-L1]),
+
+ leal _GLOBAL_OFFSET_TABLE_(%edi), %ebx
+
+This time the R_386_GOTPC gets a displacement of 0 rather than the 2
+appropriate for the opcode and mod/rm, making this form unusable.
+
+
+
+
+SIMPLE LOOPS
+
+The overheads in setting up for an unrolled loop can mean that at small
+sizes a simple loop is faster. Making small sizes go fast is important,
+even if it adds a cycle or two to bigger sizes. To this end various
+routines choose between a simple loop and an unrolled loop according to
+operand size. The path to the simple loop, or to special case code for
+small sizes, is always as fast as possible.
+
+Adding a simple loop requires a conditional jump to choose between the
+simple and unrolled code. The size of a branch misprediction penalty
+affects whether a simple loop is worthwhile.
+
+The convention is for an m4 definition UNROLL_THRESHOLD to set the crossover
+point, with sizes < UNROLL_THRESHOLD using the simple loop, sizes >=
+UNROLL_THRESHOLD using the unrolled loop. If position independent code adds
+a couple of cycles to an unrolled loop setup, the threshold will vary with
+PIC or non-PIC. Something like the following is typical.
+
+ deflit(UNROLL_THRESHOLD, ifdef(`PIC',10,8))
+
+There's no automated way to determine the threshold. Setting it to a small
+value and then to a big value makes it possible to measure the simple and
+unrolled loops each over a range of sizes, from which the crossover point
+can be determined. Alternately, just adjust the threshold up or down until
+there's no more speedups.
+
+
+
+UNROLLED LOOP CODING
+
+The x86 addressing modes allow a byte displacement of -128 to +127, making
+it possible to access 256 bytes, which is 64 limbs, without adjusting
+pointer registers within the loop. Dword sized displacements can be used
+too, but they increase code size, and unrolling to 64 ought to be enough.
+
+When unrolling to the full 64 limbs/loop, the limb at the top of the loop
+will have a displacement of -128, so pointers have to have a corresponding
++128 added before entering the loop. When unrolling to 32 limbs/loop
+displacements 0 to 127 can be used with 0 at the top of the loop and no
+adjustment needed to the pointers.
+
+Where 64 limbs/loop is supported, the +128 adjustment is done only when 64
+limbs/loop is selected. Usually the gain in speed using 64 instead of 32 or
+16 is small, so support for 64 limbs/loop is generally only for comparison.
+
+
+
+COMPUTED JUMPS
+
+When working from least significant limb to most significant limb (most
+routines) the computed jump and pointer calculations in preparation for an
+unrolled loop are as follows.
+
+ S = operand size in limbs
+ N = number of limbs per loop (UNROLL_COUNT)
+ L = log2 of unrolling (UNROLL_LOG2)
+ M = mask for unrolling (UNROLL_MASK)
+ C = code bytes per limb in the loop
+ B = bytes per limb (4 for x86)
+
+ computed jump (-S & M) * C + entrypoint
+ subtract from pointers (-S & M) * B
+ initial loop counter (S-1) >> L
+ displacements 0 to B*(N-1)
+
+The loop counter is decremented at the end of each loop, and the looping
+stops when the decrement takes the counter to -1. The displacements are for
+the addressing accessing each limb, eg. a load with "movl disp(%ebx), %eax".
+
+Usually the multiply by "C" can be handled without an imul, using instead an
+leal, or a shift and subtract.
+
+When working from most significant to least significant limb (eg. mpn_lshift
+and mpn_copyd), the calculations change as follows.
+
+ add to pointers (-S & M) * B
+ displacements 0 to -B*(N-1)
+
+
+
+OLD GAS 1.92.3
+
+This version comes with FreeBSD 2.2.8 and has a couple of gremlins that
+affect GMP code.
+
+Firstly, an expression involving two forward references to labels comes out
+as zero. For example,
+
+ addl $bar-foo, %eax
+ foo:
+ nop
+ bar:
+
+This should lead to "addl $1, %eax", but it comes out as "addl $0, %eax".
+When only one forward reference is involved, it works correctly, as for
+example,
+
+ foo:
+ addl $bar-foo, %eax
+ nop
+ bar:
+
+Secondly, an expression involving two labels can't be used as the
+displacement for an leal. For example,
+
+ foo:
+ nop
+ bar:
+ leal bar-foo(%eax,%ebx,8), %ecx
+
+A slightly cryptic error is given, "Unimplemented segment type 0 in
+parse_operand". When only one label is used it's ok, and the label can be a
+forward reference too, as for example,
+
+ leal foo(%eax,%ebx,8), %ecx
+ nop
+ foo:
+
+These problems only affect PIC computed jump calculations. The workarounds
+are just to do an leal without a displacement and then an addl, and to make
+sure the code is placed so that there's at most one forward reference in the
+addl.
+
+
+
+REFERENCES
+
+"Intel Architecture Software Developer's Manual", volumes 1, 2a, 2b, 3a, 3b,
+2006, order numbers 253665 through 253669. Available on-line,
+
+ ftp://download.intel.com/design/Pentium4/manuals/25366518.pdf
+ ftp://download.intel.com/design/Pentium4/manuals/25366618.pdf
+ ftp://download.intel.com/design/Pentium4/manuals/25366718.pdf
+ ftp://download.intel.com/design/Pentium4/manuals/25366818.pdf
+ ftp://download.intel.com/design/Pentium4/manuals/25366918.pdf
+
+
+"System V Application Binary Interface", Unix System Laboratories Inc, 1992,
+published by Prentice Hall, ISBN 0-13-880410-9. And the "Intel386 Processor
+Supplement", AT&T, 1991, ISBN 0-13-877689-X. These have details of calling
+conventions and ELF shared library PIC coding. Versions of both available
+on-line,
+
+ http://www.sco.com/developer/devspecs
+
+"Intel386 Family Binary Compatibility Specification 2", Intel Corporation,
+published by McGraw-Hill, 1991, ISBN 0-07-031219-2. (Same as the above 386
+ABI supplement.)
+
+
+
+----------------
+Local variables:
+mode: text
+fill-column: 76
+End:
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/aors_n.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/aors_n.asm
new file mode 100644
index 00000000000..5d359f59b65
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/aors_n.asm
@@ -0,0 +1,202 @@
+dnl x86 mpn_add_n/mpn_sub_n -- mpn addition and subtraction.
+
+dnl Copyright 1992, 1994-1996, 1999-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 cycles/limb
+C P5 3.375
+C P6 3.125
+C K6 3.5
+C K7 2.25
+C P4 8.75
+
+
+ifdef(`OPERATION_add_n',`
+ define(M4_inst, adcl)
+ define(M4_function_n, mpn_add_n)
+ define(M4_function_nc, mpn_add_nc)
+
+',`ifdef(`OPERATION_sub_n',`
+ define(M4_inst, sbbl)
+ define(M4_function_n, mpn_sub_n)
+ define(M4_function_nc, mpn_sub_nc)
+
+',`m4_error(`Need OPERATION_add_n or OPERATION_sub_n
+')')')
+
+MULFUNC_PROLOGUE(mpn_add_n mpn_add_nc mpn_sub_n mpn_sub_nc)
+
+
+C mp_limb_t M4_function_n (mp_ptr dst, mp_srcptr src1, mp_srcptr src2,
+C mp_size_t size);
+C mp_limb_t M4_function_nc (mp_ptr dst, mp_srcptr src1, mp_srcptr src2,
+C mp_size_t size, mp_limb_t carry);
+
+defframe(PARAM_CARRY,20)
+defframe(PARAM_SIZE, 16)
+defframe(PARAM_SRC2, 12)
+defframe(PARAM_SRC1, 8)
+defframe(PARAM_DST, 4)
+
+ TEXT
+ ALIGN(8)
+
+PROLOGUE(M4_function_nc)
+deflit(`FRAME',0)
+
+ pushl %edi FRAME_pushl()
+ pushl %esi FRAME_pushl()
+
+ movl PARAM_DST,%edi
+ movl PARAM_SRC1,%esi
+ movl PARAM_SRC2,%edx
+ movl PARAM_SIZE,%ecx
+
+ movl %ecx,%eax
+ shrl $3,%ecx C compute count for unrolled loop
+ negl %eax
+ andl $7,%eax C get index where to start loop
+ jz L(oopgo) C necessary special case for 0
+ incl %ecx C adjust loop count
+ shll $2,%eax C adjustment for pointers...
+ subl %eax,%edi C ... since they are offset ...
+ subl %eax,%esi C ... by a constant when we ...
+ subl %eax,%edx C ... enter the loop
+ shrl $2,%eax C restore previous value
+
+ifdef(`PIC',`
+ C Calculate start address in loop for PIC. Due to limitations in
+ C old gas, LF(M4_function_n,oop)-L(0a)-3 cannot be put into the leal
+ call L(0a)
+L(0a): leal (%eax,%eax,8),%eax
+ addl (%esp),%eax
+ addl $L(oop)-L(0a)-3,%eax
+ addl $4,%esp
+',`
+ C Calculate start address in loop for non-PIC.
+ leal L(oop)-3(%eax,%eax,8),%eax
+')
+
+ C These lines initialize carry from the 5th parameter. Should be
+ C possible to simplify.
+ pushl %ebp FRAME_pushl()
+ movl PARAM_CARRY,%ebp
+ shrl %ebp C shift bit 0 into carry
+ popl %ebp FRAME_popl()
+
+ jmp *%eax C jump into loop
+
+EPILOGUE()
+
+
+ ALIGN(16)
+PROLOGUE(M4_function_n)
+deflit(`FRAME',0)
+
+ pushl %edi FRAME_pushl()
+ pushl %esi FRAME_pushl()
+
+ movl PARAM_DST,%edi
+ movl PARAM_SRC1,%esi
+ movl PARAM_SRC2,%edx
+ movl PARAM_SIZE,%ecx
+
+ movl %ecx,%eax
+ shrl $3,%ecx C compute count for unrolled loop
+ negl %eax
+ andl $7,%eax C get index where to start loop
+ jz L(oop) C necessary special case for 0
+ incl %ecx C adjust loop count
+ shll $2,%eax C adjustment for pointers...
+ subl %eax,%edi C ... since they are offset ...
+ subl %eax,%esi C ... by a constant when we ...
+ subl %eax,%edx C ... enter the loop
+ shrl $2,%eax C restore previous value
+
+ifdef(`PIC',`
+ C Calculate start address in loop for PIC. Due to limitations in
+ C some assemblers, L(oop)-L(0b)-3 cannot be put into the leal
+ call L(0b)
+L(0b): leal (%eax,%eax,8),%eax
+ addl (%esp),%eax
+ addl $L(oop)-L(0b)-3,%eax
+ addl $4,%esp
+',`
+ C Calculate start address in loop for non-PIC.
+ leal L(oop)-3(%eax,%eax,8),%eax
+')
+ jmp *%eax C jump into loop
+
+L(oopgo):
+ pushl %ebp FRAME_pushl()
+ movl PARAM_CARRY,%ebp
+ shrl %ebp C shift bit 0 into carry
+ popl %ebp FRAME_popl()
+
+ ALIGN(16)
+L(oop): movl (%esi),%eax
+ M4_inst (%edx),%eax
+ movl %eax,(%edi)
+ movl 4(%esi),%eax
+ M4_inst 4(%edx),%eax
+ movl %eax,4(%edi)
+ movl 8(%esi),%eax
+ M4_inst 8(%edx),%eax
+ movl %eax,8(%edi)
+ movl 12(%esi),%eax
+ M4_inst 12(%edx),%eax
+ movl %eax,12(%edi)
+ movl 16(%esi),%eax
+ M4_inst 16(%edx),%eax
+ movl %eax,16(%edi)
+ movl 20(%esi),%eax
+ M4_inst 20(%edx),%eax
+ movl %eax,20(%edi)
+ movl 24(%esi),%eax
+ M4_inst 24(%edx),%eax
+ movl %eax,24(%edi)
+ movl 28(%esi),%eax
+ M4_inst 28(%edx),%eax
+ movl %eax,28(%edi)
+ leal 32(%edi),%edi
+ leal 32(%esi),%esi
+ leal 32(%edx),%edx
+ decl %ecx
+ jnz L(oop)
+
+ sbbl %eax,%eax
+ negl %eax
+
+ popl %esi
+ popl %edi
+ ret
+
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/aorsmul_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/aorsmul_1.asm
new file mode 100644
index 00000000000..54a8905441d
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/aorsmul_1.asm
@@ -0,0 +1,156 @@
+dnl x86 __gmpn_addmul_1 (for 386 and 486) -- Multiply a limb vector with a
+dnl limb and add the result to a second limb vector.
+
+dnl Copyright 1992, 1994, 1997, 1999-2002, 2005 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 P5 14.75
+C P6 model 0-8,10-12 7.5
+C P6 model 9 (Banias) 6.7
+C P6 model 13 (Dothan) 6.75
+C P4 model 0 (Willamette) 24.0
+C P4 model 1 (?) 24.0
+C P4 model 2 (Northwood) 24.0
+C P4 model 3 (Prescott)
+C P4 model 4 (Nocona)
+C Intel Atom
+C AMD K6 12.5
+C AMD K7 5.25
+C AMD K8
+C AMD K10
+
+
+ifdef(`OPERATION_addmul_1',`
+ define(M4_inst, addl)
+ define(M4_function_1, mpn_addmul_1)
+
+',`ifdef(`OPERATION_submul_1',`
+ define(M4_inst, subl)
+ define(M4_function_1, mpn_submul_1)
+
+',`m4_error(`Need OPERATION_addmul_1 or OPERATION_submul_1
+')')')
+
+MULFUNC_PROLOGUE(mpn_addmul_1 mpn_submul_1)
+
+
+C mp_limb_t M4_function_1 (mp_ptr dst, mp_srcptr src, mp_size_t size,
+C mp_limb_t mult);
+
+define(PARAM_MULTIPLIER, `FRAME+16(%esp)')
+define(PARAM_SIZE, `FRAME+12(%esp)')
+define(PARAM_SRC, `FRAME+8(%esp)')
+define(PARAM_DST, `FRAME+4(%esp)')
+
+ TEXT
+ ALIGN(8)
+
+PROLOGUE(M4_function_1)
+deflit(`FRAME',0)
+
+ pushl %edi
+ pushl %esi
+ pushl %ebx
+ pushl %ebp
+deflit(`FRAME',16)
+
+ movl PARAM_DST,%edi
+ movl PARAM_SRC,%esi
+ movl PARAM_SIZE,%ecx
+
+ xorl %ebx,%ebx
+ andl $3,%ecx
+ jz L(end0)
+
+L(oop0):
+ movl (%esi),%eax
+ mull PARAM_MULTIPLIER
+ leal 4(%esi),%esi
+ addl %ebx,%eax
+ movl $0,%ebx
+ adcl %ebx,%edx
+ M4_inst %eax,(%edi)
+ adcl %edx,%ebx C propagate carry into cylimb
+
+ leal 4(%edi),%edi
+ decl %ecx
+ jnz L(oop0)
+
+L(end0):
+ movl PARAM_SIZE,%ecx
+ shrl $2,%ecx
+ jz L(end)
+
+ ALIGN(8)
+L(oop): movl (%esi),%eax
+ mull PARAM_MULTIPLIER
+ addl %eax,%ebx
+ movl $0,%ebp
+ adcl %edx,%ebp
+
+ movl 4(%esi),%eax
+ mull PARAM_MULTIPLIER
+ M4_inst %ebx,(%edi)
+ adcl %eax,%ebp C new lo + cylimb
+ movl $0,%ebx
+ adcl %edx,%ebx
+
+ movl 8(%esi),%eax
+ mull PARAM_MULTIPLIER
+ M4_inst %ebp,4(%edi)
+ adcl %eax,%ebx C new lo + cylimb
+ movl $0,%ebp
+ adcl %edx,%ebp
+
+ movl 12(%esi),%eax
+ mull PARAM_MULTIPLIER
+ M4_inst %ebx,8(%edi)
+ adcl %eax,%ebp C new lo + cylimb
+ movl $0,%ebx
+ adcl %edx,%ebx
+
+ M4_inst %ebp,12(%edi)
+ adcl $0,%ebx C propagate carry into cylimb
+
+ leal 16(%esi),%esi
+ leal 16(%edi),%edi
+ decl %ecx
+ jnz L(oop)
+
+L(end): movl %ebx,%eax
+
+ popl %ebp
+ popl %ebx
+ popl %esi
+ popl %edi
+ ret
+
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/atom/aorrlsh1_n.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/atom/aorrlsh1_n.asm
new file mode 100644
index 00000000000..cd1a650022f
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/atom/aorrlsh1_n.asm
@@ -0,0 +1,53 @@
+dnl Intel Atom mpn_rsblsh1_n -- rp[] = (vp[] << 1) - up[]
+
+dnl Contributed to the GNU project by Marco Bodrato.
+
+dnl Copyright 2011 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, 31)
+
+ifdef(`OPERATION_addlsh1_n', `
+ define(M4_inst, adc)
+ define(M4_opp, sub)
+ define(M4_function, mpn_addlsh1_n)
+ define(M4_function_c, mpn_addlsh1_nc)
+',`ifdef(`OPERATION_rsblsh1_n', `
+ define(M4_inst, sbb)
+ define(M4_opp, add)
+ define(M4_function, mpn_rsblsh1_n)
+ define(M4_function_c, mpn_rsblsh1_nc)
+',`m4_error(`Need OPERATION_addlsh1_n or OPERATION_rsblsh1_n
+')')')
+
+MULFUNC_PROLOGUE(mpn_addlsh1_n mpn_addlsh1_nc mpn_rsblsh1_n mpn_rsblsh1_nc)
+
+include_mpn(`x86/atom/aorrlshC_n.asm')
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/atom/aorrlsh2_n.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/atom/aorrlsh2_n.asm
new file mode 100644
index 00000000000..10f4419de9e
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/atom/aorrlsh2_n.asm
@@ -0,0 +1,53 @@
+dnl Intel Atom mpn_addlsh2_n/mpn_rsblsh2_n -- rp[] = (vp[] << 2) +- up[]
+
+dnl Contributed to the GNU project by Marco Bodrato.
+
+dnl Copyright 2011 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, 30)
+
+ifdef(`OPERATION_addlsh2_n', `
+ define(M4_inst, adcl)
+ define(M4_opp, subl)
+ define(M4_function, mpn_addlsh2_n)
+ define(M4_function_c, mpn_addlsh2_nc)
+',`ifdef(`OPERATION_rsblsh2_n', `
+ define(M4_inst, sbbl)
+ define(M4_opp, addl)
+ define(M4_function, mpn_rsblsh2_n)
+ define(M4_function_c, mpn_rsblsh2_nc)
+',`m4_error(`Need OPERATION_addlsh2_n or OPERATION_rsblsh2_n
+')')')
+
+MULFUNC_PROLOGUE(mpn_addlsh2_n mpn_addlsh2_nc mpn_rsblsh2_n mpn_rsblsh2_nc)
+
+include_mpn(`x86/atom/aorrlshC_n.asm')
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/atom/aorrlshC_n.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/atom/aorrlshC_n.asm
new file mode 100644
index 00000000000..71cfe490d6e
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/atom/aorrlshC_n.asm
@@ -0,0 +1,156 @@
+dnl Intel Atom mpn_addlshC_n/mpn_rsblshC_n -- rp[] = (vp[] << C) +- up[]
+
+dnl Contributed to the GNU project by Marco Bodrato.
+
+dnl Copyright 2011 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 mp_limb_t mpn_addlshC_n (mp_ptr dst, mp_srcptr src1, mp_srcptr src2,
+C mp_size_t size);
+C mp_limb_t mpn_addlshC_nc (mp_ptr dst, mp_srcptr src1, mp_srcptr src2,
+C mp_size_t size, mp_limb_t carry);
+C mp_limb_t mpn_rsblshC_n (mp_ptr dst, mp_srcptr src1, mp_srcptr src2,
+C mp_size_t size);
+C mp_limb_t mpn_rsblshC_nc (mp_ptr dst, mp_srcptr src1, mp_srcptr src2,
+C mp_size_t size, mp_signed_limb_t carry);
+
+C cycles/limb
+C P5
+C P6 model 0-8,10-12
+C P6 model 9 (Banias)
+C P6 model 13 (Dothan)
+C P4 model 0 (Willamette)
+C P4 model 1 (?)
+C P4 model 2 (Northwood)
+C P4 model 3 (Prescott)
+C P4 model 4 (Nocona)
+C Intel Atom 6
+C AMD K6
+C AMD K7
+C AMD K8
+C AMD K10
+
+defframe(PARAM_CORB, 20)
+defframe(PARAM_SIZE, 16)
+defframe(PARAM_DBLD, 12)
+defframe(PARAM_SRC, 8)
+defframe(PARAM_DST, 4)
+
+dnl re-use parameter space
+define(VAR_COUNT,`PARAM_SIZE')
+define(SAVE_EBP,`PARAM_DBLD')
+define(SAVE_VP,`PARAM_SRC')
+define(SAVE_UP,`PARAM_DST')
+
+define(M, eval(m4_lshift(1,LSH)))
+define(`rp', `%edi')
+define(`up', `%esi')
+define(`vp', `%ebx')
+
+ASM_START()
+ TEXT
+ ALIGN(8)
+
+PROLOGUE(M4_function_c)
+deflit(`FRAME',0)
+ movl PARAM_CORB, %eax
+ movl %eax, %edx
+ shr $LSH, %edx
+ andl $1, %edx
+ M4_opp %edx, %eax
+ jmp L(start_nc)
+EPILOGUE()
+
+PROLOGUE(M4_function)
+deflit(`FRAME',0)
+
+ xor %eax, %eax
+ xor %edx, %edx
+L(start_nc):
+ push rp FRAME_pushl()
+
+ mov PARAM_SIZE, %ecx C size
+ mov PARAM_DST, rp
+ mov up, SAVE_UP
+ incl %ecx C size + 1
+ mov PARAM_SRC, up
+ mov vp, SAVE_VP
+ shr %ecx C (size+1)\2
+ mov PARAM_DBLD, vp
+ mov %ebp, SAVE_EBP
+ mov %ecx, VAR_COUNT
+ jnc L(entry) C size odd
+
+ shr %edx C size even
+ mov (vp), %ecx
+ lea 4(vp), vp
+ lea (%eax,%ecx,M), %edx
+ mov %ecx, %eax
+ lea -4(up), up
+ lea -4(rp), rp
+ jmp L(enteven)
+
+ ALIGN(16)
+L(oop):
+ lea (%eax,%ecx,M), %ebp
+ shr $RSH, %ecx
+ mov 4(vp), %eax
+ shr %edx
+ lea 8(vp), vp
+ M4_inst (up), %ebp
+ lea (%ecx,%eax,M), %edx
+ mov %ebp, (rp)
+L(enteven):
+ M4_inst 4(up), %edx
+ lea 8(up), up
+ mov %edx, 4(rp)
+ adc %edx, %edx
+ shr $RSH, %eax
+ lea 8(rp), rp
+L(entry):
+ mov (vp), %ecx
+ decl VAR_COUNT
+ jnz L(oop)
+
+ lea (%eax,%ecx,M), %ebp
+ shr $RSH, %ecx
+ shr %edx
+ mov SAVE_VP, vp
+ M4_inst (up), %ebp
+ mov %ecx, %eax
+ mov SAVE_UP, up
+ M4_inst $0, %eax
+ mov %ebp, (rp)
+ mov SAVE_EBP, %ebp
+ pop rp FRAME_popl()
+ ret
+EPILOGUE()
+
+ASM_END()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/atom/aors_n.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/atom/aors_n.asm
new file mode 100644
index 00000000000..45ec287c3a1
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/atom/aors_n.asm
@@ -0,0 +1,159 @@
+dnl Intel Atom mpn_add_n/mpn_sub_n -- rp[] = up[] +- vp[].
+
+dnl Copyright 2011 Free Software Foundation, Inc.
+
+dnl Contributed to the GNU project by Marco Bodrato.
+
+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 P5
+C P6 model 0-8,10-12
+C P6 model 9 (Banias)
+C P6 model 13 (Dothan)
+C P4 model 0 (Willamette)
+C P4 model 1 (?)
+C P4 model 2 (Northwood)
+C P4 model 3 (Prescott)
+C P4 model 4 (Nocona)
+C Intel Atom 3
+C AMD K6
+C AMD K7
+C AMD K8
+C AMD K10
+
+ifdef(`OPERATION_add_n', `
+ define(M4_inst, adcl)
+ define(M4_function_n, mpn_add_n)
+ define(M4_function_nc, mpn_add_nc)
+ define(M4_description, add)
+',`ifdef(`OPERATION_sub_n', `
+ define(M4_inst, sbbl)
+ define(M4_function_n, mpn_sub_n)
+ define(M4_function_nc, mpn_sub_nc)
+ define(M4_description, subtract)
+',`m4_error(`Need OPERATION_add_n or OPERATION_sub_n
+')')')
+
+MULFUNC_PROLOGUE(mpn_add_n mpn_add_nc mpn_sub_n mpn_sub_nc)
+
+C mp_limb_t M4_function_n (mp_ptr dst, mp_srcptr src1, mp_srcptr src2,
+C mp_size_t size);
+C mp_limb_t M4_function_nc (mp_ptr dst, mp_srcptr src1, mp_srcptr src2,
+C mp_size_t size, mp_limb_t carry);
+C
+C Calculate src1,size M4_description src2,size, and store the result in
+C dst,size. The return value is the carry bit from the top of the result (1
+C or 0).
+C
+C The _nc version accepts 1 or 0 for an initial carry into the low limb of
+C the calculation. Note values other than 1 or 0 here will lead to garbage
+C results.
+
+defframe(PARAM_CARRY,20)
+defframe(PARAM_SIZE, 16)
+defframe(PARAM_SRC2, 12)
+defframe(PARAM_SRC1, 8)
+defframe(PARAM_DST, 4)
+
+dnl re-use parameter space
+define(SAVE_RP,`PARAM_SIZE')
+define(SAVE_VP,`PARAM_SRC1')
+define(SAVE_UP,`PARAM_DST')
+
+define(`rp', `%edi')
+define(`up', `%esi')
+define(`vp', `%ebx')
+define(`cy', `%ecx')
+define(`r1', `%ecx')
+define(`r2', `%edx')
+
+ASM_START()
+ TEXT
+ ALIGN(16)
+deflit(`FRAME',0)
+
+PROLOGUE(M4_function_n)
+ xor cy, cy C carry
+L(start):
+ mov PARAM_SIZE, %eax C size
+ mov rp, SAVE_RP
+ mov PARAM_DST, rp
+ mov up, SAVE_UP
+ mov PARAM_SRC1, up
+ shr %eax C size >> 1
+ mov vp, SAVE_VP
+ mov PARAM_SRC2, vp
+ jz L(one) C size == 1
+ jc L(three) C size % 2 == 1
+
+ shr cy
+ mov (up), r2
+ lea 4(up), up
+ lea 4(vp), vp
+ lea -4(rp), rp
+ jmp L(entry)
+L(one):
+ shr cy
+ mov (up), r1
+ jmp L(end)
+L(three):
+ shr cy
+ mov (up), r1
+
+ ALIGN(16)
+L(oop):
+ M4_inst (vp), r1
+ lea 8(up), up
+ mov -4(up), r2
+ lea 8(vp), vp
+ mov r1, (rp)
+L(entry):
+ M4_inst -4(vp), r2
+ lea 8(rp), rp
+ dec %eax
+ mov (up), r1
+ mov r2, -4(rp)
+ jnz L(oop)
+
+L(end): C %eax is zero here
+ mov SAVE_UP, up
+ M4_inst (vp), r1
+ mov SAVE_VP, vp
+ mov r1, (rp)
+ adc %eax, %eax
+ mov SAVE_RP, rp
+ ret
+EPILOGUE()
+
+PROLOGUE(M4_function_nc)
+ mov PARAM_CARRY, cy C carry
+ jmp L(start)
+EPILOGUE()
+ASM_END()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/atom/aorslshC_n.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/atom/aorslshC_n.asm
new file mode 100644
index 00000000000..75ace65e513
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/atom/aorslshC_n.asm
@@ -0,0 +1,247 @@
+dnl Intel Atom mpn_addlshC_n/mpn_sublshC_n -- rp[] = up[] +- (vp[] << C)
+
+dnl Contributed to the GNU project by Marco Bodrato.
+
+dnl Copyright 2011 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 mp_limb_t mpn_addlshC_n_ip1 (mp_ptr dst, mp_srcptr src, mp_size_t size);
+C mp_limb_t mpn_addlshC_nc_ip1 (mp_ptr dst, mp_srcptr src, mp_size_t size,
+C mp_limb_t carry);
+C mp_limb_t mpn_sublshC_n_ip1 (mp_ptr dst, mp_srcptr src, mp_size_t size,);
+C mp_limb_t mpn_sublshC_nc_ip1 (mp_ptr dst, mp_srcptr src, mp_size_t size,
+C mp_signed_limb_t borrow);
+
+defframe(PARAM_CORB, 16)
+defframe(PARAM_SIZE, 12)
+defframe(PARAM_SRC, 8)
+defframe(PARAM_DST, 4)
+
+C mp_limb_t mpn_addlshC_n (mp_ptr dst, mp_srcptr src1, mp_srcptr src2,
+C mp_size_t size,);
+C mp_limb_t mpn_addlshC_nc (mp_ptr dst, mp_srcptr src1, mp_srcptr src2,
+C mp_size_t size, mp_limb_t carry);
+C mp_limb_t mpn_sublshC_n (mp_ptr dst, mp_srcptr src1, mp_srcptr src2,
+C mp_size_t size,);
+C mp_limb_t mpn_sublshC_nc (mp_ptr dst, mp_srcptr src1, mp_srcptr src2,
+C mp_size_t size, mp_limb_t borrow);
+
+C if src1 == dst, _ip1 is used
+
+C cycles/limb
+C dst!=src1,src2 dst==src1
+C P5
+C P6 model 0-8,10-12
+C P6 model 9 (Banias)
+C P6 model 13 (Dothan)
+C P4 model 0 (Willamette)
+C P4 model 1 (?)
+C P4 model 2 (Northwood)
+C P4 model 3 (Prescott)
+C P4 model 4 (Nocona)
+C Intel Atom 7 6
+C AMD K6
+C AMD K7
+C AMD K8
+C AMD K10
+
+defframe(GPARAM_CORB, 20)
+defframe(GPARAM_SIZE, 16)
+defframe(GPARAM_SRC2, 12)
+
+dnl re-use parameter space
+define(SAVE_EBP,`PARAM_SIZE')
+define(SAVE_EBX,`PARAM_SRC')
+define(SAVE_UP,`PARAM_DST')
+
+define(M, eval(m4_lshift(1,LSH)))
+define(`rp', `%edi')
+define(`up', `%esi')
+
+ASM_START()
+ TEXT
+ ALIGN(8)
+
+PROLOGUE(M4_ip_function_c)
+deflit(`FRAME',0)
+ movl PARAM_CORB, %ecx
+ movl %ecx, %edx
+ shr $LSH, %edx
+ andl $1, %edx
+ M4_opp %edx, %ecx
+ jmp L(start_nc)
+EPILOGUE()
+
+PROLOGUE(M4_ip_function)
+deflit(`FRAME',0)
+
+ xor %ecx, %ecx
+ xor %edx, %edx
+L(start_nc):
+ push rp FRAME_pushl()
+ mov PARAM_DST, rp
+ mov up, SAVE_UP
+ mov PARAM_SRC, up
+ mov %ebx, SAVE_EBX
+ mov PARAM_SIZE, %ebx C size
+L(inplace):
+ incl %ebx C size + 1
+ shr %ebx C (size+1)\2
+ mov %ebp, SAVE_EBP
+ jnc L(entry) C size odd
+
+ add %edx, %edx C size even
+ mov %ecx, %ebp
+ mov (up), %ecx
+ lea -4(rp), rp
+ lea (%ebp,%ecx,M), %eax
+ lea 4(up), up
+ jmp L(enteven)
+
+ ALIGN(16)
+L(oop):
+ lea (%ecx,%eax,M), %ebp
+ shr $RSH, %eax
+ mov 4(up), %ecx
+ add %edx, %edx
+ lea 8(up), up
+ M4_inst %ebp, (rp)
+ lea (%eax,%ecx,M), %eax
+
+L(enteven):
+ M4_inst %eax, 4(rp)
+ lea 8(rp), rp
+
+ sbb %edx, %edx
+ shr $RSH, %ecx
+
+L(entry):
+ mov (up), %eax
+ decl %ebx
+ jnz L(oop)
+
+ lea (%ecx,%eax,M), %ebp
+ shr $RSH, %eax
+ shr %edx
+ M4_inst %ebp, (rp)
+ mov SAVE_UP, up
+ adc $0, %eax
+ mov SAVE_EBP, %ebp
+ mov SAVE_EBX, %ebx
+ pop rp FRAME_popl()
+ ret
+EPILOGUE()
+
+PROLOGUE(M4_function_c)
+deflit(`FRAME',0)
+ movl GPARAM_CORB, %ecx
+ movl %ecx, %edx
+ shr $LSH, %edx
+ andl $1, %edx
+ M4_opp %edx, %ecx
+ jmp L(generic_nc)
+EPILOGUE()
+
+PROLOGUE(M4_function)
+deflit(`FRAME',0)
+
+ xor %ecx, %ecx
+ xor %edx, %edx
+L(generic_nc):
+ push rp FRAME_pushl()
+ mov PARAM_DST, rp
+ mov up, SAVE_UP
+ mov PARAM_SRC, up
+ cmp rp, up
+ mov %ebx, SAVE_EBX
+ jne L(general)
+ mov GPARAM_SIZE, %ebx C size
+ mov GPARAM_SRC2, up
+ jmp L(inplace)
+
+L(general):
+ mov GPARAM_SIZE, %eax C size
+ mov %ebx, SAVE_EBX
+ incl %eax C size + 1
+ mov up, %ebx C vp
+ mov GPARAM_SRC2, up C up
+ shr %eax C (size+1)\2
+ mov %ebp, SAVE_EBP
+ mov %eax, GPARAM_SIZE
+ jnc L(entry2) C size odd
+
+ add %edx, %edx C size even
+ mov %ecx, %ebp
+ mov (up), %ecx
+ lea -4(rp), rp
+ lea -4(%ebx), %ebx
+ lea (%ebp,%ecx,M), %eax
+ lea 4(up), up
+ jmp L(enteven2)
+
+ ALIGN(16)
+L(oop2):
+ lea (%ecx,%eax,M), %ebp
+ shr $RSH, %eax
+ mov 4(up), %ecx
+ add %edx, %edx
+ lea 8(up), up
+ mov (%ebx), %edx
+ M4_inst %ebp, %edx
+ lea (%eax,%ecx,M), %eax
+ mov %edx, (rp)
+L(enteven2):
+ mov 4(%ebx), %edx
+ lea 8(%ebx), %ebx
+ M4_inst %eax, %edx
+ mov %edx, 4(rp)
+ sbb %edx, %edx
+ shr $RSH, %ecx
+ lea 8(rp), rp
+L(entry2):
+ mov (up), %eax
+ decl GPARAM_SIZE
+ jnz L(oop2)
+
+ lea (%ecx,%eax,M), %ebp
+ shr $RSH, %eax
+ shr %edx
+ mov (%ebx), %edx
+ M4_inst %ebp, %edx
+ mov %edx, (rp)
+ mov SAVE_UP, up
+ adc $0, %eax
+ mov SAVE_EBP, %ebp
+ mov SAVE_EBX, %ebx
+ pop rp FRAME_popl()
+ ret
+EPILOGUE()
+
+ASM_END()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/atom/bdiv_q_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/atom/bdiv_q_1.asm
new file mode 100644
index 00000000000..31e908ec446
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/atom/bdiv_q_1.asm
@@ -0,0 +1,35 @@
+dnl Intel Atom mpn_bdiv_q_1, mpn_pi1_bdiv_q_1 -- schoolbook Hensel
+dnl division by 1-limb divisor, returning quotient only.
+
+dnl Copyright 2011 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(`x86/pentium/bdiv_q_1.asm')
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/atom/cnd_add_n.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/atom/cnd_add_n.asm
new file mode 100644
index 00000000000..50bf2ad64b8
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/atom/cnd_add_n.asm
@@ -0,0 +1,113 @@
+dnl X86 mpn_cnd_add_n optimised for Intel Atom.
+
+dnl Copyright 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/limb
+C P5 ?
+C P6 model 0-8,10-12 ?
+C P6 model 9 (Banias) ?
+C P6 model 13 (Dothan) ?
+C P4 model 0-1 (Willamette) ?
+C P4 model 2 (Northwood) ?
+C P4 model 3-4 (Prescott) ?
+C Intel atom 4.67
+C AMD K6 ?
+C AMD K7 ?
+C AMD K8 ?
+
+
+define(`rp', `%edi')
+define(`up', `%esi')
+define(`vp', `%ebp')
+define(`n', `%ecx')
+define(`cnd', `20(%esp)')
+
+ASM_START()
+ TEXT
+ ALIGN(16)
+PROLOGUE(mpn_cnd_add_n)
+ push %edi
+ push %esi
+ push %ebx
+ push %ebp
+
+ mov cnd, %eax C make cnd into a mask (1)
+ mov 24(%esp), rp
+ neg %eax C make cnd into a mask (1)
+ mov 28(%esp), up
+ sbb %eax, %eax C make cnd into a mask (1)
+ mov 32(%esp), vp
+ mov %eax, cnd C make cnd into a mask (1)
+ mov 36(%esp), n
+
+ xor %edx, %edx
+
+ shr $1, n
+ jnc L(top)
+
+ mov 0(vp), %eax
+ and cnd, %eax
+ lea 4(vp), vp
+ add 0(up), %eax
+ lea 4(rp), rp
+ lea 4(up), up
+ sbb %edx, %edx
+ mov %eax, -4(rp)
+ inc n
+ dec n
+ je L(end)
+
+L(top): sbb %edx, %edx
+ mov 0(vp), %eax
+ and cnd, %eax
+ lea 8(vp), vp
+ lea 8(rp), rp
+ mov -4(vp), %ebx
+ and cnd, %ebx
+ add %edx, %edx
+ adc 0(up), %eax
+ lea 8(up), up
+ mov %eax, -8(rp)
+ adc -4(up), %ebx
+ dec n
+ mov %ebx, -4(rp)
+ jne L(top)
+
+L(end): mov $0, %eax
+ adc %eax, %eax
+
+ pop %ebp
+ pop %ebx
+ pop %esi
+ pop %edi
+ ret
+EPILOGUE()
+ASM_END()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/atom/cnd_sub_n.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/atom/cnd_sub_n.asm
new file mode 100644
index 00000000000..221bedca379
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/atom/cnd_sub_n.asm
@@ -0,0 +1,124 @@
+dnl X86 mpn_cnd_sub_n optimised for Intel Atom.
+
+dnl Copyright 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/limb
+C P5 ?
+C P6 model 0-8,10-12 ?
+C P6 model 9 (Banias) ?
+C P6 model 13 (Dothan) ?
+C P4 model 0-1 (Willamette) ?
+C P4 model 2 (Northwood) ?
+C P4 model 3-4 (Prescott) ?
+C Intel atom 5.67
+C AMD K6 ?
+C AMD K7 ?
+C AMD K8 ?
+
+
+define(`rp', `%edi')
+define(`up', `%esi')
+define(`vp', `%ebp')
+define(`n', `%ecx')
+define(`cnd', `20(%esp)')
+
+ASM_START()
+ TEXT
+ ALIGN(16)
+PROLOGUE(mpn_cnd_sub_n)
+ push %edi
+ push %esi
+ push %ebx
+ push %ebp
+
+ mov cnd, %eax C make cnd into a mask (1)
+ mov 24(%esp), rp
+ neg %eax C make cnd into a mask (1)
+ mov 28(%esp), up
+ sbb %eax, %eax C make cnd into a mask (1)
+ mov 32(%esp), vp
+ mov %eax, cnd C make cnd into a mask (1)
+ mov 36(%esp), n
+
+ xor %edx, %edx
+
+ inc n
+ shr n
+ jnc L(ent)
+
+ mov 0(vp), %eax
+ and cnd, %eax
+ lea 4(vp), vp
+ mov 0(up), %edx
+ sub %eax, %edx
+ lea 4(rp), rp
+ lea 4(up), up
+ mov %edx, -4(rp)
+ sbb %edx, %edx C save cy
+
+L(ent): mov 0(vp), %ebx
+ and cnd, %ebx
+ add %edx, %edx C restore cy
+ mov 0(up), %edx
+ dec n
+ je L(end)
+
+L(top): sbb %ebx, %edx
+ mov 4(vp), %eax
+ mov %edx, 0(rp)
+ sbb %edx, %edx C save cy
+ mov 8(vp), %ebx
+ lea 8(up), up
+ and cnd, %ebx
+ and cnd, %eax
+ add %edx, %edx C restore cy
+ mov -4(up), %edx
+ lea 8(rp), rp
+ sbb %eax, %edx
+ mov %edx, -4(rp)
+ dec n
+ mov 0(up), %edx
+ lea 8(vp), vp
+ jne L(top)
+
+L(end): sbb %ebx, %edx
+ mov %edx, 0(rp)
+
+ mov $0, %eax
+ adc %eax, %eax
+
+ pop %ebp
+ pop %ebx
+ pop %esi
+ pop %edi
+ ret
+EPILOGUE()
+ASM_END()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/atom/dive_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/atom/dive_1.asm
new file mode 100644
index 00000000000..71036a15a4d
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/atom/dive_1.asm
@@ -0,0 +1,34 @@
+dnl Intel Atom mpn_divexact_1 -- mpn by limb exact division.
+
+dnl Copyright 2011 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_divexact_1)
+include_mpn(`x86/pentium/dive_1.asm')
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/atom/gmp-mparam.h b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/atom/gmp-mparam.h
new file mode 100644
index 00000000000..45df12806c0
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/atom/gmp-mparam.h
@@ -0,0 +1,201 @@
+/* Intel Atom/32 gmp-mparam.h -- Compiler/machine parameter header file.
+
+Copyright 1991, 1993, 1994, 2000-2011, 2014 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
+
+/* 1667 MHz Pineview (Atom D510) */
+/* FFT tuning limit = 25000000 */
+/* Generated by tuneup.c, 2014-03-14, gcc 4.5 */
+
+#define MOD_1_NORM_THRESHOLD 3
+#define MOD_1_UNNORM_THRESHOLD 5
+#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 13
+#define USE_PREINV_DIVREM_1 1 /* native */
+#define DIV_QR_1N_PI1_METHOD 1
+#define DIV_QR_1_NORM_THRESHOLD 4
+#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 MUL_TOOM22_THRESHOLD 20
+#define MUL_TOOM33_THRESHOLD 74
+#define MUL_TOOM44_THRESHOLD 178
+#define MUL_TOOM6H_THRESHOLD 270
+#define MUL_TOOM8H_THRESHOLD 399
+
+#define MUL_TOOM32_TO_TOOM43_THRESHOLD 73
+#define MUL_TOOM32_TO_TOOM53_THRESHOLD 122
+#define MUL_TOOM42_TO_TOOM53_THRESHOLD 115
+#define MUL_TOOM42_TO_TOOM63_THRESHOLD 127
+#define MUL_TOOM43_TO_TOOM54_THRESHOLD 106
+
+#define SQR_BASECASE_THRESHOLD 0 /* always (native) */
+#define SQR_TOOM2_THRESHOLD 30
+#define SQR_TOOM3_THRESHOLD 105
+#define SQR_TOOM4_THRESHOLD 178
+#define SQR_TOOM6_THRESHOLD 303
+#define SQR_TOOM8_THRESHOLD 527
+
+#define MULMID_TOOM42_THRESHOLD 54
+
+#define MULMOD_BNM1_THRESHOLD 13
+#define SQRMOD_BNM1_THRESHOLD 18
+
+#define MUL_FFT_MODF_THRESHOLD 380 /* k = 5 */
+#define MUL_FFT_TABLE3 \
+ { { 380, 5}, { 19, 6}, { 10, 5}, { 21, 6}, \
+ { 11, 5}, { 23, 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}, \
+ { 127, 8}, { 255, 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,10}, { 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}, { 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}, { 127,11}, { 255,10}, \
+ { 543,11}, { 287,10}, { 607, 9}, { 1215,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,10}, { 1215,12}, \
+ { 319,11}, { 735,12}, { 383,11}, { 831,12}, \
+ { 447,11}, { 959,13}, { 255,12}, { 511,11}, \
+ { 1087,12}, { 575,11}, { 1151,12}, { 703,11}, \
+ { 1471,13}, { 383,12}, { 831,11}, { 1663,12}, \
+ { 959,14}, { 255,13}, { 511,12}, { 1215,13}, \
+ { 639,12}, { 1471,11}, { 2943,13}, { 767,12}, \
+ { 1663,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}, \
+ { 2431,14}, { 1279,13}, { 2943,12}, { 5887,14}, \
+ { 16384,15}, { 32768,16} }
+#define MUL_FFT_TABLE3_SIZE 150
+#define MUL_FFT_THRESHOLD 4544
+
+#define SQR_FFT_MODF_THRESHOLD 340 /* 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}, { 27, 7}, { 15, 6}, \
+ { 31, 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}, { 63, 9}, { 39, 8}, { 79, 9}, \
+ { 47,10}, { 31, 9}, { 79,10}, { 47, 9}, \
+ { 95,11}, { 31,10}, { 63, 9}, { 127, 8}, \
+ { 255,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, 8}, { 607,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,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,11}, { 1407,13}, \
+ { 383,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}, { 1407,14}, { 767,13}, \
+ { 1663,12}, { 3455,13}, { 1791,15}, { 511,14}, \
+ { 1023,13}, { 2431,14}, { 1279,13}, { 2943,12}, \
+ { 5887,14}, { 16384,15}, { 32768,16} }
+#define SQR_FFT_TABLE3_SIZE 151
+#define SQR_FFT_THRESHOLD 2880
+
+#define MULLO_BASECASE_THRESHOLD 6
+#define MULLO_DC_THRESHOLD 48
+#define MULLO_MUL_N_THRESHOLD 8907
+
+#define DC_DIV_QR_THRESHOLD 59
+#define DC_DIVAPPR_Q_THRESHOLD 250
+#define DC_BDIV_QR_THRESHOLD 59
+#define DC_BDIV_Q_THRESHOLD 169
+
+#define INV_MULMOD_BNM1_THRESHOLD 38
+#define INV_NEWTON_THRESHOLD 246
+#define INV_APPR_THRESHOLD 246
+
+#define BINV_NEWTON_THRESHOLD 276
+#define REDC_1_TO_REDC_N_THRESHOLD 67
+
+#define MU_DIV_QR_THRESHOLD 1334
+#define MU_DIVAPPR_Q_THRESHOLD 1442
+#define MUPI_DIV_QR_THRESHOLD 114
+#define MU_BDIV_QR_THRESHOLD 1142
+#define MU_BDIV_Q_THRESHOLD 1334
+
+#define POWM_SEC_TABLE 1,22,98,416,1378
+
+#define MATRIX22_STRASSEN_THRESHOLD 13
+#define HGCD_THRESHOLD 133
+#define HGCD_APPR_THRESHOLD 169
+#define HGCD_REDUCE_THRESHOLD 2479
+#define GCD_DC_THRESHOLD 460
+#define GCDEXT_DC_THRESHOLD 342
+#define JACOBI_BASE_METHOD 3
+
+#define GET_STR_DC_THRESHOLD 12
+#define GET_STR_PRECOMPUTE_THRESHOLD 23
+#define SET_STR_DC_THRESHOLD 321
+#define SET_STR_PRECOMPUTE_THRESHOLD 1099
+
+#define FAC_DSC_THRESHOLD 198
+#define FAC_ODD_THRESHOLD 34
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/atom/logops_n.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/atom/logops_n.asm
new file mode 100644
index 00000000000..3cb6d7310c2
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/atom/logops_n.asm
@@ -0,0 +1,151 @@
+dnl Intel Atom mpn_and_n,...,mpn_xnor_n -- bitwise logical operations.
+
+dnl Copyright 2011 Free Software Foundation, Inc.
+
+dnl Contributed to the GNU project by Marco Bodrato.
+
+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 op nop opn
+C P5
+C P6 model 0-8,10-12
+C P6 model 9 (Banias)
+C P6 model 13 (Dothan)
+C P4 model 0 (Willamette)
+C P4 model 1 (?)
+C P4 model 2 (Northwood)
+C P4 model 3 (Prescott)
+C P4 model 4 (Nocona)
+C Intel Atom 3 3.5 3.5
+C AMD K6
+C AMD K7
+C AMD K8
+C AMD K10
+
+define(M4_choose_op,
+`ifdef(`OPERATION_$1',`
+define(`M4_function', `mpn_$1')
+define(`M4_want_pre', `$4')
+define(`M4_inst', `$3')
+define(`M4_want_post',`$2')
+')')
+define(M4pre, `ifelse(M4_want_pre, yes,`$1')')
+define(M4post,`ifelse(M4_want_post,yes,`$1')')
+
+M4_choose_op( and_n, , andl, )
+M4_choose_op( andn_n, , andl, yes)
+M4_choose_op( nand_n, yes, andl, )
+M4_choose_op( ior_n, , orl, )
+M4_choose_op( iorn_n, , orl, yes)
+M4_choose_op( nior_n, yes, orl, )
+M4_choose_op( xor_n, , xorl, )
+M4_choose_op( xnor_n, yes, xorl, )
+
+ifdef(`M4_function',,
+`m4_error(`Unrecognised or undefined OPERATION symbol
+')')
+
+MULFUNC_PROLOGUE(mpn_and_n mpn_andn_n mpn_nand_n mpn_ior_n mpn_iorn_n mpn_nior_n mpn_xor_n mpn_xnor_n)
+
+C void M4_function (mp_ptr dst, mp_srcptr src2, mp_srcptr src1, mp_size_t size);
+C
+
+defframe(PARAM_SIZE, 16)
+defframe(PARAM_SRC1, 12)
+defframe(PARAM_SRC2, 8)
+defframe(PARAM_DST, 4)
+
+dnl re-use parameter space
+define(SAVE_RP,`PARAM_SIZE')
+define(SAVE_VP,`PARAM_SRC1')
+define(SAVE_UP,`PARAM_DST')
+
+define(`rp', `%edi')
+define(`up', `%esi')
+define(`vp', `%ebx')
+define(`cnt', `%eax')
+define(`r1', `%ecx')
+define(`r2', `%edx')
+
+ASM_START()
+ TEXT
+ ALIGN(16)
+deflit(`FRAME',0)
+
+PROLOGUE(M4_function)
+ mov PARAM_SIZE, cnt C size
+ mov rp, SAVE_RP
+ mov PARAM_DST, rp
+ mov up, SAVE_UP
+ mov PARAM_SRC1, up
+ shr cnt C size >> 1
+ mov vp, SAVE_VP
+ mov PARAM_SRC2, vp
+ mov (up), r1
+ jz L(end) C size == 1
+ jnc L(even) C size % 2 == 0
+
+ ALIGN(16)
+L(oop):
+M4pre(` notl_or_xorl_GMP_NUMB_MASK(r1)')
+ M4_inst (vp), r1
+ lea 8(up), up
+ mov -4(up), r2
+M4post(` notl_or_xorl_GMP_NUMB_MASK(r1)')
+ lea 8(vp), vp
+ mov r1, (rp)
+L(entry):
+M4pre(` notl_or_xorl_GMP_NUMB_MASK(r2)')
+ M4_inst -4(vp), r2
+ lea 8(rp), rp
+M4post(` notl_or_xorl_GMP_NUMB_MASK(r2)')
+ dec cnt
+ mov (up), r1
+ mov r2, -4(rp)
+ jnz L(oop)
+
+L(end):
+M4pre(` notl_or_xorl_GMP_NUMB_MASK(r1)')
+ mov SAVE_UP, up
+ M4_inst (vp), r1
+M4post(`notl_or_xorl_GMP_NUMB_MASK(r1)')
+ mov SAVE_VP, vp
+ mov r1, (rp)
+ mov SAVE_RP, rp
+ ret
+
+L(even):
+ mov r1, r2
+ lea 4(up), up
+ lea 4(vp), vp
+ lea -4(rp), rp
+ jmp L(entry)
+EPILOGUE()
+ASM_END()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/atom/lshift.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/atom/lshift.asm
new file mode 100644
index 00000000000..f2c70dd3e85
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/atom/lshift.asm
@@ -0,0 +1,218 @@
+dnl Intel Atom mpn_lshift -- mpn left shift.
+
+dnl Copyright 2011 Free Software Foundation, Inc.
+
+dnl Contributed to the GNU project by Torbjorn Granlund and Marco Bodrato.
+
+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 mp_limb_t mpn_lshift (mp_ptr dst, mp_srcptr src, mp_size_t size,
+C unsigned cnt);
+
+C cycles/limb
+C cnt!=1 cnt==1
+C P5
+C P6 model 0-8,10-12
+C P6 model 9 (Banias)
+C P6 model 13 (Dothan)
+C P4 model 0 (Willamette)
+C P4 model 1 (?)
+C P4 model 2 (Northwood)
+C P4 model 3 (Prescott)
+C P4 model 4 (Nocona)
+C Intel Atom 5 2.5
+C AMD K6
+C AMD K7
+C AMD K8
+C AMD K10
+
+defframe(PARAM_CNT, 16)
+defframe(PARAM_SIZE,12)
+defframe(PARAM_SRC, 8)
+defframe(PARAM_DST, 4)
+
+dnl re-use parameter space
+define(SAVE_UP,`PARAM_CNT')
+define(VAR_COUNT,`PARAM_SIZE')
+define(SAVE_EBX,`PARAM_SRC')
+define(SAVE_EBP,`PARAM_DST')
+
+define(`rp', `%edi')
+define(`up', `%esi')
+define(`cnt', `%ecx')
+
+ASM_START()
+ TEXT
+ ALIGN(8)
+deflit(`FRAME',0)
+PROLOGUE(mpn_lshift)
+ mov PARAM_CNT, cnt
+ mov PARAM_SIZE, %edx
+ mov up, SAVE_UP
+ mov PARAM_SRC, up
+ push rp FRAME_pushl()
+ mov PARAM_DST, rp
+
+C We can use faster code for shift-by-1 under certain conditions.
+ cmp $1,cnt
+ jne L(normal)
+ cmpl rp, up
+ jnc L(special) C jump if s_ptr + 1 >= res_ptr
+ leal (up,%edx,4),%eax
+ cmpl %eax,rp
+ jnc L(special) C jump if res_ptr >= s_ptr + size
+
+L(normal):
+ lea -4(up,%edx,4), up
+ mov %ebx, SAVE_EBX
+ lea -4(rp,%edx,4), rp
+
+ shr %edx
+ mov (up), %eax
+ mov %edx, VAR_COUNT
+ jnc L(evn)
+
+ mov %eax, %ebx
+ shl %cl, %ebx
+ neg cnt
+ shr %cl, %eax
+ test %edx, %edx
+ jnz L(gt1)
+ mov %ebx, (rp)
+ jmp L(quit)
+
+L(gt1): mov %ebp, SAVE_EBP
+ push %eax
+ mov -4(up), %eax
+ mov %eax, %ebp
+ shr %cl, %eax
+ jmp L(lo1)
+
+L(evn): mov %ebp, SAVE_EBP
+ neg cnt
+ mov %eax, %ebp
+ mov -4(up), %edx
+ shr %cl, %eax
+ mov %edx, %ebx
+ shr %cl, %edx
+ neg cnt
+ decl VAR_COUNT
+ lea 4(rp), rp
+ lea -4(up), up
+ jz L(end)
+ push %eax FRAME_pushl()
+
+ ALIGN(8)
+L(top): shl %cl, %ebp
+ or %ebp, %edx
+ shl %cl, %ebx
+ neg cnt
+ mov -4(up), %eax
+ mov %eax, %ebp
+ mov %edx, -4(rp)
+ shr %cl, %eax
+ lea -8(rp), rp
+L(lo1): mov -8(up), %edx
+ or %ebx, %eax
+ mov %edx, %ebx
+ shr %cl, %edx
+ lea -8(up), up
+ neg cnt
+ mov %eax, (rp)
+ decl VAR_COUNT
+ jg L(top)
+
+ pop %eax FRAME_popl()
+L(end):
+ shl %cl, %ebp
+ shl %cl, %ebx
+ or %ebp, %edx
+ mov SAVE_EBP, %ebp
+ mov %edx, -4(rp)
+ mov %ebx, -8(rp)
+
+L(quit):
+ mov SAVE_UP, up
+ mov SAVE_EBX, %ebx
+ pop rp FRAME_popl()
+ ret
+
+L(special):
+deflit(`FRAME',4)
+ lea 3(%edx), %eax C size + 3
+ dec %edx C size - 1
+ mov (up), %ecx
+ shr $2, %eax C (size + 3) / 4
+ and $3, %edx C (size - 1) % 4
+ jz L(goloop) C jmp if size == 1 (mod 4)
+ shr %edx
+ jnc L(odd) C jum if size == 3 (mod 4)
+
+ add %ecx, %ecx
+ lea 4(up), up
+ mov %ecx, (rp)
+ mov (up), %ecx
+ lea 4(rp), rp
+
+ dec %edx
+ jnz L(goloop) C jump if size == 0 (mod 4)
+L(odd): lea -8(up), up
+ lea -8(rp), rp
+ jmp L(sentry) C reached if size == 2 or 3 (mod 4)
+
+L(sloop):
+ adc %ecx, %ecx
+ mov 4(up), %edx
+ mov %ecx, (rp)
+ adc %edx, %edx
+ mov 8(up), %ecx
+ mov %edx, 4(rp)
+L(sentry):
+ adc %ecx, %ecx
+ mov 12(up), %edx
+ mov %ecx, 8(rp)
+ adc %edx, %edx
+ lea 16(up), up
+ mov %edx, 12(rp)
+ lea 16(rp), rp
+ mov (up), %ecx
+L(goloop):
+ decl %eax
+ jnz L(sloop)
+
+L(squit):
+ adc %ecx, %ecx
+ mov %ecx, (rp)
+ adc %eax, %eax
+
+ mov SAVE_UP, up
+ pop rp FRAME_popl()
+ ret
+EPILOGUE()
+ASM_END()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/atom/lshiftc.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/atom/lshiftc.asm
new file mode 100644
index 00000000000..5be53ed19d4
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/atom/lshiftc.asm
@@ -0,0 +1,159 @@
+dnl Intel Atom mpn_lshiftc -- mpn left shift with complement.
+
+dnl Copyright 2011 Free Software Foundation, Inc.
+
+dnl Contributed to the GNU project by Torbjorn Granlund and Marco Bodrato.
+
+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 mp_limb_t mpn_lshiftc (mp_ptr dst, mp_srcptr src, mp_size_t size,
+C unsigned cnt);
+
+C cycles/limb
+C P5
+C P6 model 0-8,10-12
+C P6 model 9 (Banias)
+C P6 model 13 (Dothan)
+C P4 model 0 (Willamette)
+C P4 model 1 (?)
+C P4 model 2 (Northwood)
+C P4 model 3 (Prescott)
+C P4 model 4 (Nocona)
+C Intel Atom 5.5
+C AMD K6
+C AMD K7
+C AMD K8
+C AMD K10
+
+defframe(PARAM_CNT, 16)
+defframe(PARAM_SIZE,12)
+defframe(PARAM_SRC, 8)
+defframe(PARAM_DST, 4)
+
+dnl re-use parameter space
+define(SAVE_UP,`PARAM_CNT')
+define(VAR_COUNT,`PARAM_SIZE')
+define(SAVE_EBX,`PARAM_SRC')
+define(SAVE_EBP,`PARAM_DST')
+
+define(`rp', `%edi')
+define(`up', `%esi')
+define(`cnt', `%ecx')
+
+ASM_START()
+ TEXT
+
+PROLOGUE(mpn_lshiftc)
+deflit(`FRAME',0)
+ mov PARAM_CNT, cnt
+ mov PARAM_SIZE, %edx
+ mov up, SAVE_UP
+ mov PARAM_SRC, up
+ push rp FRAME_pushl()
+ mov PARAM_DST, rp
+
+ lea -4(up,%edx,4), up
+ mov %ebx, SAVE_EBX
+ lea -4(rp,%edx,4), rp
+
+ shr %edx
+ mov (up), %eax
+ mov %edx, VAR_COUNT
+ jnc L(evn)
+
+ mov %eax, %ebx
+ shl %cl, %ebx
+ neg cnt
+ shr %cl, %eax
+ test %edx, %edx
+ jnz L(gt1)
+ not %ebx
+ mov %ebx, (rp)
+ jmp L(quit)
+
+L(gt1): mov %ebp, SAVE_EBP
+ push %eax
+ mov -4(up), %eax
+ mov %eax, %ebp
+ shr %cl, %eax
+ jmp L(lo1)
+
+L(evn): mov %ebp, SAVE_EBP
+ neg cnt
+ mov %eax, %ebp
+ mov -4(up), %edx
+ shr %cl, %eax
+ mov %edx, %ebx
+ shr %cl, %edx
+ neg cnt
+ decl VAR_COUNT
+ lea 4(rp), rp
+ lea -4(up), up
+ jz L(end)
+ push %eax FRAME_pushl()
+
+L(top): shl %cl, %ebp
+ or %ebp, %edx
+ shl %cl, %ebx
+ neg cnt
+ not %edx
+ mov -4(up), %eax
+ mov %eax, %ebp
+ mov %edx, -4(rp)
+ shr %cl, %eax
+ lea -8(rp), rp
+L(lo1): mov -8(up), %edx
+ or %ebx, %eax
+ mov %edx, %ebx
+ shr %cl, %edx
+ not %eax
+ lea -8(up), up
+ neg cnt
+ mov %eax, (rp)
+ decl VAR_COUNT
+ jg L(top)
+
+ pop %eax FRAME_popl()
+L(end):
+ shl %cl, %ebp
+ shl %cl, %ebx
+ or %ebp, %edx
+ mov SAVE_EBP, %ebp
+ not %edx
+ not %ebx
+ mov %edx, -4(rp)
+ mov %ebx, -8(rp)
+
+L(quit):
+ mov SAVE_UP, up
+ mov SAVE_EBX, %ebx
+ pop rp FRAME_popl()
+ ret
+EPILOGUE()
+ASM_END()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/atom/mmx/copyd.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/atom/mmx/copyd.asm
new file mode 100644
index 00000000000..b80fb033fec
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/atom/mmx/copyd.asm
@@ -0,0 +1,34 @@
+dnl Intel Atom mpn_copyd -- copy limb vector, decrementing.
+
+dnl Copyright 2011 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_copyd)
+include_mpn(`x86/k7/mmx/copyd.asm')
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/atom/mmx/copyi.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/atom/mmx/copyi.asm
new file mode 100644
index 00000000000..49b6b8d662e
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/atom/mmx/copyi.asm
@@ -0,0 +1,34 @@
+dnl Intel Atom mpn_copyi -- copy limb vector, incrementing.
+
+dnl Copyright 2011 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_copyi)
+include_mpn(`x86/k7/mmx/copyi.asm')
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/atom/mmx/hamdist.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/atom/mmx/hamdist.asm
new file mode 100644
index 00000000000..3fe82532404
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/atom/mmx/hamdist.asm
@@ -0,0 +1,34 @@
+dnl Intel Atom mpn_hamdist -- hamming distance.
+
+dnl Copyright 2011 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_hamdist)
+include_mpn(`x86/k7/mmx/popham.asm')
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/atom/mod_34lsub1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/atom/mod_34lsub1.asm
new file mode 100644
index 00000000000..6d57ba385df
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/atom/mod_34lsub1.asm
@@ -0,0 +1,34 @@
+dnl Intel Atom mpn_mod_34lsub1 -- remainder modulo 2^24-1.
+
+dnl Copyright 2011 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_mod_34lsub1)
+include_mpn(`x86/p6/mod_34lsub1.asm')
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/atom/mode1o.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/atom/mode1o.asm
new file mode 100644
index 00000000000..c9ee6bd2db3
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/atom/mode1o.asm
@@ -0,0 +1,34 @@
+dnl Intel Atom mpn_modexact_1_odd -- exact division style remainder.
+
+dnl Copyright 2011 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_modexact_1_odd mpn_modexact_1c_odd)
+include_mpn(`x86/pentium/mode1o.asm')
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/atom/rshift.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/atom/rshift.asm
new file mode 100644
index 00000000000..1cb5dbefe9b
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/atom/rshift.asm
@@ -0,0 +1,152 @@
+dnl Intel Atom mpn_rshift -- mpn right shift.
+
+dnl Copyright 2011 Free Software Foundation, Inc.
+
+dnl Converted from AMD64 by Marco Bodrato.
+
+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 mp_limb_t mpn_rshift (mp_ptr dst, mp_srcptr src, mp_size_t size,
+C unsigned cnt);
+
+C cycles/limb
+C P5
+C P6 model 0-8,10-12
+C P6 model 9 (Banias)
+C P6 model 13 (Dothan)
+C P4 model 0 (Willamette)
+C P4 model 1 (?)
+C P4 model 2 (Northwood)
+C P4 model 3 (Prescott)
+C P4 model 4 (Nocona)
+C Intel Atom 5
+C AMD K6
+C AMD K7
+C AMD K8
+C AMD K10
+
+defframe(PARAM_CNT, 16)
+defframe(PARAM_SIZE,12)
+defframe(PARAM_SRC, 8)
+defframe(PARAM_DST, 4)
+
+dnl re-use parameter space
+define(SAVE_UP,`PARAM_CNT')
+define(VAR_COUNT,`PARAM_SIZE')
+define(SAVE_EBX,`PARAM_SRC')
+define(SAVE_EBP,`PARAM_DST')
+
+define(`rp', `%edi')
+define(`up', `%esi')
+define(`cnt', `%ecx')
+
+ASM_START()
+ TEXT
+ ALIGN(8)
+deflit(`FRAME',0)
+PROLOGUE(mpn_rshift)
+ mov PARAM_CNT, cnt
+ mov PARAM_SIZE, %edx
+ mov up, SAVE_UP
+ mov PARAM_SRC, up
+ push rp FRAME_pushl()
+ mov PARAM_DST, rp
+ mov %ebx, SAVE_EBX
+
+ shr %edx
+ mov (up), %eax
+ mov %edx, VAR_COUNT
+ jnc L(evn)
+
+ mov %eax, %ebx
+ shr %cl, %ebx
+ neg cnt
+ shl %cl, %eax
+ test %edx, %edx
+ jnz L(gt1)
+ mov %ebx, (rp)
+ jmp L(quit)
+
+L(gt1): mov %ebp, SAVE_EBP
+ push %eax
+ mov 4(up), %eax
+ mov %eax, %ebp
+ shl %cl, %eax
+ jmp L(lo1)
+
+L(evn): mov %ebp, SAVE_EBP
+ neg cnt
+ mov %eax, %ebp
+ mov 4(up), %edx
+ shl %cl, %eax
+ mov %edx, %ebx
+ shl %cl, %edx
+ neg cnt
+ decl VAR_COUNT
+ lea -4(rp), rp
+ lea 4(up), up
+ jz L(end)
+ push %eax FRAME_pushl()
+
+ ALIGN(8)
+L(top): shr %cl, %ebp
+ or %ebp, %edx
+ shr %cl, %ebx
+ neg cnt
+ mov 4(up), %eax
+ mov %eax, %ebp
+ mov %edx, 4(rp)
+ shl %cl, %eax
+ lea 8(rp), rp
+L(lo1): mov 8(up), %edx
+ or %ebx, %eax
+ mov %edx, %ebx
+ shl %cl, %edx
+ lea 8(up), up
+ neg cnt
+ mov %eax, (rp)
+ decl VAR_COUNT
+ jg L(top)
+
+ pop %eax FRAME_popl()
+L(end):
+ shr %cl, %ebp
+ shr %cl, %ebx
+ or %ebp, %edx
+ mov SAVE_EBP, %ebp
+ mov %edx, 4(rp)
+ mov %ebx, 8(rp)
+
+L(quit):
+ mov SAVE_UP, up
+ mov SAVE_EBX, %ebx
+ pop rp FRAME_popl()
+ ret
+EPILOGUE()
+ASM_END()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/atom/sse2/aorsmul_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/atom/sse2/aorsmul_1.asm
new file mode 100644
index 00000000000..969a14a9196
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/atom/sse2/aorsmul_1.asm
@@ -0,0 +1,174 @@
+dnl x86-32 mpn_addmul_1 and mpn_submul_1 optimised for Intel Atom.
+
+dnl Contributed to the GNU project by Torbjorn Granlund and Marco Bodrato.
+
+dnl Copyright 2011 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 cycles/limb
+C P5 -
+C P6 model 0-8,10-12 -
+C P6 model 9 (Banias)
+C P6 model 13 (Dothan)
+C P4 model 0 (Willamette)
+C P4 model 1 (?)
+C P4 model 2 (Northwood)
+C P4 model 3 (Prescott)
+C P4 model 4 (Nocona)
+C Intel Atom 8
+C AMD K6
+C AMD K7 -
+C AMD K8
+C AMD K10
+
+define(`rp', `%edi')
+define(`up', `%esi')
+define(`n', `%ecx')
+
+ifdef(`OPERATION_addmul_1',`
+ define(ADDSUB, add)
+ define(func_1, mpn_addmul_1)
+ define(func_1c, mpn_addmul_1c)')
+ifdef(`OPERATION_submul_1',`
+ define(ADDSUB, sub)
+ define(func_1, mpn_submul_1)
+ define(func_1c, mpn_submul_1c)')
+
+MULFUNC_PROLOGUE(mpn_addmul_1 mpn_addmul_1c mpn_submul_1 mpn_submul_1c)
+
+ TEXT
+ ALIGN(16)
+PROLOGUE(func_1)
+ xor %edx, %edx
+L(ent): push %edi
+ push %esi
+ push %ebx
+ mov 16(%esp), rp
+ mov 20(%esp), up
+ mov 24(%esp), n
+ movd 28(%esp), %mm7
+ test $1, n
+ jz L(fi0or2)
+ movd (up), %mm0
+ pmuludq %mm7, %mm0
+ shr $2, n
+ jnc L(fi1)
+
+L(fi3): lea -8(up), up
+ lea -8(rp), rp
+ movd 12(up), %mm1
+ movd %mm0, %ebx
+ pmuludq %mm7, %mm1
+ add $1, n C increment and clear carry
+ jmp L(lo3)
+
+L(fi1): movd %mm0, %ebx
+ jz L(wd1)
+ movd 4(up), %mm1
+ pmuludq %mm7, %mm1
+ jmp L(lo1)
+
+L(fi0or2):
+ movd (up), %mm1
+ pmuludq %mm7, %mm1
+ shr $2, n
+ movd 4(up), %mm0
+ jc L(fi2)
+ lea -4(up), up
+ lea -4(rp), rp
+ movd %mm1, %eax
+ pmuludq %mm7, %mm0
+ jmp L(lo0)
+
+L(fi2): lea 4(up), up
+ add $1, n C increment and clear carry
+ movd %mm1, %eax
+ lea -12(rp), rp
+ jmp L(lo2)
+
+C ALIGN(16) C alignment seems irrelevant
+L(top): movd 4(up), %mm1
+ adc $0, %edx
+ ADDSUB %eax, 12(rp)
+ movd %mm0, %ebx
+ pmuludq %mm7, %mm1
+ lea 16(rp), rp
+L(lo1): psrlq $32, %mm0
+ adc %edx, %ebx
+ movd %mm0, %edx
+ movd %mm1, %eax
+ movd 8(up), %mm0
+ pmuludq %mm7, %mm0
+ adc $0, %edx
+ ADDSUB %ebx, (rp)
+L(lo0): psrlq $32, %mm1
+ adc %edx, %eax
+ movd %mm1, %edx
+ movd %mm0, %ebx
+ movd 12(up), %mm1
+ pmuludq %mm7, %mm1
+ adc $0, %edx
+ ADDSUB %eax, 4(rp)
+L(lo3): psrlq $32, %mm0
+ adc %edx, %ebx
+ movd %mm0, %edx
+ movd %mm1, %eax
+ lea 16(up), up
+ movd (up), %mm0
+ adc $0, %edx
+ ADDSUB %ebx, 8(rp)
+L(lo2): psrlq $32, %mm1
+ adc %edx, %eax
+ movd %mm1, %edx
+ pmuludq %mm7, %mm0
+ dec n
+ jnz L(top)
+
+L(end): adc n, %edx C n is zero here
+ ADDSUB %eax, 12(rp)
+ movd %mm0, %ebx
+ lea 16(rp), rp
+L(wd1): psrlq $32, %mm0
+ adc %edx, %ebx
+ movd %mm0, %eax
+ adc n, %eax
+ ADDSUB %ebx, (rp)
+ emms
+ adc n, %eax
+ pop %ebx
+ pop %esi
+ pop %edi
+ ret
+EPILOGUE()
+PROLOGUE(func_1c)
+ mov 20(%esp), %edx C carry
+ jmp L(ent)
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/atom/sse2/bdiv_dbm1c.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/atom/sse2/bdiv_dbm1c.asm
new file mode 100644
index 00000000000..782e914019c
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/atom/sse2/bdiv_dbm1c.asm
@@ -0,0 +1,34 @@
+dnl Intel Atom mpn_bdiv_dbm1.
+
+dnl Copyright 2011 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_dbm1c)
+include_mpn(`x86/pentium4/sse2/bdiv_dbm1c.asm')
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/atom/sse2/divrem_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/atom/sse2/divrem_1.asm
new file mode 100644
index 00000000000..f84709a22e4
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/atom/sse2/divrem_1.asm
@@ -0,0 +1,34 @@
+dnl Intel Atom mpn_divrem_1 -- mpn by limb division.
+
+dnl Copyright 2011 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_preinv_divrem_1 mpn_divrem_1c mpn_divrem_1)
+include_mpn(`x86/pentium4/sse2/divrem_1.asm')
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/atom/sse2/mod_1_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/atom/sse2/mod_1_1.asm
new file mode 100644
index 00000000000..ae6581d9b65
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/atom/sse2/mod_1_1.asm
@@ -0,0 +1,34 @@
+dnl Intel Atom/SSE2 mpn_mod_1_1.
+
+dnl Copyright 2009, 2011 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_mod_1_1p)
+include_mpn(`x86/pentium4/sse2/mod_1_1.asm')
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/atom/sse2/mod_1_4.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/atom/sse2/mod_1_4.asm
new file mode 100644
index 00000000000..31faa3f0a3c
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/atom/sse2/mod_1_4.asm
@@ -0,0 +1,34 @@
+dnl Intel Atom/SSE2 mpn_mod_1_4.
+
+dnl Copyright 2009, 2011 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_mod_1s_4p)
+include_mpn(`x86/pentium4/sse2/mod_1_4.asm')
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/atom/sse2/mul_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/atom/sse2/mul_1.asm
new file mode 100644
index 00000000000..aa3bb974bb5
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/atom/sse2/mul_1.asm
@@ -0,0 +1,124 @@
+dnl Intel Atom mpn_mul_1.
+
+dnl Contributed to the GNU project by Torbjorn Granlund and Marco Bodrato.
+
+dnl Copyright 2011 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 cycles/limb
+C P5 -
+C P6 model 0-8,10-12 -
+C P6 model 9 (Banias)
+C P6 model 13 (Dothan)
+C P4 model 0 (Willamette)
+C P4 model 1 (?)
+C P4 model 2 (Northwood)
+C P4 model 3 (Prescott)
+C P4 model 4 (Nocona)
+C Intel Atom 7.5
+C AMD K6 -
+C AMD K7 -
+C AMD K8
+C AMD K10
+
+defframe(PARAM_CARRY,20)
+defframe(PARAM_MUL, 16)
+defframe(PARAM_SIZE, 12)
+defframe(PARAM_SRC, 8)
+defframe(PARAM_DST, 4)
+
+define(`rp', `%edx')
+define(`up', `%esi')
+define(`n', `%ecx')
+
+ASM_START()
+ TEXT
+ ALIGN(16)
+deflit(`FRAME',0)
+
+PROLOGUE(mpn_mul_1c)
+ movd PARAM_CARRY, %mm6 C carry
+ jmp L(ent)
+EPILOGUE()
+
+ ALIGN(8) C for compact code
+PROLOGUE(mpn_mul_1)
+ pxor %mm6, %mm6
+L(ent): push %esi FRAME_pushl()
+ mov PARAM_SRC, up
+ mov PARAM_SIZE, %eax C size
+ movd PARAM_MUL, %mm7
+ movd (up), %mm0
+ mov %eax, n
+ and $3, %eax
+ pmuludq %mm7, %mm0
+ mov PARAM_DST, rp
+ jz L(lo0)
+ cmp $2, %eax
+ lea -16(up,%eax,4),up
+ lea -16(rp,%eax,4),rp
+ jc L(lo1)
+ jz L(lo2)
+ jmp L(lo3)
+
+ ALIGN(16)
+L(top): movd (up), %mm0
+ pmuludq %mm7, %mm0
+ psrlq $32, %mm6
+ lea 16(rp), rp
+L(lo0): paddq %mm0, %mm6
+ movd 4(up), %mm0
+ pmuludq %mm7, %mm0
+ movd %mm6, (rp)
+ psrlq $32, %mm6
+L(lo3): paddq %mm0, %mm6
+ movd 8(up), %mm0
+ pmuludq %mm7, %mm0
+ movd %mm6, 4(rp)
+ psrlq $32, %mm6
+L(lo2): paddq %mm0, %mm6
+ movd 12(up), %mm0
+ pmuludq %mm7, %mm0
+ movd %mm6, 8(rp)
+ psrlq $32, %mm6
+L(lo1): paddq %mm0, %mm6
+ sub $4, n
+ movd %mm6, 12(rp)
+ lea 16(up), up
+ ja L(top)
+
+ psrlq $32, %mm6
+ movd %mm6, %eax
+ emms
+ pop %esi FRAME_popl()
+ ret
+EPILOGUE()
+ASM_END()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/atom/sse2/mul_basecase.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/atom/sse2/mul_basecase.asm
new file mode 100644
index 00000000000..97d3aeb5ad7
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/atom/sse2/mul_basecase.asm
@@ -0,0 +1,501 @@
+dnl x86 mpn_mul_basecase -- Multiply two limb vectors and store the result in
+dnl a third limb vector.
+
+dnl Contributed to the GNU project by Torbjorn Granlund and Marco Bodrato.
+
+dnl Copyright 2011 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 TODO
+C * Check if 'jmp N(%esp)' is well-predicted enough to allow us to combine the
+C 4 large loops into one; we could use it for the outer loop branch.
+C * Optimise code outside of inner loops.
+C * Write combined addmul_1 feed-in a wind-down code, and use when iterating
+C outer each loop. ("Overlapping software pipelining")
+C * Postpone push of ebx until we know vn > 1. Perhaps use caller-saves regs
+C for inlined mul_1, allowing us to postpone all pushes.
+C * Perhaps write special code for vn <= un < M, for some small M.
+
+C void mpn_mul_basecase (mp_ptr wp,
+C mp_srcptr xp, mp_size_t xn,
+C mp_srcptr yp, mp_size_t yn);
+C
+
+define(`rp', `%edi')
+define(`up', `%esi')
+define(`un', `%ecx')
+define(`vp', `%ebp')
+define(`vn', `36(%esp)')
+
+ TEXT
+ ALIGN(16)
+PROLOGUE(mpn_mul_basecase)
+ push %edi
+ push %esi
+ push %ebx
+ push %ebp
+ mov 20(%esp), rp
+ mov 24(%esp), up
+ mov 28(%esp), un
+ mov 32(%esp), vp
+
+ movd (up), %mm0
+ movd (vp), %mm7
+ pmuludq %mm7, %mm0
+ pxor %mm6, %mm6
+
+ mov un, %eax
+ and $3, %eax
+ jz L(of0)
+ cmp $2, %eax
+ jc L(of1)
+ jz L(of2)
+
+C ================================================================
+ jmp L(m3)
+ ALIGN(16)
+L(lm3): movd -4(up), %mm0
+ pmuludq %mm7, %mm0
+ psrlq $32, %mm6
+ lea 16(rp), rp
+ paddq %mm0, %mm6
+ movd (up), %mm0
+ pmuludq %mm7, %mm0
+ movd %mm6, -4(rp)
+ psrlq $32, %mm6
+L(m3): paddq %mm0, %mm6
+ movd 4(up), %mm0
+ pmuludq %mm7, %mm0
+ movd %mm6, (rp)
+ psrlq $32, %mm6
+ paddq %mm0, %mm6
+ movd 8(up), %mm0
+ pmuludq %mm7, %mm0
+ movd %mm6, 4(rp)
+ psrlq $32, %mm6
+ paddq %mm0, %mm6
+ sub $4, un
+ movd %mm6, 8(rp)
+ lea 16(up), up
+ ja L(lm3)
+
+ psrlq $32, %mm6
+ movd %mm6, 12(rp)
+
+ decl vn
+ jz L(done)
+ lea -8(rp), rp
+
+L(ol3): mov 28(%esp), un
+ neg un
+ lea 4(vp), vp
+ movd (vp), %mm7 C read next V limb
+ mov 24(%esp), up
+ lea 16(rp,un,4), rp
+
+ movd (up), %mm0
+ pmuludq %mm7, %mm0
+ sar $2, un
+ movd 4(up), %mm1
+ movd %mm0, %ebx
+ pmuludq %mm7, %mm1
+ lea -8(up), up
+ xor %edx, %edx C zero edx and CF
+ jmp L(a3)
+
+L(la3): movd 4(up), %mm1
+ adc $0, %edx
+ add %eax, 12(rp)
+ movd %mm0, %ebx
+ pmuludq %mm7, %mm1
+ lea 16(rp), rp
+ psrlq $32, %mm0
+ adc %edx, %ebx
+ movd %mm0, %edx
+ movd %mm1, %eax
+ movd 8(up), %mm0
+ pmuludq %mm7, %mm0
+ adc $0, %edx
+ add %ebx, (rp)
+ psrlq $32, %mm1
+ adc %edx, %eax
+ movd %mm1, %edx
+ movd %mm0, %ebx
+ movd 12(up), %mm1
+ pmuludq %mm7, %mm1
+ adc $0, %edx
+ add %eax, 4(rp)
+L(a3): psrlq $32, %mm0
+ adc %edx, %ebx
+ movd %mm0, %edx
+ movd %mm1, %eax
+ lea 16(up), up
+ movd (up), %mm0
+ adc $0, %edx
+ add %ebx, 8(rp)
+ psrlq $32, %mm1
+ adc %edx, %eax
+ movd %mm1, %edx
+ pmuludq %mm7, %mm0
+ inc un
+ jnz L(la3)
+
+ adc un, %edx C un is zero here
+ add %eax, 12(rp)
+ movd %mm0, %ebx
+ psrlq $32, %mm0
+ adc %edx, %ebx
+ movd %mm0, %eax
+ adc un, %eax
+ add %ebx, 16(rp)
+ adc un, %eax
+ mov %eax, 20(rp)
+
+ decl vn
+ jnz L(ol3)
+ jmp L(done)
+
+C ================================================================
+ ALIGN(16)
+L(lm0): movd (up), %mm0
+ pmuludq %mm7, %mm0
+ psrlq $32, %mm6
+ lea 16(rp), rp
+L(of0): paddq %mm0, %mm6
+ movd 4(up), %mm0
+ pmuludq %mm7, %mm0
+ movd %mm6, (rp)
+ psrlq $32, %mm6
+ paddq %mm0, %mm6
+ movd 8(up), %mm0
+ pmuludq %mm7, %mm0
+ movd %mm6, 4(rp)
+ psrlq $32, %mm6
+ paddq %mm0, %mm6
+ movd 12(up), %mm0
+ pmuludq %mm7, %mm0
+ movd %mm6, 8(rp)
+ psrlq $32, %mm6
+ paddq %mm0, %mm6
+ sub $4, un
+ movd %mm6, 12(rp)
+ lea 16(up), up
+ ja L(lm0)
+
+ psrlq $32, %mm6
+ movd %mm6, 16(rp)
+
+ decl vn
+ jz L(done)
+ lea -4(rp), rp
+
+L(ol0): mov 28(%esp), un
+ neg un
+ lea 4(vp), vp
+ movd (vp), %mm7 C read next V limb
+ mov 24(%esp), up
+ lea 20(rp,un,4), rp
+
+ movd (up), %mm1
+ pmuludq %mm7, %mm1
+ sar $2, un
+ movd 4(up), %mm0
+ lea -4(up), up
+ movd %mm1, %eax
+ pmuludq %mm7, %mm0
+ xor %edx, %edx C zero edx and CF
+ jmp L(a0)
+
+L(la0): movd 4(up), %mm1
+ adc $0, %edx
+ add %eax, 12(rp)
+ movd %mm0, %ebx
+ pmuludq %mm7, %mm1
+ lea 16(rp), rp
+ psrlq $32, %mm0
+ adc %edx, %ebx
+ movd %mm0, %edx
+ movd %mm1, %eax
+ movd 8(up), %mm0
+ pmuludq %mm7, %mm0
+ adc $0, %edx
+ add %ebx, (rp)
+L(a0): psrlq $32, %mm1
+ adc %edx, %eax
+ movd %mm1, %edx
+ movd %mm0, %ebx
+ movd 12(up), %mm1
+ pmuludq %mm7, %mm1
+ adc $0, %edx
+ add %eax, 4(rp)
+ psrlq $32, %mm0
+ adc %edx, %ebx
+ movd %mm0, %edx
+ movd %mm1, %eax
+ lea 16(up), up
+ movd (up), %mm0
+ adc $0, %edx
+ add %ebx, 8(rp)
+ psrlq $32, %mm1
+ adc %edx, %eax
+ movd %mm1, %edx
+ pmuludq %mm7, %mm0
+ inc un
+ jnz L(la0)
+
+ adc un, %edx C un is zero here
+ add %eax, 12(rp)
+ movd %mm0, %ebx
+ psrlq $32, %mm0
+ adc %edx, %ebx
+ movd %mm0, %eax
+ adc un, %eax
+ add %ebx, 16(rp)
+ adc un, %eax
+ mov %eax, 20(rp)
+
+ decl vn
+ jnz L(ol0)
+ jmp L(done)
+
+C ================================================================
+ ALIGN(16)
+L(lm1): movd -12(up), %mm0
+ pmuludq %mm7, %mm0
+ psrlq $32, %mm6
+ lea 16(rp), rp
+ paddq %mm0, %mm6
+ movd -8(up), %mm0
+ pmuludq %mm7, %mm0
+ movd %mm6, -12(rp)
+ psrlq $32, %mm6
+ paddq %mm0, %mm6
+ movd -4(up), %mm0
+ pmuludq %mm7, %mm0
+ movd %mm6, -8(rp)
+ psrlq $32, %mm6
+ paddq %mm0, %mm6
+ movd (up), %mm0
+ pmuludq %mm7, %mm0
+ movd %mm6, -4(rp)
+ psrlq $32, %mm6
+L(of1): paddq %mm0, %mm6
+ sub $4, un
+ movd %mm6, (rp)
+ lea 16(up), up
+ ja L(lm1)
+
+ psrlq $32, %mm6
+ movd %mm6, 4(rp)
+
+ decl vn
+ jz L(done)
+ lea -16(rp), rp
+
+L(ol1): mov 28(%esp), un
+ neg un
+ lea 4(vp), vp
+ movd (vp), %mm7 C read next V limb
+ mov 24(%esp), up
+ lea 24(rp,un,4), rp
+
+ movd (up), %mm0
+ pmuludq %mm7, %mm0
+ sar $2, un
+ movd %mm0, %ebx
+ movd 4(up), %mm1
+ pmuludq %mm7, %mm1
+ xor %edx, %edx C zero edx and CF
+ inc un
+ jmp L(a1)
+
+L(la1): movd 4(up), %mm1
+ adc $0, %edx
+ add %eax, 12(rp)
+ movd %mm0, %ebx
+ pmuludq %mm7, %mm1
+ lea 16(rp), rp
+L(a1): psrlq $32, %mm0
+ adc %edx, %ebx
+ movd %mm0, %edx
+ movd %mm1, %eax
+ movd 8(up), %mm0
+ pmuludq %mm7, %mm0
+ adc $0, %edx
+ add %ebx, (rp)
+ psrlq $32, %mm1
+ adc %edx, %eax
+ movd %mm1, %edx
+ movd %mm0, %ebx
+ movd 12(up), %mm1
+ pmuludq %mm7, %mm1
+ adc $0, %edx
+ add %eax, 4(rp)
+ psrlq $32, %mm0
+ adc %edx, %ebx
+ movd %mm0, %edx
+ movd %mm1, %eax
+ lea 16(up), up
+ movd (up), %mm0
+ adc $0, %edx
+ add %ebx, 8(rp)
+ psrlq $32, %mm1
+ adc %edx, %eax
+ movd %mm1, %edx
+ pmuludq %mm7, %mm0
+ inc un
+ jnz L(la1)
+
+ adc un, %edx C un is zero here
+ add %eax, 12(rp)
+ movd %mm0, %ebx
+ psrlq $32, %mm0
+ adc %edx, %ebx
+ movd %mm0, %eax
+ adc un, %eax
+ add %ebx, 16(rp)
+ adc un, %eax
+ mov %eax, 20(rp)
+
+ decl vn
+ jnz L(ol1)
+ jmp L(done)
+
+C ================================================================
+ ALIGN(16)
+L(lm2): movd -8(up), %mm0
+ pmuludq %mm7, %mm0
+ psrlq $32, %mm6
+ lea 16(rp), rp
+ paddq %mm0, %mm6
+ movd -4(up), %mm0
+ pmuludq %mm7, %mm0
+ movd %mm6, -8(rp)
+ psrlq $32, %mm6
+ paddq %mm0, %mm6
+ movd (up), %mm0
+ pmuludq %mm7, %mm0
+ movd %mm6, -4(rp)
+ psrlq $32, %mm6
+L(of2): paddq %mm0, %mm6
+ movd 4(up), %mm0
+ pmuludq %mm7, %mm0
+ movd %mm6, (rp)
+ psrlq $32, %mm6
+ paddq %mm0, %mm6
+ sub $4, un
+ movd %mm6, 4(rp)
+ lea 16(up), up
+ ja L(lm2)
+
+ psrlq $32, %mm6
+ movd %mm6, 8(rp)
+
+ decl vn
+ jz L(done)
+ lea -12(rp), rp
+
+L(ol2): mov 28(%esp), un
+ neg un
+ lea 4(vp), vp
+ movd (vp), %mm7 C read next V limb
+ mov 24(%esp), up
+ lea 12(rp,un,4), rp
+
+ movd (up), %mm1
+ pmuludq %mm7, %mm1
+ sar $2, un
+ movd 4(up), %mm0
+ lea 4(up), up
+ movd %mm1, %eax
+ xor %edx, %edx C zero edx and CF
+ jmp L(lo2)
+
+L(la2): movd 4(up), %mm1
+ adc $0, %edx
+ add %eax, 12(rp)
+ movd %mm0, %ebx
+ pmuludq %mm7, %mm1
+ lea 16(rp), rp
+ psrlq $32, %mm0
+ adc %edx, %ebx
+ movd %mm0, %edx
+ movd %mm1, %eax
+ movd 8(up), %mm0
+ pmuludq %mm7, %mm0
+ adc $0, %edx
+ add %ebx, (rp)
+ psrlq $32, %mm1
+ adc %edx, %eax
+ movd %mm1, %edx
+ movd %mm0, %ebx
+ movd 12(up), %mm1
+ pmuludq %mm7, %mm1
+ adc $0, %edx
+ add %eax, 4(rp)
+ psrlq $32, %mm0
+ adc %edx, %ebx
+ movd %mm0, %edx
+ movd %mm1, %eax
+ lea 16(up), up
+ movd (up), %mm0
+ adc $0, %edx
+ add %ebx, 8(rp)
+L(lo2): psrlq $32, %mm1
+ adc %edx, %eax
+ movd %mm1, %edx
+ pmuludq %mm7, %mm0
+ inc un
+ jnz L(la2)
+
+ adc un, %edx C un is zero here
+ add %eax, 12(rp)
+ movd %mm0, %ebx
+ psrlq $32, %mm0
+ adc %edx, %ebx
+ movd %mm0, %eax
+ adc un, %eax
+ add %ebx, 16(rp)
+ adc un, %eax
+ mov %eax, 20(rp)
+
+ decl vn
+ jnz L(ol2)
+C jmp L(done)
+
+C ================================================================
+L(done):
+ emms
+ pop %ebp
+ pop %ebx
+ pop %esi
+ pop %edi
+ ret
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/atom/sse2/popcount.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/atom/sse2/popcount.asm
new file mode 100644
index 00000000000..7847aec8e66
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/atom/sse2/popcount.asm
@@ -0,0 +1,35 @@
+dnl Intel Atom mpn_popcount -- population count.
+
+dnl Copyright 2011 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_popcount)
+include_mpn(`x86/pentium4/sse2/popcount.asm')
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/atom/sse2/sqr_basecase.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/atom/sse2/sqr_basecase.asm
new file mode 100644
index 00000000000..af19ed854d9
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/atom/sse2/sqr_basecase.asm
@@ -0,0 +1,634 @@
+dnl x86 mpn_sqr_basecase -- square an mpn number, optimised for atom.
+
+dnl Contributed to the GNU project by Torbjorn Granlund and Marco Bodrato.
+
+dnl Copyright 2011 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 TODO
+C * Check if 'jmp N(%esp)' is well-predicted enough to allow us to combine the
+C 4 large loops into one; we could use it for the outer loop branch.
+C * Optimise code outside of inner loops.
+C * Write combined addmul_1 feed-in a wind-down code, and use when iterating
+C outer each loop. ("Overlapping software pipelining")
+C * Perhaps use caller-saves regs for inlined mul_1, allowing us to postpone
+C all pushes.
+C * Perhaps write special code for n < M, for some small M.
+C * Replace inlined addmul_1 with smaller code from aorsmul_1.asm, or perhaps
+C with even less pipelined code.
+C * We run the outer loop until we have a 2-limb by 1-limb addmul_1 left.
+C Consider breaking out earlier, saving high the cost of short loops.
+
+C void mpn_sqr_basecase (mp_ptr wp,
+C mp_srcptr xp, mp_size_t xn);
+
+define(`rp', `%edi')
+define(`up', `%esi')
+define(`n', `%ecx')
+
+define(`un', `%ebp')
+
+ TEXT
+ ALIGN(16)
+PROLOGUE(mpn_sqr_basecase)
+ push %edi
+ push %esi
+ mov 12(%esp), rp
+ mov 16(%esp), up
+ mov 20(%esp), n
+
+ lea 4(rp), rp C write triangular product starting at rp[1]
+ dec n
+ movd (up), %mm7
+
+ jz L(one)
+ lea 4(up), up
+ push %ebx
+ push %ebp
+ mov n, %eax
+
+ movd (up), %mm0
+ neg n
+ pmuludq %mm7, %mm0
+ pxor %mm6, %mm6
+ mov n, un
+
+ and $3, %eax
+ jz L(of0)
+ cmp $2, %eax
+ jc L(of1)
+ jz L(of2)
+
+C ================================================================
+ jmp L(m3)
+ ALIGN(16)
+L(lm3): movd -4(up), %mm0
+ pmuludq %mm7, %mm0
+ psrlq $32, %mm6
+ lea 16(rp), rp
+ paddq %mm0, %mm6
+ movd (up), %mm0
+ pmuludq %mm7, %mm0
+ movd %mm6, -4(rp)
+ psrlq $32, %mm6
+L(m3): paddq %mm0, %mm6
+ movd 4(up), %mm0
+ pmuludq %mm7, %mm0
+ movd %mm6, (rp)
+ psrlq $32, %mm6
+ paddq %mm0, %mm6
+ movd 8(up), %mm0
+ pmuludq %mm7, %mm0
+ movd %mm6, 4(rp)
+ psrlq $32, %mm6
+ paddq %mm0, %mm6
+ add $4, un
+ movd %mm6, 8(rp)
+ lea 16(up), up
+ js L(lm3)
+
+ psrlq $32, %mm6
+ movd %mm6, 12(rp)
+
+ inc n
+C jz L(done)
+ lea -12(up), up
+ lea 4(rp), rp
+ jmp L(ol2)
+
+C ================================================================
+ ALIGN(16)
+L(lm0): movd (up), %mm0
+ pmuludq %mm7, %mm0
+ psrlq $32, %mm6
+ lea 16(rp), rp
+L(of0): paddq %mm0, %mm6
+ movd 4(up), %mm0
+ pmuludq %mm7, %mm0
+ movd %mm6, (rp)
+ psrlq $32, %mm6
+ paddq %mm0, %mm6
+ movd 8(up), %mm0
+ pmuludq %mm7, %mm0
+ movd %mm6, 4(rp)
+ psrlq $32, %mm6
+ paddq %mm0, %mm6
+ movd 12(up), %mm0
+ pmuludq %mm7, %mm0
+ movd %mm6, 8(rp)
+ psrlq $32, %mm6
+ paddq %mm0, %mm6
+ add $4, un
+ movd %mm6, 12(rp)
+ lea 16(up), up
+ js L(lm0)
+
+ psrlq $32, %mm6
+ movd %mm6, 16(rp)
+
+ inc n
+C jz L(done)
+ lea -8(up), up
+ lea 8(rp), rp
+ jmp L(ol3)
+
+C ================================================================
+ ALIGN(16)
+L(lm1): movd -12(up), %mm0
+ pmuludq %mm7, %mm0
+ psrlq $32, %mm6
+ lea 16(rp), rp
+ paddq %mm0, %mm6
+ movd -8(up), %mm0
+ pmuludq %mm7, %mm0
+ movd %mm6, -12(rp)
+ psrlq $32, %mm6
+ paddq %mm0, %mm6
+ movd -4(up), %mm0
+ pmuludq %mm7, %mm0
+ movd %mm6, -8(rp)
+ psrlq $32, %mm6
+ paddq %mm0, %mm6
+ movd (up), %mm0
+ pmuludq %mm7, %mm0
+ movd %mm6, -4(rp)
+ psrlq $32, %mm6
+L(of1): paddq %mm0, %mm6
+ add $4, un
+ movd %mm6, (rp)
+ lea 16(up), up
+ js L(lm1)
+
+ psrlq $32, %mm6
+ movd %mm6, 4(rp)
+
+ inc n
+ jz L(done) C goes away when we add special n=2 code
+ lea -20(up), up
+ lea -4(rp), rp
+ jmp L(ol0)
+
+C ================================================================
+ ALIGN(16)
+L(lm2): movd -8(up), %mm0
+ pmuludq %mm7, %mm0
+ psrlq $32, %mm6
+ lea 16(rp), rp
+ paddq %mm0, %mm6
+ movd -4(up), %mm0
+ pmuludq %mm7, %mm0
+ movd %mm6, -8(rp)
+ psrlq $32, %mm6
+ paddq %mm0, %mm6
+ movd (up), %mm0
+ pmuludq %mm7, %mm0
+ movd %mm6, -4(rp)
+ psrlq $32, %mm6
+L(of2): paddq %mm0, %mm6
+ movd 4(up), %mm0
+ pmuludq %mm7, %mm0
+ movd %mm6, (rp)
+ psrlq $32, %mm6
+ paddq %mm0, %mm6
+ add $4, un
+ movd %mm6, 4(rp)
+ lea 16(up), up
+ js L(lm2)
+
+ psrlq $32, %mm6
+ movd %mm6, 8(rp)
+
+ inc n
+C jz L(done)
+ lea -16(up), up
+C lea (rp), rp
+C jmp L(ol1)
+
+C ================================================================
+
+L(ol1): lea 4(up,n,4), up
+ movd (up), %mm7 C read next U invariant limb
+ lea 8(rp,n,4), rp
+ mov n, un
+
+ movd 4(up), %mm1
+ pmuludq %mm7, %mm1
+ sar $2, un
+ movd %mm1, %ebx
+ inc un
+ jz L(re1)
+
+ movd 8(up), %mm0
+ pmuludq %mm7, %mm0
+ xor %edx, %edx C zero edx and CF
+ jmp L(a1)
+
+L(la1): adc $0, %edx
+ add %ebx, 12(rp)
+ movd %mm0, %eax
+ pmuludq %mm7, %mm1
+ lea 16(rp), rp
+ psrlq $32, %mm0
+ adc %edx, %eax
+ movd %mm0, %edx
+ movd %mm1, %ebx
+ movd 8(up), %mm0
+ pmuludq %mm7, %mm0
+ adc $0, %edx
+ add %eax, (rp)
+L(a1): psrlq $32, %mm1
+ adc %edx, %ebx
+ movd %mm1, %edx
+ movd %mm0, %eax
+ movd 12(up), %mm1
+ pmuludq %mm7, %mm1
+ adc $0, %edx
+ add %ebx, 4(rp)
+ psrlq $32, %mm0
+ adc %edx, %eax
+ movd %mm0, %edx
+ movd %mm1, %ebx
+ lea 16(up), up
+ movd (up), %mm0
+ adc $0, %edx
+ add %eax, 8(rp)
+ psrlq $32, %mm1
+ adc %edx, %ebx
+ movd %mm1, %edx
+ pmuludq %mm7, %mm0
+ inc un
+ movd 4(up), %mm1
+ jnz L(la1)
+
+ adc un, %edx C un is zero here
+ add %ebx, 12(rp)
+ movd %mm0, %eax
+ pmuludq %mm7, %mm1
+ lea 16(rp), rp
+ psrlq $32, %mm0
+ adc %edx, %eax
+ movd %mm0, %edx
+ movd %mm1, %ebx
+ adc un, %edx
+ add %eax, (rp)
+ psrlq $32, %mm1
+ adc %edx, %ebx
+ movd %mm1, %eax
+ adc un, %eax
+ add %ebx, 4(rp)
+ adc un, %eax
+ mov %eax, 8(rp)
+
+ inc n
+
+C ================================================================
+
+L(ol0): lea (up,n,4), up
+ movd 4(up), %mm7 C read next U invariant limb
+ lea 4(rp,n,4), rp
+ mov n, un
+
+ movd 8(up), %mm0
+ pmuludq %mm7, %mm0
+ sar $2, un
+ movd 12(up), %mm1
+ movd %mm0, %eax
+ pmuludq %mm7, %mm1
+ xor %edx, %edx C zero edx and CF
+ jmp L(a0)
+
+L(la0): adc $0, %edx
+ add %ebx, 12(rp)
+ movd %mm0, %eax
+ pmuludq %mm7, %mm1
+ lea 16(rp), rp
+ psrlq $32, %mm0
+ adc %edx, %eax
+ movd %mm0, %edx
+ movd %mm1, %ebx
+ movd 8(up), %mm0
+ pmuludq %mm7, %mm0
+ adc $0, %edx
+ add %eax, (rp)
+ psrlq $32, %mm1
+ adc %edx, %ebx
+ movd %mm1, %edx
+ movd %mm0, %eax
+ movd 12(up), %mm1
+ pmuludq %mm7, %mm1
+ adc $0, %edx
+ add %ebx, 4(rp)
+L(a0): psrlq $32, %mm0
+ adc %edx, %eax
+ movd %mm0, %edx
+ movd %mm1, %ebx
+ lea 16(up), up
+ movd (up), %mm0
+ adc $0, %edx
+ add %eax, 8(rp)
+ psrlq $32, %mm1
+ adc %edx, %ebx
+ movd %mm1, %edx
+ pmuludq %mm7, %mm0
+ inc un
+ movd 4(up), %mm1
+ jnz L(la0)
+
+ adc un, %edx C un is zero here
+ add %ebx, 12(rp)
+ movd %mm0, %eax
+ pmuludq %mm7, %mm1
+ lea 16(rp), rp
+ psrlq $32, %mm0
+ adc %edx, %eax
+ movd %mm0, %edx
+ movd %mm1, %ebx
+ adc un, %edx
+ add %eax, (rp)
+ psrlq $32, %mm1
+ adc %edx, %ebx
+ movd %mm1, %eax
+ adc un, %eax
+ add %ebx, 4(rp)
+ adc un, %eax
+ mov %eax, 8(rp)
+
+ inc n
+
+C ================================================================
+
+L(ol3): lea 12(up,n,4), up
+ movd -8(up), %mm7 C read next U invariant limb
+ lea (rp,n,4), rp C put rp back
+ mov n, un
+
+ movd -4(up), %mm1
+ pmuludq %mm7, %mm1
+ sar $2, un
+ movd %mm1, %ebx
+ movd (up), %mm0
+ xor %edx, %edx C zero edx and CF
+ jmp L(a3)
+
+L(la3): adc $0, %edx
+ add %ebx, 12(rp)
+ movd %mm0, %eax
+ pmuludq %mm7, %mm1
+ lea 16(rp), rp
+ psrlq $32, %mm0
+ adc %edx, %eax
+ movd %mm0, %edx
+ movd %mm1, %ebx
+ movd 8(up), %mm0
+ pmuludq %mm7, %mm0
+ adc $0, %edx
+ add %eax, (rp)
+ psrlq $32, %mm1
+ adc %edx, %ebx
+ movd %mm1, %edx
+ movd %mm0, %eax
+ movd 12(up), %mm1
+ pmuludq %mm7, %mm1
+ adc $0, %edx
+ add %ebx, 4(rp)
+ psrlq $32, %mm0
+ adc %edx, %eax
+ movd %mm0, %edx
+ movd %mm1, %ebx
+ lea 16(up), up
+ movd (up), %mm0
+ adc $0, %edx
+ add %eax, 8(rp)
+L(a3): psrlq $32, %mm1
+ adc %edx, %ebx
+ movd %mm1, %edx
+ pmuludq %mm7, %mm0
+ inc un
+ movd 4(up), %mm1
+ jnz L(la3)
+
+ adc un, %edx C un is zero here
+ add %ebx, 12(rp)
+ movd %mm0, %eax
+ pmuludq %mm7, %mm1
+ lea 16(rp), rp
+ psrlq $32, %mm0
+ adc %edx, %eax
+ movd %mm0, %edx
+ movd %mm1, %ebx
+ adc un, %edx
+ add %eax, (rp)
+ psrlq $32, %mm1
+ adc %edx, %ebx
+ movd %mm1, %eax
+ adc un, %eax
+ add %ebx, 4(rp)
+ adc un, %eax
+ mov %eax, 8(rp)
+
+ inc n
+
+C ================================================================
+
+L(ol2): lea 8(up,n,4), up
+ movd -4(up), %mm7 C read next U invariant limb
+ lea 12(rp,n,4), rp
+ mov n, un
+
+ movd (up), %mm0
+ pmuludq %mm7, %mm0
+ xor %edx, %edx
+ sar $2, un
+ movd 4(up), %mm1
+ test un, un C clear carry
+ movd %mm0, %eax
+ pmuludq %mm7, %mm1
+ inc un
+ jnz L(a2)
+ jmp L(re2)
+
+L(la2): adc $0, %edx
+ add %ebx, 12(rp)
+ movd %mm0, %eax
+ pmuludq %mm7, %mm1
+ lea 16(rp), rp
+L(a2): psrlq $32, %mm0
+ adc %edx, %eax
+ movd %mm0, %edx
+ movd %mm1, %ebx
+ movd 8(up), %mm0
+ pmuludq %mm7, %mm0
+ adc $0, %edx
+ add %eax, (rp)
+ psrlq $32, %mm1
+ adc %edx, %ebx
+ movd %mm1, %edx
+ movd %mm0, %eax
+ movd 12(up), %mm1
+ pmuludq %mm7, %mm1
+ adc $0, %edx
+ add %ebx, 4(rp)
+ psrlq $32, %mm0
+ adc %edx, %eax
+ movd %mm0, %edx
+ movd %mm1, %ebx
+ lea 16(up), up
+ movd (up), %mm0
+ adc $0, %edx
+ add %eax, 8(rp)
+ psrlq $32, %mm1
+ adc %edx, %ebx
+ movd %mm1, %edx
+ pmuludq %mm7, %mm0
+ inc un
+ movd 4(up), %mm1
+ jnz L(la2)
+
+ adc un, %edx C un is zero here
+ add %ebx, 12(rp)
+ movd %mm0, %eax
+ pmuludq %mm7, %mm1
+ lea 16(rp), rp
+ psrlq $32, %mm0
+ adc %edx, %eax
+ movd %mm0, %edx
+ movd %mm1, %ebx
+ adc un, %edx
+ add %eax, (rp)
+ psrlq $32, %mm1
+ adc %edx, %ebx
+ movd %mm1, %eax
+ adc un, %eax
+ add %ebx, 4(rp)
+ adc un, %eax
+ mov %eax, 8(rp)
+
+ inc n
+ jmp L(ol1)
+
+C ================================================================
+L(re2): psrlq $32, %mm0
+ movd (up), %mm7 C read next U invariant limb
+ adc %edx, %eax
+ movd %mm0, %edx
+ movd %mm1, %ebx
+ adc un, %edx
+ add %eax, (rp)
+ lea 4(rp), rp
+ psrlq $32, %mm1
+ adc %edx, %ebx
+ movd %mm1, %eax
+ movd 4(up), %mm1
+ adc un, %eax
+ add %ebx, (rp)
+ pmuludq %mm7, %mm1
+ adc un, %eax
+ mov %eax, 4(rp)
+ movd %mm1, %ebx
+
+L(re1): psrlq $32, %mm1
+ add %ebx, 4(rp)
+ movd %mm1, %eax
+ adc un, %eax
+ xor n, n C make n zeroness assumption below true
+ mov %eax, 8(rp)
+
+L(done): C n is zero here
+ mov 24(%esp), up
+ mov 28(%esp), %eax
+
+ movd (up), %mm0
+ inc %eax
+ pmuludq %mm0, %mm0
+ lea 4(up), up
+ mov 20(%esp), rp
+ shr %eax
+ movd %mm0, (rp)
+ psrlq $32, %mm0
+ lea -12(rp), rp
+ mov %eax, 28(%esp)
+ jnc L(odd)
+
+ movd %mm0, %ebp
+ movd (up), %mm0
+ lea 8(rp), rp
+ pmuludq %mm0, %mm0
+ lea -4(up), up
+ add 8(rp), %ebp
+ movd %mm0, %edx
+ adc 12(rp), %edx
+ rcr n
+ jmp L(ent)
+
+C ALIGN(16) C alignment seems irrelevant
+L(top): movd (up), %mm1
+ adc n, n
+ movd %mm0, %eax
+ pmuludq %mm1, %mm1
+ movd 4(up), %mm0
+ adc (rp), %eax
+ movd %mm1, %ebx
+ pmuludq %mm0, %mm0
+ psrlq $32, %mm1
+ adc 4(rp), %ebx
+ movd %mm1, %ebp
+ movd %mm0, %edx
+ adc 8(rp), %ebp
+ adc 12(rp), %edx
+ rcr n C FIXME: isn't this awfully slow on atom???
+ adc %eax, (rp)
+ adc %ebx, 4(rp)
+L(ent): lea 8(up), up
+ adc %ebp, 8(rp)
+ psrlq $32, %mm0
+ adc %edx, 12(rp)
+L(odd): decl 28(%esp)
+ lea 16(rp), rp
+ jnz L(top)
+
+L(end): adc n, n
+ movd %mm0, %eax
+ adc n, %eax
+ mov %eax, (rp)
+
+L(rtn): emms
+ pop %ebp
+ pop %ebx
+ pop %esi
+ pop %edi
+ ret
+
+L(one): pmuludq %mm7, %mm7
+ movq %mm7, -4(rp)
+ emms
+ pop %esi
+ pop %edi
+ ret
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/atom/sublsh1_n.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/atom/sublsh1_n.asm
new file mode 100644
index 00000000000..d3e7e5b5cbd
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/atom/sublsh1_n.asm
@@ -0,0 +1,34 @@
+dnl Intel Atom mpn_sublsh1_n -- rp[] = up[] - (vp[] << 1)
+
+dnl Copyright 2011 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_sublsh1_n_ip1)
+include_mpn(`x86/k7/sublsh1_n.asm')
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/atom/sublsh2_n.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/atom/sublsh2_n.asm
new file mode 100644
index 00000000000..79405cf9f4b
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/atom/sublsh2_n.asm
@@ -0,0 +1,57 @@
+dnl Intel Atom mpn_addlsh2_n/mpn_sublsh2_n -- rp[] = up[] +- (vp[] << 2).
+
+dnl Contributed to the GNU project by Marco Bodrato.
+
+dnl Copyright 2011 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, 30)
+
+ifdef(`OPERATION_addlsh2_n', `
+ define(M4_inst, adcl)
+ define(M4_opp, subl)
+ define(M4_function, mpn_addlsh2_n)
+ define(M4_function_c, mpn_addlsh2_nc)
+ define(M4_ip_function_c, mpn_addlsh2_nc_ip1)
+ define(M4_ip_function, mpn_addlsh2_n_ip1)
+',`ifdef(`OPERATION_sublsh2_n', `
+ define(M4_inst, sbbl)
+ define(M4_opp, addl)
+ define(M4_function, mpn_sublsh2_n)
+ define(M4_function_c, mpn_sublsh2_nc)
+ define(M4_ip_function_c, mpn_sublsh2_nc_ip1)
+ define(M4_ip_function, mpn_sublsh2_n_ip1)
+',`m4_error(`Need OPERATION_addlsh2_n or OPERATION_sublsh2_n
+')')')
+
+MULFUNC_PROLOGUE(mpn_sublsh2_n mpn_sublsh2_nc mpn_sublsh2_n_ip1 mpn_sublsh2_nc_ip1)
+
+include_mpn(`x86/atom/aorslshC_n.asm')
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/bd1/gmp-mparam.h b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/bd1/gmp-mparam.h
new file mode 100644
index 00000000000..7d80a1cb4c0
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/bd1/gmp-mparam.h
@@ -0,0 +1,208 @@
+/* AMD bd2 gmp-mparam.h -- Compiler/machine parameter header file.
+
+Copyright 1991, 1993, 1994, 2000-2005, 2008-2010, 2014 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
+
+/* 3600 MHz Bulldozer Zambezi */
+/* FFT tuning limit = 25000000 */
+/* Generated by tuneup.c, 2014-03-13, gcc 4.5 */
+
+#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 4
+#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 11
+#define USE_PREINV_DIVREM_1 1 /* native */
+#define DIV_QR_1N_PI1_METHOD 1
+#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 27
+
+#define MUL_TOOM22_THRESHOLD 32
+#define MUL_TOOM33_THRESHOLD 65
+#define MUL_TOOM44_THRESHOLD 154
+#define MUL_TOOM6H_THRESHOLD 230
+#define MUL_TOOM8H_THRESHOLD 354
+
+#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_TOOM43_TO_TOOM54_THRESHOLD 130
+
+#define SQR_BASECASE_THRESHOLD 0 /* always (native) */
+#define SQR_TOOM2_THRESHOLD 48
+#define SQR_TOOM3_THRESHOLD 87
+#define SQR_TOOM4_THRESHOLD 204
+#define SQR_TOOM6_THRESHOLD 315
+#define SQR_TOOM8_THRESHOLD 430
+
+#define MULMID_TOOM42_THRESHOLD 48
+
+#define MULMOD_BNM1_THRESHOLD 21
+#define SQRMOD_BNM1_THRESHOLD 23
+
+#define MUL_FFT_MODF_THRESHOLD 840 /* k = 5 */
+#define MUL_FFT_TABLE3 \
+ { { 840, 5}, { 28, 6}, { 15, 5}, { 33, 6}, \
+ { 28, 7}, { 15, 6}, { 32, 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}, \
+ { 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}, \
+ { 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
+
+#define SQR_FFT_MODF_THRESHOLD 690 /* 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}, \
+ { 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}, \
+ { 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
+
+#define MULLO_BASECASE_THRESHOLD 5
+#define MULLO_DC_THRESHOLD 31
+#define MULLO_MUL_N_THRESHOLD 14709
+
+#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 INV_MULMOD_BNM1_THRESHOLD 78
+#define INV_NEWTON_THRESHOLD 202
+#define INV_APPR_THRESHOLD 202
+
+#define BINV_NEWTON_THRESHOLD 236
+#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 POWM_SEC_TABLE 1,22,194,376,692,2657
+
+#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 GCDEXT_DC_THRESHOLD 345
+#define JACOBI_BASE_METHOD 4
+
+#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
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/bd2/gmp-mparam.h b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/bd2/gmp-mparam.h
new file mode 100644
index 00000000000..c5a53f2f9f7
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/bd2/gmp-mparam.h
@@ -0,0 +1,209 @@
+/* AMD bd2 gmp-mparam.h -- Compiler/machine parameter header file.
+
+Copyright 1991, 1993, 1994, 2000-2005, 2008-2010, 2014 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
+
+/* 4000 MHz Piledriver Vishera */
+/* FFT tuning limit = 40000000 */
+/* Generated by tuneup.c, 2014-03-12, gcc 4.8 */
+
+#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_2_TO_MOD_1_4_THRESHOLD 0 /* never mpn_mod_1s_2p */
+#define PREINV_MOD_1_TO_MOD_1_THRESHOLD 10
+#define USE_PREINV_DIVREM_1 1 /* native */
+#define DIV_QR_1N_PI1_METHOD 1
+#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 24
+
+#define MUL_TOOM22_THRESHOLD 30
+#define MUL_TOOM33_THRESHOLD 81
+#define MUL_TOOM44_THRESHOLD 153
+#define MUL_TOOM6H_THRESHOLD 222
+#define MUL_TOOM8H_THRESHOLD 357
+
+#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_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 MULMID_TOOM42_THRESHOLD 68
+
+#define MULMOD_BNM1_THRESHOLD 19
+#define SQRMOD_BNM1_THRESHOLD 22
+
+#define MUL_FFT_MODF_THRESHOLD 636 /* k = 5 */
+#define MUL_FFT_TABLE3 \
+ { { 636, 5}, { 27, 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}, { 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}, \
+ { 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
+#define MUL_FFT_THRESHOLD 6784
+
+#define SQR_FFT_MODF_THRESHOLD 606 /* 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}, \
+ { 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
+#define SQR_FFT_THRESHOLD 5760
+
+#define MULLO_BASECASE_THRESHOLD 3
+#define MULLO_DC_THRESHOLD 34
+#define MULLO_MUL_N_THRESHOLD 13463
+
+#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 INV_MULMOD_BNM1_THRESHOLD 70
+#define INV_NEWTON_THRESHOLD 262
+#define INV_APPR_THRESHOLD 222
+
+#define BINV_NEWTON_THRESHOLD 288
+#define REDC_1_TO_REDC_N_THRESHOLD 67
+
+#define MU_DIV_QR_THRESHOLD 1718
+#define MU_DIVAPPR_Q_THRESHOLD 1652
+#define MUPI_DIV_QR_THRESHOLD 122
+#define MU_BDIV_QR_THRESHOLD 1387
+#define MU_BDIV_Q_THRESHOLD 1528
+
+#define POWM_SEC_TABLE 1,16,69,508,1378,2657,2825
+
+#define MATRIX22_STRASSEN_THRESHOLD 19
+#define HGCD_THRESHOLD 61
+#define HGCD_APPR_THRESHOLD 50
+#define HGCD_REDUCE_THRESHOLD 3389
+#define GCD_DC_THRESHOLD 492
+#define GCDEXT_DC_THRESHOLD 345
+#define JACOBI_BASE_METHOD 4
+
+#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
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/bdiv_dbm1c.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/bdiv_dbm1c.asm
new file mode 100644
index 00000000000..0288c475cdc
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/bdiv_dbm1c.asm
@@ -0,0 +1,129 @@
+dnl x86 mpn_bdiv_dbm1.
+
+dnl Copyright 2008, 2011 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 P5
+C P6 model 0-8,10-12)
+C P6 model 9 (Banias)
+C P6 model 13 (Dothan) 5.1
+C P4 model 0 (Willamette)
+C P4 model 1 (?)
+C P4 model 2 (Northwood) 13.67
+C P4 model 3 (Prescott)
+C P4 model 4 (Nocona)
+C Intel Atom
+C AMD K6
+C AMD K7 3.5
+C AMD K8
+C AMD K10
+
+
+C TODO
+C * Optimize for more x86 processors
+
+ASM_START()
+ TEXT
+ ALIGN(16)
+PROLOGUE(mpn_bdiv_dbm1c)
+ mov 16(%esp), %ecx C d
+ push %esi
+ mov 12(%esp), %esi C ap
+ push %edi
+ mov 12(%esp), %edi C qp
+ push %ebp
+ mov 24(%esp), %ebp C n
+ push %ebx
+
+ mov (%esi), %eax
+ mul %ecx
+ mov 36(%esp), %ebx
+ sub %eax, %ebx
+ mov %ebx, (%edi)
+ sbb %edx, %ebx
+
+ mov %ebp, %eax
+ and $3, %eax
+ jz L(b0)
+ cmp $2, %eax
+ jc L(b1)
+ jz L(b2)
+
+L(b3): lea -8(%esi), %esi
+ lea 8(%edi), %edi
+ add $-3, %ebp
+ jmp L(3)
+
+L(b0): mov 4(%esi), %eax
+ lea -4(%esi), %esi
+ lea 12(%edi), %edi
+ add $-4, %ebp
+ jmp L(0)
+
+L(b2): mov 4(%esi), %eax
+ lea 4(%esi), %esi
+ lea 4(%edi), %edi
+ add $-2, %ebp
+ jmp L(2)
+
+ ALIGN(8)
+L(top): mov 4(%esi), %eax
+ mul %ecx
+ lea 16(%edi), %edi
+ sub %eax, %ebx
+ mov 8(%esi), %eax
+ mov %ebx, -12(%edi)
+ sbb %edx, %ebx
+L(0): mul %ecx
+ sub %eax, %ebx
+ mov %ebx, -8(%edi)
+ sbb %edx, %ebx
+L(3): mov 12(%esi), %eax
+ mul %ecx
+ sub %eax, %ebx
+ mov %ebx, -4(%edi)
+ mov 16(%esi), %eax
+ lea 16(%esi), %esi
+ sbb %edx, %ebx
+L(2): mul %ecx
+ sub %eax, %ebx
+ mov %ebx, 0(%edi)
+ sbb %edx, %ebx
+L(b1): add $-4, %ebp
+ jns L(top)
+
+ mov %ebx, %eax
+ pop %ebx
+ pop %ebp
+ pop %edi
+ pop %esi
+ ret
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/bdiv_q_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/bdiv_q_1.asm
new file mode 100644
index 00000000000..825cd296a1f
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/bdiv_q_1.asm
@@ -0,0 +1,208 @@
+dnl x86 mpn_bdiv_q_1 -- mpn by limb exact division.
+
+dnl Rearranged from mpn/x86/dive_1.asm by Marco Bodrato.
+
+dnl Copyright 2001, 2002, 2007, 2011 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 P54 30.0
+C P55 29.0
+C P6 13.0 odd divisor, 12.0 even (strangely)
+C K6 14.0
+C K7 12.0
+C P4 42.0
+
+MULFUNC_PROLOGUE(mpn_bdiv_q_1 mpn_pi1_bdiv_q_1)
+
+defframe(PARAM_SHIFT, 24)
+defframe(PARAM_INVERSE,20)
+defframe(PARAM_DIVISOR,16)
+defframe(PARAM_SIZE, 12)
+defframe(PARAM_SRC, 8)
+defframe(PARAM_DST, 4)
+
+dnl re-use parameter space
+define(VAR_INVERSE,`PARAM_SRC')
+
+ TEXT
+
+C mp_limb_t
+C mpn_pi1_bdiv_q_1 (mp_ptr dst, mp_srcptr src, mp_size_t size, mp_limb_t divisor,
+C mp_limb_t inverse, int shift)
+
+ ALIGN(16)
+PROLOGUE(mpn_pi1_bdiv_q_1)
+deflit(`FRAME',0)
+
+ movl PARAM_SHIFT, %ecx
+ pushl %ebp FRAME_pushl()
+
+ movl PARAM_INVERSE, %eax
+ movl PARAM_SIZE, %ebp
+ pushl %ebx FRAME_pushl()
+L(common):
+ pushl %edi FRAME_pushl()
+ pushl %esi FRAME_pushl()
+
+ movl PARAM_SRC, %esi
+ movl PARAM_DST, %edi
+
+ leal (%esi,%ebp,4), %esi C src end
+ leal (%edi,%ebp,4), %edi C dst end
+ negl %ebp C -size
+
+ movl %eax, VAR_INVERSE
+ movl (%esi,%ebp,4), %eax C src[0]
+
+ xorl %ebx, %ebx
+ xorl %edx, %edx
+
+ incl %ebp
+ jz L(one)
+
+ movl (%esi,%ebp,4), %edx C src[1]
+
+ shrdl( %cl, %edx, %eax)
+
+ movl VAR_INVERSE, %edx
+ jmp L(entry)
+
+
+ ALIGN(8)
+ nop C k6 code alignment
+ nop
+L(top):
+ C eax q
+ C ebx carry bit, 0 or -1
+ C ecx shift
+ C edx carry limb
+ C esi src end
+ C edi dst end
+ C ebp counter, limbs, negative
+
+ movl -4(%esi,%ebp,4), %eax
+ subl %ebx, %edx C accumulate carry bit
+
+ movl (%esi,%ebp,4), %ebx
+
+ shrdl( %cl, %ebx, %eax)
+
+ subl %edx, %eax C apply carry limb
+ movl VAR_INVERSE, %edx
+
+ sbbl %ebx, %ebx
+
+L(entry):
+ imull %edx, %eax
+
+ movl %eax, -4(%edi,%ebp,4)
+ movl PARAM_DIVISOR, %edx
+
+ mull %edx
+
+ incl %ebp
+ jnz L(top)
+
+
+ movl -4(%esi), %eax C src high limb
+L(one):
+ shrl %cl, %eax
+ popl %esi FRAME_popl()
+
+ addl %ebx, %eax C apply carry bit
+
+ subl %edx, %eax C apply carry limb
+
+ imull VAR_INVERSE, %eax
+
+ movl %eax, -4(%edi)
+
+ popl %edi
+ popl %ebx
+ popl %ebp
+
+ ret
+
+EPILOGUE()
+
+C mp_limb_t mpn_bdiv_q_1 (mp_ptr dst, mp_srcptr src, mp_size_t size,
+C mp_limb_t divisor);
+C
+
+ ALIGN(16)
+PROLOGUE(mpn_bdiv_q_1)
+deflit(`FRAME',0)
+
+ movl PARAM_DIVISOR, %eax
+ pushl %ebp FRAME_pushl()
+
+ movl $-1, %ecx C shift count
+ movl PARAM_SIZE, %ebp
+
+ pushl %ebx FRAME_pushl()
+
+L(strip_twos):
+ incl %ecx
+
+ shrl %eax
+ jnc L(strip_twos)
+
+ leal 1(%eax,%eax), %ebx C d without twos
+ andl $127, %eax C d/2, 7 bits
+
+ifdef(`PIC',`
+ LEA( binvert_limb_table, %edx)
+ movzbl (%eax,%edx), %eax C inv 8 bits
+',`
+ movzbl binvert_limb_table(%eax), %eax C inv 8 bits
+')
+
+ leal (%eax,%eax), %edx C 2*inv
+ movl %ebx, PARAM_DIVISOR C d without twos
+ imull %eax, %eax C inv*inv
+ imull %ebx, %eax C inv*inv*d
+ subl %eax, %edx C inv = 2*inv - inv*inv*d
+
+ leal (%edx,%edx), %eax C 2*inv
+ imull %edx, %edx C inv*inv
+ imull %ebx, %edx C inv*inv*d
+ subl %edx, %eax C inv = 2*inv - inv*inv*d
+
+ ASSERT(e,` C expect d*inv == 1 mod 2^GMP_LIMB_BITS
+ pushl %eax FRAME_pushl()
+ imull PARAM_DIVISOR, %eax
+ cmpl $1, %eax
+ popl %eax FRAME_popl()')
+
+ jmp L(common)
+EPILOGUE()
+
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/bobcat/gmp-mparam.h b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/bobcat/gmp-mparam.h
new file mode 100644
index 00000000000..198081f9fd8
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/bobcat/gmp-mparam.h
@@ -0,0 +1,197 @@
+/* x86/bobcat gmp-mparam.h -- Compiler/machine parameter header file.
+
+Copyright 1991, 1993, 1994, 2000-2011, 2014 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
+
+/* 1600 MHz AMD Bobcat Zacate E-350 */
+/* FFT tuning limit = 25000000 */
+/* Generated by tuneup.c, 2014-03-12, gcc 4.5 */
+
+#define MOD_1_NORM_THRESHOLD 0 /* always */
+#define MOD_1_UNNORM_THRESHOLD 0 /* always */
+#define MOD_1N_TO_MOD_1_1_THRESHOLD 12
+#define MOD_1U_TO_MOD_1_1_THRESHOLD 5
+#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 16
+#define USE_PREINV_DIVREM_1 1 /* native */
+#define DIV_QR_1N_PI1_METHOD 1
+#define DIV_QR_1_NORM_THRESHOLD 2
+#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 40
+
+#define MUL_TOOM22_THRESHOLD 28
+#define MUL_TOOM33_THRESHOLD 90
+#define MUL_TOOM44_THRESHOLD 154
+#define MUL_TOOM6H_THRESHOLD 270
+#define MUL_TOOM8H_THRESHOLD 490
+
+#define MUL_TOOM32_TO_TOOM43_THRESHOLD 89
+#define MUL_TOOM32_TO_TOOM53_THRESHOLD 107
+#define MUL_TOOM42_TO_TOOM53_THRESHOLD 95
+#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 121
+#define SQR_TOOM4_THRESHOLD 212
+#define SQR_TOOM6_THRESHOLD 303
+#define SQR_TOOM8_THRESHOLD 454
+
+#define MULMID_TOOM42_THRESHOLD 74
+
+#define MULMOD_BNM1_THRESHOLD 18
+#define SQRMOD_BNM1_THRESHOLD 23
+
+#define MUL_FFT_MODF_THRESHOLD 660 /* k = 5 */
+#define MUL_FFT_TABLE3 \
+ { { 660, 5}, { 25, 6}, { 13, 5}, { 27, 6}, \
+ { 27, 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}, { 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}, { 159,11}, \
+ { 95,10}, { 191,12}, { 63,11}, { 127,10}, \
+ { 255, 9}, { 511,10}, { 271, 9}, { 543,11}, \
+ { 159, 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,10}, { 671,12}, { 191,11}, { 383,10}, \
+ { 799, 9}, { 1599,11}, { 415,13}, { 127,12}, \
+ { 255,11}, { 543,10}, { 1087,11}, { 607,10}, \
+ { 1215,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}, { 16384,15}, { 32768,16} }
+#define MUL_FFT_TABLE3_SIZE 139
+#define MUL_FFT_THRESHOLD 7552
+
+#define SQR_FFT_MODF_THRESHOLD 606 /* k = 5 */
+#define SQR_FFT_TABLE3 \
+ { { 606, 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}, { 35, 8}, \
+ { 19, 7}, { 41, 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}, { 103,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}, { 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}, { 383, 9}, { 767,10}, \
+ { 399, 9}, { 799,10}, { 415, 9}, { 831,12}, \
+ { 127,11}, { 255,10}, { 511, 9}, { 1023,10}, \
+ { 543, 9}, { 1087,11}, { 287,10}, { 607, 9}, \
+ { 1215,11}, { 319,10}, { 671, 9}, { 1343,12}, \
+ { 191,11}, { 383,10}, { 799,11}, { 415,10}, \
+ { 831,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}, { 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}, { 1983,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,14}, { 16384,15}, { 32768,16} }
+#define SQR_FFT_TABLE3_SIZE 147
+#define SQR_FFT_THRESHOLD 5760
+
+#define MULLO_BASECASE_THRESHOLD 5
+#define MULLO_DC_THRESHOLD 45
+#define MULLO_MUL_N_THRESHOLD 14281
+
+#define DC_DIV_QR_THRESHOLD 71
+#define DC_DIVAPPR_Q_THRESHOLD 238
+#define DC_BDIV_QR_THRESHOLD 67
+#define DC_BDIV_Q_THRESHOLD 151
+
+#define INV_MULMOD_BNM1_THRESHOLD 66
+#define INV_NEWTON_THRESHOLD 228
+#define INV_APPR_THRESHOLD 222
+
+#define BINV_NEWTON_THRESHOLD 270
+#define REDC_1_TO_REDC_N_THRESHOLD 71
+
+#define MU_DIV_QR_THRESHOLD 1718
+#define MU_DIVAPPR_Q_THRESHOLD 1718
+#define MUPI_DIV_QR_THRESHOLD 91
+#define MU_BDIV_QR_THRESHOLD 1589
+#define MU_BDIV_Q_THRESHOLD 1718
+
+#define POWM_SEC_TABLE 1,16,96,416,1185
+
+#define MATRIX22_STRASSEN_THRESHOLD 17
+#define HGCD_THRESHOLD 88
+#define HGCD_APPR_THRESHOLD 137
+#define HGCD_REDUCE_THRESHOLD 3664
+#define GCD_DC_THRESHOLD 465
+#define GCDEXT_DC_THRESHOLD 345
+#define JACOBI_BASE_METHOD 4
+
+#define GET_STR_DC_THRESHOLD 18
+#define GET_STR_PRECOMPUTE_THRESHOLD 34
+#define SET_STR_DC_THRESHOLD 270
+#define SET_STR_PRECOMPUTE_THRESHOLD 828
+
+#define FAC_DSC_THRESHOLD 256
+#define FAC_ODD_THRESHOLD 34
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/cnd_aors_n.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/cnd_aors_n.asm
new file mode 100644
index 00000000000..74f4917ecc4
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/cnd_aors_n.asm
@@ -0,0 +1,124 @@
+dnl X86 mpn_cnd_add_n, mpn_cnd_sub_n
+
+dnl Copyright 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/limb
+C P5 ?
+C P6 model 0-8,10-12 ?
+C P6 model 9 (Banias) ?
+C P6 model 13 (Dothan) 5.4
+C P4 model 0-1 (Willamette) ?
+C P4 model 2 (Northwood) 14.5
+C P4 model 3-4 (Prescott) 21
+C Intel atom 11
+C AMD K6 ?
+C AMD K7 3.4
+C AMD K8 ?
+
+
+define(`rp', `%edi')
+define(`up', `%esi')
+define(`vp', `%ebp')
+define(`n', `%ecx')
+define(`cnd', `20(%esp)')
+define(`cy', `%edx')
+
+ifdef(`OPERATION_cnd_add_n', `
+ define(ADDSUB, add)
+ define(ADCSBB, adc)
+ define(func, mpn_cnd_add_n)')
+ifdef(`OPERATION_cnd_sub_n', `
+ define(ADDSUB, sub)
+ define(ADCSBB, sbb)
+ define(func, mpn_cnd_sub_n)')
+
+MULFUNC_PROLOGUE(mpn_cnd_add_n mpn_cnd_sub_n)
+
+ASM_START()
+ TEXT
+ ALIGN(16)
+PROLOGUE(func)
+ add $-16, %esp
+ mov %ebp, (%esp)
+ mov %ebx, 4(%esp)
+ mov %esi, 8(%esp)
+ mov %edi, 12(%esp)
+
+ C make cnd into a full mask
+ mov cnd, %eax
+ neg %eax
+ sbb %eax, %eax
+ mov %eax, cnd
+
+ C load parameters into registers
+ mov 24(%esp), rp
+ mov 28(%esp), up
+ mov 32(%esp), vp
+ mov 36(%esp), n
+
+ mov (vp), %eax
+ mov (up), %ebx
+
+ C put operand pointers just beyond their last limb
+ lea (vp,n,4), vp
+ lea (up,n,4), up
+ lea -4(rp,n,4), rp
+ neg n
+
+ and cnd, %eax
+ ADDSUB %eax, %ebx
+ sbb cy, cy
+ inc n
+ je L(end)
+
+ ALIGN(16)
+L(top): mov (vp,n,4), %eax
+ and cnd, %eax
+ mov %ebx, (rp,n,4)
+ mov (up,n,4), %ebx
+ add cy, cy
+ ADCSBB %eax, %ebx
+ sbb cy, cy
+ inc n
+ jne L(top)
+
+L(end): mov %ebx, (rp)
+ xor %eax, %eax
+ sub cy, %eax
+
+ mov (%esp), %ebp
+ mov 4(%esp), %ebx
+ mov 8(%esp), %esi
+ mov 12(%esp), %edi
+ add $16, %esp
+ ret
+EPILOGUE()
+ASM_END()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/copyd.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/copyd.asm
new file mode 100644
index 00000000000..51fa19568b0
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/copyd.asm
@@ -0,0 +1,91 @@
+dnl x86 mpn_copyd -- copy limb vector, decrementing.
+
+dnl Copyright 1999-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 cycles/limb startup (approx)
+C P5 1.0 40
+C P6 2.4 70
+C K6 1.0 55
+C K7 1.3 75
+C P4 2.6 175
+C
+C (Startup time includes some function call overheads.)
+
+
+C void mpn_copyd (mp_ptr dst, mp_srcptr src, mp_size_t size);
+C
+C Copy src,size to dst,size, working from high to low addresses.
+C
+C The code here is very generic and can be expected to be reasonable on all
+C the x86 family.
+
+defframe(PARAM_SIZE,12)
+defframe(PARAM_SRC, 8)
+defframe(PARAM_DST, 4)
+deflit(`FRAME',0)
+
+ TEXT
+ ALIGN(32)
+
+PROLOGUE(mpn_copyd)
+ C eax saved esi
+ C ebx
+ C ecx counter
+ C edx saved edi
+ C esi src
+ C edi dst
+ C ebp
+
+ movl PARAM_SIZE, %ecx
+ movl %esi, %eax
+
+ movl PARAM_SRC, %esi
+ movl %edi, %edx
+
+ movl PARAM_DST, %edi
+ leal -4(%esi,%ecx,4), %esi
+
+ leal -4(%edi,%ecx,4), %edi
+
+ std
+
+ rep
+ movsl
+
+ cld
+
+ movl %eax, %esi
+ movl %edx, %edi
+
+ ret
+
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/copyi.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/copyi.asm
new file mode 100644
index 00000000000..f6b0354b4fb
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/copyi.asm
@@ -0,0 +1,99 @@
+dnl x86 mpn_copyi -- copy limb vector, incrementing.
+
+dnl Copyright 1999-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 cycles/limb startup (approx)
+C P5 1.0 35
+C P6 0.75 45
+C K6 1.0 30
+C K7 1.3 65
+C P4 1.0 120
+C
+C (Startup time includes some function call overheads.)
+
+
+C void mpn_copyi (mp_ptr dst, mp_srcptr src, mp_size_t size);
+C
+C Copy src,size to dst,size, working from low to high addresses.
+C
+C The code here is very generic and can be expected to be reasonable on all
+C the x86 family.
+C
+C P6 - An MMX based copy was tried, but was found to be slower than a rep
+C movs in all cases. The fastest MMX found was 0.8 cycles/limb (when
+C fully aligned). A rep movs seems to have a startup time of about 15
+C cycles, but doing something special for small sizes could lead to a
+C branch misprediction that would destroy any saving. For now a plain
+C rep movs seems ok.
+C
+C K62 - We used to have a big chunk of code doing an MMX copy at 0.56 c/l if
+C aligned or a 1.0 rep movs if not. But that seemed excessive since
+C it only got an advantage half the time, and even then only showed it
+C above 50 limbs or so.
+
+defframe(PARAM_SIZE,12)
+defframe(PARAM_SRC, 8)
+defframe(PARAM_DST, 4)
+deflit(`FRAME',0)
+
+ TEXT
+ ALIGN(32)
+
+ C eax saved esi
+ C ebx
+ C ecx counter
+ C edx saved edi
+ C esi src
+ C edi dst
+ C ebp
+
+PROLOGUE(mpn_copyi)
+
+ movl PARAM_SIZE, %ecx
+ movl %esi, %eax
+
+ movl PARAM_SRC, %esi
+ movl %edi, %edx
+
+ movl PARAM_DST, %edi
+
+ cld C better safe than sorry, see mpn/x86/README
+
+ rep
+ movsl
+
+ movl %eax, %esi
+ movl %edx, %edi
+
+ ret
+
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/core2/gmp-mparam.h b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/core2/gmp-mparam.h
new file mode 100644
index 00000000000..b370eb58771
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/core2/gmp-mparam.h
@@ -0,0 +1,200 @@
+/* x86/core2 gmp-mparam.h -- Compiler/machine parameter header file.
+
+Copyright 1991, 1993, 1994, 2000-2011, 2014 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
+
+/* 2133 MHz Core 2 (65nm) */
+/* FFT tuning limit = 25000000 */
+/* Generated by tuneup.c, 2014-03-14, gcc 4.5 */
+
+#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_2_TO_MOD_1_4_THRESHOLD 0 /* never mpn_mod_1s_2p */
+#define PREINV_MOD_1_TO_MOD_1_THRESHOLD 10
+#define USE_PREINV_DIVREM_1 1 /* native */
+#define DIV_QR_1N_PI1_METHOD 1
+#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 19
+
+#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 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 SQR_BASECASE_THRESHOLD 0 /* always (native) */
+#define SQR_TOOM2_THRESHOLD 34
+#define SQR_TOOM3_THRESHOLD 114
+#define SQR_TOOM4_THRESHOLD 178
+#define SQR_TOOM6_THRESHOLD 262
+#define SQR_TOOM8_THRESHOLD 357
+
+#define MULMID_TOOM42_THRESHOLD 66
+
+#define MULMOD_BNM1_THRESHOLD 15
+#define SQRMOD_BNM1_THRESHOLD 21
+
+#define MUL_FFT_MODF_THRESHOLD 600 /* 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}, \
+ { 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}, \
+ { 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
+#define MUL_FFT_THRESHOLD 6784
+
+#define SQR_FFT_MODF_THRESHOLD 500 /* k = 5 */
+#define SQR_FFT_TABLE3 \
+ { { 500, 5}, { 28, 6}, { 15, 5}, { 31, 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}, \
+ { 31, 7}, { 63, 8}, { 39, 9}, { 23, 8}, \
+ { 51,10}, { 15, 9}, { 31, 8}, { 67, 9}, \
+ { 39, 8}, { 79, 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}, \
+ { 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}, \
+ { 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}, \
+ { 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}, \
+ { 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
+#define SQR_FFT_THRESHOLD 5312
+
+#define MULLO_BASECASE_THRESHOLD 0 /* always */
+#define MULLO_DC_THRESHOLD 29
+#define MULLO_MUL_N_THRESHOLD 13463
+
+#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 INV_MULMOD_BNM1_THRESHOLD 50
+#define INV_NEWTON_THRESHOLD 39
+#define INV_APPR_THRESHOLD 37
+
+#define BINV_NEWTON_THRESHOLD 318
+#define REDC_1_TO_REDC_N_THRESHOLD 87
+
+#define MU_DIV_QR_THRESHOLD 1099
+#define MU_DIVAPPR_Q_THRESHOLD 792
+#define MUPI_DIV_QR_THRESHOLD 0 /* always */
+#define MU_BDIV_QR_THRESHOLD 1442
+#define MU_BDIV_Q_THRESHOLD 1589
+
+#define POWM_SEC_TABLE 3,32,95,480,597,2657
+
+#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 10
+#define GET_STR_PRECOMPUTE_THRESHOLD 25
+#define SET_STR_DC_THRESHOLD 442
+#define SET_STR_PRECOMPUTE_THRESHOLD 1104
+
+#define FAC_DSC_THRESHOLD 155
+#define FAC_ODD_THRESHOLD 34
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/coreihwl/gmp-mparam.h b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/coreihwl/gmp-mparam.h
new file mode 100644
index 00000000000..e2b289cc3cb
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/coreihwl/gmp-mparam.h
@@ -0,0 +1,210 @@
+/* x86/coreihwl gmp-mparam.h -- Compiler/machine parameter header file.
+
+Copyright 1991, 1993, 1994, 2000-2011, 2014 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
+
+/* 2900 MHz Core i5 Haswell */
+/* FFT tuning limit = 40000000 */
+/* Generated by tuneup.c, 2014-03-13, gcc 4.5 */
+
+#define MOD_1_NORM_THRESHOLD 16
+#define MOD_1_UNNORM_THRESHOLD 13
+#define MOD_1N_TO_MOD_1_1_THRESHOLD 11
+#define MOD_1U_TO_MOD_1_1_THRESHOLD 9
+#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 5
+#define USE_PREINV_DIVREM_1 1 /* native */
+#define DIV_QR_1N_PI1_METHOD 1
+#define DIV_QR_1_NORM_THRESHOLD 15
+#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 19
+
+#define MUL_TOOM22_THRESHOLD 27
+#define MUL_TOOM33_THRESHOLD 90
+#define MUL_TOOM44_THRESHOLD 218
+#define MUL_TOOM6H_THRESHOLD 318
+#define MUL_TOOM8H_THRESHOLD 490
+
+#define MUL_TOOM32_TO_TOOM43_THRESHOLD 89
+#define MUL_TOOM32_TO_TOOM53_THRESHOLD 153
+#define MUL_TOOM42_TO_TOOM53_THRESHOLD 105
+#define MUL_TOOM42_TO_TOOM63_THRESHOLD 101
+#define MUL_TOOM43_TO_TOOM54_THRESHOLD 130
+
+#define SQR_BASECASE_THRESHOLD 0 /* always (native) */
+#define SQR_TOOM2_THRESHOLD 44
+#define SQR_TOOM3_THRESHOLD 137
+#define SQR_TOOM4_THRESHOLD 242
+#define SQR_TOOM6_THRESHOLD 351
+#define SQR_TOOM8_THRESHOLD 597
+
+#define MULMID_TOOM42_THRESHOLD 98
+
+#define MULMOD_BNM1_THRESHOLD 17
+#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}, { 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}, { 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}, { 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}, \
+ { 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}, { 287,10}, { 607, 9}, { 1215,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}, \
+ { 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,10}, { 2431,12}, { 639,11}, { 1343,12}, \
+ { 703,11}, { 1471,13}, { 383,12}, { 767,11}, \
+ { 1599,12}, { 831,11}, { 1727,10}, { 3455,12}, \
+ { 959,14}, { 255,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}, { 1983,14}, \
+ { 511,13}, { 1023,12}, { 2239,13}, { 1151,12}, \
+ { 2495,13}, { 1279,12}, { 2559,13}, { 1407,12}, \
+ { 2943,11}, { 5887,14}, { 767,13}, { 1535,12}, \
+ { 3071,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}, { 8192,14}, { 16384,15}, { 32768,16} }
+#define MUL_FFT_TABLE3_SIZE 168
+#define MUL_FFT_THRESHOLD 7424
+
+#define SQR_FFT_MODF_THRESHOLD 530 /* k = 5 */
+#define SQR_FFT_TABLE3 \
+ { { 530, 5}, { 28, 6}, { 15, 5}, { 31, 6}, \
+ { 28, 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}, { 41, 8}, { 23, 7}, { 49, 8}, \
+ { 27, 7}, { 55, 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}, { 79,10}, { 47, 9}, { 95,11}, \
+ { 31,10}, { 63, 9}, { 135,10}, { 79, 9}, \
+ { 159,10}, { 95, 9}, { 191,10}, { 111,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,10}, { 351,11}, \
+ { 191,10}, { 383, 9}, { 767,10}, { 399, 9}, \
+ { 799,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}, \
+ { 671,10}, { 1343,11}, { 735,10}, { 1471,12}, \
+ { 383,11}, { 799,10}, { 1599,11}, { 863,10}, \
+ { 1727,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}, { 1983,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}, { 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,12}, { 4863,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 170
+#define SQR_FFT_THRESHOLD 5760
+
+#define MULLO_BASECASE_THRESHOLD 0 /* always */
+#define MULLO_DC_THRESHOLD 57
+#define MULLO_MUL_N_THRESHOLD 14281
+
+#define DC_DIV_QR_THRESHOLD 23
+#define DC_DIVAPPR_Q_THRESHOLD 63
+#define DC_BDIV_QR_THRESHOLD 87
+#define DC_BDIV_Q_THRESHOLD 204
+
+#define INV_MULMOD_BNM1_THRESHOLD 54
+#define INV_NEWTON_THRESHOLD 75
+#define INV_APPR_THRESHOLD 67
+
+#define BINV_NEWTON_THRESHOLD 296
+#define REDC_1_TO_REDC_N_THRESHOLD 79
+
+#define MU_DIV_QR_THRESHOLD 872
+#define MU_DIVAPPR_Q_THRESHOLD 654
+#define MUPI_DIV_QR_THRESHOLD 0 /* always */
+#define MU_BDIV_QR_THRESHOLD 1858
+#define MU_BDIV_Q_THRESHOLD 2089
+
+#define POWM_SEC_TABLE 1,17,127,508,1603
+
+#define MATRIX22_STRASSEN_THRESHOLD 19
+#define HGCD_THRESHOLD 61
+#define HGCD_APPR_THRESHOLD 60
+#define HGCD_REDUCE_THRESHOLD 3810
+#define GCD_DC_THRESHOLD 263
+#define GCDEXT_DC_THRESHOLD 278
+#define JACOBI_BASE_METHOD 4
+
+#define GET_STR_DC_THRESHOLD 11
+#define GET_STR_PRECOMPUTE_THRESHOLD 21
+#define SET_STR_DC_THRESHOLD 527
+#define SET_STR_PRECOMPUTE_THRESHOLD 1178
+
+#define FAC_DSC_THRESHOLD 187
+#define FAC_ODD_THRESHOLD 34
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/coreinhm/gmp-mparam.h b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/coreinhm/gmp-mparam.h
new file mode 100644
index 00000000000..13289c0c239
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/coreinhm/gmp-mparam.h
@@ -0,0 +1,224 @@
+/* x86/coreinhm gmp-mparam.h -- Compiler/machine parameter header file.
+
+Copyright 1991, 1993, 1994, 2000-2011, 2014 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
+
+/* 2667 MHz Core i7 Nehalem */
+/* FFT tuning limit = 100000000 */
+/* Generated by tuneup.c, 2014-03-19, gcc 4.5 */
+
+#define MOD_1_NORM_THRESHOLD 25
+#define MOD_1_UNNORM_THRESHOLD 15
+#define MOD_1N_TO_MOD_1_1_THRESHOLD 8
+#define MOD_1U_TO_MOD_1_1_THRESHOLD 7
+#define MOD_1_1_TO_MOD_1_2_THRESHOLD 11
+#define MOD_1_2_TO_MOD_1_4_THRESHOLD 0 /* never mpn_mod_1s_2p */
+#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 18
+#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 MUL_TOOM22_THRESHOLD 26
+#define MUL_TOOM33_THRESHOLD 89
+#define MUL_TOOM44_THRESHOLD 214
+#define MUL_TOOM6H_THRESHOLD 327
+#define MUL_TOOM8H_THRESHOLD 466
+
+#define MUL_TOOM32_TO_TOOM43_THRESHOLD 97
+#define MUL_TOOM32_TO_TOOM53_THRESHOLD 159
+#define MUL_TOOM42_TO_TOOM53_THRESHOLD 95
+#define MUL_TOOM42_TO_TOOM63_THRESHOLD 101
+#define MUL_TOOM43_TO_TOOM54_THRESHOLD 142
+
+#define SQR_BASECASE_THRESHOLD 0 /* always (native) */
+#define SQR_TOOM2_THRESHOLD 44
+#define SQR_TOOM3_THRESHOLD 145
+#define SQR_TOOM4_THRESHOLD 232
+#define SQR_TOOM6_THRESHOLD 342
+#define SQR_TOOM8_THRESHOLD 502
+
+#define MULMID_TOOM42_THRESHOLD 78
+
+#define MULMOD_BNM1_THRESHOLD 17
+#define SQRMOD_BNM1_THRESHOLD 21
+
+#define MUL_FFT_MODF_THRESHOLD 606 /* k = 5 */
+#define MUL_FFT_TABLE3 \
+ { { 606, 5}, { 25, 6}, { 13, 5}, { 28, 6}, \
+ { 15, 5}, { 33, 6}, { 29, 7}, { 15, 6}, \
+ { 33, 7}, { 17, 6}, { 36, 7}, { 19, 6}, \
+ { 39, 7}, { 23, 6}, { 47, 7}, { 35, 8}, \
+ { 19, 7}, { 43, 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, 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}, { 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,11}, { 191,10}, { 383, 9}, \
+ { 767,10}, { 399,12}, { 127,11}, { 255,10}, \
+ { 511, 9}, { 1023,10}, { 543,11}, { 287,10}, \
+ { 607,11}, { 319,10}, { 639,12}, { 191,11}, \
+ { 383,10}, { 767,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,10}, { 1727,12}, { 447,11}, { 927,10}, \
+ { 1855,11}, { 991,13}, { 255,12}, { 511,11}, \
+ { 1119,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}, { 895,11}, { 1855,12}, { 959,14}, \
+ { 255,13}, { 511,12}, { 1023,11}, { 2111,12}, \
+ { 1087,11}, { 2239,10}, { 4479,12}, { 1215,11}, \
+ { 2431,13}, { 639,12}, { 1471,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,13}, \
+ { 1279,12}, { 2623,13}, { 1407,12}, { 2943,14}, \
+ { 767,13}, { 1535,12}, { 3071,13}, { 1663,12}, \
+ { 3455,13}, { 1919,12}, { 3967,15}, { 511,14}, \
+ { 1023,13}, { 2175,12}, { 4479,13}, { 2431,12}, \
+ { 4991,14}, { 1279,13}, { 2687,12}, { 5503,13}, \
+ { 2943,12}, { 6015,14}, { 1535,13}, { 3455,14}, \
+ { 1791,13}, { 3967,12}, { 7935,15}, { 1023,14}, \
+ { 2047,13}, { 4479,14}, { 2303,13}, { 4991,12}, \
+ { 9983,14}, { 2559,13}, { 5503,14}, { 2815,13}, \
+ { 6015,15}, { 1535,14}, { 3839,13}, { 7935,16}, \
+ { 1023,15}, { 2047,14}, { 4095,13}, { 8191,12}, \
+ { 16383,11}, { 32767,10}, { 65535, 9}, { 131071, 8}, \
+ { 256, 9}, { 512,10}, { 1024,11}, { 2048,12}, \
+ { 4096,13}, { 8192,14}, { 16384,15}, { 32768,16} }
+#define MUL_FFT_TABLE3_SIZE 192
+#define MUL_FFT_THRESHOLD 6784
+
+#define SQR_FFT_MODF_THRESHOLD 555 /* k = 5 */
+#define SQR_FFT_TABLE3 \
+ { { 555, 5}, { 28, 6}, { 15, 5}, { 31, 6}, \
+ { 16, 5}, { 33, 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, 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,11}, \
+ { 63,10}, { 143, 9}, { 287,10}, { 159,11}, \
+ { 95,12}, { 63,11}, { 127,10}, { 255, 9}, \
+ { 511, 8}, { 1023,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,13}, { 127,12}, \
+ { 255,11}, { 511,10}, { 1023,11}, { 543,10}, \
+ { 1087,11}, { 607,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,13}, { 255,12}, \
+ { 511,11}, { 1023,10}, { 2047,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,11}, { 1791,12}, { 959,11}, \
+ { 1983,14}, { 255,13}, { 511,12}, { 1023,11}, \
+ { 2111,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}, { 1983,11}, { 3967,14}, { 511,13}, \
+ { 1023,12}, { 2239,11}, { 4479,13}, { 1151,12}, \
+ { 2495,13}, { 1279,12}, { 2623,13}, { 1407,12}, \
+ { 2943,14}, { 767,13}, { 1663,12}, { 3455,13}, \
+ { 1919,12}, { 3967,15}, { 511,14}, { 1023,13}, \
+ { 2175,12}, { 4479,13}, { 2431,12}, { 4863,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}, { 6655,14}, { 3839,13}, \
+ { 7935,16}, { 1023,15}, { 2047,14}, { 4095,13}, \
+ { 8191,12}, { 16383,11}, { 32767,10}, { 65535, 9}, \
+ { 131071, 8}, { 256, 9}, { 512,10}, { 1024,11}, \
+ { 2048,12}, { 4096,13}, { 8192,14}, { 16384,15}, \
+ { 32768,16} }
+#define SQR_FFT_TABLE3_SIZE 201
+#define SQR_FFT_THRESHOLD 5312
+
+#define MULLO_BASECASE_THRESHOLD 0 /* always */
+#define MULLO_DC_THRESHOLD 38
+#define MULLO_MUL_N_THRESHOLD 13463
+
+#define DC_DIV_QR_THRESHOLD 22
+#define DC_DIVAPPR_Q_THRESHOLD 43
+#define DC_BDIV_QR_THRESHOLD 78
+#define DC_BDIV_Q_THRESHOLD 157
+
+#define INV_MULMOD_BNM1_THRESHOLD 50
+#define INV_NEWTON_THRESHOLD 15
+#define INV_APPR_THRESHOLD 18
+
+#define BINV_NEWTON_THRESHOLD 351
+#define REDC_1_TO_REDC_N_THRESHOLD 84
+
+#define MU_DIV_QR_THRESHOLD 889
+#define MU_DIVAPPR_Q_THRESHOLD 483
+#define MUPI_DIV_QR_THRESHOLD 0 /* always */
+#define MU_BDIV_QR_THRESHOLD 1589
+#define MU_BDIV_Q_THRESHOLD 1787
+
+#define POWM_SEC_TABLE 2,25,95,473,1357
+
+#define MATRIX22_STRASSEN_THRESHOLD 20
+#define HGCD_THRESHOLD 52
+#define HGCD_APPR_THRESHOLD 51
+#define HGCD_REDUCE_THRESHOLD 3524
+#define GCD_DC_THRESHOLD 213
+#define GCDEXT_DC_THRESHOLD 249
+#define JACOBI_BASE_METHOD 4
+
+#define GET_STR_DC_THRESHOLD 13
+#define GET_STR_PRECOMPUTE_THRESHOLD 24
+#define SET_STR_DC_THRESHOLD 145
+#define SET_STR_PRECOMPUTE_THRESHOLD 545
+
+#define FAC_DSC_THRESHOLD 91
+#define FAC_ODD_THRESHOLD 29
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/coreisbr/gmp-mparam.h b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/coreisbr/gmp-mparam.h
new file mode 100644
index 00000000000..9b227a71ba2
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/coreisbr/gmp-mparam.h
@@ -0,0 +1,203 @@
+/* x86/coreisbr gmp-mparam.h -- Compiler/machine parameter header file.
+
+Copyright 1991, 1993, 1994, 2000-2011, 2014 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
+
+/* 3300 MHz Core i5 Sandy Bridge */
+/* FFT tuning limit = 40000000 */
+/* Generated by tuneup.c, 2014-03-13, gcc 4.5 */
+
+#define MOD_1_NORM_THRESHOLD 18
+#define MOD_1_UNNORM_THRESHOLD 11
+#define MOD_1N_TO_MOD_1_1_THRESHOLD 9
+#define MOD_1U_TO_MOD_1_1_THRESHOLD 7
+#define MOD_1_1_TO_MOD_1_2_THRESHOLD 11
+#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
+#define DIV_QR_1_NORM_THRESHOLD 16
+#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 19
+
+#define MUL_TOOM22_THRESHOLD 28
+#define MUL_TOOM33_THRESHOLD 99
+#define MUL_TOOM44_THRESHOLD 160
+#define MUL_TOOM6H_THRESHOLD 268
+#define MUL_TOOM8H_THRESHOLD 490
+
+#define MUL_TOOM32_TO_TOOM43_THRESHOLD 106
+#define MUL_TOOM32_TO_TOOM53_THRESHOLD 140
+#define MUL_TOOM42_TO_TOOM53_THRESHOLD 109
+#define MUL_TOOM42_TO_TOOM63_THRESHOLD 108
+#define MUL_TOOM43_TO_TOOM54_THRESHOLD 137
+
+#define SQR_BASECASE_THRESHOLD 0 /* always (native) */
+#define SQR_TOOM2_THRESHOLD 48
+#define SQR_TOOM3_THRESHOLD 105
+#define SQR_TOOM4_THRESHOLD 256
+#define SQR_TOOM6_THRESHOLD 366
+#define SQR_TOOM8_THRESHOLD 562
+
+#define MULMID_TOOM42_THRESHOLD 98
+
+#define MULMOD_BNM1_THRESHOLD 19
+#define SQRMOD_BNM1_THRESHOLD 23
+
+#define MUL_FFT_MODF_THRESHOLD 636 /* k = 5 */
+#define MUL_FFT_TABLE3 \
+ { { 636, 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}, { 49, 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}, { 79,10}, { 47, 9}, \
+ { 103,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}, { 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,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}, { 959,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,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}, \
+ { 2431,13}, { 1279,12}, { 2559,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,14}, \
+ { 1279,13}, { 2943,12}, { 5887,14}, { 16384,15}, \
+ { 32768,16} }
+#define MUL_FFT_TABLE3_SIZE 149
+#define MUL_FFT_THRESHOLD 7424
+
+#define SQR_FFT_MODF_THRESHOLD 555 /* 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}, { 23, 6}, \
+ { 47, 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, 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}, { 159,11}, \
+ { 95,10}, { 191,12}, { 63,11}, { 127,10}, \
+ { 255, 9}, { 543,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,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,10}, { 1727,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}, { 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}, { 2495,13}, { 1279,12}, \
+ { 2623,13}, { 1407,12}, { 2943,14}, { 767,13}, \
+ { 1663,12}, { 3455,13}, { 1919,12}, { 3839,15}, \
+ { 511,14}, { 1023,13}, { 2175,12}, { 4479,13}, \
+ { 2431,12}, { 4863,14}, { 1279,13}, { 2943,12}, \
+ { 5887,14}, { 16384,15}, { 32768,16} }
+#define SQR_FFT_TABLE3_SIZE 159
+#define SQR_FFT_THRESHOLD 5760
+
+#define MULLO_BASECASE_THRESHOLD 0 /* always */
+#define MULLO_DC_THRESHOLD 62
+#define MULLO_MUL_N_THRESHOLD 14281
+
+#define DC_DIV_QR_THRESHOLD 25
+#define DC_DIVAPPR_Q_THRESHOLD 43
+#define DC_BDIV_QR_THRESHOLD 99
+#define DC_BDIV_Q_THRESHOLD 240
+
+#define INV_MULMOD_BNM1_THRESHOLD 54
+#define INV_NEWTON_THRESHOLD 14
+#define INV_APPR_THRESHOLD 13
+
+#define BINV_NEWTON_THRESHOLD 363
+#define REDC_1_TO_REDC_N_THRESHOLD 90
+
+#define MU_DIV_QR_THRESHOLD 998
+#define MU_DIVAPPR_Q_THRESHOLD 667
+#define MUPI_DIV_QR_THRESHOLD 0 /* always */
+#define MU_BDIV_QR_THRESHOLD 1787
+#define MU_BDIV_Q_THRESHOLD 2130
+
+#define POWM_SEC_TABLE 1,16,126,480,1317
+
+#define MATRIX22_STRASSEN_THRESHOLD 21
+#define HGCD_THRESHOLD 61
+#define HGCD_APPR_THRESHOLD 56
+#define HGCD_REDUCE_THRESHOLD 3810
+#define GCD_DC_THRESHOLD 283
+#define GCDEXT_DC_THRESHOLD 309
+#define JACOBI_BASE_METHOD 4
+
+#define GET_STR_DC_THRESHOLD 12
+#define GET_STR_PRECOMPUTE_THRESHOLD 21
+#define SET_STR_DC_THRESHOLD 399
+#define SET_STR_PRECOMPUTE_THRESHOLD 1183
+
+#define FAC_DSC_THRESHOLD 194
+#define FAC_ODD_THRESHOLD 34
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/darwin.m4 b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/darwin.m4
new file mode 100644
index 00000000000..f8363db3f78
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/darwin.m4
@@ -0,0 +1,82 @@
+divert(-1)
+dnl Copyright 2007, 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/.
+
+define(`DARWIN')
+
+
+dnl Usage LEA(symbol,reg)
+dnl
+dnl We maintain lists of stuff to append in load_eip and darwin_bd. The
+dnl `index' stuff is needed to suppress repeated definitions. To avoid
+dnl getting fooled by "var" and "var1", we add 'bol ' (the end of
+dnl 'indirect_symbol') at the beginning and and a newline at the end. This
+dnl might be a bit fragile.
+
+define(`LEA',
+m4_assert_numargs(2)
+`ifdef(`PIC',`
+ifelse(index(defn(`load_eip'), `$2'),-1,
+`m4append(`load_eip',
+`L(movl_eip_`'substr($2,1)):
+ movl (%esp), $2
+ ret_internal
+')')
+ifelse(index(defn(`darwin_bd'), `bol $1
+'),-1,
+`m4append(`darwin_bd',
+` .section __IMPORT,__pointers,non_lazy_symbol_pointers
+L($1`'$non_lazy_ptr):
+ .indirect_symbol $1
+ .long 0
+')')
+ call L(movl_eip_`'substr($2,1))
+ movl L($1`'$non_lazy_ptr)-.($2), $2
+',`
+ movl `$'$1, $2
+')')
+
+
+dnl EPILOGUE_cpu
+
+define(`EPILOGUE_cpu',`load_eip`'darwin_bd')
+
+define(`load_eip', `') dnl updated in LEA
+define(`darwin_bd', `') dnl updated in LEA
+
+
+dnl Usage: CALL(funcname)
+dnl
+
+define(`CALL',
+m4_assert_numargs(1)
+`call GSYM_PREFIX`'$1')
+
+undefine(`PIC_WITH_EBX')
+
+divert`'dnl
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/dive_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/dive_1.asm
new file mode 100644
index 00000000000..9a6cbb7931d
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/dive_1.asm
@@ -0,0 +1,189 @@
+dnl x86 mpn_divexact_1 -- mpn by limb exact division.
+
+dnl Copyright 2001, 2002, 2007 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 P54 30.0
+C P55 29.0
+C P6 13.0 odd divisor, 12.0 even (strangely)
+C K6 14.0
+C K7 12.0
+C P4 42.0
+
+
+C mp_limb_t mpn_divexact_1 (mp_ptr dst, mp_srcptr src, mp_size_t size,
+C mp_limb_t divisor);
+C
+
+defframe(PARAM_DIVISOR,16)
+defframe(PARAM_SIZE, 12)
+defframe(PARAM_SRC, 8)
+defframe(PARAM_DST, 4)
+
+dnl re-use parameter space
+define(VAR_INVERSE,`PARAM_SRC')
+
+ TEXT
+
+ ALIGN(16)
+PROLOGUE(mpn_divexact_1)
+deflit(`FRAME',0)
+
+ movl PARAM_DIVISOR, %eax
+ pushl %ebp FRAME_pushl()
+
+ movl PARAM_SIZE, %ebp
+ pushl %edi FRAME_pushl()
+
+ pushl %ebx FRAME_pushl()
+ movl $-1, %ecx C shift count
+
+ pushl %esi FRAME_pushl()
+
+L(strip_twos):
+ incl %ecx
+
+ shrl %eax
+ jnc L(strip_twos)
+
+ leal 1(%eax,%eax), %ebx C d without twos
+ andl $127, %eax C d/2, 7 bits
+
+ifdef(`PIC',`
+ LEA( binvert_limb_table, %edx)
+ movzbl (%eax,%edx), %eax C inv 8 bits
+',`
+ movzbl binvert_limb_table(%eax), %eax C inv 8 bits
+')
+
+ leal (%eax,%eax), %edx C 2*inv
+ movl %ebx, PARAM_DIVISOR C d without twos
+
+ imull %eax, %eax C inv*inv
+
+ movl PARAM_SRC, %esi
+ movl PARAM_DST, %edi
+
+ imull %ebx, %eax C inv*inv*d
+
+ subl %eax, %edx C inv = 2*inv - inv*inv*d
+ leal (%edx,%edx), %eax C 2*inv
+
+ imull %edx, %edx C inv*inv
+
+ leal (%esi,%ebp,4), %esi C src end
+ leal (%edi,%ebp,4), %edi C dst end
+ negl %ebp C -size
+
+ imull %ebx, %edx C inv*inv*d
+
+ subl %edx, %eax C inv = 2*inv - inv*inv*d
+
+ ASSERT(e,` C expect d*inv == 1 mod 2^GMP_LIMB_BITS
+ pushl %eax FRAME_pushl()
+ imull PARAM_DIVISOR, %eax
+ cmpl $1, %eax
+ popl %eax FRAME_popl()')
+
+ movl %eax, VAR_INVERSE
+ movl (%esi,%ebp,4), %eax C src[0]
+
+ xorl %ebx, %ebx
+ xorl %edx, %edx
+
+ incl %ebp
+ jz L(one)
+
+ movl (%esi,%ebp,4), %edx C src[1]
+
+ shrdl( %cl, %edx, %eax)
+
+ movl VAR_INVERSE, %edx
+ jmp L(entry)
+
+
+ ALIGN(8)
+ nop C k6 code alignment
+ nop
+L(top):
+ C eax q
+ C ebx carry bit, 0 or -1
+ C ecx shift
+ C edx carry limb
+ C esi src end
+ C edi dst end
+ C ebp counter, limbs, negative
+
+ movl -4(%esi,%ebp,4), %eax
+ subl %ebx, %edx C accumulate carry bit
+
+ movl (%esi,%ebp,4), %ebx
+
+ shrdl( %cl, %ebx, %eax)
+
+ subl %edx, %eax C apply carry limb
+ movl VAR_INVERSE, %edx
+
+ sbbl %ebx, %ebx
+
+L(entry):
+ imull %edx, %eax
+
+ movl %eax, -4(%edi,%ebp,4)
+ movl PARAM_DIVISOR, %edx
+
+ mull %edx
+
+ incl %ebp
+ jnz L(top)
+
+
+ movl -4(%esi), %eax C src high limb
+L(one):
+ shrl %cl, %eax
+ popl %esi FRAME_popl()
+
+ addl %ebx, %eax C apply carry bit
+ popl %ebx FRAME_popl()
+
+ subl %edx, %eax C apply carry limb
+
+ imull VAR_INVERSE, %eax
+
+ movl %eax, -4(%edi)
+
+ popl %edi
+ popl %ebp
+
+ ret
+
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/divrem_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/divrem_1.asm
new file mode 100644
index 00000000000..255d4935c38
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/divrem_1.asm
@@ -0,0 +1,233 @@
+dnl x86 mpn_divrem_1 -- mpn by limb division extending to fractional quotient.
+
+dnl Copyright 1999-2003, 2007 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 486 approx 43 maybe
+C P5 44
+C P6 39
+C P6MMX 39
+C K6 22
+C K7 42
+C P4 58
+
+
+C mp_limb_t mpn_divrem_1 (mp_ptr dst, mp_size_t xsize,
+C mp_srcptr src, mp_size_t size, mp_limb_t divisor);
+C mp_limb_t mpn_divrem_1c (mp_ptr dst, mp_size_t xsize,
+C mp_srcptr src, mp_size_t size, mp_limb_t divisor,
+C mp_limb_t carry);
+C
+C Divide src,size by divisor and store the quotient in dst+xsize,size.
+C Extend the division to fractional quotient limbs in dst,xsize. Return the
+C remainder. Either or both xsize and size can be 0.
+C
+C mpn_divrem_1c takes a carry parameter which is an initial high limb,
+C effectively one extra limb at the top of src,size. Must have
+C carry<divisor.
+C
+C
+C Essentially the code is the same as the division based part of
+C mpn/generic/divrem_1.c, but has the advantage that we get the desired divl
+C instruction even when gcc is not being used (when longlong.h only has the
+C rather slow generic C udiv_qrnnd().
+C
+C A test is done to see if the high limb is less than the divisor, and if so
+C one less div is done. A div is between 20 and 40 cycles on the various
+C x86s, so assuming high<divisor about half the time, then this test saves
+C half that amount. The branch misprediction penalty on each chip is less
+C than half a div.
+C
+C
+C Notes for P5:
+C
+C It might be thought that moving the load down to pair with the store would
+C save 1 cycle, but that doesn't seem to happen in practice, and in any case
+C would be a mere 2.2% saving, so it's hardly worth bothering about.
+C
+C A mul-by-inverse might be a possibility for P5, as done in
+C mpn/x86/pentium/mod_1.asm. The number of auxiliary instructions required
+C is a hinderance, but there could be a 10-15% speedup available.
+C
+C
+C Notes for K6:
+C
+C K6 has its own version of this code, using loop and paying attention to
+C cache line boundary crossings. The target 20 c/l can be had with the
+C decl+jnz of the present code by pairing up the load and store in the
+C loops. But it's considered easier not to introduce complexity just for
+C that, but instead let k6 have its own code.
+C
+
+defframe(PARAM_CARRY, 24)
+defframe(PARAM_DIVISOR,20)
+defframe(PARAM_SIZE, 16)
+defframe(PARAM_SRC, 12)
+defframe(PARAM_XSIZE, 8)
+defframe(PARAM_DST, 4)
+
+ TEXT
+ ALIGN(16)
+
+PROLOGUE(mpn_divrem_1c)
+deflit(`FRAME',0)
+
+ movl PARAM_SIZE, %ecx
+ pushl %edi FRAME_pushl()
+
+ movl PARAM_SRC, %edi
+ pushl %esi FRAME_pushl()
+
+ movl PARAM_DIVISOR, %esi
+ pushl %ebx FRAME_pushl()
+
+ movl PARAM_DST, %ebx
+ pushl %ebp FRAME_pushl()
+
+ movl PARAM_XSIZE, %ebp
+ orl %ecx, %ecx
+
+ movl PARAM_CARRY, %edx
+ jz L(fraction)
+
+ leal -4(%ebx,%ebp,4), %ebx C dst one limb below integer part
+ jmp L(integer_top)
+
+EPILOGUE()
+
+
+PROLOGUE(mpn_divrem_1)
+deflit(`FRAME',0)
+
+ movl PARAM_SIZE, %ecx
+ pushl %edi FRAME_pushl()
+
+ movl PARAM_SRC, %edi
+ pushl %esi FRAME_pushl()
+
+ movl PARAM_DIVISOR, %esi
+ orl %ecx,%ecx
+
+ jz L(size_zero)
+ pushl %ebx FRAME_pushl()
+
+ movl -4(%edi,%ecx,4), %eax C src high limb
+ xorl %edx, %edx
+
+ movl PARAM_DST, %ebx
+ pushl %ebp FRAME_pushl()
+
+ movl PARAM_XSIZE, %ebp
+ cmpl %esi, %eax
+
+ leal -4(%ebx,%ebp,4), %ebx C dst one limb below integer part
+ jae L(integer_entry)
+
+
+ C high<divisor, so high of dst is zero, and avoid one div
+
+ movl %edx, (%ebx,%ecx,4)
+ decl %ecx
+
+ movl %eax, %edx
+ jz L(fraction)
+
+
+L(integer_top):
+ C eax scratch (quotient)
+ C ebx dst+4*xsize-4
+ C ecx counter
+ C edx scratch (remainder)
+ C esi divisor
+ C edi src
+ C ebp xsize
+
+ movl -4(%edi,%ecx,4), %eax
+L(integer_entry):
+
+ divl %esi
+
+ movl %eax, (%ebx,%ecx,4)
+ decl %ecx
+ jnz L(integer_top)
+
+
+L(fraction):
+ orl %ebp, %ecx
+ jz L(done)
+
+ movl PARAM_DST, %ebx
+
+
+L(fraction_top):
+ C eax scratch (quotient)
+ C ebx dst
+ C ecx counter
+ C edx scratch (remainder)
+ C esi divisor
+ C edi
+ C ebp
+
+ xorl %eax, %eax
+
+ divl %esi
+
+ movl %eax, -4(%ebx,%ecx,4)
+ decl %ecx
+ jnz L(fraction_top)
+
+
+L(done):
+ popl %ebp
+ movl %edx, %eax
+ popl %ebx
+ popl %esi
+ popl %edi
+ ret
+
+
+L(size_zero):
+deflit(`FRAME',8)
+ movl PARAM_XSIZE, %ecx
+ xorl %eax, %eax
+
+ movl PARAM_DST, %edi
+
+ cld C better safe than sorry, see mpn/x86/README
+
+ rep
+ stosl
+
+ popl %esi
+ popl %edi
+ ret
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/divrem_2.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/divrem_2.asm
new file mode 100644
index 00000000000..4c38ad0acb9
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/divrem_2.asm
@@ -0,0 +1,199 @@
+dnl x86 mpn_divrem_2 -- Divide an mpn number by a normalized 2-limb number.
+
+dnl Copyright 2007, 2008 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 norm frac
+C 486
+C P5
+C P6-13 29.2
+C P6-15 *26
+C K6
+C K7 22
+C K8 *19
+C P4-f1
+C P4-f2 *65
+C P4-f3
+C P4-f4 *72
+
+C A star means numbers not updated for the latest version of the code.
+
+
+C TODO
+C * Perhaps keep ecx or esi in stack slot, freeing up a reg for q0.
+C * The loop has not been carefully tuned. We should at the very least do
+C some local insn swapping.
+C * The code outside the main loop is what gcc generated. Clean up!
+C * Clean up stack slot usage.
+
+C INPUT PARAMETERS
+C qp
+C fn
+C up_param
+C un_param
+C dp
+
+
+C eax ebx ecx edx esi edi ebp
+C cnt qp
+
+ASM_START()
+ TEXT
+ ALIGN(16)
+PROLOGUE(mpn_divrem_2)
+ push %ebp
+ push %edi
+ push %esi
+ push %ebx
+ sub $36, %esp
+ mov 68(%esp), %ecx C un
+ mov 72(%esp), %esi C dp
+ movl $0, 32(%esp)
+ lea 0(,%ecx,4), %edi
+ add 64(%esp), %edi C up
+ mov (%esi), %ebx
+ mov 4(%esi), %eax
+ mov %ebx, 20(%esp)
+ sub $12, %edi
+ mov %eax, 24(%esp)
+ mov %edi, 12(%esp)
+ mov 8(%edi), %ebx
+ mov 4(%edi), %ebp
+ cmp %eax, %ebx
+ jb L(8)
+ seta %dl
+ cmp 20(%esp), %ebp
+ setae %al
+ orb %dl, %al C "orb" form to placate Sun tools
+ jne L(35)
+L(8):
+ mov 60(%esp), %esi C fn
+ lea -3(%esi,%ecx), %edi
+ test %edi, %edi
+ js L(9)
+ mov 24(%esp), %edx
+ mov $-1, %esi
+ mov %esi, %eax
+ mov %esi, %ecx
+ not %edx
+ divl 24(%esp)
+ mov %eax, %esi
+ imul 24(%esp), %eax
+ mov %eax, (%esp)
+ mov %esi, %eax
+ mull 20(%esp)
+ mov (%esp), %eax
+ add 20(%esp), %eax
+ adc $0, %ecx
+ add %eax, %edx
+ adc $0, %ecx
+ mov %ecx, %eax
+ js L(32)
+L(36): dec %esi
+ sub 24(%esp), %edx
+ sbb $0, %eax
+ jns L(36)
+L(32):
+ mov %esi, 16(%esp) C di
+ mov %edi, %ecx C un
+ mov 12(%esp), %esi C up
+ mov 24(%esp), %eax
+ neg %eax
+ mov %eax, 4(%esp) C -d1
+ ALIGN(16)
+ nop
+
+C eax ebx ecx edx esi edi ebp 0 4 8 12 16 20 24 28 32 56 60
+C n2 un up n1 q0 -d1 di d0 d1 msl qp fn
+
+L(loop):
+ mov 16(%esp), %eax C di
+ mul %ebx
+ add %ebp, %eax
+ mov %eax, (%esp) C q0
+ adc %ebx, %edx
+ mov %edx, %edi C q
+ imul 4(%esp), %edx
+ mov 20(%esp), %eax
+ lea (%edx, %ebp), %ebx C n1 -= ...
+ mul %edi
+ xor %ebp, %ebp
+ cmp 60(%esp), %ecx
+ jl L(19)
+ mov (%esi), %ebp
+ sub $4, %esi
+L(19): sub 20(%esp), %ebp
+ sbb 24(%esp), %ebx
+ sub %eax, %ebp
+ sbb %edx, %ebx
+ mov 20(%esp), %eax C d1
+ inc %edi
+ xor %edx, %edx
+ cmp (%esp), %ebx
+ adc $-1, %edx C mask
+ add %edx, %edi C q--
+ and %edx, %eax C d0 or 0
+ and 24(%esp), %edx C d1 or 0
+ add %eax, %ebp
+ adc %edx, %ebx
+ cmp 24(%esp), %ebx
+ jae L(fix)
+L(bck): mov 56(%esp), %edx
+ mov %edi, (%edx, %ecx, 4)
+ dec %ecx
+ jns L(loop)
+
+L(9): mov 64(%esp), %esi C up
+ mov %ebp, (%esi)
+ mov %ebx, 4(%esi)
+ mov 32(%esp), %eax
+ add $36, %esp
+ pop %ebx
+ pop %esi
+ pop %edi
+ pop %ebp
+ ret
+
+L(fix): seta %dl
+ cmp 20(%esp), %ebp
+ setae %al
+ orb %dl, %al C "orb" form to placate Sun tools
+ je L(bck)
+ inc %edi
+ sub 20(%esp), %ebp
+ sbb 24(%esp), %ebx
+ jmp L(bck)
+
+L(35): sub 20(%esp), %ebp
+ sbb 24(%esp), %ebx
+ movl $1, 32(%esp)
+ jmp L(8)
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/fat/com.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/fat/com.c
new file mode 100644
index 00000000000..d359d4ce730
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/fat/com.c
@@ -0,0 +1,32 @@
+/* Fat binary fallback mpn_com.
+
+Copyright 2003, 2009, 2011 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 "mpn/generic/com.c"
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/fat/fat.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/fat/fat.c
new file mode 100644
index 00000000000..1740813886d
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/fat/fat.c
@@ -0,0 +1,473 @@
+/* x86 fat binary initializers.
+
+ THE FUNCTIONS AND VARIABLES 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 2003, 2004, 2011, 2012 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> /* for printf */
+#include <stdlib.h> /* for getenv */
+#include <string.h>
+
+#include "gmp.h"
+#include "gmp-impl.h"
+
+/* Change this to "#define TRACE(x) x" for some traces. */
+#define TRACE(x)
+
+
+/* fat_entry.asm */
+long __gmpn_cpuid (char [12], int);
+int __gmpn_cpuid_available (void);
+
+
+#if WANT_FAKE_CPUID
+/* The "name"s in the table are values for the GMP_CPU_TYPE environment
+ variable. Anything can be used, but for now it's the canonical cpu types
+ as per config.guess/config.sub. */
+
+#define __gmpn_cpuid fake_cpuid
+#define __gmpn_cpuid_available fake_cpuid_available
+
+#define MAKE_FMS(family, model) \
+ ((((family) & 0xf) << 8) + (((family) & 0xff0) << 20) \
+ + (((model) & 0xf) << 4) + (((model) & 0xf0) << 12))
+
+static struct {
+ const char *name;
+ const char vendor[13];
+ unsigned fms;
+} fake_cpuid_table[] = {
+ { "i386", "" },
+ { "i486", "GenuineIntel", MAKE_FMS (4, 0) },
+ { "pentium", "GenuineIntel", MAKE_FMS (5, 0) },
+ { "pentiummmx", "GenuineIntel", MAKE_FMS (5, 4) },
+ { "pentiumpro", "GenuineIntel", MAKE_FMS (6, 0) },
+ { "pentium2", "GenuineIntel", MAKE_FMS (6, 2) },
+ { "pentium3", "GenuineIntel", MAKE_FMS (6, 7) },
+ { "pentium4", "GenuineIntel", MAKE_FMS (15, 2) },
+ { "prescott", "GenuineIntel", MAKE_FMS (15, 3) },
+ { "nocona", "GenuineIntel", MAKE_FMS (15, 4) },
+ { "core2", "GenuineIntel", MAKE_FMS (6, 0xf) },
+ { "coreinhm", "GenuineIntel", MAKE_FMS (6, 0x1a) },
+ { "coreiwsm", "GenuineIntel", MAKE_FMS (6, 0x25) },
+ { "coreisbr", "GenuineIntel", MAKE_FMS (6, 0x2a) },
+ { "coreihwl", "GenuineIntel", MAKE_FMS (6, 0x3c) },
+ { "atom", "GenuineIntel", MAKE_FMS (6, 0x1c) },
+
+ { "k5", "AuthenticAMD", MAKE_FMS (5, 0) },
+ { "k6", "AuthenticAMD", MAKE_FMS (5, 3) },
+ { "k62", "AuthenticAMD", MAKE_FMS (5, 8) },
+ { "k63", "AuthenticAMD", MAKE_FMS (5, 9) },
+ { "athlon", "AuthenticAMD", MAKE_FMS (6, 0) },
+ { "k8", "AuthenticAMD", MAKE_FMS (15, 0) },
+ { "k10", "AuthenticAMD", MAKE_FMS (16, 0) },
+ { "bobcat", "AuthenticAMD", MAKE_FMS (20, 1) },
+ { "bulldozer", "AuthenticAMD", MAKE_FMS (21, 1) },
+
+ { "viac3", "CentaurHauls", MAKE_FMS (6, 0) },
+ { "viac32", "CentaurHauls", MAKE_FMS (6, 9) },
+ { "nano", "CentaurHauls", MAKE_FMS (6, 15) },
+};
+
+static int
+fake_cpuid_lookup (void)
+{
+ char *s;
+ int i;
+
+ s = getenv ("GMP_CPU_TYPE");
+ if (s == NULL)
+ {
+ printf ("Need GMP_CPU_TYPE environment variable for fake cpuid\n");
+ abort ();
+ }
+
+ for (i = 0; i < numberof (fake_cpuid_table); i++)
+ if (strcmp (s, fake_cpuid_table[i].name) == 0)
+ return i;
+
+ printf ("GMP_CPU_TYPE=%s unknown\n", s);
+ abort ();
+}
+
+static int
+fake_cpuid_available (void)
+{
+ return fake_cpuid_table[fake_cpuid_lookup()].vendor[0] != '\0';
+}
+
+static long
+fake_cpuid (char dst[12], int id)
+{
+ int i = fake_cpuid_lookup();
+
+ switch (id) {
+ case 0:
+ memcpy (dst, fake_cpuid_table[i].vendor, 12);
+ return 0;
+ case 1:
+ return fake_cpuid_table[i].fms;
+ default:
+ printf ("fake_cpuid(): oops, unknown id %d\n", id);
+ abort ();
+ }
+}
+#endif
+
+
+typedef DECL_preinv_divrem_1 ((*preinv_divrem_1_t));
+typedef DECL_preinv_mod_1 ((*preinv_mod_1_t));
+
+struct cpuvec_t __gmpn_cpuvec = {
+ __MPN(add_n_init),
+ 0,
+ 0,
+ __MPN(addmul_1_init),
+ 0,
+ __MPN(bdiv_dbm1c_init),
+ __MPN(cnd_add_n_init),
+ __MPN(cnd_sub_n_init),
+ __MPN(com_init),
+ __MPN(copyd_init),
+ __MPN(copyi_init),
+ __MPN(divexact_1_init),
+ __MPN(divrem_1_init),
+ __MPN(gcd_1_init),
+ __MPN(lshift_init),
+ __MPN(lshiftc_init),
+ __MPN(mod_1_init),
+ __MPN(mod_1_1p_init),
+ __MPN(mod_1_1p_cps_init),
+ __MPN(mod_1s_2p_init),
+ __MPN(mod_1s_2p_cps_init),
+ __MPN(mod_1s_4p_init),
+ __MPN(mod_1s_4p_cps_init),
+ __MPN(mod_34lsub1_init),
+ __MPN(modexact_1c_odd_init),
+ __MPN(mul_1_init),
+ __MPN(mul_basecase_init),
+ __MPN(mullo_basecase_init),
+ __MPN(preinv_divrem_1_init),
+ __MPN(preinv_mod_1_init),
+ __MPN(redc_1_init),
+ __MPN(redc_2_init),
+ __MPN(rshift_init),
+ __MPN(sqr_basecase_init),
+ __MPN(sub_n_init),
+ 0,
+ __MPN(submul_1_init),
+ 0
+};
+
+int __gmpn_cpuvec_initialized = 0;
+
+/* The following setups start with generic x86, then overwrite with
+ specifics for a chip, and higher versions of that chip.
+
+ The arrangement of the setups here will normally be the same as the $path
+ selections in configure.in for the respective chips.
+
+ This code is reentrant and thread safe. We always calculate the same
+ decided_cpuvec, so if two copies of the code are running it doesn't
+ matter which completes first, both write the same to __gmpn_cpuvec.
+
+ We need to go via decided_cpuvec because if one thread has completed
+ __gmpn_cpuvec then it may be making use of the threshold values in that
+ vector. If another thread is still running __gmpn_cpuvec_init then we
+ don't want it to write different values to those fields since some of the
+ asm routines only operate correctly up to their own defined threshold,
+ not an arbitrary value. */
+
+void
+__gmpn_cpuvec_init (void)
+{
+ struct cpuvec_t decided_cpuvec;
+
+ TRACE (printf ("__gmpn_cpuvec_init:\n"));
+
+ memset (&decided_cpuvec, '\0', sizeof (decided_cpuvec));
+
+ CPUVEC_SETUP_x86;
+ CPUVEC_SETUP_fat;
+
+ if (! __gmpn_cpuid_available ())
+ {
+ TRACE (printf (" 80386, or early 80486 without cpuid\n"));
+ }
+ else
+ {
+ char vendor_string[13];
+ char dummy_string[12];
+ long fms;
+ int family, model;
+
+ __gmpn_cpuid (vendor_string, 0);
+ vendor_string[12] = 0;
+
+ fms = __gmpn_cpuid (dummy_string, 1);
+ family = ((fms >> 8) & 0xf) + ((fms >> 20) & 0xff);
+ model = ((fms >> 4) & 0xf) + ((fms >> 12) & 0xf0);
+
+ if (strcmp (vendor_string, "GenuineIntel") == 0)
+ {
+ switch (family)
+ {
+ case 4:
+ TRACE (printf (" 80486 with cpuid\n"));
+ break;
+
+ case 5:
+ TRACE (printf (" pentium\n"));
+ CPUVEC_SETUP_pentium;
+ if (model >= 4)
+ {
+ TRACE (printf (" pentiummmx\n"));
+ CPUVEC_SETUP_pentium_mmx;
+ }
+ break;
+
+ case 6:
+ TRACE (printf (" p6\n"));
+ CPUVEC_SETUP_p6;
+ switch (model)
+ {
+ case 0x00:
+ case 0x01:
+ TRACE (printf (" pentiumpro\n"));
+ break;
+
+ case 0x02:
+ case 0x03:
+ case 0x04:
+ case 0x05:
+ case 0x06:
+ TRACE (printf (" pentium2\n"));
+ CPUVEC_SETUP_p6_mmx;
+ break;
+
+ case 0x07:
+ case 0x08:
+ case 0x0a:
+ case 0x0b:
+ case 0x0c:
+ TRACE (printf (" pentium3\n"));
+ CPUVEC_SETUP_p6_mmx;
+ CPUVEC_SETUP_p6_p3mmx;
+ break;
+
+ case 0x09: /* Banias */
+ case 0x0d: /* Dothan */
+ case 0x0e: /* Yonah */
+ TRACE (printf (" Banias/Dothan/Yonah\n"));
+ CPUVEC_SETUP_p6_mmx;
+ CPUVEC_SETUP_p6_p3mmx;
+ CPUVEC_SETUP_p6_sse2;
+ break;
+
+ case 0x0f: /* Conroe Merom Kentsfield Allendale */
+ case 0x10:
+ case 0x11:
+ case 0x12:
+ case 0x13:
+ case 0x14:
+ case 0x15:
+ case 0x16:
+ case 0x17: /* PNR Wolfdale Yorkfield */
+ case 0x18:
+ case 0x19:
+ case 0x1d: /* PNR Dunnington */
+ TRACE (printf (" Conroe\n"));
+ CPUVEC_SETUP_p6_mmx;
+ CPUVEC_SETUP_p6_p3mmx;
+ CPUVEC_SETUP_p6_sse2;
+ CPUVEC_SETUP_core2;
+ break;
+
+ case 0x1c: /* Atom Silverthorne */
+ case 0x26: /* Atom Lincroft */
+ case 0x27: /* Atom Saltwell */
+ case 0x36: /* Atom Cedarview/Saltwell */
+ TRACE (printf (" atom\n"));
+ CPUVEC_SETUP_atom;
+ CPUVEC_SETUP_atom_mmx;
+ CPUVEC_SETUP_atom_sse2;
+ break;
+
+ case 0x1a: /* NHM Gainestown */
+ case 0x1b:
+ case 0x1e: /* NHM Lynnfield/Jasper */
+ case 0x1f:
+ case 0x20:
+ case 0x21:
+ case 0x22:
+ case 0x23:
+ case 0x24:
+ case 0x25: /* WSM Clarkdale/Arrandale */
+ case 0x28:
+ case 0x29:
+ case 0x2b:
+ case 0x2c: /* WSM Gulftown */
+ case 0x2e: /* NHM Beckton */
+ case 0x2f: /* WSM Eagleton */
+ TRACE (printf (" nehalem/westmere\n"));
+ CPUVEC_SETUP_p6_mmx;
+ CPUVEC_SETUP_p6_p3mmx;
+ CPUVEC_SETUP_p6_sse2;
+ CPUVEC_SETUP_core2;
+ CPUVEC_SETUP_coreinhm;
+ break;
+
+ case 0x2a: /* SBR */
+ case 0x2d: /* SBR-EP */
+ case 0x3a: /* IBR */
+ case 0x3c: /* Haswell */
+ TRACE (printf (" sandybridge\n"));
+ CPUVEC_SETUP_p6_mmx;
+ CPUVEC_SETUP_p6_p3mmx;
+ CPUVEC_SETUP_p6_sse2;
+ CPUVEC_SETUP_core2;
+ CPUVEC_SETUP_coreinhm;
+ CPUVEC_SETUP_coreisbr;
+ break;
+ }
+ break;
+
+ case 15:
+ TRACE (printf (" pentium4\n"));
+ CPUVEC_SETUP_pentium4;
+ CPUVEC_SETUP_pentium4_mmx;
+ CPUVEC_SETUP_pentium4_sse2;
+ break;
+ }
+ }
+ else if (strcmp (vendor_string, "AuthenticAMD") == 0)
+ {
+ switch (family)
+ {
+ case 5:
+ if (model <= 3)
+ {
+ TRACE (printf (" k5\n"));
+ }
+ else
+ {
+ TRACE (printf (" k6\n"));
+ CPUVEC_SETUP_k6;
+ CPUVEC_SETUP_k6_mmx;
+ if (model >= 8)
+ {
+ TRACE (printf (" k62\n"));
+ CPUVEC_SETUP_k6_k62mmx;
+ }
+ if (model >= 9)
+ {
+ TRACE (printf (" k63\n"));
+ }
+ }
+ break;
+ case 6:
+ TRACE (printf (" athlon\n"));
+ CPUVEC_SETUP_k7;
+ CPUVEC_SETUP_k7_mmx;
+ break;
+
+ case 0x0f: /* k8 */
+ case 0x11: /* "fam 11h", mix of k8 and k10 */
+ case 0x13: /* unknown, conservatively assume k8 */
+ case 0x16: /* unknown, conservatively assume k8 */
+ case 0x17: /* unknown, conservatively assume k8 */
+ TRACE (printf (" k8\n"));
+ CPUVEC_SETUP_k7;
+ CPUVEC_SETUP_k7_mmx;
+ CPUVEC_SETUP_k8;
+ break;
+
+ case 0x10: /* k10 */
+ case 0x12: /* k10 (llano) */
+ TRACE (printf (" k10\n"));
+ CPUVEC_SETUP_k7;
+ CPUVEC_SETUP_k7_mmx;
+ break;
+
+ case 0x14: /* bobcat */
+ TRACE (printf (" bobcat\n"));
+ CPUVEC_SETUP_k7;
+ CPUVEC_SETUP_k7_mmx;
+ CPUVEC_SETUP_bobcat;
+ break;
+
+ case 0x15: /* bulldozer */
+ TRACE (printf (" bulldozer\n"));
+ CPUVEC_SETUP_k7;
+ CPUVEC_SETUP_k7_mmx;
+ break;
+ }
+ }
+ else if (strcmp (vendor_string, "CentaurHauls") == 0)
+ {
+ switch (family)
+ {
+ case 6:
+ TRACE (printf (" viac3\n"));
+ if (model >= 9)
+ {
+ TRACE (printf (" viac32\n"));
+ }
+ if (model >= 15)
+ {
+ TRACE (printf (" nano\n"));
+ CPUVEC_SETUP_nano;
+ }
+ break;
+ }
+ }
+ else if (strcmp (vendor_string, "CyrixInstead") == 0)
+ {
+ /* Should recognize Cyrix' processors too. */
+ TRACE (printf (" cyrix something\n"));
+ }
+ }
+
+ /* There's no x86 generic mpn_preinv_divrem_1 or mpn_preinv_mod_1.
+ Instead default to the plain versions from whichever CPU we detected.
+ The function arguments are compatible, no need for any glue code. */
+ if (decided_cpuvec.preinv_divrem_1 == NULL)
+ decided_cpuvec.preinv_divrem_1 =(preinv_divrem_1_t)decided_cpuvec.divrem_1;
+ if (decided_cpuvec.preinv_mod_1 == NULL)
+ decided_cpuvec.preinv_mod_1 =(preinv_mod_1_t) decided_cpuvec.mod_1;
+
+ ASSERT_CPUVEC (decided_cpuvec);
+ CPUVEC_INSTALL (decided_cpuvec);
+
+ /* Set this once the threshold fields are ready.
+ Use volatile to prevent it getting moved. */
+ *((volatile int *) &__gmpn_cpuvec_initialized) = 1;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/fat/fat_entry.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/fat/fat_entry.asm
new file mode 100644
index 00000000000..6e3cb44dd56
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/fat/fat_entry.asm
@@ -0,0 +1,220 @@
+dnl x86 fat binary entrypoints.
+
+dnl Copyright 2003, 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')
+
+
+dnl Forcibly disable profiling.
+dnl
+dnl The entrypoints and inits are small enough not to worry about, the real
+dnl routines arrived at will have any profiling. Also, the way the code
+dnl here ends with a jump means we won't work properly with the
+dnl "instrument" profiling scheme anyway.
+
+define(`WANT_PROFILING',no)
+
+
+ TEXT
+
+
+dnl Usage: FAT_ENTRY(name, offset)
+dnl
+dnl Emit a fat binary entrypoint function of the given name. This is the
+dnl normal entry for applications, eg. __gmpn_add_n.
+dnl
+dnl The code simply jumps through the function pointer in __gmpn_cpuvec at
+dnl the given "offset" (in bytes).
+dnl
+dnl For non-PIC, the jumps are 5 bytes each, aligning them to 8 should be
+dnl fine for all x86s.
+dnl
+dnl For PIC, the jumps are 20 bytes each, and are best aligned to 16 to
+dnl ensure at least the first two instructions don't cross a cache line
+dnl boundary.
+dnl
+dnl Note the extra `' ahead of PROLOGUE obscures it from the HAVE_NATIVE
+dnl grepping in configure, stopping that code trying to eval something with
+dnl $1 in it.
+
+define(FAT_ENTRY,
+m4_assert_numargs(2)
+` ALIGN(ifdef(`PIC',16,8))
+`'PROLOGUE($1)
+ifdef(`PIC',
+` call L(movl_eip_edx)
+L(entry_here$2):
+ addl $_GLOBAL_OFFSET_TABLE_+[.-L(entry_here$2)], %edx
+ movl GSYM_PREFIX`'__gmpn_cpuvec@GOT(%edx), %edx
+ jmp *m4_empty_if_zero($2)(%edx)
+',`dnl non-PIC
+ jmp *GSYM_PREFIX`'__gmpn_cpuvec+$2
+')
+EPILOGUE()
+')
+
+
+dnl FAT_ENTRY for each CPUVEC_FUNCS_LIST
+dnl
+
+define(`CPUVEC_offset',0)
+foreach(i,
+`FAT_ENTRY(MPN(i),CPUVEC_offset)
+define(`CPUVEC_offset',eval(CPUVEC_offset + 4))',
+CPUVEC_FUNCS_LIST)
+
+ifdef(`PIC',`
+ ALIGN(8)
+L(movl_eip_edx):
+ movl (%esp), %edx
+ ret_internal
+')
+
+
+dnl Usage: FAT_INIT(name, offset)
+dnl
+dnl Emit a fat binary initializer function of the given name. These
+dnl functions are the initial values for the pointers in __gmpn_cpuvec.
+dnl
+dnl The code simply calls __gmpn_cpuvec_init, and then jumps back through
+dnl the __gmpn_cpuvec pointer, at the given "offset" (in bytes).
+dnl __gmpn_cpuvec_init will have stored the address of the selected
+dnl implementation there.
+dnl
+dnl Only one of these routines will be executed, and only once, since after
+dnl that all the __gmpn_cpuvec pointers go to real routines. So there's no
+dnl need for anything special here, just something small and simple. To
+dnl keep code size down, "fat_init" is a shared bit of code, arrived at
+dnl with the offset in %al. %al is used since the movb instruction is 2
+dnl bytes where %eax would be 4.
+dnl
+dnl Note having `PROLOGUE in FAT_INIT obscures that PROLOGUE from the
+dnl HAVE_NATIVE grepping in configure, preventing that code trying to eval
+dnl something with $1 in it.
+
+define(FAT_INIT,
+m4_assert_numargs(2)
+`PROLOGUE($1)
+ movb $`'$2, %al
+ jmp L(fat_init)
+EPILOGUE()
+')
+
+L(fat_init):
+ C al __gmpn_cpuvec byte offset
+
+ movzbl %al, %eax
+ pushl %eax
+
+ifdef(`PIC',`
+ pushl %ebx
+ call L(movl_eip_ebx)
+L(init_here):
+ addl $_GLOBAL_OFFSET_TABLE_+[.-L(init_here)], %ebx
+ call GSYM_PREFIX`'__gmpn_cpuvec_init@PLT
+ movl GSYM_PREFIX`'__gmpn_cpuvec@GOT(%ebx), %edx
+ popl %ebx
+ popl %eax
+ jmp *(%edx,%eax)
+
+L(movl_eip_ebx):
+ movl (%esp), %ebx
+ ret_internal
+
+',`dnl non-PIC
+ call GSYM_PREFIX`'__gmpn_cpuvec_init
+ popl %eax
+ jmp *GSYM_PREFIX`'__gmpn_cpuvec(%eax)
+')
+
+dnl FAT_INIT for each CPUVEC_FUNCS_LIST
+dnl
+
+define(`CPUVEC_offset',0)
+foreach(i,
+`FAT_INIT(MPN(i`'_init),CPUVEC_offset)
+define(`CPUVEC_offset',eval(CPUVEC_offset + 4))',
+CPUVEC_FUNCS_LIST)
+
+
+
+C long __gmpn_cpuid (char dst[12], int id);
+C
+C This is called only once, so just something simple and compact is fine.
+
+defframe(PARAM_ID, 8)
+defframe(PARAM_DST, 4)
+deflit(`FRAME',0)
+
+PROLOGUE(__gmpn_cpuid)
+ pushl %esi FRAME_pushl()
+ pushl %ebx FRAME_pushl()
+ movl PARAM_ID, %eax
+ cpuid
+ movl PARAM_DST, %esi
+ movl %ebx, (%esi)
+ movl %edx, 4(%esi)
+ movl %ecx, 8(%esi)
+ popl %ebx
+ popl %esi
+ ret
+EPILOGUE()
+
+
+C int __gmpn_cpuid_available (void);
+C
+C Return non-zero if the cpuid instruction is available, which means late
+C model 80486 and higher. 80386 and early 80486 don't have cpuid.
+C
+C The test follows Intel AP-485 application note, namely that if bit 21 is
+C modifiable then cpuid is supported. This test is reentrant and thread
+C safe, since of course any interrupt or context switch will preserve the
+C flags while we're tinkering with them.
+C
+C This is called only once, so just something simple and compact is fine.
+
+PROLOGUE(__gmpn_cpuid_available)
+ pushf
+ popl %ecx C old flags
+
+ movl %ecx, %edx
+ xorl $0x200000, %edx
+ pushl %edx
+ popf
+ pushf
+ popl %edx C tweaked flags
+
+ movl $1, %eax
+ cmpl %ecx, %edx
+ jne L(available)
+ xorl %eax, %eax C not changed, so cpuid not available
+
+L(available):
+ ret
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/fat/gcd_1.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/fat/gcd_1.c
new file mode 100644
index 00000000000..f809bd80928
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/fat/gcd_1.c
@@ -0,0 +1,32 @@
+/* Fat binary fallback mpn_gcd_1.
+
+Copyright 2003 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 "mpn/generic/gcd_1.c"
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/fat/gmp-mparam.h b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/fat/gmp-mparam.h
new file mode 100644
index 00000000000..3641a6bafad
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/fat/gmp-mparam.h
@@ -0,0 +1,71 @@
+/* Fat binary x86 gmp-mparam.h -- Compiler/machine parameter header file.
+
+Copyright 1991, 1993, 1994, 2000-2003, 2011 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
+
+
+/* mpn_divexact_1 is faster than mpn_divrem_1 at all sizes. The only time
+ this might not be true currently is for actual 80386 and 80486 chips,
+ where mpn/x86/dive_1.asm might be slower than mpn/x86/divrem_1.asm, but
+ that's not worth worrying about. */
+#define DIVEXACT_1_THRESHOLD 0
+
+/* Only some of the x86s have an mpn_preinv_divrem_1, but we set
+ USE_PREINV_DIVREM_1 so that all callers use it, and then let the
+ __gmpn_cpuvec pointer go to plain mpn_divrem_1 if there's not an actual
+ preinv. */
+#define USE_PREINV_DIVREM_1 1
+
+#define BMOD_1_TO_MOD_1_THRESHOLD 20
+
+/* mpn_sqr_basecase is faster than mpn_mul_basecase at all sizes, no need
+ for mpn_sqr to call the latter. */
+#define SQR_BASECASE_THRESHOLD 0
+
+/* Sensible fallbacks for these, when not taken from a cpu-specific
+ gmp-mparam.h. */
+#define MUL_TOOM22_THRESHOLD 20
+#define MUL_TOOM33_THRESHOLD 130
+#define SQR_TOOM2_THRESHOLD 30
+#define SQR_TOOM3_THRESHOLD 200
+
+/* These are values more or less in the middle of what the typical x86 chips
+ come out as. For a fat binary it's necessary to have values for these,
+ since the defaults for MUL_FFT_TABLE and SQR_FFT_TABLE otherwise come out
+ as non-constant array initializers. FIXME: Perhaps these should be done
+ in the cpuvec structure like other thresholds. */
+#define MUL_FFT_TABLE { 464, 928, 1920, 3584, 10240, 40960, 0 }
+#define MUL_FFT_MODF_THRESHOLD 400
+#define MUL_FFT_THRESHOLD 2000
+
+#define SQR_FFT_TABLE { 528, 1184, 1920, 4608, 14336, 40960, 0 }
+#define SQR_FFT_MODF_THRESHOLD 500
+#define SQR_FFT_THRESHOLD 3000
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/fat/lshiftc.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/fat/lshiftc.c
new file mode 100644
index 00000000000..9ecf48978f9
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/fat/lshiftc.c
@@ -0,0 +1,32 @@
+/* Fat binary fallback mpn_lshiftc.
+
+Copyright 2003, 2009, 2011 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 "mpn/generic/lshiftc.c"
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/fat/mod_1.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/fat/mod_1.c
new file mode 100644
index 00000000000..4f149cc353c
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/fat/mod_1.c
@@ -0,0 +1,32 @@
+/* Fat binary fallback mpn_mod_1.
+
+Copyright 2003, 2009 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 "mpn/generic/mod_1.c"
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/fat/mod_1_1.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/fat/mod_1_1.c
new file mode 100644
index 00000000000..92eaa7a87f6
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/fat/mod_1_1.c
@@ -0,0 +1,36 @@
+/* Fat binary fallback mpn_mod_1_1p.
+
+Copyright 2003, 2009, 2011 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/. */
+
+/*
+PROLOGUE(mpn_mod_1_1p_cps)
+*/
+
+#define OPERATION_mod_1_1_cps 1
+#include "mpn/generic/mod_1_1.c"
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/fat/mod_1_2.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/fat/mod_1_2.c
new file mode 100644
index 00000000000..9095a61c938
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/fat/mod_1_2.c
@@ -0,0 +1,36 @@
+/* Fat binary fallback mpn_mod_1s_2p.
+
+Copyright 2003, 2009, 2011 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/. */
+
+/*
+PROLOGUE(mpn_mod_1s_2p_cps)
+*/
+
+#define OPERATION_mod_1_2_cps 1
+#include "mpn/generic/mod_1_2.c"
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/fat/mod_1_4.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/fat/mod_1_4.c
new file mode 100644
index 00000000000..51c0def4439
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/fat/mod_1_4.c
@@ -0,0 +1,36 @@
+/* Fat binary fallback mpn_mod_1s_4p.
+
+Copyright 2003, 2009, 2011 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/. */
+
+/*
+PROLOGUE(mpn_mod_1s_4p_cps)
+*/
+
+#define OPERATION_mod_1_4_cps 1
+#include "mpn/generic/mod_1_4.c"
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/fat/mode1o.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/fat/mode1o.c
new file mode 100644
index 00000000000..870ddb899bd
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/fat/mode1o.c
@@ -0,0 +1,32 @@
+/* Fat binary fallback mpn_modexact_1c_odd.
+
+Copyright 2003 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 "mpn/generic/mode1o.c"
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/fat/mullo_basecase.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/fat/mullo_basecase.c
new file mode 100644
index 00000000000..7f86be64c52
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/fat/mullo_basecase.c
@@ -0,0 +1,32 @@
+/* Fat binary fallback mpn_mullo_basecase.
+
+Copyright 2012 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 "mpn/generic/mullo_basecase.c"
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/fat/redc_1.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/fat/redc_1.c
new file mode 100644
index 00000000000..00254033538
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/fat/redc_1.c
@@ -0,0 +1,32 @@
+/* Fat binary fallback mpn_redc_1.
+
+Copyright 2012 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 "mpn/generic/redc_1.c"
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/fat/redc_2.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/fat/redc_2.c
new file mode 100644
index 00000000000..1932d583231
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/fat/redc_2.c
@@ -0,0 +1,32 @@
+/* Fat binary fallback mpn_redc_2.
+
+Copyright 2012 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 "mpn/generic/redc_2.c"
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/geode/gmp-mparam.h b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/geode/gmp-mparam.h
new file mode 100644
index 00000000000..cc9c9f17893
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/geode/gmp-mparam.h
@@ -0,0 +1,141 @@
+/* Generic x86 gmp-mparam.h -- Compiler/machine parameter header file.
+
+Copyright 1991, 1993, 1994, 2000-2002, 2011 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
+
+/* Generated by tuneup.c, 2011-01-30, gcc 3.4 */
+
+#define MOD_1_NORM_THRESHOLD 6
+#define MOD_1_UNNORM_THRESHOLD MP_SIZE_T_MAX /* never */
+#define MOD_1N_TO_MOD_1_1_THRESHOLD 17
+#define MOD_1U_TO_MOD_1_1_THRESHOLD 9
+#define MOD_1_1_TO_MOD_1_2_THRESHOLD 0 /* never mpn_mod_1_1p */
+#define MOD_1_2_TO_MOD_1_4_THRESHOLD 14
+#define PREINV_MOD_1_TO_MOD_1_THRESHOLD MP_SIZE_T_MAX /* never */
+#define USE_PREINV_DIVREM_1 0
+#define DIVEXACT_1_THRESHOLD 0 /* always (native) */
+#define BMOD_1_TO_MOD_1_THRESHOLD 42
+
+#define MUL_TOOM22_THRESHOLD 18
+#define MUL_TOOM33_THRESHOLD 66
+#define MUL_TOOM44_THRESHOLD 105
+#define MUL_TOOM6H_THRESHOLD 141
+#define MUL_TOOM8H_THRESHOLD 212
+
+#define MUL_TOOM32_TO_TOOM43_THRESHOLD 62
+#define MUL_TOOM32_TO_TOOM53_THRESHOLD 69
+#define MUL_TOOM42_TO_TOOM53_THRESHOLD 65
+#define MUL_TOOM42_TO_TOOM63_THRESHOLD 67
+
+#define SQR_BASECASE_THRESHOLD 0 /* always (native) */
+#define SQR_TOOM2_THRESHOLD 33
+#define SQR_TOOM3_THRESHOLD 60
+#define SQR_TOOM4_THRESHOLD 136
+#define SQR_TOOM6_THRESHOLD 196
+#define SQR_TOOM8_THRESHOLD 292
+
+#define MULMOD_BNM1_THRESHOLD 14
+#define SQRMOD_BNM1_THRESHOLD 16
+
+#define MUL_FFT_MODF_THRESHOLD 468 /* k = 5 */
+#define MUL_FFT_TABLE3 \
+ { { 468, 5}, { 17, 6}, { 9, 5}, { 19, 6}, \
+ { 11, 5}, { 23, 6}, { 21, 7}, { 11, 6}, \
+ { 25, 7}, { 13, 6}, { 27, 7}, { 15, 6}, \
+ { 31, 7}, { 21, 8}, { 11, 7}, { 27, 8}, \
+ { 15, 7}, { 33, 8}, { 19, 7}, { 39, 8}, \
+ { 23, 7}, { 47, 8}, { 27, 9}, { 15, 8}, \
+ { 39, 9}, { 23, 8}, { 47,10}, { 15, 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, 9}, { 255,10}, { 143, 9}, \
+ { 287,10}, { 159,11}, { 95,10}, { 191, 9}, \
+ { 383,12}, { 4096,13}, { 8192,14}, { 16384,15}, \
+ { 32768,16} }
+#define MUL_FFT_TABLE3_SIZE 61
+#define MUL_FFT_THRESHOLD 5504
+
+#define SQR_FFT_MODF_THRESHOLD 396 /* k = 5 */
+#define SQR_FFT_TABLE3 \
+ { { 396, 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}, { 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, 9}, \
+ { 55,10}, { 31, 9}, { 79,10}, { 47, 9}, \
+ { 95,11}, { 31,10}, { 63, 9}, { 127, 8}, \
+ { 255, 9}, { 135,10}, { 79, 9}, { 159, 8}, \
+ { 319,10}, { 95, 9}, { 191,11}, { 63,10}, \
+ { 127, 9}, { 255, 8}, { 511,10}, { 143, 9}, \
+ { 287, 8}, { 575,10}, { 159,11}, { 95,10}, \
+ { 191,12}, { 4096,13}, { 8192,14}, { 16384,15}, \
+ { 32768,16} }
+#define SQR_FFT_TABLE3_SIZE 61
+#define SQR_FFT_THRESHOLD 3712
+
+#define MULLO_BASECASE_THRESHOLD 3
+#define MULLO_DC_THRESHOLD 37
+#define MULLO_MUL_N_THRESHOLD 10950
+
+#define DC_DIV_QR_THRESHOLD 59
+#define DC_DIVAPPR_Q_THRESHOLD 189
+#define DC_BDIV_QR_THRESHOLD 55
+#define DC_BDIV_Q_THRESHOLD 136
+
+#define INV_MULMOD_BNM1_THRESHOLD 50
+#define INV_NEWTON_THRESHOLD 183
+#define INV_APPR_THRESHOLD 181
+
+#define BINV_NEWTON_THRESHOLD 204
+#define REDC_1_TO_REDC_N_THRESHOLD 54
+
+#define MU_DIV_QR_THRESHOLD 1142
+#define MU_DIVAPPR_Q_THRESHOLD 1142
+#define MUPI_DIV_QR_THRESHOLD 81
+#define MU_BDIV_QR_THRESHOLD 889
+#define MU_BDIV_Q_THRESHOLD 998
+
+#define MATRIX22_STRASSEN_THRESHOLD 13
+#define HGCD_THRESHOLD 133
+#define GCD_DC_THRESHOLD 451
+#define GCDEXT_DC_THRESHOLD 318
+#define JACOBI_BASE_METHOD 1
+
+#define GET_STR_DC_THRESHOLD 15
+#define GET_STR_PRECOMPUTE_THRESHOLD 30
+#define SET_STR_DC_THRESHOLD 547
+#define SET_STR_PRECOMPUTE_THRESHOLD 1049
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/gmp-mparam.h b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/gmp-mparam.h
new file mode 100644
index 00000000000..2cb19848892
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/gmp-mparam.h
@@ -0,0 +1,38 @@
+/* Generic x86 gmp-mparam.h -- Compiler/machine parameter header file.
+
+Copyright 1991, 1993, 1994, 2000-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/. */
+
+#define GMP_LIMB_BITS 32
+#define GMP_LIMB_BYTES 4
+
+
+/* Generic x86 mpn_divexact_1 is faster than generic x86 mpn_divrem_1 on all
+ of p5, p6, k6 and k7, so use it always. It's probably slower on 386 and
+ 486, but that's too bad. */
+#define DIVEXACT_1_THRESHOLD 0
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/i486/gmp-mparam.h b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/i486/gmp-mparam.h
new file mode 100644
index 00000000000..aa7dbad45ba
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/i486/gmp-mparam.h
@@ -0,0 +1,69 @@
+/* 80486 gmp-mparam.h -- Compiler/machine parameter header file.
+
+Copyright 2001-2003 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
+
+
+/* 100MHz DX4 */
+
+/* Generated by tuneup.c, 2003-02-13, gcc 2.95 */
+
+#define MUL_TOOM22_THRESHOLD 18
+#define MUL_TOOM33_THRESHOLD 228
+
+#define SQR_BASECASE_THRESHOLD 13
+#define SQR_TOOM2_THRESHOLD 49
+#define SQR_TOOM3_THRESHOLD 238
+
+#define DIV_SB_PREINV_THRESHOLD MP_SIZE_T_MAX /* never */
+#define DIV_DC_THRESHOLD 72
+#define POWM_THRESHOLD 38
+
+#define GCD_ACCEL_THRESHOLD 3
+#define JACOBI_BASE_METHOD 2
+
+#define USE_PREINV_DIVREM_1 0
+#define USE_PREINV_MOD_1 0
+#define DIVREM_2_THRESHOLD MP_SIZE_T_MAX /* never */
+#define DIVEXACT_1_THRESHOLD 0 /* always (native) */
+#define MODEXACT_1_ODD_THRESHOLD 17
+
+#define GET_STR_DC_THRESHOLD 32
+#define GET_STR_PRECOMPUTE_THRESHOLD 82
+#define SET_STR_THRESHOLD 3524
+
+#define MUL_FFT_TABLE { 464, 928, 1920, 4608, 10240, 40960, 0 }
+#define MUL_FFT_MODF_THRESHOLD 392
+#define MUL_FFT_THRESHOLD 2816
+
+#define SQR_FFT_TABLE { 432, 928, 1920, 4608, 14336, 40960, 0 }
+#define SQR_FFT_MODF_THRESHOLD 392
+#define SQR_FFT_THRESHOLD 2816
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k10/gmp-mparam.h b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k10/gmp-mparam.h
new file mode 100644
index 00000000000..2a1ae5a6bb1
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k10/gmp-mparam.h
@@ -0,0 +1,211 @@
+/* x86/k10 gmp-mparam.h -- Compiler/machine parameter header file.
+
+Copyright 1991, 1993, 1994, 2000-2011, 2014 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
+
+/* 2400 MHz K10 Barcelona */
+/* FFT tuning limit = 25000000 */
+/* Generated by tuneup.c, 2014-03-13, gcc 4.5 */
+
+#define MOD_1_NORM_THRESHOLD 0 /* always */
+#define MOD_1_UNNORM_THRESHOLD 0 /* always */
+#define MOD_1N_TO_MOD_1_1_THRESHOLD 12
+#define MOD_1U_TO_MOD_1_1_THRESHOLD 7
+#define MOD_1_1_TO_MOD_1_2_THRESHOLD 9
+#define MOD_1_2_TO_MOD_1_4_THRESHOLD 12
+#define PREINV_MOD_1_TO_MOD_1_THRESHOLD 15
+#define USE_PREINV_DIVREM_1 1 /* native */
+#define DIV_QR_1N_PI1_METHOD 1
+#define DIV_QR_1_NORM_THRESHOLD 1
+#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 32
+
+#define MUL_TOOM22_THRESHOLD 24
+#define MUL_TOOM33_THRESHOLD 81
+#define MUL_TOOM44_THRESHOLD 130
+#define MUL_TOOM6H_THRESHOLD 189
+#define MUL_TOOM8H_THRESHOLD 430
+
+#define MUL_TOOM32_TO_TOOM43_THRESHOLD 81
+#define MUL_TOOM32_TO_TOOM53_THRESHOLD 91
+#define MUL_TOOM42_TO_TOOM53_THRESHOLD 82
+#define MUL_TOOM42_TO_TOOM63_THRESHOLD 90
+#define MUL_TOOM43_TO_TOOM54_THRESHOLD 112
+
+#define SQR_BASECASE_THRESHOLD 0 /* always (native) */
+#define SQR_TOOM2_THRESHOLD 38
+#define SQR_TOOM3_THRESHOLD 77
+#define SQR_TOOM4_THRESHOLD 184
+#define SQR_TOOM6_THRESHOLD 262
+#define SQR_TOOM8_THRESHOLD 369
+
+#define MULMID_TOOM42_THRESHOLD 56
+
+#define MULMOD_BNM1_THRESHOLD 17
+#define SQRMOD_BNM1_THRESHOLD 18
+
+#define MUL_FFT_MODF_THRESHOLD 765 /* k = 5 */
+#define MUL_FFT_TABLE3 \
+ { { 765, 5}, { 25, 6}, { 13, 5}, { 27, 6}, \
+ { 25, 7}, { 13, 6}, { 27, 7}, { 15, 6}, \
+ { 31, 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,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}, { 199,10}, \
+ { 111,11}, { 63,10}, { 127, 9}, { 263,10}, \
+ { 175,11}, { 95,10}, { 207,12}, { 63,11}, \
+ { 127,10}, { 255, 9}, { 543, 8}, { 1087, 9}, \
+ { 575,11}, { 159,10}, { 319, 9}, { 671, 8}, \
+ { 1343, 9}, { 735,11}, { 191, 9}, { 799, 8}, \
+ { 1599,10}, { 415, 9}, { 863,11}, { 223,12}, \
+ { 127,11}, { 255,10}, { 543, 9}, { 1087,10}, \
+ { 607, 9}, { 1215, 8}, { 2431,11}, { 319,10}, \
+ { 671, 9}, { 1343,10}, { 735,12}, { 191,11}, \
+ { 383,10}, { 799, 9}, { 1599,11}, { 415,10}, \
+ { 863, 9}, { 1727,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, 8}, { 5887,12}, \
+ { 383,11}, { 799,10}, { 1599,11}, { 863,10}, \
+ { 1727,12}, { 447,11}, { 959,10}, { 1919,11}, \
+ { 991,10}, { 1983,13}, { 255,12}, { 511,11}, \
+ { 1087,12}, { 575,11}, { 1215,10}, { 2431,12}, \
+ { 639,11}, { 1343,12}, { 703,11}, { 1471,10}, \
+ { 2943, 9}, { 5887,13}, { 383,12}, { 767,11}, \
+ { 1599,12}, { 831,11}, { 1727,10}, { 3455,12}, \
+ { 959,11}, { 1983,14}, { 255,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}, \
+ { 1983,14}, { 511,13}, { 1023,12}, { 2239,13}, \
+ { 1151,12}, { 2495,13}, { 1407,12}, { 2943,11}, \
+ { 5887,14}, { 767,13}, { 1663,12}, { 3455,13}, \
+ { 1919,12}, { 3839,15}, { 511,14}, { 1023,13}, \
+ { 2175,12}, { 4351,13}, { 2431,14}, { 1279,13}, \
+ { 2943,12}, { 5887,14}, { 16384,15}, { 32768,16} }
+#define MUL_FFT_TABLE3_SIZE 172
+#define MUL_FFT_THRESHOLD 6784
+
+#define SQR_FFT_MODF_THRESHOLD 555 /* k = 5 */
+#define SQR_FFT_TABLE3 \
+ { { 555, 5}, { 21, 6}, { 11, 5}, { 25, 6}, \
+ { 13, 5}, { 27, 6}, { 27, 7}, { 15, 6}, \
+ { 32, 7}, { 17, 6}, { 35, 7}, { 19, 6}, \
+ { 39, 7}, { 27, 8}, { 15, 7}, { 35, 8}, \
+ { 19, 7}, { 39, 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,10}, { 31, 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}, { 143, 9}, { 287, 8}, \
+ { 575,10}, { 159,11}, { 95,10}, { 191,12}, \
+ { 63,11}, { 127,10}, { 255, 9}, { 543, 8}, \
+ { 1087,10}, { 287, 9}, { 607,11}, { 159,10}, \
+ { 319, 9}, { 671, 8}, { 1343,10}, { 351, 9}, \
+ { 735, 8}, { 1471,11}, { 191,10}, { 383, 9}, \
+ { 767,10}, { 399, 9}, { 799, 8}, { 1599,10}, \
+ { 415, 9}, { 863,11}, { 223,10}, { 479,12}, \
+ { 127,11}, { 255,10}, { 543, 9}, { 1087,11}, \
+ { 287,10}, { 607, 9}, { 1215, 8}, { 2431,11}, \
+ { 319,10}, { 671, 9}, { 1343,11}, { 351,10}, \
+ { 735, 9}, { 1471,12}, { 191,11}, { 383,10}, \
+ { 799, 9}, { 1599,11}, { 415,10}, { 863, 9}, \
+ { 1727,11}, { 479,13}, { 127,12}, { 255,11}, \
+ { 511,10}, { 1023,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,11}, { 991,10}, { 1983,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}, \
+ { 1983,13}, { 511,12}, { 1215,11}, { 2431,13}, \
+ { 639,12}, { 1471,11}, { 2943,13}, { 767,12}, \
+ { 1727,11}, { 3455,13}, { 895,12}, { 1983,14}, \
+ { 511,13}, { 1023,12}, { 2111,13}, { 1151,12}, \
+ { 2431,13}, { 1407,12}, { 2943,14}, { 767,13}, \
+ { 1663,12}, { 3455,13}, { 1919,12}, { 3839,15}, \
+ { 511,14}, { 1023,13}, { 2431,14}, { 1279,13}, \
+ { 2943,12}, { 5887,14}, { 16384,15}, { 32768,16} }
+#define SQR_FFT_TABLE3_SIZE 172
+#define SQR_FFT_THRESHOLD 5504
+
+#define MULLO_BASECASE_THRESHOLD 7
+#define MULLO_DC_THRESHOLD 40
+#define MULLO_MUL_N_THRESHOLD 13463
+
+#define DC_DIV_QR_THRESHOLD 59
+#define DC_DIVAPPR_Q_THRESHOLD 270
+#define DC_BDIV_QR_THRESHOLD 55
+#define DC_BDIV_Q_THRESHOLD 206
+
+#define INV_MULMOD_BNM1_THRESHOLD 62
+#define INV_NEWTON_THRESHOLD 254
+#define INV_APPR_THRESHOLD 252
+
+#define BINV_NEWTON_THRESHOLD 274
+#define REDC_1_TO_REDC_N_THRESHOLD 74
+
+#define MU_DIV_QR_THRESHOLD 1589
+#define MU_DIVAPPR_Q_THRESHOLD 1589
+#define MUPI_DIV_QR_THRESHOLD 106
+#define MU_BDIV_QR_THRESHOLD 1470
+#define MU_BDIV_Q_THRESHOLD 1558
+
+#define POWM_SEC_TABLE 1,16,114,428,1240
+
+#define MATRIX22_STRASSEN_THRESHOLD 19
+#define HGCD_THRESHOLD 136
+#define HGCD_APPR_THRESHOLD 175
+#define HGCD_REDUCE_THRESHOLD 3389
+#define GCD_DC_THRESHOLD 595
+#define GCDEXT_DC_THRESHOLD 424
+#define JACOBI_BASE_METHOD 4
+
+#define GET_STR_DC_THRESHOLD 15
+#define GET_STR_PRECOMPUTE_THRESHOLD 28
+#define SET_STR_DC_THRESHOLD 100
+#define SET_STR_PRECOMPUTE_THRESHOLD 1360
+
+#define FAC_DSC_THRESHOLD 224
+#define FAC_ODD_THRESHOLD 29
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k6/README b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k6/README
new file mode 100644
index 00000000000..1d65af3851f
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k6/README
@@ -0,0 +1,251 @@
+Copyright 2000, 2001 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/.
+
+
+
+
+ AMD K6 MPN SUBROUTINES
+
+
+
+This directory contains code optimized for AMD K6 CPUs, meaning K6, K6-2 and
+K6-3.
+
+The mmx subdirectory has MMX code suiting plain K6, the k62mmx subdirectory
+has MMX code suiting K6-2 and K6-3. All chips in the K6 family have MMX,
+the separate directories are just so that ./configure can omit them if the
+assembler doesn't support MMX.
+
+
+
+
+STATUS
+
+Times for the loops, with all code and data in L1 cache, are as follows.
+
+ cycles/limb
+
+ mpn_add_n/sub_n 3.25 normal, 2.75 in-place
+
+ mpn_mul_1 6.25
+ mpn_add/submul_1 7.65-8.4 (varying with data values)
+
+ mpn_mul_basecase 9.25 cycles/crossproduct (approx)
+ mpn_sqr_basecase 4.7 cycles/crossproduct (approx)
+ or 9.2 cycles/triangleproduct (approx)
+
+ mpn_l/rshift 3.0
+
+ mpn_divrem_1 20.0
+ mpn_mod_1 20.0
+ mpn_divexact_by3 11.0
+
+ mpn_copyi 1.0
+ mpn_copyd 1.0
+
+
+K6-2 and K6-3 have dual-issue MMX and get the following improvements.
+
+ mpn_l/rshift 1.75
+
+
+Prefetching of sources hasn't yet given any joy. With the 3DNow "prefetch"
+instruction, code seems to run slower, and with just "mov" loads it doesn't
+seem faster. Results so far are inconsistent. The K6 does a hardware
+prefetch of the second cache line in a sector, so the penalty for not
+prefetching in software is reduced.
+
+
+
+
+NOTES
+
+All K6 family chips have MMX, but only K6-2 and K6-3 have 3DNow.
+
+Plain K6 executes MMX instructions only in the X pipe, but K6-2 and K6-3 can
+execute them in both X and Y (and in both together).
+
+Branch misprediction penalty is 1 to 4 cycles (Optimization Manual
+chapter 6 table 12).
+
+Write-allocate L1 data cache means prefetching of destinations is unnecessary.
+Store queue is 7 entries of 64 bits each.
+
+Floating point multiplications can be done in parallel with integer
+multiplications, but there doesn't seem to be any way to make use of this.
+
+
+
+OPTIMIZATIONS
+
+Unrolled loops are used to reduce looping overhead. The unrolling is
+configurable up to 32 limbs/loop for most routines, up to 64 for some.
+
+Sometimes computed jumps into the unrolling are used to handle sizes not a
+multiple of the unrolling. An attractive feature of this is that times
+smoothly increase with operand size, but an indirect jump is about 6 cycles
+and the setups about another 6, so it depends on how much the unrolled code
+is faster than a simple loop as to whether a computed jump ought to be used.
+
+Position independent code is implemented using a call to get eip for
+computed jumps and a ret is always done, rather than an addl $4,%esp or a
+popl, so the CPU return address branch prediction stack stays synchronised
+with the actual stack in memory. Such a call however still costs 4 to 7
+cycles.
+
+Branch prediction, in absence of any history, will guess forward jumps are
+not taken and backward jumps are taken. Where possible it's arranged that
+the less likely or less important case is under a taken forward jump.
+
+
+
+MMX
+
+Putting emms or femms as late as possible in a routine seems to be fastest.
+Perhaps an emms or femms stalls until all outstanding MMX instructions have
+completed, so putting it later gives them a chance to complete on their own,
+in parallel with other operations (like register popping).
+
+The Optimization Manual chapter 5 recommends using a femms on K6-2 and K6-3
+at the start of a routine, in case it's been preceded by x87 floating point
+operations. This isn't done because in gmp programs it's expected that x87
+floating point won't be much used and that chances are an mpn routine won't
+have been preceded by any x87 code.
+
+
+
+CODING
+
+Instructions in general code are shown paired if they can decode and execute
+together, meaning two short decode instructions with the second not
+depending on the first, only the first using the shifter, no more than one
+load, and no more than one store.
+
+K6 does some out of order execution so the pairings aren't essential, they
+just show what slots might be available. When decoding is the limiting
+factor things can be scheduled that might not execute until later.
+
+
+
+NOTES
+
+Code alignment
+
+- if an opcode/modrm or 0Fh/opcode/modrm crosses a cache line boundary,
+ short decode is inhibited. The cross.pl script detects this.
+
+- loops and branch targets should be aligned to 16 bytes, or ensure at least
+ 2 instructions before a 32 byte boundary. This makes use of the 16 byte
+ cache in the BTB.
+
+Addressing modes
+
+- (%esi) degrades decoding from short to vector. 0(%esi) doesn't have this
+ problem, and can be used as an equivalent, or easier is just to use a
+ different register, like %ebx.
+
+- K6 and pre-CXT core K6-2 have the following problem. (K6-2 CXT and K6-3
+ have it fixed, these being cpuid function 1 signatures 0x588 to 0x58F).
+
+ If more than 3 bytes are needed to determine instruction length then
+ decoding degrades from direct to long, or from long to vector. This
+ happens with forms like "0F opcode mod/rm" with mod/rm=00-xxx-100 since
+ with mod=00 the sib determines whether there's a displacement.
+
+ This affects all MMX and 3DNow instructions, and others with an 0F prefix,
+ like movzbl. The modes affected are anything with an index and no
+ displacement, or an index but no base, and this includes (%esp) which is
+ really (,%esp,1).
+
+ The cross.pl script detects problem cases. The workaround is to always
+ use a displacement, and to do this with Zdisp if it's zero so the
+ assembler doesn't discard it.
+
+ See Optimization Manual rev D page 67 and 3DNow Porting Guide rev B pages
+ 13-14 and 36-37.
+
+Calls
+
+- indirect jumps and calls are not branch predicted, they measure about 6
+ cycles.
+
+Various
+
+- adcl 2 cycles of decode, maybe 2 cycles executing in the X pipe
+- bsf 12-27 cycles
+- emms 5 cycles
+- femms 3 cycles
+- jecxz 2 cycles taken, 13 not taken (optimization manual says 7 not taken)
+- divl 20 cycles back-to-back
+- imull 2 decode, 3 execute
+- mull 2 decode, 3 execute (optimization manual decoding sample)
+- prefetch 2 cycles
+- rcll/rcrl implicit by one bit: 2 cycles
+ immediate or %cl count: 11 + 2 per bit for dword
+ 13 + 4 per bit for byte
+- setCC 2 cycles
+- xchgl %eax,reg 1.5 cycles, back-to-back (strange)
+ reg,reg 2 cycles, back-to-back
+
+
+
+
+REFERENCES
+
+"AMD-K6 Processor Code Optimization Application Note", AMD publication
+number 21924, revision D amendment 0, January 2000. This describes K6-2 and
+K6-3. Available on-line,
+
+http://www.amd.com/us-en/assets/content_type/white_papers_and_tech_docs/21924.pdf
+
+"AMD-K6 MMX Enhanced Processor x86 Code Optimization Application Note", AMD
+publication number 21828, revision A amendment 0, August 1997. This is an
+older edition of the above document, describing plain K6. Available
+on-line,
+
+http://www.amd.com/us-en/assets/content_type/white_papers_and_tech_docs/21828.pdf
+
+"3DNow Technology Manual", AMD publication number 21928G/0-March 2000.
+This describes the femms and prefetch instructions, but nothing else from
+3DNow has been used. Available on-line,
+
+http://www.amd.com/us-en/assets/content_type/white_papers_and_tech_docs/21928.pdf
+
+"3DNow Instruction Porting Guide", AMD publication number 22621, revision B,
+August 1999. This has some notes on general K6 optimizations as well as
+3DNow. Available on-line,
+
+http://www.amd.com/us-en/assets/content_type/white_papers_and_tech_docs/22621.pdf
+
+
+
+----------------
+Local variables:
+mode: text
+fill-column: 76
+End:
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k6/aors_n.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k6/aors_n.asm
new file mode 100644
index 00000000000..168f9b4ae4a
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k6/aors_n.asm
@@ -0,0 +1,337 @@
+dnl AMD K6 mpn_add/sub_n -- mpn addition or subtraction.
+
+dnl Copyright 1999-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 K6: normal 3.25 cycles/limb, in-place 2.75 cycles/limb.
+
+
+ifdef(`OPERATION_add_n', `
+ define(M4_inst, adcl)
+ define(M4_function_n, mpn_add_n)
+ define(M4_function_nc, mpn_add_nc)
+ define(M4_description, add)
+',`ifdef(`OPERATION_sub_n', `
+ define(M4_inst, sbbl)
+ define(M4_function_n, mpn_sub_n)
+ define(M4_function_nc, mpn_sub_nc)
+ define(M4_description, subtract)
+',`m4_error(`Need OPERATION_add_n or OPERATION_sub_n
+')')')
+
+MULFUNC_PROLOGUE(mpn_add_n mpn_add_nc mpn_sub_n mpn_sub_nc)
+
+
+C mp_limb_t M4_function_n (mp_ptr dst, mp_srcptr src1, mp_srcptr src2,
+C mp_size_t size);
+C mp_limb_t M4_function_nc (mp_ptr dst, mp_srcptr src1, mp_srcptr src2,
+C mp_size_t size, mp_limb_t carry);
+C
+C Calculate src1,size M4_description src2,size, and store the result in
+C dst,size. The return value is the carry bit from the top of the result
+C (1 or 0).
+C
+C The _nc version accepts 1 or 0 for an initial carry into the low limb of
+C the calculation. Note values other than 1 or 0 here will lead to garbage
+C results.
+C
+C Instruction decoding limits a normal dst=src1+src2 operation to 3 c/l, and
+C an in-place dst+=src to 2.5 c/l. The unrolled loops have 1 cycle/loop of
+C loop control, which with 4 limbs/loop means an extra 0.25 c/l.
+
+define(PARAM_CARRY, `FRAME+20(%esp)')
+define(PARAM_SIZE, `FRAME+16(%esp)')
+define(PARAM_SRC2, `FRAME+12(%esp)')
+define(PARAM_SRC1, `FRAME+8(%esp)')
+define(PARAM_DST, `FRAME+4(%esp)')
+deflit(`FRAME',0)
+
+dnl minimum 5 because the unrolled code can't handle less
+deflit(UNROLL_THRESHOLD, 5)
+
+ TEXT
+ ALIGN(32)
+
+PROLOGUE(M4_function_nc)
+ movl PARAM_CARRY, %eax
+ jmp L(start)
+EPILOGUE()
+
+
+PROLOGUE(M4_function_n)
+ xorl %eax, %eax
+L(start):
+ movl PARAM_SIZE, %ecx
+ pushl %ebx
+FRAME_pushl()
+
+ movl PARAM_SRC1, %ebx
+ pushl %edi
+FRAME_pushl()
+
+ movl PARAM_SRC2, %edx
+ cmpl $UNROLL_THRESHOLD, %ecx
+
+ movl PARAM_DST, %edi
+ jae L(unroll)
+
+
+ shrl %eax C initial carry flag
+
+ C offset 0x21 here, close enough to aligned
+L(simple):
+ C eax scratch
+ C ebx src1
+ C ecx counter
+ C edx src2
+ C esi
+ C edi dst
+ C ebp
+ C
+ C The store to (%edi) could be done with a stosl; it'd be smaller
+ C code, but there's no speed gain and a cld would have to be added
+ C (per mpn/x86/README).
+
+ movl (%ebx), %eax
+ leal 4(%ebx), %ebx
+
+ M4_inst (%edx), %eax
+
+ movl %eax, (%edi)
+ leal 4(%edi), %edi
+
+ leal 4(%edx), %edx
+ loop L(simple)
+
+
+ movl $0, %eax
+ popl %edi
+
+ setc %al
+
+ popl %ebx
+ ret
+
+
+C -----------------------------------------------------------------------------
+L(unroll):
+ C eax carry
+ C ebx src1
+ C ecx counter
+ C edx src2
+ C esi
+ C edi dst
+ C ebp
+
+ cmpl %edi, %ebx
+ pushl %esi
+
+ je L(inplace)
+
+ifdef(`OPERATION_add_n',`
+ cmpl %edi, %edx
+
+ je L(inplace_reverse)
+')
+
+ movl %ecx, %esi
+
+ andl $-4, %ecx
+ andl $3, %esi
+
+ leal (%ebx,%ecx,4), %ebx
+ leal (%edx,%ecx,4), %edx
+ leal (%edi,%ecx,4), %edi
+
+ negl %ecx
+ shrl %eax
+
+ ALIGN(32)
+L(normal_top):
+ C eax counter, qwords, negative
+ C ebx src1
+ C ecx scratch
+ C edx src2
+ C esi
+ C edi dst
+ C ebp
+
+ movl (%ebx,%ecx,4), %eax
+ leal 5(%ecx), %ecx
+ M4_inst -20(%edx,%ecx,4), %eax
+ movl %eax, -20(%edi,%ecx,4)
+
+ movl 4-20(%ebx,%ecx,4), %eax
+ M4_inst 4-20(%edx,%ecx,4), %eax
+ movl %eax, 4-20(%edi,%ecx,4)
+
+ movl 8-20(%ebx,%ecx,4), %eax
+ M4_inst 8-20(%edx,%ecx,4), %eax
+ movl %eax, 8-20(%edi,%ecx,4)
+
+ movl 12-20(%ebx,%ecx,4), %eax
+ M4_inst 12-20(%edx,%ecx,4), %eax
+ movl %eax, 12-20(%edi,%ecx,4)
+
+ loop L(normal_top)
+
+
+ decl %esi
+ jz L(normal_finish_one)
+ js L(normal_done)
+
+ C two or three more limbs
+
+ movl (%ebx), %eax
+ M4_inst (%edx), %eax
+ movl %eax, (%edi)
+
+ movl 4(%ebx), %eax
+ M4_inst 4(%edx), %eax
+ decl %esi
+ movl %eax, 4(%edi)
+
+ jz L(normal_done)
+ movl $2, %ecx
+
+L(normal_finish_one):
+ movl (%ebx,%ecx,4), %eax
+ M4_inst (%edx,%ecx,4), %eax
+ movl %eax, (%edi,%ecx,4)
+
+L(normal_done):
+ popl %esi
+ popl %edi
+
+ movl $0, %eax
+ popl %ebx
+
+ setc %al
+
+ ret
+
+
+C -----------------------------------------------------------------------------
+
+ifdef(`OPERATION_add_n',`
+L(inplace_reverse):
+ C dst==src2
+
+ movl %ebx, %edx
+')
+
+L(inplace):
+ C eax initial carry
+ C ebx
+ C ecx size
+ C edx src
+ C esi
+ C edi dst
+ C ebp
+
+ leal -1(%ecx), %esi
+ decl %ecx
+
+ andl $-4, %ecx
+ andl $3, %esi
+
+ movl (%edx), %ebx C src low limb
+ leal (%edx,%ecx,4), %edx
+
+ leal (%edi,%ecx,4), %edi
+ negl %ecx
+
+ shrl %eax
+
+
+ ALIGN(32)
+L(inplace_top):
+ C eax
+ C ebx next src limb
+ C ecx size
+ C edx src
+ C esi
+ C edi dst
+ C ebp
+
+ M4_inst %ebx, (%edi,%ecx,4)
+
+ movl 4(%edx,%ecx,4), %eax
+ leal 5(%ecx), %ecx
+
+ M4_inst %eax, 4-20(%edi,%ecx,4)
+
+ movl 8-20(%edx,%ecx,4), %eax
+ movl 12-20(%edx,%ecx,4), %ebx
+
+ M4_inst %eax, 8-20(%edi,%ecx,4)
+ M4_inst %ebx, 12-20(%edi,%ecx,4)
+
+ movl 16-20(%edx,%ecx,4), %ebx
+ loop L(inplace_top)
+
+
+ C now %esi is 0 to 3 representing respectively 1 to 4 limbs more
+
+ M4_inst %ebx, (%edi)
+
+ decl %esi
+ jz L(inplace_finish_one)
+ js L(inplace_done)
+
+ C two or three more limbs
+
+ movl 4(%edx), %eax
+ movl 8(%edx), %ebx
+ M4_inst %eax, 4(%edi)
+ M4_inst %ebx, 8(%edi)
+
+ decl %esi
+ movl $2, %ecx
+
+ jz L(normal_done)
+
+L(inplace_finish_one):
+ movl 4(%edx,%ecx,4), %eax
+ M4_inst %eax, 4(%edi,%ecx,4)
+
+L(inplace_done):
+ popl %esi
+ popl %edi
+
+ movl $0, %eax
+ popl %ebx
+
+ setc %al
+
+ ret
+
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k6/aorsmul_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k6/aorsmul_1.asm
new file mode 100644
index 00000000000..eaa92ebb24b
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k6/aorsmul_1.asm
@@ -0,0 +1,391 @@
+dnl AMD K6 mpn_addmul_1/mpn_submul_1 -- add or subtract mpn multiple.
+
+dnl Copyright 1999-2003, 2005 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 P5
+C P6 model 0-8,10-12 5.94
+C P6 model 9 (Banias) 5.51
+C P6 model 13 (Dothan) 5.57
+C P4 model 0 (Willamette)
+C P4 model 1 (?)
+C P4 model 2 (Northwood)
+C P4 model 3 (Prescott)
+C P4 model 4 (Nocona)
+C AMD K6 7.65-8.5 (data dependent)
+C AMD K7
+C AMD K8
+
+
+dnl K6: large multipliers small multipliers
+dnl UNROLL_COUNT cycles/limb cycles/limb
+dnl 4 9.5 7.78
+dnl 8 9.0 7.78
+dnl 16 8.4 7.65
+dnl 32 8.4 8.2
+dnl
+dnl Maximum possible unrolling with the current code is 32.
+dnl
+dnl Unrolling to 16 limbs/loop makes the unrolled loop fit exactly in a 256
+dnl byte block, which might explain the good speed at that unrolling.
+
+deflit(UNROLL_COUNT, 16)
+
+
+ifdef(`OPERATION_addmul_1', `
+ define(M4_inst, addl)
+ define(M4_function_1, mpn_addmul_1)
+ define(M4_function_1c, mpn_addmul_1c)
+',`ifdef(`OPERATION_submul_1', `
+ define(M4_inst, subl)
+ define(M4_function_1, mpn_submul_1)
+ define(M4_function_1c, mpn_submul_1c)
+',`m4_error(`Need OPERATION_addmul_1 or OPERATION_submul_1
+')')')
+
+MULFUNC_PROLOGUE(mpn_addmul_1 mpn_addmul_1c mpn_submul_1 mpn_submul_1c)
+
+
+C mp_limb_t mpn_addmul_1 (mp_ptr dst, mp_srcptr src, mp_size_t size,
+C mp_limb_t mult);
+C mp_limb_t mpn_addmul_1c (mp_ptr dst, mp_srcptr src, mp_size_t size,
+C mp_limb_t mult, mp_limb_t carry);
+C mp_limb_t mpn_submul_1 (mp_ptr dst, mp_srcptr src, mp_size_t size,
+C mp_limb_t mult);
+C mp_limb_t mpn_submul_1c (mp_ptr dst, mp_srcptr src, mp_size_t size,
+C mp_limb_t mult, mp_limb_t carry);
+C
+C The jadcl0()s in the unrolled loop makes the speed data dependent. Small
+C multipliers (most significant few bits clear) result in few carry bits and
+C speeds up to 7.65 cycles/limb are attained. Large multipliers (most
+C significant few bits set) make the carry bits 50/50 and lead to something
+C more like 8.4 c/l. With adcl's both of these would be 9.3 c/l.
+C
+C It's important that the gains for jadcl0 on small multipliers don't come
+C at the cost of slowing down other data. Tests on uniformly distributed
+C random data, designed to confound branch prediction, show about a 7%
+C speed-up using jadcl0 over adcl (8.93 versus 9.57 cycles/limb, with all
+C overheads included).
+C
+C In the simple loop, jadcl0() measures slower than adcl (11.9-14.7 versus
+C 11.0 cycles/limb), and hence isn't used.
+C
+C In the simple loop, note that running ecx from negative to zero and using
+C it as an index in the two movs wouldn't help. It would save one
+C instruction (2*addl+loop becoming incl+jnz), but there's nothing unpaired
+C that would be collapsed by this.
+C
+C Attempts at a simpler main loop, with less unrolling, haven't yielded much
+C success, generally running over 9 c/l.
+C
+C
+C jadcl0
+C ------
+C
+C jadcl0() being faster than adcl $0 seems to be an artifact of two things,
+C firstly the instruction decoding and secondly the fact that there's a
+C carry bit for the jadcl0 only on average about 1/4 of the time.
+C
+C The code in the unrolled loop decodes something like the following.
+C
+C decode cycles
+C mull %ebp 2
+C M4_inst %esi, disp(%edi) 1
+C adcl %eax, %ecx 2
+C movl %edx, %esi \ 1
+C jnc 1f /
+C incl %esi \ 1
+C 1: movl disp(%ebx), %eax /
+C ---
+C 7
+C
+C In a back-to-back style test this measures 7 with the jnc not taken, or 8
+C with it taken (both when correctly predicted). This is opposite to the
+C measurements showing small multipliers running faster than large ones.
+C Don't really know why.
+C
+C It's not clear how much branch misprediction might be costing. The K6
+C doco says it will be 1 to 4 cycles, but presumably it's near the low end
+C of that range to get the measured results.
+C
+C
+C In the code the two carries are more or less the preceding mul product and
+C the calculation is roughly
+C
+C x*y + u*b+v
+C
+C where b=2^32 is the size of a limb, x*y is the two carry limbs, and u and
+C v are the two limbs it's added to (being the low of the next mul, and a
+C limb from the destination).
+C
+C To get a carry requires x*y+u*b+v >= b^2, which is u*b+v >= b^2-x*y, and
+C there are b^2-(b^2-x*y) = x*y many such values, giving a probability of
+C x*y/b^2. If x, y, u and v are random and uniformly distributed between 0
+C and b-1, then the total probability can be summed over x and y,
+C
+C 1 b-1 b-1 x*y 1 b*(b-1) b*(b-1)
+C --- * sum sum --- = --- * ------- * ------- = 1/4
+C b^2 x=0 y=1 b^2 b^4 2 2
+C
+C Actually it's a very tiny bit less than 1/4 of course. If y is fixed,
+C then the probability is 1/2*y/b thus varying linearly between 0 and 1/2.
+
+
+ifdef(`PIC',`
+deflit(UNROLL_THRESHOLD, 9)
+',`
+deflit(UNROLL_THRESHOLD, 6)
+')
+
+defframe(PARAM_CARRY, 20)
+defframe(PARAM_MULTIPLIER,16)
+defframe(PARAM_SIZE, 12)
+defframe(PARAM_SRC, 8)
+defframe(PARAM_DST, 4)
+
+ TEXT
+ ALIGN(32)
+
+PROLOGUE(M4_function_1c)
+ pushl %esi
+deflit(`FRAME',4)
+ movl PARAM_CARRY, %esi
+ jmp L(start_nc)
+EPILOGUE()
+
+PROLOGUE(M4_function_1)
+ push %esi
+deflit(`FRAME',4)
+ xorl %esi, %esi C initial carry
+
+L(start_nc):
+ movl PARAM_SIZE, %ecx
+ pushl %ebx
+deflit(`FRAME',8)
+
+ movl PARAM_SRC, %ebx
+ pushl %edi
+deflit(`FRAME',12)
+
+ cmpl $UNROLL_THRESHOLD, %ecx
+ movl PARAM_DST, %edi
+
+ pushl %ebp
+deflit(`FRAME',16)
+ jae L(unroll)
+
+
+ C simple loop
+
+ movl PARAM_MULTIPLIER, %ebp
+
+L(simple):
+ C eax scratch
+ C ebx src
+ C ecx counter
+ C edx scratch
+ C esi carry
+ C edi dst
+ C ebp multiplier
+
+ movl (%ebx), %eax
+ addl $4, %ebx
+
+ mull %ebp
+
+ addl $4, %edi
+ addl %esi, %eax
+
+ adcl $0, %edx
+
+ M4_inst %eax, -4(%edi)
+
+ adcl $0, %edx
+
+ movl %edx, %esi
+ loop L(simple)
+
+
+ popl %ebp
+ popl %edi
+
+ popl %ebx
+ movl %esi, %eax
+
+ popl %esi
+ ret
+
+
+
+C -----------------------------------------------------------------------------
+C The unrolled loop uses a "two carry limbs" scheme. At the top of the loop
+C the carries are ecx=lo, esi=hi, then they swap for each limb processed.
+C For the computed jump an odd size means they start one way around, an even
+C size the other.
+C
+C VAR_JUMP holds the computed jump temporarily because there's not enough
+C registers at the point of doing the mul for the initial two carry limbs.
+C
+C The add/adc for the initial carry in %esi is necessary only for the
+C mpn_addmul/submul_1c entry points. Duplicating the startup code to
+C eliminate this for the plain mpn_add/submul_1 doesn't seem like a good
+C idea.
+
+dnl overlapping with parameters already fetched
+define(VAR_COUNTER, `PARAM_SIZE')
+define(VAR_JUMP, `PARAM_DST')
+
+L(unroll):
+ C eax
+ C ebx src
+ C ecx size
+ C edx
+ C esi initial carry
+ C edi dst
+ C ebp
+
+ movl %ecx, %edx
+ decl %ecx
+
+ subl $2, %edx
+ negl %ecx
+
+ shrl $UNROLL_LOG2, %edx
+ andl $UNROLL_MASK, %ecx
+
+ movl %edx, VAR_COUNTER
+ movl %ecx, %edx
+
+ shll $4, %edx
+ negl %ecx
+
+ C 15 code bytes per limb
+ifdef(`PIC',`
+ call L(pic_calc)
+L(here):
+',`
+ leal L(entry) (%edx,%ecx,1), %edx
+')
+ movl (%ebx), %eax C src low limb
+
+ movl PARAM_MULTIPLIER, %ebp
+ movl %edx, VAR_JUMP
+
+ mull %ebp
+
+ addl %esi, %eax C initial carry (from _1c)
+ jadcl0( %edx)
+
+
+ leal 4(%ebx,%ecx,4), %ebx
+ movl %edx, %esi C high carry
+
+ movl VAR_JUMP, %edx
+ leal (%edi,%ecx,4), %edi
+
+ testl $1, %ecx
+ movl %eax, %ecx C low carry
+
+ jz L(noswap)
+ movl %esi, %ecx C high,low carry other way around
+
+ movl %eax, %esi
+L(noswap):
+
+ jmp *%edx
+
+
+ifdef(`PIC',`
+L(pic_calc):
+ C See mpn/x86/README about old gas bugs
+ leal (%edx,%ecx,1), %edx
+ addl $L(entry)-L(here), %edx
+ addl (%esp), %edx
+ ret_internal
+')
+
+
+C -----------------------------------------------------------
+ ALIGN(32)
+L(top):
+deflit(`FRAME',16)
+ C eax scratch
+ C ebx src
+ C ecx carry lo
+ C edx scratch
+ C esi carry hi
+ C edi dst
+ C ebp multiplier
+ C
+ C 15 code bytes per limb
+
+ leal UNROLL_BYTES(%edi), %edi
+
+L(entry):
+forloop(`i', 0, UNROLL_COUNT/2-1, `
+ deflit(`disp0', eval(2*i*4))
+ deflit(`disp1', eval(disp0 + 4))
+
+Zdisp( movl, disp0,(%ebx), %eax)
+ mull %ebp
+Zdisp( M4_inst,%ecx, disp0,(%edi))
+ adcl %eax, %esi
+ movl %edx, %ecx
+ jadcl0( %ecx)
+
+ movl disp1(%ebx), %eax
+ mull %ebp
+ M4_inst %esi, disp1(%edi)
+ adcl %eax, %ecx
+ movl %edx, %esi
+ jadcl0( %esi)
+')
+
+ decl VAR_COUNTER
+
+ leal UNROLL_BYTES(%ebx), %ebx
+ jns L(top)
+
+
+ popl %ebp
+ M4_inst %ecx, UNROLL_BYTES(%edi)
+
+ popl %edi
+ movl %esi, %eax
+
+ popl %ebx
+ jadcl0( %eax)
+
+ popl %esi
+ ret
+
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k6/cross.pl b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k6/cross.pl
new file mode 100755
index 00000000000..fc921a56b71
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k6/cross.pl
@@ -0,0 +1,182 @@
+#! /usr/bin/perl
+
+# Copyright 2000, 2001 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/.
+
+
+# Usage: cross.pl [filename.o]...
+#
+# Produce an annotated disassembly of the given object files, indicating
+# certain code alignment and addressing mode problems afflicting K6 chips.
+# "ZZ" is used on all annotations, so this can be searched for.
+#
+# With no arguments, all .o files corresponding to .asm files are processed.
+# This is good in the mpn object directory of a k6*-*-* build.
+#
+# Code alignments of 8 bytes or more are handled. When 32 is used, cache
+# line boundaries will fall in at offsets 0x20,0x40,etc and problems are
+# flagged at those locations. When 16 is used, the line boundaries can also
+# fall at offsets 0x10,0x30,0x50,etc, depending where the file is loaded, so
+# problems are identified there too. Likewise when 8 byte alignment is used
+# problems are flagged additionally at 0x08,0x18,0x28,etc.
+#
+# Usually 32 byte alignment is used for k6 routines, but less is certainly
+# possible if through good luck, or a little tweaking, cache line crossing
+# problems can be avoided at the extra locations.
+#
+# Bugs:
+#
+# Instructions without mod/rm bytes or which are already vector decoded are
+# unaffected by cache line boundary crossing, but not all of these have yet
+# been put in as exceptions. All that occur in practice in GMP are present
+# though.
+#
+# There's no messages for using the vector decoded addressing mode (%esi),
+# but that's easy to avoid when coding.
+#
+# Future:
+#
+# Warn about jump targets that are poorly aligned (less than 2 instructions
+# before a cache line boundary).
+
+use strict;
+
+sub disassemble {
+ my ($file) = @_;
+ my ($addr,$b1,$b2,$b3, $prefix,$opcode,$modrm);
+ my $align;
+
+ open (IN, "objdump -Srfh $file |")
+ || die "Cannot open pipe from objdump\n";
+ while (<IN>) {
+ print;
+
+ if (/^[ \t]*[0-9]+[ \t]+\.text[ \t]/ && /2\*\*([0-9]+)$/) {
+ $align = 1 << $1;
+ if ($align < 8) {
+ print "ZZ cross.pl cannot handle alignment < 2**3\n";
+ $align = 8
+ }
+ }
+
+ if (/^[ \t]*([0-9a-f]*):[ \t]*([0-9a-f]+)[ \t]+([0-9a-f]+)[ \t]+([0-9a-f]+)/) {
+ ($addr,$b1,$b2,$b3) = ($1,$2,$3,$4);
+
+ } elsif (/^[ \t]*([0-9a-f]*):[ \t]*([0-9a-f]+)[ \t]+([0-9a-f]+)/) {
+ ($addr,$b1,$b2,$b3) = ($1,$2,$3,'');
+
+ } elsif (/^[ \t]*([0-9a-f]*):[ \t]*([0-9a-f]+)/) {
+ ($addr,$b1,$b2,$b3) = ($1,$2,'','');
+
+ } else {
+ next;
+ }
+
+ if ($b1 =~ /0f/) {
+ $prefix = $b1;
+ $opcode = $b2;
+ $modrm = $b3;
+ } else {
+ $prefix = '';
+ $opcode = $b1;
+ $modrm = $b2;
+ }
+
+ # modrm of the form 00-xxx-100 with an 0F prefix is the problem case
+ # for K6 and pre-CXT K6-2
+ if ($prefix =~ /0f/
+ && $opcode !~ /^8/ # jcond disp32
+ && $modrm =~ /^[0-3][4c]/) {
+ print "ZZ ($file) >3 bytes to determine instruction length [K6]\n";
+ }
+
+ # with just an opcode, starting 1f mod 20h
+ if (($align==32 && $addr =~ /[13579bdf]f$/
+ || $align==16 && $addr =~ /f$/
+ || $align==8 && $addr =~ /[7f]$/)
+ && $prefix !~ /0f/
+ && $opcode !~ /1[012345]/ # adc
+ && $opcode !~ /1[89abcd]/ # sbb
+ && $opcode !~ /^4/ # inc/dec reg
+ && $opcode !~ /^5/ # push/pop reg
+ && $opcode !~ /68/ # push $imm32
+ && $opcode !~ /^7/ # jcond disp8
+ && $opcode !~ /a[89]/ # test+imm
+ && $opcode !~ /a[a-f]/ # stos/lods/scas
+ && $opcode !~ /b8/ # movl $imm32,%eax
+ && $opcode !~ /d[0123]/ # rcl
+ && $opcode !~ /e[0123]/ # loop/loopz/loopnz/jcxz
+ && $opcode !~ /e8/ # call disp32
+ && $opcode !~ /e[9b]/ # jmp disp32/disp8
+ && $opcode !~ /f[89abcd]/ # clc,stc,cli,sti,cld,std
+ && !($opcode =~ /f[67]/ # grp 1
+ && $modrm =~ /^[2367abef]/) # mul, imul, div, idiv
+ && $modrm !~ /^$/) {
+ print "ZZ ($file) opcode/modrm cross 32-byte boundary\n";
+ }
+
+ # with an 0F prefix, anything starting at 1f mod 20h
+ if (($align==32 && $addr =~ /[13579bdf][f]$/
+ || $align==16 && $addr =~ /f$/
+ || $align==8 && $addr =~ /[7f]$/)
+ && $prefix =~ /0f/
+ && $opcode !~ /af/ # imul
+ && $opcode !~ /a[45]/ # shldl
+ && $opcode !~ /a[cd]/ # shrdl
+ ) {
+ print "ZZ ($file) prefix/opcode cross 32-byte boundary\n";
+ }
+
+ # with an 0F prefix, anything with mod/rm starting at 1e mod 20h
+ if (($align==32 && $addr =~ /[13579bdf][e]$/
+ || $align==16 && $addr =~ /[e]$/
+ || $align==8 && $addr =~ /[6e]$/)
+ && $prefix =~ /0f/
+ && $opcode !~ /^8/ # jcond disp32
+ && $opcode !~ /af/ # imull reg,reg
+ && $opcode !~ /a[45]/ # shldl
+ && $opcode !~ /a[cd]/ # shrdl
+ && $modrm !~ /^$/) {
+ print "ZZ ($file) prefix/opcode/modrm cross 32-byte boundary\n";
+ }
+ }
+ close IN || die "Error from objdump (or objdump not available)\n";
+}
+
+
+my @files;
+if ($#ARGV >= 0) {
+ @files = @ARGV;
+} else {
+ @files = glob "*.asm";
+ map {s/.asm/.o/} @files;
+}
+
+foreach (@files) {
+ disassemble($_);
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k6/divrem_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k6/divrem_1.asm
new file mode 100644
index 00000000000..b4cea4fa2a7
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k6/divrem_1.asm
@@ -0,0 +1,203 @@
+dnl AMD K6 mpn_divrem_1 -- mpn by limb division.
+
+dnl Copyright 1999-2003, 2007 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 K6: 20 cycles/limb
+
+
+C mp_limb_t mpn_divrem_1 (mp_ptr dst, mp_size_t xsize,
+C mp_srcptr src, mp_size_t size, mp_limb_t divisor);
+C mp_limb_t mpn_divrem_1c (mp_ptr dst, mp_size_t xsize,
+C mp_srcptr src, mp_size_t size, mp_limb_t divisor,
+C mp_limb_t carry);
+C
+C The code here is basically the same as mpn/x86/divrem_1.asm, but uses loop
+C instead of decl+jnz, since it comes out 2 cycles/limb faster.
+C
+C A test is done to see if the high limb is less than the divisor, and if so
+C one less div is done. A div is 20 cycles, so assuming high<divisor about
+C half the time, then this test saves half that amount. The branch
+C misprediction penalty is less than that.
+C
+C Back-to-back div instructions run at 20 cycles, the same as the loop here,
+C so it seems there's nothing to gain by rearranging the loop. Pairing the
+C mov and loop instructions was found to gain nothing.
+C
+C Enhancements:
+C
+C The low-latency K6 multiply might be thought to suit a mul-by-inverse, but
+C that algorithm has been found to suffer from the relatively poor carry
+C handling on K6 and too many auxiliary instructions. The fractional part
+C however could be done at about 13 c/l, if it mattered enough.
+
+defframe(PARAM_CARRY, 24)
+defframe(PARAM_DIVISOR,20)
+defframe(PARAM_SIZE, 16)
+defframe(PARAM_SRC, 12)
+defframe(PARAM_XSIZE, 8)
+defframe(PARAM_DST, 4)
+
+ TEXT
+
+ ALIGN(32)
+PROLOGUE(mpn_divrem_1c)
+deflit(`FRAME',0)
+
+ movl PARAM_SIZE, %ecx
+ pushl %edi FRAME_pushl()
+
+ movl PARAM_SRC, %edi
+ pushl %esi FRAME_pushl()
+
+ movl PARAM_DIVISOR, %esi
+ pushl %ebx FRAME_pushl()
+
+ movl PARAM_DST, %ebx
+ pushl %ebp FRAME_pushl()
+
+ movl PARAM_XSIZE, %ebp
+ orl %ecx, %ecx C size
+
+ movl PARAM_CARRY, %edx
+ jz L(fraction) C if size==0
+
+ leal -4(%ebx,%ebp,4), %ebx C dst one limb below integer part
+ jmp L(integer_top)
+
+EPILOGUE()
+
+
+ ALIGN(16)
+PROLOGUE(mpn_divrem_1)
+deflit(`FRAME',0)
+
+ movl PARAM_SIZE, %ecx
+ pushl %edi FRAME_pushl()
+
+ movl PARAM_SRC, %edi
+ pushl %esi FRAME_pushl()
+
+ movl PARAM_DIVISOR, %esi
+ orl %ecx,%ecx C size
+
+ jz L(size_zero)
+ pushl %ebx FRAME_pushl()
+
+ movl -4(%edi,%ecx,4), %eax C src high limb
+ xorl %edx, %edx
+
+ movl PARAM_DST, %ebx
+ pushl %ebp FRAME_pushl()
+
+ movl PARAM_XSIZE, %ebp
+ cmpl %esi, %eax
+
+ leal -4(%ebx,%ebp,4), %ebx C dst one limb below integer part
+ jae L(integer_entry)
+
+
+ C high<divisor, so high of dst is zero, and avoid one div
+
+ movl %edx, (%ebx,%ecx,4)
+ decl %ecx
+
+ movl %eax, %edx
+ jz L(fraction)
+
+
+L(integer_top):
+ C eax scratch (quotient)
+ C ebx dst+4*xsize-4
+ C ecx counter
+ C edx scratch (remainder)
+ C esi divisor
+ C edi src
+ C ebp xsize
+
+ movl -4(%edi,%ecx,4), %eax
+L(integer_entry):
+
+ divl %esi
+
+ movl %eax, (%ebx,%ecx,4)
+ loop L(integer_top)
+
+
+L(fraction):
+ orl %ebp, %ecx
+ jz L(done)
+
+ movl PARAM_DST, %ebx
+
+
+L(fraction_top):
+ C eax scratch (quotient)
+ C ebx dst
+ C ecx counter
+ C edx scratch (remainder)
+ C esi divisor
+ C edi
+ C ebp
+
+ xorl %eax, %eax
+
+ divl %esi
+
+ movl %eax, -4(%ebx,%ecx,4)
+ loop L(fraction_top)
+
+
+L(done):
+ popl %ebp
+ movl %edx, %eax
+ popl %ebx
+ popl %esi
+ popl %edi
+ ret
+
+
+L(size_zero):
+deflit(`FRAME',8)
+ movl PARAM_XSIZE, %ecx
+ xorl %eax, %eax
+
+ movl PARAM_DST, %edi
+
+ cld C better safe than sorry, see mpn/x86/README
+
+ rep
+ stosl
+
+ popl %esi
+ popl %edi
+ ret
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k6/gcd_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k6/gcd_1.asm
new file mode 100644
index 00000000000..0c233ff3626
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k6/gcd_1.asm
@@ -0,0 +1,362 @@
+dnl AMD K6 mpn_gcd_1 -- mpn by 1 gcd.
+
+dnl Copyright 2000-2002, 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 K6: 9.5 cycles/bit (approx) 1x1 gcd
+C 11.0 cycles/limb Nx1 reduction (modexact_1_odd)
+
+
+C mp_limb_t mpn_gcd_1 (mp_srcptr src, mp_size_t size, mp_limb_t y);
+C
+C This code is nothing very special, but offers a speedup over what gcc 2.95
+C can do with mpn/generic/gcd_1.c.
+C
+C Future:
+C
+C Using a lookup table to count trailing zeros seems a touch quicker, but
+C after a slightly longer startup. Might be worthwhile if an mpn_gcd_2 used
+C it too.
+
+
+dnl If size==1 and x (the larger operand) is more than DIV_THRESHOLD bits
+dnl bigger than y, then a division x%y is done to reduce it.
+dnl
+dnl A divl is 20 cycles and the loop runs at about 9.5 cycles/bitpair so
+dnl there should be an advantage in the divl at about 4 or 5 bits, which is
+dnl what's found.
+
+deflit(DIV_THRESHOLD, 5)
+
+
+defframe(PARAM_LIMB, 12)
+defframe(PARAM_SIZE, 8)
+defframe(PARAM_SRC, 4)
+
+ TEXT
+ ALIGN(16)
+
+PROLOGUE(mpn_gcd_1)
+deflit(`FRAME',0)
+
+ ASSERT(ne, `cmpl $0, PARAM_LIMB')
+ ASSERT(ae, `cmpl $1, PARAM_SIZE')
+
+
+ movl PARAM_SRC, %eax
+ pushl %ebx FRAME_pushl()
+
+ movl PARAM_LIMB, %edx
+ movl $-1, %ecx
+
+ movl (%eax), %ebx C src low limb
+
+ movl %ebx, %eax C src low limb
+ orl %edx, %ebx
+
+L(common_twos):
+ shrl %ebx
+ incl %ecx
+
+ jnc L(common_twos) C 1/4 chance on random data
+ shrl %cl, %edx C y
+
+ cmpl $1, PARAM_SIZE
+ ja L(size_two_or_more)
+
+
+ ASSERT(nz, `orl %eax, %eax') C should have src limb != 0
+
+ shrl %cl, %eax C x
+
+
+ C Swap if necessary to make x>=y. Measures a touch quicker as a
+ C jump than a branch free calculation.
+ C
+ C eax x
+ C ebx
+ C ecx common twos
+ C edx y
+
+ movl %eax, %ebx
+ cmpl %eax, %edx
+
+ jb L(noswap)
+ movl %edx, %eax
+
+ movl %ebx, %edx
+ movl %eax, %ebx
+L(noswap):
+
+
+ C See if it's worth reducing x with a divl.
+ C
+ C eax x
+ C ebx x
+ C ecx common twos
+ C edx y
+
+ shrl $DIV_THRESHOLD, %ebx
+
+ cmpl %ebx, %edx
+ ja L(nodiv)
+
+
+ C Reduce x to x%y.
+ C
+ C eax x
+ C ebx
+ C ecx common twos
+ C edx y
+
+ movl %edx, %ebx
+ xorl %edx, %edx
+
+ divl %ebx
+
+ orl %edx, %edx C y
+ nop C code alignment
+
+ movl %ebx, %eax C x
+ jz L(done_shll)
+L(nodiv):
+
+
+ C eax x
+ C ebx
+ C ecx common twos
+ C edx y
+ C esi
+ C edi
+ C ebp
+
+L(strip_y):
+ shrl %edx
+ jnc L(strip_y)
+
+ leal 1(%edx,%edx), %edx
+ movl %ecx, %ebx C common twos
+
+ leal 1(%eax), %ecx
+ jmp L(strip_x_and)
+
+
+C Calculating a %cl shift based on the low bit 0 or 1 avoids doing a branch
+C on a 50/50 chance of 0 or 1. The chance of the next bit also being 0 is
+C only 1/4.
+C
+C A second computed %cl shift was tried, but that measured a touch slower
+C than branching back.
+C
+C A branch-free abs(x-y) and min(x,y) calculation was tried, but that
+C measured about 1 cycle/bit slower.
+
+ C eax x
+ C ebx common twos
+ C ecx scratch
+ C edx y
+
+ ALIGN(4)
+L(swap):
+ addl %eax, %edx C x-y+y = x
+ negl %eax C -(x-y) = y-x
+
+L(strip_x):
+ shrl %eax C odd-odd = even, so always one to strip
+ ASSERT(nz)
+
+L(strip_x_leal):
+ leal 1(%eax), %ecx
+
+L(strip_x_and):
+ andl $1, %ecx C (x^1)&1
+
+ shrl %cl, %eax C shift if x even
+
+ testb $1, %al
+ jz L(strip_x)
+
+ ASSERT(nz,`testl $1, %eax') C x, y odd
+ ASSERT(nz,`testl $1, %edx')
+
+ subl %edx, %eax
+ jb L(swap)
+ ja L(strip_x)
+
+
+ movl %edx, %eax
+ movl %ebx, %ecx
+
+L(done_shll):
+ shll %cl, %eax
+ popl %ebx
+
+ ret
+
+
+C -----------------------------------------------------------------------------
+C Two or more limbs.
+C
+C x={src,size} is reduced modulo y using either a plain mod_1 style
+C remainder, or a modexact_1 style exact division.
+
+deflit(MODEXACT_THRESHOLD, ifdef(`PIC', 4, 4))
+
+ ALIGN(8)
+L(size_two_or_more):
+ C eax
+ C ebx
+ C ecx common twos
+ C edx y, without common twos
+ C esi
+ C edi
+ C ebp
+
+deflit(FRAME_TWO_OR_MORE, FRAME)
+
+ pushl %edi defframe_pushl(SAVE_EDI)
+ movl PARAM_SRC, %ebx
+
+L(y_twos):
+ shrl %edx
+ jnc L(y_twos)
+
+ movl %ecx, %edi C common twos
+ movl PARAM_SIZE, %ecx
+
+ pushl %esi defframe_pushl(SAVE_ESI)
+ leal 1(%edx,%edx), %esi C y (odd)
+
+ movl -4(%ebx,%ecx,4), %eax C src high limb
+
+ cmpl %edx, %eax C carry if high<divisor
+
+ sbbl %edx, %edx C -1 if high<divisor
+
+ addl %edx, %ecx C skip one limb if high<divisor
+ andl %eax, %edx
+
+ cmpl $MODEXACT_THRESHOLD, %ecx
+ jae L(modexact)
+
+
+L(divide_top):
+ C eax scratch (quotient)
+ C ebx src
+ C ecx counter, size-1 to 1
+ C edx carry (remainder)
+ C esi divisor (odd)
+ C edi
+ C ebp
+
+ movl -4(%ebx,%ecx,4), %eax
+ divl %esi
+ loop L(divide_top)
+
+
+ movl %edx, %eax C x
+ movl %esi, %edx C y (odd)
+
+ movl %edi, %ebx C common twos
+ popl %esi
+
+ popl %edi
+ leal 1(%eax), %ecx
+
+ orl %eax, %eax
+ jnz L(strip_x_and)
+
+
+ movl %ebx, %ecx
+ movl %edx, %eax
+
+ shll %cl, %eax
+ popl %ebx
+
+ ret
+
+
+ ALIGN(8)
+L(modexact):
+ C eax
+ C ebx src ptr
+ C ecx size or size-1
+ C edx
+ C esi y odd
+ C edi common twos
+ C ebp
+
+ movl PARAM_SIZE, %eax
+ pushl %esi FRAME_pushl()
+
+ pushl %eax FRAME_pushl()
+
+ pushl %ebx FRAME_pushl()
+
+ifdef(`PIC',`
+ nop C code alignment
+ call L(movl_eip_ebx)
+L(here):
+ addl $_GLOBAL_OFFSET_TABLE_, %ebx
+ call GSYM_PREFIX`'mpn_modexact_1_odd@PLT
+',`
+ call GSYM_PREFIX`'mpn_modexact_1_odd
+')
+
+ movl %esi, %edx C y odd
+ movl SAVE_ESI, %esi
+
+ movl %edi, %ebx C common twos
+ movl SAVE_EDI, %edi
+
+ addl $eval(FRAME - FRAME_TWO_OR_MORE), %esp
+ orl %eax, %eax
+
+ leal 1(%eax), %ecx
+ jnz L(strip_x_and)
+
+
+ movl %ebx, %ecx
+ movl %edx, %eax
+
+ shll %cl, %eax
+ popl %ebx
+
+ ret
+
+
+ifdef(`PIC',`
+L(movl_eip_ebx):
+ movl (%esp), %ebx
+ ret_internal
+')
+
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k6/gmp-mparam.h b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k6/gmp-mparam.h
new file mode 100644
index 00000000000..f03f1b2d918
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k6/gmp-mparam.h
@@ -0,0 +1,166 @@
+/* AMD K6 gmp-mparam.h -- Compiler/machine parameter header file.
+
+Copyright 1991, 1993, 1994, 2000-2004, 2009, 2010 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
+
+
+/* 450MHz K6-2 */
+
+#define MOD_1_NORM_THRESHOLD 12
+#define MOD_1_UNNORM_THRESHOLD MP_SIZE_T_MAX /* never */
+#define MOD_1N_TO_MOD_1_1_THRESHOLD 41
+#define MOD_1U_TO_MOD_1_1_THRESHOLD 32
+#define MOD_1_1_TO_MOD_1_2_THRESHOLD 3
+#define MOD_1_2_TO_MOD_1_4_THRESHOLD 0
+#define PREINV_MOD_1_TO_MOD_1_THRESHOLD 128
+#define USE_PREINV_DIVREM_1 0
+#define DIVEXACT_1_THRESHOLD 0 /* always (native) */
+#define BMOD_1_TO_MOD_1_THRESHOLD MP_SIZE_T_MAX /* never */
+
+#define MUL_TOOM22_THRESHOLD 20
+#define MUL_TOOM33_THRESHOLD 69
+#define MUL_TOOM44_THRESHOLD 106
+#define MUL_TOOM6H_THRESHOLD 157
+#define MUL_TOOM8H_THRESHOLD 199
+
+#define MUL_TOOM32_TO_TOOM43_THRESHOLD 73
+#define MUL_TOOM32_TO_TOOM53_THRESHOLD 69
+#define MUL_TOOM42_TO_TOOM53_THRESHOLD 65
+#define MUL_TOOM42_TO_TOOM63_THRESHOLD 64
+
+#define SQR_BASECASE_THRESHOLD 0 /* always (native) */
+#define SQR_TOOM2_THRESHOLD 32
+#define SQR_TOOM3_THRESHOLD 97
+#define SQR_TOOM4_THRESHOLD 143
+#define SQR_TOOM6_THRESHOLD 222
+#define SQR_TOOM8_THRESHOLD 272
+
+#define MULMOD_BNM1_THRESHOLD 13
+#define SQRMOD_BNM1_THRESHOLD 17
+
+#define MUL_FFT_MODF_THRESHOLD 476 /* k = 5 */
+#define MUL_FFT_TABLE3 \
+ { { 476, 5}, { 17, 6}, { 9, 5}, { 19, 6}, \
+ { 11, 5}, { 23, 6}, { 17, 7}, { 9, 6}, \
+ { 19, 7}, { 11, 6}, { 23, 7}, { 13, 6}, \
+ { 27, 7}, { 15, 6}, { 31, 7}, { 17, 6}, \
+ { 35, 7}, { 21, 8}, { 11, 7}, { 27, 8}, \
+ { 15, 7}, { 35, 8}, { 19, 7}, { 39, 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}, \
+ { 47,10}, { 31, 9}, { 79,10}, { 47, 9}, \
+ { 95,11}, { 31,10}, { 63, 9}, { 135,10}, \
+ { 79, 9}, { 167,10}, { 95, 9}, { 191,10}, \
+ { 111,11}, { 63,10}, { 127, 9}, { 255,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}, { 191,10}, \
+ { 415, 9}, { 831,11}, { 223,12}, { 127,11}, \
+ { 255,10}, { 543,11}, { 287,10}, { 575,11}, \
+ { 351,10}, { 703,12}, { 191,11}, { 415,10}, \
+ { 831,13}, { 127,12}, { 255,11}, { 543,10}, \
+ { 1087,11}, { 575,12}, { 319,11}, { 703,12}, \
+ { 383,11}, { 831,12}, { 447,11}, { 895,13}, \
+ { 255,12}, { 511,11}, { 1087,12}, { 575,11}, \
+ { 1151,12}, { 703,13}, { 383,12}, { 959,14}, \
+ { 255,13}, { 511,12}, { 1215,13}, { 8192,14}, \
+ { 16384,15}, { 32768,16} }
+#define MUL_FFT_TABLE3_SIZE 106
+#define MUL_FFT_THRESHOLD 7424
+
+#define SQR_FFT_MODF_THRESHOLD 432 /* k = 5 */
+#define SQR_FFT_TABLE3 \
+ { { 432, 5}, { 17, 6}, { 9, 5}, { 19, 6}, \
+ { 11, 5}, { 23, 6}, { 21, 7}, { 11, 6}, \
+ { 24, 7}, { 13, 6}, { 27, 7}, { 15, 6}, \
+ { 31, 7}, { 21, 8}, { 11, 7}, { 29, 8}, \
+ { 15, 7}, { 35, 8}, { 19, 7}, { 39, 8}, \
+ { 23, 7}, { 49, 8}, { 27, 9}, { 15, 8}, \
+ { 39, 9}, { 23, 7}, { 93, 8}, { 47, 7}, \
+ { 95, 8}, { 51,10}, { 15, 9}, { 31, 8}, \
+ { 67, 9}, { 39, 8}, { 79, 9}, { 47, 8}, \
+ { 95, 9}, { 55,10}, { 31, 9}, { 71, 8}, \
+ { 143, 9}, { 79,10}, { 47, 9}, { 95,11}, \
+ { 31,10}, { 63, 9}, { 135,10}, { 79, 9}, \
+ { 167,10}, { 95, 9}, { 191,11}, { 63,10}, \
+ { 127, 9}, { 255,10}, { 143, 9}, { 287, 8}, \
+ { 575,10}, { 159, 9}, { 319,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}, { 351, 9}, \
+ { 703,11}, { 191,10}, { 415,11}, { 223,12}, \
+ { 127,11}, { 255,10}, { 543,11}, { 287,10}, \
+ { 607,11}, { 319,10}, { 639,11}, { 351,10}, \
+ { 703,12}, { 191,11}, { 415,10}, { 831,13}, \
+ { 127,12}, { 255,11}, { 543,10}, { 1087,11}, \
+ { 607,12}, { 319,11}, { 703,12}, { 383,11}, \
+ { 831,12}, { 447,13}, { 255,12}, { 511,11}, \
+ { 1087,12}, { 575,11}, { 1215,12}, { 703,13}, \
+ { 383,12}, { 895,14}, { 255,13}, { 511,12}, \
+ { 1215,13}, { 8192,14}, { 16384,15}, { 32768,16} }
+#define SQR_FFT_TABLE3_SIZE 112
+#define SQR_FFT_THRESHOLD 7040
+
+#define MULLO_BASECASE_THRESHOLD 3
+#define MULLO_DC_THRESHOLD 60
+#define MULLO_MUL_N_THRESHOLD 13463
+
+#define DC_DIV_QR_THRESHOLD 78
+#define DC_DIVAPPR_Q_THRESHOLD 252
+#define DC_BDIV_QR_THRESHOLD 84
+#define DC_BDIV_Q_THRESHOLD 171
+
+#define INV_MULMOD_BNM1_THRESHOLD 55
+#define INV_NEWTON_THRESHOLD 234
+#define INV_APPR_THRESHOLD 236
+
+#define BINV_NEWTON_THRESHOLD 268
+#define REDC_1_TO_REDC_N_THRESHOLD 67
+
+#define MU_DIV_QR_THRESHOLD 1308
+#define MU_DIVAPPR_Q_THRESHOLD 1142
+#define MUPI_DIV_QR_THRESHOLD 134
+#define MU_BDIV_QR_THRESHOLD 1164
+#define MU_BDIV_Q_THRESHOLD 1164
+
+#define MATRIX22_STRASSEN_THRESHOLD 15
+#define HGCD_THRESHOLD 182
+#define GCD_DC_THRESHOLD 591
+#define GCDEXT_DC_THRESHOLD 472
+#define JACOBI_BASE_METHOD 2
+
+#define GET_STR_DC_THRESHOLD 24
+#define GET_STR_PRECOMPUTE_THRESHOLD 40
+#define SET_STR_DC_THRESHOLD 834
+#define SET_STR_PRECOMPUTE_THRESHOLD 2042
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k6/k62mmx/copyd.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k6/k62mmx/copyd.asm
new file mode 100644
index 00000000000..f80a5a1cdb5
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k6/k62mmx/copyd.asm
@@ -0,0 +1,118 @@
+dnl AMD K6-2 mpn_copyd -- copy limb vector, decrementing.
+
+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/.
+
+include(`../config.m4')
+
+
+C K6-2: 1.0 cycles/limb
+
+
+C void mpn_copyd (mp_ptr dst, mp_srcptr src, mp_size_t size);
+C
+C The loop here is no faster than a rep movsl at 1.0 c/l, but it avoids a 30
+C cycle startup time, which amounts for instance to a 2x speedup at 15
+C limbs.
+C
+C If dst is 4mod8 the loop would be 1.17 c/l, but that's avoided by
+C processing one limb separately to make it aligned. This and a final odd
+C limb are handled in a branch-free fashion, ending up re-copying if the
+C special case isn't needed.
+C
+C Alternatives:
+C
+C There used to be a big unrolled version of this, running at 0.56 c/l if
+C the destination was aligned, but that seemed rather excessive for the
+C relative importance of copyd.
+C
+C If the destination alignment is ignored and just left to run at 1.17 c/l
+C some code size and a fixed few cycles can be saved. Considering how few
+C uses copyd finds perhaps that should be favoured. The current code has
+C the attraction of being no slower than a basic rep movsl though.
+
+defframe(PARAM_SIZE,12)
+defframe(PARAM_SRC, 8)
+defframe(PARAM_DST, 4)
+
+dnl re-using parameter space
+define(SAVE_EBX,`PARAM_SIZE')
+
+ TEXT
+ ALIGN(16)
+
+PROLOGUE(mpn_copyd)
+deflit(`FRAME',0)
+
+ movl PARAM_SIZE, %ecx
+ movl %ebx, SAVE_EBX
+
+ movl PARAM_SRC, %eax
+ movl PARAM_DST, %edx
+
+ subl $1, %ecx C better code alignment than decl
+ jb L(zero)
+
+ jz L(one_more)
+ leal 4(%edx,%ecx,4), %ebx
+
+Zdisp( movd, 0,(%eax,%ecx,4), %mm0) C high limb
+Zdisp( movd, %mm0, 0,(%edx,%ecx,4)) C Zdisp for good code alignment
+
+ cmpl $1, %ecx
+ je L(one_more)
+
+ shrl $2, %ebx
+ andl $1, %ebx C 1 if dst[size-2] unaligned
+
+ subl %ebx, %ecx
+ nop C code alignment
+
+L(top):
+ C eax src
+ C ebx
+ C ecx counter
+ C edx dst
+
+ movq -4(%eax,%ecx,4), %mm0
+ subl $2, %ecx
+
+ movq %mm0, 4(%edx,%ecx,4)
+ ja L(top)
+
+
+L(one_more):
+ movd (%eax), %mm0
+ movd %mm0, (%edx)
+
+ movl SAVE_EBX, %ebx
+ emms_or_femms
+L(zero):
+ ret
+
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k6/k62mmx/lshift.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k6/k62mmx/lshift.asm
new file mode 100644
index 00000000000..c86575feed9
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k6/k62mmx/lshift.asm
@@ -0,0 +1,294 @@
+dnl AMD K6-2 mpn_lshift -- mpn left shift.
+
+dnl Copyright 1999, 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 K6-2: 1.75 cycles/limb
+
+
+C mp_limb_t mpn_lshift (mp_ptr dst, mp_srcptr src, mp_size_t size,
+C unsigned shift);
+C
+
+defframe(PARAM_SHIFT,16)
+defframe(PARAM_SIZE, 12)
+defframe(PARAM_SRC, 8)
+defframe(PARAM_DST, 4)
+deflit(`FRAME',0)
+
+dnl used after src has been fetched
+define(VAR_RETVAL,`PARAM_SRC')
+
+dnl minimum 9, because unrolled loop can't handle less
+deflit(UNROLL_THRESHOLD, 9)
+
+ TEXT
+ ALIGN(32)
+
+PROLOGUE(mpn_lshift)
+deflit(`FRAME',0)
+
+ C The 1 limb case can be done without the push %ebx, but it's then
+ C still the same speed. The push is left as a free helping hand for
+ C the two_or_more code.
+
+ movl PARAM_SIZE, %eax
+ pushl %ebx FRAME_pushl()
+
+ movl PARAM_SRC, %ebx
+ decl %eax
+
+ movl PARAM_SHIFT, %ecx
+ jnz L(two_or_more)
+
+ movl (%ebx), %edx C src limb
+ movl PARAM_DST, %ebx
+
+ shldl( %cl, %edx, %eax) C return value
+
+ shll %cl, %edx
+
+ movl %edx, (%ebx) C dst limb
+ popl %ebx
+
+ ret
+
+
+C -----------------------------------------------------------------------------
+ ALIGN(16) C avoid offset 0x1f
+L(two_or_more):
+ C eax size-1
+ C ebx src
+ C ecx shift
+ C edx
+
+ movl (%ebx,%eax,4), %edx C src high limb
+ negl %ecx
+
+ movd PARAM_SHIFT, %mm6
+ addl $32, %ecx C 32-shift
+
+ shrl %cl, %edx
+ cmpl $UNROLL_THRESHOLD-1, %eax
+
+ movl %edx, VAR_RETVAL
+ jae L(unroll)
+
+
+ movd %ecx, %mm7
+ movl %eax, %ecx
+
+ movl PARAM_DST, %eax
+
+L(simple):
+ C eax dst
+ C ebx src
+ C ecx counter, size-1 to 1
+ C edx retval
+ C
+ C mm0 scratch
+ C mm6 shift
+ C mm7 32-shift
+
+ movq -4(%ebx,%ecx,4), %mm0
+
+ psrlq %mm7, %mm0
+
+Zdisp( movd, %mm0, 0,(%eax,%ecx,4))
+ loop L(simple)
+
+
+ movd (%ebx), %mm0
+ popl %ebx
+
+ psllq %mm6, %mm0
+
+ movd %mm0, (%eax)
+ movl %edx, %eax
+
+ femms
+ ret
+
+
+C -----------------------------------------------------------------------------
+ ALIGN(16)
+L(unroll):
+ C eax size-1
+ C ebx src
+ C ecx 32-shift
+ C edx retval (but instead VAR_RETVAL is used)
+ C
+ C mm6 shift
+
+ addl $32, %ecx
+ movl PARAM_DST, %edx
+
+ movd %ecx, %mm7
+ subl $7, %eax C size-8
+
+ leal (%edx,%eax,4), %ecx C alignment of dst
+
+ movq 32-8(%ebx,%eax,4), %mm2 C src high qword
+ testb $4, %cl
+
+ jz L(dst_aligned)
+ psllq %mm6, %mm2
+
+ psrlq $32, %mm2
+ decl %eax
+
+ movd %mm2, 32(%edx,%eax,4) C dst high limb
+ movq 32-8(%ebx,%eax,4), %mm2 C new src high qword
+L(dst_aligned):
+
+ movq 32-16(%ebx,%eax,4), %mm0 C src second highest qword
+
+
+ C This loop is the important bit, the rest is just support for it.
+ C Four src limbs are held at the start, and four more will be read.
+ C Four dst limbs will be written. This schedule seems necessary for
+ C full speed.
+ C
+ C The use of size-8 lets the loop stop when %eax goes negative and
+ C leaves -4 to -1 which can be tested with test $1 and $2.
+
+L(top):
+ C eax counter, size-8 step by -4 until <0
+ C ebx src
+ C ecx
+ C edx dst
+ C
+ C mm0 src next qword
+ C mm1 scratch
+ C mm2 src prev qword
+ C mm6 shift
+ C mm7 64-shift
+
+ psllq %mm6, %mm2
+ subl $4, %eax
+
+ movq %mm0, %mm1
+ psrlq %mm7, %mm0
+
+ por %mm0, %mm2
+ movq 24(%ebx,%eax,4), %mm0
+
+ psllq %mm6, %mm1
+ movq %mm2, 40(%edx,%eax,4)
+
+ movq %mm0, %mm2
+ psrlq %mm7, %mm0
+
+ por %mm0, %mm1
+ movq 16(%ebx,%eax,4), %mm0
+
+ movq %mm1, 32(%edx,%eax,4)
+ jnc L(top)
+
+
+ C Now have four limbs in mm2 (prev) and mm0 (next), plus eax mod 4.
+ C
+ C 8(%ebx) is the next source, and 24(%edx) is the next destination.
+ C %eax is between -4 and -1, representing respectively 0 to 3 extra
+ C limbs that must be read.
+
+
+ testl $2, %eax C testl to avoid bad cache line crossing
+ jz L(finish_nottwo)
+
+ C Two more limbs: lshift mm2, OR it with rshifted mm0, mm0 becomes
+ C new mm2 and a new mm0 is loaded.
+
+ psllq %mm6, %mm2
+ movq %mm0, %mm1
+
+ psrlq %mm7, %mm0
+ subl $2, %eax
+
+ por %mm0, %mm2
+ movq 16(%ebx,%eax,4), %mm0
+
+ movq %mm2, 32(%edx,%eax,4)
+ movq %mm1, %mm2
+L(finish_nottwo):
+
+
+ C lshift mm2, OR with rshifted mm0, mm1 becomes lshifted mm0
+
+ testb $1, %al
+ psllq %mm6, %mm2
+
+ movq %mm0, %mm1
+ psrlq %mm7, %mm0
+
+ por %mm0, %mm2
+ psllq %mm6, %mm1
+
+ movq %mm2, 24(%edx,%eax,4)
+ jz L(finish_even)
+
+
+ C Size is odd, so mm1 and one extra limb to process.
+
+ movd (%ebx), %mm0 C src[0]
+ popl %ebx
+deflit(`FRAME',0)
+
+ movq %mm0, %mm2
+ psllq $32, %mm0
+
+ psrlq %mm7, %mm0
+
+ psllq %mm6, %mm2
+ por %mm0, %mm1
+
+ movq %mm1, 4(%edx) C dst[1,2]
+ movd %mm2, (%edx) C dst[0]
+
+ movl VAR_RETVAL, %eax
+
+ femms
+ ret
+
+
+ nop C avoid bad cache line crossing
+L(finish_even):
+deflit(`FRAME',4)
+ C Size is even, so only mm1 left to process.
+
+ movq %mm1, (%edx) C dst[0,1]
+ movl VAR_RETVAL, %eax
+
+ popl %ebx
+ femms
+ ret
+
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k6/k62mmx/rshift.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k6/k62mmx/rshift.asm
new file mode 100644
index 00000000000..f604a7bd529
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k6/k62mmx/rshift.asm
@@ -0,0 +1,293 @@
+dnl AMD K6-2 mpn_rshift -- mpn right shift.
+
+dnl Copyright 1999, 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 K6-2: 1.75 cycles/limb
+
+
+C mp_limb_t mpn_rshift (mp_ptr dst, mp_srcptr src, mp_size_t size,
+C unsigned shift);
+C
+
+defframe(PARAM_SHIFT,16)
+defframe(PARAM_SIZE, 12)
+defframe(PARAM_SRC, 8)
+defframe(PARAM_DST, 4)
+deflit(`FRAME',0)
+
+dnl Minimum 9, because the unrolled loop can't handle less.
+dnl
+deflit(UNROLL_THRESHOLD, 9)
+
+ TEXT
+ ALIGN(32)
+
+PROLOGUE(mpn_rshift)
+deflit(`FRAME',0)
+
+ C The 1 limb case can be done without the push %ebx, but it's then
+ C still the same speed. The push is left as a free helping hand for
+ C the two_or_more code.
+
+ movl PARAM_SIZE, %eax
+ pushl %ebx FRAME_pushl()
+
+ movl PARAM_SRC, %ebx
+ decl %eax
+
+ movl PARAM_SHIFT, %ecx
+ jnz L(two_or_more)
+
+ movl (%ebx), %edx C src limb
+ movl PARAM_DST, %ebx
+
+ shrdl( %cl, %edx, %eax) C return value
+
+ shrl %cl, %edx
+
+ movl %edx, (%ebx) C dst limb
+ popl %ebx
+
+ ret
+
+
+C -----------------------------------------------------------------------------
+ ALIGN(16) C avoid offset 0x1f
+L(two_or_more):
+ C eax size-1
+ C ebx src
+ C ecx shift
+ C edx
+
+ movl (%ebx), %edx C src low limb
+ negl %ecx
+
+ addl $32, %ecx
+ movd PARAM_SHIFT, %mm6
+
+ shll %cl, %edx
+ cmpl $UNROLL_THRESHOLD-1, %eax
+
+ jae L(unroll)
+
+
+ C eax size-1
+ C ebx src
+ C ecx 32-shift
+ C edx retval
+ C
+ C mm6 shift
+
+ movl PARAM_DST, %ecx
+ leal (%ebx,%eax,4), %ebx
+
+ leal -4(%ecx,%eax,4), %ecx
+ negl %eax
+
+ C This loop runs at about 3 cycles/limb, which is the amount of
+ C decoding, and this is despite every second access being unaligned.
+
+L(simple):
+ C eax counter, -(size-1) to -1
+ C ebx &src[size-1]
+ C ecx &dst[size-1]
+ C edx retval
+ C
+ C mm0 scratch
+ C mm6 shift
+
+Zdisp( movq, 0,(%ebx,%eax,4), %mm0)
+ incl %eax
+
+ psrlq %mm6, %mm0
+
+Zdisp( movd, %mm0, 0,(%ecx,%eax,4))
+ jnz L(simple)
+
+
+ movq %mm0, (%ecx)
+ movl %edx, %eax
+
+ popl %ebx
+
+ femms
+ ret
+
+
+C -----------------------------------------------------------------------------
+ ALIGN(16)
+L(unroll):
+ C eax size-1
+ C ebx src
+ C ecx 32-shift
+ C edx retval
+ C
+ C mm6 shift
+
+ addl $32, %ecx
+ subl $7, %eax C size-8
+
+ movd %ecx, %mm7
+ movl PARAM_DST, %ecx
+
+ movq (%ebx), %mm2 C src low qword
+ leal (%ebx,%eax,4), %ebx C src end - 32
+
+ testb $4, %cl
+ leal (%ecx,%eax,4), %ecx C dst end - 32
+
+ notl %eax C -(size-7)
+ jz L(dst_aligned)
+
+ psrlq %mm6, %mm2
+ incl %eax
+
+Zdisp( movd, %mm2, 0,(%ecx,%eax,4)) C dst low limb
+ movq 4(%ebx,%eax,4), %mm2 C new src low qword
+L(dst_aligned):
+
+ movq 12(%ebx,%eax,4), %mm0 C src second lowest qword
+ nop C avoid bad cache line crossing
+
+
+ C This loop is the important bit, the rest is just support for it.
+ C Four src limbs are held at the start, and four more will be read.
+ C Four dst limbs will be written. This schedule seems necessary for
+ C full speed.
+ C
+ C The use of -(size-7) lets the loop stop when %eax becomes >= 0 and
+ C and leaves 0 to 3 which can be tested with test $1 and $2.
+
+L(top):
+ C eax counter, -(size-7) step by +4 until >=0
+ C ebx src end - 32
+ C ecx dst end - 32
+ C edx retval
+ C
+ C mm0 src next qword
+ C mm1 scratch
+ C mm2 src prev qword
+ C mm6 shift
+ C mm7 64-shift
+
+ psrlq %mm6, %mm2
+ addl $4, %eax
+
+ movq %mm0, %mm1
+ psllq %mm7, %mm0
+
+ por %mm0, %mm2
+ movq 4(%ebx,%eax,4), %mm0
+
+ psrlq %mm6, %mm1
+ movq %mm2, -12(%ecx,%eax,4)
+
+ movq %mm0, %mm2
+ psllq %mm7, %mm0
+
+ por %mm0, %mm1
+ movq 12(%ebx,%eax,4), %mm0
+
+ movq %mm1, -4(%ecx,%eax,4)
+ ja L(top) C jump if no carry and not zero
+
+
+
+ C Now have the four limbs in mm2 (low) and mm0 (high), and %eax is 0
+ C to 3 representing respectively 3 to 0 further limbs.
+
+ testl $2, %eax C testl to avoid bad cache line crossings
+ jnz L(finish_nottwo)
+
+ C Two or three extra limbs: rshift mm2, OR it with lshifted mm0, mm0
+ C becomes new mm2 and a new mm0 is loaded.
+
+ psrlq %mm6, %mm2
+ movq %mm0, %mm1
+
+ psllq %mm7, %mm0
+ addl $2, %eax
+
+ por %mm0, %mm2
+ movq 12(%ebx,%eax,4), %mm0
+
+ movq %mm2, -4(%ecx,%eax,4)
+ movq %mm1, %mm2
+L(finish_nottwo):
+
+
+ testb $1, %al
+ psrlq %mm6, %mm2
+
+ movq %mm0, %mm1
+ psllq %mm7, %mm0
+
+ por %mm0, %mm2
+ psrlq %mm6, %mm1
+
+ movq %mm2, 4(%ecx,%eax,4)
+ jnz L(finish_even)
+
+
+ C one further extra limb to process
+
+ movd 32-4(%ebx), %mm0 C src[size-1], most significant limb
+ popl %ebx
+
+ movq %mm0, %mm2
+ psllq %mm7, %mm0
+
+ por %mm0, %mm1
+ psrlq %mm6, %mm2
+
+ movq %mm1, 32-12(%ecx) C dst[size-3,size-2]
+ movd %mm2, 32-4(%ecx) C dst[size-1]
+
+ movl %edx, %eax C retval
+
+ femms
+ ret
+
+
+ nop C avoid bad cache line crossing
+L(finish_even):
+ C no further extra limbs
+
+ movq %mm1, 32-8(%ecx) C dst[size-2,size-1]
+ movl %edx, %eax C retval
+
+ popl %ebx
+
+ femms
+ ret
+
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k6/mmx/com.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k6/mmx/com.asm
new file mode 100644
index 00000000000..b747454627b
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k6/mmx/com.asm
@@ -0,0 +1,103 @@
+dnl AMD K6-2 mpn_com -- mpn bitwise one's complement.
+
+dnl Copyright 1999-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')
+
+NAILS_SUPPORT(0-31)
+
+
+C alignment dst/src, A=0mod8 N=4mod8
+C A/A A/N N/A N/N
+C K6-2 1.0 1.18 1.18 1.18 cycles/limb
+C K6 1.5 1.85 1.75 1.85
+
+
+C void mpn_com (mp_ptr dst, mp_srcptr src, mp_size_t size);
+C
+C Take the bitwise ones-complement of src,size and write it to dst,size.
+
+defframe(PARAM_SIZE,12)
+defframe(PARAM_SRC, 8)
+defframe(PARAM_DST, 4)
+
+ TEXT
+ ALIGN(16)
+PROLOGUE(mpn_com)
+deflit(`FRAME',0)
+
+ movl PARAM_SIZE, %ecx
+ movl PARAM_SRC, %eax
+ movl PARAM_DST, %edx
+ shrl %ecx
+ jnz L(two_or_more)
+
+ movl (%eax), %eax
+ notl_or_xorl_GMP_NUMB_MASK( %eax)
+ movl %eax, (%edx)
+ ret
+
+
+L(two_or_more):
+ pushl %ebx FRAME_pushl()
+ pcmpeqd %mm7, %mm7 C all ones
+
+ movl %ecx, %ebx
+ifelse(GMP_NAIL_BITS,0,,
+` psrld $GMP_NAIL_BITS, %mm7') C clear nails
+
+
+
+ ALIGN(8)
+L(top):
+ C eax src
+ C ebx floor(size/2)
+ C ecx counter
+ C edx dst
+ C
+ C mm0 scratch
+ C mm7 mask
+
+ movq -8(%eax,%ecx,8), %mm0
+ pxor %mm7, %mm0
+ movq %mm0, -8(%edx,%ecx,8)
+ loop L(top)
+
+
+ jnc L(no_extra)
+ movl (%eax,%ebx,8), %eax
+ notl_or_xorl_GMP_NUMB_MASK( %eax)
+ movl %eax, (%edx,%ebx,8)
+L(no_extra):
+
+ popl %ebx
+ emms_or_femms
+ ret
+
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k6/mmx/dive_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k6/mmx/dive_1.asm
new file mode 100644
index 00000000000..b644dca8cd4
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k6/mmx/dive_1.asm
@@ -0,0 +1,281 @@
+dnl AMD K6 mpn_divexact_1 -- mpn by limb exact division.
+
+dnl Copyright 2000-2002, 2007 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 divisor
+C odd even
+C K6: 10.0 12.0 cycles/limb
+C K6-2: 10.0 11.5
+
+
+C void mpn_divexact_1 (mp_ptr dst, mp_srcptr src, mp_size_t size,
+C mp_limb_t divisor);
+C
+C A simple divl is used for size==1. This is about 10 cycles faster for an
+C odd divisor or 20 cycles for an even divisor.
+C
+C The loops are quite sensitive to code alignment, speeds should be
+C rechecked (odd and even divisor, pic and non-pic) if contemplating
+C changing anything.
+
+defframe(PARAM_DIVISOR,16)
+defframe(PARAM_SIZE, 12)
+defframe(PARAM_SRC, 8)
+defframe(PARAM_DST, 4)
+
+dnl re-use parameter space
+define(VAR_INVERSE,`PARAM_DST')
+
+ TEXT
+
+ ALIGN(32)
+PROLOGUE(mpn_divexact_1)
+deflit(`FRAME',0)
+
+ movl PARAM_SIZE, %ecx
+
+ movl PARAM_SRC, %eax
+ xorl %edx, %edx
+
+ cmpl $1, %ecx
+ jnz L(two_or_more)
+
+ movl (%eax), %eax
+
+ divl PARAM_DIVISOR
+
+ movl PARAM_DST, %ecx
+ movl %eax, (%ecx)
+
+ ret
+
+
+L(two_or_more):
+ movl PARAM_DIVISOR, %eax
+ pushl %ebx FRAME_pushl()
+
+ movl PARAM_SRC, %ebx
+ pushl %ebp FRAME_pushl()
+
+L(strip_twos):
+ shrl %eax
+ incl %edx C will get shift+1
+
+ jnc L(strip_twos)
+ pushl %esi FRAME_pushl()
+
+ leal 1(%eax,%eax), %esi C d without twos
+ andl $127, %eax C d/2, 7 bits
+
+ifdef(`PIC',`
+ LEA( binvert_limb_table, %ebp)
+Zdisp( movzbl, 0,(%eax,%ebp), %eax)
+',`
+ movzbl binvert_limb_table(%eax), %eax C inv 8 bits
+')
+ pushl %edi FRAME_pushl()
+
+ leal (%eax,%eax), %ebp C 2*inv
+
+ imull %eax, %eax C inv*inv
+
+ movl PARAM_DST, %edi
+
+ imull %esi, %eax C inv*inv*d
+
+ subl %eax, %ebp C inv = 2*inv - inv*inv*d
+ leal (%ebp,%ebp), %eax C 2*inv
+
+ imull %ebp, %ebp C inv*inv
+
+ movl %esi, PARAM_DIVISOR C d without twos
+ leal (%ebx,%ecx,4), %ebx C src end
+
+ imull %esi, %ebp C inv*inv*d
+
+ leal (%edi,%ecx,4), %edi C dst end
+ negl %ecx C -size
+
+ subl %ebp, %eax C inv = 2*inv - inv*inv*d
+ subl $1, %edx C shift amount, and clear carry
+
+ ASSERT(e,` C expect d*inv == 1 mod 2^GMP_LIMB_BITS
+ pushl %eax FRAME_pushl()
+ imull PARAM_DIVISOR, %eax
+ cmpl $1, %eax
+ popl %eax FRAME_popl()')
+
+ movl %eax, VAR_INVERSE
+ jnz L(even)
+
+ movl (%ebx,%ecx,4), %esi C src low limb
+ jmp L(odd_entry)
+
+
+ ALIGN(16)
+ nop C code alignment
+L(odd_top):
+ C eax scratch
+ C ebx src end
+ C ecx counter, limbs, negative
+ C edx inverse
+ C esi next limb, adjusted for carry
+ C edi dst end
+ C ebp carry bit, 0 or -1
+
+ imull %edx, %esi
+
+ movl PARAM_DIVISOR, %eax
+ movl %esi, -4(%edi,%ecx,4)
+
+ mull %esi C carry limb in edx
+
+ subl %ebp, %edx C apply carry bit
+ movl (%ebx,%ecx,4), %esi
+
+L(odd_entry):
+ subl %edx, %esi C apply carry limb
+ movl VAR_INVERSE, %edx
+
+ sbbl %ebp, %ebp C 0 or -1
+
+ incl %ecx
+ jnz L(odd_top)
+
+
+ imull %edx, %esi
+
+ movl %esi, -4(%edi,%ecx,4)
+
+ popl %edi
+ popl %esi
+
+ popl %ebp
+ popl %ebx
+
+ ret
+
+
+L(even):
+ C eax
+ C ebx src end
+ C ecx -size
+ C edx twos
+ C esi
+ C edi dst end
+ C ebp
+
+ xorl %ebp, %ebp
+Zdisp( movq, 0,(%ebx,%ecx,4), %mm0) C src[0,1]
+
+ movd %edx, %mm7
+ movl VAR_INVERSE, %edx
+
+ addl $2, %ecx
+ psrlq %mm7, %mm0
+
+ movd %mm0, %esi
+ jz L(even_two) C if only two limbs
+
+
+C Out-of-order execution is good enough to hide the load/rshift/movd
+C latency. Having imul at the top of the loop gives 11.5 c/l instead of 12,
+C on K6-2. In fact there's only 11 of decode, but nothing running at 11 has
+C been found. Maybe the fact every second movq is unaligned costs the extra
+C 0.5.
+
+L(even_top):
+ C eax scratch
+ C ebx src end
+ C ecx counter, limbs, negative
+ C edx inverse
+ C esi next limb, adjusted for carry
+ C edi dst end
+ C ebp carry bit, 0 or -1
+ C
+ C mm0 scratch, source limbs
+ C mm7 twos
+
+ imull %edx, %esi
+
+ movl %esi, -8(%edi,%ecx,4)
+ movl PARAM_DIVISOR, %eax
+
+ mull %esi C carry limb in edx
+
+ movq -4(%ebx,%ecx,4), %mm0
+ psrlq %mm7, %mm0
+
+ movd %mm0, %esi
+ subl %ebp, %edx C apply carry bit
+
+ subl %edx, %esi C apply carry limb
+ movl VAR_INVERSE, %edx
+
+ sbbl %ebp, %ebp C 0 or -1
+
+ incl %ecx
+ jnz L(even_top)
+
+
+L(even_two):
+ movd -4(%ebx), %mm0 C src high limb
+ psrlq %mm7, %mm0
+
+ imull %edx, %esi
+
+ movl %esi, -8(%edi)
+ movl PARAM_DIVISOR, %eax
+
+ mull %esi C carry limb in edx
+
+ movd %mm0, %esi
+ subl %ebp, %edx C apply carry bit
+
+ movl VAR_INVERSE, %eax
+ subl %edx, %esi C apply carry limb
+
+ imull %eax, %esi
+
+ movl %esi, -4(%edi)
+
+ popl %edi
+ popl %esi
+
+ popl %ebp
+ popl %ebx
+
+ emms_or_femms
+
+ ret
+
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k6/mmx/logops_n.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k6/mmx/logops_n.asm
new file mode 100644
index 00000000000..e17930bb2db
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k6/mmx/logops_n.asm
@@ -0,0 +1,226 @@
+dnl AMD K6-2 mpn_and_n, mpn_andn_n, mpn_nand_n, mpn_ior_n, mpn_iorn_n,
+dnl mpn_nior_n, mpn_xor_n, mpn_xnor_n -- mpn bitwise logical operations.
+
+dnl Copyright 1999-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')
+
+NAILS_SUPPORT(0-31)
+
+
+C alignment dst/src1/src2, A=0mod8, N=4mod8
+C A/A/A A/A/N A/N/A A/N/N N/A/A N/A/N N/N/A N/N/N
+C
+C K6-2 1.2 1.5 1.5 1.2 1.2 1.5 1.5 1.2 and,andn,ior,xor
+C K6-2 1.5 1.75 2.0 1.75 1.75 2.0 1.75 1.5 iorn,xnor
+C K6-2 1.75 2.0 2.0 2.0 2.0 2.0 2.0 1.75 nand,nior
+C
+C K6 1.5 1.68 1.75 1.2 1.75 1.75 1.68 1.5 and,andn,ior,xor
+C K6 2.0 2.0 2.25 2.25 2.25 2.25 2.0 2.0 iorn,xnor
+C K6 2.0 2.25 2.25 2.25 2.25 2.25 2.25 2.0 nand,nior
+
+
+dnl M4_p and M4_i are the MMX and integer instructions
+dnl M4_*_neg_dst means whether to negate the final result before writing
+dnl M4_*_neg_src2 means whether to negate the src2 values before using them
+
+define(M4_choose_op,
+m4_assert_numargs(7)
+`ifdef(`OPERATION_$1',`
+define(`M4_function', `mpn_$1')
+define(`M4_operation', `$1')
+define(`M4_p', `$2')
+define(`M4_p_neg_dst', `$3')
+define(`M4_p_neg_src2',`$4')
+define(`M4_i', `$5')
+define(`M4_i_neg_dst', `$6')
+define(`M4_i_neg_src2',`$7')
+')')
+
+dnl xnor is done in "iorn" style because it's a touch faster than "nior"
+dnl style (the two are equivalent for xor).
+dnl
+dnl pandn can't be used with nails.
+
+M4_choose_op( and_n, pand,0,0, andl,0,0)
+ifelse(GMP_NAIL_BITS,0,
+`M4_choose_op(andn_n, pandn,0,0, andl,0,1)',
+`M4_choose_op(andn_n, pand,0,1, andl,0,1)')
+M4_choose_op( nand_n, pand,1,0, andl,1,0)
+M4_choose_op( ior_n, por,0,0, orl,0,0)
+M4_choose_op( iorn_n, por,0,1, orl,0,1)
+M4_choose_op( nior_n, por,1,0, orl,1,0)
+M4_choose_op( xor_n, pxor,0,0, xorl,0,0)
+M4_choose_op( xnor_n, pxor,0,1, xorl,0,1)
+
+ifdef(`M4_function',,
+`m4_error(`Unrecognised or undefined OPERATION symbol
+')')
+
+MULFUNC_PROLOGUE(mpn_and_n mpn_andn_n mpn_nand_n mpn_ior_n mpn_iorn_n mpn_nior_n mpn_xor_n mpn_xnor_n)
+
+
+C void M4_function (mp_ptr dst, mp_srcptr src1, mp_srcptr src2,
+C mp_size_t size);
+C
+C Do src1,size M4_operation src2,size, storing the result in dst,size.
+C
+C Unaligned movq loads and stores are a bit slower than aligned ones. The
+C test at the start of the routine checks the alignment of src1 and if
+C necessary processes one limb separately at the low end to make it aligned.
+C
+C The raw speeds without this alignment switch are as follows.
+C
+C alignment dst/src1/src2, A=0mod8, N=4mod8
+C A/A/A A/A/N A/N/A A/N/N N/A/A N/A/N N/N/A N/N/N
+C
+C K6 1.5 2.0 1.5 2.0 and,andn,ior,xor
+C K6 1.75 2.2 2.0 2.28 iorn,xnor
+C K6 2.0 2.25 2.35 2.28 nand,nior
+C
+C
+C Future:
+C
+C K6 can do one 64-bit load per cycle so each of these routines should be
+C able to approach 1.0 c/l, if aligned. The basic and/andn/ior/xor might be
+C able to get 1.0 with just a 4 limb loop, being 3 instructions per 2 limbs.
+C The others are 4 instructions per 2 limbs, and so can only approach 1.0
+C because there's nowhere to hide some loop control.
+
+defframe(PARAM_SIZE,16)
+defframe(PARAM_SRC2,12)
+defframe(PARAM_SRC1,8)
+defframe(PARAM_DST, 4)
+deflit(`FRAME',0)
+
+ TEXT
+ ALIGN(32)
+PROLOGUE(M4_function)
+ movl PARAM_SIZE, %ecx
+ pushl %ebx FRAME_pushl()
+
+ movl PARAM_SRC1, %eax
+
+ movl PARAM_SRC2, %ebx
+ cmpl $1, %ecx
+
+ movl PARAM_DST, %edx
+ ja L(two_or_more)
+
+
+ movl (%ebx), %ecx
+ popl %ebx
+ifelse(M4_i_neg_src2,1,`notl_or_xorl_GMP_NUMB_MASK( %ecx)')
+ M4_i (%eax), %ecx
+ifelse(M4_i_neg_dst,1,` notl_or_xorl_GMP_NUMB_MASK( %ecx)')
+ movl %ecx, (%edx)
+
+ ret
+
+
+L(two_or_more):
+ C eax src1
+ C ebx src2
+ C ecx size
+ C edx dst
+ C esi
+ C edi
+ C ebp
+
+ pushl %esi FRAME_pushl()
+ testl $4, %eax
+ jz L(alignment_ok)
+
+ movl (%ebx), %esi
+ addl $4, %ebx
+ifelse(M4_i_neg_src2,1,`notl_or_xorl_GMP_NUMB_MASK( %esi)')
+ M4_i (%eax), %esi
+ addl $4, %eax
+ifelse(M4_i_neg_dst,1,` notl_or_xorl_GMP_NUMB_MASK( %esi)')
+ movl %esi, (%edx)
+ addl $4, %edx
+ decl %ecx
+
+L(alignment_ok):
+ movl %ecx, %esi
+ shrl %ecx
+ jnz L(still_two_or_more)
+
+ movl (%ebx), %ecx
+ popl %esi
+ifelse(M4_i_neg_src2,1,`notl_or_xorl_GMP_NUMB_MASK( %ecx)')
+ M4_i (%eax), %ecx
+ifelse(M4_i_neg_dst,1,` notl_or_xorl_GMP_NUMB_MASK( %ecx)')
+ popl %ebx
+ movl %ecx, (%edx)
+ ret
+
+
+L(still_two_or_more):
+ifelse(eval(M4_p_neg_src2 || M4_p_neg_dst),1,`
+ pcmpeqd %mm7, %mm7 C all ones
+ifelse(GMP_NAIL_BITS,0,,`psrld $GMP_NAIL_BITS, %mm7') C clear nails
+')
+
+ ALIGN(16)
+L(top):
+ C eax src1
+ C ebx src2
+ C ecx counter
+ C edx dst
+ C esi
+ C edi
+ C ebp
+ C
+ C carry bit is low of size
+
+ movq -8(%ebx,%ecx,8), %mm0
+ifelse(M4_p_neg_src2,1,`pxor %mm7, %mm0')
+ M4_p -8(%eax,%ecx,8), %mm0
+ifelse(M4_p_neg_dst,1,` pxor %mm7, %mm0')
+ movq %mm0, -8(%edx,%ecx,8)
+
+ loop L(top)
+
+
+ jnc L(no_extra)
+
+ movl -4(%ebx,%esi,4), %ebx
+ifelse(M4_i_neg_src2,1,`notl_or_xorl_GMP_NUMB_MASK( %ebx)')
+ M4_i -4(%eax,%esi,4), %ebx
+ifelse(M4_i_neg_dst,1,` notl_or_xorl_GMP_NUMB_MASK( %ebx)')
+ movl %ebx, -4(%edx,%esi,4)
+L(no_extra):
+
+ popl %esi
+ popl %ebx
+ emms_or_femms
+ ret
+
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k6/mmx/lshift.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k6/mmx/lshift.asm
new file mode 100644
index 00000000000..45be5826337
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k6/mmx/lshift.asm
@@ -0,0 +1,130 @@
+dnl AMD K6 mpn_lshift -- mpn left shift.
+
+dnl Copyright 1999, 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 K6: 3.0 cycles/limb
+
+
+C mp_limb_t mpn_lshift (mp_ptr dst, mp_srcptr src, mp_size_t size,
+C unsigned shift);
+C
+C The loop runs at 3 cycles/limb, limited by decoding and by having 3 mmx
+C instructions. This is despite every second fetch being unaligned.
+
+
+defframe(PARAM_SHIFT,16)
+defframe(PARAM_SIZE, 12)
+defframe(PARAM_SRC, 8)
+defframe(PARAM_DST, 4)
+
+ TEXT
+ ALIGN(32)
+
+PROLOGUE(mpn_lshift)
+deflit(`FRAME',0)
+
+ C The 1 limb case can be done without the push %ebx, but it's then
+ C still the same speed. The push is left as a free helping hand for
+ C the two_or_more code.
+
+ movl PARAM_SIZE, %eax
+ pushl %ebx FRAME_pushl()
+
+ movl PARAM_SRC, %ebx
+ decl %eax
+
+ movl PARAM_SHIFT, %ecx
+ jnz L(two_or_more)
+
+ movl (%ebx), %edx C src limb
+ movl PARAM_DST, %ebx
+
+ shldl( %cl, %edx, %eax) C return value
+
+ shll %cl, %edx
+
+ movl %edx, (%ebx) C dst limb
+ popl %ebx
+
+ ret
+
+
+ ALIGN(16) C avoid offset 0x1f
+ nop C avoid bad cache line crossing
+L(two_or_more):
+ C eax size-1
+ C ebx src
+ C ecx shift
+ C edx
+
+ movl (%ebx,%eax,4), %edx C src high limb
+ negl %ecx
+
+ movd PARAM_SHIFT, %mm6
+ addl $32, %ecx C 32-shift
+
+ shrl %cl, %edx
+
+ movd %ecx, %mm7
+ movl PARAM_DST, %ecx
+
+L(top):
+ C eax counter, size-1 to 1
+ C ebx src
+ C ecx dst
+ C edx retval
+ C
+ C mm0 scratch
+ C mm6 shift
+ C mm7 32-shift
+
+ movq -4(%ebx,%eax,4), %mm0
+ decl %eax
+
+ psrlq %mm7, %mm0
+
+ movd %mm0, 4(%ecx,%eax,4)
+ jnz L(top)
+
+
+ movd (%ebx), %mm0
+ popl %ebx
+
+ psllq %mm6, %mm0
+ movl %edx, %eax
+
+ movd %mm0, (%ecx)
+
+ emms
+ ret
+
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k6/mmx/popham.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k6/mmx/popham.asm
new file mode 100644
index 00000000000..2b19d0b5ee0
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k6/mmx/popham.asm
@@ -0,0 +1,236 @@
+dnl AMD K6-2 mpn_popcount, mpn_hamdist -- mpn bit population count and
+dnl hamming distance.
+
+dnl Copyright 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 popcount hamdist
+C K6-2: 9.0 11.5 cycles/limb
+C K6: 12.5 13.0
+
+
+C unsigned long mpn_popcount (mp_srcptr src, mp_size_t size);
+C unsigned long mpn_hamdist (mp_srcptr src, mp_srcptr src2, mp_size_t size);
+C
+C The code here isn't optimal, but it's already a 2x speedup over the plain
+C integer mpn/generic/popcount.c,hamdist.c.
+
+
+ifdef(`OPERATION_popcount',,
+`ifdef(`OPERATION_hamdist',,
+`m4_error(`Need OPERATION_popcount or OPERATION_hamdist
+')m4exit(1)')')
+
+define(HAM,
+m4_assert_numargs(1)
+`ifdef(`OPERATION_hamdist',`$1')')
+
+define(POP,
+m4_assert_numargs(1)
+`ifdef(`OPERATION_popcount',`$1')')
+
+HAM(`
+defframe(PARAM_SIZE, 12)
+defframe(PARAM_SRC2, 8)
+defframe(PARAM_SRC, 4)
+define(M4_function,mpn_hamdist)
+')
+POP(`
+defframe(PARAM_SIZE, 8)
+defframe(PARAM_SRC, 4)
+define(M4_function,mpn_popcount)
+')
+
+MULFUNC_PROLOGUE(mpn_popcount mpn_hamdist)
+
+
+ifdef(`PIC',,`
+ dnl non-PIC
+
+ RODATA
+ ALIGN(8)
+
+L(rodata_AAAAAAAAAAAAAAAA):
+ .long 0xAAAAAAAA
+ .long 0xAAAAAAAA
+
+L(rodata_3333333333333333):
+ .long 0x33333333
+ .long 0x33333333
+
+L(rodata_0F0F0F0F0F0F0F0F):
+ .long 0x0F0F0F0F
+ .long 0x0F0F0F0F
+
+L(rodata_000000FF000000FF):
+ .long 0x000000FF
+ .long 0x000000FF
+')
+
+ TEXT
+ ALIGN(32)
+
+POP(`ifdef(`PIC', `
+ C avoid shrl crossing a 32-byte boundary
+ nop')')
+
+PROLOGUE(M4_function)
+deflit(`FRAME',0)
+
+ movl PARAM_SIZE, %ecx
+
+ifdef(`PIC',`
+ movl $0xAAAAAAAA, %eax
+ movl $0x33333333, %edx
+
+ movd %eax, %mm7
+ movd %edx, %mm6
+
+ movl $0x0F0F0F0F, %eax
+ movl $0x000000FF, %edx
+
+ punpckldq %mm7, %mm7
+ punpckldq %mm6, %mm6
+
+ movd %eax, %mm5
+ movd %edx, %mm4
+
+ punpckldq %mm5, %mm5
+ punpckldq %mm4, %mm4
+',`
+
+ movq L(rodata_AAAAAAAAAAAAAAAA), %mm7
+ movq L(rodata_3333333333333333), %mm6
+ movq L(rodata_0F0F0F0F0F0F0F0F), %mm5
+ movq L(rodata_000000FF000000FF), %mm4
+')
+
+define(REG_AAAAAAAAAAAAAAAA, %mm7)
+define(REG_3333333333333333, %mm6)
+define(REG_0F0F0F0F0F0F0F0F, %mm5)
+define(REG_000000FF000000FF, %mm4)
+
+
+ movl PARAM_SRC, %eax
+HAM(` movl PARAM_SRC2, %edx')
+
+ pxor %mm2, %mm2 C total
+
+ shrl %ecx
+ jnc L(top)
+
+Zdisp( movd, 0,(%eax,%ecx,8), %mm1)
+
+HAM(`
+Zdisp( movd, 0,(%edx,%ecx,8), %mm0)
+ pxor %mm0, %mm1
+')
+
+ incl %ecx
+ jmp L(loaded)
+
+
+ ALIGN(16)
+POP(` nop C alignment to avoid crossing 32-byte boundaries')
+
+L(top):
+ C eax src
+ C ebx
+ C ecx counter, qwords, decrementing
+ C edx [hamdist] src2
+ C
+ C mm0 (scratch)
+ C mm1 (scratch)
+ C mm2 total (low dword)
+ C mm3
+ C mm4 \
+ C mm5 | special constants
+ C mm6 |
+ C mm7 /
+
+ movq -8(%eax,%ecx,8), %mm1
+HAM(` pxor -8(%edx,%ecx,8), %mm1')
+
+L(loaded):
+ movq %mm1, %mm0
+ pand REG_AAAAAAAAAAAAAAAA, %mm1
+
+ psrlq $1, %mm1
+HAM(` nop C code alignment')
+
+ psubd %mm1, %mm0 C bit pairs
+HAM(` nop C code alignment')
+
+
+ movq %mm0, %mm1
+ psrlq $2, %mm0
+
+ pand REG_3333333333333333, %mm0
+ pand REG_3333333333333333, %mm1
+
+ paddd %mm1, %mm0 C nibbles
+
+
+ movq %mm0, %mm1
+ psrlq $4, %mm0
+
+ pand REG_0F0F0F0F0F0F0F0F, %mm0
+ pand REG_0F0F0F0F0F0F0F0F, %mm1
+
+ paddd %mm1, %mm0 C bytes
+
+ movq %mm0, %mm1
+ psrlq $8, %mm0
+
+
+ paddb %mm1, %mm0 C words
+
+
+ movq %mm0, %mm1
+ psrlq $16, %mm0
+
+ paddd %mm1, %mm0 C dwords
+
+ pand REG_000000FF000000FF, %mm0
+
+ paddd %mm0, %mm2 C low to total
+ psrlq $32, %mm0
+
+ paddd %mm0, %mm2 C high to total
+ loop L(top)
+
+
+
+ movd %mm2, %eax
+ emms_or_femms
+ ret
+
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k6/mmx/rshift.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k6/mmx/rshift.asm
new file mode 100644
index 00000000000..cd0382f322c
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k6/mmx/rshift.asm
@@ -0,0 +1,130 @@
+dnl AMD K6 mpn_rshift -- mpn right shift.
+
+dnl Copyright 1999, 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 K6: 3.0 cycles/limb
+
+
+C mp_limb_t mpn_rshift (mp_ptr dst, mp_srcptr src, mp_size_t size,
+C unsigned shift);
+C
+C The loop runs at 3 cycles/limb, limited by decoding and by having 3 mmx
+C instructions. This is despite every second fetch being unaligned.
+
+
+defframe(PARAM_SHIFT,16)
+defframe(PARAM_SIZE, 12)
+defframe(PARAM_SRC, 8)
+defframe(PARAM_DST, 4)
+deflit(`FRAME',0)
+
+ TEXT
+ ALIGN(32)
+
+PROLOGUE(mpn_rshift)
+deflit(`FRAME',0)
+
+ C The 1 limb case can be done without the push %ebx, but it's then
+ C still the same speed. The push is left as a free helping hand for
+ C the two_or_more code.
+
+ movl PARAM_SIZE, %eax
+ pushl %ebx FRAME_pushl()
+
+ movl PARAM_SRC, %ebx
+ decl %eax
+
+ movl PARAM_SHIFT, %ecx
+ jnz L(two_or_more)
+
+ movl (%ebx), %edx C src limb
+ movl PARAM_DST, %ebx
+
+ shrdl( %cl, %edx, %eax) C return value
+
+ shrl %cl, %edx
+
+ movl %edx, (%ebx) C dst limb
+ popl %ebx
+
+ ret
+
+
+ ALIGN(16) C avoid offset 0x1f
+L(two_or_more):
+ C eax size-1
+ C ebx src
+ C ecx shift
+ C edx
+
+ movl (%ebx), %edx C src low limb
+ negl %ecx
+
+ addl $32, %ecx C 32-shift
+ movd PARAM_SHIFT, %mm6
+
+ shll %cl, %edx C retval
+ movl PARAM_DST, %ecx
+
+ leal (%ebx,%eax,4), %ebx
+
+ leal -4(%ecx,%eax,4), %ecx
+ negl %eax
+
+
+L(simple):
+ C eax counter (negative)
+ C ebx &src[size-1]
+ C ecx &dst[size-1]
+ C edx retval
+ C
+ C mm0 scratch
+ C mm6 shift
+
+Zdisp( movq, 0,(%ebx,%eax,4), %mm0)
+ incl %eax
+
+ psrlq %mm6, %mm0
+
+Zdisp( movd, %mm0, 0,(%ecx,%eax,4))
+ jnz L(simple)
+
+
+ movq %mm0, (%ecx)
+ movl %edx, %eax
+
+ popl %ebx
+
+ emms
+ ret
+
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k6/mod_34lsub1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k6/mod_34lsub1.asm
new file mode 100644
index 00000000000..7e30503e544
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k6/mod_34lsub1.asm
@@ -0,0 +1,190 @@
+dnl AMD K6 mpn_mod_34lsub1 -- mpn remainder modulo 2**24-1.
+
+dnl Copyright 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 K6: 2.66 cycles/limb
+
+
+C mp_limb_t mpn_mod_34lsub1 (mp_srcptr src, mp_size_t size)
+C
+C An attempt was made to use a loop like
+C
+C L(top):
+C adcl (%edx), %eax
+C adcl 4(%edx), %ebx
+C adcl 8(%edx), %esi
+C leal 12(%edx), %edx
+C loop L(top)
+C
+C with %ecx starting from floor(size/3), but it still measured 2.66 c/l.
+C The form used instead can save about 6 cycles by not dividing by 3.
+C
+C In the code used, putting the "leal"s at the top of the loop is necessary
+C for the claimed speed, anywhere else costs an extra cycle per loop.
+C Perhaps a tight loop like this needs short decode instructions at the
+C branch target, which would explain the leal/loop form above taking 8
+C cycles instead of 7 too.
+
+defframe(PARAM_SIZE, 8)
+defframe(PARAM_SRC, 4)
+
+dnl re-use parameter space
+define(SAVE_EBX, `PARAM_SIZE')
+define(SAVE_ESI, `PARAM_SRC')
+
+ TEXT
+ ALIGN(16)
+PROLOGUE(mpn_mod_34lsub1)
+deflit(`FRAME',0)
+
+ movl PARAM_SIZE, %eax
+ movl PARAM_SRC, %edx
+
+ subl $2, %eax
+ ja L(three_or_more)
+
+Zdisp( movl, 0,(%edx), %eax) C avoid code cache line boundary
+ jne L(one)
+
+ movl %eax, %ecx
+ movl 4(%edx), %edx
+
+ shrl $24, %eax C src[0] high
+ andl $0x00FFFFFF, %ecx C src[0] low
+
+ addl %ecx, %eax
+ movl %edx, %ecx
+
+ shll $8, %edx
+ andl $0x00FFFF00, %edx C src[1] high
+
+ shrl $16, %ecx C src[1] low
+ addl %ecx, %eax
+
+ addl %edx, %eax
+
+L(one):
+ ret
+
+
+L(three_or_more):
+ C eax size-2
+ C ebx
+ C ecx
+ C edx src
+
+ movl %ebx, SAVE_EBX
+ xorl %ebx, %ebx
+
+ movl %esi, SAVE_ESI
+ pushl %edi FRAME_pushl()
+
+ xorl %esi, %esi
+ xorl %edi, %edi C and clear carry flag
+
+L(top):
+ C eax counter, limbs
+ C ebx acc 0mod3
+ C ecx
+ C edx src, incrementing
+ C esi acc 1mod3
+ C edi acc 2mod3
+ C ebp
+
+ leal -2(%eax), %eax
+ leal 12(%edx), %edx
+
+ adcl -12(%edx), %ebx
+ adcl -8(%edx), %esi
+ adcl -4(%edx), %edi
+
+ decl %eax
+ jg L(top)
+
+
+ C ecx is -3, -2 or -1 representing 0, 1 or 2 more limbs, respectively
+
+ movb $0, %cl
+ incl %eax
+
+ js L(combine) C 0 more
+
+Zdisp( adcl, 0,(%edx), %ebx) C avoid code cache line crossings
+
+ movb $8, %cl
+ decl %eax
+
+ js L(combine) C 1 more
+
+ adcl 4(%edx), %esi
+
+ movb $16, %cl
+
+
+L(combine):
+ sbbl %edx, %edx
+
+ shll %cl, %edx C carry
+ movl %ebx, %eax C 0mod3
+
+ shrl $24, %eax C 0mod3 high
+ andl $0x00FFFFFF, %ebx C 0mod3 low
+
+ subl %edx, %eax C apply carry
+ movl %esi, %ecx C 1mod3
+
+ shrl $16, %esi C 1mod3 high
+ addl %ebx, %eax C apply 0mod3 low
+
+ andl $0x0000FFFF, %ecx
+ addl %esi, %eax C apply 1mod3 high
+
+ shll $8, %ecx C 1mod3 low
+ movl %edi, %edx C 2mod3
+
+ shrl $8, %edx C 2mod3 high
+ addl %ecx, %eax C apply 1mod3 low
+
+ addl %edx, %eax C apply 2mod3 high
+ andl $0x000000FF, %edi
+
+ shll $16, %edi C 2mod3 low
+ movl SAVE_EBX, %ebx
+
+ addl %edi, %eax C apply 2mod3 low
+ movl SAVE_ESI, %esi
+
+ popl %edi
+
+ ret
+
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k6/mode1o.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k6/mode1o.asm
new file mode 100644
index 00000000000..a13f647b811
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k6/mode1o.asm
@@ -0,0 +1,175 @@
+dnl AMD K6 mpn_modexact_1_odd -- exact division style remainder.
+
+dnl Copyright 2000-2003, 2007 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 K6: 10.0 cycles/limb
+
+
+C mp_limb_t mpn_modexact_1_odd (mp_srcptr src, mp_size_t size,
+C mp_limb_t divisor);
+C mp_limb_t mpn_modexact_1c_odd (mp_srcptr src, mp_size_t size,
+C mp_limb_t divisor, mp_limb_t carry);
+C
+C A special case for high<divisor at the end measured only about 4 cycles
+C faster, and so isn't used.
+C
+C A special case for size==1 using a divl rather than the inverse measured
+C only about 5 cycles faster, and so isn't used. When size==1 and
+C high<divisor it can skip a division and be a full 24 cycles faster, but
+C this isn't an important case.
+
+defframe(PARAM_CARRY, 16)
+defframe(PARAM_DIVISOR,12)
+defframe(PARAM_SIZE, 8)
+defframe(PARAM_SRC, 4)
+
+ TEXT
+
+ ALIGN(32)
+PROLOGUE(mpn_modexact_1c_odd)
+deflit(`FRAME',0)
+
+ movl PARAM_DIVISOR, %ecx
+ pushl %esi FRAME_pushl()
+
+ movl PARAM_CARRY, %edx
+ jmp L(start_1c)
+
+EPILOGUE()
+
+
+ ALIGN(16)
+PROLOGUE(mpn_modexact_1_odd)
+deflit(`FRAME',0)
+
+ movl PARAM_DIVISOR, %ecx
+ pushl %esi FRAME_pushl()
+
+ xorl %edx, %edx
+L(start_1c):
+ pushl %edi FRAME_pushl()
+
+ shrl %ecx C d/2
+ movl PARAM_DIVISOR, %esi
+
+ andl $127, %ecx C d/2, 7 bits
+ pushl %ebp FRAME_pushl()
+
+ifdef(`PIC',`
+ LEA( binvert_limb_table, %edi)
+Zdisp( movzbl, 0,(%ecx,%edi), %edi) C inv 8 bits
+',`
+ movzbl binvert_limb_table(%ecx), %edi C inv 8 bits
+')
+ leal (%edi,%edi), %ecx C 2*inv
+
+ imull %edi, %edi C inv*inv
+
+ movl PARAM_SRC, %eax
+ movl PARAM_SIZE, %ebp
+
+ imull %esi, %edi C inv*inv*d
+
+ pushl %ebx FRAME_pushl()
+ leal (%eax,%ebp,4), %ebx C src end
+
+ subl %edi, %ecx C inv = 2*inv - inv*inv*d
+ leal (%ecx,%ecx), %edi C 2*inv
+
+ imull %ecx, %ecx C inv*inv
+
+ movl (%eax), %eax C src low limb
+ negl %ebp C -size
+
+ imull %esi, %ecx C inv*inv*d
+
+ subl %ecx, %edi C inv = 2*inv - inv*inv*d
+
+ ASSERT(e,` C d*inv == 1 mod 2^GMP_LIMB_BITS
+ pushl %eax
+ movl %esi, %eax
+ imull %edi, %eax
+ cmpl $1, %eax
+ popl %eax')
+
+ jmp L(entry)
+
+
+C Rotating the mul to the top of the loop saves 1 cycle, presumably by
+C hiding the loop control under the imul latency.
+C
+C The run time is 10 cycles, but decoding is only 9 (and the dependent chain
+C only 8). It's not clear how to get down to 9 cycles.
+C
+C The xor and rcl to handle the carry bit could be an sbb instead, with the
+C the carry bit add becoming a sub, but that doesn't save anything.
+
+L(top):
+ C eax (low product)
+ C ebx src end
+ C ecx carry bit, 0 or 1
+ C edx (high product, being carry limb)
+ C esi divisor
+ C edi inverse
+ C ebp counter, limbs, negative
+
+ mull %esi
+
+ movl (%ebx,%ebp,4), %eax
+ addl %ecx, %edx C apply carry bit to carry limb
+
+L(entry):
+ xorl %ecx, %ecx
+ subl %edx, %eax C apply carry limb
+
+ rcll %ecx
+
+ imull %edi, %eax
+
+ incl %ebp
+ jnz L(top)
+
+
+
+ popl %ebx
+ popl %ebp
+
+ mull %esi
+
+ popl %edi
+ popl %esi
+
+ leal (%ecx,%edx), %eax
+
+ ret
+
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k6/mul_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k6/mul_1.asm
new file mode 100644
index 00000000000..3ef7ec24fe7
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k6/mul_1.asm
@@ -0,0 +1,292 @@
+dnl AMD K6 mpn_mul_1 -- mpn by limb multiply.
+
+dnl Copyright 1999, 2000, 2002, 2005 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 P5
+C P6 model 0-8,10-12 5.5
+C P6 model 9 (Banias)
+C P6 model 13 (Dothan) 4.87
+C P4 model 0 (Willamette)
+C P4 model 1 (?)
+C P4 model 2 (Northwood)
+C P4 model 3 (Prescott)
+C P4 model 4 (Nocona)
+C AMD K6 6.25
+C AMD K7
+C AMD K8
+
+
+C mp_limb_t mpn_mul_1 (mp_ptr dst, mp_srcptr src, mp_size_t size,
+C mp_limb_t multiplier);
+C mp_limb_t mpn_mul_1c (mp_ptr dst, mp_srcptr src, mp_size_t size,
+C mp_limb_t multiplier, mp_limb_t carry);
+C
+C Multiply src,size by mult and store the result in dst,size.
+C Return the carry limb from the top of the result.
+C
+C mpn_mul_1c() accepts an initial carry for the calculation, it's added into
+C the low limb of the result.
+
+defframe(PARAM_CARRY, 20)
+defframe(PARAM_MULTIPLIER,16)
+defframe(PARAM_SIZE, 12)
+defframe(PARAM_SRC, 8)
+defframe(PARAM_DST, 4)
+
+dnl minimum 5 because the unrolled code can't handle less
+deflit(UNROLL_THRESHOLD, 5)
+
+ TEXT
+ ALIGN(32)
+
+PROLOGUE(mpn_mul_1c)
+ pushl %esi
+deflit(`FRAME',4)
+ movl PARAM_CARRY, %esi
+ jmp L(start_nc)
+EPILOGUE()
+
+
+PROLOGUE(mpn_mul_1)
+ push %esi
+deflit(`FRAME',4)
+ xorl %esi, %esi C initial carry
+
+L(start_nc):
+ mov PARAM_SIZE, %ecx
+ push %ebx
+FRAME_pushl()
+
+ movl PARAM_SRC, %ebx
+ push %edi
+FRAME_pushl()
+
+ movl PARAM_DST, %edi
+ pushl %ebp
+FRAME_pushl()
+
+ cmpl $UNROLL_THRESHOLD, %ecx
+ movl PARAM_MULTIPLIER, %ebp
+
+ jae L(unroll)
+
+
+ C code offset 0x22 here, close enough to aligned
+L(simple):
+ C eax scratch
+ C ebx src
+ C ecx counter
+ C edx scratch
+ C esi carry
+ C edi dst
+ C ebp multiplier
+ C
+ C this loop 8 cycles/limb
+
+ movl (%ebx), %eax
+ addl $4, %ebx
+
+ mull %ebp
+
+ addl %esi, %eax
+ movl $0, %esi
+
+ adcl %edx, %esi
+
+ movl %eax, (%edi)
+ addl $4, %edi
+
+ loop L(simple)
+
+
+ popl %ebp
+
+ popl %edi
+ popl %ebx
+
+ movl %esi, %eax
+ popl %esi
+
+ ret
+
+
+C -----------------------------------------------------------------------------
+C The code for each limb is 6 cycles, with instruction decoding being the
+C limiting factor. At 4 limbs/loop and 1 cycle/loop of overhead it's 6.25
+C cycles/limb in total.
+C
+C The secret ingredient to get 6.25 is to start the loop with the mul and
+C have the load/store pair at the end. Rotating the load/store to the top
+C is an 0.5 c/l slowdown. (Some address generation effect probably.)
+C
+C The whole unrolled loop fits nicely in exactly 80 bytes.
+
+
+ ALIGN(16) C already aligned to 16 here actually
+L(unroll):
+ movl (%ebx), %eax
+ leal -16(%ebx,%ecx,4), %ebx
+
+ leal -16(%edi,%ecx,4), %edi
+ subl $4, %ecx
+
+ negl %ecx
+
+
+ ALIGN(16) C one byte nop for this alignment
+L(top):
+ C eax scratch
+ C ebx &src[size-4]
+ C ecx counter
+ C edx scratch
+ C esi carry
+ C edi &dst[size-4]
+ C ebp multiplier
+
+ mull %ebp
+
+ addl %esi, %eax
+ movl $0, %esi
+
+ adcl %edx, %esi
+
+ movl %eax, (%edi,%ecx,4)
+ movl 4(%ebx,%ecx,4), %eax
+
+
+ mull %ebp
+
+ addl %esi, %eax
+ movl $0, %esi
+
+ adcl %edx, %esi
+
+ movl %eax, 4(%edi,%ecx,4)
+ movl 8(%ebx,%ecx,4), %eax
+
+
+ mull %ebp
+
+ addl %esi, %eax
+ movl $0, %esi
+
+ adcl %edx, %esi
+
+ movl %eax, 8(%edi,%ecx,4)
+ movl 12(%ebx,%ecx,4), %eax
+
+
+ mull %ebp
+
+ addl %esi, %eax
+ movl $0, %esi
+
+ adcl %edx, %esi
+
+ movl %eax, 12(%edi,%ecx,4)
+ movl 16(%ebx,%ecx,4), %eax
+
+
+ addl $4, %ecx
+ js L(top)
+
+
+
+ C eax next src limb
+ C ebx &src[size-4]
+ C ecx 0 to 3 representing respectively 4 to 1 further limbs
+ C edx
+ C esi carry
+ C edi &dst[size-4]
+
+ testb $2, %cl
+ jnz L(finish_not_two)
+
+ mull %ebp
+
+ addl %esi, %eax
+ movl $0, %esi
+
+ adcl %edx, %esi
+
+ movl %eax, (%edi,%ecx,4)
+ movl 4(%ebx,%ecx,4), %eax
+
+
+ mull %ebp
+
+ addl %esi, %eax
+ movl $0, %esi
+
+ adcl %edx, %esi
+
+ movl %eax, 4(%edi,%ecx,4)
+ movl 8(%ebx,%ecx,4), %eax
+
+ addl $2, %ecx
+L(finish_not_two):
+
+
+ testb $1, %cl
+ jnz L(finish_not_one)
+
+ mull %ebp
+
+ addl %esi, %eax
+ movl $0, %esi
+
+ adcl %edx, %esi
+
+ movl %eax, 8(%edi)
+ movl 12(%ebx), %eax
+L(finish_not_one):
+
+
+ mull %ebp
+
+ addl %esi, %eax
+ popl %ebp
+
+ adcl $0, %edx
+
+ movl %eax, 12(%edi)
+ popl %edi
+
+ popl %ebx
+ movl %edx, %eax
+
+ popl %esi
+
+ ret
+
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k6/mul_basecase.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k6/mul_basecase.asm
new file mode 100644
index 00000000000..7030001c3f2
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k6/mul_basecase.asm
@@ -0,0 +1,612 @@
+dnl AMD K6 mpn_mul_basecase -- multiply two mpn numbers.
+
+dnl Copyright 1999-2003 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 K6: approx 9.0 cycles per cross product on 30x30 limbs (with 16 limbs/loop
+C unrolling).
+
+
+
+dnl K6: UNROLL_COUNT cycles/product (approx)
+dnl 8 9.75
+dnl 16 9.3
+dnl 32 9.3
+dnl Maximum possible with the current code is 32.
+dnl
+dnl With 16 the inner unrolled loop fits exactly in a 256 byte block, which
+dnl might explain it's good performance.
+
+deflit(UNROLL_COUNT, 16)
+
+
+C void mpn_mul_basecase (mp_ptr wp,
+C mp_srcptr xp, mp_size_t xsize,
+C mp_srcptr yp, mp_size_t ysize);
+C
+C Calculate xp,xsize multiplied by yp,ysize, storing the result in
+C wp,xsize+ysize.
+C
+C This routine is essentially the same as mpn/generic/mul_basecase.c, but
+C it's faster because it does most of the mpn_addmul_1() entry code only
+C once. The saving is about 10-20% on typical sizes coming from the
+C Karatsuba multiply code.
+C
+C Enhancements:
+C
+C The mul_1 loop is about 8.5 c/l, which is slower than mpn_mul_1 at 6.25
+C c/l. Could call mpn_mul_1 when ysize is big enough to make it worthwhile.
+C
+C The main unrolled addmul loop could be shared by mpn_addmul_1, using some
+C extra stack setups and maybe 2 or 3 wasted cycles at the end. Code saving
+C would be 256 bytes.
+
+ifdef(`PIC',`
+deflit(UNROLL_THRESHOLD, 8)
+',`
+deflit(UNROLL_THRESHOLD, 8)
+')
+
+defframe(PARAM_YSIZE,20)
+defframe(PARAM_YP, 16)
+defframe(PARAM_XSIZE,12)
+defframe(PARAM_XP, 8)
+defframe(PARAM_WP, 4)
+
+ TEXT
+ ALIGN(32)
+PROLOGUE(mpn_mul_basecase)
+deflit(`FRAME',0)
+
+ movl PARAM_XSIZE, %ecx
+ movl PARAM_YP, %eax
+
+ movl PARAM_XP, %edx
+ movl (%eax), %eax C yp low limb
+
+ cmpl $2, %ecx
+ ja L(xsize_more_than_two_limbs)
+ je L(two_by_something)
+
+
+ C one limb by one limb
+
+ movl (%edx), %edx C xp low limb
+ movl PARAM_WP, %ecx
+
+ mull %edx
+
+ movl %eax, (%ecx)
+ movl %edx, 4(%ecx)
+ ret
+
+
+C -----------------------------------------------------------------------------
+L(two_by_something):
+ decl PARAM_YSIZE
+ pushl %ebx
+deflit(`FRAME',4)
+
+ movl PARAM_WP, %ebx
+ pushl %esi
+deflit(`FRAME',8)
+
+ movl %eax, %ecx C yp low limb
+ movl (%edx), %eax C xp low limb
+
+ movl %edx, %esi C xp
+ jnz L(two_by_two)
+
+
+ C two limbs by one limb
+
+ mull %ecx
+
+ movl %eax, (%ebx)
+ movl 4(%esi), %eax
+
+ movl %edx, %esi C carry
+
+ mull %ecx
+
+ addl %eax, %esi
+ movl %esi, 4(%ebx)
+
+ adcl $0, %edx
+
+ movl %edx, 8(%ebx)
+ popl %esi
+
+ popl %ebx
+ ret
+
+
+
+C -----------------------------------------------------------------------------
+ ALIGN(16)
+L(two_by_two):
+ C eax xp low limb
+ C ebx wp
+ C ecx yp low limb
+ C edx
+ C esi xp
+ C edi
+ C ebp
+deflit(`FRAME',8)
+
+ mull %ecx C xp[0] * yp[0]
+
+ push %edi
+deflit(`FRAME',12)
+ movl %eax, (%ebx)
+
+ movl 4(%esi), %eax
+ movl %edx, %edi C carry, for wp[1]
+
+ mull %ecx C xp[1] * yp[0]
+
+ addl %eax, %edi
+ movl PARAM_YP, %ecx
+
+ adcl $0, %edx
+
+ movl %edi, 4(%ebx)
+ movl 4(%ecx), %ecx C yp[1]
+
+ movl 4(%esi), %eax C xp[1]
+ movl %edx, %edi C carry, for wp[2]
+
+ mull %ecx C xp[1] * yp[1]
+
+ addl %eax, %edi
+
+ adcl $0, %edx
+
+ movl (%esi), %eax C xp[0]
+ movl %edx, %esi C carry, for wp[3]
+
+ mull %ecx C xp[0] * yp[1]
+
+ addl %eax, 4(%ebx)
+ adcl %edx, %edi
+ adcl $0, %esi
+
+ movl %edi, 8(%ebx)
+ popl %edi
+
+ movl %esi, 12(%ebx)
+ popl %esi
+
+ popl %ebx
+ ret
+
+
+C -----------------------------------------------------------------------------
+ ALIGN(16)
+L(xsize_more_than_two_limbs):
+
+C The first limb of yp is processed with a simple mpn_mul_1 style loop
+C inline. Unrolling this doesn't seem worthwhile since it's only run once
+C (whereas the addmul below is run ysize-1 many times). A call to the
+C actual mpn_mul_1 will be slowed down by the call and parameter pushing and
+C popping, and doesn't seem likely to be worthwhile on the typical 10-20
+C limb operations the Karatsuba code calls here with.
+
+ C eax yp[0]
+ C ebx
+ C ecx xsize
+ C edx xp
+ C esi
+ C edi
+ C ebp
+deflit(`FRAME',0)
+
+ pushl %edi defframe_pushl(SAVE_EDI)
+ pushl %ebp defframe_pushl(SAVE_EBP)
+
+ movl PARAM_WP, %edi
+ pushl %esi defframe_pushl(SAVE_ESI)
+
+ movl %eax, %ebp
+ pushl %ebx defframe_pushl(SAVE_EBX)
+
+ leal (%edx,%ecx,4), %ebx C xp end
+ xorl %esi, %esi
+
+ leal (%edi,%ecx,4), %edi C wp end of mul1
+ negl %ecx
+
+
+L(mul1):
+ C eax scratch
+ C ebx xp end
+ C ecx counter, negative
+ C edx scratch
+ C esi carry
+ C edi wp end of mul1
+ C ebp multiplier
+
+ movl (%ebx,%ecx,4), %eax
+
+ mull %ebp
+
+ addl %esi, %eax
+ movl $0, %esi
+
+ adcl %edx, %esi
+
+ movl %eax, (%edi,%ecx,4)
+ incl %ecx
+
+ jnz L(mul1)
+
+
+ movl PARAM_YSIZE, %edx
+ movl %esi, (%edi) C final carry
+
+ movl PARAM_XSIZE, %ecx
+ decl %edx
+
+ jnz L(ysize_more_than_one_limb)
+
+ popl %ebx
+ popl %esi
+ popl %ebp
+ popl %edi
+ ret
+
+
+L(ysize_more_than_one_limb):
+ cmpl $UNROLL_THRESHOLD, %ecx
+ movl PARAM_YP, %eax
+
+ jae L(unroll)
+
+
+C -----------------------------------------------------------------------------
+C Simple addmul loop.
+C
+C Using ebx and edi pointing at the ends of their respective locations saves
+C a couple of instructions in the outer loop. The inner loop is still 11
+C cycles, the same as the simple loop in aorsmul_1.asm.
+
+ C eax yp
+ C ebx xp end
+ C ecx xsize
+ C edx ysize-1
+ C esi
+ C edi wp end of mul1
+ C ebp
+
+ movl 4(%eax), %ebp C multiplier
+ negl %ecx
+
+ movl %ecx, PARAM_XSIZE C -xsize
+ xorl %esi, %esi C initial carry
+
+ leal 4(%eax,%edx,4), %eax C yp end
+ negl %edx
+
+ movl %eax, PARAM_YP
+ movl %edx, PARAM_YSIZE
+
+ jmp L(simple_outer_entry)
+
+
+ C aligning here saves a couple of cycles
+ ALIGN(16)
+L(simple_outer_top):
+ C edx ysize counter, negative
+
+ movl PARAM_YP, %eax C yp end
+ xorl %esi, %esi C carry
+
+ movl PARAM_XSIZE, %ecx C -xsize
+ movl %edx, PARAM_YSIZE
+
+ movl (%eax,%edx,4), %ebp C yp limb multiplier
+L(simple_outer_entry):
+ addl $4, %edi
+
+
+L(simple_inner):
+ C eax scratch
+ C ebx xp end
+ C ecx counter, negative
+ C edx scratch
+ C esi carry
+ C edi wp end of this addmul
+ C ebp multiplier
+
+ movl (%ebx,%ecx,4), %eax
+
+ mull %ebp
+
+ addl %esi, %eax
+ movl $0, %esi
+
+ adcl $0, %edx
+ addl %eax, (%edi,%ecx,4)
+ adcl %edx, %esi
+
+ incl %ecx
+ jnz L(simple_inner)
+
+
+ movl PARAM_YSIZE, %edx
+ movl %esi, (%edi)
+
+ incl %edx
+ jnz L(simple_outer_top)
+
+
+ popl %ebx
+ popl %esi
+ popl %ebp
+ popl %edi
+ ret
+
+
+C -----------------------------------------------------------------------------
+C Unrolled loop.
+C
+C The unrolled inner loop is the same as in aorsmul_1.asm, see that code for
+C some comments.
+C
+C VAR_COUNTER is for the inner loop, running from VAR_COUNTER_INIT down to
+C 0, inclusive.
+C
+C VAR_JMP is the computed jump into the unrolled loop.
+C
+C PARAM_XP and PARAM_WP get offset appropriately for where the unrolled loop
+C is entered.
+C
+C VAR_XP_LOW is the least significant limb of xp, which is needed at the
+C start of the unrolled loop. This can't just be fetched through the xp
+C pointer because of the offset applied to it.
+C
+C PARAM_YSIZE is the outer loop counter, going from -(ysize-1) up to -1,
+C inclusive.
+C
+C PARAM_YP is offset appropriately so that the PARAM_YSIZE counter can be
+C added to give the location of the next limb of yp, which is the multiplier
+C in the unrolled loop.
+C
+C PARAM_WP is similarly offset so that the PARAM_YSIZE counter can be added
+C to give the starting point in the destination for each unrolled loop (this
+C point is one limb upwards for each limb of yp processed).
+C
+C Having PARAM_YSIZE count negative to zero means it's not necessary to
+C store new values of PARAM_YP and PARAM_WP on each loop. Those values on
+C the stack remain constant and on each loop an leal adjusts them with the
+C PARAM_YSIZE counter value.
+
+
+defframe(VAR_COUNTER, -20)
+defframe(VAR_COUNTER_INIT, -24)
+defframe(VAR_JMP, -28)
+defframe(VAR_XP_LOW, -32)
+deflit(VAR_STACK_SPACE, 16)
+
+dnl For some strange reason using (%esp) instead of 0(%esp) is a touch
+dnl slower in this code, hence the defframe empty-if-zero feature is
+dnl disabled.
+dnl
+dnl If VAR_COUNTER is at (%esp), the effect is worse. In this case the
+dnl unrolled loop is 255 instead of 256 bytes, but quite how this affects
+dnl anything isn't clear.
+dnl
+define(`defframe_empty_if_zero_disabled',1)
+
+L(unroll):
+ C eax yp (not used)
+ C ebx xp end (not used)
+ C ecx xsize
+ C edx ysize-1
+ C esi
+ C edi wp end of mul1 (not used)
+ C ebp
+deflit(`FRAME', 16)
+
+ leal -2(%ecx), %ebp C one limb processed at start,
+ decl %ecx C and ebp is one less
+
+ shrl $UNROLL_LOG2, %ebp
+ negl %ecx
+
+ subl $VAR_STACK_SPACE, %esp
+deflit(`FRAME', 16+VAR_STACK_SPACE)
+ andl $UNROLL_MASK, %ecx
+
+ movl %ecx, %esi
+ shll $4, %ecx
+
+ movl %ebp, VAR_COUNTER_INIT
+ negl %esi
+
+ C 15 code bytes per limb
+ifdef(`PIC',`
+ call L(pic_calc)
+L(unroll_here):
+',`
+ leal L(unroll_entry) (%ecx,%esi,1), %ecx
+')
+
+ movl PARAM_XP, %ebx
+ movl %ebp, VAR_COUNTER
+
+ movl PARAM_WP, %edi
+ movl %ecx, VAR_JMP
+
+ movl (%ebx), %eax
+ leal 4(%edi,%esi,4), %edi C wp adjust for unrolling and mul1
+
+ leal (%ebx,%esi,4), %ebx C xp adjust for unrolling
+
+ movl %eax, VAR_XP_LOW
+
+ movl %ebx, PARAM_XP
+ movl PARAM_YP, %ebx
+
+ leal (%edi,%edx,4), %ecx C wp adjust for ysize indexing
+ movl 4(%ebx), %ebp C multiplier (yp second limb)
+
+ leal 4(%ebx,%edx,4), %ebx C yp adjust for ysize indexing
+
+ movl %ecx, PARAM_WP
+
+ leal 1(%esi), %ecx C adjust parity for decl %ecx above
+
+ movl %ebx, PARAM_YP
+ negl %edx
+
+ movl %edx, PARAM_YSIZE
+ jmp L(unroll_outer_entry)
+
+
+ifdef(`PIC',`
+L(pic_calc):
+ C See mpn/x86/README about old gas bugs
+ leal (%ecx,%esi,1), %ecx
+ addl $L(unroll_entry)-L(unroll_here), %ecx
+ addl (%esp), %ecx
+ ret_internal
+')
+
+
+C -----------------------------------------------------------------------------
+ C Aligning here saves a couple of cycles per loop. Using 32 doesn't
+ C cost any extra space, since the inner unrolled loop below is
+ C aligned to 32.
+ ALIGN(32)
+L(unroll_outer_top):
+ C edx ysize
+
+ movl PARAM_YP, %eax
+ movl %edx, PARAM_YSIZE C incremented ysize counter
+
+ movl PARAM_WP, %edi
+
+ movl VAR_COUNTER_INIT, %ebx
+ movl (%eax,%edx,4), %ebp C next multiplier
+
+ movl PARAM_XSIZE, %ecx
+ leal (%edi,%edx,4), %edi C adjust wp for where we are in yp
+
+ movl VAR_XP_LOW, %eax
+ movl %ebx, VAR_COUNTER
+
+L(unroll_outer_entry):
+ mull %ebp
+
+ C using testb is a tiny bit faster than testl
+ testb $1, %cl
+
+ movl %eax, %ecx C low carry
+ movl VAR_JMP, %eax
+
+ movl %edx, %esi C high carry
+ movl PARAM_XP, %ebx
+
+ jnz L(unroll_noswap)
+ movl %ecx, %esi C high,low carry other way around
+
+ movl %edx, %ecx
+L(unroll_noswap):
+
+ jmp *%eax
+
+
+
+C -----------------------------------------------------------------------------
+ ALIGN(32)
+L(unroll_top):
+ C eax scratch
+ C ebx xp
+ C ecx carry low
+ C edx scratch
+ C esi carry high
+ C edi wp
+ C ebp multiplier
+ C VAR_COUNTER loop counter
+ C
+ C 15 code bytes each limb
+
+ leal UNROLL_BYTES(%edi), %edi
+
+L(unroll_entry):
+deflit(CHUNK_COUNT,2)
+forloop(`i', 0, UNROLL_COUNT/CHUNK_COUNT-1, `
+ deflit(`disp0', eval(i*CHUNK_COUNT*4))
+ deflit(`disp1', eval(disp0 + 4))
+ deflit(`disp2', eval(disp1 + 4))
+
+ movl disp1(%ebx), %eax
+ mull %ebp
+Zdisp( addl, %ecx, disp0,(%edi))
+ adcl %eax, %esi
+ movl %edx, %ecx
+ jadcl0( %ecx)
+
+ movl disp2(%ebx), %eax
+ mull %ebp
+ addl %esi, disp1(%edi)
+ adcl %eax, %ecx
+ movl %edx, %esi
+ jadcl0( %esi)
+')
+
+ decl VAR_COUNTER
+ leal UNROLL_BYTES(%ebx), %ebx
+
+ jns L(unroll_top)
+
+
+ movl PARAM_YSIZE, %edx
+ addl %ecx, UNROLL_BYTES(%edi)
+
+ adcl $0, %esi
+
+ incl %edx
+ movl %esi, UNROLL_BYTES+4(%edi)
+
+ jnz L(unroll_outer_top)
+
+
+ movl SAVE_ESI, %esi
+ movl SAVE_EBP, %ebp
+ movl SAVE_EDI, %edi
+ movl SAVE_EBX, %ebx
+
+ addl $FRAME, %esp
+ ret
+
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k6/pre_mod_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k6/pre_mod_1.asm
new file mode 100644
index 00000000000..34db20d3866
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k6/pre_mod_1.asm
@@ -0,0 +1,146 @@
+dnl AMD K6 mpn_preinv_mod_1 -- mpn by 1 remainder, with pre-inverted divisor.
+
+dnl Copyright 2000, 2002, 2003 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 K6: 18.0 cycles/limb
+
+
+C mp_limb_t mpn_preinv_mod_1 (mp_srcptr src, mp_size_t size, mp_limb_t divisor,
+C mp_limb_t inverse);
+C
+C This code is only 2 c/l faster than a simple divl, but that's 10% so it's
+C considered worthwhile (just).
+
+defframe(PARAM_INVERSE,16)
+defframe(PARAM_DIVISOR,12)
+defframe(PARAM_SIZE, 8)
+defframe(PARAM_SRC, 4)
+
+ TEXT
+ ALIGN(32)
+PROLOGUE(mpn_preinv_mod_1)
+deflit(`FRAME',0)
+
+ ASSERT(ae,`cmpl $1, PARAM_SIZE')
+ ASSERT(nz,`testl $0x80000000, PARAM_DIVISOR')
+
+ movl PARAM_SIZE, %ecx
+ pushl %ebp FRAME_pushl()
+
+ movl PARAM_SRC, %ebp
+ pushl %edi FRAME_pushl()
+
+ movl PARAM_DIVISOR, %eax
+ pushl %esi FRAME_pushl()
+
+ movl -4(%ebp,%ecx,4), %esi C src high limb
+ pushl %ebx FRAME_pushl()
+
+ movl %edx, %edi C first n2 to cancel
+ subl %eax, %esi C first n1 = high-divisor
+
+ decl %ecx
+ jz L(done_sbbl)
+
+L(top):
+ C eax scratch
+ C ebx n10, nadj, q1
+ C ecx counter, size to 1
+ C edx scratch
+ C esi n2
+ C edi old high, for underflow test
+ C ebp src
+
+ sbbl %edx, %edi C high n-(q1+1)*d, 0 or -1
+
+L(entry):
+ andl PARAM_DIVISOR, %edi
+L(q1_ff_top):
+ movl -4(%ebp,%ecx,4), %ebx
+
+ addl %esi, %edi C possible addback
+ movl %ebx, %esi C n10
+
+ sarl $31, %ebx C -n1 = 0 or -1
+ movl %edi, %eax C n2
+
+ movl PARAM_INVERSE, %edx
+ subl %ebx, %eax C n2+n1
+
+ mull %edx C m*(n2+n1)
+
+ andl PARAM_DIVISOR, %ebx C -n1 & d
+ addl %esi, %ebx C nadj = n10 + (-n1&d), ignoring overflow
+
+ addl %ebx, %eax C low m*(n2+n1) + nadj, giving carry flag
+ leal 1(%edi), %ebx C n2+1
+
+ adcl %ebx, %edx C 1+high(n2<<32+m*(n2+n1)+nadj) = q1+1
+
+ movl PARAM_DIVISOR, %eax C d
+ jz L(q1_ff)
+
+ mull %edx C (q1+1)*d
+
+ subl %eax, %esi C low n-(q1+1)*d
+ loop L(top)
+
+
+
+L(done_sbbl):
+ sbbl %edx, %edi C high n-(q1+1)*d, 0 or -1
+
+ andl PARAM_DIVISOR, %edi
+L(done_esi_edi):
+ popl %ebx
+
+ leal (%esi,%edi), %eax
+ popl %esi
+
+ popl %edi
+ popl %ebp
+
+ ret
+
+
+C Special case for q1=0xFFFFFFFF, giving q=0xFFFFFFFF meaning the low dword
+C of q*d is simply -d and the remainder n-q*d = n10+d. This is rarely
+C reached.
+
+L(q1_ff):
+ movl PARAM_DIVISOR, %edi
+ loop L(q1_ff_top)
+
+ jmp L(done_esi_edi)
+
+
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k6/sqr_basecase.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k6/sqr_basecase.asm
new file mode 100644
index 00000000000..b7ecb5cc8a1
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k6/sqr_basecase.asm
@@ -0,0 +1,680 @@
+dnl AMD K6 mpn_sqr_basecase -- square an mpn number.
+
+dnl Copyright 1999-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 K6: approx 4.7 cycles per cross product, or 9.2 cycles per triangular
+C product (measured on the speed difference between 17 and 33 limbs,
+C which is roughly the Karatsuba recursing range).
+
+
+dnl SQR_TOOM2_THRESHOLD_MAX is the maximum SQR_TOOM2_THRESHOLD this
+dnl code supports. This value is used only by the tune program to know
+dnl what it can go up to. (An attempt to compile with a bigger value will
+dnl trigger some m4_assert()s in the code, making the build fail.)
+dnl
+dnl The value is determined by requiring the displacements in the unrolled
+dnl addmul to fit in single bytes. This means a maximum UNROLL_COUNT of
+dnl 63, giving a maximum SQR_TOOM2_THRESHOLD of 66.
+
+deflit(SQR_TOOM2_THRESHOLD_MAX, 66)
+
+
+dnl Allow a value from the tune program to override config.m4.
+
+ifdef(`SQR_TOOM2_THRESHOLD_OVERRIDE',
+`define(`SQR_TOOM2_THRESHOLD',SQR_TOOM2_THRESHOLD_OVERRIDE)')
+
+
+dnl UNROLL_COUNT is the number of code chunks in the unrolled addmul. The
+dnl number required is determined by SQR_TOOM2_THRESHOLD, since
+dnl mpn_sqr_basecase only needs to handle sizes < SQR_TOOM2_THRESHOLD.
+dnl
+dnl The first addmul is the biggest, and this takes the second least
+dnl significant limb and multiplies it by the third least significant and
+dnl up. Hence for a maximum operand size of SQR_TOOM2_THRESHOLD-1
+dnl limbs, UNROLL_COUNT needs to be SQR_TOOM2_THRESHOLD-3.
+
+m4_config_gmp_mparam(`SQR_TOOM2_THRESHOLD')
+deflit(UNROLL_COUNT, eval(SQR_TOOM2_THRESHOLD-3))
+
+
+C void mpn_sqr_basecase (mp_ptr dst, mp_srcptr src, mp_size_t size);
+C
+C The algorithm is essentially the same as mpn/generic/sqr_basecase.c, but a
+C lot of function call overheads are avoided, especially when the given size
+C is small.
+C
+C The code size might look a bit excessive, but not all of it is executed
+C and so won't fill up the code cache. The 1x1, 2x2 and 3x3 special cases
+C clearly apply only to those sizes; mid sizes like 10x10 only need part of
+C the unrolled addmul; and big sizes like 35x35 that do need all of it will
+C at least be getting value for money, because 35x35 spends something like
+C 5780 cycles here.
+C
+C Different values of UNROLL_COUNT give slightly different speeds, between
+C 9.0 and 9.2 c/tri-prod measured on the difference between 17 and 33 limbs.
+C This isn't a big difference, but it's presumably some alignment effect
+C which if understood could give a simple speedup.
+
+defframe(PARAM_SIZE,12)
+defframe(PARAM_SRC, 8)
+defframe(PARAM_DST, 4)
+
+ TEXT
+ ALIGN(32)
+PROLOGUE(mpn_sqr_basecase)
+deflit(`FRAME',0)
+
+ movl PARAM_SIZE, %ecx
+ movl PARAM_SRC, %eax
+
+ cmpl $2, %ecx
+ je L(two_limbs)
+
+ movl PARAM_DST, %edx
+ ja L(three_or_more)
+
+
+C -----------------------------------------------------------------------------
+C one limb only
+ C eax src
+ C ebx
+ C ecx size
+ C edx dst
+
+ movl (%eax), %eax
+ movl %edx, %ecx
+
+ mull %eax
+
+ movl %eax, (%ecx)
+ movl %edx, 4(%ecx)
+ ret
+
+
+C -----------------------------------------------------------------------------
+ ALIGN(16)
+L(two_limbs):
+ C eax src
+ C ebx
+ C ecx size
+ C edx dst
+
+ pushl %ebx
+ movl %eax, %ebx C src
+deflit(`FRAME',4)
+
+ movl (%ebx), %eax
+ movl PARAM_DST, %ecx
+
+ mull %eax C src[0]^2
+
+ movl %eax, (%ecx)
+ movl 4(%ebx), %eax
+
+ movl %edx, 4(%ecx)
+
+ mull %eax C src[1]^2
+
+ movl %eax, 8(%ecx)
+ movl (%ebx), %eax
+
+ movl %edx, 12(%ecx)
+ movl 4(%ebx), %edx
+
+ mull %edx C src[0]*src[1]
+
+ addl %eax, 4(%ecx)
+
+ adcl %edx, 8(%ecx)
+ adcl $0, 12(%ecx)
+
+ popl %ebx
+ addl %eax, 4(%ecx)
+
+ adcl %edx, 8(%ecx)
+ adcl $0, 12(%ecx)
+
+ ret
+
+
+C -----------------------------------------------------------------------------
+L(three_or_more):
+deflit(`FRAME',0)
+ cmpl $4, %ecx
+ jae L(four_or_more)
+
+
+C -----------------------------------------------------------------------------
+C three limbs
+ C eax src
+ C ecx size
+ C edx dst
+
+ pushl %ebx
+ movl %eax, %ebx C src
+
+ movl (%ebx), %eax
+ movl %edx, %ecx C dst
+
+ mull %eax C src[0] ^ 2
+
+ movl %eax, (%ecx)
+ movl 4(%ebx), %eax
+
+ movl %edx, 4(%ecx)
+ pushl %esi
+
+ mull %eax C src[1] ^ 2
+
+ movl %eax, 8(%ecx)
+ movl 8(%ebx), %eax
+
+ movl %edx, 12(%ecx)
+ pushl %edi
+
+ mull %eax C src[2] ^ 2
+
+ movl %eax, 16(%ecx)
+ movl (%ebx), %eax
+
+ movl %edx, 20(%ecx)
+ movl 4(%ebx), %edx
+
+ mull %edx C src[0] * src[1]
+
+ movl %eax, %esi
+ movl (%ebx), %eax
+
+ movl %edx, %edi
+ movl 8(%ebx), %edx
+
+ pushl %ebp
+ xorl %ebp, %ebp
+
+ mull %edx C src[0] * src[2]
+
+ addl %eax, %edi
+ movl 4(%ebx), %eax
+
+ adcl %edx, %ebp
+
+ movl 8(%ebx), %edx
+
+ mull %edx C src[1] * src[2]
+
+ addl %eax, %ebp
+
+ adcl $0, %edx
+
+
+ C eax will be dst[5]
+ C ebx
+ C ecx dst
+ C edx dst[4]
+ C esi dst[1]
+ C edi dst[2]
+ C ebp dst[3]
+
+ xorl %eax, %eax
+ addl %esi, %esi
+ adcl %edi, %edi
+ adcl %ebp, %ebp
+ adcl %edx, %edx
+ adcl $0, %eax
+
+ addl %esi, 4(%ecx)
+ adcl %edi, 8(%ecx)
+ adcl %ebp, 12(%ecx)
+
+ popl %ebp
+ popl %edi
+
+ adcl %edx, 16(%ecx)
+
+ popl %esi
+ popl %ebx
+
+ adcl %eax, 20(%ecx)
+ ASSERT(nc)
+
+ ret
+
+
+C -----------------------------------------------------------------------------
+
+defframe(SAVE_EBX, -4)
+defframe(SAVE_ESI, -8)
+defframe(SAVE_EDI, -12)
+defframe(SAVE_EBP, -16)
+defframe(VAR_COUNTER,-20)
+defframe(VAR_JMP, -24)
+deflit(STACK_SPACE, 24)
+
+ ALIGN(16)
+L(four_or_more):
+
+ C eax src
+ C ebx
+ C ecx size
+ C edx dst
+ C esi
+ C edi
+ C ebp
+
+C First multiply src[0]*src[1..size-1] and store at dst[1..size].
+C
+C A test was done calling mpn_mul_1 here to get the benefit of its unrolled
+C loop, but this was only a tiny speedup; at 35 limbs it took 24 cycles off
+C a 5780 cycle operation, which is not surprising since the loop here is 8
+C c/l and mpn_mul_1 is 6.25 c/l.
+
+ subl $STACK_SPACE, %esp deflit(`FRAME',STACK_SPACE)
+
+ movl %edi, SAVE_EDI
+ leal 4(%edx), %edi
+
+ movl %ebx, SAVE_EBX
+ leal 4(%eax), %ebx
+
+ movl %esi, SAVE_ESI
+ xorl %esi, %esi
+
+ movl %ebp, SAVE_EBP
+
+ C eax
+ C ebx src+4
+ C ecx size
+ C edx
+ C esi
+ C edi dst+4
+ C ebp
+
+ movl (%eax), %ebp C multiplier
+ leal -1(%ecx), %ecx C size-1, and pad to a 16 byte boundary
+
+
+ ALIGN(16)
+L(mul_1):
+ C eax scratch
+ C ebx src ptr
+ C ecx counter
+ C edx scratch
+ C esi carry
+ C edi dst ptr
+ C ebp multiplier
+
+ movl (%ebx), %eax
+ addl $4, %ebx
+
+ mull %ebp
+
+ addl %esi, %eax
+ movl $0, %esi
+
+ adcl %edx, %esi
+
+ movl %eax, (%edi)
+ addl $4, %edi
+
+ loop L(mul_1)
+
+
+C Addmul src[n]*src[n+1..size-1] at dst[2*n-1...], for each n=1..size-2.
+C
+C The last two addmuls, which are the bottom right corner of the product
+C triangle, are left to the end. These are src[size-3]*src[size-2,size-1]
+C and src[size-2]*src[size-1]. If size is 4 then it's only these corner
+C cases that need to be done.
+C
+C The unrolled code is the same as mpn_addmul_1(), see that routine for some
+C comments.
+C
+C VAR_COUNTER is the outer loop, running from -(size-4) to -1, inclusive.
+C
+C VAR_JMP is the computed jump into the unrolled code, stepped by one code
+C chunk each outer loop.
+C
+C K6 doesn't do any branch prediction on indirect jumps, which is good
+C actually because it's a different target each time. The unrolled addmul
+C is about 3 cycles/limb faster than a simple loop, so the 6 cycle cost of
+C the indirect jump is quickly recovered.
+
+
+dnl This value is also implicitly encoded in a shift and add.
+dnl
+deflit(CODE_BYTES_PER_LIMB, 15)
+
+dnl With the unmodified &src[size] and &dst[size] pointers, the
+dnl displacements in the unrolled code fit in a byte for UNROLL_COUNT
+dnl values up to 31. Above that an offset must be added to them.
+dnl
+deflit(OFFSET,
+ifelse(eval(UNROLL_COUNT>31),1,
+eval((UNROLL_COUNT-31)*4),
+0))
+
+ C eax
+ C ebx &src[size]
+ C ecx
+ C edx
+ C esi carry
+ C edi &dst[size]
+ C ebp
+
+ movl PARAM_SIZE, %ecx
+ movl %esi, (%edi)
+
+ subl $4, %ecx
+ jz L(corner)
+
+ movl %ecx, %edx
+ifelse(OFFSET,0,,
+` subl $OFFSET, %ebx')
+
+ shll $4, %ecx
+ifelse(OFFSET,0,,
+` subl $OFFSET, %edi')
+
+ negl %ecx
+
+ifdef(`PIC',`
+ call L(pic_calc)
+L(here):
+',`
+ leal L(unroll_inner_end)-eval(2*CODE_BYTES_PER_LIMB)(%ecx,%edx), %ecx
+')
+ negl %edx
+
+
+ C The calculated jump mustn't be before the start of the available
+ C code. This is the limitation UNROLL_COUNT puts on the src operand
+ C size, but checked here using the jump address directly.
+ C
+ ASSERT(ae,`
+ movl_text_address( L(unroll_inner_start), %eax)
+ cmpl %eax, %ecx
+ ')
+
+
+C -----------------------------------------------------------------------------
+ ALIGN(16)
+L(unroll_outer_top):
+ C eax
+ C ebx &src[size], constant
+ C ecx VAR_JMP
+ C edx VAR_COUNTER, limbs, negative
+ C esi high limb to store
+ C edi dst ptr, high of last addmul
+ C ebp
+
+ movl -12+OFFSET(%ebx,%edx,4), %ebp C multiplier
+ movl %edx, VAR_COUNTER
+
+ movl -8+OFFSET(%ebx,%edx,4), %eax C first limb of multiplicand
+
+ mull %ebp
+
+ testb $1, %cl
+
+ movl %edx, %esi C high carry
+ movl %ecx, %edx C jump
+
+ movl %eax, %ecx C low carry
+ leal CODE_BYTES_PER_LIMB(%edx), %edx
+
+ movl %edx, VAR_JMP
+ leal 4(%edi), %edi
+
+ C A branch-free version of this using some xors was found to be a
+ C touch slower than just a conditional jump, despite the jump
+ C switching between taken and not taken on every loop.
+
+ifelse(eval(UNROLL_COUNT%2),0,
+ jz,jnz) L(unroll_noswap)
+ movl %esi, %eax C high,low carry other way around
+
+ movl %ecx, %esi
+ movl %eax, %ecx
+L(unroll_noswap):
+
+ jmp *%edx
+
+
+ C Must be on an even address here so the low bit of the jump address
+ C will indicate which way around ecx/esi should start.
+ C
+ C An attempt was made at padding here to get the end of the unrolled
+ C code to come out on a good alignment, to save padding before
+ C L(corner). This worked, but turned out to run slower than just an
+ C ALIGN(2). The reason for this is not clear, it might be related
+ C to the different speeds on different UNROLL_COUNTs noted above.
+
+ ALIGN(2)
+
+L(unroll_inner_start):
+ C eax scratch
+ C ebx src
+ C ecx carry low
+ C edx scratch
+ C esi carry high
+ C edi dst
+ C ebp multiplier
+ C
+ C 15 code bytes each limb
+ C ecx/esi swapped on each chunk
+
+forloop(`i', UNROLL_COUNT, 1, `
+ deflit(`disp_src', eval(-i*4 + OFFSET))
+ deflit(`disp_dst', eval(disp_src - 4))
+
+ m4_assert(`disp_src>=-128 && disp_src<128')
+ m4_assert(`disp_dst>=-128 && disp_dst<128')
+
+ifelse(eval(i%2),0,`
+Zdisp( movl, disp_src,(%ebx), %eax)
+ mull %ebp
+Zdisp( addl, %esi, disp_dst,(%edi))
+ adcl %eax, %ecx
+ movl %edx, %esi
+ jadcl0( %esi)
+',`
+ dnl this one comes out last
+Zdisp( movl, disp_src,(%ebx), %eax)
+ mull %ebp
+Zdisp( addl, %ecx, disp_dst,(%edi))
+ adcl %eax, %esi
+ movl %edx, %ecx
+ jadcl0( %ecx)
+')
+')
+L(unroll_inner_end):
+
+ addl %esi, -4+OFFSET(%edi)
+
+ movl VAR_COUNTER, %edx
+ jadcl0( %ecx)
+
+ movl %ecx, m4_empty_if_zero(OFFSET)(%edi)
+ movl VAR_JMP, %ecx
+
+ incl %edx
+ jnz L(unroll_outer_top)
+
+
+ifelse(OFFSET,0,,`
+ addl $OFFSET, %ebx
+ addl $OFFSET, %edi
+')
+
+
+C -----------------------------------------------------------------------------
+ ALIGN(16)
+L(corner):
+ C ebx &src[size]
+ C edi &dst[2*size-5]
+
+ movl -12(%ebx), %ebp
+
+ movl -8(%ebx), %eax
+ movl %eax, %ecx
+
+ mull %ebp
+
+ addl %eax, -4(%edi)
+ adcl $0, %edx
+
+ movl -4(%ebx), %eax
+ movl %edx, %esi
+ movl %eax, %ebx
+
+ mull %ebp
+
+ addl %esi, %eax
+ adcl $0, %edx
+
+ addl %eax, (%edi)
+ adcl $0, %edx
+
+ movl %edx, %esi
+ movl %ebx, %eax
+
+ mull %ecx
+
+ addl %esi, %eax
+ movl %eax, 4(%edi)
+
+ adcl $0, %edx
+
+ movl %edx, 8(%edi)
+
+
+C -----------------------------------------------------------------------------
+C Left shift of dst[1..2*size-2], the bit shifted out becomes dst[2*size-1].
+C The loop measures about 6 cycles/iteration, though it looks like it should
+C decode in 5.
+
+L(lshift_start):
+ movl PARAM_SIZE, %ecx
+
+ movl PARAM_DST, %edi
+ subl $1, %ecx C size-1 and clear carry
+
+ movl PARAM_SRC, %ebx
+ movl %ecx, %edx
+
+ xorl %eax, %eax C ready for adcl
+
+
+ ALIGN(16)
+L(lshift):
+ C eax
+ C ebx src (for later use)
+ C ecx counter, decrementing
+ C edx size-1 (for later use)
+ C esi
+ C edi dst, incrementing
+ C ebp
+
+ rcll 4(%edi)
+ rcll 8(%edi)
+ leal 8(%edi), %edi
+ loop L(lshift)
+
+
+ adcl %eax, %eax
+
+ movl %eax, 4(%edi) C dst most significant limb
+ movl (%ebx), %eax C src[0]
+
+ leal 4(%ebx,%edx,4), %ebx C &src[size]
+ subl %edx, %ecx C -(size-1)
+
+
+C -----------------------------------------------------------------------------
+C Now add in the squares on the diagonal, src[0]^2, src[1]^2, ...,
+C src[size-1]^2. dst[0] hasn't yet been set at all yet, and just gets the
+C low limb of src[0]^2.
+
+
+ mull %eax
+
+ movl %eax, (%edi,%ecx,8) C dst[0]
+
+
+ ALIGN(16)
+L(diag):
+ C eax scratch
+ C ebx &src[size]
+ C ecx counter, negative
+ C edx carry
+ C esi scratch
+ C edi dst[2*size-2]
+ C ebp
+
+ movl (%ebx,%ecx,4), %eax
+ movl %edx, %esi
+
+ mull %eax
+
+ addl %esi, 4(%edi,%ecx,8)
+ adcl %eax, 8(%edi,%ecx,8)
+ adcl $0, %edx
+
+ incl %ecx
+ jnz L(diag)
+
+
+ movl SAVE_EBX, %ebx
+ movl SAVE_ESI, %esi
+
+ addl %edx, 4(%edi) C dst most significant limb
+
+ movl SAVE_EDI, %edi
+ movl SAVE_EBP, %ebp
+ addl $FRAME, %esp
+ ret
+
+
+
+C -----------------------------------------------------------------------------
+ifdef(`PIC',`
+L(pic_calc):
+ C See mpn/x86/README about old gas bugs
+ addl (%esp), %ecx
+ addl $L(unroll_inner_end)-L(here)-eval(2*CODE_BYTES_PER_LIMB), %ecx
+ addl %edx, %ecx
+ ret_internal
+')
+
+
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k7/README b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k7/README
new file mode 100644
index 00000000000..5711b612c5c
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k7/README
@@ -0,0 +1,174 @@
+Copyright 2000, 2001 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/.
+
+
+
+
+ AMD K7 MPN SUBROUTINES
+
+
+This directory contains code optimized for the AMD Athlon CPU.
+
+The mmx subdirectory has routines using MMX instructions. All Athlons have
+MMX, the separate directory is just so that configure can omit it if the
+assembler doesn't support MMX.
+
+
+
+STATUS
+
+Times for the loops, with all code and data in L1 cache.
+
+ cycles/limb
+ mpn_add/sub_n 1.6
+
+ mpn_copyi 0.75 or 1.0 \ varying with data alignment
+ mpn_copyd 0.75 or 1.0 /
+
+ mpn_divrem_1 17.0 integer part, 15.0 fractional part
+ mpn_mod_1 17.0
+ mpn_divexact_by3 8.0
+
+ mpn_l/rshift 1.2
+
+ mpn_mul_1 3.4
+ mpn_addmul/submul_1 3.9
+
+ mpn_mul_basecase 4.42 cycles/crossproduct (approx)
+ mpn_sqr_basecase 2.3 cycles/crossproduct (approx)
+ or 4.55 cycles/triangleproduct (approx)
+
+Prefetching of sources hasn't yet been tried.
+
+
+
+NOTES
+
+cmov, MMX, 3DNow and some extensions to MMX and 3DNow are available.
+
+Write-allocate L1 data cache means prefetching of destinations is unnecessary.
+
+Floating point multiplications can be done in parallel with integer
+multiplications, but there doesn't seem to be any way to make use of this.
+
+Unsigned "mul"s can be issued every 3 cycles. This suggests 3 is a limit on
+the speed of the multiplication routines. The documentation shows mul
+executing in IEU0 (or maybe in IEU0 and IEU1 together), so it might be that,
+to get near 3 cycles code has to be arranged so that nothing else is issued
+to IEU0. A busy IEU0 could explain why some code takes 4 cycles and other
+apparently equivalent code takes 5.
+
+
+
+OPTIMIZATIONS
+
+Unrolled loops are used to reduce looping overhead. The unrolling is
+configurable up to 32 limbs/loop for most routines and up to 64 for some.
+The K7 has 64k L1 code cache so quite big unrolling is allowable.
+
+Computed jumps into the unrolling are used to handle sizes not a multiple of
+the unrolling. An attractive feature of this is that times increase
+smoothly with operand size, but it may be that some routines should just
+have simple loops to finish up, especially when PIC adds between 2 and 16
+cycles to get %eip.
+
+Position independent code is implemented using a call to get %eip for the
+computed jumps and a ret is always done, rather than an addl $4,%esp or a
+popl, so the CPU return address branch prediction stack stays synchronised
+with the actual stack in memory.
+
+Branch prediction, in absence of any history, will guess forward jumps are
+not taken and backward jumps are taken. Where possible it's arranged that
+the less likely or less important case is under a taken forward jump.
+
+
+
+CODING
+
+Instructions in general code have been shown grouped if they can execute
+together, which means up to three direct-path instructions which have no
+successive dependencies. K7 always decodes three and has out-of-order
+execution, but the groupings show what slots might be available and what
+dependency chains exist.
+
+When there's vector-path instructions an effort is made to get triplets of
+direct-path instructions in between them, even if there's dependencies,
+since this maximizes decoding throughput and might save a cycle or two if
+decoding is the limiting factor.
+
+
+
+INSTRUCTIONS
+
+adcl direct
+divl 39 cycles back-to-back
+lodsl,etc vector
+loop 1 cycle vector (decl/jnz opens up one decode slot)
+movd reg vector
+movd mem direct
+mull issue every 3 cycles, latency 4 cycles low word, 6 cycles high word
+popl vector (use movl for more than one pop)
+pushl direct, will pair with a load
+shrdl %cl vector, 3 cycles, seems to be 3 decode too
+xorl r,r false read dependency recognised
+
+
+
+REFERENCES
+
+"AMD Athlon Processor X86 Code Optimization Guide", AMD publication number
+22007, revision K, February 2002. Available on-line,
+
+http://www.amd.com/us-en/assets/content_type/white_papers_and_tech_docs/22007.pdf
+
+"3DNow Technology Manual", AMD publication number 21928G/0-March 2000.
+This describes the femms and prefetch instructions. Available on-line,
+
+http://www.amd.com/us-en/assets/content_type/white_papers_and_tech_docs/21928.pdf
+
+"AMD Extensions to the 3DNow and MMX Instruction Sets Manual", AMD
+publication number 22466, revision D, March 2000. This describes
+instructions added in the Athlon processor, such as pswapd and the extra
+prefetch forms. Available on-line,
+
+http://www.amd.com/us-en/assets/content_type/white_papers_and_tech_docs/22466.pdf
+
+"3DNow Instruction Porting Guide", AMD publication number 22621, revision B,
+August 1999. This has some notes on general Athlon optimizations as well as
+3DNow. Available on-line,
+
+http://www.amd.com/us-en/assets/content_type/white_papers_and_tech_docs/22621.pdf
+
+
+
+
+----------------
+Local variables:
+mode: text
+fill-column: 76
+End:
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k7/addlsh1_n.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k7/addlsh1_n.asm
new file mode 100644
index 00000000000..a957b6f78e6
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k7/addlsh1_n.asm
@@ -0,0 +1,196 @@
+dnl AMD K7 mpn_addlsh1_n -- rp[] = up[] + (vp[] << 1)
+
+dnl Copyright 2011 Free Software Foundation, Inc.
+
+dnl Contributed to the GNU project by Torbjorn Granlund and Marco Bodrato.
+
+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 This is an attempt at an addlsh1_n for x86-32, not relying on sse2 insns.
+C The innerloop is 2*3-way unrolled, which is best we can do with the available
+C registers. It seems tricky to use the same structure for rsblsh1_n, since we
+C cannot feed carry between operations there.
+
+C cycles/limb
+C P5
+C P6 model 0-8,10-12
+C P6 model 9 (Banias)
+C P6 model 13 (Dothan) 5.4 (worse than add_n + lshift)
+C P4 model 0 (Willamette)
+C P4 model 1 (?)
+C P4 model 2 (Northwood)
+C P4 model 3 (Prescott)
+C P4 model 4 (Nocona)
+C Intel Atom 6
+C AMD K6 ?
+C AMD K7 2.5
+C AMD K8
+
+C This is a basic addlsh1_n for k7, atom, and perhaps some other x86-32
+C processors. It uses 2*3-way unrolling, for good reasons. Unfortunately,
+C that means we need an initial magic multiply.
+C
+C It is not clear how to do sublsh1_n or rsblsh1_n using the same pattern. We
+C cannot do rsblsh1_n since we feed carry from the shift blocks to the
+C add/subtract blocks, which is right for addition but reversed for
+C subtraction. We could perhaps do sublsh1_n, with some extra move insns,
+C without losing any time, since we're not issue limited but carry recurrency
+C latency.
+C
+C Breaking carry recurrency might be a good idea. We would then need separate
+C registers for the shift carry and add/subtract carry, which in turn would
+C force is to 2*2-way unrolling.
+
+defframe(PARAM_SIZE, 16)
+defframe(PARAM_DBLD, 12)
+defframe(PARAM_SRC, 8)
+defframe(PARAM_DST, 4)
+
+dnl re-use parameter space
+define(VAR_COUNT,`PARAM_DST')
+define(VAR_TMP,`PARAM_DBLD')
+
+ASM_START()
+ TEXT
+ ALIGN(8)
+PROLOGUE(mpn_addlsh1_n)
+deflit(`FRAME',0)
+
+define(`rp', `%edi')
+define(`up', `%esi')
+define(`vp', `%ebp')
+
+ mov $0x2aaaaaab, %eax
+
+ push %ebx FRAME_pushl()
+ mov PARAM_SIZE, %ebx C size
+
+ push rp FRAME_pushl()
+ mov PARAM_DST, rp
+
+ mul %ebx
+
+ push up FRAME_pushl()
+ mov PARAM_SRC, up
+
+ not %edx C count = -(size\8)-1
+ mov %edx, VAR_COUNT
+
+ push vp FRAME_pushl()
+ mov PARAM_DBLD, vp
+
+ lea 3(%edx,%edx,2), %ecx C count*3+3 = -(size\6)*3
+ xor %edx, %edx
+ lea (%ebx,%ecx,2), %ebx C size + (count*3+3)*2 = size % 6
+ or %ebx, %ebx
+ jz L(exact)
+
+L(oop):
+ifdef(`CPU_P6',`
+ shr %edx ') C restore 2nd saved carry bit
+ mov (vp), %eax
+ adc %eax, %eax
+ rcr %edx C restore 1st saved carry bit
+ lea 4(vp), vp
+ adc (up), %eax
+ lea 4(up), up
+ adc %edx, %edx C save a carry bit in edx
+ifdef(`CPU_P6',`
+ adc %edx, %edx ') C save another carry bit in edx
+ dec %ebx
+ mov %eax, (rp)
+ lea 4(rp), rp
+ jnz L(oop)
+ mov vp, VAR_TMP
+L(exact):
+ incl VAR_COUNT
+ jz L(end)
+
+ ALIGN(16)
+L(top):
+ifdef(`CPU_P6',`
+ shr %edx ') C restore 2nd saved carry bit
+ mov (vp), %eax
+ adc %eax, %eax
+ mov 4(vp), %ebx
+ adc %ebx, %ebx
+ mov 8(vp), %ecx
+ adc %ecx, %ecx
+
+ rcr %edx C restore 1st saved carry bit
+
+ adc (up), %eax
+ mov %eax, (rp)
+ adc 4(up), %ebx
+ mov %ebx, 4(rp)
+ adc 8(up), %ecx
+ mov %ecx, 8(rp)
+
+ mov 12(vp), %eax
+ adc %eax, %eax
+ mov 16(vp), %ebx
+ adc %ebx, %ebx
+ mov 20(vp), %ecx
+ adc %ecx, %ecx
+
+ lea 24(vp), vp
+ adc %edx, %edx C save a carry bit in edx
+
+ adc 12(up), %eax
+ mov %eax, 12(rp)
+ adc 16(up), %ebx
+ mov %ebx, 16(rp)
+ adc 20(up), %ecx
+
+ lea 24(up), up
+
+ifdef(`CPU_P6',`
+ adc %edx, %edx ') C save another carry bit in edx
+ mov %ecx, 20(rp)
+ incl VAR_COUNT
+ lea 24(rp), rp
+ jne L(top)
+
+L(end):
+ pop vp FRAME_popl()
+ pop up FRAME_popl()
+
+ifdef(`CPU_P6',`
+ xor %eax, %eax
+ shr $1, %edx
+ adc %edx, %eax
+',`
+ adc $0, %edx
+ mov %edx, %eax
+')
+ pop rp FRAME_popl()
+ pop %ebx FRAME_popl()
+ ret
+EPILOGUE()
+ASM_END()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k7/aors_n.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k7/aors_n.asm
new file mode 100644
index 00000000000..1a08072029f
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k7/aors_n.asm
@@ -0,0 +1,258 @@
+dnl AMD K7 mpn_add_n/mpn_sub_n -- mpn add or subtract.
+
+dnl Copyright 1999-2003 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 K7: 1.64 cycles/limb (at 16 limbs/loop).
+
+
+
+dnl K7: UNROLL_COUNT cycles/limb
+dnl 8 1.9
+dnl 16 1.64
+dnl 32 1.7
+dnl 64 2.0
+dnl Maximum possible with the current code is 64.
+
+deflit(UNROLL_COUNT, 16)
+
+
+ifdef(`OPERATION_add_n', `
+ define(M4_inst, adcl)
+ define(M4_function_n, mpn_add_n)
+ define(M4_function_nc, mpn_add_nc)
+ define(M4_description, add)
+',`ifdef(`OPERATION_sub_n', `
+ define(M4_inst, sbbl)
+ define(M4_function_n, mpn_sub_n)
+ define(M4_function_nc, mpn_sub_nc)
+ define(M4_description, subtract)
+',`m4_error(`Need OPERATION_add_n or OPERATION_sub_n
+')')')
+
+MULFUNC_PROLOGUE(mpn_add_n mpn_add_nc mpn_sub_n mpn_sub_nc)
+
+
+C mp_limb_t M4_function_n (mp_ptr dst, mp_srcptr src1, mp_srcptr src2,
+C mp_size_t size);
+C mp_limb_t M4_function_nc (mp_ptr dst, mp_srcptr src1, mp_srcptr src2,
+C mp_size_t size, mp_limb_t carry);
+C
+C Calculate src1,size M4_description src2,size, and store the result in
+C dst,size. The return value is the carry bit from the top of the result (1
+C or 0).
+C
+C The _nc version accepts 1 or 0 for an initial carry into the low limb of
+C the calculation. Note values other than 1 or 0 here will lead to garbage
+C results.
+C
+C This code runs at 1.64 cycles/limb, which might be the best possible with
+C plain integer operations. Each limb is 2 loads and 1 store, any 2 of
+C which can be done each cycle, leading to 1.5 c/l.
+
+dnl Must have UNROLL_THRESHOLD >= 2, since the unrolled loop can't handle 1.
+ifdef(`PIC',`
+deflit(UNROLL_THRESHOLD, 8)
+',`
+deflit(UNROLL_THRESHOLD, 8)
+')
+
+defframe(PARAM_CARRY,20)
+defframe(PARAM_SIZE, 16)
+defframe(PARAM_SRC2, 12)
+defframe(PARAM_SRC1, 8)
+defframe(PARAM_DST, 4)
+
+defframe(SAVE_EBP, -4)
+defframe(SAVE_ESI, -8)
+defframe(SAVE_EBX, -12)
+defframe(SAVE_EDI, -16)
+deflit(STACK_SPACE, 16)
+
+ TEXT
+ ALIGN(32)
+deflit(`FRAME',0)
+
+PROLOGUE(M4_function_nc)
+ movl PARAM_CARRY, %eax
+ jmp L(start)
+EPILOGUE()
+
+PROLOGUE(M4_function_n)
+
+ xorl %eax, %eax C carry
+L(start):
+ movl PARAM_SIZE, %ecx
+ subl $STACK_SPACE, %esp
+deflit(`FRAME',STACK_SPACE)
+
+ movl %edi, SAVE_EDI
+ movl %ebx, SAVE_EBX
+ cmpl $UNROLL_THRESHOLD, %ecx
+
+ movl PARAM_SRC2, %edx
+ movl PARAM_SRC1, %ebx
+ jae L(unroll)
+
+ movl PARAM_DST, %edi
+ leal (%ebx,%ecx,4), %ebx
+ leal (%edx,%ecx,4), %edx
+
+ leal (%edi,%ecx,4), %edi
+ negl %ecx
+ shrl %eax
+
+ C This loop in in a single 16 byte code block already, so no
+ C alignment necessary.
+L(simple):
+ C eax scratch
+ C ebx src1
+ C ecx counter
+ C edx src2
+ C esi
+ C edi dst
+ C ebp
+
+ movl (%ebx,%ecx,4), %eax
+ M4_inst (%edx,%ecx,4), %eax
+ movl %eax, (%edi,%ecx,4)
+ incl %ecx
+ jnz L(simple)
+
+ movl $0, %eax
+ movl SAVE_EDI, %edi
+
+ movl SAVE_EBX, %ebx
+ setc %al
+ addl $STACK_SPACE, %esp
+
+ ret
+
+
+C -----------------------------------------------------------------------------
+ C This is at 0x55, close enough to aligned.
+L(unroll):
+deflit(`FRAME',STACK_SPACE)
+ movl %ebp, SAVE_EBP
+ andl $-2, %ecx C size low bit masked out
+ andl $1, PARAM_SIZE C size low bit kept
+
+ movl %ecx, %edi
+ decl %ecx
+ movl PARAM_DST, %ebp
+
+ shrl $UNROLL_LOG2, %ecx
+ negl %edi
+ movl %esi, SAVE_ESI
+
+ andl $UNROLL_MASK, %edi
+
+ifdef(`PIC',`
+ call L(pic_calc)
+L(here):
+',`
+ leal L(entry) (%edi,%edi,8), %esi C 9 bytes per
+')
+ negl %edi
+ shrl %eax
+
+ leal ifelse(UNROLL_BYTES,256,128) (%ebx,%edi,4), %ebx
+ leal ifelse(UNROLL_BYTES,256,128) (%edx,%edi,4), %edx
+ leal ifelse(UNROLL_BYTES,256,128) (%ebp,%edi,4), %edi
+
+ jmp *%esi
+
+
+ifdef(`PIC',`
+L(pic_calc):
+ C See mpn/x86/README about old gas bugs
+ leal (%edi,%edi,8), %esi
+ addl $L(entry)-L(here), %esi
+ addl (%esp), %esi
+ ret_internal
+')
+
+
+C -----------------------------------------------------------------------------
+ ALIGN(32)
+L(top):
+ C eax zero
+ C ebx src1
+ C ecx counter
+ C edx src2
+ C esi scratch (was computed jump)
+ C edi dst
+ C ebp scratch
+
+ leal UNROLL_BYTES(%edx), %edx
+
+L(entry):
+deflit(CHUNK_COUNT, 2)
+forloop(i, 0, UNROLL_COUNT/CHUNK_COUNT-1, `
+ deflit(`disp0', eval(i*CHUNK_COUNT*4 ifelse(UNROLL_BYTES,256,-128)))
+ deflit(`disp1', eval(disp0 + 4))
+
+Zdisp( movl, disp0,(%ebx), %esi)
+ movl disp1(%ebx), %ebp
+Zdisp( M4_inst,disp0,(%edx), %esi)
+Zdisp( movl, %esi, disp0,(%edi))
+ M4_inst disp1(%edx), %ebp
+ movl %ebp, disp1(%edi)
+')
+
+ decl %ecx
+ leal UNROLL_BYTES(%ebx), %ebx
+ leal UNROLL_BYTES(%edi), %edi
+ jns L(top)
+
+
+ mov PARAM_SIZE, %esi
+ movl SAVE_EBP, %ebp
+ movl $0, %eax
+
+ decl %esi
+ js L(even)
+
+ movl (%ebx), %ecx
+ M4_inst UNROLL_BYTES(%edx), %ecx
+ movl %ecx, (%edi)
+L(even):
+
+ movl SAVE_EDI, %edi
+ movl SAVE_EBX, %ebx
+ setc %al
+
+ movl SAVE_ESI, %esi
+ addl $STACK_SPACE, %esp
+
+ ret
+
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k7/aorsmul_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k7/aorsmul_1.asm
new file mode 100644
index 00000000000..eec8df6de25
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k7/aorsmul_1.asm
@@ -0,0 +1,167 @@
+dnl AMD K7 mpn_addmul_1/mpn_submul_1 -- add or subtract mpn multiple.
+
+dnl Copyright 1999-2002, 2005, 2008 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 P5
+C P6 model 0-8,10-12
+C P6 model 9 (Banias) 6.5
+C P6 model 13 (Dothan)
+C P4 model 0 (Willamette)
+C P4 model 1 (?)
+C P4 model 2 (Northwood)
+C P4 model 3 (Prescott)
+C P4 model 4 (Nocona)
+C AMD K6
+C AMD K7 3.75
+C AMD K8
+
+C TODO
+C * Improve feed-in and wind-down code. We beat the old code for all n != 1,
+C but lose by 2x for n == 1.
+
+ifdef(`OPERATION_addmul_1',`
+ define(`ADDSUB', `add')
+ define(`func', `mpn_addmul_1')
+')
+ifdef(`OPERATION_submul_1',`
+ define(`ADDSUB', `sub')
+ define(`func', `mpn_submul_1')
+')
+
+MULFUNC_PROLOGUE(mpn_addmul_1 mpn_submul_1)
+
+ASM_START()
+ TEXT
+ ALIGN(16)
+PROLOGUE(func)
+ add $-16, %esp
+ mov %ebp, (%esp)
+ mov %ebx, 4(%esp)
+ mov %esi, 8(%esp)
+ mov %edi, 12(%esp)
+
+ mov 20(%esp), %edi
+ mov 24(%esp), %esi
+ mov 28(%esp), %eax
+ mov 32(%esp), %ecx
+ mov %eax, %ebx
+ shr $2, %eax
+ mov %eax, 28(%esp)
+ mov (%esi), %eax
+ and $3, %ebx
+ jz L(b0)
+ cmp $2, %ebx
+ jz L(b2)
+ jg L(b3)
+
+L(b1): lea -4(%esi), %esi
+ lea -4(%edi), %edi
+ mul %ecx
+ mov %eax, %ebx
+ mov %edx, %ebp
+ cmpl $0, 28(%esp)
+ jz L(cj1)
+ mov 8(%esi), %eax
+ jmp L(1)
+
+L(b2): mul %ecx
+ mov %eax, %ebp
+ mov 4(%esi), %eax
+ mov %edx, %ebx
+ cmpl $0, 28(%esp)
+ jne L(2)
+ jmp L(cj2)
+
+L(b3): lea -12(%esi), %esi
+ lea -12(%edi), %edi
+ mul %ecx
+ mov %eax, %ebx
+ mov %edx, %ebp
+ mov 16(%esi), %eax
+ incl 28(%esp)
+ jmp L(3)
+
+L(b0): lea -8(%esi), %esi
+ lea -8(%edi), %edi
+ mul %ecx
+ mov %eax, %ebp
+ mov 12(%esi), %eax
+ mov %edx, %ebx
+ jmp L(0)
+
+ ALIGN(16)
+L(top): lea 16(%edi), %edi
+L(2): mul %ecx
+ ADDSUB %ebp, 0(%edi)
+ mov $0, %ebp
+ adc %eax, %ebx
+ mov 8(%esi), %eax
+ adc %edx, %ebp
+L(1): mul %ecx
+ ADDSUB %ebx, 4(%edi)
+ mov $0, %ebx
+ adc %eax, %ebp
+ mov 12(%esi), %eax
+ adc %edx, %ebx
+L(0): mul %ecx
+ ADDSUB %ebp, 8(%edi)
+ mov $0, %ebp
+ adc %eax, %ebx
+ adc %edx, %ebp
+ mov 16(%esi), %eax
+L(3): mul %ecx
+ ADDSUB %ebx, 12(%edi)
+ adc %eax, %ebp
+ mov 20(%esi), %eax
+ lea 16(%esi), %esi
+ mov $0, %ebx
+ adc %edx, %ebx
+ decl 28(%esp)
+ jnz L(top)
+
+L(end): lea 16(%edi), %edi
+L(cj2): mul %ecx
+ ADDSUB %ebp, (%edi)
+ adc %eax, %ebx
+ adc $0, %edx
+L(cj1): ADDSUB %ebx, 4(%edi)
+ adc $0, %edx
+ mov %edx, %eax
+ mov (%esp), %ebp
+ mov 4(%esp), %ebx
+ mov 8(%esp), %esi
+ mov 12(%esp), %edi
+ add $16, %esp
+ ret
+EPILOGUE()
+ASM_END()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k7/bdiv_q_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k7/bdiv_q_1.asm
new file mode 100644
index 00000000000..df3477f539a
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k7/bdiv_q_1.asm
@@ -0,0 +1,244 @@
+dnl AMD K7 mpn_bdiv_q_1 -- mpn by limb exact division.
+
+dnl Rearranged from mpn/x86/k7/dive_1.asm by Marco Bodrato.
+
+dnl Copyright 2001, 2002, 2004, 2007, 2011 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 Athlon: 11.0
+C Hammer: 9.0
+
+
+C void mpn_divexact_1 (mp_ptr dst, mp_srcptr src, mp_size_t size,
+C mp_limb_t divisor);
+C
+C The dependent chain is mul+imul+sub for 11 cycles and that speed is
+C achieved with no special effort. The load and shrld latencies are hidden
+C by out of order execution.
+C
+C It's a touch faster on size==1 to use the mul-by-inverse than divl.
+
+defframe(PARAM_SHIFT, 24)
+defframe(PARAM_INVERSE,20)
+defframe(PARAM_DIVISOR,16)
+defframe(PARAM_SIZE, 12)
+defframe(PARAM_SRC, 8)
+defframe(PARAM_DST, 4)
+
+defframe(SAVE_EBX, -4)
+defframe(SAVE_ESI, -8)
+defframe(SAVE_EDI, -12)
+defframe(SAVE_EBP, -16)
+defframe(VAR_INVERSE, -20)
+defframe(VAR_DST_END, -24)
+
+deflit(STACK_SPACE, 24)
+
+ TEXT
+
+C mp_limb_t
+C mpn_pi1_bdiv_q_1 (mp_ptr dst, mp_srcptr src, mp_size_t size, mp_limb_t divisor,
+C mp_limb_t inverse, int shift)
+ ALIGN(16)
+PROLOGUE(mpn_pi1_bdiv_q_1)
+deflit(`FRAME',0)
+
+ subl $STACK_SPACE, %esp deflit(`FRAME',STACK_SPACE)
+ movl PARAM_SHIFT, %ecx C shift count
+
+ movl %ebp, SAVE_EBP
+ movl PARAM_SIZE, %ebp
+
+ movl %esi, SAVE_ESI
+ movl PARAM_SRC, %esi
+
+ movl %edi, SAVE_EDI
+ movl PARAM_DST, %edi
+
+ movl %ebx, SAVE_EBX
+
+ leal (%esi,%ebp,4), %esi C src end
+ leal (%edi,%ebp,4), %edi C dst end
+ negl %ebp C -size
+
+ movl PARAM_INVERSE, %eax C inv
+
+L(common):
+ movl %eax, VAR_INVERSE
+ movl (%esi,%ebp,4), %eax C src[0]
+
+ incl %ebp
+ jz L(one)
+
+ movl (%esi,%ebp,4), %edx C src[1]
+
+ shrdl( %cl, %edx, %eax)
+
+ movl %edi, VAR_DST_END
+ xorl %ebx, %ebx
+ jmp L(entry)
+
+ ALIGN(8)
+L(top):
+ C eax q
+ C ebx carry bit, 0 or 1
+ C ecx shift
+ C edx
+ C esi src end
+ C edi dst end
+ C ebp counter, limbs, negative
+
+ mull PARAM_DIVISOR C carry limb in edx
+
+ movl -4(%esi,%ebp,4), %eax
+ movl (%esi,%ebp,4), %edi
+
+ shrdl( %cl, %edi, %eax)
+
+ subl %ebx, %eax C apply carry bit
+ setc %bl
+ movl VAR_DST_END, %edi
+
+ subl %edx, %eax C apply carry limb
+ adcl $0, %ebx
+
+L(entry):
+ imull VAR_INVERSE, %eax
+
+ movl %eax, -4(%edi,%ebp,4)
+ incl %ebp
+ jnz L(top)
+
+
+ mull PARAM_DIVISOR C carry limb in edx
+
+ movl -4(%esi), %eax C src high limb
+ shrl %cl, %eax
+ movl SAVE_ESI, %esi
+
+ subl %ebx, %eax C apply carry bit
+ movl SAVE_EBX, %ebx
+ movl SAVE_EBP, %ebp
+
+ subl %edx, %eax C apply carry limb
+
+ imull VAR_INVERSE, %eax
+
+ movl %eax, -4(%edi)
+ movl SAVE_EDI, %edi
+ addl $STACK_SPACE, %esp
+
+ ret
+
+L(one):
+ shrl %cl, %eax
+ movl SAVE_ESI, %esi
+ movl SAVE_EBX, %ebx
+
+ imull VAR_INVERSE, %eax
+
+ movl SAVE_EBP, %ebp
+
+ movl %eax, -4(%edi)
+ movl SAVE_EDI, %edi
+ addl $STACK_SPACE, %esp
+
+ ret
+EPILOGUE()
+
+C mp_limb_t mpn_bdiv_q_1 (mp_ptr dst, mp_srcptr src, mp_size_t size,
+C mp_limb_t divisor);
+C
+
+ ALIGN(16)
+PROLOGUE(mpn_bdiv_q_1)
+deflit(`FRAME',0)
+
+ movl PARAM_DIVISOR, %eax
+ subl $STACK_SPACE, %esp deflit(`FRAME',STACK_SPACE)
+ movl $-1, %ecx C shift count
+
+ movl %ebp, SAVE_EBP
+ movl PARAM_SIZE, %ebp
+
+ movl %esi, SAVE_ESI
+ movl %edi, SAVE_EDI
+
+ C If there's usually only one or two trailing zero bits then this
+ C should be faster than bsfl.
+L(strip_twos):
+ incl %ecx
+ shrl %eax
+ jnc L(strip_twos)
+
+ movl %ebx, SAVE_EBX
+ leal 1(%eax,%eax), %ebx C d without twos
+ andl $127, %eax C d/2, 7 bits
+
+ifdef(`PIC',`
+ LEA( binvert_limb_table, %edx)
+ movzbl (%eax,%edx), %eax C inv 8 bits
+',`
+ movzbl binvert_limb_table(%eax), %eax C inv 8 bits
+')
+
+ leal (%eax,%eax), %edx C 2*inv
+ movl %ebx, PARAM_DIVISOR C d without twos
+
+ imull %eax, %eax C inv*inv
+
+ movl PARAM_SRC, %esi
+ movl PARAM_DST, %edi
+
+ imull %ebx, %eax C inv*inv*d
+
+ subl %eax, %edx C inv = 2*inv - inv*inv*d
+ leal (%edx,%edx), %eax C 2*inv
+
+ imull %edx, %edx C inv*inv
+
+ leal (%esi,%ebp,4), %esi C src end
+ leal (%edi,%ebp,4), %edi C dst end
+ negl %ebp C -size
+
+ imull %ebx, %edx C inv*inv*d
+
+ subl %edx, %eax C inv = 2*inv - inv*inv*d
+
+ ASSERT(e,` C expect d*inv == 1 mod 2^GMP_LIMB_BITS
+ pushl %eax FRAME_pushl()
+ imull PARAM_DIVISOR, %eax
+ cmpl $1, %eax
+ popl %eax FRAME_popl()')
+
+ jmp L(common)
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k7/dive_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k7/dive_1.asm
new file mode 100644
index 00000000000..8eb4f45ac0f
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k7/dive_1.asm
@@ -0,0 +1,207 @@
+dnl AMD K7 mpn_divexact_1 -- mpn by limb exact division.
+
+dnl Copyright 2001, 2002, 2004, 2007 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 Athlon: 11.0
+C Hammer: 9.0
+
+
+C void mpn_divexact_1 (mp_ptr dst, mp_srcptr src, mp_size_t size,
+C mp_limb_t divisor);
+C
+C The dependent chain is mul+imul+sub for 11 cycles and that speed is
+C achieved with no special effort. The load and shrld latencies are hidden
+C by out of order execution.
+C
+C It's a touch faster on size==1 to use the mul-by-inverse than divl.
+
+defframe(PARAM_DIVISOR,16)
+defframe(PARAM_SIZE, 12)
+defframe(PARAM_SRC, 8)
+defframe(PARAM_DST, 4)
+
+defframe(SAVE_EBX, -4)
+defframe(SAVE_ESI, -8)
+defframe(SAVE_EDI, -12)
+defframe(SAVE_EBP, -16)
+defframe(VAR_INVERSE, -20)
+defframe(VAR_DST_END, -24)
+
+deflit(STACK_SPACE, 24)
+
+ TEXT
+
+ ALIGN(16)
+PROLOGUE(mpn_divexact_1)
+deflit(`FRAME',0)
+
+ movl PARAM_DIVISOR, %eax
+ subl $STACK_SPACE, %esp deflit(`FRAME',STACK_SPACE)
+ movl $-1, %ecx C shift count
+
+ movl %ebp, SAVE_EBP
+ movl PARAM_SIZE, %ebp
+
+ movl %esi, SAVE_ESI
+ movl %edi, SAVE_EDI
+
+ C If there's usually only one or two trailing zero bits then this
+ C should be faster than bsfl.
+L(strip_twos):
+ incl %ecx
+ shrl %eax
+ jnc L(strip_twos)
+
+ movl %ebx, SAVE_EBX
+ leal 1(%eax,%eax), %ebx C d without twos
+ andl $127, %eax C d/2, 7 bits
+
+ifdef(`PIC',`
+ LEA( binvert_limb_table, %edx)
+ movzbl (%eax,%edx), %eax C inv 8 bits
+',`
+ movzbl binvert_limb_table(%eax), %eax C inv 8 bits
+')
+
+ leal (%eax,%eax), %edx C 2*inv
+ movl %ebx, PARAM_DIVISOR C d without twos
+
+ imull %eax, %eax C inv*inv
+
+ movl PARAM_SRC, %esi
+ movl PARAM_DST, %edi
+
+ imull %ebx, %eax C inv*inv*d
+
+ subl %eax, %edx C inv = 2*inv - inv*inv*d
+ leal (%edx,%edx), %eax C 2*inv
+
+ imull %edx, %edx C inv*inv
+
+ leal (%esi,%ebp,4), %esi C src end
+ leal (%edi,%ebp,4), %edi C dst end
+ negl %ebp C -size
+
+ imull %ebx, %edx C inv*inv*d
+
+ subl %edx, %eax C inv = 2*inv - inv*inv*d
+
+ ASSERT(e,` C expect d*inv == 1 mod 2^GMP_LIMB_BITS
+ pushl %eax FRAME_pushl()
+ imull PARAM_DIVISOR, %eax
+ cmpl $1, %eax
+ popl %eax FRAME_popl()')
+
+ movl %eax, VAR_INVERSE
+ movl (%esi,%ebp,4), %eax C src[0]
+
+ incl %ebp
+ jz L(one)
+
+ movl (%esi,%ebp,4), %edx C src[1]
+
+ shrdl( %cl, %edx, %eax)
+
+ movl %edi, VAR_DST_END
+ xorl %ebx, %ebx
+ jmp L(entry)
+
+ ALIGN(8)
+L(top):
+ C eax q
+ C ebx carry bit, 0 or 1
+ C ecx shift
+ C edx
+ C esi src end
+ C edi dst end
+ C ebp counter, limbs, negative
+
+ mull PARAM_DIVISOR C carry limb in edx
+
+ movl -4(%esi,%ebp,4), %eax
+ movl (%esi,%ebp,4), %edi
+
+ shrdl( %cl, %edi, %eax)
+
+ subl %ebx, %eax C apply carry bit
+ setc %bl
+ movl VAR_DST_END, %edi
+
+ subl %edx, %eax C apply carry limb
+ adcl $0, %ebx
+
+L(entry):
+ imull VAR_INVERSE, %eax
+
+ movl %eax, -4(%edi,%ebp,4)
+ incl %ebp
+ jnz L(top)
+
+
+ mull PARAM_DIVISOR C carry limb in edx
+
+ movl -4(%esi), %eax C src high limb
+ shrl %cl, %eax
+ movl SAVE_ESI, %esi
+
+ subl %ebx, %eax C apply carry bit
+ movl SAVE_EBX, %ebx
+ movl SAVE_EBP, %ebp
+
+ subl %edx, %eax C apply carry limb
+
+ imull VAR_INVERSE, %eax
+
+ movl %eax, -4(%edi)
+ movl SAVE_EDI, %edi
+ addl $STACK_SPACE, %esp
+
+ ret
+
+
+L(one):
+ shrl %cl, %eax
+ movl SAVE_ESI, %esi
+ movl SAVE_EBX, %ebx
+
+ imull VAR_INVERSE, %eax
+
+ movl SAVE_EBP, %ebp
+ movl %eax, -4(%edi)
+
+ movl SAVE_EDI, %edi
+ addl $STACK_SPACE, %esp
+
+ ret
+
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k7/gcd_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k7/gcd_1.asm
new file mode 100644
index 00000000000..c7d12c83c01
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k7/gcd_1.asm
@@ -0,0 +1,186 @@
+dnl x86 mpn_gcd_1 optimised for AMD K7.
+
+dnl Contributed to the GNU project by by Kevin Ryde. Rehacked by Torbjorn
+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 AMD K7 5.31
+C AMD K8,K9 5.33
+C AMD K10 5.30
+C AMD bd1 ?
+C AMD bobcat 7.02
+C Intel P4-2 10.1
+C Intel P4-3/4 10.0
+C Intel P6/13 5.88
+C Intel core2 6.26
+C Intel NHM 6.83
+C Intel SBR 8.50
+C Intel atom 8.90
+C VIA nano ?
+C Numbers measured with: speed -CD -s16-32 -t16 mpn_gcd_1
+
+C TODO
+C * Tune overhead, this takes 2-3 cycles more than old code when v0 is tiny.
+C * Stream things better through registers, avoiding some copying.
+
+C ctz_table[n] is the number of trailing zeros on n, or MAXSHIFT if n==0.
+
+deflit(MAXSHIFT, 6)
+deflit(MASK, eval((m4_lshift(1,MAXSHIFT))-1))
+
+DEF_OBJECT(ctz_table,64)
+ .byte MAXSHIFT
+forloop(i,1,MASK,
+` .byte m4_count_trailing_zeros(i)
+')
+END_OBJECT(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(`DIV_THRES_LOG2', 7)
+
+
+define(`up', `%edi')
+define(`n', `%esi')
+define(`v0', `%edx')
+
+
+ASM_START()
+ TEXT
+ ALIGN(16)
+PROLOGUE(mpn_gcd_1)
+ push %edi
+ push %esi
+
+ mov 12(%esp), up
+ mov 16(%esp), n
+ mov 20(%esp), v0
+
+ mov (up), %eax C U low limb
+ or v0, %eax C x | y
+ mov $-1, %ecx
+
+L(twos):
+ inc %ecx
+ shr %eax
+ jnc L(twos)
+
+ shr %cl, v0
+ mov %ecx, %eax C common twos
+
+L(divide_strip_y):
+ shr v0
+ jnc L(divide_strip_y)
+ adc v0, v0
+
+ push %eax
+ push v0
+
+ cmp $1, n
+ jnz L(reduce_nby1)
+
+C Both U and V are single limbs, reduce with bmod if u0 >> v0.
+ mov (up), %ecx
+ mov %ecx, %eax
+ shr $DIV_THRES_LOG2, %ecx
+ cmp %ecx, v0
+ ja L(reduced)
+
+ mov v0, %esi
+ xor %edx, %edx
+ div %esi
+ mov %edx, %eax
+ jmp L(reduced)
+
+L(reduce_nby1):
+ifdef(`PIC_WITH_EBX',`
+ push %ebx
+ call L(movl_eip_to_ebx)
+ add $_GLOBAL_OFFSET_TABLE_, %ebx
+')
+ push v0 C param 3
+ push n C param 2
+ push up C param 1
+ cmp $BMOD_1_TO_MOD_1_THRESHOLD, n
+ jl L(bmod)
+ CALL( mpn_mod_1)
+ jmp L(called)
+L(bmod):
+ CALL( mpn_modexact_1_odd)
+
+L(called):
+ add $12, %esp C deallocate params
+ifdef(`PIC_WITH_EBX',`
+ pop %ebx
+')
+L(reduced):
+ pop %edx
+
+ LEA( ctz_table, %esi)
+ test %eax, %eax
+ mov %eax, %ecx
+ jnz L(mid)
+ jmp L(end)
+
+ ALIGN(16) C K8 BC P4 NHM SBR
+L(top): cmovc( %ecx, %eax) C if x-y < 0 0
+ cmovc( %edi, %edx) C use x,y-x 0
+L(mid): and $MASK, %ecx C 0
+ movzbl (%esi,%ecx), %ecx C 1
+ jz L(shift_alot) C 1
+ shr %cl, %eax C 3
+ mov %eax, %edi C 4
+ mov %edx, %ecx C 3
+ sub %eax, %ecx C 4
+ sub %edx, %eax C 4
+ jnz L(top) C 5
+
+L(end): pop %ecx
+ mov %edx, %eax
+ shl %cl, %eax
+ pop %esi
+ pop %edi
+ ret
+
+L(shift_alot):
+ shr $MAXSHIFT, %eax
+ mov %eax, %ecx
+ jmp L(mid)
+
+ifdef(`PIC_WITH_EBX',`
+L(movl_eip_to_ebx):
+ mov (%esp), %ebx
+ ret
+')
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k7/gmp-mparam.h b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k7/gmp-mparam.h
new file mode 100644
index 00000000000..9977a113e2d
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k7/gmp-mparam.h
@@ -0,0 +1,241 @@
+/* AMD K7 gmp-mparam.h -- Compiler/machine parameter header file.
+
+Copyright 1991, 1993, 1994, 2000-2005, 2008-2010, 2014 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
+
+/* 2083 MHz K7 Barton */
+/* FFT tuning limit = 25000000 */
+/* Generated by tuneup.c, 2014-03-13, gcc 4.2 */
+
+#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 3
+#define MOD_1_1_TO_MOD_1_2_THRESHOLD 24
+#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 USE_PREINV_DIVREM_1 1 /* native */
+#define DIV_QR_1N_PI1_METHOD 1
+#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 24
+
+#define MUL_TOOM22_THRESHOLD 28
+#define MUL_TOOM33_THRESHOLD 85
+#define MUL_TOOM44_THRESHOLD 147
+#define MUL_TOOM6H_THRESHOLD 216
+#define MUL_TOOM8H_THRESHOLD 309
+
+#define MUL_TOOM32_TO_TOOM43_THRESHOLD 85
+#define MUL_TOOM32_TO_TOOM53_THRESHOLD 99
+#define MUL_TOOM42_TO_TOOM53_THRESHOLD 98
+#define MUL_TOOM42_TO_TOOM63_THRESHOLD 102
+#define MUL_TOOM43_TO_TOOM54_THRESHOLD 124
+
+#define SQR_BASECASE_THRESHOLD 0 /* always (native) */
+#define SQR_TOOM2_THRESHOLD 50
+#define SQR_TOOM3_THRESHOLD 81
+#define SQR_TOOM4_THRESHOLD 216
+#define SQR_TOOM6_THRESHOLD 306
+#define SQR_TOOM8_THRESHOLD 446
+
+#define MULMID_TOOM42_THRESHOLD 56
+
+#define MULMOD_BNM1_THRESHOLD 17
+#define SQRMOD_BNM1_THRESHOLD 17
+
+#define MUL_FFT_MODF_THRESHOLD 904 /* k = 6 */
+#define MUL_FFT_TABLE3 \
+ { { 904, 6}, { 21, 7}, { 11, 6}, { 25, 7}, \
+ { 13, 6}, { 27, 7}, { 15, 6}, { 31, 7}, \
+ { 17, 6}, { 35, 7}, { 19, 6}, { 39, 7}, \
+ { 23, 6}, { 47, 7}, { 27, 8}, { 15, 7}, \
+ { 31, 6}, { 63, 7}, { 35, 8}, { 19, 7}, \
+ { 39, 8}, { 23, 7}, { 47, 8}, { 31, 7}, \
+ { 63, 8}, { 39, 7}, { 79, 9}, { 23, 8}, \
+ { 47, 7}, { 95, 8}, { 51, 9}, { 31, 8}, \
+ { 71, 9}, { 39, 8}, { 79, 9}, { 47, 8}, \
+ { 95, 9}, { 55,10}, { 31, 9}, { 63, 8}, \
+ { 127, 9}, { 71, 8}, { 143, 9}, { 79, 8}, \
+ { 159,10}, { 47, 9}, { 95, 8}, { 191, 9}, \
+ { 103,11}, { 31,10}, { 63, 9}, { 127, 8}, \
+ { 255, 9}, { 143,10}, { 79, 9}, { 167,10}, \
+ { 95, 9}, { 199,10}, { 111,11}, { 63,10}, \
+ { 127, 9}, { 255,10}, { 143, 9}, { 287,10}, \
+ { 159, 9}, { 319,11}, { 95,10}, { 191, 9}, \
+ { 383,10}, { 207,12}, { 63,11}, { 127,10}, \
+ { 255, 9}, { 511,10}, { 271, 8}, { 1087,10}, \
+ { 287,11}, { 159,10}, { 319, 9}, { 639,11}, \
+ { 191,10}, { 383, 9}, { 767, 8}, { 1535, 9}, \
+ { 799, 8}, { 1599,11}, { 223,12}, { 127,11}, \
+ { 255,10}, { 511, 9}, { 1023,10}, { 543, 9}, \
+ { 1087,11}, { 287,10}, { 575, 9}, { 1151,10}, \
+ { 607, 9}, { 1215, 8}, { 2431,11}, { 319,10}, \
+ { 639, 9}, { 1279,10}, { 671, 9}, { 1343,12}, \
+ { 191,11}, { 383,10}, { 767, 9}, { 1535,10}, \
+ { 799, 9}, { 1599,10}, { 831, 9}, { 1663,10}, \
+ { 863,13}, { 127,12}, { 255,11}, { 511,10}, \
+ { 1023,11}, { 543,10}, { 1087,11}, { 575,10}, \
+ { 1151,11}, { 607,10}, { 1215, 9}, { 2431,12}, \
+ { 319,11}, { 639,10}, { 1407,11}, { 735,10}, \
+ { 1471, 9}, { 2943,12}, { 383,11}, { 767,10}, \
+ { 1535,11}, { 799,10}, { 1599,11}, { 831,10}, \
+ { 1663,11}, { 895,10}, { 1791,11}, { 959,10}, \
+ { 1919,13}, { 255,12}, { 511,11}, { 1023,10}, \
+ { 2047,11}, { 1087,12}, { 575,11}, { 1151,10}, \
+ { 2303,11}, { 1215,10}, { 2431,12}, { 639,11}, \
+ { 1279,10}, { 2559,11}, { 1407,10}, { 2815,11}, \
+ { 1471,10}, { 2943,13}, { 383,12}, { 767,11}, \
+ { 1599,12}, { 831,11}, { 1663,12}, { 895,11}, \
+ { 1791,10}, { 3583,12}, { 959,11}, { 1919,10}, \
+ { 3839,14}, { 255,13}, { 511,12}, { 1023,11}, \
+ { 2047,12}, { 1087,11}, { 2175,12}, { 1151,11}, \
+ { 2303,12}, { 1215,11}, { 2431,13}, { 639,12}, \
+ { 1407,11}, { 2815,12}, { 1471,11}, { 2943,13}, \
+ { 767,12}, { 1663,11}, { 3327,13}, { 895,12}, \
+ { 1791,11}, { 3583,12}, { 1919,11}, { 3839,12}, \
+ { 1983,11}, { 3967,14}, { 511,13}, { 1023,12}, \
+ { 2239,13}, { 1151,12}, { 2495,13}, { 1279,12}, \
+ { 2559,13}, { 1407,12}, { 2943,11}, { 5887,14}, \
+ { 767,13}, { 1535,12}, { 3071,13}, { 1663,12}, \
+ { 3327,13}, { 1791,12}, { 3583,13}, { 1919,12}, \
+ { 3967,15}, { 511,14}, { 1023,13}, { 2047,12}, \
+ { 4095,13}, { 2175,12}, { 4351,13}, { 2431,12}, \
+ { 4863,14}, { 1279,13}, { 2559,12}, { 5119,13}, \
+ { 2943,12}, { 5887,14}, { 16384,15}, { 32768,16} }
+#define MUL_FFT_TABLE3_SIZE 228
+#define MUL_FFT_THRESHOLD 7808
+
+#define SQR_FFT_MODF_THRESHOLD 888 /* k = 6 */
+#define SQR_FFT_TABLE3 \
+ { { 888, 6}, { 21, 7}, { 11, 6}, { 25, 7}, \
+ { 13, 6}, { 27, 7}, { 15, 6}, { 31, 7}, \
+ { 17, 6}, { 35, 7}, { 19, 6}, { 39, 7}, \
+ { 23, 6}, { 47, 7}, { 27, 8}, { 15, 7}, \
+ { 31, 6}, { 63, 7}, { 35, 8}, { 19, 7}, \
+ { 39, 8}, { 23, 7}, { 47, 8}, { 31, 7}, \
+ { 63, 8}, { 39, 9}, { 23, 8}, { 47, 7}, \
+ { 95, 8}, { 51, 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, 8}, { 191,11}, \
+ { 31,10}, { 63, 9}, { 127, 8}, { 255, 9}, \
+ { 143,10}, { 79, 9}, { 167,10}, { 95, 9}, \
+ { 191,10}, { 111,11}, { 63,10}, { 127, 9}, \
+ { 255, 8}, { 511,10}, { 143, 9}, { 287, 8}, \
+ { 575,10}, { 159,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}, { 319, 9}, \
+ { 639, 8}, { 1279, 9}, { 671,11}, { 191,10}, \
+ { 383, 9}, { 799, 8}, { 1599, 9}, { 831,11}, \
+ { 223,12}, { 127,11}, { 255,10}, { 543, 9}, \
+ { 1087,11}, { 287,10}, { 575, 9}, { 1215, 8}, \
+ { 2431,11}, { 319,10}, { 639, 9}, { 1279,10}, \
+ { 671, 9}, { 1407,12}, { 191,10}, { 799, 9}, \
+ { 1599,10}, { 831, 9}, { 1663,10}, { 863, 9}, \
+ { 1727,11}, { 447,13}, { 127,12}, { 255,11}, \
+ { 511,10}, { 1023,11}, { 543,10}, { 1087, 9}, \
+ { 2175,10}, { 1119,11}, { 575,10}, { 1151,11}, \
+ { 607,10}, { 1215, 9}, { 2431,12}, { 319,11}, \
+ { 639,10}, { 1279,11}, { 671,10}, { 1343, 9}, \
+ { 2687,11}, { 703,10}, { 1407,11}, { 735,10}, \
+ { 1471, 9}, { 2943,10}, { 1503,12}, { 383,11}, \
+ { 767,10}, { 1535,11}, { 799,10}, { 1599,11}, \
+ { 863,10}, { 1727,12}, { 447,11}, { 895,10}, \
+ { 1791,11}, { 959,10}, { 1919,13}, { 255,12}, \
+ { 511,11}, { 1023,10}, { 2047,11}, { 1087,10}, \
+ { 2175,11}, { 1119,12}, { 575,11}, { 1151,10}, \
+ { 2303,11}, { 1215,10}, { 2431,12}, { 639,11}, \
+ { 1407,10}, { 2815,11}, { 1471,10}, { 2943,12}, \
+ { 767,11}, { 1599,12}, { 831,11}, { 1663,10}, \
+ { 3327,12}, { 895,11}, { 1791,10}, { 3583,12}, \
+ { 959,11}, { 1919,10}, { 3839,11}, { 1983,14}, \
+ { 255,13}, { 511,12}, { 1023,11}, { 2047,12}, \
+ { 1087,11}, { 2175,12}, { 1151,11}, { 2303,12}, \
+ { 1215,11}, { 2431,13}, { 639,12}, { 1407,11}, \
+ { 2815,12}, { 1471,11}, { 2943,13}, { 767,12}, \
+ { 1663,11}, { 3327,12}, { 1727,13}, { 895,12}, \
+ { 1791,11}, { 3583,12}, { 1919,11}, { 3839,12}, \
+ { 1983,11}, { 3967,14}, { 511,13}, { 1023,12}, \
+ { 2175,13}, { 1151,12}, { 2495,13}, { 1279,12}, \
+ { 2559,13}, { 1407,12}, { 2943,11}, { 5887,14}, \
+ { 767,13}, { 1535,12}, { 3071,13}, { 1663,12}, \
+ { 3327,13}, { 1791,12}, { 3583,13}, { 1919,12}, \
+ { 3967,15}, { 511,14}, { 1023,13}, { 2047,12}, \
+ { 4095,13}, { 2175,12}, { 4351,13}, { 2431,14}, \
+ { 1279,13}, { 2943,12}, { 5887,14}, { 16384,15}, \
+ { 32768,16} }
+#define SQR_FFT_TABLE3_SIZE 229
+#define SQR_FFT_THRESHOLD 7552
+
+#define MULLO_BASECASE_THRESHOLD 8
+#define MULLO_DC_THRESHOLD 36
+#define MULLO_MUL_N_THRESHOLD 13463
+
+#define DC_DIV_QR_THRESHOLD 45
+#define DC_DIVAPPR_Q_THRESHOLD 208
+#define DC_BDIV_QR_THRESHOLD 43
+#define DC_BDIV_Q_THRESHOLD 140
+
+#define INV_MULMOD_BNM1_THRESHOLD 62
+#define INV_NEWTON_THRESHOLD 204
+#define INV_APPR_THRESHOLD 204
+
+#define BINV_NEWTON_THRESHOLD 230
+#define REDC_1_TO_REDC_N_THRESHOLD 59
+
+#define MU_DIV_QR_THRESHOLD 1752
+#define MU_DIVAPPR_Q_THRESHOLD 1528
+#define MUPI_DIV_QR_THRESHOLD 82
+#define MU_BDIV_QR_THRESHOLD 1360
+#define MU_BDIV_Q_THRESHOLD 1470
+
+#define POWM_SEC_TABLE 1,16,102,336,1221
+
+#define MATRIX22_STRASSEN_THRESHOLD 16
+#define HGCD_THRESHOLD 120
+#define HGCD_APPR_THRESHOLD 143
+#define HGCD_REDUCE_THRESHOLD 4818
+#define GCD_DC_THRESHOLD 474
+#define GCDEXT_DC_THRESHOLD 345
+#define JACOBI_BASE_METHOD 4
+
+#define GET_STR_DC_THRESHOLD 15
+#define GET_STR_PRECOMPUTE_THRESHOLD 33
+#define SET_STR_DC_THRESHOLD 298
+#define SET_STR_PRECOMPUTE_THRESHOLD 1187
+
+#define FAC_DSC_THRESHOLD 602
+#define FAC_ODD_THRESHOLD 29
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k7/invert_limb.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k7/invert_limb.asm
new file mode 100644
index 00000000000..6cce455a9de
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k7/invert_limb.asm
@@ -0,0 +1,193 @@
+dnl x86 mpn_invert_limb
+
+dnl Contributed to the GNU project by Niels Möller
+
+dnl Copyright 2009, 2011 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 (approx) div
+C P5 ?
+C P6 model 0-8,10-12 ?
+C P6 model 9 (Banias) ?
+C P6 model 13 (Dothan) ?
+C P4 model 0 (Willamette) ?
+C P4 model 1 (?) ?
+C P4 model 2 (Northwood) ?
+C P4 model 3 (Prescott) ?
+C P4 model 4 (Nocona) ?
+C AMD K6 ?
+C AMD K7 41 53
+C AMD K8 ?
+
+C TODO
+C * These c/l numbers are for a non-PIC build. Consider falling back to using
+C the 'div' instruction for PIC builds.
+C * Perhaps use this file--or at least the algorithm--for more machines than k7.
+
+C Register usage:
+C Input D in %edi
+C Current approximation is in %eax and/or %ecx
+C %ebx and %edx are temporaries
+C %esi and %ebp are unused
+
+defframe(PARAM_DIVISOR,4)
+
+ASM_START()
+
+C Make approx_tab global to work around Apple relocation bug.
+ifdef(`DARWIN',`
+ deflit(`approx_tab', MPN(invert_limb_tab))
+ GLOBL approx_tab')
+
+ TEXT
+ ALIGN(16)
+PROLOGUE(mpn_invert_limb)
+deflit(`FRAME', 0)
+ mov PARAM_DIVISOR, %eax
+ C Avoid push/pop on k7.
+ sub $8, %esp FRAME_subl_esp(8)
+ mov %ebx, (%esp)
+ mov %edi, 4(%esp)
+
+ mov %eax, %edi
+ shr $22, %eax
+ifdef(`PIC',`
+ LEA( approx_tab, %ebx)
+ movzwl -1024(%ebx, %eax, 2), %eax
+',`
+ movzwl -1024+approx_tab(%eax, %eax), %eax C %eax = v0
+')
+
+ C v1 = (v0 << 4) - ((v0*v0*d_21) >> 32) - 1
+ mov %eax, %ecx
+ imul %eax, %eax
+ mov %edi, %ebx
+ shr $11, %ebx
+ inc %ebx
+ mul %ebx
+ mov %edi, %ebx C Prepare
+ shr %ebx
+ sbb %eax, %eax
+ sub %eax, %ebx C %ebx = d_31, %eax = mask
+ shl $4, %ecx
+ dec %ecx
+ sub %edx, %ecx C %ecx = v1
+
+ C v_2 = (v1 << 15) + ((v1 *(2^48 - v1 * d31 + (v1 >> 1) & mask)) >> 33)
+ imul %ecx, %ebx
+ and %ecx, %eax
+ shr %eax
+ sub %ebx, %eax
+ mul %ecx
+ mov %edi, %eax C Prepare for next mul
+ shl $15, %ecx
+ shr %edx
+ add %edx, %ecx C %ecx = v2
+
+ mul %ecx
+ add %edi, %eax
+ mov %ecx, %eax
+ adc %edi, %edx
+ sub %edx, %eax C %eax = v3
+
+ mov (%esp), %ebx
+ mov 4(%esp), %edi
+ add $8, %esp
+
+ ret
+
+EPILOGUE()
+
+DEF_OBJECT(approx_tab,2)
+ .value 0x7fe1,0x7fa1,0x7f61,0x7f22,0x7ee3,0x7ea4,0x7e65,0x7e27
+ .value 0x7de9,0x7dab,0x7d6d,0x7d30,0x7cf3,0x7cb6,0x7c79,0x7c3d
+ .value 0x7c00,0x7bc4,0x7b89,0x7b4d,0x7b12,0x7ad7,0x7a9c,0x7a61
+ .value 0x7a27,0x79ec,0x79b2,0x7979,0x793f,0x7906,0x78cc,0x7894
+ .value 0x785b,0x7822,0x77ea,0x77b2,0x777a,0x7742,0x770b,0x76d3
+ .value 0x769c,0x7665,0x762f,0x75f8,0x75c2,0x758c,0x7556,0x7520
+ .value 0x74ea,0x74b5,0x7480,0x744b,0x7416,0x73e2,0x73ad,0x7379
+ .value 0x7345,0x7311,0x72dd,0x72aa,0x7277,0x7243,0x7210,0x71de
+ .value 0x71ab,0x7179,0x7146,0x7114,0x70e2,0x70b1,0x707f,0x704e
+ .value 0x701c,0x6feb,0x6fba,0x6f8a,0x6f59,0x6f29,0x6ef9,0x6ec8
+ .value 0x6e99,0x6e69,0x6e39,0x6e0a,0x6ddb,0x6dab,0x6d7d,0x6d4e
+ .value 0x6d1f,0x6cf1,0x6cc2,0x6c94,0x6c66,0x6c38,0x6c0a,0x6bdd
+ .value 0x6bb0,0x6b82,0x6b55,0x6b28,0x6afb,0x6acf,0x6aa2,0x6a76
+ .value 0x6a49,0x6a1d,0x69f1,0x69c6,0x699a,0x696e,0x6943,0x6918
+ .value 0x68ed,0x68c2,0x6897,0x686c,0x6842,0x6817,0x67ed,0x67c3
+ .value 0x6799,0x676f,0x6745,0x671b,0x66f2,0x66c8,0x669f,0x6676
+ .value 0x664d,0x6624,0x65fc,0x65d3,0x65aa,0x6582,0x655a,0x6532
+ .value 0x650a,0x64e2,0x64ba,0x6493,0x646b,0x6444,0x641c,0x63f5
+ .value 0x63ce,0x63a7,0x6381,0x635a,0x6333,0x630d,0x62e7,0x62c1
+ .value 0x629a,0x6275,0x624f,0x6229,0x6203,0x61de,0x61b8,0x6193
+ .value 0x616e,0x6149,0x6124,0x60ff,0x60da,0x60b6,0x6091,0x606d
+ .value 0x6049,0x6024,0x6000,0x5fdc,0x5fb8,0x5f95,0x5f71,0x5f4d
+ .value 0x5f2a,0x5f07,0x5ee3,0x5ec0,0x5e9d,0x5e7a,0x5e57,0x5e35
+ .value 0x5e12,0x5def,0x5dcd,0x5dab,0x5d88,0x5d66,0x5d44,0x5d22
+ .value 0x5d00,0x5cde,0x5cbd,0x5c9b,0x5c7a,0x5c58,0x5c37,0x5c16
+ .value 0x5bf5,0x5bd4,0x5bb3,0x5b92,0x5b71,0x5b51,0x5b30,0x5b10
+ .value 0x5aef,0x5acf,0x5aaf,0x5a8f,0x5a6f,0x5a4f,0x5a2f,0x5a0f
+ .value 0x59ef,0x59d0,0x59b0,0x5991,0x5972,0x5952,0x5933,0x5914
+ .value 0x58f5,0x58d6,0x58b7,0x5899,0x587a,0x585b,0x583d,0x581f
+ .value 0x5800,0x57e2,0x57c4,0x57a6,0x5788,0x576a,0x574c,0x572e
+ .value 0x5711,0x56f3,0x56d5,0x56b8,0x569b,0x567d,0x5660,0x5643
+ .value 0x5626,0x5609,0x55ec,0x55cf,0x55b2,0x5596,0x5579,0x555d
+ .value 0x5540,0x5524,0x5507,0x54eb,0x54cf,0x54b3,0x5497,0x547b
+ .value 0x545f,0x5443,0x5428,0x540c,0x53f0,0x53d5,0x53b9,0x539e
+ .value 0x5383,0x5368,0x534c,0x5331,0x5316,0x52fb,0x52e0,0x52c6
+ .value 0x52ab,0x5290,0x5276,0x525b,0x5240,0x5226,0x520c,0x51f1
+ .value 0x51d7,0x51bd,0x51a3,0x5189,0x516f,0x5155,0x513b,0x5121
+ .value 0x5108,0x50ee,0x50d5,0x50bb,0x50a2,0x5088,0x506f,0x5056
+ .value 0x503c,0x5023,0x500a,0x4ff1,0x4fd8,0x4fbf,0x4fa6,0x4f8e
+ .value 0x4f75,0x4f5c,0x4f44,0x4f2b,0x4f13,0x4efa,0x4ee2,0x4eca
+ .value 0x4eb1,0x4e99,0x4e81,0x4e69,0x4e51,0x4e39,0x4e21,0x4e09
+ .value 0x4df1,0x4dda,0x4dc2,0x4daa,0x4d93,0x4d7b,0x4d64,0x4d4d
+ .value 0x4d35,0x4d1e,0x4d07,0x4cf0,0x4cd8,0x4cc1,0x4caa,0x4c93
+ .value 0x4c7d,0x4c66,0x4c4f,0x4c38,0x4c21,0x4c0b,0x4bf4,0x4bde
+ .value 0x4bc7,0x4bb1,0x4b9a,0x4b84,0x4b6e,0x4b58,0x4b41,0x4b2b
+ .value 0x4b15,0x4aff,0x4ae9,0x4ad3,0x4abd,0x4aa8,0x4a92,0x4a7c
+ .value 0x4a66,0x4a51,0x4a3b,0x4a26,0x4a10,0x49fb,0x49e5,0x49d0
+ .value 0x49bb,0x49a6,0x4990,0x497b,0x4966,0x4951,0x493c,0x4927
+ .value 0x4912,0x48fe,0x48e9,0x48d4,0x48bf,0x48ab,0x4896,0x4881
+ .value 0x486d,0x4858,0x4844,0x482f,0x481b,0x4807,0x47f3,0x47de
+ .value 0x47ca,0x47b6,0x47a2,0x478e,0x477a,0x4766,0x4752,0x473e
+ .value 0x472a,0x4717,0x4703,0x46ef,0x46db,0x46c8,0x46b4,0x46a1
+ .value 0x468d,0x467a,0x4666,0x4653,0x4640,0x462c,0x4619,0x4606
+ .value 0x45f3,0x45e0,0x45cd,0x45ba,0x45a7,0x4594,0x4581,0x456e
+ .value 0x455b,0x4548,0x4536,0x4523,0x4510,0x44fe,0x44eb,0x44d8
+ .value 0x44c6,0x44b3,0x44a1,0x448f,0x447c,0x446a,0x4458,0x4445
+ .value 0x4433,0x4421,0x440f,0x43fd,0x43eb,0x43d9,0x43c7,0x43b5
+ .value 0x43a3,0x4391,0x437f,0x436d,0x435c,0x434a,0x4338,0x4327
+ .value 0x4315,0x4303,0x42f2,0x42e0,0x42cf,0x42bd,0x42ac,0x429b
+ .value 0x4289,0x4278,0x4267,0x4256,0x4244,0x4233,0x4222,0x4211
+ .value 0x4200,0x41ef,0x41de,0x41cd,0x41bc,0x41ab,0x419a,0x418a
+ .value 0x4179,0x4168,0x4157,0x4147,0x4136,0x4125,0x4115,0x4104
+ .value 0x40f4,0x40e3,0x40d3,0x40c2,0x40b2,0x40a2,0x4091,0x4081
+ .value 0x4071,0x4061,0x4050,0x4040,0x4030,0x4020,0x4010,0x4000
+END_OBJECT(approx_tab)
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k7/mmx/com.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k7/mmx/com.asm
new file mode 100644
index 00000000000..a258c224f12
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k7/mmx/com.asm
@@ -0,0 +1,125 @@
+dnl AMD Athlon mpn_com -- mpn bitwise one's complement.
+
+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 K7: 1.0 cycles/limb
+
+
+C void mpn_com (mp_ptr dst, mp_srcptr src, mp_size_t size);
+C
+C The loop form below is necessary for the claimed speed. It needs to be
+C aligned to a 16 byte boundary and only 16 bytes long. Maybe that's so it
+C fits in a BTB entry. The adjustments to %eax and %edx avoid offsets on
+C the movq's and achieve the necessary size.
+C
+C If both src and dst are 4mod8, the loop runs at 1.5 c/l. So long as one
+C of the two is 0mod8, it runs at 1.0 c/l. On that basis dst is checked
+C (offset by the size, as per the loop addressing) and one high limb
+C processed separately to get alignment.
+C
+C The padding for the nails case is unattractive, but shouldn't cost any
+C cycles. Explicit .byte's guarantee the desired instructions, at a point
+C where we're probably stalled waiting for loads anyway.
+C
+C Enhancements:
+C
+C The combination load/pxor/store might be able to be unrolled to approach
+C 0.5 c/l if desired.
+
+defframe(PARAM_SIZE,12)
+defframe(PARAM_SRC, 8)
+defframe(PARAM_DST, 4)
+
+ TEXT
+ ALIGN(16)
+
+PROLOGUE(mpn_com)
+deflit(`FRAME',0)
+
+ movl PARAM_DST, %edx
+ movl PARAM_SIZE, %ecx
+ pcmpeqd %mm7, %mm7
+
+ leal (%edx,%ecx,4), %eax
+ andl $4, %eax
+ifelse(GMP_NAIL_BITS,0,,
+` psrld $GMP_NAIL_BITS, %mm7') C GMP_NUMB_MASK
+
+ movl PARAM_SRC, %eax
+ movd -4(%eax,%ecx,4), %mm0 C src high limb
+
+ifelse(GMP_NAIL_BITS,0,,
+` C padding for alignment below
+ .byte 0x8d, 0xb6, 0x00, 0x00, 0x00, 0x00 C lea 0(%esi),%esi
+ .byte 0x8d, 0xbf, 0x00, 0x00, 0x00, 0x00 C lea 0(%edi),%edi
+')
+
+ jz L(aligned)
+
+ pxor %mm7, %mm0
+ movd %mm0, -4(%edx,%ecx,4) C dst high limb
+ decl %ecx
+ jz L(done)
+L(aligned):
+
+ addl $4, %eax
+ addl $4, %edx
+ decl %ecx
+ jz L(one)
+
+ C offset 0x30 for no nails, or 0x40 for nails
+ ALIGN(16)
+L(top):
+ C eax src
+ C ebx
+ C ecx counter
+ C edx dst
+
+ subl $2, %ecx
+ movq (%eax,%ecx,4), %mm0
+ pxor %mm7, %mm0
+ movq %mm0, (%edx,%ecx,4)
+ jg L(top)
+
+ jnz L(done) C if size even
+
+L(one):
+ movd -4(%eax), %mm0 C src low limb
+ pxor %mm7, %mm0
+ movd %mm0, -4(%edx) C dst low limb
+
+L(done):
+ emms
+
+ ret
+
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k7/mmx/copyd.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k7/mmx/copyd.asm
new file mode 100644
index 00000000000..59ece40920b
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k7/mmx/copyd.asm
@@ -0,0 +1,144 @@
+dnl AMD K7 mpn_copyd -- copy limb vector, decrementing.
+
+dnl Copyright 1999, 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 alignment dst/src, A=0mod8 N=4mod8
+C A/A A/N N/A N/N
+C K7 0.75 1.0 1.0 0.75
+
+
+C void mpn_copyd (mp_ptr dst, mp_srcptr src, mp_size_t size);
+C
+C The various comments in mpn/x86/k7/copyi.asm apply here too.
+
+defframe(PARAM_SIZE,12)
+defframe(PARAM_SRC, 8)
+defframe(PARAM_DST, 4)
+deflit(`FRAME',0)
+
+dnl parameter space reused
+define(SAVE_EBX,`PARAM_SIZE')
+define(SAVE_ESI,`PARAM_SRC')
+
+dnl minimum 5 since the unrolled code can't handle less than 5
+deflit(UNROLL_THRESHOLD, 5)
+
+ TEXT
+ ALIGN(32)
+PROLOGUE(mpn_copyd)
+
+ movl PARAM_SIZE, %ecx
+ movl %ebx, SAVE_EBX
+
+ movl PARAM_SRC, %eax
+ movl PARAM_DST, %edx
+
+ cmpl $UNROLL_THRESHOLD, %ecx
+ jae L(unroll)
+
+ orl %ecx, %ecx
+ jz L(simple_done)
+
+L(simple):
+ C eax src
+ C ebx scratch
+ C ecx counter
+ C edx dst
+ C
+ C this loop is 2 cycles/limb
+
+ movl -4(%eax,%ecx,4), %ebx
+ movl %ebx, -4(%edx,%ecx,4)
+ decl %ecx
+ jnz L(simple)
+
+L(simple_done):
+ movl SAVE_EBX, %ebx
+ ret
+
+
+L(unroll):
+ movl %esi, SAVE_ESI
+ leal (%eax,%ecx,4), %ebx
+ leal (%edx,%ecx,4), %esi
+
+ andl %esi, %ebx
+ movl SAVE_ESI, %esi
+ subl $4, %ecx C size-4
+
+ testl $4, %ebx C testl to pad code closer to 16 bytes for L(top)
+ jz L(aligned)
+
+ C both src and dst unaligned, process one limb to align them
+ movl 12(%eax,%ecx,4), %ebx
+ movl %ebx, 12(%edx,%ecx,4)
+ decl %ecx
+L(aligned):
+
+
+ ALIGN(16)
+L(top):
+ C eax src
+ C ebx
+ C ecx counter, limbs
+ C edx dst
+
+ movq 8(%eax,%ecx,4), %mm0
+ movq (%eax,%ecx,4), %mm1
+ subl $4, %ecx
+ movq %mm0, 16+8(%edx,%ecx,4)
+ movq %mm1, 16(%edx,%ecx,4)
+ jns L(top)
+
+
+ C now %ecx is -4 to -1 representing respectively 0 to 3 limbs remaining
+
+ testb $2, %cl
+ jz L(finish_not_two)
+
+ movq 8(%eax,%ecx,4), %mm0
+ movq %mm0, 8(%edx,%ecx,4)
+L(finish_not_two):
+
+ testb $1, %cl
+ jz L(done)
+
+ movl (%eax), %ebx
+ movl %ebx, (%edx)
+
+L(done):
+ movl SAVE_EBX, %ebx
+ emms
+ ret
+
+
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k7/mmx/copyi.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k7/mmx/copyi.asm
new file mode 100644
index 00000000000..9a28f927ec9
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k7/mmx/copyi.asm
@@ -0,0 +1,157 @@
+dnl AMD K7 mpn_copyi -- copy limb vector, incrementing.
+
+dnl Copyright 1999, 2000, 2002, 2003 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 alignment dst/src, A=0mod8 N=4mod8
+C A/A A/N N/A N/N
+C K7 0.75 1.0 1.0 0.75
+
+
+C void mpn_copyi (mp_ptr dst, mp_srcptr src, mp_size_t size);
+C
+C Copy src,size to dst,size.
+C
+C This code at 0.75 or 1.0 c/l is always faster than a plain rep movsl at
+C 1.33 c/l.
+C
+C The K7 can do a 64-bit load and 64-bit store in one cycle (optimization
+C guile 22007 appendix B), so 0.5 c/l should be possible, however nothing
+C under 0.7 c/l is known. Apparently only two 32-bit stores can be done in
+C one cycle, so perhaps some scheduling is needed to ensure it's a
+C load+store in each cycle, not store+store.
+C
+C If both source and destination are unaligned then one limb is processed at
+C the start to make them aligned and so get 0.75 c/l, whereas if they'd been
+C used unaligned it would be 1.5 c/l.
+
+defframe(PARAM_SIZE,12)
+defframe(PARAM_SRC, 8)
+defframe(PARAM_DST, 4)
+
+dnl parameter space reused
+define(SAVE_EBX,`PARAM_SIZE')
+
+dnl minimum 5 since the unrolled code can't handle less than 5
+deflit(UNROLL_THRESHOLD, 5)
+
+ TEXT
+ ALIGN(32)
+PROLOGUE(mpn_copyi)
+deflit(`FRAME',0)
+
+ movl PARAM_SIZE, %ecx
+ movl %ebx, SAVE_EBX
+
+ movl PARAM_SRC, %eax
+ movl PARAM_DST, %edx
+
+ cmpl $UNROLL_THRESHOLD, %ecx
+ jae L(unroll)
+
+ orl %ecx, %ecx
+ jz L(simple_done)
+
+L(simple):
+ C eax src, incrementing
+ C ebx scratch
+ C ecx counter
+ C edx dst, incrementing
+ C
+ C this loop is 2 cycles/limb
+
+ movl (%eax), %ebx
+ movl %ebx, (%edx)
+ decl %ecx
+ leal 4(%eax), %eax
+ leal 4(%edx), %edx
+ jnz L(simple)
+
+L(simple_done):
+ movl SAVE_EBX, %ebx
+ ret
+
+
+L(unroll):
+ movl %eax, %ebx
+ leal -12(%eax,%ecx,4), %eax C src end - 12
+ subl $3, %ecx C size-3
+
+ andl %edx, %ebx
+ leal (%edx,%ecx,4), %edx C dst end - 12
+ negl %ecx
+
+ testl $4, %ebx C testl to pad code closer to 16 bytes for L(top)
+ jz L(aligned)
+
+ C both src and dst unaligned, process one limb to align them
+ movl (%eax,%ecx,4), %ebx
+ movl %ebx, (%edx,%ecx,4)
+ incl %ecx
+L(aligned):
+
+
+ ALIGN(16)
+L(top):
+ C eax src end - 12
+ C ebx
+ C ecx counter, negative, limbs
+ C edx dst end - 12
+
+ movq (%eax,%ecx,4), %mm0
+ movq 8(%eax,%ecx,4), %mm1
+ addl $4, %ecx
+ movq %mm0, -16(%edx,%ecx,4)
+ movq %mm1, -16+8(%edx,%ecx,4)
+ ja L(top) C jump no carry and not zero
+
+
+ C now %ecx is 0 to 3 representing respectively 3 to 0 limbs remaining
+
+ testb $2, %cl
+ jnz L(finish_not_two)
+
+ movq (%eax,%ecx,4), %mm0
+ movq %mm0, (%edx,%ecx,4)
+L(finish_not_two):
+
+ testb $1, %cl
+ jnz L(done)
+
+ movl 8(%eax), %ebx
+ movl %ebx, 8(%edx)
+
+L(done):
+ movl SAVE_EBX, %ebx
+ emms
+ ret
+
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k7/mmx/divrem_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k7/mmx/divrem_1.asm
new file mode 100644
index 00000000000..cf343280bbd
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k7/mmx/divrem_1.asm
@@ -0,0 +1,832 @@
+dnl AMD K7 mpn_divrem_1, mpn_divrem_1c, mpn_preinv_divrem_1 -- mpn by limb
+dnl division.
+
+dnl Copyright 1999-2002, 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 K7: 17.0 cycles/limb integer part, 15.0 cycles/limb fraction part.
+
+
+C mp_limb_t mpn_divrem_1 (mp_ptr dst, mp_size_t xsize,
+C mp_srcptr src, mp_size_t size,
+C mp_limb_t divisor);
+C mp_limb_t mpn_divrem_1c (mp_ptr dst, mp_size_t xsize,
+C mp_srcptr src, mp_size_t size,
+C mp_limb_t divisor, mp_limb_t carry);
+C mp_limb_t mpn_preinv_divrem_1 (mp_ptr dst, mp_size_t xsize,
+C mp_srcptr src, mp_size_t size,
+C mp_limb_t divisor, mp_limb_t inverse,
+C unsigned shift);
+C
+C Algorithm:
+C
+C The method and nomenclature follow part 8 of "Division by Invariant
+C Integers using Multiplication" by Granlund and Montgomery, reference in
+C gmp.texi.
+C
+C The "and"s shown in the paper are done here with "cmov"s. "m" is written
+C for m', and "d" for d_norm, which won't cause any confusion since it's
+C only the normalized divisor that's of any use in the code. "b" is written
+C for 2^N, the size of a limb, N being 32 here.
+C
+C The step "sdword dr = n - 2^N*d + (2^N-1-q1) * d" is instead done as
+C "n-(q1+1)*d"; this rearrangement gives the same two-limb answer. If
+C q1==0xFFFFFFFF, then q1+1 would overflow. We branch to a special case
+C "q1_ff" if this occurs. Since the true quotient is either q1 or q1+1 then
+C if q1==0xFFFFFFFF that must be the right value.
+C
+C For the last and second last steps q1==0xFFFFFFFF is instead handled by an
+C sbbl to go back to 0xFFFFFFFF if an overflow occurs when adding 1. This
+C then goes through as normal, and finding no addback required. sbbl costs
+C an extra cycle over what the main loop code does, but it keeps code size
+C and complexity down.
+C
+C Notes:
+C
+C mpn_divrem_1 and mpn_preinv_divrem_1 avoid one division if the src high
+C limb is less than the divisor. mpn_divrem_1c doesn't check for a zero
+C carry, since in normal circumstances that will be a very rare event.
+C
+C The test for skipping a division is branch free (once size>=1 is tested).
+C The store to the destination high limb is 0 when a divide is skipped, or
+C if it's not skipped then a copy of the src high limb is used. The latter
+C is in case src==dst.
+C
+C There's a small bias towards expecting xsize==0, by having code for
+C xsize==0 in a straight line and xsize!=0 under forward jumps.
+C
+C Alternatives:
+C
+C If the divisor is normalized (high bit set) then a division step can
+C always be skipped, since the high destination limb is always 0 or 1 in
+C that case. It doesn't seem worth checking for this though, since it
+C probably occurs infrequently, in particular note that big_base for a
+C decimal mpn_get_str is not normalized in a 32-bit limb.
+
+
+dnl MUL_THRESHOLD is the value of xsize+size at which the multiply by
+dnl inverse method is used, rather than plain "divl"s. Minimum value 1.
+dnl
+dnl The inverse takes about 50 cycles to calculate, but after that the
+dnl multiply is 17 c/l versus division at 42 c/l.
+dnl
+dnl At 3 limbs the mul is a touch faster than div on the integer part, and
+dnl even more so on the fractional part.
+
+deflit(MUL_THRESHOLD, 3)
+
+
+defframe(PARAM_PREINV_SHIFT, 28) dnl mpn_preinv_divrem_1
+defframe(PARAM_PREINV_INVERSE, 24) dnl mpn_preinv_divrem_1
+defframe(PARAM_CARRY, 24) dnl mpn_divrem_1c
+defframe(PARAM_DIVISOR,20)
+defframe(PARAM_SIZE, 16)
+defframe(PARAM_SRC, 12)
+defframe(PARAM_XSIZE, 8)
+defframe(PARAM_DST, 4)
+
+defframe(SAVE_EBX, -4)
+defframe(SAVE_ESI, -8)
+defframe(SAVE_EDI, -12)
+defframe(SAVE_EBP, -16)
+
+defframe(VAR_NORM, -20)
+defframe(VAR_INVERSE, -24)
+defframe(VAR_SRC, -28)
+defframe(VAR_DST, -32)
+defframe(VAR_DST_STOP,-36)
+
+deflit(STACK_SPACE, 36)
+
+ TEXT
+ ALIGN(32)
+
+PROLOGUE(mpn_preinv_divrem_1)
+deflit(`FRAME',0)
+ movl PARAM_XSIZE, %ecx
+ movl PARAM_DST, %edx
+ subl $STACK_SPACE, %esp FRAME_subl_esp(STACK_SPACE)
+
+ movl %esi, SAVE_ESI
+ movl PARAM_SRC, %esi
+
+ movl %ebx, SAVE_EBX
+ movl PARAM_SIZE, %ebx
+
+ leal 8(%edx,%ecx,4), %edx C &dst[xsize+2]
+ movl %ebp, SAVE_EBP
+ movl PARAM_DIVISOR, %ebp
+
+ movl %edx, VAR_DST_STOP C &dst[xsize+2]
+ movl %edi, SAVE_EDI
+ xorl %edi, %edi C carry
+
+ movl -4(%esi,%ebx,4), %eax C src high limb
+ xor %ecx, %ecx
+
+ C
+
+ C
+
+ cmpl %ebp, %eax C high cmp divisor
+
+ cmovc( %eax, %edi) C high is carry if high<divisor
+ cmovnc( %eax, %ecx) C 0 if skip div, src high if not
+ C (the latter in case src==dst)
+
+ movl %ecx, -12(%edx,%ebx,4) C dst high limb
+ sbbl $0, %ebx C skip one division if high<divisor
+ movl PARAM_PREINV_SHIFT, %ecx
+
+ leal -8(%edx,%ebx,4), %edx C &dst[xsize+size]
+ movl $32, %eax
+
+ movl %edx, VAR_DST C &dst[xsize+size]
+
+ shll %cl, %ebp C d normalized
+ subl %ecx, %eax
+ movl %ecx, VAR_NORM
+
+ movd %eax, %mm7 C rshift
+ movl PARAM_PREINV_INVERSE, %eax
+ jmp L(start_preinv)
+
+EPILOGUE()
+
+
+ ALIGN(16)
+
+PROLOGUE(mpn_divrem_1c)
+deflit(`FRAME',0)
+ movl PARAM_CARRY, %edx
+ movl PARAM_SIZE, %ecx
+ subl $STACK_SPACE, %esp
+deflit(`FRAME',STACK_SPACE)
+
+ movl %ebx, SAVE_EBX
+ movl PARAM_XSIZE, %ebx
+
+ movl %edi, SAVE_EDI
+ movl PARAM_DST, %edi
+
+ movl %ebp, SAVE_EBP
+ movl PARAM_DIVISOR, %ebp
+
+ movl %esi, SAVE_ESI
+ movl PARAM_SRC, %esi
+
+ leal -4(%edi,%ebx,4), %edi C &dst[xsize-1]
+ jmp L(start_1c)
+
+EPILOGUE()
+
+
+ C offset 0xa1, close enough to aligned
+PROLOGUE(mpn_divrem_1)
+deflit(`FRAME',0)
+
+ movl PARAM_SIZE, %ecx
+ movl $0, %edx C initial carry (if can't skip a div)
+ subl $STACK_SPACE, %esp
+deflit(`FRAME',STACK_SPACE)
+
+ movl %esi, SAVE_ESI
+ movl PARAM_SRC, %esi
+
+ movl %ebx, SAVE_EBX
+ movl PARAM_XSIZE, %ebx
+
+ movl %ebp, SAVE_EBP
+ movl PARAM_DIVISOR, %ebp
+ orl %ecx, %ecx C size
+
+ movl %edi, SAVE_EDI
+ movl PARAM_DST, %edi
+ leal -4(%edi,%ebx,4), %edi C &dst[xsize-1]
+
+ jz L(no_skip_div) C if size==0
+ movl -4(%esi,%ecx,4), %eax C src high limb
+ xorl %esi, %esi
+
+ cmpl %ebp, %eax C high cmp divisor
+
+ cmovc( %eax, %edx) C high is carry if high<divisor
+ cmovnc( %eax, %esi) C 0 if skip div, src high if not
+
+ movl %esi, (%edi,%ecx,4) C dst high limb
+ sbbl $0, %ecx C size-1 if high<divisor
+ movl PARAM_SRC, %esi C reload
+L(no_skip_div):
+
+
+L(start_1c):
+ C eax
+ C ebx xsize
+ C ecx size
+ C edx carry
+ C esi src
+ C edi &dst[xsize-1]
+ C ebp divisor
+
+ leal (%ebx,%ecx), %eax C size+xsize
+ cmpl $MUL_THRESHOLD, %eax
+ jae L(mul_by_inverse)
+
+
+C With MUL_THRESHOLD set to 3, the simple loops here only do 0 to 2 limbs.
+C It'd be possible to write them out without the looping, but no speedup
+C would be expected.
+C
+C Using PARAM_DIVISOR instead of %ebp measures 1 cycle/loop faster on the
+C integer part, but curiously not on the fractional part, where %ebp is a
+C (fixed) couple of cycles faster.
+
+ orl %ecx, %ecx
+ jz L(divide_no_integer)
+
+L(divide_integer):
+ C eax scratch (quotient)
+ C ebx xsize
+ C ecx counter
+ C edx scratch (remainder)
+ C esi src
+ C edi &dst[xsize-1]
+ C ebp divisor
+
+ movl -4(%esi,%ecx,4), %eax
+
+ divl PARAM_DIVISOR
+
+ movl %eax, (%edi,%ecx,4)
+ decl %ecx
+ jnz L(divide_integer)
+
+
+L(divide_no_integer):
+ movl PARAM_DST, %edi
+ orl %ebx, %ebx
+ jnz L(divide_fraction)
+
+L(divide_done):
+ movl SAVE_ESI, %esi
+ movl SAVE_EDI, %edi
+ movl %edx, %eax
+
+ movl SAVE_EBX, %ebx
+ movl SAVE_EBP, %ebp
+ addl $STACK_SPACE, %esp
+
+ ret
+
+
+L(divide_fraction):
+ C eax scratch (quotient)
+ C ebx counter
+ C ecx
+ C edx scratch (remainder)
+ C esi
+ C edi dst
+ C ebp divisor
+
+ movl $0, %eax
+
+ divl %ebp
+
+ movl %eax, -4(%edi,%ebx,4)
+ decl %ebx
+ jnz L(divide_fraction)
+
+ jmp L(divide_done)
+
+
+
+C -----------------------------------------------------------------------------
+
+L(mul_by_inverse):
+ C eax
+ C ebx xsize
+ C ecx size
+ C edx carry
+ C esi src
+ C edi &dst[xsize-1]
+ C ebp divisor
+
+ bsrl %ebp, %eax C 31-l
+
+ leal 12(%edi), %ebx C &dst[xsize+2], loop dst stop
+ leal 4(%edi,%ecx,4), %edi C &dst[xsize+size]
+
+ movl %edi, VAR_DST
+ movl %ebx, VAR_DST_STOP
+
+ movl %ecx, %ebx C size
+ movl $31, %ecx
+
+ movl %edx, %edi C carry
+ movl $-1, %edx
+
+ C
+
+ xorl %eax, %ecx C l
+ incl %eax C 32-l
+
+ shll %cl, %ebp C d normalized
+ movl %ecx, VAR_NORM
+
+ movd %eax, %mm7
+
+ movl $-1, %eax
+ subl %ebp, %edx C (b-d)-1 giving edx:eax = b*(b-d)-1
+
+ divl %ebp C floor (b*(b-d)-1) / d
+
+L(start_preinv):
+ C eax inverse
+ C ebx size
+ C ecx shift
+ C edx
+ C esi src
+ C edi carry
+ C ebp divisor
+ C
+ C mm7 rshift
+
+ orl %ebx, %ebx C size
+ movl %eax, VAR_INVERSE
+ leal -12(%esi,%ebx,4), %eax C &src[size-3]
+
+ jz L(start_zero)
+ movl %eax, VAR_SRC
+ cmpl $1, %ebx
+
+ movl 8(%eax), %esi C src high limb
+ jz L(start_one)
+
+L(start_two_or_more):
+ movl 4(%eax), %edx C src second highest limb
+
+ shldl( %cl, %esi, %edi) C n2 = carry,high << l
+
+ shldl( %cl, %edx, %esi) C n10 = high,second << l
+
+ cmpl $2, %ebx
+ je L(integer_two_left)
+ jmp L(integer_top)
+
+
+L(start_one):
+ shldl( %cl, %esi, %edi) C n2 = carry,high << l
+
+ shll %cl, %esi C n10 = high << l
+ movl %eax, VAR_SRC
+ jmp L(integer_one_left)
+
+
+L(start_zero):
+ C Can be here with xsize==0 if mpn_preinv_divrem_1 had size==1 and
+ C skipped a division.
+
+ shll %cl, %edi C n2 = carry << l
+ movl %edi, %eax C return value for zero_done
+ cmpl $0, PARAM_XSIZE
+
+ je L(zero_done)
+ jmp L(fraction_some)
+
+
+
+C -----------------------------------------------------------------------------
+C
+C The multiply by inverse loop is 17 cycles, and relies on some out-of-order
+C execution. The instruction scheduling is important, with various
+C apparently equivalent forms running 1 to 5 cycles slower.
+C
+C A lower bound for the time would seem to be 16 cycles, based on the
+C following successive dependencies.
+C
+C cycles
+C n2+n1 1
+C mul 6
+C q1+1 1
+C mul 6
+C sub 1
+C addback 1
+C ---
+C 16
+C
+C This chain is what the loop has already, but 16 cycles isn't achieved.
+C K7 has enough decode, and probably enough execute (depending maybe on what
+C a mul actually consumes), but nothing running under 17 has been found.
+C
+C In theory n2+n1 could be done in the sub and addback stages (by
+C calculating both n2 and n2+n1 there), but lack of registers makes this an
+C unlikely proposition.
+C
+C The jz in the loop keeps the q1+1 stage to 1 cycle. Handling an overflow
+C from q1+1 with an "sbbl $0, %ebx" would add a cycle to the dependent
+C chain, and nothing better than 18 cycles has been found when using it.
+C The jump is taken only when q1 is 0xFFFFFFFF, and on random data this will
+C be an extremely rare event.
+C
+C Branch mispredictions will hit random occurrences of q1==0xFFFFFFFF, but
+C if some special data is coming out with this always, the q1_ff special
+C case actually runs at 15 c/l. 0x2FFF...FFFD divided by 3 is a good way to
+C induce the q1_ff case, for speed measurements or testing. Note that
+C 0xFFF...FFF divided by 1 or 2 doesn't induce it.
+C
+C The instruction groupings and empty comments show the cycles for a naive
+C in-order view of the code (conveniently ignoring the load latency on
+C VAR_INVERSE). This shows some of where the time is going, but is nonsense
+C to the extent that out-of-order execution rearranges it. In this case
+C there's 19 cycles shown, but it executes at 17.
+
+ ALIGN(16)
+L(integer_top):
+ C eax scratch
+ C ebx scratch (nadj, q1)
+ C ecx scratch (src, dst)
+ C edx scratch
+ C esi n10
+ C edi n2
+ C ebp divisor
+ C
+ C mm0 scratch (src qword)
+ C mm7 rshift for normalization
+
+ cmpl $0x80000000, %esi C n1 as 0=c, 1=nc
+ movl %edi, %eax C n2
+ movl VAR_SRC, %ecx
+
+ leal (%ebp,%esi), %ebx
+ cmovc( %esi, %ebx) C nadj = n10 + (-n1 & d), ignoring overflow
+ sbbl $-1, %eax C n2+n1
+
+ mull VAR_INVERSE C m*(n2+n1)
+
+ movq (%ecx), %mm0 C next limb and the one below it
+ subl $4, %ecx
+
+ movl %ecx, VAR_SRC
+
+ C
+
+ addl %ebx, %eax C m*(n2+n1) + nadj, low giving carry flag
+ leal 1(%edi), %ebx C n2+1
+ movl %ebp, %eax C d
+
+ C
+
+ adcl %edx, %ebx C 1 + high(n2<<32 + m*(n2+n1) + nadj) = q1+1
+ jz L(q1_ff)
+ movl VAR_DST, %ecx
+
+ mull %ebx C (q1+1)*d
+
+ psrlq %mm7, %mm0
+
+ leal -4(%ecx), %ecx
+
+ C
+
+ subl %eax, %esi
+ movl VAR_DST_STOP, %eax
+
+ C
+
+ sbbl %edx, %edi C n - (q1+1)*d
+ movl %esi, %edi C remainder -> n2
+ leal (%ebp,%esi), %edx
+
+ movd %mm0, %esi
+
+ cmovc( %edx, %edi) C n - q1*d if underflow from using q1+1
+ sbbl $0, %ebx C q
+ cmpl %eax, %ecx
+
+ movl %ebx, (%ecx)
+ movl %ecx, VAR_DST
+ jne L(integer_top)
+
+
+L(integer_loop_done):
+
+
+C -----------------------------------------------------------------------------
+C
+C Here, and in integer_one_left below, an sbbl $0 is used rather than a jz
+C q1_ff special case. This make the code a bit smaller and simpler, and
+C costs only 1 cycle (each).
+
+L(integer_two_left):
+ C eax scratch
+ C ebx scratch (nadj, q1)
+ C ecx scratch (src, dst)
+ C edx scratch
+ C esi n10
+ C edi n2
+ C ebp divisor
+ C
+ C mm7 rshift
+
+ cmpl $0x80000000, %esi C n1 as 0=c, 1=nc
+ movl %edi, %eax C n2
+ movl PARAM_SRC, %ecx
+
+ leal (%ebp,%esi), %ebx
+ cmovc( %esi, %ebx) C nadj = n10 + (-n1 & d), ignoring overflow
+ sbbl $-1, %eax C n2+n1
+
+ mull VAR_INVERSE C m*(n2+n1)
+
+ movd (%ecx), %mm0 C src low limb
+
+ movl VAR_DST_STOP, %ecx
+
+ C
+
+ addl %ebx, %eax C m*(n2+n1) + nadj, low giving carry flag
+ leal 1(%edi), %ebx C n2+1
+ movl %ebp, %eax C d
+
+ adcl %edx, %ebx C 1 + high(n2<<32 + m*(n2+n1) + nadj) = q1+1
+
+ sbbl $0, %ebx
+
+ mull %ebx C (q1+1)*d
+
+ psllq $32, %mm0
+
+ psrlq %mm7, %mm0
+
+ C
+
+ subl %eax, %esi
+
+ C
+
+ sbbl %edx, %edi C n - (q1+1)*d
+ movl %esi, %edi C remainder -> n2
+ leal (%ebp,%esi), %edx
+
+ movd %mm0, %esi
+
+ cmovc( %edx, %edi) C n - q1*d if underflow from using q1+1
+ sbbl $0, %ebx C q
+
+ movl %ebx, -4(%ecx)
+
+
+C -----------------------------------------------------------------------------
+L(integer_one_left):
+ C eax scratch
+ C ebx scratch (nadj, q1)
+ C ecx dst
+ C edx scratch
+ C esi n10
+ C edi n2
+ C ebp divisor
+ C
+ C mm7 rshift
+
+ movl VAR_DST_STOP, %ecx
+ cmpl $0x80000000, %esi C n1 as 0=c, 1=nc
+ movl %edi, %eax C n2
+
+ leal (%ebp,%esi), %ebx
+ cmovc( %esi, %ebx) C nadj = n10 + (-n1 & d), ignoring overflow
+ sbbl $-1, %eax C n2+n1
+
+ mull VAR_INVERSE C m*(n2+n1)
+
+ C
+
+ C
+
+ C
+
+ addl %ebx, %eax C m*(n2+n1) + nadj, low giving carry flag
+ leal 1(%edi), %ebx C n2+1
+ movl %ebp, %eax C d
+
+ C
+
+ adcl %edx, %ebx C 1 + high(n2<<32 + m*(n2+n1) + nadj) = q1+1
+
+ sbbl $0, %ebx C q1 if q1+1 overflowed
+
+ mull %ebx
+
+ C
+
+ C
+
+ C
+
+ subl %eax, %esi
+
+ C
+
+ sbbl %edx, %edi C n - (q1+1)*d
+ movl %esi, %edi C remainder -> n2
+ leal (%ebp,%esi), %edx
+
+ cmovc( %edx, %edi) C n - q1*d if underflow from using q1+1
+ sbbl $0, %ebx C q
+
+ movl %ebx, -8(%ecx)
+ subl $8, %ecx
+
+
+
+L(integer_none):
+ cmpl $0, PARAM_XSIZE
+ jne L(fraction_some)
+
+ movl %edi, %eax
+L(fraction_done):
+ movl VAR_NORM, %ecx
+L(zero_done):
+ movl SAVE_EBP, %ebp
+
+ movl SAVE_EDI, %edi
+ movl SAVE_ESI, %esi
+
+ movl SAVE_EBX, %ebx
+ addl $STACK_SPACE, %esp
+
+ shrl %cl, %eax
+ emms
+
+ ret
+
+
+C -----------------------------------------------------------------------------
+C
+C Special case for q1=0xFFFFFFFF, giving q=0xFFFFFFFF meaning the low dword
+C of q*d is simply -d and the remainder n-q*d = n10+d
+
+L(q1_ff):
+ C eax (divisor)
+ C ebx (q1+1 == 0)
+ C ecx
+ C edx
+ C esi n10
+ C edi n2
+ C ebp divisor
+
+ movl VAR_DST, %ecx
+ movl VAR_DST_STOP, %edx
+ subl $4, %ecx
+
+ psrlq %mm7, %mm0
+ leal (%ebp,%esi), %edi C n-q*d remainder -> next n2
+ movl %ecx, VAR_DST
+
+ movd %mm0, %esi C next n10
+
+ movl $-1, (%ecx)
+ cmpl %ecx, %edx
+ jne L(integer_top)
+
+ jmp L(integer_loop_done)
+
+
+
+C -----------------------------------------------------------------------------
+C
+C Being the fractional part, the "source" limbs are all zero, meaning
+C n10=0, n1=0, and hence nadj=0, leading to many instructions eliminated.
+C
+C The loop runs at 15 cycles. The dependent chain is the same as the
+C general case above, but without the n2+n1 stage (due to n1==0), so 15
+C would seem to be the lower bound.
+C
+C A not entirely obvious simplification is that q1+1 never overflows a limb,
+C and so there's no need for the sbbl $0 or jz q1_ff from the general case.
+C q1 is the high word of m*n2+b*n2 and the following shows q1<=b-2 always.
+C rnd() means rounding down to a multiple of d.
+C
+C m*n2 + b*n2 <= m*(d-1) + b*(d-1)
+C = m*d + b*d - m - b
+C = floor((b(b-d)-1)/d)*d + b*d - m - b
+C = rnd(b(b-d)-1) + b*d - m - b
+C = rnd(b(b-d)-1 + b*d) - m - b
+C = rnd(b*b-1) - m - b
+C <= (b-2)*b
+C
+C Unchanged from the general case is that the final quotient limb q can be
+C either q1 or q1+1, and the q1+1 case occurs often. This can be seen from
+C equation 8.4 of the paper which simplifies as follows when n1==0 and
+C n0==0.
+C
+C n-q1*d = (n2*k+q0*d)/b <= d + (d*d-2d)/b
+C
+C As before, the instruction groupings and empty comments show a naive
+C in-order view of the code, which is made a nonsense by out of order
+C execution. There's 17 cycles shown, but it executes at 15.
+C
+C Rotating the store q and remainder->n2 instructions up to the top of the
+C loop gets the run time down from 16 to 15.
+
+ ALIGN(16)
+L(fraction_some):
+ C eax
+ C ebx
+ C ecx
+ C edx
+ C esi
+ C edi carry
+ C ebp divisor
+
+ movl PARAM_DST, %esi
+ movl VAR_DST_STOP, %ecx C &dst[xsize+2]
+ movl %edi, %eax
+
+ subl $8, %ecx C &dst[xsize]
+ jmp L(fraction_entry)
+
+
+ ALIGN(16)
+L(fraction_top):
+ C eax n2 carry, then scratch
+ C ebx scratch (nadj, q1)
+ C ecx dst, decrementing
+ C edx scratch
+ C esi dst stop point
+ C edi (will be n2)
+ C ebp divisor
+
+ movl %ebx, (%ecx) C previous q
+ movl %eax, %edi C remainder->n2
+
+L(fraction_entry):
+ mull VAR_INVERSE C m*n2
+
+ movl %ebp, %eax C d
+ subl $4, %ecx C dst
+ leal 1(%edi), %ebx
+
+ C
+
+ C
+
+ C
+
+ C
+
+ addl %edx, %ebx C 1 + high(n2<<32 + m*n2) = q1+1
+
+ mull %ebx C (q1+1)*d
+
+ C
+
+ C
+
+ C
+
+ negl %eax C low of n - (q1+1)*d
+
+ C
+
+ sbbl %edx, %edi C high of n - (q1+1)*d, caring only about carry
+ leal (%ebp,%eax), %edx
+
+ cmovc( %edx, %eax) C n - q1*d if underflow from using q1+1
+ sbbl $0, %ebx C q
+ cmpl %esi, %ecx
+
+ jne L(fraction_top)
+
+
+ movl %ebx, (%ecx)
+ jmp L(fraction_done)
+
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k7/mmx/lshift.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k7/mmx/lshift.asm
new file mode 100644
index 00000000000..b3383cf2c30
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k7/mmx/lshift.asm
@@ -0,0 +1,481 @@
+dnl AMD K7 mpn_lshift -- mpn left shift.
+
+dnl Copyright 1999-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 K7: 1.21 cycles/limb (at 16 limbs/loop).
+
+
+
+dnl K7: UNROLL_COUNT cycles/limb
+dnl 4 1.51
+dnl 8 1.26
+dnl 16 1.21
+dnl 32 1.2
+dnl Maximum possible with the current code is 64.
+
+deflit(UNROLL_COUNT, 16)
+
+
+C mp_limb_t mpn_lshift (mp_ptr dst, mp_srcptr src, mp_size_t size,
+C unsigned shift);
+C
+C Shift src,size left by shift many bits and store the result in dst,size.
+C Zeros are shifted in at the right. The bits shifted out at the left are
+C the return value.
+C
+C The comments in mpn_rshift apply here too.
+
+ifdef(`PIC',`
+deflit(UNROLL_THRESHOLD, 10)
+',`
+deflit(UNROLL_THRESHOLD, 10)
+')
+
+defframe(PARAM_SHIFT,16)
+defframe(PARAM_SIZE, 12)
+defframe(PARAM_SRC, 8)
+defframe(PARAM_DST, 4)
+
+defframe(SAVE_EDI, -4)
+defframe(SAVE_ESI, -8)
+defframe(SAVE_EBX, -12)
+deflit(SAVE_SIZE, 12)
+
+ TEXT
+ ALIGN(32)
+
+PROLOGUE(mpn_lshift)
+deflit(`FRAME',0)
+
+ movl PARAM_SIZE, %eax
+ movl PARAM_SRC, %edx
+ subl $SAVE_SIZE, %esp
+deflit(`FRAME',SAVE_SIZE)
+
+ movl PARAM_SHIFT, %ecx
+ movl %edi, SAVE_EDI
+
+ movl PARAM_DST, %edi
+ decl %eax
+ jnz L(more_than_one_limb)
+
+ movl (%edx), %edx
+
+ shldl( %cl, %edx, %eax) C eax was decremented to zero
+
+ shll %cl, %edx
+
+ movl %edx, (%edi)
+ movl SAVE_EDI, %edi
+ addl $SAVE_SIZE, %esp
+
+ ret
+
+
+C -----------------------------------------------------------------------------
+L(more_than_one_limb):
+ C eax size-1
+ C ebx
+ C ecx shift
+ C edx src
+ C esi
+ C edi dst
+ C ebp
+
+ movd PARAM_SHIFT, %mm6
+ movd (%edx,%eax,4), %mm5 C src high limb
+ cmp $UNROLL_THRESHOLD-1, %eax
+
+ jae L(unroll)
+ negl %ecx
+ movd (%edx), %mm4 C src low limb
+
+ addl $32, %ecx
+
+ movd %ecx, %mm7
+
+L(simple_top):
+ C eax loop counter, limbs
+ C ebx
+ C ecx
+ C edx src
+ C esi
+ C edi dst
+ C ebp
+ C
+ C mm0 scratch
+ C mm4 src low limb
+ C mm5 src high limb
+ C mm6 shift
+ C mm7 32-shift
+
+ movq -4(%edx,%eax,4), %mm0
+ decl %eax
+
+ psrlq %mm7, %mm0
+
+ movd %mm0, 4(%edi,%eax,4)
+ jnz L(simple_top)
+
+
+ psllq %mm6, %mm5
+ psllq %mm6, %mm4
+
+ psrlq $32, %mm5
+ movd %mm4, (%edi) C dst low limb
+
+ movd %mm5, %eax C return value
+
+ movl SAVE_EDI, %edi
+ addl $SAVE_SIZE, %esp
+ emms
+
+ ret
+
+
+C -----------------------------------------------------------------------------
+ ALIGN(16)
+L(unroll):
+ C eax size-1
+ C ebx (saved)
+ C ecx shift
+ C edx src
+ C esi
+ C edi dst
+ C ebp
+ C
+ C mm5 src high limb, for return value
+ C mm6 lshift
+
+ movl %esi, SAVE_ESI
+ movl %ebx, SAVE_EBX
+ leal -4(%edx,%eax,4), %edx C &src[size-2]
+
+ testb $4, %dl
+ movq (%edx), %mm1 C src high qword
+
+ jz L(start_src_aligned)
+
+
+ C src isn't aligned, process high limb (marked xxx) separately to
+ C make it so
+ C
+ C source -4(edx,%eax,4)
+ C |
+ C +-------+-------+-------+--
+ C | xxx |
+ C +-------+-------+-------+--
+ C 0mod8 4mod8 0mod8
+ C
+ C dest -4(edi,%eax,4)
+ C |
+ C +-------+-------+--
+ C | xxx | |
+ C +-------+-------+--
+
+ psllq %mm6, %mm1
+ subl $4, %edx
+ movl %eax, PARAM_SIZE C size-1
+
+ psrlq $32, %mm1
+ decl %eax C size-2 is new size-1
+
+ movd %mm1, 4(%edi,%eax,4)
+ movq (%edx), %mm1 C new src high qword
+L(start_src_aligned):
+
+
+ leal -4(%edi,%eax,4), %edi C &dst[size-2]
+ psllq %mm6, %mm5
+
+ testl $4, %edi
+ psrlq $32, %mm5 C return value
+
+ jz L(start_dst_aligned)
+
+
+ C dst isn't aligned, subtract 4 bytes to make it so, and pretend the
+ C shift is 32 bits extra. High limb of dst (marked xxx) handled
+ C here separately.
+ C
+ C source %edx
+ C +-------+-------+--
+ C | mm1 |
+ C +-------+-------+--
+ C 0mod8 4mod8
+ C
+ C dest %edi
+ C +-------+-------+-------+--
+ C | xxx |
+ C +-------+-------+-------+--
+ C 0mod8 4mod8 0mod8
+
+ movq %mm1, %mm0
+ psllq %mm6, %mm1
+ addl $32, %ecx C shift+32
+
+ psrlq $32, %mm1
+
+ movd %mm1, 4(%edi)
+ movq %mm0, %mm1
+ subl $4, %edi
+
+ movd %ecx, %mm6 C new lshift
+L(start_dst_aligned):
+
+ decl %eax C size-2, two last limbs handled at end
+ movq %mm1, %mm2 C copy of src high qword
+ negl %ecx
+
+ andl $-2, %eax C round size down to even
+ addl $64, %ecx
+
+ movl %eax, %ebx
+ negl %eax
+
+ andl $UNROLL_MASK, %eax
+ decl %ebx
+
+ shll %eax
+
+ movd %ecx, %mm7 C rshift = 64-lshift
+
+ifdef(`PIC',`
+ call L(pic_calc)
+L(here):
+',`
+ leal L(entry) (%eax,%eax,4), %esi
+')
+ shrl $UNROLL_LOG2, %ebx C loop counter
+
+ leal ifelse(UNROLL_BYTES,256,128) -8(%edx,%eax,2), %edx
+ leal ifelse(UNROLL_BYTES,256,128) (%edi,%eax,2), %edi
+ movl PARAM_SIZE, %eax C for use at end
+ jmp *%esi
+
+
+ifdef(`PIC',`
+L(pic_calc):
+ C See mpn/x86/README about old gas bugs
+ leal (%eax,%eax,4), %esi
+ addl $L(entry)-L(here), %esi
+ addl (%esp), %esi
+
+ ret_internal
+')
+
+
+C -----------------------------------------------------------------------------
+ ALIGN(32)
+L(top):
+ C eax size (for use at end)
+ C ebx loop counter
+ C ecx rshift
+ C edx src
+ C esi computed jump
+ C edi dst
+ C ebp
+ C
+ C mm0 scratch
+ C mm1 \ carry (alternating, mm2 first)
+ C mm2 /
+ C mm6 lshift
+ C mm7 rshift
+ C
+ C 10 code bytes/limb
+ C
+ C The two chunks differ in whether mm1 or mm2 hold the carry.
+ C The computed jump puts the initial carry in both mm1 and mm2.
+
+L(entry):
+deflit(CHUNK_COUNT, 4)
+forloop(i, 0, UNROLL_COUNT/CHUNK_COUNT-1, `
+ deflit(`disp0', eval(-i*CHUNK_COUNT*4 ifelse(UNROLL_BYTES,256,-128)))
+ deflit(`disp1', eval(disp0 - 8))
+
+Zdisp( movq, disp0,(%edx), %mm0)
+ psllq %mm6, %mm2
+
+ movq %mm0, %mm1
+ psrlq %mm7, %mm0
+
+ por %mm2, %mm0
+Zdisp( movq, %mm0, disp0,(%edi))
+
+
+Zdisp( movq, disp1,(%edx), %mm0)
+ psllq %mm6, %mm1
+
+ movq %mm0, %mm2
+ psrlq %mm7, %mm0
+
+ por %mm1, %mm0
+Zdisp( movq, %mm0, disp1,(%edi))
+')
+
+ subl $UNROLL_BYTES, %edx
+ subl $UNROLL_BYTES, %edi
+ decl %ebx
+
+ jns L(top)
+
+
+
+define(`disp', `m4_empty_if_zero(eval($1 ifelse(UNROLL_BYTES,256,-128)))')
+
+L(end):
+ testb $1, %al
+ movl SAVE_EBX, %ebx
+ psllq %mm6, %mm2 C wanted left shifted in all cases below
+
+ movd %mm5, %eax
+
+ movl SAVE_ESI, %esi
+ jz L(end_even)
+
+
+L(end_odd):
+
+ C Size odd, destination was aligned.
+ C
+ C source edx+8 edx+4
+ C --+---------------+-------+
+ C | mm2 | |
+ C --+---------------+-------+
+ C
+ C dest edi
+ C --+---------------+---------------+-------+
+ C | written | | |
+ C --+---------------+---------------+-------+
+ C
+ C mm6 = shift
+ C mm7 = ecx = 64-shift
+
+
+ C Size odd, destination was unaligned.
+ C
+ C source edx+8 edx+4
+ C --+---------------+-------+
+ C | mm2 | |
+ C --+---------------+-------+
+ C
+ C dest edi
+ C --+---------------+---------------+
+ C | written | |
+ C --+---------------+---------------+
+ C
+ C mm6 = shift+32
+ C mm7 = ecx = 64-(shift+32)
+
+
+ C In both cases there's one extra limb of src to fetch and combine
+ C with mm2 to make a qword at (%edi), and in the aligned case
+ C there's an extra limb of dst to be formed from that extra src limb
+ C left shifted.
+
+ movd disp(4) (%edx), %mm0
+ testb $32, %cl
+
+ movq %mm0, %mm1
+ psllq $32, %mm0
+
+ psrlq %mm7, %mm0
+ psllq %mm6, %mm1
+
+ por %mm2, %mm0
+
+ movq %mm0, disp(0) (%edi)
+ jz L(end_odd_unaligned)
+ movd %mm1, disp(-4) (%edi)
+L(end_odd_unaligned):
+
+ movl SAVE_EDI, %edi
+ addl $SAVE_SIZE, %esp
+ emms
+
+ ret
+
+
+L(end_even):
+
+ C Size even, destination was aligned.
+ C
+ C source edx+8
+ C --+---------------+
+ C | mm2 |
+ C --+---------------+
+ C
+ C dest edi
+ C --+---------------+---------------+
+ C | written | |
+ C --+---------------+---------------+
+ C
+ C mm6 = shift
+ C mm7 = ecx = 64-shift
+
+
+ C Size even, destination was unaligned.
+ C
+ C source edx+8
+ C --+---------------+
+ C | mm2 |
+ C --+---------------+
+ C
+ C dest edi+4
+ C --+---------------+-------+
+ C | written | |
+ C --+---------------+-------+
+ C
+ C mm6 = shift+32
+ C mm7 = ecx = 64-(shift+32)
+
+
+ C The movq for the aligned case overwrites the movd for the
+ C unaligned case.
+
+ movq %mm2, %mm0
+ psrlq $32, %mm2
+
+ testb $32, %cl
+ movd %mm2, disp(4) (%edi)
+
+ jz L(end_even_unaligned)
+ movq %mm0, disp(0) (%edi)
+L(end_even_unaligned):
+
+ movl SAVE_EDI, %edi
+ addl $SAVE_SIZE, %esp
+ emms
+
+ ret
+
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k7/mmx/popham.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k7/mmx/popham.asm
new file mode 100644
index 00000000000..95965b74d40
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k7/mmx/popham.asm
@@ -0,0 +1,213 @@
+dnl AMD K7 mpn_popcount, mpn_hamdist -- population count and hamming
+dnl distance.
+
+dnl Copyright 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 popcount hamdist
+C P3 generic 6.5 7
+C P3 model 9 (Banias) 5.7 6.1
+C P3 model 13 (Dothan) 5.75 6
+C K7 5 6
+
+C unsigned long mpn_popcount (mp_srcptr src, mp_size_t size);
+C unsigned long mpn_hamdist (mp_srcptr src, mp_srcptr src2, mp_size_t size);
+C
+C The code here is almost certainly not optimal, but is already a 3x speedup
+C over the generic C code. The main improvement would be to interleave
+C processing of two qwords in the loop so as to fully exploit the available
+C execution units, possibly leading to 3.25 c/l (13 cycles for 4 limbs).
+C
+C The loop is based on the example "Efficient 64-bit population count using
+C MMX instructions" in the Athlon Optimization Guide, AMD document 22007,
+C page 158 of rev E (reference in mpn/x86/k7/README).
+
+ifdef(`OPERATION_popcount',,
+`ifdef(`OPERATION_hamdist',,
+`m4_error(`Need OPERATION_popcount or OPERATION_hamdist defined
+')')')
+
+define(HAM,
+m4_assert_numargs(1)
+`ifdef(`OPERATION_hamdist',`$1')')
+
+define(POP,
+m4_assert_numargs(1)
+`ifdef(`OPERATION_popcount',`$1')')
+
+HAM(`
+defframe(PARAM_SIZE, 12)
+defframe(PARAM_SRC2, 8)
+defframe(PARAM_SRC, 4)
+define(M4_function,mpn_hamdist)
+')
+POP(`
+defframe(PARAM_SIZE, 8)
+defframe(PARAM_SRC, 4)
+define(M4_function,mpn_popcount)
+')
+
+MULFUNC_PROLOGUE(mpn_popcount mpn_hamdist)
+
+
+ifdef(`PIC',,`
+ dnl non-PIC
+
+ RODATA
+ ALIGN(8)
+
+L(rodata_AAAAAAAAAAAAAAAA):
+ .long 0xAAAAAAAA
+ .long 0xAAAAAAAA
+
+L(rodata_3333333333333333):
+ .long 0x33333333
+ .long 0x33333333
+
+L(rodata_0F0F0F0F0F0F0F0F):
+ .long 0x0F0F0F0F
+ .long 0x0F0F0F0F
+')
+
+ TEXT
+ ALIGN(32)
+
+PROLOGUE(M4_function)
+deflit(`FRAME',0)
+
+ movl PARAM_SIZE, %ecx
+
+ifdef(`PIC',`
+ movl $0xAAAAAAAA, %eax
+ movl $0x33333333, %edx
+
+ movd %eax, %mm7
+ movd %edx, %mm6
+
+ movl $0x0F0F0F0F, %eax
+
+ punpckldq %mm7, %mm7
+ punpckldq %mm6, %mm6
+
+ movd %eax, %mm5
+ movd %edx, %mm4
+
+ punpckldq %mm5, %mm5
+
+',`
+ movq L(rodata_AAAAAAAAAAAAAAAA), %mm7
+ movq L(rodata_3333333333333333), %mm6
+ movq L(rodata_0F0F0F0F0F0F0F0F), %mm5
+')
+ pxor %mm4, %mm4
+
+define(REG_AAAAAAAAAAAAAAAA,%mm7)
+define(REG_3333333333333333,%mm6)
+define(REG_0F0F0F0F0F0F0F0F,%mm5)
+define(REG_0000000000000000,%mm4)
+
+
+ movl PARAM_SRC, %eax
+HAM(` movl PARAM_SRC2, %edx')
+
+ pxor %mm2, %mm2 C total
+
+ shrl %ecx
+ jnc L(top)
+
+ movd (%eax,%ecx,8), %mm1
+
+HAM(` movd (%edx,%ecx,8), %mm0
+ pxor %mm0, %mm1
+')
+ orl %ecx, %ecx
+ jmp L(loaded)
+
+
+ ALIGN(16)
+L(top):
+ C eax src
+ C ebx
+ C ecx counter, qwords, decrementing
+ C edx [hamdist] src2
+ C
+ C mm0 (scratch)
+ C mm1 (scratch)
+ C mm2 total (low dword)
+ C mm3
+ C mm4 \
+ C mm5 | special constants
+ C mm6 |
+ C mm7 /
+
+ movq -8(%eax,%ecx,8), %mm1
+
+HAM(` pxor -8(%edx,%ecx,8), %mm1')
+ decl %ecx
+
+L(loaded):
+ movq %mm1, %mm0
+ pand REG_AAAAAAAAAAAAAAAA, %mm1
+
+ psrlq $1, %mm1
+
+ psubd %mm1, %mm0 C bit pairs
+
+
+ movq %mm0, %mm1
+ psrlq $2, %mm0
+
+ pand REG_3333333333333333, %mm0
+ pand REG_3333333333333333, %mm1
+
+ paddd %mm1, %mm0 C nibbles
+
+
+ movq %mm0, %mm1
+ psrlq $4, %mm0
+
+ pand REG_0F0F0F0F0F0F0F0F, %mm0
+ pand REG_0F0F0F0F0F0F0F0F, %mm1
+
+ paddd %mm1, %mm0 C bytes
+
+
+ psadbw( %mm4, %mm0)
+
+ paddd %mm0, %mm2 C add to total
+ jnz L(top)
+
+
+ movd %mm2, %eax
+ emms
+ ret
+
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k7/mmx/rshift.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k7/mmx/rshift.asm
new file mode 100644
index 00000000000..345d23a25e3
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k7/mmx/rshift.asm
@@ -0,0 +1,480 @@
+dnl AMD K7 mpn_rshift -- mpn right shift.
+
+dnl Copyright 1999-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 K7: 1.21 cycles/limb (at 16 limbs/loop).
+
+
+
+dnl K7: UNROLL_COUNT cycles/limb
+dnl 4 1.51
+dnl 8 1.26
+dnl 16 1.21
+dnl 32 1.2
+dnl Maximum possible with the current code is 64.
+
+deflit(UNROLL_COUNT, 16)
+
+
+C mp_limb_t mpn_rshift (mp_ptr dst, mp_srcptr src, mp_size_t size,
+C unsigned shift);
+C
+C Shift src,size right by shift many bits and store the result in dst,size.
+C Zeros are shifted in at the left. The bits shifted out at the right are
+C the return value.
+C
+C This code uses 64-bit MMX operations, which makes it possible to handle
+C two limbs at a time, for a theoretical 1.0 cycles/limb. Plain integer
+C code, on the other hand, suffers from shrd being a vector path decode and
+C running at 3 cycles back-to-back.
+C
+C Full speed depends on source and destination being aligned, and some hairy
+C setups and finish-ups are done to arrange this for the loop.
+
+ifdef(`PIC',`
+deflit(UNROLL_THRESHOLD, 10)
+',`
+deflit(UNROLL_THRESHOLD, 10)
+')
+
+defframe(PARAM_SHIFT,16)
+defframe(PARAM_SIZE, 12)
+defframe(PARAM_SRC, 8)
+defframe(PARAM_DST, 4)
+
+defframe(SAVE_EDI, -4)
+defframe(SAVE_ESI, -8)
+defframe(SAVE_EBX, -12)
+deflit(SAVE_SIZE, 12)
+
+ TEXT
+ ALIGN(32)
+
+PROLOGUE(mpn_rshift)
+deflit(`FRAME',0)
+
+ movl PARAM_SIZE, %eax
+ movl PARAM_SRC, %edx
+ subl $SAVE_SIZE, %esp
+deflit(`FRAME',SAVE_SIZE)
+
+ movl PARAM_SHIFT, %ecx
+ movl %edi, SAVE_EDI
+
+ movl PARAM_DST, %edi
+ decl %eax
+ jnz L(more_than_one_limb)
+
+ movl (%edx), %edx C src limb
+
+ shrdl( %cl, %edx, %eax) C eax was decremented to zero
+
+ shrl %cl, %edx
+
+ movl %edx, (%edi) C dst limb
+ movl SAVE_EDI, %edi
+ addl $SAVE_SIZE, %esp
+
+ ret
+
+
+C -----------------------------------------------------------------------------
+L(more_than_one_limb):
+ C eax size-1
+ C ebx
+ C ecx shift
+ C edx src
+ C esi
+ C edi dst
+ C ebp
+
+ movd PARAM_SHIFT, %mm6 C rshift
+ movd (%edx), %mm5 C src low limb
+ cmp $UNROLL_THRESHOLD-1, %eax
+
+ jae L(unroll)
+ leal (%edx,%eax,4), %edx C &src[size-1]
+ leal -4(%edi,%eax,4), %edi C &dst[size-2]
+
+ movd (%edx), %mm4 C src high limb
+ negl %eax
+
+
+L(simple_top):
+ C eax loop counter, limbs, negative
+ C ebx
+ C ecx shift
+ C edx carry
+ C edx &src[size-1]
+ C edi &dst[size-2]
+ C ebp
+ C
+ C mm0 scratch
+ C mm4 src high limb
+ C mm5 src low limb
+ C mm6 shift
+
+ movq (%edx,%eax,4), %mm0
+ incl %eax
+
+ psrlq %mm6, %mm0
+
+ movd %mm0, (%edi,%eax,4)
+ jnz L(simple_top)
+
+
+ psllq $32, %mm5
+ psrlq %mm6, %mm4
+
+ psrlq %mm6, %mm5
+ movd %mm4, 4(%edi) C dst high limb
+
+ movd %mm5, %eax C return value
+
+ movl SAVE_EDI, %edi
+ addl $SAVE_SIZE, %esp
+ emms
+
+ ret
+
+
+C -----------------------------------------------------------------------------
+ ALIGN(16)
+L(unroll):
+ C eax size-1
+ C ebx
+ C ecx shift
+ C edx src
+ C esi
+ C edi dst
+ C ebp
+ C
+ C mm5 src low limb
+ C mm6 rshift
+
+ testb $4, %dl
+ movl %esi, SAVE_ESI
+ movl %ebx, SAVE_EBX
+
+ psllq $32, %mm5
+ jz L(start_src_aligned)
+
+
+ C src isn't aligned, process low limb separately (marked xxx) and
+ C step src and dst by one limb, making src aligned.
+ C
+ C source edx
+ C --+-------+-------+-------+
+ C | xxx |
+ C --+-------+-------+-------+
+ C 4mod8 0mod8 4mod8
+ C
+ C dest edi
+ C --+-------+-------+
+ C | | xxx |
+ C --+-------+-------+
+
+ movq (%edx), %mm0 C src low two limbs
+ addl $4, %edx
+ movl %eax, PARAM_SIZE C size-1
+
+ addl $4, %edi
+ decl %eax C size-2 is new size-1
+
+ psrlq %mm6, %mm0
+ movl %edi, PARAM_DST C new dst
+
+ movd %mm0, -4(%edi)
+L(start_src_aligned):
+
+
+ movq (%edx), %mm1 C src low two limbs
+ decl %eax C size-2, two last limbs handled at end
+ testl $4, %edi
+
+ psrlq %mm6, %mm5
+ jz L(start_dst_aligned)
+
+
+ C dst isn't aligned, add 4 to make it so, and pretend the shift is
+ C 32 bits extra. Low limb of dst (marked xxx) handled here separately.
+ C
+ C source edx
+ C --+-------+-------+
+ C | mm1 |
+ C --+-------+-------+
+ C 4mod8 0mod8
+ C
+ C dest edi
+ C --+-------+-------+-------+
+ C | xxx |
+ C --+-------+-------+-------+
+ C 4mod8 0mod8 4mod8
+
+ movq %mm1, %mm0
+ psrlq %mm6, %mm1
+ addl $32, %ecx C shift+32
+
+ movd %mm1, (%edi)
+ movq %mm0, %mm1
+ addl $4, %edi C new dst
+
+ movd %ecx, %mm6
+L(start_dst_aligned):
+
+
+ movq %mm1, %mm2 C copy of src low two limbs
+ negl %ecx
+ andl $-2, %eax C round size down to even
+
+ movl %eax, %ebx
+ negl %eax
+ addl $64, %ecx
+
+ andl $UNROLL_MASK, %eax
+ decl %ebx
+
+ shll %eax
+
+ movd %ecx, %mm7 C lshift = 64-rshift
+
+ifdef(`PIC',`
+ call L(pic_calc)
+L(here):
+',`
+ leal L(entry) (%eax,%eax,4), %esi
+ negl %eax
+')
+ shrl $UNROLL_LOG2, %ebx C loop counter
+
+ leal ifelse(UNROLL_BYTES,256,128+) 8(%edx,%eax,2), %edx
+ leal ifelse(UNROLL_BYTES,256,128) (%edi,%eax,2), %edi
+ movl PARAM_SIZE, %eax C for use at end
+
+ jmp *%esi
+
+
+ifdef(`PIC',`
+L(pic_calc):
+ C See mpn/x86/README about old gas bugs
+ leal (%eax,%eax,4), %esi
+ addl $L(entry)-L(here), %esi
+ addl (%esp), %esi
+ negl %eax
+
+ ret_internal
+')
+
+
+C -----------------------------------------------------------------------------
+ ALIGN(64)
+L(top):
+ C eax size, for use at end
+ C ebx loop counter
+ C ecx lshift
+ C edx src
+ C esi was computed jump
+ C edi dst
+ C ebp
+ C
+ C mm0 scratch
+ C mm1 \ carry (alternating)
+ C mm2 /
+ C mm6 rshift
+ C mm7 lshift
+ C
+ C 10 code bytes/limb
+ C
+ C The two chunks differ in whether mm1 or mm2 hold the carry.
+ C The computed jump puts the initial carry in both mm1 and mm2.
+
+L(entry):
+deflit(CHUNK_COUNT, 4)
+forloop(i, 0, UNROLL_COUNT/CHUNK_COUNT-1, `
+ deflit(`disp0', eval(i*CHUNK_COUNT*4 ifelse(UNROLL_BYTES,256,-128)))
+ deflit(`disp1', eval(disp0 + 8))
+
+Zdisp( movq, disp0,(%edx), %mm0)
+ psrlq %mm6, %mm2
+
+ movq %mm0, %mm1
+ psllq %mm7, %mm0
+
+ por %mm2, %mm0
+Zdisp( movq, %mm0, disp0,(%edi))
+
+
+Zdisp( movq, disp1,(%edx), %mm0)
+ psrlq %mm6, %mm1
+
+ movq %mm0, %mm2
+ psllq %mm7, %mm0
+
+ por %mm1, %mm0
+Zdisp( movq, %mm0, disp1,(%edi))
+')
+
+ addl $UNROLL_BYTES, %edx
+ addl $UNROLL_BYTES, %edi
+ decl %ebx
+
+ jns L(top)
+
+
+deflit(`disp0', ifelse(UNROLL_BYTES,256,-128))
+deflit(`disp1', eval(disp0-0 + 8))
+
+ testb $1, %al
+ psrlq %mm6, %mm2 C wanted rshifted in all cases below
+ movl SAVE_ESI, %esi
+
+ movd %mm5, %eax C return value
+
+ movl SAVE_EBX, %ebx
+ jz L(end_even)
+
+
+ C Size odd, destination was aligned.
+ C
+ C source
+ C edx
+ C +-------+---------------+--
+ C | | mm2 |
+ C +-------+---------------+--
+ C
+ C dest edi
+ C +-------+---------------+---------------+--
+ C | | | written |
+ C +-------+---------------+---------------+--
+ C
+ C mm6 = shift
+ C mm7 = ecx = 64-shift
+
+
+ C Size odd, destination was unaligned.
+ C
+ C source
+ C edx
+ C +-------+---------------+--
+ C | | mm2 |
+ C +-------+---------------+--
+ C
+ C dest edi
+ C +---------------+---------------+--
+ C | | written |
+ C +---------------+---------------+--
+ C
+ C mm6 = shift+32
+ C mm7 = ecx = 64-(shift+32)
+
+
+ C In both cases there's one extra limb of src to fetch and combine
+ C with mm2 to make a qword to store, and in the aligned case there's
+ C a further extra limb of dst to be formed.
+
+
+ movd disp0(%edx), %mm0
+ movq %mm0, %mm1
+
+ psllq %mm7, %mm0
+ testb $32, %cl
+
+ por %mm2, %mm0
+ psrlq %mm6, %mm1
+
+ movq %mm0, disp0(%edi)
+ jz L(finish_odd_unaligned)
+
+ movd %mm1, disp1(%edi)
+L(finish_odd_unaligned):
+
+ movl SAVE_EDI, %edi
+ addl $SAVE_SIZE, %esp
+ emms
+
+ ret
+
+
+L(end_even):
+
+ C Size even, destination was aligned.
+ C
+ C source
+ C +---------------+--
+ C | mm2 |
+ C +---------------+--
+ C
+ C dest edi
+ C +---------------+---------------+--
+ C | | mm3 |
+ C +---------------+---------------+--
+ C
+ C mm6 = shift
+ C mm7 = ecx = 64-shift
+
+
+ C Size even, destination was unaligned.
+ C
+ C source
+ C +---------------+--
+ C | mm2 |
+ C +---------------+--
+ C
+ C dest edi
+ C +-------+---------------+--
+ C | | mm3 |
+ C +-------+---------------+--
+ C
+ C mm6 = shift+32
+ C mm7 = 64-(shift+32)
+
+
+ C The movd for the unaligned case is the same data as the movq for
+ C the aligned case, it's just a choice between whether one or two
+ C limbs should be written.
+
+
+ testb $32, %cl
+ movd %mm2, disp0(%edi)
+
+ jz L(end_even_unaligned)
+
+ movq %mm2, disp0(%edi)
+L(end_even_unaligned):
+
+ movl SAVE_EDI, %edi
+ addl $SAVE_SIZE, %esp
+ emms
+
+ ret
+
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k7/mod_1_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k7/mod_1_1.asm
new file mode 100644
index 00000000000..1bbe6f92d76
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k7/mod_1_1.asm
@@ -0,0 +1,221 @@
+dnl x86-32 mpn_mod_1_1p, requiring cmov.
+
+dnl Contributed to the GNU project by Niels Möller and Torbjorn Granlund.
+
+dnl Copyright 2010, 2011 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 P5 ?
+C P6 model 0-8,10-12 ?
+C P6 model 9 (Banias) ?
+C P6 model 13 (Dothan) ?
+C P4 model 0 (Willamette) ?
+C P4 model 1 (?) ?
+C P4 model 2 (Northwood) ?
+C P4 model 3 (Prescott) ?
+C P4 model 4 (Nocona) ?
+C AMD K6 ?
+C AMD K7 7
+C AMD K8 ?
+
+define(`B2mb', `%ebx')
+define(`r0', `%esi')
+define(`r2', `%ebp')
+define(`t0', `%edi')
+define(`ap', `%ecx') C Also shift count
+
+C Stack frame
+C pre 36(%esp)
+C b 32(%esp)
+C n 28(%esp)
+C ap 24(%esp)
+C return 20(%esp)
+C %ebp 16(%esp)
+C %edi 12(%esp)
+C %esi 8(%esp)
+C %ebx 4(%esp)
+C B2mod (%esp)
+
+define(`B2modb', `(%esp)')
+define(`n', `28(%esp)')
+define(`b', `32(%esp)')
+define(`pre', `36(%esp)')
+
+C mp_limb_t
+C mpn_mod_1_1p (mp_srcptr ap, mp_size_t n, mp_limb_t b, mp_limb_t pre[4])
+C
+C The pre array contains bi, cnt, B1modb, B2modb
+C Note: This implementation needs B1modb only when cnt > 0
+
+ASM_START()
+ TEXT
+ ALIGN(8)
+PROLOGUE(mpn_mod_1_1p)
+ push %ebp
+ push %edi
+ push %esi
+ push %ebx
+ mov 32(%esp), %ebp C pre[]
+
+ mov 12(%ebp), %eax C B2modb
+ push %eax C Put it on stack
+
+ mov n, %edx
+ mov 24(%esp), ap
+
+ lea (ap, %edx, 4), ap
+ mov -4(ap), %eax
+ cmp $3, %edx
+ jnc L(first)
+ mov -8(ap), r0
+ jmp L(reduce_two)
+
+L(first):
+ C First iteration, no r2
+ mull B2modb
+ mov -12(ap), r0
+ add %eax, r0
+ mov -8(ap), %eax
+ adc %edx, %eax
+ sbb r2, r2
+ subl $3, n
+ lea -16(ap), ap
+ jz L(reduce_three)
+
+ mov B2modb, B2mb
+ sub b, B2mb
+ lea (B2mb, r0), t0
+ jmp L(mid)
+
+ ALIGN(16)
+L(top): C Loopmixed to 7 c/l on k7
+ add %eax, r0
+ lea (B2mb, r0), t0
+ mov r2, %eax
+ adc %edx, %eax
+ sbb r2, r2
+L(mid): mull B2modb
+ and B2modb, r2
+ add r0, r2
+ decl n
+ mov (ap), r0
+ cmovc( t0, r2)
+ lea -4(ap), ap
+ jnz L(top)
+
+ add %eax, r0
+ mov r2, %eax
+ adc %edx, %eax
+ sbb r2, r2
+
+L(reduce_three):
+ C Eliminate r2
+ and b, r2
+ sub r2, %eax
+
+L(reduce_two):
+ mov pre, %ebp
+ movb 4(%ebp), %cl
+ test %cl, %cl
+ jz L(normalized)
+
+ C Unnormalized, use B1modb to reduce to size < B b
+ mull 8(%ebp)
+ xor t0, t0
+ add %eax, r0
+ adc %edx, t0
+ mov t0, %eax
+
+ C Left-shift to normalize
+ shld %cl, r0, %eax C Always use shld?
+
+ shl %cl, r0
+ jmp L(udiv)
+
+L(normalized):
+ mov %eax, t0
+ sub b, t0
+ cmovnc( t0, %eax)
+
+L(udiv):
+ lea 1(%eax), t0
+ mull (%ebp)
+ mov b, %ebx C Needed in register for lea
+ add r0, %eax
+ adc t0, %edx
+ imul %ebx, %edx
+ sub %edx, r0
+ cmp r0, %eax
+ lea (%ebx, r0), %eax
+ cmovnc( r0, %eax)
+ cmp %ebx, %eax
+ jnc L(fix)
+L(ok): shr %cl, %eax
+
+ add $4, %esp
+ pop %ebx
+ pop %esi
+ pop %edi
+ pop %ebp
+
+ ret
+L(fix): sub %ebx, %eax
+ jmp L(ok)
+EPILOGUE()
+
+PROLOGUE(mpn_mod_1_1p_cps)
+ push %ebp
+ mov 12(%esp), %ebp
+ push %esi
+ bsr %ebp, %ecx
+ push %ebx
+ xor $31, %ecx
+ mov 16(%esp), %esi
+ sal %cl, %ebp
+ mov %ebp, %edx
+ not %edx
+ mov $-1, %eax
+ div %ebp C On K7, invert_limb would be a few cycles faster.
+ mov %eax, (%esi) C store bi
+ mov %ecx, 4(%esi) C store cnt
+ neg %ebp
+ mov $1, %edx
+ shld %cl, %eax, %edx
+ imul %ebp, %edx
+ shr %cl, %edx
+ imul %ebp, %eax
+ mov %edx, 8(%esi) C store B1modb
+ mov %eax, 12(%esi) C store B2modb
+ pop %ebx
+ pop %esi
+ pop %ebp
+ ret
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k7/mod_1_4.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k7/mod_1_4.asm
new file mode 100644
index 00000000000..bb7597edd29
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k7/mod_1_4.asm
@@ -0,0 +1,260 @@
+dnl x86-32 mpn_mod_1s_4p, requiring cmov.
+
+dnl Contributed to the GNU project by Torbjorn Granlund.
+
+dnl Copyright 2009, 2010 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 P5 ?
+C P6 model 0-8,10-12 ?
+C P6 model 9 (Banias) ?
+C P6 model 13 (Dothan) 6
+C P4 model 0 (Willamette) ?
+C P4 model 1 (?) ?
+C P4 model 2 (Northwood) 15.5
+C P4 model 3 (Prescott) ?
+C P4 model 4 (Nocona) ?
+C AMD K6 ?
+C AMD K7 4.75
+C AMD K8 ?
+
+ASM_START()
+ TEXT
+ ALIGN(16)
+PROLOGUE(mpn_mod_1s_4p)
+ push %ebp
+ push %edi
+ push %esi
+ push %ebx
+ sub $28, %esp
+ mov 60(%esp), %edi C cps[]
+ mov 8(%edi), %eax
+ mov 12(%edi), %edx
+ mov 16(%edi), %ecx
+ mov 20(%edi), %esi
+ mov 24(%edi), %edi
+ mov %eax, 4(%esp)
+ mov %edx, 8(%esp)
+ mov %ecx, 12(%esp)
+ mov %esi, 16(%esp)
+ mov %edi, 20(%esp)
+ mov 52(%esp), %eax C n
+ xor %edi, %edi
+ mov 48(%esp), %esi C up
+ lea -12(%esi,%eax,4), %esi
+ and $3, %eax
+ je L(b0)
+ cmp $2, %eax
+ jc L(b1)
+ je L(b2)
+
+L(b3): mov 4(%esi), %eax
+ mull 4(%esp)
+ mov (%esi), %ebp
+ add %eax, %ebp
+ adc %edx, %edi
+ mov 8(%esi), %eax
+ mull 8(%esp)
+ lea -12(%esi), %esi
+ jmp L(m0)
+
+L(b0): mov (%esi), %eax
+ mull 4(%esp)
+ mov -4(%esi), %ebp
+ add %eax, %ebp
+ adc %edx, %edi
+ mov 4(%esi), %eax
+ mull 8(%esp)
+ add %eax, %ebp
+ adc %edx, %edi
+ mov 8(%esi), %eax
+ mull 12(%esp)
+ lea -16(%esi), %esi
+ jmp L(m0)
+
+L(b1): mov 8(%esi), %ebp
+ lea -4(%esi), %esi
+ jmp L(m1)
+
+L(b2): mov 8(%esi), %edi
+ mov 4(%esi), %ebp
+ lea -8(%esi), %esi
+ jmp L(m1)
+
+ ALIGN(16)
+L(top): mov (%esi), %eax
+ mull 4(%esp)
+ mov -4(%esi), %ebx
+ xor %ecx, %ecx
+ add %eax, %ebx
+ adc %edx, %ecx
+ mov 4(%esi), %eax
+ mull 8(%esp)
+ add %eax, %ebx
+ adc %edx, %ecx
+ mov 8(%esi), %eax
+ mull 12(%esp)
+ add %eax, %ebx
+ adc %edx, %ecx
+ lea -16(%esi), %esi
+ mov 16(%esp), %eax
+ mul %ebp
+ add %eax, %ebx
+ adc %edx, %ecx
+ mov 20(%esp), %eax
+ mul %edi
+ mov %ebx, %ebp
+ mov %ecx, %edi
+L(m0): add %eax, %ebp
+ adc %edx, %edi
+L(m1): subl $4, 52(%esp)
+ ja L(top)
+
+L(end): mov 4(%esp), %eax
+ mul %edi
+ mov 60(%esp), %edi
+ add %eax, %ebp
+ adc $0, %edx
+ mov 4(%edi), %ecx
+ mov %edx, %esi
+ mov %ebp, %eax
+ sal %cl, %esi
+ mov %ecx, %ebx
+ neg %ecx
+ shr %cl, %eax
+ or %esi, %eax
+ lea 1(%eax), %esi
+ mull (%edi)
+ mov %ebx, %ecx
+ mov %eax, %ebx
+ mov %ebp, %eax
+ mov 56(%esp), %ebp
+ sal %cl, %eax
+ add %eax, %ebx
+ adc %esi, %edx
+ imul %ebp, %edx
+ sub %edx, %eax
+ lea (%eax,%ebp), %edx
+ cmp %eax, %ebx
+ cmovc( %edx, %eax)
+ mov %eax, %edx
+ sub %ebp, %eax
+ cmovc( %edx, %eax)
+ add $28, %esp
+ pop %ebx
+ pop %esi
+ pop %edi
+ pop %ebp
+ shr %cl, %eax
+ ret
+EPILOGUE()
+
+ ALIGN(16)
+PROLOGUE(mpn_mod_1s_4p_cps)
+C CAUTION: This is the same code as in pentium4/sse2/mod_1_4.asm
+ push %ebp
+ push %edi
+ push %esi
+ push %ebx
+ mov 20(%esp), %ebp C FIXME: avoid bp for 0-idx
+ mov 24(%esp), %ebx
+ bsr %ebx, %ecx
+ xor $31, %ecx
+ sal %cl, %ebx C b << cnt
+ mov %ebx, %edx
+ not %edx
+ mov $-1, %eax
+ div %ebx
+ xor %edi, %edi
+ sub %ebx, %edi
+ mov $1, %esi
+ mov %eax, (%ebp) C store bi
+ mov %ecx, 4(%ebp) C store cnt
+ shld %cl, %eax, %esi
+ imul %edi, %esi
+ mov %eax, %edi
+ mul %esi
+
+ add %esi, %edx
+ shr %cl, %esi
+ mov %esi, 8(%ebp) C store B1modb
+
+ not %edx
+ imul %ebx, %edx
+ lea (%edx,%ebx), %esi
+ cmp %edx, %eax
+ cmovnc( %edx, %esi)
+ mov %edi, %eax
+ mul %esi
+
+ add %esi, %edx
+ shr %cl, %esi
+ mov %esi, 12(%ebp) C store B2modb
+
+ not %edx
+ imul %ebx, %edx
+ lea (%edx,%ebx), %esi
+ cmp %edx, %eax
+ cmovnc( %edx, %esi)
+ mov %edi, %eax
+ mul %esi
+
+ add %esi, %edx
+ shr %cl, %esi
+ mov %esi, 16(%ebp) C store B3modb
+
+ not %edx
+ imul %ebx, %edx
+ lea (%edx,%ebx), %esi
+ cmp %edx, %eax
+ cmovnc( %edx, %esi)
+ mov %edi, %eax
+ mul %esi
+
+ add %esi, %edx
+ shr %cl, %esi
+ mov %esi, 20(%ebp) C store B4modb
+
+ not %edx
+ imul %ebx, %edx
+ add %edx, %ebx
+ cmp %edx, %eax
+ cmovnc( %edx, %ebx)
+
+ shr %cl, %ebx
+ mov %ebx, 24(%ebp) C store B5modb
+
+ pop %ebx
+ pop %esi
+ pop %edi
+ pop %ebp
+ ret
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k7/mod_34lsub1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k7/mod_34lsub1.asm
new file mode 100644
index 00000000000..ee3ad04099d
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k7/mod_34lsub1.asm
@@ -0,0 +1,188 @@
+dnl AMD K7 mpn_mod_34lsub1 -- remainder modulo 2^24-1.
+
+dnl Copyright 2000-2002, 2004, 2005, 2008 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 Athlon: 1
+C Hammer: 1
+
+
+C mp_limb_t mpn_mod_34lsub1 (mp_srcptr src, mp_size_t size)
+C
+C The loop form below and the 64 byte code alignment seem necessary for the
+C claimed speed. This is a bit strange, since normally k7 isn't very
+C sensitive to such things. Perhaps there has to be 6 instructions in the
+C first 16 bytes for the BTB entry or something.
+
+defframe(PARAM_SIZE, 8)
+defframe(PARAM_SRC, 4)
+
+dnl re-use parameter space
+define(SAVE_EDI, `PARAM_SIZE')
+
+ TEXT
+ ALIGN(64)
+PROLOGUE(mpn_mod_34lsub1)
+deflit(`FRAME',0)
+
+ movl PARAM_SIZE, %ecx
+ movl PARAM_SRC, %edx
+
+ subl $2, %ecx
+ ja L(three_or_more)
+
+ movl (%edx), %eax
+ jb L(one)
+
+ movl 4(%edx), %ecx
+ movl %eax, %edx
+ shrl $24, %eax C src[0] low
+
+ andl $0xFFFFFF, %edx C src[0] high
+ addl %edx, %eax
+ movl %ecx, %edx
+
+ andl $0xFFFF, %ecx
+ shrl $16, %edx C src[1] high
+ addl %edx, %eax
+
+ shll $8, %ecx C src[1] low
+ addl %ecx, %eax
+
+L(one):
+ ret
+
+
+L(three_or_more):
+ C eax
+ C ebx
+ C ecx size-2
+ C edx src
+ C esi
+ C edi
+
+ pushl %ebx FRAME_pushl()
+ xorl %eax, %eax
+ xorl %ebx, %ebx
+
+ movl %edi, SAVE_EDI
+ pushl %esi FRAME_pushl()
+ xorl %esi, %esi C and clear carry flag
+
+
+ C code offset 0x40 at this point
+L(top):
+ C eax acc 0mod3
+ C ebx acc 1mod3
+ C ecx counter, limbs
+ C edx src
+ C esi acc 2mod3
+ C edi
+
+ leal 24(%edx), %edx
+ leal -2(%ecx), %ecx
+ adcl -24(%edx), %eax
+ adcl -20(%edx), %ebx
+ adcl -16(%edx), %esi
+
+ decl %ecx
+ jng L(done_loop)
+
+ leal -2(%ecx), %ecx
+ adcl -12(%edx), %eax
+ adcl -8(%edx), %ebx
+ adcl -4(%edx), %esi
+
+ decl %ecx
+ jg L(top)
+
+
+ leal 12(%edx), %edx
+
+
+L(done_loop):
+ C ecx is -2, -1 or 0 representing 0, 1 or 2 more limbs, respectively
+
+ incl %ecx
+ movl $0xFFFFFFFF, %edi
+ js L(combine)
+
+ adcl -12(%edx), %eax
+ decl %ecx
+ movl $0xFFFFFF00, %edi
+ js L(combine)
+
+ adcl -8(%edx), %ebx
+ movl $0xFFFF0000, %edi
+
+
+L(combine):
+ C eax acc 0mod3
+ C ebx acc 1mod3
+ C ecx
+ C edx
+ C esi acc 2mod3
+ C edi mask
+
+ sbbl %ecx, %ecx C carry
+ movl %eax, %edx C 0mod3
+ shrl $24, %eax C 0mod3 high
+
+ andl %edi, %ecx C carry masked
+ andl $0x00FFFFFF, %edx C 0mod3 low
+ movl %ebx, %edi C 1mod3
+
+ subl %ecx, %eax C apply carry
+ shrl $16, %ebx C 1mod3 high
+ andl $0xFFFF, %edi
+
+ addl %edx, %eax C apply 0mod3 low
+ movl %esi, %edx C 2mod3
+ shll $8, %edi C 1mod3 low
+
+ addl %ebx, %eax C apply 1mod3 high
+ shrl $8, %esi C 2mod3 high
+ movzbl %dl, %edx C 2mod3 low
+
+ addl %edi, %eax C apply 1mod3 low
+ shll $16, %edx C 2mod3 low
+
+ addl %esi, %eax C apply 2mod3 high
+ popl %esi FRAME_popl()
+
+ movl SAVE_EDI, %edi
+ addl %edx, %eax C apply 2mod3 low
+ popl %ebx FRAME_popl()
+
+ ret
+
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k7/mode1o.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k7/mode1o.asm
new file mode 100644
index 00000000000..6472ec5949b
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k7/mode1o.asm
@@ -0,0 +1,180 @@
+dnl AMD K7 mpn_modexact_1_odd -- exact division style remainder.
+
+dnl Copyright 2000-2002, 2004, 2007 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 Athlon: 11.0
+C Hammer: 7.0
+
+
+C mp_limb_t mpn_modexact_1_odd (mp_srcptr src, mp_size_t size,
+C mp_limb_t divisor);
+C mp_limb_t mpn_modexact_1c_odd (mp_srcptr src, mp_size_t size,
+C mp_limb_t divisor, mp_limb_t carry);
+C
+C With the loop running at just 11 cycles it doesn't seem worth bothering to
+C check for high<divisor to save one step.
+C
+C Using a divl for size==1 measures slower than the modexact method, which
+C is not too surprising since for the latter it's only about 24 cycles to
+C calculate the modular inverse.
+
+defframe(PARAM_CARRY, 16)
+defframe(PARAM_DIVISOR,12)
+defframe(PARAM_SIZE, 8)
+defframe(PARAM_SRC, 4)
+
+defframe(SAVE_EBX, -4)
+defframe(SAVE_ESI, -8)
+defframe(SAVE_EDI, -12)
+defframe(SAVE_EBP, -16)
+
+deflit(STACK_SPACE, 16)
+
+ TEXT
+
+ ALIGN(16)
+PROLOGUE(mpn_modexact_1c_odd)
+deflit(`FRAME',0)
+
+ movl PARAM_CARRY, %ecx
+ jmp L(start_1c)
+
+EPILOGUE()
+
+
+ ALIGN(16)
+PROLOGUE(mpn_modexact_1_odd)
+deflit(`FRAME',0)
+
+ xorl %ecx, %ecx
+L(start_1c):
+ movl PARAM_DIVISOR, %eax
+ subl $STACK_SPACE, %esp FRAME_subl_esp(STACK_SPACE)
+
+ movl %esi, SAVE_ESI
+ movl PARAM_DIVISOR, %esi
+
+ movl %edi, SAVE_EDI
+
+ shrl %eax C d/2
+
+ andl $127, %eax
+
+ifdef(`PIC',`
+ LEA( binvert_limb_table, %edi)
+ movzbl (%eax,%edi), %edi C inv 8 bits
+',`
+ movzbl binvert_limb_table(%eax), %edi C inv 8 bits
+')
+
+ xorl %edx, %edx C initial extra carry
+ leal (%edi,%edi), %eax C 2*inv
+
+ imull %edi, %edi C inv*inv
+
+ movl %ebp, SAVE_EBP
+ movl PARAM_SIZE, %ebp
+
+ movl %ebx, SAVE_EBX
+ movl PARAM_SRC, %ebx
+
+ imull %esi, %edi C inv*inv*d
+
+ subl %edi, %eax C inv = 2*inv - inv*inv*d
+ leal (%eax,%eax), %edi C 2*inv
+
+ imull %eax, %eax C inv*inv
+
+ imull %esi, %eax C inv*inv*d
+
+ leal (%ebx,%ebp,4), %ebx C src end
+ negl %ebp C -size
+
+ subl %eax, %edi C inv = 2*inv - inv*inv*d
+
+ ASSERT(e,` C d*inv == 1 mod 2^GMP_LIMB_BITS
+ movl %esi, %eax
+ imull %edi, %eax
+ cmpl $1, %eax')
+
+
+C The dependent chain here is
+C
+C cycles
+C subl %edx, %eax 1
+C imull %edi, %eax 4
+C mull %esi 6 (high limb)
+C ----
+C total 11
+C
+C Out of order execution hides the load latency for the source data, so no
+C special scheduling is required.
+
+L(top):
+ C eax src limb
+ C ebx src end ptr
+ C ecx next carry bit, 0 or 1 (or initial carry param)
+ C edx carry limb, high of last product
+ C esi divisor
+ C edi inverse
+ C ebp counter, limbs, negative
+
+ movl (%ebx,%ebp,4), %eax
+
+ subl %ecx, %eax C apply carry bit
+ movl $0, %ecx
+
+ setc %cl C new carry bit
+
+ subl %edx, %eax C apply carry limb
+ adcl $0, %ecx
+
+ imull %edi, %eax
+
+ mull %esi
+
+ incl %ebp
+ jnz L(top)
+
+
+ movl SAVE_ESI, %esi
+ movl SAVE_EDI, %edi
+ leal (%ecx,%edx), %eax
+
+ movl SAVE_EBX, %ebx
+ movl SAVE_EBP, %ebp
+ addl $STACK_SPACE, %esp
+
+ ret
+
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k7/mul_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k7/mul_1.asm
new file mode 100644
index 00000000000..755cd2ed50c
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k7/mul_1.asm
@@ -0,0 +1,237 @@
+dnl AMD K7 mpn_mul_1.
+
+dnl Copyright 1999-2002, 2005, 2008 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 P5
+C P6 model 0-8,10-12)
+C P6 model 9 (Banias)
+C P6 model 13 (Dothan)
+C P4 model 0 (Willamette)
+C P4 model 1 (?)
+C P4 model 2 (Northwood)
+C P4 model 3 (Prescott)
+C P4 model 4 (Nocona)
+C AMD K6
+C AMD K7 3.25
+C AMD K8
+
+C TODO
+C * Improve feed-in and wind-down code. We beat the old code for all n != 1,
+C but we might be able to do even better.
+C * The feed-in code for mul_1c is crude.
+
+ASM_START()
+ TEXT
+ ALIGN(16)
+PROLOGUE(mpn_mul_1c)
+ add $-16, %esp
+ mov %ebp, (%esp)
+ mov %ebx, 4(%esp)
+ mov %esi, 8(%esp)
+ mov %edi, 12(%esp)
+
+ mov 20(%esp), %edi
+ mov 24(%esp), %esi
+ mov 28(%esp), %ebp
+ mov 32(%esp), %ecx
+ mov %ebp, %ebx
+ shr $2, %ebp
+ mov %ebp, 28(%esp)
+ mov (%esi), %eax
+ and $3, %ebx
+ jz L(c0)
+ cmp $2, %ebx
+ mov 36(%esp), %ebx
+ jz L(c2)
+ jg L(c3)
+
+L(c1): lea -4(%edi), %edi
+ mul %ecx
+ test %ebp, %ebp
+ jnz 1f
+ add %ebx, %eax
+ mov %eax, 4(%edi)
+ mov %edx, %eax
+ adc %ebp, %eax
+ jmp L(rt)
+1: add %eax, %ebx
+ mov $0, %ebp
+ adc %edx, %ebp
+ mov 4(%esi), %eax
+ jmp L(1)
+
+L(c2): lea 4(%esi), %esi
+ mul %ecx
+ test %ebp, %ebp
+ mov %ebx, %ebp
+ jnz 2f
+ add %eax, %ebp
+ mov $0, %ebx
+ adc %edx, %ebx
+ mov (%esi), %eax
+ jmp L(cj2)
+2: add %eax, %ebp
+ mov $0, %ebx
+ adc %edx, %ebx
+ mov (%esi), %eax
+ jmp L(2)
+
+L(c3): lea 8(%esi), %esi
+ lea -12(%edi), %edi
+ mul %ecx
+ add %eax, %ebx
+ mov $0, %ebp
+ adc %edx, %ebp
+ mov -4(%esi), %eax
+ incl 28(%esp)
+ jmp L(3)
+
+L(c0): mov 36(%esp), %ebx
+ lea -4(%esi), %esi
+ lea -8(%edi), %edi
+ mul %ecx
+ mov %ebx, %ebp
+ add %eax, %ebp
+ mov $0, %ebx
+ adc %edx, %ebx
+ mov 8(%esi), %eax
+ jmp L(0)
+
+EPILOGUE()
+ ALIGN(16)
+PROLOGUE(mpn_mul_1)
+ add $-16, %esp
+ mov %ebp, (%esp)
+ mov %ebx, 4(%esp)
+ mov %esi, 8(%esp)
+ mov %edi, 12(%esp)
+
+ mov 20(%esp), %edi
+ mov 24(%esp), %esi
+ mov 28(%esp), %ebp
+ mov 32(%esp), %ecx
+ mov %ebp, %ebx
+ shr $2, %ebp
+ mov %ebp, 28(%esp)
+ mov (%esi), %eax
+ and $3, %ebx
+ jz L(b0)
+ cmp $2, %ebx
+ jz L(b2)
+ jg L(b3)
+
+L(b1): lea -4(%edi), %edi
+ mul %ecx
+ test %ebp, %ebp
+ jnz L(gt1)
+ mov %eax, 4(%edi)
+ mov %edx, %eax
+ jmp L(rt)
+L(gt1): mov %eax, %ebx
+ mov %edx, %ebp
+ mov 4(%esi), %eax
+ jmp L(1)
+
+L(b2): lea 4(%esi), %esi
+ mul %ecx
+ test %ebp, %ebp
+ mov %eax, %ebp
+ mov %edx, %ebx
+ mov (%esi), %eax
+ jnz L(2)
+ jmp L(cj2)
+
+L(b3): lea 8(%esi), %esi
+ lea -12(%edi), %edi
+ mul %ecx
+ mov %eax, %ebx
+ mov %edx, %ebp
+ mov -4(%esi), %eax
+ incl 28(%esp)
+ jmp L(3)
+
+L(b0): lea -4(%esi), %esi
+ lea -8(%edi), %edi
+ mul %ecx
+ mov %eax, %ebp
+ mov %edx, %ebx
+ mov 8(%esi), %eax
+ jmp L(0)
+
+ ALIGN(16)
+L(top): mov $0, %ebx
+ adc %edx, %ebx
+L(2): mul %ecx
+ add %eax, %ebx
+ mov %ebp, 0(%edi)
+ mov 4(%esi), %eax
+ mov $0, %ebp
+ adc %edx, %ebp
+L(1): mul %ecx
+ add %eax, %ebp
+ mov 8(%esi), %eax
+ mov %ebx, 4(%edi)
+ mov $0, %ebx
+ adc %edx, %ebx
+L(0): mov %ebp, 8(%edi)
+ mul %ecx
+ add %eax, %ebx
+ mov 12(%esi), %eax
+ lea 16(%esi), %esi
+ mov $0, %ebp
+ adc %edx, %ebp
+L(3): mov %ebx, 12(%edi)
+ mul %ecx
+ lea 16(%edi), %edi
+ add %eax, %ebp
+ decl 28(%esp)
+ mov 0(%esi), %eax
+ jnz L(top)
+
+L(end): mov $0, %ebx
+ adc %edx, %ebx
+L(cj2): mul %ecx
+ add %eax, %ebx
+ mov %ebp, (%edi)
+L(cj1): mov %ebx, 4(%edi)
+ adc $0, %edx
+ mov %edx, %eax
+
+L(rt): mov (%esp), %ebp
+ mov 4(%esp), %ebx
+ mov 8(%esp), %esi
+ mov 12(%esp), %edi
+ add $16, %esp
+ ret
+EPILOGUE()
+ASM_END()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k7/mul_basecase.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k7/mul_basecase.asm
new file mode 100644
index 00000000000..4dfb5008852
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k7/mul_basecase.asm
@@ -0,0 +1,602 @@
+dnl AMD K7 mpn_mul_basecase -- multiply two mpn numbers.
+
+dnl Copyright 1999-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 K7: approx 4.42 cycles per cross product at around 20x20 limbs (16
+C limbs/loop unrolling).
+
+
+
+dnl K7 UNROLL_COUNT cycles/product (at around 20x20)
+dnl 8 4.67
+dnl 16 4.59
+dnl 32 4.42
+dnl Maximum possible with the current code is 32.
+dnl
+dnl At 32 the typical 13-26 limb sizes from the karatsuba code will get
+dnl done with a straight run through a block of code, no inner loop. Using
+dnl 32 gives 1k of code, but the k7 has a 64k L1 code cache.
+
+deflit(UNROLL_COUNT, 32)
+
+
+C void mpn_mul_basecase (mp_ptr wp,
+C mp_srcptr xp, mp_size_t xsize,
+C mp_srcptr yp, mp_size_t ysize);
+C
+C Calculate xp,xsize multiplied by yp,ysize, storing the result in
+C wp,xsize+ysize.
+C
+C This routine is essentially the same as mpn/generic/mul_basecase.c, but
+C it's faster because it does most of the mpn_addmul_1() startup
+C calculations only once. The saving is 15-25% on typical sizes coming from
+C the Karatsuba multiply code.
+
+ifdef(`PIC',`
+deflit(UNROLL_THRESHOLD, 5)
+',`
+deflit(UNROLL_THRESHOLD, 5)
+')
+
+defframe(PARAM_YSIZE,20)
+defframe(PARAM_YP, 16)
+defframe(PARAM_XSIZE,12)
+defframe(PARAM_XP, 8)
+defframe(PARAM_WP, 4)
+
+ TEXT
+ ALIGN(32)
+PROLOGUE(mpn_mul_basecase)
+deflit(`FRAME',0)
+
+ movl PARAM_XSIZE, %ecx
+ movl PARAM_YP, %eax
+
+ movl PARAM_XP, %edx
+ movl (%eax), %eax C yp low limb
+
+ cmpl $2, %ecx
+ ja L(xsize_more_than_two)
+ je L(two_by_something)
+
+
+ C one limb by one limb
+
+ mull (%edx)
+
+ movl PARAM_WP, %ecx
+ movl %eax, (%ecx)
+ movl %edx, 4(%ecx)
+ ret
+
+
+C -----------------------------------------------------------------------------
+L(two_by_something):
+deflit(`FRAME',0)
+ decl PARAM_YSIZE
+ pushl %ebx defframe_pushl(`SAVE_EBX')
+ movl %eax, %ecx C yp low limb
+
+ movl PARAM_WP, %ebx
+ pushl %esi defframe_pushl(`SAVE_ESI')
+ movl %edx, %esi C xp
+
+ movl (%edx), %eax C xp low limb
+ jnz L(two_by_two)
+
+
+ C two limbs by one limb
+
+ mull %ecx
+
+ movl %eax, (%ebx)
+ movl 4(%esi), %eax
+ movl %edx, %esi C carry
+
+ mull %ecx
+
+ addl %eax, %esi
+
+ movl %esi, 4(%ebx)
+ movl SAVE_ESI, %esi
+
+ adcl $0, %edx
+
+ movl %edx, 8(%ebx)
+ movl SAVE_EBX, %ebx
+ addl $FRAME, %esp
+
+ ret
+
+
+
+C -----------------------------------------------------------------------------
+C Could load yp earlier into another register.
+
+ ALIGN(16)
+L(two_by_two):
+ C eax xp low limb
+ C ebx wp
+ C ecx yp low limb
+ C edx
+ C esi xp
+ C edi
+ C ebp
+
+dnl FRAME carries on from previous
+
+ mull %ecx C xp[0] * yp[0]
+
+ push %edi defframe_pushl(`SAVE_EDI')
+ movl %edx, %edi C carry, for wp[1]
+
+ movl %eax, (%ebx)
+ movl 4(%esi), %eax
+
+ mull %ecx C xp[1] * yp[0]
+
+ addl %eax, %edi
+ movl PARAM_YP, %ecx
+
+ adcl $0, %edx
+ movl 4(%ecx), %ecx C yp[1]
+ movl %edi, 4(%ebx)
+
+ movl 4(%esi), %eax C xp[1]
+ movl %edx, %edi C carry, for wp[2]
+
+ mull %ecx C xp[1] * yp[1]
+
+ addl %eax, %edi
+
+ adcl $0, %edx
+ movl (%esi), %eax C xp[0]
+
+ movl %edx, %esi C carry, for wp[3]
+
+ mull %ecx C xp[0] * yp[1]
+
+ addl %eax, 4(%ebx)
+ adcl %edx, %edi
+ movl %edi, 8(%ebx)
+
+ adcl $0, %esi
+ movl SAVE_EDI, %edi
+ movl %esi, 12(%ebx)
+
+ movl SAVE_ESI, %esi
+ movl SAVE_EBX, %ebx
+ addl $FRAME, %esp
+
+ ret
+
+
+C -----------------------------------------------------------------------------
+ ALIGN(16)
+L(xsize_more_than_two):
+
+C The first limb of yp is processed with a simple mpn_mul_1 style loop
+C inline. Unrolling this doesn't seem worthwhile since it's only run once
+C (whereas the addmul below is run ysize-1 many times). A call to the
+C actual mpn_mul_1 will be slowed down by the call and parameter pushing and
+C popping, and doesn't seem likely to be worthwhile on the typical 13-26
+C limb operations the Karatsuba code calls here with.
+
+ C eax yp[0]
+ C ebx
+ C ecx xsize
+ C edx xp
+ C esi
+ C edi
+ C ebp
+
+dnl FRAME doesn't carry on from previous, no pushes yet here
+defframe(`SAVE_EBX',-4)
+defframe(`SAVE_ESI',-8)
+defframe(`SAVE_EDI',-12)
+defframe(`SAVE_EBP',-16)
+deflit(`FRAME',0)
+
+ subl $16, %esp
+deflit(`FRAME',16)
+
+ movl %edi, SAVE_EDI
+ movl PARAM_WP, %edi
+
+ movl %ebx, SAVE_EBX
+ movl %ebp, SAVE_EBP
+ movl %eax, %ebp
+
+ movl %esi, SAVE_ESI
+ xorl %ebx, %ebx
+ leal (%edx,%ecx,4), %esi C xp end
+
+ leal (%edi,%ecx,4), %edi C wp end of mul1
+ negl %ecx
+
+
+L(mul1):
+ C eax scratch
+ C ebx carry
+ C ecx counter, negative
+ C edx scratch
+ C esi xp end
+ C edi wp end of mul1
+ C ebp multiplier
+
+ movl (%esi,%ecx,4), %eax
+
+ mull %ebp
+
+ addl %ebx, %eax
+ movl %eax, (%edi,%ecx,4)
+ movl $0, %ebx
+
+ adcl %edx, %ebx
+ incl %ecx
+ jnz L(mul1)
+
+
+ movl PARAM_YSIZE, %edx
+ movl PARAM_XSIZE, %ecx
+
+ movl %ebx, (%edi) C final carry
+ decl %edx
+
+ jnz L(ysize_more_than_one)
+
+
+ movl SAVE_EDI, %edi
+ movl SAVE_EBX, %ebx
+
+ movl SAVE_EBP, %ebp
+ movl SAVE_ESI, %esi
+ addl $FRAME, %esp
+
+ ret
+
+
+L(ysize_more_than_one):
+ cmpl $UNROLL_THRESHOLD, %ecx
+ movl PARAM_YP, %eax
+
+ jae L(unroll)
+
+
+C -----------------------------------------------------------------------------
+ C simple addmul looping
+ C
+ C eax yp
+ C ebx
+ C ecx xsize
+ C edx ysize-1
+ C esi xp end
+ C edi wp end of mul1
+ C ebp
+
+ leal 4(%eax,%edx,4), %ebp C yp end
+ negl %ecx
+ negl %edx
+
+ movl (%esi,%ecx,4), %eax C xp low limb
+ movl %edx, PARAM_YSIZE C -(ysize-1)
+ incl %ecx
+
+ xorl %ebx, %ebx C initial carry
+ movl %ecx, PARAM_XSIZE C -(xsize-1)
+ movl %ebp, PARAM_YP
+
+ movl (%ebp,%edx,4), %ebp C yp second lowest limb - multiplier
+ jmp L(simple_outer_entry)
+
+
+ C this is offset 0x121 so close enough to aligned
+L(simple_outer_top):
+ C ebp ysize counter, negative
+
+ movl PARAM_YP, %edx
+ movl PARAM_XSIZE, %ecx C -(xsize-1)
+ xorl %ebx, %ebx C carry
+
+ movl %ebp, PARAM_YSIZE
+ addl $4, %edi C next position in wp
+
+ movl (%edx,%ebp,4), %ebp C yp limb - multiplier
+ movl -4(%esi,%ecx,4), %eax C xp low limb
+
+
+L(simple_outer_entry):
+
+L(simple_inner):
+ C eax xp limb
+ C ebx carry limb
+ C ecx loop counter (negative)
+ C edx scratch
+ C esi xp end
+ C edi wp end
+ C ebp multiplier
+
+ mull %ebp
+
+ addl %eax, %ebx
+ adcl $0, %edx
+
+ addl %ebx, (%edi,%ecx,4)
+ movl (%esi,%ecx,4), %eax
+ adcl $0, %edx
+
+ incl %ecx
+ movl %edx, %ebx
+ jnz L(simple_inner)
+
+
+ mull %ebp
+
+ movl PARAM_YSIZE, %ebp
+ addl %eax, %ebx
+
+ adcl $0, %edx
+ addl %ebx, (%edi)
+
+ adcl $0, %edx
+ incl %ebp
+
+ movl %edx, 4(%edi)
+ jnz L(simple_outer_top)
+
+
+ movl SAVE_EBX, %ebx
+ movl SAVE_ESI, %esi
+
+ movl SAVE_EDI, %edi
+ movl SAVE_EBP, %ebp
+ addl $FRAME, %esp
+
+ ret
+
+
+
+C -----------------------------------------------------------------------------
+C
+C The unrolled loop is the same as in mpn_addmul_1(), see that code for some
+C comments.
+C
+C VAR_ADJUST is the negative of how many limbs the leals in the inner loop
+C increment xp and wp. This is used to adjust back xp and wp, and rshifted
+C to given an initial VAR_COUNTER at the top of the outer loop.
+C
+C VAR_COUNTER is for the unrolled loop, running from VAR_ADJUST/UNROLL_COUNT
+C up to -1, inclusive.
+C
+C VAR_JMP is the computed jump into the unrolled loop.
+C
+C VAR_XP_LOW is the least significant limb of xp, which is needed at the
+C start of the unrolled loop.
+C
+C PARAM_YSIZE is the outer loop counter, going from -(ysize-1) up to -1,
+C inclusive.
+C
+C PARAM_YP is offset appropriately so that the PARAM_YSIZE counter can be
+C added to give the location of the next limb of yp, which is the multiplier
+C in the unrolled loop.
+C
+C The trick with VAR_ADJUST means it's only necessary to do one fetch in the
+C outer loop to take care of xp, wp and the inner loop counter.
+
+defframe(VAR_COUNTER, -20)
+defframe(VAR_ADJUST, -24)
+defframe(VAR_JMP, -28)
+defframe(VAR_XP_LOW, -32)
+deflit(VAR_EXTRA_SPACE, 16)
+
+
+L(unroll):
+ C eax yp
+ C ebx
+ C ecx xsize
+ C edx ysize-1
+ C esi xp end
+ C edi wp end of mul1
+ C ebp
+
+ movl PARAM_XP, %esi
+ movl 4(%eax), %ebp C multiplier (yp second limb)
+ leal 4(%eax,%edx,4), %eax C yp adjust for ysize indexing
+
+ movl PARAM_WP, %edi
+ movl %eax, PARAM_YP
+ negl %edx
+
+ movl %edx, PARAM_YSIZE
+ leal UNROLL_COUNT-2(%ecx), %ebx C (xsize-1)+UNROLL_COUNT-1
+ decl %ecx C xsize-1
+
+ movl (%esi), %eax C xp low limb
+ andl $-UNROLL_MASK-1, %ebx
+ negl %ecx
+
+ subl $VAR_EXTRA_SPACE, %esp
+deflit(`FRAME',16+VAR_EXTRA_SPACE)
+ negl %ebx
+ andl $UNROLL_MASK, %ecx
+
+ movl %ebx, VAR_ADJUST
+ movl %ecx, %edx
+ shll $4, %ecx
+
+ sarl $UNROLL_LOG2, %ebx
+
+ C 17 code bytes per limb
+ifdef(`PIC',`
+ call L(pic_calc)
+L(unroll_here):
+',`
+ leal L(unroll_entry) (%ecx,%edx,1), %ecx
+')
+ negl %edx
+
+ movl %eax, VAR_XP_LOW
+ movl %ecx, VAR_JMP
+ leal 4(%edi,%edx,4), %edi C wp and xp, adjust for unrolling,
+ leal 4(%esi,%edx,4), %esi C and start at second limb
+ jmp L(unroll_outer_entry)
+
+
+ifdef(`PIC',`
+L(pic_calc):
+ C See mpn/x86/README about old gas bugs
+ leal (%ecx,%edx,1), %ecx
+ addl $L(unroll_entry)-L(unroll_here), %ecx
+ addl (%esp), %ecx
+ ret_internal
+')
+
+
+C --------------------------------------------------------------------------
+ ALIGN(32)
+L(unroll_outer_top):
+ C ebp ysize counter, negative
+
+ movl VAR_ADJUST, %ebx
+ movl PARAM_YP, %edx
+
+ movl VAR_XP_LOW, %eax
+ movl %ebp, PARAM_YSIZE C store incremented ysize counter
+
+ leal 4(%edi,%ebx,4), %edi
+ leal (%esi,%ebx,4), %esi
+ sarl $UNROLL_LOG2, %ebx
+
+ movl (%edx,%ebp,4), %ebp C yp next multiplier
+ movl VAR_JMP, %ecx
+
+L(unroll_outer_entry):
+ mull %ebp
+
+ testb $1, %cl C and clear carry bit
+ movl %ebx, VAR_COUNTER
+ movl $0, %ebx
+
+ movl $0, %ecx
+ cmovz( %eax, %ecx) C eax into low carry, zero into high carry limb
+ cmovnz( %eax, %ebx)
+
+ C Extra fetch of VAR_JMP is bad, but registers are tight
+ jmp *VAR_JMP
+
+
+C -----------------------------------------------------------------------------
+ ALIGN(32)
+L(unroll_top):
+ C eax xp limb
+ C ebx carry high
+ C ecx carry low
+ C edx scratch
+ C esi xp+8
+ C edi wp
+ C ebp yp multiplier limb
+ C
+ C VAR_COUNTER loop counter, negative
+ C
+ C 17 bytes each limb
+
+L(unroll_entry):
+
+deflit(CHUNK_COUNT,2)
+forloop(`i', 0, UNROLL_COUNT/CHUNK_COUNT-1, `
+ deflit(`disp0', eval(i*CHUNK_COUNT*4 ifelse(UNROLL_BYTES,256,-128)))
+ deflit(`disp1', eval(disp0 + 4))
+
+Zdisp( movl, disp0,(%esi), %eax)
+ adcl %edx, %ebx
+
+ mull %ebp
+
+Zdisp( addl, %ecx, disp0,(%edi))
+ movl $0, %ecx
+
+ adcl %eax, %ebx
+
+
+ movl disp1(%esi), %eax
+ adcl %edx, %ecx
+
+ mull %ebp
+
+ addl %ebx, disp1(%edi)
+ movl $0, %ebx
+
+ adcl %eax, %ecx
+')
+
+
+ incl VAR_COUNTER
+ leal UNROLL_BYTES(%esi), %esi
+ leal UNROLL_BYTES(%edi), %edi
+
+ jnz L(unroll_top)
+
+
+ C eax
+ C ebx zero
+ C ecx low
+ C edx high
+ C esi
+ C edi wp, pointing at second last limb)
+ C ebp
+ C
+ C carry flag to be added to high
+
+deflit(`disp0', ifelse(UNROLL_BYTES,256,-128))
+deflit(`disp1', eval(disp0-0 + 4))
+
+ movl PARAM_YSIZE, %ebp
+ adcl $0, %edx
+ addl %ecx, disp0(%edi)
+
+ adcl $0, %edx
+ incl %ebp
+
+ movl %edx, disp1(%edi)
+ jnz L(unroll_outer_top)
+
+
+ movl SAVE_ESI, %esi
+ movl SAVE_EBP, %ebp
+
+ movl SAVE_EDI, %edi
+ movl SAVE_EBX, %ebx
+ addl $FRAME, %esp
+
+ ret
+
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k7/sqr_basecase.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k7/sqr_basecase.asm
new file mode 100644
index 00000000000..7b6a97e0df4
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k7/sqr_basecase.asm
@@ -0,0 +1,635 @@
+dnl AMD K7 mpn_sqr_basecase -- square an mpn number.
+
+dnl Copyright 1999-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 K7: approx 2.3 cycles/crossproduct, or 4.55 cycles/triangular product
+C (measured on the speed difference between 25 and 50 limbs, which is
+C roughly the Karatsuba recursing range).
+
+
+dnl These are the same as mpn/x86/k6/sqr_basecase.asm, see that code for
+dnl some comments.
+
+deflit(SQR_TOOM2_THRESHOLD_MAX, 66)
+
+ifdef(`SQR_TOOM2_THRESHOLD_OVERRIDE',
+`define(`SQR_TOOM2_THRESHOLD',SQR_TOOM2_THRESHOLD_OVERRIDE)')
+
+m4_config_gmp_mparam(`SQR_TOOM2_THRESHOLD')
+deflit(UNROLL_COUNT, eval(SQR_TOOM2_THRESHOLD-3))
+
+
+C void mpn_sqr_basecase (mp_ptr dst, mp_srcptr src, mp_size_t size);
+C
+C With a SQR_TOOM2_THRESHOLD around 50 this code is about 1500 bytes,
+C which is quite a bit, but is considered good value since squares big
+C enough to use most of the code will be spending quite a few cycles in it.
+
+
+defframe(PARAM_SIZE,12)
+defframe(PARAM_SRC, 8)
+defframe(PARAM_DST, 4)
+
+ TEXT
+ ALIGN(32)
+PROLOGUE(mpn_sqr_basecase)
+deflit(`FRAME',0)
+
+ movl PARAM_SIZE, %ecx
+ movl PARAM_SRC, %eax
+ cmpl $2, %ecx
+
+ movl PARAM_DST, %edx
+ je L(two_limbs)
+ ja L(three_or_more)
+
+
+C------------------------------------------------------------------------------
+C one limb only
+ C eax src
+ C ecx size
+ C edx dst
+
+ movl (%eax), %eax
+ movl %edx, %ecx
+
+ mull %eax
+
+ movl %edx, 4(%ecx)
+ movl %eax, (%ecx)
+ ret
+
+
+C------------------------------------------------------------------------------
+C
+C Using the read/modify/write "add"s seems to be faster than saving and
+C restoring registers. Perhaps the loads for the first set hide under the
+C mul latency and the second gets store to load forwarding.
+
+ ALIGN(16)
+L(two_limbs):
+ C eax src
+ C ebx
+ C ecx size
+ C edx dst
+deflit(`FRAME',0)
+
+ pushl %ebx FRAME_pushl()
+ movl %eax, %ebx C src
+ movl (%eax), %eax
+
+ movl %edx, %ecx C dst
+
+ mull %eax C src[0]^2
+
+ movl %eax, (%ecx) C dst[0]
+ movl 4(%ebx), %eax
+
+ movl %edx, 4(%ecx) C dst[1]
+
+ mull %eax C src[1]^2
+
+ movl %eax, 8(%ecx) C dst[2]
+ movl (%ebx), %eax
+
+ movl %edx, 12(%ecx) C dst[3]
+
+ mull 4(%ebx) C src[0]*src[1]
+
+ popl %ebx
+
+ addl %eax, 4(%ecx)
+ adcl %edx, 8(%ecx)
+ adcl $0, 12(%ecx)
+ ASSERT(nc)
+
+ addl %eax, 4(%ecx)
+ adcl %edx, 8(%ecx)
+ adcl $0, 12(%ecx)
+ ASSERT(nc)
+
+ ret
+
+
+C------------------------------------------------------------------------------
+defframe(SAVE_EBX, -4)
+defframe(SAVE_ESI, -8)
+defframe(SAVE_EDI, -12)
+defframe(SAVE_EBP, -16)
+deflit(STACK_SPACE, 16)
+
+L(three_or_more):
+ subl $STACK_SPACE, %esp
+ cmpl $4, %ecx
+ jae L(four_or_more)
+deflit(`FRAME',STACK_SPACE)
+
+
+C------------------------------------------------------------------------------
+C Three limbs
+C
+C Writing out the loads and stores separately at the end of this code comes
+C out about 10 cycles faster than using adcls to memory.
+
+ C eax src
+ C ecx size
+ C edx dst
+
+ movl %ebx, SAVE_EBX
+ movl %eax, %ebx C src
+ movl (%eax), %eax
+
+ movl %edx, %ecx C dst
+ movl %esi, SAVE_ESI
+ movl %edi, SAVE_EDI
+
+ mull %eax C src[0] ^ 2
+
+ movl %eax, (%ecx)
+ movl 4(%ebx), %eax
+ movl %edx, 4(%ecx)
+
+ mull %eax C src[1] ^ 2
+
+ movl %eax, 8(%ecx)
+ movl 8(%ebx), %eax
+ movl %edx, 12(%ecx)
+
+ mull %eax C src[2] ^ 2
+
+ movl %eax, 16(%ecx)
+ movl (%ebx), %eax
+ movl %edx, 20(%ecx)
+
+ mull 4(%ebx) C src[0] * src[1]
+
+ movl %eax, %esi
+ movl (%ebx), %eax
+ movl %edx, %edi
+
+ mull 8(%ebx) C src[0] * src[2]
+
+ addl %eax, %edi
+ movl %ebp, SAVE_EBP
+ movl $0, %ebp
+
+ movl 4(%ebx), %eax
+ adcl %edx, %ebp
+
+ mull 8(%ebx) C src[1] * src[2]
+
+ xorl %ebx, %ebx
+ addl %eax, %ebp
+
+ adcl $0, %edx
+
+ C eax
+ C ebx zero, will be dst[5]
+ C ecx dst
+ C edx dst[4]
+ C esi dst[1]
+ C edi dst[2]
+ C ebp dst[3]
+
+ adcl $0, %edx
+ addl %esi, %esi
+
+ adcl %edi, %edi
+ movl 4(%ecx), %eax
+
+ adcl %ebp, %ebp
+
+ adcl %edx, %edx
+
+ adcl $0, %ebx
+ addl %eax, %esi
+ movl 8(%ecx), %eax
+
+ adcl %eax, %edi
+ movl 12(%ecx), %eax
+ movl %esi, 4(%ecx)
+
+ adcl %eax, %ebp
+ movl 16(%ecx), %eax
+ movl %edi, 8(%ecx)
+
+ movl SAVE_ESI, %esi
+ movl SAVE_EDI, %edi
+
+ adcl %eax, %edx
+ movl 20(%ecx), %eax
+ movl %ebp, 12(%ecx)
+
+ adcl %ebx, %eax
+ ASSERT(nc)
+ movl SAVE_EBX, %ebx
+ movl SAVE_EBP, %ebp
+
+ movl %edx, 16(%ecx)
+ movl %eax, 20(%ecx)
+ addl $FRAME, %esp
+
+ ret
+
+
+C------------------------------------------------------------------------------
+L(four_or_more):
+
+C First multiply src[0]*src[1..size-1] and store at dst[1..size].
+C Further products are added in rather than stored.
+
+ C eax src
+ C ebx
+ C ecx size
+ C edx dst
+ C esi
+ C edi
+ C ebp
+
+defframe(`VAR_COUNTER',-20)
+defframe(`VAR_JMP', -24)
+deflit(EXTRA_STACK_SPACE, 8)
+
+ movl %ebx, SAVE_EBX
+ movl %edi, SAVE_EDI
+ leal (%edx,%ecx,4), %edi C &dst[size]
+
+ movl %esi, SAVE_ESI
+ movl %ebp, SAVE_EBP
+ leal (%eax,%ecx,4), %esi C &src[size]
+
+ movl (%eax), %ebp C multiplier
+ movl $0, %ebx
+ decl %ecx
+
+ negl %ecx
+ subl $EXTRA_STACK_SPACE, %esp
+FRAME_subl_esp(EXTRA_STACK_SPACE)
+
+L(mul_1):
+ C eax scratch
+ C ebx carry
+ C ecx counter
+ C edx scratch
+ C esi &src[size]
+ C edi &dst[size]
+ C ebp multiplier
+
+ movl (%esi,%ecx,4), %eax
+
+ mull %ebp
+
+ addl %ebx, %eax
+ movl %eax, (%edi,%ecx,4)
+ movl $0, %ebx
+
+ adcl %edx, %ebx
+ incl %ecx
+ jnz L(mul_1)
+
+
+C Add products src[n]*src[n+1..size-1] at dst[2*n-1...], for each n=1..size-2.
+C
+C The last two products, which are the bottom right corner of the product
+C triangle, are left to the end. These are src[size-3]*src[size-2,size-1]
+C and src[size-2]*src[size-1]. If size is 4 then it's only these corner
+C cases that need to be done.
+C
+C The unrolled code is the same as in mpn_addmul_1, see that routine for
+C some comments.
+C
+C VAR_COUNTER is the outer loop, running from -size+4 to -1, inclusive.
+C
+C VAR_JMP is the computed jump into the unrolled code, stepped by one code
+C chunk each outer loop.
+C
+C K7 does branch prediction on indirect jumps, which is bad since it's a
+C different target each time. There seems no way to avoid this.
+
+dnl This value also hard coded in some shifts and adds
+deflit(CODE_BYTES_PER_LIMB, 17)
+
+dnl With the unmodified &src[size] and &dst[size] pointers, the
+dnl displacements in the unrolled code fit in a byte for UNROLL_COUNT
+dnl values up to 31, but above that an offset must be added to them.
+
+deflit(OFFSET,
+ifelse(eval(UNROLL_COUNT>31),1,
+eval((UNROLL_COUNT-31)*4),
+0))
+
+dnl Because the last chunk of code is generated differently, a label placed
+dnl at the end doesn't work. Instead calculate the implied end using the
+dnl start and how many chunks of code there are.
+
+deflit(UNROLL_INNER_END,
+`L(unroll_inner_start)+eval(UNROLL_COUNT*CODE_BYTES_PER_LIMB)')
+
+ C eax
+ C ebx carry
+ C ecx
+ C edx
+ C esi &src[size]
+ C edi &dst[size]
+ C ebp
+
+ movl PARAM_SIZE, %ecx
+ movl %ebx, (%edi)
+
+ subl $4, %ecx
+ jz L(corner)
+
+ negl %ecx
+ifelse(OFFSET,0,,`subl $OFFSET, %edi')
+ifelse(OFFSET,0,,`subl $OFFSET, %esi')
+
+ movl %ecx, %edx
+ shll $4, %ecx
+
+ifdef(`PIC',`
+ call L(pic_calc)
+L(here):
+',`
+ leal UNROLL_INNER_END-eval(2*CODE_BYTES_PER_LIMB)(%ecx,%edx), %ecx
+')
+
+
+ C The calculated jump mustn't come out to before the start of the
+ C code available. This is the limit UNROLL_COUNT puts on the src
+ C operand size, but checked here directly using the jump address.
+ ASSERT(ae,
+ `movl_text_address(L(unroll_inner_start), %eax)
+ cmpl %eax, %ecx')
+
+
+C------------------------------------------------------------------------------
+ ALIGN(16)
+L(unroll_outer_top):
+ C eax
+ C ebx high limb to store
+ C ecx VAR_JMP
+ C edx VAR_COUNTER, limbs, negative
+ C esi &src[size], constant
+ C edi dst ptr, high of last addmul
+ C ebp
+
+ movl -12+OFFSET(%esi,%edx,4), %ebp C next multiplier
+ movl -8+OFFSET(%esi,%edx,4), %eax C first of multiplicand
+
+ movl %edx, VAR_COUNTER
+
+ mull %ebp
+
+define(cmovX,`ifelse(eval(UNROLL_COUNT%2),0,`cmovz($@)',`cmovnz($@)')')
+
+ testb $1, %cl
+ movl %edx, %ebx C high carry
+ movl %ecx, %edx C jump
+
+ movl %eax, %ecx C low carry
+ cmovX( %ebx, %ecx) C high carry reverse
+ cmovX( %eax, %ebx) C low carry reverse
+
+ leal CODE_BYTES_PER_LIMB(%edx), %eax
+ xorl %edx, %edx
+ leal 4(%edi), %edi
+
+ movl %eax, VAR_JMP
+
+ jmp *%eax
+
+
+ifdef(`PIC',`
+L(pic_calc):
+ addl (%esp), %ecx
+ addl $UNROLL_INNER_END-eval(2*CODE_BYTES_PER_LIMB)-L(here), %ecx
+ addl %edx, %ecx
+ ret_internal
+')
+
+
+ C Must be an even address to preserve the significance of the low
+ C bit of the jump address indicating which way around ecx/ebx should
+ C start.
+ ALIGN(2)
+
+L(unroll_inner_start):
+ C eax next limb
+ C ebx carry high
+ C ecx carry low
+ C edx scratch
+ C esi src
+ C edi dst
+ C ebp multiplier
+
+forloop(`i', UNROLL_COUNT, 1, `
+ deflit(`disp_src', eval(-i*4 + OFFSET))
+ deflit(`disp_dst', eval(disp_src - 4))
+
+ m4_assert(`disp_src>=-128 && disp_src<128')
+ m4_assert(`disp_dst>=-128 && disp_dst<128')
+
+ifelse(eval(i%2),0,`
+Zdisp( movl, disp_src,(%esi), %eax)
+ adcl %edx, %ebx
+
+ mull %ebp
+
+Zdisp( addl, %ecx, disp_dst,(%edi))
+ movl $0, %ecx
+
+ adcl %eax, %ebx
+
+',`
+ dnl this bit comes out last
+Zdisp( movl, disp_src,(%esi), %eax)
+ adcl %edx, %ecx
+
+ mull %ebp
+
+Zdisp( addl, %ebx, disp_dst,(%edi))
+
+ifelse(forloop_last,0,
+` movl $0, %ebx')
+
+ adcl %eax, %ecx
+')
+')
+
+ C eax next limb
+ C ebx carry high
+ C ecx carry low
+ C edx scratch
+ C esi src
+ C edi dst
+ C ebp multiplier
+
+ adcl $0, %edx
+ addl %ecx, -4+OFFSET(%edi)
+ movl VAR_JMP, %ecx
+
+ adcl $0, %edx
+
+ movl %edx, m4_empty_if_zero(OFFSET) (%edi)
+ movl VAR_COUNTER, %edx
+
+ incl %edx
+ jnz L(unroll_outer_top)
+
+
+ifelse(OFFSET,0,,`
+ addl $OFFSET, %esi
+ addl $OFFSET, %edi
+')
+
+
+C------------------------------------------------------------------------------
+L(corner):
+ C esi &src[size]
+ C edi &dst[2*size-5]
+
+ movl -12(%esi), %ebp
+ movl -8(%esi), %eax
+ movl %eax, %ecx
+
+ mull %ebp
+
+ addl %eax, -4(%edi)
+ movl -4(%esi), %eax
+
+ adcl $0, %edx
+ movl %edx, %ebx
+ movl %eax, %esi
+
+ mull %ebp
+
+ addl %ebx, %eax
+
+ adcl $0, %edx
+ addl %eax, (%edi)
+ movl %esi, %eax
+
+ adcl $0, %edx
+ movl %edx, %ebx
+
+ mull %ecx
+
+ addl %ebx, %eax
+ movl %eax, 4(%edi)
+
+ adcl $0, %edx
+ movl %edx, 8(%edi)
+
+
+
+C Left shift of dst[1..2*size-2], high bit shifted out becomes dst[2*size-1].
+
+L(lshift_start):
+ movl PARAM_SIZE, %eax
+ movl PARAM_DST, %edi
+ xorl %ecx, %ecx C clear carry
+
+ leal (%edi,%eax,8), %edi
+ notl %eax C -size-1, preserve carry
+
+ leal 2(%eax), %eax C -(size-1)
+
+L(lshift):
+ C eax counter, negative
+ C ebx
+ C ecx
+ C edx
+ C esi
+ C edi dst, pointing just after last limb
+ C ebp
+
+ rcll -4(%edi,%eax,8)
+ rcll (%edi,%eax,8)
+ incl %eax
+ jnz L(lshift)
+
+ setc %al
+
+ movl PARAM_SRC, %esi
+ movl %eax, -4(%edi) C dst most significant limb
+
+ movl PARAM_SIZE, %ecx
+
+
+C Now add in the squares on the diagonal, src[0]^2, src[1]^2, ...,
+C src[size-1]^2. dst[0] hasn't yet been set at all yet, and just gets the
+C low limb of src[0]^2.
+
+ movl (%esi), %eax C src[0]
+
+ mull %eax
+
+ leal (%esi,%ecx,4), %esi C src point just after last limb
+ negl %ecx
+
+ movl %eax, (%edi,%ecx,8) C dst[0]
+ incl %ecx
+
+L(diag):
+ C eax scratch
+ C ebx scratch
+ C ecx counter, negative
+ C edx carry
+ C esi src just after last limb
+ C edi dst just after last limb
+ C ebp
+
+ movl (%esi,%ecx,4), %eax
+ movl %edx, %ebx
+
+ mull %eax
+
+ addl %ebx, -4(%edi,%ecx,8)
+ adcl %eax, (%edi,%ecx,8)
+ adcl $0, %edx
+
+ incl %ecx
+ jnz L(diag)
+
+
+ movl SAVE_ESI, %esi
+ movl SAVE_EBX, %ebx
+
+ addl %edx, -4(%edi) C dst most significant limb
+ movl SAVE_EDI, %edi
+
+ movl SAVE_EBP, %ebp
+ addl $FRAME, %esp
+
+ ret
+
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k7/sublsh1_n.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k7/sublsh1_n.asm
new file mode 100644
index 00000000000..523b01218db
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k7/sublsh1_n.asm
@@ -0,0 +1,173 @@
+dnl AMD K7 mpn_sublsh1_n_ip1 -- rp[] = rp[] - (up[] << 1)
+
+dnl Copyright 2011 Free Software Foundation, Inc.
+
+dnl Contributed to the GNU project by Torbjorn Granlund and Marco Bodrato.
+
+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 This is an attempt at a sublsh1_n for x86-32, not relying on sse2 insns. The
+C innerloop is 2*3-way unrolled, which is best we can do with the available
+C registers. It seems tricky to use the same structure for rsblsh1_n, since we
+C cannot feed carry between operations there.
+
+C cycles/limb
+C P5
+C P6 model 0-8,10-12
+C P6 model 9 (Banias)
+C P6 model 13 (Dothan)
+C P4 model 0 (Willamette)
+C P4 model 1 (?)
+C P4 model 2 (Northwood)
+C P4 model 3 (Prescott)
+C P4 model 4 (Nocona)
+C Intel Atom 6.75
+C AMD K6
+C AMD K7
+C AMD K8
+
+C This is a basic sublsh1_n for k7, atom, and perhaps some other x86-32
+C processors. It uses 2*4-way unrolling, for good reasons.
+C
+C Breaking carry recurrency might be a good idea. We would then need separate
+C registers for the shift carry and add/subtract carry, which in turn would
+C force is to 2*2-way unrolling.
+
+defframe(PARAM_SIZE, 12)
+defframe(PARAM_SRC, 8)
+defframe(PARAM_DST, 4)
+
+dnl re-use parameter space
+define(VAR_COUNT,`PARAM_SIZE')
+define(SAVE_EBX,`PARAM_SRC')
+define(SAVE_EBP,`PARAM_DST')
+
+ASM_START()
+ TEXT
+ ALIGN(8)
+PROLOGUE(mpn_sublsh1_n_ip1)
+deflit(`FRAME',0)
+
+define(`rp', `%edi')
+define(`up', `%esi')
+
+ mov PARAM_SIZE, %eax C size
+ push up FRAME_pushl()
+ push rp FRAME_pushl()
+ xor %edx, %edx
+ mov PARAM_SRC, up
+ mov PARAM_DST, rp
+ mov %ebx, SAVE_EBX
+ mov %eax, %ebx
+ shr $3, %eax
+
+ not %eax C count = -(size\8)-i
+ and $7, %ebx C size % 8
+ jz L(exact)
+
+L(oop):
+ifdef(`CPU_P6',`
+ shr %edx ') C restore 2nd saved carry bit
+ mov (up), %ecx
+ adc %ecx, %ecx
+ rcr %edx C restore 1st saved carry bit
+ lea 4(up), up
+ sbb %ecx, (rp)
+ lea 4(rp), rp
+ adc %edx, %edx C save a carry bit in edx
+ifdef(`CPU_P6',`
+ adc %edx, %edx ') C save another carry bit in edx
+ dec %ebx
+ jnz L(oop)
+L(exact):
+ inc %eax
+ jz L(end)
+ mov %eax, VAR_COUNT
+ mov %ebp, SAVE_EBP
+
+ ALIGN(16)
+L(top):
+ifdef(`CPU_P6',`
+ shr %edx ') C restore 2nd saved carry bit
+ mov (up), %eax
+ adc %eax, %eax
+ mov 4(up), %ebx
+ adc %ebx, %ebx
+ mov 8(up), %ecx
+ adc %ecx, %ecx
+ mov 12(up), %ebp
+ adc %ebp, %ebp
+
+ rcr %edx C restore 1st saved carry bit
+
+ sbb %eax, (rp)
+ sbb %ebx, 4(rp)
+ sbb %ecx, 8(rp)
+ sbb %ebp, 12(rp)
+
+ mov 16(up), %eax
+ adc %eax, %eax
+ mov 20(up), %ebx
+ adc %ebx, %ebx
+ mov 24(up), %ecx
+ adc %ecx, %ecx
+ mov 28(up), %ebp
+ adc %ebp, %ebp
+
+ lea 32(up), up
+ adc %edx, %edx C save a carry bit in edx
+
+ sbb %eax, 16(rp)
+ sbb %ebx, 20(rp)
+ sbb %ecx, 24(rp)
+ sbb %ebp, 28(rp)
+
+ifdef(`CPU_P6',`
+ adc %edx, %edx ') C save another carry bit in edx
+ incl VAR_COUNT
+ lea 32(rp), rp
+ jne L(top)
+
+ mov SAVE_EBP, %ebp
+L(end):
+ mov SAVE_EBX, %ebx
+
+ifdef(`CPU_P6',`
+ xor %eax, %eax
+ shr $1, %edx
+ adc %edx, %eax
+',`
+ adc $0, %edx
+ mov %edx, %eax
+')
+ pop rp FRAME_popl()
+ pop up FRAME_popl()
+ ret
+EPILOGUE()
+ASM_END()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k8/gmp-mparam.h b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k8/gmp-mparam.h
new file mode 100644
index 00000000000..8d95fef80b7
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/k8/gmp-mparam.h
@@ -0,0 +1,198 @@
+/* x86/k8 gmp-mparam.h -- Compiler/machine parameter header file.
+
+Copyright 1991, 1993, 1994, 2000-2011, 2014 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
+
+/* 2500 MHz K8 Brisbane */
+/* FFT tuning limit = 10000000 */
+/* Generated by tuneup.c, 2014-03-12, gcc 4.5 */
+
+#define MOD_1_NORM_THRESHOLD 0 /* always */
+#define MOD_1_UNNORM_THRESHOLD 0 /* always */
+#define MOD_1N_TO_MOD_1_1_THRESHOLD 11
+#define MOD_1U_TO_MOD_1_1_THRESHOLD 6
+#define MOD_1_1_TO_MOD_1_2_THRESHOLD 12
+#define MOD_1_2_TO_MOD_1_4_THRESHOLD 0 /* never mpn_mod_1s_2p */
+#define PREINV_MOD_1_TO_MOD_1_THRESHOLD 16
+#define USE_PREINV_DIVREM_1 1 /* native */
+#define DIV_QR_1N_PI1_METHOD 1
+#define DIV_QR_1_NORM_THRESHOLD 2
+#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 40
+
+#define MUL_TOOM22_THRESHOLD 24
+#define MUL_TOOM33_THRESHOLD 81
+#define MUL_TOOM44_THRESHOLD 130
+#define MUL_TOOM6H_THRESHOLD 303
+#define MUL_TOOM8H_THRESHOLD 430
+
+#define MUL_TOOM32_TO_TOOM43_THRESHOLD 81
+#define MUL_TOOM32_TO_TOOM53_THRESHOLD 91
+#define MUL_TOOM42_TO_TOOM53_THRESHOLD 93
+#define MUL_TOOM42_TO_TOOM63_THRESHOLD 92
+#define MUL_TOOM43_TO_TOOM54_THRESHOLD 122
+
+#define SQR_BASECASE_THRESHOLD 0 /* always (native) */
+#define SQR_TOOM2_THRESHOLD 46
+#define SQR_TOOM3_THRESHOLD 78
+#define SQR_TOOM4_THRESHOLD 202
+#define SQR_TOOM6_THRESHOLD 286
+#define SQR_TOOM8_THRESHOLD 422
+
+#define MULMID_TOOM42_THRESHOLD 56
+
+#define MULMOD_BNM1_THRESHOLD 17
+#define SQRMOD_BNM1_THRESHOLD 18
+
+#define MUL_FFT_MODF_THRESHOLD 848 /* k = 5 */
+#define MUL_FFT_TABLE3 \
+ { { 848, 5}, { 27, 6}, { 25, 7}, { 13, 6}, \
+ { 27, 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}, \
+ { 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}, { 103,11}, \
+ { 31,10}, { 63, 9}, { 135,10}, { 79, 9}, \
+ { 167,10}, { 95, 9}, { 199,10}, { 111,11}, \
+ { 63,10}, { 127, 9}, { 255,10}, { 143, 9}, \
+ { 287,10}, { 159,11}, { 95,10}, { 207,12}, \
+ { 63,11}, { 127,10}, { 271, 9}, { 543,10}, \
+ { 287,11}, { 159,10}, { 319, 9}, { 639,10}, \
+ { 335, 9}, { 671,11}, { 191,10}, { 383, 9}, \
+ { 799,11}, { 223,12}, { 127,11}, { 255,10}, \
+ { 543,11}, { 287,10}, { 607, 9}, { 1215,11}, \
+ { 319,10}, { 671, 9}, { 1343,12}, { 191,11}, \
+ { 383,10}, { 799, 9}, { 1599,11}, { 415,10}, \
+ { 863, 9}, { 1727,13}, { 127,12}, { 255,11}, \
+ { 543,10}, { 1119,11}, { 607,10}, { 1215,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}, \
+ { 991,13}, { 255,12}, { 511,11}, { 1023,10}, \
+ { 2111,11}, { 1119,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,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}, \
+ { 4096,13}, { 8192,14}, { 16384,15}, { 32768,16} }
+#define MUL_FFT_TABLE3_SIZE 144
+#define MUL_FFT_THRESHOLD 7552
+
+#define SQR_FFT_MODF_THRESHOLD 618 /* k = 5 */
+#define SQR_FFT_TABLE3 \
+ { { 618, 5}, { 25, 6}, { 13, 5}, { 27, 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}, { 47, 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}, { 135,10}, { 79, 9}, \
+ { 167,10}, { 95, 9}, { 191,10}, { 111,11}, \
+ { 63,10}, { 159,11}, { 95,10}, { 191,12}, \
+ { 63,11}, { 127,10}, { 255, 9}, { 511,10}, \
+ { 271, 9}, { 543, 8}, { 1087,10}, { 287,11}, \
+ { 159,10}, { 319, 9}, { 639,10}, { 335, 9}, \
+ { 671, 8}, { 1343,10}, { 351,11}, { 191,10}, \
+ { 383, 9}, { 767,10}, { 399, 9}, { 799,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, 9}, \
+ { 1599,11}, { 415,10}, { 863, 9}, { 1727,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,10}, { 1727,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,11}, \
+ { 3455,13}, { 895,12}, { 1983,14}, { 511,13}, \
+ { 1023,12}, { 2239,13}, { 1151,12}, { 4096,13}, \
+ { 8192,14}, { 16384,15}, { 32768,16} }
+#define SQR_FFT_TABLE3_SIZE 147
+#define SQR_FFT_THRESHOLD 5760
+
+#define MULLO_BASECASE_THRESHOLD 8
+#define MULLO_DC_THRESHOLD 31
+#define MULLO_MUL_N_THRESHOLD 14281
+
+#define DC_DIV_QR_THRESHOLD 91
+#define DC_DIVAPPR_Q_THRESHOLD 280
+#define DC_BDIV_QR_THRESHOLD 87
+#define DC_BDIV_Q_THRESHOLD 222
+
+#define INV_MULMOD_BNM1_THRESHOLD 62
+#define INV_NEWTON_THRESHOLD 268
+#define INV_APPR_THRESHOLD 270
+
+#define BINV_NEWTON_THRESHOLD 260
+#define REDC_1_TO_REDC_N_THRESHOLD 79
+
+#define MU_DIV_QR_THRESHOLD 1718
+#define MU_DIVAPPR_Q_THRESHOLD 1528
+#define MUPI_DIV_QR_THRESHOLD 97
+#define MU_BDIV_QR_THRESHOLD 1470
+#define MU_BDIV_Q_THRESHOLD 1470
+
+#define POWM_SEC_TABLE 1,22,114,416,1464
+
+#define MATRIX22_STRASSEN_THRESHOLD 16
+#define HGCD_THRESHOLD 149
+#define HGCD_APPR_THRESHOLD 204
+#define HGCD_REDUCE_THRESHOLD 4455
+#define GCD_DC_THRESHOLD 599
+#define GCDEXT_DC_THRESHOLD 403
+#define JACOBI_BASE_METHOD 4
+
+#define GET_STR_DC_THRESHOLD 13
+#define GET_STR_PRECOMPUTE_THRESHOLD 28
+#define SET_STR_DC_THRESHOLD 270
+#define SET_STR_PRECOMPUTE_THRESHOLD 1367
+
+#define FAC_DSC_THRESHOLD 348
+#define FAC_ODD_THRESHOLD 24
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/lshift.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/lshift.asm
new file mode 100644
index 00000000000..6ee6153cc28
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/lshift.asm
@@ -0,0 +1,106 @@
+dnl x86 mpn_lshift -- mpn left shift.
+
+dnl Copyright 1992, 1994, 1996, 1999-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 cycles/limb
+C P54 7.5
+C P55 7.0
+C P6 2.5
+C K6 4.5
+C K7 5.0
+C P4 14.5
+
+
+C mp_limb_t mpn_lshift (mp_ptr dst, mp_srcptr src, mp_size_t size,
+C unsigned shift);
+
+defframe(PARAM_SHIFT,16)
+defframe(PARAM_SIZE, 12)
+defframe(PARAM_SRC, 8)
+defframe(PARAM_DST, 4)
+
+ TEXT
+ ALIGN(8)
+PROLOGUE(mpn_lshift)
+
+ pushl %edi
+ pushl %esi
+ pushl %ebx
+deflit(`FRAME',12)
+
+ movl PARAM_DST,%edi
+ movl PARAM_SRC,%esi
+ movl PARAM_SIZE,%edx
+ movl PARAM_SHIFT,%ecx
+
+ subl $4,%esi C adjust src
+
+ movl (%esi,%edx,4),%ebx C read most significant limb
+ xorl %eax,%eax
+ shldl( %cl, %ebx, %eax) C compute carry limb
+ decl %edx
+ jz L(end)
+ pushl %eax C push carry limb onto stack
+ testb $1,%dl
+ jnz L(1) C enter loop in the middle
+ movl %ebx,%eax
+
+ ALIGN(8)
+L(oop): movl (%esi,%edx,4),%ebx C load next lower limb
+ shldl( %cl, %ebx, %eax) C compute result limb
+ movl %eax,(%edi,%edx,4) C store it
+ decl %edx
+L(1): movl (%esi,%edx,4),%eax
+ shldl( %cl, %eax, %ebx)
+ movl %ebx,(%edi,%edx,4)
+ decl %edx
+ jnz L(oop)
+
+ shll %cl,%eax C compute least significant limb
+ movl %eax,(%edi) C store it
+
+ popl %eax C pop carry limb
+
+ popl %ebx
+ popl %esi
+ popl %edi
+ ret
+
+L(end): shll %cl,%ebx C compute least significant limb
+ movl %ebx,(%edi) C store it
+
+ popl %ebx
+ popl %esi
+ popl %edi
+ ret
+
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/mmx/sec_tabselect.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/mmx/sec_tabselect.asm
new file mode 100644
index 00000000000..aae158abf7b
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/mmx/sec_tabselect.asm
@@ -0,0 +1,163 @@
+dnl X86 MMX mpn_sec_tabselect.
+
+dnl Contributed to the GNU project by Torbjörn Granlund.
+
+dnl Copyright 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/limb cycles/limb
+C ali,evn n unal,evn n
+C P5
+C P6 model 0-8,10-12
+C P6 model 9 (Banias)
+C P6 model 13 (Dothan) 1.33 1.87
+C P4 model 0 (Willamette)
+C P4 model 1 (?)
+C P4 model 2 (Northwood) 2.1 2.63
+C P4 model 3 (Prescott)
+C P4 model 4 (Nocona) 1.7 2.57
+C Intel Atom 1.85 2.7
+C AMD K6
+C AMD K7 1.33 1.33
+C AMD K8
+C AMD K10
+
+define(`rp', `%edi')
+define(`tp', `%esi')
+define(`n', `%edx')
+define(`nents', `%ecx')
+define(`which', `')
+
+define(`i', `%ebp')
+define(`j', `%ebx')
+
+ASM_START()
+ TEXT
+ ALIGN(16)
+PROLOGUE(mpn_sec_tabselect)
+ push %ebx
+ push %esi
+ push %edi
+ push %ebp
+
+ mov 20(%esp), rp
+ mov 24(%esp), tp
+ mov 28(%esp), n
+ mov 32(%esp), nents
+
+ movd 36(%esp), %mm6
+ punpckldq %mm6, %mm6 C 2 copies of `which'
+
+ mov $1, %ebx
+ movd %ebx, %mm7
+ punpckldq %mm7, %mm7 C 2 copies of 1
+
+ mov n, j
+ add $-4, j
+ js L(outer_end)
+
+L(outer_top):
+ mov nents, i
+ mov tp, %eax
+ pxor %mm1, %mm1
+ pxor %mm4, %mm4
+ pxor %mm5, %mm5
+ ALIGN(16)
+L(top): movq %mm6, %mm0
+ pcmpeqd %mm1, %mm0
+ paddd %mm7, %mm1
+ movq (tp), %mm2
+ movq 8(tp), %mm3
+ pand %mm0, %mm2
+ pand %mm0, %mm3
+ por %mm2, %mm4
+ por %mm3, %mm5
+ lea (tp,n,4), tp
+ add $-1, i
+ jne L(top)
+
+ movq %mm4, (rp)
+ movq %mm5, 8(rp)
+
+ lea 16(%eax), tp
+ lea 16(rp), rp
+ add $-4, j
+ jns L(outer_top)
+L(outer_end):
+
+ test $2, %dl
+ jz L(b0x)
+
+L(b1x): mov nents, i
+ mov tp, %eax
+ pxor %mm1, %mm1
+ pxor %mm4, %mm4
+ ALIGN(16)
+L(tp2): movq %mm6, %mm0
+ pcmpeqd %mm1, %mm0
+ paddd %mm7, %mm1
+ movq (tp), %mm2
+ pand %mm0, %mm2
+ por %mm2, %mm4
+ lea (tp,n,4), tp
+ add $-1, i
+ jne L(tp2)
+
+ movq %mm4, (rp)
+
+ lea 8(%eax), tp
+ lea 8(rp), rp
+
+L(b0x): test $1, %dl
+ jz L(b00)
+
+L(b01): mov nents, i
+ pxor %mm1, %mm1
+ pxor %mm4, %mm4
+ ALIGN(16)
+L(tp1): movq %mm6, %mm0
+ pcmpeqd %mm1, %mm0
+ paddd %mm7, %mm1
+ movd (tp), %mm2
+ pand %mm0, %mm2
+ por %mm2, %mm4
+ lea (tp,n,4), tp
+ add $-1, i
+ jne L(tp1)
+
+ movd %mm4, (rp)
+
+L(b00): pop %ebp
+ pop %edi
+ pop %esi
+ pop %ebx
+ emms
+ ret
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/mod_34lsub1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/mod_34lsub1.asm
new file mode 100644
index 00000000000..e09e702c6f8
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/mod_34lsub1.asm
@@ -0,0 +1,183 @@
+dnl Generic x86 mpn_mod_34lsub1 -- mpn remainder modulo 2^24-1.
+
+dnl Copyright 2000-2002, 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 cycles/limb
+C P5 3.0
+C P6 3.66
+C K6 3.0
+C K7 1.3
+C P4 9
+
+
+C mp_limb_t mpn_mod_34lsub1 (mp_srcptr src, mp_size_t size)
+C
+
+defframe(PARAM_SIZE, 8)
+defframe(PARAM_SRC, 4)
+
+dnl re-use parameter space
+define(SAVE_EBX, `PARAM_SRC')
+
+ TEXT
+ ALIGN(16)
+PROLOGUE(mpn_mod_34lsub1)
+deflit(`FRAME',0)
+
+ movl PARAM_SIZE, %ecx
+ movl PARAM_SRC, %edx
+
+ subl $2, %ecx
+ ja L(three_or_more)
+
+ movl (%edx), %eax
+ jb L(one)
+
+ movl 4(%edx), %ecx
+ movl %eax, %edx
+ shrl $24, %eax C src[0] low
+
+ andl $0xFFFFFF, %edx C src[0] high
+ addl %edx, %eax
+ movl %ecx, %edx
+
+ andl $0xFFFF, %ecx
+ shrl $16, %edx C src[1] high
+ addl %edx, %eax
+
+ shll $8, %ecx C src[1] low
+ addl %ecx, %eax
+
+L(one):
+ ret
+
+
+L(three_or_more):
+ C eax
+ C ebx
+ C ecx size-2
+ C edx src
+ C esi
+ C edi
+ C ebp
+
+ movl %ebx, SAVE_EBX C and arrange 16-byte loop alignment
+ xorl %ebx, %ebx
+
+ pushl %esi FRAME_pushl()
+ xorl %esi, %esi
+
+ pushl %edi FRAME_pushl()
+ xorl %eax, %eax C and clear carry flag
+
+
+ C offset 0x40 here
+L(top):
+ C eax acc 0mod3
+ C ebx acc 1mod3
+ C ecx counter, limbs
+ C edx src
+ C esi acc 2mod3
+ C edi
+ C ebp
+
+ leal 12(%edx), %edx
+ leal -2(%ecx), %ecx
+
+ adcl -12(%edx), %eax
+ adcl -8(%edx), %ebx
+ adcl -4(%edx), %esi
+
+ decl %ecx
+ jg L(top)
+
+
+ C ecx is -2, -1 or 0 representing 0, 1 or 2 more limbs, respectively
+
+ movl $0xFFFFFFFF, %edi
+ incl %ecx
+ js L(combine)
+
+ adcl (%edx), %eax
+ movl $0xFFFFFF00, %edi
+ decl %ecx
+ js L(combine)
+
+ adcl 4(%edx), %ebx
+ movl $0xFFFF0000, %edi
+
+
+L(combine):
+ C eax acc 0mod3
+ C ebx acc 1mod3
+ C ecx
+ C edx
+ C esi acc 2mod3
+ C edi mask
+ C ebp
+
+ sbbl %ecx, %ecx C carry
+ movl %eax, %edx C 0mod3
+
+ shrl $24, %eax C 0mod3 high
+ andl %edi, %ecx C carry masked
+
+ subl %ecx, %eax C apply carry
+ movl %ebx, %edi C 1mod3
+
+ shrl $16, %ebx C 1mod3 high
+ andl $0x00FFFFFF, %edx C 0mod3 low
+
+ addl %edx, %eax C apply 0mod3 low
+ andl $0xFFFF, %edi
+
+ shll $8, %edi C 1mod3 low
+ addl %ebx, %eax C apply 1mod3 high
+
+ addl %edi, %eax C apply 1mod3 low
+ movl %esi, %edx C 2mod3
+
+ shrl $8, %esi C 2mod3 high
+ andl $0xFF, %edx C 2mod3 low
+
+ shll $16, %edx C 2mod3 low
+ addl %esi, %eax C apply 2mod3 high
+
+ addl %edx, %eax C apply 2mod3 low
+ popl %edi FRAME_popl()
+
+ movl SAVE_EBX, %ebx
+ popl %esi FRAME_popl()
+
+ ret
+
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/mul_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/mul_1.asm
new file mode 100644
index 00000000000..421de622253
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/mul_1.asm
@@ -0,0 +1,140 @@
+dnl x86 mpn_mul_1 (for 386, 486, and Pentium Pro) -- Multiply a limb vector
+dnl with a limb and store the result in a second limb vector.
+
+dnl Copyright 1992, 1994, 1997-2002, 2005 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 P5 12.5
+C P6 model 0-8,10-12 5.5
+C P6 model 9 (Banias)
+C P6 model 13 (Dothan) 5.25
+C P4 model 0 (Willamette) 19.0
+C P4 model 1 (?) 19.0
+C P4 model 2 (Northwood) 19.0
+C P4 model 3 (Prescott)
+C P4 model 4 (Nocona)
+C AMD K6 10.5
+C AMD K7 4.5
+C AMD K8
+
+
+C mp_limb_t mpn_mul_1 (mp_ptr dst, mp_srcptr src, mp_size_t size,
+C mp_limb_t multiplier);
+
+defframe(PARAM_MULTIPLIER,16)
+defframe(PARAM_SIZE, 12)
+defframe(PARAM_SRC, 8)
+defframe(PARAM_DST, 4)
+
+ TEXT
+ ALIGN(8)
+PROLOGUE(mpn_mul_1)
+deflit(`FRAME',0)
+
+ pushl %edi
+ pushl %esi
+ pushl %ebx
+ pushl %ebp
+deflit(`FRAME',16)
+
+ movl PARAM_DST,%edi
+ movl PARAM_SRC,%esi
+ movl PARAM_SIZE,%ecx
+
+ xorl %ebx,%ebx
+ andl $3,%ecx
+ jz L(end0)
+
+L(oop0):
+ movl (%esi),%eax
+ mull PARAM_MULTIPLIER
+ leal 4(%esi),%esi
+ addl %ebx,%eax
+ movl $0,%ebx
+ adcl %ebx,%edx
+ movl %eax,(%edi)
+ movl %edx,%ebx C propagate carry into cylimb
+
+ leal 4(%edi),%edi
+ decl %ecx
+ jnz L(oop0)
+
+L(end0):
+ movl PARAM_SIZE,%ecx
+ shrl $2,%ecx
+ jz L(end)
+
+
+ ALIGN(8)
+L(oop): movl (%esi),%eax
+ mull PARAM_MULTIPLIER
+ addl %eax,%ebx
+ movl $0,%ebp
+ adcl %edx,%ebp
+
+ movl 4(%esi),%eax
+ mull PARAM_MULTIPLIER
+ movl %ebx,(%edi)
+ addl %eax,%ebp C new lo + cylimb
+ movl $0,%ebx
+ adcl %edx,%ebx
+
+ movl 8(%esi),%eax
+ mull PARAM_MULTIPLIER
+ movl %ebp,4(%edi)
+ addl %eax,%ebx C new lo + cylimb
+ movl $0,%ebp
+ adcl %edx,%ebp
+
+ movl 12(%esi),%eax
+ mull PARAM_MULTIPLIER
+ movl %ebx,8(%edi)
+ addl %eax,%ebp C new lo + cylimb
+ movl $0,%ebx
+ adcl %edx,%ebx
+
+ movl %ebp,12(%edi)
+
+ leal 16(%esi),%esi
+ leal 16(%edi),%edi
+ decl %ecx
+ jnz L(oop)
+
+L(end): movl %ebx,%eax
+
+ popl %ebp
+ popl %ebx
+ popl %esi
+ popl %edi
+ ret
+
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/mul_basecase.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/mul_basecase.asm
new file mode 100644
index 00000000000..8339732a80c
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/mul_basecase.asm
@@ -0,0 +1,223 @@
+dnl x86 mpn_mul_basecase -- Multiply two limb vectors and store the result
+dnl in a third limb vector.
+
+dnl Copyright 1996-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 cycles/crossproduct
+C P5 15
+C P6 7.5
+C K6 12.5
+C K7 5.5
+C P4 24
+
+
+C void mpn_mul_basecase (mp_ptr wp,
+C mp_srcptr xp, mp_size_t xsize,
+C mp_srcptr yp, mp_size_t ysize);
+C
+C This was written in a haste since the Pentium optimized code that was used
+C for all x86 machines was slow for the Pentium II. This code would benefit
+C from some cleanup.
+C
+C To shave off some percentage of the run-time, one should make 4 variants
+C of the Louter loop, for the four different outcomes of un mod 4. That
+C would avoid Loop0 altogether. Code expansion would be > 4-fold for that
+C part of the function, but since it is not very large, that would be
+C acceptable.
+C
+C The mul loop (at L(oopM)) might need some tweaking. It's current speed is
+C unknown.
+
+defframe(PARAM_YSIZE,20)
+defframe(PARAM_YP, 16)
+defframe(PARAM_XSIZE,12)
+defframe(PARAM_XP, 8)
+defframe(PARAM_WP, 4)
+
+defframe(VAR_MULTIPLIER, -4)
+defframe(VAR_COUNTER, -8)
+deflit(VAR_STACK_SPACE, 8)
+
+ TEXT
+ ALIGN(8)
+
+PROLOGUE(mpn_mul_basecase)
+deflit(`FRAME',0)
+
+ subl $VAR_STACK_SPACE,%esp
+ pushl %esi
+ pushl %ebp
+ pushl %edi
+deflit(`FRAME',eval(VAR_STACK_SPACE+12))
+
+ movl PARAM_XP,%esi
+ movl PARAM_WP,%edi
+ movl PARAM_YP,%ebp
+
+ movl (%esi),%eax C load xp[0]
+ mull (%ebp) C multiply by yp[0]
+ movl %eax,(%edi) C store to wp[0]
+ movl PARAM_XSIZE,%ecx C xsize
+ decl %ecx C If xsize = 1, ysize = 1 too
+ jz L(done)
+
+ pushl %ebx
+FRAME_pushl()
+ movl %edx,%ebx
+
+ leal 4(%esi),%esi
+ leal 4(%edi),%edi
+
+L(oopM):
+ movl (%esi),%eax C load next limb at xp[j]
+ leal 4(%esi),%esi
+ mull (%ebp)
+ addl %ebx,%eax
+ movl %edx,%ebx
+ adcl $0,%ebx
+ movl %eax,(%edi)
+ leal 4(%edi),%edi
+ decl %ecx
+ jnz L(oopM)
+
+ movl %ebx,(%edi) C most significant limb of product
+ addl $4,%edi C increment wp
+ movl PARAM_XSIZE,%eax
+ shll $2,%eax
+ subl %eax,%edi
+ subl %eax,%esi
+
+ movl PARAM_YSIZE,%eax C ysize
+ decl %eax
+ jz L(skip)
+ movl %eax,VAR_COUNTER C set index i to ysize
+
+L(outer):
+ movl PARAM_YP,%ebp C yp
+ addl $4,%ebp C make ebp point to next v limb
+ movl %ebp,PARAM_YP
+ movl (%ebp),%eax C copy y limb ...
+ movl %eax,VAR_MULTIPLIER C ... to stack slot
+ movl PARAM_XSIZE,%ecx
+
+ xorl %ebx,%ebx
+ andl $3,%ecx
+ jz L(end0)
+
+L(oop0):
+ movl (%esi),%eax
+ mull VAR_MULTIPLIER
+ leal 4(%esi),%esi
+ addl %ebx,%eax
+ movl $0,%ebx
+ adcl %ebx,%edx
+ addl %eax,(%edi)
+ adcl %edx,%ebx C propagate carry into cylimb
+
+ leal 4(%edi),%edi
+ decl %ecx
+ jnz L(oop0)
+
+L(end0):
+ movl PARAM_XSIZE,%ecx
+ shrl $2,%ecx
+ jz L(endX)
+
+ ALIGN(8)
+L(oopX):
+ movl (%esi),%eax
+ mull VAR_MULTIPLIER
+ addl %eax,%ebx
+ movl $0,%ebp
+ adcl %edx,%ebp
+
+ movl 4(%esi),%eax
+ mull VAR_MULTIPLIER
+ addl %ebx,(%edi)
+ adcl %eax,%ebp C new lo + cylimb
+ movl $0,%ebx
+ adcl %edx,%ebx
+
+ movl 8(%esi),%eax
+ mull VAR_MULTIPLIER
+ addl %ebp,4(%edi)
+ adcl %eax,%ebx C new lo + cylimb
+ movl $0,%ebp
+ adcl %edx,%ebp
+
+ movl 12(%esi),%eax
+ mull VAR_MULTIPLIER
+ addl %ebx,8(%edi)
+ adcl %eax,%ebp C new lo + cylimb
+ movl $0,%ebx
+ adcl %edx,%ebx
+
+ addl %ebp,12(%edi)
+ adcl $0,%ebx C propagate carry into cylimb
+
+ leal 16(%esi),%esi
+ leal 16(%edi),%edi
+ decl %ecx
+ jnz L(oopX)
+
+L(endX):
+ movl %ebx,(%edi)
+ addl $4,%edi
+
+ C we incremented wp and xp in the loop above; compensate
+ movl PARAM_XSIZE,%eax
+ shll $2,%eax
+ subl %eax,%edi
+ subl %eax,%esi
+
+ movl VAR_COUNTER,%eax
+ decl %eax
+ movl %eax,VAR_COUNTER
+ jnz L(outer)
+
+L(skip):
+ popl %ebx
+ popl %edi
+ popl %ebp
+ popl %esi
+ addl $8,%esp
+ ret
+
+L(done):
+ movl %edx,4(%edi) C store to wp[1]
+ popl %edi
+ popl %ebp
+ popl %esi
+ addl $8,%esp
+ ret
+
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/nano/gmp-mparam.h b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/nano/gmp-mparam.h
new file mode 100644
index 00000000000..cd8ac4e1d6e
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/nano/gmp-mparam.h
@@ -0,0 +1,162 @@
+/* x86/nano gmp-mparam.h -- Compiler/machine parameter header file.
+
+Copyright 1991, 1993, 1994, 2000-2011 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
+
+/* Generated by tuneup.c, 2011-11-25, gcc 4.2 */
+
+#define MOD_1_1P_METHOD 1
+#define MOD_1_NORM_THRESHOLD 3
+#define MOD_1_UNNORM_THRESHOLD 3
+#define MOD_1N_TO_MOD_1_1_THRESHOLD 10
+#define MOD_1U_TO_MOD_1_1_THRESHOLD 9
+#define MOD_1_1_TO_MOD_1_2_THRESHOLD 0 /* never mpn_mod_1_1p */
+#define MOD_1_2_TO_MOD_1_4_THRESHOLD 53
+#define PREINV_MOD_1_TO_MOD_1_THRESHOLD 12
+#define USE_PREINV_DIVREM_1 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 32
+
+#define MUL_TOOM22_THRESHOLD 16
+#define MUL_TOOM33_THRESHOLD 132
+#define MUL_TOOM44_THRESHOLD 195
+#define MUL_TOOM6H_THRESHOLD 270
+#define MUL_TOOM8H_THRESHOLD 478
+
+#define MUL_TOOM32_TO_TOOM43_THRESHOLD 129
+#define MUL_TOOM32_TO_TOOM53_THRESHOLD 138
+#define MUL_TOOM42_TO_TOOM53_THRESHOLD 130
+#define MUL_TOOM42_TO_TOOM63_THRESHOLD 135
+
+#define SQR_BASECASE_THRESHOLD 0 /* always (native) */
+#define SQR_TOOM2_THRESHOLD 28
+#define SQR_TOOM3_THRESHOLD 194
+#define SQR_TOOM4_THRESHOLD 502
+#define SQR_TOOM6_THRESHOLD 746
+#define SQR_TOOM8_THRESHOLD 1005
+
+#define MULMID_TOOM42_THRESHOLD 40
+
+#define MULMOD_BNM1_THRESHOLD 14
+#define SQRMOD_BNM1_THRESHOLD 19
+
+#define POWM_SEC_TABLE 4,23,258,828,2246
+
+#define MUL_FFT_MODF_THRESHOLD 308 /* k = 5 */
+#define MUL_FFT_TABLE3 \
+ { { 308, 5}, { 13, 6}, { 7, 5}, { 17, 6}, \
+ { 9, 5}, { 19, 6}, { 11, 5}, { 23, 6}, \
+ { 13, 7}, { 7, 6}, { 17, 7}, { 9, 6}, \
+ { 19, 7}, { 11, 6}, { 24, 7}, { 15, 6}, \
+ { 31, 7}, { 19, 8}, { 11, 7}, { 25, 8}, \
+ { 15, 7}, { 33, 8}, { 19, 7}, { 39, 8}, \
+ { 23, 7}, { 47, 9}, { 15, 8}, { 31, 7}, \
+ { 63, 8}, { 39, 9}, { 23, 8}, { 47,10}, \
+ { 15, 9}, { 31, 8}, { 63, 9}, { 47,10}, \
+ { 31, 9}, { 71,10}, { 47, 9}, { 95,11}, \
+ { 31,10}, { 63, 9}, { 127, 8}, { 255,10}, \
+ { 79, 9}, { 159,10}, { 95, 9}, { 191,11}, \
+ { 63,10}, { 127, 9}, { 255, 8}, { 543, 9}, \
+ { 287, 8}, { 575, 7}, { 1215,10}, { 159,11}, \
+ { 95,10}, { 191,12}, { 63,11}, { 127,10}, \
+ { 255, 9}, { 543, 8}, { 1087,10}, { 287, 9}, \
+ { 607, 8}, { 1215,11}, { 159,10}, { 319, 9}, \
+ { 639,10}, { 351, 9}, { 703, 8}, { 1407, 9}, \
+ { 735, 8}, { 1471,11}, { 191,10}, { 383, 9}, \
+ { 767,10}, { 415, 9}, { 831,11}, { 223,10}, \
+ { 447, 9}, { 895,10}, { 479, 9}, { 959, 8}, \
+ { 1919,12}, { 4096,13}, { 8192,14}, { 16384,15}, \
+ { 32768,16} }
+#define MUL_FFT_TABLE3_SIZE 89
+#define MUL_FFT_THRESHOLD 1856
+
+#define SQR_FFT_MODF_THRESHOLD 396 /* k = 5 */
+#define SQR_FFT_TABLE3 \
+ { { 396, 5}, { 13, 6}, { 7, 5}, { 21, 6}, \
+ { 11, 5}, { 23, 6}, { 21, 7}, { 11, 6}, \
+ { 25, 7}, { 15, 6}, { 31, 7}, { 19, 6}, \
+ { 39, 7}, { 21, 8}, { 11, 7}, { 23, 6}, \
+ { 47, 7}, { 27, 8}, { 15, 7}, { 33, 8}, \
+ { 19, 7}, { 39, 8}, { 23, 7}, { 47, 8}, \
+ { 27, 9}, { 15, 8}, { 31, 7}, { 63, 8}, \
+ { 39, 9}, { 23, 8}, { 47,10}, { 15, 9}, \
+ { 31, 8}, { 63, 9}, { 39, 8}, { 79, 9}, \
+ { 47,10}, { 31, 9}, { 79,10}, { 47, 9}, \
+ { 95,11}, { 31,10}, { 63, 9}, { 127,10}, \
+ { 79, 9}, { 159,10}, { 95,11}, { 63,10}, \
+ { 127, 9}, { 255, 8}, { 543,10}, { 143, 9}, \
+ { 287, 8}, { 607, 7}, { 1215, 6}, { 2431,10}, \
+ { 159, 8}, { 639,11}, { 95,10}, { 191,12}, \
+ { 63,11}, { 127,10}, { 255, 9}, { 543, 8}, \
+ { 1087,10}, { 287, 9}, { 607, 8}, { 1215,11}, \
+ { 159,10}, { 319, 9}, { 671,10}, { 351, 9}, \
+ { 703, 8}, { 1407, 9}, { 735, 8}, { 1471, 7}, \
+ { 2943,11}, { 191,10}, { 383, 9}, { 799,10}, \
+ { 415, 9}, { 895,10}, { 479,12}, { 4096,13}, \
+ { 8192,14}, { 16384,15}, { 32768,16} }
+#define SQR_FFT_TABLE3_SIZE 87
+#define SQR_FFT_THRESHOLD 2368
+
+#define MULLO_BASECASE_THRESHOLD 0 /* always */
+#define MULLO_DC_THRESHOLD 51
+#define MULLO_MUL_N_THRESHOLD 3369
+
+#define DC_DIV_QR_THRESHOLD 56
+#define DC_DIVAPPR_Q_THRESHOLD 183
+#define DC_BDIV_QR_THRESHOLD 55
+#define DC_BDIV_Q_THRESHOLD 118
+
+#define INV_MULMOD_BNM1_THRESHOLD 30
+#define INV_NEWTON_THRESHOLD 266
+#define INV_APPR_THRESHOLD 218
+
+#define BINV_NEWTON_THRESHOLD 268
+#define REDC_1_TO_REDC_N_THRESHOLD 56
+
+#define MU_DIV_QR_THRESHOLD 1308
+#define MU_DIVAPPR_Q_THRESHOLD 1528
+#define MUPI_DIV_QR_THRESHOLD 124
+#define MU_BDIV_QR_THRESHOLD 855
+#define MU_BDIV_Q_THRESHOLD 1334
+
+#define MATRIX22_STRASSEN_THRESHOLD 14
+#define HGCD_THRESHOLD 104
+#define HGCD_APPR_THRESHOLD 139
+#define HGCD_REDUCE_THRESHOLD 2121
+#define GCD_DC_THRESHOLD 456
+#define GCDEXT_DC_THRESHOLD 321
+#define JACOBI_BASE_METHOD 4
+
+#define GET_STR_DC_THRESHOLD 11
+#define GET_STR_PRECOMPUTE_THRESHOLD 25
+#define SET_STR_DC_THRESHOLD 542
+#define SET_STR_PRECOMPUTE_THRESHOLD 840
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/p6/README b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/p6/README
new file mode 100644
index 00000000000..f19d47b94fa
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/p6/README
@@ -0,0 +1,125 @@
+Copyright 2000, 2001 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/.
+
+
+
+
+
+ INTEL P6 MPN SUBROUTINES
+
+
+
+This directory contains code optimized for Intel P6 class CPUs, meaning
+PentiumPro, Pentium II and Pentium III. The mmx and p3mmx subdirectories
+have routines using MMX instructions.
+
+
+
+STATUS
+
+Times for the loops, with all code and data in L1 cache, are as follows.
+Some of these might be able to be improved.
+
+ cycles/limb
+
+ mpn_add_n/sub_n 3.7
+
+ mpn_copyi 0.75
+ mpn_copyd 1.75 (or 0.75 if no overlap)
+
+ mpn_divrem_1 39.0
+ mpn_mod_1 21.5
+ mpn_divexact_by3 8.5
+
+ mpn_mul_1 5.5
+ mpn_addmul/submul_1 6.35
+
+ mpn_l/rshift 2.5
+
+ mpn_mul_basecase 8.2 cycles/crossproduct (approx)
+ mpn_sqr_basecase 4.0 cycles/crossproduct (approx)
+ or 7.75 cycles/triangleproduct (approx)
+
+Pentium II and III have MMX and get the following improvements.
+
+ mpn_divrem_1 25.0 integer part, 17.5 fractional part
+
+ mpn_l/rshift 1.75
+
+
+
+
+NOTES
+
+Write-allocate L1 data cache means prefetching of destinations is unnecessary.
+
+Mispredicted branches have a penalty of between 9 and 15 cycles, and even up
+to 26 cycles depending how far speculative execution has gone. The 9 cycle
+minimum penalty comes from the issue pipeline being 9 stages.
+
+A copy with rep movs seems to copy 16 bytes at a time, since speeds for 4,
+5, 6 or 7 limb operations are all the same. The 0.75 cycles/limb would be 3
+cycles per 16 byte block.
+
+
+
+
+CODING
+
+Instructions in general code have been shown grouped if they can execute
+together, which means up to three instructions with no successive
+dependencies, and with only the first being a multiple micro-op.
+
+P6 has out-of-order execution, so the groupings are really only showing
+dependent paths where some shuffling might allow some latencies to be
+hidden.
+
+
+
+
+REFERENCES
+
+"Intel Architecture Optimization Reference Manual", 1999, revision 001 dated
+02/99, order number 245127 (order number 730795-001 is in the document too).
+Available on-line:
+
+ http://download.intel.com/design/PentiumII/manuals/245127.htm
+
+"Intel Architecture Optimization Manual", 1997, order number 242816. This
+is an older document mostly about P5 and not as good as the above.
+Available on-line:
+
+ http://download.intel.com/design/PentiumII/manuals/242816.htm
+
+
+
+----------------
+Local variables:
+mode: text
+fill-column: 76
+End:
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/p6/aors_n.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/p6/aors_n.asm
new file mode 100644
index 00000000000..df51c2e6f76
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/p6/aors_n.asm
@@ -0,0 +1,156 @@
+dnl Intel P6 mpn_add_n/mpn_sub_n -- mpn add or subtract.
+
+dnl Copyright 2006 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 TODO:
+C * Avoid indexed addressing, it makes us stall on the two-ported register
+C file.
+
+C cycles/limb
+C P6 model 0-8,10-12 3.17
+C P6 model 9 (Banias) 2.15
+C P6 model 13 (Dothan) 2.25
+
+
+define(`rp', `%edi')
+define(`up', `%esi')
+define(`vp', `%ebx')
+define(`n', `%ecx')
+
+ifdef(`OPERATION_add_n', `
+ define(ADCSBB, adc)
+ define(func, mpn_add_n)
+ define(func_nc, mpn_add_nc)')
+ifdef(`OPERATION_sub_n', `
+ define(ADCSBB, sbb)
+ define(func, mpn_sub_n)
+ define(func_nc, mpn_sub_nc)')
+
+MULFUNC_PROLOGUE(mpn_add_n mpn_add_nc mpn_sub_n mpn_sub_nc)
+
+ASM_START()
+
+ TEXT
+ ALIGN(16)
+
+PROLOGUE(func)
+ xor %edx, %edx
+L(start):
+ push %edi
+ push %esi
+ push %ebx
+
+ mov 16(%esp), rp
+ mov 20(%esp), up
+ mov 24(%esp), vp
+ mov 28(%esp), n
+
+ lea (up,n,4), up
+ lea (vp,n,4), vp
+ lea (rp,n,4), rp
+
+ neg n
+ mov n, %eax
+ and $-8, n
+ and $7, %eax
+ shl $2, %eax C 4x
+ifdef(`PIC',`
+ call L(pic_calc)
+L(here):
+',`
+ lea L(ent) (%eax,%eax,2), %eax C 12x
+')
+
+ shr %edx C set cy flag
+ jmp *%eax
+
+ifdef(`PIC',`
+L(pic_calc):
+ C See mpn/x86/README about old gas bugs
+ lea (%eax,%eax,2), %eax
+ add $L(ent)-L(here), %eax
+ add (%esp), %eax
+ ret_internal
+')
+
+L(end):
+ sbb %eax, %eax
+ neg %eax
+ pop %ebx
+ pop %esi
+ pop %edi
+ ret
+
+ ALIGN(16)
+L(top):
+ jecxz L(end)
+L(ent):
+Zdisp( mov, 0,(up,n,4), %eax)
+Zdisp( ADCSBB, 0,(vp,n,4), %eax)
+Zdisp( mov, %eax, 0,(rp,n,4))
+
+ mov 4(up,n,4), %edx
+ ADCSBB 4(vp,n,4), %edx
+ mov %edx, 4(rp,n,4)
+
+ mov 8(up,n,4), %eax
+ ADCSBB 8(vp,n,4), %eax
+ mov %eax, 8(rp,n,4)
+
+ mov 12(up,n,4), %edx
+ ADCSBB 12(vp,n,4), %edx
+ mov %edx, 12(rp,n,4)
+
+ mov 16(up,n,4), %eax
+ ADCSBB 16(vp,n,4), %eax
+ mov %eax, 16(rp,n,4)
+
+ mov 20(up,n,4), %edx
+ ADCSBB 20(vp,n,4), %edx
+ mov %edx, 20(rp,n,4)
+
+ mov 24(up,n,4), %eax
+ ADCSBB 24(vp,n,4), %eax
+ mov %eax, 24(rp,n,4)
+
+ mov 28(up,n,4), %edx
+ ADCSBB 28(vp,n,4), %edx
+ mov %edx, 28(rp,n,4)
+
+ lea 8(n), n
+ jmp L(top)
+
+EPILOGUE()
+
+PROLOGUE(func_nc)
+ movl 20(%esp), %edx
+ jmp L(start)
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/p6/aorsmul_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/p6/aorsmul_1.asm
new file mode 100644
index 00000000000..bc8c49c62e8
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/p6/aorsmul_1.asm
@@ -0,0 +1,320 @@
+dnl Intel P6 mpn_addmul_1/mpn_submul_1 -- add or subtract mpn multiple.
+
+dnl Copyright 1999-2002, 2005 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 P5
+C P6 model 0-8,10-12 6.44
+C P6 model 9 (Banias) 6.15
+C P6 model 13 (Dothan) 6.11
+C P4 model 0 (Willamette)
+C P4 model 1 (?)
+C P4 model 2 (Northwood)
+C P4 model 3 (Prescott)
+C P4 model 4 (Nocona)
+C AMD K6
+C AMD K7
+C AMD K8
+
+
+dnl P6 UNROLL_COUNT cycles/limb
+dnl 8 6.7
+dnl 16 6.35
+dnl 32 6.3
+dnl 64 6.3
+dnl Maximum possible with the current code is 64.
+
+deflit(UNROLL_COUNT, 16)
+
+
+ifdef(`OPERATION_addmul_1', `
+ define(M4_inst, addl)
+ define(M4_function_1, mpn_addmul_1)
+ define(M4_function_1c, mpn_addmul_1c)
+ define(M4_description, add it to)
+ define(M4_desc_retval, carry)
+',`ifdef(`OPERATION_submul_1', `
+ define(M4_inst, subl)
+ define(M4_function_1, mpn_submul_1)
+ define(M4_function_1c, mpn_submul_1c)
+ define(M4_description, subtract it from)
+ define(M4_desc_retval, borrow)
+',`m4_error(`Need OPERATION_addmul_1 or OPERATION_submul_1
+')')')
+
+MULFUNC_PROLOGUE(mpn_addmul_1 mpn_addmul_1c mpn_submul_1 mpn_submul_1c)
+
+
+C mp_limb_t M4_function_1 (mp_ptr dst, mp_srcptr src, mp_size_t size,
+C mp_limb_t mult);
+C mp_limb_t M4_function_1c (mp_ptr dst, mp_srcptr src, mp_size_t size,
+C mp_limb_t mult, mp_limb_t carry);
+C
+C Calculate src,size multiplied by mult and M4_description dst,size.
+C Return the M4_desc_retval limb from the top of the result.
+C
+C This code is pretty much the same as the K6 code. The unrolled loop is
+C the same, but there's just a few scheduling tweaks in the setups and the
+C simple loop.
+C
+C A number of variations have been tried for the unrolled loop, with one or
+C two carries, and with loads scheduled earlier, but nothing faster than 6
+C cycles/limb has been found.
+
+ifdef(`PIC',`
+deflit(UNROLL_THRESHOLD, 5)
+',`
+deflit(UNROLL_THRESHOLD, 5)
+')
+
+defframe(PARAM_CARRY, 20)
+defframe(PARAM_MULTIPLIER,16)
+defframe(PARAM_SIZE, 12)
+defframe(PARAM_SRC, 8)
+defframe(PARAM_DST, 4)
+
+ TEXT
+ ALIGN(32)
+
+PROLOGUE(M4_function_1c)
+ pushl %ebx
+deflit(`FRAME',4)
+ movl PARAM_CARRY, %ebx
+ jmp L(start_nc)
+EPILOGUE()
+
+PROLOGUE(M4_function_1)
+ push %ebx
+deflit(`FRAME',4)
+ xorl %ebx, %ebx C initial carry
+
+L(start_nc):
+ movl PARAM_SIZE, %ecx
+ pushl %esi
+deflit(`FRAME',8)
+
+ movl PARAM_SRC, %esi
+ pushl %edi
+deflit(`FRAME',12)
+
+ movl PARAM_DST, %edi
+ pushl %ebp
+deflit(`FRAME',16)
+ cmpl $UNROLL_THRESHOLD, %ecx
+
+ movl PARAM_MULTIPLIER, %ebp
+ jae L(unroll)
+
+
+ C simple loop
+ C this is offset 0x22, so close enough to aligned
+L(simple):
+ C eax scratch
+ C ebx carry
+ C ecx counter
+ C edx scratch
+ C esi src
+ C edi dst
+ C ebp multiplier
+
+ movl (%esi), %eax
+ addl $4, %edi
+
+ mull %ebp
+
+ addl %ebx, %eax
+ adcl $0, %edx
+
+ M4_inst %eax, -4(%edi)
+ movl %edx, %ebx
+
+ adcl $0, %ebx
+ decl %ecx
+
+ leal 4(%esi), %esi
+ jnz L(simple)
+
+
+ popl %ebp
+ popl %edi
+
+ popl %esi
+ movl %ebx, %eax
+
+ popl %ebx
+ ret
+
+
+
+C------------------------------------------------------------------------------
+C VAR_JUMP holds the computed jump temporarily because there's not enough
+C registers when doing the mul for the initial two carry limbs.
+C
+C The add/adc for the initial carry in %ebx is necessary only for the
+C mpn_add/submul_1c entry points. Duplicating the startup code to
+C eliminate this for the plain mpn_add/submul_1 doesn't seem like a good
+C idea.
+
+dnl overlapping with parameters already fetched
+define(VAR_COUNTER,`PARAM_SIZE')
+define(VAR_JUMP, `PARAM_DST')
+
+ C this is offset 0x43, so close enough to aligned
+L(unroll):
+ C eax
+ C ebx initial carry
+ C ecx size
+ C edx
+ C esi src
+ C edi dst
+ C ebp
+
+ movl %ecx, %edx
+ decl %ecx
+
+ subl $2, %edx
+ negl %ecx
+
+ shrl $UNROLL_LOG2, %edx
+ andl $UNROLL_MASK, %ecx
+
+ movl %edx, VAR_COUNTER
+ movl %ecx, %edx
+
+ C 15 code bytes per limb
+ifdef(`PIC',`
+ call L(pic_calc)
+L(here):
+',`
+ shll $4, %edx
+ negl %ecx
+
+ leal L(entry) (%edx,%ecx,1), %edx
+')
+ movl (%esi), %eax C src low limb
+
+ movl %edx, VAR_JUMP
+ leal ifelse(UNROLL_BYTES,256,128+) 4(%esi,%ecx,4), %esi
+
+ mull %ebp
+
+ addl %ebx, %eax C initial carry (from _1c)
+ adcl $0, %edx
+
+ movl %edx, %ebx C high carry
+ leal ifelse(UNROLL_BYTES,256,128) (%edi,%ecx,4), %edi
+
+ movl VAR_JUMP, %edx
+ testl $1, %ecx
+ movl %eax, %ecx C low carry
+
+ cmovnz( %ebx, %ecx) C high,low carry other way around
+ cmovnz( %eax, %ebx)
+
+ jmp *%edx
+
+
+ifdef(`PIC',`
+L(pic_calc):
+ shll $4, %edx
+ negl %ecx
+
+ C See mpn/x86/README about old gas bugs
+ leal (%edx,%ecx,1), %edx
+ addl $L(entry)-L(here), %edx
+
+ addl (%esp), %edx
+
+ ret_internal
+')
+
+
+C -----------------------------------------------------------
+ ALIGN(32)
+L(top):
+deflit(`FRAME',16)
+ C eax scratch
+ C ebx carry hi
+ C ecx carry lo
+ C edx scratch
+ C esi src
+ C edi dst
+ C ebp multiplier
+ C
+ C VAR_COUNTER loop counter
+ C
+ C 15 code bytes per limb
+
+ addl $UNROLL_BYTES, %edi
+
+L(entry):
+deflit(CHUNK_COUNT,2)
+forloop(`i', 0, UNROLL_COUNT/CHUNK_COUNT-1, `
+ deflit(`disp0', eval(i*4*CHUNK_COUNT ifelse(UNROLL_BYTES,256,-128)))
+ deflit(`disp1', eval(disp0 + 4))
+
+Zdisp( movl, disp0,(%esi), %eax)
+ mull %ebp
+Zdisp( M4_inst,%ecx, disp0,(%edi))
+ adcl %eax, %ebx
+ movl %edx, %ecx
+ adcl $0, %ecx
+
+ movl disp1(%esi), %eax
+ mull %ebp
+ M4_inst %ebx, disp1(%edi)
+ adcl %eax, %ecx
+ movl %edx, %ebx
+ adcl $0, %ebx
+')
+
+ decl VAR_COUNTER
+ leal UNROLL_BYTES(%esi), %esi
+
+ jns L(top)
+
+
+deflit(`disp0', eval(UNROLL_BYTES ifelse(UNROLL_BYTES,256,-128)))
+
+ M4_inst %ecx, disp0(%edi)
+ movl %ebx, %eax
+
+ popl %ebp
+ popl %edi
+
+ popl %esi
+ popl %ebx
+ adcl $0, %eax
+
+ ret
+
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/p6/bdiv_q_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/p6/bdiv_q_1.asm
new file mode 100644
index 00000000000..2cc179c2384
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/p6/bdiv_q_1.asm
@@ -0,0 +1,286 @@
+dnl Intel P6 mpn_modexact_1_odd -- exact division style remainder.
+
+dnl Rearranged from mpn/x86/p6/dive_1.asm by Marco Bodrato.
+
+dnl Copyright 2001, 2002, 2007, 2011 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 odd even divisor
+C P6: 10.0 12.0 cycles/limb
+
+C MULFUNC_PROLOGUE(mpn_bdiv_q_1 mpn_pi1_bdiv_q_1)
+
+C The odd case is basically the same as mpn_modexact_1_odd, just with an
+C extra store, and it runs at the same 10 cycles which is the dependent
+C chain.
+C
+C The shifts for the even case aren't on the dependent chain so in principle
+C it could run the same too, but nothing running at 10 has been found.
+C Perhaps there's too many uops (an extra 4 over the odd case).
+
+defframe(PARAM_SHIFT, 24)
+defframe(PARAM_INVERSE,20)
+defframe(PARAM_DIVISOR,16)
+defframe(PARAM_SIZE, 12)
+defframe(PARAM_SRC, 8)
+defframe(PARAM_DST, 4)
+
+defframe(SAVE_EBX, -4)
+defframe(SAVE_ESI, -8)
+defframe(SAVE_EDI, -12)
+defframe(SAVE_EBP, -16)
+deflit(STACK_SPACE, 16)
+
+dnl re-use parameter space
+define(VAR_INVERSE,`PARAM_SRC')
+
+ TEXT
+
+C mp_limb_t
+C mpn_pi1_bdiv_q_1 (mp_ptr dst, mp_srcptr src, mp_size_t size, mp_limb_t divisor,
+C mp_limb_t inverse, int shift)
+
+ ALIGN(16)
+PROLOGUE(mpn_pi1_bdiv_q_1)
+deflit(`FRAME',0)
+
+ subl $STACK_SPACE, %esp FRAME_subl_esp(STACK_SPACE)
+
+ movl %esi, SAVE_ESI
+ movl PARAM_SRC, %esi
+
+ movl %ebx, SAVE_EBX
+ movl PARAM_SIZE, %ebx
+
+ movl %ebp, SAVE_EBP
+ movl PARAM_INVERSE, %ebp
+
+ movl PARAM_SHIFT, %ecx C trailing twos
+
+L(common):
+ movl %edi, SAVE_EDI
+ movl PARAM_DST, %edi
+
+ leal (%esi,%ebx,4), %esi C src end
+
+ leal (%edi,%ebx,4), %edi C dst end
+ negl %ebx C -size
+
+ movl (%esi,%ebx,4), %eax C src[0]
+
+ orl %ecx, %ecx
+ jz L(odd_entry)
+
+ movl %edi, PARAM_DST
+ movl %ebp, VAR_INVERSE
+
+L(even):
+ C eax src[0]
+ C ebx counter, limbs, negative
+ C ecx shift
+ C edx
+ C esi
+ C edi
+ C ebp
+
+ xorl %ebp, %ebp C initial carry bit
+ xorl %edx, %edx C initial carry limb (for size==1)
+
+ incl %ebx
+ jz L(even_one)
+
+ movl (%esi,%ebx,4), %edi C src[1]
+
+ shrdl( %cl, %edi, %eax)
+
+ jmp L(even_entry)
+
+
+L(even_top):
+ C eax scratch
+ C ebx counter, limbs, negative
+ C ecx shift
+ C edx scratch
+ C esi &src[size]
+ C edi &dst[size] and scratch
+ C ebp carry bit
+
+ movl (%esi,%ebx,4), %edi
+
+ mull PARAM_DIVISOR
+
+ movl -4(%esi,%ebx,4), %eax
+ shrdl( %cl, %edi, %eax)
+
+ subl %ebp, %eax
+
+ sbbl %ebp, %ebp
+ subl %edx, %eax
+
+ sbbl $0, %ebp
+
+L(even_entry):
+ imull VAR_INVERSE, %eax
+
+ movl PARAM_DST, %edi
+ negl %ebp
+
+ movl %eax, -4(%edi,%ebx,4)
+ incl %ebx
+ jnz L(even_top)
+
+ mull PARAM_DIVISOR
+
+ movl -4(%esi), %eax
+
+L(even_one):
+ shrl %cl, %eax
+ movl SAVE_ESI, %esi
+
+ subl %ebp, %eax
+ movl SAVE_EBP, %ebp
+
+ subl %edx, %eax
+ movl SAVE_EBX, %ebx
+
+ imull VAR_INVERSE, %eax
+
+ movl %eax, -4(%edi)
+ movl SAVE_EDI, %edi
+ addl $STACK_SPACE, %esp
+
+ ret
+
+C The dependent chain here is
+C
+C subl %edx, %eax 1
+C imull %ebp, %eax 4
+C mull PARAM_DIVISOR 5
+C ----
+C total 10
+C
+C and this is the measured speed. No special scheduling is necessary, out
+C of order execution hides the load latency.
+
+L(odd_top):
+ C eax scratch (src limb)
+ C ebx counter, limbs, negative
+ C ecx carry bit
+ C edx carry limb, high of last product
+ C esi &src[size]
+ C edi &dst[size]
+ C ebp inverse
+
+ mull PARAM_DIVISOR
+
+ movl (%esi,%ebx,4), %eax
+ subl %ecx, %eax
+
+ sbbl %ecx, %ecx
+ subl %edx, %eax
+
+ sbbl $0, %ecx
+
+L(odd_entry):
+ imull %ebp, %eax
+
+ movl %eax, (%edi,%ebx,4)
+ negl %ecx
+
+ incl %ebx
+ jnz L(odd_top)
+
+
+ movl SAVE_ESI, %esi
+
+ movl SAVE_EDI, %edi
+
+ movl SAVE_EBP, %ebp
+
+ movl SAVE_EBX, %ebx
+ addl $STACK_SPACE, %esp
+
+ ret
+
+EPILOGUE()
+
+C mp_limb_t mpn_bdiv_q_1 (mp_ptr dst, mp_srcptr src, mp_size_t size,
+C mp_limb_t divisor);
+C
+
+ ALIGN(16)
+PROLOGUE(mpn_bdiv_q_1)
+deflit(`FRAME',0)
+
+ movl PARAM_DIVISOR, %eax
+ subl $STACK_SPACE, %esp FRAME_subl_esp(STACK_SPACE)
+
+ movl %esi, SAVE_ESI
+ movl PARAM_SRC, %esi
+
+ movl %ebx, SAVE_EBX
+ movl PARAM_SIZE, %ebx
+
+ bsfl %eax, %ecx C trailing twos
+
+ movl %ebp, SAVE_EBP
+
+ shrl %cl, %eax C d without twos
+
+ movl %eax, %edx
+ shrl %eax C d/2 without twos
+
+ movl %edx, PARAM_DIVISOR
+ andl $127, %eax
+
+ifdef(`PIC',`
+ LEA( binvert_limb_table, %ebp)
+ movzbl (%eax,%ebp), %ebp C inv 8 bits
+',`
+ movzbl binvert_limb_table(%eax), %ebp C inv 8 bits
+')
+
+ leal (%ebp,%ebp), %eax C 2*inv
+
+ imull %ebp, %ebp C inv*inv
+ imull %edx, %ebp C inv*inv*d
+
+ subl %ebp, %eax C inv = 2*inv - inv*inv*d
+ leal (%eax,%eax), %ebp C 2*inv
+
+ imull %eax, %eax C inv*inv
+ imull %edx, %eax C inv*inv*d
+
+ subl %eax, %ebp C inv = 2*inv - inv*inv*d
+
+ jmp L(common)
+
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/p6/copyd.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/p6/copyd.asm
new file mode 100644
index 00000000000..1be7636835e
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/p6/copyd.asm
@@ -0,0 +1,178 @@
+dnl Intel P6 mpn_copyd -- copy limb vector backwards.
+
+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/.
+
+include(`../config.m4')
+
+
+C P6: 1.75 cycles/limb, or 0.75 if no overlap
+
+
+C void mpn_copyd (mp_ptr dst, mp_srcptr src, mp_size_t size);
+C
+C An explicit loop is used because a decrementing rep movsl is a bit slow at
+C 2.4 c/l. That rep movsl also has about a 40 cycle startup time, and the
+C code here stands a chance of being faster if the branches predict well.
+C
+C The slightly strange loop form seems necessary for the claimed speed.
+C Maybe load/store ordering affects it.
+C
+C The source and destination are checked to see if they're actually
+C overlapping, since it might be possible to use an incrementing rep movsl
+C at 0.75 c/l. (It doesn't suffer the bad startup time of the decrementing
+C version.)
+C
+C Enhancements:
+C
+C Top speed for an all-integer copy is probably 1.0 c/l, being one load and
+C one store each cycle. Unrolling the loop below would approach 1.0, but
+C it'd be good to know why something like store/load/subl + store/load/jnz
+C doesn't already run at 1.0 c/l. It looks like it should decode in 2
+C cycles, but doesn't run that way.
+
+defframe(PARAM_SIZE,12)
+defframe(PARAM_SRC, 8)
+defframe(PARAM_DST, 4)
+
+dnl re-using parameter space
+define(SAVE_ESI,`PARAM_SIZE')
+define(SAVE_EDI,`PARAM_SRC')
+
+ TEXT
+ ALIGN(16)
+
+PROLOGUE(mpn_copyd)
+deflit(`FRAME',0)
+
+ movl PARAM_SIZE, %ecx
+
+ movl %esi, SAVE_ESI
+ movl PARAM_SRC, %esi
+
+ movl %edi, SAVE_EDI
+ movl PARAM_DST, %edi
+
+ subl $1, %ecx
+ jb L(zero)
+
+ movl (%esi,%ecx,4), %eax C src[size-1]
+ jz L(one)
+
+ movl -4(%esi,%ecx,4), %edx C src[size-2]
+ subl $2, %ecx
+ jbe L(done_loop) C 2 or 3 limbs only
+
+
+ C The usual overlap is
+ C
+ C high low
+ C +------------------+
+ C | dst|
+ C +------------------+
+ C +------------------+
+ C | src|
+ C +------------------+
+ C
+ C We can use an incrementing copy in the following circumstances.
+ C
+ C src+4*size<=dst, since then the regions are disjoint
+ C
+ C src==dst, clearly (though this shouldn't occur normally)
+ C
+ C src>dst, since in that case it's a requirement of the
+ C parameters that src>=dst+size*4, and hence the
+ C regions are disjoint
+ C
+
+ leal (%edi,%ecx,4), %edx
+ cmpl %edi, %esi
+ jae L(use_movsl) C src >= dst
+
+ cmpl %edi, %edx
+ movl 4(%esi,%ecx,4), %edx C src[size-2] again
+ jbe L(use_movsl) C src+4*size <= dst
+
+
+L(top):
+ C eax prev high limb
+ C ebx
+ C ecx counter, size-3 down to 0 or -1, inclusive, by 2s
+ C edx prev low limb
+ C esi src
+ C edi dst
+ C ebp
+
+ movl %eax, 8(%edi,%ecx,4)
+ movl (%esi,%ecx,4), %eax
+
+ movl %edx, 4(%edi,%ecx,4)
+ movl -4(%esi,%ecx,4), %edx
+
+ subl $2, %ecx
+ jnbe L(top)
+
+
+L(done_loop):
+ movl %eax, 8(%edi,%ecx,4)
+ movl %edx, 4(%edi,%ecx,4)
+
+ C copy low limb (needed if size was odd, but will already have been
+ C done in the loop if size was even)
+ movl (%esi), %eax
+L(one):
+ movl %eax, (%edi)
+ movl SAVE_EDI, %edi
+ movl SAVE_ESI, %esi
+
+ ret
+
+
+L(use_movsl):
+ C eax
+ C ebx
+ C ecx size-3
+ C edx
+ C esi src
+ C edi dst
+ C ebp
+
+ addl $3, %ecx
+
+ cld C better safe than sorry, see mpn/x86/README
+
+ rep
+ movsl
+
+L(zero):
+ movl SAVE_ESI, %esi
+ movl SAVE_EDI, %edi
+
+ ret
+
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/p6/dive_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/p6/dive_1.asm
new file mode 100644
index 00000000000..aa7ba880c97
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/p6/dive_1.asm
@@ -0,0 +1,266 @@
+dnl Intel P6 mpn_modexact_1_odd -- exact division style remainder.
+
+dnl Copyright 2001, 2002, 2007 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 odd even divisor
+C P6: 10.0 12.0 cycles/limb
+
+
+C void mpn_divexact_1 (mp_ptr dst, mp_srcptr src, mp_size_t size,
+C mp_limb_t divisor);
+C
+C The odd case is basically the same as mpn_modexact_1_odd, just with an
+C extra store, and it runs at the same 10 cycles which is the dependent
+C chain.
+C
+C The shifts for the even case aren't on the dependent chain so in principle
+C it could run the same too, but nothing running at 10 has been found.
+C Perhaps there's too many uops (an extra 4 over the odd case).
+
+defframe(PARAM_DIVISOR,16)
+defframe(PARAM_SIZE, 12)
+defframe(PARAM_SRC, 8)
+defframe(PARAM_DST, 4)
+
+defframe(SAVE_EBX, -4)
+defframe(SAVE_ESI, -8)
+defframe(SAVE_EDI, -12)
+defframe(SAVE_EBP, -16)
+defframe(VAR_INVERSE, -20)
+deflit(STACK_SPACE, 20)
+
+ TEXT
+
+ ALIGN(16)
+PROLOGUE(mpn_divexact_1)
+deflit(`FRAME',0)
+
+ movl PARAM_DIVISOR, %eax
+ subl $STACK_SPACE, %esp FRAME_subl_esp(STACK_SPACE)
+
+ movl %esi, SAVE_ESI
+ movl PARAM_SRC, %esi
+
+ movl %ebx, SAVE_EBX
+ movl PARAM_SIZE, %ebx
+
+ bsfl %eax, %ecx C trailing twos
+
+ movl %ebp, SAVE_EBP
+
+ shrl %cl, %eax C d without twos
+
+ movl %eax, %edx
+ shrl %eax C d/2 without twos
+
+ movl %edx, PARAM_DIVISOR
+ andl $127, %eax
+
+ifdef(`PIC',`
+ LEA( binvert_limb_table, %ebp)
+ movzbl (%eax,%ebp), %ebp C inv 8 bits
+',`
+ movzbl binvert_limb_table(%eax), %ebp C inv 8 bits
+')
+
+ leal (%ebp,%ebp), %eax C 2*inv
+
+ imull %ebp, %ebp C inv*inv
+
+ movl %edi, SAVE_EDI
+ movl PARAM_DST, %edi
+
+ leal (%esi,%ebx,4), %esi C src end
+
+ imull PARAM_DIVISOR, %ebp C inv*inv*d
+
+ subl %ebp, %eax C inv = 2*inv - inv*inv*d
+ leal (%eax,%eax), %ebp C 2*inv
+
+ imull %eax, %eax C inv*inv
+
+ leal (%edi,%ebx,4), %edi C dst end
+ negl %ebx C -size
+
+ movl %edi, PARAM_DST
+
+ imull PARAM_DIVISOR, %eax C inv*inv*d
+
+ subl %eax, %ebp C inv = 2*inv - inv*inv*d
+
+ ASSERT(e,` C d*inv == 1 mod 2^GMP_LIMB_BITS
+ movl PARAM_DIVISOR, %eax
+ imull %ebp, %eax
+ cmpl $1, %eax')
+
+ movl %ebp, VAR_INVERSE
+ movl (%esi,%ebx,4), %eax C src[0]
+
+ orl %ecx, %ecx
+ jnz L(even)
+
+ C ecx initial carry is zero
+ jmp L(odd_entry)
+
+
+C The dependent chain here is
+C
+C subl %edx, %eax 1
+C imull %ebp, %eax 4
+C mull PARAM_DIVISOR 5
+C ----
+C total 10
+C
+C and this is the measured speed. No special scheduling is necessary, out
+C of order execution hides the load latency.
+
+L(odd_top):
+ C eax scratch (src limb)
+ C ebx counter, limbs, negative
+ C ecx carry bit
+ C edx carry limb, high of last product
+ C esi &src[size]
+ C edi &dst[size]
+ C ebp
+
+ mull PARAM_DIVISOR
+
+ movl (%esi,%ebx,4), %eax
+ subl %ecx, %eax
+
+ sbbl %ecx, %ecx
+ subl %edx, %eax
+
+ sbbl $0, %ecx
+
+L(odd_entry):
+ imull VAR_INVERSE, %eax
+
+ movl %eax, (%edi,%ebx,4)
+ negl %ecx
+
+ incl %ebx
+ jnz L(odd_top)
+
+
+ movl SAVE_ESI, %esi
+
+ movl SAVE_EDI, %edi
+
+ movl SAVE_EBP, %ebp
+
+ movl SAVE_EBX, %ebx
+ addl $STACK_SPACE, %esp
+
+ ret
+
+
+L(even):
+ C eax src[0]
+ C ebx counter, limbs, negative
+ C ecx shift
+ C edx
+ C esi
+ C edi
+ C ebp
+
+ xorl %ebp, %ebp C initial carry bit
+ xorl %edx, %edx C initial carry limb (for size==1)
+
+ incl %ebx
+ jz L(even_one)
+
+ movl (%esi,%ebx,4), %edi C src[1]
+
+ shrdl( %cl, %edi, %eax)
+
+ jmp L(even_entry)
+
+
+L(even_top):
+ C eax scratch
+ C ebx counter, limbs, negative
+ C ecx shift
+ C edx scratch
+ C esi &src[size]
+ C edi &dst[size] and scratch
+ C ebp carry bit
+
+ movl (%esi,%ebx,4), %edi
+
+ mull PARAM_DIVISOR
+
+ movl -4(%esi,%ebx,4), %eax
+ shrdl( %cl, %edi, %eax)
+
+ subl %ebp, %eax
+
+ sbbl %ebp, %ebp
+ subl %edx, %eax
+
+ sbbl $0, %ebp
+
+L(even_entry):
+ imull VAR_INVERSE, %eax
+
+ movl PARAM_DST, %edi
+ negl %ebp
+
+ movl %eax, -4(%edi,%ebx,4)
+ incl %ebx
+ jnz L(even_top)
+
+
+
+ mull PARAM_DIVISOR
+
+ movl -4(%esi), %eax
+
+L(even_one):
+ shrl %cl, %eax
+ movl SAVE_ESI, %esi
+
+ subl %ebp, %eax
+ movl SAVE_EBP, %ebp
+
+ subl %edx, %eax
+ movl SAVE_EBX, %ebx
+
+ imull VAR_INVERSE, %eax
+
+ movl %eax, -4(%edi)
+ movl SAVE_EDI, %edi
+ addl $STACK_SPACE, %esp
+
+ ret
+
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/p6/gcd_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/p6/gcd_1.asm
new file mode 100644
index 00000000000..f6518f6e199
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/p6/gcd_1.asm
@@ -0,0 +1,156 @@
+dnl x86 mpn_gcd_1 optimised for processors with fast BSF.
+
+dnl Based on the K7 gcd_1.asm, by Kevin Ryde. Rehacked by Torbjorn 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 AMD K7 7.80
+C AMD K8,K9 7.79
+C AMD K10 4.08
+C AMD bd1 ?
+C AMD bobcat 7.82
+C Intel P4-2 14.9
+C Intel P4-3/4 14.0
+C Intel P6/13 5.09
+C Intel core2 4.22
+C Intel NHM 5.00
+C Intel SBR 5.00
+C Intel atom 17.1
+C VIA nano ?
+C Numbers measured with: speed -CD -s16-32 -t16 mpn_gcd_1
+
+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)
+
+
+define(`up', `%edi')
+define(`n', `%esi')
+define(`v0', `%edx')
+
+
+ASM_START()
+ TEXT
+ ALIGN(16)
+PROLOGUE(mpn_gcd_1)
+ push %edi
+ push %esi
+
+ mov 12(%esp), up
+ mov 16(%esp), n
+ mov 20(%esp), v0
+
+ mov (up), %eax C U low limb
+ or v0, %eax
+ bsf %eax, %eax C min(ctz(u0),ctz(v0))
+
+ bsf v0, %ecx
+ shr %cl, v0
+
+ push %eax C preserve common twos over call
+ push v0 C preserve v0 argument over call
+
+ cmp $1, n
+ jnz L(reduce_nby1)
+
+C Both U and V are single limbs, reduce with bmod if u0 >> v0.
+ mov (up), %ecx
+ mov %ecx, %eax
+ shr $BMOD_THRES_LOG2, %ecx
+ cmp %ecx, v0
+ ja L(reduced)
+ jmp L(bmod)
+
+L(reduce_nby1):
+ cmp $BMOD_1_TO_MOD_1_THRESHOLD, n
+ jl L(bmod)
+ifdef(`PIC_WITH_EBX',`
+ push %ebx
+ call L(movl_eip_to_ebx)
+ add $_GLOBAL_OFFSET_TABLE_, %ebx
+')
+ push v0 C param 3
+ push n C param 2
+ push up C param 1
+ CALL( mpn_mod_1)
+ jmp L(called)
+
+L(bmod):
+ifdef(`PIC_WITH_EBX',`dnl
+ push %ebx
+ call L(movl_eip_to_ebx)
+ add $_GLOBAL_OFFSET_TABLE_, %ebx
+')
+ push v0 C param 3
+ push n C param 2
+ push up C param 1
+ CALL( mpn_modexact_1_odd)
+
+L(called):
+ add $12, %esp C deallocate params
+ifdef(`PIC_WITH_EBX',`dnl
+ pop %ebx
+')
+L(reduced):
+ pop %edx
+
+ bsf %eax, %ecx
+C test %eax, %eax C FIXME: does this lower latency?
+ jnz L(mid)
+ jmp L(end)
+
+ ALIGN(16) C K10 BD C2 NHM SBR
+L(top): cmovc( %esi, %eax) C if x-y < 0 0,3 0,3 0,6 0,5 0,5
+ cmovc( %edi, %edx) C use x,y-x 0,3 0,3 2,8 1,7 1,7
+L(mid): shr %cl, %eax C 1,7 1,6 2,8 2,8 2,8
+ mov %edx, %esi C 1 1 4 3 3
+ sub %eax, %esi C 2 2 5 4 4
+ bsf %esi, %ecx C 3 3 6 5 5
+ mov %eax, %edi C 2 2 3 3 4
+ sub %edx, %eax C 2 2 4 3 4
+ jnz L(top) C
+
+L(end): pop %ecx
+ mov %edx, %eax
+ shl %cl, %eax
+
+ pop %esi
+ pop %edi
+ ret
+
+ifdef(`PIC_WITH_EBX',`dnl
+L(movl_eip_to_ebx):
+ mov (%esp), %ebx
+ ret
+')
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/p6/gmp-mparam.h b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/p6/gmp-mparam.h
new file mode 100644
index 00000000000..96c96fd5586
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/p6/gmp-mparam.h
@@ -0,0 +1,194 @@
+/* Intel P6 gmp-mparam.h -- Compiler/machine parameter header file.
+
+Copyright 1991, 1993, 1994, 1999-2003, 2008-2010, 2012 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 more than the
+ value in mpn/x86/p6/gmp-mparam.h. The latter is used as a hard limit in
+ mpn/x86/p6/sqr_basecase.asm. */
+
+
+/* 1867 MHz P6 model 13 */
+
+#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 11
+#define MOD_1_2_TO_MOD_1_4_THRESHOLD 0 /* never mpn_mod_1s_2p */
+#define PREINV_MOD_1_TO_MOD_1_THRESHOLD 8
+#define USE_PREINV_DIVREM_1 1 /* native */
+#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 21
+
+#define MUL_TOOM22_THRESHOLD 20
+#define MUL_TOOM33_THRESHOLD 74
+#define MUL_TOOM44_THRESHOLD 181
+#define MUL_TOOM6H_THRESHOLD 252
+#define MUL_TOOM8H_THRESHOLD 363
+
+#define MUL_TOOM32_TO_TOOM43_THRESHOLD 73
+#define MUL_TOOM32_TO_TOOM53_THRESHOLD 114
+#define MUL_TOOM42_TO_TOOM53_THRESHOLD 115
+#define MUL_TOOM42_TO_TOOM63_THRESHOLD 80
+
+#define SQR_BASECASE_THRESHOLD 0 /* always (native) */
+#define SQR_TOOM2_THRESHOLD 30
+#define SQR_TOOM3_THRESHOLD 101
+#define SQR_TOOM4_THRESHOLD 154
+#define SQR_TOOM6_THRESHOLD 222
+#define SQR_TOOM8_THRESHOLD 527
+
+#define MULMID_TOOM42_THRESHOLD 58
+
+#define MULMOD_BNM1_THRESHOLD 13
+#define SQRMOD_BNM1_THRESHOLD 17
+
+#define POWM_SEC_TABLE 4,23,258,768,2388
+
+#define MUL_FFT_MODF_THRESHOLD 565 /* k = 5 */
+#define MUL_FFT_TABLE3 \
+ { { 565, 5}, { 25, 6}, { 13, 5}, { 27, 6}, \
+ { 25, 7}, { 13, 6}, { 28, 7}, { 15, 6}, \
+ { 31, 7}, { 17, 6}, { 35, 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, 5}, \
+ { 383, 4}, { 991, 5}, { 511, 6}, { 267, 7}, \
+ { 157, 8}, { 91, 9}, { 47, 8}, { 111, 9}, \
+ { 63, 8}, { 127, 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,12}, { 63,11}, { 127,10}, { 255, 9}, \
+ { 511,10}, { 271, 9}, { 543,10}, { 287,11}, \
+ { 159,10}, { 335, 9}, { 671,11}, { 191,10}, \
+ { 383, 9}, { 767,10}, { 399, 9}, { 799,10}, \
+ { 415,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,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}, { 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}, { 1215,13}, \
+ { 639,12}, { 1471,11}, { 2943,13}, { 767,12}, \
+ { 1727,13}, { 895,12}, { 1919,14}, { 511,13}, \
+ { 1023,12}, { 2111,13}, { 1151,12}, { 2431,13}, \
+ { 1407,12}, { 2815,14}, { 767,13}, { 1663,12}, \
+ { 3455,13}, { 8192,14}, { 16384,15}, { 32768,16} }
+#define MUL_FFT_TABLE3_SIZE 132
+#define MUL_FFT_THRESHOLD 6784
+
+#define SQR_FFT_MODF_THRESHOLD 472 /* k = 5 */
+#define SQR_FFT_TABLE3 \
+ { { 472, 5}, { 25, 6}, { 13, 5}, { 27, 6}, \
+ { 25, 7}, { 13, 6}, { 27, 7}, { 15, 6}, \
+ { 31, 7}, { 17, 6}, { 35, 7}, { 27, 8}, \
+ { 15, 7}, { 35, 8}, { 19, 7}, { 41, 8}, \
+ { 23, 7}, { 49, 8}, { 27, 9}, { 15, 8}, \
+ { 39, 9}, { 23, 8}, { 51,10}, { 15, 9}, \
+ { 31, 8}, { 63, 4}, { 1023, 8}, { 67, 9}, \
+ { 39, 5}, { 639, 4}, { 1471, 6}, { 383, 7}, \
+ { 209, 8}, { 119, 9}, { 63, 7}, { 255, 8}, \
+ { 139, 9}, { 71, 8}, { 143, 9}, { 79,10}, \
+ { 47, 9}, { 95,11}, { 31,10}, { 63, 9}, \
+ { 135,10}, { 79, 9}, { 159, 8}, { 319, 9}, \
+ { 167,10}, { 95,11}, { 63,10}, { 143, 9}, \
+ { 287,10}, { 159,11}, { 95,10}, { 191,12}, \
+ { 63,11}, { 127,10}, { 255, 9}, { 543, 8}, \
+ { 1087,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}, \
+ { 543, 9}, { 1087,11}, { 287,10}, { 607, 9}, \
+ { 1215,11}, { 319,10}, { 671, 9}, { 1343,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,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}, { 8192,14}, \
+ { 16384,15}, { 32768,16} }
+#define SQR_FFT_TABLE3_SIZE 146
+#define SQR_FFT_THRESHOLD 5760
+
+#define MULLO_BASECASE_THRESHOLD 0 /* always */
+#define MULLO_DC_THRESHOLD 33
+#define MULLO_MUL_N_THRESHOLD 13463
+
+#define DC_DIV_QR_THRESHOLD 20
+#define DC_DIVAPPR_Q_THRESHOLD 56
+#define DC_BDIV_QR_THRESHOLD 60
+#define DC_BDIV_Q_THRESHOLD 134
+
+#define INV_MULMOD_BNM1_THRESHOLD 38
+#define INV_NEWTON_THRESHOLD 66
+#define INV_APPR_THRESHOLD 63
+
+#define BINV_NEWTON_THRESHOLD 250
+#define REDC_1_TO_REDC_N_THRESHOLD 63
+
+#define MU_DIV_QR_THRESHOLD 1164
+#define MU_DIVAPPR_Q_THRESHOLD 979
+#define MUPI_DIV_QR_THRESHOLD 38
+#define MU_BDIV_QR_THRESHOLD 1442
+#define MU_BDIV_Q_THRESHOLD 1470
+
+#define MATRIX22_STRASSEN_THRESHOLD 17
+#define HGCD_THRESHOLD 64
+#define HGCD_APPR_THRESHOLD 105
+#define HGCD_REDUCE_THRESHOLD 3524
+#define GCD_DC_THRESHOLD 386
+#define GCDEXT_DC_THRESHOLD 309
+#define JACOBI_BASE_METHOD 1
+
+#define GET_STR_DC_THRESHOLD 13
+#define GET_STR_PRECOMPUTE_THRESHOLD 26
+#define SET_STR_DC_THRESHOLD 587
+#define SET_STR_PRECOMPUTE_THRESHOLD 1104
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/p6/lshsub_n.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/p6/lshsub_n.asm
new file mode 100644
index 00000000000..7ada213644b
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/p6/lshsub_n.asm
@@ -0,0 +1,169 @@
+dnl Intel P6 mpn_lshsub_n -- mpn papillion support.
+
+dnl Copyright 2006 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 P6/13: 3.35 cycles/limb (separate mpn_sub_n + mpn_lshift needs 4.12)
+
+C (1) The loop is not scheduled in any way, and scheduling attempts have not
+C improved speed on P6/13. Presumably, the K7 will want scheduling, if it
+C at all wants to use MMX.
+C (2) We could save a register by not alternatingly using eax and edx in the
+C loop.
+
+define(`rp', `%edi')
+define(`up', `%esi')
+define(`vp', `%ebx')
+define(`n', `%ecx')
+define(`cnt', `%mm7')
+
+ASM_START()
+
+ TEXT
+ ALIGN(16)
+
+PROLOGUE(mpn_lshsub_n)
+ push %edi
+ push %esi
+ push %ebx
+
+ mov 16(%esp), rp
+ mov 20(%esp), up
+ mov 24(%esp), vp
+ mov 28(%esp), n
+ mov $32, %eax
+ sub 32(%esp), %eax
+ movd %eax, cnt
+
+ lea (up,n,4), up
+ lea (vp,n,4), vp
+ lea (rp,n,4), rp
+
+ neg n
+ mov n, %eax
+ and $-8, n
+ and $7, %eax
+ shl %eax C eax = 2x
+ lea (%eax,%eax,4), %edx C edx = 10x
+ifdef(`PIC',`
+ call L(pic_calc)
+L(here):
+',`
+ lea L(ent)(%eax,%edx,2), %eax C eax = 22x
+')
+
+ pxor %mm1, %mm1
+ pxor %mm0, %mm0
+
+ jmp *%eax
+
+ifdef(`PIC',`
+L(pic_calc):
+ C See mpn/x86/README about old gas bugs
+ lea (%eax,%edx,2), %eax
+ add $L(ent)-L(here), %eax
+ add (%esp), %eax
+ ret_internal
+')
+
+L(end): C compute (cy<<cnt) | (edx>>(32-cnt))
+ sbb %eax, %eax
+ neg %eax
+ mov 32(%esp), %ecx
+ shld %cl, %edx, %eax
+
+ emms
+
+ pop %ebx
+ pop %esi
+ pop %edi
+ ret
+ ALIGN(16)
+L(top): jecxz L(end)
+L(ent): mov 0(up,n,4), %eax
+ sbb 0(vp,n,4), %eax
+ movd %eax, %mm0
+ punpckldq %mm0, %mm1
+ psrlq %mm7, %mm1
+ movd %mm1, 0(rp,n,4)
+
+ mov 4(up,n,4), %edx
+ sbb 4(vp,n,4), %edx
+ movd %edx, %mm1
+ punpckldq %mm1, %mm0
+ psrlq %mm7, %mm0
+ movd %mm0, 4(rp,n,4)
+
+ mov 8(up,n,4), %eax
+ sbb 8(vp,n,4), %eax
+ movd %eax, %mm0
+ punpckldq %mm0, %mm1
+ psrlq %mm7, %mm1
+ movd %mm1, 8(rp,n,4)
+
+ mov 12(up,n,4), %edx
+ sbb 12(vp,n,4), %edx
+ movd %edx, %mm1
+ punpckldq %mm1, %mm0
+ psrlq %mm7, %mm0
+ movd %mm0, 12(rp,n,4)
+
+ mov 16(up,n,4), %eax
+ sbb 16(vp,n,4), %eax
+ movd %eax, %mm0
+ punpckldq %mm0, %mm1
+ psrlq %mm7, %mm1
+ movd %mm1, 16(rp,n,4)
+
+ mov 20(up,n,4), %edx
+ sbb 20(vp,n,4), %edx
+ movd %edx, %mm1
+ punpckldq %mm1, %mm0
+ psrlq %mm7, %mm0
+ movd %mm0, 20(rp,n,4)
+
+ mov 24(up,n,4), %eax
+ sbb 24(vp,n,4), %eax
+ movd %eax, %mm0
+ punpckldq %mm0, %mm1
+ psrlq %mm7, %mm1
+ movd %mm1, 24(rp,n,4)
+
+ mov 28(up,n,4), %edx
+ sbb 28(vp,n,4), %edx
+ movd %edx, %mm1
+ punpckldq %mm1, %mm0
+ psrlq %mm7, %mm0
+ movd %mm0, 28(rp,n,4)
+
+ lea 8(n), n
+ jmp L(top)
+
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/p6/mmx/divrem_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/p6/mmx/divrem_1.asm
new file mode 100644
index 00000000000..5300616c14d
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/p6/mmx/divrem_1.asm
@@ -0,0 +1,767 @@
+dnl Intel Pentium-II mpn_divrem_1 -- mpn by limb division.
+
+dnl Copyright 1999-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 P6MMX: 25.0 cycles/limb integer part, 17.5 cycles/limb fraction part.
+
+
+C mp_limb_t mpn_divrem_1 (mp_ptr dst, mp_size_t xsize,
+C mp_srcptr src, mp_size_t size,
+C mp_limb_t divisor);
+C mp_limb_t mpn_divrem_1c (mp_ptr dst, mp_size_t xsize,
+C mp_srcptr src, mp_size_t size,
+C mp_limb_t divisor, mp_limb_t carry);
+C mp_limb_t mpn_preinv_divrem_1 (mp_ptr dst, mp_size_t xsize,
+C mp_srcptr src, mp_size_t size,
+C mp_limb_t divisor, mp_limb_t inverse,
+C unsigned shift);
+C
+C This code is a lightly reworked version of mpn/x86/k7/mmx/divrem_1.asm,
+C see that file for some comments. It's possible what's here can be improved.
+
+
+dnl MUL_THRESHOLD is the value of xsize+size at which the multiply by
+dnl inverse method is used, rather than plain "divl"s. Minimum value 1.
+dnl
+dnl The different speeds of the integer and fraction parts means that using
+dnl xsize+size isn't quite right. The threshold wants to be a bit higher
+dnl for the integer part and a bit lower for the fraction part. (Or what's
+dnl really wanted is to speed up the integer part!)
+dnl
+dnl The threshold is set to make the integer part right. At 4 limbs the
+dnl div and mul are about the same there, but on the fractional part the
+dnl mul is much faster.
+
+deflit(MUL_THRESHOLD, 4)
+
+
+defframe(PARAM_PREINV_SHIFT, 28) dnl mpn_preinv_divrem_1
+defframe(PARAM_PREINV_INVERSE, 24) dnl mpn_preinv_divrem_1
+defframe(PARAM_CARRY, 24) dnl mpn_divrem_1c
+defframe(PARAM_DIVISOR,20)
+defframe(PARAM_SIZE, 16)
+defframe(PARAM_SRC, 12)
+defframe(PARAM_XSIZE, 8)
+defframe(PARAM_DST, 4)
+
+defframe(SAVE_EBX, -4)
+defframe(SAVE_ESI, -8)
+defframe(SAVE_EDI, -12)
+defframe(SAVE_EBP, -16)
+
+defframe(VAR_NORM, -20)
+defframe(VAR_INVERSE, -24)
+defframe(VAR_SRC, -28)
+defframe(VAR_DST, -32)
+defframe(VAR_DST_STOP,-36)
+
+deflit(STACK_SPACE, 36)
+
+ TEXT
+ ALIGN(16)
+
+PROLOGUE(mpn_preinv_divrem_1)
+deflit(`FRAME',0)
+ movl PARAM_XSIZE, %ecx
+ subl $STACK_SPACE, %esp FRAME_subl_esp(STACK_SPACE)
+
+ movl %esi, SAVE_ESI
+ movl PARAM_SRC, %esi
+
+ movl %ebx, SAVE_EBX
+ movl PARAM_SIZE, %ebx
+
+ movl %ebp, SAVE_EBP
+ movl PARAM_DIVISOR, %ebp
+
+ movl %edi, SAVE_EDI
+ movl PARAM_DST, %edx
+
+ movl -4(%esi,%ebx,4), %eax C src high limb
+ xorl %edi, %edi C initial carry (if can't skip a div)
+
+ C
+
+ leal 8(%edx,%ecx,4), %edx C &dst[xsize+2]
+ xor %ecx, %ecx
+
+ movl %edx, VAR_DST_STOP C &dst[xsize+2]
+ cmpl %ebp, %eax C high cmp divisor
+
+ cmovc( %eax, %edi) C high is carry if high<divisor
+
+ cmovnc( %eax, %ecx) C 0 if skip div, src high if not
+ C (the latter in case src==dst)
+
+ movl %ecx, -12(%edx,%ebx,4) C dst high limb
+
+ sbbl $0, %ebx C skip one division if high<divisor
+ movl PARAM_PREINV_SHIFT, %ecx
+
+ leal -8(%edx,%ebx,4), %edx C &dst[xsize+size]
+ movl $32, %eax
+
+ movl %edx, VAR_DST C &dst[xsize+size]
+
+ shll %cl, %ebp C d normalized
+ subl %ecx, %eax
+ movl %ecx, VAR_NORM
+
+ movd %eax, %mm7 C rshift
+ movl PARAM_PREINV_INVERSE, %eax
+ jmp L(start_preinv)
+
+EPILOGUE()
+
+
+
+ ALIGN(16)
+
+PROLOGUE(mpn_divrem_1c)
+deflit(`FRAME',0)
+ movl PARAM_CARRY, %edx
+
+ movl PARAM_SIZE, %ecx
+ subl $STACK_SPACE, %esp
+deflit(`FRAME',STACK_SPACE)
+
+ movl %ebx, SAVE_EBX
+ movl PARAM_XSIZE, %ebx
+
+ movl %edi, SAVE_EDI
+ movl PARAM_DST, %edi
+
+ movl %ebp, SAVE_EBP
+ movl PARAM_DIVISOR, %ebp
+
+ movl %esi, SAVE_ESI
+ movl PARAM_SRC, %esi
+
+ leal -4(%edi,%ebx,4), %edi
+ jmp L(start_1c)
+
+EPILOGUE()
+
+
+ C offset 0x31, close enough to aligned
+PROLOGUE(mpn_divrem_1)
+deflit(`FRAME',0)
+
+ movl PARAM_SIZE, %ecx
+ movl $0, %edx C initial carry (if can't skip a div)
+ subl $STACK_SPACE, %esp
+deflit(`FRAME',STACK_SPACE)
+
+ movl %ebp, SAVE_EBP
+ movl PARAM_DIVISOR, %ebp
+
+ movl %ebx, SAVE_EBX
+ movl PARAM_XSIZE, %ebx
+
+ movl %esi, SAVE_ESI
+ movl PARAM_SRC, %esi
+ orl %ecx, %ecx C size
+
+ movl %edi, SAVE_EDI
+ movl PARAM_DST, %edi
+
+ leal -4(%edi,%ebx,4), %edi C &dst[xsize-1]
+ jz L(no_skip_div) C if size==0
+
+ movl -4(%esi,%ecx,4), %eax C src high limb
+ xorl %esi, %esi
+ cmpl %ebp, %eax C high cmp divisor
+
+ cmovc( %eax, %edx) C high is carry if high<divisor
+
+ cmovnc( %eax, %esi) C 0 if skip div, src high if not
+ C (the latter in case src==dst)
+
+ movl %esi, (%edi,%ecx,4) C dst high limb
+
+ sbbl $0, %ecx C size-1 if high<divisor
+ movl PARAM_SRC, %esi C reload
+L(no_skip_div):
+
+
+L(start_1c):
+ C eax
+ C ebx xsize
+ C ecx size
+ C edx carry
+ C esi src
+ C edi &dst[xsize-1]
+ C ebp divisor
+
+ leal (%ebx,%ecx), %eax C size+xsize
+ cmpl $MUL_THRESHOLD, %eax
+ jae L(mul_by_inverse)
+
+ orl %ecx, %ecx
+ jz L(divide_no_integer)
+
+L(divide_integer):
+ C eax scratch (quotient)
+ C ebx xsize
+ C ecx counter
+ C edx scratch (remainder)
+ C esi src
+ C edi &dst[xsize-1]
+ C ebp divisor
+
+ movl -4(%esi,%ecx,4), %eax
+
+ divl %ebp
+
+ movl %eax, (%edi,%ecx,4)
+ decl %ecx
+ jnz L(divide_integer)
+
+
+L(divide_no_integer):
+ movl PARAM_DST, %edi
+ orl %ebx, %ebx
+ jnz L(divide_fraction)
+
+L(divide_done):
+ movl SAVE_ESI, %esi
+
+ movl SAVE_EDI, %edi
+
+ movl SAVE_EBX, %ebx
+ movl %edx, %eax
+
+ movl SAVE_EBP, %ebp
+ addl $STACK_SPACE, %esp
+
+ ret
+
+
+L(divide_fraction):
+ C eax scratch (quotient)
+ C ebx counter
+ C ecx
+ C edx scratch (remainder)
+ C esi
+ C edi dst
+ C ebp divisor
+
+ movl $0, %eax
+
+ divl %ebp
+
+ movl %eax, -4(%edi,%ebx,4)
+ decl %ebx
+ jnz L(divide_fraction)
+
+ jmp L(divide_done)
+
+
+
+C -----------------------------------------------------------------------------
+
+L(mul_by_inverse):
+ C eax
+ C ebx xsize
+ C ecx size
+ C edx carry
+ C esi src
+ C edi &dst[xsize-1]
+ C ebp divisor
+
+ leal 12(%edi), %ebx C &dst[xsize+2], loop dst stop
+
+ movl %ebx, VAR_DST_STOP
+ leal 4(%edi,%ecx,4), %edi C &dst[xsize+size]
+
+ movl %edi, VAR_DST
+ movl %ecx, %ebx C size
+
+ bsrl %ebp, %ecx C 31-l
+ movl %edx, %edi C carry
+
+ leal 1(%ecx), %eax C 32-l
+ xorl $31, %ecx C l
+
+ movl %ecx, VAR_NORM
+ movl $-1, %edx
+
+ shll %cl, %ebp C d normalized
+ movd %eax, %mm7
+
+ movl $-1, %eax
+ subl %ebp, %edx C (b-d)-1 giving edx:eax = b*(b-d)-1
+
+ divl %ebp C floor (b*(b-d)-1) / d
+
+L(start_preinv):
+ C eax inverse
+ C ebx size
+ C ecx shift
+ C edx
+ C esi src
+ C edi carry
+ C ebp divisor
+ C
+ C mm7 rshift
+
+ movl %eax, VAR_INVERSE
+ orl %ebx, %ebx C size
+ leal -12(%esi,%ebx,4), %eax C &src[size-3]
+
+ movl %eax, VAR_SRC
+ jz L(start_zero)
+
+ movl 8(%eax), %esi C src high limb
+ cmpl $1, %ebx
+ jz L(start_one)
+
+L(start_two_or_more):
+ movl 4(%eax), %edx C src second highest limb
+
+ shldl( %cl, %esi, %edi) C n2 = carry,high << l
+
+ shldl( %cl, %edx, %esi) C n10 = high,second << l
+
+ cmpl $2, %ebx
+ je L(integer_two_left)
+ jmp L(integer_top)
+
+
+L(start_one):
+ shldl( %cl, %esi, %edi) C n2 = carry,high << l
+
+ shll %cl, %esi C n10 = high << l
+ jmp L(integer_one_left)
+
+
+L(start_zero):
+ C Can be here with xsize==0 if mpn_preinv_divrem_1 had size==1 and
+ C skipped a division.
+
+ shll %cl, %edi C n2 = carry << l
+ movl %edi, %eax C return value for zero_done
+ cmpl $0, PARAM_XSIZE
+
+ je L(zero_done)
+ jmp L(fraction_some)
+
+
+
+C -----------------------------------------------------------------------------
+C
+C This loop runs at about 25 cycles, which is probably sub-optimal, and
+C certainly more than the dependent chain would suggest. A better loop, or
+C a better rough analysis of what's possible, would be welcomed.
+C
+C In the current implementation, the following successively dependent
+C micro-ops seem to exist.
+C
+C uops
+C n2+n1 1 (addl)
+C mul 5
+C q1+1 3 (addl/adcl)
+C mul 5
+C sub 3 (subl/sbbl)
+C addback 2 (cmov)
+C ---
+C 19
+C
+C Lack of registers hinders explicit scheduling and it might be that the
+C normal out of order execution isn't able to hide enough under the mul
+C latencies.
+C
+C Using sarl/negl to pick out n1 for the n2+n1 stage is a touch faster than
+C cmov (and takes one uop off the dependent chain). A sarl/andl/addl
+C combination was tried for the addback (despite the fact it would lengthen
+C the dependent chain) but found to be no faster.
+
+
+ ALIGN(16)
+L(integer_top):
+ C eax scratch
+ C ebx scratch (nadj, q1)
+ C ecx scratch (src, dst)
+ C edx scratch
+ C esi n10
+ C edi n2
+ C ebp d
+ C
+ C mm0 scratch (src qword)
+ C mm7 rshift for normalization
+
+ movl %esi, %eax
+ movl %ebp, %ebx
+
+ sarl $31, %eax C -n1
+ movl VAR_SRC, %ecx
+
+ andl %eax, %ebx C -n1 & d
+ negl %eax C n1
+
+ addl %esi, %ebx C nadj = n10 + (-n1 & d), ignoring overflow
+ addl %edi, %eax C n2+n1
+ movq (%ecx), %mm0 C next src limb and the one below it
+
+ mull VAR_INVERSE C m*(n2+n1)
+
+ subl $4, %ecx
+
+ movl %ecx, VAR_SRC
+
+ C
+
+ C
+
+ addl %ebx, %eax C m*(n2+n1) + nadj, low giving carry flag
+ movl %ebp, %eax C d
+ leal 1(%edi), %ebx C n2+1
+
+ adcl %edx, %ebx C 1 + high(n2<<32 + m*(n2+n1) + nadj) = q1+1
+ jz L(q1_ff)
+
+ mull %ebx C (q1+1)*d
+
+ movl VAR_DST, %ecx
+ psrlq %mm7, %mm0
+
+ C
+
+ C
+
+ C
+
+ subl %eax, %esi
+ movl VAR_DST_STOP, %eax
+
+ sbbl %edx, %edi C n - (q1+1)*d
+ movl %esi, %edi C remainder -> n2
+ leal (%ebp,%esi), %edx
+
+ cmovc( %edx, %edi) C n - q1*d if underflow from using q1+1
+ movd %mm0, %esi
+
+ sbbl $0, %ebx C q
+ subl $4, %ecx
+
+ movl %ebx, (%ecx)
+ cmpl %eax, %ecx
+
+ movl %ecx, VAR_DST
+ jne L(integer_top)
+
+
+L(integer_loop_done):
+
+
+C -----------------------------------------------------------------------------
+C
+C Here, and in integer_one_left below, an sbbl $0 is used rather than a jz
+C q1_ff special case. This make the code a bit smaller and simpler, and
+C costs only 2 cycles (each).
+
+L(integer_two_left):
+ C eax scratch
+ C ebx scratch (nadj, q1)
+ C ecx scratch (src, dst)
+ C edx scratch
+ C esi n10
+ C edi n2
+ C ebp divisor
+ C
+ C mm7 rshift
+
+
+ movl %esi, %eax
+ movl %ebp, %ebx
+
+ sarl $31, %eax C -n1
+ movl PARAM_SRC, %ecx
+
+ andl %eax, %ebx C -n1 & d
+ negl %eax C n1
+
+ addl %esi, %ebx C nadj = n10 + (-n1 & d), ignoring overflow
+ addl %edi, %eax C n2+n1
+
+ mull VAR_INVERSE C m*(n2+n1)
+
+ movd (%ecx), %mm0 C src low limb
+
+ movl VAR_DST_STOP, %ecx
+
+ C
+
+ C
+
+ addl %ebx, %eax C m*(n2+n1) + nadj, low giving carry flag
+ leal 1(%edi), %ebx C n2+1
+ movl %ebp, %eax C d
+
+ adcl %edx, %ebx C 1 + high(n2<<32 + m*(n2+n1) + nadj) = q1+1
+
+ sbbl $0, %ebx
+
+ mull %ebx C (q1+1)*d
+
+ psllq $32, %mm0
+
+ psrlq %mm7, %mm0
+
+ C
+
+ C
+
+ subl %eax, %esi
+
+ sbbl %edx, %edi C n - (q1+1)*d
+ movl %esi, %edi C remainder -> n2
+ leal (%ebp,%esi), %edx
+
+ cmovc( %edx, %edi) C n - q1*d if underflow from using q1+1
+ movd %mm0, %esi
+
+ sbbl $0, %ebx C q
+
+ movl %ebx, -4(%ecx)
+
+
+C -----------------------------------------------------------------------------
+L(integer_one_left):
+ C eax scratch
+ C ebx scratch (nadj, q1)
+ C ecx scratch (dst)
+ C edx scratch
+ C esi n10
+ C edi n2
+ C ebp divisor
+ C
+ C mm7 rshift
+
+
+ movl %esi, %eax
+ movl %ebp, %ebx
+
+ sarl $31, %eax C -n1
+ movl VAR_DST_STOP, %ecx
+
+ andl %eax, %ebx C -n1 & d
+ negl %eax C n1
+
+ addl %esi, %ebx C nadj = n10 + (-n1 & d), ignoring overflow
+ addl %edi, %eax C n2+n1
+
+ mull VAR_INVERSE C m*(n2+n1)
+
+ C
+
+ C
+
+ C
+
+ addl %ebx, %eax C m*(n2+n1) + nadj, low giving carry flag
+ leal 1(%edi), %ebx C n2+1
+ movl %ebp, %eax C d
+
+ C
+
+ adcl %edx, %ebx C 1 + high(n2<<32 + m*(n2+n1) + nadj) = q1+1
+
+ sbbl $0, %ebx C q1 if q1+1 overflowed
+
+ mull %ebx
+
+ C
+
+ C
+
+ C
+
+ C
+
+ subl %eax, %esi
+ movl PARAM_XSIZE, %eax
+
+ sbbl %edx, %edi C n - (q1+1)*d
+ movl %esi, %edi C remainder -> n2
+ leal (%ebp,%esi), %edx
+
+ cmovc( %edx, %edi) C n - q1*d if underflow from using q1+1
+
+ sbbl $0, %ebx C q
+
+ movl %ebx, -8(%ecx)
+ subl $8, %ecx
+
+
+
+ orl %eax, %eax C xsize
+ jnz L(fraction_some)
+
+ movl %edi, %eax
+L(fraction_done):
+ movl VAR_NORM, %ecx
+L(zero_done):
+ movl SAVE_EBP, %ebp
+
+ movl SAVE_EDI, %edi
+
+ movl SAVE_ESI, %esi
+
+ movl SAVE_EBX, %ebx
+ addl $STACK_SPACE, %esp
+
+ shrl %cl, %eax
+ emms
+
+ ret
+
+
+C -----------------------------------------------------------------------------
+C
+C Special case for q1=0xFFFFFFFF, giving q=0xFFFFFFFF meaning the low dword
+C of q*d is simply -d and the remainder n-q*d = n10+d
+
+L(q1_ff):
+ C eax (divisor)
+ C ebx (q1+1 == 0)
+ C ecx
+ C edx
+ C esi n10
+ C edi n2
+ C ebp divisor
+
+ movl VAR_DST, %ecx
+ movl VAR_DST_STOP, %edx
+ subl $4, %ecx
+
+ movl %ecx, VAR_DST
+ psrlq %mm7, %mm0
+ leal (%ebp,%esi), %edi C n-q*d remainder -> next n2
+
+ movl $-1, (%ecx)
+ movd %mm0, %esi C next n10
+
+ cmpl %ecx, %edx
+ jne L(integer_top)
+
+ jmp L(integer_loop_done)
+
+
+
+C -----------------------------------------------------------------------------
+C
+C In the current implementation, the following successively dependent
+C micro-ops seem to exist.
+C
+C uops
+C mul 5
+C q1+1 1 (addl)
+C mul 5
+C sub 3 (negl/sbbl)
+C addback 2 (cmov)
+C ---
+C 16
+C
+C The loop in fact runs at about 17.5 cycles. Using a sarl/andl/addl for
+C the addback was found to be a touch slower.
+
+
+ ALIGN(16)
+L(fraction_some):
+ C eax
+ C ebx
+ C ecx
+ C edx
+ C esi
+ C edi carry
+ C ebp divisor
+
+ movl PARAM_DST, %esi
+ movl VAR_DST_STOP, %ecx C &dst[xsize+2]
+ movl %edi, %eax
+
+ subl $8, %ecx C &dst[xsize]
+
+
+ ALIGN(16)
+L(fraction_top):
+ C eax n2, then scratch
+ C ebx scratch (nadj, q1)
+ C ecx dst, decrementing
+ C edx scratch
+ C esi dst stop point
+ C edi n2
+ C ebp divisor
+
+ mull VAR_INVERSE C m*n2
+
+ movl %ebp, %eax C d
+ subl $4, %ecx C dst
+ leal 1(%edi), %ebx
+
+ C
+
+ C
+
+ C
+
+ addl %edx, %ebx C 1 + high(n2<<32 + m*n2) = q1+1
+
+ mull %ebx C (q1+1)*d
+
+ C
+
+ C
+
+ C
+
+ C
+
+ negl %eax C low of n - (q1+1)*d
+
+ sbbl %edx, %edi C high of n - (q1+1)*d, caring only about carry
+ leal (%ebp,%eax), %edx
+
+ cmovc( %edx, %eax) C n - q1*d if underflow from using q1+1
+
+ sbbl $0, %ebx C q
+ movl %eax, %edi C remainder->n2
+ cmpl %esi, %ecx
+
+ movl %ebx, (%ecx) C previous q
+ jne L(fraction_top)
+
+
+ jmp L(fraction_done)
+
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/p6/mmx/gmp-mparam.h b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/p6/mmx/gmp-mparam.h
new file mode 100644
index 00000000000..35c3aadfc1f
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/p6/mmx/gmp-mparam.h
@@ -0,0 +1,198 @@
+/* Intel P6/mmx gmp-mparam.h -- Compiler/machine parameter header file.
+
+Copyright 1991, 1993, 1994, 1999-2005, 2009, 2010 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 more than the
+ value in mpn/x86/p6/gmp-mparam.h. The latter is used as a hard limit in
+ mpn/x86/p6/sqr_basecase.asm. */
+
+
+/* 800 MHz P6 model 8 */
+
+#define MOD_1_NORM_THRESHOLD 4
+#define MOD_1_UNNORM_THRESHOLD 4
+#define MOD_1N_TO_MOD_1_1_THRESHOLD 9
+#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 10
+#define PREINV_MOD_1_TO_MOD_1_THRESHOLD 17
+#define USE_PREINV_DIVREM_1 1 /* native */
+#define DIVEXACT_1_THRESHOLD 0 /* always (native) */
+#define BMOD_1_TO_MOD_1_THRESHOLD 49
+
+#define MUL_TOOM22_THRESHOLD 22
+#define MUL_TOOM33_THRESHOLD 73
+#define MUL_TOOM44_THRESHOLD 193
+#define MUL_TOOM6H_THRESHOLD 254
+#define MUL_TOOM8H_THRESHOLD 381
+
+#define MUL_TOOM32_TO_TOOM43_THRESHOLD 73
+#define MUL_TOOM32_TO_TOOM53_THRESHOLD 122
+#define MUL_TOOM42_TO_TOOM53_THRESHOLD 73
+#define MUL_TOOM42_TO_TOOM63_THRESHOLD 80
+
+#define SQR_BASECASE_THRESHOLD 0 /* always (native) */
+#define SQR_TOOM2_THRESHOLD 30
+#define SQR_TOOM3_THRESHOLD 81
+#define SQR_TOOM4_THRESHOLD 142
+#define SQR_TOOM6_THRESHOLD 258
+#define SQR_TOOM8_THRESHOLD 399
+
+#define MULMOD_BNM1_THRESHOLD 15
+#define SQRMOD_BNM1_THRESHOLD 18
+
+#define MUL_FFT_MODF_THRESHOLD 476 /* k = 5 */
+#define MUL_FFT_TABLE3 \
+ { { 476, 5}, { 21, 6}, { 11, 5}, { 23, 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}, { 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, 9}, { 55,10}, { 31, 9}, \
+ { 63, 8}, { 127, 9}, { 79,10}, { 47, 9}, \
+ { 95,11}, { 31,10}, { 63, 9}, { 135,10}, \
+ { 79, 9}, { 167,10}, { 95, 9}, { 199,10}, \
+ { 111,11}, { 63,10}, { 127, 9}, { 255, 8}, \
+ { 511,10}, { 143, 9}, { 287, 8}, { 575,10}, \
+ { 159,11}, { 95,10}, { 191, 9}, { 383,10}, \
+ { 207,12}, { 63,11}, { 127,10}, { 255, 9}, \
+ { 511,10}, { 271, 9}, { 543, 8}, { 1087,10}, \
+ { 287, 9}, { 575,11}, { 159,10}, { 319, 9}, \
+ { 639,10}, { 351, 9}, { 703,11}, { 191,10}, \
+ { 383, 9}, { 767,10}, { 415, 9}, { 831,11}, \
+ { 223,10}, { 447,12}, { 127,11}, { 255,10}, \
+ { 543, 9}, { 1087,11}, { 287,10}, { 607, 9}, \
+ { 1215,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,10}, \
+ { 1215,12}, { 319,11}, { 671,10}, { 1343,11}, \
+ { 703,10}, { 1407,11}, { 735,12}, { 383,11}, \
+ { 831,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,13}, { 383,12}, { 767,11}, \
+ { 1535,12}, { 831,11}, { 1727,12}, { 959,11}, \
+ { 1919,14}, { 255,13}, { 511,12}, { 1215,11}, \
+ { 2431,13}, { 639,12}, { 1471,11}, { 2943,13}, \
+ { 767,12}, { 1727,13}, { 895,12}, { 1919,11}, \
+ { 3839,14}, { 511,13}, { 1023,12}, { 2111,13}, \
+ { 1151,12}, { 2431,13}, { 1279,12}, { 2559,13}, \
+ { 1407,12}, { 2943,14}, { 767,13}, { 1663,12}, \
+ { 3327,13}, { 1919,12}, { 3839,15}, { 32768,16} }
+#define MUL_FFT_TABLE3_SIZE 160
+#define MUL_FFT_THRESHOLD 7040
+
+#define SQR_FFT_MODF_THRESHOLD 376 /* k = 5 */
+#define SQR_FFT_TABLE3 \
+ { { 376, 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}, { 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, 9}, \
+ { 55,10}, { 31, 9}, { 79,10}, { 47, 9}, \
+ { 95,11}, { 31,10}, { 63, 9}, { 127, 8}, \
+ { 255, 9}, { 135,10}, { 79, 9}, { 167,10}, \
+ { 95, 9}, { 191, 8}, { 383,10}, { 111,11}, \
+ { 63,10}, { 127, 9}, { 255, 8}, { 511, 9}, \
+ { 271,10}, { 143, 9}, { 287, 8}, { 575, 9}, \
+ { 303, 8}, { 607,10}, { 159, 9}, { 319,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}, \
+ { 303,11}, { 159,10}, { 319, 9}, { 639,10}, \
+ { 351, 9}, { 703,11}, { 191,10}, { 383, 9}, \
+ { 767,10}, { 415, 9}, { 831,11}, { 223,10}, \
+ { 479,12}, { 127,11}, { 255,10}, { 543, 9}, \
+ { 1087,11}, { 287,10}, { 607, 9}, { 1215,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,10}, { 1215,12}, \
+ { 319,11}, { 671,10}, { 1343,11}, { 703,10}, \
+ { 1407,11}, { 735,12}, { 383,11}, { 831,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}, \
+ { 1407,13}, { 383,12}, { 831,11}, { 1727,12}, \
+ { 959,11}, { 1919,14}, { 255,13}, { 511,12}, \
+ { 1215,11}, { 2431,13}, { 639,12}, { 1471,11}, \
+ { 2943,13}, { 767,12}, { 1727,13}, { 895,12}, \
+ { 1919,11}, { 3839,14}, { 511,13}, { 1023,12}, \
+ { 2111,13}, { 1151,12}, { 2431,13}, { 1407,12}, \
+ { 2943,14}, { 767,13}, { 1535,12}, { 3071,13}, \
+ { 1663,12}, { 3455,13}, { 1919,12}, { 3839,15}, \
+ { 32768,16} }
+#define SQR_FFT_TABLE3_SIZE 161
+#define SQR_FFT_THRESHOLD 3712
+
+#define MULLO_BASECASE_THRESHOLD 8
+#define MULLO_DC_THRESHOLD 60
+#define MULLO_MUL_N_THRESHOLD 13765
+
+#define DC_DIV_QR_THRESHOLD 83
+#define DC_DIVAPPR_Q_THRESHOLD 246
+#define DC_BDIV_QR_THRESHOLD 76
+#define DC_BDIV_Q_THRESHOLD 175
+
+#define INV_MULMOD_BNM1_THRESHOLD 42
+#define INV_NEWTON_THRESHOLD 268
+#define INV_APPR_THRESHOLD 250
+
+#define BINV_NEWTON_THRESHOLD 276
+#define REDC_1_TO_REDC_N_THRESHOLD 74
+
+#define MU_DIV_QR_THRESHOLD 1442
+#define MU_DIVAPPR_Q_THRESHOLD 1442
+#define MUPI_DIV_QR_THRESHOLD 132
+#define MU_BDIV_QR_THRESHOLD 1142
+#define MU_BDIV_Q_THRESHOLD 1334
+
+#define MATRIX22_STRASSEN_THRESHOLD 18
+#define HGCD_THRESHOLD 121
+#define GCD_DC_THRESHOLD 478
+#define GCDEXT_DC_THRESHOLD 361
+#define JACOBI_BASE_METHOD 4
+
+#define GET_STR_DC_THRESHOLD 13
+#define GET_STR_PRECOMPUTE_THRESHOLD 26
+#define SET_STR_DC_THRESHOLD 272
+#define SET_STR_PRECOMPUTE_THRESHOLD 1074
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/p6/mmx/lshift.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/p6/mmx/lshift.asm
new file mode 100644
index 00000000000..febd1c0e6ca
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/p6/mmx/lshift.asm
@@ -0,0 +1,38 @@
+dnl Intel Pentium-II mpn_lshift -- mpn left shift.
+
+dnl Copyright 2001 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 The P55 code runs well on P-II/III, but could stand some minor tweaks
+dnl at some stage probably.
+
+include(`../config.m4')
+
+MULFUNC_PROLOGUE(mpn_lshift)
+include_mpn(`x86/pentium/mmx/lshift.asm')
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/p6/mmx/popham.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/p6/mmx/popham.asm
new file mode 100644
index 00000000000..fd340e4b450
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/p6/mmx/popham.asm
@@ -0,0 +1,39 @@
+dnl Intel Pentium-II mpn_popcount, mpn_hamdist -- population count and
+dnl hamming distance.
+
+dnl Copyright 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 P6MMX: popcount 11 cycles/limb (approx), hamdist 11.5 cycles/limb (approx)
+
+
+MULFUNC_PROLOGUE(mpn_popcount mpn_hamdist)
+include_mpn(`x86/k6/mmx/popham.asm')
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/p6/mmx/rshift.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/p6/mmx/rshift.asm
new file mode 100644
index 00000000000..77aa1909fa7
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/p6/mmx/rshift.asm
@@ -0,0 +1,38 @@
+dnl Intel Pentium-II mpn_rshift -- mpn left shift.
+
+dnl Copyright 2001 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 The P55 code runs well on P-II/III, but could stand some minor tweaks
+dnl at some stage probably.
+
+include(`../config.m4')
+
+MULFUNC_PROLOGUE(mpn_rshift)
+include_mpn(`x86/pentium/mmx/rshift.asm')
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/p6/mod_34lsub1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/p6/mod_34lsub1.asm
new file mode 100644
index 00000000000..b88ab5d17cd
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/p6/mod_34lsub1.asm
@@ -0,0 +1,190 @@
+dnl Intel P6 mpn_mod_34lsub1 -- remainder modulo 2^24-1.
+
+dnl Copyright 2000-2002, 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 P6: 2.0 cycles/limb
+
+C TODO
+C Experiments with more unrolling indicate that 1.5 c/l is possible on P6-13
+C with the current carry handling scheme.
+
+C mp_limb_t mpn_mod_34lsub1 (mp_srcptr src, mp_size_t size)
+C
+C Groups of three limbs are handled, with carry bits from 0mod3 into 1mod3
+C into 2mod3, but at that point going into a separate carries total so we
+C don't keep the carry flag live across the loop control. Avoiding decl
+C lets us get to 2.0 c/l, as compared to the generic x86 code at 3.66.
+C
+
+defframe(PARAM_SIZE, 8)
+defframe(PARAM_SRC, 4)
+
+dnl re-use parameter space
+define(SAVE_EBX, `PARAM_SIZE')
+define(SAVE_ESI, `PARAM_SRC')
+
+ TEXT
+ ALIGN(16)
+PROLOGUE(mpn_mod_34lsub1)
+deflit(`FRAME',0)
+
+ movl PARAM_SIZE, %ecx
+ movl PARAM_SRC, %edx
+
+ subl $2, %ecx C size-2
+ movl (%edx), %eax C src[0]
+ ja L(three_or_more)
+ jb L(one)
+
+ C size==2
+
+ movl 4(%edx), %ecx C src[1]
+
+ movl %eax, %edx C src[0]
+ shrl $24, %eax C src[0] high
+
+ andl $0xFFFFFF, %edx C src[0] low
+
+ addl %edx, %eax
+ movl %ecx, %edx C src[1]
+ shrl $16, %ecx C src[1] high
+
+ andl $0xFFFF, %edx
+ addl %ecx, %eax
+
+ shll $8, %edx C src[1] low
+
+ addl %edx, %eax
+L(one):
+ ret
+
+
+L(three_or_more):
+ C eax src[0], initial acc 0mod3
+ C ebx
+ C ecx size-2
+ C edx src
+ C esi
+ C edi
+ C ebp
+
+ movl %ebx, SAVE_EBX
+ movl 4(%edx), %ebx C src[1], initial 1mod3
+ subl $3, %ecx C size-5
+
+ movl %esi, SAVE_ESI
+ movl 8(%edx), %esi C src[2], initial 2mod3
+
+ pushl %edi FRAME_pushl()
+ movl $0, %edi C initial carries 0mod3
+ jng L(done) C if size < 6
+
+
+L(top):
+ C eax acc 0mod3
+ C ebx acc 1mod3
+ C ecx counter, limbs
+ C edx src
+ C esi acc 2mod3
+ C edi carrys into 0mod3
+ C ebp
+
+ addl 12(%edx), %eax
+ adcl 16(%edx), %ebx
+ adcl 20(%edx), %esi
+ leal 12(%edx), %edx
+ adcl $0, %edi
+
+ subl $3, %ecx
+ jg L(top) C at least 3 more to process
+
+
+L(done):
+ C ecx is -2, -1 or 0 representing 0, 1 or 2 more limbs respectively
+ cmpl $-1, %ecx
+ jl L(done_0) C if -2, meaning 0 more limbs
+
+ C 1 or 2 more limbs
+ movl $0, %ecx
+ je L(done_1) C if -1, meaning 1 more limb only
+ movl 16(%edx), %ecx
+L(done_1):
+ addl 12(%edx), %eax C 0mod3
+ adcl %ecx, %ebx C 1mod3
+ adcl $0, %esi C 2mod3
+ adcl $0, %edi C carries 0mod3
+
+L(done_0):
+ C eax acc 0mod3
+ C ebx acc 1mod3
+ C ecx
+ C edx
+ C esi acc 2mod3
+ C edi carries 0mod3
+ C ebp
+
+ movl %eax, %ecx C 0mod3
+ shrl $24, %eax C 0mod3 high initial total
+
+ andl $0xFFFFFF, %ecx C 0mod3 low
+ movl %edi, %edx C carries
+ shrl $24, %edi C carries high
+
+ addl %ecx, %eax C add 0mod3 low
+ andl $0xFFFFFF, %edx C carries 0mod3 low
+ movl %ebx, %ecx C 1mod3
+
+ shrl $16, %ebx C 1mod3 high
+ addl %edi, %eax C add carries high
+ addl %edx, %eax C add carries 0mod3 low
+
+ andl $0xFFFF, %ecx C 1mod3 low mask
+ addl %ebx, %eax C add 1mod3 high
+ movl SAVE_EBX, %ebx
+
+ shll $8, %ecx C 1mod3 low
+ movl %esi, %edx C 2mod3
+ popl %edi FRAME_popl()
+
+ shrl $8, %esi C 2mod3 high
+ andl $0xFF, %edx C 2mod3 low mask
+ addl %ecx, %eax C add 1mod3 low
+
+ shll $16, %edx C 2mod3 low
+ addl %esi, %eax C add 2mod3 high
+ movl SAVE_ESI, %esi
+
+ addl %edx, %eax C add 2mod3 low
+
+ ret
+
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/p6/mode1o.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/p6/mode1o.asm
new file mode 100644
index 00000000000..c62b676e5ad
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/p6/mode1o.asm
@@ -0,0 +1,169 @@
+dnl Intel P6 mpn_modexact_1_odd -- exact division style remainder.
+
+dnl Copyright 2000-2002, 2007 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 P6: 10.0 cycles/limb
+
+
+C mp_limb_t mpn_modexact_1_odd (mp_srcptr src, mp_size_t size,
+C mp_limb_t divisor);
+C mp_limb_t mpn_modexact_1c_odd (mp_srcptr src, mp_size_t size,
+C mp_limb_t divisor, mp_limb_t carry);
+C
+C It's not worth skipping a step at the end when high<divisor since the main
+C loop is only 10 cycles.
+
+defframe(PARAM_CARRY, 16)
+defframe(PARAM_DIVISOR,12)
+defframe(PARAM_SIZE, 8)
+defframe(PARAM_SRC, 4)
+
+dnl Not enough room under modexact_1 to make these re-use the parameter
+dnl space, unfortunately.
+defframe(SAVE_EBX, -4)
+defframe(SAVE_ESI, -8)
+defframe(SAVE_EDI, -12)
+deflit(STACK_SPACE, 12)
+
+ TEXT
+
+ ALIGN(16)
+PROLOGUE(mpn_modexact_1c_odd)
+deflit(`FRAME',0)
+
+ movl PARAM_CARRY, %ecx
+ jmp L(start_1c)
+
+EPILOGUE()
+
+ ALIGN(16)
+PROLOGUE(mpn_modexact_1_odd)
+deflit(`FRAME',0)
+
+ xorl %ecx, %ecx
+L(start_1c):
+ movl PARAM_DIVISOR, %eax
+
+ subl $STACK_SPACE, %esp FRAME_subl_esp(STACK_SPACE)
+
+ movl %esi, SAVE_ESI
+ movl PARAM_SRC, %esi
+
+ shrl %eax C d/2
+ movl %edi, SAVE_EDI
+
+ andl $127, %eax
+
+ifdef(`PIC',`
+ LEA( binvert_limb_table, %edi)
+ movzbl (%eax,%edi), %edi C inv 8 bits
+',`
+ movzbl binvert_limb_table(%eax), %edi C inv 8 bits
+')
+
+ xorl %edx, %edx C initial extra carry
+ leal (%edi,%edi), %eax C 2*inv
+
+ imull %edi, %edi C inv*inv
+
+ movl %ebx, SAVE_EBX
+ movl PARAM_SIZE, %ebx
+
+ imull PARAM_DIVISOR, %edi C inv*inv*d
+
+ subl %edi, %eax C inv = 2*inv - inv*inv*d
+ leal (%eax,%eax), %edi C 2*inv
+
+ imull %eax, %eax C inv*inv
+
+ imull PARAM_DIVISOR, %eax C inv*inv*d
+
+ leal (%esi,%ebx,4), %esi C src end
+ negl %ebx C -size
+
+ subl %eax, %edi C inv = 2*inv - inv*inv*d
+
+ ASSERT(e,` C d*inv == 1 mod 2^GMP_LIMB_BITS
+ movl PARAM_DIVISOR, %eax
+ imull %edi, %eax
+ cmpl $1, %eax')
+
+
+C The dependent chain here is
+C
+C subl %edx, %eax 1
+C imull %edi, %eax 4
+C mull PARAM_DIVISOR 5
+C ----
+C total 10
+C
+C and this is the measured speed. No special scheduling is necessary, out
+C of order execution hides the load latency.
+
+L(top):
+ C eax scratch (src limb)
+ C ebx counter, limbs, negative
+ C ecx carry bit, 0 or 1
+ C edx carry limb, high of last product
+ C esi &src[size]
+ C edi inverse
+ C ebp
+
+ movl (%esi,%ebx,4), %eax
+ subl %ecx, %eax
+
+ sbbl %ecx, %ecx
+ subl %edx, %eax
+
+ sbbl $0, %ecx
+
+ imull %edi, %eax
+
+ negl %ecx
+
+ mull PARAM_DIVISOR
+
+ incl %ebx
+ jnz L(top)
+
+
+ movl SAVE_ESI, %esi
+ leal (%ecx,%edx), %eax
+
+ movl SAVE_EDI, %edi
+
+ movl SAVE_EBX, %ebx
+ addl $STACK_SPACE, %esp
+
+ ret
+
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/p6/mul_basecase.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/p6/mul_basecase.asm
new file mode 100644
index 00000000000..d87bc12b606
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/p6/mul_basecase.asm
@@ -0,0 +1,607 @@
+dnl Intel P6 mpn_mul_basecase -- multiply two mpn numbers.
+
+dnl Copyright 1999-2003 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 P6: approx 6.5 cycles per cross product (16 limbs/loop unrolling).
+
+
+dnl P6 UNROLL_COUNT cycles/product (approx)
+dnl 8 7
+dnl 16 6.5
+dnl 32 6.4
+dnl Maximum possible with the current code is 32.
+
+deflit(UNROLL_COUNT, 16)
+
+
+C void mpn_mul_basecase (mp_ptr wp,
+C mp_srcptr xp, mp_size_t xsize,
+C mp_srcptr yp, mp_size_t ysize);
+C
+C This routine is essentially the same as mpn/generic/mul_basecase.c, but
+C it's faster because it does most of the mpn_addmul_1() startup
+C calculations only once.
+
+ifdef(`PIC',`
+deflit(UNROLL_THRESHOLD, 5)
+',`
+deflit(UNROLL_THRESHOLD, 5)
+')
+
+defframe(PARAM_YSIZE,20)
+defframe(PARAM_YP, 16)
+defframe(PARAM_XSIZE,12)
+defframe(PARAM_XP, 8)
+defframe(PARAM_WP, 4)
+
+ TEXT
+ ALIGN(16)
+
+PROLOGUE(mpn_mul_basecase)
+deflit(`FRAME',0)
+
+ movl PARAM_XSIZE, %ecx
+
+ movl PARAM_YP, %eax
+
+ movl PARAM_XP, %edx
+
+ movl (%eax), %eax C yp[0]
+ cmpl $2, %ecx
+ ja L(xsize_more_than_two)
+ je L(two_by_something)
+
+
+ C one limb by one limb
+
+ mull (%edx)
+
+ movl PARAM_WP, %ecx
+ movl %eax, (%ecx)
+ movl %edx, 4(%ecx)
+ ret
+
+
+C -----------------------------------------------------------------------------
+L(two_by_something):
+deflit(`FRAME',0)
+
+dnl re-use parameter space
+define(SAVE_EBX, `PARAM_XSIZE')
+define(SAVE_ESI, `PARAM_YSIZE')
+
+ movl %ebx, SAVE_EBX
+ cmpl $1, PARAM_YSIZE
+ movl %eax, %ecx C yp[0]
+
+ movl %esi, SAVE_ESI C save esi
+ movl PARAM_WP, %ebx
+ movl %edx, %esi C xp
+
+ movl (%edx), %eax C xp[0]
+ jne L(two_by_two)
+
+
+ C two limbs by one limb
+ C
+ C eax xp[0]
+ C ebx wp
+ C ecx yp[0]
+ C edx
+ C esi xp
+
+ mull %ecx
+
+ movl %eax, (%ebx)
+ movl 4(%esi), %eax
+ movl %edx, %esi C carry
+
+ mull %ecx
+
+ addl %eax, %esi
+
+ movl %esi, 4(%ebx)
+ movl SAVE_ESI, %esi
+
+ adcl $0, %edx
+
+ movl %edx, 8(%ebx)
+ movl SAVE_EBX, %ebx
+
+ ret
+
+
+
+C -----------------------------------------------------------------------------
+
+ ALIGN(16)
+L(two_by_two):
+ C eax xp[0]
+ C ebx wp
+ C ecx yp[0]
+ C edx
+ C esi xp
+ C edi
+ C ebp
+
+dnl more parameter space re-use
+define(SAVE_EDI, `PARAM_WP')
+
+ mull %ecx C xp[0] * yp[0]
+
+ movl %edi, SAVE_EDI
+ movl %edx, %edi C carry, for wp[1]
+
+ movl %eax, (%ebx)
+ movl 4(%esi), %eax
+
+ mull %ecx C xp[1] * yp[0]
+
+ addl %eax, %edi
+ movl PARAM_YP, %ecx
+
+ adcl $0, %edx
+ movl 4(%ecx), %ecx C yp[1]
+
+ movl %edi, 4(%ebx)
+ movl 4(%esi), %eax C xp[1]
+ movl %edx, %edi C carry, for wp[2]
+
+ mull %ecx C xp[1] * yp[1]
+
+ addl %eax, %edi
+ movl (%esi), %eax C xp[0]
+
+ adcl $0, %edx
+ movl %edx, %esi C carry, for wp[3]
+
+ mull %ecx C xp[0] * yp[1]
+
+ addl %eax, 4(%ebx)
+ movl %esi, %eax
+
+ adcl %edx, %edi
+ movl SAVE_ESI, %esi
+
+ movl %edi, 8(%ebx)
+
+ adcl $0, %eax
+ movl SAVE_EDI, %edi
+
+ movl %eax, 12(%ebx)
+ movl SAVE_EBX, %ebx
+
+ ret
+
+
+C -----------------------------------------------------------------------------
+ ALIGN(16)
+L(xsize_more_than_two):
+
+C The first limb of yp is processed with a simple mpn_mul_1 loop running at
+C about 6.2 c/l. Unrolling this doesn't seem worthwhile since it's only run
+C once (whereas the addmul_1 below is run ysize-1 many times). A call to
+C mpn_mul_1 would be slowed down by the parameter pushing and popping etc,
+C and doesn't seem likely to be worthwhile on the typical sizes reaching
+C here from the Karatsuba code.
+
+ C eax yp[0]
+ C ebx
+ C ecx xsize
+ C edx xp
+ C esi
+ C edi
+ C ebp
+
+defframe(`SAVE_EBX', -4)
+defframe(`SAVE_ESI', -8)
+defframe(`SAVE_EDI', -12)
+defframe(`SAVE_EBP', -16)
+defframe(VAR_COUNTER, -20) dnl for use in the unroll case
+defframe(VAR_ADJUST, -24)
+defframe(VAR_JMP, -28)
+defframe(VAR_SWAP, -32)
+defframe(VAR_XP_LOW, -36)
+deflit(STACK_SPACE, 36)
+
+ subl $STACK_SPACE, %esp
+deflit(`FRAME',STACK_SPACE)
+
+ movl %edi, SAVE_EDI
+ movl PARAM_WP, %edi
+
+ movl %ebx, SAVE_EBX
+
+ movl %ebp, SAVE_EBP
+ movl %eax, %ebp
+
+ movl %esi, SAVE_ESI
+ xorl %ebx, %ebx
+ leal (%edx,%ecx,4), %esi C xp end
+
+ leal (%edi,%ecx,4), %edi C wp end of mul1
+ negl %ecx
+
+
+L(mul1):
+ C eax scratch
+ C ebx carry
+ C ecx counter, negative
+ C edx scratch
+ C esi xp end
+ C edi wp end of mul1
+ C ebp multiplier
+
+ movl (%esi,%ecx,4), %eax
+
+ mull %ebp
+
+ addl %ebx, %eax
+ movl %eax, (%edi,%ecx,4)
+ movl $0, %ebx
+
+ adcl %edx, %ebx
+ incl %ecx
+ jnz L(mul1)
+
+
+ movl PARAM_YSIZE, %edx
+
+ movl %ebx, (%edi) C final carry
+ movl PARAM_XSIZE, %ecx
+ decl %edx
+
+ jz L(done) C if ysize==1
+
+ cmpl $UNROLL_THRESHOLD, %ecx
+ movl PARAM_YP, %eax
+ jae L(unroll)
+
+
+C -----------------------------------------------------------------------------
+ C simple addmul looping
+ C
+ C eax yp
+ C ebx
+ C ecx xsize
+ C edx ysize-1
+ C esi xp end
+ C edi wp end of mul1
+ C ebp
+
+ leal 4(%eax,%edx,4), %ebp C yp end
+ negl %ecx
+ negl %edx
+
+ movl %edx, PARAM_YSIZE C -(ysize-1)
+ movl (%esi,%ecx,4), %eax C xp low limb
+ incl %ecx
+
+ movl %ecx, PARAM_XSIZE C -(xsize-1)
+ xorl %ebx, %ebx C initial carry
+
+ movl %ebp, PARAM_YP
+ movl (%ebp,%edx,4), %ebp C yp second lowest limb - multiplier
+ jmp L(simple_outer_entry)
+
+
+L(simple_outer_top):
+ C ebp ysize counter, negative
+
+ movl PARAM_YP, %edx
+
+ movl PARAM_XSIZE, %ecx C -(xsize-1)
+ xorl %ebx, %ebx C carry
+
+ movl %ebp, PARAM_YSIZE
+ addl $4, %edi C next position in wp
+
+ movl (%edx,%ebp,4), %ebp C yp limb - multiplier
+
+ movl -4(%esi,%ecx,4), %eax C xp low limb
+
+
+L(simple_outer_entry):
+
+L(simple_inner_top):
+ C eax xp limb
+ C ebx carry limb
+ C ecx loop counter (negative)
+ C edx scratch
+ C esi xp end
+ C edi wp end
+ C ebp multiplier
+
+ mull %ebp
+
+ addl %eax, %ebx
+ adcl $0, %edx
+
+ addl %ebx, (%edi,%ecx,4)
+ movl (%esi,%ecx,4), %eax
+ adcl $0, %edx
+
+ incl %ecx
+ movl %edx, %ebx
+ jnz L(simple_inner_top)
+
+
+ C separate code for last limb so outer loop counter handling can be
+ C interleaved
+
+ mull %ebp
+
+ movl PARAM_YSIZE, %ebp
+ addl %eax, %ebx
+
+ adcl $0, %edx
+
+ addl %ebx, (%edi)
+
+ adcl $0, %edx
+ incl %ebp
+
+ movl %edx, 4(%edi)
+ jnz L(simple_outer_top)
+
+
+L(done):
+ movl SAVE_EBX, %ebx
+
+ movl SAVE_ESI, %esi
+
+ movl SAVE_EDI, %edi
+
+ movl SAVE_EBP, %ebp
+ addl $FRAME, %esp
+
+ ret
+
+
+
+C -----------------------------------------------------------------------------
+C
+C The unrolled loop is the same as in mpn_addmul_1, see that code for some
+C comments.
+C
+C VAR_ADJUST is the negative of how many limbs the leals in the inner loop
+C increment xp and wp. This is used to adjust xp and wp, and is rshifted to
+C given an initial VAR_COUNTER at the top of the outer loop.
+C
+C VAR_COUNTER is for the unrolled loop, running from VAR_ADJUST/UNROLL_COUNT
+C up to -1, inclusive.
+C
+C VAR_JMP is the computed jump into the unrolled loop.
+C
+C VAR_SWAP is 0 if xsize odd or 0xFFFFFFFF if xsize even, used to swap the
+C initial ebx and ecx on entry to the unrolling.
+C
+C VAR_XP_LOW is the least significant limb of xp, which is needed at the
+C start of the unrolled loop.
+C
+C PARAM_YSIZE is the outer loop counter, going from -(ysize-1) up to -1,
+C inclusive.
+C
+C PARAM_YP is offset appropriately so that the PARAM_YSIZE counter can be
+C added to give the location of the next limb of yp, which is the multiplier
+C in the unrolled loop.
+C
+C The trick with the VAR_ADJUST value means it's only necessary to do one
+C fetch in the outer loop to take care of xp, wp and the inner loop counter.
+
+
+L(unroll):
+ C eax yp
+ C ebx
+ C ecx xsize
+ C edx ysize-1
+ C esi xp end
+ C edi wp end of mul1
+ C ebp
+
+ movl PARAM_XP, %esi
+
+ movl 4(%eax), %ebp C multiplier (yp second limb)
+ leal 4(%eax,%edx,4), %eax C yp adjust for ysize indexing
+
+ movl %eax, PARAM_YP
+ movl PARAM_WP, %edi
+ negl %edx
+
+ movl %edx, PARAM_YSIZE
+ leal UNROLL_COUNT-2(%ecx), %ebx C (xsize-1)+UNROLL_COUNT-1
+ decl %ecx C xsize-1
+
+ movl (%esi), %eax C xp low limb
+ andl $-UNROLL_MASK-1, %ebx
+ negl %ecx C -(xsize-1)
+
+ negl %ebx
+ andl $UNROLL_MASK, %ecx
+
+ movl %ebx, VAR_ADJUST
+ movl %ecx, %edx
+ shll $4, %ecx
+
+ movl %eax, VAR_XP_LOW
+ sarl $UNROLL_LOG2, %ebx
+ negl %edx
+
+ C 15 code bytes per limb
+ifdef(`PIC',`
+ call L(pic_calc)
+L(unroll_here):
+',`
+ leal L(unroll_inner_entry) (%ecx,%edx,1), %ecx
+')
+
+ movl %ecx, VAR_JMP
+ movl %edx, %ecx
+ shll $31, %edx
+
+ sarl $31, %edx C 0 or -1 as xsize odd or even
+ leal 4(%edi,%ecx,4), %edi C wp and xp, adjust for unrolling,
+ leal 4(%esi,%ecx,4), %esi C and start at second limb
+
+ movl %edx, VAR_SWAP
+ jmp L(unroll_outer_entry)
+
+
+ifdef(`PIC',`
+L(pic_calc):
+ C See mpn/x86/README about old gas bugs
+ leal (%ecx,%edx,1), %ecx
+ addl $L(unroll_inner_entry)-L(unroll_here), %ecx
+ addl (%esp), %ecx
+ ret_internal
+')
+
+
+C --------------------------------------------------------------------------
+ ALIGN(16)
+L(unroll_outer_top):
+ C eax
+ C ebx
+ C ecx
+ C edx
+ C esi xp + offset
+ C edi wp + offset
+ C ebp ysize counter, negative
+
+ movl VAR_ADJUST, %ebx
+ movl PARAM_YP, %edx
+
+ movl VAR_XP_LOW, %eax
+ movl %ebp, PARAM_YSIZE C store incremented ysize counter
+
+ leal eval(UNROLL_BYTES + 4) (%edi,%ebx,4), %edi
+ leal (%esi,%ebx,4), %esi
+ sarl $UNROLL_LOG2, %ebx
+
+ movl (%edx,%ebp,4), %ebp C yp next multiplier
+
+L(unroll_outer_entry):
+ mull %ebp
+
+ movl %ebx, VAR_COUNTER
+ movl %edx, %ebx C carry high
+ movl %eax, %ecx C carry low
+
+ xorl %edx, %eax
+ movl VAR_JMP, %edx
+
+ andl VAR_SWAP, %eax
+
+ xorl %eax, %ebx C carries other way for odd index
+ xorl %eax, %ecx
+
+ jmp *%edx
+
+
+C -----------------------------------------------------------------------------
+
+L(unroll_inner_top):
+ C eax xp limb
+ C ebx carry high
+ C ecx carry low
+ C edx scratch
+ C esi xp+8
+ C edi wp
+ C ebp yp multiplier limb
+ C
+ C VAR_COUNTER loop counter, negative
+ C
+ C 15 bytes each limb
+
+ addl $UNROLL_BYTES, %edi
+
+L(unroll_inner_entry):
+
+deflit(CHUNK_COUNT,2)
+forloop(`i', 0, UNROLL_COUNT/CHUNK_COUNT-1, `
+ deflit(`disp0', eval(i*CHUNK_COUNT*4 ifelse(UNROLL_BYTES,256,-128)))
+ deflit(`disp1', eval(disp0 + 4))
+
+Zdisp( movl, disp0,(%esi), %eax)
+ mull %ebp
+Zdisp( addl, %ecx, disp0,(%edi))
+ adcl %eax, %ebx C new carry low
+ movl %edx, %ecx
+ adcl $0, %ecx C new carry high
+
+ movl disp1(%esi), %eax
+ mull %ebp
+ addl %ebx, disp1(%edi)
+ adcl %eax, %ecx C new carry low
+ movl %edx, %ebx
+ adcl $0, %ebx C new carry high
+')
+
+
+ incl VAR_COUNTER
+ leal UNROLL_BYTES(%esi), %esi
+ jnz L(unroll_inner_top)
+
+
+ C eax
+ C ebx carry high
+ C ecx carry low
+ C edx
+ C esi
+ C edi wp, pointing at second last limb)
+ C ebp
+
+deflit(`disp0', eval(UNROLL_BYTES ifelse(UNROLL_BYTES,256,-128)))
+deflit(`disp1', eval(disp0 + 4))
+
+ movl PARAM_YSIZE, %ebp
+ addl %ecx, disp0(%edi) C carry low
+
+ adcl $0, %ebx
+ incl %ebp
+
+ movl %ebx, disp1(%edi) C carry high
+ jnz L(unroll_outer_top)
+
+
+ movl SAVE_ESI, %esi
+
+ movl SAVE_EBP, %ebp
+
+ movl SAVE_EDI, %edi
+
+ movl SAVE_EBX, %ebx
+ addl $FRAME, %esp
+
+ ret
+
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/p6/p3mmx/popham.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/p6/p3mmx/popham.asm
new file mode 100644
index 00000000000..db2f2601c9e
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/p6/p3mmx/popham.asm
@@ -0,0 +1,42 @@
+dnl Intel Pentium-III mpn_popcount, mpn_hamdist -- population count and
+dnl hamming distance.
+
+dnl Copyright 2000, 2002, 2004, 2007 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 popcount hamdist
+C P3 generic 6.5 7
+C P3 model 9 (Banias) ? ?
+C P3 model 13 (Dothan) 5.75 6
+
+
+MULFUNC_PROLOGUE(mpn_popcount mpn_hamdist)
+include_mpn(`x86/k7/mmx/popham.asm')
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/p6/sqr_basecase.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/p6/sqr_basecase.asm
new file mode 100644
index 00000000000..8fc7fdf3753
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/p6/sqr_basecase.asm
@@ -0,0 +1,649 @@
+dnl Intel P6 mpn_sqr_basecase -- square an mpn number.
+
+dnl Copyright 1999, 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 P6: approx 4.0 cycles per cross product, or 7.75 cycles per triangular
+C product (measured on the speed difference between 20 and 40 limbs,
+C which is the Karatsuba recursing range).
+
+
+dnl These are the same as in mpn/x86/k6/sqr_basecase.asm, see that file for
+dnl a description. The only difference here is that UNROLL_COUNT can go up
+dnl to 64 (not 63) making SQR_TOOM2_THRESHOLD_MAX 67.
+
+deflit(SQR_TOOM2_THRESHOLD_MAX, 67)
+
+ifdef(`SQR_TOOM2_THRESHOLD_OVERRIDE',
+`define(`SQR_TOOM2_THRESHOLD',SQR_TOOM2_THRESHOLD_OVERRIDE)')
+
+m4_config_gmp_mparam(`SQR_TOOM2_THRESHOLD')
+deflit(UNROLL_COUNT, eval(SQR_TOOM2_THRESHOLD-3))
+
+
+C void mpn_sqr_basecase (mp_ptr dst, mp_srcptr src, mp_size_t size);
+C
+C The algorithm is basically the same as mpn/generic/sqr_basecase.c, but a
+C lot of function call overheads are avoided, especially when the given size
+C is small.
+C
+C The code size might look a bit excessive, but not all of it is executed so
+C it won't all get into the code cache. The 1x1, 2x2 and 3x3 special cases
+C clearly apply only to those sizes; mid sizes like 10x10 only need part of
+C the unrolled addmul; and big sizes like 40x40 that do use the full
+C unrolling will least be making good use of it, because 40x40 will take
+C something like 7000 cycles.
+
+defframe(PARAM_SIZE,12)
+defframe(PARAM_SRC, 8)
+defframe(PARAM_DST, 4)
+
+ TEXT
+ ALIGN(32)
+PROLOGUE(mpn_sqr_basecase)
+deflit(`FRAME',0)
+
+ movl PARAM_SIZE, %edx
+
+ movl PARAM_SRC, %eax
+
+ cmpl $2, %edx
+ movl PARAM_DST, %ecx
+ je L(two_limbs)
+
+ movl (%eax), %eax
+ ja L(three_or_more)
+
+
+C -----------------------------------------------------------------------------
+C one limb only
+ C eax src limb
+ C ebx
+ C ecx dst
+ C edx
+
+ mull %eax
+
+ movl %eax, (%ecx)
+ movl %edx, 4(%ecx)
+
+ ret
+
+
+C -----------------------------------------------------------------------------
+L(two_limbs):
+ C eax src
+ C ebx
+ C ecx dst
+ C edx
+
+defframe(SAVE_ESI, -4)
+defframe(SAVE_EBX, -8)
+defframe(SAVE_EDI, -12)
+defframe(SAVE_EBP, -16)
+deflit(`STACK_SPACE',16)
+
+ subl $STACK_SPACE, %esp
+deflit(`FRAME',STACK_SPACE)
+
+ movl %esi, SAVE_ESI
+ movl %eax, %esi
+ movl (%eax), %eax
+
+ mull %eax C src[0]^2
+
+ movl %eax, (%ecx) C dst[0]
+ movl 4(%esi), %eax
+
+ movl %ebx, SAVE_EBX
+ movl %edx, %ebx C dst[1]
+
+ mull %eax C src[1]^2
+
+ movl %edi, SAVE_EDI
+ movl %eax, %edi C dst[2]
+ movl (%esi), %eax
+
+ movl %ebp, SAVE_EBP
+ movl %edx, %ebp C dst[3]
+
+ mull 4(%esi) C src[0]*src[1]
+
+ addl %eax, %ebx
+ movl SAVE_ESI, %esi
+
+ adcl %edx, %edi
+
+ adcl $0, %ebp
+ addl %ebx, %eax
+ movl SAVE_EBX, %ebx
+
+ adcl %edi, %edx
+ movl SAVE_EDI, %edi
+
+ adcl $0, %ebp
+
+ movl %eax, 4(%ecx)
+
+ movl %ebp, 12(%ecx)
+ movl SAVE_EBP, %ebp
+
+ movl %edx, 8(%ecx)
+ addl $FRAME, %esp
+
+ ret
+
+
+C -----------------------------------------------------------------------------
+L(three_or_more):
+ C eax src low limb
+ C ebx
+ C ecx dst
+ C edx size
+deflit(`FRAME',0)
+
+ pushl %esi defframe_pushl(`SAVE_ESI')
+ cmpl $4, %edx
+
+ movl PARAM_SRC, %esi
+ jae L(four_or_more)
+
+
+C -----------------------------------------------------------------------------
+C three limbs
+
+ C eax src low limb
+ C ebx
+ C ecx dst
+ C edx
+ C esi src
+ C edi
+ C ebp
+
+ pushl %ebp defframe_pushl(`SAVE_EBP')
+ pushl %edi defframe_pushl(`SAVE_EDI')
+
+ mull %eax C src[0] ^ 2
+
+ movl %eax, (%ecx)
+ movl %edx, 4(%ecx)
+
+ movl 4(%esi), %eax
+ xorl %ebp, %ebp
+
+ mull %eax C src[1] ^ 2
+
+ movl %eax, 8(%ecx)
+ movl %edx, 12(%ecx)
+ movl 8(%esi), %eax
+
+ pushl %ebx defframe_pushl(`SAVE_EBX')
+
+ mull %eax C src[2] ^ 2
+
+ movl %eax, 16(%ecx)
+ movl %edx, 20(%ecx)
+
+ movl (%esi), %eax
+
+ mull 4(%esi) C src[0] * src[1]
+
+ movl %eax, %ebx
+ movl %edx, %edi
+
+ movl (%esi), %eax
+
+ mull 8(%esi) C src[0] * src[2]
+
+ addl %eax, %edi
+ movl %edx, %ebp
+
+ adcl $0, %ebp
+ movl 4(%esi), %eax
+
+ mull 8(%esi) C src[1] * src[2]
+
+ xorl %esi, %esi
+ addl %eax, %ebp
+
+ C eax
+ C ebx dst[1]
+ C ecx dst
+ C edx dst[4]
+ C esi zero, will be dst[5]
+ C edi dst[2]
+ C ebp dst[3]
+
+ adcl $0, %edx
+ addl %ebx, %ebx
+
+ adcl %edi, %edi
+
+ adcl %ebp, %ebp
+
+ adcl %edx, %edx
+ movl 4(%ecx), %eax
+
+ adcl $0, %esi
+ addl %ebx, %eax
+
+ movl %eax, 4(%ecx)
+ movl 8(%ecx), %eax
+
+ adcl %edi, %eax
+ movl 12(%ecx), %ebx
+
+ adcl %ebp, %ebx
+ movl 16(%ecx), %edi
+
+ movl %eax, 8(%ecx)
+ movl SAVE_EBP, %ebp
+
+ movl %ebx, 12(%ecx)
+ movl SAVE_EBX, %ebx
+
+ adcl %edx, %edi
+ movl 20(%ecx), %eax
+
+ movl %edi, 16(%ecx)
+ movl SAVE_EDI, %edi
+
+ adcl %esi, %eax C no carry out of this
+ movl SAVE_ESI, %esi
+
+ movl %eax, 20(%ecx)
+ addl $FRAME, %esp
+
+ ret
+
+
+
+C -----------------------------------------------------------------------------
+defframe(VAR_COUNTER,-20)
+defframe(VAR_JMP, -24)
+deflit(`STACK_SPACE',24)
+
+L(four_or_more):
+ C eax src low limb
+ C ebx
+ C ecx
+ C edx size
+ C esi src
+ C edi
+ C ebp
+deflit(`FRAME',4) dnl %esi already pushed
+
+C First multiply src[0]*src[1..size-1] and store at dst[1..size].
+
+ subl $STACK_SPACE-FRAME, %esp
+deflit(`FRAME',STACK_SPACE)
+ movl $1, %ecx
+
+ movl %edi, SAVE_EDI
+ movl PARAM_DST, %edi
+
+ movl %ebx, SAVE_EBX
+ subl %edx, %ecx C -(size-1)
+
+ movl %ebp, SAVE_EBP
+ movl $0, %ebx C initial carry
+
+ leal (%esi,%edx,4), %esi C &src[size]
+ movl %eax, %ebp C multiplier
+
+ leal -4(%edi,%edx,4), %edi C &dst[size-1]
+
+
+C This loop runs at just over 6 c/l.
+
+L(mul_1):
+ C eax scratch
+ C ebx carry
+ C ecx counter, limbs, negative, -(size-1) to -1
+ C edx scratch
+ C esi &src[size]
+ C edi &dst[size-1]
+ C ebp multiplier
+
+ movl %ebp, %eax
+
+ mull (%esi,%ecx,4)
+
+ addl %ebx, %eax
+ movl $0, %ebx
+
+ adcl %edx, %ebx
+ movl %eax, 4(%edi,%ecx,4)
+
+ incl %ecx
+ jnz L(mul_1)
+
+
+ movl %ebx, 4(%edi)
+
+
+C Addmul src[n]*src[n+1..size-1] at dst[2*n-1...], for each n=1..size-2.
+C
+C The last two addmuls, which are the bottom right corner of the product
+C triangle, are left to the end. These are src[size-3]*src[size-2,size-1]
+C and src[size-2]*src[size-1]. If size is 4 then it's only these corner
+C cases that need to be done.
+C
+C The unrolled code is the same as mpn_addmul_1(), see that routine for some
+C comments.
+C
+C VAR_COUNTER is the outer loop, running from -(size-4) to -1, inclusive.
+C
+C VAR_JMP is the computed jump into the unrolled code, stepped by one code
+C chunk each outer loop.
+
+dnl This is also hard-coded in the address calculation below.
+deflit(CODE_BYTES_PER_LIMB, 15)
+
+dnl With &src[size] and &dst[size-1] pointers, the displacements in the
+dnl unrolled code fit in a byte for UNROLL_COUNT values up to 32, but above
+dnl that an offset must be added to them.
+deflit(OFFSET,
+ifelse(eval(UNROLL_COUNT>32),1,
+eval((UNROLL_COUNT-32)*4),
+0))
+
+ C eax
+ C ebx carry
+ C ecx
+ C edx
+ C esi &src[size]
+ C edi &dst[size-1]
+ C ebp
+
+ movl PARAM_SIZE, %ecx
+
+ subl $4, %ecx
+ jz L(corner)
+
+ movl %ecx, %edx
+ negl %ecx
+
+ shll $4, %ecx
+ifelse(OFFSET,0,,`subl $OFFSET, %esi')
+
+ifdef(`PIC',`
+ call L(pic_calc)
+L(here):
+',`
+ leal L(unroll_inner_end)-eval(2*CODE_BYTES_PER_LIMB)(%ecx,%edx), %ecx
+')
+ negl %edx
+
+ifelse(OFFSET,0,,`subl $OFFSET, %edi')
+
+ C The calculated jump mustn't be before the start of the available
+ C code. This is the limit that UNROLL_COUNT puts on the src operand
+ C size, but checked here using the jump address directly.
+
+ ASSERT(ae,
+ `movl_text_address( L(unroll_inner_start), %eax)
+ cmpl %eax, %ecx')
+
+
+C -----------------------------------------------------------------------------
+ ALIGN(16)
+L(unroll_outer_top):
+ C eax
+ C ebx high limb to store
+ C ecx VAR_JMP
+ C edx VAR_COUNTER, limbs, negative
+ C esi &src[size], constant
+ C edi dst ptr, second highest limb of last addmul
+ C ebp
+
+ movl -12+OFFSET(%esi,%edx,4), %ebp C multiplier
+ movl %edx, VAR_COUNTER
+
+ movl -8+OFFSET(%esi,%edx,4), %eax C first limb of multiplicand
+
+ mull %ebp
+
+define(cmovX,`ifelse(eval(UNROLL_COUNT%2),1,`cmovz($@)',`cmovnz($@)')')
+
+ testb $1, %cl
+
+ movl %edx, %ebx C high carry
+ leal 4(%edi), %edi
+
+ movl %ecx, %edx C jump
+
+ movl %eax, %ecx C low carry
+ leal CODE_BYTES_PER_LIMB(%edx), %edx
+
+ cmovX( %ebx, %ecx) C high carry reverse
+ cmovX( %eax, %ebx) C low carry reverse
+ movl %edx, VAR_JMP
+ jmp *%edx
+
+
+ C Must be on an even address here so the low bit of the jump address
+ C will indicate which way around ecx/ebx should start.
+
+ ALIGN(2)
+
+L(unroll_inner_start):
+ C eax scratch
+ C ebx carry high
+ C ecx carry low
+ C edx scratch
+ C esi src pointer
+ C edi dst pointer
+ C ebp multiplier
+ C
+ C 15 code bytes each limb
+ C ecx/ebx reversed on each chunk
+
+forloop(`i', UNROLL_COUNT, 1, `
+ deflit(`disp_src', eval(-i*4 + OFFSET))
+ deflit(`disp_dst', eval(disp_src))
+
+ m4_assert(`disp_src>=-128 && disp_src<128')
+ m4_assert(`disp_dst>=-128 && disp_dst<128')
+
+ifelse(eval(i%2),0,`
+Zdisp( movl, disp_src,(%esi), %eax)
+ mull %ebp
+Zdisp( addl, %ebx, disp_dst,(%edi))
+ adcl %eax, %ecx
+ movl %edx, %ebx
+ adcl $0, %ebx
+',`
+ dnl this one comes out last
+Zdisp( movl, disp_src,(%esi), %eax)
+ mull %ebp
+Zdisp( addl, %ecx, disp_dst,(%edi))
+ adcl %eax, %ebx
+ movl %edx, %ecx
+ adcl $0, %ecx
+')
+')
+L(unroll_inner_end):
+
+ addl %ebx, m4_empty_if_zero(OFFSET)(%edi)
+
+ movl VAR_COUNTER, %edx
+ adcl $0, %ecx
+
+ movl %ecx, m4_empty_if_zero(OFFSET+4)(%edi)
+ movl VAR_JMP, %ecx
+
+ incl %edx
+ jnz L(unroll_outer_top)
+
+
+ifelse(OFFSET,0,,`
+ addl $OFFSET, %esi
+ addl $OFFSET, %edi
+')
+
+
+C -----------------------------------------------------------------------------
+ ALIGN(16)
+L(corner):
+ C eax
+ C ebx
+ C ecx
+ C edx
+ C esi &src[size]
+ C edi &dst[2*size-5]
+ C ebp
+
+ movl -12(%esi), %eax
+
+ mull -8(%esi)
+
+ addl %eax, (%edi)
+ movl -12(%esi), %eax
+ movl $0, %ebx
+
+ adcl %edx, %ebx
+
+ mull -4(%esi)
+
+ addl %eax, %ebx
+ movl -8(%esi), %eax
+
+ adcl $0, %edx
+
+ addl %ebx, 4(%edi)
+ movl $0, %ebx
+
+ adcl %edx, %ebx
+
+ mull -4(%esi)
+
+ movl PARAM_SIZE, %ecx
+ addl %ebx, %eax
+
+ adcl $0, %edx
+
+ movl %eax, 8(%edi)
+
+ movl %edx, 12(%edi)
+ movl PARAM_DST, %edi
+
+
+C Left shift of dst[1..2*size-2], the bit shifted out becomes dst[2*size-1].
+
+ subl $1, %ecx C size-1
+ xorl %eax, %eax C ready for final adcl, and clear carry
+
+ movl %ecx, %edx
+ movl PARAM_SRC, %esi
+
+
+L(lshift):
+ C eax
+ C ebx
+ C ecx counter, size-1 to 1
+ C edx size-1 (for later use)
+ C esi src (for later use)
+ C edi dst, incrementing
+ C ebp
+
+ rcll 4(%edi)
+ rcll 8(%edi)
+
+ leal 8(%edi), %edi
+ decl %ecx
+ jnz L(lshift)
+
+
+ adcl %eax, %eax
+
+ movl %eax, 4(%edi) C dst most significant limb
+ movl (%esi), %eax C src[0]
+
+ leal 4(%esi,%edx,4), %esi C &src[size]
+ subl %edx, %ecx C -(size-1)
+
+
+C Now add in the squares on the diagonal, src[0]^2, src[1]^2, ...,
+C src[size-1]^2. dst[0] hasn't yet been set at all yet, and just gets the
+C low limb of src[0]^2.
+
+
+ mull %eax
+
+ movl %eax, (%edi,%ecx,8) C dst[0]
+
+
+L(diag):
+ C eax scratch
+ C ebx scratch
+ C ecx counter, negative
+ C edx carry
+ C esi &src[size]
+ C edi dst[2*size-2]
+ C ebp
+
+ movl (%esi,%ecx,4), %eax
+ movl %edx, %ebx
+
+ mull %eax
+
+ addl %ebx, 4(%edi,%ecx,8)
+ adcl %eax, 8(%edi,%ecx,8)
+ adcl $0, %edx
+
+ incl %ecx
+ jnz L(diag)
+
+
+ movl SAVE_ESI, %esi
+ movl SAVE_EBX, %ebx
+
+ addl %edx, 4(%edi) C dst most significant limb
+
+ movl SAVE_EDI, %edi
+ movl SAVE_EBP, %ebp
+ addl $FRAME, %esp
+ ret
+
+
+
+C -----------------------------------------------------------------------------
+ifdef(`PIC',`
+L(pic_calc):
+ addl (%esp), %ecx
+ addl $L(unroll_inner_end)-L(here)-eval(2*CODE_BYTES_PER_LIMB), %ecx
+ addl %edx, %ecx
+ ret_internal
+')
+
+
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/p6/sse2/addmul_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/p6/sse2/addmul_1.asm
new file mode 100644
index 00000000000..144b627aa36
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/p6/sse2/addmul_1.asm
@@ -0,0 +1,37 @@
+dnl Intel P6/SSE2 mpn_addmul_1.
+
+dnl Copyright 2008 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 TODO
+C * Write P6 specific SSE2 code.
+
+MULFUNC_PROLOGUE(mpn_addmul_1)
+include_mpn(`x86/pentium4/sse2/addmul_1.asm')
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/p6/sse2/gmp-mparam.h b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/p6/sse2/gmp-mparam.h
new file mode 100644
index 00000000000..69226289a7d
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/p6/sse2/gmp-mparam.h
@@ -0,0 +1,197 @@
+/* Intel P6/sse2 gmp-mparam.h -- Compiler/machine parameter header file.
+
+Copyright 1991, 1993, 1994, 1999-2003, 2008-2010 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 more than the
+ value in mpn/x86/p6/gmp-mparam.h. The latter is used as a hard limit in
+ mpn/x86/p6/sqr_basecase.asm. */
+
+
+/* 1867 MHz P6 model 13 */
+
+#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 11
+#define MOD_1_2_TO_MOD_1_4_THRESHOLD 0 /* never mpn_mod_1s_2p */
+#define PREINV_MOD_1_TO_MOD_1_THRESHOLD 8
+#define USE_PREINV_DIVREM_1 1 /* native */
+#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 21
+
+#define MUL_TOOM22_THRESHOLD 20
+#define MUL_TOOM33_THRESHOLD 77
+#define MUL_TOOM44_THRESHOLD 169
+#define MUL_TOOM6H_THRESHOLD 246
+#define MUL_TOOM8H_THRESHOLD 381
+
+#define MUL_TOOM32_TO_TOOM43_THRESHOLD 73
+#define MUL_TOOM32_TO_TOOM53_THRESHOLD 114
+#define MUL_TOOM42_TO_TOOM53_THRESHOLD 97
+#define MUL_TOOM42_TO_TOOM63_THRESHOLD 80
+#define MUL_TOOM43_TO_TOOM54_THRESHOLD 106
+
+#define SQR_BASECASE_THRESHOLD 0 /* always (native) */
+#define SQR_TOOM2_THRESHOLD 30
+#define SQR_TOOM3_THRESHOLD 101
+#define SQR_TOOM4_THRESHOLD 154
+#define SQR_TOOM6_THRESHOLD 222
+#define SQR_TOOM8_THRESHOLD 527
+
+#define MULMID_TOOM42_THRESHOLD 58
+
+#define MULMOD_BNM1_THRESHOLD 13
+#define SQRMOD_BNM1_THRESHOLD 17
+
+#define MUL_FFT_MODF_THRESHOLD 690 /* k = 5 */
+#define MUL_FFT_TABLE3 \
+ { { 565, 5}, { 25, 6}, { 13, 5}, { 27, 6}, \
+ { 25, 7}, { 13, 6}, { 28, 7}, { 15, 6}, \
+ { 31, 7}, { 17, 6}, { 35, 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, 5}, \
+ { 383, 4}, { 991, 5}, { 511, 6}, { 267, 7}, \
+ { 157, 8}, { 91, 9}, { 47, 8}, { 111, 9}, \
+ { 63, 8}, { 127, 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,12}, { 63,11}, { 127,10}, { 255, 9}, \
+ { 511,10}, { 271, 9}, { 543,10}, { 287,11}, \
+ { 159,10}, { 335, 9}, { 671,11}, { 191,10}, \
+ { 383, 9}, { 767,10}, { 399, 9}, { 799,10}, \
+ { 415,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,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}, { 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}, { 1215,13}, \
+ { 639,12}, { 1471,11}, { 2943,13}, { 767,12}, \
+ { 1727,13}, { 895,12}, { 1919,14}, { 511,13}, \
+ { 1023,12}, { 2111,13}, { 1151,12}, { 2431,13}, \
+ { 1407,12}, { 2815,14}, { 767,13}, { 1663,12}, \
+ { 3455,13}, { 8192,14}, { 16384,15}, { 32768,16} }
+#define MUL_FFT_TABLE3_SIZE 132
+#define MUL_FFT_THRESHOLD 7424
+
+#define SQR_FFT_MODF_THRESHOLD 565 /* k = 5 */
+#define SQR_FFT_TABLE3 \
+ { { 472, 5}, { 25, 6}, { 13, 5}, { 27, 6}, \
+ { 25, 7}, { 13, 6}, { 27, 7}, { 15, 6}, \
+ { 31, 7}, { 17, 6}, { 35, 7}, { 27, 8}, \
+ { 15, 7}, { 35, 8}, { 19, 7}, { 41, 8}, \
+ { 23, 7}, { 49, 8}, { 27, 9}, { 15, 8}, \
+ { 39, 9}, { 23, 8}, { 51,10}, { 15, 9}, \
+ { 31, 8}, { 63, 4}, { 1023, 8}, { 67, 9}, \
+ { 39, 5}, { 639, 4}, { 1471, 6}, { 383, 7}, \
+ { 209, 8}, { 119, 9}, { 63, 7}, { 255, 8}, \
+ { 139, 9}, { 71, 8}, { 143, 9}, { 79,10}, \
+ { 47, 9}, { 95,11}, { 31,10}, { 63, 9}, \
+ { 135,10}, { 79, 9}, { 159, 8}, { 319, 9}, \
+ { 167,10}, { 95,11}, { 63,10}, { 143, 9}, \
+ { 287,10}, { 159,11}, { 95,10}, { 191,12}, \
+ { 63,11}, { 127,10}, { 255, 9}, { 543, 8}, \
+ { 1087,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}, \
+ { 543, 9}, { 1087,11}, { 287,10}, { 607, 9}, \
+ { 1215,11}, { 319,10}, { 671, 9}, { 1343,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,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}, { 8192,14}, \
+ { 16384,15}, { 32768,16} }
+#define SQR_FFT_TABLE3_SIZE 146
+#define SQR_FFT_THRESHOLD 5760
+
+#define MULLO_BASECASE_THRESHOLD 0 /* always */
+#define MULLO_DC_THRESHOLD 31
+#define MULLO_MUL_N_THRESHOLD 13463
+
+#define DC_DIV_QR_THRESHOLD 25
+#define DC_DIVAPPR_Q_THRESHOLD 55
+#define DC_BDIV_QR_THRESHOLD 60
+#define DC_BDIV_Q_THRESHOLD 132
+
+#define INV_MULMOD_BNM1_THRESHOLD 38
+#define INV_NEWTON_THRESHOLD 65
+#define INV_APPR_THRESHOLD 65
+
+#define BINV_NEWTON_THRESHOLD 252
+#define REDC_1_TO_REDC_N_THRESHOLD 62
+
+#define MU_DIV_QR_THRESHOLD 1164
+#define MU_DIVAPPR_Q_THRESHOLD 748
+#define MUPI_DIV_QR_THRESHOLD 38
+#define MU_BDIV_QR_THRESHOLD 1360
+#define MU_BDIV_Q_THRESHOLD 1470
+
+#define POWM_SEC_TABLE 2,23,258,879,2246
+
+#define MATRIX22_STRASSEN_THRESHOLD 17
+#define HGCD_THRESHOLD 69
+#define HGCD_APPR_THRESHOLD 112
+#define HGCD_REDUCE_THRESHOLD 3389
+#define GCD_DC_THRESHOLD 386
+#define GCDEXT_DC_THRESHOLD 303
+#define JACOBI_BASE_METHOD 1
+
+#define GET_STR_DC_THRESHOLD 13
+#define GET_STR_PRECOMPUTE_THRESHOLD 25
+#define SET_STR_DC_THRESHOLD 582
+#define SET_STR_PRECOMPUTE_THRESHOLD 1118
+
+#define FAC_DSC_THRESHOLD 178
+#define FAC_ODD_THRESHOLD 34
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/p6/sse2/mod_1_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/p6/sse2/mod_1_1.asm
new file mode 100644
index 00000000000..8b7b7adaa5f
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/p6/sse2/mod_1_1.asm
@@ -0,0 +1,34 @@
+dnl Intel P6/SSE2 mpn_mod_1_1.
+
+dnl Copyright 2009, 2011 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_mod_1_1p)
+include_mpn(`x86/pentium4/sse2/mod_1_1.asm')
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/p6/sse2/mod_1_4.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/p6/sse2/mod_1_4.asm
new file mode 100644
index 00000000000..49c96c60b9c
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/p6/sse2/mod_1_4.asm
@@ -0,0 +1,34 @@
+dnl Intel P6/SSE2 mpn_mod_1_4.
+
+dnl Copyright 2009, 2011 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_mod_1s_4p)
+include_mpn(`x86/pentium4/sse2/mod_1_4.asm')
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/p6/sse2/mul_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/p6/sse2/mul_1.asm
new file mode 100644
index 00000000000..50e5b6983aa
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/p6/sse2/mul_1.asm
@@ -0,0 +1,38 @@
+dnl Intel P6/SSE2 mpn_mul_1.
+
+dnl Copyright 2008 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 TODO
+C * Write P6 specific SSE2 code. It should reach 3 c/l.
+C The Pentium4 code runs at 4.2 c/l.
+
+MULFUNC_PROLOGUE(mpn_mul_1)
+include_mpn(`x86/pentium4/sse2/mul_1.asm')
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/p6/sse2/mul_basecase.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/p6/sse2/mul_basecase.asm
new file mode 100644
index 00000000000..4687625790c
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/p6/sse2/mul_basecase.asm
@@ -0,0 +1,35 @@
+dnl Intel P6/SSE2 mpn_mul_basecase.
+
+dnl Copyright 2008 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_basecase)
+include_mpn(`x86/pentium4/sse2/mul_basecase.asm')
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/p6/sse2/popcount.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/p6/sse2/popcount.asm
new file mode 100644
index 00000000000..4c02b93be28
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/p6/sse2/popcount.asm
@@ -0,0 +1,35 @@
+dnl Intel P6/SSE2 mpn_popcount -- population count.
+
+dnl Copyright 2008 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_popcount)
+include_mpn(`x86/pentium4/sse2/popcount.asm')
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/p6/sse2/sqr_basecase.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/p6/sse2/sqr_basecase.asm
new file mode 100644
index 00000000000..76b574b6c74
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/p6/sse2/sqr_basecase.asm
@@ -0,0 +1,35 @@
+dnl Intel P6/SSE2 mpn_sqr_basecase.
+
+dnl Copyright 2008 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_sqr_basecase)
+include_mpn(`x86/pentium4/sse2/sqr_basecase.asm')
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/p6/sse2/submul_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/p6/sse2/submul_1.asm
new file mode 100644
index 00000000000..98a603ce93e
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/p6/sse2/submul_1.asm
@@ -0,0 +1,35 @@
+dnl Intel P6/SSE2 mpn_submul_1.
+
+dnl Copyright 2008 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(`x86/k6/aorsmul_1.asm')
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium/README b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium/README
new file mode 100644
index 00000000000..305936bbd94
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium/README
@@ -0,0 +1,181 @@
+Copyright 1996, 1999-2001, 2003 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/.
+
+
+
+
+
+ INTEL PENTIUM P5 MPN SUBROUTINES
+
+
+This directory contains mpn functions optimized for Intel Pentium (P5,P54)
+processors. The mmx subdirectory has additional code for Pentium with MMX
+(P55).
+
+
+STATUS
+
+ cycles/limb
+
+ mpn_add_n/sub_n 2.375
+
+ mpn_mul_1 12.0
+ mpn_add/submul_1 14.0
+
+ mpn_mul_basecase 14.2 cycles/crossproduct (approx)
+
+ mpn_sqr_basecase 8 cycles/crossproduct (approx)
+ or 15.5 cycles/triangleproduct (approx)
+
+ mpn_l/rshift 5.375 normal (6.0 on P54)
+ 1.875 special shift by 1 bit
+
+ mpn_divrem_1 44.0
+ mpn_mod_1 28.0
+ mpn_divexact_by3 15.0
+
+ mpn_copyi/copyd 1.0
+
+Pentium MMX gets the following improvements
+
+ mpn_l/rshift 1.75
+
+ mpn_mul_1 12.0 normal, 7.0 for 16-bit multiplier
+
+
+mpn_add_n and mpn_sub_n run at asymptotically 2 cycles/limb. Due to loop
+overhead and other delays (cache refill?), they run at or near 2.5
+cycles/limb.
+
+mpn_mul_1, mpn_addmul_1, mpn_submul_1 all run 1 cycle faster than they
+should. Intel documentation says a mul instruction is 10 cycles, but it
+measures 9 and the routines using it run as 9.
+
+
+
+P55 MMX AND X87
+
+The cost of switching between MMX and x87 floating point on P55 is about 100
+cycles (fld1/por/emms for instance). In order to avoid that the two aren't
+mixed and currently that means using MMX and not x87.
+
+MMX offers a big speedup for lshift and rshift, and a nice speedup for
+16-bit multipliers in mpn_mul_1. If fast code using x87 is found then
+perhaps the preference for MMX will be reversed.
+
+
+
+
+P54 SHLDL
+
+mpn_lshift and mpn_rshift run at about 6 cycles/limb on P5 and P54, but the
+documentation indicates that they should take only 43/8 = 5.375 cycles/limb,
+or 5 cycles/limb asymptotically. The P55 runs them at the expected speed.
+
+It seems that on P54 a shldl or shrdl allows pairing in one following cycle,
+but not two. For example, back to back repetitions of the following
+
+ shldl( %cl, %eax, %ebx)
+ xorl %edx, %edx
+ xorl %esi, %esi
+
+run at 5 cycles, as expected, but repetitions of the following run at 7
+cycles, whereas 6 would be expected (and is achieved on P55),
+
+ shldl( %cl, %eax, %ebx)
+ xorl %edx, %edx
+ xorl %esi, %esi
+ xorl %edi, %edi
+ xorl %ebp, %ebp
+
+Three xorls run at 7 cycles too, so it doesn't seem to be just that pairing
+inhibited is only in the second following cycle (or something like that).
+
+Avoiding this problem would bring P54 shifts down from 6.0 c/l to 5.5 with a
+pattern of shift, 2 loads, shift, 2 stores, shift, etc. A start has been
+made on something like that, but it's not yet complete.
+
+
+
+
+OTHER NOTES
+
+Prefetching Destinations
+
+ Pentium doesn't allocate cache lines on writes, unlike most other modern
+ processors. Since the functions in the mpn class do array writes, we
+ have to handle allocating the destination cache lines by reading a word
+ from it in the loops, to achieve the best performance.
+
+Prefetching Sources
+
+ Prefetching of sources is pointless since there's no out-of-order loads.
+ Any load instruction blocks until the line is brought to L1, so it may
+ as well be the load that wants the data which blocks.
+
+Data Cache Bank Clashes
+
+ Pairing of memory operations requires that the two issued operations
+ refer to different cache banks (ie. different addresses modulo 32
+ bytes). The simplest way to ensure this is to read/write two words from
+ the same object. If we make operations on different objects, they might
+ or might not be to the same cache bank.
+
+PIC %eip Fetching
+
+ A simple call $+5 and popl can be used to get %eip, there's no need to
+ balance calls and returns since P5 doesn't have any return stack branch
+ prediction.
+
+Float Multiplies
+
+ fmul is pairable and can be issued every 2 cycles (with a 4 cycle
+ latency for data ready to use). This is a lot better than integer mull
+ or imull at 9 cycles non-pairing. Unfortunately the advantage is
+ quickly eaten away by needing to throw data through memory back to the
+ integer registers to adjust for fild and fist being signed, and to do
+ things like propagating carry bits.
+
+
+
+
+
+REFERENCES
+
+"Intel Architecture Optimization Manual", 1997, order number 242816. This
+is mostly about P5, the parts about P6 aren't relevant. Available on-line:
+
+ http://download.intel.com/design/PentiumII/manuals/242816.htm
+
+
+
+----------------
+Local variables:
+mode: text
+fill-column: 76
+End:
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium/aors_n.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium/aors_n.asm
new file mode 100644
index 00000000000..01ebfb96ae4
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium/aors_n.asm
@@ -0,0 +1,203 @@
+dnl Intel Pentium mpn_add_n/mpn_sub_n -- mpn addition and subtraction.
+
+dnl Copyright 1992, 1994-1996, 1999, 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 P5: 2.375 cycles/limb
+
+
+ifdef(`OPERATION_add_n',`
+ define(M4_inst, adcl)
+ define(M4_function_n, mpn_add_n)
+ define(M4_function_nc, mpn_add_nc)
+
+',`ifdef(`OPERATION_sub_n',`
+ define(M4_inst, sbbl)
+ define(M4_function_n, mpn_sub_n)
+ define(M4_function_nc, mpn_sub_nc)
+
+',`m4_error(`Need OPERATION_add_n or OPERATION_sub_n
+')')')
+
+MULFUNC_PROLOGUE(mpn_add_n mpn_add_nc mpn_sub_n mpn_sub_nc)
+
+
+C mp_limb_t M4_function_n (mp_ptr dst, mp_srcptr src1, mp_srcptr src2,
+C mp_size_t size);
+C mp_limb_t M4_function_nc (mp_ptr dst, mp_srcptr src1, mp_srcptr src2,
+C mp_size_t size, mp_limb_t carry);
+
+defframe(PARAM_CARRY,20)
+defframe(PARAM_SIZE, 16)
+defframe(PARAM_SRC2, 12)
+defframe(PARAM_SRC1, 8)
+defframe(PARAM_DST, 4)
+
+ TEXT
+ ALIGN(8)
+PROLOGUE(M4_function_nc)
+
+ pushl %edi
+ pushl %esi
+ pushl %ebx
+ pushl %ebp
+deflit(`FRAME',16)
+
+ movl PARAM_DST,%edi
+ movl PARAM_SRC1,%esi
+ movl PARAM_SRC2,%ebp
+ movl PARAM_SIZE,%ecx
+
+ movl (%ebp),%ebx
+
+ decl %ecx
+ movl %ecx,%edx
+ shrl $3,%ecx
+ andl $7,%edx
+ testl %ecx,%ecx C zero carry flag
+ jz L(endgo)
+
+ pushl %edx
+FRAME_pushl()
+ movl PARAM_CARRY,%eax
+ shrl %eax C shift bit 0 into carry
+ jmp L(oop)
+
+L(endgo):
+deflit(`FRAME',16)
+ movl PARAM_CARRY,%eax
+ shrl %eax C shift bit 0 into carry
+ jmp L(end)
+
+EPILOGUE()
+
+
+ ALIGN(8)
+PROLOGUE(M4_function_n)
+
+ pushl %edi
+ pushl %esi
+ pushl %ebx
+ pushl %ebp
+deflit(`FRAME',16)
+
+ movl PARAM_DST,%edi
+ movl PARAM_SRC1,%esi
+ movl PARAM_SRC2,%ebp
+ movl PARAM_SIZE,%ecx
+
+ movl (%ebp),%ebx
+
+ decl %ecx
+ movl %ecx,%edx
+ shrl $3,%ecx
+ andl $7,%edx
+ testl %ecx,%ecx C zero carry flag
+ jz L(end)
+ pushl %edx
+FRAME_pushl()
+
+ ALIGN(8)
+L(oop): movl 28(%edi),%eax C fetch destination cache line
+ leal 32(%edi),%edi
+
+L(1): movl (%esi),%eax
+ movl 4(%esi),%edx
+ M4_inst %ebx,%eax
+ movl 4(%ebp),%ebx
+ M4_inst %ebx,%edx
+ movl 8(%ebp),%ebx
+ movl %eax,-32(%edi)
+ movl %edx,-28(%edi)
+
+L(2): movl 8(%esi),%eax
+ movl 12(%esi),%edx
+ M4_inst %ebx,%eax
+ movl 12(%ebp),%ebx
+ M4_inst %ebx,%edx
+ movl 16(%ebp),%ebx
+ movl %eax,-24(%edi)
+ movl %edx,-20(%edi)
+
+L(3): movl 16(%esi),%eax
+ movl 20(%esi),%edx
+ M4_inst %ebx,%eax
+ movl 20(%ebp),%ebx
+ M4_inst %ebx,%edx
+ movl 24(%ebp),%ebx
+ movl %eax,-16(%edi)
+ movl %edx,-12(%edi)
+
+L(4): movl 24(%esi),%eax
+ movl 28(%esi),%edx
+ M4_inst %ebx,%eax
+ movl 28(%ebp),%ebx
+ M4_inst %ebx,%edx
+ movl 32(%ebp),%ebx
+ movl %eax,-8(%edi)
+ movl %edx,-4(%edi)
+
+ leal 32(%esi),%esi
+ leal 32(%ebp),%ebp
+ decl %ecx
+ jnz L(oop)
+
+ popl %edx
+FRAME_popl()
+L(end):
+ decl %edx C test %edx w/o clobbering carry
+ js L(end2)
+ incl %edx
+L(oop2):
+ leal 4(%edi),%edi
+ movl (%esi),%eax
+ M4_inst %ebx,%eax
+ movl 4(%ebp),%ebx
+ movl %eax,-4(%edi)
+ leal 4(%esi),%esi
+ leal 4(%ebp),%ebp
+ decl %edx
+ jnz L(oop2)
+L(end2):
+ movl (%esi),%eax
+ M4_inst %ebx,%eax
+ movl %eax,(%edi)
+
+ sbbl %eax,%eax
+ negl %eax
+
+ popl %ebp
+ popl %ebx
+ popl %esi
+ popl %edi
+ ret
+
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium/aorsmul_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium/aorsmul_1.asm
new file mode 100644
index 00000000000..d83cc4513b6
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium/aorsmul_1.asm
@@ -0,0 +1,144 @@
+dnl Intel Pentium mpn_addmul_1 -- mpn by limb multiplication.
+
+dnl Copyright 1992, 1994, 1996, 1999, 2000, 2002 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 P5: 14.0 cycles/limb
+
+
+ifdef(`OPERATION_addmul_1', `
+ define(M4_inst, addl)
+ define(M4_function_1, mpn_addmul_1)
+ define(M4_function_1c, mpn_addmul_1c)
+
+',`ifdef(`OPERATION_submul_1', `
+ define(M4_inst, subl)
+ define(M4_function_1, mpn_submul_1)
+ define(M4_function_1c, mpn_submul_1c)
+
+',`m4_error(`Need OPERATION_addmul_1 or OPERATION_submul_1
+')')')
+
+MULFUNC_PROLOGUE(mpn_addmul_1 mpn_addmul_1c mpn_submul_1 mpn_submul_1c)
+
+
+C mp_limb_t mpn_addmul_1 (mp_ptr dst, mp_srcptr src, mp_size_t size,
+C mp_limb_t mult);
+C mp_limb_t mpn_addmul_1c (mp_ptr dst, mp_srcptr src, mp_size_t size,
+C mp_limb_t mult, mp_limb_t carry);
+C
+C mp_limb_t mpn_submul_1 (mp_ptr dst, mp_srcptr src, mp_size_t size,
+C mp_limb_t mult);
+C mp_limb_t mpn_submul_1c (mp_ptr dst, mp_srcptr src, mp_size_t size,
+C mp_limb_t mult, mp_limb_t carry);
+C
+
+defframe(PARAM_CARRY, 20)
+defframe(PARAM_MULTIPLIER,16)
+defframe(PARAM_SIZE, 12)
+defframe(PARAM_SRC, 8)
+defframe(PARAM_DST, 4)
+
+ TEXT
+
+ ALIGN(8)
+PROLOGUE(M4_function_1c)
+deflit(`FRAME',0)
+
+ movl PARAM_CARRY, %ecx
+ pushl %esi FRAME_pushl()
+
+ jmp L(start_1c)
+
+EPILOGUE()
+
+
+ ALIGN(8)
+PROLOGUE(M4_function_1)
+deflit(`FRAME',0)
+
+ xorl %ecx, %ecx
+ pushl %esi FRAME_pushl()
+
+L(start_1c):
+ movl PARAM_SRC, %esi
+ movl PARAM_SIZE, %eax
+
+ pushl %edi FRAME_pushl()
+ pushl %ebx FRAME_pushl()
+
+ movl PARAM_DST, %edi
+ leal -1(%eax), %ebx C size-1
+
+ leal (%esi,%eax,4), %esi
+ xorl $-1, %ebx C -size, and clear carry
+
+ leal (%edi,%eax,4), %edi
+
+L(top):
+ C eax
+ C ebx counter, negative
+ C ecx carry
+ C edx
+ C esi src end
+ C edi dst end
+ C ebp
+
+ adcl $0, %ecx
+ movl (%esi,%ebx,4), %eax
+
+ mull PARAM_MULTIPLIER
+
+ addl %ecx, %eax
+ movl (%edi,%ebx,4), %ecx
+
+ adcl $0, %edx
+ M4_inst %eax, %ecx
+
+ movl %ecx, (%edi,%ebx,4)
+ incl %ebx
+
+ movl %edx, %ecx
+ jnz L(top)
+
+
+ adcl $0, %ecx
+ popl %ebx
+
+ movl %ecx, %eax
+ popl %edi
+
+ popl %esi
+
+ ret
+
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium/bdiv_q_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium/bdiv_q_1.asm
new file mode 100644
index 00000000000..9fee3cb87a2
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium/bdiv_q_1.asm
@@ -0,0 +1,260 @@
+dnl Intel Pentium mpn_divexact_1 -- mpn by limb exact division.
+
+dnl Rearranged from mpn/x86/pentium/dive_1.asm by Marco Bodrato.
+
+dnl Copyright 2001, 2002, 2011 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 divisor
+C odd even
+C P54: 24.5 30.5 cycles/limb
+C P55: 23.0 28.0
+
+MULFUNC_PROLOGUE(mpn_bdiv_q_1 mpn_pi1_bdiv_q_1)
+
+C The P55 speeds noted above, 23 cycles odd or 28 cycles even, are as
+C expected. On P54 in the even case the shrdl pairing nonsense (see
+C mpn/x86/pentium/README) costs 1 cycle, but it's not clear why there's a
+C further 1.5 slowdown for both odd and even.
+
+defframe(PARAM_SHIFT, 24)
+defframe(PARAM_INVERSE,20)
+defframe(PARAM_DIVISOR,16)
+defframe(PARAM_SIZE, 12)
+defframe(PARAM_SRC, 8)
+defframe(PARAM_DST, 4)
+
+dnl re-use parameter space
+define(VAR_INVERSE,`PARAM_DST')
+
+ TEXT
+
+ ALIGN(32)
+C mp_limb_t mpn_bdiv_q_1 (mp_ptr dst, mp_srcptr src, mp_size_t size,
+C mp_limb_t divisor);
+C
+PROLOGUE(mpn_bdiv_q_1)
+deflit(`FRAME',0)
+
+ movl $-1, %ecx
+ movl PARAM_DIVISOR, %eax
+
+L(strip_twos):
+ ASSERT(nz, `orl %eax, %eax')
+ shrl %eax
+ incl %ecx C shift count
+
+ jnc L(strip_twos)
+
+ leal 1(%eax,%eax), %edx C d
+ andl $127, %eax C d/2, 7 bits
+
+ pushl %ebx FRAME_pushl()
+ pushl %ebp FRAME_pushl()
+
+ifdef(`PIC',`
+ call L(here)
+L(here):
+ popl %ebp C eip
+
+ addl $_GLOBAL_OFFSET_TABLE_+[.-L(here)], %ebp
+ C AGI
+ movl binvert_limb_table@GOT(%ebp), %ebp
+ C AGI
+ movzbl (%eax,%ebp), %eax
+',`
+
+dnl non-PIC
+ movzbl binvert_limb_table(%eax), %eax C inv 8 bits
+')
+
+ movl %eax, %ebp C inv
+ addl %eax, %eax C 2*inv
+
+ imull %ebp, %ebp C inv*inv
+
+ imull %edx, %ebp C inv*inv*d
+
+ subl %ebp, %eax C inv = 2*inv - inv*inv*d
+ movl PARAM_SIZE, %ebx
+
+ movl %eax, %ebp
+ addl %eax, %eax C 2*inv
+
+ imull %ebp, %ebp C inv*inv
+
+ imull %edx, %ebp C inv*inv*d
+
+ subl %ebp, %eax C inv = 2*inv - inv*inv*d
+ movl %edx, PARAM_DIVISOR C d without twos
+
+ ASSERT(e,` C expect d*inv == 1 mod 2^GMP_LIMB_BITS
+ pushl %eax FRAME_pushl()
+ imull PARAM_DIVISOR, %eax
+ cmpl $1, %eax
+ popl %eax FRAME_popl()')
+
+ jmp L(common)
+EPILOGUE()
+
+C mp_limb_t
+C mpn_pi1_bdiv_q_1 (mp_ptr dst, mp_srcptr src, mp_size_t size, mp_limb_t divisor,
+C mp_limb_t inverse, int shift)
+ ALIGN(32)
+PROLOGUE(mpn_pi1_bdiv_q_1)
+deflit(`FRAME',0)
+
+ movl PARAM_SHIFT, %ecx
+
+ pushl %ebx FRAME_pushl()
+ pushl %ebp FRAME_pushl()
+
+ movl PARAM_SIZE, %ebx
+ movl PARAM_INVERSE, %eax
+
+L(common):
+ pushl %esi FRAME_pushl()
+ push %edi FRAME_pushl()
+
+ movl PARAM_SRC, %esi
+ movl PARAM_DST, %edi
+ movl %eax, VAR_INVERSE
+
+ leal (%esi,%ebx,4), %esi C src end
+ leal (%edi,%ebx,4), %edi C dst end
+
+ negl %ebx C -size
+
+ xorl %ebp, %ebp C initial carry bit
+
+ orl %ecx, %ecx C shift
+ movl (%esi,%ebx,4), %eax C src low limb
+ jz L(odd_entry)
+
+ xorl %edx, %edx C initial carry limb (for even, if one)
+ incl %ebx
+ jz L(one)
+
+ movl (%esi,%ebx,4), %edx C src second limb (for even)
+ shrdl( %cl, %edx, %eax)
+
+ jmp L(even_entry)
+
+
+ ALIGN(8)
+L(odd_top):
+ C eax scratch
+ C ebx counter, limbs, negative
+ C ecx
+ C edx
+ C esi src end
+ C edi dst end
+ C ebp carry bit, 0 or -1
+
+ mull PARAM_DIVISOR
+
+ movl (%esi,%ebx,4), %eax
+ subl %ebp, %edx
+
+ subl %edx, %eax
+
+ sbbl %ebp, %ebp
+
+L(odd_entry):
+ imull VAR_INVERSE, %eax
+
+ movl %eax, (%edi,%ebx,4)
+
+ incl %ebx
+ jnz L(odd_top)
+
+ popl %edi
+ popl %esi
+
+ popl %ebp
+ popl %ebx
+
+ ret
+
+L(even_top):
+ C eax scratch
+ C ebx counter, limbs, negative
+ C ecx twos
+ C edx
+ C esi src end
+ C edi dst end
+ C ebp carry bit, 0 or -1
+
+ mull PARAM_DIVISOR
+
+ subl %ebp, %edx C carry bit
+ movl -4(%esi,%ebx,4), %eax C src limb
+
+ movl (%esi,%ebx,4), %ebp C and one above it
+
+ shrdl( %cl, %ebp, %eax)
+
+ subl %edx, %eax C carry limb
+
+ sbbl %ebp, %ebp
+
+L(even_entry):
+ imull VAR_INVERSE, %eax
+
+ movl %eax, -4(%edi,%ebx,4)
+ incl %ebx
+
+ jnz L(even_top)
+
+ mull PARAM_DIVISOR
+
+ movl -4(%esi), %eax C src high limb
+ subl %ebp, %edx
+
+L(one):
+ shrl %cl, %eax
+
+ subl %edx, %eax C no carry if division is exact
+
+ imull VAR_INVERSE, %eax
+
+ movl %eax, -4(%edi) C dst high limb
+ nop C protect against cache bank clash
+
+ popl %edi
+ popl %esi
+
+ popl %ebp
+ popl %ebx
+
+ ret
+
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium/com.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium/com.asm
new file mode 100644
index 00000000000..b0805452a62
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium/com.asm
@@ -0,0 +1,181 @@
+dnl Intel Pentium mpn_com -- mpn ones complement.
+
+dnl Copyright 1996, 2001, 2002, 2006 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 P5: 1.75 cycles/limb
+
+
+NAILS_SUPPORT(0-31)
+
+
+C void mpn_com (mp_ptr dst, mp_srcptr src, mp_size_t size);
+C
+C This code is similar to mpn_copyi, basically there's just some "xorl
+C $GMP_NUMB_MASK"s inserted.
+C
+C Alternatives:
+C
+C On P55 some MMX code could be 1.25 c/l (8 limb unrolled) if src and dst
+C are the same alignment mod 8, but it doesn't seem worth the trouble for
+C just that case (there'd need to be some plain integer available too for
+C the unaligned case).
+
+defframe(PARAM_SIZE,12)
+defframe(PARAM_SRC, 8)
+defframe(PARAM_DST, 4)
+
+ TEXT
+ ALIGN(8)
+PROLOGUE(mpn_com)
+deflit(`FRAME',0)
+
+ movl PARAM_SRC, %eax
+ movl PARAM_SIZE, %ecx
+
+ pushl %esi FRAME_pushl()
+ pushl %edi FRAME_pushl()
+
+ leal (%eax,%ecx,4), %eax
+ xorl $-1, %ecx C -size-1
+
+ movl PARAM_DST, %edx
+ addl $8, %ecx C -size+7
+
+ jns L(end)
+
+ movl (%edx), %esi C fetch destination cache line
+ nop
+
+L(top):
+ C eax &src[size]
+ C ebx
+ C ecx counter, limbs, negative
+ C edx dst, incrementing
+ C esi scratch
+ C edi scratch
+ C ebp
+
+ movl 28(%edx), %esi C destination prefetch
+ addl $32, %edx
+
+ movl -28(%eax,%ecx,4), %esi
+ movl -24(%eax,%ecx,4), %edi
+ xorl $GMP_NUMB_MASK, %esi
+ xorl $GMP_NUMB_MASK, %edi
+ movl %esi, -32(%edx)
+ movl %edi, -28(%edx)
+
+ movl -20(%eax,%ecx,4), %esi
+ movl -16(%eax,%ecx,4), %edi
+ xorl $GMP_NUMB_MASK, %esi
+ xorl $GMP_NUMB_MASK, %edi
+ movl %esi, -24(%edx)
+ movl %edi, -20(%edx)
+
+ movl -12(%eax,%ecx,4), %esi
+ movl -8(%eax,%ecx,4), %edi
+ xorl $GMP_NUMB_MASK, %esi
+ xorl $GMP_NUMB_MASK, %edi
+ movl %esi, -16(%edx)
+ movl %edi, -12(%edx)
+
+ movl -4(%eax,%ecx,4), %esi
+ movl (%eax,%ecx,4), %edi
+ xorl $GMP_NUMB_MASK, %esi
+ xorl $GMP_NUMB_MASK, %edi
+ movl %esi, -8(%edx)
+ movl %edi, -4(%edx)
+
+ addl $8, %ecx
+ js L(top)
+
+
+L(end):
+ C eax &src[size]
+ C ecx 0 to 7, representing respectively 7 to 0 limbs remaining
+ C edx dst, next location to store
+
+ subl $4, %ecx
+ nop
+
+ jns L(no4)
+
+ movl -12(%eax,%ecx,4), %esi
+ movl -8(%eax,%ecx,4), %edi
+ xorl $GMP_NUMB_MASK, %esi
+ xorl $GMP_NUMB_MASK, %edi
+ movl %esi, (%edx)
+ movl %edi, 4(%edx)
+
+ movl -4(%eax,%ecx,4), %esi
+ movl (%eax,%ecx,4), %edi
+ xorl $GMP_NUMB_MASK, %esi
+ xorl $GMP_NUMB_MASK, %edi
+ movl %esi, 8(%edx)
+ movl %edi, 12(%edx)
+
+ addl $16, %edx
+ addl $4, %ecx
+L(no4):
+
+ subl $2, %ecx
+ nop
+
+ jns L(no2)
+
+ movl -4(%eax,%ecx,4), %esi
+ movl (%eax,%ecx,4), %edi
+ xorl $GMP_NUMB_MASK, %esi
+ xorl $GMP_NUMB_MASK, %edi
+ movl %esi, (%edx)
+ movl %edi, 4(%edx)
+
+ addl $8, %edx
+ addl $2, %ecx
+L(no2):
+
+ popl %edi
+ jnz L(done)
+
+ movl -4(%eax), %ecx
+
+ xorl $GMP_NUMB_MASK, %ecx
+ popl %esi
+
+ movl %ecx, (%edx)
+ ret
+
+L(done):
+ popl %esi
+ ret
+
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium/copyd.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium/copyd.asm
new file mode 100644
index 00000000000..72a543b2a37
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium/copyd.asm
@@ -0,0 +1,146 @@
+dnl Intel Pentium mpn_copyd -- copy limb vector, decrementing.
+
+dnl Copyright 1996, 2001, 2002, 2006 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 P5: 1.25 cycles/limb
+
+
+C void mpn_copyd (mp_ptr dst, mp_srcptr src, mp_size_t size);
+C
+C See comments in copyi.asm.
+
+defframe(PARAM_SIZE,12)
+defframe(PARAM_SRC, 8)
+defframe(PARAM_DST, 4)
+
+ TEXT
+ ALIGN(8)
+PROLOGUE(mpn_copyd)
+deflit(`FRAME',0)
+
+ movl PARAM_SRC, %eax
+ movl PARAM_SIZE, %ecx
+
+ pushl %esi FRAME_pushl()
+ pushl %edi FRAME_pushl()
+
+ leal -4(%eax,%ecx,4), %eax C &src[size-1]
+ movl PARAM_DST, %edx
+
+ subl $7, %ecx C size-7
+ jle L(end)
+
+ movl 28-4(%edx,%ecx,4), %esi C prefetch cache, dst[size-1]
+ nop
+
+L(top):
+ C eax src, decrementing
+ C ebx
+ C ecx counter, limbs
+ C edx dst
+ C esi scratch
+ C edi scratch
+ C ebp
+
+ movl 28-32(%edx,%ecx,4), %esi C prefetch dst cache line
+ subl $8, %ecx
+
+ movl (%eax), %esi C read words pairwise
+ movl -4(%eax), %edi
+ movl %esi, 56(%edx,%ecx,4) C store words pairwise
+ movl %edi, 52(%edx,%ecx,4)
+
+ movl -8(%eax), %esi
+ movl -12(%eax), %edi
+ movl %esi, 48(%edx,%ecx,4)
+ movl %edi, 44(%edx,%ecx,4)
+
+ movl -16(%eax), %esi
+ movl -20(%eax), %edi
+ movl %esi, 40(%edx,%ecx,4)
+ movl %edi, 36(%edx,%ecx,4)
+
+ movl -24(%eax), %esi
+ movl -28(%eax), %edi
+ movl %esi, 32(%edx,%ecx,4)
+ movl %edi, 28(%edx,%ecx,4)
+
+ leal -32(%eax), %eax
+ jg L(top)
+
+
+L(end):
+ C ecx -7 to 0, representing respectively 0 to 7 limbs remaining
+ C eax src end
+ C edx dst, next location to store
+
+ addl $4, %ecx
+ jle L(no4)
+
+ movl (%eax), %esi
+ movl -4(%eax), %edi
+ movl %esi, 8(%edx,%ecx,4)
+ movl %edi, 4(%edx,%ecx,4)
+
+ movl -8(%eax), %esi
+ movl -12(%eax), %edi
+ movl %esi, (%edx,%ecx,4)
+ movl %edi, -4(%edx,%ecx,4)
+
+ subl $16, %eax
+ subl $4, %ecx
+L(no4):
+
+ addl $2, %ecx
+ jle L(no2)
+
+ movl (%eax), %esi
+ movl -4(%eax), %edi
+ movl %esi, (%edx,%ecx,4)
+ movl %edi, -4(%edx,%ecx,4)
+
+ subl $8, %eax
+ subl $2, %ecx
+L(no2):
+
+ jnz L(done)
+
+ movl (%eax), %ecx
+ movl %ecx, (%edx) C risk of cache bank clash here
+
+L(done):
+ popl %edi
+ popl %esi
+
+ ret
+
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium/copyi.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium/copyi.asm
new file mode 100644
index 00000000000..d983d6b46ec
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium/copyi.asm
@@ -0,0 +1,164 @@
+dnl Intel Pentium mpn_copyi -- copy limb vector, incrementing.
+
+dnl Copyright 1996, 2001, 2002, 2006 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 P5: 1.25 cycles/limb
+
+
+C void mpn_copyi (mp_ptr dst, mp_srcptr src, mp_size_t size);
+C
+C Destination prefetching is done to avoid repeated write-throughs on lines
+C not already in L1.
+C
+C At least one of the src or dst pointer needs to be incremented rather than
+C using indexing, so that there's somewhere to put the loop control without
+C an AGI. Incrementing one and not two lets us keep loop overhead to 2
+C cycles. Making it the src pointer incremented avoids an AGI on the %ecx
+C subtracts in the finishup code.
+C
+C The block of finishup code is almost as big as the main loop itself, which
+C is unfortunate, but it's faster that way than with say rep movsl, by about
+C 10 cycles for instance on P55.
+C
+C There's nothing to be gained from MMX on P55, since it can do only one
+C movq load (or store) per cycle, so the throughput would be the same as the
+C code here (and even then only if src and dst have the same alignment mod
+C 8).
+
+defframe(PARAM_SIZE,12)
+defframe(PARAM_SRC, 8)
+defframe(PARAM_DST, 4)
+
+ TEXT
+ ALIGN(8)
+PROLOGUE(mpn_copyi)
+deflit(`FRAME',0)
+
+ movl PARAM_SIZE, %ecx
+ movl PARAM_DST, %edx
+
+ pushl %ebx FRAME_pushl()
+ pushl %esi FRAME_pushl()
+
+ leal (%edx,%ecx,4), %edx C &dst[size-1]
+ xorl $-1, %ecx C -size-1
+
+ movl PARAM_SRC, %esi
+ addl $8, %ecx C -size+7
+
+ jns L(end)
+
+ movl -28(%edx,%ecx,4), %eax C fetch destination cache line, dst[0]
+ nop
+
+L(top):
+ C eax scratch
+ C ebx scratch
+ C ecx counter, limbs, negative
+ C edx &dst[size-1]
+ C esi src, incrementing
+ C edi
+ C ebp
+
+ movl (%edx,%ecx,4), %eax C fetch destination cache line
+ addl $8, %ecx
+
+ movl (%esi), %eax C read words pairwise
+ movl 4(%esi), %ebx
+ movl %eax, -60(%edx,%ecx,4) C store words pairwise
+ movl %ebx, -56(%edx,%ecx,4)
+
+ movl 8(%esi), %eax
+ movl 12(%esi), %ebx
+ movl %eax, -52(%edx,%ecx,4)
+ movl %ebx, -48(%edx,%ecx,4)
+
+ movl 16(%esi), %eax
+ movl 20(%esi), %ebx
+ movl %eax, -44(%edx,%ecx,4)
+ movl %ebx, -40(%edx,%ecx,4)
+
+ movl 24(%esi), %eax
+ movl 28(%esi), %ebx
+ movl %eax, -36(%edx,%ecx,4)
+ movl %ebx, -32(%edx,%ecx,4)
+
+ leal 32(%esi), %esi
+ js L(top)
+
+
+L(end):
+ C ecx 0 to 7, representing respectively 7 to 0 limbs remaining
+ C esi src end
+ C edx dst, next location to store
+
+ subl $4, %ecx
+ jns L(no4)
+
+ movl (%esi), %eax
+ movl 4(%esi), %ebx
+ movl %eax, -12(%edx,%ecx,4)
+ movl %ebx, -8(%edx,%ecx,4)
+
+ movl 8(%esi), %eax
+ movl 12(%esi), %ebx
+ movl %eax, -4(%edx,%ecx,4)
+ movl %ebx, (%edx,%ecx,4)
+
+ addl $16, %esi
+ addl $4, %ecx
+L(no4):
+
+ subl $2, %ecx
+ jns L(no2)
+
+ movl (%esi), %eax
+ movl 4(%esi), %ebx
+ movl %eax, -4(%edx,%ecx,4)
+ movl %ebx, (%edx,%ecx,4)
+
+ addl $8, %esi
+ addl $2, %ecx
+L(no2):
+
+ jnz L(done)
+
+ movl (%esi), %eax
+ movl %eax, -4(%edx,%ecx,4) C risk of cache bank clash here
+
+L(done):
+ popl %esi
+ popl %ebx
+
+ ret
+
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium/dive_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium/dive_1.asm
new file mode 100644
index 00000000000..f80632f4794
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium/dive_1.asm
@@ -0,0 +1,272 @@
+dnl Intel Pentium mpn_divexact_1 -- mpn by limb exact division.
+
+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/.
+
+include(`../config.m4')
+
+
+C divisor
+C odd even
+C P54: 24.5 30.5 cycles/limb
+C P55: 23.0 28.0
+
+
+C void mpn_divexact_1 (mp_ptr dst, mp_srcptr src, mp_size_t size,
+C mp_limb_t divisor);
+C
+C Plain divl is used for small sizes, since the inverse takes a while to
+C setup. Multiplying works out faster for size>=3 when the divisor is odd,
+C or size>=4 when the divisor is even. Actually on P55 size==2 for odd or
+C size==3 for even are about the same speed for both divl or mul, but the
+C former is used since it will use up less code cache.
+C
+C The P55 speeds noted above, 23 cycles odd or 28 cycles even, are as
+C expected. On P54 in the even case the shrdl pairing nonsense (see
+C mpn/x86/pentium/README) costs 1 cycle, but it's not clear why there's a
+C further 1.5 slowdown for both odd and even.
+
+defframe(PARAM_DIVISOR,16)
+defframe(PARAM_SIZE, 12)
+defframe(PARAM_SRC, 8)
+defframe(PARAM_DST, 4)
+
+dnl re-use parameter space
+define(VAR_INVERSE,`PARAM_DST')
+
+ TEXT
+
+ ALIGN(32)
+PROLOGUE(mpn_divexact_1)
+deflit(`FRAME',0)
+
+ movl PARAM_DIVISOR, %eax
+ movl PARAM_SIZE, %ecx
+
+ pushl %esi FRAME_pushl()
+ push %edi FRAME_pushl()
+
+ movl PARAM_SRC, %esi
+ andl $1, %eax
+
+ movl PARAM_DST, %edi
+ addl %ecx, %eax C size if even, size+1 if odd
+
+ cmpl $4, %eax
+ jae L(mul_by_inverse)
+
+
+ xorl %edx, %edx
+L(div_top):
+ movl -4(%esi,%ecx,4), %eax
+
+ divl PARAM_DIVISOR
+
+ movl %eax, -4(%edi,%ecx,4)
+ decl %ecx
+
+ jnz L(div_top)
+
+ popl %edi
+ popl %esi
+
+ ret
+
+
+
+L(mul_by_inverse):
+ movl PARAM_DIVISOR, %eax
+ movl $-1, %ecx
+
+L(strip_twos):
+ ASSERT(nz, `orl %eax, %eax')
+ shrl %eax
+ incl %ecx C shift count
+
+ jnc L(strip_twos)
+
+ leal 1(%eax,%eax), %edx C d
+ andl $127, %eax C d/2, 7 bits
+
+ pushl %ebx FRAME_pushl()
+ pushl %ebp FRAME_pushl()
+
+ifdef(`PIC',`
+ call L(here)
+L(here):
+ popl %ebp C eip
+
+ addl $_GLOBAL_OFFSET_TABLE_+[.-L(here)], %ebp
+ C AGI
+ movl binvert_limb_table@GOT(%ebp), %ebp
+ C AGI
+ movzbl (%eax,%ebp), %eax
+',`
+
+dnl non-PIC
+ movzbl binvert_limb_table(%eax), %eax C inv 8 bits
+')
+
+ movl %eax, %ebp C inv
+ addl %eax, %eax C 2*inv
+
+ imull %ebp, %ebp C inv*inv
+
+ imull %edx, %ebp C inv*inv*d
+
+ subl %ebp, %eax C inv = 2*inv - inv*inv*d
+ movl PARAM_SIZE, %ebx
+
+ movl %eax, %ebp
+ addl %eax, %eax C 2*inv
+
+ imull %ebp, %ebp C inv*inv
+
+ imull %edx, %ebp C inv*inv*d
+
+ subl %ebp, %eax C inv = 2*inv - inv*inv*d
+ movl %edx, PARAM_DIVISOR C d without twos
+
+ leal (%esi,%ebx,4), %esi C src end
+ leal (%edi,%ebx,4), %edi C dst end
+
+ negl %ebx C -size
+
+ ASSERT(e,` C expect d*inv == 1 mod 2^GMP_LIMB_BITS
+ pushl %eax FRAME_pushl()
+ imull PARAM_DIVISOR, %eax
+ cmpl $1, %eax
+ popl %eax FRAME_popl()')
+
+ movl %eax, VAR_INVERSE
+ xorl %ebp, %ebp C initial carry bit
+
+ movl (%esi,%ebx,4), %eax C src low limb
+ orl %ecx, %ecx C shift
+
+ movl 4(%esi,%ebx,4), %edx C src second limb (for even)
+ jz L(odd_entry)
+
+ shrdl( %cl, %edx, %eax)
+
+ incl %ebx
+ jmp L(even_entry)
+
+
+ ALIGN(8)
+L(odd_top):
+ C eax scratch
+ C ebx counter, limbs, negative
+ C ecx
+ C edx
+ C esi src end
+ C edi dst end
+ C ebp carry bit, 0 or -1
+
+ mull PARAM_DIVISOR
+
+ movl (%esi,%ebx,4), %eax
+ subl %ebp, %edx
+
+ subl %edx, %eax
+
+ sbbl %ebp, %ebp
+
+L(odd_entry):
+ imull VAR_INVERSE, %eax
+
+ movl %eax, (%edi,%ebx,4)
+
+ incl %ebx
+ jnz L(odd_top)
+
+
+ popl %ebp
+ popl %ebx
+
+ popl %edi
+ popl %esi
+
+ ret
+
+
+L(even_top):
+ C eax scratch
+ C ebx counter, limbs, negative
+ C ecx twos
+ C edx
+ C esi src end
+ C edi dst end
+ C ebp carry bit, 0 or -1
+
+ mull PARAM_DIVISOR
+
+ subl %ebp, %edx C carry bit
+ movl -4(%esi,%ebx,4), %eax C src limb
+
+ movl (%esi,%ebx,4), %ebp C and one above it
+
+ shrdl( %cl, %ebp, %eax)
+
+ subl %edx, %eax C carry limb
+
+ sbbl %ebp, %ebp
+
+L(even_entry):
+ imull VAR_INVERSE, %eax
+
+ movl %eax, -4(%edi,%ebx,4)
+ incl %ebx
+
+ jnz L(even_top)
+
+
+
+ mull PARAM_DIVISOR
+
+ movl -4(%esi), %eax C src high limb
+ subl %ebp, %edx
+
+ shrl %cl, %eax
+
+ subl %edx, %eax C no carry if division is exact
+
+ imull VAR_INVERSE, %eax
+
+ movl %eax, -4(%edi) C dst high limb
+ nop C protect against cache bank clash
+
+ popl %ebp
+ popl %ebx
+
+ popl %edi
+ popl %esi
+
+ ret
+
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium/gmp-mparam.h b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium/gmp-mparam.h
new file mode 100644
index 00000000000..befa6e27a95
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium/gmp-mparam.h
@@ -0,0 +1,76 @@
+/* Intel P54 gmp-mparam.h -- Compiler/machine parameter header file.
+
+Copyright 1991, 1993, 1994, 1999-2002, 2004 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
+
+
+/* For mpn/x86/pentium/mod_1.asm */
+#define COUNT_LEADING_ZEROS_NEED_CLZ_TAB
+
+
+/* 166MHz P54 */
+
+/* Generated by tuneup.c, 2004-02-10, gcc 2.95 */
+
+#define MUL_TOOM22_THRESHOLD 16
+#define MUL_TOOM33_THRESHOLD 90
+
+#define SQR_BASECASE_THRESHOLD 0 /* always */
+#define SQR_TOOM2_THRESHOLD 22
+#define SQR_TOOM3_THRESHOLD 122
+
+#define DIV_SB_PREINV_THRESHOLD MP_SIZE_T_MAX /* never */
+#define DIV_DC_THRESHOLD 52
+#define POWM_THRESHOLD 77
+
+#define HGCD_THRESHOLD 121
+#define GCD_ACCEL_THRESHOLD 3
+#define GCD_DC_THRESHOLD 615
+#define JACOBI_BASE_METHOD 2
+
+#define USE_PREINV_DIVREM_1 0
+#define USE_PREINV_MOD_1 1 /* native */
+#define DIVREM_2_THRESHOLD MP_SIZE_T_MAX /* never */
+#define DIVEXACT_1_THRESHOLD 0 /* always (native) */
+#define MODEXACT_1_ODD_THRESHOLD 0 /* always (native) */
+
+#define GET_STR_DC_THRESHOLD 23
+#define GET_STR_PRECOMPUTE_THRESHOLD 33
+#define SET_STR_THRESHOLD 2788
+
+#define MUL_FFT_TABLE { 432, 928, 1664, 3584, 10240, 40960, 0 }
+#define MUL_FFT_MODF_THRESHOLD 448
+#define MUL_FFT_THRESHOLD 3328
+
+#define SQR_FFT_TABLE { 496, 928, 1920, 4608, 10240, 40960, 0 }
+#define SQR_FFT_MODF_THRESHOLD 512
+#define SQR_FFT_THRESHOLD 3328
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium/hamdist.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium/hamdist.asm
new file mode 100644
index 00000000000..2d7bc99b126
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium/hamdist.asm
@@ -0,0 +1,143 @@
+dnl Intel P5 mpn_hamdist -- mpn hamming distance.
+
+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/.
+
+include(`../config.m4')
+
+
+C P5: 14.0 cycles/limb
+
+
+C unsigned long mpn_hamdist (mp_srcptr src1, mp_srcptr src2, mp_size_t size);
+C
+C It might be possible to shave 1 cycle from the loop, and hence 2
+C cycles/limb. The xorb is taking 2 cycles, but a separate load and xor
+C would be 1, if the right schedule could be found (not found so far).
+C Wanting to avoid potential cache bank clashes makes it tricky.
+
+C The slightly strange quoting here helps the renaming done by tune/many.pl.
+deflit(TABLE_NAME,
+m4_assert_defined(`GSYM_PREFIX')
+GSYM_PREFIX`'mpn_popcount``'_table')
+
+defframe(PARAM_SIZE,12)
+defframe(PARAM_SRC2, 8)
+defframe(PARAM_SRC1, 4)
+
+ TEXT
+ ALIGN(8)
+
+PROLOGUE(mpn_hamdist)
+deflit(`FRAME',0)
+
+ movl PARAM_SIZE, %ecx
+ pushl %esi FRAME_pushl()
+
+ shll %ecx C size in byte pairs
+ pushl %edi FRAME_pushl()
+
+ifdef(`PIC',`
+ pushl %ebx FRAME_pushl()
+ pushl %ebp FRAME_pushl()
+
+ call L(here) FRAME_pushl()
+L(here):
+ movl PARAM_SRC1, %esi
+ popl %ebp FRAME_popl()
+
+ movl PARAM_SRC2, %edi
+ addl $_GLOBAL_OFFSET_TABLE_+[.-L(here)], %ebp
+
+ xorl %ebx, %ebx C byte
+ xorl %edx, %edx C byte
+
+ movl TABLE_NAME@GOT(%ebp), %ebp
+ xorl %eax, %eax C total
+define(TABLE,`(%ebp,$1)')
+
+',`
+dnl non-PIC
+ movl PARAM_SRC1, %esi
+ movl PARAM_SRC2, %edi
+
+ xorl %eax, %eax C total
+ pushl %ebx FRAME_pushl()
+
+ xorl %edx, %edx C byte
+ xorl %ebx, %ebx C byte
+
+define(TABLE,`TABLE_NAME($1)')
+')
+
+
+ C The nop after the xorb seems necessary. Although a movb might be
+ C expected to go down the V pipe in the second cycle of the xorb, it
+ C doesn't and costs an extra 2 cycles.
+L(top):
+ C eax total
+ C ebx byte
+ C ecx counter, 2*size to 2
+ C edx byte
+ C esi src1
+ C edi src2
+ C ebp [PIC] table
+
+ addl %ebx, %eax
+ movb -1(%esi,%ecx,2), %bl
+
+ addl %edx, %eax
+ movb -1(%edi,%ecx,2), %dl
+
+ xorb %dl, %bl
+ movb -2(%esi,%ecx,2), %dl
+
+ xorb -2(%edi,%ecx,2), %dl
+ nop
+
+ movb TABLE(%ebx), %bl
+ decl %ecx
+
+ movb TABLE(%edx), %dl
+ jnz L(top)
+
+
+ifdef(`PIC',`
+ popl %ebp
+')
+ addl %ebx, %eax
+ popl %ebx
+
+ addl %edx, %eax
+ popl %edi
+
+ popl %esi
+
+ ret
+
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium/logops_n.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium/logops_n.asm
new file mode 100644
index 00000000000..18773172e98
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium/logops_n.asm
@@ -0,0 +1,176 @@
+dnl Intel Pentium mpn_and_n,...,mpn_xnor_n -- bitwise logical operations.
+
+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/.
+
+include(`../config.m4')
+
+
+C P5: 3.0 c/l and, ior, xor
+C 3.5 c/l andn, iorn, nand, nior, xnor
+
+
+define(M4_choose_op,
+`ifdef(`OPERATION_$1',`
+define(`M4_function', `mpn_$1')
+define(`M4_want_pre', `$4')
+define(`M4op', `$3')
+define(`M4_want_post',`$2')
+')')
+define(M4pre, `ifelse(M4_want_pre, yes,`$1')')
+define(M4post,`ifelse(M4_want_post,yes,`$1')')
+
+M4_choose_op( and_n, , andl, )
+M4_choose_op( andn_n, , andl, yes)
+M4_choose_op( nand_n, yes, andl, )
+M4_choose_op( ior_n, , orl, )
+M4_choose_op( iorn_n, , orl, yes)
+M4_choose_op( nior_n, yes, orl, )
+M4_choose_op( xor_n, , xorl, )
+M4_choose_op( xnor_n, yes, xorl, )
+
+ifdef(`M4_function',,
+`m4_error(`Unrecognised or undefined OPERATION symbol
+')')
+
+MULFUNC_PROLOGUE(mpn_and_n mpn_andn_n mpn_nand_n mpn_ior_n mpn_iorn_n mpn_nior_n mpn_xor_n mpn_xnor_n)
+
+NAILS_SUPPORT(0-31)
+
+
+C void M4_function (mp_ptr wp, mp_srcptr xp, mp_srcptr yp, mp_size_t size);
+C
+C Nothing complicated here, just some care to avoid data cache bank clashes
+C and AGIs.
+C
+C We're one register short of being able to do a simple 4 loads, 2 ops, 2
+C stores. Instead %ebp is juggled a bit and nops are introduced to keep the
+C pairings as intended. An in-place operation would free up a register, for
+C an 0.5 c/l speedup, if that's worth bothering with.
+C
+C This code seems best for P55 too. Data alignment is a big problem for MMX
+C and the pairing restrictions on movq and integer instructions make life
+C difficult.
+
+defframe(PARAM_SIZE,16)
+defframe(PARAM_YP, 12)
+defframe(PARAM_XP, 8)
+defframe(PARAM_WP, 4)
+
+ TEXT
+ ALIGN(8)
+
+PROLOGUE(M4_function)
+deflit(`FRAME',0)
+
+ pushl %ebx FRAME_pushl()
+ pushl %esi FRAME_pushl()
+
+ pushl %edi FRAME_pushl()
+ pushl %ebp FRAME_pushl()
+
+ movl PARAM_SIZE, %ecx
+ movl PARAM_XP, %ebx
+
+ movl PARAM_YP, %esi
+ movl PARAM_WP, %edi
+
+ shrl %ecx
+ jnc L(entry)
+
+ movl (%ebx,%ecx,8), %eax C risk of data cache bank clash here
+ movl (%esi,%ecx,8), %edx
+
+M4pre(` notl_or_xorl_GMP_NUMB_MASK(%edx)')
+
+ M4op %edx, %eax
+
+M4post(`xorl $GMP_NUMB_MASK, %eax')
+ orl %ecx, %ecx
+
+ movl %eax, (%edi,%ecx,8)
+ jz L(done)
+
+ jmp L(entry)
+
+
+L(top):
+ C eax
+ C ebx xp
+ C ecx counter, limb pairs, decrementing
+ C edx
+ C esi yp
+ C edi wp
+ C ebp
+
+ M4op %ebp, %edx
+ nop
+
+M4post(`xorl $GMP_NUMB_MASK, %eax')
+M4post(`xorl $GMP_NUMB_MASK, %edx')
+
+ movl %eax, 4(%edi,%ecx,8)
+ movl %edx, (%edi,%ecx,8)
+
+L(entry):
+ movl -4(%ebx,%ecx,8), %ebp
+ nop
+
+ movl -4(%esi,%ecx,8), %eax
+ movl -8(%esi,%ecx,8), %edx
+
+M4pre(` xorl $GMP_NUMB_MASK, %eax')
+M4pre(` xorl $GMP_NUMB_MASK, %edx')
+
+ M4op %ebp, %eax
+ movl -8(%ebx,%ecx,8), %ebp
+
+ decl %ecx
+ jnz L(top)
+
+
+ M4op %ebp, %edx
+ nop
+
+M4post(`xorl $GMP_NUMB_MASK, %eax')
+M4post(`xorl $GMP_NUMB_MASK, %edx')
+
+ movl %eax, 4(%edi,%ecx,8)
+ movl %edx, (%edi,%ecx,8)
+
+
+L(done):
+ popl %ebp
+ popl %edi
+
+ popl %esi
+ popl %ebx
+
+ ret
+
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium/lshift.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium/lshift.asm
new file mode 100644
index 00000000000..2a31f36c6ed
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium/lshift.asm
@@ -0,0 +1,243 @@
+dnl Intel Pentium mpn_lshift -- mpn left shift.
+
+dnl Copyright 1992, 1994-1996, 1999, 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 cycles/limb
+C P5,P54: 6.0
+C P55: 5.375
+
+
+C mp_limb_t mpn_lshift (mp_ptr dst, mp_srcptr src, mp_size_t size,
+C unsigned shift);
+C
+C The main shift-by-N loop should run at 5.375 c/l and that's what P55 does,
+C but P5 and P54 run only at 6.0 c/l, which is 4 cycles lost somewhere.
+
+defframe(PARAM_SHIFT,16)
+defframe(PARAM_SIZE, 12)
+defframe(PARAM_SRC, 8)
+defframe(PARAM_DST, 4)
+
+ TEXT
+ ALIGN(8)
+PROLOGUE(mpn_lshift)
+
+ pushl %edi
+ pushl %esi
+ pushl %ebx
+ pushl %ebp
+deflit(`FRAME',16)
+
+ movl PARAM_DST,%edi
+ movl PARAM_SRC,%esi
+ movl PARAM_SIZE,%ebp
+ movl PARAM_SHIFT,%ecx
+
+C We can use faster code for shift-by-1 under certain conditions.
+ cmp $1,%ecx
+ jne L(normal)
+ leal 4(%esi),%eax
+ cmpl %edi,%eax
+ jnc L(special) C jump if s_ptr + 1 >= res_ptr
+ leal (%esi,%ebp,4),%eax
+ cmpl %eax,%edi
+ jnc L(special) C jump if res_ptr >= s_ptr + size
+
+L(normal):
+ leal -4(%edi,%ebp,4),%edi
+ leal -4(%esi,%ebp,4),%esi
+
+ movl (%esi),%edx
+ subl $4,%esi
+ xorl %eax,%eax
+ shldl( %cl, %edx, %eax) C compute carry limb
+ pushl %eax C push carry limb onto stack
+
+ decl %ebp
+ pushl %ebp
+ shrl $3,%ebp
+ jz L(end)
+
+ movl (%edi),%eax C fetch destination cache line
+
+ ALIGN(4)
+L(oop): movl -28(%edi),%eax C fetch destination cache line
+ movl %edx,%ebx
+
+ movl (%esi),%eax
+ movl -4(%esi),%edx
+ shldl( %cl, %eax, %ebx)
+ shldl( %cl, %edx, %eax)
+ movl %ebx,(%edi)
+ movl %eax,-4(%edi)
+
+ movl -8(%esi),%ebx
+ movl -12(%esi),%eax
+ shldl( %cl, %ebx, %edx)
+ shldl( %cl, %eax, %ebx)
+ movl %edx,-8(%edi)
+ movl %ebx,-12(%edi)
+
+ movl -16(%esi),%edx
+ movl -20(%esi),%ebx
+ shldl( %cl, %edx, %eax)
+ shldl( %cl, %ebx, %edx)
+ movl %eax,-16(%edi)
+ movl %edx,-20(%edi)
+
+ movl -24(%esi),%eax
+ movl -28(%esi),%edx
+ shldl( %cl, %eax, %ebx)
+ shldl( %cl, %edx, %eax)
+ movl %ebx,-24(%edi)
+ movl %eax,-28(%edi)
+
+ subl $32,%esi
+ subl $32,%edi
+ decl %ebp
+ jnz L(oop)
+
+L(end): popl %ebp
+ andl $7,%ebp
+ jz L(end2)
+L(oop2):
+ movl (%esi),%eax
+ shldl( %cl,%eax,%edx)
+ movl %edx,(%edi)
+ movl %eax,%edx
+ subl $4,%esi
+ subl $4,%edi
+ decl %ebp
+ jnz L(oop2)
+
+L(end2):
+ shll %cl,%edx C compute least significant limb
+ movl %edx,(%edi) C store it
+
+ popl %eax C pop carry limb
+
+ popl %ebp
+ popl %ebx
+ popl %esi
+ popl %edi
+ ret
+
+
+C We loop from least significant end of the arrays, which is only
+C permissable if the source and destination don't overlap, since the
+C function is documented to work for overlapping source and destination.
+
+L(special):
+ movl (%esi),%edx
+ addl $4,%esi
+
+ decl %ebp
+ pushl %ebp
+ shrl $3,%ebp
+
+ addl %edx,%edx
+ incl %ebp
+ decl %ebp
+ jz L(Lend)
+
+ movl (%edi),%eax C fetch destination cache line
+
+ ALIGN(4)
+L(Loop):
+ movl 28(%edi),%eax C fetch destination cache line
+ movl %edx,%ebx
+
+ movl (%esi),%eax
+ movl 4(%esi),%edx
+ adcl %eax,%eax
+ movl %ebx,(%edi)
+ adcl %edx,%edx
+ movl %eax,4(%edi)
+
+ movl 8(%esi),%ebx
+ movl 12(%esi),%eax
+ adcl %ebx,%ebx
+ movl %edx,8(%edi)
+ adcl %eax,%eax
+ movl %ebx,12(%edi)
+
+ movl 16(%esi),%edx
+ movl 20(%esi),%ebx
+ adcl %edx,%edx
+ movl %eax,16(%edi)
+ adcl %ebx,%ebx
+ movl %edx,20(%edi)
+
+ movl 24(%esi),%eax
+ movl 28(%esi),%edx
+ adcl %eax,%eax
+ movl %ebx,24(%edi)
+ adcl %edx,%edx
+ movl %eax,28(%edi)
+
+ leal 32(%esi),%esi C use leal not to clobber carry
+ leal 32(%edi),%edi
+ decl %ebp
+ jnz L(Loop)
+
+L(Lend):
+ popl %ebp
+ sbbl %eax,%eax C save carry in %eax
+ andl $7,%ebp
+ jz L(Lend2)
+ addl %eax,%eax C restore carry from eax
+L(Loop2):
+ movl %edx,%ebx
+ movl (%esi),%edx
+ adcl %edx,%edx
+ movl %ebx,(%edi)
+
+ leal 4(%esi),%esi C use leal not to clobber carry
+ leal 4(%edi),%edi
+ decl %ebp
+ jnz L(Loop2)
+
+ jmp L(L1)
+L(Lend2):
+ addl %eax,%eax C restore carry from eax
+L(L1): movl %edx,(%edi) C store last limb
+
+ sbbl %eax,%eax
+ negl %eax
+
+ popl %ebp
+ popl %ebx
+ popl %esi
+ popl %edi
+ ret
+
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium/mmx/gmp-mparam.h b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium/mmx/gmp-mparam.h
new file mode 100644
index 00000000000..02a0def127b
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium/mmx/gmp-mparam.h
@@ -0,0 +1,163 @@
+/* Intel P55 gmp-mparam.h -- Compiler/machine parameter header file.
+
+Copyright 1991, 1993, 1994, 1999-2002, 2004, 2009, 2010 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
+
+
+/* For mpn/x86/pentium/mod_1.asm */
+#define COUNT_LEADING_ZEROS_NEED_CLZ_TAB
+
+
+/* 233MHz P55 */
+
+#define MOD_1_NORM_THRESHOLD 5
+#define MOD_1_UNNORM_THRESHOLD MP_SIZE_T_MAX /* never */
+#define MOD_1N_TO_MOD_1_1_THRESHOLD MP_SIZE_T_MAX /* never */
+#define MOD_1U_TO_MOD_1_1_THRESHOLD 12
+#define MOD_1_1_TO_MOD_1_2_THRESHOLD 0
+#define MOD_1_2_TO_MOD_1_4_THRESHOLD 11
+#define PREINV_MOD_1_TO_MOD_1_THRESHOLD 63
+#define USE_PREINV_DIVREM_1 0
+#define DIVEXACT_1_THRESHOLD 0 /* always (native) */
+#define BMOD_1_TO_MOD_1_THRESHOLD 51
+
+#define MUL_TOOM22_THRESHOLD 16
+#define MUL_TOOM33_THRESHOLD 53
+#define MUL_TOOM44_THRESHOLD 128
+#define MUL_TOOM6H_THRESHOLD 189
+#define MUL_TOOM8H_THRESHOLD 260
+
+#define MUL_TOOM32_TO_TOOM43_THRESHOLD 89
+#define MUL_TOOM32_TO_TOOM53_THRESHOLD 91
+#define MUL_TOOM42_TO_TOOM53_THRESHOLD 90
+#define MUL_TOOM42_TO_TOOM63_THRESHOLD 88
+
+#define SQR_BASECASE_THRESHOLD 0 /* always (native) */
+#define SQR_TOOM2_THRESHOLD 20
+#define SQR_TOOM3_THRESHOLD 73
+#define SQR_TOOM4_THRESHOLD 178
+#define SQR_TOOM6_THRESHOLD 210
+#define SQR_TOOM8_THRESHOLD 375
+
+#define MULMOD_BNM1_THRESHOLD 11
+#define SQRMOD_BNM1_THRESHOLD 12
+
+#define MUL_FFT_MODF_THRESHOLD 364 /* k = 5 */
+#define MUL_FFT_TABLE3 \
+ { { 364, 5}, { 15, 6}, { 8, 5}, { 17, 6}, \
+ { 9, 5}, { 19, 6}, { 17, 7}, { 9, 6}, \
+ { 21, 7}, { 11, 6}, { 23, 7}, { 15, 6}, \
+ { 31, 7}, { 21, 8}, { 11, 7}, { 27, 8}, \
+ { 15, 7}, { 33, 8}, { 19, 7}, { 39, 8}, \
+ { 23, 7}, { 47, 8}, { 27, 9}, { 15, 8}, \
+ { 31, 7}, { 63, 8}, { 39, 9}, { 23, 8}, \
+ { 47,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, 8}, { 319, 9}, { 167,10}, \
+ { 95, 9}, { 191, 8}, { 383,11}, { 63,10}, \
+ { 127, 9}, { 255,10}, { 143, 9}, { 287,10}, \
+ { 159, 9}, { 319,11}, { 95,10}, { 191, 9}, \
+ { 383,12}, { 63,11}, { 127,10}, { 271, 9}, \
+ { 543,10}, { 287,11}, { 159,10}, { 351,11}, \
+ { 191,10}, { 415,11}, { 223,12}, { 127,11}, \
+ { 255,10}, { 511,11}, { 287,10}, { 575,11}, \
+ { 351,12}, { 191,11}, { 415,13}, { 127,12}, \
+ { 255,11}, { 575,12}, { 319,11}, { 703,12}, \
+ { 383,11}, { 831,12}, { 447,13}, { 8192,14}, \
+ { 16384,15}, { 32768,16} }
+#define MUL_FFT_TABLE3_SIZE 90
+#define MUL_FFT_THRESHOLD 3520
+
+#define SQR_FFT_MODF_THRESHOLD 340 /* k = 5 */
+#define SQR_FFT_TABLE3 \
+ { { 340, 5}, { 17, 6}, { 9, 5}, { 19, 6}, \
+ { 17, 7}, { 9, 6}, { 21, 7}, { 11, 6}, \
+ { 23, 7}, { 15, 6}, { 31, 7}, { 21, 8}, \
+ { 11, 7}, { 29, 8}, { 15, 7}, { 33, 8}, \
+ { 19, 7}, { 39, 8}, { 27, 7}, { 55, 9}, \
+ { 15, 8}, { 31, 7}, { 65, 8}, { 43, 9}, \
+ { 23, 8}, { 47,10}, { 15, 9}, { 31, 8}, \
+ { 67, 9}, { 39, 8}, { 83, 9}, { 47, 8}, \
+ { 95,10}, { 31, 9}, { 63, 8}, { 127, 9}, \
+ { 79,10}, { 47, 9}, { 95,11}, { 31,10}, \
+ { 63, 9}, { 127, 8}, { 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,10}, { 207,12}, \
+ { 63,11}, { 127,10}, { 271, 9}, { 543,10}, \
+ { 287, 9}, { 575,10}, { 303,11}, { 159,10}, \
+ { 351,11}, { 191,10}, { 415,11}, { 223,10}, \
+ { 447,12}, { 127,11}, { 255,10}, { 543,11}, \
+ { 287,10}, { 607,11}, { 351,12}, { 191,11}, \
+ { 479,13}, { 127,12}, { 255,11}, { 575,12}, \
+ { 319,11}, { 703,12}, { 383,11}, { 767,12}, \
+ { 447,13}, { 8192,14}, { 16384,15}, { 32768,16} }
+#define SQR_FFT_TABLE3_SIZE 96
+#define SQR_FFT_THRESHOLD 5504
+
+#define MULLO_BASECASE_THRESHOLD 0 /* always */
+#define MULLO_DC_THRESHOLD 48
+#define MULLO_MUL_N_THRESHOLD 6633
+
+#define DC_DIV_QR_THRESHOLD 43
+#define DC_DIVAPPR_Q_THRESHOLD 170
+#define DC_BDIV_QR_THRESHOLD 43
+#define DC_BDIV_Q_THRESHOLD 110
+
+#define INV_MULMOD_BNM1_THRESHOLD 30
+#define INV_NEWTON_THRESHOLD 177
+#define INV_APPR_THRESHOLD 171
+
+#define BINV_NEWTON_THRESHOLD 194
+#define REDC_1_TO_REDC_N_THRESHOLD 50
+
+#define MU_DIV_QR_THRESHOLD 1142
+#define MU_DIVAPPR_Q_THRESHOLD 1142
+#define MUPI_DIV_QR_THRESHOLD 90
+#define MU_BDIV_QR_THRESHOLD 942
+#define MU_BDIV_Q_THRESHOLD 1017
+
+#define MATRIX22_STRASSEN_THRESHOLD 13
+#define HGCD_THRESHOLD 92
+#define GCD_DC_THRESHOLD 283
+#define GCDEXT_DC_THRESHOLD 221
+#define JACOBI_BASE_METHOD 2
+
+#define GET_STR_DC_THRESHOLD 18
+#define GET_STR_PRECOMPUTE_THRESHOLD 31
+#define SET_STR_DC_THRESHOLD 490
+#define SET_STR_PRECOMPUTE_THRESHOLD 994
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium/mmx/hamdist.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium/mmx/hamdist.asm
new file mode 100644
index 00000000000..72e31966976
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium/mmx/hamdist.asm
@@ -0,0 +1,40 @@
+dnl Intel P55 mpn_hamdist -- mpn hamming distance.
+
+dnl Copyright 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 P55: hamdist 12.0 cycles/limb
+
+C For reference, this code runs at 11.5 cycles/limb for popcount, which is
+C slower than the plain integer mpn/x86/pentium/popcount.asm.
+
+MULFUNC_PROLOGUE(mpn_hamdist)
+include_mpn(`x86/k6/mmx/popham.asm')
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium/mmx/lshift.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium/mmx/lshift.asm
new file mode 100644
index 00000000000..04b0ddcc8f0
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium/mmx/lshift.asm
@@ -0,0 +1,463 @@
+dnl Intel P5 mpn_lshift -- mpn left shift.
+
+dnl Copyright 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 P5: 1.75 cycles/limb.
+
+
+C mp_limb_t mpn_lshift (mp_ptr dst, mp_srcptr src, mp_size_t size,
+C unsigned shift);
+C
+C Shift src,size left by shift many bits and store the result in dst,size.
+C Zeros are shifted in at the right. Return the bits shifted out at the
+C left.
+C
+C The comments in mpn_rshift apply here too.
+
+defframe(PARAM_SHIFT,16)
+defframe(PARAM_SIZE, 12)
+defframe(PARAM_SRC, 8)
+defframe(PARAM_DST, 4)
+deflit(`FRAME',0)
+
+dnl minimum 5, because the unrolled loop can't handle less
+deflit(UNROLL_THRESHOLD, 5)
+
+ TEXT
+ ALIGN(8)
+
+PROLOGUE(mpn_lshift)
+
+ pushl %ebx
+ pushl %edi
+deflit(`FRAME',8)
+
+ movl PARAM_SIZE, %eax
+ movl PARAM_DST, %edx
+
+ movl PARAM_SRC, %ebx
+ movl PARAM_SHIFT, %ecx
+
+ cmp $UNROLL_THRESHOLD, %eax
+ jae L(unroll)
+
+ movl -4(%ebx,%eax,4), %edi C src high limb
+ decl %eax
+
+ jnz L(simple)
+
+ shldl( %cl, %edi, %eax) C eax was decremented to zero
+
+ shll %cl, %edi
+
+ movl %edi, (%edx) C dst low limb
+ popl %edi C risk of data cache bank clash
+
+ popl %ebx
+
+ ret
+
+
+C -----------------------------------------------------------------------------
+L(simple):
+ C eax size-1
+ C ebx src
+ C ecx shift
+ C edx dst
+ C esi
+ C edi
+ C ebp
+deflit(`FRAME',8)
+
+ movd (%ebx,%eax,4), %mm5 C src high limb
+
+ movd %ecx, %mm6 C lshift
+ negl %ecx
+
+ psllq %mm6, %mm5
+ addl $32, %ecx
+
+ movd %ecx, %mm7
+ psrlq $32, %mm5 C retval
+
+
+L(simple_top):
+ C eax counter, limbs, negative
+ C ebx src
+ C ecx
+ C edx dst
+ C esi
+ C edi
+ C
+ C mm0 scratch
+ C mm5 return value
+ C mm6 shift
+ C mm7 32-shift
+
+ movq -4(%ebx,%eax,4), %mm0
+ decl %eax
+
+ psrlq %mm7, %mm0
+
+ C
+
+ movd %mm0, 4(%edx,%eax,4)
+ jnz L(simple_top)
+
+
+ movd (%ebx), %mm0
+
+ movd %mm5, %eax
+ psllq %mm6, %mm0
+
+ popl %edi
+ popl %ebx
+
+ movd %mm0, (%edx)
+
+ emms
+
+ ret
+
+
+C -----------------------------------------------------------------------------
+ ALIGN(8)
+L(unroll):
+ C eax size
+ C ebx src
+ C ecx shift
+ C edx dst
+ C esi
+ C edi
+ C ebp
+deflit(`FRAME',8)
+
+ movd -4(%ebx,%eax,4), %mm5 C src high limb
+ leal (%ebx,%eax,4), %edi
+
+ movd %ecx, %mm6 C lshift
+ andl $4, %edi
+
+ psllq %mm6, %mm5
+ jz L(start_src_aligned)
+
+
+ C src isn't aligned, process high limb separately (marked xxx) to
+ C make it so.
+ C
+ C source -8(ebx,%eax,4)
+ C |
+ C +-------+-------+-------+--
+ C | |
+ C +-------+-------+-------+--
+ C 0mod8 4mod8 0mod8
+ C
+ C dest
+ C -4(edx,%eax,4)
+ C |
+ C +-------+-------+--
+ C | xxx | |
+ C +-------+-------+--
+
+ movq -8(%ebx,%eax,4), %mm0 C unaligned load
+
+ psllq %mm6, %mm0
+ decl %eax
+
+ psrlq $32, %mm0
+
+ C
+
+ movd %mm0, (%edx,%eax,4)
+L(start_src_aligned):
+
+ movq -8(%ebx,%eax,4), %mm1 C src high qword
+ leal (%edx,%eax,4), %edi
+
+ andl $4, %edi
+ psrlq $32, %mm5 C return value
+
+ movq -16(%ebx,%eax,4), %mm3 C src second highest qword
+ jz L(start_dst_aligned)
+
+ C dst isn't aligned, subtract 4 to make it so, and pretend the shift
+ C is 32 bits extra. High limb of dst (marked xxx) handled here
+ C separately.
+ C
+ C source -8(ebx,%eax,4)
+ C |
+ C +-------+-------+--
+ C | mm1 |
+ C +-------+-------+--
+ C 0mod8 4mod8
+ C
+ C dest
+ C -4(edx,%eax,4)
+ C |
+ C +-------+-------+-------+--
+ C | xxx | |
+ C +-------+-------+-------+--
+ C 0mod8 4mod8 0mod8
+
+ movq %mm1, %mm0
+ addl $32, %ecx C new shift
+
+ psllq %mm6, %mm0
+
+ movd %ecx, %mm6
+ psrlq $32, %mm0
+
+ C wasted cycle here waiting for %mm0
+
+ movd %mm0, -4(%edx,%eax,4)
+ subl $4, %edx
+L(start_dst_aligned):
+
+
+ psllq %mm6, %mm1
+ negl %ecx C -shift
+
+ addl $64, %ecx C 64-shift
+ movq %mm3, %mm2
+
+ movd %ecx, %mm7
+ subl $8, %eax C size-8
+
+ psrlq %mm7, %mm3
+
+ por %mm1, %mm3 C mm3 ready to store
+ jc L(finish)
+
+
+ C The comments in mpn_rshift apply here too.
+
+ ALIGN(8)
+L(unroll_loop):
+ C eax counter, limbs
+ C ebx src
+ C ecx
+ C edx dst
+ C esi
+ C edi
+ C
+ C mm0
+ C mm1
+ C mm2 src qword from 16(%ebx,%eax,4)
+ C mm3 dst qword ready to store to 24(%edx,%eax,4)
+ C
+ C mm5 return value
+ C mm6 lshift
+ C mm7 rshift
+
+ movq 8(%ebx,%eax,4), %mm0
+ psllq %mm6, %mm2
+
+ movq %mm0, %mm1
+ psrlq %mm7, %mm0
+
+ movq %mm3, 24(%edx,%eax,4) C prev
+ por %mm2, %mm0
+
+ movq (%ebx,%eax,4), %mm3 C
+ psllq %mm6, %mm1 C
+
+ movq %mm0, 16(%edx,%eax,4)
+ movq %mm3, %mm2 C
+
+ psrlq %mm7, %mm3 C
+ subl $4, %eax
+
+ por %mm1, %mm3 C
+ jnc L(unroll_loop)
+
+
+
+L(finish):
+ C eax -4 to -1 representing respectively 0 to 3 limbs remaining
+
+ testb $2, %al
+
+ jz L(finish_no_two)
+
+ movq 8(%ebx,%eax,4), %mm0
+ psllq %mm6, %mm2
+
+ movq %mm0, %mm1
+ psrlq %mm7, %mm0
+
+ movq %mm3, 24(%edx,%eax,4) C prev
+ por %mm2, %mm0
+
+ movq %mm1, %mm2
+ movq %mm0, %mm3
+
+ subl $2, %eax
+L(finish_no_two):
+
+
+ C eax -4 or -3 representing respectively 0 or 1 limbs remaining
+ C
+ C mm2 src prev qword, from 16(%ebx,%eax,4)
+ C mm3 dst qword, for 24(%edx,%eax,4)
+
+ testb $1, %al
+ movd %mm5, %eax C retval
+
+ popl %edi
+ jz L(finish_zero)
+
+
+ C One extra src limb, destination was aligned.
+ C
+ C source ebx
+ C --+---------------+-------+
+ C | mm2 | |
+ C --+---------------+-------+
+ C
+ C dest edx+12 edx+4 edx
+ C --+---------------+---------------+-------+
+ C | mm3 | | |
+ C --+---------------+---------------+-------+
+ C
+ C mm6 = shift
+ C mm7 = ecx = 64-shift
+
+
+ C One extra src limb, destination was unaligned.
+ C
+ C source ebx
+ C --+---------------+-------+
+ C | mm2 | |
+ C --+---------------+-------+
+ C
+ C dest edx+12 edx+4
+ C --+---------------+---------------+
+ C | mm3 | |
+ C --+---------------+---------------+
+ C
+ C mm6 = shift+32
+ C mm7 = ecx = 64-(shift+32)
+
+
+ C In both cases there's one extra limb of src to fetch and combine
+ C with mm2 to make a qword at 4(%edx), and in the aligned case
+ C there's an extra limb of dst to be formed from that extra src limb
+ C left shifted.
+
+
+ movd (%ebx), %mm0
+ psllq %mm6, %mm2
+
+ movq %mm3, 12(%edx)
+ psllq $32, %mm0
+
+ movq %mm0, %mm1
+ psrlq %mm7, %mm0
+
+ por %mm2, %mm0
+ psllq %mm6, %mm1
+
+ movq %mm0, 4(%edx)
+ psrlq $32, %mm1
+
+ andl $32, %ecx
+ popl %ebx
+
+ jz L(finish_one_unaligned)
+
+ movd %mm1, (%edx)
+L(finish_one_unaligned):
+
+ emms
+
+ ret
+
+
+L(finish_zero):
+
+ C No extra src limbs, destination was aligned.
+ C
+ C source ebx
+ C --+---------------+
+ C | mm2 |
+ C --+---------------+
+ C
+ C dest edx+8 edx
+ C --+---------------+---------------+
+ C | mm3 | |
+ C --+---------------+---------------+
+ C
+ C mm6 = shift
+ C mm7 = ecx = 64-shift
+
+
+ C No extra src limbs, destination was unaligned.
+ C
+ C source ebx
+ C --+---------------+
+ C | mm2 |
+ C --+---------------+
+ C
+ C dest edx+8 edx+4
+ C --+---------------+-------+
+ C | mm3 | |
+ C --+---------------+-------+
+ C
+ C mm6 = shift+32
+ C mm7 = ecx = 64-(shift+32)
+
+
+ C The movd for the unaligned case writes the same data to 4(%edx)
+ C that the movq does for the aligned case.
+
+
+ movq %mm3, 8(%edx)
+ andl $32, %ecx
+
+ psllq %mm6, %mm2
+ jz L(finish_zero_unaligned)
+
+ movq %mm2, (%edx)
+L(finish_zero_unaligned):
+
+ psrlq $32, %mm2
+ popl %ebx
+
+ movd %mm5, %eax C retval
+
+ movd %mm2, 4(%edx)
+
+ emms
+
+ ret
+
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium/mmx/mul_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium/mmx/mul_1.asm
new file mode 100644
index 00000000000..4ced577b13a
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium/mmx/mul_1.asm
@@ -0,0 +1,371 @@
+dnl Intel Pentium MMX mpn_mul_1 -- mpn by limb multiplication.
+
+dnl Copyright 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 cycles/limb
+C P5: 12.0 for 32-bit multiplier
+C 7.0 for 16-bit multiplier
+
+
+C mp_limb_t mpn_mul_1 (mp_ptr dst, mp_srcptr src, mp_size_t size,
+C mp_limb_t multiplier);
+C
+C When the multiplier is 16 bits some special case MMX code is used. Small
+C multipliers might arise reasonably often from mpz_mul_ui etc. If the size
+C is odd there's roughly a 5 cycle penalty, so times for say size==7 and
+C size==8 end up being quite close. If src isn't aligned to an 8 byte
+C boundary then one limb is processed separately with roughly a 5 cycle
+C penalty, so in that case it's say size==8 and size==9 which are close.
+C
+C Alternatives:
+C
+C MMX is not believed to be of any use for 32-bit multipliers, since for
+C instance the current method would just have to be more or less duplicated
+C for the high and low halves of the multiplier, and would probably
+C therefore run at about 14 cycles, which is slower than the plain integer
+C at 12.
+C
+C Adding the high and low MMX products using integer code seems best. An
+C attempt at using paddd and carry bit propagation with pcmpgtd didn't give
+C any joy. Perhaps something could be done keeping the values signed and
+C thereby avoiding adjustments to make pcmpgtd into an unsigned compare, or
+C perhaps not.
+C
+C Future:
+C
+C An mpn_mul_1c entrypoint would need a double carry out of the low result
+C limb in the 16-bit code, unless it could be assumed the carry fits in 16
+C bits, possibly as carry<multiplier, this being true of a big calculation
+C done piece by piece. But let's worry about that if/when mul_1c is
+C actually used.
+
+defframe(PARAM_MULTIPLIER,16)
+defframe(PARAM_SIZE, 12)
+defframe(PARAM_SRC, 8)
+defframe(PARAM_DST, 4)
+
+ TEXT
+
+ ALIGN(8)
+PROLOGUE(mpn_mul_1)
+deflit(`FRAME',0)
+
+ movl PARAM_SIZE, %ecx
+ movl PARAM_SRC, %edx
+
+ cmpl $1, %ecx
+ jne L(two_or_more)
+
+ C one limb only
+
+ movl PARAM_MULTIPLIER, %eax
+ movl PARAM_DST, %ecx
+
+ mull (%edx)
+
+ movl %eax, (%ecx)
+ movl %edx, %eax
+
+ ret
+
+
+L(two_or_more):
+ C eax size
+ C ebx
+ C ecx carry
+ C edx
+ C esi src
+ C edi
+ C ebp
+
+ pushl %esi FRAME_pushl()
+ pushl %edi FRAME_pushl()
+
+ movl %edx, %esi C src
+ movl PARAM_DST, %edi
+
+ movl PARAM_MULTIPLIER, %eax
+ pushl %ebx FRAME_pushl()
+
+ leal (%esi,%ecx,4), %esi C src end
+ leal (%edi,%ecx,4), %edi C dst end
+
+ negl %ecx C -size
+
+ pushl %ebp FRAME_pushl()
+ cmpl $65536, %eax
+
+ jb L(small)
+
+
+L(big):
+ xorl %ebx, %ebx C carry limb
+ sarl %ecx C -size/2
+
+ jnc L(top) C with carry flag clear
+
+
+ C size was odd, process one limb separately
+
+ mull 4(%esi,%ecx,8) C m * src[0]
+
+ movl %eax, 4(%edi,%ecx,8)
+ incl %ecx
+
+ orl %edx, %ebx C carry limb, and clear carry flag
+
+
+L(top):
+ C eax
+ C ebx carry
+ C ecx counter, negative
+ C edx
+ C esi src end
+ C edi dst end
+ C ebp (scratch carry)
+
+ adcl $0, %ebx
+ movl (%esi,%ecx,8), %eax
+
+ mull PARAM_MULTIPLIER
+
+ movl %edx, %ebp
+ addl %eax, %ebx
+
+ adcl $0, %ebp
+ movl 4(%esi,%ecx,8), %eax
+
+ mull PARAM_MULTIPLIER
+
+ movl %ebx, (%edi,%ecx,8)
+ addl %ebp, %eax
+
+ movl %eax, 4(%edi,%ecx,8)
+ incl %ecx
+
+ movl %edx, %ebx
+ jnz L(top)
+
+
+ adcl $0, %ebx
+ popl %ebp
+
+ movl %ebx, %eax
+ popl %ebx
+
+ popl %edi
+ popl %esi
+
+ ret
+
+
+L(small):
+ C Special case for 16-bit multiplier.
+ C
+ C eax multiplier
+ C ebx
+ C ecx -size
+ C edx src
+ C esi src end
+ C edi dst end
+ C ebp multiplier
+
+ C size<3 not supported here. At size==3 we're already a couple of
+ C cycles faster, so there's no threshold as such, just use the MMX
+ C as soon as possible.
+
+ cmpl $-3, %ecx
+ ja L(big)
+
+ movd %eax, %mm7 C m
+ pxor %mm6, %mm6 C initial carry word
+
+ punpcklwd %mm7, %mm7 C m replicated 2 times
+ addl $2, %ecx C -size+2
+
+ punpckldq %mm7, %mm7 C m replicated 4 times
+ andl $4, %edx C test alignment, clear carry flag
+
+ movq %mm7, %mm0 C m
+ jz L(small_entry)
+
+
+ C Source is unaligned, process one limb separately.
+ C
+ C Plain integer code is used here, since it's smaller and is about
+ C the same 13 cycles as an mmx block would be.
+ C
+ C An "addl $1,%ecx" doesn't clear the carry flag when size==3, hence
+ C the use of separate incl and orl.
+
+ mull -8(%esi,%ecx,4) C m * src[0]
+
+ movl %eax, -8(%edi,%ecx,4) C dst[0]
+ incl %ecx C one limb processed
+
+ movd %edx, %mm6 C initial carry
+
+ orl %eax, %eax C clear carry flag
+ jmp L(small_entry)
+
+
+C The scheduling here is quite tricky, since so many instructions have
+C pairing restrictions. In particular the js won't pair with a movd, and
+C can't be paired with an adc since it wants flags from the inc, so
+C instructions are rotated to the top of the loop to find somewhere useful
+C for it.
+C
+C Trouble has been taken to avoid overlapping successive loop iterations,
+C since that would greatly increase the size of the startup and finishup
+C code. Actually there's probably not much advantage to be had from
+C overlapping anyway, since the difficulties are mostly with pairing, not
+C with latencies as such.
+C
+C In the comments x represents the src data and m the multiplier (16
+C bits, but replicated 4 times).
+C
+C The m signs calculated in %mm3 are a loop invariant and could be held in
+C say %mm5, but that would save only one instruction and hence be no faster.
+
+L(small_top):
+ C eax l.low, then l.high
+ C ebx (h.low)
+ C ecx counter, -size+2 to 0 or 1
+ C edx (h.high)
+ C esi &src[size]
+ C edi &dst[size]
+ C ebp
+ C
+ C %mm0 (high products)
+ C %mm1 (low products)
+ C %mm2 (adjust for m using x signs)
+ C %mm3 (adjust for x using m signs)
+ C %mm4
+ C %mm5
+ C %mm6 h.low, then carry
+ C %mm7 m replicated 4 times
+
+ movd %mm6, %ebx C h.low
+ psrlq $32, %mm1 C l.high
+
+ movd %mm0, %edx C h.high
+ movq %mm0, %mm6 C new c
+
+ adcl %eax, %ebx
+ incl %ecx
+
+ movd %mm1, %eax C l.high
+ movq %mm7, %mm0
+
+ adcl %eax, %edx
+ movl %ebx, -16(%edi,%ecx,4)
+
+ movl %edx, -12(%edi,%ecx,4)
+ psrlq $32, %mm6 C c
+
+L(small_entry):
+ pmulhw -8(%esi,%ecx,4), %mm0 C h = (x*m).high
+ movq %mm7, %mm1
+
+ pmullw -8(%esi,%ecx,4), %mm1 C l = (x*m).low
+ movq %mm7, %mm3
+
+ movq -8(%esi,%ecx,4), %mm2 C x
+ psraw $15, %mm3 C m signs
+
+ pand -8(%esi,%ecx,4), %mm3 C x selected by m signs
+ psraw $15, %mm2 C x signs
+
+ paddw %mm3, %mm0 C add x to h if m neg
+ pand %mm7, %mm2 C m selected by x signs
+
+ paddw %mm2, %mm0 C add m to h if x neg
+ incl %ecx
+
+ movd %mm1, %eax C l.low
+ punpcklwd %mm0, %mm6 C c + h.low << 16
+
+ psrlq $16, %mm0 C h.high
+ js L(small_top)
+
+
+
+
+ movd %mm6, %ebx C h.low
+ psrlq $32, %mm1 C l.high
+
+ adcl %eax, %ebx
+ popl %ebp FRAME_popl()
+
+ movd %mm0, %edx C h.high
+ psrlq $32, %mm0 C l.high
+
+ movd %mm1, %eax C l.high
+
+ adcl %eax, %edx
+ movl %ebx, -12(%edi,%ecx,4)
+
+ movd %mm0, %eax C c
+
+ adcl $0, %eax
+ movl %edx, -8(%edi,%ecx,4)
+
+ orl %ecx, %ecx
+ jnz L(small_done) C final %ecx==1 means even, ==0 odd
+
+
+ C Size odd, one extra limb to process.
+ C Plain integer code is used here, since it's smaller and is about
+ C the same speed as another mmx block would be.
+
+ movl %eax, %ecx
+ movl PARAM_MULTIPLIER, %eax
+
+ mull -4(%esi)
+
+ addl %ecx, %eax
+
+ adcl $0, %edx
+ movl %eax, -4(%edi)
+
+ movl %edx, %eax
+L(small_done):
+ popl %ebx
+
+ popl %edi
+ popl %esi
+
+ emms
+
+ ret
+
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium/mmx/rshift.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium/mmx/rshift.asm
new file mode 100644
index 00000000000..e3b274bb636
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium/mmx/rshift.asm
@@ -0,0 +1,468 @@
+dnl Intel P5 mpn_rshift -- mpn right shift.
+
+dnl Copyright 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 P5: 1.75 cycles/limb.
+
+
+C mp_limb_t mpn_rshift (mp_ptr dst, mp_srcptr src, mp_size_t size,
+C unsigned shift);
+C
+C Shift src,size right by shift many bits and store the result in dst,size.
+C Zeros are shifted in at the left. Return the bits shifted out at the
+C right.
+C
+C It takes 6 mmx instructions to process 2 limbs, making 1.5 cycles/limb,
+C and with a 4 limb loop and 1 cycle of loop overhead the total is 1.75 c/l.
+C
+C Full speed depends on source and destination being aligned. Unaligned mmx
+C loads and stores on P5 don't pair and have a 2 cycle penalty. Some hairy
+C setups and finish-ups are done to ensure alignment for the loop.
+C
+C MMX shifts work out a bit faster even for the simple loop.
+
+defframe(PARAM_SHIFT,16)
+defframe(PARAM_SIZE, 12)
+defframe(PARAM_SRC, 8)
+defframe(PARAM_DST, 4)
+deflit(`FRAME',0)
+
+dnl Minimum 5, because the unrolled loop can't handle less.
+deflit(UNROLL_THRESHOLD, 5)
+
+ TEXT
+ ALIGN(8)
+
+PROLOGUE(mpn_rshift)
+
+ pushl %ebx
+ pushl %edi
+deflit(`FRAME',8)
+
+ movl PARAM_SIZE, %eax
+ movl PARAM_DST, %edx
+
+ movl PARAM_SRC, %ebx
+ movl PARAM_SHIFT, %ecx
+
+ cmp $UNROLL_THRESHOLD, %eax
+ jae L(unroll)
+
+ decl %eax
+ movl (%ebx), %edi C src low limb
+
+ jnz L(simple)
+
+ shrdl( %cl, %edi, %eax) C eax was decremented to zero
+
+ shrl %cl, %edi
+
+ movl %edi, (%edx) C dst low limb
+ popl %edi C risk of data cache bank clash
+
+ popl %ebx
+
+ ret
+
+
+C -----------------------------------------------------------------------------
+ ALIGN(8)
+L(simple):
+ C eax size-1
+ C ebx src
+ C ecx shift
+ C edx dst
+ C esi
+ C edi
+ C ebp
+deflit(`FRAME',8)
+
+ movd (%ebx), %mm5 C src[0]
+ leal (%ebx,%eax,4), %ebx C &src[size-1]
+
+ movd %ecx, %mm6 C rshift
+ leal -4(%edx,%eax,4), %edx C &dst[size-2]
+
+ psllq $32, %mm5
+ negl %eax
+
+
+C This loop is 5 or 8 cycles, with every second load unaligned and a wasted
+C cycle waiting for the mm0 result to be ready. For comparison a shrdl is 4
+C cycles and would be 8 in a simple loop. Using mmx helps the return value
+C and last limb calculations too.
+
+L(simple_top):
+ C eax counter, limbs, negative
+ C ebx &src[size-1]
+ C ecx return value
+ C edx &dst[size-2]
+ C
+ C mm0 scratch
+ C mm5 return value
+ C mm6 shift
+
+ movq (%ebx,%eax,4), %mm0
+ incl %eax
+
+ psrlq %mm6, %mm0
+
+ movd %mm0, (%edx,%eax,4)
+ jnz L(simple_top)
+
+
+ movd (%ebx), %mm0
+ psrlq %mm6, %mm5 C return value
+
+ psrlq %mm6, %mm0
+ popl %edi
+
+ movd %mm5, %eax
+ popl %ebx
+
+ movd %mm0, 4(%edx)
+
+ emms
+
+ ret
+
+
+C -----------------------------------------------------------------------------
+ ALIGN(8)
+L(unroll):
+ C eax size
+ C ebx src
+ C ecx shift
+ C edx dst
+ C esi
+ C edi
+ C ebp
+deflit(`FRAME',8)
+
+ movd (%ebx), %mm5 C src[0]
+ movl $4, %edi
+
+ movd %ecx, %mm6 C rshift
+ testl %edi, %ebx
+
+ psllq $32, %mm5
+ jz L(start_src_aligned)
+
+
+ C src isn't aligned, process low limb separately (marked xxx) and
+ C step src and dst by one limb, making src aligned.
+ C
+ C source ebx
+ C --+-------+-------+-------+
+ C | xxx |
+ C --+-------+-------+-------+
+ C 4mod8 0mod8 4mod8
+ C
+ C dest edx
+ C --+-------+-------+
+ C | | xxx |
+ C --+-------+-------+
+
+ movq (%ebx), %mm0 C unaligned load
+
+ psrlq %mm6, %mm0
+ addl $4, %ebx
+
+ decl %eax
+
+ movd %mm0, (%edx)
+ addl $4, %edx
+L(start_src_aligned):
+
+
+ movq (%ebx), %mm1
+ testl %edi, %edx
+
+ psrlq %mm6, %mm5 C retval
+ jz L(start_dst_aligned)
+
+ C dst isn't aligned, add 4 to make it so, and pretend the shift is
+ C 32 bits extra. Low limb of dst (marked xxx) handled here
+ C separately.
+ C
+ C source ebx
+ C --+-------+-------+
+ C | mm1 |
+ C --+-------+-------+
+ C 4mod8 0mod8
+ C
+ C dest edx
+ C --+-------+-------+-------+
+ C | xxx |
+ C --+-------+-------+-------+
+ C 4mod8 0mod8 4mod8
+
+ movq %mm1, %mm0
+ addl $32, %ecx C new shift
+
+ psrlq %mm6, %mm0
+
+ movd %ecx, %mm6
+
+ movd %mm0, (%edx)
+ addl $4, %edx
+L(start_dst_aligned):
+
+
+ movq 8(%ebx), %mm3
+ negl %ecx
+
+ movq %mm3, %mm2 C mm2 src qword
+ addl $64, %ecx
+
+ movd %ecx, %mm7
+ psrlq %mm6, %mm1
+
+ leal -12(%ebx,%eax,4), %ebx
+ leal -20(%edx,%eax,4), %edx
+
+ psllq %mm7, %mm3
+ subl $7, %eax C size-7
+
+ por %mm1, %mm3 C mm3 ready to store
+ negl %eax C -(size-7)
+
+ jns L(finish)
+
+
+ C This loop is the important bit, the rest is just support. Careful
+ C instruction scheduling achieves the claimed 1.75 c/l. The
+ C relevant parts of the pairing rules are:
+ C
+ C - mmx loads and stores execute only in the U pipe
+ C - only one mmx shift in a pair
+ C - wait one cycle before storing an mmx register result
+ C - the usual address generation interlock
+ C
+ C Two qword calculations are slightly interleaved. The instructions
+ C marked "C" belong to the second qword, and the "C prev" one is for
+ C the second qword from the previous iteration.
+
+ ALIGN(8)
+L(unroll_loop):
+ C eax counter, limbs, negative
+ C ebx &src[size-12]
+ C ecx
+ C edx &dst[size-12]
+ C esi
+ C edi
+ C
+ C mm0
+ C mm1
+ C mm2 src qword from -8(%ebx,%eax,4)
+ C mm3 dst qword ready to store to -8(%edx,%eax,4)
+ C
+ C mm5 return value
+ C mm6 rshift
+ C mm7 lshift
+
+ movq (%ebx,%eax,4), %mm0
+ psrlq %mm6, %mm2
+
+ movq %mm0, %mm1
+ psllq %mm7, %mm0
+
+ movq %mm3, -8(%edx,%eax,4) C prev
+ por %mm2, %mm0
+
+ movq 8(%ebx,%eax,4), %mm3 C
+ psrlq %mm6, %mm1 C
+
+ movq %mm0, (%edx,%eax,4)
+ movq %mm3, %mm2 C
+
+ psllq %mm7, %mm3 C
+ addl $4, %eax
+
+ por %mm1, %mm3 C
+ js L(unroll_loop)
+
+
+L(finish):
+ C eax 0 to 3 representing respectively 3 to 0 limbs remaining
+
+ testb $2, %al
+
+ jnz L(finish_no_two)
+
+ movq (%ebx,%eax,4), %mm0
+ psrlq %mm6, %mm2
+
+ movq %mm0, %mm1
+ psllq %mm7, %mm0
+
+ movq %mm3, -8(%edx,%eax,4) C prev
+ por %mm2, %mm0
+
+ movq %mm1, %mm2
+ movq %mm0, %mm3
+
+ addl $2, %eax
+L(finish_no_two):
+
+
+ C eax 2 or 3 representing respectively 1 or 0 limbs remaining
+ C
+ C mm2 src prev qword, from -8(%ebx,%eax,4)
+ C mm3 dst qword, for -8(%edx,%eax,4)
+
+ testb $1, %al
+ popl %edi
+
+ movd %mm5, %eax C retval
+ jnz L(finish_zero)
+
+
+ C One extra limb, destination was aligned.
+ C
+ C source ebx
+ C +-------+---------------+--
+ C | | mm2 |
+ C +-------+---------------+--
+ C
+ C dest edx
+ C +-------+---------------+---------------+--
+ C | | | mm3 |
+ C +-------+---------------+---------------+--
+ C
+ C mm6 = shift
+ C mm7 = ecx = 64-shift
+
+
+ C One extra limb, destination was unaligned.
+ C
+ C source ebx
+ C +-------+---------------+--
+ C | | mm2 |
+ C +-------+---------------+--
+ C
+ C dest edx
+ C +---------------+---------------+--
+ C | | mm3 |
+ C +---------------+---------------+--
+ C
+ C mm6 = shift+32
+ C mm7 = ecx = 64-(shift+32)
+
+
+ C In both cases there's one extra limb of src to fetch and combine
+ C with mm2 to make a qword at 8(%edx), and in the aligned case
+ C there's a further extra limb of dst to be formed.
+
+
+ movd 8(%ebx), %mm0
+ psrlq %mm6, %mm2
+
+ movq %mm0, %mm1
+ psllq %mm7, %mm0
+
+ movq %mm3, (%edx)
+ por %mm2, %mm0
+
+ psrlq %mm6, %mm1
+ andl $32, %ecx
+
+ popl %ebx
+ jz L(finish_one_unaligned)
+
+ C dst was aligned, must store one extra limb
+ movd %mm1, 16(%edx)
+L(finish_one_unaligned):
+
+ movq %mm0, 8(%edx)
+
+ emms
+
+ ret
+
+
+L(finish_zero):
+
+ C No extra limbs, destination was aligned.
+ C
+ C source ebx
+ C +---------------+--
+ C | mm2 |
+ C +---------------+--
+ C
+ C dest edx+4
+ C +---------------+---------------+--
+ C | | mm3 |
+ C +---------------+---------------+--
+ C
+ C mm6 = shift
+ C mm7 = ecx = 64-shift
+
+
+ C No extra limbs, destination was unaligned.
+ C
+ C source ebx
+ C +---------------+--
+ C | mm2 |
+ C +---------------+--
+ C
+ C dest edx+4
+ C +-------+---------------+--
+ C | | mm3 |
+ C +-------+---------------+--
+ C
+ C mm6 = shift+32
+ C mm7 = 64-(shift+32)
+
+
+ C The movd for the unaligned case is clearly the same data as the
+ C movq for the aligned case, it's just a choice between whether one
+ C or two limbs should be written.
+
+
+ movq %mm3, 4(%edx)
+ psrlq %mm6, %mm2
+
+ movd %mm2, 12(%edx)
+ andl $32, %ecx
+
+ popl %ebx
+ jz L(finish_zero_unaligned)
+
+ movq %mm2, 12(%edx)
+L(finish_zero_unaligned):
+
+ emms
+
+ ret
+
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium/mod_34lsub1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium/mod_34lsub1.asm
new file mode 100644
index 00000000000..2d88223b847
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium/mod_34lsub1.asm
@@ -0,0 +1,192 @@
+dnl Intel P5 mpn_mod_34lsub1 -- mpn remainder modulo 2**24-1.
+
+dnl Copyright 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 P5: 1.66 cycles/limb
+
+
+C mp_limb_t mpn_mod_34lsub1 (mp_srcptr src, mp_size_t size)
+C
+
+defframe(PARAM_SIZE, 8)
+defframe(PARAM_SRC, 4)
+
+ TEXT
+ ALIGN(16)
+PROLOGUE(mpn_mod_34lsub1)
+deflit(`FRAME',0)
+
+ movl PARAM_SIZE, %ecx
+ movl PARAM_SRC, %edx
+
+ subl $2, %ecx
+ ja L(three_or_more)
+
+ movl (%edx), %eax
+ jne L(one)
+
+
+ movl 4(%edx), %ecx
+ movl %eax, %edx
+
+ shrl $24, %edx
+ andl $0xFFFFFF, %eax
+
+ addl %edx, %eax
+ movl %ecx, %edx
+
+ shrl $16, %ecx
+ andl $0xFFFF, %edx
+
+ shll $8, %edx
+ addl %ecx, %eax
+
+ addl %edx, %eax
+
+L(one):
+ ret
+
+
+L(three_or_more):
+ C eax
+ C ebx
+ C ecx size-2
+ C edx src
+ C esi
+ C edi
+ C ebp
+
+ pushl %ebx FRAME_pushl()
+ pushl %esi FRAME_pushl()
+
+ pushl %edi FRAME_pushl()
+ pushl %ebp FRAME_pushl()
+
+ xorl %esi, %esi C 0mod3
+ xorl %edi, %edi C 1mod3
+
+ xorl %ebp, %ebp C 2mod3, and clear carry
+
+L(top):
+ C eax scratch
+ C ebx scratch
+ C ecx counter, limbs
+ C edx src
+ C esi 0mod3
+ C edi 1mod3
+ C ebp 2mod3
+
+ movl (%edx), %eax
+ movl 4(%edx), %ebx
+
+ adcl %eax, %esi
+ movl 8(%edx), %eax
+
+ adcl %ebx, %edi
+ leal 12(%edx), %edx
+
+ adcl %eax, %ebp
+ leal -2(%ecx), %ecx
+
+ decl %ecx
+ jg L(top)
+
+
+ C ecx is -2, -1 or 0, representing 0, 1 or 2 more limbs, respectively
+
+ movl $0xFFFFFFFF, %ebx C mask
+ incl %ecx
+
+ js L(combine) C 0 more
+
+ movl (%edx), %eax
+ movl $0xFFFFFF00, %ebx
+
+ adcl %eax, %esi
+ decl %ecx
+
+ js L(combine) C 1 more
+
+ movl 4(%edx), %eax
+ movl $0xFFFF0000, %ebx
+
+ adcl %eax, %edi
+
+
+
+L(combine):
+ C eax
+ C ebx mask
+ C ecx
+ C edx
+ C esi 0mod3
+ C edi 1mod3
+ C ebp 2mod3
+
+ sbbl %ecx, %ecx C carry
+ movl %esi, %eax C 0mod3
+
+ andl %ebx, %ecx C masked for position
+ andl $0xFFFFFF, %eax C 0mod3 low
+
+ shrl $24, %esi C 0mod3 high
+ subl %ecx, %eax C apply carry
+
+ addl %esi, %eax C apply 0mod3
+ movl %edi, %ebx C 1mod3
+
+ shrl $16, %edi C 1mod3 high
+ andl $0x0000FFFF, %ebx
+
+ shll $8, %ebx C 1mod3 low
+ addl %edi, %eax C apply 1mod3 high
+
+ addl %ebx, %eax C apply 1mod3 low
+ movl %ebp, %ebx C 2mod3
+
+ shrl $8, %ebp C 2mod3 high
+ andl $0xFF, %ebx
+
+ shll $16, %ebx C 2mod3 low
+ addl %ebp, %eax C apply 2mod3 high
+
+ addl %ebx, %eax C apply 2mod3 low
+
+ popl %ebp
+ popl %edi
+
+ popl %esi
+ popl %ebx
+
+ ret
+
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium/mode1o.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium/mode1o.asm
new file mode 100644
index 00000000000..eb2790e1a08
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium/mode1o.asm
@@ -0,0 +1,266 @@
+dnl Intel Pentium mpn_modexact_1_odd -- exact division style remainder.
+
+dnl Copyright 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 P5: 23.0 cycles/limb
+
+
+C mp_limb_t mpn_modexact_1_odd (mp_srcptr src, mp_size_t size,
+C mp_limb_t divisor);
+C mp_limb_t mpn_modexact_1c_odd (mp_srcptr src, mp_size_t size,
+C mp_limb_t divisor, mp_limb_t carry);
+C
+C There seems no way to pair up the two lone instructions in the main loop.
+C
+C The special case for size==1 saves about 20 cycles (non-PIC), making it
+C the same as mpn_mod_1, and in fact making modexact faster than mod_1 at
+C all sizes.
+C
+C Alternatives:
+C
+C Using mmx for the multiplies might be possible, with pmullw and pmulhw
+C having just 3 cycle latencies, but carry bit handling would probably be
+C complicated.
+
+defframe(PARAM_CARRY, 16)
+defframe(PARAM_DIVISOR,12)
+defframe(PARAM_SIZE, 8)
+defframe(PARAM_SRC, 4)
+
+dnl re-using parameter space
+define(VAR_INVERSE,`PARAM_SIZE')
+
+ TEXT
+
+ ALIGN(16)
+PROLOGUE(mpn_modexact_1c_odd)
+deflit(`FRAME',0)
+
+ movl PARAM_DIVISOR, %eax
+ movl PARAM_CARRY, %edx
+
+ jmp L(start_1c)
+
+EPILOGUE()
+
+ ALIGN(16)
+PROLOGUE(mpn_modexact_1_odd)
+deflit(`FRAME',0)
+
+ movl PARAM_DIVISOR, %eax
+ xorl %edx, %edx C carry
+
+L(start_1c):
+
+ifdef(`PIC',`
+ call L(here) FRAME_pushl()
+L(here):
+
+ shrl %eax C d/2
+ movl (%esp), %ecx C eip
+
+ addl $_GLOBAL_OFFSET_TABLE_+[.-L(here)], %ecx
+ movl %ebx, (%esp) C push ebx
+
+ andl $127, %eax
+ movl PARAM_SIZE, %ebx
+
+ movl binvert_limb_table@GOT(%ecx), %ecx
+ subl $2, %ebx
+
+ movb (%eax,%ecx), %cl C inv 8 bits
+ jc L(one_limb)
+
+',`
+dnl non-PIC
+ shrl %eax C d/2
+ pushl %ebx FRAME_pushl()
+
+ movl PARAM_SIZE, %ebx
+ andl $127, %eax
+
+ subl $2, %ebx
+ jc L(one_limb)
+
+ movb binvert_limb_table(%eax), %cl C inv 8 bits
+')
+
+ movl %ecx, %eax
+ addl %ecx, %ecx C 2*inv
+
+ imull %eax, %eax C inv*inv
+
+ imull PARAM_DIVISOR, %eax C inv*inv*d
+
+ subl %eax, %ecx C inv = 2*inv - inv*inv*d
+
+ movl %ecx, %eax
+ addl %ecx, %ecx C 2*inv
+
+ imull %eax, %eax C inv*inv
+
+ imull PARAM_DIVISOR, %eax C inv*inv*d
+
+ subl %eax, %ecx C inv = 2*inv - inv*inv*d
+ pushl %esi FRAME_pushl()
+
+ ASSERT(e,` C d*inv == 1 mod 2^GMP_LIMB_BITS
+ movl %ecx, %eax
+ imull PARAM_DIVISOR, %eax
+ cmpl $1, %eax')
+
+ movl PARAM_SRC, %esi
+ movl %ecx, VAR_INVERSE
+
+ movl (%esi), %eax C src[0]
+ leal 4(%esi,%ebx,4), %esi C &src[size-1]
+
+ xorl $-1, %ebx C -(size-1)
+ ASSERT(nz)
+ jmp L(entry)
+
+
+C The use of VAR_INVERSE means only a store is needed for that value, rather
+C than a push and pop of say %edi.
+
+ ALIGN(16)
+L(top):
+ C eax scratch, low product
+ C ebx counter, limbs, negative
+ C ecx carry bit
+ C edx scratch, high product
+ C esi &src[size-1]
+ C edi
+ C ebp
+
+ mull PARAM_DIVISOR C h:dummy = q*d
+
+ movl (%esi,%ebx,4), %eax C src[i]
+ subl %ecx, %edx C h -= -c
+
+L(entry):
+ subl %edx, %eax C s = src[i] - h
+
+ sbbl %ecx, %ecx C new -c (0 or -1)
+
+ imull VAR_INVERSE, %eax C q = s*i
+
+ incl %ebx
+ jnz L(top)
+
+
+ mull PARAM_DIVISOR
+
+ movl (%esi), %eax C src high
+ subl %ecx, %edx C h -= -c
+
+ cmpl PARAM_DIVISOR, %eax
+
+ jbe L(skip_last)
+deflit(FRAME_LAST,FRAME)
+
+
+ subl %edx, %eax C s = src[i] - h
+ popl %esi FRAME_popl()
+
+ sbbl %ecx, %ecx C c (0 or -1)
+ popl %ebx FRAME_popl()
+
+ imull VAR_INVERSE, %eax C q = s*i
+
+ mull PARAM_DIVISOR C h:dummy = q*d
+
+ movl %edx, %eax
+
+ subl %ecx, %eax
+
+ ret
+
+
+C When high<divisor can skip last step.
+
+L(skip_last):
+deflit(`FRAME',FRAME_LAST)
+ C eax src high
+ C ebx
+ C ecx
+ C edx r
+ C esi
+
+ subl %eax, %edx C r-s
+ popl %esi FRAME_popl()
+
+ sbbl %eax, %eax C -1 if underflow
+ movl PARAM_DIVISOR, %ebx
+
+ andl %ebx, %eax C divisor if underflow
+ popl %ebx FRAME_popl()
+
+ addl %edx, %eax C addback if underflow
+
+ ret
+
+
+C Special case for size==1 using a division for r = c-a mod d.
+C Could look for a-c<d and save a division sometimes, but that doesn't seem
+C worth bothering about.
+
+L(one_limb):
+deflit(`FRAME',4)
+ C eax
+ C ebx size-2 (==-1)
+ C ecx
+ C edx carry
+ C esi src end
+ C edi
+ C ebp
+
+ movl %edx, %eax
+ movl PARAM_SRC, %edx
+
+ movl PARAM_DIVISOR, %ecx
+ popl %ebx FRAME_popl()
+
+ subl (%edx), %eax C c-a
+
+ sbbl %edx, %edx
+ decl %ecx C d-1
+
+ andl %ecx, %edx C b*d+c-a if c<a, or c-a if c>=a
+
+ divl PARAM_DIVISOR
+
+ movl %edx, %eax
+
+ ret
+
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium/mul_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium/mul_1.asm
new file mode 100644
index 00000000000..a0858af2b41
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium/mul_1.asm
@@ -0,0 +1,177 @@
+dnl Intel Pentium mpn_mul_1 -- mpn by limb multiplication.
+
+dnl Copyright 1992, 1994, 1996, 1999, 2000, 2002 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 P5: 12.0 cycles/limb
+
+
+C mp_limb_t mpn_mul_1 (mp_ptr dst, mp_srcptr src, mp_size_t size,
+C mp_limb_t multiplier);
+C mp_limb_t mpn_mul_1c (mp_ptr dst, mp_srcptr src, mp_size_t size,
+C mp_limb_t multiplier, mp_limb_t carry);
+C
+
+defframe(PARAM_CARRY, 20)
+defframe(PARAM_MULTIPLIER,16)
+defframe(PARAM_SIZE, 12)
+defframe(PARAM_SRC, 8)
+defframe(PARAM_DST, 4)
+
+ TEXT
+ ALIGN(8)
+PROLOGUE(mpn_mul_1c)
+deflit(`FRAME',0)
+
+ movl PARAM_CARRY, %ecx
+ pushl %esi FRAME_pushl()
+
+ jmp L(start_1c)
+
+EPILOGUE()
+
+
+ ALIGN(8)
+PROLOGUE(mpn_mul_1)
+deflit(`FRAME',0)
+
+ xorl %ecx, %ecx
+ pushl %esi FRAME_pushl()
+
+L(start_1c):
+ movl PARAM_SRC, %esi
+ movl PARAM_SIZE, %eax
+
+ shrl %eax
+ jnz L(two_or_more)
+
+
+ C one limb only
+
+ movl (%esi), %eax
+
+ mull PARAM_MULTIPLIER
+
+ addl %eax, %ecx
+ movl PARAM_DST, %eax
+
+ adcl $0, %edx
+ popl %esi
+
+ movl %ecx, (%eax)
+ movl %edx, %eax
+
+ ret
+
+
+L(two_or_more):
+ C eax size/2
+ C ebx
+ C ecx carry
+ C edx
+ C esi src
+ C edi
+ C ebp
+
+ pushl %edi FRAME_pushl()
+ pushl %ebx FRAME_pushl()
+
+ movl PARAM_DST, %edi
+ leal -1(%eax), %ebx C size/2-1
+
+ notl %ebx C -size, preserve carry
+
+ leal (%esi,%eax,8), %esi C src end
+ leal (%edi,%eax,8), %edi C dst end
+
+ pushl %ebp FRAME_pushl()
+ jnc L(top)
+
+
+ C size was odd, process one limb separately
+
+ movl (%esi,%ebx,8), %eax
+ addl $4, %esi
+
+ mull PARAM_MULTIPLIER
+
+ addl %ecx, %eax
+ movl %edx, %ecx
+
+ movl %eax, (%edi,%ebx,8)
+ leal 4(%edi), %edi
+
+
+L(top):
+ C eax
+ C ebx counter, negative
+ C ecx carry
+ C edx
+ C esi src end
+ C edi dst end
+ C ebp
+
+ adcl $0, %ecx
+ movl (%esi,%ebx,8), %eax
+
+ mull PARAM_MULTIPLIER
+
+ movl %edx, %ebp
+ addl %eax, %ecx
+
+ adcl $0, %ebp
+ movl 4(%esi,%ebx,8), %eax
+
+ mull PARAM_MULTIPLIER
+
+ movl %ecx, (%edi,%ebx,8)
+ addl %ebp, %eax
+
+ movl %eax, 4(%edi,%ebx,8)
+ incl %ebx
+
+ movl %edx, %ecx
+ jnz L(top)
+
+
+ adcl $0, %ecx
+ popl %ebp
+
+ movl %ecx, %eax
+ popl %ebx
+
+ popl %edi
+ popl %esi
+
+ ret
+
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium/mul_2.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium/mul_2.asm
new file mode 100644
index 00000000000..4c7beb5df27
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium/mul_2.asm
@@ -0,0 +1,150 @@
+dnl Intel Pentium mpn_mul_2 -- mpn by 2-limb multiplication.
+
+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/.
+
+include(`../config.m4')
+
+
+C P5: 24.0 cycles/limb
+
+
+C mp_limb_t mpn_mul_2 (mp_ptr dst, mp_srcptr src, mp_size_t size,
+C mp_srcptr mult);
+C
+C At 24 c/l this is only 2 cycles faster than a separate mul_1 and addmul_1,
+C but has the advantage of making just one pass over the operands.
+C
+C There's not enough registers to use PARAM_MULT directly, so the multiplier
+C limbs are transferred to local variables on the stack.
+
+defframe(PARAM_MULT, 16)
+defframe(PARAM_SIZE, 12)
+defframe(PARAM_SRC, 8)
+defframe(PARAM_DST, 4)
+
+dnl re-use parameter space
+define(VAR_MULT_LOW, `PARAM_SRC')
+define(VAR_MULT_HIGH,`PARAM_DST')
+
+ TEXT
+ ALIGN(8)
+PROLOGUE(mpn_mul_2)
+deflit(`FRAME',0)
+
+ pushl %esi FRAME_pushl()
+ pushl %edi FRAME_pushl()
+
+ movl PARAM_SRC, %esi
+ movl PARAM_DST, %edi
+
+ movl PARAM_MULT, %eax
+ movl PARAM_SIZE, %ecx
+
+ movl 4(%eax), %edx C mult high
+ movl (%eax), %eax C mult low
+
+ movl %eax, VAR_MULT_LOW
+ movl %edx, VAR_MULT_HIGH
+
+ pushl %ebx FRAME_pushl()
+ pushl %ebp FRAME_pushl()
+
+ mull (%esi) C src[0] * mult[0]
+
+ movl %eax, %ebp C in case src==dst
+ movl (%esi), %eax C src[0]
+
+ movl %ebp, (%edi) C dst[0]
+ movl %edx, %ebx C initial low carry
+
+ xorl %ebp, %ebp C initial high carry
+ leal (%edi,%ecx,4), %edi C dst end
+
+ mull VAR_MULT_HIGH C src[0] * mult[1]
+
+ subl $2, %ecx C size-2
+ js L(done)
+
+ leal 8(%esi,%ecx,4), %esi C &src[size]
+ xorl $-1, %ecx C -(size-1)
+
+
+
+L(top):
+ C eax low prod
+ C ebx low carry
+ C ecx counter, negative
+ C edx high prod
+ C esi src end
+ C edi dst end
+ C ebp high carry (0 or -1)
+
+ andl $1, %ebp C 1 or 0
+ addl %eax, %ebx
+
+ adcl %edx, %ebp
+ ASSERT(nc)
+ movl (%esi,%ecx,4), %eax
+
+ mull VAR_MULT_LOW
+
+ addl %eax, %ebx C low carry
+ movl (%esi,%ecx,4), %eax
+
+ adcl %ebp, %edx C high carry
+ movl %ebx, (%edi,%ecx,4)
+
+ sbbl %ebp, %ebp C new high carry, -1 or 0
+ movl %edx, %ebx C new low carry
+
+ mull VAR_MULT_HIGH
+
+ incl %ecx
+ jnz L(top)
+
+
+L(done):
+ andl $1, %ebp C 1 or 0
+ addl %ebx, %eax
+
+ adcl %ebp, %edx
+ ASSERT(nc)
+ movl %eax, (%edi) C store carry low
+
+ movl %edx, %eax C return carry high
+
+ popl %ebp
+ popl %ebx
+
+ popl %edi
+ popl %esi
+
+ ret
+
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium/mul_basecase.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium/mul_basecase.asm
new file mode 100644
index 00000000000..50e15d35672
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium/mul_basecase.asm
@@ -0,0 +1,143 @@
+dnl Intel Pentium mpn_mul_basecase -- mpn by mpn multiplication.
+
+dnl Copyright 1996, 1998-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 P5: 14.2 cycles/crossproduct (approx)
+
+
+C void mpn_mul_basecase (mp_ptr wp,
+C mp_srcptr xp, mp_size_t xsize,
+C mp_srcptr yp, mp_size_t ysize);
+
+defframe(PARAM_YSIZE, 20)
+defframe(PARAM_YP, 16)
+defframe(PARAM_XSIZE, 12)
+defframe(PARAM_XP, 8)
+defframe(PARAM_WP, 4)
+
+defframe(VAR_COUNTER, -4)
+
+ TEXT
+ ALIGN(8)
+PROLOGUE(mpn_mul_basecase)
+
+ pushl %eax C dummy push for allocating stack slot
+ pushl %esi
+ pushl %ebp
+ pushl %edi
+deflit(`FRAME',16)
+
+ movl PARAM_XP,%esi
+ movl PARAM_WP,%edi
+ movl PARAM_YP,%ebp
+
+ movl (%esi),%eax C load xp[0]
+ mull (%ebp) C multiply by yp[0]
+ movl %eax,(%edi) C store to wp[0]
+ movl PARAM_XSIZE,%ecx C xsize
+ decl %ecx C If xsize = 1, ysize = 1 too
+ jz L(done)
+
+ movl PARAM_XSIZE,%eax
+ pushl %ebx
+FRAME_pushl()
+ movl %edx,%ebx
+ leal (%esi,%eax,4),%esi C make xp point at end
+ leal (%edi,%eax,4),%edi C offset wp by xsize
+ negl %ecx C negate j size/index for inner loop
+ xorl %eax,%eax C clear carry
+
+ ALIGN(8)
+L(oop1): adcl $0,%ebx
+ movl (%esi,%ecx,4),%eax C load next limb at xp[j]
+ mull (%ebp)
+ addl %ebx,%eax
+ movl %eax,(%edi,%ecx,4)
+ incl %ecx
+ movl %edx,%ebx
+ jnz L(oop1)
+
+ adcl $0,%ebx
+ movl PARAM_YSIZE,%eax
+ movl %ebx,(%edi) C most significant limb of product
+ addl $4,%edi C increment wp
+ decl %eax
+ jz L(skip)
+ movl %eax,VAR_COUNTER C set index i to ysize
+
+L(outer):
+ addl $4,%ebp C make ebp point to next y limb
+ movl PARAM_XSIZE,%ecx
+ negl %ecx
+ xorl %ebx,%ebx
+
+ C code at 0x61 here, close enough to aligned
+L(oop2):
+ adcl $0,%ebx
+ movl (%esi,%ecx,4),%eax
+ mull (%ebp)
+ addl %ebx,%eax
+ movl (%edi,%ecx,4),%ebx
+ adcl $0,%edx
+ addl %eax,%ebx
+ movl %ebx,(%edi,%ecx,4)
+ incl %ecx
+ movl %edx,%ebx
+ jnz L(oop2)
+
+ adcl $0,%ebx
+
+ movl %ebx,(%edi)
+ addl $4,%edi
+ movl VAR_COUNTER,%eax
+ decl %eax
+ movl %eax,VAR_COUNTER
+ jnz L(outer)
+
+L(skip):
+ popl %ebx
+ popl %edi
+ popl %ebp
+ popl %esi
+ addl $4,%esp
+ ret
+
+L(done):
+ movl %edx,4(%edi) C store to wp[1]
+ popl %edi
+ popl %ebp
+ popl %esi
+ popl %eax C dummy pop for deallocating stack slot
+ ret
+
+EPILOGUE()
+
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium/popcount.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium/popcount.asm
new file mode 100644
index 00000000000..b8d84ad2e2b
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium/popcount.asm
@@ -0,0 +1,134 @@
+dnl Intel P5 mpn_popcount -- mpn bit population count.
+
+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/.
+
+include(`../config.m4')
+
+
+C P5: 8.0 cycles/limb
+
+
+C unsigned long mpn_popcount (mp_srcptr src, mp_size_t size);
+C
+C An arithmetic approach has been found to be slower than the table lookup,
+C due to needing too many instructions.
+
+C The slightly strange quoting here helps the renaming done by tune/many.pl.
+deflit(TABLE_NAME,
+m4_assert_defined(`GSYM_PREFIX')
+GSYM_PREFIX`'mpn_popcount``'_table')
+
+ RODATA
+ ALIGN(8)
+ GLOBL TABLE_NAME
+TABLE_NAME:
+forloop(i,0,255,
+` .byte m4_popcount(i)
+')
+
+defframe(PARAM_SIZE,8)
+defframe(PARAM_SRC, 4)
+
+ TEXT
+ ALIGN(8)
+
+PROLOGUE(mpn_popcount)
+deflit(`FRAME',0)
+
+ movl PARAM_SIZE, %ecx
+ pushl %esi FRAME_pushl()
+
+ifdef(`PIC',`
+ pushl %ebx FRAME_pushl()
+ pushl %ebp FRAME_pushl()
+
+ call L(here)
+L(here):
+ popl %ebp
+ shll %ecx C size in byte pairs
+
+ addl $_GLOBAL_OFFSET_TABLE_+[.-L(here)], %ebp
+ movl PARAM_SRC, %esi
+
+ xorl %eax, %eax C total
+ xorl %ebx, %ebx C byte
+
+ movl TABLE_NAME@GOT(%ebp), %ebp
+ xorl %edx, %edx C byte
+define(TABLE,`(%ebp,$1)')
+',`
+dnl non-PIC
+ shll %ecx C size in byte pairs
+ movl PARAM_SRC, %esi
+
+ pushl %ebx FRAME_pushl()
+ xorl %eax, %eax C total
+
+ xorl %ebx, %ebx C byte
+ xorl %edx, %edx C byte
+
+define(TABLE,`TABLE_NAME`'($1)')
+')
+
+
+ ALIGN(8) C necessary on P55 for claimed speed
+L(top):
+ C eax total
+ C ebx byte
+ C ecx counter, 2*size to 2
+ C edx byte
+ C esi src
+ C edi
+ C ebp [PIC] table
+
+ addl %ebx, %eax
+ movb -1(%esi,%ecx,2), %bl
+
+ addl %edx, %eax
+ movb -2(%esi,%ecx,2), %dl
+
+ movb TABLE(%ebx), %bl
+ decl %ecx
+
+ movb TABLE(%edx), %dl
+ jnz L(top)
+
+
+ifdef(`PIC',`
+ popl %ebp
+')
+ addl %ebx, %eax
+ popl %ebx
+
+ addl %edx, %eax
+ popl %esi
+
+ ret
+
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium/rshift.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium/rshift.asm
new file mode 100644
index 00000000000..2105c4c9352
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium/rshift.asm
@@ -0,0 +1,243 @@
+dnl Intel Pentium mpn_rshift -- mpn right shift.
+
+dnl Copyright 1992, 1994-1996, 1999, 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 cycles/limb
+C P5,P54: 6.0
+C P55: 5.375
+
+
+C mp_limb_t mpn_rshift (mp_ptr dst, mp_srcptr src, mp_size_t size,
+C unsigned shift);
+C
+C The main shift-by-N loop should run at 5.375 c/l and that's what P55 does,
+C but P5 and P54 run only at 6.0 c/l, which is 4 cycles lost somewhere.
+
+defframe(PARAM_SHIFT,16)
+defframe(PARAM_SIZE, 12)
+defframe(PARAM_SRC, 8)
+defframe(PARAM_DST, 4)
+
+ TEXT
+ ALIGN(8)
+PROLOGUE(mpn_rshift)
+
+ pushl %edi
+ pushl %esi
+ pushl %ebx
+ pushl %ebp
+deflit(`FRAME',16)
+
+ movl PARAM_DST,%edi
+ movl PARAM_SRC,%esi
+ movl PARAM_SIZE,%ebp
+ movl PARAM_SHIFT,%ecx
+
+C We can use faster code for shift-by-1 under certain conditions.
+ cmp $1,%ecx
+ jne L(normal)
+ leal 4(%edi),%eax
+ cmpl %esi,%eax
+ jnc L(special) C jump if res_ptr + 1 >= s_ptr
+ leal (%edi,%ebp,4),%eax
+ cmpl %eax,%esi
+ jnc L(special) C jump if s_ptr >= res_ptr + size
+
+L(normal):
+ movl (%esi),%edx
+ addl $4,%esi
+ xorl %eax,%eax
+ shrdl( %cl, %edx, %eax) C compute carry limb
+ pushl %eax C push carry limb onto stack
+
+ decl %ebp
+ pushl %ebp
+ shrl $3,%ebp
+ jz L(end)
+
+ movl (%edi),%eax C fetch destination cache line
+
+ ALIGN(4)
+L(oop): movl 28(%edi),%eax C fetch destination cache line
+ movl %edx,%ebx
+
+ movl (%esi),%eax
+ movl 4(%esi),%edx
+ shrdl( %cl, %eax, %ebx)
+ shrdl( %cl, %edx, %eax)
+ movl %ebx,(%edi)
+ movl %eax,4(%edi)
+
+ movl 8(%esi),%ebx
+ movl 12(%esi),%eax
+ shrdl( %cl, %ebx, %edx)
+ shrdl( %cl, %eax, %ebx)
+ movl %edx,8(%edi)
+ movl %ebx,12(%edi)
+
+ movl 16(%esi),%edx
+ movl 20(%esi),%ebx
+ shrdl( %cl, %edx, %eax)
+ shrdl( %cl, %ebx, %edx)
+ movl %eax,16(%edi)
+ movl %edx,20(%edi)
+
+ movl 24(%esi),%eax
+ movl 28(%esi),%edx
+ shrdl( %cl, %eax, %ebx)
+ shrdl( %cl, %edx, %eax)
+ movl %ebx,24(%edi)
+ movl %eax,28(%edi)
+
+ addl $32,%esi
+ addl $32,%edi
+ decl %ebp
+ jnz L(oop)
+
+L(end): popl %ebp
+ andl $7,%ebp
+ jz L(end2)
+L(oop2):
+ movl (%esi),%eax
+ shrdl( %cl,%eax,%edx) C compute result limb
+ movl %edx,(%edi)
+ movl %eax,%edx
+ addl $4,%esi
+ addl $4,%edi
+ decl %ebp
+ jnz L(oop2)
+
+L(end2):
+ shrl %cl,%edx C compute most significant limb
+ movl %edx,(%edi) C store it
+
+ popl %eax C pop carry limb
+
+ popl %ebp
+ popl %ebx
+ popl %esi
+ popl %edi
+ ret
+
+
+C We loop from least significant end of the arrays, which is only
+C permissable if the source and destination don't overlap, since the
+C function is documented to work for overlapping source and destination.
+
+L(special):
+ leal -4(%edi,%ebp,4),%edi
+ leal -4(%esi,%ebp,4),%esi
+
+ movl (%esi),%edx
+ subl $4,%esi
+
+ decl %ebp
+ pushl %ebp
+ shrl $3,%ebp
+
+ shrl %edx
+ incl %ebp
+ decl %ebp
+ jz L(Lend)
+
+ movl (%edi),%eax C fetch destination cache line
+
+ ALIGN(4)
+L(Loop):
+ movl -28(%edi),%eax C fetch destination cache line
+ movl %edx,%ebx
+
+ movl (%esi),%eax
+ movl -4(%esi),%edx
+ rcrl %eax
+ movl %ebx,(%edi)
+ rcrl %edx
+ movl %eax,-4(%edi)
+
+ movl -8(%esi),%ebx
+ movl -12(%esi),%eax
+ rcrl %ebx
+ movl %edx,-8(%edi)
+ rcrl %eax
+ movl %ebx,-12(%edi)
+
+ movl -16(%esi),%edx
+ movl -20(%esi),%ebx
+ rcrl %edx
+ movl %eax,-16(%edi)
+ rcrl %ebx
+ movl %edx,-20(%edi)
+
+ movl -24(%esi),%eax
+ movl -28(%esi),%edx
+ rcrl %eax
+ movl %ebx,-24(%edi)
+ rcrl %edx
+ movl %eax,-28(%edi)
+
+ leal -32(%esi),%esi C use leal not to clobber carry
+ leal -32(%edi),%edi
+ decl %ebp
+ jnz L(Loop)
+
+L(Lend):
+ popl %ebp
+ sbbl %eax,%eax C save carry in %eax
+ andl $7,%ebp
+ jz L(Lend2)
+ addl %eax,%eax C restore carry from eax
+L(Loop2):
+ movl %edx,%ebx
+ movl (%esi),%edx
+ rcrl %edx
+ movl %ebx,(%edi)
+
+ leal -4(%esi),%esi C use leal not to clobber carry
+ leal -4(%edi),%edi
+ decl %ebp
+ jnz L(Loop2)
+
+ jmp L(L1)
+L(Lend2):
+ addl %eax,%eax C restore carry from eax
+L(L1): movl %edx,(%edi) C store last limb
+
+ movl $0,%eax
+ rcrl %eax
+
+ popl %ebp
+ popl %ebx
+ popl %esi
+ popl %edi
+ ret
+
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium/sqr_basecase.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium/sqr_basecase.asm
new file mode 100644
index 00000000000..b11d767da2f
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium/sqr_basecase.asm
@@ -0,0 +1,528 @@
+dnl Intel P5 mpn_sqr_basecase -- square an mpn number.
+
+dnl Copyright 1999-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 P5: approx 8 cycles per crossproduct, or 15.5 cycles per triangular
+C product at around 20x20 limbs.
+
+
+C void mpn_sqr_basecase (mp_ptr dst, mp_srcptr src, mp_size_t size);
+C
+C Calculate src,size squared, storing the result in dst,2*size.
+C
+C The algorithm is basically the same as mpn/generic/sqr_basecase.c, but a
+C lot of function call overheads are avoided, especially when the size is
+C small.
+
+defframe(PARAM_SIZE,12)
+defframe(PARAM_SRC, 8)
+defframe(PARAM_DST, 4)
+
+ TEXT
+ ALIGN(8)
+PROLOGUE(mpn_sqr_basecase)
+deflit(`FRAME',0)
+
+ movl PARAM_SIZE, %edx
+ movl PARAM_SRC, %eax
+
+ cmpl $2, %edx
+ movl PARAM_DST, %ecx
+
+ je L(two_limbs)
+
+ movl (%eax), %eax
+ ja L(three_or_more)
+
+C -----------------------------------------------------------------------------
+C one limb only
+ C eax src
+ C ebx
+ C ecx dst
+ C edx
+
+ mull %eax
+
+ movl %eax, (%ecx)
+ movl %edx, 4(%ecx)
+
+ ret
+
+C -----------------------------------------------------------------------------
+ ALIGN(8)
+L(two_limbs):
+ C eax src
+ C ebx
+ C ecx dst
+ C edx size
+
+ pushl %ebp
+ pushl %edi
+
+ pushl %esi
+ pushl %ebx
+
+ movl %eax, %ebx
+ movl (%eax), %eax
+
+ mull %eax C src[0]^2
+
+ movl %eax, (%ecx) C dst[0]
+ movl %edx, %esi C dst[1]
+
+ movl 4(%ebx), %eax
+
+ mull %eax C src[1]^2
+
+ movl %eax, %edi C dst[2]
+ movl %edx, %ebp C dst[3]
+
+ movl (%ebx), %eax
+
+ mull 4(%ebx) C src[0]*src[1]
+
+ addl %eax, %esi
+ popl %ebx
+
+ adcl %edx, %edi
+
+ adcl $0, %ebp
+ addl %esi, %eax
+
+ adcl %edi, %edx
+ movl %eax, 4(%ecx)
+
+ adcl $0, %ebp
+ popl %esi
+
+ movl %edx, 8(%ecx)
+ movl %ebp, 12(%ecx)
+
+ popl %edi
+ popl %ebp
+
+ ret
+
+
+C -----------------------------------------------------------------------------
+ ALIGN(8)
+L(three_or_more):
+ C eax src low limb
+ C ebx
+ C ecx dst
+ C edx size
+
+ cmpl $4, %edx
+ pushl %ebx
+deflit(`FRAME',4)
+
+ movl PARAM_SRC, %ebx
+ jae L(four_or_more)
+
+
+C -----------------------------------------------------------------------------
+C three limbs
+ C eax src low limb
+ C ebx src
+ C ecx dst
+ C edx size
+
+ pushl %ebp
+ pushl %edi
+
+ mull %eax C src[0] ^ 2
+
+ movl %eax, (%ecx)
+ movl %edx, 4(%ecx)
+
+ movl 4(%ebx), %eax
+ xorl %ebp, %ebp
+
+ mull %eax C src[1] ^ 2
+
+ movl %eax, 8(%ecx)
+ movl %edx, 12(%ecx)
+
+ movl 8(%ebx), %eax
+ pushl %esi C risk of cache bank clash
+
+ mull %eax C src[2] ^ 2
+
+ movl %eax, 16(%ecx)
+ movl %edx, 20(%ecx)
+
+ movl (%ebx), %eax
+
+ mull 4(%ebx) C src[0] * src[1]
+
+ movl %eax, %esi
+ movl %edx, %edi
+
+ movl (%ebx), %eax
+
+ mull 8(%ebx) C src[0] * src[2]
+
+ addl %eax, %edi
+ movl %edx, %ebp
+
+ adcl $0, %ebp
+ movl 4(%ebx), %eax
+
+ mull 8(%ebx) C src[1] * src[2]
+
+ xorl %ebx, %ebx
+ addl %eax, %ebp
+
+ C eax
+ C ebx zero, will be dst[5]
+ C ecx dst
+ C edx dst[4]
+ C esi dst[1]
+ C edi dst[2]
+ C ebp dst[3]
+
+ adcl $0, %edx
+ addl %esi, %esi
+
+ adcl %edi, %edi
+
+ adcl %ebp, %ebp
+
+ adcl %edx, %edx
+ movl 4(%ecx), %eax
+
+ adcl $0, %ebx
+ addl %esi, %eax
+
+ movl %eax, 4(%ecx)
+ movl 8(%ecx), %eax
+
+ adcl %edi, %eax
+ movl 12(%ecx), %esi
+
+ adcl %ebp, %esi
+ movl 16(%ecx), %edi
+
+ movl %eax, 8(%ecx)
+ movl %esi, 12(%ecx)
+
+ adcl %edx, %edi
+ popl %esi
+
+ movl 20(%ecx), %eax
+ movl %edi, 16(%ecx)
+
+ popl %edi
+ popl %ebp
+
+ adcl %ebx, %eax C no carry out of this
+ popl %ebx
+
+ movl %eax, 20(%ecx)
+
+ ret
+
+
+C -----------------------------------------------------------------------------
+ ALIGN(8)
+L(four_or_more):
+ C eax src low limb
+ C ebx src
+ C ecx dst
+ C edx size
+ C esi
+ C edi
+ C ebp
+ C
+ C First multiply src[0]*src[1..size-1] and store at dst[1..size].
+
+deflit(`FRAME',4)
+
+ pushl %edi
+FRAME_pushl()
+ pushl %esi
+FRAME_pushl()
+
+ pushl %ebp
+FRAME_pushl()
+ leal (%ecx,%edx,4), %edi C dst end of this mul1
+
+ leal (%ebx,%edx,4), %esi C src end
+ movl %ebx, %ebp C src
+
+ negl %edx C -size
+ xorl %ebx, %ebx C clear carry limb and carry flag
+
+ leal 1(%edx), %ecx C -(size-1)
+
+L(mul1):
+ C eax scratch
+ C ebx carry
+ C ecx counter, negative
+ C edx scratch
+ C esi &src[size]
+ C edi &dst[size]
+ C ebp src
+
+ adcl $0, %ebx
+ movl (%esi,%ecx,4), %eax
+
+ mull (%ebp)
+
+ addl %eax, %ebx
+
+ movl %ebx, (%edi,%ecx,4)
+ incl %ecx
+
+ movl %edx, %ebx
+ jnz L(mul1)
+
+
+ C Add products src[n]*src[n+1..size-1] at dst[2*n-1...], for
+ C n=1..size-2.
+ C
+ C The last two products, which are the end corner of the product
+ C triangle, are handled separately to save looping overhead. These
+ C are src[size-3]*src[size-2,size-1] and src[size-2]*src[size-1].
+ C If size is 4 then it's only these that need to be done.
+ C
+ C In the outer loop %esi is a constant, and %edi just advances by 1
+ C limb each time. The size of the operation decreases by 1 limb
+ C each time.
+
+ C eax
+ C ebx carry (needing carry flag added)
+ C ecx
+ C edx
+ C esi &src[size]
+ C edi &dst[size]
+ C ebp
+
+ adcl $0, %ebx
+ movl PARAM_SIZE, %edx
+
+ movl %ebx, (%edi)
+ subl $4, %edx
+
+ negl %edx
+ jz L(corner)
+
+
+L(outer):
+ C ebx previous carry limb to store
+ C edx outer loop counter (negative)
+ C esi &src[size]
+ C edi dst, pointing at stored carry limb of previous loop
+
+ pushl %edx C new outer loop counter
+ leal -2(%edx), %ecx
+
+ movl %ebx, (%edi)
+ addl $4, %edi
+
+ addl $4, %ebp
+ xorl %ebx, %ebx C initial carry limb, clear carry flag
+
+L(inner):
+ C eax scratch
+ C ebx carry (needing carry flag added)
+ C ecx counter, negative
+ C edx scratch
+ C esi &src[size]
+ C edi dst end of this addmul
+ C ebp &src[j]
+
+ adcl $0, %ebx
+ movl (%esi,%ecx,4), %eax
+
+ mull (%ebp)
+
+ addl %ebx, %eax
+ movl (%edi,%ecx,4), %ebx
+
+ adcl $0, %edx
+ addl %eax, %ebx
+
+ movl %ebx, (%edi,%ecx,4)
+ incl %ecx
+
+ movl %edx, %ebx
+ jnz L(inner)
+
+
+ adcl $0, %ebx
+ popl %edx C outer loop counter
+
+ incl %edx
+ jnz L(outer)
+
+
+ movl %ebx, (%edi)
+
+L(corner):
+ C esi &src[size]
+ C edi &dst[2*size-4]
+
+ movl -8(%esi), %eax
+ movl -4(%edi), %ebx C risk of data cache bank clash here
+
+ mull -12(%esi) C src[size-2]*src[size-3]
+
+ addl %eax, %ebx
+ movl %edx, %ecx
+
+ adcl $0, %ecx
+ movl -4(%esi), %eax
+
+ mull -12(%esi) C src[size-1]*src[size-3]
+
+ addl %ecx, %eax
+ movl (%edi), %ecx
+
+ adcl $0, %edx
+ movl %ebx, -4(%edi)
+
+ addl %eax, %ecx
+ movl %edx, %ebx
+
+ adcl $0, %ebx
+ movl -4(%esi), %eax
+
+ mull -8(%esi) C src[size-1]*src[size-2]
+
+ movl %ecx, (%edi)
+ addl %eax, %ebx
+
+ adcl $0, %edx
+ movl PARAM_SIZE, %eax
+
+ negl %eax
+ movl %ebx, 4(%edi)
+
+ addl $1, %eax C -(size-1) and clear carry
+ movl %edx, 8(%edi)
+
+
+C -----------------------------------------------------------------------------
+C Left shift of dst[1..2*size-2], high bit shifted out becomes dst[2*size-1].
+
+L(lshift):
+ C eax counter, negative
+ C ebx next limb
+ C ecx
+ C edx
+ C esi
+ C edi &dst[2*size-4]
+ C ebp
+
+ movl 12(%edi,%eax,8), %ebx
+
+ rcll %ebx
+ movl 16(%edi,%eax,8), %ecx
+
+ rcll %ecx
+ movl %ebx, 12(%edi,%eax,8)
+
+ movl %ecx, 16(%edi,%eax,8)
+ incl %eax
+
+ jnz L(lshift)
+
+
+ adcl %eax, %eax C high bit out
+ movl PARAM_SRC, %esi
+
+ movl PARAM_SIZE, %ecx C risk of cache bank clash
+ movl %eax, 12(%edi) C dst most significant limb
+
+
+C -----------------------------------------------------------------------------
+C Now add in the squares on the diagonal, namely src[0]^2, src[1]^2, ...,
+C src[size-1]^2. dst[0] hasn't yet been set at all yet, and just gets the
+C low limb of src[0]^2.
+
+ movl (%esi), %eax C src[0]
+ leal (%esi,%ecx,4), %esi C src end
+
+ negl %ecx
+
+ mull %eax
+
+ movl %eax, 16(%edi,%ecx,8) C dst[0]
+ movl %edx, %ebx
+
+ addl $1, %ecx C size-1 and clear carry
+
+L(diag):
+ C eax scratch (low product)
+ C ebx carry limb
+ C ecx counter, negative
+ C edx scratch (high product)
+ C esi &src[size]
+ C edi &dst[2*size-4]
+ C ebp scratch (fetched dst limbs)
+
+ movl (%esi,%ecx,4), %eax
+ adcl $0, %ebx
+
+ mull %eax
+
+ movl 16-4(%edi,%ecx,8), %ebp
+
+ addl %ebp, %ebx
+ movl 16(%edi,%ecx,8), %ebp
+
+ adcl %eax, %ebp
+ movl %ebx, 16-4(%edi,%ecx,8)
+
+ movl %ebp, 16(%edi,%ecx,8)
+ incl %ecx
+
+ movl %edx, %ebx
+ jnz L(diag)
+
+
+ adcl $0, %edx
+ movl 16-4(%edi), %eax C dst most significant limb
+
+ addl %eax, %edx
+ popl %ebp
+
+ movl %edx, 16-4(%edi)
+ popl %esi C risk of cache bank clash
+
+ popl %edi
+ popl %ebx
+
+ ret
+
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium4/README b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium4/README
new file mode 100644
index 00000000000..90f752e5d5a
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium4/README
@@ -0,0 +1,124 @@
+Copyright 2001 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/.
+
+
+
+
+ INTEL PENTIUM-4 MPN SUBROUTINES
+
+
+This directory contains mpn functions optimized for Intel Pentium-4.
+
+The mmx subdirectory has routines using MMX instructions, the sse2
+subdirectory has routines using SSE2 instructions. All P4s have these, the
+separate directories are just so configure can omit that code if the
+assembler doesn't support it.
+
+
+STATUS
+
+ cycles/limb
+
+ mpn_add_n/sub_n 4 normal, 6 in-place
+
+ mpn_mul_1 4 normal, 6 in-place
+ mpn_addmul_1 6
+ mpn_submul_1 7
+
+ mpn_mul_basecase 6 cycles/crossproduct (approx)
+
+ mpn_sqr_basecase 3.5 cycles/crossproduct (approx)
+ or 7.0 cycles/triangleproduct (approx)
+
+ mpn_l/rshift 1.75
+
+
+
+The shifts ought to be able to go at 1.5 c/l, but not much effort has been
+applied to them yet.
+
+In-place operations, and all addmul, submul, mul_basecase and sqr_basecase
+calls, suffer from pipeline anomalies associated with write combining and
+movd reads and writes to the same or nearby locations. The movq
+instructions do not trigger the same hardware problems. Unfortunately,
+using movq and splitting/combining seems to require too many extra
+instructions to help. Perhaps future chip steppings will be better.
+
+
+
+NOTES
+
+The Pentium-4 pipeline "Netburst", provides for quite a number of surprises.
+Many traditional x86 instructions run very slowly, requiring use of
+alterative instructions for acceptable performance.
+
+adcl and sbbl are quite slow at 8 cycles for reg->reg. paddq of 32-bits
+within a 64-bit mmx register seems better, though the combination
+paddq/psrlq when propagating a carry is still a 4 cycle latency.
+
+incl and decl should be avoided, instead use add $1 and sub $1. Apparently
+the carry flag is not separately renamed, so incl and decl depend on all
+previous flags-setting instructions.
+
+shll and shrl have a 4 cycle latency, or 8 times the latency of the fastest
+integer instructions (addl, subl, orl, andl, and some more). shldl and
+shrdl seem to have 13 and 15 cycles latency, respectively. Bizarre.
+
+movq mmx -> mmx does have 6 cycle latency, as noted in the documentation.
+pxor/por or similar combination at 2 cycles latency can be used instead.
+The movq however executes in the float unit, thereby saving MMX execution
+resources. With the right juggling, data moves shouldn't be on a dependent
+chain.
+
+L1 is write-through, but the write-combining sounds like it does enough to
+not require explicit destination prefetching.
+
+xmm registers so far haven't found a use, but not much effort has been
+expended. A configure test for whether the operating system knows
+fxsave/fxrestor will be needed if they're used.
+
+
+
+REFERENCES
+
+Intel Pentium-4 processor manuals,
+
+ http://developer.intel.com/design/pentium4/manuals
+
+"Intel Pentium 4 Processor Optimization Reference Manual", Intel, 2001,
+order number 248966. Available on-line:
+
+ http://developer.intel.com/design/pentium4/manuals/248966.htm
+
+
+
+----------------
+Local variables:
+mode: text
+fill-column: 76
+End:
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium4/copyd.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium4/copyd.asm
new file mode 100644
index 00000000000..82af81c522b
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium4/copyd.asm
@@ -0,0 +1,71 @@
+dnl Pentium-4 mpn_copyd -- copy limb vector, decrementing.
+
+dnl Copyright 1999-2001 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 The std/rep/movsl/cld is very slow for small blocks on pentium4. Its
+dnl startup time seems to be about 165 cycles. It then needs 2.6 c/l.
+dnl We therefore use an open-coded 2 c/l copying loop.
+
+dnl Ultimately, we may want to use 64-bit movq or 128-bit movdqu in some
+dnl nifty unrolled arrangement. Clearly, that could reach much higher
+dnl speeds, at least for large blocks.
+
+include(`../config.m4')
+
+
+defframe(PARAM_SIZE, 12)
+defframe(PARAM_SRC, 8)
+defframe(PARAM_DST, 4)
+
+ TEXT
+ ALIGN(8)
+
+PROLOGUE(mpn_copyd)
+deflit(`FRAME',0)
+
+ movl PARAM_SIZE, %ecx
+
+ movl PARAM_SRC, %eax
+ movl PARAM_DST, %edx
+ movl %ebx, PARAM_SIZE
+ addl $-1, %ecx
+ js L(end)
+
+L(loop):
+ movl (%eax,%ecx,4), %ebx
+ movl %ebx, (%edx,%ecx,4)
+ addl $-1, %ecx
+
+ jns L(loop)
+L(end):
+ movl PARAM_SIZE, %ebx
+ ret
+
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium4/copyi.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium4/copyi.asm
new file mode 100644
index 00000000000..b6148879fa4
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium4/copyi.asm
@@ -0,0 +1,93 @@
+dnl Pentium-4 mpn_copyi -- copy limb vector, incrementing.
+
+dnl Copyright 1999-2001 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 The rep/movsl is very slow for small blocks on pentium4. Its startup
+dnl time seems to be about 110 cycles. It then copies at a rate of one
+dnl limb per cycle. We therefore fall back to an open-coded 2 c/l copying
+dnl loop for smaller sizes.
+
+dnl Ultimately, we may want to use 64-bit movd or 128-bit movdqu in some
+dnl nifty unrolled arrangement. Clearly, that could reach much higher
+dnl speeds, at least for large blocks.
+
+include(`../config.m4')
+
+
+defframe(PARAM_SIZE, 12)
+defframe(PARAM_SRC, 8)
+defframe(PARAM_DST, 4)
+
+ TEXT
+ ALIGN(8)
+
+PROLOGUE(mpn_copyi)
+deflit(`FRAME',0)
+
+ movl PARAM_SIZE, %ecx
+ cmpl $150, %ecx
+ jg L(replmovs)
+
+ movl PARAM_SRC, %eax
+ movl PARAM_DST, %edx
+ movl %ebx, PARAM_SIZE
+ testl %ecx, %ecx
+ jz L(end)
+
+L(loop):
+ movl (%eax), %ebx
+ leal 4(%eax), %eax
+ addl $-1, %ecx
+ movl %ebx, (%edx)
+ leal 4(%edx), %edx
+
+ jnz L(loop)
+
+L(end):
+ movl PARAM_SIZE, %ebx
+ ret
+
+L(replmovs):
+ cld C better safe than sorry, see mpn/x86/README
+
+ movl %esi, %eax
+ movl PARAM_SRC, %esi
+ movl %edi, %edx
+ movl PARAM_DST, %edi
+
+ rep
+ movsl
+
+ movl %eax, %esi
+ movl %edx, %edi
+
+ ret
+
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium4/mmx/lshift.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium4/mmx/lshift.asm
new file mode 100644
index 00000000000..b5eca66698d
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium4/mmx/lshift.asm
@@ -0,0 +1,39 @@
+dnl Intel Pentium-4 mpn_lshift -- left shift.
+
+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/.
+
+include(`../config.m4')
+
+
+C P4 Willamette, Northwood: 1.75 cycles/limb
+C P4 Prescott: 2.0 cycles/limb
+
+
+MULFUNC_PROLOGUE(mpn_lshift)
+include_mpn(`x86/pentium/mmx/lshift.asm')
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium4/mmx/popham.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium4/mmx/popham.asm
new file mode 100644
index 00000000000..9563cb57e49
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium4/mmx/popham.asm
@@ -0,0 +1,203 @@
+dnl Intel Pentium 4 mpn_popcount, mpn_hamdist -- population count and
+dnl hamming distance.
+
+dnl Copyright 2000-2002, 2007 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 popcount hamdist
+C P3 model 9 (Banias) ? ?
+C P3 model 13 (Dothan) 6 6
+C P4 model 0 (Willamette)
+C P4 model 1 (?)
+C P4 model 2 (Northwood) 8 9
+C P4 model 3 (Prescott) 8 9
+C P4 model 4 (Nocona)
+
+C unsigned long mpn_popcount (mp_srcptr src, mp_size_t size);
+C unsigned long mpn_hamdist (mp_srcptr src, mp_srcptr src2, mp_size_t size);
+C
+C Loading with unaligned movq's costs an extra 1 c/l and hence is avoided.
+C Two movd's and a punpckldq seems to be the same speed as an aligned movq,
+C and using them saves fiddling about with alignment testing on entry.
+C
+C For popcount there's 13 mmx instructions in the loop, so perhaps 6.5 c/l
+C might be possible, but 8 c/l relying on out-of-order execution is already
+C quite reasonable.
+
+ifdef(`OPERATION_popcount',,
+`ifdef(`OPERATION_hamdist',,
+`m4_error(`Need OPERATION_popcount or OPERATION_hamdist defined
+')')')
+
+define(HAM,
+m4_assert_numargs(1)
+`ifdef(`OPERATION_hamdist',`$1')')
+
+define(POP,
+m4_assert_numargs(1)
+`ifdef(`OPERATION_popcount',`$1')')
+
+HAM(`
+defframe(PARAM_SIZE, 12)
+defframe(PARAM_SRC2, 8)
+defframe(PARAM_SRC, 4)
+define(M4_function,mpn_hamdist)
+')
+POP(`
+defframe(PARAM_SIZE, 8)
+defframe(PARAM_SRC, 4)
+define(M4_function,mpn_popcount)
+')
+
+MULFUNC_PROLOGUE(mpn_popcount mpn_hamdist)
+
+
+ifdef(`PIC',,`
+ dnl non-PIC
+ RODATA
+ ALIGN(8)
+L(rodata_AAAAAAAAAAAAAAAA):
+ .long 0xAAAAAAAA
+ .long 0xAAAAAAAA
+L(rodata_3333333333333333):
+ .long 0x33333333
+ .long 0x33333333
+L(rodata_0F0F0F0F0F0F0F0F):
+ .long 0x0F0F0F0F
+ .long 0x0F0F0F0F
+')
+
+ TEXT
+ ALIGN(16)
+
+PROLOGUE(M4_function)
+deflit(`FRAME',0)
+
+ movl PARAM_SIZE, %ecx
+ movl PARAM_SRC, %eax
+
+ifdef(`PIC',`
+ movl $0xAAAAAAAA, %edx
+ movd %edx, %mm7
+ punpckldq %mm7, %mm7
+
+ movl $0x33333333, %edx
+ movd %edx, %mm6
+ punpckldq %mm6, %mm6
+
+ movl $0x0F0F0F0F, %edx
+ movd %edx, %mm5
+ punpckldq %mm5, %mm5
+
+HAM(` movl PARAM_SRC2, %edx')
+
+',`
+ dnl non-PIC
+HAM(` movl PARAM_SRC2, %edx')
+ movq L(rodata_AAAAAAAAAAAAAAAA), %mm7
+ movq L(rodata_3333333333333333), %mm6
+ movq L(rodata_0F0F0F0F0F0F0F0F), %mm5
+')
+
+ pxor %mm4, %mm4 C zero
+ pxor %mm0, %mm0 C total
+
+ subl $1, %ecx
+ ja L(top)
+
+L(last):
+ movd (%eax,%ecx,4), %mm1 C src high limb
+HAM(` movd (%edx,%ecx,4), %mm2
+ pxor %mm2, %mm1
+')
+ jmp L(loaded)
+
+
+L(top):
+ C eax src
+ C ebx
+ C ecx counter, size-1 to 2 or 1, inclusive
+ C edx [hamdist] src2
+ C
+ C mm0 total (low dword)
+ C mm1 (scratch)
+ C mm2 (scratch)
+ C mm3
+ C mm4 0x0000000000000000
+ C mm5 0x0F0F0F0F0F0F0F0F
+ C mm6 0x3333333333333333
+ C mm7 0xAAAAAAAAAAAAAAAA
+
+ movd (%eax), %mm1
+ movd 4(%eax), %mm2
+ punpckldq %mm2, %mm1
+ addl $8, %eax
+
+HAM(` movd (%edx), %mm2
+ movd 4(%edx), %mm3
+ punpckldq %mm3, %mm2
+ pxor %mm2, %mm1
+ addl $8, %edx
+')
+
+L(loaded):
+ movq %mm7, %mm2
+ pand %mm1, %mm2
+ psrlq $1, %mm2
+ psubd %mm2, %mm1 C bit pairs
+
+ movq %mm6, %mm2
+ pand %mm1, %mm2
+ psrlq $2, %mm1
+ pand %mm6, %mm1
+ paddd %mm2, %mm1 C nibbles
+
+ movq %mm5, %mm2
+ pand %mm1, %mm2
+ psrlq $4, %mm1
+ pand %mm5, %mm1
+ paddd %mm2, %mm1 C bytes
+
+ psadbw( %mm4, %mm1)
+ paddd %mm1, %mm0 C to total
+
+ subl $2, %ecx
+ jg L(top)
+
+ C ecx is 0 or -1 representing respectively 1 or 0 further limbs
+ jz L(last)
+
+
+ movd %mm0, %eax
+ emms
+ ret
+
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium4/mmx/rshift.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium4/mmx/rshift.asm
new file mode 100644
index 00000000000..3ac0094a5a0
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium4/mmx/rshift.asm
@@ -0,0 +1,39 @@
+dnl Intel Pentium-4 mpn_rshift -- right shift.
+
+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/.
+
+include(`../config.m4')
+
+
+C P4 Willamette, Northwood: 1.75 cycles/limb
+C P4 Prescott: 2.0 cycles/limb
+
+
+MULFUNC_PROLOGUE(mpn_rshift)
+include_mpn(`x86/pentium/mmx/rshift.asm')
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium4/sse2/add_n.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium4/sse2/add_n.asm
new file mode 100644
index 00000000000..8e2380e4931
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium4/sse2/add_n.asm
@@ -0,0 +1,101 @@
+dnl Intel Pentium-4 mpn_add_n -- mpn addition.
+
+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/.
+
+include(`../config.m4')
+
+
+C cycles/limb
+C dst!=src1,2 dst==src1 dst==src2
+C P6 model 0-8,10-12 -
+C P6 model 9 (Banias) ?
+C P6 model 13 (Dothan) ?
+C P4 model 0-1 (Willamette) ?
+C P4 model 2 (Northwood) 4 6 6
+C P4 model 3-4 (Prescott) 4.25 7.5 7.5
+
+defframe(PARAM_CARRY,20)
+defframe(PARAM_SIZE, 16)
+defframe(PARAM_SRC2, 12)
+defframe(PARAM_SRC1, 8)
+defframe(PARAM_DST, 4)
+
+dnl re-use parameter space
+define(SAVE_EBX,`PARAM_SRC1')
+
+ TEXT
+ ALIGN(8)
+
+PROLOGUE(mpn_add_nc)
+deflit(`FRAME',0)
+ movd PARAM_CARRY, %mm0
+ jmp L(start_nc)
+EPILOGUE()
+
+ ALIGN(8)
+PROLOGUE(mpn_add_n)
+deflit(`FRAME',0)
+ pxor %mm0, %mm0
+L(start_nc):
+ mov PARAM_SRC1, %eax
+ mov %ebx, SAVE_EBX
+ mov PARAM_SRC2, %ebx
+ mov PARAM_DST, %edx
+ mov PARAM_SIZE, %ecx
+
+ lea (%eax,%ecx,4), %eax C src1 end
+ lea (%ebx,%ecx,4), %ebx C src2 end
+ lea (%edx,%ecx,4), %edx C dst end
+ neg %ecx C -size
+
+L(top):
+ C eax src1 end
+ C ebx src2 end
+ C ecx counter, limbs, negative
+ C edx dst end
+ C mm0 carry bit
+
+ movd (%eax,%ecx,4), %mm1
+ movd (%ebx,%ecx,4), %mm2
+ paddq %mm2, %mm1
+
+ paddq %mm1, %mm0
+ movd %mm0, (%edx,%ecx,4)
+
+ psrlq $32, %mm0
+
+ add $1, %ecx
+ jnz L(top)
+
+ movd %mm0, %eax
+ mov SAVE_EBX, %ebx
+ emms
+ ret
+
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium4/sse2/addlsh1_n.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium4/sse2/addlsh1_n.asm
new file mode 100644
index 00000000000..93b63b2018d
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium4/sse2/addlsh1_n.asm
@@ -0,0 +1,108 @@
+dnl Intel Pentium-4 mpn_addlsh1_n -- mpn x+2*y.
+
+dnl Copyright 2001-2004, 2006 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 dst!=src1,2 dst==src1 dst==src2
+C P6 model 0-8,10-12 -
+C P6 model 9 (Banias) ?
+C P6 model 13 (Dothan) ?
+C P4 model 0-1 (Willamette) ?
+C P4 model 2 (Northwood) 4.25 6 6
+C P4 model 3-4 (Prescott) 5 8.5 8.5
+
+C The slightly strange combination of indexing and pointer incrementing
+C that's used seems to work best. Not sure why, but %ecx,4 with src1 and/or
+C src2 is a slowdown.
+C
+C The dependent chain is simply the paddq of x+2*y to the previous carry,
+C then psrlq to get the new carry. That makes 4 c/l the target speed, which
+C is almost achieved for separate src/dst but when src==dst the write
+C combining anomalies slow it down.
+
+defframe(PARAM_SIZE, 16)
+defframe(PARAM_SRC2, 12)
+defframe(PARAM_SRC1, 8)
+defframe(PARAM_DST, 4)
+
+dnl re-use parameter space
+define(SAVE_EBX,`PARAM_SRC1')
+
+ TEXT
+ ALIGN(8)
+
+PROLOGUE(mpn_addlsh1_n)
+deflit(`FRAME',0)
+
+ mov PARAM_SRC1, %eax
+ mov %ebx, SAVE_EBX
+
+ mov PARAM_SRC2, %ebx
+ pxor %mm0, %mm0 C initial carry
+
+ mov PARAM_DST, %edx
+
+ mov PARAM_SIZE, %ecx
+
+ lea (%edx,%ecx,4), %edx C dst end
+ neg %ecx C -size
+
+L(top):
+ C eax src1 end
+ C ebx src2 end
+ C ecx counter, limbs, negative
+ C edx dst end
+ C mm0 carry
+
+ movd (%ebx), %mm2
+ movd (%eax), %mm1
+ psrlq $32, %mm0
+ lea 4(%eax), %eax
+ lea 4(%ebx), %ebx
+
+ psllq $1, %mm2
+ paddq %mm2, %mm1
+
+ paddq %mm1, %mm0
+
+ movd %mm0, (%edx,%ecx,4)
+ add $1, %ecx
+ jnz L(top)
+
+
+ psrlq $32, %mm0
+ mov SAVE_EBX, %ebx
+ movd %mm0, %eax
+ emms
+ ret
+
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium4/sse2/addmul_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium4/sse2/addmul_1.asm
new file mode 100644
index 00000000000..78102072bfc
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium4/sse2/addmul_1.asm
@@ -0,0 +1,189 @@
+dnl mpn_addmul_1 for Pentium 4 and P6 models with SSE2 (i.e., 9,D,E,F).
+
+dnl Copyright 2005, 2007, 2011 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 P6 model 0-8,10-12 -
+C P6 model 9 (Banias) 5.24
+C P6 model 13 (Dothan) 5.24
+C P4 model 0-1 (Willamette) 5
+C P4 model 2 (Northwood) 5
+C P4 model 3-4 (Prescott) 5
+
+C TODO:
+C * Tweak eax/edx offsets in loop as to save some lea's
+C * Perhaps software pipeline small-case code
+
+C INPUT PARAMETERS
+C rp sp + 4
+C up sp + 8
+C n sp + 12
+C v0 sp + 16
+
+ TEXT
+ ALIGN(16)
+PROLOGUE(mpn_addmul_1)
+ pxor %mm6, %mm6
+L(ent): mov 4(%esp), %edx
+ mov 8(%esp), %eax
+ mov 12(%esp), %ecx
+ movd 16(%esp), %mm7
+ cmp $4, %ecx
+ jnc L(big)
+
+L(lp0): movd (%eax), %mm0
+ lea 4(%eax), %eax
+ movd (%edx), %mm4
+ lea 4(%edx), %edx
+ pmuludq %mm7, %mm0
+ paddq %mm0, %mm4
+ paddq %mm4, %mm6
+ movd %mm6, -4(%edx)
+ psrlq $32, %mm6
+ dec %ecx
+ jnz L(lp0)
+ movd %mm6, %eax
+ emms
+ ret
+
+L(big): and $3, %ecx
+ je L(0)
+ cmp $2, %ecx
+ jc L(1)
+ je L(2)
+ jmp L(3) C FIXME: one case should fall through
+
+L(0): movd (%eax), %mm3
+ sub 12(%esp), %ecx C loop count
+ lea -16(%eax), %eax
+ lea -12(%edx), %edx
+ pmuludq %mm7, %mm3
+ movd 20(%eax), %mm0
+ movd 12(%edx), %mm5
+ pmuludq %mm7, %mm0
+ movd 24(%eax), %mm1
+ paddq %mm3, %mm5
+ movd 16(%edx), %mm4
+ jmp L(00)
+
+L(1): movd (%eax), %mm2
+ sub 12(%esp), %ecx
+ lea -12(%eax), %eax
+ lea -8(%edx), %edx
+ movd 8(%edx), %mm4
+ pmuludq %mm7, %mm2
+ movd 16(%eax), %mm3
+ pmuludq %mm7, %mm3
+ movd 20(%eax), %mm0
+ paddq %mm2, %mm4
+ movd 12(%edx), %mm5
+ jmp L(01)
+
+L(2): movd (%eax), %mm1
+ sub 12(%esp), %ecx
+ lea -8(%eax), %eax
+ lea -4(%edx), %edx
+ pmuludq %mm7, %mm1
+ movd 12(%eax), %mm2
+ movd 4(%edx), %mm5
+ pmuludq %mm7, %mm2
+ movd 16(%eax), %mm3
+ paddq %mm1, %mm5
+ movd 8(%edx), %mm4
+ jmp L(10)
+
+L(3): movd (%eax), %mm0
+ sub 12(%esp), %ecx
+ lea -4(%eax), %eax
+ pmuludq %mm7, %mm0
+ movd 8(%eax), %mm1
+ movd (%edx), %mm4
+ pmuludq %mm7, %mm1
+ movd 12(%eax), %mm2
+ paddq %mm0, %mm4
+ movd 4(%edx), %mm5
+
+ ALIGN(16)
+L(top): pmuludq %mm7, %mm2
+ paddq %mm4, %mm6
+ movd 16(%eax), %mm3
+ paddq %mm1, %mm5
+ movd 8(%edx), %mm4
+ movd %mm6, 0(%edx)
+ psrlq $32, %mm6
+L(10): pmuludq %mm7, %mm3
+ paddq %mm5, %mm6
+ movd 20(%eax), %mm0
+ paddq %mm2, %mm4
+ movd 12(%edx), %mm5
+ movd %mm6, 4(%edx)
+ psrlq $32, %mm6
+L(01): pmuludq %mm7, %mm0
+ paddq %mm4, %mm6
+ movd 24(%eax), %mm1
+ paddq %mm3, %mm5
+ movd 16(%edx), %mm4
+ movd %mm6, 8(%edx)
+ psrlq $32, %mm6
+L(00): pmuludq %mm7, %mm1
+ paddq %mm5, %mm6
+ movd 28(%eax), %mm2
+ paddq %mm0, %mm4
+ movd 20(%edx), %mm5
+ movd %mm6, 12(%edx)
+ psrlq $32, %mm6
+ lea 16(%eax), %eax
+ lea 16(%edx), %edx
+ add $4, %ecx
+ jnz L(top)
+
+L(end): pmuludq %mm7, %mm2
+ paddq %mm4, %mm6
+ paddq %mm1, %mm5
+ movd 8(%edx), %mm4
+ movd %mm6, 0(%edx)
+ psrlq $32, %mm6
+ paddq %mm5, %mm6
+ paddq %mm2, %mm4
+ movd %mm6, 4(%edx)
+ psrlq $32, %mm6
+ paddq %mm4, %mm6
+ movd %mm6, 8(%edx)
+ psrlq $32, %mm6
+ movd %mm6, %eax
+ emms
+ ret
+EPILOGUE()
+PROLOGUE(mpn_addmul_1c)
+ movd 20(%esp), %mm6
+ jmp L(ent)
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium4/sse2/bdiv_dbm1c.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium4/sse2/bdiv_dbm1c.asm
new file mode 100644
index 00000000000..354300e4de1
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium4/sse2/bdiv_dbm1c.asm
@@ -0,0 +1,141 @@
+dnl Intel Atom mpn_bdiv_dbm1.
+
+dnl Contributed to the GNU project by Torbjorn Granlund and Marco Bodrato.
+
+dnl Copyright 2011 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 cycles/limb
+C P5 -
+C P6 model 0-8,10-12 -
+C P6 model 9 (Banias) 9.75
+C P6 model 13 (Dothan)
+C P4 model 0 (Willamette)
+C P4 model 1 (?)
+C P4 model 2 (Northwood) 8.25
+C P4 model 3 (Prescott)
+C P4 model 4 (Nocona)
+C Intel Atom 8
+C AMD K6 -
+C AMD K7 -
+C AMD K8
+C AMD K10
+
+C TODO: This code was optimised for atom-32, consider moving it back to atom
+C dir(atom currently grabs this code), and write a 4-way version(7c/l).
+
+defframe(PARAM_CARRY,20)
+defframe(PARAM_MUL, 16)
+defframe(PARAM_SIZE, 12)
+defframe(PARAM_SRC, 8)
+defframe(PARAM_DST, 4)
+
+dnl re-use parameter space
+define(SAVE_RP,`PARAM_MUL')
+define(SAVE_UP,`PARAM_SIZE')
+
+define(`rp', `%edi')
+define(`up', `%esi')
+define(`n', `%ecx')
+define(`reg', `%edx')
+define(`cy', `%eax') C contains the return value
+
+ASM_START()
+ TEXT
+ ALIGN(16)
+deflit(`FRAME',0)
+
+PROLOGUE(mpn_bdiv_dbm1c)
+ mov PARAM_SIZE, n C size
+ mov up, SAVE_UP
+ mov PARAM_SRC, up
+ movd PARAM_MUL, %mm7
+ mov rp, SAVE_RP
+ mov PARAM_DST, rp
+
+ movd (up), %mm0
+ pmuludq %mm7, %mm0
+ shr n
+ mov PARAM_CARRY, cy
+ jz L(eq1)
+
+ movd 4(up), %mm1
+ jc L(odd)
+
+ lea 4(up), up
+ pmuludq %mm7, %mm1
+ movd %mm0, reg
+ psrlq $32, %mm0
+ sub reg, cy
+ movd %mm0, reg
+ movq %mm1, %mm0
+ dec n
+ mov cy, (rp)
+ lea 4(rp), rp
+ jz L(end)
+
+C ALIGN(16)
+L(top): movd 4(up), %mm1
+ sbb reg, cy
+L(odd): movd %mm0, reg
+ psrlq $32, %mm0
+ pmuludq %mm7, %mm1
+ sub reg, cy
+ lea 8(up), up
+ movd %mm0, reg
+ movd (up), %mm0
+ mov cy, (rp)
+ sbb reg, cy
+ movd %mm1, reg
+ psrlq $32, %mm1
+ sub reg, cy
+ movd %mm1, reg
+ pmuludq %mm7, %mm0
+ dec n
+ mov cy, 4(rp)
+ lea 8(rp), rp
+ jnz L(top)
+
+L(end): sbb reg, cy
+
+L(eq1): movd %mm0, reg
+ psrlq $32, %mm0
+ mov SAVE_UP, up
+ sub reg, cy
+ movd %mm0, reg
+ emms
+ mov cy, (rp)
+ sbb reg, cy
+
+ mov SAVE_RP, rp
+ ret
+EPILOGUE()
+ASM_END()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium4/sse2/bdiv_q_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium4/sse2/bdiv_q_1.asm
new file mode 100644
index 00000000000..f7f461d56f0
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium4/sse2/bdiv_q_1.asm
@@ -0,0 +1,233 @@
+dnl Intel Pentium-4 mpn_divexact_1 -- mpn by limb exact division.
+
+dnl Rearranged from mpn/x86/pentium4/sse2/dive_1.asm by Marco Bodrato.
+
+dnl Copyright 2001, 2002, 2007, 2011 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 P4: 19.0 cycles/limb
+
+C Pairs of movd's are used to avoid unaligned loads. Despite the loads not
+C being on the dependent chain and there being plenty of cycles available,
+C using an unaligned movq on every second iteration measured about 23 c/l.
+C
+
+defframe(PARAM_SHIFT, 24)
+defframe(PARAM_INVERSE,20)
+defframe(PARAM_DIVISOR,16)
+defframe(PARAM_SIZE, 12)
+defframe(PARAM_SRC, 8)
+defframe(PARAM_DST, 4)
+
+ TEXT
+
+C mp_limb_t
+C mpn_pi1_bdiv_q_1 (mp_ptr dst, mp_srcptr src, mp_size_t size, mp_limb_t divisor,
+C mp_limb_t inverse, int shift)
+ ALIGN(32)
+PROLOGUE(mpn_pi1_bdiv_q_1)
+deflit(`FRAME',0)
+
+ movl PARAM_SIZE, %edx
+
+ movl PARAM_SRC, %eax
+
+ movl PARAM_DIVISOR, %ecx
+
+ movd %ecx, %mm6
+ movl PARAM_SHIFT, %ecx
+
+ movd %ecx, %mm7 C shift
+
+ C
+
+ movl PARAM_INVERSE, %ecx
+ movd %ecx, %mm5 C inv
+
+ movl PARAM_DST, %ecx
+ pxor %mm1, %mm1 C initial carry limb
+ pxor %mm0, %mm0 C initial carry bit
+
+ subl $1, %edx
+ jz L(done)
+
+ pcmpeqd %mm4, %mm4
+ psrlq $32, %mm4 C 0x00000000FFFFFFFF
+
+C The dependent chain here is as follows.
+C
+C latency
+C psubq s = (src-cbit) - climb 2
+C pmuludq q = s*inverse 8
+C pmuludq prod = q*divisor 8
+C psrlq climb = high(prod) 2
+C --
+C 20
+C
+C Yet the loop measures 19.0 c/l, so obviously there's something gained
+C there over a straight reading of the chip documentation.
+
+L(top):
+ C eax src, incrementing
+ C ebx
+ C ecx dst, incrementing
+ C edx counter, size-1 iterations
+ C
+ C mm0 carry bit
+ C mm1 carry limb
+ C mm4 0x00000000FFFFFFFF
+ C mm5 inverse
+ C mm6 divisor
+ C mm7 shift
+
+ movd (%eax), %mm2
+ movd 4(%eax), %mm3
+ addl $4, %eax
+ punpckldq %mm3, %mm2
+
+ psrlq %mm7, %mm2
+ pand %mm4, %mm2 C src
+ psubq %mm0, %mm2 C src - cbit
+
+ psubq %mm1, %mm2 C src - cbit - climb
+ movq %mm2, %mm0
+ psrlq $63, %mm0 C new cbit
+
+ pmuludq %mm5, %mm2 C s*inverse
+ movd %mm2, (%ecx) C q
+ addl $4, %ecx
+
+ movq %mm6, %mm1
+ pmuludq %mm2, %mm1 C q*divisor
+ psrlq $32, %mm1 C new climb
+
+L(entry):
+ subl $1, %edx
+ jnz L(top)
+
+L(done):
+ movd (%eax), %mm2
+ psrlq %mm7, %mm2 C src
+ psubq %mm0, %mm2 C src - cbit
+
+ psubq %mm1, %mm2 C src - cbit - climb
+
+ pmuludq %mm5, %mm2 C s*inverse
+ movd %mm2, (%ecx) C q
+
+ emms
+ ret
+
+EPILOGUE()
+
+ ALIGN(16)
+C mp_limb_t mpn_bdiv_q_1 (mp_ptr dst, mp_srcptr src, mp_size_t size,
+C mp_limb_t divisor);
+C
+PROLOGUE(mpn_bdiv_q_1)
+deflit(`FRAME',0)
+
+ movl PARAM_SIZE, %edx
+
+ movl PARAM_DIVISOR, %ecx
+
+ C eax src
+ C ebx
+ C ecx divisor
+ C edx size-1
+
+ movl %ecx, %eax
+ bsfl %ecx, %ecx C trailing twos
+
+ shrl %cl, %eax C d = divisor without twos
+ movd %eax, %mm6
+ movd %ecx, %mm7 C shift
+
+ shrl %eax C d/2
+
+ andl $127, %eax C d/2, 7 bits
+
+ifdef(`PIC',`
+ LEA( binvert_limb_table, %ecx)
+ movzbl (%eax,%ecx), %eax C inv 8 bits
+',`
+ movzbl binvert_limb_table(%eax), %eax C inv 8 bits
+')
+
+ C
+
+ movd %eax, %mm5 C inv
+
+ movd %eax, %mm0 C inv
+
+ pmuludq %mm5, %mm5 C inv*inv
+
+ C
+
+ pmuludq %mm6, %mm5 C inv*inv*d
+ paddd %mm0, %mm0 C 2*inv
+
+ C
+
+ psubd %mm5, %mm0 C inv = 2*inv - inv*inv*d
+ pxor %mm5, %mm5
+
+ paddd %mm0, %mm5
+ pmuludq %mm0, %mm0 C inv*inv
+
+ pcmpeqd %mm4, %mm4
+ psrlq $32, %mm4 C 0x00000000FFFFFFFF
+
+ C
+
+ pmuludq %mm6, %mm0 C inv*inv*d
+ paddd %mm5, %mm5 C 2*inv
+
+ movl PARAM_SRC, %eax
+ movl PARAM_DST, %ecx
+ pxor %mm1, %mm1 C initial carry limb
+
+ C
+
+ psubd %mm0, %mm5 C inv = 2*inv - inv*inv*d
+
+ ASSERT(e,` C expect d*inv == 1 mod 2^GMP_LIMB_BITS
+ pushl %eax FRAME_pushl()
+ movq %mm6, %mm0
+ pmuludq %mm5, %mm0
+ movd %mm0, %eax
+ cmpl $1, %eax
+ popl %eax FRAME_popl()')
+
+ pxor %mm0, %mm0 C initial carry bit
+ jmp L(entry)
+
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium4/sse2/cnd_add_n.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium4/sse2/cnd_add_n.asm
new file mode 100644
index 00000000000..b3f3474e675
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium4/sse2/cnd_add_n.asm
@@ -0,0 +1,95 @@
+dnl Intel Pentium-4 mpn_cnd_add_n -- mpn addition.
+
+dnl Copyright 2001, 2002, 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/limb
+C P6 model 0-8,10-12 -
+C P6 model 9 (Banias) ?
+C P6 model 13 (Dothan) 4.67
+C P4 model 0-1 (Willamette) ?
+C P4 model 2 (Northwood) 5
+C P4 model 3-4 (Prescott) 5.25
+
+defframe(PARAM_SIZE, 20)
+defframe(PARAM_SRC2, 16)
+defframe(PARAM_SRC1, 12)
+defframe(PARAM_DST, 8)
+defframe(PARAM_CND, 4)
+
+dnl re-use parameter space
+define(SAVE_EBX,`PARAM_SRC1')
+
+define(`cnd', `%mm3')
+
+ TEXT
+ ALIGN(8)
+
+ ALIGN(8)
+PROLOGUE(mpn_cnd_add_n)
+deflit(`FRAME',0)
+ pxor %mm0, %mm0
+
+ mov PARAM_CND, %eax
+ neg %eax
+ sbb %eax, %eax
+ movd %eax, cnd
+
+ mov PARAM_SRC1, %eax
+ mov %ebx, SAVE_EBX
+ mov PARAM_SRC2, %ebx
+ mov PARAM_DST, %edx
+ mov PARAM_SIZE, %ecx
+
+ lea (%eax,%ecx,4), %eax C src1 end
+ lea (%ebx,%ecx,4), %ebx C src2 end
+ lea (%edx,%ecx,4), %edx C dst end
+ neg %ecx C -size
+
+L(top): movd (%ebx,%ecx,4), %mm2
+ movd (%eax,%ecx,4), %mm1
+ pand cnd, %mm2
+ paddq %mm2, %mm1
+
+ paddq %mm1, %mm0
+ movd %mm0, (%edx,%ecx,4)
+
+ psrlq $32, %mm0
+
+ add $1, %ecx
+ jnz L(top)
+
+ movd %mm0, %eax
+ mov SAVE_EBX, %ebx
+ emms
+ ret
+
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium4/sse2/cnd_sub_n.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium4/sse2/cnd_sub_n.asm
new file mode 100644
index 00000000000..339a23e0b6e
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium4/sse2/cnd_sub_n.asm
@@ -0,0 +1,114 @@
+dnl Intel Pentium-4 mpn_cnd_sub_n -- mpn subtraction.
+
+dnl Copyright 2001, 2002, 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/limb
+C P6 model 0-8,10-12 -
+C P6 model 9 (Banias) ?
+C P6 model 13 (Dothan) 4.67
+C P4 model 0-1 (Willamette) ?
+C P4 model 2 (Northwood) 5
+C P4 model 3-4 (Prescott) 5.25
+
+defframe(PARAM_SIZE, 20)
+defframe(PARAM_SRC2, 16)
+defframe(PARAM_SRC1, 12)
+defframe(PARAM_DST, 8)
+defframe(PARAM_CND, 4)
+
+dnl re-use parameter space
+define(SAVE_EBX,`PARAM_SRC1')
+
+define(`cnd', `%mm3')
+
+ TEXT
+ ALIGN(8)
+
+ ALIGN(8)
+PROLOGUE(mpn_cnd_sub_n)
+deflit(`FRAME',0)
+ pxor %mm0, %mm0
+
+ mov PARAM_CND, %eax
+ neg %eax
+ sbb %eax, %eax
+ movd %eax, cnd
+
+ mov PARAM_SRC1, %eax
+ mov %ebx, SAVE_EBX
+ mov PARAM_SRC2, %ebx
+ mov PARAM_DST, %edx
+ mov PARAM_SIZE, %ecx
+
+ lea (%eax,%ecx,4), %eax C src1 end
+ lea (%ebx,%ecx,4), %ebx C src2 end
+ lea (%edx,%ecx,4), %edx C dst end
+ neg %ecx C -size
+
+L(top): movd (%ebx,%ecx,4), %mm2
+ movd (%eax,%ecx,4), %mm1
+ pand cnd, %mm2
+ psubq %mm2, %mm1
+
+ psubq %mm0, %mm1
+ movd %mm1, (%edx,%ecx,4)
+
+ psrlq $63, %mm1
+
+ add $1, %ecx
+ jz L(done_mm1)
+
+ movd (%ebx,%ecx,4), %mm2
+ movd (%eax,%ecx,4), %mm0
+ pand cnd, %mm2
+ psubq %mm2, %mm0
+
+ psubq %mm1, %mm0
+ movd %mm0, (%edx,%ecx,4)
+
+ psrlq $63, %mm0
+
+ add $1, %ecx
+ jnz L(top)
+
+ movd %mm0, %eax
+ mov SAVE_EBX, %ebx
+ emms
+ ret
+
+L(done_mm1):
+ movd %mm1, %eax
+ mov SAVE_EBX, %ebx
+ emms
+ ret
+
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium4/sse2/dive_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium4/sse2/dive_1.asm
new file mode 100644
index 00000000000..238f0dd8a50
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium4/sse2/dive_1.asm
@@ -0,0 +1,215 @@
+dnl Intel Pentium-4 mpn_divexact_1 -- mpn by limb exact division.
+
+dnl Copyright 2001, 2002, 2007 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 P4: 19.0 cycles/limb
+
+
+C void mpn_divexact_1 (mp_ptr dst, mp_srcptr src, mp_size_t size,
+C mp_limb_t divisor);
+C
+C Pairs of movd's are used to avoid unaligned loads. Despite the loads not
+C being on the dependent chain and there being plenty of cycles available,
+C using an unaligned movq on every second iteration measured about 23 c/l.
+C
+C Using divl for size==1 seems a touch quicker than mul-by-inverse. The mul
+C will be about 9+2*4+2*2+10*4+19+12 = 92 cycles latency, though some of
+C that might be hidden by out-of-order execution, whereas divl is around 60.
+C At size==2 an extra 19 for the mul versus 60 for the divl will see the mul
+C faster.
+
+defframe(PARAM_DIVISOR,16)
+defframe(PARAM_SIZE, 12)
+defframe(PARAM_SRC, 8)
+defframe(PARAM_DST, 4)
+
+ TEXT
+
+ ALIGN(16)
+PROLOGUE(mpn_divexact_1)
+deflit(`FRAME',0)
+
+ movl PARAM_SIZE, %edx
+
+ movl PARAM_SRC, %eax
+
+ movl PARAM_DIVISOR, %ecx
+ subl $1, %edx
+ jnz L(two_or_more)
+
+ movl (%eax), %eax
+ xorl %edx, %edx
+
+ divl %ecx
+ movl PARAM_DST, %ecx
+
+ movl %eax, (%ecx)
+ ret
+
+
+L(two_or_more):
+ C eax src
+ C ebx
+ C ecx divisor
+ C edx size-1
+
+ movl %ecx, %eax
+ bsfl %ecx, %ecx C trailing twos
+
+ shrl %cl, %eax C d = divisor without twos
+ movd %eax, %mm6
+ movd %ecx, %mm7 C shift
+
+ shrl %eax C d/2
+
+ andl $127, %eax C d/2, 7 bits
+
+ifdef(`PIC',`
+ LEA( binvert_limb_table, %ecx)
+ movzbl (%eax,%ecx), %eax C inv 8 bits
+',`
+ movzbl binvert_limb_table(%eax), %eax C inv 8 bits
+')
+
+ C
+
+ movd %eax, %mm5 C inv
+
+ movd %eax, %mm0 C inv
+
+ pmuludq %mm5, %mm5 C inv*inv
+
+ C
+
+ pmuludq %mm6, %mm5 C inv*inv*d
+ paddd %mm0, %mm0 C 2*inv
+
+ C
+
+ psubd %mm5, %mm0 C inv = 2*inv - inv*inv*d
+ pxor %mm5, %mm5
+
+ paddd %mm0, %mm5
+ pmuludq %mm0, %mm0 C inv*inv
+
+ pcmpeqd %mm4, %mm4
+ psrlq $32, %mm4 C 0x00000000FFFFFFFF
+
+ C
+
+ pmuludq %mm6, %mm0 C inv*inv*d
+ paddd %mm5, %mm5 C 2*inv
+
+ movl PARAM_SRC, %eax
+ movl PARAM_DST, %ecx
+ pxor %mm1, %mm1 C initial carry limb
+
+ C
+
+ psubd %mm0, %mm5 C inv = 2*inv - inv*inv*d
+
+ ASSERT(e,` C expect d*inv == 1 mod 2^GMP_LIMB_BITS
+ pushl %eax FRAME_pushl()
+ movq %mm6, %mm0
+ pmuludq %mm5, %mm0
+ movd %mm0, %eax
+ cmpl $1, %eax
+ popl %eax FRAME_popl()')
+
+ pxor %mm0, %mm0 C initial carry bit
+
+
+C The dependent chain here is as follows.
+C
+C latency
+C psubq s = (src-cbit) - climb 2
+C pmuludq q = s*inverse 8
+C pmuludq prod = q*divisor 8
+C psrlq climb = high(prod) 2
+C --
+C 20
+C
+C Yet the loop measures 19.0 c/l, so obviously there's something gained
+C there over a straight reading of the chip documentation.
+
+L(top):
+ C eax src, incrementing
+ C ebx
+ C ecx dst, incrementing
+ C edx counter, size-1 iterations
+ C
+ C mm0 carry bit
+ C mm1 carry limb
+ C mm4 0x00000000FFFFFFFF
+ C mm5 inverse
+ C mm6 divisor
+ C mm7 shift
+
+ movd (%eax), %mm2
+ movd 4(%eax), %mm3
+ addl $4, %eax
+ punpckldq %mm3, %mm2
+
+ psrlq %mm7, %mm2
+ pand %mm4, %mm2 C src
+ psubq %mm0, %mm2 C src - cbit
+
+ psubq %mm1, %mm2 C src - cbit - climb
+ movq %mm2, %mm0
+ psrlq $63, %mm0 C new cbit
+
+ pmuludq %mm5, %mm2 C s*inverse
+ movd %mm2, (%ecx) C q
+ addl $4, %ecx
+
+ movq %mm6, %mm1
+ pmuludq %mm2, %mm1 C q*divisor
+ psrlq $32, %mm1 C new climb
+
+ subl $1, %edx
+ jnz L(top)
+
+
+L(done):
+ movd (%eax), %mm2
+ psrlq %mm7, %mm2 C src
+ psubq %mm0, %mm2 C src - cbit
+
+ psubq %mm1, %mm2 C src - cbit - climb
+
+ pmuludq %mm5, %mm2 C s*inverse
+ movd %mm2, (%ecx) C q
+
+ emms
+ ret
+
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium4/sse2/divrem_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium4/sse2/divrem_1.asm
new file mode 100644
index 00000000000..0146fab1177
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium4/sse2/divrem_1.asm
@@ -0,0 +1,645 @@
+dnl Intel Pentium-4 mpn_divrem_1 -- mpn by limb division.
+
+dnl Copyright 1999-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 P4: 32 cycles/limb integer part, 30 cycles/limb fraction part.
+
+
+C mp_limb_t mpn_divrem_1 (mp_ptr dst, mp_size_t xsize,
+C mp_srcptr src, mp_size_t size,
+C mp_limb_t divisor);
+C mp_limb_t mpn_divrem_1c (mp_ptr dst, mp_size_t xsize,
+C mp_srcptr src, mp_size_t size,
+C mp_limb_t divisor, mp_limb_t carry);
+C mp_limb_t mpn_preinv_divrem_1 (mp_ptr dst, mp_size_t xsize,
+C mp_srcptr src, mp_size_t size,
+C mp_limb_t divisor, mp_limb_t inverse,
+C unsigned shift);
+C
+C Algorithm:
+C
+C The method and nomenclature follow part 8 of "Division by Invariant
+C Integers using Multiplication" by Granlund and Montgomery, reference in
+C gmp.texi.
+C
+C "m" is written for what is m' in the paper, and "d" for d_norm, which
+C won't cause any confusion since it's only the normalized divisor that's of
+C any use in the code. "b" is written for 2^N, the size of a limb, N being
+C 32 here.
+C
+C The step "sdword dr = n - 2^N*d + (2^N-1-q1) * d" is instead done as
+C "n-d - q1*d". This rearrangement gives the same two-limb answer but lets
+C us have just a psubq on the dependent chain.
+C
+C For reference, the way the k7 code uses "n-(q1+1)*d" would not suit here,
+C detecting an overflow of q1+1 when q1=0xFFFFFFFF would cost too much.
+C
+C Notes:
+C
+C mpn_divrem_1 and mpn_preinv_divrem_1 avoid one division if the src high
+C limb is less than the divisor. mpn_divrem_1c doesn't check for a zero
+C carry, since in normal circumstances that will be a very rare event.
+C
+C The test for skipping a division is branch free (once size>=1 is tested).
+C The store to the destination high limb is 0 when a divide is skipped, or
+C if it's not skipped then a copy of the src high limb is stored. The
+C latter is in case src==dst.
+C
+C There's a small bias towards expecting xsize==0, by having code for
+C xsize==0 in a straight line and xsize!=0 under forward jumps.
+C
+C Enhancements:
+C
+C The loop measures 32 cycles, but the dependent chain would suggest it
+C could be done with 30. Not sure where to start looking for the extras.
+C
+C Alternatives:
+C
+C If the divisor is normalized (high bit set) then a division step can
+C always be skipped, since the high destination limb is always 0 or 1 in
+C that case. It doesn't seem worth checking for this though, since it
+C probably occurs infrequently.
+
+
+dnl MUL_THRESHOLD is the value of xsize+size at which the multiply by
+dnl inverse method is used, rather than plain "divl"s. Minimum value 1.
+dnl
+dnl The inverse takes about 80-90 cycles to calculate, but after that the
+dnl multiply is 32 c/l versus division at about 58 c/l.
+dnl
+dnl At 4 limbs the div is a touch faster than the mul (and of course
+dnl simpler), so start the mul from 5 limbs.
+
+deflit(MUL_THRESHOLD, 5)
+
+
+defframe(PARAM_PREINV_SHIFT, 28) dnl mpn_preinv_divrem_1
+defframe(PARAM_PREINV_INVERSE, 24) dnl mpn_preinv_divrem_1
+defframe(PARAM_CARRY, 24) dnl mpn_divrem_1c
+defframe(PARAM_DIVISOR,20)
+defframe(PARAM_SIZE, 16)
+defframe(PARAM_SRC, 12)
+defframe(PARAM_XSIZE, 8)
+defframe(PARAM_DST, 4)
+
+dnl re-use parameter space
+define(SAVE_ESI,`PARAM_SIZE')
+define(SAVE_EBP,`PARAM_SRC')
+define(SAVE_EDI,`PARAM_DIVISOR')
+define(SAVE_EBX,`PARAM_DST')
+
+ TEXT
+
+ ALIGN(16)
+PROLOGUE(mpn_preinv_divrem_1)
+deflit(`FRAME',0)
+
+ movl PARAM_SIZE, %ecx
+ xorl %edx, %edx C carry if can't skip a div
+
+ movl %esi, SAVE_ESI
+ movl PARAM_SRC, %esi
+
+ movl %ebp, SAVE_EBP
+ movl PARAM_DIVISOR, %ebp
+
+ movl %edi, SAVE_EDI
+ movl PARAM_DST, %edi
+
+ movl -4(%esi,%ecx,4), %eax C src high limb
+
+ movl %ebx, SAVE_EBX
+ movl PARAM_XSIZE, %ebx
+
+ movd PARAM_PREINV_INVERSE, %mm4
+
+ movd PARAM_PREINV_SHIFT, %mm7 C l
+ cmpl %ebp, %eax C high cmp divisor
+
+ cmovc( %eax, %edx) C high is carry if high<divisor
+ movd %edx, %mm0 C carry
+
+ movd %edx, %mm1 C carry
+ movl $0, %edx
+
+ movd %ebp, %mm5 C d
+ cmovnc( %eax, %edx) C 0 if skip div, src high if not
+ C (the latter in case src==dst)
+ leal -4(%edi,%ebx,4), %edi C &dst[xsize-1]
+
+ movl %edx, (%edi,%ecx,4) C dst high limb
+ sbbl $0, %ecx C skip one division if high<divisor
+ movl $32, %eax
+
+ subl PARAM_PREINV_SHIFT, %eax
+ psllq %mm7, %mm5 C d normalized
+ leal (%edi,%ecx,4), %edi C &dst[xsize+size-1]
+ leal -4(%esi,%ecx,4), %esi C &src[size-1]
+
+ movd %eax, %mm6 C 32-l
+ jmp L(start_preinv)
+
+EPILOGUE()
+
+
+ ALIGN(16)
+PROLOGUE(mpn_divrem_1c)
+deflit(`FRAME',0)
+
+ movl PARAM_CARRY, %edx
+
+ movl PARAM_SIZE, %ecx
+
+ movl %esi, SAVE_ESI
+ movl PARAM_SRC, %esi
+
+ movl %ebp, SAVE_EBP
+ movl PARAM_DIVISOR, %ebp
+
+ movl %edi, SAVE_EDI
+ movl PARAM_DST, %edi
+
+ movl %ebx, SAVE_EBX
+ movl PARAM_XSIZE, %ebx
+
+ leal -4(%edi,%ebx,4), %edi C &dst[xsize-1]
+ jmp L(start_1c)
+
+EPILOGUE()
+
+
+ ALIGN(16)
+PROLOGUE(mpn_divrem_1)
+deflit(`FRAME',0)
+
+ movl PARAM_SIZE, %ecx
+ xorl %edx, %edx C initial carry (if can't skip a div)
+
+ movl %esi, SAVE_ESI
+ movl PARAM_SRC, %esi
+
+ movl %ebp, SAVE_EBP
+ movl PARAM_DIVISOR, %ebp
+
+ movl %edi, SAVE_EDI
+ movl PARAM_DST, %edi
+
+ movl %ebx, SAVE_EBX
+ movl PARAM_XSIZE, %ebx
+ leal -4(%edi,%ebx,4), %edi C &dst[xsize-1]
+
+ orl %ecx, %ecx C size
+ jz L(no_skip_div) C if size==0
+ movl -4(%esi,%ecx,4), %eax C src high limb
+
+ cmpl %ebp, %eax C high cmp divisor
+
+ cmovnc( %eax, %edx) C 0 if skip div, src high if not
+ movl %edx, (%edi,%ecx,4) C dst high limb
+
+ movl $0, %edx
+ cmovc( %eax, %edx) C high is carry if high<divisor
+
+ sbbl $0, %ecx C size-1 if high<divisor
+L(no_skip_div):
+
+
+L(start_1c):
+ C eax
+ C ebx xsize
+ C ecx size
+ C edx carry
+ C esi src
+ C edi &dst[xsize-1]
+ C ebp divisor
+
+ leal (%ebx,%ecx), %eax C size+xsize
+ leal -4(%esi,%ecx,4), %esi C &src[size-1]
+ leal (%edi,%ecx,4), %edi C &dst[size+xsize-1]
+
+ cmpl $MUL_THRESHOLD, %eax
+ jae L(mul_by_inverse)
+
+
+ orl %ecx, %ecx
+ jz L(divide_no_integer) C if size==0
+
+L(divide_integer):
+ C eax scratch (quotient)
+ C ebx xsize
+ C ecx counter
+ C edx carry
+ C esi src, decrementing
+ C edi dst, decrementing
+ C ebp divisor
+
+ movl (%esi), %eax
+ subl $4, %esi
+
+ divl %ebp
+
+ movl %eax, (%edi)
+ subl $4, %edi
+
+ subl $1, %ecx
+ jnz L(divide_integer)
+
+
+L(divide_no_integer):
+ orl %ebx, %ebx
+ jnz L(divide_fraction) C if xsize!=0
+
+L(divide_done):
+ movl SAVE_ESI, %esi
+ movl SAVE_EDI, %edi
+ movl SAVE_EBX, %ebx
+ movl SAVE_EBP, %ebp
+ movl %edx, %eax
+ ret
+
+
+L(divide_fraction):
+ C eax scratch (quotient)
+ C ebx counter
+ C ecx
+ C edx carry
+ C esi
+ C edi dst, decrementing
+ C ebp divisor
+
+ movl $0, %eax
+
+ divl %ebp
+
+ movl %eax, (%edi)
+ subl $4, %edi
+
+ subl $1, %ebx
+ jnz L(divide_fraction)
+
+ jmp L(divide_done)
+
+
+
+C -----------------------------------------------------------------------------
+
+L(mul_by_inverse):
+ C eax
+ C ebx xsize
+ C ecx size
+ C edx carry
+ C esi &src[size-1]
+ C edi &dst[size+xsize-1]
+ C ebp divisor
+
+ bsrl %ebp, %eax C 31-l
+ movd %edx, %mm0 C carry
+ movd %edx, %mm1 C carry
+ movl %ecx, %edx C size
+ movl $31, %ecx
+
+ C
+
+ xorl %eax, %ecx C l = leading zeros on d
+ addl $1, %eax
+
+ shll %cl, %ebp C d normalized
+ movd %ecx, %mm7 C l
+ movl %edx, %ecx C size
+
+ movd %eax, %mm6 C 32-l
+ movl $-1, %edx
+ movl $-1, %eax
+
+ C
+
+ subl %ebp, %edx C (b-d)-1 so edx:eax = b*(b-d)-1
+
+ divl %ebp C floor (b*(b-d)-1 / d)
+ movd %ebp, %mm5 C d
+
+ C
+
+ movd %eax, %mm4 C m
+
+
+L(start_preinv):
+ C eax inverse
+ C ebx xsize
+ C ecx size
+ C edx
+ C esi &src[size-1]
+ C edi &dst[size+xsize-1]
+ C ebp
+ C
+ C mm0 carry
+ C mm1 carry
+ C mm2
+ C mm4 m
+ C mm5 d
+ C mm6 31-l
+ C mm7 l
+
+ psllq %mm7, %mm0 C n2 = carry << l, for size==0
+
+ subl $1, %ecx
+ jb L(integer_none)
+
+ movd (%esi), %mm0 C src high limb
+ punpckldq %mm1, %mm0
+ psrlq %mm6, %mm0 C n2 = high (carry:srchigh << l)
+ jz L(integer_last)
+
+
+C The dependent chain here consists of
+C
+C 2 paddd n1+n2
+C 8 pmuludq m*(n1+n2)
+C 2 paddq n2:nadj + m*(n1+n2)
+C 2 psrlq q1
+C 8 pmuludq d*q1
+C 2 psubq (n-d)-q1*d
+C 2 psrlq high n-(q1+1)*d mask
+C 2 pand d masked
+C 2 paddd n2+d addback
+C --
+C 30
+C
+C But it seems to run at 32 cycles, so presumably there's something else
+C going on.
+
+ ALIGN(16)
+L(integer_top):
+ C eax
+ C ebx
+ C ecx counter, size-1 to 0
+ C edx
+ C esi src, decrementing
+ C edi dst, decrementing
+ C
+ C mm0 n2
+ C mm4 m
+ C mm5 d
+ C mm6 32-l
+ C mm7 l
+
+ ASSERT(b,`C n2<d
+ movd %mm0, %eax
+ movd %mm5, %edx
+ cmpl %edx, %eax')
+
+ movd -4(%esi), %mm1 C next src limbs
+ movd (%esi), %mm2
+ leal -4(%esi), %esi
+
+ punpckldq %mm2, %mm1
+ psrlq %mm6, %mm1 C n10
+
+ movq %mm1, %mm2 C n10
+ movq %mm1, %mm3 C n10
+ psrad $31, %mm1 C -n1
+ pand %mm5, %mm1 C -n1 & d
+ paddd %mm2, %mm1 C nadj = n10+(-n1&d), ignore overflow
+
+ psrld $31, %mm2 C n1
+ paddd %mm0, %mm2 C n2+n1
+ punpckldq %mm0, %mm1 C n2:nadj
+
+ pmuludq %mm4, %mm2 C m*(n2+n1)
+
+ C
+
+ paddq %mm2, %mm1 C n2:nadj + m*(n2+n1)
+ pxor %mm2, %mm2 C break dependency, saves 4 cycles
+ pcmpeqd %mm2, %mm2 C FF...FF
+ psrlq $63, %mm2 C 1
+
+ psrlq $32, %mm1 C q1 = high(n2:nadj + m*(n2+n1))
+
+ paddd %mm1, %mm2 C q1+1
+ pmuludq %mm5, %mm1 C q1*d
+
+ punpckldq %mm0, %mm3 C n = n2:n10
+ pxor %mm0, %mm0
+
+ psubq %mm5, %mm3 C n - d
+
+ C
+
+ psubq %mm1, %mm3 C n - (q1+1)*d
+
+ por %mm3, %mm0 C copy remainder -> new n2
+ psrlq $32, %mm3 C high n - (q1+1)*d, 0 or -1
+
+ ASSERT(be,`C 0 or -1
+ movd %mm3, %eax
+ addl $1, %eax
+ cmpl $1, %eax')
+
+ paddd %mm3, %mm2 C q
+ pand %mm5, %mm3 C mask & d
+
+ paddd %mm3, %mm0 C addback if necessary
+ movd %mm2, (%edi)
+ leal -4(%edi), %edi
+
+ subl $1, %ecx
+ ja L(integer_top)
+
+
+L(integer_last):
+ C eax
+ C ebx xsize
+ C ecx
+ C edx
+ C esi &src[0]
+ C edi &dst[xsize]
+ C
+ C mm0 n2
+ C mm4 m
+ C mm5 d
+ C mm6
+ C mm7 l
+
+ ASSERT(b,`C n2<d
+ movd %mm0, %eax
+ movd %mm5, %edx
+ cmpl %edx, %eax')
+
+ movd (%esi), %mm1 C src[0]
+ psllq %mm7, %mm1 C n10
+
+ movq %mm1, %mm2 C n10
+ movq %mm1, %mm3 C n10
+ psrad $31, %mm1 C -n1
+ pand %mm5, %mm1 C -n1 & d
+ paddd %mm2, %mm1 C nadj = n10+(-n1&d), ignore overflow
+
+ psrld $31, %mm2 C n1
+ paddd %mm0, %mm2 C n2+n1
+ punpckldq %mm0, %mm1 C n2:nadj
+
+ pmuludq %mm4, %mm2 C m*(n2+n1)
+
+ C
+
+ paddq %mm2, %mm1 C n2:nadj + m*(n2+n1)
+ pcmpeqd %mm2, %mm2 C FF...FF
+ psrlq $63, %mm2 C 1
+
+ psrlq $32, %mm1 C q1 = high(n2:nadj + m*(n2+n1))
+ paddd %mm1, %mm2 C q1
+
+ pmuludq %mm5, %mm1 C q1*d
+ punpckldq %mm0, %mm3 C n
+ psubq %mm5, %mm3 C n - d
+ pxor %mm0, %mm0
+
+ C
+
+ psubq %mm1, %mm3 C n - (q1+1)*d
+
+ por %mm3, %mm0 C remainder -> n2
+ psrlq $32, %mm3 C high n - (q1+1)*d, 0 or -1
+
+ ASSERT(be,`C 0 or -1
+ movd %mm3, %eax
+ addl $1, %eax
+ cmpl $1, %eax')
+
+ paddd %mm3, %mm2 C q
+ pand %mm5, %mm3 C mask & d
+
+ paddd %mm3, %mm0 C addback if necessary
+ movd %mm2, (%edi)
+ leal -4(%edi), %edi
+
+
+L(integer_none):
+ C eax
+ C ebx xsize
+
+ orl %ebx, %ebx
+ jnz L(fraction_some) C if xsize!=0
+
+
+L(fraction_done):
+ movl SAVE_EBP, %ebp
+ psrld %mm7, %mm0 C remainder
+
+ movl SAVE_EDI, %edi
+ movd %mm0, %eax
+
+ movl SAVE_ESI, %esi
+ movl SAVE_EBX, %ebx
+ emms
+ ret
+
+
+
+C -----------------------------------------------------------------------------
+C
+
+L(fraction_some):
+ C eax
+ C ebx xsize
+ C ecx
+ C edx
+ C esi
+ C edi &dst[xsize-1]
+ C ebp
+
+
+L(fraction_top):
+ C eax
+ C ebx counter, xsize iterations
+ C ecx
+ C edx
+ C esi src, decrementing
+ C edi dst, decrementing
+ C
+ C mm0 n2
+ C mm4 m
+ C mm5 d
+ C mm6 32-l
+ C mm7 l
+
+ ASSERT(b,`C n2<d
+ movd %mm0, %eax
+ movd %mm5, %edx
+ cmpl %edx, %eax')
+
+ movq %mm0, %mm1 C n2
+ pmuludq %mm4, %mm0 C m*n2
+
+ pcmpeqd %mm2, %mm2
+ psrlq $63, %mm2
+
+ C
+
+ psrlq $32, %mm0 C high(m*n2)
+
+ paddd %mm1, %mm0 C q1 = high(n2:0 + m*n2)
+
+ paddd %mm0, %mm2 C q1+1
+ pmuludq %mm5, %mm0 C q1*d
+
+ psllq $32, %mm1 C n = n2:0
+ psubq %mm5, %mm1 C n - d
+
+ C
+
+ psubq %mm0, %mm1 C r = n - (q1+1)*d
+ pxor %mm0, %mm0
+
+ por %mm1, %mm0 C r -> n2
+ psrlq $32, %mm1 C high n - (q1+1)*d, 0 or -1
+
+ ASSERT(be,`C 0 or -1
+ movd %mm1, %eax
+ addl $1, %eax
+ cmpl $1, %eax')
+
+ paddd %mm1, %mm2 C q
+ pand %mm5, %mm1 C mask & d
+
+ paddd %mm1, %mm0 C addback if necessary
+ movd %mm2, (%edi)
+ leal -4(%edi), %edi
+
+ subl $1, %ebx
+ jne L(fraction_top)
+
+
+ jmp L(fraction_done)
+
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium4/sse2/gmp-mparam.h b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium4/sse2/gmp-mparam.h
new file mode 100644
index 00000000000..a94ae868b37
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium4/sse2/gmp-mparam.h
@@ -0,0 +1,206 @@
+/* Intel Pentium-4 gmp-mparam.h -- Compiler/machine parameter header file.
+
+Copyright 1991, 1993, 1994, 2000-2005, 2007-2010, 2014 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
+
+/* 2600 MHz P4 Northwood */
+/* FFT tuning limit = 12500000 */
+/* Generated by tuneup.c, 2014-03-12, gcc 4.2 */
+
+#define MOD_1_NORM_THRESHOLD 24
+#define MOD_1_UNNORM_THRESHOLD MP_SIZE_T_MAX /* never */
+#define MOD_1N_TO_MOD_1_1_THRESHOLD 6
+#define MOD_1U_TO_MOD_1_1_THRESHOLD 5
+#define MOD_1_1_TO_MOD_1_2_THRESHOLD 13
+#define MOD_1_2_TO_MOD_1_4_THRESHOLD 0 /* never mpn_mod_1s_2p */
+#define PREINV_MOD_1_TO_MOD_1_THRESHOLD 2
+#define USE_PREINV_DIVREM_1 1 /* native */
+#define DIV_QR_1N_PI1_METHOD 2
+#define DIV_QR_1_NORM_THRESHOLD 19
+#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 20
+
+#define MUL_TOOM22_THRESHOLD 29
+#define MUL_TOOM33_THRESHOLD 113
+#define MUL_TOOM44_THRESHOLD 288
+#define MUL_TOOM6H_THRESHOLD 454
+#define MUL_TOOM8H_THRESHOLD 592
+
+#define MUL_TOOM32_TO_TOOM43_THRESHOLD 118
+#define MUL_TOOM32_TO_TOOM53_THRESHOLD 214
+#define MUL_TOOM42_TO_TOOM53_THRESHOLD 193
+#define MUL_TOOM42_TO_TOOM63_THRESHOLD 186
+#define MUL_TOOM43_TO_TOOM54_THRESHOLD 287
+
+#define SQR_BASECASE_THRESHOLD 0 /* always (native) */
+#define SQR_TOOM2_THRESHOLD 44
+#define SQR_TOOM3_THRESHOLD 173
+#define SQR_TOOM4_THRESHOLD 390
+#define SQR_TOOM6_THRESHOLD 0 /* always */
+#define SQR_TOOM8_THRESHOLD 915
+
+#define MULMID_TOOM42_THRESHOLD 66
+
+#define MULMOD_BNM1_THRESHOLD 19
+#define SQRMOD_BNM1_THRESHOLD 23
+
+#define MUL_FFT_MODF_THRESHOLD 1147 /* k = 5 */
+#define MUL_FFT_TABLE3 \
+ { { 1147, 5}, { 36, 6}, { 19, 5}, { 39, 6}, \
+ { 27, 7}, { 15, 6}, { 33, 7}, { 17, 6}, \
+ { 35, 7}, { 19, 6}, { 40, 7}, { 21, 6}, \
+ { 43, 7}, { 23, 6}, { 49, 7}, { 27, 6}, \
+ { 55, 7}, { 31, 6}, { 63, 7}, { 35, 8}, \
+ { 19, 7}, { 43, 8}, { 23, 7}, { 51, 8}, \
+ { 27, 7}, { 55, 8}, { 31, 7}, { 63, 8}, \
+ { 39, 7}, { 79, 8}, { 43, 9}, { 23, 8}, \
+ { 55, 9}, { 31, 8}, { 71, 9}, { 39, 8}, \
+ { 79, 9}, { 47, 8}, { 95, 9}, { 55,10}, \
+ { 31, 9}, { 63, 8}, { 127, 9}, { 79,10}, \
+ { 47, 9}, { 111,11}, { 31,10}, { 63, 9}, \
+ { 143,10}, { 79, 9}, { 159,10}, { 111,11}, \
+ { 63,10}, { 127, 9}, { 255,10}, { 159, 9}, \
+ { 319,11}, { 95,10}, { 207,12}, { 63,11}, \
+ { 127,10}, { 287,11}, { 159,10}, { 335,11}, \
+ { 191,10}, { 383,11}, { 223,12}, { 127,11}, \
+ { 255,10}, { 511,11}, { 319,10}, { 671,11}, \
+ { 351,12}, { 191,11}, { 383,10}, { 799,13}, \
+ { 127,12}, { 255,11}, { 511,10}, { 1055, 9}, \
+ { 2111,10}, { 1119, 9}, { 2239,11}, { 607,12}, \
+ { 319,11}, { 671,10}, { 1407,11}, { 735,10}, \
+ { 1471, 9}, { 2943,12}, { 383,11}, { 799,10}, \
+ { 1599,11}, { 863,10}, { 1727, 9}, { 3455,12}, \
+ { 447,11}, { 895,13}, { 255,12}, { 511,11}, \
+ { 1055,10}, { 2111,11}, { 1119,10}, { 2239, 9}, \
+ { 4479,12}, { 575,11}, { 1247,10}, { 2495, 9}, \
+ { 4991,12}, { 639,11}, { 1471,10}, { 2943,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}, { 2495,10}, \
+ { 4991,13}, { 639,12}, { 1471,11}, { 2943,10}, \
+ { 5887,11}, { 3007,13}, { 767,12}, { 1727,11}, \
+ { 3455,13}, { 895,12}, { 1791,11}, { 3711,12}, \
+ { 1983,11}, { 3967,10}, { 7935,14}, { 511,13}, \
+ { 1023,12}, { 2239,11}, { 4479,13}, { 1151,12}, \
+ { 2495,11}, { 4991,13}, { 1279,12}, { 2623,13}, \
+ { 1407,12}, { 2943,11}, { 5887,12}, { 3007,14}, \
+ { 16384,15}, { 32768,16} }
+#define MUL_FFT_TABLE3_SIZE 158
+#define MUL_FFT_THRESHOLD 7808
+
+#define SQR_FFT_MODF_THRESHOLD 896 /* k = 5 */
+#define SQR_FFT_TABLE3 \
+ { { 896, 5}, { 28, 6}, { 15, 5}, { 33, 6}, \
+ { 17, 5}, { 35, 6}, { 19, 5}, { 39, 6}, \
+ { 27, 7}, { 15, 6}, { 33, 7}, { 17, 6}, \
+ { 36, 7}, { 19, 6}, { 39, 7}, { 23, 6}, \
+ { 47, 7}, { 27, 6}, { 55, 7}, { 31, 6}, \
+ { 63, 7}, { 37, 8}, { 19, 7}, { 43, 8}, \
+ { 23, 7}, { 51, 8}, { 27, 7}, { 55, 8}, \
+ { 31, 7}, { 63, 8}, { 39, 7}, { 79, 8}, \
+ { 43, 9}, { 23, 8}, { 55, 9}, { 31, 8}, \
+ { 71, 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, 9}, \
+ { 191,11}, { 63,10}, { 127, 9}, { 255,10}, \
+ { 159,11}, { 95,10}, { 191,12}, { 63,11}, \
+ { 127,10}, { 255, 9}, { 511,10}, { 271, 9}, \
+ { 543,11}, { 159,10}, { 319, 9}, { 639,11}, \
+ { 191,10}, { 383, 9}, { 767,11}, { 223,12}, \
+ { 127,11}, { 255,10}, { 511, 9}, { 1055,10}, \
+ { 543,11}, { 287,10}, { 607,11}, { 319,12}, \
+ { 191,11}, { 383,10}, { 767,13}, { 127,12}, \
+ { 255,11}, { 511,10}, { 1055,11}, { 543,10}, \
+ { 1119, 9}, { 2239,11}, { 607,12}, { 319,11}, \
+ { 671,10}, { 1407,11}, { 735,10}, { 1471, 9}, \
+ { 2943,12}, { 383,11}, { 799,10}, { 1599,11}, \
+ { 863,10}, { 1727,12}, { 447,11}, { 991,13}, \
+ { 255,12}, { 511,11}, { 1055,10}, { 2111,11}, \
+ { 1119,10}, { 2239,12}, { 575,11}, { 1247,10}, \
+ { 2495,12}, { 639,11}, { 1471,10}, { 2943,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,11}, { 2495,13}, \
+ { 639,12}, { 1471,11}, { 2943,10}, { 5887,13}, \
+ { 767,12}, { 1727,11}, { 3455,13}, { 895,12}, \
+ { 1791,11}, { 3711,12}, { 1983,11}, { 3967,10}, \
+ { 7935,14}, { 511,13}, { 1023,12}, { 2239,11}, \
+ { 4479,13}, { 1151,12}, { 2495,11}, { 4991,13}, \
+ { 1279,12}, { 2623,13}, { 1407,12}, { 2943,11}, \
+ { 5887,14}, { 16384,15}, { 32768,16} }
+#define SQR_FFT_TABLE3_SIZE 159
+#define SQR_FFT_THRESHOLD 7296
+
+#define MULLO_BASECASE_THRESHOLD 12
+#define MULLO_DC_THRESHOLD 55
+#define MULLO_MUL_N_THRESHOLD 14709
+
+#define DC_DIV_QR_THRESHOLD 38
+#define DC_DIVAPPR_Q_THRESHOLD 77
+#define DC_BDIV_QR_THRESHOLD 51
+#define DC_BDIV_Q_THRESHOLD 85
+
+#define INV_MULMOD_BNM1_THRESHOLD 56
+#define INV_NEWTON_THRESHOLD 121
+#define INV_APPR_THRESHOLD 93
+
+#define BINV_NEWTON_THRESHOLD 366
+#define REDC_1_TO_REDC_N_THRESHOLD 64
+
+#define MU_DIV_QR_THRESHOLD 2350
+#define MU_DIVAPPR_Q_THRESHOLD 2172
+#define MUPI_DIV_QR_THRESHOLD 62
+#define MU_BDIV_QR_THRESHOLD 2172
+#define MU_BDIV_Q_THRESHOLD 2304
+
+#define POWM_SEC_TABLE 1,19,102,615,2111
+
+#define MATRIX22_STRASSEN_THRESHOLD 23
+#define HGCD_THRESHOLD 88
+#define HGCD_APPR_THRESHOLD 93
+#define HGCD_REDUCE_THRESHOLD 5010
+#define GCD_DC_THRESHOLD 379
+#define GCDEXT_DC_THRESHOLD 258
+#define JACOBI_BASE_METHOD 4
+
+#define GET_STR_DC_THRESHOLD 12
+#define GET_STR_PRECOMPUTE_THRESHOLD 26
+#define SET_STR_DC_THRESHOLD 147
+#define SET_STR_PRECOMPUTE_THRESHOLD 894
+
+#define FAC_DSC_THRESHOLD 906
+#define FAC_ODD_THRESHOLD 28
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium4/sse2/mod_1_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium4/sse2/mod_1_1.asm
new file mode 100644
index 00000000000..ee88babeeea
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium4/sse2/mod_1_1.asm
@@ -0,0 +1,166 @@
+dnl x86-32 mpn_mod_1_1p for Pentium 4 and P6 models with SSE2 (i.e., 9,D,E,F).
+
+dnl Contributed to the GNU project by Torbjorn Granlund.
+
+dnl Copyright 2009, 2010 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 TODO:
+C * Optimize. The present code was written quite straightforwardly.
+C * Optimize post-loop reduction code; it is from mod_1s_4p, thus overkill.
+C * Write a cps function that uses sse2 insns.
+
+C cycles/limb
+C P6 model 0-8,10-12 -
+C P6 model 9 (Banias) ?
+C P6 model 13 (Dothan) ?
+C P4 model 0-1 (Willamette) ?
+C P4 model 2 (Northwood) 16
+C P4 model 3-4 (Prescott) 18
+
+C INPUT PARAMETERS
+C ap sp + 4
+C n sp + 8
+C b sp + 12
+C cps sp + 16
+
+define(`B1modb', `%mm1')
+define(`B2modb', `%mm2')
+define(`ap', `%edx')
+define(`n', `%eax')
+
+ TEXT
+ ALIGN(16)
+PROLOGUE(mpn_mod_1_1p)
+ push %ebx
+ mov 8(%esp), ap
+ mov 12(%esp), n
+ mov 20(%esp), %ecx
+ movd 8(%ecx), B1modb
+ movd 12(%ecx), B2modb
+
+ lea -4(ap,n,4), ap
+
+C FIXME: See comment in generic/mod_1_1.c.
+ movd (ap), %mm7
+ movd -4(ap), %mm4
+ pmuludq B1modb, %mm7
+ paddq %mm4, %mm7
+ add $-2, n
+ jz L(end)
+
+ ALIGN(8)
+L(top): movq %mm7, %mm6
+ psrlq $32, %mm7 C rh
+ movd -8(ap), %mm0
+ add $-4, ap
+ pmuludq B2modb, %mm7
+ pmuludq B1modb, %mm6
+ add $-1, n
+ paddq %mm0, %mm7
+ paddq %mm6, %mm7
+ jnz L(top)
+
+L(end): pcmpeqd %mm4, %mm4
+ psrlq $32, %mm4 C 0x00000000FFFFFFFF
+ pand %mm7, %mm4 C rl
+ psrlq $32, %mm7 C rh
+ pmuludq B1modb, %mm7 C rh,cl
+ paddq %mm4, %mm7 C rh,rl
+ movd 4(%ecx), %mm4 C cnt
+ psllq %mm4, %mm7 C rh,rl normalized
+ movq %mm7, %mm2 C rl in low half
+ psrlq $32, %mm7 C rh
+ movd (%ecx), %mm1 C bi
+ pmuludq %mm7, %mm1 C qh,ql
+ paddq %mm2, %mm1 C qh-1,ql
+ movd %mm1, %ecx C ql
+ psrlq $32, %mm1 C qh-1
+ movd 16(%esp), %mm3 C b
+ pmuludq %mm1, %mm3 C (qh-1) * b
+ psubq %mm3, %mm2 C r in low half (could use psubd)
+ movd %mm2, %eax C r
+ mov 16(%esp), %ebx
+ sub %ebx, %eax C r
+ cmp %eax, %ecx
+ lea (%eax,%ebx), %edx
+ cmovc( %edx, %eax)
+ movd %mm4, %ecx C cnt
+ cmp %ebx, %eax
+ jae L(fix)
+ emms
+ pop %ebx
+ shr %cl, %eax
+ ret
+
+L(fix): sub %ebx, %eax
+ emms
+ pop %ebx
+ shr %cl, %eax
+ ret
+EPILOGUE()
+
+PROLOGUE(mpn_mod_1_1p_cps)
+C CAUTION: This is the same code as in k7/mod_1_1.asm
+ push %ebp
+ mov 12(%esp), %ebp
+ push %esi
+ bsr %ebp, %ecx
+ push %ebx
+ xor $31, %ecx
+ mov 16(%esp), %esi
+ sal %cl, %ebp
+ mov %ebp, %edx
+ not %edx
+ mov $-1, %eax
+ div %ebp
+ mov %eax, (%esi) C store bi
+ mov %ecx, 4(%esi) C store cnt
+ xor %ebx, %ebx
+ sub %ebp, %ebx
+ mov $1, %edx
+ shld %cl, %eax, %edx
+ imul %edx, %ebx
+ mul %ebx
+ add %ebx, %edx
+ not %edx
+ imul %ebp, %edx
+ add %edx, %ebp
+ cmp %edx, %eax
+ cmovc( %ebp, %edx)
+ shr %cl, %ebx
+ mov %ebx, 8(%esi) C store B1modb
+ shr %cl, %edx
+ mov %edx, 12(%esi) C store B2modb
+ pop %ebx
+ pop %esi
+ pop %ebp
+ ret
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium4/sse2/mod_1_4.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium4/sse2/mod_1_4.asm
new file mode 100644
index 00000000000..eb2edb6297d
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium4/sse2/mod_1_4.asm
@@ -0,0 +1,269 @@
+dnl x86-32 mpn_mod_1s_4p for Pentium 4 and P6 models with SSE2 (i.e. 9,D,E,F).
+
+dnl Contributed to the GNU project by Torbjorn Granlund.
+
+dnl Copyright 2009, 2010 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 TODO:
+C * Optimize. The present code was written quite straightforwardly.
+C * Optimize post-loop reduction code.
+C * Write a cps function that uses sse2 insns.
+
+C cycles/limb
+C P6 model 0-8,10-12 -
+C P6 model 9 (Banias) ?
+C P6 model 13 (Dothan) 3.4
+C P4 model 0-1 (Willamette) ?
+C P4 model 2 (Northwood) 4
+C P4 model 3-4 (Prescott) 4.5
+
+C INPUT PARAMETERS
+C ap sp + 4
+C n sp + 8
+C b sp + 12
+C cps sp + 16
+
+define(`B1modb', `%mm1')
+define(`B2modb', `%mm2')
+define(`B3modb', `%mm3')
+define(`B4modb', `%mm4')
+define(`B5modb', `%mm5')
+define(`ap', `%edx')
+define(`n', `%eax')
+
+ASM_START()
+ TEXT
+ ALIGN(16)
+PROLOGUE(mpn_mod_1s_4p)
+ push %ebx
+ mov 8(%esp), ap
+ mov 12(%esp), n
+ mov 20(%esp), %ecx
+
+ movd 8(%ecx), B1modb
+ movd 12(%ecx), B2modb
+ movd 16(%ecx), B3modb
+ movd 20(%ecx), B4modb
+ movd 24(%ecx), B5modb
+
+ mov n, %ebx
+ lea -4(ap,n,4), ap
+ and $3, %ebx
+ je L(b0)
+ cmp $2, %ebx
+ jc L(b1)
+ je L(b2)
+
+L(b3): movd -4(ap), %mm7
+ pmuludq B1modb, %mm7
+ movd -8(ap), %mm6
+ paddq %mm6, %mm7
+ movd (ap), %mm6
+ pmuludq B2modb, %mm6
+ paddq %mm6, %mm7
+ lea -24(ap), ap
+ add $-3, n
+ jz L(end)
+ jmp L(top)
+
+L(b0): movd -8(ap), %mm7
+ pmuludq B1modb, %mm7
+ movd -12(ap), %mm6
+ paddq %mm6, %mm7
+ movd -4(ap), %mm6
+ pmuludq B2modb, %mm6
+ paddq %mm6, %mm7
+ movd (ap), %mm6
+ pmuludq B3modb, %mm6
+ paddq %mm6, %mm7
+ lea -28(ap), ap
+ add $-4, n
+ jz L(end)
+ jmp L(top)
+
+L(b1): movd (ap), %mm7
+ lea -16(ap), ap
+ dec n
+ jz L(x)
+ jmp L(top)
+
+L(b2): movd -4(ap), %mm7 C rl
+ punpckldq (ap), %mm7 C rh
+ lea -20(ap), ap
+ add $-2, n
+ jz L(end)
+
+ ALIGN(8)
+L(top): movd 4(ap), %mm0
+ pmuludq B1modb, %mm0
+ movd 0(ap), %mm6
+ paddq %mm6, %mm0
+
+ movd 8(ap), %mm6
+ pmuludq B2modb, %mm6
+ paddq %mm6, %mm0
+
+ movd 12(ap), %mm6
+ pmuludq B3modb, %mm6
+ paddq %mm6, %mm0
+
+ movq %mm7, %mm6
+ psrlq $32, %mm7 C rh
+ pmuludq B5modb, %mm7
+ pmuludq B4modb, %mm6
+
+ paddq %mm0, %mm7
+ paddq %mm6, %mm7
+
+ add $-16, ap
+ add $-4, n
+ jnz L(top)
+
+L(end): pcmpeqd %mm4, %mm4
+ psrlq $32, %mm4 C 0x00000000FFFFFFFF
+ pand %mm7, %mm4 C rl
+ psrlq $32, %mm7 C rh
+ pmuludq B1modb, %mm7 C rh,cl
+ paddq %mm4, %mm7 C rh,rl
+L(x): movd 4(%ecx), %mm4 C cnt
+ psllq %mm4, %mm7 C rh,rl normalized
+ movq %mm7, %mm2 C rl in low half
+ psrlq $32, %mm7 C rh
+ movd (%ecx), %mm1 C bi
+ pmuludq %mm7, %mm1 C qh,ql
+ paddq %mm2, %mm1 C qh-1,ql
+ movd %mm1, %ecx C ql
+ psrlq $32, %mm1 C qh-1
+ movd 16(%esp), %mm3 C b
+ pmuludq %mm1, %mm3 C (qh-1) * b
+ psubq %mm3, %mm2 C r in low half (could use psubd)
+ movd %mm2, %eax C r
+ mov 16(%esp), %ebx
+ sub %ebx, %eax C r
+ cmp %eax, %ecx
+ lea (%eax,%ebx), %edx
+ cmovc( %edx, %eax)
+ movd %mm4, %ecx C cnt
+ cmp %ebx, %eax
+ jae L(fix)
+ emms
+ pop %ebx
+ shr %cl, %eax
+ ret
+
+L(fix): sub %ebx, %eax
+ emms
+ pop %ebx
+ shr %cl, %eax
+ ret
+EPILOGUE()
+
+ ALIGN(16)
+PROLOGUE(mpn_mod_1s_4p_cps)
+C CAUTION: This is the same code as in k7/mod_1_4.asm
+ push %ebp
+ push %edi
+ push %esi
+ push %ebx
+ mov 20(%esp), %ebp C FIXME: avoid bp for 0-idx
+ mov 24(%esp), %ebx
+ bsr %ebx, %ecx
+ xor $31, %ecx
+ sal %cl, %ebx C b << cnt
+ mov %ebx, %edx
+ not %edx
+ mov $-1, %eax
+ div %ebx
+ xor %edi, %edi
+ sub %ebx, %edi
+ mov $1, %esi
+ mov %eax, (%ebp) C store bi
+ mov %ecx, 4(%ebp) C store cnt
+ shld %cl, %eax, %esi
+ imul %edi, %esi
+ mov %eax, %edi
+ mul %esi
+
+ add %esi, %edx
+ shr %cl, %esi
+ mov %esi, 8(%ebp) C store B1modb
+
+ not %edx
+ imul %ebx, %edx
+ lea (%edx,%ebx), %esi
+ cmp %edx, %eax
+ cmovnc( %edx, %esi)
+ mov %edi, %eax
+ mul %esi
+
+ add %esi, %edx
+ shr %cl, %esi
+ mov %esi, 12(%ebp) C store B2modb
+
+ not %edx
+ imul %ebx, %edx
+ lea (%edx,%ebx), %esi
+ cmp %edx, %eax
+ cmovnc( %edx, %esi)
+ mov %edi, %eax
+ mul %esi
+
+ add %esi, %edx
+ shr %cl, %esi
+ mov %esi, 16(%ebp) C store B3modb
+
+ not %edx
+ imul %ebx, %edx
+ lea (%edx,%ebx), %esi
+ cmp %edx, %eax
+ cmovnc( %edx, %esi)
+ mov %edi, %eax
+ mul %esi
+
+ add %esi, %edx
+ shr %cl, %esi
+ mov %esi, 20(%ebp) C store B4modb
+
+ not %edx
+ imul %ebx, %edx
+ add %edx, %ebx
+ cmp %edx, %eax
+ cmovnc( %edx, %ebx)
+
+ shr %cl, %ebx
+ mov %ebx, 24(%ebp) C store B5modb
+
+ pop %ebx
+ pop %esi
+ pop %edi
+ pop %ebp
+ ret
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium4/sse2/mod_34lsub1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium4/sse2/mod_34lsub1.asm
new file mode 100644
index 00000000000..31e25b79bc3
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium4/sse2/mod_34lsub1.asm
@@ -0,0 +1,175 @@
+dnl Intel Pentium 4 mpn_mod_34lsub1 -- remainder modulo 2^24-1.
+
+dnl Copyright 2000-2003 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 Pentium4: 1.0 cycles/limb
+
+
+C mp_limb_t mpn_mod_34lsub1 (mp_srcptr src, mp_size_t size)
+C
+C Enhancements:
+C
+C There might a couple of cycles to save by using plain integer code for
+C more small sizes. 2 limbs measures about 20 cycles, but 3 limbs jumps to
+C about 46 (inclusive of some function call overheads).
+
+defframe(PARAM_SIZE, 8)
+defframe(PARAM_SRC, 4)
+
+dnl re-use parameter space
+define(SAVE_EBX, `PARAM_SRC')
+define(SAVE_ESI, `PARAM_SIZE')
+
+ TEXT
+ ALIGN(16)
+PROLOGUE(mpn_mod_34lsub1)
+deflit(`FRAME',0)
+
+ movl PARAM_SIZE, %ecx
+ movl PARAM_SRC, %edx
+ movl (%edx), %eax
+
+ subl $2, %ecx
+ ja L(three_or_more)
+ jne L(one)
+
+ movl 4(%edx), %edx
+ movl %eax, %ecx
+ shrl $24, %eax C src[0] high
+
+ andl $0x00FFFFFF, %ecx C src[0] low
+ addl %ecx, %eax
+
+ movl %edx, %ecx
+ shll $8, %edx
+
+ shrl $16, %ecx C src[1] low
+ addl %ecx, %eax
+
+ andl $0x00FFFF00, %edx C src[1] high
+ addl %edx, %eax
+
+L(one):
+ ret
+
+
+L(three_or_more):
+ pxor %mm0, %mm0
+ pxor %mm1, %mm1
+ pxor %mm2, %mm2
+
+ pcmpeqd %mm7, %mm7
+ psrlq $32, %mm7 C 0x00000000FFFFFFFF, low 32 bits
+
+ pcmpeqd %mm6, %mm6
+ psrlq $40, %mm6 C 0x0000000000FFFFFF, low 24 bits
+
+L(top):
+ C eax
+ C ebx
+ C ecx counter, size-2 to 0, -1 or -2
+ C edx src, incrementing
+ C
+ C mm0 sum 0mod3
+ C mm1 sum 1mod3
+ C mm2 sum 2mod3
+ C mm3
+ C mm4
+ C mm5
+ C mm6 0x0000000000FFFFFF
+ C mm7 0x00000000FFFFFFFF
+
+ movd (%edx), %mm3
+ paddq %mm3, %mm0
+
+ movd 4(%edx), %mm3
+ paddq %mm3, %mm1
+
+ movd 8(%edx), %mm3
+ paddq %mm3, %mm2
+
+ addl $12, %edx
+ subl $3, %ecx
+ ja L(top)
+
+
+ C ecx is -2, -1 or 0 representing 0, 1 or 2 more limbs, respectively
+
+ addl $1, %ecx
+ js L(combine) C 0 more
+
+ movd (%edx), %mm3
+ paddq %mm3, %mm0
+
+ jz L(combine) C 1 more
+
+ movd 4(%edx), %mm3
+ paddq %mm3, %mm1
+
+L(combine):
+ movq %mm7, %mm3 C low halves
+ pand %mm0, %mm3
+
+ movq %mm7, %mm4
+ pand %mm1, %mm4
+
+ movq %mm7, %mm5
+ pand %mm2, %mm5
+
+ psrlq $32, %mm0 C high halves
+ psrlq $32, %mm1
+ psrlq $32, %mm2
+
+ paddq %mm0, %mm4 C fold high halves to give 33 bits each
+ paddq %mm1, %mm5
+ paddq %mm2, %mm3
+
+ psllq $8, %mm4 C combine at respective offsets
+ psllq $16, %mm5
+ paddq %mm4, %mm3
+ paddq %mm5, %mm3 C 0x000cxxxxxxxxxxxx, 50 bits
+
+ pand %mm3, %mm6 C fold at 24 bits
+ psrlq $24, %mm3
+
+ paddq %mm6, %mm3
+ movd %mm3, %eax
+
+ ASSERT(z, C nothing left in high dword
+ `psrlq $32, %mm3
+ movd %mm3, %ecx
+ orl %ecx, %ecx')
+
+ emms
+ ret
+
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium4/sse2/mode1o.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium4/sse2/mode1o.asm
new file mode 100644
index 00000000000..778c478169d
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium4/sse2/mode1o.asm
@@ -0,0 +1,174 @@
+dnl Intel Pentium-4 mpn_modexact_1_odd -- mpn by limb exact remainder.
+
+dnl Copyright 2001, 2002, 2007 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 P4: 19.0 cycles/limb
+
+
+C mp_limb_t mpn_modexact_1_odd (mp_srcptr src, mp_size_t size,
+C mp_limb_t divisor);
+C mp_limb_t mpn_modexact_1c_odd (mp_srcptr src, mp_size_t size,
+C mp_limb_t divisor, mp_limb_t carry);
+C
+
+defframe(PARAM_CARRY, 16)
+defframe(PARAM_DIVISOR,12)
+defframe(PARAM_SIZE, 8)
+defframe(PARAM_SRC, 4)
+
+ TEXT
+
+ ALIGN(16)
+PROLOGUE(mpn_modexact_1c_odd)
+deflit(`FRAME',0)
+
+ movd PARAM_CARRY, %mm1
+ jmp L(start_1c)
+
+EPILOGUE()
+
+
+ ALIGN(16)
+PROLOGUE(mpn_modexact_1_odd)
+deflit(`FRAME',0)
+
+ pxor %mm1, %mm1 C carry limb
+L(start_1c):
+ movl PARAM_DIVISOR, %eax
+
+ movd PARAM_DIVISOR, %mm7
+
+ shrl %eax
+
+ andl $127, %eax C d/2, 7 bits
+
+ifdef(`PIC',`
+ LEA( binvert_limb_table, %edx)
+ movzbl (%eax,%edx), %eax C inv 8 bits
+',`
+ movzbl binvert_limb_table(%eax), %eax C inv 8 bits
+')
+
+ C
+
+ movd %eax, %mm6 C inv
+
+ movd %eax, %mm0 C inv
+
+ pmuludq %mm6, %mm6 C inv*inv
+
+ C
+
+ pmuludq %mm7, %mm6 C inv*inv*d
+ paddd %mm0, %mm0 C 2*inv
+
+ C
+
+ psubd %mm6, %mm0 C inv = 2*inv - inv*inv*d
+ pxor %mm6, %mm6
+
+ paddd %mm0, %mm6
+ pmuludq %mm0, %mm0 C inv*inv
+
+ C
+
+ pmuludq %mm7, %mm0 C inv*inv*d
+ paddd %mm6, %mm6 C 2*inv
+
+
+ movl PARAM_SRC, %eax
+ movl PARAM_SIZE, %ecx
+
+ C
+
+ psubd %mm0, %mm6 C inv = 2*inv - inv*inv*d
+
+ ASSERT(e,` C expect d*inv == 1 mod 2^GMP_LIMB_BITS
+ pushl %eax FRAME_pushl()
+ movd %mm6, %eax
+ imul PARAM_DIVISOR, %eax
+ cmpl $1, %eax
+ popl %eax FRAME_popl()')
+
+ pxor %mm0, %mm0 C carry bit
+
+
+C The dependent chain here is as follows.
+C
+C latency
+C psubq s = (src-cbit) - climb 2
+C pmuludq q = s*inverse 8
+C pmuludq prod = q*divisor 8
+C psrlq climb = high(prod) 2
+C --
+C 20
+C
+C Yet the loop measures 19.0 c/l, so obviously there's something gained
+C there over a straight reading of the chip documentation.
+
+L(top):
+ C eax src, incrementing
+ C ebx
+ C ecx counter, limbs
+ C edx
+ C
+ C mm0 carry bit
+ C mm1 carry limb
+ C mm6 inverse
+ C mm7 divisor
+
+ movd (%eax), %mm2
+ addl $4, %eax
+
+ psubq %mm0, %mm2 C src - cbit
+
+ psubq %mm1, %mm2 C src - cbit - climb
+ movq %mm2, %mm0
+ psrlq $63, %mm0 C new cbit
+
+ pmuludq %mm6, %mm2 C s*inverse
+
+ movq %mm7, %mm1
+ pmuludq %mm2, %mm1 C q*divisor
+ psrlq $32, %mm1 C new climb
+
+ subl $1, %ecx
+ jnz L(top)
+
+
+L(done):
+ paddq %mm1, %mm0
+ movd %mm0, %eax
+ emms
+ ret
+
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium4/sse2/mul_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium4/sse2/mul_1.asm
new file mode 100644
index 00000000000..6347b8bf624
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium4/sse2/mul_1.asm
@@ -0,0 +1,164 @@
+dnl mpn_mul_1 for Pentium 4 and P6 models with SSE2 (i.e., 9,D,E,F).
+
+dnl Copyright 2005, 2007, 2011 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 P6 model 0-8,10-12 -
+C P6 model 9 (Banias) 4.17
+C P6 model 13 (Dothan) 4.17
+C P4 model 0-1 (Willamette) 4
+C P4 model 2 (Northwood) 4
+C P4 model 3-4 (Prescott) 4.55
+
+C TODO:
+C * Tweak eax/edx offsets in loop as to save some lea's
+C * Perhaps software pipeline small-case code
+
+C INPUT PARAMETERS
+C rp sp + 4
+C up sp + 8
+C n sp + 12
+C v0 sp + 16
+
+ TEXT
+ ALIGN(16)
+PROLOGUE(mpn_mul_1)
+ pxor %mm6, %mm6
+L(ent): mov 4(%esp), %edx
+ mov 8(%esp), %eax
+ mov 12(%esp), %ecx
+ movd 16(%esp), %mm7
+ cmp $4, %ecx
+ jnc L(big)
+
+L(lp0): movd (%eax), %mm0
+ lea 4(%eax), %eax
+ lea 4(%edx), %edx
+ pmuludq %mm7, %mm0
+ paddq %mm0, %mm6
+ movd %mm6, -4(%edx)
+ psrlq $32, %mm6
+ dec %ecx
+ jnz L(lp0)
+ movd %mm6, %eax
+ emms
+ ret
+
+L(big): and $3, %ecx
+ je L(0)
+ cmp $2, %ecx
+ jc L(1)
+ je L(2)
+ jmp L(3) C FIXME: one case should fall through
+
+L(0): movd (%eax), %mm3
+ sub 12(%esp), %ecx C loop count
+ lea -16(%eax), %eax
+ lea -12(%edx), %edx
+ pmuludq %mm7, %mm3
+ movd 20(%eax), %mm0
+ pmuludq %mm7, %mm0
+ movd 24(%eax), %mm1
+ jmp L(00)
+
+L(1): movd (%eax), %mm2
+ sub 12(%esp), %ecx
+ lea -12(%eax), %eax
+ lea -8(%edx), %edx
+ pmuludq %mm7, %mm2
+ movd 16(%eax), %mm3
+ pmuludq %mm7, %mm3
+ movd 20(%eax), %mm0
+ jmp L(01)
+
+L(2): movd (%eax), %mm1
+ sub 12(%esp), %ecx
+ lea -8(%eax), %eax
+ lea -4(%edx), %edx
+ pmuludq %mm7, %mm1
+ movd 12(%eax), %mm2
+ pmuludq %mm7, %mm2
+ movd 16(%eax), %mm3
+ jmp L(10)
+
+L(3): movd (%eax), %mm0
+ sub 12(%esp), %ecx
+ lea -4(%eax), %eax
+ pmuludq %mm7, %mm0
+ movd 8(%eax), %mm1
+ pmuludq %mm7, %mm1
+ movd 12(%eax), %mm2
+
+ ALIGN(16)
+L(top): pmuludq %mm7, %mm2
+ paddq %mm0, %mm6
+ movd 16(%eax), %mm3
+ movd %mm6, 0(%edx)
+ psrlq $32, %mm6
+L(10): pmuludq %mm7, %mm3
+ paddq %mm1, %mm6
+ movd 20(%eax), %mm0
+ movd %mm6, 4(%edx)
+ psrlq $32, %mm6
+L(01): pmuludq %mm7, %mm0
+ paddq %mm2, %mm6
+ movd 24(%eax), %mm1
+ movd %mm6, 8(%edx)
+ psrlq $32, %mm6
+L(00): pmuludq %mm7, %mm1
+ paddq %mm3, %mm6
+ movd 28(%eax), %mm2
+ movd %mm6, 12(%edx)
+ psrlq $32, %mm6
+ lea 16(%eax), %eax
+ lea 16(%edx), %edx
+ add $4, %ecx
+ ja L(top)
+
+L(end): pmuludq %mm7, %mm2
+ paddq %mm0, %mm6
+ movd %mm6, 0(%edx)
+ psrlq $32, %mm6
+ paddq %mm1, %mm6
+ movd %mm6, 4(%edx)
+ psrlq $32, %mm6
+ paddq %mm2, %mm6
+ movd %mm6, 8(%edx)
+ psrlq $32, %mm6
+ movd %mm6, %eax
+ emms
+ ret
+EPILOGUE()
+PROLOGUE(mpn_mul_1c)
+ movd 20(%esp), %mm6
+ jmp L(ent)
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium4/sse2/mul_basecase.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium4/sse2/mul_basecase.asm
new file mode 100644
index 00000000000..6e3775ae096
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium4/sse2/mul_basecase.asm
@@ -0,0 +1,662 @@
+dnl mpn_mul_basecase for Pentium 4 and P6 models with SSE2 (i.e., 9,D,E,F).
+
+dnl Copyright 2001, 2002, 2005, 2007 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 TODO:
+C * Improve ad-hoc outer loop code and register handling. Some feed-in
+C scheduling could improve things by several cycles per outer iteration.
+C * In code for un <= 3, try keeping accumulation operands in registers,
+C without storing intermediates to rp.
+C * We might want to keep 32 in a free mm register, since the register form is
+C 3 bytes and the immediate form is 4 bytes. About 70 bytes to save.
+C * Look into different loop alignment, we now expand the code about 50 bytes
+C with possibly needless alignment.
+C * Perhaps rewrap loops 00,01,02 (6 loops) to allow fall-through entry.
+C * Use OSP, should solve feed-in latency problems.
+C * Save a few tens of bytes by doing cross-jumping for Loel0, etc.
+C * Save around 120 bytes by remapping "m 0", "m 1", "m 2" and "m 3" registers
+C so that they can share feed-in code, and changing the branch targets from
+C L<n> to Lm<nn>.
+
+C cycles/limb
+C P6 model 9 (Banias) ?
+C P6 model 13 (Dothan) 5.24
+C P6 model 14 (Yonah) ?
+C P4 model 0-1 (Willamette): 5
+C P4 model 2 (Northwood): 4.60 at 32 limbs
+C P4 model 3-4 (Prescott): 4.94 at 32 limbs
+
+C INPUT PARAMETERS
+C rp sp + 4
+C up sp + 8
+C un sp + 12
+C vp sp + 16
+C vn sp + 20
+
+ TEXT
+ ALIGN(16)
+PROLOGUE(mpn_mul_basecase)
+ push %esi
+ push %ebx
+ mov 12(%esp), %edx C rp
+ mov 16(%esp), %eax C up
+ mov 20(%esp), %ecx C un
+ mov 24(%esp), %esi C vp
+ mov 28(%esp), %ebx C vn
+ movd (%esi), %mm7 C
+L(ent): cmp $3, %ecx
+ ja L(big)
+ movd (%eax), %mm6
+ pmuludq %mm7, %mm6
+ jz L(un3)
+ cmp $2, %ecx
+ jz L(un2)
+
+L(un1): movd %mm6, (%edx) C un=1
+ psrlq $32, %mm6 C un=1
+ movd %mm6, 4(%edx) C un=1
+ jmp L(rtr) C un=1
+
+L(un2): movd 4(%eax), %mm1 C un=2
+ pmuludq %mm7, %mm1 C un=2
+ movd %mm6, (%edx) C un=2
+ psrlq $32, %mm6 C un=2
+ paddq %mm1, %mm6 C un=2
+ movd %mm6, 4(%edx) C un=2
+ psrlq $32, %mm6 C un=2
+ movd %mm6, 8(%edx) C un=2
+ dec %ebx C un=2
+ jz L(rtr) C un=2
+ movd 4(%esi), %mm7 C un=2
+ movd (%eax), %mm6 C un=2
+ pmuludq %mm7, %mm6 C un=2
+ movd 4(%eax), %mm1 C un=2
+ movd 4(%edx), %mm4 C un=2
+ pmuludq %mm7, %mm1 C un=2
+ movd 8(%edx), %mm5 C un=2
+ paddq %mm4, %mm6 C un=2
+ paddq %mm1, %mm5 C un=2
+ movd %mm6, 4(%edx) C un=2
+ psrlq $32, %mm6 C un=2
+ paddq %mm5, %mm6 C un=2
+ movd %mm6, 8(%edx) C un=2
+ psrlq $32, %mm6 C un=2
+ movd %mm6, 12(%edx) C un=2
+L(rtr): emms
+ pop %ebx
+ pop %esi
+ ret
+
+L(un3): movd 4(%eax), %mm1 C un=3
+ pmuludq %mm7, %mm1 C un=3
+ movd 8(%eax), %mm2 C un=3
+ pmuludq %mm7, %mm2 C un=3
+ movd %mm6, (%edx) C un=3
+ psrlq $32, %mm6 C un=3
+ paddq %mm1, %mm6 C un=3
+ movd %mm6, 4(%edx) C un=3
+ psrlq $32, %mm6 C un=3
+ paddq %mm2, %mm6 C un=3
+ movd %mm6, 8(%edx) C un=3
+ psrlq $32, %mm6 C un=3
+ movd %mm6, 12(%edx) C un=3
+ dec %ebx C un=3
+ jz L(rtr) C un=3
+ movd 4(%esi), %mm7 C un=3
+ movd (%eax), %mm6 C un=3
+ pmuludq %mm7, %mm6 C un=3
+ movd 4(%eax), %mm1 C un=3
+ movd 4(%edx), %mm4 C un=3
+ pmuludq %mm7, %mm1 C un=3
+ movd 8(%eax), %mm2 C un=3
+ movd 8(%edx), %mm5 C un=3
+ pmuludq %mm7, %mm2 C un=3
+ paddq %mm4, %mm6 C un=3
+ paddq %mm1, %mm5 C un=3
+ movd 12(%edx), %mm4 C un=3
+ movd %mm6, 4(%edx) C un=3
+ psrlq $32, %mm6 C un=3
+ paddq %mm5, %mm6 C un=3
+ paddq %mm2, %mm4 C un=3
+ movd %mm6, 8(%edx) C un=3
+ psrlq $32, %mm6 C un=3
+ paddq %mm4, %mm6 C un=3
+ movd %mm6, 12(%edx) C un=3
+ psrlq $32, %mm6 C un=3
+ movd %mm6, 16(%edx) C un=3
+ dec %ebx C un=3
+ jz L(rtr) C un=3
+ movd 8(%esi), %mm7 C un=3
+ movd (%eax), %mm6 C un=3
+ pmuludq %mm7, %mm6 C un=3
+ movd 4(%eax), %mm1 C un=3
+ movd 8(%edx), %mm4 C un=3
+ pmuludq %mm7, %mm1 C un=3
+ movd 8(%eax), %mm2 C un=3
+ movd 12(%edx), %mm5 C un=3
+ pmuludq %mm7, %mm2 C un=3
+ paddq %mm4, %mm6 C un=3
+ paddq %mm1, %mm5 C un=3
+ movd 16(%edx), %mm4 C un=3
+ movd %mm6, 8(%edx) C un=3
+ psrlq $32, %mm6 C un=3
+ paddq %mm5, %mm6 C un=3
+ paddq %mm2, %mm4 C un=3
+ movd %mm6, 12(%edx) C un=3
+ psrlq $32, %mm6 C un=3
+ paddq %mm4, %mm6 C un=3
+ movd %mm6, 16(%edx) C un=3
+ psrlq $32, %mm6 C un=3
+ movd %mm6, 20(%edx) C un=3
+ jmp L(rtr)
+
+
+L(big): push %edi
+ pxor %mm6, %mm6
+ lea 4(%esi), %esi
+ and $3, %ecx
+ jz L(0)
+ cmp $2, %ecx
+ jc L(1)
+ jz L(2)
+ jmp L(3) C FIXME: one case should fall through
+
+
+L(0): movd (%eax), %mm3 C m 0
+ sub 24(%esp), %ecx C inner loop count m 0
+ mov %ecx, 24(%esp) C update loop count for later m 0
+ pmuludq %mm7, %mm3 C m 0
+ movd 4(%eax), %mm0 C m 0
+ pmuludq %mm7, %mm0 C m 0
+ movd 8(%eax), %mm1 C m 0
+ jmp L(m00) C m 0
+ ALIGN(16) C m 0
+L(lpm0):
+ pmuludq %mm7, %mm4 C m 0
+ paddq %mm0, %mm6 C m 0
+ movd (%eax), %mm3 C m 0
+ movd %mm6, -12(%edx) C m 0
+ psrlq $32, %mm6 C m 0
+ pmuludq %mm7, %mm3 C m 0
+ paddq %mm1, %mm6 C m 0
+ movd 4(%eax), %mm0 C m 0
+ movd %mm6, -8(%edx) C m 0
+ psrlq $32, %mm6 C m 0
+ pmuludq %mm7, %mm0 C m 0
+ paddq %mm4, %mm6 C m 0
+ movd 8(%eax), %mm1 C m 0
+ movd %mm6, -4(%edx) C m 0
+ psrlq $32, %mm6 C m 0
+L(m00): pmuludq %mm7, %mm1 C m 0
+ paddq %mm3, %mm6 C m 0
+ movd 12(%eax), %mm4 C m 0
+ movd %mm6, (%edx) C m 0
+ psrlq $32, %mm6 C m 0
+ lea 16(%eax), %eax C m 0
+ lea 16(%edx), %edx C m 0
+ add $4, %ecx C m 0
+ ja L(lpm0) C m 0
+ pmuludq %mm7, %mm4 C m 0
+ paddq %mm0, %mm6 C m 0
+ movd %mm6, -12(%edx) C m 0
+ psrlq $32, %mm6 C m 0
+ paddq %mm1, %mm6 C m 0
+ mov 16(%esp), %edi C rp 0
+ jmp L(x0)
+
+L(olp0):
+ lea 4(%edi), %edi C am 0
+ movd (%esi), %mm7 C am 0
+ lea 4(%esi), %esi C am 0
+ mov %edi, %edx C rp am 0
+ mov 20(%esp), %eax C up am 0
+ movd (%eax), %mm3 C am 0
+ mov 24(%esp), %ecx C inner loop count am 0
+ pxor %mm6, %mm6 C am 0
+ pmuludq %mm7, %mm3 C am 0
+ movd 4(%eax), %mm0 C am 0
+ movd (%edx), %mm5 C am 0
+ pmuludq %mm7, %mm0 C am 0
+ movd 8(%eax), %mm1 C am 0
+ paddq %mm3, %mm5 C am 0
+ movd 4(%edx), %mm4 C am 0
+ jmp L(am00) C am 0
+ ALIGN(16) C mm 0
+L(lam0):
+ pmuludq %mm7, %mm2 C am 0
+ paddq %mm4, %mm6 C am 0
+ movd (%eax), %mm3 C am 0
+ paddq %mm1, %mm5 C am 0
+ movd -4(%edx), %mm4 C am 0
+ movd %mm6, -12(%edx) C am 0
+ psrlq $32, %mm6 C am 0
+ pmuludq %mm7, %mm3 C am 0
+ paddq %mm5, %mm6 C am 0
+ movd 4(%eax), %mm0 C am 0
+ paddq %mm2, %mm4 C am 0
+ movd (%edx), %mm5 C am 0
+ movd %mm6, -8(%edx) C am 0
+ psrlq $32, %mm6 C am 0
+ pmuludq %mm7, %mm0 C am 0
+ paddq %mm4, %mm6 C am 0
+ movd 8(%eax), %mm1 C am 0
+ paddq %mm3, %mm5 C am 0
+ movd 4(%edx), %mm4 C am 0
+ movd %mm6, -4(%edx) C am 0
+ psrlq $32, %mm6 C am 0
+L(am00):
+ pmuludq %mm7, %mm1 C am 0
+ paddq %mm5, %mm6 C am 0
+ movd 12(%eax), %mm2 C am 0
+ paddq %mm0, %mm4 C am 0
+ movd 8(%edx), %mm5 C am 0
+ movd %mm6, (%edx) C am 0
+ psrlq $32, %mm6 C am 0
+ lea 16(%eax), %eax C am 0
+ lea 16(%edx), %edx C am 0
+ add $4, %ecx C am 0
+ jnz L(lam0) C am 0
+ pmuludq %mm7, %mm2 C am 0
+ paddq %mm4, %mm6 C am 0
+ paddq %mm1, %mm5 C am 0
+ movd -4(%edx), %mm4 C am 0
+ movd %mm6, -12(%edx) C am 0
+ psrlq $32, %mm6 C am 0
+ paddq %mm5, %mm6 C am 0
+ paddq %mm2, %mm4 C am 0
+L(x0): movd %mm6, -8(%edx) C am 0
+ psrlq $32, %mm6 C am 0
+ paddq %mm4, %mm6 C am 0
+ movd %mm6, -4(%edx) C am 0
+ psrlq $32, %mm6 C am 0
+ movd %mm6, (%edx) C am 0
+ dec %ebx C am 0
+ jnz L(olp0) C am 0
+L(oel0):
+ emms C 0
+ pop %edi C 0
+ pop %ebx C 0
+ pop %esi C 0
+ ret C 0
+
+
+L(1): movd (%eax), %mm4 C m 1
+ sub 24(%esp), %ecx C m 1
+ mov %ecx, 24(%esp) C update loop count for later m 1
+ pmuludq %mm7, %mm4 C m 1
+ movd 4(%eax), %mm3 C m 1
+ pmuludq %mm7, %mm3 C m 1
+ movd 8(%eax), %mm0 C m 1
+ jmp L(m01) C m 1
+ ALIGN(16) C m 1
+L(lpm1):
+ pmuludq %mm7, %mm4 C m 1
+ paddq %mm0, %mm6 C m 1
+ movd 4(%eax), %mm3 C m 1
+ movd %mm6, -8(%edx) C m 1
+ psrlq $32, %mm6 C m 1
+ pmuludq %mm7, %mm3 C m 1
+ paddq %mm1, %mm6 C m 1
+ movd 8(%eax), %mm0 C m 1
+ movd %mm6, -4(%edx) C m 1
+ psrlq $32, %mm6 C m 1
+L(m01): pmuludq %mm7, %mm0 C m 1
+ paddq %mm4, %mm6 C m 1
+ movd 12(%eax), %mm1 C m 1
+ movd %mm6, (%edx) C m 1
+ psrlq $32, %mm6 C m 1
+ pmuludq %mm7, %mm1 C m 1
+ paddq %mm3, %mm6 C m 1
+ movd 16(%eax), %mm4 C m 1
+ movd %mm6, 4(%edx) C m 1
+ psrlq $32, %mm6 C m 1
+ lea 16(%eax), %eax C m 1
+ lea 16(%edx), %edx C m 1
+ add $4, %ecx C m 1
+ ja L(lpm1) C m 1
+ pmuludq %mm7, %mm4 C m 1
+ paddq %mm0, %mm6 C m 1
+ movd %mm6, -8(%edx) C m 1
+ psrlq $32, %mm6 C m 1
+ paddq %mm1, %mm6 C m 1
+ mov 16(%esp), %edi C rp 1
+ jmp L(x1)
+
+L(olp1):
+ lea 4(%edi), %edi C am 1
+ movd (%esi), %mm7 C am 1
+ lea 4(%esi), %esi C am 1
+ mov %edi, %edx C rp am 1
+ mov 20(%esp), %eax C up am 1
+ movd (%eax), %mm2 C am 1
+ mov 24(%esp), %ecx C inner loop count am 1
+ pxor %mm6, %mm6 C am 1
+ pmuludq %mm7, %mm2 C am 1
+ movd 4(%eax), %mm3 C am 1
+ movd (%edx), %mm4 C am 1
+ pmuludq %mm7, %mm3 C am 1
+ movd 8(%eax), %mm0 C am 1
+ paddq %mm2, %mm4 C am 1
+ movd 4(%edx), %mm5 C am 1
+ jmp L(am01) C am 1
+ ALIGN(16) C am 1
+L(lam1):
+ pmuludq %mm7, %mm2 C am 1
+ paddq %mm4, %mm6 C am 1
+ movd 4(%eax), %mm3 C am 1
+ paddq %mm1, %mm5 C am 1
+ movd (%edx), %mm4 C am 1
+ movd %mm6, -8(%edx) C am 1
+ psrlq $32, %mm6 C am 1
+ pmuludq %mm7, %mm3 C am 1
+ paddq %mm5, %mm6 C am 1
+ movd 8(%eax), %mm0 C am 1
+ paddq %mm2, %mm4 C am 1
+ movd 4(%edx), %mm5 C am 1
+ movd %mm6, -4(%edx) C am 1
+ psrlq $32, %mm6 C am 1
+L(am01):
+ pmuludq %mm7, %mm0 C am 1
+ paddq %mm4, %mm6 C am 1
+ movd 12(%eax), %mm1 C am 1
+ paddq %mm3, %mm5 C am 1
+ movd 8(%edx), %mm4 C am 1
+ movd %mm6, (%edx) C am 1
+ psrlq $32, %mm6 C am 1
+ pmuludq %mm7, %mm1 C am 1
+ paddq %mm5, %mm6 C am 1
+ movd 16(%eax), %mm2 C am 1
+ paddq %mm0, %mm4 C am 1
+ movd 12(%edx), %mm5 C am 1
+ movd %mm6, 4(%edx) C am 1
+ psrlq $32, %mm6 C am 1
+ lea 16(%eax), %eax C am 1
+ lea 16(%edx), %edx C am 1
+ add $4, %ecx C am 1
+ jnz L(lam1) C am 1
+ pmuludq %mm7, %mm2 C am 1
+ paddq %mm4, %mm6 C am 1
+ paddq %mm1, %mm5 C am 1
+ movd (%edx), %mm4 C am 1
+ movd %mm6, -8(%edx) C am 1
+ psrlq $32, %mm6 C am 1
+ paddq %mm5, %mm6 C am 1
+ paddq %mm2, %mm4 C am 1
+L(x1): movd %mm6, -4(%edx) C am 1
+ psrlq $32, %mm6 C am 1
+ paddq %mm4, %mm6 C am 1
+ movd %mm6, (%edx) C am 1
+ psrlq $32, %mm6 C am 1
+ movd %mm6, 4(%edx) C am 1
+ dec %ebx C am 1
+ jnz L(olp1) C am 1
+L(oel1):
+ emms C 1
+ pop %edi C 1
+ pop %ebx C 1
+ pop %esi C 1
+ ret C 1
+
+
+L(2): movd (%eax), %mm1 C m 2
+ sub 24(%esp), %ecx C m 2
+ mov %ecx, 24(%esp) C update loop count for later m 2
+ pmuludq %mm7, %mm1 C m 2
+ movd 4(%eax), %mm4 C m 2
+ pmuludq %mm7, %mm4 C m 2
+ movd 8(%eax), %mm3 C m 2
+ jmp L(m10) C m 2
+ ALIGN(16) C m 2
+L(lpm2):
+ pmuludq %mm7, %mm4 C m 2
+ paddq %mm0, %mm6 C m 2
+ movd 8(%eax), %mm3 C m 2
+ movd %mm6, -4(%edx) C m 2
+ psrlq $32, %mm6 C m 2
+L(m10): pmuludq %mm7, %mm3 C m 2
+ paddq %mm1, %mm6 C m 2
+ movd 12(%eax), %mm0 C m 2
+ movd %mm6, (%edx) C m 2
+ psrlq $32, %mm6 C m 2
+ pmuludq %mm7, %mm0 C m 2
+ paddq %mm4, %mm6 C m 2
+ movd 16(%eax), %mm1 C m 2
+ movd %mm6, 4(%edx) C m 2
+ psrlq $32, %mm6 C m 2
+ pmuludq %mm7, %mm1 C m 2
+ paddq %mm3, %mm6 C m 2
+ movd 20(%eax), %mm4 C m 2
+ movd %mm6, 8(%edx) C m 2
+ psrlq $32, %mm6 C m 2
+ lea 16(%eax), %eax C m 2
+ lea 16(%edx), %edx C m 2
+ add $4, %ecx C m 2
+ ja L(lpm2) C m 2
+ pmuludq %mm7, %mm4 C m 2
+ paddq %mm0, %mm6 C m 2
+ movd %mm6, -4(%edx) C m 2
+ psrlq $32, %mm6 C m 2
+ paddq %mm1, %mm6 C m 2
+ mov 16(%esp), %edi C rp 2
+ jmp L(x2)
+
+L(olp2):
+ lea 4(%edi), %edi C am 2
+ movd (%esi), %mm7 C am 2
+ lea 4(%esi), %esi C am 2
+ mov %edi, %edx C rp am 2
+ mov 20(%esp), %eax C up am 2
+ movd (%eax), %mm1 C am 2
+ mov 24(%esp), %ecx C inner loop count am 2
+ pxor %mm6, %mm6 C am 2
+ pmuludq %mm7, %mm1 C am 2
+ movd 4(%eax), %mm2 C am 2
+ movd (%edx), %mm5 C am 2
+ pmuludq %mm7, %mm2 C am 2
+ movd 8(%eax), %mm3 C am 2
+ paddq %mm1, %mm5 C am 2
+ movd 4(%edx), %mm4 C am 2
+ jmp L(am10) C am 2
+ ALIGN(16) C am 2
+L(lam2):
+ pmuludq %mm7, %mm2 C am 2
+ paddq %mm4, %mm6 C am 2
+ movd 8(%eax), %mm3 C am 2
+ paddq %mm1, %mm5 C am 2
+ movd 4(%edx), %mm4 C am 2
+ movd %mm6, -4(%edx) C am 2
+ psrlq $32, %mm6 C am 2
+L(am10):
+ pmuludq %mm7, %mm3 C am 2
+ paddq %mm5, %mm6 C am 2
+ movd 12(%eax), %mm0 C am 2
+ paddq %mm2, %mm4 C am 2
+ movd 8(%edx), %mm5 C am 2
+ movd %mm6, (%edx) C am 2
+ psrlq $32, %mm6 C am 2
+ pmuludq %mm7, %mm0 C am 2
+ paddq %mm4, %mm6 C am 2
+ movd 16(%eax), %mm1 C am 2
+ paddq %mm3, %mm5 C am 2
+ movd 12(%edx), %mm4 C am 2
+ movd %mm6, 4(%edx) C am 2
+ psrlq $32, %mm6 C am 2
+ pmuludq %mm7, %mm1 C am 2
+ paddq %mm5, %mm6 C am 2
+ movd 20(%eax), %mm2 C am 2
+ paddq %mm0, %mm4 C am 2
+ movd 16(%edx), %mm5 C am 2
+ movd %mm6, 8(%edx) C am 2
+ psrlq $32, %mm6 C am 2
+ lea 16(%eax), %eax C am 2
+ lea 16(%edx), %edx C am 2
+ add $4, %ecx C am 2
+ jnz L(lam2) C am 2
+ pmuludq %mm7, %mm2 C am 2
+ paddq %mm4, %mm6 C am 2
+ paddq %mm1, %mm5 C am 2
+ movd 4(%edx), %mm4 C am 2
+ movd %mm6, -4(%edx) C am 2
+ psrlq $32, %mm6 C am 2
+ paddq %mm5, %mm6 C am 2
+ paddq %mm2, %mm4 C am 2
+L(x2): movd %mm6, (%edx) C am 2
+ psrlq $32, %mm6 C am 2
+ paddq %mm4, %mm6 C am 2
+ movd %mm6, 4(%edx) C am 2
+ psrlq $32, %mm6 C am 2
+ movd %mm6, 8(%edx) C am 2
+ dec %ebx C am 2
+ jnz L(olp2) C am 2
+L(oel2):
+ emms C 2
+ pop %edi C 2
+ pop %ebx C 2
+ pop %esi C 2
+ ret C 2
+
+
+L(3): movd (%eax), %mm0 C m 3
+ sub 24(%esp), %ecx C m 3
+ mov %ecx, 24(%esp) C update loop count for later m 3
+ pmuludq %mm7, %mm0 C m 3
+ movd 4(%eax), %mm1 C m 3
+ pmuludq %mm7, %mm1 C m 3
+ movd 8(%eax), %mm4 C m 3
+ jmp L(lpm3) C m 3
+ ALIGN(16) C m 3
+L(lpm3):
+ pmuludq %mm7, %mm4 C m 3
+ paddq %mm0, %mm6 C m 3
+ movd 12(%eax), %mm3 C m 3
+ movd %mm6, (%edx) C m 3
+ psrlq $32, %mm6 C m 3
+ pmuludq %mm7, %mm3 C m 3
+ paddq %mm1, %mm6 C m 3
+ movd 16(%eax), %mm0 C m 3
+ movd %mm6, 4(%edx) C m 3
+ psrlq $32, %mm6 C m 3
+ pmuludq %mm7, %mm0 C m 3
+ paddq %mm4, %mm6 C m 3
+ movd 20(%eax), %mm1 C m 3
+ movd %mm6, 8(%edx) C m 3
+ psrlq $32, %mm6 C m 3
+ pmuludq %mm7, %mm1 C m 3
+ paddq %mm3, %mm6 C m 3
+ movd 24(%eax), %mm4 C m 3
+ movd %mm6, 12(%edx) C m 3
+ psrlq $32, %mm6 C m 3
+ lea 16(%eax), %eax C m 3
+ lea 16(%edx), %edx C m 3
+ add $4, %ecx C m 3
+ ja L(lpm3) C m 3
+ pmuludq %mm7, %mm4 C m 3
+ paddq %mm0, %mm6 C m 3
+ movd %mm6, (%edx) C m 3
+ psrlq $32, %mm6 C m 3
+ paddq %mm1, %mm6 C m 3
+ mov 16(%esp), %edi C rp 3
+ jmp L(x3)
+
+L(olp3):
+ lea 4(%edi), %edi C am 3
+ movd (%esi), %mm7 C am 3
+ lea 4(%esi), %esi C am 3
+ mov %edi, %edx C rp am 3
+ mov 20(%esp), %eax C up am 3
+ movd (%eax), %mm0 C am 3
+ mov 24(%esp), %ecx C inner loop count am 3
+ pxor %mm6, %mm6 C am 3
+ pmuludq %mm7, %mm0 C am 3
+ movd 4(%eax), %mm1 C am 3
+ movd (%edx), %mm4 C am 3
+ pmuludq %mm7, %mm1 C am 3
+ movd 8(%eax), %mm2 C am 3
+ paddq %mm0, %mm4 C am 3
+ movd 4(%edx), %mm5 C am 3
+ jmp L(lam3) C am 3
+ ALIGN(16) C am 3
+L(lam3):
+ pmuludq %mm7, %mm2 C am 3
+ paddq %mm4, %mm6 C am 3
+ movd 12(%eax), %mm3 C am 3
+ paddq %mm1, %mm5 C am 3
+ movd 8(%edx), %mm4 C am 3
+ movd %mm6, (%edx) C am 3
+ psrlq $32, %mm6 C am 3
+ pmuludq %mm7, %mm3 C am 3
+ paddq %mm5, %mm6 C am 3
+ movd 16(%eax), %mm0 C am 3
+ paddq %mm2, %mm4 C am 3
+ movd 12(%edx), %mm5 C am 3
+ movd %mm6, 4(%edx) C am 3
+ psrlq $32, %mm6 C am 3
+ pmuludq %mm7, %mm0 C am 3
+ paddq %mm4, %mm6 C am 3
+ movd 20(%eax), %mm1 C am 3
+ paddq %mm3, %mm5 C am 3
+ movd 16(%edx), %mm4 C am 3
+ movd %mm6, 8(%edx) C am 3
+ psrlq $32, %mm6 C am 3
+ pmuludq %mm7, %mm1 C am 3
+ paddq %mm5, %mm6 C am 3
+ movd 24(%eax), %mm2 C am 3
+ paddq %mm0, %mm4 C am 3
+ movd 20(%edx), %mm5 C am 3
+ movd %mm6, 12(%edx) C am 3
+ psrlq $32, %mm6 C am 3
+ lea 16(%eax), %eax C am 3
+ lea 16(%edx), %edx C am 3
+ add $4, %ecx C am 3
+ jnz L(lam3) C am 3
+ pmuludq %mm7, %mm2 C am 3
+ paddq %mm4, %mm6 C am 3
+ paddq %mm1, %mm5 C am 3
+ movd 8(%edx), %mm4 C am 3
+ movd %mm6, (%edx) C am 3
+ psrlq $32, %mm6 C am 3
+ paddq %mm5, %mm6 C am 3
+ paddq %mm2, %mm4 C am 3
+L(x3): movd %mm6, 4(%edx) C am 3
+ psrlq $32, %mm6 C am 3
+ paddq %mm4, %mm6 C am 3
+ movd %mm6, 8(%edx) C am 3
+ psrlq $32, %mm6 C am 3
+ movd %mm6, 12(%edx) C am 3
+ dec %ebx C am 3
+ jnz L(olp3) C am 3
+L(oel3):
+ emms C 3
+ pop %edi C 3
+ pop %ebx C 3
+ pop %esi C 3
+ ret C 3
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium4/sse2/popcount.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium4/sse2/popcount.asm
new file mode 100644
index 00000000000..b8238b9b66e
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium4/sse2/popcount.asm
@@ -0,0 +1,280 @@
+dnl X86-32 and X86-64 mpn_popcount using SSE2.
+
+dnl Copyright 2006, 2007, 2011 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 32-bit popcount hamdist
+C cycles/limb cycles/limb
+C P5 -
+C P6 model 0-8,10-12 -
+C P6 model 9 (Banias) ?
+C P6 model 13 (Dothan) 4
+C P4 model 0 (Willamette) ?
+C P4 model 1 (?) ?
+C P4 model 2 (Northwood) 3.9
+C P4 model 3 (Prescott) ?
+C P4 model 4 (Nocona) ?
+C AMD K6 -
+C AMD K7 -
+C AMD K8 ?
+
+C 64-bit popcount hamdist
+C cycles/limb cycles/limb
+C P4 model 4 (Nocona): 8
+C AMD K8,K9 7.5
+C AMD K10 3.5
+C Intel core2 3.68
+C Intel corei 3.15
+C Intel atom 10.8
+C VIA nano 6.5
+
+C TODO
+C * Make a mpn_hamdist based on this. Alignment could either be handled by
+C using movdqu for one operand and movdqa for the other, or by painfully
+C shifting as we go. Unfortunately, there seem to be no usable shift
+C instruction, except for one that takes an immediate count.
+C * It would probably be possible to cut a few cycles/limb using software
+C pipelining.
+C * There are 35 decode slots unused by the SSE2 instructions. Loop control
+C needs just 2 or 3 slots, leaving around 32 slots. This allows a parallel
+C integer based popcount. Such a combined loop would handle 6 limbs in
+C about 30 cycles on K8.
+C * We could save a byte or two by using 32-bit operations on areg.
+C * Check if using movdqa to a temp of and then register-based pand is faster.
+
+ifelse(GMP_LIMB_BITS,`32',
+` define(`up', `%edx')
+ define(`n', `%ecx')
+ define(`areg',`%eax')
+ define(`breg',`%ebx')
+ define(`zero',`%xmm4')
+ define(`LIMB32',` $1')
+ define(`LIMB64',`dnl')
+',`
+ define(`up', `%rdi')
+ define(`n', `%rsi')
+ define(`areg',`%rax')
+ define(`breg',`%rdx')
+ define(`zero',`%xmm8')
+ define(`LIMB32',`dnl')
+ define(`LIMB64',` $1')
+')
+
+define(`mm01010101',`%xmm6')
+define(`mm00110011',`%xmm7')
+define(`mm00001111',`%xmm2')
+
+define(`GMP_LIMB_BYTES', eval(GMP_LIMB_BITS/8))
+define(`LIMBS_PER_XMM', eval(16/GMP_LIMB_BYTES))
+define(`LIMBS_PER_2XMM', eval(32/GMP_LIMB_BYTES))
+
+undefine(`psadbw') C override inherited m4 version
+
+ASM_START()
+
+C Make cnsts global to work around Apple relocation bug.
+ifdef(`DARWIN',`
+ define(`cnsts', MPN(popccnsts))
+ GLOBL cnsts')
+
+ TEXT
+ ALIGN(32)
+PROLOGUE(mpn_popcount)
+
+LIMB32(`mov 4(%esp), up ')
+LIMB32(`mov 8(%esp), n ')
+LIMB32(`push %ebx ')
+
+ pxor %xmm3, %xmm3 C zero grand total count
+LIMB64(`pxor zero, zero ')
+ifdef(`PIC',`
+ LEA( cnsts, breg)
+',`
+LIMB32(`mov $cnsts, breg ')
+LIMB64(`movabs $cnsts, breg ')
+')
+
+ movdqa -48(breg), mm01010101
+ movdqa -32(breg), mm00110011
+ movdqa -16(breg), mm00001111
+
+ mov up, areg
+ and $-16, up C round `up' down to 128-bit boundary
+ and $12, areg C 32:areg = 0, 4, 8, 12
+ C 64:areg = 0, 8
+ movdqa (up), %xmm0
+ pand 64(breg,areg,4), %xmm0
+ shr $m4_log2(GMP_LIMB_BYTES), %eax
+ add areg, n C compensate n for rounded down `up'
+
+ pxor %xmm4, %xmm4
+ sub $LIMBS_PER_XMM, n
+ jbe L(sum)
+
+ sub $LIMBS_PER_XMM, n
+ ja L(ent)
+ jmp L(lsum)
+
+ ALIGN(16)
+L(top): movdqa (up), %xmm0
+L(ent): movdqa 16(up), %xmm4
+
+ movdqa %xmm0, %xmm1
+ movdqa %xmm4, %xmm5
+ psrld $1, %xmm0
+ psrld $1, %xmm4
+ pand mm01010101, %xmm0
+ pand mm01010101, %xmm4
+ psubd %xmm0, %xmm1
+ psubd %xmm4, %xmm5
+
+ movdqa %xmm1, %xmm0
+ movdqa %xmm5, %xmm4
+ psrlq $2, %xmm1
+ psrlq $2, %xmm5
+ pand mm00110011, %xmm0
+ pand mm00110011, %xmm4
+ pand mm00110011, %xmm1
+ pand mm00110011, %xmm5
+ paddq %xmm0, %xmm1
+ paddq %xmm4, %xmm5
+
+LIMB32(`pxor zero, zero ')
+
+ add $32, up
+ sub $LIMBS_PER_2XMM, n
+
+ paddq %xmm5, %xmm1
+ movdqa %xmm1, %xmm0
+ psrlq $4, %xmm1
+ pand mm00001111, %xmm0
+ pand mm00001111, %xmm1
+ paddq %xmm0, %xmm1
+
+ psadbw zero, %xmm1
+ paddq %xmm1, %xmm3 C add to grand total
+
+ jnc L(top)
+L(end):
+ add $LIMBS_PER_2XMM, n
+ jz L(rt)
+ movdqa (up), %xmm0
+ pxor %xmm4, %xmm4
+ sub $LIMBS_PER_XMM, n
+ jbe L(sum)
+L(lsum):
+ movdqa %xmm0, %xmm4
+ movdqa 16(up), %xmm0
+L(sum):
+ shl $m4_log2(GMP_LIMB_BYTES), n
+ and $12, n
+ pand (breg,n,4), %xmm0
+
+ movdqa %xmm0, %xmm1
+ movdqa %xmm4, %xmm5
+ psrld $1, %xmm0
+ psrld $1, %xmm4
+ pand mm01010101, %xmm0
+ pand mm01010101, %xmm4
+ psubd %xmm0, %xmm1
+ psubd %xmm4, %xmm5
+
+ movdqa %xmm1, %xmm0
+ movdqa %xmm5, %xmm4
+ psrlq $2, %xmm1
+ psrlq $2, %xmm5
+ pand mm00110011, %xmm0
+ pand mm00110011, %xmm4
+ pand mm00110011, %xmm1
+ pand mm00110011, %xmm5
+ paddq %xmm0, %xmm1
+ paddq %xmm4, %xmm5
+
+LIMB32(`pxor zero, zero ')
+
+ paddq %xmm5, %xmm1
+ movdqa %xmm1, %xmm0
+ psrlq $4, %xmm1
+ pand mm00001111, %xmm0
+ pand mm00001111, %xmm1
+ paddq %xmm0, %xmm1
+
+ psadbw zero, %xmm1
+ paddq %xmm1, %xmm3 C add to grand total
+
+
+C Add the two 64-bit halves of the grand total counter
+L(rt): movdqa %xmm3, %xmm0
+ psrldq $8, %xmm3
+ paddq %xmm3, %xmm0
+ movd %xmm0, areg C movq avoided due to gas bug
+
+LIMB32(`pop %ebx ')
+ ret
+
+EPILOGUE()
+DEF_OBJECT(dummy,16)
+C Three magic constants used for masking out bits
+ .byte 0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55
+ .byte 0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55
+
+ .byte 0x33,0x33,0x33,0x33,0x33,0x33,0x33,0x33
+ .byte 0x33,0x33,0x33,0x33,0x33,0x33,0x33,0x33
+
+ .byte 0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f
+ .byte 0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f
+cnsts:
+C Masks for high end of number
+ .byte 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff
+ .byte 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff
+
+ .byte 0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00
+ .byte 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+
+ .byte 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff
+ .byte 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+
+ .byte 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff
+ .byte 0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00
+C Masks for low end of number
+ .byte 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff
+ .byte 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff
+
+ .byte 0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff
+ .byte 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff
+
+ .byte 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+ .byte 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff
+
+ .byte 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+ .byte 0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff
+END_OBJECT(dummy)
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium4/sse2/rsh1add_n.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium4/sse2/rsh1add_n.asm
new file mode 100644
index 00000000000..f421d1323eb
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium4/sse2/rsh1add_n.asm
@@ -0,0 +1,126 @@
+dnl Intel Pentium-4 mpn_rsh1add_n -- mpn (x+y)/2
+
+dnl Copyright 2001-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 cycles/limb (approx)
+C dst!=src1,2 dst==src1 dst==src2
+C P4: 4.5 6.5 6.5
+
+
+C mp_limb_t mpn_rsh1add_n (mp_ptr wp, mp_srcptr xp, mp_srcptr yp,
+C mp_size_t size);
+C
+C The slightly strange combination of indexing and pointer incrementing
+C that's used seems to work best. Not sure why, but for instance leal
+C incrementing on %esi is a 1 or 2 cycle slowdown.
+C
+C The dependent chain is paddq combining the carry and next (shifted) part,
+C plus psrlq to move the new carry down. That, and just 4 mmx instructions
+C in total, makes 4 c/l the target speed, which is almost achieved for
+C separate src/dst but when src==dst the write combining anomalies slow it
+C down.
+
+defframe(PARAM_SIZE, 16)
+defframe(PARAM_YP, 12)
+defframe(PARAM_XP, 8)
+defframe(PARAM_WP, 4)
+
+dnl re-use parameter space
+define(SAVE_EBX,`PARAM_XP')
+define(SAVE_ESI,`PARAM_YP')
+
+ TEXT
+ ALIGN(8)
+
+PROLOGUE(mpn_rsh1add_n)
+deflit(`FRAME',0)
+
+ movl PARAM_XP, %edx
+ movl %ebx, SAVE_EBX
+
+ movl PARAM_YP, %ebx
+ movl %esi, SAVE_ESI
+
+ movl PARAM_WP, %esi
+
+ movd (%edx), %mm0 C xp[0]
+
+ movd (%ebx), %mm1 C yp[0]
+ movl PARAM_SIZE, %ecx
+
+ movl (%edx), %eax C xp[0]
+
+ addl (%ebx), %eax C xp[0]+yp[0]
+
+ paddq %mm1, %mm0 C xp[0]+yp[0]
+ leal (%esi,%ecx,4), %esi C wp end
+ negl %ecx C -size
+
+ psrlq $1, %mm0 C (xp[0]+yp[0])/2
+ and $1, %eax C return value, rsh1 bit of xp[0]+yp[0]
+ addl $1, %ecx C -(size-1)
+ jz L(done)
+
+
+L(top):
+ C eax return value
+ C ebx yp end
+ C ecx counter, limbs, -(size-1) to -1 inclusive
+ C edx xp end
+ C esi wp end
+ C mm0 carry (32 bits)
+
+ movd 4(%edx), %mm1 C xp[i+1]
+ movd 4(%ebx), %mm2 C yp[i+1]
+ leal 4(%edx), %edx
+ leal 4(%ebx), %ebx
+ paddq %mm2, %mm1 C xp[i+1]+yp[i+1]
+ psllq $31, %mm1 C low bit at 31, further 32 above
+
+ paddq %mm1, %mm0 C 31 and carry from prev add
+ movd %mm0, -4(%esi,%ecx,4) C low ready to store dst[i]
+
+ psrlq $32, %mm0 C high becomes new carry
+
+ addl $1, %ecx
+ jnz L(top)
+
+
+L(done):
+ movd %mm0, -4(%esi) C dst[size-1]
+ movl SAVE_EBX, %ebx
+
+ movl SAVE_ESI, %esi
+ emms
+ ret
+
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium4/sse2/sqr_basecase.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium4/sse2/sqr_basecase.asm
new file mode 100644
index 00000000000..2dd57d25d9a
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium4/sse2/sqr_basecase.asm
@@ -0,0 +1,705 @@
+dnl mpn_sqr_basecase for Pentium 4 and P6 models with SSE2 (i.e., 9,D,E,F).
+
+dnl Copyright 2001, 2002, 2007 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 TODO:
+C * Improve ad-hoc outer loop code and register handling. Some feed-in
+C scheduling could improve things by several cycles per outer iteration.
+C * In Lam3...Lam1 code for, keep accumulation operands in registers, without
+C storing intermediates to rp.
+C * We might want to keep 32 in a free mm register, since the register form is
+C 3 bytes and the immediate form is 4 bytes. About 80 bytes to save.
+C * Look into different loop alignment, we now expand the code about 50 bytes
+C with possibly needless alignment.
+C * Use OSP, should solve feed-in latency problems.
+C * Address relative slowness for un<=3 for Pentium M. The old code is there
+C considerably faster. (1:20/14, 2:34:32, 3:66/57)
+
+C INPUT PARAMETERS
+C rp sp + 4
+C up sp + 8
+C un sp + 12
+
+ TEXT
+ ALIGN(16)
+PROLOGUE(mpn_sqr_basecase)
+ mov 4(%esp), %edx C rp
+ mov 8(%esp), %eax C up
+ mov 12(%esp), %ecx C un
+
+ cmp $2, %ecx
+ jc L(un1)
+ jz L(un2)
+ cmp $4, %ecx
+ jc L(un3)
+ jz L(un4)
+ jmp L(big)
+
+L(un1): mov (%eax), %eax
+ mov %edx, %ecx
+ mul %eax
+ mov %eax, (%ecx)
+ mov %edx, 4(%ecx)
+ ret
+L(un2): movd (%eax), %mm0 C un=2
+ movd (%eax), %mm2 C un=2
+ movd 4(%eax), %mm1 C un=2
+ pmuludq %mm0, %mm0 C 64b weight 0 un=2
+ pmuludq %mm1, %mm2 C 64b weight 32 un=2
+ pmuludq %mm1, %mm1 C 64b weight 64 un=2
+ movd %mm0, (%edx) C un=2
+ psrlq $32, %mm0 C 32b weight 32 un=2
+ pcmpeqd %mm7, %mm7 C un=2
+ psrlq $33, %mm7 C 0x000000007FFFFFFF un=2
+ pand %mm2, %mm7 C 31b weight 32 un=2
+ psrlq $31, %mm2 C 33b weight 65 un=2
+ psllq $1, %mm7 C 31b weight 33 un=2
+ paddq %mm7, %mm0 C un=2
+ movd %mm0, 4(%edx) C un=2
+ psrlq $32, %mm0 C un=2
+ paddq %mm2, %mm1 C un=2
+ paddq %mm0, %mm1 C un=2
+ movd %mm1, 8(%edx) C un=2
+ psrlq $32, %mm1 C un=2
+ movd %mm1, 12(%edx) C un=2
+ emms
+ ret
+L(un3): movd (%eax), %mm7 C un=3
+ movd 4(%eax), %mm6 C un=3
+ pmuludq %mm7, %mm6 C un=3
+ movd 8(%eax), %mm2 C un=3
+ pmuludq %mm7, %mm2 C un=3
+ movd %mm6, 4(%edx) C un=3
+ psrlq $32, %mm6 C un=3
+ paddq %mm2, %mm6 C un=3
+ movd %mm6, 8(%edx) C un=3
+ psrlq $32, %mm6 C un=3
+ movd %mm6, 12(%edx) C un=3
+ lea 4(%edx), %edx C un=3
+ lea 4(%eax), %eax C un=3
+ jmp L(am1)
+L(un4): movd (%eax), %mm7 C un=4
+ movd 4(%eax), %mm6 C un=4
+ pmuludq %mm7, %mm6 C un=4
+ movd 8(%eax), %mm0 C un=4
+ pmuludq %mm7, %mm0 C un=4
+ movd 12(%eax), %mm1 C un=4
+ pmuludq %mm7, %mm1 C un=4
+ movd %mm6, 4(%edx) C un=4
+ psrlq $32, %mm6 C un=4
+ paddq %mm0, %mm6 C un=4
+ movd %mm6, 8(%edx) C un=4
+ psrlq $32, %mm6 C un=4
+ paddq %mm1, %mm6 C un=4
+ movd %mm6, 12(%edx) C un=4
+ psrlq $32, %mm6 C un=4
+ movd %mm6, 16(%edx) C un=4
+ lea 4(%edx), %edx C un=4
+ lea 4(%eax), %eax C un=4
+ jmp L(am2)
+
+L(big): push %esi
+ push %ebx
+ push %edi
+ pxor %mm6, %mm6
+ movd (%eax), %mm7 C
+ lea 4(%eax), %esi C init up, up++
+ lea 4(%eax), %eax C up2++ FIXME: should fix offsets
+ lea 4(%edx), %edi C init rp, rp++
+ lea 4(%edx), %edx C rp2++
+ lea -4(%ecx), %ebx C loop count
+ and $3, %ecx
+ jz L(3m)
+ cmp $2, %ecx
+ ja L(2m)
+ jb L(0m)
+
+L(1m):
+ movd (%eax), %mm4 C m 1
+ lea (%ebx), %ecx C inner loop count m 1
+ pmuludq %mm7, %mm4 C m 1
+ movd 4(%eax), %mm3 C m 1
+ pmuludq %mm7, %mm3 C m 1
+ movd 8(%eax), %mm0 C m 1
+ jmp L(m01) C m 1
+ ALIGN(16) C m 1
+L(lpm1):
+ pmuludq %mm7, %mm4 C m 1
+ paddq %mm0, %mm6 C m 1
+ movd 4(%eax), %mm3 C m 1
+ movd %mm6, -8(%edx) C m 1
+ psrlq $32, %mm6 C m 1
+ pmuludq %mm7, %mm3 C m 1
+ paddq %mm1, %mm6 C m 1
+ movd 8(%eax), %mm0 C m 1
+ movd %mm6, -4(%edx) C m 1
+ psrlq $32, %mm6 C m 1
+L(m01): pmuludq %mm7, %mm0 C m 1
+ paddq %mm4, %mm6 C m 1
+ movd 12(%eax), %mm1 C m 1
+ movd %mm6, (%edx) C m 1
+ psrlq $32, %mm6 C m 1
+ pmuludq %mm7, %mm1 C m 1
+ paddq %mm3, %mm6 C m 1
+ movd 16(%eax), %mm4 C m 1
+ movd %mm6, 4(%edx) C m 1
+ psrlq $32, %mm6 C m 1
+ lea 16(%eax), %eax C m 1
+ lea 16(%edx), %edx C m 1
+ sub $4, %ecx C m 1
+ ja L(lpm1) C m 1
+ pmuludq %mm7, %mm4 C m 1
+ paddq %mm0, %mm6 C m 1
+ movd %mm6, -8(%edx) C m 1
+ psrlq $32, %mm6 C m 1
+ paddq %mm1, %mm6 C m 1
+ jmp L(0)
+
+L(2m):
+ movd (%eax), %mm1 C m 2
+ lea (%ebx), %ecx C inner loop count m 2
+ pmuludq %mm7, %mm1 C m 2
+ movd 4(%eax), %mm4 C m 2
+ pmuludq %mm7, %mm4 C m 2
+ movd 8(%eax), %mm3 C m 2
+ jmp L(m10) C m 2
+ ALIGN(16) C m 2
+L(lpm2):
+ pmuludq %mm7, %mm4 C m 2
+ paddq %mm0, %mm6 C m 2
+ movd 8(%eax), %mm3 C m 2
+ movd %mm6, -4(%edx) C m 2
+ psrlq $32, %mm6 C m 2
+L(m10): pmuludq %mm7, %mm3 C m 2
+ paddq %mm1, %mm6 C m 2
+ movd 12(%eax), %mm0 C m 2
+ movd %mm6, (%edx) C m 2
+ psrlq $32, %mm6 C m 2
+ pmuludq %mm7, %mm0 C m 2
+ paddq %mm4, %mm6 C m 2
+ movd 16(%eax), %mm1 C m 2
+ movd %mm6, 4(%edx) C m 2
+ psrlq $32, %mm6 C m 2
+ pmuludq %mm7, %mm1 C m 2
+ paddq %mm3, %mm6 C m 2
+ movd 20(%eax), %mm4 C m 2
+ movd %mm6, 8(%edx) C m 2
+ psrlq $32, %mm6 C m 2
+ lea 16(%eax), %eax C m 2
+ lea 16(%edx), %edx C m 2
+ sub $4, %ecx C m 2
+ ja L(lpm2) C m 2
+ pmuludq %mm7, %mm4 C m 2
+ paddq %mm0, %mm6 C m 2
+ movd %mm6, -4(%edx) C m 2
+ psrlq $32, %mm6 C m 2
+ paddq %mm1, %mm6 C m 2
+ jmp L(1)
+
+L(3m):
+ movd (%eax), %mm0 C m 3
+ lea (%ebx), %ecx C inner loop count m 3
+ pmuludq %mm7, %mm0 C m 3
+ movd 4(%eax), %mm1 C m 3
+ pmuludq %mm7, %mm1 C m 3
+ movd 8(%eax), %mm4 C m 3
+ jmp L(lpm3) C m 3
+ ALIGN(16) C m 3
+L(lpm3):
+ pmuludq %mm7, %mm4 C m 3
+ paddq %mm0, %mm6 C m 3
+ movd 12(%eax), %mm3 C m 3
+ movd %mm6, (%edx) C m 3
+ psrlq $32, %mm6 C m 3
+ pmuludq %mm7, %mm3 C m 3
+ paddq %mm1, %mm6 C m 3
+ movd 16(%eax), %mm0 C m 3
+ movd %mm6, 4(%edx) C m 3
+ psrlq $32, %mm6 C m 3
+ pmuludq %mm7, %mm0 C m 3
+ paddq %mm4, %mm6 C m 3
+ movd 20(%eax), %mm1 C m 3
+ movd %mm6, 8(%edx) C m 3
+ psrlq $32, %mm6 C m 3
+ pmuludq %mm7, %mm1 C m 3
+ paddq %mm3, %mm6 C m 3
+ movd 24(%eax), %mm4 C m 3
+ movd %mm6, 12(%edx) C m 3
+ psrlq $32, %mm6 C m 3
+ lea 16(%eax), %eax C m 3
+ lea 16(%edx), %edx C m 3
+ sub $4, %ecx C m 3
+ ja L(lpm3) C m 3
+ pmuludq %mm7, %mm4 C m 3
+ paddq %mm0, %mm6 C m 3
+ movd %mm6, (%edx) C m 3
+ psrlq $32, %mm6 C m 3
+ paddq %mm1, %mm6 C m 3
+ jmp L(2)
+
+L(0m):
+ movd (%eax), %mm3 C m 0
+ lea (%ebx), %ecx C inner loop count m 0
+ pmuludq %mm7, %mm3 C m 0
+ movd 4(%eax), %mm0 C m 0
+ pmuludq %mm7, %mm0 C m 0
+ movd 8(%eax), %mm1 C m 0
+ jmp L(m00) C m 0
+ ALIGN(16) C m 0
+L(lpm0):
+ pmuludq %mm7, %mm4 C m 0
+ paddq %mm0, %mm6 C m 0
+ movd (%eax), %mm3 C m 0
+ movd %mm6, -12(%edx) C m 0
+ psrlq $32, %mm6 C m 0
+ pmuludq %mm7, %mm3 C m 0
+ paddq %mm1, %mm6 C m 0
+ movd 4(%eax), %mm0 C m 0
+ movd %mm6, -8(%edx) C m 0
+ psrlq $32, %mm6 C m 0
+ pmuludq %mm7, %mm0 C m 0
+ paddq %mm4, %mm6 C m 0
+ movd 8(%eax), %mm1 C m 0
+ movd %mm6, -4(%edx) C m 0
+ psrlq $32, %mm6 C m 0
+L(m00): pmuludq %mm7, %mm1 C m 0
+ paddq %mm3, %mm6 C m 0
+ movd 12(%eax), %mm4 C m 0
+ movd %mm6, (%edx) C m 0
+ psrlq $32, %mm6 C m 0
+ lea 16(%eax), %eax C m 0
+ lea 16(%edx), %edx C m 0
+ sub $4, %ecx C m 0
+ ja L(lpm0) C m 0
+ pmuludq %mm7, %mm4 C m 0
+ paddq %mm0, %mm6 C m 0
+ movd %mm6, -12(%edx) C m 0
+ psrlq $32, %mm6 C m 0
+ paddq %mm1, %mm6 C m 0
+ jmp L(3)
+
+L(outer):
+ lea 8(%edi), %edi C rp += 2
+ movd (%esi), %mm7 C am 3
+ mov %edi, %edx C rp2 = rp am 3
+ lea 4(%esi), %esi C up++ am 3
+ lea (%esi), %eax C up2 = up am 3
+ movd (%eax), %mm0 C am 3
+ lea (%ebx), %ecx C inner loop count am 3
+ pxor %mm6, %mm6 C am 3
+ pmuludq %mm7, %mm0 C am 3
+ movd 4(%eax), %mm1 C am 3
+ movd (%edx), %mm4 C am 3
+ pmuludq %mm7, %mm1 C am 3
+ movd 8(%eax), %mm2 C am 3
+ paddq %mm0, %mm4 C am 3
+ movd 4(%edx), %mm5 C am 3
+ jmp L(lam3) C am 3
+ ALIGN(16) C am 3
+L(lam3):
+ pmuludq %mm7, %mm2 C am 3
+ paddq %mm4, %mm6 C am 3
+ movd 12(%eax), %mm3 C am 3
+ paddq %mm1, %mm5 C am 3
+ movd 8(%edx), %mm4 C am 3
+ movd %mm6, (%edx) C am 3
+ psrlq $32, %mm6 C am 3
+ pmuludq %mm7, %mm3 C am 3
+ paddq %mm5, %mm6 C am 3
+ movd 16(%eax), %mm0 C am 3
+ paddq %mm2, %mm4 C am 3
+ movd 12(%edx), %mm5 C am 3
+ movd %mm6, 4(%edx) C am 3
+ psrlq $32, %mm6 C am 3
+ pmuludq %mm7, %mm0 C am 3
+ paddq %mm4, %mm6 C am 3
+ movd 20(%eax), %mm1 C am 3
+ paddq %mm3, %mm5 C am 3
+ movd 16(%edx), %mm4 C am 3
+ movd %mm6, 8(%edx) C am 3
+ psrlq $32, %mm6 C am 3
+ pmuludq %mm7, %mm1 C am 3
+ paddq %mm5, %mm6 C am 3
+ movd 24(%eax), %mm2 C am 3
+ paddq %mm0, %mm4 C am 3
+ movd 20(%edx), %mm5 C am 3
+ movd %mm6, 12(%edx) C am 3
+ psrlq $32, %mm6 C am 3
+ lea 16(%eax), %eax C am 3
+ lea 16(%edx), %edx C am 3
+ sub $4, %ecx C am 3
+ ja L(lam3) C am 3
+ pmuludq %mm7, %mm2 C am 3
+ paddq %mm4, %mm6 C am 3
+ paddq %mm1, %mm5 C am 3
+ movd 8(%edx), %mm4 C am 3
+ movd %mm6, (%edx) C am 3
+ psrlq $32, %mm6 C am 3
+ paddq %mm5, %mm6 C am 3
+ paddq %mm2, %mm4 C am 3
+L(2): movd %mm6, 4(%edx) C am 3
+ psrlq $32, %mm6 C am 3
+ paddq %mm4, %mm6 C am 3
+ movd %mm6, 8(%edx) C am 3
+ psrlq $32, %mm6 C am 3
+ movd %mm6, 12(%edx) C am 3
+
+ lea 8(%edi), %edi C rp += 2
+ movd (%esi), %mm7 C am 2
+ mov %edi, %edx C rp2 = rp am 2
+ lea 4(%esi), %esi C up++ am 2
+ lea (%esi), %eax C up2 = up am 2
+ movd (%eax), %mm1 C am 2
+ lea (%ebx), %ecx C inner loop count am 2
+ pxor %mm6, %mm6 C am 2
+ pmuludq %mm7, %mm1 C am 2
+ movd 4(%eax), %mm2 C am 2
+ movd (%edx), %mm5 C am 2
+ pmuludq %mm7, %mm2 C am 2
+ movd 8(%eax), %mm3 C am 2
+ paddq %mm1, %mm5 C am 2
+ movd 4(%edx), %mm4 C am 2
+ jmp L(am10) C am 2
+ ALIGN(16) C am 2
+L(lam2):
+ pmuludq %mm7, %mm2 C am 2
+ paddq %mm4, %mm6 C am 2
+ movd 8(%eax), %mm3 C am 2
+ paddq %mm1, %mm5 C am 2
+ movd 4(%edx), %mm4 C am 2
+ movd %mm6, -4(%edx) C am 2
+ psrlq $32, %mm6 C am 2
+L(am10):
+ pmuludq %mm7, %mm3 C am 2
+ paddq %mm5, %mm6 C am 2
+ movd 12(%eax), %mm0 C am 2
+ paddq %mm2, %mm4 C am 2
+ movd 8(%edx), %mm5 C am 2
+ movd %mm6, (%edx) C am 2
+ psrlq $32, %mm6 C am 2
+ pmuludq %mm7, %mm0 C am 2
+ paddq %mm4, %mm6 C am 2
+ movd 16(%eax), %mm1 C am 2
+ paddq %mm3, %mm5 C am 2
+ movd 12(%edx), %mm4 C am 2
+ movd %mm6, 4(%edx) C am 2
+ psrlq $32, %mm6 C am 2
+ pmuludq %mm7, %mm1 C am 2
+ paddq %mm5, %mm6 C am 2
+ movd 20(%eax), %mm2 C am 2
+ paddq %mm0, %mm4 C am 2
+ movd 16(%edx), %mm5 C am 2
+ movd %mm6, 8(%edx) C am 2
+ psrlq $32, %mm6 C am 2
+ lea 16(%eax), %eax C am 2
+ lea 16(%edx), %edx C am 2
+ sub $4, %ecx C am 2
+ ja L(lam2) C am 2
+ pmuludq %mm7, %mm2 C am 2
+ paddq %mm4, %mm6 C am 2
+ paddq %mm1, %mm5 C am 2
+ movd 4(%edx), %mm4 C am 2
+ movd %mm6, -4(%edx) C am 2
+ psrlq $32, %mm6 C am 2
+ paddq %mm5, %mm6 C am 2
+ paddq %mm2, %mm4 C am 2
+L(1): movd %mm6, (%edx) C am 2
+ psrlq $32, %mm6 C am 2
+ paddq %mm4, %mm6 C am 2
+ movd %mm6, 4(%edx) C am 2
+ psrlq $32, %mm6 C am 2
+ movd %mm6, 8(%edx) C am 2
+
+ lea 8(%edi), %edi C rp += 2
+ movd (%esi), %mm7 C am 1
+ mov %edi, %edx C rp2 = rp am 1
+ lea 4(%esi), %esi C up++ am 1
+ lea (%esi), %eax C up2 = up am 1
+ movd (%eax), %mm2 C am 1
+ lea (%ebx), %ecx C inner loop count am 1
+ pxor %mm6, %mm6 C am 1
+ pmuludq %mm7, %mm2 C am 1
+ movd 4(%eax), %mm3 C am 1
+ movd (%edx), %mm4 C am 1
+ pmuludq %mm7, %mm3 C am 1
+ movd 8(%eax), %mm0 C am 1
+ paddq %mm2, %mm4 C am 1
+ movd 4(%edx), %mm5 C am 1
+ jmp L(am01) C am 1
+ ALIGN(16) C am 1
+L(lam1):
+ pmuludq %mm7, %mm2 C am 1
+ paddq %mm4, %mm6 C am 1
+ movd 4(%eax), %mm3 C am 1
+ paddq %mm1, %mm5 C am 1
+ movd (%edx), %mm4 C am 1
+ movd %mm6, -8(%edx) C am 1
+ psrlq $32, %mm6 C am 1
+ pmuludq %mm7, %mm3 C am 1
+ paddq %mm5, %mm6 C am 1
+ movd 8(%eax), %mm0 C am 1
+ paddq %mm2, %mm4 C am 1
+ movd 4(%edx), %mm5 C am 1
+ movd %mm6, -4(%edx) C am 1
+ psrlq $32, %mm6 C am 1
+L(am01):
+ pmuludq %mm7, %mm0 C am 1
+ paddq %mm4, %mm6 C am 1
+ movd 12(%eax), %mm1 C am 1
+ paddq %mm3, %mm5 C am 1
+ movd 8(%edx), %mm4 C am 1
+ movd %mm6, (%edx) C am 1
+ psrlq $32, %mm6 C am 1
+ pmuludq %mm7, %mm1 C am 1
+ paddq %mm5, %mm6 C am 1
+ movd 16(%eax), %mm2 C am 1
+ paddq %mm0, %mm4 C am 1
+ movd 12(%edx), %mm5 C am 1
+ movd %mm6, 4(%edx) C am 1
+ psrlq $32, %mm6 C am 1
+ lea 16(%eax), %eax C am 1
+ lea 16(%edx), %edx C am 1
+ sub $4, %ecx C am 1
+ ja L(lam1) C am 1
+ pmuludq %mm7, %mm2 C am 1
+ paddq %mm4, %mm6 C am 1
+ paddq %mm1, %mm5 C am 1
+ movd (%edx), %mm4 C am 1
+ movd %mm6, -8(%edx) C am 1
+ psrlq $32, %mm6 C am 1
+ paddq %mm5, %mm6 C am 1
+ paddq %mm2, %mm4 C am 1
+L(0): movd %mm6, -4(%edx) C am 1
+ psrlq $32, %mm6 C am 1
+ paddq %mm4, %mm6 C am 1
+ movd %mm6, (%edx) C am 1
+ psrlq $32, %mm6 C am 1
+ movd %mm6, 4(%edx) C am 1
+
+ lea 8(%edi), %edi C rp += 2
+ movd (%esi), %mm7 C am 0
+ mov %edi, %edx C rp2 = rp am 0
+ lea 4(%esi), %esi C up++ am 0
+ lea (%esi), %eax C up2 = up am 0
+ movd (%eax), %mm3 C am 0
+ lea (%ebx), %ecx C inner loop count am 0
+ pxor %mm6, %mm6 C am 0
+ pmuludq %mm7, %mm3 C am 0
+ movd 4(%eax), %mm0 C am 0
+ movd (%edx), %mm5 C am 0
+ pmuludq %mm7, %mm0 C am 0
+ movd 8(%eax), %mm1 C am 0
+ paddq %mm3, %mm5 C am 0
+ movd 4(%edx), %mm4 C am 0
+ jmp L(am00) C am 0
+ ALIGN(16) C am 0
+L(lam0):
+ pmuludq %mm7, %mm2 C am 0
+ paddq %mm4, %mm6 C am 0
+ movd (%eax), %mm3 C am 0
+ paddq %mm1, %mm5 C am 0
+ movd -4(%edx), %mm4 C am 0
+ movd %mm6, -12(%edx) C am 0
+ psrlq $32, %mm6 C am 0
+ pmuludq %mm7, %mm3 C am 0
+ paddq %mm5, %mm6 C am 0
+ movd 4(%eax), %mm0 C am 0
+ paddq %mm2, %mm4 C am 0
+ movd (%edx), %mm5 C am 0
+ movd %mm6, -8(%edx) C am 0
+ psrlq $32, %mm6 C am 0
+ pmuludq %mm7, %mm0 C am 0
+ paddq %mm4, %mm6 C am 0
+ movd 8(%eax), %mm1 C am 0
+ paddq %mm3, %mm5 C am 0
+ movd 4(%edx), %mm4 C am 0
+ movd %mm6, -4(%edx) C am 0
+ psrlq $32, %mm6 C am 0
+L(am00):
+ pmuludq %mm7, %mm1 C am 0
+ paddq %mm5, %mm6 C am 0
+ movd 12(%eax), %mm2 C am 0
+ paddq %mm0, %mm4 C am 0
+ movd 8(%edx), %mm5 C am 0
+ movd %mm6, (%edx) C am 0
+ psrlq $32, %mm6 C am 0
+ lea 16(%eax), %eax C am 0
+ lea 16(%edx), %edx C am 0
+ sub $4, %ecx C am 0
+ ja L(lam0) C am 0
+ pmuludq %mm7, %mm2 C am 0
+ paddq %mm4, %mm6 C am 0
+ paddq %mm1, %mm5 C am 0
+ movd -4(%edx), %mm4 C am 0
+ movd %mm6, -12(%edx) C am 0
+ psrlq $32, %mm6 C am 0
+ paddq %mm5, %mm6 C am 0
+ paddq %mm2, %mm4 C am 0
+L(3): movd %mm6, -8(%edx) C am 0
+ psrlq $32, %mm6 C am 0
+ paddq %mm4, %mm6 C am 0
+ movd %mm6, -4(%edx) C am 0
+ psrlq $32, %mm6 C am 0
+ movd %mm6, (%edx) C am 0
+ sub $4, %ebx C am 0
+ ja L(outer) C am 0
+
+ mov %edi, %edx
+ mov %esi, %eax
+ pop %edi
+ pop %ebx
+ pop %esi
+
+L(am3): C up[un-1..un-3] x up[un-4]
+ lea 8(%edx), %edx C rp2 += 2
+ movd (%eax), %mm7
+ movd 4(%eax), %mm1
+ movd 8(%eax), %mm2
+ movd 12(%eax), %mm3
+ movd (%edx), %mm4
+ pmuludq %mm7, %mm1
+ movd 4(%edx), %mm5
+ pmuludq %mm7, %mm2
+ movd 8(%edx), %mm6
+ pmuludq %mm7, %mm3
+ paddq %mm1, %mm4
+ paddq %mm2, %mm5
+ paddq %mm3, %mm6
+ movd %mm4, (%edx)
+ psrlq $32, %mm4
+ paddq %mm5, %mm4
+ movd %mm4, 4(%edx)
+ psrlq $32, %mm4
+ paddq %mm6, %mm4
+ movd %mm4, 8(%edx)
+ psrlq $32, %mm4
+ movd %mm4, 12(%edx) C FIXME feed through!
+ lea 4(%eax), %eax
+
+L(am2): C up[un-1..un-2] x up[un-3]
+ lea 8(%edx), %edx C rp2 += 2
+ movd (%eax), %mm7
+ movd 4(%eax), %mm1
+ movd 8(%eax), %mm2
+ movd (%edx), %mm4
+ movd 4(%edx), %mm5
+ pmuludq %mm7, %mm1
+ pmuludq %mm7, %mm2
+ paddq %mm1, %mm4
+ paddq %mm2, %mm5
+ movd %mm4, (%edx)
+ psrlq $32, %mm4
+ paddq %mm5, %mm4
+ movd %mm4, 4(%edx)
+ psrlq $32, %mm4
+ movd %mm4, 8(%edx) C FIXME feed through!
+ lea 4(%eax), %eax
+
+L(am1): C up[un-1] x up[un-2]
+ lea 8(%edx), %edx C rp2 += 2
+ movd (%eax), %mm7
+ movd 4(%eax), %mm2
+ movd (%edx), %mm4
+ pmuludq %mm7, %mm2
+ paddq %mm2, %mm4
+ movd %mm4, (%edx)
+ psrlq $32, %mm4
+ movd %mm4, 4(%edx)
+
+C *** diag stuff, use elementary code for now
+
+ mov 4(%esp), %edx C rp
+ mov 8(%esp), %eax C up
+ mov 12(%esp), %ecx C un
+
+ movd (%eax), %mm2
+ pmuludq %mm2, %mm2 C src[0]^2
+
+ pcmpeqd %mm7, %mm7
+ psrlq $32, %mm7
+
+ movd 4(%edx), %mm3 C dst[1]
+
+ movd %mm2, (%edx)
+ psrlq $32, %mm2
+
+ psllq $1, %mm3 C 2*dst[1]
+ paddq %mm3, %mm2
+ movd %mm2, 4(%edx)
+ psrlq $32, %mm2
+
+ sub $2, %ecx
+
+L(diag):
+ movd 4(%eax), %mm0 C src limb
+ add $4, %eax
+ pmuludq %mm0, %mm0
+ movq %mm7, %mm1
+ pand %mm0, %mm1 C diagonal low
+ psrlq $32, %mm0 C diagonal high
+
+ movd 8(%edx), %mm3
+ psllq $1, %mm3 C 2*dst[i]
+ paddq %mm3, %mm1
+ paddq %mm1, %mm2
+ movd %mm2, 8(%edx)
+ psrlq $32, %mm2
+
+ movd 12(%edx), %mm3
+ psllq $1, %mm3 C 2*dst[i+1]
+ paddq %mm3, %mm0
+ paddq %mm0, %mm2
+ movd %mm2, 12(%edx)
+ add $8, %edx
+ psrlq $32, %mm2
+
+ sub $1, %ecx
+ jnz L(diag)
+
+ movd 4(%eax), %mm0 C src[size-1]
+ pmuludq %mm0, %mm0
+ pand %mm0, %mm7 C diagonal low
+ psrlq $32, %mm0 C diagonal high
+
+ movd 8(%edx), %mm3 C dst[2*size-2]
+ psllq $1, %mm3
+ paddq %mm3, %mm7
+ paddq %mm7, %mm2
+ movd %mm2, 8(%edx)
+ psrlq $32, %mm2
+
+ paddq %mm0, %mm2
+ movd %mm2, 12(%edx) C dst[2*size-1]
+
+ emms
+ ret
+
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium4/sse2/sub_n.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium4/sse2/sub_n.asm
new file mode 100644
index 00000000000..5ba1c018ecb
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium4/sse2/sub_n.asm
@@ -0,0 +1,119 @@
+dnl Intel Pentium-4 mpn_sub_n -- mpn subtraction.
+
+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/.
+
+include(`../config.m4')
+
+
+C cycles/limb
+C dst!=src1,2 dst==src1 dst==src2
+C P6 model 0-8,10-12 -
+C P6 model 9 (Banias) ?
+C P6 model 13 (Dothan) ?
+C P4 model 0-1 (Willamette) ?
+C P4 model 2 (Northwood) 4 6 6
+C P4 model 3-4 (Prescott) 4.25 7.5 7.5
+
+defframe(PARAM_CARRY,20)
+defframe(PARAM_SIZE, 16)
+defframe(PARAM_SRC2, 12)
+defframe(PARAM_SRC1, 8)
+defframe(PARAM_DST, 4)
+
+dnl re-use parameter space
+define(SAVE_EBX,`PARAM_SRC1')
+
+ TEXT
+ ALIGN(8)
+
+PROLOGUE(mpn_sub_nc)
+deflit(`FRAME',0)
+ movd PARAM_CARRY, %mm0
+ jmp L(start_nc)
+EPILOGUE()
+
+ ALIGN(8)
+PROLOGUE(mpn_sub_n)
+deflit(`FRAME',0)
+ pxor %mm0, %mm0
+L(start_nc):
+ mov PARAM_SRC1, %eax
+ mov %ebx, SAVE_EBX
+ mov PARAM_SRC2, %ebx
+ mov PARAM_DST, %edx
+ mov PARAM_SIZE, %ecx
+
+ lea (%eax,%ecx,4), %eax C src1 end
+ lea (%ebx,%ecx,4), %ebx C src2 end
+ lea (%edx,%ecx,4), %edx C dst end
+ neg %ecx C -size
+
+L(top):
+ C eax src1 end
+ C ebx src2 end
+ C ecx counter, limbs, negative
+ C edx dst end
+ C mm0 carry bit
+
+ movd (%eax,%ecx,4), %mm1
+ movd (%ebx,%ecx,4), %mm2
+ psubq %mm2, %mm1
+
+ psubq %mm0, %mm1
+ movd %mm1, (%edx,%ecx,4)
+
+ psrlq $63, %mm1
+
+ add $1, %ecx
+ jz L(done_mm1)
+
+ movd (%eax,%ecx,4), %mm0
+ movd (%ebx,%ecx,4), %mm2
+ psubq %mm2, %mm0
+
+ psubq %mm1, %mm0
+ movd %mm0, (%edx,%ecx,4)
+
+ psrlq $63, %mm0
+
+ add $1, %ecx
+ jnz L(top)
+
+ movd %mm0, %eax
+ mov SAVE_EBX, %ebx
+ emms
+ ret
+
+L(done_mm1):
+ movd %mm1, %eax
+ mov SAVE_EBX, %ebx
+ emms
+ ret
+
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium4/sse2/submul_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium4/sse2/submul_1.asm
new file mode 100644
index 00000000000..020675bd7bb
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/pentium4/sse2/submul_1.asm
@@ -0,0 +1,182 @@
+dnl Intel Pentium-4 mpn_submul_1 -- Multiply a limb vector with a limb and
+dnl subtract the result from a second limb vector.
+
+dnl Copyright 2001, 2002, 2008, 2010 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 P6 model 0-8,10-12 -
+C P6 model 9 (Banias) 6.8
+C P6 model 13 (Dothan) 6.9
+C P4 model 0-1 (Willamette) ?
+C P4 model 2 (Northwood) 5.87
+C P4 model 3-4 (Prescott) 6.5
+
+C This code represents a step forwards compared to the code available before
+C GMP 5.1, but it is not carefully tuned for either P6 or P4. In fact, it is
+C not good for P6. For P4 it saved a bit over 1 c/l for both Northwood and
+C Prescott compared to the old code.
+C
+C The arrangements made here to get a two instruction dependent chain are
+C slightly subtle. In the loop the carry (or borrow rather) is a negative so
+C that a paddq can be used to give a low limb ready to store, and a high limb
+C ready to become the new carry after a psrlq.
+C
+C If the carry was a simple twos complement negative then the psrlq shift would
+C need to bring in 0 bits or 1 bits according to whether the high was zero or
+C non-zero, since a non-zero value would represent a negative needing sign
+C extension. That wouldn't be particularly easy to arrange and certainly would
+C add an instruction to the dependent chain, so instead an offset is applied so
+C that the high limb will be 0xFFFFFFFF+c. With c in the range -0xFFFFFFFF to
+C 0, the value 0xFFFFFFFF+c is in the range 0 to 0xFFFFFFFF and is therefore
+C always positive and can always have 0 bits shifted in, which is what psrlq
+C does.
+C
+C The extra 0xFFFFFFFF must be subtracted before c is used, but that can be
+C done off the dependent chain. The total adjustment then is to add
+C 0xFFFFFFFF00000000 to offset the new carry, and subtract 0x00000000FFFFFFFF
+C to remove the offset from the current carry, for a net add of
+C 0xFFFFFFFE00000001. In the code this is applied to the destination limb when
+C fetched.
+C
+C It's also possible to view the 0xFFFFFFFF adjustment as a ones-complement
+C negative, which is how it's undone for the return value, but that doesn't
+C seem as clear.
+
+defframe(PARAM_CARRY, 20)
+defframe(PARAM_MULTIPLIER,16)
+defframe(PARAM_SIZE, 12)
+defframe(PARAM_SRC, 8)
+defframe(PARAM_DST, 4)
+
+ TEXT
+ ALIGN(16)
+
+PROLOGUE(mpn_submul_1c)
+deflit(`FRAME',0)
+ movd PARAM_CARRY, %mm1
+ jmp L(start_1c)
+EPILOGUE()
+
+PROLOGUE(mpn_submul_1)
+deflit(`FRAME',0)
+ pxor %mm1, %mm1 C initial borrow
+
+L(start_1c):
+ mov PARAM_SRC, %eax
+ pcmpeqd %mm0, %mm0
+
+ movd PARAM_MULTIPLIER, %mm7
+ pcmpeqd %mm6, %mm6
+
+ mov PARAM_DST, %edx
+ psrlq $32, %mm0 C 0x00000000FFFFFFFF
+
+ mov PARAM_SIZE, %ecx
+ psllq $32, %mm6 C 0xFFFFFFFF00000000
+
+ psubq %mm0, %mm6 C 0xFFFFFFFE00000001
+
+ psubq %mm1, %mm0 C 0xFFFFFFFF - borrow
+
+
+ movd (%eax), %mm3 C up
+ movd (%edx), %mm4 C rp
+
+ add $-1, %ecx
+ paddq %mm6, %mm4 C add 0xFFFFFFFE00000001
+ pmuludq %mm7, %mm3
+ jnz L(gt1)
+ psubq %mm3, %mm4 C prod
+ paddq %mm4, %mm0 C borrow
+ movd %mm0, (%edx) C result
+ jmp L(rt)
+
+L(gt1): movd 4(%eax), %mm1 C up
+ movd 4(%edx), %mm2 C rp
+
+ add $-1, %ecx
+ jz L(eev)
+
+ ALIGN(16)
+L(top): paddq %mm6, %mm2 C add 0xFFFFFFFE00000001
+ pmuludq %mm7, %mm1
+ psubq %mm3, %mm4 C prod
+ movd 8(%eax), %mm3 C up
+ paddq %mm4, %mm0 C borrow
+ movd 8(%edx), %mm4 C rp
+ movd %mm0, (%edx) C result
+ psrlq $32, %mm0
+
+ add $-1, %ecx
+ jz L(eod)
+
+ paddq %mm6, %mm4 C add 0xFFFFFFFE00000001
+ pmuludq %mm7, %mm3
+ psubq %mm1, %mm2 C prod
+ movd 12(%eax), %mm1 C up
+ paddq %mm2, %mm0 C borrow
+ movd 12(%edx), %mm2 C rp
+ movd %mm0, 4(%edx) C result
+ psrlq $32, %mm0
+
+ lea 8(%eax), %eax
+ lea 8(%edx), %edx
+ add $-1, %ecx
+ jnz L(top)
+
+
+L(eev): paddq %mm6, %mm2 C add 0xFFFFFFFE00000001
+ pmuludq %mm7, %mm1
+ psubq %mm3, %mm4 C prod
+ paddq %mm4, %mm0 C borrow
+ movd %mm0, (%edx) C result
+ psrlq $32, %mm0
+ psubq %mm1, %mm2 C prod
+ paddq %mm2, %mm0 C borrow
+ movd %mm0, 4(%edx) C result
+L(rt): psrlq $32, %mm0
+ movd %mm0, %eax
+ not %eax
+ emms
+ ret
+
+L(eod): paddq %mm6, %mm4 C add 0xFFFFFFFE00000001
+ pmuludq %mm7, %mm3
+ psubq %mm1, %mm2 C prod
+ paddq %mm2, %mm0 C borrow
+ movd %mm0, 4(%edx) C result
+ psrlq $32, %mm0
+ psubq %mm3, %mm4 C prod
+ paddq %mm4, %mm0 C borrow
+ movd %mm0, 8(%edx) C result
+ jmp L(rt)
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/rshift.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/rshift.asm
new file mode 100644
index 00000000000..a60dcaa4b23
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/rshift.asm
@@ -0,0 +1,108 @@
+dnl x86 mpn_rshift -- mpn right shift.
+
+dnl Copyright 1992, 1994, 1996, 1999-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 cycles/limb
+C P54 7.5
+C P55 7.0
+C P6 2.5
+C K6 4.5
+C K7 5.0
+C P4 16.5
+
+
+C mp_limb_t mpn_rshift (mp_ptr dst, mp_srcptr src, mp_size_t size,
+C unsigned shift);
+
+defframe(PARAM_SHIFT,16)
+defframe(PARAM_SIZE, 12)
+defframe(PARAM_SRC, 8)
+defframe(PARAM_DST, 4)
+
+ TEXT
+ ALIGN(8)
+PROLOGUE(mpn_rshift)
+
+ pushl %edi
+ pushl %esi
+ pushl %ebx
+deflit(`FRAME',12)
+
+ movl PARAM_DST,%edi
+ movl PARAM_SRC,%esi
+ movl PARAM_SIZE,%edx
+ movl PARAM_SHIFT,%ecx
+
+ leal -4(%edi,%edx,4),%edi
+ leal (%esi,%edx,4),%esi
+ negl %edx
+
+ movl (%esi,%edx,4),%ebx C read least significant limb
+ xorl %eax,%eax
+ shrdl( %cl, %ebx, %eax) C compute carry limb
+ incl %edx
+ jz L(end)
+ pushl %eax C push carry limb onto stack
+ testb $1,%dl
+ jnz L(1) C enter loop in the middle
+ movl %ebx,%eax
+
+ ALIGN(8)
+L(oop): movl (%esi,%edx,4),%ebx C load next higher limb
+ shrdl( %cl, %ebx, %eax) C compute result limb
+ movl %eax,(%edi,%edx,4) C store it
+ incl %edx
+L(1): movl (%esi,%edx,4),%eax
+ shrdl( %cl, %eax, %ebx)
+ movl %ebx,(%edi,%edx,4)
+ incl %edx
+ jnz L(oop)
+
+ shrl %cl,%eax C compute most significant limb
+ movl %eax,(%edi) C store it
+
+ popl %eax C pop carry limb
+
+ popl %ebx
+ popl %esi
+ popl %edi
+ ret
+
+L(end): shrl %cl,%ebx C compute most significant limb
+ movl %ebx,(%edi) C store it
+
+ popl %ebx
+ popl %esi
+ popl %edi
+ ret
+
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/sec_tabselect.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/sec_tabselect.asm
new file mode 100644
index 00000000000..c7c2e059f14
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/sec_tabselect.asm
@@ -0,0 +1,115 @@
+dnl x86 mpn_sec_tabselect.
+
+dnl Copyright 2011 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 P5 ?
+C P6 model 0-8,10-12 ?
+C P6 model 9 (Banias) ?
+C P6 model 13 (Dothan) ?
+C P4 model 0 (Willamette) ?
+C P4 model 1 (?) ?
+C P4 model 2 (Northwood) 4.5
+C P4 model 3 (Prescott) ?
+C P4 model 4 (Nocona) ?
+C Intel Atom ?
+C AMD K6 ?
+C AMD K7 3.4
+C AMD K8 ?
+C AMD K10 ?
+
+C NOTES
+C * This has not been tuned for any specific processor. Its speed should not
+C be too bad, though.
+C * Using SSE2 could result in many-fold speedup.
+
+C mpn_sec_tabselect (mp_limb_t *rp, mp_limb_t *tp, mp_size_t n, mp_size_t nents, mp_size_t which)
+define(`rp', `%edi')
+define(`tp', `%esi')
+define(`n', `%ebx')
+define(`nents', `%ecx')
+define(`which', `36(%esp)')
+
+define(`i', `%ebp')
+define(`maskp', `20(%esp)')
+define(`maskn', `32(%esp)')
+
+ASM_START()
+ TEXT
+ ALIGN(16)
+PROLOGUE(mpn_sec_tabselect)
+ push %edi
+ push %esi
+ push %ebx
+ push %ebp
+ mov 20(%esp), rp
+ mov 24(%esp), tp
+ mov 28(%esp), n
+ mov 32(%esp), nents
+
+ lea (rp,n,4), rp
+ lea (tp,n,4), tp
+ sub nents, which
+L(outer):
+ mov which, %eax
+ add nents, %eax
+ neg %eax C set CF iff 'which' != k
+ sbb %eax, %eax
+ mov %eax, maskn
+ not %eax
+ mov %eax, maskp
+
+ mov n, i
+ neg i
+
+ ALIGN(16)
+L(top): mov (tp,i,4), %eax
+ and maskp, %eax
+ mov (rp,i,4), %edx
+ and maskn, %edx
+ or %edx, %eax
+ mov %eax, (rp,i,4)
+ inc i
+ js L(top)
+
+L(end): mov n, %eax
+ lea (tp,%eax,4), tp
+ dec nents
+ jne L(outer)
+
+L(outer_end):
+ pop %ebp
+ pop %ebx
+ pop %esi
+ pop %edi
+ ret
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/sqr_basecase.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/sqr_basecase.asm
new file mode 100644
index 00000000000..39f8a89805f
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/sqr_basecase.asm
@@ -0,0 +1,359 @@
+dnl x86 generic mpn_sqr_basecase -- square an mpn number.
+
+dnl Copyright 1999, 2000, 2002, 2003 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/crossproduct cycles/triangleproduct
+C P5
+C P6
+C K6
+C K7
+C P4
+
+
+C void mpn_sqr_basecase (mp_ptr dst, mp_srcptr src, mp_size_t size);
+C
+C The algorithm is basically the same as mpn/generic/sqr_basecase.c, but a
+C lot of function call overheads are avoided, especially when the size is
+C small.
+C
+C The mul1 loop is not unrolled like mul_1.asm, it doesn't seem worth the
+C code size to do so here.
+C
+C Enhancements:
+C
+C The addmul loop here is also not unrolled like aorsmul_1.asm and
+C mul_basecase.asm are. Perhaps it should be done. It'd add to the
+C complexity, but if it's worth doing in the other places then it should be
+C worthwhile here.
+C
+C A fully-unrolled style like other sqr_basecase.asm versions (k6, k7, p6)
+C might be worth considering. That'd add quite a bit to the code size, but
+C only as much as is used would be dragged into L1 cache.
+
+defframe(PARAM_SIZE,12)
+defframe(PARAM_SRC, 8)
+defframe(PARAM_DST, 4)
+
+ TEXT
+ ALIGN(8)
+PROLOGUE(mpn_sqr_basecase)
+deflit(`FRAME',0)
+
+ movl PARAM_SIZE, %edx
+
+ movl PARAM_SRC, %eax
+
+ cmpl $2, %edx
+ movl PARAM_DST, %ecx
+
+ je L(two_limbs)
+ ja L(three_or_more)
+
+
+C -----------------------------------------------------------------------------
+C one limb only
+ C eax src
+ C ebx
+ C ecx dst
+ C edx
+
+ movl (%eax), %eax
+ mull %eax
+ movl %eax, (%ecx)
+ movl %edx, 4(%ecx)
+ ret
+
+
+C -----------------------------------------------------------------------------
+ ALIGN(8)
+L(two_limbs):
+ C eax src
+ C ebx
+ C ecx dst
+ C edx
+
+ pushl %ebx
+ pushl %ebp
+
+ movl %eax, %ebx
+ movl (%eax), %eax
+
+ mull %eax C src[0]^2
+
+ pushl %esi
+ pushl %edi
+
+ movl %edx, %esi C dst[1]
+ movl %eax, (%ecx) C dst[0]
+
+ movl 4(%ebx), %eax
+ mull %eax C src[1]^2
+
+ movl %eax, %edi C dst[2]
+ movl %edx, %ebp C dst[3]
+
+ movl (%ebx), %eax
+ mull 4(%ebx) C src[0]*src[1]
+
+ addl %eax, %esi
+
+ adcl %edx, %edi
+
+ adcl $0, %ebp
+ addl %esi, %eax
+
+ adcl %edi, %edx
+ movl %eax, 4(%ecx)
+
+ adcl $0, %ebp
+
+ movl %edx, 8(%ecx)
+ movl %ebp, 12(%ecx)
+
+ popl %edi
+ popl %esi
+
+ popl %ebp
+ popl %ebx
+
+ ret
+
+
+C -----------------------------------------------------------------------------
+ ALIGN(8)
+L(three_or_more):
+deflit(`FRAME',0)
+ C eax src
+ C ebx
+ C ecx dst
+ C edx size
+
+ pushl %ebx FRAME_pushl()
+ pushl %edi FRAME_pushl()
+
+ pushl %esi FRAME_pushl()
+ pushl %ebp FRAME_pushl()
+
+ leal (%ecx,%edx,4), %edi C &dst[size], end of this mul1
+ leal (%eax,%edx,4), %esi C &src[size]
+
+C First multiply src[0]*src[1..size-1] and store at dst[1..size].
+
+ movl (%eax), %ebp C src[0], multiplier
+ movl %edx, %ecx
+
+ negl %ecx C -size
+ xorl %ebx, %ebx C clear carry limb
+
+ incl %ecx C -(size-1)
+
+L(mul1):
+ C eax scratch
+ C ebx carry
+ C ecx counter, limbs, negative
+ C edx scratch
+ C esi &src[size]
+ C edi &dst[size]
+ C ebp multiplier
+
+ movl (%esi,%ecx,4), %eax
+ mull %ebp
+ addl %eax, %ebx
+ adcl $0, %edx
+ movl %ebx, (%edi,%ecx,4)
+ movl %edx, %ebx
+ incl %ecx
+ jnz L(mul1)
+
+ movl %ebx, (%edi)
+
+
+ C Add products src[n]*src[n+1..size-1] at dst[2*n-1...], for
+ C n=1..size-2.
+ C
+ C The last products src[size-2]*src[size-1], which is the end corner
+ C of the product triangle, is handled separately at the end to save
+ C looping overhead. If size is 3 then it's only this that needs to
+ C be done.
+ C
+ C In the outer loop %esi is a constant, and %edi just advances by 1
+ C limb each time. The size of the operation decreases by 1 limb
+ C each time.
+
+ C eax
+ C ebx carry (needing carry flag added)
+ C ecx
+ C edx
+ C esi &src[size]
+ C edi &dst[size]
+ C ebp
+
+ movl PARAM_SIZE, %ecx
+ subl $3, %ecx
+ jz L(corner)
+
+ negl %ecx
+
+dnl re-use parameter space
+define(VAR_OUTER,`PARAM_DST')
+
+L(outer):
+ C eax
+ C ebx
+ C ecx
+ C edx outer loop counter, -(size-3) to -1
+ C esi &src[size]
+ C edi dst, pointing at stored carry limb of previous loop
+ C ebp
+
+ movl %ecx, VAR_OUTER
+ addl $4, %edi C advance dst end
+
+ movl -8(%esi,%ecx,4), %ebp C next multiplier
+ subl $1, %ecx
+
+ xorl %ebx, %ebx C initial carry limb
+
+L(inner):
+ C eax scratch
+ C ebx carry (needing carry flag added)
+ C ecx counter, -n-1 to -1
+ C edx scratch
+ C esi &src[size]
+ C edi dst end of this addmul
+ C ebp multiplier
+
+ movl (%esi,%ecx,4), %eax
+ mull %ebp
+ addl %ebx, %eax
+ adcl $0, %edx
+ addl %eax, (%edi,%ecx,4)
+ adcl $0, %edx
+ movl %edx, %ebx
+ addl $1, %ecx
+ jl L(inner)
+
+
+ movl %ebx, (%edi)
+ movl VAR_OUTER, %ecx
+ incl %ecx
+ jnz L(outer)
+
+
+L(corner):
+ C esi &src[size]
+ C edi &dst[2*size-3]
+
+ movl -4(%esi), %eax
+ mull -8(%esi) C src[size-1]*src[size-2]
+ addl %eax, 0(%edi)
+ adcl $0, %edx
+ movl %edx, 4(%edi) C dst high limb
+
+
+C -----------------------------------------------------------------------------
+C Left shift of dst[1..2*size-2], high bit shifted out becomes dst[2*size-1].
+
+ movl PARAM_SIZE, %eax
+ negl %eax
+ addl $1, %eax C -(size-1) and clear carry
+
+L(lshift):
+ C eax counter, negative
+ C ebx next limb
+ C ecx
+ C edx
+ C esi
+ C edi &dst[2*size-4]
+ C ebp
+
+ rcll 8(%edi,%eax,8)
+ rcll 12(%edi,%eax,8)
+ incl %eax
+ jnz L(lshift)
+
+
+ adcl %eax, %eax C high bit out
+ movl %eax, 8(%edi) C dst most significant limb
+
+
+C Now add in the squares on the diagonal, namely src[0]^2, src[1]^2, ...,
+C src[size-1]^2. dst[0] hasn't yet been set at all yet, and just gets the
+C low limb of src[0]^2.
+
+ movl PARAM_SRC, %esi
+ movl (%esi), %eax C src[0]
+ mull %eax C src[0]^2
+
+ movl PARAM_SIZE, %ecx
+ leal (%esi,%ecx,4), %esi C src end
+
+ negl %ecx C -size
+ movl %edx, %ebx C initial carry
+
+ movl %eax, 12(%edi,%ecx,8) C dst[0]
+ incl %ecx C -(size-1)
+
+L(diag):
+ C eax scratch (low product)
+ C ebx carry limb
+ C ecx counter, -(size-1) to -1
+ C edx scratch (high product)
+ C esi &src[size]
+ C edi &dst[2*size-3]
+ C ebp scratch (fetched dst limbs)
+
+ movl (%esi,%ecx,4), %eax
+ mull %eax
+
+ addl %ebx, 8(%edi,%ecx,8)
+ movl %edx, %ebx
+
+ adcl %eax, 12(%edi,%ecx,8)
+ adcl $0, %ebx
+
+ incl %ecx
+ jnz L(diag)
+
+
+ addl %ebx, 8(%edi) C dst most significant limb
+
+ popl %ebp
+ popl %esi
+
+ popl %edi
+ popl %ebx
+
+ ret
+
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/t-zdisp.sh b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/t-zdisp.sh
new file mode 100755
index 00000000000..61efdd6c4ff
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/t-zdisp.sh
@@ -0,0 +1,71 @@
+#! /bin/sh
+#
+# Copyright 2000 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/.
+
+
+# Usage: cd $(builddir)/mpn
+# $(srcdir)/x86/t-zdisp.sh
+#
+# Run the Zdisp() macro instructions through the assembler to check
+# the encodings used. Mismatches are printed, no output means all ok.
+#
+# This program is only meant for use during development. It can be
+# run in the mpn build directory of any x86 configuration.
+#
+# For this test the assembler needs to generate byte sized 0
+# displacements when given something like 0(%eax). Recent versions of
+# gas are suitable (eg. 2.9.x or 2.10.x).
+
+set -e
+
+cat >tmp-zdisptest.asm <<\EOF
+
+include(`../config.m4')
+
+dnl Redefine Zdisp_match to output its pattern and encoding.
+define(`Zdisp_match',
+`define(`Zdisp_found',1)dnl
+ifelse(`$2',0,` $1 $2$3, $4')`'dnl
+ifelse(`$3',0,` $1 $2, $3$4')`'dnl
+
+ .byte $5
+')
+ .text
+ Zdisp()
+EOF
+
+m4 tmp-zdisptest.asm >tmp-zdisptest.s
+as -o tmp-zdisptest.o tmp-zdisptest.s
+
+# Demand duplicates from the instruction patterns and byte encodings.
+objdump -d tmp-zdisptest.o | awk '
+/^ *[a-z0-9]+:/ {
+ sub(/^ *[a-z0-9]+:/,"")
+ print
+}' | sort | uniq -u
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/t-zdisp2.pl b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/t-zdisp2.pl
new file mode 100755
index 00000000000..b441b6579a7
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/t-zdisp2.pl
@@ -0,0 +1,147 @@
+#!/usr/bin/perl -w
+#
+# Copyright 2001, 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/.
+
+
+# Usage: cd $(builddir)/mpn
+# $(srcdir)/x86/t-zdisp2.pl
+#
+# Grep for any "0(reg...)" addressing modes coming out of the x86 .asm
+# files. Additive expressions like "12+4-16" are recognised too.
+#
+# Old gas doesn't preserve the "0" displacement, so if it's wanted then
+# Zdisp ought to be used to give explicit .byte sequences. See
+# mpn/x86/README.
+#
+# No output means everything is ok. All the asm files are put through m4 in
+# PIC and non-PIC modes, and in each multi-function form, all of which can
+# take a while to run.
+#
+# This program is only meant for use during development.
+
+use strict;
+use File::Find;
+use File::Basename;
+use Getopt::Std;
+
+my %opt;
+getopts('t', \%opt);
+
+
+my $srcdir;
+open IN, '<Makefile' or die;
+while (<IN>) {
+ if (/^srcdir[ \t]*=[ \t]*(.*)/) {
+ $srcdir = $1;
+ last;
+ }
+}
+close IN or die;
+defined $srcdir or die "Cannot find \$srcdir in Makefile\n";
+
+my $filecount = 0;
+
+my $tempfile = 't-zdisp2.tmp';
+open KARA, ">$tempfile" or die;
+close KARA or die;
+
+find({ wanted => \&process, preprocess => \&process_mparam, no_chdir => 1 },
+ "$srcdir/x86");
+
+sub process {
+ if (/gmp-mparam.h$/) {
+ process_mparam($_);
+ } elsif (/\.asm$/) {
+ process_asm($_);
+ }
+}
+
+# Ensure we're using the right SQR_TOOM2_THRESHOLD for the part of the
+# tree being processed.
+sub process_mparam {
+ my $file = "$File::Find::dir/gmp-mparam.h";
+ if (-f $file) {
+ print "$file\n" if $opt{'t'};
+ open MPARAM, "<$file" or die;
+ while (<MPARAM>) {
+ if (/^#define SQR_TOOM2_THRESHOLD[ \t]*([0-9][0-9]*)/) {
+ open KARA, ">$tempfile" or die;
+ print KARA "define(\`SQR_TOOM2_THRESHOLD',$1)\n\n";
+ print "define(\`SQR_TOOM2_THRESHOLD',$1)\n" if $opt{'t'};
+ close KARA or die;
+ last;
+ }
+ }
+ close MPARAM or die;
+ }
+ return @_;
+}
+
+sub process_asm {
+ my ($file) = @_;
+ my $base = basename ($file, '.asm');
+
+ my @funs;
+ if ($base eq 'aors_n') { @funs = qw(add_n sub_n); }
+ elsif ($base eq 'aorsmul_1') { @funs = qw(addmul_1 submul_1); }
+ elsif ($base eq 'popham') { @funs = qw(popcount hamdist); }
+ elsif ($base eq 'logops_n') { @funs = qw(and_n andn_n nand_n ior_n iorn_n nior_n xor_n xnor_n); }
+ elsif ($base eq 'lorrshift') { @funs = qw(lshift rshift); }
+ else { @funs = ($base); }
+
+ foreach my $fun (@funs) {
+ foreach my $pic ('', ' -DPIC') {
+ my $header = "$file: 0: $pic\n";
+ $filecount++;
+
+ my $m4 = "m4 -DHAVE_HOST_CPU_athlon -DOPERATION_$fun $pic ../config.m4 $tempfile $file";
+ print "$m4\n" if $opt{'t'};
+
+ open IN, "$m4 |" or die;
+ while (<IN>) {
+ next unless /([0-9+-][0-9 \t+-]*)\(%/;
+ my $pat=$1;
+ $pat = eval($pat);
+ next if ($pat != 0);
+ print "$header$_";
+ $header='';
+ }
+ close IN or die;
+ }
+ }
+}
+
+unlink($tempfile);
+print "total $filecount processed\n";
+exit 0;
+
+
+# Local variables:
+# perl-indent-level: 2
+# End:
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/udiv.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/udiv.asm
new file mode 100644
index 00000000000..a3ee08860f2
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/udiv.asm
@@ -0,0 +1,52 @@
+dnl x86 mpn_udiv_qrnnd -- 2 by 1 limb division
+
+dnl Copyright 1999, 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 mp_limb_t mpn_udiv_qrnnd (mp_limb_t *remptr, mp_limb_t high, mp_limb_t low,
+C mp_limb_t divisor);
+
+defframe(PARAM_DIVISOR, 16)
+defframe(PARAM_LOW, 12)
+defframe(PARAM_HIGH, 8)
+defframe(PARAM_REMPTR, 4)
+
+ TEXT
+ ALIGN(8)
+PROLOGUE(mpn_udiv_qrnnd)
+deflit(`FRAME',0)
+ movl PARAM_LOW, %eax
+ movl PARAM_HIGH, %edx
+ divl PARAM_DIVISOR
+ movl PARAM_REMPTR, %ecx
+ movl %edx, (%ecx)
+ ret
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/umul.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/umul.asm
new file mode 100644
index 00000000000..34fe4344008
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/umul.asm
@@ -0,0 +1,51 @@
+dnl mpn_umul_ppmm -- 1x1->2 limb multiplication
+
+dnl Copyright 1999, 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 mp_limb_t mpn_umul_ppmm (mp_limb_t *lowptr, mp_limb_t m1, mp_limb_t m2);
+C
+
+defframe(PARAM_M2, 12)
+defframe(PARAM_M1, 8)
+defframe(PARAM_LOWPTR, 4)
+
+ TEXT
+ ALIGN(8)
+PROLOGUE(mpn_umul_ppmm)
+deflit(`FRAME',0)
+ movl PARAM_LOWPTR, %ecx
+ movl PARAM_M1, %eax
+ mull PARAM_M2
+ movl %eax, (%ecx)
+ movl %edx, %eax
+ ret
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/x86-defs.m4 b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/x86-defs.m4
new file mode 100644
index 00000000000..1538b6820c4
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86/x86-defs.m4
@@ -0,0 +1,999 @@
+divert(-1)
+
+
+dnl m4 macros for x86 assembler.
+
+
+dnl Copyright 1999-2003, 2007, 2010, 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/.
+
+
+dnl Notes:
+dnl
+dnl m4 isn't perfect for processing BSD style x86 assembler code, the main
+dnl problems are,
+dnl
+dnl 1. Doing define(foo,123) and then using foo in an addressing mode like
+dnl foo(%ebx) expands as a macro rather than a constant. This is worked
+dnl around by using deflit() from asm-defs.m4, instead of define().
+dnl
+dnl 2. Immediates in macro definitions need a space or `' to stop the $
+dnl looking like a macro parameter. For example,
+dnl
+dnl define(foo, `mov $ 123, %eax')
+dnl
+dnl This is only a problem in macro definitions, not in ordinary text,
+dnl and not in macro parameters like text passed to forloop() or ifdef().
+
+
+deflit(GMP_LIMB_BYTES, 4)
+
+
+dnl Libtool gives -DPIC -DDLL_EXPORT to indicate a cygwin or mingw DLL. We
+dnl undefine PIC since we don't need to be position independent in this
+dnl case and definitely don't want the ELF style _GLOBAL_OFFSET_TABLE_ etc.
+
+ifdef(`DLL_EXPORT',`undefine(`PIC')')
+
+
+dnl Usage: CPUVEC_FUNCS_LIST
+dnl
+dnl A list of the functions from gmp-impl.h x86 struct cpuvec_t, in the
+dnl order they appear in that structure.
+
+define(CPUVEC_FUNCS_LIST,
+``add_n',
+`addlsh1_n',
+`addlsh2_n',
+`addmul_1',
+`addmul_2',
+`bdiv_dbm1c',
+`cnd_add_n',
+`cnd_sub_n',
+`com',
+`copyd',
+`copyi',
+`divexact_1',
+`divrem_1',
+`gcd_1',
+`lshift',
+`lshiftc',
+`mod_1',
+`mod_1_1p',
+`mod_1_1p_cps',
+`mod_1s_2p',
+`mod_1s_2p_cps',
+`mod_1s_4p',
+`mod_1s_4p_cps',
+`mod_34lsub1',
+`modexact_1c_odd',
+`mul_1',
+`mul_basecase',
+`mullo_basecase',
+`preinv_divrem_1',
+`preinv_mod_1',
+`redc_1',
+`redc_2',
+`rshift',
+`sqr_basecase',
+`sub_n',
+`sublsh1_n',
+`submul_1'')
+
+
+dnl Called: PROLOGUE_cpu(GSYM_PREFIX`'foo)
+dnl
+dnl In the x86 code we use explicit TEXT and ALIGN() calls in the code,
+dnl since different alignments are wanted in various circumstances. So for
+dnl instance,
+dnl
+dnl TEXT
+dnl ALIGN(16)
+dnl PROLOGUE(mpn_add_n)
+dnl ...
+dnl EPILOGUE()
+
+define(`PROLOGUE_cpu',
+m4_assert_numargs(1)
+m4_assert_defined(`WANT_PROFILING')
+ `GLOBL $1
+ TYPE($1,`function')
+ COFF_TYPE($1)
+$1:
+ifelse(WANT_PROFILING,`prof', ` call_mcount')
+ifelse(WANT_PROFILING,`gprof', ` call_mcount')
+ifelse(WANT_PROFILING,`instrument',` call_instrument(enter)')
+')
+
+
+dnl Usage: COFF_TYPE(GSYM_PREFIX`'foo)
+dnl
+dnl Emit COFF style ".def ... .endef" type information for a function, when
+dnl supported. The argument should include any GSYM_PREFIX.
+dnl
+dnl See autoconf macro GMP_ASM_COFF_TYPE for HAVE_COFF_TYPE.
+
+define(COFF_TYPE,
+m4_assert_numargs(1)
+m4_assert_defined(`HAVE_COFF_TYPE')
+`ifelse(HAVE_COFF_TYPE,yes,
+ `.def $1
+ .scl 2
+ .type 32
+ .endef')')
+
+
+dnl Usage: call_mcount
+dnl
+dnl For `gprof' style profiling, %ebp is setup as a frame pointer. None of
+dnl the assembler routines use %ebp this way, so it's done only for the
+dnl benefit of mcount. glibc sysdeps/i386/i386-mcount.S shows how mcount
+dnl gets the current function from (%esp) and the parent from 4(%ebp).
+dnl
+dnl For `prof' style profiling gcc generates mcount calls without setting
+dnl up %ebp, and the same is done here.
+
+define(`call_mcount',
+m4_assert_numargs(-1)
+m4_assert_defined(`WANT_PROFILING')
+m4_assert_defined(`MCOUNT_PIC_REG')
+m4_assert_defined(`MCOUNT_NONPIC_REG')
+m4_assert_defined(`MCOUNT_PIC_CALL')
+m4_assert_defined(`MCOUNT_NONPIC_CALL')
+`ifelse(ifdef(`PIC',`MCOUNT_PIC_REG',`MCOUNT_NONPIC_REG'),,,
+` DATA
+ ALIGN(4)
+L(mcount_data_`'mcount_counter):
+ W32 0
+ TEXT
+')dnl
+ifelse(WANT_PROFILING,`gprof',
+` pushl %ebp
+ movl %esp, %ebp
+')dnl
+ifdef(`PIC',
+` pushl %ebx
+ call_movl_eip_to_ebx
+L(mcount_here_`'mcount_counter):
+ addl $_GLOBAL_OFFSET_TABLE_+[.-L(mcount_here_`'mcount_counter)], %ebx
+ifelse(MCOUNT_PIC_REG,,,
+` leal L(mcount_data_`'mcount_counter)@GOTOFF(%ebx), MCOUNT_PIC_REG')
+MCOUNT_PIC_CALL
+ popl %ebx
+',`dnl non-PIC
+ifelse(MCOUNT_NONPIC_REG,,,
+` movl `$'L(mcount_data_`'mcount_counter), MCOUNT_NONPIC_REG
+')dnl
+MCOUNT_NONPIC_CALL
+')dnl
+ifelse(WANT_PROFILING,`gprof',
+` popl %ebp
+')
+define(`mcount_counter',incr(mcount_counter))
+')
+
+define(mcount_counter,1)
+
+
+dnl Usage: call_instrument(enter|exit)
+dnl
+dnl Call __cyg_profile_func_enter or __cyg_profile_func_exit.
+dnl
+dnl For PIC, most routines don't require _GLOBAL_OFFSET_TABLE_ themselves
+dnl so %ebx is just setup for these calls. It's a bit wasteful to repeat
+dnl the setup for the exit call having done it earlier for the enter, but
+dnl there's nowhere very convenient to hold %ebx through the length of a
+dnl routine, in general.
+dnl
+dnl For PIC, because instrument_current_function will be within the current
+dnl object file we can get it just as an offset from %eip, there's no need
+dnl to use the GOT.
+dnl
+dnl No attempt is made to maintain the stack alignment gcc generates with
+dnl -mpreferred-stack-boundary. This wouldn't be hard, but it seems highly
+dnl unlikely the instrumenting functions would be doing anything that'd
+dnl benefit from alignment, in particular they're unlikely to be using
+dnl doubles or long doubles on the stack.
+dnl
+dnl The FRAME scheme is used to conveniently account for the register saves
+dnl before accessing the return address. Any previous value is saved and
+dnl restored, since plenty of code keeps a value across a "ret" in the
+dnl middle of a routine.
+
+define(call_instrument,
+m4_assert_numargs(1)
+` pushdef(`FRAME',0)
+ifelse($1,exit,
+` pushl %eax FRAME_pushl() C return value
+')
+ifdef(`PIC',
+` pushl %ebx FRAME_pushl()
+ call_movl_eip_to_ebx
+L(instrument_here_`'instrument_count):
+ movl %ebx, %ecx
+ addl $_GLOBAL_OFFSET_TABLE_+[.-L(instrument_here_`'instrument_count)], %ebx
+ C use addl rather than leal to avoid old gas bugs, see mpn/x86/README
+ addl $instrument_current_function-L(instrument_here_`'instrument_count), %ecx
+ pushl m4_empty_if_zero(FRAME)(%esp) FRAME_pushl() C return addr
+ pushl %ecx FRAME_pushl() C this function
+ call GSYM_PREFIX`'__cyg_profile_func_$1@PLT
+ addl $`'8, %esp
+ popl %ebx
+',
+` C non-PIC
+ pushl m4_empty_if_zero(FRAME)(%esp) FRAME_pushl() C return addr
+ pushl $instrument_current_function FRAME_pushl() C this function
+ call GSYM_PREFIX`'__cyg_profile_func_$1
+ addl $`'8, %esp
+')
+ifelse($1,exit,
+` popl %eax C return value
+')
+ popdef(`FRAME')
+define(`instrument_count',incr(instrument_count))
+')
+define(instrument_count,1)
+
+
+dnl Usage: instrument_current_function
+dnl
+dnl Return the current function name for instrumenting purposes. This is
+dnl PROLOGUE_current_function, but it sticks at the first such name seen.
+dnl
+dnl Sticking to the first name seen ensures that multiple-entrypoint
+dnl functions like mpn_add_nc and mpn_add_n will make enter and exit calls
+dnl giving the same function address.
+
+define(instrument_current_function,
+m4_assert_numargs(-1)
+`ifdef(`instrument_current_function_seen',
+`instrument_current_function_seen',
+`define(`instrument_current_function_seen',PROLOGUE_current_function)dnl
+PROLOGUE_current_function')')
+
+
+dnl Usage: call_movl_eip_to_ebx
+dnl
+dnl Generate a call to L(movl_eip_to_ebx), and record the need for that
+dnl routine.
+
+define(call_movl_eip_to_ebx,
+m4_assert_numargs(-1)
+`call L(movl_eip_to_ebx)
+define(`movl_eip_to_ebx_needed',1)')
+
+dnl Usage: generate_movl_eip_to_ebx
+dnl
+dnl Emit a L(movl_eip_to_ebx) routine, if needed and not already generated.
+
+define(generate_movl_eip_to_ebx,
+m4_assert_numargs(-1)
+`ifelse(movl_eip_to_ebx_needed,1,
+`ifelse(movl_eip_to_ebx_done,1,,
+`L(movl_eip_to_ebx):
+ movl (%esp), %ebx
+ ret_internal
+define(`movl_eip_to_ebx_done',1)
+')')')
+
+
+dnl Usage: ret
+dnl
+dnl Generate a "ret", but if doing instrumented profiling then call
+dnl __cyg_profile_func_exit first.
+
+define(ret,
+m4_assert_numargs(-1)
+m4_assert_defined(`WANT_PROFILING')
+`ifelse(WANT_PROFILING,instrument,
+`ret_instrument',
+`ret_internal')
+generate_movl_eip_to_ebx
+')
+
+
+dnl Usage: ret_internal
+dnl
+dnl A plain "ret", without any __cyg_profile_func_exit call. This can be
+dnl used for a return which is internal to some function, such as when
+dnl getting %eip for PIC.
+
+define(ret_internal,
+m4_assert_numargs(-1)
+``ret'')
+
+
+dnl Usage: ret_instrument
+dnl
+dnl Generate call to __cyg_profile_func_exit and then a ret. If a ret has
+dnl already been seen from this function then jump to that chunk of code,
+dnl rather than emitting it again.
+
+define(ret_instrument,
+m4_assert_numargs(-1)
+`ifelse(m4_unquote(ret_instrument_seen_`'instrument_current_function),1,
+`jmp L(instrument_exit_`'instrument_current_function)',
+`define(ret_instrument_seen_`'instrument_current_function,1)
+L(instrument_exit_`'instrument_current_function):
+call_instrument(exit)
+ ret_internal')')
+
+
+dnl Usage: _GLOBAL_OFFSET_TABLE_
+dnl
+dnl Expand to _GLOBAL_OFFSET_TABLE_ plus any necessary underscore prefix.
+dnl This lets us write plain _GLOBAL_OFFSET_TABLE_ in SVR4 style, but still
+dnl work with systems requiring an extra underscore such as OpenBSD.
+dnl
+dnl deflit is used so "leal _GLOBAL_OFFSET_TABLE_(%eax), %ebx" will come
+dnl out right, though that form doesn't work properly in gas (see
+dnl mpn/x86/README).
+
+deflit(_GLOBAL_OFFSET_TABLE_,
+m4_assert_defined(`GOT_GSYM_PREFIX')
+`GOT_GSYM_PREFIX`_GLOBAL_OFFSET_TABLE_'')
+
+
+dnl --------------------------------------------------------------------------
+dnl Various x86 macros.
+dnl
+
+
+dnl Usage: ALIGN_OFFSET(bytes,offset)
+dnl
+dnl Align to `offset' away from a multiple of `bytes'.
+dnl
+dnl This is useful for testing, for example align to something very strict
+dnl and see what effect offsets from it have, "ALIGN_OFFSET(256,32)".
+dnl
+dnl Generally you wouldn't execute across the padding, but it's done with
+dnl nop's so it'll work.
+
+define(ALIGN_OFFSET,
+m4_assert_numargs(2)
+`ALIGN($1)
+forloop(`i',1,$2,` nop
+')')
+
+
+dnl Usage: defframe(name,offset)
+dnl
+dnl Make a definition like the following with which to access a parameter
+dnl or variable on the stack.
+dnl
+dnl define(name,`FRAME+offset(%esp)')
+dnl
+dnl Actually m4_empty_if_zero(FRAME+offset) is used, which will save one
+dnl byte if FRAME+offset is zero, by putting (%esp) rather than 0(%esp).
+dnl Use define(`defframe_empty_if_zero_disabled',1) if for some reason the
+dnl zero offset is wanted.
+dnl
+dnl The new macro also gets a check that when it's used FRAME is actually
+dnl defined, and that the final %esp offset isn't negative, which would
+dnl mean an attempt to access something below the current %esp.
+dnl
+dnl deflit() is used rather than a plain define(), so the new macro won't
+dnl delete any following parenthesized expression. name(%edi) will come
+dnl out say as 16(%esp)(%edi). This isn't valid assembler and should
+dnl provoke an error, which is better than silently giving just 16(%esp).
+dnl
+dnl See README for more on the suggested way to access the stack frame.
+
+define(defframe,
+m4_assert_numargs(2)
+`deflit(`$1',
+m4_assert_defined(`FRAME')
+`defframe_check_notbelow(`$1',$2,FRAME)dnl
+defframe_empty_if_zero(FRAME+($2))(%esp)')')
+
+dnl Called: defframe_empty_if_zero(expression)
+define(defframe_empty_if_zero,
+m4_assert_numargs(1)
+`ifelse(defframe_empty_if_zero_disabled,1,
+`eval($1)',
+`m4_empty_if_zero($1)')')
+
+dnl Called: defframe_check_notbelow(`name',offset,FRAME)
+define(defframe_check_notbelow,
+m4_assert_numargs(3)
+`ifelse(eval(($3)+($2)<0),1,
+`m4_error(`$1 at frame offset $2 used when FRAME is only $3 bytes
+')')')
+
+
+dnl Usage: FRAME_pushl()
+dnl FRAME_popl()
+dnl FRAME_addl_esp(n)
+dnl FRAME_subl_esp(n)
+dnl
+dnl Adjust FRAME appropriately for a pushl or popl, or for an addl or subl
+dnl %esp of n bytes.
+dnl
+dnl Using these macros is completely optional. Sometimes it makes more
+dnl sense to put explicit deflit(`FRAME',N) forms, especially when there's
+dnl jumps and different sequences of FRAME values need to be used in
+dnl different places.
+
+define(FRAME_pushl,
+m4_assert_numargs(0)
+m4_assert_defined(`FRAME')
+`deflit(`FRAME',eval(FRAME+4))')
+
+define(FRAME_popl,
+m4_assert_numargs(0)
+m4_assert_defined(`FRAME')
+`deflit(`FRAME',eval(FRAME-4))')
+
+define(FRAME_addl_esp,
+m4_assert_numargs(1)
+m4_assert_defined(`FRAME')
+`deflit(`FRAME',eval(FRAME-($1)))')
+
+define(FRAME_subl_esp,
+m4_assert_numargs(1)
+m4_assert_defined(`FRAME')
+`deflit(`FRAME',eval(FRAME+($1)))')
+
+
+dnl Usage: defframe_pushl(name)
+dnl
+dnl Do a combination FRAME_pushl() and a defframe() to name the stack
+dnl location just pushed. This should come after a pushl instruction.
+dnl Putting it on the same line works and avoids lengthening the code. For
+dnl example,
+dnl
+dnl pushl %eax defframe_pushl(VAR_COUNTER)
+dnl
+dnl Notice the defframe() is done with an unquoted -FRAME thus giving its
+dnl current value without tracking future changes.
+
+define(defframe_pushl,
+m4_assert_numargs(1)
+`FRAME_pushl()defframe(`$1',-FRAME)')
+
+
+dnl --------------------------------------------------------------------------
+dnl Assembler instruction macros.
+dnl
+
+
+dnl Usage: emms_or_femms
+dnl femms_available_p
+dnl
+dnl femms_available_p expands to 1 or 0 according to whether the AMD 3DNow
+dnl femms instruction is available. emms_or_femms expands to femms if
+dnl available, or emms if not.
+dnl
+dnl emms_or_femms is meant for use in the K6 directory where plain K6
+dnl (without femms) and K6-2 and K6-3 (with a slightly faster femms) are
+dnl supported together.
+dnl
+dnl On K7 femms is no longer faster and is just an alias for emms, so plain
+dnl emms may as well be used.
+
+define(femms_available_p,
+m4_assert_numargs(-1)
+`m4_ifdef_anyof_p(
+ `HAVE_HOST_CPU_k62',
+ `HAVE_HOST_CPU_k63',
+ `HAVE_HOST_CPU_athlon')')
+
+define(emms_or_femms,
+m4_assert_numargs(-1)
+`ifelse(femms_available_p,1,`femms',`emms')')
+
+
+dnl Usage: femms
+dnl
+dnl Gas 2.9.1 which comes with FreeBSD 3.4 doesn't support femms, so the
+dnl following is a replacement using .byte.
+
+define(femms,
+m4_assert_numargs(-1)
+`.byte 15,14 C AMD 3DNow femms')
+
+
+dnl Usage: jadcl0(op)
+dnl
+dnl Generate a jnc/incl as a substitute for adcl $0,op. Note this isn't an
+dnl exact replacement, since it doesn't set the flags like adcl does.
+dnl
+dnl This finds a use in K6 mpn_addmul_1, mpn_submul_1, mpn_mul_basecase and
+dnl mpn_sqr_basecase because on K6 an adcl is slow, the branch
+dnl misprediction penalty is small, and the multiply algorithm used leads
+dnl to a carry bit on average only 1/4 of the time.
+dnl
+dnl jadcl0_disabled can be set to 1 to instead generate an ordinary adcl
+dnl for comparison. For example,
+dnl
+dnl define(`jadcl0_disabled',1)
+dnl
+dnl When using a register operand, eg. "jadcl0(%edx)", the jnc/incl code is
+dnl the same size as an adcl. This makes it possible to use the exact same
+dnl computed jump code when testing the relative speed of the two.
+
+define(jadcl0,
+m4_assert_numargs(1)
+`ifelse(jadcl0_disabled,1,
+ `adcl $`'0, $1',
+ `jnc L(jadcl0_`'jadcl0_counter)
+ incl $1
+L(jadcl0_`'jadcl0_counter):
+define(`jadcl0_counter',incr(jadcl0_counter))')')
+
+define(jadcl0_counter,1)
+
+
+dnl Usage: x86_lookup(target, key,value, key,value, ...)
+dnl x86_lookup_p(target, key,value, key,value, ...)
+dnl
+dnl Look for `target' among the `key' parameters.
+dnl
+dnl x86_lookup expands to the corresponding `value', or generates an error
+dnl if `target' isn't found.
+dnl
+dnl x86_lookup_p expands to 1 if `target' is found, or 0 if not.
+
+define(x86_lookup,
+m4_assert_numargs_range(1,999)
+`ifelse(eval($#<3),1,
+`m4_error(`unrecognised part of x86 instruction: $1
+')',
+`ifelse(`$1',`$2', `$3',
+`x86_lookup(`$1',shift(shift(shift($@))))')')')
+
+define(x86_lookup_p,
+m4_assert_numargs_range(1,999)
+`ifelse(eval($#<3),1, `0',
+`ifelse(`$1',`$2', `1',
+`x86_lookup_p(`$1',shift(shift(shift($@))))')')')
+
+
+dnl Usage: x86_opcode_reg32(reg)
+dnl x86_opcode_reg32_p(reg)
+dnl
+dnl x86_opcode_reg32 expands to the standard 3 bit encoding for the given
+dnl 32-bit register, eg. `%ebp' turns into 5.
+dnl
+dnl x86_opcode_reg32_p expands to 1 if reg is a valid 32-bit register, or 0
+dnl if not.
+
+define(x86_opcode_reg32,
+m4_assert_numargs(1)
+`x86_lookup(`$1',x86_opcode_reg32_list)')
+
+define(x86_opcode_reg32_p,
+m4_assert_onearg()
+`x86_lookup_p(`$1',x86_opcode_reg32_list)')
+
+define(x86_opcode_reg32_list,
+``%eax',0,
+`%ecx',1,
+`%edx',2,
+`%ebx',3,
+`%esp',4,
+`%ebp',5,
+`%esi',6,
+`%edi',7')
+
+
+dnl Usage: x86_opcode_tttn(cond)
+dnl
+dnl Expand to the 4-bit "tttn" field value for the given x86 branch
+dnl condition (like `c', `ae', etc).
+
+define(x86_opcode_tttn,
+m4_assert_numargs(1)
+`x86_lookup(`$1',x86_opcode_ttn_list)')
+
+define(x86_opcode_tttn_list,
+``o', 0,
+`no', 1,
+`b', 2, `c', 2, `nae',2,
+`nb', 3, `nc', 3, `ae', 3,
+`e', 4, `z', 4,
+`ne', 5, `nz', 5,
+`be', 6, `na', 6,
+`nbe', 7, `a', 7,
+`s', 8,
+`ns', 9,
+`p', 10, `pe', 10, `npo',10,
+`np', 11, `npe',11, `po', 11,
+`l', 12, `nge',12,
+`nl', 13, `ge', 13,
+`le', 14, `ng', 14,
+`nle',15, `g', 15')
+
+
+dnl Usage: cmovCC(%srcreg,%dstreg)
+dnl
+dnl Emit a cmov instruction, using a .byte sequence, since various past
+dnl versions of gas don't know cmov. For example,
+dnl
+dnl cmovz( %eax, %ebx)
+dnl
+dnl The source operand can only be a plain register. (m4 code implementing
+dnl full memory addressing modes exists, believe it or not, but isn't
+dnl currently needed and isn't included.)
+dnl
+dnl All the standard conditions are defined. Attempting to use one without
+dnl the macro parentheses, such as just "cmovbe %eax, %ebx", will provoke
+dnl an error. This protects against writing something old gas wouldn't
+dnl understand.
+
+dnl Called: define_cmov_many(cond,tttn,cond,tttn,...)
+define(define_cmov_many,
+`ifelse(m4_length(`$1'),0,,
+`define_cmov(`$1',`$2')define_cmov_many(shift(shift($@)))')')
+
+dnl Called: define_cmov(cond,tttn)
+dnl Emit basically define(cmov<cond>,`cmov_internal(<cond>,<ttn>,`$1',`$2')')
+define(define_cmov,
+m4_assert_numargs(2)
+`define(`cmov$1',
+m4_instruction_wrapper()
+m4_assert_numargs(2)
+`cmov_internal'(m4_doublequote($`'0),``$2'',dnl
+m4_doublequote($`'1),m4_doublequote($`'2)))')
+
+define_cmov_many(x86_opcode_tttn_list)
+
+dnl Called: cmov_internal(name,tttn,src,dst)
+define(cmov_internal,
+m4_assert_numargs(4)
+`.byte dnl
+15, dnl
+eval(64+$2), dnl
+eval(192+8*x86_opcode_reg32(`$4')+x86_opcode_reg32(`$3')) dnl
+ C `$1 $3, $4'')
+
+
+dnl Usage: x86_opcode_regmmx(reg)
+dnl
+dnl Validate the given mmx register, and return its number, 0 to 7.
+
+define(x86_opcode_regmmx,
+m4_assert_numargs(1)
+`x86_lookup(`$1',x86_opcode_regmmx_list)')
+
+define(x86_opcode_regmmx_list,
+``%mm0',0,
+`%mm1',1,
+`%mm2',2,
+`%mm3',3,
+`%mm4',4,
+`%mm5',5,
+`%mm6',6,
+`%mm7',7')
+
+
+dnl Usage: psadbw(%srcreg,%dstreg)
+dnl
+dnl Oldish versions of gas don't know psadbw, in particular gas 2.9.1 on
+dnl FreeBSD 3.3 and 3.4 doesn't, so instead emit .byte sequences. For
+dnl example,
+dnl
+dnl psadbw( %mm1, %mm2)
+dnl
+dnl Only register->register forms are supported here, which suffices for
+dnl the current code.
+
+define(psadbw,
+m4_instruction_wrapper()
+m4_assert_numargs(2)
+`.byte 0x0f,0xf6,dnl
+eval(192+x86_opcode_regmmx(`$2')*8+x86_opcode_regmmx(`$1')) dnl
+ C `psadbw $1, $2'')
+
+
+dnl Usage: Zdisp(inst,op,op,op)
+dnl
+dnl Generate explicit .byte sequences if necessary to force a byte-sized
+dnl zero displacement on an instruction. For example,
+dnl
+dnl Zdisp( movl, 0,(%esi), %eax)
+dnl
+dnl expands to
+dnl
+dnl .byte 139,70,0 C movl 0(%esi), %eax
+dnl
+dnl If the displacement given isn't 0, then normal assembler code is
+dnl generated. For example,
+dnl
+dnl Zdisp( movl, 4,(%esi), %eax)
+dnl
+dnl expands to
+dnl
+dnl movl 4(%esi), %eax
+dnl
+dnl This means a single Zdisp() form can be used with an expression for the
+dnl displacement, and .byte will be used only if necessary. The
+dnl displacement argument is eval()ed.
+dnl
+dnl Because there aren't many places a 0(reg) form is wanted, Zdisp is
+dnl implemented with a table of instructions and encodings. A new entry is
+dnl needed for any different operation or registers. The table is split
+dnl into separate macros to avoid overflowing BSD m4 macro expansion space.
+
+define(Zdisp,
+m4_assert_numargs(4)
+`define(`Zdisp_found',0)dnl
+Zdisp_1($@)dnl
+Zdisp_2($@)dnl
+Zdisp_3($@)dnl
+Zdisp_4($@)dnl
+ifelse(Zdisp_found,0,
+`m4_error(`unrecognised instruction in Zdisp: $1 $2 $3 $4
+')')')
+
+define(Zdisp_1,`dnl
+Zdisp_match( adcl, 0,(%edx), %eax, `0x13,0x42,0x00', $@)`'dnl
+Zdisp_match( adcl, 0,(%edx), %ebx, `0x13,0x5a,0x00', $@)`'dnl
+Zdisp_match( adcl, 0,(%edx), %esi, `0x13,0x72,0x00', $@)`'dnl
+Zdisp_match( addl, %ebx, 0,(%edi), `0x01,0x5f,0x00', $@)`'dnl
+Zdisp_match( addl, %ecx, 0,(%edi), `0x01,0x4f,0x00', $@)`'dnl
+Zdisp_match( addl, %esi, 0,(%edi), `0x01,0x77,0x00', $@)`'dnl
+Zdisp_match( sbbl, 0,(%edx), %eax, `0x1b,0x42,0x00', $@)`'dnl
+Zdisp_match( sbbl, 0,(%edx), %esi, `0x1b,0x72,0x00', $@)`'dnl
+Zdisp_match( subl, %ecx, 0,(%edi), `0x29,0x4f,0x00', $@)`'dnl
+Zdisp_match( movzbl, 0,(%eax,%ebp), %eax, `0x0f,0xb6,0x44,0x28,0x00', $@)`'dnl
+Zdisp_match( movzbl, 0,(%ecx,%edi), %edi, `0x0f,0xb6,0x7c,0x39,0x00', $@)`'dnl
+Zdisp_match( adc, 0,(%ebx,%ecx,4), %eax, `0x13,0x44,0x8b,0x00', $@)`'dnl
+Zdisp_match( sbb, 0,(%ebx,%ecx,4), %eax, `0x1b,0x44,0x8b,0x00', $@)`'dnl
+')
+define(Zdisp_2,`dnl
+Zdisp_match( movl, %eax, 0,(%edi), `0x89,0x47,0x00', $@)`'dnl
+Zdisp_match( movl, %ebx, 0,(%edi), `0x89,0x5f,0x00', $@)`'dnl
+Zdisp_match( movl, %esi, 0,(%edi), `0x89,0x77,0x00', $@)`'dnl
+Zdisp_match( movl, 0,(%ebx), %eax, `0x8b,0x43,0x00', $@)`'dnl
+Zdisp_match( movl, 0,(%ebx), %esi, `0x8b,0x73,0x00', $@)`'dnl
+Zdisp_match( movl, 0,(%edx), %eax, `0x8b,0x42,0x00', $@)`'dnl
+Zdisp_match( movl, 0,(%esi), %eax, `0x8b,0x46,0x00', $@)`'dnl
+Zdisp_match( movl, 0,(%esi,%ecx,4), %eax, `0x8b,0x44,0x8e,0x00', $@)`'dnl
+Zdisp_match( mov, 0,(%esi,%ecx,4), %eax, `0x8b,0x44,0x8e,0x00', $@)`'dnl
+Zdisp_match( mov, %eax, 0,(%edi,%ecx,4), `0x89,0x44,0x8f,0x00', $@)`'dnl
+')
+define(Zdisp_3,`dnl
+Zdisp_match( movq, 0,(%eax,%ecx,8), %mm0, `0x0f,0x6f,0x44,0xc8,0x00', $@)`'dnl
+Zdisp_match( movq, 0,(%ebx,%eax,4), %mm0, `0x0f,0x6f,0x44,0x83,0x00', $@)`'dnl
+Zdisp_match( movq, 0,(%ebx,%eax,4), %mm2, `0x0f,0x6f,0x54,0x83,0x00', $@)`'dnl
+Zdisp_match( movq, 0,(%ebx,%ecx,4), %mm0, `0x0f,0x6f,0x44,0x8b,0x00', $@)`'dnl
+Zdisp_match( movq, 0,(%edx), %mm0, `0x0f,0x6f,0x42,0x00', $@)`'dnl
+Zdisp_match( movq, 0,(%esi), %mm0, `0x0f,0x6f,0x46,0x00', $@)`'dnl
+Zdisp_match( movq, %mm0, 0,(%edi), `0x0f,0x7f,0x47,0x00', $@)`'dnl
+Zdisp_match( movq, %mm2, 0,(%ecx,%eax,4), `0x0f,0x7f,0x54,0x81,0x00', $@)`'dnl
+Zdisp_match( movq, %mm2, 0,(%edx,%eax,4), `0x0f,0x7f,0x54,0x82,0x00', $@)`'dnl
+Zdisp_match( movq, %mm0, 0,(%edx,%ecx,8), `0x0f,0x7f,0x44,0xca,0x00', $@)`'dnl
+')
+define(Zdisp_4,`dnl
+Zdisp_match( movd, 0,(%eax,%ecx,4), %mm0, `0x0f,0x6e,0x44,0x88,0x00', $@)`'dnl
+Zdisp_match( movd, 0,(%eax,%ecx,8), %mm1, `0x0f,0x6e,0x4c,0xc8,0x00', $@)`'dnl
+Zdisp_match( movd, 0,(%edx,%ecx,8), %mm0, `0x0f,0x6e,0x44,0xca,0x00', $@)`'dnl
+Zdisp_match( movd, %mm0, 0,(%eax,%ecx,4), `0x0f,0x7e,0x44,0x88,0x00', $@)`'dnl
+Zdisp_match( movd, %mm0, 0,(%ecx,%eax,4), `0x0f,0x7e,0x44,0x81,0x00', $@)`'dnl
+Zdisp_match( movd, %mm2, 0,(%ecx,%eax,4), `0x0f,0x7e,0x54,0x81,0x00', $@)`'dnl
+Zdisp_match( movd, %mm0, 0,(%edx,%ecx,4), `0x0f,0x7e,0x44,0x8a,0x00', $@)`'dnl
+')
+
+define(Zdisp_match,
+m4_assert_numargs(9)
+`ifelse(eval(m4_stringequal_p(`$1',`$6')
+ && m4_stringequal_p(`$2',0)
+ && m4_stringequal_p(`$3',`$8')
+ && m4_stringequal_p(`$4',`$9')),1,
+`define(`Zdisp_found',1)dnl
+ifelse(eval(`$7'),0,
+` .byte $5 C `$1 0$3, $4'',
+` $6 $7$8, $9')',
+
+`ifelse(eval(m4_stringequal_p(`$1',`$6')
+ && m4_stringequal_p(`$2',`$7')
+ && m4_stringequal_p(`$3',0)
+ && m4_stringequal_p(`$4',`$9')),1,
+`define(`Zdisp_found',1)dnl
+ifelse(eval(`$8'),0,
+` .byte $5 C `$1 $2, 0$4'',
+` $6 $7, $8$9')')')')
+
+
+dnl Usage: shldl(count,src,dst)
+dnl shrdl(count,src,dst)
+dnl shldw(count,src,dst)
+dnl shrdw(count,src,dst)
+dnl
+dnl Generate a double-shift instruction, possibly omitting a %cl count
+dnl parameter if that's what the assembler requires, as indicated by
+dnl WANT_SHLDL_CL in config.m4. For example,
+dnl
+dnl shldl( %cl, %eax, %ebx)
+dnl
+dnl turns into either
+dnl
+dnl shldl %cl, %eax, %ebx
+dnl or
+dnl shldl %eax, %ebx
+dnl
+dnl Immediate counts are always passed through unchanged. For example,
+dnl
+dnl shrdl( $2, %esi, %edi)
+dnl becomes
+dnl shrdl $2, %esi, %edi
+dnl
+dnl
+dnl If you forget to use the macro form "shldl( ...)" and instead write
+dnl just a plain "shldl ...", an error results. This ensures the necessary
+dnl variant treatment of %cl isn't accidentally bypassed.
+
+define(define_shd_instruction,
+m4_assert_numargs(1)
+`define($1,
+m4_instruction_wrapper()
+m4_assert_numargs(3)
+`shd_instruction'(m4_doublequote($`'0),m4_doublequote($`'1),dnl
+m4_doublequote($`'2),m4_doublequote($`'3)))')
+
+dnl Effectively: define(shldl,`shd_instruction(`$0',`$1',`$2',`$3')') etc
+define_shd_instruction(shldl)
+define_shd_instruction(shrdl)
+define_shd_instruction(shldw)
+define_shd_instruction(shrdw)
+
+dnl Called: shd_instruction(op,count,src,dst)
+define(shd_instruction,
+m4_assert_numargs(4)
+m4_assert_defined(`WANT_SHLDL_CL')
+`ifelse(eval(m4_stringequal_p(`$2',`%cl') && !WANT_SHLDL_CL),1,
+``$1' `$3', `$4'',
+``$1' `$2', `$3', `$4'')')
+
+
+dnl Usage: ASSERT([cond][,instructions])
+dnl
+dnl If WANT_ASSERT is 1, output the given instructions and expect the given
+dnl flags condition to then be satisfied. For example,
+dnl
+dnl ASSERT(ne, `cmpl %eax, %ebx')
+dnl
+dnl The instructions can be omitted to just assert a flags condition with
+dnl no extra calculation. For example,
+dnl
+dnl ASSERT(nc)
+dnl
+dnl When `instructions' is not empty, a pushf/popf is added to preserve the
+dnl flags, but the instructions themselves must preserve any registers that
+dnl matter. FRAME is adjusted for the push and pop, so the instructions
+dnl given can use defframe() stack variables.
+dnl
+dnl The condition can be omitted to just output the given instructions when
+dnl assertion checking is wanted. In this case the pushf/popf is omitted.
+dnl For example,
+dnl
+dnl ASSERT(, `movl %eax, VAR_KEEPVAL')
+
+define(ASSERT,
+m4_assert_numargs_range(1,2)
+m4_assert_defined(`WANT_ASSERT')
+`ifelse(WANT_ASSERT,1,
+`ifelse(`$1',,
+ `$2',
+ `C ASSERT
+ifelse(`$2',,,` pushf ifdef(`FRAME',`FRAME_pushl()')')
+ $2
+ j`$1' L(ASSERT_ok`'ASSERT_counter)
+ ud2 C assertion failed
+L(ASSERT_ok`'ASSERT_counter):
+ifelse(`$2',,,` popf ifdef(`FRAME',`FRAME_popl()')')
+define(`ASSERT_counter',incr(ASSERT_counter))')')')
+
+define(ASSERT_counter,1)
+
+
+dnl Usage: movl_text_address(label,register)
+dnl
+dnl Get the address of a text segment label, using either a plain movl or a
+dnl position-independent calculation, as necessary. For example,
+dnl
+dnl movl_code_address(L(foo),%eax)
+dnl
+dnl This macro is only meant for use in ASSERT()s or when testing, since
+dnl the PIC sequence it generates will want to be done with a ret balancing
+dnl the call on CPUs with return address branch prediction.
+dnl
+dnl The addl generated here has a backward reference to the label, and so
+dnl won't suffer from the two forwards references bug in old gas (described
+dnl in mpn/x86/README).
+
+define(movl_text_address,
+m4_assert_numargs(2)
+`ifdef(`PIC',
+ `call L(movl_text_address_`'movl_text_address_counter)
+L(movl_text_address_`'movl_text_address_counter):
+ popl $2 C %eip
+ addl `$'$1-L(movl_text_address_`'movl_text_address_counter), $2
+define(`movl_text_address_counter',incr(movl_text_address_counter))',
+ `movl `$'$1, $2')')
+
+define(movl_text_address_counter,1)
+
+
+dnl Usage: notl_or_xorl_GMP_NUMB_MASK(reg)
+dnl
+dnl Expand to either "notl `reg'" or "xorl $GMP_NUMB_BITS,`reg'" as
+dnl appropriate for nails in use or not.
+
+define(notl_or_xorl_GMP_NUMB_MASK,
+m4_assert_numargs(1)
+`ifelse(GMP_NAIL_BITS,0,
+`notl `$1'',
+`xorl $GMP_NUMB_MASK, `$1'')')
+
+
+dnl Usage LEA(symbol,reg)
+
+define(`LEA',
+m4_assert_numargs(2)
+`ifdef(`PIC',`
+define(`EPILOGUE_cpu',
+`
+L(movl_eip_`'substr($2,1)):
+ movl (%esp), $2
+ ret_internal
+ SIZE($'`1, .-$'`1)')
+
+ call L(movl_eip_`'substr($2,1))
+ addl $_GLOBAL_OFFSET_TABLE_, $2
+ movl $1@GOT($2), $2
+',`
+ movl `$'$1, $2
+')')
+
+define(`DEF_OBJECT',
+m4_assert_numargs_range(1,2)
+ `RODATA
+ ALIGN(ifelse($#,1,2,$2))
+$1:
+')
+
+define(`END_OBJECT',
+m4_assert_numargs(1)
+` SIZE(`$1',.-`$1')')
+
+dnl Usage: CALL(funcname)
+dnl
+
+define(`CALL',
+m4_assert_numargs(1)
+`ifdef(`PIC',
+ `call GSYM_PREFIX`'$1@PLT',
+ `call GSYM_PREFIX`'$1')')
+
+ifdef(`PIC',
+`define(`PIC_WITH_EBX')',
+`undefine(`PIC_WITH_EBX')')
+
+divert`'dnl
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/README b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/README
new file mode 100644
index 00000000000..9c8a5866227
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/README
@@ -0,0 +1,74 @@
+Copyright 2003, 2004, 2006, 2008 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/.
+
+
+
+
+
+ AMD64 MPN SUBROUTINES
+
+
+This directory contains mpn functions for AMD64 chips. It is also useful
+for 64-bit Pentiums, and "Core 2".
+
+
+ RELEVANT OPTIMIZATION ISSUES
+
+The Opteron and Athlon64 can sustain up to 3 instructions per cycle, but in
+practice that is only possible for integer instructions. But almost any
+three integer instructions can issue simultaneously, including any 3 ALU
+operations, including shifts. Up to two memory operations can issue each
+cycle.
+
+Scheduling typically requires that load-use instructions are split into
+separate load and use instructions. That requires more decode resources,
+and it is rarely a win. Opteron/Athlon64 have deep out-of-order core.
+
+
+Optimizing for 64-bit Pentium4 is probably a waste of time, as the most
+critical instructions are very poorly implemented here. Perhaps we could
+save a cycle or two, but the most common loops now run at between 10 and 22
+cycles, so a saved cycle isn't too exciting.
+
+
+The new spin of the venerable P6 core, the "Core 2" is much better than the
+Pentium4 for the GMP loops. Its integer pipeline is somewhat similar to to
+the Opteron/Athlon64 pipeline, except that the GMP favourites ADC/SBB and
+MUL are slower. Furthermore, an INC/DEC followed by ADC/SBB incur a
+pipeline stall of around 10 cycles. The default mpn_add_n and mpn_sub_n
+code suffers badly from the stall. The code in the core2 subdirectory uses
+the almost forgotten instruction JRCXZ for loop control, and updates the
+induction variable using LEA.
+
+
+
+REFERENCES
+
+"System V Application Binary Interface AMD64 Architecture Processor
+Supplement", draft version 0.99, December 2007.
+http://www.x86-64.org/documentation/abi.pdf
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/addaddmul_1msb0.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/addaddmul_1msb0.asm
new file mode 100644
index 00000000000..87c21b4aca9
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/addaddmul_1msb0.asm
@@ -0,0 +1,170 @@
+dnl AMD64 mpn_addaddmul_1msb0, R = Au + Bv, u,v < 2^63.
+
+dnl Copyright 2008 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 AMD K8,K9 2.167
+C AMD K10 2.167
+C Intel P4 12.0
+C Intel core2 4.0
+C Intel corei ?
+C Intel atom ?
+C VIA nano ?
+
+C TODO
+C * Perhaps handle various n mod 3 sizes better. The code now is too large.
+
+C INPUT PARAMETERS
+define(`rp', `%rdi')
+define(`ap', `%rsi')
+define(`bp_param', `%rdx')
+define(`n', `%rcx')
+define(`u0', `%r8')
+define(`v0', `%r9')
+
+
+define(`bp', `%rbp')
+
+ASM_START()
+ TEXT
+ ALIGN(16)
+PROLOGUE(mpn_addaddmul_1msb0)
+ push %r12
+ push %rbp
+
+ lea (ap,n,8), ap
+ lea (bp_param,n,8), bp
+ lea (rp,n,8), rp
+ neg n
+
+ mov (ap,n,8), %rax
+ mul %r8
+ mov %rax, %r12
+ mov (bp,n,8), %rax
+ mov %rdx, %r10
+ add $3, n
+ jns L(end)
+
+ ALIGN(16)
+L(top): mul %r9
+ add %rax, %r12
+ mov -16(ap,n,8), %rax
+ adc %rdx, %r10
+ mov %r12, -24(rp,n,8)
+ mul %r8
+ add %rax, %r10
+ mov -16(bp,n,8), %rax
+ mov $0, R32(%r11)
+ adc %rdx, %r11
+ mul %r9
+ add %rax, %r10
+ mov -8(ap,n,8), %rax
+ adc %rdx, %r11
+ mov %r10, -16(rp,n,8)
+ mul %r8
+ add %rax, %r11
+ mov -8(bp,n,8), %rax
+ mov $0, R32(%r12)
+ adc %rdx, %r12
+ mul %r9
+ add %rax, %r11
+ adc %rdx, %r12
+ mov (ap,n,8), %rax
+ mul %r8
+ add %rax, %r12
+ mov %r11, -8(rp,n,8)
+ mov (bp,n,8), %rax
+ mov $0, R32(%r10)
+ adc %rdx, %r10
+ add $3, n
+ js L(top)
+
+L(end): cmp $1, R32(n)
+ ja 2f
+ jz 1f
+
+ mul %r9
+ add %rax, %r12
+ mov -16(ap), %rax
+ adc %rdx, %r10
+ mov %r12, -24(rp)
+ mul %r8
+ add %rax, %r10
+ mov -16(bp), %rax
+ mov $0, R32(%r11)
+ adc %rdx, %r11
+ mul %r9
+ add %rax, %r10
+ mov -8(ap), %rax
+ adc %rdx, %r11
+ mov %r10, -16(rp)
+ mul %r8
+ add %rax, %r11
+ mov -8(bp), %rax
+ mov $0, R32(%r12)
+ adc %rdx, %r12
+ mul %r9
+ add %rax, %r11
+ adc %rdx, %r12
+ mov %r11, -8(rp)
+ mov %r12, %rax
+ pop %rbp
+ pop %r12
+ ret
+
+1: mul %r9
+ add %rax, %r12
+ mov -8(ap), %rax
+ adc %rdx, %r10
+ mov %r12, -16(rp)
+ mul %r8
+ add %rax, %r10
+ mov -8(bp), %rax
+ mov $0, R32(%r11)
+ adc %rdx, %r11
+ mul %r9
+ add %rax, %r10
+ adc %rdx, %r11
+ mov %r10, -8(rp)
+ mov %r11, %rax
+ pop %rbp
+ pop %r12
+ ret
+
+2: mul %r9
+ add %rax, %r12
+ mov %r12, -8(rp)
+ adc %rdx, %r10
+ mov %r10, %rax
+ pop %rbp
+ pop %r12
+ ret
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/addmul_2.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/addmul_2.asm
new file mode 100644
index 00000000000..18307d719fc
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/addmul_2.asm
@@ -0,0 +1,184 @@
+dnl AMD64 mpn_addmul_2 -- Multiply an n-limb vector with a 2-limb vector and
+dnl add the result to a third limb vector.
+
+dnl Copyright 2008, 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/limb
+C AMD K8,K9 2.375
+C AMD K10 2.375
+C Intel P4 15-16
+C Intel core2 4.45
+C Intel NHM 4.32
+C Intel SBR 3.4
+C Intel atom ?
+C VIA nano 4.4
+
+C This code is the result of running a code generation and optimization tool
+C suite written by David Harvey and Torbjorn Granlund.
+
+C TODO
+C * Tune feed-in and wind-down code.
+
+C INPUT PARAMETERS
+define(`rp', `%rdi')
+define(`up', `%rsi')
+define(`n_param',`%rdx')
+define(`vp', `%rcx')
+
+define(`v0', `%r8')
+define(`v1', `%r9')
+define(`w0', `%rbx')
+define(`w1', `%rcx')
+define(`w2', `%rbp')
+define(`w3', `%r10')
+define(`n', `%r11')
+
+ABI_SUPPORT(DOS64)
+ABI_SUPPORT(STD64)
+
+ASM_START()
+ TEXT
+ ALIGN(16)
+PROLOGUE(mpn_addmul_2)
+ FUNC_ENTRY(4)
+ mov n_param, n
+ push %rbx
+ push %rbp
+
+ mov 0(vp), v0
+ mov 8(vp), v1
+
+ mov R32(n_param), R32(%rbx)
+ mov (up), %rax
+ lea -8(up,n_param,8), up
+ lea -8(rp,n_param,8), rp
+ mul v0
+ neg n
+ and $3, R32(%rbx)
+ jz L(b0)
+ cmp $2, R32(%rbx)
+ jc L(b1)
+ jz L(b2)
+
+L(b3): mov %rax, w1
+ mov %rdx, w2
+ xor R32(w3), R32(w3)
+ mov 8(up,n,8), %rax
+ dec n
+ jmp L(lo3)
+
+L(b2): mov %rax, w2
+ mov 8(up,n,8), %rax
+ mov %rdx, w3
+ xor R32(w0), R32(w0)
+ add $-2, n
+ jmp L(lo2)
+
+L(b1): mov %rax, w3
+ mov 8(up,n,8), %rax
+ mov %rdx, w0
+ xor R32(w1), R32(w1)
+ inc n
+ jmp L(lo1)
+
+L(b0): mov $0, R32(w3)
+ mov %rax, w0
+ mov 8(up,n,8), %rax
+ mov %rdx, w1
+ xor R32(w2), R32(w2)
+ jmp L(lo0)
+
+ ALIGN(32)
+L(top): mov $0, R32(w1)
+ mul v0
+ add %rax, w3
+ mov (up,n,8), %rax
+ adc %rdx, w0
+ adc $0, R32(w1)
+L(lo1): mul v1
+ add w3, (rp,n,8)
+ mov $0, R32(w3)
+ adc %rax, w0
+ mov $0, R32(w2)
+ mov 8(up,n,8), %rax
+ adc %rdx, w1
+ mul v0
+ add %rax, w0
+ mov 8(up,n,8), %rax
+ adc %rdx, w1
+ adc $0, R32(w2)
+L(lo0): mul v1
+ add w0, 8(rp,n,8)
+ adc %rax, w1
+ adc %rdx, w2
+ mov 16(up,n,8), %rax
+ mul v0
+ add %rax, w1
+ adc %rdx, w2
+ adc $0, R32(w3)
+ mov 16(up,n,8), %rax
+L(lo3): mul v1
+ add w1, 16(rp,n,8)
+ adc %rax, w2
+ adc %rdx, w3
+ xor R32(w0), R32(w0)
+ mov 24(up,n,8), %rax
+ mul v0
+ add %rax, w2
+ mov 24(up,n,8), %rax
+ adc %rdx, w3
+ adc $0, R32(w0)
+L(lo2): mul v1
+ add w2, 24(rp,n,8)
+ adc %rax, w3
+ adc %rdx, w0
+ mov 32(up,n,8), %rax
+ add $4, n
+ js L(top)
+
+L(end): xor R32(w1), R32(w1)
+ mul v0
+ add %rax, w3
+ mov (up), %rax
+ adc %rdx, w0
+ adc R32(w1), R32(w1)
+ mul v1
+ add w3, (rp)
+ adc %rax, w0
+ adc %rdx, w1
+ mov w0, 8(rp)
+ mov w1, %rax
+
+ pop %rbp
+ pop %rbx
+ FUNC_EXIT()
+ ret
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/aorrlsh1_n.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/aorrlsh1_n.asm
new file mode 100644
index 00000000000..6ee08728232
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/aorrlsh1_n.asm
@@ -0,0 +1,170 @@
+dnl AMD64 mpn_addlsh1_n -- rp[] = up[] + (vp[] << 1)
+dnl AMD64 mpn_rsblsh1_n -- rp[] = (vp[] << 1) - up[]
+
+dnl Copyright 2003, 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/limb
+C AMD K8,K9 2
+C AMD K10 2
+C AMD bd1 ?
+C AMD bobcat ?
+C Intel P4 13
+C Intel core2 3.45
+C Intel NHM ?
+C Intel SBR ?
+C Intel atom ?
+C VIA nano ?
+
+
+C Sometimes speed degenerates, supposedly related to that some operand
+C alignments cause cache conflicts.
+
+C The speed is limited by decoding/issue bandwidth. There are 22 instructions
+C in the loop, which corresponds to ceil(22/3)/4 = 1.83 c/l.
+
+C INPUT PARAMETERS
+define(`rp',`%rdi')
+define(`up',`%rsi')
+define(`vp',`%rdx')
+define(`n', `%rcx')
+
+ifdef(`OPERATION_addlsh1_n', `
+ define(ADDSUB, add)
+ define(ADCSBB, adc)
+ define(func, mpn_addlsh1_n)')
+ifdef(`OPERATION_rsblsh1_n', `
+ define(ADDSUB, sub)
+ define(ADCSBB, sbb)
+ define(func, mpn_rsblsh1_n)')
+
+MULFUNC_PROLOGUE(mpn_addlsh1_n mpn_rsblsh1_n)
+
+ABI_SUPPORT(DOS64)
+ABI_SUPPORT(STD64)
+
+ASM_START()
+ TEXT
+ ALIGN(16)
+PROLOGUE(func)
+ FUNC_ENTRY(4)
+ push %rbp
+
+ mov (vp), %r8
+ mov R32(n), R32(%rax)
+ lea (rp,n,8), rp
+ lea (up,n,8), up
+ lea (vp,n,8), vp
+ neg n
+ xor R32(%rbp), R32(%rbp)
+ and $3, R32(%rax)
+ je L(b00)
+ cmp $2, R32(%rax)
+ jc L(b01)
+ je L(b10)
+
+L(b11): add %r8, %r8
+ mov 8(vp,n,8), %r9
+ adc %r9, %r9
+ mov 16(vp,n,8), %r10
+ adc %r10, %r10
+ sbb R32(%rax), R32(%rax) C save scy
+ ADDSUB (up,n,8), %r8
+ ADCSBB 8(up,n,8), %r9
+ mov %r8, (rp,n,8)
+ mov %r9, 8(rp,n,8)
+ ADCSBB 16(up,n,8), %r10
+ mov %r10, 16(rp,n,8)
+ sbb R32(%rbp), R32(%rbp) C save acy
+ add $3, n
+ jmp L(ent)
+
+L(b10): add %r8, %r8
+ mov 8(vp,n,8), %r9
+ adc %r9, %r9
+ sbb R32(%rax), R32(%rax) C save scy
+ ADDSUB (up,n,8), %r8
+ ADCSBB 8(up,n,8), %r9
+ mov %r8, (rp,n,8)
+ mov %r9, 8(rp,n,8)
+ sbb R32(%rbp), R32(%rbp) C save acy
+ add $2, n
+ jmp L(ent)
+
+L(b01): add %r8, %r8
+ sbb R32(%rax), R32(%rax) C save scy
+ ADDSUB (up,n,8), %r8
+ mov %r8, (rp,n,8)
+ sbb R32(%rbp), R32(%rbp) C save acy
+ inc n
+L(ent): jns L(end)
+
+ ALIGN(16)
+L(top): add R32(%rax), R32(%rax) C restore scy
+
+ mov (vp,n,8), %r8
+L(b00): adc %r8, %r8
+ mov 8(vp,n,8), %r9
+ adc %r9, %r9
+ mov 16(vp,n,8), %r10
+ adc %r10, %r10
+ mov 24(vp,n,8), %r11
+ adc %r11, %r11
+
+ sbb R32(%rax), R32(%rax) C save scy
+ add R32(%rbp), R32(%rbp) C restore acy
+
+ ADCSBB (up,n,8), %r8
+ nop C Hammer speedup!
+ ADCSBB 8(up,n,8), %r9
+ mov %r8, (rp,n,8)
+ mov %r9, 8(rp,n,8)
+ ADCSBB 16(up,n,8), %r10
+ ADCSBB 24(up,n,8), %r11
+ mov %r10, 16(rp,n,8)
+ mov %r11, 24(rp,n,8)
+
+ sbb R32(%rbp), R32(%rbp) C save acy
+ add $4, n
+ js L(top)
+
+L(end):
+ifdef(`OPERATION_addlsh1_n',`
+ add R32(%rbp), R32(%rax)
+ neg R32(%rax)')
+ifdef(`OPERATION_rsblsh1_n',`
+ sub R32(%rax), R32(%rbp)
+ movslq R32(%rbp), %rax')
+
+ pop %rbp
+ FUNC_EXIT()
+ ret
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/aorrlsh2_n.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/aorrlsh2_n.asm
new file mode 100644
index 00000000000..999e972fb46
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/aorrlsh2_n.asm
@@ -0,0 +1,53 @@
+dnl AMD64 mpn_addlsh2_n -- rp[] = up[] + (vp[] << 2)
+dnl AMD64 mpn_rsblsh2_n -- rp[] = (vp[] << 2) - up[]
+
+dnl Contributed to the GNU project by Torbjorn Granlund.
+
+dnl Copyright 2009-2011 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(ADDSUB, add)
+ define(ADCSBB, adc)
+ define(func, mpn_addlsh2_n)')
+ifdef(`OPERATION_rsblsh2_n',`
+ define(ADDSUB, sub)
+ define(ADCSBB, sbb)
+ define(func, mpn_rsblsh2_n)')
+
+MULFUNC_PROLOGUE(mpn_addlsh2_n mpn_rsblsh2_n)
+
+ABI_SUPPORT(DOS64)
+ABI_SUPPORT(STD64)
+
+include_mpn(`x86_64/aorrlshC_n.asm')
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/aorrlshC_n.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/aorrlshC_n.asm
new file mode 100644
index 00000000000..5a9fd4dfb9d
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/aorrlshC_n.asm
@@ -0,0 +1,160 @@
+dnl AMD64 mpn_addlshC_n -- rp[] = up[] + (vp[] << C)
+dnl AMD64 mpn_rsblshC_n -- rp[] = (vp[] << C) - up[]
+
+dnl Copyright 2009-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/.
+
+
+C cycles/limb
+C AMD K8,K9 2
+C AMD K10 2
+C Intel P4 ?
+C Intel core2 3
+C Intel NHM 2.75
+C Intel SBR 2.55
+C Intel atom ?
+C VIA nano ?
+
+C INPUT PARAMETERS
+define(`rp', `%rdi')
+define(`up', `%rsi')
+define(`vp', `%rdx')
+define(`n', `%rcx')
+
+define(M, eval(m4_lshift(1,LSH)))
+
+ABI_SUPPORT(DOS64)
+ABI_SUPPORT(STD64)
+
+ASM_START()
+ TEXT
+ ALIGN(16)
+PROLOGUE(func)
+ FUNC_ENTRY(4)
+ push %r12
+ push %r13
+ push %r14
+ push %r15
+
+ mov (vp), %r8
+ lea (,%r8,M), %r12
+ shr $RSH, %r8
+
+ mov R32(n), R32(%rax)
+ lea (rp,n,8), rp
+ lea (up,n,8), up
+ lea (vp,n,8), vp
+ neg n
+ and $3, R8(%rax)
+ je L(b00)
+ cmp $2, R8(%rax)
+ jc L(b01)
+ je L(b10)
+
+L(b11): mov 8(vp,n,8), %r10
+ lea (%r8,%r10,M), %r14
+ shr $RSH, %r10
+ mov 16(vp,n,8), %r11
+ lea (%r10,%r11,M), %r15
+ shr $RSH, %r11
+ ADDSUB (up,n,8), %r12
+ ADCSBB 8(up,n,8), %r14
+ ADCSBB 16(up,n,8), %r15
+ sbb R32(%rax), R32(%rax) C save carry for next
+ mov %r12, (rp,n,8)
+ mov %r14, 8(rp,n,8)
+ mov %r15, 16(rp,n,8)
+ add $3, n
+ js L(top)
+ jmp L(end)
+
+L(b01): mov %r8, %r11
+ ADDSUB (up,n,8), %r12
+ sbb R32(%rax), R32(%rax) C save carry for next
+ mov %r12, (rp,n,8)
+ add $1, n
+ js L(top)
+ jmp L(end)
+
+L(b10): mov 8(vp,n,8), %r11
+ lea (%r8,%r11,M), %r15
+ shr $RSH, %r11
+ ADDSUB (up,n,8), %r12
+ ADCSBB 8(up,n,8), %r15
+ sbb R32(%rax), R32(%rax) C save carry for next
+ mov %r12, (rp,n,8)
+ mov %r15, 8(rp,n,8)
+ add $2, n
+ js L(top)
+ jmp L(end)
+
+L(b00): mov 8(vp,n,8), %r9
+ mov 16(vp,n,8), %r10
+ jmp L(e00)
+
+ ALIGN(16)
+L(top): mov 16(vp,n,8), %r10
+ mov (vp,n,8), %r8
+ mov 8(vp,n,8), %r9
+ lea (%r11,%r8,M), %r12
+ shr $RSH, %r8
+L(e00): lea (%r8,%r9,M), %r13
+ shr $RSH, %r9
+ mov 24(vp,n,8), %r11
+ lea (%r9,%r10,M), %r14
+ shr $RSH, %r10
+ lea (%r10,%r11,M), %r15
+ shr $RSH, %r11
+ add R32(%rax), R32(%rax) C restore carry
+ ADCSBB (up,n,8), %r12
+ ADCSBB 8(up,n,8), %r13
+ ADCSBB 16(up,n,8), %r14
+ ADCSBB 24(up,n,8), %r15
+ mov %r12, (rp,n,8)
+ mov %r13, 8(rp,n,8)
+ mov %r14, 16(rp,n,8)
+ sbb R32(%rax), R32(%rax) C save carry for next
+ mov %r15, 24(rp,n,8)
+ add $4, n
+ js L(top)
+L(end):
+
+ifelse(ADDSUB,add,`
+ sub R32(%r11), R32(%rax)
+ neg R32(%rax)
+',`
+ add R32(%r11), R32(%rax)
+ movslq R32(%rax), %rax
+')
+ pop %r15
+ pop %r14
+ pop %r13
+ pop %r12
+ FUNC_EXIT()
+ ret
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/aorrlsh_n.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/aorrlsh_n.asm
new file mode 100644
index 00000000000..5ca128fbf35
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/aorrlsh_n.asm
@@ -0,0 +1,176 @@
+dnl AMD64 mpn_addlsh_n and mpn_rsblsh_n. R = V2^k +- U.
+
+dnl Copyright 2006, 2010-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/limb
+C AMD K8,K9 3.1 < 3.85 for lshift + add_n
+C AMD K10 3.1 < 3.85 for lshift + add_n
+C Intel P4 14.6 > 7.33 for lshift + add_n
+C Intel core2 3.87 > 3.27 for lshift + add_n
+C Intel NHM 4 > 3.75 for lshift + add_n
+C Intel SBR (5.8) > 3.46 for lshift + add_n
+C Intel atom (7.75) < 8.75 for lshift + add_n
+C VIA nano 4.7 < 6.25 for lshift + add_n
+
+C This was written quickly and not optimized at all. Surely one could get
+C closer to 3 c/l or perhaps even under 3 c/l. Ideas:
+C 1) Use indexing to save the 3 LEA
+C 2) Write reasonable feed-in code
+C 3) Be more clever about register usage
+C 4) Unroll more, handling CL negation, carry save/restore cost much now
+C 5) Reschedule
+
+C INPUT PARAMETERS
+define(`rp', `%rdi')
+define(`up', `%rsi')
+define(`vp', `%rdx')
+define(`n', `%rcx')
+define(`cnt', `%r8')
+
+ifdef(`OPERATION_addlsh_n',`
+ define(ADCSBB, `adc')
+ define(func, mpn_addlsh_n)
+')
+ifdef(`OPERATION_rsblsh_n',`
+ define(ADCSBB, `sbb')
+ define(func, mpn_rsblsh_n)
+')
+
+MULFUNC_PROLOGUE(mpn_addlsh_n mpn_rsblsh_n)
+
+ABI_SUPPORT(DOS64)
+ABI_SUPPORT(STD64)
+
+ASM_START()
+ TEXT
+ ALIGN(16)
+PROLOGUE(func)
+ FUNC_ENTRY(4)
+IFDOS(` mov 56(%rsp), %r8d ')
+ push %r12
+ push %r13
+ push %r14
+ push %rbp
+ push %rbx
+
+ mov n, %rax
+ xor R32(%rbx), R32(%rbx) C clear carry save register
+ mov R32(%r8), R32(%rcx) C shift count
+ xor R32(%rbp), R32(%rbp) C limb carry
+
+ mov R32(%rax), R32(%r11)
+ and $3, R32(%r11)
+ je L(4)
+ sub $1, R32(%r11)
+
+L(012): mov (vp), %r8
+ mov %r8, %r12
+ shl R8(%rcx), %r8
+ or %rbp, %r8
+ neg R8(%rcx)
+ mov %r12, %rbp
+ shr R8(%rcx), %rbp
+ neg R8(%rcx)
+ add R32(%rbx), R32(%rbx)
+ ADCSBB (up), %r8
+ mov %r8, (rp)
+ sbb R32(%rbx), R32(%rbx)
+ lea 8(up), up
+ lea 8(vp), vp
+ lea 8(rp), rp
+ sub $1, R32(%r11)
+ jnc L(012)
+
+L(4): sub $4, %rax
+ jc L(end)
+
+ ALIGN(16)
+L(top): mov (vp), %r8
+ mov %r8, %r12
+ mov 8(vp), %r9
+ mov %r9, %r13
+ mov 16(vp), %r10
+ mov %r10, %r14
+ mov 24(vp), %r11
+
+ shl R8(%rcx), %r8
+ shl R8(%rcx), %r9
+ shl R8(%rcx), %r10
+ or %rbp, %r8
+ mov %r11, %rbp
+ shl R8(%rcx), %r11
+
+ neg R8(%rcx)
+
+ shr R8(%rcx), %r12
+ shr R8(%rcx), %r13
+ shr R8(%rcx), %r14
+ shr R8(%rcx), %rbp C used next iteration
+
+ or %r12, %r9
+ or %r13, %r10
+ or %r14, %r11
+
+ neg R8(%rcx)
+
+ add R32(%rbx), R32(%rbx) C restore carry flag
+
+ ADCSBB (up), %r8
+ ADCSBB 8(up), %r9
+ ADCSBB 16(up), %r10
+ ADCSBB 24(up), %r11
+
+ mov %r8, (rp)
+ mov %r9, 8(rp)
+ mov %r10, 16(rp)
+ mov %r11, 24(rp)
+
+ sbb R32(%rbx), R32(%rbx) C save carry flag
+
+ lea 32(up), up
+ lea 32(vp), vp
+ lea 32(rp), rp
+
+ sub $4, %rax
+ jnc L(top)
+
+L(end): add R32(%rbx), R32(%rbx)
+ ADCSBB $0, %rbp
+ mov %rbp, %rax
+ pop %rbx
+ pop %rbp
+ pop %r14
+ pop %r13
+ pop %r12
+ FUNC_EXIT()
+ ret
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/aors_err1_n.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/aors_err1_n.asm
new file mode 100644
index 00000000000..54d0b3f9b75
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/aors_err1_n.asm
@@ -0,0 +1,225 @@
+dnl AMD64 mpn_add_err1_n, mpn_sub_err1_n
+
+dnl Contributed by David Harvey.
+
+dnl Copyright 2011 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 AMD K8,K9 2.75 (degenerates to 3 c/l for some alignments)
+C AMD K10 ?
+C Intel P4 ?
+C Intel core2 ?
+C Intel corei ?
+C Intel atom ?
+C VIA nano ?
+
+
+C INPUT PARAMETERS
+define(`rp', `%rdi')
+define(`up', `%rsi')
+define(`vp', `%rdx')
+define(`ep', `%rcx')
+define(`yp', `%r8')
+define(`n', `%r9')
+define(`cy_param', `8(%rsp)')
+
+define(`el', `%rbx')
+define(`eh', `%rbp')
+define(`t0', `%r10')
+define(`t1', `%r11')
+define(`t2', `%r12')
+define(`t3', `%r13')
+define(`w0', `%r14')
+define(`w1', `%r15')
+
+ifdef(`OPERATION_add_err1_n', `
+ define(ADCSBB, adc)
+ define(func, mpn_add_err1_n)')
+ifdef(`OPERATION_sub_err1_n', `
+ define(ADCSBB, sbb)
+ define(func, mpn_sub_err1_n)')
+
+MULFUNC_PROLOGUE(mpn_add_err1_n mpn_sub_err1_n)
+
+
+ASM_START()
+ TEXT
+ ALIGN(16)
+PROLOGUE(func)
+ mov cy_param, %rax
+
+ push %rbx
+ push %rbp
+ push %r12
+ push %r13
+ push %r14
+ push %r15
+
+ lea (up,n,8), up
+ lea (vp,n,8), vp
+ lea (rp,n,8), rp
+
+ mov R32(n), R32(%r10)
+ and $3, R32(%r10)
+ jz L(0mod4)
+ cmp $2, R32(%r10)
+ jc L(1mod4)
+ jz L(2mod4)
+L(3mod4):
+ xor R32(el), R32(el)
+ xor R32(eh), R32(eh)
+ xor R32(t0), R32(t0)
+ xor R32(t1), R32(t1)
+ lea -24(yp,n,8), yp
+ neg n
+
+ shr $1, %al C restore carry
+ mov (up,n,8), w0
+ mov 8(up,n,8), w1
+ ADCSBB (vp,n,8), w0
+ mov w0, (rp,n,8)
+ cmovc 16(yp), el
+ ADCSBB 8(vp,n,8), w1
+ mov w1, 8(rp,n,8)
+ cmovc 8(yp), t0
+ mov 16(up,n,8), w0
+ ADCSBB 16(vp,n,8), w0
+ mov w0, 16(rp,n,8)
+ cmovc (yp), t1
+ setc %al C save carry
+ add t0, el
+ adc $0, eh
+ add t1, el
+ adc $0, eh
+
+ add $3, n
+ jnz L(loop)
+ jmp L(end)
+
+ ALIGN(16)
+L(0mod4):
+ xor R32(el), R32(el)
+ xor R32(eh), R32(eh)
+ lea (yp,n,8), yp
+ neg n
+ jmp L(loop)
+
+ ALIGN(16)
+L(1mod4):
+ xor R32(el), R32(el)
+ xor R32(eh), R32(eh)
+ lea -8(yp,n,8), yp
+ neg n
+
+ shr $1, %al C restore carry
+ mov (up,n,8), w0
+ ADCSBB (vp,n,8), w0
+ mov w0, (rp,n,8)
+ cmovc (yp), el
+ setc %al C save carry
+
+ add $1, n
+ jnz L(loop)
+ jmp L(end)
+
+ ALIGN(16)
+L(2mod4):
+ xor R32(el), R32(el)
+ xor R32(eh), R32(eh)
+ xor R32(t0), R32(t0)
+ lea -16(yp,n,8), yp
+ neg n
+
+ shr $1, %al C restore carry
+ mov (up,n,8), w0
+ mov 8(up,n,8), w1
+ ADCSBB (vp,n,8), w0
+ mov w0, (rp,n,8)
+ cmovc 8(yp), el
+ ADCSBB 8(vp,n,8), w1
+ mov w1, 8(rp,n,8)
+ cmovc (yp), t0
+ setc %al C save carry
+ add t0, el
+ adc $0, eh
+
+ add $2, n
+ jnz L(loop)
+ jmp L(end)
+
+ ALIGN(32)
+L(loop):
+ shr $1, %al C restore carry
+ mov -8(yp), t0
+ mov $0, R32(t3)
+ mov (up,n,8), w0
+ mov 8(up,n,8), w1
+ ADCSBB (vp,n,8), w0
+ cmovnc t3, t0
+ ADCSBB 8(vp,n,8), w1
+ mov -16(yp), t1
+ mov w0, (rp,n,8)
+ mov 16(up,n,8), w0
+ mov w1, 8(rp,n,8)
+ cmovnc t3, t1
+ mov -24(yp), t2
+ ADCSBB 16(vp,n,8), w0
+ cmovnc t3, t2
+ mov 24(up,n,8), w1
+ ADCSBB 24(vp,n,8), w1
+ cmovc -32(yp), t3
+ setc %al C save carry
+ add t0, el
+ adc $0, eh
+ add t1, el
+ adc $0, eh
+ add t2, el
+ adc $0, eh
+ mov w0, 16(rp,n,8)
+ add t3, el
+ lea -32(yp), yp
+ adc $0, eh
+ mov w1, 24(rp,n,8)
+ add $4, n
+ jnz L(loop)
+
+L(end):
+ mov el, (ep)
+ mov eh, 8(ep)
+
+ pop %r15
+ pop %r14
+ pop %r13
+ pop %r12
+ pop %rbp
+ pop %rbx
+ ret
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/aors_err2_n.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/aors_err2_n.asm
new file mode 100644
index 00000000000..ce5c2a49b6d
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/aors_err2_n.asm
@@ -0,0 +1,172 @@
+dnl AMD64 mpn_add_err2_n, mpn_sub_err2_n
+
+dnl Contributed by David Harvey.
+
+dnl Copyright 2011 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 AMD K8,K9 4.5
+C AMD K10 ?
+C Intel P4 ?
+C Intel core2 6.9
+C Intel corei ?
+C Intel atom ?
+C VIA nano ?
+
+
+C INPUT PARAMETERS
+define(`rp', `%rdi')
+define(`up', `%rsi')
+define(`vp', `%rdx')
+define(`ep', `%rcx')
+define(`yp1', `%r8')
+define(`yp2', `%r9')
+define(`n_param', `8(%rsp)')
+define(`cy_param', `16(%rsp)')
+
+define(`cy1', `%r14')
+define(`cy2', `%rax')
+
+define(`n', `%r10')
+
+define(`w', `%rbx')
+define(`e1l', `%rbp')
+define(`e1h', `%r11')
+define(`e2l', `%r12')
+define(`e2h', `%r13')
+
+
+ifdef(`OPERATION_add_err2_n', `
+ define(ADCSBB, adc)
+ define(func, mpn_add_err2_n)')
+ifdef(`OPERATION_sub_err2_n', `
+ define(ADCSBB, sbb)
+ define(func, mpn_sub_err2_n)')
+
+MULFUNC_PROLOGUE(mpn_add_err2_n mpn_sub_err2_n)
+
+
+ASM_START()
+ TEXT
+ ALIGN(16)
+PROLOGUE(func)
+ mov cy_param, cy2
+ mov n_param, n
+
+ push %rbx
+ push %rbp
+ push %r12
+ push %r13
+ push %r14
+
+ xor R32(e1l), R32(e1l)
+ xor R32(e1h), R32(e1h)
+ xor R32(e2l), R32(e2l)
+ xor R32(e2h), R32(e2h)
+
+ sub yp1, yp2
+
+ lea (rp,n,8), rp
+ lea (up,n,8), up
+ lea (vp,n,8), vp
+
+ test $1, n
+ jnz L(odd)
+
+ lea -8(yp1,n,8), yp1
+ neg n
+ jmp L(top)
+
+ ALIGN(16)
+L(odd):
+ lea -16(yp1,n,8), yp1
+ neg n
+ shr $1, cy2
+ mov (up,n,8), w
+ ADCSBB (vp,n,8), w
+ cmovc 8(yp1), e1l
+ cmovc 8(yp1,yp2), e2l
+ mov w, (rp,n,8)
+ sbb cy2, cy2
+ inc n
+ jz L(end)
+
+ ALIGN(16)
+L(top):
+ mov (up,n,8), w
+ shr $1, cy2 C restore carry
+ ADCSBB (vp,n,8), w
+ mov w, (rp,n,8)
+ sbb cy1, cy1 C generate mask, preserve CF
+
+ mov 8(up,n,8), w
+ ADCSBB 8(vp,n,8), w
+ mov w, 8(rp,n,8)
+ sbb cy2, cy2 C generate mask, preserve CF
+
+ mov (yp1), w C (e1h:e1l) += cy1 * yp1 limb
+ and cy1, w
+ add w, e1l
+ adc $0, e1h
+
+ and (yp1,yp2), cy1 C (e2h:e2l) += cy1 * yp2 limb
+ add cy1, e2l
+ adc $0, e2h
+
+ mov -8(yp1), w C (e1h:e1l) += cy2 * next yp1 limb
+ and cy2, w
+ add w, e1l
+ adc $0, e1h
+
+ mov -8(yp1,yp2), w C (e2h:e2l) += cy2 * next yp2 limb
+ and cy2, w
+ add w, e2l
+ adc $0, e2h
+
+ add $2, n
+ lea -16(yp1), yp1
+ jnz L(top)
+L(end):
+
+ mov e1l, (ep)
+ mov e1h, 8(ep)
+ mov e2l, 16(ep)
+ mov e2h, 24(ep)
+
+ and $1, %eax C return carry
+
+ pop %r14
+ pop %r13
+ pop %r12
+ pop %rbp
+ pop %rbx
+ ret
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/aors_err3_n.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/aors_err3_n.asm
new file mode 100644
index 00000000000..bb6d0c53662
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/aors_err3_n.asm
@@ -0,0 +1,156 @@
+dnl AMD64 mpn_add_err3_n, mpn_sub_err3_n
+
+dnl Contributed by David Harvey.
+
+dnl Copyright 2011 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 AMD K8,K9 7.0
+C AMD K10 ?
+C Intel P4 ?
+C Intel core2 ?
+C Intel corei ?
+C Intel atom ?
+C VIA nano ?
+
+C INPUT PARAMETERS
+define(`rp', `%rdi')
+define(`up', `%rsi')
+define(`vp', `%rdx')
+define(`ep', `%rcx')
+define(`yp1', `%r8')
+define(`yp2', `%r9')
+define(`yp3_param', `8(%rsp)')
+define(`n_param', `16(%rsp)')
+define(`cy_param', `24(%rsp)')
+
+define(`n', `%r10')
+define(`yp3', `%rcx')
+define(`t', `%rbx')
+
+define(`e1l', `%rbp')
+define(`e1h', `%r11')
+define(`e2l', `%r12')
+define(`e2h', `%r13')
+define(`e3l', `%r14')
+define(`e3h', `%r15')
+
+
+
+ifdef(`OPERATION_add_err3_n', `
+ define(ADCSBB, adc)
+ define(func, mpn_add_err3_n)')
+ifdef(`OPERATION_sub_err3_n', `
+ define(ADCSBB, sbb)
+ define(func, mpn_sub_err3_n)')
+
+MULFUNC_PROLOGUE(mpn_add_err3_n mpn_sub_err3_n)
+
+
+ASM_START()
+ TEXT
+ ALIGN(16)
+PROLOGUE(func)
+ mov cy_param, %rax
+ mov n_param, n
+
+ push %rbx
+ push %rbp
+ push %r12
+ push %r13
+ push %r14
+ push %r15
+
+ push ep
+ mov 64(%rsp), yp3 C load from yp3_param
+
+ xor R32(e1l), R32(e1l)
+ xor R32(e1h), R32(e1h)
+ xor R32(e2l), R32(e2l)
+ xor R32(e2h), R32(e2h)
+ xor R32(e3l), R32(e3l)
+ xor R32(e3h), R32(e3h)
+
+ sub yp1, yp2
+ sub yp1, yp3
+
+ lea -8(yp1,n,8), yp1
+ lea (rp,n,8), rp
+ lea (up,n,8), up
+ lea (vp,n,8), vp
+ neg n
+
+ ALIGN(16)
+L(top):
+ shr $1, %rax C restore carry
+ mov (up,n,8), %rax
+ ADCSBB (vp,n,8), %rax
+ mov %rax, (rp,n,8)
+ sbb %rax, %rax C save carry and generate mask
+
+ mov (yp1), t
+ and %rax, t
+ add t, e1l
+ adc $0, e1h
+
+ mov (yp1,yp2), t
+ and %rax, t
+ add t, e2l
+ adc $0, e2h
+
+ mov (yp1,yp3), t
+ and %rax, t
+ add t, e3l
+ adc $0, e3h
+
+ lea -8(yp1), yp1
+ inc n
+ jnz L(top)
+
+L(end):
+ and $1, %eax
+ pop ep
+
+ mov e1l, (ep)
+ mov e1h, 8(ep)
+ mov e2l, 16(ep)
+ mov e2h, 24(ep)
+ mov e3l, 32(ep)
+ mov e3h, 40(ep)
+
+ pop %r15
+ pop %r14
+ pop %r13
+ pop %r12
+ pop %rbp
+ pop %rbx
+ ret
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/aors_n.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/aors_n.asm
new file mode 100644
index 00000000000..8941f7a17b9
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/aors_n.asm
@@ -0,0 +1,169 @@
+dnl AMD64 mpn_add_n, mpn_sub_n
+
+dnl Copyright 2003-2005, 2007, 2008, 2010-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/limb
+C AMD K8,K9 1.5
+C AMD K10 1.5
+C AMD bd1 1.8
+C AMD bobcat 2.5
+C Intel P4
+C Intel core2 4.9
+C Intel NHM 5.5
+C Intel SBR 1.61
+C Intel IBR 1.61
+C Intel atom 4
+C VIA nano 3.25
+
+C The loop of this code is the result of running a code generation and
+C optimization tool suite written by David Harvey and Torbjorn Granlund.
+
+C INPUT PARAMETERS
+define(`rp', `%rdi') C rcx
+define(`up', `%rsi') C rdx
+define(`vp', `%rdx') C r8
+define(`n', `%rcx') C r9
+define(`cy', `%r8') C rsp+40 (mpn_add_nc and mpn_sub_nc)
+
+ifdef(`OPERATION_add_n', `
+ define(ADCSBB, adc)
+ define(func, mpn_add_n)
+ define(func_nc, mpn_add_nc)')
+ifdef(`OPERATION_sub_n', `
+ define(ADCSBB, sbb)
+ define(func, mpn_sub_n)
+ define(func_nc, mpn_sub_nc)')
+
+MULFUNC_PROLOGUE(mpn_add_n mpn_add_nc mpn_sub_n mpn_sub_nc)
+
+ABI_SUPPORT(DOS64)
+ABI_SUPPORT(STD64)
+
+ASM_START()
+ TEXT
+ ALIGN(16)
+PROLOGUE(func_nc)
+ FUNC_ENTRY(4)
+IFDOS(` mov 56(%rsp), %r8 ')
+ mov R32(n), R32(%rax)
+ shr $2, n
+ and $3, R32(%rax)
+ bt $0, %r8 C cy flag <- carry parameter
+ jrcxz L(lt4)
+
+ mov (up), %r8
+ mov 8(up), %r9
+ dec n
+ jmp L(mid)
+
+EPILOGUE()
+ ALIGN(16)
+PROLOGUE(func)
+ FUNC_ENTRY(4)
+ mov R32(n), R32(%rax)
+ shr $2, n
+ and $3, R32(%rax)
+ jrcxz L(lt4)
+
+ mov (up), %r8
+ mov 8(up), %r9
+ dec n
+ jmp L(mid)
+
+L(lt4): dec R32(%rax)
+ mov (up), %r8
+ jnz L(2)
+ ADCSBB (vp), %r8
+ mov %r8, (rp)
+ adc R32(%rax), R32(%rax)
+ FUNC_EXIT()
+ ret
+
+L(2): dec R32(%rax)
+ mov 8(up), %r9
+ jnz L(3)
+ ADCSBB (vp), %r8
+ ADCSBB 8(vp), %r9
+ mov %r8, (rp)
+ mov %r9, 8(rp)
+ adc R32(%rax), R32(%rax)
+ FUNC_EXIT()
+ ret
+
+L(3): mov 16(up), %r10
+ ADCSBB (vp), %r8
+ ADCSBB 8(vp), %r9
+ ADCSBB 16(vp), %r10
+ mov %r8, (rp)
+ mov %r9, 8(rp)
+ mov %r10, 16(rp)
+ setc R8(%rax)
+ FUNC_EXIT()
+ ret
+
+ ALIGN(16)
+L(top): ADCSBB (vp), %r8
+ ADCSBB 8(vp), %r9
+ ADCSBB 16(vp), %r10
+ ADCSBB 24(vp), %r11
+ mov %r8, (rp)
+ lea 32(up), up
+ mov %r9, 8(rp)
+ mov %r10, 16(rp)
+ dec n
+ mov %r11, 24(rp)
+ lea 32(vp), vp
+ mov (up), %r8
+ mov 8(up), %r9
+ lea 32(rp), rp
+L(mid): mov 16(up), %r10
+ mov 24(up), %r11
+ jnz L(top)
+
+L(end): lea 32(up), up
+ ADCSBB (vp), %r8
+ ADCSBB 8(vp), %r9
+ ADCSBB 16(vp), %r10
+ ADCSBB 24(vp), %r11
+ lea 32(vp), vp
+ mov %r8, (rp)
+ mov %r9, 8(rp)
+ mov %r10, 16(rp)
+ mov %r11, 24(rp)
+ lea 32(rp), rp
+
+ inc R32(%rax)
+ dec R32(%rax)
+ jnz L(lt4)
+ adc R32(%rax), R32(%rax)
+ FUNC_EXIT()
+ ret
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/aorsmul_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/aorsmul_1.asm
new file mode 100644
index 00000000000..e3fc005757f
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/aorsmul_1.asm
@@ -0,0 +1,180 @@
+dnl AMD64 mpn_addmul_1 and mpn_submul_1.
+
+dnl Copyright 2003-2005, 2007, 2008, 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/limb
+C AMD K8,K9 2.5
+C AMD K10 2.5
+C AMD bd1 5.0
+C AMD bobcat 6.17
+C Intel P4 14.9
+C Intel core2 5.09
+C Intel NHM 4.9
+C Intel SBR 4.0
+C Intel atom 21.3
+C VIA nano 5.0
+
+C The loop of this code is the result of running a code generation and
+C optimization tool suite written by David Harvey and Torbjorn Granlund.
+
+C TODO
+C * The loop is great, but the prologue and epilogue code was quickly written.
+C Tune it!
+
+define(`rp', `%rdi') C rcx
+define(`up', `%rsi') C rdx
+define(`n_param', `%rdx') C r8
+define(`vl', `%rcx') C r9
+
+define(`n', `%r11')
+
+ifdef(`OPERATION_addmul_1',`
+ define(`ADDSUB', `add')
+ define(`func', `mpn_addmul_1')
+')
+ifdef(`OPERATION_submul_1',`
+ define(`ADDSUB', `sub')
+ define(`func', `mpn_submul_1')
+')
+
+ABI_SUPPORT(DOS64)
+ABI_SUPPORT(STD64)
+
+MULFUNC_PROLOGUE(mpn_addmul_1 mpn_submul_1)
+
+IFDOS(` define(`up', ``%rsi'') ') dnl
+IFDOS(` define(`rp', ``%rcx'') ') dnl
+IFDOS(` define(`vl', ``%r9'') ') dnl
+IFDOS(` define(`r9', ``rdi'') ') dnl
+IFDOS(` define(`n', ``%r8'') ') dnl
+IFDOS(` define(`r8', ``r11'') ') dnl
+
+ASM_START()
+ TEXT
+ ALIGN(16)
+PROLOGUE(func)
+
+IFDOS(``push %rsi '')
+IFDOS(``push %rdi '')
+IFDOS(``mov %rdx, %rsi '')
+
+ mov (up), %rax C read first u limb early
+ push %rbx
+IFSTD(` mov n_param, %rbx ') C move away n from rdx, mul uses it
+IFDOS(` mov n, %rbx ')
+ mul vl
+IFSTD(` mov %rbx, n ')
+
+ and $3, R32(%rbx)
+ jz L(b0)
+ cmp $2, R32(%rbx)
+ jz L(b2)
+ jg L(b3)
+
+L(b1): dec n
+ jne L(gt1)
+ ADDSUB %rax, (rp)
+ jmp L(ret)
+L(gt1): lea 8(up,n,8), up
+ lea -8(rp,n,8), rp
+ neg n
+ xor %r10, %r10
+ xor R32(%rbx), R32(%rbx)
+ mov %rax, %r9
+ mov (up,n,8), %rax
+ mov %rdx, %r8
+ jmp L(L1)
+
+L(b0): lea (up,n,8), up
+ lea -16(rp,n,8), rp
+ neg n
+ xor %r10, %r10
+ mov %rax, %r8
+ mov %rdx, %rbx
+ jmp L(L0)
+
+L(b3): lea -8(up,n,8), up
+ lea -24(rp,n,8), rp
+ neg n
+ mov %rax, %rbx
+ mov %rdx, %r10
+ jmp L(L3)
+
+L(b2): lea -16(up,n,8), up
+ lea -32(rp,n,8), rp
+ neg n
+ xor %r8, %r8
+ xor R32(%rbx), R32(%rbx)
+ mov %rax, %r10
+ mov 24(up,n,8), %rax
+ mov %rdx, %r9
+ jmp L(L2)
+
+ ALIGN(16)
+L(top): ADDSUB %r10, (rp,n,8)
+ adc %rax, %r9
+ mov (up,n,8), %rax
+ adc %rdx, %r8
+ mov $0, R32(%r10)
+L(L1): mul vl
+ ADDSUB %r9, 8(rp,n,8)
+ adc %rax, %r8
+ adc %rdx, %rbx
+L(L0): mov 8(up,n,8), %rax
+ mul vl
+ ADDSUB %r8, 16(rp,n,8)
+ adc %rax, %rbx
+ adc %rdx, %r10
+L(L3): mov 16(up,n,8), %rax
+ mul vl
+ ADDSUB %rbx, 24(rp,n,8)
+ mov $0, R32(%r8) C zero
+ mov %r8, %rbx C zero
+ adc %rax, %r10
+ mov 24(up,n,8), %rax
+ mov %r8, %r9 C zero
+ adc %rdx, %r9
+L(L2): mul vl
+ add $4, n
+ js L(top)
+
+ ADDSUB %r10, (rp,n,8)
+ adc %rax, %r9
+ adc %r8, %rdx
+ ADDSUB %r9, 8(rp,n,8)
+L(ret): adc $0, %rdx
+ mov %rdx, %rax
+
+ pop %rbx
+IFDOS(``pop %rdi '')
+IFDOS(``pop %rsi '')
+ ret
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/atom/addmul_2.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/atom/addmul_2.asm
new file mode 100644
index 00000000000..c1dcdc44aad
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/atom/addmul_2.asm
@@ -0,0 +1,186 @@
+dnl AMD64 mpn_addmul_2 optimised for Intel Atom.
+
+dnl Copyright 2008, 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/limb best
+C AMD K8,K9
+C AMD K10
+C AMD bd1
+C AMD bd2
+C AMD bobcat
+C AMD jaguar
+C Intel P4
+C Intel PNR
+C Intel NHM
+C Intel SBR
+C Intel IBR
+C Intel HWL
+C Intel BWL
+C Intel atom 18.8 this
+C VIA nano
+
+C The loop of this code is the result of running a code generation and
+C optimisation tool suite written by David Harvey and Torbjorn Granlund.
+
+define(`rp', `%rdi') C rcx
+define(`up', `%rsi') C rdx
+define(`n_param', `%rdx') C r8
+define(`vp', `%rcx') C r9
+
+define(`v0', `%r8')
+define(`v1', `%r9')
+define(`w0', `%rbx')
+define(`w1', `%rcx')
+define(`w2', `%rbp')
+define(`w3', `%r10')
+define(`n', `%r11')
+
+ABI_SUPPORT(DOS64)
+ABI_SUPPORT(STD64)
+
+ASM_START()
+ TEXT
+ ALIGN(16)
+PROLOGUE(mpn_addmul_2)
+ FUNC_ENTRY(4)
+ push %rbx
+ push %rbp
+
+ mov (up), %rax
+
+ mov (vp), v0
+ mov 8(vp), v1
+
+ mov n_param, n
+ mul v0
+
+ test $1, R8(n)
+ jnz L(bx1)
+
+L(bx0): test $2, R8(n)
+ jnz L(b10)
+
+L(b00): mov %rax, w0
+ mov (up), %rax
+ mov %rdx, w1
+ xor R32(w2), R32(w2)
+ lea -8(rp), rp
+ jmp L(lo0)
+
+L(b10): mov %rax, w2
+ mov (up), %rax
+ mov %rdx, w3
+ xor R32(w0), R32(w0)
+ lea -16(up), up
+ lea -24(rp), rp
+ jmp L(lo2)
+
+L(bx1): test $2, R8(n)
+ jnz L(b11)
+
+L(b01): mov %rax, w3
+ mov %rdx, w0
+ mov (up), %rax
+ xor R32(w1), R32(w1)
+ lea 8(up), up
+ dec n
+ jmp L(lo1)
+
+L(b11): mov %rax, w1
+ mov (up), %rax
+ mov %rdx, w2
+ xor R32(w3), R32(w3)
+ lea -8(up), up
+ lea -16(rp), rp
+ jmp L(lo3)
+
+ ALIGN(16)
+L(top):
+L(lo1): mul v1
+ add w3, (rp)
+ mov $0, R32(w2)
+ adc %rax, w0
+ mov (up), %rax
+ adc %rdx, w1
+ mul v0
+ add %rax, w0
+ mov (up), %rax
+ adc %rdx, w1
+ adc $0, R32(w2)
+L(lo0): mul v1
+ add w0, 8(rp)
+ adc %rax, w1
+ mov 8(up), %rax
+ mov $0, R32(w3)
+ adc %rdx, w2
+ mul v0
+ add %rax, w1
+ mov 8(up), %rax
+ adc %rdx, w2
+ adc $0, R32(w3)
+L(lo3): mul v1
+ add w1, 16(rp)
+ adc %rax, w2
+ mov 16(up), %rax
+ mov $0, R32(w0)
+ adc %rdx, w3
+ mul v0
+ add %rax, w2
+ mov 16(up), %rax
+ adc %rdx, w3
+ adc $0, R32(w0)
+L(lo2): mul v1
+ add w2, 24(rp)
+ adc %rax, w3
+ mov 24(up), %rax
+ adc %rdx, w0
+ mov $0, R32(w1)
+ lea 32(rp), rp
+ mul v0
+ lea 32(up), up
+ add %rax, w3
+ adc %rdx, w0
+ mov -8(up), %rax
+ adc $0, R32(w1)
+ sub $4, n
+ ja L(top)
+
+L(end): mul v1
+ add w3, (rp)
+ adc %rax, w0
+ adc %rdx, w1
+ mov w0, 8(rp)
+ mov w1, %rax
+ pop %rbp
+ pop %rbx
+ FUNC_EXIT()
+ ret
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/atom/aorrlsh1_n.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/atom/aorrlsh1_n.asm
new file mode 100644
index 00000000000..f44de19fefc
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/atom/aorrlsh1_n.asm
@@ -0,0 +1,238 @@
+dnl AMD64 mpn_addlsh1_n, mpn_rsblsh1_n optimised for Intel Atom.
+dnl Used also for AMD bd1.
+
+dnl Contributed to the GNU project by Torbjorn Granlund.
+
+dnl Copyright 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 TODO
+C * This code is slightly large at 433 bytes.
+C * sublsh1_n.asm and this file use the same basic pattern.
+
+C cycles/limb
+C AMD K8,K9 ?
+C AMD K10 ?
+C AMD bd1 2.3
+C AMD bobcat ?
+C Intel P4 ?
+C Intel core2 ?
+C Intel NHM ?
+C Intel SBR ?
+C Intel atom 4.875 (4.75 is probably possible)
+C VIA nano ?
+
+C INPUT PARAMETERS
+define(`rp', `%rdi')
+define(`up', `%rsi')
+define(`vp', `%rdx')
+define(`n', `%rcx')
+define(`cy', `%r8')
+
+ifdef(`OPERATION_addlsh1_n', `
+ define(ADDSUB, add)
+ define(ADCSBB, adc)
+ define(func_n, mpn_addlsh1_n)
+ define(func_nc, mpn_addlsh1_nc)')
+ifdef(`OPERATION_rsblsh1_n', `
+ define(ADDSUB, sub)
+ define(ADCSBB, sbb)
+ define(func_n, mpn_rsblsh1_n)
+ define(func_nc, mpn_rsblsh1_nc)')
+
+ABI_SUPPORT(DOS64)
+ABI_SUPPORT(STD64)
+
+MULFUNC_PROLOGUE(mpn_addlsh1_n mpn_addlsh1_nc mpn_rsblsh1_n mpn_rsblsh1_nc)
+
+ASM_START()
+ TEXT
+ ALIGN(16)
+PROLOGUE(func_n)
+ FUNC_ENTRY(4)
+ push %rbp
+ xor R32(%rbp), R32(%rbp)
+L(ent): mov R32(n), R32(%rax)
+ and $3, R32(%rax)
+ jz L(b0)
+ cmp $2, R32(%rax)
+ jz L(b2)
+ jg L(b3)
+
+L(b1): mov (vp), %r8
+ add %r8, %r8
+ lea 8(vp), vp
+ sbb R32(%rax), R32(%rax) C save scy
+ add R32(%rbp), R32(%rbp) C restore acy
+ ADCSBB (up), %r8
+ mov %r8, (rp)
+ sbb R32(%rbp), R32(%rbp) C save acy
+ lea 8(up), up
+ lea 8(rp), rp
+ jmp L(b0)
+
+L(b2): mov (vp), %r8
+ add %r8, %r8
+ mov 8(vp), %r9
+ adc %r9, %r9
+ lea 16(vp), vp
+ sbb R32(%rax), R32(%rax) C save scy
+ add R32(%rbp), R32(%rbp) C restore acy
+ ADCSBB (up), %r8
+ mov %r8, (rp)
+ ADCSBB 8(up), %r9
+ mov %r9, 8(rp)
+ sbb R32(%rbp), R32(%rbp) C save acy
+ lea 16(up), up
+ lea 16(rp), rp
+ jmp L(b0)
+
+L(b3): mov (vp), %r8
+ add %r8, %r8
+ mov 8(vp), %r9
+ adc %r9, %r9
+ mov 16(vp), %r10
+ adc %r10, %r10
+ lea 24(vp), vp
+ sbb R32(%rax), R32(%rax) C save scy
+ add R32(%rbp), R32(%rbp) C restore acy
+ ADCSBB (up), %r8
+ mov %r8, (rp)
+ ADCSBB 8(up), %r9
+ mov %r9, 8(rp)
+ ADCSBB 16(up), %r10
+ mov %r10, 16(rp)
+ sbb R32(%rbp), R32(%rbp) C save acy
+ lea 24(up), up
+ lea 24(rp), rp
+
+L(b0): test $4, R8(n)
+ jz L(skp)
+ add R32(%rax), R32(%rax) C restore scy
+ mov (vp), %r8
+ adc %r8, %r8
+ mov 8(vp), %r9
+ adc %r9, %r9
+ mov 16(vp), %r10
+ adc %r10, %r10
+ mov 24(vp), %r11
+ adc %r11, %r11
+ lea 32(vp), vp
+ sbb R32(%rax), R32(%rax) C save scy
+ add R32(%rbp), R32(%rbp) C restore acy
+ ADCSBB (up), %r8
+ mov %r8, (rp)
+ ADCSBB 8(up), %r9
+ mov %r9, 8(rp)
+ ADCSBB 16(up), %r10
+ mov %r10, 16(rp)
+ ADCSBB 24(up), %r11
+ mov %r11, 24(rp)
+ lea 32(up), up
+ lea 32(rp), rp
+ sbb R32(%rbp), R32(%rbp) C save acy
+
+L(skp): cmp $8, n
+ jl L(rtn)
+
+ push %r12
+ push %r13
+ push %r14
+ push %rbx
+ lea -64(rp), rp
+ jmp L(x)
+
+ ALIGN(16)
+L(top): add R32(%rax), R32(%rax) C restore scy
+ lea 64(rp), rp
+ mov (vp), %r8
+ adc %r8, %r8
+ mov 8(vp), %r9
+ adc %r9, %r9
+ mov 16(vp), %r10
+ adc %r10, %r10
+ mov 24(vp), %r11
+ adc %r11, %r11
+ mov 32(vp), %r12
+ adc %r12, %r12
+ mov 40(vp), %r13
+ adc %r13, %r13
+ mov 48(vp), %r14
+ adc %r14, %r14
+ mov 56(vp), %rbx
+ adc %rbx, %rbx
+ lea 64(vp), vp
+ sbb R32(%rax), R32(%rax) C save scy
+ add R32(%rbp), R32(%rbp) C restore acy
+ ADCSBB (up), %r8
+ mov %r8, (rp)
+ ADCSBB 8(up), %r9
+ mov %r9, 8(rp)
+ ADCSBB 16(up), %r10
+ mov %r10, 16(rp)
+ ADCSBB 24(up), %r11
+ mov %r11, 24(rp)
+ ADCSBB 32(up), %r12
+ mov %r12, 32(rp)
+ ADCSBB 40(up), %r13
+ mov %r13, 40(rp)
+ ADCSBB 48(up), %r14
+ mov %r14, 48(rp)
+ ADCSBB 56(up), %rbx
+ mov %rbx, 56(rp)
+ sbb R32(%rbp), R32(%rbp) C save acy
+ lea 64(up), up
+L(x): sub $8, n
+ jge L(top)
+
+L(end): pop %rbx
+ pop %r14
+ pop %r13
+ pop %r12
+L(rtn):
+ifdef(`OPERATION_addlsh1_n',`
+ add R32(%rbp), R32(%rax)
+ neg R32(%rax)')
+ifdef(`OPERATION_rsblsh1_n',`
+ sub R32(%rax), R32(%rbp)
+ movslq R32(%rbp), %rax')
+
+ pop %rbp
+ FUNC_EXIT()
+ ret
+EPILOGUE()
+PROLOGUE(func_nc)
+ FUNC_ENTRY(4)
+IFDOS(` mov 56(%rsp), %r8 ')
+ push %rbp
+ neg %r8 C set CF
+ sbb R32(%rbp), R32(%rbp) C save acy
+ jmp L(ent)
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/atom/aorrlsh2_n.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/atom/aorrlsh2_n.asm
new file mode 100644
index 00000000000..02fb29dd74f
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/atom/aorrlsh2_n.asm
@@ -0,0 +1,191 @@
+dnl AMD64 mpn_addlsh2_n -- rp[] = up[] + (vp[] << 2)
+dnl AMD64 mpn_rsblsh2_n -- rp[] = (vp[] << 2) - up[]
+dnl Optimised for Intel Atom.
+
+dnl Contributed to the GNU project by Torbjorn Granlund.
+
+dnl Copyright 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/limb
+C AMD K8,K9 ?
+C AMD K10 ?
+C Intel P4 ?
+C Intel core2 ?
+C Intel NHM ?
+C Intel SBR ?
+C Intel atom 5.75
+C VIA nano ?
+
+C INPUT PARAMETERS
+define(`rp', `%rdi')
+define(`up', `%rsi')
+define(`vp', `%rdx')
+define(`n', `%rcx')
+
+define(`LSH', 2)
+define(`RSH', 62)
+define(M, eval(m4_lshift(1,LSH)))
+
+ifdef(`OPERATION_addlsh2_n', `
+ define(ADDSUB, add)
+ define(ADCSBB, adc)
+ define(func_n, mpn_addlsh2_n)
+ define(func_nc, mpn_addlsh2_nc)')
+ifdef(`OPERATION_rsblsh2_n', `
+ define(ADDSUB, sub)
+ define(ADCSBB, sbb)
+ define(func_n, mpn_rsblsh2_n)
+ define(func_nc, mpn_rsblsh2_nc)')
+
+ABI_SUPPORT(DOS64)
+ABI_SUPPORT(STD64)
+
+MULFUNC_PROLOGUE(mpn_addlsh2_n mpn_rsblsh2_n)
+
+ASM_START()
+ TEXT
+ ALIGN(16)
+PROLOGUE(func_n)
+ FUNC_ENTRY(4)
+ push %rbx
+ push %rbp
+
+ mov R32(n), R32(%rax)
+ and $3, R32(%rax)
+ jz L(b0) C we rely on rax = 0 at target
+ cmp $2, R32(%rax)
+ mov $0, R32(%rax)
+ jz L(b2)
+ jg L(b3)
+
+L(b1): mov (vp), %r9
+ lea (%rax,%r9,M), %rbp
+ shr $RSH, %r9
+ sub $1, n
+ lea -8(up), up
+ lea -8(rp), rp
+ jz L(cj1)
+ mov 8(vp), %r10
+ lea (%r9,%r10,M), %r9
+ shr $RSH, %r10
+ mov 16(vp), %r11
+ lea 24(vp), vp
+ mov (vp), %r8
+ lea (%r10,%r11,M), %r10
+ shr $RSH, %r11
+ add R32(%rax), R32(%rax)
+ jmp L(L1)
+
+L(b2): lea -32(rp), rp
+ mov (vp), %r8
+ lea -32(up), up
+ lea (%rax,%r8,M), %rbx
+ shr $RSH, %r8
+ mov 8(vp), %r9
+ sub $2, n
+ jle L(end)
+ jmp L(top)
+
+L(b3): lea -24(up), up
+ mov (vp), %r11
+ lea -24(rp), rp
+ mov 8(vp), %r8
+ lea (%rax,%r11,M), %r10
+ shr $RSH, %r11
+ lea 8(vp), vp
+ lea (%r11,%r8,M), %rbx
+ add $1, n
+ jmp L(L3)
+
+L(b0): lea -16(up), up
+ mov (vp), %r10
+ lea (%rax,%r10,M), %r9
+ shr $RSH, %r10
+ mov 8(vp), %r11
+ lea -16(rp), rp
+ mov 16(vp), %r8
+ lea (%r10,%r11,M), %r10
+ shr $RSH, %r11
+ add R32(%rax), R32(%rax)
+ lea 16(vp), vp
+ jmp L(L0)
+
+ ALIGN(16)
+L(top): lea (%r8,%r9,M), %rbp
+ shr $RSH, %r9
+ lea 32(up), up
+ mov 16(vp), %r10
+ lea (%r9,%r10,M), %r9
+ shr $RSH, %r10
+ mov 24(vp), %r11
+ lea 32(rp), rp
+ lea 32(vp), vp
+ mov (vp), %r8
+ lea (%r10,%r11,M), %r10
+ shr $RSH, %r11
+ add R32(%rax), R32(%rax)
+ ADCSBB (up), %rbx
+ mov %rbx, (rp)
+L(L1): ADCSBB 8(up), %rbp
+ mov %rbp, 8(rp)
+L(L0): ADCSBB 16(up), %r9
+ lea (%r11,%r8,M), %rbx
+ mov %r9, 16(rp)
+L(L3): ADCSBB 24(up), %r10
+ sbb R32(%rax), R32(%rax)
+L(L2): shr $RSH, %r8
+ mov 8(vp), %r9
+ mov %r10, 24(rp)
+ sub $4, n
+ jg L(top)
+
+L(end): lea (%r8,%r9,M), %rbp
+ shr $RSH, %r9
+ lea 32(up), up
+ lea 32(rp), rp
+ add R32(%rax), R32(%rax)
+ ADCSBB (up), %rbx
+ mov %rbx, (rp)
+L(cj1): ADCSBB 8(up), %rbp
+ mov %rbp, 8(rp)
+
+ifdef(`OPERATION_addlsh2_n',`
+ mov R32(n), R32(%rax) C zero rax
+ adc %r9, %rax')
+ifdef(`OPERATION_rsblsh2_n',`
+ sbb n, %r9 C subtract 0
+ mov %r9, %rax')
+
+ pop %rbp
+ pop %rbx
+ FUNC_EXIT()
+ ret
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/atom/aors_n.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/atom/aors_n.asm
new file mode 100644
index 00000000000..2c0b7b31a88
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/atom/aors_n.asm
@@ -0,0 +1,37 @@
+dnl X86-64 mpn_add_n, mpn_sub_n, optimized for Intel Atom.
+
+dnl Copyright 2003-2005, 2007, 2008, 2010-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')
+
+ABI_SUPPORT(DOS64)
+ABI_SUPPORT(STD64)
+
+MULFUNC_PROLOGUE(mpn_add_n mpn_add_nc mpn_sub_n mpn_sub_nc)
+include_mpn(`x86_64/coreisbr/aors_n.asm')
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/atom/aorsmul_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/atom/aorsmul_1.asm
new file mode 100644
index 00000000000..e95315347cc
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/atom/aorsmul_1.asm
@@ -0,0 +1,190 @@
+dnl AMD64 mpn_addmul_1/mpn_submul_1 optimised for Intel Atom.
+
+dnl Copyright 2003-2005, 2007, 2008, 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/limb best
+C AMD K8,K9
+C AMD K10
+C AMD bd1
+C AMD bd2
+C AMD bobcat
+C AMD jaguar
+C Intel P4
+C Intel PNR
+C Intel NHM
+C Intel SBR
+C Intel IBR
+C Intel HWL
+C Intel BWL
+C Intel atom 19.37 this
+C VIA nano
+
+C The loop of this code is the result of running a code generation and
+C optimisation tool suite written by David Harvey and Torbjorn Granlund.
+
+define(`rp', `%rdi') C rcx
+define(`up', `%rsi') C rdx
+define(`n_param', `%rdx') C r8
+define(`v0', `%rcx') C r9
+
+define(`n', `%rbx')
+
+ifdef(`OPERATION_addmul_1',`
+ define(`ADDSUB', `add')
+ define(`func', `mpn_addmul_1')
+')
+ifdef(`OPERATION_submul_1',`
+ define(`ADDSUB', `sub')
+ define(`func', `mpn_submul_1')
+')
+
+ABI_SUPPORT(DOS64)
+ABI_SUPPORT(STD64)
+
+MULFUNC_PROLOGUE(mpn_addmul_1 mpn_submul_1)
+
+ASM_START()
+ TEXT
+ ALIGN(16)
+PROLOGUE(func)
+ FUNC_ENTRY(4)
+ push %rbx
+
+ mov (up), %rax
+ lea -8(up,n_param,8), up
+ lea -16(rp,n_param,8), rp
+
+ test $1, R8(n_param)
+ jnz L(bx1)
+
+L(bx0): test $2, R8(n_param)
+ jnz L(b10)
+
+L(b00): mov $1, R32(n)
+ sub n_param, n
+ mul v0
+ mov %rax, %r11
+ mov 8(up,n,8), %rax
+ mov %rdx, %r10
+ mul v0
+ mov %rax, %r8
+ mov 16(up,n,8), %rax
+ jmp L(lo0)
+
+L(b10): mov $3, R32(n)
+ sub n_param, n
+ mul v0
+ mov %rax, %r11
+ mov -8(up,n,8), %rax
+ mov %rdx, %r10
+ mul v0
+ test n, n
+ jns L(cj2)
+ mov %rax, %r8
+ mov (up,n,8), %rax
+ mov %rdx, %r9
+ jmp L(lo2)
+
+L(bx1): test $2, R8(n_param)
+ jnz L(b11)
+
+L(b01): mov $2, R32(n)
+ sub n_param, n
+ mul v0
+ test n, n
+ jns L(cj1)
+ mov %rax, %r8
+ mov (up,n,8), %rax
+ mov %rdx, %r9
+ mul v0
+ mov %rax, %r11
+ mov 8(up,n,8), %rax
+ mov %rdx, %r10
+ jmp L(lo1)
+
+L(b11): xor R32(n), R32(n)
+ sub n_param, n
+ mul v0
+ mov %rax, %r8
+ mov 16(up,n,8), %rax
+ mov %rdx, %r9
+ mul v0
+ mov %rax, %r11
+ mov 24(up,n,8), %rax
+ jmp L(lo3)
+
+ ALIGN(16)
+L(top): mul v0
+ ADDSUB %r8, -16(rp,n,8)
+ mov %rax, %r8
+ mov (up,n,8), %rax
+ adc %r9, %r11
+ mov %rdx, %r9
+ adc $0, %r10
+L(lo2): mul v0
+ ADDSUB %r11, -8(rp,n,8)
+ mov %rax, %r11
+ mov 8(up,n,8), %rax
+ adc %r10, %r8
+ mov %rdx, %r10
+ adc $0, %r9
+L(lo1): mul v0
+ ADDSUB %r8, (rp,n,8)
+ mov %rax, %r8
+ adc %r9, %r11
+ mov 16(up,n,8), %rax
+ adc $0, %r10
+L(lo0): mov %rdx, %r9
+ mul v0
+ ADDSUB %r11, 8(rp,n,8)
+ mov %rax, %r11
+ adc %r10, %r8
+ mov 24(up,n,8), %rax
+ adc $0, %r9
+L(lo3): add $4, n
+ mov %rdx, %r10
+ js L(top)
+
+L(end): mul v0
+ ADDSUB %r8, -16(rp,n,8)
+ adc %r9, %r11
+ adc $0, %r10
+L(cj2): ADDSUB %r11, -8(rp,n,8)
+ adc %r10, %rax
+ adc $0, %rdx
+L(cj1): ADDSUB %rax, (rp,n,8)
+ mov $0, R32(%rax)
+ adc %rdx, %rax
+ pop %rbx
+ FUNC_EXIT()
+ ret
+EPILOGUE()
+ASM_END()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/atom/com.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/atom/com.asm
new file mode 100644
index 00000000000..6b6460fffeb
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/atom/com.asm
@@ -0,0 +1,37 @@
+dnl X86-64 mpn_com optimised for Intel Atom.
+
+dnl Copyright 2012, 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')
+
+ABI_SUPPORT(DOS64)
+ABI_SUPPORT(STD64)
+
+MULFUNC_PROLOGUE(mpn_com)
+include_mpn(`x86_64/fastsse/com-palignr.asm')
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/atom/copyd.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/atom/copyd.asm
new file mode 100644
index 00000000000..e3092794c0e
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/atom/copyd.asm
@@ -0,0 +1,37 @@
+dnl X86-64 mpn_copyd optimised for Intel Atom.
+
+dnl Copyright 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')
+
+ABI_SUPPORT(DOS64)
+ABI_SUPPORT(STD64)
+
+MULFUNC_PROLOGUE(mpn_copyd)
+include_mpn(`x86_64/fastsse/copyd-palignr.asm')
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/atom/copyi.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/atom/copyi.asm
new file mode 100644
index 00000000000..00ec3c23c66
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/atom/copyi.asm
@@ -0,0 +1,37 @@
+dnl X86-64 mpn_copyi optimised for Intel Atom.
+
+dnl Copyright 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')
+
+ABI_SUPPORT(DOS64)
+ABI_SUPPORT(STD64)
+
+MULFUNC_PROLOGUE(mpn_copyi)
+include_mpn(`x86_64/fastsse/copyi-palignr.asm')
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/atom/dive_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/atom/dive_1.asm
new file mode 100644
index 00000000000..d9ba5fe6f02
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/atom/dive_1.asm
@@ -0,0 +1,37 @@
+dnl AMD64 mpn_divexact_1 -- mpn by limb exact division.
+
+dnl Copyright 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')
+
+ABI_SUPPORT(DOS64)
+ABI_SUPPORT(STD64)
+
+MULFUNC_PROLOGUE(mpn_divexact_1)
+include_mpn(`x86_64/nano/dive_1.asm')
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/atom/gmp-mparam.h b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/atom/gmp-mparam.h
new file mode 100644
index 00000000000..6816dfc3628
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/atom/gmp-mparam.h
@@ -0,0 +1,220 @@
+/* Intel Atom/64 gmp-mparam.h -- Compiler/machine parameter header file.
+
+Copyright 1991, 1993, 1994, 2000-2010, 2012, 2014 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
+
+#define SHLD_SLOW 1
+#define SHRD_SLOW 1
+
+/* 1667 MHz Pineview (Atom D510) */
+/* FFT tuning limit = 25000000 */
+/* Generated by tuneup.c, 2014-03-13, gcc 4.5 */
+
+#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 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_1_NORM_THRESHOLD 1
+#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 MUL_TOOM22_THRESHOLD 12
+#define MUL_TOOM33_THRESHOLD 74
+#define MUL_TOOM44_THRESHOLD 118
+#define MUL_TOOM6H_THRESHOLD 157
+#define MUL_TOOM8H_THRESHOLD 212
+
+#define MUL_TOOM32_TO_TOOM43_THRESHOLD 73
+#define MUL_TOOM32_TO_TOOM53_THRESHOLD 84
+#define MUL_TOOM42_TO_TOOM53_THRESHOLD 81
+#define MUL_TOOM42_TO_TOOM63_THRESHOLD 80
+#define MUL_TOOM43_TO_TOOM54_THRESHOLD 58
+
+#define SQR_BASECASE_THRESHOLD 6
+#define SQR_TOOM2_THRESHOLD 23
+#define SQR_TOOM3_THRESHOLD 49
+#define SQR_TOOM4_THRESHOLD 130
+#define SQR_TOOM6_THRESHOLD 173
+#define SQR_TOOM8_THRESHOLD 238
+
+#define MULMID_TOOM42_THRESHOLD 16
+
+#define MULMOD_BNM1_THRESHOLD 10
+#define SQRMOD_BNM1_THRESHOLD 12
+
+#define MUL_FFT_MODF_THRESHOLD 252 /* k = 5 */
+#define MUL_FFT_TABLE3 \
+ { { 252, 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}, { 11, 7}, { 23, 8}, \
+ { 13, 9}, { 7, 8}, { 15, 7}, { 31, 8}, \
+ { 19, 9}, { 11, 8}, { 25, 9}, { 15, 8}, \
+ { 33, 9}, { 19, 8}, { 39, 9}, { 23,10}, \
+ { 15, 9}, { 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,10}, { 79,11}, { 47,10}, { 95,12}, \
+ { 31,11}, { 63,10}, { 127, 9}, { 255, 8}, \
+ { 511, 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,12}, \
+ { 63,11}, { 127,10}, { 255, 9}, { 511,11}, \
+ { 143,10}, { 287, 9}, { 575, 8}, { 1151,10}, \
+ { 319, 9}, { 639,11}, { 175,10}, { 351, 9}, \
+ { 703, 8}, { 1407, 7}, { 2815,10}, { 383,11}, \
+ { 207,10}, { 415,11}, { 223,10}, { 447,13}, \
+ { 63,12}, { 127,11}, { 255,10}, { 511,11}, \
+ { 287,10}, { 575, 9}, { 1151,12}, { 159,11}, \
+ { 319,10}, { 639,11}, { 351,10}, { 703, 9}, \
+ { 1407,12}, { 191,11}, { 415,12}, { 223,11}, \
+ { 447,10}, { 895,11}, { 479,13}, { 127,12}, \
+ { 255,11}, { 511,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,12}, { 447,11}, \
+ { 895,12}, { 479,14}, { 127,13}, { 255,12}, \
+ { 511,11}, { 1023,12}, { 575,11}, { 1151,13}, \
+ { 319,12}, { 703,11}, { 1407,13}, { 383,12}, \
+ { 831,13}, { 447,12}, { 895,11}, { 1791,14}, \
+ { 255,13}, { 511,12}, { 1023,13}, { 575,12}, \
+ { 1151,13}, { 703,12}, { 1407,14}, { 383,13}, \
+ { 831,12}, { 1663,13}, { 895,12}, { 1791,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,14}, { 1407,13}, { 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 2240
+
+#define SQR_FFT_MODF_THRESHOLD 208 /* k = 5 */
+#define SQR_FFT_TABLE3 \
+ { { 208, 5}, { 11, 6}, { 6, 5}, { 13, 6}, \
+ { 13, 7}, { 7, 6}, { 15, 7}, { 13, 8}, \
+ { 7, 7}, { 17, 8}, { 9, 7}, { 19, 8}, \
+ { 11, 7}, { 23, 8}, { 13, 9}, { 7, 8}, \
+ { 19, 9}, { 11, 8}, { 23,10}, { 7, 9}, \
+ { 15, 8}, { 31, 9}, { 23,10}, { 15, 9}, \
+ { 39,10}, { 23,11}, { 15,10}, { 31, 9}, \
+ { 63, 8}, { 127,10}, { 39, 9}, { 79, 8}, \
+ { 159,10}, { 47, 8}, { 191,10}, { 55,11}, \
+ { 31,10}, { 63, 9}, { 127, 8}, { 255,10}, \
+ { 71, 9}, { 143, 8}, { 287, 7}, { 575,10}, \
+ { 79, 9}, { 159,11}, { 47, 9}, { 191,12}, \
+ { 31,11}, { 63,10}, { 127, 9}, { 255, 8}, \
+ { 511,10}, { 143, 9}, { 287, 8}, { 575,10}, \
+ { 159, 9}, { 319, 8}, { 639,10}, { 175, 9}, \
+ { 351, 8}, { 703,10}, { 191, 9}, { 383,10}, \
+ { 207,11}, { 111,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,11}, { 191,10}, { 383,11}, { 207,10}, \
+ { 415,11}, { 223,10}, { 447,13}, { 63,12}, \
+ { 127,11}, { 255,10}, { 511,11}, { 287,10}, \
+ { 575,12}, { 159,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,12}, \
+ { 287,11}, { 575,12}, { 319,11}, { 639,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,13}, { 319,12}, \
+ { 703,11}, { 1407,13}, { 383,12}, { 831,13}, \
+ { 447,12}, { 895,14}, { 255,13}, { 511,12}, \
+ { 1023,13}, { 575,12}, { 1151,13}, { 703,12}, \
+ { 1407,14}, { 383,13}, { 831,12}, { 1663,13}, \
+ { 895,15}, { 255,14}, { 511,13}, { 1087,12}, \
+ { 2175,13}, { 1151,14}, { 639,13}, { 1407,12}, \
+ { 2815,14}, { 767,13}, { 1663,14}, { 895,13}, \
+ { 1791,12}, { 3583,15}, { 511,14}, { 1023,13}, \
+ { 2047,14}, { 1151,13}, { 2431,12}, { 4863,14}, \
+ { 1407,13}, { 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 175
+#define SQR_FFT_THRESHOLD 1600
+
+#define MULLO_BASECASE_THRESHOLD 0 /* always */
+#define MULLO_DC_THRESHOLD 34
+#define MULLO_MUL_N_THRESHOLD 4392
+
+#define DC_DIV_QR_THRESHOLD 32
+#define DC_DIVAPPR_Q_THRESHOLD 122
+#define DC_BDIV_QR_THRESHOLD 35
+#define DC_BDIV_Q_THRESHOLD 76
+
+#define INV_MULMOD_BNM1_THRESHOLD 22
+#define INV_NEWTON_THRESHOLD 163
+#define INV_APPR_THRESHOLD 134
+
+#define BINV_NEWTON_THRESHOLD 179
+#define REDC_1_TO_REDC_2_THRESHOLD 17
+#define REDC_2_TO_REDC_N_THRESHOLD 43
+
+#define MU_DIV_QR_THRESHOLD 855
+#define MU_DIVAPPR_Q_THRESHOLD 872
+#define MUPI_DIV_QR_THRESHOLD 83
+#define MU_BDIV_QR_THRESHOLD 748
+#define MU_BDIV_Q_THRESHOLD 807
+
+#define POWM_SEC_TABLE 1,16,114,452,1603
+
+#define MATRIX22_STRASSEN_THRESHOLD 13
+#define HGCD_THRESHOLD 102
+#define HGCD_APPR_THRESHOLD 95
+#define HGCD_REDUCE_THRESHOLD 1329
+#define GCD_DC_THRESHOLD 268
+#define GCDEXT_DC_THRESHOLD 221
+#define JACOBI_BASE_METHOD 4
+
+#define GET_STR_DC_THRESHOLD 14
+#define GET_STR_PRECOMPUTE_THRESHOLD 26
+#define SET_STR_DC_THRESHOLD 418
+#define SET_STR_PRECOMPUTE_THRESHOLD 1420
+
+#define FAC_DSC_THRESHOLD 1065
+#define FAC_ODD_THRESHOLD 0 /* always */
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/atom/lshift.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/atom/lshift.asm
new file mode 100644
index 00000000000..1b37d5dccf9
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/atom/lshift.asm
@@ -0,0 +1,123 @@
+dnl AMD64 mpn_lshift -- mpn left shift, optimised for Atom.
+
+dnl Contributed to the GNU project by Torbjorn Granlund.
+
+dnl Copyright 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/limb
+C AMD K8,K9 ?
+C AMD K10 ?
+C Intel P4 ?
+C Intel core2 ?
+C Intel NHM ?
+C Intel SBR ?
+C Intel atom 4.5
+C VIA nano ?
+
+C TODO
+C * Consider using 4-way unrolling. We reach 4 c/l, but the code is 2.5 times
+C larger.
+
+C INPUT PARAMETERS
+define(`rp', `%rdi')
+define(`up', `%rsi')
+define(`n', `%rdx')
+define(`cnt', `%rcx')
+
+ABI_SUPPORT(DOS64)
+ABI_SUPPORT(STD64)
+
+ASM_START()
+ TEXT
+ ALIGN(16)
+PROLOGUE(mpn_lshift)
+ FUNC_ENTRY(4)
+ lea -8(up,n,8), up
+ lea -8(rp,n,8), rp
+ shr R32(n)
+ mov (up), %rax
+ jnc L(evn)
+
+ mov %rax, %r11
+ shl R8(%rcx), %r11
+ neg R8(%rcx)
+ shr R8(%rcx), %rax
+ test n, n
+ jnz L(gt1)
+ mov %r11, (rp)
+ FUNC_EXIT()
+ ret
+
+L(gt1): mov -8(up), %r8
+ mov %r8, %r10
+ shr R8(%rcx), %r8
+ jmp L(lo1)
+
+L(evn): mov %rax, %r10
+ neg R8(%rcx)
+ shr R8(%rcx), %rax
+ mov -8(up), %r9
+ mov %r9, %r11
+ shr R8(%rcx), %r9
+ neg R8(%rcx)
+ dec n
+ lea 8(rp), rp
+ lea -8(up), up
+ jz L(end)
+
+ ALIGN(8)
+L(top): shl R8(%rcx), %r10
+ or %r10, %r9
+ shl R8(%rcx), %r11
+ neg R8(%rcx)
+ mov -8(up), %r8
+ mov %r8, %r10
+ mov %r9, -8(rp)
+ shr R8(%rcx), %r8
+ lea -16(rp), rp
+L(lo1): mov -16(up), %r9
+ or %r11, %r8
+ mov %r9, %r11
+ shr R8(%rcx), %r9
+ lea -16(up), up
+ neg R8(%rcx)
+ mov %r8, (rp)
+ dec n
+ jg L(top)
+
+L(end): shl R8(%rcx), %r10
+ or %r10, %r9
+ shl R8(%rcx), %r11
+ mov %r9, -8(rp)
+ mov %r11, -16(rp)
+ FUNC_EXIT()
+ ret
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/atom/lshiftc.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/atom/lshiftc.asm
new file mode 100644
index 00000000000..7385f8fd444
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/atom/lshiftc.asm
@@ -0,0 +1,127 @@
+dnl AMD64 mpn_lshiftc -- mpn left shift with complement, optimised for Atom.
+
+dnl Contributed to the GNU project by Torbjorn Granlund.
+
+dnl Copyright 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/limb
+C AMD K8,K9 ?
+C AMD K10 ?
+C Intel P4 ?
+C Intel core2 ?
+C Intel NHM ?
+C Intel SBR ?
+C Intel atom 5
+C VIA nano ?
+
+C TODO
+C * Consider using 4-way unrolling. We reach 4.5 c/l, but the code is 2.5
+C times larger.
+
+C INPUT PARAMETERS
+define(`rp', `%rdi')
+define(`up', `%rsi')
+define(`n', `%rdx')
+define(`cnt', `%rcx')
+
+ABI_SUPPORT(DOS64)
+ABI_SUPPORT(STD64)
+
+ASM_START()
+ TEXT
+ ALIGN(16)
+PROLOGUE(mpn_lshiftc)
+ FUNC_ENTRY(4)
+ lea -8(up,n,8), up
+ lea -8(rp,n,8), rp
+ shr R32(n)
+ mov (up), %rax
+ jnc L(evn)
+
+ mov %rax, %r11
+ shl R8(%rcx), %r11
+ neg R8(%rcx)
+ shr R8(%rcx), %rax
+ test n, n
+ jnz L(gt1)
+ not %r11
+ mov %r11, (rp)
+ FUNC_EXIT()
+ ret
+
+L(gt1): mov -8(up), %r8
+ mov %r8, %r10
+ shr R8(%rcx), %r8
+ jmp L(lo1)
+
+L(evn): mov %rax, %r10
+ neg R8(%rcx)
+ shr R8(%rcx), %rax
+ mov -8(up), %r9
+ mov %r9, %r11
+ shr R8(%rcx), %r9
+ neg R8(%rcx)
+ lea 8(rp), rp
+ lea -8(up), up
+ jmp L(lo0)
+
+C ALIGN(16)
+L(top): shl R8(%rcx), %r10
+ or %r10, %r9
+ shl R8(%rcx), %r11
+ not %r9
+ neg R8(%rcx)
+ mov -8(up), %r8
+ lea -16(rp), rp
+ mov %r8, %r10
+ shr R8(%rcx), %r8
+ mov %r9, 8(rp)
+L(lo1): or %r11, %r8
+ mov -16(up), %r9
+ mov %r9, %r11
+ shr R8(%rcx), %r9
+ lea -16(up), up
+ neg R8(%rcx)
+ not %r8
+ mov %r8, (rp)
+L(lo0): dec n
+ jg L(top)
+
+L(end): shl R8(%rcx), %r10
+ or %r10, %r9
+ not %r9
+ shl R8(%rcx), %r11
+ not %r11
+ mov %r9, -8(rp)
+ mov %r11, -16(rp)
+ FUNC_EXIT()
+ ret
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/atom/mul_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/atom/mul_1.asm
new file mode 100644
index 00000000000..d76a3d3b8c9
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/atom/mul_1.asm
@@ -0,0 +1,143 @@
+dnl AMD64 mpn_mul_1 optimised for Intel Atom.
+
+dnl Copyright 2003-2005, 2007, 2008, 2012, 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/limb best
+C AMD K8,K9
+C AMD K10
+C AMD bd1
+C AMD bd2
+C AMD bobcat
+C AMD jaguar
+C Intel P4
+C Intel PNR
+C Intel NHM
+C Intel SBR
+C Intel IBR
+C Intel HWL
+C Intel BWL
+C Intel atom 17.3 this
+C VIA nano
+
+C The loop of this code is the result of running a code generation and
+C optimisation tool suite written by David Harvey and Torbjorn Granlund.
+
+define(`rp', `%rdi') C rcx
+define(`up', `%rsi') C rdx
+define(`n_param', `%rdx') C r8
+define(`v0', `%rcx') C r9
+
+define(`n', `%r11')
+
+ABI_SUPPORT(DOS64)
+ABI_SUPPORT(STD64)
+
+ASM_START()
+ TEXT
+ ALIGN(16)
+PROLOGUE(mpn_mul_1)
+ FUNC_ENTRY(4)
+ xor %r8, %r8
+L(com): mov (up), %rax
+ lea -16(up,n_param,8), up
+ lea -8(rp,n_param,8), rp
+ test $1, R8(n_param)
+ jnz L(bx1)
+
+L(bx0): mov %r8, %r9
+ test $2, R8(n_param)
+ jnz L(b10)
+
+L(b00): mov $2, R32(n)
+ sub n_param, n
+ jmp L(lo0)
+
+L(bx1): test $2, R8(n_param)
+ jnz L(b11)
+
+L(b01): mov $3, R32(n)
+ sub n_param, n
+ mul v0
+ cmp $2, n
+ jnz L(lo1)
+ jmp L(cj1)
+
+L(b11): mov $1, R32(n)
+ sub n_param, n
+ jmp L(lo3)
+
+L(b10): xor R32(n), R32(n)
+ sub n_param, n
+ jmp L(lo2)
+
+L(top): mul v0
+ mov %r9, -24(rp,n,8)
+L(lo1): xor %r9d, %r9d
+ add %rax, %r8
+ mov (up,n,8), %rax
+ adc %rdx, %r9
+ mov %r8, -16(rp,n,8)
+L(lo0): xor %r8d, %r8d
+ mul v0
+ add %rax, %r9
+ mov 8(up,n,8), %rax
+ adc %rdx, %r8
+ mov %r9, -8(rp,n,8)
+L(lo3): xor %r9d, %r9d
+ mul v0
+ add %rax, %r8
+ mov 16(up,n,8), %rax
+ adc %rdx, %r9
+ mov %r8, (rp,n,8)
+L(lo2): xor %r8d, %r8d
+ mul v0
+ add %rax, %r9
+ mov 24(up,n,8), %rax
+ adc %rdx, %r8
+ add $4, n
+ js L(top)
+
+L(end): mul v0
+ mov %r9, -8(rp)
+L(cj1): add %rax, %r8
+ mov $0, R32(%rax)
+ adc %rdx, %rax
+ mov %r8, (rp)
+ FUNC_EXIT()
+ ret
+EPILOGUE()
+
+PROLOGUE(mpn_mul_1c)
+ FUNC_ENTRY(4)
+IFDOS(` mov 56(%rsp), %r8 ')
+ jmp L(com)
+EPILOGUE()
+ASM_END()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/atom/mul_2.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/atom/mul_2.asm
new file mode 100644
index 00000000000..f3fc3afdd1b
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/atom/mul_2.asm
@@ -0,0 +1,186 @@
+dnl AMD64 mpn_mul_2 optimised for Intel Atom.
+
+dnl Copyright 2008, 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/limb best
+C AMD K8,K9
+C AMD K10
+C AMD bd1
+C AMD bd2
+C AMD bobcat
+C AMD jaguar
+C Intel P4
+C Intel PNR
+C Intel NHM
+C Intel SBR
+C Intel IBR
+C Intel HWL
+C Intel BWL
+C Intel atom 17.75 this
+C VIA nano
+
+C The loop of this code is the result of running a code generation and
+C optimisation tool suite written by David Harvey and Torbjorn Granlund.
+
+define(`rp', `%rdi') C rcx
+define(`up', `%rsi') C rdx
+define(`n_param', `%rdx') C r8
+define(`vp', `%rcx') C r9
+
+define(`v0', `%r8')
+define(`v1', `%r9')
+define(`w0', `%rbx')
+define(`w1', `%rcx')
+define(`w2', `%rbp')
+define(`w3', `%r10')
+define(`n', `%r11')
+
+ABI_SUPPORT(DOS64)
+ABI_SUPPORT(STD64)
+
+ASM_START()
+ TEXT
+ ALIGN(16)
+PROLOGUE(mpn_mul_2)
+ FUNC_ENTRY(4)
+ push %rbx
+ push %rbp
+
+ mov (up), %rax
+
+ mov (vp), v0
+ mov 8(vp), v1
+
+ mov n_param, n
+ mul v0
+
+ test $1, R8(n)
+ jnz L(bx1)
+
+L(bx0): test $2, R8(n)
+ jnz L(b10)
+
+L(b00): mov %rax, w0
+ mov (up), %rax
+ mov %rdx, w1
+ xor R32(w2), R32(w2)
+ lea -8(rp), rp
+ jmp L(lo0)
+
+L(b10): mov %rax, w2
+ mov (up), %rax
+ mov %rdx, w3
+ xor R32(w0), R32(w0)
+ lea -16(up), up
+ lea -24(rp), rp
+ jmp L(lo2)
+
+L(bx1): test $2, R8(n)
+ jnz L(b11)
+
+L(b01): mov %rax, w3
+ mov %rdx, w0
+ mov (up), %rax
+ xor R32(w1), R32(w1)
+ lea 8(up), up
+ dec n
+ jmp L(lo1)
+
+L(b11): mov %rax, w1
+ mov (up), %rax
+ mov %rdx, w2
+ xor R32(w3), R32(w3)
+ lea -8(up), up
+ lea -16(rp), rp
+ jmp L(lo3)
+
+ ALIGN(16)
+L(top):
+L(lo1): mul v1
+ add %rax, w0
+ mov (up), %rax
+ mov $0, R32(w2)
+ mov w3, (rp)
+ adc %rdx, w1
+ mul v0
+ add %rax, w0
+ mov (up), %rax
+ adc %rdx, w1
+ adc $0, R32(w2)
+L(lo0): mul v1
+ add %rax, w1
+ mov 8(up), %rax
+ mov w0, 8(rp)
+ adc %rdx, w2
+ mul v0
+ add %rax, w1
+ mov 8(up), %rax
+ adc %rdx, w2
+ mov $0, R32(w3)
+ adc $0, R32(w3)
+L(lo3): mul v1
+ add %rax, w2
+ mov 16(up), %rax
+ mov w1, 16(rp)
+ mov $0, R32(w0)
+ adc %rdx, w3
+ mul v0
+ add %rax, w2
+ mov 16(up), %rax
+ adc %rdx, w3
+L(lo2): mov $0, R32(w1)
+ mov w2, 24(rp)
+ adc $0, R32(w0)
+ mul v1
+ add %rax, w3
+ mov 24(up), %rax
+ lea 32(up), up
+ adc %rdx, w0
+ mul v0
+ lea 32(rp), rp
+ add %rax, w3
+ adc %rdx, w0
+ mov -8(up), %rax
+ adc $0, R32(w1)
+ sub $4, n
+ ja L(top)
+
+L(end): mul v1
+ mov w3, (rp)
+ add %rax, w0
+ adc %rdx, w1
+ mov w0, 8(rp)
+ mov w1, %rax
+ pop %rbp
+ pop %rbx
+ FUNC_EXIT()
+ ret
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/atom/popcount.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/atom/popcount.asm
new file mode 100644
index 00000000000..fb14dd3d318
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/atom/popcount.asm
@@ -0,0 +1,35 @@
+dnl x86-64 mpn_popcount.
+
+dnl Copyright 2007, 2011 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_popcount)
+include_mpn(`x86/pentium4/sse2/popcount.asm')
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/atom/redc_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/atom/redc_1.asm
new file mode 100644
index 00000000000..d93c19fdc05
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/atom/redc_1.asm
@@ -0,0 +1,574 @@
+dnl X86-64 mpn_redc_1 optimised for Intel Atom.
+
+dnl Contributed to the GNU project by Torbjörn Granlund.
+
+dnl Copyright 2003-2005, 2007, 2008, 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/limb
+C AMD K8,K9 ?
+C AMD K10 ?
+C AMD bull ?
+C AMD pile ?
+C AMD steam ?
+C AMD bobcat 5.0
+C AMD jaguar ?
+C Intel P4 ?
+C Intel core ?
+C Intel NHM ?
+C Intel SBR ?
+C Intel IBR ?
+C Intel HWL ?
+C Intel BWL ?
+C Intel atom ?
+C VIA nano ?
+
+C TODO
+C * Micro-optimise, none performed thus far.
+C * Consider inlining mpn_add_n.
+C * Single basecases out before the pushes.
+C * Make lead-in code for the inner loops be more similar.
+
+C When playing with pointers, set this to $2 to fall back to conservative
+C indexing in wind-down code.
+define(`I',`$1')
+
+define(`rp', `%rdi') C rcx
+define(`up', `%rsi') C rdx
+define(`mp_param', `%rdx') C r8
+define(`n', `%rcx') C r9
+define(`u0inv', `%r8') C stack
+
+define(`i', `%r14')
+define(`j', `%r15')
+define(`mp', `%r12')
+define(`q0', `%r13')
+define(`w0', `%rbp')
+define(`w1', `%r9')
+define(`w2', `%r10')
+define(`w3', `%r11')
+
+C rax rbx rcx rdx rdi rsi rbp r8 r9 r10 r11 r12 r13 r14 r15
+
+ABI_SUPPORT(DOS64)
+ABI_SUPPORT(STD64)
+
+define(`ALIGNx', `ALIGN(16)')
+
+ASM_START()
+ TEXT
+ ALIGN(32)
+PROLOGUE(mpn_redc_1)
+ FUNC_ENTRY(4)
+IFDOS(` mov 56(%rsp), %r8 ')
+ push %rbx
+ push %rbp
+ push %r12
+ push %r13
+ push %r14
+ push %r15
+
+ mov (up), q0
+ mov n, j C outer loop induction var
+ lea (mp_param,n,8), mp
+ lea (up,n,8), up
+ neg n
+ imul u0inv, q0 C first iteration q0
+
+ test $1, R8(n)
+ jz L(bx0)
+
+L(bx1): test $2, R8(n)
+ jz L(b3)
+
+L(b1): cmp $-1, R32(n)
+ jz L(n1)
+
+L(otp1):lea 1(n), i
+ mov (mp,n,8), %rax
+ mul q0
+ mov %rax, %rbp
+ mov 8(mp,n,8), %rax
+ mov %rdx, %r9
+ mul q0
+ mov %rax, %rbx
+ mov 16(mp,n,8), %rax
+ mov %rdx, %r10
+ mul q0
+ add (up,n,8), %rbp
+ mov %rax, %rbp
+ adc %r9, %rbx
+ mov 24(mp,n,8), %rax
+ adc $0, %r10
+ mov %rdx, %r9
+ mul q0
+ add 8(up,n,8), %rbx
+ mov %rbx, 8(up,n,8)
+ mov %rax, %r11
+ adc %r10, %rbp
+ mov 32(mp,n,8), %rax
+ adc $0, %r9
+ imul u0inv, %rbx C next q limb
+ jmp L(e1)
+
+ ALIGNx
+L(tp1): mul q0
+ add %rbp, -24(up,i,8)
+ mov %rax, %rbp
+ mov (mp,i,8), %rax
+ adc %r9, %r11
+ mov %rdx, %r9
+ adc $0, %r10
+ mul q0
+ add %r11, -16(up,i,8)
+ mov %rax, %r11
+ mov 8(mp,i,8), %rax
+ adc %r10, %rbp
+ mov %rdx, %r10
+ adc $0, %r9
+ mul q0
+ add %rbp, -8(up,i,8)
+ mov %rax, %rbp
+ adc %r9, %r11
+ mov 16(mp,i,8), %rax
+ adc $0, %r10
+ mov %rdx, %r9
+ mul q0
+ add %r11, (up,i,8)
+ mov %rax, %r11
+ adc %r10, %rbp
+ mov 24(mp,i,8), %rax
+ adc $0, %r9
+L(e1): add $4, i
+ mov %rdx, %r10
+ js L(tp1)
+
+L(ed1): mul q0
+ add %rbp, I(-24(up),-24(up,i,8))
+ adc %r9, %r11
+ adc $0, %r10
+ add %r11, I(-16(up),-16(up,i,8))
+ adc %r10, %rax
+ adc $0, %rdx
+ add %rax, I(-8(up),-8(up,i,8))
+ adc $0, %rdx
+ mov %rdx, (up,n,8) C up[0]
+ mov %rbx, q0 C previously computed q limb -> q0
+ lea 8(up), up C up++
+ dec j
+ jnz L(otp1)
+ jmp L(cj)
+
+L(b3): cmp $-3, R32(n)
+ jz L(n3)
+
+L(otp3):lea 3(n), i
+ mov (mp,n,8), %rax
+ mul q0
+ mov %rax, %rbp
+ mov 8(mp,n,8), %rax
+ mov %rdx, %r9
+ mul q0
+ mov %rax, %rbx
+ mov 16(mp,n,8), %rax
+ mov %rdx, %r10
+ mul q0
+ add (up,n,8), %rbp
+ mov %rax, %rbp
+ mov 24(mp,n,8), %rax
+ adc %r9, %rbx
+ mov %rdx, %r9
+ adc $0, %r10
+ mul q0
+ add 8(up,n,8), %rbx
+ mov %rbx, 8(up,n,8)
+ mov %rax, %r11
+ mov 32(mp,n,8), %rax
+ adc %r10, %rbp
+ mov %rdx, %r10
+ adc $0, %r9
+ imul u0inv, %rbx C next q limb
+ jmp L(e3)
+
+ ALIGNx
+L(tp3): mul q0
+ add %rbp, -24(up,i,8)
+ mov %rax, %rbp
+ mov (mp,i,8), %rax
+ adc %r9, %r11
+ mov %rdx, %r9
+ adc $0, %r10
+ mul q0
+ add %r11, -16(up,i,8)
+ mov %rax, %r11
+ mov 8(mp,i,8), %rax
+ adc %r10, %rbp
+ mov %rdx, %r10
+ adc $0, %r9
+L(e3): mul q0
+ add %rbp, -8(up,i,8)
+ mov %rax, %rbp
+ adc %r9, %r11
+ mov 16(mp,i,8), %rax
+ adc $0, %r10
+ mov %rdx, %r9
+ mul q0
+ add %r11, (up,i,8)
+ mov %rax, %r11
+ adc %r10, %rbp
+ mov 24(mp,i,8), %rax
+ adc $0, %r9
+ add $4, i
+ mov %rdx, %r10
+ js L(tp3)
+
+L(ed3): mul q0
+ add %rbp, I(-24(up),-24(up,i,8))
+ adc %r9, %r11
+ adc $0, %r10
+ add %r11, I(-16(up),-16(up,i,8))
+ adc %r10, %rax
+ adc $0, %rdx
+ add %rax, I(-8(up),-8(up,i,8))
+ adc $0, %rdx
+ mov %rdx, (up,n,8) C up[0]
+ mov %rbx, q0 C previously computed q limb -> q0
+ lea 8(up), up C up++
+ dec j
+ jnz L(otp3)
+C jmp L(cj)
+
+L(cj):
+IFSTD(` lea (up,n,8), up C param 2: up
+ lea (up,n,8), %rdx C param 3: up - n
+ neg R32(n) ') C param 4: n
+
+IFDOS(` lea (up,n,8), %rdx C param 2: up
+ lea (%rdx,n,8), %r8 C param 3: up - n
+ neg R32(n)
+ mov n, %r9 C param 4: n
+ mov rp, %rcx ') C param 1: rp
+
+ CALL( mpn_add_n)
+
+L(ret): pop %r15
+ pop %r14
+ pop %r13
+ pop %r12
+ pop %rbp
+ pop %rbx
+ FUNC_EXIT()
+ ret
+
+L(bx0): test $2, R8(n)
+ jnz L(b2)
+
+L(b0): cmp $-4, R32(n)
+ jz L(n4)
+
+L(otp0):lea 4(n), i
+ mov (mp,n,8), %rax
+ mul q0
+ mov %rax, %r11
+ mov 8(mp,n,8), %rax
+ mov %rdx, %r10
+ mul q0
+ mov %rax, %rbx
+ mov 16(mp,n,8), %rax
+ mov %rdx, %r9
+ mul q0
+ add (up,n,8), %r11
+ mov %rax, %r11
+ adc %r10, %rbx
+ mov 24(mp,n,8), %rax
+ adc $0, %r9
+ mov %rdx, %r10
+ mul q0
+ add 8(up,n,8), %rbx
+ mov %rbx, 8(up,n,8)
+ mov %rax, %rbp
+ mov 32(mp,n,8), %rax
+ adc %r9, %r11
+ mov %rdx, %r9
+ adc $0, %r10
+ imul u0inv, %rbx C next q limb
+ jmp L(e0)
+
+ ALIGNx
+L(tp0): mul q0
+ add %rbp, -24(up,i,8)
+ mov %rax, %rbp
+ mov (mp,i,8), %rax
+ adc %r9, %r11
+ mov %rdx, %r9
+ adc $0, %r10
+L(e0): mul q0
+ add %r11, -16(up,i,8)
+ mov %rax, %r11
+ mov 8(mp,i,8), %rax
+ adc %r10, %rbp
+ mov %rdx, %r10
+ adc $0, %r9
+ mul q0
+ add %rbp, -8(up,i,8)
+ mov %rax, %rbp
+ adc %r9, %r11
+ mov 16(mp,i,8), %rax
+ adc $0, %r10
+ mov %rdx, %r9
+ mul q0
+ add %r11, (up,i,8)
+ mov %rax, %r11
+ adc %r10, %rbp
+ mov 24(mp,i,8), %rax
+ adc $0, %r9
+ add $4, i
+ mov %rdx, %r10
+ js L(tp0)
+
+L(ed0): mul q0
+ add %rbp, I(-24(up),-24(up,i,8))
+ adc %r9, %r11
+ adc $0, %r10
+ add %r11, I(-16(up),-16(up,i,8))
+ adc %r10, %rax
+ adc $0, %rdx
+ add %rax, I(-8(up),-8(up,i,8))
+ adc $0, %rdx
+ mov %rdx, (up,n,8) C up[0]
+ mov %rbx, q0 C previously computed q limb -> q0
+ lea 8(up), up C up++
+ dec j
+ jnz L(otp0)
+ jmp L(cj)
+
+L(b2): cmp $-2, R32(n)
+ jz L(n2)
+
+L(otp2):lea 2(n), i
+ mov (mp,n,8), %rax
+ mul q0
+ mov %rax, %r11
+ mov 8(mp,n,8), %rax
+ mov %rdx, %r10
+ mul q0
+ mov %rax, %rbx
+ mov 16(mp,n,8), %rax
+ mov %rdx, %r9
+ mul q0
+ add (up,n,8), %r11
+ mov %rax, %r11
+ adc %r10, %rbx
+ mov 24(mp,n,8), %rax
+ adc $0, %r9
+ mov %rdx, %r10
+ mul q0
+ add 8(up,n,8), %rbx
+ mov %rbx, 8(up,n,8)
+ mov %rax, %rbp
+ mov 32(mp,n,8), %rax
+ adc %r9, %r11
+ mov %rdx, %r9
+ adc $0, %r10
+ imul u0inv, %rbx C next q limb
+ jmp L(e2)
+
+ ALIGNx
+L(tp2): mul q0
+ add %rbp, -24(up,i,8)
+ mov %rax, %rbp
+ mov (mp,i,8), %rax
+ adc %r9, %r11
+ mov %rdx, %r9
+ adc $0, %r10
+ mul q0
+ add %r11, -16(up,i,8)
+ mov %rax, %r11
+ mov 8(mp,i,8), %rax
+ adc %r10, %rbp
+ mov %rdx, %r10
+ adc $0, %r9
+ mul q0
+ add %rbp, -8(up,i,8)
+ mov %rax, %rbp
+ adc %r9, %r11
+ mov 16(mp,i,8), %rax
+ adc $0, %r10
+ mov %rdx, %r9
+L(e2): mul q0
+ add %r11, (up,i,8)
+ mov %rax, %r11
+ adc %r10, %rbp
+ mov 24(mp,i,8), %rax
+ adc $0, %r9
+ add $4, i
+ mov %rdx, %r10
+ js L(tp2)
+
+L(ed2): mul q0
+ add %rbp, I(-24(up),-24(up,i,8))
+ adc %r9, %r11
+ adc $0, %r10
+ add %r11, I(-16(up),-16(up,i,8))
+ adc %r10, %rax
+ adc $0, %rdx
+ add %rax, I(-8(up),-8(up,i,8))
+ adc $0, %rdx
+ mov %rdx, (up,n,8) C up[0]
+ mov %rbx, q0 C previously computed q limb -> q0
+ lea 8(up), up C up++
+ dec j
+ jnz L(otp2)
+ jmp L(cj)
+
+L(n1): mov (mp_param), %rax
+ mul q0
+ add -8(up), %rax
+ adc (up), %rdx
+ mov %rdx, (rp)
+ mov $0, R32(%rax)
+ adc R32(%rax), R32(%rax)
+ jmp L(ret)
+
+L(n2): mov (mp_param), %rax
+ mov -16(up), %rbp
+ mul q0
+ add %rax, %rbp
+ mov %rdx, %r9
+ adc $0, %r9
+ mov -8(mp), %rax
+ mov -8(up), %r10
+ mul q0
+ add %rax, %r10
+ mov %rdx, %r11
+ adc $0, %r11
+ add %r9, %r10
+ adc $0, %r11
+ mov %r10, q0
+ imul u0inv, q0 C next q0
+ mov -16(mp), %rax
+ mul q0
+ add %rax, %r10
+ mov %rdx, %r9
+ adc $0, %r9
+ mov -8(mp), %rax
+ mov (up), %r14
+ mul q0
+ add %rax, %r14
+ adc $0, %rdx
+ add %r9, %r14
+ adc $0, %rdx
+ xor R32(%rax), R32(%rax)
+ add %r11, %r14
+ adc 8(up), %rdx
+ mov %r14, (rp)
+ mov %rdx, 8(rp)
+ adc R32(%rax), R32(%rax)
+ jmp L(ret)
+
+ ALIGNx
+L(n3): mov -24(mp), %rax
+ mov -24(up), %r10
+ mul q0
+ add %rax, %r10
+ mov -16(mp), %rax
+ mov %rdx, %r11
+ adc $0, %r11
+ mov -16(up), %rbp
+ mul q0
+ add %rax, %rbp
+ mov %rdx, %r9
+ adc $0, %r9
+ mov -8(mp), %rax
+ add %r11, %rbp
+ mov -8(up), %r10
+ adc $0, %r9
+ mul q0
+ mov %rbp, q0
+ imul u0inv, q0 C next q0
+ add %rax, %r10
+ mov %rdx, %r11
+ adc $0, %r11
+ mov %rbp, -16(up)
+ add %r9, %r10
+ adc $0, %r11
+ mov %r10, -8(up)
+ mov %r11, -24(up) C up[0]
+ lea 8(up), up C up++
+ dec j
+ jnz L(n3)
+
+ mov -48(up), %rdx
+ mov -40(up), %rbx
+ xor R32(%rax), R32(%rax)
+ add %rbp, %rdx
+ adc %r10, %rbx
+ adc -8(up), %r11
+ mov %rdx, (rp)
+ mov %rbx, 8(rp)
+ mov %r11, 16(rp)
+ adc R32(%rax), R32(%rax)
+ jmp L(ret)
+
+L(n4): mov -32(mp), %rax
+ mul q0
+ mov %rax, %r11
+ mov -24(mp), %rax
+ mov %rdx, %r10
+ mul q0
+ mov %rax, %rbx
+ mov -16(mp), %rax
+ mov %rdx, %r9
+ mul q0
+ add -32(up), %r11
+ mov %rax, %r11
+ adc %r10, %rbx
+ mov -8(mp), %rax
+ adc $0, %r9
+ mov %rdx, %r10
+ mul q0
+ add -24(up), %rbx
+ mov %rbx, -24(up)
+ adc %r9, %r11
+ adc $0, %r10
+ imul u0inv, %rbx C next q limb
+ add %r11, -16(up)
+ adc %r10, %rax
+ adc $0, %rdx
+ add %rax, -8(up)
+ adc $0, %rdx
+ mov %rdx, -32(up) C up[0]
+ mov %rbx, q0 C previously computed q limb -> q0
+ dec j
+ lea 8(up), up C up++
+ jnz L(n4)
+ jmp L(cj)
+EPILOGUE()
+ASM_END()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/atom/rsh1aors_n.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/atom/rsh1aors_n.asm
new file mode 100644
index 00000000000..6f5f6384a7d
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/atom/rsh1aors_n.asm
@@ -0,0 +1,287 @@
+dnl x86-64 mpn_rsh1add_n/mpn_rsh1sub_n.
+
+dnl Contributed to the GNU project by Torbjorn Granlund.
+
+dnl Copyright 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 TODO
+C * Schedule loop less. It is now almost surely overscheduled, resulting in
+C large feed-in and wind-down code.
+
+C cycles/limb
+C AMD K8,K9 ?
+C AMD K10 ?
+C Intel P4 ?
+C Intel core2 ?
+C Intel NMH ?
+C Intel SBR ?
+C Intel atom 5.25
+C VIA nano ?
+
+C INPUT PARAMETERS
+define(`rp',`%rdi')
+define(`up',`%rsi')
+define(`vp',`%rdx')
+define(`n',`%rcx')
+
+ifdef(`OPERATION_rsh1add_n', `
+ define(ADDSUB, add)
+ define(ADCSBB, adc)
+ define(func_n, mpn_rsh1add_n)
+ define(func_nc, mpn_rsh1add_nc)')
+ifdef(`OPERATION_rsh1sub_n', `
+ define(ADDSUB, sub)
+ define(ADCSBB, sbb)
+ define(func_n, mpn_rsh1sub_n)
+ define(func_nc, mpn_rsh1sub_nc)')
+
+ABI_SUPPORT(DOS64)
+ABI_SUPPORT(STD64)
+
+MULFUNC_PROLOGUE(mpn_rsh1add_n mpn_rsh1sub_n)
+
+ASM_START()
+ TEXT
+ ALIGN(16)
+PROLOGUE(func_n)
+ FUNC_ENTRY(4)
+ push %rbx
+ push %rbp
+ push %r12
+ push %r13
+ push %r14
+ push %r15
+
+ mov (up), %r15
+ ADDSUB (vp), %r15
+ sbb R32(%rbx), R32(%rbx)
+ xor R32(%rax), R32(%rax)
+ shr %r15
+ adc R32(%rax), R32(%rax) C return value
+
+ mov R32(n), R32(%rbp)
+ and $3, R32(%rbp)
+ jz L(b0)
+ cmp $2, R32(%rbp)
+ jae L(b23)
+
+L(b1): dec n
+ jnz L(gt1)
+ shl $63, %rbx
+ add %rbx, %r15
+ mov %r15, (rp)
+ jmp L(cj1)
+L(gt1): lea 24(up), up
+ lea 24(vp), vp
+ mov -16(up), %r9
+ add R32(%rbx), R32(%rbx)
+ mov -8(up), %r10
+ lea 24(rp), rp
+ mov (up), %r11
+ ADCSBB -16(vp), %r9
+ ADCSBB -8(vp), %r10
+ mov %r15, %r12
+ ADCSBB (vp), %r11
+ mov %r9, %r13
+ sbb R32(%rbx), R32(%rbx)
+ mov %r11, %r15
+ mov %r10, %r14
+ shl $63, %r11
+ shl $63, %r10
+ shl $63, %r9
+ or %r9, %r12
+ shr %r13
+ mov 8(up), %r8
+ shr %r14
+ or %r10, %r13
+ shr %r15
+ or %r11, %r14
+ sub $4, n
+ jz L(cj5)
+L(gt5): mov 16(up), %r9
+ add R32(%rbx), R32(%rbx)
+ mov 24(up), %r10
+ ADCSBB 8(vp), %r8
+ mov %r15, %rbp
+ mov 32(up), %r11
+ jmp L(lo1)
+
+L(b23): jnz L(b3)
+ mov 8(up), %r8
+ sub $2, n
+ jnz L(gt2)
+ add R32(%rbx), R32(%rbx)
+ ADCSBB 8(vp), %r8
+ mov %r8, %r12
+ jmp L(cj2)
+L(gt2): mov 16(up), %r9
+ add R32(%rbx), R32(%rbx)
+ mov 24(up), %r10
+ ADCSBB 8(vp), %r8
+ mov %r15, %rbp
+ mov 32(up), %r11
+ ADCSBB 16(vp), %r9
+ lea 32(up), up
+ ADCSBB 24(vp), %r10
+ mov %r9, %r13
+ ADCSBB 32(vp), %r11
+ mov %r8, %r12
+ jmp L(lo2)
+
+L(b3): lea 40(up), up
+ lea 8(vp), vp
+ mov %r15, %r14
+ add R32(%rbx), R32(%rbx)
+ mov -32(up), %r11
+ ADCSBB 0(vp), %r11
+ lea 8(rp), rp
+ sbb R32(%rbx), R32(%rbx)
+ mov %r11, %r15
+ shl $63, %r11
+ mov -24(up), %r8
+ shr %r15
+ or %r11, %r14
+ sub $3, n
+ jnz L(gt3)
+ add R32(%rbx), R32(%rbx)
+ ADCSBB 8(vp), %r8
+ jmp L(cj3)
+L(gt3): mov -16(up), %r9
+ add R32(%rbx), R32(%rbx)
+ mov -8(up), %r10
+ ADCSBB 8(vp), %r8
+ mov %r15, %rbp
+ mov (up), %r11
+ ADCSBB 16(vp), %r9
+ ADCSBB 24(vp), %r10
+ mov %r8, %r12
+ jmp L(lo3)
+
+L(b0): lea 48(up), up
+ lea 16(vp), vp
+ add R32(%rbx), R32(%rbx)
+ mov -40(up), %r10
+ lea 16(rp), rp
+ mov -32(up), %r11
+ ADCSBB -8(vp), %r10
+ mov %r15, %r13
+ ADCSBB (vp), %r11
+ sbb R32(%rbx), R32(%rbx)
+ mov %r11, %r15
+ mov %r10, %r14
+ shl $63, %r11
+ shl $63, %r10
+ mov -24(up), %r8
+ shr %r14
+ or %r10, %r13
+ shr %r15
+ or %r11, %r14
+ sub $4, n
+ jnz L(gt4)
+ add R32(%rbx), R32(%rbx)
+ ADCSBB 8(vp), %r8
+ jmp L(cj4)
+L(gt4): mov -16(up), %r9
+ add R32(%rbx), R32(%rbx)
+ mov -8(up), %r10
+ ADCSBB 8(vp), %r8
+ mov %r15, %rbp
+ mov (up), %r11
+ ADCSBB 16(vp), %r9
+ jmp L(lo0)
+
+ ALIGN(8)
+L(top): mov 16(up), %r9
+ shr %r14
+ or %r10, %r13
+ shr %r15
+ or %r11, %r14
+ add R32(%rbx), R32(%rbx)
+ mov 24(up), %r10
+ mov %rbp, (rp)
+ ADCSBB 8(vp), %r8
+ mov %r15, %rbp
+ lea 32(rp), rp
+ mov 32(up), %r11
+L(lo1): ADCSBB 16(vp), %r9
+ lea 32(up), up
+ mov %r12, -24(rp)
+L(lo0): ADCSBB 24(vp), %r10
+ mov %r8, %r12
+ mov %r13, -16(rp)
+L(lo3): ADCSBB 32(vp), %r11
+ mov %r9, %r13
+ mov %r14, -8(rp)
+L(lo2): sbb R32(%rbx), R32(%rbx)
+ shl $63, %r8
+ mov %r11, %r15
+ shr %r12
+ mov %r10, %r14
+ shl $63, %r9
+ lea 32(vp), vp
+ shl $63, %r10
+ or %r8, %rbp
+ shl $63, %r11
+ or %r9, %r12
+ shr %r13
+ mov 8(up), %r8
+ sub $4, n
+ jg L(top)
+
+L(end): shr %r14
+ or %r10, %r13
+ shr %r15
+ or %r11, %r14
+ mov %rbp, (rp)
+ lea 32(rp), rp
+L(cj5): add R32(%rbx), R32(%rbx)
+ ADCSBB 8(vp), %r8
+ mov %r12, -24(rp)
+L(cj4): mov %r13, -16(rp)
+L(cj3): mov %r8, %r12
+ mov %r14, -8(rp)
+L(cj2): sbb R32(%rbx), R32(%rbx)
+ shl $63, %r8
+ shr %r12
+ or %r8, %r15
+ shl $63, %rbx
+ add %rbx, %r12
+ mov %r15, (rp)
+ mov %r12, 8(rp)
+L(cj1): pop %r15
+ pop %r14
+ pop %r13
+ pop %r12
+ pop %rbp
+ pop %rbx
+ FUNC_EXIT()
+ ret
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/atom/rshift.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/atom/rshift.asm
new file mode 100644
index 00000000000..29c027de499
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/atom/rshift.asm
@@ -0,0 +1,121 @@
+dnl AMD64 mpn_rshift -- mpn right shift, optimised for Atom.
+
+dnl Contributed to the GNU project by Torbjorn Granlund.
+
+dnl Copyright 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/limb
+C AMD K8,K9 ?
+C AMD K10 ?
+C Intel P4 ?
+C Intel core2 ?
+C Intel NHM ?
+C Intel SBR ?
+C Intel atom 4.5
+C VIA nano ?
+
+C TODO
+C * Consider using 4-way unrolling. We reach 4 c/l, but the code is 2.5 times
+C larger.
+
+C INPUT PARAMETERS
+define(`rp', `%rdi')
+define(`up', `%rsi')
+define(`n', `%rdx')
+define(`cnt', `%rcx')
+
+ABI_SUPPORT(DOS64)
+ABI_SUPPORT(STD64)
+
+ASM_START()
+ TEXT
+ ALIGN(16)
+PROLOGUE(mpn_rshift)
+ FUNC_ENTRY(4)
+ shr R32(n)
+ mov (up), %rax
+ jnc L(evn)
+
+ mov %rax, %r11
+ shr R8(cnt), %r11
+ neg R8(cnt)
+ shl R8(cnt), %rax
+ test n, n
+ jnz L(gt1)
+ mov %r11, (rp)
+ FUNC_EXIT()
+ ret
+
+L(gt1): mov 8(up), %r8
+ mov %r8, %r10
+ shl R8(cnt), %r8
+ jmp L(lo1)
+
+L(evn): mov %rax, %r10
+ neg R8(cnt)
+ shl R8(cnt), %rax
+ mov 8(up), %r9
+ mov %r9, %r11
+ shl R8(cnt), %r9
+ neg R8(cnt)
+ dec n
+ lea -8(rp), rp
+ lea 8(up), up
+ jz L(end)
+
+ ALIGN(8)
+L(top): shr R8(cnt), %r10
+ or %r10, %r9
+ shr R8(cnt), %r11
+ neg R8(cnt)
+ mov 8(up), %r8
+ mov %r8, %r10
+ mov %r9, 8(rp)
+ shl R8(cnt), %r8
+ lea 16(rp), rp
+L(lo1): mov 16(up), %r9
+ or %r11, %r8
+ mov %r9, %r11
+ shl R8(cnt), %r9
+ lea 16(up), up
+ neg R8(cnt)
+ mov %r8, (rp)
+ dec n
+ jg L(top)
+
+L(end): shr R8(cnt), %r10
+ or %r10, %r9
+ shr R8(cnt), %r11
+ mov %r9, 8(rp)
+ mov %r11, 16(rp)
+ FUNC_EXIT()
+ ret
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/atom/sublsh1_n.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/atom/sublsh1_n.asm
new file mode 100644
index 00000000000..1306acde2be
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/atom/sublsh1_n.asm
@@ -0,0 +1,242 @@
+dnl AMD64 mpn_sublsh1_n optimised for Intel Atom.
+dnl Used also for AMD bd1.
+
+dnl Contributed to the GNU project by Torbjorn Granlund.
+
+dnl Copyright 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 TODO
+C * This code is slightly large at 501 bytes.
+C * aorrlsh1_n.asm and this file use the same basic pattern.
+
+C cycles/limb
+C AMD K8,K9 ?
+C AMD K10 ?
+C AMD bd1 2.3
+C AMD bobcat ?
+C Intel P4 ?
+C Intel core2 ?
+C Intel NHM ?
+C Intel SBR ?
+C Intel atom 5 (4.875 is probably possible)
+C VIA nano ?
+
+C INPUT PARAMETERS
+define(`rp', `%rdi')
+define(`up', `%rsi')
+define(`vp', `%rdx')
+define(`n', `%rcx')
+define(`cy', `%r8')
+
+ABI_SUPPORT(DOS64)
+ABI_SUPPORT(STD64)
+
+ASM_START()
+ TEXT
+ ALIGN(16)
+PROLOGUE(mpn_sublsh1_n)
+ FUNC_ENTRY(4)
+ push %rbp
+ push %r15
+ xor R32(%rbp), R32(%rbp)
+L(ent): mov R32(n), R32(%rax)
+ and $3, R32(%rax)
+ jz L(b0)
+ cmp $2, R32(%rax)
+ jz L(b2)
+ jg L(b3)
+
+L(b1): mov (vp), %r8
+ add %r8, %r8
+ lea 8(vp), vp
+ sbb R32(%rax), R32(%rax) C save scy
+ add R32(%rbp), R32(%rbp) C restore acy
+ mov (up), %r15
+ sbb %r8, %r15
+ mov %r15, (rp)
+ sbb R32(%rbp), R32(%rbp) C save acy
+ lea 8(up), up
+ lea 8(rp), rp
+ jmp L(b0)
+
+L(b2): mov (vp), %r8
+ add %r8, %r8
+ mov 8(vp), %r9
+ adc %r9, %r9
+ lea 16(vp), vp
+ sbb R32(%rax), R32(%rax) C save scy
+ add R32(%rbp), R32(%rbp) C restore acy
+ mov (up), %r15
+ sbb %r8, %r15
+ mov %r15, (rp)
+ mov 8(up), %r15
+ sbb %r9, %r15
+ mov %r15, 8(rp)
+ sbb R32(%rbp), R32(%rbp) C save acy
+ lea 16(up), up
+ lea 16(rp), rp
+ jmp L(b0)
+
+L(b3): mov (vp), %r8
+ add %r8, %r8
+ mov 8(vp), %r9
+ adc %r9, %r9
+ mov 16(vp), %r10
+ adc %r10, %r10
+ lea 24(vp), vp
+ sbb R32(%rax), R32(%rax) C save scy
+ add R32(%rbp), R32(%rbp) C restore acy
+ mov (up), %r15
+ sbb %r8, %r15
+ mov %r15, (rp)
+ mov 8(up), %r15
+ sbb %r9, %r15
+ mov %r15, 8(rp)
+ mov 16(up), %r15
+ sbb %r10, %r15
+ mov %r15, 16(rp)
+ sbb R32(%rbp), R32(%rbp) C save acy
+ lea 24(up), up
+ lea 24(rp), rp
+
+L(b0): test $4, R8(n)
+ jz L(skp)
+ add R32(%rax), R32(%rax) C restore scy
+ mov (vp), %r8
+ adc %r8, %r8
+ mov 8(vp), %r9
+ adc %r9, %r9
+ mov 16(vp), %r10
+ adc %r10, %r10
+ mov 24(vp), %r11
+ adc %r11, %r11
+ lea 32(vp), vp
+ sbb R32(%rax), R32(%rax) C save scy
+ add R32(%rbp), R32(%rbp) C restore acy
+ mov (up), %r15
+ sbb %r8, %r15
+ mov %r15, (rp)
+ mov 8(up), %r15
+ sbb %r9, %r15
+ mov %r15, 8(rp)
+ mov 16(up), %r15
+ sbb %r10, %r15
+ mov %r15, 16(rp)
+ mov 24(up), %r15
+ sbb %r11, %r15
+ mov %r15, 24(rp)
+ lea 32(up), up
+ lea 32(rp), rp
+ sbb R32(%rbp), R32(%rbp) C save acy
+
+L(skp): cmp $8, n
+ jl L(rtn)
+
+ push %r12
+ push %r13
+ push %r14
+ push %rbx
+ lea -64(rp), rp
+ jmp L(x)
+
+ ALIGN(16)
+L(top): mov (vp), %r8
+ add R32(%rax), R32(%rax)
+ lea 64(vp), vp
+ adc %r8, %r8
+ mov -56(vp), %r9
+ adc %r9, %r9
+ mov -48(vp), %r10
+ adc %r10, %r10
+ mov -40(vp), %r11
+ adc %r11, %r11
+ mov -32(vp), %r12
+ adc %r12, %r12
+ mov -24(vp), %r13
+ adc %r13, %r13
+ mov -16(vp), %r14
+ adc %r14, %r14
+ mov -8(vp), %r15
+ adc %r15, %r15
+ sbb R32(%rax), R32(%rax)
+ add R32(%rbp), R32(%rbp)
+ mov (up), %rbp
+ lea 64(rp), rp
+ mov 8(up), %rbx
+ sbb %r8, %rbp
+ mov 32(up), %r8
+ mov %rbp, (rp)
+ sbb %r9, %rbx
+ mov 16(up), %rbp
+ mov %rbx, 8(rp)
+ sbb %r10, %rbp
+ mov 24(up), %rbx
+ mov %rbp, 16(rp)
+ sbb %r11, %rbx
+ mov %rbx, 24(rp)
+ sbb %r12, %r8
+ mov 40(up), %r9
+ mov %r8, 32(rp)
+ sbb %r13, %r9
+ mov 48(up), %rbp
+ mov %r9, 40(rp)
+ sbb %r14, %rbp
+ mov 56(up), %rbx
+ mov %rbp, 48(rp)
+ sbb %r15, %rbx
+ lea 64(up), up
+ mov %rbx, 56(rp)
+ sbb R32(%rbp), R32(%rbp)
+L(x): sub $8, n
+ jge L(top)
+
+L(end): pop %rbx
+ pop %r14
+ pop %r13
+ pop %r12
+L(rtn):
+ add R32(%rbp), R32(%rax)
+ neg R32(%rax)
+
+ pop %r15
+ pop %rbp
+ FUNC_EXIT()
+ ret
+EPILOGUE()
+PROLOGUE(mpn_sublsh1_nc)
+ FUNC_ENTRY(4)
+IFDOS(` mov 56(%rsp), %r8 ')
+ push %rbp
+ push %r15
+ neg %r8 C set CF
+ sbb R32(%rbp), R32(%rbp) C save acy
+ jmp L(ent)
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/bd1/README b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/bd1/README
new file mode 100644
index 00000000000..ccd210e0d6d
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/bd1/README
@@ -0,0 +1,11 @@
+This directory contains code for AMD bulldozer including its piledriver update.
+
+We currently make limited use of SIMD instructions, both via the MPN_PATH and
+via inclusion of x86_64/fastsse files.
+
+The bd1 cores share one SIMD/FPU pipeline for two integer units. This probably
+means that an all-core GMP load (such as a HPC load) might run slower if there
+is significant SIMD dependency.
+
+We should perhaps allow a special 'bd1nosimd' pseudo cpu-name excluding any
+SIMD code.
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/bd1/aorrlsh1_n.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/bd1/aorrlsh1_n.asm
new file mode 100644
index 00000000000..c34a5fa134b
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/bd1/aorrlsh1_n.asm
@@ -0,0 +1,37 @@
+dnl AMD64 mpn_addlsh1_n and mpn_rsblsh1_n
+
+dnl Copyright 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')
+
+ABI_SUPPORT(DOS64)
+ABI_SUPPORT(STD64)
+
+MULFUNC_PROLOGUE(mpn_addlsh1_n mpn_addlsh1_nc mpn_rsblsh1_n mpn_rsblsh1_nc)
+include_mpn(`x86_64/atom/aorrlsh1_n.asm')
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/bd1/aorsmul_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/bd1/aorsmul_1.asm
new file mode 100644
index 00000000000..96fec9f5ac5
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/bd1/aorsmul_1.asm
@@ -0,0 +1,181 @@
+dnl AMD64 mpn_addmul_1 and mpn_submul_1 optimised for AMD Bulldozer.
+
+dnl Copyright 2003-2005, 2007, 2008, 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/limb
+C AMD K8,K9
+C AMD K10
+C AMD bd1 4.5-4.7
+C AMD bobcat
+C Intel P4
+C Intel core2
+C Intel NHM
+C Intel SBR
+C Intel atom
+C VIA nano
+
+C The loop of this code is the result of running a code generation and
+C optimisation tool suite written by David Harvey and Torbjorn Granlund.
+
+C TODO
+C * Try to make loop run closer to 4 c/l.
+
+define(`rp', `%rdi') C rcx
+define(`up', `%rsi') C rdx
+define(`n_param', `%rdx') C r8
+define(`v0', `%rcx') C r9
+
+define(`n', `%r11')
+
+ifdef(`OPERATION_addmul_1',`
+ define(`ADDSUB', `add')
+ define(`func', `mpn_addmul_1')
+')
+ifdef(`OPERATION_submul_1',`
+ define(`ADDSUB', `sub')
+ define(`func', `mpn_submul_1')
+')
+
+ABI_SUPPORT(DOS64)
+ABI_SUPPORT(STD64)
+
+MULFUNC_PROLOGUE(mpn_addmul_1 mpn_submul_1)
+
+IFDOS(` define(`up', ``%rsi'') ') dnl
+IFDOS(` define(`rp', ``%rcx'') ') dnl
+IFDOS(` define(`v0', ``%r9'') ') dnl
+IFDOS(` define(`r9', ``rdi'') ') dnl
+IFDOS(` define(`n', ``%r8'') ') dnl
+IFDOS(` define(`r8', ``r11'') ') dnl
+
+ASM_START()
+ TEXT
+ ALIGN(16)
+PROLOGUE(func)
+IFDOS(``push %rsi '')
+IFDOS(``push %rdi '')
+IFDOS(``mov %rdx, %rsi '')
+
+ mov (up), %rax C read first u limb early
+ push %rbx
+IFSTD(` mov n_param, %rbx ') C move away n from rdx, mul uses it
+IFDOS(` mov n, %rbx ')
+ mul v0
+
+IFSTD(` mov %rbx, n ')
+
+ and $3, R32(%rbx)
+ lea -16(rp,n,8), rp
+ jz L(b0)
+ cmp $2, R32(%rbx)
+ jb L(b1)
+ jz L(b2)
+
+L(b3): mov $0, R32(%r8)
+ mov %rax, %rbx
+ mov $0, R32(%r9)
+ mov 8(up), %rax
+ mov %rdx, %r10
+ lea (up,n,8), up
+ not n
+ jmp L(L3)
+
+L(b0): mov $0, R32(%r10)
+ mov %rax, %r8
+ mov %rdx, %rbx
+ mov 8(up), %rax
+ lea (up,n,8), up
+ neg n
+ jmp L(L0)
+
+L(b1): cmp $1, n
+ jz L(n1)
+ mov %rax, %r9
+ mov 8(up), %rax
+ mov %rdx, %r8
+ mov $0, R32(%rbx)
+ lea (up,n,8), up
+ neg n
+ inc n
+ jmp L(L1)
+
+L(b2): mov $0, R32(%rbx)
+ mov %rax, %r10
+ mov %rdx, %r9
+ mov 8(up), %rax
+ mov $0, R32(%r8)
+ lea (up,n,8), up
+ neg n
+ add $2, n
+ jns L(end)
+
+ ALIGN(32)
+L(top): mul v0
+ ADDSUB %r10, (rp,n,8)
+ adc %rax, %r9
+ mov (up,n,8), %rax
+ adc %rdx, %r8
+L(L1): mul v0
+ mov $0, R32(%r10)
+ ADDSUB %r9, 8(rp,n,8)
+ adc %rax, %r8
+ adc %rdx, %rbx
+ mov 8(up,n,8), %rax
+L(L0): mul v0
+ ADDSUB %r8, 16(rp,n,8)
+ mov $0, R32(%r8)
+ adc %rax, %rbx
+ mov $0, R32(%r9)
+ mov 16(up,n,8), %rax
+ adc %rdx, %r10
+L(L3): mul v0
+ ADDSUB %rbx, 24(rp,n,8)
+ mov $0, R32(%rbx)
+ adc %rax, %r10
+ adc %rdx, %r9
+ mov 24(up,n,8), %rax
+ add $4, n
+ js L(top)
+
+L(end): mul v0
+ ADDSUB %r10, (rp)
+ adc %r9, %rax
+ adc %r8, %rdx
+L(n1): ADDSUB %rax, 8(rp)
+ adc $0, %rdx
+ mov %rdx, %rax
+
+ pop %rbx
+IFDOS(``pop %rdi '')
+IFDOS(``pop %rsi '')
+ ret
+EPILOGUE()
+ASM_END()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/bd1/com.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/bd1/com.asm
new file mode 100644
index 00000000000..43f356117ac
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/bd1/com.asm
@@ -0,0 +1,37 @@
+dnl X86-64 mpn_com optimised for AMD bd1.
+
+dnl Copyright 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')
+
+ABI_SUPPORT(DOS64)
+ABI_SUPPORT(STD64)
+
+MULFUNC_PROLOGUE(mpn_com)
+include_mpn(`x86_64/fastsse/com-palignr.asm')
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/bd1/copyd.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/bd1/copyd.asm
new file mode 100644
index 00000000000..675cdc3f6b2
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/bd1/copyd.asm
@@ -0,0 +1,37 @@
+dnl X86-64 mpn_copyd optimised for AMD bd1.
+
+dnl Copyright 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')
+
+ABI_SUPPORT(DOS64)
+ABI_SUPPORT(STD64)
+
+MULFUNC_PROLOGUE(mpn_copyd)
+include_mpn(`x86_64/fastsse/copyd-palignr.asm')
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/bd1/copyi.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/bd1/copyi.asm
new file mode 100644
index 00000000000..ceef0365859
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/bd1/copyi.asm
@@ -0,0 +1,37 @@
+dnl X86-64 mpn_copyi optimised for AMD bd1.
+
+dnl Copyright 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')
+
+ABI_SUPPORT(DOS64)
+ABI_SUPPORT(STD64)
+
+MULFUNC_PROLOGUE(mpn_copyi)
+include_mpn(`x86_64/fastsse/copyi-palignr.asm')
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/bd1/gcd_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/bd1/gcd_1.asm
new file mode 100644
index 00000000000..3d8e5c7ab12
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/bd1/gcd_1.asm
@@ -0,0 +1,37 @@
+dnl AMD64 mpn_gcd_1.
+
+dnl Copyright 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')
+
+ABI_SUPPORT(DOS64)
+ABI_SUPPORT(STD64)
+
+MULFUNC_PROLOGUE(mpn_gcd_1)
+include_mpn(`x86_64/core2/gcd_1.asm')
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/bd1/gmp-mparam.h b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/bd1/gmp-mparam.h
new file mode 100644
index 00000000000..5014f9f469c
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/bd1/gmp-mparam.h
@@ -0,0 +1,236 @@
+/* AMD bd1 gmp-mparam.h -- Compiler/machine parameter header file.
+
+Copyright 1991, 1993, 1994, 2000-2010, 2012, 2014 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 Bulldozer Zambezi */
+/* FFT tuning limit = 40000000 */
+/* Generated by tuneup.c, 2014-03-13, gcc 4.5 */
+
+#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 4
+#define MOD_1_1_TO_MOD_1_2_THRESHOLD 13
+#define MOD_1_2_TO_MOD_1_4_THRESHOLD 28
+#define PREINV_MOD_1_TO_MOD_1_THRESHOLD 11
+#define USE_PREINV_DIVREM_1 1 /* native */
+#define DIV_QR_1_NORM_THRESHOLD 1
+#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 22
+
+#define MUL_TOOM22_THRESHOLD 20
+#define MUL_TOOM33_THRESHOLD 59
+#define MUL_TOOM44_THRESHOLD 166
+#define MUL_TOOM6H_THRESHOLD 274
+#define MUL_TOOM8H_THRESHOLD 333
+
+#define MUL_TOOM32_TO_TOOM43_THRESHOLD 97
+#define MUL_TOOM32_TO_TOOM53_THRESHOLD 107
+#define MUL_TOOM42_TO_TOOM53_THRESHOLD 105
+#define MUL_TOOM42_TO_TOOM63_THRESHOLD 115
+#define MUL_TOOM43_TO_TOOM54_THRESHOLD 150
+
+#define SQR_BASECASE_THRESHOLD 0 /* always (native) */
+#define SQR_TOOM2_THRESHOLD 22
+#define SQR_TOOM3_THRESHOLD 85
+#define SQR_TOOM4_THRESHOLD 242
+#define SQR_TOOM6_THRESHOLD 318
+#define SQR_TOOM8_THRESHOLD 478
+
+#define MULMID_TOOM42_THRESHOLD 22
+
+#define MULMOD_BNM1_THRESHOLD 11
+#define SQRMOD_BNM1_THRESHOLD 14
+
+#define MUL_FFT_MODF_THRESHOLD 404 /* k = 5 */
+#define MUL_FFT_TABLE3 \
+ { { 404, 5}, { 19, 6}, { 11, 5}, { 23, 6}, \
+ { 19, 7}, { 10, 6}, { 25, 7}, { 15, 6}, \
+ { 31, 7}, { 25, 8}, { 13, 7}, { 27, 8}, \
+ { 15, 7}, { 31, 8}, { 17, 7}, { 35, 8}, \
+ { 19, 7}, { 39, 8}, { 27, 9}, { 15, 8}, \
+ { 35, 9}, { 19, 8}, { 41, 9}, { 23, 8}, \
+ { 47, 9}, { 27,10}, { 15, 9}, { 39,10}, \
+ { 23, 9}, { 55,11}, { 15,10}, { 31, 9}, \
+ { 67,10}, { 39, 9}, { 83,10}, { 47, 9}, \
+ { 95,10}, { 55,11}, { 31,10}, { 79,11}, \
+ { 47,10}, { 103,12}, { 31,11}, { 63,10}, \
+ { 135,11}, { 79,10}, { 167,11}, { 95,10}, \
+ { 191,11}, { 111,12}, { 63,11}, { 127,10}, \
+ { 255,11}, { 143,10}, { 287, 9}, { 575,10}, \
+ { 303,11}, { 159,12}, { 95,11}, { 191,10}, \
+ { 383,11}, { 207,13}, { 63,12}, { 127,11}, \
+ { 255,10}, { 511,11}, { 271,10}, { 543,11}, \
+ { 287,10}, { 575,11}, { 303,12}, { 159,11}, \
+ { 319, 9}, { 1279,11}, { 367,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,10}, { 1215,12}, \
+ { 319,10}, { 1279,11}, { 671,12}, { 351,11}, \
+ { 703,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,11}, { 1279,12}, { 671,11}, { 1343,10}, \
+ { 2687,12}, { 703,11}, { 1407,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,11}, \
+ { 2431,10}, { 4863,12}, { 1343,13}, { 703,12}, \
+ { 1407,14}, { 383,13}, { 767,12}, { 1599,13}, \
+ { 831,12}, { 1727,11}, { 3455,13}, { 895,12}, \
+ { 1791,13}, { 959,15}, { 255,14}, { 511,13}, \
+ { 1087,12}, { 2175,13}, { 1151,12}, { 2303,13}, \
+ { 1215,12}, { 2431,11}, { 4863,13}, { 1343,12}, \
+ { 2687,13}, { 1471,12}, { 2943,11}, { 5887,14}, \
+ { 767,13}, { 1599,12}, { 3199,13}, { 1727,14}, \
+ { 895,13}, { 1791,12}, { 3583,13}, { 1919,12}, \
+ { 3839,15}, { 511,14}, { 1023,13}, { 2175,14}, \
+ { 1151,13}, { 2303,12}, { 4607,13}, { 2431,12}, \
+ { 4863,14}, { 1279,13}, { 2687,14}, { 1407,13}, \
+ { 2943,12}, { 5887,15}, { 767,14}, { 1535,13}, \
+ { 3199,14}, { 1663,13}, { 3455,12}, { 6911,14}, \
+ { 1791,13}, { 3583,14}, { 1919,13}, { 3839,16}, \
+ { 511,15}, { 1023,14}, { 2175,13}, { 4351,14}, \
+ { 2303,13}, { 4607,14}, { 2431,13}, { 4863,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 3712
+
+#define SQR_FFT_MODF_THRESHOLD 380 /* k = 5 */
+#define SQR_FFT_TABLE3 \
+ { { 380, 5}, { 17, 6}, { 9, 5}, { 23, 6}, \
+ { 21, 7}, { 11, 6}, { 25, 7}, { 13, 6}, \
+ { 27, 7}, { 15, 6}, { 31, 7}, { 25, 8}, \
+ { 13, 7}, { 27, 8}, { 15, 7}, { 31, 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}, \
+ { 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,10}, \
+ { 191,11}, { 111,12}, { 63,11}, { 127,10}, \
+ { 255, 9}, { 511,10}, { 271,11}, { 143,10}, \
+ { 287, 9}, { 575,10}, { 303,11}, { 159,10}, \
+ { 319,12}, { 95,11}, { 191,10}, { 383,13}, \
+ { 63,12}, { 127,11}, { 255,10}, { 511,11}, \
+ { 271,10}, { 543, 9}, { 1087,11}, { 303,10}, \
+ { 607,12}, { 159,11}, { 319,10}, { 639,11}, \
+ { 335,10}, { 671, 9}, { 1343,11}, { 351,12}, \
+ { 191,11}, { 383,10}, { 767,11}, { 415,12}, \
+ { 223,11}, { 447,13}, { 127,12}, { 255,11}, \
+ { 511,10}, { 1023,11}, { 543,10}, { 1087,12}, \
+ { 287,11}, { 575,10}, { 1151,11}, { 607,12}, \
+ { 319,11}, { 639,10}, { 1279,11}, { 671,12}, \
+ { 351,13}, { 191,12}, { 383,11}, { 767,12}, \
+ { 415,11}, { 831,12}, { 447,14}, { 127,13}, \
+ { 255,12}, { 511,11}, { 1023,12}, { 543,11}, \
+ { 1087,10}, { 2175,12}, { 575,11}, { 1151,12}, \
+ { 607,13}, { 319,12}, { 639,11}, { 1279,12}, \
+ { 671,11}, { 1343,10}, { 2687,12}, { 703,11}, \
+ { 1407,13}, { 383,12}, { 767,11}, { 1599,10}, \
+ { 3199,12}, { 831,13}, { 447,12}, { 895,14}, \
+ { 255,13}, { 511,12}, { 1087,11}, { 2175,13}, \
+ { 575,12}, { 1215,11}, { 2431,10}, { 4863,13}, \
+ { 639,12}, { 1343,11}, { 2687,13}, { 703,12}, \
+ { 1407,14}, { 383,13}, { 767,12}, { 1599,11}, \
+ { 3199,13}, { 831,12}, { 1727,13}, { 895,15}, \
+ { 255,14}, { 511,13}, { 1087,12}, { 2175,13}, \
+ { 1215,12}, { 2431,11}, { 4863,14}, { 639,13}, \
+ { 1343,12}, { 2687,13}, { 1471,12}, { 2943,11}, \
+ { 5887,14}, { 767,13}, { 1599,12}, { 3199,13}, \
+ { 1727,14}, { 895,13}, { 1791,12}, { 3583,13}, \
+ { 1919,12}, { 3839,15}, { 511,14}, { 1023,13}, \
+ { 2175,14}, { 1151,13}, { 2303,12}, { 4607,13}, \
+ { 2431,12}, { 4863,14}, { 1279,13}, { 2687,14}, \
+ { 1407,13}, { 2943,12}, { 5887,15}, { 767,14}, \
+ { 1535,13}, { 3199,14}, { 1663,13}, { 3327,12}, \
+ { 6655,13}, { 3455,12}, { 6911,14}, { 1791,13}, \
+ { 3583,14}, { 1919,13}, { 3839,16}, { 511,15}, \
+ { 1023,14}, { 2175,13}, { 4351,14}, { 2303,13}, \
+ { 4607,14}, { 2431,13}, { 4863,15}, { 32768,16}, \
+ { 65536,17}, { 131072,18}, { 262144,19}, { 524288,20}, \
+ {1048576,21}, {2097152,22}, {4194304,23}, {8388608,24} }
+#define SQR_FFT_TABLE3_SIZE 220
+#define SQR_FFT_THRESHOLD 3264
+
+#define MULLO_BASECASE_THRESHOLD 0 /* always */
+#define MULLO_DC_THRESHOLD 39
+#define MULLO_MUL_N_THRESHOLD 7246
+
+#define DC_DIV_QR_THRESHOLD 54
+#define DC_DIVAPPR_Q_THRESHOLD 180
+#define DC_BDIV_QR_THRESHOLD 47
+#define DC_BDIV_Q_THRESHOLD 80
+
+#define INV_MULMOD_BNM1_THRESHOLD 38
+#define INV_NEWTON_THRESHOLD 226
+#define INV_APPR_THRESHOLD 188
+
+#define BINV_NEWTON_THRESHOLD 248
+#define REDC_1_TO_REDC_2_THRESHOLD 52
+#define REDC_2_TO_REDC_N_THRESHOLD 0 /* always */
+
+#define MU_DIV_QR_THRESHOLD 1334
+#define MU_DIVAPPR_Q_THRESHOLD 1360
+#define MUPI_DIV_QR_THRESHOLD 108
+#define MU_BDIV_QR_THRESHOLD 1142
+#define MU_BDIV_Q_THRESHOLD 1360
+
+#define POWM_SEC_TABLE 1,16,194,386,452,2245
+
+#define MATRIX22_STRASSEN_THRESHOLD 15
+#define HGCD_THRESHOLD 108
+#define HGCD_APPR_THRESHOLD 51
+#define HGCD_REDUCE_THRESHOLD 2681
+#define GCD_DC_THRESHOLD 474
+#define GCDEXT_DC_THRESHOLD 298
+#define JACOBI_BASE_METHOD 4
+
+#define GET_STR_DC_THRESHOLD 13
+#define GET_STR_PRECOMPUTE_THRESHOLD 21
+#define SET_STR_DC_THRESHOLD 418
+#define SET_STR_PRECOMPUTE_THRESHOLD 1289
+
+#define FAC_DSC_THRESHOLD 252
+#define FAC_ODD_THRESHOLD 23
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/bd1/hamdist.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/bd1/hamdist.asm
new file mode 100644
index 00000000000..93e1e5632b2
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/bd1/hamdist.asm
@@ -0,0 +1,38 @@
+dnl AMD64 mpn_hamdist -- hamming distance.
+
+dnl Copyright 2008, 2010-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')
+
+ABI_SUPPORT(DOS64)
+ABI_SUPPORT(STD64)
+
+MULFUNC_PROLOGUE(mpn_hamdist)
+include_mpn(`x86_64/k10/hamdist.asm')
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/bd1/mul_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/bd1/mul_1.asm
new file mode 100644
index 00000000000..e59667c0853
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/bd1/mul_1.asm
@@ -0,0 +1,184 @@
+dnl AMD64 mpn_mul_1 optimised for AMD Bulldozer.
+
+dnl Copyright 2003-2005, 2007, 2008, 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/limb
+C AMD K8,K9
+C AMD K10
+C AMD bd1 4
+C AMD bobcat
+C Intel P4
+C Intel core2
+C Intel NHM
+C Intel SBR
+C Intel atom
+C VIA nano
+
+C The loop of this code is the result of running a code generation and
+C optimisation tool suite written by David Harvey and Torbjorn Granlund.
+
+C TODO
+C * Move loop code into feed-in blocks, to save insn for zeroing regs.
+
+define(`rp', `%rdi') C rcx
+define(`up', `%rsi') C rdx
+define(`n_param', `%rdx') C r8
+define(`v0', `%rcx') C r9
+
+define(`n', `%rbx')
+
+ABI_SUPPORT(DOS64)
+ABI_SUPPORT(STD64)
+
+IFDOS(` define(`up', ``%rsi'') ') dnl
+IFDOS(` define(`rp', ``%rcx'') ') dnl
+IFDOS(` define(`v0', ``%r9'') ') dnl
+IFDOS(` define(`r9', ``rdi'') ') dnl
+IFDOS(` define(`n', ``%r8'') ') dnl
+IFDOS(` define(`r8', ``rbx'') ') dnl
+
+ASM_START()
+ TEXT
+ ALIGN(16)
+PROLOGUE(mpn_mul_1c)
+IFDOS(``push %rsi '')
+IFDOS(``push %rdi '')
+IFDOS(``mov %rdx, %rsi '')
+
+ mov (up), %rax C read first u limb early
+ push %rbx
+IFSTD(` mov n_param, %r11 ') C move away n from rdx, mul uses it
+IFDOS(` mov n, %r11 ')
+ mul v0
+
+IFSTD(` add %r8, %rax ')
+IFDOS(` add 64(%rsp), %rax ') C 40 + 3*8 (3 push insns)
+ adc $0, %rdx
+ jmp L(common)
+
+EPILOGUE()
+
+ ALIGN(16)
+PROLOGUE(mpn_mul_1)
+IFDOS(``push %rsi '')
+IFDOS(``push %rdi '')
+IFDOS(``mov %rdx, %rsi '')
+
+ mov (up), %rax C read first u limb early
+ push %rbx
+IFSTD(` mov n_param, %r11 ') C move away n from rdx, mul uses it
+IFDOS(` mov n, %r11 ')
+ mul v0
+
+L(common):
+IFSTD(` mov %r11, n ')
+
+ and $3, R32(%r11)
+ lea -16(rp,n,8), rp
+ jz L(b0)
+ cmp $2, R32(%r11)
+ jb L(b1)
+ jz L(b2)
+
+L(b3): mov %rax, %r10
+ mov %rdx, %r11
+ mov 8(up), %rax
+ mul v0
+ lea (up,n,8), up
+ not n
+ jmp L(L3)
+
+L(b0): mov %rax, %r9
+ mov %rdx, %r10
+ mov 8(up), %rax
+ lea (up,n,8), up
+ neg n
+ jmp L(L0)
+
+L(b1): mov %rax, %r8
+ cmp $1, n
+ jz L(n1)
+ mov %rdx, %r9
+ lea (up,n,8), up
+ neg n
+ mov %r8, 16(rp,n,8)
+ inc n
+ jmp L(L1)
+
+L(b2): mov %rax, %r11
+ mov %rdx, %r8
+ mov 8(up), %rax
+ lea (up,n,8), up
+ neg n
+ add $2, n
+ jns L(end)
+
+ ALIGN(16)
+L(top): mul v0
+ mov %rdx, %r9
+ add %rax, %r8
+ adc $0, %r9
+ mov %r8, 8(rp,n,8)
+ mov %r11, (rp,n,8)
+L(L1): mov (up,n,8), %rax
+ mul v0
+ add %rax, %r9
+ mov %rdx, %r10
+ mov 8(up,n,8), %rax
+ adc $0, %r10
+L(L0): mul v0
+ add %rax, %r10
+ mov %rdx, %r11
+ mov 16(up,n,8), %rax
+ adc $0, %r11
+ mul v0
+ mov %r9, 16(rp,n,8)
+L(L3): add %rax, %r11
+ mov %r10, 24(rp,n,8)
+ mov %rdx, %r8
+ adc $0, %r8
+ add $4, n
+ mov -8(up,n,8), %rax
+ js L(top)
+
+L(end): mul v0
+ add %rax, %r8
+ adc $0, %rdx
+ mov %r11, (rp)
+L(n1): mov %r8, 8(rp)
+ mov %rdx, %rax
+
+ pop %rbx
+IFDOS(``pop %rdi '')
+IFDOS(``pop %rsi '')
+ ret
+EPILOGUE()
+ASM_END()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/bd1/mul_2.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/bd1/mul_2.asm
new file mode 100644
index 00000000000..4ed5f305614
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/bd1/mul_2.asm
@@ -0,0 +1,192 @@
+dnl AMD64 mpn_mul_2 optimised for AMD Bulldozer.
+
+dnl Contributed to the GNU project by Torbjörn Granlund.
+
+dnl Copyright 2008, 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/limb
+C AMD K8,K9
+C AMD K10
+C AMD bull 4.36 average, quite fluctuating
+C AMD pile 4.38 slighty fluctuating
+C AMD steam
+C AMD bobcat
+C AMD jaguar
+C Intel P4
+C Intel core
+C Intel NHM
+C Intel SBR
+C Intel IBR
+C Intel HWL
+C Intel BWL
+C Intel atom
+C VIA nano
+
+C The loop of this code is the result of running a code generation and
+C optimisation tool suite written by David Harvey and Torbjorn Granlund.
+C Scheme: genxmul --mul
+
+define(`rp', `%rdi') C rcx
+define(`up', `%rsi') C rdx
+define(`n_param', `%rdx') C r8
+define(`vp', `%rcx') C r9
+
+define(`v0', `%r8')
+define(`v1', `%r9')
+define(`w0', `%rbx')
+define(`w1', `%rcx')
+define(`w2', `%rbp')
+define(`w3', `%r10')
+define(`n', `%r11')
+
+ABI_SUPPORT(DOS64)
+ABI_SUPPORT(STD64)
+
+ASM_START()
+ TEXT
+ ALIGN(32)
+PROLOGUE(mpn_mul_2)
+ FUNC_ENTRY(4)
+ push %rbx
+ push %rbp
+
+ mov (up), %rax
+
+ mov (vp), v0
+ mov 8(vp), v1
+
+ lea (up,n_param,8), up
+ lea (rp,n_param,8), rp
+
+ mov n_param, n
+ mul v0
+ neg n
+
+ test $1, R8(n)
+ jnz L(bx1)
+
+L(bx0): test $2, R8(n)
+ jnz L(b10)
+
+L(b00): mov %rax, w0
+ mov %rdx, w1
+ xor R32(w2), R32(w2)
+ mov (up,n,8), %rax
+ jmp L(lo0)
+
+L(b10): mov %rax, w2
+ mov %rdx, w3
+ mov (up,n,8), %rax
+ xor R32(w0), R32(w0)
+ mul v1
+ add $-2, n
+ jmp L(lo2)
+
+L(bx1): test $2, R8(n)
+ jz L(b11)
+
+L(b01): mov %rax, w3
+ mov %rdx, w0
+ mov (up,n,8), %rax
+ mul v1
+ xor R32(w1), R32(w1)
+ inc n
+ jmp L(lo1)
+
+L(b11): mov %rax, w1
+ mov %rdx, w2
+ mov (up,n,8), %rax
+ xor R32(w3), R32(w3)
+ dec n
+ jmp L(lo3)
+
+ ALIGN(32)
+L(top): mov -8(up,n,8), %rax
+ mul v1
+ mov w2, -16(rp,n,8)
+L(lo1): add %rax, w0
+ mov w3, -8(rp,n,8)
+ adc %rdx, w1
+ mov (up,n,8), %rax
+ mul v0
+ mov $0, R32(w2)
+ add %rax, w0
+ adc %rdx, w1
+ adc $0, R32(w2)
+ mov (up,n,8), %rax
+L(lo0): mul v1
+ add %rax, w1
+ adc %rdx, w2
+ mov 8(up,n,8), %rax
+ mul v0
+ add %rax, w1
+ mov w0, (rp,n,8)
+ mov $0, R32(w3)
+ mov 8(up,n,8), %rax
+ adc %rdx, w2
+ adc $0, R32(w3)
+L(lo3): mul v1
+ add %rax, w2
+ mov 16(up,n,8), %rax
+ adc %rdx, w3
+ mul v0
+ add %rax, w2
+ mov 16(up,n,8), %rax
+ mov $0, R32(w0)
+ adc %rdx, w3
+ adc $0, R32(w0)
+ mul v1
+ mov w1, 8(rp,n,8)
+L(lo2): add %rax, w3
+ adc %rdx, w0
+ mov 24(up,n,8), %rax
+ mul v0
+ add %rax, w3
+ adc %rdx, w0
+ mov $0, R32(w1)
+ adc $0, R32(w1)
+ add $4, n
+ jnc L(top)
+
+L(end): mov -8(up,n,8), %rax
+ mul v1
+ mov w2, -16(rp,n,8)
+ add %rax, w0
+ mov w3, -8(rp,n,8)
+ adc %rdx, w1
+ mov w0, (rp,n,8)
+ mov w1, %rax
+
+ pop %rbp
+ pop %rbx
+ FUNC_EXIT()
+ ret
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/bd1/mul_basecase.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/bd1/mul_basecase.asm
new file mode 100644
index 00000000000..e47ba587cda
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/bd1/mul_basecase.asm
@@ -0,0 +1,416 @@
+dnl AMD64 mpn_mul_basecase optimised for AMD Bulldozer and Piledriver.
+
+dnl Contributed to the GNU project by Torbjörn Granlund.
+
+dnl Copyright 2003-2005, 2007, 2008, 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/limb mul_1 mul_2 mul_3 addmul_2
+C AMD K8,K9
+C AMD K10
+C AMD bull ~4.8 ~4.55 - ~4.3
+C AMD pile ~4.6 ~4.55 - ~4.55
+C AMD bobcat
+C AMD jaguar
+C Intel P4
+C Intel core
+C Intel NHM
+C Intel SBR
+C Intel IBR
+C Intel HWL
+C Intel BWL
+C Intel atom
+C VIA nano
+
+C The inner loops of this code are the result of running a code generation and
+C optimisation tool suite written by David Harvey and Torbjorn Granlund.
+
+C TODO
+C * Merge bull-specific mul_1, if it is not slower the TOOM22 range.
+C Alternatively, we could tweak the present code (which was loopmixed for a
+C different CPU).
+C * Merge faster mul_2, such as the one in the same directory as this file.
+C * Further micro-optimise.
+
+C When playing with pointers, set this to $2 to fall back to conservative
+C indexing in wind-down code.
+define(`I',`$1')
+
+
+define(`rp', `%rdi')
+define(`up', `%rsi')
+define(`un_param',`%rdx')
+define(`vp', `%rcx')
+define(`vn', `%r8')
+
+define(`un', `%rbx')
+
+define(`w0', `%r10')
+define(`w1', `%r11')
+define(`w2', `%r12')
+define(`w3', `%r13')
+define(`n', `%rbp')
+define(`v0', `%r9')
+
+ABI_SUPPORT(DOS64)
+ABI_SUPPORT(STD64)
+
+ASM_START()
+ TEXT
+ ALIGN(16)
+PROLOGUE(mpn_mul_basecase)
+ FUNC_ENTRY(4)
+IFDOS(` mov 56(%rsp), %r8d ')
+ push %rbx
+ push %rbp
+ mov un_param, un C free up rdx
+ neg un
+
+ mov (up), %rax C shared for mul_1 and mul_2
+ lea (up,un_param,8), up C point at operand end
+ lea (rp,un_param,8), rp C point at rp[un-1]
+
+ mov (vp), v0 C shared for mul_1 and mul_2
+ mul v0 C shared for mul_1 and mul_2
+
+ test $1, R8(vn)
+ jz L(do_mul_2)
+
+L(do_mul_1):
+ test $1, R8(un)
+ jnz L(m1x1)
+
+L(m1x0):mov %rax, w0 C un = 2, 4, 6, 8, ...
+ mov %rdx, w1
+ mov 8(up,un,8), %rax
+ test $2, R8(un)
+ jnz L(m110)
+
+L(m100):lea 2(un), n C un = 4, 8, 12, ...
+ jmp L(m1l0)
+
+L(m110):lea (un), n C un = 2, 6, 10, ...
+ jmp L(m1l2)
+
+L(m1x1):mov %rax, w1 C un = 1, 3, 5, 7, ...
+ mov %rdx, w0
+ test $2, R8(un)
+ jz L(m111)
+
+L(m101):lea 3(un), n C un = 1, 5, 9, ...
+ test n, n
+ js L(m1l1)
+ mov %rax, -8(rp)
+ mov %rdx, (rp)
+ pop %rbp
+ pop %rbx
+ FUNC_EXIT()
+ ret
+
+L(m111):lea 1(un), n C un = 3, 7, 11, ...
+ mov 8(up,un,8), %rax
+ jmp L(m1l3)
+
+ ALIGN(16)
+L(m1tp):mov %rdx, w0
+ add %rax, w1
+L(m1l1):mov -16(up,n,8), %rax
+ adc $0, w0
+ mul v0
+ add %rax, w0
+ mov w1, -24(rp,n,8)
+ mov -8(up,n,8), %rax
+ mov %rdx, w1
+ adc $0, w1
+L(m1l0):mul v0
+ mov w0, -16(rp,n,8)
+ add %rax, w1
+ mov %rdx, w0
+ mov (up,n,8), %rax
+ adc $0, w0
+L(m1l3):mul v0
+ mov w1, -8(rp,n,8)
+ mov %rdx, w1
+ add %rax, w0
+ mov 8(up,n,8), %rax
+ adc $0, w1
+L(m1l2):mul v0
+ mov w0, (rp,n,8)
+ add $4, n
+ jnc L(m1tp)
+
+L(m1ed):add %rax, w1
+ adc $0, %rdx
+ mov w1, I(-8(rp),-24(rp,n,8))
+ mov %rdx, I((rp),-16(rp,n,8))
+
+ dec R32(vn)
+ jz L(ret2)
+
+ lea 8(vp), vp
+ lea 8(rp), rp
+ push %r12
+ push %r13
+ push %r14
+ jmp L(do_addmul)
+
+L(do_mul_2):
+define(`v1', `%r14')
+ push %r12
+ push %r13
+ push %r14
+
+ mov 8(vp), v1
+
+ test $1, R8(un)
+ jnz L(m2b1)
+
+L(m2b0):lea (un), n
+ mov %rax, w2 C 0
+ mov (up,un,8), %rax
+ mov %rdx, w1 C 1
+ mul v1
+ mov %rax, w0 C 1
+ mov w2, (rp,un,8) C 0
+ mov 8(up,un,8), %rax
+ mov %rdx, w2 C 2
+ jmp L(m2l0)
+
+L(m2b1):lea 1(un), n
+ mov %rax, w0 C 1
+ mov %rdx, w3 C 2
+ mov (up,un,8), %rax
+ mul v1
+ mov w0, (rp,un,8) C 1
+ mov %rdx, w0 C 3
+ mov %rax, w2 C 0
+ mov 8(up,un,8), %rax
+ jmp L(m2l1)
+
+ ALIGN(32)
+L(m2tp):add %rax, w2 C 0
+ mov (up,n,8), %rax
+ adc $0, w0 C 1
+L(m2l1):mul v0
+ add %rax, w2 C 0
+ mov (up,n,8), %rax
+ mov %rdx, w1 C 1
+ adc $0, w1 C 1
+ mul v1
+ add w3, w2 C 0
+ adc $0, w1 C 1
+ add %rax, w0 C 1
+ mov w2, (rp,n,8) C 0
+ mov 8(up,n,8), %rax
+ mov %rdx, w2 C 2
+ adc $0, w2 C 2
+L(m2l0):mul v0
+ add %rax, w0 C 1
+ mov %rdx, w3 C 2
+ adc $0, w3 C 2
+ add w1, w0 C 1
+ adc $0, w3 C 2
+ mov 8(up,n,8), %rax
+ mul v1
+ add $2, n
+ mov w0, -8(rp,n,8) C 1
+ mov %rdx, w0 C 3
+ jnc L(m2tp)
+
+L(m2ed):add %rax, w2
+ adc $0, %rdx
+ add w3, w2
+ adc $0, %rdx
+ mov w2, I((rp),(rp,n,8))
+ mov %rdx, I(8(rp),8(rp,n,8))
+
+ add $-2, R32(vn)
+ jz L(ret5)
+
+ lea 16(vp), vp
+ lea 16(rp), rp
+
+
+L(do_addmul):
+ push %r15
+ push vn C save vn in new stack slot
+define(`vn', `(%rsp)')
+define(`X0', `%r14')
+define(`X1', `%r15')
+define(`v1', `%r8')
+
+L(outer):
+ mov (vp), v0
+ mov 8(vp), v1
+
+ mov (up,un,8), %rax
+ mul v0
+
+ test $1, R8(un)
+ jnz L(bx1)
+
+L(bx0): mov %rax, X1
+ mov (up,un,8), %rax
+ mov %rdx, X0
+ mul v1
+ test $2, R8(un)
+ jnz L(b10)
+
+L(b00): lea (un), n C un = 4, 8, 12, ...
+ mov (rp,un,8), w3
+ mov %rax, w0
+ mov 8(up,un,8), %rax
+ mov %rdx, w1
+ jmp L(lo0)
+
+L(b10): lea 2(un), n C un = 2, 6, 10, ...
+ mov (rp,un,8), w1
+ mov %rdx, w3
+ mov %rax, w2
+ mov 8(up,un,8), %rax
+ jmp L(lo2)
+
+L(bx1): mov %rax, X0
+ mov (up,un,8), %rax
+ mov %rdx, X1
+ mul v1
+ test $2, R8(un)
+ jz L(b11)
+
+L(b01): lea 1(un), n C un = 1, 5, 9, ...
+ mov (rp,un,8), w2
+ mov %rdx, w0
+ mov %rax, w3
+ jmp L(lo1)
+
+L(b11): lea -1(un), n C un = 3, 7, 11, ...
+ mov (rp,un,8), w0
+ mov %rax, w1
+ mov 8(up,un,8), %rax
+ mov %rdx, w2
+ jmp L(lo3)
+
+ ALIGN(32)
+L(top):
+L(lo2): mul v0
+ add w1, X1
+ mov X1, -16(rp,n,8)
+ mov %rdx, X1
+ adc %rax, X0
+ adc $0, X1
+ mov -8(up,n,8), %rax
+ mul v1
+ mov -8(rp,n,8), w1
+ mov %rdx, w0
+ add w1, w2
+ adc %rax, w3
+ adc $0, w0
+L(lo1): mov (up,n,8), %rax
+ mul v0
+ add w2, X0
+ mov X0, -8(rp,n,8)
+ mov %rdx, X0
+ adc %rax, X1
+ mov (up,n,8), %rax
+ adc $0, X0
+ mov (rp,n,8), w2
+ mul v1
+ add w2, w3
+ adc %rax, w0
+ mov 8(up,n,8), %rax
+ mov %rdx, w1
+ adc $0, w1
+L(lo0): mul v0
+ add w3, X1
+ mov X1, (rp,n,8)
+ adc %rax, X0
+ mov 8(up,n,8), %rax
+ mov %rdx, X1
+ adc $0, X1
+ mov 8(rp,n,8), w3
+ mul v1
+ add w3, w0
+ adc %rax, w1
+ mov 16(up,n,8), %rax
+ mov %rdx, w2
+ adc $0, w2
+L(lo3): mul v0
+ add w0, X0
+ mov X0, 8(rp,n,8)
+ mov %rdx, X0
+ adc %rax, X1
+ adc $0, X0
+ mov 16(up,n,8), %rax
+ mov 16(rp,n,8), w0
+ mul v1
+ mov %rdx, w3
+ add w0, w1
+ adc %rax, w2
+ adc $0, w3
+ mov 24(up,n,8), %rax
+ add $4, n
+ jnc L(top)
+
+L(end): mul v0
+ add w1, X1
+ mov X1, I(-16(rp),-16(rp,n,8))
+ mov %rdx, X1
+ adc %rax, X0
+ adc $0, X1
+ mov I(-8(up),-8(up,n,8)), %rax
+ mul v1
+ mov I(-8(rp),-8(rp,n,8)), w1
+ add w1, w2
+ adc %rax, w3
+ adc $0, %rdx
+ add w2, X0
+ adc $0, X1
+ mov X0, I(-8(rp),-8(rp,n,8))
+ add w3, X1
+ mov X1, I((rp),(rp,n,8))
+ adc $0, %rdx
+ mov %rdx, I(8(rp),8(rp,n,8))
+
+
+ addl $-2, vn
+ lea 16(vp), vp
+ lea 16(rp), rp
+ jnz L(outer)
+
+ pop %rax C deallocate vn slot
+ pop %r15
+L(ret5):pop %r14
+ pop %r13
+ pop %r12
+L(ret2):pop %rbp
+ pop %rbx
+ FUNC_EXIT()
+ ret
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/bd1/popcount.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/bd1/popcount.asm
new file mode 100644
index 00000000000..8f22a715b66
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/bd1/popcount.asm
@@ -0,0 +1,38 @@
+dnl AMD64 mpn_popcount -- population count.
+
+dnl Copyright 2008, 2010-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')
+
+ABI_SUPPORT(DOS64)
+ABI_SUPPORT(STD64)
+
+MULFUNC_PROLOGUE(mpn_popcount)
+include_mpn(`x86_64/k10/popcount.asm')
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/bd1/sec_tabselect.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/bd1/sec_tabselect.asm
new file mode 100644
index 00000000000..e4360341d93
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/bd1/sec_tabselect.asm
@@ -0,0 +1,37 @@
+dnl X86-64 mpn_sec_tabselect.
+
+dnl Copyright 2012, 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')
+
+ABI_SUPPORT(DOS64)
+ABI_SUPPORT(STD64)
+
+MULFUNC_PROLOGUE(mpn_sec_tabselect)
+include_mpn(`x86_64/fastsse/sec_tabselect.asm')
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/bd1/sublsh1_n.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/bd1/sublsh1_n.asm
new file mode 100644
index 00000000000..4ba673d15a0
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/bd1/sublsh1_n.asm
@@ -0,0 +1,37 @@
+dnl AMD64 mpn_sublsh1_n
+
+dnl Copyright 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')
+
+ABI_SUPPORT(DOS64)
+ABI_SUPPORT(STD64)
+
+MULFUNC_PROLOGUE(mpn_sublsh1_n mpn_sublsh1_nc)
+include_mpn(`x86_64/atom/sublsh1_n.asm')
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/bd2/gmp-mparam.h b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/bd2/gmp-mparam.h
new file mode 100644
index 00000000000..16f25c4c7bb
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/bd2/gmp-mparam.h
@@ -0,0 +1,237 @@
+/* AMD bd2 gmp-mparam.h -- Compiler/machine parameter header file.
+
+Copyright 1991, 1993, 1994, 2000-2010, 2012, 2014 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
+
+/* 3200 MHz Piledriver Vishera */
+/* FFT tuning limit = 40000000 */
+/* Generated by tuneup.c, 2014-03-12, 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 4
+#define MOD_1U_TO_MOD_1_1_THRESHOLD 4
+#define MOD_1_1_TO_MOD_1_2_THRESHOLD 17
+#define MOD_1_2_TO_MOD_1_4_THRESHOLD 34
+#define PREINV_MOD_1_TO_MOD_1_THRESHOLD 10
+#define USE_PREINV_DIVREM_1 1 /* native */
+#define DIV_QR_1_NORM_THRESHOLD 2
+#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 21
+
+#define MUL_TOOM22_THRESHOLD 16
+#define MUL_TOOM33_THRESHOLD 54
+#define MUL_TOOM44_THRESHOLD 154
+#define MUL_TOOM6H_THRESHOLD 274
+#define MUL_TOOM8H_THRESHOLD 454
+
+#define MUL_TOOM32_TO_TOOM43_THRESHOLD 97
+#define MUL_TOOM32_TO_TOOM53_THRESHOLD 114
+#define MUL_TOOM42_TO_TOOM53_THRESHOLD 105
+#define MUL_TOOM42_TO_TOOM63_THRESHOLD 105
+#define MUL_TOOM43_TO_TOOM54_THRESHOLD 147
+
+#define SQR_BASECASE_THRESHOLD 0 /* always (native) */
+#define SQR_TOOM2_THRESHOLD 22
+#define SQR_TOOM3_THRESHOLD 81
+#define SQR_TOOM4_THRESHOLD 218
+#define SQR_TOOM6_THRESHOLD 303
+#define SQR_TOOM8_THRESHOLD 430
+
+#define MULMID_TOOM42_THRESHOLD 20
+
+#define MULMOD_BNM1_THRESHOLD 12
+#define SQRMOD_BNM1_THRESHOLD 13
+
+#define MUL_FFT_MODF_THRESHOLD 376 /* k = 5 */
+#define MUL_FFT_TABLE3 \
+ { { 376, 5}, { 19, 6}, { 10, 5}, { 21, 6}, \
+ { 11, 5}, { 23, 6}, { 21, 7}, { 11, 6}, \
+ { 23, 7}, { 13, 6}, { 27, 7}, { 21, 8}, \
+ { 11, 7}, { 25, 8}, { 13, 7}, { 27, 8}, \
+ { 15, 7}, { 32, 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}, { 39,10}, \
+ { 23, 9}, { 51,11}, { 15,10}, { 31, 9}, \
+ { 71,10}, { 39, 9}, { 83,10}, { 47, 9}, \
+ { 99,10}, { 55,11}, { 31,10}, { 79,11}, \
+ { 47,10}, { 95,12}, { 31,11}, { 63,10}, \
+ { 135, 6}, { 2175, 7}, { 1151, 9}, { 303,10}, \
+ { 159, 9}, { 319, 8}, { 639, 9}, { 335,11}, \
+ { 95,10}, { 191,11}, { 111,12}, { 63,11}, \
+ { 127,10}, { 255,11}, { 143,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}, { 351,12}, \
+ { 191,11}, { 383,10}, { 767,11}, { 415,12}, \
+ { 223,11}, { 447,13}, { 127,12}, { 255,11}, \
+ { 511,12}, { 287,11}, { 575,10}, { 1151,12}, \
+ { 319,11}, { 639,10}, { 1279,12}, { 351,13}, \
+ { 191,12}, { 383,11}, { 767,12}, { 415,10}, \
+ { 1663,12}, { 447,14}, { 127,13}, { 255,12}, \
+ { 511,11}, { 1023,12}, { 543,11}, { 1087,10}, \
+ { 2175,12}, { 575,11}, { 1151,12}, { 607,13}, \
+ { 319,12}, { 639,11}, { 1279,12}, { 671,11}, \
+ { 1343,10}, { 2687,12}, { 703,11}, { 1407,10}, \
+ { 2815,12}, { 735,13}, { 383,12}, { 767,11}, \
+ { 1599,12}, { 831,11}, { 1663,13}, { 447,12}, \
+ { 895,11}, { 1791,14}, { 255,13}, { 511,12}, \
+ { 1023,11}, { 2047,12}, { 1087,11}, { 2175,13}, \
+ { 575,12}, { 1151,11}, { 2303,12}, { 1215,11}, \
+ { 2431,10}, { 4863,13}, { 639,12}, { 1279,11}, \
+ { 2559,12}, { 1343,11}, { 2687,13}, { 703,12}, \
+ { 1407,11}, { 2815,14}, { 383,13}, { 767,12}, \
+ { 1599,13}, { 831,12}, { 1663,13}, { 895,12}, \
+ { 1791,15}, { 255,14}, { 511,13}, { 1023,12}, \
+ { 2047,13}, { 1087,12}, { 2175,13}, { 1151,12}, \
+ { 2303,13}, { 1215,12}, { 2431,11}, { 4863,14}, \
+ { 639,13}, { 1343,12}, { 2687,13}, { 1407,12}, \
+ { 2815,13}, { 1471,12}, { 2943,11}, { 5887,14}, \
+ { 767,13}, { 1599,12}, { 3199,13}, { 1727,14}, \
+ { 895,13}, { 1791,12}, { 3583,13}, { 1919,12}, \
+ { 3839,11}, { 7679,15}, { 511,14}, { 1023,13}, \
+ { 2175,14}, { 1151,13}, { 2431,12}, { 4863,14}, \
+ { 1279,13}, { 2687,14}, { 1407,13}, { 2943,12}, \
+ { 5887,15}, { 767,14}, { 1535,13}, { 3199,14}, \
+ { 1663,13}, { 3455,12}, { 6911,14}, { 1791,13}, \
+ { 3583,14}, { 1919,13}, { 3839,12}, { 7679,16}, \
+ { 511,15}, { 1023,14}, { 2175,13}, { 4479,14}, \
+ { 2303,13}, { 4607,14}, { 2431,13}, { 4863,15}, \
+ { 32768,16}, { 65536,17}, { 131072,18}, { 262144,19}, \
+ { 524288,20}, {1048576,21}, {2097152,22}, {4194304,23}, \
+ {8388608,24} }
+#define MUL_FFT_TABLE3_SIZE 225
+#define MUL_FFT_THRESHOLD 3712
+
+#define SQR_FFT_MODF_THRESHOLD 344 /* k = 5 */
+#define SQR_FFT_TABLE3 \
+ { { 344, 5}, { 11, 4}, { 23, 5}, { 19, 6}, \
+ { 10, 5}, { 21, 6}, { 21, 7}, { 11, 6}, \
+ { 25, 7}, { 13, 6}, { 27, 7}, { 17, 6}, \
+ { 35, 8}, { 9, 7}, { 21, 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}, { 39, 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}, { 79,11}, { 47,10}, { 95,12}, \
+ { 31,11}, { 63,10}, { 127, 9}, { 255,10}, \
+ { 135,11}, { 95,10}, { 191, 6}, { 3199, 7}, \
+ { 1727, 9}, { 447,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,11}, { 207,13}, \
+ { 63,12}, { 127,11}, { 255,10}, { 511,11}, \
+ { 271,10}, { 543,11}, { 287,10}, { 575,11}, \
+ { 351,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,12}, { 319,10}, \
+ { 1279,12}, { 351,13}, { 191,12}, { 383,11}, \
+ { 767,12}, { 415,11}, { 831,12}, { 447,11}, \
+ { 895,14}, { 127,13}, { 255,12}, { 511,11}, \
+ { 1023,12}, { 543,11}, { 1087,10}, { 2175,12}, \
+ { 575,13}, { 319,11}, { 1279,12}, { 671,11}, \
+ { 1343,12}, { 703,11}, { 1407,13}, { 383,12}, \
+ { 767,11}, { 1535,12}, { 799,11}, { 1599,12}, \
+ { 831,11}, { 1663,13}, { 447,12}, { 895,14}, \
+ { 255,13}, { 511,12}, { 1087,11}, { 2175,13}, \
+ { 575,11}, { 2303,12}, { 1215,11}, { 2431,10}, \
+ { 4863,13}, { 639,12}, { 1343,11}, { 2687,13}, \
+ { 703,12}, { 1407,14}, { 383,13}, { 767,12}, \
+ { 1599,13}, { 831,12}, { 1727,11}, { 3455,13}, \
+ { 895,15}, { 255,14}, { 511,13}, { 1087,12}, \
+ { 2239,11}, { 4479,12}, { 2303,13}, { 1215,12}, \
+ { 2431,11}, { 4863,14}, { 639,13}, { 1279,12}, \
+ { 2559,13}, { 1343,12}, { 2687,13}, { 1407,12}, \
+ { 2815,13}, { 1471,12}, { 2943,11}, { 5887,14}, \
+ { 767,13}, { 1599,12}, { 3199,13}, { 1727,14}, \
+ { 895,13}, { 1791,12}, { 3583,13}, { 1919,12}, \
+ { 3839,15}, { 511,14}, { 1023,13}, { 2431,12}, \
+ { 4863,14}, { 1279,13}, { 2687,14}, { 1407,13}, \
+ { 2943,12}, { 5887,11}, { 11775,15}, { 767,14}, \
+ { 1535,13}, { 3199,14}, { 1663,13}, { 3455,12}, \
+ { 6911,14}, { 1791,13}, { 3583,14}, { 1919,13}, \
+ { 3839,16}, { 511,15}, { 1023,14}, { 2175,13}, \
+ { 4479,14}, { 2303,13}, { 4607,14}, { 2431,13}, \
+ { 4863,15}, { 32768,16}, { 65536,17}, { 131072,18}, \
+ { 262144,19}, { 524288,20}, {1048576,21}, {2097152,22}, \
+ {4194304,23}, {8388608,24} }
+#define SQR_FFT_TABLE3_SIZE 214
+#define SQR_FFT_THRESHOLD 3264
+
+#define MULLO_BASECASE_THRESHOLD 0 /* always */
+#define MULLO_DC_THRESHOLD 37
+#define MULLO_MUL_N_THRESHOLD 8397
+
+#define DC_DIV_QR_THRESHOLD 42
+#define DC_DIVAPPR_Q_THRESHOLD 173
+#define DC_BDIV_QR_THRESHOLD 42
+#define DC_BDIV_Q_THRESHOLD 77
+
+#define INV_MULMOD_BNM1_THRESHOLD 30
+#define INV_NEWTON_THRESHOLD 202
+#define INV_APPR_THRESHOLD 172
+
+#define BINV_NEWTON_THRESHOLD 238
+#define REDC_1_TO_REDC_2_THRESHOLD 44
+#define REDC_2_TO_REDC_N_THRESHOLD 0 /* always */
+
+#define MU_DIV_QR_THRESHOLD 1308
+#define MU_DIVAPPR_Q_THRESHOLD 1334
+#define MUPI_DIV_QR_THRESHOLD 85
+#define MU_BDIV_QR_THRESHOLD 1142
+#define MU_BDIV_Q_THRESHOLD 1308
+
+#define POWM_SEC_TABLE 1,16,257,452,1099,2079
+
+#define MATRIX22_STRASSEN_THRESHOLD 14
+#define HGCD_THRESHOLD 110
+#define HGCD_APPR_THRESHOLD 96
+#define HGCD_REDUCE_THRESHOLD 2479
+#define GCD_DC_THRESHOLD 372
+#define GCDEXT_DC_THRESHOLD 293
+#define JACOBI_BASE_METHOD 4
+
+#define GET_STR_DC_THRESHOLD 12
+#define GET_STR_PRECOMPUTE_THRESHOLD 20
+#define SET_STR_DC_THRESHOLD 204
+#define SET_STR_PRECOMPUTE_THRESHOLD 1160
+
+#define FAC_DSC_THRESHOLD 166
+#define FAC_ODD_THRESHOLD 24
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/bdiv_dbm1c.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/bdiv_dbm1c.asm
new file mode 100644
index 00000000000..a53bd52beb3
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/bdiv_dbm1c.asm
@@ -0,0 +1,106 @@
+dnl x86_64 mpn_bdiv_dbm1.
+
+dnl Copyright 2008, 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/limb
+C AMD K8,K9 2.25
+C AMD K10 2.25
+C Intel P4 12.5
+C Intel core2 4
+C Intel NHM 3.75
+C Intel SBR 3.6
+C Intel atom 20
+C VIA nano 4
+
+C TODO
+C * Optimise feed-in code.
+
+C INPUT PARAMETERS
+define(`qp', `%rdi')
+define(`up', `%rsi')
+define(`n_param', `%rdx')
+define(`bd', `%rcx')
+define(`cy', `%r8')
+
+define(`n', `%r9')
+
+ABI_SUPPORT(DOS64)
+ABI_SUPPORT(STD64)
+
+ASM_START()
+ TEXT
+ ALIGN(16)
+PROLOGUE(mpn_bdiv_dbm1c)
+ FUNC_ENTRY(4)
+IFDOS(` mov 56(%rsp), %r8 ')
+ mov (up), %rax
+ mov n_param, n
+ mov R32(n_param), R32(%r11)
+ mul bd
+ lea (up,n,8), up
+ lea (qp,n,8), qp
+ neg n
+ and $3, R32(%r11)
+ jz L(lo0)
+ lea -4(n,%r11), n
+ cmp $2, R32(%r11)
+ jc L(lo1)
+ jz L(lo2)
+ jmp L(lo3)
+
+ ALIGN(16)
+L(top): mov (up,n,8), %rax
+ mul bd
+L(lo0): sub %rax, %r8
+ mov %r8, (qp,n,8)
+ sbb %rdx, %r8
+ mov 8(up,n,8), %rax
+ mul bd
+L(lo3): sub %rax, %r8
+ mov %r8, 8(qp,n,8)
+ sbb %rdx, %r8
+ mov 16(up,n,8), %rax
+ mul bd
+L(lo2): sub %rax, %r8
+ mov %r8, 16(qp,n,8)
+ sbb %rdx, %r8
+ mov 24(up,n,8), %rax
+ mul bd
+L(lo1): sub %rax, %r8
+ mov %r8, 24(qp,n,8)
+ sbb %rdx, %r8
+ add $4, n
+ jnz L(top)
+
+ mov %r8, %rax
+ FUNC_EXIT()
+ ret
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/bdiv_q_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/bdiv_q_1.asm
new file mode 100644
index 00000000000..02eacbe6a8b
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/bdiv_q_1.asm
@@ -0,0 +1,167 @@
+dnl AMD64 mpn_bdiv_q_1, mpn_pi1_bdiv_q_1 -- schoolbook Hensel division by
+dnl 1-limb divisor, returning quotient only.
+
+dnl Copyright 2001, 2002, 2004-2006, 2009, 2011, 2012 Free Software
+dnl 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 AMD K8,K9 10
+C AMD K10 10
+C Intel P4 33
+C Intel core2 13.25
+C Intel corei 14
+C Intel atom 42
+C VIA nano ?
+
+
+C INPUT PARAMETERS
+define(`rp', `%rdi')
+define(`up', `%rsi')
+define(`n', `%rdx')
+define(`d', `%rcx')
+define(`di', `%r8') C just mpn_pi1_bdiv_q_1
+define(`ncnt', `%r9') C just mpn_pi1_bdiv_q_1
+
+ABI_SUPPORT(DOS64)
+ABI_SUPPORT(STD64)
+
+ASM_START()
+ TEXT
+ ALIGN(16)
+PROLOGUE(mpn_bdiv_q_1)
+ FUNC_ENTRY(4)
+ push %rbx
+
+ mov %rcx, %rax
+ xor R32(%rcx), R32(%rcx) C ncnt count
+ mov %rdx, %r10
+
+ bt $0, R32(%rax)
+ jnc L(evn) C skip bsfq unless divisor is even
+
+L(odd): mov %rax, %rbx
+ shr R32(%rax)
+ and $127, R32(%rax) C d/2, 7 bits
+
+ LEA( binvert_limb_table, %rdx)
+
+ movzbl (%rdx,%rax), R32(%rax) C inv 8 bits
+
+ mov %rbx, %r11 C d without twos
+
+ lea (%rax,%rax), R32(%rdx) C 2*inv
+ imul R32(%rax), R32(%rax) C inv*inv
+ imul R32(%rbx), R32(%rax) C inv*inv*d
+ sub R32(%rax), R32(%rdx) C inv = 2*inv - inv*inv*d, 16 bits
+
+ lea (%rdx,%rdx), R32(%rax) C 2*inv
+ imul R32(%rdx), R32(%rdx) C inv*inv
+ imul R32(%rbx), R32(%rdx) C inv*inv*d
+ sub R32(%rdx), R32(%rax) C inv = 2*inv - inv*inv*d, 32 bits
+
+ lea (%rax,%rax), %r8 C 2*inv
+ imul %rax, %rax C inv*inv
+ imul %rbx, %rax C inv*inv*d
+ sub %rax, %r8 C inv = 2*inv - inv*inv*d, 64 bits
+
+ jmp L(com)
+
+L(evn): bsf %rax, %rcx
+ shr R8(%rcx), %rax
+ jmp L(odd)
+EPILOGUE()
+
+PROLOGUE(mpn_pi1_bdiv_q_1)
+ FUNC_ENTRY(4)
+IFDOS(` mov 56(%rsp), %r8 ')
+IFDOS(` mov 64(%rsp), %r9 ')
+ push %rbx
+
+ mov %rcx, %r11 C d
+ mov %rdx, %r10 C n
+ mov %r9, %rcx C ncnt
+
+L(com): mov (up), %rax C up[0]
+
+ dec %r10
+ jz L(one)
+
+ mov 8(up), %rdx C up[1]
+ lea (up,%r10,8), up C up end
+ lea (rp,%r10,8), rp C rp end
+ neg %r10 C -n
+
+ shrd R8(%rcx), %rdx, %rax
+
+ xor R32(%rbx), R32(%rbx)
+ jmp L(ent)
+
+ ALIGN(8)
+L(top):
+ C rax q
+ C rbx carry bit, 0 or 1
+ C rcx ncnt
+ C rdx
+ C r10 counter, limbs, negative
+
+ mul %r11 C carry limb in rdx
+ mov (up,%r10,8), %rax
+ mov 8(up,%r10,8), %r9
+ shrd R8(%rcx), %r9, %rax
+ nop
+ sub %rbx, %rax C apply carry bit
+ setc R8(%rbx)
+ sub %rdx, %rax C apply carry limb
+ adc $0, %rbx
+L(ent): imul %r8, %rax
+ mov %rax, (rp,%r10,8)
+ inc %r10
+ jnz L(top)
+
+ mul %r11 C carry limb in rdx
+ mov (up), %rax C up high limb
+ shr R8(%rcx), %rax
+ sub %rbx, %rax C apply carry bit
+ sub %rdx, %rax C apply carry limb
+ imul %r8, %rax
+ mov %rax, (rp)
+ pop %rbx
+ FUNC_EXIT()
+ ret
+
+L(one): shr R8(%rcx), %rax
+ imul %r8, %rax
+ mov %rax, (rp)
+ pop %rbx
+ FUNC_EXIT()
+ ret
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/bobcat/aors_n.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/bobcat/aors_n.asm
new file mode 100644
index 00000000000..22287b85589
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/bobcat/aors_n.asm
@@ -0,0 +1,150 @@
+dnl AMD64 mpn_add_n, mpn_sub_n optimised for bobcat.
+
+dnl Copyright 2003-2005, 2007, 2008, 2010-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/limb
+C AMD K8,K9
+C AMD K10
+C AMD bd1
+C AMD bobcat 2.28
+C Intel P4
+C Intel core2
+C Intel NHM
+C Intel SBR
+C Intel IBR
+C Intel atom
+C VIA nano
+
+C The loop of this code is the result of running a code generation and
+C optimization tool suite written by David Harvey and Torbjorn Granlund.
+
+C INPUT PARAMETERS
+define(`rp', `%rdi') C rcx
+define(`up', `%rsi') C rdx
+define(`vp', `%rdx') C r8
+define(`n', `%rcx') C r9
+define(`cy', `%r8') C rsp+40 (mpn_add_nc and mpn_sub_nc)
+
+ifdef(`OPERATION_add_n', `
+ define(ADCSBB, adc)
+ define(func, mpn_add_n)
+ define(func_nc, mpn_add_nc)')
+ifdef(`OPERATION_sub_n', `
+ define(ADCSBB, sbb)
+ define(func, mpn_sub_n)
+ define(func_nc, mpn_sub_nc)')
+
+MULFUNC_PROLOGUE(mpn_add_n mpn_add_nc mpn_sub_n mpn_sub_nc)
+
+ABI_SUPPORT(DOS64)
+ABI_SUPPORT(STD64)
+
+ASM_START()
+ TEXT
+ ALIGN(16)
+PROLOGUE(func)
+ FUNC_ENTRY(4)
+ xor %r8, %r8
+L(ent): test $1, R8(n)
+ jnz L(bx1)
+
+L(bx0): test $2, R8(n)
+ jnz L(b10)
+
+L(b00): shr $2, n
+ neg %r8
+ mov $3, R32(%rax)
+ mov (up), %r10
+ mov 8(up), %r11
+ jmp L(lo0)
+
+L(b10): shr $2, n
+ neg %r8
+ mov $1, R32(%rax)
+ mov (up), %r8
+ mov 8(up), %r9
+ jrcxz L(cj2)
+ jmp L(top)
+
+L(bx1): test $2, R8(n)
+ jnz L(b11)
+
+L(b01): shr $2, n
+ neg %r8
+ mov $0, R32(%rax)
+ mov (up), %r9
+ jrcxz L(cj1)
+ mov 8(up), %r10
+ jmp L(lo1)
+
+ ALIGN(8)
+L(b11): inc n
+ shr $2, n
+ neg %r8
+ mov $2, R32(%rax)
+ mov (up), %r11
+ jmp L(lo3)
+
+ ALIGN(4)
+L(top): mov 8(up,%rax,8), %r10
+ ADCSBB -8(vp,%rax,8), %r8
+ mov %r8, -8(rp,%rax,8)
+L(lo1): mov 16(up,%rax,8), %r11
+ ADCSBB (vp,%rax,8), %r9
+ lea 4(%rax), %rax
+ mov %r9, -32(rp,%rax,8)
+L(lo0): ADCSBB -24(vp,%rax,8), %r10
+ mov %r10, -24(rp,%rax,8)
+L(lo3): ADCSBB -16(vp,%rax,8), %r11
+ dec n
+ mov -8(up,%rax,8), %r8
+ mov %r11, -16(rp,%rax,8)
+L(lo2): mov (up,%rax,8), %r9
+ jnz L(top)
+
+L(cj2): ADCSBB -8(vp,%rax,8), %r8
+ mov %r8, -8(rp,%rax,8)
+L(cj1): ADCSBB (vp,%rax,8), %r9
+ mov %r9, (rp,%rax,8)
+
+ mov $0, R32(%rax)
+ adc $0, R32(%rax)
+
+ FUNC_EXIT()
+ ret
+EPILOGUE()
+
+ ALIGN(16)
+PROLOGUE(func_nc)
+ FUNC_ENTRY(4)
+IFDOS(` mov 56(%rsp), %r8 ')
+ jmp L(ent)
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/bobcat/aorsmul_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/bobcat/aorsmul_1.asm
new file mode 100644
index 00000000000..415a17cb7ff
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/bobcat/aorsmul_1.asm
@@ -0,0 +1,183 @@
+dnl AMD64 mpn_addmul_1 and mpn_submul_1 optimised for AMD bobcat.
+
+dnl Copyright 2003-2005, 2007, 2008, 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/limb
+C AMD K8,K9 4.5
+C AMD K10 4.5
+C AMD bd1 4.75
+C AMD bobcat 5
+C Intel P4 17.7
+C Intel core2 5.5
+C Intel NHM 5.43
+C Intel SBR 3.92
+C Intel atom 23
+C VIA nano 5.63
+
+ABI_SUPPORT(DOS64)
+ABI_SUPPORT(STD64)
+
+ifdef(`OPERATION_addmul_1',`
+ define(`ADDSUB', `add')
+ define(`func', `mpn_addmul_1')
+')
+ifdef(`OPERATION_submul_1',`
+ define(`ADDSUB', `sub')
+ define(`func', `mpn_submul_1')
+')
+
+MULFUNC_PROLOGUE(mpn_addmul_1 mpn_submul_1)
+
+C Standard parameters
+define(`rp', `%rdi')
+define(`up', `%rsi')
+define(`n_param', `%rdx')
+define(`v0', `%rcx')
+C Standard allocations
+define(`n', `%rbx')
+define(`w0', `%r8')
+define(`w1', `%r9')
+define(`w2', `%r10')
+define(`w3', `%r11')
+
+C DOS64 parameters
+IFDOS(` define(`rp', `%rcx') ') dnl
+IFDOS(` define(`up', `%rsi') ') dnl
+IFDOS(` define(`n_param', `%r8') ') dnl
+IFDOS(` define(`v0', `%r9') ') dnl
+C DOS64 allocations
+IFDOS(` define(`n', `%rbx') ') dnl
+IFDOS(` define(`w0', `%r8') ') dnl
+IFDOS(` define(`w1', `%rdi') ') dnl
+IFDOS(` define(`w2', `%r10') ') dnl
+IFDOS(` define(`w3', `%r11') ') dnl
+
+ASM_START()
+ TEXT
+ ALIGN(16)
+PROLOGUE(func)
+IFDOS(` push %rsi ')
+IFDOS(` push %rdi ')
+IFDOS(` mov %rdx, %rsi ')
+
+ push %rbx
+ mov (up), %rax
+
+ lea -16(rp,n_param,8), rp
+ lea -16(up,n_param,8), up
+
+ mov n_param, n
+ and $3, R32(n_param)
+ jz L(b0)
+ cmp $2, R32(n_param)
+ ja L(b3)
+ jz L(b2)
+
+L(b1): mul v0
+ cmp $1, n
+ jz L(n1)
+ mov %rax, w2
+ mov %rdx, w3
+ neg n
+ add $3, n
+ jmp L(L1)
+L(n1): ADDSUB %rax, 8(rp)
+ adc $0, %rdx
+ mov %rdx, %rax
+ pop %rbx
+IFDOS(` pop %rdi ')
+IFDOS(` pop %rsi ')
+ ret
+
+L(b3): mul v0
+ mov %rax, w2
+ mov %rdx, w3
+ neg n
+ inc n
+ jmp L(L3)
+
+L(b0): mul v0
+ mov %rax, w0
+ mov %rdx, w1
+ neg n
+ add $2, n
+ jmp L(L0)
+
+L(b2): mul v0
+ mov %rax, w0
+ mov %rdx, w1
+ neg n
+ jmp L(L2)
+
+ ALIGN(16)
+L(top): ADDSUB w0, -16(rp,n,8)
+ adc w1, w2
+ adc $0, w3
+L(L1): mov 0(up,n,8), %rax
+ mul v0
+ mov %rax, w0
+ mov %rdx, w1
+ ADDSUB w2, -8(rp,n,8)
+ adc w3, w0
+ adc $0, w1
+L(L0): mov 8(up,n,8), %rax
+ mul v0
+ mov %rax, w2
+ mov %rdx, w3
+ ADDSUB w0, 0(rp,n,8)
+ adc w1, w2
+ adc $0, w3
+L(L3): mov 16(up,n,8), %rax
+ mul v0
+ mov %rax, w0
+ mov %rdx, w1
+ ADDSUB w2, 8(rp,n,8)
+ adc w3, w0
+ adc $0, w1
+L(L2): mov 24(up,n,8), %rax
+ mul v0
+ mov %rax, w2
+ mov %rdx, w3
+ add $4, n
+ js L(top)
+
+L(end): ADDSUB w0, (rp)
+ adc w1, w2
+ adc $0, w3
+ ADDSUB w2, 8(rp)
+ adc $0, w3
+ mov w3, %rax
+
+ pop %rbx
+IFDOS(` pop %rdi ')
+IFDOS(` pop %rsi ')
+ ret
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/bobcat/copyd.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/bobcat/copyd.asm
new file mode 100644
index 00000000000..877714e903c
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/bobcat/copyd.asm
@@ -0,0 +1,91 @@
+dnl AMD64 mpn_copyd optimised for AMD bobcat.
+
+dnl Copyright 2003, 2005, 2007, 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/limb
+C AMD K8,K9 1
+C AMD K10 1-2 (alignment fluctuations)
+C AMD bd1 ?
+C AMD bobcat 1.5
+C Intel P4 2.8
+C Intel core2 1
+C Intel NHM 1-1.25
+C Intel SBR 1
+C Intel atom 2.87
+C VIA nano 2
+
+C INPUT PARAMETERS
+C rp rdi
+C up rsi
+C n rdx
+
+define(`rp',`%rdi')
+define(`up',`%rsi')
+define(`n',`%rdx')
+
+ABI_SUPPORT(DOS64)
+ABI_SUPPORT(STD64)
+
+ASM_START()
+ TEXT
+ ALIGN(16)
+PROLOGUE(mpn_copyd)
+ FUNC_ENTRY(3)
+ sub $4, n
+ jl L(end)
+ ALIGN(16)
+L(top): mov 24(up,n,8), %r8
+ mov %r8, 24(rp,n,8)
+ mov 16(up,n,8), %r8
+ mov %r8, 16(rp,n,8)
+ mov 8(up,n,8), %r8
+ mov %r8, 8(rp,n,8)
+ mov (up,n,8), %r8
+ mov %r8, (rp,n,8)
+L(ent): sub $4, n
+ jge L(top)
+
+L(end): cmp $-4, R32(n)
+ jz L(ret)
+ mov 24(up,n,8), %r8
+ mov %r8, 24(rp,n,8)
+ cmp $-3, R32(n)
+ jz L(ret)
+ mov 16(up,n,8), %r8
+ mov %r8, 16(rp,n,8)
+ cmp $-2, R32(n)
+ jz L(ret)
+ mov 8(up,n,8), %r8
+ mov %r8, 8(rp,n,8)
+
+L(ret): FUNC_EXIT()
+ ret
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/bobcat/copyi.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/bobcat/copyi.asm
new file mode 100644
index 00000000000..ee0f578652b
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/bobcat/copyi.asm
@@ -0,0 +1,94 @@
+dnl AMD64 mpn_copyi optimised for AMD bobcat.
+
+dnl Copyright 2003, 2005, 2007, 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/limb
+C AMD K8,K9 1
+C AMD K10 1-2 (alignment fluctuations)
+C AMD bd1 ?
+C AMD bobcat 1.5
+C Intel P4 2.8
+C Intel core2 1
+C Intel NHM 1-1.25
+C Intel SBR 1
+C Intel atom 2.87
+C VIA nano 2
+
+C INPUT PARAMETERS
+C rp rdi
+C up rsi
+C n rdx
+
+define(`rp',`%rdi')
+define(`up',`%rsi')
+define(`n',`%rdx')
+
+ABI_SUPPORT(DOS64)
+ABI_SUPPORT(STD64)
+
+ASM_START()
+ TEXT
+ ALIGN(16)
+PROLOGUE(mpn_copyi)
+ FUNC_ENTRY(3)
+ lea -32(up,n,8), up
+ lea -32(rp,n,8), rp
+ neg n
+ add $4, n
+ jg L(end)
+ ALIGN(16)
+L(top): mov (up,n,8), %r8
+ mov %r8, (rp,n,8)
+ mov 8(up,n,8), %r8
+ mov %r8, 8(rp,n,8)
+ mov 16(up,n,8), %r8
+ mov %r8, 16(rp,n,8)
+ mov 24(up,n,8), %r8
+ mov %r8, 24(rp,n,8)
+L(ent): add $4, n
+ jle L(top)
+
+L(end): cmp $4, R32(n)
+ jz L(ret)
+ mov (up,n,8), %r8
+ mov %r8, (rp,n,8)
+ cmp $3, R32(n)
+ jz L(ret)
+ mov 8(up,n,8), %r8
+ mov %r8, 8(rp,n,8)
+ cmp $2, R32(n)
+ jz L(ret)
+ mov 16(up,n,8), %r8
+ mov %r8, 16(rp,n,8)
+
+L(ret): FUNC_EXIT()
+ ret
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/bobcat/gmp-mparam.h b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/bobcat/gmp-mparam.h
new file mode 100644
index 00000000000..de4c4e4528c
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/bobcat/gmp-mparam.h
@@ -0,0 +1,208 @@
+/* AMD Bobcat gmp-mparam.h -- Compiler/machine parameter header file.
+
+Copyright 1991, 1993, 1994, 2000-2012, 2014 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
+
+#undef HAVE_NATIVE_mpn_mul_2
+#undef HAVE_NATIVE_mpn_addmul_2
+
+/* 1600 MHz AMD Bobcat Zacate E-350 */
+/* FFT tuning limit = 25000000 */
+/* Generated by tuneup.c, 2014-03-12, gcc 4.5 */
+
+#define MOD_1_NORM_THRESHOLD 0 /* always */
+#define MOD_1_UNNORM_THRESHOLD 0 /* always */
+#define MOD_1N_TO_MOD_1_1_THRESHOLD 4
+#define MOD_1U_TO_MOD_1_1_THRESHOLD 3
+#define MOD_1_1_TO_MOD_1_2_THRESHOLD 32
+#define MOD_1_2_TO_MOD_1_4_THRESHOLD 43
+#define PREINV_MOD_1_TO_MOD_1_THRESHOLD 10
+#define USE_PREINV_DIVREM_1 1 /* native */
+#define DIV_QR_1_NORM_THRESHOLD 1
+#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 17
+
+#define MUL_TOOM22_THRESHOLD 24
+#define MUL_TOOM33_THRESHOLD 36
+#define MUL_TOOM44_THRESHOLD 268
+#define MUL_TOOM6H_THRESHOLD 396
+#define MUL_TOOM8H_THRESHOLD 517
+
+#define MUL_TOOM32_TO_TOOM43_THRESHOLD 69
+#define MUL_TOOM32_TO_TOOM53_THRESHOLD 195
+#define MUL_TOOM42_TO_TOOM53_THRESHOLD 181
+#define MUL_TOOM42_TO_TOOM63_THRESHOLD 72
+#define MUL_TOOM43_TO_TOOM54_THRESHOLD 103
+
+#define SQR_BASECASE_THRESHOLD 0 /* always (native) */
+#define SQR_TOOM2_THRESHOLD 26
+#define SQR_TOOM3_THRESHOLD 93
+#define SQR_TOOM4_THRESHOLD 375
+#define SQR_TOOM6_THRESHOLD 0 /* always */
+#define SQR_TOOM8_THRESHOLD 478
+
+#define MULMID_TOOM42_THRESHOLD 22
+
+#define MULMOD_BNM1_THRESHOLD 11
+#define SQRMOD_BNM1_THRESHOLD 13
+
+#define MUL_FFT_MODF_THRESHOLD 400 /* k = 5 */
+#define MUL_FFT_TABLE3 \
+ { { 400, 5}, { 17, 6}, { 9, 5}, { 19, 6}, \
+ { 10, 5}, { 21, 6}, { 11, 5}, { 23, 6}, \
+ { 20, 7}, { 11, 6}, { 23, 7}, { 21, 8}, \
+ { 11, 7}, { 24, 8}, { 13, 7}, { 27, 8}, \
+ { 15, 7}, { 31, 8}, { 17, 7}, { 36, 8}, \
+ { 19, 7}, { 39, 8}, { 21, 9}, { 11, 8}, \
+ { 23, 7}, { 47, 8}, { 27, 9}, { 15, 8}, \
+ { 37, 9}, { 19, 8}, { 43, 9}, { 23, 8}, \
+ { 49, 9}, { 27,10}, { 15, 9}, { 43,10}, \
+ { 23, 9}, { 55,11}, { 15,10}, { 31, 9}, \
+ { 67,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}, \
+ { 143,11}, { 79,10}, { 167,11}, { 95,10}, \
+ { 191, 9}, { 383,11}, { 111,12}, { 63,11}, \
+ { 127,10}, { 255, 9}, { 511,11}, { 143,10}, \
+ { 287,11}, { 159,10}, { 319,12}, { 95,11}, \
+ { 191,10}, { 383,11}, { 207,10}, { 415,13}, \
+ { 63,12}, { 127,11}, { 255,10}, { 511,11}, \
+ { 271,10}, { 543,11}, { 287,12}, { 159,11}, \
+ { 319,10}, { 639,11}, { 351,10}, { 703,11}, \
+ { 367,12}, { 191,11}, { 383,10}, { 767,11}, \
+ { 415,12}, { 223,11}, { 447,13}, { 127,12}, \
+ { 255,11}, { 543,12}, { 287,11}, { 607,12}, \
+ { 319,11}, { 639,12}, { 351,11}, { 703,13}, \
+ { 191,12}, { 383,11}, { 767,12}, { 415,11}, \
+ { 831,12}, { 447,14}, { 127,13}, { 255,12}, \
+ { 607,13}, { 319,12}, { 703,13}, { 383,12}, \
+ { 831,13}, { 447,12}, { 895,14}, { 255,13}, \
+ { 511,12}, { 1023,13}, { 575,12}, { 1151,13}, \
+ { 703,14}, { 383,13}, { 831,12}, { 1663,13}, \
+ { 895,15}, { 255,14}, { 511,13}, { 1087,12}, \
+ { 2175,13}, { 1151,14}, { 639,13}, { 1407,14}, \
+ { 767,13}, { 1663,14}, { 895,15}, { 511,14}, \
+ { 1023,13}, { 2175,14}, { 1151,13}, { 2431,14}, \
+ { 1279,13}, { 2559,14}, { 1407,15}, { 32768,16}, \
+ { 65536,17}, { 131072,18}, { 262144,19}, { 524288,20}, \
+ {1048576,21}, {2097152,22}, {4194304,23}, {8388608,24} }
+#define MUL_FFT_TABLE3_SIZE 156
+#define MUL_FFT_THRESHOLD 5504
+
+#define SQR_FFT_MODF_THRESHOLD 380 /* k = 5 */
+#define SQR_FFT_TABLE3 \
+ { { 380, 5}, { 17, 6}, { 9, 5}, { 19, 6}, \
+ { 10, 5}, { 21, 6}, { 11, 5}, { 23, 6}, \
+ { 12, 5}, { 25, 6}, { 21, 7}, { 11, 6}, \
+ { 25, 7}, { 13, 6}, { 27, 7}, { 25, 8}, \
+ { 13, 7}, { 27, 8}, { 15, 7}, { 31, 8}, \
+ { 17, 7}, { 35, 8}, { 19, 7}, { 39, 8}, \
+ { 27, 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,10}, { 31, 9}, { 71,10}, \
+ { 39, 9}, { 83,10}, { 47, 9}, { 99,10}, \
+ { 55,11}, { 31,10}, { 79,11}, { 47,10}, \
+ { 103,12}, { 31,11}, { 63,10}, { 127, 9}, \
+ { 255,10}, { 135, 9}, { 271,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,11}, { 159,10}, \
+ { 319,12}, { 95,11}, { 191,10}, { 383,11}, \
+ { 207,10}, { 415,13}, { 63,12}, { 127,11}, \
+ { 255,10}, { 511,11}, { 271,10}, { 575,11}, \
+ { 303,12}, { 159,11}, { 319,10}, { 639,11}, \
+ { 335,10}, { 671,11}, { 351,10}, { 703,11}, \
+ { 367,12}, { 191,11}, { 383,10}, { 767,11}, \
+ { 415,12}, { 223,11}, { 447,13}, { 127,12}, \
+ { 255,11}, { 543,12}, { 287,11}, { 607,12}, \
+ { 319,11}, { 671,12}, { 351,11}, { 703,13}, \
+ { 191,12}, { 383,11}, { 767,12}, { 415,11}, \
+ { 831,12}, { 479,14}, { 127,13}, { 255,12}, \
+ { 607,13}, { 319,12}, { 703,13}, { 383,12}, \
+ { 831,13}, { 447,12}, { 895,14}, { 255,13}, \
+ { 511,12}, { 1023,13}, { 575,12}, { 1151,13}, \
+ { 703,14}, { 383,13}, { 831,12}, { 1663,13}, \
+ { 895,15}, { 255,14}, { 511,13}, { 1087,12}, \
+ { 2175,13}, { 1151,14}, { 639,13}, { 1343,12}, \
+ { 2687,14}, { 767,13}, { 1599,12}, { 3199,13}, \
+ { 1663,14}, { 895,15}, { 511,14}, { 1023,13}, \
+ { 2175,14}, { 1151,13}, { 2431,14}, { 1279,13}, \
+ { 2687,15}, { 32768,16}, { 65536,17}, { 131072,18}, \
+ { 262144,19}, { 524288,20}, {1048576,21}, {2097152,22}, \
+ {4194304,23}, {8388608,24} }
+#define SQR_FFT_TABLE3_SIZE 162
+#define SQR_FFT_THRESHOLD 3712
+
+#define MULLO_BASECASE_THRESHOLD 0 /* always */
+#define MULLO_DC_THRESHOLD 26
+#define MULLO_MUL_N_THRESHOLD 10950
+
+#define DC_DIV_QR_THRESHOLD 63
+#define DC_DIVAPPR_Q_THRESHOLD 198
+#define DC_BDIV_QR_THRESHOLD 56
+#define DC_BDIV_Q_THRESHOLD 127
+
+#define INV_MULMOD_BNM1_THRESHOLD 46
+#define INV_NEWTON_THRESHOLD 236
+#define INV_APPR_THRESHOLD 204
+
+#define BINV_NEWTON_THRESHOLD 286
+#define REDC_1_TO_REDC_2_THRESHOLD 63
+#define REDC_2_TO_REDC_N_THRESHOLD 0 /* always */
+
+#define MU_DIV_QR_THRESHOLD 1499
+#define MU_DIVAPPR_Q_THRESHOLD 1499
+#define MUPI_DIV_QR_THRESHOLD 84
+#define MU_BDIV_QR_THRESHOLD 1334
+#define MU_BDIV_Q_THRESHOLD 1470
+
+#define POWM_SEC_TABLE 1,16,194,904,1167
+
+#define MATRIX22_STRASSEN_THRESHOLD 15
+#define HGCD_THRESHOLD 102
+#define HGCD_APPR_THRESHOLD 50
+#define HGCD_REDUCE_THRESHOLD 2681
+#define GCD_DC_THRESHOLD 416
+#define GCDEXT_DC_THRESHOLD 293
+#define JACOBI_BASE_METHOD 4
+
+#define GET_STR_DC_THRESHOLD 15
+#define GET_STR_PRECOMPUTE_THRESHOLD 26
+#define SET_STR_DC_THRESHOLD 248
+#define SET_STR_PRECOMPUTE_THRESHOLD 1160
+
+#define FAC_DSC_THRESHOLD 746
+#define FAC_ODD_THRESHOLD 44
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/bobcat/mul_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/bobcat/mul_1.asm
new file mode 100644
index 00000000000..cb58bef0b35
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/bobcat/mul_1.asm
@@ -0,0 +1,187 @@
+dnl AMD64 mpn_mul_1 optimised for AMD bobcat.
+
+dnl Copyright 2003-2005, 2007, 2008, 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/limb
+C AMD K8,K9 4.5
+C AMD K10 4.5
+C AMD bd1 4.62
+C AMD bobcat 5
+C Intel P4 14
+C Intel core2 4.5
+C Intel NHM 4.23
+C Intel SBR 3.0
+C Intel atom 21
+C VIA nano 4.94
+
+C The loop of this code is the result of running a code generation and
+C optimisation tool suite written by David Harvey and Torbjorn Granlund.
+
+ABI_SUPPORT(DOS64)
+ABI_SUPPORT(STD64)
+
+C Standard parameters
+define(`rp', `%rdi')
+define(`up', `%rsi')
+define(`n_param', `%rdx')
+define(`v0', `%rcx')
+define(`cy', `%r8')
+C Standard allocations
+define(`n', `%rbx')
+define(`w0', `%r8')
+define(`w1', `%r9')
+define(`w2', `%r10')
+define(`w3', `%r11')
+
+C DOS64 parameters
+IFDOS(` define(`rp', `%rcx') ') dnl
+IFDOS(` define(`up', `%rsi') ') dnl
+IFDOS(` define(`n_param', `%r8') ') dnl
+IFDOS(` define(`v0', `%r9') ') dnl
+IFDOS(` define(`cy', `64(%rsp)')') dnl
+C DOS64 allocations
+IFDOS(` define(`n', `%rbx') ') dnl
+IFDOS(` define(`w0', `%r8') ') dnl
+IFDOS(` define(`w1', `%rdi') ') dnl
+IFDOS(` define(`w2', `%r10') ') dnl
+IFDOS(` define(`w3', `%r11') ') dnl
+
+ASM_START()
+ TEXT
+ ALIGN(16)
+PROLOGUE(mpn_mul_1c)
+IFDOS(` push %rsi ')
+IFDOS(` push %rdi ')
+IFDOS(` mov %rdx, %rsi ')
+ mov cy, w2
+ jmp L(com)
+EPILOGUE()
+
+PROLOGUE(mpn_mul_1)
+IFDOS(` push %rsi ')
+IFDOS(` push %rdi ')
+IFDOS(` mov %rdx, %rsi ')
+ xor w2, w2
+L(com): push %rbx
+ mov (up), %rax
+
+ lea -16(rp,n_param,8), rp
+ lea -16(up,n_param,8), up
+
+ mov n_param, n
+ and $3, R32(n_param)
+ jz L(b0)
+ cmp $2, R32(n_param)
+ ja L(b3)
+ jz L(b2)
+
+L(b1): mul v0
+ cmp $1, n
+ jz L(n1)
+ neg n
+ add $3, n
+ add %rax, w2
+ mov %rdx, w3
+ jmp L(L1)
+L(n1): add %rax, w2
+ mov %rdx, %rax
+ mov w2, 8(rp)
+ adc $0, %rax
+ pop %rbx
+IFDOS(` pop %rdi ')
+IFDOS(` pop %rsi ')
+ ret
+
+L(b3): mul v0
+ neg n
+ inc n
+ add %rax, w2
+ mov %rdx, w3
+ jmp L(L3)
+
+L(b0): mul v0
+ mov %rax, w0
+ mov %rdx, w1
+ neg n
+ add $2, n
+ add w2, w0
+ jmp L(L0)
+
+L(b2): mul v0
+ mov %rax, w0
+ mov %rdx, w1
+ neg n
+ add w2, w0
+ jmp L(L2)
+
+ ALIGN(16)
+L(top): mov w0, -16(rp,n,8)
+ add w1, w2
+L(L1): adc $0, w3
+ mov 0(up,n,8), %rax
+ mul v0
+ mov %rax, w0
+ mov %rdx, w1
+ mov w2, -8(rp,n,8)
+ add w3, w0
+L(L0): adc $0, w1
+ mov 8(up,n,8), %rax
+ mul v0
+ mov %rax, w2
+ mov %rdx, w3
+ mov w0, 0(rp,n,8)
+ add w1, w2
+L(L3): adc $0, w3
+ mov 16(up,n,8), %rax
+ mul v0
+ mov %rax, w0
+ mov %rdx, w1
+ mov w2, 8(rp,n,8)
+ add w3, w0
+L(L2): adc $0, w1
+ mov 24(up,n,8), %rax
+ mul v0
+ mov %rax, w2
+ mov %rdx, w3
+ add $4, n
+ js L(top)
+
+L(end): mov w0, (rp)
+ add w1, w2
+ adc $0, w3
+ mov w2, 8(rp)
+ mov w3, %rax
+
+ pop %rbx
+IFDOS(` pop %rdi ')
+IFDOS(` pop %rsi ')
+ ret
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/bobcat/mul_basecase.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/bobcat/mul_basecase.asm
new file mode 100644
index 00000000000..e7d46bfcff6
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/bobcat/mul_basecase.asm
@@ -0,0 +1,486 @@
+dnl AMD64 mpn_mul_basecase optimised for AMD bobcat.
+
+dnl Copyright 2003-2005, 2007, 2008, 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/limb
+C AMD K8,K9 4.5
+C AMD K10 4.5
+C AMD bd1 4.75
+C AMD bobcat 5
+C Intel P4 17.7
+C Intel core2 5.5
+C Intel NHM 5.43
+C Intel SBR 3.92
+C Intel atom 23
+C VIA nano 5.63
+
+C This mul_basecase is based on mul_1 and addmul_1, since these both run at the
+C multiply insn bandwidth, without any apparent loop branch exit pipeline
+C replays experienced on K8. The structure is unusual: it falls into mul_1 in
+C the same way for all n, then it splits into 4 different wind-down blocks and
+C 4 separate addmul_1 loops.
+C
+C We have not tried using the same addmul_1 loops with a switch into feed-in
+C code, as we do in other basecase implementations. Doing that could save
+C substantial code volume, but would also probably add some overhead.
+
+C TODO
+C * Tune un < 3 code.
+C * Fix slowdown for un=vn=3 (67->71) compared to default code.
+C * This is 1263 bytes, compared to 1099 bytes for default code. Consider
+C combining addmul loops like that code. Tolerable slowdown?
+C * Lots of space could be saved by replacing the "switch" code by gradual
+C jumps out from mul_1 winddown code, perhaps with no added overhead.
+C * Are the ALIGN(16) really necessary? They add about 25 bytes of padding.
+
+ABI_SUPPORT(DOS64)
+ABI_SUPPORT(STD64)
+
+C Standard parameters
+define(`rp', `%rdi')
+define(`up', `%rsi')
+define(`un_param', `%rdx')
+define(`vp', `%rcx')
+define(`vn', `%r8')
+C Standard allocations
+define(`un', `%rbx')
+define(`w0', `%r10')
+define(`w1', `%r11')
+define(`w2', `%r12')
+define(`w3', `%r13')
+define(`n', `%rbp')
+define(`v0', `%r9')
+
+C Temp macro for allowing control over indexing.
+C Define to return $1 for more conservative ptr handling.
+define(`X',`$2')
+
+
+ASM_START()
+ TEXT
+ ALIGN(16)
+PROLOGUE(mpn_mul_basecase)
+ FUNC_ENTRY(4)
+IFDOS(` mov 56(%rsp), %r8d ')
+
+ mov (up), %rax
+ mov (vp), v0
+
+ cmp $2, un_param
+ ja L(ge3)
+ jz L(u2)
+
+ mul v0 C u0 x v0
+ mov %rax, (rp)
+ mov %rdx, 8(rp)
+ FUNC_EXIT()
+ ret
+
+L(u2): mul v0 C u0 x v0
+ mov %rax, (rp)
+ mov 8(up), %rax
+ mov %rdx, w0
+ mul v0
+ add %rax, w0
+ mov %rdx, w1
+ adc $0, w1
+ cmp $1, R32(vn)
+ jnz L(u2v2)
+ mov w0, 8(rp)
+ mov w1, 16(rp)
+ FUNC_EXIT()
+ ret
+
+L(u2v2):mov 8(vp), v0
+ mov (up), %rax
+ mul v0
+ add %rax, w0
+ mov w0, 8(rp)
+ mov %rdx, %r8 C CAUTION: r8 realloc
+ adc $0, %r8
+ mov 8(up), %rax
+ mul v0
+ add w1, %r8
+ adc $0, %rdx
+ add %r8, %rax
+ adc $0, %rdx
+ mov %rax, 16(rp)
+ mov %rdx, 24(rp)
+ FUNC_EXIT()
+ ret
+
+
+L(ge3): push %rbx
+ push %rbp
+ push %r12
+ push %r13
+
+ lea 8(vp), vp
+
+ lea -24(rp,un_param,8), rp
+ lea -24(up,un_param,8), up
+ xor R32(un), R32(un)
+ mov $2, R32(n)
+ sub un_param, un
+ sub un_param, n
+
+ mul v0
+ mov %rax, w2
+ mov %rdx, w3
+ jmp L(L3)
+
+ ALIGN(16)
+L(top): mov w0, -16(rp,n,8)
+ add w1, w2
+ adc $0, w3
+ mov (up,n,8), %rax
+ mul v0
+ mov %rax, w0
+ mov %rdx, w1
+ mov w2, -8(rp,n,8)
+ add w3, w0
+ adc $0, w1
+ mov 8(up,n,8), %rax
+ mul v0
+ mov %rax, w2
+ mov %rdx, w3
+ mov w0, (rp,n,8)
+ add w1, w2
+ adc $0, w3
+L(L3): mov 16(up,n,8), %rax
+ mul v0
+ mov %rax, w0
+ mov %rdx, w1
+ mov w2, 8(rp,n,8)
+ add w3, w0
+ adc $0, w1
+ mov 24(up,n,8), %rax
+ mul v0
+ mov %rax, w2
+ mov %rdx, w3
+ add $4, n
+ js L(top)
+
+ mov w0, -16(rp,n,8)
+ add w1, w2
+ adc $0, w3
+
+C Switch on n into right addmul_l loop
+ test n, n
+ jz L(r2)
+ cmp $2, R32(n)
+ ja L(r3)
+ jz L(r0)
+ jmp L(r1)
+
+
+L(r3): mov w2, X(-8(rp,n,8),16(rp))
+ mov w3, X((rp,n,8),24(rp))
+ add $2, un
+
+C outer loop(3)
+L(to3): dec vn
+ jz L(ret)
+ mov (vp), v0
+ mov 8(up,un,8), %rax
+ lea 8(vp), vp
+ lea 8(rp), rp
+ mov un, n
+ mul v0
+ mov %rax, w2
+ mov %rdx, w3
+ jmp L(al3)
+
+ ALIGN(16)
+L(ta3): add w0, -16(rp,n,8)
+ adc w1, w2
+ adc $0, w3
+ mov (up,n,8), %rax
+ mul v0
+ mov %rax, w0
+ mov %rdx, w1
+ add w2, -8(rp,n,8)
+ adc w3, w0
+ adc $0, w1
+ mov 8(up,n,8), %rax
+ mul v0
+ mov %rax, w2
+ mov %rdx, w3
+ add w0, (rp,n,8)
+ adc w1, w2
+ adc $0, w3
+L(al3): mov 16(up,n,8), %rax
+ mul v0
+ mov %rax, w0
+ mov %rdx, w1
+ add w2, 8(rp,n,8)
+ adc w3, w0
+ adc $0, w1
+ mov 24(up,n,8), %rax
+ mul v0
+ mov %rax, w2
+ mov %rdx, w3
+ add $4, n
+ js L(ta3)
+
+ add w0, X(-16(rp,n,8),8(rp))
+ adc w1, w2
+ adc $0, w3
+ add w2, X(-8(rp,n,8),16(rp))
+ adc $0, w3
+ mov w3, X((rp,n,8),24(rp))
+ jmp L(to3)
+
+
+L(r2): mov X(0(up,n,8),(up)), %rax
+ mul v0
+ mov %rax, w0
+ mov %rdx, w1
+ mov w2, X(-8(rp,n,8),-8(rp))
+ add w3, w0
+ adc $0, w1
+ mov X(8(up,n,8),8(up)), %rax
+ mul v0
+ mov %rax, w2
+ mov %rdx, w3
+ mov w0, X((rp,n,8),(rp))
+ add w1, w2
+ adc $0, w3
+ mov X(16(up,n,8),16(up)), %rax
+ mul v0
+ mov %rax, w0
+ mov %rdx, w1
+ mov w2, X(8(rp,n,8),8(rp))
+ add w3, w0
+ adc $0, w1
+ mov w0, X(16(rp,n,8),16(rp))
+ adc $0, w3
+ mov w1, X(24(rp,n,8),24(rp))
+ inc un
+
+C outer loop(2)
+L(to2): dec vn
+ jz L(ret)
+ mov (vp), v0
+ mov 16(up,un,8), %rax
+ lea 8(vp), vp
+ lea 8(rp), rp
+ mov un, n
+ mul v0
+ mov %rax, w0
+ mov %rdx, w1
+ jmp L(al2)
+
+ ALIGN(16)
+L(ta2): add w0, -16(rp,n,8)
+ adc w1, w2
+ adc $0, w3
+ mov (up,n,8), %rax
+ mul v0
+ mov %rax, w0
+ mov %rdx, w1
+ add w2, -8(rp,n,8)
+ adc w3, w0
+ adc $0, w1
+ mov 8(up,n,8), %rax
+ mul v0
+ mov %rax, w2
+ mov %rdx, w3
+ add w0, (rp,n,8)
+ adc w1, w2
+ adc $0, w3
+ mov 16(up,n,8), %rax
+ mul v0
+ mov %rax, w0
+ mov %rdx, w1
+ add w2, 8(rp,n,8)
+ adc w3, w0
+ adc $0, w1
+L(al2): mov 24(up,n,8), %rax
+ mul v0
+ mov %rax, w2
+ mov %rdx, w3
+ add $4, n
+ js L(ta2)
+
+ add w0, X(-16(rp,n,8),8(rp))
+ adc w1, w2
+ adc $0, w3
+ add w2, X(-8(rp,n,8),16(rp))
+ adc $0, w3
+ mov w3, X((rp,n,8),24(rp))
+ jmp L(to2)
+
+
+L(r1): mov X(0(up,n,8),8(up)), %rax
+ mul v0
+ mov %rax, w0
+ mov %rdx, w1
+ mov w2, X(-8(rp,n,8),(rp))
+ add w3, w0
+ adc $0, w1
+ mov X(8(up,n,8),16(up)), %rax
+ mul v0
+ mov %rax, w2
+ mov %rdx, w3
+ mov w0, X((rp,n,8),8(rp))
+ add w1, w2
+ adc $0, w3
+ mov w2, X(8(rp,n,8),16(rp))
+ mov w3, X(16(rp,n,8),24(rp))
+ add $4, un
+
+C outer loop(1)
+L(to1): dec vn
+ jz L(ret)
+ mov (vp), v0
+ mov -8(up,un,8), %rax
+ lea 8(vp), vp
+ lea 8(rp), rp
+ mov un, n
+ mul v0
+ mov %rax, w2
+ mov %rdx, w3
+ jmp L(al1)
+
+ ALIGN(16)
+L(ta1): add w0, -16(rp,n,8)
+ adc w1, w2
+ adc $0, w3
+L(al1): mov (up,n,8), %rax
+ mul v0
+ mov %rax, w0
+ mov %rdx, w1
+ add w2, -8(rp,n,8)
+ adc w3, w0
+ adc $0, w1
+ mov 8(up,n,8), %rax
+ mul v0
+ mov %rax, w2
+ mov %rdx, w3
+ add w0, (rp,n,8)
+ adc w1, w2
+ adc $0, w3
+ mov 16(up,n,8), %rax
+ mul v0
+ mov %rax, w0
+ mov %rdx, w1
+ add w2, 8(rp,n,8)
+ adc w3, w0
+ adc $0, w1
+ mov 24(up,n,8), %rax
+ mul v0
+ mov %rax, w2
+ mov %rdx, w3
+ add $4, n
+ js L(ta1)
+
+ add w0, X(-16(rp,n,8),8(rp))
+ adc w1, w2
+ adc $0, w3
+ add w2, X(-8(rp,n,8),16(rp))
+ adc $0, w3
+ mov w3, X((rp,n,8),24(rp))
+ jmp L(to1)
+
+
+L(r0): mov X((up,n,8),16(up)), %rax
+ mul v0
+ mov %rax, w0
+ mov %rdx, w1
+ mov w2, X(-8(rp,n,8),8(rp))
+ add w3, w0
+ adc $0, w1
+ mov w0, X((rp,n,8),16(rp))
+ mov w1, X(8(rp,n,8),24(rp))
+ add $3, un
+
+C outer loop(0)
+L(to0): dec vn
+ jz L(ret)
+ mov (vp), v0
+ mov (up,un,8), %rax
+ lea 8(vp), vp
+ lea 8(rp), rp
+ mov un, n
+ mul v0
+ mov %rax, w0
+ mov %rdx, w1
+ jmp L(al0)
+
+ ALIGN(16)
+L(ta0): add w0, -16(rp,n,8)
+ adc w1, w2
+ adc $0, w3
+ mov (up,n,8), %rax
+ mul v0
+ mov %rax, w0
+ mov %rdx, w1
+ add w2, -8(rp,n,8)
+ adc w3, w0
+ adc $0, w1
+L(al0): mov 8(up,n,8), %rax
+ mul v0
+ mov %rax, w2
+ mov %rdx, w3
+ add w0, (rp,n,8)
+ adc w1, w2
+ adc $0, w3
+ mov 16(up,n,8), %rax
+ mul v0
+ mov %rax, w0
+ mov %rdx, w1
+ add w2, 8(rp,n,8)
+ adc w3, w0
+ adc $0, w1
+ mov 24(up,n,8), %rax
+ mul v0
+ mov %rax, w2
+ mov %rdx, w3
+ add $4, n
+ js L(ta0)
+
+ add w0, X(-16(rp,n,8),8(rp))
+ adc w1, w2
+ adc $0, w3
+ add w2, X(-8(rp,n,8),16(rp))
+ adc $0, w3
+ mov w3, X((rp,n,8),24(rp))
+ jmp L(to0)
+
+
+L(ret): pop %r13
+ pop %r12
+ pop %rbp
+ pop %rbx
+ FUNC_EXIT()
+ ret
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/bobcat/redc_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/bobcat/redc_1.asm
new file mode 100644
index 00000000000..c3798021f7f
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/bobcat/redc_1.asm
@@ -0,0 +1,502 @@
+dnl X86-64 mpn_redc_1 optimised for AMD bobcat.
+
+dnl Contributed to the GNU project by Torbjörn Granlund.
+
+dnl Copyright 2003-2005, 2007, 2008, 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/limb
+C AMD K8,K9 ?
+C AMD K10 ?
+C AMD bull ?
+C AMD pile ?
+C AMD steam ?
+C AMD bobcat 5.0
+C AMD jaguar ?
+C Intel P4 ?
+C Intel core ?
+C Intel NHM ?
+C Intel SBR ?
+C Intel IBR ?
+C Intel HWL ?
+C Intel BWL ?
+C Intel atom ?
+C VIA nano ?
+
+C TODO
+C * Micro-optimise, none performed thus far.
+C * Consider inlining mpn_add_n.
+C * Single basecases out before the pushes.
+
+C When playing with pointers, set this to $2 to fall back to conservative
+C indexing in wind-down code.
+define(`I',`$1')
+
+define(`rp', `%rdi') C rcx
+define(`up', `%rsi') C rdx
+define(`mp_param', `%rdx') C r8
+define(`n', `%rcx') C r9
+define(`u0inv', `%r8') C stack
+
+define(`i', `%r14')
+define(`j', `%r15')
+define(`mp', `%r12')
+define(`q0', `%r13')
+define(`w0', `%rbp')
+define(`w1', `%r9')
+define(`w2', `%r10')
+define(`w3', `%r11')
+
+C rax rbx rcx rdx rdi rsi rbp r8 r9 r10 r11 r12 r13 r14 r15
+
+ABI_SUPPORT(DOS64)
+ABI_SUPPORT(STD64)
+
+define(`ALIGNx', `ALIGN(16)')
+
+ASM_START()
+ TEXT
+ ALIGN(32)
+PROLOGUE(mpn_redc_1)
+ FUNC_ENTRY(4)
+IFDOS(` mov 56(%rsp), %r8 ')
+ push %rbx
+ push %rbp
+ push %r12
+ push %r13
+ push %r14
+ push %r15
+
+ mov (up), q0
+ mov n, j C outer loop induction var
+ lea (mp_param,n,8), mp
+ lea (up,n,8), up
+ neg n
+ imul u0inv, q0 C first iteration q0
+
+ test $1, R8(n)
+ jz L(bx0)
+
+L(bx1): test $2, R8(n)
+ jz L(b3)
+
+L(b1): cmp $-1, R32(n)
+ jz L(n1)
+
+L(otp1):lea 1(n), i
+ mov (mp,n,8), %rax
+ mul q0
+ mov %rax, w2
+ mov %rdx, w3
+ mov 8(mp,n,8), %rax
+ mul q0
+ mov %rax, %rbx
+ mov %rdx, w1
+ add (up,n,8), w2
+ adc w3, %rbx
+ adc $0, w1
+ mov 16(mp,n,8), %rax
+ mul q0
+ mov %rax, w2
+ mov %rdx, w3
+ add 8(up,n,8), %rbx
+ mov %rbx, 8(up,n,8)
+ adc w1, w2
+ adc $0, w3
+ imul u0inv, %rbx C next q limb
+ jmp L(e1)
+
+ ALIGNx
+L(tp1): add w0, -16(up,i,8)
+ adc w1, w2
+ adc $0, w3
+ mov (mp,i,8), %rax
+ mul q0
+ mov %rax, w0
+ mov %rdx, w1
+ add w2, -8(up,i,8)
+ adc w3, w0
+ adc $0, w1
+ mov 8(mp,i,8), %rax
+ mul q0
+ mov %rax, w2
+ mov %rdx, w3
+ add w0, (up,i,8)
+ adc w1, w2
+ adc $0, w3
+L(e1): mov 16(mp,i,8), %rax
+ mul q0
+ mov %rax, w0
+ mov %rdx, w1
+ add w2, 8(up,i,8)
+ adc w3, w0
+ adc $0, w1
+ mov 24(mp,i,8), %rax
+ mul q0
+ mov %rax, w2
+ mov %rdx, w3
+ add $4, i
+ js L(tp1)
+
+L(ed1): add w0, I(-16(up),-16(up,i,8))
+ adc w1, w2
+ adc $0, w3
+ add w2, I(-8(up),-8(up,i,8))
+ adc $0, w3
+ mov w3, (up,n,8) C up[0]
+ mov %rbx, q0 C previously computed q limb -> q0
+ lea 8(up), up C up++
+ dec j
+ jnz L(otp1)
+ jmp L(cj)
+
+L(b3): cmp $-3, R32(n)
+ jz L(n3)
+
+L(otp3):lea 3(n), i
+ mov (mp,n,8), %rax
+ mul q0
+ mov %rax, w2
+ mov %rdx, w3
+ mov 8(mp,n,8), %rax
+ mul q0
+ mov %rax, %rbx
+ mov %rdx, w1
+ add (up,n,8), w2
+ adc w3, %rbx
+ adc $0, w1
+ mov 16(mp,n,8), %rax
+ mul q0
+ mov %rax, w2
+ mov %rdx, w3
+ add 8(up,n,8), %rbx
+ mov %rbx, 8(up,n,8)
+ adc w1, w2
+ adc $0, w3
+ imul u0inv, %rbx C next q limb
+ jmp L(e3)
+
+ ALIGNx
+L(tp3): add w0, -16(up,i,8)
+ adc w1, w2
+ adc $0, w3
+L(e3): mov (mp,i,8), %rax
+ mul q0
+ mov %rax, w0
+ mov %rdx, w1
+ add w2, -8(up,i,8)
+ adc w3, w0
+ adc $0, w1
+ mov 8(mp,i,8), %rax
+ mul q0
+ mov %rax, w2
+ mov %rdx, w3
+ add w0, (up,i,8)
+ adc w1, w2
+ adc $0, w3
+ mov 16(mp,i,8), %rax
+ mul q0
+ mov %rax, w0
+ mov %rdx, w1
+ add w2, 8(up,i,8)
+ adc w3, w0
+ adc $0, w1
+ mov 24(mp,i,8), %rax
+ mul q0
+ mov %rax, w2
+ mov %rdx, w3
+ add $4, i
+ js L(tp3)
+
+L(ed3): add w0, I(-16(up),-16(up,i,8))
+ adc w1, w2
+ adc $0, w3
+ add w2, I(-8(up),-8(up,i,8))
+ adc $0, w3
+ mov w3, (up,n,8) C up[0]
+ mov %rbx, q0 C previously computed q limb -> q0
+ lea 8(up), up C up++
+ dec j
+ jnz L(otp3)
+C jmp L(cj)
+
+L(cj):
+IFSTD(` lea (up,n,8), up C param 2: up
+ lea (up,n,8), %rdx C param 3: up - n
+ neg R32(n) ') C param 4: n
+
+IFDOS(` lea (up,n,8), %rdx C param 2: up
+ lea (%rdx,n,8), %r8 C param 3: up - n
+ neg R32(n)
+ mov n, %r9 C param 4: n
+ mov rp, %rcx ') C param 1: rp
+
+ CALL( mpn_add_n)
+
+L(ret): pop %r15
+ pop %r14
+ pop %r13
+ pop %r12
+ pop %rbp
+ pop %rbx
+ FUNC_EXIT()
+ ret
+
+L(bx0): test $2, R8(n)
+ jnz L(b2)
+
+L(b0):
+L(otp0):lea (n), i
+ mov (mp,n,8), %rax
+ mul q0
+ mov %rax, w0
+ mov %rdx, w1
+ mov 8(mp,n,8), %rax
+ mul q0
+ mov %rax, %rbx
+ mov %rdx, w3
+ add (up,n,8), w0
+ adc w1, %rbx
+ adc $0, w3
+ mov 16(mp,n,8), %rax
+ mul q0
+ mov %rax, w0
+ mov %rdx, w1
+ add 8(up,n,8), %rbx
+ mov %rbx, 8(up,n,8)
+ adc w3, w0
+ adc $0, w1
+ imul u0inv, %rbx C next q limb
+ jmp L(e0)
+
+ ALIGNx
+L(tp0): add w0, -16(up,i,8)
+ adc w1, w2
+ adc $0, w3
+ mov (mp,i,8), %rax
+ mul q0
+ mov %rax, w0
+ mov %rdx, w1
+ add w2, -8(up,i,8)
+ adc w3, w0
+ adc $0, w1
+ mov 8(mp,i,8), %rax
+ mul q0
+ mov %rax, w2
+ mov %rdx, w3
+ add w0, (up,i,8)
+ adc w1, w2
+ adc $0, w3
+ mov 16(mp,i,8), %rax
+ mul q0
+ mov %rax, w0
+ mov %rdx, w1
+ add w2, 8(up,i,8)
+ adc w3, w0
+ adc $0, w1
+L(e0): mov 24(mp,i,8), %rax
+ mul q0
+ mov %rax, w2
+ mov %rdx, w3
+ add $4, i
+ js L(tp0)
+
+L(ed0): add w0, I(-16(up),-16(up,i,8))
+ adc w1, w2
+ adc $0, w3
+ add w2, I(-8(up),-8(up,i,8))
+ adc $0, w3
+ mov w3, (up,n,8) C up[0]
+ mov %rbx, q0 C previously computed q limb -> q0
+ lea 8(up), up C up++
+ dec j
+ jnz L(otp0)
+ jmp L(cj)
+
+L(b2): cmp $-2, R32(n)
+ jz L(n2)
+
+L(otp2):lea 2(n), i
+ mov (mp,n,8), %rax
+ mul q0
+ mov %rax, w0
+ mov %rdx, w1
+ mov 8(mp,n,8), %rax
+ mul q0
+ mov %rax, %rbx
+ mov %rdx, w3
+ add (up,n,8), w0
+ adc w1, %rbx
+ adc $0, w3
+ mov 16(mp,n,8), %rax
+ mul q0
+ mov %rax, w0
+ mov %rdx, w1
+ add 8(up,n,8), %rbx
+ mov %rbx, 8(up,n,8)
+ adc w3, w0
+ adc $0, w1
+ imul u0inv, %rbx C next q limb
+ jmp L(e2)
+
+ ALIGNx
+L(tp2): add w0, -16(up,i,8)
+ adc w1, w2
+ adc $0, w3
+ mov (mp,i,8), %rax
+ mul q0
+ mov %rax, w0
+ mov %rdx, w1
+ add w2, -8(up,i,8)
+ adc w3, w0
+ adc $0, w1
+L(e2): mov 8(mp,i,8), %rax
+ mul q0
+ mov %rax, w2
+ mov %rdx, w3
+ add w0, (up,i,8)
+ adc w1, w2
+ adc $0, w3
+ mov 16(mp,i,8), %rax
+ mul q0
+ mov %rax, w0
+ mov %rdx, w1
+ add w2, 8(up,i,8)
+ adc w3, w0
+ adc $0, w1
+ mov 24(mp,i,8), %rax
+ mul q0
+ mov %rax, w2
+ mov %rdx, w3
+ add $4, i
+ js L(tp2)
+
+L(ed2): add w0, I(-16(up),-16(up,i,8))
+ adc w1, w2
+ adc $0, w3
+ add w2, I(-8(up),-8(up,i,8))
+ adc $0, w3
+ mov w3, (up,n,8) C up[0]
+ mov %rbx, q0 C previously computed q limb -> q0
+ lea 8(up), up C up++
+ dec j
+ jnz L(otp2)
+ jmp L(cj)
+
+L(n1): mov (mp_param), %rax
+ mul q0
+ add -8(up), %rax
+ adc (up), %rdx
+ mov %rdx, (rp)
+ mov $0, R32(%rax)
+ adc R32(%rax), R32(%rax)
+ jmp L(ret)
+
+L(n2): mov (mp_param), %rax
+ mov -16(up), %rbp
+ mul q0
+ add %rax, %rbp
+ mov %rdx, %r9
+ adc $0, %r9
+ mov -8(mp), %rax
+ mov -8(up), %r10
+ mul q0
+ add %rax, %r10
+ mov %rdx, %r11
+ adc $0, %r11
+ add %r9, %r10
+ adc $0, %r11
+ mov %r10, q0
+ imul u0inv, q0 C next q0
+ mov -16(mp), %rax
+ mul q0
+ add %rax, %r10
+ mov %rdx, %r9
+ adc $0, %r9
+ mov -8(mp), %rax
+ mov (up), %r14
+ mul q0
+ add %rax, %r14
+ adc $0, %rdx
+ add %r9, %r14
+ adc $0, %rdx
+ xor R32(%rax), R32(%rax)
+ add %r11, %r14
+ adc 8(up), %rdx
+ mov %r14, (rp)
+ mov %rdx, 8(rp)
+ adc R32(%rax), R32(%rax)
+ jmp L(ret)
+
+ ALIGNx
+L(n3): mov -24(mp), %rax
+ mov -24(up), %r10
+ mul q0
+ add %rax, %r10
+ mov -16(mp), %rax
+ mov %rdx, %r11
+ adc $0, %r11
+ mov -16(up), %rbp
+ mul q0
+ add %rax, %rbp
+ mov %rdx, %r9
+ adc $0, %r9
+ mov -8(mp), %rax
+ add %r11, %rbp
+ mov -8(up), %r10
+ adc $0, %r9
+ mul q0
+ mov %rbp, q0
+ imul u0inv, q0 C next q0
+ add %rax, %r10
+ mov %rdx, %r11
+ adc $0, %r11
+ mov %rbp, -16(up)
+ add %r9, %r10
+ adc $0, %r11
+ mov %r10, -8(up)
+ mov %r11, -24(up) C up[0]
+ lea 8(up), up C up++
+ dec j
+ jnz L(n3)
+
+ mov -48(up), %rdx
+ mov -40(up), %rbx
+ xor R32(%rax), R32(%rax)
+ add %rbp, %rdx
+ adc %r10, %rbx
+ adc -8(up), %r11
+ mov %rdx, (rp)
+ mov %rbx, 8(rp)
+ mov %r11, 16(rp)
+ adc R32(%rax), R32(%rax)
+ jmp L(ret)
+EPILOGUE()
+ASM_END()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/bobcat/sqr_basecase.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/bobcat/sqr_basecase.asm
new file mode 100644
index 00000000000..0e417a1ebeb
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/bobcat/sqr_basecase.asm
@@ -0,0 +1,565 @@
+dnl AMD64 mpn_sqr_basecase optimised for AMD bobcat.
+
+dnl Copyright 2003-2005, 2007, 2008, 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/limb
+C AMD K8,K9 4.5
+C AMD K10 4.5
+C AMD bd1 4.75
+C AMD bobcat 5
+C Intel P4 17.7
+C Intel core2 5.5
+C Intel NHM 5.43
+C Intel SBR 3.92
+C Intel atom 23
+C VIA nano 5.63
+
+C This sqr_basecase is based on mul_1 and addmul_1, since these both run at the
+C multiply insn bandwidth, without any apparent loop branch exit pipeline
+C replays experienced on K8. The structure is unusual: it falls into mul_1 in
+C the same way for all n, then it splits into 4 different wind-down blocks and
+C 4 separate addmul_1 loops.
+C
+C We have not tried using the same addmul_1 loops with a switch into feed-in
+C code, as we do in other basecase implementations. Doing that could save
+C substantial code volume, but would also probably add some overhead.
+
+C TODO
+C * Tune un < 4 code.
+C * Perhaps implement a larger final corner (it is now 2 x 1).
+C * Lots of space could be saved by replacing the "switch" code by gradual
+C jumps out from mul_1 winddown code, perhaps with no added overhead.
+C * Are the ALIGN(16) really necessary? They add about 25 bytes of padding.
+
+ABI_SUPPORT(DOS64)
+ABI_SUPPORT(STD64)
+
+C Standard parameters
+define(`rp', `%rdi')
+define(`up', `%rsi')
+define(`un_param', `%rdx')
+C Standard allocations
+define(`un', `%rbx')
+define(`w0', `%r8')
+define(`w1', `%r9')
+define(`w2', `%r10')
+define(`w3', `%r11')
+define(`n', `%rbp')
+define(`v0', `%rcx')
+
+C Temp macro for allowing control over indexing.
+C Define to return $1 for more conservative ptr handling.
+define(`X',`$2')
+dnl define(`X',`$1')
+
+
+ASM_START()
+ TEXT
+ ALIGN(64)
+PROLOGUE(mpn_sqr_basecase)
+ FUNC_ENTRY(3)
+
+ mov (up), %rax
+
+ cmp $2, R32(un_param)
+ jae L(ge2)
+
+ mul %rax
+ mov %rax, (rp)
+ mov %rdx, 8(rp)
+ FUNC_EXIT()
+ ret
+
+L(ge2): mov (up), v0
+ jnz L(g2)
+
+ mul %rax
+ mov %rax, (rp)
+ mov 8(up), %rax
+ mov %rdx, w0
+ mul v0
+ add %rax, w0
+ mov %rdx, w1
+ adc $0, w1
+ mov 8(up), v0
+ mov (up), %rax
+ mul v0
+ add %rax, w0
+ mov w0, 8(rp)
+ mov %rdx, w0 C CAUTION: r8 realloc
+ adc $0, w0
+ mov 8(up), %rax
+ mul v0
+ add w1, w0
+ adc $0, %rdx
+ add w0, %rax
+ adc $0, %rdx
+ mov %rax, 16(rp)
+ mov %rdx, 24(rp)
+ FUNC_EXIT()
+ ret
+
+L(g2): cmp $3, R32(un_param)
+ ja L(g3)
+ mul %rax
+ mov %rax, (rp)
+ mov %rdx, 8(rp)
+ mov 8(up), %rax
+ mul %rax
+ mov %rax, 16(rp)
+ mov %rdx, 24(rp)
+ mov 16(up), %rax
+ mul %rax
+ mov %rax, 32(rp)
+ mov %rdx, 40(rp)
+
+ mov (up), v0
+ mov 8(up), %rax
+ mul v0
+ mov %rax, w0
+ mov %rdx, w1
+ mov 16(up), %rax
+ mul v0
+ xor R32(w2), R32(w2)
+ add %rax, w1
+ adc %rdx, w2
+
+ mov 8(up), v0
+ mov 16(up), %rax
+ mul v0
+ xor R32(w3), R32(w3)
+ add %rax, w2
+ adc %rdx, w3
+ add w0, w0
+ adc w1, w1
+ adc w2, w2
+ adc w3, w3
+ mov $0, R32(v0)
+ adc v0, v0
+ add w0, 8(rp)
+ adc w1, 16(rp)
+ adc w2, 24(rp)
+ adc w3, 32(rp)
+ adc v0, 40(rp)
+ FUNC_EXIT()
+ ret
+
+L(g3): push %rbx
+ push %rbp
+
+ mov 8(up), %rax
+ lea -24(rp,un_param,8), rp
+ lea -24(up,un_param,8), up
+ neg un_param
+ push un_param C for sqr_diag_addlsh1
+ lea (un_param), un
+ lea 3(un_param), n
+
+ mul v0
+ mov %rax, w2
+ mov %rdx, w3
+ jmp L(L3)
+
+ ALIGN(16)
+L(top): mov w0, -16(rp,n,8)
+ add w1, w2
+ adc $0, w3
+ mov (up,n,8), %rax
+ mul v0
+ mov %rax, w0
+ mov %rdx, w1
+ mov w2, -8(rp,n,8)
+ add w3, w0
+ adc $0, w1
+ mov 8(up,n,8), %rax
+ mul v0
+ mov %rax, w2
+ mov %rdx, w3
+ mov w0, (rp,n,8)
+ add w1, w2
+ adc $0, w3
+L(L3): mov 16(up,n,8), %rax
+ mul v0
+ mov %rax, w0
+ mov %rdx, w1
+ mov w2, 8(rp,n,8)
+ add w3, w0
+ adc $0, w1
+ mov 24(up,n,8), %rax
+ mul v0
+ mov %rax, w2
+ mov %rdx, w3
+ add $4, n
+ js L(top)
+
+ mov w0, -16(rp,n,8)
+ add w1, w2
+ adc $0, w3
+
+ test n, n
+ jz L(r2)
+ cmp $2, R32(n)
+ ja L(r3)
+ jz L(r0)
+
+
+L(r1): mov X((up,n,8),8(up)), %rax
+ mul v0
+ mov %rax, w0
+ mov %rdx, w1
+ mov w2, X(-8(rp,n,8),(rp))
+ add w3, w0
+ adc $0, w1
+ mov X(8(up,n,8),16(up)), %rax
+ mul v0
+ mov %rax, w2
+ mov %rdx, w3
+ mov w0, X((rp,n,8),8(rp))
+ add w1, w2
+ adc $0, w3
+ mov w2, X(8(rp,n,8),16(rp))
+ mov w3, X(16(rp,n,8),24(rp))
+ add $5, un
+ jmp L(to0)
+
+L(r2): mov X((up,n,8),(up)), %rax
+ mul v0
+ mov %rax, w0
+ mov %rdx, w1
+ mov w2, X(-8(rp,n,8),-8(rp))
+ add w3, w0
+ adc $0, w1
+ mov X(8(up,n,8),8(up)), %rax
+ mul v0
+ mov %rax, w2
+ mov %rdx, w3
+ mov w0, X((rp,n,8),(rp))
+ add w1, w2
+ adc $0, w3
+ mov X(16(up,n,8),16(up)), %rax
+ mul v0
+ mov %rax, w0
+ mov %rdx, w1
+ mov w2, X(8(rp,n,8),8(rp))
+ add w3, w0
+ adc $0, w1
+ mov w0, X(16(rp,n,8),16(rp))
+ adc $0, w3
+ mov w1, X(24(rp,n,8),24(rp))
+ add $6, un
+ jmp L(to1)
+
+L(r3): mov w2, X(-8(rp,n,8),16(rp))
+ mov w3, X((rp,n,8),24(rp))
+ add $3, un
+ jmp L(to2)
+
+L(r0): mov X((up,n,8),16(up)), %rax
+ mul v0
+ mov %rax, w0
+ mov %rdx, w1
+ mov w2, X(-8(rp,n,8),8(rp))
+ add w3, w0
+ adc $0, w1
+ mov w0, X((rp,n,8),16(rp))
+ mov w1, X(8(rp,n,8),24(rp))
+ add $4, un
+C jmp L(to3)
+C fall through into main loop
+
+
+L(outer):
+ mov un, n
+ mov (up,un,8), v0
+ mov 8(up,un,8), %rax
+ lea 8(rp), rp
+ mul v0
+ mov %rax, w2
+ mov %rdx, w3
+ jmp L(al3)
+
+ ALIGN(16)
+L(ta3): add w0, -16(rp,n,8)
+ adc w1, w2
+ adc $0, w3
+ mov (up,n,8), %rax
+ mul v0
+ mov %rax, w0
+ mov %rdx, w1
+ add w2, -8(rp,n,8)
+ adc w3, w0
+ adc $0, w1
+ mov 8(up,n,8), %rax
+ mul v0
+ mov %rax, w2
+ mov %rdx, w3
+ add w0, (rp,n,8)
+ adc w1, w2
+ adc $0, w3
+L(al3): mov 16(up,n,8), %rax
+ mul v0
+ mov %rax, w0
+ mov %rdx, w1
+ add w2, 8(rp,n,8)
+ adc w3, w0
+ adc $0, w1
+ mov 24(up,n,8), %rax
+ mul v0
+ mov %rax, w2
+ mov %rdx, w3
+ add $4, n
+ js L(ta3)
+
+ add w0, X(-16(rp,n,8),8(rp))
+ adc w1, w2
+ adc $0, w3
+ add w2, X(-8(rp,n,8),16(rp))
+ adc $0, w3
+ mov w3, X((rp,n,8),24(rp))
+
+
+L(to2): mov un, n
+ cmp $-4, R32(un)
+ jnc L(end)
+ add $4, un
+ mov 8(up,n,8), v0
+ mov 16(up,n,8), %rax
+ lea 8(rp), rp
+ mul v0
+ mov %rax, w0
+ mov %rdx, w1
+ jmp L(al2)
+
+ ALIGN(16)
+L(ta2): add w0, -16(rp,n,8)
+ adc w1, w2
+ adc $0, w3
+ mov (up,n,8), %rax
+ mul v0
+ mov %rax, w0
+ mov %rdx, w1
+ add w2, -8(rp,n,8)
+ adc w3, w0
+ adc $0, w1
+ mov 8(up,n,8), %rax
+ mul v0
+ mov %rax, w2
+ mov %rdx, w3
+ add w0, (rp,n,8)
+ adc w1, w2
+ adc $0, w3
+ mov 16(up,n,8), %rax
+ mul v0
+ mov %rax, w0
+ mov %rdx, w1
+ add w2, 8(rp,n,8)
+ adc w3, w0
+ adc $0, w1
+L(al2): mov 24(up,n,8), %rax
+ mul v0
+ mov %rax, w2
+ mov %rdx, w3
+ add $4, n
+ js L(ta2)
+
+ add w0, X(-16(rp,n,8),8(rp))
+ adc w1, w2
+ adc $0, w3
+ add w2, X(-8(rp,n,8),16(rp))
+ adc $0, w3
+ mov w3, X((rp,n,8),24(rp))
+
+
+L(to1): mov un, n
+ mov -16(up,un,8), v0
+ mov -8(up,un,8), %rax
+ lea 8(rp), rp
+ mul v0
+ mov %rax, w2
+ mov %rdx, w3
+ jmp L(al1)
+
+ ALIGN(16)
+L(ta1): add w0, -16(rp,n,8)
+ adc w1, w2
+ adc $0, w3
+L(al1): mov (up,n,8), %rax
+ mul v0
+ mov %rax, w0
+ mov %rdx, w1
+ add w2, -8(rp,n,8)
+ adc w3, w0
+ adc $0, w1
+ mov 8(up,n,8), %rax
+ mul v0
+ mov %rax, w2
+ mov %rdx, w3
+ add w0, (rp,n,8)
+ adc w1, w2
+ adc $0, w3
+ mov 16(up,n,8), %rax
+ mul v0
+ mov %rax, w0
+ mov %rdx, w1
+ add w2, 8(rp,n,8)
+ adc w3, w0
+ adc $0, w1
+ mov 24(up,n,8), %rax
+ mul v0
+ mov %rax, w2
+ mov %rdx, w3
+ add $4, n
+ js L(ta1)
+
+ add w0, X(-16(rp,n,8),8(rp))
+ adc w1, w2
+ adc $0, w3
+ add w2, X(-8(rp,n,8),16(rp))
+ adc $0, w3
+ mov w3, X((rp,n,8),24(rp))
+
+
+L(to0): mov un, n
+ mov -8(up,un,8), v0
+ mov (up,un,8), %rax
+ lea 8(rp), rp
+ mul v0
+ mov %rax, w0
+ mov %rdx, w1
+ jmp L(al0)
+
+ ALIGN(16)
+L(ta0): add w0, -16(rp,n,8)
+ adc w1, w2
+ adc $0, w3
+ mov (up,n,8), %rax
+ mul v0
+ mov %rax, w0
+ mov %rdx, w1
+ add w2, -8(rp,n,8)
+ adc w3, w0
+ adc $0, w1
+L(al0): mov 8(up,n,8), %rax
+ mul v0
+ mov %rax, w2
+ mov %rdx, w3
+ add w0, (rp,n,8)
+ adc w1, w2
+ adc $0, w3
+ mov 16(up,n,8), %rax
+ mul v0
+ mov %rax, w0
+ mov %rdx, w1
+ add w2, 8(rp,n,8)
+ adc w3, w0
+ adc $0, w1
+ mov 24(up,n,8), %rax
+ mul v0
+ mov %rax, w2
+ mov %rdx, w3
+ add $4, n
+ js L(ta0)
+
+ add w0, X(-16(rp,n,8),8(rp))
+ adc w1, w2
+ adc $0, w3
+ add w2, X(-8(rp,n,8),16(rp))
+ adc $0, w3
+ mov w3, X((rp,n,8),24(rp))
+ jmp L(outer)
+
+
+L(end): mov X(8(up,un,8),(up)), v0
+ mov X(16(up,un,8),8(up)), %rax
+ mul v0
+ mov %rax, w0
+ mov %rdx, w1
+ mov X(24(up,un,8),16(up)), %rax
+ mul v0
+ mov %rax, w2
+ mov %rdx, w3
+ add w0, X(24(rp,un,8),16(rp))
+ adc w1, w2
+ adc $0, w3
+ add w2, X(32(rp,un,8),24(rp))
+ adc $0, w3
+ mov X(16(up,un,8),8(up)), v0
+ mov X(24(up,un,8),16(up)), %rax
+ mul v0
+ add %rax, w3
+ mov w3, X(40(rp,un,8),32(rp))
+ adc $0, %rdx
+ mov %rdx, X(48(rp,un,8),40(rp))
+
+
+C sqr_diag_addlsh1
+
+ lea 16(up), up
+ lea 40(rp), rp
+ pop n
+ lea 2(n,n), n
+
+ mov (up,n,4), %rax
+ mul %rax
+ xor R32(w2), R32(w2)
+
+ mov 8(rp,n,8), w0
+ mov %rax, (rp,n,8)
+ jmp L(lm)
+
+ ALIGN(8)
+L(tsd): add %rbx, w0
+ adc %rax, w1
+ mov w0, -8(rp,n,8)
+ mov 8(rp,n,8), w0
+ mov w1, (rp,n,8)
+L(lm): mov 16(rp,n,8), w1
+ adc w0, w0
+ adc w1, w1
+ lea (%rdx,w2), %rbx
+ mov 8(up,n,4), %rax
+ setc R8(w2)
+ mul %rax
+ add $2, n
+ js L(tsd)
+
+L(esd): add %rbx, w0
+ adc %rax, w1
+ mov w0, X(-8(rp,n,8),-8(rp))
+ mov w1, X((rp,n,8),(rp))
+ adc w2, %rdx
+ mov %rdx, X(8(rp,n,8),8(rp))
+
+ pop %rbp
+ pop %rbx
+ FUNC_EXIT()
+ ret
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/cnd_aors_n.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/cnd_aors_n.asm
new file mode 100644
index 00000000000..13a2ab3be95
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/cnd_aors_n.asm
@@ -0,0 +1,183 @@
+dnl AMD64 mpn_cnd_add_n, mpn_cnd_sub_n
+
+dnl Copyright 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/limb
+C AMD K8,K9 2
+C AMD K10 2
+C AMD bd1 2.32
+C AMD bobcat 3
+C Intel P4 13
+C Intel core2 2.9
+C Intel NHM 2.8
+C Intel SBR 2.4
+C Intel atom 5.33
+C VIA nano 3
+
+C NOTES
+C * It might seem natural to use the cmov insn here, but since this function
+C is supposed to have the exact same execution pattern for cnd true and
+C false, and since cmov's documentation is not clear about whether it
+C actually reads both source operands and writes the register for a false
+C condition, we cannot use it.
+C * Two cases could be optimised: (1) cnd_add_n could use ADCSBB-from-memory
+C to save one insn/limb, and (2) when up=rp cnd_add_n and cnd_sub_n could use
+C ADCSBB-to-memory, again saving 1 insn/limb.
+C * This runs optimally at decoder bandwidth on K10. It has not been tuned
+C for any other processor.
+
+C INPUT PARAMETERS
+define(`cnd', `%rdi') dnl rcx
+define(`rp', `%rsi') dnl rdx
+define(`up', `%rdx') dnl r8
+define(`vp', `%rcx') dnl r9
+define(`n', `%r8') dnl rsp+40
+
+ifdef(`OPERATION_cnd_add_n', `
+ define(ADDSUB, add)
+ define(ADCSBB, adc)
+ define(func, mpn_cnd_add_n)')
+ifdef(`OPERATION_cnd_sub_n', `
+ define(ADDSUB, sub)
+ define(ADCSBB, sbb)
+ define(func, mpn_cnd_sub_n)')
+
+MULFUNC_PROLOGUE(mpn_cnd_add_n mpn_cnd_sub_n)
+
+ABI_SUPPORT(DOS64)
+ABI_SUPPORT(STD64)
+
+ASM_START()
+ TEXT
+ ALIGN(16)
+PROLOGUE(func)
+ FUNC_ENTRY(4)
+IFDOS(` mov 56(%rsp), R32(%r8)')
+ push %rbx
+ push %rbp
+ push %r12
+ push %r13
+ push %r14
+
+ neg cnd
+ sbb cnd, cnd C make cnd mask
+
+ lea (vp,n,8), vp
+ lea (up,n,8), up
+ lea (rp,n,8), rp
+
+ mov R32(n), R32(%rax)
+ neg n
+ and $3, R32(%rax)
+ jz L(top) C carry-save reg rax = 0 in this arc
+ cmp $2, R32(%rax)
+ jc L(b1)
+ jz L(b2)
+
+L(b3): mov (vp,n,8), %r12
+ mov 8(vp,n,8), %r13
+ mov 16(vp,n,8), %r14
+ and cnd, %r12
+ mov (up,n,8), %r10
+ and cnd, %r13
+ mov 8(up,n,8), %rbx
+ and cnd, %r14
+ mov 16(up,n,8), %rbp
+ ADDSUB %r12, %r10
+ mov %r10, (rp,n,8)
+ ADCSBB %r13, %rbx
+ mov %rbx, 8(rp,n,8)
+ ADCSBB %r14, %rbp
+ mov %rbp, 16(rp,n,8)
+ sbb R32(%rax), R32(%rax) C save carry
+ add $3, n
+ js L(top)
+ jmp L(end)
+
+L(b2): mov (vp,n,8), %r12
+ mov 8(vp,n,8), %r13
+ mov (up,n,8), %r10
+ and cnd, %r12
+ mov 8(up,n,8), %rbx
+ and cnd, %r13
+ ADDSUB %r12, %r10
+ mov %r10, (rp,n,8)
+ ADCSBB %r13, %rbx
+ mov %rbx, 8(rp,n,8)
+ sbb R32(%rax), R32(%rax) C save carry
+ add $2, n
+ js L(top)
+ jmp L(end)
+
+L(b1): mov (vp,n,8), %r12
+ mov (up,n,8), %r10
+ and cnd, %r12
+ ADDSUB %r12, %r10
+ mov %r10, (rp,n,8)
+ sbb R32(%rax), R32(%rax) C save carry
+ add $1, n
+ jns L(end)
+
+ ALIGN(16)
+L(top): mov (vp,n,8), %r12
+ mov 8(vp,n,8), %r13
+ mov 16(vp,n,8), %r14
+ mov 24(vp,n,8), %r11
+ and cnd, %r12
+ mov (up,n,8), %r10
+ and cnd, %r13
+ mov 8(up,n,8), %rbx
+ and cnd, %r14
+ mov 16(up,n,8), %rbp
+ and cnd, %r11
+ mov 24(up,n,8), %r9
+ add R32(%rax), R32(%rax) C restore carry
+ ADCSBB %r12, %r10
+ mov %r10, (rp,n,8)
+ ADCSBB %r13, %rbx
+ mov %rbx, 8(rp,n,8)
+ ADCSBB %r14, %rbp
+ mov %rbp, 16(rp,n,8)
+ ADCSBB %r11, %r9
+ mov %r9, 24(rp,n,8)
+ sbb R32(%rax), R32(%rax) C save carry
+ add $4, n
+ js L(top)
+
+L(end): neg R32(%rax)
+ pop %r14
+ pop %r13
+ pop %r12
+ pop %rbp
+ pop %rbx
+ FUNC_EXIT()
+ ret
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/com.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/com.asm
new file mode 100644
index 00000000000..006acaf6486
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/com.asm
@@ -0,0 +1,95 @@
+dnl AMD64 mpn_com.
+
+dnl Copyright 2004-2006, 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/limb
+C AMD K8,K9 1.25
+C AMD K10 1.25
+C Intel P4 2.78
+C Intel core2 1.1
+C Intel corei 1.5
+C Intel atom ?
+C VIA nano 2
+
+C INPUT PARAMETERS
+define(`rp',`%rdi')
+define(`up',`%rsi')
+define(`n',`%rdx')
+
+ABI_SUPPORT(DOS64)
+ABI_SUPPORT(STD64)
+
+ASM_START()
+ TEXT
+ ALIGN(32)
+PROLOGUE(mpn_com)
+ FUNC_ENTRY(3)
+ movq (up), %r8
+ movl R32(%rdx), R32(%rax)
+ leaq (up,n,8), up
+ leaq (rp,n,8), rp
+ negq n
+ andl $3, R32(%rax)
+ je L(b00)
+ cmpl $2, R32(%rax)
+ jc L(b01)
+ je L(b10)
+
+L(b11): notq %r8
+ movq %r8, (rp,n,8)
+ decq n
+ jmp L(e11)
+L(b10): addq $-2, n
+ jmp L(e10)
+ .byte 0x90,0x90,0x90,0x90,0x90,0x90
+L(b01): notq %r8
+ movq %r8, (rp,n,8)
+ incq n
+ jz L(ret)
+
+L(oop): movq (up,n,8), %r8
+L(b00): movq 8(up,n,8), %r9
+ notq %r8
+ notq %r9
+ movq %r8, (rp,n,8)
+ movq %r9, 8(rp,n,8)
+L(e11): movq 16(up,n,8), %r8
+L(e10): movq 24(up,n,8), %r9
+ notq %r8
+ notq %r9
+ movq %r8, 16(rp,n,8)
+ movq %r9, 24(rp,n,8)
+ addq $4, n
+ jnc L(oop)
+L(ret): FUNC_EXIT()
+ ret
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/copyd.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/copyd.asm
new file mode 100644
index 00000000000..a5e6e595e7d
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/copyd.asm
@@ -0,0 +1,93 @@
+dnl AMD64 mpn_copyd -- copy limb vector, decrementing.
+
+dnl Copyright 2003, 2005, 2007, 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/limb
+C AMD K8,K9 1
+C AMD K10 1
+C AMD bd1 1.36
+C AMD bobcat 1.71
+C Intel P4 2-3
+C Intel core2 1
+C Intel NHM 1
+C Intel SBR 1
+C Intel atom 2
+C VIA nano 2
+
+
+IFSTD(`define(`rp',`%rdi')')
+IFSTD(`define(`up',`%rsi')')
+IFSTD(`define(`n', `%rdx')')
+
+IFDOS(`define(`rp',`%rcx')')
+IFDOS(`define(`up',`%rdx')')
+IFDOS(`define(`n', `%r8')')
+
+ABI_SUPPORT(DOS64)
+ABI_SUPPORT(STD64)
+
+ASM_START()
+ TEXT
+ ALIGN(64)
+PROLOGUE(mpn_copyd)
+ lea -8(up,n,8), up
+ lea (rp,n,8), rp
+ sub $4, n
+ jc L(end)
+ nop
+
+L(top): mov (up), %rax
+ mov -8(up), %r9
+ lea -32(rp), rp
+ mov -16(up), %r10
+ mov -24(up), %r11
+ lea -32(up), up
+ mov %rax, 24(rp)
+ mov %r9, 16(rp)
+ sub $4, n
+ mov %r10, 8(rp)
+ mov %r11, (rp)
+ jnc L(top)
+
+L(end): shr R32(n)
+ jnc 1f
+ mov (up), %rax
+ mov %rax, -8(rp)
+ lea -8(rp), rp
+ lea -8(up), up
+1: shr R32(n)
+ jnc 1f
+ mov (up), %rax
+ mov -8(up), %r9
+ mov %rax, -8(rp)
+ mov %r9, -16(rp)
+1: ret
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/copyi.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/copyi.asm
new file mode 100644
index 00000000000..bafce7a09eb
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/copyi.asm
@@ -0,0 +1,92 @@
+dnl AMD64 mpn_copyi -- copy limb vector, incrementing.
+
+dnl Copyright 2003, 2005, 2007, 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/limb
+C AMD K8,K9 1
+C AMD K10 1
+C AMD bd1 1.36
+C AMD bobcat 1.71
+C Intel P4 2-3
+C Intel core2 1
+C Intel NHM 1
+C Intel SBR 1
+C Intel atom 2
+C VIA nano 2
+
+
+IFSTD(`define(`rp',`%rdi')')
+IFSTD(`define(`up',`%rsi')')
+IFSTD(`define(`n', `%rdx')')
+
+IFDOS(`define(`rp',`%rcx')')
+IFDOS(`define(`up',`%rdx')')
+IFDOS(`define(`n', `%r8')')
+
+ABI_SUPPORT(DOS64)
+ABI_SUPPORT(STD64)
+
+ASM_START()
+ TEXT
+ ALIGN(64)
+ .byte 0,0,0,0,0,0
+PROLOGUE(mpn_copyi)
+ lea -8(rp), rp
+ sub $4, n
+ jc L(end)
+
+L(top): mov (up), %rax
+ mov 8(up), %r9
+ lea 32(rp), rp
+ mov 16(up), %r10
+ mov 24(up), %r11
+ lea 32(up), up
+ mov %rax, -24(rp)
+ mov %r9, -16(rp)
+ sub $4, n
+ mov %r10, -8(rp)
+ mov %r11, (rp)
+ jnc L(top)
+
+L(end): shr R32(n)
+ jnc 1f
+ mov (up), %rax
+ mov %rax, 8(rp)
+ lea 8(rp), rp
+ lea 8(up), up
+1: shr R32(n)
+ jnc 1f
+ mov (up), %rax
+ mov 8(up), %r9
+ mov %rax, 8(rp)
+ mov %r9, 16(rp)
+1: ret
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/core2/aorrlsh1_n.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/core2/aorrlsh1_n.asm
new file mode 100644
index 00000000000..7066bb43720
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/core2/aorrlsh1_n.asm
@@ -0,0 +1,53 @@
+dnl AMD64 mpn_addlsh1_n -- rp[] = up[] + (vp[] << 1)
+dnl AMD64 mpn_rsblsh1_n -- rp[] = (vp[] << 1) - up[]
+
+dnl Contributed to the GNU project by Torbjorn Granlund.
+
+dnl Copyright 2008, 2010-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')
+
+define(LSH, 1)
+define(RSH, 63)
+
+ifdef(`OPERATION_addlsh1_n', `
+ define(ADDSUB, add)
+ define(ADCSBB, adc)
+ define(func, mpn_addlsh1_n)')
+ifdef(`OPERATION_rsblsh1_n', `
+ define(ADDSUB, sub)
+ define(ADCSBB, sbb)
+ define(func, mpn_rsblsh1_n)')
+
+MULFUNC_PROLOGUE(mpn_addlsh1_n mpn_rsblsh1_n)
+
+ABI_SUPPORT(DOS64)
+ABI_SUPPORT(STD64)
+
+include_mpn(`x86_64/aorrlshC_n.asm')
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/core2/aorrlsh2_n.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/core2/aorrlsh2_n.asm
new file mode 100644
index 00000000000..5065120857b
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/core2/aorrlsh2_n.asm
@@ -0,0 +1,53 @@
+dnl AMD64 mpn_addlsh2_n -- rp[] = up[] + (vp[] << 2)
+dnl AMD64 mpn_rsblsh2_n -- rp[] = (vp[] << 2) - up[]
+
+dnl Contributed to the GNU project by Torbjorn Granlund.
+
+dnl Copyright 2008, 2010-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')
+
+define(LSH, 2)
+define(RSH, 62)
+
+ifdef(`OPERATION_addlsh2_n', `
+ define(ADDSUB, add)
+ define(ADCSBB, adc)
+ define(func, mpn_addlsh2_n)')
+ifdef(`OPERATION_rsblsh2_n', `
+ define(ADDSUB, sub)
+ define(ADCSBB, sbb)
+ define(func, mpn_rsblsh2_n)')
+
+MULFUNC_PROLOGUE(mpn_addlsh2_n mpn_rsblsh2_n)
+
+ABI_SUPPORT(DOS64)
+ABI_SUPPORT(STD64)
+
+include_mpn(`x86_64/aorrlshC_n.asm')
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/core2/aorrlsh_n.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/core2/aorrlsh_n.asm
new file mode 100644
index 00000000000..57abf315796
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/core2/aorrlsh_n.asm
@@ -0,0 +1,38 @@
+dnl AMD64 mpn_addlsh_n and mpn_rsblsh_n. R = V2^k +- U.
+
+dnl Copyright 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')
+
+MULFUNC_PROLOGUE(mpn_addlsh_n mpn_addlsh_nc mpn_rsblsh_n)
+
+ABI_SUPPORT(DOS64)
+ABI_SUPPORT(STD64)
+
+include_mpn(`x86_64/coreinhm/aorrlsh_n.asm')
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/core2/aors_err1_n.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/core2/aors_err1_n.asm
new file mode 100644
index 00000000000..3f875aefa42
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/core2/aors_err1_n.asm
@@ -0,0 +1,225 @@
+dnl Core 2 mpn_add_err1_n, mpn_sub_err1_n
+
+dnl Contributed by David Harvey.
+
+dnl Copyright 2011 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 AMD K8,K9 ?
+C AMD K10 ?
+C Intel P4 ?
+C Intel core2 4.14
+C Intel corei ?
+C Intel atom ?
+C VIA nano ?
+
+
+C INPUT PARAMETERS
+define(`rp', `%rdi')
+define(`up', `%rsi')
+define(`vp', `%rdx')
+define(`ep', `%rcx')
+define(`yp', `%r8')
+define(`n', `%r9')
+define(`cy_param', `8(%rsp)')
+
+define(`el', `%rbx')
+define(`eh', `%rbp')
+define(`t0', `%r10')
+define(`t1', `%r11')
+define(`t2', `%r12')
+define(`t3', `%r13')
+define(`w0', `%r14')
+define(`w1', `%r15')
+
+ifdef(`OPERATION_add_err1_n', `
+ define(ADCSBB, adc)
+ define(func, mpn_add_err1_n)')
+ifdef(`OPERATION_sub_err1_n', `
+ define(ADCSBB, sbb)
+ define(func, mpn_sub_err1_n)')
+
+MULFUNC_PROLOGUE(mpn_add_err1_n mpn_sub_err1_n)
+
+
+ASM_START()
+ TEXT
+ ALIGN(16)
+PROLOGUE(func)
+ mov cy_param, %rax
+
+ push %rbx
+ push %rbp
+ push %r12
+ push %r13
+ push %r14
+ push %r15
+
+ lea (up,n,8), up
+ lea (vp,n,8), vp
+ lea (rp,n,8), rp
+
+ mov R32(n), R32(%r10)
+ and $3, R32(%r10)
+ jz L(0mod4)
+ cmp $2, R32(%r10)
+ jc L(1mod4)
+ jz L(2mod4)
+L(3mod4):
+ xor R32(el), R32(el)
+ xor R32(eh), R32(eh)
+ xor R32(t0), R32(t0)
+ xor R32(t1), R32(t1)
+ lea -24(yp,n,8), yp
+ neg n
+
+ shr $1, %al C restore carry
+ mov (up,n,8), w0
+ mov 8(up,n,8), w1
+ ADCSBB (vp,n,8), w0
+ mov w0, (rp,n,8)
+ cmovc 16(yp), el
+ ADCSBB 8(vp,n,8), w1
+ mov w1, 8(rp,n,8)
+ cmovc 8(yp), t0
+ mov 16(up,n,8), w0
+ ADCSBB 16(vp,n,8), w0
+ mov w0, 16(rp,n,8)
+ cmovc (yp), t1
+ setc %al C save carry
+ add t0, el
+ adc $0, eh
+ add t1, el
+ adc $0, eh
+
+ add $3, n
+ jnz L(loop)
+ jmp L(end)
+
+ ALIGN(16)
+L(0mod4):
+ xor R32(el), R32(el)
+ xor R32(eh), R32(eh)
+ lea (yp,n,8), yp
+ neg n
+ jmp L(loop)
+
+ ALIGN(16)
+L(1mod4):
+ xor R32(el), R32(el)
+ xor R32(eh), R32(eh)
+ lea -8(yp,n,8), yp
+ neg n
+
+ shr $1, %al C restore carry
+ mov (up,n,8), w0
+ ADCSBB (vp,n,8), w0
+ mov w0, (rp,n,8)
+ cmovc (yp), el
+ setc %al C save carry
+
+ add $1, n
+ jnz L(loop)
+ jmp L(end)
+
+ ALIGN(16)
+L(2mod4):
+ xor R32(el), R32(el)
+ xor R32(eh), R32(eh)
+ xor R32(t0), R32(t0)
+ lea -16(yp,n,8), yp
+ neg n
+
+ shr $1, %al C restore carry
+ mov (up,n,8), w0
+ mov 8(up,n,8), w1
+ ADCSBB (vp,n,8), w0
+ mov w0, (rp,n,8)
+ cmovc 8(yp), el
+ ADCSBB 8(vp,n,8), w1
+ mov w1, 8(rp,n,8)
+ cmovc (yp), t0
+ setc %al C save carry
+ add t0, el
+ adc $0, eh
+
+ add $2, n
+ jnz L(loop)
+ jmp L(end)
+
+ ALIGN(32)
+L(loop):
+ mov (up,n,8), w0
+ shr $1, %al C restore carry
+ mov -8(yp), t0
+ mov $0, R32(t3)
+ ADCSBB (vp,n,8), w0
+ cmovnc t3, t0
+ mov w0, (rp,n,8)
+ mov 8(up,n,8), w1
+ mov 16(up,n,8), w0
+ ADCSBB 8(vp,n,8), w1
+ mov -16(yp), t1
+ cmovnc t3, t1
+ mov -24(yp), t2
+ mov w1, 8(rp,n,8)
+ ADCSBB 16(vp,n,8), w0
+ cmovnc t3, t2
+ mov 24(up,n,8), w1
+ ADCSBB 24(vp,n,8), w1
+ cmovc -32(yp), t3
+ setc %al C save carry
+ add t0, el
+ adc $0, eh
+ add t1, el
+ adc $0, eh
+ add t2, el
+ adc $0, eh
+ lea -32(yp), yp
+ mov w0, 16(rp,n,8)
+ add t3, el
+ adc $0, eh
+ add $4, n
+ mov w1, -8(rp,n,8)
+ jnz L(loop)
+
+L(end):
+ mov el, (ep)
+ mov eh, 8(ep)
+
+ pop %r15
+ pop %r14
+ pop %r13
+ pop %r12
+ pop %rbp
+ pop %rbx
+ ret
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/core2/aors_n.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/core2/aors_n.asm
new file mode 100644
index 00000000000..74a1bce48a2
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/core2/aors_n.asm
@@ -0,0 +1,141 @@
+dnl Intel mpn_add_n/mpn_sub_n optimised for Conroe, Nehalem.
+
+dnl Copyright 2006, 2007, 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/limb
+C AMD K8,K9 2
+C AMD K10 2
+C Intel P4 10
+C Intel core2 2
+C Intel NHM 2
+C Intel SBR 2
+C Intel atom 9
+C VIA nano 3
+
+C INPUT PARAMETERS
+define(`rp', `%rdi')
+define(`up', `%rsi')
+define(`vp', `%rdx')
+define(`n', `%rcx')
+define(`cy', `%r8')
+
+ifdef(`OPERATION_add_n', `
+ define(ADCSBB, adc)
+ define(func, mpn_add_n)
+ define(func_nc, mpn_add_nc)')
+ifdef(`OPERATION_sub_n', `
+ define(ADCSBB, sbb)
+ define(func, mpn_sub_n)
+ define(func_nc, mpn_sub_nc)')
+
+MULFUNC_PROLOGUE(mpn_add_n mpn_add_nc mpn_sub_n mpn_sub_nc)
+
+ABI_SUPPORT(DOS64)
+ABI_SUPPORT(STD64)
+
+ASM_START()
+ TEXT
+ ALIGN(16)
+PROLOGUE(func)
+ FUNC_ENTRY(4)
+ xor %r8, %r8
+L(start):
+ mov (up), %r10
+ mov (vp), %r11
+
+ lea (up,n,8), up
+ lea (vp,n,8), vp
+ lea (rp,n,8), rp
+ mov R32(n), R32(%rax)
+ neg n
+ and $3, R32(%rax)
+ je L(b00)
+ add %rax, n C clear low rcx bits for jrcxz
+ cmp $2, R32(%rax)
+ jl L(b01)
+ je L(b10)
+
+L(b11): neg %r8 C set cy
+ jmp L(e11)
+
+L(b00): neg %r8 C set cy
+ mov %r10, %r8
+ mov %r11, %r9
+ lea 4(n), n
+ jmp L(e00)
+
+ nop
+ nop
+ nop
+L(b01): neg %r8 C set cy
+ jmp L(top)
+
+L(b10): neg %r8 C set cy
+ mov %r10, %r8
+ mov %r11, %r9
+ jmp L(e10)
+
+L(end): ADCSBB %r11, %r10
+ mov %r10, -8(rp)
+ mov R32(%rcx), R32(%rax) C clear eax, ecx contains 0
+ adc R32(%rax), R32(%rax)
+ FUNC_EXIT()
+ ret
+
+ ALIGN(16)
+L(top): jrcxz L(end)
+ mov (up,n,8), %r8
+ mov (vp,n,8), %r9
+ lea 4(n), n
+ ADCSBB %r11, %r10
+ mov %r10, -40(rp,n,8)
+L(e00): mov -24(up,n,8), %r10
+ mov -24(vp,n,8), %r11
+ ADCSBB %r9, %r8
+ mov %r8, -32(rp,n,8)
+L(e11): mov -16(up,n,8), %r8
+ mov -16(vp,n,8), %r9
+ ADCSBB %r11, %r10
+ mov %r10, -24(rp,n,8)
+L(e10): mov -8(up,n,8), %r10
+ mov -8(vp,n,8), %r11
+ ADCSBB %r9, %r8
+ mov %r8, -16(rp,n,8)
+ jmp L(top)
+EPILOGUE()
+
+PROLOGUE(func_nc)
+ FUNC_ENTRY(4)
+IFDOS(` mov 56(%rsp), %r8 ')
+ jmp L(start)
+EPILOGUE()
+
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/core2/aorsmul_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/core2/aorsmul_1.asm
new file mode 100644
index 00000000000..6b313dd836e
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/core2/aorsmul_1.asm
@@ -0,0 +1,178 @@
+dnl x86-64 mpn_addmul_1 and mpn_submul_1, optimized for "Core 2".
+
+dnl Copyright 2003-2005, 2007-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/limb
+C AMD K8,K9 4
+C AMD K10 4
+C AMD bd1 5.1
+C AMD bobcat
+C Intel P4 ?
+C Intel core2 4.3-4.5 (fluctuating)
+C Intel NHM 5.0
+C Intel SBR 4.1
+C Intel atom ?
+C VIA nano 5.25
+
+C INPUT PARAMETERS
+define(`rp', `%rdi')
+define(`up', `%rsi')
+define(`n', `%rdx')
+define(`v0', `%rcx')
+
+ifdef(`OPERATION_addmul_1',`
+ define(`ADDSUB', `add')
+ define(`func', `mpn_addmul_1')
+ define(`func_1c', `mpn_addmul_1c')
+')
+ifdef(`OPERATION_submul_1',`
+ define(`ADDSUB', `sub')
+ define(`func', `mpn_submul_1')
+ define(`func_1c', `mpn_submul_1c')
+')
+
+MULFUNC_PROLOGUE(mpn_addmul_1 mpn_addmul_1c mpn_submul_1 mpn_submul_1c)
+
+ABI_SUPPORT(DOS64)
+ABI_SUPPORT(STD64)
+
+ C For DOS, on the stack we have four saved registers, return address,
+ C space for four register arguments, and finally the carry input.
+
+IFDOS(` define(`carry_in', `72(%rsp)')') dnl
+IFSTD(` define(`carry_in', `%r8')') dnl
+
+ASM_START()
+ TEXT
+ ALIGN(16)
+PROLOGUE(func_1c)
+ FUNC_ENTRY(4)
+ push %rbx
+ push %rbp
+ lea (%rdx), %rbx
+ neg %rbx
+
+ mov (up), %rax
+ mov (rp), %r10
+
+ lea -16(rp,%rdx,8), rp
+ lea (up,%rdx,8), up
+ mul %rcx
+ add carry_in, %rax
+ adc $0, %rdx
+ jmp L(start_nc)
+EPILOGUE()
+
+ ALIGN(16)
+PROLOGUE(func)
+ FUNC_ENTRY(4)
+ push %rbx
+ push %rbp
+ lea (%rdx), %rbx
+ neg %rbx
+
+ mov (up), %rax
+ mov (rp), %r10
+
+ lea -16(rp,%rdx,8), rp
+ lea (up,%rdx,8), up
+ mul %rcx
+
+L(start_nc):
+ bt $0, R32(%rbx)
+ jc L(odd)
+
+ lea (%rax), %r11
+ mov 8(up,%rbx,8), %rax
+ lea (%rdx), %rbp
+ mul %rcx
+ add $2, %rbx
+ jns L(n2)
+
+ lea (%rax), %r8
+ mov (up,%rbx,8), %rax
+ lea (%rdx), %r9
+ jmp L(mid)
+
+L(odd): add $1, %rbx
+ jns L(n1)
+
+ lea (%rax), %r8
+ mov (up,%rbx,8), %rax
+ lea (%rdx), %r9
+ mul %rcx
+ lea (%rax), %r11
+ mov 8(up,%rbx,8), %rax
+ lea (%rdx), %rbp
+ jmp L(e)
+
+ ALIGN(16)
+L(top): mul %rcx
+ ADDSUB %r8, %r10
+ lea (%rax), %r8
+ mov (up,%rbx,8), %rax
+ adc %r9, %r11
+ mov %r10, -8(rp,%rbx,8)
+ mov (rp,%rbx,8), %r10
+ lea (%rdx), %r9
+ adc $0, %rbp
+L(mid): mul %rcx
+ ADDSUB %r11, %r10
+ lea (%rax), %r11
+ mov 8(up,%rbx,8), %rax
+ adc %rbp, %r8
+ mov %r10, (rp,%rbx,8)
+ mov 8(rp,%rbx,8), %r10
+ lea (%rdx), %rbp
+ adc $0, %r9
+L(e): add $2, %rbx
+ js L(top)
+
+ mul %rcx
+ ADDSUB %r8, %r10
+ adc %r9, %r11
+ mov %r10, -8(rp)
+ adc $0, %rbp
+L(n2): mov (rp), %r10
+ ADDSUB %r11, %r10
+ adc %rbp, %rax
+ mov %r10, (rp)
+ adc $0, %rdx
+L(n1): mov 8(rp), %r10
+ ADDSUB %rax, %r10
+ mov %r10, 8(rp)
+ mov R32(%rbx), R32(%rax) C zero rax
+ adc %rdx, %rax
+ pop %rbp
+ pop %rbx
+ FUNC_EXIT()
+ ret
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/core2/copyd.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/core2/copyd.asm
new file mode 100644
index 00000000000..f0dc54a55e7
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/core2/copyd.asm
@@ -0,0 +1,37 @@
+dnl X86-64 mpn_copyd optimised for Intel Sandy Bridge.
+
+dnl Copyright 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')
+
+ABI_SUPPORT(DOS64)
+ABI_SUPPORT(STD64)
+
+MULFUNC_PROLOGUE(mpn_copyd)
+include_mpn(`x86_64/fastsse/copyd-palignr.asm')
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/core2/copyi.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/core2/copyi.asm
new file mode 100644
index 00000000000..9c26e00c522
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/core2/copyi.asm
@@ -0,0 +1,37 @@
+dnl X86-64 mpn_copyi optimised for Intel Sandy Bridge.
+
+dnl Copyright 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')
+
+ABI_SUPPORT(DOS64)
+ABI_SUPPORT(STD64)
+
+MULFUNC_PROLOGUE(mpn_copyi)
+include_mpn(`x86_64/fastsse/copyi-palignr.asm')
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/core2/divrem_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/core2/divrem_1.asm
new file mode 100644
index 00000000000..623bea386ca
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/core2/divrem_1.asm
@@ -0,0 +1,237 @@
+dnl x86-64 mpn_divrem_1 -- mpn by limb division.
+
+dnl Copyright 2004, 2005, 2007-2010, 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 norm unorm frac
+C AMD K8,K9 15 15 12
+C AMD K10 15 15 12
+C Intel P4 44 44 43
+C Intel core2 24 24 19.5
+C Intel corei 19 19 18
+C Intel atom 51 51 36
+C VIA nano 46 44 22.5
+
+C mp_limb_t
+C mpn_divrem_1 (mp_ptr qp, mp_size_t fn,
+C mp_srcptr np, mp_size_t nn, mp_limb_t d)
+
+C mp_limb_t
+C mpn_preinv_divrem_1 (mp_ptr qp, mp_size_t fn,
+C mp_srcptr np, mp_size_t nn, mp_limb_t d,
+C mp_limb_t dinv, int cnt)
+
+C INPUT PARAMETERS
+define(`qp', `%rdi')
+define(`fn_param', `%rsi')
+define(`up_param', `%rdx')
+define(`un_param', `%rcx')
+define(`d', `%r8')
+define(`dinv', `%r9') C only for mpn_preinv_divrem_1
+C shift passed on stack C only for mpn_preinv_divrem_1
+
+define(`cnt', `%rcx')
+define(`up', `%rsi')
+define(`fn', `%r12')
+define(`un', `%rbx')
+
+
+C rax rbx rcx rdx rsi rdi rbp r8 r9 r10 r11 r12 r13 r14 r15
+C cnt qp d dinv
+
+ABI_SUPPORT(DOS64)
+ABI_SUPPORT(STD64)
+
+IFSTD(`define(`CNTOFF', `40($1)')')
+IFDOS(`define(`CNTOFF', `104($1)')')
+
+ASM_START()
+ TEXT
+ ALIGN(16)
+PROLOGUE(mpn_preinv_divrem_1)
+ FUNC_ENTRY(4)
+IFDOS(` mov 56(%rsp), %r8 ')
+IFDOS(` mov 64(%rsp), %r9 ')
+ xor R32(%rax), R32(%rax)
+ push %r13
+ push %r12
+ push %rbp
+ push %rbx
+
+ mov fn_param, fn
+ mov un_param, un
+ add fn_param, un_param
+ mov up_param, up
+
+ lea -8(qp,un_param,8), qp
+
+ mov CNTOFF(%rsp), R8(cnt)
+ shl R8(cnt), d
+ jmp L(ent)
+EPILOGUE()
+
+ ALIGN(16)
+PROLOGUE(mpn_divrem_1)
+ FUNC_ENTRY(4)
+IFDOS(` mov 56(%rsp), %r8 ')
+ xor R32(%rax), R32(%rax)
+ push %r13
+ push %r12
+ push %rbp
+ push %rbx
+
+ mov fn_param, fn
+ mov un_param, un
+ add fn_param, un_param
+ mov up_param, up
+ je L(ret)
+
+ lea -8(qp,un_param,8), qp
+ xor R32(%rbp), R32(%rbp)
+
+L(unnormalized):
+ test un, un
+ je L(44)
+ mov -8(up,un,8), %rax
+ cmp d, %rax
+ jae L(44)
+ mov %rbp, (qp)
+ mov %rax, %rbp
+ lea -8(qp), qp
+ je L(ret)
+ dec un
+L(44):
+ bsr d, %rcx
+ not R32(%rcx)
+ sal R8(%rcx), d
+ sal R8(%rcx), %rbp
+
+ push %rcx
+IFSTD(` push %rdi ')
+IFSTD(` push %rsi ')
+ push %r8
+IFSTD(` mov d, %rdi ')
+IFDOS(` mov d, %rcx ')
+ CALL( mpn_invert_limb)
+ pop %r8
+IFSTD(` pop %rsi ')
+IFSTD(` pop %rdi ')
+ pop %rcx
+
+ mov %rax, dinv
+ mov %rbp, %rax
+ test un, un
+ je L(frac)
+L(ent): mov -8(up,un,8), %rbp
+ shr R8(%rcx), %rax
+ shld R8(%rcx), %rbp, %rax
+ sub $2, un
+ js L(end)
+
+ ALIGN(16)
+L(top): lea 1(%rax), %r11
+ mul dinv
+ mov (up,un,8), %r10
+ shld R8(%rcx), %r10, %rbp
+ mov %rbp, %r13
+ add %rax, %r13
+ adc %r11, %rdx
+ mov %rdx, %r11
+ imul d, %rdx
+ sub %rdx, %rbp
+ lea (d,%rbp), %rax
+ sub $8, qp
+ cmp %r13, %rbp
+ cmovc %rbp, %rax
+ adc $-1, %r11
+ cmp d, %rax
+ jae L(ufx)
+L(uok): dec un
+ mov %r11, 8(qp)
+ mov %r10, %rbp
+ jns L(top)
+
+L(end): lea 1(%rax), %r11
+ sal R8(%rcx), %rbp
+ mul dinv
+ add %rbp, %rax
+ adc %r11, %rdx
+ mov %rax, %r11
+ mov %rdx, %r13
+ imul d, %rdx
+ sub %rdx, %rbp
+ mov d, %rax
+ add %rbp, %rax
+ cmp %r11, %rbp
+ cmovc %rbp, %rax
+ adc $-1, %r13
+ cmp d, %rax
+ jae L(efx)
+L(eok): mov %r13, (qp)
+ sub $8, qp
+ jmp L(frac)
+
+L(ufx): sub d, %rax
+ inc %r11
+ jmp L(uok)
+L(efx): sub d, %rax
+ inc %r13
+ jmp L(eok)
+
+L(frac):mov d, %rbp
+ neg %rbp
+ jmp L(fent)
+
+ ALIGN(16) C K8-K10 P6-CNR P6-NHM P4
+L(ftop):mul dinv C 0,12 0,17 0,17
+ add %r11, %rdx C 5 8 10
+ mov %rax, %r11 C 4 8 3
+ mov %rdx, %r13 C 6 9 11
+ imul %rbp, %rdx C 6 9 11
+ mov d, %rax C
+ add %rdx, %rax C 10 14 14
+ cmp %r11, %rdx C 10 14 14
+ cmovc %rdx, %rax C 11 15 15
+ adc $-1, %r13 C
+ mov %r13, (qp) C
+ sub $8, qp C
+L(fent):lea 1(%rax), %r11 C
+ dec fn C
+ jns L(ftop) C
+
+ shr R8(%rcx), %rax
+L(ret): pop %rbx
+ pop %rbp
+ pop %r12
+ pop %r13
+ FUNC_EXIT()
+ ret
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/core2/gcd_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/core2/gcd_1.asm
new file mode 100644
index 00000000000..e0cab9b4e45
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/core2/gcd_1.asm
@@ -0,0 +1,144 @@
+dnl AMD64 mpn_gcd_1 optimised for Intel C2, NHM, SBR and AMD K10, BD.
+
+dnl Based on the K7 gcd_1.asm, by Kevin Ryde. Rehacked for AMD64 by Torbjorn
+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 AMD K8,K9 8.50
+C AMD K10 4.30
+C AMD bd1 5.00
+C AMD bobcat 10.0
+C Intel P4 18.6
+C Intel core2 3.83
+C Intel NHM 5.17
+C Intel SBR 4.69
+C Intel atom 17.0
+C VIA nano 5.44
+C Numbers measured with: speed -CD -s16-64 -t48 mpn_gcd_1
+
+C TODO
+C * Optimise inner-loop for specific CPUs.
+C * Use DIV for 1-by-1 reductions, at least for some CPUs.
+
+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', `%rdi')
+define(`n', `%rsi')
+define(`v0', `%rdx')
+
+ABI_SUPPORT(DOS64)
+ABI_SUPPORT(STD64)
+
+IFDOS(`define(`STACK_ALLOC', 40)')
+IFSTD(`define(`STACK_ALLOC', 8)')
+
+C Undo some configure cleverness.
+C The problem is that C only defines the '1c' variant, and that configure
+C therefore considers modexact_1c to be the base function. It then adds a
+C special fat rule for mpn_modexact_1_odd, messing up things when a cpudep
+C gcd_1 exists without a corresponding cpudep mode1o.
+ifdef(`WANT_FAT_BINARY', `
+ define(`mpn_modexact_1_odd', `MPN_PREFIX`modexact_1_odd_x86_64'')')
+
+
+ASM_START()
+ TEXT
+ ALIGN(16)
+PROLOGUE(mpn_gcd_1)
+ FUNC_ENTRY(3)
+ mov (up), %rax C U low limb
+ or v0, %rax
+ bsf %rax, %rax C min(ctz(u0),ctz(v0))
+
+ bsf v0, %rcx
+ shr R8(%rcx), v0
+
+ push %rax C preserve common twos over call
+ push v0 C preserve v0 argument over call
+ sub $STACK_ALLOC, %rsp C maintain ABI required rsp alignment
+
+ cmp $1, n
+ jnz L(reduce_nby1)
+
+C Both U and V are single limbs, reduce with bmod if u0 >> v0.
+ mov (up), %r8
+ mov %r8, %rax
+ shr $BMOD_THRES_LOG2, %r8
+ cmp %r8, v0
+ ja L(reduced)
+ jmp L(bmod)
+
+L(reduce_nby1):
+ cmp $BMOD_1_TO_MOD_1_THRESHOLD, n
+ jl L(bmod)
+IFDOS(` mov %rdx, %r8 ')
+IFDOS(` mov %rsi, %rdx ')
+IFDOS(` mov %rdi, %rcx ')
+ CALL( mpn_mod_1)
+ jmp L(reduced)
+L(bmod):
+IFDOS(` mov %rdx, %r8 ')
+IFDOS(` mov %rsi, %rdx ')
+IFDOS(` mov %rdi, %rcx ')
+ CALL( mpn_modexact_1_odd)
+L(reduced):
+
+ add $STACK_ALLOC, %rsp
+ pop %rdx
+
+ bsf %rax, %rcx
+C test %rax, %rax C FIXME: does this lower latency?
+ jnz L(mid)
+ jmp L(end)
+
+ ALIGN(16) C K10 BD C2 NHM SBR
+L(top): cmovc %r10, %rax C if x-y < 0 0,3 0,3 0,6 0,5 0,5
+ cmovc %r9, %rdx C use x,y-x 0,3 0,3 2,8 1,7 1,7
+L(mid): shr R8(%rcx), %rax C 1,7 1,6 2,8 2,8 2,8
+ mov %rdx, %r10 C 1 1 4 3 3
+ sub %rax, %r10 C 2 2 5 4 4
+ bsf %r10, %rcx C 3 3 6 5 5
+ mov %rax, %r9 C 2 2 3 3 4
+ sub %rdx, %rax C 2 2 4 3 4
+ jnz L(top) C
+
+L(end): pop %rcx
+ mov %rdx, %rax
+ shl R8(%rcx), %rax
+ FUNC_EXIT()
+ ret
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/core2/gmp-mparam.h b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/core2/gmp-mparam.h
new file mode 100644
index 00000000000..0f4f88f7807
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/core2/gmp-mparam.h
@@ -0,0 +1,217 @@
+/* Core 2 gmp-mparam.h -- Compiler/machine parameter header file.
+
+Copyright 1991, 1993, 1994, 2000-2010, 2012, 2014 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
+
+/* 2133 MHz Core 2 (65nm) */
+/* FFT tuning limit = 60000000 */
+/* Generated by tuneup.c, 2014-03-13, gcc 4.5 */
+
+#define MOD_1_NORM_THRESHOLD 0 /* always */
+#define MOD_1_UNNORM_THRESHOLD 0 /* always */
+#define MOD_1N_TO_MOD_1_1_THRESHOLD 4
+#define MOD_1U_TO_MOD_1_1_THRESHOLD 3
+#define MOD_1_1_TO_MOD_1_2_THRESHOLD 11
+#define MOD_1_2_TO_MOD_1_4_THRESHOLD 16
+#define PREINV_MOD_1_TO_MOD_1_THRESHOLD 9
+#define USE_PREINV_DIVREM_1 1 /* native */
+#define DIV_QR_1_NORM_THRESHOLD 1
+#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 23
+#define MUL_TOOM33_THRESHOLD 65
+#define MUL_TOOM44_THRESHOLD 179
+#define MUL_TOOM6H_THRESHOLD 268
+#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 73
+#define MUL_TOOM42_TO_TOOM63_THRESHOLD 78
+#define MUL_TOOM43_TO_TOOM54_THRESHOLD 100
+
+#define SQR_BASECASE_THRESHOLD 0 /* always (native) */
+#define SQR_TOOM2_THRESHOLD 28
+#define SQR_TOOM3_THRESHOLD 102
+#define SQR_TOOM4_THRESHOLD 160
+#define SQR_TOOM6_THRESHOLD 222
+#define SQR_TOOM8_THRESHOLD 296
+
+#define MULMID_TOOM42_THRESHOLD 28
+
+#define MULMOD_BNM1_THRESHOLD 12
+#define SQRMOD_BNM1_THRESHOLD 13
+
+#define MUL_FFT_MODF_THRESHOLD 372 /* k = 5 */
+#define MUL_FFT_TABLE3 \
+ { { 372, 5}, { 17, 6}, { 9, 5}, { 19, 6}, \
+ { 21, 7}, { 11, 6}, { 23, 7}, { 12, 6}, \
+ { 25, 7}, { 21, 8}, { 11, 7}, { 25, 8}, \
+ { 13, 7}, { 27, 8}, { 15, 7}, { 32, 8}, \
+ { 17, 7}, { 36, 8}, { 19, 7}, { 40, 8}, \
+ { 21, 9}, { 11, 8}, { 27, 9}, { 15, 8}, \
+ { 35, 9}, { 19, 8}, { 41, 9}, { 23, 8}, \
+ { 47, 9}, { 27,10}, { 15, 9}, { 43,10}, \
+ { 23, 9}, { 51,11}, { 15,10}, { 31, 9}, \
+ { 63,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, 9}, { 271,11}, \
+ { 79,10}, { 159, 9}, { 319,10}, { 167,11}, \
+ { 95,10}, { 191, 9}, { 383,10}, { 207,11}, \
+ { 111,12}, { 63,11}, { 127,10}, { 271,11}, \
+ { 143,10}, { 287, 9}, { 575,10}, { 303,11}, \
+ { 159,10}, { 319,12}, { 95,11}, { 191,10}, \
+ { 383,11}, { 207,10}, { 415,11}, { 223,13}, \
+ { 63,12}, { 127,11}, { 271,10}, { 543,11}, \
+ { 287,10}, { 575,11}, { 303,10}, { 607,12}, \
+ { 159,11}, { 319,10}, { 639,11}, { 351,12}, \
+ { 191,11}, { 415,12}, { 223,11}, { 479,13}, \
+ { 127,12}, { 255,11}, { 543,12}, { 287,11}, \
+ { 607,12}, { 319,11}, { 639,12}, { 351,11}, \
+ { 703,13}, { 191,12}, { 415,11}, { 831,12}, \
+ { 479,14}, { 127,13}, { 255,12}, { 607,13}, \
+ { 319,12}, { 703,13}, { 383,12}, { 831,13}, \
+ { 447,12}, { 959,14}, { 255,13}, { 511,12}, \
+ { 1023,13}, { 575,12}, { 1215,13}, { 639,12}, \
+ { 1279,13}, { 703,14}, { 383,13}, { 831,12}, \
+ { 1663,13}, { 895,15}, { 255,14}, { 511,13}, \
+ { 1151,14}, { 639,13}, { 1343,14}, { 767,13}, \
+ { 1599,14}, { 895,15}, { 511,14}, { 1279,13}, \
+ { 2687,14}, { 1407,13}, { 2815,15}, { 767,14}, \
+ { 1535,13}, { 3199,14}, { 1663,13}, { 3455,16}, \
+ { 511,15}, { 1023,14}, { 2047,13}, { 4095,14}, \
+ { 2175,12}, { 8959,14}, { 2303,13}, { 4607,12}, \
+ { 9471,14}, { 2431,13}, { 4863,12}, { 9983,15}, \
+ { 1279,14}, { 2559,12}, { 10239,14}, { 2687,12}, \
+ { 11775,15}, { 1535,14}, { 3327,13}, { 6655,14}, \
+ { 3455,13}, { 6911,14}, { 3583,12}, { 14335,11}, \
+ { 28671,10}, { 57343,11}, { 2048,12}, { 4096,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 183
+#define MUL_FFT_THRESHOLD 4736
+
+#define SQR_FFT_MODF_THRESHOLD 340 /* k = 5 */
+#define SQR_FFT_TABLE3 \
+ { { 340, 5}, { 15, 6}, { 8, 5}, { 17, 6}, \
+ { 9, 5}, { 19, 6}, { 23, 7}, { 12, 6}, \
+ { 25, 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}, { 43,10}, \
+ { 23, 9}, { 55,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, 8}, { 511, 9}, \
+ { 271, 8}, { 543,11}, { 79, 9}, { 319, 8}, \
+ { 639,11}, { 95,10}, { 191, 9}, { 383,10}, \
+ { 207, 9}, { 415,12}, { 63,11}, { 127,10}, \
+ { 271, 9}, { 543,10}, { 287, 9}, { 575,10}, \
+ { 303, 9}, { 607,10}, { 319, 9}, { 639,11}, \
+ { 175,12}, { 95,11}, { 191,10}, { 383,11}, \
+ { 207,10}, { 415,13}, { 63,12}, { 127,11}, \
+ { 271,10}, { 543,11}, { 287,10}, { 575,11}, \
+ { 303,10}, { 607,11}, { 319,10}, { 639,11}, \
+ { 351,12}, { 191,11}, { 415,10}, { 831,12}, \
+ { 223,11}, { 447,10}, { 895,11}, { 479,13}, \
+ { 127,12}, { 255,11}, { 543,12}, { 287,11}, \
+ { 607,12}, { 319,11}, { 639,12}, { 351,13}, \
+ { 191,12}, { 415,11}, { 831,12}, { 479,14}, \
+ { 127,13}, { 255,12}, { 607,13}, { 319,12}, \
+ { 703,13}, { 383,12}, { 831,13}, { 447,12}, \
+ { 959,14}, { 255,13}, { 511,12}, { 1023,13}, \
+ { 575,12}, { 1215,13}, { 639,12}, { 1279,13}, \
+ { 703,14}, { 383,13}, { 831,12}, { 1663,13}, \
+ { 959,15}, { 255,14}, { 511,13}, { 1087,12}, \
+ { 2175,13}, { 1215,14}, { 639,13}, { 1343,12}, \
+ { 2687,13}, { 1407,12}, { 2815,14}, { 767,13}, \
+ { 1663,14}, { 895,15}, { 511,14}, { 1023,13}, \
+ { 2175,14}, { 1151,13}, { 2303,12}, { 4607,13}, \
+ { 2431,12}, { 4863,14}, { 1279,13}, { 2687,14}, \
+ { 1407,15}, { 767,14}, { 1535,13}, { 3071,14}, \
+ { 1663,13}, { 3455,12}, { 6911,14}, { 1791,13}, \
+ { 3583,16}, { 511,15}, { 1023,14}, { 2175,13}, \
+ { 4351,14}, { 2303,13}, { 4607,14}, { 2431,13}, \
+ { 4863,15}, { 1279,14}, { 2815,13}, { 5631,14}, \
+ { 2943,13}, { 5887,15}, { 1535,14}, { 3455,13}, \
+ { 6911,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 179
+#define SQR_FFT_THRESHOLD 3008
+
+#define MULLO_BASECASE_THRESHOLD 0 /* always */
+#define MULLO_DC_THRESHOLD 62
+#define MULLO_MUL_N_THRESHOLD 9174
+
+#define DC_DIV_QR_THRESHOLD 46
+#define DC_DIVAPPR_Q_THRESHOLD 155
+#define DC_BDIV_QR_THRESHOLD 50
+#define DC_BDIV_Q_THRESHOLD 94
+
+#define INV_MULMOD_BNM1_THRESHOLD 48
+#define INV_NEWTON_THRESHOLD 156
+#define INV_APPR_THRESHOLD 155
+
+#define BINV_NEWTON_THRESHOLD 234
+#define REDC_1_TO_REDC_2_THRESHOLD 22
+#define REDC_2_TO_REDC_N_THRESHOLD 48
+
+#define MU_DIV_QR_THRESHOLD 1187
+#define MU_DIVAPPR_Q_THRESHOLD 1142
+#define MUPI_DIV_QR_THRESHOLD 74
+#define MU_BDIV_QR_THRESHOLD 1017
+#define MU_BDIV_Q_THRESHOLD 1187
+
+#define POWM_SEC_TABLE 1,64,131,269,466
+
+#define MATRIX22_STRASSEN_THRESHOLD 19
+#define HGCD_THRESHOLD 117
+#define HGCD_APPR_THRESHOLD 151
+#define HGCD_REDUCE_THRESHOLD 2121
+#define GCD_DC_THRESHOLD 427
+#define GCDEXT_DC_THRESHOLD 342
+#define JACOBI_BASE_METHOD 4
+
+#define GET_STR_DC_THRESHOLD 11
+#define GET_STR_PRECOMPUTE_THRESHOLD 18
+#define SET_STR_DC_THRESHOLD 552
+#define SET_STR_PRECOMPUTE_THRESHOLD 1561
+
+#define FAC_DSC_THRESHOLD 656
+#define FAC_ODD_THRESHOLD 23
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/core2/lshift.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/core2/lshift.asm
new file mode 100644
index 00000000000..8ccafeca6c6
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/core2/lshift.asm
@@ -0,0 +1,149 @@
+dnl x86-64 mpn_lshift optimized for "Core 2".
+
+dnl Copyright 2007, 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/limb
+C AMD K8,K9 4.25
+C AMD K10 4.25
+C Intel P4 14.7
+C Intel core2 1.27
+C Intel NHM 1.375 (up to about n = 260, then 1.5)
+C Intel SBR 1.87
+C Intel atom ?
+C VIA nano ?
+
+
+C INPUT PARAMETERS
+define(`rp', `%rdi')
+define(`up', `%rsi')
+define(`n', `%rdx')
+define(`cnt', `%rcx')
+
+ABI_SUPPORT(DOS64)
+ABI_SUPPORT(STD64)
+
+ASM_START()
+ TEXT
+ ALIGN(16)
+PROLOGUE(mpn_lshift)
+ FUNC_ENTRY(4)
+ lea -8(rp,n,8), rp
+ lea -8(up,n,8), up
+
+ mov R32(%rdx), R32(%rax)
+ and $3, R32(%rax)
+ jne L(nb00)
+L(b00): C n = 4, 8, 12, ...
+ mov (up), %r10
+ mov -8(up), %r11
+ xor R32(%rax), R32(%rax)
+ shld R8(cnt), %r10, %rax
+ mov -16(up), %r8
+ lea 24(rp), rp
+ sub $4, n
+ jmp L(00)
+
+L(nb00):C n = 1, 5, 9, ...
+ cmp $2, R32(%rax)
+ jae L(nb01)
+L(b01): mov (up), %r9
+ xor R32(%rax), R32(%rax)
+ shld R8(cnt), %r9, %rax
+ sub $2, n
+ jb L(le1)
+ mov -8(up), %r10
+ mov -16(up), %r11
+ lea -8(up), up
+ lea 16(rp), rp
+ jmp L(01)
+L(le1): shl R8(cnt), %r9
+ mov %r9, (rp)
+ FUNC_EXIT()
+ ret
+
+L(nb01):C n = 2, 6, 10, ...
+ jne L(b11)
+L(b10): mov (up), %r8
+ mov -8(up), %r9
+ xor R32(%rax), R32(%rax)
+ shld R8(cnt), %r8, %rax
+ sub $3, n
+ jb L(le2)
+ mov -16(up), %r10
+ lea -16(up), up
+ lea 8(rp), rp
+ jmp L(10)
+L(le2): shld R8(cnt), %r9, %r8
+ mov %r8, (rp)
+ shl R8(cnt), %r9
+ mov %r9, -8(rp)
+ FUNC_EXIT()
+ ret
+
+ ALIGN(16) C performance critical!
+L(b11): C n = 3, 7, 11, ...
+ mov (up), %r11
+ mov -8(up), %r8
+ xor R32(%rax), R32(%rax)
+ shld R8(cnt), %r11, %rax
+ mov -16(up), %r9
+ lea -24(up), up
+ sub $4, n
+ jb L(end)
+
+ ALIGN(16)
+L(top): shld R8(cnt), %r8, %r11
+ mov (up), %r10
+ mov %r11, (rp)
+L(10): shld R8(cnt), %r9, %r8
+ mov -8(up), %r11
+ mov %r8, -8(rp)
+L(01): shld R8(cnt), %r10, %r9
+ mov -16(up), %r8
+ mov %r9, -16(rp)
+L(00): shld R8(cnt), %r11, %r10
+ mov -24(up), %r9
+ mov %r10, -24(rp)
+ add $-32, up
+ lea -32(rp), rp
+ sub $4, n
+ jnc L(top)
+
+L(end): shld R8(cnt), %r8, %r11
+ mov %r11, (rp)
+ shld R8(cnt), %r9, %r8
+ mov %r8, -8(rp)
+ shl R8(cnt), %r9
+ mov %r9, -16(rp)
+ FUNC_EXIT()
+ ret
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/core2/lshiftc.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/core2/lshiftc.asm
new file mode 100644
index 00000000000..65c7b2f1b86
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/core2/lshiftc.asm
@@ -0,0 +1,159 @@
+dnl x86-64 mpn_lshiftc optimized for "Core 2".
+
+dnl Copyright 2007, 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/limb
+C AMD K8,K9 ?
+C AMD K10 ?
+C Intel P4 ?
+C Intel core2 1.5
+C Intel NHM 2.25 (up to about n = 260, then 1.875)
+C Intel SBR 2.25
+C Intel atom ?
+C VIA nano ?
+
+
+C INPUT PARAMETERS
+define(`rp', `%rdi')
+define(`up', `%rsi')
+define(`n', `%rdx')
+define(`cnt', `%rcx')
+
+ABI_SUPPORT(DOS64)
+ABI_SUPPORT(STD64)
+
+ASM_START()
+ TEXT
+ ALIGN(16)
+PROLOGUE(mpn_lshiftc)
+ FUNC_ENTRY(4)
+ lea -8(rp,n,8), rp
+ lea -8(up,n,8), up
+
+ mov R32(%rdx), R32(%rax)
+ and $3, R32(%rax)
+ jne L(nb00)
+L(b00): C n = 4, 8, 12, ...
+ mov (up), %r10
+ mov -8(up), %r11
+ xor R32(%rax), R32(%rax)
+ shld R8(cnt), %r10, %rax
+ mov -16(up), %r8
+ lea 24(rp), rp
+ sub $4, n
+ jmp L(00)
+
+L(nb00):C n = 1, 5, 9, ...
+ cmp $2, R32(%rax)
+ jae L(nb01)
+L(b01): mov (up), %r9
+ xor R32(%rax), R32(%rax)
+ shld R8(cnt), %r9, %rax
+ sub $2, n
+ jb L(le1)
+ mov -8(up), %r10
+ mov -16(up), %r11
+ lea -8(up), up
+ lea 16(rp), rp
+ jmp L(01)
+L(le1): shl R8(cnt), %r9
+ not %r9
+ mov %r9, (rp)
+ FUNC_EXIT()
+ ret
+
+L(nb01):C n = 2, 6, 10, ...
+ jne L(b11)
+L(b10): mov (up), %r8
+ mov -8(up), %r9
+ xor R32(%rax), R32(%rax)
+ shld R8(cnt), %r8, %rax
+ sub $3, n
+ jb L(le2)
+ mov -16(up), %r10
+ lea -16(up), up
+ lea 8(rp), rp
+ jmp L(10)
+L(le2): shld R8(cnt), %r9, %r8
+ not %r8
+ mov %r8, (rp)
+ shl R8(cnt), %r9
+ not %r9
+ mov %r9, -8(rp)
+ FUNC_EXIT()
+ ret
+
+ ALIGN(16) C performance critical!
+L(b11): C n = 3, 7, 11, ...
+ mov (up), %r11
+ mov -8(up), %r8
+ xor R32(%rax), R32(%rax)
+ shld R8(cnt), %r11, %rax
+ mov -16(up), %r9
+ lea -24(up), up
+ sub $4, n
+ jb L(end)
+
+ ALIGN(16)
+L(top): shld R8(cnt), %r8, %r11
+ mov (up), %r10
+ not %r11
+ mov %r11, (rp)
+L(10): shld R8(cnt), %r9, %r8
+ mov -8(up), %r11
+ not %r8
+ mov %r8, -8(rp)
+L(01): shld R8(cnt), %r10, %r9
+ mov -16(up), %r8
+ not %r9
+ mov %r9, -16(rp)
+L(00): shld R8(cnt), %r11, %r10
+ mov -24(up), %r9
+ not %r10
+ mov %r10, -24(rp)
+ add $-32, up
+ lea -32(rp), rp
+ sub $4, n
+ jnc L(top)
+
+L(end): shld R8(cnt), %r8, %r11
+ not %r11
+ mov %r11, (rp)
+ shld R8(cnt), %r9, %r8
+ not %r8
+ mov %r8, -8(rp)
+ shl R8(cnt), %r9
+ not %r9
+ mov %r9, -16(rp)
+ FUNC_EXIT()
+ ret
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/core2/mul_basecase.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/core2/mul_basecase.asm
new file mode 100644
index 00000000000..d16be852f76
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/core2/mul_basecase.asm
@@ -0,0 +1,975 @@
+dnl X86-64 mpn_mul_basecase optimised for Intel Nehalem/Westmere.
+dnl It also seems good for Conroe/Wolfdale.
+
+dnl Contributed to the GNU project by Torbjörn Granlund.
+
+dnl Copyright 2008, 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/limb mul_1 mul_2 mul_3 addmul_2
+C AMD K8,K9
+C AMD K10
+C AMD bull
+C AMD pile
+C AMD steam
+C AMD bobcat
+C AMD jaguar
+C Intel P4
+C Intel core 4.0 4.0 - 4.18-4.25
+C Intel NHM 3.75 3.8 - 4.06-4.2
+C Intel SBR
+C Intel IBR
+C Intel HWL
+C Intel BWL
+C Intel atom
+C VIA nano
+
+C The inner loops of this code are the result of running a code generation and
+C optimisation tool suite written by David Harvey and Torbjörn Granlund.
+
+C Code structure:
+C
+C
+C m_1(0m4) m_1(1m4) m_1(2m4) m_1(3m4)
+C | | | |
+C m_2(0m4) | m_2(1m4) | m_2(2m4) | m_2(3m4) |
+C | / | / | / | /
+C | / | / | / | /
+C | / | / | / | /
+C \|/ |/_ \|/ |/_ \|/ |/_ \|/ |/_
+C _____ _____ _____ _____
+C / \ / \ / \ / \
+C \|/ | \|/ | \|/ | \|/ |
+C am_2(0m4) | am_2(1m4) | am_2(2m4) | am_2(3m4) |
+C \ /|\ \ /|\ \ /|\ \ /|\
+C \_____/ \_____/ \_____/ \_____/
+
+C TODO
+C * Tune. None done so far.
+C * Currently 2687 bytes, making it smaller would be nice.
+C * Implement some basecases, say for un < 4.
+C * Try zeroing with xor in m2 loops.
+C * Try re-rolling the m2 loops to avoid the current 9 insn code duplication
+C between loop header and wind-down code.
+C * Consider adc reg,reg instead of adc $0,reg in m2 loops. This save a byte.
+
+C When playing with pointers, set this to $2 to fall back to conservative
+C indexing in wind-down code.
+define(`I',`$1')
+
+C Define this to $1 to use late loop index variable as zero, $2 to use an
+C explicit $0.
+define(`Z',`$1')
+
+define(`rp', `%rdi')
+define(`up', `%rsi')
+define(`un_param', `%rdx')
+define(`vp_param', `%rcx') C FIXME reallocate vp to rcx but watch performance!
+define(`vn_param', `%r8')
+
+define(`un', `%r9')
+define(`vn', `(%rsp)')
+
+define(`v0', `%r10')
+define(`v1', `%r11')
+define(`w0', `%rbx')
+define(`w1', `%rcx')
+define(`w2', `%rbp')
+define(`w3', `%r12')
+define(`i', `%r13')
+define(`vp', `%r14')
+
+define(`X0', `%r8')
+define(`X1', `%r15')
+
+C rax rbx rcx rdx rdi rsi rbp r8 r9 r10 r11 r12 r13 r14 r15
+
+ABI_SUPPORT(DOS64)
+ABI_SUPPORT(STD64)
+
+define(`ALIGNx', `ALIGN(16)')
+
+define(`N', 85)
+ifdef(`N',,`define(`N',0)')
+define(`MOV', `ifelse(eval(N & $3),0,`mov $1, $2',`lea ($1), $2')')
+
+ASM_START()
+ TEXT
+ ALIGN(32)
+PROLOGUE(mpn_mul_basecase)
+ FUNC_ENTRY(4)
+IFDOS(` mov 56(%rsp), %r8d ')
+ mov (up), %rax C shared for mul_1 and mul_2
+ push %rbx
+ push %rbp
+ push %r12
+ push %r13
+ push %r14
+
+ mov (vp_param), v0 C shared for mul_1 and mul_2
+
+ xor un, un
+ sub un_param, un C un = -un_param
+
+ lea (up,un_param,8), up
+ lea (rp,un_param,8), rp
+
+ mul v0 C shared for mul_1 and mul_2
+
+ test $1, R8(vn_param)
+ jz L(m2)
+
+ lea 8(vp_param), vp C FIXME: delay until known needed
+
+ test $1, R8(un)
+ jnz L(m1x1)
+
+L(m1x0):test $2, R8(un)
+ jnz L(m1s2)
+
+L(m1s0):
+ lea (un), i
+ mov %rax, (rp,un,8)
+ mov 8(up,un,8), %rax
+ mov %rdx, w0 C FIXME: Use lea?
+ lea L(do_am0)(%rip), %rbp
+ jmp L(m1e0)
+
+L(m1s2):
+ lea 2(un), i
+ mov %rax, (rp,un,8)
+ mov 8(up,un,8), %rax
+ mov %rdx, w0 C FIXME: Use lea?
+ mul v0
+ lea L(do_am2)(%rip), %rbp
+ test i, i
+ jnz L(m1e2)
+ add %rax, w0
+ adc $0, %rdx
+ mov w0, I(-8(rp),8(rp,un,8))
+ mov %rdx, I((rp),16(rp,un,8))
+ jmp L(ret2)
+
+L(m1x1):test $2, R8(un)
+ jz L(m1s3)
+
+L(m1s1):
+ lea 1(un), i
+ mov %rax, (rp,un,8)
+ test i, i
+ jz L(1)
+ mov 8(up,un,8), %rax
+ mov %rdx, w1 C FIXME: Use lea?
+ lea L(do_am1)(%rip), %rbp
+ jmp L(m1e1)
+L(1): mov %rdx, I((rp),8(rp,un,8))
+ jmp L(ret2)
+
+L(m1s3):
+ lea -1(un), i
+ mov %rax, (rp,un,8)
+ mov 8(up,un,8), %rax
+ mov %rdx, w1 C FIXME: Use lea?
+ lea L(do_am3)(%rip), %rbp
+ jmp L(m1e3)
+
+ ALIGNx
+L(m1top):
+ mul v0
+ mov w1, -16(rp,i,8)
+L(m1e2):xor R32(w1), R32(w1)
+ add %rax, w0
+ mov (up,i,8), %rax
+ adc %rdx, w1
+ mov w0, -8(rp,i,8)
+L(m1e1):xor R32(w0), R32(w0)
+ mul v0
+ add %rax, w1
+ mov 8(up,i,8), %rax
+ adc %rdx, w0
+ mov w1, (rp,i,8)
+L(m1e0):xor R32(w1), R32(w1)
+ mul v0
+ add %rax, w0
+ mov 16(up,i,8), %rax
+ adc %rdx, w1
+ mov w0, 8(rp,i,8)
+L(m1e3):xor R32(w0), R32(w0)
+ mul v0
+ add %rax, w1
+ mov 24(up,i,8), %rax
+ adc %rdx, w0
+ add $4, i
+ js L(m1top)
+
+ mul v0
+ mov w1, I(-16(rp),-16(rp,i,8))
+ add %rax, w0
+ adc $0, %rdx
+ mov w0, I(-8(rp),-8(rp,i,8))
+ mov %rdx, I((rp),(rp,i,8))
+
+ dec vn_param
+ jz L(ret2)
+ lea -8(rp), rp
+ jmp *%rbp
+
+L(m2):
+ mov 8(vp_param), v1
+ lea 16(vp_param), vp C FIXME: delay until known needed
+
+ test $1, R8(un)
+ jnz L(bx1)
+
+L(bx0): test $2, R8(un)
+ jnz L(b10)
+
+L(b00): lea (un), i
+ mov %rax, (rp,un,8)
+ mov %rdx, w1 C FIXME: Use lea?
+ mov (up,un,8), %rax
+ mov $0, R32(w2)
+ jmp L(m2e0)
+
+L(b10): lea -2(un), i
+ mov %rax, w2 C FIXME: Use lea?
+ mov (up,un,8), %rax
+ mov %rdx, w3 C FIXME: Use lea?
+ mov $0, R32(w0)
+ jmp L(m2e2)
+
+L(bx1): test $2, R8(un)
+ jz L(b11)
+
+L(b01): lea 1(un), i
+ mov %rax, (rp,un,8)
+ mov (up,un,8), %rax
+ mov %rdx, w0 C FIXME: Use lea?
+ mov $0, R32(w1)
+ jmp L(m2e1)
+
+L(b11): lea -1(un), i
+ mov %rax, w1 C FIXME: Use lea?
+ mov (up,un,8), %rax
+ mov %rdx, w2 C FIXME: Use lea?
+ mov $0, R32(w3)
+ jmp L(m2e3)
+
+ ALIGNx
+L(m2top0):
+ mul v0
+ add %rax, w3
+ mov -8(up,i,8), %rax
+ mov w3, -8(rp,i,8)
+ adc %rdx, w0
+ adc $0, R32(w1)
+ mul v1
+ add %rax, w0
+ adc %rdx, w1
+ mov $0, R32(w2)
+ mov (up,i,8), %rax
+ mul v0
+ add %rax, w0
+ mov w0, (rp,i,8)
+ adc %rdx, w1
+ mov (up,i,8), %rax
+ adc $0, R32(w2)
+L(m2e0):mul v1
+ add %rax, w1
+ adc %rdx, w2
+ mov 8(up,i,8), %rax
+ mul v0
+ mov $0, R32(w3)
+ add %rax, w1
+ adc %rdx, w2
+ adc $0, R32(w3)
+ mov 8(up,i,8), %rax
+ mul v1
+ add %rax, w2
+ mov w1, 8(rp,i,8)
+ adc %rdx, w3
+ mov $0, R32(w0)
+ mov 16(up,i,8), %rax
+ mul v0
+ add %rax, w2
+ mov 16(up,i,8), %rax
+ adc %rdx, w3
+ adc $0, R32(w0)
+ mul v1
+ mov $0, R32(w1)
+ add %rax, w3
+ mov 24(up,i,8), %rax
+ mov w2, 16(rp,i,8)
+ adc %rdx, w0
+ add $4, i
+ js L(m2top0)
+
+ mul v0
+ add %rax, w3
+ mov I(-8(up),-8(up,i,8)), %rax
+ mov w3, I(-8(rp),-8(rp,i,8))
+ adc %rdx, w0
+ adc R32(w1), R32(w1)
+ mul v1
+ add %rax, w0
+ adc %rdx, w1
+ mov w0, I((rp),(rp,i,8))
+ mov w1, I(8(rp),8(rp,i,8))
+
+ add $-2, vn_param
+ jz L(ret2)
+
+L(do_am0):
+ push %r15
+ push vn_param
+
+L(olo0):
+ mov (vp), v0
+ mov 8(vp), v1
+ lea 16(vp), vp
+ lea 16(rp), rp
+ mov (up,un,8), %rax
+C lea 0(un), i
+ mov un, i
+ mul v0
+ mov %rax, X0
+ mov (up,un,8), %rax
+ MOV( %rdx, X1, 2)
+ mul v1
+ MOV( %rdx, w0, 4)
+ mov (rp,un,8), w2
+ mov %rax, w3
+ jmp L(lo0)
+
+ ALIGNx
+L(am2top0):
+ mul v1
+ add w0, w1
+ adc %rax, w2
+ mov (up,i,8), %rax
+ MOV( %rdx, w3, 1)
+ adc $0, w3
+ mul v0
+ add w1, X1
+ mov X1, -8(rp,i,8)
+ adc %rax, X0
+ MOV( %rdx, X1, 2)
+ adc $0, X1
+ mov (up,i,8), %rax
+ mul v1
+ MOV( %rdx, w0, 4)
+ mov (rp,i,8), w1
+ add w1, w2
+ adc %rax, w3
+ adc $0, w0
+L(lo0): mov 8(up,i,8), %rax
+ mul v0
+ add w2, X0
+ adc %rax, X1
+ mov X0, (rp,i,8)
+ MOV( %rdx, X0, 8)
+ adc $0, X0
+ mov 8(up,i,8), %rax
+ mov 8(rp,i,8), w2
+ mul v1
+ add w2, w3
+ adc %rax, w0
+ MOV( %rdx, w1, 16)
+ adc $0, w1
+ mov 16(up,i,8), %rax
+ mul v0
+ add w3, X1
+ mov X1, 8(rp,i,8)
+ adc %rax, X0
+ MOV( %rdx, X1, 32)
+ mov 16(rp,i,8), w3
+ adc $0, X1
+ mov 16(up,i,8), %rax
+ mul v1
+ add w3, w0
+ MOV( %rdx, w2, 64)
+ adc %rax, w1
+ mov 24(up,i,8), %rax
+ adc $0, w2
+ mul v0
+ add w0, X0
+ mov X0, 16(rp,i,8)
+ MOV( %rdx, X0, 128)
+ adc %rax, X1
+ mov 24(up,i,8), %rax
+ mov 24(rp,i,8), w0
+ adc $0, X0
+ add $4, i
+ jnc L(am2top0)
+
+ mul v1
+ add w0, w1
+ adc %rax, w2
+ adc Z(i,$0), %rdx
+ add w1, X1
+ adc Z(i,$0), X0
+ mov X1, I(-8(rp),-8(rp,i,8))
+ add w2, X0
+ mov X0, I((rp),(rp,i,8))
+ adc Z(i,$0), %rdx
+ mov %rdx, I(8(rp),8(rp,i,8))
+
+ addl $-2, vn
+ jnz L(olo0)
+
+L(ret): pop %rax
+ pop %r15
+L(ret2):pop %r14
+ pop %r13
+ pop %r12
+ pop %rbp
+ pop %rbx
+ FUNC_EXIT()
+ ret
+
+
+ ALIGNx
+L(m2top1):
+ mul v0
+ add %rax, w3
+ mov -8(up,i,8), %rax
+ mov w3, -8(rp,i,8)
+ adc %rdx, w0
+ adc $0, R32(w1)
+L(m2e1):mul v1
+ add %rax, w0
+ adc %rdx, w1
+ mov $0, R32(w2)
+ mov (up,i,8), %rax
+ mul v0
+ add %rax, w0
+ mov w0, (rp,i,8)
+ adc %rdx, w1
+ mov (up,i,8), %rax
+ adc $0, R32(w2)
+ mul v1
+ add %rax, w1
+ adc %rdx, w2
+ mov 8(up,i,8), %rax
+ mul v0
+ mov $0, R32(w3)
+ add %rax, w1
+ adc %rdx, w2
+ adc $0, R32(w3)
+ mov 8(up,i,8), %rax
+ mul v1
+ add %rax, w2
+ mov w1, 8(rp,i,8)
+ adc %rdx, w3
+ mov $0, R32(w0)
+ mov 16(up,i,8), %rax
+ mul v0
+ add %rax, w2
+ mov 16(up,i,8), %rax
+ adc %rdx, w3
+ adc $0, R32(w0)
+ mul v1
+ mov $0, R32(w1)
+ add %rax, w3
+ mov 24(up,i,8), %rax
+ mov w2, 16(rp,i,8)
+ adc %rdx, w0
+ add $4, i
+ js L(m2top1)
+
+ mul v0
+ add %rax, w3
+ mov I(-8(up),-8(up,i,8)), %rax
+ mov w3, I(-8(rp),-8(rp,i,8))
+ adc %rdx, w0
+ adc R32(w1), R32(w1)
+ mul v1
+ add %rax, w0
+ adc %rdx, w1
+ mov w0, I((rp),(rp,i,8))
+ mov w1, I(8(rp),8(rp,i,8))
+
+ add $-2, vn_param
+ jz L(ret2)
+
+L(do_am1):
+ push %r15
+ push vn_param
+
+L(olo1):
+ mov (vp), v0
+ mov 8(vp), v1
+ lea 16(vp), vp
+ lea 16(rp), rp
+ mov (up,un,8), %rax
+ lea 1(un), i
+ mul v0
+ mov %rax, X1
+ MOV( %rdx, X0, 128)
+ mov (up,un,8), %rax
+ mov (rp,un,8), w1
+ mul v1
+ mov %rax, w2
+ mov 8(up,un,8), %rax
+ MOV( %rdx, w3, 1)
+ jmp L(lo1)
+
+ ALIGNx
+L(am2top1):
+ mul v1
+ add w0, w1
+ adc %rax, w2
+ mov (up,i,8), %rax
+ MOV( %rdx, w3, 1)
+ adc $0, w3
+L(lo1): mul v0
+ add w1, X1
+ mov X1, -8(rp,i,8)
+ adc %rax, X0
+ MOV( %rdx, X1, 2)
+ adc $0, X1
+ mov (up,i,8), %rax
+ mul v1
+ MOV( %rdx, w0, 4)
+ mov (rp,i,8), w1
+ add w1, w2
+ adc %rax, w3
+ adc $0, w0
+ mov 8(up,i,8), %rax
+ mul v0
+ add w2, X0
+ adc %rax, X1
+ mov X0, (rp,i,8)
+ MOV( %rdx, X0, 8)
+ adc $0, X0
+ mov 8(up,i,8), %rax
+ mov 8(rp,i,8), w2
+ mul v1
+ add w2, w3
+ adc %rax, w0
+ MOV( %rdx, w1, 16)
+ adc $0, w1
+ mov 16(up,i,8), %rax
+ mul v0
+ add w3, X1
+ mov X1, 8(rp,i,8)
+ adc %rax, X0
+ MOV( %rdx, X1, 32)
+ mov 16(rp,i,8), w3
+ adc $0, X1
+ mov 16(up,i,8), %rax
+ mul v1
+ add w3, w0
+ MOV( %rdx, w2, 64)
+ adc %rax, w1
+ mov 24(up,i,8), %rax
+ adc $0, w2
+ mul v0
+ add w0, X0
+ mov X0, 16(rp,i,8)
+ MOV( %rdx, X0, 128)
+ adc %rax, X1
+ mov 24(up,i,8), %rax
+ mov 24(rp,i,8), w0
+ adc $0, X0
+ add $4, i
+ jnc L(am2top1)
+
+ mul v1
+ add w0, w1
+ adc %rax, w2
+ adc Z(i,$0), %rdx
+ add w1, X1
+ adc Z(i,$0), X0
+ mov X1, I(-8(rp),-8(rp,i,8))
+ add w2, X0
+ mov X0, I((rp),(rp,i,8))
+ adc Z(i,$0), %rdx
+ mov %rdx, I(8(rp),8(rp,i,8))
+
+ addl $-2, vn
+ jnz L(olo1)
+
+ pop %rax
+ pop %r15
+ pop %r14
+ pop %r13
+ pop %r12
+ pop %rbp
+ pop %rbx
+ FUNC_EXIT()
+ ret
+
+
+ ALIGNx
+L(m2top2):
+ mul v0
+ add %rax, w3
+ mov -8(up,i,8), %rax
+ mov w3, -8(rp,i,8)
+ adc %rdx, w0
+ adc $0, R32(w1)
+ mul v1
+ add %rax, w0
+ adc %rdx, w1
+ mov $0, R32(w2)
+ mov (up,i,8), %rax
+ mul v0
+ add %rax, w0
+ mov w0, (rp,i,8)
+ adc %rdx, w1
+ mov (up,i,8), %rax
+ adc $0, R32(w2)
+ mul v1
+ add %rax, w1
+ adc %rdx, w2
+ mov 8(up,i,8), %rax
+ mul v0
+ mov $0, R32(w3)
+ add %rax, w1
+ adc %rdx, w2
+ adc $0, R32(w3)
+ mov 8(up,i,8), %rax
+ mul v1
+ add %rax, w2
+ mov w1, 8(rp,i,8)
+ adc %rdx, w3
+ mov $0, R32(w0)
+ mov 16(up,i,8), %rax
+ mul v0
+ add %rax, w2
+ mov 16(up,i,8), %rax
+ adc %rdx, w3
+ adc $0, R32(w0)
+L(m2e2):mul v1
+ mov $0, R32(w1)
+ add %rax, w3
+ mov 24(up,i,8), %rax
+ mov w2, 16(rp,i,8)
+ adc %rdx, w0
+ add $4, i
+ js L(m2top2)
+
+ mul v0
+ add %rax, w3
+ mov I(-8(up),-8(up,i,8)), %rax
+ mov w3, I(-8(rp),-8(rp,i,8))
+ adc %rdx, w0
+ adc R32(w1), R32(w1)
+ mul v1
+ add %rax, w0
+ adc %rdx, w1
+ mov w0, I((rp),(rp,i,8))
+ mov w1, I(8(rp),8(rp,i,8))
+
+ add $-2, vn_param
+ jz L(ret2)
+
+L(do_am2):
+ push %r15
+ push vn_param
+
+L(olo2):
+ mov (vp), v0
+ mov 8(vp), v1
+ lea 16(vp), vp
+ lea 16(rp), rp
+ mov (up,un,8), %rax
+ lea -2(un), i
+ mul v0
+ mov %rax, X0
+ MOV( %rdx, X1, 32)
+ mov (up,un,8), %rax
+ mov (rp,un,8), w0
+ mul v1
+ mov %rax, w1
+ lea (%rdx), w2
+ mov 8(up,un,8), %rax
+ jmp L(lo2)
+
+ ALIGNx
+L(am2top2):
+ mul v1
+ add w0, w1
+ adc %rax, w2
+ mov (up,i,8), %rax
+ MOV( %rdx, w3, 1)
+ adc $0, w3
+ mul v0
+ add w1, X1
+ mov X1, -8(rp,i,8)
+ adc %rax, X0
+ MOV( %rdx, X1, 2)
+ adc $0, X1
+ mov (up,i,8), %rax
+ mul v1
+ MOV( %rdx, w0, 4)
+ mov (rp,i,8), w1
+ add w1, w2
+ adc %rax, w3
+ adc $0, w0
+ mov 8(up,i,8), %rax
+ mul v0
+ add w2, X0
+ adc %rax, X1
+ mov X0, (rp,i,8)
+ MOV( %rdx, X0, 8)
+ adc $0, X0
+ mov 8(up,i,8), %rax
+ mov 8(rp,i,8), w2
+ mul v1
+ add w2, w3
+ adc %rax, w0
+ MOV( %rdx, w1, 16)
+ adc $0, w1
+ mov 16(up,i,8), %rax
+ mul v0
+ add w3, X1
+ mov X1, 8(rp,i,8)
+ adc %rax, X0
+ MOV( %rdx, X1, 32)
+ mov 16(rp,i,8), w3
+ adc $0, X1
+ mov 16(up,i,8), %rax
+ mul v1
+ add w3, w0
+ MOV( %rdx, w2, 64)
+ adc %rax, w1
+ mov 24(up,i,8), %rax
+ adc $0, w2
+L(lo2): mul v0
+ add w0, X0
+ mov X0, 16(rp,i,8)
+ MOV( %rdx, X0, 128)
+ adc %rax, X1
+ mov 24(up,i,8), %rax
+ mov 24(rp,i,8), w0
+ adc $0, X0
+ add $4, i
+ jnc L(am2top2)
+
+ mul v1
+ add w0, w1
+ adc %rax, w2
+ adc Z(i,$0), %rdx
+ add w1, X1
+ adc Z(i,$0), X0
+ mov X1, I(-8(rp),-8(rp,i,8))
+ add w2, X0
+ mov X0, I((rp),(rp,i,8))
+ adc Z(i,$0), %rdx
+ mov %rdx, I(8(rp),8(rp,i,8))
+
+ addl $-2, vn
+ jnz L(olo2)
+
+ pop %rax
+ pop %r15
+ pop %r14
+ pop %r13
+ pop %r12
+ pop %rbp
+ pop %rbx
+ FUNC_EXIT()
+ ret
+
+
+ ALIGNx
+L(m2top3):
+ mul v0
+ add %rax, w3
+ mov -8(up,i,8), %rax
+ mov w3, -8(rp,i,8)
+ adc %rdx, w0
+ adc $0, R32(w1)
+ mul v1
+ add %rax, w0
+ adc %rdx, w1
+ mov $0, R32(w2)
+ mov (up,i,8), %rax
+ mul v0
+ add %rax, w0
+ mov w0, (rp,i,8)
+ adc %rdx, w1
+ mov (up,i,8), %rax
+ adc $0, R32(w2)
+ mul v1
+ add %rax, w1
+ adc %rdx, w2
+ mov 8(up,i,8), %rax
+ mul v0
+ mov $0, R32(w3)
+ add %rax, w1
+ adc %rdx, w2
+ adc $0, R32(w3)
+ mov 8(up,i,8), %rax
+L(m2e3):mul v1
+ add %rax, w2
+ mov w1, 8(rp,i,8)
+ adc %rdx, w3
+ mov $0, R32(w0)
+ mov 16(up,i,8), %rax
+ mul v0
+ add %rax, w2
+ mov 16(up,i,8), %rax
+ adc %rdx, w3
+ adc $0, R32(w0)
+ mul v1
+ mov $0, R32(w1)
+ add %rax, w3
+ mov 24(up,i,8), %rax
+ mov w2, 16(rp,i,8)
+ adc %rdx, w0
+ add $4, i
+ js L(m2top3)
+
+ mul v0
+ add %rax, w3
+ mov I(-8(up),-8(up,i,8)), %rax
+ mov w3, I(-8(rp),-8(rp,i,8))
+ adc %rdx, w0
+ adc $0, R32(w1)
+ mul v1
+ add %rax, w0
+ adc %rdx, w1
+ mov w0, I((rp),(rp,i,8))
+ mov w1, I(8(rp),8(rp,i,8))
+
+ add $-2, vn_param
+ jz L(ret2)
+
+L(do_am3):
+ push %r15
+ push vn_param
+
+L(olo3):
+ mov (vp), v0
+ mov 8(vp), v1
+ lea 16(vp), vp
+ lea 16(rp), rp
+ mov (up,un,8), %rax
+ lea -1(un), i
+ mul v0
+ mov %rax, X1
+ MOV( %rdx, X0, 8)
+ mov (up,un,8), %rax
+ mov (rp,un,8), w3
+ mul v1
+ mov %rax, w0
+ MOV( %rdx, w1, 16)
+ mov 8(up,un,8), %rax
+ jmp L(lo3)
+
+ ALIGNx
+L(am2top3):
+ mul v1
+ add w0, w1
+ adc %rax, w2
+ mov (up,i,8), %rax
+ MOV( %rdx, w3, 1)
+ adc $0, w3
+ mul v0
+ add w1, X1
+ mov X1, -8(rp,i,8)
+ adc %rax, X0
+ MOV( %rdx, X1, 2)
+ adc $0, X1
+ mov (up,i,8), %rax
+ mul v1
+ MOV( %rdx, w0, 4)
+ mov (rp,i,8), w1
+ add w1, w2
+ adc %rax, w3
+ adc $0, w0
+ mov 8(up,i,8), %rax
+ mul v0
+ add w2, X0
+ adc %rax, X1
+ mov X0, (rp,i,8)
+ MOV( %rdx, X0, 8)
+ adc $0, X0
+ mov 8(up,i,8), %rax
+ mov 8(rp,i,8), w2
+ mul v1
+ add w2, w3
+ adc %rax, w0
+ MOV( %rdx, w1, 16)
+ adc $0, w1
+ mov 16(up,i,8), %rax
+L(lo3): mul v0
+ add w3, X1
+ mov X1, 8(rp,i,8)
+ adc %rax, X0
+ MOV( %rdx, X1, 32)
+ mov 16(rp,i,8), w3
+ adc $0, X1
+ mov 16(up,i,8), %rax
+ mul v1
+ add w3, w0
+ MOV( %rdx, w2, 64)
+ adc %rax, w1
+ mov 24(up,i,8), %rax
+ adc $0, w2
+ mul v0
+ add w0, X0
+ mov X0, 16(rp,i,8)
+ MOV( %rdx, X0, 128)
+ adc %rax, X1
+ mov 24(up,i,8), %rax
+ mov 24(rp,i,8), w0
+ adc $0, X0
+ add $4, i
+ jnc L(am2top3)
+
+ mul v1
+ add w0, w1
+ adc %rax, w2
+ adc Z(i,$0), %rdx
+ add w1, X1
+ adc Z(i,$0), X0
+ mov X1, I(-8(rp),-8(rp,i,8))
+ add w2, X0
+ mov X0, I((rp),(rp,i,8))
+ adc Z(i,$0), %rdx
+ mov %rdx, I(8(rp),8(rp,i,8))
+
+ addl $-2, vn
+ jnz L(olo3)
+
+ pop %rax
+ pop %r15
+ pop %r14
+ pop %r13
+ pop %r12
+ pop %rbp
+ pop %rbx
+ FUNC_EXIT()
+ ret
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/core2/mullo_basecase.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/core2/mullo_basecase.asm
new file mode 100644
index 00000000000..0f03d867f6b
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/core2/mullo_basecase.asm
@@ -0,0 +1,427 @@
+dnl AMD64 mpn_mullo_basecase optimised for Conroe/Wolfdale/Nehalem/Westmere.
+
+dnl Contributed to the GNU project by Torbjörn Granlund.
+
+dnl Copyright 2008, 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/limb mul_2 addmul_2
+C AMD K8,K9
+C AMD K10
+C AMD bull
+C AMD pile
+C AMD steam
+C AMD bobcat
+C AMD jaguar
+C Intel P4
+C Intel core 4.0 4.18-4.25
+C Intel NHM 3.75 4.06-4.2
+C Intel SBR
+C Intel IBR
+C Intel HWL
+C Intel BWL
+C Intel atom
+C VIA nano
+
+C The inner loops of this code are the result of running a code generation and
+C optimisation tool suite written by David Harvey and Torbjörn Granlund.
+
+C TODO
+C * Implement proper cor2, replacing current cor0.
+C * Offset n by 2 in order to avoid the outer loop cmp. (And sqr_basecase?)
+C * Micro-optimise.
+
+C When playing with pointers, set this to $2 to fall back to conservative
+C indexing in wind-down code.
+define(`I',`$1')
+
+define(`rp', `%rdi')
+define(`up', `%rsi')
+define(`vp_param', `%rdx')
+define(`n_param', `%rcx')
+
+define(`v0', `%r10')
+define(`v1', `%r11')
+define(`w0', `%rbx')
+define(`w1', `%rcx')
+define(`w2', `%rbp')
+define(`w3', `%r12')
+define(`n', `%r9')
+define(`i', `%r13')
+define(`vp', `%r8')
+
+define(`X0', `%r14')
+define(`X1', `%r15')
+
+C rax rbx rcx rdx rdi rsi rbp r8 r9 r10 r11 r12 r13 r14 r15
+
+ABI_SUPPORT(DOS64)
+ABI_SUPPORT(STD64)
+
+define(`ALIGNx', `ALIGN(16)')
+
+define(`N', 85)
+ifdef(`N',,`define(`N',0)')
+define(`MOV', `ifelse(eval(N & $3),0,`mov $1, $2',`lea ($1), $2')')
+
+ASM_START()
+ TEXT
+ ALIGN(32)
+PROLOGUE(mpn_mullo_basecase)
+ FUNC_ENTRY(4)
+
+ mov (up), %rax
+ mov vp_param, vp
+
+ cmp $4, n_param
+ jb L(small)
+
+ mov (vp_param), v0
+ push %rbx
+ lea (rp,n_param,8), rp C point rp at R[un]
+ push %rbp
+ lea (up,n_param,8), up C point up right after U's end
+ push %r12
+ mov $0, R32(n) C FIXME
+ sub n_param, n
+ push %r13
+ mul v0
+ mov 8(vp), v1
+
+ test $1, R8(n_param)
+ jnz L(m2x1)
+
+L(m2x0):test $2, R8(n_param)
+ jnz L(m2b2)
+
+L(m2b0):lea (n), i
+ mov %rax, (rp,n,8)
+ mov %rdx, w1
+ mov (up,n,8), %rax
+ xor R32(w2), R32(w2)
+ jmp L(m2e0)
+
+L(m2b2):lea -2(n), i
+ mov %rax, w2
+ mov (up,n,8), %rax
+ mov %rdx, w3
+ xor R32(w0), R32(w0)
+ jmp L(m2e2)
+
+L(m2x1):test $2, R8(n_param)
+ jnz L(m2b3)
+
+L(m2b1):lea 1(n), i
+ mov %rax, (rp,n,8)
+ mov (up,n,8), %rax
+ mov %rdx, w0
+ xor R32(w1), R32(w1)
+ jmp L(m2e1)
+
+L(m2b3):lea -1(n), i
+ xor R32(w3), R32(w3)
+ mov %rax, w1
+ mov %rdx, w2
+ mov (up,n,8), %rax
+ jmp L(m2e3)
+
+ ALIGNx
+L(m2tp):mul v0
+ add %rax, w3
+ mov -8(up,i,8), %rax
+ mov w3, -8(rp,i,8)
+ adc %rdx, w0
+ adc $0, R32(w1)
+L(m2e1):mul v1
+ add %rax, w0
+ adc %rdx, w1
+ mov $0, R32(w2)
+ mov (up,i,8), %rax
+ mul v0
+ add %rax, w0
+ mov w0, (rp,i,8)
+ adc %rdx, w1
+ mov (up,i,8), %rax
+ adc $0, R32(w2)
+L(m2e0):mul v1
+ add %rax, w1
+ adc %rdx, w2
+ mov 8(up,i,8), %rax
+ mul v0
+ mov $0, R32(w3)
+ add %rax, w1
+ adc %rdx, w2
+ adc $0, R32(w3)
+ mov 8(up,i,8), %rax
+L(m2e3):mul v1
+ add %rax, w2
+ mov w1, 8(rp,i,8)
+ adc %rdx, w3
+ mov $0, R32(w0)
+ mov 16(up,i,8), %rax
+ mul v0
+ add %rax, w2
+ mov 16(up,i,8), %rax
+ adc %rdx, w3
+ adc $0, R32(w0)
+L(m2e2):mul v1
+ mov $0, R32(w1) C FIXME: dead in last iteration
+ add %rax, w3
+ mov 24(up,i,8), %rax
+ mov w2, 16(rp,i,8)
+ adc %rdx, w0 C FIXME: dead in last iteration
+ add $4, i
+ js L(m2tp)
+
+L(m2ed):imul v0, %rax
+ add w3, %rax
+ mov %rax, I(-8(rp),-8(rp,i,8))
+
+ add $2, n
+ lea 16(vp), vp
+ lea -16(up), up
+ cmp $-2, n
+ jge L(cor1)
+
+ push %r14
+ push %r15
+
+L(outer):
+ mov (vp), v0
+ mov 8(vp), v1
+ mov (up,n,8), %rax
+ mul v0
+ test $1, R8(n)
+ jnz L(a1x1)
+
+L(a1x0):mov %rax, X1
+ MOV( %rdx, X0, 8)
+ mov (up,n,8), %rax
+ mul v1
+ test $2, R8(n)
+ jnz L(a110)
+
+L(a100):lea (n), i
+ mov (rp,n,8), w3
+ mov %rax, w0
+ MOV( %rdx, w1, 16)
+ jmp L(lo0)
+
+L(a110):lea 2(n), i
+ mov (rp,n,8), w1
+ mov %rax, w2
+ mov 8(up,n,8), %rax
+ MOV( %rdx, w3, 1)
+ jmp L(lo2)
+
+L(a1x1):mov %rax, X0
+ MOV( %rdx, X1, 2)
+ mov (up,n,8), %rax
+ mul v1
+ test $2, R8(n)
+ jz L(a111)
+
+L(a101):lea 1(n), i
+ MOV( %rdx, w0, 4)
+ mov (rp,n,8), w2
+ mov %rax, w3
+ jmp L(lo1)
+
+L(a111):lea -1(n), i
+ MOV( %rdx, w2, 64)
+ mov %rax, w1
+ mov (rp,n,8), w0
+ mov 8(up,n,8), %rax
+ jmp L(lo3)
+
+ ALIGNx
+L(top): mul v1
+ add w0, w1
+ adc %rax, w2
+ mov -8(up,i,8), %rax
+ MOV( %rdx, w3, 1)
+ adc $0, w3
+L(lo2): mul v0
+ add w1, X1
+ mov X1, -16(rp,i,8)
+ adc %rax, X0
+ MOV( %rdx, X1, 2)
+ adc $0, X1
+ mov -8(up,i,8), %rax
+ mul v1
+ MOV( %rdx, w0, 4)
+ mov -8(rp,i,8), w1
+ add w1, w2
+ adc %rax, w3
+ adc $0, w0
+L(lo1): mov (up,i,8), %rax
+ mul v0
+ add w2, X0
+ adc %rax, X1
+ mov X0, -8(rp,i,8)
+ MOV( %rdx, X0, 8)
+ adc $0, X0
+ mov (up,i,8), %rax
+ mov (rp,i,8), w2
+ mul v1
+ add w2, w3
+ adc %rax, w0
+ MOV( %rdx, w1, 16)
+ adc $0, w1
+L(lo0): mov 8(up,i,8), %rax
+ mul v0
+ add w3, X1
+ mov X1, (rp,i,8)
+ adc %rax, X0
+ MOV( %rdx, X1, 32)
+ mov 8(rp,i,8), w3
+ adc $0, X1
+ mov 8(up,i,8), %rax
+ mul v1
+ add w3, w0
+ MOV( %rdx, w2, 64)
+ adc %rax, w1
+ mov 16(up,i,8), %rax
+ adc $0, w2
+L(lo3): mul v0
+ add w0, X0
+ mov X0, 8(rp,i,8)
+ MOV( %rdx, X0, 128)
+ adc %rax, X1
+ mov 16(up,i,8), %rax
+ mov 16(rp,i,8), w0
+ adc $0, X0
+ add $4, i
+ jnc L(top)
+
+L(end): imul v1, %rax
+ add w0, w1
+ adc %rax, w2
+ mov I(-8(up),-8(up,i,8)), %rax
+ imul v0, %rax
+ add w1, X1
+ mov X1, I(-16(rp),-16(rp,i,8))
+ adc X0, %rax
+ mov I(-8(rp),-8(rp,i,8)), w1
+ add w1, w2
+ add w2, %rax
+ mov %rax, I(-8(rp),-8(rp,i,8))
+
+ add $2, n
+ lea 16(vp), vp
+ lea -16(up), up
+ cmp $-2, n
+ jl L(outer)
+
+ pop %r15
+ pop %r14
+
+ jnz L(cor0)
+
+L(cor1):mov (vp), v0
+ mov 8(vp), v1
+ mov -16(up), %rax
+ mul v0 C u0 x v2
+ add -16(rp), %rax C FIXME: rp[0] still available in reg?
+ adc -8(rp), %rdx C FIXME: rp[1] still available in reg?
+ mov -8(up), %rbx
+ imul v0, %rbx
+ mov -16(up), %rcx
+ imul v1, %rcx
+ mov %rax, -16(rp)
+ add %rbx, %rcx
+ add %rdx, %rcx
+ mov %rcx, -8(rp)
+ pop %r13
+ pop %r12
+ pop %rbp
+ pop %rbx
+ FUNC_EXIT()
+ ret
+
+L(cor0):mov (vp), %r11
+ imul -8(up), %r11
+ add %rax, %r11
+ mov %r11, -8(rp)
+ pop %r13
+ pop %r12
+ pop %rbp
+ pop %rbx
+ FUNC_EXIT()
+ ret
+
+ ALIGN(16)
+L(small):
+ cmp $2, n_param
+ jae L(gt1)
+L(n1): imul (vp_param), %rax
+ mov %rax, (rp)
+ FUNC_EXIT()
+ ret
+L(gt1): ja L(gt2)
+L(n2): mov (vp_param), %r9
+ mul %r9
+ mov %rax, (rp)
+ mov 8(up), %rax
+ imul %r9, %rax
+ add %rax, %rdx
+ mov 8(vp), %r9
+ mov (up), %rcx
+ imul %r9, %rcx
+ add %rcx, %rdx
+ mov %rdx, 8(rp)
+ FUNC_EXIT()
+ ret
+L(gt2):
+L(n3): mov (vp_param), %r9
+ mul %r9 C u0 x v0
+ mov %rax, (rp)
+ mov %rdx, %r10
+ mov 8(up), %rax
+ mul %r9 C u1 x v0
+ imul 16(up), %r9 C u2 x v0
+ add %rax, %r10
+ adc %rdx, %r9
+ mov 8(vp), %r11
+ mov (up), %rax
+ mul %r11 C u0 x v1
+ add %rax, %r10
+ adc %rdx, %r9
+ imul 8(up), %r11 C u1 x v1
+ add %r11, %r9
+ mov %r10, 8(rp)
+ mov 16(vp), %r10
+ mov (up), %rax
+ imul %rax, %r10 C u0 x v2
+ add %r10, %r9
+ mov %r9, 16(rp)
+ FUNC_EXIT()
+ ret
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/core2/popcount.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/core2/popcount.asm
new file mode 100644
index 00000000000..e935cf18920
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/core2/popcount.asm
@@ -0,0 +1,35 @@
+dnl x86-64 mpn_popcount optimized for "Core 2".
+
+dnl Copyright 2007 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_popcount)
+include_mpn(`x86/pentium4/sse2/popcount.asm')
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/core2/redc_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/core2/redc_1.asm
new file mode 100644
index 00000000000..d0e96ef1cba
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/core2/redc_1.asm
@@ -0,0 +1,425 @@
+dnl X86-64 mpn_redc_1 optimised for Intel Conroe and Wolfdale.
+
+dnl Contributed to the GNU project by Torbjörn Granlund.
+
+dnl Copyright 2003-2005, 2007, 2008, 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/limb
+C AMD K8,K9 ?
+C AMD K10 ?
+C AMD bull ?
+C AMD pile ?
+C AMD steam ?
+C AMD bobcat ?
+C AMD jaguar ?
+C Intel P4 ?
+C Intel core 4.5 (fluctuating)
+C Intel NHM ?
+C Intel SBR ?
+C Intel IBR ?
+C Intel HWL ?
+C Intel BWL ?
+C Intel atom ?
+C VIA nano ?
+
+C The inner loops of this code are the result of running a code generation and
+C optimisation tool suite written by David Harvey and Torbjörn Granlund.
+
+C TODO
+C * Micro-optimise, none performed thus far.
+C * Consider inlining mpn_add_n.
+C * Single basecases out before the pushes.
+C * Keep up[i] in registers for basecases (might require pushes).
+
+C When playing with pointers, set this to $2 to fall back to conservative
+C indexing in wind-down code.
+define(`I',`$1')
+
+define(`rp', `%rdi') C rcx
+define(`up', `%rsi') C rdx
+define(`mp_param', `%rdx') C r8
+define(`n', `%rcx') C r9
+define(`u0inv', `%r8') C stack
+
+define(`i', `%r14')
+define(`j', `%r15')
+define(`mp', `%r12')
+define(`q0', `%r13')
+
+C rax rbx rcx rdx rdi rsi rbp r8 r9 r10 r11 r12 r13 r14 r15
+C X q0' n X rp up u0i mp q0 i j
+
+ABI_SUPPORT(DOS64)
+ABI_SUPPORT(STD64)
+
+define(`ALIGNx', `ALIGN(16)')
+
+ASM_START()
+ TEXT
+ ALIGN(32)
+PROLOGUE(mpn_redc_1)
+ FUNC_ENTRY(4)
+IFDOS(` mov 56(%rsp), %r8 ')
+ push %rbx
+ push %rbp
+ push %r12
+ push %r13
+ push %r14
+ push %r15
+
+ mov (up), q0
+ mov n, j C outer loop induction var
+ lea (mp_param,n,8), mp
+ lea -16(up,n,8), up
+ neg n
+ imul u0inv, q0 C first iteration q0
+
+ test $1, R8(n)
+ jz L(b0)
+
+L(b1): cmp $-1, R32(n)
+ jz L(n1)
+ cmp $-3, R32(n)
+ jz L(n3)
+
+ push rp
+
+L(otp1):lea 3(n), i
+ mov (mp,n,8), %rax
+ mul q0
+ lea (%rax), %rbp
+ mov 8(mp,n,8), %rax
+ lea (%rdx), %r9
+ mul q0
+ lea (%rax), %r11
+ mov 16(mp,n,8), %rax
+ mov 16(up,n,8), %r10
+ lea (%rdx), %rdi
+ mul q0
+ add %rbp, %r10
+ lea (%rax), %rbp
+ mov 24(mp,n,8), %rax
+ adc %r9, %r11
+ mov 24(up,n,8), %rbx
+ lea (%rdx), %r9
+ adc $0, %rdi
+ mul q0
+ add %r11, %rbx
+ lea (%rax), %r11
+ mov 32(mp,n,8), %rax
+ adc %rdi, %rbp
+ mov %rbx, 24(up,n,8)
+ mov 32(up,n,8), %r10
+ lea (%rdx), %rdi
+ adc $0, %r9
+ imul u0inv, %rbx C next q limb
+ add $2, i
+ jns L(ed1)
+
+ ALIGNx
+L(tp1): mul q0
+ add %rbp, %r10
+ lea (%rax), %rbp
+ mov (mp,i,8), %rax
+ adc %r9, %r11
+ mov %r10, -8(up,i,8)
+ mov (up,i,8), %r10
+ lea (%rdx), %r9
+ adc $0, %rdi
+ mul q0
+ add %r11, %r10
+ lea (%rax), %r11
+ mov 8(mp,i,8), %rax
+ adc %rdi, %rbp
+ mov %r10, (up,i,8)
+ mov 8(up,i,8), %r10
+ lea (%rdx), %rdi
+ adc $0, %r9
+ add $2, i
+ js L(tp1)
+
+L(ed1): mul q0
+ add %rbp, %r10
+ adc %r9, %r11
+ mov %r10, I(-8(up),-8(up,i,8))
+ mov I((up),(up,i,8)), %r10
+ adc $0, %rdi
+ add %r11, %r10
+ adc %rdi, %rax
+ mov %r10, I((up),(up,i,8))
+ mov I(8(up),8(up,i,8)), %r10
+ adc $0, %rdx
+ add %rax, %r10
+ mov %r10, I(8(up),8(up,i,8))
+ adc $0, %rdx
+ mov %rdx, 16(up,n,8) C up[0]
+ mov %rbx, q0 C previously computed q limb -> q0
+ lea 8(up), up C up++
+ dec j
+ jnz L(otp1)
+ jmp L(cj)
+
+L(b0): cmp $-2, R32(n)
+ jz L(n2)
+ cmp $-4, R32(n)
+ jz L(n4)
+
+ push rp
+
+L(otp0):lea 4(n), i
+ mov (mp,n,8), %rax
+ mul q0
+ lea (%rax), %r11
+ mov 8(mp,n,8), %rax
+ lea (%rdx), %rdi
+ mul q0
+ lea (%rax), %rbp
+ mov 16(mp,n,8), %rax
+ mov 16(up,n,8), %r10
+ lea (%rdx), %r9
+ mul q0
+ add %r11, %r10
+ lea (%rax), %r11
+ mov 24(mp,n,8), %rax
+ adc %rdi, %rbp
+ mov 24(up,n,8), %rbx
+ lea (%rdx), %rdi
+ adc $0, %r9
+ mul q0
+ add %rbp, %rbx
+ lea (%rax), %rbp
+ mov 32(mp,n,8), %rax
+ adc %r9, %r11
+ mov %rbx, 24(up,n,8)
+ mov 32(up,n,8), %r10
+ lea (%rdx), %r9
+ adc $0, %rdi
+ imul u0inv, %rbx C next q limb
+ jmp L(e0)
+
+ ALIGNx
+L(tp0): mul q0
+ add %rbp, %r10
+ lea (%rax), %rbp
+ mov (mp,i,8), %rax
+ adc %r9, %r11
+ mov %r10, -8(up,i,8)
+ mov (up,i,8), %r10
+ lea (%rdx), %r9
+ adc $0, %rdi
+L(e0): mul q0
+ add %r11, %r10
+ lea (%rax), %r11
+ mov 8(mp,i,8), %rax
+ adc %rdi, %rbp
+ mov %r10, (up,i,8)
+ mov 8(up,i,8), %r10
+ lea (%rdx), %rdi
+ adc $0, %r9
+ add $2, i
+ js L(tp0)
+
+L(ed0): mul q0
+ add %rbp, %r10
+ adc %r9, %r11
+ mov %r10, I(-8(up),-8(up,i,8))
+ mov I((up),(up,i,8)), %r10
+ adc $0, %rdi
+ add %r11, %r10
+ adc %rdi, %rax
+ mov %r10, I((up),(up,i,8))
+ mov I(8(up),8(up,i,8)), %r10
+ adc $0, %rdx
+ add %rax, %r10
+ mov %r10, I(8(up),8(up,i,8))
+ adc $0, %rdx
+ mov %rdx, 16(up,n,8) C up[0]
+ mov %rbx, q0 C previously computed q limb -> q0
+ lea 8(up), up C up++
+ dec j
+ jnz L(otp0)
+
+L(cj): lea 16(up), up C FIXME
+ pop rp
+L(add_n):
+IFSTD(` lea (up,n,8), up C param 2: up
+ lea (up,n,8), %rdx C param 3: up - n
+ neg R32(n) ') C param 4: n
+
+IFDOS(` lea (up,n,8), %rdx C param 2: up
+ lea (%rdx,n,8), %r8 C param 3: up - n
+ neg R32(n)
+ mov n, %r9 C param 4: n
+ mov rp, %rcx ') C param 1: rp
+
+ CALL( mpn_add_n)
+
+L(ret): pop %r15
+ pop %r14
+ pop %r13
+ pop %r12
+ pop %rbp
+ pop %rbx
+ FUNC_EXIT()
+ ret
+
+L(n1): mov (mp_param), %rax
+ mul q0
+ add 8(up), %rax
+ adc 16(up), %rdx
+ mov %rdx, (rp)
+ mov $0, R32(%rax)
+ adc R32(%rax), R32(%rax)
+ jmp L(ret)
+
+L(n2): mov (mp_param), %rax
+ mov (up), %rbp
+ mul q0
+ add %rax, %rbp
+ mov %rdx, %r9
+ adc $0, %r9
+ mov -8(mp), %rax
+ mov 8(up), %r10
+ mul q0
+ add %rax, %r10
+ mov %rdx, %r11
+ adc $0, %r11
+ add %r9, %r10
+ adc $0, %r11
+ mov %r10, q0
+ imul u0inv, q0 C next q0
+ mov -16(mp), %rax
+ mul q0
+ add %rax, %r10
+ mov %rdx, %r9
+ adc $0, %r9
+ mov -8(mp), %rax
+ mov 16(up), %r14
+ mul q0
+ add %rax, %r14
+ adc $0, %rdx
+ add %r9, %r14
+ adc $0, %rdx
+ xor R32(%rax), R32(%rax)
+ add %r11, %r14
+ adc 24(up), %rdx
+ mov %r14, (rp)
+ mov %rdx, 8(rp)
+ adc R32(%rax), R32(%rax)
+ jmp L(ret)
+
+ ALIGNx
+L(n3): mov -24(mp), %rax
+ mov -8(up), %r10
+ mul q0
+ add %rax, %r10
+ mov -16(mp), %rax
+ mov %rdx, %r11
+ adc $0, %r11
+ mov (up), %rbp
+ mul q0
+ add %rax, %rbp
+ mov %rdx, %r9
+ adc $0, %r9
+ mov -8(mp), %rax
+ add %r11, %rbp
+ mov 8(up), %r10
+ adc $0, %r9
+ mul q0
+ mov %rbp, q0
+ imul u0inv, q0 C next q0
+ add %rax, %r10
+ mov %rdx, %r11
+ adc $0, %r11
+ mov %rbp, (up)
+ add %r9, %r10
+ adc $0, %r11
+ mov %r10, 8(up)
+ mov %r11, -8(up) C up[0]
+ lea 8(up), up C up++
+ dec j
+ jnz L(n3)
+
+ mov -32(up), %rdx
+ mov -24(up), %rbx
+ xor R32(%rax), R32(%rax)
+ add %rbp, %rdx
+ adc %r10, %rbx
+ adc 8(up), %r11
+ mov %rdx, (rp)
+ mov %rbx, 8(rp)
+ mov %r11, 16(rp)
+ adc R32(%rax), R32(%rax)
+ jmp L(ret)
+
+ ALIGNx
+L(n4): mov -32(mp), %rax
+ mul q0
+ lea (%rax), %r11
+ mov -24(mp), %rax
+ lea (%rdx), %r14
+ mul q0
+ lea (%rax), %rbp
+ mov -16(mp), %rax
+ mov -16(up), %r10
+ lea (%rdx), %r9
+ mul q0
+ add %r11, %r10
+ lea (%rax), %r11
+ mov -8(mp), %rax
+ adc %r14, %rbp
+ mov -8(up), %rbx
+ lea (%rdx), %r14
+ adc $0, %r9
+ mul q0
+ add %rbp, %rbx
+ adc %r9, %r11
+ mov %rbx, -8(up)
+ mov (up), %r10
+ adc $0, %r14
+ imul u0inv, %rbx C next q limb
+ add %r11, %r10
+ adc %r14, %rax
+ mov %r10, (up)
+ mov 8(up), %r10
+ adc $0, %rdx
+ add %rax, %r10
+ mov %r10, 8(up)
+ adc $0, %rdx
+ mov %rdx, -16(up) C up[0]
+ mov %rbx, q0 C previously computed q limb -> q0
+ lea 8(up), up C up++
+ dec j
+ jnz L(n4)
+ lea 16(up), up
+ jmp L(add_n)
+EPILOGUE()
+ASM_END()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/core2/rsh1aors_n.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/core2/rsh1aors_n.asm
new file mode 100644
index 00000000000..27eed3712d2
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/core2/rsh1aors_n.asm
@@ -0,0 +1,169 @@
+dnl X86-64 mpn_rsh1add_n, mpn_rsh1sub_n optimised for Intel Conroe/Penryn.
+
+dnl Copyright 2003, 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/limb
+C AMD K8,K9 ?
+C AMD K10 ?
+C Intel P4 ?
+C Intel core2 3.05
+C Intel NHM 3.3
+C Intel SBR 2.5
+C Intel atom ?
+C VIA nano ?
+
+C TODO
+C * Loopmix to approach 2.5 c/l on NHM.
+
+C INPUT PARAMETERS
+define(`rp', `%rdi')
+define(`up', `%rsi')
+define(`vp', `%rdx')
+define(`n', `%rcx')
+
+ifdef(`OPERATION_rsh1add_n', `
+ define(ADDSUB, add)
+ define(ADCSBB, adc)
+ define(func_n, mpn_rsh1add_n)
+ define(func_nc, mpn_rsh1add_nc)')
+ifdef(`OPERATION_rsh1sub_n', `
+ define(ADDSUB, sub)
+ define(ADCSBB, sbb)
+ define(func_n, mpn_rsh1sub_n)
+ define(func_nc, mpn_rsh1sub_nc)')
+
+MULFUNC_PROLOGUE(mpn_rsh1add_n mpn_rsh1add_nc mpn_rsh1sub_n mpn_rsh1sub_nc)
+
+ABI_SUPPORT(DOS64)
+ABI_SUPPORT(STD64)
+
+ASM_START()
+ TEXT
+ ALIGN(16)
+PROLOGUE(func_nc)
+ FUNC_ENTRY(4)
+IFDOS(` mov 56(%rsp), %r8 ')
+ push %rbx
+ push %rbp
+
+ neg %r8 C set C flag from parameter
+ mov (up), %r8
+ ADCSBB (vp), %r8
+ jmp L(ent)
+EPILOGUE()
+
+ ALIGN(16)
+PROLOGUE(func_n)
+ FUNC_ENTRY(4)
+ push %rbx
+ push %rbp
+
+ mov (up), %r8
+ ADDSUB (vp), %r8
+L(ent): sbb R32(%rbx), R32(%rbx) C save cy
+ mov %r8, %rax
+ and $1, R32(%rax) C return value
+
+ lea (up,n,8), up
+ lea (vp,n,8), vp
+ lea (rp,n,8), rp
+ mov R32(n), R32(%rbp)
+ neg n
+ and $3, R32(%rbp)
+ jz L(b0)
+ cmp $2, R32(%rbp)
+ jae L(n1)
+
+L(b1): mov %r8, %rbp
+ inc n
+ js L(top)
+ jmp L(end)
+
+L(n1): jnz L(b3)
+ add R32(%rbx), R32(%rbx) C restore cy
+ mov 8(up,n,8), %r11
+ ADCSBB 8(vp,n,8), %r11
+ sbb R32(%rbx), R32(%rbx) C save cy
+ mov %r8, %r10
+ add $-2, n
+ jmp L(2)
+
+L(b3): add R32(%rbx), R32(%rbx) C restore cy
+ mov 8(up,n,8), %r10
+ mov 16(up,n,8), %r11
+ ADCSBB 8(vp,n,8), %r10
+ ADCSBB 16(vp,n,8), %r11
+ sbb R32(%rbx), R32(%rbx) C save cy
+ mov %r8, %r9
+ dec n
+ jmp L(3)
+
+L(b0): add R32(%rbx), R32(%rbx) C restore cy
+ mov 8(up,n,8), %r9
+ mov 16(up,n,8), %r10
+ mov 24(up,n,8), %r11
+ ADCSBB 8(vp,n,8), %r9
+ ADCSBB 16(vp,n,8), %r10
+ ADCSBB 24(vp,n,8), %r11
+ sbb R32(%rbx), R32(%rbx) C save cy
+ jmp L(4)
+
+ ALIGN(16)
+
+L(top): add R32(%rbx), R32(%rbx) C restore cy
+ mov (up,n,8), %r8
+ mov 8(up,n,8), %r9
+ mov 16(up,n,8), %r10
+ mov 24(up,n,8), %r11
+ ADCSBB (vp,n,8), %r8
+ ADCSBB 8(vp,n,8), %r9
+ ADCSBB 16(vp,n,8), %r10
+ ADCSBB 24(vp,n,8), %r11
+ sbb R32(%rbx), R32(%rbx) C save cy
+ shrd $1, %r8, %rbp
+ mov %rbp, -8(rp,n,8)
+L(4): shrd $1, %r9, %r8
+ mov %r8, (rp,n,8)
+L(3): shrd $1, %r10, %r9
+ mov %r9, 8(rp,n,8)
+L(2): shrd $1, %r11, %r10
+ mov %r10, 16(rp,n,8)
+L(1): add $4, n
+ mov %r11, %rbp
+ js L(top)
+
+L(end): shrd $1, %rbx, %rbp
+ mov %rbp, -8(rp)
+ pop %rbp
+ pop %rbx
+ FUNC_EXIT()
+ ret
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/core2/rshift.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/core2/rshift.asm
new file mode 100644
index 00000000000..ab32ec85dff
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/core2/rshift.asm
@@ -0,0 +1,147 @@
+dnl x86-64 mpn_rshift optimized for "Core 2".
+
+dnl Copyright 2007, 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/limb
+C AMD K8,K9 4.25
+C AMD K10 4.25
+C Intel P4 14.7
+C Intel core2 1.27
+C Intel NHM 1.375 (up to about n = 260, then 1.5)
+C Intel SBR 1.77
+C Intel atom ?
+C VIA nano ?
+
+
+C INPUT PARAMETERS
+define(`rp', `%rdi')
+define(`up', `%rsi')
+define(`n', `%rdx')
+define(`cnt', `%rcx')
+
+ABI_SUPPORT(DOS64)
+ABI_SUPPORT(STD64)
+
+ASM_START()
+ TEXT
+ ALIGN(16)
+PROLOGUE(mpn_rshift)
+ FUNC_ENTRY(4)
+ mov R32(%rdx), R32(%rax)
+ and $3, R32(%rax)
+ jne L(nb00)
+L(b00): C n = 4, 8, 12, ...
+ mov (up), %r10
+ mov 8(up), %r11
+ xor R32(%rax), R32(%rax)
+ shrd R8(cnt), %r10, %rax
+ mov 16(up), %r8
+ lea 8(up), up
+ lea -24(rp), rp
+ sub $4, n
+ jmp L(00)
+
+L(nb00):C n = 1, 5, 9, ...
+ cmp $2, R32(%rax)
+ jae L(nb01)
+L(b01): mov (up), %r9
+ xor R32(%rax), R32(%rax)
+ shrd R8(cnt), %r9, %rax
+ sub $2, n
+ jb L(le1)
+ mov 8(up), %r10
+ mov 16(up), %r11
+ lea 16(up), up
+ lea -16(rp), rp
+ jmp L(01)
+L(le1): shr R8(cnt), %r9
+ mov %r9, (rp)
+ FUNC_EXIT()
+ ret
+
+L(nb01):C n = 2, 6, 10, ...
+ jne L(b11)
+L(b10): mov (up), %r8
+ mov 8(up), %r9
+ xor R32(%rax), R32(%rax)
+ shrd R8(cnt), %r8, %rax
+ sub $3, n
+ jb L(le2)
+ mov 16(up), %r10
+ lea 24(up), up
+ lea -8(rp), rp
+ jmp L(10)
+L(le2): shrd R8(cnt), %r9, %r8
+ mov %r8, (rp)
+ shr R8(cnt), %r9
+ mov %r9, 8(rp)
+ FUNC_EXIT()
+ ret
+
+ ALIGN(16)
+L(b11): C n = 3, 7, 11, ...
+ mov (up), %r11
+ mov 8(up), %r8
+ xor R32(%rax), R32(%rax)
+ shrd R8(cnt), %r11, %rax
+ mov 16(up), %r9
+ lea 32(up), up
+ sub $4, n
+ jb L(end)
+
+ ALIGN(16)
+L(top): shrd R8(cnt), %r8, %r11
+ mov -8(up), %r10
+ mov %r11, (rp)
+L(10): shrd R8(cnt), %r9, %r8
+ mov (up), %r11
+ mov %r8, 8(rp)
+L(01): shrd R8(cnt), %r10, %r9
+ mov 8(up), %r8
+ mov %r9, 16(rp)
+L(00): shrd R8(cnt), %r11, %r10
+ mov 16(up), %r9
+ mov %r10, 24(rp)
+ add $32, up
+ lea 32(rp), rp
+ sub $4, n
+ jnc L(top)
+
+L(end): shrd R8(cnt), %r8, %r11
+ mov %r11, (rp)
+ shrd R8(cnt), %r9, %r8
+ mov %r8, 8(rp)
+ shr R8(cnt), %r9
+ mov %r9, 16(rp)
+ FUNC_EXIT()
+ ret
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/core2/sec_tabselect.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/core2/sec_tabselect.asm
new file mode 100644
index 00000000000..e4360341d93
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/core2/sec_tabselect.asm
@@ -0,0 +1,37 @@
+dnl X86-64 mpn_sec_tabselect.
+
+dnl Copyright 2012, 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')
+
+ABI_SUPPORT(DOS64)
+ABI_SUPPORT(STD64)
+
+MULFUNC_PROLOGUE(mpn_sec_tabselect)
+include_mpn(`x86_64/fastsse/sec_tabselect.asm')
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/core2/sqr_basecase.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/core2/sqr_basecase.asm
new file mode 100644
index 00000000000..a112c1b52ec
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/core2/sqr_basecase.asm
@@ -0,0 +1,984 @@
+dnl X86-64 mpn_sqr_basecase optimised for Intel Nehalem/Westmere.
+dnl It also seems good for Conroe/Wolfdale.
+
+dnl Contributed to the GNU project by Torbjörn Granlund.
+
+dnl Copyright 2008, 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/limb mul_2 addmul_2 sqr_diag_addlsh1
+C AMD K8,K9
+C AMD K10
+C AMD bull
+C AMD pile
+C AMD steam
+C AMD bobcat
+C AMD jaguar
+C Intel P4
+C Intel core 4.9 4.18-4.25 3.87
+C Intel NHM 3.8 4.06-4.2 3.5
+C Intel SBR
+C Intel IBR
+C Intel HWL
+C Intel BWL
+C Intel atom
+C VIA nano
+
+C The inner loops of this code are the result of running a code generation and
+C optimisation tool suite written by David Harvey and Torbjörn Granlund.
+
+C Code structure:
+C
+C
+C m_2(0m4) m_2(2m4) m_2(1m4) m_2(3m4)
+C | | | |
+C | | | |
+C | | | |
+C \|/ \|/ \|/ \|/
+C ____________ ____________
+C / \ / \
+C \|/ \ \|/ \
+C am_2(3m4) am_2(1m4) am_2(0m4) am_2(2m4)
+C \ /|\ \ /|\
+C \____________/ \____________/
+C \ /
+C \ /
+C \ /
+C tail(0m2) tail(1m2)
+C \ /
+C \ /
+C sqr_diag_addlsh1
+
+C TODO
+C * Tune. None done so far.
+C * Currently 2761 bytes, making it smaller would be nice.
+C * Consider using a jumptab-based entry sequence. One might even use a mask-
+C less sequence, if the table is large enough to support tuneup's needs.
+C The code would be, using non-PIC code,
+C lea tab(%rip),%rax; jmp *(n,%rax)
+C or,
+C lea tab(%rip),%rax; lea (%rip),%rbx; add (n,%rax),%rbx; jmp *%rbx
+C using PIC code. The table entries would be Ln1,Ln2,Ln3,Lm0,Lm1,Lm2,Lm3,..
+C with the last four entries repeated a safe number of times.
+C * Consider expanding feed-in code in order to avoid zeroing registers.
+C * Zero consistently with xor.
+C * Check if using "lea (reg),reg" should be done in more places; we have some
+C explicit "mov %rax,reg" now.
+C * Try zeroing with xor in m2 loops.
+C * Try re-rolling the m2 loops to avoid the current 9 insn code duplication
+C between loop header and wind-down code.
+C * Consider adc reg,reg instead of adc $0,reg in m2 loops. This save a byte.
+
+C When playing with pointers, set this to $2 to fall back to conservative
+C indexing in wind-down code.
+define(`I',`$1')
+
+C Define this to $1 to use late loop index variable as zero, $2 to use an
+C explicit $0.
+define(`Z',`$1')
+
+define(`rp', `%rdi')
+define(`up', `%rsi')
+define(`n_param', `%rdx')
+
+define(`n', `%r8')
+
+define(`v0', `%r10')
+define(`v1', `%r11')
+define(`w0', `%rbx')
+define(`w1', `%rcx')
+define(`w2', `%rbp')
+define(`w3', `%r9')
+define(`i', `%r13')
+
+define(`X0', `%r12')
+define(`X1', `%r14')
+
+C rax rbx rcx rdx rdi rsi rbp r8 r9 r10 r11 r12 r13 r14 r15
+
+ABI_SUPPORT(DOS64)
+ABI_SUPPORT(STD64)
+
+define(`ALIGNx', `ALIGN(16)')
+
+define(`N', 85)
+ifdef(`N',,`define(`N',0)')
+define(`MOV', `ifelse(eval(N & $3),0,`mov $1, $2',`lea ($1), $2')')
+
+ASM_START()
+ TEXT
+ ALIGN(32)
+PROLOGUE(mpn_sqr_basecase)
+ FUNC_ENTRY(3)
+
+ cmp $4, n_param
+ jl L(small)
+
+ push %rbx
+ push %rbp
+ push %r12
+ push %r13
+ push %r14
+
+ mov (up), v0
+ mov 8(up), %rax
+ mov %rax, v1
+
+ mov $1, R32(n)
+ sub n_param, n C n = -n_param+1
+ push n
+
+ lea (up,n_param,8), up
+ lea (rp,n_param,8), rp
+
+ mul v0
+
+ test $1, R8(n)
+ jnz L(bx1)
+
+L(bx0): test $2, R8(n)
+ mov %rax, (rp,n,8)
+ jnz L(b10)
+
+L(b00): lea (n), i C n = 5, 9, ...
+ mov %rdx, w1 C FIXME: Use lea?
+ xor R32(w2), R32(w2)
+ jmp L(m2e0)
+
+L(b10): lea 2(n), i C n = 7, 11, ...
+ mov 8(up,n,8), %rax
+ mov %rdx, w3 C FIXME: Use lea?
+ xor R32(w0), R32(w0)
+ xor R32(w1), R32(w1)
+ jmp L(m2e2)
+
+L(bx1): test $2, R8(n)
+ mov %rax, (rp,n,8)
+ jz L(b11)
+
+L(b01): lea 1(n), i C n = 6, 10, ...
+ mov %rdx, w0 C FIXME: Use lea?
+ xor R32(w1), R32(w1)
+ jmp L(m2e1)
+
+L(b11): lea -1(n), i C n = 4, 8, 12, ...
+ mov %rdx, w2 C FIXME: Use lea?
+ xor R32(w3), R32(w3)
+ jmp L(m2e3)
+
+
+ ALIGNx
+L(m2top1):
+ mul v0
+ add %rax, w3
+ mov -8(up,i,8), %rax
+ mov w3, -8(rp,i,8)
+ adc %rdx, w0
+ adc $0, R32(w1)
+ mul v1
+ add %rax, w0
+ adc %rdx, w1
+L(m2e1):mov $0, R32(w2)
+ mov (up,i,8), %rax
+ mul v0
+ add %rax, w0
+ mov w0, (rp,i,8)
+ adc %rdx, w1
+ mov (up,i,8), %rax
+ adc $0, R32(w2)
+ mul v1
+ add %rax, w1
+ adc %rdx, w2
+ mov 8(up,i,8), %rax
+ mul v0
+ mov $0, R32(w3)
+ add %rax, w1
+ adc %rdx, w2
+ adc $0, R32(w3)
+ mov 8(up,i,8), %rax
+ mul v1
+ add %rax, w2
+ mov w1, 8(rp,i,8)
+ adc %rdx, w3
+ mov $0, R32(w0)
+ mov 16(up,i,8), %rax
+ mul v0
+ add %rax, w2
+ mov 16(up,i,8), %rax
+ adc %rdx, w3
+ adc $0, R32(w0)
+ mul v1
+ mov $0, R32(w1)
+ add %rax, w3
+ mov 24(up,i,8), %rax
+ mov w2, 16(rp,i,8)
+ adc %rdx, w0
+ add $4, i
+ js L(m2top1)
+
+ mul v0
+ add %rax, w3
+ mov I(-8(up),-8(up,i,8)), %rax
+ mov w3, I(-8(rp),-8(rp,i,8))
+ adc %rdx, w0
+ adc R32(w1), R32(w1)
+ mul v1
+ add w0, %rax
+ adc w1, %rdx
+ mov %rax, I((rp),(rp,i,8))
+ mov %rdx, I(8(rp),8(rp,i,8))
+
+ lea 16(rp), rp
+ add $2, n C decrease |n|
+ jmp L(am2o3)
+
+ ALIGNx
+L(m2top3):
+ mul v0
+ add %rax, w3
+ mov -8(up,i,8), %rax
+ mov w3, -8(rp,i,8)
+ adc %rdx, w0
+ adc $0, R32(w1)
+ mul v1
+ add %rax, w0
+ adc %rdx, w1
+ mov $0, R32(w2)
+ mov (up,i,8), %rax
+ mul v0
+ add %rax, w0
+ mov w0, (rp,i,8)
+ adc %rdx, w1
+ mov (up,i,8), %rax
+ adc $0, R32(w2)
+ mul v1
+ add %rax, w1
+ adc %rdx, w2
+ mov 8(up,i,8), %rax
+ mul v0
+ mov $0, R32(w3)
+ add %rax, w1
+ adc %rdx, w2
+ adc $0, R32(w3)
+ mov 8(up,i,8), %rax
+ mul v1
+ add %rax, w2
+ mov w1, 8(rp,i,8)
+ adc %rdx, w3
+L(m2e3):mov $0, R32(w0)
+ mov 16(up,i,8), %rax
+ mul v0
+ add %rax, w2
+ mov 16(up,i,8), %rax
+ adc %rdx, w3
+ adc $0, R32(w0)
+ mul v1
+ mov $0, R32(w1)
+ add %rax, w3
+ mov 24(up,i,8), %rax
+ mov w2, 16(rp,i,8)
+ adc %rdx, w0
+ add $4, i
+ js L(m2top3)
+
+ mul v0
+ add %rax, w3
+ mov I(-8(up),-8(up,i,8)), %rax
+ mov w3, I(-8(rp),-8(rp,i,8))
+ adc %rdx, w0
+ adc R32(w1), R32(w1)
+ mul v1
+ add w0, %rax
+ adc w1, %rdx
+ mov %rax, I((rp),(rp,i,8))
+ mov %rdx, I(8(rp),8(rp,i,8))
+
+ lea 16(rp), rp
+ add $2, n C decrease |n|
+ cmp $-1, n
+ jz L(cor1) C jumps iff entry n = 4
+
+L(am2o1):
+ mov -8(up,n,8), v0
+ mov (up,n,8), %rax
+ mov %rax, v1
+ lea 1(n), i
+ mul v0
+ mov %rax, X1
+ MOV( %rdx, X0, 128)
+ mov (rp,n,8), w1
+ xor R32(w2), R32(w2)
+ mov 8(up,n,8), %rax
+ xor R32(w3), R32(w3)
+ jmp L(lo1)
+
+ ALIGNx
+L(am2top1):
+ mul v1
+ add w0, w1
+ adc %rax, w2
+ mov (up,i,8), %rax
+ MOV( %rdx, w3, 1)
+ adc $0, w3
+L(lo1): mul v0
+ add w1, X1
+ mov X1, -8(rp,i,8)
+ adc %rax, X0
+ MOV( %rdx, X1, 2)
+ adc $0, X1
+ mov (up,i,8), %rax
+ mul v1
+ MOV( %rdx, w0, 4)
+ mov (rp,i,8), w1
+ add w1, w2
+ adc %rax, w3
+ adc $0, w0
+ mov 8(up,i,8), %rax
+ mul v0
+ add w2, X0
+ adc %rax, X1
+ mov X0, (rp,i,8)
+ MOV( %rdx, X0, 8)
+ adc $0, X0
+ mov 8(up,i,8), %rax
+ mov 8(rp,i,8), w2
+ mul v1
+ add w2, w3
+ adc %rax, w0
+ MOV( %rdx, w1, 16)
+ adc $0, w1
+ mov 16(up,i,8), %rax
+ mul v0
+ add w3, X1
+ mov X1, 8(rp,i,8)
+ adc %rax, X0
+ MOV( %rdx, X1, 32)
+ mov 16(rp,i,8), w3
+ adc $0, X1
+ mov 16(up,i,8), %rax
+ mul v1
+ add w3, w0
+ MOV( %rdx, w2, 64)
+ adc %rax, w1
+ mov 24(up,i,8), %rax
+ adc $0, w2
+ mul v0
+ add w0, X0
+ mov X0, 16(rp,i,8)
+ MOV( %rdx, X0, 128)
+ adc %rax, X1
+ mov 24(up,i,8), %rax
+ mov 24(rp,i,8), w0
+ adc $0, X0
+ add $4, i
+ jnc L(am2top1)
+
+ mul v1
+ add w0, w1
+ adc w2, %rax
+ adc Z(i,$0), %rdx
+ add w1, X1
+ adc Z(i,$0), X0
+ mov X1, I(-8(rp),-8(rp,i,8))
+ add X0, %rax
+ mov %rax, I((rp),(rp,i,8))
+ adc Z(i,$0), %rdx
+ mov %rdx, I(8(rp),8(rp,i,8))
+
+ lea 16(rp), rp
+ add $2, n
+
+L(am2o3):
+ mov -8(up,n,8), v0
+ mov (up,n,8), %rax
+ mov %rax, v1
+ lea -1(n), i
+ mul v0
+ mov %rax, X1
+ MOV( %rdx, X0, 8)
+ mov (rp,n,8), w3
+ xor R32(w0), R32(w0)
+ xor R32(w1), R32(w1)
+ mov 8(up,n,8), %rax
+ jmp L(lo3)
+
+ ALIGNx
+L(am2top3):
+ mul v1
+ add w0, w1
+ adc %rax, w2
+ mov (up,i,8), %rax
+ MOV( %rdx, w3, 1)
+ adc $0, w3
+ mul v0
+ add w1, X1
+ mov X1, -8(rp,i,8)
+ adc %rax, X0
+ MOV( %rdx, X1, 2)
+ adc $0, X1
+ mov (up,i,8), %rax
+ mul v1
+ MOV( %rdx, w0, 4)
+ mov (rp,i,8), w1
+ add w1, w2
+ adc %rax, w3
+ adc $0, w0
+ mov 8(up,i,8), %rax
+ mul v0
+ add w2, X0
+ adc %rax, X1
+ mov X0, (rp,i,8)
+ MOV( %rdx, X0, 8)
+ adc $0, X0
+ mov 8(up,i,8), %rax
+ mov 8(rp,i,8), w2
+ mul v1
+ add w2, w3
+ adc %rax, w0
+ MOV( %rdx, w1, 16)
+ adc $0, w1
+ mov 16(up,i,8), %rax
+L(lo3): mul v0
+ add w3, X1
+ mov X1, 8(rp,i,8)
+ adc %rax, X0
+ MOV( %rdx, X1, 32)
+ mov 16(rp,i,8), w3
+ adc $0, X1
+ mov 16(up,i,8), %rax
+ mul v1
+ add w3, w0
+ MOV( %rdx, w2, 64)
+ adc %rax, w1
+ mov 24(up,i,8), %rax
+ adc $0, w2
+ mul v0
+ add w0, X0
+ mov X0, 16(rp,i,8)
+ MOV( %rdx, X0, 128)
+ adc %rax, X1
+ mov 24(up,i,8), %rax
+ mov 24(rp,i,8), w0
+ adc $0, X0
+ add $4, i
+ jnc L(am2top3)
+
+ mul v1
+ add w0, w1
+ adc w2, %rax
+ adc Z(i,$0), %rdx
+ add w1, X1
+ adc Z(i,$0), X0
+ mov X1, I(-8(rp),-8(rp,i,8))
+ add X0, %rax
+ mov %rax, I((rp),(rp,i,8))
+ adc Z(i,$0), %rdx
+ mov %rdx, I(8(rp),8(rp,i,8))
+
+ lea 16(rp), rp
+ add $2, n
+ cmp $-1, n
+ jnz L(am2o1)
+
+L(cor1):pop n
+ mov %rdx, w3
+ mov -16(up), v0
+ mov -8(up), %rax
+ mul v0
+ add w3, %rax
+ adc $0, %rdx
+ mov %rax, -8(rp)
+ mov %rdx, (rp)
+ jmp L(sqr_diag_addlsh1)
+
+ ALIGNx
+L(m2top2):
+L(m2e2):mul v0
+ add %rax, w3
+ mov -8(up,i,8), %rax
+ mov w3, -8(rp,i,8)
+ adc %rdx, w0
+ adc $0, R32(w1)
+ mul v1
+ add %rax, w0
+ adc %rdx, w1
+ mov $0, R32(w2)
+ mov (up,i,8), %rax
+ mul v0
+ add %rax, w0
+ mov w0, (rp,i,8)
+ adc %rdx, w1
+ mov (up,i,8), %rax
+ adc $0, R32(w2)
+ mul v1
+ add %rax, w1
+ adc %rdx, w2
+ mov 8(up,i,8), %rax
+ mul v0
+ mov $0, R32(w3)
+ add %rax, w1
+ adc %rdx, w2
+ adc $0, R32(w3)
+ mov 8(up,i,8), %rax
+ mul v1
+ add %rax, w2
+ mov w1, 8(rp,i,8)
+ adc %rdx, w3
+ mov $0, R32(w0)
+ mov 16(up,i,8), %rax
+ mul v0
+ add %rax, w2
+ mov 16(up,i,8), %rax
+ adc %rdx, w3
+ adc $0, R32(w0)
+ mul v1
+ mov $0, R32(w1)
+ add %rax, w3
+ mov 24(up,i,8), %rax
+ mov w2, 16(rp,i,8)
+ adc %rdx, w0
+ add $4, i
+ js L(m2top2)
+
+ mul v0
+ add %rax, w3
+ mov I(-8(up),-8(up,i,8)), %rax
+ mov w3, I(-8(rp),-8(rp,i,8))
+ adc %rdx, w0
+ adc R32(w1), R32(w1)
+ mul v1
+ add w0, %rax
+ adc w1, %rdx
+ mov %rax, I((rp),(rp,i,8))
+ mov %rdx, I(8(rp),8(rp,i,8))
+
+ lea 16(rp), rp
+ add $2, n C decrease |n|
+ jmp L(am2o0)
+
+ ALIGNx
+L(m2top0):
+ mul v0
+ add %rax, w3
+ mov -8(up,i,8), %rax
+ mov w3, -8(rp,i,8)
+ adc %rdx, w0
+ adc $0, R32(w1)
+ mul v1
+ add %rax, w0
+ adc %rdx, w1
+ mov $0, R32(w2)
+ mov (up,i,8), %rax
+ mul v0
+ add %rax, w0
+ mov w0, (rp,i,8)
+ adc %rdx, w1
+ mov (up,i,8), %rax
+ adc $0, R32(w2)
+ mul v1
+ add %rax, w1
+ adc %rdx, w2
+L(m2e0):mov 8(up,i,8), %rax
+ mul v0
+ mov $0, R32(w3)
+ add %rax, w1
+ adc %rdx, w2
+ adc $0, R32(w3)
+ mov 8(up,i,8), %rax
+ mul v1
+ add %rax, w2
+ mov w1, 8(rp,i,8)
+ adc %rdx, w3
+ mov $0, R32(w0)
+ mov 16(up,i,8), %rax
+ mul v0
+ add %rax, w2
+ mov 16(up,i,8), %rax
+ adc %rdx, w3
+ adc $0, R32(w0)
+ mul v1
+ mov $0, R32(w1)
+ add %rax, w3
+ mov 24(up,i,8), %rax
+ mov w2, 16(rp,i,8)
+ adc %rdx, w0
+ add $4, i
+ js L(m2top0)
+
+ mul v0
+ add %rax, w3
+ mov I(-8(up),-8(up,i,8)), %rax
+ mov w3, I(-8(rp),-8(rp,i,8))
+ adc %rdx, w0
+ adc R32(w1), R32(w1)
+ mul v1
+ add w0, %rax
+ adc w1, %rdx
+ mov %rax, I((rp),(rp,i,8))
+ mov %rdx, I(8(rp),8(rp,i,8))
+
+ lea 16(rp), rp
+ add $2, n C decrease |n|
+ cmp $-2, n
+ jz L(cor2) C jumps iff entry n = 5
+
+L(am2o2):
+ mov -8(up,n,8), v0
+ mov (up,n,8), %rax
+ mov %rax, v1
+ lea -2(n), i
+ mul v0
+ mov %rax, X0
+ MOV( %rdx, X1, 32)
+ mov (rp,n,8), w0
+ xor R32(w1), R32(w1)
+ xor R32(w2), R32(w2)
+ mov 8(up,n,8), %rax
+ jmp L(lo2)
+
+ ALIGNx
+L(am2top2):
+ mul v1
+ add w0, w1
+ adc %rax, w2
+ mov (up,i,8), %rax
+ MOV( %rdx, w3, 1)
+ adc $0, w3
+ mul v0
+ add w1, X1
+ mov X1, -8(rp,i,8)
+ adc %rax, X0
+ MOV( %rdx, X1, 2)
+ adc $0, X1
+ mov (up,i,8), %rax
+ mul v1
+ MOV( %rdx, w0, 4)
+ mov (rp,i,8), w1
+ add w1, w2
+ adc %rax, w3
+ adc $0, w0
+ mov 8(up,i,8), %rax
+ mul v0
+ add w2, X0
+ adc %rax, X1
+ mov X0, (rp,i,8)
+ MOV( %rdx, X0, 8)
+ adc $0, X0
+ mov 8(up,i,8), %rax
+ mov 8(rp,i,8), w2
+ mul v1
+ add w2, w3
+ adc %rax, w0
+ MOV( %rdx, w1, 16)
+ adc $0, w1
+ mov 16(up,i,8), %rax
+ mul v0
+ add w3, X1
+ mov X1, 8(rp,i,8)
+ adc %rax, X0
+ MOV( %rdx, X1, 32)
+ mov 16(rp,i,8), w3
+ adc $0, X1
+ mov 16(up,i,8), %rax
+ mul v1
+ add w3, w0
+ MOV( %rdx, w2, 64)
+ adc %rax, w1
+ mov 24(up,i,8), %rax
+ adc $0, w2
+L(lo2): mul v0
+ add w0, X0
+ mov X0, 16(rp,i,8)
+ MOV( %rdx, X0, 128)
+ adc %rax, X1
+ mov 24(up,i,8), %rax
+ mov 24(rp,i,8), w0
+ adc $0, X0
+ add $4, i
+ jnc L(am2top2)
+
+ mul v1
+ add w0, w1
+ adc w2, %rax
+ adc Z(i,$0), %rdx
+ add w1, X1
+ adc Z(i,$0), X0
+ mov X1, I(-8(rp),-8(rp,i,8))
+ add X0, %rax
+ mov %rax, I((rp),(rp,i,8))
+ adc Z(i,$0), %rdx
+ mov %rdx, I(8(rp),8(rp,i,8))
+
+ lea 16(rp), rp
+ add $2, n
+
+L(am2o0):
+ mov -8(up,n,8), v0
+ mov (up,n,8), %rax
+ mov %rax, v1
+ lea 0(n), i
+ mul v0
+ mov %rax, X0
+ MOV( %rdx, X1, 2)
+ xor R32(w0), R32(w0)
+ mov (rp,n,8), w2
+ xor R32(w3), R32(w3)
+ jmp L(lo0)
+
+ ALIGNx
+L(am2top0):
+ mul v1
+ add w0, w1
+ adc %rax, w2
+ mov (up,i,8), %rax
+ MOV( %rdx, w3, 1)
+ adc $0, w3
+ mul v0
+ add w1, X1
+ mov X1, -8(rp,i,8)
+ adc %rax, X0
+ MOV( %rdx, X1, 2)
+ adc $0, X1
+ mov (up,i,8), %rax
+ mul v1
+ MOV( %rdx, w0, 4)
+ mov (rp,i,8), w1
+ add w1, w2
+ adc %rax, w3
+ adc $0, w0
+L(lo0): mov 8(up,i,8), %rax
+ mul v0
+ add w2, X0
+ adc %rax, X1
+ mov X0, (rp,i,8)
+ MOV( %rdx, X0, 8)
+ adc $0, X0
+ mov 8(up,i,8), %rax
+ mov 8(rp,i,8), w2
+ mul v1
+ add w2, w3
+ adc %rax, w0
+ MOV( %rdx, w1, 16)
+ adc $0, w1
+ mov 16(up,i,8), %rax
+ mul v0
+ add w3, X1
+ mov X1, 8(rp,i,8)
+ adc %rax, X0
+ MOV( %rdx, X1, 32)
+ mov 16(rp,i,8), w3
+ adc $0, X1
+ mov 16(up,i,8), %rax
+ mul v1
+ add w3, w0
+ MOV( %rdx, w2, 64)
+ adc %rax, w1
+ mov 24(up,i,8), %rax
+ adc $0, w2
+ mul v0
+ add w0, X0
+ mov X0, 16(rp,i,8)
+ MOV( %rdx, X0, 128)
+ adc %rax, X1
+ mov 24(up,i,8), %rax
+ mov 24(rp,i,8), w0
+ adc $0, X0
+ add $4, i
+ jnc L(am2top0)
+
+ mul v1
+ add w0, w1
+ adc w2, %rax
+ adc Z(i,$0), %rdx
+ add w1, X1
+ adc Z(i,$0), X0
+ mov X1, I(-8(rp),-8(rp,i,8))
+ add X0, %rax
+ mov %rax, I((rp),(rp,i,8))
+ adc Z(i,$0), %rdx
+ mov %rdx, I(8(rp),8(rp,i,8))
+
+ lea 16(rp), rp
+ add $2, n
+ cmp $-2, n
+ jnz L(am2o2)
+
+L(cor2):pop n
+ mov -24(up), v0
+ mov %rax, w2
+ mov %rdx, w0
+ mov -16(up), %rax
+ mov %rax, v1
+ mul v0
+ mov %rax, X0
+ MOV( %rdx, X1, 32)
+ mov -8(up), %rax
+ mul v0
+ add w2, X0
+ mov X0, -16(rp)
+ MOV( %rdx, X0, 128)
+ adc %rax, X1
+ mov -8(up), %rax
+ adc $0, X0
+ mul v1
+ add w0, X1
+ adc $0, X0
+ mov X1, -8(rp)
+ add X0, %rax
+ mov %rax, (rp)
+ adc $0, %rdx
+ mov %rdx, 8(rp)
+ lea 8(rp), rp
+
+L(sqr_diag_addlsh1):
+ mov -8(up,n,8), %rax
+ shl n
+ xor R32(%rbx), R32(%rbx)
+ mul %rax
+ mov 8(rp,n,8), %r11
+ lea (%rdx), %r10
+ mov 16(rp,n,8), %r9
+ add %r11, %r11
+ jmp L(dm)
+
+ ALIGNx
+L(dtop):mul %rax
+ add %r11, %r10
+ mov 8(rp,n,8), %r11
+ mov %r10, -8(rp,n,8)
+ adc %r9, %rax
+ lea (%rdx,%rbx), %r10
+ mov 16(rp,n,8), %r9
+ adc %r11, %r11
+L(dm): mov %rax, (rp,n,8)
+ mov (up,n,4), %rax
+ adc %r9, %r9
+ setc R8(%rbx)
+ add $2, n
+ js L(dtop)
+
+ mul %rax
+ add %r11, %r10
+ mov %r10, -8(rp)
+ adc %r9, %rax
+ lea (%rdx,%rbx), %r10
+ mov %rax, (rp)
+ adc $0, %r10
+ mov %r10, 8(rp)
+
+ pop %r14
+ pop %r13
+ pop %r12
+ pop %rbp
+ pop %rbx
+ FUNC_EXIT()
+ ret
+
+ ALIGN(16)
+L(small):
+ mov (up), %rax
+ cmp $2, n_param
+ jae L(gt1)
+L(n1):
+ mul %rax
+ mov %rax, (rp)
+ mov %rdx, 8(rp)
+ FUNC_EXIT()
+ ret
+
+L(gt1): jne L(gt2)
+L(n2): mov %rax, %r8
+ mul %rax
+ mov 8(up), %r11
+ mov %rax, (rp)
+ mov %r11, %rax
+ mov %rdx, %r9
+ mul %rax
+ mov %rax, %r10
+ mov %r11, %rax
+ mov %rdx, %r11
+ mul %r8
+ xor %r8, %r8
+ add %rax, %r9
+ adc %rdx, %r10
+ adc %r8, %r11
+ add %rax, %r9
+ mov %r9, 8(rp)
+ adc %rdx, %r10
+ mov %r10, 16(rp)
+ adc %r8, %r11
+ mov %r11, 24(rp)
+ FUNC_EXIT()
+ ret
+
+L(gt2):
+L(n3): mov %rax, %r10
+ mul %rax
+ mov 8(up), %r11
+ mov %rax, (rp)
+ mov %r11, %rax
+ mov %rdx, 8(rp)
+ mul %rax
+ mov 16(up), %rcx
+ mov %rax, 16(rp)
+ mov %rcx, %rax
+ mov %rdx, 24(rp)
+ mul %rax
+ mov %rax, 32(rp)
+ mov %rdx, 40(rp)
+
+ mov %r11, %rax
+ mul %r10
+ mov %rax, %r8
+ mov %rcx, %rax
+ mov %rdx, %r9
+ mul %r10
+ xor %r10, %r10
+ add %rax, %r9
+ mov %r11, %rax
+ mov %r10, %r11
+ adc %rdx, %r10
+
+ mul %rcx
+ add %rax, %r10
+ adc %r11, %rdx
+ add %r8, %r8
+ adc %r9, %r9
+ adc %r10, %r10
+ adc %rdx, %rdx
+ adc %r11, %r11
+ add %r8, 8(rp)
+ adc %r9, 16(rp)
+ adc %r10, 24(rp)
+ adc %rdx, 32(rp)
+ adc %r11, 40(rp)
+ FUNC_EXIT()
+ ret
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/core2/sublsh1_n.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/core2/sublsh1_n.asm
new file mode 100644
index 00000000000..46488fcafeb
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/core2/sublsh1_n.asm
@@ -0,0 +1,47 @@
+dnl AMD64 mpn_sublsh1_n optimised for Core 2 and Core iN.
+
+dnl Contributed to the GNU project by Torbjorn Granlund.
+
+dnl Copyright 2008, 2010-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')
+
+define(LSH, 1)
+define(RSH, 63)
+
+define(ADDSUB, sub)
+define(ADCSBB, sbb)
+define(func, mpn_sublsh1_n)
+
+MULFUNC_PROLOGUE(mpn_sublsh1_n)
+
+ABI_SUPPORT(DOS64)
+ABI_SUPPORT(STD64)
+
+include_mpn(`x86_64/core2/sublshC_n.asm')
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/core2/sublsh2_n.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/core2/sublsh2_n.asm
new file mode 100644
index 00000000000..f3b1e284646
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/core2/sublsh2_n.asm
@@ -0,0 +1,47 @@
+dnl AMD64 mpn_sublsh2_n optimised for Core 2 and Core iN.
+
+dnl Contributed to the GNU project by Torbjorn Granlund.
+
+dnl Copyright 2008, 2010-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')
+
+define(LSH, 2)
+define(RSH, 62)
+
+define(ADDSUB, sub)
+define(ADCSBB, sbb)
+define(func, mpn_sublsh2_n)
+
+MULFUNC_PROLOGUE(mpn_sublsh2_n)
+
+ABI_SUPPORT(DOS64)
+ABI_SUPPORT(STD64)
+
+include_mpn(`x86_64/core2/sublshC_n.asm')
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/core2/sublshC_n.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/core2/sublshC_n.asm
new file mode 100644
index 00000000000..5acc46b032a
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/core2/sublshC_n.asm
@@ -0,0 +1,158 @@
+dnl AMD64 mpn_sublshC_n -- rp[] = up[] - (vp[] << 1), optimised for Core 2 and
+dnl Core iN.
+
+dnl Contributed to the GNU project by Torbjorn Granlund.
+
+dnl Copyright 2008, 2010-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/.
+
+C cycles/limb
+C AMD K8,K9 4.25
+C AMD K10 ?
+C Intel P4 ?
+C Intel core2 3
+C Intel NHM 3.1
+C Intel SBR 2.47
+C Intel atom ?
+C VIA nano ?
+
+C INPUT PARAMETERS
+define(`rp',`%rdi')
+define(`up',`%rsi')
+define(`vp',`%rdx')
+define(`n', `%rcx')
+
+ASM_START()
+ TEXT
+ ALIGN(8)
+PROLOGUE(func)
+ FUNC_ENTRY(4)
+ push %rbx
+ push %r12
+
+ mov R32(%rcx), R32(%rax)
+ lea 24(up,n,8), up
+ lea 24(vp,n,8), vp
+ lea 24(rp,n,8), rp
+ neg n
+
+ xor R32(%r11), R32(%r11)
+
+ mov -24(vp,n,8), %r8 C do first limb early
+ shrd $RSH, %r8, %r11
+
+ and $3, R32(%rax)
+ je L(b0)
+ cmp $2, R32(%rax)
+ jc L(b1)
+ je L(b2)
+
+L(b3): mov -16(vp,n,8), %r9
+ shrd $RSH, %r9, %r8
+ mov -8(vp,n,8), %r10
+ shrd $RSH, %r10, %r9
+ mov -24(up,n,8), %r12
+ ADDSUB %r11, %r12
+ mov %r12, -24(rp,n,8)
+ mov -16(up,n,8), %r12
+ ADCSBB %r8, %r12
+ mov %r12, -16(rp,n,8)
+ mov -8(up,n,8), %r12
+ ADCSBB %r9, %r12
+ mov %r12, -8(rp,n,8)
+ mov %r10, %r11
+ sbb R32(%rax), R32(%rax) C save cy
+ add $3, n
+ js L(top)
+ jmp L(end)
+
+L(b1): mov -24(up,n,8), %r12
+ ADDSUB %r11, %r12
+ mov %r12, -24(rp,n,8)
+ mov %r8, %r11
+ sbb R32(%rax), R32(%rax) C save cy
+ inc n
+ js L(top)
+ jmp L(end)
+
+L(b2): mov -16(vp,n,8), %r9
+ shrd $RSH, %r9, %r8
+ mov -24(up,n,8), %r12
+ ADDSUB %r11, %r12
+ mov %r12, -24(rp,n,8)
+ mov -16(up,n,8), %r12
+ ADCSBB %r8, %r12
+ mov %r12, -16(rp,n,8)
+ mov %r9, %r11
+ sbb R32(%rax), R32(%rax) C save cy
+ add $2, n
+ js L(top)
+ jmp L(end)
+
+ ALIGN(16)
+L(top): mov -24(vp,n,8), %r8
+ shrd $RSH, %r8, %r11
+L(b0): mov -16(vp,n,8), %r9
+ shrd $RSH, %r9, %r8
+ mov -8(vp,n,8), %r10
+ shrd $RSH, %r10, %r9
+ mov (vp,n,8), %rbx
+ shrd $RSH, %rbx, %r10
+
+ add R32(%rax), R32(%rax) C restore cy
+
+ mov -24(up,n,8), %r12
+ ADCSBB %r11, %r12
+ mov %r12, -24(rp,n,8)
+
+ mov -16(up,n,8), %r12
+ ADCSBB %r8, %r12
+ mov %r12, -16(rp,n,8)
+
+ mov -8(up,n,8), %r12
+ ADCSBB %r9, %r12
+ mov %r12, -8(rp,n,8)
+
+ mov (up,n,8), %r12
+ ADCSBB %r10, %r12
+ mov %r12, (rp,n,8)
+
+ mov %rbx, %r11
+ sbb R32(%rax), R32(%rax) C save cy
+
+ add $4, n
+ js L(top)
+
+L(end): shr $RSH, %r11
+ pop %r12
+ pop %rbx
+ sub R32(%r11), R32(%rax)
+ neg R32(%rax)
+ FUNC_EXIT()
+ ret
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/coreihwl/addmul_2.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/coreihwl/addmul_2.asm
new file mode 100644
index 00000000000..54aebc888d7
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/coreihwl/addmul_2.asm
@@ -0,0 +1,238 @@
+dnl AMD64 mpn_addmul_2 optimised for Intel Haswell.
+
+dnl Contributed to the GNU project by Torbjörn Granlund.
+
+dnl Copyright 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/limb
+C AMD K8,K9 n/a
+C AMD K10 n/a
+C AMD bull n/a
+C AMD pile n/a
+C AMD steam ?
+C AMD bobcat n/a
+C AMD jaguar ?
+C Intel P4 n/a
+C Intel core n/a
+C Intel NHM n/a
+C Intel SBR n/a
+C Intel IBR n/a
+C Intel HWL 2.15
+C Intel BWL ?
+C Intel atom n/a
+C VIA nano n/a
+
+C The loop of this code is the result of running a code generation and
+C optimisation tool suite written by David Harvey and Torbjörn Granlund.
+
+define(`rp', `%rdi')
+define(`up', `%rsi')
+define(`n_param',`%rdx')
+define(`vp', `%rcx')
+
+define(`v0', `%r8')
+define(`v1', `%r9')
+define(`w0', `%rbx')
+define(`w1', `%rcx')
+define(`w2', `%rbp')
+define(`w3', `%r10')
+define(`n', `%r11')
+define(`X0', `%r12')
+define(`X1', `%r13')
+
+ABI_SUPPORT(DOS64)
+ABI_SUPPORT(STD64)
+
+ASM_START()
+ TEXT
+ ALIGN(32)
+PROLOGUE(mpn_addmul_2)
+ FUNC_ENTRY(4)
+ push %rbx
+ push %rbp
+ push %r12
+ push %r13
+
+ mov (vp), v0
+ mov 8(vp), v1
+
+ mov n_param, n
+ shr $2, n
+
+ test $1, R8(n_param)
+ jnz L(bx1)
+
+L(bx0): mov (rp), X0
+ mov 8(rp), X1
+ test $2, R8(n_param)
+ jnz L(b10)
+
+L(b00): mov (up), %rdx
+ lea 16(up), up
+ mulx( v0, %rax, w1)
+ add %rax, X0
+ mulx( v1, %rax, w2)
+ adc $0, w1
+ mov X0, (rp)
+ add %rax, X1
+ adc $0, w2
+ mov -8(up), %rdx
+ lea 16(rp), rp
+ jmp L(lo0)
+
+L(b10): mov (up), %rdx
+ inc n
+ mulx( v0, %rax, w1)
+ add %rax, X0
+ adc $0, w1
+ mulx( v1, %rax, w2)
+ mov X0, (rp)
+ mov 16(rp), X0
+ add %rax, X1
+ adc $0, w2
+ xor w0, w0
+ jmp L(lo2)
+
+L(bx1): mov (rp), X1
+ mov 8(rp), X0
+ test $2, R8(n_param)
+ jnz L(b11)
+
+L(b01): mov (up), %rdx
+ mulx( v0, %rax, w3)
+ add %rax, X1
+ adc $0, w3
+ mulx( v1, %rax, w0)
+ add %rax, X0
+ adc $0, w0
+ mov 8(up), %rdx
+ mov X1, (rp)
+ mov 16(rp), X1
+ mulx( v0, %rax, w1)
+ lea 24(rp), rp
+ lea 24(up), up
+ jmp L(lo1)
+
+L(b11): mov (up), %rdx
+ inc n
+ mulx( v0, %rax, w3)
+ add %rax, X1
+ adc $0, w3
+ mulx( v1, %rax, w0)
+ add %rax, X0
+ adc $0, w0
+ mov X1, (rp)
+ mov 8(up), %rdx
+ mulx( v0, %rax, w1)
+ lea 8(rp), rp
+ lea 8(up), up
+ jmp L(lo3)
+
+ ALIGN(16)
+L(top): mulx( v0, %rax, w3)
+ add w0, X1
+ adc $0, w2
+ add %rax, X1
+ adc $0, w3
+ mulx( v1, %rax, w0)
+ add %rax, X0
+ adc $0, w0
+ lea 32(rp), rp
+ add w1, X1
+ mov -16(up), %rdx
+ mov X1, -24(rp)
+ adc $0, w3
+ add w2, X0
+ mov -8(rp), X1
+ mulx( v0, %rax, w1)
+ adc $0, w0
+L(lo1): add %rax, X0
+ mulx( v1, %rax, w2)
+ adc $0, w1
+ add w3, X0
+ mov X0, -16(rp)
+ adc $0, w1
+ add %rax, X1
+ adc $0, w2
+ add w0, X1
+ mov -8(up), %rdx
+ adc $0, w2
+L(lo0): mulx( v0, %rax, w3)
+ add %rax, X1
+ adc $0, w3
+ mov (rp), X0
+ mulx( v1, %rax, w0)
+ add %rax, X0
+ adc $0, w0
+ add w1, X1
+ mov X1, -8(rp)
+ adc $0, w3
+ mov (up), %rdx
+ add w2, X0
+ mulx( v0, %rax, w1)
+ adc $0, w0
+L(lo3): add %rax, X0
+ adc $0, w1
+ mulx( v1, %rax, w2)
+ add w3, X0
+ mov 8(rp), X1
+ mov X0, (rp)
+ mov 16(rp), X0
+ adc $0, w1
+ add %rax, X1
+ adc $0, w2
+L(lo2): mov 8(up), %rdx
+ lea 32(up), up
+ dec n
+ jnz L(top)
+
+L(end): mulx( v0, %rax, w3)
+ add w0, X1
+ adc $0, w2
+ add %rax, X1
+ adc $0, w3
+ mulx( v1, %rdx, %rax)
+ add w1, X1
+ mov X1, 8(rp)
+ adc $0, w3
+ add w2, %rdx
+ adc $0, %rax
+ add w3, %rdx
+ mov %rdx, 16(rp)
+ adc $0, %rax
+
+ pop %r13
+ pop %r12
+ pop %rbp
+ pop %rbx
+ FUNC_EXIT()
+ ret
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/coreihwl/aorsmul_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/coreihwl/aorsmul_1.asm
new file mode 100644
index 00000000000..fd5a26d00f6
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/coreihwl/aorsmul_1.asm
@@ -0,0 +1,198 @@
+dnl AMD64 mpn_addmul_1 and mpn_submul_1 optimised for Intel Haswell.
+
+dnl Contributed to the GNU project by Torbjörn Granlund.
+
+dnl Copyright 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/limb
+C AMD K8,K9 n/a
+C AMD K10 n/a
+C AMD bull n/a
+C AMD pile n/a
+C AMD steam ?
+C AMD bobcat n/a
+C AMD jaguar ?
+C Intel P4 n/a
+C Intel core n/a
+C Intel NHM n/a
+C Intel SBR n/a
+C Intel IBR n/a
+C Intel HWL 2.32
+C Intel BWL ?
+C Intel atom n/a
+C VIA nano n/a
+
+C The loop of this code is the result of running a code generation and
+C optimisation tool suite written by David Harvey and Torbjörn Granlund.
+
+C TODO
+C * Handle small n separately, for lower overhead.
+
+define(`rp', `%rdi') C rcx
+define(`up', `%rsi') C rdx
+define(`n_param', `%rdx') C r8
+define(`v0_param',`%rcx') C r9
+
+define(`n', `%rbp')
+define(`v0', `%rdx')
+
+ifdef(`OPERATION_addmul_1',`
+ define(`ADDSUB', `add')
+ define(`ADCSBB', `adc')
+ define(`func', `mpn_addmul_1')
+')
+ifdef(`OPERATION_submul_1',`
+ define(`ADDSUB', `sub')
+ define(`ADCSBB', `sbb')
+ define(`func', `mpn_submul_1')
+')
+
+ABI_SUPPORT(DOS64)
+ABI_SUPPORT(STD64)
+
+MULFUNC_PROLOGUE(mpn_addmul_1 mpn_submul_1)
+
+ASM_START()
+ TEXT
+ ALIGN(16)
+PROLOGUE(func)
+ FUNC_ENTRY(4)
+ push %rbx
+ push %rbp
+ push %r12
+ push %r13
+
+ mov n_param, n
+ mov v0_param, v0
+
+ test $1, R8(n)
+ jnz L(bx1)
+
+L(bx0): shr $2, n
+ jc L(b10)
+
+L(b00): mulx( (up), %r13, %r12)
+ mulx( 8,(up), %rbx, %rax)
+ add %r12, %rbx
+ adc $0, %rax
+ mov (rp), %r12
+ mov 8(rp), %rcx
+ mulx( 16,(up), %r9, %r8)
+ lea -16(rp), rp
+ lea 16(up), up
+ ADDSUB %r13, %r12
+ jmp L(lo0)
+
+L(bx1): shr $2, n
+ jc L(b11)
+
+L(b01): mulx( (up), %r11, %r10)
+ jnz L(gt1)
+L(n1): ADDSUB %r11, (rp)
+ mov $0, R32(%rax)
+ adc %r10, %rax
+ jmp L(ret)
+
+L(gt1): mulx( 8,(up), %r13, %r12)
+ mulx( 16,(up), %rbx, %rax)
+ lea 24(up), up
+ add %r10, %r13
+ adc %r12, %rbx
+ adc $0, %rax
+ mov (rp), %r10
+ mov 8(rp), %r12
+ mov 16(rp), %rcx
+ lea -8(rp), rp
+ ADDSUB %r11, %r10
+ jmp L(lo1)
+
+L(b11): mulx( (up), %rbx, %rax)
+ mov (rp), %rcx
+ mulx( 8,(up), %r9, %r8)
+ lea 8(up), up
+ lea -24(rp), rp
+ inc n C adjust n
+ ADDSUB %rbx, %rcx
+ jmp L(lo3)
+
+L(b10): mulx( (up), %r9, %r8)
+ mulx( 8,(up), %r11, %r10)
+ lea -32(rp), rp
+ mov $0, R32(%rax)
+ clc C clear cf
+ jz L(end) C depends on old shift
+
+ ALIGN(16)
+L(top): adc %rax, %r9
+ lea 32(rp), rp
+ adc %r8, %r11
+ mulx( 16,(up), %r13, %r12)
+ mov (rp), %r8
+ mulx( 24,(up), %rbx, %rax)
+ lea 32(up), up
+ adc %r10, %r13
+ adc %r12, %rbx
+ adc $0, %rax
+ mov 8(rp), %r10
+ mov 16(rp), %r12
+ ADDSUB %r9, %r8
+ mov 24(rp), %rcx
+ mov %r8, (rp)
+ ADCSBB %r11, %r10
+L(lo1): mulx( (up), %r9, %r8)
+ mov %r10, 8(rp)
+ ADCSBB %r13, %r12
+L(lo0): mov %r12, 16(rp)
+ ADCSBB %rbx, %rcx
+L(lo3): mulx( 8,(up), %r11, %r10)
+ mov %rcx, 24(rp)
+ dec n
+ jnz L(top)
+
+L(end): adc %rax, %r9
+ adc %r8, %r11
+ mov 32(rp), %r8
+ mov %r10, %rax
+ adc $0, %rax
+ mov 40(rp), %r10
+ ADDSUB %r9, %r8
+ mov %r8, 32(rp)
+ ADCSBB %r11, %r10
+ mov %r10, 40(rp)
+ adc $0, %rax
+
+L(ret): pop %r13
+ pop %r12
+ pop %rbp
+ pop %rbx
+ FUNC_EXIT()
+ ret
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/coreihwl/gmp-mparam.h b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/coreihwl/gmp-mparam.h
new file mode 100644
index 00000000000..eef44b3a814
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/coreihwl/gmp-mparam.h
@@ -0,0 +1,237 @@
+/* Haswell gmp-mparam.h -- Compiler/machine parameter header file.
+
+Copyright 1991, 1993, 1994, 2000-2014 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
+
+/* 2900 MHz Core i5 Haswell */
+/* FFT tuning limit = 75000000 */
+/* Generated by tuneup.c, 2014-03-12, gcc 4.5 */
+
+#define MOD_1_NORM_THRESHOLD 0 /* always */
+#define MOD_1_UNNORM_THRESHOLD 0 /* always */
+#define MOD_1N_TO_MOD_1_1_THRESHOLD 4
+#define MOD_1U_TO_MOD_1_1_THRESHOLD 3
+#define MOD_1_1_TO_MOD_1_2_THRESHOLD 10
+#define MOD_1_2_TO_MOD_1_4_THRESHOLD 26
+#define PREINV_MOD_1_TO_MOD_1_THRESHOLD 10
+#define USE_PREINV_DIVREM_1 1 /* native */
+#define DIV_QR_1_NORM_THRESHOLD 1
+#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 25
+
+#define MUL_TOOM22_THRESHOLD 22
+#define MUL_TOOM33_THRESHOLD 74
+#define MUL_TOOM44_THRESHOLD 195
+#define MUL_TOOM6H_THRESHOLD 298
+#define MUL_TOOM8H_THRESHOLD 406
+
+#define MUL_TOOM32_TO_TOOM43_THRESHOLD 121
+#define MUL_TOOM32_TO_TOOM53_THRESHOLD 138
+#define MUL_TOOM42_TO_TOOM53_THRESHOLD 128
+#define MUL_TOOM42_TO_TOOM63_THRESHOLD 132
+#define MUL_TOOM43_TO_TOOM54_THRESHOLD 170
+
+#define SQR_BASECASE_THRESHOLD 0 /* always (native) */
+#define SQR_TOOM2_THRESHOLD 34
+#define SQR_TOOM3_THRESHOLD 117
+#define SQR_TOOM4_THRESHOLD 336
+#define SQR_TOOM6_THRESHOLD 426
+#define SQR_TOOM8_THRESHOLD 562
+
+#define MULMID_TOOM42_THRESHOLD 42
+
+#define MULMOD_BNM1_THRESHOLD 13
+#define SQRMOD_BNM1_THRESHOLD 17
+
+#define MUL_FFT_MODF_THRESHOLD 376 /* k = 5 */
+#define MUL_FFT_TABLE3 \
+ { { 376, 5}, { 19, 6}, { 10, 5}, { 21, 6}, \
+ { 11, 5}, { 23, 6}, { 21, 7}, { 11, 6}, \
+ { 25, 7}, { 13, 6}, { 27, 7}, { 21, 8}, \
+ { 11, 7}, { 24, 8}, { 13, 7}, { 27, 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}, { 39,10}, { 23, 9}, { 55,11}, \
+ { 15,10}, { 31, 9}, { 67,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, 9}, { 319,10}, \
+ { 167,11}, { 95,10}, { 191, 9}, { 383,11}, \
+ { 111,12}, { 63,11}, { 127,10}, { 255, 9}, \
+ { 511,10}, { 271, 9}, { 543,11}, { 143,10}, \
+ { 287, 9}, { 575,10}, { 303, 9}, { 607,11}, \
+ { 159,10}, { 319, 9}, { 639,12}, { 95,11}, \
+ { 191,10}, { 383,11}, { 207,10}, { 415,13}, \
+ { 63,12}, { 127,11}, { 255,10}, { 511,11}, \
+ { 271,10}, { 543, 9}, { 1087,11}, { 287,10}, \
+ { 607,12}, { 159,11}, { 319,10}, { 639,11}, \
+ { 335,10}, { 671,11}, { 351,10}, { 703,11}, \
+ { 367,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,10}, { 1087,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,12}, { 415,11}, \
+ { 831,10}, { 1663,12}, { 447,11}, { 895,12}, \
+ { 479,14}, { 127,12}, { 511,11}, { 1023,12}, \
+ { 543,11}, { 1087,12}, { 575,11}, { 1151,12}, \
+ { 607,11}, { 1215,13}, { 319,12}, { 671,11}, \
+ { 1343,12}, { 703,11}, { 1407,12}, { 735,13}, \
+ { 383,12}, { 767,11}, { 1535,12}, { 831,13}, \
+ { 447,12}, { 959,11}, { 1919,13}, { 511,12}, \
+ { 1087,13}, { 575,12}, { 1215,13}, { 639,12}, \
+ { 1343,13}, { 703,12}, { 1407,11}, { 2815,14}, \
+ { 383,13}, { 767,12}, { 1535,13}, { 831,12}, \
+ { 1727,13}, { 959,12}, { 1919,14}, { 511,13}, \
+ { 1023,12}, { 2047,13}, { 1087,12}, { 2175,13}, \
+ { 1215,12}, { 2431,14}, { 639,13}, { 1279,12}, \
+ { 2559,13}, { 1343,12}, { 2687,13}, { 1407,12}, \
+ { 2815,13}, { 1471,12}, { 2943,14}, { 767,13}, \
+ { 1535,12}, { 3071,13}, { 1727,14}, { 895,13}, \
+ { 1791,12}, { 3583,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}, { 1791,13}, \
+ { 3583,14}, { 1919,16}, { 511,15}, { 1023,14}, \
+ { 2175,13}, { 4351,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}, \
+ { 32768,16}, { 65536,17}, { 131072,18}, { 262144,19}, \
+ { 524288,20}, {1048576,21}, {2097152,22}, {4194304,23}, \
+ {8388608,24} }
+#define MUL_FFT_TABLE3_SIZE 237
+#define MUL_FFT_THRESHOLD 4224
+
+#define SQR_FFT_MODF_THRESHOLD 344 /* k = 5 */
+#define SQR_FFT_TABLE3 \
+ { { 344, 5}, { 17, 6}, { 9, 5}, { 19, 6}, \
+ { 10, 5}, { 21, 6}, { 21, 7}, { 11, 6}, \
+ { 25, 7}, { 13, 6}, { 27, 7}, { 21, 8}, \
+ { 11, 7}, { 25, 8}, { 13, 7}, { 28, 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}, \
+ { 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, 8}, { 511,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, 9}, \
+ { 543,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,10}, { 415,13}, { 63,12}, \
+ { 127,11}, { 255,10}, { 511,11}, { 271,10}, \
+ { 543, 9}, { 1087,10}, { 575,11}, { 303,10}, \
+ { 607,11}, { 319,10}, { 671,11}, { 351,10}, \
+ { 735,11}, { 383,10}, { 767,11}, { 415,10}, \
+ { 831,11}, { 447,10}, { 895,11}, { 479,13}, \
+ { 127,12}, { 255,11}, { 543,10}, { 1087,11}, \
+ { 607,10}, { 1215,11}, { 671,12}, { 351,11}, \
+ { 735,12}, { 383,11}, { 767,12}, { 415,11}, \
+ { 831,10}, { 1663,12}, { 447,11}, { 895,12}, \
+ { 479,14}, { 127,12}, { 511,11}, { 1023,12}, \
+ { 543,11}, { 1087,12}, { 607,11}, { 1215,13}, \
+ { 319,12}, { 639,11}, { 1279,12}, { 671,11}, \
+ { 1343,12}, { 735,13}, { 383,12}, { 767,11}, \
+ { 1535,12}, { 831,13}, { 447,12}, { 959,13}, \
+ { 511,12}, { 1087,13}, { 575,12}, { 1215,13}, \
+ { 639,12}, { 1343,13}, { 703,12}, { 1407,14}, \
+ { 383,13}, { 767,12}, { 1535,13}, { 831,12}, \
+ { 1663,13}, { 959,14}, { 511,13}, { 1087,12}, \
+ { 2175,13}, { 1215,12}, { 2431,14}, { 639,13}, \
+ { 1343,12}, { 2687,13}, { 1407,12}, { 2815,13}, \
+ { 1471,14}, { 767,13}, { 1599,12}, { 3199,13}, \
+ { 1663,14}, { 895,13}, { 1791,12}, { 3583,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,12}, { 6911,14}, \
+ { 1791,13}, { 3583,16}, { 511,15}, { 1023,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}, \
+ { 4223,15}, { 32768,16}, { 65536,17}, { 131072,18}, \
+ { 262144,19}, { 524288,20}, {1048576,21}, {2097152,22}, \
+ {4194304,23}, {8388608,24} }
+#define SQR_FFT_TABLE3_SIZE 206
+#define SQR_FFT_THRESHOLD 3712
+
+#define MULLO_BASECASE_THRESHOLD 0 /* always */
+#define MULLO_DC_THRESHOLD 78
+#define MULLO_MUL_N_THRESHOLD 8207
+
+#define DC_DIV_QR_THRESHOLD 63
+#define DC_DIVAPPR_Q_THRESHOLD 195
+#define DC_BDIV_QR_THRESHOLD 56
+#define DC_BDIV_Q_THRESHOLD 128
+
+#define INV_MULMOD_BNM1_THRESHOLD 42
+#define INV_NEWTON_THRESHOLD 199
+#define INV_APPR_THRESHOLD 181
+
+#define BINV_NEWTON_THRESHOLD 236
+#define REDC_1_TO_REDC_2_THRESHOLD 47
+#define REDC_2_TO_REDC_N_THRESHOLD 62
+
+#define MU_DIV_QR_THRESHOLD 1470
+#define MU_DIVAPPR_Q_THRESHOLD 1589
+#define MUPI_DIV_QR_THRESHOLD 78
+#define MU_BDIV_QR_THRESHOLD 1442
+#define MU_BDIV_Q_THRESHOLD 1470
+
+#define POWM_SEC_TABLE 3,22,194,257,1099
+
+#define MATRIX22_STRASSEN_THRESHOLD 17
+#define HGCD_THRESHOLD 112
+#define HGCD_APPR_THRESHOLD 52
+#define HGCD_REDUCE_THRESHOLD 2681
+#define GCD_DC_THRESHOLD 807
+#define GCDEXT_DC_THRESHOLD 416
+#define JACOBI_BASE_METHOD 4
+
+#define GET_STR_DC_THRESHOLD 12
+#define GET_STR_PRECOMPUTE_THRESHOLD 21
+#define SET_STR_DC_THRESHOLD 1326
+#define SET_STR_PRECOMPUTE_THRESHOLD 2627
+
+#define FAC_DSC_THRESHOLD 767
+#define FAC_ODD_THRESHOLD 0 /* always */
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/coreihwl/mul_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/coreihwl/mul_1.asm
new file mode 100644
index 00000000000..1e3c338f4ee
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/coreihwl/mul_1.asm
@@ -0,0 +1,155 @@
+dnl AMD64 mpn_mul_1 using mulx optimised for Intel Haswell.
+
+dnl Contributed to the GNU project by Torbjörn Granlund.
+
+dnl Copyright 2012, 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/limb best
+C AMD K8,K9 n/a
+C AMD K10 n/a
+C AMD bd1 n/a
+C AMD bd2 ?
+C AMD bobcat n/a
+C AMD jaguar ?
+C Intel P4 n/a
+C Intel PNR n/a
+C Intel NHM n/a
+C Intel SBR n/a
+C Intel IBR n/a
+C Intel HWL 1.57 this
+C Intel BWL ?
+C Intel atom n/a
+C VIA nano n/a
+
+C The loop of this code is the result of running a code generation and
+C optimisation tool suite written by David Harvey and Torbjorn Granlund.
+
+define(`rp', `%rdi') C rcx
+define(`up', `%rsi') C rdx
+define(`n_param', `%rdx') C r8
+define(`v0_param',`%rcx') C r9
+
+define(`n', `%rbp')
+define(`v0', `%rdx')
+
+ABI_SUPPORT(DOS64)
+ABI_SUPPORT(STD64)
+
+ASM_START()
+ TEXT
+ ALIGN(32)
+PROLOGUE(mpn_mul_1)
+ FUNC_ENTRY(4)
+ push %rbx
+ push %rbp
+ push %r12
+
+ mov n_param, n
+ shr $2, n
+
+ test $1, R8(n_param)
+ jnz L(bx1)
+
+L(bx0): test $2, R8(n_param)
+ mov v0_param, v0
+ jnz L(b10)
+
+L(b00): mulx( (up), %r9, %r8)
+ mulx( 8,(up), %r11, %r10)
+ mulx( 16,(up), %rcx, %r12)
+ lea -32(rp), rp
+ jmp L(lo0)
+
+L(b10): mulx( (up), %rcx, %r12)
+ mulx( 8,(up), %rbx, %rax)
+ lea -16(rp), rp
+ test n, n
+ jz L(cj2)
+ mulx( 16,(up), %r9, %r8)
+ lea 16(up), up
+ jmp L(lo2)
+
+L(bx1): test $2, R8(n_param)
+ mov v0_param, v0
+ jnz L(b11)
+
+L(b01): mulx( (up), %rbx, %rax)
+ lea -24(rp), rp
+ test n, n
+ jz L(cj1)
+ mulx( 8,(up), %r9, %r8)
+ lea 8(up), up
+ jmp L(lo1)
+
+L(b11): mulx( (up), %r11, %r10)
+ mulx( 8,(up), %rcx, %r12)
+ mulx( 16,(up), %rbx, %rax)
+ lea -8(rp), rp
+ test n, n
+ jz L(cj3)
+ lea 24(up), up
+ jmp L(lo3)
+
+ ALIGN(32)
+L(top): lea 32(rp), rp
+ mov %r9, (rp)
+ adc %r8, %r11
+L(lo3): mulx( (up), %r9, %r8)
+ mov %r11, 8(rp)
+ adc %r10, %rcx
+L(lo2): mov %rcx, 16(rp)
+ adc %r12, %rbx
+L(lo1): mulx( 8,(up), %r11, %r10)
+ adc %rax, %r9
+ mulx( 16,(up), %rcx, %r12)
+ mov %rbx, 24(rp)
+L(lo0): mulx( 24,(up), %rbx, %rax)
+ lea 32(up), up
+ dec n
+ jnz L(top)
+
+L(end): lea 32(rp), rp
+ mov %r9, (rp)
+ adc %r8, %r11
+L(cj3): mov %r11, 8(rp)
+ adc %r10, %rcx
+L(cj2): mov %rcx, 16(rp)
+ adc %r12, %rbx
+L(cj1): mov %rbx, 24(rp)
+ adc $0, %rax
+
+ pop %r12
+ pop %rbp
+ pop %rbx
+ FUNC_EXIT()
+ ret
+EPILOGUE()
+ASM_END()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/coreihwl/mul_2.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/coreihwl/mul_2.asm
new file mode 100644
index 00000000000..5bdb1aa645e
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/coreihwl/mul_2.asm
@@ -0,0 +1,173 @@
+dnl AMD64 mpn_mul_2 optimised for Intel Haswell.
+
+dnl Contributed to the GNU project by Torbjörn Granlund.
+
+dnl Copyright 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/limb
+C AMD K8,K9 n/a
+C AMD K10 n/a
+C AMD bull n/a
+C AMD pile n/a
+C AMD steam ?
+C AMD bobcat n/a
+C AMD jaguar ?
+C Intel P4 n/a
+C Intel core n/a
+C Intel NHM n/a
+C Intel SBR n/a
+C Intel IBR n/a
+C Intel HWL 1.86
+C Intel BWL ?
+C Intel atom n/a
+C VIA nano n/a
+
+C The loop of this code is the result of running a code generation and
+C optimisation tool suite written by David Harvey and Torbjörn Granlund.
+
+C TODO
+C * Move test and jcc together, for insn fusion.
+
+define(`rp', `%rdi')
+define(`up', `%rsi')
+define(`n_param',`%rdx')
+define(`vp', `%rcx')
+
+define(`v0', `%r8')
+define(`v1', `%r9')
+define(`w0', `%rbx')
+define(`w1', `%rcx')
+define(`w2', `%rbp')
+define(`w3', `%r10')
+define(`n', `%r11')
+
+ABI_SUPPORT(DOS64)
+ABI_SUPPORT(STD64)
+
+ASM_START()
+ TEXT
+ ALIGN(32)
+PROLOGUE(mpn_mul_2)
+ FUNC_ENTRY(4)
+ push %rbx
+ push %rbp
+
+ mov (vp), v0
+ mov 8(vp), v1
+
+ lea 3(n_param), n
+ shr $2, n
+
+ test $1, R8(n_param)
+ jnz L(bx1)
+
+L(bx0): xor w0, w0
+ test $2, R8(n_param)
+ mov (up), %rdx
+ mulx( v0, w2, w1)
+ jz L(lo0)
+
+L(b10): lea -16(rp), rp
+ lea -16(up), up
+ jmp L(lo2)
+
+L(bx1): xor w2, w2
+ test $2, R8(n_param)
+ mov (up), %rdx
+ mulx( v0, w0, w3)
+ jnz L(b11)
+
+L(b01): lea -24(rp), rp
+ lea 8(up), up
+ jmp L(lo1)
+
+L(b11): lea -8(rp), rp
+ lea -8(up), up
+ jmp L(lo3)
+
+ ALIGN(16)
+L(top): mulx( v1, %rax, w0)
+ add %rax, w2 C 0
+ mov (up), %rdx
+ mulx( v0, %rax, w1)
+ adc $0, w0 C 1
+ add %rax, w2 C 0
+ adc $0, w1 C 1
+ add w3, w2 C 0
+L(lo0): mov w2, (rp) C 0
+ adc $0, w1 C 1
+ mulx( v1, %rax, w2)
+ add %rax, w0 C 1
+ mov 8(up), %rdx
+ adc $0, w2 C 2
+ mulx( v0, %rax, w3)
+ add %rax, w0 C 1
+ adc $0, w3 C 2
+ add w1, w0 C 1
+L(lo3): mov w0, 8(rp) C 1
+ adc $0, w3 C 2
+ mulx( v1, %rax, w0)
+ add %rax, w2 C 2
+ mov 16(up), %rdx
+ mulx( v0, %rax, w1)
+ adc $0, w0 C 3
+ add %rax, w2 C 2
+ adc $0, w1 C 3
+ add w3, w2 C 2
+L(lo2): mov w2, 16(rp) C 2
+ adc $0, w1 C 3
+ mulx( v1, %rax, w2)
+ add %rax, w0 C 3
+ mov 24(up), %rdx
+ adc $0, w2 C 4
+ mulx( v0, %rax, w3)
+ add %rax, w0 C 3
+ adc $0, w3 C 4
+ add w1, w0 C 3
+ lea 32(up), up
+L(lo1): mov w0, 24(rp) C 3
+ adc $0, w3 C 4
+ dec n
+ lea 32(rp), rp
+ jnz L(top)
+
+L(end): mulx( v1, %rdx, %rax)
+ add %rdx, w2
+ adc $0, %rax
+ add w3, w2
+ mov w2, (rp)
+ adc $0, %rax
+
+ pop %rbp
+ pop %rbx
+ FUNC_EXIT()
+ ret
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/coreihwl/mul_basecase.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/coreihwl/mul_basecase.asm
new file mode 100644
index 00000000000..b2656c8e9bd
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/coreihwl/mul_basecase.asm
@@ -0,0 +1,441 @@
+dnl AMD64 mpn_mul_basecase optimised for Intel Haswell.
+
+dnl Contributed to the GNU project by Torbjörn Granlund.
+
+dnl Copyright 2003-2005, 2007, 2008, 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/limb mul_1 mul_2 mul_3 addmul_2
+C AMD K8,K9 n/a n/a - n/a
+C AMD K10 n/a n/a - n/a
+C AMD bull n/a n/a - n/a
+C AMD pile n/a n/a - n/a
+C AMD steam ? ? - ?
+C AMD bobcat n/a n/a - n/a
+C AMD jaguar ? ? - ?
+C Intel P4 n/a n/a - n/a
+C Intel core n/a n/a - n/a
+C Intel NHM n/a n/a - n/a
+C Intel SBR n/a n/a - n/a
+C Intel IBR n/a n/a - n/a
+C Intel HWL 1.77 1.86 - 2.15
+C Intel BWL ? ? - ?
+C Intel atom n/a n/a - n/a
+C VIA nano n/a n/a - n/a
+
+C The inner loops of this code are the result of running a code generation and
+C optimisation tool suite written by David Harvey and Torbjörn Granlund.
+
+C TODO
+C * Adjoin a mul_3.
+C * Further micro-optimise.
+
+define(`rp', `%rdi')
+define(`up', `%rsi')
+define(`un_param',`%rdx')
+define(`vp', `%rcx')
+define(`vn', `%r8')
+
+define(`un', `%rbx')
+
+define(`w0', `%r10')
+define(`w1', `%r11')
+define(`w2', `%r12')
+define(`w3', `%r13')
+define(`n', `%rbp')
+define(`v0', `%r9')
+
+ABI_SUPPORT(DOS64)
+ABI_SUPPORT(STD64)
+
+ASM_START()
+ TEXT
+ ALIGN(16)
+PROLOGUE(mpn_mul_basecase)
+ FUNC_ENTRY(4)
+IFDOS(` mov 56(%rsp), %r8d ')
+ push %rbx
+ push %rbp
+ push %r12
+ push %r13
+ push %r14
+ mov un_param, un C free up rdx
+ neg un
+
+ mov un_param, n C FIXME: share
+ sar $2, n C FIXME: share
+
+ test $1, R8(vn)
+ jz L(do_mul_2)
+
+define(`w4', `%r9')
+define(`w5', `%r14')
+
+ mov (vp), %rdx
+
+L(do_mul_1):
+ test $1, R8(un)
+ jnz L(m1x1)
+
+L(m1x0):test $2, R8(un)
+ jnz L(m110)
+
+L(m100):
+ mulx( (up), w5, w2)
+ mulx( 8,(up), w1, w3)
+ lea -24(rp), rp
+ jmp L(m1l0)
+
+L(m110):
+ mulx( (up), w3, w4)
+ mulx( 8,(up), w1, w5)
+ lea -8(rp), rp
+ test n, n
+ jz L(cj2)
+ mulx( 16,(up), w0, w2)
+ lea 16(up), up
+ jmp L(m1l2)
+
+L(m1x1):test $2, R8(un)
+ jz L(m111)
+
+L(m101):
+ mulx( (up), w4, w5)
+ lea -16(rp), rp
+ test n, n
+ jz L(cj1)
+ mulx( 8,(up), w0, w2)
+ lea 8(up), up
+ jmp L(m1l1)
+
+L(m111):
+ mulx( (up), w2, w3)
+ mulx( 8,(up), w0, w4)
+ mulx( 16,(up), w1, w5)
+ lea 24(up), up
+ test n, n
+ jnz L(gt3)
+ add w0, w3
+ jmp L(cj3)
+L(gt3): add w0, w3
+ jmp L(m1l3)
+
+ ALIGN(32)
+L(m1tp):lea 32(rp), rp
+L(m1l3):mov w2, (rp)
+ mulx( (up), w0, w2)
+L(m1l2):mov w3, 8(rp)
+ adc w1, w4
+L(m1l1):adc w0, w5
+ mov w4, 16(rp)
+ mulx( 8,(up), w1, w3)
+L(m1l0):mov w5, 24(rp)
+ mulx( 16,(up), w0, w4)
+ adc w1, w2
+ mulx( 24,(up), w1, w5)
+ adc w0, w3
+ lea 32(up), up
+ dec n
+ jnz L(m1tp)
+
+L(m1ed):lea 32(rp), rp
+L(cj3): mov w2, (rp)
+L(cj2): mov w3, 8(rp)
+ adc w1, w4
+L(cj1): mov w4, 16(rp)
+ adc $0, w5
+ mov w5, 24(rp)
+
+ dec R32(vn)
+ jz L(ret5)
+
+ lea 8(vp), vp
+ lea 32(rp), rp
+C push %r12
+C push %r13
+C push %r14
+ jmp L(do_addmul)
+
+L(do_mul_2):
+define(`v1', `%r14')
+C push %r12
+C push %r13
+C push %r14
+
+ mov (vp), v0
+ mov 8(vp), v1
+
+ lea (un), n
+ sar $2, n
+
+ test $1, R8(un)
+ jnz L(m2x1)
+
+L(m2x0):xor w0, w0
+ test $2, R8(un)
+ mov (up), %rdx
+ mulx( v0, w2, w1)
+ jz L(m2l0)
+
+L(m210):lea -16(rp), rp
+ lea -16(up), up
+ jmp L(m2l2)
+
+L(m2x1):xor w2, w2
+ test $2, R8(un)
+ mov (up), %rdx
+ mulx( v0, w0, w3)
+ jz L(m211)
+
+L(m201):lea -24(rp), rp
+ lea 8(up), up
+ jmp L(m2l1)
+
+L(m211):lea -8(rp), rp
+ lea -8(up), up
+ jmp L(m2l3)
+
+ ALIGN(16)
+L(m2tp):mulx( v1, %rax, w0)
+ add %rax, w2
+ mov (up), %rdx
+ mulx( v0, %rax, w1)
+ adc $0, w0
+ add %rax, w2
+ adc $0, w1
+ add w3, w2
+L(m2l0):mov w2, (rp)
+ adc $0, w1
+ mulx( v1, %rax, w2)
+ add %rax, w0
+ mov 8(up), %rdx
+ adc $0, w2
+ mulx( v0, %rax, w3)
+ add %rax, w0
+ adc $0, w3
+ add w1, w0
+L(m2l3):mov w0, 8(rp)
+ adc $0, w3
+ mulx( v1, %rax, w0)
+ add %rax, w2
+ mov 16(up), %rdx
+ mulx( v0, %rax, w1)
+ adc $0, w0
+ add %rax, w2
+ adc $0, w1
+ add w3, w2
+L(m2l2):mov w2, 16(rp)
+ adc $0, w1
+ mulx( v1, %rax, w2)
+ add %rax, w0
+ mov 24(up), %rdx
+ adc $0, w2
+ mulx( v0, %rax, w3)
+ add %rax, w0
+ adc $0, w3
+ add w1, w0
+ lea 32(up), up
+L(m2l1):mov w0, 24(rp)
+ adc $0, w3
+ inc n
+ lea 32(rp), rp
+ jnz L(m2tp)
+
+L(m2ed):mulx( v1, %rdx, %rax)
+ add %rdx, w2
+ adc $0, %rax
+ add w3, w2
+ mov w2, (rp)
+ adc $0, %rax
+ mov %rax, 8(rp)
+
+ add $-2, R32(vn)
+ jz L(ret5)
+ lea 16(vp), vp
+ lea 16(rp), rp
+
+
+L(do_addmul):
+ push %r15
+ push vn C save vn in new stack slot
+define(`vn', `(%rsp)')
+define(`X0', `%r14')
+define(`X1', `%r15')
+define(`v1', `%r8')
+
+ lea (rp,un,8), rp
+ lea (up,un,8), up
+
+L(outer):
+ mov (vp), v0
+ mov 8(vp), v1
+
+ lea 2(un), n
+ sar $2, n
+
+ mov (up), %rdx
+ test $1, R8(un)
+ jnz L(bx1)
+
+L(bx0): mov (rp), X0
+ mov 8(rp), X1
+ mulx( v0, %rax, w1)
+ add %rax, X0
+ mulx( v1, %rax, w2)
+ adc $0, w1
+ mov X0, (rp)
+ add %rax, X1
+ adc $0, w2
+ mov 8(up), %rdx
+ test $2, R8(un)
+ jnz L(b10)
+
+L(b00): lea 16(up), up
+ lea 16(rp), rp
+ jmp L(lo0)
+
+L(b10): mov 16(rp), X0
+ lea 32(up), up
+ mulx( v0, %rax, w3)
+ jmp L(lo2)
+
+L(bx1): mov (rp), X1
+ mov 8(rp), X0
+ mulx( v0, %rax, w3)
+ add %rax, X1
+ adc $0, w3
+ mulx( v1, %rax, w0)
+ add %rax, X0
+ adc $0, w0
+ mov 8(up), %rdx
+ mov X1, (rp)
+ mulx( v0, %rax, w1)
+ test $2, R8(un)
+ jz L(b11)
+
+L(b01): mov 16(rp), X1
+ lea 24(rp), rp
+ lea 24(up), up
+ jmp L(lo1)
+
+L(b11): lea 8(rp), rp
+ lea 8(up), up
+ jmp L(lo3)
+
+ ALIGN(16)
+L(top): mulx( v0, %rax, w3)
+ add w0, X1
+ adc $0, w2
+L(lo2): add %rax, X1
+ adc $0, w3
+ mulx( v1, %rax, w0)
+ add %rax, X0
+ adc $0, w0
+ lea 32(rp), rp
+ add w1, X1
+ mov -16(up), %rdx
+ mov X1, -24(rp)
+ adc $0, w3
+ add w2, X0
+ mov -8(rp), X1
+ mulx( v0, %rax, w1)
+ adc $0, w0
+L(lo1): add %rax, X0
+ mulx( v1, %rax, w2)
+ adc $0, w1
+ add w3, X0
+ mov X0, -16(rp)
+ adc $0, w1
+ add %rax, X1
+ adc $0, w2
+ add w0, X1
+ mov -8(up), %rdx
+ adc $0, w2
+L(lo0): mulx( v0, %rax, w3)
+ add %rax, X1
+ adc $0, w3
+ mov (rp), X0
+ mulx( v1, %rax, w0)
+ add %rax, X0
+ adc $0, w0
+ add w1, X1
+ mov X1, -8(rp)
+ adc $0, w3
+ mov (up), %rdx
+ add w2, X0
+ mulx( v0, %rax, w1)
+ adc $0, w0
+L(lo3): add %rax, X0
+ adc $0, w1
+ mulx( v1, %rax, w2)
+ add w3, X0
+ mov 8(rp), X1
+ mov X0, (rp)
+ mov 16(rp), X0
+ adc $0, w1
+ add %rax, X1
+ adc $0, w2
+ mov 8(up), %rdx
+ lea 32(up), up
+ inc n
+ jnz L(top)
+
+L(end): mulx( v0, %rax, w3)
+ add w0, X1
+ adc $0, w2
+ add %rax, X1
+ adc $0, w3
+ mulx( v1, %rdx, %rax)
+ add w1, X1
+ mov X1, 8(rp)
+ adc $0, w3
+ add w2, %rdx
+ adc $0, %rax
+ add w3, %rdx
+ mov %rdx, 16(rp)
+ adc $0, %rax
+ mov %rax, 24(rp)
+
+ addl $-2, vn
+ lea 16(vp), vp
+ lea -16(up,un,8), up
+ lea 32(rp,un,8), rp
+ jnz L(outer)
+
+ pop %rax C deallocate vn slot
+ pop %r15
+L(ret5):pop %r14
+L(ret4):pop %r13
+L(ret3):pop %r12
+L(ret2):pop %rbp
+ pop %rbx
+ FUNC_EXIT()
+ ret
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/coreihwl/mullo_basecase.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/coreihwl/mullo_basecase.asm
new file mode 100644
index 00000000000..9986e8bcfa4
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/coreihwl/mullo_basecase.asm
@@ -0,0 +1,426 @@
+dnl AMD64 mpn_mullo_basecase optimised for Intel Haswell.
+
+dnl Contributed to the GNU project by Torbjörn Granlund.
+
+dnl Copyright 2008, 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/limb mul_2 addmul_2
+C AMD K8,K9 n/a n/a
+C AMD K10 n/a n/a
+C AMD bull n/a n/a
+C AMD pile n/a n/a
+C AMD steam ? ?
+C AMD bobcat n/a n/a
+C AMD jaguar ? ?
+C Intel P4 n/a n/a
+C Intel core n/a n/a
+C Intel NHM n/a n/a
+C Intel SBR n/a n/a
+C Intel IBR n/a n/a
+C Intel HWL 1.86 2.15
+C Intel BWL ? ?
+C Intel atom n/a n/a
+C VIA nano n/a n/a
+
+C The inner loops of this code are the result of running a code generation and
+C optimisation tool suite written by David Harvey and Torbjörn Granlund.
+
+C TODO
+C * Implement proper cor2, replacing current cor0.
+C * Micro-optimise.
+
+C When playing with pointers, set this to $2 to fall back to conservative
+C indexing in wind-down code.
+define(`I',`$1')
+
+define(`rp', `%rdi')
+define(`up', `%rsi')
+define(`vp_param', `%rdx')
+define(`n', `%rcx')
+
+define(`vp', `%r8')
+define(`X0', `%r14')
+define(`X1', `%r15')
+
+define(`w0', `%r10')
+define(`w1', `%r11')
+define(`w2', `%r12')
+define(`w3', `%r13')
+define(`i', `%rbp')
+define(`v0', `%r9')
+define(`v1', `%rbx')
+
+C rax rbx rcx rdx rdi rsi rbp r8 r9 r10 r11 r12 r13 r14 r15
+
+ABI_SUPPORT(DOS64)
+ABI_SUPPORT(STD64)
+
+ASM_START()
+ TEXT
+ ALIGN(32)
+PROLOGUE(mpn_mullo_basecase)
+ FUNC_ENTRY(4)
+
+ mov vp_param, vp
+ mov (up), %rdx
+
+ cmp $4, n
+ jb L(small)
+
+ push %rbx
+ push %rbp
+ push %r12
+ push %r13
+
+ mov (vp), v0
+ mov 8(vp), v1
+
+ lea 2(n), i
+ shr $2, i
+ neg n
+ add $2, n
+
+ push up C put entry `up' on stack
+
+ test $1, R8(n)
+ jnz L(m2x1)
+
+L(m2x0):mulx( v0, w0, w3)
+ xor R32(w2), R32(w2)
+ test $2, R8(n)
+ jz L(m2b2)
+
+L(m2b0):lea -8(rp), rp
+ lea -8(up), up
+ jmp L(m2e0)
+
+L(m2b2):lea -24(rp), rp
+ lea 8(up), up
+ jmp L(m2e2)
+
+L(m2x1):mulx( v0, w2, w1)
+ xor R32(w0), R32(w0)
+ test $2, R8(n)
+ jnz L(m2b3)
+
+L(m2b1):jmp L(m2e1)
+
+L(m2b3):lea -16(rp), rp
+ lea -16(up), up
+ jmp L(m2e3)
+
+ ALIGN(16)
+L(m2tp):mulx( v1, %rax, w0)
+ add %rax, w2
+ mov (up), %rdx
+ mulx( v0, %rax, w1)
+ adc $0, w0
+ add %rax, w2
+ adc $0, w1
+ add w3, w2
+L(m2e1):mov w2, (rp)
+ adc $0, w1
+ mulx( v1, %rax, w2)
+ add %rax, w0
+ mov 8(up), %rdx
+ adc $0, w2
+ mulx( v0, %rax, w3)
+ add %rax, w0
+ adc $0, w3
+ add w1, w0
+L(m2e0):mov w0, 8(rp)
+ adc $0, w3
+ mulx( v1, %rax, w0)
+ add %rax, w2
+ mov 16(up), %rdx
+ mulx( v0, %rax, w1)
+ adc $0, w0
+ add %rax, w2
+ adc $0, w1
+ add w3, w2
+L(m2e3):mov w2, 16(rp)
+ adc $0, w1
+ mulx( v1, %rax, w2)
+ add %rax, w0
+ mov 24(up), %rdx
+ adc $0, w2
+ mulx( v0, %rax, w3)
+ add %rax, w0
+ adc $0, w3
+ add w1, w0
+ lea 32(up), up
+L(m2e2):mov w0, 24(rp)
+ adc $0, w3
+ dec i
+ lea 32(rp), rp
+ jnz L(m2tp)
+
+L(m2ed):mulx( v1, %rax, w0)
+ add %rax, w2
+ mov (up), %rdx
+ mulx( v0, %rax, w1)
+ add w2, %rax
+ add w3, %rax
+ mov %rax, (rp)
+
+ mov (%rsp), up C restore `up' to beginning
+ lea 16(vp), vp
+ lea 8(rp,n,8), rp C put back rp to old rp + 2
+ add $2, n
+ jge L(cor1)
+
+ push %r14
+ push %r15
+
+L(outer):
+ mov (vp), v0
+ mov 8(vp), v1
+
+ lea (n), i
+ sar $2, i
+
+ mov (up), %rdx
+ test $1, R8(n)
+ jnz L(bx1)
+
+L(bx0): mov (rp), X1
+ mov 8(rp), X0
+ mulx( v0, %rax, w3)
+ add %rax, X1
+ adc $0, w3
+ mulx( v1, %rax, w0)
+ add %rax, X0
+ adc $0, w0
+ mov 8(up), %rdx
+ mov X1, (rp)
+ mulx( v0, %rax, w1)
+ test $2, R8(n)
+ jz L(b2)
+
+L(b0): lea 8(rp), rp
+ lea 8(up), up
+ jmp L(lo0)
+
+L(b2): mov 16(rp), X1
+ lea 24(rp), rp
+ lea 24(up), up
+ jmp L(lo2)
+
+L(bx1): mov (rp), X0
+ mov 8(rp), X1
+ mulx( v0, %rax, w1)
+ add %rax, X0
+ mulx( v1, %rax, w2)
+ adc $0, w1
+ mov X0, (rp)
+ add %rax, X1
+ adc $0, w2
+ mov 8(up), %rdx
+ test $2, R8(n)
+ jnz L(b3)
+
+L(b1): lea 16(up), up
+ lea 16(rp), rp
+ jmp L(lo1)
+
+L(b3): mov 16(rp), X0
+ lea 32(up), up
+ mulx( v0, %rax, w3)
+ inc i
+ jz L(cj3)
+ jmp L(lo3)
+
+ ALIGN(16)
+L(top): mulx( v0, %rax, w3)
+ add w0, X1
+ adc $0, w2
+L(lo3): add %rax, X1
+ adc $0, w3
+ mulx( v1, %rax, w0)
+ add %rax, X0
+ adc $0, w0
+ lea 32(rp), rp
+ add w1, X1
+ mov -16(up), %rdx
+ mov X1, -24(rp)
+ adc $0, w3
+ add w2, X0
+ mov -8(rp), X1
+ mulx( v0, %rax, w1)
+ adc $0, w0
+L(lo2): add %rax, X0
+ mulx( v1, %rax, w2)
+ adc $0, w1
+ add w3, X0
+ mov X0, -16(rp)
+ adc $0, w1
+ add %rax, X1
+ adc $0, w2
+ add w0, X1
+ mov -8(up), %rdx
+ adc $0, w2
+L(lo1): mulx( v0, %rax, w3)
+ add %rax, X1
+ adc $0, w3
+ mov (rp), X0
+ mulx( v1, %rax, w0)
+ add %rax, X0
+ adc $0, w0
+ add w1, X1
+ mov X1, -8(rp)
+ adc $0, w3
+ mov (up), %rdx
+ add w2, X0
+ mulx( v0, %rax, w1)
+ adc $0, w0
+L(lo0): add %rax, X0
+ adc $0, w1
+ mulx( v1, %rax, w2)
+ add w3, X0
+ mov 8(rp), X1
+ mov X0, (rp)
+ mov 16(rp), X0
+ adc $0, w1
+ add %rax, X1
+ adc $0, w2
+ mov 8(up), %rdx
+ lea 32(up), up
+ inc i
+ jnz L(top)
+
+L(end): mulx( v0, %rax, w3)
+ add w0, X1
+ adc $0, w2
+L(cj3): add %rax, X1
+ adc $0, w3
+ mulx( v1, %rax, w0)
+ add %rax, X0
+ add w1, X1
+ mov -16(up), %rdx
+ mov X1, 8(rp)
+ adc $0, w3
+ add w2, X0
+ mulx( v0, %rax, w1)
+ add X0, %rax
+ add w3, %rax
+ mov %rax, 16(rp)
+
+ mov 16(%rsp), up C restore `up' to beginning
+ lea 16(vp), vp
+ lea 24(rp,n,8), rp C put back rp to old rp + 2
+ add $2, n
+ jl L(outer)
+
+ pop %r15
+ pop %r14
+
+ jnz L(cor0)
+
+L(cor1):mov (vp), v0
+ mov 8(vp), v1
+ mov (up), %rdx
+ mulx( v0, %r12, %rbp) C u0 x v2
+ add (rp), %r12 C FIXME: rp[0] still available in reg?
+ adc %rax, %rbp
+ mov 8(up), %r10
+ imul v0, %r10
+ imul v1, %rdx
+ mov %r12, (rp)
+ add %r10, %rdx
+ add %rbp, %rdx
+ mov %rdx, 8(rp)
+ pop %rax C deallocate `up' copy
+ pop %r13
+ pop %r12
+ pop %rbp
+ pop %rbx
+ FUNC_EXIT()
+ ret
+
+L(cor0):mov (vp), %r11
+ imul (up), %r11
+ add %rax, %r11
+ mov %r11, (rp)
+ pop %rax C deallocate `up' copy
+ pop %r13
+ pop %r12
+ pop %rbp
+ pop %rbx
+ FUNC_EXIT()
+ ret
+
+ ALIGN(16)
+L(small):
+ cmp $2, n
+ jae L(gt1)
+L(n1): imul (vp), %rdx
+ mov %rdx, (rp)
+ FUNC_EXIT()
+ ret
+L(gt1): ja L(gt2)
+L(n2): mov (vp), %r9
+ mulx( %r9, %rax, %rdx)
+ mov %rax, (rp)
+ mov 8(up), %rax
+ imul %r9, %rax
+ add %rax, %rdx
+ mov 8(vp), %r9
+ mov (up), %rcx
+ imul %r9, %rcx
+ add %rcx, %rdx
+ mov %rdx, 8(rp)
+ FUNC_EXIT()
+ ret
+L(gt2):
+L(n3): mov (vp), %r9
+ mulx( %r9, %rax, %r10) C u0 x v0
+ mov %rax, (rp)
+ mov 8(up), %rdx
+ mulx( %r9, %rax, %rdx) C u1 x v0
+ imul 16(up), %r9 C u2 x v0
+ add %rax, %r10
+ adc %rdx, %r9
+ mov 8(vp), %r11
+ mov (up), %rdx
+ mulx( %r11, %rax, %rdx) C u0 x v1
+ add %rax, %r10
+ adc %rdx, %r9
+ imul 8(up), %r11 C u1 x v1
+ add %r11, %r9
+ mov %r10, 8(rp)
+ mov 16(vp), %r10
+ mov (up), %rax
+ imul %rax, %r10 C u0 x v2
+ add %r10, %r9
+ mov %r9, 16(rp)
+ FUNC_EXIT()
+ ret
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/coreihwl/redc_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/coreihwl/redc_1.asm
new file mode 100644
index 00000000000..f1a475e53cd
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/coreihwl/redc_1.asm
@@ -0,0 +1,433 @@
+dnl AMD64 mpn_redc_1 optimised for Intel Haswell.
+
+dnl Contributed to the GNU project by Torbjörn Granlund.
+
+dnl Copyright 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/limb
+C AMD K8,K9 n/a
+C AMD K10 n/a
+C AMD bull n/a
+C AMD pile n/a
+C AMD steam ?
+C AMD bobcat n/a
+C AMD jaguar ?
+C Intel P4 n/a
+C Intel core n/a
+C Intel NHM n/a
+C Intel SBR n/a
+C Intel IBR n/a
+C Intel HWL 2.32
+C Intel BWL ?
+C Intel atom n/a
+C VIA nano n/a
+
+C The inner loops of this code are the result of running a code generation and
+C optimisation tool suite written by David Harvey and Torbjörn Granlund.
+
+C TODO
+C * Micro-optimise.
+C * Consider inlining mpn_add_n. Tests indicate that this saves just 1-2
+C cycles, though.
+
+define(`rp', `%rdi') C rcx
+define(`up', `%rsi') C rdx
+define(`mp_param', `%rdx') C r8
+define(`n', `%rcx') C r9
+define(`u0inv_param', `%r8') C stack
+
+define(`i', `%r14')
+define(`j', `%r15')
+define(`mp', `%rdi')
+define(`u0inv', `(%rsp)') C stack
+
+ABI_SUPPORT(DOS64) C FIXME: needs verification
+ABI_SUPPORT(STD64)
+
+ASM_START()
+ TEXT
+ ALIGN(16)
+PROLOGUE(mpn_redc_1)
+ FUNC_ENTRY(4)
+IFDOS(` mov 56(%rsp), %r8 ')
+ push %rbx
+ push %rbp
+ push %r12
+ push %r13
+ push %r14
+ push %r15
+ push rp
+ mov mp_param, mp C note that rp and mp shares register
+ mov (up), %rdx
+
+ neg n
+ push %r8 C put u0inv on stack
+ imul u0inv_param, %rdx C first iteration q0
+ mov n, j C outer loop induction var
+
+ test $1, R8(n)
+ jnz L(bx1)
+
+L(bx0): test $2, R8(n)
+ jz L(o0b)
+
+ cmp $-2, R32(n)
+ jnz L(o2)
+
+C Special code for n = 2 since general code cannot handle it
+ mov 8(%rsp), %rbx C rp
+ lea 16(%rsp), %rsp C deallocate two slots
+ mulx( (mp), %r9, %r12)
+ mulx( 8,(mp), %r11, %r10)
+ add %r12, %r11
+ adc $0, %r10
+ add (up), %r9 C = 0
+ adc 8(up), %r11 C r11 = up[1]
+ adc $0, %r10 C -> up[0]
+ mov %r11, %rdx
+ imul u0inv_param, %rdx
+ mulx( (mp), %r13, %r12)
+ mulx( 8,(mp), %r14, %r15)
+ xor R32(%rax), R32(%rax)
+ add %r12, %r14
+ adc $0, %r15
+ add %r11, %r13 C = 0
+ adc 16(up), %r14 C rp[2]
+ adc $0, %r15 C -> up[1]
+ add %r14, %r10
+ adc 24(up), %r15
+ mov %r10, (%rbx)
+ mov %r15, 8(%rbx)
+ setc R8(%rax)
+ jmp L(ret)
+
+L(o2): lea 2(n), i C inner loop induction var
+ mulx( (mp), %r9, %r8)
+ mulx( 8,(mp), %r11, %r10)
+ sar $2, i
+ add %r8, %r11
+ jmp L(lo2)
+
+ ALIGN(16)
+L(tp2): adc %rax, %r9
+ lea 32(up), up
+ adc %r8, %r11
+L(lo2): mulx( 16,(mp), %r13, %r12)
+ mov (up), %r8
+ mulx( 24,(mp), %rbx, %rax)
+ lea 32(mp), mp
+ adc %r10, %r13
+ adc %r12, %rbx
+ adc $0, %rax
+ mov 8(up), %r10
+ mov 16(up), %r12
+ add %r9, %r8
+ mov 24(up), %rbp
+ mov %r8, (up)
+ adc %r11, %r10
+ mulx( (mp), %r9, %r8)
+ mov %r10, 8(up)
+ adc %r13, %r12
+ mov %r12, 16(up)
+ adc %rbx, %rbp
+ mulx( 8,(mp), %r11, %r10)
+ mov %rbp, 24(up)
+ inc i
+ jnz L(tp2)
+
+L(ed2): mov 56(up,n,8), %rdx C next iteration up[0]
+ lea 16(mp,n,8), mp C mp = (last starting mp)
+ adc %rax, %r9
+ adc %r8, %r11
+ mov 32(up), %r8
+ adc $0, %r10
+ imul u0inv, %rdx C next iteration q0
+ mov 40(up), %rax
+ add %r9, %r8
+ mov %r8, 32(up)
+ adc %r11, %rax
+ mov %rax, 40(up)
+ lea 56(up,n,8), up C up = (last starting up) + 1
+ adc $0, %r10
+ mov %r10, -8(up)
+ inc j
+ jnz L(o2)
+
+ jmp L(cj)
+
+
+L(bx1): test $2, R8(n)
+ jz L(o3a)
+
+L(o1a): cmp $-1, R32(n)
+ jnz L(o1b)
+
+C Special code for n = 1 since general code cannot handle it
+ mov 8(%rsp), %rbx C rp
+ lea 16(%rsp), %rsp C deallocate two slots
+ mulx( (mp), %r11, %r10)
+ add (up), %r11
+ adc 8(up), %r10
+ mov %r10, (%rbx)
+ mov $0, R32(%rax)
+ setc R8(%rax)
+ jmp L(ret)
+
+L(o1b): lea 24(mp), mp
+L(o1): lea 1(n), i C inner loop induction var
+ mulx( -24,(mp), %r11, %r10)
+ mulx( -16,(mp), %r13, %r12)
+ mulx( -8,(mp), %rbx, %rax)
+ sar $2, i
+ add %r10, %r13
+ adc %r12, %rbx
+ adc $0, %rax
+ mov (up), %r10
+ mov 8(up), %r12
+ mov 16(up), %rbp
+ add %r11, %r10
+ jmp L(lo1)
+
+ ALIGN(16)
+L(tp1): adc %rax, %r9
+ lea 32(up), up
+ adc %r8, %r11
+ mulx( 16,(mp), %r13, %r12)
+ mov -8(up), %r8
+ mulx( 24,(mp), %rbx, %rax)
+ lea 32(mp), mp
+ adc %r10, %r13
+ adc %r12, %rbx
+ adc $0, %rax
+ mov (up), %r10
+ mov 8(up), %r12
+ add %r9, %r8
+ mov 16(up), %rbp
+ mov %r8, -8(up)
+ adc %r11, %r10
+L(lo1): mulx( (mp), %r9, %r8)
+ mov %r10, (up)
+ adc %r13, %r12
+ mov %r12, 8(up)
+ adc %rbx, %rbp
+ mulx( 8,(mp), %r11, %r10)
+ mov %rbp, 16(up)
+ inc i
+ jnz L(tp1)
+
+L(ed1): mov 48(up,n,8), %rdx C next iteration up[0]
+ lea 40(mp,n,8), mp C mp = (last starting mp)
+ adc %rax, %r9
+ adc %r8, %r11
+ mov 24(up), %r8
+ adc $0, %r10
+ imul u0inv, %rdx C next iteration q0
+ mov 32(up), %rax
+ add %r9, %r8
+ mov %r8, 24(up)
+ adc %r11, %rax
+ mov %rax, 32(up)
+ lea 48(up,n,8), up C up = (last starting up) + 1
+ adc $0, %r10
+ mov %r10, -8(up)
+ inc j
+ jnz L(o1)
+
+ jmp L(cj)
+
+L(o3a): cmp $-3, R32(n)
+ jnz L(o3b)
+
+C Special code for n = 3 since general code cannot handle it
+L(n3): mulx( (mp), %rbx, %rax)
+ mulx( 8,(mp), %r9, %r14)
+ add (up), %rbx
+ mulx( 16,(mp), %r11, %r10)
+ adc %rax, %r9 C W 1
+ adc %r14, %r11 C W 2
+ mov 8(up), %r14
+ mov u0inv_param, %rdx
+ adc $0, %r10 C W 3
+ mov 16(up), %rax
+ add %r9, %r14 C W 1
+ mov %r14, 8(up)
+ mulx( %r14, %rdx, %r13) C next iteration q0
+ adc %r11, %rax C W 2
+ mov %rax, 16(up)
+ adc $0, %r10 C W 3
+ mov %r10, (up)
+ lea 8(up), up C up = (last starting up) + 1
+ inc j
+ jnz L(n3)
+
+ jmp L(cj)
+
+L(o3b): lea 8(mp), mp
+L(o3): lea 4(n), i C inner loop induction var
+ mulx( -8,(mp), %rbx, %rax)
+ mulx( (mp), %r9, %r8)
+ mov (up), %rbp
+ mulx( 8,(mp), %r11, %r10)
+ sar $2, i
+ add %rbx, %rbp
+ nop
+ adc %rax, %r9
+ jmp L(lo3)
+
+ ALIGN(16)
+L(tp3): adc %rax, %r9
+ lea 32(up), up
+L(lo3): adc %r8, %r11
+ mulx( 16,(mp), %r13, %r12)
+ mov 8(up), %r8
+ mulx( 24,(mp), %rbx, %rax)
+ lea 32(mp), mp
+ adc %r10, %r13
+ adc %r12, %rbx
+ adc $0, %rax
+ mov 16(up), %r10
+ mov 24(up), %r12
+ add %r9, %r8
+ mov 32(up), %rbp
+ mov %r8, 8(up)
+ adc %r11, %r10
+ mulx( (mp), %r9, %r8)
+ mov %r10, 16(up)
+ adc %r13, %r12
+ mov %r12, 24(up)
+ adc %rbx, %rbp
+ mulx( 8,(mp), %r11, %r10)
+ mov %rbp, 32(up)
+ inc i
+ jnz L(tp3)
+
+L(ed3): mov 64(up,n,8), %rdx C next iteration up[0]
+ lea 24(mp,n,8), mp C mp = (last starting mp)
+ adc %rax, %r9
+ adc %r8, %r11
+ mov 40(up), %r8
+ adc $0, %r10
+ imul u0inv, %rdx C next iteration q0
+ mov 48(up), %rax
+ add %r9, %r8
+ mov %r8, 40(up)
+ adc %r11, %rax
+ mov %rax, 48(up)
+ lea 64(up,n,8), up C up = (last starting up) + 1
+ adc $0, %r10
+ mov %r10, -8(up)
+ inc j
+ jnz L(o3)
+
+ jmp L(cj)
+
+L(o0b): lea 16(mp), mp
+L(o0): mov n, i C inner loop induction var
+ mulx( -16,(mp), %r13, %r12)
+ mulx( -8,(mp), %rbx, %rax)
+ sar $2, i
+ add %r12, %rbx
+ adc $0, %rax
+ mov (up), %r12
+ mov 8(up), %rbp
+ mulx( (mp), %r9, %r8)
+ add %r13, %r12
+ jmp L(lo0)
+
+ ALIGN(16)
+L(tp0): adc %rax, %r9
+ lea 32(up), up
+ adc %r8, %r11
+ mulx( 16,(mp), %r13, %r12)
+ mov -16(up), %r8
+ mulx( 24,(mp), %rbx, %rax)
+ lea 32(mp), mp
+ adc %r10, %r13
+ adc %r12, %rbx
+ adc $0, %rax
+ mov -8(up), %r10
+ mov (up), %r12
+ add %r9, %r8
+ mov 8(up), %rbp
+ mov %r8, -16(up)
+ adc %r11, %r10
+ mulx( (mp), %r9, %r8)
+ mov %r10, -8(up)
+ adc %r13, %r12
+ mov %r12, (up)
+L(lo0): adc %rbx, %rbp
+ mulx( 8,(mp), %r11, %r10)
+ mov %rbp, 8(up)
+ inc i
+ jnz L(tp0)
+
+L(ed0): mov 40(up,n,8), %rdx C next iteration up[0]
+ lea 32(mp,n,8), mp C mp = (last starting mp)
+ adc %rax, %r9
+ adc %r8, %r11
+ mov 16(up), %r8
+ adc $0, %r10
+ imul u0inv, %rdx C next iteration q0
+ mov 24(up), %rax
+ add %r9, %r8
+ mov %r8, 16(up)
+ adc %r11, %rax
+ mov %rax, 24(up)
+ lea 40(up,n,8), up C up = (last starting up) + 1
+ adc $0, %r10
+ mov %r10, -8(up)
+ inc j
+ jnz L(o0)
+
+L(cj):
+IFSTD(` mov 8(%rsp), %rdi C param 1: rp
+ lea 16(%rsp), %rsp C deallocate two slots
+ lea (up,n,8), %rdx C param 3: up - n
+ neg R32(n) ') C param 4: n
+
+IFDOS(` mov up, %rdx C param 2: up
+ lea (up,n,8), %r8 C param 3: up - n
+ neg R32(n)
+ mov n, %r9 C param 4: n
+ mov 8(%rsp), %rcx C param 1: rp
+ lea 16(%rsp), %rsp ') C deallocate two slots
+
+ CALL( mpn_add_n)
+
+L(ret): pop %r15
+ pop %r14
+ pop %r13
+ pop %r12
+ pop %rbp
+ pop %rbx
+ FUNC_EXIT()
+ ret
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/coreihwl/sqr_basecase.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/coreihwl/sqr_basecase.asm
new file mode 100644
index 00000000000..641cdf349aa
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/coreihwl/sqr_basecase.asm
@@ -0,0 +1,506 @@
+dnl AMD64 mpn_sqr_basecase optimised for Intel Haswell.
+
+dnl Contributed to the GNU project by Torbjörn Granlund.
+
+dnl Copyright 2008, 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/limb mul_2 addmul_2 sqr_diag_addlsh1
+C AMD K8,K9 n/a n/a n/a
+C AMD K10 n/a n/a n/a
+C AMD bull n/a n/a n/a
+C AMD pile n/a n/a n/a
+C AMD steam ? ? ?
+C AMD bobcat n/a n/a n/a
+C AMD jaguar ? ? ?
+C Intel P4 n/a n/a n/a
+C Intel core n/a n/a n/a
+C Intel NHM n/a n/a n/a
+C Intel SBR n/a n/a n/a
+C Intel IBR n/a n/a n/a
+C Intel HWL 1.86 2.15 ~2.5
+C Intel BWL ? ? ?
+C Intel atom n/a n/a n/a
+C VIA nano n/a n/a n/a
+
+C The inner loops of this code are the result of running a code generation and
+C optimisation tool suite written by David Harvey and Torbjörn Granlund, except
+C that the sqr_diag_addlsh1 loop was manually written.
+
+C TODO
+C * Replace current unoptimised sqr_diag_addlsh1 loop; 1.75 c/l might be
+C possible.
+C * Consider splitting outer loop into 2, one for n = 1 (mod 2) and one for
+C n = 0 (mod 2). These loops could fall into specific "corner" code.
+C * Consider splitting outer loop into 4.
+C * Streamline pointer updates.
+C * Perhaps suppress a few more xor insns in feed-in code.
+C * Make sure we write no dead registers in feed-in code.
+C * We might use 32-bit size ops, since n >= 2^32 is non-terminating. Watch
+C out for negative sizes being zero-extended, though.
+C * Provide straight-line code for n = 4; then look for simplifications in
+C main code.
+
+define(`rp', `%rdi')
+define(`up', `%rsi')
+define(`un_param',`%rdx')
+
+
+ABI_SUPPORT(DOS64)
+ABI_SUPPORT(STD64)
+
+ASM_START()
+ TEXT
+ ALIGN(32)
+PROLOGUE(mpn_sqr_basecase)
+ FUNC_ENTRY(3)
+
+ cmp $2, un_param
+ jae L(gt1)
+
+ mov (up), %rdx
+ mulx( %rdx, %rax, %rdx)
+ mov %rax, (rp)
+ mov %rdx, 8(rp)
+ FUNC_EXIT()
+ ret
+
+L(gt1): jne L(gt2)
+
+ mov (up), %rdx
+ mov 8(up), %rcx
+ mulx( %rcx, %r9, %r10) C v0 * v1 W 1 2
+ mulx( %rdx, %rax, %r8) C v0 * v0 W 0 1
+ mov %rcx, %rdx
+ mulx( %rdx, %r11, %rdx) C v1 * v1 W 2 3
+ add %r9, %r9 C W 1
+ adc %r10, %r10 C W 2
+ adc $0, %rdx C W 3
+ add %r9, %r8 C W 1
+ adc %r11, %r10 C W 2
+ adc $0, %rdx C W 3
+ mov %rax, (rp)
+ mov %r8, 8(rp)
+ mov %r10, 16(rp)
+ mov %rdx, 24(rp)
+ FUNC_EXIT()
+ ret
+
+L(gt2): cmp $4, un_param
+ jae L(gt3)
+define(`v0', `%r8')
+define(`v1', `%r9')
+define(`w0', `%r10')
+define(`w2', `%r11')
+
+ mov (up), v0
+ mov 8(up), %rdx
+ mov %rdx, v1
+ mulx( v0, w2, %rax)
+ mov 16(up), %rdx
+ mulx( v0, w0, %rcx)
+ mov w2, %r8
+ add %rax, w0
+ adc $0, %rcx
+ mulx( v1, %rdx, %rax)
+ add %rcx, %rdx
+ mov %rdx, 24(rp)
+ adc $0, %rax
+ mov %rax, 32(rp)
+ xor R32(%rcx), R32(%rcx)
+ mov (up), %rdx
+ mulx( %rdx, %rax, w2)
+ mov %rax, (rp)
+ add %r8, %r8
+ adc w0, w0
+ setc R8(%rcx)
+ mov 8(up), %rdx
+ mulx( %rdx, %rax, %rdx)
+ add w2, %r8
+ adc %rax, w0
+ mov %r8, 8(rp)
+ mov w0, 16(rp)
+ mov 24(rp), %r8
+ mov 32(rp), w0
+ lea (%rdx,%rcx), w2
+ adc %r8, %r8
+ adc w0, w0
+ setc R8(%rcx)
+ mov 16(up), %rdx
+ mulx( %rdx, %rax, %rdx)
+ add w2, %r8
+ adc %rax, w0
+ mov %r8, 24(rp)
+ mov w0, 32(rp)
+ adc %rcx, %rdx
+ mov %rdx, 40(rp)
+ FUNC_EXIT()
+ ret
+
+L(gt3):
+
+define(`v0', `%r8')
+define(`v1', `%r9')
+define(`w0', `%r10')
+define(`w1', `%r11')
+define(`w2', `%rbx')
+define(`w3', `%rbp')
+define(`un', `%r12')
+define(`n', `%rcx')
+
+define(`X0', `%r13')
+define(`X1', `%r14')
+
+L(do_mul_2):
+ push %rbx
+ push %rbp
+ push %r12
+ push %r13
+ push %r14
+ mov $0, R32(un)
+ sub un_param, un C free up rdx
+ push un
+ mov (up), v0
+ mov 8(up), %rdx
+ lea 2(un), n
+ sar $2, n C FIXME: suppress, change loop?
+ inc un C decrement |un|
+ mov %rdx, v1
+
+ test $1, R8(un)
+ jnz L(mx1)
+
+L(mx0): mulx( v0, w2, w1)
+ mov 16(up), %rdx
+ mov w2, 8(rp)
+ xor w2, w2
+ mulx( v0, w0, w3)
+ test $2, R8(un)
+ jz L(m00)
+
+L(m10): lea -8(rp), rp
+ lea -8(up), up
+ jmp L(mlo2)
+
+L(m00): lea 8(up), up
+ lea 8(rp), rp
+ jmp L(mlo0)
+
+L(mx1): mulx( v0, w0, w3)
+ mov 16(up), %rdx
+ mov w0, 8(rp)
+ xor w0, w0
+ mulx( v0, w2, w1)
+ test $2, R8(un)
+ jz L(mlo3)
+
+L(m01): lea 16(rp), rp
+ lea 16(up), up
+ jmp L(mlo1)
+
+ ALIGN(32)
+L(mtop):mulx( v1, %rax, w0)
+ add %rax, w2 C 0
+ mov (up), %rdx
+ mulx( v0, %rax, w1)
+ adc $0, w0 C 1
+ add %rax, w2 C 0
+L(mlo1):adc $0, w1 C 1
+ add w3, w2 C 0
+ mov w2, (rp) C 0
+ adc $0, w1 C 1
+ mulx( v1, %rax, w2)
+ add %rax, w0 C 1
+ mov 8(up), %rdx
+ adc $0, w2 C 2
+ mulx( v0, %rax, w3)
+ add %rax, w0 C 1
+ adc $0, w3 C 2
+L(mlo0):add w1, w0 C 1
+ mov w0, 8(rp) C 1
+ adc $0, w3 C 2
+ mulx( v1, %rax, w0)
+ add %rax, w2 C 2
+ mov 16(up), %rdx
+ mulx( v0, %rax, w1)
+ adc $0, w0 C 3
+ add %rax, w2 C 2
+ adc $0, w1 C 3
+L(mlo3):add w3, w2 C 2
+ mov w2, 16(rp) C 2
+ adc $0, w1 C 3
+ mulx( v1, %rax, w2)
+ add %rax, w0 C 3
+ mov 24(up), %rdx
+ adc $0, w2 C 4
+ mulx( v0, %rax, w3)
+ add %rax, w0 C 3
+ adc $0, w3 C 4
+L(mlo2):add w1, w0 C 3
+ lea 32(up), up
+ mov w0, 24(rp) C 3
+ adc $0, w3 C 4
+ inc n
+ lea 32(rp), rp
+ jnz L(mtop)
+
+L(mend):mulx( v1, %rdx, %rax)
+ add %rdx, w2
+ adc $0, %rax
+ add w3, w2
+ mov w2, (rp)
+ adc $0, %rax
+ mov %rax, 8(rp)
+
+ lea 16(up), up
+ lea -16(rp), rp
+
+L(do_addmul_2):
+L(outer):
+ lea (up,un,8), up C put back up to 2 positions above last time
+ lea 48(rp,un,8), rp C put back rp to 4 positions above last time
+
+ mov -8(up), v0 C shared between addmul_2 and corner
+
+ add $2, un C decrease |un|
+ cmp $-2, un
+ jge L(corner)
+
+ mov (up), v1
+
+ lea 1(un), n
+ sar $2, n C FIXME: suppress, change loop?
+
+ mov v1, %rdx
+ test $1, R8(un)
+ jnz L(bx1)
+
+L(bx0): mov (rp), X0
+ mov 8(rp), X1
+ mulx( v0, %rax, w1)
+ add %rax, X0
+ adc $0, w1
+ mov X0, (rp)
+ xor w2, w2
+ test $2, R8(un)
+ jnz L(b10)
+
+L(b00): mov 8(up), %rdx
+ lea 16(rp), rp
+ lea 16(up), up
+ jmp L(lo0)
+
+L(b10): mov 8(up), %rdx
+ mov 16(rp), X0
+ lea 32(up), up
+ inc n
+ mulx( v0, %rax, w3)
+ jz L(ex)
+ jmp L(lo2)
+
+L(bx1): mov (rp), X1
+ mov 8(rp), X0
+ mulx( v0, %rax, w3)
+ mov 8(up), %rdx
+ add %rax, X1
+ adc $0, w3
+ xor w0, w0
+ mov X1, (rp)
+ mulx( v0, %rax, w1)
+ test $2, R8(un)
+ jz L(b11)
+
+L(b01): mov 16(rp), X1
+ lea 24(rp), rp
+ lea 24(up), up
+ jmp L(lo1)
+
+L(b11): lea 8(rp), rp
+ lea 8(up), up
+ jmp L(lo3)
+
+ ALIGN(32)
+L(top): mulx( v0, %rax, w3)
+ add w0, X1
+ adc $0, w2
+L(lo2): add %rax, X1
+ adc $0, w3
+ mulx( v1, %rax, w0)
+ add %rax, X0
+ adc $0, w0
+ lea 32(rp), rp
+ add w1, X1
+ mov -16(up), %rdx
+ mov X1, -24(rp)
+ adc $0, w3
+ add w2, X0
+ mov -8(rp), X1
+ mulx( v0, %rax, w1)
+ adc $0, w0
+L(lo1): add %rax, X0
+ mulx( v1, %rax, w2)
+ adc $0, w1
+ add w3, X0
+ mov X0, -16(rp)
+ adc $0, w1
+ add %rax, X1
+ adc $0, w2
+ add w0, X1
+ mov -8(up), %rdx
+ adc $0, w2
+L(lo0): mulx( v0, %rax, w3)
+ add %rax, X1
+ adc $0, w3
+ mov (rp), X0
+ mulx( v1, %rax, w0)
+ add %rax, X0
+ adc $0, w0
+ add w1, X1
+ mov X1, -8(rp)
+ adc $0, w3
+ mov (up), %rdx
+ add w2, X0
+ mulx( v0, %rax, w1)
+ adc $0, w0
+L(lo3): add %rax, X0
+ adc $0, w1
+ mulx( v1, %rax, w2)
+ add w3, X0
+ mov 8(rp), X1
+ mov X0, (rp)
+ mov 16(rp), X0
+ adc $0, w1
+ add %rax, X1
+ adc $0, w2
+ mov 8(up), %rdx
+ lea 32(up), up
+ inc n
+ jnz L(top)
+
+L(end): mulx( v0, %rax, w3)
+ add w0, X1
+ adc $0, w2
+L(ex): add %rax, X1
+ adc $0, w3
+ mulx( v1, %rdx, %rax)
+ add w1, X1
+ mov X1, 8(rp)
+ adc $0, w3
+ add w2, %rdx
+ adc $0, %rax
+ add %rdx, w3
+ mov w3, 16(rp)
+ adc $0, %rax
+ mov %rax, 24(rp)
+
+ jmp L(outer) C loop until a small corner remains
+
+L(corner):
+ pop un
+ mov (up), %rdx
+ jg L(small_corner)
+
+ mov %rdx, v1
+ mov (rp), X0
+ mov %rax, X1 C Tricky rax reuse of last iteration
+ mulx( v0, %rax, w1)
+ add %rax, X0
+ adc $0, w1
+ mov X0, (rp)
+ mov 8(up), %rdx
+ mulx( v0, %rax, w3)
+ add %rax, X1
+ adc $0, w3
+ mulx( v1, %rdx, %rax)
+ add w1, X1
+ mov X1, 8(rp)
+ adc $0, w3
+ add w3, %rdx
+ mov %rdx, 16(rp)
+ adc $0, %rax
+ mov %rax, 24(rp)
+ lea 32(rp), rp
+ lea 16(up), up
+ jmp L(com)
+
+L(small_corner):
+ mulx( v0, X1, w3)
+ add %rax, X1 C Tricky rax reuse of last iteration
+ adc $0, w3
+ mov X1, (rp)
+ mov w3, 8(rp)
+ lea 16(rp), rp
+ lea 8(up), up
+
+L(com):
+
+L(sqr_diag_addlsh1):
+ lea 8(up,un,8), up C put back up at its very beginning
+ lea (rp,un,8), rp
+ lea (rp,un,8), rp C put back rp at its very beginning
+ inc un
+
+ mov -8(up), %rdx
+ xor R32(%rbx), R32(%rbx) C clear CF as side effect
+ mulx( %rdx, %rax, %r10)
+ mov %rax, 8(rp)
+ mov 16(rp), %r8
+ mov 24(rp), %r9
+ jmp L(dm)
+
+ ALIGN(16)
+L(dtop):mov 32(rp), %r8
+ mov 40(rp), %r9
+ lea 16(rp), rp
+ lea (%rdx,%rbx), %r10
+L(dm): adc %r8, %r8
+ adc %r9, %r9
+ setc R8(%rbx)
+ mov (up), %rdx
+ lea 8(up), up
+ mulx( %rdx, %rax, %rdx)
+ add %r10, %r8
+ adc %rax, %r9
+ mov %r8, 16(rp)
+ mov %r9, 24(rp)
+ inc un
+ jnz L(dtop)
+
+L(dend):adc %rbx, %rdx
+ mov %rdx, 32(rp)
+
+ pop %r14
+ pop %r13
+ pop %r12
+ pop %rbp
+ pop %rbx
+ FUNC_EXIT()
+ ret
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/coreinhm/aorrlsh_n.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/coreinhm/aorrlsh_n.asm
new file mode 100644
index 00000000000..eed64e701e8
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/coreinhm/aorrlsh_n.asm
@@ -0,0 +1,200 @@
+dnl AMD64 mpn_addlsh_n -- rp[] = up[] + (vp[] << k)
+dnl AMD64 mpn_rsblsh_n -- rp[] = (vp[] << k) - up[]
+dnl Optimised for Nehalem.
+
+dnl Contributed to the GNU project by Torbjorn Granlund.
+
+dnl Copyright 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/limb
+C AMD K8,K9 ?
+C AMD K10 4.75
+C Intel P4 ?
+C Intel core2 2.8-3
+C Intel NHM 2.8
+C Intel SBR 3.55
+C Intel atom ?
+C VIA nano ?
+
+C The inner-loop probably runs close to optimally on Nehalem (using 4-way
+C unrolling). The rest of the code is quite crude, and could perhaps be made
+C both smaller and faster.
+
+C INPUT PARAMETERS
+define(`rp', `%rdi')
+define(`up', `%rsi')
+define(`vp', `%rdx')
+define(`n', `%rcx')
+define(`cnt', `%r8')
+define(`cy', `%r9') C for _nc variant
+
+ifdef(`OPERATION_addlsh_n', `
+ define(ADDSUB, add)
+ define(ADCSBB, adc)
+ define(IFRSB, )
+ define(func_n, mpn_addlsh_n)
+ define(func_nc, mpn_addlsh_nc)')
+ifdef(`OPERATION_rsblsh_n', `
+ define(ADDSUB, sub)
+ define(ADCSBB, sbb)
+ define(IFRSB, `$1')
+ define(func_n, mpn_rsblsh_n)
+ define(func_nc, mpn_rsblsh_nc)')
+
+C mpn_rsblsh_nc removed below, its idea of carry-in is inconsistent with
+C refmpn_rsblsh_nc
+MULFUNC_PROLOGUE(mpn_addlsh_n mpn_addlsh_nc mpn_rsblsh_n)
+
+ABI_SUPPORT(DOS64)
+ABI_SUPPORT(STD64)
+
+ASM_START()
+ TEXT
+ ALIGN(32)
+PROLOGUE(func_n)
+ FUNC_ENTRY(4)
+IFDOS(` mov 56(%rsp), %r8d ') C cnt
+ push %rbx
+ xor R32(%rbx), R32(%rbx) C clear CF save register
+L(ent): push %rbp
+ mov R32(n), R32(%rbp)
+ mov n, %rax
+
+ mov R32(cnt), R32(%rcx)
+ neg R32(%rcx)
+
+ lea -8(up,%rax,8), up
+ lea -8(vp,%rax,8), vp
+ lea -40(rp,%rax,8), rp
+ neg %rax
+
+ and $3, R32(%rbp)
+ jz L(b0)
+ cmp $2, R32(%rbp)
+ jc L(b1)
+ jz L(b2)
+
+L(b3): xor R32(%r9), R32(%r9)
+ mov 8(vp,%rax,8), %r10
+ mov 16(vp,%rax,8), %r11
+ shrd %cl, %r10, %r9
+ shrd %cl, %r11, %r10
+ add R32(%rbx), R32(%rbx)
+ ADCSBB 8(up,%rax,8), %r9
+ mov 24(vp,%rax,8), %r8
+ ADCSBB 16(up,%rax,8), %r10
+ sbb R32(%rbx), R32(%rbx)
+ add $3, %rax
+ jmp L(lo3)
+
+L(b0): mov 8(vp,%rax,8), %r9
+ xor R32(%r8), R32(%r8)
+ shrd %cl, %r9, %r8
+ mov 16(vp,%rax,8), %r10
+ mov 24(vp,%rax,8), %r11
+ shrd %cl, %r10, %r9
+ shrd %cl, %r11, %r10
+ add R32(%rbx), R32(%rbx)
+ ADCSBB 8(up,%rax,8), %r8
+ mov %r8, 40(rp,%rax,8) C offset 40
+ ADCSBB 16(up,%rax,8), %r9
+ mov 32(vp,%rax,8), %r8
+ ADCSBB 24(up,%rax,8), %r10
+ sbb R32(%rbx), R32(%rbx)
+ add $4, %rax
+ jmp L(lo0)
+
+L(b1): mov 8(vp,%rax,8), %r8
+ add $1, %rax
+ jz L(1)
+ mov 8(vp,%rax,8), %r9
+ xor R32(%rbp), R32(%rbp)
+ jmp L(lo1)
+L(1): xor R32(%r11), R32(%r11)
+ jmp L(wd1)
+
+L(b2): xor %r10, %r10
+ mov 8(vp,%rax,8), %r11
+ shrd %cl, %r11, %r10
+ add R32(%rbx), R32(%rbx)
+ mov 16(vp,%rax,8), %r8
+ ADCSBB 8(up,%rax,8), %r10
+ sbb R32(%rbx), R32(%rbx)
+ add $2, %rax
+ jz L(end)
+
+ ALIGN(16)
+L(top): mov 8(vp,%rax,8), %r9
+ mov %r11, %rbp
+L(lo2): mov %r10, 24(rp,%rax,8) C offset 24
+L(lo1): shrd %cl, %r8, %rbp
+ shrd %cl, %r9, %r8
+ mov 16(vp,%rax,8), %r10
+ mov 24(vp,%rax,8), %r11
+ shrd %cl, %r10, %r9
+ shrd %cl, %r11, %r10
+ add R32(%rbx), R32(%rbx)
+ ADCSBB (up,%rax,8), %rbp
+ ADCSBB 8(up,%rax,8), %r8
+ mov %r8, 40(rp,%rax,8) C offset 40
+ ADCSBB 16(up,%rax,8), %r9
+ mov 32(vp,%rax,8), %r8
+ ADCSBB 24(up,%rax,8), %r10
+ sbb R32(%rbx), R32(%rbx)
+ add $4, %rax
+ mov %rbp, (rp,%rax,8) C offset 32
+L(lo0):
+L(lo3): mov %r9, 16(rp,%rax,8) C offset 48
+ jnz L(top)
+
+L(end): mov %r10, 24(rp,%rax,8)
+L(wd1): shrd %cl, %r8, %r11
+ add R32(%rbx), R32(%rbx)
+ ADCSBB (up,%rax,8), %r11
+ mov %r11, 32(rp,%rax,8) C offset 32
+ adc R32(%rax), R32(%rax) C rax is zero after loop
+ shr R8(%rcx), %r8
+ ADDSUB %r8, %rax
+IFRSB( neg %rax)
+ pop %rbp
+ pop %rbx
+ FUNC_EXIT()
+ ret
+EPILOGUE()
+PROLOGUE(func_nc)
+ FUNC_ENTRY(4)
+IFDOS(` mov 56(%rsp), %r8d ') C cnt
+IFDOS(` mov 64(%rsp), %r9 ') C cy
+ push %rbx
+ neg cy
+ sbb R32(%rbx), R32(%rbx) C initialise CF save register
+ jmp L(ent)
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/coreinhm/aorsmul_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/coreinhm/aorsmul_1.asm
new file mode 100644
index 00000000000..b768905b939
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/coreinhm/aorsmul_1.asm
@@ -0,0 +1,187 @@
+dnl AMD64 mpn_addmul_1 and mpn_submul_1 optimised for Intel Nehalem.
+
+dnl Contributed to the GNU project by Torbjörn Granlund.
+
+dnl Copyright 2003-2005, 2007, 2008, 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/limb
+C AMD K8,K9
+C AMD K10
+C AMD bull
+C AMD pile
+C AMD bobcat
+C AMD jaguar
+C Intel P4
+C Intel core
+C Intel NHM 4.55 with minor fluctuations
+C Intel SBR
+C Intel IBR
+C Intel HWL
+C Intel BWL
+C Intel atom
+C VIA nano
+
+C The loop of this code is the result of running a code generation and
+C optimization tool suite written by David Harvey and Torbjorn Granlund.
+
+C N.B.: Be careful if editing, making sure the loop alignment padding does not
+C become large, as we currently fall into it.
+
+define(`rp', `%rdi') C rcx
+define(`up', `%rsi') C rdx
+define(`n_param', `%rdx') C r8
+define(`v0', `%rcx') C r9
+
+define(`n', `%rbx')
+
+ifdef(`OPERATION_addmul_1',`
+ define(`ADDSUB', `add')
+ define(`func', `mpn_addmul_1')
+')
+ifdef(`OPERATION_submul_1',`
+ define(`ADDSUB', `sub')
+ define(`func', `mpn_submul_1')
+')
+
+ABI_SUPPORT(DOS64)
+ABI_SUPPORT(STD64)
+
+MULFUNC_PROLOGUE(mpn_addmul_1 mpn_submul_1)
+
+ASM_START()
+ TEXT
+ ALIGN(32)
+PROLOGUE(func)
+ FUNC_ENTRY(4)
+ push %rbx
+
+ mov (up), %rax
+ lea -8(up,n_param,8), up
+ mov (rp), %r8
+ lea -8(rp,n_param,8), rp
+
+ test $1, R8(n_param)
+ jnz L(bx1)
+
+L(bx0): test $2, R8(n_param)
+ jnz L(b10)
+
+L(b00): mov $3, R32(n)
+ sub n_param, n
+ mul v0
+ mov $0, R32(%r11)
+ mov %r8, %r10
+ ADDSUB %rax, %r10
+ mov -8(up,n,8), %rax
+ adc %rdx, %r11
+ jmp L(lo0)
+
+L(b10): mov $1, R32(n)
+ sub n_param, n
+ mul v0
+ mov %r8, %r10
+ mov $0, R32(%r11)
+ ADDSUB %rax, %r10
+ mov 8(up,n,8), %rax
+ adc %rdx, %r11
+ jmp L(lo2)
+
+L(bx1): test $2, R8(n_param)
+ jz L(b01)
+
+L(b11): mov $2, R32(n)
+ sub n_param, n
+ mul v0
+ ADDSUB %rax, %r8
+ mov $0, R32(%r9)
+ mov (up,n,8), %rax
+ adc %rdx, %r9
+ jmp L(lo3)
+
+L(b01): mov $0, R32(n)
+ sub n_param, n
+ xor %r11, %r11
+ add $4, n
+ jc L(end)
+
+ ALIGN(32)
+L(top): mul v0
+ ADDSUB %rax, %r8
+ mov $0, R32(%r9)
+ mov -16(up,n,8), %rax
+ adc %rdx, %r9
+L(lo1): mul v0
+ ADDSUB %r11, %r8
+ mov $0, R32(%r11)
+ mov -16(rp,n,8), %r10
+ adc $0, %r9
+ ADDSUB %rax, %r10
+ mov -8(up,n,8), %rax
+ adc %rdx, %r11
+ mov %r8, -24(rp,n,8)
+ ADDSUB %r9, %r10
+ adc $0, %r11
+L(lo0): mov -8(rp,n,8), %r8
+ mul v0
+ ADDSUB %rax, %r8
+ mov $0, R32(%r9)
+ mov (up,n,8), %rax
+ adc %rdx, %r9
+ mov %r10, -16(rp,n,8)
+ ADDSUB %r11, %r8
+ adc $0, %r9
+L(lo3): mul v0
+ mov (rp,n,8), %r10
+ mov $0, R32(%r11)
+ ADDSUB %rax, %r10
+ mov 8(up,n,8), %rax
+ adc %rdx, %r11
+ mov %r8, -8(rp,n,8)
+ ADDSUB %r9, %r10
+ adc $0, %r11
+L(lo2): mov 8(rp,n,8), %r8
+ mov %r10, (rp,n,8)
+ add $4, n
+ jnc L(top)
+
+L(end): mul v0
+ ADDSUB %rax, %r8
+ mov $0, R32(%rax)
+ adc %rdx, %rax
+ ADDSUB %r11, %r8
+ adc $0, %rax
+ mov %r8, (rp)
+
+ pop %rbx
+ FUNC_EXIT()
+ ret
+EPILOGUE()
+ASM_END()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/coreinhm/gmp-mparam.h b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/coreinhm/gmp-mparam.h
new file mode 100644
index 00000000000..6a7c03639f6
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/coreinhm/gmp-mparam.h
@@ -0,0 +1,231 @@
+/* Nehalem gmp-mparam.h -- Compiler/machine parameter header file.
+
+Copyright 1991, 1993, 1994, 2000-2012, 2014 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
+
+/* 2667 MHz Core i7 Nehalem */
+/* FFT tuning limit = 100000000 */
+/* Generated by tuneup.c, 2014-03-18, gcc 4.5 */
+
+#define MOD_1_NORM_THRESHOLD 0 /* always */
+#define MOD_1_UNNORM_THRESHOLD 0 /* always */
+#define MOD_1N_TO_MOD_1_1_THRESHOLD 2
+#define MOD_1U_TO_MOD_1_1_THRESHOLD 3
+#define MOD_1_1_TO_MOD_1_2_THRESHOLD 11
+#define MOD_1_2_TO_MOD_1_4_THRESHOLD 16
+#define PREINV_MOD_1_TO_MOD_1_THRESHOLD 9
+#define USE_PREINV_DIVREM_1 1 /* native */
+#define DIV_QR_1_NORM_THRESHOLD 1
+#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 16
+
+#define MUL_TOOM22_THRESHOLD 18
+#define MUL_TOOM33_THRESHOLD 60
+#define MUL_TOOM44_THRESHOLD 166
+#define MUL_TOOM6H_THRESHOLD 228
+#define MUL_TOOM8H_THRESHOLD 309
+
+#define MUL_TOOM32_TO_TOOM43_THRESHOLD 63
+#define MUL_TOOM32_TO_TOOM53_THRESHOLD 114
+#define MUL_TOOM42_TO_TOOM53_THRESHOLD 104
+#define MUL_TOOM42_TO_TOOM63_THRESHOLD 113
+#define MUL_TOOM43_TO_TOOM54_THRESHOLD 147
+
+#define SQR_BASECASE_THRESHOLD 0 /* always (native) */
+#define SQR_TOOM2_THRESHOLD 28
+#define SQR_TOOM3_THRESHOLD 93
+#define SQR_TOOM4_THRESHOLD 250
+#define SQR_TOOM6_THRESHOLD 351
+#define SQR_TOOM8_THRESHOLD 454
+
+#define MULMID_TOOM42_THRESHOLD 28
+
+#define MULMOD_BNM1_THRESHOLD 12
+#define SQRMOD_BNM1_THRESHOLD 15
+
+#define MUL_FFT_MODF_THRESHOLD 380 /* k = 5 */
+#define MUL_FFT_TABLE3 \
+ { { 380, 5}, { 17, 6}, { 9, 5}, { 19, 6}, \
+ { 10, 5}, { 21, 6}, { 21, 7}, { 11, 6}, \
+ { 23, 7}, { 21, 8}, { 11, 7}, { 24, 8}, \
+ { 13, 7}, { 27, 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}, { 39,10}, \
+ { 23, 9}, { 51,11}, { 15,10}, { 31, 9}, \
+ { 67,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, 9}, { 319,10}, { 167,11}, { 95,10}, \
+ { 191, 9}, { 383,12}, { 63,11}, { 127,10}, \
+ { 255, 9}, { 511,11}, { 143,10}, { 287, 9}, \
+ { 575,11}, { 159,10}, { 319,12}, { 95,11}, \
+ { 191,10}, { 383, 9}, { 767,11}, { 207,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}, \
+ { 351,10}, { 703,12}, { 191,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,12}, \
+ { 319,11}, { 671,12}, { 351,11}, { 703,13}, \
+ { 191,12}, { 383,11}, { 767,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}, { 703,11}, { 1407,13}, \
+ { 383,12}, { 831,13}, { 447,12}, { 959,14}, \
+ { 255,13}, { 511,12}, { 1087,11}, { 2175,13}, \
+ { 575,12}, { 1215,11}, { 2431,13}, { 639,12}, \
+ { 1279,13}, { 703,12}, { 1407,14}, { 383,13}, \
+ { 767,12}, { 1535,13}, { 831,12}, { 1663,13}, \
+ { 959,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,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}, { 3071,14}, \
+ { 1663,13}, { 3455,14}, { 1791,13}, { 3583,14}, \
+ { 1919,16}, { 511,15}, { 1023,14}, { 2431,13}, \
+ { 4863,15}, { 1279,14}, { 2943,13}, { 5887,15}, \
+ { 1535,14}, { 3455,15}, { 1791,14}, { 3839,16}, \
+ { 1023,15}, { 2047,14}, { 4223,15}, { 2303,14}, \
+ { 4863,15}, { 2815,14}, { 5887,16}, { 65536,17}, \
+ { 131072,18}, { 262144,19}, { 524288,20}, {1048576,21}, \
+ {2097152,22}, {4194304,23}, {8388608,24} }
+#define MUL_FFT_TABLE3_SIZE 203
+#define MUL_FFT_THRESHOLD 4032
+
+#define SQR_FFT_MODF_THRESHOLD 312 /* k = 5 */
+#define SQR_FFT_TABLE3 \
+ { { 312, 5}, { 17, 6}, { 9, 5}, { 19, 6}, \
+ { 21, 7}, { 11, 6}, { 23, 7}, { 21, 8}, \
+ { 11, 7}, { 24, 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}, \
+ { 83,10}, { 47, 9}, { 95,10}, { 55,11}, \
+ { 31,10}, { 79,11}, { 47,10}, { 95,12}, \
+ { 31,11}, { 63,10}, { 127, 9}, { 255, 8}, \
+ { 511,10}, { 135,11}, { 79,10}, { 159, 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,11}, { 159,10}, { 319, 9}, { 639,12}, \
+ { 95,11}, { 191,10}, { 383, 9}, { 767,11}, \
+ { 207,13}, { 63,12}, { 127,11}, { 255,10}, \
+ { 511, 9}, { 1023,11}, { 271,10}, { 543,11}, \
+ { 287,10}, { 575,11}, { 303,12}, { 159,11}, \
+ { 319,10}, { 639, 9}, { 1279,11}, { 351,10}, \
+ { 703,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,10}, { 1087,12}, \
+ { 287,11}, { 575,10}, { 1151,11}, { 607,12}, \
+ { 319,11}, { 639,10}, { 1279,11}, { 671,12}, \
+ { 351,11}, { 703,13}, { 191,12}, { 383,11}, \
+ { 767,12}, { 415,11}, { 831,12}, { 447,11}, \
+ { 895,12}, { 479,11}, { 959,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,13}, { 383,12}, \
+ { 767,11}, { 1535,12}, { 831,13}, { 447,12}, \
+ { 959,14}, { 255,13}, { 511,12}, { 1087,13}, \
+ { 575,12}, { 1215,13}, { 639,12}, { 1343,13}, \
+ { 703,12}, { 1407,14}, { 383,13}, { 767,12}, \
+ { 1535,13}, { 831,12}, { 1663,13}, { 959,14}, \
+ { 511,13}, { 1087,12}, { 2175,13}, { 1215,12}, \
+ { 2431,14}, { 639,13}, { 1279,12}, { 2559,13}, \
+ { 1343,12}, { 2687,13}, { 1407,12}, { 2815,14}, \
+ { 767,13}, { 1663,14}, { 895,13}, { 1791,12}, \
+ { 3583,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}, { 1663,13}, { 3455,14}, { 1791,13}, \
+ { 3583,16}, { 511,15}, { 1023,14}, { 2303,13}, \
+ { 4607,14}, { 2431,13}, { 4863,15}, { 1279,14}, \
+ { 2943,13}, { 5887,15}, { 1535,14}, { 3455,15}, \
+ { 1791,14}, { 3839,16}, { 1023,15}, { 2047,14}, \
+ { 4223,15}, { 2303,14}, { 4863,15}, { 2815,14}, \
+ { 5887,16}, { 65536,17}, { 131072,18}, { 262144,19}, \
+ { 524288,20}, {1048576,21}, {2097152,22}, {4194304,23}, \
+ {8388608,24} }
+#define SQR_FFT_TABLE3_SIZE 217
+#define SQR_FFT_THRESHOLD 2752
+
+#define MULLO_BASECASE_THRESHOLD 0 /* always */
+#define MULLO_DC_THRESHOLD 45
+#define MULLO_MUL_N_THRESHOLD 8397
+
+#define DC_DIV_QR_THRESHOLD 46
+#define DC_DIVAPPR_Q_THRESHOLD 135
+#define DC_BDIV_QR_THRESHOLD 38
+#define DC_BDIV_Q_THRESHOLD 31
+
+#define INV_MULMOD_BNM1_THRESHOLD 34
+#define INV_NEWTON_THRESHOLD 212
+#define INV_APPR_THRESHOLD 155
+
+#define BINV_NEWTON_THRESHOLD 254
+#define REDC_1_TO_REDC_2_THRESHOLD 32
+#define REDC_2_TO_REDC_N_THRESHOLD 50
+
+#define MU_DIV_QR_THRESHOLD 1334
+#define MU_DIVAPPR_Q_THRESHOLD 1360
+#define MUPI_DIV_QR_THRESHOLD 85
+#define MU_BDIV_QR_THRESHOLD 1142
+#define MU_BDIV_Q_THRESHOLD 1210
+
+#define POWM_SEC_TABLE 3,46,194,494,1678
+
+#define MATRIX22_STRASSEN_THRESHOLD 21
+#define HGCD_THRESHOLD 141
+#define HGCD_APPR_THRESHOLD 175
+#define HGCD_REDUCE_THRESHOLD 2205
+#define GCD_DC_THRESHOLD 330
+#define GCDEXT_DC_THRESHOLD 361
+#define JACOBI_BASE_METHOD 4
+
+#define GET_STR_DC_THRESHOLD 15
+#define GET_STR_PRECOMPUTE_THRESHOLD 21
+#define SET_STR_DC_THRESHOLD 517
+#define SET_STR_PRECOMPUTE_THRESHOLD 1430
+
+#define FAC_DSC_THRESHOLD 351
+#define FAC_ODD_THRESHOLD 43
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/coreinhm/hamdist.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/coreinhm/hamdist.asm
new file mode 100644
index 00000000000..93e1e5632b2
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/coreinhm/hamdist.asm
@@ -0,0 +1,38 @@
+dnl AMD64 mpn_hamdist -- hamming distance.
+
+dnl Copyright 2008, 2010-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')
+
+ABI_SUPPORT(DOS64)
+ABI_SUPPORT(STD64)
+
+MULFUNC_PROLOGUE(mpn_hamdist)
+include_mpn(`x86_64/k10/hamdist.asm')
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/coreinhm/popcount.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/coreinhm/popcount.asm
new file mode 100644
index 00000000000..8f22a715b66
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/coreinhm/popcount.asm
@@ -0,0 +1,38 @@
+dnl AMD64 mpn_popcount -- population count.
+
+dnl Copyright 2008, 2010-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')
+
+ABI_SUPPORT(DOS64)
+ABI_SUPPORT(STD64)
+
+MULFUNC_PROLOGUE(mpn_popcount)
+include_mpn(`x86_64/k10/popcount.asm')
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/coreinhm/redc_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/coreinhm/redc_1.asm
new file mode 100644
index 00000000000..4d9261d8f90
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/coreinhm/redc_1.asm
@@ -0,0 +1,544 @@
+dnl X86-64 mpn_redc_1 optimised for Intel Nehalem and Westmere.
+
+dnl Contributed to the GNU project by Torbjörn Granlund.
+
+dnl Copyright 2003-2005, 2007, 2008, 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/limb
+C AMD K8,K9 ?
+C AMD K10 ?
+C AMD bull ?
+C AMD pile ?
+C AMD steam ?
+C AMD bobcat ?
+C AMD jaguar ?
+C Intel P4 ?
+C Intel core ?
+C Intel NHM ?
+C Intel SBR ?
+C Intel IBR ?
+C Intel HWL ?
+C Intel BWL ?
+C Intel atom ?
+C VIA nano ?
+
+C The inner loops of this code are the result of running a code generation and
+C optimisation tool suite written by David Harvey and Torbjörn Granlund.
+
+C TODO
+C * Micro-optimise, none performed thus far.
+C * Consider inlining mpn_add_n.
+C * Single basecases out before the pushes.
+
+C When playing with pointers, set this to $2 to fall back to conservative
+C indexing in wind-down code.
+define(`I',`$1')
+
+define(`rp', `%rdi') C rcx
+define(`up', `%rsi') C rdx
+define(`mp_param', `%rdx') C r8
+define(`n', `%rcx') C r9
+define(`u0inv', `%r8') C stack
+
+define(`i', `%r14')
+define(`j', `%r15')
+define(`mp', `%r12')
+define(`q0', `%r13')
+
+C rax rbx rcx rdx rdi rsi rbp r8 r9 r10 r11 r12 r13 r14 r15
+
+ABI_SUPPORT(DOS64)
+ABI_SUPPORT(STD64)
+
+define(`ALIGNx', `ALIGN(16)')
+
+ASM_START()
+ TEXT
+ ALIGN(32)
+PROLOGUE(mpn_redc_1)
+ FUNC_ENTRY(4)
+IFDOS(` mov 56(%rsp), %r8 ')
+ push %rbx
+ push %rbp
+ push %r12
+ push %r13
+ push %r14
+ push %r15
+
+ mov (up), q0
+ mov n, j C outer loop induction var
+ lea (mp_param,n,8), mp
+ lea (up,n,8), up
+ neg n
+ imul u0inv, q0 C first iteration q0
+
+ test $1, R8(n)
+ jz L(bx0)
+
+L(bx1): test $2, R8(n)
+ jz L(b3)
+
+L(b1): cmp $-1, R32(n)
+ jz L(n1)
+
+L(otp1):lea 3(n), i
+ mov (mp,n,8), %rax
+ mov (up,n,8), %rbp
+ mul q0
+ add %rax, %rbp
+ mov $0, R32(%r9)
+ mov 8(mp,n,8), %rax
+ adc %rdx, %r9
+ mul q0
+ mov $0, R32(%r11)
+ mov 8(up,n,8), %rbx
+ add %rax, %rbx
+ mov 16(mp,n,8), %rax
+ adc %rdx, %r11
+ add %r9, %rbx
+ adc $0, %r11
+ mov 16(up,n,8), %rbp
+ mul q0
+ add %rax, %rbp
+ mov $0, R32(%r9)
+ mov 24(mp,n,8), %rax
+ adc %rdx, %r9
+ mov %rbx, 8(up,n,8)
+ imul u0inv, %rbx C next q limb
+ jmp L(e1)
+
+ ALIGNx
+L(tp1): mul q0
+ add %rax, %rbp
+ mov $0, R32(%r9)
+ mov -16(mp,i,8), %rax
+ adc %rdx, %r9
+ mul q0
+ add %r11, %rbp
+ mov $0, R32(%r11)
+ mov -16(up,i,8), %r10
+ adc $0, %r9
+ add %rax, %r10
+ mov -8(mp,i,8), %rax
+ adc %rdx, %r11
+ mov %rbp, -24(up,i,8)
+ add %r9, %r10
+ adc $0, %r11
+ mov -8(up,i,8), %rbp
+ mul q0
+ add %rax, %rbp
+ mov $0, R32(%r9)
+ mov (mp,i,8), %rax
+ adc %rdx, %r9
+ mov %r10, -16(up,i,8)
+L(e1): add %r11, %rbp
+ adc $0, %r9
+ mul q0
+ mov (up,i,8), %r10
+ mov $0, R32(%r11)
+ add %rax, %r10
+ mov 8(mp,i,8), %rax
+ adc %rdx, %r11
+ mov %rbp, -8(up,i,8)
+ add %r9, %r10
+ adc $0, %r11
+ mov 8(up,i,8), %rbp
+ mov %r10, (up,i,8)
+ add $4, i
+ jnc L(tp1)
+
+L(ed1): mul q0
+ add %rax, %rbp
+ adc $0, %rdx
+ add %r11, %rbp
+ adc $0, %rdx
+ mov %rbp, I(-8(up),-24(up,i,8))
+ mov %rdx, (up,n,8) C up[0]
+ mov %rbx, q0 C previously computed q limb -> q0
+ lea 8(up), up C up++
+ dec j
+ jnz L(otp1)
+ jmp L(cj)
+
+L(b3): cmp $-3, R32(n)
+ jz L(n3)
+
+L(otp3):lea 5(n), i
+ mov (mp,n,8), %rax
+ mov (up,n,8), %rbp
+ mul q0
+ add %rax, %rbp
+ mov $0, R32(%r9)
+ mov 8(mp,n,8), %rax
+ adc %rdx, %r9
+ mul q0
+ mov 8(up,n,8), %rbx
+ mov $0, R32(%r11)
+ add %rax, %rbx
+ mov 16(mp,n,8), %rax
+ adc %rdx, %r11
+ add %r9, %rbx
+ adc $0, %r11
+ mov 16(up,n,8), %rbp
+ mov %rbx, 8(up,n,8)
+ imul u0inv, %rbx C next q limb
+C jmp L(tp3)
+
+ ALIGNx
+L(tp3): mul q0
+ add %rax, %rbp
+ mov $0, R32(%r9)
+ mov -16(mp,i,8), %rax
+ adc %rdx, %r9
+ mul q0
+ add %r11, %rbp
+ mov $0, R32(%r11)
+ mov -16(up,i,8), %r10
+ adc $0, %r9
+ add %rax, %r10
+ mov -8(mp,i,8), %rax
+ adc %rdx, %r11
+ mov %rbp, -24(up,i,8)
+ add %r9, %r10
+ adc $0, %r11
+ mov -8(up,i,8), %rbp
+ mul q0
+ add %rax, %rbp
+ mov $0, R32(%r9)
+ mov (mp,i,8), %rax
+ adc %rdx, %r9
+ mov %r10, -16(up,i,8)
+ add %r11, %rbp
+ adc $0, %r9
+ mul q0
+ mov (up,i,8), %r10
+ mov $0, R32(%r11)
+ add %rax, %r10
+ mov 8(mp,i,8), %rax
+ adc %rdx, %r11
+ mov %rbp, -8(up,i,8)
+ add %r9, %r10
+ adc $0, %r11
+ mov 8(up,i,8), %rbp
+ mov %r10, (up,i,8)
+ add $4, i
+ jnc L(tp3)
+
+L(ed3): mul q0
+ add %rax, %rbp
+ adc $0, %rdx
+ add %r11, %rbp
+ adc $0, %rdx
+ mov %rbp, I(-8(up),-24(up,i,8))
+ mov %rdx, (up,n,8) C up[0]
+ mov %rbx, q0 C previously computed q limb -> q0
+ lea 8(up), up C up++
+ dec j
+ jnz L(otp3)
+C jmp L(cj)
+
+L(cj):
+IFSTD(` lea (up,n,8), up C param 2: up
+ lea (up,n,8), %rdx C param 3: up - n
+ neg R32(n) ') C param 4: n
+
+IFDOS(` lea (up,n,8), %rdx C param 2: up
+ lea (%rdx,n,8), %r8 C param 3: up - n
+ neg R32(n)
+ mov n, %r9 C param 4: n
+ mov rp, %rcx ') C param 1: rp
+
+ CALL( mpn_add_n)
+
+L(ret): pop %r15
+ pop %r14
+ pop %r13
+ pop %r12
+ pop %rbp
+ pop %rbx
+ FUNC_EXIT()
+ ret
+
+L(bx0): test $2, R8(n)
+ jnz L(b2)
+
+L(b0):
+L(otp0):lea 2(n), i
+ mov (mp,n,8), %rax
+ mul q0
+ mov $0, R32(%r11)
+ mov (up,n,8), %r10
+ add %rax, %r10
+ mov 8(mp,n,8), %rax
+ adc %rdx, %r11
+ mov 8(up,n,8), %rbx
+ mul q0
+ add %rax, %rbx
+ mov $0, R32(%r9)
+ mov 16(mp,n,8), %rax
+ adc %rdx, %r9
+ add %r11, %rbx
+ adc $0, %r9
+ mul q0
+ mov 16(up,n,8), %r10
+ mov $0, R32(%r11)
+ add %rax, %r10
+ mov 24(mp,n,8), %rax
+ adc %rdx, %r11
+ mov %rbx, 8(up,n,8)
+ imul u0inv, %rbx C next q limb
+ jmp L(e0)
+
+ ALIGNx
+L(tp0): mul q0
+ add %rax, %rbp
+ mov $0, R32(%r9)
+ mov -16(mp,i,8), %rax
+ adc %rdx, %r9
+ mul q0
+ add %r11, %rbp
+ mov $0, R32(%r11)
+ mov -16(up,i,8), %r10
+ adc $0, %r9
+ add %rax, %r10
+ mov -8(mp,i,8), %rax
+ adc %rdx, %r11
+ mov %rbp, -24(up,i,8)
+ add %r9, %r10
+ adc $0, %r11
+ mov -8(up,i,8), %rbp
+ mul q0
+ add %rax, %rbp
+ mov $0, R32(%r9)
+ mov (mp,i,8), %rax
+ adc %rdx, %r9
+ mov %r10, -16(up,i,8)
+ add %r11, %rbp
+ adc $0, %r9
+ mul q0
+ mov (up,i,8), %r10
+ mov $0, R32(%r11)
+ add %rax, %r10
+ mov 8(mp,i,8), %rax
+ adc %rdx, %r11
+ mov %rbp, -8(up,i,8)
+L(e0): add %r9, %r10
+ adc $0, %r11
+ mov 8(up,i,8), %rbp
+ mov %r10, (up,i,8)
+ add $4, i
+ jnc L(tp0)
+
+L(ed0): mul q0
+ add %rax, %rbp
+ adc $0, %rdx
+ add %r11, %rbp
+ adc $0, %rdx
+ mov %rbp, I(-8(up),-24(up,i,8))
+ mov %rdx, (up,n,8) C up[0]
+ mov %rbx, q0 C previously computed q limb -> q0
+ lea 8(up), up C up++
+ dec j
+ jnz L(otp0)
+ jmp L(cj)
+
+L(b2): cmp $-2, R32(n)
+ jz L(n2)
+
+L(otp2):lea 4(n), i
+ mov (mp,n,8), %rax
+ mul q0
+ mov (up,n,8), %r10
+ mov $0, R32(%r11)
+ add %rax, %r10
+ mov 8(mp,n,8), %rax
+ adc %rdx, %r11
+ mov 8(up,n,8), %rbx
+ mul q0
+ add %rax, %rbx
+ mov $0, R32(%r9)
+ mov 16(mp,n,8), %rax
+ adc %rdx, %r9
+ mul q0
+ add %r11, %rbx
+ mov $0, R32(%r11)
+ mov 16(up,n,8), %r10
+ adc $0, %r9
+ add %rax, %r10
+ mov 24(mp,n,8), %rax
+ adc %rdx, %r11
+ mov %rbx, 8(up,n,8)
+ imul u0inv, %rbx C next q limb
+ jmp L(e2)
+
+ ALIGNx
+L(tp2): mul q0
+ add %rax, %rbp
+ mov $0, R32(%r9)
+ mov -16(mp,i,8), %rax
+ adc %rdx, %r9
+ mul q0
+ add %r11, %rbp
+ mov $0, R32(%r11)
+ mov -16(up,i,8), %r10
+ adc $0, %r9
+ add %rax, %r10
+ mov -8(mp,i,8), %rax
+ adc %rdx, %r11
+ mov %rbp, -24(up,i,8)
+L(e2): add %r9, %r10
+ adc $0, %r11
+ mov -8(up,i,8), %rbp
+ mul q0
+ add %rax, %rbp
+ mov $0, R32(%r9)
+ mov (mp,i,8), %rax
+ adc %rdx, %r9
+ mov %r10, -16(up,i,8)
+ add %r11, %rbp
+ adc $0, %r9
+ mul q0
+ mov (up,i,8), %r10
+ mov $0, R32(%r11)
+ add %rax, %r10
+ mov 8(mp,i,8), %rax
+ adc %rdx, %r11
+ mov %rbp, -8(up,i,8)
+ add %r9, %r10
+ adc $0, %r11
+ mov 8(up,i,8), %rbp
+ mov %r10, (up,i,8)
+ add $4, i
+ jnc L(tp2)
+
+L(ed2): mul q0
+ add %rax, %rbp
+ adc $0, %rdx
+ add %r11, %rbp
+ adc $0, %rdx
+ mov %rbp, I(-8(up),-24(up,i,8))
+ mov %rdx, (up,n,8) C up[0]
+ mov %rbx, q0 C previously computed q limb -> q0
+ lea 8(up), up C up++
+ dec j
+ jnz L(otp2)
+ jmp L(cj)
+
+L(n1): mov (mp_param), %rax
+ mul q0
+ add -8(up), %rax
+ adc (up), %rdx
+ mov %rdx, (rp)
+ mov $0, R32(%rax)
+ adc R32(%rax), R32(%rax)
+ jmp L(ret)
+
+L(n2): mov (mp_param), %rax
+ mov -16(up), %rbp
+ mul q0
+ add %rax, %rbp
+ mov %rdx, %r9
+ adc $0, %r9
+ mov -8(mp), %rax
+ mov -8(up), %r10
+ mul q0
+ add %rax, %r10
+ mov %rdx, %r11
+ adc $0, %r11
+ add %r9, %r10
+ adc $0, %r11
+ mov %r10, q0
+ imul u0inv, q0 C next q0
+ mov -16(mp), %rax
+ mul q0
+ add %rax, %r10
+ mov %rdx, %r9
+ adc $0, %r9
+ mov -8(mp), %rax
+ mov (up), %r14
+ mul q0
+ add %rax, %r14
+ adc $0, %rdx
+ add %r9, %r14
+ adc $0, %rdx
+ xor R32(%rax), R32(%rax)
+ add %r11, %r14
+ adc 8(up), %rdx
+ mov %r14, (rp)
+ mov %rdx, 8(rp)
+ adc R32(%rax), R32(%rax)
+ jmp L(ret)
+
+ ALIGNx
+L(n3): mov -24(mp), %rax
+ mov -24(up), %r10
+ mul q0
+ add %rax, %r10
+ mov -16(mp), %rax
+ mov %rdx, %r11
+ adc $0, %r11
+ mov -16(up), %rbp
+ mul q0
+ add %rax, %rbp
+ mov %rdx, %r9
+ adc $0, %r9
+ mov -8(mp), %rax
+ add %r11, %rbp
+ mov -8(up), %r10
+ adc $0, %r9
+ mul q0
+ mov %rbp, q0
+ imul u0inv, q0 C next q0
+ add %rax, %r10
+ mov %rdx, %r11
+ adc $0, %r11
+ mov %rbp, -16(up)
+ add %r9, %r10
+ adc $0, %r11
+ mov %r10, -8(up)
+ mov %r11, -24(up) C up[0]
+ lea 8(up), up C up++
+ dec j
+ jnz L(n3)
+
+ mov -48(up), %rdx
+ mov -40(up), %rbx
+ xor R32(%rax), R32(%rax)
+ add %rbp, %rdx
+ adc %r10, %rbx
+ adc -8(up), %r11
+ mov %rdx, (rp)
+ mov %rbx, 8(rp)
+ mov %r11, 16(rp)
+ adc R32(%rax), R32(%rax)
+ jmp L(ret)
+EPILOGUE()
+ASM_END()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/coreinhm/sec_tabselect.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/coreinhm/sec_tabselect.asm
new file mode 100644
index 00000000000..e4360341d93
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/coreinhm/sec_tabselect.asm
@@ -0,0 +1,37 @@
+dnl X86-64 mpn_sec_tabselect.
+
+dnl Copyright 2012, 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')
+
+ABI_SUPPORT(DOS64)
+ABI_SUPPORT(STD64)
+
+MULFUNC_PROLOGUE(mpn_sec_tabselect)
+include_mpn(`x86_64/fastsse/sec_tabselect.asm')
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/coreisbr/addmul_2.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/coreisbr/addmul_2.asm
new file mode 100644
index 00000000000..21f0bf465f6
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/coreisbr/addmul_2.asm
@@ -0,0 +1,224 @@
+dnl AMD64 mpn_addmul_2 optimised for Intel Sandy Bridge.
+
+dnl Contributed to the GNU project by Torbjörn Granlund.
+
+dnl Copyright 2003-2005, 2007, 2008, 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/limb best
+C AMD K8,K9
+C AMD K10
+C AMD bull
+C AMD pile
+C AMD bobcat
+C AMD jaguar
+C Intel P4
+C Intel core
+C Intel NHM
+C Intel SBR 2.93 this
+C Intel IBR 2.66 this
+C Intel HWL 2.5 2.15
+C Intel BWL
+C Intel atom
+C VIA nano
+
+C This code is the result of running a code generation and optimisation tool
+C suite written by David Harvey and Torbjorn Granlund.
+
+C When playing with pointers, set this to $2 to fall back to conservative
+C indexing in wind-down code.
+define(`I',`$1')
+
+
+define(`rp', `%rdi') C rcx
+define(`up', `%rsi') C rdx
+define(`n_param', `%rdx') C r8
+define(`vp', `%rcx') C r9
+
+define(`n', `%rcx')
+define(`v0', `%rbx')
+define(`v1', `%rbp')
+define(`w0', `%r8')
+define(`w1', `%r9')
+define(`w2', `%r10')
+define(`w3', `%r11')
+define(`X0', `%r12')
+define(`X1', `%r13')
+
+ABI_SUPPORT(DOS64)
+ABI_SUPPORT(STD64)
+
+ASM_START()
+ TEXT
+ ALIGN(32)
+PROLOGUE(mpn_addmul_2)
+ FUNC_ENTRY(4)
+ push %rbx
+ push %rbp
+ push %r12
+ push %r13
+
+ mov (vp), v0
+ mov 8(vp), v1
+
+ mov (up), %rax
+
+ mov n_param, n
+ neg n
+
+ lea (up,n_param,8), up
+ lea 8(rp,n_param,8), rp
+ mul v0
+
+ test $1, R8(n)
+ jnz L(bx1)
+
+L(bx0): mov -8(rp,n,8), X0
+ mov %rdx, w1
+ add %rax, X0
+ adc $0, w1
+ mov (up,n,8), %rax
+ xor w0, w0
+ xor w3, w3
+ test $2, R8(n)
+ jnz L(b10)
+
+L(b00): nop C this nop make loop go faster on SBR!
+ mul v1
+ mov (rp,n,8), X1
+ jmp L(lo0)
+
+L(b10): lea -2(n), n
+ jmp L(lo2)
+
+L(bx1): mov -8(rp,n,8), X1
+ mov %rdx, w3
+ add %rax, X1
+ adc $0, w3
+ mov (up,n,8), %rax
+ xor w1, w1
+ xor w2, w2
+ test $2, R8(n)
+ jz L(b11)
+
+L(b01): mov (rp,n,8), X0
+ inc n
+ jmp L(lo1)
+
+L(b11): dec n
+ jmp L(lo3)
+
+ ALIGN(32)
+L(top):
+L(lo1): mul v1
+ mov %rdx, w0 C 1
+ add %rax, X0 C 0
+ adc $0, w0 C 1
+ add w1, X1 C 3
+ adc $0, w3 C 0
+ add w2, X0 C 0
+ adc $0, w0 C 1
+ mov (up,n,8), %rax
+ mul v0
+ add %rax, X0 C 0
+ mov %rdx, w1 C 1
+ adc $0, w1 C 1
+ mov (up,n,8), %rax
+ mul v1
+ mov X1, -16(rp,n,8) C 3
+ mov (rp,n,8), X1 C 1
+ add w3, X0 C 0
+ adc $0, w1 C 1
+L(lo0): mov %rdx, w2 C 2
+ mov X0, -8(rp,n,8) C 0
+ add %rax, X1 C 1
+ adc $0, w2 C 2
+ mov 8(up,n,8), %rax
+ add w0, X1 C 1
+ adc $0, w2 C 2
+ mul v0
+ add %rax, X1 C 1
+ mov %rdx, w3 C 2
+ adc $0, w3 C 2
+ mov 8(up,n,8), %rax
+L(lo3): mul v1
+ add w1, X1 C 1
+ mov 8(rp,n,8), X0 C 2
+ adc $0, w3 C 2
+ mov %rdx, w0 C 3
+ add %rax, X0 C 2
+ adc $0, w0 C 3
+ mov 16(up,n,8), %rax
+ mul v0
+ add w2, X0 C 2
+ mov X1, (rp,n,8) C 1
+ mov %rdx, w1 C 3
+ adc $0, w0 C 3
+ add %rax, X0 C 2
+ adc $0, w1 C 3
+ mov 16(up,n,8), %rax
+ add w3, X0 C 2
+ adc $0, w1 C 3
+L(lo2): mul v1
+ mov 16(rp,n,8), X1 C 3
+ add %rax, X1 C 3
+ mov %rdx, w2 C 4
+ adc $0, w2 C 4
+ mov 24(up,n,8), %rax
+ mov X0, 8(rp,n,8) C 2
+ mul v0
+ add w0, X1 C 3
+ mov %rdx, w3 C 4
+ adc $0, w2 C 4
+ add %rax, X1 C 3
+ mov 24(up,n,8), %rax
+ mov 24(rp,n,8), X0 C 0 useless but harmless final read
+ adc $0, w3 C 4
+ add $4, n
+ jnc L(top)
+
+L(end): mul v1
+ add w1, X1
+ adc $0, w3
+ add w2, %rax
+ adc $0, %rdx
+ mov X1, I(-16(rp),-16(rp,n,8))
+ add w3, %rax
+ adc $0, %rdx
+ mov %rax, I(-8(rp),-8(rp,n,8))
+ mov %rdx, %rax
+
+ pop %r13
+ pop %r12
+ pop %rbp
+ pop %rbx
+ FUNC_EXIT()
+ ret
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/coreisbr/aorrlsh1_n.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/coreisbr/aorrlsh1_n.asm
new file mode 100644
index 00000000000..2319a800607
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/coreisbr/aorrlsh1_n.asm
@@ -0,0 +1,54 @@
+dnl AMD64 mpn_addlsh1_n -- rp[] = up[] + (vp[] << 1)
+dnl AMD64 mpn_rsblsh1_n -- rp[] = (vp[] << 1) - up[]
+
+dnl Contributed to the GNU project by Torbjorn Granlund.
+
+dnl Copyright 2008, 2010-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')
+
+define(LSH, 1)
+define(RSH, 63)
+
+ifdef(`OPERATION_addlsh1_n', `
+ define(ADDSUB, add)
+ define(ADCSBB, adc)
+ define(func_n, mpn_addlsh1_n)
+ define(func_nc, mpn_addlsh1_nc)')
+ifdef(`OPERATION_rsblsh1_n', `
+ define(ADDSUB, sub)
+ define(ADCSBB, sbb)
+ define(func_n, mpn_rsblsh1_n)
+ define(func_nc, mpn_rsblsh1_nc)')
+
+ABI_SUPPORT(DOS64)
+ABI_SUPPORT(STD64)
+
+MULFUNC_PROLOGUE(mpn_addlsh1_n mpn_addlsh1_nc mpn_rsblsh1_n mpn_rsblsh1_nc)
+include_mpn(`x86_64/coreisbr/aorrlshC_n.asm')
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/coreisbr/aorrlsh2_n.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/coreisbr/aorrlsh2_n.asm
new file mode 100644
index 00000000000..9416d5a1645
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/coreisbr/aorrlsh2_n.asm
@@ -0,0 +1,56 @@
+dnl AMD64 mpn_addlsh2_n -- rp[] = up[] + (vp[] << 1)
+dnl AMD64 mpn_rsblsh2_n -- rp[] = (vp[] << 1) - up[]
+
+dnl Contributed to the GNU project by Torbjorn Granlund.
+
+dnl Copyright 2008, 2010-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')
+
+define(LSH, 2)
+define(RSH, 62)
+
+ifdef(`OPERATION_addlsh2_n', `
+ define(ADDSUB, add)
+ define(ADCSBB, adc)
+ define(func_n, mpn_addlsh2_n)
+ define(func_nc, mpn_addlsh2_nc)')
+ifdef(`OPERATION_rsblsh2_n', `
+ define(ADDSUB, sub)
+ define(ADCSBB, sbb)
+ define(func_n, mpn_rsblsh2_n)
+ define(func_nc, mpn_rsblsh2_nc)')
+
+ABI_SUPPORT(DOS64)
+ABI_SUPPORT(STD64)
+
+C mpn_rsblsh2_nc removed below, its idea of carry-in is inconsistent with
+C refmpn_rsblsh2_nc
+MULFUNC_PROLOGUE(mpn_addlsh2_n mpn_addlsh2_nc mpn_rsblsh2_n)
+include_mpn(`x86_64/coreisbr/aorrlshC_n.asm')
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/coreisbr/aorrlshC_n.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/coreisbr/aorrlshC_n.asm
new file mode 100644
index 00000000000..23ace418895
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/coreisbr/aorrlshC_n.asm
@@ -0,0 +1,173 @@
+dnl AMD64 mpn_addlshC_n -- rp[] = up[] + (vp[] << C)
+dnl AMD64 mpn_rsblshC_n -- rp[] = (vp[] << C) - up[]
+
+dnl Copyright 2009-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/.
+
+
+C cycles/limb
+C AMD K8,K9 ?
+C AMD K10 ?
+C Intel P4 ?
+C Intel core2 3.25
+C Intel NHM 4
+C Intel SBR 2 C (or 1.95 when L(top)'s alignment = 16 (mod 32))
+C Intel atom ?
+C VIA nano ?
+
+C This code probably runs close to optimally on Sandy Bridge (using 4-way
+C unrolling). It also runs reasonably well on Core 2, but it runs poorly on
+C all other processors, including Nehalem.
+
+C INPUT PARAMETERS
+define(`rp', `%rdi')
+define(`up', `%rsi')
+define(`vp', `%rdx')
+define(`n', `%rcx')
+define(`cy', `%r8')
+
+ABI_SUPPORT(DOS64)
+ABI_SUPPORT(STD64)
+
+ASM_START()
+ TEXT
+ ALIGN(16)
+PROLOGUE(func_nc)
+ FUNC_ENTRY(4)
+IFDOS(` mov 56(%rsp), %r8 ')
+ push %rbp
+ mov cy, %rax
+ neg %rax C set msb on carry
+ xor R32(%rbp), R32(%rbp) C limb carry
+ mov (vp), %r8
+ shrd $RSH, %r8, %rbp
+ mov R32(n), R32(%r9)
+ and $3, R32(%r9)
+ je L(b00)
+ cmp $2, R32(%r9)
+ jc L(b01)
+ je L(b10)
+ jmp L(b11)
+EPILOGUE()
+
+ ALIGN(16)
+PROLOGUE(func_n)
+ FUNC_ENTRY(4)
+ push %rbp
+ xor R32(%rbp), R32(%rbp) C limb carry
+ mov (vp), %r8
+ shrd $RSH, %r8, %rbp
+ mov R32(n), R32(%rax)
+ and $3, R32(%rax)
+ je L(b00)
+ cmp $2, R32(%rax)
+ jc L(b01)
+ je L(b10)
+
+L(b11): mov 8(vp), %r9
+ shrd $RSH, %r9, %r8
+ mov 16(vp), %r10
+ shrd $RSH, %r10, %r9
+ add R32(%rax), R32(%rax) C init carry flag
+ ADCSBB (up), %rbp
+ ADCSBB 8(up), %r8
+ ADCSBB 16(up), %r9
+ mov %rbp, (rp)
+ mov %r8, 8(rp)
+ mov %r9, 16(rp)
+ mov %r10, %rbp
+ lea 24(up), up
+ lea 24(vp), vp
+ lea 24(rp), rp
+ sbb R32(%rax), R32(%rax) C save carry flag
+ sub $3, n
+ ja L(top)
+ jmp L(end)
+
+L(b01): add R32(%rax), R32(%rax) C init carry flag
+ ADCSBB (up), %rbp
+ mov %rbp, (rp)
+ mov %r8, %rbp
+ lea 8(up), up
+ lea 8(vp), vp
+ lea 8(rp), rp
+ sbb R32(%rax), R32(%rax) C save carry flag
+ sub $1, n
+ ja L(top)
+ jmp L(end)
+
+L(b10): mov 8(vp), %r9
+ shrd $RSH, %r9, %r8
+ add R32(%rax), R32(%rax) C init carry flag
+ ADCSBB (up), %rbp
+ ADCSBB 8(up), %r8
+ mov %rbp, (rp)
+ mov %r8, 8(rp)
+ mov %r9, %rbp
+ lea 16(up), up
+ lea 16(vp), vp
+ lea 16(rp), rp
+ sbb R32(%rax), R32(%rax) C save carry flag
+ sub $2, n
+ ja L(top)
+ jmp L(end)
+
+ ALIGN(16)
+L(top): mov (vp), %r8
+ shrd $RSH, %r8, %rbp
+L(b00): mov 8(vp), %r9
+ shrd $RSH, %r9, %r8
+ mov 16(vp), %r10
+ shrd $RSH, %r10, %r9
+ mov 24(vp), %r11
+ shrd $RSH, %r11, %r10
+ lea 32(vp), vp
+ add R32(%rax), R32(%rax) C restore carry flag
+ ADCSBB (up), %rbp
+ ADCSBB 8(up), %r8
+ ADCSBB 16(up), %r9
+ ADCSBB 24(up), %r10
+ lea 32(up), up
+ mov %rbp, (rp)
+ mov %r8, 8(rp)
+ mov %r9, 16(rp)
+ mov %r10, 24(rp)
+ mov %r11, %rbp
+ lea 32(rp), rp
+ sbb R32(%rax), R32(%rax) C save carry flag
+ sub $4, n
+ jnz L(top)
+
+L(end): shr $RSH, %rbp
+ add R32(%rax), R32(%rax) C restore carry flag
+ ADCSBB $0, %rbp
+ mov %rbp, %rax
+ pop %rbp
+ FUNC_EXIT()
+ ret
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/coreisbr/aorrlsh_n.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/coreisbr/aorrlsh_n.asm
new file mode 100644
index 00000000000..db8ee688496
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/coreisbr/aorrlsh_n.asm
@@ -0,0 +1,215 @@
+dnl AMD64 mpn_addlsh_n -- rp[] = up[] + (vp[] << k)
+dnl AMD64 mpn_rsblsh_n -- rp[] = (vp[] << k) - up[]
+dnl Optimised for Sandy Bridge.
+
+dnl Contributed to the GNU project by Torbjorn Granlund.
+
+dnl Copyright 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/limb
+C AMD K8,K9 ?
+C AMD K10 5.25
+C Intel P4 ?
+C Intel core2 3.1
+C Intel NHM 3.95
+C Intel SBR 2.75
+C Intel atom ?
+C VIA nano ?
+
+C The inner-loop probably runs close to optimally on Sandy Bridge (using 4-way
+C unrolling). The rest of the code is quite crude, and could perhaps be made
+C both smaller and faster.
+
+C INPUT PARAMETERS
+define(`rp', `%rdi')
+define(`up', `%rsi')
+define(`vp', `%rdx')
+define(`n', `%rcx')
+define(`cnt', `%r8')
+define(`cy', `%r9') C for _nc variant
+
+ifdef(`OPERATION_addlsh_n', `
+ define(ADDSUB, add)
+ define(ADCSBB, adc)
+ define(IFRSB, )
+ define(func_n, mpn_addlsh_n)
+ define(func_nc, mpn_addlsh_nc)')
+ifdef(`OPERATION_rsblsh_n', `
+ define(ADDSUB, sub)
+ define(ADCSBB, sbb)
+ define(IFRSB, `$1')
+ define(func_n, mpn_rsblsh_n)
+ define(func_nc, mpn_rsblsh_nc)')
+
+ABI_SUPPORT(DOS64)
+ABI_SUPPORT(STD64)
+
+C mpn_rsblsh_nc removed below, its idea of carry-in is inconsistent with
+C refmpn_rsblsh_nc
+MULFUNC_PROLOGUE(mpn_addlsh_n mpn_addlsh_nc mpn_rsblsh_n)
+
+ASM_START()
+ TEXT
+ ALIGN(32)
+PROLOGUE(func_n)
+ FUNC_ENTRY(4)
+IFDOS(` mov 56(%rsp), %r8d ') C cnt
+ push %rbx
+ xor R32(%rbx), R32(%rbx) C clear CF save register
+L(ent): push %rbp
+ mov R32(n), R32(%rbp)
+ mov n, %rax
+ mov R32(cnt), R32(%rcx)
+ neg R32(%rcx)
+ and $3, R32(%rbp)
+ jz L(b0)
+ lea -32(vp,%rbp,8), vp
+ lea -32(up,%rbp,8), up
+ lea -32(rp,%rbp,8), rp
+ cmp $2, R32(%rbp)
+ jc L(b1)
+ jz L(b2)
+
+L(b3): xor %r8, %r8
+ mov 8(vp), %r9
+ mov 16(vp), %r10
+ shrd R8(%rcx), %r9, %r8
+ shrd R8(%rcx), %r10, %r9
+ mov 24(vp), %r11
+ shrd R8(%rcx), %r11, %r10
+ sub $3, %rax
+ jz L(3)
+ add R32(%rbx), R32(%rbx)
+ lea 32(vp), vp
+ ADCSBB 8(up), %r8
+ ADCSBB 16(up), %r9
+ ADCSBB 24(up), %r10
+ lea 32(up), up
+ jmp L(lo3)
+L(3): add R32(%rbx), R32(%rbx)
+ lea 32(vp), vp
+ ADCSBB 8(up), %r8
+ ADCSBB 16(up), %r9
+ ADCSBB 24(up), %r10
+ jmp L(wd3)
+
+L(b0): mov (vp), %r8
+ mov 8(vp), %r9
+ xor R32(%rbp), R32(%rbp)
+ jmp L(lo0)
+
+L(b1): xor %r10, %r10
+ mov 24(vp), %r11
+ shrd R8(%rcx), %r11, %r10
+ sub $1, %rax
+ jz L(1)
+ add R32(%rbx), R32(%rbx)
+ lea 32(vp), vp
+ ADCSBB 24(up), %r10
+ lea 32(up), up
+ mov (vp), %r8
+ jmp L(lo1)
+L(1): add R32(%rbx), R32(%rbx)
+ ADCSBB 24(up), %r10
+ jmp L(wd1)
+
+L(b2): xor %r9, %r9
+ mov 16(vp), %r10
+ shrd R8(%rcx), %r10, %r9
+ mov 24(vp), %r11
+ shrd R8(%rcx), %r11, %r10
+ sub $2, %rax
+ jz L(2)
+ add R32(%rbx), R32(%rbx)
+ lea 32(vp), vp
+ ADCSBB 16(up), %r9
+ ADCSBB 24(up), %r10
+ lea 32(up), up
+ jmp L(lo2)
+L(2): add R32(%rbx), R32(%rbx)
+ ADCSBB 16(up), %r9
+ ADCSBB 24(up), %r10
+ jmp L(wd2)
+
+ ALIGN(32) C 16-byte alignment is not enough!
+L(top): shrd R8(%rcx), %r11, %r10
+ add R32(%rbx), R32(%rbx)
+ lea 32(vp), vp
+ ADCSBB (up), %rbp
+ ADCSBB 8(up), %r8
+ ADCSBB 16(up), %r9
+ ADCSBB 24(up), %r10
+ mov %rbp, (rp)
+ lea 32(up), up
+L(lo3): mov %r8, 8(rp)
+L(lo2): mov %r9, 16(rp)
+ mov (vp), %r8
+L(lo1): mov %r10, 24(rp)
+ mov 8(vp), %r9
+ mov %r11, %rbp
+ lea 32(rp), rp
+ sbb R32(%rbx), R32(%rbx)
+L(lo0): shrd R8(%rcx), %r8, %rbp
+ mov 16(vp), %r10
+ shrd R8(%rcx), %r9, %r8
+ shrd R8(%rcx), %r10, %r9
+ mov 24(vp), %r11
+ sub $4, %rax
+ jg L(top)
+
+ shrd R8(%rcx), %r11, %r10
+ add R32(%rbx), R32(%rbx)
+ ADCSBB (up), %rbp
+ ADCSBB 8(up), %r8
+ ADCSBB 16(up), %r9
+ ADCSBB 24(up), %r10
+ mov %rbp, (rp)
+L(wd3): mov %r8, 8(rp)
+L(wd2): mov %r9, 16(rp)
+L(wd1): mov %r10, 24(rp)
+ adc R32(%rax), R32(%rax) C rax is zero after loop
+ shr R8(%rcx), %r11
+ ADDSUB %r11, %rax
+IFRSB( neg %rax)
+ pop %rbp
+ pop %rbx
+ FUNC_EXIT()
+ ret
+EPILOGUE()
+PROLOGUE(func_nc)
+ FUNC_ENTRY(4)
+IFDOS(` mov 56(%rsp), %r8d ') C cnt
+IFDOS(` mov 64(%rsp), %r9 ') C cy
+ push %rbx
+ neg cy
+ sbb R32(%rbx), R32(%rbx) C initialise CF save register
+ jmp L(ent)
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/coreisbr/aors_n.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/coreisbr/aors_n.asm
new file mode 100644
index 00000000000..01abf78a0d8
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/coreisbr/aors_n.asm
@@ -0,0 +1,198 @@
+dnl AMD64 mpn_add_n, mpn_sub_n optimised for Sandy bridge, Ivy bridge, and
+dnl Haswell.
+
+dnl Contributed to the GNU project by Torbjörn Granlund.
+
+dnl Copyright 2003-2005, 2007, 2008, 2010-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/limb
+C AMD K8,K9
+C AMD K10
+C AMD bull 1.82 average over 400-600
+C AMD pile 1.83 average over 400-600
+C AMD bobcat
+C AMD jaguar
+C Intel P4
+C Intel core
+C Intel NHM
+C Intel SBR 1.55 fluctuates
+C Intel IBR 1.55 fluctuates
+C Intel HWL 1.33 fluctuates
+C Intel BWL
+C Intel atom
+C VIA nano
+
+C The loop of this code was manually written. It runs close to optimally on
+C Intel SBR, IBR, and HWL far as we know, except for the fluctuation problems.
+C It also runs slightly faster on average on AMD bull and pile.
+C
+C No micro-optimisation has been done.
+C
+C N.B.! The loop alignment padding insns are executed. If editing the code,
+C make sure the padding does not become excessive. It is now a 4-byte nop.
+
+define(`rp', `%rdi') C rcx
+define(`up', `%rsi') C rdx
+define(`vp', `%rdx') C r8
+define(`n', `%rcx') C r9
+define(`cy', `%r8') C rsp+40 (mpn_add_nc and mpn_sub_nc)
+
+ifdef(`OPERATION_add_n', `
+ define(ADCSBB, adc)
+ define(func, mpn_add_n)
+ define(func_nc, mpn_add_nc)')
+ifdef(`OPERATION_sub_n', `
+ define(ADCSBB, sbb)
+ define(func, mpn_sub_n)
+ define(func_nc, mpn_sub_nc)')
+
+MULFUNC_PROLOGUE(mpn_add_n mpn_add_nc mpn_sub_n mpn_sub_nc)
+
+ABI_SUPPORT(DOS64)
+ABI_SUPPORT(STD64)
+
+ASM_START()
+ TEXT
+ ALIGN(32)
+PROLOGUE(func)
+ FUNC_ENTRY(4)
+ xor %r8, %r8
+
+L(ent): mov R32(n), R32(%rax)
+ shr $2, n
+
+ test $1, R8(%rax)
+ jnz L(bx1)
+
+L(bx0): test $2, R8(%rax)
+ jnz L(b10)
+
+L(b00): neg %r8
+ mov (up), %r8
+ mov 8(up), %r9
+ ADCSBB (vp), %r8
+ ADCSBB 8(vp), %r9
+ mov 16(up), %r10
+ mov 24(up), %r11
+ lea 32(up), up
+ ADCSBB 16(vp), %r10
+ ADCSBB 24(vp), %r11
+ lea 32(vp), vp
+ lea -16(rp), rp
+ jmp L(lo0)
+
+L(b10): neg %r8
+ mov (up), %r10
+ mov 8(up), %r11
+ ADCSBB 0(vp), %r10
+ ADCSBB 8(vp), %r11
+ jrcxz L(e2)
+ mov 16(up), %r8
+ mov 24(up), %r9
+ lea 16(up), up
+ ADCSBB 16(vp), %r8
+ ADCSBB 24(vp), %r9
+ lea 16(vp), vp
+ lea (rp), rp
+ jmp L(lo2)
+
+L(e2): mov %r10, (rp)
+ mov %r11, 8(rp)
+ setc R8(%rax)
+ FUNC_EXIT()
+ ret
+
+L(bx1): test $2, R8(%rax)
+ jnz L(b11)
+
+L(b01): neg %r8
+ mov (up), %r11
+ ADCSBB (vp), %r11
+ jrcxz L(e1)
+ mov 8(up), %r8
+ mov 16(up), %r9
+ lea 8(up), up
+ lea -8(rp), rp
+ ADCSBB 8(vp), %r8
+ ADCSBB 16(vp), %r9
+ lea 8(vp), vp
+ jmp L(lo1)
+
+L(e1): mov %r11, (rp)
+ setc R8(%rax)
+ FUNC_EXIT()
+ ret
+
+L(b11): neg %r8
+ mov (up), %r9
+ ADCSBB (vp), %r9
+ mov 8(up), %r10
+ mov 16(up), %r11
+ lea 24(up), up
+ ADCSBB 8(vp), %r10
+ ADCSBB 16(vp), %r11
+ lea 24(vp), vp
+ mov %r9, (rp)
+ lea 8(rp), rp
+ jrcxz L(end)
+
+ ALIGN(32)
+L(top): mov (up), %r8
+ mov 8(up), %r9
+ ADCSBB (vp), %r8
+ ADCSBB 8(vp), %r9
+L(lo2): mov %r10, (rp)
+L(lo1): mov %r11, 8(rp)
+ mov 16(up), %r10
+ mov 24(up), %r11
+ lea 32(up), up
+ ADCSBB 16(vp), %r10
+ ADCSBB 24(vp), %r11
+ lea 32(vp), vp
+L(lo0): mov %r8, 16(rp)
+L(lo3): mov %r9, 24(rp)
+ lea 32(rp), rp
+ dec n
+ jnz L(top)
+
+L(end): mov R32(n), R32(%rax) C zero rax
+ mov %r10, (rp)
+ mov %r11, 8(rp)
+ setc R8(%rax)
+ FUNC_EXIT()
+ ret
+EPILOGUE()
+ ALIGN(16)
+PROLOGUE(func_nc)
+ FUNC_ENTRY(4)
+IFDOS(` mov 56(%rsp), %r8 ')
+ jmp L(ent)
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/coreisbr/aorsmul_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/coreisbr/aorsmul_1.asm
new file mode 100644
index 00000000000..9f01d9c0612
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/coreisbr/aorsmul_1.asm
@@ -0,0 +1,209 @@
+dnl X86-64 mpn_addmul_1 and mpn_submul_1 optimised for Intel Sandy Bridge.
+
+dnl Contributed to the GNU project by Torbjörn Granlund.
+
+dnl Copyright 2003-2005, 2007, 2008, 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/limb
+C AMD K8,K9
+C AMD K10
+C AMD bull
+C AMD pile
+C AMD steam
+C AMD bobcat
+C AMD jaguar
+C Intel P4
+C Intel core
+C Intel NHM
+C Intel SBR 3.24 (average, fluctuating in 3.20-3.57)
+C Intel IBR 3.04
+C Intel HWL
+C Intel BWL
+C Intel atom
+C VIA nano
+
+C The loop of this code is the result of running a code generation and
+C optimization tool suite written by David Harvey and Torbjörn Granlund.
+
+define(`rp', `%rdi') C rcx
+define(`up', `%rsi') C rdx
+define(`n_param', `%rdx') C r8
+define(`v0', `%rcx') C r9
+
+define(`n', `%rbx')
+
+define(`I',`$1')
+
+ifdef(`OPERATION_addmul_1',`
+ define(`ADDSUB', `add')
+ define(`func', `mpn_addmul_1')
+')
+ifdef(`OPERATION_submul_1',`
+ define(`ADDSUB', `sub')
+ define(`func', `mpn_submul_1')
+')
+
+ABI_SUPPORT(DOS64)
+ABI_SUPPORT(STD64)
+
+MULFUNC_PROLOGUE(mpn_addmul_1 mpn_submul_1)
+
+IFDOS(` define(`up', ``%rsi'')') dnl
+IFDOS(` define(`rp', ``%rcx'')') dnl
+IFDOS(` define(`v0', ``%r9'')') dnl
+IFDOS(` define(`r9', ``rdi'')') dnl
+IFDOS(` define(`n_param',``%r8'')') dnl
+
+ASM_START()
+ TEXT
+ ALIGN(32)
+PROLOGUE(func)
+
+IFDOS(``push %rsi '')
+IFDOS(``push %rdi '')
+IFDOS(``mov %rdx, %rsi '')
+
+ mov (up), %rax
+ push %rbx
+ lea (up,n_param,8), up
+ lea (rp,n_param,8), rp
+
+ test $1, R8(n_param)
+ jnz L(b13)
+
+L(b02): xor R32(%r11), R32(%r11)
+ test $2, R8(n_param)
+ jnz L(b2)
+
+L(b0): mov $1, R32(n)
+ sub n_param, n
+ mul v0
+ mov %rdx, %r9
+ mov -8(rp,n,8), %r8
+ jmp L(e0)
+
+ ALIGN(16)
+L(b2): mov $-1, n
+ sub n_param, n
+ mul v0
+ mov 8(rp,n,8), %r8
+ mov %rdx, %r9
+ jmp L(e2)
+
+ ALIGN(16)
+L(b13): xor R32(%r9), R32(%r9)
+ test $2, R8(n_param)
+ jnz L(b3)
+
+L(b1): mov $2, R32(n)
+ sub n_param, n
+ jns L(1)
+ mul v0
+ mov -16(rp,n,8), %r10
+ mov %rdx, %r11
+ jmp L(e1)
+
+ ALIGN(16)
+L(b3): xor R32(n), R32(n)
+ sub n_param, n
+ mul v0
+ mov (rp,n,8), %r10
+ jmp L(e3)
+
+ ALIGN(32)
+L(top): mul v0
+ mov -16(rp,n,8), %r10
+ ADDSUB %r11, %r8
+ mov %rdx, %r11
+ adc $0, %r9
+ mov %r8, -24(rp,n,8)
+L(e1): ADDSUB %rax, %r10
+ mov -8(up,n,8), %rax
+ adc $0, %r11
+ mul v0
+ ADDSUB %r9, %r10
+ mov %rdx, %r9
+ mov -8(rp,n,8), %r8
+ adc $0, %r11
+ mov %r10, -16(rp,n,8)
+L(e0): ADDSUB %rax, %r8
+ adc $0, %r9
+ mov (up,n,8), %rax
+ mul v0
+ mov (rp,n,8), %r10
+ ADDSUB %r11, %r8
+ mov %r8, -8(rp,n,8)
+ adc $0, %r9
+L(e3): mov %rdx, %r11
+ ADDSUB %rax, %r10
+ mov 8(up,n,8), %rax
+ adc $0, %r11
+ mul v0
+ mov 8(rp,n,8), %r8
+ ADDSUB %r9, %r10
+ mov %rdx, %r9
+ mov %r10, (rp,n,8)
+ adc $0, %r11
+L(e2): ADDSUB %rax, %r8
+ adc $0, %r9
+ mov 16(up,n,8), %rax
+ add $4, n
+ jnc L(top)
+
+L(end): mul v0
+ mov I(-8(rp),-16(rp,n,8)), %r10
+ ADDSUB %r11, %r8
+ mov %rdx, %r11
+ adc $0, %r9
+ mov %r8, I(-16(rp),-24(rp,n,8))
+ ADDSUB %rax, %r10
+ adc $0, %r11
+ ADDSUB %r9, %r10
+ adc $0, %r11
+ mov %r10, I(-8(rp),-16(rp,n,8))
+ mov %r11, %rax
+
+ pop %rbx
+IFDOS(``pop %rdi '')
+IFDOS(``pop %rsi '')
+ ret
+
+ ALIGN(16)
+L(1): mul v0
+ ADDSUB %rax, -8(rp)
+ mov %rdx, %rax
+ adc $0, %rax
+ pop %rbx
+IFDOS(``pop %rdi '')
+IFDOS(``pop %rsi '')
+ ret
+EPILOGUE()
+ASM_END()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/coreisbr/divrem_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/coreisbr/divrem_1.asm
new file mode 100644
index 00000000000..d9f371f7852
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/coreisbr/divrem_1.asm
@@ -0,0 +1,37 @@
+dnl X86-64 mpn_divrem_1
+
+dnl Copyright 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')
+
+ABI_SUPPORT(DOS64)
+ABI_SUPPORT(STD64)
+
+MULFUNC_PROLOGUE(mpn_divrem_1 mpn_preinv_divrem_1)
+include_mpn(`x86_64/divrem_1.asm')
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/coreisbr/gmp-mparam.h b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/coreisbr/gmp-mparam.h
new file mode 100644
index 00000000000..3a91b4c30e4
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/coreisbr/gmp-mparam.h
@@ -0,0 +1,224 @@
+/* Sandy Bridge gmp-mparam.h -- Compiler/machine parameter header file.
+
+Copyright 1991, 1993, 1994, 2000-2014 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
+
+/* 3300 MHz Core i5 Sandy Bridge */
+/* FFT tuning limit = 100000000 */
+/* Generated by tuneup.c, 2014-03-12, gcc 4.5 */
+
+#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 3
+#define MOD_1_1_TO_MOD_1_2_THRESHOLD 9
+#define MOD_1_2_TO_MOD_1_4_THRESHOLD 20
+#define PREINV_MOD_1_TO_MOD_1_THRESHOLD 10
+#define USE_PREINV_DIVREM_1 1 /* native */
+#define DIV_QR_1_NORM_THRESHOLD 1
+#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 30
+
+#define MUL_TOOM22_THRESHOLD 20
+#define MUL_TOOM33_THRESHOLD 65
+#define MUL_TOOM44_THRESHOLD 166
+#define MUL_TOOM6H_THRESHOLD 254
+#define MUL_TOOM8H_THRESHOLD 333
+
+#define MUL_TOOM32_TO_TOOM43_THRESHOLD 105
+#define MUL_TOOM32_TO_TOOM53_THRESHOLD 122
+#define MUL_TOOM42_TO_TOOM53_THRESHOLD 105
+#define MUL_TOOM42_TO_TOOM63_THRESHOLD 113
+#define MUL_TOOM43_TO_TOOM54_THRESHOLD 148
+
+#define SQR_BASECASE_THRESHOLD 0 /* always (native) */
+#define SQR_TOOM2_THRESHOLD 28
+#define SQR_TOOM3_THRESHOLD 93
+#define SQR_TOOM4_THRESHOLD 250
+#define SQR_TOOM6_THRESHOLD 348
+#define SQR_TOOM8_THRESHOLD 454
+
+#define MULMID_TOOM42_THRESHOLD 36
+
+#define MULMOD_BNM1_THRESHOLD 12
+#define SQRMOD_BNM1_THRESHOLD 15
+
+#define MUL_FFT_MODF_THRESHOLD 380 /* k = 5 */
+#define MUL_FFT_TABLE3 \
+ { { 380, 5}, { 19, 6}, { 10, 5}, { 21, 6}, \
+ { 11, 5}, { 23, 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}, { 39, 9}, { 23, 8}, \
+ { 47, 9}, { 27,10}, { 15, 9}, { 39,10}, \
+ { 23, 9}, { 51,11}, { 15,10}, { 31, 9}, \
+ { 67,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, 9}, { 319,10}, { 167,11}, { 95,10}, \
+ { 191, 9}, { 383, 8}, { 767, 7}, { 1599, 8}, \
+ { 831, 9}, { 447,10}, { 239,12}, { 63,11}, \
+ { 127,10}, { 255,11}, { 143,10}, { 287, 9}, \
+ { 575,12}, { 95,11}, { 191,10}, { 383,11}, \
+ { 207,10}, { 447,13}, { 63,12}, { 127,11}, \
+ { 255,10}, { 511,11}, { 271,10}, { 543, 8}, \
+ { 2175,11}, { 303,12}, { 159,11}, { 319,10}, \
+ { 671,11}, { 367,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}, { 671,12}, { 351,11}, { 703,10}, \
+ { 1407,13}, { 191,12}, { 383,11}, { 767,12}, \
+ { 415,11}, { 831,12}, { 479,14}, { 127,13}, \
+ { 255,12}, { 511,11}, { 1023,12}, { 575,11}, \
+ { 1151,12}, { 607,13}, { 319,12}, { 671,11}, \
+ { 1343,12}, { 703,13}, { 383,12}, { 767,11}, \
+ { 1535,12}, { 831,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}, { 959,14}, \
+ { 511,13}, { 1087,12}, { 2175,13}, { 1215,12}, \
+ { 2431,14}, { 639,13}, { 1343,12}, { 2687,13}, \
+ { 1407,12}, { 2815,13}, { 1471,12}, { 2943,14}, \
+ { 767,13}, { 1663,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}, \
+ { 3071,14}, { 1663,13}, { 3455,14}, { 1919,16}, \
+ { 511,15}, { 1023,14}, { 2431,13}, { 4863,15}, \
+ { 1279,14}, { 2943,13}, { 5887,15}, { 1535,14}, \
+ { 3455,15}, { 1791,14}, { 3839,13}, { 7679,16}, \
+ { 1023,15}, { 2047,14}, { 4223,15}, { 2303,14}, \
+ { 4863,15}, { 2815,14}, { 5887,16}, { 65536,17}, \
+ { 131072,18}, { 262144,19}, { 524288,20}, {1048576,21}, \
+ {2097152,22}, {4194304,23}, {8388608,24} }
+#define MUL_FFT_TABLE3_SIZE 203
+#define MUL_FFT_THRESHOLD 4736
+
+#define SQR_FFT_MODF_THRESHOLD 336 /* k = 5 */
+#define SQR_FFT_TABLE3 \
+ { { 336, 5}, { 11, 4}, { 23, 5}, { 19, 6}, \
+ { 10, 5}, { 21, 6}, { 11, 5}, { 23, 6}, \
+ { 25, 7}, { 13, 6}, { 27, 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}, { 51,11}, { 15,10}, { 31, 9}, \
+ { 63,10}, { 39, 9}, { 79,10}, { 55,11}, \
+ { 31,10}, { 79,11}, { 47,10}, { 95,12}, \
+ { 31,11}, { 63,10}, { 127, 9}, { 255, 8}, \
+ { 511,10}, { 135,11}, { 79, 9}, { 319, 8}, \
+ { 639,11}, { 95,10}, { 191, 9}, { 383,12}, \
+ { 63,11}, { 127,10}, { 255, 9}, { 511,10}, \
+ { 271, 9}, { 543,11}, { 143,10}, { 287, 8}, \
+ { 1151,10}, { 303, 6}, { 4863, 8}, { 1279, 9}, \
+ { 671,11}, { 175,10}, { 367,12}, { 95,11}, \
+ { 191,10}, { 383,11}, { 207, 9}, { 831,10}, \
+ { 447,13}, { 63,12}, { 127,11}, { 255,10}, \
+ { 511,11}, { 271, 9}, { 1087,10}, { 575,11}, \
+ { 303,10}, { 607,11}, { 319,10}, { 671,11}, \
+ { 367,12}, { 191,11}, { 383,10}, { 767,11}, \
+ { 415,12}, { 223,11}, { 447,10}, { 959,12}, \
+ { 255,11}, { 511,10}, { 1023,11}, { 575,10}, \
+ { 1151,11}, { 607,10}, { 1215,12}, { 319,11}, \
+ { 671, 9}, { 2687,12}, { 351,11}, { 703,13}, \
+ { 191,12}, { 415,11}, { 831,12}, { 479,14}, \
+ { 127,13}, { 255,12}, { 511,11}, { 1023,12}, \
+ { 607,13}, { 319,12}, { 671,11}, { 1343,12}, \
+ { 703,13}, { 383,12}, { 831,13}, { 447,12}, \
+ { 959,14}, { 255,13}, { 511,12}, { 1087,13}, \
+ { 575,12}, { 1215,13}, { 639,12}, { 1343,13}, \
+ { 703,14}, { 383,13}, { 767,12}, { 1535,13}, \
+ { 831,12}, { 1663,13}, { 959,14}, { 511,13}, \
+ { 1087,12}, { 2175,13}, { 1215,14}, { 639,13}, \
+ { 1343,12}, { 2687,13}, { 1407,12}, { 2815,14}, \
+ { 767,13}, { 1663,14}, { 895,13}, { 1791,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}, \
+ { 3071,14}, { 1663,13}, { 3455,14}, { 1791,16}, \
+ { 511,15}, { 1023,14}, { 2431,13}, { 4863,15}, \
+ { 1279,14}, { 2943,13}, { 5887,15}, { 1535,14}, \
+ { 3455,15}, { 1791,14}, { 3839,16}, { 1023,15}, \
+ { 2047,14}, { 4223,15}, { 2303,14}, { 4863,15}, \
+ { 2815,14}, { 5887,16}, { 65536,17}, { 131072,18}, \
+ { 262144,19}, { 524288,20}, {1048576,21}, {2097152,22}, \
+ {4194304,23}, {8388608,24} }
+#define SQR_FFT_TABLE3_SIZE 190
+#define SQR_FFT_THRESHOLD 3264
+
+#define MULLO_BASECASE_THRESHOLD 0 /* always */
+#define MULLO_DC_THRESHOLD 62
+#define MULLO_MUL_N_THRESHOLD 8907
+
+#define DC_DIV_QR_THRESHOLD 52
+#define DC_DIVAPPR_Q_THRESHOLD 166
+#define DC_BDIV_QR_THRESHOLD 46
+#define DC_BDIV_Q_THRESHOLD 104
+
+#define INV_MULMOD_BNM1_THRESHOLD 42
+#define INV_NEWTON_THRESHOLD 166
+#define INV_APPR_THRESHOLD 165
+
+#define BINV_NEWTON_THRESHOLD 228
+#define REDC_1_TO_REDC_2_THRESHOLD 32
+#define REDC_2_TO_REDC_N_THRESHOLD 52
+
+#define MU_DIV_QR_THRESHOLD 1334
+#define MU_DIVAPPR_Q_THRESHOLD 1387
+#define MUPI_DIV_QR_THRESHOLD 69
+#define MU_BDIV_QR_THRESHOLD 1187
+#define MU_BDIV_Q_THRESHOLD 1334
+
+#define POWM_SEC_TABLE 3,22,194,452,1167
+
+#define MATRIX22_STRASSEN_THRESHOLD 14
+#define HGCD_THRESHOLD 119
+#define HGCD_APPR_THRESHOLD 51
+#define HGCD_REDUCE_THRESHOLD 2479
+#define GCD_DC_THRESHOLD 478
+#define GCDEXT_DC_THRESHOLD 368
+#define JACOBI_BASE_METHOD 4
+
+#define GET_STR_DC_THRESHOLD 14
+#define GET_STR_PRECOMPUTE_THRESHOLD 22
+#define SET_STR_DC_THRESHOLD 802
+#define SET_STR_PRECOMPUTE_THRESHOLD 2042
+
+#define FAC_DSC_THRESHOLD 644
+#define FAC_ODD_THRESHOLD 24
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/coreisbr/lshift.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/coreisbr/lshift.asm
new file mode 100644
index 00000000000..a1cbc31f61b
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/coreisbr/lshift.asm
@@ -0,0 +1,37 @@
+dnl X86-64 mpn_lshift optimised for Intel Sandy Bridge.
+
+dnl Copyright 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')
+
+ABI_SUPPORT(DOS64)
+ABI_SUPPORT(STD64)
+
+MULFUNC_PROLOGUE(mpn_lshift)
+include_mpn(`x86_64/fastsse/lshift-movdqu2.asm')
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/coreisbr/lshiftc.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/coreisbr/lshiftc.asm
new file mode 100644
index 00000000000..ac90edb76b0
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/coreisbr/lshiftc.asm
@@ -0,0 +1,37 @@
+dnl X86-64 mpn_lshiftc optimised for Intel Sandy Bridge.
+
+dnl Copyright 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')
+
+ABI_SUPPORT(DOS64)
+ABI_SUPPORT(STD64)
+
+MULFUNC_PROLOGUE(mpn_lshiftc)
+include_mpn(`x86_64/fastsse/lshiftc-movdqu2.asm')
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/coreisbr/mul_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/coreisbr/mul_1.asm
new file mode 100644
index 00000000000..ded7d899c23
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/coreisbr/mul_1.asm
@@ -0,0 +1,161 @@
+dnl X86-64 mpn_mul_1 optimised for Intel Sandy Bridge.
+
+dnl Contributed to the GNU project by Torbjörn Granlund.
+
+dnl Copyright 2003-2005, 2007, 2008, 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/limb
+C AMD K8,K9
+C AMD K10
+C AMD bd1
+C AMD bobcat
+C Intel P4
+C Intel core2
+C Intel NHM
+C Intel SBR 2.5
+C Intel IBR 2.4
+C Intel atom
+C VIA nano
+
+C The loop of this code is the result of running a code generation and
+C optimisation tool suite written by David Harvey and Torbjorn Granlund.
+
+C TODO
+C * The loop is great, but the prologue code was quickly written. Tune it!
+C * Add mul_1c entry point.
+C * We could preserve one less register under DOS64 calling conventions, using
+C r10 instead of rsi.
+
+define(`rp', `%rdi') C rcx
+define(`up', `%rsi') C rdx
+define(`n_param', `%rdx') C r8
+define(`v0', `%rcx') C r9
+
+define(`n', `%r11')
+
+ABI_SUPPORT(DOS64)
+ABI_SUPPORT(STD64)
+
+IFDOS(` define(`up', ``%rsi'')') dnl
+IFDOS(` define(`rp', ``%rcx'')') dnl
+IFDOS(` define(`v0', ``%r9'')') dnl
+IFDOS(` define(`r9', ``rdi'')') dnl
+IFDOS(` define(`n_param',``%r8'')') dnl
+IFDOS(` define(`n', ``%r8'')') dnl
+IFDOS(` define(`r8', ``r11'')') dnl
+
+ASM_START()
+ TEXT
+ ALIGN(16)
+PROLOGUE(mpn_mul_1)
+
+IFDOS(``push %rsi '')
+IFDOS(``push %rdi '')
+IFDOS(``mov %rdx, %rsi '')
+
+ mov (up), %rax
+ mov R32(`n_param'), R32(%r10)
+IFSTD(` mov n_param, n ')
+
+ lea (up,n_param,8), up
+ lea -8(rp,n_param,8), rp
+ neg n
+ mul v0
+ and $3, R32(%r10)
+ jz L(b0)
+ cmp $2, R32(%r10)
+ jb L(b1)
+ jz L(b2)
+
+L(b3): add $-1, n
+ mov %rax, %r9
+ mov %rdx, %r8
+ mov 16(up,n,8), %rax
+ jmp L(L3)
+
+L(b1): mov %rax, %r9
+ mov %rdx, %r8
+ add $1, n
+ jnc L(L1)
+ mov %rax, (rp)
+ mov %rdx, %rax
+IFDOS(``pop %rdi '')
+IFDOS(``pop %rsi '')
+ ret
+
+L(b2): add $-2, n
+ mov %rax, %r8
+ mov %rdx, %r9
+ mov 24(up,n,8), %rax
+ jmp L(L2)
+
+L(b0): mov %rax, %r8
+ mov %rdx, %r9
+ mov 8(up,n,8), %rax
+ jmp L(L0)
+
+ ALIGN(8)
+L(top): mov %rdx, %r8
+ add %rax, %r9
+L(L1): mov 0(up,n,8), %rax
+ adc $0, %r8
+ mul v0
+ add %rax, %r8
+ mov %r9, 0(rp,n,8)
+ mov 8(up,n,8), %rax
+ mov %rdx, %r9
+ adc $0, %r9
+L(L0): mul v0
+ mov %r8, 8(rp,n,8)
+ add %rax, %r9
+ mov %rdx, %r8
+ mov 16(up,n,8), %rax
+ adc $0, %r8
+L(L3): mul v0
+ mov %r9, 16(rp,n,8)
+ mov %rdx, %r9
+ add %rax, %r8
+ mov 24(up,n,8), %rax
+ adc $0, %r9
+L(L2): mul v0
+ mov %r8, 24(rp,n,8)
+ add $4, n
+ jnc L(top)
+
+L(end): add %rax, %r9
+ mov %rdx, %rax
+ adc $0, %rax
+ mov %r9, (rp)
+
+IFDOS(``pop %rdi '')
+IFDOS(``pop %rsi '')
+ ret
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/coreisbr/mul_2.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/coreisbr/mul_2.asm
new file mode 100644
index 00000000000..ffee78a385b
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/coreisbr/mul_2.asm
@@ -0,0 +1,163 @@
+dnl AMD64 mpn_mul_2 optimised for Intel Sandy Bridge.
+
+dnl Contributed to the GNU project by Torbjörn Granlund.
+
+dnl Copyright 2003-2005, 2007, 2008, 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/limb best
+C AMD K8,K9
+C AMD K10
+C AMD bull
+C AMD pile
+C AMD bobcat
+C AMD jaguar
+C Intel P4
+C Intel core
+C Intel NHM
+C Intel SBR 2.57 2.52 using 4-way code
+C Intel IBR 2.35 2.32 using 4-way code
+C Intel HWL 2.02 1.86
+C Intel BWL
+C Intel atom
+C VIA nano
+
+C This code is the result of running a code generation and optimisation tool
+C suite written by David Harvey and Torbjorn Granlund.
+
+C When playing with pointers, set this to $2 to fall back to conservative
+C indexing in wind-down code.
+define(`I',`$1')
+
+define(`rp', `%rdi') C rcx
+define(`up', `%rsi') C rdx
+define(`n_param', `%rdx') C r8
+define(`vp', `%rcx') C r9
+
+define(`n', `%rcx')
+define(`v0', `%rbx')
+define(`v1', `%rbp')
+
+define(`w0', `%r8')
+define(`w1', `%r9')
+define(`w2', `%r10')
+define(`w3', `%r11')
+
+ABI_SUPPORT(DOS64)
+ABI_SUPPORT(STD64)
+
+ASM_START()
+ TEXT
+ ALIGN(32)
+PROLOGUE(mpn_mul_2)
+ FUNC_ENTRY(4)
+ push %rbx
+ push %rbp
+
+ mov (vp), v0
+ mov 8(vp), v1
+
+ mov (up), %rax
+ lea (up,n_param,8), up
+ lea (rp,n_param,8), rp
+
+ test $1, R8(n_param)
+ jnz L(b1)
+
+L(b0): mov $0, R32(n)
+ sub n_param, n
+ xor w0, w0
+ mul v0
+ mov %rax, w2
+ mov %rdx, w1
+ mov (up,n,8), %rax
+ jmp L(lo0)
+
+L(b1): mov $1, R32(n)
+ sub n_param, n
+ xor w2, w2
+ mul v0
+ mov %rax, w0
+ mov %rdx, w3
+ mov -8(up,n,8), %rax
+ mul v1
+ jmp L(lo1)
+
+ ALIGN(32)
+L(top): mul v0
+ add %rax, w0 C 1
+ mov %rdx, w3 C 2
+ adc $0, w3 C 2
+ mov -8(up,n,8), %rax
+ mul v1
+ add w1, w0 C 1
+ adc $0, w3 C 2
+L(lo1): add %rax, w2 C 2
+ mov w0, -8(rp,n,8) C 1
+ mov %rdx, w0 C 3
+ adc $0, w0 C 3
+ mov (up,n,8), %rax
+ mul v0
+ add %rax, w2 C 2
+ mov %rdx, w1 C 3
+ adc $0, w1 C 3
+ add w3, w2 C 2
+ mov (up,n,8), %rax
+ adc $0, w1 C 1
+L(lo0): mul v1
+ mov w2, (rp,n,8) C 2
+ add %rax, w0 C 3
+ mov %rdx, w2 C 4
+ mov 8(up,n,8), %rax
+ adc $0, w2 C 4
+ add $2, n
+ jnc L(top)
+
+L(end): mul v0
+ add %rax, w0
+ mov %rdx, w3
+ adc $0, w3
+ mov I(-8(up),-8(up,n,8)), %rax
+ mul v1
+ add w1, w0
+ adc $0, w3
+ add %rax, w2
+ mov w0, I(-8(rp),-8(rp,n,8))
+ adc $0, %rdx
+ add w3, w2
+ mov w2, I((rp),(rp,n,8))
+ adc $0, %rdx
+ mov %rdx, %rax
+
+ pop %rbp
+ pop %rbx
+ FUNC_EXIT()
+ ret
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/coreisbr/mul_basecase.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/coreisbr/mul_basecase.asm
new file mode 100644
index 00000000000..f026136ea0c
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/coreisbr/mul_basecase.asm
@@ -0,0 +1,407 @@
+dnl AMD64 mpn_mul_basecase optimised for Intel Sandy bridge and Ivy bridge.
+
+dnl Contributed to the GNU project by Torbjörn Granlund.
+
+dnl Copyright 2003-2005, 2007, 2008, 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/limb mul_1 mul_2 mul_3 addmul_2
+C AMD K8,K9
+C AMD K10
+C AMD bull
+C AMD pile
+C AMD steam
+C AMD bobcat
+C AMD jaguar
+C Intel P4
+C Intel core
+C Intel NHM
+C Intel SBR 2.5 2.5 - 2.95
+C Intel IBR 2.4 2.3 - 2.68
+C Intel HWL 2.35 2.0 - 2.5
+C Intel BWL
+C Intel atom
+C VIA nano
+
+C The inner loops of this code are the result of running a code generation and
+C optimisation tool suite written by David Harvey and Torbjorn Granlund.
+
+C TODO
+C * Fix the addmul_2 fluctuation affecting SBR.
+C * Improve feed-in code, avoiding zeroing of many registers and dummy adds in
+C the loops at the expense of code size.
+C * Adjoin a mul_3, avoiding slow mul_1 for odd vn.
+C * Consider replacing the 2-way mul_2 code with 4-way code, for a very slight
+C speedup.
+C * Further micro-optimise.
+
+C When playing with pointers, set this to $2 to fall back to conservative
+C indexing in wind-down code.
+define(`I',`$1')
+
+
+define(`rp', `%rdi')
+define(`up', `%rsi')
+define(`un_param',`%rdx')
+define(`vp', `%rcx')
+define(`vn', `%r8')
+
+define(`un', `%rbx')
+
+define(`w0', `%r10')
+define(`w1', `%r11')
+define(`w2', `%r12')
+define(`w3', `%r13')
+define(`n', `%rbp')
+define(`v0', `%r9')
+
+ABI_SUPPORT(DOS64)
+ABI_SUPPORT(STD64)
+
+ASM_START()
+ TEXT
+ ALIGN(16)
+PROLOGUE(mpn_mul_basecase)
+ FUNC_ENTRY(4)
+IFDOS(` mov 56(%rsp), %r8d ')
+ push %rbx
+ push %rbp
+ mov un_param, un C free up rdx
+ neg un
+
+ mov (up), %rax C shared for mul_1 and mul_2
+ lea (up,un_param,8), up C point at operand end
+ lea (rp,un_param,8), rp C point at rp[un-1]
+
+ mov (vp), v0 C shared for mul_1 and mul_2
+ mul v0 C shared for mul_1 and mul_2
+
+ test $1, R8(vn)
+ jz L(do_mul_2)
+
+L(do_mul_1):
+ test $1, R8(un)
+ jnz L(m1x1)
+
+L(m1x0):mov %rax, w0 C un = 2, 4, 6, 8, ...
+ mov %rdx, w1
+ mov 8(up,un,8), %rax
+ test $2, R8(un)
+ jnz L(m110)
+
+L(m100):lea 2(un), n C un = 4, 8, 12, ...
+ jmp L(m1l0)
+
+L(m110):lea (un), n C un = 2, 6, 10, ...
+ jmp L(m1l2)
+
+L(m1x1):mov %rax, w1 C un = 1, 3, 5, 7, ...
+ mov %rdx, w0
+ test $2, R8(un)
+ jz L(m111)
+
+L(m101):lea 3(un), n C un = 1, 5, 9, ...
+ test n, n
+ js L(m1l1)
+ mov %rax, -8(rp)
+ mov %rdx, (rp)
+ pop %rbp
+ pop %rbx
+ FUNC_EXIT()
+ ret
+
+L(m111):lea 1(un), n C un = 3, 7, 11, ...
+ mov 8(up,un,8), %rax
+ jmp L(m1l3)
+
+ ALIGN(16) C FIXME
+L(m1tp):mov %rdx, w0
+ add %rax, w1
+L(m1l1):mov -16(up,n,8), %rax
+ adc $0, w0
+ mul v0
+ add %rax, w0
+ mov w1, -24(rp,n,8)
+ mov -8(up,n,8), %rax
+ mov %rdx, w1
+ adc $0, w1
+L(m1l0):mul v0
+ mov w0, -16(rp,n,8)
+ add %rax, w1
+ mov %rdx, w0
+ mov (up,n,8), %rax
+ adc $0, w0
+L(m1l3):mul v0
+ mov w1, -8(rp,n,8)
+ mov %rdx, w1
+ add %rax, w0
+ mov 8(up,n,8), %rax
+ adc $0, w1
+L(m1l2):mul v0
+ mov w0, (rp,n,8)
+ add $4, n
+ jnc L(m1tp)
+
+L(m1ed):add %rax, w1
+ adc $0, %rdx
+ mov w1, I(-8(rp),-24(rp,n,8))
+ mov %rdx, I((rp),-16(rp,n,8))
+
+ dec R32(vn)
+ jz L(ret2)
+
+ lea 8(vp), vp
+ lea 8(rp), rp
+ push %r12
+ push %r13
+ push %r14
+ jmp L(do_addmul)
+
+L(do_mul_2):
+define(`v1', `%r14')
+ push %r12
+ push %r13
+ push %r14
+
+ mov 8(vp), v1
+
+ test $1, R8(un)
+ jnz L(m2b1)
+
+L(m2b0):lea (un), n
+ xor w0, w0
+ mov %rax, w2
+ mov %rdx, w1
+ jmp L(m2l0)
+
+L(m2b1):lea 1(un), n
+ xor w1, w1
+ xor w2, w2
+ mov %rax, w0
+ mov %rdx, w3
+ jmp L(m2l1)
+
+ ALIGN(32)
+L(m2tp):mul v0
+ add %rax, w0
+ mov %rdx, w3
+ adc $0, w3
+L(m2l1):mov -8(up,n,8), %rax
+ mul v1
+ add w1, w0
+ adc $0, w3
+ add %rax, w2
+ mov w0, -8(rp,n,8)
+ mov %rdx, w0
+ adc $0, w0
+ mov (up,n,8), %rax
+ mul v0
+ add %rax, w2
+ mov %rdx, w1
+ adc $0, w1
+ add w3, w2
+L(m2l0):mov (up,n,8), %rax
+ adc $0, w1
+ mul v1
+ mov w2, (rp,n,8)
+ add %rax, w0
+ mov %rdx, w2
+ mov 8(up,n,8), %rax
+ adc $0, w2
+ add $2, n
+ jnc L(m2tp)
+
+L(m2ed):mul v0
+ add %rax, w0
+ mov %rdx, w3
+ adc $0, w3
+ mov I(-8(up),-8(up,n,8)), %rax
+ mul v1
+ add w1, w0
+ adc $0, w3
+ add %rax, w2
+ mov w0, I(-8(rp),-8(rp,n,8))
+ adc $0, %rdx
+ add w3, w2
+ mov w2, I((rp),(rp,n,8))
+ adc $0, %rdx
+ mov %rdx, I(8(rp),8(rp,n,8))
+
+ add $-2, R32(vn)
+ jz L(ret5)
+ lea 16(vp), vp
+ lea 16(rp), rp
+
+
+L(do_addmul):
+ push %r15
+ push vn C save vn in new stack slot
+define(`vn', `(%rsp)')
+define(`X0', `%r14')
+define(`X1', `%r15')
+define(`v1', `%r8')
+
+L(outer):
+ mov (vp), v0
+ mov 8(vp), v1
+ mov (up,un,8), %rax
+ mul v0
+ test $1, R8(un)
+ jnz L(a1x1)
+
+L(a1x0):mov (rp,un,8), X0
+ xor w0, w0
+ mov %rdx, w1
+ test $2, R8(un)
+ jnz L(a110)
+
+L(a100):lea 2(un), n C un = 4, 8, 12, ...
+ add %rax, X0
+ adc $0, w1
+ mov (up,un,8), %rax
+ mul v1
+ mov 8(rp,un,8), X1 C FIXME: Use un
+ jmp L(lo0)
+
+L(a110):lea (un), n C un = 2, 6, 10, ...
+ xor w3, w3
+ jmp L(lo2)
+
+L(a1x1):mov (rp,un,8), X1
+ xor w2, w2
+ xor w1, w1
+ test $2, R8(un)
+ jz L(a111)
+
+L(a101):lea 3(un), n C un = 1, 5, 9, ...
+ mov %rdx, w3
+ add %rax, X1
+ mov (up,un,8), %rax
+ mov 8(rp,un,8), X0
+ adc $0, w3
+ jmp L(top)
+
+L(a111):lea 1(un), n C un = 3, 7, 11, ...
+ jmp L(lo3)
+
+ ALIGN(32)
+L(top): mul v1
+ mov %rdx, w0
+ add %rax, X0
+ adc $0, w0
+ add w1, X1
+ adc $0, w3
+ add w2, X0
+ adc $0, w0
+ mov -16(up,n,8), %rax
+ mul v0
+ add %rax, X0
+ mov %rdx, w1
+ adc $0, w1
+ mov -16(up,n,8), %rax
+ mul v1
+ mov X1, -24(rp,n,8)
+ mov -8(rp,n,8), X1
+ add w3, X0
+ adc $0, w1
+L(lo0): mov %rdx, w2
+ mov X0, -16(rp,n,8)
+ add %rax, X1
+ adc $0, w2
+ mov -8(up,n,8), %rax
+ add w0, X1
+ adc $0, w2
+ mul v0
+L(lo3): add %rax, X1
+ mov %rdx, w3
+ adc $0, w3
+ mov -8(up,n,8), %rax
+ mul v1
+ add w1, X1
+ mov (rp,n,8), X0
+ adc $0, w3
+ mov %rdx, w0
+ add %rax, X0
+ adc $0, w0
+ mov (up,n,8), %rax
+ mul v0
+ add w2, X0
+ mov X1, -8(rp,n,8)
+ mov %rdx, w1
+ adc $0, w0
+L(lo2): add %rax, X0
+ adc $0, w1
+ mov (up,n,8), %rax
+ add w3, X0
+ adc $0, w1
+ mul v1
+ mov 8(rp,n,8), X1
+ add %rax, X1
+ mov %rdx, w2
+ adc $0, w2
+ mov 8(up,n,8), %rax
+ mov X0, (rp,n,8)
+ mul v0
+ add w0, X1
+ mov %rdx, w3
+ adc $0, w2
+ add %rax, X1
+ mov 8(up,n,8), %rax
+ mov 16(rp,n,8), X0 C useless but harmless in final iter
+ adc $0, w3
+ add $4, n
+ jnc L(top)
+
+L(end): mul v1
+ add w1, X1
+ adc $0, w3
+ add w2, %rax
+ adc $0, %rdx
+ mov X1, I(-8(rp),-24(rp,n,8))
+ add w3, %rax
+ adc $0, %rdx
+ mov %rax, I((rp),-16(rp,n,8))
+ mov %rdx, I(8(rp),-8(rp,n,8))
+
+ addl $-2, vn
+ lea 16(vp), vp
+ lea 16(rp), rp
+ jnz L(outer)
+
+ pop %rax C deallocate vn slot
+ pop %r15
+L(ret5):pop %r14
+ pop %r13
+ pop %r12
+L(ret2):pop %rbp
+ pop %rbx
+ FUNC_EXIT()
+ ret
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/coreisbr/mullo_basecase.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/coreisbr/mullo_basecase.asm
new file mode 100644
index 00000000000..a41a8acee41
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/coreisbr/mullo_basecase.asm
@@ -0,0 +1,384 @@
+dnl AMD64 mpn_mullo_basecase optimised for Intel Sandy bridge and Ivy bridge.
+
+dnl Contributed to the GNU project by Torbjörn Granlund.
+
+dnl Copyright 2008, 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/limb mul_2 addmul_2
+C AMD K8,K9
+C AMD K10
+C AMD bull
+C AMD pile
+C AMD steam
+C AMD bobcat
+C AMD jaguar
+C Intel P4
+C Intel core
+C Intel NHM
+C Intel SBR 2.5 2.95
+C Intel IBR 2.3 2.68
+C Intel HWL 2.0 2.5
+C Intel BWL
+C Intel atom
+C VIA nano
+
+C The inner loops of this code are the result of running a code generation and
+C optimisation tool suite written by David Harvey and Torbjörn Granlund.
+
+C TODO
+C * Implement proper cor2, replacing current cor0.
+C * Offset n by 2 in order to avoid the outer loop cmp. (And sqr_basecase?)
+C * Micro-optimise.
+
+C When playing with pointers, set this to $2 to fall back to conservative
+C indexing in wind-down code.
+define(`I',`$1')
+
+define(`rp', `%rdi')
+define(`up', `%rsi')
+define(`vp_param', `%rdx')
+define(`n', `%rcx')
+
+define(`vp', `%r8')
+define(`X0', `%r14')
+define(`X1', `%r15')
+
+define(`w0', `%r10')
+define(`w1', `%r11')
+define(`w2', `%r12')
+define(`w3', `%r13')
+define(`i', `%rbp')
+define(`v0', `%r9')
+define(`v1', `%rbx')
+
+C rax rbx rcx rdx rdi rsi rbp r8 r9 r10 r11 r12 r13 r14 r15
+
+ABI_SUPPORT(DOS64)
+ABI_SUPPORT(STD64)
+
+ASM_START()
+ TEXT
+ ALIGN(32)
+PROLOGUE(mpn_mullo_basecase)
+ FUNC_ENTRY(4)
+
+ mov (up), %rax
+ mov vp_param, vp
+
+ cmp $4, n
+ jb L(small)
+
+ mov (vp_param), v0
+ push %rbx
+ lea (rp,n,8), rp C point rp at R[un]
+ push %rbp
+ lea (up,n,8), up C point up right after U's end
+ push %r12
+ neg n
+ push %r13
+ mul v0
+ mov 8(vp), v1
+
+ test $1, R8(n)
+ jnz L(m2b1)
+
+L(m2b0):lea (n), i
+ xor w0, w0
+ mov %rax, w2
+ mov %rdx, w1
+ jmp L(m2l0)
+
+L(m2b1):lea 1(n), i
+ xor w1, w1
+ xor w2, w2
+ mov %rax, w0
+ mov %rdx, w3
+ jmp L(m2l1)
+
+ ALIGN(32)
+L(m2tp):mul v0
+ add %rax, w0
+ mov %rdx, w3
+ adc $0, w3
+L(m2l1):mov -8(up,i,8), %rax
+ mul v1
+ add w1, w0
+ adc $0, w3
+ add %rax, w2
+ mov w0, -8(rp,i,8)
+ mov %rdx, w0
+ adc $0, w0
+ mov (up,i,8), %rax
+ mul v0
+ add %rax, w2
+ mov %rdx, w1
+ adc $0, w1
+ add w3, w2
+L(m2l0):mov (up,i,8), %rax
+ adc $0, w1
+ mul v1
+ mov w2, (rp,i,8)
+ add %rax, w0
+ mov %rdx, w2 C FIXME: dead in last iteration
+ mov 8(up,i,8), %rax
+ adc $0, w2 C FIXME: dead in last iteration
+ add $2, i
+ jnc L(m2tp)
+
+L(m2ed):imul v0, %rax
+ add w0, %rax
+ add w1, %rax
+ mov %rax, I(-8(rp),-8(rp,i,8))
+
+ add $2, n
+ lea 16(vp), vp
+ lea -16(up), up
+ cmp $-2, n
+ jge L(cor1)
+
+ push %r14
+ push %r15
+
+L(outer):
+ mov (vp), v0
+ mov 8(vp), v1
+ mov (up,n,8), %rax
+ mul v0
+ test $1, R8(n)
+ jnz L(a1x1)
+
+L(a1x0):mov (rp,n,8), X1
+ xor w2, w2
+ xor w1, w1
+ test $2, R8(n)
+ jnz L(a110)
+
+L(a100):lea 1(n), i
+ jmp L(lo0)
+
+L(a110):lea 3(n), i
+ mov %rdx, w3
+ add %rax, X1
+ mov (up,n,8), %rax
+ mov 8(rp,n,8), X0
+ adc $0, w3
+ jmp L(lo2)
+
+L(a1x1):mov (rp,n,8), X0
+ xor w0, w0
+ mov %rdx, w1
+ test $2, R8(n)
+ jz L(a111)
+
+L(a101):lea 2(n), i
+ add %rax, X0
+ adc $0, w1
+ mov (up,n,8), %rax
+ mul v1
+ mov 8(rp,n,8), X1
+ jmp L(lo1)
+
+L(a111):lea (n), i
+ xor w3, w3
+ jmp L(lo3)
+
+ ALIGN(32)
+L(top):
+L(lo2): mul v1
+ mov %rdx, w0
+ add %rax, X0
+ adc $0, w0
+ add w1, X1
+ adc $0, w3
+ add w2, X0
+ adc $0, w0
+ mov -16(up,i,8), %rax
+ mul v0
+ add %rax, X0
+ mov %rdx, w1
+ adc $0, w1
+ mov -16(up,i,8), %rax
+ mul v1
+ mov X1, -24(rp,i,8)
+ mov -8(rp,i,8), X1
+ add w3, X0
+ adc $0, w1
+L(lo1): mov %rdx, w2
+ mov X0, -16(rp,i,8)
+ add %rax, X1
+ adc $0, w2
+ mov -8(up,i,8), %rax
+ add w0, X1
+ adc $0, w2
+ mul v0
+L(lo0): add %rax, X1
+ mov %rdx, w3
+ adc $0, w3
+ mov -8(up,i,8), %rax
+ mul v1
+ add w1, X1
+ mov (rp,i,8), X0
+ adc $0, w3
+ mov %rdx, w0
+ add %rax, X0
+ adc $0, w0
+ mov (up,i,8), %rax
+ mul v0
+ add w2, X0
+ mov X1, -8(rp,i,8)
+ mov %rdx, w1
+ adc $0, w0
+L(lo3): add %rax, X0
+ adc $0, w1
+ mov (up,i,8), %rax
+ add w3, X0
+ adc $0, w1
+ mul v1
+ mov 8(rp,i,8), X1
+ add %rax, X1
+ mov %rdx, w2
+ adc $0, w2
+ mov 8(up,i,8), %rax
+ mov X0, (rp,i,8)
+ mul v0
+ add w0, X1
+ mov %rdx, w3
+ adc $0, w2
+ add %rax, X1
+ mov 8(up,i,8), %rax
+ mov 16(rp,i,8), X0
+ adc $0, w3
+ add $4, i
+ jnc L(top)
+
+L(end): imul v1, %rax
+ add %rax, X0
+ add w1, X1
+ adc $0, w3
+ add w2, X0
+ mov I(-8(up),-16(up,i,8)), %rax
+ imul v0, %rax
+ add X0, %rax
+ mov X1, I(-16(rp),-24(rp,i,8))
+ add w3, %rax
+ mov %rax, I(-8(rp),-16(rp,i,8))
+
+ add $2, n
+ lea 16(vp), vp
+ lea -16(up), up
+ cmp $-2, n
+ jl L(outer)
+
+ pop %r15
+ pop %r14
+
+ jnz L(cor0)
+
+L(cor1):mov (vp), v0
+ mov 8(vp), v1
+ mov -16(up), %rax
+ mul v0 C u0 x v2
+ add -16(rp), %rax C FIXME: rp[0] still available in reg?
+ adc -8(rp), %rdx C FIXME: rp[1] still available in reg?
+ mov -8(up), %r10
+ imul v0, %r10
+ mov -16(up), %r11
+ imul v1, %r11
+ mov %rax, -16(rp)
+ add %r10, %r11
+ add %rdx, %r11
+ mov %r11, -8(rp)
+ pop %r13
+ pop %r12
+ pop %rbp
+ pop %rbx
+ FUNC_EXIT()
+ ret
+
+L(cor0):mov (vp), %r11
+ imul -8(up), %r11
+ add %rax, %r11
+ mov %r11, -8(rp)
+ pop %r13
+ pop %r12
+ pop %rbp
+ pop %rbx
+ FUNC_EXIT()
+ ret
+
+ ALIGN(16)
+L(small):
+ cmp $2, n
+ jae L(gt1)
+L(n1): imul (vp_param), %rax
+ mov %rax, (rp)
+ FUNC_EXIT()
+ ret
+L(gt1): ja L(gt2)
+L(n2): mov (vp_param), %r9
+ mul %r9
+ mov %rax, (rp)
+ mov 8(up), %rax
+ imul %r9, %rax
+ add %rax, %rdx
+ mov 8(vp), %r9
+ mov (up), %rcx
+ imul %r9, %rcx
+ add %rcx, %rdx
+ mov %rdx, 8(rp)
+ FUNC_EXIT()
+ ret
+L(gt2):
+L(n3): mov (vp_param), %r9
+ mul %r9 C u0 x v0
+ mov %rax, (rp)
+ mov %rdx, %r10
+ mov 8(up), %rax
+ mul %r9 C u1 x v0
+ imul 16(up), %r9 C u2 x v0
+ add %rax, %r10
+ adc %rdx, %r9
+ mov 8(vp), %r11
+ mov (up), %rax
+ mul %r11 C u0 x v1
+ add %rax, %r10
+ adc %rdx, %r9
+ imul 8(up), %r11 C u1 x v1
+ add %r11, %r9
+ mov %r10, 8(rp)
+ mov 16(vp), %r10
+ mov (up), %rax
+ imul %rax, %r10 C u0 x v2
+ add %r10, %r9
+ mov %r9, 16(rp)
+ FUNC_EXIT()
+ ret
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/coreisbr/popcount.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/coreisbr/popcount.asm
new file mode 100644
index 00000000000..a5be33e6a79
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/coreisbr/popcount.asm
@@ -0,0 +1,118 @@
+dnl AMD64 mpn_popcount -- population count.
+
+dnl Copyright 2008, 2010-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/limb
+C AMD K8,K9 n/a
+C AMD K10 1.5 slower than 8-way non-pipelined code
+C AMD bd1 4.2
+C AMD bobcat 6.28 slower than 8-way non-pipelined code
+C Intel P4 n/a
+C Intel core2 n/a
+C Intel NHM 1.32
+C Intel SBR 1.05 fluctuating
+C Intel IBR 1.05 fluctuating
+C Intel HSW 1
+C Intel atom n/a
+C VIA nano n/a
+
+define(`up', `%rdi')
+define(`n_param', `%rsi')
+
+define(`n', `%rcx')
+
+ABI_SUPPORT(DOS64)
+ABI_SUPPORT(STD64)
+
+ASM_START()
+ TEXT
+ ALIGN(32)
+PROLOGUE(mpn_popcount)
+ FUNC_ENTRY(2)
+
+ lea (up,n_param,8), up
+ xor R32(%rax), R32(%rax)
+
+ test $1, R8(n_param)
+ jnz L(bx1)
+
+L(bx0): test $2, R8(n_param)
+ jnz L(b10)
+
+L(b00): mov $0, R32(n)
+ sub n_param, n
+ .byte 0xf3,0x4c,0x0f,0xb8,0x04,0xcf C popcnt (up,n,8), %r8
+ .byte 0xf3,0x4c,0x0f,0xb8,0x4c,0xcf,0x08 C popcnt 8(up,n,8), %r9
+ jmp L(lo0)
+
+L(b10): mov $2, R32(n)
+ sub n_param, n
+ .byte 0xf3,0x4c,0x0f,0xb8,0x54,0xcf,0xf0 C popcnt -16(up,n,8), %r10
+ .byte 0xf3,0x4c,0x0f,0xb8,0x5c,0xcf,0xf8 C popcnt -8(up,n,8), %r11
+ test n, n
+ jz L(cj2)
+ jmp L(lo2)
+
+L(bx1): test $2, R8(n_param)
+ jnz L(b11)
+
+L(b01): mov $1, R32(n)
+ sub n_param, n
+ .byte 0xf3,0x4c,0x0f,0xb8,0x5c,0xcf,0xf8 C popcnt -8(up,n,8), %r11
+ test n, n
+ jz L(cj1)
+ .byte 0xf3,0x4c,0x0f,0xb8,0x04,0xcf C popcnt 0(up,n,8), %r8
+ jmp L(lo1)
+
+L(b11): mov $-1, n
+ sub n_param, n
+ .byte 0xf3,0x4c,0x0f,0xb8,0x4c,0xcf,0x08 C popcnt 8(up,n,8), %r9
+ .byte 0xf3,0x4c,0x0f,0xb8,0x54,0xcf,0x10 C popcnt 16(up,n,8), %r10
+ jmp L(lo3)
+
+ ALIGN(32)
+L(top): add %r9, %rax
+L(lo2): .byte 0xf3,0x4c,0x0f,0xb8,0x04,0xcf C popcnt 0(up,n,8), %r8
+ add %r10, %rax
+L(lo1): .byte 0xf3,0x4c,0x0f,0xb8,0x4c,0xcf,0x08 C popcnt 8(up,n,8), %r9
+ add %r11, %rax
+L(lo0): .byte 0xf3,0x4c,0x0f,0xb8,0x54,0xcf,0x10 C popcnt 16(up,n,8), %r10
+ add %r8, %rax
+L(lo3): .byte 0xf3,0x4c,0x0f,0xb8,0x5c,0xcf,0x18 C popcnt 24(up,n,8), %r11
+ add $4, n
+ js L(top)
+
+L(end): add %r9, %rax
+L(cj2): add %r10, %rax
+L(cj1): add %r11, %rax
+ FUNC_EXIT()
+ ret
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/coreisbr/redc_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/coreisbr/redc_1.asm
new file mode 100644
index 00000000000..8a5170e3fde
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/coreisbr/redc_1.asm
@@ -0,0 +1,541 @@
+dnl X86-64 mpn_redc_1 optimised for Intel Sandy Bridge and Ivy Bridge.
+
+dnl Contributed to the GNU project by Torbjörn Granlund.
+
+dnl Copyright 2003-2005, 2007, 2008, 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/limb
+C AMD K8,K9 ?
+C AMD K10 ?
+C AMD bull ?
+C AMD pile ?
+C AMD steam ?
+C AMD bobcat ?
+C AMD jaguar ?
+C Intel P4 ?
+C Intel core ?
+C Intel NHM ?
+C Intel SBR 3.24
+C Intel IBR 3.04
+C Intel HWL ?
+C Intel BWL ?
+C Intel atom ?
+C VIA nano ?
+
+C The inner loops of this code are the result of running a code generation and
+C optimisation tool suite written by David Harvey and Torbjörn Granlund.
+
+C TODO
+C * Micro-optimise, none performed thus far.
+C * Consider inlining mpn_add_n.
+C * Single basecases out before the pushes.
+
+C When playing with pointers, set this to $2 to fall back to conservative
+C indexing in wind-down code.
+define(`I',`$1')
+
+define(`rp', `%rdi') C rcx
+define(`up', `%rsi') C rdx
+define(`mp_param', `%rdx') C r8
+define(`n', `%rcx') C r9
+define(`u0inv', `%r8') C stack
+
+define(`i', `%r14')
+define(`j', `%r15')
+define(`mp', `%r12')
+define(`q0', `%r13')
+
+C rax rbx rcx rdx rdi rsi rbp r8 r9 r10 r11 r12 r13 r14 r15
+
+ABI_SUPPORT(DOS64)
+ABI_SUPPORT(STD64)
+
+define(`ALIGNx', `ALIGN(16)')
+
+ASM_START()
+ TEXT
+ ALIGN(32)
+PROLOGUE(mpn_redc_1)
+ FUNC_ENTRY(4)
+IFDOS(` mov 56(%rsp), %r8 ')
+ push %rbx
+ push %rbp
+ push %r12
+ push %r13
+ push %r14
+ push %r15
+
+ mov (up), q0
+ mov n, j C outer loop induction var
+ lea 8(mp_param,n,8), mp
+ lea 8(up,n,8), up
+ neg n
+ imul u0inv, q0 C first iteration q0
+
+ test $1, R8(n)
+ jz L(bx0)
+
+L(bx1): test $2, R8(n)
+ jz L(b3)
+
+L(b1): cmp $-1, R32(n)
+ jz L(n1)
+
+L(otp1):lea 1(n), i
+ mov -8(mp,n,8), %rax
+ mul q0
+ mov -8(up,n,8), %r10
+ mov %rdx, %r11
+ add %rax, %r10
+ mov (mp,n,8), %rax
+ adc $0, %r11
+ mul q0
+ mov %rdx, %r9
+ mov (up,n,8), %rbx
+ add %rax, %rbx
+ adc $0, %r9
+ mov (mp,i,8), %rax
+ mul q0
+ mov (up,i,8), %r10
+ add %r11, %rbx
+ mov %rbx, -8(up,i,8) C next low remainder limb
+ adc $0, %r9
+ imul u0inv, %rbx C next q limb
+ jmp L(e1)
+
+ ALIGNx
+L(tp1): mul q0
+ mov -16(up,i,8), %r10
+ add %r11, %rbp
+ mov %rdx, %r11
+ adc $0, %r9
+ mov %rbp, -24(up,i,8)
+ add %rax, %r10
+ mov -8(mp,i,8), %rax
+ adc $0, %r11
+ mul q0
+ add %r9, %r10
+ mov %rdx, %r9
+ mov -8(up,i,8), %rbp
+ adc $0, %r11
+ mov %r10, -16(up,i,8)
+ add %rax, %rbp
+ adc $0, %r9
+ mov (mp,i,8), %rax
+ mul q0
+ mov (up,i,8), %r10
+ add %r11, %rbp
+ mov %rbp, -8(up,i,8)
+ adc $0, %r9
+L(e1): mov %rdx, %r11
+ add %rax, %r10
+ mov 8(mp,i,8), %rax
+ adc $0, %r11
+ mul q0
+ mov 8(up,i,8), %rbp
+ add %r9, %r10
+ mov %rdx, %r9
+ mov %r10, (up,i,8)
+ adc $0, %r11
+ add %rax, %rbp
+ adc $0, %r9
+ mov 16(mp,i,8), %rax
+ add $4, i
+ jnc L(tp1)
+
+L(ed1): mul q0
+ mov I(-16(up),-16(up,i,8)), %r10
+ add %r11, %rbp
+ adc $0, %r9
+ mov %rbp, I(-24(up),-24(up,i,8))
+ add %rax, %r10
+ adc $0, %rdx
+ add %r9, %r10
+ adc $0, %rdx
+ mov %r10, I(-16(up),-16(up,i,8))
+ mov %rdx, -8(up,n,8) C up[0]
+ mov %rbx, q0 C previously computed q limb -> q0
+ lea 8(up), up C up++
+ dec j
+ jnz L(otp1)
+ jmp L(cj)
+
+L(b3): cmp $-3, R32(n)
+ jz L(n3)
+
+L(otp3):lea 3(n), i
+ mov -8(mp,n,8), %rax
+ mul q0
+ mov -8(up,n,8), %r10
+ mov %rdx, %r11
+ add %rax, %r10
+ mov (mp,n,8), %rax
+ adc $0, %r11
+ mul q0
+ mov (up,n,8), %rbx
+ mov %rdx, %r9
+ add %rax, %rbx
+ adc $0, %r9
+ mov 8(mp,n,8), %rax
+ mul q0
+ mov 8(up,n,8), %r10
+ add %r11, %rbx
+ mov %rdx, %r11
+ adc $0, %r9
+ mov %rbx, (up,n,8)
+ imul u0inv, %rbx C next q limb
+ jmp L(e3)
+
+ ALIGNx
+L(tp3): mul q0
+ mov -16(up,i,8), %r10
+ add %r11, %rbp
+ mov %rdx, %r11
+ adc $0, %r9
+ mov %rbp, -24(up,i,8)
+L(e3): add %rax, %r10
+ mov -8(mp,i,8), %rax
+ adc $0, %r11
+ mul q0
+ add %r9, %r10
+ mov %rdx, %r9
+ mov -8(up,i,8), %rbp
+ adc $0, %r11
+ mov %r10, -16(up,i,8)
+ add %rax, %rbp
+ adc $0, %r9
+ mov (mp,i,8), %rax
+ mul q0
+ mov (up,i,8), %r10
+ add %r11, %rbp
+ mov %rbp, -8(up,i,8)
+ adc $0, %r9
+ mov %rdx, %r11
+ add %rax, %r10
+ mov 8(mp,i,8), %rax
+ adc $0, %r11
+ mul q0
+ mov 8(up,i,8), %rbp
+ add %r9, %r10
+ mov %rdx, %r9
+ mov %r10, (up,i,8)
+ adc $0, %r11
+ add %rax, %rbp
+ adc $0, %r9
+ mov 16(mp,i,8), %rax
+ add $4, i
+ jnc L(tp3)
+
+L(ed3): mul q0
+ mov I(-16(up),-16(up,i,8)), %r10
+ add %r11, %rbp
+ adc $0, %r9
+ mov %rbp, I(-24(up),-24(up,i,8))
+ add %rax, %r10
+ adc $0, %rdx
+ add %r9, %r10
+ adc $0, %rdx
+ mov %r10, I(-16(up),-16(up,i,8))
+ mov %rdx, -8(up,n,8) C up[0]
+ mov %rbx, q0 C previously computed q limb -> q0
+ lea 8(up), up C up++
+ dec j
+ jnz L(otp3)
+C jmp L(cj)
+
+L(cj):
+IFSTD(` lea -8(up,n,8), up C param 2: up
+ lea (up,n,8), %rdx C param 3: up - n
+ neg R32(n) ') C param 4: n
+
+IFDOS(` lea -8(up,n,8), %rdx C param 2: up
+ lea (%rdx,n,8), %r8 C param 3: up - n
+ neg R32(n)
+ mov n, %r9 C param 4: n
+ mov rp, %rcx ') C param 1: rp
+
+ CALL( mpn_add_n)
+
+L(ret): pop %r15
+ pop %r14
+ pop %r13
+ pop %r12
+ pop %rbp
+ pop %rbx
+ FUNC_EXIT()
+ ret
+
+L(bx0): test $2, R8(n)
+ jnz L(b2)
+
+L(b0):
+L(otp0):lea (n), i
+ mov -8(mp,n,8), %rax
+ mul q0
+ mov %rdx, %r9
+ mov -8(up,n,8), %rbp
+ add %rax, %rbp
+ adc $0, %r9
+ mov (mp,n,8), %rax
+ mul q0
+ mov (up,n,8), %rbx
+ mov %rdx, %r11
+ add %rax, %rbx
+ mov 8(mp,n,8), %rax
+ adc $0, %r11
+ mul q0
+ mov 8(up,n,8), %rbp
+ add %r9, %rbx
+ mov %rdx, %r9
+ mov %rbx, (up,n,8)
+ adc $0, %r11
+ imul u0inv, %rbx C next q limb
+ jmp L(e0)
+
+ ALIGNx
+L(tp0): mul q0
+ mov -16(up,i,8), %r10
+ add %r11, %rbp
+ mov %rdx, %r11
+ adc $0, %r9
+ mov %rbp, -24(up,i,8)
+ add %rax, %r10
+ mov -8(mp,i,8), %rax
+ adc $0, %r11
+ mul q0
+ add %r9, %r10
+ mov %rdx, %r9
+ mov -8(up,i,8), %rbp
+ adc $0, %r11
+ mov %r10, -16(up,i,8)
+ add %rax, %rbp
+ adc $0, %r9
+ mov (mp,i,8), %rax
+ mul q0
+ mov (up,i,8), %r10
+ add %r11, %rbp
+ mov %rbp, -8(up,i,8)
+ adc $0, %r9
+ mov %rdx, %r11
+ add %rax, %r10
+ mov 8(mp,i,8), %rax
+ adc $0, %r11
+ mul q0
+ mov 8(up,i,8), %rbp
+ add %r9, %r10
+ mov %rdx, %r9
+ mov %r10, (up,i,8)
+ adc $0, %r11
+L(e0): add %rax, %rbp
+ adc $0, %r9
+ mov 16(mp,i,8), %rax
+ add $4, i
+ jnc L(tp0)
+
+L(ed0): mul q0
+ mov I(-16(up),-16(up,i,8)), %r10
+ add %r11, %rbp
+ adc $0, %r9
+ mov %rbp, I(-24(up),-24(up,i,8))
+ add %rax, %r10
+ adc $0, %rdx
+ add %r9, %r10
+ adc $0, %rdx
+ mov %r10, I(-16(up),-16(up,i,8))
+ mov %rdx, -8(up,n,8) C up[0]
+ mov %rbx, q0 C previously computed q limb -> q0
+ lea 8(up), up C up++
+ dec j
+ jnz L(otp0)
+ jmp L(cj)
+
+L(b2): cmp $-2, R32(n)
+ jz L(n2)
+
+L(otp2):lea 2(n), i
+ mov -8(mp,n,8), %rax
+ mul q0
+ mov -8(up,n,8), %rbp
+ mov %rdx, %r9
+ add %rax, %rbp
+ adc $0, %r9
+ mov (mp,n,8), %rax
+ mul q0
+ mov (up,n,8), %rbx
+ mov %rdx, %r11
+ add %rax, %rbx
+ mov 8(mp,n,8), %rax
+ adc $0, %r11
+ mul q0
+ add %r9, %rbx
+ mov %rdx, %r9
+ mov 8(up,n,8), %rbp
+ adc $0, %r11
+ mov %rbx, (up,n,8)
+ imul u0inv, %rbx C next q limb
+ jmp L(e2)
+
+ ALIGNx
+L(tp2): mul q0
+ mov -16(up,i,8), %r10
+ add %r11, %rbp
+ mov %rdx, %r11
+ adc $0, %r9
+ mov %rbp, -24(up,i,8)
+ add %rax, %r10
+ mov -8(mp,i,8), %rax
+ adc $0, %r11
+ mul q0
+ add %r9, %r10
+ mov %rdx, %r9
+ mov -8(up,i,8), %rbp
+ adc $0, %r11
+ mov %r10, -16(up,i,8)
+L(e2): add %rax, %rbp
+ adc $0, %r9
+ mov (mp,i,8), %rax
+ mul q0
+ mov (up,i,8), %r10
+ add %r11, %rbp
+ mov %rbp, -8(up,i,8)
+ adc $0, %r9
+ mov %rdx, %r11
+ add %rax, %r10
+ mov 8(mp,i,8), %rax
+ adc $0, %r11
+ mul q0
+ mov 8(up,i,8), %rbp
+ add %r9, %r10
+ mov %rdx, %r9
+ mov %r10, (up,i,8)
+ adc $0, %r11
+ add %rax, %rbp
+ adc $0, %r9
+ mov 16(mp,i,8), %rax
+ add $4, i
+ jnc L(tp2)
+
+L(ed2): mul q0
+ mov I(-16(up),-16(up,i,8)), %r10
+ add %r11, %rbp
+ adc $0, %r9
+ mov %rbp, I(-24(up),-24(up,i,8))
+ add %rax, %r10
+ adc $0, %rdx
+ add %r9, %r10
+ adc $0, %rdx
+ mov %r10, I(-16(up),-16(up,i,8))
+ mov %rdx, -8(up,n,8) C up[0]
+ mov %rbx, q0 C previously computed q limb -> q0
+ lea 8(up), up C up++
+ dec j
+ jnz L(otp2)
+ jmp L(cj)
+
+L(n1): mov (mp_param), %rax
+ mul q0
+ add -16(up), %rax
+ adc -8(up), %rdx
+ mov %rdx, (rp)
+ mov $0, R32(%rax)
+ adc R32(%rax), R32(%rax)
+ jmp L(ret)
+
+L(n2): mov (mp_param), %rax
+ mov -24(up), %rbp
+ mul q0
+ add %rax, %rbp
+ mov %rdx, %r9
+ adc $0, %r9
+ mov -16(mp), %rax
+ mov -16(up), %r10
+ mul q0
+ add %rax, %r10
+ mov %rdx, %r11
+ adc $0, %r11
+ add %r9, %r10
+ adc $0, %r11
+ mov %r10, q0
+ imul u0inv, q0 C next q0
+ mov -24(mp), %rax
+ mul q0
+ add %rax, %r10
+ mov %rdx, %r9
+ adc $0, %r9
+ mov -16(mp), %rax
+ mov -8(up), %r14
+ mul q0
+ add %rax, %r14
+ adc $0, %rdx
+ add %r9, %r14
+ adc $0, %rdx
+ xor R32(%rax), R32(%rax)
+ add %r11, %r14
+ adc (up), %rdx
+ mov %r14, (rp)
+ mov %rdx, 8(rp)
+ adc R32(%rax), R32(%rax)
+ jmp L(ret)
+
+ ALIGNx
+L(n3): mov -32(mp), %rax
+ mov -32(up), %r10
+ mul q0
+ add %rax, %r10
+ mov -24(mp), %rax
+ mov %rdx, %r11
+ adc $0, %r11
+ mov -24(up), %rbp
+ mul q0
+ add %rax, %rbp
+ mov %rdx, %r9
+ adc $0, %r9
+ mov -16(mp), %rax
+ add %r11, %rbp
+ mov -16(up), %r10
+ adc $0, %r9
+ mul q0
+ mov %rbp, q0
+ imul u0inv, q0 C next q0
+ add %rax, %r10
+ mov %rdx, %r11
+ adc $0, %r11
+ mov %rbp, -24(up)
+ add %r9, %r10
+ adc $0, %r11
+ mov %r10, -16(up)
+ mov %r11, -32(up) C up[0]
+ lea 8(up), up C up++
+ dec j
+ jnz L(n3)
+ jmp L(cj)
+EPILOGUE()
+ASM_END()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/coreisbr/rsh1aors_n.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/coreisbr/rsh1aors_n.asm
new file mode 100644
index 00000000000..fd2eaea7bb9
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/coreisbr/rsh1aors_n.asm
@@ -0,0 +1,193 @@
+dnl X86-64 mpn_rsh1add_n, mpn_rsh1sub_n optimised for Intel Sandy Bridge.
+
+dnl Copyright 2003, 2005, 2009-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/limb
+C AMD K8,K9 ?
+C AMD K10 4.25
+C Intel P4 21.5
+C Intel core2 3.2
+C Intel NHM 3.87
+C Intel SBR 2.05
+C Intel atom ?
+C VIA nano 44.9
+
+C INPUT PARAMETERS
+define(`rp', `%rdi')
+define(`up', `%rsi')
+define(`vp', `%rdx')
+define(`n', `%rcx')
+
+ifdef(`OPERATION_rsh1add_n', `
+ define(ADDSUB, add)
+ define(ADCSBB, adc)
+ define(func_n, mpn_rsh1add_n)
+ define(func_nc, mpn_rsh1add_nc)')
+ifdef(`OPERATION_rsh1sub_n', `
+ define(ADDSUB, sub)
+ define(ADCSBB, sbb)
+ define(func_n, mpn_rsh1sub_n)
+ define(func_nc, mpn_rsh1sub_nc)')
+
+MULFUNC_PROLOGUE(mpn_rsh1add_n mpn_rsh1add_nc mpn_rsh1sub_n mpn_rsh1sub_nc)
+
+ABI_SUPPORT(DOS64)
+ABI_SUPPORT(STD64)
+
+ASM_START()
+ TEXT
+
+ ALIGN(16)
+PROLOGUE(func_nc)
+ FUNC_ENTRY(4)
+IFDOS(` mov 56(%rsp), %r8 ')
+ push %rbx
+ push %rbp
+
+ neg %r8 C set C flag from parameter
+ mov (up), %rbp
+ ADCSBB (vp), %rbp
+
+ jmp L(ent)
+EPILOGUE()
+
+ ALIGN(16)
+PROLOGUE(func_n)
+ FUNC_ENTRY(4)
+ push %rbx
+ push %rbp
+
+ mov (up), %rbp
+ ADDSUB (vp), %rbp
+L(ent):
+ sbb R32(%rbx), R32(%rbx) C save cy
+ mov R32(%rbp), R32(%rax)
+ and $1, R32(%rax) C return value
+
+ mov R32(n), R32(%r11)
+ and $3, R32(%r11)
+
+ cmp $1, R32(%r11)
+ je L(do) C jump if n = 1 5 9 ...
+
+L(n1): cmp $2, R32(%r11)
+ jne L(n2) C jump unless n = 2 6 10 ...
+ add R32(%rbx), R32(%rbx) C restore cy
+ mov 8(up), %r10
+ ADCSBB 8(vp), %r10
+ lea 8(up), up
+ lea 8(vp), vp
+ lea 8(rp), rp
+ sbb R32(%rbx), R32(%rbx) C save cy
+
+ shrd $1, %r10, %rbp
+ mov %rbp, -8(rp)
+ jmp L(cj1)
+
+L(n2): cmp $3, R32(%r11)
+ jne L(n3) C jump unless n = 3 7 11 ...
+ add R32(%rbx), R32(%rbx) C restore cy
+ mov 8(up), %r9
+ mov 16(up), %r10
+ ADCSBB 8(vp), %r9
+ ADCSBB 16(vp), %r10
+ lea 16(up), up
+ lea 16(vp), vp
+ lea 16(rp), rp
+ sbb R32(%rbx), R32(%rbx) C save cy
+
+ shrd $1, %r9, %rbp
+ mov %rbp, -16(rp)
+ jmp L(cj2)
+
+L(n3): dec n C come here for n = 4 8 12 ...
+ add R32(%rbx), R32(%rbx) C restore cy
+ mov 8(up), %r8
+ mov 16(up), %r9
+ ADCSBB 8(vp), %r8
+ ADCSBB 16(vp), %r9
+ mov 24(up), %r10
+ ADCSBB 24(vp), %r10
+ lea 24(up), up
+ lea 24(vp), vp
+ lea 24(rp), rp
+ sbb R32(%rbx), R32(%rbx) C save cy
+
+ shrd $1, %r8, %rbp
+ mov %rbp, -24(rp)
+ shrd $1, %r9, %r8
+ mov %r8, -16(rp)
+L(cj2): shrd $1, %r10, %r9
+ mov %r9, -8(rp)
+L(cj1): mov %r10, %rbp
+
+L(do):
+ shr $2, n C 4
+ je L(end) C 2
+ ALIGN(16)
+L(top): add R32(%rbx), R32(%rbx) C restore cy
+
+ mov 8(up), %r8
+ mov 16(up), %r9
+ ADCSBB 8(vp), %r8
+ ADCSBB 16(vp), %r9
+ mov 24(up), %r10
+ mov 32(up), %r11
+ ADCSBB 24(vp), %r10
+ ADCSBB 32(vp), %r11
+
+ lea 32(up), up
+ lea 32(vp), vp
+
+ sbb R32(%rbx), R32(%rbx) C save cy
+
+ shrd $1, %r8, %rbp
+ mov %rbp, (rp)
+ shrd $1, %r9, %r8
+ mov %r8, 8(rp)
+ shrd $1, %r10, %r9
+ mov %r9, 16(rp)
+ shrd $1, %r11, %r10
+ mov %r10, 24(rp)
+
+ dec n
+ mov %r11, %rbp
+ lea 32(rp), rp
+ jne L(top)
+
+L(end): shrd $1, %rbx, %rbp
+ mov %rbp, (rp)
+ pop %rbp
+ pop %rbx
+ FUNC_EXIT()
+ ret
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/coreisbr/rshift.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/coreisbr/rshift.asm
new file mode 100644
index 00000000000..4c1c0d4cde0
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/coreisbr/rshift.asm
@@ -0,0 +1,37 @@
+dnl X86-64 mpn_rshift optimised for Intel Sandy Bridge.
+
+dnl Copyright 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')
+
+ABI_SUPPORT(DOS64)
+ABI_SUPPORT(STD64)
+
+MULFUNC_PROLOGUE(mpn_rshift)
+include_mpn(`x86_64/fastsse/rshift-movdqu2.asm')
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/coreisbr/sec_tabselect.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/coreisbr/sec_tabselect.asm
new file mode 100644
index 00000000000..e4360341d93
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/coreisbr/sec_tabselect.asm
@@ -0,0 +1,37 @@
+dnl X86-64 mpn_sec_tabselect.
+
+dnl Copyright 2012, 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')
+
+ABI_SUPPORT(DOS64)
+ABI_SUPPORT(STD64)
+
+MULFUNC_PROLOGUE(mpn_sec_tabselect)
+include_mpn(`x86_64/fastsse/sec_tabselect.asm')
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/coreisbr/sqr_basecase.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/coreisbr/sqr_basecase.asm
new file mode 100644
index 00000000000..46a36121fec
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/coreisbr/sqr_basecase.asm
@@ -0,0 +1,484 @@
+dnl AMD64 mpn_sqr_basecase optimised for Intel Sandy bridge and Ivy bridge.
+
+dnl Contributed to the GNU project by Torbjörn Granlund.
+
+dnl Copyright 2008, 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/limb mul_2 addmul_2 sqr_diag_addlsh1
+C AMD K8,K9 ? ? ?
+C AMD K10 ? ? ?
+C AMD bull ? ? ?
+C AMD pile ? ? ?
+C AMD steam ? ? ?
+C AMD bobcat ? ? ?
+C AMD jaguar ? ? ?
+C Intel P4 ? ? ?
+C Intel core ? ? ?
+C Intel NHM ? ? ?
+C Intel SBR 2.57 2.93 3.0
+C Intel IBR 2.35 2.66 3.0
+C Intel HWL 2.02 2.5 2.5
+C Intel BWL ? ? ?
+C Intel atom ? ? ?
+C VIA nano ? ? ?
+
+C The inner loops of this code are the result of running a code generation and
+C optimisation tool suite written by David Harvey and Torbjörn Granlund, except
+C that the sqr_diag_addlsh1 loop was manually written.
+
+C TODO
+C * Replace current unoptimised sqr_diag_addlsh1 loop, 2.5 c/l should be easy.
+C * Streamline pointer updates.
+C * Perhaps suppress a few more xor insns in feed-in code.
+C * Make sure we write no dead registers in feed-in code.
+C * We might use 32-bit size ops, since n >= 2^32 is non-terminating. Watch
+C out for negative sizes being zero-extended, though.
+C * The straight-line code for n <= 3 comes from the K8 code, and might be
+C quite sub-optimal here. Write specific code, and add code for n = 4.
+C * The mul_2 loop has a 10 insn common sequence in the loop start and the
+C wind-down code. Try re-rolling it.
+C * This file has been the subject to just basic micro-optimisation.
+
+C When playing with pointers, set this to $2 to fall back to conservative
+C indexing in wind-down code.
+define(`I',`$1')
+
+define(`rp', `%rdi')
+define(`up', `%rsi')
+define(`un_param',`%rdx')
+
+
+ABI_SUPPORT(DOS64)
+ABI_SUPPORT(STD64)
+
+ASM_START()
+ TEXT
+ ALIGN(32)
+PROLOGUE(mpn_sqr_basecase)
+ FUNC_ENTRY(3)
+
+ cmp $2, un_param
+ jae L(gt1)
+
+ mov (up), %rax
+ mul %rax
+ mov %rax, (rp)
+ mov %rdx, 8(rp)
+ FUNC_EXIT()
+ ret
+
+L(gt1): jne L(gt2)
+
+ mov (up), %rax
+ mov %rax, %r8
+ mul %rax
+ mov 8(up), %r11
+ mov %rax, (rp)
+ mov %r11, %rax
+ mov %rdx, %r9
+ mul %rax
+ mov %rax, %r10
+ mov %r11, %rax
+ mov %rdx, %r11
+ mul %r8
+ xor %r8, %r8
+ add %rax, %r9
+ adc %rdx, %r10
+ adc %r8, %r11
+ add %rax, %r9
+ mov %r9, 8(rp)
+ adc %rdx, %r10
+ mov %r10, 16(rp)
+ adc %r8, %r11
+ mov %r11, 24(rp)
+ FUNC_EXIT()
+ ret
+
+L(gt2): cmp $4, un_param
+ jae L(gt3)
+define(`v0', `%r8')
+define(`v1', `%r9')
+define(`w0', `%r10')
+define(`w2', `%r11')
+
+ mov (up), %rax
+ mov %rax, %r10
+ mul %rax
+ mov 8(up), %r11
+ mov %rax, (rp)
+ mov %r11, %rax
+ mov %rdx, 8(rp)
+ mul %rax
+ mov 16(up), %rcx
+ mov %rax, 16(rp)
+ mov %rcx, %rax
+ mov %rdx, 24(rp)
+ mul %rax
+ mov %rax, 32(rp)
+ mov %rdx, 40(rp)
+
+ mov %r11, %rax
+ mul %r10
+ mov %rax, %r8
+ mov %rcx, %rax
+ mov %rdx, %r9
+ mul %r10
+ xor %r10, %r10
+ add %rax, %r9
+ mov %r11, %rax
+ mov %r10, %r11
+ adc %rdx, %r10
+
+ mul %rcx
+ add %rax, %r10
+ adc %r11, %rdx
+ add %r8, %r8
+ adc %r9, %r9
+ adc %r10, %r10
+ adc %rdx, %rdx
+ adc %r11, %r11
+ add %r8, 8(rp)
+ adc %r9, 16(rp)
+ adc %r10, 24(rp)
+ adc %rdx, 32(rp)
+ adc %r11, 40(rp)
+ FUNC_EXIT()
+ ret
+
+L(gt3):
+
+define(`v0', `%r8')
+define(`v1', `%r9')
+define(`w0', `%r10')
+define(`w1', `%r11')
+define(`w2', `%rbx')
+define(`w3', `%rbp')
+define(`un', `%r12')
+define(`n', `%rcx')
+
+define(`X0', `%r13')
+define(`X1', `%r14')
+
+L(do_mul_2):
+ mov (up), v0
+ push %rbx
+ lea (rp,un_param,8), rp C point rp at R[un]
+ mov 8(up), %rax
+ push %rbp
+ lea (up,un_param,8), up C point up right after U's end
+ mov %rax, v1
+ push %r12
+ mov $1, R32(un) C free up rdx
+ push %r13
+ sub un_param, un
+ push %r14
+ push un
+ mul v0
+ mov %rax, (rp,un,8)
+ mov 8(up,un,8), %rax
+ test $1, R8(un)
+ jnz L(m2b1)
+
+L(m2b0):lea 2(un), n
+ xor R32(w1), R32(w1) C FIXME
+ xor R32(w2), R32(w2) C FIXME
+ mov %rdx, w0
+ jmp L(m2l0)
+
+L(m2b1):lea 1(un), n
+ xor R32(w3), R32(w3) C FIXME
+ xor R32(w0), R32(w0) C FIXME
+ mov %rdx, w2
+ jmp L(m2l1)
+
+ ALIGN(32)
+L(m2tp):
+L(m2l0):mul v0
+ add %rax, w0
+ mov %rdx, w3
+ adc $0, w3
+ mov -8(up,n,8), %rax
+ mul v1
+ add w1, w0
+ adc $0, w3
+ add %rax, w2
+ mov w0, -8(rp,n,8)
+ mov %rdx, w0
+ adc $0, w0
+ mov (up,n,8), %rax
+L(m2l1):mul v0
+ add %rax, w2
+ mov %rdx, w1
+ adc $0, w1
+ add w3, w2
+ mov (up,n,8), %rax
+ adc $0, w1
+ mul v1
+ mov w2, (rp,n,8)
+ add %rax, w0
+ mov %rdx, w2
+ mov 8(up,n,8), %rax
+ adc $0, w2
+ add $2, n
+ jnc L(m2tp)
+
+L(m2ed):mul v0
+ add %rax, w0
+ mov %rdx, w3
+ adc $0, w3
+ mov I(-8(up),-8(up,n,8)), %rax
+ mul v1
+ add w1, w0
+ adc $0, w3
+ add %rax, w2
+ mov w0, I(-8(rp),-8(rp,n,8))
+ adc $0, %rdx
+ add w3, w2
+ mov w2, I((rp),(rp,n,8))
+ adc $0, %rdx
+ mov %rdx, I(8(rp),8(rp,n,8))
+
+ add $2, un C decrease |un|
+
+L(do_addmul_2):
+L(outer):
+ lea 16(rp), rp
+ cmp $-2, R32(un) C jump if un C {-1,0} FIXME jump if un C {-2,1}
+ jge L(corner) C FIXME: move to before the lea above
+
+ mov -8(up,un,8), v0
+ mov (up,un,8), %rax
+ mov %rax, v1
+ mul v0
+ test $1, R8(un)
+ jnz L(a1x1)
+
+L(a1x0):mov (rp,un,8), X0
+ xor w0, w0
+ mov 8(rp,un,8), X1
+ add %rax, X0
+ mov %rdx, w1
+ adc $0, w1
+ xor w2, w2
+ mov X0, (rp,un,8)
+ mov 8(up,un,8), %rax
+ test $2, R8(un)
+ jnz L(a110)
+
+L(a100):lea 2(un), n C un = 4, 8, 12, ...
+ jmp L(lo0)
+
+L(a110):lea (un), n C un = 2, 6, 10, ...
+ jmp L(lo2)
+
+L(a1x1):mov (rp,un,8), X1
+ xor w2, w2
+ mov 8(rp,un,8), X0
+ add %rax, X1
+ mov %rdx, w3
+ adc $0, w3
+ xor w0, w0
+ mov 8(up,un,8), %rax
+ test $2, R8(un)
+ jz L(a111)
+
+L(a101):lea 3(un), n C un = 1, 5, 9, ...
+ jmp L(lo1)
+
+L(a111):lea 1(un), n C un = 3, 7, 11, ...
+ jmp L(lo3)
+
+ ALIGN(32)
+L(top): mul v1
+ mov %rdx, w0
+ add %rax, X0
+ adc $0, w0
+ add w1, X1
+ adc $0, w3
+ add w2, X0
+ adc $0, w0
+ mov -16(up,n,8), %rax
+L(lo1): mul v0
+ add %rax, X0
+ mov %rdx, w1
+ adc $0, w1
+ mov -16(up,n,8), %rax
+ mul v1
+ mov X1, -24(rp,n,8)
+ mov -8(rp,n,8), X1
+ add w3, X0
+ adc $0, w1
+ mov %rdx, w2
+ mov X0, -16(rp,n,8)
+ add %rax, X1
+ adc $0, w2
+ mov -8(up,n,8), %rax
+ add w0, X1
+ adc $0, w2
+L(lo0): mul v0
+ add %rax, X1
+ mov %rdx, w3
+ adc $0, w3
+ mov -8(up,n,8), %rax
+ mul v1
+ add w1, X1
+ mov (rp,n,8), X0
+ adc $0, w3
+ mov %rdx, w0
+ add %rax, X0
+ adc $0, w0
+ mov (up,n,8), %rax
+L(lo3): mul v0
+ add w2, X0
+ mov X1, -8(rp,n,8)
+ mov %rdx, w1
+ adc $0, w0
+ add %rax, X0
+ adc $0, w1
+ mov (up,n,8), %rax
+ add w3, X0
+ adc $0, w1
+ mul v1
+ mov 8(rp,n,8), X1
+ add %rax, X1
+ mov %rdx, w2
+ adc $0, w2
+ mov 8(up,n,8), %rax
+ mov X0, (rp,n,8)
+L(lo2): mul v0
+ add w0, X1
+ mov %rdx, w3
+ adc $0, w2
+ add %rax, X1
+ mov 8(up,n,8), %rax
+ mov 16(rp,n,8), X0
+ adc $0, w3
+ add $4, n
+ jnc L(top)
+
+L(end): mul v1
+ add w1, X1
+ adc $0, w3
+ add w2, %rax
+ adc $0, %rdx
+ mov X1, I(-8(rp),-24(rp,n,8))
+ add w3, %rax
+ adc $0, %rdx
+ mov %rax, I((rp),-16(rp,n,8))
+ mov %rdx, I(8(rp),-8(rp,n,8))
+
+ add $2, un C decrease |un|
+ jmp L(outer) C loop until a small corner remains
+
+L(corner):
+ pop n
+ jg L(small_corner)
+
+ lea 8(rp), rp
+ mov -24(up), v0
+ mov -16(up), %rax
+ mov %rax, v1
+ mul v0
+ mov -24(rp), X0
+ mov -16(rp), X1
+ add %rax, X0
+ mov %rdx, w1
+ adc $0, w1
+ xor w2, w2
+ mov X0, -24(rp)
+ mov -8(up), %rax
+ mul v0
+ add $0, X1
+ mov %rdx, w3
+ adc $0, w2
+ add %rax, X1
+ mov -8(up), %rax
+ adc $0, w3
+ mul v1
+ add w1, X1
+ adc $0, w3
+ add w2, %rax
+ adc $0, %rdx
+ mov X1, -16(rp)
+ jmp L(com)
+
+L(small_corner):
+ mov -8(rp), w3
+ mov -16(up), v0
+ mov -8(up), %rax
+ mul v0
+L(com): add w3, %rax
+ adc $0, %rdx
+ mov %rax, -8(rp)
+ mov %rdx, (rp)
+
+L(sqr_diag_addlsh1):
+ mov -8(up,n,8), %rax
+ shl n
+ mul %rax
+ mov %rax, (rp,n,8)
+
+ xor R32(%rbx), R32(%rbx)
+ mov 8(rp,n,8), %r8
+ mov 16(rp,n,8), %r9
+ jmp L(dm)
+
+ ALIGN(32)
+L(dtop):add %r8, %r10
+ adc %r9, %rax
+ mov 8(rp,n,8), %r8
+ mov 16(rp,n,8), %r9
+ mov %r10, -8(rp,n,8)
+ mov %rax, (rp,n,8)
+L(dm): adc %r8, %r8
+ adc %r9, %r9
+ mov (up,n,4), %rax
+ lea (%rdx,%rbx), %r10
+ setc R8(%rbx)
+ mul %rax
+ add $2, n
+ js L(dtop)
+
+L(dend):add %r8, %r10
+ adc %r9, %rax
+ mov %r10, I(-8(rp),-8(rp,n,8))
+ mov %rax, I((rp),(rp,n,8))
+ adc %rbx, %rdx
+ mov %rdx, I(8(rp),8(rp,n,8))
+
+ pop %r14
+ pop %r13
+ pop %r12
+ pop %rbp
+ pop %rbx
+ FUNC_EXIT()
+ ret
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/darwin.m4 b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/darwin.m4
new file mode 100644
index 00000000000..6f8ec7893d9
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/darwin.m4
@@ -0,0 +1,81 @@
+divert(-1)
+dnl Copyright 2008, 2011, 2012 Free Software Foundation, Inc.
+dnl
+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/.
+
+define(`DARWIN')
+
+define(`LEA',`dnl
+ifdef(`PIC',
+ `lea $1(%rip), $2'
+,
+ `movabs `$'$1, $2')
+')
+
+dnl Usage: CALL(funcname)
+dnl
+dnl Simply override the definition in x86_64-defs.m4.
+
+define(`CALL',`call GSYM_PREFIX`'$1')
+
+
+dnl Usage: JUMPTABSECT
+dnl
+dnl CAUTION: Do not put anything sensible here, like RODATA. That works with
+dnl some Darwin tool chains, but silently breaks with other. (Note that
+dnl putting jump tables in the text segment is a really poor idea for PC many
+dnl processors, since they cannot cache the same thing in both L1D and L2I.)
+
+define(`JUMPTABSECT', `.text')
+
+
+dnl Usage: JMPENT(targlabel,tablabel)
+
+define(`JMPENT',`dnl
+ifdef(`PIC',
+ `.set $1_tmp, $1-$2
+ .long $1_tmp'
+,
+ `.quad $1'
+)')
+
+dnl Target ABI macros. For Darwin we override IFELF (and leave default for
+dnl IFDOS and IFSTD).
+
+define(`IFELF', `')
+
+
+dnl Usage: PROTECT(symbol)
+dnl
+dnl Used for private GMP symbols that should never be overridden by users.
+dnl This can save reloc entries and improve shlib sharing as well as
+dnl application startup times
+
+define(`PROTECT', `.private_extern $1')
+
+
+divert`'dnl
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/div_qr_1n_pi1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/div_qr_1n_pi1.asm
new file mode 100644
index 00000000000..cb072e979dc
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/div_qr_1n_pi1.asm
@@ -0,0 +1,247 @@
+dnl x86-64 mpn_div_qr_1n_pi1
+dnl -- Divide an mpn number by a normalized single-limb number,
+dnl using a single-limb inverse.
+
+dnl Contributed to the GNU project by Niels Möller
+
+dnl Copyright 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 c/l
+C AMD K8,K9 13
+C AMD K10 13
+C AMD bull 16.5
+C AMD pile 15
+C AMD steam ?
+C AMD bobcat 16
+C AMD jaguar ?
+C Intel P4 47 poor
+C Intel core 19.25
+C Intel NHM 18
+C Intel SBR 15 poor
+C Intel IBR 13
+C Intel HWL 11.7
+C Intel BWL ?
+C Intel atom 52 very poor
+C VIA nano 19
+
+
+C INPUT Parameters
+define(`QP', `%rdi')
+define(`UP', `%rsi')
+define(`UN_INPUT', `%rdx')
+define(`U1', `%rcx') C Also in %rax
+define(`D', `%r8')
+define(`DINV', `%r9')
+
+C Invariants
+define(`B2', `%rbp')
+define(`B2md', `%rbx')
+
+C Variables
+define(`UN', `%r8') C Overlaps D input
+define(`T', `%r10')
+define(`U0', `%r11')
+define(`U2', `%r12')
+define(`Q0', `%r13')
+define(`Q1', `%r14')
+define(`Q2', `%r15')
+
+ABI_SUPPORT(STD64)
+
+ ASM_START()
+ TEXT
+ ALIGN(16)
+PROLOGUE(mpn_div_qr_1n_pi1)
+ FUNC_ENTRY(6)
+IFDOS(` mov 56(%rsp), %r8 ')
+IFDOS(` mov 64(%rsp), %r9 ')
+ dec UN_INPUT
+ jnz L(first)
+
+ C Just a single 2/1 division.
+ C T, U0 are allocated in scratch registers
+ lea 1(U1), T
+ mov U1, %rax
+ mul DINV
+ mov (UP), U0
+ add U0, %rax
+ adc T, %rdx
+ mov %rdx, T
+ imul D, %rdx
+ sub %rdx, U0
+ cmp U0, %rax
+ lea (U0, D), %rax
+ cmovnc U0, %rax
+ sbb $0, T
+ cmp D, %rax
+ jc L(single_div_done)
+ sub D, %rax
+ add $1, T
+L(single_div_done):
+ mov T, (QP)
+ FUNC_EXIT
+ ret
+L(first):
+ C FIXME: Could delay some of these until we enter the loop.
+ push %r15
+ push %r14
+ push %r13
+ push %r12
+ push %rbx
+ push %rbp
+
+ mov D, B2
+ imul DINV, B2
+ neg B2
+ mov B2, B2md
+ sub D, B2md
+
+ C D not needed until final reduction
+ push D
+ mov UN_INPUT, UN C Clobbers D
+
+ mov DINV, %rax
+ mul U1
+ mov %rax, Q0
+ add U1, %rdx
+ mov %rdx, T
+
+ mov B2, %rax
+ mul U1
+ mov -8(UP, UN, 8), U0
+ mov (UP, UN, 8), U1
+ mov T, (QP, UN, 8)
+ add %rax, U0
+ adc %rdx, U1
+ sbb U2, U2
+ dec UN
+ mov U1, %rax
+ jz L(final)
+
+ ALIGN(16)
+
+ C Loop is 28 instructions, 30 decoder slots, should run in 10 cycles.
+ C At entry, %rax holds an extra copy of U1
+L(loop):
+ C {Q2, Q1, Q0} <-- DINV * U1 + B (Q0 + U2 DINV) + B^2 U2
+ C Remains to add in B (U1 + c)
+ mov DINV, Q1
+ mov U2, Q2
+ and U2, Q1
+ neg Q2
+ mul DINV
+ add %rdx, Q1
+ adc $0, Q2
+ add Q0, Q1
+ mov %rax, Q0
+ mov B2, %rax
+ lea (B2md, U0), T
+ adc $0, Q2
+
+ C {U2, U1, U0} <-- (U0 + U2 B2 -c U) B + U1 B2 + u
+ mul U1
+ and B2, U2
+ add U2, U0
+ cmovnc U0, T
+
+ C {QP+UN, ...} <-- {QP+UN, ...} + {Q2, Q1} + U1 + c
+ adc U1, Q1
+ mov -8(UP, UN, 8), U0
+ adc Q2, 8(QP, UN, 8)
+ jc L(q_incr)
+L(q_incr_done):
+ add %rax, U0
+ mov T, %rax
+ adc %rdx, %rax
+ mov Q1, (QP, UN, 8)
+ sbb U2, U2
+ dec UN
+ mov %rax, U1
+ jnz L(loop)
+
+L(final):
+ pop D
+
+ mov U2, Q1
+ and D, U2
+ sub U2, %rax
+ neg Q1
+
+ mov %rax, U1
+ sub D, %rax
+ cmovc U1, %rax
+ sbb $-1, Q1
+
+ lea 1(%rax), T
+ mul DINV
+ add U0, %rax
+ adc T, %rdx
+ mov %rdx, T
+ imul D, %rdx
+ sub %rdx, U0
+ cmp U0, %rax
+ lea (U0, D), %rax
+ cmovnc U0, %rax
+ sbb $0, T
+ cmp D, %rax
+ jc L(div_done)
+ sub D, %rax
+ add $1, T
+L(div_done):
+ add T, Q0
+ mov Q0, (QP)
+ adc Q1, 8(QP)
+ jnc L(done)
+L(final_q_incr):
+ addq $1, 16(QP)
+ lea 8(QP), QP
+ jc L(final_q_incr)
+
+L(done):
+ pop %rbp
+ pop %rbx
+ pop %r12
+ pop %r13
+ pop %r14
+ pop %r15
+ FUNC_EXIT
+ ret
+
+L(q_incr):
+ C U1 is not live, so use it for indexing
+ lea 16(QP, UN, 8), U1
+L(q_incr_loop):
+ addq $1, (U1)
+ jnc L(q_incr_done)
+ lea 8(U1), U1
+ jmp L(q_incr_loop)
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/div_qr_2n_pi1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/div_qr_2n_pi1.asm
new file mode 100644
index 00000000000..5e59a0ac5d6
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/div_qr_2n_pi1.asm
@@ -0,0 +1,158 @@
+dnl x86-64 mpn_div_qr_2n_pi1
+dnl -- Divide an mpn number by a normalized 2-limb number,
+dnl using a single-limb inverse.
+
+dnl Copyright 2007, 2008, 2010-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 c/l
+C INPUT PARAMETERS
+define(`qp', `%rdi')
+define(`rp', `%rsi')
+define(`up_param', `%rdx')
+define(`un', `%rcx')
+define(`d1', `%r8')
+define(`d0', `%r9')
+define(`di_param', `8(%rsp)')
+
+define(`di', `%r10')
+define(`up', `%r11')
+define(`u2', `%rbx')
+define(`u1', `%r12')
+define(`t1', `%r13')
+define(`t0', `%r14')
+define(`md1', `%r15')
+
+C TODO
+C * Store qh in the same stack slot as di_param, instead of pushing
+C it. (we could put it in register %rbp, but then we would need to
+C save and restore that instead, which doesn't seem like a win).
+
+ABI_SUPPORT(DOS64)
+ABI_SUPPORT(STD64)
+
+ASM_START()
+ TEXT
+ ALIGN(16)
+PROLOGUE(mpn_div_qr_2n_pi1)
+ FUNC_ENTRY(4)
+IFDOS(` mov 56(%rsp), %r8 ')
+IFDOS(` mov 64(%rsp), %r9 ')
+IFDOS(`define(`di_param', `72(%rsp)')')
+ mov di_param, di
+ mov up_param, up
+ push %r15
+ push %r14
+ push %r13
+ push %r12
+ push %rbx
+
+ mov -16(up, un, 8), u1
+ mov -8(up, un, 8), u2
+
+ mov u1, t0
+ mov u2, t1
+ sub d0, t0
+ sbb d1, t1
+ cmovnc t0, u1
+ cmovnc t1, u2
+ C push qh which is !carry
+ sbb %rax, %rax
+ inc %rax
+ push %rax
+ lea -2(un), un
+ mov d1, md1
+ neg md1
+
+ jmp L(next)
+
+ ALIGN(16)
+L(loop):
+ C udiv_qr_3by2 (q,u2,u1,u2,u1,n0, d1,d0,di)
+ C Based on the optimized divrem_2.asm code.
+
+ mov di, %rax
+ mul u2
+ mov u1, t0
+ add %rax, t0 C q0 in t0
+ adc u2, %rdx
+ mov %rdx, t1 C q in t1
+ imul md1, %rdx
+ mov d0, %rax
+ lea (%rdx, u1), u2
+ mul t1
+ mov (up, un, 8), u1
+ sub d0, u1
+ sbb d1, u2
+ sub %rax, u1
+ sbb %rdx, u2
+ xor R32(%rax), R32(%rax)
+ xor R32(%rdx), R32(%rdx)
+ cmp t0, u2
+ cmovnc d0, %rax
+ cmovnc d1, %rdx
+ adc $0, t1
+ nop
+ add %rax, u1
+ adc %rdx, u2
+ cmp d1, u2
+ jae L(fix)
+L(bck):
+ mov t1, (qp, un, 8)
+L(next):
+ sub $1, un
+ jnc L(loop)
+L(end):
+ mov u2, 8(rp)
+ mov u1, (rp)
+
+ C qh on stack
+ pop %rax
+
+ pop %rbx
+ pop %r12
+ pop %r13
+ pop %r14
+ pop %r15
+ FUNC_EXIT()
+ ret
+
+L(fix): C Unlikely update. u2 >= d1
+ seta %dl
+ cmp d0, u1
+ setae %al
+ orb %dl, %al C "orb" form to placate Sun tools
+ je L(bck)
+ inc t1
+ sub d0, u1
+ sbb d1, u2
+ jmp L(bck)
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/div_qr_2u_pi1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/div_qr_2u_pi1.asm
new file mode 100644
index 00000000000..85af96fbf6f
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/div_qr_2u_pi1.asm
@@ -0,0 +1,200 @@
+dnl x86-64 mpn_div_qr_2u_pi1
+dnl -- Divide an mpn number by an unnormalized 2-limb number,
+dnl using a single-limb inverse and shifting the dividend on the fly.
+
+dnl Copyright 2007, 2008, 2010, 2011 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 c/l
+C INPUT PARAMETERS
+define(`qp', `%rdi')
+define(`rp', `%rsi')
+define(`up_param', `%rdx')
+define(`un_param', `%rcx') dnl %rcx needed for shift count
+define(`d1', `%r8')
+define(`d0', `%r9')
+define(`shift_param', `FRAME+8(%rsp)')
+define(`di_param', `FRAME+16(%rsp)')
+
+define(`di', `%r10')
+define(`up', `%r11')
+define(`un', `%rbp')
+define(`u2', `%rbx')
+define(`u1', `%r12')
+define(`u0', `%rsi') dnl Same as rp, which is saved and restored.
+define(`t1', `%r13')
+define(`t0', `%r14')
+define(`md1', `%r15')
+
+ASM_START()
+ TEXT
+ ALIGN(16)
+deflit(`FRAME', 0)
+PROLOGUE(mpn_div_qr_2u_pi1)
+ mov di_param, di
+ mov up_param, up
+ push %r15
+ push %r14
+ push %r13
+ push %r12
+ push %rbx
+ push %rbp
+ push rp
+deflit(`FRAME', 56)
+ lea -2(un_param), un
+ mov d1, md1
+ neg md1
+
+ C int parameter, 32 bits only
+ movl shift_param, R32(%rcx)
+
+ C FIXME: Different code for SHLD_SLOW
+
+ xor R32(u2), R32(u2)
+ mov 8(up, un, 8), u1
+ shld %cl, u1, u2
+ C Remains to read (up, un, 8) and shift u1, u0
+ C udiv_qr_3by2 (qh,u2,u1,u2,u1,n0, d1,d0,di)
+ mov di, %rax
+ mul u2
+ mov (up, un, 8), u0
+ shld %cl, u0, u1
+ mov u1, t0
+ add %rax, t0 C q0 in t0
+ adc u2, %rdx
+ mov %rdx, t1 C q in t1
+ imul md1, %rdx
+ mov d0, %rax
+ lea (%rdx, u1), u2
+ mul t1
+ mov u0, u1
+ shl %cl, u1
+ sub d0, u1
+ sbb d1, u2
+ sub %rax, u1
+ sbb %rdx, u2
+ xor R32(%rax), R32(%rax)
+ xor R32(%rdx), R32(%rdx)
+ cmp t0, u2
+ cmovnc d0, %rax
+ cmovnc d1, %rdx
+ adc $0, t1
+ nop
+ add %rax, u1
+ adc %rdx, u2
+ cmp d1, u2
+ jae L(fix_qh)
+L(bck_qh):
+ push t1 C push qh on stack
+
+ jmp L(next)
+
+ ALIGN(16)
+L(loop):
+ C udiv_qr_3by2 (q,u2,u1,u2,u1,n0, d1,d0,di)
+ C Based on the optimized divrem_2.asm code.
+
+ mov di, %rax
+ mul u2
+ mov (up, un, 8), u0
+ xor R32(t1), R32(t1)
+ shld %cl, u0, t1
+ or t1, u1
+ mov u1, t0
+ add %rax, t0 C q0 in t0
+ adc u2, %rdx
+ mov %rdx, t1 C q in t1
+ imul md1, %rdx
+ mov d0, %rax
+ lea (%rdx, u1), u2
+ mul t1
+ mov u0, u1
+ shl %cl, u1
+ sub d0, u1
+ sbb d1, u2
+ sub %rax, u1
+ sbb %rdx, u2
+ xor R32(%rax), R32(%rax)
+ xor R32(%rdx), R32(%rdx)
+ cmp t0, u2
+ cmovnc d0, %rax
+ cmovnc d1, %rdx
+ adc $0, t1
+ nop
+ add %rax, u1
+ adc %rdx, u2
+ cmp d1, u2
+ jae L(fix)
+L(bck):
+ mov t1, (qp, un, 8)
+L(next):
+ sub $1, un
+ jnc L(loop)
+L(end):
+ C qh on stack
+ pop %rax
+ pop rp
+ shrd %cl, u2, u1
+ shr %cl, u2
+ mov u2, 8(rp)
+ mov u1, (rp)
+
+ pop %rbp
+ pop %rbx
+ pop %r12
+ pop %r13
+ pop %r14
+ pop %r15
+ ret
+
+L(fix): C Unlikely update. u2 >= d1
+ seta %dl
+ cmp d0, u1
+ setae %al
+ orb %dl, %al C "orb" form to placate Sun tools
+ je L(bck)
+ inc t1
+ sub d0, u1
+ sbb d1, u2
+ jmp L(bck)
+
+C Duplicated, just jumping back to a different address.
+L(fix_qh): C Unlikely update. u2 >= d1
+ seta %dl
+ cmp d0, u1
+ setae %al
+ orb %dl, %al C "orb" form to placate Sun tools
+ je L(bck_qh)
+ inc t1
+ sub d0, u1
+ sbb d1, u2
+ jmp L(bck_qh)
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/dive_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/dive_1.asm
new file mode 100644
index 00000000000..988bdab632d
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/dive_1.asm
@@ -0,0 +1,158 @@
+dnl AMD64 mpn_divexact_1 -- mpn by limb exact division.
+
+dnl Copyright 2001, 2002, 2004-2006, 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/limb
+C AMD K8,K9 10
+C AMD K10 10
+C Intel P4 33
+C Intel core2 13.25
+C Intel corei 14
+C Intel atom 42
+C VIA nano 43
+
+C A quick adoption of the 32-bit K7 code.
+
+
+C INPUT PARAMETERS
+C rp rdi
+C up rsi
+C n rdx
+C divisor rcx
+
+ABI_SUPPORT(DOS64)
+ABI_SUPPORT(STD64)
+
+ASM_START()
+ TEXT
+ ALIGN(16)
+PROLOGUE(mpn_divexact_1)
+ FUNC_ENTRY(4)
+ push %rbx
+
+ mov %rcx, %rax
+ xor R32(%rcx), R32(%rcx) C shift count
+ mov %rdx, %r8
+
+ bt $0, R32(%rax)
+ jnc L(evn) C skip bsfq unless divisor is even
+
+L(odd): mov %rax, %rbx
+ shr R32(%rax)
+ and $127, R32(%rax) C d/2, 7 bits
+
+ LEA( binvert_limb_table, %rdx)
+
+ movzbl (%rdx,%rax), R32(%rax) C inv 8 bits
+
+ mov %rbx, %r11 C d without twos
+
+ lea (%rax,%rax), R32(%rdx) C 2*inv
+ imul R32(%rax), R32(%rax) C inv*inv
+ imul R32(%rbx), R32(%rax) C inv*inv*d
+ sub R32(%rax), R32(%rdx) C inv = 2*inv - inv*inv*d, 16 bits
+
+ lea (%rdx,%rdx), R32(%rax) C 2*inv
+ imul R32(%rdx), R32(%rdx) C inv*inv
+ imul R32(%rbx), R32(%rdx) C inv*inv*d
+ sub R32(%rdx), R32(%rax) C inv = 2*inv - inv*inv*d, 32 bits
+
+ lea (%rax,%rax), %r10 C 2*inv
+ imul %rax, %rax C inv*inv
+ imul %rbx, %rax C inv*inv*d
+ sub %rax, %r10 C inv = 2*inv - inv*inv*d, 64 bits
+
+ lea (%rsi,%r8,8), %rsi C up end
+ lea -8(%rdi,%r8,8), %rdi C rp end
+ neg %r8 C -n
+
+ mov (%rsi,%r8,8), %rax C up[0]
+
+ inc %r8
+ jz L(one)
+
+ mov (%rsi,%r8,8), %rdx C up[1]
+
+ shrd R8(%rcx), %rdx, %rax
+
+ xor R32(%rbx), R32(%rbx)
+ jmp L(ent)
+
+L(evn): bsf %rax, %rcx
+ shr R8(%rcx), %rax
+ jmp L(odd)
+
+ ALIGN(8)
+L(top):
+ C rax q
+ C rbx carry bit, 0 or 1
+ C rcx shift
+ C rdx
+ C rsi up end
+ C rdi rp end
+ C r8 counter, limbs, negative
+ C r10 d^(-1) mod 2^64
+ C r11 d, shifted down
+
+ mul %r11 C carry limb in rdx 0 10
+ mov -8(%rsi,%r8,8), %rax C
+ mov (%rsi,%r8,8), %r9 C
+ shrd R8(%rcx), %r9, %rax C
+ nop C
+ sub %rbx, %rax C apply carry bit
+ setc %bl C
+ sub %rdx, %rax C apply carry limb 5
+ adc $0, %rbx C 6
+L(ent): imul %r10, %rax C 6
+ mov %rax, (%rdi,%r8,8) C
+ inc %r8 C
+ jnz L(top)
+
+ mul %r11 C carry limb in rdx
+ mov -8(%rsi), %rax C up high limb
+ shr R8(%rcx), %rax
+ sub %rbx, %rax C apply carry bit
+ sub %rdx, %rax C apply carry limb
+ imul %r10, %rax
+ mov %rax, (%rdi)
+ pop %rbx
+ FUNC_EXIT()
+ ret
+
+L(one): shr R8(%rcx), %rax
+ imul %r10, %rax
+ mov %rax, (%rdi)
+ pop %rbx
+ FUNC_EXIT()
+ ret
+
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/divrem_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/divrem_1.asm
new file mode 100644
index 00000000000..91928d9aa30
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/divrem_1.asm
@@ -0,0 +1,306 @@
+dnl x86-64 mpn_divrem_1 -- mpn by limb division.
+
+dnl Copyright 2004, 2005, 2007-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 norm unorm frac
+C AMD K8,K9 13 13 12
+C AMD K10 13 13 12
+C Intel P4 43 44 43
+C Intel core2 24.5 24.5 19.5
+C Intel corei 20.5 19.5 18
+C Intel atom 43 46 36
+C VIA nano 25.5 25.5 24
+
+C mp_limb_t
+C mpn_divrem_1 (mp_ptr qp, mp_size_t fn,
+C mp_srcptr np, mp_size_t nn, mp_limb_t d)
+
+C mp_limb_t
+C mpn_preinv_divrem_1 (mp_ptr qp, mp_size_t fn,
+C mp_srcptr np, mp_size_t nn, mp_limb_t d,
+C mp_limb_t dinv, int cnt)
+
+C INPUT PARAMETERS
+define(`qp', `%rdi')
+define(`fn_param', `%rsi')
+define(`up_param', `%rdx')
+define(`un_param', `%rcx')
+define(`d', `%r8')
+define(`dinv', `%r9') C only for mpn_preinv_divrem_1
+C shift passed on stack C only for mpn_preinv_divrem_1
+
+define(`cnt', `%rcx')
+define(`up', `%rsi')
+define(`fn', `%r12')
+define(`un', `%rbx')
+
+
+C rax rbx rcx rdx rsi rdi rbp r8 r9 r10 r11 r12 r13 r14 r15
+C cnt qp d dinv
+
+ABI_SUPPORT(DOS64)
+ABI_SUPPORT(STD64)
+
+IFSTD(`define(`CNTOFF', `40($1)')')
+IFDOS(`define(`CNTOFF', `104($1)')')
+
+ASM_START()
+ TEXT
+ ALIGN(16)
+PROLOGUE(mpn_preinv_divrem_1)
+ FUNC_ENTRY(4)
+IFDOS(` mov 56(%rsp), %r8 ')
+IFDOS(` mov 64(%rsp), %r9 ')
+ xor R32(%rax), R32(%rax)
+ push %r13
+ push %r12
+ push %rbp
+ push %rbx
+
+ mov fn_param, fn
+ mov un_param, un
+ add fn_param, un_param
+ mov up_param, up
+
+ lea -8(qp,un_param,8), qp
+
+ test d, d
+ js L(nent)
+
+ mov CNTOFF(%rsp), R8(cnt)
+ shl R8(cnt), d
+ jmp L(uent)
+EPILOGUE()
+
+ ALIGN(16)
+PROLOGUE(mpn_divrem_1)
+ FUNC_ENTRY(4)
+IFDOS(` mov 56(%rsp), %r8 ')
+ xor R32(%rax), R32(%rax)
+ push %r13
+ push %r12
+ push %rbp
+ push %rbx
+
+ mov fn_param, fn
+ mov un_param, un
+ add fn_param, un_param
+ mov up_param, up
+ je L(ret)
+
+ lea -8(qp,un_param,8), qp
+ xor R32(%rbp), R32(%rbp)
+
+ test d, d
+ jns L(unnormalized)
+
+L(normalized):
+ test un, un
+ je L(8) C un == 0
+ mov -8(up,un,8), %rbp
+ dec un
+ mov %rbp, %rax
+ sub d, %rbp
+ cmovc %rax, %rbp
+ sbb R32(%rax), R32(%rax)
+ inc R32(%rax)
+ mov %rax, (qp)
+ lea -8(qp), qp
+L(8):
+IFSTD(` push %rdi ')
+IFSTD(` push %rsi ')
+ push %r8
+IFSTD(` mov d, %rdi ')
+IFDOS(` mov d, %rcx ')
+ CALL( mpn_invert_limb)
+ pop %r8
+IFSTD(` pop %rsi ')
+IFSTD(` pop %rdi ')
+
+ mov %rax, dinv
+ mov %rbp, %rax
+ jmp L(nent)
+
+ ALIGN(16)
+L(ntop):mov (up,un,8), %r10 C K8-K10 P6-CNR P6-NHM P4
+ mul dinv C 0,13 0,20 0,18 0,45
+ add %r10, %rax C 4 8 3 12
+ adc %rbp, %rdx C 5 9 10 13
+ mov %rax, %rbp C 5 9 4 13
+ mov %rdx, %r13 C 6 11 12 23
+ imul d, %rdx C 6 11 11 23
+ sub %rdx, %r10 C 10 16 14 33
+ mov d, %rax C
+ add %r10, %rax C 11 17 15 34
+ cmp %rbp, %r10 C 11 17 15 34
+ cmovc %r10, %rax C 12 18 16 35
+ adc $-1, %r13 C
+ cmp d, %rax C
+ jae L(nfx) C
+L(nok): mov %r13, (qp) C
+ sub $8, qp C
+L(nent):lea 1(%rax), %rbp C
+ dec un C
+ jns L(ntop) C
+
+ xor R32(%rcx), R32(%rcx)
+ jmp L(87)
+
+L(nfx): sub d, %rax
+ inc %r13
+ jmp L(nok)
+
+L(unnormalized):
+ test un, un
+ je L(44)
+ mov -8(up,un,8), %rax
+ cmp d, %rax
+ jae L(44)
+ mov %rbp, (qp)
+ mov %rax, %rbp
+ lea -8(qp), qp
+ je L(ret)
+ dec un
+L(44):
+ bsr d, %rcx
+ not R32(%rcx)
+ shl R8(%rcx), d
+ shl R8(%rcx), %rbp
+
+ push %rcx
+IFSTD(` push %rdi ')
+IFSTD(` push %rsi ')
+ push %r8
+IFSTD(` mov d, %rdi ')
+IFDOS(` mov d, %rcx ')
+ CALL( mpn_invert_limb)
+ pop %r8
+IFSTD(` pop %rsi ')
+IFSTD(` pop %rdi ')
+ pop %rcx
+
+ mov %rax, dinv
+ mov %rbp, %rax
+ test un, un
+ je L(87)
+
+L(uent):dec un
+ mov (up,un,8), %rbp
+ neg R32(%rcx)
+ shr R8(%rcx), %rbp
+ neg R32(%rcx)
+ or %rbp, %rax
+ jmp L(ent)
+
+ ALIGN(16)
+L(utop):mov (up,un,8), %r10
+ shl R8(%rcx), %rbp
+ neg R32(%rcx)
+ shr R8(%rcx), %r10
+ neg R32(%rcx)
+ or %r10, %rbp
+ mul dinv
+ add %rbp, %rax
+ adc %r11, %rdx
+ mov %rax, %r11
+ mov %rdx, %r13
+ imul d, %rdx
+ sub %rdx, %rbp
+ mov d, %rax
+ add %rbp, %rax
+ cmp %r11, %rbp
+ cmovc %rbp, %rax
+ adc $-1, %r13
+ cmp d, %rax
+ jae L(ufx)
+L(uok): mov %r13, (qp)
+ sub $8, qp
+L(ent): mov (up,un,8), %rbp
+ dec un
+ lea 1(%rax), %r11
+ jns L(utop)
+
+L(uend):shl R8(%rcx), %rbp
+ mul dinv
+ add %rbp, %rax
+ adc %r11, %rdx
+ mov %rax, %r11
+ mov %rdx, %r13
+ imul d, %rdx
+ sub %rdx, %rbp
+ mov d, %rax
+ add %rbp, %rax
+ cmp %r11, %rbp
+ cmovc %rbp, %rax
+ adc $-1, %r13
+ cmp d, %rax
+ jae L(efx)
+L(eok): mov %r13, (qp)
+ sub $8, qp
+ jmp L(87)
+
+L(ufx): sub d, %rax
+ inc %r13
+ jmp L(uok)
+L(efx): sub d, %rax
+ inc %r13
+ jmp L(eok)
+
+L(87): mov d, %rbp
+ neg %rbp
+ jmp L(fent)
+
+ ALIGN(16) C K8-K10 P6-CNR P6-NHM P4
+L(ftop):mul dinv C 0,12 0,17 0,17
+ add %r11, %rdx C 5 8 10
+ mov %rax, %r11 C 4 8 3
+ mov %rdx, %r13 C 6 9 11
+ imul %rbp, %rdx C 6 9 11
+ mov d, %rax C
+ add %rdx, %rax C 10 14 14
+ cmp %r11, %rdx C 10 14 14
+ cmovc %rdx, %rax C 11 15 15
+ adc $-1, %r13 C
+ mov %r13, (qp) C
+ sub $8, qp C
+L(fent):lea 1(%rax), %r11 C
+ dec fn C
+ jns L(ftop) C
+
+ shr R8(%rcx), %rax
+L(ret): pop %rbx
+ pop %rbp
+ pop %r12
+ pop %r13
+ FUNC_EXIT()
+ ret
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/divrem_2.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/divrem_2.asm
new file mode 100644
index 00000000000..66c2da1a054
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/divrem_2.asm
@@ -0,0 +1,189 @@
+dnl x86-64 mpn_divrem_2 -- Divide an mpn number by a normalized 2-limb number.
+
+dnl Copyright 2007, 2008, 2010 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 best
+C AMD K8,K9 18
+C AMD K10 18
+C AMD bull
+C AMD pile
+C AMD bobcat
+C AMD jaguar
+C Intel P4 68
+C Intel core 34
+C Intel NHM 30.25
+C Intel SBR 21.3
+C Intel IBR 21.4
+C Intel HWL 20.6
+C Intel BWL
+C Intel atom 73
+C VIA nano 33
+
+
+C INPUT PARAMETERS
+define(`qp', `%rdi')
+define(`fn', `%rsi')
+define(`up_param', `%rdx')
+define(`un_param', `%rcx')
+define(`dp', `%r8')
+
+ABI_SUPPORT(DOS64)
+ABI_SUPPORT(STD64)
+
+ASM_START()
+ TEXT
+ ALIGN(16)
+PROLOGUE(mpn_divrem_2)
+ FUNC_ENTRY(4)
+IFDOS(` mov 56(%rsp), %r8 ')
+ push %r15
+ push %r14
+ push %r13
+ push %r12
+ lea -24(%rdx,%rcx,8), %r12 C r12 = &up[un-1]
+ mov %rsi, %r13
+ push %rbp
+ mov %rdi, %rbp
+ push %rbx
+ mov 8(%r8), %r11 C d1
+ mov 16(%r12), %rbx
+ mov (%r8), %r8 C d0
+ mov 8(%r12), %r10
+
+ xor R32(%r15), R32(%r15)
+ cmp %rbx, %r11
+ ja L(2)
+ setb %dl
+ cmp %r10, %r8
+ setbe %al
+ orb %al, %dl C "orb" form to placate Sun tools
+ je L(2)
+ inc R32(%r15)
+ sub %r8, %r10
+ sbb %r11, %rbx
+L(2):
+ lea -3(%rcx,%r13), %r14 C un + fn - 3
+ test %r14, %r14
+ js L(end)
+
+ push %r8
+ push %r10
+ push %r11
+IFSTD(` mov %r11, %rdi ')
+IFDOS(` mov %r11, %rcx ')
+ CALL( mpn_invert_limb)
+ pop %r11
+ pop %r10
+ pop %r8
+
+ mov %r11, %rdx
+ mov %rax, %rdi
+ imul %rax, %rdx
+ mov %rdx, %r9
+ mul %r8
+ xor R32(%rcx), R32(%rcx)
+ add %r8, %r9
+ adc $-1, %rcx
+ add %rdx, %r9
+ adc $0, %rcx
+ js 2f
+1: dec %rdi
+ sub %r11, %r9
+ sbb $0, %rcx
+ jns 1b
+2:
+
+ lea (%rbp,%r14,8), %rbp
+ mov %r11, %rsi
+ neg %rsi C -d1
+
+C rax rbx rcx rdx rsi rdi rbp r8 r9 r10 r11 r12 r13 r14 r15
+C n2 un -d1 dinv qp d0 q0 d1 up fn msl
+
+ ALIGN(16)
+L(top): mov %rdi, %rax C di ncp
+ mul %rbx C 0, 17
+ mov %r10, %rcx C
+ add %rax, %rcx C 4
+ adc %rbx, %rdx C 5
+ mov %rdx, %r9 C q 6
+ imul %rsi, %rdx C 6
+ mov %r8, %rax C ncp
+ lea (%rdx, %r10), %rbx C n1 -= ... 10
+ xor R32(%r10), R32(%r10) C
+ mul %r9 C 7
+ cmp %r14, %r13 C
+ jg L(19) C
+ mov (%r12), %r10 C
+ sub $8, %r12 C
+L(19): sub %r8, %r10 C ncp
+ sbb %r11, %rbx C 11
+ sub %rax, %r10 C 11
+ sbb %rdx, %rbx C 12
+ xor R32(%rax), R32(%rax) C
+ xor R32(%rdx), R32(%rdx) C
+ cmp %rcx, %rbx C 13
+ cmovnc %r8, %rax C 14
+ cmovnc %r11, %rdx C 14
+ adc $0, %r9 C adjust q 14
+ nop
+ add %rax, %r10 C 15
+ adc %rdx, %rbx C 16
+ cmp %r11, %rbx C
+ jae L(fix) C
+L(bck): mov %r9, (%rbp) C
+ sub $8, %rbp C
+ dec %r14
+ jns L(top)
+
+L(end): mov %r10, 8(%r12)
+ mov %rbx, 16(%r12)
+ pop %rbx
+ pop %rbp
+ pop %r12
+ pop %r13
+ pop %r14
+ mov %r15, %rax
+ pop %r15
+ FUNC_EXIT()
+ ret
+
+L(fix): seta %dl
+ cmp %r8, %r10
+ setae %al
+ orb %dl, %al C "orb" form to placate Sun tools
+ je L(bck)
+ inc %r9
+ sub %r8, %r10
+ sbb %r11, %rbx
+ jmp L(bck)
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/dos64.m4 b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/dos64.m4
new file mode 100644
index 00000000000..9414623b56c
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/dos64.m4
@@ -0,0 +1,100 @@
+divert(-1)
+dnl Copyright 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/.
+
+define(`HOST_DOS64')
+
+
+dnl On DOS64 we always generate position-independent-code
+dnl
+
+define(`PIC')
+
+
+define(`LEA',`
+ lea $1(%rip), $2
+')
+
+
+dnl Usage: CALL(funcname)
+dnl
+dnl Simply override the definition in x86_64-defs.m4.
+
+define(`CALL',`call GSYM_PREFIX`'$1')
+
+
+dnl Usage: JUMPTABSECT
+
+define(`JUMPTABSECT', `RODATA')
+
+
+dnl Usage: JMPENT(targlabel,tablabel)
+
+define(`JMPENT', `.long $1-$2')
+
+
+dnl Usage: FUNC_ENTRY(nregparmas)
+dnl Usage: FUNC_EXIT()
+
+dnl FUNC_ENTRY and FUNC_EXIT provide an easy path for adoption of standard
+dnl ABI assembly to the DOS64 ABI.
+
+define(`FUNC_ENTRY',
+ `push %rdi
+ push %rsi
+ mov %rcx, %rdi
+ifelse(eval($1>=2),1,`dnl
+ mov %rdx, %rsi
+ifelse(eval($1>=3),1,`dnl
+ mov %r8, %rdx
+ifelse(eval($1>=4),1,`dnl
+ mov %r9, %rcx
+')')')')
+
+define(`FUNC_EXIT',
+ `pop %rsi
+ pop %rdi')
+
+
+dnl Target ABI macros. For DOS64 we override the defaults.
+
+define(`IFDOS', `$1')
+define(`IFSTD', `')
+define(`IFELF', `')
+
+
+dnl Usage: PROTECT(symbol)
+dnl
+dnl Used for private GMP symbols that should never be overridden by users.
+dnl This can save reloc entries and improve shlib sharing as well as
+dnl application startup times
+
+define(`PROTECT', `')
+
+
+divert`'dnl
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/fastavx/copyd.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/fastavx/copyd.asm
new file mode 100644
index 00000000000..41c55de5ca1
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/fastavx/copyd.asm
@@ -0,0 +1,171 @@
+dnl AMD64 mpn_copyd optimised for CPUs with fast AVX.
+
+dnl Contributed to the GNU project by Torbjörn Granlund.
+
+dnl Copyright 2003, 2005, 2007, 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/limb aligned unaligned best seen for cpu?
+C AMD K8,K9 n/a
+C AMD K10 n/a
+C AMD bull n/a
+C AMD pile 4.87 4.87 N
+C AMD steam ? ?
+C AMD bobcat n/a
+C AMD jaguar n/a
+C Intel P4 n/a
+C Intel core n/a
+C Intel NHM n/a
+C Intel SBR 0.50 0.91 N
+C Intel IBR ?
+C Intel HWL 0.25 0.30 Y
+C Intel BWL ?
+C Intel atom n/a
+C VIA nano n/a
+
+C We try to do as many 32-byte operations as possible. The top-most and
+C bottom-most writes might need 8-byte operations. For the bulk copying, we
+C write using aligned 32-byte operations, but we read with both aligned and
+C unaligned 32-byte operations.
+
+define(`rp', `%rdi')
+define(`up', `%rsi')
+define(`n', `%rdx')
+
+ABI_SUPPORT(DOS64)
+ABI_SUPPORT(STD64)
+
+dnl define(`vmovdqu', vlddqu)
+
+ASM_START()
+ TEXT
+ ALIGN(32)
+PROLOGUE(mpn_copyd)
+ FUNC_ENTRY(3)
+
+ lea -32(rp,n,8), rp
+ lea -32(up,n,8), up
+
+ cmp $7, n C basecase needed for correctness
+ jbe L(bc)
+
+ test $8, R8(rp) C is rp 16-byte aligned?
+ jz L(a2) C jump if rp aligned
+ mov 24(up), %rax
+ lea -8(up), up
+ mov %rax, 24(rp)
+ lea -8(rp), rp
+ dec n
+L(a2): test $16, R8(rp) C is rp 32-byte aligned?
+ jz L(a3) C jump if rp aligned
+ vmovdqu 16(up), %xmm0
+ lea -16(up), up
+ vmovdqa %xmm0, 16(rp)
+ lea -16(rp), rp
+ sub $2, n
+L(a3): sub $16, n
+ jc L(sma)
+
+ ALIGN(16)
+L(top): vmovdqu (up), %ymm0
+ vmovdqu -32(up), %ymm1
+ vmovdqu -64(up), %ymm2
+ vmovdqu -96(up), %ymm3
+ lea -128(up), up
+ vmovdqa %ymm0, (rp)
+ vmovdqa %ymm1, -32(rp)
+ vmovdqa %ymm2, -64(rp)
+ vmovdqa %ymm3, -96(rp)
+ lea -128(rp), rp
+L(ali): sub $16, n
+ jnc L(top)
+
+L(sma): test $8, R8(n)
+ jz 1f
+ vmovdqu (up), %ymm0
+ vmovdqu -32(up), %ymm1
+ lea -64(up), up
+ vmovdqa %ymm0, (rp)
+ vmovdqa %ymm1, -32(rp)
+ lea -64(rp), rp
+1:
+ test $4, R8(n)
+ jz 1f
+ vmovdqu (up), %ymm0
+ lea -32(up), up
+ vmovdqa %ymm0, (rp)
+ lea -32(rp), rp
+1:
+ test $2, R8(n)
+ jz 1f
+ vmovdqu 16(up), %xmm0
+ lea -16(up), up
+ vmovdqa %xmm0, 16(rp)
+ lea -16(rp), rp
+1:
+ test $1, R8(n)
+ jz 1f
+ mov 24(up), %r8
+ mov %r8, 24(rp)
+1:
+ FUNC_EXIT()
+ ret
+
+ ALIGN(16)
+L(bc): test $4, R8(n)
+ jz 1f
+ mov 24(up), %rax
+ mov 16(up), %rcx
+ mov 8(up), %r8
+ mov (up), %r9
+ lea -32(up), up
+ mov %rax, 24(rp)
+ mov %rcx, 16(rp)
+ mov %r8, 8(rp)
+ mov %r9, (rp)
+ lea -32(rp), rp
+1:
+ test $2, R8(n)
+ jz 1f
+ mov 24(up), %rax
+ mov 16(up), %rcx
+ lea -16(up), up
+ mov %rax, 24(rp)
+ mov %rcx, 16(rp)
+ lea -16(rp), rp
+1:
+ test $1, R8(n)
+ jz 1f
+ mov 24(up), %rax
+ mov %rax, 24(rp)
+1:
+ FUNC_EXIT()
+ ret
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/fastavx/copyi.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/fastavx/copyi.asm
new file mode 100644
index 00000000000..97264ef8375
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/fastavx/copyi.asm
@@ -0,0 +1,168 @@
+dnl AMD64 mpn_copyi optimised for CPUs with fast AVX.
+
+dnl Contributed to the GNU project by Torbjörn Granlund.
+
+dnl Copyright 2003, 2005, 2007, 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/limb aligned unaligned best seen for cpu?
+C AMD K8,K9 n/a
+C AMD K10 n/a
+C AMD bull n/a
+C AMD pile 4.87 4.87 N
+C AMD steam ? ?
+C AMD bobcat n/a
+C AMD jaguar n/a
+C Intel P4 n/a
+C Intel core n/a
+C Intel NHM n/a
+C Intel SBR 0.50 0.91 N
+C Intel IBR ?
+C Intel HWL 0.25 0.30 Y
+C Intel BWL ?
+C Intel atom n/a
+C VIA nano n/a
+
+C We try to do as many 32-byte operations as possible. The top-most and
+C bottom-most writes might need 8-byte operations. For the bulk copying, we
+C write using aligned 32-byte operations, but we read with both aligned and
+C unaligned 32-byte operations.
+
+define(`rp', `%rdi')
+define(`up', `%rsi')
+define(`n', `%rdx')
+
+ABI_SUPPORT(DOS64)
+ABI_SUPPORT(STD64)
+
+dnl define(`vmovdqu', vlddqu)
+
+ASM_START()
+ TEXT
+ ALIGN(32)
+PROLOGUE(mpn_copyi)
+ FUNC_ENTRY(3)
+
+ cmp $7, n
+ jbe L(bc)
+
+ test $8, R8(rp) C is rp 16-byte aligned?
+ jz L(a2) C jump if rp aligned
+ mov (up), %rax
+ lea 8(up), up
+ mov %rax, (rp)
+ lea 8(rp), rp
+ dec n
+L(a2): test $16, R8(rp) C is rp 32-byte aligned?
+ jz L(a3) C jump if rp aligned
+ vmovdqu (up), %xmm0
+ lea 16(up), up
+ vmovdqa %xmm0, (rp)
+ lea 16(rp), rp
+ sub $2, n
+L(a3): sub $16, n
+ jc L(sma)
+
+ ALIGN(16)
+L(top): vmovdqu (up), %ymm0
+ vmovdqu 32(up), %ymm1
+ vmovdqu 64(up), %ymm2
+ vmovdqu 96(up), %ymm3
+ lea 128(up), up
+ vmovdqa %ymm0, (rp)
+ vmovdqa %ymm1, 32(rp)
+ vmovdqa %ymm2, 64(rp)
+ vmovdqa %ymm3, 96(rp)
+ lea 128(rp), rp
+L(ali): sub $16, n
+ jnc L(top)
+
+L(sma): test $8, R8(n)
+ jz 1f
+ vmovdqu (up), %ymm0
+ vmovdqu 32(up), %ymm1
+ lea 64(up), up
+ vmovdqa %ymm0, (rp)
+ vmovdqa %ymm1, 32(rp)
+ lea 64(rp), rp
+1:
+ test $4, R8(n)
+ jz 1f
+ vmovdqu (up), %ymm0
+ lea 32(up), up
+ vmovdqa %ymm0, (rp)
+ lea 32(rp), rp
+1:
+ test $2, R8(n)
+ jz 1f
+ vmovdqu (up), %xmm0
+ lea 16(up), up
+ vmovdqa %xmm0, (rp)
+ lea 16(rp), rp
+1:
+L(end): test $1, R8(n)
+ jz 1f
+ mov (up), %r8
+ mov %r8, (rp)
+1:
+ FUNC_EXIT()
+ ret
+
+ ALIGN(16)
+L(bc): test $4, R8(n)
+ jz 1f
+ mov (up), %rax
+ mov 8(up), %rcx
+ mov 16(up), %r8
+ mov 24(up), %r9
+ lea 32(up), up
+ mov %rax, (rp)
+ mov %rcx, 8(rp)
+ mov %r8, 16(rp)
+ mov %r9, 24(rp)
+ lea 32(rp), rp
+1:
+ test $2, R8(n)
+ jz 1f
+ mov (up), %rax
+ mov 8(up), %rcx
+ lea 16(up), up
+ mov %rax, (rp)
+ mov %rcx, 8(rp)
+ lea 16(rp), rp
+1:
+ test $1, R8(n)
+ jz 1f
+ mov (up), %rax
+ mov %rax, (rp)
+1:
+ FUNC_EXIT()
+ ret
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/fastsse/README b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/fastsse/README
new file mode 100644
index 00000000000..520551ed99d
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/fastsse/README
@@ -0,0 +1,21 @@
+This directory contains code for x86-64 processors with fast
+implementations of SSE operations, hence the name "fastsse".
+
+Current processors that might benefit from this code are:
+
+ AMD K10
+ AMD Bulldozer
+ Intel Nocona
+ Intel Nehalem/Westmere
+ Intel Sandybridge/Ivybridge
+ VIA Nano
+
+Current processors that do not benefit from this code are:
+
+ AMD K8
+ AMD Bobcat
+ Intel Atom
+
+Intel Conroe/Penryn is a border case; its handling of non-aligned
+128-bit memory operands is poor. VIA Nano also have poor handling of
+non-aligned operands.
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/fastsse/com-palignr.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/fastsse/com-palignr.asm
new file mode 100644
index 00000000000..d9641e890de
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/fastsse/com-palignr.asm
@@ -0,0 +1,302 @@
+dnl AMD64 mpn_com optimised for CPUs with fast SSE copying and SSSE3.
+
+dnl Copyright 2012, 2013 Free Software Foundation, Inc.
+
+dnl Contributed to the GNU project by Torbjorn Granlund.
+
+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 cycles/limb cycles/limb good
+C aligned unaligned best seen for cpu?
+C AMD K8,K9 2.0 illop 1.0/1.0 N
+C AMD K10 0.85 illop Y/N
+C AMD bd1 1.39 ? 1.45 Y/N
+C AMD bobcat 1.97 ? 8.17 1.5/1.5 N
+C Intel P4 2.26 illop Y/N
+C Intel core2 0.52 0.82 opt/0.74 Y
+C Intel NHM 0.52 0.65 opt/opt Y
+C Intel SBR 0.51 0.55 opt/0.51 Y
+C Intel atom 1.16 1.70 opt/opt Y
+C VIA nano 1.09 1.10 opt/opt Y
+
+C We use only 16-byte operations, except for unaligned top-most and bottom-most
+C limbs. We use the SSSE3 palignr instruction when rp - up = 8 (mod 16). That
+C instruction is better adapted to mpn_copyd's needs, we need to contort the
+C code to use it here.
+C
+C For operands of < COM_SSE_THRESHOLD limbs, we use a plain 64-bit loop, taken
+C from the x86_64 default code.
+
+C INPUT PARAMETERS
+define(`rp', `%rdi')
+define(`up', `%rsi')
+define(`n', `%rdx')
+
+C There are three instructions for loading an aligned 128-bit quantity. We use
+C movaps, since it has the shortest coding.
+define(`movdqa', ``movaps'')
+
+ifdef(`COM_SSE_THRESHOLD',`',`define(`COM_SSE_THRESHOLD', 7)')
+
+ASM_START()
+ TEXT
+ ALIGN(64)
+PROLOGUE(mpn_com)
+ FUNC_ENTRY(3)
+
+ cmp $COM_SSE_THRESHOLD, n
+ jbe L(bc)
+
+ pcmpeqb %xmm7, %xmm7 C set to 111...111
+
+ test $8, R8(rp) C is rp 16-byte aligned?
+ jz L(rp_aligned) C jump if rp aligned
+
+ mov (up), %r8
+ lea 8(up), up
+ not %r8
+ mov %r8, (rp)
+ lea 8(rp), rp
+ dec n
+
+L(rp_aligned):
+ test $8, R8(up)
+ jnz L(uent)
+
+ifelse(eval(COM_SSE_THRESHOLD >= 8),1,
+` sub $8, n',
+` jmp L(am)')
+
+ ALIGN(16)
+L(atop):movdqa 0(up), %xmm0
+ movdqa 16(up), %xmm1
+ movdqa 32(up), %xmm2
+ movdqa 48(up), %xmm3
+ lea 64(up), up
+ pxor %xmm7, %xmm0
+ pxor %xmm7, %xmm1
+ pxor %xmm7, %xmm2
+ pxor %xmm7, %xmm3
+ movdqa %xmm0, (rp)
+ movdqa %xmm1, 16(rp)
+ movdqa %xmm2, 32(rp)
+ movdqa %xmm3, 48(rp)
+ lea 64(rp), rp
+L(am): sub $8, n
+ jnc L(atop)
+
+ test $4, R8(n)
+ jz 1f
+ movdqa (up), %xmm0
+ movdqa 16(up), %xmm1
+ lea 32(up), up
+ pxor %xmm7, %xmm0
+ pxor %xmm7, %xmm1
+ movdqa %xmm0, (rp)
+ movdqa %xmm1, 16(rp)
+ lea 32(rp), rp
+
+1: test $2, R8(n)
+ jz 1f
+ movdqa (up), %xmm0
+ lea 16(up), up
+ pxor %xmm7, %xmm0
+ movdqa %xmm0, (rp)
+ lea 16(rp), rp
+
+1: test $1, R8(n)
+ jz 1f
+ mov (up), %r8
+ not %r8
+ mov %r8, (rp)
+
+1: FUNC_EXIT()
+ ret
+
+L(uent):
+C Code handling up - rp = 8 (mod 16)
+
+C FIXME: The code below only handles overlap if it is close to complete, or
+C quite separate: up-rp < 5 or up-up > 15 limbs
+ lea -40(up), %rax C 40 = 5 * GMP_LIMB_BYTES
+ sub rp, %rax
+ cmp $80, %rax C 80 = (15-5) * GMP_LIMB_BYTES
+ jbe L(bc) C deflect to plain loop
+
+ sub $16, n
+ jc L(uend)
+
+ movdqa 120(up), %xmm3
+
+ sub $16, n
+ jmp L(um)
+
+ ALIGN(16)
+L(utop):movdqa 120(up), %xmm3
+ pxor %xmm7, %xmm0
+ movdqa %xmm0, -128(rp)
+ sub $16, n
+L(um): movdqa 104(up), %xmm2
+ palignr($8, %xmm2, %xmm3)
+ movdqa 88(up), %xmm1
+ pxor %xmm7, %xmm3
+ movdqa %xmm3, 112(rp)
+ palignr($8, %xmm1, %xmm2)
+ movdqa 72(up), %xmm0
+ pxor %xmm7, %xmm2
+ movdqa %xmm2, 96(rp)
+ palignr($8, %xmm0, %xmm1)
+ movdqa 56(up), %xmm3
+ pxor %xmm7, %xmm1
+ movdqa %xmm1, 80(rp)
+ palignr($8, %xmm3, %xmm0)
+ movdqa 40(up), %xmm2
+ pxor %xmm7, %xmm0
+ movdqa %xmm0, 64(rp)
+ palignr($8, %xmm2, %xmm3)
+ movdqa 24(up), %xmm1
+ pxor %xmm7, %xmm3
+ movdqa %xmm3, 48(rp)
+ palignr($8, %xmm1, %xmm2)
+ movdqa 8(up), %xmm0
+ pxor %xmm7, %xmm2
+ movdqa %xmm2, 32(rp)
+ palignr($8, %xmm0, %xmm1)
+ movdqa -8(up), %xmm3
+ pxor %xmm7, %xmm1
+ movdqa %xmm1, 16(rp)
+ palignr($8, %xmm3, %xmm0)
+ lea 128(up), up
+ lea 128(rp), rp
+ jnc L(utop)
+
+ pxor %xmm7, %xmm0
+ movdqa %xmm0, -128(rp)
+
+L(uend):test $8, R8(n)
+ jz 1f
+ movdqa 56(up), %xmm3
+ movdqa 40(up), %xmm2
+ palignr($8, %xmm2, %xmm3)
+ movdqa 24(up), %xmm1
+ pxor %xmm7, %xmm3
+ movdqa %xmm3, 48(rp)
+ palignr($8, %xmm1, %xmm2)
+ movdqa 8(up), %xmm0
+ pxor %xmm7, %xmm2
+ movdqa %xmm2, 32(rp)
+ palignr($8, %xmm0, %xmm1)
+ movdqa -8(up), %xmm3
+ pxor %xmm7, %xmm1
+ movdqa %xmm1, 16(rp)
+ palignr($8, %xmm3, %xmm0)
+ lea 64(up), up
+ pxor %xmm7, %xmm0
+ movdqa %xmm0, (rp)
+ lea 64(rp), rp
+
+1: test $4, R8(n)
+ jz 1f
+ movdqa 24(up), %xmm1
+ movdqa 8(up), %xmm0
+ palignr($8, %xmm0, %xmm1)
+ movdqa -8(up), %xmm3
+ pxor %xmm7, %xmm1
+ movdqa %xmm1, 16(rp)
+ palignr($8, %xmm3, %xmm0)
+ lea 32(up), up
+ pxor %xmm7, %xmm0
+ movdqa %xmm0, (rp)
+ lea 32(rp), rp
+
+1: test $2, R8(n)
+ jz 1f
+ movdqa 8(up), %xmm0
+ movdqa -8(up), %xmm3
+ palignr($8, %xmm3, %xmm0)
+ lea 16(up), up
+ pxor %xmm7, %xmm0
+ movdqa %xmm0, (rp)
+ lea 16(rp), rp
+
+1: test $1, R8(n)
+ jz 1f
+ mov (up), %r8
+ not %r8
+ mov %r8, (rp)
+
+1: FUNC_EXIT()
+ ret
+
+C Basecase code. Needed for good small operands speed, not for
+C correctness as the above code is currently written.
+
+L(bc): lea -8(rp), rp
+ sub $4, R32(n)
+ jc L(end)
+
+ifelse(eval(1 || COM_SSE_THRESHOLD >= 8),1,
+` ALIGN(16)')
+L(top): mov (up), %r8
+ mov 8(up), %r9
+ lea 32(rp), rp
+ mov 16(up), %r10
+ mov 24(up), %r11
+ lea 32(up), up
+ not %r8
+ not %r9
+ not %r10
+ not %r11
+ mov %r8, -24(rp)
+ mov %r9, -16(rp)
+ifelse(eval(1 || COM_SSE_THRESHOLD >= 8),1,
+` sub $4, R32(n)')
+ mov %r10, -8(rp)
+ mov %r11, (rp)
+ifelse(eval(1 || COM_SSE_THRESHOLD >= 8),1,
+` jnc L(top)')
+
+L(end): test $1, R8(n)
+ jz 1f
+ mov (up), %r8
+ not %r8
+ mov %r8, 8(rp)
+ lea 8(rp), rp
+ lea 8(up), up
+1: test $2, R8(n)
+ jz 1f
+ mov (up), %r8
+ mov 8(up), %r9
+ not %r8
+ not %r9
+ mov %r8, 8(rp)
+ mov %r9, 16(rp)
+1: FUNC_EXIT()
+ ret
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/fastsse/com.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/fastsse/com.asm
new file mode 100644
index 00000000000..4abb076d3f5
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/fastsse/com.asm
@@ -0,0 +1,161 @@
+dnl AMD64 mpn_com optimised for CPUs with fast SSE.
+
+dnl Copyright 2003, 2005, 2007, 2011, 2012 Free Software Foundation, Inc.
+
+dnl Contributed to the GNU project by Torbjorn Granlund.
+
+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 cycles/limb cycles/limb good
+C aligned unaligned best seen for cpu?
+C AMD K8,K9 2.0 2.0 N
+C AMD K10 0.85 1.3 Y/N
+C AMD bd1 1.40 1.40 Y
+C AMD bobcat 3.1 3.1 N
+C Intel P4 2.28 illop Y
+C Intel core2 1.02 1.02 N
+C Intel NHM 0.53 0.68 Y
+C Intel SBR 0.51 0.75 Y
+C Intel atom 3.68 3.68 N
+C VIA nano 1.17 5.09 Y/N
+
+C We try to do as many 16-byte operations as possible. The top-most and
+C bottom-most writes might need 8-byte operations. We can always write using
+C aligned 16-byte operations, we read with both aligned and unaligned 16-byte
+C operations.
+
+C Instead of having separate loops for reading aligned and unaligned, we read
+C using MOVDQU. This seems to work great except for core2; there performance
+C doubles when reading using MOVDQA (for aligned source). It is unclear how to
+C best handle the unaligned case there.
+
+C INPUT PARAMETERS
+define(`rp', `%rdi')
+define(`up', `%rsi')
+define(`n', `%rdx')
+
+ABI_SUPPORT(DOS64)
+ABI_SUPPORT(STD64)
+
+ASM_START()
+ TEXT
+ ALIGN(16)
+PROLOGUE(mpn_com)
+ FUNC_ENTRY(3)
+
+ test n, n
+ jz L(don)
+
+ pcmpeqb %xmm7, %xmm7 C set to 111...111
+
+ test $8, R8(rp) C is rp 16-byte aligned?
+ jz L(ali) C jump if rp aligned
+ mov (up), %rax
+ lea 8(up), up
+ not %rax
+ mov %rax, (rp)
+ lea 8(rp), rp
+ dec n
+
+ sub $14, n
+ jc L(sma)
+
+ ALIGN(16)
+L(top): movdqu (up), %xmm0
+ movdqu 16(up), %xmm1
+ movdqu 32(up), %xmm2
+ movdqu 48(up), %xmm3
+ movdqu 64(up), %xmm4
+ movdqu 80(up), %xmm5
+ movdqu 96(up), %xmm6
+ lea 112(up), up
+ pxor %xmm7, %xmm0
+ pxor %xmm7, %xmm1
+ pxor %xmm7, %xmm2
+ pxor %xmm7, %xmm3
+ pxor %xmm7, %xmm4
+ pxor %xmm7, %xmm5
+ pxor %xmm7, %xmm6
+ movdqa %xmm0, (rp)
+ movdqa %xmm1, 16(rp)
+ movdqa %xmm2, 32(rp)
+ movdqa %xmm3, 48(rp)
+ movdqa %xmm4, 64(rp)
+ movdqa %xmm5, 80(rp)
+ movdqa %xmm6, 96(rp)
+ lea 112(rp), rp
+L(ali): sub $14, n
+ jnc L(top)
+
+L(sma): add $14, n
+ test $8, R8(n)
+ jz 1f
+ movdqu (up), %xmm0
+ movdqu 16(up), %xmm1
+ movdqu 32(up), %xmm2
+ movdqu 48(up), %xmm3
+ lea 64(up), up
+ pxor %xmm7, %xmm0
+ pxor %xmm7, %xmm1
+ pxor %xmm7, %xmm2
+ pxor %xmm7, %xmm3
+ movdqa %xmm0, (rp)
+ movdqa %xmm1, 16(rp)
+ movdqa %xmm2, 32(rp)
+ movdqa %xmm3, 48(rp)
+ lea 64(rp), rp
+1:
+ test $4, R8(n)
+ jz 1f
+ movdqu (up), %xmm0
+ movdqu 16(up), %xmm1
+ lea 32(up), up
+ pxor %xmm7, %xmm0
+ pxor %xmm7, %xmm1
+ movdqa %xmm0, (rp)
+ movdqa %xmm1, 16(rp)
+ lea 32(rp), rp
+1:
+ test $2, R8(n)
+ jz 1f
+ movdqu (up), %xmm0
+ lea 16(up), up
+ pxor %xmm7, %xmm0
+ movdqa %xmm0, (rp)
+ lea 16(rp), rp
+1:
+ test $1, R8(n)
+ jz 1f
+ mov (up), %rax
+ not %rax
+ mov %rax, (rp)
+1:
+L(don): FUNC_EXIT()
+ ret
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/fastsse/copyd-palignr.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/fastsse/copyd-palignr.asm
new file mode 100644
index 00000000000..7430cadc09e
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/fastsse/copyd-palignr.asm
@@ -0,0 +1,251 @@
+dnl AMD64 mpn_copyd optimised for CPUs with fast SSE copying and SSSE3.
+
+dnl Copyright 2012 Free Software Foundation, Inc.
+
+dnl Contributed to the GNU project by Torbjorn Granlund.
+
+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 cycles/limb cycles/limb good
+C aligned unaligned best seen for cpu?
+C AMD K8,K9 2.0 illop 1.0/1.0 N
+C AMD K10 0.85 illop Y/N
+C AMD bull 0.70 0.70 Y
+C AMD pile 0.68 0.68 Y
+C AMD steam ? ?
+C AMD bobcat 1.97 8.24 1.5/1.5 N
+C AMD jaguar ? ?
+C Intel P4 2.26 illop Y/N
+C Intel core 0.52 0.68-0.80 opt/0.64 Y
+C Intel NHM 0.52 0.64 opt/opt Y
+C Intel SBR 0.51 0.51 opt/0.51 Y
+C Intel IBR ? ? Y
+C Intel HWL 0.51 0.51 0.25/0.25 N
+C Intel atom 1.16 1.66 opt/opt Y
+C VIA nano 1.08 1.06 opt/opt Y
+
+C We use only 16-byte operations, except for unaligned top-most and bottom-most
+C limbs. We use the SSSE3 palignr instruction when rp - up = 8 (mod 16).
+C
+C For operands of < COPYD_SSE_THRESHOLD limbs, we use a plain 64-bit loop,
+C taken from the x86_64 default code.
+
+C INPUT PARAMETERS
+define(`rp', `%rdi')
+define(`up', `%rsi')
+define(`n', `%rdx')
+
+C There are three instructions for loading an aligned 128-bit quantity. We use
+C movaps, since it has the shortest coding.
+define(`movdqa', ``movaps'')
+
+ifdef(`COPYD_SSE_THRESHOLD',`',`define(`COPYD_SSE_THRESHOLD', 7)')
+
+ASM_START()
+ TEXT
+ ALIGN(64)
+PROLOGUE(mpn_copyd)
+ FUNC_ENTRY(3)
+
+ lea -8(up,n,8), up
+ lea -8(rp,n,8), rp
+
+ cmp $COPYD_SSE_THRESHOLD, n
+ jbe L(bc)
+
+ test $8, R8(rp) C is rp 16-byte aligned?
+ jnz L(rp_aligned) C jump if rp aligned
+
+ mov (up), %rax C copy one limb
+ mov %rax, (rp)
+ lea -8(up), up
+ lea -8(rp), rp
+ dec n
+
+L(rp_aligned):
+ test $8, R8(up)
+ jz L(uent)
+
+ifelse(eval(COPYD_SSE_THRESHOLD >= 8),1,
+` sub $8, n',
+` jmp L(am)')
+
+ ALIGN(16)
+L(atop):movdqa -8(up), %xmm0
+ movdqa -24(up), %xmm1
+ movdqa -40(up), %xmm2
+ movdqa -56(up), %xmm3
+ lea -64(up), up
+ movdqa %xmm0, -8(rp)
+ movdqa %xmm1, -24(rp)
+ movdqa %xmm2, -40(rp)
+ movdqa %xmm3, -56(rp)
+ lea -64(rp), rp
+L(am): sub $8, n
+ jnc L(atop)
+
+ test $4, R8(n)
+ jz 1f
+ movdqa -8(up), %xmm0
+ movdqa -24(up), %xmm1
+ lea -32(up), up
+ movdqa %xmm0, -8(rp)
+ movdqa %xmm1, -24(rp)
+ lea -32(rp), rp
+
+1: test $2, R8(n)
+ jz 1f
+ movdqa -8(up), %xmm0
+ lea -16(up), up
+ movdqa %xmm0, -8(rp)
+ lea -16(rp), rp
+
+1: test $1, R8(n)
+ jz 1f
+ mov (up), %r8
+ mov %r8, (rp)
+
+1: FUNC_EXIT()
+ ret
+
+L(uent):sub $16, n
+ movdqa (up), %xmm0
+ jc L(uend)
+
+ ALIGN(16)
+L(utop):sub $16, n
+ movdqa -16(up), %xmm1
+ palignr($8, %xmm1, %xmm0)
+ movdqa %xmm0, -8(rp)
+ movdqa -32(up), %xmm2
+ palignr($8, %xmm2, %xmm1)
+ movdqa %xmm1, -24(rp)
+ movdqa -48(up), %xmm3
+ palignr($8, %xmm3, %xmm2)
+ movdqa %xmm2, -40(rp)
+ movdqa -64(up), %xmm0
+ palignr($8, %xmm0, %xmm3)
+ movdqa %xmm3, -56(rp)
+ movdqa -80(up), %xmm1
+ palignr($8, %xmm1, %xmm0)
+ movdqa %xmm0, -72(rp)
+ movdqa -96(up), %xmm2
+ palignr($8, %xmm2, %xmm1)
+ movdqa %xmm1, -88(rp)
+ movdqa -112(up), %xmm3
+ palignr($8, %xmm3, %xmm2)
+ movdqa %xmm2, -104(rp)
+ movdqa -128(up), %xmm0
+ palignr($8, %xmm0, %xmm3)
+ movdqa %xmm3, -120(rp)
+ lea -128(up), up
+ lea -128(rp), rp
+ jnc L(utop)
+
+L(uend):test $8, R8(n)
+ jz 1f
+ movdqa -16(up), %xmm1
+ palignr($8, %xmm1, %xmm0)
+ movdqa %xmm0, -8(rp)
+ movdqa -32(up), %xmm0
+ palignr($8, %xmm0, %xmm1)
+ movdqa %xmm1, -24(rp)
+ movdqa -48(up), %xmm1
+ palignr($8, %xmm1, %xmm0)
+ movdqa %xmm0, -40(rp)
+ movdqa -64(up), %xmm0
+ palignr($8, %xmm0, %xmm1)
+ movdqa %xmm1, -56(rp)
+ lea -64(up), up
+ lea -64(rp), rp
+
+1: test $4, R8(n)
+ jz 1f
+ movdqa -16(up), %xmm1
+ palignr($8, %xmm1, %xmm0)
+ movdqa %xmm0, -8(rp)
+ movdqa -32(up), %xmm0
+ palignr($8, %xmm0, %xmm1)
+ movdqa %xmm1, -24(rp)
+ lea -32(up), up
+ lea -32(rp), rp
+
+1: test $2, R8(n)
+ jz 1f
+ movdqa -16(up), %xmm1
+ palignr($8, %xmm1, %xmm0)
+ movdqa %xmm0, -8(rp)
+ lea -16(up), up
+ lea -16(rp), rp
+
+1: test $1, R8(n)
+ jz 1f
+ mov (up), %r8
+ mov %r8, (rp)
+
+1: FUNC_EXIT()
+ ret
+
+C Basecase code. Needed for good small operands speed, not for
+C correctness as the above code is currently written.
+
+L(bc): sub $4, R32(n)
+ jc L(end)
+
+ ALIGN(16)
+L(top): mov (up), %r8
+ mov -8(up), %r9
+ lea -32(rp), rp
+ mov -16(up), %r10
+ mov -24(up), %r11
+ lea -32(up), up
+ mov %r8, 32(rp)
+ mov %r9, 24(rp)
+ifelse(eval(COPYD_SSE_THRESHOLD >= 8),1,
+` sub $4, R32(n)')
+ mov %r10, 16(rp)
+ mov %r11, 8(rp)
+ifelse(eval(COPYD_SSE_THRESHOLD >= 8),1,
+` jnc L(top)')
+
+L(end): test $1, R8(n)
+ jz 1f
+ mov (up), %r8
+ mov %r8, (rp)
+ lea -8(rp), rp
+ lea -8(up), up
+1: test $2, R8(n)
+ jz 1f
+ mov (up), %r8
+ mov -8(up), %r9
+ mov %r8, (rp)
+ mov %r9, -8(rp)
+1: FUNC_EXIT()
+ ret
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/fastsse/copyd.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/fastsse/copyd.asm
new file mode 100644
index 00000000000..5c6094c7e2b
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/fastsse/copyd.asm
@@ -0,0 +1,145 @@
+dnl AMD64 mpn_copyd optimised for CPUs with fast SSE.
+
+dnl Copyright 2003, 2005, 2007, 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/limb good for cpu?
+C AMD K8,K9
+C AMD K10 0.85 Y
+C AMD bd1 0.8 Y
+C AMD bobcat
+C Intel P4 2.28 Y
+C Intel core2 1
+C Intel NHM 0.5 Y
+C Intel SBR 0.5 Y
+C Intel atom
+C VIA nano 1.1 Y
+
+C We try to do as many 16-byte operations as possible. The top-most and
+C bottom-most writes might need 8-byte operations. We can always write using
+C aligned 16-byte operations, we read with both aligned and unaligned 16-byte
+C operations.
+
+C Instead of having separate loops for reading aligned and unaligned, we read
+C using MOVDQU. This seems to work great except for core2; there performance
+C doubles when reading using MOVDQA (for aligned source). It is unclear how to
+C best handle the unaligned case there.
+
+C INPUT PARAMETERS
+define(`rp', `%rdi')
+define(`up', `%rsi')
+define(`n', `%rdx')
+
+ABI_SUPPORT(DOS64)
+ABI_SUPPORT(STD64)
+
+ASM_START()
+ TEXT
+ ALIGN(16)
+PROLOGUE(mpn_copyd)
+ FUNC_ENTRY(3)
+
+ test n, n
+ jz L(don)
+
+ lea -16(rp,n,8), rp
+ lea -16(up,n,8), up
+
+ test $8, R8(rp) C is rp 16-byte aligned?
+ jz L(ali) C jump if rp aligned
+ mov 8(up), %rax
+ lea -8(up), up
+ mov %rax, 8(rp)
+ lea -8(rp), rp
+ dec n
+
+ sub $16, n
+ jc L(sma)
+
+ ALIGN(16)
+L(top): movdqu (up), %xmm0
+ movdqu -16(up), %xmm1
+ movdqu -32(up), %xmm2
+ movdqu -48(up), %xmm3
+ movdqu -64(up), %xmm4
+ movdqu -80(up), %xmm5
+ movdqu -96(up), %xmm6
+ movdqu -112(up), %xmm7
+ lea -128(up), up
+ movdqa %xmm0, (rp)
+ movdqa %xmm1, -16(rp)
+ movdqa %xmm2, -32(rp)
+ movdqa %xmm3, -48(rp)
+ movdqa %xmm4, -64(rp)
+ movdqa %xmm5, -80(rp)
+ movdqa %xmm6, -96(rp)
+ movdqa %xmm7, -112(rp)
+ lea -128(rp), rp
+L(ali): sub $16, n
+ jnc L(top)
+
+L(sma): test $8, R8(n)
+ jz 1f
+ movdqu (up), %xmm0
+ movdqu -16(up), %xmm1
+ movdqu -32(up), %xmm2
+ movdqu -48(up), %xmm3
+ lea -64(up), up
+ movdqa %xmm0, (rp)
+ movdqa %xmm1, -16(rp)
+ movdqa %xmm2, -32(rp)
+ movdqa %xmm3, -48(rp)
+ lea -64(rp), rp
+1:
+ test $4, R8(n)
+ jz 1f
+ movdqu (up), %xmm0
+ movdqu -16(up), %xmm1
+ lea -32(up), up
+ movdqa %xmm0, (rp)
+ movdqa %xmm1, -16(rp)
+ lea -32(rp), rp
+1:
+ test $2, R8(n)
+ jz 1f
+ movdqu (up), %xmm0
+ lea -16(up), up
+ movdqa %xmm0, (rp)
+ lea -16(rp), rp
+1:
+ test $1, R8(n)
+ jz 1f
+ mov 8(up), %r8
+ mov %r8, 8(rp)
+1:
+L(don): FUNC_EXIT()
+ ret
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/fastsse/copyi-palignr.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/fastsse/copyi-palignr.asm
new file mode 100644
index 00000000000..fda3c3500f6
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/fastsse/copyi-palignr.asm
@@ -0,0 +1,295 @@
+dnl AMD64 mpn_copyi optimised for CPUs with fast SSE copying and SSSE3.
+
+dnl Copyright 2012, 2013 Free Software Foundation, Inc.
+
+dnl Contributed to the GNU project by Torbjörn Granlund.
+
+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 cycles/limb cycles/limb good
+C aligned unaligned best seen for cpu?
+C AMD K8,K9 2.0 illop 1.0/1.0 N
+C AMD K10 0.85 illop Y/N
+C AMD bull 0.70 0.66 Y
+C AMD pile 0.68 0.66 Y
+C AMD steam ? ?
+C AMD bobcat 1.97 8.16 1.5/1.5 N
+C AMD jaguar ? ?
+C Intel P4 2.26 illop Y/N
+C Intel core 0.52 0.64 opt/opt Y
+C Intel NHM 0.52 0.71 opt/opt Y
+C Intel SBR 0.51 0.54 opt/0.51 Y
+C Intel IBR ? ? Y
+C Intel HWL 0.51 0.52 0.25/0.25 N
+C Intel atom 1.16 1.61 opt/opt Y
+C VIA nano 1.09 1.08 opt/opt Y
+
+C We use only 16-byte operations, except for unaligned top-most and bottom-most
+C limbs. We use the SSSE3 palignr instruction when rp - up = 8 (mod 16). That
+C instruction is better adapted to mpn_copyd's needs, we need to contort the
+C code to use it here.
+C
+C For operands of < COPYI_SSE_THRESHOLD limbs, we use a plain 64-bit loop,
+C taken from the x86_64 default code.
+
+C INPUT PARAMETERS
+define(`rp', `%rdi')
+define(`up', `%rsi')
+define(`n', `%rdx')
+
+C There are three instructions for loading an aligned 128-bit quantity. We use
+C movaps, since it has the shortest coding.
+dnl define(`movdqa', ``movaps'')
+
+ifdef(`COPYI_SSE_THRESHOLD',`',`define(`COPYI_SSE_THRESHOLD', 7)')
+
+ASM_START()
+ TEXT
+ ALIGN(64)
+PROLOGUE(mpn_copyi)
+ FUNC_ENTRY(3)
+
+ cmp $COPYI_SSE_THRESHOLD, n
+ jbe L(bc)
+
+ test $8, R8(rp) C is rp 16-byte aligned?
+ jz L(rp_aligned) C jump if rp aligned
+
+ movsq C copy one limb
+ dec n
+
+L(rp_aligned):
+ test $8, R8(up)
+ jnz L(uent)
+
+ifelse(eval(COPYI_SSE_THRESHOLD >= 8),1,
+` sub $8, n',
+` jmp L(am)')
+
+ ALIGN(16)
+L(atop):movdqa 0(up), %xmm0
+ movdqa 16(up), %xmm1
+ movdqa 32(up), %xmm2
+ movdqa 48(up), %xmm3
+ lea 64(up), up
+ movdqa %xmm0, (rp)
+ movdqa %xmm1, 16(rp)
+ movdqa %xmm2, 32(rp)
+ movdqa %xmm3, 48(rp)
+ lea 64(rp), rp
+L(am): sub $8, n
+ jnc L(atop)
+
+ test $4, R8(n)
+ jz 1f
+ movdqa (up), %xmm0
+ movdqa 16(up), %xmm1
+ lea 32(up), up
+ movdqa %xmm0, (rp)
+ movdqa %xmm1, 16(rp)
+ lea 32(rp), rp
+
+1: test $2, R8(n)
+ jz 1f
+ movdqa (up), %xmm0
+ lea 16(up), up
+ movdqa %xmm0, (rp)
+ lea 16(rp), rp
+
+1: test $1, R8(n)
+ jz 1f
+ mov (up), %r8
+ mov %r8, (rp)
+
+1: FUNC_EXIT()
+ ret
+
+L(uent):
+C Code handling up - rp = 8 (mod 16)
+
+ cmp $16, n
+ jc L(ued0)
+
+IFDOS(` add $-56, %rsp ')
+IFDOS(` movdqa %xmm6, (%rsp) ')
+IFDOS(` movdqa %xmm7, 16(%rsp) ')
+IFDOS(` movdqa %xmm8, 32(%rsp) ')
+
+ movaps 120(up), %xmm7
+ movaps 104(up), %xmm6
+ movaps 88(up), %xmm5
+ movaps 72(up), %xmm4
+ movaps 56(up), %xmm3
+ movaps 40(up), %xmm2
+ lea 128(up), up
+ sub $32, n
+ jc L(ued1)
+
+ ALIGN(16)
+L(utop):movaps -104(up), %xmm1
+ sub $16, n
+ movaps -120(up), %xmm0
+ palignr($8, %xmm6, %xmm7)
+ movaps -136(up), %xmm8
+ movdqa %xmm7, 112(rp)
+ palignr($8, %xmm5, %xmm6)
+ movaps 120(up), %xmm7
+ movdqa %xmm6, 96(rp)
+ palignr($8, %xmm4, %xmm5)
+ movaps 104(up), %xmm6
+ movdqa %xmm5, 80(rp)
+ palignr($8, %xmm3, %xmm4)
+ movaps 88(up), %xmm5
+ movdqa %xmm4, 64(rp)
+ palignr($8, %xmm2, %xmm3)
+ movaps 72(up), %xmm4
+ movdqa %xmm3, 48(rp)
+ palignr($8, %xmm1, %xmm2)
+ movaps 56(up), %xmm3
+ movdqa %xmm2, 32(rp)
+ palignr($8, %xmm0, %xmm1)
+ movaps 40(up), %xmm2
+ movdqa %xmm1, 16(rp)
+ palignr($8, %xmm8, %xmm0)
+ lea 128(up), up
+ movdqa %xmm0, (rp)
+ lea 128(rp), rp
+ jnc L(utop)
+
+L(ued1):movaps -104(up), %xmm1
+ movaps -120(up), %xmm0
+ movaps -136(up), %xmm8
+ palignr($8, %xmm6, %xmm7)
+ movdqa %xmm7, 112(rp)
+ palignr($8, %xmm5, %xmm6)
+ movdqa %xmm6, 96(rp)
+ palignr($8, %xmm4, %xmm5)
+ movdqa %xmm5, 80(rp)
+ palignr($8, %xmm3, %xmm4)
+ movdqa %xmm4, 64(rp)
+ palignr($8, %xmm2, %xmm3)
+ movdqa %xmm3, 48(rp)
+ palignr($8, %xmm1, %xmm2)
+ movdqa %xmm2, 32(rp)
+ palignr($8, %xmm0, %xmm1)
+ movdqa %xmm1, 16(rp)
+ palignr($8, %xmm8, %xmm0)
+ movdqa %xmm0, (rp)
+ lea 128(rp), rp
+
+IFDOS(` movdqa (%rsp), %xmm6 ')
+IFDOS(` movdqa 16(%rsp), %xmm7 ')
+IFDOS(` movdqa 32(%rsp), %xmm8 ')
+IFDOS(` add $56, %rsp ')
+
+L(ued0):test $8, R8(n)
+ jz 1f
+ movaps 56(up), %xmm3
+ movaps 40(up), %xmm2
+ movaps 24(up), %xmm1
+ movaps 8(up), %xmm0
+ movaps -8(up), %xmm4
+ palignr($8, %xmm2, %xmm3)
+ movdqa %xmm3, 48(rp)
+ palignr($8, %xmm1, %xmm2)
+ movdqa %xmm2, 32(rp)
+ palignr($8, %xmm0, %xmm1)
+ movdqa %xmm1, 16(rp)
+ palignr($8, %xmm4, %xmm0)
+ lea 64(up), up
+ movdqa %xmm0, (rp)
+ lea 64(rp), rp
+
+1: test $4, R8(n)
+ jz 1f
+ movaps 24(up), %xmm1
+ movaps 8(up), %xmm0
+ palignr($8, %xmm0, %xmm1)
+ movaps -8(up), %xmm3
+ movdqa %xmm1, 16(rp)
+ palignr($8, %xmm3, %xmm0)
+ lea 32(up), up
+ movdqa %xmm0, (rp)
+ lea 32(rp), rp
+
+1: test $2, R8(n)
+ jz 1f
+ movdqa 8(up), %xmm0
+ movdqa -8(up), %xmm3
+ palignr($8, %xmm3, %xmm0)
+ lea 16(up), up
+ movdqa %xmm0, (rp)
+ lea 16(rp), rp
+
+1: test $1, R8(n)
+ jz 1f
+ mov (up), %r8
+ mov %r8, (rp)
+
+1: FUNC_EXIT()
+ ret
+
+C Basecase code. Needed for good small operands speed, not for
+C correctness as the above code is currently written.
+
+L(bc): lea -8(rp), rp
+ sub $4, R32(n)
+ jc L(end)
+
+ ALIGN(16)
+L(top): mov (up), %r8
+ mov 8(up), %r9
+ lea 32(rp), rp
+ mov 16(up), %r10
+ mov 24(up), %r11
+ lea 32(up), up
+ mov %r8, -24(rp)
+ mov %r9, -16(rp)
+ifelse(eval(COPYI_SSE_THRESHOLD >= 8),1,
+` sub $4, R32(n)')
+ mov %r10, -8(rp)
+ mov %r11, (rp)
+ifelse(eval(COPYI_SSE_THRESHOLD >= 8),1,
+` jnc L(top)')
+
+L(end): test $1, R8(n)
+ jz 1f
+ mov (up), %r8
+ mov %r8, 8(rp)
+ lea 8(rp), rp
+ lea 8(up), up
+1: test $2, R8(n)
+ jz 1f
+ mov (up), %r8
+ mov 8(up), %r9
+ mov %r8, 8(rp)
+ mov %r9, 16(rp)
+1: FUNC_EXIT()
+ ret
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/fastsse/copyi.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/fastsse/copyi.asm
new file mode 100644
index 00000000000..a1a1c231dc0
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/fastsse/copyi.asm
@@ -0,0 +1,166 @@
+dnl AMD64 mpn_copyi optimised for CPUs with fast SSE.
+
+dnl Contributed to the GNU project by Torbjörn Granlund.
+
+dnl Copyright 2003, 2005, 2007, 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/limb good for cpu?
+C AMD K8,K9
+C AMD K10 0.85 1.64 Y/N
+C AMD bd1 1.4 1.4 Y
+C AMD bobcat
+C Intel P4 2.3 2.3 Y
+C Intel core2 1.0 1.0
+C Intel NHM 0.5 0.67 Y
+C Intel SBR 0.5 0.75 Y
+C Intel atom
+C VIA nano 1.16 5.16 Y/N
+
+C We try to do as many 16-byte operations as possible. The top-most and
+C bottom-most writes might need 8-byte operations. We can always write using
+C aligned 16-byte operations, we read with both aligned and unaligned 16-byte
+C operations.
+
+C Instead of having separate loops for reading aligned and unaligned, we read
+C using MOVDQU. This seems to work great except for core2; there performance
+C doubles when reading using MOVDQA (for aligned source). It is unclear how to
+C best handle the unaligned case there.
+
+C INPUT PARAMETERS
+define(`rp', `%rdi')
+define(`up', `%rsi')
+define(`n', `%rdx')
+
+ABI_SUPPORT(DOS64)
+ABI_SUPPORT(STD64)
+
+dnl define(`movdqu', lddqu)
+
+ASM_START()
+ TEXT
+ ALIGN(64)
+PROLOGUE(mpn_copyi)
+ FUNC_ENTRY(3)
+
+ cmp $3, n
+ jc L(bc)
+
+ test $8, R8(rp) C is rp 16-byte aligned?
+ jz L(ali) C jump if rp aligned
+ movsq C copy single limb
+ dec n
+
+ sub $16, n
+ jc L(sma)
+
+ ALIGN(16)
+L(top): movdqu (up), %xmm0
+ movdqu 16(up), %xmm1
+ movdqu 32(up), %xmm2
+ movdqu 48(up), %xmm3
+ movdqu 64(up), %xmm4
+ movdqu 80(up), %xmm5
+ movdqu 96(up), %xmm6
+ movdqu 112(up), %xmm7
+ lea 128(up), up
+ movdqa %xmm0, (rp)
+ movdqa %xmm1, 16(rp)
+ movdqa %xmm2, 32(rp)
+ movdqa %xmm3, 48(rp)
+ movdqa %xmm4, 64(rp)
+ movdqa %xmm5, 80(rp)
+ movdqa %xmm6, 96(rp)
+ movdqa %xmm7, 112(rp)
+ lea 128(rp), rp
+L(ali): sub $16, n
+ jnc L(top)
+
+L(sma): test $8, R8(n)
+ jz 1f
+ movdqu (up), %xmm0
+ movdqu 16(up), %xmm1
+ movdqu 32(up), %xmm2
+ movdqu 48(up), %xmm3
+ lea 64(up), up
+ movdqa %xmm0, (rp)
+ movdqa %xmm1, 16(rp)
+ movdqa %xmm2, 32(rp)
+ movdqa %xmm3, 48(rp)
+ lea 64(rp), rp
+1:
+ test $4, R8(n)
+ jz 1f
+ movdqu (up), %xmm0
+ movdqu 16(up), %xmm1
+ lea 32(up), up
+ movdqa %xmm0, (rp)
+ movdqa %xmm1, 16(rp)
+ lea 32(rp), rp
+1:
+ test $2, R8(n)
+ jz 1f
+ movdqu (up), %xmm0
+ lea 16(up), up
+ movdqa %xmm0, (rp)
+ lea 16(rp), rp
+ ALIGN(16)
+1:
+L(end): test $1, R8(n)
+ jz 1f
+ mov (up), %r8
+ mov %r8, (rp)
+1:
+ FUNC_EXIT()
+ ret
+
+C Basecase code. Needed for good small operands speed, not for
+C correctness as the above code is currently written.
+
+L(bc): sub $2, n
+ jc L(end)
+ ALIGN(16)
+1: mov (up), %rax
+ mov 8(up), %rcx
+ lea 16(up), up
+ mov %rax, (rp)
+ mov %rcx, 8(rp)
+ lea 16(rp), rp
+ sub $2, n
+ jnc 1b
+
+ test $1, R8(n)
+ jz L(ret)
+ mov (up), %rax
+ mov %rax, (rp)
+L(ret): FUNC_EXIT()
+ ret
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/fastsse/lshift-movdqu2.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/fastsse/lshift-movdqu2.asm
new file mode 100644
index 00000000000..a05e850a1fc
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/fastsse/lshift-movdqu2.asm
@@ -0,0 +1,182 @@
+dnl AMD64 mpn_lshift optimised for CPUs with fast SSE including fast movdqu.
+
+dnl Contributed to the GNU project by Torbjorn Granlund.
+
+dnl Copyright 2010-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/limb cycles/limb cycles/limb good
+C aligned unaligned best seen for cpu?
+C AMD K8,K9 3 3 2.35 no, use shl/shr
+C AMD K10 1.5-1.8 1.5-1.8 1.33 yes
+C AMD bd1 1.7-1.9 1.7-1.9 1.33 yes
+C AMD bobcat 3.17 3.17 yes, bad for n < 20
+C Intel P4 4.67 4.67 2.7 no, slow movdqu
+C Intel core2 2.15 2.15 1.25 no, use shld/shrd
+C Intel NHM 1.66 1.66 1.25 no, use shld/shrd
+C Intel SBR 1.3 1.3 1.25 yes, bad for n = 4-6
+C Intel atom 11.7 11.7 4.5 no
+C VIA nano 5.7 5.95 2.0 no, slow movdqu
+
+C We try to do as many aligned 16-byte operations as possible. The top-most
+C and bottom-most writes might need 8-byte operations.
+C
+C This variant rely on fast load movdqu, and uses it even for aligned operands,
+C in order to avoid the need for two separate loops.
+C
+C TODO
+C * Could 2-limb wind-down code be simplified?
+C * Improve basecase code, using shld/shrd for SBR, discrete integer shifts
+C for other affected CPUs.
+
+C INPUT PARAMETERS
+define(`rp', `%rdi')
+define(`ap', `%rsi')
+define(`n', `%rdx')
+define(`cnt', `%rcx')
+
+ASM_START()
+ TEXT
+ ALIGN(64)
+PROLOGUE(mpn_lshift)
+ FUNC_ENTRY(4)
+ movd R32(%rcx), %xmm4
+ mov $64, R32(%rax)
+ sub R32(%rcx), R32(%rax)
+ movd R32(%rax), %xmm5
+
+ neg R32(%rcx)
+ mov -8(ap,n,8), %rax
+ shr R8(%rcx), %rax
+
+ cmp $3, n
+ jle L(bc)
+
+ lea (rp,n,8), R32(%rcx)
+ test $8, R8(%rcx)
+ jz L(rp_aligned)
+
+C Do one initial limb in order to make rp aligned
+ movq -8(ap,n,8), %xmm0
+ movq -16(ap,n,8), %xmm1
+ psllq %xmm4, %xmm0
+ psrlq %xmm5, %xmm1
+ por %xmm1, %xmm0
+ movq %xmm0, -8(rp,n,8)
+ dec n
+
+L(rp_aligned):
+ lea 1(n), %r8d
+
+ and $6, R32(%r8)
+ jz L(ba0)
+ cmp $4, R32(%r8)
+ jz L(ba4)
+ jc L(ba2)
+L(ba6): add $-4, n
+ jmp L(i56)
+L(ba0): add $-6, n
+ jmp L(i70)
+L(ba4): add $-2, n
+ jmp L(i34)
+L(ba2): add $-8, n
+ jle L(end)
+
+ ALIGN(16)
+L(top): movdqu 40(ap,n,8), %xmm1
+ movdqu 48(ap,n,8), %xmm0
+ psllq %xmm4, %xmm0
+ psrlq %xmm5, %xmm1
+ por %xmm1, %xmm0
+ movdqa %xmm0, 48(rp,n,8)
+L(i70):
+ movdqu 24(ap,n,8), %xmm1
+ movdqu 32(ap,n,8), %xmm0
+ psllq %xmm4, %xmm0
+ psrlq %xmm5, %xmm1
+ por %xmm1, %xmm0
+ movdqa %xmm0, 32(rp,n,8)
+L(i56):
+ movdqu 8(ap,n,8), %xmm1
+ movdqu 16(ap,n,8), %xmm0
+ psllq %xmm4, %xmm0
+ psrlq %xmm5, %xmm1
+ por %xmm1, %xmm0
+ movdqa %xmm0, 16(rp,n,8)
+L(i34):
+ movdqu -8(ap,n,8), %xmm1
+ movdqu (ap,n,8), %xmm0
+ psllq %xmm4, %xmm0
+ psrlq %xmm5, %xmm1
+ por %xmm1, %xmm0
+ movdqa %xmm0, (rp,n,8)
+ sub $8, n
+ jg L(top)
+
+L(end): test $1, R8(n)
+ jnz L(end8)
+
+ movdqu (ap), %xmm1
+ pxor %xmm0, %xmm0
+ punpcklqdq %xmm1, %xmm0
+ psllq %xmm4, %xmm1
+ psrlq %xmm5, %xmm0
+ por %xmm1, %xmm0
+ movdqa %xmm0, (rp)
+ FUNC_EXIT()
+ ret
+
+C Basecase
+ ALIGN(16)
+L(bc): dec R32(n)
+ jz L(end8)
+
+ movq (ap,n,8), %xmm1
+ movq -8(ap,n,8), %xmm0
+ psllq %xmm4, %xmm1
+ psrlq %xmm5, %xmm0
+ por %xmm1, %xmm0
+ movq %xmm0, (rp,n,8)
+ sub $2, R32(n)
+ jl L(end8)
+ movq 8(ap), %xmm1
+ movq (ap), %xmm0
+ psllq %xmm4, %xmm1
+ psrlq %xmm5, %xmm0
+ por %xmm1, %xmm0
+ movq %xmm0, 8(rp)
+
+L(end8):movq (ap), %xmm0
+ psllq %xmm4, %xmm0
+ movq %xmm0, (rp)
+ FUNC_EXIT()
+ ret
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/fastsse/lshift.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/fastsse/lshift.asm
new file mode 100644
index 00000000000..f76972a22f6
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/fastsse/lshift.asm
@@ -0,0 +1,169 @@
+dnl AMD64 mpn_lshift optimised for CPUs with fast SSE.
+
+dnl Contributed to the GNU project by David Harvey and Torbjorn Granlund.
+
+dnl Copyright 2010-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/limb cycles/limb good
+C 16-byte aligned 16-byte unaligned for cpu?
+C AMD K8,K9 ? ?
+C AMD K10 1.68 (1.45) 1.75 (1.49) Y
+C AMD bd1 1.82 (1.75) 1.82 (1.75) Y
+C AMD bobcat 4 4
+C Intel P4 3 (2.7) 3 (2.7) Y
+C Intel core2 2.05 (1.67) 2.55 (1.75)
+C Intel NHM 2.05 (1.75) 2.09 (2)
+C Intel SBR 1.5 (1.3125) 1.5 (1.4375) Y
+C Intel atom ? ?
+C VIA nano 2.25 (2) 2.5 (2) Y
+
+C We try to do as many 16-byte operations as possible. The top-most and
+C bottom-most writes might need 8-byte operations.
+
+C There are two inner-loops, one for when rp = ap (mod 16) and one when this is
+C not true. The aligned case reads 16+8 bytes, the unaligned case reads
+C 16+8+X bytes, where X is 8 or 16 depending on how punpcklqdq is implemented.
+
+C This is not yet great code:
+C (1) The unaligned case makes many reads.
+C (2) We should do some unrolling, at least 2-way.
+C With 2-way unrolling but no scheduling we reach 1.5 c/l on K10 and 2 c/l on
+C Nano.
+
+C INPUT PARAMETERS
+define(`rp', `%rdi')
+define(`ap', `%rsi')
+define(`n', `%rdx')
+define(`cnt', `%rcx')
+
+ASM_START()
+ TEXT
+ ALIGN(64)
+PROLOGUE(mpn_lshift)
+ movd R32(%rcx), %xmm4
+ mov $64, R32(%rax)
+ sub R32(%rcx), R32(%rax)
+ movd R32(%rax), %xmm5
+
+ neg R32(%rcx)
+ mov -8(ap,n,8), %rax
+ shr R8(%rcx), %rax
+
+ cmp $2, n
+ jle L(le2)
+
+ lea (rp,n,8), R32(%rcx)
+ test $8, R8(%rcx)
+ je L(rp_aligned)
+
+C Do one initial limb in order to make rp aligned
+ movq -8(ap,n,8), %xmm0
+ movq -16(ap,n,8), %xmm1
+ psllq %xmm4, %xmm0
+ psrlq %xmm5, %xmm1
+ por %xmm1, %xmm0
+ movq %xmm0, -8(rp,n,8)
+ dec n
+
+L(rp_aligned):
+ lea (ap,n,8), R32(%rcx)
+ test $8, R8(%rcx)
+ je L(aent)
+ jmp L(uent)
+C *****************************************************************************
+
+C Handle the case when ap != rp (mod 16).
+
+ ALIGN(16)
+L(utop):movdqa -8(ap,n,8), %xmm0
+ movq (ap,n,8), %xmm1
+ punpcklqdq 8(ap,n,8), %xmm1
+ psllq %xmm4, %xmm1
+ psrlq %xmm5, %xmm0
+ por %xmm1, %xmm0
+ movdqa %xmm0, (rp,n,8)
+L(uent):sub $2, n
+ ja L(utop)
+
+ jne L(end8)
+
+ movq (ap), %xmm1
+ pxor %xmm0, %xmm0
+ punpcklqdq %xmm1, %xmm0
+ punpcklqdq 8(ap), %xmm1
+ psllq %xmm4, %xmm1
+ psrlq %xmm5, %xmm0
+ por %xmm1, %xmm0
+ movdqa %xmm0, (rp)
+ ret
+C *****************************************************************************
+
+C Handle the case when ap = rp (mod 16).
+
+ ALIGN(16)
+L(atop):movdqa (ap,n,8), %xmm0 C xmm0 = B*ap[n-1] + ap[n-2]
+ movq -8(ap,n,8), %xmm1 C xmm1 = ap[n-3]
+ punpcklqdq %xmm0, %xmm1 C xmm1 = B*ap[n-2] + ap[n-3]
+ psllq %xmm4, %xmm0
+ psrlq %xmm5, %xmm1
+ por %xmm1, %xmm0
+ movdqa %xmm0, (rp,n,8)
+L(aent):
+ sub $2, n
+ ja L(atop)
+ jne L(end8)
+
+ movdqa (ap), %xmm1
+ pxor %xmm0, %xmm0
+ punpcklqdq %xmm1, %xmm0
+ psllq %xmm4, %xmm1
+ psrlq %xmm5, %xmm0
+ por %xmm1, %xmm0
+ movdqa %xmm0, (rp)
+ ret
+C *****************************************************************************
+
+ ALIGN(16)
+L(le2): jne L(end8)
+
+ movq 8(ap), %xmm0
+ movq (ap), %xmm1
+ psllq %xmm4, %xmm0
+ psrlq %xmm5, %xmm1
+ por %xmm1, %xmm0
+ movq %xmm0, 8(rp)
+
+L(end8):movq (ap), %xmm0
+ psllq %xmm4, %xmm0
+ movq %xmm0, (rp)
+ ret
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/fastsse/lshiftc-movdqu2.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/fastsse/lshiftc-movdqu2.asm
new file mode 100644
index 00000000000..8250910c52a
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/fastsse/lshiftc-movdqu2.asm
@@ -0,0 +1,193 @@
+dnl AMD64 mpn_lshiftc optimised for CPUs with fast SSE including fast movdqu.
+
+dnl Contributed to the GNU project by Torbjorn Granlund.
+
+dnl Copyright 2010-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/limb cycles/limb cycles/limb good
+C aligned unaligned best seen for cpu?
+C AMD K8,K9 3 3 ? no, use shl/shr
+C AMD K10 1.8-2.0 1.8-2.0 ? yes
+C AMD bd1 1.9 1.9 ? yes
+C AMD bobcat 3.67 3.67 yes, bad for n < 20
+C Intel P4 4.75 4.75 ? no, slow movdqu
+C Intel core2 2.27 2.27 ? no, use shld/shrd
+C Intel NHM 2.15 2.15 ? no, use shld/shrd
+C Intel SBR 1.45 1.45 ? yes, bad for n = 4-6
+C Intel atom 12.9 12.9 ? no
+C VIA nano 6.18 6.44 ? no, slow movdqu
+
+C We try to do as many aligned 16-byte operations as possible. The top-most
+C and bottom-most writes might need 8-byte operations.
+C
+C This variant rely on fast load movdqu, and uses it even for aligned operands,
+C in order to avoid the need for two separate loops.
+C
+C TODO
+C * Could 2-limb wind-down code be simplified?
+C * Improve basecase code, using shld/shrd for SBR, discrete integer shifts
+C for other affected CPUs.
+
+C INPUT PARAMETERS
+define(`rp', `%rdi')
+define(`ap', `%rsi')
+define(`n', `%rdx')
+define(`cnt', `%rcx')
+
+ASM_START()
+ TEXT
+ ALIGN(64)
+PROLOGUE(mpn_lshiftc)
+ FUNC_ENTRY(4)
+ movd R32(%rcx), %xmm4
+ mov $64, R32(%rax)
+ sub R32(%rcx), R32(%rax)
+ movd R32(%rax), %xmm5
+
+ neg R32(%rcx)
+ mov -8(ap,n,8), %rax
+ shr R8(%rcx), %rax
+
+ pcmpeqb %xmm3, %xmm3 C set to 111...111
+
+ cmp $3, n
+ jle L(bc)
+
+ lea (rp,n,8), R32(%rcx)
+ test $8, R8(%rcx)
+ jz L(rp_aligned)
+
+C Do one initial limb in order to make rp aligned
+ movq -8(ap,n,8), %xmm0
+ movq -16(ap,n,8), %xmm1
+ psllq %xmm4, %xmm0
+ psrlq %xmm5, %xmm1
+ por %xmm1, %xmm0
+ pxor %xmm3, %xmm0
+ movq %xmm0, -8(rp,n,8)
+ dec n
+
+L(rp_aligned):
+ lea 1(n), %r8d
+
+ and $6, R32(%r8)
+ jz L(ba0)
+ cmp $4, R32(%r8)
+ jz L(ba4)
+ jc L(ba2)
+L(ba6): add $-4, n
+ jmp L(i56)
+L(ba0): add $-6, n
+ jmp L(i70)
+L(ba4): add $-2, n
+ jmp L(i34)
+L(ba2): add $-8, n
+ jle L(end)
+
+ ALIGN(16)
+L(top): movdqu 40(ap,n,8), %xmm1
+ movdqu 48(ap,n,8), %xmm0
+ psllq %xmm4, %xmm0
+ psrlq %xmm5, %xmm1
+ por %xmm1, %xmm0
+ pxor %xmm3, %xmm0
+ movdqa %xmm0, 48(rp,n,8)
+L(i70):
+ movdqu 24(ap,n,8), %xmm1
+ movdqu 32(ap,n,8), %xmm0
+ psllq %xmm4, %xmm0
+ psrlq %xmm5, %xmm1
+ por %xmm1, %xmm0
+ pxor %xmm3, %xmm0
+ movdqa %xmm0, 32(rp,n,8)
+L(i56):
+ movdqu 8(ap,n,8), %xmm1
+ movdqu 16(ap,n,8), %xmm0
+ psllq %xmm4, %xmm0
+ psrlq %xmm5, %xmm1
+ por %xmm1, %xmm0
+ pxor %xmm3, %xmm0
+ movdqa %xmm0, 16(rp,n,8)
+L(i34):
+ movdqu -8(ap,n,8), %xmm1
+ movdqu (ap,n,8), %xmm0
+ psllq %xmm4, %xmm0
+ psrlq %xmm5, %xmm1
+ por %xmm1, %xmm0
+ pxor %xmm3, %xmm0
+ movdqa %xmm0, (rp,n,8)
+ sub $8, n
+ jg L(top)
+
+L(end): test $1, R8(n)
+ jnz L(end8)
+
+ movdqu (ap), %xmm1
+ pxor %xmm0, %xmm0
+ punpcklqdq %xmm1, %xmm0
+ psllq %xmm4, %xmm1
+ psrlq %xmm5, %xmm0
+ por %xmm1, %xmm0
+ pxor %xmm3, %xmm0
+ movdqa %xmm0, (rp)
+ FUNC_EXIT()
+ ret
+
+C Basecase
+ ALIGN(16)
+L(bc): dec R32(n)
+ jz L(end8)
+
+ movq (ap,n,8), %xmm1
+ movq -8(ap,n,8), %xmm0
+ psllq %xmm4, %xmm1
+ psrlq %xmm5, %xmm0
+ por %xmm1, %xmm0
+ pxor %xmm3, %xmm0
+ movq %xmm0, (rp,n,8)
+ sub $2, R32(n)
+ jl L(end8)
+ movq 8(ap), %xmm1
+ movq (ap), %xmm0
+ psllq %xmm4, %xmm1
+ psrlq %xmm5, %xmm0
+ por %xmm1, %xmm0
+ pxor %xmm3, %xmm0
+ movq %xmm0, 8(rp)
+
+L(end8):movq (ap), %xmm0
+ psllq %xmm4, %xmm0
+ pxor %xmm3, %xmm0
+ movq %xmm0, (rp)
+ FUNC_EXIT()
+ ret
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/fastsse/lshiftc.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/fastsse/lshiftc.asm
new file mode 100644
index 00000000000..d2520690e22
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/fastsse/lshiftc.asm
@@ -0,0 +1,179 @@
+dnl AMD64 mpn_lshiftc optimised for CPUs with fast SSE.
+
+dnl Contributed to the GNU project by David Harvey and Torbjorn Granlund.
+
+dnl Copyright 2010-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/limb cycles/limb good
+C 16-byte aligned 16-byte unaligned for cpu?
+C AMD K8,K9 ? ?
+C AMD K10 1.85 (1.635) 1.9 (1.67) Y
+C AMD bd1 1.82 (1.75) 1.82 (1.75) Y
+C AMD bobcat 4.5 4.5
+C Intel P4 3.6 (3.125) 3.6 (3.125) Y
+C Intel core2 2.05 (1.67) 2.55 (1.75)
+C Intel NHM 2.05 (1.875) 2.6 (2.25)
+C Intel SBR 1.55 (1.44) 2 (1.57) Y
+C Intel atom ? ?
+C VIA nano 2.5 (2.5) 2.5 (2.5) Y
+
+C We try to do as many 16-byte operations as possible. The top-most and
+C bottom-most writes might need 8-byte operations. We always write using
+C 16-byte operations, we read with both 8-byte and 16-byte operations.
+
+C There are two inner-loops, one for when rp = ap (mod 16) and one when this is
+C not true. The aligned case reads 16+8 bytes, the unaligned case reads
+C 16+8+X bytes, where X is 8 or 16 depending on how punpcklqdq is implemented.
+
+C This is not yet great code:
+C (1) The unaligned case makes too many reads.
+C (2) We should do some unrolling, at least 2-way.
+C With 2-way unrolling but no scheduling we reach 1.5 c/l on K10 and 2 c/l on
+C Nano.
+
+C INPUT PARAMETERS
+define(`rp', `%rdi')
+define(`ap', `%rsi')
+define(`n', `%rdx')
+define(`cnt', `%rcx')
+
+ASM_START()
+ TEXT
+ ALIGN(16)
+PROLOGUE(mpn_lshiftc)
+ movd R32(%rcx), %xmm4
+ mov $64, R32(%rax)
+ sub R32(%rcx), R32(%rax)
+ movd R32(%rax), %xmm5
+
+ neg R32(%rcx)
+ mov -8(ap,n,8), %rax
+ shr R8(%rcx), %rax
+
+ pcmpeqb %xmm7, %xmm7 C set to 111...111
+
+ cmp $2, n
+ jle L(le2)
+
+ lea (rp,n,8), R32(%rcx)
+ test $8, R8(%rcx)
+ je L(rp_aligned)
+
+C Do one initial limb in order to make rp aligned
+ movq -8(ap,n,8), %xmm0
+ movq -16(ap,n,8), %xmm1
+ psllq %xmm4, %xmm0
+ psrlq %xmm5, %xmm1
+ por %xmm1, %xmm0
+ pxor %xmm7, %xmm0
+ movq %xmm0, -8(rp,n,8)
+ dec n
+
+L(rp_aligned):
+ lea (ap,n,8), R32(%rcx)
+ test $8, R8(%rcx)
+ je L(aent)
+ jmp L(uent)
+C *****************************************************************************
+
+C Handle the case when ap != rp (mod 16).
+
+ ALIGN(16)
+L(utop):movq (ap,n,8), %xmm1
+ punpcklqdq 8(ap,n,8), %xmm1
+ movdqa -8(ap,n,8), %xmm0
+ psllq %xmm4, %xmm1
+ psrlq %xmm5, %xmm0
+ por %xmm1, %xmm0
+ pxor %xmm7, %xmm0
+ movdqa %xmm0, (rp,n,8)
+L(uent):sub $2, n
+ ja L(utop)
+
+ jne L(end8)
+
+ movq (ap), %xmm1
+ pxor %xmm0, %xmm0
+ punpcklqdq %xmm1, %xmm0
+ punpcklqdq 8(ap), %xmm1
+ psllq %xmm4, %xmm1
+ psrlq %xmm5, %xmm0
+ por %xmm1, %xmm0
+ pxor %xmm7, %xmm0
+ movdqa %xmm0, (rp)
+ ret
+C *****************************************************************************
+
+C Handle the case when ap = rp (mod 16).
+
+ ALIGN(16)
+L(atop):movdqa (ap,n,8), %xmm0 C xmm0 = B*ap[n-1] + ap[n-2]
+ movq -8(ap,n,8), %xmm1 C xmm1 = ap[n-3]
+ punpcklqdq %xmm0, %xmm1 C xmm1 = B*ap[n-2] + ap[n-3]
+ psllq %xmm4, %xmm0
+ psrlq %xmm5, %xmm1
+ por %xmm1, %xmm0
+ pxor %xmm7, %xmm0
+ movdqa %xmm0, (rp,n,8)
+L(aent):sub $2, n
+ ja L(atop)
+
+ jne L(end8)
+
+ movdqa (ap), %xmm0
+ pxor %xmm1, %xmm1
+ punpcklqdq %xmm0, %xmm1
+ psllq %xmm4, %xmm0
+ psrlq %xmm5, %xmm1
+ por %xmm1, %xmm0
+ pxor %xmm7, %xmm0
+ movdqa %xmm0, (rp)
+ ret
+C *****************************************************************************
+
+ ALIGN(16)
+L(le2): jne L(end8)
+
+ movq 8(ap), %xmm0
+ movq (ap), %xmm1
+ psllq %xmm4, %xmm0
+ psrlq %xmm5, %xmm1
+ por %xmm1, %xmm0
+ pxor %xmm7, %xmm0
+ movq %xmm0, 8(rp)
+
+L(end8):movq (ap), %xmm0
+ psllq %xmm4, %xmm0
+ pxor %xmm7, %xmm0
+ movq %xmm0, (rp)
+ ret
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/fastsse/rshift-movdqu2.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/fastsse/rshift-movdqu2.asm
new file mode 100644
index 00000000000..1e270b13c31
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/fastsse/rshift-movdqu2.asm
@@ -0,0 +1,201 @@
+dnl AMD64 mpn_rshift optimised for CPUs with fast SSE including fast movdqu.
+
+dnl Contributed to the GNU project by Torbjorn Granlund.
+
+dnl Copyright 2010-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/limb cycles/limb cycles/limb good
+C aligned unaligned best seen for cpu?
+C AMD K8,K9 3 3 2.35 no, use shl/shr
+C AMD K10 1.5-1.8 1.5-1.8 1.33 yes
+C AMD bd1 1.7-1.9 1.7-1.9 1.33 yes
+C AMD bobcat 3.17 3.17 yes, bad for n < 20
+C Intel P4 4.67 4.67 2.7 no, slow movdqu
+C Intel core2 2.15 2.15 1.25 no, use shld/shrd
+C Intel NHM 1.66 1.66 1.25 no, use shld/shrd
+C Intel SBR 1.3 1.3 1.25 yes, bad for n = 4-6
+C Intel atom 11.7 11.7 4.5 no
+C VIA nano 5.7 5.95 2.0 no, slow movdqu
+
+C We try to do as many aligned 16-byte operations as possible. The top-most
+C and bottom-most writes might need 8-byte operations.
+C
+C This variant rely on fast load movdqu, and uses it even for aligned operands,
+C in order to avoid the need for two separate loops.
+C
+C TODO
+C * Could 2-limb wind-down code be simplified?
+C * Improve basecase code, using shld/shrd for SBR, discrete integer shifts
+C for other affected CPUs.
+
+C INPUT PARAMETERS
+define(`rp', `%rdi')
+define(`ap', `%rsi')
+define(`n', `%rdx')
+define(`cnt', `%rcx')
+
+ASM_START()
+ TEXT
+ ALIGN(64)
+PROLOGUE(mpn_rshift)
+ FUNC_ENTRY(4)
+ movd R32(%rcx), %xmm4
+ mov $64, R32(%rax)
+ sub R32(%rcx), R32(%rax)
+ movd R32(%rax), %xmm5
+
+ neg R32(%rcx)
+ mov (ap), %rax
+ shl R8(%rcx), %rax
+
+ cmp $3, n
+ jle L(bc)
+
+ test $8, R8(rp)
+ jz L(rp_aligned)
+
+C Do one initial limb in order to make rp aligned
+ movq (ap), %xmm0
+ movq 8(ap), %xmm1
+ psrlq %xmm4, %xmm0
+ psllq %xmm5, %xmm1
+ por %xmm1, %xmm0
+ movq %xmm0, (rp)
+ lea 8(ap), ap
+ lea 8(rp), rp
+ dec n
+
+L(rp_aligned):
+ lea 1(n), %r8d
+ lea (ap,n,8), ap
+ lea (rp,n,8), rp
+ neg n
+
+ and $6, R32(%r8)
+ jz L(bu0)
+ cmp $4, R32(%r8)
+ jz L(bu4)
+ jc L(bu2)
+L(bu6): add $4, n
+ jmp L(i56)
+L(bu0): add $6, n
+ jmp L(i70)
+L(bu4): add $2, n
+ jmp L(i34)
+L(bu2): add $8, n
+ jge L(end)
+
+ ALIGN(16)
+L(top): movdqu -64(ap,n,8), %xmm1
+ movdqu -56(ap,n,8), %xmm0
+ psllq %xmm5, %xmm0
+ psrlq %xmm4, %xmm1
+ por %xmm1, %xmm0
+ movdqa %xmm0, -64(rp,n,8)
+L(i70):
+ movdqu -48(ap,n,8), %xmm1
+ movdqu -40(ap,n,8), %xmm0
+ psllq %xmm5, %xmm0
+ psrlq %xmm4, %xmm1
+ por %xmm1, %xmm0
+ movdqa %xmm0, -48(rp,n,8)
+L(i56):
+ movdqu -32(ap,n,8), %xmm1
+ movdqu -24(ap,n,8), %xmm0
+ psllq %xmm5, %xmm0
+ psrlq %xmm4, %xmm1
+ por %xmm1, %xmm0
+ movdqa %xmm0, -32(rp,n,8)
+L(i34):
+ movdqu -16(ap,n,8), %xmm1
+ movdqu -8(ap,n,8), %xmm0
+ psllq %xmm5, %xmm0
+ psrlq %xmm4, %xmm1
+ por %xmm1, %xmm0
+ movdqa %xmm0, -16(rp,n,8)
+ add $8, n
+ jl L(top)
+
+L(end): test $1, R8(n)
+ jnz L(e1)
+
+ movdqu -16(ap), %xmm1
+ movq -8(ap), %xmm0
+ psrlq %xmm4, %xmm1
+ psllq %xmm5, %xmm0
+ por %xmm1, %xmm0
+ movdqa %xmm0, -16(rp)
+ FUNC_EXIT()
+ ret
+
+L(e1): movq -8(ap), %xmm0
+ psrlq %xmm4, %xmm0
+ movq %xmm0, -8(rp)
+ FUNC_EXIT()
+ ret
+
+C Basecase
+ ALIGN(16)
+L(bc): dec R32(n)
+ jnz 1f
+ movq (ap), %xmm0
+ psrlq %xmm4, %xmm0
+ movq %xmm0, (rp)
+ FUNC_EXIT()
+ ret
+
+1: movq (ap), %xmm1
+ movq 8(ap), %xmm0
+ psrlq %xmm4, %xmm1
+ psllq %xmm5, %xmm0
+ por %xmm1, %xmm0
+ movq %xmm0, (rp)
+ dec R32(n)
+ jnz 1f
+ movq 8(ap), %xmm0
+ psrlq %xmm4, %xmm0
+ movq %xmm0, 8(rp)
+ FUNC_EXIT()
+ ret
+
+1: movq 8(ap), %xmm1
+ movq 16(ap), %xmm0
+ psrlq %xmm4, %xmm1
+ psllq %xmm5, %xmm0
+ por %xmm1, %xmm0
+ movq %xmm0, 8(rp)
+ movq 16(ap), %xmm0
+ psrlq %xmm4, %xmm0
+ movq %xmm0, 16(rp)
+ FUNC_EXIT()
+ ret
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/fastsse/sec_tabselect.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/fastsse/sec_tabselect.asm
new file mode 100644
index 00000000000..e3df110be4e
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/fastsse/sec_tabselect.asm
@@ -0,0 +1,192 @@
+dnl AMD64 SSE mpn_sec_tabselect.
+
+dnl Contributed to the GNU project by Torbjörn Granlund.
+
+dnl Copyright 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/limb cycles/limb cycles/limb
+C ali,evn n unal,evn n other cases
+C AMD K8,K9 1.65 1.65 1.8
+C AMD K10 0.78 0.78 0.85
+C AMD bd1 0.80 0.91 1.25
+C AMD bobcat 2.15 2.15 2.37
+C Intel P4 2.5 2.5 2.95
+C Intel core2 1.17 1.25 1.25
+C Intel NHM 0.87 0.90 0.90
+C Intel SBR 0.63 0.79 0.77
+C Intel atom 4.3 4.3 4.3 slower than plain code
+C VIA nano 1.4 5.1 3.14 too alignment dependent
+
+C NOTES
+C * We only honour the least significant 32 bits of the `which' and `nents'
+C arguments to allow efficient code using just SSE2. We would need to
+C either use the SSE4_1 pcmpeqq, or find some other SSE2 sequence.
+C * We use movd for copying between xmm and plain registers, since old gas
+C rejects movq. But gas assembles movd as movq when given a 64-bit greg.
+
+define(`rp', `%rdi')
+define(`tp', `%rsi')
+define(`n', `%rdx')
+define(`nents', `%rcx')
+define(`which', `%r8')
+
+define(`i', `%r10')
+define(`j', `%r9')
+
+C rax rbx rcx rdx rdi rsi rbp r8 r9 r10 r11 r12 r13 r14 r15
+C nents n rp tab which j i temp * * * *
+
+ABI_SUPPORT(DOS64)
+ABI_SUPPORT(STD64)
+
+ASM_START()
+ TEXT
+ ALIGN(16)
+PROLOGUE(mpn_sec_tabselect)
+ FUNC_ENTRY(4)
+IFDOS(` mov 56(%rsp), %r8d ')
+
+ movd which, %xmm8
+ pshufd $0, %xmm8, %xmm8 C 4 `which' copies
+ mov $1, R32(%rax)
+ movd %rax, %xmm9
+ pshufd $0, %xmm9, %xmm9 C 4 copies of 1
+
+ mov n, j
+ add $-8, j
+ js L(outer_end)
+
+L(outer_top):
+ mov nents, i
+ mov tp, %r11
+ pxor %xmm13, %xmm13
+ pxor %xmm4, %xmm4
+ pxor %xmm5, %xmm5
+ pxor %xmm6, %xmm6
+ pxor %xmm7, %xmm7
+ ALIGN(16)
+L(top): movdqa %xmm8, %xmm0
+ pcmpeqd %xmm13, %xmm0
+ paddd %xmm9, %xmm13
+ movdqu 0(tp), %xmm2
+ movdqu 16(tp), %xmm3
+ pand %xmm0, %xmm2
+ pand %xmm0, %xmm3
+ por %xmm2, %xmm4
+ por %xmm3, %xmm5
+ movdqu 32(tp), %xmm2
+ movdqu 48(tp), %xmm3
+ pand %xmm0, %xmm2
+ pand %xmm0, %xmm3
+ por %xmm2, %xmm6
+ por %xmm3, %xmm7
+ lea (tp,n,8), tp
+ add $-1, i
+ jne L(top)
+
+ movdqu %xmm4, 0(rp)
+ movdqu %xmm5, 16(rp)
+ movdqu %xmm6, 32(rp)
+ movdqu %xmm7, 48(rp)
+
+ lea 64(%r11), tp
+ lea 64(rp), rp
+ add $-8, j
+ jns L(outer_top)
+L(outer_end):
+
+ test $4, R8(n)
+ je L(b0xx)
+L(b1xx):mov nents, i
+ mov tp, %r11
+ pxor %xmm13, %xmm13
+ pxor %xmm4, %xmm4
+ pxor %xmm5, %xmm5
+ ALIGN(16)
+L(tp4): movdqa %xmm8, %xmm0
+ pcmpeqd %xmm13, %xmm0
+ paddd %xmm9, %xmm13
+ movdqu 0(tp), %xmm2
+ movdqu 16(tp), %xmm3
+ pand %xmm0, %xmm2
+ pand %xmm0, %xmm3
+ por %xmm2, %xmm4
+ por %xmm3, %xmm5
+ lea (tp,n,8), tp
+ add $-1, i
+ jne L(tp4)
+ movdqu %xmm4, 0(rp)
+ movdqu %xmm5, 16(rp)
+ lea 32(%r11), tp
+ lea 32(rp), rp
+
+L(b0xx):test $2, R8(n)
+ je L(b00x)
+L(b01x):mov nents, i
+ mov tp, %r11
+ pxor %xmm13, %xmm13
+ pxor %xmm4, %xmm4
+ ALIGN(16)
+L(tp2): movdqa %xmm8, %xmm0
+ pcmpeqd %xmm13, %xmm0
+ paddd %xmm9, %xmm13
+ movdqu 0(tp), %xmm2
+ pand %xmm0, %xmm2
+ por %xmm2, %xmm4
+ lea (tp,n,8), tp
+ add $-1, i
+ jne L(tp2)
+ movdqu %xmm4, 0(rp)
+ lea 16(%r11), tp
+ lea 16(rp), rp
+
+L(b00x):test $1, R8(n)
+ je L(b000)
+L(b001):mov nents, i
+ mov tp, %r11
+ pxor %xmm13, %xmm13
+ pxor %xmm4, %xmm4
+ ALIGN(16)
+L(tp1): movdqa %xmm8, %xmm0
+ pcmpeqd %xmm13, %xmm0
+ paddd %xmm9, %xmm13
+ movq 0(tp), %xmm2
+ pand %xmm0, %xmm2
+ por %xmm2, %xmm4
+ lea (tp,n,8), tp
+ add $-1, i
+ jne L(tp1)
+ movq %xmm4, 0(rp)
+
+L(b000):FUNC_EXIT()
+ ret
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/fat/fat.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/fat/fat.c
new file mode 100644
index 00000000000..1b3f4e48be8
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/fat/fat.c
@@ -0,0 +1,368 @@
+/* x86_64 fat binary initializers.
+
+ Contributed to the GNU project by Kevin Ryde (original x86_32 code) and
+ Torbjorn Granlund (port to x86_64)
+
+ THE FUNCTIONS AND VARIABLES 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 2003, 2004, 2009, 2011-2014 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> /* for printf */
+#include <stdlib.h> /* for getenv */
+#include <string.h>
+
+#include "gmp.h"
+#include "gmp-impl.h"
+
+/* Change this to "#define TRACE(x) x" for some traces. */
+#define TRACE(x)
+
+
+/* fat_entry.asm */
+long __gmpn_cpuid (char [12], int);
+
+
+#if WANT_FAKE_CPUID
+/* The "name"s in the table are values for the GMP_CPU_TYPE environment
+ variable. Anything can be used, but for now it's the canonical cpu types
+ as per config.guess/config.sub. */
+
+#define __gmpn_cpuid fake_cpuid
+
+#define MAKE_FMS(family, model) \
+ ((((family) & 0xf) << 8) + (((family) & 0xff0) << 20) \
+ + (((model) & 0xf) << 4) + (((model) & 0xf0) << 12))
+
+static struct {
+ const char *name;
+ const char vendor[13];
+ unsigned fms;
+} fake_cpuid_table[] = {
+ { "core2", "GenuineIntel", MAKE_FMS (6, 0xf) },
+ { "coreinhm", "GenuineIntel", MAKE_FMS (6, 0x1a) },
+ { "coreiwsm", "GenuineIntel", MAKE_FMS (6, 0x25) },
+ { "coreisbr", "GenuineIntel", MAKE_FMS (6, 0x2a) },
+ { "coreihwl", "GenuineIntel", MAKE_FMS (6, 0x3c) },
+ { "atom", "GenuineIntel", MAKE_FMS (6, 0x1c) },
+ { "pentium4", "GenuineIntel", MAKE_FMS (15, 3) },
+
+ { "k8", "AuthenticAMD", MAKE_FMS (15, 0) },
+ { "k10", "AuthenticAMD", MAKE_FMS (16, 0) },
+ { "bobcat", "AuthenticAMD", MAKE_FMS (20, 1) },
+ { "bulldozer", "AuthenticAMD", MAKE_FMS (21, 1) },
+ { "piledriver", "AuthenticAMD", MAKE_FMS (21, 2) },
+ { "steamroller","AuthenticAMD", MAKE_FMS (21, 0x30) },
+ { "excavator", "AuthenticAMD", MAKE_FMS (21, 0x60) },
+ { "jaguar", "AuthenticAMD", MAKE_FMS (22, 1) },
+
+ { "nano", "CentaurHauls", MAKE_FMS (6, 15) },
+};
+
+static int
+fake_cpuid_lookup (void)
+{
+ char *s;
+ int i;
+
+ s = getenv ("GMP_CPU_TYPE");
+ if (s == NULL)
+ {
+ printf ("Need GMP_CPU_TYPE environment variable for fake cpuid\n");
+ abort ();
+ }
+
+ for (i = 0; i < numberof (fake_cpuid_table); i++)
+ if (strcmp (s, fake_cpuid_table[i].name) == 0)
+ return i;
+
+ printf ("GMP_CPU_TYPE=%s unknown\n", s);
+ abort ();
+}
+
+static long
+fake_cpuid (char dst[12], unsigned int id)
+{
+ int i = fake_cpuid_lookup();
+
+ switch (id) {
+ case 0:
+ memcpy (dst, fake_cpuid_table[i].vendor, 12);
+ return 0;
+ case 1:
+ return fake_cpuid_table[i].fms;
+ case 7:
+ dst[0] = 0xff; /* BMI1, AVX2, etc */
+ dst[1] = 0xff; /* BMI2, etc */
+ return 0;
+ case 0x80000001:
+ dst[4 + 29 / 8] = (1 << (29 % 8)); /* "long" mode */
+ return 0;
+ default:
+ printf ("fake_cpuid(): oops, unknown id %d\n", id);
+ abort ();
+ }
+}
+#endif
+
+
+typedef DECL_preinv_divrem_1 ((*preinv_divrem_1_t));
+typedef DECL_preinv_mod_1 ((*preinv_mod_1_t));
+
+struct cpuvec_t __gmpn_cpuvec = {
+ __MPN(add_n_init),
+ __MPN(addlsh1_n_init),
+ __MPN(addlsh2_n_init),
+ __MPN(addmul_1_init),
+ __MPN(addmul_2_init),
+ __MPN(bdiv_dbm1c_init),
+ __MPN(cnd_add_n_init),
+ __MPN(cnd_sub_n_init),
+ __MPN(com_init),
+ __MPN(copyd_init),
+ __MPN(copyi_init),
+ __MPN(divexact_1_init),
+ __MPN(divrem_1_init),
+ __MPN(gcd_1_init),
+ __MPN(lshift_init),
+ __MPN(lshiftc_init),
+ __MPN(mod_1_init),
+ __MPN(mod_1_1p_init),
+ __MPN(mod_1_1p_cps_init),
+ __MPN(mod_1s_2p_init),
+ __MPN(mod_1s_2p_cps_init),
+ __MPN(mod_1s_4p_init),
+ __MPN(mod_1s_4p_cps_init),
+ __MPN(mod_34lsub1_init),
+ __MPN(modexact_1c_odd_init),
+ __MPN(mul_1_init),
+ __MPN(mul_basecase_init),
+ __MPN(mullo_basecase_init),
+ __MPN(preinv_divrem_1_init),
+ __MPN(preinv_mod_1_init),
+ __MPN(redc_1_init),
+ __MPN(redc_2_init),
+ __MPN(rshift_init),
+ __MPN(sqr_basecase_init),
+ __MPN(sub_n_init),
+ __MPN(sublsh1_n_init),
+ __MPN(submul_1_init),
+ 0
+};
+
+int __gmpn_cpuvec_initialized = 0;
+
+/* The following setups start with generic x86, then overwrite with
+ specifics for a chip, and higher versions of that chip.
+
+ The arrangement of the setups here will normally be the same as the $path
+ selections in configure.in for the respective chips.
+
+ This code is reentrant and thread safe. We always calculate the same
+ decided_cpuvec, so if two copies of the code are running it doesn't
+ matter which completes first, both write the same to __gmpn_cpuvec.
+
+ We need to go via decided_cpuvec because if one thread has completed
+ __gmpn_cpuvec then it may be making use of the threshold values in that
+ vector. If another thread is still running __gmpn_cpuvec_init then we
+ don't want it to write different values to those fields since some of the
+ asm routines only operate correctly up to their own defined threshold,
+ not an arbitrary value. */
+
+void
+__gmpn_cpuvec_init (void)
+{
+ struct cpuvec_t decided_cpuvec;
+ char vendor_string[13];
+ char dummy_string[12];
+ long fms;
+ int family, model;
+
+ TRACE (printf ("__gmpn_cpuvec_init:\n"));
+
+ memset (&decided_cpuvec, '\0', sizeof (decided_cpuvec));
+
+ CPUVEC_SETUP_x86_64;
+ CPUVEC_SETUP_fat;
+
+ __gmpn_cpuid (vendor_string, 0);
+ vendor_string[12] = 0;
+
+ fms = __gmpn_cpuid (dummy_string, 1);
+ family = ((fms >> 8) & 0xf) + ((fms >> 20) & 0xff);
+ model = ((fms >> 4) & 0xf) + ((fms >> 12) & 0xf0);
+
+ /* Check extended feature flags */
+ __gmpn_cpuid (dummy_string, 0x80000001);
+ if ((dummy_string[4 + 29 / 8] & (1 << (29 % 8))) == 0)
+ abort (); /* longmode-capable-bit turned off! */
+
+ /*********************************************************/
+ /*** WARNING: keep this list in sync with config.guess ***/
+ /*********************************************************/
+ if (strcmp (vendor_string, "GenuineIntel") == 0)
+ {
+ switch (family)
+ {
+ case 6:
+ switch (model)
+ {
+ case 0x0f: /* Conroe Merom Kentsfield Allendale */
+ case 0x10:
+ case 0x11:
+ case 0x12:
+ case 0x13:
+ case 0x14:
+ case 0x15:
+ case 0x16:
+ case 0x17: /* PNR Wolfdale Yorkfield */
+ case 0x18:
+ case 0x19:
+ case 0x1d: /* PNR Dunnington */
+ CPUVEC_SETUP_core2;
+ break;
+
+ case 0x1c: /* Atom Silverthorne */
+ case 0x26: /* Atom Lincroft */
+ case 0x27: /* Atom Saltwell? */
+ case 0x36: /* Atom Cedarview/Saltwell */
+ CPUVEC_SETUP_atom;
+ break;
+
+ case 0x1a: /* NHM Gainestown */
+ case 0x1b:
+ case 0x1e: /* NHM Lynnfield/Jasper */
+ case 0x1f:
+ case 0x20:
+ case 0x21:
+ case 0x22:
+ case 0x23:
+ case 0x24:
+ case 0x25: /* WSM Clarkdale/Arrandale */
+ case 0x28:
+ case 0x29:
+ case 0x2b:
+ case 0x2c: /* WSM Gulftown */
+ case 0x2e: /* NHM Beckton */
+ case 0x2f: /* WSM Eagleton */
+ case 0x37: /* Atom Silvermont */
+ case 0x4d: /* Atom Silvermont/Avoton */
+ CPUVEC_SETUP_core2;
+ CPUVEC_SETUP_coreinhm;
+ break;
+
+ case 0x2a: /* SB */
+ case 0x2d: /* SBC-EP */
+ case 0x3a: /* IBR */
+ case 0x3e: /* IBR Ivytown */
+ CPUVEC_SETUP_core2;
+ CPUVEC_SETUP_coreinhm;
+ CPUVEC_SETUP_coreisbr;
+ break;
+ case 0x3c: /* Haswell client */
+ case 0x3d: /* Broadwell */
+ case 0x3f: /* Haswell server */
+ case 0x45: /* Haswell ULT */
+ case 0x46: /* Crystal Well */
+ case 0x4f: /* Broadwell server */
+ case 0x56: /* Broadwell microserver */
+ CPUVEC_SETUP_core2;
+ CPUVEC_SETUP_coreinhm;
+ CPUVEC_SETUP_coreisbr;
+ /* Some Haswells lack BMI2. Let them appear as Sandybridges for
+ now. */
+ __gmpn_cpuid (dummy_string, 7);
+ if ((dummy_string[0 + 8 / 8] & (1 << (8 % 8))) != 0)
+ CPUVEC_SETUP_coreihwl;
+ break;
+ }
+ break;
+
+ case 15:
+ CPUVEC_SETUP_pentium4;
+ break;
+ }
+ }
+ else if (strcmp (vendor_string, "AuthenticAMD") == 0)
+ {
+ switch (family)
+ {
+ case 0x0f: /* k8 */
+ case 0x11: /* "fam 11h", mix of k8 and k10 */
+ case 0x13:
+ case 0x17:
+ CPUVEC_SETUP_k8;
+ break;
+
+ case 0x10: /* k10 */
+ case 0x12: /* k10 (llano) */
+ CPUVEC_SETUP_k8;
+ CPUVEC_SETUP_k10;
+ break;
+
+ case 0x14: /* bobcat */
+ case 0x16: /* jaguar */
+ CPUVEC_SETUP_k8;
+ CPUVEC_SETUP_k10;
+ CPUVEC_SETUP_bobcat;
+ break;
+
+ case 0x15: /* bulldozer, piledriver, steamroller, excavator */
+ CPUVEC_SETUP_k8;
+ CPUVEC_SETUP_k10;
+ CPUVEC_SETUP_bd1;
+ }
+ }
+ else if (strcmp (vendor_string, "CentaurHauls") == 0)
+ {
+ switch (family)
+ {
+ case 6:
+ if (model >= 15)
+ CPUVEC_SETUP_nano;
+ break;
+ }
+ }
+
+ /* There's no x86 generic mpn_preinv_divrem_1 or mpn_preinv_mod_1.
+ Instead default to the plain versions from whichever CPU we detected.
+ The function arguments are compatible, no need for any glue code. */
+ if (decided_cpuvec.preinv_divrem_1 == NULL)
+ decided_cpuvec.preinv_divrem_1 =(preinv_divrem_1_t)decided_cpuvec.divrem_1;
+ if (decided_cpuvec.preinv_mod_1 == NULL)
+ decided_cpuvec.preinv_mod_1 =(preinv_mod_1_t) decided_cpuvec.mod_1;
+
+ ASSERT_CPUVEC (decided_cpuvec);
+ CPUVEC_INSTALL (decided_cpuvec);
+
+ /* Set this once the threshold fields are ready.
+ Use volatile to prevent it getting moved. */
+ *((volatile int *) &__gmpn_cpuvec_initialized) = 1;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/fat/fat_entry.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/fat/fat_entry.asm
new file mode 100644
index 00000000000..764e3d82f2b
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/fat/fat_entry.asm
@@ -0,0 +1,204 @@
+dnl x86 fat binary entrypoints.
+
+dnl Contributed to the GNU project by Kevin Ryde (original x86_32 code) and
+dnl Torbjorn Granlund (port to x86_64)
+
+dnl Copyright 2003, 2009, 2011-2014 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')
+
+
+dnl Forcibly disable profiling.
+dnl
+dnl The entrypoints and inits are small enough not to worry about, the real
+dnl routines arrived at will have any profiling. Also, the way the code
+dnl here ends with a jump means we won't work properly with the
+dnl "instrument" profiling scheme anyway.
+
+define(`WANT_PROFILING',no)
+
+
+dnl We define PRETEND_PIC as a helper symbol, the use it for suppressing
+dnl normal, fast call code, since that triggers problems on Darwin and
+dnl OpenBSD.
+
+ifdef(`DARWIN',
+`define(`PRETEND_PIC')')
+ifdef(`OPENBSD',
+`define(`PRETEND_PIC')')
+ifdef(`PIC',
+`define(`PRETEND_PIC')')
+
+ABI_SUPPORT(DOS64)
+ABI_SUPPORT(STD64)
+
+ TEXT
+
+dnl Usage: FAT_ENTRY(name, offset)
+dnl
+dnl Emit a fat binary entrypoint function of the given name. This is the
+dnl normal entry for applications, eg. __gmpn_add_n.
+dnl
+dnl The code simply jumps through the function pointer in __gmpn_cpuvec at
+dnl the given "offset" (in bytes).
+dnl
+dnl For non-PIC, the jumps are 5 bytes each, aligning them to 8 should be
+dnl fine for all x86s.
+dnl
+dnl For ELF/DARWIN PIC, the jumps are 20 bytes each, and are best aligned to
+dnl 16 to ensure at least the first two instructions don't cross a cache line
+dnl boundary.
+dnl
+dnl For DOS64, the jumps are 6 bytes. The same form works also for GNU/Linux
+dnl (at least with certain assembler/linkers) but FreeBSD 8.2 crashes. Not
+dnl tested on Darwin, Slowaris, NetBSD, etc.
+dnl
+dnl Note the extra `' ahead of PROLOGUE obscures it from the HAVE_NATIVE
+dnl grepping in configure, stopping that code trying to eval something with
+dnl $1 in it.
+
+define(FAT_ENTRY,
+m4_assert_numargs(2)
+`ifdef(`HOST_DOS64',
+` ALIGN(8)
+`'PROLOGUE($1)
+ jmp *$2+GSYM_PREFIX`'__gmpn_cpuvec(%rip)
+EPILOGUE()
+',
+` ALIGN(ifdef(`PIC',16,8))
+`'PROLOGUE($1)
+ifdef(`PRETEND_PIC',
+` LEA( GSYM_PREFIX`'__gmpn_cpuvec, %rax)
+ jmp *$2(%rax)
+',`dnl non-PIC
+ jmp *GSYM_PREFIX`'__gmpn_cpuvec+$2
+')
+EPILOGUE()
+')')
+
+
+dnl FAT_ENTRY for each CPUVEC_FUNCS_LIST
+dnl
+
+define(`CPUVEC_offset',0)
+foreach(i,
+`FAT_ENTRY(MPN(i),CPUVEC_offset)
+define(`CPUVEC_offset',eval(CPUVEC_offset + 8))',
+CPUVEC_FUNCS_LIST)
+
+
+dnl Usage: FAT_INIT(name, offset)
+dnl
+dnl Emit a fat binary initializer function of the given name. These
+dnl functions are the initial values for the pointers in __gmpn_cpuvec.
+dnl
+dnl The code simply calls __gmpn_cpuvec_init, and then jumps back through
+dnl the __gmpn_cpuvec pointer, at the given "offset" (in bytes).
+dnl __gmpn_cpuvec_init will have stored the address of the selected
+dnl implementation there.
+dnl
+dnl Only one of these routines will be executed, and only once, since after
+dnl that all the __gmpn_cpuvec pointers go to real routines. So there's no
+dnl need for anything special here, just something small and simple. To
+dnl keep code size down, "fat_init" is a shared bit of code, arrived at
+dnl with the offset in %al. %al is used since the movb instruction is 2
+dnl bytes where %eax would be 4.
+dnl
+dnl Note having `PROLOGUE in FAT_INIT obscures that PROLOGUE from the
+dnl HAVE_NATIVE grepping in configure, preventing that code trying to eval
+dnl something with $1 in it.
+dnl
+dnl We need to preserve parameter registers over the __gmpn_cpuvec_init call
+
+define(FAT_INIT,
+m4_assert_numargs(2)
+`PROLOGUE($1)
+ mov $`'$2, %al
+ jmp L(fat_init)
+EPILOGUE()
+')
+
+dnl FAT_INIT for each CPUVEC_FUNCS_LIST
+dnl
+
+define(`CPUVEC_offset',0)
+foreach(i,
+`FAT_INIT(MPN(i`'_init),CPUVEC_offset)
+define(`CPUVEC_offset',eval(CPUVEC_offset + 1))',
+CPUVEC_FUNCS_LIST)
+
+L(fat_init):
+ C al __gmpn_cpuvec byte offset
+
+ movzbl %al, %eax
+IFSTD(` push %rdi ')
+IFSTD(` push %rsi ')
+ push %rdx
+ push %rcx
+ push %r8
+ push %r9
+ push %rax
+ CALL( __gmpn_cpuvec_init)
+ pop %rax
+ pop %r9
+ pop %r8
+ pop %rcx
+ pop %rdx
+IFSTD(` pop %rsi ')
+IFSTD(` pop %rdi ')
+ifdef(`PRETEND_PIC',`
+ LEA( GSYM_PREFIX`'__gmpn_cpuvec, %r10)
+ jmp *(%r10,%rax,8)
+',`dnl non-PIC
+ jmp *GSYM_PREFIX`'__gmpn_cpuvec(,%rax,8)
+')
+
+
+C long __gmpn_cpuid (char dst[12], int id);
+C
+C This is called only 3 times, so just something simple and compact is fine.
+C
+C The rcx/ecx zeroing here is needed for the BMI2 check.
+
+define(`rp', `%rdi')
+define(`idx', `%rsi')
+
+PROLOGUE(__gmpn_cpuid)
+ FUNC_ENTRY(2)
+ mov %rbx, %r8
+ mov R32(idx), R32(%rax)
+ xor %ecx, %ecx
+ cpuid
+ mov %ebx, (rp)
+ mov %edx, 4(rp)
+ mov %ecx, 8(rp)
+ mov %r8, %rbx
+ FUNC_EXIT()
+ ret
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/fat/gmp-mparam.h b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/fat/gmp-mparam.h
new file mode 100644
index 00000000000..005c893635f
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/fat/gmp-mparam.h
@@ -0,0 +1,72 @@
+/* Fat binary x86_64 gmp-mparam.h -- Compiler/machine parameter header file.
+
+Copyright 1991, 1993, 1994, 2000-2003, 2009, 2011 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
+
+
+/* mpn_divexact_1 is faster than mpn_divrem_1 at all sizes. The only time
+ this might not be true currently is for actual 80386 and 80486 chips,
+ where mpn/x86/dive_1.asm might be slower than mpn/x86/divrem_1.asm, but
+ that's not worth worrying about. */
+#define DIVEXACT_1_THRESHOLD 0
+
+/* Only some of the x86s have an mpn_preinv_divrem_1, but we set
+ USE_PREINV_DIVREM_1 so that all callers use it, and then let the
+ __gmpn_cpuvec pointer go to plain mpn_divrem_1 if there's not an actual
+ preinv. */
+#define USE_PREINV_DIVREM_1 1
+
+#define BMOD_1_TO_MOD_1_THRESHOLD 20
+
+/* mpn_sqr_basecase is faster than mpn_mul_basecase at all sizes, no need
+ for mpn_sqr to call the latter. */
+#define SQR_BASECASE_THRESHOLD 0
+
+/* Sensible fallbacks for these, when not taken from a cpu-specific
+ gmp-mparam.h. */
+#define MUL_TOOM22_THRESHOLD 20
+#define MUL_TOOM33_THRESHOLD 130
+#define SQR_TOOM2_THRESHOLD 30
+#define SQR_TOOM3_THRESHOLD 200
+
+/* These are values more or less in the middle of what the typical x86 chips
+ come out as. For a fat binary it's necessary to have values for these,
+ since the defaults for MUL_FFT_TABLE and SQR_FFT_TABLE otherwise come out
+ as non-constant array initializers. FIXME: Perhaps these should be done
+ in the cpuvec structure like other thresholds. */
+#define MUL_FFT_TABLE { 464, 928, 1920, 3584, 10240, 40960, 0 }
+#define MUL_FFT_MODF_THRESHOLD 400
+#define MUL_FFT_THRESHOLD 2000
+
+#define SQR_FFT_TABLE { 528, 1184, 1920, 4608, 14336, 40960, 0 }
+#define SQR_FFT_MODF_THRESHOLD 500
+#define SQR_FFT_THRESHOLD 3000
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/fat/mod_1.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/fat/mod_1.c
new file mode 100644
index 00000000000..4f149cc353c
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/fat/mod_1.c
@@ -0,0 +1,32 @@
+/* Fat binary fallback mpn_mod_1.
+
+Copyright 2003, 2009 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 "mpn/generic/mod_1.c"
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/fat/mul_basecase.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/fat/mul_basecase.c
new file mode 100644
index 00000000000..d9eb4718c27
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/fat/mul_basecase.c
@@ -0,0 +1,32 @@
+/* Fat binary fallback mpn_mul_basecase.
+
+Copyright 2012 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 "mpn/generic/mul_basecase.c"
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/fat/mullo_basecase.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/fat/mullo_basecase.c
new file mode 100644
index 00000000000..7f86be64c52
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/fat/mullo_basecase.c
@@ -0,0 +1,32 @@
+/* Fat binary fallback mpn_mullo_basecase.
+
+Copyright 2012 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 "mpn/generic/mullo_basecase.c"
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/fat/redc_1.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/fat/redc_1.c
new file mode 100644
index 00000000000..00254033538
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/fat/redc_1.c
@@ -0,0 +1,32 @@
+/* Fat binary fallback mpn_redc_1.
+
+Copyright 2012 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 "mpn/generic/redc_1.c"
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/fat/redc_2.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/fat/redc_2.c
new file mode 100644
index 00000000000..1932d583231
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/fat/redc_2.c
@@ -0,0 +1,32 @@
+/* Fat binary fallback mpn_redc_2.
+
+Copyright 2012 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 "mpn/generic/redc_2.c"
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/fat/sqr_basecase.c b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/fat/sqr_basecase.c
new file mode 100644
index 00000000000..d1c5dcd2e03
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/fat/sqr_basecase.c
@@ -0,0 +1,32 @@
+/* Fat binary fallback mpn_sqr_basecase.
+
+Copyright 2012 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 "mpn/generic/sqr_basecase.c"
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/gcd_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/gcd_1.asm
new file mode 100644
index 00000000000..252d4174ebf
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/gcd_1.asm
@@ -0,0 +1,163 @@
+dnl AMD64 mpn_gcd_1 -- mpn by 1 gcd.
+
+dnl Based on the K7 gcd_1.asm, by Kevin Ryde. Rehacked for AMD64 by Torbjorn
+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 AMD K8,K9 5.21 (4.95)
+C AMD K10 5.15 (5.00)
+C AMD bd1 5.42 (5.14)
+C AMD bobcat 6.71 (6.56)
+C Intel P4 13.5 (12.75)
+C Intel core2 6.20 (6.16)
+C Intel NHM 6.49 (6.25)
+C Intel SBR 7.75 (7.57)
+C Intel atom 8.77 (8.54)
+C VIA nano 6.60 (6.20)
+C Numbers measured with: speed -CD -s16-64 -t48 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))
+
+DEF_OBJECT(ctz_table,64)
+ .byte MAXSHIFT
+forloop(i,1,MASK,
+` .byte m4_count_trailing_zeros(i)
+')
+END_OBJECT(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', 8)
+
+C INPUT PARAMETERS
+define(`up', `%rdi')
+define(`n', `%rsi')
+define(`v0', `%rdx')
+
+ABI_SUPPORT(DOS64)
+ABI_SUPPORT(STD64)
+
+IFDOS(`define(`STACK_ALLOC', 40)')
+IFSTD(`define(`STACK_ALLOC', 8)')
+
+ASM_START()
+ TEXT
+ ALIGN(16)
+PROLOGUE(mpn_gcd_1)
+ FUNC_ENTRY(3)
+ mov (up), %rax C U low limb
+ mov $-1, R32(%rcx)
+ or v0, %rax C x | y
+
+L(twos):
+ inc R32(%rcx)
+ shr %rax
+ jnc L(twos)
+
+ shr R8(%rcx), v0
+ push %rcx C common twos
+
+L(divide_strip_y):
+ shr v0
+ jnc L(divide_strip_y)
+ adc v0, v0
+
+ cmp $1, n
+ jnz L(reduce_nby1)
+
+C Both U and V are single limbs, reduce with bmod if u0 >> v0.
+ mov (up), %r8
+ mov %r8, %rax
+ shr $BMOD_THRES_LOG2, %r8
+ cmp %r8, v0
+ ja L(noreduce)
+ push v0
+ sub $STACK_ALLOC, %rsp C maintain ABI required rsp alignment
+
+L(bmod):
+IFDOS(` mov %rdx, %r8 ')
+IFDOS(` mov %rsi, %rdx ')
+IFDOS(` mov %rdi, %rcx ')
+ CALL( mpn_modexact_1_odd)
+
+L(reduced):
+ add $STACK_ALLOC, %rsp
+ pop %rdx
+
+L(noreduce):
+ LEA( ctz_table, %rsi)
+ test %rax, %rax
+ mov %rax, %rcx
+ jnz L(mid)
+ jmp L(end)
+
+L(reduce_nby1):
+ push v0
+ sub $STACK_ALLOC, %rsp C maintain ABI required rsp alignment
+
+ cmp $BMOD_1_TO_MOD_1_THRESHOLD, n
+ jl L(bmod)
+IFDOS(` mov %rdx, %r8 ')
+IFDOS(` mov %rsi, %rdx ')
+IFDOS(` mov %rdi, %rcx ')
+ CALL( mpn_mod_1)
+ jmp L(reduced)
+
+ ALIGN(16) C K8 BC P4 NHM SBR
+L(top): cmovc %rcx, %rax C if x-y < 0 0
+ cmovc %rdi, %rdx C use x,y-x 0
+L(mid): and $MASK, R32(%rcx) C 0
+ movzbl (%rsi,%rcx), R32(%rcx) C 1
+ jz L(shift_alot) C 1
+ shr R8(%rcx), %rax C 3
+ mov %rax, %rdi C 4
+ mov %rdx, %rcx C 3
+ sub %rax, %rcx C 4
+ sub %rdx, %rax C 4
+ jnz L(top) C 5
+
+L(end): pop %rcx
+ mov %rdx, %rax
+ shl R8(%rcx), %rax
+ FUNC_EXIT()
+ ret
+
+L(shift_alot):
+ shr $MAXSHIFT, %rax
+ mov %rax, %rcx
+ jmp L(mid)
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/gmp-mparam.h b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/gmp-mparam.h
new file mode 100644
index 00000000000..0dea8c94cda
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/gmp-mparam.h
@@ -0,0 +1,218 @@
+/* AMD K8-K10 gmp-mparam.h -- Compiler/machine parameter header file.
+
+Copyright 1991, 1993, 1994, 2000-2010, 2012 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
+
+
+#define MOD_1_NORM_THRESHOLD 0 /* always */
+#define MOD_1_UNNORM_THRESHOLD 0 /* always */
+#define MOD_1N_TO_MOD_1_1_THRESHOLD 4
+#define MOD_1U_TO_MOD_1_1_THRESHOLD 3
+#define MOD_1_1_TO_MOD_1_2_THRESHOLD 14
+#define MOD_1_2_TO_MOD_1_4_THRESHOLD 28
+#define PREINV_MOD_1_TO_MOD_1_THRESHOLD 7
+#define USE_PREINV_DIVREM_1 1 /* native */
+#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 MUL_TOOM22_THRESHOLD 27
+#define MUL_TOOM33_THRESHOLD 81
+#define MUL_TOOM44_THRESHOLD 234
+#define MUL_TOOM6H_THRESHOLD 418
+#define MUL_TOOM8H_THRESHOLD 466
+
+#define MUL_TOOM32_TO_TOOM43_THRESHOLD 97
+#define MUL_TOOM32_TO_TOOM53_THRESHOLD 160
+#define MUL_TOOM42_TO_TOOM53_THRESHOLD 145
+#define MUL_TOOM42_TO_TOOM63_THRESHOLD 175
+
+#define SQR_BASECASE_THRESHOLD 0 /* always (native) */
+#define SQR_TOOM2_THRESHOLD 36
+#define SQR_TOOM3_THRESHOLD 117
+#define SQR_TOOM4_THRESHOLD 327
+#define SQR_TOOM6_THRESHOLD 446
+#define SQR_TOOM8_THRESHOLD 547
+
+#define MULMID_TOOM42_THRESHOLD 36
+
+#define MULMOD_BNM1_THRESHOLD 17
+#define SQRMOD_BNM1_THRESHOLD 17
+
+#define POWM_SEC_TABLE 2,67,322,991
+
+#define MUL_FFT_MODF_THRESHOLD 570 /* k = 5 */
+#define MUL_FFT_TABLE3 \
+ { { 570, 5}, { 21, 6}, { 11, 5}, { 23, 6}, \
+ { 25, 7}, { 13, 6}, { 27, 7}, { 15, 6}, \
+ { 31, 7}, { 25, 8}, { 13, 7}, { 29, 8}, \
+ { 15, 7}, { 31, 8}, { 17, 7}, { 35, 8}, \
+ { 19, 7}, { 39, 8}, { 21, 7}, { 43, 8}, \
+ { 23, 7}, { 47, 8}, { 25, 7}, { 51, 8}, \
+ { 29, 9}, { 15, 8}, { 37, 9}, { 19, 8}, \
+ { 43, 9}, { 23, 8}, { 51, 9}, { 27, 8}, \
+ { 55,10}, { 15, 9}, { 43,10}, { 23, 9}, \
+ { 55,10}, { 31, 9}, { 63, 5}, { 1023, 4}, \
+ { 2431, 5}, { 1279, 6}, { 671, 7}, { 367, 8}, \
+ { 189, 9}, { 95, 8}, { 195, 9}, { 111,11}, \
+ { 31, 9}, { 131,10}, { 71, 9}, { 155,10}, \
+ { 79, 9}, { 159,10}, { 87,11}, { 47,10}, \
+ { 111,11}, { 63,10}, { 135,11}, { 79,10}, \
+ { 167,11}, { 95,10}, { 191,11}, { 111,12}, \
+ { 63,11}, { 143,10}, { 287,11}, { 159,10}, \
+ { 319,11}, { 175,12}, { 95,11}, { 207,13}, \
+ { 63,12}, { 127,11}, { 255,10}, { 543,11}, \
+ { 287,12}, { 159,11}, { 319,10}, { 639,11}, \
+ { 335,10}, { 671,11}, { 351,10}, { 703,12}, \
+ { 191,11}, { 383,10}, { 767,11}, { 415,12}, \
+ { 223,13}, { 127,12}, { 255,11}, { 543,12}, \
+ { 287,11}, { 575,10}, { 1151,11}, { 607,12}, \
+ { 319,11}, { 639,10}, { 1279,11}, { 671,12}, \
+ { 351,11}, { 703,13}, { 191,12}, { 383,11}, \
+ { 767,12}, { 415,11}, { 831,12}, { 447,14}, \
+ { 127,13}, { 255,12}, { 543,11}, { 1087,12}, \
+ { 607,11}, { 1215,13}, { 319,12}, { 671,11}, \
+ { 1343,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}, { 1087,13}, { 575,12}, \
+ { 1215,13}, { 639,12}, { 1343,13}, { 703,12}, \
+ { 1407,14}, { 383,13}, { 767,12}, { 1599,13}, \
+ { 831,12}, { 1663,13}, { 895,12}, { 1791,13}, \
+ { 959,15}, { 255,14}, { 511,13}, { 1087,12}, \
+ { 2175,13}, { 1215,14}, { 639,13}, { 1471,14}, \
+ { 767,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}, { 1535,13}, { 3071,14}, { 1791,16}, \
+ { 511,15}, { 1023,14}, { 2431,15}, { 1279,14}, \
+ { 2815,15}, { 1535,14}, { 3199,15}, { 1791,14}, \
+ { 3583,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 7552
+
+#define SQR_FFT_MODF_THRESHOLD 460 /* k = 5 */
+#define SQR_FFT_TABLE3 \
+ { { 460, 5}, { 21, 6}, { 11, 5}, { 23, 6}, \
+ { 12, 5}, { 25, 6}, { 27, 7}, { 14, 6}, \
+ { 29, 7}, { 15, 6}, { 31, 7}, { 29, 8}, \
+ { 15, 7}, { 32, 8}, { 17, 7}, { 35, 8}, \
+ { 19, 7}, { 39, 8}, { 21, 7}, { 43, 8}, \
+ { 25, 7}, { 51, 8}, { 29, 9}, { 15, 8}, \
+ { 35, 9}, { 19, 8}, { 43, 9}, { 23, 8}, \
+ { 51, 9}, { 27, 8}, { 55,10}, { 15, 9}, \
+ { 31, 8}, { 63, 9}, { 43,10}, { 23, 9}, \
+ { 55,11}, { 15,10}, { 31, 9}, { 71,10}, \
+ { 39, 9}, { 83,10}, { 47, 6}, { 767, 4}, \
+ { 3263, 5}, { 1727, 4}, { 3455, 5}, { 1791, 6}, \
+ { 927, 7}, { 479, 6}, { 959, 7}, { 511, 8}, \
+ { 271, 9}, { 147,10}, { 87,11}, { 47,10}, \
+ { 95,12}, { 31,11}, { 63,10}, { 135,11}, \
+ { 79,10}, { 167,11}, { 95,10}, { 191,11}, \
+ { 111,12}, { 63,11}, { 127,10}, { 255,11}, \
+ { 143,10}, { 287, 9}, { 575,10}, { 303,11}, \
+ { 159,12}, { 95,11}, { 191,10}, { 383, 9}, \
+ { 767,10}, { 399,11}, { 207,13}, { 63,12}, \
+ { 127,11}, { 255,10}, { 511,11}, { 271,10}, \
+ { 543,11}, { 287,10}, { 575,12}, { 159,11}, \
+ { 319,10}, { 639,11}, { 335,10}, { 671,11}, \
+ { 351,10}, { 703,12}, { 191,11}, { 383,10}, \
+ { 767,11}, { 415,10}, { 831,11}, { 447,13}, \
+ { 127,12}, { 255,11}, { 511,10}, { 1023,11}, \
+ { 543,12}, { 287,11}, { 575,10}, { 1151,11}, \
+ { 607,10}, { 1215,12}, { 319,11}, { 639,10}, \
+ { 1279,11}, { 671,12}, { 351,11}, { 703,13}, \
+ { 191,12}, { 383,11}, { 767,12}, { 415,11}, \
+ { 831,12}, { 447,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}, { 959,14}, { 255,13}, \
+ { 511,12}, { 1087,13}, { 575,12}, { 1215,13}, \
+ { 639,12}, { 1343,13}, { 703,12}, { 1407,14}, \
+ { 383,13}, { 767,12}, { 1599,13}, { 831,12}, \
+ { 1663,13}, { 895,12}, { 1791,13}, { 959,15}, \
+ { 255,14}, { 511,13}, { 1087,12}, { 2175,13}, \
+ { 1215,14}, { 639,13}, { 1471,14}, { 767,13}, \
+ { 1663,14}, { 895,13}, { 1855,15}, { 511,14}, \
+ { 1023,13}, { 2175,14}, { 1151,13}, { 2303,14}, \
+ { 1279,13}, { 2559,14}, { 1407,15}, { 767,14}, \
+ { 1535,13}, { 3071,14}, { 1791,16}, { 511,15}, \
+ { 1023,14}, { 2303,15}, { 1279,14}, { 2687,15}, \
+ { 1535,14}, { 3199,15}, { 1791,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 5248
+
+#define MULLO_BASECASE_THRESHOLD 0 /* always */
+#define MULLO_DC_THRESHOLD 35
+#define MULLO_MUL_N_THRESHOLD 15604
+
+#define DC_DIV_QR_THRESHOLD 56
+#define DC_DIVAPPR_Q_THRESHOLD 220
+#define DC_BDIV_QR_THRESHOLD 52
+#define DC_BDIV_Q_THRESHOLD 152
+
+#define INV_MULMOD_BNM1_THRESHOLD 54
+#define INV_NEWTON_THRESHOLD 226
+#define INV_APPR_THRESHOLD 214
+
+#define BINV_NEWTON_THRESHOLD 327
+#define REDC_1_TO_REDC_2_THRESHOLD 4
+#define REDC_2_TO_REDC_N_THRESHOLD 79
+
+#define MU_DIV_QR_THRESHOLD 1895
+#define MU_DIVAPPR_Q_THRESHOLD 1895
+#define MUPI_DIV_QR_THRESHOLD 106
+#define MU_BDIV_QR_THRESHOLD 1589
+#define MU_BDIV_Q_THRESHOLD 1718
+
+#define MATRIX22_STRASSEN_THRESHOLD 16
+#define HGCD_THRESHOLD 125
+#define HGCD_APPR_THRESHOLD 173
+#define HGCD_REDUCE_THRESHOLD 3524
+#define GCD_DC_THRESHOLD 555
+#define GCDEXT_DC_THRESHOLD 478
+#define JACOBI_BASE_METHOD 4
+
+#define GET_STR_DC_THRESHOLD 12
+#define GET_STR_PRECOMPUTE_THRESHOLD 28
+#define SET_STR_DC_THRESHOLD 248
+#define SET_STR_PRECOMPUTE_THRESHOLD 1648
+
+#define FAC_DSC_THRESHOLD 1075
+#define FAC_ODD_THRESHOLD 0 /* always */
+
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/invert_limb.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/invert_limb.asm
new file mode 100644
index 00000000000..cc79b89a2b3
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/invert_limb.asm
@@ -0,0 +1,115 @@
+dnl AMD64 mpn_invert_limb -- Invert a normalized limb.
+
+dnl Contributed to the GNU project by Torbjorn Granlund and Niels Möller.
+
+dnl Copyright 2004, 2007-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/limb (approx) div
+C AMD K8,K9 48 71
+C AMD K10 48 77
+C Intel P4 135 161
+C Intel core2 69 116
+C Intel corei 55 89
+C Intel atom 129 191
+C VIA nano 79 157
+
+C rax rcx rdx rdi rsi r8
+
+ABI_SUPPORT(DOS64)
+ABI_SUPPORT(STD64)
+
+PROTECT(`mpn_invert_limb_table')
+
+ASM_START()
+ TEXT
+ ALIGN(16)
+PROLOGUE(mpn_invert_limb) C Kn C2 Ci
+ FUNC_ENTRY(1)
+ mov %rdi, %rax C 0 0 0
+ shr $55, %rax C 1 1 1
+ifdef(`PIC',`
+ifdef(`DARWIN',`
+ mov mpn_invert_limb_table@GOTPCREL(%rip), %r8
+ add $-512, %r8
+',`
+ lea -512+mpn_invert_limb_table(%rip), %r8
+')',`
+ movabs $-512+mpn_invert_limb_table, %r8
+')
+ movzwl (%r8,%rax,2), R32(%rcx) C %rcx = v0
+
+ C v1 = (v0 << 11) - (v0*v0*d40 >> 40) - 1
+ mov %rdi, %rsi C 0 0 0
+ mov R32(%rcx), R32(%rax) C 4 5 5
+ imul R32(%rcx), R32(%rcx) C 4 5 5
+ shr $24, %rsi C 1 1 1
+ inc %rsi C %rsi = d40
+ imul %rsi, %rcx C 8 10 8
+ shr $40, %rcx C 12 15 11
+ sal $11, R32(%rax) C 5 6 6
+ dec R32(%rax)
+ sub R32(%rcx), R32(%rax) C %rax = v1
+
+ C v2 = (v1 << 13) + (v1 * (2^60 - v1*d40) >> 47)
+ mov $0x1000000000000000, %rcx
+ imul %rax, %rsi C 14 17 13
+ sub %rsi, %rcx
+ imul %rax, %rcx
+ sal $13, %rax
+ shr $47, %rcx
+ add %rax, %rcx C %rcx = v2
+
+ C v3 = (v2 << 31) + (v2 * (2^96 - v2 * d63 + ((v2 >> 1) & mask)) >> 65
+ mov %rdi, %rsi C 0 0 0
+ shr %rsi C d/2
+ sbb %rax, %rax C -d0 = -(d mod 2)
+ sub %rax, %rsi C d63 = ceil(d/2)
+ imul %rcx, %rsi C v2 * d63
+ and %rcx, %rax C v2 * d0
+ shr %rax C (v2>>1) * d0
+ sub %rsi, %rax C (v2>>1) * d0 - v2 * d63
+ mul %rcx
+ sal $31, %rcx
+ shr %rdx
+ add %rdx, %rcx C %rcx = v3
+
+ mov %rdi, %rax
+ mul %rcx
+ add %rdi, %rax
+ mov %rcx, %rax
+ adc %rdi, %rdx
+ sub %rdx, %rax
+
+ FUNC_EXIT()
+ ret
+EPILOGUE()
+ASM_END()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/invert_limb_table.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/invert_limb_table.asm
new file mode 100644
index 00000000000..739d59e46cd
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/invert_limb_table.asm
@@ -0,0 +1,50 @@
+dnl Table used for mpn_invert_limb
+
+dnl Contributed to the GNU project by Torbjorn Granlund and Niels Möller.
+
+dnl Copyright 2004, 2007-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')
+
+ABI_SUPPORT(DOS64)
+ABI_SUPPORT(STD64)
+
+PROTECT(`mpn_invert_limb_table')
+
+ASM_START()
+C Table entry X contains floor (0x7fd00 / (0x100 + X))
+
+ RODATA
+ ALIGN(2)
+ GLOBL mpn_invert_limb_table
+mpn_invert_limb_table:
+forloop(i,256,512-1,dnl
+` .value eval(0x7fd00/i)
+')dnl
+ASM_END()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/k10/gcd_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/k10/gcd_1.asm
new file mode 100644
index 00000000000..3d8e5c7ab12
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/k10/gcd_1.asm
@@ -0,0 +1,37 @@
+dnl AMD64 mpn_gcd_1.
+
+dnl Copyright 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')
+
+ABI_SUPPORT(DOS64)
+ABI_SUPPORT(STD64)
+
+MULFUNC_PROLOGUE(mpn_gcd_1)
+include_mpn(`x86_64/core2/gcd_1.asm')
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/k10/gmp-mparam.h b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/k10/gmp-mparam.h
new file mode 100644
index 00000000000..5881306a401
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/k10/gmp-mparam.h
@@ -0,0 +1,222 @@
+/* AMD K10 gmp-mparam.h -- Compiler/machine parameter header file.
+
+Copyright 1991, 1993, 1994, 2000-2012, 2014 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
+
+#if 0
+#undef mpn_sublsh_n
+#define mpn_sublsh_n(rp,up,vp,n,c) \
+ (((rp) == (up)) ? mpn_submul_1 (rp, vp, n, CNST_LIMB(1) << (c)) \
+ : MPN(mpn_sublsh_n)(rp,up,vp,n,c))
+#endif
+
+/* 3200 MHz K10 Thuban */
+/* FFT tuning limit = 100000000 */
+/* Generated by tuneup.c, 2014-03-12, gcc 4.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 2
+#define MOD_1_1_TO_MOD_1_2_THRESHOLD 17
+#define MOD_1_2_TO_MOD_1_4_THRESHOLD 28
+#define PREINV_MOD_1_TO_MOD_1_THRESHOLD 7
+#define USE_PREINV_DIVREM_1 1 /* native */
+#define DIV_QR_1_NORM_THRESHOLD 1
+#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 MUL_TOOM22_THRESHOLD 28
+#define MUL_TOOM33_THRESHOLD 81
+#define MUL_TOOM44_THRESHOLD 242
+#define MUL_TOOM6H_THRESHOLD 369
+#define MUL_TOOM8H_THRESHOLD 478
+
+#define MUL_TOOM32_TO_TOOM43_THRESHOLD 97
+#define MUL_TOOM32_TO_TOOM53_THRESHOLD 154
+#define MUL_TOOM42_TO_TOOM53_THRESHOLD 145
+#define MUL_TOOM42_TO_TOOM63_THRESHOLD 163
+#define MUL_TOOM43_TO_TOOM54_THRESHOLD 142
+
+#define SQR_BASECASE_THRESHOLD 0 /* always (native) */
+#define SQR_TOOM2_THRESHOLD 34
+#define SQR_TOOM3_THRESHOLD 114
+#define SQR_TOOM4_THRESHOLD 390
+#define SQR_TOOM6_THRESHOLD 446
+#define SQR_TOOM8_THRESHOLD 547
+
+#define MULMID_TOOM42_THRESHOLD 36
+
+#define MULMOD_BNM1_THRESHOLD 17
+#define SQRMOD_BNM1_THRESHOLD 17
+
+#define MUL_FFT_MODF_THRESHOLD 570 /* k = 5 */
+#define MUL_FFT_TABLE3 \
+ { { 570, 5}, { 25, 6}, { 13, 5}, { 27, 6}, \
+ { 29, 7}, { 15, 6}, { 31, 7}, { 29, 8}, \
+ { 15, 7}, { 32, 8}, { 17, 7}, { 35, 8}, \
+ { 19, 7}, { 39, 8}, { 21, 7}, { 43, 8}, \
+ { 23, 7}, { 47, 8}, { 25, 7}, { 51, 8}, \
+ { 29, 9}, { 15, 8}, { 35, 9}, { 19, 8}, \
+ { 43, 9}, { 23, 8}, { 51, 9}, { 27, 8}, \
+ { 55,10}, { 15, 9}, { 31, 8}, { 63, 9}, \
+ { 43,10}, { 23, 9}, { 55,10}, { 31, 9}, \
+ { 67,10}, { 39, 9}, { 83,10}, { 47, 9}, \
+ { 95,10}, { 55,11}, { 31,10}, { 87,11}, \
+ { 47,10}, { 111,12}, { 31,11}, { 63,10}, \
+ { 135,11}, { 79,10}, { 167, 8}, { 671,11}, \
+ { 111,12}, { 63,11}, { 159,12}, { 95,11}, \
+ { 207,10}, { 415,13}, { 63,12}, { 127,11}, \
+ { 255,10}, { 511,11}, { 271,12}, { 159,11}, \
+ { 319,10}, { 639,11}, { 335,10}, { 671,11}, \
+ { 367,12}, { 191,11}, { 415,12}, { 223,13}, \
+ { 127,12}, { 255,11}, { 543,12}, { 287,11}, \
+ { 575,10}, { 1151,11}, { 607,10}, { 1215,12}, \
+ { 319,11}, { 671,12}, { 351,11}, { 703,13}, \
+ { 191,12}, { 383,11}, { 767,12}, { 415,11}, \
+ { 831,12}, { 447,14}, { 127,13}, { 255,12}, \
+ { 543,11}, { 1087,12}, { 607,13}, { 319,12}, \
+ { 671,11}, { 1343,12}, { 735,13}, { 383,12}, \
+ { 799,11}, { 1599,12}, { 831,13}, { 447,12}, \
+ { 959,13}, { 511,12}, { 1087,13}, { 575,12}, \
+ { 1215,13}, { 639,12}, { 1343,13}, { 703,12}, \
+ { 1407,14}, { 383,13}, { 767,12}, { 1599,13}, \
+ { 831,12}, { 1663,13}, { 895,12}, { 1791,13}, \
+ { 959,15}, { 255,14}, { 511,13}, { 1087,12}, \
+ { 2175,13}, { 1215,14}, { 639,13}, { 1471,14}, \
+ { 767,13}, { 1727,14}, { 895,13}, { 1855,15}, \
+ { 511,14}, { 1023,13}, { 2175,14}, { 1151,13}, \
+ { 2431,14}, { 1279,13}, { 2559,14}, { 1407,15}, \
+ { 767,14}, { 1535,13}, { 3071,14}, { 1791,16}, \
+ { 511,15}, { 1023,14}, { 2431,15}, { 1279,14}, \
+ { 2815,15}, { 1535,14}, { 3199,15}, { 1791,14}, \
+ { 3583,16}, { 1023,15}, { 2047,14}, { 4223,15}, \
+ { 2303,14}, { 4863,15}, { 2559,14}, { 5247,15}, \
+ { 2815,16}, { 65536,17}, { 131072,18}, { 262144,19}, \
+ { 524288,20}, {1048576,21}, {2097152,22}, {4194304,23}, \
+ {8388608,24} }
+#define MUL_FFT_TABLE3_SIZE 169
+#define MUL_FFT_THRESHOLD 7808
+
+#define SQR_FFT_MODF_THRESHOLD 448 /* k = 5 */
+#define SQR_FFT_TABLE3 \
+ { { 448, 5}, { 21, 6}, { 11, 5}, { 23, 6}, \
+ { 12, 5}, { 25, 6}, { 29, 7}, { 15, 6}, \
+ { 31, 7}, { 29, 8}, { 15, 7}, { 32, 8}, \
+ { 17, 7}, { 35, 8}, { 19, 7}, { 39, 8}, \
+ { 21, 7}, { 43, 8}, { 25, 7}, { 51, 8}, \
+ { 29, 9}, { 15, 8}, { 35, 9}, { 19, 8}, \
+ { 43, 9}, { 23, 8}, { 51, 9}, { 27, 8}, \
+ { 55,10}, { 15, 9}, { 31, 8}, { 65, 9}, \
+ { 43,10}, { 23, 9}, { 55,11}, { 15,10}, \
+ { 31, 9}, { 67,10}, { 39, 9}, { 83,10}, \
+ { 47, 9}, { 95,10}, { 55,11}, { 31,10}, \
+ { 79,11}, { 47,10}, { 103,12}, { 31,11}, \
+ { 63,10}, { 135,11}, { 79,10}, { 159,11}, \
+ { 95,10}, { 191,11}, { 111,12}, { 63,11}, \
+ { 127,10}, { 255,11}, { 143, 9}, { 575,10}, \
+ { 303, 9}, { 607,12}, { 95,11}, { 191, 9}, \
+ { 767,10}, { 399,11}, { 207,13}, { 63,12}, \
+ { 127,11}, { 255,10}, { 543, 9}, { 1087,10}, \
+ { 575,12}, { 159,11}, { 319,10}, { 639,11}, \
+ { 335,10}, { 671,11}, { 351,10}, { 703, 9}, \
+ { 1407,12}, { 191,11}, { 415,10}, { 831,12}, \
+ { 223,11}, { 447,13}, { 127,12}, { 255,11}, \
+ { 543,10}, { 1087,12}, { 287,11}, { 607,12}, \
+ { 319,11}, { 671,12}, { 351,11}, { 703,13}, \
+ { 191,12}, { 383,11}, { 767,10}, { 1535,12}, \
+ { 415,11}, { 863,12}, { 447,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}, { 799,11}, { 1599,12}, { 863,13}, \
+ { 447,12}, { 927,14}, { 255,13}, { 511,12}, \
+ { 1087,13}, { 575,12}, { 1215,13}, { 639,12}, \
+ { 1343,13}, { 703,12}, { 1407,14}, { 383,13}, \
+ { 767,12}, { 1535,13}, { 831,12}, { 1727,13}, \
+ { 895,12}, { 1791,13}, { 959,15}, { 255,14}, \
+ { 511,13}, { 1087,12}, { 2175,13}, { 1215,14}, \
+ { 639,13}, { 1471,14}, { 767,13}, { 1663,14}, \
+ { 895,13}, { 1791,15}, { 511,14}, { 1023,13}, \
+ { 2175,14}, { 1151,13}, { 2303,14}, { 1407,15}, \
+ { 767,14}, { 1791,16}, { 511,15}, { 1023,14}, \
+ { 2303,15}, { 1279,14}, { 2687,15}, { 1535,14}, \
+ { 3199,15}, { 1791,16}, { 1023,15}, { 2047,14}, \
+ { 4223,15}, { 2303,14}, { 4863,15}, { 2559,14}, \
+ { 5247,16}, { 65536,17}, { 131072,18}, { 262144,19}, \
+ { 524288,20}, {1048576,21}, {2097152,22}, {4194304,23}, \
+ {8388608,24} }
+#define SQR_FFT_TABLE3_SIZE 185
+#define SQR_FFT_THRESHOLD 5568
+
+#define MULLO_BASECASE_THRESHOLD 0 /* always */
+#define MULLO_DC_THRESHOLD 61
+#define MULLO_MUL_N_THRESHOLD 15604
+
+#define DC_DIV_QR_THRESHOLD 56
+#define DC_DIVAPPR_Q_THRESHOLD 218
+#define DC_BDIV_QR_THRESHOLD 52
+#define DC_BDIV_Q_THRESHOLD 42
+
+#define INV_MULMOD_BNM1_THRESHOLD 62
+#define INV_NEWTON_THRESHOLD 226
+#define INV_APPR_THRESHOLD 220
+
+#define BINV_NEWTON_THRESHOLD 327
+#define REDC_1_TO_REDC_2_THRESHOLD 51
+#define REDC_2_TO_REDC_N_THRESHOLD 66
+
+#define MU_DIV_QR_THRESHOLD 1752
+#define MU_DIVAPPR_Q_THRESHOLD 1718
+#define MUPI_DIV_QR_THRESHOLD 102
+#define MU_BDIV_QR_THRESHOLD 1528
+#define MU_BDIV_Q_THRESHOLD 1718
+
+#define POWM_SEC_TABLE 1,22,110,624,1985
+
+#define MATRIX22_STRASSEN_THRESHOLD 17
+#define HGCD_THRESHOLD 147
+#define HGCD_APPR_THRESHOLD 181
+#define HGCD_REDUCE_THRESHOLD 3524
+#define GCD_DC_THRESHOLD 622
+#define GCDEXT_DC_THRESHOLD 487
+#define JACOBI_BASE_METHOD 4
+
+#define GET_STR_DC_THRESHOLD 14
+#define GET_STR_PRECOMPUTE_THRESHOLD 29
+#define SET_STR_DC_THRESHOLD 268
+#define SET_STR_PRECOMPUTE_THRESHOLD 1718
+
+#define FAC_DSC_THRESHOLD 1075
+#define FAC_ODD_THRESHOLD 23
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/k10/hamdist.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/k10/hamdist.asm
new file mode 100644
index 00000000000..44b67b5e4e6
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/k10/hamdist.asm
@@ -0,0 +1,103 @@
+dnl AMD64 mpn_hamdist -- hamming distance.
+
+dnl Copyright 2008, 2010-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/limb
+C AMD K8,K9 n/a
+C AMD K10 2
+C Intel P4 n/a
+C Intel core2 n/a
+C Intel corei 2.05
+C Intel atom n/a
+C VIA nano n/a
+
+C This is very straightforward 2-way unrolled code.
+
+C TODO
+C * Write something less basic. It should not be hard to reach 1.5 c/l with
+C 4-way unrolling.
+
+define(`ap', `%rdi')
+define(`bp', `%rsi')
+define(`n', `%rdx')
+
+ABI_SUPPORT(DOS64)
+ABI_SUPPORT(STD64)
+
+ASM_START()
+ TEXT
+ ALIGN(32)
+PROLOGUE(mpn_hamdist)
+ FUNC_ENTRY(3)
+ mov (ap), %r8
+ xor (bp), %r8
+
+ lea (ap,n,8), ap C point at A operand end
+ lea (bp,n,8), bp C point at B operand end
+ neg n
+
+ bt $0, R32(n)
+ jnc L(2)
+
+L(1): .byte 0xf3,0x49,0x0f,0xb8,0xc0 C popcnt %r8, %rax
+ xor R32(%r10), R32(%r10)
+ add $1, n
+ js L(top)
+ FUNC_EXIT()
+ ret
+
+ ALIGN(16)
+L(2): mov 8(ap,n,8), %r9
+ .byte 0xf3,0x49,0x0f,0xb8,0xc0 C popcnt %r8, %rax
+ xor 8(bp,n,8), %r9
+ .byte 0xf3,0x4d,0x0f,0xb8,0xd1 C popcnt %r9, %r10
+ add $2, n
+ js L(top)
+ lea (%r10, %rax), %rax
+ FUNC_EXIT()
+ ret
+
+ ALIGN(16)
+L(top): mov (ap,n,8), %r8
+ lea (%r10, %rax), %rax
+ mov 8(ap,n,8), %r9
+ xor (bp,n,8), %r8
+ xor 8(bp,n,8), %r9
+ .byte 0xf3,0x49,0x0f,0xb8,0xc8 C popcnt %r8, %rcx
+ lea (%rcx, %rax), %rax
+ .byte 0xf3,0x4d,0x0f,0xb8,0xd1 C popcnt %r9, %r10
+ add $2, n
+ js L(top)
+
+ lea (%r10, %rax), %rax
+ FUNC_EXIT()
+ ret
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/k10/lshift.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/k10/lshift.asm
new file mode 100644
index 00000000000..a1cbc31f61b
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/k10/lshift.asm
@@ -0,0 +1,37 @@
+dnl X86-64 mpn_lshift optimised for Intel Sandy Bridge.
+
+dnl Copyright 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')
+
+ABI_SUPPORT(DOS64)
+ABI_SUPPORT(STD64)
+
+MULFUNC_PROLOGUE(mpn_lshift)
+include_mpn(`x86_64/fastsse/lshift-movdqu2.asm')
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/k10/lshiftc.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/k10/lshiftc.asm
new file mode 100644
index 00000000000..ac90edb76b0
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/k10/lshiftc.asm
@@ -0,0 +1,37 @@
+dnl X86-64 mpn_lshiftc optimised for Intel Sandy Bridge.
+
+dnl Copyright 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')
+
+ABI_SUPPORT(DOS64)
+ABI_SUPPORT(STD64)
+
+MULFUNC_PROLOGUE(mpn_lshiftc)
+include_mpn(`x86_64/fastsse/lshiftc-movdqu2.asm')
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/k10/popcount.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/k10/popcount.asm
new file mode 100644
index 00000000000..3814aeabf49
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/k10/popcount.asm
@@ -0,0 +1,138 @@
+dnl AMD64 mpn_popcount -- population count.
+
+dnl Copyright 2008, 2010-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/limb
+C AMD K8,K9 n/a
+C AMD K10 1.125
+C Intel P4 n/a
+C Intel core2 n/a
+C Intel corei 1.25
+C Intel atom n/a
+C VIA nano n/a
+
+C * The zero-offset of popcount is misassembled to the offset-less form, which
+C is one byte shorter and therefore will mess up the switching code.
+C * The outdated gas used in FreeBSD and NetBSD cannot handle the POPCNT insn,
+C which is the main reason for our usage of '.byte'.
+
+C TODO
+C * Improve switching code, the current code sucks.
+
+define(`up', `%rdi')
+define(`n', `%rsi')
+
+ABI_SUPPORT(DOS64)
+ABI_SUPPORT(STD64)
+
+ASM_START()
+ TEXT
+ ALIGN(32)
+PROLOGUE(mpn_popcount)
+ FUNC_ENTRY(2)
+
+ifelse(1,1,`
+ lea (up,n,8), up
+
+C mov R32(n), R32(%rcx)
+C neg R32(%rcx)
+ imul $-1, R32(n), R32(%rcx)
+ and $8-1, R32(%rcx)
+
+ neg n
+
+ mov R32(%rcx), R32(%rax)
+ neg %rax
+ lea (up,%rax,8),up
+
+ xor R32(%rax), R32(%rax)
+
+ lea (%rcx,%rcx,4), %rcx
+
+ lea L(top)(%rip), %rdx
+ lea (%rdx,%rcx,2), %rdx
+ jmp *%rdx
+',`
+ lea (up,n,8), up
+
+ mov R32(n), R32(%rcx)
+ neg R32(%rcx)
+ and $8-1, R32(%rcx)
+
+ neg n
+
+ mov R32(%rcx), R32(%rax)
+ shl $3, R32(%rax)
+ sub %rax, up
+
+ xor R32(%rax), R32(%rax)
+
+C add R32(%rcx), R32(%rcx) C 2x
+C lea (%rcx,%rcx,4), %rcx C 10x
+ imul $10, R32(%rcx)
+
+ lea L(top)(%rip), %rdx
+ add %rcx, %rdx
+ jmp *%rdx
+')
+
+ ALIGN(32)
+L(top):
+C 0 = n mod 8
+ .byte 0xf3,0x4c,0x0f,0xb8,0x44,0xf7,0x00 C popcnt 0(up,n,8), %r8
+ add %r8, %rax
+C 7 = n mod 8
+ .byte 0xf3,0x4c,0x0f,0xb8,0x4c,0xf7,0x08 C popcnt 8(up,n,8), %r9
+ add %r9, %rax
+C 6 = n mod 8
+ .byte 0xf3,0x4c,0x0f,0xb8,0x44,0xf7,0x10 C popcnt 16(up,n,8), %r8
+ add %r8, %rax
+C 5 = n mod 8
+ .byte 0xf3,0x4c,0x0f,0xb8,0x4c,0xf7,0x18 C popcnt 24(up,n,8), %r9
+ add %r9, %rax
+C 4 = n mod 8
+ .byte 0xf3,0x4c,0x0f,0xb8,0x44,0xf7,0x20 C popcnt 32(up,n,8), %r8
+ add %r8, %rax
+C 3 = n mod 8
+ .byte 0xf3,0x4c,0x0f,0xb8,0x4c,0xf7,0x28 C popcnt 40(up,n,8), %r9
+ add %r9, %rax
+C 2 = n mod 8
+ .byte 0xf3,0x4c,0x0f,0xb8,0x44,0xf7,0x30 C popcnt 48(up,n,8), %r8
+ add %r8, %rax
+C 1 = n mod 8
+ .byte 0xf3,0x4c,0x0f,0xb8,0x4c,0xf7,0x38 C popcnt 56(up,n,8), %r9
+ add %r9, %rax
+
+ add $8, n
+ js L(top)
+ FUNC_EXIT()
+ ret
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/k10/rshift.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/k10/rshift.asm
new file mode 100644
index 00000000000..4c1c0d4cde0
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/k10/rshift.asm
@@ -0,0 +1,37 @@
+dnl X86-64 mpn_rshift optimised for Intel Sandy Bridge.
+
+dnl Copyright 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')
+
+ABI_SUPPORT(DOS64)
+ABI_SUPPORT(STD64)
+
+MULFUNC_PROLOGUE(mpn_rshift)
+include_mpn(`x86_64/fastsse/rshift-movdqu2.asm')
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/k10/sec_tabselect.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/k10/sec_tabselect.asm
new file mode 100644
index 00000000000..e4360341d93
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/k10/sec_tabselect.asm
@@ -0,0 +1,37 @@
+dnl X86-64 mpn_sec_tabselect.
+
+dnl Copyright 2012, 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')
+
+ABI_SUPPORT(DOS64)
+ABI_SUPPORT(STD64)
+
+MULFUNC_PROLOGUE(mpn_sec_tabselect)
+include_mpn(`x86_64/fastsse/sec_tabselect.asm')
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/k8/aorrlsh_n.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/k8/aorrlsh_n.asm
new file mode 100644
index 00000000000..ff3a1842fd0
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/k8/aorrlsh_n.asm
@@ -0,0 +1,217 @@
+dnl AMD64 mpn_addlsh_n and mpn_rsblsh_n. R = V2^k +- U.
+
+dnl Copyright 2006, 2010-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/limb
+C AMD K8,K9 2.87 < 3.85 for lshift + add_n
+C AMD K10 2.75 < 3.85 for lshift + add_n
+C Intel P4 22 > 7.33 for lshift + add_n
+C Intel core2 4.1 > 3.27 for lshift + add_n
+C Intel NHM 4.4 > 3.75 for lshift + add_n
+C Intel SBR 3.17 < 3.46 for lshift + add_n
+C Intel atom ? ? 8.75 for lshift + add_n
+C VIA nano 4.7 < 6.25 for lshift + add_n
+
+C TODO
+C * Can we propagate carry into rdx instead of using a special carry register?
+C That could save enough insns to get to 10 cycles/iteration.
+
+define(`rp', `%rdi')
+define(`up', `%rsi')
+define(`vp_param', `%rdx')
+define(`n_param', `%rcx')
+define(`cnt', `%r8')
+
+define(`vp', `%r12')
+define(`n', `%rbp')
+
+ifdef(`OPERATION_addlsh_n',`
+ define(ADDSUB, `add')
+ define(ADCSBB, `adc')
+ define(func, mpn_addlsh_n)
+')
+ifdef(`OPERATION_rsblsh_n',`
+ define(ADDSUB, `sub')
+ define(ADCSBB, `sbb')
+ define(func, mpn_rsblsh_n)
+')
+
+MULFUNC_PROLOGUE(mpn_addlsh_n mpn_rsblsh_n)
+
+ABI_SUPPORT(DOS64)
+ABI_SUPPORT(STD64)
+
+ASM_START()
+ TEXT
+ ALIGN(16)
+PROLOGUE(func)
+ FUNC_ENTRY(4)
+IFDOS(` mov 56(%rsp), %r8d ')
+ push %r12
+ push %rbp
+ push %rbx
+
+ mov (vp_param), %rax C load first V limb early
+
+ mov $0, R32(n)
+ sub n_param, n
+
+ lea -16(up,n_param,8), up
+ lea -16(rp,n_param,8), rp
+ lea 16(vp_param,n_param,8), vp
+
+ mov n_param, %r9
+
+ mov %r8, %rcx
+ mov $1, R32(%r8)
+ shl R8(%rcx), %r8
+
+ mul %r8 C initial multiply
+
+ and $3, R32(%r9)
+ jz L(b0)
+ cmp $2, R32(%r9)
+ jc L(b1)
+ jz L(b2)
+
+L(b3): mov %rax, %r11
+ ADDSUB 16(up,n,8), %r11
+ mov -8(vp,n,8), %rax
+ sbb R32(%rcx), R32(%rcx)
+ mov %rdx, %rbx
+ mul %r8
+ or %rax, %rbx
+ mov (vp,n,8), %rax
+ mov %rdx, %r9
+ mul %r8
+ or %rax, %r9
+ add $3, n
+ jnz L(lo3)
+ jmp L(cj3)
+
+L(b2): mov %rax, %rbx
+ mov -8(vp,n,8), %rax
+ mov %rdx, %r9
+ mul %r8
+ or %rax, %r9
+ add $2, n
+ jz L(cj2)
+ mov %rdx, %r10
+ mov -16(vp,n,8), %rax
+ mul %r8
+ or %rax, %r10
+ xor R32(%rcx), R32(%rcx) C clear carry register
+ jmp L(lo2)
+
+L(b1): mov %rax, %r9
+ mov %rdx, %r10
+ add $1, n
+ jnz L(gt1)
+ ADDSUB 8(up,n,8), %r9
+ jmp L(cj1)
+L(gt1): mov -16(vp,n,8), %rax
+ mul %r8
+ or %rax, %r10
+ mov %rdx, %r11
+ mov -8(vp,n,8), %rax
+ mul %r8
+ or %rax, %r11
+ ADDSUB 8(up,n,8), %r9
+ ADCSBB 16(up,n,8), %r10
+ ADCSBB 24(up,n,8), %r11
+ mov (vp,n,8), %rax
+ sbb R32(%rcx), R32(%rcx)
+ jmp L(lo1)
+
+L(b0): mov %rax, %r10
+ mov %rdx, %r11
+ mov -8(vp,n,8), %rax
+ mul %r8
+ or %rax, %r11
+ ADDSUB 16(up,n,8), %r10
+ ADCSBB 24(up,n,8), %r11
+ mov (vp,n,8), %rax
+ sbb R32(%rcx), R32(%rcx)
+ mov %rdx, %rbx
+ mul %r8
+ or %rax, %rbx
+ mov 8(vp,n,8), %rax
+ add $4, n
+ jz L(end)
+
+ ALIGN(8)
+L(top): mov %rdx, %r9
+ mul %r8
+ or %rax, %r9
+ mov %r10, -16(rp,n,8)
+L(lo3): mov %rdx, %r10
+ mov -16(vp,n,8), %rax
+ mul %r8
+ or %rax, %r10
+ mov %r11, -8(rp,n,8)
+L(lo2): mov %rdx, %r11
+ mov -8(vp,n,8), %rax
+ mul %r8
+ or %rax, %r11
+ add R32(%rcx), R32(%rcx)
+ ADCSBB (up,n,8), %rbx
+ ADCSBB 8(up,n,8), %r9
+ ADCSBB 16(up,n,8), %r10
+ ADCSBB 24(up,n,8), %r11
+ mov (vp,n,8), %rax
+ sbb R32(%rcx), R32(%rcx)
+ mov %rbx, (rp,n,8)
+L(lo1): mov %rdx, %rbx
+ mul %r8
+ or %rax, %rbx
+ mov %r9, 8(rp,n,8)
+L(lo0): mov 8(vp,n,8), %rax
+ add $4, n
+ jnz L(top)
+
+L(end): mov %rdx, %r9
+ mul %r8
+ or %rax, %r9
+ mov %r10, -16(rp,n,8)
+L(cj3): mov %r11, -8(rp,n,8)
+L(cj2): add R32(%rcx), R32(%rcx)
+ ADCSBB (up,n,8), %rbx
+ ADCSBB 8(up,n,8), %r9
+ mov %rbx, (rp,n,8)
+L(cj1): mov %r9, 8(rp,n,8)
+ mov %rdx, %rax
+ ADCSBB $0, %rax
+ pop %rbx
+ pop %rbp
+ pop %r12
+ FUNC_EXIT()
+ ret
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/k8/div_qr_1n_pi1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/k8/div_qr_1n_pi1.asm
new file mode 100644
index 00000000000..861402b2229
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/k8/div_qr_1n_pi1.asm
@@ -0,0 +1,249 @@
+dnl x86-64 mpn_div_qr_1n_pi1
+dnl -- Divide an mpn number by a normalized single-limb number,
+dnl using a single-limb inverse.
+
+dnl Contributed to the GNU project by Niels Möller
+
+dnl Copyright 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 c/l
+C AMD K8,K9 11
+C AMD K10 11
+C AMD bull 16
+C AMD pile 14.25
+C AMD steam ?
+C AMD bobcat 16
+C AMD jaguar ?
+C Intel P4 47.5 poor
+C Intel core 28.5 very poor
+C Intel NHM 29 very poor
+C Intel SBR 16 poor
+C Intel IBR 13.5
+C Intel HWL 12
+C Intel BWL ?
+C Intel atom 53 very poor
+C VIA nano 19
+
+
+C INPUT Parameters
+define(`QP', `%rdi')
+define(`UP', `%rsi')
+define(`UN_INPUT', `%rdx')
+define(`U1', `%rcx') C Also in %rax
+define(`D', `%r8')
+define(`DINV', `%r9')
+
+C Invariants
+define(`B2', `%rbp')
+define(`B2md', `%rbx')
+
+C Variables
+define(`UN', `%r8') C Overlaps D input
+define(`T', `%r10')
+define(`U0', `%r11')
+define(`U2', `%r12')
+define(`Q0', `%r13')
+define(`Q1', `%r14')
+define(`Q2', `%r15')
+
+ABI_SUPPORT(STD64)
+
+ ASM_START()
+ TEXT
+ ALIGN(16)
+PROLOGUE(mpn_div_qr_1n_pi1)
+ FUNC_ENTRY(6)
+IFDOS(` mov 56(%rsp), %r8 ')
+IFDOS(` mov 64(%rsp), %r9 ')
+ dec UN_INPUT
+ jnz L(first)
+
+ C Just a single 2/1 division.
+ C T, U0 are allocated in scratch registers
+ lea 1(U1), T
+ mov U1, %rax
+ mul DINV
+ mov (UP), U0
+ add U0, %rax
+ adc T, %rdx
+ mov %rdx, T
+ imul D, %rdx
+ sub %rdx, U0
+ cmp U0, %rax
+ lea (U0, D), %rax
+ cmovnc U0, %rax
+ sbb $0, T
+ cmp D, %rax
+ jc L(single_div_done)
+ sub D, %rax
+ add $1, T
+L(single_div_done):
+ mov T, (QP)
+ FUNC_EXIT
+ ret
+L(first):
+ C FIXME: Could delay some of these until we enter the loop.
+ push %r15
+ push %r14
+ push %r13
+ push %r12
+ push %rbx
+ push %rbp
+
+ mov D, B2
+ imul DINV, B2
+ neg B2
+ mov B2, B2md
+ sub D, B2md
+
+ C D not needed until final reduction
+ push D
+ mov UN_INPUT, UN C Clobbers D
+
+ mov DINV, %rax
+ mul U1
+ mov %rax, Q0
+ add U1, %rdx
+ mov %rdx, T
+
+ mov B2, %rax
+ mul U1
+ mov -8(UP, UN, 8), U0
+ mov (UP, UN, 8), U1
+ mov T, (QP, UN, 8)
+ add %rax, U0
+ adc %rdx, U1
+ sbb U2, U2
+ dec UN
+ mov U1, %rax
+ jz L(final)
+ mov $0, R32(Q1)
+
+ ALIGN(16)
+
+ C Loop is 28 instructions, 30 K8/K10 decoder slots, should run
+ C in 10 cycles. At entry, %rax holds an extra copy of U1, Q1
+ C is zero, and carry holds an extra copy of U2.
+L(loop):
+ C {Q2, Q1, Q0} <-- DINV * U1 + B (Q0 + U2 DINV) + B^2 U2
+ C Remains to add in B (U1 + c)
+ cmovc DINV, Q1
+ mov U2, Q2
+ neg Q2
+ mul DINV
+ add %rdx, Q1
+ adc $0, Q2
+ add Q0, Q1
+ mov %rax, Q0
+ mov B2, %rax
+ lea (B2md, U0), T
+ adc $0, Q2
+
+ C {U2, U1, U0} <-- (U0 + U2 B2 -c U) B + U1 B2 + u
+ mul U1
+ and B2, U2
+ add U2, U0
+ cmovnc U0, T
+
+ C {QP+UN, ...} <-- {QP+UN, ...} + {Q2, Q1} + U1 + c
+ adc U1, Q1
+ mov -8(UP, UN, 8), U0
+ adc Q2, 8(QP, UN, 8)
+ jc L(q_incr)
+L(q_incr_done):
+ add %rax, U0
+ mov T, %rax
+ adc %rdx, %rax
+ mov Q1, (QP, UN, 8)
+ mov $0, R32(Q1)
+ sbb U2, U2
+ dec UN
+ mov %rax, U1
+ jnz L(loop)
+
+L(final):
+ pop D
+
+ mov U2, Q1
+ and D, U2
+ sub U2, %rax
+ neg Q1
+
+ mov %rax, U1
+ sub D, %rax
+ cmovc U1, %rax
+ sbb $-1, Q1
+
+ lea 1(%rax), T
+ mul DINV
+ add U0, %rax
+ adc T, %rdx
+ mov %rdx, T
+ imul D, %rdx
+ sub %rdx, U0
+ cmp U0, %rax
+ lea (U0, D), %rax
+ cmovnc U0, %rax
+ sbb $0, T
+ cmp D, %rax
+ jc L(div_done)
+ sub D, %rax
+ add $1, T
+L(div_done):
+ add T, Q0
+ mov Q0, (QP)
+ adc Q1, 8(QP)
+ jnc L(done)
+L(final_q_incr):
+ addq $1, 16(QP)
+ lea 8(QP), QP
+ jc L(final_q_incr)
+
+L(done):
+ pop %rbp
+ pop %rbx
+ pop %r12
+ pop %r13
+ pop %r14
+ pop %r15
+ FUNC_EXIT
+ ret
+
+L(q_incr):
+ C U1 is not live, so use it for indexing
+ lea 16(QP, UN, 8), U1
+L(q_incr_loop):
+ addq $1, (U1)
+ jnc L(q_incr_done)
+ lea 8(U1), U1
+ jmp L(q_incr_loop)
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/k8/gmp-mparam.h b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/k8/gmp-mparam.h
new file mode 100644
index 00000000000..df78c389234
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/k8/gmp-mparam.h
@@ -0,0 +1,236 @@
+/* AMD K8 gmp-mparam.h -- Compiler/machine parameter header file.
+
+Copyright 1991, 1993, 1994, 2000-2012, 2014 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
+
+// #undef mpn_sublsh_n
+// #define mpn_sublsh_n(rp,up,vp,n,c) \
+// (((rp) == (up)) ? mpn_submul_1 (rp, vp, n, CNST_LIMB(1) << (c)) \
+// : MPN(mpn_sublsh_n)(rp,up,vp,n,c))
+
+/* 2500 MHz K8 Brisbane */
+/* FFT tuning limit = 25000000 */
+/* Generated by tuneup.c, 2014-03-12, gcc 4.5 */
+
+#define MOD_1_NORM_THRESHOLD 0 /* always */
+#define MOD_1_UNNORM_THRESHOLD 0 /* always */
+#define MOD_1N_TO_MOD_1_1_THRESHOLD 4
+#define MOD_1U_TO_MOD_1_1_THRESHOLD 3
+#define MOD_1_1_TO_MOD_1_2_THRESHOLD 13
+#define MOD_1_2_TO_MOD_1_4_THRESHOLD 35
+#define PREINV_MOD_1_TO_MOD_1_THRESHOLD 9
+#define USE_PREINV_DIVREM_1 1 /* native */
+#define DIV_QR_1_NORM_THRESHOLD 1
+#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 16
+
+#define MUL_TOOM22_THRESHOLD 28
+#define MUL_TOOM33_THRESHOLD 81
+#define MUL_TOOM44_THRESHOLD 242
+#define MUL_TOOM6H_THRESHOLD 345
+#define MUL_TOOM8H_THRESHOLD 482
+
+#define MUL_TOOM32_TO_TOOM43_THRESHOLD 97
+#define MUL_TOOM32_TO_TOOM53_THRESHOLD 153
+#define MUL_TOOM42_TO_TOOM53_THRESHOLD 161
+#define MUL_TOOM42_TO_TOOM63_THRESHOLD 175
+#define MUL_TOOM43_TO_TOOM54_THRESHOLD 166
+
+#define SQR_BASECASE_THRESHOLD 0 /* always (native) */
+#define SQR_TOOM2_THRESHOLD 34
+#define SQR_TOOM3_THRESHOLD 129
+#define SQR_TOOM4_THRESHOLD 527
+#define SQR_TOOM6_THRESHOLD 562
+#define SQR_TOOM8_THRESHOLD 0 /* always */
+
+#define MULMID_TOOM42_THRESHOLD 36
+
+#define MULMOD_BNM1_THRESHOLD 18
+#define SQRMOD_BNM1_THRESHOLD 22
+
+#define MUL_FFT_MODF_THRESHOLD 654 /* k = 5 */
+#define MUL_FFT_TABLE3 \
+ { { 654, 5}, { 21, 6}, { 11, 5}, { 23, 6}, \
+ { 12, 5}, { 25, 6}, { 13, 5}, { 27, 6}, \
+ { 15, 5}, { 31, 6}, { 27, 7}, { 15, 6}, \
+ { 31, 7}, { 19, 6}, { 39, 7}, { 29, 8}, \
+ { 15, 7}, { 33, 8}, { 17, 7}, { 37, 8}, \
+ { 19, 7}, { 39, 8}, { 23, 7}, { 47, 8}, \
+ { 25, 7}, { 51, 8}, { 43, 9}, { 23, 8}, \
+ { 51, 9}, { 27, 8}, { 57, 9}, { 31, 8}, \
+ { 65, 9}, { 35, 8}, { 71, 9}, { 39, 8}, \
+ { 79, 9}, { 43,10}, { 23, 9}, { 59, 8}, \
+ { 119,10}, { 31, 8}, { 125, 9}, { 71,10}, \
+ { 39, 9}, { 87,10}, { 47, 9}, { 99,10}, \
+ { 55, 9}, { 123,11}, { 31,10}, { 63, 9}, \
+ { 131,10}, { 71, 9}, { 143,10}, { 79, 9}, \
+ { 159,10}, { 87,11}, { 47,10}, { 119,11}, \
+ { 63,10}, { 143,11}, { 79,10}, { 175,11}, \
+ { 95,10}, { 199,11}, { 111,10}, { 223,12}, \
+ { 63,11}, { 143,10}, { 287, 9}, { 575,10}, \
+ { 295,11}, { 159,10}, { 319,11}, { 175,12}, \
+ { 95,11}, { 191,10}, { 383,11}, { 207,10}, \
+ { 415, 9}, { 831,11}, { 223,10}, { 447,13}, \
+ { 63,12}, { 127,11}, { 255,10}, { 511,11}, \
+ { 271,10}, { 543, 9}, { 1087,11}, { 287,10}, \
+ { 575, 9}, { 1151,12}, { 159,11}, { 319,10}, \
+ { 639,11}, { 335,10}, { 671,11}, { 351,10}, \
+ { 703,11}, { 367,12}, { 191,11}, { 383,10}, \
+ { 767,11}, { 399,10}, { 799,11}, { 415,10}, \
+ { 831,12}, { 223,11}, { 447,10}, { 895,11}, \
+ { 479,13}, { 127,12}, { 255,11}, { 511,10}, \
+ { 1023,11}, { 543,10}, { 1087,12}, { 287,11}, \
+ { 575,10}, { 1151,11}, { 607,12}, { 319,11}, \
+ { 639,10}, { 1279,11}, { 671,12}, { 351,11}, \
+ { 703,10}, { 1407,13}, { 191,12}, { 383,11}, \
+ { 767,12}, { 415,11}, { 831,12}, { 447,11}, \
+ { 895,12}, { 479,11}, { 959,14}, { 127,13}, \
+ { 255,12}, { 511,11}, { 1023,12}, { 543,11}, \
+ { 1087,12}, { 575,11}, { 1151,12}, { 607,11}, \
+ { 1215,13}, { 319,12}, { 671,11}, { 1343,12}, \
+ { 735,13}, { 383,12}, { 799,11}, { 1599,12}, \
+ { 863,13}, { 447,12}, { 895,11}, { 1791,12}, \
+ { 991,13}, { 511,12}, { 1087,13}, { 575,12}, \
+ { 1215,13}, { 639,12}, { 1343,13}, { 703,12}, \
+ { 1471,14}, { 383,13}, { 767,12}, { 1599,13}, \
+ { 831,12}, { 1663,13}, { 895,12}, { 1791,13}, \
+ { 959,12}, { 1919,14}, { 511,13}, { 1087,12}, \
+ { 2175,13}, { 1215,14}, { 639,13}, { 1471,14}, \
+ { 767,13}, { 1663,14}, { 895,13}, { 1919,15}, \
+ { 511,14}, { 1023,13}, { 2175,14}, { 1151,13}, \
+ { 2367,14}, { 1279,13}, { 2559,14}, { 1407,15}, \
+ { 32768,16}, { 65536,17}, { 131072,18}, { 262144,19}, \
+ { 524288,20}, {1048576,21}, {2097152,22}, {4194304,23}, \
+ {8388608,24} }
+#define MUL_FFT_TABLE3_SIZE 205
+#define MUL_FFT_THRESHOLD 11520
+
+#define SQR_FFT_MODF_THRESHOLD 570 /* k = 5 */
+#define SQR_FFT_TABLE3 \
+ { { 570, 5}, { 21, 6}, { 11, 5}, { 23, 6}, \
+ { 12, 5}, { 25, 6}, { 13, 5}, { 27, 6}, \
+ { 14, 5}, { 29, 6}, { 16, 5}, { 33, 6}, \
+ { 29, 7}, { 15, 6}, { 31, 7}, { 16, 6}, \
+ { 33, 7}, { 17, 6}, { 35, 7}, { 33, 8}, \
+ { 17, 7}, { 37, 8}, { 19, 7}, { 40, 8}, \
+ { 21, 7}, { 43, 8}, { 23, 7}, { 47, 8}, \
+ { 25, 7}, { 51, 8}, { 29, 9}, { 15, 8}, \
+ { 37, 9}, { 19, 8}, { 43, 9}, { 23, 8}, \
+ { 51, 9}, { 27, 8}, { 55, 9}, { 31, 8}, \
+ { 63, 9}, { 35, 8}, { 71, 9}, { 39, 8}, \
+ { 79, 9}, { 43,10}, { 23, 9}, { 55,10}, \
+ { 31, 9}, { 71,10}, { 39, 9}, { 83,10}, \
+ { 47, 9}, { 99,10}, { 55, 9}, { 123,11}, \
+ { 31,10}, { 63, 9}, { 127,10}, { 71, 9}, \
+ { 143,10}, { 87,11}, { 47,10}, { 111,12}, \
+ { 31,11}, { 63,10}, { 143,11}, { 79,10}, \
+ { 167,11}, { 95,10}, { 199,11}, { 111,12}, \
+ { 63,11}, { 127, 9}, { 511,11}, { 143,10}, \
+ { 287, 9}, { 575, 8}, { 1151,11}, { 159,10}, \
+ { 319, 9}, { 639,11}, { 175,12}, { 95,11}, \
+ { 191,10}, { 383, 9}, { 767,11}, { 207,10}, \
+ { 415, 9}, { 831,10}, { 431,11}, { 223,10}, \
+ { 447,13}, { 63,12}, { 127,10}, { 511, 9}, \
+ { 1023,10}, { 543, 9}, { 1087,11}, { 287,10}, \
+ { 575, 9}, { 1151,12}, { 159,11}, { 319,10}, \
+ { 639, 9}, { 1279,11}, { 335,10}, { 671,11}, \
+ { 351,10}, { 703,11}, { 367,12}, { 191,11}, \
+ { 383,10}, { 767,11}, { 399,10}, { 799,11}, \
+ { 415,10}, { 831,11}, { 431,12}, { 223,11}, \
+ { 447,10}, { 895,11}, { 463,13}, { 127,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,10}, { 1535,11}, \
+ { 799,12}, { 415,11}, { 831,12}, { 447,11}, \
+ { 895,12}, { 479,14}, { 127,12}, { 511,11}, \
+ { 1023,12}, { 543,11}, { 1087,12}, { 575,11}, \
+ { 1151,12}, { 607,11}, { 1215,13}, { 319,12}, \
+ { 639,11}, { 1279,12}, { 671,11}, { 1343,12}, \
+ { 703,11}, { 1407,12}, { 735,13}, { 383,12}, \
+ { 799,11}, { 1599,12}, { 863,13}, { 447,12}, \
+ { 959,13}, { 511,12}, { 1087,13}, { 575,12}, \
+ { 1215,13}, { 639,12}, { 1343,13}, { 703,12}, \
+ { 1471,14}, { 383,13}, { 767,12}, { 1599,13}, \
+ { 831,12}, { 1663,13}, { 895,12}, { 1791,13}, \
+ { 959,14}, { 511,13}, { 1023,12}, { 2047,13}, \
+ { 1215,14}, { 639,13}, { 1471,14}, { 767,13}, \
+ { 1663,14}, { 895,13}, { 1855,15}, { 511,14}, \
+ { 1023,13}, { 2111,14}, { 1151,13}, { 2303,14}, \
+ { 1407,15}, { 32768,16}, { 65536,17}, { 131072,18}, \
+ { 262144,19}, { 524288,20}, {1048576,21}, {2097152,22}, \
+ {4194304,23}, {8388608,24} }
+#define SQR_FFT_TABLE3_SIZE 214
+#define SQR_FFT_THRESHOLD 5760
+
+#define MULLO_BASECASE_THRESHOLD 0 /* always */
+#define MULLO_DC_THRESHOLD 61
+#define MULLO_MUL_N_THRESHOLD 22906
+
+#define DC_DIV_QR_THRESHOLD 51
+#define DC_DIVAPPR_Q_THRESHOLD 264
+#define DC_BDIV_QR_THRESHOLD 38
+#define DC_BDIV_Q_THRESHOLD 170
+
+#define INV_MULMOD_BNM1_THRESHOLD 67
+#define INV_NEWTON_THRESHOLD 246
+#define INV_APPR_THRESHOLD 244
+
+#define BINV_NEWTON_THRESHOLD 252
+#define REDC_1_TO_REDC_2_THRESHOLD 35
+#define REDC_2_TO_REDC_N_THRESHOLD 84
+
+#define MU_DIV_QR_THRESHOLD 2089
+#define MU_DIVAPPR_Q_THRESHOLD 1752
+#define MUPI_DIV_QR_THRESHOLD 93
+#define MU_BDIV_QR_THRESHOLD 1718
+#define MU_BDIV_Q_THRESHOLD 1895
+
+#define POWM_SEC_TABLE 2,16,194,904,2177
+
+#define MATRIX22_STRASSEN_THRESHOLD 21
+#define HGCD_THRESHOLD 148
+#define HGCD_APPR_THRESHOLD 185
+#define HGCD_REDUCE_THRESHOLD 4120
+#define GCD_DC_THRESHOLD 562
+#define GCDEXT_DC_THRESHOLD 501
+#define JACOBI_BASE_METHOD 4
+
+#define GET_STR_DC_THRESHOLD 17
+#define GET_STR_PRECOMPUTE_THRESHOLD 29
+#define SET_STR_DC_THRESHOLD 268
+#define SET_STR_PRECOMPUTE_THRESHOLD 1787
+
+#define FAC_DSC_THRESHOLD 1240
+#define FAC_ODD_THRESHOLD 0 /* always */
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/k8/mul_basecase.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/k8/mul_basecase.asm
new file mode 100644
index 00000000000..ca2efb9b2f0
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/k8/mul_basecase.asm
@@ -0,0 +1,469 @@
+dnl AMD64 mpn_mul_basecase.
+
+dnl Contributed to the GNU project by Torbjorn Granlund and David Harvey.
+
+dnl Copyright 2008, 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/limb
+C AMD K8,K9 2.375
+C AMD K10 2.375
+C Intel P4 15-16
+C Intel core2 4.45
+C Intel corei 4.35
+C Intel atom ?
+C VIA nano 4.5
+
+C The inner loops of this code are the result of running a code generation and
+C optimization tool suite written by David Harvey and Torbjorn Granlund.
+
+C TODO
+C * Use fewer registers. (how??? I can't see it -- david)
+C * Avoid some "mov $0,r" and instead use "xor r,r".
+C * Can the top of each L(addmul_outer_n) prologue be folded into the
+C mul_1/mul_2 prologues, saving a LEA (%rip)? It would slow down the
+C case where vn = 1 or 2; is it worth it?
+
+C INPUT PARAMETERS
+define(`rp', `%rdi')
+define(`up', `%rsi')
+define(`un_param',`%rdx')
+define(`vp', `%rcx')
+define(`vn', `%r8')
+
+define(`v0', `%r12')
+define(`v1', `%r9')
+
+define(`w0', `%rbx')
+define(`w1', `%r15')
+define(`w2', `%rbp')
+define(`w3', `%r10')
+
+define(`n', `%r11')
+define(`outer_addr', `%r14')
+define(`un', `%r13')
+
+ABI_SUPPORT(DOS64)
+ABI_SUPPORT(STD64)
+
+ASM_START()
+ TEXT
+ ALIGN(16)
+PROLOGUE(mpn_mul_basecase)
+ FUNC_ENTRY(4)
+IFDOS(` mov 56(%rsp), %r8d ')
+ push %rbx
+ push %rbp
+ push %r12
+ push %r13
+ push %r14
+ push %r15
+
+ xor R32(un), R32(un)
+ mov (up), %rax
+ mov (vp), v0
+
+ sub un_param, un C rdx used by mul
+ mov un, n
+ mov R32(un_param), R32(w0)
+
+ lea (rp,un_param,8), rp
+ lea (up,un_param,8), up
+
+ mul v0
+
+ test $1, R8(vn)
+ jz L(mul_2)
+
+C ===========================================================
+C mul_1 for vp[0] if vn is odd
+
+L(mul_1):
+ and $3, R32(w0)
+ jz L(mul_1_prologue_0)
+ cmp $2, R32(w0)
+ jc L(mul_1_prologue_1)
+ jz L(mul_1_prologue_2)
+
+L(mul_1_prologue_3):
+ add $-1, n
+ lea L(addmul_outer_3)(%rip), outer_addr
+ mov %rax, w3
+ mov %rdx, w0
+ jmp L(mul_1_entry_3)
+
+L(mul_1_prologue_0):
+ mov %rax, w2
+ mov %rdx, w3 C note: already w0 == 0
+ lea L(addmul_outer_0)(%rip), outer_addr
+ jmp L(mul_1_entry_0)
+
+L(mul_1_prologue_1):
+ cmp $-1, un
+ jne 2f
+ mov %rax, -8(rp)
+ mov %rdx, (rp)
+ jmp L(ret)
+2: add $1, n
+ lea L(addmul_outer_1)(%rip), outer_addr
+ mov %rax, w1
+ mov %rdx, w2
+ xor R32(w3), R32(w3)
+ mov (up,n,8), %rax
+ jmp L(mul_1_entry_1)
+
+L(mul_1_prologue_2):
+ add $-2, n
+ lea L(addmul_outer_2)(%rip), outer_addr
+ mov %rax, w0
+ mov %rdx, w1
+ mov 24(up,n,8), %rax
+ xor R32(w2), R32(w2)
+ xor R32(w3), R32(w3)
+ jmp L(mul_1_entry_2)
+
+
+ C this loop is 10 c/loop = 2.5 c/l on K8, for all up/rp alignments
+
+ ALIGN(16)
+L(mul_1_top):
+ mov w0, -16(rp,n,8)
+ add %rax, w1
+ mov (up,n,8), %rax
+ adc %rdx, w2
+L(mul_1_entry_1):
+ xor R32(w0), R32(w0)
+ mul v0
+ mov w1, -8(rp,n,8)
+ add %rax, w2
+ adc %rdx, w3
+L(mul_1_entry_0):
+ mov 8(up,n,8), %rax
+ mul v0
+ mov w2, (rp,n,8)
+ add %rax, w3
+ adc %rdx, w0
+L(mul_1_entry_3):
+ mov 16(up,n,8), %rax
+ mul v0
+ mov w3, 8(rp,n,8)
+ xor R32(w2), R32(w2) C zero
+ mov w2, w3 C zero
+ add %rax, w0
+ mov 24(up,n,8), %rax
+ mov w2, w1 C zero
+ adc %rdx, w1
+L(mul_1_entry_2):
+ mul v0
+ add $4, n
+ js L(mul_1_top)
+
+ mov w0, -16(rp)
+ add %rax, w1
+ mov w1, -8(rp)
+ adc %rdx, w2
+ mov w2, (rp)
+
+ add $-1, vn C vn -= 1
+ jz L(ret)
+
+ mov 8(vp), v0
+ mov 16(vp), v1
+
+ lea 8(vp), vp C vp += 1
+ lea 8(rp), rp C rp += 1
+
+ jmp *outer_addr
+
+C ===========================================================
+C mul_2 for vp[0], vp[1] if vn is even
+
+ ALIGN(16)
+L(mul_2):
+ mov 8(vp), v1
+
+ and $3, R32(w0)
+ jz L(mul_2_prologue_0)
+ cmp $2, R32(w0)
+ jz L(mul_2_prologue_2)
+ jc L(mul_2_prologue_1)
+
+L(mul_2_prologue_3):
+ lea L(addmul_outer_3)(%rip), outer_addr
+ add $2, n
+ mov %rax, -16(rp,n,8)
+ mov %rdx, w2
+ xor R32(w3), R32(w3)
+ xor R32(w0), R32(w0)
+ mov -16(up,n,8), %rax
+ jmp L(mul_2_entry_3)
+
+ ALIGN(16)
+L(mul_2_prologue_0):
+ add $3, n
+ mov %rax, w0
+ mov %rdx, w1
+ xor R32(w2), R32(w2)
+ mov -24(up,n,8), %rax
+ lea L(addmul_outer_0)(%rip), outer_addr
+ jmp L(mul_2_entry_0)
+
+ ALIGN(16)
+L(mul_2_prologue_1):
+ mov %rax, w3
+ mov %rdx, w0
+ xor R32(w1), R32(w1)
+ lea L(addmul_outer_1)(%rip), outer_addr
+ jmp L(mul_2_entry_1)
+
+ ALIGN(16)
+L(mul_2_prologue_2):
+ add $1, n
+ lea L(addmul_outer_2)(%rip), outer_addr
+ mov $0, R32(w0)
+ mov $0, R32(w1)
+ mov %rax, w2
+ mov -8(up,n,8), %rax
+ mov %rdx, w3
+ jmp L(mul_2_entry_2)
+
+ C this loop is 18 c/loop = 2.25 c/l on K8, for all up/rp alignments
+
+ ALIGN(16)
+L(mul_2_top):
+ mov -32(up,n,8), %rax
+ mul v1
+ add %rax, w0
+ adc %rdx, w1
+ mov -24(up,n,8), %rax
+ xor R32(w2), R32(w2)
+ mul v0
+ add %rax, w0
+ mov -24(up,n,8), %rax
+ adc %rdx, w1
+ adc $0, R32(w2)
+L(mul_2_entry_0):
+ mul v1
+ add %rax, w1
+ mov w0, -24(rp,n,8)
+ adc %rdx, w2
+ mov -16(up,n,8), %rax
+ mul v0
+ mov $0, R32(w3)
+ add %rax, w1
+ adc %rdx, w2
+ mov -16(up,n,8), %rax
+ adc $0, R32(w3)
+ mov $0, R32(w0)
+ mov w1, -16(rp,n,8)
+L(mul_2_entry_3):
+ mul v1
+ add %rax, w2
+ mov -8(up,n,8), %rax
+ adc %rdx, w3
+ mov $0, R32(w1)
+ mul v0
+ add %rax, w2
+ mov -8(up,n,8), %rax
+ adc %rdx, w3
+ adc R32(w1), R32(w0) C adc $0, w0
+L(mul_2_entry_2):
+ mul v1
+ add %rax, w3
+ mov w2, -8(rp,n,8)
+ adc %rdx, w0
+ mov (up,n,8), %rax
+ mul v0
+ add %rax, w3
+ adc %rdx, w0
+ adc $0, R32(w1)
+L(mul_2_entry_1):
+ add $4, n
+ mov w3, -32(rp,n,8)
+ js L(mul_2_top)
+
+ mov -32(up,n,8), %rax C FIXME: n is constant
+ mul v1
+ add %rax, w0
+ mov w0, (rp)
+ adc %rdx, w1
+ mov w1, 8(rp)
+
+ add $-2, vn C vn -= 2
+ jz L(ret)
+
+ mov 16(vp), v0
+ mov 24(vp), v1
+
+ lea 16(vp), vp C vp += 2
+ lea 16(rp), rp C rp += 2
+
+ jmp *outer_addr
+
+
+C ===========================================================
+C addmul_2 for remaining vp's
+
+ C in the following prologues, we reuse un to store the
+ C adjusted value of n that is reloaded on each iteration
+
+L(addmul_outer_0):
+ add $3, un
+ lea 0(%rip), outer_addr
+
+ mov un, n
+ mov -24(up,un,8), %rax
+ mul v0
+ mov %rax, w0
+ mov -24(up,un,8), %rax
+ mov %rdx, w1
+ xor R32(w2), R32(w2)
+ jmp L(addmul_entry_0)
+
+L(addmul_outer_1):
+ mov un, n
+ mov (up,un,8), %rax
+ mul v0
+ mov %rax, w3
+ mov (up,un,8), %rax
+ mov %rdx, w0
+ xor R32(w1), R32(w1)
+ jmp L(addmul_entry_1)
+
+L(addmul_outer_2):
+ add $1, un
+ lea 0(%rip), outer_addr
+
+ mov un, n
+ mov -8(up,un,8), %rax
+ mul v0
+ xor R32(w0), R32(w0)
+ mov %rax, w2
+ xor R32(w1), R32(w1)
+ mov %rdx, w3
+ mov -8(up,un,8), %rax
+ jmp L(addmul_entry_2)
+
+L(addmul_outer_3):
+ add $2, un
+ lea 0(%rip), outer_addr
+
+ mov un, n
+ mov -16(up,un,8), %rax
+ xor R32(w3), R32(w3)
+ mul v0
+ mov %rax, w1
+ mov -16(up,un,8), %rax
+ mov %rdx, w2
+ jmp L(addmul_entry_3)
+
+ C this loop is 19 c/loop = 2.375 c/l on K8, for all up/rp alignments
+
+ ALIGN(16)
+L(addmul_top):
+ add w3, -32(rp,n,8)
+ adc %rax, w0
+ mov -24(up,n,8), %rax
+ adc %rdx, w1
+ xor R32(w2), R32(w2)
+ mul v0
+ add %rax, w0
+ mov -24(up,n,8), %rax
+ adc %rdx, w1
+ adc R32(w2), R32(w2) C adc $0, w2
+L(addmul_entry_0):
+ mul v1
+ xor R32(w3), R32(w3)
+ add w0, -24(rp,n,8)
+ adc %rax, w1
+ mov -16(up,n,8), %rax
+ adc %rdx, w2
+ mul v0
+ add %rax, w1
+ mov -16(up,n,8), %rax
+ adc %rdx, w2
+ adc $0, R32(w3)
+L(addmul_entry_3):
+ mul v1
+ add w1, -16(rp,n,8)
+ adc %rax, w2
+ mov -8(up,n,8), %rax
+ adc %rdx, w3
+ mul v0
+ xor R32(w0), R32(w0)
+ add %rax, w2
+ adc %rdx, w3
+ mov $0, R32(w1)
+ mov -8(up,n,8), %rax
+ adc R32(w1), R32(w0) C adc $0, w0
+L(addmul_entry_2):
+ mul v1
+ add w2, -8(rp,n,8)
+ adc %rax, w3
+ adc %rdx, w0
+ mov (up,n,8), %rax
+ mul v0
+ add %rax, w3
+ mov (up,n,8), %rax
+ adc %rdx, w0
+ adc $0, R32(w1)
+L(addmul_entry_1):
+ mul v1
+ add $4, n
+ js L(addmul_top)
+
+ add w3, -8(rp)
+ adc %rax, w0
+ mov w0, (rp)
+ adc %rdx, w1
+ mov w1, 8(rp)
+
+ add $-2, vn C vn -= 2
+ jz L(ret)
+
+ lea 16(rp), rp C rp += 2
+ lea 16(vp), vp C vp += 2
+
+ mov (vp), v0
+ mov 8(vp), v1
+
+ jmp *outer_addr
+
+ ALIGN(16)
+L(ret): pop %r15
+ pop %r14
+ pop %r13
+ pop %r12
+ pop %rbp
+ pop %rbx
+ FUNC_EXIT()
+ ret
+
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/k8/mullo_basecase.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/k8/mullo_basecase.asm
new file mode 100644
index 00000000000..fa00f4234a3
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/k8/mullo_basecase.asm
@@ -0,0 +1,436 @@
+dnl AMD64 mpn_mullo_basecase.
+
+dnl Contributed to the GNU project by Torbjorn Granlund.
+
+dnl Copyright 2008, 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 The inner loops of this code are the result of running a code generation and
+C optimisation tool suite written by David Harvey and Torbjorn Granlund.
+
+C NOTES
+C * There is a major stupidity in that we call mpn_mul_1 initially, for a
+C large trip count. Instead, we should start with mul_2 for any operand
+C size congruence class.
+C * Stop iterating addmul_2 earlier, falling into straight-line triangle code
+C for the last 2-3 iterations.
+C * Perhaps implement n=4 special code.
+C * The reload of the outer loop jump address hurts branch prediction.
+C * The addmul_2 loop ends with an MUL whose high part is not used upon loop
+C exit.
+
+C INPUT PARAMETERS
+define(`rp', `%rdi')
+define(`up', `%rsi')
+define(`vp_param', `%rdx')
+define(`n', `%rcx')
+
+define(`vp', `%r11')
+define(`outer_addr', `%r8')
+define(`j', `%r9')
+define(`v0', `%r13')
+define(`v1', `%r14')
+define(`w0', `%rbx')
+define(`w1', `%r15')
+define(`w2', `%rbp')
+define(`w3', `%r10')
+
+ABI_SUPPORT(DOS64)
+ABI_SUPPORT(STD64)
+
+ASM_START()
+ TEXT
+ ALIGN(16)
+PROLOGUE(mpn_mullo_basecase)
+ FUNC_ENTRY(4)
+ cmp $4, n
+ jge L(gen)
+ mov (up), %rax C u0
+ mov (vp_param), %r8 C v0
+
+ lea L(tab)(%rip), %r9
+ifdef(`PIC',
+` movslq (%r9,%rcx,4), %r10
+ add %r10, %r9
+ jmp *%r9
+',`
+ jmp *(%r9,n,8)
+')
+ JUMPTABSECT
+ ALIGN(8)
+L(tab): JMPENT( L(tab), L(tab)) C not allowed
+ JMPENT( L(1), L(tab)) C 1
+ JMPENT( L(2), L(tab)) C 2
+ JMPENT( L(3), L(tab)) C 3
+dnl JMPENT( L(0m4), L(tab)) C 4
+dnl JMPENT( L(1m4), L(tab)) C 5
+dnl JMPENT( L(2m4), L(tab)) C 6
+dnl JMPENT( L(3m4), L(tab)) C 7
+dnl JMPENT( L(0m4), L(tab)) C 8
+dnl JMPENT( L(1m4), L(tab)) C 9
+dnl JMPENT( L(2m4), L(tab)) C 10
+dnl JMPENT( L(3m4), L(tab)) C 11
+ TEXT
+
+L(1): imul %r8, %rax
+ mov %rax, (rp)
+ FUNC_EXIT()
+ ret
+
+L(2): mov 8(vp_param), %r11
+ imul %rax, %r11 C u0 x v1
+ mul %r8 C u0 x v0
+ mov %rax, (rp)
+ imul 8(up), %r8 C u1 x v0
+ lea (%r11, %rdx), %rax
+ add %r8, %rax
+ mov %rax, 8(rp)
+ FUNC_EXIT()
+ ret
+
+L(3): mov 8(vp_param), %r9 C v1
+ mov 16(vp_param), %r11
+ mul %r8 C u0 x v0 -> <r1,r0>
+ mov %rax, (rp) C r0
+ mov (up), %rax C u0
+ mov %rdx, %rcx C r1
+ mul %r9 C u0 x v1 -> <r2,r1>
+ imul 8(up), %r9 C u1 x v1 -> r2
+ mov 16(up), %r10
+ imul %r8, %r10 C u2 x v0 -> r2
+ add %rax, %rcx
+ adc %rdx, %r9
+ add %r10, %r9
+ mov 8(up), %rax C u1
+ mul %r8 C u1 x v0 -> <r2,r1>
+ add %rax, %rcx
+ adc %rdx, %r9
+ mov %r11, %rax
+ imul (up), %rax C u0 x v2 -> r2
+ add %rax, %r9
+ mov %rcx, 8(rp)
+ mov %r9, 16(rp)
+ FUNC_EXIT()
+ ret
+
+L(0m4):
+L(1m4):
+L(2m4):
+L(3m4):
+L(gen): push %rbx
+ push %rbp
+ push %r13
+ push %r14
+ push %r15
+
+ mov (up), %rax
+ mov (vp_param), v0
+ mov vp_param, vp
+
+ lea (rp,n,8), rp
+ lea (up,n,8), up
+ neg n
+
+ mul v0
+
+ test $1, R8(n)
+ jz L(mul_2)
+
+L(mul_1):
+ lea -8(rp), rp
+ lea -8(up), up
+ test $2, R8(n)
+ jnz L(mul_1_prologue_3)
+
+L(mul_1_prologue_2): C n = 7, 11, 15, ...
+ lea -1(n), j
+ lea L(addmul_outer_1)(%rip), outer_addr
+ mov %rax, w0
+ mov %rdx, w1
+ xor R32(w2), R32(w2)
+ xor R32(w3), R32(w3)
+ mov 16(up,n,8), %rax
+ jmp L(mul_1_entry_2)
+
+L(mul_1_prologue_3): C n = 5, 9, 13, ...
+ lea 1(n), j
+ lea L(addmul_outer_3)(%rip), outer_addr
+ mov %rax, w2
+ mov %rdx, w3
+ xor R32(w0), R32(w0)
+ jmp L(mul_1_entry_0)
+
+ ALIGN(16)
+L(mul_1_top):
+ mov w0, -16(rp,j,8)
+ add %rax, w1
+ mov (up,j,8), %rax
+ adc %rdx, w2
+ xor R32(w0), R32(w0)
+ mul v0
+ mov w1, -8(rp,j,8)
+ add %rax, w2
+ adc %rdx, w3
+L(mul_1_entry_0):
+ mov 8(up,j,8), %rax
+ mul v0
+ mov w2, (rp,j,8)
+ add %rax, w3
+ adc %rdx, w0
+ mov 16(up,j,8), %rax
+ mul v0
+ mov w3, 8(rp,j,8)
+ xor R32(w2), R32(w2) C zero
+ mov w2, w3 C zero
+ add %rax, w0
+ mov 24(up,j,8), %rax
+ mov w2, w1 C zero
+ adc %rdx, w1
+L(mul_1_entry_2):
+ mul v0
+ add $4, j
+ js L(mul_1_top)
+
+ mov w0, -16(rp)
+ add %rax, w1
+ mov w1, -8(rp)
+ adc %rdx, w2
+
+ imul (up), v0
+ add v0, w2
+ mov w2, (rp)
+
+ add $1, n
+ jz L(ret)
+
+ mov 8(vp), v0
+ mov 16(vp), v1
+
+ lea 16(up), up
+ lea 8(vp), vp
+ lea 24(rp), rp
+
+ jmp *outer_addr
+
+
+L(mul_2):
+ mov 8(vp), v1
+ test $2, R8(n)
+ jz L(mul_2_prologue_3)
+
+ ALIGN(16)
+L(mul_2_prologue_1):
+ lea 0(n), j
+ mov %rax, w3
+ mov %rdx, w0
+ xor R32(w1), R32(w1)
+ mov (up,n,8), %rax
+ lea L(addmul_outer_3)(%rip), outer_addr
+ jmp L(mul_2_entry_1)
+
+ ALIGN(16)
+L(mul_2_prologue_3):
+ lea 2(n), j
+ mov $0, R32(w3)
+ mov %rax, w1
+ mov (up,n,8), %rax
+ mov %rdx, w2
+ lea L(addmul_outer_1)(%rip), outer_addr
+ jmp L(mul_2_entry_3)
+
+ ALIGN(16)
+L(mul_2_top):
+ mov -32(up,j,8), %rax
+ mul v1
+ add %rax, w0
+ adc %rdx, w1
+ mov -24(up,j,8), %rax
+ xor R32(w2), R32(w2)
+ mul v0
+ add %rax, w0
+ mov -24(up,j,8), %rax
+ adc %rdx, w1
+ adc $0, R32(w2)
+ mul v1
+ add %rax, w1
+ mov w0, -24(rp,j,8)
+ adc %rdx, w2
+ mov -16(up,j,8), %rax
+ mul v0
+ mov $0, R32(w3)
+ add %rax, w1
+ adc %rdx, w2
+ mov -16(up,j,8), %rax
+ adc $0, R32(w3)
+L(mul_2_entry_3):
+ mov $0, R32(w0)
+ mov w1, -16(rp,j,8)
+ mul v1
+ add %rax, w2
+ mov -8(up,j,8), %rax
+ adc %rdx, w3
+ mov $0, R32(w1)
+ mul v0
+ add %rax, w2
+ mov -8(up,j,8), %rax
+ adc %rdx, w3
+ adc R32(w1), R32(w0)
+ mul v1
+ add %rax, w3
+ mov w2, -8(rp,j,8)
+ adc %rdx, w0
+ mov (up,j,8), %rax
+ mul v0
+ add %rax, w3
+ adc %rdx, w0
+ adc $0, R32(w1)
+L(mul_2_entry_1):
+ add $4, j
+ mov w3, -32(rp,j,8)
+ js L(mul_2_top)
+
+ imul -16(up), v1
+ add v1, w0
+ imul -8(up), v0
+ add v0, w0
+ mov w0, -8(rp)
+
+ add $2, n
+ jz L(ret)
+
+ mov 16(vp), v0
+ mov 24(vp), v1
+
+ lea 16(vp), vp
+ lea 16(rp), rp
+
+ jmp *outer_addr
+
+
+L(addmul_outer_1):
+ lea -2(n), j
+ mov -16(up,n,8), %rax
+ mul v0
+ mov %rax, w3
+ mov -16(up,n,8), %rax
+ mov %rdx, w0
+ xor R32(w1), R32(w1)
+ lea L(addmul_outer_3)(%rip), outer_addr
+ jmp L(addmul_entry_1)
+
+L(addmul_outer_3):
+ lea 0(n), j
+ mov -16(up,n,8), %rax
+ xor R32(w3), R32(w3)
+ mul v0
+ mov %rax, w1
+ mov -16(up,n,8), %rax
+ mov %rdx, w2
+ lea L(addmul_outer_1)(%rip), outer_addr
+ jmp L(addmul_entry_3)
+
+ ALIGN(16)
+L(addmul_top):
+ add w3, -32(rp,j,8)
+ adc %rax, w0
+ mov -24(up,j,8), %rax
+ adc %rdx, w1
+ xor R32(w2), R32(w2)
+ mul v0
+ add %rax, w0
+ mov -24(up,j,8), %rax
+ adc %rdx, w1
+ adc R32(w2), R32(w2)
+ mul v1
+ xor R32(w3), R32(w3)
+ add w0, -24(rp,j,8)
+ adc %rax, w1
+ mov -16(up,j,8), %rax
+ adc %rdx, w2
+ mul v0
+ add %rax, w1
+ mov -16(up,j,8), %rax
+ adc %rdx, w2
+ adc $0, R32(w3)
+L(addmul_entry_3):
+ mul v1
+ add w1, -16(rp,j,8)
+ adc %rax, w2
+ mov -8(up,j,8), %rax
+ adc %rdx, w3
+ mul v0
+ xor R32(w0), R32(w0)
+ add %rax, w2
+ adc %rdx, w3
+ mov $0, R32(w1)
+ mov -8(up,j,8), %rax
+ adc R32(w1), R32(w0)
+ mul v1
+ add w2, -8(rp,j,8)
+ adc %rax, w3
+ adc %rdx, w0
+ mov (up,j,8), %rax
+ mul v0
+ add %rax, w3
+ mov (up,j,8), %rax
+ adc %rdx, w0
+ adc $0, R32(w1)
+L(addmul_entry_1):
+ mul v1
+ add $4, j
+ js L(addmul_top)
+
+ add w3, -32(rp)
+ adc %rax, w0
+
+ imul -24(up), v0
+ add v0, w0
+ add w0, -24(rp)
+
+ add $2, n
+ jns L(ret)
+
+ lea 16(vp), vp
+
+ mov (vp), v0
+ mov 8(vp), v1
+
+ lea -16(up), up
+
+ jmp *outer_addr
+
+L(ret): pop %r15
+ pop %r14
+ pop %r13
+ pop %rbp
+ pop %rbx
+ FUNC_EXIT()
+ ret
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/k8/mulmid_basecase.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/k8/mulmid_basecase.asm
new file mode 100644
index 00000000000..86f1414ed85
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/k8/mulmid_basecase.asm
@@ -0,0 +1,559 @@
+dnl AMD64 mpn_mulmid_basecase
+
+dnl Contributed by David Harvey.
+
+dnl Copyright 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/limb
+C K8,K9: 2.375 (2.5 when un - vn is "small")
+C K10: ?
+C P4: ?
+C P6-15: ?
+
+C INPUT PARAMETERS
+define(`rp', `%rdi')
+define(`up', `%rsi')
+define(`un_param',`%rdx')
+define(`vp_param',`%rcx')
+define(`vn', `%r8')
+
+define(`v0', `%r12')
+define(`v1', `%r9')
+
+define(`w0', `%rbx')
+define(`w1', `%rcx')
+define(`w2', `%rbp')
+define(`w3', `%r10')
+
+define(`n', `%r11')
+define(`outer_addr', `%r14')
+define(`un', `%r13')
+define(`vp', `%r15')
+
+define(`vp_inner', `%r10')
+
+ABI_SUPPORT(DOS64)
+ABI_SUPPORT(STD64)
+
+ASM_START()
+ TEXT
+ ALIGN(16)
+PROLOGUE(mpn_mulmid_basecase)
+ FUNC_ENTRY(4)
+IFDOS(` mov 56(%rsp), %r8d ')
+ push %rbx
+ push %rbp
+ push %r12
+ push %r13
+ push %r14
+ push %r15
+
+ mov vp_param, vp
+
+ C use un for row length (= un_param - vn + 1)
+ lea 1(un_param), un
+ sub vn, un
+
+ lea (rp,un,8), rp
+
+ cmp $4, un C TODO: needs tuning
+ jc L(diagonal)
+
+ lea (up,un_param,8), up
+
+ test $1, vn
+ jz L(mul_2)
+
+C ===========================================================
+C mul_1 for vp[0] if vn is odd
+
+L(mul_1):
+ mov R32(un), R32(w0)
+
+ neg un
+ mov (up,un,8), %rax
+ mov (vp), v0
+ mul v0
+
+ and $-4, un C round down to multiple of 4
+ mov un, n
+
+ and $3, R32(w0)
+ jz L(mul_1_prologue_0)
+ cmp $2, R32(w0)
+ jc L(mul_1_prologue_1)
+ jz L(mul_1_prologue_2)
+
+L(mul_1_prologue_3):
+ mov %rax, w3
+ mov %rdx, w0
+ lea L(addmul_prologue_3)(%rip), outer_addr
+ jmp L(mul_1_entry_3)
+
+ ALIGN(16)
+L(mul_1_prologue_0):
+ mov %rax, w2
+ mov %rdx, w3 C note already w0 == 0
+ lea L(addmul_prologue_0)(%rip), outer_addr
+ jmp L(mul_1_entry_0)
+
+ ALIGN(16)
+L(mul_1_prologue_1):
+ add $4, n
+ mov %rax, w1
+ mov %rdx, w2
+ mov $0, R32(w3)
+ mov (up,n,8), %rax
+ lea L(addmul_prologue_1)(%rip), outer_addr
+ jmp L(mul_1_entry_1)
+
+ ALIGN(16)
+L(mul_1_prologue_2):
+ mov %rax, w0
+ mov %rdx, w1
+ mov 24(up,n,8), %rax
+ mov $0, R32(w2)
+ mov $0, R32(w3)
+ lea L(addmul_prologue_2)(%rip), outer_addr
+ jmp L(mul_1_entry_2)
+
+
+ C this loop is 10 c/loop = 2.5 c/l on K8
+
+ ALIGN(16)
+L(mul_1_top):
+ mov w0, -16(rp,n,8)
+ add %rax, w1
+ mov (up,n,8), %rax
+ adc %rdx, w2
+L(mul_1_entry_1):
+ mov $0, R32(w0)
+ mul v0
+ mov w1, -8(rp,n,8)
+ add %rax, w2
+ adc %rdx, w3
+L(mul_1_entry_0):
+ mov 8(up,n,8), %rax
+ mul v0
+ mov w2, (rp,n,8)
+ add %rax, w3
+ adc %rdx, w0
+L(mul_1_entry_3):
+ mov 16(up,n,8), %rax
+ mul v0
+ mov w3, 8(rp,n,8)
+ mov $0, R32(w2) C zero
+ mov w2, w3 C zero
+ add %rax, w0
+ mov 24(up,n,8), %rax
+ mov w2, w1 C zero
+ adc %rdx, w1
+L(mul_1_entry_2):
+ mul v0
+ add $4, n
+ js L(mul_1_top)
+
+ mov w0, -16(rp)
+ add %rax, w1
+ mov w1, -8(rp)
+ mov w2, 8(rp) C zero last limb of output
+ adc %rdx, w2
+ mov w2, (rp)
+
+ dec vn
+ jz L(ret)
+
+ lea -8(up), up
+ lea 8(vp), vp
+
+ mov un, n
+ mov (vp), v0
+ mov 8(vp), v1
+
+ jmp *outer_addr
+
+C ===========================================================
+C mul_2 for vp[0], vp[1] if vn is even
+
+ ALIGN(16)
+L(mul_2):
+ mov R32(un), R32(w0)
+
+ neg un
+ mov -8(up,un,8), %rax
+ mov (vp), v0
+ mov 8(vp), v1
+ mul v1
+
+ and $-4, un C round down to multiple of 4
+ mov un, n
+
+ and $3, R32(w0)
+ jz L(mul_2_prologue_0)
+ cmp $2, R32(w0)
+ jc L(mul_2_prologue_1)
+ jz L(mul_2_prologue_2)
+
+L(mul_2_prologue_3):
+ mov %rax, w1
+ mov %rdx, w2
+ lea L(addmul_prologue_3)(%rip), outer_addr
+ jmp L(mul_2_entry_3)
+
+ ALIGN(16)
+L(mul_2_prologue_0):
+ mov %rax, w0
+ mov %rdx, w1
+ lea L(addmul_prologue_0)(%rip), outer_addr
+ jmp L(mul_2_entry_0)
+
+ ALIGN(16)
+L(mul_2_prologue_1):
+ mov %rax, w3
+ mov %rdx, w0
+ mov $0, R32(w1)
+ lea L(addmul_prologue_1)(%rip), outer_addr
+ jmp L(mul_2_entry_1)
+
+ ALIGN(16)
+L(mul_2_prologue_2):
+ mov %rax, w2
+ mov %rdx, w3
+ mov $0, R32(w0)
+ mov 16(up,n,8), %rax
+ lea L(addmul_prologue_2)(%rip), outer_addr
+ jmp L(mul_2_entry_2)
+
+
+ C this loop is 18 c/loop = 2.25 c/l on K8
+
+ ALIGN(16)
+L(mul_2_top):
+ mov -8(up,n,8), %rax
+ mul v1
+ add %rax, w0
+ adc %rdx, w1
+L(mul_2_entry_0):
+ mov $0, R32(w2)
+ mov (up,n,8), %rax
+ mul v0
+ add %rax, w0
+ mov (up,n,8), %rax
+ adc %rdx, w1
+ adc $0, R32(w2)
+ mul v1
+ add %rax, w1
+ mov w0, (rp,n,8)
+ adc %rdx, w2
+L(mul_2_entry_3):
+ mov 8(up,n,8), %rax
+ mul v0
+ mov $0, R32(w3)
+ add %rax, w1
+ adc %rdx, w2
+ mov $0, R32(w0)
+ adc $0, R32(w3)
+ mov 8(up,n,8), %rax
+ mov w1, 8(rp,n,8)
+ mul v1
+ add %rax, w2
+ mov 16(up,n,8), %rax
+ adc %rdx, w3
+L(mul_2_entry_2):
+ mov $0, R32(w1)
+ mul v0
+ add %rax, w2
+ mov 16(up,n,8), %rax
+ adc %rdx, w3
+ adc $0, R32(w0)
+ mul v1
+ add %rax, w3
+ mov w2, 16(rp,n,8)
+ adc %rdx, w0
+L(mul_2_entry_1):
+ mov 24(up,n,8), %rax
+ mul v0
+ add %rax, w3
+ adc %rdx, w0
+ adc $0, R32(w1)
+ add $4, n
+ mov w3, -8(rp,n,8)
+ jnz L(mul_2_top)
+
+ mov w0, (rp)
+ mov w1, 8(rp)
+
+ sub $2, vn
+ jz L(ret)
+
+ lea 16(vp), vp
+ lea -16(up), up
+
+ mov un, n
+ mov (vp), v0
+ mov 8(vp), v1
+
+ jmp *outer_addr
+
+C ===========================================================
+C addmul_2 for remaining vp's
+
+ ALIGN(16)
+L(addmul_prologue_0):
+ mov -8(up,n,8), %rax
+ mul v1
+ mov %rax, w1
+ mov %rdx, w2
+ mov $0, R32(w3)
+ jmp L(addmul_entry_0)
+
+ ALIGN(16)
+L(addmul_prologue_1):
+ mov 16(up,n,8), %rax
+ mul v1
+ mov %rax, w0
+ mov %rdx, w1
+ mov $0, R32(w2)
+ mov 24(up,n,8), %rax
+ jmp L(addmul_entry_1)
+
+ ALIGN(16)
+L(addmul_prologue_2):
+ mov 8(up,n,8), %rax
+ mul v1
+ mov %rax, w3
+ mov %rdx, w0
+ mov $0, R32(w1)
+ jmp L(addmul_entry_2)
+
+ ALIGN(16)
+L(addmul_prologue_3):
+ mov (up,n,8), %rax
+ mul v1
+ mov %rax, w2
+ mov %rdx, w3
+ mov $0, R32(w0)
+ mov $0, R32(w1)
+ jmp L(addmul_entry_3)
+
+ C this loop is 19 c/loop = 2.375 c/l on K8
+
+ ALIGN(16)
+L(addmul_top):
+ mov $0, R32(w3)
+ add %rax, w0
+ mov -8(up,n,8), %rax
+ adc %rdx, w1
+ adc $0, R32(w2)
+ mul v1
+ add w0, -8(rp,n,8)
+ adc %rax, w1
+ adc %rdx, w2
+L(addmul_entry_0):
+ mov (up,n,8), %rax
+ mul v0
+ add %rax, w1
+ mov (up,n,8), %rax
+ adc %rdx, w2
+ adc $0, R32(w3)
+ mul v1
+ add w1, (rp,n,8)
+ mov $0, R32(w1)
+ adc %rax, w2
+ mov $0, R32(w0)
+ adc %rdx, w3
+L(addmul_entry_3):
+ mov 8(up,n,8), %rax
+ mul v0
+ add %rax, w2
+ mov 8(up,n,8), %rax
+ adc %rdx, w3
+ adc $0, R32(w0)
+ mul v1
+ add w2, 8(rp,n,8)
+ adc %rax, w3
+ adc %rdx, w0
+L(addmul_entry_2):
+ mov 16(up,n,8), %rax
+ mul v0
+ add %rax, w3
+ mov 16(up,n,8), %rax
+ adc %rdx, w0
+ adc $0, R32(w1)
+ mul v1
+ add w3, 16(rp,n,8)
+ nop C don't ask...
+ adc %rax, w0
+ mov $0, R32(w2)
+ mov 24(up,n,8), %rax
+ adc %rdx, w1
+L(addmul_entry_1):
+ mul v0
+ add $4, n
+ jnz L(addmul_top)
+
+ add %rax, w0
+ adc %rdx, w1
+ adc $0, R32(w2)
+
+ add w0, -8(rp)
+ adc w1, (rp)
+ adc w2, 8(rp)
+
+ sub $2, vn
+ jz L(ret)
+
+ lea 16(vp), vp
+ lea -16(up), up
+
+ mov un, n
+ mov (vp), v0
+ mov 8(vp), v1
+
+ jmp *outer_addr
+
+C ===========================================================
+C accumulate along diagonals if un - vn is small
+
+ ALIGN(16)
+L(diagonal):
+ xor R32(w0), R32(w0)
+ xor R32(w1), R32(w1)
+ xor R32(w2), R32(w2)
+
+ neg un
+
+ mov R32(vn), %eax
+ and $3, %eax
+ jz L(diag_prologue_0)
+ cmp $2, %eax
+ jc L(diag_prologue_1)
+ jz L(diag_prologue_2)
+
+L(diag_prologue_3):
+ lea -8(vp), vp
+ mov vp, vp_inner
+ add $1, vn
+ mov vn, n
+ lea L(diag_entry_3)(%rip), outer_addr
+ jmp L(diag_entry_3)
+
+L(diag_prologue_0):
+ mov vp, vp_inner
+ mov vn, n
+ lea 0(%rip), outer_addr
+ mov -8(up,n,8), %rax
+ jmp L(diag_entry_0)
+
+L(diag_prologue_1):
+ lea 8(vp), vp
+ mov vp, vp_inner
+ add $3, vn
+ mov vn, n
+ lea 0(%rip), outer_addr
+ mov -8(vp_inner), %rax
+ jmp L(diag_entry_1)
+
+L(diag_prologue_2):
+ lea -16(vp), vp
+ mov vp, vp_inner
+ add $2, vn
+ mov vn, n
+ lea 0(%rip), outer_addr
+ mov 16(vp_inner), %rax
+ jmp L(diag_entry_2)
+
+
+ C this loop is 10 c/loop = 2.5 c/l on K8
+
+ ALIGN(16)
+L(diag_top):
+ add %rax, w0
+ adc %rdx, w1
+ mov -8(up,n,8), %rax
+ adc $0, w2
+L(diag_entry_0):
+ mulq (vp_inner)
+ add %rax, w0
+ adc %rdx, w1
+ adc $0, w2
+L(diag_entry_3):
+ mov -16(up,n,8), %rax
+ mulq 8(vp_inner)
+ add %rax, w0
+ mov 16(vp_inner), %rax
+ adc %rdx, w1
+ adc $0, w2
+L(diag_entry_2):
+ mulq -24(up,n,8)
+ add %rax, w0
+ mov 24(vp_inner), %rax
+ adc %rdx, w1
+ lea 32(vp_inner), vp_inner
+ adc $0, w2
+L(diag_entry_1):
+ mulq -32(up,n,8)
+ sub $4, n
+ jnz L(diag_top)
+
+ add %rax, w0
+ adc %rdx, w1
+ adc $0, w2
+
+ mov w0, (rp,un,8)
+
+ inc un
+ jz L(diag_end)
+
+ mov vn, n
+ mov vp, vp_inner
+
+ lea 8(up), up
+ mov w1, w0
+ mov w2, w1
+ xor R32(w2), R32(w2)
+
+ jmp *outer_addr
+
+L(diag_end):
+ mov w1, (rp)
+ mov w2, 8(rp)
+
+L(ret): pop %r15
+ pop %r14
+ pop %r13
+ pop %r12
+ pop %rbp
+ pop %rbx
+ FUNC_EXIT()
+ ret
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/k8/redc_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/k8/redc_1.asm
new file mode 100644
index 00000000000..74538986f93
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/k8/redc_1.asm
@@ -0,0 +1,590 @@
+dnl X86-64 mpn_redc_1 optimised for AMD K8-K10.
+
+dnl Contributed to the GNU project by Torbjörn Granlund.
+
+dnl Copyright 2004, 2008, 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/limb
+C AMD K8,K9 ?
+C AMD K10 ?
+C AMD bull ?
+C AMD pile ?
+C AMD steam ?
+C AMD bobcat ?
+C AMD jaguar ?
+C Intel P4 ?
+C Intel core ?
+C Intel NHM ?
+C Intel SBR ?
+C Intel IBR ?
+C Intel HWL ?
+C Intel BWL ?
+C Intel atom ?
+C VIA nano ?
+
+C The inner loops of this code are the result of running a code generation and
+C optimisation tool suite written by David Harvey and Torbjörn Granlund.
+
+C TODO
+C * Micro-optimise, none performed thus far.
+C * This looks different from other current redc_1.asm variants. Consider
+C adapting this to the mainstream style.
+C * Is this code really faster than more approaches which compute q0 later?
+C Is the use of a jump jump table faster? Or is the edge of this due to the
+C inlined add_n code?
+C * Put initial m[0] x q0 computation in header.
+C * Put basecases at the file's end, single them out before the pushes.
+
+define(`rp', `%rdi') C rcx
+define(`up', `%rsi') C rdx
+define(`mp_param', `%rdx') C r8
+define(`n', `%rcx') C r9
+define(`u0inv', `%r8') C stack
+
+define(`i', `%r11')
+define(`nneg', `%r12')
+define(`mp', `%r13')
+define(`q0', `%rbp')
+define(`vp', `%rdx')
+
+ABI_SUPPORT(DOS64)
+ABI_SUPPORT(STD64)
+
+ASM_START()
+ TEXT
+ ALIGN(32)
+PROLOGUE(mpn_redc_1)
+ FUNC_ENTRY(4)
+IFDOS(` mov 56(%rsp), %r8 ')
+ push %rbp
+ mov (up), q0 C up[0]
+ push %rbx
+ imul u0inv, q0 C first q0, for all execution paths
+ push %r12
+ push %r13
+ push %r14
+ push %r15
+
+ mov n, nneg
+ neg nneg
+ lea (mp_param,n,8), mp C mp += n
+ lea -16(up,n,8), up C up += n
+
+ mov R32(n), R32(%rax)
+ and $3, R32(%rax)
+ lea 4(%rax), %r9
+ cmp $4, R32(n)
+ cmovg %r9, %rax
+ lea L(tab)(%rip), %r9
+ifdef(`PIC',`
+ movslq (%r9,%rax,4), %rax
+ add %r9, %rax
+ jmp *%rax
+',`
+ jmp *(%r9,%rax,8)
+')
+
+ JUMPTABSECT
+ ALIGN(8)
+L(tab): JMPENT( L(0m4), L(tab))
+ JMPENT( L(1), L(tab))
+ JMPENT( L(2), L(tab))
+ JMPENT( L(3), L(tab))
+ JMPENT( L(0m4), L(tab))
+ JMPENT( L(1m4), L(tab))
+ JMPENT( L(2m4), L(tab))
+ JMPENT( L(3m4), L(tab))
+ TEXT
+
+ ALIGN(16)
+L(1): mov (mp_param), %rax
+ mul q0
+ add 8(up), %rax
+ adc 16(up), %rdx
+ mov %rdx, (rp)
+ mov $0, R32(%rax)
+ adc R32(%rax), R32(%rax)
+ jmp L(ret)
+
+
+ ALIGN(16)
+L(2): mov (mp_param), %rax
+ mul q0
+ xor R32(%r14), R32(%r14)
+ mov %rax, %r10
+ mov -8(mp), %rax
+ mov %rdx, %r9
+ mul q0
+ add (up), %r10
+ adc %rax, %r9
+ adc %rdx, %r14
+ add 8(up), %r9
+ adc $0, %r14
+ mov %r9, q0
+ imul u0inv, q0
+ mov -16(mp), %rax
+ mul q0
+ xor R32(%rbx), R32(%rbx)
+ mov %rax, %r10
+ mov -8(mp), %rax
+ mov %rdx, %r11
+ mul q0
+ add %r9, %r10
+ adc %rax, %r11
+ adc %rdx, %rbx
+ add 16(up), %r11
+ adc $0, %rbx
+ xor R32(%rax), R32(%rax)
+ add %r11, %r14
+ adc 24(up), %rbx
+ mov %r14, (rp)
+ mov %rbx, 8(rp)
+ adc R32(%rax), R32(%rax)
+ jmp L(ret)
+
+
+L(3): mov (mp_param), %rax
+ mul q0
+ mov %rax, %rbx
+ mov %rdx, %r10
+ mov -16(mp), %rax
+ mul q0
+ xor R32(%r9), R32(%r9)
+ xor R32(%r14), R32(%r14)
+ add -8(up), %rbx
+ adc %rax, %r10
+ mov -8(mp), %rax
+ adc %rdx, %r9
+ mul q0
+ add (up), %r10
+ mov %r10, (up)
+ adc %rax, %r9
+ adc %rdx, %r14
+ mov %r10, q0
+ imul u0inv, q0
+ add %r9, 8(up)
+ adc $0, %r14
+ mov %r14, -8(up)
+
+ mov -24(mp), %rax
+ mul q0
+ mov %rax, %rbx
+ mov %rdx, %r10
+ mov -16(mp), %rax
+ mul q0
+ xor R32(%r9), R32(%r9)
+ xor R32(%r14), R32(%r14)
+ add (up), %rbx
+ adc %rax, %r10
+ mov -8(mp), %rax
+ adc %rdx, %r9
+ mul q0
+ add 8(up), %r10
+ mov %r10, 8(up)
+ adc %rax, %r9
+ adc %rdx, %r14
+ mov %r10, q0
+ imul u0inv, q0
+ add %r9, 16(up)
+ adc $0, %r14
+ mov %r14, (up)
+
+ mov -24(mp), %rax
+ mul q0
+ mov %rax, %rbx
+ mov %rdx, %r10
+ mov -16(mp), %rax
+ mul q0
+ xor R32(%r9), R32(%r9)
+ xor R32(%r14), R32(%r14)
+ add 8(up), %rbx
+ adc %rax, %r10
+ mov -8(mp), %rax
+ adc %rdx, %r9
+ mul q0
+ add 16(up), %r10
+ adc %rax, %r9
+ adc %rdx, %r14
+ add 24(up), %r9
+ adc $0, %r14
+
+ xor R32(%rax), R32(%rax)
+ add -8(up), %r10
+ adc (up), %r9
+ adc 32(up), %r14
+ mov %r10, (rp)
+ mov %r9, 8(rp)
+ mov %r14, 16(rp)
+ adc R32(%rax), R32(%rax)
+ jmp L(ret)
+
+
+ ALIGN(16)
+L(2m4):
+L(lo2): mov (mp,nneg,8), %rax
+ mul q0
+ xor R32(%r14), R32(%r14)
+ xor R32(%rbx), R32(%rbx)
+ mov %rax, %r10
+ mov 8(mp,nneg,8), %rax
+ mov 24(up,nneg,8), %r15
+ mov %rdx, %r9
+ mul q0
+ add 16(up,nneg,8), %r10
+ adc %rax, %r9
+ mov 16(mp,nneg,8), %rax
+ adc %rdx, %r14
+ mul q0
+ mov $0, R32(%r10) C xor?
+ lea 2(nneg), i
+ add %r9, %r15
+ imul u0inv, %r15
+ jmp L(e2)
+
+ ALIGN(16)
+L(li2): add %r10, (up,i,8)
+ adc %rax, %r9
+ mov (mp,i,8), %rax
+ adc %rdx, %r14
+ xor R32(%r10), R32(%r10)
+ mul q0
+L(e2): add %r9, 8(up,i,8)
+ adc %rax, %r14
+ adc %rdx, %rbx
+ mov 8(mp,i,8), %rax
+ mul q0
+ add %r14, 16(up,i,8)
+ adc %rax, %rbx
+ adc %rdx, %r10
+ mov 16(mp,i,8), %rax
+ mul q0
+ add %rbx, 24(up,i,8)
+ mov $0, R32(%r14) C zero
+ mov %r14, %rbx C zero
+ adc %rax, %r10
+ mov 24(mp,i,8), %rax
+ mov %r14, %r9 C zero
+ adc %rdx, %r9
+ mul q0
+ add $4, i
+ js L(li2)
+
+L(le2): add %r10, (up)
+ adc %rax, %r9
+ adc %r14, %rdx
+ add %r9, 8(up)
+ adc $0, %rdx
+ mov %rdx, 16(up,nneg,8) C up[0]
+ add $8, up
+ mov %r15, q0
+ dec n
+ jnz L(lo2)
+
+ mov nneg, n
+ sar $2, n
+ lea 32(up,nneg,8), up
+ lea (up,nneg,8), vp
+
+ mov -16(up), %r8
+ mov -8(up), %r9
+ add -16(vp), %r8
+ adc -8(vp), %r9
+ mov %r8, (rp)
+ mov %r9, 8(rp)
+ lea 16(rp), rp
+ jmp L(addx)
+
+
+ ALIGN(16)
+L(1m4):
+L(lo1): mov (mp,nneg,8), %rax
+ xor %r9, %r9
+ xor R32(%rbx), R32(%rbx)
+ mul q0
+ mov %rax, %r9
+ mov 8(mp,nneg,8), %rax
+ mov 24(up,nneg,8), %r15
+ mov %rdx, %r14
+ mov $0, R32(%r10) C xor?
+ mul q0
+ add 16(up,nneg,8), %r9
+ adc %rax, %r14
+ adc %rdx, %rbx
+ mov 16(mp,nneg,8), %rax
+ mul q0
+ lea 1(nneg), i
+ add %r14, %r15
+ imul u0inv, %r15
+ jmp L(e1)
+
+ ALIGN(16)
+L(li1): add %r10, (up,i,8)
+ adc %rax, %r9
+ mov (mp,i,8), %rax
+ adc %rdx, %r14
+ xor R32(%r10), R32(%r10)
+ mul q0
+ add %r9, 8(up,i,8)
+ adc %rax, %r14
+ adc %rdx, %rbx
+ mov 8(mp,i,8), %rax
+ mul q0
+L(e1): add %r14, 16(up,i,8)
+ adc %rax, %rbx
+ adc %rdx, %r10
+ mov 16(mp,i,8), %rax
+ mul q0
+ add %rbx, 24(up,i,8)
+ mov $0, R32(%r14) C zero
+ mov %r14, %rbx C zero
+ adc %rax, %r10
+ mov 24(mp,i,8), %rax
+ mov %r14, %r9 C zero
+ adc %rdx, %r9
+ mul q0
+ add $4, i
+ js L(li1)
+
+L(le1): add %r10, (up)
+ adc %rax, %r9
+ adc %r14, %rdx
+ add %r9, 8(up)
+ adc $0, %rdx
+ mov %rdx, 16(up,nneg,8) C up[0]
+ add $8, up
+ mov %r15, q0
+ dec n
+ jnz L(lo1)
+
+ mov nneg, n
+ sar $2, n
+ lea 24(up,nneg,8), up
+ lea (up,nneg,8), vp
+
+ mov -8(up), %r8
+ add -8(vp), %r8
+ mov %r8, (rp)
+ lea 8(rp), rp
+ jmp L(addx)
+
+
+ ALIGN(16)
+L(0m4):
+L(lo0): mov (mp,nneg,8), %rax
+ mov nneg, i
+ mul q0
+ xor R32(%r10), R32(%r10)
+ mov %rax, %r14
+ mov %rdx, %rbx
+ mov 8(mp,nneg,8), %rax
+ mov 24(up,nneg,8), %r15
+ mul q0
+ add 16(up,nneg,8), %r14
+ adc %rax, %rbx
+ adc %rdx, %r10
+ add %rbx, %r15
+ imul u0inv, %r15
+ jmp L(e0)
+
+ ALIGN(16)
+L(li0): add %r10, (up,i,8)
+ adc %rax, %r9
+ mov (mp,i,8), %rax
+ adc %rdx, %r14
+ xor R32(%r10), R32(%r10)
+ mul q0
+ add %r9, 8(up,i,8)
+ adc %rax, %r14
+ adc %rdx, %rbx
+ mov 8(mp,i,8), %rax
+ mul q0
+ add %r14, 16(up,i,8)
+ adc %rax, %rbx
+ adc %rdx, %r10
+L(e0): mov 16(mp,i,8), %rax
+ mul q0
+ add %rbx, 24(up,i,8)
+ mov $0, R32(%r14) C zero
+ mov %r14, %rbx C zero
+ adc %rax, %r10
+ mov 24(mp,i,8), %rax
+ mov %r14, %r9 C zero
+ adc %rdx, %r9
+ mul q0
+ add $4, i
+ js L(li0)
+
+L(le0): add %r10, (up)
+ adc %rax, %r9
+ adc %r14, %rdx
+ add %r9, 8(up)
+ adc $0, %rdx
+ mov %rdx, 16(up,nneg,8) C up[0]
+ add $8, up
+ mov %r15, q0
+ dec n
+ jnz L(lo0)
+
+ mov nneg, n
+ sar $2, n
+ clc
+ lea 16(up,nneg,8), up
+ lea (up,nneg,8), vp
+ jmp L(addy)
+
+
+ ALIGN(16)
+L(3m4):
+L(lo3): mov (mp,nneg,8), %rax
+ mul q0
+ mov %rax, %rbx
+ mov %rdx, %r10
+ mov 8(mp,nneg,8), %rax
+ mov 24(up,nneg,8), %r15
+ mul q0
+ add 16(up,nneg,8), %rbx C result is zero, might carry
+ mov $0, R32(%rbx) C zero
+ mov %rbx, %r14 C zero
+ adc %rax, %r10
+ mov 16(mp,nneg,8), %rax
+ mov %r14, %r9 C zero
+ adc %rdx, %r9
+ add %r10, %r15
+ mul q0
+ lea 3(nneg), i
+ imul u0inv, %r15
+C jmp L(li3)
+
+ ALIGN(16)
+L(li3): add %r10, (up,i,8)
+ adc %rax, %r9
+ mov (mp,i,8), %rax
+ adc %rdx, %r14
+ xor R32(%r10), R32(%r10)
+ mul q0
+ add %r9, 8(up,i,8)
+ adc %rax, %r14
+ adc %rdx, %rbx
+ mov 8(mp,i,8), %rax
+ mul q0
+ add %r14, 16(up,i,8)
+ adc %rax, %rbx
+ adc %rdx, %r10
+ mov 16(mp,i,8), %rax
+ mul q0
+ add %rbx, 24(up,i,8)
+ mov $0, R32(%r14) C zero
+ mov %r14, %rbx C zero
+ adc %rax, %r10
+ mov 24(mp,i,8), %rax
+ mov %r14, %r9 C zero
+ adc %rdx, %r9
+ mul q0
+ add $4, i
+ js L(li3)
+
+L(le3): add %r10, (up)
+ adc %rax, %r9
+ adc %r14, %rdx
+ add %r9, 8(up)
+ adc $0, %rdx
+ mov %rdx, 16(up,nneg,8) C up[0]
+ mov %r15, q0
+ lea 8(up), up
+ dec n
+ jnz L(lo3)
+
+
+C ==== Addition code ====
+ mov nneg, n
+ sar $2, n
+ lea 40(up,nneg,8), up
+ lea (up,nneg,8), vp
+
+ mov -24(up), %r8
+ mov -16(up), %r9
+ mov -8(up), %r10
+ add -24(vp), %r8
+ adc -16(vp), %r9
+ adc -8(vp), %r10
+ mov %r8, (rp)
+ mov %r9, 8(rp)
+ mov %r10, 16(rp)
+ lea 24(rp), rp
+
+L(addx):inc n
+ jz L(ad3)
+
+L(addy):mov (up), %r8
+ mov 8(up), %r9
+ inc n
+ jmp L(mid)
+
+C ALIGN(16)
+L(al3): adc (vp), %r8
+ adc 8(vp), %r9
+ adc 16(vp), %r10
+ adc 24(vp), %r11
+ mov %r8, (rp)
+ lea 32(up), up
+ mov %r9, 8(rp)
+ mov %r10, 16(rp)
+ inc n
+ mov %r11, 24(rp)
+ lea 32(vp), vp
+ mov (up), %r8
+ mov 8(up), %r9
+ lea 32(rp), rp
+L(mid): mov 16(up), %r10
+ mov 24(up), %r11
+ jnz L(al3)
+
+L(ae3): adc (vp), %r8
+ adc 8(vp), %r9
+ adc 16(vp), %r10
+ adc 24(vp), %r11
+ mov %r8, (rp)
+ mov %r9, 8(rp)
+ mov %r10, 16(rp)
+ mov %r11, 24(rp)
+
+L(ad3): mov R32(n), R32(%rax) C zero
+ adc R32(%rax), R32(%rax)
+
+L(ret): pop %r15
+ pop %r14
+ pop %r13
+ pop %r12
+ pop %rbx
+ pop %rbp
+ FUNC_EXIT()
+ ret
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/k8/sqr_basecase.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/k8/sqr_basecase.asm
new file mode 100644
index 00000000000..60cf945a465
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/k8/sqr_basecase.asm
@@ -0,0 +1,807 @@
+dnl AMD64 mpn_sqr_basecase.
+
+dnl Contributed to the GNU project by Torbjorn Granlund.
+
+dnl Copyright 2008, 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 The inner loops of this code are the result of running a code generation and
+C optimization tool suite written by David Harvey and Torbjorn Granlund.
+
+C NOTES
+C * There is a major stupidity in that we call mpn_mul_1 initially, for a
+C large trip count. Instead, we should follow the generic/sqr_basecase.c
+C code which uses addmul_2s from the start, conditionally leaving a 1x1
+C multiply to the end. (In assembly code, one would stop invoking
+C addmul_2s loops when perhaps 3x2s respectively a 2x2s remains.)
+C * Another stupidity is in the sqr_diag_addlsh1 code. It does not need to
+C save/restore carry, instead it can propagate into the high product word.
+C * Align more labels, should shave off a few cycles.
+C * We can safely use 32-bit size operations, since operands with (2^32)
+C limbs will lead to non-termination in practice.
+C * The jump table could probably be optimized, at least for non-pic.
+C * The special code for n <= 4 was quickly written. It is probably too
+C large and unnecessarily slow.
+C * Consider combining small cases code so that the n=k-1 code jumps into the
+C middle of the n=k code.
+C * Avoid saving registers for small cases code.
+C * Needed variables:
+C n r11 input size
+C i r8 work left, initially n
+C j r9 inner loop count
+C r15 unused
+C v0 r13
+C v1 r14
+C rp rdi
+C up rsi
+C w0 rbx
+C w1 rcx
+C w2 rbp
+C w3 r10
+C tp r12
+C lo rax
+C hi rdx
+C rsp
+
+C INPUT PARAMETERS
+define(`rp', `%rdi')
+define(`up', `%rsi')
+define(`n_param', `%rdx')
+
+define(`n', `%r11')
+define(`tp', `%r12')
+define(`i', `%r8')
+define(`j', `%r9')
+define(`v0', `%r13')
+define(`v1', `%r14')
+define(`w0', `%rbx')
+define(`w1', `%rcx')
+define(`w2', `%rbp')
+define(`w3', `%r10')
+
+ABI_SUPPORT(DOS64)
+ABI_SUPPORT(STD64)
+
+ASM_START()
+ TEXT
+ ALIGN(16)
+PROLOGUE(mpn_sqr_basecase)
+ FUNC_ENTRY(3)
+ mov R32(n_param), R32(%rcx)
+ mov R32(n_param), R32(n) C free original n register (rdx)
+
+ add $-40, %rsp
+
+ and $3, R32(%rcx)
+ cmp $4, R32(n_param)
+ lea 4(%rcx), %r8
+
+ mov %rbx, 32(%rsp)
+ mov %rbp, 24(%rsp)
+ mov %r12, 16(%rsp)
+ mov %r13, 8(%rsp)
+ mov %r14, (%rsp)
+
+ cmovg %r8, %rcx
+
+ lea L(tab)(%rip), %rax
+ifdef(`PIC',
+` movslq (%rax,%rcx,4), %r10
+ add %r10, %rax
+ jmp *%rax
+',`
+ jmp *(%rax,%rcx,8)
+')
+ JUMPTABSECT
+ ALIGN(8)
+L(tab): JMPENT( L(4), L(tab))
+ JMPENT( L(1), L(tab))
+ JMPENT( L(2), L(tab))
+ JMPENT( L(3), L(tab))
+ JMPENT( L(0m4), L(tab))
+ JMPENT( L(1m4), L(tab))
+ JMPENT( L(2m4), L(tab))
+ JMPENT( L(3m4), L(tab))
+ TEXT
+
+L(1): mov (up), %rax
+ mul %rax
+ add $40, %rsp
+ mov %rax, (rp)
+ mov %rdx, 8(rp)
+ FUNC_EXIT()
+ ret
+
+L(2): mov (up), %rax
+ mov %rax, %r8
+ mul %rax
+ mov 8(up), %r11
+ mov %rax, (rp)
+ mov %r11, %rax
+ mov %rdx, %r9
+ mul %rax
+ add $40, %rsp
+ mov %rax, %r10
+ mov %r11, %rax
+ mov %rdx, %r11
+ mul %r8
+ xor %r8, %r8
+ add %rax, %r9
+ adc %rdx, %r10
+ adc %r8, %r11
+ add %rax, %r9
+ mov %r9, 8(rp)
+ adc %rdx, %r10
+ mov %r10, 16(rp)
+ adc %r8, %r11
+ mov %r11, 24(rp)
+ FUNC_EXIT()
+ ret
+
+L(3): mov (up), %rax
+ mov %rax, %r10
+ mul %rax
+ mov 8(up), %r11
+ mov %rax, (rp)
+ mov %r11, %rax
+ mov %rdx, 8(rp)
+ mul %rax
+ mov 16(up), %rcx
+ mov %rax, 16(rp)
+ mov %rcx, %rax
+ mov %rdx, 24(rp)
+ mul %rax
+ mov %rax, 32(rp)
+ mov %rdx, 40(rp)
+
+ mov %r11, %rax
+ mul %r10
+ mov %rax, %r8
+ mov %rcx, %rax
+ mov %rdx, %r9
+ mul %r10
+ xor %r10, %r10
+ add %rax, %r9
+ mov %r11, %rax
+ mov %r10, %r11
+ adc %rdx, %r10
+
+ mul %rcx
+ add $40, %rsp
+ add %rax, %r10
+ adc %r11, %rdx
+ add %r8, %r8
+ adc %r9, %r9
+ adc %r10, %r10
+ adc %rdx, %rdx
+ adc %r11, %r11
+ add %r8, 8(rp)
+ adc %r9, 16(rp)
+ adc %r10, 24(rp)
+ adc %rdx, 32(rp)
+ adc %r11, 40(rp)
+ FUNC_EXIT()
+ ret
+
+L(4): mov (up), %rax
+ mov %rax, %r11
+ mul %rax
+ mov 8(up), %rbx
+ mov %rax, (rp)
+ mov %rbx, %rax
+ mov %rdx, 8(rp)
+ mul %rax
+ mov %rax, 16(rp)
+ mov %rdx, 24(rp)
+ mov 16(up), %rax
+ mul %rax
+ mov %rax, 32(rp)
+ mov %rdx, 40(rp)
+ mov 24(up), %rax
+ mul %rax
+ mov %rax, 48(rp)
+ mov %rbx, %rax
+ mov %rdx, 56(rp)
+
+ mul %r11
+ add $32, %rsp
+ mov %rax, %r8
+ mov %rdx, %r9
+ mov 16(up), %rax
+ mul %r11
+ xor %r10, %r10
+ add %rax, %r9
+ adc %rdx, %r10
+ mov 24(up), %rax
+ mul %r11
+ xor %r11, %r11
+ add %rax, %r10
+ adc %rdx, %r11
+ mov 16(up), %rax
+ mul %rbx
+ xor %rcx, %rcx
+ add %rax, %r10
+ adc %rdx, %r11
+ adc $0, %rcx
+ mov 24(up), %rax
+ mul %rbx
+ pop %rbx
+ add %rax, %r11
+ adc %rdx, %rcx
+ mov 16(up), %rdx
+ mov 24(up), %rax
+ mul %rdx
+ add %rax, %rcx
+ adc $0, %rdx
+
+ add %r8, %r8
+ adc %r9, %r9
+ adc %r10, %r10
+ adc %r11, %r11
+ adc %rcx, %rcx
+ mov $0, R32(%rax)
+ adc %rdx, %rdx
+
+ adc %rax, %rax
+ add %r8, 8(rp)
+ adc %r9, 16(rp)
+ adc %r10, 24(rp)
+ adc %r11, 32(rp)
+ adc %rcx, 40(rp)
+ adc %rdx, 48(rp)
+ adc %rax, 56(rp)
+ FUNC_EXIT()
+ ret
+
+
+L(0m4):
+ lea -16(rp,n,8), tp C point tp in middle of result operand
+ mov (up), v0
+ mov 8(up), %rax
+ lea (up,n,8), up C point up at end of input operand
+
+ lea -4(n), i
+C Function mpn_mul_1_m3(tp, up - i, i, up[-i - 1])
+ xor R32(j), R32(j)
+ sub n, j
+
+ mul v0
+ xor R32(w2), R32(w2)
+ mov %rax, w0
+ mov 16(up,j,8), %rax
+ mov %rdx, w3
+ jmp L(L3)
+
+ ALIGN(16)
+L(mul_1_m3_top):
+ add %rax, w2
+ mov w3, (tp,j,8)
+ mov (up,j,8), %rax
+ adc %rdx, w1
+ xor R32(w0), R32(w0)
+ mul v0
+ xor R32(w3), R32(w3)
+ mov w2, 8(tp,j,8)
+ add %rax, w1
+ adc %rdx, w0
+ mov 8(up,j,8), %rax
+ mov w1, 16(tp,j,8)
+ xor R32(w2), R32(w2)
+ mul v0
+ add %rax, w0
+ mov 16(up,j,8), %rax
+ adc %rdx, w3
+L(L3): xor R32(w1), R32(w1)
+ mul v0
+ add %rax, w3
+ mov 24(up,j,8), %rax
+ adc %rdx, w2
+ mov w0, 24(tp,j,8)
+ mul v0
+ add $4, j
+ js L(mul_1_m3_top)
+
+ add %rax, w2
+ mov w3, (tp)
+ adc %rdx, w1
+ mov w2, 8(tp)
+ mov w1, 16(tp)
+
+ lea eval(2*8)(tp), tp C tp += 2
+ lea -8(up), up
+ jmp L(dowhile)
+
+
+L(1m4):
+ lea 8(rp,n,8), tp C point tp in middle of result operand
+ mov (up), v0 C u0
+ mov 8(up), %rax C u1
+ lea 8(up,n,8), up C point up at end of input operand
+
+ lea -3(n), i
+C Function mpn_mul_2s_m0(tp, up - i, i, up - i - 1)
+ lea -3(n), j
+ neg j
+
+ mov %rax, v1 C u1
+ mul v0 C u0 * u1
+ mov %rdx, w1
+ xor R32(w2), R32(w2)
+ mov %rax, 8(rp)
+ jmp L(m0)
+
+ ALIGN(16)
+L(mul_2_m0_top):
+ mul v1
+ add %rax, w0
+ adc %rdx, w1
+ mov -24(up,j,8), %rax
+ mov $0, R32(w2)
+ mul v0
+ add %rax, w0
+ mov -24(up,j,8), %rax
+ adc %rdx, w1
+ adc $0, R32(w2)
+ mul v1 C v1 * u0
+ add %rax, w1
+ mov w0, -24(tp,j,8)
+ adc %rdx, w2
+L(m0): mov -16(up,j,8), %rax C u2, u6 ...
+ mul v0 C u0 * u2
+ mov $0, R32(w3)
+ add %rax, w1
+ adc %rdx, w2
+ mov -16(up,j,8), %rax
+ adc $0, R32(w3)
+ mov $0, R32(w0)
+ mov w1, -16(tp,j,8)
+ mul v1
+ add %rax, w2
+ mov -8(up,j,8), %rax
+ adc %rdx, w3
+ mov $0, R32(w1)
+ mul v0
+ add %rax, w2
+ mov -8(up,j,8), %rax
+ adc %rdx, w3
+ adc $0, R32(w0)
+ mul v1
+ add %rax, w3
+ mov w2, -8(tp,j,8)
+ adc %rdx, w0
+L(m2x): mov (up,j,8), %rax
+ mul v0
+ add %rax, w3
+ adc %rdx, w0
+ adc $0, R32(w1)
+ add $4, j
+ mov -32(up,j,8), %rax
+ mov w3, -32(tp,j,8)
+ js L(mul_2_m0_top)
+
+ mul v1
+ add %rax, w0
+ adc %rdx, w1
+ mov w0, -8(tp)
+ mov w1, (tp)
+
+ lea -16(up), up
+ lea eval(3*8-24)(tp), tp C tp += 3
+ jmp L(dowhile_end)
+
+
+L(2m4):
+ lea -16(rp,n,8), tp C point tp in middle of result operand
+ mov (up), v0
+ mov 8(up), %rax
+ lea (up,n,8), up C point up at end of input operand
+
+ lea -4(n), i
+C Function mpn_mul_1_m1(tp, up - (i - 1), i - 1, up[-i])
+ lea -2(n), j
+ neg j
+
+ mul v0
+ mov %rax, w2
+ mov (up,j,8), %rax
+ mov %rdx, w1
+ jmp L(L1)
+
+ ALIGN(16)
+L(mul_1_m1_top):
+ add %rax, w2
+ mov w3, (tp,j,8)
+ mov (up,j,8), %rax
+ adc %rdx, w1
+L(L1): xor R32(w0), R32(w0)
+ mul v0
+ xor R32(w3), R32(w3)
+ mov w2, 8(tp,j,8)
+ add %rax, w1
+ adc %rdx, w0
+ mov 8(up,j,8), %rax
+ mov w1, 16(tp,j,8)
+ xor R32(w2), R32(w2)
+ mul v0
+ add %rax, w0
+ mov 16(up,j,8), %rax
+ adc %rdx, w3
+ xor R32(w1), R32(w1)
+ mul v0
+ add %rax, w3
+ mov 24(up,j,8), %rax
+ adc %rdx, w2
+ mov w0, 24(tp,j,8)
+ mul v0
+ add $4, j
+ js L(mul_1_m1_top)
+
+ add %rax, w2
+ mov w3, (tp)
+ adc %rdx, w1
+ mov w2, 8(tp)
+ mov w1, 16(tp)
+
+ lea eval(2*8)(tp), tp C tp += 2
+ lea -8(up), up
+ jmp L(dowhile_mid)
+
+
+L(3m4):
+ lea 8(rp,n,8), tp C point tp in middle of result operand
+ mov (up), v0 C u0
+ mov 8(up), %rax C u1
+ lea 8(up,n,8), up C point up at end of input operand
+
+ lea -5(n), i
+C Function mpn_mul_2s_m2(tp, up - i + 1, i - 1, up - i)
+ lea -1(n), j
+ neg j
+
+ mov %rax, v1 C u1
+ mul v0 C u0 * u1
+ mov %rdx, w3
+ xor R32(w0), R32(w0)
+ xor R32(w1), R32(w1)
+ mov %rax, 8(rp)
+ jmp L(m2)
+
+ ALIGN(16)
+L(mul_2_m2_top):
+ mul v1
+ add %rax, w0
+ adc %rdx, w1
+ mov -24(up,j,8), %rax
+ mov $0, R32(w2)
+ mul v0
+ add %rax, w0
+ mov -24(up,j,8), %rax
+ adc %rdx, w1
+ adc $0, R32(w2)
+ mul v1 C v1 * u0
+ add %rax, w1
+ mov w0, -24(tp,j,8)
+ adc %rdx, w2
+ mov -16(up,j,8), %rax
+ mul v0
+ mov $0, R32(w3)
+ add %rax, w1
+ adc %rdx, w2
+ mov -16(up,j,8), %rax
+ adc $0, R32(w3)
+ mov $0, R32(w0)
+ mov w1, -16(tp,j,8)
+ mul v1
+ add %rax, w2
+ mov -8(up,j,8), %rax
+ adc %rdx, w3
+ mov $0, R32(w1)
+ mul v0
+ add %rax, w2
+ mov -8(up,j,8), %rax
+ adc %rdx, w3
+ adc $0, R32(w0)
+ mul v1
+ add %rax, w3
+ mov w2, -8(tp,j,8)
+ adc %rdx, w0
+L(m2): mov (up,j,8), %rax
+ mul v0
+ add %rax, w3
+ adc %rdx, w0
+ adc $0, R32(w1)
+ add $4, j
+ mov -32(up,j,8), %rax
+ mov w3, -32(tp,j,8)
+ js L(mul_2_m2_top)
+
+ mul v1
+ add %rax, w0
+ adc %rdx, w1
+ mov w0, -8(tp)
+ mov w1, (tp)
+
+ lea -16(up), up
+ jmp L(dowhile_mid)
+
+L(dowhile):
+C Function mpn_addmul_2s_m2(tp, up - (i - 1), i - 1, up - i)
+ lea 4(i), j
+ neg j
+
+ mov 16(up,j,8), v0
+ mov 24(up,j,8), v1
+ mov 24(up,j,8), %rax
+ mul v0
+ xor R32(w3), R32(w3)
+ add %rax, 24(tp,j,8)
+ adc %rdx, w3
+ xor R32(w0), R32(w0)
+ xor R32(w1), R32(w1)
+ jmp L(am2)
+
+ ALIGN(16)
+L(addmul_2_m2_top):
+ add w3, (tp,j,8)
+ adc %rax, w0
+ mov 8(up,j,8), %rax
+ adc %rdx, w1
+ mov $0, R32(w2)
+ mul v0
+ add %rax, w0
+ mov 8(up,j,8), %rax
+ adc %rdx, w1
+ adc $0, R32(w2)
+ mul v1 C v1 * u0
+ add w0, 8(tp,j,8)
+ adc %rax, w1
+ adc %rdx, w2
+ mov 16(up,j,8), %rax
+ mov $0, R32(w3)
+ mul v0 C v0 * u1
+ add %rax, w1
+ mov 16(up,j,8), %rax
+ adc %rdx, w2
+ adc $0, R32(w3)
+ mul v1 C v1 * u1
+ add w1, 16(tp,j,8)
+ adc %rax, w2
+ mov 24(up,j,8), %rax
+ adc %rdx, w3
+ mul v0
+ mov $0, R32(w0)
+ add %rax, w2
+ adc %rdx, w3
+ mov $0, R32(w1)
+ mov 24(up,j,8), %rax
+ adc $0, R32(w0)
+ mul v1
+ add w2, 24(tp,j,8)
+ adc %rax, w3
+ adc %rdx, w0
+L(am2): mov 32(up,j,8), %rax
+ mul v0
+ add %rax, w3
+ mov 32(up,j,8), %rax
+ adc %rdx, w0
+ adc $0, R32(w1)
+ mul v1
+ add $4, j
+ js L(addmul_2_m2_top)
+
+ add w3, (tp)
+ adc %rax, w0
+ adc %rdx, w1
+ mov w0, 8(tp)
+ mov w1, 16(tp)
+
+ lea eval(2*8)(tp), tp C tp += 2
+
+ add $-2, R32(i) C i -= 2
+
+L(dowhile_mid):
+C Function mpn_addmul_2s_m0(tp, up - (i - 1), i - 1, up - i)
+ lea 2(i), j
+ neg j
+
+ mov (up,j,8), v0
+ mov 8(up,j,8), v1
+ mov 8(up,j,8), %rax
+ mul v0
+ xor R32(w1), R32(w1)
+ add %rax, 8(tp,j,8)
+ adc %rdx, w1
+ xor R32(w2), R32(w2)
+ jmp L(20)
+
+ ALIGN(16)
+L(addmul_2_m0_top):
+ add w3, (tp,j,8)
+ adc %rax, w0
+ mov 8(up,j,8), %rax
+ adc %rdx, w1
+ mov $0, R32(w2)
+ mul v0
+ add %rax, w0
+ mov 8(up,j,8), %rax
+ adc %rdx, w1
+ adc $0, R32(w2)
+ mul v1 C v1 * u0
+ add w0, 8(tp,j,8)
+ adc %rax, w1
+ adc %rdx, w2
+L(20): mov 16(up,j,8), %rax
+ mov $0, R32(w3)
+ mul v0 C v0 * u1
+ add %rax, w1
+ mov 16(up,j,8), %rax
+ adc %rdx, w2
+ adc $0, R32(w3)
+ mul v1 C v1 * u1
+ add w1, 16(tp,j,8)
+ adc %rax, w2
+ mov 24(up,j,8), %rax
+ adc %rdx, w3
+ mul v0
+ mov $0, R32(w0)
+ add %rax, w2
+ adc %rdx, w3
+ mov $0, R32(w1)
+ mov 24(up,j,8), %rax
+ adc $0, R32(w0)
+ mul v1
+ add w2, 24(tp,j,8)
+ adc %rax, w3
+ adc %rdx, w0
+ mov 32(up,j,8), %rax
+ mul v0
+ add %rax, w3
+ mov 32(up,j,8), %rax
+ adc %rdx, w0
+ adc $0, R32(w1)
+ mul v1
+ add $4, j
+ js L(addmul_2_m0_top)
+
+ add w3, (tp)
+ adc %rax, w0
+ adc %rdx, w1
+ mov w0, 8(tp)
+ mov w1, 16(tp)
+
+ lea eval(2*8)(tp), tp C tp += 2
+L(dowhile_end):
+
+ add $-2, R32(i) C i -= 2
+ jne L(dowhile)
+
+C Function mpn_addmul_2s_2
+ mov -16(up), v0
+ mov -8(up), v1
+ mov -8(up), %rax
+ mul v0
+ xor R32(w3), R32(w3)
+ add %rax, -8(tp)
+ adc %rdx, w3
+ xor R32(w0), R32(w0)
+ xor R32(w1), R32(w1)
+ mov (up), %rax
+ mul v0
+ add %rax, w3
+ mov (up), %rax
+ adc %rdx, w0
+ mul v1
+ add w3, (tp)
+ adc %rax, w0
+ adc %rdx, w1
+ mov w0, 8(tp)
+ mov w1, 16(tp)
+
+C Function mpn_sqr_diag_addlsh1
+ lea -4(n,n), j
+
+ mov 8(rp), %r11
+ lea -8(up), up
+ lea (rp,j,8), rp
+ neg j
+ mov (up,j,4), %rax
+ mul %rax
+ test $2, R8(j)
+ jnz L(odd)
+
+L(evn): add %r11, %r11
+ sbb R32(%rbx), R32(%rbx) C save CF
+ add %rdx, %r11
+ mov %rax, (rp,j,8)
+ jmp L(d0)
+
+L(odd): add %r11, %r11
+ sbb R32(%rbp), R32(%rbp) C save CF
+ add %rdx, %r11
+ mov %rax, (rp,j,8)
+ lea -2(j), j
+ jmp L(d1)
+
+ ALIGN(16)
+L(top): mov (up,j,4), %rax
+ mul %rax
+ add R32(%rbp), R32(%rbp) C restore carry
+ adc %rax, %r10
+ adc %rdx, %r11
+ mov %r10, (rp,j,8)
+L(d0): mov %r11, 8(rp,j,8)
+ mov 16(rp,j,8), %r10
+ adc %r10, %r10
+ mov 24(rp,j,8), %r11
+ adc %r11, %r11
+ nop
+ sbb R32(%rbp), R32(%rbp) C save CF
+ mov 8(up,j,4), %rax
+ mul %rax
+ add R32(%rbx), R32(%rbx) C restore carry
+ adc %rax, %r10
+ adc %rdx, %r11
+ mov %r10, 16(rp,j,8)
+L(d1): mov %r11, 24(rp,j,8)
+ mov 32(rp,j,8), %r10
+ adc %r10, %r10
+ mov 40(rp,j,8), %r11
+ adc %r11, %r11
+ sbb R32(%rbx), R32(%rbx) C save CF
+ add $4, j
+ js L(top)
+
+ mov (up), %rax
+ mul %rax
+ add R32(%rbp), R32(%rbp) C restore carry
+ adc %rax, %r10
+ adc %rdx, %r11
+ mov %r10, (rp)
+ mov %r11, 8(rp)
+ mov 16(rp), %r10
+ adc %r10, %r10
+ sbb R32(%rbp), R32(%rbp) C save CF
+ neg R32(%rbp)
+ mov 8(up), %rax
+ mul %rax
+ add R32(%rbx), R32(%rbx) C restore carry
+ adc %rax, %r10
+ adc %rbp, %rdx
+ mov %r10, 16(rp)
+ mov %rdx, 24(rp)
+
+ pop %r14
+ pop %r13
+ pop %r12
+ pop %rbp
+ pop %rbx
+ FUNC_EXIT()
+ ret
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/logops_n.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/logops_n.asm
new file mode 100644
index 00000000000..b277f589624
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/logops_n.asm
@@ -0,0 +1,244 @@
+dnl AMD64 logops.
+
+dnl Copyright 2004-2006, 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/limb
+C AMD K8,K9 1.5 with fluctuations for variant 2 and 3
+C AMD K10 1.5 with fluctuations for all variants
+C Intel P4 2.8/3.35/3.60 (variant1/variant2/variant3)
+C Intel core2 2
+C Intel NHM 2
+C Intel SBR 1.5/1.75/1.75
+C Intel atom 3.75
+C VIA nano 3.25
+
+ifdef(`OPERATION_and_n',`
+ define(`func',`mpn_and_n')
+ define(`VARIANT_1')
+ define(`LOGOP',`andq')')
+ifdef(`OPERATION_andn_n',`
+ define(`func',`mpn_andn_n')
+ define(`VARIANT_2')
+ define(`LOGOP',`andq')')
+ifdef(`OPERATION_nand_n',`
+ define(`func',`mpn_nand_n')
+ define(`VARIANT_3')
+ define(`LOGOP',`andq')')
+ifdef(`OPERATION_ior_n',`
+ define(`func',`mpn_ior_n')
+ define(`VARIANT_1')
+ define(`LOGOP',`orq')')
+ifdef(`OPERATION_iorn_n',`
+ define(`func',`mpn_iorn_n')
+ define(`VARIANT_2')
+ define(`LOGOP',`orq')')
+ifdef(`OPERATION_nior_n',`
+ define(`func',`mpn_nior_n')
+ define(`VARIANT_3')
+ define(`LOGOP',`orq')')
+ifdef(`OPERATION_xor_n',`
+ define(`func',`mpn_xor_n')
+ define(`VARIANT_1')
+ define(`LOGOP',`xorq')')
+ifdef(`OPERATION_xnor_n',`
+ define(`func',`mpn_xnor_n')
+ define(`VARIANT_2')
+ define(`LOGOP',`xorq')')
+
+
+MULFUNC_PROLOGUE(mpn_and_n mpn_andn_n mpn_nand_n mpn_ior_n mpn_iorn_n mpn_nior_n mpn_xor_n mpn_xnor_n)
+
+C INPUT PARAMETERS
+define(`rp',`%rdi')
+define(`up',`%rsi')
+define(`vp',`%rdx')
+define(`n',`%rcx')
+
+ABI_SUPPORT(DOS64)
+ABI_SUPPORT(STD64)
+
+ASM_START()
+
+ifdef(`VARIANT_1',`
+ TEXT
+ ALIGN(32)
+PROLOGUE(func)
+ FUNC_ENTRY(4)
+ movq (vp), %r8
+ movl R32(%rcx), R32(%rax)
+ leaq (vp,n,8), vp
+ leaq (up,n,8), up
+ leaq (rp,n,8), rp
+ negq n
+ andl $3, R32(%rax)
+ je L(b00)
+ cmpl $2, R32(%rax)
+ jc L(b01)
+ je L(b10)
+
+L(b11): LOGOP (up,n,8), %r8
+ movq %r8, (rp,n,8)
+ decq n
+ jmp L(e11)
+L(b10): addq $-2, n
+ jmp L(e10)
+L(b01): LOGOP (up,n,8), %r8
+ movq %r8, (rp,n,8)
+ incq n
+ jz L(ret)
+
+L(oop): movq (vp,n,8), %r8
+L(b00): movq 8(vp,n,8), %r9
+ LOGOP (up,n,8), %r8
+ LOGOP 8(up,n,8), %r9
+ nop
+ movq %r8, (rp,n,8)
+ movq %r9, 8(rp,n,8)
+L(e11): movq 16(vp,n,8), %r8
+L(e10): movq 24(vp,n,8), %r9
+ LOGOP 16(up,n,8), %r8
+ LOGOP 24(up,n,8), %r9
+ movq %r8, 16(rp,n,8)
+ movq %r9, 24(rp,n,8)
+ addq $4, n
+ jnc L(oop)
+L(ret): FUNC_EXIT()
+ ret
+EPILOGUE()
+')
+
+ifdef(`VARIANT_2',`
+ TEXT
+ ALIGN(32)
+PROLOGUE(func)
+ FUNC_ENTRY(4)
+ movq (vp), %r8
+ notq %r8
+ movl R32(%rcx), R32(%rax)
+ leaq (vp,n,8), vp
+ leaq (up,n,8), up
+ leaq (rp,n,8), rp
+ negq n
+ andl $3, R32(%rax)
+ je L(b00)
+ cmpl $2, R32(%rax)
+ jc L(b01)
+ je L(b10)
+
+L(b11): LOGOP (up,n,8), %r8
+ movq %r8, (rp,n,8)
+ decq n
+ jmp L(e11)
+L(b10): addq $-2, n
+ jmp L(e10)
+ .byte 0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90
+L(b01): LOGOP (up,n,8), %r8
+ movq %r8, (rp,n,8)
+ incq n
+ jz L(ret)
+
+L(oop): movq (vp,n,8), %r8
+ notq %r8
+L(b00): movq 8(vp,n,8), %r9
+ notq %r9
+ LOGOP (up,n,8), %r8
+ LOGOP 8(up,n,8), %r9
+ movq %r8, (rp,n,8)
+ movq %r9, 8(rp,n,8)
+L(e11): movq 16(vp,n,8), %r8
+ notq %r8
+L(e10): movq 24(vp,n,8), %r9
+ notq %r9
+ LOGOP 16(up,n,8), %r8
+ LOGOP 24(up,n,8), %r9
+ movq %r8, 16(rp,n,8)
+ movq %r9, 24(rp,n,8)
+ addq $4, n
+ jnc L(oop)
+L(ret): FUNC_EXIT()
+ ret
+EPILOGUE()
+')
+
+ifdef(`VARIANT_3',`
+ TEXT
+ ALIGN(32)
+PROLOGUE(func)
+ FUNC_ENTRY(4)
+ movq (vp), %r8
+ movl R32(%rcx), R32(%rax)
+ leaq (vp,n,8), vp
+ leaq (up,n,8), up
+ leaq (rp,n,8), rp
+ negq n
+ andl $3, R32(%rax)
+ je L(b00)
+ cmpl $2, R32(%rax)
+ jc L(b01)
+ je L(b10)
+
+L(b11): LOGOP (up,n,8), %r8
+ notq %r8
+ movq %r8, (rp,n,8)
+ decq n
+ jmp L(e11)
+L(b10): addq $-2, n
+ jmp L(e10)
+ .byte 0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90
+L(b01): LOGOP (up,n,8), %r8
+ notq %r8
+ movq %r8, (rp,n,8)
+ incq n
+ jz L(ret)
+
+L(oop): movq (vp,n,8), %r8
+L(b00): movq 8(vp,n,8), %r9
+ LOGOP (up,n,8), %r8
+ notq %r8
+ LOGOP 8(up,n,8), %r9
+ notq %r9
+ movq %r8, (rp,n,8)
+ movq %r9, 8(rp,n,8)
+L(e11): movq 16(vp,n,8), %r8
+L(e10): movq 24(vp,n,8), %r9
+ LOGOP 16(up,n,8), %r8
+ notq %r8
+ LOGOP 24(up,n,8), %r9
+ notq %r9
+ movq %r8, 16(rp,n,8)
+ movq %r9, 24(rp,n,8)
+ addq $4, n
+ jnc L(oop)
+L(ret): FUNC_EXIT()
+ ret
+EPILOGUE()
+')
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/lshift.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/lshift.asm
new file mode 100644
index 00000000000..f368944b85d
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/lshift.asm
@@ -0,0 +1,247 @@
+dnl AMD64 mpn_lshift -- mpn left shift.
+
+dnl Copyright 2003, 2005, 2007, 2009, 2011, 2012 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 cycles/limb cnt=1
+C AMD K8,K9 2.375 1.375
+C AMD K10 2.375 1.375
+C Intel P4 8 10.5
+C Intel core2 2.11 4.28
+C Intel corei ? ?
+C Intel atom 5.75 3.5
+C VIA nano 3.5 2.25
+
+
+C INPUT PARAMETERS
+define(`rp', `%rdi')
+define(`up', `%rsi')
+define(`n', `%rdx')
+define(`cnt', `%rcx')
+
+ABI_SUPPORT(DOS64)
+ABI_SUPPORT(STD64)
+
+ASM_START()
+ TEXT
+ ALIGN(32)
+PROLOGUE(mpn_lshift)
+ FUNC_ENTRY(4)
+ cmp $1, R8(%rcx)
+ jne L(gen)
+
+C For cnt=1 we want to work from lowest limb towards higher limbs.
+C Check for bad overlap (up=rp is OK!) up=rp+1..rp+n-1 is bad.
+C FIXME: this could surely be done more cleverly.
+
+ mov rp, %rax
+ sub up, %rax
+ je L(fwd) C rp = up
+ shr $3, %rax
+ cmp n, %rax
+ jb L(gen)
+
+L(fwd): mov R32(n), R32(%rax)
+ shr $2, n
+ je L(e1)
+ and $3, R32(%rax)
+
+ ALIGN(8)
+ nop
+ nop
+L(t1): mov (up), %r8
+ mov 8(up), %r9
+ mov 16(up), %r10
+ mov 24(up), %r11
+ lea 32(up), up
+ adc %r8, %r8
+ mov %r8, (rp)
+ adc %r9, %r9
+ mov %r9, 8(rp)
+ adc %r10, %r10
+ mov %r10, 16(rp)
+ adc %r11, %r11
+ mov %r11, 24(rp)
+ lea 32(rp), rp
+ dec n
+ jne L(t1)
+
+ inc R32(%rax)
+ dec R32(%rax)
+ jne L(n00)
+ adc R32(%rax), R32(%rax)
+ FUNC_EXIT()
+ ret
+L(e1): test R32(%rax), R32(%rax) C clear cy
+L(n00): mov (up), %r8
+ dec R32(%rax)
+ jne L(n01)
+ adc %r8, %r8
+ mov %r8, (rp)
+L(ret): adc R32(%rax), R32(%rax)
+ FUNC_EXIT()
+ ret
+L(n01): dec R32(%rax)
+ mov 8(up), %r9
+ jne L(n10)
+ adc %r8, %r8
+ adc %r9, %r9
+ mov %r8, (rp)
+ mov %r9, 8(rp)
+ adc R32(%rax), R32(%rax)
+ FUNC_EXIT()
+ ret
+L(n10): mov 16(up), %r10
+ adc %r8, %r8
+ adc %r9, %r9
+ adc %r10, %r10
+ mov %r8, (rp)
+ mov %r9, 8(rp)
+ mov %r10, 16(rp)
+ adc $-1, R32(%rax)
+ FUNC_EXIT()
+ ret
+
+L(gen): neg R32(%rcx) C put rsh count in cl
+ mov -8(up,n,8), %rax
+ shr R8(%rcx), %rax C function return value
+
+ neg R32(%rcx) C put lsh count in cl
+ lea 1(n), R32(%r8)
+ and $3, R32(%r8)
+ je L(rlx) C jump for n = 3, 7, 11, ...
+
+ dec R32(%r8)
+ jne L(1)
+C n = 4, 8, 12, ...
+ mov -8(up,n,8), %r10
+ shl R8(%rcx), %r10
+ neg R32(%rcx) C put rsh count in cl
+ mov -16(up,n,8), %r8
+ shr R8(%rcx), %r8
+ or %r8, %r10
+ mov %r10, -8(rp,n,8)
+ dec n
+ jmp L(rll)
+
+L(1): dec R32(%r8)
+ je L(1x) C jump for n = 1, 5, 9, 13, ...
+C n = 2, 6, 10, 16, ...
+ mov -8(up,n,8), %r10
+ shl R8(%rcx), %r10
+ neg R32(%rcx) C put rsh count in cl
+ mov -16(up,n,8), %r8
+ shr R8(%rcx), %r8
+ or %r8, %r10
+ mov %r10, -8(rp,n,8)
+ dec n
+ neg R32(%rcx) C put lsh count in cl
+L(1x):
+ cmp $1, n
+ je L(ast)
+ mov -8(up,n,8), %r10
+ shl R8(%rcx), %r10
+ mov -16(up,n,8), %r11
+ shl R8(%rcx), %r11
+ neg R32(%rcx) C put rsh count in cl
+ mov -16(up,n,8), %r8
+ mov -24(up,n,8), %r9
+ shr R8(%rcx), %r8
+ or %r8, %r10
+ shr R8(%rcx), %r9
+ or %r9, %r11
+ mov %r10, -8(rp,n,8)
+ mov %r11, -16(rp,n,8)
+ sub $2, n
+
+L(rll): neg R32(%rcx) C put lsh count in cl
+L(rlx): mov -8(up,n,8), %r10
+ shl R8(%rcx), %r10
+ mov -16(up,n,8), %r11
+ shl R8(%rcx), %r11
+
+ sub $4, n C 4
+ jb L(end) C 2
+ ALIGN(16)
+L(top):
+ C finish stuff from lsh block
+ neg R32(%rcx) C put rsh count in cl
+ mov 16(up,n,8), %r8
+ mov 8(up,n,8), %r9
+ shr R8(%rcx), %r8
+ or %r8, %r10
+ shr R8(%rcx), %r9
+ or %r9, %r11
+ mov %r10, 24(rp,n,8)
+ mov %r11, 16(rp,n,8)
+ C start two new rsh
+ mov 0(up,n,8), %r8
+ mov -8(up,n,8), %r9
+ shr R8(%rcx), %r8
+ shr R8(%rcx), %r9
+
+ C finish stuff from rsh block
+ neg R32(%rcx) C put lsh count in cl
+ mov 8(up,n,8), %r10
+ mov 0(up,n,8), %r11
+ shl R8(%rcx), %r10
+ or %r10, %r8
+ shl R8(%rcx), %r11
+ or %r11, %r9
+ mov %r8, 8(rp,n,8)
+ mov %r9, 0(rp,n,8)
+ C start two new lsh
+ mov -8(up,n,8), %r10
+ mov -16(up,n,8), %r11
+ shl R8(%rcx), %r10
+ shl R8(%rcx), %r11
+
+ sub $4, n
+ jae L(top) C 2
+L(end):
+ neg R32(%rcx) C put rsh count in cl
+ mov 8(up), %r8
+ shr R8(%rcx), %r8
+ or %r8, %r10
+ mov (up), %r9
+ shr R8(%rcx), %r9
+ or %r9, %r11
+ mov %r10, 16(rp)
+ mov %r11, 8(rp)
+
+ neg R32(%rcx) C put lsh count in cl
+L(ast): mov (up), %r10
+ shl R8(%rcx), %r10
+ mov %r10, (rp)
+ FUNC_EXIT()
+ ret
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/lshiftc.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/lshiftc.asm
new file mode 100644
index 00000000000..c4ba04a1738
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/lshiftc.asm
@@ -0,0 +1,182 @@
+dnl AMD64 mpn_lshiftc -- mpn left shift with complement.
+
+dnl Copyright 2003, 2005, 2006, 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/limb
+C AMD K8,K9 2.75
+C AMD K10 2.75
+C Intel P4 ?
+C Intel core2 ?
+C Intel corei ?
+C Intel atom ?
+C VIA nano 3.75
+
+
+C INPUT PARAMETERS
+define(`rp', `%rdi')
+define(`up', `%rsi')
+define(`n', `%rdx')
+define(`cnt', `%rcx')
+
+ABI_SUPPORT(DOS64)
+ABI_SUPPORT(STD64)
+
+ASM_START()
+ TEXT
+ ALIGN(32)
+PROLOGUE(mpn_lshiftc)
+ FUNC_ENTRY(4)
+ neg R32(%rcx) C put rsh count in cl
+ mov -8(up,n,8), %rax
+ shr R8(%rcx), %rax C function return value
+
+ neg R32(%rcx) C put lsh count in cl
+ lea 1(n), R32(%r8)
+ and $3, R32(%r8)
+ je L(rlx) C jump for n = 3, 7, 11, ...
+
+ dec R32(%r8)
+ jne L(1)
+C n = 4, 8, 12, ...
+ mov -8(up,n,8), %r10
+ shl R8(%rcx), %r10
+ neg R32(%rcx) C put rsh count in cl
+ mov -16(up,n,8), %r8
+ shr R8(%rcx), %r8
+ or %r8, %r10
+ not %r10
+ mov %r10, -8(rp,n,8)
+ dec n
+ jmp L(rll)
+
+L(1): dec R32(%r8)
+ je L(1x) C jump for n = 1, 5, 9, 13, ...
+C n = 2, 6, 10, 16, ...
+ mov -8(up,n,8), %r10
+ shl R8(%rcx), %r10
+ neg R32(%rcx) C put rsh count in cl
+ mov -16(up,n,8), %r8
+ shr R8(%rcx), %r8
+ or %r8, %r10
+ not %r10
+ mov %r10, -8(rp,n,8)
+ dec n
+ neg R32(%rcx) C put lsh count in cl
+L(1x):
+ cmp $1, n
+ je L(ast)
+ mov -8(up,n,8), %r10
+ shl R8(%rcx), %r10
+ mov -16(up,n,8), %r11
+ shl R8(%rcx), %r11
+ neg R32(%rcx) C put rsh count in cl
+ mov -16(up,n,8), %r8
+ mov -24(up,n,8), %r9
+ shr R8(%rcx), %r8
+ or %r8, %r10
+ shr R8(%rcx), %r9
+ or %r9, %r11
+ not %r10
+ not %r11
+ mov %r10, -8(rp,n,8)
+ mov %r11, -16(rp,n,8)
+ sub $2, n
+
+L(rll): neg R32(%rcx) C put lsh count in cl
+L(rlx): mov -8(up,n,8), %r10
+ shl R8(%rcx), %r10
+ mov -16(up,n,8), %r11
+ shl R8(%rcx), %r11
+
+ sub $4, n C 4
+ jb L(end) C 2
+ ALIGN(16)
+L(top):
+ C finish stuff from lsh block
+ neg R32(%rcx) C put rsh count in cl
+ mov 16(up,n,8), %r8
+ mov 8(up,n,8), %r9
+ shr R8(%rcx), %r8
+ or %r8, %r10
+ shr R8(%rcx), %r9
+ or %r9, %r11
+ not %r10
+ not %r11
+ mov %r10, 24(rp,n,8)
+ mov %r11, 16(rp,n,8)
+ C start two new rsh
+ mov 0(up,n,8), %r8
+ mov -8(up,n,8), %r9
+ shr R8(%rcx), %r8
+ shr R8(%rcx), %r9
+
+ C finish stuff from rsh block
+ neg R32(%rcx) C put lsh count in cl
+ mov 8(up,n,8), %r10
+ mov 0(up,n,8), %r11
+ shl R8(%rcx), %r10
+ or %r10, %r8
+ shl R8(%rcx), %r11
+ or %r11, %r9
+ not %r8
+ not %r9
+ mov %r8, 8(rp,n,8)
+ mov %r9, 0(rp,n,8)
+ C start two new lsh
+ mov -8(up,n,8), %r10
+ mov -16(up,n,8), %r11
+ shl R8(%rcx), %r10
+ shl R8(%rcx), %r11
+
+ sub $4, n
+ jae L(top) C 2
+L(end):
+ neg R32(%rcx) C put rsh count in cl
+ mov 8(up), %r8
+ shr R8(%rcx), %r8
+ or %r8, %r10
+ mov (up), %r9
+ shr R8(%rcx), %r9
+ or %r9, %r11
+ not %r10
+ not %r11
+ mov %r10, 16(rp)
+ mov %r11, 8(rp)
+
+ neg R32(%rcx) C put lsh count in cl
+L(ast): mov (up), %r10
+ shl R8(%rcx), %r10
+ not %r10
+ mov %r10, (rp)
+ FUNC_EXIT()
+ ret
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/lshsub_n.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/lshsub_n.asm
new file mode 100644
index 00000000000..4d428c0bd25
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/lshsub_n.asm
@@ -0,0 +1,172 @@
+dnl AMD64 mpn_lshsub_n. R = 2^k(U - V).
+
+dnl Copyright 2006, 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/limb
+C AMD K8,K9 3.15 (mpn_sub_n + mpn_lshift costs about 4 c/l)
+C AMD K10 3.15 (mpn_sub_n + mpn_lshift costs about 4 c/l)
+C Intel P4 16.5
+C Intel core2 4.35
+C Intel corei ?
+C Intel atom ?
+C VIA nano ?
+
+C This was written quickly and not optimized at all, but it runs very well on
+C K8. But perhaps one could get under 3 c/l. Ideas:
+C 1) Use indexing to save the 3 LEA
+C 2) Write reasonable feed-in code
+C 3) Be more clever about register usage
+C 4) Unroll more, handling CL negation, carry save/restore cost much now
+C 5) Reschedule
+
+C INPUT PARAMETERS
+define(`rp', `%rdi')
+define(`up', `%rsi')
+define(`vp', `%rdx')
+define(`n', `%rcx')
+define(`cnt', `%r8')
+
+ABI_SUPPORT(DOS64)
+ABI_SUPPORT(STD64)
+
+ASM_START()
+ TEXT
+ ALIGN(16)
+PROLOGUE(mpn_lshsub_n)
+ FUNC_ENTRY(4)
+IFDOS(` mov 56(%rsp), %r8d ')
+
+ push %r12
+ push %r13
+ push %r14
+ push %r15
+ push %rbx
+
+ mov n, %rax
+ xor R32(%rbx), R32(%rbx) C clear carry save register
+ mov R32(%r8), R32(%rcx) C shift count
+ xor R32(%r15), R32(%r15) C limb carry
+
+ mov R32(%rax), R32(%r11)
+ and $3, R32(%r11)
+ je L(4)
+ sub $1, R32(%r11)
+
+L(oopette):
+ add R32(%rbx), R32(%rbx) C restore carry flag
+ mov 0(up), %r8
+ lea 8(up), up
+ sbb 0(vp), %r8
+ mov %r8, %r12
+ sbb R32(%rbx), R32(%rbx) C save carry flag
+ shl R8(%rcx), %r8
+ or %r15, %r8
+ mov %r12, %r15
+ lea 8(vp), vp
+ neg R8(%rcx)
+ shr R8(%rcx), %r15
+ neg R8(%rcx)
+ mov %r8, 0(rp)
+ lea 8(rp), rp
+ sub $1, R32(%r11)
+ jnc L(oopette)
+
+L(4):
+ sub $4, %rax
+ jc L(end)
+
+ ALIGN(16)
+L(oop):
+ add R32(%rbx), R32(%rbx) C restore carry flag
+
+ mov 0(up), %r8
+ mov 8(up), %r9
+ mov 16(up), %r10
+ mov 24(up), %r11
+
+ lea 32(up), up
+
+ sbb 0(vp), %r8
+ mov %r8, %r12
+ sbb 8(vp), %r9
+ mov %r9, %r13
+ sbb 16(vp), %r10
+ mov %r10, %r14
+ sbb 24(vp), %r11
+
+ sbb R32(%rbx), R32(%rbx) C save carry flag
+
+ shl R8(%rcx), %r8
+ shl R8(%rcx), %r9
+ shl R8(%rcx), %r10
+ or %r15, %r8
+ mov %r11, %r15
+ shl R8(%rcx), %r11
+
+ lea 32(vp), vp
+
+ neg R8(%rcx)
+
+ shr R8(%rcx), %r12
+ shr R8(%rcx), %r13
+ shr R8(%rcx), %r14
+ shr R8(%rcx), %r15 C used next loop
+
+ or %r12, %r9
+ or %r13, %r10
+ or %r14, %r11
+
+ neg R8(%rcx)
+
+ mov %r8, 0(rp)
+ mov %r9, 8(rp)
+ mov %r10, 16(rp)
+ mov %r11, 24(rp)
+
+ lea 32(rp), rp
+
+ sub $4, %rax
+ jnc L(oop)
+L(end):
+ neg R32(%rbx)
+ shl R8(%rcx), %rbx
+ adc %r15, %rbx
+ mov %rbx, %rax
+ pop %rbx
+ pop %r15
+ pop %r14
+ pop %r13
+ pop %r12
+
+ FUNC_EXIT()
+ ret
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/missing-call.m4 b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/missing-call.m4
new file mode 100644
index 00000000000..c024f0ed77c
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/missing-call.m4
@@ -0,0 +1,53 @@
+dnl AMD64 MULX/ADX simulation support, function call version.
+
+dnl Contributed to the GNU project by Torbjörn Granlund.
+
+dnl Copyright 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/.
+
+
+define(`adox',`
+ push $1
+ push $2
+ call __gmp_adox
+ pop $2
+')
+
+define(`adcx',`
+ push $1
+ push $2
+ call __gmp_adcx
+ pop $2
+')
+
+define(`mulx',`
+ push $1
+ call __gmp_mulx
+ pop $2
+ pop $3
+')
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/missing-inline.m4 b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/missing-inline.m4
new file mode 100644
index 00000000000..bd1df1313fe
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/missing-inline.m4
@@ -0,0 +1,100 @@
+dnl AMD64 MULX/ADX simulation support, inline version.
+
+dnl Contributed to the GNU project by Torbjörn Granlund.
+
+dnl Copyright 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/.
+
+
+define(`adox',`
+ push $2
+ push %rcx
+ push %rbx
+ push %rax
+ mov $1, %rcx
+ pushfq
+ pushfq
+C copy 0(%rsp):11 to 0(%rsp):0
+ mov (%rsp), %rbx
+ shr %rbx
+ bt $`'10, %rbx
+ adc %rbx, %rbx
+ mov %rbx, (%rsp)
+C put manipulated flags into eflags, execute a plain adc
+ popfq
+ adc %rcx, 32(%rsp)
+C copy CF to 0(%rsp):11
+ mov (%rsp), %rbx
+ sbb R32(%rax), R32(%rax)
+ and $`'0x800, R32(%rax)
+ and $`'0xfffffffffffff7ff, %rbx
+ or %rax, %rbx
+ mov %rbx, (%rsp)
+C put manipulated flags into eflags
+ popfq
+ pop %rax
+ pop %rbx
+ pop %rcx
+ pop $2
+')
+
+define(`adcx',`
+ push $2
+ push %rcx
+ push %rbx
+ push %rax
+ mov $1, %rcx
+ pushfq
+ adc %rcx, 32(%rsp)
+ mov (%rsp), %rbx
+ sbb R32(%rax), R32(%rax)
+ and $`'0xfffffffffffffffe, %rbx
+ sub %rax, %rbx
+ mov %rbx, (%rsp)
+ popfq
+ pop %rax
+ pop %rbx
+ pop %rcx
+ pop $2
+')
+
+define(`mulx',`
+ lea -16(%rsp), %rsp
+ push %rax
+ push %rdx
+ pushfq C preserve all flags
+ mov $1, %rax
+ mul %rdx
+ mov %rax, 24(%rsp)
+ mov %rdx, 32(%rsp)
+ popfq C restore eflags
+ pop %rdx
+ pop %rax
+ pop $2
+ pop $3
+')
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/missing.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/missing.asm
new file mode 100644
index 00000000000..9b65c89dd4b
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/missing.asm
@@ -0,0 +1,130 @@
+
+ dnl AMD64 MULX/ADX simulation support.
+
+dnl Contributed to the GNU project by Torbjörn Granlund.
+
+dnl Copyright 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')
+
+ASM_START()
+
+C Fake the MULX instruction
+C
+C Accept the single explicit parameter on the stack, return the two result
+C words on the stack. This calling convention means that we need to move the
+C return address up.
+C
+PROLOGUE(__gmp_mulx)
+ lea -8(%rsp), %rsp
+ push %rax
+ push %rdx
+ pushfq C preserve all flags
+ mov 32(%rsp), %rax C move retaddr...
+ mov %rax, 24(%rsp) C ...up the stack
+ mov 40(%rsp), %rax C input parameter
+ mul %rdx
+ mov %rax, 32(%rsp)
+ mov %rdx, 40(%rsp)
+ popfq C restore eflags
+ pop %rdx
+ pop %rax
+ ret
+EPILOGUE()
+PROTECT(__gmp_mulx)
+
+
+C Fake the ADOX instruction
+C
+C Accept the two parameters on the stack, return the result word on the stack.
+C This calling convention means that we need to move the return address down.
+C
+PROLOGUE(__gmp_adox)
+ push %rcx
+ push %rbx
+ push %rax
+ mov 32(%rsp), %rcx C src2
+ mov 24(%rsp), %rax C move retaddr...
+ mov %rax, 32(%rsp) C ...down the stack
+ pushfq
+C copy 0(%rsp):11 to 0(%rsp):0
+ mov (%rsp), %rbx
+ shr %rbx
+ bt $10, %rbx
+ adc %rbx, %rbx
+ push %rbx
+C put manipulated flags into eflags, execute a plain adc
+ popfq
+ adc %rcx, 48(%rsp)
+C copy CF to 0(%rsp):11
+ pop %rbx
+ sbb R32(%rax), R32(%rax)
+ and $0x800, R32(%rax)
+ and $0xfffffffffffff7ff, %rbx
+ or %rax, %rbx
+ push %rbx
+C put manipulated flags into eflags
+ popfq
+ pop %rax
+ pop %rbx
+ pop %rcx
+ lea 8(%rsp), %rsp
+ ret
+EPILOGUE()
+PROTECT(__gmp_adox)
+
+
+C Fake the ADCX instruction
+C
+C Accept the two parameters on the stack, return the result word on the stack.
+C This calling convention means that we need to move the return address down.
+C
+PROLOGUE(__gmp_adcx)
+ push %rcx
+ push %rbx
+ push %rax
+ mov 32(%rsp), %rcx C src2
+ mov 24(%rsp), %rax C move retaddr...
+ mov %rax, 32(%rsp) C ...down the stack
+ pushfq
+ adc %rcx, 48(%rsp)
+ pop %rbx
+ sbb R32(%rax), R32(%rax)
+ and $`'0xfffffffffffffffe, %rbx
+ sub %rax, %rbx
+ push %rbx
+ popfq
+ pop %rax
+ pop %rbx
+ pop %rcx
+ lea 8(%rsp), %rsp
+ ret
+EPILOGUE()
+PROTECT(__gmp_adcx)
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/mod_1_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/mod_1_1.asm
new file mode 100644
index 00000000000..4a7c45a58b4
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/mod_1_1.asm
@@ -0,0 +1,235 @@
+dnl AMD64 mpn_mod_1_1p
+
+dnl Contributed to the GNU project by Torbjörn Granlund and Niels Möller.
+
+dnl Copyright 2009-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/limb
+C AMD K8,K9 6
+C AMD K10 6
+C Intel P4 26
+C Intel core2 12.5
+C Intel NHM 11.3
+C Intel SBR 8.4 (slowdown, old code took 8.0)
+C Intel atom 26
+C VIA nano 13
+
+define(`B2mb', `%r10')
+define(`B2modb', `%r11')
+define(`ap', `%rdi')
+define(`n', `%rsi')
+define(`pre', `%r8')
+define(`b', `%rbx')
+
+define(`r0', `%rbp') C r1 kept in %rax
+define(`r2', `%rcx') C kept negated. Also used as shift count
+define(`t0', `%r9')
+
+C mp_limb_t
+C mpn_mod_1_1p (mp_srcptr ap, mp_size_t n, mp_limb_t b, mp_limb_t bmodb[4])
+C %rdi %rsi %rdx %rcx
+C The pre array contains bi, cnt, B1modb, B2modb
+C Note: This implementation needs B1modb only when cnt > 0
+
+C The iteration is almost as follows,
+C
+C r_2 B^3 + r_1 B^2 + r_0 B + u = r_1 B2modb + (r_0 + r_2 B2mod) B + u
+C
+C where r2 is a single bit represented as a mask. But to make sure that the
+C result fits in two limbs and a bit, carry from the addition
+C
+C r_0 + r_2 B2mod
+C
+C is handled specially. On carry, we subtract b to cancel the carry,
+C and we use instead the value
+C
+C r_0 + B2mb (mod B)
+C
+C This addition can be issued early since it doesn't depend on r2, and it is
+C the source of the cmov in the loop.
+C
+C We have the invariant that r_2 B^2 + r_1 B + r_0 < B^2 + B b
+
+ABI_SUPPORT(DOS64)
+ABI_SUPPORT(STD64)
+
+ASM_START()
+ TEXT
+ ALIGN(16)
+PROLOGUE(mpn_mod_1_1p)
+ FUNC_ENTRY(4)
+ push %rbp
+ push %rbx
+ mov %rdx, b
+ mov %rcx, pre
+
+ mov -8(ap, n, 8), %rax
+ cmp $3, n
+ jnc L(first)
+ mov -16(ap, n, 8), r0
+ jmp L(reduce_two)
+
+L(first):
+ C First iteration, no r2
+ mov 24(pre), B2modb
+ mul B2modb
+ mov -24(ap, n, 8), r0
+ add %rax, r0
+ mov -16(ap, n, 8), %rax
+ adc %rdx, %rax
+ sbb r2, r2
+ sub $4, n
+ jc L(reduce_three)
+
+ mov B2modb, B2mb
+ sub b, B2mb
+
+ ALIGN(16)
+L(top): and B2modb, r2
+ lea (B2mb, r0), t0
+ mul B2modb
+ add r0, r2
+ mov (ap, n, 8), r0
+ cmovc t0, r2
+ add %rax, r0
+ mov r2, %rax
+ adc %rdx, %rax
+ sbb r2, r2
+ sub $1, n
+ jnc L(top)
+
+L(reduce_three):
+ C Eliminate r2
+ and b, r2
+ sub r2, %rax
+
+L(reduce_two):
+ mov 8(pre), R32(%rcx)
+ test R32(%rcx), R32(%rcx)
+ jz L(normalized)
+
+ C Unnormalized, use B1modb to reduce to size < B (b+1)
+ mulq 16(pre)
+ xor t0, t0
+ add %rax, r0
+ adc %rdx, t0
+ mov t0, %rax
+
+ C Left-shift to normalize
+ifdef(`SHLD_SLOW',`
+ shl R8(%rcx), %rax
+ mov r0, t0
+ neg R32(%rcx)
+ shr R8(%rcx), t0
+ or t0, %rax
+ neg R32(%rcx)
+',`
+ shld R8(%rcx), r0, %rax
+')
+ shl R8(%rcx), r0
+ jmp L(udiv)
+
+L(normalized):
+ mov %rax, t0
+ sub b, t0
+ cmovnc t0, %rax
+
+L(udiv):
+ lea 1(%rax), t0
+ mulq (pre)
+ add r0, %rax
+ adc t0, %rdx
+ imul b, %rdx
+ sub %rdx, r0
+ cmp r0, %rax
+ lea (b, r0), %rax
+ cmovnc r0, %rax
+ cmp b, %rax
+ jnc L(fix)
+L(ok): shr R8(%rcx), %rax
+
+ pop %rbx
+ pop %rbp
+ FUNC_EXIT()
+ ret
+L(fix): sub b, %rax
+ jmp L(ok)
+EPILOGUE()
+
+ ALIGN(16)
+PROLOGUE(mpn_mod_1_1p_cps)
+ FUNC_ENTRY(2)
+ push %rbp
+ bsr %rsi, %rcx
+ push %rbx
+ mov %rdi, %rbx
+ push %r12
+ xor $63, R32(%rcx)
+ mov %rsi, %r12
+ mov R32(%rcx), R32(%rbp)
+ sal R8(%rcx), %r12
+IFSTD(` mov %r12, %rdi ') C pass parameter
+IFDOS(` mov %r12, %rcx ') C pass parameter
+ CALL( mpn_invert_limb)
+ neg %r12
+ mov %r12, %r8
+ mov %rax, (%rbx) C store bi
+ mov %rbp, 8(%rbx) C store cnt
+ imul %rax, %r12
+ mov %r12, 24(%rbx) C store B2modb
+ mov R32(%rbp), R32(%rcx)
+ test R32(%rcx), R32(%rcx)
+ jz L(z)
+
+ mov $1, R32(%rdx)
+ifdef(`SHLD_SLOW',`
+ C Destroys %rax, unlike shld. Otherwise, we could do B1modb
+ C before B2modb, and get rid of the move %r12, %r8 above.
+
+ shl R8(%rcx), %rdx
+ neg R32(%rcx)
+ shr R8(%rcx), %rax
+ or %rax, %rdx
+ neg R32(%rcx)
+',`
+ shld R8(%rcx), %rax, %rdx
+')
+ imul %rdx, %r8
+ shr R8(%rcx), %r8
+ mov %r8, 16(%rbx) C store B1modb
+L(z):
+ pop %r12
+ pop %rbx
+ pop %rbp
+ FUNC_EXIT()
+ ret
+EPILOGUE()
+ASM_END()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/mod_1_2.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/mod_1_2.asm
new file mode 100644
index 00000000000..02dd9177919
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/mod_1_2.asm
@@ -0,0 +1,238 @@
+dnl AMD64 mpn_mod_1s_2p
+
+dnl Contributed to the GNU project by Torbjorn Granlund.
+
+dnl Copyright 2009-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/limb
+C AMD K8,K9 4
+C AMD K10 4
+C Intel P4 19
+C Intel core2 8
+C Intel NHM 6.5
+C Intel SBR 4.5
+C Intel atom 28
+C VIA nano 8
+
+ABI_SUPPORT(DOS64)
+ABI_SUPPORT(STD64)
+
+ASM_START()
+ TEXT
+ ALIGN(16)
+PROLOGUE(mpn_mod_1s_2p)
+ FUNC_ENTRY(4)
+ push %r14
+ test $1, R8(%rsi)
+ mov %rdx, %r14
+ push %r13
+ mov %rcx, %r13
+ push %r12
+ push %rbp
+ push %rbx
+ mov 16(%rcx), %r10
+ mov 24(%rcx), %rbx
+ mov 32(%rcx), %rbp
+ je L(b0)
+ dec %rsi
+ je L(one)
+ mov -8(%rdi,%rsi,8), %rax
+ mul %r10
+ mov %rax, %r9
+ mov %rdx, %r8
+ mov (%rdi,%rsi,8), %rax
+ add -16(%rdi,%rsi,8), %r9
+ adc $0, %r8
+ mul %rbx
+ add %rax, %r9
+ adc %rdx, %r8
+ jmp L(11)
+
+L(b0): mov -8(%rdi,%rsi,8), %r8
+ mov -16(%rdi,%rsi,8), %r9
+
+L(11): sub $4, %rsi
+ jb L(ed2)
+ lea 40(%rdi,%rsi,8), %rdi
+ mov -40(%rdi), %r11
+ mov -32(%rdi), %rax
+ jmp L(m0)
+
+ ALIGN(16)
+L(top): mov -24(%rdi), %r9
+ add %rax, %r11
+ mov -16(%rdi), %rax
+ adc %rdx, %r12
+ mul %r10
+ add %rax, %r9
+ mov %r11, %rax
+ mov %rdx, %r8
+ adc $0, %r8
+ mul %rbx
+ add %rax, %r9
+ mov %r12, %rax
+ adc %rdx, %r8
+ mul %rbp
+ sub $2, %rsi
+ jb L(ed1)
+ mov -40(%rdi), %r11
+ add %rax, %r9
+ mov -32(%rdi), %rax
+ adc %rdx, %r8
+L(m0): mul %r10
+ add %rax, %r11
+ mov %r9, %rax
+ mov %rdx, %r12
+ adc $0, %r12
+ mul %rbx
+ add %rax, %r11
+ lea -32(%rdi), %rdi C ap -= 4
+ mov %r8, %rax
+ adc %rdx, %r12
+ mul %rbp
+ sub $2, %rsi
+ jae L(top)
+
+L(ed0): mov %r11, %r9
+ mov %r12, %r8
+L(ed1): add %rax, %r9
+ adc %rdx, %r8
+L(ed2): mov 8(%r13), R32(%rdi) C cnt
+ mov %r8, %rax
+ mov %r9, %r8
+ mul %r10
+ add %rax, %r8
+ adc $0, %rdx
+L(1): xor R32(%rcx), R32(%rcx)
+ mov %r8, %r9
+ sub R32(%rdi), R32(%rcx)
+ shr R8(%rcx), %r9
+ mov R32(%rdi), R32(%rcx)
+ sal R8(%rcx), %rdx
+ or %rdx, %r9
+ sal R8(%rcx), %r8
+ mov %r9, %rax
+ mulq (%r13)
+ mov %rax, %rsi
+ inc %r9
+ add %r8, %rsi
+ adc %r9, %rdx
+ imul %r14, %rdx
+ sub %rdx, %r8
+ lea (%r8,%r14), %rax
+ cmp %r8, %rsi
+ cmovc %rax, %r8
+ mov %r8, %rax
+ sub %r14, %rax
+ cmovc %r8, %rax
+ mov R32(%rdi), R32(%rcx)
+ shr R8(%rcx), %rax
+ pop %rbx
+ pop %rbp
+ pop %r12
+ pop %r13
+ pop %r14
+ FUNC_EXIT()
+ ret
+L(one):
+ mov (%rdi), %r8
+ mov 8(%rcx), R32(%rdi)
+ xor %rdx, %rdx
+ jmp L(1)
+EPILOGUE()
+
+ ALIGN(16)
+PROLOGUE(mpn_mod_1s_2p_cps)
+ FUNC_ENTRY(2)
+ push %rbp
+ bsr %rsi, %rcx
+ push %rbx
+ mov %rdi, %rbx
+ push %r12
+ xor $63, R32(%rcx)
+ mov %rsi, %r12
+ mov R32(%rcx), R32(%rbp) C preserve cnt over call
+ sal R8(%rcx), %r12 C b << cnt
+IFSTD(` mov %r12, %rdi ') C pass parameter
+IFDOS(` mov %r12, %rcx ') C pass parameter
+ CALL( mpn_invert_limb)
+ mov %r12, %r8
+ mov %rax, %r11
+ mov %rax, (%rbx) C store bi
+ mov %rbp, 8(%rbx) C store cnt
+ neg %r8
+ mov R32(%rbp), R32(%rcx)
+ mov $1, R32(%rsi)
+ifdef(`SHLD_SLOW',`
+ shl R8(%rcx), %rsi
+ neg R32(%rcx)
+ mov %rax, %rbp
+ shr R8(%rcx), %rax
+ or %rax, %rsi
+ mov %rbp, %rax
+ neg R32(%rcx)
+',`
+ shld R8(%rcx), %rax, %rsi C FIXME: Slow on Atom and Nano
+')
+ imul %r8, %rsi
+ mul %rsi
+
+ add %rsi, %rdx
+ shr R8(%rcx), %rsi
+ mov %rsi, 16(%rbx) C store B1modb
+
+ not %rdx
+ imul %r12, %rdx
+ lea (%rdx,%r12), %rsi
+ cmp %rdx, %rax
+ cmovnc %rdx, %rsi
+ mov %r11, %rax
+ mul %rsi
+
+ add %rsi, %rdx
+ shr R8(%rcx), %rsi
+ mov %rsi, 24(%rbx) C store B2modb
+
+ not %rdx
+ imul %r12, %rdx
+ add %rdx, %r12
+ cmp %rdx, %rax
+ cmovnc %rdx, %r12
+
+ shr R8(%rcx), %r12
+ mov %r12, 32(%rbx) C store B3modb
+
+ pop %r12
+ pop %rbx
+ pop %rbp
+ FUNC_EXIT()
+ ret
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/mod_1_4.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/mod_1_4.asm
new file mode 100644
index 00000000000..3ce83dc42ed
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/mod_1_4.asm
@@ -0,0 +1,269 @@
+dnl AMD64 mpn_mod_1s_4p
+
+dnl Contributed to the GNU project by Torbjorn Granlund.
+
+dnl Copyright 2009-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/limb
+C AMD K8,K9 3
+C AMD K10 3
+C Intel P4 15.5
+C Intel core2 5
+C Intel corei 4
+C Intel atom 23
+C VIA nano 4.75
+
+ABI_SUPPORT(DOS64)
+ABI_SUPPORT(STD64)
+
+ASM_START()
+ TEXT
+ ALIGN(16)
+PROLOGUE(mpn_mod_1s_4p)
+ FUNC_ENTRY(4)
+ push %r15
+ push %r14
+ push %r13
+ push %r12
+ push %rbp
+ push %rbx
+
+ mov %rdx, %r15
+ mov %rcx, %r14
+ mov 16(%rcx), %r11 C B1modb
+ mov 24(%rcx), %rbx C B2modb
+ mov 32(%rcx), %rbp C B3modb
+ mov 40(%rcx), %r13 C B4modb
+ mov 48(%rcx), %r12 C B5modb
+ xor R32(%r8), R32(%r8)
+ mov R32(%rsi), R32(%rdx)
+ and $3, R32(%rdx)
+ je L(b0)
+ cmp $2, R32(%rdx)
+ jc L(b1)
+ je L(b2)
+
+L(b3): lea -24(%rdi,%rsi,8), %rdi
+ mov 8(%rdi), %rax
+ mul %r11
+ mov (%rdi), %r9
+ add %rax, %r9
+ adc %rdx, %r8
+ mov 16(%rdi), %rax
+ mul %rbx
+ jmp L(m0)
+
+ ALIGN(8)
+L(b0): lea -32(%rdi,%rsi,8), %rdi
+ mov 8(%rdi), %rax
+ mul %r11
+ mov (%rdi), %r9
+ add %rax, %r9
+ adc %rdx, %r8
+ mov 16(%rdi), %rax
+ mul %rbx
+ add %rax, %r9
+ adc %rdx, %r8
+ mov 24(%rdi), %rax
+ mul %rbp
+ jmp L(m0)
+
+ ALIGN(8)
+L(b1): lea -8(%rdi,%rsi,8), %rdi
+ mov (%rdi), %r9
+ jmp L(m1)
+
+ ALIGN(8)
+L(b2): lea -16(%rdi,%rsi,8), %rdi
+ mov 8(%rdi), %r8
+ mov (%rdi), %r9
+ jmp L(m1)
+
+ ALIGN(16)
+L(top): mov -24(%rdi), %rax
+ mov -32(%rdi), %r10
+ mul %r11 C up[1] * B1modb
+ add %rax, %r10
+ mov -16(%rdi), %rax
+ mov $0, R32(%rcx)
+ adc %rdx, %rcx
+ mul %rbx C up[2] * B2modb
+ add %rax, %r10
+ mov -8(%rdi), %rax
+ adc %rdx, %rcx
+ sub $32, %rdi
+ mul %rbp C up[3] * B3modb
+ add %rax, %r10
+ mov %r13, %rax
+ adc %rdx, %rcx
+ mul %r9 C rl * B4modb
+ add %rax, %r10
+ mov %r12, %rax
+ adc %rdx, %rcx
+ mul %r8 C rh * B5modb
+ mov %r10, %r9
+ mov %rcx, %r8
+L(m0): add %rax, %r9
+ adc %rdx, %r8
+L(m1): sub $4, %rsi
+ ja L(top)
+
+L(end): mov 8(%r14), R32(%rsi)
+ mov %r8, %rax
+ mul %r11
+ mov %rax, %r8
+ add %r9, %r8
+ adc $0, %rdx
+ xor R32(%rcx), R32(%rcx)
+ sub R32(%rsi), R32(%rcx)
+ mov %r8, %rdi
+ shr R8(%rcx), %rdi
+ mov R32(%rsi), R32(%rcx)
+ sal R8(%rcx), %rdx
+ or %rdx, %rdi
+ mov %rdi, %rax
+ mulq (%r14)
+ mov %r15, %rbx
+ mov %rax, %r9
+ sal R8(%rcx), %r8
+ inc %rdi
+ add %r8, %r9
+ adc %rdi, %rdx
+ imul %rbx, %rdx
+ sub %rdx, %r8
+ lea (%r8,%rbx), %rax
+ cmp %r8, %r9
+ cmovc %rax, %r8
+ mov %r8, %rax
+ sub %rbx, %rax
+ cmovc %r8, %rax
+ shr R8(%rcx), %rax
+ pop %rbx
+ pop %rbp
+ pop %r12
+ pop %r13
+ pop %r14
+ pop %r15
+ FUNC_EXIT()
+ ret
+EPILOGUE()
+
+ ALIGN(16)
+PROLOGUE(mpn_mod_1s_4p_cps)
+ FUNC_ENTRY(2)
+ push %rbp
+ bsr %rsi, %rcx
+ push %rbx
+ mov %rdi, %rbx
+ push %r12
+ xor $63, R32(%rcx)
+ mov %rsi, %r12
+ mov R32(%rcx), R32(%rbp) C preserve cnt over call
+ sal R8(%rcx), %r12 C b << cnt
+IFSTD(` mov %r12, %rdi ') C pass parameter
+IFDOS(` mov %r12, %rcx ') C pass parameter
+ CALL( mpn_invert_limb)
+ mov %r12, %r8
+ mov %rax, %r11
+ mov %rax, (%rbx) C store bi
+ mov %rbp, 8(%rbx) C store cnt
+ neg %r8
+ mov R32(%rbp), R32(%rcx)
+ mov $1, R32(%rsi)
+ifdef(`SHLD_SLOW',`
+ shl R8(%rcx), %rsi
+ neg R32(%rcx)
+ mov %rax, %rbp
+ shr R8(%rcx), %rax
+ or %rax, %rsi
+ mov %rbp, %rax
+ neg R32(%rcx)
+',`
+ shld R8(%rcx), %rax, %rsi C FIXME: Slow on Atom and Nano
+')
+ imul %r8, %rsi
+ mul %rsi
+
+ add %rsi, %rdx
+ shr R8(%rcx), %rsi
+ mov %rsi, 16(%rbx) C store B1modb
+
+ not %rdx
+ imul %r12, %rdx
+ lea (%rdx,%r12), %rsi
+ cmp %rdx, %rax
+ cmovnc %rdx, %rsi
+ mov %r11, %rax
+ mul %rsi
+
+ add %rsi, %rdx
+ shr R8(%rcx), %rsi
+ mov %rsi, 24(%rbx) C store B2modb
+
+ not %rdx
+ imul %r12, %rdx
+ lea (%rdx,%r12), %rsi
+ cmp %rdx, %rax
+ cmovnc %rdx, %rsi
+ mov %r11, %rax
+ mul %rsi
+
+ add %rsi, %rdx
+ shr R8(%rcx), %rsi
+ mov %rsi, 32(%rbx) C store B3modb
+
+ not %rdx
+ imul %r12, %rdx
+ lea (%rdx,%r12), %rsi
+ cmp %rdx, %rax
+ cmovnc %rdx, %rsi
+ mov %r11, %rax
+ mul %rsi
+
+ add %rsi, %rdx
+ shr R8(%rcx), %rsi
+ mov %rsi, 40(%rbx) C store B4modb
+
+ not %rdx
+ imul %r12, %rdx
+ add %rdx, %r12
+ cmp %rdx, %rax
+ cmovnc %rdx, %r12
+
+ shr R8(%rcx), %r12
+ mov %r12, 48(%rbx) C store B5modb
+
+ pop %r12
+ pop %rbx
+ pop %rbp
+ FUNC_EXIT()
+ ret
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/mod_34lsub1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/mod_34lsub1.asm
new file mode 100644
index 00000000000..62bdcfac690
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/mod_34lsub1.asm
@@ -0,0 +1,205 @@
+dnl AMD64 mpn_mod_34lsub1 -- remainder modulo 2^48-1.
+
+dnl Copyright 2000-2002, 2004, 2005, 2007, 2009-2012 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 AMD K8,K9 0.67 0.583 is possible with zero-reg instead of $0, 4-way
+C AMD K10 0.67 this seems hard to beat
+C AMD bd1 1
+C AMD bobcat 1.07
+C Intel P4 7.35 terrible, use old code
+C Intel core2 1.25 1+epsilon with huge unrolling
+C Intel NHM 1.15 this seems hard to beat
+C Intel SBR 0.93
+C Intel atom 2.5
+C VIA nano 1.25 this seems hard to beat
+
+C INPUT PARAMETERS
+define(`ap', %rdi)
+define(`n', %rsi)
+
+C mp_limb_t mpn_mod_34lsub1 (mp_srcptr up, mp_size_t n)
+
+C TODO
+C * Review feed-in and wind-down code.
+
+ABI_SUPPORT(DOS64)
+ABI_SUPPORT(STD64)
+
+ASM_START()
+ TEXT
+ ALIGN(32)
+PROLOGUE(mpn_mod_34lsub1)
+ FUNC_ENTRY(2)
+
+ mov $0x0000FFFFFFFFFFFF, %r11
+
+ mov (ap), %rax
+
+ cmp $2, %rsi
+ ja L(gt2)
+
+ jb L(one)
+
+ mov 8(ap), %rsi
+ mov %rax, %rdx
+ shr $48, %rax C src[0] low
+
+ and %r11, %rdx C src[0] high
+ add %rdx, %rax
+ mov R32(%rsi), R32(%rdx)
+
+ shr $32, %rsi C src[1] high
+ add %rsi, %rax
+
+ shl $16, %rdx C src[1] low
+ add %rdx, %rax
+L(one): FUNC_EXIT()
+ ret
+
+
+C Don't change this, the wind-down code is not able to handle greater values
+define(UNROLL,3)
+
+L(gt2): mov 8(ap), %rcx
+ mov 16(ap), %rdx
+ xor %r9, %r9
+ add $24, ap
+ sub $eval(UNROLL*3+3), %rsi
+ jc L(end)
+ ALIGN(16)
+L(top):
+ add (ap), %rax
+ adc 8(ap), %rcx
+ adc 16(ap), %rdx
+ adc $0, %r9
+forloop(i,1,UNROLL-1,`dnl
+ add eval(i*24)(ap), %rax
+ adc eval(i*24+8)(ap), %rcx
+ adc eval(i*24+16)(ap), %rdx
+ adc $0, %r9
+')dnl
+ add $eval(UNROLL*24), ap
+ sub $eval(UNROLL*3), %rsi
+ jnc L(top)
+
+L(end):
+ lea L(tab)(%rip), %r8
+ifdef(`PIC',
+` movslq 36(%r8,%rsi,4), %r10
+ add %r10, %r8
+ jmp *%r8
+',`
+ jmp *72(%r8,%rsi,8)
+')
+ JUMPTABSECT
+ ALIGN(8)
+L(tab): JMPENT( L(0), L(tab))
+ JMPENT( L(1), L(tab))
+ JMPENT( L(2), L(tab))
+ JMPENT( L(3), L(tab))
+ JMPENT( L(4), L(tab))
+ JMPENT( L(5), L(tab))
+ JMPENT( L(6), L(tab))
+ JMPENT( L(7), L(tab))
+ JMPENT( L(8), L(tab))
+ TEXT
+
+L(6): add (ap), %rax
+ adc 8(ap), %rcx
+ adc 16(ap), %rdx
+ adc $0, %r9
+ add $24, ap
+L(3): add (ap), %rax
+ adc 8(ap), %rcx
+ adc 16(ap), %rdx
+ jmp L(cj1)
+
+L(7): add (ap), %rax
+ adc 8(ap), %rcx
+ adc 16(ap), %rdx
+ adc $0, %r9
+ add $24, ap
+L(4): add (ap), %rax
+ adc 8(ap), %rcx
+ adc 16(ap), %rdx
+ adc $0, %r9
+ add $24, ap
+L(1): add (ap), %rax
+ adc $0, %rcx
+ jmp L(cj2)
+
+L(8): add (ap), %rax
+ adc 8(ap), %rcx
+ adc 16(ap), %rdx
+ adc $0, %r9
+ add $24, ap
+L(5): add (ap), %rax
+ adc 8(ap), %rcx
+ adc 16(ap), %rdx
+ adc $0, %r9
+ add $24, ap
+L(2): add (ap), %rax
+ adc 8(ap), %rcx
+
+L(cj2): adc $0, %rdx
+L(cj1): adc $0, %r9
+L(0): add %r9, %rax
+ adc $0, %rcx
+ adc $0, %rdx
+ adc $0, %rax
+
+ mov %rax, %rdi C 0mod3
+ shr $48, %rax C 0mod3 high
+
+ and %r11, %rdi C 0mod3 low
+ mov R32(%rcx), R32(%r10) C 1mod3
+
+ shr $32, %rcx C 1mod3 high
+
+ add %rdi, %rax C apply 0mod3 low
+ movzwl %dx, R32(%rdi) C 2mod3
+ shl $16, %r10 C 1mod3 low
+
+ add %rcx, %rax C apply 1mod3 high
+ shr $16, %rdx C 2mod3 high
+
+ add %r10, %rax C apply 1mod3 low
+ shl $32, %rdi C 2mod3 low
+
+ add %rdx, %rax C apply 2mod3 high
+ add %rdi, %rax C apply 2mod3 low
+
+ FUNC_EXIT()
+ ret
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/mode1o.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/mode1o.asm
new file mode 100644
index 00000000000..2cd2b088481
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/mode1o.asm
@@ -0,0 +1,171 @@
+dnl AMD64 mpn_modexact_1_odd -- Hensel norm remainder.
+
+dnl Copyright 2000-2006, 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/limb
+C AMD K8,K9 10
+C AMD K10 10
+C Intel P4 33
+C Intel core2 13
+C Intel corei 14.5
+C Intel atom 35
+C VIA nano ?
+
+
+C The dependent chain in the main loop is
+C
+C cycles
+C sub %rdx, %rax 1
+C imul %r9, %rax 4
+C mul %r8 5
+C ----
+C total 10
+C
+C The mov load from src seems to need to be scheduled back before the jz to
+C achieve this speed, out-of-order execution apparently can't completely hide
+C the latency otherwise.
+C
+C The l=src[i]-cbit step is rotated back too, since that allows us to avoid it
+C for the first iteration (where there's no cbit).
+C
+C The code alignment used (32-byte) for the loop also seems necessary. Without
+C that the non-PIC case has adc crossing the 0x60 offset, apparently making it
+C run at 11 cycles instead of 10.
+
+
+ABI_SUPPORT(DOS64)
+ABI_SUPPORT(STD64)
+
+ASM_START()
+ TEXT
+ ALIGN(32)
+PROLOGUE(mpn_modexact_1_odd)
+ FUNC_ENTRY(3)
+ mov $0, R32(%rcx)
+IFDOS(` jmp L(ent) ')
+
+PROLOGUE(mpn_modexact_1c_odd)
+ FUNC_ENTRY(4)
+L(ent):
+ C rdi src
+ C rsi size
+ C rdx divisor
+ C rcx carry
+
+ mov %rdx, %r8 C d
+ shr R32(%rdx) C d/2
+
+ LEA( binvert_limb_table, %r9)
+
+ and $127, R32(%rdx)
+ mov %rcx, %r10 C initial carry
+
+ movzbl (%r9,%rdx), R32(%rdx) C inv 8 bits
+
+ mov (%rdi), %rax C src[0]
+ lea (%rdi,%rsi,8), %r11 C src end
+ mov %r8, %rdi C d, made available to imull
+
+ lea (%rdx,%rdx), R32(%rcx) C 2*inv
+ imul R32(%rdx), R32(%rdx) C inv*inv
+
+ neg %rsi C -size
+
+ imul R32(%rdi), R32(%rdx) C inv*inv*d
+
+ sub R32(%rdx), R32(%rcx) C inv = 2*inv - inv*inv*d, 16 bits
+
+ lea (%rcx,%rcx), R32(%rdx) C 2*inv
+ imul R32(%rcx), R32(%rcx) C inv*inv
+
+ imul R32(%rdi), R32(%rcx) C inv*inv*d
+
+ sub R32(%rcx), R32(%rdx) C inv = 2*inv - inv*inv*d, 32 bits
+ xor R32(%rcx), R32(%rcx) C initial cbit
+
+ lea (%rdx,%rdx), %r9 C 2*inv
+ imul %rdx, %rdx C inv*inv
+
+ imul %r8, %rdx C inv*inv*d
+
+ sub %rdx, %r9 C inv = 2*inv - inv*inv*d, 64 bits
+ mov %r10, %rdx C initial climb
+
+ ASSERT(e,` C d*inv == 1 mod 2^64
+ mov %r8, %r10
+ imul %r9, %r10
+ cmp $1, %r10')
+
+ inc %rsi
+ jz L(one)
+
+
+ ALIGN(16)
+L(top):
+ C rax l = src[i]-cbit
+ C rcx new cbit, 0 or 1
+ C rdx climb, high of last product
+ C rsi counter, limbs, negative
+ C rdi
+ C r8 divisor
+ C r9 inverse
+ C r11 src end ptr
+
+ sub %rdx, %rax C l = src[i]-cbit - climb
+
+ adc $0, %rcx C more cbit
+ imul %r9, %rax C q = l * inverse
+
+ mul %r8 C climb = high (q * d)
+
+ mov (%r11,%rsi,8), %rax C src[i+1]
+ sub %rcx, %rax C next l = src[i+1] - cbit
+ setc R8(%rcx) C new cbit
+
+ inc %rsi
+ jnz L(top)
+
+
+L(one):
+ sub %rdx, %rax C l = src[i]-cbit - climb
+
+ adc $0, %rcx C more cbit
+ imul %r9, %rax C q = l * inverse
+
+ mul %r8 C climb = high (q * d)
+
+ lea (%rcx,%rdx), %rax C climb+cbit
+ FUNC_EXIT()
+ ret
+
+EPILOGUE(mpn_modexact_1c_odd)
+EPILOGUE(mpn_modexact_1_odd)
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/mul_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/mul_1.asm
new file mode 100644
index 00000000000..b032afc9ddb
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/mul_1.asm
@@ -0,0 +1,183 @@
+dnl AMD64 mpn_mul_1.
+
+dnl Copyright 2003-2005, 2007, 2008, 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/limb
+C AMD K8,K9 2.5
+C AMD K10 2.5
+C AMD bd1 5.0
+C AMD bobcat 5.5
+C Intel P4 12.3
+C Intel core2 4.0
+C Intel NHM 3.75
+C Intel SBR 2.95
+C Intel atom 19.8
+C VIA nano 4.25
+
+C The loop of this code is the result of running a code generation and
+C optimization tool suite written by David Harvey and Torbjorn Granlund.
+
+C TODO
+C * The loop is great, but the prologue and epilogue code was quickly written.
+C Tune it!
+
+define(`rp', `%rdi') C rcx
+define(`up', `%rsi') C rdx
+define(`n_param', `%rdx') C r8
+define(`vl', `%rcx') C r9
+
+define(`n', `%r11')
+
+ABI_SUPPORT(DOS64)
+ABI_SUPPORT(STD64)
+
+IFDOS(` define(`up', ``%rsi'') ') dnl
+IFDOS(` define(`rp', ``%rcx'') ') dnl
+IFDOS(` define(`vl', ``%r9'') ') dnl
+IFDOS(` define(`r9', ``rdi'') ') dnl
+IFDOS(` define(`n', ``%r8'') ') dnl
+IFDOS(` define(`r8', ``r11'') ') dnl
+
+ASM_START()
+ TEXT
+ ALIGN(16)
+PROLOGUE(mpn_mul_1c)
+IFDOS(``push %rsi '')
+IFDOS(``push %rdi '')
+IFDOS(``mov %rdx, %rsi '')
+ push %rbx
+IFSTD(` mov %r8, %r10')
+IFDOS(` mov 64(%rsp), %r10') C 40 + 3*8 (3 push insns)
+ jmp L(common)
+EPILOGUE()
+
+PROLOGUE(mpn_mul_1)
+IFDOS(``push %rsi '')
+IFDOS(``push %rdi '')
+IFDOS(``mov %rdx, %rsi '')
+
+ push %rbx
+ xor %r10, %r10
+L(common):
+ mov (up), %rax C read first u limb early
+IFSTD(` mov n_param, %rbx ') C move away n from rdx, mul uses it
+IFDOS(` mov n, %rbx ')
+ mul vl
+IFSTD(` mov %rbx, n ')
+
+ add %r10, %rax
+ adc $0, %rdx
+
+ and $3, R32(%rbx)
+ jz L(b0)
+ cmp $2, R32(%rbx)
+ jz L(b2)
+ jg L(b3)
+
+L(b1): dec n
+ jne L(gt1)
+ mov %rax, (rp)
+ jmp L(ret)
+L(gt1): lea 8(up,n,8), up
+ lea -8(rp,n,8), rp
+ neg n
+ xor %r10, %r10
+ xor R32(%rbx), R32(%rbx)
+ mov %rax, %r9
+ mov (up,n,8), %rax
+ mov %rdx, %r8
+ jmp L(L1)
+
+L(b0): lea (up,n,8), up
+ lea -16(rp,n,8), rp
+ neg n
+ xor %r10, %r10
+ mov %rax, %r8
+ mov %rdx, %rbx
+ jmp L(L0)
+
+L(b3): lea -8(up,n,8), up
+ lea -24(rp,n,8), rp
+ neg n
+ mov %rax, %rbx
+ mov %rdx, %r10
+ jmp L(L3)
+
+L(b2): lea -16(up,n,8), up
+ lea -32(rp,n,8), rp
+ neg n
+ xor %r8, %r8
+ xor R32(%rbx), R32(%rbx)
+ mov %rax, %r10
+ mov 24(up,n,8), %rax
+ mov %rdx, %r9
+ jmp L(L2)
+
+ ALIGN(16)
+L(top): mov %r10, (rp,n,8)
+ add %rax, %r9
+ mov (up,n,8), %rax
+ adc %rdx, %r8
+ mov $0, R32(%r10)
+L(L1): mul vl
+ mov %r9, 8(rp,n,8)
+ add %rax, %r8
+ adc %rdx, %rbx
+L(L0): mov 8(up,n,8), %rax
+ mul vl
+ mov %r8, 16(rp,n,8)
+ add %rax, %rbx
+ adc %rdx, %r10
+L(L3): mov 16(up,n,8), %rax
+ mul vl
+ mov %rbx, 24(rp,n,8)
+ mov $0, R32(%r8) C zero
+ mov %r8, %rbx C zero
+ add %rax, %r10
+ mov 24(up,n,8), %rax
+ mov %r8, %r9 C zero
+ adc %rdx, %r9
+L(L2): mul vl
+ add $4, n
+ js L(top)
+
+ mov %r10, (rp,n,8)
+ add %rax, %r9
+ adc %r8, %rdx
+ mov %r9, 8(rp,n,8)
+ add %r8, %rdx
+L(ret): mov %rdx, %rax
+
+ pop %rbx
+IFDOS(``pop %rdi '')
+IFDOS(``pop %rsi '')
+ ret
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/mul_2.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/mul_2.asm
new file mode 100644
index 00000000000..f408c52250e
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/mul_2.asm
@@ -0,0 +1,192 @@
+dnl AMD64 mpn_mul_2 -- Multiply an n-limb vector with a 2-limb vector and
+dnl store the result in a third limb vector.
+
+dnl Copyright 2008, 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/limb
+C AMD K8,K9 2.275
+C AMD K10 2.275
+C Intel P4 13.5
+C Intel core2 4.0
+C Intel corei 3.8
+C Intel atom ?
+C VIA nano ?
+
+C This code is the result of running a code generation and optimization tool
+C suite written by David Harvey and Torbjorn Granlund.
+
+C TODO
+C * Work on feed-in and wind-down code.
+C * Convert "mov $0" to "xor".
+C * Adjust initial lea to save some bytes.
+C * Perhaps adjust n from n_param&3 value?
+C * Replace with 2.25 c/l sequence.
+
+C INPUT PARAMETERS
+define(`rp', `%rdi')
+define(`up', `%rsi')
+define(`n_param',`%rdx')
+define(`vp', `%rcx')
+
+define(`v0', `%r8')
+define(`v1', `%r9')
+define(`w0', `%rbx')
+define(`w1', `%rcx')
+define(`w2', `%rbp')
+define(`w3', `%r10')
+define(`n', `%r11')
+
+ABI_SUPPORT(DOS64)
+ABI_SUPPORT(STD64)
+
+ASM_START()
+ TEXT
+ ALIGN(16)
+PROLOGUE(mpn_mul_2)
+ FUNC_ENTRY(4)
+ push %rbx
+ push %rbp
+
+ mov (vp), v0
+ mov 8(vp), v1
+
+ mov (up), %rax
+
+ mov n_param, n
+ neg n
+ lea -8(up,n_param,8), up
+ lea -8(rp,n_param,8), rp
+
+ and $3, R32(n_param)
+ jz L(m2p0)
+ cmp $2, R32(n_param)
+ jc L(m2p1)
+ jz L(m2p2)
+L(m2p3):
+ mul v0
+ xor R32(w3), R32(w3)
+ mov %rax, w1
+ mov %rdx, w2
+ mov 8(up,n,8), %rax
+ add $-1, n
+ mul v1
+ add %rax, w2
+ jmp L(m23)
+L(m2p0):
+ mul v0
+ xor R32(w2), R32(w2)
+ mov %rax, w0
+ mov %rdx, w1
+ jmp L(m20)
+L(m2p1):
+ mul v0
+ xor R32(w3), R32(w3)
+ xor R32(w0), R32(w0)
+ xor R32(w1), R32(w1)
+ add $1, n
+ jmp L(m2top)
+L(m2p2):
+ mul v0
+ xor R32(w0), R32(w0)
+ xor R32(w1), R32(w1)
+ mov %rax, w2
+ mov %rdx, w3
+ mov 8(up,n,8), %rax
+ add $-2, n
+ jmp L(m22)
+
+
+ ALIGN(32)
+L(m2top):
+ add %rax, w3
+ adc %rdx, w0
+ mov 0(up,n,8), %rax
+ adc $0, R32(w1)
+ mov $0, R32(w2)
+ mul v1
+ add %rax, w0
+ mov w3, 0(rp,n,8)
+ adc %rdx, w1
+ mov 8(up,n,8), %rax
+ mul v0
+ add %rax, w0
+ adc %rdx, w1
+ adc $0, R32(w2)
+L(m20): mov 8(up,n,8), %rax
+ mul v1
+ add %rax, w1
+ adc %rdx, w2
+ mov 16(up,n,8), %rax
+ mov $0, R32(w3)
+ mul v0
+ add %rax, w1
+ mov 16(up,n,8), %rax
+ adc %rdx, w2
+ adc $0, R32(w3)
+ mul v1
+ add %rax, w2
+ mov w0, 8(rp,n,8)
+L(m23): adc %rdx, w3
+ mov 24(up,n,8), %rax
+ mul v0
+ mov $0, R32(w0)
+ add %rax, w2
+ adc %rdx, w3
+ mov w1, 16(rp,n,8)
+ mov 24(up,n,8), %rax
+ mov $0, R32(w1)
+ adc $0, R32(w0)
+L(m22): mul v1
+ add %rax, w3
+ mov w2, 24(rp,n,8)
+ adc %rdx, w0
+ mov 32(up,n,8), %rax
+ mul v0
+ add $4, n
+ js L(m2top)
+
+
+ add %rax, w3
+ adc %rdx, w0
+ adc $0, R32(w1)
+ mov (up), %rax
+ mul v1
+ mov w3, (rp)
+ add %rax, w0
+ adc %rdx, w1
+ mov w0, 8(rp)
+ mov w1, %rax
+
+ pop %rbp
+ pop %rbx
+ FUNC_EXIT()
+ ret
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/mulx/adx/addmul_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/mulx/adx/addmul_1.asm
new file mode 100644
index 00000000000..ea607899a4c
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/mulx/adx/addmul_1.asm
@@ -0,0 +1,149 @@
+dnl AMD64 mpn_addmul_1 for CPUs with mulx and adx.
+
+dnl Contributed to the GNU project by Torbjörn Granlund.
+
+dnl Copyright 2012, 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/limb
+C AMD K8,K9 -
+C AMD K10 -
+C AMD bd1 -
+C AMD bobcat -
+C Intel P4 -
+C Intel PNR -
+C Intel NHM -
+C Intel SBR -
+C Intel HWL -
+C Intel BWL ?
+C Intel atom -
+C VIA nano -
+
+define(`rp', `%rdi') dnl rcx
+define(`up', `%rsi') dnl rdx
+define(`n_param', `%rdx') dnl r8
+define(`v0_param',`%rcx') dnl r9
+
+define(`n', `%rcx') dnl
+define(`v0', `%rdx') dnl
+
+C Testing mechanism for running this on older AMD64 processors
+ifelse(FAKE_MULXADX,1,`
+ include(CONFIG_TOP_SRCDIR`/mpn/x86_64/missing-call.m4')
+',`
+ define(`adox', ``adox' $1, $2')
+ define(`adcx', ``adcx' $1, $2')
+ define(`mulx', ``mulx' $1, $2, $3')
+')
+
+ASM_START()
+ TEXT
+ ALIGN(16)
+PROLOGUE(mpn_addmul_1)
+ mov (up), %r8
+
+ push %rbx
+ push %r12
+ push %r13
+
+ lea (up,n_param,8), up
+ lea -16(rp,n_param,8), rp
+ mov R32(n_param), R32(%rax)
+ xchg v0_param, v0 C FIXME: is this insn fast?
+
+ neg n
+
+ and $3, R8(%rax)
+ jz L(b0)
+ cmp $2, R8(%rax)
+ jl L(b1)
+ jz L(b2)
+
+L(b3): mulx( (up,n,8), %r11, %r10)
+ mulx( 8(up,n,8), %r13, %r12)
+ mulx( 16(up,n,8), %rbx, %rax)
+ dec n
+ jmp L(lo3)
+
+L(b0): mulx( (up,n,8), %r9, %r8)
+ mulx( 8(up,n,8), %r11, %r10)
+ mulx( 16(up,n,8), %r13, %r12)
+ jmp L(lo0)
+
+L(b2): mulx( (up,n,8), %r13, %r12)
+ mulx( 8(up,n,8), %rbx, %rax)
+ lea 2(n), n
+ jrcxz L(wd2)
+L(gt2): mulx( (up,n,8), %r9, %r8)
+ jmp L(lo2)
+
+L(b1): and R8(%rax), R8(%rax)
+ mulx( (up,n,8), %rbx, %rax)
+ lea 1(n), n
+ jrcxz L(wd1)
+ mulx( (up,n,8), %r9, %r8)
+ mulx( 8(up,n,8), %r11, %r10)
+ jmp L(lo1)
+
+L(end): adcx( %r10, %r13)
+ mov %r11, -8(rp)
+L(wd2): adox( (rp), %r13)
+ adcx( %r12, %rbx)
+ mov %r13, (rp)
+L(wd1): adox( 8(rp), %rbx)
+ adcx( %rcx, %rax)
+ adox( %rcx, %rax)
+ mov %rbx, 8(rp)
+ pop %r13
+ pop %r12
+ pop %rbx
+ ret
+
+L(top): jrcxz L(end)
+ mulx( (up,n,8), %r9, %r8)
+ adcx( %r10, %r13)
+ mov %r11, -8(rp,n,8)
+L(lo2): adox( (rp,n,8), %r13)
+ mulx( 8(up,n,8), %r11, %r10)
+ adcx( %r12, %rbx)
+ mov %r13, (rp,n,8)
+L(lo1): adox( 8(rp,n,8), %rbx)
+ mulx( 16(up,n,8), %r13, %r12)
+ adcx( %rax, %r9)
+ mov %rbx, 8(rp,n,8)
+L(lo0): adox( 16(rp,n,8), %r9)
+ mulx( 24(up,n,8), %rbx, %rax)
+ adcx( %r8, %r11)
+ mov %r9, 16(rp,n,8)
+L(lo3): adox( 24(rp,n,8), %r11)
+ lea 4(n), n
+ jmp L(top)
+EPILOGUE()
+ASM_END()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/mulx/aorsmul_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/mulx/aorsmul_1.asm
new file mode 100644
index 00000000000..285c07335e8
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/mulx/aorsmul_1.asm
@@ -0,0 +1,161 @@
+dnl AMD64 mpn_addmul_1 and mpn_submul_1 for CPUs with mulx.
+
+dnl Copyright 2012, 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/limb
+C AMD K8,K9 -
+C AMD K10 -
+C AMD bd1 -
+C AMD bd2 ?
+C AMD bobcat -
+C AMD jaguar ?
+C Intel P4 -
+C Intel PNR -
+C Intel NHM -
+C Intel SBR -
+C Intel HWL ?
+C Intel BWL ?
+C Intel atom -
+C VIA nano -
+
+define(`rp', `%rdi') C rcx
+define(`up', `%rsi') C rdx
+define(`n_param', `%rdx') C r8
+define(`v0_param',`%rcx') C r9
+
+define(`n', `%rcx')
+define(`v0', `%rdx')
+
+ifdef(`OPERATION_addmul_1',`
+ define(`ADDSUB', `add')
+ define(`ADCSBB', `adc')
+ define(`func', `mpn_addmul_1')
+')
+ifdef(`OPERATION_submul_1',`
+ define(`ADDSUB', `sub')
+ define(`ADCSBB', `sbb')
+ define(`func', `mpn_submul_1')
+')
+
+MULFUNC_PROLOGUE(mpn_addmul_1 mpn_submul_1)
+
+IFDOS(` define(`up', ``%rsi'') ') dnl
+IFDOS(` define(`rp', ``%rcx'') ') dnl
+IFDOS(` define(`vl', ``%r9'') ') dnl
+IFDOS(` define(`r9', ``rdi'') ') dnl
+IFDOS(` define(`n', ``%r8'') ') dnl
+IFDOS(` define(`r8', ``r11'') ') dnl
+
+ASM_START()
+ TEXT
+ ALIGN(16)
+PROLOGUE(func)
+ mov (up), %r8
+
+ push %rbx
+ push %r12
+ push %r13
+
+ lea (up,n_param,8), up
+ lea -32(rp,n_param,8), rp
+ mov R32(n_param), R32(%rax)
+ xchg v0_param, v0 C FIXME: is this insn fast?
+
+ neg n
+
+ and $3, R8(%rax)
+ jz L(b0)
+ cmp $2, R8(%rax)
+ jz L(b2)
+ jg L(b3)
+
+L(b1): mulx %r8, %rbx, %rax
+ sub $-1, n
+ jz L(wd1)
+ mulx (up,n,8), %r9, %r8
+ mulx 8(up,n,8), %r11, %r10
+ test R32(%rax), R32(%rax) C clear cy
+ jmp L(lo1)
+
+L(b0): mulx %r8, %r9, %r8
+ mulx 8(up,n,8), %r11, %r10
+ mulx 16(up,n,8), %r13, %r12
+ xor R32(%rax), R32(%rax)
+ jmp L(lo0)
+
+L(b3): mulx %r8, %r11, %r10
+ mulx 8(up,n,8), %r13, %r12
+ mulx 16(up,n,8), %rbx, %rax
+ add %r10, %r13
+ adc %r12, %rbx
+ adc $0, %rax
+ sub $-3, n
+ jz L(wd3)
+ test R32(%rax), R32(%rax) C clear cy
+ jmp L(lo3)
+
+L(b2): mulx %r8, %r13, %r12
+ mulx 8(up,n,8), %rbx, %rax
+ add %r12, %rbx
+ adc $0, %rax
+ sub $-2, n
+ jz L(wd2)
+ mulx (up,n,8), %r9, %r8
+ test R32(%rax), R32(%rax) C clear cy
+ jmp L(lo2)
+
+L(top): ADDSUB %r9, (rp,n,8)
+L(lo3): mulx (up,n,8), %r9, %r8
+ ADCSBB %r11, 8(rp,n,8)
+L(lo2): mulx 8(up,n,8), %r11, %r10
+ ADCSBB %r13, 16(rp,n,8)
+L(lo1): mulx 16(up,n,8), %r13, %r12
+ ADCSBB %rbx, 24(rp,n,8)
+ adc %rax, %r9
+L(lo0): mulx 24(up,n,8), %rbx, %rax
+ adc %r8, %r11
+ adc %r10, %r13
+ adc %r12, %rbx
+ adc $0, %rax C rax = carry limb
+ add $4, n
+ js L(top)
+
+L(end): ADDSUB %r9, (rp)
+L(wd3): ADCSBB %r11, 8(rp)
+L(wd2): ADCSBB %r13, 16(rp)
+L(wd1): ADCSBB %rbx, 24(rp)
+ adc n, %rax
+ pop %r13
+ pop %r12
+ pop %rbx
+ ret
+EPILOGUE()
+ASM_END()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/mulx/mul_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/mulx/mul_1.asm
new file mode 100644
index 00000000000..34a044dcdcc
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/mulx/mul_1.asm
@@ -0,0 +1,154 @@
+dnl AMD64 mpn_mul_1 for CPUs with mulx.
+
+dnl Copyright 2012, 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/limb
+C AMD K8,K9 -
+C AMD K10 -
+C AMD bd1 -
+C AMD bd2 ?
+C AMD bobcat -
+C AMD jaguar ?
+C Intel P4 -
+C Intel PNR -
+C Intel NHM -
+C Intel SBR -
+C Intel HWL ?
+C Intel BWL ?
+C Intel atom -
+C VIA nano -
+
+define(`rp', `%rdi') C rcx
+define(`up', `%rsi') C rdx
+define(`n_param', `%rdx') C r8
+define(`v0_param',`%rcx') C r9
+
+define(`n', `%rcx')
+define(`v0', `%rdx')
+
+IFDOS(` define(`up', ``%rsi'') ') dnl
+IFDOS(` define(`rp', ``%rcx'') ') dnl
+IFDOS(` define(`v0', ``%r9'') ') dnl
+IFDOS(` define(`r9', ``rdi'') ') dnl
+IFDOS(` define(`n', ``%r8'') ') dnl
+IFDOS(` define(`r8', ``r11'') ') dnl
+
+ASM_START()
+ TEXT
+ ALIGN(16)
+PROLOGUE(mpn_mul_1c)
+ jmp L(ent)
+EPILOGUE()
+PROLOGUE(mpn_mul_1)
+ xor R32(%r8), R32(%r8) C carry-in limb
+L(ent): mov (up), %r9
+
+ push %rbx
+ push %r12
+ push %r13
+
+ lea (up,n_param,8), up
+ lea -32(rp,n_param,8), rp
+ mov R32(n_param), R32(%rax)
+ xchg v0_param, v0 C FIXME: is this insn fast?
+
+ neg n
+
+ and $3, R8(%rax)
+ jz L(b0)
+ cmp $2, R8(%rax)
+ jz L(b2)
+ jg L(b3)
+
+L(b1): mov %r8, %r12
+ mulx %r9, %rbx, %rax
+ sub $-1, n
+ jz L(wd1)
+ mulx (up,n,8), %r9, %r8
+ mulx 8(up,n,8), %r11, %r10
+ add %r12, %rbx
+ jmp L(lo1)
+
+L(b3): mulx %r9, %r11, %r10
+ mulx 8(up,n,8), %r13, %r12
+ mulx 16(up,n,8), %rbx, %rax
+ sub $-3, n
+ jz L(wd3)
+ add %r8, %r11
+ jmp L(lo3)
+
+L(b2): mov %r8, %r10 C carry-in limb
+ mulx %r9, %r13, %r12
+ mulx 8(up,n,8), %rbx, %rax
+ sub $-2, n
+ jz L(wd2)
+ mulx (up,n,8), %r9, %r8
+ add %r10, %r13
+ jmp L(lo2)
+
+L(b0): mov %r8, %rax C carry-in limb
+ mulx %r9, %r9, %r8
+ mulx 8(up,n,8), %r11, %r10
+ mulx 16(up,n,8), %r13, %r12
+ add %rax, %r9
+ jmp L(lo0)
+
+L(top): jrcxz L(end)
+ adc %r8, %r11
+ mov %r9, (rp,n,8)
+L(lo3): mulx (up,n,8), %r9, %r8
+ adc %r10, %r13
+ mov %r11, 8(rp,n,8)
+L(lo2): mulx 8(up,n,8), %r11, %r10
+ adc %r12, %rbx
+ mov %r13, 16(rp,n,8)
+L(lo1): mulx 16(up,n,8), %r13, %r12
+ adc %rax, %r9
+ mov %rbx, 24(rp,n,8)
+L(lo0): mulx 24(up,n,8), %rbx, %rax
+ lea 4(n), n
+ jmp L(top)
+
+L(end): mov %r9, (rp)
+L(wd3): adc %r8, %r11
+ mov %r11, 8(rp)
+L(wd2): adc %r10, %r13
+ mov %r13, 16(rp)
+L(wd1): adc %r12, %rbx
+ adc n, %rax
+ mov %rbx, 24(rp)
+
+ pop %r13
+ pop %r12
+ pop %rbx
+ ret
+EPILOGUE()
+ASM_END()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/nano/copyd.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/nano/copyd.asm
new file mode 100644
index 00000000000..f0dc54a55e7
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/nano/copyd.asm
@@ -0,0 +1,37 @@
+dnl X86-64 mpn_copyd optimised for Intel Sandy Bridge.
+
+dnl Copyright 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')
+
+ABI_SUPPORT(DOS64)
+ABI_SUPPORT(STD64)
+
+MULFUNC_PROLOGUE(mpn_copyd)
+include_mpn(`x86_64/fastsse/copyd-palignr.asm')
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/nano/copyi.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/nano/copyi.asm
new file mode 100644
index 00000000000..9c26e00c522
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/nano/copyi.asm
@@ -0,0 +1,37 @@
+dnl X86-64 mpn_copyi optimised for Intel Sandy Bridge.
+
+dnl Copyright 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')
+
+ABI_SUPPORT(DOS64)
+ABI_SUPPORT(STD64)
+
+MULFUNC_PROLOGUE(mpn_copyi)
+include_mpn(`x86_64/fastsse/copyi-palignr.asm')
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/nano/dive_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/nano/dive_1.asm
new file mode 100644
index 00000000000..e9a07631c4b
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/nano/dive_1.asm
@@ -0,0 +1,166 @@
+dnl AMD64 mpn_divexact_1 -- mpn by limb exact division.
+
+dnl Copyright 2001, 2002, 2004-2006, 2010-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/limb
+C norm unorm
+C AMD K8,K9 11 11
+C AMD K10 11 11
+C Intel P4 ?
+C Intel core2 13.5 13.25
+C Intel corei 14.25
+C Intel atom 34 36
+C VIA nano 19.25 19.25
+
+
+C INPUT PARAMETERS
+C rp rdi
+C up rsi
+C n rdx
+C divisor rcx
+
+ABI_SUPPORT(DOS64)
+ABI_SUPPORT(STD64)
+
+ASM_START()
+ TEXT
+ ALIGN(16)
+PROLOGUE(mpn_divexact_1)
+ FUNC_ENTRY(4)
+ push %rbx
+
+ mov %rcx, %rax
+ xor R32(%rcx), R32(%rcx) C shift count
+ mov %rdx, %r8
+
+ bt $0, R32(%rax)
+ jc L(odd) C skip bsfq unless divisor is even
+ bsf %rax, %rcx
+ shr R8(%rcx), %rax
+L(odd): mov %rax, %rbx
+ shr R32(%rax)
+ and $127, R32(%rax) C d/2, 7 bits
+
+ LEA( binvert_limb_table, %rdx)
+
+ movzbl (%rdx,%rax), R32(%rax) C inv 8 bits
+
+ mov %rbx, %r11 C d without twos
+
+ lea (%rax,%rax), R32(%rdx) C 2*inv
+ imul R32(%rax), R32(%rax) C inv*inv
+ imul R32(%rbx), R32(%rax) C inv*inv*d
+ sub R32(%rax), R32(%rdx) C inv = 2*inv - inv*inv*d, 16 bits
+
+ lea (%rdx,%rdx), R32(%rax) C 2*inv
+ imul R32(%rdx), R32(%rdx) C inv*inv
+ imul R32(%rbx), R32(%rdx) C inv*inv*d
+ sub R32(%rdx), R32(%rax) C inv = 2*inv - inv*inv*d, 32 bits
+
+ lea (%rax,%rax), %r10 C 2*inv
+ imul %rax, %rax C inv*inv
+ imul %rbx, %rax C inv*inv*d
+ sub %rax, %r10 C inv = 2*inv - inv*inv*d, 64 bits
+
+ lea (%rsi,%r8,8), %rsi C up end
+ lea -8(%rdi,%r8,8), %rdi C rp end
+ neg %r8 C -n
+
+ mov (%rsi,%r8,8), %rax C up[0]
+
+ inc %r8
+ jz L(one)
+
+ test R32(%rcx), R32(%rcx)
+ jnz L(unorm) C branch if count != 0
+ xor R32(%rbx), R32(%rbx)
+ jmp L(nent)
+
+ ALIGN(8)
+L(ntop):mul %r11 C carry limb in rdx 0 10
+ mov -8(%rsi,%r8,8), %rax C
+ sub %rbx, %rax C apply carry bit
+ setc %bl C
+ sub %rdx, %rax C apply carry limb 5
+ adc $0, %rbx C 6
+L(nent):imul %r10, %rax C 6
+ mov %rax, (%rdi,%r8,8) C
+ inc %r8 C
+ jnz L(ntop)
+
+ mov -8(%rsi), %r9 C up high limb
+ jmp L(com)
+
+L(unorm):
+ mov (%rsi,%r8,8), %r9 C up[1]
+ shr R8(%rcx), %rax C
+ neg R32(%rcx)
+ shl R8(%rcx), %r9 C
+ neg R32(%rcx)
+ or %r9, %rax
+ xor R32(%rbx), R32(%rbx)
+ jmp L(uent)
+
+ ALIGN(8)
+L(utop):mul %r11 C carry limb in rdx 0 10
+ mov (%rsi,%r8,8), %rax C
+ shl R8(%rcx), %rax C
+ neg R32(%rcx)
+ or %r9, %rax
+ sub %rbx, %rax C apply carry bit
+ setc %bl C
+ sub %rdx, %rax C apply carry limb 5
+ adc $0, %rbx C 6
+L(uent):imul %r10, %rax C 6
+ mov (%rsi,%r8,8), %r9 C
+ shr R8(%rcx), %r9 C
+ neg R32(%rcx)
+ mov %rax, (%rdi,%r8,8) C
+ inc %r8 C
+ jnz L(utop)
+
+L(com): mul %r11 C carry limb in rdx
+ sub %rbx, %r9 C apply carry bit
+ sub %rdx, %r9 C apply carry limb
+ imul %r10, %r9
+ mov %r9, (%rdi)
+ pop %rbx
+ FUNC_EXIT()
+ ret
+
+L(one): shr R8(%rcx), %rax
+ imul %r10, %rax
+ mov %rax, (%rdi)
+ pop %rbx
+ FUNC_EXIT()
+ ret
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/nano/gcd_1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/nano/gcd_1.asm
new file mode 100644
index 00000000000..3d8e5c7ab12
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/nano/gcd_1.asm
@@ -0,0 +1,37 @@
+dnl AMD64 mpn_gcd_1.
+
+dnl Copyright 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')
+
+ABI_SUPPORT(DOS64)
+ABI_SUPPORT(STD64)
+
+MULFUNC_PROLOGUE(mpn_gcd_1)
+include_mpn(`x86_64/core2/gcd_1.asm')
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/nano/gmp-mparam.h b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/nano/gmp-mparam.h
new file mode 100644
index 00000000000..fde69dbb7fc
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/nano/gmp-mparam.h
@@ -0,0 +1,243 @@
+/* VIA Nano gmp-mparam.h -- Compiler/machine parameter header file.
+
+Copyright 1991, 1993, 1994, 2000-2010, 2012, 2014 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
+
+#define SHLD_SLOW 1
+#define SHRD_SLOW 1
+
+/* 1600 MHz Nano 2xxx */
+/* FFT tuning limit = 25000000 */
+/* Generated by tuneup.c, 2014-03-12, gcc 4.2 */
+
+#define MOD_1_NORM_THRESHOLD 0 /* always */
+#define MOD_1_UNNORM_THRESHOLD 0 /* always */
+#define MOD_1N_TO_MOD_1_1_THRESHOLD 4
+#define MOD_1U_TO_MOD_1_1_THRESHOLD 2
+#define MOD_1_1_TO_MOD_1_2_THRESHOLD 18
+#define MOD_1_2_TO_MOD_1_4_THRESHOLD 20
+#define PREINV_MOD_1_TO_MOD_1_THRESHOLD 8
+#define USE_PREINV_DIVREM_1 1 /* native */
+#define DIV_QR_1_NORM_THRESHOLD 1
+#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 22
+
+#define MUL_TOOM22_THRESHOLD 27
+#define MUL_TOOM33_THRESHOLD 38
+#define MUL_TOOM44_THRESHOLD 324
+#define MUL_TOOM6H_THRESHOLD 450
+#define MUL_TOOM8H_THRESHOLD 632
+
+#define MUL_TOOM32_TO_TOOM43_THRESHOLD 73
+#define MUL_TOOM32_TO_TOOM53_THRESHOLD 207
+#define MUL_TOOM42_TO_TOOM53_THRESHOLD 211
+#define MUL_TOOM42_TO_TOOM63_THRESHOLD 219
+#define MUL_TOOM43_TO_TOOM54_THRESHOLD 315
+
+#define SQR_BASECASE_THRESHOLD 10
+#define SQR_TOOM2_THRESHOLD 52
+#define SQR_TOOM3_THRESHOLD 73
+#define SQR_TOOM4_THRESHOLD 387
+#define SQR_TOOM6_THRESHOLD 662
+#define SQR_TOOM8_THRESHOLD 781
+
+#define MULMID_TOOM42_THRESHOLD 32
+
+#define MULMOD_BNM1_THRESHOLD 14
+#define SQRMOD_BNM1_THRESHOLD 15
+
+#define MUL_FFT_MODF_THRESHOLD 376 /* k = 5 */
+#define MUL_FFT_TABLE3 \
+ { { 376, 5}, { 19, 6}, { 10, 5}, { 21, 6}, \
+ { 23, 7}, { 12, 6}, { 25, 7}, { 21, 8}, \
+ { 11, 7}, { 24, 8}, { 13, 7}, { 27, 8}, \
+ { 15, 7}, { 31, 8}, { 19, 7}, { 39, 8}, \
+ { 21, 9}, { 11, 8}, { 27, 9}, { 15, 8}, \
+ { 35, 9}, { 19, 8}, { 41, 9}, { 23, 8}, \
+ { 49, 9}, { 27,10}, { 15, 9}, { 43,10}, \
+ { 23, 9}, { 55,11}, { 15,10}, { 31, 9}, \
+ { 67,10}, { 39, 9}, { 83,10}, { 47, 9}, \
+ { 95,10}, { 79,11}, { 47,10}, { 103,12}, \
+ { 31,11}, { 63,10}, { 143,11}, { 79,10}, \
+ { 159, 9}, { 319,10}, { 175,11}, { 95, 9}, \
+ { 383, 8}, { 767,10}, { 207,11}, { 111,12}, \
+ { 63,11}, { 127,10}, { 255,11}, { 143, 9}, \
+ { 575, 8}, { 1151,10}, { 303,11}, { 159,10}, \
+ { 319, 9}, { 639, 8}, { 1279,10}, { 335,12}, \
+ { 95,11}, { 191,10}, { 383, 9}, { 767,11}, \
+ { 207,10}, { 415, 9}, { 831, 8}, { 1663,10}, \
+ { 447,13}, { 63,12}, { 127,11}, { 255,10}, \
+ { 511, 9}, { 1023,11}, { 271,10}, { 543, 9}, \
+ { 1087,10}, { 575, 9}, { 1215,12}, { 159,11}, \
+ { 319,10}, { 639, 9}, { 1279,11}, { 335,10}, \
+ { 671, 9}, { 1343,11}, { 351,10}, { 703, 9}, \
+ { 1407,12}, { 191,11}, { 383,10}, { 767, 9}, \
+ { 1535,10}, { 831, 9}, { 1663,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,10}, { 1343,12}, { 351,11}, { 703,10}, \
+ { 1407,13}, { 191,12}, { 383,11}, { 767,10}, \
+ { 1535,12}, { 415,11}, { 831,10}, { 1663,12}, \
+ { 447,11}, { 895,10}, { 1791,14}, { 127,13}, \
+ { 255,12}, { 511,11}, { 1023,12}, { 543,11}, \
+ { 1087,12}, { 575,11}, { 1151,12}, { 607,11}, \
+ { 1215,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}, { 895,11}, { 1791,13}, \
+ { 511,12}, { 1023,11}, { 2047,12}, { 1087,13}, \
+ { 575,12}, { 1151,11}, { 2303,12}, { 1215,13}, \
+ { 639,12}, { 1279,11}, { 2559,12}, { 1343,13}, \
+ { 703,12}, { 1407,14}, { 383,13}, { 767,12}, \
+ { 1535,13}, { 831,12}, { 1663,13}, { 895,12}, \
+ { 1791,13}, { 959,14}, { 511,13}, { 1023,12}, \
+ { 2047,13}, { 1087,12}, { 2175,13}, { 1151,12}, \
+ { 2303,13}, { 1215,14}, { 639,13}, { 1279,12}, \
+ { 2559,13}, { 1407,12}, { 2815,13}, { 1471,14}, \
+ { 767,13}, { 1535,12}, { 3071,13}, { 1663,14}, \
+ { 895,13}, { 1791,12}, { 3583,13}, { 1919,15}, \
+ { 511,14}, { 1023,13}, { 2047,12}, { 4095,13}, \
+ { 2175,14}, { 1151,13}, { 2303,12}, { 4607,13}, \
+ { 2431,14}, { 1279,13}, { 2559,12}, { 5119,14}, \
+ { 1407,13}, { 2815,12}, { 5631,15}, { 32768,16}, \
+ { 65536,17}, { 131072,18}, { 262144,19}, { 524288,20}, \
+ {1048576,21}, {2097152,22}, {4194304,23}, {8388608,24} }
+#define MUL_FFT_TABLE3_SIZE 224
+#define MUL_FFT_THRESHOLD 3520
+
+#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}, { 24, 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}, { 51,11}, \
+ { 15,10}, { 31, 9}, { 67,10}, { 39, 9}, \
+ { 79,10}, { 47, 9}, { 95,10}, { 55,11}, \
+ { 31,10}, { 63, 9}, { 127,10}, { 71, 9}, \
+ { 143,10}, { 79,11}, { 47,10}, { 95, 9}, \
+ { 191,10}, { 103,12}, { 31,11}, { 63,10}, \
+ { 127, 9}, { 255,10}, { 135, 7}, { 1087, 9}, \
+ { 287,11}, { 79, 9}, { 319, 8}, { 639,10}, \
+ { 167,11}, { 95,10}, { 191, 9}, { 383, 8}, \
+ { 767,11}, { 111,12}, { 63,11}, { 127,10}, \
+ { 255, 9}, { 511, 8}, { 1023,10}, { 271, 9}, \
+ { 543, 8}, { 1087,11}, { 143, 9}, { 575, 8}, \
+ { 1151,10}, { 303, 9}, { 639, 8}, { 1279,10}, \
+ { 335, 9}, { 671,10}, { 351, 9}, { 703,12}, \
+ { 95,11}, { 191,10}, { 383, 9}, { 767,11}, \
+ { 207,10}, { 415, 9}, { 831,13}, { 63,12}, \
+ { 127,11}, { 255,10}, { 511, 9}, { 1023,11}, \
+ { 271,10}, { 543, 9}, { 1087,10}, { 575, 9}, \
+ { 1151,11}, { 303,10}, { 607, 9}, { 1215,12}, \
+ { 159,11}, { 319,10}, { 639, 9}, { 1279,10}, \
+ { 671, 9}, { 1343,11}, { 351,10}, { 703, 9}, \
+ { 1407,12}, { 191,11}, { 383,10}, { 767, 9}, \
+ { 1535,11}, { 415,10}, { 831, 9}, { 1663,12}, \
+ { 223,11}, { 447,10}, { 959,13}, { 127,12}, \
+ { 255,11}, { 511,10}, { 1023,11}, { 543,10}, \
+ { 1087,11}, { 575,10}, { 1215,12}, { 319,11}, \
+ { 639,10}, { 1279,11}, { 671,10}, { 1343,12}, \
+ { 351,11}, { 703,10}, { 1407,13}, { 191,12}, \
+ { 383,11}, { 767,10}, { 1535,12}, { 415,11}, \
+ { 831,10}, { 1663,12}, { 447,11}, { 895,10}, \
+ { 1791,12}, { 479,11}, { 959,14}, { 127,12}, \
+ { 511,11}, { 1023,12}, { 543,11}, { 1087,12}, \
+ { 575,11}, { 1151,12}, { 607,11}, { 1215,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}, { 895,11}, { 1791,12}, { 959,13}, \
+ { 511,12}, { 1023,11}, { 2047,12}, { 1087,13}, \
+ { 575,12}, { 1215,13}, { 639,12}, { 1343,13}, \
+ { 703,12}, { 1407,11}, { 2815,13}, { 767,12}, \
+ { 1535,13}, { 831,12}, { 1663,13}, { 895,12}, \
+ { 1791,13}, { 959,14}, { 511,13}, { 1023,12}, \
+ { 2047,13}, { 1087,12}, { 2175,13}, { 1215,14}, \
+ { 639,13}, { 1279,12}, { 2559,13}, { 1407,12}, \
+ { 2815,14}, { 767,13}, { 1535,12}, { 3071,13}, \
+ { 1663,14}, { 895,13}, { 1791,12}, { 3583,13}, \
+ { 1919,15}, { 511,14}, { 1023,13}, { 2047,12}, \
+ { 4095,13}, { 2175,14}, { 1151,13}, { 2303,12}, \
+ { 4607,14}, { 1279,13}, { 2559,14}, { 1407,13}, \
+ { 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 230
+#define SQR_FFT_THRESHOLD 2496
+
+#define MULLO_BASECASE_THRESHOLD 13
+#define MULLO_DC_THRESHOLD 38
+#define MULLO_MUL_N_THRESHOLD 6633
+
+#define DC_DIV_QR_THRESHOLD 56
+#define DC_DIVAPPR_Q_THRESHOLD 173
+#define DC_BDIV_QR_THRESHOLD 55
+#define DC_BDIV_Q_THRESHOLD 96
+
+#define INV_MULMOD_BNM1_THRESHOLD 54
+#define INV_NEWTON_THRESHOLD 202
+#define INV_APPR_THRESHOLD 166
+
+#define BINV_NEWTON_THRESHOLD 246
+#define REDC_1_TO_REDC_2_THRESHOLD 7
+#define REDC_2_TO_REDC_N_THRESHOLD 85
+
+#define MU_DIV_QR_THRESHOLD 1499
+#define MU_DIVAPPR_Q_THRESHOLD 1652
+#define MUPI_DIV_QR_THRESHOLD 83
+#define MU_BDIV_QR_THRESHOLD 1210
+#define MU_BDIV_Q_THRESHOLD 1499
+
+#define POWM_SEC_TABLE 1,28,129,642,2387
+
+#define MATRIX22_STRASSEN_THRESHOLD 15
+#define HGCD_THRESHOLD 127
+#define HGCD_APPR_THRESHOLD 214
+#define HGCD_REDUCE_THRESHOLD 2479
+#define GCD_DC_THRESHOLD 487
+#define GCDEXT_DC_THRESHOLD 505
+#define JACOBI_BASE_METHOD 4
+
+#define GET_STR_DC_THRESHOLD 12
+#define GET_STR_PRECOMPUTE_THRESHOLD 24
+#define SET_STR_DC_THRESHOLD 802
+#define SET_STR_PRECOMPUTE_THRESHOLD 2042
+
+#define FAC_DSC_THRESHOLD 1737
+#define FAC_ODD_THRESHOLD 44
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/nano/popcount.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/nano/popcount.asm
new file mode 100644
index 00000000000..fb14dd3d318
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/nano/popcount.asm
@@ -0,0 +1,35 @@
+dnl x86-64 mpn_popcount.
+
+dnl Copyright 2007, 2011 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_popcount)
+include_mpn(`x86/pentium4/sse2/popcount.asm')
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/pentium4/aors_n.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/pentium4/aors_n.asm
new file mode 100644
index 00000000000..8e6ee1bae6b
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/pentium4/aors_n.asm
@@ -0,0 +1,196 @@
+dnl x86-64 mpn_add_n/mpn_sub_n optimized for Pentium 4.
+
+dnl Contributed to the GNU project by Torbjorn Granlund.
+
+dnl Copyright 2007, 2008, 2010-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/limb
+C AMD K8,K9 2.8
+C AMD K10 2.8
+C Intel P4 4
+C Intel core2 3.6-5 (fluctuating)
+C Intel corei ?
+C Intel atom ?
+C VIA nano ?
+
+
+C INPUT PARAMETERS
+define(`rp', `%rdi')
+define(`up', `%rsi')
+define(`vp', `%rdx')
+define(`n', `%rcx')
+define(`cy', `%r8')
+
+ifdef(`OPERATION_add_n', `
+ define(ADDSUB, add)
+ define(func, mpn_add_n)
+ define(func_nc, mpn_add_nc)')
+ifdef(`OPERATION_sub_n', `
+ define(ADDSUB, sub)
+ define(func, mpn_sub_n)
+ define(func_nc, mpn_sub_nc)')
+
+ABI_SUPPORT(DOS64)
+ABI_SUPPORT(STD64)
+
+MULFUNC_PROLOGUE(mpn_add_n mpn_add_nc mpn_sub_n mpn_sub_nc)
+ASM_START()
+ TEXT
+PROLOGUE(func)
+ FUNC_ENTRY(4)
+ xor %r8, %r8
+IFDOS(` jmp L(ent) ')
+EPILOGUE()
+PROLOGUE(func_nc)
+ FUNC_ENTRY(4)
+IFDOS(` mov 56(%rsp), %r8 ')
+L(ent): push %rbx
+ push %r12
+
+ mov (vp), %r9
+
+ mov R32(n), R32(%rax)
+ and $3, R32(%rax)
+ jne L(n00) C n = 0, 4, 8, ...
+ mov R32(%r8), R32(%rbx)
+ mov (up), %r8
+ mov 8(up), %r10
+ ADDSUB %r9, %r8
+ mov 8(vp), %r9
+ setc R8(%rax)
+ lea -16(rp), rp
+ jmp L(L00)
+
+L(n00): cmp $2, R32(%rax)
+ jnc L(n01) C n = 1, 5, 9, ...
+ mov (up), %r11
+ mov R32(%r8), R32(%rax)
+ xor R32(%rbx), R32(%rbx)
+ dec n
+ jnz L(gt1)
+ ADDSUB %r9, %r11
+ setc R8(%rbx)
+ ADDSUB %rax, %r11
+ adc $0, R32(%rbx)
+ mov %r11, (rp)
+ jmp L(ret)
+L(gt1): mov 8(up), %r8
+ ADDSUB %r9, %r11
+ mov 8(vp), %r9
+ setc R8(%rbx)
+ lea -8(rp), rp
+ lea 8(up), up
+ lea 8(vp), vp
+ jmp L(L01)
+
+L(n01): jne L(n10) C n = 2, 6, 10, ...
+ mov (up), %r12
+ mov R32(%r8), R32(%rbx)
+ mov 8(up), %r11
+ ADDSUB %r9, %r12
+ mov 8(vp), %r9
+ setc R8(%rax)
+ lea -32(rp), rp
+ lea 16(up), up
+ lea 16(vp), vp
+ jmp L(L10)
+
+L(n10): mov (up), %r10 C n = 3, 7, 11, ...
+ mov R32(%r8), R32(%rax)
+ xor R32(%rbx), R32(%rbx)
+ mov 8(up), %r12
+ ADDSUB %r9, %r10
+ mov 8(vp), %r9
+ setc R8(%rbx)
+ lea -24(rp), rp
+ lea -8(up), up
+ lea -8(vp), vp
+ jmp L(L11)
+
+L(c0): mov $1, R8(%rbx)
+ jmp L(rc0)
+L(c1): mov $1, R8(%rax)
+ jmp L(rc1)
+L(c2): mov $1, R8(%rbx)
+ jmp L(rc2)
+L(c3): mov $1, R8(%rax)
+ jmp L(rc3)
+
+ ALIGN(16)
+L(top): mov (up), %r8 C not on critical path
+ ADDSUB %r9, %r11 C not on critical path
+ mov (vp), %r9 C not on critical path
+ setc R8(%rbx) C save carry out
+ mov %r12, (rp)
+L(L01): ADDSUB %rax, %r11 C apply previous carry out
+ jc L(c0) C jump if ripple
+L(rc0): mov 8(up), %r10
+ ADDSUB %r9, %r8
+ mov 8(vp), %r9
+ setc R8(%rax)
+ mov %r11, 8(rp)
+L(L00): ADDSUB %rbx, %r8
+ jc L(c1)
+L(rc1): mov 16(up), %r12
+ ADDSUB %r9, %r10
+ mov 16(vp), %r9
+ setc R8(%rbx)
+ mov %r8, 16(rp)
+L(L11): ADDSUB %rax, %r10
+ jc L(c2)
+L(rc2): mov 24(up), %r11
+ ADDSUB %r9, %r12
+ lea 32(up), up
+ mov 24(vp), %r9
+ lea 32(vp), vp
+ setc R8(%rax)
+ mov %r10, 24(rp)
+L(L10): ADDSUB %rbx, %r12
+ jc L(c3)
+L(rc3): lea 32(rp), rp
+ sub $4, n
+ ja L(top)
+
+L(end): ADDSUB %r9, %r11
+ setc R8(%rbx)
+ mov %r12, (rp)
+ ADDSUB %rax, %r11
+ jnc L(1)
+ mov $1, R8(%rbx)
+L(1): mov %r11, 8(rp)
+
+L(ret): mov R32(%rbx), R32(%rax)
+ pop %r12
+ pop %rbx
+ FUNC_EXIT()
+ ret
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/pentium4/aorslsh1_n.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/pentium4/aorslsh1_n.asm
new file mode 100644
index 00000000000..66937d32678
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/pentium4/aorslsh1_n.asm
@@ -0,0 +1,50 @@
+dnl AMD64 mpn_addlsh1_n, mpn_sublsh1_n -- rp[] = up[] +- (vp[] << 1),
+dnl optimised for Pentium 4.
+
+dnl Contributed to the GNU project by Torbjorn Granlund.
+
+dnl Copyright 2008, 2010-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')
+
+define(LSH, 1)
+define(RSH, 31) C 31, not 63, since we use 32-bit ops
+
+ifdef(`OPERATION_addlsh1_n', `
+ define(ADDSUB, add)
+ define(func, mpn_addlsh1_n)')
+ifdef(`OPERATION_sublsh1_n', `
+ define(ADDSUB, sub)
+ define(func, mpn_sublsh1_n)')
+
+ABI_SUPPORT(DOS64)
+ABI_SUPPORT(STD64)
+
+MULFUNC_PROLOGUE(mpn_addlsh1_n mpn_sublsh1_n)
+include_mpn(`x86_64/pentium4/aorslshC_n.asm')
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/pentium4/aorslsh2_n.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/pentium4/aorslsh2_n.asm
new file mode 100644
index 00000000000..001f0ac5bfa
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/pentium4/aorslsh2_n.asm
@@ -0,0 +1,50 @@
+dnl AMD64 mpn_addlsh2_n, mpn_sublsh2_n -- rp[] = up[] +- (vp[] << 2),
+dnl optimised for Pentium 4.
+
+dnl Contributed to the GNU project by Torbjorn Granlund.
+
+dnl Copyright 2008, 2010-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')
+
+define(LSH, 2)
+define(RSH, 30) C 30, not 62, since we use 32-bit ops
+
+ifdef(`OPERATION_addlsh2_n', `
+ define(ADDSUB, add)
+ define(func, mpn_addlsh2_n)')
+ifdef(`OPERATION_sublsh2_n', `
+ define(ADDSUB, sub)
+ define(func, mpn_sublsh2_n)')
+
+ABI_SUPPORT(DOS64)
+ABI_SUPPORT(STD64)
+
+MULFUNC_PROLOGUE(mpn_addlsh2_n mpn_sublsh2_n)
+include_mpn(`x86_64/pentium4/aorslshC_n.asm')
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/pentium4/aorslshC_n.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/pentium4/aorslshC_n.asm
new file mode 100644
index 00000000000..d03c6a3f305
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/pentium4/aorslshC_n.asm
@@ -0,0 +1,203 @@
+dnl AMD64 mpn_addlshC_n, mpn_sublshC_n -- rp[] = up[] +- (vp[] << C), where
+dnl C is 1, 2, 3. Optimized for Pentium 4.
+
+dnl Contributed to the GNU project by Torbjorn Granlund.
+
+dnl Copyright 2008, 2010-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/.
+
+C cycles/limb
+C AMD K8,K9 3.8
+C AMD K10 3.8
+C Intel P4 5.8
+C Intel core2 4.75
+C Intel corei 4.75
+C Intel atom ?
+C VIA nano 4.75
+
+
+C INPUT PARAMETERS
+define(`rp',`%rdi')
+define(`up',`%rsi')
+define(`vp',`%rdx')
+define(`n', `%rcx')
+
+define(M, eval(m4_lshift(1,LSH)))
+
+ABI_SUPPORT(DOS64)
+ABI_SUPPORT(STD64)
+
+ASM_START()
+ TEXT
+ ALIGN(16)
+PROLOGUE(func)
+ FUNC_ENTRY(4)
+ push %rbx
+ push %r12
+ push %rbp
+
+ mov (vp), %r9
+ shl $LSH, %r9
+ mov 4(vp), R32(%rbp)
+
+ xor R32(%rbx), R32(%rbx)
+
+ mov R32(n), R32(%rax)
+ and $3, R32(%rax)
+ jne L(n00) C n = 0, 4, 8, ...
+
+ mov (up), %r8
+ mov 8(up), %r10
+ shr $RSH, R32(%rbp)
+ ADDSUB %r9, %r8
+ mov 8(vp), %r9
+ lea (%rbp,%r9,M), %r9
+ setc R8(%rax)
+ mov 12(vp), R32(%rbp)
+ lea -16(rp), rp
+ jmp L(L00)
+
+L(n00): cmp $2, R32(%rax)
+ jnc L(n01) C n = 1, 5, 9, ...
+ mov (up), %r11
+ lea -8(rp), rp
+ shr $RSH, R32(%rbp)
+ ADDSUB %r9, %r11
+ setc R8(%rbx)
+ dec n
+ jz L(1) C jump for n = 1
+ mov 8(up), %r8
+ mov 8(vp), %r9
+ lea (%rbp,%r9,M), %r9
+ mov 12(vp), R32(%rbp)
+ lea 8(up), up
+ lea 8(vp), vp
+ jmp L(L01)
+
+L(n01): jne L(n10) C n = 2, 6, 10, ...
+ mov (up), %r12
+ mov 8(up), %r11
+ shr $RSH, R32(%rbp)
+ ADDSUB %r9, %r12
+ mov 8(vp), %r9
+ lea (%rbp,%r9,M), %r9
+ setc R8(%rax)
+ mov 12(vp), R32(%rbp)
+ lea 16(up), up
+ lea 16(vp), vp
+ jmp L(L10)
+
+L(n10): mov (up), %r10
+ mov 8(up), %r12
+ shr $RSH, R32(%rbp)
+ ADDSUB %r9, %r10
+ mov 8(vp), %r9
+ lea (%rbp,%r9,M), %r9
+ setc R8(%rbx)
+ mov 12(vp), R32(%rbp)
+ lea -24(rp), rp
+ lea -8(up), up
+ lea -8(vp), vp
+ jmp L(L11)
+
+L(c0): mov $1, R8(%rbx)
+ jmp L(rc0)
+L(c1): mov $1, R8(%rax)
+ jmp L(rc1)
+L(c2): mov $1, R8(%rbx)
+ jmp L(rc2)
+
+ ALIGN(16)
+L(top): mov (up), %r8 C not on critical path
+ shr $RSH, R32(%rbp)
+ ADDSUB %r9, %r11 C not on critical path
+ mov (vp), %r9
+ lea (%rbp,%r9,M), %r9
+ setc R8(%rbx) C save carry out
+ mov 4(vp), R32(%rbp)
+ mov %r12, (rp)
+ ADDSUB %rax, %r11 C apply previous carry out
+ jc L(c0) C jump if ripple
+L(rc0):
+L(L01): mov 8(up), %r10
+ shr $RSH, R32(%rbp)
+ ADDSUB %r9, %r8
+ mov 8(vp), %r9
+ lea (%rbp,%r9,M), %r9
+ setc R8(%rax)
+ mov 12(vp), R32(%rbp)
+ mov %r11, 8(rp)
+ ADDSUB %rbx, %r8
+ jc L(c1)
+L(rc1):
+L(L00): mov 16(up), %r12
+ shr $RSH, R32(%rbp)
+ ADDSUB %r9, %r10
+ mov 16(vp), %r9
+ lea (%rbp,%r9,M), %r9
+ setc R8(%rbx)
+ mov 20(vp), R32(%rbp)
+ mov %r8, 16(rp)
+ ADDSUB %rax, %r10
+ jc L(c2)
+L(rc2):
+L(L11): mov 24(up), %r11
+ shr $RSH, R32(%rbp)
+ ADDSUB %r9, %r12
+ mov 24(vp), %r9
+ lea (%rbp,%r9,M), %r9
+ lea 32(up), up
+ lea 32(vp), vp
+ setc R8(%rax)
+ mov -4(vp), R32(%rbp)
+ mov %r10, 24(rp)
+ ADDSUB %rbx, %r12
+ jc L(c3)
+L(rc3): lea 32(rp), rp
+L(L10): sub $4, n
+ ja L(top)
+
+L(end):
+ shr $RSH, R32(%rbp)
+ ADDSUB %r9, %r11
+ setc R8(%rbx)
+ mov %r12, (rp)
+ ADDSUB %rax, %r11
+ jnc L(1)
+ mov $1, R8(%rbx)
+L(1): mov %r11, 8(rp)
+ lea (%rbx,%rbp), R32(%rax)
+ pop %rbp
+ pop %r12
+ pop %rbx
+ FUNC_EXIT()
+ ret
+L(c3): mov $1, R8(%rax)
+ jmp L(rc3)
+EPILOGUE()
+ASM_END()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/pentium4/gmp-mparam.h b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/pentium4/gmp-mparam.h
new file mode 100644
index 00000000000..2171e230a5c
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/pentium4/gmp-mparam.h
@@ -0,0 +1,231 @@
+/* Pentium 4-64 gmp-mparam.h -- Compiler/machine parameter header file.
+
+Copyright 1991, 1993, 1994, 2000-2010, 2014 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
+
+/* These routines exists for all x86_64 chips, but they are slower on Pentium4
+ than separate add/sub and shift. Make sure they are not really used. */
+#undef HAVE_NATIVE_mpn_rsblsh1_n
+#undef HAVE_NATIVE_mpn_rsblsh2_n
+#undef HAVE_NATIVE_mpn_addlsh_n
+#undef HAVE_NATIVE_mpn_rsblsh_n
+
+/* 3400 MHz Pentium4 Nocona / 1024 Kibyte cache */
+/* FFT tuning limit = 25000000 */
+/* Generated by tuneup.c, 2014-03-12, gcc 4.5 */
+
+#define MOD_1_NORM_THRESHOLD 0 /* always */
+#define MOD_1_UNNORM_THRESHOLD 0 /* always */
+#define MOD_1N_TO_MOD_1_1_THRESHOLD 4
+#define MOD_1U_TO_MOD_1_1_THRESHOLD 3
+#define MOD_1_1_TO_MOD_1_2_THRESHOLD 16
+#define MOD_1_2_TO_MOD_1_4_THRESHOLD 32
+#define PREINV_MOD_1_TO_MOD_1_THRESHOLD 11
+#define USE_PREINV_DIVREM_1 1 /* native */
+#define DIV_QR_1_NORM_THRESHOLD 1
+#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 20
+
+#define MUL_TOOM22_THRESHOLD 12
+#define MUL_TOOM33_THRESHOLD 41
+#define MUL_TOOM44_THRESHOLD 112
+#define MUL_TOOM6H_THRESHOLD 157
+#define MUL_TOOM8H_THRESHOLD 236
+
+#define MUL_TOOM32_TO_TOOM43_THRESHOLD 73
+#define MUL_TOOM32_TO_TOOM53_THRESHOLD 91
+#define MUL_TOOM42_TO_TOOM53_THRESHOLD 81
+#define MUL_TOOM42_TO_TOOM63_THRESHOLD 78
+#define MUL_TOOM43_TO_TOOM54_THRESHOLD 106
+
+#define SQR_BASECASE_THRESHOLD 5
+#define SQR_TOOM2_THRESHOLD 30
+#define SQR_TOOM3_THRESHOLD 53
+#define SQR_TOOM4_THRESHOLD 154
+#define SQR_TOOM6_THRESHOLD 197
+#define SQR_TOOM8_THRESHOLD 296
+
+#define MULMID_TOOM42_THRESHOLD 22
+
+#define MULMOD_BNM1_THRESHOLD 9
+#define SQRMOD_BNM1_THRESHOLD 9
+
+#define MUL_FFT_MODF_THRESHOLD 252 /* k = 5 */
+#define MUL_FFT_TABLE3 \
+ { { 252, 5}, { 11, 6}, { 6, 5}, { 13, 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}, { 47,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}, { 63, 9}, \
+ { 127, 8}, { 255,10}, { 71, 9}, { 143, 8}, \
+ { 287,10}, { 79,11}, { 47,10}, { 95, 9}, \
+ { 191,10}, { 103,12}, { 31,11}, { 63,10}, \
+ { 127, 9}, { 255,10}, { 143, 9}, { 287,11}, \
+ { 79,10}, { 159, 9}, { 319,10}, { 175, 9}, \
+ { 351,11}, { 95,10}, { 191, 9}, { 383,10}, \
+ { 223,12}, { 63,11}, { 127,10}, { 255,11}, \
+ { 143,10}, { 287, 9}, { 575, 8}, { 1151,11}, \
+ { 159,10}, { 319,11}, { 175,10}, { 351,12}, \
+ { 95,11}, { 191,10}, { 383,11}, { 207,10}, \
+ { 415,11}, { 223,13}, { 63,12}, { 127,11}, \
+ { 255,10}, { 511,11}, { 287,10}, { 575, 9}, \
+ { 1151,12}, { 159,11}, { 319,10}, { 639,11}, \
+ { 351,10}, { 703,12}, { 191,11}, { 383,10}, \
+ { 767,11}, { 415,12}, { 223,11}, { 447,13}, \
+ { 127,12}, { 255,11}, { 511,12}, { 287,11}, \
+ { 575,10}, { 1151,12}, { 319,11}, { 639,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}, { 543,11}, { 1087,10}, { 2175,12}, \
+ { 575,11}, { 1151,13}, { 319,12}, { 639,11}, \
+ { 1279,12}, { 703,11}, { 1407,10}, { 2815,13}, \
+ { 383,12}, { 767,11}, { 1535,12}, { 831,11}, \
+ { 1663,13}, { 447,12}, { 895,14}, { 255,13}, \
+ { 511,12}, { 1023,11}, { 2047,12}, { 1087,11}, \
+ { 2175,13}, { 575,12}, { 1151,11}, { 2303,12}, \
+ { 1215,11}, { 2431,10}, { 4863,13}, { 639,12}, \
+ { 1279,11}, { 2559,13}, { 703,12}, { 1407,11}, \
+ { 2815,14}, { 383,13}, { 767,12}, { 1535,13}, \
+ { 831,12}, { 1663,13}, { 895,15}, { 255,14}, \
+ { 511,13}, { 1023,12}, { 2047,13}, { 1087,12}, \
+ { 2175,13}, { 1151,12}, { 2303,13}, { 1215,12}, \
+ { 2431,11}, { 4863,14}, { 639,13}, { 1279,12}, \
+ { 2559,13}, { 1407,12}, { 2815,14}, { 767,13}, \
+ { 1663,14}, { 895,13}, { 1791,12}, { 3583,13}, \
+ { 1919,12}, { 3839,15}, { 511,14}, { 1023,13}, \
+ { 2175,14}, { 1151,13}, { 2303,12}, { 4607,13}, \
+ { 2431,12}, { 4863,14}, { 1279,13}, { 2559,14}, \
+ { 1407,13}, { 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 211
+#define MUL_FFT_THRESHOLD 2240
+
+#define SQR_FFT_MODF_THRESHOLD 212 /* k = 5 */
+#define SQR_FFT_TABLE3 \
+ { { 212, 5}, { 11, 6}, { 6, 5}, { 13, 6}, \
+ { 13, 7}, { 7, 6}, { 15, 7}, { 9, 6}, \
+ { 19, 7}, { 13, 8}, { 7, 7}, { 17, 8}, \
+ { 9, 7}, { 20, 8}, { 11, 7}, { 24, 8}, \
+ { 13, 9}, { 7, 8}, { 21, 9}, { 11, 8}, \
+ { 25,10}, { 7, 9}, { 15, 8}, { 33, 9}, \
+ { 19, 8}, { 39, 9}, { 23, 8}, { 47,10}, \
+ { 15, 9}, { 39,10}, { 23, 9}, { 47,11}, \
+ { 15,10}, { 31, 9}, { 63, 8}, { 127, 9}, \
+ { 67,10}, { 39, 9}, { 79,10}, { 55,11}, \
+ { 31,10}, { 63, 9}, { 127, 8}, { 255,10}, \
+ { 71, 9}, { 143, 8}, { 287,10}, { 79, 9}, \
+ { 159,11}, { 47, 9}, { 191,12}, { 31,11}, \
+ { 63,10}, { 127, 9}, { 255,10}, { 143, 9}, \
+ { 287,11}, { 79,10}, { 159, 9}, { 319,10}, \
+ { 175, 9}, { 351,10}, { 191, 9}, { 383,10}, \
+ { 207,11}, { 111,10}, { 223,12}, { 63,11}, \
+ { 127,10}, { 255,11}, { 143,10}, { 287, 9}, \
+ { 575,11}, { 159,10}, { 319,11}, { 175,10}, \
+ { 351,11}, { 191,10}, { 383,11}, { 223,13}, \
+ { 63,12}, { 127,11}, { 255,10}, { 511,11}, \
+ { 287,10}, { 575,12}, { 159,11}, { 351,12}, \
+ { 191,11}, { 383,12}, { 223,11}, { 447,13}, \
+ { 127,12}, { 255,11}, { 511,12}, { 287,11}, \
+ { 575,10}, { 1151,12}, { 319,11}, { 639,12}, \
+ { 351,13}, { 191,12}, { 383,11}, { 767,12}, \
+ { 415,11}, { 831,12}, { 447,14}, { 127,13}, \
+ { 255,12}, { 511,11}, { 1023,10}, { 2047,11}, \
+ { 1087,12}, { 575,11}, { 1151,13}, { 319,12}, \
+ { 639,11}, { 1279,12}, { 703,11}, { 1407,13}, \
+ { 383,12}, { 767,11}, { 1535,12}, { 831,13}, \
+ { 447,14}, { 255,13}, { 511,12}, { 1023,11}, \
+ { 2047,13}, { 575,12}, { 1151,11}, { 2303,12}, \
+ { 1215,13}, { 639,12}, { 1279,11}, { 2559,13}, \
+ { 703,14}, { 383,13}, { 767,12}, { 1535,13}, \
+ { 831,12}, { 1663,13}, { 895,15}, { 255,14}, \
+ { 511,13}, { 1023,12}, { 2047,13}, { 1087,12}, \
+ { 2175,13}, { 1151,12}, { 2303,13}, { 1215,12}, \
+ { 2431,14}, { 639,13}, { 1279,12}, { 2687,13}, \
+ { 1407,12}, { 2815,14}, { 767,13}, { 1663,14}, \
+ { 895,13}, { 1791,12}, { 3583,15}, { 511,14}, \
+ { 1023,13}, { 2175,14}, { 1151,13}, { 2303,12}, \
+ { 4607,13}, { 2431,12}, { 4863,14}, { 1279,13}, \
+ { 2559,14}, { 1407,13}, { 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 184
+#define SQR_FFT_THRESHOLD 1984
+
+#define MULLO_BASECASE_THRESHOLD 0 /* always */
+#define MULLO_DC_THRESHOLD 33
+#define MULLO_MUL_N_THRESHOLD 4392
+
+#define DC_DIV_QR_THRESHOLD 35
+#define DC_DIVAPPR_Q_THRESHOLD 68
+#define DC_BDIV_QR_THRESHOLD 32
+#define DC_BDIV_Q_THRESHOLD 56
+
+#define INV_MULMOD_BNM1_THRESHOLD 22
+#define INV_NEWTON_THRESHOLD 195
+#define INV_APPR_THRESHOLD 116
+
+#define BINV_NEWTON_THRESHOLD 199
+#define REDC_1_TO_REDC_2_THRESHOLD 4
+#define REDC_2_TO_REDC_N_THRESHOLD 42
+
+#define MU_DIV_QR_THRESHOLD 979
+#define MU_DIVAPPR_Q_THRESHOLD 979
+#define MUPI_DIV_QR_THRESHOLD 91
+#define MU_BDIV_QR_THRESHOLD 855
+#define MU_BDIV_Q_THRESHOLD 942
+
+#define POWM_SEC_TABLE 1,16,175,692,1603
+
+#define MATRIX22_STRASSEN_THRESHOLD 17
+#define HGCD_THRESHOLD 109
+#define HGCD_APPR_THRESHOLD 119
+#define HGCD_REDUCE_THRESHOLD 1679
+#define GCD_DC_THRESHOLD 222
+#define GCDEXT_DC_THRESHOLD 238
+#define JACOBI_BASE_METHOD 4
+
+#define GET_STR_DC_THRESHOLD 12
+#define GET_STR_PRECOMPUTE_THRESHOLD 24
+#define SET_STR_DC_THRESHOLD 537
+#define SET_STR_PRECOMPUTE_THRESHOLD 1430
+
+#define FAC_DSC_THRESHOLD 1127
+#define FAC_ODD_THRESHOLD 0 /* always */
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/pentium4/lshift.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/pentium4/lshift.asm
new file mode 100644
index 00000000000..d3b521364ff
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/pentium4/lshift.asm
@@ -0,0 +1,166 @@
+dnl x86-64 mpn_lshift optimized for Pentium 4.
+
+dnl Copyright 2003, 2005, 2007, 2008, 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/limb
+C AMD K8,K9 2.5
+C AMD K10 ?
+C Intel P4 3.29
+C Intel core2 2.1 (fluctuates, presumably cache related)
+C Intel corei ?
+C Intel atom 14.3
+C VIA nano ?
+
+C INPUT PARAMETERS
+define(`rp',`%rdi')
+define(`up',`%rsi')
+define(`n',`%rdx')
+define(`cnt',`%cl')
+
+ABI_SUPPORT(DOS64)
+ABI_SUPPORT(STD64)
+
+ASM_START()
+ TEXT
+ ALIGN(32)
+PROLOGUE(mpn_lshift)
+ FUNC_ENTRY(4)
+ mov -8(up,n,8), %rax
+ movd R32(%rcx), %mm4
+ neg R32(%rcx) C put rsh count in cl
+ and $63, R32(%rcx)
+ movd R32(%rcx), %mm5
+
+ lea 1(n), R32(%r8)
+
+ shr R8(%rcx), %rax C function return value
+
+ and $3, R32(%r8)
+ je L(rol) C jump for n = 3, 7, 11, ...
+
+ dec R32(%r8)
+ jne L(1)
+C n = 4, 8, 12, ...
+ movq -8(up,n,8), %mm2
+ psllq %mm4, %mm2
+ movq -16(up,n,8), %mm0
+ psrlq %mm5, %mm0
+ por %mm0, %mm2
+ movq %mm2, -8(rp,n,8)
+ dec n
+ jmp L(rol)
+
+L(1): dec R32(%r8)
+ je L(1x) C jump for n = 1, 5, 9, 13, ...
+C n = 2, 6, 10, 16, ...
+ movq -8(up,n,8), %mm2
+ psllq %mm4, %mm2
+ movq -16(up,n,8), %mm0
+ psrlq %mm5, %mm0
+ por %mm0, %mm2
+ movq %mm2, -8(rp,n,8)
+ dec n
+L(1x):
+ cmp $1, n
+ je L(ast)
+ movq -8(up,n,8), %mm2
+ psllq %mm4, %mm2
+ movq -16(up,n,8), %mm3
+ psllq %mm4, %mm3
+ movq -16(up,n,8), %mm0
+ movq -24(up,n,8), %mm1
+ psrlq %mm5, %mm0
+ por %mm0, %mm2
+ psrlq %mm5, %mm1
+ por %mm1, %mm3
+ movq %mm2, -8(rp,n,8)
+ movq %mm3, -16(rp,n,8)
+ sub $2, n
+
+L(rol): movq -8(up,n,8), %mm2
+ psllq %mm4, %mm2
+ movq -16(up,n,8), %mm3
+ psllq %mm4, %mm3
+
+ sub $4, n C 4
+ jb L(end) C 2
+ ALIGN(32)
+L(top):
+ C finish stuff from lsh block
+ movq 16(up,n,8), %mm0
+ movq 8(up,n,8), %mm1
+ psrlq %mm5, %mm0
+ por %mm0, %mm2
+ psrlq %mm5, %mm1
+ movq (up,n,8), %mm0
+ por %mm1, %mm3
+ movq -8(up,n,8), %mm1
+ movq %mm2, 24(rp,n,8)
+ movq %mm3, 16(rp,n,8)
+ C start two new rsh
+ psrlq %mm5, %mm0
+ psrlq %mm5, %mm1
+
+ C finish stuff from rsh block
+ movq 8(up,n,8), %mm2
+ movq (up,n,8), %mm3
+ psllq %mm4, %mm2
+ por %mm2, %mm0
+ psllq %mm4, %mm3
+ movq -8(up,n,8), %mm2
+ por %mm3, %mm1
+ movq -16(up,n,8), %mm3
+ movq %mm0, 8(rp,n,8)
+ movq %mm1, (rp,n,8)
+ C start two new lsh
+ sub $4, n
+ psllq %mm4, %mm2
+ psllq %mm4, %mm3
+
+ jae L(top) C 2
+L(end):
+ movq 8(up), %mm0
+ psrlq %mm5, %mm0
+ por %mm0, %mm2
+ movq (up), %mm1
+ psrlq %mm5, %mm1
+ por %mm1, %mm3
+ movq %mm2, 16(rp)
+ movq %mm3, 8(rp)
+
+L(ast): movq (up), %mm2
+ psllq %mm4, %mm2
+ movq %mm2, (rp)
+ emms
+ FUNC_EXIT()
+ ret
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/pentium4/lshiftc.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/pentium4/lshiftc.asm
new file mode 100644
index 00000000000..fc64676574e
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/pentium4/lshiftc.asm
@@ -0,0 +1,179 @@
+dnl x86-64 mpn_lshiftc optimized for Pentium 4.
+
+dnl Copyright 2003, 2005, 2007, 2008, 2010, 2012 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 AMD K8,K9 ?
+C AMD K10 ?
+C Intel P4 4.15
+C Intel core2 ?
+C Intel corei ?
+C Intel atom ?
+C VIA nano ?
+
+C INPUT PARAMETERS
+define(`rp',`%rdi')
+define(`up',`%rsi')
+define(`n',`%rdx')
+define(`cnt',`%cl')
+
+ABI_SUPPORT(DOS64)
+ABI_SUPPORT(STD64)
+
+ASM_START()
+ TEXT
+ ALIGN(32)
+PROLOGUE(mpn_lshiftc)
+ FUNC_ENTRY(4)
+ mov -8(up,n,8), %rax
+ pcmpeqd %mm6, %mm6 C 0xffff...fff
+ movd R32(%rcx), %mm4
+ neg R32(%rcx) C put rsh count in cl
+ and $63, R32(%rcx)
+ movd R32(%rcx), %mm5
+
+ lea 1(n), R32(%r8)
+
+ shr R8(%rcx), %rax C function return value
+
+ and $3, R32(%r8)
+ je L(rol) C jump for n = 3, 7, 11, ...
+
+ dec R32(%r8)
+ jne L(1)
+C n = 4, 8, 12, ...
+ movq -8(up,n,8), %mm2
+ psllq %mm4, %mm2
+ movq -16(up,n,8), %mm0
+ pxor %mm6, %mm2
+ psrlq %mm5, %mm0
+ pandn %mm2, %mm0
+ movq %mm0, -8(rp,n,8)
+ dec n
+ jmp L(rol)
+
+L(1): dec R32(%r8)
+ je L(1x) C jump for n = 1, 5, 9, 13, ...
+C n = 2, 6, 10, 16, ...
+ movq -8(up,n,8), %mm2
+ psllq %mm4, %mm2
+ movq -16(up,n,8), %mm0
+ pxor %mm6, %mm2
+ psrlq %mm5, %mm0
+ pandn %mm2, %mm0
+ movq %mm0, -8(rp,n,8)
+ dec n
+L(1x):
+ cmp $1, n
+ je L(ast)
+ movq -8(up,n,8), %mm2
+ psllq %mm4, %mm2
+ movq -16(up,n,8), %mm3
+ psllq %mm4, %mm3
+ movq -16(up,n,8), %mm0
+ movq -24(up,n,8), %mm1
+ pxor %mm6, %mm2
+ psrlq %mm5, %mm0
+ pandn %mm2, %mm0
+ pxor %mm6, %mm3
+ psrlq %mm5, %mm1
+ pandn %mm3, %mm1
+ movq %mm0, -8(rp,n,8)
+ movq %mm1, -16(rp,n,8)
+ sub $2, n
+
+L(rol): movq -8(up,n,8), %mm2
+ psllq %mm4, %mm2
+ movq -16(up,n,8), %mm3
+ psllq %mm4, %mm3
+
+ sub $4, n
+ jb L(end)
+ ALIGN(32)
+L(top):
+ C finish stuff from lsh block
+ movq 16(up,n,8), %mm0
+ pxor %mm6, %mm2
+ movq 8(up,n,8), %mm1
+ psrlq %mm5, %mm0
+ psrlq %mm5, %mm1
+ pandn %mm2, %mm0
+ pxor %mm6, %mm3
+ movq %mm0, 24(rp,n,8)
+ movq (up,n,8), %mm0
+ pandn %mm3, %mm1
+ movq %mm1, 16(rp,n,8)
+ movq -8(up,n,8), %mm1
+ C start two new rsh
+ psrlq %mm5, %mm0
+ psrlq %mm5, %mm1
+
+ C finish stuff from rsh block
+ movq 8(up,n,8), %mm2
+ pxor %mm6, %mm0
+ movq (up,n,8), %mm3
+ psllq %mm4, %mm2
+ psllq %mm4, %mm3
+ pandn %mm0, %mm2
+ pxor %mm6, %mm1
+ movq %mm2, 8(rp,n,8)
+ movq -8(up,n,8), %mm2
+ pandn %mm1, %mm3
+ movq %mm3, (rp,n,8)
+ movq -16(up,n,8), %mm3
+ C start two new lsh
+ sub $4, n
+ psllq %mm4, %mm2
+ psllq %mm4, %mm3
+
+ jae L(top)
+
+L(end): pxor %mm6, %mm2
+ movq 8(up), %mm0
+ psrlq %mm5, %mm0
+ pandn %mm2, %mm0
+ pxor %mm6, %mm3
+ movq (up), %mm1
+ psrlq %mm5, %mm1
+ pandn %mm3, %mm1
+ movq %mm0, 16(rp)
+ movq %mm1, 8(rp)
+
+L(ast): movq (up), %mm2
+ psllq %mm4, %mm2
+ pxor %mm6, %mm2
+ movq %mm2, (rp)
+ emms
+ FUNC_EXIT()
+ ret
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/pentium4/mod_34lsub1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/pentium4/mod_34lsub1.asm
new file mode 100644
index 00000000000..f34b3f079ab
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/pentium4/mod_34lsub1.asm
@@ -0,0 +1,167 @@
+dnl AMD64 mpn_mod_34lsub1 -- remainder modulo 2^48-1.
+
+dnl Copyright 2000-2002, 2004, 2005, 2007, 2010-2012 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 AMD K8,K9 1.0
+C AMD K10 1.12
+C Intel P4 3.25
+C Intel core2 1.5
+C Intel corei 1.5
+C Intel atom 2.5
+C VIA nano 1.75
+
+
+C INPUT PARAMETERS
+define(`ap', %rdi)
+define(`n', %rsi)
+
+C mp_limb_t mpn_mod_34lsub1 (mp_srcptr up, mp_size_t n)
+
+C TODO
+C * Review feed-in and wind-down code. In particular, try to avoid adc and
+C sbb to placate Pentium4.
+C * It seems possible to reach 2.67 c/l by using a cleaner 6-way unrolling,
+C without the dual loop exits.
+
+ABI_SUPPORT(DOS64)
+ABI_SUPPORT(STD64)
+
+ASM_START()
+ TEXT
+ ALIGN(32)
+PROLOGUE(mpn_mod_34lsub1)
+ FUNC_ENTRY(2)
+
+ mov $0x0000FFFFFFFFFFFF, %r11
+
+ sub $2, %rsi
+ ja L(gt2)
+
+ mov (ap), %rax
+ nop
+ jb L(1)
+
+ mov 8(ap), %rsi
+ mov %rax, %rdx
+ shr $48, %rax C src[0] low
+
+ and %r11, %rdx C src[0] high
+ add %rdx, %rax
+ mov R32(%rsi), R32(%rdx)
+
+ shr $32, %rsi C src[1] high
+ add %rsi, %rax
+
+ shl $16, %rdx C src[1] low
+ add %rdx, %rax
+
+L(1): FUNC_EXIT()
+ ret
+
+
+ ALIGN(16)
+L(gt2): xor R32(%rax), R32(%rax)
+ xor R32(%rcx), R32(%rcx)
+ xor R32(%rdx), R32(%rdx)
+ xor %r8, %r8
+ xor %r9, %r9
+ xor %r10, %r10
+
+L(top): add (ap), %rax
+ adc $0, %r10
+ add 8(ap), %rcx
+ adc $0, %r8
+ add 16(ap), %rdx
+ adc $0, %r9
+
+ sub $3, %rsi
+ jng L(end)
+
+ add 24(ap), %rax
+ adc $0, %r10
+ add 32(ap), %rcx
+ adc $0, %r8
+ add 40(ap), %rdx
+ lea 48(ap), ap
+ adc $0, %r9
+
+ sub $3, %rsi
+ jg L(top)
+
+
+ add $-24, ap
+L(end): add %r9, %rax
+ adc %r10, %rcx
+ adc %r8, %rdx
+
+ inc %rsi
+ mov $0x1, R32(%r10)
+ js L(combine)
+
+ mov $0x10000, R32(%r10)
+ adc 24(ap), %rax
+ dec %rsi
+ js L(combine)
+
+ adc 32(ap), %rcx
+ mov $0x100000000, %r10
+
+L(combine):
+ sbb %rsi, %rsi C carry
+ mov %rax, %rdi C 0mod3
+ shr $48, %rax C 0mod3 high
+
+ and %r10, %rsi C carry masked
+ and %r11, %rdi C 0mod3 low
+ mov R32(%rcx), R32(%r10) C 1mod3
+
+ add %rsi, %rax C apply carry
+ shr $32, %rcx C 1mod3 high
+
+ add %rdi, %rax C apply 0mod3 low
+ movzwl %dx, R32(%rdi) C 2mod3
+ shl $16, %r10 C 1mod3 low
+
+ add %rcx, %rax C apply 1mod3 high
+ shr $16, %rdx C 2mod3 high
+
+ add %r10, %rax C apply 1mod3 low
+ shl $32, %rdi C 2mod3 low
+
+ add %rdx, %rax C apply 2mod3 high
+ add %rdi, %rax C apply 2mod3 low
+
+ FUNC_EXIT()
+ ret
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/pentium4/popcount.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/pentium4/popcount.asm
new file mode 100644
index 00000000000..7014b39de56
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/pentium4/popcount.asm
@@ -0,0 +1,35 @@
+dnl x86-64 mpn_popcount optimized for Pentium 4.
+
+dnl Copyright 2007 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_popcount)
+include_mpn(`x86/pentium4/sse2/popcount.asm')
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/pentium4/rsh1aors_n.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/pentium4/rsh1aors_n.asm
new file mode 100644
index 00000000000..5528ce47dae
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/pentium4/rsh1aors_n.asm
@@ -0,0 +1,334 @@
+dnl x86-64 mpn_rsh1add_n/mpn_rsh1sub_n optimized for Pentium 4.
+
+dnl Contributed to the GNU project by Torbjorn Granlund.
+
+dnl Copyright 2007, 2008, 2010-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/limb
+C AMD K8,K9 4.13
+C AMD K10 4.13
+C Intel P4 5.70
+C Intel core2 4.75
+C Intel corei 5
+C Intel atom 8.75
+C VIA nano 5.25
+
+C TODO
+C * Try to make this smaller, 746 bytes seem excessive for this 2nd class
+C function. Less sw pipelining would help, and since we now probably
+C pipeline somewhat too deeply, it might not affect performance too much.
+C * A separate small-n loop might speed things as well as make things smaller.
+C That loop should be selected before pushing registers.
+
+C INPUT PARAMETERS
+define(`rp', `%rdi')
+define(`up', `%rsi')
+define(`vp', `%rdx')
+define(`n', `%rcx')
+define(`cy', `%r8')
+
+ifdef(`OPERATION_rsh1add_n', `
+ define(ADDSUB, add)
+ define(func, mpn_rsh1add_n)
+ define(func_nc, mpn_rsh1add_nc)')
+ifdef(`OPERATION_rsh1sub_n', `
+ define(ADDSUB, sub)
+ define(func, mpn_rsh1sub_n)
+ define(func_nc, mpn_rsh1sub_nc)')
+
+ABI_SUPPORT(DOS64)
+ABI_SUPPORT(STD64)
+
+MULFUNC_PROLOGUE(mpn_rsh1add_n mpn_rsh1add_nc mpn_rsh1sub_n mpn_rsh1sub_nc)
+
+ASM_START()
+ TEXT
+PROLOGUE(func)
+ FUNC_ENTRY(4)
+ xor %r8, %r8
+IFDOS(` jmp L(ent) ')
+EPILOGUE()
+PROLOGUE(func_nc)
+ FUNC_ENTRY(4)
+IFDOS(` mov 56(%rsp), %r8 ')
+L(ent): push %rbx
+ push %r12
+ push %r13
+ push %r14
+ push %r15
+
+ mov (vp), %r9
+ mov (up), %r15
+
+ mov R32(n), R32(%rax)
+ and $3, R32(%rax)
+ jne L(n00)
+
+ mov R32(%r8), R32(%rbx) C n = 0, 4, 8, ...
+ mov 8(up), %r10
+ ADDSUB %r9, %r15
+ mov 8(vp), %r9
+ setc R8(%rax)
+ ADDSUB %rbx, %r15 C return bit
+ jnc 1f
+ mov $1, R8(%rax)
+1: mov 16(up), %r12
+ ADDSUB %r9, %r10
+ mov 16(vp), %r9
+ setc R8(%rbx)
+ mov %r15, %r13
+ ADDSUB %rax, %r10
+ jnc 1f
+ mov $1, R8(%rbx)
+1: mov 24(up), %r11
+ ADDSUB %r9, %r12
+ lea 32(up), up
+ mov 24(vp), %r9
+ lea 32(vp), vp
+ setc R8(%rax)
+ mov %r10, %r14
+ shl $63, %r10
+ shr %r13
+ jmp L(L00)
+
+L(n00): cmp $2, R32(%rax)
+ jnc L(n01)
+ xor R32(%rbx), R32(%rbx) C n = 1, 5, 9, ...
+ lea -24(rp), rp
+ mov R32(%r8), R32(%rax)
+ dec n
+ jnz L(gt1)
+ ADDSUB %r9, %r15
+ setc R8(%rbx)
+ ADDSUB %rax, %r15
+ jnc 1f
+ mov $1, R8(%rbx)
+1: mov %r15, %r14
+ shl $63, %rbx
+ shr %r14
+ jmp L(cj1)
+L(gt1): mov 8(up), %r8
+ ADDSUB %r9, %r15
+ mov 8(vp), %r9
+ setc R8(%rbx)
+ ADDSUB %rax, %r15
+ jnc 1f
+ mov $1, R8(%rbx)
+1: mov 16(up), %r10
+ ADDSUB %r9, %r8
+ mov 16(vp), %r9
+ setc R8(%rax)
+ mov %r15, %r14
+ ADDSUB %rbx, %r8
+ jnc 1f
+ mov $1, R8(%rax)
+1: mov 24(up), %r12
+ ADDSUB %r9, %r10
+ mov 24(vp), %r9
+ setc R8(%rbx)
+ mov %r8, %r13
+ shl $63, %r8
+ shr %r14
+ lea 8(up), up
+ lea 8(vp), vp
+ jmp L(L01)
+
+L(n01): jne L(n10)
+ lea -16(rp), rp C n = 2, 6, 10, ...
+ mov R32(%r8), R32(%rbx)
+ mov 8(up), %r11
+ ADDSUB %r9, %r15
+ mov 8(vp), %r9
+ setc R8(%rax)
+ ADDSUB %rbx, %r15
+ jnc 1f
+ mov $1, R8(%rax)
+1: sub $2, n
+ jnz L(gt2)
+ ADDSUB %r9, %r11
+ setc R8(%rbx)
+ mov %r15, %r13
+ ADDSUB %rax, %r11
+ jnc 1f
+ mov $1, R8(%rbx)
+1: mov %r11, %r14
+ shl $63, %r11
+ shr %r13
+ jmp L(cj2)
+L(gt2): mov 16(up), %r8
+ ADDSUB %r9, %r11
+ mov 16(vp), %r9
+ setc R8(%rbx)
+ mov %r15, %r13
+ ADDSUB %rax, %r11
+ jnc 1f
+ mov $1, R8(%rbx)
+1: mov 24(up), %r10
+ ADDSUB %r9, %r8
+ mov 24(vp), %r9
+ setc R8(%rax)
+ mov %r11, %r14
+ shl $63, %r11
+ shr %r13
+ lea 16(up), up
+ lea 16(vp), vp
+ jmp L(L10)
+
+L(n10): xor R32(%rbx), R32(%rbx) C n = 3, 7, 11, ...
+ lea -8(rp), rp
+ mov R32(%r8), R32(%rax)
+ mov 8(up), %r12
+ ADDSUB %r9, %r15
+ mov 8(vp), %r9
+ setc R8(%rbx)
+ ADDSUB %rax, %r15
+ jnc 1f
+ mov $1, R8(%rbx)
+1: mov 16(up), %r11
+ ADDSUB %r9, %r12
+ mov 16(vp), %r9
+ setc R8(%rax)
+ mov %r15, %r14
+ ADDSUB %rbx, %r12
+ jnc 1f
+ mov $1, R8(%rax)
+1: sub $3, n
+ jnz L(gt3)
+ ADDSUB %r9, %r11
+ setc R8(%rbx)
+ mov %r12, %r13
+ shl $63, %r12
+ shr %r14
+ jmp L(cj3)
+L(gt3): mov 24(up), %r8
+ ADDSUB %r9, %r11
+ mov 24(vp), %r9
+ setc R8(%rbx)
+ mov %r12, %r13
+ shl $63, %r12
+ shr %r14
+ lea 24(up), up
+ lea 24(vp), vp
+ jmp L(L11)
+
+L(c0): mov $1, R8(%rbx)
+ jmp L(rc0)
+L(c1): mov $1, R8(%rax)
+ jmp L(rc1)
+L(c2): mov $1, R8(%rbx)
+ jmp L(rc2)
+
+ ALIGN(16)
+L(top): mov (up), %r8 C not on critical path
+ or %r13, %r10
+ ADDSUB %r9, %r11 C not on critical path
+ mov (vp), %r9 C not on critical path
+ setc R8(%rbx) C save carry out
+ mov %r12, %r13 C new for later
+ shl $63, %r12 C shift new right
+ shr %r14 C shift old left
+ mov %r10, (rp)
+L(L11): ADDSUB %rax, %r11 C apply previous carry out
+ jc L(c0) C jump if ripple
+L(rc0): mov 8(up), %r10
+ or %r14, %r12
+ ADDSUB %r9, %r8
+ mov 8(vp), %r9
+ setc R8(%rax)
+ mov %r11, %r14
+ shl $63, %r11
+ shr %r13
+ mov %r12, 8(rp)
+L(L10): ADDSUB %rbx, %r8
+ jc L(c1)
+L(rc1): mov 16(up), %r12
+ or %r13, %r11
+ ADDSUB %r9, %r10
+ mov 16(vp), %r9
+ setc R8(%rbx)
+ mov %r8, %r13
+ shl $63, %r8
+ shr %r14
+ mov %r11, 16(rp)
+L(L01): ADDSUB %rax, %r10
+ jc L(c2)
+L(rc2): mov 24(up), %r11
+ or %r14, %r8
+ ADDSUB %r9, %r12
+ lea 32(up), up
+ mov 24(vp), %r9
+ lea 32(vp), vp
+ setc R8(%rax)
+ mov %r10, %r14
+ shl $63, %r10
+ shr %r13
+ mov %r8, 24(rp)
+ lea 32(rp), rp
+L(L00): ADDSUB %rbx, %r12
+ jc L(c3)
+L(rc3): sub $4, n
+ ja L(top)
+
+L(end): or %r13, %r10
+ ADDSUB %r9, %r11
+ setc R8(%rbx)
+ mov %r12, %r13
+ shl $63, %r12
+ shr %r14
+ mov %r10, (rp)
+L(cj3): ADDSUB %rax, %r11
+ jnc 1f
+ mov $1, R8(%rbx)
+1: or %r14, %r12
+ mov %r11, %r14
+ shl $63, %r11
+ shr %r13
+ mov %r12, 8(rp)
+L(cj2): or %r13, %r11
+ shl $63, %rbx
+ shr %r14
+ mov %r11, 16(rp)
+L(cj1): or %r14, %rbx
+ mov %rbx, 24(rp)
+
+ mov R32(%r15), R32(%rax)
+ and $1, R32(%rax)
+ pop %r15
+ pop %r14
+ pop %r13
+ pop %r12
+ pop %rbx
+ FUNC_EXIT()
+ ret
+L(c3): mov $1, R8(%rax)
+ jmp L(rc3)
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/pentium4/rshift.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/pentium4/rshift.asm
new file mode 100644
index 00000000000..b7c1ee2cdd4
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/pentium4/rshift.asm
@@ -0,0 +1,169 @@
+dnl x86-64 mpn_rshift optimized for Pentium 4.
+
+dnl Copyright 2003, 2005, 2007, 2008, 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/limb
+C AMD K8,K9 2.5
+C AMD K10 ?
+C Intel P4 3.29
+C Intel core2 2.1 (fluctuates, presumably cache related)
+C Intel corei ?
+C Intel atom 14.3
+C VIA nano ?
+
+C INPUT PARAMETERS
+define(`rp',`%rdi')
+define(`up',`%rsi')
+define(`n',`%rdx')
+define(`cnt',`%cl')
+
+ABI_SUPPORT(DOS64)
+ABI_SUPPORT(STD64)
+
+ASM_START()
+ TEXT
+ ALIGN(32)
+PROLOGUE(mpn_rshift)
+ FUNC_ENTRY(4)
+ mov (up), %rax
+ movd R32(%rcx), %mm4
+ neg R32(%rcx) C put lsh count in cl
+ and $63, R32(%rcx)
+ movd R32(%rcx), %mm5
+
+ lea -8(up,n,8), up
+ lea -8(rp,n,8), rp
+ lea 1(n), R32(%r8)
+ neg n
+
+ shl R8(%rcx), %rax C function return value
+
+ and $3, R32(%r8)
+ je L(rol) C jump for n = 3, 7, 11, ...
+
+ dec R32(%r8)
+ jne L(1)
+C n = 4, 8, 12, ...
+ movq 8(up,n,8), %mm2
+ psrlq %mm4, %mm2
+ movq 16(up,n,8), %mm0
+ psllq %mm5, %mm0
+ por %mm0, %mm2
+ movq %mm2, 8(rp,n,8)
+ inc n
+ jmp L(rol)
+
+L(1): dec R32(%r8)
+ je L(1x) C jump for n = 1, 5, 9, 13, ...
+C n = 2, 6, 10, 16, ...
+ movq 8(up,n,8), %mm2
+ psrlq %mm4, %mm2
+ movq 16(up,n,8), %mm0
+ psllq %mm5, %mm0
+ por %mm0, %mm2
+ movq %mm2, 8(rp,n,8)
+ inc n
+L(1x):
+ cmp $-1, n
+ je L(ast)
+ movq 8(up,n,8), %mm2
+ psrlq %mm4, %mm2
+ movq 16(up,n,8), %mm3
+ psrlq %mm4, %mm3
+ movq 16(up,n,8), %mm0
+ movq 24(up,n,8), %mm1
+ psllq %mm5, %mm0
+ por %mm0, %mm2
+ psllq %mm5, %mm1
+ por %mm1, %mm3
+ movq %mm2, 8(rp,n,8)
+ movq %mm3, 16(rp,n,8)
+ add $2, n
+
+L(rol): movq 8(up,n,8), %mm2
+ psrlq %mm4, %mm2
+ movq 16(up,n,8), %mm3
+ psrlq %mm4, %mm3
+
+ add $4, n C 4
+ jb L(end) C 2
+ ALIGN(32)
+L(top):
+ C finish stuff from lsh block
+ movq -16(up,n,8), %mm0
+ movq -8(up,n,8), %mm1
+ psllq %mm5, %mm0
+ por %mm0, %mm2
+ psllq %mm5, %mm1
+ movq (up,n,8), %mm0
+ por %mm1, %mm3
+ movq 8(up,n,8), %mm1
+ movq %mm2, -24(rp,n,8)
+ movq %mm3, -16(rp,n,8)
+ C start two new rsh
+ psllq %mm5, %mm0
+ psllq %mm5, %mm1
+
+ C finish stuff from rsh block
+ movq -8(up,n,8), %mm2
+ movq (up,n,8), %mm3
+ psrlq %mm4, %mm2
+ por %mm2, %mm0
+ psrlq %mm4, %mm3
+ movq 8(up,n,8), %mm2
+ por %mm3, %mm1
+ movq 16(up,n,8), %mm3
+ movq %mm0, -8(rp,n,8)
+ movq %mm1, (rp,n,8)
+ C start two new lsh
+ add $4, n
+ psrlq %mm4, %mm2
+ psrlq %mm4, %mm3
+
+ jae L(top) C 2
+L(end):
+ movq -8(up), %mm0
+ psllq %mm5, %mm0
+ por %mm0, %mm2
+ movq (up), %mm1
+ psllq %mm5, %mm1
+ por %mm1, %mm3
+ movq %mm2, -16(rp)
+ movq %mm3, -8(rp)
+
+L(ast): movq (up), %mm2
+ psrlq %mm4, %mm2
+ movq %mm2, (rp)
+ emms
+ FUNC_EXIT()
+ ret
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/pentium4/sec_tabselect.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/pentium4/sec_tabselect.asm
new file mode 100644
index 00000000000..e4360341d93
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/pentium4/sec_tabselect.asm
@@ -0,0 +1,37 @@
+dnl X86-64 mpn_sec_tabselect.
+
+dnl Copyright 2012, 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')
+
+ABI_SUPPORT(DOS64)
+ABI_SUPPORT(STD64)
+
+MULFUNC_PROLOGUE(mpn_sec_tabselect)
+include_mpn(`x86_64/fastsse/sec_tabselect.asm')
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/popham.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/popham.asm
new file mode 100644
index 00000000000..9005f817762
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/popham.asm
@@ -0,0 +1,177 @@
+dnl AMD64 mpn_popcount, mpn_hamdist -- population count and hamming distance.
+
+dnl Copyright 2004, 2005, 2007, 2010-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 popcount hamdist
+C cycles/limb cycles/limb
+C AMD K8,K9 6 7
+C AMD K10 6 7
+C Intel P4 12 14.3
+C Intel core2 7 8
+C Intel corei ? 7.3
+C Intel atom 16.5 17.5
+C VIA nano 8.75 10.4
+
+C TODO
+C * Tune. It should be possible to reach 5 c/l for popcount and 6 c/l for
+C hamdist for K8/K9.
+
+
+ifdef(`OPERATION_popcount',`
+ define(`func',`mpn_popcount')
+ define(`up', `%rdi')
+ define(`n', `%rsi')
+ define(`h55555555', `%r10')
+ define(`h33333333', `%r11')
+ define(`h0f0f0f0f', `%rcx')
+ define(`h01010101', `%rdx')
+ define(`POP', `$1')
+ define(`HAM', `dnl')
+')
+ifdef(`OPERATION_hamdist',`
+ define(`func',`mpn_hamdist')
+ define(`up', `%rdi')
+ define(`vp', `%rsi')
+ define(`n', `%rdx')
+ define(`h55555555', `%r10')
+ define(`h33333333', `%r11')
+ define(`h0f0f0f0f', `%rcx')
+ define(`h01010101', `%r14')
+ define(`POP', `dnl')
+ define(`HAM', `$1')
+')
+
+
+MULFUNC_PROLOGUE(mpn_popcount mpn_hamdist)
+
+ABI_SUPPORT(DOS64)
+ABI_SUPPORT(STD64)
+
+ASM_START()
+ TEXT
+ ALIGN(32)
+PROLOGUE(func)
+ POP(` FUNC_ENTRY(2) ')
+ HAM(` FUNC_ENTRY(3) ')
+ push %r12
+ push %r13
+ HAM(` push %r14 ')
+
+ mov $0x5555555555555555, h55555555
+ mov $0x3333333333333333, h33333333
+ mov $0x0f0f0f0f0f0f0f0f, h0f0f0f0f
+ mov $0x0101010101010101, h01010101
+
+ lea (up,n,8), up
+ HAM(` lea (vp,n,8), vp ')
+ neg n
+
+ xor R32(%rax), R32(%rax)
+
+ bt $0, R32(n)
+ jnc L(top)
+
+ mov (up,n,8), %r8
+ HAM(` xor (vp,n,8), %r8 ')
+
+ mov %r8, %r9
+ shr %r8
+ and h55555555, %r8
+ sub %r8, %r9
+
+ mov %r9, %r8
+ shr $2, %r9
+ and h33333333, %r8
+ and h33333333, %r9
+ add %r8, %r9 C 16 4-bit fields (0..4)
+
+ mov %r9, %r8
+ shr $4, %r9
+ and h0f0f0f0f, %r8
+ and h0f0f0f0f, %r9
+ add %r8, %r9 C 8 8-bit fields (0..16)
+
+ imul h01010101, %r9 C sum the 8 fields in high 8 bits
+ shr $56, %r9
+
+ mov %r9, %rax C add to total
+ add $1, n
+ jz L(end)
+
+ ALIGN(16)
+L(top): mov (up,n,8), %r8
+ mov 8(up,n,8), %r12
+ HAM(` xor (vp,n,8), %r8 ')
+ HAM(` xor 8(vp,n,8), %r12 ')
+
+ mov %r8, %r9
+ mov %r12, %r13
+ shr %r8
+ shr %r12
+ and h55555555, %r8
+ and h55555555, %r12
+ sub %r8, %r9
+ sub %r12, %r13
+
+ mov %r9, %r8
+ mov %r13, %r12
+ shr $2, %r9
+ shr $2, %r13
+ and h33333333, %r8
+ and h33333333, %r9
+ and h33333333, %r12
+ and h33333333, %r13
+ add %r8, %r9 C 16 4-bit fields (0..4)
+ add %r12, %r13 C 16 4-bit fields (0..4)
+
+ add %r13, %r9 C 16 4-bit fields (0..8)
+ mov %r9, %r8
+ shr $4, %r9
+ and h0f0f0f0f, %r8
+ and h0f0f0f0f, %r9
+ add %r8, %r9 C 8 8-bit fields (0..16)
+
+ imul h01010101, %r9 C sum the 8 fields in high 8 bits
+ shr $56, %r9
+
+ add %r9, %rax C add to total
+ add $2, n
+ jnc L(top)
+
+L(end):
+ HAM(` pop %r14 ')
+ pop %r13
+ pop %r12
+ FUNC_EXIT()
+ ret
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/rsh1aors_n.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/rsh1aors_n.asm
new file mode 100644
index 00000000000..a3e9cc5d239
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/rsh1aors_n.asm
@@ -0,0 +1,189 @@
+dnl AMD64 mpn_rsh1add_n -- rp[] = (up[] + vp[]) >> 1
+dnl AMD64 mpn_rsh1sub_n -- rp[] = (up[] - vp[]) >> 1
+
+dnl Copyright 2003, 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/limb
+C AMD K8,K9 2.14 (mpn_add_n + mpn_rshift need 4.125)
+C AMD K10 2.14 (mpn_add_n + mpn_rshift need 4.125)
+C Intel P4 12.75
+C Intel core2 3.75
+C Intel NMH 4.4
+C Intel SBR ?
+C Intel atom ?
+C VIA nano 3.25
+
+C TODO
+C * Rewrite to use indexed addressing, like addlsh1.asm and sublsh1.asm.
+
+C INPUT PARAMETERS
+define(`rp', `%rdi')
+define(`up', `%rsi')
+define(`vp', `%rdx')
+define(`n',` %rcx')
+
+ifdef(`OPERATION_rsh1add_n', `
+ define(ADDSUB, add)
+ define(ADCSBB, adc)
+ define(func_n, mpn_rsh1add_n)
+ define(func_nc, mpn_rsh1add_nc)')
+ifdef(`OPERATION_rsh1sub_n', `
+ define(ADDSUB, sub)
+ define(ADCSBB, sbb)
+ define(func_n, mpn_rsh1sub_n)
+ define(func_nc, mpn_rsh1sub_nc)')
+
+MULFUNC_PROLOGUE(mpn_rsh1add_n mpn_rsh1add_nc mpn_rsh1sub_n mpn_rsh1sub_nc)
+
+ABI_SUPPORT(DOS64)
+ABI_SUPPORT(STD64)
+
+ASM_START()
+ TEXT
+ ALIGN(16)
+PROLOGUE(func_nc)
+ FUNC_ENTRY(4)
+IFDOS(` mov 56(%rsp), %r8 ')
+ push %rbx
+
+ xor R32(%rax), R32(%rax)
+ neg %r8 C set C flag from parameter
+ mov (up), %rbx
+ ADCSBB (vp), %rbx
+ jmp L(ent)
+EPILOGUE()
+
+ ALIGN(16)
+PROLOGUE(func_n)
+ FUNC_ENTRY(4)
+ push %rbx
+
+ xor R32(%rax), R32(%rax)
+ mov (up), %rbx
+ ADDSUB (vp), %rbx
+L(ent):
+ rcr %rbx C rotate, save acy
+ adc R32(%rax), R32(%rax) C return value
+
+ mov R32(n), R32(%r11)
+ and $3, R32(%r11)
+
+ cmp $1, R32(%r11)
+ je L(do) C jump if n = 1 5 9 ...
+
+L(n1): cmp $2, R32(%r11)
+ jne L(n2) C jump unless n = 2 6 10 ...
+ add %rbx, %rbx C rotate carry limb, restore acy
+ mov 8(up), %r10
+ ADCSBB 8(vp), %r10
+ lea 8(up), up
+ lea 8(vp), vp
+ lea 8(rp), rp
+ rcr %r10
+ rcr %rbx
+ mov %rbx, -8(rp)
+ jmp L(cj1)
+
+L(n2): cmp $3, R32(%r11)
+ jne L(n3) C jump unless n = 3 7 11 ...
+ add %rbx, %rbx C rotate carry limb, restore acy
+ mov 8(up), %r9
+ mov 16(up), %r10
+ ADCSBB 8(vp), %r9
+ ADCSBB 16(vp), %r10
+ lea 16(up), up
+ lea 16(vp), vp
+ lea 16(rp), rp
+ rcr %r10
+ rcr %r9
+ rcr %rbx
+ mov %rbx, -16(rp)
+ jmp L(cj2)
+
+L(n3): dec n C come here for n = 4 8 12 ...
+ add %rbx, %rbx C rotate carry limb, restore acy
+ mov 8(up), %r8
+ mov 16(up), %r9
+ ADCSBB 8(vp), %r8
+ ADCSBB 16(vp), %r9
+ mov 24(up), %r10
+ ADCSBB 24(vp), %r10
+ lea 24(up), up
+ lea 24(vp), vp
+ lea 24(rp), rp
+ rcr %r10
+ rcr %r9
+ rcr %r8
+ rcr %rbx
+ mov %rbx, -24(rp)
+ mov %r8, -16(rp)
+L(cj2): mov %r9, -8(rp)
+L(cj1): mov %r10, %rbx
+
+L(do):
+ shr $2, n C 4
+ je L(end) C 2
+ ALIGN(16)
+L(top): add %rbx, %rbx C rotate carry limb, restore acy
+
+ mov 8(up), %r8
+ mov 16(up), %r9
+ ADCSBB 8(vp), %r8
+ ADCSBB 16(vp), %r9
+ mov 24(up), %r10
+ mov 32(up), %r11
+ ADCSBB 24(vp), %r10
+ ADCSBB 32(vp), %r11
+
+ lea 32(up), up
+ lea 32(vp), vp
+
+ rcr %r11 C rotate, save acy
+ rcr %r10
+ rcr %r9
+ rcr %r8
+
+ rcr %rbx
+ mov %rbx, (rp)
+ mov %r8, 8(rp)
+ mov %r9, 16(rp)
+ mov %r10, 24(rp)
+ mov %r11, %rbx
+
+ lea 32(rp), rp
+ dec n
+ jne L(top)
+
+L(end): mov %rbx, (rp)
+ pop %rbx
+ FUNC_EXIT()
+ ret
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/rshift.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/rshift.asm
new file mode 100644
index 00000000000..3f344f1dfc0
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/rshift.asm
@@ -0,0 +1,176 @@
+dnl AMD64 mpn_rshift -- mpn right shift.
+
+dnl Copyright 2003, 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/limb
+C AMD K8,K9 2.375
+C AMD K10 2.375
+C Intel P4 8
+C Intel core2 2.11
+C Intel corei ?
+C Intel atom 5.75
+C VIA nano 3.5
+
+
+C INPUT PARAMETERS
+define(`rp', `%rdi')
+define(`up', `%rsi')
+define(`n', `%rdx')
+define(`cnt', `%rcx')
+
+ABI_SUPPORT(DOS64)
+ABI_SUPPORT(STD64)
+
+ASM_START()
+ TEXT
+ ALIGN(32)
+PROLOGUE(mpn_rshift)
+ FUNC_ENTRY(4)
+ neg R32(%rcx) C put rsh count in cl
+ mov (up), %rax
+ shl R8(%rcx), %rax C function return value
+ neg R32(%rcx) C put lsh count in cl
+
+ lea 1(n), R32(%r8)
+
+ lea -8(up,n,8), up
+ lea -8(rp,n,8), rp
+ neg n
+
+ and $3, R32(%r8)
+ je L(rlx) C jump for n = 3, 7, 11, ...
+
+ dec R32(%r8)
+ jne L(1)
+C n = 4, 8, 12, ...
+ mov 8(up,n,8), %r10
+ shr R8(%rcx), %r10
+ neg R32(%rcx) C put rsh count in cl
+ mov 16(up,n,8), %r8
+ shl R8(%rcx), %r8
+ or %r8, %r10
+ mov %r10, 8(rp,n,8)
+ inc n
+ jmp L(rll)
+
+L(1): dec R32(%r8)
+ je L(1x) C jump for n = 1, 5, 9, 13, ...
+C n = 2, 6, 10, 16, ...
+ mov 8(up,n,8), %r10
+ shr R8(%rcx), %r10
+ neg R32(%rcx) C put rsh count in cl
+ mov 16(up,n,8), %r8
+ shl R8(%rcx), %r8
+ or %r8, %r10
+ mov %r10, 8(rp,n,8)
+ inc n
+ neg R32(%rcx) C put lsh count in cl
+L(1x):
+ cmp $-1, n
+ je L(ast)
+ mov 8(up,n,8), %r10
+ shr R8(%rcx), %r10
+ mov 16(up,n,8), %r11
+ shr R8(%rcx), %r11
+ neg R32(%rcx) C put rsh count in cl
+ mov 16(up,n,8), %r8
+ mov 24(up,n,8), %r9
+ shl R8(%rcx), %r8
+ or %r8, %r10
+ shl R8(%rcx), %r9
+ or %r9, %r11
+ mov %r10, 8(rp,n,8)
+ mov %r11, 16(rp,n,8)
+ add $2, n
+
+L(rll): neg R32(%rcx) C put lsh count in cl
+L(rlx): mov 8(up,n,8), %r10
+ shr R8(%rcx), %r10
+ mov 16(up,n,8), %r11
+ shr R8(%rcx), %r11
+
+ add $4, n C 4
+ jb L(end) C 2
+ ALIGN(16)
+L(top):
+ C finish stuff from lsh block
+ neg R32(%rcx) C put rsh count in cl
+ mov -16(up,n,8), %r8
+ mov -8(up,n,8), %r9
+ shl R8(%rcx), %r8
+ or %r8, %r10
+ shl R8(%rcx), %r9
+ or %r9, %r11
+ mov %r10, -24(rp,n,8)
+ mov %r11, -16(rp,n,8)
+ C start two new rsh
+ mov (up,n,8), %r8
+ mov 8(up,n,8), %r9
+ shl R8(%rcx), %r8
+ shl R8(%rcx), %r9
+
+ C finish stuff from rsh block
+ neg R32(%rcx) C put lsh count in cl
+ mov -8(up,n,8), %r10
+ mov 0(up,n,8), %r11
+ shr R8(%rcx), %r10
+ or %r10, %r8
+ shr R8(%rcx), %r11
+ or %r11, %r9
+ mov %r8, -8(rp,n,8)
+ mov %r9, 0(rp,n,8)
+ C start two new lsh
+ mov 8(up,n,8), %r10
+ mov 16(up,n,8), %r11
+ shr R8(%rcx), %r10
+ shr R8(%rcx), %r11
+
+ add $4, n
+ jae L(top) C 2
+L(end):
+ neg R32(%rcx) C put rsh count in cl
+ mov -8(up), %r8
+ shl R8(%rcx), %r8
+ or %r8, %r10
+ mov (up), %r9
+ shl R8(%rcx), %r9
+ or %r9, %r11
+ mov %r10, -16(rp)
+ mov %r11, -8(rp)
+
+ neg R32(%rcx) C put lsh count in cl
+L(ast): mov (up), %r10
+ shr R8(%rcx), %r10
+ mov %r10, (rp)
+ FUNC_EXIT()
+ ret
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/sec_tabselect.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/sec_tabselect.asm
new file mode 100644
index 00000000000..e8aed261ef3
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/sec_tabselect.asm
@@ -0,0 +1,176 @@
+dnl AMD64 mpn_sec_tabselect.
+
+dnl Contributed to the GNU project by Torbjörn Granlund.
+
+dnl Copyright 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/limb good for cpu
+C AMD K8,K9 1.5 Y
+C AMD K10 1.4
+C AMD bd1 2.64
+C AMD bobcat 2.15 Y
+C Intel P4 4
+C Intel core2 1.38
+C Intel NHM 1.75
+C Intel SBR 1.25
+C Intel atom 2.5 Y
+C VIA nano 1.75 Y
+
+C NOTES
+C * This has not been tuned for any specific processor. Its speed should not
+C be too bad, though.
+C * Using SSE2/AVX2 could result in many-fold speedup.
+C * WORKS FOR n mod 4 = 0 ONLY!
+
+C mpn_sec_tabselect (mp_limb_t *rp, mp_limb_t *tp, mp_size_t n, mp_size_t nents, mp_size_t which)
+define(`rp', `%rdi')
+define(`tp', `%rsi')
+define(`n', `%rdx')
+define(`nents', `%rcx')
+define(`which', `%r8')
+
+define(`i', `%rbp')
+define(`j', `%r9')
+
+C rax rbx rcx rdx rdi rsi rbp r8 r9 r10 r11 r12 r13 r14 r15
+C nents n rp tab i which j * * * * * *
+
+ABI_SUPPORT(DOS64)
+ABI_SUPPORT(STD64)
+
+ASM_START()
+ TEXT
+ ALIGN(16)
+PROLOGUE(mpn_sec_tabselect)
+ FUNC_ENTRY(4)
+IFDOS(` mov 56(%rsp), %r8d ')
+
+ push %rbx
+ push %rbp
+ push %r12
+ push %r13
+ push %r14
+ push %r15
+
+ mov n, j
+ add $-4, j
+ js L(outer_end)
+
+L(outer_top):
+ mov nents, i
+ push tp
+ xor R32(%r12), R32(%r12)
+ xor R32(%r13), R32(%r13)
+ xor R32(%r14), R32(%r14)
+ xor R32(%r15), R32(%r15)
+ mov which, %rbx
+
+ ALIGN(16)
+L(top): sub $1, %rbx
+ sbb %rax, %rax
+ mov 0(tp), %r10
+ mov 8(tp), %r11
+ and %rax, %r10
+ and %rax, %r11
+ or %r10, %r12
+ or %r11, %r13
+ mov 16(tp), %r10
+ mov 24(tp), %r11
+ and %rax, %r10
+ and %rax, %r11
+ or %r10, %r14
+ or %r11, %r15
+ lea (tp,n,8), tp
+ add $-1, i
+ jne L(top)
+
+ mov %r12, 0(rp)
+ mov %r13, 8(rp)
+ mov %r14, 16(rp)
+ mov %r15, 24(rp)
+ pop tp
+ lea 32(tp), tp
+ lea 32(rp), rp
+ add $-4, j
+ jns L(outer_top)
+L(outer_end):
+
+ test $2, R8(n)
+ jz L(b0x)
+L(b1x): mov nents, i
+ push tp
+ xor R32(%r12), R32(%r12)
+ xor R32(%r13), R32(%r13)
+ mov which, %rbx
+ ALIGN(16)
+L(tp2): sub $1, %rbx
+ sbb %rax, %rax
+ mov 0(tp), %r10
+ mov 8(tp), %r11
+ and %rax, %r10
+ and %rax, %r11
+ or %r10, %r12
+ or %r11, %r13
+ lea (tp,n,8), tp
+ add $-1, i
+ jne L(tp2)
+ mov %r12, 0(rp)
+ mov %r13, 8(rp)
+ pop tp
+ lea 16(tp), tp
+ lea 16(rp), rp
+
+L(b0x): test $1, R8(n)
+ jz L(b00)
+L(b01): mov nents, i
+ xor R32(%r12), R32(%r12)
+ mov which, %rbx
+ ALIGN(16)
+L(tp1): sub $1, %rbx
+ sbb %rax, %rax
+ mov 0(tp), %r10
+ and %rax, %r10
+ or %r10, %r12
+ lea (tp,n,8), tp
+ add $-1, i
+ jne L(tp1)
+ mov %r12, 0(rp)
+
+L(b00): pop %r15
+ pop %r14
+ pop %r13
+ pop %r12
+ pop %rbp
+ pop %rbx
+ FUNC_EXIT()
+ ret
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/sqr_diag_addlsh1.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/sqr_diag_addlsh1.asm
new file mode 100644
index 00000000000..4ad034c855d
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/sqr_diag_addlsh1.asm
@@ -0,0 +1,116 @@
+dnl AMD64 mpn_sqr_diag_addlsh1
+
+dnl Contributed to the GNU project by Torbjörn Granlund.
+
+dnl Copyright 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/limb
+C AMD K8,K9 2.5
+C AMD K10 2.5
+C AMD bull 3.6
+C AMD pile 3.6
+C AMD steam ?
+C AMD bobcat 4
+C AMD jaguar ?
+C Intel P4 ?
+C Intel core 4
+C Intel NHM 3.6
+C Intel SBR 3.15
+C Intel IBR 3.2
+C Intel HWL 2.6
+C Intel BWL ?
+C Intel atom 14
+C VIA nano 3.5
+
+C When playing with pointers, set this to $2 to fall back to conservative
+C indexing in wind-down code.
+define(`I',`$1')
+
+define(`rp', `%rdi')
+define(`tp', `%rsi')
+define(`up_arg', `%rdx')
+define(`n', `%rcx')
+
+define(`up', `%r11')
+
+ABI_SUPPORT(DOS64)
+ABI_SUPPORT(STD64)
+
+ASM_START()
+ TEXT
+ ALIGN(32)
+PROLOGUE(mpn_sqr_diag_addlsh1)
+ FUNC_ENTRY(4)
+ push %rbx
+
+ dec n
+ shl n
+
+ mov (up_arg), %rax
+
+ lea (rp,n,8), rp
+ lea (tp,n,8), tp
+ lea (up_arg,n,4), up
+ neg n
+
+ mul %rax
+ mov %rax, (rp,n,8)
+
+ xor R32(%rbx), R32(%rbx)
+ jmp L(mid)
+
+ ALIGN(16)
+L(top): add %r10, %r8
+ adc %rax, %r9
+ mov %r8, -8(rp,n,8)
+ mov %r9, (rp,n,8)
+L(mid): mov 8(up,n,4), %rax
+ mov (tp,n,8), %r8
+ mov 8(tp,n,8), %r9
+ adc %r8, %r8
+ adc %r9, %r9
+ lea (%rdx,%rbx), %r10
+ setc R8(%rbx)
+ mul %rax
+ add $2, n
+ js L(top)
+
+L(end): add %r10, %r8
+ adc %rax, %r9
+ mov %r8, I(-8(rp),-8(rp,n,8))
+ mov %r9, I((rp),(rp,n,8))
+ adc %rbx, %rdx
+ mov %rdx, I(8(rp),8(rp,n,8))
+
+ pop %rbx
+ FUNC_EXIT()
+ ret
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/sublsh1_n.asm b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/sublsh1_n.asm
new file mode 100644
index 00000000000..c6d829fcb2d
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/sublsh1_n.asm
@@ -0,0 +1,160 @@
+dnl AMD64 mpn_sublsh1_n -- rp[] = up[] - (vp[] << 1)
+
+dnl Copyright 2003, 2005-2007, 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/limb
+C AMD K8,K9 2.2
+C AMD K10 2.2
+C Intel P4 12.75
+C Intel core2 3.45
+C Intel corei ?
+C Intel atom ?
+C VIA nano 3.25
+
+C Sometimes speed degenerates, supposedly related to that some operand
+C alignments cause cache conflicts.
+
+C The speed is limited by decoding/issue bandwidth. There are 26 instructions
+C in the loop, which corresponds to 26/3/4 = 2.167 c/l.
+
+C INPUT PARAMETERS
+define(`rp',`%rdi')
+define(`up',`%rsi')
+define(`vp',`%rdx')
+define(`n', `%rcx')
+
+ABI_SUPPORT(DOS64)
+ABI_SUPPORT(STD64)
+
+ASM_START()
+ TEXT
+ ALIGN(16)
+PROLOGUE(mpn_sublsh1_n)
+ FUNC_ENTRY(4)
+ push %rbx
+ push %rbp
+
+ mov (vp), %r8
+ mov R32(n), R32(%rax)
+ lea (rp,n,8), rp
+ lea (up,n,8), up
+ lea (vp,n,8), vp
+ neg n
+ xor R32(%rbp), R32(%rbp)
+ and $3, R32(%rax)
+ je L(b00)
+ cmp $2, R32(%rax)
+ jc L(b01)
+ je L(b10)
+
+L(b11): add %r8, %r8
+ mov 8(vp,n,8), %r9
+ adc %r9, %r9
+ mov 16(vp,n,8), %r10
+ adc %r10, %r10
+ sbb R32(%rax), R32(%rax) C save scy
+ mov (up,n,8), %rbp
+ mov 8(up,n,8), %rbx
+ sub %r8, %rbp
+ sbb %r9, %rbx
+ mov %rbp, (rp,n,8)
+ mov %rbx, 8(rp,n,8)
+ mov 16(up,n,8), %rbp
+ sbb %r10, %rbp
+ mov %rbp, 16(rp,n,8)
+ sbb R32(%rbp), R32(%rbp) C save acy
+ add $3, n
+ jmp L(ent)
+
+L(b10): add %r8, %r8
+ mov 8(vp,n,8), %r9
+ adc %r9, %r9
+ sbb R32(%rax), R32(%rax) C save scy
+ mov (up,n,8), %rbp
+ mov 8(up,n,8), %rbx
+ sub %r8, %rbp
+ sbb %r9, %rbx
+ mov %rbp, (rp,n,8)
+ mov %rbx, 8(rp,n,8)
+ sbb R32(%rbp), R32(%rbp) C save acy
+ add $2, n
+ jmp L(ent)
+
+L(b01): add %r8, %r8
+ sbb R32(%rax), R32(%rax) C save scy
+ mov (up,n,8), %rbp
+ sub %r8, %rbp
+ mov %rbp, (rp,n,8)
+ sbb R32(%rbp), R32(%rbp) C save acy
+ inc n
+L(ent): jns L(end)
+
+ ALIGN(16)
+L(top): add R32(%rax), R32(%rax) C restore scy
+
+ mov (vp,n,8), %r8
+L(b00): adc %r8, %r8
+ mov 8(vp,n,8), %r9
+ adc %r9, %r9
+ mov 16(vp,n,8), %r10
+ adc %r10, %r10
+ mov 24(vp,n,8), %r11
+ adc %r11, %r11
+
+ sbb R32(%rax), R32(%rax) C save scy
+ add R32(%rbp), R32(%rbp) C restore acy
+
+ mov (up,n,8), %rbp
+ mov 8(up,n,8), %rbx
+ sbb %r8, %rbp
+ sbb %r9, %rbx
+ mov %rbp, (rp,n,8)
+ mov %rbx, 8(rp,n,8)
+ mov 16(up,n,8), %rbp
+ mov 24(up,n,8), %rbx
+ sbb %r10, %rbp
+ sbb %r11, %rbx
+ mov %rbp, 16(rp,n,8)
+ mov %rbx, 24(rp,n,8)
+
+ sbb R32(%rbp), R32(%rbp) C save acy
+ add $4, n
+ js L(top)
+
+L(end): add R32(%rbp), R32(%rax)
+ neg R32(%rax)
+
+ pop %rbp
+ pop %rbx
+ FUNC_EXIT()
+ ret
+EPILOGUE()
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/x86_64-defs.m4 b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/x86_64-defs.m4
new file mode 100644
index 00000000000..366598b41de
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpn/x86_64/x86_64-defs.m4
@@ -0,0 +1,354 @@
+divert(-1)
+
+dnl m4 macros for amd64 assembler.
+
+dnl Copyright 1999-2005, 2008, 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/.
+
+
+dnl Usage: CPUVEC_FUNCS_LIST
+dnl
+dnl A list of the functions from gmp-impl.h x86 struct cpuvec_t, in the
+dnl order they appear in that structure.
+
+define(CPUVEC_FUNCS_LIST,
+``add_n',
+`addlsh1_n',
+`addlsh2_n',
+`addmul_1',
+`addmul_2',
+`bdiv_dbm1c',
+`cnd_add_n',
+`cnd_sub_n',
+`com',
+`copyd',
+`copyi',
+`divexact_1',
+`divrem_1',
+`gcd_1',
+`lshift',
+`lshiftc',
+`mod_1',
+`mod_1_1p',
+`mod_1_1p_cps',
+`mod_1s_2p',
+`mod_1s_2p_cps',
+`mod_1s_4p',
+`mod_1s_4p_cps',
+`mod_34lsub1',
+`modexact_1c_odd',
+`mul_1',
+`mul_basecase',
+`mullo_basecase',
+`preinv_divrem_1',
+`preinv_mod_1',
+`redc_1',
+`redc_2',
+`rshift',
+`sqr_basecase',
+`sub_n',
+`sublsh1_n',
+`submul_1'')
+
+
+dnl Called: PROLOGUE_cpu(GSYM_PREFIX`'foo)
+dnl
+dnl In the amd64 code we use explicit TEXT and ALIGN() calls in the code,
+dnl since different alignments are wanted in various circumstances. So for
+dnl instance,
+dnl
+dnl TEXT
+dnl ALIGN(16)
+dnl PROLOGUE(mpn_add_n)
+dnl ...
+dnl EPILOGUE()
+
+define(`PROLOGUE_cpu',
+m4_assert_numargs(1)
+` GLOBL $1
+ TYPE($1,`function')
+$1:
+')
+
+
+dnl Usage: ASSERT([cond][,instructions])
+dnl
+dnl If WANT_ASSERT is 1, output the given instructions and expect the given
+dnl flags condition to then be satisfied. For example,
+dnl
+dnl ASSERT(ne, `cmpq %rax, %rbx')
+dnl
+dnl The instructions can be omitted to just assert a flags condition with
+dnl no extra calculation. For example,
+dnl
+dnl ASSERT(nc)
+dnl
+dnl When `instructions' is not empty, a pushfq/popfq is added for
+dnl convenience to preserve the flags, but the instructions themselves must
+dnl preserve any registers that matter.
+dnl
+dnl The condition can be omitted to just output the given instructions when
+dnl assertion checking is wanted. In this case the pushf/popf is omitted.
+dnl For example,
+dnl
+dnl ASSERT(, `movq %rax, VAR_KEEPVAL')
+
+define(ASSERT,
+m4_assert_numargs_range(1,2)
+m4_assert_defined(`WANT_ASSERT')
+`ifelse(WANT_ASSERT,1,
+`ifelse(`$1',,
+` $2',
+`ifelse(`$2',,,
+` pushfq')
+ $2
+ j`$1' L(ASSERT_ok`'ASSERT_counter)
+ ud2 C assertion failed
+L(ASSERT_ok`'ASSERT_counter):
+ifelse(`$2',,,` popfq')
+define(`ASSERT_counter',incr(ASSERT_counter))')')')
+
+define(ASSERT_counter,1)
+
+define(`LEA',`dnl
+ifdef(`PIC',
+ `mov $1@GOTPCREL(%rip), $2'
+,
+ `movabs `$'$1, $2')
+')
+
+
+define(`DEF_OBJECT',
+m4_assert_numargs_range(1,2)
+` RODATA
+ ALIGN(ifelse($#,1,2,$2))
+$1:
+')
+
+define(`END_OBJECT',
+m4_assert_numargs(1)
+` SIZE(`$1',.-`$1')')
+
+
+define(`R32',
+ `ifelse($1,`%rax',`%eax',
+ $1,`%rbx',`%ebx',
+ $1,`%rcx',`%ecx',
+ $1,`%rdx',`%edx',
+ $1,`%rsi',`%esi',
+ $1,`%rdi',`%edi',
+ $1,`%rbp',`%ebp',
+ $1,`%r8',`%r8d',
+ $1,`%r9',`%r9d',
+ $1,`%r10',`%r10d',
+ $1,`%r11',`%r11d',
+ $1,`%r12',`%r12d',
+ $1,`%r13',`%r13d',
+ $1,`%r14',`%r14d',
+ $1,`%r15',`%r15d')')
+define(`R8',
+ `ifelse($1,`%rax',`%al',
+ $1,`%rbx',`%bl',
+ $1,`%rcx',`%cl',
+ $1,`%rdx',`%dl',
+ $1,`%rsi',`%sil',
+ $1,`%rdi',`%dil',
+ $1,`%rbp',`%bpl',
+ $1,`%r8',`%r8b',
+ $1,`%r9',`%r9b',
+ $1,`%r10',`%r10b',
+ $1,`%r11',`%r11b',
+ $1,`%r12',`%r12b',
+ $1,`%r13',`%r13b',
+ $1,`%r14',`%r14b',
+ $1,`%r15',`%r15b')')
+
+
+dnl Usage: CALL(funcname)
+dnl
+
+define(`CALL',`dnl
+ifdef(`PIC',
+ `call GSYM_PREFIX`'$1@PLT'
+,
+ `call GSYM_PREFIX`'$1'
+)')
+
+
+define(`JUMPTABSECT', `.section .data.rel.ro.local,"aw",@progbits')
+
+
+dnl Usage: JMPENT(targlabel,tablabel)
+
+define(`JMPENT',`dnl
+ifdef(`PIC',
+ `.long $1-$2'
+,
+ `.quad $1'
+)')
+
+
+dnl These macros are defined just for DOS64, where they provide calling
+dnl sequence glue code.
+
+define(`FUNC_ENTRY',`')
+define(`FUNC_EXIT',`')
+
+
+dnl Target ABI macros.
+
+define(`IFDOS', `')
+define(`IFSTD', `$1')
+define(`IFELF', `$1')
+
+
+dnl Usage: PROTECT(symbol)
+dnl
+dnl Used for private GMP symbols that should never be overridden by users.
+dnl This can save reloc entries and improve shlib sharing as well as
+dnl application startup times
+
+define(`PROTECT', `.hidden $1')
+
+
+dnl Usage: x86_lookup(target, key,value, key,value, ...)
+dnl
+dnl Look for `target' among the `key' parameters.
+dnl
+dnl x86_lookup expands to the corresponding `value', or generates an error
+dnl if `target' isn't found.
+
+define(x86_lookup,
+m4_assert_numargs_range(1,999)
+`ifelse(eval($#<3),1,
+`m4_error(`unrecognised part of x86 instruction: $1
+')',
+`ifelse(`$1',`$2', `$3',
+`x86_lookup(`$1',shift(shift(shift($@))))')')')
+
+
+dnl Usage: x86_opcode_regxmm(reg)
+dnl
+dnl Validate the given xmm register, and return its number, 0 to 7.
+
+define(x86_opcode_regxmm,
+m4_assert_numargs(1)
+`x86_lookup(`$1',x86_opcode_regxmm_list)')
+
+define(x86_opcode_regxmm_list,
+``%xmm0',0,
+`%xmm1',1,
+`%xmm2',2,
+`%xmm3',3,
+`%xmm4',4,
+`%xmm5',5,
+`%xmm6',6,
+`%xmm7',7,
+`%xmm8',8,
+`%xmm9',9,
+`%xmm10',10,
+`%xmm11',11,
+`%xmm12',12,
+`%xmm13',13,
+`%xmm14',14,
+`%xmm15',15')
+
+dnl Usage: palignr($imm,%srcreg,%dstreg)
+dnl
+dnl Emit a palignr instruction, using a .byte sequence, since obsolete but
+dnl still distributed versions of gas don't know SSSE3 instructions.
+
+define(`palignr',
+m4_assert_numargs(3)
+`.byte 0x66,dnl
+ifelse(eval(x86_opcode_regxmm($3) >= 8 || x86_opcode_regxmm($2) >= 8),1,
+ `eval(0x40+x86_opcode_regxmm($3)/8*4+x86_opcode_regxmm($2)/8),')dnl
+0x0f,0x3a,0x0f,dnl
+eval(0xc0+x86_opcode_regxmm($3)%8*8+x86_opcode_regxmm($2)%8),dnl
+substr($1,1)')
+
+
+dnl Usage
+dnl
+dnl regnum(op) raw operand index (so slightly misnamed)
+dnl regnumh(op) high bit of register operand nimber
+dnl ix(op) 0 for reg operand, 1 for plain pointer operand.
+dnl
+
+define(`regnum',`x86_lookup(`$1',oplist)')
+define(`regnumh',`eval(regnum($1)/8 & 1)')
+define(`ix',`eval(regnum($1)/16)')
+define(`oplist',
+``%rax', 0, `%rcx', 1, `%rdx', 2, `%rbx', 3,
+ `%rsp', 4, `%rbp', 5, `%rsi', 6, `%rdi', 7,
+ `%r8', 8, `%r9', 9, `%r10', 10, `%r11', 11,
+ `%r12', 12, `%r13', 13, `%r14', 14, `%r15', 15,
+ `(%rax)',16, `(%rcx)',17, `(%rdx)',18, `(%rbx)',19,
+ `(%rsp)',20, `(%rbp)',21, `(%rsi)',22, `(%rdi)',23,
+ `(%r8)', 24, `(%r9)', 25, `(%r10)',26, `(%r11)',27,
+ `(%r12)',28, `(%r13)',29, `(%r14)',30, `(%r15)' 31')
+
+
+dnl Usage
+dnl
+dnl mulx(reg1,reg2,reg3)
+dnl
+dnl or
+dnl
+dnl mulx((reg1),reg2,reg3)
+dnl
+dnl where reg1 is any register but rsp,rbp,r12,r13, or
+dnl
+dnl mulx(off,(reg1),reg2,reg3)
+dnl
+dnl where reg1 is any register but rsp,r12.
+dnl
+dnl The exceptions are due to special coding needed for some registers; rsp
+dnl and r12 need an extra byte 0x24 at the end while rbp and r13 lack the
+dnl offset-less form.
+dnl
+dnl Other addressing forms are not handled. Invalid forms are not properly
+dnl detected. Offsets that don't fit one byte are not handled correctly.
+
+define(`mulx',`dnl
+ifelse($#,3,
+`.byte 0xc4`'dnl
+,0x`'eval(0xe2^32*regnumh($1)^128*regnumh($3),16)`'dnl
+,0x`'eval(0xfb-8*regnum($2),16)`'dnl
+,0xf6`'dnl
+,0x`'eval(0xc0+(7 & regnum($1))+8*(7 & regnum($3))-0xc0*ix($1),16)`'dnl
+',$#,4,
+`.byte 0xc4`'dnl
+,0x`'eval(0xe2^32*regnumh($2)^128*regnumh($4),16)`'dnl
+,0x`'eval(0xfb-8*regnum($3),16)`'dnl
+,0xf6`'dnl
+,0x`'eval(0x40+(7 & regnum($2))+8*(7 & regnum($4)),16)`'dnl
+,0x`'eval(($1 + 256) % 256,16)`'dnl
+')')
+
+divert`'dnl
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpq/Makefile.am b/Build/source/libs/gmp/gmp-6.0.0/mpq/Makefile.am
new file mode 100644
index 00000000000..406aa9f8dc6
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpq/Makefile.am
@@ -0,0 +1,41 @@
+## Process this file with automake to generate Makefile.in
+
+# Copyright 1996, 1998, 2000-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/.
+
+
+INCLUDES = -D__GMP_WITHIN_GMP -I$(top_srcdir)
+
+noinst_LTLIBRARIES = libmpq.la
+libmpq_la_SOURCES = \
+ abs.c aors.c canonicalize.c clear.c clears.c \
+ cmp.c cmp_si.c cmp_ui.c div.c equal.c \
+ get_d.c get_den.c get_num.c get_str.c \
+ init.c inits.c inp_str.c inv.c md_2exp.c mul.c neg.c out_str.c \
+ set.c set_den.c set_num.c set_si.c set_str.c set_ui.c set_z.c set_d.c \
+ set_f.c swap.c
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpq/abs.c b/Build/source/libs/gmp/gmp-6.0.0/mpq/abs.c
new file mode 100644
index 00000000000..7fe04a35bb6
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpq/abs.c
@@ -0,0 +1,56 @@
+/* mpq_abs -- absolute value of a rational.
+
+Copyright 2000, 2001, 2012 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_FORCE_mpq_abs 1
+
+#include "gmp.h"
+#include "gmp-impl.h"
+
+
+void
+mpq_abs (mpq_ptr dst, mpq_srcptr src)
+{
+ mp_size_t num_abs_size = ABSIZ(NUM(src));
+
+ if (dst != src)
+ {
+ mp_size_t den_size = SIZ(DEN(src));
+ mp_ptr dp;
+
+ dp = MPZ_NEWALLOC (NUM(dst), num_abs_size);
+ MPN_COPY (dp, PTR(NUM(src)), num_abs_size);
+
+ dp = MPZ_NEWALLOC (DEN(dst), den_size);
+ SIZ(DEN(dst)) = den_size;
+ MPN_COPY (dp, PTR(DEN(src)), den_size);
+ }
+
+ SIZ(NUM(dst)) = num_abs_size;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpq/aors.c b/Build/source/libs/gmp/gmp-6.0.0/mpq/aors.c
new file mode 100644
index 00000000000..81edc1fa398
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpq/aors.c
@@ -0,0 +1,113 @@
+/* mpq_add, mpq_sub -- add or subtract rational numbers.
+
+Copyright 1991, 1994-1997, 2000, 2001, 2004, 2005 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.h"
+#include "gmp-impl.h"
+
+
+static void __gmpq_aors (REGPARM_3_1 (mpq_ptr, mpq_srcptr, mpq_srcptr, void (*) (mpz_ptr, mpz_srcptr, mpz_srcptr))) REGPARM_ATTR (1);
+#define mpq_aors(w,x,y,fun) __gmpq_aors (REGPARM_3_1 (w, x, y, fun))
+
+REGPARM_ATTR (1) static void
+mpq_aors (mpq_ptr rop, mpq_srcptr op1, mpq_srcptr op2,
+ void (*fun) (mpz_ptr, mpz_srcptr, mpz_srcptr))
+{
+ mpz_t gcd;
+ mpz_t tmp1, tmp2;
+ mp_size_t op1_num_size = ABSIZ(NUM(op1));
+ mp_size_t op1_den_size = SIZ(DEN(op1));
+ mp_size_t op2_num_size = ABSIZ(NUM(op2));
+ mp_size_t op2_den_size = SIZ(DEN(op2));
+ TMP_DECL;
+
+ TMP_MARK;
+ MPZ_TMP_INIT (gcd, MIN (op1_den_size, op2_den_size));
+ MPZ_TMP_INIT (tmp1, op1_num_size + op2_den_size);
+ MPZ_TMP_INIT (tmp2, op2_num_size + op1_den_size);
+
+ /* ROP might be identical to either operand, so don't store the
+ result there until we are finished with the input operands. We
+ dare to overwrite the numerator of ROP when we are finished
+ with the numerators of OP1 and OP2. */
+
+ mpz_gcd (gcd, DEN(op1), DEN(op2));
+ if (! MPZ_EQUAL_1_P (gcd))
+ {
+ mpz_t t;
+
+ MPZ_TMP_INIT (t, MAX (op1_num_size + op2_den_size,
+ op2_num_size + op1_den_size) + 2 - SIZ(gcd));
+
+ mpz_divexact_gcd (t, DEN(op2), gcd);
+ mpz_divexact_gcd (tmp2, DEN(op1), gcd);
+
+ mpz_mul (tmp1, NUM(op1), t);
+ mpz_mul (t, NUM(op2), tmp2);
+
+ (*fun) (t, tmp1, t);
+
+ mpz_gcd (gcd, t, gcd);
+ if (MPZ_EQUAL_1_P (gcd))
+ {
+ mpz_set (NUM(rop), t);
+ mpz_mul (DEN(rop), DEN(op2), tmp2);
+ }
+ else
+ {
+ mpz_divexact_gcd (NUM(rop), t, gcd);
+ mpz_divexact_gcd (tmp1, DEN(op2), gcd);
+ mpz_mul (DEN(rop), tmp1, tmp2);
+ }
+ }
+ else
+ {
+ /* The common divisor is 1. This is the case (for random input) with
+ probability 6/(pi**2), which is about 60.8%. */
+ mpz_mul (tmp1, NUM(op1), DEN(op2));
+ mpz_mul (tmp2, NUM(op2), DEN(op1));
+ (*fun) (NUM(rop), tmp1, tmp2);
+ mpz_mul (DEN(rop), DEN(op1), DEN(op2));
+ }
+ TMP_FREE;
+}
+
+
+void
+mpq_add (mpq_ptr rop, mpq_srcptr op1, mpq_srcptr op2)
+{
+ mpq_aors (rop, op1, op2, mpz_add);
+}
+
+void
+mpq_sub (mpq_ptr rop, mpq_srcptr op1, mpq_srcptr op2)
+{
+ mpq_aors (rop, op1, op2, mpz_sub);
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpq/canonicalize.c b/Build/source/libs/gmp/gmp-6.0.0/mpq/canonicalize.c
new file mode 100644
index 00000000000..882f408fb83
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpq/canonicalize.c
@@ -0,0 +1,63 @@
+/* mpq_canonicalize(op) -- Remove common factors of the denominator and
+ numerator in OP.
+
+Copyright 1991, 1994-1996, 2000, 2001, 2005 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.h"
+#include "gmp-impl.h"
+
+void
+mpq_canonicalize (mpq_t op)
+{
+ mpz_t gcd;
+ TMP_DECL;
+
+ if (UNLIKELY (SIZ(DEN(op)) == 0))
+ DIVIDE_BY_ZERO;
+
+ TMP_MARK;
+
+ /* ??? Dunno if the 1+ is needed. */
+ MPZ_TMP_INIT (gcd, 1 + MAX (ABSIZ(NUM(op)),
+ ABSIZ(DEN(op))));
+
+ mpz_gcd (gcd, NUM(op), DEN(op));
+ if (! MPZ_EQUAL_1_P (gcd))
+ {
+ mpz_divexact_gcd (NUM(op), NUM(op), gcd);
+ mpz_divexact_gcd (DEN(op), DEN(op), gcd);
+ }
+
+ if (SIZ(DEN(op)) < 0)
+ {
+ SIZ(NUM(op)) = -SIZ(NUM(op));
+ SIZ(DEN(op)) = -SIZ(DEN(op));
+ }
+ TMP_FREE;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpq/clear.c b/Build/source/libs/gmp/gmp-6.0.0/mpq/clear.c
new file mode 100644
index 00000000000..ce0b973f9f4
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpq/clear.c
@@ -0,0 +1,41 @@
+/* mpq_clear -- free the space occupied by a mpq_t.
+
+Copyright 1991, 1994, 1995, 2000, 2001 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.h"
+#include "gmp-impl.h"
+
+void
+mpq_clear (mpq_t m)
+{
+ (*__gmp_free_func) (PTR(NUM(m)),
+ (size_t) ALLOC(NUM(m)) * GMP_LIMB_BYTES);
+ (*__gmp_free_func) (PTR(DEN(m)),
+ (size_t) ALLOC(DEN(m)) * GMP_LIMB_BYTES);
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpq/clears.c b/Build/source/libs/gmp/gmp-6.0.0/mpq/clears.c
new file mode 100644
index 00000000000..f949fe36cd8
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpq/clears.c
@@ -0,0 +1,52 @@
+/* mpq_clears() -- Clear multiple mpq_t variables.
+
+Copyright 2009, 2014 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 <stdarg.h>
+#include <stdio.h> /* for NULL */
+#include "gmp.h"
+#include "gmp-impl.h"
+
+void
+mpq_clears (mpq_ptr x, ...)
+{
+ va_list ap;
+
+ va_start (ap, x);
+
+ while (x != NULL)
+ {
+ (*__gmp_free_func) (PTR(NUM(x)),
+ (size_t) ALLOC(NUM(x)) * GMP_LIMB_BYTES);
+ (*__gmp_free_func) (PTR(DEN(x)),
+ (size_t) ALLOC(DEN(x)) * GMP_LIMB_BYTES);
+ x = va_arg (ap, mpq_ptr);
+ }
+ va_end (ap);
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpq/cmp.c b/Build/source/libs/gmp/gmp-6.0.0/mpq/cmp.c
new file mode 100644
index 00000000000..e633b6f42d4
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpq/cmp.c
@@ -0,0 +1,126 @@
+/* mpq_cmp(u,v) -- Compare U, V. Return positive, zero, or negative
+ based on if U > V, U == V, or U < V.
+
+Copyright 1991, 1994, 1996, 2001, 2002, 2005 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.h"
+#include "gmp-impl.h"
+#include "longlong.h"
+
+int
+mpq_cmp (const mpq_t op1, const mpq_t op2)
+{
+ mp_size_t num1_size = SIZ(NUM(op1));
+ mp_size_t den1_size = SIZ(DEN(op1));
+ mp_size_t num2_size = SIZ(NUM(op2));
+ mp_size_t den2_size = SIZ(DEN(op2));
+ mp_size_t tmp1_size, tmp2_size;
+ mp_ptr tmp1_ptr, tmp2_ptr;
+ mp_size_t num1_sign;
+ int cc;
+ TMP_DECL;
+
+ /* need canonical signs to get right result */
+ ASSERT (den1_size > 0);
+ ASSERT (den2_size > 0);
+
+ if (num1_size == 0)
+ return -num2_size;
+ if (num2_size == 0)
+ return num1_size;
+ if ((num1_size ^ num2_size) < 0) /* I.e. are the signs different? */
+ return num1_size;
+
+ num1_sign = num1_size;
+ num1_size = ABS (num1_size);
+ num2_size = ABS (num2_size);
+
+ tmp1_size = num1_size + den2_size;
+ tmp2_size = num2_size + den1_size;
+
+ /* 1. Check to see if we can tell which operand is larger by just looking at
+ the number of limbs. */
+
+ /* NUM1 x DEN2 is either TMP1_SIZE limbs or TMP1_SIZE-1 limbs.
+ Same for NUM1 x DEN1 with respect to TMP2_SIZE. */
+ if (tmp1_size > tmp2_size + 1)
+ /* NUM1 x DEN2 is surely larger in magnitude than NUM2 x DEN1. */
+ return num1_sign;
+ if (tmp2_size > tmp1_size + 1)
+ /* NUM1 x DEN2 is surely smaller in magnitude than NUM2 x DEN1. */
+ return -num1_sign;
+
+ /* 2. Same, but compare the number of significant bits. */
+ {
+ int cnt1, cnt2;
+ mp_bitcnt_t bits1, bits2;
+
+ count_leading_zeros (cnt1, PTR(NUM(op1))[num1_size - 1]);
+ count_leading_zeros (cnt2, PTR(DEN(op2))[den2_size - 1]);
+ bits1 = tmp1_size * GMP_NUMB_BITS - cnt1 - cnt2 + 2 * GMP_NAIL_BITS;
+
+ count_leading_zeros (cnt1, PTR(NUM(op2))[num2_size - 1]);
+ count_leading_zeros (cnt2, PTR(DEN(op1))[den1_size - 1]);
+ bits2 = tmp2_size * GMP_NUMB_BITS - cnt1 - cnt2 + 2 * GMP_NAIL_BITS;
+
+ if (bits1 > bits2 + 1)
+ return num1_sign;
+ if (bits2 > bits1 + 1)
+ return -num1_sign;
+ }
+
+ /* 3. Finally, cross multiply and compare. */
+
+ TMP_MARK;
+ TMP_ALLOC_LIMBS_2 (tmp1_ptr,tmp1_size, tmp2_ptr,tmp2_size);
+
+ if (num1_size >= den2_size)
+ tmp1_size -= 0 == mpn_mul (tmp1_ptr,
+ PTR(NUM(op1)), num1_size,
+ PTR(DEN(op2)), den2_size);
+ else
+ tmp1_size -= 0 == mpn_mul (tmp1_ptr,
+ PTR(DEN(op2)), den2_size,
+ PTR(NUM(op1)), num1_size);
+
+ if (num2_size >= den1_size)
+ tmp2_size -= 0 == mpn_mul (tmp2_ptr,
+ PTR(NUM(op2)), num2_size,
+ PTR(DEN(op1)), den1_size);
+ else
+ tmp2_size -= 0 == mpn_mul (tmp2_ptr,
+ PTR(DEN(op1)), den1_size,
+ PTR(NUM(op2)), num2_size);
+
+
+ cc = tmp1_size - tmp2_size != 0
+ ? tmp1_size - tmp2_size : mpn_cmp (tmp1_ptr, tmp2_ptr, tmp1_size);
+ TMP_FREE;
+ return num1_sign < 0 ? -cc : cc;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpq/cmp_si.c b/Build/source/libs/gmp/gmp-6.0.0/mpq/cmp_si.c
new file mode 100644
index 00000000000..0a31fe8c9e7
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpq/cmp_si.c
@@ -0,0 +1,67 @@
+/* _mpq_cmp_si -- compare mpq and long/ulong fraction.
+
+Copyright 2001, 2013 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.h"
+#include "gmp-impl.h"
+
+
+/* Something like mpq_cmpabs_ui would be more useful for the neg/neg case,
+ and perhaps a version accepting a parameter to reverse the test, to make
+ it a tail call here. */
+
+int
+_mpq_cmp_si (mpq_srcptr q, long n, unsigned long d)
+{
+ /* need canonical sign to get right result */
+ ASSERT (SIZ(DEN(q)) > 0);
+
+ if (SIZ(NUM(q)) >= 0)
+ {
+ if (n >= 0)
+ return _mpq_cmp_ui (q, n, d); /* >=0 cmp >=0 */
+ else
+ return 1; /* >=0 cmp <0 */
+ }
+ else
+ {
+ if (n >= 0)
+ return -1; /* <0 cmp >=0 */
+ else
+ {
+ mpq_t qabs;
+ SIZ(NUM(qabs)) = ABSIZ(NUM(q));
+ PTR(NUM(qabs)) = PTR(NUM(q));
+ SIZ(DEN(qabs)) = SIZ(DEN(q));
+ PTR(DEN(qabs)) = PTR(DEN(q));
+
+ return - _mpq_cmp_ui (qabs, NEG_CAST (unsigned long, n), d); /* <0 cmp <0 */
+ }
+ }
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpq/cmp_ui.c b/Build/source/libs/gmp/gmp-6.0.0/mpq/cmp_ui.c
new file mode 100644
index 00000000000..a2e2d8ca812
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpq/cmp_ui.c
@@ -0,0 +1,100 @@
+/* mpq_cmp_ui(u,vn,vd) -- Compare U with Vn/Vd. Return positive, zero, or
+ negative based on if U > V, U == V, or U < V. Vn and Vd may have
+ common factors.
+
+Copyright 1993, 1994, 1996, 2000-2003, 2005 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.h"
+#include "gmp-impl.h"
+
+int
+_mpq_cmp_ui (const mpq_t op1, unsigned long int num2, unsigned long int den2)
+{
+ mp_size_t num1_size = SIZ(NUM(op1));
+ mp_size_t den1_size = SIZ(DEN(op1));
+ mp_size_t tmp1_size, tmp2_size;
+ mp_ptr tmp1_ptr, tmp2_ptr;
+ mp_limb_t cy_limb;
+ int cc;
+ TMP_DECL;
+
+#if GMP_NAIL_BITS != 0
+ if ((num2 | den2) > GMP_NUMB_MAX)
+ {
+ mpq_t op2;
+ mpq_init (op2);
+ mpz_set_ui (mpq_numref (op2), num2);
+ mpz_set_ui (mpq_denref (op2), den2);
+ cc = mpq_cmp (op1, op2);
+ mpq_clear (op2);
+ return cc;
+ }
+#endif
+
+ /* need canonical sign to get right result */
+ ASSERT (den1_size > 0);
+
+ if (UNLIKELY (den2 == 0))
+ DIVIDE_BY_ZERO;
+
+ if (num1_size == 0)
+ return -(num2 != 0);
+ if (num1_size < 0)
+ return num1_size;
+ if (num2 == 0)
+ return num1_size;
+
+ /* NUM1 x DEN2 is either TMP1_SIZE limbs or TMP1_SIZE-1 limbs.
+ Same for NUM1 x DEN1 with respect to TMP2_SIZE. */
+ if (num1_size > den1_size + 1)
+ /* NUM1 x DEN2 is surely larger in magnitude than NUM2 x DEN1. */
+ return num1_size;
+ if (den1_size > num1_size + 1)
+ /* NUM1 x DEN2 is surely smaller in magnitude than NUM2 x DEN1. */
+ return -num1_size;
+
+ TMP_MARK;
+ tmp1_ptr = TMP_ALLOC_LIMBS (num1_size + 1);
+ tmp2_ptr = TMP_ALLOC_LIMBS (den1_size + 1);
+
+ cy_limb = mpn_mul_1 (tmp1_ptr, PTR(NUM(op1)), num1_size,
+ (mp_limb_t) den2);
+ tmp1_ptr[num1_size] = cy_limb;
+ tmp1_size = num1_size + (cy_limb != 0);
+
+ cy_limb = mpn_mul_1 (tmp2_ptr, PTR(DEN(op1)), den1_size,
+ (mp_limb_t) num2);
+ tmp2_ptr[den1_size] = cy_limb;
+ tmp2_size = den1_size + (cy_limb != 0);
+
+ cc = tmp1_size - tmp2_size != 0
+ ? tmp1_size - tmp2_size : mpn_cmp (tmp1_ptr, tmp2_ptr, tmp1_size);
+ TMP_FREE;
+ return cc;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpq/div.c b/Build/source/libs/gmp/gmp-6.0.0/mpq/div.c
new file mode 100644
index 00000000000..7d91e0998ae
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpq/div.c
@@ -0,0 +1,115 @@
+/* mpq_div -- divide two rational numbers.
+
+Copyright 1991, 1994-1996, 2000, 2001 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.h"
+#include "gmp-impl.h"
+
+
+void
+mpq_div (mpq_ptr quot, mpq_srcptr op1, mpq_srcptr op2)
+{
+ mpz_t gcd1, gcd2;
+ mpz_t tmp1, tmp2;
+ mpz_t numtmp;
+ mp_size_t op1_num_size;
+ mp_size_t op1_den_size;
+ mp_size_t op2_num_size;
+ mp_size_t op2_den_size;
+ mp_size_t alloc;
+ TMP_DECL;
+
+ op2_num_size = ABSIZ(NUM(op2));
+
+ if (UNLIKELY (op2_num_size == 0))
+ DIVIDE_BY_ZERO;
+
+ op1_num_size = ABSIZ(NUM(op1));
+
+ if (op1_num_size == 0)
+ {
+ /* We special case this to simplify allocation logic; gcd(0,x) = x
+ is a singular case for the allocations. */
+ SIZ(NUM(quot)) = 0;
+ PTR(DEN(quot))[0] = 1;
+ SIZ(DEN(quot)) = 1;
+ return;
+ }
+
+ op2_den_size = SIZ(DEN(op2));
+ op1_den_size = SIZ(DEN(op1));
+
+ TMP_MARK;
+
+ alloc = MIN (op1_num_size, op2_num_size);
+ MPZ_TMP_INIT (gcd1, alloc);
+
+ alloc = MIN (op1_den_size, op2_den_size);
+ MPZ_TMP_INIT (gcd2, alloc);
+
+ alloc = MAX (op1_num_size, op2_num_size);
+ MPZ_TMP_INIT (tmp1, alloc);
+
+ alloc = MAX (op1_den_size, op2_den_size);
+ MPZ_TMP_INIT (tmp2, alloc);
+
+ alloc = op1_num_size + op2_den_size;
+ MPZ_TMP_INIT (numtmp, alloc);
+
+ /* QUOT might be identical to either operand, so don't store the result there
+ until we are finished with the input operands. We can overwrite the
+ numerator of QUOT when we are finished with the numerators of OP1 and
+ OP2. */
+
+ mpz_gcd (gcd1, NUM(op1), NUM(op2));
+ mpz_gcd (gcd2, DEN(op2), DEN(op1));
+
+ mpz_divexact_gcd (tmp1, NUM(op1), gcd1);
+ mpz_divexact_gcd (tmp2, DEN(op2), gcd2);
+
+ mpz_mul (numtmp, tmp1, tmp2);
+
+ mpz_divexact_gcd (tmp1, NUM(op2), gcd1);
+ mpz_divexact_gcd (tmp2, DEN(op1), gcd2);
+
+ mpz_mul (DEN(quot), tmp1, tmp2);
+
+ /* We needed to go via NUMTMP to take care of QUOT being the same as OP2.
+ Now move NUMTMP to QUOT->_mp_num. */
+ mpz_set (NUM(quot), numtmp);
+
+ /* Keep the denominator positive. */
+ if (SIZ(DEN(quot)) < 0)
+ {
+ SIZ(DEN(quot)) = -SIZ(DEN(quot));
+ SIZ(NUM(quot)) = -SIZ(NUM(quot));
+ }
+
+ TMP_FREE;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpq/equal.c b/Build/source/libs/gmp/gmp-6.0.0/mpq/equal.c
new file mode 100644
index 00000000000..500c2d802ea
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpq/equal.c
@@ -0,0 +1,69 @@
+/* mpq_equal(u,v) -- Compare U, V. Return non-zero if they are equal, zero
+ if they are non-equal.
+
+Copyright 1996, 2001, 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/. */
+
+#include "gmp.h"
+#include "gmp-impl.h"
+
+int
+mpq_equal (mpq_srcptr op1, mpq_srcptr op2) __GMP_NOTHROW
+{
+ mp_size_t num1_size, num2_size, den1_size, den2_size, i;
+ mp_srcptr num1_ptr, num2_ptr, den1_ptr, den2_ptr;
+
+ /* need fully canonical for correct results */
+ ASSERT_MPQ_CANONICAL (op1);
+ ASSERT_MPQ_CANONICAL (op2);
+
+ num1_size = SIZ(NUM(op1));
+ num2_size = SIZ(NUM(op2));
+ if (num1_size != num2_size)
+ return 0;
+
+ num1_ptr = PTR(NUM(op1));
+ num2_ptr = PTR(NUM(op2));
+ num1_size = ABS (num1_size);
+ for (i = 0; i < num1_size; i++)
+ if (num1_ptr[i] != num2_ptr[i])
+ return 0;
+
+ den1_size = SIZ(DEN(op1));
+ den2_size = SIZ(DEN(op2));
+ if (den1_size != den2_size)
+ return 0;
+
+ den1_ptr = PTR(DEN(op1));
+ den2_ptr = PTR(DEN(op2));
+ for (i = 0; i < den1_size; i++)
+ if (den1_ptr[i] != den2_ptr[i])
+ return 0;
+
+ return 1;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpq/get_d.c b/Build/source/libs/gmp/gmp-6.0.0/mpq/get_d.c
new file mode 100644
index 00000000000..6318e222936
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpq/get_d.c
@@ -0,0 +1,175 @@
+/* double mpq_get_d (mpq_t src) -- mpq to double, rounding towards zero.
+
+Copyright 1995, 1996, 2001-2005 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> /* for NULL */
+#include "gmp.h"
+#include "gmp-impl.h"
+#include "longlong.h"
+
+
+/* All that's needed is to get the high 53 bits of the quotient num/den,
+ rounded towards zero. More than 53 bits is fine, any excess is ignored
+ by mpn_get_d.
+
+ N_QLIMBS is how many quotient limbs we need to satisfy the mantissa of a
+ double, assuming the highest of those limbs is non-zero. The target
+ qsize for mpn_tdiv_qr is then 1 more than this, since that function may
+ give a zero in the high limb (and non-zero in the second highest).
+
+ The use of 8*sizeof(double) in N_QLIMBS is an overestimate of the
+ mantissa bits, but it gets the same result as the true value (53 or 48 or
+ whatever) when rounded up to a multiple of GMP_NUMB_BITS, for non-nails.
+
+ Enhancements:
+
+ Use the true mantissa size in the N_QLIMBS formula, to save a divide step
+ in nails.
+
+ Examine the high limbs of num and den to see if the highest 1 bit of the
+ quotient will fall high enough that just N_QLIMBS-1 limbs is enough to
+ get the necessary bits, thereby saving a division step.
+
+ Bit shift either num or den to arrange for the above condition on the
+ high 1 bit of the quotient, to save a division step always. A shift to
+ save a division step is definitely worthwhile with mpn_tdiv_qr, though we
+ may want to reassess this on big num/den when a quotient-only division
+ exists.
+
+ Maybe we could estimate the final exponent using nsize-dsize (and
+ possibly the high limbs of num and den), so as to detect overflow and
+ return infinity or zero quickly. Overflow is never very helpful to an
+ application, and can therefore probably be regarded as abnormal, but we
+ may still like to optimize it if the conditions are easy. (This would
+ only be for float formats we know, unknown formats are not important and
+ can be left to mpn_get_d.)
+
+ 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.
+
+ Alternatives:
+
+ An alternative algorithm, that may be faster:
+ 0. Let n be somewhat larger than the number of significant bits in a double.
+ 1. Extract the most significant n bits of the denominator, and an equal
+ number of bits from the numerator.
+ 2. Interpret the extracted numbers as integers, call them a and b
+ respectively, and develop n bits of the fractions ((a + 1) / b) and
+ (a / (b + 1)) using mpn_divrem.
+ 3. If the computed values are identical UP TO THE POSITION WE CARE ABOUT,
+ we are done. If they are different, repeat the algorithm from step 1,
+ but first let n = n * 2.
+ 4. If we end up using all bits from the numerator and denominator, fall
+ back to a plain division.
+ 5. Just to make life harder, The computation of a + 1 and b + 1 above
+ might give carry-out... Needs special handling. It might work to
+ subtract 1 in both cases instead.
+
+ Not certain if this approach would be faster than a quotient-only
+ division. Presumably such optimizations are the sort of thing we would
+ like to have helping everywhere that uses a quotient-only division. */
+
+double
+mpq_get_d (const mpq_t src)
+{
+ double res;
+ mp_srcptr np, dp;
+ mp_ptr remp, tp;
+ mp_size_t nsize = SIZ(NUM(src));
+ mp_size_t dsize = SIZ(DEN(src));
+ mp_size_t qsize, prospective_qsize, zeros, chop, tsize;
+ mp_size_t sign_quotient = nsize;
+ long exp;
+#define N_QLIMBS (1 + (sizeof (double) + GMP_LIMB_BYTES-1) / GMP_LIMB_BYTES)
+ mp_limb_t qarr[N_QLIMBS + 1];
+ mp_ptr qp = qarr;
+ TMP_DECL;
+
+ ASSERT (dsize > 0); /* canonical src */
+
+ /* mpn_get_d below requires a non-zero operand */
+ if (UNLIKELY (nsize == 0))
+ return 0.0;
+
+ TMP_MARK;
+ nsize = ABS (nsize);
+ dsize = ABS (dsize);
+ np = PTR(NUM(src));
+ dp = PTR(DEN(src));
+
+ prospective_qsize = nsize - dsize + 1; /* from using given n,d */
+ qsize = N_QLIMBS + 1; /* desired qsize */
+
+ zeros = qsize - prospective_qsize; /* padding n to get qsize */
+ exp = (long) -zeros * GMP_NUMB_BITS; /* relative to low of qp */
+
+ chop = MAX (-zeros, 0); /* negative zeros means shorten n */
+ np += chop;
+ nsize -= chop;
+ zeros += chop; /* now zeros >= 0 */
+
+ tsize = nsize + zeros; /* size for possible copy of n */
+
+ if (WANT_TMP_DEBUG)
+ {
+ /* separate blocks, for malloc debugging */
+ remp = TMP_ALLOC_LIMBS (dsize);
+ tp = (zeros > 0 ? TMP_ALLOC_LIMBS (tsize) : NULL);
+ }
+ else
+ {
+ /* one block with conditionalized size, for efficiency */
+ remp = TMP_ALLOC_LIMBS (dsize + (zeros > 0 ? tsize : 0));
+ tp = remp + dsize;
+ }
+
+ /* zero extend n into temporary space, if necessary */
+ if (zeros > 0)
+ {
+ MPN_ZERO (tp, zeros);
+ MPN_COPY (tp+zeros, np, nsize);
+ np = tp;
+ nsize = tsize;
+ }
+
+ ASSERT (qsize == nsize - dsize + 1);
+ mpn_tdiv_qr (qp, remp, (mp_size_t) 0, np, nsize, dp, dsize);
+
+ /* strip possible zero high limb */
+ qsize -= (qp[qsize-1] == 0);
+
+ res = mpn_get_d (qp, qsize, sign_quotient, exp);
+ TMP_FREE;
+ return res;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpq/get_den.c b/Build/source/libs/gmp/gmp-6.0.0/mpq/get_den.c
new file mode 100644
index 00000000000..48a385c817e
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpq/get_den.c
@@ -0,0 +1,43 @@
+/* mpq_get_den(den,rat_src) -- Set DEN to the denominator of RAT_SRC.
+
+Copyright 1991, 1994, 1995, 2001, 2012 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.h"
+#include "gmp-impl.h"
+
+void
+mpq_get_den (mpz_ptr den, mpq_srcptr src)
+{
+ mp_size_t size = SIZ(DEN(src));
+ mp_ptr dp;
+
+ dp = MPZ_NEWALLOC (den, size);
+ SIZ(den) = size;
+ MPN_COPY (dp, PTR(DEN(src)), size);
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpq/get_num.c b/Build/source/libs/gmp/gmp-6.0.0/mpq/get_num.c
new file mode 100644
index 00000000000..cb464ccb94f
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpq/get_num.c
@@ -0,0 +1,45 @@
+ /* mpq_get_num(num,rat_src) -- Set NUM to the numerator of RAT_SRC.
+
+Copyright 1991, 1994, 1995, 2001, 2012 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.h"
+#include "gmp-impl.h"
+
+void
+mpq_get_num (mpz_ptr num, mpq_srcptr src)
+{
+ mp_size_t size = SIZ(NUM(src));
+ mp_size_t abs_size = ABS (size);
+ mp_ptr dp;
+
+ dp = MPZ_NEWALLOC (num, abs_size);
+ SIZ(num) = size;
+
+ MPN_COPY (dp, PTR(NUM(src)), abs_size);
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpq/get_str.c b/Build/source/libs/gmp/gmp-6.0.0/mpq/get_str.c
new file mode 100644
index 00000000000..8fa0de1cd74
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpq/get_str.c
@@ -0,0 +1,76 @@
+/* mpq_get_str -- mpq to string conversion.
+
+Copyright 2001, 2002, 2006, 2011 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 <string.h>
+#include "gmp.h"
+#include "gmp-impl.h"
+#include "longlong.h"
+
+char *
+mpq_get_str (char *str, int base, mpq_srcptr q)
+{
+ size_t str_alloc, len;
+
+ if (base > 62 || base < -36)
+ return NULL;
+
+ str_alloc = 0;
+ if (str == NULL)
+ {
+ /* This is an overestimate since we don't bother checking how much of
+ the high limbs of num and den are used. +2 for rounding up the
+ chars per bit of num and den. +3 for sign, slash and '\0'. */
+ DIGITS_IN_BASE_PER_LIMB (str_alloc, ABSIZ(NUM(q)) + SIZ(DEN(q)), ABS(base));
+ str_alloc += 6;
+
+ str = (char *) (*__gmp_allocate_func) (str_alloc);
+ }
+
+ mpz_get_str (str, base, mpq_numref(q));
+ len = strlen (str);
+ if (! MPZ_EQUAL_1_P (mpq_denref (q)))
+ {
+ str[len++] = '/';
+ mpz_get_str (str+len, base, mpq_denref(q));
+ len += strlen (str+len);
+ }
+
+ ASSERT (len == strlen(str));
+ ASSERT (str_alloc == 0 || len+1 <= str_alloc);
+ ASSERT (len+1 <= /* size recommended to applications */
+ mpz_sizeinbase (mpq_numref(q), ABS(base)) +
+ mpz_sizeinbase (mpq_denref(q), ABS(base)) + 3);
+
+ if (str_alloc != 0)
+ __GMP_REALLOCATE_FUNC_MAYBE_TYPE (str, str_alloc, len+1, char);
+
+ return str;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpq/init.c b/Build/source/libs/gmp/gmp-6.0.0/mpq/init.c
new file mode 100644
index 00000000000..0f526ef31d0
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpq/init.c
@@ -0,0 +1,49 @@
+/* mpq_init -- Make a new rational number with value 0/1.
+
+Copyright 1991, 1994, 1995, 2000-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/. */
+
+#include "gmp.h"
+#include "gmp-impl.h"
+
+void
+mpq_init (mpq_t x)
+{
+ ALLOC(NUM(x)) = 1;
+ PTR(NUM(x)) = (mp_ptr) (*__gmp_allocate_func) (GMP_LIMB_BYTES);
+ SIZ(NUM(x)) = 0;
+ ALLOC(DEN(x)) = 1;
+ PTR(DEN(x)) = (mp_ptr) (*__gmp_allocate_func) (GMP_LIMB_BYTES);
+ PTR(DEN(x))[0] = 1;
+ SIZ(DEN(x)) = 1;
+
+#ifdef __CHECKER__
+ /* let the low limb look initialized, for the benefit of mpz_get_ui etc */
+ PTR(NUM(x))[0] = 0;
+#endif
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpq/inits.c b/Build/source/libs/gmp/gmp-6.0.0/mpq/inits.c
new file mode 100644
index 00000000000..97c41656ffd
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpq/inits.c
@@ -0,0 +1,49 @@
+/* mpq_inits() -- Initialize multiple mpq_t variables and set them to 0.
+
+Copyright 2009 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 <stdarg.h>
+#include <stdio.h> /* for NULL */
+#include "gmp.h"
+#include "gmp-impl.h"
+
+void
+mpq_inits (mpq_ptr x, ...)
+{
+ va_list ap;
+
+ va_start (ap, x);
+
+ while (x != NULL)
+ {
+ mpq_init (x);
+ x = va_arg (ap, mpq_ptr);
+ }
+ va_end (ap);
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpq/inp_str.c b/Build/source/libs/gmp/gmp-6.0.0/mpq/inp_str.c
new file mode 100644
index 00000000000..7ba95743f8f
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpq/inp_str.c
@@ -0,0 +1,76 @@
+/* mpq_inp_str -- read an mpq from a FILE.
+
+Copyright 2001 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 <ctype.h>
+#include "gmp.h"
+#include "gmp-impl.h"
+
+
+size_t
+mpq_inp_str (mpq_ptr q, FILE *fp, int base)
+{
+ size_t nread;
+ int c;
+
+ if (fp == NULL)
+ fp = stdin;
+
+ SIZ(DEN(q)) = 1;
+ PTR(DEN(q))[0] = 1;
+
+ nread = mpz_inp_str (mpq_numref(q), fp, base);
+ if (nread == 0)
+ return 0;
+
+ c = getc (fp);
+ nread++;
+
+ if (c == '/')
+ {
+ c = getc (fp);
+ nread++;
+
+ nread = mpz_inp_str_nowhite (mpq_denref(q), fp, base, c, nread);
+ if (nread == 0)
+ {
+ SIZ(NUM(q)) = 0;
+ SIZ(DEN(q)) = 1;
+ PTR(DEN(q))[0] = 1;
+ }
+ }
+ else
+ {
+ ungetc (c, fp);
+ nread--;
+ }
+
+ return nread;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpq/inv.c b/Build/source/libs/gmp/gmp-6.0.0/mpq/inv.c
new file mode 100644
index 00000000000..bd703d48602
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpq/inv.c
@@ -0,0 +1,71 @@
+/* mpq_inv(dest,src) -- invert a rational number, i.e. set DEST to SRC
+ with the numerator and denominator swapped.
+
+Copyright 1991, 1994, 1995, 2000, 2001, 2012 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.h"
+#include "gmp-impl.h"
+
+void
+mpq_inv (mpq_ptr dest, mpq_srcptr src)
+{
+ mp_size_t num_size = SIZ(NUM(src));
+ mp_size_t den_size = SIZ(DEN(src));
+
+ if (num_size < 0)
+ {
+ num_size = -num_size;
+ den_size = -den_size;
+ }
+ else if (UNLIKELY (num_size == 0))
+ DIVIDE_BY_ZERO;
+
+ SIZ(DEN(dest)) = num_size;
+ SIZ(NUM(dest)) = den_size;
+
+ /* If dest == src we may just swap the numerator and denominator;
+ we ensured that the new denominator is positive. */
+
+ if (dest == src)
+ {
+ MP_PTR_SWAP (PTR(NUM(dest)), PTR(DEN(dest)));
+ MP_SIZE_T_SWAP (ALLOC(NUM(dest)), ALLOC(DEN(dest)));
+ }
+ else
+ {
+ mp_ptr dp;
+
+ den_size = ABS (den_size);
+ dp = MPZ_NEWALLOC (NUM(dest), den_size);
+ MPN_COPY (dp, PTR(DEN(src)), den_size);
+
+ dp = MPZ_NEWALLOC (DEN(dest), num_size);
+ MPN_COPY (dp, PTR(NUM(src)), num_size);
+ }
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpq/md_2exp.c b/Build/source/libs/gmp/gmp-6.0.0/mpq/md_2exp.c
new file mode 100644
index 00000000000..a2a7e1e2fb7
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpq/md_2exp.c
@@ -0,0 +1,111 @@
+/* mpq_mul_2exp, mpq_div_2exp - multiply or divide by 2^N */
+
+/*
+Copyright 2000, 2002, 2012 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.h"
+#include "gmp-impl.h"
+#include "longlong.h"
+
+
+/* The multiplier/divisor "n", representing 2^n, is applied by right shifting
+ "r" until it's odd (if it isn't already), and left shifting "l" for the
+ rest. */
+
+static void
+mord_2exp (mpz_ptr ldst, mpz_ptr rdst, mpz_srcptr lsrc, mpz_srcptr rsrc,
+ mp_bitcnt_t n)
+{
+ mp_size_t rsrc_size = SIZ(rsrc);
+ mp_size_t len = ABS (rsrc_size);
+ mp_ptr rsrc_ptr = PTR(rsrc);
+ mp_ptr p, rdst_ptr;
+ mp_limb_t plow;
+
+ p = rsrc_ptr;
+ plow = *p;
+ while (n >= GMP_NUMB_BITS && plow == 0)
+ {
+ n -= GMP_NUMB_BITS;
+ p++;
+ plow = *p;
+ }
+
+ /* no realloc here if rsrc==rdst, so p and rsrc_ptr remain valid */
+ len -= (p - rsrc_ptr);
+ rdst_ptr = MPZ_REALLOC (rdst, len);
+
+ if ((plow & 1) || n == 0)
+ {
+ /* need INCR when src==dst */
+ if (p != rdst_ptr)
+ MPN_COPY_INCR (rdst_ptr, p, len);
+ }
+ else
+ {
+ unsigned long shift;
+ if (plow == 0)
+ shift = n;
+ else
+ {
+ count_trailing_zeros (shift, plow);
+ shift = MIN (shift, n);
+ }
+ mpn_rshift (rdst_ptr, p, len, shift);
+ len -= (rdst_ptr[len-1] == 0);
+ n -= shift;
+ }
+ SIZ(rdst) = (rsrc_size >= 0) ? len : -len;
+
+ if (n)
+ mpz_mul_2exp (ldst, lsrc, n);
+ else if (ldst != lsrc)
+ mpz_set (ldst, lsrc);
+}
+
+
+void
+mpq_mul_2exp (mpq_ptr dst, mpq_srcptr src, mp_bitcnt_t n)
+{
+ mord_2exp (NUM(dst), DEN(dst), NUM(src), DEN(src), n);
+}
+
+void
+mpq_div_2exp (mpq_ptr dst, mpq_srcptr src, mp_bitcnt_t n)
+{
+ if (SIZ(NUM(src)) == 0)
+ {
+ SIZ(NUM(dst)) = 0;
+ SIZ(DEN(dst)) = 1;
+ PTR(DEN(dst))[0] = 1;
+ return;
+ }
+
+ mord_2exp (DEN(dst), NUM(dst), DEN(src), NUM(src), n);
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpq/mul.c b/Build/source/libs/gmp/gmp-6.0.0/mpq/mul.c
new file mode 100644
index 00000000000..49d618f3bc1
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpq/mul.c
@@ -0,0 +1,103 @@
+/* mpq_mul -- multiply two rational numbers.
+
+Copyright 1991, 1994-1996, 2000-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/. */
+
+#include "gmp.h"
+#include "gmp-impl.h"
+
+
+void
+mpq_mul (mpq_ptr prod, mpq_srcptr op1, mpq_srcptr op2)
+{
+ mpz_t gcd1, gcd2;
+ mpz_t tmp1, tmp2;
+ mp_size_t op1_num_size;
+ mp_size_t op1_den_size;
+ mp_size_t op2_num_size;
+ mp_size_t op2_den_size;
+ mp_size_t alloc;
+ TMP_DECL;
+
+ if (op1 == op2)
+ {
+ /* No need for any GCDs when squaring. */
+ mpz_mul (mpq_numref (prod), mpq_numref (op1), mpq_numref (op1));
+ mpz_mul (mpq_denref (prod), mpq_denref (op1), mpq_denref (op1));
+ return;
+ }
+
+ op1_num_size = ABSIZ(NUM(op1));
+ op1_den_size = SIZ(DEN(op1));
+ op2_num_size = ABSIZ(NUM(op2));
+ op2_den_size = SIZ(DEN(op2));
+
+ if (op1_num_size == 0 || op2_num_size == 0)
+ {
+ /* We special case this to simplify allocation logic; gcd(0,x) = x
+ is a singular case for the allocations. */
+ SIZ(NUM(prod)) = 0;
+ PTR(DEN(prod))[0] = 1;
+ SIZ(DEN(prod)) = 1;
+ return;
+ }
+
+ TMP_MARK;
+
+ alloc = MIN (op1_num_size, op2_den_size);
+ MPZ_TMP_INIT (gcd1, alloc);
+
+ alloc = MIN (op2_num_size, op1_den_size);
+ MPZ_TMP_INIT (gcd2, alloc);
+
+ alloc = MAX (op1_num_size, op2_den_size);
+ MPZ_TMP_INIT (tmp1, alloc);
+
+ alloc = MAX (op2_num_size, op1_den_size);
+ MPZ_TMP_INIT (tmp2, alloc);
+
+ /* PROD might be identical to either operand, so don't store the result there
+ until we are finished with the input operands. We can overwrite the
+ numerator of PROD when we are finished with the numerators of OP1 and
+ OP2. */
+
+ mpz_gcd (gcd1, NUM(op1), DEN(op2));
+ mpz_gcd (gcd2, NUM(op2), DEN(op1));
+
+ mpz_divexact_gcd (tmp1, NUM(op1), gcd1);
+ mpz_divexact_gcd (tmp2, NUM(op2), gcd2);
+
+ mpz_mul (NUM(prod), tmp1, tmp2);
+
+ mpz_divexact_gcd (tmp1, DEN(op2), gcd1);
+ mpz_divexact_gcd (tmp2, DEN(op1), gcd2);
+
+ mpz_mul (DEN(prod), tmp1, tmp2);
+
+ TMP_FREE;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpq/neg.c b/Build/source/libs/gmp/gmp-6.0.0/mpq/neg.c
new file mode 100644
index 00000000000..054e21ebe33
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpq/neg.c
@@ -0,0 +1,58 @@
+/* mpq_neg -- negate a rational.
+
+Copyright 2000, 2001, 2012 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_FORCE_mpq_neg 1
+
+#include "gmp.h"
+#include "gmp-impl.h"
+
+
+void
+mpq_neg (mpq_ptr dst, mpq_srcptr src)
+{
+ mp_size_t num_size = SIZ(NUM(src));
+
+ if (src != dst)
+ {
+ mp_size_t size;
+ mp_ptr dp;
+
+ size = ABS(num_size);
+ dp = MPZ_NEWALLOC (NUM(dst), size);
+ MPN_COPY (dp, PTR(NUM(src)), size);
+
+ size = SIZ(DEN(src));
+ dp = MPZ_NEWALLOC (DEN(dst), size);
+ SIZ(DEN(dst)) = size;
+ MPN_COPY (dp, PTR(DEN(src)), size);
+ }
+
+ SIZ(NUM(dst)) = -num_size;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpq/out_str.c b/Build/source/libs/gmp/gmp-6.0.0/mpq/out_str.c
new file mode 100644
index 00000000000..c2bc053b215
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpq/out_str.c
@@ -0,0 +1,54 @@
+/* mpq_out_str(stream,base,integer) */
+
+/*
+Copyright 2000, 2001 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.h"
+#include "gmp-impl.h"
+
+
+size_t
+mpq_out_str (FILE *stream, int base, mpq_srcptr q)
+{
+ size_t written;
+
+ if (stream == NULL)
+ stream = stdout;
+
+ written = mpz_out_str (stream, base, mpq_numref (q));
+
+ if (mpz_cmp_ui (mpq_denref (q), 1) != 0)
+ {
+ putc ('/', stream);
+ written += 1 + mpz_out_str (stream, base, mpq_denref (q));
+ }
+
+ return ferror (stream) ? 0 : written;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpq/set.c b/Build/source/libs/gmp/gmp-6.0.0/mpq/set.c
new file mode 100644
index 00000000000..fb7bfad49c6
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpq/set.c
@@ -0,0 +1,51 @@
+/* mpq_set(dest,src) -- Set DEST to SRC.
+
+Copyright 1991, 1994, 1995, 2001, 2012 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.h"
+#include "gmp-impl.h"
+
+void
+mpq_set (mpq_ptr dest, mpq_srcptr src)
+{
+ mp_size_t num_size, den_size;
+ mp_size_t abs_num_size;
+ mp_ptr dp;
+
+ num_size = SIZ(NUM(src));
+ abs_num_size = ABS (num_size);
+ dp = MPZ_NEWALLOC (NUM(dest), abs_num_size);
+ SIZ(NUM(dest)) = num_size;
+ MPN_COPY (dp, PTR(NUM(src)), abs_num_size);
+
+ den_size = SIZ(DEN(src));
+ dp = MPZ_NEWALLOC (DEN(dest), den_size);
+ SIZ(DEN(dest)) = den_size;
+ MPN_COPY (dp, PTR(DEN(src)), den_size);
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpq/set_d.c b/Build/source/libs/gmp/gmp-6.0.0/mpq/set_d.c
new file mode 100644
index 00000000000..308677db402
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpq/set_d.c
@@ -0,0 +1,166 @@
+/* mpq_set_d(mpq_t q, double d) -- Set q to d without rounding.
+
+Copyright 2000, 2002, 2003, 2012 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 "config.h"
+
+#if HAVE_FLOAT_H
+#include <float.h> /* for DBL_MAX */
+#endif
+
+#include "gmp.h"
+#include "gmp-impl.h"
+#include "longlong.h"
+
+#if LIMBS_PER_DOUBLE > 4
+ choke me
+#endif
+
+void
+mpq_set_d (mpq_ptr dest, double d)
+{
+ int negative;
+ mp_exp_t exp;
+ mp_limb_t tp[LIMBS_PER_DOUBLE];
+ mp_ptr np, dp;
+ mp_size_t nn, dn;
+ int c;
+
+ DOUBLE_NAN_INF_ACTION (d,
+ __gmp_invalid_operation (),
+ __gmp_invalid_operation ());
+
+ negative = d < 0;
+ d = ABS (d);
+
+ exp = __gmp_extract_double (tp, d);
+
+ /* There are two main version of the conversion. The `then' arm handles
+ numbers with a fractional part, while the `else' arm handles integers. */
+#if LIMBS_PER_DOUBLE == 4
+ if (exp <= 1 || (exp == 2 && (tp[0] | tp[1]) != 0))
+#endif
+#if LIMBS_PER_DOUBLE == 3
+ if (exp <= 1 || (exp == 2 && tp[0] != 0))
+#endif
+#if LIMBS_PER_DOUBLE == 2
+ if (exp <= 1)
+#endif
+ {
+ if (d == 0.0)
+ {
+ SIZ(NUM(dest)) = 0;
+ SIZ(DEN(dest)) = 1;
+ PTR(DEN(dest))[0] = 1;
+ return;
+ }
+
+ dn = -exp;
+ np = MPZ_NEWALLOC (NUM(dest), 3);
+#if LIMBS_PER_DOUBLE == 4
+ if ((tp[0] | tp[1] | tp[2]) == 0)
+ np[0] = tp[3], nn = 1;
+ else if ((tp[0] | tp[1]) == 0)
+ np[1] = tp[3], np[0] = tp[2], nn = 2;
+ else if (tp[0] == 0)
+ np[2] = tp[3], np[1] = tp[2], np[0] = tp[1], nn = 3;
+ else
+ np[3] = tp[3], np[2] = tp[2], np[1] = tp[1], np[0] = tp[0], nn = 4;
+#endif
+#if LIMBS_PER_DOUBLE == 3
+ if ((tp[0] | tp[1]) == 0)
+ np[0] = tp[2], nn = 1;
+ else if (tp[0] == 0)
+ np[1] = tp[2], np[0] = tp[1], nn = 2;
+ else
+ np[2] = tp[2], np[1] = tp[1], np[0] = tp[0], nn = 3;
+#endif
+#if LIMBS_PER_DOUBLE == 2
+ if (tp[0] == 0)
+ np[0] = tp[1], nn = 1;
+ else
+ np[1] = tp[1], np[0] = tp[0], nn = 2;
+#endif
+ dn += nn + 1;
+ ASSERT_ALWAYS (dn > 0);
+ dp = MPZ_NEWALLOC (DEN(dest), dn);
+ MPN_ZERO (dp, dn - 1);
+ dp[dn - 1] = 1;
+ count_trailing_zeros (c, np[0] | dp[0]);
+ if (c != 0)
+ {
+ mpn_rshift (np, np, nn, c);
+ nn -= np[nn - 1] == 0;
+ mpn_rshift (dp, dp, dn, c);
+ dn -= dp[dn - 1] == 0;
+ }
+ SIZ(DEN(dest)) = dn;
+ SIZ(NUM(dest)) = negative ? -nn : nn;
+ }
+ else
+ {
+ nn = exp;
+ np = MPZ_NEWALLOC (NUM(dest), nn);
+ switch (nn)
+ {
+ default:
+ MPN_ZERO (np, nn - LIMBS_PER_DOUBLE);
+ np += nn - LIMBS_PER_DOUBLE;
+ /* fall through */
+#if LIMBS_PER_DOUBLE == 2
+ case 2:
+ np[1] = tp[1], np[0] = tp[0];
+ break;
+#endif
+#if LIMBS_PER_DOUBLE == 3
+ case 3:
+ np[2] = tp[2], np[1] = tp[1], np[0] = tp[0];
+ break;
+ case 2:
+ np[1] = tp[2], np[0] = tp[1];
+ break;
+#endif
+#if LIMBS_PER_DOUBLE == 4
+ case 4:
+ np[3] = tp[3], np[2] = tp[2], np[1] = tp[1], np[0] = tp[0];
+ break;
+ case 3:
+ np[2] = tp[3], np[1] = tp[2], np[0] = tp[1];
+ break;
+ case 2:
+ np[1] = tp[3], np[0] = tp[2];
+ break;
+#endif
+ }
+ dp = PTR(DEN(dest));
+ dp[0] = 1;
+ SIZ(DEN(dest)) = 1;
+ SIZ(NUM(dest)) = negative ? -nn : nn;
+ }
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpq/set_den.c b/Build/source/libs/gmp/gmp-6.0.0/mpq/set_den.c
new file mode 100644
index 00000000000..4bcb86b0977
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpq/set_den.c
@@ -0,0 +1,45 @@
+/* mpq_set_den(dest,den) -- Set the denominator of DEST from DEN.
+
+Copyright 1991, 1994-1996, 2000, 2001, 2012 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.h"
+#include "gmp-impl.h"
+
+void
+mpq_set_den (mpq_ptr dest, mpz_srcptr den)
+{
+ mp_size_t size = SIZ (den);
+ mp_size_t abs_size = ABS (size);
+ mp_ptr dp;
+
+ dp = MPZ_NEWALLOC (DEN(dest), abs_size);
+
+ SIZ(DEN(dest)) = size;
+ MPN_COPY (dp, PTR(den), abs_size);
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpq/set_f.c b/Build/source/libs/gmp/gmp-6.0.0/mpq/set_f.c
new file mode 100644
index 00000000000..7764a17f05e
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpq/set_f.c
@@ -0,0 +1,107 @@
+/* mpq_set_f -- set an mpq from an mpf.
+
+Copyright 2000-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/. */
+
+#include "gmp.h"
+#include "gmp-impl.h"
+#include "longlong.h"
+
+
+void
+mpq_set_f (mpq_ptr q, mpf_srcptr f)
+{
+ mp_size_t fexp = EXP(f);
+ mp_ptr fptr = PTR(f);
+ mp_size_t fsize = SIZ(f);
+ mp_size_t abs_fsize = ABS(fsize);
+ mp_limb_t flow;
+
+ if (fsize == 0)
+ {
+ /* set q=0 */
+ SIZ(NUM(q)) = 0;
+ SIZ(DEN(q)) = 1;
+ PTR(DEN(q))[0] = 1;
+ return;
+ }
+
+ /* strip low zero limbs from f */
+ flow = *fptr;
+ MPN_STRIP_LOW_ZEROS_NOT_ZERO (fptr, abs_fsize, flow);
+
+ if (fexp >= abs_fsize)
+ {
+ /* radix point is to the right of the limbs, no denominator */
+ mp_ptr num_ptr;
+
+ num_ptr = MPZ_NEWALLOC (mpq_numref (q), fexp);
+ MPN_ZERO (num_ptr, fexp - abs_fsize);
+ MPN_COPY (num_ptr + fexp - abs_fsize, fptr, abs_fsize);
+
+ SIZ(NUM(q)) = fsize >= 0 ? fexp : -fexp;
+ SIZ(DEN(q)) = 1;
+ PTR(DEN(q))[0] = 1;
+ }
+ else
+ {
+ /* radix point is within or to the left of the limbs, use denominator */
+ mp_ptr num_ptr, den_ptr;
+ mp_size_t den_size;
+
+ den_size = abs_fsize - fexp;
+ num_ptr = MPZ_NEWALLOC (mpq_numref (q), abs_fsize);
+ den_ptr = MPZ_NEWALLOC (mpq_denref (q), den_size+1);
+
+ if (flow & 1)
+ {
+ /* no powers of two to strip from numerator */
+
+ MPN_COPY (num_ptr, fptr, abs_fsize);
+ MPN_ZERO (den_ptr, den_size);
+ den_ptr[den_size] = 1;
+ }
+ else
+ {
+ /* right shift numerator, adjust denominator accordingly */
+ int shift;
+
+ den_size--;
+ count_trailing_zeros (shift, flow);
+
+ mpn_rshift (num_ptr, fptr, abs_fsize, shift);
+ abs_fsize -= (num_ptr[abs_fsize-1] == 0);
+
+ MPN_ZERO (den_ptr, den_size);
+ den_ptr[den_size] = GMP_LIMB_HIGHBIT >> (shift-1);
+ }
+
+ SIZ(NUM(q)) = fsize >= 0 ? abs_fsize : -abs_fsize;
+ SIZ(DEN(q)) = den_size + 1;
+ }
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpq/set_num.c b/Build/source/libs/gmp/gmp-6.0.0/mpq/set_num.c
new file mode 100644
index 00000000000..c6b52ccaa18
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpq/set_num.c
@@ -0,0 +1,45 @@
+/* mpq_set_num(dest,num) -- Set the numerator of DEST from NUM.
+
+Copyright 1991, 1994, 1995, 2001, 2012 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.h"
+#include "gmp-impl.h"
+
+void
+mpq_set_num (mpq_ptr dest, mpz_srcptr num)
+{
+ mp_size_t size = SIZ (num);
+ mp_size_t abs_size = ABS (size);
+ mp_ptr dp;
+
+ dp = MPZ_NEWALLOC (NUM(dest), abs_size);
+
+ SIZ(NUM(dest)) = size;
+ MPN_COPY (dp, PTR(num), abs_size);
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpq/set_si.c b/Build/source/libs/gmp/gmp-6.0.0/mpq/set_si.c
new file mode 100644
index 00000000000..0a10b3048d1
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpq/set_si.c
@@ -0,0 +1,65 @@
+/* mpq_set_si(dest,ulong_num,ulong_den) -- Set DEST to the rational number
+ ULONG_NUM/ULONG_DEN.
+
+Copyright 1991, 1994, 1995, 2001, 2003 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.h"
+#include "gmp-impl.h"
+
+void
+mpq_set_si (mpq_t dest, signed long int num, unsigned long int den)
+{
+ unsigned long int abs_num;
+
+ if (GMP_NUMB_BITS < BITS_PER_ULONG)
+ {
+ if (num == 0) /* Canonicalize 0/d to 0/1. */
+ den = 1;
+ mpz_set_si (mpq_numref (dest), num);
+ mpz_set_ui (mpq_denref (dest), den);
+ return;
+ }
+
+ abs_num = ABS_CAST (unsigned long, num);
+
+ if (num == 0)
+ {
+ /* Canonicalize 0/d to 0/1. */
+ den = 1;
+ SIZ(NUM(dest)) = 0;
+ }
+ else
+ {
+ PTR(NUM(dest))[0] = abs_num;
+ SIZ(NUM(dest)) = num > 0 ? 1 : -1;
+ }
+
+ PTR(DEN(dest))[0] = den;
+ SIZ(DEN(dest)) = (den != 0);
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpq/set_str.c b/Build/source/libs/gmp/gmp-6.0.0/mpq/set_str.c
new file mode 100644
index 00000000000..930fe5576c0
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpq/set_str.c
@@ -0,0 +1,69 @@
+/* mpq_set_str -- string to mpq conversion.
+
+Copyright 2001, 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/. */
+
+#include <stdio.h>
+#include <string.h>
+#include "gmp.h"
+#include "gmp-impl.h"
+
+
+/* FIXME: Would like an mpz_set_mem (or similar) accepting a pointer and
+ length so we wouldn't have to copy the numerator just to null-terminate
+ it. */
+
+int
+mpq_set_str (mpq_ptr q, const char *str, int base)
+{
+ const char *slash;
+ char *num;
+ size_t numlen;
+ int ret;
+
+ slash = strchr (str, '/');
+ if (slash == NULL)
+ {
+ SIZ(DEN(q)) = 1;
+ PTR(DEN(q))[0] = 1;
+
+ return mpz_set_str (mpq_numref(q), str, base);
+ }
+
+ numlen = slash - str;
+ num = __GMP_ALLOCATE_FUNC_TYPE (numlen+1, char);
+ memcpy (num, str, numlen);
+ num[numlen] = '\0';
+ ret = mpz_set_str (mpq_numref(q), num, base);
+ (*__gmp_free_func) (num, numlen+1);
+
+ if (ret != 0)
+ return ret;
+
+ return mpz_set_str (mpq_denref(q), slash+1, base);
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpq/set_ui.c b/Build/source/libs/gmp/gmp-6.0.0/mpq/set_ui.c
new file mode 100644
index 00000000000..4473b30bb84
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpq/set_ui.c
@@ -0,0 +1,61 @@
+/* mpq_set_ui(dest,ulong_num,ulong_den) -- Set DEST to the rational number
+ ULONG_NUM/ULONG_DEN.
+
+Copyright 1991, 1994, 1995, 2001-2003 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.h"
+#include "gmp-impl.h"
+
+void
+mpq_set_ui (mpq_t dest, unsigned long int num, unsigned long int den)
+{
+ if (GMP_NUMB_BITS < BITS_PER_ULONG)
+ {
+ if (num == 0) /* Canonicalize 0/d to 0/1. */
+ den = 1;
+ mpz_set_ui (mpq_numref (dest), num);
+ mpz_set_ui (mpq_denref (dest), den);
+ return;
+ }
+
+ if (num == 0)
+ {
+ /* Canonicalize 0/n to 0/1. */
+ den = 1;
+ SIZ(NUM(dest)) = 0;
+ }
+ else
+ {
+ PTR(NUM(dest))[0] = num;
+ SIZ(NUM(dest)) = 1;
+ }
+
+ PTR(DEN(dest))[0] = den;
+ SIZ(DEN(dest)) = (den != 0);
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpq/set_z.c b/Build/source/libs/gmp/gmp-6.0.0/mpq/set_z.c
new file mode 100644
index 00000000000..358d1ca899c
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpq/set_z.c
@@ -0,0 +1,49 @@
+/* mpq_set_z (dest,src) -- Set DEST to SRC.
+
+Copyright 1996, 2001, 2012 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.h"
+#include "gmp-impl.h"
+
+void
+mpq_set_z (mpq_ptr dest, mpz_srcptr src)
+{
+ mp_size_t num_size;
+ mp_size_t abs_num_size;
+ mp_ptr dp;
+
+ num_size = SIZ (src);
+ abs_num_size = ABS (num_size);
+ dp = MPZ_NEWALLOC (NUM(dest), abs_num_size);
+ SIZ(NUM(dest)) = num_size;
+ MPN_COPY (dp, PTR(src), abs_num_size);
+
+ PTR(DEN(dest))[0] = 1;
+ SIZ(DEN(dest)) = 1;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpq/swap.c b/Build/source/libs/gmp/gmp-6.0.0/mpq/swap.c
new file mode 100644
index 00000000000..51fdcac7fd3
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpq/swap.c
@@ -0,0 +1,71 @@
+/* mpq_swap (U, V) -- Swap U and V.
+
+Copyright 1997, 1998, 2000, 2001 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.h"
+#include "gmp-impl.h"
+
+void
+mpq_swap (mpq_ptr u, mpq_ptr v) __GMP_NOTHROW
+{
+ mp_ptr up, vp;
+ mp_size_t usize, vsize;
+ mp_size_t ualloc, valloc;
+
+ ualloc = ALLOC(NUM(u));
+ valloc = ALLOC(NUM(v));
+ ALLOC(NUM(v)) = ualloc;
+ ALLOC(NUM(u)) = valloc;
+
+ usize = SIZ(NUM(u));
+ vsize = SIZ(NUM(v));
+ SIZ(NUM(v)) = usize;
+ SIZ(NUM(u)) = vsize;
+
+ up = PTR(NUM(u));
+ vp = PTR(NUM(v));
+ PTR(NUM(v)) = up;
+ PTR(NUM(u)) = vp;
+
+
+ ualloc = ALLOC(DEN(u));
+ valloc = ALLOC(DEN(v));
+ ALLOC(DEN(v)) = ualloc;
+ ALLOC(DEN(u)) = valloc;
+
+ usize = SIZ(DEN(u));
+ vsize = SIZ(DEN(v));
+ SIZ(DEN(v)) = usize;
+ SIZ(DEN(u)) = vsize;
+
+ up = PTR(DEN(u));
+ vp = PTR(DEN(v));
+ PTR(DEN(v)) = up;
+ PTR(DEN(u)) = vp;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpz/2fac_ui.c b/Build/source/libs/gmp/gmp-6.0.0/mpz/2fac_ui.c
new file mode 100644
index 00000000000..37e6c468bc8
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpz/2fac_ui.c
@@ -0,0 +1,100 @@
+/* mpz_2fac_ui(RESULT, N) -- Set RESULT to N!!.
+
+Contributed to the GNU project by Marco Bodrato.
+
+Copyright 2012 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.h"
+#include "gmp-impl.h"
+
+#define FACTOR_LIST_STORE(P, PR, MAX_PR, VEC, I) \
+ do { \
+ if ((PR) > (MAX_PR)) { \
+ (VEC)[(I)++] = (PR); \
+ (PR) = (P); \
+ } else \
+ (PR) *= (P); \
+ } while (0)
+
+#define FAC_2DSC_THRESHOLD ((FAC_DSC_THRESHOLD << 1) | (FAC_DSC_THRESHOLD & 1))
+#define FACTORS_PER_LIMB (GMP_NUMB_BITS / (LOG2C(FAC_2DSC_THRESHOLD-1)+1))
+
+/* Computes n!!, the 2-multi-factorial of n. (aka double-factorial or semi-factorial)
+ WARNING: it assumes that n fits in a limb!
+ */
+void
+mpz_2fac_ui (mpz_ptr x, unsigned long n)
+{
+ ASSERT (n <= GMP_NUMB_MAX);
+
+ if ((n & 1) == 0) { /* n is even, n = 2k, (2k)!! = k! 2^k */
+ mp_limb_t count;
+
+ if ((n <= TABLE_LIMIT_2N_MINUS_POPC_2N) & (n != 0))
+ count = __gmp_fac2cnt_table[n / 2 - 1];
+ else
+ {
+ popc_limb (count, n); /* popc(n) == popc(k) */
+ count = n - count; /* n - popc(n) == k + k - popc(k) */
+ }
+ mpz_oddfac_1 (x, n >> 1, 0);
+ mpz_mul_2exp (x, x, count);
+ } else { /* n is odd */
+ if (n <= ODD_DOUBLEFACTORIAL_TABLE_LIMIT) {
+ PTR (x)[0] = __gmp_odd2fac_table[n >> 1];
+ SIZ (x) = 1;
+ } else if (BELOW_THRESHOLD (n, FAC_2DSC_THRESHOLD)) { /* odd basecase, */
+ mp_limb_t *factors, prod, max_prod, j;
+ TMP_SDECL;
+
+ /* FIXME: we might alloc a fixed amount 1+FAC_2DSC_THRESHOLD/FACTORS_PER_LIMB */
+ TMP_SMARK;
+ factors = TMP_SALLOC_LIMBS (1 + n / (2 * FACTORS_PER_LIMB));
+
+ factors[0] = ODD_DOUBLEFACTORIAL_TABLE_MAX;
+ j = 1;
+ prod = n;
+
+ max_prod = GMP_NUMB_MAX / FAC_2DSC_THRESHOLD;
+ while ((n -= 2) > ODD_DOUBLEFACTORIAL_TABLE_LIMIT)
+ FACTOR_LIST_STORE (n, prod, max_prod, factors, j);
+
+ factors[j++] = prod;
+ mpz_prodlimbs (x, factors, j);
+
+ TMP_SFREE;
+ } else { /* for the asymptotically fast odd case, let oddfac do the job. */
+ mpz_oddfac_1 (x, n, 1);
+ }
+ }
+}
+
+#undef FACTORS_PER_LIMB
+#undef FACTOR_LIST_STORE
+#undef FAC_2DSC_THRESHOLD
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpz/Makefile.am b/Build/source/libs/gmp/gmp-6.0.0/mpz/Makefile.am
new file mode 100644
index 00000000000..1aac41b992a
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpz/Makefile.am
@@ -0,0 +1,67 @@
+## Process this file with automake to generate Makefile.in
+
+# Copyright 1996, 1998-2003, 2012 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/.
+
+
+INCLUDES = -D__GMP_WITHIN_GMP -I$(top_srcdir)
+
+noinst_LTLIBRARIES = libmpz.la
+libmpz_la_SOURCES = aors.h aors_ui.h fits_s.h mul_i.h \
+ 2fac_ui.c \
+ add.c add_ui.c abs.c aorsmul.c aorsmul_i.c and.c array_init.c \
+ bin_ui.c bin_uiui.c cdiv_q.c \
+ cdiv_q_ui.c cdiv_qr.c cdiv_qr_ui.c cdiv_r.c cdiv_r_ui.c cdiv_ui.c \
+ cfdiv_q_2exp.c cfdiv_r_2exp.c \
+ clear.c clears.c clrbit.c \
+ cmp.c cmp_d.c cmp_si.c cmp_ui.c cmpabs.c cmpabs_d.c cmpabs_ui.c \
+ com.c combit.c \
+ cong.c cong_2exp.c cong_ui.c \
+ divexact.c divegcd.c dive_ui.c divis.c divis_ui.c divis_2exp.c \
+ dump.c export.c fac_ui.c fdiv_q.c fdiv_q_ui.c \
+ fdiv_qr.c fdiv_qr_ui.c fdiv_r.c fdiv_r_ui.c fdiv_ui.c \
+ fib_ui.c fib2_ui.c \
+ fits_sint.c fits_slong.c fits_sshort.c \
+ fits_uint.c fits_ulong.c fits_ushort.c \
+ gcd.c gcd_ui.c gcdext.c get_d.c get_d_2exp.c get_si.c \
+ get_str.c get_ui.c getlimbn.c hamdist.c \
+ import.c init.c init2.c inits.c inp_raw.c inp_str.c \
+ invert.c ior.c iset.c iset_d.c iset_si.c iset_str.c iset_ui.c \
+ jacobi.c kronsz.c kronuz.c kronzs.c kronzu.c \
+ lcm.c lcm_ui.c limbs_read.c limbs_write.c limbs_modify.c limbs_finish.c \
+ lucnum_ui.c lucnum2_ui.c mfac_uiui.c millerrabin.c \
+ mod.c mul.c mul_2exp.c mul_si.c mul_ui.c n_pow_ui.c neg.c nextprime.c \
+ oddfac_1.c \
+ out_raw.c out_str.c perfpow.c perfsqr.c popcount.c pow_ui.c powm.c \
+ powm_sec.c powm_ui.c pprime_p.c prodlimbs.c primorial_ui.c random.c random2.c \
+ realloc.c realloc2.c remove.c roinit_n.c root.c rootrem.c rrandomb.c \
+ scan0.c scan1.c set.c set_d.c set_f.c set_q.c set_si.c set_str.c \
+ set_ui.c setbit.c size.c sizeinbase.c sqrt.c sqrtrem.c sub.c sub_ui.c \
+ swap.c tdiv_ui.c tdiv_q.c tdiv_q_2exp.c tdiv_q_ui.c tdiv_qr.c \
+ tdiv_qr_ui.c tdiv_r.c tdiv_r_2exp.c tdiv_r_ui.c tstbit.c ui_pow_ui.c \
+ ui_sub.c urandomb.c urandomm.c xor.c
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpz/abs.c b/Build/source/libs/gmp/gmp-6.0.0/mpz/abs.c
new file mode 100644
index 00000000000..81c6b632668
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpz/abs.c
@@ -0,0 +1,55 @@
+/* mpz_abs(dst, src) -- Assign the absolute value of SRC to DST.
+
+Copyright 1991, 1993-1995, 2001, 2012 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_FORCE_mpz_abs 1
+
+#include "gmp.h"
+#include "gmp-impl.h"
+
+void
+mpz_abs (mpz_ptr w, mpz_srcptr u)
+{
+ mp_ptr wp;
+ mp_srcptr up;
+ mp_size_t size;
+
+ size = ABSIZ (u);
+
+ if (u != w)
+ {
+ wp = MPZ_NEWALLOC (w, size);
+
+ up = PTR (u);
+
+ MPN_COPY (wp, up, size);
+ }
+
+ SIZ (w) = size;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpz/add.c b/Build/source/libs/gmp/gmp-6.0.0/mpz/add.c
new file mode 100644
index 00000000000..f1f0ae8e160
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpz/add.c
@@ -0,0 +1,33 @@
+/* mpz_add -- add integers.
+
+Copyright 2001 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 OPERATION_add
+#include "aors.h"
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpz/add_ui.c b/Build/source/libs/gmp/gmp-6.0.0/mpz/add_ui.c
new file mode 100644
index 00000000000..8fd15ad6111
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpz/add_ui.c
@@ -0,0 +1,33 @@
+/* mpz_add_ui -- Add an mpz_t and an unsigned one-word integer.
+
+Copyright 2001 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 OPERATION_add_ui
+#include "aors_ui.h"
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpz/and.c b/Build/source/libs/gmp/gmp-6.0.0/mpz/and.c
new file mode 100644
index 00000000000..5aa01a71da1
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpz/and.c
@@ -0,0 +1,244 @@
+/* mpz_and -- Logical and.
+
+Copyright 1991, 1993, 1994, 1996, 1997, 2000, 2001, 2003, 2005, 2012 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.h"
+#include "gmp-impl.h"
+
+void
+mpz_and (mpz_ptr res, mpz_srcptr op1, mpz_srcptr op2)
+{
+ mp_srcptr op1_ptr, op2_ptr;
+ mp_size_t op1_size, op2_size;
+ mp_ptr res_ptr;
+ mp_size_t res_size;
+ mp_size_t i;
+ TMP_DECL;
+
+ TMP_MARK;
+ op1_size = SIZ(op1);
+ op2_size = SIZ(op2);
+
+ op1_ptr = PTR(op1);
+ op2_ptr = PTR(op2);
+
+ if (op1_size >= 0)
+ {
+ if (op2_size >= 0)
+ {
+ res_size = MIN (op1_size, op2_size);
+ /* First loop finds the size of the result. */
+ for (i = res_size - 1; i >= 0; i--)
+ if ((op1_ptr[i] & op2_ptr[i]) != 0)
+ break;
+ res_size = i + 1;
+
+ /* Handle allocation, now then we know exactly how much space is
+ needed for the result. */
+ res_ptr = MPZ_REALLOC (res, res_size);
+ /* Don't re-read op1_ptr and op2_ptr. Since res_size <=
+ MIN(op1_size, op2_size), res is not changed when op1
+ is identical to res or op2 is identical to res. */
+
+ SIZ(res) = res_size;
+ if (LIKELY (res_size != 0))
+ mpn_and_n (res_ptr, op1_ptr, op2_ptr, res_size);
+ return;
+ }
+ else /* op2_size < 0 */
+ {
+ /* Fall through to the code at the end of the function. */
+ }
+ }
+ else
+ {
+ if (op2_size < 0)
+ {
+ mp_ptr opx, opy;
+ mp_limb_t cy;
+
+ /* Both operands are negative, so will be the result.
+ -((-OP1) & (-OP2)) = -(~(OP1 - 1) & ~(OP2 - 1)) =
+ = ~(~(OP1 - 1) & ~(OP2 - 1)) + 1 =
+ = ((OP1 - 1) | (OP2 - 1)) + 1 */
+
+ /* It might seem as we could end up with an (invalid) result with
+ a leading zero-limb here when one of the operands is of the
+ type 1,,0,,..,,.0. But some analysis shows that we surely
+ would get carry into the zero-limb in this situation... */
+
+ op1_size = -op1_size;
+ op2_size = -op2_size;
+
+ if (op1_size > op2_size)
+ MPN_SRCPTR_SWAP (op1_ptr, op1_size, op2_ptr, op2_size);
+
+ TMP_ALLOC_LIMBS_2 (opx, op1_size, opy, op2_size);
+ mpn_sub_1 (opx, op1_ptr, op1_size, (mp_limb_t) 1);
+ op1_ptr = opx;
+
+ mpn_sub_1 (opy, op2_ptr, op2_size, (mp_limb_t) 1);
+ op2_ptr = opy;
+
+ res_ptr = MPZ_REALLOC (res, 1 + op2_size);
+ /* Don't re-read OP1_PTR and OP2_PTR. They point to temporary
+ space--never to the space PTR(res) used to point to before
+ reallocation. */
+
+ MPN_COPY (res_ptr + op1_size, op2_ptr + op1_size,
+ op2_size - op1_size);
+ mpn_ior_n (res_ptr, op1_ptr, op2_ptr, op1_size);
+ res_size = op2_size;
+
+ cy = mpn_add_1 (res_ptr, res_ptr, res_size, (mp_limb_t) 1);
+ res_ptr[res_size] = cy;
+ res_size += (cy != 0);
+
+ SIZ(res) = -res_size;
+ TMP_FREE;
+ return;
+ }
+ else
+ {
+ /* We should compute -OP1 & OP2. Swap OP1 and OP2 and fall
+ through to the code that handles OP1 & -OP2. */
+ MPN_SRCPTR_SWAP (op1_ptr, op1_size, op2_ptr, op2_size);
+ }
+
+ }
+
+ {
+#if ANDNEW
+ mp_size_t op2_lim;
+ mp_size_t count;
+
+ /* OP2 must be negated as with infinite precision.
+
+ Scan from the low end for a non-zero limb. The first non-zero
+ limb is simply negated (two's complement). Any subsequent
+ limbs are one's complemented. Of course, we don't need to
+ handle more limbs than there are limbs in the other, positive
+ operand as the result for those limbs is going to become zero
+ anyway. */
+
+ /* Scan for the least significant non-zero OP2 limb, and zero the
+ result meanwhile for those limb positions. (We will surely
+ find a non-zero limb, so we can write the loop with one
+ termination condition only.) */
+ for (i = 0; op2_ptr[i] == 0; i++)
+ res_ptr[i] = 0;
+ op2_lim = i;
+
+ op2_size = -op2_size;
+
+ if (op1_size <= op2_size)
+ {
+ /* The ones-extended OP2 is >= than the zero-extended OP1.
+ RES_SIZE <= OP1_SIZE. Find the exact size. */
+ for (i = op1_size - 1; i > op2_lim; i--)
+ if ((op1_ptr[i] & ~op2_ptr[i]) != 0)
+ break;
+ res_size = i + 1;
+ for (i = res_size - 1; i > op2_lim; i--)
+ res_ptr[i] = op1_ptr[i] & ~op2_ptr[i];
+ res_ptr[op2_lim] = op1_ptr[op2_lim] & -op2_ptr[op2_lim];
+ /* Yes, this *can* happen! */
+ MPN_NORMALIZE (res_ptr, res_size);
+ }
+ else
+ {
+ /* The ones-extended OP2 is < than the zero-extended OP1.
+ RES_SIZE == OP1_SIZE, since OP1 is normalized. */
+ res_size = op1_size;
+ MPN_COPY (res_ptr + op2_size, op1_ptr + op2_size, op1_size - op2_size);
+ for (i = op2_size - 1; i > op2_lim; i--)
+ res_ptr[i] = op1_ptr[i] & ~op2_ptr[i];
+ res_ptr[op2_lim] = op1_ptr[op2_lim] & -op2_ptr[op2_lim];
+ }
+
+ SIZ(res) = res_size;
+#else
+
+ /* OP1 is positive and zero-extended,
+ OP2 is negative and ones-extended.
+ The result will be positive.
+ OP1 & -OP2 = OP1 & ~(OP2 - 1). */
+
+ mp_ptr opx;
+
+ op2_size = -op2_size;
+ opx = TMP_ALLOC_LIMBS (op2_size);
+ mpn_sub_1 (opx, op2_ptr, op2_size, (mp_limb_t) 1);
+ op2_ptr = opx;
+
+ if (op1_size > op2_size)
+ {
+ /* The result has the same size as OP1, since OP1 is normalized
+ and longer than the ones-extended OP2. */
+ res_size = op1_size;
+
+ /* Handle allocation, now then we know exactly how much space is
+ needed for the result. */
+ res_ptr = MPZ_REALLOC (res, res_size);
+ /* Don't re-read OP1_PTR or OP2_PTR. Since res_size = op1_size,
+ op1 is not changed if it is identical to res.
+ OP2_PTR points to temporary space. */
+
+ MPN_COPY (res_ptr + op2_size, op1_ptr + op2_size, res_size - op2_size);
+ mpn_andn_n (res_ptr, op1_ptr, op2_ptr, op2_size);
+
+ SIZ(res) = res_size;
+ }
+ else
+ {
+ /* Find out the exact result size. Ignore the high limbs of OP2,
+ OP1 is zero-extended and would make the result zero. */
+ for (i = op1_size - 1; i >= 0; i--)
+ if ((op1_ptr[i] & ~op2_ptr[i]) != 0)
+ break;
+ res_size = i + 1;
+
+ /* Handle allocation, now then we know exactly how much space is
+ needed for the result. */
+ res_ptr = MPZ_REALLOC (res, res_size);
+ /* Don't re-read OP1_PTR. Since res_size <= op1_size,
+ op1 is not changed if it is identical to res.
+ Don't re-read OP2_PTR. It points to temporary space--never
+ to the space PTR(res) used to point to before reallocation. */
+
+ if (LIKELY (res_size != 0))
+ mpn_andn_n (res_ptr, op1_ptr, op2_ptr, res_size);
+
+ SIZ(res) = res_size;
+ }
+#endif
+ }
+ TMP_FREE;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpz/aors.h b/Build/source/libs/gmp/gmp-6.0.0/mpz/aors.h
new file mode 100644
index 00000000000..4d22754b23b
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpz/aors.h
@@ -0,0 +1,124 @@
+/* mpz_add, mpz_sub -- add or subtract integers.
+
+Copyright 1991, 1993, 1994, 1996, 2000, 2001, 2011, 2012 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.h"
+#include "gmp-impl.h"
+
+
+#ifdef OPERATION_add
+#define FUNCTION mpz_add
+#define VARIATION
+#endif
+#ifdef OPERATION_sub
+#define FUNCTION mpz_sub
+#define VARIATION -
+#endif
+
+#ifndef FUNCTION
+Error, need OPERATION_add or OPERATION_sub
+#endif
+
+
+void
+FUNCTION (mpz_ptr w, mpz_srcptr u, mpz_srcptr v)
+{
+ mp_srcptr up, vp;
+ mp_ptr wp;
+ mp_size_t usize, vsize, wsize;
+ mp_size_t abs_usize;
+ mp_size_t abs_vsize;
+
+ usize = SIZ(u);
+ vsize = VARIATION SIZ(v);
+ abs_usize = ABS (usize);
+ abs_vsize = ABS (vsize);
+
+ if (abs_usize < abs_vsize)
+ {
+ /* Swap U and V. */
+ MPZ_SRCPTR_SWAP (u, v);
+ MP_SIZE_T_SWAP (usize, vsize);
+ MP_SIZE_T_SWAP (abs_usize, abs_vsize);
+ }
+
+ /* True: ABS_USIZE >= ABS_VSIZE. */
+
+ /* If not space for w (and possible carry), increase space. */
+ wsize = abs_usize + 1;
+ wp = MPZ_REALLOC (w, wsize);
+
+ /* These must be after realloc (u or v may be the same as w). */
+ up = PTR(u);
+ vp = PTR(v);
+
+ if ((usize ^ vsize) < 0)
+ {
+ /* U and V have different sign. Need to compare them to determine
+ which operand to subtract from which. */
+
+ /* This test is right since ABS_USIZE >= ABS_VSIZE. */
+ if (abs_usize != abs_vsize)
+ {
+ mpn_sub (wp, up, abs_usize, vp, abs_vsize);
+ wsize = abs_usize;
+ MPN_NORMALIZE (wp, wsize);
+ if (usize < 0)
+ wsize = -wsize;
+ }
+ else if (mpn_cmp (up, vp, abs_usize) < 0)
+ {
+ mpn_sub_n (wp, vp, up, abs_usize);
+ wsize = abs_usize;
+ MPN_NORMALIZE (wp, wsize);
+ if (usize >= 0)
+ wsize = -wsize;
+ }
+ else
+ {
+ mpn_sub_n (wp, up, vp, abs_usize);
+ wsize = abs_usize;
+ MPN_NORMALIZE (wp, wsize);
+ if (usize < 0)
+ wsize = -wsize;
+ }
+ }
+ else
+ {
+ /* U and V have same sign. Add them. */
+ mp_limb_t cy_limb = mpn_add (wp, up, abs_usize, vp, abs_vsize);
+ wp[abs_usize] = cy_limb;
+ wsize = abs_usize + cy_limb;
+ if (usize < 0)
+ wsize = -wsize;
+ }
+
+ SIZ(w) = wsize;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpz/aors_ui.h b/Build/source/libs/gmp/gmp-6.0.0/mpz/aors_ui.h
new file mode 100644
index 00000000000..2e3c481ab70
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpz/aors_ui.h
@@ -0,0 +1,121 @@
+/* mpz_add_ui, mpz_sub_ui -- Add or subtract an mpz_t and an unsigned
+ one-word integer.
+
+Copyright 1991, 1993, 1994, 1996, 1999-2002, 2004, 2012, 2013 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.h"
+#include "gmp-impl.h"
+
+
+#ifdef OPERATION_add_ui
+#define FUNCTION mpz_add_ui
+#define FUNCTION2 mpz_add
+#define VARIATION_CMP >=
+#define VARIATION_NEG
+#define VARIATION_UNNEG -
+#endif
+
+#ifdef OPERATION_sub_ui
+#define FUNCTION mpz_sub_ui
+#define FUNCTION2 mpz_sub
+#define VARIATION_CMP <
+#define VARIATION_NEG -
+#define VARIATION_UNNEG
+#endif
+
+#ifndef FUNCTION
+Error, need OPERATION_add_ui or OPERATION_sub_ui
+#endif
+
+
+void
+FUNCTION (mpz_ptr w, mpz_srcptr u, unsigned long int vval)
+{
+ mp_srcptr up;
+ mp_ptr wp;
+ mp_size_t usize, wsize;
+ mp_size_t abs_usize;
+
+#if BITS_PER_ULONG > GMP_NUMB_BITS /* avoid warnings about shift amount */
+ if (vval > GMP_NUMB_MAX)
+ {
+ mpz_t v;
+ mp_limb_t vl[2];
+ PTR(v) = vl;
+ vl[0] = vval & GMP_NUMB_MASK;
+ vl[1] = vval >> GMP_NUMB_BITS;
+ SIZ(v) = 2;
+ FUNCTION2 (w, u, v);
+ return;
+ }
+#endif
+
+ usize = SIZ (u);
+ if (usize == 0)
+ {
+ PTR (w)[0] = vval;
+ SIZ (w) = VARIATION_NEG (vval != 0);
+ return;
+ }
+
+ abs_usize = ABS (usize);
+
+ /* If not space for W (and possible carry), increase space. */
+ wp = MPZ_REALLOC (w, abs_usize + 1);
+
+ /* These must be after realloc (U may be the same as W). */
+ up = PTR (u);
+
+ if (usize VARIATION_CMP 0)
+ {
+ mp_limb_t cy;
+ cy = mpn_add_1 (wp, up, abs_usize, (mp_limb_t) vval);
+ wp[abs_usize] = cy;
+ wsize = VARIATION_NEG (abs_usize + cy);
+ }
+ else
+ {
+ /* The signs are different. Need exact comparison to determine
+ which operand to subtract from which. */
+ if (abs_usize == 1 && up[0] < vval)
+ {
+ wp[0] = vval - up[0];
+ wsize = VARIATION_NEG 1;
+ }
+ else
+ {
+ mpn_sub_1 (wp, up, abs_usize, (mp_limb_t) vval);
+ /* Size can decrease with at most one limb. */
+ wsize = VARIATION_UNNEG (abs_usize - (wp[abs_usize - 1] == 0));
+ }
+ }
+
+ SIZ (w) = wsize;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpz/aorsmul.c b/Build/source/libs/gmp/gmp-6.0.0/mpz/aorsmul.c
new file mode 100644
index 00000000000..bf012c965ce
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpz/aorsmul.c
@@ -0,0 +1,164 @@
+/* mpz_addmul, mpz_submul -- add or subtract multiple.
+
+Copyright 2001, 2004, 2005, 2012 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.h"
+#include "gmp-impl.h"
+
+
+/* expecting x and y both with non-zero high limbs */
+#define mpn_cmp_twosizes_lt(xp,xsize, yp,ysize) \
+ ((xsize) < (ysize) \
+ || ((xsize) == (ysize) && mpn_cmp (xp, yp, xsize) < 0))
+
+
+/* sub>=0 means an addmul w += x*y, sub<0 means a submul w -= x*y.
+
+ The signs of w, x and y are fully accounted for by each flipping "sub".
+
+ The sign of w is retained for the result, unless the absolute value
+ submul underflows, in which case it flips. */
+
+static void __gmpz_aorsmul (REGPARM_3_1 (mpz_ptr w, mpz_srcptr x, mpz_srcptr y, mp_size_t sub)) REGPARM_ATTR (1);
+#define mpz_aorsmul(w,x,y,sub) __gmpz_aorsmul (REGPARM_3_1 (w, x, y, sub))
+
+REGPARM_ATTR (1) static void
+mpz_aorsmul (mpz_ptr w, mpz_srcptr x, mpz_srcptr y, mp_size_t sub)
+{
+ mp_size_t xsize, ysize, tsize, wsize, wsize_signed;
+ mp_ptr wp, tp;
+ mp_limb_t c, high;
+ TMP_DECL;
+
+ /* w unaffected if x==0 or y==0 */
+ xsize = SIZ(x);
+ ysize = SIZ(y);
+ if (xsize == 0 || ysize == 0)
+ return;
+
+ /* make x the bigger of the two */
+ if (ABS(ysize) > ABS(xsize))
+ {
+ MPZ_SRCPTR_SWAP (x, y);
+ MP_SIZE_T_SWAP (xsize, ysize);
+ }
+
+ sub ^= ysize;
+ ysize = ABS(ysize);
+
+ /* use mpn_addmul_1/mpn_submul_1 if possible */
+ if (ysize == 1)
+ {
+ mpz_aorsmul_1 (w, x, PTR(y)[0], sub);
+ return;
+ }
+
+ sub ^= xsize;
+ xsize = ABS(xsize);
+
+ wsize_signed = SIZ(w);
+ sub ^= wsize_signed;
+ wsize = ABS(wsize_signed);
+
+ tsize = xsize + ysize;
+ wp = MPZ_REALLOC (w, MAX (wsize, tsize) + 1);
+
+ if (wsize_signed == 0)
+ {
+ /* Nothing to add to, just set w=x*y. No w==x or w==y overlap here,
+ since we know x,y!=0 but w==0. */
+ high = mpn_mul (wp, PTR(x),xsize, PTR(y),ysize);
+ tsize -= (high == 0);
+ SIZ(w) = (sub >= 0 ? tsize : -tsize);
+ return;
+ }
+
+ TMP_MARK;
+ tp = TMP_ALLOC_LIMBS (tsize);
+
+ high = mpn_mul (tp, PTR(x),xsize, PTR(y),ysize);
+ tsize -= (high == 0);
+ ASSERT (tp[tsize-1] != 0);
+ if (sub >= 0)
+ {
+ mp_srcptr up = wp;
+ mp_size_t usize = wsize;
+
+ if (usize < tsize)
+ {
+ up = tp;
+ usize = tsize;
+ tp = wp;
+ tsize = wsize;
+
+ wsize = usize;
+ }
+
+ c = mpn_add (wp, up,usize, tp,tsize);
+ wp[wsize] = c;
+ wsize += (c != 0);
+ }
+ else
+ {
+ mp_srcptr up = wp;
+ mp_size_t usize = wsize;
+
+ if (mpn_cmp_twosizes_lt (up,usize, tp,tsize))
+ {
+ up = tp;
+ usize = tsize;
+ tp = wp;
+ tsize = wsize;
+
+ wsize = usize;
+ wsize_signed = -wsize_signed;
+ }
+
+ ASSERT_NOCARRY (mpn_sub (wp, up,usize, tp,tsize));
+ wsize = usize;
+ MPN_NORMALIZE (wp, wsize);
+ }
+
+ SIZ(w) = (wsize_signed >= 0 ? wsize : -wsize);
+
+ TMP_FREE;
+}
+
+
+void
+mpz_addmul (mpz_ptr w, mpz_srcptr u, mpz_srcptr v)
+{
+ mpz_aorsmul (w, u, v, (mp_size_t) 0);
+}
+
+void
+mpz_submul (mpz_ptr w, mpz_srcptr u, mpz_srcptr v)
+{
+ mpz_aorsmul (w, u, v, (mp_size_t) -1);
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpz/aorsmul_i.c b/Build/source/libs/gmp/gmp-6.0.0/mpz/aorsmul_i.c
new file mode 100644
index 00000000000..eafd5f36de9
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpz/aorsmul_i.c
@@ -0,0 +1,255 @@
+/* mpz_addmul_ui, mpz_submul_ui - add or subtract small multiple.
+
+ THE mpz_aorsmul_1 FUNCTION IN THIS FILE IS FOR INTERNAL USE ONLY AND IS
+ ALMOST CERTAIN TO BE SUBJECT TO INCOMPATIBLE CHANGES OR DISAPPEAR
+ COMPLETELY IN FUTURE GNU MP RELEASES.
+
+Copyright 2001, 2002, 2004, 2005, 2012 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.h"
+#include "gmp-impl.h"
+
+
+#if HAVE_NATIVE_mpn_mul_1c
+#define MPN_MUL_1C(cout, dst, src, size, n, cin) \
+ do { \
+ (cout) = mpn_mul_1c (dst, src, size, n, cin); \
+ } while (0)
+#else
+#define MPN_MUL_1C(cout, dst, src, size, n, cin) \
+ do { \
+ mp_limb_t __cy; \
+ __cy = mpn_mul_1 (dst, src, size, n); \
+ (cout) = __cy + mpn_add_1 (dst, dst, size, cin); \
+ } while (0)
+#endif
+
+
+/* sub>=0 means an addmul w += x*y, sub<0 means a submul w -= x*y.
+
+ All that's needed to account for negative w or x is to flip "sub".
+
+ The final w will retain its sign, unless an underflow occurs in a submul
+ of absolute values, in which case it's flipped.
+
+ If x has more limbs than w, then mpn_submul_1 followed by mpn_com is
+ used. The alternative would be mpn_mul_1 into temporary space followed
+ by mpn_sub_n. Avoiding temporary space seem good, and submul+com stands
+ a chance of being faster since it involves only one set of carry
+ propagations, not two. Note that doing an addmul_1 with a
+ twos-complement negative y doesn't work, because it effectively adds an
+ extra x * 2^GMP_LIMB_BITS. */
+
+REGPARM_ATTR(1) void
+mpz_aorsmul_1 (mpz_ptr w, mpz_srcptr x, mp_limb_t y, mp_size_t sub)
+{
+ mp_size_t xsize, wsize, wsize_signed, new_wsize, min_size, dsize;
+ mp_srcptr xp;
+ mp_ptr wp;
+ mp_limb_t cy;
+
+ /* w unaffected if x==0 or y==0 */
+ xsize = SIZ (x);
+ if (xsize == 0 || y == 0)
+ return;
+
+ sub ^= xsize;
+ xsize = ABS (xsize);
+
+ wsize_signed = SIZ (w);
+ if (wsize_signed == 0)
+ {
+ /* nothing to add to, just set x*y, "sub" gives the sign */
+ wp = MPZ_REALLOC (w, xsize+1);
+ cy = mpn_mul_1 (wp, PTR(x), xsize, y);
+ wp[xsize] = cy;
+ xsize += (cy != 0);
+ SIZ (w) = (sub >= 0 ? xsize : -xsize);
+ return;
+ }
+
+ sub ^= wsize_signed;
+ wsize = ABS (wsize_signed);
+
+ new_wsize = MAX (wsize, xsize);
+ wp = MPZ_REALLOC (w, new_wsize+1);
+ xp = PTR (x);
+ min_size = MIN (wsize, xsize);
+
+ if (sub >= 0)
+ {
+ /* addmul of absolute values */
+
+ cy = mpn_addmul_1 (wp, xp, min_size, y);
+ wp += min_size;
+ xp += min_size;
+
+ dsize = xsize - wsize;
+#if HAVE_NATIVE_mpn_mul_1c
+ if (dsize > 0)
+ cy = mpn_mul_1c (wp, xp, dsize, y, cy);
+ else if (dsize < 0)
+ {
+ dsize = -dsize;
+ cy = mpn_add_1 (wp, wp, dsize, cy);
+ }
+#else
+ if (dsize != 0)
+ {
+ mp_limb_t cy2;
+ if (dsize > 0)
+ cy2 = mpn_mul_1 (wp, xp, dsize, y);
+ else
+ {
+ dsize = -dsize;
+ cy2 = 0;
+ }
+ cy = cy2 + mpn_add_1 (wp, wp, dsize, cy);
+ }
+#endif
+
+ wp[dsize] = cy;
+ new_wsize += (cy != 0);
+ }
+ else
+ {
+ /* submul of absolute values */
+
+ cy = mpn_submul_1 (wp, xp, min_size, y);
+ if (wsize >= xsize)
+ {
+ /* if w bigger than x, then propagate borrow through it */
+ if (wsize != xsize)
+ cy = mpn_sub_1 (wp+xsize, wp+xsize, wsize-xsize, cy);
+
+ if (cy != 0)
+ {
+ /* Borrow out of w, take twos complement negative to get
+ absolute value, flip sign of w. */
+ wp[new_wsize] = ~-cy; /* extra limb is 0-cy */
+ mpn_com (wp, wp, new_wsize);
+ new_wsize++;
+ MPN_INCR_U (wp, new_wsize, CNST_LIMB(1));
+ wsize_signed = -wsize_signed;
+ }
+ }
+ else /* wsize < xsize */
+ {
+ /* x bigger than w, so want x*y-w. Submul has given w-x*y, so
+ take twos complement and use an mpn_mul_1 for the rest. */
+
+ mp_limb_t cy2;
+
+ /* -(-cy*b^n + w-x*y) = (cy-1)*b^n + ~(w-x*y) + 1 */
+ mpn_com (wp, wp, wsize);
+ cy += mpn_add_1 (wp, wp, wsize, CNST_LIMB(1));
+ cy -= 1;
+
+ /* If cy-1 == -1 then hold that -1 for latter. mpn_submul_1 never
+ returns cy==MP_LIMB_T_MAX so that value always indicates a -1. */
+ cy2 = (cy == MP_LIMB_T_MAX);
+ cy += cy2;
+ MPN_MUL_1C (cy, wp+wsize, xp+wsize, xsize-wsize, y, cy);
+ wp[new_wsize] = cy;
+ new_wsize += (cy != 0);
+
+ /* Apply any -1 from above. The value at wp+wsize is non-zero
+ because y!=0 and the high limb of x will be non-zero. */
+ if (cy2)
+ MPN_DECR_U (wp+wsize, new_wsize-wsize, CNST_LIMB(1));
+
+ wsize_signed = -wsize_signed;
+ }
+
+ /* submul can produce high zero limbs due to cancellation, both when w
+ has more limbs or x has more */
+ MPN_NORMALIZE (wp, new_wsize);
+ }
+
+ SIZ (w) = (wsize_signed >= 0 ? new_wsize : -new_wsize);
+
+ ASSERT (new_wsize == 0 || PTR(w)[new_wsize-1] != 0);
+}
+
+
+void
+mpz_addmul_ui (mpz_ptr w, mpz_srcptr x, unsigned long y)
+{
+#if BITS_PER_ULONG > GMP_NUMB_BITS
+ if (UNLIKELY (y > GMP_NUMB_MAX && SIZ(x) != 0))
+ {
+ mpz_t t;
+ mp_ptr tp;
+ mp_size_t xn;
+ TMP_DECL;
+ TMP_MARK;
+ xn = SIZ (x);
+ MPZ_TMP_INIT (t, ABS (xn) + 1);
+ tp = PTR (t);
+ tp[0] = 0;
+ MPN_COPY (tp + 1, PTR(x), ABS (xn));
+ SIZ(t) = xn >= 0 ? xn + 1 : xn - 1;
+ mpz_aorsmul_1 (w, t, (mp_limb_t) y >> GMP_NUMB_BITS, (mp_size_t) 0);
+ PTR(t) = tp + 1;
+ SIZ(t) = xn;
+ mpz_aorsmul_1 (w, t, (mp_limb_t) y & GMP_NUMB_MASK, (mp_size_t) 0);
+ TMP_FREE;
+ return;
+ }
+#endif
+ mpz_aorsmul_1 (w, x, (mp_limb_t) y, (mp_size_t) 0);
+}
+
+void
+mpz_submul_ui (mpz_ptr w, mpz_srcptr x, unsigned long y)
+{
+#if BITS_PER_ULONG > GMP_NUMB_BITS
+ if (y > GMP_NUMB_MAX && SIZ(x) != 0)
+ {
+ mpz_t t;
+ mp_ptr tp;
+ mp_size_t xn;
+ TMP_DECL;
+ TMP_MARK;
+ xn = SIZ (x);
+ MPZ_TMP_INIT (t, ABS (xn) + 1);
+ tp = PTR (t);
+ tp[0] = 0;
+ MPN_COPY (tp + 1, PTR(x), ABS (xn));
+ SIZ(t) = xn >= 0 ? xn + 1 : xn - 1;
+ mpz_aorsmul_1 (w, t, (mp_limb_t) y >> GMP_NUMB_BITS, (mp_size_t) -1);
+ PTR(t) = tp + 1;
+ SIZ(t) = xn;
+ mpz_aorsmul_1 (w, t, (mp_limb_t) y & GMP_NUMB_MASK, (mp_size_t) -1);
+ TMP_FREE;
+ return;
+ }
+#endif
+ mpz_aorsmul_1 (w, x, (mp_limb_t) y & GMP_NUMB_MASK, (mp_size_t) -1);
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpz/array_init.c b/Build/source/libs/gmp/gmp-6.0.0/mpz/array_init.c
new file mode 100644
index 00000000000..b967ddbeefb
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpz/array_init.c
@@ -0,0 +1,50 @@
+/* mpz_array_init (array, array_size, size_per_elem) --
+
+Copyright 1991, 1993-1995, 2000-2002, 2012 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.h"
+#include "gmp-impl.h"
+
+void
+mpz_array_init (mpz_ptr arr, mp_size_t arr_size, mp_size_t nbits)
+{
+ mp_ptr p;
+ mp_size_t i;
+ mp_size_t nlimbs;
+
+ nlimbs = nbits / GMP_NUMB_BITS + 1;
+ p = (mp_ptr) (*__gmp_allocate_func) ((size_t) arr_size * nlimbs * GMP_LIMB_BYTES);
+
+ for (i = 0; i < arr_size; i++)
+ {
+ ALLOC (&arr[i]) = nlimbs + 1; /* Yes, lie a little... */
+ SIZ (&arr[i]) = 0;
+ PTR (&arr[i]) = p + i * nlimbs;
+ }
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpz/bin_ui.c b/Build/source/libs/gmp/gmp-6.0.0/mpz/bin_ui.c
new file mode 100644
index 00000000000..c24b21724c1
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpz/bin_ui.c
@@ -0,0 +1,143 @@
+/* mpz_bin_ui - compute n over k.
+
+Copyright 1998-2002, 2012, 2013 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.h"
+#include "gmp-impl.h"
+#include "longlong.h"
+
+
+/* This is a poor implementation. Look at bin_uiui.c for improvement ideas.
+ In fact consider calling mpz_bin_uiui() when the arguments fit, leaving
+ the code here only for big n.
+
+ The identity bin(n,k) = (-1)^k * bin(-n+k-1,k) can be found in Knuth vol
+ 1 section 1.2.6 part G. */
+
+
+#define DIVIDE() \
+ do { \
+ ASSERT (SIZ(r) > 0); \
+ MPN_DIVREM_OR_DIVEXACT_1 (PTR(r), PTR(r), (mp_size_t) SIZ(r), kacc); \
+ SIZ(r) -= (PTR(r)[SIZ(r)-1] == 0); \
+ } while (0)
+
+void
+mpz_bin_ui (mpz_ptr r, mpz_srcptr n, unsigned long int k)
+{
+ mpz_t ni;
+ mp_limb_t i;
+ mpz_t nacc;
+ mp_limb_t kacc;
+ mp_size_t negate;
+
+ if (SIZ (n) < 0)
+ {
+ /* bin(n,k) = (-1)^k * bin(-n+k-1,k), and set ni = -n+k-1 - k = -n-1 */
+ mpz_init (ni);
+ mpz_add_ui (ni, n, 1L);
+ mpz_neg (ni, ni);
+ negate = (k & 1); /* (-1)^k */
+ }
+ else
+ {
+ /* bin(n,k) == 0 if k>n
+ (no test for this under the n<0 case, since -n+k-1 >= k there) */
+ if (mpz_cmp_ui (n, k) < 0)
+ {
+ SIZ (r) = 0;
+ return;
+ }
+
+ /* set ni = n-k */
+ mpz_init (ni);
+ mpz_sub_ui (ni, n, k);
+ negate = 0;
+ }
+
+ /* Now wanting bin(ni+k,k), with ni positive, and "negate" is the sign (0
+ for positive, 1 for negative). */
+ SIZ (r) = 1; PTR (r)[0] = 1;
+
+ /* Rewrite bin(n,k) as bin(n,n-k) if that is smaller. In this case it's
+ whether ni+k-k < k meaning ni<k, and if so change to denominator ni+k-k
+ = ni, and new ni of ni+k-ni = k. */
+ if (mpz_cmp_ui (ni, k) < 0)
+ {
+ unsigned long tmp;
+ tmp = k;
+ k = mpz_get_ui (ni);
+ mpz_set_ui (ni, tmp);
+ }
+
+ kacc = 1;
+ mpz_init_set_ui (nacc, 1L);
+
+ for (i = 1; i <= k; i++)
+ {
+ mp_limb_t k1, k0;
+
+#if 0
+ mp_limb_t nacclow;
+ int c;
+
+ nacclow = PTR(nacc)[0];
+ for (c = 0; (((kacc | nacclow) & 1) == 0); c++)
+ {
+ kacc >>= 1;
+ nacclow >>= 1;
+ }
+ mpz_div_2exp (nacc, nacc, c);
+#endif
+
+ mpz_add_ui (ni, ni, 1L);
+ mpz_mul (nacc, nacc, ni);
+ umul_ppmm (k1, k0, kacc, i << GMP_NAIL_BITS);
+ if (k1 != 0)
+ {
+ /* Accumulator overflow. Perform bignum step. */
+ mpz_mul (r, r, nacc);
+ SIZ (nacc) = 1; PTR (nacc)[0] = 1;
+ DIVIDE ();
+ kacc = i;
+ }
+ else
+ {
+ /* Save new products in accumulators to keep accumulating. */
+ kacc = k0 >> GMP_NAIL_BITS;
+ }
+ }
+
+ mpz_mul (r, r, nacc);
+ DIVIDE ();
+ SIZ(r) = (SIZ(r) ^ -negate) + negate;
+
+ mpz_clear (nacc);
+ mpz_clear (ni);
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpz/bin_uiui.c b/Build/source/libs/gmp/gmp-6.0.0/mpz/bin_uiui.c
new file mode 100644
index 00000000000..94a9dc5c75d
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpz/bin_uiui.c
@@ -0,0 +1,696 @@
+/* mpz_bin_uiui - compute n over k.
+
+Contributed to the GNU project by Torbjorn Granlund and Marco Bodrato.
+
+Copyright 2010-2012 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.h"
+#include "gmp-impl.h"
+#include "longlong.h"
+
+#ifndef BIN_GOETGHELUCK_THRESHOLD
+#define BIN_GOETGHELUCK_THRESHOLD 1000
+#endif
+#ifndef BIN_UIUI_ENABLE_SMALLDC
+#define BIN_UIUI_ENABLE_SMALLDC 1
+#endif
+#ifndef BIN_UIUI_RECURSIVE_SMALLDC
+#define BIN_UIUI_RECURSIVE_SMALLDC (GMP_NUMB_BITS > 32)
+#endif
+
+/* Algorithm:
+
+ Accumulate chunks of factors first limb-by-limb (using one of mul0-mul8)
+ which are then accumulated into mpn numbers. The first inner loop
+ accumulates divisor factors, the 2nd inner loop accumulates exactly the same
+ number of dividend factors. We avoid accumulating more for the divisor,
+ even with its smaller factors, since we else cannot guarantee divisibility.
+
+ Since we know each division will yield an integer, we compute the quotient
+ using Hensel norm: If the quotient is limited by 2^t, we compute A / B mod
+ 2^t.
+
+ Improvements:
+
+ (1) An obvious improvement to this code would be to compute mod 2^t
+ everywhere. Unfortunately, we cannot determine t beforehand, unless we
+ invoke some approximation, such as Stirling's formula. Of course, we don't
+ need t to be tight. However, it is not clear that this would help much,
+ our numbers are kept reasonably small already.
+
+ (2) Compute nmax/kmax semi-accurately, without scalar division or a loop.
+ Extracting the 3 msb, then doing a table lookup using cnt*8+msb as index,
+ would make it both reasonably accurate and fast. (We could use a table
+ stored into a limb, perhaps.) The table should take the removed factors of
+ 2 into account (those done on-the-fly in mulN).
+
+ (3) The first time in the loop we compute the odd part of a
+ factorial in kp, we might use oddfac_1 for this task.
+ */
+
+/* This threshold determines how large divisor to accumulate before we call
+ bdiv. Perhaps we should never call bdiv, and accumulate all we are told,
+ since we are just basecase code anyway? Presumably, this depends on the
+ relative speed of the asymptotically fast code and this code. */
+#define SOME_THRESHOLD 20
+
+/* Multiply-into-limb functions. These remove factors of 2 on-the-fly. FIXME:
+ All versions of MAXFACS don't take this 2 removal into account now, meaning
+ that then, shifting just adds some overhead. (We remove factors from the
+ completed limb anyway.) */
+
+static mp_limb_t
+mul1 (mp_limb_t m)
+{
+ return m;
+}
+
+static mp_limb_t
+mul2 (mp_limb_t m)
+{
+ /* We need to shift before multiplying, to avoid an overflow. */
+ mp_limb_t m01 = (m | 1) * ((m + 1) >> 1);
+ return m01;
+}
+
+static mp_limb_t
+mul3 (mp_limb_t m)
+{
+ mp_limb_t m01 = (m + 0) * (m + 1) >> 1;
+ mp_limb_t m2 = (m + 2);
+ return m01 * m2;
+}
+
+static mp_limb_t
+mul4 (mp_limb_t m)
+{
+ mp_limb_t m01 = (m + 0) * (m + 1) >> 1;
+ mp_limb_t m23 = (m + 2) * (m + 3) >> 1;
+ return m01 * m23;
+}
+
+static mp_limb_t
+mul5 (mp_limb_t m)
+{
+ mp_limb_t m012 = (m + 0) * (m + 1) * (m + 2) >> 1;
+ mp_limb_t m34 = (m + 3) * (m + 4) >> 1;
+ return m012 * m34;
+}
+
+static mp_limb_t
+mul6 (mp_limb_t m)
+{
+ mp_limb_t m01 = (m + 0) * (m + 1);
+ mp_limb_t m23 = (m + 2) * (m + 3);
+ mp_limb_t m45 = (m + 4) * (m + 5) >> 1;
+ mp_limb_t m0123 = m01 * m23 >> 3;
+ return m0123 * m45;
+}
+
+static mp_limb_t
+mul7 (mp_limb_t m)
+{
+ mp_limb_t m01 = (m + 0) * (m + 1);
+ mp_limb_t m23 = (m + 2) * (m + 3);
+ mp_limb_t m456 = (m + 4) * (m + 5) * (m + 6) >> 1;
+ mp_limb_t m0123 = m01 * m23 >> 3;
+ return m0123 * m456;
+}
+
+static mp_limb_t
+mul8 (mp_limb_t m)
+{
+ mp_limb_t m01 = (m + 0) * (m + 1);
+ mp_limb_t m23 = (m + 2) * (m + 3);
+ mp_limb_t m45 = (m + 4) * (m + 5);
+ mp_limb_t m67 = (m + 6) * (m + 7);
+ mp_limb_t m0123 = m01 * m23 >> 3;
+ mp_limb_t m4567 = m45 * m67 >> 3;
+ return m0123 * m4567;
+}
+
+typedef mp_limb_t (* mulfunc_t) (mp_limb_t);
+
+static const mulfunc_t mulfunc[] = {mul1,mul2,mul3,mul4,mul5,mul6,mul7,mul8};
+#define M (numberof(mulfunc))
+
+/* Number of factors-of-2 removed by the corresponding mulN function. */
+static const unsigned char tcnttab[] = {0, 1, 1, 2, 2, 4, 4, 6};
+
+#if 1
+/* This variant is inaccurate but share the code with other functions. */
+#define MAXFACS(max,l) \
+ do { \
+ (max) = log_n_max (l); \
+ } while (0)
+#else
+
+/* This variant is exact(?) but uses a loop. It takes the 2 removal
+ of mulN into account. */
+static const unsigned long ftab[] =
+#if GMP_NUMB_BITS == 64
+ /* 1 to 8 factors per iteration */
+ {CNST_LIMB(0xffffffffffffffff),CNST_LIMB(0x100000000),0x32cbfe,0x16a0b,0x24c4,0xa16,0x34b,0x1b2 /*,0xdf,0x8d */};
+#endif
+#if GMP_NUMB_BITS == 32
+ /* 1 to 7 factors per iteration */
+ {0xffffffff,0x10000,0x801,0x16b,0x71,0x42,0x26 /* ,0x1e */};
+#endif
+
+#define MAXFACS(max,l) \
+ do { \
+ int __i; \
+ for (__i = numberof (ftab) - 1; l > ftab[__i]; __i--) \
+ ; \
+ (max) = __i + 1; \
+ } while (0)
+#endif
+
+/* Entry i contains (i!/2^t)^(-1) where t is chosen such that the parenthesis
+ is an odd integer. */
+static const mp_limb_t facinv[] = { ONE_LIMB_ODD_FACTORIAL_INVERSES_TABLE };
+
+static void
+mpz_bdiv_bin_uiui (mpz_ptr r, unsigned long int n, unsigned long int k)
+{
+ int nmax, kmax, nmaxnow, numfac;
+ mp_ptr np, kp;
+ mp_size_t nn, kn, alloc;
+ mp_limb_t i, j, t, iii, jjj, cy, dinv;
+ mp_bitcnt_t i2cnt, j2cnt;
+ int cnt;
+ mp_size_t maxn;
+ TMP_DECL;
+
+ ASSERT (k > ODD_FACTORIAL_TABLE_LIMIT);
+ TMP_MARK;
+
+ maxn = 1 + n / GMP_NUMB_BITS; /* absolutely largest result size (limbs) */
+
+ /* FIXME: This allocation might be insufficient, but is usually way too
+ large. */
+ alloc = SOME_THRESHOLD - 1 + MAX (3 * maxn / 2, SOME_THRESHOLD);
+ alloc = MIN (alloc, k) + 1;
+ np = TMP_ALLOC_LIMBS (alloc);
+ kp = TMP_ALLOC_LIMBS (SOME_THRESHOLD + 1);
+
+ MAXFACS (nmax, n);
+ ASSERT (nmax <= M);
+ MAXFACS (kmax, k);
+ ASSERT (kmax <= M);
+ ASSERT (k >= M);
+
+ i = n - k + 1;
+
+ np[0] = 1; nn = 1;
+
+ i2cnt = 0; /* total low zeros in dividend */
+ j2cnt = __gmp_fac2cnt_table[ODD_FACTORIAL_TABLE_LIMIT / 2 - 1];
+ /* total low zeros in divisor */
+
+ numfac = 1;
+ j = ODD_FACTORIAL_TABLE_LIMIT + 1;
+ jjj = ODD_FACTORIAL_TABLE_MAX;
+ ASSERT (__gmp_oddfac_table[ODD_FACTORIAL_TABLE_LIMIT] == ODD_FACTORIAL_TABLE_MAX);
+
+ while (1)
+ {
+ kp[0] = jjj; /* store new factors */
+ kn = 1;
+ t = k - j + 1;
+ kmax = MIN (kmax, t);
+
+ while (kmax != 0 && kn < SOME_THRESHOLD)
+ {
+ jjj = mulfunc[kmax - 1] (j);
+ j += kmax; /* number of factors used */
+ count_trailing_zeros (cnt, jjj); /* count low zeros */
+ jjj >>= cnt; /* remove remaining low zeros */
+ j2cnt += tcnttab[kmax - 1] + cnt; /* update low zeros count */
+ cy = mpn_mul_1 (kp, kp, kn, jjj); /* accumulate new factors */
+ kp[kn] = cy;
+ kn += cy != 0;
+ t = k - j + 1;
+ kmax = MIN (kmax, t);
+ }
+ numfac = j - numfac;
+
+ while (numfac != 0)
+ {
+ nmaxnow = MIN (nmax, numfac);
+ iii = mulfunc[nmaxnow - 1] (i);
+ i += nmaxnow; /* number of factors used */
+ count_trailing_zeros (cnt, iii); /* count low zeros */
+ iii >>= cnt; /* remove remaining low zeros */
+ i2cnt += tcnttab[nmaxnow - 1] + cnt; /* update low zeros count */
+ cy = mpn_mul_1 (np, np, nn, iii); /* accumulate new factors */
+ np[nn] = cy;
+ nn += cy != 0;
+ numfac -= nmaxnow;
+ }
+
+ ASSERT (nn < alloc);
+
+ binvert_limb (dinv, kp[0]);
+ nn += (np[nn - 1] >= kp[kn - 1]);
+ nn -= kn;
+ mpn_sbpi1_bdiv_q (np, np, nn, kp, MIN(kn,nn), -dinv);
+
+ if (kmax == 0)
+ break;
+ numfac = j;
+
+ jjj = mulfunc[kmax - 1] (j);
+ j += kmax; /* number of factors used */
+ count_trailing_zeros (cnt, jjj); /* count low zeros */
+ jjj >>= cnt; /* remove remaining low zeros */
+ j2cnt += tcnttab[kmax - 1] + cnt; /* update low zeros count */
+ }
+
+ /* Put back the right number of factors of 2. */
+ cnt = i2cnt - j2cnt;
+ if (cnt != 0)
+ {
+ ASSERT (cnt < GMP_NUMB_BITS); /* can happen, but not for intended use */
+ cy = mpn_lshift (np, np, nn, cnt);
+ np[nn] = cy;
+ nn += cy != 0;
+ }
+
+ nn -= np[nn - 1] == 0; /* normalisation */
+
+ kp = MPZ_NEWALLOC (r, nn);
+ SIZ(r) = nn;
+ MPN_COPY (kp, np, nn);
+ TMP_FREE;
+}
+
+static void
+mpz_smallk_bin_uiui (mpz_ptr r, unsigned long int n, unsigned long int k)
+{
+ int nmax, numfac;
+ mp_ptr rp;
+ mp_size_t rn, alloc;
+ mp_limb_t i, iii, cy;
+ mp_bitcnt_t i2cnt, cnt;
+
+ count_leading_zeros (cnt, (mp_limb_t) n);
+ cnt = GMP_LIMB_BITS - cnt;
+ alloc = cnt * k / GMP_NUMB_BITS + 3; /* FIXME: ensure rounding is enough. */
+ rp = MPZ_NEWALLOC (r, alloc);
+
+ MAXFACS (nmax, n);
+ nmax = MIN (nmax, M);
+
+ i = n - k + 1;
+
+ nmax = MIN (nmax, k);
+ rp[0] = mulfunc[nmax - 1] (i);
+ rn = 1;
+ i += nmax; /* number of factors used */
+ i2cnt = tcnttab[nmax - 1]; /* low zeros count */
+ numfac = k - nmax;
+ while (numfac != 0)
+ {
+ nmax = MIN (nmax, numfac);
+ iii = mulfunc[nmax - 1] (i);
+ i += nmax; /* number of factors used */
+ i2cnt += tcnttab[nmax - 1]; /* update low zeros count */
+ cy = mpn_mul_1 (rp, rp, rn, iii); /* accumulate new factors */
+ rp[rn] = cy;
+ rn += cy != 0;
+ numfac -= nmax;
+ }
+
+ ASSERT (rn < alloc);
+
+ mpn_pi1_bdiv_q_1 (rp, rp, rn, __gmp_oddfac_table[k], facinv[k - 2],
+ __gmp_fac2cnt_table[k / 2 - 1] - i2cnt);
+ /* A two-fold, branch-free normalisation is possible :*/
+ /* rn -= rp[rn - 1] == 0; */
+ /* rn -= rp[rn - 1] == 0; */
+ MPN_NORMALIZE_NOT_ZERO (rp, rn);
+
+ SIZ(r) = rn;
+}
+
+/* Algorithm:
+
+ Plain and simply multiply things together.
+
+ We tabulate factorials (k!/2^t)^(-1) mod B (where t is chosen such
+ that k!/2^t is odd).
+
+*/
+
+static mp_limb_t
+bc_bin_uiui (unsigned int n, unsigned int k)
+{
+ return ((__gmp_oddfac_table[n] * facinv[k - 2] * facinv[n - k - 2])
+ << (__gmp_fac2cnt_table[n / 2 - 1] - __gmp_fac2cnt_table[k / 2 - 1] - __gmp_fac2cnt_table[(n-k) / 2 - 1]))
+ & GMP_NUMB_MASK;
+}
+
+/* Algorithm:
+
+ Recursively exploit the relation
+ bin(n,k) = bin(n,k>>1)*bin(n-k>>1,k-k>>1)/bin(k,k>>1) .
+
+ Values for binomial(k,k>>1) that fit in a limb are precomputed
+ (with inverses).
+*/
+
+/* bin2kk[i - ODD_CENTRAL_BINOMIAL_OFFSET] =
+ binomial(i*2,i)/2^t (where t is chosen so that it is odd). */
+static const mp_limb_t bin2kk[] = { ONE_LIMB_ODD_CENTRAL_BINOMIAL_TABLE };
+
+/* bin2kkinv[i] = bin2kk[i]^-1 mod B */
+static const mp_limb_t bin2kkinv[] = { ONE_LIMB_ODD_CENTRAL_BINOMIAL_INVERSE_TABLE };
+
+/* bin2kk[i] = binomial((i+MIN_S)*2,i+MIN_S)/2^t. This table contains the t values. */
+static const unsigned char fac2bin[] = { CENTRAL_BINOMIAL_2FAC_TABLE };
+
+static void
+mpz_smallkdc_bin_uiui (mpz_ptr r, unsigned long int n, unsigned long int k)
+{
+ mp_ptr rp;
+ mp_size_t rn;
+ unsigned long int hk;
+
+ hk = k >> 1;
+
+ if ((! BIN_UIUI_RECURSIVE_SMALLDC) || hk <= ODD_FACTORIAL_TABLE_LIMIT)
+ mpz_smallk_bin_uiui (r, n, hk);
+ else
+ mpz_smallkdc_bin_uiui (r, n, hk);
+ k -= hk;
+ n -= hk;
+ if (n <= ODD_FACTORIAL_EXTTABLE_LIMIT) {
+ mp_limb_t cy;
+ rn = SIZ (r);
+ rp = MPZ_REALLOC (r, rn + 1);
+ cy = mpn_mul_1 (rp, rp, rn, bc_bin_uiui (n, k));
+ rp [rn] = cy;
+ rn += cy != 0;
+ } else {
+ mp_limb_t buffer[ODD_CENTRAL_BINOMIAL_TABLE_LIMIT + 3];
+ mpz_t t;
+
+ ALLOC (t) = ODD_CENTRAL_BINOMIAL_TABLE_LIMIT + 3;
+ PTR (t) = buffer;
+ if ((! BIN_UIUI_RECURSIVE_SMALLDC) || k <= ODD_FACTORIAL_TABLE_LIMIT)
+ mpz_smallk_bin_uiui (t, n, k);
+ else
+ mpz_smallkdc_bin_uiui (t, n, k);
+ mpz_mul (r, r, t);
+ rp = PTR (r);
+ rn = SIZ (r);
+ }
+
+ mpn_pi1_bdiv_q_1 (rp, rp, rn, bin2kk[k - ODD_CENTRAL_BINOMIAL_OFFSET],
+ bin2kkinv[k - ODD_CENTRAL_BINOMIAL_OFFSET],
+ fac2bin[k - ODD_CENTRAL_BINOMIAL_OFFSET] - (k != hk));
+ /* A two-fold, branch-free normalisation is possible :*/
+ /* rn -= rp[rn - 1] == 0; */
+ /* rn -= rp[rn - 1] == 0; */
+ MPN_NORMALIZE_NOT_ZERO (rp, rn);
+
+ SIZ(r) = rn;
+}
+
+/* mpz_goetgheluck_bin_uiui(RESULT, N, K) -- Set RESULT to binomial(N,K).
+ *
+ * Contributed to the GNU project by Marco Bodrato.
+ *
+ * Implementation of the algorithm by P. Goetgheluck, "Computing
+ * Binomial Coefficients", The American Mathematical Monthly, Vol. 94,
+ * No. 4 (April 1987), pp. 360-365.
+ *
+ * Acknowledgment: Peter Luschny did spot the slowness of the previous
+ * code and suggested the reference.
+ */
+
+/* TODO: Remove duplicated constants / macros / static functions...
+ */
+
+/*************************************************************/
+/* Section macros: common macros, for swing/fac/bin (&sieve) */
+/*************************************************************/
+
+#define FACTOR_LIST_APPEND(PR, MAX_PR, VEC, I) \
+ if ((PR) > (MAX_PR)) { \
+ (VEC)[(I)++] = (PR); \
+ (PR) = 1; \
+ }
+
+#define FACTOR_LIST_STORE(P, PR, MAX_PR, VEC, I) \
+ do { \
+ if ((PR) > (MAX_PR)) { \
+ (VEC)[(I)++] = (PR); \
+ (PR) = (P); \
+ } else \
+ (PR) *= (P); \
+ } while (0)
+
+#define LOOP_ON_SIEVE_CONTINUE(prime,end,sieve) \
+ __max_i = (end); \
+ \
+ do { \
+ ++__i; \
+ if (((sieve)[__index] & __mask) == 0) \
+ { \
+ (prime) = id_to_n(__i)
+
+#define LOOP_ON_SIEVE_BEGIN(prime,start,end,off,sieve) \
+ do { \
+ mp_limb_t __mask, __index, __max_i, __i; \
+ \
+ __i = (start)-(off); \
+ __index = __i / GMP_LIMB_BITS; \
+ __mask = CNST_LIMB(1) << (__i % GMP_LIMB_BITS); \
+ __i += (off); \
+ \
+ LOOP_ON_SIEVE_CONTINUE(prime,end,sieve)
+
+#define LOOP_ON_SIEVE_STOP \
+ } \
+ __mask = __mask << 1 | __mask >> (GMP_LIMB_BITS-1); \
+ __index += __mask & 1; \
+ } while (__i <= __max_i) \
+
+#define LOOP_ON_SIEVE_END \
+ LOOP_ON_SIEVE_STOP; \
+ } while (0)
+
+/*********************************************************/
+/* Section sieve: sieving functions and tools for primes */
+/*********************************************************/
+
+#if WANT_ASSERT
+static mp_limb_t
+bit_to_n (mp_limb_t bit) { return (bit*3+4)|1; }
+#endif
+
+/* id_to_n (x) = bit_to_n (x-1) = (id*3+1)|1*/
+static mp_limb_t
+id_to_n (mp_limb_t id) { return id*3+1+(id&1); }
+
+/* n_to_bit (n) = ((n-1)&(-CNST_LIMB(2)))/3U-1 */
+static mp_limb_t
+n_to_bit (mp_limb_t n) { return ((n-5)|1)/3U; }
+
+static mp_size_t
+primesieve_size (mp_limb_t n) { return n_to_bit(n) / GMP_LIMB_BITS + 1; }
+
+/*********************************************************/
+/* Section binomial: fast binomial implementation */
+/*********************************************************/
+
+#define COUNT_A_PRIME(P, N, K, PR, MAX_PR, VEC, I) \
+ do { \
+ mp_limb_t __a, __b, __prime, __ma,__mb; \
+ __prime = (P); \
+ __a = (N); __b = (K); __mb = 0; \
+ FACTOR_LIST_APPEND(PR, MAX_PR, VEC, I); \
+ do { \
+ __mb += __b % __prime; __b /= __prime; \
+ __ma = __a % __prime; __a /= __prime; \
+ if (__ma < __mb) { \
+ __mb = 1; (PR) *= __prime; \
+ } else __mb = 0; \
+ } while (__a >= __prime); \
+ } while (0)
+
+#define SH_COUNT_A_PRIME(P, N, K, PR, MAX_PR, VEC, I) \
+ do { \
+ mp_limb_t __prime; \
+ __prime = (P); \
+ if (((N) % __prime) < ((K) % __prime)) { \
+ FACTOR_LIST_STORE (__prime, PR, MAX_PR, VEC, I); \
+ } \
+ } while (0)
+
+/* Returns an approximation of the sqare root of x. *
+ * It gives: x <= limb_apprsqrt (x) ^ 2 < x * 9/4 */
+static mp_limb_t
+limb_apprsqrt (mp_limb_t x)
+{
+ int s;
+
+ ASSERT (x > 2);
+ count_leading_zeros (s, x - 1);
+ s = GMP_LIMB_BITS - 1 - s;
+ return (CNST_LIMB(1) << (s >> 1)) + (CNST_LIMB(1) << ((s - 1) >> 1));
+}
+
+static void
+mpz_goetgheluck_bin_uiui (mpz_ptr r, unsigned long int n, unsigned long int k)
+{
+ mp_limb_t *sieve, *factors, count;
+ mp_limb_t prod, max_prod, j;
+ TMP_DECL;
+
+ ASSERT (BIN_GOETGHELUCK_THRESHOLD >= 13);
+ ASSERT (n >= 25);
+
+ TMP_MARK;
+ sieve = TMP_ALLOC_LIMBS (primesieve_size (n));
+
+ count = gmp_primesieve (sieve, n) + 1;
+ factors = TMP_ALLOC_LIMBS (count / log_n_max (n) + 1);
+
+ max_prod = GMP_NUMB_MAX / n;
+
+ /* Handle primes = 2, 3 separately. */
+ popc_limb (count, n - k);
+ popc_limb (j, k);
+ count += j;
+ popc_limb (j, n);
+ count -= j;
+ prod = CNST_LIMB(1) << count;
+
+ j = 0;
+ COUNT_A_PRIME (3, n, k, prod, max_prod, factors, j);
+
+ /* Accumulate prime factors from 5 to n/2 */
+ {
+ mp_limb_t s;
+
+ {
+ mp_limb_t prime;
+ s = limb_apprsqrt(n);
+ s = n_to_bit (s);
+ LOOP_ON_SIEVE_BEGIN (prime, n_to_bit (5), s, 0,sieve);
+ COUNT_A_PRIME (prime, n, k, prod, max_prod, factors, j);
+ LOOP_ON_SIEVE_END;
+ s++;
+ }
+
+ ASSERT (max_prod <= GMP_NUMB_MAX / 2);
+ max_prod <<= 1;
+ ASSERT (bit_to_n (s) * bit_to_n (s) > n);
+ ASSERT (s <= n_to_bit (n >> 1));
+ {
+ mp_limb_t prime;
+
+ LOOP_ON_SIEVE_BEGIN (prime, s, n_to_bit (n >> 1), 0,sieve);
+ SH_COUNT_A_PRIME (prime, n, k, prod, max_prod, factors, j);
+ LOOP_ON_SIEVE_END;
+ }
+ max_prod >>= 1;
+ }
+
+ /* Store primes from (n-k)+1 to n */
+ ASSERT (n_to_bit (n - k) < n_to_bit (n));
+ {
+ mp_limb_t prime;
+ LOOP_ON_SIEVE_BEGIN (prime, n_to_bit (n - k) + 1, n_to_bit (n), 0,sieve);
+ FACTOR_LIST_STORE (prime, prod, max_prod, factors, j);
+ LOOP_ON_SIEVE_END;
+ }
+
+ if (LIKELY (j != 0))
+ {
+ factors[j++] = prod;
+ mpz_prodlimbs (r, factors, j);
+ }
+ else
+ {
+ PTR (r)[0] = prod;
+ SIZ (r) = 1;
+ }
+ TMP_FREE;
+}
+
+#undef COUNT_A_PRIME
+#undef SH_COUNT_A_PRIME
+#undef LOOP_ON_SIEVE_END
+#undef LOOP_ON_SIEVE_STOP
+#undef LOOP_ON_SIEVE_BEGIN
+#undef LOOP_ON_SIEVE_CONTINUE
+
+/*********************************************************/
+/* End of implementation of Goetgheluck's algorithm */
+/*********************************************************/
+
+void
+mpz_bin_uiui (mpz_ptr r, unsigned long int n, unsigned long int k)
+{
+ if (UNLIKELY (n < k)) {
+ SIZ (r) = 0;
+#if BITS_PER_ULONG > GMP_NUMB_BITS
+ } else if (UNLIKELY (n > GMP_NUMB_MAX)) {
+ mpz_t tmp;
+
+ mpz_init_set_ui (tmp, n);
+ mpz_bin_ui (r, tmp, k);
+ mpz_clear (tmp);
+#endif
+ } else {
+ ASSERT (n <= GMP_NUMB_MAX);
+ /* Rewrite bin(n,k) as bin(n,n-k) if that is smaller. */
+ k = MIN (k, n - k);
+ if (k < 2) {
+ PTR(r)[0] = k ? n : 1; /* 1 + ((-k) & (n-1)); */
+ SIZ(r) = 1;
+ } else if (n <= ODD_FACTORIAL_EXTTABLE_LIMIT) { /* k >= 2, n >= 4 */
+ PTR(r)[0] = bc_bin_uiui (n, k);
+ SIZ(r) = 1;
+ } else if (k <= ODD_FACTORIAL_TABLE_LIMIT)
+ mpz_smallk_bin_uiui (r, n, k);
+ else if (BIN_UIUI_ENABLE_SMALLDC &&
+ k <= (BIN_UIUI_RECURSIVE_SMALLDC ? ODD_CENTRAL_BINOMIAL_TABLE_LIMIT : ODD_FACTORIAL_TABLE_LIMIT)* 2)
+ mpz_smallkdc_bin_uiui (r, n, k);
+ else if (ABOVE_THRESHOLD (k, BIN_GOETGHELUCK_THRESHOLD) &&
+ k > (n >> 4)) /* k > ODD_FACTORIAL_TABLE_LIMIT */
+ mpz_goetgheluck_bin_uiui (r, n, k);
+ else
+ mpz_bdiv_bin_uiui (r, n, k);
+ }
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpz/cdiv_q.c b/Build/source/libs/gmp/gmp-6.0.0/mpz/cdiv_q.c
new file mode 100644
index 00000000000..32e3200a8d5
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpz/cdiv_q.c
@@ -0,0 +1,53 @@
+/* mpz_cdiv_q -- Division rounding the quotient towards +infinity. The
+ remainder gets the opposite sign as the denominator.
+
+Copyright 1994-1996, 2000, 2001, 2005, 2012 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.h"
+#include "gmp-impl.h"
+
+void
+mpz_cdiv_q (mpz_ptr quot, mpz_srcptr dividend, mpz_srcptr divisor)
+{
+ mp_size_t dividend_size = SIZ (dividend);
+ mp_size_t divisor_size = SIZ (divisor);
+ mpz_t rem;
+ TMP_DECL;
+
+ TMP_MARK;
+
+ MPZ_TMP_INIT (rem, ABS (divisor_size));
+
+ mpz_tdiv_qr (quot, rem, dividend, divisor);
+
+ if ((divisor_size ^ dividend_size) >= 0 && SIZ (rem) != 0)
+ mpz_add_ui (quot, quot, 1L);
+
+ TMP_FREE;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpz/cdiv_q_ui.c b/Build/source/libs/gmp/gmp-6.0.0/mpz/cdiv_q_ui.c
new file mode 100644
index 00000000000..63608c90438
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpz/cdiv_q_ui.c
@@ -0,0 +1,103 @@
+/* mpz_cdiv_q_ui -- Division rounding the quotient towards +infinity. The
+ remainder gets the opposite sign as the denominator. In order to make it
+ always fit into the return type, the negative of the true remainder is
+ returned.
+
+Copyright 1994, 1996, 1999, 2001, 2002, 2004, 2012 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.h"
+#include "gmp-impl.h"
+
+unsigned long int
+mpz_cdiv_q_ui (mpz_ptr quot, mpz_srcptr dividend, unsigned long int divisor)
+{
+ mp_size_t ns, nn, qn;
+ mp_ptr np, qp;
+ mp_limb_t rl;
+
+ if (UNLIKELY (divisor == 0))
+ DIVIDE_BY_ZERO;
+
+ ns = SIZ(dividend);
+ if (ns == 0)
+ {
+ SIZ(quot) = 0;
+ return 0;
+ }
+
+ nn = ABS(ns);
+ qp = MPZ_REALLOC (quot, nn);
+ np = PTR(dividend);
+
+#if BITS_PER_ULONG > GMP_NUMB_BITS /* avoid warnings about shift amount */
+ if (divisor > GMP_NUMB_MAX)
+ {
+ mp_limb_t dp[2], rp[2];
+
+ if (nn == 1) /* tdiv_qr requirements; tested above for 0 */
+ {
+ qp[0] = 0;
+ rl = np[0];
+ qn = 1; /* a white lie, fixed below */
+ }
+ else
+ {
+ dp[0] = divisor & GMP_NUMB_MASK;
+ dp[1] = divisor >> GMP_NUMB_BITS;
+ mpn_tdiv_qr (qp, rp, (mp_size_t) 0, np, nn, dp, (mp_size_t) 2);
+ rl = rp[0] + (rp[1] << GMP_NUMB_BITS);
+ qn = nn - 2 + 1;
+ }
+
+ if (rl != 0 && ns >= 0)
+ {
+ mpn_incr_u (qp, (mp_limb_t) 1);
+ rl = divisor - rl;
+ }
+
+ qn -= qp[qn - 1] == 0; qn -= qn != 0 && qp[qn - 1] == 0;
+ }
+ else
+#endif
+ {
+ rl = mpn_divrem_1 (qp, (mp_size_t) 0, np, nn, (mp_limb_t) divisor);
+
+ if (rl != 0 && ns >= 0)
+ {
+ mpn_incr_u (qp, (mp_limb_t) 1);
+ rl = divisor - rl;
+ }
+
+ qn = nn - (qp[nn - 1] == 0);
+ }
+
+ SIZ(quot) = ns >= 0 ? qn : -qn;
+ return rl;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpz/cdiv_qr.c b/Build/source/libs/gmp/gmp-6.0.0/mpz/cdiv_qr.c
new file mode 100644
index 00000000000..45e9a2774cc
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpz/cdiv_qr.c
@@ -0,0 +1,65 @@
+/* mpz_cdiv_qr -- Division rounding the quotient towards +infinity. The
+ remainder gets the opposite sign as the denominator.
+
+Copyright 1994-1996, 2000, 2001, 2005, 2012 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.h"
+#include "gmp-impl.h"
+
+void
+mpz_cdiv_qr (mpz_ptr quot, mpz_ptr rem, mpz_srcptr dividend, mpz_srcptr divisor)
+{
+ mp_size_t divisor_size = SIZ (divisor);
+ mp_size_t xsize;
+ mpz_t temp_divisor; /* N.B.: lives until function returns! */
+ TMP_DECL;
+
+ TMP_MARK;
+
+ /* We need the original value of the divisor after the quotient and
+ remainder have been preliminary calculated. We have to copy it to
+ temporary space if it's the same variable as either QUOT or REM. */
+ if (quot == divisor || rem == divisor)
+ {
+ MPZ_TMP_INIT (temp_divisor, ABS (divisor_size));
+ mpz_set (temp_divisor, divisor);
+ divisor = temp_divisor;
+ }
+
+ xsize = SIZ (dividend) ^ divisor_size;;
+ mpz_tdiv_qr (quot, rem, dividend, divisor);
+
+ if (xsize >= 0 && SIZ (rem) != 0)
+ {
+ mpz_add_ui (quot, quot, 1L);
+ mpz_sub (rem, rem, divisor);
+ }
+
+ TMP_FREE;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpz/cdiv_qr_ui.c b/Build/source/libs/gmp/gmp-6.0.0/mpz/cdiv_qr_ui.c
new file mode 100644
index 00000000000..1ccfbbe7fd2
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpz/cdiv_qr_ui.c
@@ -0,0 +1,119 @@
+/* mpz_cdiv_qr_ui -- Division rounding the quotient towards +infinity. The
+ remainder gets the opposite sign as the denominator. In order to make it
+ always fit into the return type, the negative of the true remainder is
+ returned.
+
+Copyright 1994-1996, 1999, 2001, 2002, 2004, 2012 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.h"
+#include "gmp-impl.h"
+
+unsigned long int
+mpz_cdiv_qr_ui (mpz_ptr quot, mpz_ptr rem, mpz_srcptr dividend, unsigned long int divisor)
+{
+ mp_size_t ns, nn, qn;
+ mp_ptr np, qp;
+ mp_limb_t rl;
+
+ if (UNLIKELY (divisor == 0))
+ DIVIDE_BY_ZERO;
+
+ ns = SIZ(dividend);
+ if (ns == 0)
+ {
+ SIZ(quot) = 0;
+ SIZ(rem) = 0;
+ return 0;
+ }
+
+ nn = ABS(ns);
+ qp = MPZ_REALLOC (quot, nn);
+ np = PTR(dividend);
+
+#if BITS_PER_ULONG > GMP_NUMB_BITS /* avoid warnings about shift amount */
+ if (divisor > GMP_NUMB_MAX)
+ {
+ mp_limb_t dp[2];
+ mp_ptr rp;
+ mp_size_t rn;
+
+ rp = MPZ_REALLOC (rem, 2);
+
+ if (nn == 1) /* tdiv_qr requirements; tested above for 0 */
+ {
+ qp[0] = 0;
+ qn = 1; /* a white lie, fixed below */
+ rl = np[0];
+ rp[0] = rl;
+ }
+ else
+ {
+ dp[0] = divisor & GMP_NUMB_MASK;
+ dp[1] = divisor >> GMP_NUMB_BITS;
+ mpn_tdiv_qr (qp, rp, (mp_size_t) 0, np, nn, dp, (mp_size_t) 2);
+ rl = rp[0] + (rp[1] << GMP_NUMB_BITS);
+ qn = nn - 2 + 1;
+ }
+
+ if (rl != 0 && ns >= 0)
+ {
+ mpn_incr_u (qp, (mp_limb_t) 1);
+ rl = divisor - rl;
+ rp[0] = rl & GMP_NUMB_MASK;
+ rp[1] = rl >> GMP_NUMB_BITS;
+ }
+
+ qn -= qp[qn - 1] == 0; qn -= qn != 0 && qp[qn - 1] == 0;
+ rn = 1 + (rl > GMP_NUMB_MAX); rn -= (rp[rn - 1] == 0);
+ SIZ(rem) = -rn;
+ }
+ else
+#endif
+ {
+ rl = mpn_divrem_1 (qp, (mp_size_t) 0, np, nn, (mp_limb_t) divisor);
+ if (rl == 0)
+ SIZ(rem) = 0;
+ else
+ {
+ if (ns >= 0)
+ {
+ mpn_incr_u (qp, (mp_limb_t) 1);
+ rl = divisor - rl;
+ }
+
+ PTR(rem)[0] = rl;
+ SIZ(rem) = -(rl != 0);
+ }
+ qn = nn - (qp[nn - 1] == 0);
+ }
+
+ SIZ(quot) = ns >= 0 ? qn : -qn;
+ return rl;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpz/cdiv_r.c b/Build/source/libs/gmp/gmp-6.0.0/mpz/cdiv_r.c
new file mode 100644
index 00000000000..9cebab3e061
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpz/cdiv_r.c
@@ -0,0 +1,61 @@
+/* mpz_cdiv_r -- Division rounding the quotient towards +infinity. The
+ remainder gets the opposite sign as the denominator.
+
+Copyright 1994-1996, 2001, 2005, 2012 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.h"
+#include "gmp-impl.h"
+
+void
+mpz_cdiv_r (mpz_ptr rem, mpz_srcptr dividend, mpz_srcptr divisor)
+{
+ mp_size_t divisor_size = SIZ (divisor);
+ mpz_t temp_divisor; /* N.B.: lives until function returns! */
+ TMP_DECL;
+
+ TMP_MARK;
+
+ /* We need the original value of the divisor after the remainder has been
+ preliminary calculated. We have to copy it to temporary space if it's
+ the same variable as REM. */
+ if (rem == divisor)
+ {
+
+ MPZ_TMP_INIT (temp_divisor, ABS (divisor_size));
+ mpz_set (temp_divisor, divisor);
+ divisor = temp_divisor;
+ }
+
+ mpz_tdiv_r (rem, dividend, divisor);
+
+ if ((divisor_size ^ SIZ (dividend)) >= 0 && SIZ (rem) != 0)
+ mpz_sub (rem, rem, divisor);
+
+ TMP_FREE;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpz/cdiv_r_ui.c b/Build/source/libs/gmp/gmp-6.0.0/mpz/cdiv_r_ui.c
new file mode 100644
index 00000000000..68fb149c461
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpz/cdiv_r_ui.c
@@ -0,0 +1,110 @@
+/* mpz_cdiv_r_ui -- Division rounding the quotient towards +infinity. The
+ remainder gets the opposite sign as the denominator. In order to make it
+ always fit into the return type, the negative of the true remainder is
+ returned.
+
+Copyright 1994-1996, 2001, 2002, 2004, 2005, 2012 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.h"
+#include "gmp-impl.h"
+
+unsigned long int
+mpz_cdiv_r_ui (mpz_ptr rem, mpz_srcptr dividend, unsigned long int divisor)
+{
+ mp_size_t ns, nn;
+ mp_ptr np;
+ mp_limb_t rl;
+
+ if (UNLIKELY (divisor == 0))
+ DIVIDE_BY_ZERO;
+
+ ns = SIZ(dividend);
+ if (ns == 0)
+ {
+ SIZ(rem) = 0;
+ return 0;
+ }
+
+ nn = ABS(ns);
+ np = PTR(dividend);
+#if BITS_PER_ULONG > GMP_NUMB_BITS /* avoid warnings about shift amount */
+ if (divisor > GMP_NUMB_MAX)
+ {
+ mp_limb_t dp[2];
+ mp_ptr rp, qp;
+ mp_size_t rn;
+ TMP_DECL;
+
+ rp = MPZ_REALLOC (rem, 2);
+
+ if (nn == 1) /* tdiv_qr requirements; tested above for 0 */
+ {
+ rl = np[0];
+ rp[0] = rl;
+ }
+ else
+ {
+ TMP_MARK;
+ dp[0] = divisor & GMP_NUMB_MASK;
+ dp[1] = divisor >> GMP_NUMB_BITS;
+ qp = TMP_ALLOC_LIMBS (nn - 2 + 1);
+ mpn_tdiv_qr (qp, rp, (mp_size_t) 0, np, nn, dp, (mp_size_t) 2);
+ TMP_FREE;
+ rl = rp[0] + (rp[1] << GMP_NUMB_BITS);
+ }
+
+ if (rl != 0 && ns >= 0)
+ {
+ rl = divisor - rl;
+ rp[0] = rl & GMP_NUMB_MASK;
+ rp[1] = rl >> GMP_NUMB_BITS;
+ }
+
+ rn = 1 + (rl > GMP_NUMB_MAX); rn -= (rp[rn - 1] == 0);
+ SIZ(rem) = -rn;
+ }
+ else
+#endif
+ {
+ rl = mpn_mod_1 (np, nn, (mp_limb_t) divisor);
+ if (rl == 0)
+ SIZ(rem) = 0;
+ else
+ {
+ if (ns >= 0)
+ rl = divisor - rl;
+
+ PTR(rem)[0] = rl;
+ SIZ(rem) = -1;
+ }
+ }
+
+ return rl;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpz/cdiv_ui.c b/Build/source/libs/gmp/gmp-6.0.0/mpz/cdiv_ui.c
new file mode 100644
index 00000000000..1f7f6e3c1ba
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpz/cdiv_ui.c
@@ -0,0 +1,103 @@
+/* mpz_cdiv_ui -- Division rounding the quotient towards +infinity. The
+ remainder gets the opposite sign as the denominator. In order to make it
+ always fit into the return type, the negative of the true remainder is
+ returned.
+
+Copyright 1994-1996, 2001, 2002, 2004, 2005, 2012 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.h"
+#include "gmp-impl.h"
+
+unsigned long int
+mpz_cdiv_ui (mpz_srcptr dividend, unsigned long int divisor)
+{
+ mp_size_t ns, nn;
+ mp_ptr np;
+ mp_limb_t rl;
+
+ if (UNLIKELY (divisor == 0))
+ DIVIDE_BY_ZERO;
+
+ ns = SIZ(dividend);
+ if (ns == 0)
+ {
+ return 0;
+ }
+
+ nn = ABS(ns);
+ np = PTR(dividend);
+#if BITS_PER_ULONG > GMP_NUMB_BITS /* avoid warnings about shift amount */
+ if (divisor > GMP_NUMB_MAX)
+ {
+ mp_limb_t dp[2], rp[2];
+ mp_ptr qp;
+ mp_size_t rn;
+ TMP_DECL;
+
+ if (nn == 1) /* tdiv_qr requirements; tested above for 0 */
+ {
+ rl = np[0];
+ rp[0] = rl;
+ }
+ else
+ {
+ TMP_MARK;
+ dp[0] = divisor & GMP_NUMB_MASK;
+ dp[1] = divisor >> GMP_NUMB_BITS;
+ qp = TMP_ALLOC_LIMBS (nn - 2 + 1);
+ mpn_tdiv_qr (qp, rp, (mp_size_t) 0, np, nn, dp, (mp_size_t) 2);
+ TMP_FREE;
+ rl = rp[0] + (rp[1] << GMP_NUMB_BITS);
+ }
+
+ if (rl != 0 && ns >= 0)
+ {
+ rl = divisor - rl;
+ rp[0] = rl & GMP_NUMB_MASK;
+ rp[1] = rl >> GMP_NUMB_BITS;
+ }
+
+ rn = 1 + (rl > GMP_NUMB_MAX); rn -= (rp[rn - 1] == 0);
+ }
+ else
+#endif
+ {
+ rl = mpn_mod_1 (np, nn, (mp_limb_t) divisor);
+ if (rl == 0)
+ ;
+ else
+ {
+ if (ns >= 0)
+ rl = divisor - rl;
+ }
+ }
+
+ return rl;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpz/cfdiv_q_2exp.c b/Build/source/libs/gmp/gmp-6.0.0/mpz/cfdiv_q_2exp.c
new file mode 100644
index 00000000000..c69e37c6054
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpz/cfdiv_q_2exp.c
@@ -0,0 +1,113 @@
+/* mpz_cdiv_q_2exp, mpz_fdiv_q_2exp -- quotient from mpz divided by 2^n.
+
+Copyright 1991, 1993, 1994, 1996, 1998, 1999, 2001, 2002, 2004, 2012 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.h"
+#include "gmp-impl.h"
+
+
+/* dir==1 for ceil, dir==-1 for floor */
+
+static void __gmpz_cfdiv_q_2exp (REGPARM_3_1 (mpz_ptr, mpz_srcptr, mp_bitcnt_t, int)) REGPARM_ATTR (1);
+#define cfdiv_q_2exp(w,u,cnt,dir) __gmpz_cfdiv_q_2exp (REGPARM_3_1 (w,u,cnt,dir))
+
+REGPARM_ATTR (1) static void
+cfdiv_q_2exp (mpz_ptr w, mpz_srcptr u, mp_bitcnt_t cnt, int dir)
+{
+ mp_size_t wsize, usize, abs_usize, limb_cnt, i;
+ mp_srcptr up;
+ mp_ptr wp;
+ mp_limb_t round, rmask;
+
+ usize = SIZ (u);
+ abs_usize = ABS (usize);
+ limb_cnt = cnt / GMP_NUMB_BITS;
+ wsize = abs_usize - limb_cnt;
+ if (wsize <= 0)
+ {
+ /* u < 2**cnt, so result 1, 0 or -1 according to rounding */
+ PTR(w)[0] = 1;
+ SIZ(w) = (usize == 0 || (usize ^ dir) < 0 ? 0 : dir);
+ return;
+ }
+
+ /* +1 limb to allow for mpn_add_1 below */
+ MPZ_REALLOC (w, wsize+1);
+
+ /* Check for rounding if direction matches u sign.
+ Set round if we're skipping non-zero limbs. */
+ up = PTR(u);
+ round = 0;
+ rmask = ((usize ^ dir) >= 0 ? MP_LIMB_T_MAX : 0);
+ if (rmask != 0)
+ for (i = 0; i < limb_cnt && round == 0; i++)
+ round = up[i];
+
+ wp = PTR(w);
+ cnt %= GMP_NUMB_BITS;
+ if (cnt != 0)
+ {
+ round |= rmask & mpn_rshift (wp, up + limb_cnt, wsize, cnt);
+ wsize -= (wp[wsize - 1] == 0);
+ }
+ else
+ MPN_COPY_INCR (wp, up + limb_cnt, wsize);
+
+ if (round != 0)
+ {
+ if (wsize != 0)
+ {
+ mp_limb_t cy;
+ cy = mpn_add_1 (wp, wp, wsize, CNST_LIMB(1));
+ wp[wsize] = cy;
+ wsize += cy;
+ }
+ else
+ {
+ /* We shifted something to zero. */
+ wp[0] = 1;
+ wsize = 1;
+ }
+ }
+ SIZ(w) = (usize >= 0 ? wsize : -wsize);
+}
+
+
+void
+mpz_cdiv_q_2exp (mpz_ptr w, mpz_srcptr u, mp_bitcnt_t cnt)
+{
+ cfdiv_q_2exp (w, u, cnt, 1);
+}
+
+void
+mpz_fdiv_q_2exp (mpz_ptr w, mpz_srcptr u, mp_bitcnt_t cnt)
+{
+ cfdiv_q_2exp (w, u, cnt, -1);
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpz/cfdiv_r_2exp.c b/Build/source/libs/gmp/gmp-6.0.0/mpz/cfdiv_r_2exp.c
new file mode 100644
index 00000000000..5466691f295
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpz/cfdiv_r_2exp.c
@@ -0,0 +1,164 @@
+/* mpz_cdiv_r_2exp, mpz_fdiv_r_2exp -- remainder from mpz divided by 2^n.
+
+Copyright 2001, 2002, 2004, 2012 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.h"
+#include "gmp-impl.h"
+
+
+/* Bit mask of "n" least significant bits of a limb. */
+#define LOW_MASK(n) ((CNST_LIMB(1) << (n)) - 1)
+
+
+/* dir==1 for ceil, dir==-1 for floor */
+
+static void __gmpz_cfdiv_r_2exp (REGPARM_3_1 (mpz_ptr, mpz_srcptr, mp_bitcnt_t, int)) REGPARM_ATTR (1);
+#define cfdiv_r_2exp(w,u,cnt,dir) __gmpz_cfdiv_r_2exp (REGPARM_3_1 (w, u, cnt, dir))
+
+REGPARM_ATTR (1) static void
+cfdiv_r_2exp (mpz_ptr w, mpz_srcptr u, mp_bitcnt_t cnt, int dir)
+{
+ mp_size_t usize, abs_usize, limb_cnt, i;
+ mp_srcptr up;
+ mp_ptr wp;
+ mp_limb_t high;
+
+ usize = SIZ(u);
+ if (usize == 0)
+ {
+ SIZ(w) = 0;
+ return;
+ }
+
+ limb_cnt = cnt / GMP_NUMB_BITS;
+ cnt %= GMP_NUMB_BITS;
+ abs_usize = ABS (usize);
+
+ /* MPZ_REALLOC(w) below is only when w!=u, so we can fetch PTR(u) here
+ nice and early */
+ up = PTR(u);
+
+ if ((usize ^ dir) < 0)
+ {
+ /* Round towards zero, means just truncate */
+
+ if (w == u)
+ {
+ /* if already smaller than limb_cnt then do nothing */
+ if (abs_usize <= limb_cnt)
+ return;
+ wp = PTR(w);
+ }
+ else
+ {
+ i = MIN (abs_usize, limb_cnt+1);
+ wp = MPZ_REALLOC (w, i);
+ MPN_COPY (wp, up, i);
+
+ /* if smaller than limb_cnt then only the copy is needed */
+ if (abs_usize <= limb_cnt)
+ {
+ SIZ(w) = usize;
+ return;
+ }
+ }
+ }
+ else
+ {
+ /* Round away from zero, means twos complement if non-zero */
+
+ /* if u!=0 and smaller than divisor, then must negate */
+ if (abs_usize <= limb_cnt)
+ goto negate;
+
+ /* if non-zero low limb, then must negate */
+ for (i = 0; i < limb_cnt; i++)
+ if (up[i] != 0)
+ goto negate;
+
+ /* if non-zero partial limb, then must negate */
+ if ((up[limb_cnt] & LOW_MASK (cnt)) != 0)
+ goto negate;
+
+ /* otherwise low bits of u are zero, so that's the result */
+ SIZ(w) = 0;
+ return;
+
+ negate:
+ /* twos complement negation to get 2**cnt-u */
+
+ wp = MPZ_REALLOC (w, limb_cnt+1);
+ up = PTR(u);
+
+ /* Ones complement */
+ i = MIN (abs_usize, limb_cnt+1);
+ mpn_com (wp, up, i);
+ for ( ; i <= limb_cnt; i++)
+ wp[i] = GMP_NUMB_MAX;
+
+ /* Twos complement. Since u!=0 in the relevant part, the twos
+ complement never gives 0 and a carry, so can use MPN_INCR_U. */
+ MPN_INCR_U (wp, limb_cnt+1, CNST_LIMB(1));
+
+ usize = -usize;
+ }
+
+ /* Mask the high limb */
+ high = wp[limb_cnt];
+ high &= LOW_MASK (cnt);
+ wp[limb_cnt] = high;
+
+ /* Strip any consequent high zeros */
+ while (high == 0)
+ {
+ limb_cnt--;
+ if (limb_cnt < 0)
+ {
+ SIZ(w) = 0;
+ return;
+ }
+ high = wp[limb_cnt];
+ }
+
+ limb_cnt++;
+ SIZ(w) = (usize >= 0 ? limb_cnt : -limb_cnt);
+}
+
+
+void
+mpz_cdiv_r_2exp (mpz_ptr w, mpz_srcptr u, mp_bitcnt_t cnt)
+{
+ cfdiv_r_2exp (w, u, cnt, 1);
+}
+
+void
+mpz_fdiv_r_2exp (mpz_ptr w, mpz_srcptr u, mp_bitcnt_t cnt)
+{
+ cfdiv_r_2exp (w, u, cnt, -1);
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpz/clear.c b/Build/source/libs/gmp/gmp-6.0.0/mpz/clear.c
new file mode 100644
index 00000000000..30f626c5052
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpz/clear.c
@@ -0,0 +1,40 @@
+/* mpz_clear -- de-allocate the space occupied by the dynamic digit space of
+ an integer.
+
+Copyright 1991, 1993-1995, 2000, 2001, 2012, 2014 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.h"
+#include "gmp-impl.h"
+
+void
+mpz_clear (mpz_ptr m)
+{
+ (*__gmp_free_func) (PTR (m), (size_t) ALLOC (m) * GMP_LIMB_BYTES);
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpz/clears.c b/Build/source/libs/gmp/gmp-6.0.0/mpz/clears.c
new file mode 100644
index 00000000000..193c5ade773
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpz/clears.c
@@ -0,0 +1,49 @@
+/* mpz_clears() -- Clear multiple mpz_t variables.
+
+Copyright 2009, 2014 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 <stdarg.h>
+#include <stdio.h> /* for NULL */
+#include "gmp.h"
+#include "gmp-impl.h"
+
+void
+mpz_clears (mpz_ptr x, ...)
+{
+ va_list ap;
+
+ va_start (ap, x);
+
+ while (x != NULL)
+ {
+ (*__gmp_free_func) (PTR (x), (size_t) ALLOC (x) * GMP_LIMB_BYTES);
+ x = va_arg (ap, mpz_ptr);
+ }
+ va_end (ap);
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpz/clrbit.c b/Build/source/libs/gmp/gmp-6.0.0/mpz/clrbit.c
new file mode 100644
index 00000000000..2475efe1e5b
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpz/clrbit.c
@@ -0,0 +1,116 @@
+/* mpz_clrbit -- clear a specified bit.
+
+Copyright 1991, 1993-1995, 2001, 2002, 2012 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.h"
+#include "gmp-impl.h"
+
+void
+mpz_clrbit (mpz_ptr d, mp_bitcnt_t bit_idx)
+{
+ mp_size_t dsize = SIZ (d);
+ mp_ptr dp = PTR (d);
+ mp_size_t limb_idx;
+ mp_limb_t mask;
+
+ limb_idx = bit_idx / GMP_NUMB_BITS;
+ mask = CNST_LIMB(1) << (bit_idx % GMP_NUMB_BITS);
+ if (dsize >= 0)
+ {
+ if (limb_idx < dsize)
+ {
+ mp_limb_t dlimb;
+ dlimb = dp[limb_idx] & ~mask;
+ dp[limb_idx] = dlimb;
+
+ if (UNLIKELY ((dlimb == 0) + limb_idx == dsize)) /* dsize == limb_idx + 1 */
+ {
+ /* high limb became zero, must normalize */
+ MPN_NORMALIZE (dp, limb_idx);
+ SIZ (d) = limb_idx;
+ }
+ }
+ else
+ ;
+ }
+ else
+ {
+ /* Simulate two's complement arithmetic, i.e. simulate
+ 1. Set OP = ~(OP - 1) [with infinitely many leading ones].
+ 2. clear the bit.
+ 3. Set OP = ~OP + 1. */
+
+ dsize = -dsize;
+
+ if (limb_idx < dsize)
+ {
+ mp_size_t zero_bound;
+
+ /* No index upper bound on this loop, we're sure there's a non-zero limb
+ sooner or later. */
+ zero_bound = 0;
+ while (dp[zero_bound] == 0)
+ zero_bound++;
+
+ if (limb_idx > zero_bound)
+ {
+ dp[limb_idx] |= mask;
+ }
+ else if (limb_idx == zero_bound)
+ {
+ mp_limb_t dlimb;
+ dlimb = (((dp[limb_idx] - 1) | mask) + 1) & GMP_NUMB_MASK;
+ dp[limb_idx] = dlimb;
+
+ if (dlimb == 0)
+ {
+ /* Increment at limb_idx + 1. Extend the number with a zero limb
+ for simplicity. */
+ dp = MPZ_REALLOC (d, dsize + 1);
+ dp[dsize] = 0;
+ MPN_INCR_U (dp + limb_idx + 1, dsize - limb_idx, 1);
+ dsize += dp[dsize];
+
+ SIZ (d) = -dsize;
+ }
+ }
+ else
+ ;
+ }
+ else
+ {
+ /* Ugh. The bit should be cleared outside of the end of the
+ number. We have to increase the size of the number. */
+ dp = MPZ_REALLOC (d, limb_idx + 1);
+ SIZ (d) = -(limb_idx + 1);
+ MPN_ZERO (dp + dsize, limb_idx - dsize);
+ dp[limb_idx] = mask;
+ }
+ }
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpz/cmp.c b/Build/source/libs/gmp/gmp-6.0.0/mpz/cmp.c
new file mode 100644
index 00000000000..b8a5eaa7657
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpz/cmp.c
@@ -0,0 +1,54 @@
+/* mpz_cmp(u,v) -- Compare U, V. Return positive, zero, or negative
+ based on if U > V, U == V, or U < V.
+
+Copyright 1991, 1993, 1994, 1996, 2001, 2002, 2011 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.h"
+#include "gmp-impl.h"
+
+int
+mpz_cmp (mpz_srcptr u, mpz_srcptr v) __GMP_NOTHROW
+{
+ mp_size_t usize, vsize, dsize, asize;
+ mp_srcptr up, vp;
+ int cmp;
+
+ usize = SIZ(u);
+ vsize = SIZ(v);
+ dsize = usize - vsize;
+ if (dsize != 0)
+ return dsize;
+
+ asize = ABS (usize);
+ up = PTR(u);
+ vp = PTR(v);
+ MPN_CMP (cmp, up, vp, asize);
+ return (usize >= 0 ? cmp : -cmp);
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpz/cmp_d.c b/Build/source/libs/gmp/gmp-6.0.0/mpz/cmp_d.c
new file mode 100644
index 00000000000..45926d6d547
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpz/cmp_d.c
@@ -0,0 +1,145 @@
+/* mpz_cmp_d -- compare absolute values of mpz and double.
+
+Copyright 2001-2003 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 "config.h"
+
+#if HAVE_FLOAT_H
+#include <float.h> /* for DBL_MAX */
+#endif
+
+#include "gmp.h"
+#include "gmp-impl.h"
+
+
+#define RETURN_CMP(zl, dl) \
+ do { \
+ zlimb = (zl); \
+ dlimb = (dl); \
+ if (zlimb != dlimb) \
+ return (zlimb >= dlimb ? ret : -ret); \
+ } while (0)
+
+#define RETURN_NONZERO(ptr, size, val) \
+ do { \
+ mp_size_t __i; \
+ for (__i = (size)-1; __i >= 0; __i--) \
+ if ((ptr)[__i] != 0) \
+ return val; \
+ return 0; \
+ } while (0)
+
+
+int
+mpz_cmp_d (mpz_srcptr z, double d)
+{
+ mp_limb_t darray[LIMBS_PER_DOUBLE], zlimb, dlimb;
+ mp_srcptr zp;
+ mp_size_t zsize;
+ int dexp, ret;
+
+ /* d=NaN is an invalid operation, there's no sensible return value.
+ d=Inf or -Inf is always bigger than z. */
+ DOUBLE_NAN_INF_ACTION (d, __gmp_invalid_operation (), goto z_zero);
+
+ /* 1. Either operand zero. */
+ zsize = SIZ(z);
+ if (d == 0.0)
+ return zsize;
+ if (zsize == 0)
+ {
+ z_zero:
+ return (d < 0.0 ? 1 : -1);
+ }
+
+ /* 2. Opposite signs. */
+ if (zsize >= 0)
+ {
+ if (d < 0.0)
+ return 1; /* >=0 cmp <0 */
+ ret = 1;
+ }
+ else
+ {
+ if (d >= 0.0)
+ return -1; /* <0 cmp >=0 */
+ ret = -1;
+ d = -d;
+ zsize = -zsize;
+ }
+
+ /* 3. Small d, knowing abs(z) >= 1. */
+ if (d < 1.0)
+ return ret;
+
+ dexp = __gmp_extract_double (darray, d);
+ ASSERT (dexp >= 1);
+
+ /* 4. Check for different high limb positions. */
+ if (zsize != dexp)
+ return (zsize >= dexp ? ret : -ret);
+
+ /* 5. Limb data. */
+ zp = PTR(z);
+
+#if LIMBS_PER_DOUBLE == 2
+ RETURN_CMP (zp[zsize-1], darray[1]);
+ if (zsize == 1)
+ return (darray[0] != 0 ? -ret : 0);
+
+ RETURN_CMP (zp[zsize-2], darray[0]);
+ RETURN_NONZERO (zp, zsize-2, ret);
+#endif
+
+#if LIMBS_PER_DOUBLE == 3
+ RETURN_CMP (zp[zsize-1], darray[2]);
+ if (zsize == 1)
+ return ((darray[0] | darray[1]) != 0 ? -ret : 0);
+
+ RETURN_CMP (zp[zsize-2], darray[1]);
+ if (zsize == 2)
+ return (darray[0] != 0 ? -ret : 0);
+
+ RETURN_CMP (zp[zsize-3], darray[0]);
+ RETURN_NONZERO (zp, zsize-3, ret);
+#endif
+
+#if LIMBS_PER_DOUBLE >= 4
+ {
+ int i;
+ for (i = 1; i <= LIMBS_PER_DOUBLE; i++)
+ {
+ RETURN_CMP (zp[zsize-i], darray[LIMBS_PER_DOUBLE-i]);
+ if (i >= zsize)
+ RETURN_NONZERO (darray, LIMBS_PER_DOUBLE-i, -ret);
+ }
+ RETURN_NONZERO (zp, zsize-LIMBS_PER_DOUBLE, ret);
+ }
+#endif
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpz/cmp_si.c b/Build/source/libs/gmp/gmp-6.0.0/mpz/cmp_si.c
new file mode 100644
index 00000000000..86251f436ad
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpz/cmp_si.c
@@ -0,0 +1,70 @@
+/* mpz_cmp_si(u,v) -- Compare an integer U with a single-word int V.
+ Return positive, zero, or negative based on if U > V, U == V, or U < V.
+
+Copyright 1991, 1993-1996, 2000-2002, 2012, 2013 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.h"
+#include "gmp-impl.h"
+
+int
+_mpz_cmp_si (mpz_srcptr u, signed long int v_digit) __GMP_NOTHROW
+{
+#if GMP_NAIL_BITS != 0
+ /* FIXME. This isn't very pretty. */
+ mpz_t tmp;
+ mp_limb_t tt[2];
+ PTR(tmp) = tt;
+ ALLOC(tmp) = 2;
+ mpz_set_si (tmp, v_digit);
+ return mpz_cmp (u, tmp);
+#else
+
+ mp_size_t vsize, usize;
+
+ usize = SIZ (u);
+ vsize = (v_digit > 0) - (v_digit < 0);
+
+ if ((usize == 0) | (usize != vsize))
+ return usize - vsize;
+ else {
+ mp_limb_t u_digit, absv_digit;
+
+ u_digit = PTR (u)[0];
+ absv_digit = ABS_CAST (unsigned long, v_digit);
+
+ if (u_digit == absv_digit)
+ return 0;
+
+ if (u_digit > absv_digit)
+ return usize;
+ else
+ return -usize;
+ }
+#endif
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpz/cmp_ui.c b/Build/source/libs/gmp/gmp-6.0.0/mpz/cmp_ui.c
new file mode 100644
index 00000000000..790d8241d68
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpz/cmp_ui.c
@@ -0,0 +1,78 @@
+/* mpz_cmp_ui.c -- Compare a mpz_t a with an mp_limb_t b. Return positive,
+ zero, or negative based on if a > b, a == b, or a < b.
+
+Copyright 1991, 1993-1996, 2001, 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/. */
+
+#include "gmp.h"
+#include "gmp-impl.h"
+
+int
+_mpz_cmp_ui (mpz_srcptr u, unsigned long int v_digit) __GMP_NOTHROW
+{
+ mp_ptr up;
+ mp_size_t un;
+ mp_limb_t ul;
+
+ up = PTR(u);
+ un = SIZ(u);
+
+ if (un == 0)
+ return -(v_digit != 0);
+
+ if (un == 1)
+ {
+ ul = up[0];
+ if (ul > v_digit)
+ return 1;
+ if (ul < v_digit)
+ return -1;
+ return 0;
+ }
+
+#if GMP_NAIL_BITS != 0
+ if (v_digit > GMP_NUMB_MAX)
+ {
+ if (un == 2)
+ {
+ ul = up[0] + (up[1] << GMP_NUMB_BITS);
+
+ if ((up[1] >> GMP_NAIL_BITS) != 0)
+ return 1;
+
+ if (ul > v_digit)
+ return 1;
+ if (ul < v_digit)
+ return -1;
+ return 0;
+ }
+ }
+#endif
+
+ return un > 0 ? 1 : -1;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpz/cmpabs.c b/Build/source/libs/gmp/gmp-6.0.0/mpz/cmpabs.c
new file mode 100644
index 00000000000..5685776abe9
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpz/cmpabs.c
@@ -0,0 +1,54 @@
+/* mpz_cmpabs(u,v) -- Compare U, V. Return positive, zero, or negative
+ based on if U > V, U == V, or U < V.
+
+Copyright 1991, 1993, 1994, 1996, 1997, 2000-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/. */
+
+#include "gmp.h"
+#include "gmp-impl.h"
+
+
+int
+mpz_cmpabs (mpz_srcptr u, mpz_srcptr v) __GMP_NOTHROW
+{
+ mp_size_t usize, vsize, dsize;
+ mp_srcptr up, vp;
+ int cmp;
+
+ usize = ABSIZ (u);
+ vsize = ABSIZ (v);
+ dsize = usize - vsize;
+ if (dsize != 0)
+ return dsize;
+
+ up = PTR(u);
+ vp = PTR(v);
+ MPN_CMP (cmp, up, vp, usize);
+ return cmp;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpz/cmpabs_d.c b/Build/source/libs/gmp/gmp-6.0.0/mpz/cmpabs_d.c
new file mode 100644
index 00000000000..a4b95d26aa3
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpz/cmpabs_d.c
@@ -0,0 +1,130 @@
+/* mpz_cmpabs_d -- compare absolute values of mpz and double.
+
+Copyright 2001-2003, 2012 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 "config.h"
+
+#if HAVE_FLOAT_H
+#include <float.h> /* for DBL_MAX */
+#endif
+
+#include "gmp.h"
+#include "gmp-impl.h"
+
+
+#define RETURN_CMP(zl, dl) \
+ do { \
+ zlimb = (zl); \
+ dlimb = (dl); \
+ if (zlimb != dlimb) \
+ return (zlimb >= dlimb ? 1 : -1); \
+ } while (0)
+
+#define RETURN_NONZERO(ptr, size, val) \
+ do { \
+ mp_size_t __i; \
+ for (__i = (size)-1; __i >= 0; __i--) \
+ if ((ptr)[__i] != 0) \
+ return val; \
+ return 0; \
+ } while (0)
+
+
+int
+mpz_cmpabs_d (mpz_srcptr z, double d)
+{
+ mp_limb_t darray[LIMBS_PER_DOUBLE], zlimb, dlimb;
+ mp_srcptr zp;
+ mp_size_t zsize;
+ int dexp;
+
+ /* d=NaN is an invalid operation, there's no sensible return value.
+ d=Inf or -Inf is always bigger than z. */
+ DOUBLE_NAN_INF_ACTION (d, __gmp_invalid_operation (), return -1);
+
+ /* 1. Check for either operand zero. */
+ zsize = SIZ(z);
+ if (d == 0.0)
+ return (zsize != 0);
+ if (zsize == 0)
+ return -1; /* d != 0 */
+
+ /* 2. Ignore signs. */
+ zsize = ABS(zsize);
+ d = ABS(d);
+
+ /* 3. Small d, knowing abs(z) >= 1. */
+ if (d < 1.0)
+ return 1;
+
+ dexp = __gmp_extract_double (darray, d);
+ ASSERT (dexp >= 1);
+
+ /* 4. Check for different high limb positions. */
+ if (zsize != dexp)
+ return (zsize >= dexp ? 1 : -1);
+
+ /* 5. Limb data. */
+ zp = PTR(z);
+
+#if LIMBS_PER_DOUBLE == 2
+ RETURN_CMP (zp[zsize-1], darray[1]);
+ if (zsize == 1)
+ return (darray[0] != 0 ? -1 : 0);
+
+ RETURN_CMP (zp[zsize-2], darray[0]);
+ RETURN_NONZERO (zp, zsize-2, 1);
+#endif
+
+#if LIMBS_PER_DOUBLE == 3
+ RETURN_CMP (zp[zsize-1], darray[2]);
+ if (zsize == 1)
+ return ((darray[0] | darray[1]) != 0 ? -1 : 0);
+
+ RETURN_CMP (zp[zsize-2], darray[1]);
+ if (zsize == 2)
+ return (darray[0] != 0 ? -1 : 0);
+
+ RETURN_CMP (zp[zsize-3], darray[0]);
+ RETURN_NONZERO (zp, zsize-3, 1);
+#endif
+
+#if LIMBS_PER_DOUBLE >= 4
+ {
+ int i;
+ for (i = 1; i <= LIMBS_PER_DOUBLE; i++)
+ {
+ RETURN_CMP (zp[zsize-i], darray[LIMBS_PER_DOUBLE-i]);
+ if (i >= zsize)
+ RETURN_NONZERO (darray, LIMBS_PER_DOUBLE-i, -1);
+ }
+ RETURN_NONZERO (zp, zsize-LIMBS_PER_DOUBLE, 1);
+ }
+#endif
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpz/cmpabs_ui.c b/Build/source/libs/gmp/gmp-6.0.0/mpz/cmpabs_ui.c
new file mode 100644
index 00000000000..fdeb061945d
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpz/cmpabs_ui.c
@@ -0,0 +1,77 @@
+/* mpz_cmpabs_ui.c -- Compare a mpz_t a with an mp_limb_t b. Return positive,
+ zero, or negative based on if a > b, a == b, or a < b.
+
+Copyright 1991, 1993-1995, 1997, 2000-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/. */
+
+#include "gmp.h"
+#include "gmp-impl.h"
+
+int
+mpz_cmpabs_ui (mpz_srcptr u, unsigned long int v_digit) __GMP_NOTHROW
+{
+ mp_ptr up;
+ mp_size_t un;
+ mp_limb_t ul;
+
+ up = PTR(u);
+ un = SIZ(u);
+
+ if (un == 0)
+ return -(v_digit != 0);
+
+ un = ABS (un);
+
+ if (un == 1)
+ {
+ ul = up[0];
+ if (ul > v_digit)
+ return 1;
+ if (ul < v_digit)
+ return -1;
+ return 0;
+ }
+
+#if GMP_NAIL_BITS != 0
+ if (v_digit > GMP_NUMB_MAX)
+ {
+ if (un == 2)
+ {
+ ul = up[0] + (up[1] << GMP_NUMB_BITS);
+
+ if (ul > v_digit)
+ return 1;
+ if (ul < v_digit)
+ return -1;
+ return 0;
+ }
+ }
+#endif
+
+ return 1;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpz/com.c b/Build/source/libs/gmp/gmp-6.0.0/mpz/com.c
new file mode 100644
index 00000000000..66d69ce8b24
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpz/com.c
@@ -0,0 +1,88 @@
+/* mpz_com(mpz_ptr dst, mpz_ptr src) -- Assign the bit-complemented value of
+ SRC to DST.
+
+Copyright 1991, 1993, 1994, 1996, 2001, 2003, 2012 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.h"
+#include "gmp-impl.h"
+
+void
+mpz_com (mpz_ptr dst, mpz_srcptr src)
+{
+ mp_size_t size = SIZ (src);
+ mp_srcptr src_ptr;
+ mp_ptr dst_ptr;
+
+ if (size >= 0)
+ {
+ /* As with infinite precision: one's complement, two's complement.
+ But this can be simplified using the identity -x = ~x + 1.
+ So we're going to compute (~~x) + 1 = x + 1! */
+
+ if (UNLIKELY (size == 0))
+ {
+ /* special case, as mpn_add_1 wants size!=0 */
+ PTR (dst)[0] = 1;
+ SIZ (dst) = -1;
+ }
+ else
+ {
+ mp_limb_t cy;
+
+ dst_ptr = MPZ_REALLOC (dst, size + 1);
+
+ src_ptr = PTR (src);
+
+ cy = mpn_add_1 (dst_ptr, src_ptr, size, (mp_limb_t) 1);
+ dst_ptr[size] = cy;
+ size += cy;
+
+ /* Store a negative size, to indicate ones-extension. */
+ SIZ (dst) = -size;
+ }
+ }
+ else
+ {
+ /* As with infinite precision: two's complement, then one's complement.
+ But that can be simplified using the identity -x = ~(x - 1).
+ So we're going to compute ~~(x - 1) = x - 1! */
+ size = -size;
+
+ dst_ptr = MPZ_REALLOC (dst, size);
+
+ src_ptr = PTR (src);
+
+ mpn_sub_1 (dst_ptr, src_ptr, size, (mp_limb_t) 1);
+ size -= dst_ptr[size - 1] == 0;
+
+ /* Store a positive size, to indicate zero-extension. */
+ SIZ (dst) = size;
+ }
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpz/combit.c b/Build/source/libs/gmp/gmp-6.0.0/mpz/combit.c
new file mode 100644
index 00000000000..85ea4c8b26c
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpz/combit.c
@@ -0,0 +1,103 @@
+/* mpz_combit -- complement a specified bit.
+
+Copyright 2002, 2003, 2012 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.h"
+#include "gmp-impl.h"
+
+void
+mpz_combit (mpz_ptr d, mp_bitcnt_t bit_index)
+{
+ mp_size_t dsize = SIZ(d);
+ mp_ptr dp = PTR(d);
+
+ mp_size_t limb_index = bit_index / GMP_NUMB_BITS;
+ mp_limb_t bit = (CNST_LIMB (1) << (bit_index % GMP_NUMB_BITS));
+
+ /* Check for the most common case: Positive input, no realloc or
+ normalization needed. */
+ if (limb_index + 1 < dsize)
+ dp[limb_index] ^= bit;
+
+ /* Check for the hairy case. d < 0, and we have all zero bits to the
+ right of the bit to toggle. */
+ else if (limb_index < -dsize && mpn_zero_p (dp, limb_index)
+ && (dp[limb_index] & (bit - 1)) == 0)
+ {
+ ASSERT (dsize < 0);
+ dsize = -dsize;
+
+ if (dp[limb_index] & bit)
+ {
+ /* We toggle the least significant one bit. Corresponds to
+ an add, with potential carry propagation, on the absolute
+ value. */
+ dp = MPZ_REALLOC (d, 1 + dsize);
+ dp[dsize] = 0;
+ MPN_INCR_U (dp + limb_index, 1 + dsize - limb_index, bit);
+ SIZ(d) = - dsize - dp[dsize];
+ }
+ else
+ {
+ /* We toggle a zero bit, subtract from the absolute value. */
+ MPN_DECR_U (dp + limb_index, dsize - limb_index, bit);
+ /* The absolute value shrinked by at most one bit. */
+ dsize -= dp[dsize - 1] == 0;
+ ASSERT (dsize > 0 && dp[dsize - 1] != 0);
+ SIZ (d) = -dsize;
+ }
+ }
+ else
+ {
+ /* Simple case: Toggle the bit in the absolute value. */
+ dsize = ABS(dsize);
+ if (limb_index < dsize)
+ {
+ mp_limb_t dlimb;
+ dlimb = dp[limb_index] ^ bit;
+ dp[limb_index] = dlimb;
+
+ /* Can happen only when limb_index = dsize - 1. Avoid SIZ(d)
+ bookkeeping in the common case. */
+ if (UNLIKELY ((dlimb == 0) + limb_index == dsize)) /* dsize == limb_index + 1 */
+ {
+ /* high limb became zero, must normalize */
+ MPN_NORMALIZE (dp, limb_index);
+ SIZ (d) = SIZ (d) >= 0 ? limb_index : -limb_index;
+ }
+ }
+ else
+ {
+ dp = MPZ_REALLOC (d, limb_index + 1);
+ MPN_ZERO(dp + dsize, limb_index - dsize);
+ dp[limb_index++] = bit;
+ SIZ(d) = SIZ(d) >= 0 ? limb_index : -limb_index;
+ }
+ }
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpz/cong.c b/Build/source/libs/gmp/gmp-6.0.0/mpz/cong.c
new file mode 100644
index 00000000000..1855b5052ac
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpz/cong.c
@@ -0,0 +1,183 @@
+/* mpz_congruent_p -- test congruence of two mpz's.
+
+Copyright 2001, 2002, 2005 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.h"
+#include "gmp-impl.h"
+#include "longlong.h"
+
+
+/* For big divisors this code is only very slightly better than the user
+ doing a combination of mpz_sub and mpz_tdiv_r, but it's quite convenient,
+ and perhaps in the future can be improved, in similar ways to
+ mpn_divisible_p perhaps.
+
+ The csize==1 / dsize==1 special case makes mpz_congruent_p as good as
+ mpz_congruent_ui_p on relevant operands, though such a combination
+ probably doesn't occur often.
+
+ Alternatives:
+
+ If c<d then it'd work to just form a%d and compare a and c (either as
+ a==c or a+c==d depending on the signs), but the saving from avoiding the
+ abs(a-c) calculation would be small compared to the division.
+
+ Similarly if both a<d and c<d then it would work to just compare a and c
+ (a==c or a+c==d), but this isn't considered a particularly important case
+ and so isn't done for the moment.
+
+ Low zero limbs on d could be stripped and the corresponding limbs of a
+ and c tested and skipped, but doing so would introduce a borrow when a
+ and c differ in sign and have non-zero skipped limbs. It doesn't seem
+ worth the complications to do this, since low zero limbs on d should
+ occur only rarely. */
+
+int
+mpz_congruent_p (mpz_srcptr a, mpz_srcptr c, mpz_srcptr d)
+{
+ mp_size_t asize, csize, dsize, sign;
+ mp_srcptr ap, cp, dp;
+ mp_ptr xp;
+ mp_limb_t alow, clow, dlow, dmask, r;
+ int result;
+ TMP_DECL;
+
+ dsize = SIZ(d);
+ if (UNLIKELY (dsize == 0))
+ return (mpz_cmp (a, c) == 0);
+
+ dsize = ABS(dsize);
+ dp = PTR(d);
+
+ if (ABSIZ(a) < ABSIZ(c))
+ MPZ_SRCPTR_SWAP (a, c);
+
+ asize = SIZ(a);
+ csize = SIZ(c);
+ sign = (asize ^ csize);
+
+ asize = ABS(asize);
+ ap = PTR(a);
+
+ if (csize == 0)
+ return mpn_divisible_p (ap, asize, dp, dsize);
+
+ csize = ABS(csize);
+ cp = PTR(c);
+
+ alow = ap[0];
+ clow = cp[0];
+ dlow = dp[0];
+
+ /* Check a==c mod low zero bits of dlow. This might catch a few cases of
+ a!=c quickly, and it helps the csize==1 special cases below. */
+ dmask = LOW_ZEROS_MASK (dlow) & GMP_NUMB_MASK;
+ alow = (sign >= 0 ? alow : -alow);
+ if (((alow-clow) & dmask) != 0)
+ return 0;
+
+ if (csize == 1)
+ {
+ if (dsize == 1)
+ {
+ cong_1:
+ if (sign < 0)
+ NEG_MOD (clow, clow, dlow);
+
+ if (ABOVE_THRESHOLD (asize, BMOD_1_TO_MOD_1_THRESHOLD))
+ {
+ r = mpn_mod_1 (ap, asize, dlow);
+ if (clow < dlow)
+ return r == clow;
+ else
+ return r == (clow % dlow);
+ }
+
+ if ((dlow & 1) == 0)
+ {
+ /* Strip low zero bits to get odd d required by modexact. If
+ d==e*2^n then a==c mod d if and only if both a==c mod e and
+ a==c mod 2^n, the latter having been done above. */
+ unsigned twos;
+ count_trailing_zeros (twos, dlow);
+ dlow >>= twos;
+ }
+
+ r = mpn_modexact_1c_odd (ap, asize, dlow, clow);
+ return r == 0 || r == dlow;
+ }
+
+ /* dlow==0 is avoided since we don't want to bother handling extra low
+ zero bits if dsecond is even (would involve borrow if a,c differ in
+ sign and alow,clow!=0). */
+ if (dsize == 2 && dlow != 0)
+ {
+ mp_limb_t dsecond = dp[1];
+
+ if (dsecond <= dmask)
+ {
+ unsigned twos;
+ count_trailing_zeros (twos, dlow);
+ dlow = (dlow >> twos) | (dsecond << (GMP_NUMB_BITS-twos));
+ ASSERT_LIMB (dlow);
+
+ /* dlow will be odd here, so the test for it even under cong_1
+ is unnecessary, but the rest of that code is wanted. */
+ goto cong_1;
+ }
+ }
+ }
+
+ TMP_MARK;
+ xp = TMP_ALLOC_LIMBS (asize+1);
+
+ /* calculate abs(a-c) */
+ if (sign >= 0)
+ {
+ /* same signs, subtract */
+ if (asize > csize || mpn_cmp (ap, cp, asize) >= 0)
+ ASSERT_NOCARRY (mpn_sub (xp, ap, asize, cp, csize));
+ else
+ ASSERT_NOCARRY (mpn_sub_n (xp, cp, ap, asize));
+ MPN_NORMALIZE (xp, asize);
+ }
+ else
+ {
+ /* different signs, add */
+ mp_limb_t carry;
+ carry = mpn_add (xp, ap, asize, cp, csize);
+ xp[asize] = carry;
+ asize += (carry != 0);
+ }
+
+ result = mpn_divisible_p (xp, asize, dp, dsize);
+
+ TMP_FREE;
+ return result;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpz/cong_2exp.c b/Build/source/libs/gmp/gmp-6.0.0/mpz/cong_2exp.c
new file mode 100644
index 00000000000..8e78b173787
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpz/cong_2exp.c
@@ -0,0 +1,150 @@
+/* mpz_congruent_2exp_p -- test congruence of mpz mod 2^n.
+
+Copyright 2001, 2002, 2013 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.h"
+#include "gmp-impl.h"
+
+
+int
+mpz_congruent_2exp_p (mpz_srcptr a, mpz_srcptr c, mp_bitcnt_t d) __GMP_NOTHROW
+{
+ mp_size_t i, dlimbs;
+ unsigned dbits;
+ mp_ptr ap, cp;
+ mp_limb_t dmask, alimb, climb, sum;
+ mp_size_t as, cs, asize, csize;
+
+ as = SIZ(a);
+ asize = ABS(as);
+
+ cs = SIZ(c);
+ csize = ABS(cs);
+
+ if (asize < csize)
+ {
+ MPZ_SRCPTR_SWAP (a, c);
+ MP_SIZE_T_SWAP (asize, csize);
+ }
+
+ dlimbs = d / GMP_NUMB_BITS;
+ dbits = d % GMP_NUMB_BITS;
+ dmask = (CNST_LIMB(1) << dbits) - 1;
+
+ ap = PTR(a);
+ cp = PTR(c);
+
+ if (csize == 0)
+ goto a_zeros;
+
+ if ((cs ^ as) >= 0)
+ {
+ /* same signs, direct comparison */
+
+ /* a==c for limbs in common */
+ if (mpn_cmp (ap, cp, MIN (csize, dlimbs)) != 0)
+ return 0;
+
+ /* if that's all of dlimbs, then a==c for remaining bits */
+ if (csize > dlimbs)
+ return ((ap[dlimbs]-cp[dlimbs]) & dmask) == 0;
+
+ a_zeros:
+ /* a remains, need all zero bits */
+
+ /* if d covers all of a and c, then must be exactly equal */
+ if (asize <= dlimbs)
+ return asize == csize;
+
+ /* whole limbs zero */
+ for (i = csize; i < dlimbs; i++)
+ if (ap[i] != 0)
+ return 0;
+
+ /* partial limb zero */
+ return (ap[dlimbs] & dmask) == 0;
+ }
+ else
+ {
+ /* different signs, negated comparison */
+
+ /* common low zero limbs, stopping at first non-zeros, which must
+ match twos complement */
+ i = 0;
+ do
+ {
+ ASSERT (i < csize); /* always have a non-zero limb on c */
+ alimb = ap[i];
+ climb = cp[i];
+ sum = (alimb + climb) & GMP_NUMB_MASK;
+
+ if (i >= dlimbs)
+ return (sum & dmask) == 0;
+ ++i;
+
+ /* require both zero, or first non-zeros as twos-complements */
+ if (sum != 0)
+ return 0;
+ } while (alimb == 0);
+
+ /* further limbs matching as ones-complement */
+ for (; i < csize; ++i)
+ {
+ alimb = ap[i];
+ climb = cp[i];
+ sum = alimb ^ climb ^ GMP_NUMB_MASK;
+
+ if (i >= dlimbs)
+ return (sum & dmask) == 0;
+
+ if (sum != 0)
+ return 0;
+ }
+
+ /* no more c, so require all 1 bits in a */
+
+ if (asize < dlimbs)
+ return 0; /* not enough a */
+
+ /* whole limbs */
+ for ( ; i < dlimbs; i++)
+ if (ap[i] != GMP_NUMB_MAX)
+ return 0;
+
+ /* if only whole limbs, no further fetches from a */
+ if (dbits == 0)
+ return 1;
+
+ /* need enough a */
+ if (asize == dlimbs)
+ return 0;
+
+ return ((ap[dlimbs]+1) & dmask) == 0;
+ }
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpz/cong_ui.c b/Build/source/libs/gmp/gmp-6.0.0/mpz/cong_ui.c
new file mode 100644
index 00000000000..a9729d9a858
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpz/cong_ui.c
@@ -0,0 +1,116 @@
+/* mpz_congruent_ui_p -- test congruence of mpz and ulong.
+
+Copyright 2000-2002, 2012 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.h"
+#include "gmp-impl.h"
+#include "longlong.h"
+
+
+/* There's some explicit checks for c<d since it seems reasonably likely an
+ application might use that in a test.
+
+ Hopefully the compiler can generate something good for r==(c%d), though
+ if modexact is being used exclusively then that's not reached. */
+
+int
+mpz_congruent_ui_p (mpz_srcptr a, unsigned long cu, unsigned long du)
+{
+ mp_srcptr ap;
+ mp_size_t asize;
+ mp_limb_t c, d, r;
+
+ if (UNLIKELY (du == 0))
+ return (mpz_cmp_ui (a, cu) == 0);
+
+ asize = SIZ(a);
+ if (asize == 0)
+ {
+ if (cu < du)
+ return cu == 0;
+ else
+ return (cu % du) == 0;
+ }
+
+ /* For nails don't try to be clever if c or d is bigger than a limb, just
+ fake up some mpz_t's and go to the main mpz_congruent_p. */
+ if (du > GMP_NUMB_MAX || cu > GMP_NUMB_MAX)
+ {
+ mp_limb_t climbs[2], dlimbs[2];
+ mpz_t cz, dz;
+
+ ALLOC(cz) = 2;
+ PTR(cz) = climbs;
+ ALLOC(dz) = 2;
+ PTR(dz) = dlimbs;
+
+ mpz_set_ui (cz, cu);
+ mpz_set_ui (dz, du);
+ return mpz_congruent_p (a, cz, dz);
+ }
+
+ /* NEG_MOD works on limbs, so convert ulong to limb */
+ c = cu;
+ d = du;
+
+ if (asize < 0)
+ {
+ asize = -asize;
+ NEG_MOD (c, c, d);
+ }
+
+ ap = PTR (a);
+
+ if (ABOVE_THRESHOLD (asize, BMOD_1_TO_MOD_1_THRESHOLD))
+ {
+ r = mpn_mod_1 (ap, asize, d);
+ if (c < d)
+ return r == c;
+ else
+ return r == (c % d);
+ }
+
+ if ((d & 1) == 0)
+ {
+ /* Strip low zero bits to get odd d required by modexact. If
+ d==e*2^n then a==c mod d if and only if both a==c mod 2^n
+ and a==c mod e. */
+
+ unsigned twos;
+
+ if ((ap[0]-c) & LOW_ZEROS_MASK (d))
+ return 0;
+
+ count_trailing_zeros (twos, d);
+ d >>= twos;
+ }
+
+ r = mpn_modexact_1c_odd (ap, asize, d, c);
+ return r == 0 || r == d;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpz/dive_ui.c b/Build/source/libs/gmp/gmp-6.0.0/mpz/dive_ui.c
new file mode 100644
index 00000000000..8a1b5a31ff8
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpz/dive_ui.c
@@ -0,0 +1,69 @@
+/* mpz_divexact_ui -- exact division mpz by ulong.
+
+Copyright 2001, 2002, 2012 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.h"
+#include "gmp-impl.h"
+
+void
+mpz_divexact_ui (mpz_ptr dst, mpz_srcptr src, unsigned long divisor)
+{
+ mp_size_t size, abs_size;
+ mp_ptr dst_ptr;
+
+ if (UNLIKELY (divisor == 0))
+ DIVIDE_BY_ZERO;
+
+ /* For nails don't try to be clever if d is bigger than a limb, just fake
+ up an mpz_t and go to the main mpz_divexact. */
+ if (divisor > GMP_NUMB_MAX)
+ {
+ mp_limb_t dlimbs[2];
+ mpz_t dz;
+ ALLOC(dz) = 2;
+ PTR(dz) = dlimbs;
+ mpz_set_ui (dz, divisor);
+ mpz_divexact (dst, src, dz);
+ return;
+ }
+
+ size = SIZ(src);
+ if (size == 0)
+ {
+ SIZ(dst) = 0;
+ return;
+ }
+ abs_size = ABS (size);
+
+ dst_ptr = MPZ_REALLOC (dst, abs_size);
+
+ MPN_DIVREM_OR_DIVEXACT_1 (dst_ptr, PTR(src), abs_size, (mp_limb_t) divisor);
+ abs_size -= (dst_ptr[abs_size-1] == 0);
+ SIZ(dst) = (size >= 0 ? abs_size : -abs_size);
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpz/divegcd.c b/Build/source/libs/gmp/gmp-6.0.0/mpz/divegcd.c
new file mode 100644
index 00000000000..3cb181c3195
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpz/divegcd.c
@@ -0,0 +1,157 @@
+/* mpz_divexact_gcd -- exact division optimized for GCDs.
+
+ THE FUNCTIONS IN THIS FILE ARE FOR INTERNAL USE AND ARE ALMOST CERTAIN TO
+ BE SUBJECT TO INCOMPATIBLE CHANGES IN FUTURE GNU MP RELEASES.
+
+Copyright 2000, 2005, 2011, 2012 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.h"
+#include "gmp-impl.h"
+#include "longlong.h"
+
+
+/* Set q to a/d, expecting d to be from a GCD and therefore usually small.
+
+ The distribution of GCDs of random numbers can be found in Knuth volume 2
+ section 4.5.2 theorem D.
+
+ GCD chance
+ 1 60.8%
+ 2^k 20.2% (1<=k<32)
+ 3*2^k 9.0% (1<=k<32)
+ other 10.1%
+
+ Only the low limb is examined for optimizations, since GCDs bigger than
+ 2^32 (or 2^64) will occur very infrequently.
+
+ Future: This could change to an mpn_divexact_gcd, possibly partly
+ inlined, if/when the relevant mpq functions change to an mpn based
+ implementation. */
+
+
+#if GMP_NUMB_BITS % 2 == 0
+static void
+mpz_divexact_by3 (mpz_ptr q, mpz_srcptr a)
+{
+ mp_size_t size = SIZ(a);
+ mp_size_t abs_size = ABS(size);
+ mp_ptr qp;
+
+ qp = MPZ_REALLOC (q, abs_size);
+
+ mpn_bdiv_dbm1 (qp, PTR(a), abs_size, GMP_NUMB_MASK / 3);
+
+ abs_size -= (qp[abs_size-1] == 0);
+ SIZ(q) = (size>0 ? abs_size : -abs_size);
+}
+#endif
+
+#if GMP_NUMB_BITS % 4 == 0
+static void
+mpz_divexact_by5 (mpz_ptr q, mpz_srcptr a)
+{
+ mp_size_t size = SIZ(a);
+ mp_size_t abs_size = ABS(size);
+ mp_ptr qp;
+
+ qp = MPZ_REALLOC (q, abs_size);
+
+ mpn_bdiv_dbm1 (qp, PTR(a), abs_size, GMP_NUMB_MASK / 5);
+
+ abs_size -= (qp[abs_size-1] == 0);
+ SIZ(q) = (size>0 ? abs_size : -abs_size);
+}
+#endif
+
+static void
+mpz_divexact_limb (mpz_ptr q, mpz_srcptr a, mp_limb_t d)
+{
+ mp_size_t size = SIZ(a);
+ mp_size_t abs_size = ABS(size);
+ mp_ptr qp;
+
+ qp = MPZ_REALLOC (q, abs_size);
+
+ mpn_divexact_1 (qp, PTR(a), abs_size, d);
+
+ abs_size -= (qp[abs_size-1] == 0);
+ SIZ(q) = (size>0 ? abs_size : -abs_size);
+}
+
+void
+mpz_divexact_gcd (mpz_ptr q, mpz_srcptr a, mpz_srcptr d)
+{
+ ASSERT (mpz_sgn (d) > 0);
+
+ if (SIZ(a) == 0)
+ {
+ SIZ(q) = 0;
+ return;
+ }
+
+ if (SIZ(d) == 1)
+ {
+ mp_limb_t dl = PTR(d)[0];
+ int twos;
+
+ if ((dl & 1) == 0)
+ {
+ count_trailing_zeros (twos, dl);
+ dl >>= twos;
+ mpz_tdiv_q_2exp (q, a, twos);
+ a = q;
+ }
+
+ if (dl == 1)
+ {
+ if (q != a)
+ mpz_set (q, a);
+ return;
+ }
+#if GMP_NUMB_BITS % 2 == 0
+ if (dl == 3)
+ {
+ mpz_divexact_by3 (q, a);
+ return;
+ }
+#endif
+#if GMP_NUMB_BITS % 4 == 0
+ if (dl == 5)
+ {
+ mpz_divexact_by5 (q, a);
+ return;
+ }
+#endif
+
+ mpz_divexact_limb (q, a, dl);
+ return;
+ }
+
+ mpz_divexact (q, a, d);
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpz/divexact.c b/Build/source/libs/gmp/gmp-6.0.0/mpz/divexact.c
new file mode 100644
index 00000000000..e9354715299
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpz/divexact.c
@@ -0,0 +1,91 @@
+/* mpz_divexact -- finds quotient when known that quot * den == num && den != 0.
+
+Contributed to the GNU project by Niels Möller.
+
+Copyright 1991, 1993-1998, 2000-2002, 2005-2007, 2009, 2012 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.h"
+#include "gmp-impl.h"
+#include "longlong.h"
+
+void
+mpz_divexact (mpz_ptr quot, mpz_srcptr num, mpz_srcptr den)
+{
+ mp_ptr qp;
+ mp_size_t qn;
+ mp_srcptr np, dp;
+ mp_size_t nn, dn;
+ TMP_DECL;
+
+#if WANT_ASSERT
+ {
+ mpz_t rem;
+ mpz_init (rem);
+ mpz_tdiv_r (rem, num, den);
+ ASSERT (SIZ(rem) == 0);
+ mpz_clear (rem);
+ }
+#endif
+
+ nn = ABSIZ (num);
+ dn = ABSIZ (den);
+
+ if (nn < dn)
+ {
+ /* This special case avoids segfaults below when the function is
+ incorrectly called with |N| < |D|, N != 0. It also handles the
+ well-defined case N = 0. */
+ SIZ(quot) = 0;
+ return;
+ }
+
+ qn = nn - dn + 1;
+
+ TMP_MARK;
+
+ if (quot == num || quot == den)
+ qp = TMP_ALLOC_LIMBS (qn);
+ else
+ qp = MPZ_REALLOC (quot, qn);
+
+ np = PTR(num);
+ dp = PTR(den);
+
+ mpn_divexact (qp, np, nn, dp, dn);
+ MPN_NORMALIZE (qp, qn);
+
+ if (qp != PTR(quot))
+ MPN_COPY (MPZ_REALLOC (quot, qn), qp, qn);
+
+ SIZ(quot) = (SIZ(num) ^ SIZ(den)) >= 0 ? qn : -qn;
+
+ TMP_FREE;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpz/divis.c b/Build/source/libs/gmp/gmp-6.0.0/mpz/divis.c
new file mode 100644
index 00000000000..cd9d406846b
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpz/divis.c
@@ -0,0 +1,44 @@
+/* mpz_divisible_p -- mpz by mpz divisibility test
+
+Copyright 2001, 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/. */
+
+#include "gmp.h"
+#include "gmp-impl.h"
+
+int
+mpz_divisible_p (mpz_srcptr a, mpz_srcptr d)
+{
+ mp_size_t dsize = SIZ(d);
+ mp_size_t asize = SIZ(a);
+
+ if (UNLIKELY (dsize == 0))
+ return (asize == 0);
+
+ return mpn_divisible_p (PTR(a), ABS(asize), PTR(d), ABS(dsize));
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpz/divis_2exp.c b/Build/source/libs/gmp/gmp-6.0.0/mpz/divis_2exp.c
new file mode 100644
index 00000000000..db6cfa44339
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpz/divis_2exp.c
@@ -0,0 +1,61 @@
+/* mpz_divisible_2exp_p -- mpz by 2^n divisibility test
+
+Copyright 2001, 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/. */
+
+#include "gmp.h"
+#include "gmp-impl.h"
+
+
+int
+mpz_divisible_2exp_p (mpz_srcptr a, mp_bitcnt_t d) __GMP_NOTHROW
+{
+ mp_size_t i, dlimbs;
+ unsigned dbits;
+ mp_ptr ap;
+ mp_limb_t dmask;
+ mp_size_t asize;
+
+ asize = ABSIZ(a);
+ dlimbs = d / GMP_NUMB_BITS;
+
+ /* if d covers the whole of a, then only a==0 is divisible */
+ if (asize <= dlimbs)
+ return asize == 0;
+
+ /* whole limbs must be zero */
+ ap = PTR(a);
+ for (i = 0; i < dlimbs; i++)
+ if (ap[i] != 0)
+ return 0;
+
+ /* left over bits must be zero */
+ dbits = d % GMP_NUMB_BITS;
+ dmask = (CNST_LIMB(1) << dbits) - 1;
+ return (ap[dlimbs] & dmask) == 0;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpz/divis_ui.c b/Build/source/libs/gmp/gmp-6.0.0/mpz/divis_ui.c
new file mode 100644
index 00000000000..41ff5f0b84e
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpz/divis_ui.c
@@ -0,0 +1,81 @@
+/* mpz_divisible_ui_p -- mpz by ulong divisibility test.
+
+Copyright 2000-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/. */
+
+#include "gmp.h"
+#include "gmp-impl.h"
+#include "longlong.h"
+
+
+int
+mpz_divisible_ui_p (mpz_srcptr a, unsigned long d)
+{
+ mp_size_t asize;
+ mp_ptr ap;
+ unsigned twos;
+
+ asize = SIZ(a);
+ if (UNLIKELY (d == 0))
+ return (asize == 0);
+
+ if (asize == 0) /* 0 divisible by any d */
+ return 1;
+
+ /* For nails don't try to be clever if d is bigger than a limb, just fake
+ up an mpz_t and go to the main mpz_divisible_p. */
+ if (d > GMP_NUMB_MAX)
+ {
+ mp_limb_t dlimbs[2];
+ mpz_t dz;
+ ALLOC(dz) = 2;
+ PTR(dz) = dlimbs;
+ mpz_set_ui (dz, d);
+ return mpz_divisible_p (a, dz);
+ }
+
+ ap = PTR(a);
+ asize = ABS(asize); /* ignore sign of a */
+
+ if (ABOVE_THRESHOLD (asize, BMOD_1_TO_MOD_1_THRESHOLD))
+ return mpn_mod_1 (ap, asize, (mp_limb_t) d) == 0;
+
+ if (! (d & 1))
+ {
+ /* Strip low zero bits to get odd d required by modexact. If d==e*2^n
+ and a is divisible by 2^n and by e, then it's divisible by d. */
+
+ if ((ap[0] & LOW_ZEROS_MASK (d)) != 0)
+ return 0;
+
+ count_trailing_zeros (twos, (mp_limb_t) d);
+ d >>= twos;
+ }
+
+ return mpn_modexact_1_odd (ap, asize, (mp_limb_t) d) == 0;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpz/dump.c b/Build/source/libs/gmp/gmp-6.0.0/mpz/dump.c
new file mode 100644
index 00000000000..282be34db70
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpz/dump.c
@@ -0,0 +1,49 @@
+/* mpz_dump - Dump an integer to stdout.
+
+ THIS IS AN INTERNAL FUNCTION WITH A MUTABLE INTERFACE. IT IS NOT SAFE TO
+ CALL THIS FUNCTION DIRECTLY. IN FACT, IT IS ALMOST GUARANTEED THAT THIS
+ FUNCTION WILL CHANGE OR DISAPPEAR IN A FUTURE GNU MP RELEASE.
+
+
+Copyright 1999-2001 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 <string.h> /* for strlen */
+#include "gmp.h"
+#include "gmp-impl.h"
+
+void
+mpz_dump (mpz_srcptr u)
+{
+ char *str;
+
+ str = mpz_get_str (0, 10, u);
+ printf ("%s\n", str);
+ (*__gmp_free_func) (str, strlen (str) + 1);
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpz/export.c b/Build/source/libs/gmp/gmp-6.0.0/mpz/export.c
new file mode 100644
index 00000000000..bc4c4df976a
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpz/export.c
@@ -0,0 +1,190 @@
+/* mpz_export -- create word data from mpz.
+
+Copyright 2002, 2003, 2012 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> /* for NULL */
+#include "gmp.h"
+#include "gmp-impl.h"
+#include "longlong.h"
+
+
+#if HAVE_LIMB_BIG_ENDIAN
+#define HOST_ENDIAN 1
+#endif
+#if HAVE_LIMB_LITTLE_ENDIAN
+#define HOST_ENDIAN (-1)
+#endif
+#ifndef HOST_ENDIAN
+static const mp_limb_t endian_test = (CNST_LIMB(1) << (GMP_LIMB_BITS-7)) - 1;
+#define HOST_ENDIAN (* (signed char *) &endian_test)
+#endif
+
+void *
+mpz_export (void *data, size_t *countp, int order,
+ size_t size, int endian, size_t nail, mpz_srcptr z)
+{
+ mp_size_t zsize;
+ mp_srcptr zp;
+ size_t count, dummy;
+ unsigned long numb;
+ unsigned align;
+
+ ASSERT (order == 1 || order == -1);
+ ASSERT (endian == 1 || endian == 0 || endian == -1);
+ ASSERT (nail <= 8*size);
+ ASSERT (nail < 8*size || SIZ(z) == 0); /* nail < 8*size+(SIZ(z)==0) */
+
+ if (countp == NULL)
+ countp = &dummy;
+
+ zsize = SIZ(z);
+ if (zsize == 0)
+ {
+ *countp = 0;
+ return data;
+ }
+
+ zsize = ABS (zsize);
+ zp = PTR(z);
+ numb = 8*size - nail;
+ MPN_SIZEINBASE_2EXP (count, zp, zsize, numb);
+ *countp = count;
+
+ if (data == NULL)
+ data = (*__gmp_allocate_func) (count*size);
+
+ if (endian == 0)
+ endian = HOST_ENDIAN;
+
+ align = ((char *) data - (char *) NULL) % sizeof (mp_limb_t);
+
+ if (nail == GMP_NAIL_BITS)
+ {
+ if (size == sizeof (mp_limb_t) && align == 0)
+ {
+ if (order == -1 && endian == HOST_ENDIAN)
+ {
+ MPN_COPY ((mp_ptr) data, zp, (mp_size_t) count);
+ return data;
+ }
+ if (order == 1 && endian == HOST_ENDIAN)
+ {
+ MPN_REVERSE ((mp_ptr) data, zp, (mp_size_t) count);
+ return data;
+ }
+
+ if (order == -1 && endian == -HOST_ENDIAN)
+ {
+ MPN_BSWAP ((mp_ptr) data, zp, (mp_size_t) count);
+ return data;
+ }
+ if (order == 1 && endian == -HOST_ENDIAN)
+ {
+ MPN_BSWAP_REVERSE ((mp_ptr) data, zp, (mp_size_t) count);
+ return data;
+ }
+ }
+ }
+
+ {
+ mp_limb_t limb, wbitsmask;
+ size_t i, numb;
+ mp_size_t j, wbytes, woffset;
+ unsigned char *dp;
+ int lbits, wbits;
+ mp_srcptr zend;
+
+ numb = size * 8 - nail;
+
+ /* whole bytes per word */
+ wbytes = numb / 8;
+
+ /* possible partial byte */
+ wbits = numb % 8;
+ wbitsmask = (CNST_LIMB(1) << wbits) - 1;
+
+ /* offset to get to the next word */
+ woffset = (endian >= 0 ? size : - (mp_size_t) size)
+ + (order < 0 ? size : - (mp_size_t) size);
+
+ /* least significant byte */
+ dp = (unsigned char *) data
+ + (order >= 0 ? (count-1)*size : 0) + (endian >= 0 ? size-1 : 0);
+
+#define EXTRACT(N, MASK) \
+ do { \
+ if (lbits >= (N)) \
+ { \
+ *dp = limb MASK; \
+ limb >>= (N); \
+ lbits -= (N); \
+ } \
+ else \
+ { \
+ mp_limb_t newlimb; \
+ newlimb = (zp == zend ? 0 : *zp++); \
+ *dp = (limb | (newlimb << lbits)) MASK; \
+ limb = newlimb >> ((N)-lbits); \
+ lbits += GMP_NUMB_BITS - (N); \
+ } \
+ } while (0)
+
+ zend = zp + zsize;
+ lbits = 0;
+ limb = 0;
+ for (i = 0; i < count; i++)
+ {
+ for (j = 0; j < wbytes; j++)
+ {
+ EXTRACT (8, + 0);
+ dp -= endian;
+ }
+ if (wbits != 0)
+ {
+ EXTRACT (wbits, & wbitsmask);
+ dp -= endian;
+ j++;
+ }
+ for ( ; j < size; j++)
+ {
+ *dp = '\0';
+ dp -= endian;
+ }
+ dp += woffset;
+ }
+
+ ASSERT (zp == PTR(z) + ABSIZ(z));
+
+ /* low byte of word after most significant */
+ ASSERT (dp == (unsigned char *) data
+ + (order < 0 ? count*size : - (mp_size_t) size)
+ + (endian >= 0 ? (mp_size_t) size - 1 : 0));
+ }
+ return data;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpz/fac_ui.c b/Build/source/libs/gmp/gmp-6.0.0/mpz/fac_ui.c
new file mode 100644
index 00000000000..e0932272ff6
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpz/fac_ui.c
@@ -0,0 +1,108 @@
+/* mpz_fac_ui(RESULT, N) -- Set RESULT to N!.
+
+Contributed to the GNU project by Marco Bodrato.
+
+Copyright 1991, 1993-1995, 2000-2003, 2011, 2012 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.h"
+#include "gmp-impl.h"
+
+#define FACTOR_LIST_STORE(P, PR, MAX_PR, VEC, I) \
+ do { \
+ if ((PR) > (MAX_PR)) { \
+ (VEC)[(I)++] = (PR); \
+ (PR) = (P); \
+ } else \
+ (PR) *= (P); \
+ } while (0)
+
+#if TUNE_PROGRAM_BUILD
+#define FACTORS_PER_LIMB (GMP_NUMB_BITS / (LOG2C(FAC_DSC_THRESHOLD_LIMIT-1)+1))
+#else
+#define FACTORS_PER_LIMB (GMP_NUMB_BITS / (LOG2C(FAC_ODD_THRESHOLD)+1))
+#endif
+
+/* Computes n!, the factorial of n.
+ WARNING: it assumes that n fits in a limb!
+ */
+void
+mpz_fac_ui (mpz_ptr x, unsigned long n)
+{
+ static const mp_limb_t table[] = { ONE_LIMB_FACTORIAL_TABLE };
+
+ ASSERT (n <= GMP_NUMB_MAX);
+
+ if (n < numberof (table))
+ {
+ PTR (x)[0] = table[n];
+ SIZ (x) = 1;
+ }
+ else if (BELOW_THRESHOLD (n, FAC_ODD_THRESHOLD))
+ {
+ mp_limb_t prod, max_prod;
+ mp_size_t j;
+ mp_ptr factors;
+ TMP_SDECL;
+
+ TMP_SMARK;
+ factors = TMP_SALLOC_LIMBS (2 + (n - numberof (table)) / FACTORS_PER_LIMB);
+
+ factors[0] = table[numberof (table)-1];
+ j = 1;
+ prod = n;
+#if TUNE_PROGRAM_BUILD
+ max_prod = GMP_NUMB_MAX / FAC_DSC_THRESHOLD_LIMIT;
+#else
+ max_prod = GMP_NUMB_MAX / (FAC_ODD_THRESHOLD | 1);
+#endif
+ while (--n >= numberof (table))
+ FACTOR_LIST_STORE (n, prod, max_prod, factors, j);
+
+ factors[j++] = prod;
+ mpz_prodlimbs (x, factors, j);
+
+ TMP_SFREE;
+ }
+ else
+ {
+ mp_limb_t count;
+ mpz_oddfac_1 (x, n, 0);
+ if (n <= TABLE_LIMIT_2N_MINUS_POPC_2N)
+ count = __gmp_fac2cnt_table[n / 2 - 1];
+ else
+ {
+ popc_limb (count, n);
+ count = n - count;
+ }
+ mpz_mul_2exp (x, x, count);
+ }
+}
+
+#undef FACTORS_PER_LIMB
+#undef FACTOR_LIST_STORE
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpz/fdiv_q.c b/Build/source/libs/gmp/gmp-6.0.0/mpz/fdiv_q.c
new file mode 100644
index 00000000000..5713b905b2a
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpz/fdiv_q.c
@@ -0,0 +1,53 @@
+/* mpz_fdiv_q -- Division rounding the quotient towards -infinity.
+ The remainder gets the same sign as the denominator.
+
+Copyright 1994-1996, 2000, 2001, 2005, 2012 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.h"
+#include "gmp-impl.h"
+
+void
+mpz_fdiv_q (mpz_ptr quot, mpz_srcptr dividend, mpz_srcptr divisor)
+{
+ mp_size_t dividend_size = SIZ (dividend);
+ mp_size_t divisor_size = SIZ (divisor);
+ mpz_t rem;
+ TMP_DECL;
+
+ TMP_MARK;
+
+ MPZ_TMP_INIT (rem, ABS (divisor_size));
+
+ mpz_tdiv_qr (quot, rem, dividend, divisor);
+
+ if ((divisor_size ^ dividend_size) < 0 && SIZ (rem) != 0)
+ mpz_sub_ui (quot, quot, 1L);
+
+ TMP_FREE;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpz/fdiv_q_ui.c b/Build/source/libs/gmp/gmp-6.0.0/mpz/fdiv_q_ui.c
new file mode 100644
index 00000000000..7899992d049
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpz/fdiv_q_ui.c
@@ -0,0 +1,101 @@
+/* mpz_fdiv_q_ui -- Division rounding the quotient towards -infinity.
+ The remainder gets the same sign as the denominator.
+
+Copyright 1994-1996, 1999, 2001, 2002, 2004, 2012 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.h"
+#include "gmp-impl.h"
+
+unsigned long int
+mpz_fdiv_q_ui (mpz_ptr quot, mpz_srcptr dividend, unsigned long int divisor)
+{
+ mp_size_t ns, nn, qn;
+ mp_ptr np, qp;
+ mp_limb_t rl;
+
+ if (UNLIKELY (divisor == 0))
+ DIVIDE_BY_ZERO;
+
+ ns = SIZ(dividend);
+ if (ns == 0)
+ {
+ SIZ(quot) = 0;
+ return 0;
+ }
+
+ nn = ABS(ns);
+ qp = MPZ_REALLOC (quot, nn);
+ np = PTR(dividend);
+
+#if BITS_PER_ULONG > GMP_NUMB_BITS /* avoid warnings about shift amount */
+ if (divisor > GMP_NUMB_MAX)
+ {
+ mp_limb_t dp[2], rp[2];
+
+ if (nn == 1) /* tdiv_qr requirements; tested above for 0 */
+ {
+ qp[0] = 0;
+ rl = np[0];
+ qn = 1; /* a white lie, fixed below */
+ }
+ else
+ {
+ dp[0] = divisor & GMP_NUMB_MASK;
+ dp[1] = divisor >> GMP_NUMB_BITS;
+ mpn_tdiv_qr (qp, rp, (mp_size_t) 0, np, nn, dp, (mp_size_t) 2);
+ rl = rp[0] + (rp[1] << GMP_NUMB_BITS);
+ qn = nn - 2 + 1;
+ }
+
+ if (rl != 0 && ns < 0)
+ {
+ mpn_incr_u (qp, (mp_limb_t) 1);
+ rl = divisor - rl;
+ }
+
+ qn -= qp[qn - 1] == 0; qn -= qn != 0 && qp[qn - 1] == 0;
+ }
+ else
+#endif
+ {
+ rl = mpn_divrem_1 (qp, (mp_size_t) 0, np, nn, (mp_limb_t) divisor);
+
+ if (rl != 0 && ns < 0)
+ {
+ mpn_incr_u (qp, (mp_limb_t) 1);
+ rl = divisor - rl;
+ }
+
+ qn = nn - (qp[nn - 1] == 0);
+ }
+
+ SIZ(quot) = ns >= 0 ? qn : -qn;
+ return rl;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpz/fdiv_qr.c b/Build/source/libs/gmp/gmp-6.0.0/mpz/fdiv_qr.c
new file mode 100644
index 00000000000..36cfd367add
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpz/fdiv_qr.c
@@ -0,0 +1,65 @@
+/* mpz_fdiv_qr -- Division rounding the quotient towards -infinity.
+ The remainder gets the same sign as the denominator.
+
+Copyright 1994-1996, 2000, 2001, 2005, 2012 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.h"
+#include "gmp-impl.h"
+
+void
+mpz_fdiv_qr (mpz_ptr quot, mpz_ptr rem, mpz_srcptr dividend, mpz_srcptr divisor)
+{
+ mp_size_t divisor_size = SIZ (divisor);
+ mp_size_t xsize;
+ mpz_t temp_divisor; /* N.B.: lives until function returns! */
+ TMP_DECL;
+
+ TMP_MARK;
+
+ /* We need the original value of the divisor after the quotient and
+ remainder have been preliminary calculated. We have to copy it to
+ temporary space if it's the same variable as either QUOT or REM. */
+ if (quot == divisor || rem == divisor)
+ {
+ MPZ_TMP_INIT (temp_divisor, ABS (divisor_size));
+ mpz_set (temp_divisor, divisor);
+ divisor = temp_divisor;
+ }
+
+ xsize = SIZ (dividend) ^ divisor_size;;
+ mpz_tdiv_qr (quot, rem, dividend, divisor);
+
+ if (xsize < 0 && SIZ (rem) != 0)
+ {
+ mpz_sub_ui (quot, quot, 1L);
+ mpz_add (rem, rem, divisor);
+ }
+
+ TMP_FREE;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpz/fdiv_qr_ui.c b/Build/source/libs/gmp/gmp-6.0.0/mpz/fdiv_qr_ui.c
new file mode 100644
index 00000000000..c8435a423c4
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpz/fdiv_qr_ui.c
@@ -0,0 +1,118 @@
+/* mpz_fdiv_qr_ui -- Division rounding the quotient towards -infinity.
+ The remainder gets the same sign as the denominator.
+
+Copyright 1994-1996, 1999, 2001, 2002, 2004, 2012 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.h"
+#include "gmp-impl.h"
+
+unsigned long int
+mpz_fdiv_qr_ui (mpz_ptr quot, mpz_ptr rem, mpz_srcptr dividend, unsigned long int divisor)
+{
+ mp_size_t ns, nn, qn;
+ mp_ptr np, qp;
+ mp_limb_t rl;
+
+ if (UNLIKELY (divisor == 0))
+ DIVIDE_BY_ZERO;
+
+ ns = SIZ(dividend);
+ if (ns == 0)
+ {
+ SIZ(quot) = 0;
+ SIZ(rem) = 0;
+ return 0;
+ }
+
+ nn = ABS(ns);
+ qp = MPZ_REALLOC (quot, nn);
+ np = PTR(dividend);
+
+#if BITS_PER_ULONG > GMP_NUMB_BITS /* avoid warnings about shift amount */
+ if (divisor > GMP_NUMB_MAX)
+ {
+ mp_limb_t dp[2];
+ mp_ptr rp;
+ mp_size_t rn;
+
+ MPZ_REALLOC (rem, 2);
+ rp = PTR(rem);
+
+ if (nn == 1) /* tdiv_qr requirements; tested above for 0 */
+ {
+ qp[0] = 0;
+ qn = 1; /* a white lie, fixed below */
+ rl = np[0];
+ rp[0] = rl;
+ }
+ else
+ {
+ dp[0] = divisor & GMP_NUMB_MASK;
+ dp[1] = divisor >> GMP_NUMB_BITS;
+ mpn_tdiv_qr (qp, rp, (mp_size_t) 0, np, nn, dp, (mp_size_t) 2);
+ rl = rp[0] + (rp[1] << GMP_NUMB_BITS);
+ qn = nn - 2 + 1;
+ }
+
+ if (rl != 0 && ns < 0)
+ {
+ mpn_incr_u (qp, (mp_limb_t) 1);
+ rl = divisor - rl;
+ rp[0] = rl & GMP_NUMB_MASK;
+ rp[1] = rl >> GMP_NUMB_BITS;
+ }
+
+ qn -= qp[qn - 1] == 0; qn -= qn != 0 && qp[qn - 1] == 0;
+ rn = 1 + (rl > GMP_NUMB_MAX); rn -= (rp[rn - 1] == 0);
+ SIZ(rem) = rn;
+ }
+ else
+#endif
+ {
+ rl = mpn_divrem_1 (qp, (mp_size_t) 0, np, nn, (mp_limb_t) divisor);
+ if (rl == 0)
+ SIZ(rem) = 0;
+ else
+ {
+ if (ns < 0)
+ {
+ mpn_incr_u (qp, (mp_limb_t) 1);
+ rl = divisor - rl;
+ }
+
+ PTR(rem)[0] = rl;
+ SIZ(rem) = rl != 0;
+ }
+ qn = nn - (qp[nn - 1] == 0);
+ }
+
+ SIZ(quot) = ns >= 0 ? qn : -qn;
+ return rl;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpz/fdiv_r.c b/Build/source/libs/gmp/gmp-6.0.0/mpz/fdiv_r.c
new file mode 100644
index 00000000000..35f2789b14c
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpz/fdiv_r.c
@@ -0,0 +1,60 @@
+/* mpz_fdiv_r -- Division rounding the quotient towards -infinity.
+ The remainder gets the same sign as the denominator.
+
+Copyright 1994-1996, 2001, 2005, 2012 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.h"
+#include "gmp-impl.h"
+
+void
+mpz_fdiv_r (mpz_ptr rem, mpz_srcptr dividend, mpz_srcptr divisor)
+{
+ mp_size_t divisor_size = SIZ (divisor);
+ mpz_t temp_divisor; /* N.B.: lives until function returns! */
+ TMP_DECL;
+
+ TMP_MARK;
+
+ /* We need the original value of the divisor after the remainder has been
+ preliminary calculated. We have to copy it to temporary space if it's
+ the same variable as REM. */
+ if (rem == divisor)
+ {
+ MPZ_TMP_INIT (temp_divisor, ABS (divisor_size));
+ mpz_set (temp_divisor, divisor);
+ divisor = temp_divisor;
+ }
+
+ mpz_tdiv_r (rem, dividend, divisor);
+
+ if ((divisor_size ^ SIZ (dividend)) < 0 && SIZ (rem) != 0)
+ mpz_add (rem, rem, divisor);
+
+ TMP_FREE;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpz/fdiv_r_ui.c b/Build/source/libs/gmp/gmp-6.0.0/mpz/fdiv_r_ui.c
new file mode 100644
index 00000000000..98dd56c6f22
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpz/fdiv_r_ui.c
@@ -0,0 +1,108 @@
+/* mpz_fdiv_r_ui -- Division rounding the quotient towards -infinity.
+ The remainder gets the same sign as the denominator.
+
+Copyright 1994-1996, 2001, 2002, 2004, 2005, 2012 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.h"
+#include "gmp-impl.h"
+
+unsigned long int
+mpz_fdiv_r_ui (mpz_ptr rem, mpz_srcptr dividend, unsigned long int divisor)
+{
+ mp_size_t ns, nn;
+ mp_ptr np;
+ mp_limb_t rl;
+
+ if (UNLIKELY (divisor == 0))
+ DIVIDE_BY_ZERO;
+
+ ns = SIZ(dividend);
+ if (ns == 0)
+ {
+ SIZ(rem) = 0;
+ return 0;
+ }
+
+ nn = ABS(ns);
+ np = PTR(dividend);
+#if BITS_PER_ULONG > GMP_NUMB_BITS /* avoid warnings about shift amount */
+ if (divisor > GMP_NUMB_MAX)
+ {
+ mp_limb_t dp[2];
+ mp_ptr rp, qp;
+ mp_size_t rn;
+ TMP_DECL;
+
+ rp = MPZ_REALLOC (rem, 2);
+
+ if (nn == 1) /* tdiv_qr requirements; tested above for 0 */
+ {
+ rl = np[0];
+ rp[0] = rl;
+ }
+ else
+ {
+ TMP_MARK;
+ dp[0] = divisor & GMP_NUMB_MASK;
+ dp[1] = divisor >> GMP_NUMB_BITS;
+ qp = TMP_ALLOC_LIMBS (nn - 2 + 1);
+ mpn_tdiv_qr (qp, rp, (mp_size_t) 0, np, nn, dp, (mp_size_t) 2);
+ TMP_FREE;
+ rl = rp[0] + (rp[1] << GMP_NUMB_BITS);
+ }
+
+ if (rl != 0 && ns < 0)
+ {
+ rl = divisor - rl;
+ rp[0] = rl & GMP_NUMB_MASK;
+ rp[1] = rl >> GMP_NUMB_BITS;
+ }
+
+ rn = 1 + (rl > GMP_NUMB_MAX); rn -= (rp[rn - 1] == 0);
+ SIZ(rem) = rn;
+ }
+ else
+#endif
+ {
+ rl = mpn_mod_1 (np, nn, (mp_limb_t) divisor);
+ if (rl == 0)
+ SIZ(rem) = 0;
+ else
+ {
+ if (ns < 0)
+ rl = divisor - rl;
+
+ PTR(rem)[0] = rl;
+ SIZ(rem) = 1;
+ }
+ }
+
+ return rl;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpz/fdiv_ui.c b/Build/source/libs/gmp/gmp-6.0.0/mpz/fdiv_ui.c
new file mode 100644
index 00000000000..532ee2cbec5
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpz/fdiv_ui.c
@@ -0,0 +1,101 @@
+/* mpz_fdiv_ui -- Division rounding the quotient towards -infinity.
+ The remainder gets the same sign as the denominator.
+
+Copyright 1994-1996, 2001, 2002, 2004, 2005, 2012 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.h"
+#include "gmp-impl.h"
+
+unsigned long int
+mpz_fdiv_ui (mpz_srcptr dividend, unsigned long int divisor)
+{
+ mp_size_t ns, nn;
+ mp_ptr np;
+ mp_limb_t rl;
+
+ if (UNLIKELY (divisor == 0))
+ DIVIDE_BY_ZERO;
+
+ ns = SIZ(dividend);
+ if (ns == 0)
+ {
+ return 0;
+ }
+
+ nn = ABS(ns);
+ np = PTR(dividend);
+#if BITS_PER_ULONG > GMP_NUMB_BITS /* avoid warnings about shift amount */
+ if (divisor > GMP_NUMB_MAX)
+ {
+ mp_limb_t dp[2], rp[2];
+ mp_ptr qp;
+ mp_size_t rn;
+ TMP_DECL;
+
+ if (nn == 1) /* tdiv_qr requirements; tested above for 0 */
+ {
+ rl = np[0];
+ rp[0] = rl;
+ }
+ else
+ {
+ TMP_MARK;
+ dp[0] = divisor & GMP_NUMB_MASK;
+ dp[1] = divisor >> GMP_NUMB_BITS;
+ qp = TMP_ALLOC_LIMBS (nn - 2 + 1);
+ mpn_tdiv_qr (qp, rp, (mp_size_t) 0, np, nn, dp, (mp_size_t) 2);
+ TMP_FREE;
+ rl = rp[0] + (rp[1] << GMP_NUMB_BITS);
+ }
+
+ if (rl != 0 && ns < 0)
+ {
+ rl = divisor - rl;
+ rp[0] = rl & GMP_NUMB_MASK;
+ rp[1] = rl >> GMP_NUMB_BITS;
+ }
+
+ rn = 1 + (rl > GMP_NUMB_MAX); rn -= (rp[rn - 1] == 0);
+ }
+ else
+#endif
+ {
+ rl = mpn_mod_1 (np, nn, (mp_limb_t) divisor);
+ if (rl == 0)
+ ;
+ else
+ {
+ if (ns < 0)
+ rl = divisor - rl;
+ }
+ }
+
+ return rl;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpz/fib2_ui.c b/Build/source/libs/gmp/gmp-6.0.0/mpz/fib2_ui.c
new file mode 100644
index 00000000000..122db8dd519
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpz/fib2_ui.c
@@ -0,0 +1,50 @@
+/* mpz_fib2_ui -- calculate Fibonacci numbers.
+
+Copyright 2001, 2012 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.h"
+#include "gmp-impl.h"
+
+
+void
+mpz_fib2_ui (mpz_ptr fn, mpz_ptr fnsub1, unsigned long n)
+{
+ mp_ptr fp, f1p;
+ mp_size_t size;
+
+ size = MPN_FIB2_SIZE (n);
+ fp = MPZ_REALLOC (fn, size);
+ f1p = MPZ_REALLOC (fnsub1, size);
+
+ size = mpn_fib2_ui (fp, f1p, n);
+
+ SIZ(fn) = size - (n == 0);
+ SIZ(fnsub1) = size - (f1p[size-1] == 0);
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpz/fib_ui.c b/Build/source/libs/gmp/gmp-6.0.0/mpz/fib_ui.c
new file mode 100644
index 00000000000..c0f57a0dc92
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpz/fib_ui.c
@@ -0,0 +1,152 @@
+/* mpz_fib_ui -- calculate Fibonacci numbers.
+
+Copyright 2000-2002, 2005, 2012 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.h"
+#include "gmp-impl.h"
+#include "longlong.h"
+
+
+/* change to "#define TRACE(x) x" to get some traces */
+#define TRACE(x)
+
+
+/* In the F[2k+1] below for k odd, the -2 won't give a borrow from the low
+ limb because the result F[2k+1] is an F[4m+3] and such numbers are always
+ == 1, 2 or 5 mod 8, whereas an underflow would leave 6 or 7. (This is
+ the same as in mpn_fib2_ui.)
+
+ In the F[2k+1] for k even, the +2 won't give a carry out of the low limb
+ in normal circumstances. This is an F[4m+1] and we claim that F[3*2^b+1]
+ == 1 mod 2^b is the first F[4m+1] congruent to 0 or 1 mod 2^b, and hence
+ if n < 2^GMP_NUMB_BITS then F[n] cannot have a low limb of 0 or 1. No
+ proof for this claim, but it's been verified up to b==32 and has such a
+ nice pattern it must be true :-). Of interest is that F[3*2^b] == 0 mod
+ 2^(b+1) seems to hold too.
+
+ When n >= 2^GMP_NUMB_BITS, which can arise in a nails build, then the low
+ limb of F[4m+1] can certainly be 1, and an mpn_add_1 must be used. */
+
+void
+mpz_fib_ui (mpz_ptr fn, unsigned long n)
+{
+ mp_ptr fp, xp, yp;
+ mp_size_t size, xalloc;
+ unsigned long n2;
+ mp_limb_t c, c2;
+ TMP_DECL;
+
+ if (n <= FIB_TABLE_LIMIT)
+ {
+ PTR(fn)[0] = FIB_TABLE (n);
+ SIZ(fn) = (n != 0); /* F[0]==0, others are !=0 */
+ return;
+ }
+
+ n2 = n/2;
+ xalloc = MPN_FIB2_SIZE (n2) + 1;
+ fp = MPZ_REALLOC (fn, 2*xalloc+1);
+
+ TMP_MARK;
+ TMP_ALLOC_LIMBS_2 (xp,xalloc, yp,xalloc);
+ size = mpn_fib2_ui (xp, yp, n2);
+
+ TRACE (printf ("mpz_fib_ui last step n=%lu size=%ld bit=%lu\n",
+ n >> 1, size, n&1);
+ mpn_trace ("xp", xp, size);
+ mpn_trace ("yp", yp, size));
+
+ if (n & 1)
+ {
+ /* F[2k+1] = (2F[k]+F[k-1])*(2F[k]-F[k-1]) + 2*(-1)^k */
+ mp_size_t xsize, ysize;
+
+#if HAVE_NATIVE_mpn_add_n_sub_n
+ xp[size] = mpn_lshift (xp, xp, size, 1);
+ yp[size] = 0;
+ ASSERT_NOCARRY (mpn_add_n_sub_n (xp, yp, xp, yp, size+1));
+ xsize = size + (xp[size] != 0);
+ ysize = size + (yp[size] != 0);
+#else
+ c2 = mpn_lshift (fp, xp, size, 1);
+ c = c2 + mpn_add_n (xp, fp, yp, size);
+ xp[size] = c;
+ xsize = size + (c != 0);
+ c2 -= mpn_sub_n (yp, fp, yp, size);
+ yp[size] = c2;
+ ASSERT (c2 <= 1);
+ ysize = size + c2;
+#endif
+
+ size = xsize + ysize;
+ c = mpn_mul (fp, xp, xsize, yp, ysize);
+
+#if GMP_NUMB_BITS >= BITS_PER_ULONG
+ /* no overflow, see comments above */
+ ASSERT (n & 2 ? fp[0] >= 2 : fp[0] <= GMP_NUMB_MAX-2);
+ fp[0] += (n & 2 ? -CNST_LIMB(2) : CNST_LIMB(2));
+#else
+ if (n & 2)
+ {
+ ASSERT (fp[0] >= 2);
+ fp[0] -= 2;
+ }
+ else
+ {
+ ASSERT (c != GMP_NUMB_MAX); /* because it's the high of a mul */
+ c += mpn_add_1 (fp, fp, size-1, CNST_LIMB(2));
+ fp[size-1] = c;
+ }
+#endif
+ }
+ else
+ {
+ /* F[2k] = F[k]*(F[k]+2F[k-1]) */
+
+ mp_size_t xsize, ysize;
+ c = mpn_lshift (yp, yp, size, 1);
+ c += mpn_add_n (yp, yp, xp, size);
+ yp[size] = c;
+ xsize = size;
+ ysize = size + (c != 0);
+ size += ysize;
+ c = mpn_mul (fp, yp, ysize, xp, xsize);
+ }
+
+ /* one or two high zeros */
+ size -= (c == 0);
+ size -= (fp[size-1] == 0);
+ SIZ(fn) = size;
+
+ TRACE (printf ("done special, size=%ld\n", size);
+ mpn_trace ("fp ", fp, size));
+
+ TMP_FREE;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpz/fits_s.h b/Build/source/libs/gmp/gmp-6.0.0/mpz/fits_s.h
new file mode 100644
index 00000000000..e7f21d1b2bd
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpz/fits_s.h
@@ -0,0 +1,61 @@
+/* int mpz_fits_X_p (mpz_t z) -- test whether z fits signed type X.
+
+Copyright 1997, 2000-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/. */
+
+#include "gmp.h"
+#include "gmp-impl.h"
+
+
+int
+FUNCTION (mpz_srcptr z) __GMP_NOTHROW
+{
+ mp_size_t n = SIZ(z);
+ mp_ptr p = PTR(z);
+ mp_limb_t limb = p[0];
+
+ if (n == 0)
+ return 1;
+ if (n == 1)
+ return limb <= MAXIMUM;
+ if (n == -1)
+ return limb <= NEG_CAST (mp_limb_t, MINIMUM);
+#if GMP_NAIL_BITS != 0
+ {
+ if ((p[1] >> GMP_NAIL_BITS) == 0)
+ {
+ limb += p[1] << GMP_NUMB_BITS;
+ if (n == 2)
+ return limb <= MAXIMUM;
+ if (n == -2)
+ return limb <= NEG_CAST (mp_limb_t, MINIMUM);
+ }
+ }
+#endif
+ return 0;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpz/fits_sint.c b/Build/source/libs/gmp/gmp-6.0.0/mpz/fits_sint.c
new file mode 100644
index 00000000000..d548c45b0d3
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpz/fits_sint.c
@@ -0,0 +1,36 @@
+/* int mpz_fits_sint_p (mpz_t z) -- test whether z fits an int.
+
+Copyright 1997, 2000, 2001 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 FUNCTION mpz_fits_sint_p
+#define MAXIMUM INT_MAX
+#define MINIMUM INT_MIN
+
+#include "fits_s.h"
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpz/fits_slong.c b/Build/source/libs/gmp/gmp-6.0.0/mpz/fits_slong.c
new file mode 100644
index 00000000000..9306a00c0f1
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpz/fits_slong.c
@@ -0,0 +1,36 @@
+/* int mpz_fits_slong_p (mpz_t z) -- test whether z fits a long.
+
+Copyright 1997, 2000, 2001 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 FUNCTION mpz_fits_slong_p
+#define MAXIMUM LONG_MAX
+#define MINIMUM LONG_MIN
+
+#include "fits_s.h"
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpz/fits_sshort.c b/Build/source/libs/gmp/gmp-6.0.0/mpz/fits_sshort.c
new file mode 100644
index 00000000000..431d6b06ce7
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpz/fits_sshort.c
@@ -0,0 +1,36 @@
+/* int mpz_fits_sshort_p (mpz_t z) -- test whether z fits a short.
+
+Copyright 1997, 2000, 2001 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 FUNCTION mpz_fits_sshort_p
+#define MAXIMUM SHRT_MAX
+#define MINIMUM SHRT_MIN
+
+#include "fits_s.h"
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpz/fits_uint.c b/Build/source/libs/gmp/gmp-6.0.0/mpz/fits_uint.c
new file mode 100644
index 00000000000..a37e291b6ed
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpz/fits_uint.c
@@ -0,0 +1,34 @@
+/* mpz_fits_uint_p -- test whether z fits an unsigned int.
+
+Copyright 1997, 2000, 2001 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_FORCE_mpz_fits_uint_p 1
+
+#include "gmp.h"
+#include "gmp-impl.h"
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpz/fits_ulong.c b/Build/source/libs/gmp/gmp-6.0.0/mpz/fits_ulong.c
new file mode 100644
index 00000000000..fa40eb56710
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpz/fits_ulong.c
@@ -0,0 +1,34 @@
+/* mpz_fits_ulong_p -- test whether z fits an unsigned long.
+
+Copyright 1997, 2000, 2001 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_FORCE_mpz_fits_ulong_p 1
+
+#include "gmp.h"
+#include "gmp-impl.h"
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpz/fits_ushort.c b/Build/source/libs/gmp/gmp-6.0.0/mpz/fits_ushort.c
new file mode 100644
index 00000000000..7f6f907821b
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpz/fits_ushort.c
@@ -0,0 +1,34 @@
+/* mpz_fits_ushort_p -- test whether z fits an unsigned short.
+
+Copyright 1997, 2000, 2001 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_FORCE_mpz_fits_ushort_p 1
+
+#include "gmp.h"
+#include "gmp-impl.h"
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpz/gcd.c b/Build/source/libs/gmp/gmp-6.0.0/mpz/gcd.c
new file mode 100644
index 00000000000..87c6a8f17b7
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpz/gcd.c
@@ -0,0 +1,167 @@
+/* mpz/gcd.c: Calculate the greatest common divisor of two integers.
+
+Copyright 1991, 1993, 1994, 1996, 2000-2002, 2005, 2010 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.h"
+#include "gmp-impl.h"
+#include "longlong.h"
+
+
+void
+mpz_gcd (mpz_ptr g, mpz_srcptr u, mpz_srcptr v)
+{
+ unsigned long int g_zero_bits, u_zero_bits, v_zero_bits;
+ mp_size_t g_zero_limbs, u_zero_limbs, v_zero_limbs;
+ mp_ptr tp;
+ mp_ptr up;
+ mp_size_t usize;
+ mp_ptr vp;
+ mp_size_t vsize;
+ mp_size_t gsize;
+ TMP_DECL;
+
+ up = PTR(u);
+ usize = ABSIZ (u);
+ vp = PTR(v);
+ vsize = ABSIZ (v);
+ /* GCD(0, V) == V. */
+ if (usize == 0)
+ {
+ SIZ (g) = vsize;
+ if (g == v)
+ return;
+ MPZ_REALLOC (g, vsize);
+ MPN_COPY (PTR (g), vp, vsize);
+ return;
+ }
+
+ /* GCD(U, 0) == U. */
+ if (vsize == 0)
+ {
+ SIZ (g) = usize;
+ if (g == u)
+ return;
+ MPZ_REALLOC (g, usize);
+ MPN_COPY (PTR (g), up, usize);
+ return;
+ }
+
+ if (usize == 1)
+ {
+ SIZ (g) = 1;
+ PTR (g)[0] = mpn_gcd_1 (vp, vsize, up[0]);
+ return;
+ }
+
+ if (vsize == 1)
+ {
+ SIZ(g) = 1;
+ PTR (g)[0] = mpn_gcd_1 (up, usize, vp[0]);
+ return;
+ }
+
+ TMP_MARK;
+
+ /* Eliminate low zero bits from U and V and move to temporary storage. */
+ while (*up == 0)
+ up++;
+ u_zero_limbs = up - PTR(u);
+ usize -= u_zero_limbs;
+ count_trailing_zeros (u_zero_bits, *up);
+ tp = up;
+ up = TMP_ALLOC_LIMBS (usize);
+ if (u_zero_bits != 0)
+ {
+ mpn_rshift (up, tp, usize, u_zero_bits);
+ usize -= up[usize - 1] == 0;
+ }
+ else
+ MPN_COPY (up, tp, usize);
+
+ while (*vp == 0)
+ vp++;
+ v_zero_limbs = vp - PTR (v);
+ vsize -= v_zero_limbs;
+ count_trailing_zeros (v_zero_bits, *vp);
+ tp = vp;
+ vp = TMP_ALLOC_LIMBS (vsize);
+ if (v_zero_bits != 0)
+ {
+ mpn_rshift (vp, tp, vsize, v_zero_bits);
+ vsize -= vp[vsize - 1] == 0;
+ }
+ else
+ MPN_COPY (vp, tp, vsize);
+
+ if (u_zero_limbs > v_zero_limbs)
+ {
+ g_zero_limbs = v_zero_limbs;
+ g_zero_bits = v_zero_bits;
+ }
+ else if (u_zero_limbs < v_zero_limbs)
+ {
+ g_zero_limbs = u_zero_limbs;
+ g_zero_bits = u_zero_bits;
+ }
+ else /* Equal. */
+ {
+ g_zero_limbs = u_zero_limbs;
+ g_zero_bits = MIN (u_zero_bits, v_zero_bits);
+ }
+
+ /* Call mpn_gcd. The 2nd argument must not have more bits than the 1st. */
+ vsize = (usize < vsize || (usize == vsize && up[usize-1] < vp[vsize-1]))
+ ? mpn_gcd (vp, vp, vsize, up, usize)
+ : mpn_gcd (vp, up, usize, vp, vsize);
+
+ /* Here G <-- V << (g_zero_limbs*GMP_LIMB_BITS + g_zero_bits). */
+ gsize = vsize + g_zero_limbs;
+ if (g_zero_bits != 0)
+ {
+ mp_limb_t cy_limb;
+ gsize += (vp[vsize - 1] >> (GMP_NUMB_BITS - g_zero_bits)) != 0;
+ MPZ_REALLOC (g, gsize);
+ MPN_ZERO (PTR (g), g_zero_limbs);
+
+ tp = PTR(g) + g_zero_limbs;
+ cy_limb = mpn_lshift (tp, vp, vsize, g_zero_bits);
+ if (cy_limb != 0)
+ tp[vsize] = cy_limb;
+ }
+ else
+ {
+ MPZ_REALLOC (g, gsize);
+ MPN_ZERO (PTR (g), g_zero_limbs);
+ MPN_COPY (PTR (g) + g_zero_limbs, vp, vsize);
+ }
+
+ SIZ (g) = gsize;
+ TMP_FREE;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpz/gcd_ui.c b/Build/source/libs/gmp/gmp-6.0.0/mpz/gcd_ui.c
new file mode 100644
index 00000000000..e26d03f64a9
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpz/gcd_ui.c
@@ -0,0 +1,85 @@
+/* mpz_gcd_ui -- Calculate the greatest common divisor of two integers.
+
+Copyright 1994, 1996, 1999-2004 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> /* for NULL */
+#include "gmp.h"
+#include "gmp-impl.h"
+
+unsigned long int
+mpz_gcd_ui (mpz_ptr w, mpz_srcptr u, unsigned long int v)
+{
+ mp_size_t un;
+ mp_limb_t res;
+
+#if BITS_PER_ULONG > GMP_NUMB_BITS /* avoid warnings about shift amount */
+ if (v > GMP_NUMB_MAX)
+ {
+ mpz_t vz;
+ mp_limb_t vlimbs[2];
+ vlimbs[0] = v & GMP_NUMB_MASK;
+ vlimbs[1] = v >> GMP_NUMB_BITS;
+ PTR(vz) = vlimbs;
+ SIZ(vz) = 2;
+ mpz_gcd (w, u, vz);
+ /* because v!=0 we will have w<=v hence fitting a ulong */
+ ASSERT (mpz_fits_ulong_p (w));
+ return mpz_get_ui (w);
+ }
+#endif
+
+ un = ABSIZ(u);
+
+ if (un == 0)
+ res = v;
+ else if (v == 0)
+ {
+ if (w != NULL)
+ {
+ if (u != w)
+ {
+ MPZ_REALLOC (w, un);
+ MPN_COPY (PTR(w), PTR(u), un);
+ }
+ SIZ(w) = un;
+ }
+ /* Return u if it fits a ulong, otherwise 0. */
+ res = PTR(u)[0];
+ return (un == 1 && res <= ULONG_MAX ? res : 0);
+ }
+ else
+ res = mpn_gcd_1 (PTR(u), un, (mp_limb_t) v);
+
+ if (w != NULL)
+ {
+ PTR(w)[0] = res;
+ SIZ(w) = res != 0;
+ }
+ return res;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpz/gcdext.c b/Build/source/libs/gmp/gmp-6.0.0/mpz/gcdext.c
new file mode 100644
index 00000000000..01b1f8379ae
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpz/gcdext.c
@@ -0,0 +1,124 @@
+/* mpz_gcdext(g, s, t, a, b) -- Set G to gcd(a, b), and S and T such that
+ g = as + bt.
+
+Copyright 1991, 1993-1997, 2000, 2001, 2005, 2011, 2012 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> /* for NULL */
+#include "gmp.h"
+#include "gmp-impl.h"
+
+void
+mpz_gcdext (mpz_ptr g, mpz_ptr s, mpz_ptr t, mpz_srcptr a, mpz_srcptr b)
+{
+ mp_size_t asize, bsize;
+ mp_ptr tmp_ap, tmp_bp;
+ mp_size_t gsize, ssize, tmp_ssize;
+ mp_ptr gp, tmp_gp, tmp_sp;
+ TMP_DECL;
+
+ /* mpn_gcdext requires that Usize >= Vsize. Therefore, we often
+ have to swap U and V. The computed cofactor will be the
+ "smallest" one, which is faster to produce. The wanted one will
+ be computed here; this is needed anyway when both are requested. */
+
+ asize = ABSIZ (a);
+ bsize = ABSIZ (b);
+
+ if (asize < bsize)
+ {
+ MPZ_SRCPTR_SWAP (a, b);
+ MP_SIZE_T_SWAP (asize, bsize);
+ MPZ_PTR_SWAP (s, t);
+ }
+
+ if (bsize == 0)
+ {
+ /* g = |a|, s = sgn(a), t = 0. */
+ ssize = SIZ (a) >= 0 ? (asize != 0) : -1;
+
+ gp = MPZ_REALLOC (g, asize);
+ MPN_COPY (gp, PTR (a), asize);
+ SIZ (g) = asize;
+
+ if (t != NULL)
+ SIZ (t) = 0;
+ if (s != NULL)
+ {
+ SIZ (s) = ssize;
+ PTR (s)[0] = 1;
+ }
+ return;
+ }
+
+ TMP_MARK;
+
+ TMP_ALLOC_LIMBS_2 (tmp_ap, asize, tmp_bp, bsize);
+ MPN_COPY (tmp_ap, PTR (a), asize);
+ MPN_COPY (tmp_bp, PTR (b), bsize);
+
+ TMP_ALLOC_LIMBS_2 (tmp_gp, bsize, tmp_sp, bsize + 1);
+
+ gsize = mpn_gcdext (tmp_gp, tmp_sp, &tmp_ssize, tmp_ap, asize, tmp_bp, bsize);
+
+ ssize = ABS (tmp_ssize);
+ tmp_ssize = SIZ (a) >= 0 ? tmp_ssize : -tmp_ssize;
+
+ if (t != NULL)
+ {
+ mpz_t x;
+ __mpz_struct gtmp, stmp;
+
+ PTR (&gtmp) = tmp_gp;
+ SIZ (&gtmp) = gsize;
+
+ PTR (&stmp) = tmp_sp;
+ SIZ (&stmp) = tmp_ssize;
+
+ MPZ_TMP_INIT (x, ssize + asize + 1);
+ mpz_mul (x, &stmp, a);
+ mpz_sub (x, &gtmp, x);
+ mpz_divexact (t, x, b);
+ }
+
+ if (s != NULL)
+ {
+ mp_ptr sp;
+
+ sp = MPZ_REALLOC (s, ssize);
+ MPN_COPY (sp, tmp_sp, ssize);
+ SIZ (s) = tmp_ssize;
+ }
+
+ gp = MPZ_REALLOC (g, gsize);
+ MPN_COPY (gp, tmp_gp, gsize);
+ SIZ (g) = gsize;
+
+ TMP_FREE;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpz/get_d.c b/Build/source/libs/gmp/gmp-6.0.0/mpz/get_d.c
new file mode 100644
index 00000000000..ac653c5ba01
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpz/get_d.c
@@ -0,0 +1,44 @@
+/* double mpz_get_d (mpz_t src) -- Return the double approximation to SRC.
+
+Copyright 1996, 1997, 2000-2003 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.h"
+#include "gmp-impl.h"
+
+double
+mpz_get_d (mpz_srcptr z)
+{
+ mp_size_t size;
+
+ size = SIZ (z);
+ if (UNLIKELY (size == 0))
+ return 0.0;
+
+ return mpn_get_d (PTR (z), ABS (size), size, 0L);
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpz/get_d_2exp.c b/Build/source/libs/gmp/gmp-6.0.0/mpz/get_d_2exp.c
new file mode 100644
index 00000000000..96314851bf8
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpz/get_d_2exp.c
@@ -0,0 +1,54 @@
+/* double mpz_get_d_2exp (signed long int *exp, mpz_t src).
+
+Copyright 2001, 2003, 2004, 2012 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.h"
+#include "gmp-impl.h"
+#include "longlong.h"
+
+double
+mpz_get_d_2exp (signed long int *exp2, mpz_srcptr src)
+{
+ mp_size_t size, abs_size;
+ mp_srcptr ptr;
+ long exp;
+
+ size = SIZ(src);
+ if (UNLIKELY (size == 0))
+ {
+ *exp2 = 0;
+ return 0.0;
+ }
+
+ ptr = PTR(src);
+ abs_size = ABS(size);
+ MPN_SIZEINBASE_2EXP(exp, ptr, abs_size, 1);
+ *exp2 = exp;
+ return mpn_get_d (ptr, abs_size, size, -exp);
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpz/get_si.c b/Build/source/libs/gmp/gmp-6.0.0/mpz/get_si.c
new file mode 100644
index 00000000000..6e9752636b2
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpz/get_si.c
@@ -0,0 +1,53 @@
+/* mpz_get_si(integer) -- Return the least significant digit from INTEGER.
+
+Copyright 1991, 1993-1995, 2000-2002, 2006, 2012 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.h"
+#include "gmp-impl.h"
+
+signed long int
+mpz_get_si (mpz_srcptr z) __GMP_NOTHROW
+{
+ mp_ptr zp = PTR (z);
+ mp_size_t size = SIZ (z);
+ mp_limb_t zl = zp[0];
+
+#if GMP_NAIL_BITS != 0
+ if (ULONG_MAX > GMP_NUMB_MAX && ABS (size) >= 2)
+ zl |= zp[1] << GMP_NUMB_BITS;
+#endif
+
+ if (size > 0)
+ return zl & LONG_MAX;
+ else if (size < 0)
+ /* This expression is necessary to properly handle 0x80000000 */
+ return -1 - (long) ((zl - 1) & LONG_MAX);
+ else
+ return 0;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpz/get_str.c b/Build/source/libs/gmp/gmp-6.0.0/mpz/get_str.c
new file mode 100644
index 00000000000..08c7cd73710
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpz/get_str.c
@@ -0,0 +1,119 @@
+/* mpz_get_str (string, base, mp_src) -- Convert the multiple precision
+ number MP_SRC to a string STRING of base BASE. If STRING is NULL
+ allocate space for the result. In any case, return a pointer to the
+ result. If STRING is not NULL, the caller must ensure enough space is
+ available to store the result.
+
+Copyright 1991, 1993, 1994, 1996, 2000-2002, 2005, 2012 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 <string.h> /* for strlen */
+#include "gmp.h"
+#include "gmp-impl.h"
+#include "longlong.h"
+
+char *
+mpz_get_str (char *res_str, int base, mpz_srcptr x)
+{
+ mp_ptr xp;
+ mp_size_t x_size = SIZ (x);
+ char *return_str;
+ size_t str_size;
+ size_t alloc_size = 0;
+ const char *num_to_text;
+ int i;
+ TMP_DECL;
+
+ if (base >= 0)
+ {
+ num_to_text = "0123456789abcdefghijklmnopqrstuvwxyz";
+ if (base <= 1)
+ base = 10;
+ else if (base > 36)
+ {
+ num_to_text = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
+ if (base > 62)
+ return NULL;
+ }
+ }
+ else
+ {
+ base = -base;
+ if (base <= 1)
+ base = 10;
+ else if (base > 36)
+ return NULL;
+ num_to_text = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
+ }
+
+ /* allocate string for the user if necessary */
+ if (res_str == NULL)
+ {
+ /* digits, null terminator, possible minus sign */
+ MPN_SIZEINBASE (alloc_size, PTR(x), ABS(x_size), base);
+ alloc_size += 1 + (x_size<0);
+ res_str = (char *) (*__gmp_allocate_func) (alloc_size);
+ }
+ return_str = res_str;
+
+ if (x_size < 0)
+ {
+ *res_str++ = '-';
+ x_size = -x_size;
+ }
+
+ /* mpn_get_str clobbers its input on non power-of-2 bases */
+ TMP_MARK;
+ xp = PTR (x);
+ if (! POW2_P (base))
+ {
+ xp = TMP_ALLOC_LIMBS (x_size | 1); /* |1 in case x_size==0 */
+ MPN_COPY (xp, PTR (x), x_size);
+ }
+
+ str_size = mpn_get_str ((unsigned char *) res_str, base, xp, x_size);
+ ASSERT (alloc_size == 0 || str_size <= alloc_size - (SIZ(x) < 0));
+
+ /* Convert result to printable chars. */
+ for (i = 0; i < str_size; i++)
+ res_str[i] = num_to_text[(int) res_str[i]];
+ res_str[str_size] = 0;
+
+ TMP_FREE;
+
+ /* if allocated then resize down to the actual space required */
+ if (alloc_size != 0)
+ {
+ size_t actual_size = str_size + 1 + (res_str - return_str);
+ ASSERT (actual_size == strlen (return_str) + 1);
+ __GMP_REALLOCATE_FUNC_MAYBE_TYPE (return_str, alloc_size, actual_size,
+ char);
+ }
+ return return_str;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpz/get_ui.c b/Build/source/libs/gmp/gmp-6.0.0/mpz/get_ui.c
new file mode 100644
index 00000000000..ca97788b745
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpz/get_ui.c
@@ -0,0 +1,34 @@
+/* mpz_get_ui(integer) -- Return the least significant digit from INTEGER.
+
+Copyright 1991, 1993-1995, 2001 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_FORCE_mpz_get_ui 1
+
+#include "gmp.h"
+#include "gmp-impl.h"
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpz/getlimbn.c b/Build/source/libs/gmp/gmp-6.0.0/mpz/getlimbn.c
new file mode 100644
index 00000000000..c531f7e61f6
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpz/getlimbn.c
@@ -0,0 +1,34 @@
+/* mpz_getlimbn(integer,n) -- Return the N:th limb from INTEGER.
+
+Copyright 1993-1996, 2001 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_FORCE_mpz_getlimbn 1
+
+#include "gmp.h"
+#include "gmp-impl.h"
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpz/hamdist.c b/Build/source/libs/gmp/gmp-6.0.0/mpz/hamdist.c
new file mode 100644
index 00000000000..146769c3945
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpz/hamdist.c
@@ -0,0 +1,175 @@
+/* mpz_hamdist -- calculate hamming distance.
+
+Copyright 1994, 1996, 2001, 2002, 2009-2011 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.h"
+#include "gmp-impl.h"
+
+
+mp_bitcnt_t
+mpz_hamdist (mpz_srcptr u, mpz_srcptr v) __GMP_NOTHROW
+{
+ mp_srcptr up, vp;
+ mp_size_t usize, vsize;
+ mp_bitcnt_t count;
+
+ usize = SIZ(u);
+ vsize = SIZ(v);
+
+ up = PTR(u);
+ vp = PTR(v);
+
+ if (usize >= 0)
+ {
+ if (vsize < 0)
+ return ~ (mp_bitcnt_t) 0;
+
+ /* positive/positive */
+
+ if (usize < vsize)
+ MPN_SRCPTR_SWAP (up,usize, vp,vsize);
+
+ count = 0;
+ if (vsize != 0)
+ count = mpn_hamdist (up, vp, vsize);
+
+ usize -= vsize;
+ if (usize != 0)
+ count += mpn_popcount (up + vsize, usize);
+
+ return count;
+ }
+ else
+ {
+ mp_limb_t ulimb, vlimb;
+ mp_size_t old_vsize, step;
+
+ if (vsize >= 0)
+ return ~ (mp_bitcnt_t) 0;
+
+ /* negative/negative */
+
+ usize = -usize;
+ vsize = -vsize;
+
+ /* skip common low zeros */
+ for (;;)
+ {
+ ASSERT (usize > 0);
+ ASSERT (vsize > 0);
+
+ usize--;
+ vsize--;
+
+ ulimb = *up++;
+ vlimb = *vp++;
+
+ if (ulimb != 0)
+ break;
+
+ if (vlimb != 0)
+ {
+ MPN_SRCPTR_SWAP (up,usize, vp,vsize);
+ ulimb = vlimb;
+ vlimb = 0;
+ break;
+ }
+ }
+
+ /* twos complement first non-zero limbs (ulimb is non-zero, but vlimb
+ might be zero) */
+ ulimb = -ulimb;
+ vlimb = -vlimb;
+ popc_limb (count, (ulimb ^ vlimb) & GMP_NUMB_MASK);
+
+ if (vlimb == 0)
+ {
+ mp_bitcnt_t twoscount;
+
+ /* first non-zero of v */
+ old_vsize = vsize;
+ do
+ {
+ ASSERT (vsize > 0);
+ vsize--;
+ vlimb = *vp++;
+ }
+ while (vlimb == 0);
+
+ /* part of u corresponding to skipped v zeros */
+ step = old_vsize - vsize - 1;
+ count += step * GMP_NUMB_BITS;
+ step = MIN (step, usize);
+ if (step != 0)
+ {
+ count -= mpn_popcount (up, step);
+ usize -= step;
+ up += step;
+ }
+
+ /* First non-zero vlimb as twos complement, xor with ones
+ complement ulimb. Note -v^(~0^u) == (v-1)^u. */
+ vlimb--;
+ if (usize != 0)
+ {
+ usize--;
+ vlimb ^= *up++;
+ }
+ popc_limb (twoscount, vlimb);
+ count += twoscount;
+ }
+
+ /* Overlapping part of u and v, if any. Ones complement both, so just
+ plain hamdist. */
+ step = MIN (usize, vsize);
+ if (step != 0)
+ {
+ count += mpn_hamdist (up, vp, step);
+ usize -= step;
+ vsize -= step;
+ up += step;
+ vp += step;
+ }
+
+ /* Remaining high part of u or v, if any, ones complement but xor
+ against all ones in the other, so plain popcount. */
+ if (usize != 0)
+ {
+ remaining:
+ count += mpn_popcount (up, usize);
+ }
+ else if (vsize != 0)
+ {
+ up = vp;
+ usize = vsize;
+ goto remaining;
+ }
+ return count;
+ }
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpz/import.c b/Build/source/libs/gmp/gmp-6.0.0/mpz/import.c
new file mode 100644
index 00000000000..9072830afee
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpz/import.c
@@ -0,0 +1,180 @@
+/* mpz_import -- set mpz from word data.
+
+Copyright 2002, 2012 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.h"
+#include "gmp-impl.h"
+
+
+
+#if HAVE_LIMB_BIG_ENDIAN
+#define HOST_ENDIAN 1
+#endif
+#if HAVE_LIMB_LITTLE_ENDIAN
+#define HOST_ENDIAN (-1)
+#endif
+#ifndef HOST_ENDIAN
+static const mp_limb_t endian_test = (CNST_LIMB(1) << (GMP_LIMB_BITS-7)) - 1;
+#define HOST_ENDIAN (* (signed char *) &endian_test)
+#endif
+
+
+void
+mpz_import (mpz_ptr z, size_t count, int order,
+ size_t size, int endian, size_t nail, const void *data)
+{
+ mp_size_t zsize;
+ mp_ptr zp;
+
+ ASSERT (order == 1 || order == -1);
+ ASSERT (endian == 1 || endian == 0 || endian == -1);
+ ASSERT (nail <= 8*size);
+
+ zsize = BITS_TO_LIMBS (count * (8*size - nail));
+ zp = MPZ_NEWALLOC (z, zsize);
+
+ if (endian == 0)
+ endian = HOST_ENDIAN;
+
+ /* Can't use these special cases with nails currently, since they don't
+ mask out the nail bits in the input data. */
+ if (nail == 0 && GMP_NAIL_BITS == 0)
+ {
+ unsigned align = ((char *) data - (char *) NULL) % sizeof (mp_limb_t);
+
+ if (order == -1
+ && size == sizeof (mp_limb_t)
+ && endian == HOST_ENDIAN
+ && align == 0)
+ {
+ MPN_COPY (zp, (mp_srcptr) data, (mp_size_t) count);
+ goto done;
+ }
+
+ if (order == -1
+ && size == sizeof (mp_limb_t)
+ && endian == - HOST_ENDIAN
+ && align == 0)
+ {
+ MPN_BSWAP (zp, (mp_srcptr) data, (mp_size_t) count);
+ goto done;
+ }
+
+ if (order == 1
+ && size == sizeof (mp_limb_t)
+ && endian == HOST_ENDIAN
+ && align == 0)
+ {
+ MPN_REVERSE (zp, (mp_srcptr) data, (mp_size_t) count);
+ goto done;
+ }
+ }
+
+ {
+ mp_limb_t limb, byte, wbitsmask;
+ size_t i, j, numb, wbytes;
+ mp_size_t woffset;
+ unsigned char *dp;
+ int lbits, wbits;
+
+ numb = size * 8 - nail;
+
+ /* whole bytes to process */
+ wbytes = numb / 8;
+
+ /* partial byte to process */
+ wbits = numb % 8;
+ wbitsmask = (CNST_LIMB(1) << wbits) - 1;
+
+ /* offset to get to the next word after processing wbytes and wbits */
+ woffset = (numb + 7) / 8;
+ woffset = (endian >= 0 ? woffset : -woffset)
+ + (order < 0 ? size : - (mp_size_t) size);
+
+ /* least significant byte */
+ dp = (unsigned char *) data
+ + (order >= 0 ? (count-1)*size : 0) + (endian >= 0 ? size-1 : 0);
+
+#define ACCUMULATE(N) \
+ do { \
+ ASSERT (lbits < GMP_NUMB_BITS); \
+ ASSERT (limb <= (CNST_LIMB(1) << lbits) - 1); \
+ \
+ limb |= (mp_limb_t) byte << lbits; \
+ lbits += (N); \
+ if (lbits >= GMP_NUMB_BITS) \
+ { \
+ *zp++ = limb & GMP_NUMB_MASK; \
+ lbits -= GMP_NUMB_BITS; \
+ ASSERT (lbits < (N)); \
+ limb = byte >> ((N) - lbits); \
+ } \
+ } while (0)
+
+ limb = 0;
+ lbits = 0;
+ for (i = 0; i < count; i++)
+ {
+ for (j = 0; j < wbytes; j++)
+ {
+ byte = *dp;
+ dp -= endian;
+ ACCUMULATE (8);
+ }
+ if (wbits != 0)
+ {
+ byte = *dp & wbitsmask;
+ dp -= endian;
+ ACCUMULATE (wbits);
+ }
+ dp += woffset;
+ }
+
+ if (lbits != 0)
+ {
+ ASSERT (lbits <= GMP_NUMB_BITS);
+ ASSERT_LIMB (limb);
+ *zp++ = limb;
+ }
+
+ ASSERT (zp == PTR(z) + zsize);
+
+ /* low byte of word after most significant */
+ ASSERT (dp == (unsigned char *) data
+ + (order < 0 ? count*size : - (mp_size_t) size)
+ + (endian >= 0 ? (mp_size_t) size - 1 : 0));
+
+ }
+
+ done:
+ zp = PTR(z);
+ MPN_NORMALIZE (zp, zsize);
+ SIZ(z) = zsize;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpz/init.c b/Build/source/libs/gmp/gmp-6.0.0/mpz/init.c
new file mode 100644
index 00000000000..09df9df5c86
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpz/init.c
@@ -0,0 +1,45 @@
+/* mpz_init() -- Make a new multiple precision number with value 0.
+
+Copyright 1991, 1993-1995, 2000-2002, 2012 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.h"
+#include "gmp-impl.h"
+
+void
+mpz_init (mpz_ptr x)
+{
+ ALLOC (x) = 1;
+ PTR (x) = (mp_ptr) (*__gmp_allocate_func) (GMP_LIMB_BYTES);
+ SIZ (x) = 0;
+
+#ifdef __CHECKER__
+ /* let the low limb look initialized, for the benefit of mpz_get_ui etc */
+ PTR (x) = 0;
+#endif
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpz/init2.c b/Build/source/libs/gmp/gmp-6.0.0/mpz/init2.c
new file mode 100644
index 00000000000..b942e499d62
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpz/init2.c
@@ -0,0 +1,61 @@
+/* mpz_init2 -- initialize mpz, with requested size in bits.
+
+Copyright 2001, 2002, 2008 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 <stdlib.h>
+#include <stdio.h>
+#include "gmp.h"
+#include "gmp-impl.h"
+
+void
+mpz_init2 (mpz_ptr x, mp_bitcnt_t bits)
+{
+ mp_size_t new_alloc;
+
+ bits -= (bits != 0); /* Round down, except if 0 */
+ new_alloc = 1 + bits / GMP_NUMB_BITS;
+
+ if (sizeof (unsigned long) > sizeof (int)) /* param vs _mp_size field */
+ {
+ if (UNLIKELY (new_alloc > INT_MAX))
+ {
+ fprintf (stderr, "gmp: overflow in mpz type\n");
+ abort ();
+ }
+ }
+
+ PTR(x) = __GMP_ALLOCATE_FUNC_LIMBS (new_alloc);
+ ALLOC(x) = new_alloc;
+ SIZ(x) = 0;
+
+#ifdef __CHECKER__
+ /* let the low limb look initialized, for the benefit of mpz_get_ui etc */
+ PTR(x)[0] = 0;
+#endif
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpz/inits.c b/Build/source/libs/gmp/gmp-6.0.0/mpz/inits.c
new file mode 100644
index 00000000000..0488edaa447
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpz/inits.c
@@ -0,0 +1,49 @@
+/* mpz_inits() -- Initialize multiple mpz_t variables and set them to 0.
+
+Copyright 2009 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 <stdarg.h>
+#include <stdio.h> /* for NULL */
+#include "gmp.h"
+#include "gmp-impl.h"
+
+void
+mpz_inits (mpz_ptr x, ...)
+{
+ va_list ap;
+
+ va_start (ap, x);
+
+ while (x != NULL)
+ {
+ mpz_init (x);
+ x = va_arg (ap, mpz_ptr);
+ }
+ va_end (ap);
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpz/inp_raw.c b/Build/source/libs/gmp/gmp-6.0.0/mpz/inp_raw.c
new file mode 100644
index 00000000000..d95c19ede72
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpz/inp_raw.c
@@ -0,0 +1,173 @@
+/* mpz_inp_raw -- read an mpz_t in raw format.
+
+Copyright 2001, 2002, 2005, 2012 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.h"
+#include "gmp-impl.h"
+
+
+/* NTOH_LIMB_FETCH fetches a limb which is in network byte order (ie. big
+ endian) and produces a normal host byte order result. */
+
+#if HAVE_LIMB_BIG_ENDIAN
+#define NTOH_LIMB_FETCH(limb, src) do { (limb) = *(src); } while (0)
+#endif
+
+#if HAVE_LIMB_LITTLE_ENDIAN
+#define NTOH_LIMB_FETCH(limb, src) BSWAP_LIMB_FETCH (limb, src)
+#endif
+
+#ifndef NTOH_LIMB_FETCH
+#define NTOH_LIMB_FETCH(limb, src) \
+ do { \
+ const unsigned char *__p = (const unsigned char *) (src); \
+ mp_limb_t __limb; \
+ int __i; \
+ __limb = 0; \
+ for (__i = 0; __i < GMP_LIMB_BYTES; __i++) \
+ __limb = (__limb << 8) | __p[__i]; \
+ (limb) = __limb; \
+ } while (0)
+#endif
+
+
+/* Enhancement: The byte swap loop ought to be safe to vectorize on Cray
+ etc, but someone who knows what they're doing needs to check it. */
+
+size_t
+mpz_inp_raw (mpz_ptr x, FILE *fp)
+{
+ unsigned char csize_bytes[4];
+ mp_size_t csize, abs_xsize, i;
+ size_t abs_csize;
+ char *cp;
+ mp_ptr xp, sp, ep;
+ mp_limb_t slimb, elimb;
+
+ if (fp == 0)
+ fp = stdin;
+
+ /* 4 bytes for size */
+ if (fread (csize_bytes, sizeof (csize_bytes), 1, fp) != 1)
+ return 0;
+
+ csize =
+ ( (mp_size_t) csize_bytes[0] << 24)
+ + ((mp_size_t) csize_bytes[1] << 16)
+ + ((mp_size_t) csize_bytes[2] << 8)
+ + ((mp_size_t) csize_bytes[3]);
+
+ /* Sign extend if necessary.
+ Could write "csize -= ((csize & 0x80000000L) << 1)", but that tickles a
+ bug in gcc 3.0 for powerpc64 on AIX. */
+ if (sizeof (csize) > 4 && csize & 0x80000000L)
+ csize -= 0x80000000L << 1;
+
+ abs_csize = ABS (csize);
+
+ /* round up to a multiple of limbs */
+ abs_xsize = BITS_TO_LIMBS (abs_csize*8);
+
+ if (abs_xsize != 0)
+ {
+ xp = MPZ_NEWALLOC (x, abs_xsize);
+
+ /* Get limb boundaries right in the read, for the benefit of the
+ non-nails case. */
+ xp[0] = 0;
+ cp = (char *) (xp + abs_xsize) - abs_csize;
+ if (fread (cp, abs_csize, 1, fp) != 1)
+ return 0;
+
+ if (GMP_NAIL_BITS == 0)
+ {
+ /* Reverse limbs to least significant first, and byte swap. If
+ abs_xsize is odd then on the last iteration elimb and slimb are
+ the same. It doesn't seem extra code to handle that case
+ separately, to save an NTOH. */
+ sp = xp;
+ ep = xp + abs_xsize-1;
+ for (i = 0; i < (abs_xsize+1)/2; i++)
+ {
+ NTOH_LIMB_FETCH (elimb, ep);
+ NTOH_LIMB_FETCH (slimb, sp);
+ *sp++ = elimb;
+ *ep-- = slimb;
+ }
+ }
+ else
+ {
+ /* It ought to be possible to do the transformation in-place, but
+ for now it's easier to use an extra temporary area. */
+ mp_limb_t byte, limb;
+ int bits;
+ mp_size_t tpos;
+ mp_ptr tp;
+ TMP_DECL;
+
+ TMP_MARK;
+ tp = TMP_ALLOC_LIMBS (abs_xsize);
+ limb = 0;
+ bits = 0;
+ tpos = 0;
+ for (i = abs_csize-1; i >= 0; i--)
+ {
+ byte = (unsigned char) cp[i];
+ limb |= (byte << bits);
+ bits += 8;
+ if (bits >= GMP_NUMB_BITS)
+ {
+ ASSERT (tpos < abs_xsize);
+ tp[tpos++] = limb & GMP_NUMB_MASK;
+ bits -= GMP_NUMB_BITS;
+ ASSERT (bits < 8);
+ limb = byte >> (8 - bits);
+ }
+ }
+ if (bits != 0)
+ {
+ ASSERT (tpos < abs_xsize);
+ tp[tpos++] = limb;
+ }
+ ASSERT (tpos == abs_xsize);
+
+ MPN_COPY (xp, tp, abs_xsize);
+ TMP_FREE;
+ }
+
+ /* GMP 1.x mpz_out_raw wrote high zero bytes, strip any high zero
+ limbs resulting from this. Should be a non-zero value here, but
+ for safety don't assume that. */
+ MPN_NORMALIZE (xp, abs_xsize);
+ }
+
+ SIZ(x) = (csize >= 0 ? abs_xsize : -abs_xsize);
+ return abs_csize + 4;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpz/inp_str.c b/Build/source/libs/gmp/gmp-6.0.0/mpz/inp_str.c
new file mode 100644
index 00000000000..474bc68435f
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpz/inp_str.c
@@ -0,0 +1,174 @@
+/* mpz_inp_str(dest_integer, stream, base) -- Input a number in base
+ BASE from stdio stream STREAM and store the result in DEST_INTEGER.
+
+ OF THE FUNCTIONS IN THIS FILE, ONLY mpz_inp_str IS FOR EXTERNAL USE, THE
+ REST ARE INTERNALS AND ARE ALMOST CERTAIN TO BE SUBJECT TO INCOMPATIBLE
+ CHANGES OR DISAPPEAR COMPLETELY IN FUTURE GNU MP RELEASES.
+
+Copyright 1991, 1993, 1994, 1996, 1998, 2000-2003, 2011-2013 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 <ctype.h>
+#include "gmp.h"
+#include "gmp-impl.h"
+#include "longlong.h"
+
+#define digit_value_tab __gmp_digit_value_tab
+
+size_t
+mpz_inp_str (mpz_ptr x, FILE *stream, int base)
+{
+ int c;
+ size_t nread;
+
+ if (stream == 0)
+ stream = stdin;
+
+ nread = 0;
+
+ /* Skip whitespace. */
+ do
+ {
+ c = getc (stream);
+ nread++;
+ }
+ while (isspace (c));
+
+ return mpz_inp_str_nowhite (x, stream, base, c, nread);
+}
+
+/* shared by mpq_inp_str */
+size_t
+mpz_inp_str_nowhite (mpz_ptr x, FILE *stream, int base, int c, size_t nread)
+{
+ char *str;
+ size_t alloc_size, str_size;
+ int negative;
+ mp_size_t xsize;
+ const unsigned char *digit_value;
+
+ ASSERT_ALWAYS (EOF == -1); /* FIXME: handle this by adding explicit */
+ /* comparisons of c and EOF before each */
+ /* read of digit_value[]. */
+
+ digit_value = digit_value_tab;
+ if (base > 36)
+ {
+ /* For bases > 36, use the collating sequence
+ 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz. */
+ digit_value += 208;
+ if (base > 62)
+ return 0; /* too large base */
+ }
+
+ negative = 0;
+ if (c == '-')
+ {
+ negative = 1;
+ c = getc (stream);
+ nread++;
+ }
+
+ if (c == EOF || digit_value[c] >= (base == 0 ? 10 : base))
+ return 0; /* error if no digits */
+
+ /* If BASE is 0, try to find out the base by looking at the initial
+ characters. */
+ if (base == 0)
+ {
+ base = 10;
+ if (c == '0')
+ {
+ base = 8;
+ c = getc (stream);
+ nread++;
+ if (c == 'x' || c == 'X')
+ {
+ base = 16;
+ c = getc (stream);
+ nread++;
+ }
+ else if (c == 'b' || c == 'B')
+ {
+ base = 2;
+ c = getc (stream);
+ nread++;
+ }
+ }
+ }
+
+ /* Skip leading zeros. */
+ while (c == '0')
+ {
+ c = getc (stream);
+ nread++;
+ }
+
+ alloc_size = 100;
+ str = (char *) (*__gmp_allocate_func) (alloc_size);
+ str_size = 0;
+
+ while (c != EOF)
+ {
+ int dig;
+ dig = digit_value[c];
+ if (dig >= base)
+ break;
+ if (str_size >= alloc_size)
+ {
+ 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[str_size++] = dig;
+ c = getc (stream);
+ }
+ nread += str_size;
+
+ ungetc (c, stream);
+ nread--;
+
+ /* Make sure the string is not empty, mpn_set_str would fail. */
+ if (str_size == 0)
+ {
+ SIZ (x) = 0;
+ }
+ else
+ {
+ LIMBS_PER_DIGIT_IN_BASE (xsize, str_size, base);
+ MPZ_REALLOC (x, xsize);
+
+ /* Convert the byte array in base BASE to our bignum format. */
+ xsize = mpn_set_str (PTR (x), (unsigned char *) str, str_size, base);
+ SIZ (x) = negative ? -xsize : xsize;
+ }
+ (*__gmp_free_func) (str, alloc_size);
+ return nread;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpz/invert.c b/Build/source/libs/gmp/gmp-6.0.0/mpz/invert.c
new file mode 100644
index 00000000000..09cdd9a121a
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpz/invert.c
@@ -0,0 +1,73 @@
+/* mpz_invert (inv, x, n). Find multiplicative inverse of X in Z(N).
+ If X has an inverse, return non-zero and store inverse in INVERSE,
+ otherwise, return 0 and put garbage in INVERSE.
+
+Copyright 1996-2001, 2005, 2012, 2014 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.h"
+#include "gmp-impl.h"
+
+int
+mpz_invert (mpz_ptr inverse, mpz_srcptr x, mpz_srcptr n)
+{
+ mpz_t gcd, tmp;
+ mp_size_t xsize, nsize, size;
+ TMP_DECL;
+
+ xsize = ABSIZ (x);
+ nsize = ABSIZ (n);
+
+ size = MAX (xsize, nsize) + 1;
+ TMP_MARK;
+
+ MPZ_TMP_INIT (gcd, size);
+ MPZ_TMP_INIT (tmp, size);
+ mpz_gcdext (gcd, tmp, (mpz_ptr) 0, x, n);
+
+ /* If no inverse existed, return with an indication of that. */
+ if (!MPZ_EQUAL_1_P (gcd))
+ {
+ TMP_FREE;
+ return 0;
+ }
+
+ /* Make sure we return a positive inverse. */
+ if (SIZ (tmp) < 0)
+ {
+ if (SIZ (n) < 0)
+ mpz_sub (inverse, tmp, n);
+ else
+ mpz_add (inverse, tmp, n);
+ }
+ else
+ mpz_set (inverse, tmp);
+
+ TMP_FREE;
+ return 1;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpz/ior.c b/Build/source/libs/gmp/gmp-6.0.0/mpz/ior.c
new file mode 100644
index 00000000000..5c181f04c4c
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpz/ior.c
@@ -0,0 +1,230 @@
+/* mpz_ior -- Logical inclusive or.
+
+Copyright 1991, 1993, 1994, 1996, 1997, 2000, 2001, 2005, 2012, 2013 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.h"
+#include "gmp-impl.h"
+
+void
+mpz_ior (mpz_ptr res, mpz_srcptr op1, mpz_srcptr op2)
+{
+ mp_srcptr op1_ptr, op2_ptr;
+ mp_size_t op1_size, op2_size;
+ mp_ptr res_ptr;
+ mp_size_t res_size;
+ mp_size_t i;
+ TMP_DECL;
+
+ TMP_MARK;
+ op1_size = SIZ(op1);
+ op2_size = SIZ(op2);
+
+ op1_ptr = PTR(op1);
+ op2_ptr = PTR(op2);
+ res_ptr = PTR(res);
+
+ if (op1_size >= 0)
+ {
+ if (op2_size >= 0)
+ {
+ if (op1_size >= op2_size)
+ {
+ if (ALLOC(res) < op1_size)
+ {
+ res_ptr = MPZ_REALLOC (res, op1_size);
+ /* No overlapping possible: op1_ptr = PTR(op1); */
+ op2_ptr = PTR(op2);
+ }
+
+ if (res_ptr != op1_ptr)
+ MPN_COPY (res_ptr + op2_size, op1_ptr + op2_size,
+ op1_size - op2_size);
+ if (LIKELY (op2_size != 0))
+ mpn_ior_n (res_ptr, op1_ptr, op2_ptr, op2_size);
+ res_size = op1_size;
+ }
+ else
+ {
+ if (ALLOC(res) < op2_size)
+ {
+ res_ptr = MPZ_REALLOC (res, op2_size);
+ op1_ptr = PTR(op1);
+ /* No overlapping possible: op2_ptr = PTR(op2); */
+ }
+
+ if (res_ptr != op2_ptr)
+ MPN_COPY (res_ptr + op1_size, op2_ptr + op1_size,
+ op2_size - op1_size);
+ if (LIKELY (op1_size != 0))
+ mpn_ior_n (res_ptr, op1_ptr, op2_ptr, op1_size);
+ res_size = op2_size;
+ }
+
+ SIZ(res) = res_size;
+ return;
+ }
+ else /* op2_size < 0 */
+ {
+ /* Fall through to the code at the end of the function. */
+ }
+ }
+ else
+ {
+ if (op2_size < 0)
+ {
+ mp_ptr opx, opy;
+
+ /* Both operands are negative, so will be the result.
+ -((-OP1) | (-OP2)) = -(~(OP1 - 1) | ~(OP2 - 1)) =
+ = ~(~(OP1 - 1) | ~(OP2 - 1)) + 1 =
+ = ((OP1 - 1) & (OP2 - 1)) + 1 */
+
+ op1_size = -op1_size;
+ op2_size = -op2_size;
+
+ res_size = MIN (op1_size, op2_size);
+
+ /* Possible optimization: Decrease mpn_sub precision,
+ as we won't use the entire res of both. */
+ TMP_ALLOC_LIMBS_2 (opx, res_size, opy, res_size);
+ mpn_sub_1 (opx, op1_ptr, res_size, (mp_limb_t) 1);
+ op1_ptr = opx;
+
+ mpn_sub_1 (opy, op2_ptr, res_size, (mp_limb_t) 1);
+ op2_ptr = opy;
+
+ /* First loop finds the size of the result. */
+ for (i = res_size - 1; i >= 0; i--)
+ if ((op1_ptr[i] & op2_ptr[i]) != 0)
+ break;
+ res_size = i + 1;
+
+ if (res_size != 0)
+ {
+ res_ptr = MPZ_NEWALLOC (res, res_size + 1);
+
+ /* Second loop computes the real result. */
+ mpn_and_n (res_ptr, op1_ptr, op2_ptr, res_size);
+
+ res_ptr[res_size] = 0;
+ MPN_INCR_U (res_ptr, res_size + 1, 1);
+ res_size += res_ptr[res_size];
+ }
+ else
+ {
+ res_ptr[0] = 1;
+ res_size = 1;
+ }
+
+ SIZ(res) = -res_size;
+ TMP_FREE;
+ return;
+ }
+ else
+ {
+ /* We should compute -OP1 | OP2. Swap OP1 and OP2 and fall
+ through to the code that handles OP1 | -OP2. */
+ MPZ_SRCPTR_SWAP (op1, op2);
+ MPN_SRCPTR_SWAP (op1_ptr,op1_size, op2_ptr,op2_size);
+ }
+ }
+
+ {
+ mp_ptr opx;
+ mp_limb_t cy;
+ mp_size_t res_alloc;
+ mp_size_t count;
+
+ /* Operand 2 negative, so will be the result.
+ -(OP1 | (-OP2)) = -(OP1 | ~(OP2 - 1)) =
+ = ~(OP1 | ~(OP2 - 1)) + 1 =
+ = (~OP1 & (OP2 - 1)) + 1 */
+
+ op2_size = -op2_size;
+
+ res_alloc = op2_size;
+
+ opx = TMP_ALLOC_LIMBS (op2_size);
+ mpn_sub_1 (opx, op2_ptr, op2_size, (mp_limb_t) 1);
+ op2_ptr = opx;
+ op2_size -= op2_ptr[op2_size - 1] == 0;
+
+ if (ALLOC(res) < res_alloc)
+ {
+ _mpz_realloc (res, res_alloc);
+ op1_ptr = PTR(op1);
+ /* op2_ptr points to temporary space. */
+ res_ptr = PTR(res);
+ }
+
+ if (op1_size >= op2_size)
+ {
+ /* We can just ignore the part of OP1 that stretches above OP2,
+ because the result limbs are zero there. */
+
+ /* First loop finds the size of the result. */
+ for (i = op2_size - 1; i >= 0; i--)
+ if ((~op1_ptr[i] & op2_ptr[i]) != 0)
+ break;
+ res_size = i + 1;
+ count = res_size;
+ }
+ else
+ {
+ res_size = op2_size;
+
+ /* Copy the part of OP2 that stretches above OP1, to RES. */
+ MPN_COPY (res_ptr + op1_size, op2_ptr + op1_size, op2_size - op1_size);
+ count = op1_size;
+ }
+
+ if (res_size != 0)
+ {
+ /* Second loop computes the real result. */
+ if (LIKELY (count != 0))
+ mpn_andn_n (res_ptr, op2_ptr, op1_ptr, count);
+
+ cy = mpn_add_1 (res_ptr, res_ptr, res_size, (mp_limb_t) 1);
+ if (cy)
+ {
+ res_ptr[res_size] = cy;
+ res_size++;
+ }
+ }
+ else
+ {
+ res_ptr[0] = 1;
+ res_size = 1;
+ }
+
+ SIZ(res) = -res_size;
+ }
+ TMP_FREE;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpz/iset.c b/Build/source/libs/gmp/gmp-6.0.0/mpz/iset.c
new file mode 100644
index 00000000000..b6fbf490fdb
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpz/iset.c
@@ -0,0 +1,59 @@
+/* mpz_init_set (src_integer) -- Make a new multiple precision number with
+ a value copied from SRC_INTEGER.
+
+Copyright 1991, 1993, 1994, 1996, 2000-2002, 2012 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.h"
+#include "gmp-impl.h"
+
+void
+mpz_init_set (mpz_ptr w, mpz_srcptr u)
+{
+ mp_ptr wp, up;
+ mp_size_t usize, size;
+
+ usize = SIZ (u);
+ size = ABS (usize);
+
+ ALLOC (w) = MAX (size, 1);
+ PTR (w) = (mp_ptr) (*__gmp_allocate_func) ((size_t) ALLOC (w) * GMP_LIMB_BYTES);
+
+ wp = PTR (w);
+ up = PTR (u);
+
+ MPN_COPY (wp, up, size);
+ SIZ (w) = usize;
+
+#ifdef __CHECKER__
+ /* let the low limb look initialized, for the benefit of mpz_get_ui etc */
+ if (size == 0)
+ wp[0] = 0;
+#endif
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpz/iset_d.c b/Build/source/libs/gmp/gmp-6.0.0/mpz/iset_d.c
new file mode 100644
index 00000000000..a450abcb3e8
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpz/iset_d.c
@@ -0,0 +1,42 @@
+/* mpz_init_set_d(integer, val) -- Initialize and assign INTEGER with a double
+ value VAL.
+
+Copyright 1996, 2000, 2001, 2012 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.h"
+#include "gmp-impl.h"
+
+void
+mpz_init_set_d (mpz_ptr dest, double val)
+{
+ ALLOC (dest) = 1;
+ PTR (dest) = (mp_ptr) (*__gmp_allocate_func) (GMP_LIMB_BYTES);
+ SIZ (dest) = 0;
+ mpz_set_d (dest, val);
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpz/iset_si.c b/Build/source/libs/gmp/gmp-6.0.0/mpz/iset_si.c
new file mode 100644
index 00000000000..107577795a1
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpz/iset_si.c
@@ -0,0 +1,59 @@
+/* mpz_init_set_si(dest,val) -- Make a new multiple precision in DEST and
+ assign VAL to the new number.
+
+Copyright 1991, 1993-1995, 2000-2002, 2012 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.h"
+#include "gmp-impl.h"
+
+void
+mpz_init_set_si (mpz_ptr dest, signed long int val)
+{
+ mp_size_t size;
+ mp_limb_t vl;
+
+ ALLOC (dest) = 1;
+ PTR (dest) = (mp_ptr) (*__gmp_allocate_func) (GMP_LIMB_BYTES);
+
+ vl = (mp_limb_t) ABS_CAST (unsigned long int, val);
+
+ PTR (dest)[0] = vl & GMP_NUMB_MASK;
+ size = vl != 0;
+
+#if GMP_NAIL_BITS != 0
+ if (vl > GMP_NUMB_MAX)
+ {
+ MPZ_REALLOC (dest, 2);
+ PTR (dest)[1] = vl >> GMP_NUMB_BITS;
+ size = 2;
+ }
+#endif
+
+ SIZ (dest) = val >= 0 ? size : -size;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpz/iset_str.c b/Build/source/libs/gmp/gmp-6.0.0/mpz/iset_str.c
new file mode 100644
index 00000000000..e31742ce659
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpz/iset_str.c
@@ -0,0 +1,52 @@
+/* mpz_init_set_str(string, base) -- Convert the \0-terminated string STRING in
+ base BASE to a multiple precision integer. Allow white space in the string.
+ If BASE == 0 determine the base in the C standard way, i.e. 0xhh...h means
+ base 16, 0oo...o means base 8, otherwise assume base 10.
+
+Copyright 1991, 1993-1995, 2000-2002, 2012 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.h"
+#include "gmp-impl.h"
+
+int
+mpz_init_set_str (mpz_ptr x, const char *str, int base)
+{
+ ALLOC (x) = 1;
+ PTR (x) = (mp_ptr) (*__gmp_allocate_func) (GMP_LIMB_BYTES);
+
+ /* if str has no digits mpz_set_str leaves x->_mp_size unset */
+ SIZ (x) = 0;
+
+#ifdef __CHECKER__
+ /* let the low limb look initialized, for the benefit of mpz_get_ui etc */
+ PTR (x)[0] = 0;
+#endif
+
+ return mpz_set_str (x, str, base);
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpz/iset_ui.c b/Build/source/libs/gmp/gmp-6.0.0/mpz/iset_ui.c
new file mode 100644
index 00000000000..0d43c68411c
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpz/iset_ui.c
@@ -0,0 +1,59 @@
+/* mpz_init_set_ui(dest,val) -- Make a new multiple precision in DEST and
+ assign VAL to the new number.
+
+Copyright 1991, 1993-1995, 2000-2002, 2004, 2012 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.h"
+#include "gmp-impl.h"
+
+void
+mpz_init_set_ui (mpz_ptr dest, unsigned long int val)
+{
+ mp_size_t size;
+
+#if BITS_PER_ULONG > GMP_NUMB_BITS /* avoid warnings about shift amount */
+ if (val > GMP_NUMB_MAX)
+ {
+ ALLOC (dest) = 2;
+ PTR (dest) = (mp_ptr) (*__gmp_allocate_func) (GMP_LIMB_BYTES*2);
+ PTR (dest)[1] = val >> GMP_NUMB_BITS;
+ size = 2;
+ }
+ else
+#endif
+ {
+ ALLOC (dest) = 1;
+ PTR (dest) = (mp_ptr) (*__gmp_allocate_func) (GMP_LIMB_BYTES);
+
+ size = val != 0;
+ }
+ PTR (dest)[0] = val & GMP_NUMB_MASK;
+
+ SIZ (dest) = size;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpz/jacobi.c b/Build/source/libs/gmp/gmp-6.0.0/mpz/jacobi.c
new file mode 100644
index 00000000000..397fe11c9bb
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpz/jacobi.c
@@ -0,0 +1,211 @@
+/* mpz_jacobi, mpz_legendre, mpz_kronecker -- mpz/mpz Jacobi symbols.
+
+Copyright 2000-2002, 2005, 2010-2012 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.h"
+#include "gmp-impl.h"
+#include "longlong.h"
+
+
+/* This code does triple duty as mpz_jacobi, mpz_legendre and
+ mpz_kronecker. For ABI compatibility, the link symbol is
+ __gmpz_jacobi, not __gmpz_kronecker, even though the latter would
+ be more logical.
+
+ mpz_jacobi could assume b is odd, but the improvements from that seem
+ small compared to other operations, and anything significant should be
+ checked at run-time since we'd like odd b to go fast in mpz_kronecker
+ too.
+
+ mpz_legendre could assume b is an odd prime, but knowing this doesn't
+ present any obvious benefits. Result 0 wouldn't arise (unless "a" is a
+ multiple of b), but the checking for that takes little time compared to
+ other operations.
+
+ Enhancements:
+
+ mpn_bdiv_qr should be used instead of mpn_tdiv_qr.
+
+*/
+
+int
+mpz_jacobi (mpz_srcptr a, mpz_srcptr b)
+{
+ mp_srcptr asrcp, bsrcp;
+ mp_size_t asize, bsize;
+ mp_limb_t alow, blow;
+ mp_ptr ap, bp;
+ unsigned btwos;
+ int result_bit1;
+ int res;
+ TMP_DECL;
+
+ asize = SIZ(a);
+ asrcp = PTR(a);
+ alow = asrcp[0];
+
+ bsize = SIZ(b);
+ bsrcp = PTR(b);
+ blow = bsrcp[0];
+
+ /* The MPN jacobi functions require positive a and b, and b odd. So
+ we must to handle the cases of a or b zero, then signs, and then
+ the case of even b.
+ */
+
+ if (bsize == 0)
+ /* (a/0) = [ a = 1 or a = -1 ] */
+ return JACOBI_LS0 (alow, asize);
+
+ if (asize == 0)
+ /* (0/b) = [ b = 1 or b = - 1 ] */
+ return JACOBI_0LS (blow, bsize);
+
+ if ( (((alow | blow) & 1) == 0))
+ /* Common factor of 2 ==> (a/b) = 0 */
+ return 0;
+
+ if (bsize < 0)
+ {
+ /* (a/-1) = -1 if a < 0, +1 if a >= 0 */
+ result_bit1 = (asize < 0) << 1;
+ bsize = -bsize;
+ }
+ else
+ result_bit1 = 0;
+
+ JACOBI_STRIP_LOW_ZEROS (result_bit1, alow, bsrcp, bsize, blow);
+
+ count_trailing_zeros (btwos, blow);
+ blow >>= btwos;
+
+ if (bsize > 1 && btwos > 0)
+ {
+ mp_limb_t b1 = bsrcp[1];
+ blow |= b1 << (GMP_NUMB_BITS - btwos);
+ if (bsize == 2 && (b1 >> btwos) == 0)
+ bsize = 1;
+ }
+
+ if (asize < 0)
+ {
+ /* (-1/b) = -1 iff b = 3 (mod 4) */
+ result_bit1 ^= JACOBI_N1B_BIT1(blow);
+ asize = -asize;
+ }
+
+ JACOBI_STRIP_LOW_ZEROS (result_bit1, blow, asrcp, asize, alow);
+
+ /* Ensure asize >= bsize. Take advantage of the generalized
+ reciprocity law (a/b*2^n) = (b*2^n / a) * RECIP(a,b) */
+
+ if (asize < bsize)
+ {
+ MPN_SRCPTR_SWAP (asrcp, asize, bsrcp, bsize);
+ MP_LIMB_T_SWAP (alow, blow);
+
+ /* NOTE: The value of alow (old blow) is a bit subtle. For this code
+ path, we get alow as the low, always odd, limb of shifted A. Which is
+ what we need for the reciprocity update below.
+
+ However, all other uses of alow assumes that it is *not*
+ shifted. Luckily, alow matters only when either
+
+ + btwos > 0, in which case A is always odd
+
+ + asize == bsize == 1, in which case this code path is never
+ taken. */
+
+ count_trailing_zeros (btwos, blow);
+ blow >>= btwos;
+
+ if (bsize > 1 && btwos > 0)
+ {
+ mp_limb_t b1 = bsrcp[1];
+ blow |= b1 << (GMP_NUMB_BITS - btwos);
+ if (bsize == 2 && (b1 >> btwos) == 0)
+ bsize = 1;
+ }
+
+ result_bit1 ^= JACOBI_RECIP_UU_BIT1 (alow, blow);
+ }
+
+ if (bsize == 1)
+ {
+ result_bit1 ^= JACOBI_TWOS_U_BIT1(btwos, alow);
+
+ if (blow == 1)
+ return JACOBI_BIT1_TO_PN (result_bit1);
+
+ if (asize > 1)
+ JACOBI_MOD_OR_MODEXACT_1_ODD (result_bit1, alow, asrcp, asize, blow);
+
+ return mpn_jacobi_base (alow, blow, result_bit1);
+ }
+
+ /* Allocation strategy: For A, we allocate a working copy only for A % B, but
+ when A is much larger than B, we have to allocate space for the large
+ quotient. We use the same area, pointed to by bp, for both the quotient
+ A/B and the working copy of B. */
+
+ TMP_MARK;
+
+ if (asize >= 2*bsize)
+ TMP_ALLOC_LIMBS_2 (ap, bsize, bp, asize - bsize + 1);
+ else
+ TMP_ALLOC_LIMBS_2 (ap, bsize, bp, bsize);
+
+ /* In the case of even B, we conceptually shift out the powers of two first,
+ and then divide A mod B. Hence, when taking those powers of two into
+ account, we must use alow *before* the division. Doing the actual division
+ first is ok, because the point is to remove multiples of B from A, and
+ multiples of 2^k B are good enough. */
+ if (asize > bsize)
+ mpn_tdiv_qr (bp, ap, 0, asrcp, asize, bsrcp, bsize);
+ else
+ MPN_COPY (ap, asrcp, bsize);
+
+ if (btwos > 0)
+ {
+ result_bit1 ^= JACOBI_TWOS_U_BIT1(btwos, alow);
+
+ ASSERT_NOCARRY (mpn_rshift (bp, bsrcp, bsize, btwos));
+ bsize -= (ap[bsize-1] | bp[bsize-1]) == 0;
+ }
+ else
+ MPN_COPY (bp, bsrcp, bsize);
+
+ ASSERT (blow == bp[0]);
+ res = mpn_jacobi_n (ap, bp, bsize,
+ mpn_jacobi_init (ap[0], blow, (result_bit1>>1) & 1));
+
+ TMP_FREE;
+ return res;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpz/kronsz.c b/Build/source/libs/gmp/gmp-6.0.0/mpz/kronsz.c
new file mode 100644
index 00000000000..12c8fbd0aa1
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpz/kronsz.c
@@ -0,0 +1,138 @@
+/* mpz_si_kronecker -- long+mpz Kronecker/Jacobi symbol.
+
+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/. */
+
+#include "gmp.h"
+#include "gmp-impl.h"
+#include "longlong.h"
+
+
+int
+mpz_si_kronecker (long a, mpz_srcptr b)
+{
+ mp_srcptr b_ptr;
+ mp_limb_t b_low;
+ mp_size_t b_size;
+ mp_size_t b_abs_size;
+ mp_limb_t a_limb, b_rem;
+ unsigned twos;
+ int result_bit1;
+
+#if GMP_NUMB_BITS < BITS_PER_ULONG
+ if (a > GMP_NUMB_MAX || a < -GMP_NUMB_MAX)
+ {
+ mp_limb_t alimbs[2];
+ mpz_t az;
+ ALLOC(az) = numberof (alimbs);
+ PTR(az) = alimbs;
+ mpz_set_si (az, a);
+ return mpz_kronecker (az, b);
+ }
+#endif
+
+ b_size = SIZ (b);
+ if (b_size == 0)
+ return JACOBI_S0 (a); /* (a/0) */
+
+ /* account for the effect of the sign of b, then ignore it */
+ result_bit1 = JACOBI_BSGN_SS_BIT1 (a, b_size);
+
+ b_ptr = PTR(b);
+ b_low = b_ptr[0];
+ b_abs_size = ABS (b_size);
+
+ if ((b_low & 1) != 0)
+ {
+ /* b odd */
+
+ result_bit1 ^= JACOBI_ASGN_SU_BIT1 (a, b_low);
+ a_limb = (unsigned long) ABS(a);
+
+ if ((a_limb & 1) == 0)
+ {
+ /* (0/b)=1 for b=+/-1, 0 otherwise */
+ if (a_limb == 0)
+ return (b_abs_size == 1 && b_low == 1);
+
+ /* a even, b odd */
+ count_trailing_zeros (twos, a_limb);
+ a_limb >>= twos;
+ /* (a*2^n/b) = (a/b) * twos(n,a) */
+ result_bit1 ^= JACOBI_TWOS_U_BIT1 (twos, b_low);
+ }
+ }
+ else
+ {
+ /* (even/even)=0, and (0/b)=0 for b!=+/-1 */
+ if ((a & 1) == 0)
+ return 0;
+
+ /* a odd, b even
+
+ Establish shifted b_low with valid bit1 for ASGN and RECIP below.
+ Zero limbs stripped are accounted for, but zero bits on b_low are
+ not because they remain in {b_ptr,b_abs_size} for the
+ JACOBI_MOD_OR_MODEXACT_1_ODD. */
+
+ JACOBI_STRIP_LOW_ZEROS (result_bit1, a, b_ptr, b_abs_size, b_low);
+ if ((b_low & 1) == 0)
+ {
+ if (UNLIKELY (b_low == GMP_NUMB_HIGHBIT))
+ {
+ /* need b_ptr[1] to get bit1 in b_low */
+ if (b_abs_size == 1)
+ {
+ /* (a/0x80000000) = (a/2)^(BPML-1) */
+ if ((GMP_NUMB_BITS % 2) == 0)
+ result_bit1 ^= JACOBI_TWO_U_BIT1 (a);
+ return JACOBI_BIT1_TO_PN (result_bit1);
+ }
+
+ /* b_abs_size > 1 */
+ b_low = b_ptr[1] << 1;
+ }
+ else
+ {
+ count_trailing_zeros (twos, b_low);
+ b_low >>= twos;
+ }
+ }
+
+ result_bit1 ^= JACOBI_ASGN_SU_BIT1 (a, b_low);
+ a_limb = (unsigned long) ABS(a);
+ }
+
+ if (a_limb == 1)
+ return JACOBI_BIT1_TO_PN (result_bit1); /* (1/b)=1 */
+
+ /* (a/b*2^n) = (b*2^n mod a / a) * recip(a,b) */
+ JACOBI_MOD_OR_MODEXACT_1_ODD (result_bit1, b_rem, b_ptr, b_abs_size, a_limb);
+ result_bit1 ^= JACOBI_RECIP_UU_BIT1 (a_limb, b_low);
+ return mpn_jacobi_base (b_rem, a_limb, result_bit1);
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpz/kronuz.c b/Build/source/libs/gmp/gmp-6.0.0/mpz/kronuz.c
new file mode 100644
index 00000000000..ca88250de59
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpz/kronuz.c
@@ -0,0 +1,130 @@
+/* mpz_ui_kronecker -- ulong+mpz Kronecker/Jacobi symbol.
+
+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/. */
+
+#include "gmp.h"
+#include "gmp-impl.h"
+#include "longlong.h"
+
+
+int
+mpz_ui_kronecker (unsigned long a, mpz_srcptr b)
+{
+ mp_srcptr b_ptr;
+ mp_limb_t b_low;
+ int b_abs_size;
+ mp_limb_t b_rem;
+ int twos;
+ int result_bit1;
+
+ /* (a/-1)=1 when a>=0, so the sign of b is ignored */
+ b_abs_size = ABSIZ (b);
+
+ if (b_abs_size == 0)
+ return JACOBI_U0 (a); /* (a/0) */
+
+ if (a > GMP_NUMB_MAX)
+ {
+ mp_limb_t alimbs[2];
+ mpz_t az;
+ ALLOC(az) = numberof (alimbs);
+ PTR(az) = alimbs;
+ mpz_set_ui (az, a);
+ return mpz_kronecker (az, b);
+ }
+
+ b_ptr = PTR(b);
+ b_low = b_ptr[0];
+ result_bit1 = 0;
+
+ if (! (b_low & 1))
+ {
+ /* (0/b)=0 for b!=+/-1; and (even/even)=0 */
+ if (! (a & 1))
+ return 0;
+
+ /* a odd, b even
+
+ Establish shifted b_low with valid bit1 for the RECIP below. Zero
+ limbs stripped are accounted for, but zero bits on b_low are not
+ because they remain in {b_ptr,b_abs_size} for
+ JACOBI_MOD_OR_MODEXACT_1_ODD. */
+
+ JACOBI_STRIP_LOW_ZEROS (result_bit1, a, b_ptr, b_abs_size, b_low);
+ if (! (b_low & 1))
+ {
+ if (UNLIKELY (b_low == GMP_NUMB_HIGHBIT))
+ {
+ /* need b_ptr[1] to get bit1 in b_low */
+ if (b_abs_size == 1)
+ {
+ /* (a/0x80...00) == (a/2)^(NUMB-1) */
+ if ((GMP_NUMB_BITS % 2) == 0)
+ {
+ /* JACOBI_STRIP_LOW_ZEROS does nothing to result_bit1
+ when GMP_NUMB_BITS is even, so it's still 0. */
+ ASSERT (result_bit1 == 0);
+ result_bit1 = JACOBI_TWO_U_BIT1 (a);
+ }
+ return JACOBI_BIT1_TO_PN (result_bit1);
+ }
+
+ /* b_abs_size > 1 */
+ b_low = b_ptr[1] << 1;
+ }
+ else
+ {
+ count_trailing_zeros (twos, b_low);
+ b_low >>= twos;
+ }
+ }
+ }
+ else
+ {
+ if (a == 0) /* (0/b)=1 for b=+/-1, 0 otherwise */
+ return (b_abs_size == 1 && b_low == 1);
+
+ if (! (a & 1))
+ {
+ /* a even, b odd */
+ count_trailing_zeros (twos, a);
+ a >>= twos;
+ /* (a*2^n/b) = (a/b) * (2/a)^n */
+ result_bit1 = JACOBI_TWOS_U_BIT1 (twos, b_low);
+ }
+ }
+
+ if (a == 1)
+ return JACOBI_BIT1_TO_PN (result_bit1); /* (1/b)=1 */
+
+ /* (a/b*2^n) = (b*2^n mod a / a) * RECIP(a,b) */
+ JACOBI_MOD_OR_MODEXACT_1_ODD (result_bit1, b_rem, b_ptr, b_abs_size, a);
+ result_bit1 ^= JACOBI_RECIP_UU_BIT1 (a, b_low);
+ return mpn_jacobi_base (b_rem, (mp_limb_t) a, result_bit1);
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpz/kronzs.c b/Build/source/libs/gmp/gmp-6.0.0/mpz/kronzs.c
new file mode 100644
index 00000000000..695cd0f283e
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpz/kronzs.c
@@ -0,0 +1,93 @@
+/* mpz_kronecker_si -- mpz+long Kronecker/Jacobi symbol.
+
+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/. */
+
+#include "gmp.h"
+#include "gmp-impl.h"
+#include "longlong.h"
+
+
+/* After the absolute value of b is established it's treated as an unsigned
+ long, because 0x80..00 doesn't fit in a signed long. */
+
+int
+mpz_kronecker_si (mpz_srcptr a, long b)
+{
+ mp_srcptr a_ptr;
+ mp_size_t a_size;
+ mp_limb_t a_rem, b_limb;
+ int result_bit1;
+
+ a_size = SIZ(a);
+ if (a_size == 0)
+ return JACOBI_0S (b);
+
+#if GMP_NUMB_BITS < BITS_PER_ULONG
+ if (b > GMP_NUMB_MAX || b < -GMP_NUMB_MAX)
+ {
+ mp_limb_t blimbs[2];
+ mpz_t bz;
+ ALLOC(bz) = numberof (blimbs);
+ PTR(bz) = blimbs;
+ mpz_set_si (bz, b);
+ return mpz_kronecker (a, bz);
+ }
+#endif
+
+ result_bit1 = JACOBI_BSGN_SS_BIT1 (a_size, b);
+ b_limb = ABS_CAST (unsigned long, b);
+ a_ptr = PTR(a);
+
+ if ((b_limb & 1) == 0)
+ {
+ mp_limb_t a_low = a_ptr[0];
+ int twos;
+
+ if (b_limb == 0)
+ return JACOBI_LS0 (a_low, a_size); /* (a/0) */
+
+ if (! (a_low & 1))
+ return 0; /* (even/even)=0 */
+
+ /* (a/2)=(2/a) for a odd */
+ count_trailing_zeros (twos, b_limb);
+ b_limb >>= twos;
+ result_bit1 ^= JACOBI_TWOS_U_BIT1 (twos, a_low);
+ }
+
+ if (b_limb == 1)
+ return JACOBI_BIT1_TO_PN (result_bit1); /* (a/1)=1 for any a */
+
+ result_bit1 ^= JACOBI_ASGN_SU_BIT1 (a_size, b_limb);
+ a_size = ABS(a_size);
+
+ /* (a/b) = (a mod b / b) */
+ JACOBI_MOD_OR_MODEXACT_1_ODD (result_bit1, a_rem, a_ptr, a_size, b_limb);
+ return mpn_jacobi_base (a_rem, b_limb, result_bit1);
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpz/kronzu.c b/Build/source/libs/gmp/gmp-6.0.0/mpz/kronzu.c
new file mode 100644
index 00000000000..f57f92e8ba1
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpz/kronzu.c
@@ -0,0 +1,89 @@
+/* mpz_kronecker_ui -- mpz+ulong Kronecker/Jacobi symbol.
+
+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/. */
+
+#include "gmp.h"
+#include "gmp-impl.h"
+#include "longlong.h"
+
+
+int
+mpz_kronecker_ui (mpz_srcptr a, unsigned long b)
+{
+ mp_srcptr a_ptr;
+ mp_size_t a_size;
+ mp_limb_t a_rem;
+ int result_bit1;
+
+ a_size = SIZ(a);
+ if (a_size == 0)
+ return JACOBI_0U (b);
+
+ if (b > GMP_NUMB_MAX)
+ {
+ mp_limb_t blimbs[2];
+ mpz_t bz;
+ ALLOC(bz) = numberof (blimbs);
+ PTR(bz) = blimbs;
+ mpz_set_ui (bz, b);
+ return mpz_kronecker (a, bz);
+ }
+
+ a_ptr = PTR(a);
+ if ((b & 1) != 0)
+ {
+ result_bit1 = JACOBI_ASGN_SU_BIT1 (a_size, b);
+ }
+ else
+ {
+ mp_limb_t a_low = a_ptr[0];
+ int twos;
+
+ if (b == 0)
+ return JACOBI_LS0 (a_low, a_size); /* (a/0) */
+
+ if (! (a_low & 1))
+ return 0; /* (even/even)=0 */
+
+ /* (a/2)=(2/a) for a odd */
+ count_trailing_zeros (twos, b);
+ b >>= twos;
+ result_bit1 = (JACOBI_TWOS_U_BIT1 (twos, a_low)
+ ^ JACOBI_ASGN_SU_BIT1 (a_size, b));
+ }
+
+ if (b == 1)
+ return JACOBI_BIT1_TO_PN (result_bit1); /* (a/1)=1 for any a */
+
+ a_size = ABS(a_size);
+
+ /* (a/b) = (a mod b / b) */
+ JACOBI_MOD_OR_MODEXACT_1_ODD (result_bit1, a_rem, a_ptr, a_size, b);
+ return mpn_jacobi_base (a_rem, (mp_limb_t) b, result_bit1);
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpz/lcm.c b/Build/source/libs/gmp/gmp-6.0.0/mpz/lcm.c
new file mode 100644
index 00000000000..805f6710775
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpz/lcm.c
@@ -0,0 +1,88 @@
+/* mpz_lcm -- mpz/mpz least common multiple.
+
+Copyright 1996, 2000, 2001, 2005, 2012 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.h"
+#include "gmp-impl.h"
+
+void
+mpz_lcm (mpz_ptr r, mpz_srcptr u, mpz_srcptr v)
+{
+ mpz_t g;
+ mp_size_t usize, vsize;
+ TMP_DECL;
+
+ usize = SIZ (u);
+ vsize = SIZ (v);
+ if (usize == 0 || vsize == 0)
+ {
+ SIZ (r) = 0;
+ return;
+ }
+ usize = ABS (usize);
+ vsize = ABS (vsize);
+
+ if (vsize == 1 || usize == 1)
+ {
+ mp_limb_t vl, gl, c;
+ mp_srcptr up;
+ mp_ptr rp;
+
+ if (usize == 1)
+ {
+ usize = vsize;
+ MPZ_SRCPTR_SWAP (u, v);
+ }
+
+ MPZ_REALLOC (r, usize+1);
+
+ up = PTR(u);
+ vl = PTR(v)[0];
+ gl = mpn_gcd_1 (up, usize, vl);
+ vl /= gl;
+
+ rp = PTR(r);
+ c = mpn_mul_1 (rp, up, usize, vl);
+ rp[usize] = c;
+ usize += (c != 0);
+ SIZ(r) = usize;
+ return;
+ }
+
+ TMP_MARK;
+ MPZ_TMP_INIT (g, usize); /* v != 0 implies |gcd(u,v)| <= |u| */
+
+ mpz_gcd (g, u, v);
+ mpz_divexact (g, u, g);
+ mpz_mul (r, g, v);
+
+ SIZ (r) = ABS (SIZ (r)); /* result always positive */
+
+ TMP_FREE;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpz/lcm_ui.c b/Build/source/libs/gmp/gmp-6.0.0/mpz/lcm_ui.c
new file mode 100644
index 00000000000..362d183b428
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpz/lcm_ui.c
@@ -0,0 +1,79 @@
+/* mpz_lcm_ui -- least common multiple of mpz and ulong.
+
+Copyright 2001, 2002, 2004 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.h"
+#include "gmp-impl.h"
+#include "longlong.h"
+
+
+void
+mpz_lcm_ui (mpz_ptr r, mpz_srcptr u, unsigned long v)
+{
+ mp_size_t usize;
+ mp_srcptr up;
+ mp_ptr rp;
+ unsigned long g;
+ mp_limb_t c;
+
+#if BITS_PER_ULONG > GMP_NUMB_BITS /* avoid warnings about shift amount */
+ if (v > GMP_NUMB_MAX)
+ {
+ mpz_t vz;
+ mp_limb_t vlimbs[2];
+ vlimbs[0] = v & GMP_NUMB_MASK;
+ vlimbs[1] = v >> GMP_NUMB_BITS;
+ PTR(vz) = vlimbs;
+ SIZ(vz) = 2;
+ mpz_lcm (r, u, vz);
+ return;
+ }
+#endif
+
+ /* result zero if either operand zero */
+ usize = SIZ(u);
+ if (usize == 0 || v == 0)
+ {
+ SIZ(r) = 0;
+ return;
+ }
+ usize = ABS(usize);
+
+ MPZ_REALLOC (r, usize+1);
+
+ up = PTR(u);
+ g = (unsigned long) mpn_gcd_1 (up, usize, (mp_limb_t) v);
+ v /= g;
+
+ rp = PTR(r);
+ c = mpn_mul_1 (rp, up, usize, (mp_limb_t) v);
+ rp[usize] = c;
+ usize += (c != 0);
+ SIZ(r) = usize;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpz/limbs_finish.c b/Build/source/libs/gmp/gmp-6.0.0/mpz/limbs_finish.c
new file mode 100644
index 00000000000..ebf6dea2907
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpz/limbs_finish.c
@@ -0,0 +1,40 @@
+/* mpz_finish_limbs -- Update mpz after writing to the limb array.
+
+Copyright 2013 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.h"
+#include "gmp-impl.h"
+
+void
+mpz_limbs_finish (mpz_ptr x, mp_size_t xs)
+{
+ mp_size_t xn = ABS(xs);
+ MPN_NORMALIZE (PTR (x), xn);
+ SIZ (x) = xs < 0 ? -xn : xn;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpz/limbs_modify.c b/Build/source/libs/gmp/gmp-6.0.0/mpz/limbs_modify.c
new file mode 100644
index 00000000000..bafd7d88a0e
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpz/limbs_modify.c
@@ -0,0 +1,39 @@
+/* mpz_limbs_modify -- Read-and-modify access to the mpn-style limb array.
+
+Copyright 2013 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.h"
+#include "gmp-impl.h"
+
+mp_ptr
+mpz_limbs_modify (mpz_ptr x, mp_size_t n)
+{
+ ASSERT (n > 0);
+ return MPZ_REALLOC (x, n);
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpz/limbs_read.c b/Build/source/libs/gmp/gmp-6.0.0/mpz/limbs_read.c
new file mode 100644
index 00000000000..6c14f18d459
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpz/limbs_read.c
@@ -0,0 +1,38 @@
+/* mpz_limbs_read -- Read access to the mpn-style limb array.
+
+Copyright 2013 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.h"
+#include "gmp-impl.h"
+
+mp_srcptr
+mpz_limbs_read (mpz_srcptr x)
+{
+ return PTR(x);
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpz/limbs_write.c b/Build/source/libs/gmp/gmp-6.0.0/mpz/limbs_write.c
new file mode 100644
index 00000000000..605cb5e3a36
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpz/limbs_write.c
@@ -0,0 +1,39 @@
+/* mpz_limbs_write -- Write access to the mpn-style limb array.
+
+Copyright 2013 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.h"
+#include "gmp-impl.h"
+
+mp_ptr
+mpz_limbs_write (mpz_ptr x, mp_size_t n)
+{
+ ASSERT (n > 0);
+ return MPZ_NEWALLOC (x, n);
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpz/lucnum2_ui.c b/Build/source/libs/gmp/gmp-6.0.0/mpz/lucnum2_ui.c
new file mode 100644
index 00000000000..f8e4fb356f0
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpz/lucnum2_ui.c
@@ -0,0 +1,90 @@
+/* mpz_lucnum2_ui -- calculate Lucas numbers.
+
+Copyright 2001, 2003, 2005, 2012 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.h"
+#include "gmp-impl.h"
+
+
+void
+mpz_lucnum2_ui (mpz_ptr ln, mpz_ptr lnsub1, unsigned long n)
+{
+ mp_ptr lp, l1p, f1p;
+ mp_size_t size;
+ mp_limb_t c;
+ TMP_DECL;
+
+ ASSERT (ln != lnsub1);
+
+ /* handle small n quickly, and hide the special case for L[-1]=-1 */
+ if (n <= FIB_TABLE_LUCNUM_LIMIT)
+ {
+ mp_limb_t f = FIB_TABLE (n);
+ mp_limb_t f1 = FIB_TABLE ((int) n - 1);
+
+ /* L[n] = F[n] + 2F[n-1] */
+ PTR(ln)[0] = f + 2*f1;
+ SIZ(ln) = 1;
+
+ /* L[n-1] = 2F[n] - F[n-1], but allow for L[-1]=-1 */
+ PTR(lnsub1)[0] = (n == 0 ? 1 : 2*f - f1);
+ SIZ(lnsub1) = (n == 0 ? -1 : 1);
+
+ return;
+ }
+
+ TMP_MARK;
+ size = MPN_FIB2_SIZE (n);
+ f1p = TMP_ALLOC_LIMBS (size);
+
+ lp = MPZ_REALLOC (ln, size+1);
+ l1p = MPZ_REALLOC (lnsub1, size+1);
+
+ size = mpn_fib2_ui (l1p, f1p, n);
+
+ /* L[n] = F[n] + 2F[n-1] */
+#if HAVE_NATIVE_mpn_addlsh1_n
+ c = mpn_addlsh1_n (lp, l1p, f1p, size);
+#else
+ c = mpn_lshift (lp, f1p, size, 1);
+ c += mpn_add_n (lp, lp, l1p, size);
+#endif
+ lp[size] = c;
+ SIZ(ln) = size + (c != 0);
+
+ /* L[n-1] = 2F[n] - F[n-1] */
+ c = mpn_lshift (l1p, l1p, size, 1);
+ c -= mpn_sub_n (l1p, l1p, f1p, size);
+ ASSERT ((mp_limb_signed_t) c >= 0);
+ l1p[size] = c;
+ SIZ(lnsub1) = size + (c != 0);
+
+ TMP_FREE;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpz/lucnum_ui.c b/Build/source/libs/gmp/gmp-6.0.0/mpz/lucnum_ui.c
new file mode 100644
index 00000000000..d1fe6b54cef
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpz/lucnum_ui.c
@@ -0,0 +1,209 @@
+/* mpz_lucnum_ui -- calculate Lucas number.
+
+Copyright 2001, 2003, 2005, 2011, 2012 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.h"
+#include "gmp-impl.h"
+
+
+/* change this to "#define TRACE(x) x" for diagnostics */
+#define TRACE(x)
+
+
+/* Notes:
+
+ For the +4 in L[2k+1] when k is even, all L[4m+3] == 4, 5 or 7 mod 8, so
+ there can't be an overflow applying +4 to just the low limb (since that
+ would leave 0, 1, 2 or 3 mod 8).
+
+ For the -4 in L[2k+1] when k is even, it seems (no proof) that
+ L[3*2^(b-2)-3] == -4 mod 2^b, so for instance with a 32-bit limb
+ L[0xBFFFFFFD] == 0xFFFFFFFC mod 2^32, and this implies a borrow from the
+ low limb. Obviously L[0xBFFFFFFD] is a huge number, but it's at least
+ conceivable to calculate it, so it probably should be handled.
+
+ For the -2 in L[2k] with k even, it seems (no proof) L[2^(b-1)] == -1 mod
+ 2^b, so for instance in 32-bits L[0x80000000] has a low limb of
+ 0xFFFFFFFF so there would have been a borrow. Again L[0x80000000] is
+ obviously huge, but probably should be made to work. */
+
+void
+mpz_lucnum_ui (mpz_ptr ln, unsigned long n)
+{
+ mp_size_t lalloc, xalloc, lsize, xsize;
+ mp_ptr lp, xp;
+ mp_limb_t c;
+ int zeros;
+ TMP_DECL;
+
+ TRACE (printf ("mpn_lucnum_ui n=%lu\n", n));
+
+ if (n <= FIB_TABLE_LUCNUM_LIMIT)
+ {
+ /* L[n] = F[n] + 2F[n-1] */
+ PTR(ln)[0] = FIB_TABLE(n) + 2 * FIB_TABLE ((int) n - 1);
+ SIZ(ln) = 1;
+ return;
+ }
+
+ /* +1 since L[n]=F[n]+2F[n-1] might be 1 limb bigger than F[n], further +1
+ since square or mul used below might need an extra limb over the true
+ size */
+ lalloc = MPN_FIB2_SIZE (n) + 2;
+ lp = MPZ_REALLOC (ln, lalloc);
+
+ TMP_MARK;
+ xalloc = lalloc;
+ xp = TMP_ALLOC_LIMBS (xalloc);
+
+ /* Strip trailing zeros from n, until either an odd number is reached
+ where the L[2k+1] formula can be used, or until n fits within the
+ FIB_TABLE data. The table is preferred of course. */
+ zeros = 0;
+ for (;;)
+ {
+ if (n & 1)
+ {
+ /* L[2k+1] = 5*F[k-1]*(2*F[k]+F[k-1]) - 4*(-1)^k */
+
+ mp_size_t yalloc, ysize;
+ mp_ptr yp;
+
+ TRACE (printf (" initial odd n=%lu\n", n));
+
+ yalloc = MPN_FIB2_SIZE (n/2);
+ yp = TMP_ALLOC_LIMBS (yalloc);
+ ASSERT (xalloc >= yalloc);
+
+ xsize = mpn_fib2_ui (xp, yp, n/2);
+
+ /* possible high zero on F[k-1] */
+ ysize = xsize;
+ ysize -= (yp[ysize-1] == 0);
+ ASSERT (yp[ysize-1] != 0);
+
+ /* xp = 2*F[k] + F[k-1] */
+#if HAVE_NATIVE_mpn_addlsh1_n
+ c = mpn_addlsh1_n (xp, yp, xp, xsize);
+#else
+ c = mpn_lshift (xp, xp, xsize, 1);
+ c += mpn_add_n (xp, xp, yp, xsize);
+#endif
+ ASSERT (xalloc >= xsize+1);
+ xp[xsize] = c;
+ xsize += (c != 0);
+ ASSERT (xp[xsize-1] != 0);
+
+ ASSERT (lalloc >= xsize + ysize);
+ c = mpn_mul (lp, xp, xsize, yp, ysize);
+ lsize = xsize + ysize;
+ lsize -= (c == 0);
+
+ /* lp = 5*lp */
+#if HAVE_NATIVE_mpn_addlsh2_n
+ c = mpn_addlsh2_n (lp, lp, lp, lsize);
+#else
+ /* FIXME: Is this faster than mpn_mul_1 ? */
+ c = mpn_lshift (xp, lp, lsize, 2);
+ c += mpn_add_n (lp, lp, xp, lsize);
+#endif
+ ASSERT (lalloc >= lsize+1);
+ lp[lsize] = c;
+ lsize += (c != 0);
+
+ /* lp = lp - 4*(-1)^k */
+ if (n & 2)
+ {
+ /* no overflow, see comments above */
+ ASSERT (lp[0] <= MP_LIMB_T_MAX-4);
+ lp[0] += 4;
+ }
+ else
+ {
+ /* won't go negative */
+ MPN_DECR_U (lp, lsize, CNST_LIMB(4));
+ }
+
+ TRACE (mpn_trace (" l",lp, lsize));
+ break;
+ }
+
+ MP_PTR_SWAP (xp, lp); /* balance the swaps wanted in the L[2k] below */
+ zeros++;
+ n /= 2;
+
+ if (n <= FIB_TABLE_LUCNUM_LIMIT)
+ {
+ /* L[n] = F[n] + 2F[n-1] */
+ lp[0] = FIB_TABLE (n) + 2 * FIB_TABLE ((int) n - 1);
+ lsize = 1;
+
+ TRACE (printf (" initial small n=%lu\n", n);
+ mpn_trace (" l",lp, lsize));
+ break;
+ }
+ }
+
+ for ( ; zeros != 0; zeros--)
+ {
+ /* L[2k] = L[k]^2 + 2*(-1)^k */
+
+ TRACE (printf (" zeros=%d\n", zeros));
+
+ ASSERT (xalloc >= 2*lsize);
+ mpn_sqr (xp, lp, lsize);
+ lsize *= 2;
+ lsize -= (xp[lsize-1] == 0);
+
+ /* First time around the loop k==n determines (-1)^k, after that k is
+ always even and we set n=0 to indicate that. */
+ if (n & 1)
+ {
+ /* L[n]^2 == 0 or 1 mod 4, like all squares, so +2 gives no carry */
+ ASSERT (xp[0] <= MP_LIMB_T_MAX-2);
+ xp[0] += 2;
+ n = 0;
+ }
+ else
+ {
+ /* won't go negative */
+ MPN_DECR_U (xp, lsize, CNST_LIMB(2));
+ }
+
+ MP_PTR_SWAP (xp, lp);
+ ASSERT (lp[lsize-1] != 0);
+ }
+
+ /* should end up in the right spot after all the xp/lp swaps */
+ ASSERT (lp == PTR(ln));
+ SIZ(ln) = lsize;
+
+ TMP_FREE;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpz/mfac_uiui.c b/Build/source/libs/gmp/gmp-6.0.0/mpz/mfac_uiui.c
new file mode 100644
index 00000000000..3ea36bce9d2
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpz/mfac_uiui.c
@@ -0,0 +1,140 @@
+/* mpz_mfac_uiui(RESULT, N, M) -- Set RESULT to N!^(M) = N(N-M)(N-2M)...
+
+Contributed to the GNU project by Marco Bodrato.
+
+Copyright 2012, 2013 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.h"
+#include "gmp-impl.h"
+
+/*************************************************************/
+/* Section macros: common macros, for swing/fac/bin (&sieve) */
+/*************************************************************/
+
+#define FACTOR_LIST_STORE(P, PR, MAX_PR, VEC, I) \
+ do { \
+ if ((PR) > (MAX_PR)) { \
+ (VEC)[(I)++] = (PR); \
+ (PR) = (P); \
+ } else \
+ (PR) *= (P); \
+ } while (0)
+
+/*********************************************************/
+/* Section oder factorials: */
+/*********************************************************/
+
+/* mpz_mfac_uiui (x, n, m) computes x = n!^(m) = n*(n-m)*(n-2m)*... */
+
+void
+mpz_mfac_uiui (mpz_ptr x, unsigned long n, unsigned long m)
+{
+ ASSERT (n <= GMP_NUMB_MAX);
+ ASSERT (m != 0);
+
+ if ((n < 3) | (n - 3 < m - 1)) { /* (n < 3 || n - 1 <= m || m == 0) */
+ PTR (x)[0] = n + (n == 0);
+ SIZ (x) = 1;
+ } else { /* m < n - 1 < GMP_NUMB_MAX */
+ mp_limb_t g, sn;
+ mpz_t t;
+
+ sn = n;
+ g = mpn_gcd_1 (&sn, 1, m);
+ if (g > 1) { n/=g; m/=g; }
+
+ if (m <= 2) { /* fac or 2fac */
+ if (m == 1) {
+ if (g > 2) {
+ mpz_init (t);
+ mpz_fac_ui (t, n);
+ sn = n;
+ } else {
+ if (g == 2)
+ mpz_2fac_ui (x, n << 1);
+ else
+ mpz_fac_ui (x, n);
+ return;
+ }
+ } else { /* m == 2 */
+ if (g > 1) {
+ mpz_init (t);
+ mpz_2fac_ui (t, n);
+ sn = n / 2 + 1;
+ } else {
+ mpz_2fac_ui (x, n);
+ return;
+ }
+ }
+ } else { /* m >= 3, gcd(n,m) = 1 */
+ mp_limb_t *factors;
+ mp_limb_t prod, max_prod, j;
+ TMP_DECL;
+
+ sn = n / m + 1;
+
+ j = 0;
+ prod = n;
+ n -= m;
+ max_prod = GMP_NUMB_MAX / n;
+
+ if (g > 1)
+ factors = MPZ_NEWALLOC (x, sn / log_n_max (n) + 2);
+ else {
+ TMP_MARK;
+ factors = TMP_ALLOC_LIMBS (sn / log_n_max (n) + 2);
+ }
+
+ for (; n > m; n -= m)
+ FACTOR_LIST_STORE (n, prod, max_prod, factors, j);
+
+ factors[j++] = n;
+ factors[j++] = prod;
+
+ if (g > 1) {
+ mpz_init (t);
+ mpz_prodlimbs (t, factors, j);
+ } else {
+ mpz_prodlimbs (x, factors, j);
+ TMP_FREE;
+ return;
+ }
+ }
+
+ {
+ mpz_t p;
+
+ mpz_init (p);
+ mpz_ui_pow_ui (p, g, sn); /* g^sn */
+ mpz_mul (x, p, t);
+ mpz_clear (p);
+ mpz_clear (t);
+ }
+ }
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpz/millerrabin.c b/Build/source/libs/gmp/gmp-6.0.0/mpz/millerrabin.c
new file mode 100644
index 00000000000..e1ce32c8937
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpz/millerrabin.c
@@ -0,0 +1,124 @@
+/* mpz_millerrabin(n,reps) -- An implementation of the probabilistic primality
+ test found in Knuth's Seminumerical Algorithms book. If the function
+ mpz_millerrabin() returns 0 then n is not prime. If it returns 1, then n is
+ 'probably' prime. The probability of a false positive is (1/4)**reps, where
+ reps is the number of internal passes of the probabilistic algorithm. Knuth
+ indicates that 25 passes are reasonable.
+
+ 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 1991, 1993, 1994, 1996-2002, 2005 Free Software Foundation, Inc.
+
+Contributed by John Amanatides.
+
+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.h"
+#include "gmp-impl.h"
+
+static int millerrabin (mpz_srcptr, mpz_srcptr,
+ mpz_ptr, mpz_ptr,
+ mpz_srcptr, unsigned long int);
+
+int
+mpz_millerrabin (mpz_srcptr n, int reps)
+{
+ int r;
+ mpz_t nm1, nm3, x, y, q;
+ unsigned long int k;
+ gmp_randstate_t rstate;
+ int is_prime;
+ TMP_DECL;
+ TMP_MARK;
+
+ MPZ_TMP_INIT (nm1, SIZ (n) + 1);
+ mpz_sub_ui (nm1, n, 1L);
+
+ MPZ_TMP_INIT (x, SIZ (n) + 1);
+ MPZ_TMP_INIT (y, 2 * SIZ (n)); /* mpz_powm_ui needs excessive memory!!! */
+
+ /* Perform a Fermat test. */
+ mpz_set_ui (x, 210L);
+ mpz_powm (y, x, nm1, n);
+ if (mpz_cmp_ui (y, 1L) != 0)
+ {
+ TMP_FREE;
+ return 0;
+ }
+
+ MPZ_TMP_INIT (q, SIZ (n));
+
+ /* Find q and k, where q is odd and n = 1 + 2**k * q. */
+ k = mpz_scan1 (nm1, 0L);
+ mpz_tdiv_q_2exp (q, nm1, k);
+
+ /* n-3 */
+ MPZ_TMP_INIT (nm3, SIZ (n) + 1);
+ mpz_sub_ui (nm3, n, 3L);
+ ASSERT (mpz_cmp_ui (nm3, 1L) >= 0);
+
+ gmp_randinit_default (rstate);
+
+ is_prime = 1;
+ for (r = 0; r < reps && is_prime; r++)
+ {
+ /* 2 to n-2 inclusive, don't want 1, 0 or -1 */
+ mpz_urandomm (x, rstate, nm3);
+ mpz_add_ui (x, x, 2L);
+
+ is_prime = millerrabin (n, nm1, x, y, q, k);
+ }
+
+ gmp_randclear (rstate);
+
+ TMP_FREE;
+ return is_prime;
+}
+
+static int
+millerrabin (mpz_srcptr n, mpz_srcptr nm1, mpz_ptr x, mpz_ptr y,
+ mpz_srcptr q, unsigned long int k)
+{
+ unsigned long int i;
+
+ mpz_powm (y, x, q, n);
+
+ if (mpz_cmp_ui (y, 1L) == 0 || mpz_cmp (y, nm1) == 0)
+ return 1;
+
+ for (i = 1; i < k; i++)
+ {
+ mpz_powm_ui (y, y, 2L, n);
+ if (mpz_cmp (y, nm1) == 0)
+ return 1;
+ if (mpz_cmp_ui (y, 1L) == 0)
+ return 0;
+ }
+ return 0;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpz/mod.c b/Build/source/libs/gmp/gmp-6.0.0/mpz/mod.c
new file mode 100644
index 00000000000..f2de0f97831
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpz/mod.c
@@ -0,0 +1,68 @@
+/* mpz_mod -- The mathematical mod function.
+
+Copyright 1991, 1993-1996, 2001, 2002, 2005, 2010, 2012 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.h"
+#include "gmp-impl.h"
+
+void
+mpz_mod (mpz_ptr rem, mpz_srcptr dividend, mpz_srcptr divisor)
+{
+ mp_size_t rn, bn;
+ mpz_t temp_divisor;
+ TMP_DECL;
+
+ TMP_MARK;
+
+ bn = ABSIZ(divisor);
+
+ /* We need the original value of the divisor after the remainder has been
+ preliminary calculated. We have to copy it to temporary space if it's
+ the same variable as REM. */
+ if (rem == divisor)
+ {
+ PTR(temp_divisor) = TMP_ALLOC_LIMBS (bn);
+ MPN_COPY (PTR(temp_divisor), PTR(divisor), bn);
+ }
+ else
+ {
+ PTR(temp_divisor) = PTR(divisor);
+ }
+ SIZ(temp_divisor) = bn;
+ divisor = temp_divisor;
+
+ mpz_tdiv_r (rem, dividend, divisor);
+
+ rn = SIZ (rem);
+ if (rn < 0)
+ mpz_add (rem, rem, divisor);
+
+ TMP_FREE;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpz/mul.c b/Build/source/libs/gmp/gmp-6.0.0/mpz/mul.c
new file mode 100644
index 00000000000..59a279eca6d
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpz/mul.c
@@ -0,0 +1,157 @@
+/* mpz_mul -- Multiply two integers.
+
+Copyright 1991, 1993, 1994, 1996, 2000, 2001, 2005, 2009, 2011, 2012 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> /* for NULL */
+#include "gmp.h"
+#include "gmp-impl.h"
+
+
+void
+mpz_mul (mpz_ptr w, mpz_srcptr u, mpz_srcptr v)
+{
+ mp_size_t usize;
+ mp_size_t vsize;
+ mp_size_t wsize;
+ mp_size_t sign_product;
+ mp_ptr up, vp;
+ mp_ptr wp;
+ mp_ptr free_me;
+ size_t free_me_size;
+ mp_limb_t cy_limb;
+ TMP_DECL;
+
+ usize = SIZ (u);
+ vsize = SIZ (v);
+ sign_product = usize ^ vsize;
+ usize = ABS (usize);
+ vsize = ABS (vsize);
+
+ if (usize < vsize)
+ {
+ MPZ_SRCPTR_SWAP (u, v);
+ MP_SIZE_T_SWAP (usize, vsize);
+ }
+
+ if (vsize == 0)
+ {
+ SIZ (w) = 0;
+ return;
+ }
+
+#if HAVE_NATIVE_mpn_mul_2
+ if (vsize <= 2)
+ {
+ wp = MPZ_REALLOC (w, usize+vsize);
+ if (vsize == 1)
+ cy_limb = mpn_mul_1 (wp, PTR (u), usize, PTR (v)[0]);
+ else
+ {
+ cy_limb = mpn_mul_2 (wp, PTR (u), usize, PTR (v));
+ usize++;
+ }
+ wp[usize] = cy_limb;
+ usize += (cy_limb != 0);
+ SIZ (w) = (sign_product >= 0 ? usize : -usize);
+ return;
+ }
+#else
+ if (vsize == 1)
+ {
+ wp = MPZ_REALLOC (w, usize+1);
+ cy_limb = mpn_mul_1 (wp, PTR (u), usize, PTR (v)[0]);
+ wp[usize] = cy_limb;
+ usize += (cy_limb != 0);
+ SIZ (w) = (sign_product >= 0 ? usize : -usize);
+ return;
+ }
+#endif
+
+ TMP_MARK;
+ free_me = NULL;
+ up = PTR (u);
+ vp = PTR (v);
+ wp = PTR (w);
+
+ /* Ensure W has space enough to store the result. */
+ wsize = usize + vsize;
+ if (ALLOC (w) < wsize)
+ {
+ if (wp == up || wp == vp)
+ {
+ free_me = wp;
+ free_me_size = ALLOC (w);
+ }
+ else
+ (*__gmp_free_func) (wp, (size_t) ALLOC (w) * GMP_LIMB_BYTES);
+
+ ALLOC (w) = wsize;
+ wp = (mp_ptr) (*__gmp_allocate_func) ((size_t) wsize * GMP_LIMB_BYTES);
+ PTR (w) = wp;
+ }
+ else
+ {
+ /* Make U and V not overlap with W. */
+ if (wp == up)
+ {
+ /* W and U are identical. Allocate temporary space for U. */
+ up = TMP_ALLOC_LIMBS (usize);
+ /* Is V identical too? Keep it identical with U. */
+ if (wp == vp)
+ vp = up;
+ /* Copy to the temporary space. */
+ MPN_COPY (up, wp, usize);
+ }
+ else if (wp == vp)
+ {
+ /* W and V are identical. Allocate temporary space for V. */
+ vp = TMP_ALLOC_LIMBS (vsize);
+ /* Copy to the temporary space. */
+ MPN_COPY (vp, wp, vsize);
+ }
+ }
+
+ if (up == vp)
+ {
+ mpn_sqr (wp, up, usize);
+ cy_limb = wp[wsize - 1];
+ }
+ else
+ {
+ cy_limb = mpn_mul (wp, up, usize, vp, vsize);
+ }
+
+ wsize -= cy_limb == 0;
+
+ SIZ (w) = sign_product < 0 ? -wsize : wsize;
+ if (free_me != NULL)
+ (*__gmp_free_func) (free_me, free_me_size * GMP_LIMB_BYTES);
+ TMP_FREE;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpz/mul_2exp.c b/Build/source/libs/gmp/gmp-6.0.0/mpz/mul_2exp.c
new file mode 100644
index 00000000000..f02fef7ee23
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpz/mul_2exp.c
@@ -0,0 +1,73 @@
+/* mpz_mul_2exp -- Multiply a bignum by 2**CNT
+
+Copyright 1991, 1993, 1994, 1996, 2001, 2002, 2012 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.h"
+#include "gmp-impl.h"
+
+void
+mpz_mul_2exp (mpz_ptr r, mpz_srcptr u, mp_bitcnt_t cnt)
+{
+ mp_size_t un, rn;
+ mp_size_t limb_cnt;
+ mp_ptr rp;
+ mp_srcptr up;
+ mp_limb_t rlimb;
+
+ un = ABSIZ (u);
+ limb_cnt = cnt / GMP_NUMB_BITS;
+ rn = un + limb_cnt;
+
+ if (un == 0)
+ rn = 0;
+ else
+ {
+ rp = MPZ_REALLOC (r, rn + 1);
+ up = PTR(u);
+
+ cnt %= GMP_NUMB_BITS;
+ if (cnt != 0)
+ {
+ rlimb = mpn_lshift (rp + limb_cnt, up, un, cnt);
+ rp[rn] = rlimb;
+ rn += (rlimb != 0);
+ }
+ else
+ {
+ MPN_COPY_DECR (rp + limb_cnt, up, un);
+ }
+
+ /* Zero all whole limbs at low end. Do it here and not before calling
+ mpn_lshift, not to lose for U == R. */
+ MPN_ZERO (rp, limb_cnt);
+ }
+
+ SIZ(r) = SIZ(u) >= 0 ? rn : -rn;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpz/mul_i.h b/Build/source/libs/gmp/gmp-6.0.0/mpz/mul_i.h
new file mode 100644
index 00000000000..486a8fd63e6
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpz/mul_i.h
@@ -0,0 +1,107 @@
+/* mpz_mul_ui/si (product, multiplier, small_multiplicand) -- Set PRODUCT to
+ MULTIPLICATOR times SMALL_MULTIPLICAND.
+
+Copyright 1991, 1993, 1994, 1996, 2000-2002, 2005, 2008, 2012 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.h"
+#include "gmp-impl.h"
+
+
+#ifdef OPERATION_mul_si
+#define FUNCTION mpz_mul_si
+#define MULTIPLICAND_UNSIGNED
+#define MULTIPLICAND_ABS(x) ABS_CAST(unsigned long, (x))
+#endif
+
+#ifdef OPERATION_mul_ui
+#define FUNCTION mpz_mul_ui
+#define MULTIPLICAND_UNSIGNED unsigned
+#define MULTIPLICAND_ABS(x) x
+#endif
+
+#ifndef FUNCTION
+Error, error, unrecognised OPERATION
+#endif
+
+
+void
+FUNCTION (mpz_ptr prod, mpz_srcptr mult,
+ MULTIPLICAND_UNSIGNED long int small_mult)
+{
+ mp_size_t size;
+ mp_size_t sign_product;
+ mp_limb_t sml;
+ mp_limb_t cy;
+ mp_ptr pp;
+
+ sign_product = SIZ(mult);
+ if (sign_product == 0 || small_mult == 0)
+ {
+ SIZ(prod) = 0;
+ return;
+ }
+
+ size = ABS (sign_product);
+
+ sml = MULTIPLICAND_ABS (small_mult);
+
+ if (sml <= GMP_NUMB_MAX)
+ {
+ pp = MPZ_REALLOC (prod, size + 1);
+ cy = mpn_mul_1 (pp, PTR(mult), size, sml);
+ pp[size] = cy;
+ size += cy != 0;
+ }
+#if GMP_NAIL_BITS != 0
+ else
+ {
+ /* Operand too large for the current nails size. Use temporary for
+ intermediate products, to allow prod and mult being identical. */
+ mp_ptr tp;
+ TMP_DECL;
+ TMP_MARK;
+
+ tp = TMP_ALLOC_LIMBS (size + 2);
+
+ /* Use, maybe, mpn_mul_2? */
+ cy = mpn_mul_1 (tp, PTR(mult), size, sml & GMP_NUMB_MASK);
+ tp[size] = cy;
+ cy = mpn_addmul_1 (tp + 1, PTR(mult), size, sml >> GMP_NUMB_BITS);
+ tp[size + 1] = cy;
+ size += 2;
+ MPN_NORMALIZE_NOT_ZERO (tp, size); /* too general, need to trim one or two limb */
+ pp = MPZ_REALLOC (prod, size);
+ MPN_COPY (pp, tp, size);
+ TMP_FREE;
+ }
+#endif
+
+ SIZ(prod) = ((sign_product < 0) ^ (small_mult < 0)) ? -size : size;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpz/mul_si.c b/Build/source/libs/gmp/gmp-6.0.0/mpz/mul_si.c
new file mode 100644
index 00000000000..9f29f601e29
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpz/mul_si.c
@@ -0,0 +1,34 @@
+/* mpz_mul_si (product, multiplier, small_multiplicand) -- Set PRODUCT to
+ MULTIPLICATOR times SMALL_MULTIPLICAND.
+
+Copyright 2001 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 OPERATION_mul_si
+#include "mul_i.h"
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpz/mul_ui.c b/Build/source/libs/gmp/gmp-6.0.0/mpz/mul_ui.c
new file mode 100644
index 00000000000..d398c4f6f1f
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpz/mul_ui.c
@@ -0,0 +1,34 @@
+/* mpz_mul_ui (product, multiplier, small_multiplicand) -- Set PRODUCT to
+ MULTIPLICATOR times SMALL_MULTIPLICAND.
+
+Copyright 2001 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 OPERATION_mul_ui
+#include "mul_i.h"
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpz/n_pow_ui.c b/Build/source/libs/gmp/gmp-6.0.0/mpz/n_pow_ui.c
new file mode 100644
index 00000000000..6c3febe2375
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpz/n_pow_ui.c
@@ -0,0 +1,533 @@
+/* mpz_n_pow_ui -- mpn raised to ulong.
+
+ 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, 2012 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.h"
+#include "gmp-impl.h"
+#include "longlong.h"
+
+
+/* Change this to "#define TRACE(x) x" for some traces. */
+#define TRACE(x)
+
+
+/* Use this to test the mul_2 code on a CPU without a native version of that
+ routine. */
+#if 0
+#define mpn_mul_2 refmpn_mul_2
+#define HAVE_NATIVE_mpn_mul_2 1
+#endif
+
+
+/* mpz_pow_ui and mpz_ui_pow_ui want to share almost all of this code.
+ ui_pow_ui doesn't need the mpn_mul based powering loop or the tests on
+ bsize==2 or >2, but separating that isn't easy because there's shared
+ code both before and after (the size calculations and the powers of 2
+ handling).
+
+ Alternatives:
+
+ It would work to just use the mpn_mul powering loop for 1 and 2 limb
+ bases, but the current separate loop allows mul_1 and mul_2 to be done
+ in-place, which might help cache locality a bit. If mpn_mul was relaxed
+ to allow source==dest when vn==1 or 2 then some pointer twiddling might
+ let us get the same effect in one loop.
+
+ The initial powering for bsize==1 into blimb or blimb:blimb_low doesn't
+ form the biggest possible power of b that fits, only the biggest power of
+ 2 power, ie. b^(2^n). It'd be possible to choose a bigger power, perhaps
+ using mp_bases[b].big_base for small b, and thereby get better value
+ from mpn_mul_1 or mpn_mul_2 in the bignum powering. It's felt that doing
+ so would be more complicated than it's worth, and could well end up being
+ a slowdown for small e. For big e on the other hand the algorithm is
+ dominated by mpn_sqr so there wouldn't much of a saving. The current
+ code can be viewed as simply doing the first few steps of the powering in
+ a single or double limb where possible.
+
+ If r==b, and blow_twos==0, and r must be realloc'ed, then the temporary
+ copy made of b is unnecessary. We could just use the old alloc'ed block
+ and free it at the end. But arranging this seems like a lot more trouble
+ than it's worth. */
+
+
+/* floor(sqrt(GMP_NUMB_MAX)), ie. the biggest value that can be squared in
+ a limb without overflowing.
+ FIXME: This formula is an underestimate when GMP_NUMB_BITS is odd. */
+
+#define GMP_NUMB_HALFMAX (((mp_limb_t) 1 << GMP_NUMB_BITS/2) - 1)
+
+
+/* The following are for convenience, they update the size and check the
+ alloc. */
+
+#define MPN_SQR(dst, alloc, src, size) \
+ do { \
+ ASSERT (2*(size) <= (alloc)); \
+ mpn_sqr (dst, src, size); \
+ (size) *= 2; \
+ (size) -= ((dst)[(size)-1] == 0); \
+ } while (0)
+
+#define MPN_MUL(dst, alloc, src, size, src2, size2) \
+ do { \
+ mp_limb_t cy; \
+ ASSERT ((size) + (size2) <= (alloc)); \
+ cy = mpn_mul (dst, src, size, src2, size2); \
+ (size) += (size2) - (cy == 0); \
+ } while (0)
+
+#define MPN_MUL_2(ptr, size, alloc, mult) \
+ do { \
+ mp_limb_t cy; \
+ ASSERT ((size)+2 <= (alloc)); \
+ cy = mpn_mul_2 (ptr, ptr, size, mult); \
+ (size)++; \
+ (ptr)[(size)] = cy; \
+ (size) += (cy != 0); \
+ } while (0)
+
+#define MPN_MUL_1(ptr, size, alloc, limb) \
+ do { \
+ mp_limb_t cy; \
+ ASSERT ((size)+1 <= (alloc)); \
+ cy = mpn_mul_1 (ptr, ptr, size, limb); \
+ (ptr)[size] = cy; \
+ (size) += (cy != 0); \
+ } while (0)
+
+#define MPN_LSHIFT(ptr, size, alloc, shift) \
+ do { \
+ mp_limb_t cy; \
+ ASSERT ((size)+1 <= (alloc)); \
+ cy = mpn_lshift (ptr, ptr, size, shift); \
+ (ptr)[size] = cy; \
+ (size) += (cy != 0); \
+ } while (0)
+
+#define MPN_RSHIFT_OR_COPY(dst, src, size, shift) \
+ do { \
+ if ((shift) == 0) \
+ MPN_COPY (dst, src, size); \
+ else \
+ { \
+ mpn_rshift (dst, src, size, shift); \
+ (size) -= ((dst)[(size)-1] == 0); \
+ } \
+ } while (0)
+
+
+/* ralloc and talloc are only wanted for ASSERTs, after the initial space
+ allocations. Avoid writing values to them in a normal build, to ensure
+ the compiler lets them go dead. gcc already figures this out itself
+ actually. */
+
+#define SWAP_RP_TP \
+ do { \
+ MP_PTR_SWAP (rp, tp); \
+ ASSERT_CODE (MP_SIZE_T_SWAP (ralloc, talloc)); \
+ } while (0)
+
+
+void
+mpz_n_pow_ui (mpz_ptr r, mp_srcptr bp, mp_size_t bsize, unsigned long int e)
+{
+ mp_ptr rp;
+ mp_size_t rtwos_limbs, ralloc, rsize;
+ int rneg, i, cnt, btwos, r_bp_overlap;
+ mp_limb_t blimb, rl;
+ mp_bitcnt_t rtwos_bits;
+#if HAVE_NATIVE_mpn_mul_2
+ mp_limb_t blimb_low, rl_high;
+#else
+ mp_limb_t b_twolimbs[2];
+#endif
+ TMP_DECL;
+
+ TRACE (printf ("mpz_n_pow_ui rp=0x%lX bp=0x%lX bsize=%ld e=%lu (0x%lX)\n",
+ PTR(r), bp, bsize, e, e);
+ mpn_trace ("b", bp, bsize));
+
+ ASSERT (bsize == 0 || bp[ABS(bsize)-1] != 0);
+ ASSERT (MPN_SAME_OR_SEPARATE2_P (PTR(r), ALLOC(r), bp, ABS(bsize)));
+
+ /* b^0 == 1, including 0^0 == 1 */
+ if (e == 0)
+ {
+ PTR(r)[0] = 1;
+ SIZ(r) = 1;
+ return;
+ }
+
+ /* 0^e == 0 apart from 0^0 above */
+ if (bsize == 0)
+ {
+ SIZ(r) = 0;
+ return;
+ }
+
+ /* Sign of the final result. */
+ rneg = (bsize < 0 && (e & 1) != 0);
+ bsize = ABS (bsize);
+ TRACE (printf ("rneg %d\n", rneg));
+
+ r_bp_overlap = (PTR(r) == bp);
+
+ /* Strip low zero limbs from b. */
+ rtwos_limbs = 0;
+ for (blimb = *bp; blimb == 0; blimb = *++bp)
+ {
+ rtwos_limbs += e;
+ bsize--; ASSERT (bsize >= 1);
+ }
+ TRACE (printf ("trailing zero rtwos_limbs=%ld\n", rtwos_limbs));
+
+ /* Strip low zero bits from b. */
+ count_trailing_zeros (btwos, blimb);
+ blimb >>= btwos;
+ rtwos_bits = e * btwos;
+ rtwos_limbs += rtwos_bits / GMP_NUMB_BITS;
+ rtwos_bits %= GMP_NUMB_BITS;
+ TRACE (printf ("trailing zero btwos=%d rtwos_limbs=%ld rtwos_bits=%lu\n",
+ btwos, rtwos_limbs, rtwos_bits));
+
+ TMP_MARK;
+
+ rl = 1;
+#if HAVE_NATIVE_mpn_mul_2
+ rl_high = 0;
+#endif
+
+ if (bsize == 1)
+ {
+ bsize_1:
+ /* Power up as far as possible within blimb. We start here with e!=0,
+ but if e is small then we might reach e==0 and the whole b^e in rl.
+ Notice this code works when blimb==1 too, reaching e==0. */
+
+ while (blimb <= GMP_NUMB_HALFMAX)
+ {
+ TRACE (printf ("small e=0x%lX blimb=0x%lX rl=0x%lX\n",
+ e, blimb, rl));
+ ASSERT (e != 0);
+ if ((e & 1) != 0)
+ rl *= blimb;
+ e >>= 1;
+ if (e == 0)
+ goto got_rl;
+ blimb *= blimb;
+ }
+
+#if HAVE_NATIVE_mpn_mul_2
+ TRACE (printf ("single power, e=0x%lX b=0x%lX rl=0x%lX\n",
+ e, blimb, rl));
+
+ /* Can power b once more into blimb:blimb_low */
+ bsize = 2;
+ ASSERT (e != 0);
+ if ((e & 1) != 0)
+ {
+ umul_ppmm (rl_high, rl, rl, blimb << GMP_NAIL_BITS);
+ rl >>= GMP_NAIL_BITS;
+ }
+ e >>= 1;
+ umul_ppmm (blimb, blimb_low, blimb, blimb << GMP_NAIL_BITS);
+ blimb_low >>= GMP_NAIL_BITS;
+
+ got_rl:
+ TRACE (printf ("double power e=0x%lX blimb=0x%lX:0x%lX rl=0x%lX:%lX\n",
+ e, blimb, blimb_low, rl_high, rl));
+
+ /* Combine left-over rtwos_bits into rl_high:rl to be handled by the
+ final mul_1 or mul_2 rather than a separate lshift.
+ - rl_high:rl mustn't be 1 (since then there's no final mul)
+ - rl_high mustn't overflow
+ - rl_high mustn't change to non-zero, since mul_1+lshift is
+ probably faster than mul_2 (FIXME: is this true?) */
+
+ if (rtwos_bits != 0
+ && ! (rl_high == 0 && rl == 1)
+ && (rl_high >> (GMP_NUMB_BITS-rtwos_bits)) == 0)
+ {
+ mp_limb_t new_rl_high = (rl_high << rtwos_bits)
+ | (rl >> (GMP_NUMB_BITS-rtwos_bits));
+ if (! (rl_high == 0 && new_rl_high != 0))
+ {
+ rl_high = new_rl_high;
+ rl <<= rtwos_bits;
+ rtwos_bits = 0;
+ TRACE (printf ("merged rtwos_bits, rl=0x%lX:%lX\n",
+ rl_high, rl));
+ }
+ }
+#else
+ got_rl:
+ TRACE (printf ("small power e=0x%lX blimb=0x%lX rl=0x%lX\n",
+ e, blimb, rl));
+
+ /* Combine left-over rtwos_bits into rl to be handled by the final
+ mul_1 rather than a separate lshift.
+ - rl mustn't be 1 (since then there's no final mul)
+ - rl mustn't overflow */
+
+ if (rtwos_bits != 0
+ && rl != 1
+ && (rl >> (GMP_NUMB_BITS-rtwos_bits)) == 0)
+ {
+ rl <<= rtwos_bits;
+ rtwos_bits = 0;
+ TRACE (printf ("merged rtwos_bits, rl=0x%lX\n", rl));
+ }
+#endif
+ }
+ else if (bsize == 2)
+ {
+ mp_limb_t bsecond = bp[1];
+ if (btwos != 0)
+ blimb |= (bsecond << (GMP_NUMB_BITS - btwos)) & GMP_NUMB_MASK;
+ bsecond >>= btwos;
+ if (bsecond == 0)
+ {
+ /* Two limbs became one after rshift. */
+ bsize = 1;
+ goto bsize_1;
+ }
+
+ TRACE (printf ("bsize==2 using b=0x%lX:%lX", bsecond, blimb));
+#if HAVE_NATIVE_mpn_mul_2
+ blimb_low = blimb;
+#else
+ bp = b_twolimbs;
+ b_twolimbs[0] = blimb;
+ b_twolimbs[1] = bsecond;
+#endif
+ blimb = bsecond;
+ }
+ else
+ {
+ if (r_bp_overlap || btwos != 0)
+ {
+ mp_ptr tp = TMP_ALLOC_LIMBS (bsize);
+ MPN_RSHIFT_OR_COPY (tp, bp, bsize, btwos);
+ bp = tp;
+ TRACE (printf ("rshift or copy bp,bsize, new bsize=%ld\n", bsize));
+ }
+#if HAVE_NATIVE_mpn_mul_2
+ /* in case 3 limbs rshift to 2 and hence use the mul_2 loop below */
+ blimb_low = bp[0];
+#endif
+ blimb = bp[bsize-1];
+
+ TRACE (printf ("big bsize=%ld ", bsize);
+ mpn_trace ("b", bp, bsize));
+ }
+
+ /* At this point blimb is the most significant limb of the base to use.
+
+ Each factor of b takes (bsize*BPML-cnt) bits and there's e of them; +1
+ limb to round up the division; +1 for multiplies all using an extra
+ limb over the true size; +2 for rl at the end; +1 for lshift at the
+ end.
+
+ The size calculation here is reasonably accurate. The base is at least
+ half a limb, so in 32 bits the worst case is 2^16+1 treated as 17 bits
+ when it will power up as just over 16, an overestimate of 17/16 =
+ 6.25%. For a 64-bit limb it's half that.
+
+ If e==0 then blimb won't be anything useful (though it will be
+ non-zero), but that doesn't matter since we just end up with ralloc==5,
+ and that's fine for 2 limbs of rl and 1 of lshift. */
+
+ ASSERT (blimb != 0);
+ count_leading_zeros (cnt, blimb);
+ ralloc = (bsize*GMP_NUMB_BITS - cnt + GMP_NAIL_BITS) * e / GMP_NUMB_BITS + 5;
+ TRACE (printf ("ralloc %ld, from bsize=%ld blimb=0x%lX cnt=%d\n",
+ ralloc, bsize, blimb, cnt));
+ rp = MPZ_REALLOC (r, ralloc + rtwos_limbs);
+
+ /* Low zero limbs resulting from powers of 2. */
+ MPN_ZERO (rp, rtwos_limbs);
+ rp += rtwos_limbs;
+
+ if (e == 0)
+ {
+ /* Any e==0 other than via bsize==1 or bsize==2 is covered at the
+ start. */
+ rp[0] = rl;
+ rsize = 1;
+#if HAVE_NATIVE_mpn_mul_2
+ rp[1] = rl_high;
+ rsize += (rl_high != 0);
+#endif
+ ASSERT (rp[rsize-1] != 0);
+ }
+ else
+ {
+ mp_ptr tp;
+ mp_size_t talloc;
+
+ /* In the mpn_mul_1 or mpn_mul_2 loops or in the mpn_mul loop when the
+ low bit of e is zero, tp only has to hold the second last power
+ step, which is half the size of the final result. There's no need
+ to round up the divide by 2, since ralloc includes a +2 for rl
+ which not needed by tp. In the mpn_mul loop when the low bit of e
+ is 1, tp must hold nearly the full result, so just size it the same
+ as rp. */
+
+ talloc = ralloc;
+#if HAVE_NATIVE_mpn_mul_2
+ if (bsize <= 2 || (e & 1) == 0)
+ talloc /= 2;
+#else
+ if (bsize <= 1 || (e & 1) == 0)
+ talloc /= 2;
+#endif
+ TRACE (printf ("talloc %ld\n", talloc));
+ tp = TMP_ALLOC_LIMBS (talloc);
+
+ /* Go from high to low over the bits of e, starting with i pointing at
+ the bit below the highest 1 (which will mean i==-1 if e==1). */
+ count_leading_zeros (cnt, (mp_limb_t) e);
+ i = GMP_LIMB_BITS - cnt - 2;
+
+#if HAVE_NATIVE_mpn_mul_2
+ if (bsize <= 2)
+ {
+ mp_limb_t mult[2];
+
+ /* Any bsize==1 will have been powered above to be two limbs. */
+ ASSERT (bsize == 2);
+ ASSERT (blimb != 0);
+
+ /* Arrange the final result ends up in r, not in the temp space */
+ if ((i & 1) == 0)
+ SWAP_RP_TP;
+
+ rp[0] = blimb_low;
+ rp[1] = blimb;
+ rsize = 2;
+
+ mult[0] = blimb_low;
+ mult[1] = blimb;
+
+ for ( ; i >= 0; i--)
+ {
+ TRACE (printf ("mul_2 loop i=%d e=0x%lX, rsize=%ld ralloc=%ld talloc=%ld\n",
+ i, e, rsize, ralloc, talloc);
+ mpn_trace ("r", rp, rsize));
+
+ MPN_SQR (tp, talloc, rp, rsize);
+ SWAP_RP_TP;
+ if ((e & (1L << i)) != 0)
+ MPN_MUL_2 (rp, rsize, ralloc, mult);
+ }
+
+ TRACE (mpn_trace ("mul_2 before rl, r", rp, rsize));
+ if (rl_high != 0)
+ {
+ mult[0] = rl;
+ mult[1] = rl_high;
+ MPN_MUL_2 (rp, rsize, ralloc, mult);
+ }
+ else if (rl != 1)
+ MPN_MUL_1 (rp, rsize, ralloc, rl);
+ }
+#else
+ if (bsize == 1)
+ {
+ /* Arrange the final result ends up in r, not in the temp space */
+ if ((i & 1) == 0)
+ SWAP_RP_TP;
+
+ rp[0] = blimb;
+ rsize = 1;
+
+ for ( ; i >= 0; i--)
+ {
+ TRACE (printf ("mul_1 loop i=%d e=0x%lX, rsize=%ld ralloc=%ld talloc=%ld\n",
+ i, e, rsize, ralloc, talloc);
+ mpn_trace ("r", rp, rsize));
+
+ MPN_SQR (tp, talloc, rp, rsize);
+ SWAP_RP_TP;
+ if ((e & (1L << i)) != 0)
+ MPN_MUL_1 (rp, rsize, ralloc, blimb);
+ }
+
+ TRACE (mpn_trace ("mul_1 before rl, r", rp, rsize));
+ if (rl != 1)
+ MPN_MUL_1 (rp, rsize, ralloc, rl);
+ }
+#endif
+ else
+ {
+ int parity;
+
+ /* Arrange the final result ends up in r, not in the temp space */
+ ULONG_PARITY (parity, e);
+ if (((parity ^ i) & 1) != 0)
+ SWAP_RP_TP;
+
+ MPN_COPY (rp, bp, bsize);
+ rsize = bsize;
+
+ for ( ; i >= 0; i--)
+ {
+ TRACE (printf ("mul loop i=%d e=0x%lX, rsize=%ld ralloc=%ld talloc=%ld\n",
+ i, e, rsize, ralloc, talloc);
+ mpn_trace ("r", rp, rsize));
+
+ MPN_SQR (tp, talloc, rp, rsize);
+ SWAP_RP_TP;
+ if ((e & (1L << i)) != 0)
+ {
+ MPN_MUL (tp, talloc, rp, rsize, bp, bsize);
+ SWAP_RP_TP;
+ }
+ }
+ }
+ }
+
+ ASSERT (rp == PTR(r) + rtwos_limbs);
+ TRACE (mpn_trace ("end loop r", rp, rsize));
+ TMP_FREE;
+
+ /* Apply any partial limb factors of 2. */
+ if (rtwos_bits != 0)
+ {
+ MPN_LSHIFT (rp, rsize, ralloc, (unsigned) rtwos_bits);
+ TRACE (mpn_trace ("lshift r", rp, rsize));
+ }
+
+ rsize += rtwos_limbs;
+ SIZ(r) = (rneg ? -rsize : rsize);
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpz/neg.c b/Build/source/libs/gmp/gmp-6.0.0/mpz/neg.c
new file mode 100644
index 00000000000..eb46ab7f785
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpz/neg.c
@@ -0,0 +1,57 @@
+/* mpz_neg(mpz_ptr dst, mpz_ptr src) -- Assign the negated value of SRC to DST.
+
+Copyright 1991, 1993-1995, 2001, 2012 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_FORCE_mpz_neg 1
+
+#include "gmp.h"
+#include "gmp-impl.h"
+
+void
+mpz_neg (mpz_ptr w, mpz_srcptr u)
+{
+ mp_ptr wp;
+ mp_srcptr up;
+ mp_size_t usize, size;
+
+ usize = SIZ (u);
+
+ if (u != w)
+ {
+ size = ABS (usize);
+
+ wp = MPZ_NEWALLOC (w, size);
+
+ up = PTR (u);
+
+ MPN_COPY (wp, up, size);
+ }
+
+ SIZ (w) = -usize;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpz/nextprime.c b/Build/source/libs/gmp/gmp-6.0.0/mpz/nextprime.c
new file mode 100644
index 00000000000..1493054695c
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpz/nextprime.c
@@ -0,0 +1,129 @@
+/* mpz_nextprime(p,t) - compute the next prime > t and store that in p.
+
+Copyright 1999-2001, 2008, 2009, 2012 Free Software Foundation, Inc.
+
+Contributed to the GNU project by Niels Möller and Torbjorn Granlund.
+
+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.h"
+#include "gmp-impl.h"
+#include "longlong.h"
+
+static const unsigned char primegap[] =
+{
+ 2,2,4,2,4,2,4,6,2,6,4,2,4,6,6,2,6,4,2,6,4,6,8,4,2,4,2,4,14,4,6,
+ 2,10,2,6,6,4,6,6,2,10,2,4,2,12,12,4,2,4,6,2,10,6,6,6,2,6,4,2,10,14,4,2,
+ 4,14,6,10,2,4,6,8,6,6,4,6,8,4,8,10,2,10,2,6,4,6,8,4,2,4,12,8,4,8,4,6,
+ 12,2,18,6,10,6,6,2,6,10,6,6,2,6,6,4,2,12,10,2,4,6,6,2,12,4,6,8,10,8,10,8,
+ 6,6,4,8,6,4,8,4,14,10,12,2,10,2,4,2,10,14,4,2,4,14,4,2,4,20,4,8,10,8,4,6,
+ 6,14,4,6,6,8,6,12
+};
+
+#define NUMBER_OF_PRIMES 167
+
+void
+mpz_nextprime (mpz_ptr p, mpz_srcptr n)
+{
+ unsigned short *moduli;
+ unsigned long difference;
+ int i;
+ unsigned prime_limit;
+ unsigned long prime;
+ mp_size_t pn;
+ mp_bitcnt_t nbits;
+ unsigned incr;
+ TMP_SDECL;
+
+ /* First handle tiny numbers */
+ if (mpz_cmp_ui (n, 2) < 0)
+ {
+ mpz_set_ui (p, 2);
+ return;
+ }
+ mpz_add_ui (p, n, 1);
+ mpz_setbit (p, 0);
+
+ if (mpz_cmp_ui (p, 7) <= 0)
+ return;
+
+ pn = SIZ(p);
+ MPN_SIZEINBASE_2EXP(nbits, PTR(p), pn, 1);
+ if (nbits / 2 >= NUMBER_OF_PRIMES)
+ prime_limit = NUMBER_OF_PRIMES - 1;
+ else
+ prime_limit = nbits / 2;
+
+ TMP_SMARK;
+
+ /* Compute residues modulo small odd primes */
+ moduli = TMP_SALLOC_TYPE (prime_limit * sizeof moduli[0], unsigned short);
+
+ for (;;)
+ {
+ /* FIXME: Compute lazily? */
+ prime = 3;
+ for (i = 0; i < prime_limit; i++)
+ {
+ moduli[i] = mpz_fdiv_ui (p, prime);
+ prime += primegap[i];
+ }
+
+#define INCR_LIMIT 0x10000 /* deep science */
+
+ for (difference = incr = 0; incr < INCR_LIMIT; difference += 2)
+ {
+ /* First check residues */
+ prime = 3;
+ for (i = 0; i < prime_limit; i++)
+ {
+ unsigned r;
+ /* FIXME: Reduce moduli + incr and store back, to allow for
+ division-free reductions. Alternatively, table primes[]'s
+ inverses (mod 2^16). */
+ r = (moduli[i] + incr) % prime;
+ prime += primegap[i];
+
+ if (r == 0)
+ goto next;
+ }
+
+ mpz_add_ui (p, p, difference);
+ difference = 0;
+
+ /* Miller-Rabin test */
+ if (mpz_millerrabin (p, 25))
+ goto done;
+ next:;
+ incr += 2;
+ }
+ mpz_add_ui (p, p, difference);
+ difference = 0;
+ }
+ done:
+ TMP_SFREE;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpz/oddfac_1.c b/Build/source/libs/gmp/gmp-6.0.0/mpz/oddfac_1.c
new file mode 100644
index 00000000000..cf0bff06505
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpz/oddfac_1.c
@@ -0,0 +1,427 @@
+/* mpz_oddfac_1(RESULT, N) -- Set RESULT to the odd factor of N!.
+
+Contributed to the GNU project by Marco Bodrato.
+
+THE FUNCTION IN THIS FILE IS INTERNAL WITH A MUTABLE INTERFACE.
+IT IS ONLY 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 2010-2012 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.h"
+#include "gmp-impl.h"
+#include "longlong.h"
+
+/* TODO:
+ - split this file in smaller parts with functions that can be recycled for different computations.
+ */
+
+/**************************************************************/
+/* Section macros: common macros, for mswing/fac/bin (&sieve) */
+/**************************************************************/
+
+#define FACTOR_LIST_APPEND(PR, MAX_PR, VEC, I) \
+ if ((PR) > (MAX_PR)) { \
+ (VEC)[(I)++] = (PR); \
+ (PR) = 1; \
+ }
+
+#define FACTOR_LIST_STORE(P, PR, MAX_PR, VEC, I) \
+ do { \
+ if ((PR) > (MAX_PR)) { \
+ (VEC)[(I)++] = (PR); \
+ (PR) = (P); \
+ } else \
+ (PR) *= (P); \
+ } while (0)
+
+#define LOOP_ON_SIEVE_CONTINUE(prime,end,sieve) \
+ __max_i = (end); \
+ \
+ do { \
+ ++__i; \
+ if (((sieve)[__index] & __mask) == 0) \
+ { \
+ (prime) = id_to_n(__i)
+
+#define LOOP_ON_SIEVE_BEGIN(prime,start,end,off,sieve) \
+ do { \
+ mp_limb_t __mask, __index, __max_i, __i; \
+ \
+ __i = (start)-(off); \
+ __index = __i / GMP_LIMB_BITS; \
+ __mask = CNST_LIMB(1) << (__i % GMP_LIMB_BITS); \
+ __i += (off); \
+ \
+ LOOP_ON_SIEVE_CONTINUE(prime,end,sieve)
+
+#define LOOP_ON_SIEVE_STOP \
+ } \
+ __mask = __mask << 1 | __mask >> (GMP_LIMB_BITS-1); \
+ __index += __mask & 1; \
+ } while (__i <= __max_i) \
+
+#define LOOP_ON_SIEVE_END \
+ LOOP_ON_SIEVE_STOP; \
+ } while (0)
+
+/*********************************************************/
+/* Section sieve: sieving functions and tools for primes */
+/*********************************************************/
+
+#if WANT_ASSERT
+static mp_limb_t
+bit_to_n (mp_limb_t bit) { return (bit*3+4)|1; }
+#endif
+
+/* id_to_n (x) = bit_to_n (x-1) = (id*3+1)|1*/
+static mp_limb_t
+id_to_n (mp_limb_t id) { return id*3+1+(id&1); }
+
+/* n_to_bit (n) = ((n-1)&(-CNST_LIMB(2)))/3U-1 */
+static mp_limb_t
+n_to_bit (mp_limb_t n) { return ((n-5)|1)/3U; }
+
+#if WANT_ASSERT
+static mp_size_t
+primesieve_size (mp_limb_t n) { return n_to_bit(n) / GMP_LIMB_BITS + 1; }
+#endif
+
+/*********************************************************/
+/* Section mswing: 2-multiswing factorial */
+/*********************************************************/
+
+/* Returns an approximation of the sqare root of x. *
+ * It gives: x <= limb_apprsqrt (x) ^ 2 < x * 9/4 */
+static mp_limb_t
+limb_apprsqrt (mp_limb_t x)
+{
+ int s;
+
+ ASSERT (x > 2);
+ count_leading_zeros (s, x - 1);
+ s = GMP_LIMB_BITS - 1 - s;
+ return (CNST_LIMB(1) << (s >> 1)) + (CNST_LIMB(1) << ((s - 1) >> 1));
+}
+
+#if 0
+/* A count-then-exponentiate variant for SWING_A_PRIME */
+#define SWING_A_PRIME(P, N, PR, MAX_PR, VEC, I) \
+ do { \
+ mp_limb_t __q, __prime; \
+ int __exp; \
+ __prime = (P); \
+ __exp = 0; \
+ __q = (N); \
+ do { \
+ __q /= __prime; \
+ __exp += __q & 1; \
+ } while (__q >= __prime); \
+ if (__exp) { /* Store $prime^{exp}$ */ \
+ for (__q = __prime; --__exp; __q *= __prime); \
+ FACTOR_LIST_STORE(__q, PR, MAX_PR, VEC, I); \
+ }; \
+ } while (0)
+#else
+#define SWING_A_PRIME(P, N, PR, MAX_PR, VEC, I) \
+ do { \
+ mp_limb_t __q, __prime; \
+ __prime = (P); \
+ FACTOR_LIST_APPEND(PR, MAX_PR, VEC, I); \
+ __q = (N); \
+ do { \
+ __q /= __prime; \
+ if ((__q & 1) != 0) (PR) *= __prime; \
+ } while (__q >= __prime); \
+ } while (0)
+#endif
+
+#define SH_SWING_A_PRIME(P, N, PR, MAX_PR, VEC, I) \
+ do { \
+ mp_limb_t __prime; \
+ __prime = (P); \
+ if ((((N) / __prime) & 1) != 0) \
+ FACTOR_LIST_STORE(__prime, PR, MAX_PR, VEC, I); \
+ } while (0)
+
+/* mpz_2multiswing_1 computes the odd part of the 2-multiswing
+ factorial of the parameter n. The result x is an odd positive
+ integer so that multiswing(n,2) = x 2^a.
+
+ Uses the algorithm described by Peter Luschny in "Divide, Swing and
+ Conquer the Factorial!".
+
+ The pointer sieve points to primesieve_size(n) limbs containing a
+ bit-array where primes are marked as 0.
+ Enough (FIXME: explain :-) limbs must be pointed by factors.
+ */
+
+static void
+mpz_2multiswing_1 (mpz_ptr x, mp_limb_t n, mp_ptr sieve, mp_ptr factors)
+{
+ mp_limb_t prod, max_prod;
+ mp_size_t j;
+
+ ASSERT (n >= 26);
+
+ j = 0;
+ prod = -(n & 1);
+ n &= ~ CNST_LIMB(1); /* n-1, if n is odd */
+
+ prod = (prod & n) + 1; /* the original n, if it was odd, 1 otherwise */
+ max_prod = GMP_NUMB_MAX / (n-1);
+
+ /* Handle prime = 3 separately. */
+ SWING_A_PRIME (3, n, prod, max_prod, factors, j);
+
+ /* Swing primes from 5 to n/3 */
+ {
+ mp_limb_t s;
+
+ {
+ mp_limb_t prime;
+
+ s = limb_apprsqrt(n);
+ ASSERT (s >= 5);
+ s = n_to_bit (s);
+ LOOP_ON_SIEVE_BEGIN (prime, n_to_bit (5), s, 0,sieve);
+ SWING_A_PRIME (prime, n, prod, max_prod, factors, j);
+ LOOP_ON_SIEVE_END;
+ s++;
+ }
+
+ ASSERT (max_prod <= GMP_NUMB_MAX / 3);
+ ASSERT (bit_to_n (s) * bit_to_n (s) > n);
+ ASSERT (s <= n_to_bit (n / 3));
+ {
+ mp_limb_t prime;
+ mp_limb_t l_max_prod = max_prod * 3;
+
+ LOOP_ON_SIEVE_BEGIN (prime, s, n_to_bit (n/3), 0, sieve);
+ SH_SWING_A_PRIME (prime, n, prod, l_max_prod, factors, j);
+ LOOP_ON_SIEVE_END;
+ }
+ }
+
+ /* Store primes from (n+1)/2 to n */
+ {
+ mp_limb_t prime;
+ LOOP_ON_SIEVE_BEGIN (prime, n_to_bit (n >> 1) + 1, n_to_bit (n), 0,sieve);
+ FACTOR_LIST_STORE (prime, prod, max_prod, factors, j);
+ LOOP_ON_SIEVE_END;
+ }
+
+ if (LIKELY (j != 0))
+ {
+ factors[j++] = prod;
+ mpz_prodlimbs (x, factors, j);
+ }
+ else
+ {
+ PTR (x)[0] = prod;
+ SIZ (x) = 1;
+ }
+}
+
+#undef SWING_A_PRIME
+#undef SH_SWING_A_PRIME
+#undef LOOP_ON_SIEVE_END
+#undef LOOP_ON_SIEVE_STOP
+#undef LOOP_ON_SIEVE_BEGIN
+#undef LOOP_ON_SIEVE_CONTINUE
+#undef FACTOR_LIST_APPEND
+
+/*********************************************************/
+/* Section oddfac: odd factorial, needed also by binomial*/
+/*********************************************************/
+
+#if TUNE_PROGRAM_BUILD
+#define FACTORS_PER_LIMB (GMP_NUMB_BITS / (LOG2C(FAC_DSC_THRESHOLD_LIMIT-1)+1))
+#else
+#define FACTORS_PER_LIMB (GMP_NUMB_BITS / (LOG2C(FAC_DSC_THRESHOLD-1)+1))
+#endif
+
+/* mpz_oddfac_1 computes the odd part of the factorial of the
+ parameter n. I.e. n! = x 2^a, where x is the returned value: an
+ odd positive integer.
+
+ If flag != 0 a square is skipped in the DSC part, e.g.
+ if n is odd, n > FAC_DSC_THRESHOLD and flag = 1, x is set to n!!.
+
+ If n is too small, flag is ignored, and an ASSERT can be triggered.
+
+ TODO: FAC_DSC_THRESHOLD is used here with two different roles:
+ - to decide when prime factorisation is needed,
+ - to stop the recursion, once sieving is done.
+ Maybe two thresholds can do a better job.
+ */
+void
+mpz_oddfac_1 (mpz_ptr x, mp_limb_t n, unsigned flag)
+{
+ ASSERT (n <= GMP_NUMB_MAX);
+ ASSERT (flag == 0 || (flag == 1 && n > ODD_FACTORIAL_TABLE_LIMIT && ABOVE_THRESHOLD (n, FAC_DSC_THRESHOLD)));
+
+ if (n <= ODD_FACTORIAL_TABLE_LIMIT)
+ {
+ PTR (x)[0] = __gmp_oddfac_table[n];
+ SIZ (x) = 1;
+ }
+ else if (n <= ODD_DOUBLEFACTORIAL_TABLE_LIMIT + 1)
+ {
+ mp_ptr px;
+
+ px = MPZ_NEWALLOC (x, 2);
+ umul_ppmm (px[1], px[0], __gmp_odd2fac_table[(n - 1) >> 1], __gmp_oddfac_table[n >> 1]);
+ SIZ (x) = 2;
+ }
+ else
+ {
+ unsigned s;
+ mp_ptr factors;
+
+ s = 0;
+ {
+ mp_limb_t tn;
+ mp_limb_t prod, max_prod, i;
+ mp_size_t j;
+ TMP_SDECL;
+
+#if TUNE_PROGRAM_BUILD
+ ASSERT (FAC_DSC_THRESHOLD_LIMIT >= FAC_DSC_THRESHOLD);
+ ASSERT (FAC_DSC_THRESHOLD >= 2 * (ODD_DOUBLEFACTORIAL_TABLE_LIMIT + 2));
+#endif
+
+ /* Compute the number of recursive steps for the DSC algorithm. */
+ for (tn = n; ABOVE_THRESHOLD (tn, FAC_DSC_THRESHOLD); s++)
+ tn >>= 1;
+
+ j = 0;
+
+ TMP_SMARK;
+ factors = TMP_SALLOC_LIMBS (1 + tn / FACTORS_PER_LIMB);
+ ASSERT (tn >= FACTORS_PER_LIMB);
+
+ prod = 1;
+#if TUNE_PROGRAM_BUILD
+ max_prod = GMP_NUMB_MAX / FAC_DSC_THRESHOLD_LIMIT;
+#else
+ max_prod = GMP_NUMB_MAX / FAC_DSC_THRESHOLD;
+#endif
+
+ ASSERT (tn > ODD_DOUBLEFACTORIAL_TABLE_LIMIT + 1);
+ do {
+ i = ODD_DOUBLEFACTORIAL_TABLE_LIMIT + 2;
+ factors[j++] = ODD_DOUBLEFACTORIAL_TABLE_MAX;
+ do {
+ FACTOR_LIST_STORE (i, prod, max_prod, factors, j);
+ i += 2;
+ } while (i <= tn);
+ max_prod <<= 1;
+ tn >>= 1;
+ } while (tn > ODD_DOUBLEFACTORIAL_TABLE_LIMIT + 1);
+
+ factors[j++] = prod;
+ factors[j++] = __gmp_odd2fac_table[(tn - 1) >> 1];
+ factors[j++] = __gmp_oddfac_table[tn >> 1];
+ mpz_prodlimbs (x, factors, j);
+
+ TMP_SFREE;
+ }
+
+ if (s != 0)
+ /* Use the algorithm described by Peter Luschny in "Divide,
+ Swing and Conquer the Factorial!".
+
+ Improvement: there are two temporary buffers, factors and
+ square, that are never used together; with a good estimate
+ of the maximal needed size, they could share a single
+ allocation.
+ */
+ {
+ mpz_t mswing;
+ mp_ptr sieve;
+ mp_size_t size;
+ TMP_DECL;
+
+ TMP_MARK;
+
+ flag--;
+ size = n / GMP_NUMB_BITS + 4;
+ ASSERT (primesieve_size (n - 1) <= size - (size / 2 + 1));
+ /* 2-multiswing(n) < 2^(n-1)*sqrt(n/pi) < 2^(n+GMP_NUMB_BITS);
+ one more can be overwritten by mul, another for the sieve */
+ MPZ_TMP_INIT (mswing, size);
+ /* Initialize size, so that ASSERT can check it correctly. */
+ ASSERT_CODE (SIZ (mswing) = 0);
+
+ /* Put the sieve on the second half, it will be overwritten by the last mswing. */
+ sieve = PTR (mswing) + size / 2 + 1;
+
+ size = (gmp_primesieve (sieve, n - 1) + 1) / log_n_max (n) + 1;
+
+ factors = TMP_ALLOC_LIMBS (size);
+ do {
+ mp_ptr square, px;
+ mp_size_t nx, ns;
+ mp_limb_t cy;
+ TMP_DECL;
+
+ s--;
+ ASSERT (ABSIZ (mswing) < ALLOC (mswing) / 2); /* Check: sieve has not been overwritten */
+ mpz_2multiswing_1 (mswing, n >> s, sieve, factors);
+
+ TMP_MARK;
+ nx = SIZ (x);
+ if (s == flag) {
+ size = nx;
+ square = TMP_ALLOC_LIMBS (size);
+ MPN_COPY (square, PTR (x), nx);
+ } else {
+ size = nx << 1;
+ square = TMP_ALLOC_LIMBS (size);
+ mpn_sqr (square, PTR (x), nx);
+ size -= (square[size - 1] == 0);
+ }
+ ns = SIZ (mswing);
+ nx = size + ns;
+ px = MPZ_NEWALLOC (x, nx);
+ ASSERT (ns <= size);
+ cy = mpn_mul (px, square, size, PTR(mswing), ns); /* n!= n$ * floor(n/2)!^2 */
+
+ TMP_FREE;
+ SIZ(x) = nx - (cy == 0);
+ } while (s != 0);
+ TMP_FREE;
+ }
+ }
+}
+
+#undef FACTORS_PER_LIMB
+#undef FACTOR_LIST_STORE
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpz/out_raw.c b/Build/source/libs/gmp/gmp-6.0.0/mpz/out_raw.c
new file mode 100644
index 00000000000..3b6b0b7cb5d
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpz/out_raw.c
@@ -0,0 +1,173 @@
+/* mpz_out_raw -- write an mpz_t in raw format.
+
+Copyright 2001, 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/. */
+
+#include <stdio.h>
+#include "gmp.h"
+#include "gmp-impl.h"
+#include "longlong.h"
+
+
+/* HTON_LIMB_STORE takes a normal host byte order limb and stores it as
+ network byte order (ie. big endian). */
+
+#if HAVE_LIMB_BIG_ENDIAN
+#define HTON_LIMB_STORE(dst, limb) do { *(dst) = (limb); } while (0)
+#endif
+
+#if HAVE_LIMB_LITTLE_ENDIAN
+#define HTON_LIMB_STORE(dst, limb) BSWAP_LIMB_STORE (dst, limb)
+#endif
+
+#ifndef HTON_LIMB_STORE
+#define HTON_LIMB_STORE(dst, limb) \
+ do { \
+ mp_limb_t __limb = (limb); \
+ char *__p = (char *) (dst); \
+ int __i; \
+ for (__i = 0; __i < GMP_LIMB_BYTES; __i++) \
+ __p[__i] = (char) (__limb >> ((GMP_LIMB_BYTES-1 - __i) * 8)); \
+ } while (0)
+#endif
+
+
+size_t
+mpz_out_raw (FILE *fp, mpz_srcptr x)
+{
+ mp_size_t xsize, abs_xsize, bytes, i;
+ mp_srcptr xp;
+ char *tp, *bp;
+ mp_limb_t xlimb;
+ int zeros;
+ size_t tsize, ssize;
+
+ xsize = SIZ(x);
+ abs_xsize = ABS (xsize);
+ bytes = (abs_xsize * GMP_NUMB_BITS + 7) / 8;
+ tsize = ROUND_UP_MULTIPLE ((unsigned) 4, GMP_LIMB_BYTES) + bytes;
+
+ tp = __GMP_ALLOCATE_FUNC_TYPE (tsize, char);
+ bp = tp + ROUND_UP_MULTIPLE ((unsigned) 4, GMP_LIMB_BYTES);
+
+ if (bytes != 0)
+ {
+ bp += bytes;
+ xp = PTR (x);
+ i = abs_xsize;
+
+ if (GMP_NAIL_BITS == 0)
+ {
+ /* reverse limb order, and byte swap if necessary */
+#ifdef _CRAY
+ _Pragma ("_CRI ivdep");
+#endif
+ do
+ {
+ bp -= GMP_LIMB_BYTES;
+ xlimb = *xp;
+ HTON_LIMB_STORE ((mp_ptr) bp, xlimb);
+ xp++;
+ }
+ while (--i > 0);
+
+ /* strip high zero bytes (without fetching from bp) */
+ count_leading_zeros (zeros, xlimb);
+ zeros /= 8;
+ bp += zeros;
+ bytes -= zeros;
+ }
+ else
+ {
+ mp_limb_t new_xlimb;
+ int bits;
+ ASSERT_CODE (char *bp_orig = bp - bytes);
+
+ ASSERT_ALWAYS (GMP_NUMB_BITS >= 8);
+
+ bits = 0;
+ xlimb = 0;
+ for (;;)
+ {
+ while (bits >= 8)
+ {
+ ASSERT (bp > bp_orig);
+ *--bp = xlimb & 0xFF;
+ xlimb >>= 8;
+ bits -= 8;
+ }
+
+ if (i == 0)
+ break;
+
+ new_xlimb = *xp++;
+ i--;
+ ASSERT (bp > bp_orig);
+ *--bp = (xlimb | (new_xlimb << bits)) & 0xFF;
+ xlimb = new_xlimb >> (8 - bits);
+ bits += GMP_NUMB_BITS - 8;
+ }
+
+ if (bits != 0)
+ {
+ ASSERT (bp > bp_orig);
+ *--bp = xlimb;
+ }
+
+ ASSERT (bp == bp_orig);
+ while (*bp == 0)
+ {
+ bp++;
+ bytes--;
+ }
+ }
+ }
+
+ /* total bytes to be written */
+ ssize = 4 + bytes;
+
+ /* twos complement negative for the size value */
+ bytes = (xsize >= 0 ? bytes : -bytes);
+
+ /* so we don't rely on sign extension in ">>" */
+ ASSERT_ALWAYS (sizeof (bytes) >= 4);
+
+ bp[-4] = bytes >> 24;
+ bp[-3] = bytes >> 16;
+ bp[-2] = bytes >> 8;
+ bp[-1] = bytes;
+ bp -= 4;
+
+ if (fp == 0)
+ fp = stdout;
+ if (fwrite (bp, ssize, 1, fp) != 1)
+ ssize = 0;
+
+ (*__gmp_free_func) (tp, tsize);
+ return ssize;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpz/out_str.c b/Build/source/libs/gmp/gmp-6.0.0/mpz/out_str.c
new file mode 100644
index 00000000000..6c97039c64b
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpz/out_str.c
@@ -0,0 +1,112 @@
+/* mpz_out_str(stream, base, integer) -- Output to STREAM the multi prec.
+ integer INTEGER in base BASE.
+
+Copyright 1991, 1993, 1994, 1996, 2001, 2005, 2011, 2012 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.h"
+#include "gmp-impl.h"
+#include "longlong.h"
+
+size_t
+mpz_out_str (FILE *stream, int base, mpz_srcptr x)
+{
+ mp_ptr xp;
+ mp_size_t x_size = SIZ (x);
+ unsigned char *str;
+ size_t str_size;
+ size_t i;
+ size_t written;
+ const char *num_to_text;
+ TMP_DECL;
+
+ if (stream == 0)
+ stream = stdout;
+
+ if (base >= 0)
+ {
+ num_to_text = "0123456789abcdefghijklmnopqrstuvwxyz";
+ if (base <= 1)
+ base = 10;
+ else if (base > 36)
+ {
+ num_to_text = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
+ if (base > 62)
+ return 0;
+ }
+ }
+ else
+ {
+ base = -base;
+ if (base <= 1)
+ base = 10;
+ else if (base > 36)
+ return 0;
+ num_to_text = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
+ }
+
+ written = 0;
+
+ if (x_size < 0)
+ {
+ fputc ('-', stream);
+ x_size = -x_size;
+ written = 1;
+ }
+
+ TMP_MARK;
+
+ DIGITS_IN_BASE_PER_LIMB (str_size, x_size, base);
+ str_size += 3;
+ str = (unsigned char *) TMP_ALLOC (str_size);
+
+ xp = PTR (x);
+ if (! POW2_P (base))
+ {
+ xp = TMP_ALLOC_LIMBS (x_size | 1); /* |1 in case x_size==0 */
+ MPN_COPY (xp, PTR (x), x_size);
+ }
+
+ str_size = mpn_get_str (str, base, xp, x_size);
+
+ /* Convert result to printable chars. */
+ for (i = 0; i < str_size; i++)
+ str[i] = num_to_text[str[i]];
+ str[str_size] = 0;
+
+ {
+ size_t fwret;
+ fwret = fwrite ((char *) str, 1, str_size, stream);
+ written += fwret;
+ }
+
+ TMP_FREE;
+ return ferror (stream) ? 0 : written;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpz/perfpow.c b/Build/source/libs/gmp/gmp-6.0.0/mpz/perfpow.c
new file mode 100644
index 00000000000..72ff3c89ac4
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpz/perfpow.c
@@ -0,0 +1,39 @@
+/* mpz_perfect_power_p(arg) -- Return non-zero if ARG is a perfect power,
+ zero otherwise.
+
+Copyright 1998-2001, 2005, 2008, 2009 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.h"
+#include "gmp-impl.h"
+
+int
+mpz_perfect_power_p (mpz_srcptr u)
+{
+ return mpn_perfect_power_p (PTR (u), SIZ (u));
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpz/perfsqr.c b/Build/source/libs/gmp/gmp-6.0.0/mpz/perfsqr.c
new file mode 100644
index 00000000000..534f10ff563
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpz/perfsqr.c
@@ -0,0 +1,35 @@
+/* mpz_perfect_square_p(arg) -- Return non-zero if ARG is a perfect square,
+ zero otherwise.
+
+Copyright 1991, 1993, 1994, 1996, 2000, 2001 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_FORCE_mpz_perfect_square_p 1
+
+#include "gmp.h"
+#include "gmp-impl.h"
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpz/popcount.c b/Build/source/libs/gmp/gmp-6.0.0/mpz/popcount.c
new file mode 100644
index 00000000000..06f0f0b3a26
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpz/popcount.c
@@ -0,0 +1,35 @@
+/* mpz_popcount(mpz_ptr op) -- Population count of OP. If the operand is
+ negative, return ~0 (a novel representation of infinity).
+
+Copyright 1994, 1996, 2001 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_FORCE_mpz_popcount 1
+
+#include "gmp.h"
+#include "gmp-impl.h"
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpz/pow_ui.c b/Build/source/libs/gmp/gmp-6.0.0/mpz/pow_ui.c
new file mode 100644
index 00000000000..4891e978774
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpz/pow_ui.c
@@ -0,0 +1,53 @@
+/* mpz_pow_ui -- mpz raised to ulong.
+
+Copyright 2001, 2008 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.h"
+#include "gmp-impl.h"
+
+void
+mpz_pow_ui (mpz_ptr r, mpz_srcptr b, unsigned long int e)
+{
+ /* We test some small exponents here, mainly to avoid the overhead of
+ mpz_n_pow_ui for small bases and exponents. */
+ switch (e)
+ {
+ case 0:
+ mpz_set_ui (r, 1);
+ break;
+ case 1:
+ mpz_set (r, b);
+ break;
+ case 2:
+ mpz_mul (r, b, b);
+ break;
+ default:
+ mpz_n_pow_ui (r, PTR(b), (mp_size_t) SIZ(b), e);
+ }
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpz/powm.c b/Build/source/libs/gmp/gmp-6.0.0/mpz/powm.c
new file mode 100644
index 00000000000..4d13da7396f
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpz/powm.c
@@ -0,0 +1,283 @@
+/* mpz_powm(res,base,exp,mod) -- Set R to (U^E) mod M.
+
+ Contributed to the GNU project by Torbjorn Granlund.
+
+Copyright 1991, 1993, 1994, 1996, 1997, 2000-2002, 2005, 2008, 2009, 2011, 2012
+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.h"
+#include "gmp-impl.h"
+#include "longlong.h"
+
+
+/* TODO
+
+ * Improve handling of buffers. It is pretty ugly now.
+
+ * For even moduli, we compute a binvert of its odd part both here and in
+ mpn_powm. How can we avoid this recomputation?
+*/
+
+/*
+ b ^ e mod m res
+ 0 0 0 ?
+ 0 e 0 ?
+ 0 0 m ?
+ 0 e m 0
+ b 0 0 ?
+ b e 0 ?
+ b 0 m 1 mod m
+ b e m b^e mod m
+*/
+
+#define HANDLE_NEGATIVE_EXPONENT 1
+
+void
+mpz_powm (mpz_ptr r, mpz_srcptr b, mpz_srcptr e, mpz_srcptr m)
+{
+ mp_size_t n, nodd, ncnt;
+ int cnt;
+ mp_ptr rp, tp;
+ mp_srcptr bp, ep, mp;
+ mp_size_t rn, bn, es, en, itch;
+ mpz_t new_b; /* note: value lives long via 'b' */
+ TMP_DECL;
+
+ n = ABSIZ(m);
+ if (UNLIKELY (n == 0))
+ DIVIDE_BY_ZERO;
+
+ mp = PTR(m);
+
+ TMP_MARK;
+
+ es = SIZ(e);
+ if (UNLIKELY (es <= 0))
+ {
+ if (es == 0)
+ {
+ /* b^0 mod m, b is anything and m is non-zero.
+ Result is 1 mod m, i.e., 1 or 0 depending on if m = 1. */
+ SIZ(r) = n != 1 || mp[0] != 1;
+ PTR(r)[0] = 1;
+ TMP_FREE; /* we haven't really allocated anything here */
+ return;
+ }
+#if HANDLE_NEGATIVE_EXPONENT
+ MPZ_TMP_INIT (new_b, n + 1);
+
+ if (UNLIKELY (! mpz_invert (new_b, b, m)))
+ DIVIDE_BY_ZERO;
+ b = new_b;
+ es = -es;
+#else
+ DIVIDE_BY_ZERO;
+#endif
+ }
+ en = es;
+
+ bn = ABSIZ(b);
+
+ if (UNLIKELY (bn == 0))
+ {
+ SIZ(r) = 0;
+ TMP_FREE;
+ return;
+ }
+
+ ep = PTR(e);
+
+ /* Handle (b^1 mod m) early, since mpn_pow* do not handle that case. */
+ if (UNLIKELY (en == 1 && ep[0] == 1))
+ {
+ rp = TMP_ALLOC_LIMBS (n);
+ bp = PTR(b);
+ if (bn >= n)
+ {
+ mp_ptr qp = TMP_ALLOC_LIMBS (bn - n + 1);
+ mpn_tdiv_qr (qp, rp, 0L, bp, bn, mp, n);
+ rn = n;
+ MPN_NORMALIZE (rp, rn);
+
+ if (SIZ(b) < 0 && rn != 0)
+ {
+ mpn_sub (rp, mp, n, rp, rn);
+ rn = n;
+ MPN_NORMALIZE (rp, rn);
+ }
+ }
+ else
+ {
+ if (SIZ(b) < 0)
+ {
+ mpn_sub (rp, mp, n, bp, bn);
+ rn = n;
+ rn -= (rp[rn - 1] == 0);
+ }
+ else
+ {
+ MPN_COPY (rp, bp, bn);
+ rn = bn;
+ }
+ }
+ goto ret;
+ }
+
+ /* Remove low zero limbs from M. This loop will terminate for correctly
+ represented mpz numbers. */
+ ncnt = 0;
+ while (UNLIKELY (mp[0] == 0))
+ {
+ mp++;
+ ncnt++;
+ }
+ nodd = n - ncnt;
+ cnt = 0;
+ if (mp[0] % 2 == 0)
+ {
+ mp_ptr newmp = TMP_ALLOC_LIMBS (nodd);
+ count_trailing_zeros (cnt, mp[0]);
+ mpn_rshift (newmp, mp, nodd, cnt);
+ nodd -= newmp[nodd - 1] == 0;
+ mp = newmp;
+ ncnt++;
+ }
+
+ if (ncnt != 0)
+ {
+ /* We will call both mpn_powm and mpn_powlo. */
+ /* rp needs n, mpn_powlo needs 4n, the 2 mpn_binvert might need more */
+ mp_size_t n_largest_binvert = MAX (ncnt, nodd);
+ mp_size_t itch_binvert = mpn_binvert_itch (n_largest_binvert);
+ itch = 3 * n + MAX (itch_binvert, 2 * n);
+ }
+ else
+ {
+ /* We will call just mpn_powm. */
+ mp_size_t itch_binvert = mpn_binvert_itch (nodd);
+ itch = n + MAX (itch_binvert, 2 * n);
+ }
+ tp = TMP_ALLOC_LIMBS (itch);
+
+ rp = tp; tp += n;
+
+ bp = PTR(b);
+ mpn_powm (rp, bp, bn, ep, en, mp, nodd, tp);
+
+ rn = n;
+
+ if (ncnt != 0)
+ {
+ mp_ptr r2, xp, yp, odd_inv_2exp;
+ unsigned long t;
+ int bcnt;
+
+ if (bn < ncnt)
+ {
+ mp_ptr newbp = TMP_ALLOC_LIMBS (ncnt);
+ MPN_COPY (newbp, bp, bn);
+ MPN_ZERO (newbp + bn, ncnt - bn);
+ bp = newbp;
+ }
+
+ r2 = tp;
+
+ if (bp[0] % 2 == 0)
+ {
+ if (en > 1)
+ {
+ MPN_ZERO (r2, ncnt);
+ goto zero;
+ }
+
+ ASSERT (en == 1);
+ t = (ncnt - (cnt != 0)) * GMP_NUMB_BITS + cnt;
+
+ /* Count number of low zero bits in B, up to 3. */
+ bcnt = (0x1213 >> ((bp[0] & 7) << 1)) & 0x3;
+ /* Note that ep[0] * bcnt might overflow, but that just results
+ in a missed optimization. */
+ if (ep[0] * bcnt >= t)
+ {
+ MPN_ZERO (r2, ncnt);
+ goto zero;
+ }
+ }
+
+ mpn_powlo (r2, bp, ep, en, ncnt, tp + ncnt);
+
+ zero:
+ if (nodd < ncnt)
+ {
+ mp_ptr newmp = TMP_ALLOC_LIMBS (ncnt);
+ MPN_COPY (newmp, mp, nodd);
+ MPN_ZERO (newmp + nodd, ncnt - nodd);
+ mp = newmp;
+ }
+
+ odd_inv_2exp = tp + n;
+ mpn_binvert (odd_inv_2exp, mp, ncnt, tp + 2 * n);
+
+ mpn_sub (r2, r2, ncnt, rp, nodd > ncnt ? ncnt : nodd);
+
+ xp = tp + 2 * n;
+ mpn_mullo_n (xp, odd_inv_2exp, r2, ncnt);
+
+ if (cnt != 0)
+ xp[ncnt - 1] &= (CNST_LIMB(1) << cnt) - 1;
+
+ yp = tp;
+ if (ncnt > nodd)
+ mpn_mul (yp, xp, ncnt, mp, nodd);
+ else
+ mpn_mul (yp, mp, nodd, xp, ncnt);
+
+ mpn_add (rp, yp, n, rp, nodd);
+
+ ASSERT (nodd + ncnt >= n);
+ ASSERT (nodd + ncnt <= n + 1);
+ }
+
+ MPN_NORMALIZE (rp, rn);
+
+ if ((ep[0] & 1) && SIZ(b) < 0 && rn != 0)
+ {
+ mpn_sub (rp, PTR(m), n, rp, rn);
+ rn = n;
+ MPN_NORMALIZE (rp, rn);
+ }
+
+ ret:
+ MPZ_REALLOC (r, rn);
+ SIZ(r) = rn;
+ MPN_COPY (PTR(r), rp, rn);
+
+ TMP_FREE;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpz/powm_sec.c b/Build/source/libs/gmp/gmp-6.0.0/mpz/powm_sec.c
new file mode 100644
index 00000000000..98644ca4963
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpz/powm_sec.c
@@ -0,0 +1,104 @@
+/* mpz_powm_sec(res,base,exp,mod) -- Set R to (U^E) mod M.
+
+ Contributed to the GNU project by Torbjorn Granlund.
+
+Copyright 1991, 1993, 1994, 1996, 1997, 2000-2002, 2005, 2008, 2009, 2012 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.h"
+#include "gmp-impl.h"
+
+
+void
+mpz_powm_sec (mpz_ptr r, mpz_srcptr b, mpz_srcptr e, mpz_srcptr m)
+{
+ mp_size_t n;
+ mp_ptr rp, tp;
+ mp_srcptr bp, ep, mp;
+ mp_size_t rn, bn, es, en;
+ TMP_DECL;
+
+ n = ABSIZ(m);
+
+ mp = PTR(m);
+
+ if (UNLIKELY ((n == 0) || (mp[0] % 2 == 0)))
+ DIVIDE_BY_ZERO;
+
+ es = SIZ(e);
+ if (UNLIKELY (es <= 0))
+ {
+ if (es == 0)
+ {
+ /* b^0 mod m, b is anything and m is non-zero.
+ Result is 1 mod m, i.e., 1 or 0 depending on if m = 1. */
+ SIZ(r) = n != 1 || mp[0] != 1;
+ PTR(r)[0] = 1;
+ return;
+ }
+ DIVIDE_BY_ZERO;
+ }
+ en = es;
+
+ bn = ABSIZ(b);
+
+ if (UNLIKELY (bn == 0))
+ {
+ SIZ(r) = 0;
+ return;
+ }
+
+ TMP_MARK;
+ tp = TMP_ALLOC_LIMBS (n + mpn_sec_powm_itch (bn, en * GMP_NUMB_BITS, n));
+
+ rp = tp; tp += n;
+
+ bp = PTR(b);
+ ep = PTR(e);
+
+ mpn_sec_powm (rp, bp, bn, ep, en * GMP_NUMB_BITS, mp, n, tp);
+
+ rn = n;
+
+ MPN_NORMALIZE (rp, rn);
+
+ if ((ep[0] & 1) && SIZ(b) < 0 && rn != 0)
+ {
+ mpn_sub (rp, PTR(m), n, rp, rn);
+ rn = n;
+ MPN_NORMALIZE (rp, rn);
+ }
+
+ MPZ_REALLOC (r, rn);
+ SIZ(r) = rn;
+ MPN_COPY (PTR(r), rp, rn);
+
+ TMP_FREE;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpz/powm_ui.c b/Build/source/libs/gmp/gmp-6.0.0/mpz/powm_ui.c
new file mode 100644
index 00000000000..46e770ce7ec
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpz/powm_ui.c
@@ -0,0 +1,292 @@
+/* mpz_powm_ui(res,base,exp,mod) -- Set R to (B^E) mod M.
+
+ Contributed to the GNU project by Torbjörn Granlund.
+
+Copyright 1991, 1993, 1994, 1996, 1997, 2000-2002, 2005, 2008, 2009, 2011-2013
+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.h"
+#include "gmp-impl.h"
+#include "longlong.h"
+
+
+/* This code is very old, and should be rewritten to current GMP standard. It
+ is slower than mpz_powm for large exponents, but also for small exponents
+ when the mod argument is small.
+
+ As an intermediate solution, we now deflect to mpz_powm for exponents >= 20.
+*/
+
+/*
+ b ^ e mod m res
+ 0 0 0 ?
+ 0 e 0 ?
+ 0 0 m ?
+ 0 e m 0
+ b 0 0 ?
+ b e 0 ?
+ b 0 m 1 mod m
+ b e m b^e mod m
+*/
+
+static void
+mod (mp_ptr np, mp_size_t nn, mp_srcptr dp, mp_size_t dn, gmp_pi1_t *dinv, mp_ptr tp)
+{
+ mp_ptr qp;
+ TMP_DECL;
+ TMP_MARK;
+
+ qp = tp;
+
+ if (dn == 1)
+ {
+ np[0] = mpn_divrem_1 (qp, (mp_size_t) 0, np, nn, dp[0]);
+ }
+ else if (dn == 2)
+ {
+ mpn_div_qr_2n_pi1 (qp, np, np, nn, dp[1], dp[0], dinv->inv32);
+ }
+ else if (BELOW_THRESHOLD (dn, DC_DIV_QR_THRESHOLD) ||
+ BELOW_THRESHOLD (nn - dn, DC_DIV_QR_THRESHOLD))
+ {
+ mpn_sbpi1_div_qr (qp, np, nn, dp, dn, dinv->inv32);
+ }
+ else if (BELOW_THRESHOLD (dn, MUPI_DIV_QR_THRESHOLD) || /* fast condition */
+ BELOW_THRESHOLD (nn, 2 * MU_DIV_QR_THRESHOLD) || /* fast condition */
+ (double) (2 * (MU_DIV_QR_THRESHOLD - MUPI_DIV_QR_THRESHOLD)) * dn /* slow... */
+ + (double) MUPI_DIV_QR_THRESHOLD * nn > (double) dn * nn) /* ...condition */
+ {
+ mpn_dcpi1_div_qr (qp, np, nn, dp, dn, dinv);
+ }
+ else
+ {
+ /* We need to allocate separate remainder area, since mpn_mu_div_qr does
+ not handle overlap between the numerator and remainder areas.
+ FIXME: Make it handle such overlap. */
+ mp_ptr rp = TMP_BALLOC_LIMBS (dn);
+ mp_size_t itch = mpn_mu_div_qr_itch (nn, dn, 0);
+ mp_ptr scratch = TMP_BALLOC_LIMBS (itch);
+ mpn_mu_div_qr (qp, rp, np, nn, dp, dn, scratch);
+ MPN_COPY (np, rp, dn);
+ }
+
+ TMP_FREE;
+}
+
+/* Compute t = a mod m, a is defined by (ap,an), m is defined by (mp,mn), and
+ t is defined by (tp,mn). */
+static void
+reduce (mp_ptr tp, mp_srcptr ap, mp_size_t an, mp_srcptr mp, mp_size_t mn, gmp_pi1_t *dinv)
+{
+ mp_ptr rp, scratch;
+ TMP_DECL;
+ TMP_MARK;
+
+ rp = TMP_ALLOC_LIMBS (an);
+ scratch = TMP_ALLOC_LIMBS (an - mn + 1);
+ MPN_COPY (rp, ap, an);
+ mod (rp, an, mp, mn, dinv, scratch);
+ MPN_COPY (tp, rp, mn);
+
+ TMP_FREE;
+}
+
+void
+mpz_powm_ui (mpz_ptr r, mpz_srcptr b, unsigned long int el, mpz_srcptr m)
+{
+ if (el < 20)
+ {
+ mp_ptr xp, tp, mp, bp, scratch;
+ mp_size_t xn, tn, mn, bn;
+ int m_zero_cnt;
+ int c;
+ mp_limb_t e, m2;
+ gmp_pi1_t dinv;
+ TMP_DECL;
+
+ mp = PTR(m);
+ mn = ABSIZ(m);
+ if (UNLIKELY (mn == 0))
+ DIVIDE_BY_ZERO;
+
+ if (el == 0)
+ {
+ /* Exponent is zero, result is 1 mod M, i.e., 1 or 0 depending on if
+ M equals 1. */
+ SIZ(r) = (mn == 1 && mp[0] == 1) ? 0 : 1;
+ PTR(r)[0] = 1;
+ return;
+ }
+
+ TMP_MARK;
+
+ /* Normalize m (i.e. make its most significant bit set) as required by
+ division functions below. */
+ count_leading_zeros (m_zero_cnt, mp[mn - 1]);
+ m_zero_cnt -= GMP_NAIL_BITS;
+ if (m_zero_cnt != 0)
+ {
+ mp_ptr new_mp = TMP_ALLOC_LIMBS (mn);
+ mpn_lshift (new_mp, mp, mn, m_zero_cnt);
+ mp = new_mp;
+ }
+
+ m2 = mn == 1 ? 0 : mp[mn - 2];
+ invert_pi1 (dinv, mp[mn - 1], m2);
+
+ bn = ABSIZ(b);
+ bp = PTR(b);
+ if (bn > mn)
+ {
+ /* Reduce possibly huge base. Use a function call to reduce, since we
+ don't want the quotient allocation to live until function return. */
+ mp_ptr new_bp = TMP_ALLOC_LIMBS (mn);
+ reduce (new_bp, bp, bn, mp, mn, &dinv);
+ bp = new_bp;
+ bn = mn;
+ /* Canonicalize the base, since we are potentially going to multiply with
+ it quite a few times. */
+ MPN_NORMALIZE (bp, bn);
+ }
+
+ if (bn == 0)
+ {
+ SIZ(r) = 0;
+ TMP_FREE;
+ return;
+ }
+
+ tp = TMP_ALLOC_LIMBS (2 * mn + 1);
+ xp = TMP_ALLOC_LIMBS (mn);
+ scratch = TMP_ALLOC_LIMBS (mn + 1);
+
+ MPN_COPY (xp, bp, bn);
+ xn = bn;
+
+ e = el;
+ count_leading_zeros (c, e);
+ e = (e << c) << 1; /* shift the exp bits to the left, lose msb */
+ c = GMP_LIMB_BITS - 1 - c;
+
+ if (c == 0)
+ {
+ /* If m is already normalized (high bit of high limb set), and b is
+ the same size, but a bigger value, and e==1, then there's no
+ modular reductions done and we can end up with a result out of
+ range at the end. */
+ if (xn == mn && mpn_cmp (xp, mp, mn) >= 0)
+ mpn_sub_n (xp, xp, mp, mn);
+ }
+ else
+ {
+ /* Main loop. */
+ do
+ {
+ mpn_sqr (tp, xp, xn);
+ tn = 2 * xn; tn -= tp[tn - 1] == 0;
+ if (tn < mn)
+ {
+ MPN_COPY (xp, tp, tn);
+ xn = tn;
+ }
+ else
+ {
+ mod (tp, tn, mp, mn, &dinv, scratch);
+ MPN_COPY (xp, tp, mn);
+ xn = mn;
+ }
+
+ if ((mp_limb_signed_t) e < 0)
+ {
+ mpn_mul (tp, xp, xn, bp, bn);
+ tn = xn + bn; tn -= tp[tn - 1] == 0;
+ if (tn < mn)
+ {
+ MPN_COPY (xp, tp, tn);
+ xn = tn;
+ }
+ else
+ {
+ mod (tp, tn, mp, mn, &dinv, scratch);
+ MPN_COPY (xp, tp, mn);
+ xn = mn;
+ }
+ }
+ e <<= 1;
+ c--;
+ }
+ while (c != 0);
+ }
+
+ /* We shifted m left m_zero_cnt steps. Adjust the result by reducing it
+ with the original M. */
+ if (m_zero_cnt != 0)
+ {
+ mp_limb_t cy;
+ cy = mpn_lshift (tp, xp, xn, m_zero_cnt);
+ tp[xn] = cy; xn += cy != 0;
+
+ if (xn < mn)
+ {
+ MPN_COPY (xp, tp, xn);
+ }
+ else
+ {
+ mod (tp, xn, mp, mn, &dinv, scratch);
+ MPN_COPY (xp, tp, mn);
+ xn = mn;
+ }
+ mpn_rshift (xp, xp, xn, m_zero_cnt);
+ }
+ MPN_NORMALIZE (xp, xn);
+
+ if ((el & 1) != 0 && SIZ(b) < 0 && xn != 0)
+ {
+ mp = PTR(m); /* want original, unnormalized m */
+ mpn_sub (xp, mp, mn, xp, xn);
+ xn = mn;
+ MPN_NORMALIZE (xp, xn);
+ }
+ MPZ_REALLOC (r, xn);
+ SIZ (r) = xn;
+ MPN_COPY (PTR(r), xp, xn);
+
+ TMP_FREE;
+ }
+ else
+ {
+ /* For large exponents, fake a mpz_t exponent and deflect to the more
+ sophisticated mpz_powm. */
+ mpz_t e;
+ mp_limb_t ep[LIMBS_PER_ULONG];
+ MPZ_FAKE_UI (e, ep, el);
+ mpz_powm (r, b, e, m);
+ }
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpz/pprime_p.c b/Build/source/libs/gmp/gmp-6.0.0/mpz/pprime_p.c
new file mode 100644
index 00000000000..f3d38a08210
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpz/pprime_p.c
@@ -0,0 +1,164 @@
+/* mpz_probab_prime_p --
+ An implementation of the probabilistic primality test found in Knuth's
+ Seminumerical Algorithms book. If the function mpz_probab_prime_p()
+ returns 0 then n is not prime. If it returns 1, then n is 'probably'
+ prime. If it returns 2, n is surely prime. The probability of a false
+ positive is (1/4)**reps, where reps is the number of internal passes of the
+ probabilistic algorithm. Knuth indicates that 25 passes are reasonable.
+
+Copyright 1991, 1993, 1994, 1996-2002, 2005 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.h"
+#include "gmp-impl.h"
+#include "longlong.h"
+
+static int isprime (unsigned long int);
+
+
+/* MPN_MOD_OR_MODEXACT_1_ODD can be used instead of mpn_mod_1 for the trial
+ division. It gives a result which is not the actual remainder r but a
+ value congruent to r*2^n mod d. Since all the primes being tested are
+ odd, r*2^n mod p will be 0 if and only if r mod p is 0. */
+
+int
+mpz_probab_prime_p (mpz_srcptr n, int reps)
+{
+ mp_limb_t r;
+ mpz_t n2;
+
+ /* Handle small and negative n. */
+ if (mpz_cmp_ui (n, 1000000L) <= 0)
+ {
+ int is_prime;
+ if (mpz_cmpabs_ui (n, 1000000L) <= 0)
+ {
+ is_prime = isprime (mpz_get_ui (n));
+ return is_prime ? 2 : 0;
+ }
+ /* Negative number. Negate and fall out. */
+ PTR(n2) = PTR(n);
+ SIZ(n2) = -SIZ(n);
+ n = n2;
+ }
+
+ /* If n is now even, it is not a prime. */
+ if ((mpz_get_ui (n) & 1) == 0)
+ return 0;
+
+#if defined (PP)
+ /* Check if n has small factors. */
+#if defined (PP_INVERTED)
+ r = MPN_MOD_OR_PREINV_MOD_1 (PTR(n), (mp_size_t) SIZ(n), (mp_limb_t) PP,
+ (mp_limb_t) PP_INVERTED);
+#else
+ r = mpn_mod_1 (PTR(n), (mp_size_t) SIZ(n), (mp_limb_t) PP);
+#endif
+ if (r % 3 == 0
+#if GMP_LIMB_BITS >= 4
+ || r % 5 == 0
+#endif
+#if GMP_LIMB_BITS >= 8
+ || r % 7 == 0
+#endif
+#if GMP_LIMB_BITS >= 16
+ || r % 11 == 0 || r % 13 == 0
+#endif
+#if GMP_LIMB_BITS >= 32
+ || r % 17 == 0 || r % 19 == 0 || r % 23 == 0 || r % 29 == 0
+#endif
+#if GMP_LIMB_BITS >= 64
+ || r % 31 == 0 || r % 37 == 0 || r % 41 == 0 || r % 43 == 0
+ || r % 47 == 0 || r % 53 == 0
+#endif
+ )
+ {
+ return 0;
+ }
+#endif /* PP */
+
+ /* Do more dividing. We collect small primes, using umul_ppmm, until we
+ overflow a single limb. We divide our number by the small primes product,
+ and look for factors in the remainder. */
+ {
+ unsigned long int ln2;
+ unsigned long int q;
+ mp_limb_t p1, p0, p;
+ unsigned int primes[15];
+ int nprimes;
+
+ nprimes = 0;
+ p = 1;
+ ln2 = mpz_sizeinbase (n, 2); /* FIXME: tune this limit */
+ for (q = PP_FIRST_OMITTED; q < ln2; q += 2)
+ {
+ if (isprime (q))
+ {
+ umul_ppmm (p1, p0, p, q);
+ if (p1 != 0)
+ {
+ r = MPN_MOD_OR_MODEXACT_1_ODD (PTR(n), (mp_size_t) SIZ(n), p);
+ while (--nprimes >= 0)
+ if (r % primes[nprimes] == 0)
+ {
+ ASSERT_ALWAYS (mpn_mod_1 (PTR(n), (mp_size_t) SIZ(n), (mp_limb_t) primes[nprimes]) == 0);
+ return 0;
+ }
+ p = q;
+ nprimes = 0;
+ }
+ else
+ {
+ p = p0;
+ }
+ primes[nprimes++] = q;
+ }
+ }
+ }
+
+ /* Perform a number of Miller-Rabin tests. */
+ return mpz_millerrabin (n, reps);
+}
+
+static int
+isprime (unsigned long int t)
+{
+ unsigned long int q, r, d;
+
+ if (t < 3 || (t & 1) == 0)
+ return t == 2;
+
+ for (d = 3, r = 1; r != 0; d += 2)
+ {
+ q = t / d;
+ r = t - q * d;
+ if (q < d)
+ return 1;
+ }
+ return 0;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpz/primorial_ui.c b/Build/source/libs/gmp/gmp-6.0.0/mpz/primorial_ui.c
new file mode 100644
index 00000000000..f322edf5499
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpz/primorial_ui.c
@@ -0,0 +1,164 @@
+/* mpz_primorial_ui(RESULT, N) -- Set RESULT to N# the product of primes <= N.
+
+Contributed to the GNU project by Marco Bodrato.
+
+Copyright 2012 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.h"
+#include "gmp-impl.h"
+
+/* TODO: Remove duplicated constants / macros / static functions...
+ */
+
+/*************************************************************/
+/* Section macros: common macros, for swing/fac/bin (&sieve) */
+/*************************************************************/
+
+#define FACTOR_LIST_STORE(P, PR, MAX_PR, VEC, I) \
+ do { \
+ if ((PR) > (MAX_PR)) { \
+ (VEC)[(I)++] = (PR); \
+ (PR) = (P); \
+ } else \
+ (PR) *= (P); \
+ } while (0)
+
+#define LOOP_ON_SIEVE_CONTINUE(prime,end,sieve) \
+ __max_i = (end); \
+ \
+ do { \
+ ++__i; \
+ if (((sieve)[__index] & __mask) == 0) \
+ { \
+ (prime) = id_to_n(__i)
+
+#define LOOP_ON_SIEVE_BEGIN(prime,start,end,off,sieve) \
+ do { \
+ mp_limb_t __mask, __index, __max_i, __i; \
+ \
+ __i = (start)-(off); \
+ __index = __i / GMP_LIMB_BITS; \
+ __mask = CNST_LIMB(1) << (__i % GMP_LIMB_BITS); \
+ __i += (off); \
+ \
+ LOOP_ON_SIEVE_CONTINUE(prime,end,sieve)
+
+#define LOOP_ON_SIEVE_STOP \
+ } \
+ __mask = __mask << 1 | __mask >> (GMP_LIMB_BITS-1); \
+ __index += __mask & 1; \
+ } while (__i <= __max_i) \
+
+#define LOOP_ON_SIEVE_END \
+ LOOP_ON_SIEVE_STOP; \
+ } while (0)
+
+/*********************************************************/
+/* Section sieve: sieving functions and tools for primes */
+/*********************************************************/
+
+#if WANT_ASSERT
+static mp_limb_t
+bit_to_n (mp_limb_t bit) { return (bit*3+4)|1; }
+#endif
+
+/* id_to_n (x) = bit_to_n (x-1) = (id*3+1)|1*/
+static mp_limb_t
+id_to_n (mp_limb_t id) { return id*3+1+(id&1); }
+
+/* n_to_bit (n) = ((n-1)&(-CNST_LIMB(2)))/3U-1 */
+static mp_limb_t
+n_to_bit (mp_limb_t n) { return ((n-5)|1)/3U; }
+
+#if WANT_ASSERT
+static mp_size_t
+primesieve_size (mp_limb_t n) { return n_to_bit(n) / GMP_LIMB_BITS + 1; }
+#endif
+
+/*********************************************************/
+/* Section primorial: implementation */
+/*********************************************************/
+
+void
+mpz_primorial_ui (mpz_ptr x, unsigned long n)
+{
+ static const mp_limb_t table[] = { 1, 1, 2, 6, 6 };
+
+ ASSERT (n <= GMP_NUMB_MAX);
+
+ if (n < numberof (table))
+ {
+ PTR (x)[0] = table[n];
+ SIZ (x) = 1;
+ }
+ else
+ {
+ mp_limb_t *sieve, *factors;
+ mp_size_t size;
+ mp_limb_t prod;
+ mp_limb_t j;
+ TMP_DECL;
+
+ size = 1 + n / GMP_NUMB_BITS + n / (2*GMP_NUMB_BITS);
+ ASSERT (size >= primesieve_size (n));
+ sieve = MPZ_NEWALLOC (x, size);
+ size = (gmp_primesieve (sieve, n) + 1) / log_n_max (n) + 1;
+
+ TMP_MARK;
+ factors = TMP_ALLOC_LIMBS (size);
+
+ j = 0;
+
+ prod = table[numberof (table)-1];
+
+ /* Store primes from 5 to n */
+ {
+ mp_limb_t prime, max_prod;
+
+ max_prod = GMP_NUMB_MAX / n;
+
+ LOOP_ON_SIEVE_BEGIN (prime, n_to_bit(numberof (table)), n_to_bit (n), 0, sieve);
+ FACTOR_LIST_STORE (prime, prod, max_prod, factors, j);
+ LOOP_ON_SIEVE_END;
+ }
+
+ if (LIKELY (j != 0))
+ {
+ factors[j++] = prod;
+ mpz_prodlimbs (x, factors, j);
+ }
+ else
+ {
+ PTR (x)[0] = prod;
+ SIZ (x) = 1;
+ }
+
+ TMP_FREE;
+ }
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpz/prodlimbs.c b/Build/source/libs/gmp/gmp-6.0.0/mpz/prodlimbs.c
new file mode 100644
index 00000000000..8d84bcb4353
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpz/prodlimbs.c
@@ -0,0 +1,109 @@
+/* mpz_prodlimbs(RESULT, V, LEN) -- Set RESULT to V[0]*V[1]*...*V[LEN-1].
+
+Contributed to the GNU project by Marco Bodrato.
+
+THE FUNCTION IN THIS FILE IS INTERNAL WITH A MUTABLE INTERFACE.
+IT IS ONLY 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 2010-2012 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.h"
+#include "gmp-impl.h"
+
+/*********************************************************/
+/* Section list-prod: product of a list -> mpz_t */
+/*********************************************************/
+
+/* FIXME: should be tuned */
+#ifndef RECURSIVE_PROD_THRESHOLD
+#define RECURSIVE_PROD_THRESHOLD (MUL_TOOM22_THRESHOLD)
+#endif
+
+/* Computes the product of the j>1 limbs pointed by factors, puts the
+ * result in x. It assumes that all limbs are non-zero. Above
+ * Karatsuba's threshold it uses a binary splitting strategy, to gain
+ * speed by the asymptotically fast multiplication algorithms.
+ *
+ * The list in {factors, j} is overwritten.
+ * Returns the size of the result
+ */
+
+mp_size_t
+mpz_prodlimbs (mpz_ptr x, mp_ptr factors, mp_size_t j)
+{
+ mp_limb_t cy;
+ mp_size_t size, i;
+ mp_ptr prod;
+
+ ASSERT (j > 1);
+ ASSERT (RECURSIVE_PROD_THRESHOLD > 3);
+
+ if (BELOW_THRESHOLD (j, RECURSIVE_PROD_THRESHOLD)) {
+ j--;
+ size = 1;
+
+ for (i = 1; i < j; i++)
+ {
+ cy = mpn_mul_1 (factors, factors, size, factors[i]);
+ factors[size] = cy;
+ size += cy != 0;
+ };
+
+ prod = MPZ_NEWALLOC (x, size + 1);
+
+ cy = mpn_mul_1 (prod, factors, size, factors[i]);
+ prod[size] = cy;
+ return SIZ (x) = size + (cy != 0);
+ } else {
+ mpz_t x1, x2;
+ TMP_DECL;
+
+ i = j >> 1;
+ j -= i;
+ TMP_MARK;
+
+ MPZ_TMP_INIT (x2, j);
+
+ PTR (x1) = factors + i;
+ ALLOC (x1) = j;
+ j = mpz_prodlimbs (x2, factors + i, j);
+ i = mpz_prodlimbs (x1, factors, i);
+ size = i + j;
+ prod = MPZ_NEWALLOC (x, size);
+ if (i >= j)
+ cy = mpn_mul (prod, PTR(x1), i, PTR(x2), j);
+ else
+ cy = mpn_mul (prod, PTR(x2), j, PTR(x1), i);
+ TMP_FREE;
+
+ return SIZ (x) = size - (cy == 0);
+ }
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpz/random.c b/Build/source/libs/gmp/gmp-6.0.0/mpz/random.c
new file mode 100644
index 00000000000..1dca3a93cdd
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpz/random.c
@@ -0,0 +1,40 @@
+/* mpz_random -- Generate a random mpz_t of specified size in limbs.
+
+Copyright 2001, 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/. */
+
+#include "gmp.h"
+#include "gmp-impl.h"
+
+void
+mpz_random (mpz_ptr x, mp_size_t size)
+{
+ mpz_urandomb (x, RANDS, (unsigned long) (ABS (size) * GMP_NUMB_BITS));
+ if (size < 0)
+ SIZ(x) = -SIZ(x);
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpz/random2.c b/Build/source/libs/gmp/gmp-6.0.0/mpz/random2.c
new file mode 100644
index 00000000000..7f9e5f28e8b
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpz/random2.c
@@ -0,0 +1,51 @@
+/* mpz_random2 -- Generate a positive random mpz_t of specified size, with
+ long runs of consecutive ones and zeros in the binary representation.
+ Meant for testing of other MP routines.
+
+Copyright 1991, 1993, 1994, 1996, 2001, 2012 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.h"
+#include "gmp-impl.h"
+
+void
+mpz_random2 (mpz_ptr x, mp_size_t size)
+{
+ mp_size_t abs_size;
+ mp_ptr xp;
+
+ abs_size = ABS (size);
+ if (abs_size != 0)
+ {
+ xp = MPZ_REALLOC (x, abs_size);
+
+ mpn_random2 (xp, abs_size);
+ }
+
+ SIZ (x) = size;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpz/realloc.c b/Build/source/libs/gmp/gmp-6.0.0/mpz/realloc.c
new file mode 100644
index 00000000000..3d2755ca0a1
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpz/realloc.c
@@ -0,0 +1,71 @@
+/* _mpz_realloc -- make the mpz_t have NEW_ALLOC digits allocated.
+
+Copyright 1991, 1993-1995, 2000, 2001, 2008 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 <stdlib.h>
+#include <stdio.h>
+#include "gmp.h"
+#include "gmp-impl.h"
+
+void *
+_mpz_realloc (mpz_ptr m, mp_size_t new_alloc)
+{
+ mp_ptr mp;
+
+ /* Never allocate zero space. */
+ new_alloc = MAX (new_alloc, 1);
+
+ if (sizeof (mp_size_t) == sizeof (int))
+ {
+ if (UNLIKELY (new_alloc > ULONG_MAX / GMP_NUMB_BITS))
+ {
+ fprintf (stderr, "gmp: overflow in mpz type\n");
+ abort ();
+ }
+ }
+ else
+ {
+ if (UNLIKELY (new_alloc > INT_MAX))
+ {
+ fprintf (stderr, "gmp: overflow in mpz type\n");
+ abort ();
+ }
+ }
+
+ mp = __GMP_REALLOCATE_FUNC_LIMBS (PTR(m), ALLOC(m), new_alloc);
+ PTR(m) = mp;
+ ALLOC(m) = new_alloc;
+
+ /* Don't create an invalid number; if the current value doesn't fit after
+ reallocation, clear it to 0. */
+ if (ABSIZ(m) > new_alloc)
+ SIZ(m) = 0;
+
+ return (void *) mp;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpz/realloc2.c b/Build/source/libs/gmp/gmp-6.0.0/mpz/realloc2.c
new file mode 100644
index 00000000000..3ccfaab1f06
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpz/realloc2.c
@@ -0,0 +1,60 @@
+/* mpz_realloc2 -- change allocated data size.
+
+Copyright 2001, 2002, 2008 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 <stdlib.h>
+#include <stdio.h>
+#include "gmp.h"
+#include "gmp-impl.h"
+
+void
+mpz_realloc2 (mpz_ptr m, mp_bitcnt_t bits)
+{
+ mp_size_t new_alloc;
+
+ bits -= (bits != 0); /* Round down, except if 0 */
+ new_alloc = 1 + bits / GMP_NUMB_BITS;
+
+ if (sizeof (unsigned long) > sizeof (int)) /* param vs _mp_size field */
+ {
+ if (UNLIKELY (new_alloc > INT_MAX))
+ {
+ fprintf (stderr, "gmp: overflow in mpz type\n");
+ abort ();
+ }
+ }
+
+ PTR(m) = __GMP_REALLOCATE_FUNC_LIMBS (PTR(m), ALLOC(m), new_alloc);
+ ALLOC(m) = new_alloc;
+
+ /* Don't create an invalid number; if the current value doesn't fit after
+ reallocation, clear it to 0. */
+ if (ABSIZ(m) > new_alloc)
+ SIZ(m) = 0;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpz/remove.c b/Build/source/libs/gmp/gmp-6.0.0/mpz/remove.c
new file mode 100644
index 00000000000..3d293587383
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpz/remove.c
@@ -0,0 +1,147 @@
+/* mpz_remove -- divide out a factor and return its multiplicity.
+
+Copyright 1998-2002, 2012 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.h"
+#include "gmp-impl.h"
+
+mp_bitcnt_t
+mpz_remove (mpz_ptr dest, mpz_srcptr src, mpz_srcptr f)
+{
+ mp_bitcnt_t pwr;
+ mp_srcptr fp;
+ mp_size_t sn, fn, afn;
+ mp_limb_t fp0;
+
+ sn = SIZ (src);
+ fn = SIZ (f);
+ fp = PTR (f);
+ afn = ABS (fn);
+ fp0 = fp[0];
+
+ if (UNLIKELY ((afn <= (fp0 == 1)) /* mpz_cmpabs_ui (f, 1) <= 0 */
+ | (sn == 0)))
+ {
+ /* f = 0 or f = +- 1 or src = 0 */
+ if (afn == 0)
+ DIVIDE_BY_ZERO;
+ mpz_set (dest, src);
+ return 0;
+ }
+
+ if ((fp0 & 1) != 0)
+ { /* f is odd */
+ mp_ptr dp;
+ mp_size_t dn;
+
+ dn = ABS (sn);
+ dp = MPZ_REALLOC (dest, dn);
+
+ pwr = mpn_remove (dp, &dn, PTR(src), dn, PTR(f), afn, ~(mp_bitcnt_t) 0);
+
+ SIZ (dest) = ((pwr & (fn < 0)) ^ (sn < 0)) ? -dn : dn;
+ }
+ else if (afn == (fp0 == 2))
+ { /* mpz_cmpabs_ui (f, 2) == 0 */
+ pwr = mpz_scan1 (src, 0);
+ mpz_div_2exp (dest, src, pwr);
+ if (pwr & (fn < 0)) /*((pwr % 2 == 1) && (SIZ (f) < 0))*/
+ mpz_neg (dest, dest);
+ }
+ else
+ { /* f != +-2 */
+ mpz_t x, rem;
+
+ mpz_init (rem);
+ mpz_init (x);
+
+ pwr = 0;
+ mpz_tdiv_qr (x, rem, src, f);
+ if (SIZ (rem) == 0)
+ {
+ mpz_t fpow[GMP_LIMB_BITS]; /* Really MP_SIZE_T_BITS */
+ int p;
+
+#if WANT_ORIGINAL_DEST
+ mp_ptr dp;
+ dp = PTR (dest);
+#endif
+ /* We could perhaps compute mpz_scan1(src,0)/mpz_scan1(f,0). It is an
+ upper bound of the result we're seeking. We could also shift down the
+ operands so that they become odd, to make intermediate values
+ smaller. */
+ mpz_init_set (fpow[0], f);
+ mpz_swap (dest, x);
+
+ p = 1;
+ /* Divide by f, f^2 ... f^(2^k) until we get a remainder for f^(2^k). */
+ while (ABSIZ (dest) >= 2 * ABSIZ (fpow[p - 1]) - 1)
+ {
+ mpz_init (fpow[p]);
+ mpz_mul (fpow[p], fpow[p - 1], fpow[p - 1]);
+ mpz_tdiv_qr (x, rem, dest, fpow[p]);
+ if (SIZ (rem) != 0) {
+ mpz_clear (fpow[p]);
+ break;
+ }
+ mpz_swap (dest, x);
+ p++;
+ }
+
+ pwr = ((mp_bitcnt_t)1 << p) - 1;
+
+ /* Divide by f^(2^(k-1)), f^(2^(k-2)), ..., f for all divisors that give
+ a zero remainder. */
+ while (--p >= 0)
+ {
+ mpz_tdiv_qr (x, rem, dest, fpow[p]);
+ if (SIZ (rem) == 0)
+ {
+ pwr += (mp_bitcnt_t)1 << p;
+ mpz_swap (dest, x);
+ }
+ mpz_clear (fpow[p]);
+ }
+
+#if WANT_ORIGINAL_DEST
+ if (PTR (x) == dp) {
+ mpz_swap (dest, x);
+ mpz_set (dest, x);
+ }
+#endif
+ }
+ else
+ mpz_set (dest, src);
+
+ mpz_clear (x);
+ mpz_clear (rem);
+ }
+
+ return pwr;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpz/roinit_n.c b/Build/source/libs/gmp/gmp-6.0.0/mpz/roinit_n.c
new file mode 100644
index 00000000000..137dbda83c6
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpz/roinit_n.c
@@ -0,0 +1,44 @@
+/* mpz_roinit_n -- Initialize mpz with read-only limb array.
+
+Copyright 2013 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.h"
+#include "gmp-impl.h"
+
+mpz_srcptr
+mpz_roinit_n (mpz_ptr x, mp_srcptr xp, mp_size_t xs)
+{
+ mp_size_t xn = ABS(xs);
+ MPN_NORMALIZE (xp, xn);
+
+ ALLOC (x) = 0;
+ SIZ (x) = xs < 0 ? -xn : xn;
+ PTR (x) = (mp_ptr) xp;
+ return x;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpz/root.c b/Build/source/libs/gmp/gmp-6.0.0/mpz/root.c
new file mode 100644
index 00000000000..31eb440b4f2
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpz/root.c
@@ -0,0 +1,93 @@
+/* mpz_root(root, u, nth) -- Set ROOT to floor(U^(1/nth)).
+ Return an indication if the result is exact.
+
+Copyright 1999-2003, 2005, 2012 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> /* for NULL */
+#include "gmp.h"
+#include "gmp-impl.h"
+
+int
+mpz_root (mpz_ptr root, mpz_srcptr u, unsigned long int nth)
+{
+ mp_ptr rootp, up;
+ mp_size_t us, un, rootn, remn;
+ TMP_DECL;
+
+ us = SIZ(u);
+
+ /* even roots of negatives provoke an exception */
+ if (UNLIKELY (us < 0 && (nth & 1) == 0))
+ SQRT_OF_NEGATIVE;
+
+ /* root extraction interpreted as c^(1/nth) means a zeroth root should
+ provoke a divide by zero, do this even if c==0 */
+ if (UNLIKELY (nth == 0))
+ DIVIDE_BY_ZERO;
+
+ if (us == 0)
+ {
+ if (root != NULL)
+ SIZ(root) = 0;
+ return 1; /* exact result */
+ }
+
+ un = ABS (us);
+ rootn = (un - 1) / nth + 1;
+
+ TMP_MARK;
+
+ /* FIXME: Perhaps disallow root == NULL */
+ if (root != NULL && u != root)
+ rootp = MPZ_REALLOC (root, rootn);
+ else
+ rootp = TMP_ALLOC_LIMBS (rootn);
+
+ up = PTR(u);
+
+ if (nth == 1)
+ {
+ MPN_COPY (rootp, up, un);
+ remn = 0;
+ }
+ else
+ {
+ remn = mpn_rootrem (rootp, NULL, up, un, (mp_limb_t) nth);
+ }
+
+ if (root != NULL)
+ {
+ SIZ(root) = us >= 0 ? rootn : -rootn;
+ if (u == root)
+ MPN_COPY (up, rootp, rootn);
+ }
+
+ TMP_FREE;
+ return remn == 0;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpz/rootrem.c b/Build/source/libs/gmp/gmp-6.0.0/mpz/rootrem.c
new file mode 100644
index 00000000000..ac4a1e030af
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpz/rootrem.c
@@ -0,0 +1,101 @@
+/* mpz_rootrem(root, rem, u, nth) -- Set ROOT to trunc(U^(1/nth)) and
+ set REM to the remainder.
+
+Copyright 1999-2003, 2005, 2012 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> /* for NULL */
+#include "gmp.h"
+#include "gmp-impl.h"
+
+void
+mpz_rootrem (mpz_ptr root, mpz_ptr rem, mpz_srcptr u, unsigned long int nth)
+{
+ mp_ptr rootp, up, remp;
+ mp_size_t us, un, rootn, remn;
+ TMP_DECL;
+
+ us = SIZ(u);
+
+ /* even roots of negatives provoke an exception */
+ if (UNLIKELY (us < 0 && (nth & 1) == 0))
+ SQRT_OF_NEGATIVE;
+
+ /* root extraction interpreted as c^(1/nth) means a zeroth root should
+ provoke a divide by zero, do this even if c==0 */
+ if (UNLIKELY (nth == 0))
+ DIVIDE_BY_ZERO;
+
+ if (us == 0)
+ {
+ if (root != NULL)
+ SIZ(root) = 0;
+ SIZ(rem) = 0;
+ return;
+ }
+
+ un = ABS (us);
+ rootn = (un - 1) / nth + 1;
+
+ TMP_MARK;
+
+ /* FIXME: Perhaps disallow root == NULL */
+ if (root != NULL && u != root)
+ rootp = MPZ_REALLOC (root, rootn);
+ else
+ rootp = TMP_ALLOC_LIMBS (rootn);
+
+ if (u != rem)
+ remp = MPZ_REALLOC (rem, un);
+ else
+ remp = TMP_ALLOC_LIMBS (un);
+
+ up = PTR(u);
+
+ if (nth == 1)
+ {
+ MPN_COPY (rootp, up, un);
+ remn = 0;
+ }
+ else
+ {
+ remn = mpn_rootrem (rootp, remp, up, un, (mp_limb_t) nth);
+ }
+
+ if (root != NULL)
+ {
+ SIZ(root) = us >= 0 ? rootn : -rootn;
+ if (u == root)
+ MPN_COPY (up, rootp, rootn);
+ }
+
+ if (u == rem)
+ MPN_COPY (up, remp, remn);
+ SIZ(rem) = us >= 0 ? remn : -remn;
+ TMP_FREE;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpz/rrandomb.c b/Build/source/libs/gmp/gmp-6.0.0/mpz/rrandomb.c
new file mode 100644
index 00000000000..8b1803c6baa
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpz/rrandomb.c
@@ -0,0 +1,103 @@
+/* mpz_rrandomb -- Generate a positive random mpz_t of specified bit size, with
+ long runs of consecutive ones and zeros in the binary representation.
+ Meant for testing of other MP routines.
+
+Copyright 2000-2002, 2004, 2012 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.h"
+#include "gmp-impl.h"
+
+static void gmp_rrandomb (mp_ptr, gmp_randstate_t, mp_bitcnt_t);
+
+void
+mpz_rrandomb (mpz_ptr x, gmp_randstate_t rstate, mp_bitcnt_t nbits)
+{
+ mp_size_t nl;
+ mp_ptr xp;
+
+ nl = BITS_TO_LIMBS (nbits);
+ if (nbits != 0)
+ {
+ xp = MPZ_NEWALLOC (x, nl);
+ gmp_rrandomb (xp, rstate, nbits);
+ }
+
+ SIZ(x) = nl;
+}
+
+/* Ask _gmp_rand for 32 bits per call unless that's more than a limb can hold.
+ Thus, we get the same random number sequence in the common cases.
+ FIXME: We should always generate the same random number sequence! */
+#if GMP_NUMB_BITS < 32
+#define BITS_PER_RANDCALL GMP_NUMB_BITS
+#else
+#define BITS_PER_RANDCALL 32
+#endif
+
+static void
+gmp_rrandomb (mp_ptr rp, gmp_randstate_t rstate, mp_bitcnt_t nbits)
+{
+ mp_bitcnt_t bi;
+ mp_limb_t ranm; /* buffer for random bits */
+ unsigned cap_chunksize, chunksize;
+ mp_size_t i;
+
+ /* Set entire result to 111..1 */
+ i = BITS_TO_LIMBS (nbits) - 1;
+ rp[i] = GMP_NUMB_MAX >> (GMP_NUMB_BITS - (nbits % GMP_NUMB_BITS)) % GMP_NUMB_BITS;
+ for (i = i - 1; i >= 0; i--)
+ rp[i] = GMP_NUMB_MAX;
+
+ _gmp_rand (&ranm, rstate, BITS_PER_RANDCALL);
+ cap_chunksize = nbits / (ranm % 4 + 1);
+ cap_chunksize += cap_chunksize == 0; /* make it at least 1 */
+
+ bi = nbits;
+
+ for (;;)
+ {
+ _gmp_rand (&ranm, rstate, BITS_PER_RANDCALL);
+ chunksize = 1 + ranm % cap_chunksize;
+ bi = (bi < chunksize) ? 0 : bi - chunksize;
+
+ if (bi == 0)
+ break; /* low chunk is ...1 */
+
+ rp[bi / GMP_NUMB_BITS] ^= CNST_LIMB (1) << bi % GMP_NUMB_BITS;
+
+ _gmp_rand (&ranm, rstate, BITS_PER_RANDCALL);
+ chunksize = 1 + ranm % cap_chunksize;
+ bi = (bi < chunksize) ? 0 : bi - chunksize;
+
+ mpn_incr_u (rp + bi / GMP_NUMB_BITS, CNST_LIMB (1) << bi % GMP_NUMB_BITS);
+
+ if (bi == 0)
+ break; /* low chunk is ...0 */
+ }
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpz/scan0.c b/Build/source/libs/gmp/gmp-6.0.0/mpz/scan0.c
new file mode 100644
index 00000000000..de24595cfe9
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpz/scan0.c
@@ -0,0 +1,130 @@
+/* mpz_scan0 -- search for a 0 bit.
+
+Copyright 2000-2002, 2004, 2012 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.h"
+#include "gmp-impl.h"
+#include "longlong.h"
+
+
+/* mpn_scan0 can't be used for the u>0 search since there might not be a 0
+ bit before the end of the data. mpn_scan1 could be used for the inverted
+ search under u<0, but usually the search won't go very far so it seems
+ reasonable to inline that code. */
+
+mp_bitcnt_t
+mpz_scan0 (mpz_srcptr u, mp_bitcnt_t starting_bit) __GMP_NOTHROW
+{
+ mp_srcptr u_ptr = PTR(u);
+ mp_size_t size = SIZ(u);
+ mp_size_t abs_size = ABS(size);
+ mp_srcptr u_end = u_ptr + abs_size;
+ mp_size_t starting_limb = starting_bit / GMP_NUMB_BITS;
+ mp_srcptr p = u_ptr + starting_limb;
+ mp_limb_t limb;
+ int cnt;
+
+ /* When past end, there's an immediate 0 bit for u>=0, or no 0 bits for
+ u<0. Notice this test picks up all cases of u==0 too. */
+ if (starting_limb >= abs_size)
+ return (size >= 0 ? starting_bit : ~(mp_bitcnt_t) 0);
+
+ limb = *p;
+
+ if (size >= 0)
+ {
+ /* Mask to 1 all bits before starting_bit, thus ignoring them. */
+ limb |= (CNST_LIMB(1) << (starting_bit % GMP_NUMB_BITS)) - 1;
+
+ /* Search for a limb which isn't all ones. If the end is reached then
+ the zero bit immediately past the end is returned. */
+ while (limb == GMP_NUMB_MAX)
+ {
+ p++;
+ if (p == u_end)
+ return (mp_bitcnt_t) abs_size * GMP_NUMB_BITS;
+ limb = *p;
+ }
+
+ /* Now seek low 1 bit. */
+ limb = ~limb;
+ }
+ else
+ {
+ mp_srcptr q;
+
+ /* If there's a non-zero limb before ours then we're in the ones
+ complement region. Search from *(p-1) downwards since that might
+ give better cache locality, and since a non-zero in the middle of a
+ number is perhaps a touch more likely than at the end. */
+ q = p;
+ while (q != u_ptr)
+ {
+ q--;
+ if (*q != 0)
+ goto inverted;
+ }
+
+ /* Adjust so ~limb implied by searching for 1 bit below becomes -limb.
+ If limb==0 here then this isn't the beginning of twos complement
+ inversion, but that doesn't matter because limb==0 is a zero bit
+ immediately (-1 is all ones for below). */
+ limb--;
+
+ inverted:
+ /* Now seeking a 1 bit. */
+
+ /* Mask to 0 all bits before starting_bit, thus ignoring them. */
+ limb &= (MP_LIMB_T_MAX << (starting_bit % GMP_NUMB_BITS));
+
+ if (limb == 0)
+ {
+ /* If the high limb is zero after masking, then no 1 bits past
+ starting_bit. */
+ p++;
+ if (p == u_end)
+ return ~(mp_bitcnt_t) 0;
+
+ /* Search further for a non-zero limb. The high limb is non-zero,
+ if nothing else. */
+ for (;;)
+ {
+ limb = *p;
+ if (limb != 0)
+ break;
+ p++;
+ ASSERT (p < u_end);
+ }
+ }
+ }
+
+ ASSERT (limb != 0);
+ count_trailing_zeros (cnt, limb);
+ return (mp_bitcnt_t) (p - u_ptr) * GMP_NUMB_BITS + cnt;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpz/scan1.c b/Build/source/libs/gmp/gmp-6.0.0/mpz/scan1.c
new file mode 100644
index 00000000000..c9309de6913
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpz/scan1.c
@@ -0,0 +1,124 @@
+/* mpz_scan1 -- search for a 1 bit.
+
+Copyright 2000-2002, 2004, 2012 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.h"
+#include "gmp-impl.h"
+#include "longlong.h"
+
+
+/* mpn_scan0 can't be used for the inverted u<0 search since there might not
+ be a 0 bit before the end of the data. mpn_scan1 could be used under u>0
+ (except when in the high limb), but usually the search won't go very far
+ so it seems reasonable to inline that code. */
+
+mp_bitcnt_t
+mpz_scan1 (mpz_srcptr u, mp_bitcnt_t starting_bit) __GMP_NOTHROW
+{
+ mp_srcptr u_ptr = PTR(u);
+ mp_size_t size = SIZ(u);
+ mp_size_t abs_size = ABS(size);
+ mp_srcptr u_end = u_ptr + abs_size - 1;
+ mp_size_t starting_limb = starting_bit / GMP_NUMB_BITS;
+ mp_srcptr p = u_ptr + starting_limb;
+ mp_limb_t limb;
+ int cnt;
+
+ /* Past the end there's no 1 bits for u>=0, or an immediate 1 bit for u<0.
+ Notice this test picks up any u==0 too. */
+ if (starting_limb >= abs_size)
+ return (size >= 0 ? ~(mp_bitcnt_t) 0 : starting_bit);
+
+ /* This is an important case, where sign is not relevant! */
+ if (starting_bit == 0)
+ goto short_cut;
+
+ limb = *p;
+
+ if (size >= 0)
+ {
+ /* Mask to 0 all bits before starting_bit, thus ignoring them. */
+ limb &= (MP_LIMB_T_MAX << (starting_bit % GMP_NUMB_BITS));
+
+ if (limb == 0)
+ {
+ /* If it's the high limb which is zero after masking, then there's
+ no 1 bits after starting_bit. */
+ if (p == u_end)
+ return ~(mp_bitcnt_t) 0;
+
+ /* Otherwise search further for a non-zero limb. The high limb is
+ non-zero, if nothing else. */
+ search_nonzero:
+ do
+ {
+ ASSERT (p != u_end);
+ p++;
+ short_cut:
+ limb = *p;
+ }
+ while (limb == 0);
+ }
+ }
+ else
+ {
+ /* If there's a non-zero limb before ours then we're in the ones
+ complement region. */
+ if (mpn_zero_p (u_ptr, starting_limb)) {
+ if (limb == 0)
+ /* Seeking for the first non-zero bit, it is the same for u and -u. */
+ goto search_nonzero;
+
+ /* Adjust so ~limb implied by searching for 0 bit becomes -limb. */
+ limb--;
+ }
+
+ /* Now seeking a 0 bit. */
+
+ /* Mask to 1 all bits before starting_bit, thus ignoring them. */
+ limb |= (CNST_LIMB(1) << (starting_bit % GMP_NUMB_BITS)) - 1;
+
+ /* Search for a limb which is not all ones. If the end is reached
+ then the zero immediately past the end is the result. */
+ while (limb == GMP_NUMB_MAX)
+ {
+ if (p == u_end)
+ return (mp_bitcnt_t) abs_size * GMP_NUMB_BITS;
+ p++;
+ limb = *p;
+ }
+
+ /* Now seeking low 1 bit. */
+ limb = ~limb;
+ }
+
+ ASSERT (limb != 0);
+ count_trailing_zeros (cnt, limb);
+ return (mp_bitcnt_t) (p - u_ptr) * GMP_NUMB_BITS + cnt;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpz/set.c b/Build/source/libs/gmp/gmp-6.0.0/mpz/set.c
new file mode 100644
index 00000000000..9d7d58c8d03
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpz/set.c
@@ -0,0 +1,50 @@
+/* mpz_set (dest_integer, src_integer) -- Assign DEST_INTEGER from SRC_INTEGER.
+
+Copyright 1991, 1993-1995, 2000, 2012 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.h"
+#include "gmp-impl.h"
+
+
+void
+mpz_set (mpz_ptr w, mpz_srcptr u)
+{
+ mp_ptr wp, up;
+ mp_size_t usize, size;
+
+ usize = SIZ(u);
+ size = ABS (usize);
+
+ wp = MPZ_REALLOC (w, size);
+
+ up = PTR(u);
+
+ MPN_COPY (wp, up, size);
+ SIZ(w) = usize;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpz/set_d.c b/Build/source/libs/gmp/gmp-6.0.0/mpz/set_d.c
new file mode 100644
index 00000000000..d40ee726d23
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpz/set_d.c
@@ -0,0 +1,117 @@
+/* mpz_set_d(integer, val) -- Assign INTEGER with a double value VAL.
+
+Copyright 1995, 1996, 2000-2003, 2006 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 "config.h"
+
+#if HAVE_FLOAT_H
+#include <float.h> /* for DBL_MAX */
+#endif
+
+#include "gmp.h"
+#include "gmp-impl.h"
+
+
+/* We used to have a special case for d < MP_BASE_AS_DOUBLE, just casting
+ double -> limb. Unfortunately gcc 3.3 on powerpc970-apple-darwin6.8.5
+ got this wrong. (It assumed __fixunsdfdi returned its result in a single
+ 64-bit register, where instead that function followed the calling
+ conventions and gave the result in two parts r3 and r4.) Hence the use
+ of __gmp_extract_double in all cases. */
+
+void
+mpz_set_d (mpz_ptr r, double d)
+{
+ int negative;
+ mp_limb_t tp[LIMBS_PER_DOUBLE];
+ mp_ptr rp;
+ mp_size_t rn;
+
+ DOUBLE_NAN_INF_ACTION (d,
+ __gmp_invalid_operation (),
+ __gmp_invalid_operation ());
+
+ negative = d < 0;
+ d = ABS (d);
+
+ rn = __gmp_extract_double (tp, d);
+
+ if (ALLOC(r) < rn)
+ _mpz_realloc (r, rn);
+
+ if (rn <= 0)
+ rn = 0;
+
+ rp = PTR (r);
+
+ switch (rn)
+ {
+ default:
+ MPN_ZERO (rp, rn - LIMBS_PER_DOUBLE);
+ rp += rn - LIMBS_PER_DOUBLE;
+ /* fall through */
+#if LIMBS_PER_DOUBLE == 2
+ case 2:
+ rp[1] = tp[1], rp[0] = tp[0];
+ break;
+ case 1:
+ rp[0] = tp[1];
+ break;
+#endif
+#if LIMBS_PER_DOUBLE == 3
+ case 3:
+ rp[2] = tp[2], rp[1] = tp[1], rp[0] = tp[0];
+ break;
+ case 2:
+ rp[1] = tp[2], rp[0] = tp[1];
+ break;
+ case 1:
+ rp[0] = tp[2];
+ break;
+#endif
+#if LIMBS_PER_DOUBLE == 4
+ case 4:
+ rp[3] = tp[3], rp[2] = tp[2], rp[1] = tp[1], rp[0] = tp[0];
+ break;
+ case 3:
+ rp[2] = tp[3], rp[1] = tp[2], rp[0] = tp[1];
+ break;
+ case 2:
+ rp[1] = tp[3], rp[0] = tp[2];
+ break;
+ case 1:
+ rp[0] = tp[3];
+ break;
+#endif
+ case 0:
+ break;
+ }
+
+ SIZ(r) = negative ? -rn : rn;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpz/set_f.c b/Build/source/libs/gmp/gmp-6.0.0/mpz/set_f.c
new file mode 100644
index 00000000000..4eb98198371
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpz/set_f.c
@@ -0,0 +1,72 @@
+/* mpz_set_f (dest_integer, src_float) -- Assign DEST_INTEGER from SRC_FLOAT.
+
+Copyright 1996, 2001, 2012 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.h"
+#include "gmp-impl.h"
+
+
+void
+mpz_set_f (mpz_ptr w, mpf_srcptr u)
+{
+ mp_ptr wp, up;
+ mp_size_t size;
+ mp_exp_t exp;
+
+ /* abs(u)<1 truncates to zero */
+ exp = EXP (u);
+ if (exp <= 0)
+ {
+ SIZ(w) = 0;
+ return;
+ }
+
+ wp = MPZ_REALLOC (w, exp);
+ up = PTR(u);
+
+ size = SIZ (u);
+ SIZ(w) = (size >= 0 ? exp : -exp);
+ size = ABS (size);
+
+ if (exp > size)
+ {
+ /* pad with low zeros to get a total "exp" many limbs */
+ mp_size_t zeros = exp - size;
+ MPN_ZERO (wp, zeros);
+ wp += zeros;
+ }
+ else
+ {
+ /* exp<=size, truncate to the high "exp" many limbs */
+ up += (size - exp);
+ size = exp;
+ }
+
+ MPN_COPY (wp, up, size);
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpz/set_q.c b/Build/source/libs/gmp/gmp-6.0.0/mpz/set_q.c
new file mode 100644
index 00000000000..2627e822980
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpz/set_q.c
@@ -0,0 +1,35 @@
+/* mpz_set_q (dest_integer, src_rational) -- Assign DEST_INTEGER from
+ SRC_rational.
+
+Copyright 1996, 2001 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_FORCE_mpz_set_q 1
+
+#include "gmp.h"
+#include "gmp-impl.h"
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpz/set_si.c b/Build/source/libs/gmp/gmp-6.0.0/mpz/set_si.c
new file mode 100644
index 00000000000..1370368332e
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpz/set_si.c
@@ -0,0 +1,55 @@
+/* mpz_set_si(dest,val) -- Assign DEST with a small value VAL.
+
+Copyright 1991, 1993-1995, 2000-2002, 2012 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.h"
+#include "gmp-impl.h"
+
+void
+mpz_set_si (mpz_ptr dest, signed long int val)
+{
+ mp_size_t size;
+ mp_limb_t vl;
+
+ vl = (mp_limb_t) ABS_CAST (unsigned long int, val);
+
+ PTR (dest)[0] = vl & GMP_NUMB_MASK;
+ size = vl != 0;
+
+#if GMP_NAIL_BITS != 0
+ if (vl > GMP_NUMB_MAX)
+ {
+ MPZ_REALLOC (dest, 2);
+ PTR (dest)[1] = vl >> GMP_NUMB_BITS;
+ size = 2;
+ }
+#endif
+
+ SIZ (dest) = val >= 0 ? size : -size;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpz/set_str.c b/Build/source/libs/gmp/gmp-6.0.0/mpz/set_str.c
new file mode 100644
index 00000000000..848d2136a0a
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpz/set_str.c
@@ -0,0 +1,145 @@
+/* mpz_set_str(mp_dest, string, base) -- Convert the \0-terminated
+ string STRING in base BASE to multiple precision integer in
+ MP_DEST. Allow white space in the string. If BASE == 0 determine
+ the base in the C standard way, i.e. 0xhh...h means base 16,
+ 0oo...o means base 8, otherwise assume base 10.
+
+Copyright 1991, 1993, 1994, 1996-1998, 2000-2003, 2005, 2011-2013 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 <string.h>
+#include <ctype.h>
+#include "gmp.h"
+#include "gmp-impl.h"
+#include "longlong.h"
+
+#define digit_value_tab __gmp_digit_value_tab
+
+int
+mpz_set_str (mpz_ptr x, const char *str, int base)
+{
+ size_t str_size;
+ char *s, *begs;
+ size_t i;
+ mp_size_t xsize;
+ int c;
+ int negative;
+ const unsigned char *digit_value;
+ TMP_DECL;
+
+ digit_value = digit_value_tab;
+ if (base > 36)
+ {
+ /* For bases > 36, use the collating sequence
+ 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz. */
+ digit_value += 208;
+ if (base > 62)
+ return -1; /* too large base */
+ }
+
+ /* Skip whitespace. */
+ do
+ c = (unsigned char) *str++;
+ while (isspace (c));
+
+ negative = 0;
+ if (c == '-')
+ {
+ negative = 1;
+ c = (unsigned char) *str++;
+ }
+
+ if (digit_value[c] >= (base == 0 ? 10 : base))
+ return -1; /* error if no valid digits */
+
+ /* If BASE is 0, try to find out the base by looking at the initial
+ characters. */
+ if (base == 0)
+ {
+ base = 10;
+ if (c == '0')
+ {
+ base = 8;
+ c = (unsigned char) *str++;
+ if (c == 'x' || c == 'X')
+ {
+ base = 16;
+ c = (unsigned char) *str++;
+ }
+ else if (c == 'b' || c == 'B')
+ {
+ base = 2;
+ c = (unsigned char) *str++;
+ }
+ }
+ }
+
+ /* Skip leading zeros and white space. */
+ while (c == '0' || isspace (c))
+ c = (unsigned char) *str++;
+ /* Make sure the string does not become empty, mpn_set_str would fail. */
+ if (c == 0)
+ {
+ SIZ (x) = 0;
+ return 0;
+ }
+
+ TMP_MARK;
+ str_size = strlen (str - 1);
+ s = begs = (char *) TMP_ALLOC (str_size + 1);
+
+ /* Remove spaces from the string and convert the result from ASCII to a
+ byte array. */
+ for (i = 0; i < str_size; i++)
+ {
+ if (!isspace (c))
+ {
+ int dig = digit_value[c];
+ if (dig >= base)
+ {
+ TMP_FREE;
+ return -1;
+ }
+ *s++ = dig;
+ }
+ c = (unsigned char) *str++;
+ }
+
+ str_size = s - begs;
+
+ LIMBS_PER_DIGIT_IN_BASE (xsize, str_size, base);
+ MPZ_REALLOC (x, xsize);
+
+ /* Convert the byte array in base BASE to our bignum format. */
+ xsize = mpn_set_str (PTR (x), (unsigned char *) begs, str_size, base);
+ SIZ (x) = negative ? -xsize : xsize;
+
+ TMP_FREE;
+ return 0;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpz/set_ui.c b/Build/source/libs/gmp/gmp-6.0.0/mpz/set_ui.c
new file mode 100644
index 00000000000..f36754cd59b
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpz/set_ui.c
@@ -0,0 +1,53 @@
+/* mpz_set_ui(integer, val) -- Assign INTEGER with a small value VAL.
+
+Copyright 1991, 1993-1995, 2001, 2002, 2004, 2012 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.h"
+#include "gmp-impl.h"
+
+void
+mpz_set_ui (mpz_ptr dest, unsigned long int val)
+{
+ mp_size_t size;
+
+ PTR (dest)[0] = val & GMP_NUMB_MASK;
+ size = val != 0;
+
+#if BITS_PER_ULONG > GMP_NUMB_BITS /* avoid warnings about shift amount */
+ if (val > GMP_NUMB_MAX)
+ {
+ MPZ_REALLOC (dest, 2);
+ PTR (dest)[1] = val >> GMP_NUMB_BITS;
+ size = 2;
+ }
+#endif
+
+ SIZ (dest) = size;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpz/setbit.c b/Build/source/libs/gmp/gmp-6.0.0/mpz/setbit.c
new file mode 100644
index 00000000000..3c2c139f987
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpz/setbit.c
@@ -0,0 +1,105 @@
+/* mpz_setbit -- set a specified bit.
+
+Copyright 1991, 1993-1995, 1997, 1999, 2001, 2002, 2012 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.h"
+#include "gmp-impl.h"
+
+void
+mpz_setbit (mpz_ptr d, mp_bitcnt_t bit_idx)
+{
+ mp_size_t dsize = SIZ (d);
+ mp_ptr dp = PTR (d);
+ mp_size_t limb_idx;
+ mp_limb_t mask;
+
+ limb_idx = bit_idx / GMP_NUMB_BITS;
+ mask = CNST_LIMB(1) << (bit_idx % GMP_NUMB_BITS);
+ if (dsize >= 0)
+ {
+ if (limb_idx < dsize)
+ {
+ dp[limb_idx] |= mask;
+ }
+ else
+ {
+ /* Ugh. The bit should be set outside of the end of the
+ number. We have to increase the size of the number. */
+ dp = MPZ_REALLOC (d, limb_idx + 1);
+ SIZ (d) = limb_idx + 1;
+ MPN_ZERO (dp + dsize, limb_idx - dsize);
+ dp[limb_idx] = mask;
+ }
+ }
+ else
+ {
+ /* Simulate two's complement arithmetic, i.e. simulate
+ 1. Set OP = ~(OP - 1) [with infinitely many leading ones].
+ 2. Set the bit.
+ 3. Set OP = ~OP + 1. */
+
+ dsize = -dsize;
+
+ if (limb_idx < dsize)
+ {
+ mp_size_t zero_bound;
+ /* No index upper bound on this loop, we're sure there's a non-zero limb
+ sooner or later. */
+ zero_bound = 0;
+ while (dp[zero_bound] == 0)
+ zero_bound++;
+
+ if (limb_idx > zero_bound)
+ {
+ mp_limb_t dlimb;
+ dlimb = dp[limb_idx] & ~mask;
+ dp[limb_idx] = dlimb;
+
+ if (UNLIKELY ((dlimb == 0) + limb_idx == dsize)) /* dsize == limb_idx + 1 */
+ {
+ /* high limb became zero, must normalize */
+ MPN_NORMALIZE (dp, limb_idx);
+ SIZ (d) = -limb_idx;
+ }
+ }
+ else if (limb_idx == zero_bound)
+ {
+ dp[limb_idx] = ((dp[limb_idx] - 1) & ~mask) + 1;
+ ASSERT (dp[limb_idx] != 0);
+ }
+ else
+ {
+ MPN_DECR_U (dp + limb_idx, dsize - limb_idx, mask);
+ dsize -= dp[dsize - 1] == 0;
+ SIZ (d) = -dsize;
+ }
+ }
+ }
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpz/size.c b/Build/source/libs/gmp/gmp-6.0.0/mpz/size.c
new file mode 100644
index 00000000000..2b324c34230
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpz/size.c
@@ -0,0 +1,35 @@
+/* mpz_size(x) -- return the number of lims currently used by the
+ value of integer X.
+
+Copyright 1991, 1993-1995, 2001 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_FORCE_mpz_size 1
+
+#include "gmp.h"
+#include "gmp-impl.h"
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpz/sizeinbase.c b/Build/source/libs/gmp/gmp-6.0.0/mpz/sizeinbase.c
new file mode 100644
index 00000000000..0f3851ea861
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpz/sizeinbase.c
@@ -0,0 +1,43 @@
+/* mpz_sizeinbase(x, base) -- return an approximation to the number of
+ character the integer X would have printed in base BASE. The
+ approximation is never too small.
+
+Copyright 1991, 1993-1995, 2001, 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/. */
+
+#include "gmp.h"
+#include "gmp-impl.h"
+#include "longlong.h"
+
+size_t
+mpz_sizeinbase (mpz_srcptr x, int base) __GMP_NOTHROW
+{
+ size_t result;
+ MPN_SIZEINBASE (result, PTR(x), ABSIZ(x), base);
+ return result;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpz/sqrt.c b/Build/source/libs/gmp/gmp-6.0.0/mpz/sqrt.c
new file mode 100644
index 00000000000..d906cfd59e8
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpz/sqrt.c
@@ -0,0 +1,77 @@
+/* mpz_sqrt(root, u) -- Set ROOT to floor(sqrt(U)).
+
+Copyright 1991, 1993, 1994, 1996, 2000, 2001, 2005, 2012 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> /* for NULL */
+#include "gmp.h"
+#include "gmp-impl.h"
+
+void
+mpz_sqrt (mpz_ptr root, mpz_srcptr op)
+{
+ mp_size_t op_size, root_size;
+ mp_ptr root_ptr, op_ptr;
+
+ op_size = SIZ (op);
+ if (UNLIKELY (op_size <= 0))
+ {
+ if (op_size < 0)
+ SQRT_OF_NEGATIVE;
+ SIZ(root) = 0;
+ return;
+ }
+
+ /* The size of the root is accurate after this simple calculation. */
+ root_size = (op_size + 1) / 2;
+ SIZ (root) = root_size;
+
+ op_ptr = PTR (op);
+
+ if (root == op)
+ {
+ /* Allocate temp space for the root, which we then copy to the
+ shared OP/ROOT variable. */
+ TMP_DECL;
+ TMP_MARK;
+
+ root_ptr = TMP_ALLOC_LIMBS (root_size);
+ mpn_sqrtrem (root_ptr, NULL, op_ptr, op_size);
+
+ MPN_COPY (op_ptr, root_ptr, root_size);
+
+ TMP_FREE;
+ }
+ else
+ {
+ root_ptr = MPZ_REALLOC (root, root_size);
+
+ mpn_sqrtrem (root_ptr, NULL, op_ptr, op_size);
+ }
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpz/sqrtrem.c b/Build/source/libs/gmp/gmp-6.0.0/mpz/sqrtrem.c
new file mode 100644
index 00000000000..99685354d6e
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpz/sqrtrem.c
@@ -0,0 +1,85 @@
+/* mpz_sqrtrem(root,rem,x) -- Set ROOT to floor(sqrt(X)) and REM
+ to the remainder, i.e. X - ROOT**2.
+
+Copyright 1991, 1993, 1994, 1996, 2000, 2001, 2005, 2011, 2012 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.h"
+#include "gmp-impl.h"
+
+void
+mpz_sqrtrem (mpz_ptr root, mpz_ptr rem, mpz_srcptr op)
+{
+ mp_size_t op_size, root_size, rem_size;
+ mp_ptr root_ptr, op_ptr, rem_ptr;
+
+ op_size = SIZ (op);
+ if (UNLIKELY (op_size <= 0))
+ {
+ if (op_size < 0)
+ SQRT_OF_NEGATIVE;
+ SIZ(root) = 0;
+ SIZ(rem) = 0;
+ return;
+ }
+
+ rem_ptr = MPZ_REALLOC (rem, op_size);
+
+ /* The size of the root is accurate after this simple calculation. */
+ root_size = (op_size + 1) / 2;
+ SIZ (root) = root_size;
+
+ op_ptr = PTR (op);
+
+ if (root == op)
+ {
+ /* Allocate temp space for the root, which we then copy to the
+ shared OP/ROOT variable. */
+ TMP_DECL;
+ TMP_MARK;
+
+ root_ptr = TMP_ALLOC_LIMBS (root_size);
+ rem_size = mpn_sqrtrem (root_ptr, rem_ptr, op_ptr, op_size);
+
+ if (rem != root) /* Don't overwrite remainder */
+ MPN_COPY (op_ptr, root_ptr, root_size);
+
+ TMP_FREE;
+ }
+ else
+ {
+ root_ptr = MPZ_REALLOC (root, root_size);
+
+ rem_size = mpn_sqrtrem (root_ptr, rem_ptr, op_ptr, op_size);
+ }
+
+ /* Write remainder size last, to make this function give only the square root
+ remainder, when passed ROOT == REM. */
+ SIZ (rem) = rem_size;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpz/sub.c b/Build/source/libs/gmp/gmp-6.0.0/mpz/sub.c
new file mode 100644
index 00000000000..7cb022e0692
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpz/sub.c
@@ -0,0 +1,33 @@
+/* mpz_sub -- subtract integers.
+
+Copyright 2001 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 OPERATION_sub
+#include "aors.h"
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpz/sub_ui.c b/Build/source/libs/gmp/gmp-6.0.0/mpz/sub_ui.c
new file mode 100644
index 00000000000..3ce23d3555f
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpz/sub_ui.c
@@ -0,0 +1,33 @@
+/* mpz_sub_ui -- Subtract an mpz_t and an unsigned one-word integer.
+
+Copyright 2001 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 OPERATION_sub_ui
+#include "aors_ui.h"
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpz/swap.c b/Build/source/libs/gmp/gmp-6.0.0/mpz/swap.c
new file mode 100644
index 00000000000..0fc11fb9e1a
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpz/swap.c
@@ -0,0 +1,55 @@
+/* mpz_swap (dest_integer, src_integer) -- Swap U and V.
+
+Copyright 1997, 1998, 2001, 2012 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.h"
+#include "gmp-impl.h"
+
+void
+mpz_swap (mpz_ptr u, mpz_ptr v) __GMP_NOTHROW
+{
+ mp_ptr up, vp;
+ mp_size_t usize, vsize;
+ mp_size_t ualloc, valloc;
+
+ ualloc = ALLOC (u);
+ valloc = ALLOC (v);
+ ALLOC (v) = ualloc;
+ ALLOC (u) = valloc;
+
+ usize = SIZ (u);
+ vsize = SIZ (v);
+ SIZ (v) = usize;
+ SIZ (u) = vsize;
+
+ up = PTR (u);
+ vp = PTR (v);
+ PTR (v) = up;
+ PTR (u) = vp;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpz/tdiv_q.c b/Build/source/libs/gmp/gmp-6.0.0/mpz/tdiv_q.c
new file mode 100644
index 00000000000..38528f35bfb
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpz/tdiv_q.c
@@ -0,0 +1,93 @@
+/* mpz_tdiv_q -- divide two integers and produce a quotient.
+
+Copyright 1991, 1993, 1994, 1996, 2000, 2001, 2005, 2010, 2012 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.h"
+#include "gmp-impl.h"
+#include "longlong.h"
+
+void
+mpz_tdiv_q (mpz_ptr quot, mpz_srcptr num, mpz_srcptr den)
+{
+ mp_size_t ql;
+ mp_size_t ns, ds, nl, dl;
+ mp_ptr np, dp, qp;
+ TMP_DECL;
+
+ ns = SIZ (num);
+ ds = SIZ (den);
+ nl = ABS (ns);
+ dl = ABS (ds);
+ ql = nl - dl + 1;
+
+ if (UNLIKELY (dl == 0))
+ DIVIDE_BY_ZERO;
+
+ if (ql <= 0)
+ {
+ SIZ (quot) = 0;
+ return;
+ }
+
+ qp = MPZ_REALLOC (quot, ql);
+
+ TMP_MARK;
+ np = PTR (num);
+ dp = PTR (den);
+
+ /* Copy denominator to temporary space if it overlaps with the quotient. */
+ if (dp == qp)
+ {
+ mp_ptr tp;
+ tp = TMP_ALLOC_LIMBS (dl);
+ MPN_COPY (tp, dp, dl);
+ dp = tp;
+ }
+ /* Copy numerator to temporary space if it overlaps with the quotient. */
+ if (np == qp)
+ {
+ mp_ptr tp;
+ tp = TMP_ALLOC_LIMBS (nl + 1);
+ MPN_COPY (tp, np, nl);
+ /* Overlap dividend and scratch. */
+ mpn_div_q (qp, tp, nl, dp, dl, tp);
+ }
+ else
+ {
+ mp_ptr tp;
+ tp = TMP_ALLOC_LIMBS (nl + 1);
+ mpn_div_q (qp, np, nl, dp, dl, tp);
+ }
+
+ ql -= qp[ql - 1] == 0;
+
+ SIZ (quot) = (ns ^ ds) >= 0 ? ql : -ql;
+ TMP_FREE;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpz/tdiv_q_2exp.c b/Build/source/libs/gmp/gmp-6.0.0/mpz/tdiv_q_2exp.c
new file mode 100644
index 00000000000..9ffcaf2bbbe
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpz/tdiv_q_2exp.c
@@ -0,0 +1,68 @@
+/* mpz_tdiv_q_2exp -- Divide an integer by 2**CNT. Round the quotient
+ towards -infinity.
+
+Copyright 1991, 1993, 1994, 1996, 2001, 2002, 2012 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.h"
+#include "gmp-impl.h"
+
+void
+mpz_tdiv_q_2exp (mpz_ptr r, mpz_srcptr u, mp_bitcnt_t cnt)
+{
+ mp_size_t un, rn;
+ mp_size_t limb_cnt;
+ mp_ptr rp;
+ mp_srcptr up;
+
+ un = SIZ(u);
+ limb_cnt = cnt / GMP_NUMB_BITS;
+ rn = ABS (un) - limb_cnt;
+
+ if (rn <= 0)
+ rn = 0;
+ else
+ {
+ rp = MPZ_REALLOC (r, rn);
+ up = PTR(u) + limb_cnt;
+
+ cnt %= GMP_NUMB_BITS;
+ if (cnt != 0)
+ {
+ mpn_rshift (rp, up, rn, cnt);
+ rn -= rp[rn - 1] == 0;
+ }
+ else
+ {
+ MPN_COPY_INCR (rp, up, rn);
+ }
+ }
+
+ SIZ(r) = un >= 0 ? rn : -rn;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpz/tdiv_q_ui.c b/Build/source/libs/gmp/gmp-6.0.0/mpz/tdiv_q_ui.c
new file mode 100644
index 00000000000..88e90825290
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpz/tdiv_q_ui.c
@@ -0,0 +1,84 @@
+/* mpz_tdiv_q_ui(quot, dividend, divisor_limb)
+ -- Divide DIVIDEND by DIVISOR_LIMB and store the result in QUOT.
+
+Copyright 1991, 1993, 1994, 1996, 1998, 2001, 2002, 2004, 2012 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.h"
+#include "gmp-impl.h"
+
+unsigned long int
+mpz_tdiv_q_ui (mpz_ptr quot, mpz_srcptr dividend, unsigned long int divisor)
+{
+ mp_size_t ns, nn, qn;
+ mp_ptr np, qp;
+ mp_limb_t rl;
+
+ if (UNLIKELY (divisor == 0))
+ DIVIDE_BY_ZERO;
+
+ ns = SIZ(dividend);
+ if (ns == 0)
+ {
+ SIZ(quot) = 0;
+ return 0;
+ }
+
+ nn = ABS(ns);
+ qp = MPZ_REALLOC (quot, nn);
+ np = PTR(dividend);
+
+#if BITS_PER_ULONG > GMP_NUMB_BITS /* avoid warnings about shift amount */
+ if (divisor > GMP_NUMB_MAX)
+ {
+ mp_limb_t dp[2], rp[2];
+
+ if (nn == 1) /* tdiv_qr requirements; tested above for 0 */
+ {
+ SIZ(quot) = 0;
+ rl = np[0];
+ return rl;
+ }
+
+ dp[0] = divisor & GMP_NUMB_MASK;
+ dp[1] = divisor >> GMP_NUMB_BITS;
+ mpn_tdiv_qr (qp, rp, (mp_size_t) 0, np, nn, dp, (mp_size_t) 2);
+ rl = rp[0] + (rp[1] << GMP_NUMB_BITS);
+ qn = nn - 2 + 1; qn -= qp[qn - 1] == 0; qn -= qn != 0 && qp[qn - 1] == 0;
+ }
+ else
+#endif
+ {
+ rl = mpn_divrem_1 (qp, (mp_size_t) 0, np, nn, (mp_limb_t) divisor);
+ qn = nn - (qp[nn - 1] == 0);
+ }
+
+ SIZ(quot) = ns >= 0 ? qn : -qn;
+ return rl;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpz/tdiv_qr.c b/Build/source/libs/gmp/gmp-6.0.0/mpz/tdiv_qr.c
new file mode 100644
index 00000000000..ab9a37dae9c
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpz/tdiv_qr.c
@@ -0,0 +1,107 @@
+/* mpz_tdiv_qr(quot,rem,dividend,divisor) -- Set QUOT to DIVIDEND/DIVISOR,
+ and REM to DIVIDEND mod DIVISOR.
+
+Copyright 1991, 1993, 1994, 2000, 2001, 2005, 2011, 2012 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.h"
+#include "gmp-impl.h"
+#include "longlong.h"
+
+void
+mpz_tdiv_qr (mpz_ptr quot, mpz_ptr rem, mpz_srcptr num, mpz_srcptr den)
+{
+ mp_size_t ql;
+ mp_size_t ns, ds, nl, dl;
+ mp_ptr np, dp, qp, rp;
+ TMP_DECL;
+
+ ns = SIZ (num);
+ ds = SIZ (den);
+ nl = ABS (ns);
+ dl = ABS (ds);
+ ql = nl - dl + 1;
+
+ if (UNLIKELY (dl == 0))
+ DIVIDE_BY_ZERO;
+
+ rp = MPZ_REALLOC (rem, dl);
+
+ if (ql <= 0)
+ {
+ if (num != rem)
+ {
+ np = PTR (num);
+ MPN_COPY (rp, np, nl);
+ SIZ (rem) = SIZ (num);
+ }
+ /* This needs to follow the assignment to rem, in case the
+ numerator and quotient are the same. */
+ SIZ (quot) = 0;
+ return;
+ }
+
+ qp = MPZ_REALLOC (quot, ql);
+
+ TMP_MARK;
+ np = PTR (num);
+ dp = PTR (den);
+
+ /* FIXME: We should think about how to handle the temporary allocation.
+ Perhaps mpn_tdiv_qr should handle it, since it anyway often needs to
+ allocate temp space. */
+
+ /* Copy denominator to temporary space if it overlaps with the quotient
+ or remainder. */
+ if (dp == rp || dp == qp)
+ {
+ mp_ptr tp;
+ tp = TMP_ALLOC_LIMBS (dl);
+ MPN_COPY (tp, dp, dl);
+ dp = tp;
+ }
+ /* Copy numerator to temporary space if it overlaps with the quotient or
+ remainder. */
+ if (np == rp || np == qp)
+ {
+ mp_ptr tp;
+ tp = TMP_ALLOC_LIMBS (nl);
+ MPN_COPY (tp, np, nl);
+ np = tp;
+ }
+
+ mpn_tdiv_qr (qp, rp, 0L, np, nl, dp, dl);
+
+ ql -= qp[ql - 1] == 0;
+ MPN_NORMALIZE (rp, dl);
+
+ SIZ (quot) = (ns ^ ds) >= 0 ? ql : -ql;
+ SIZ (rem) = ns >= 0 ? dl : -dl;
+ TMP_FREE;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpz/tdiv_qr_ui.c b/Build/source/libs/gmp/gmp-6.0.0/mpz/tdiv_qr_ui.c
new file mode 100644
index 00000000000..4f667abe07d
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpz/tdiv_qr_ui.c
@@ -0,0 +1,103 @@
+/* mpz_tdiv_qr_ui(quot,rem,dividend,short_divisor) --
+ Set QUOT to DIVIDEND / SHORT_DIVISOR
+ and REM to DIVIDEND mod SHORT_DIVISOR.
+
+Copyright 1991, 1993, 1994, 1996, 1998, 2001, 2002, 2004, 2012 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.h"
+#include "gmp-impl.h"
+
+unsigned long int
+mpz_tdiv_qr_ui (mpz_ptr quot, mpz_ptr rem, mpz_srcptr dividend, unsigned long int divisor)
+{
+ mp_size_t ns, nn, qn;
+ mp_ptr np, qp;
+ mp_limb_t rl;
+
+ if (UNLIKELY (divisor == 0))
+ DIVIDE_BY_ZERO;
+
+ ns = SIZ(dividend);
+ if (ns == 0)
+ {
+ SIZ(quot) = 0;
+ SIZ(rem) = 0;
+ return 0;
+ }
+
+ nn = ABS(ns);
+ qp = MPZ_REALLOC (quot, nn);
+ np = PTR(dividend);
+
+#if BITS_PER_ULONG > GMP_NUMB_BITS /* avoid warnings about shift amount */
+ if (divisor > GMP_NUMB_MAX)
+ {
+ mp_limb_t dp[2];
+ mp_ptr rp;
+ mp_size_t rn;
+
+ if (nn == 1) /* tdiv_qr requirements; tested above for 0 */
+ {
+ SIZ(quot) = 0;
+ rl = np[0];
+ SIZ(rem) = ns >= 0 ? 1 : -1;
+ PTR(rem)[0] = rl;
+ return rl;
+ }
+
+ rp = MPZ_REALLOC (rem, 2);
+
+ dp[0] = divisor & GMP_NUMB_MASK;
+ dp[1] = divisor >> GMP_NUMB_BITS;
+ mpn_tdiv_qr (qp, rp, (mp_size_t) 0, np, nn, dp, (mp_size_t) 2);
+ rl = rp[0] + (rp[1] << GMP_NUMB_BITS);
+ qn = nn - 2 + 1; qn -= qp[qn - 1] == 0; qn -= qn != 0 && qp[qn - 1] == 0;
+ rn = 2 - (rp[1] == 0); rn -= (rp[rn - 1] == 0);
+ SIZ(rem) = ns >= 0 ? rn : -rn;
+ }
+ else
+#endif
+ {
+ rl = mpn_divrem_1 (qp, (mp_size_t) 0, np, nn, (mp_limb_t) divisor);
+ if (rl == 0)
+ SIZ(rem) = 0;
+ else
+ {
+ /* Store the single-limb remainder. We don't check if there's space
+ for just one limb, since no function ever makes zero space. */
+ SIZ(rem) = ns >= 0 ? 1 : -1;
+ PTR(rem)[0] = rl;
+ }
+ qn = nn - (qp[nn - 1] == 0);
+ }
+
+ SIZ(quot) = ns >= 0 ? qn : -qn;
+ return rl;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpz/tdiv_r.c b/Build/source/libs/gmp/gmp-6.0.0/mpz/tdiv_r.c
new file mode 100644
index 00000000000..d9cb38c3232
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpz/tdiv_r.c
@@ -0,0 +1,98 @@
+/* mpz_tdiv_r(rem, dividend, divisor) -- Set REM to DIVIDEND mod DIVISOR.
+
+Copyright 1991, 1993, 1994, 2000, 2001, 2005, 2012 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.h"
+#include "gmp-impl.h"
+#include "longlong.h"
+
+void
+mpz_tdiv_r (mpz_ptr rem, mpz_srcptr num, mpz_srcptr den)
+{
+ mp_size_t ql;
+ mp_size_t ns, ds, nl, dl;
+ mp_ptr np, dp, qp, rp;
+ TMP_DECL;
+
+ ns = SIZ (num);
+ ds = SIZ (den);
+ nl = ABS (ns);
+ dl = ABS (ds);
+ ql = nl - dl + 1;
+
+ if (UNLIKELY (dl == 0))
+ DIVIDE_BY_ZERO;
+
+ rp = MPZ_REALLOC (rem, dl);
+
+ if (ql <= 0)
+ {
+ if (num != rem)
+ {
+ np = PTR (num);
+ MPN_COPY (rp, np, nl);
+ SIZ (rem) = SIZ (num);
+ }
+ return;
+ }
+
+ TMP_MARK;
+ qp = TMP_ALLOC_LIMBS (ql);
+ np = PTR (num);
+ dp = PTR (den);
+
+ /* FIXME: We should think about how to handle the temporary allocation.
+ Perhaps mpn_tdiv_qr should handle it, since it anyway often needs to
+ allocate temp space. */
+
+ /* Copy denominator to temporary space if it overlaps with the remainder. */
+ if (dp == rp)
+ {
+ mp_ptr tp;
+ tp = TMP_ALLOC_LIMBS (dl);
+ MPN_COPY (tp, dp, dl);
+ dp = tp;
+ }
+ /* Copy numerator to temporary space if it overlaps with the remainder. */
+ if (np == rp)
+ {
+ mp_ptr tp;
+ tp = TMP_ALLOC_LIMBS (nl);
+ MPN_COPY (tp, np, nl);
+ np = tp;
+ }
+
+ mpn_tdiv_qr (qp, rp, 0L, np, nl, dp, dl);
+
+ MPN_NORMALIZE (rp, dl);
+
+ SIZ (rem) = ns >= 0 ? dl : -dl;
+ TMP_FREE;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpz/tdiv_r_2exp.c b/Build/source/libs/gmp/gmp-6.0.0/mpz/tdiv_r_2exp.c
new file mode 100644
index 00000000000..e21d90fecd5
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpz/tdiv_r_2exp.c
@@ -0,0 +1,78 @@
+/* mpz_tdiv_r_2exp -- Divide an integer by 2**CNT and produce a remainder.
+
+Copyright 1991, 1993-1995, 2001, 2002, 2012 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.h"
+#include "gmp-impl.h"
+
+void
+mpz_tdiv_r_2exp (mpz_ptr res, mpz_srcptr in, mp_bitcnt_t cnt)
+{
+ mp_size_t in_size = ABSIZ (in);
+ mp_size_t res_size;
+ mp_size_t limb_cnt = cnt / GMP_NUMB_BITS;
+ mp_srcptr in_ptr = PTR (in);
+
+ if (in_size > limb_cnt)
+ {
+ /* The input operand is (probably) greater than 2**CNT. */
+ mp_limb_t x;
+
+ x = in_ptr[limb_cnt] & (((mp_limb_t) 1 << cnt % GMP_NUMB_BITS) - 1);
+ if (x != 0)
+ {
+ res_size = limb_cnt + 1;
+ MPZ_REALLOC (res, res_size);
+
+ PTR (res)[limb_cnt] = x;
+ }
+ else
+ {
+ res_size = limb_cnt;
+ MPN_NORMALIZE (in_ptr, res_size);
+
+ MPZ_REALLOC (res, res_size);
+
+ limb_cnt = res_size;
+ }
+ }
+ else
+ {
+ /* The input operand is smaller than 2**CNT. We perform a no-op,
+ apart from that we might need to copy IN to RES. */
+ res_size = in_size;
+ MPZ_REALLOC (res, res_size);
+
+ limb_cnt = res_size;
+ }
+
+ if (res != in)
+ MPN_COPY (PTR (res), PTR (in), limb_cnt);
+ SIZ (res) = SIZ (in) >= 0 ? res_size : -res_size;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpz/tdiv_r_ui.c b/Build/source/libs/gmp/gmp-6.0.0/mpz/tdiv_r_ui.c
new file mode 100644
index 00000000000..30addd6db79
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpz/tdiv_r_ui.c
@@ -0,0 +1,99 @@
+/* mpz_tdiv_r_ui(rem, dividend, divisor_limb)
+ -- Set REM to DIVDEND mod DIVISOR_LIMB.
+
+Copyright 1991, 1993, 1994, 1996, 1998, 2001, 2002, 2004, 2005, 2012 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.h"
+#include "gmp-impl.h"
+
+unsigned long int
+mpz_tdiv_r_ui (mpz_ptr rem, mpz_srcptr dividend, unsigned long int divisor)
+{
+ mp_size_t ns, nn;
+ mp_ptr np;
+ mp_limb_t rl;
+
+ if (UNLIKELY (divisor == 0))
+ DIVIDE_BY_ZERO;
+
+ ns = SIZ(dividend);
+ if (ns == 0)
+ {
+ SIZ(rem) = 0;
+ return 0;
+ }
+
+ nn = ABS(ns);
+ np = PTR(dividend);
+#if BITS_PER_ULONG > GMP_NUMB_BITS /* avoid warnings about shift amount */
+ if (divisor > GMP_NUMB_MAX)
+ {
+ mp_limb_t dp[2];
+ mp_ptr rp, qp;
+ mp_size_t rn;
+ TMP_DECL;
+
+ if (nn == 1) /* tdiv_qr requirements; tested above for 0 */
+ {
+ rl = np[0];
+ SIZ(rem) = ns >= 0 ? 1 : -1;
+ PTR(rem)[0] = rl;
+ return rl;
+ }
+
+ rp = MPZ_REALLOC (rem, 2);
+
+ TMP_MARK;
+ dp[0] = divisor & GMP_NUMB_MASK;
+ dp[1] = divisor >> GMP_NUMB_BITS;
+ qp = TMP_ALLOC_LIMBS (nn - 2 + 1);
+ mpn_tdiv_qr (qp, rp, (mp_size_t) 0, np, nn, dp, (mp_size_t) 2);
+ TMP_FREE;
+ rl = rp[0] + (rp[1] << GMP_NUMB_BITS);
+ rn = 2 - (rp[1] == 0); rn -= (rp[rn - 1] == 0);
+ SIZ(rem) = ns >= 0 ? rn : -rn;
+ }
+ else
+#endif
+ {
+ rl = mpn_mod_1 (np, nn, (mp_limb_t) divisor);
+ if (rl == 0)
+ SIZ(rem) = 0;
+ else
+ {
+ /* Store the single-limb remainder. We don't check if there's space
+ for just one limb, since no function ever makes zero space. */
+ SIZ(rem) = ns >= 0 ? 1 : -1;
+ PTR(rem)[0] = rl;
+ }
+ }
+
+ return rl;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpz/tdiv_ui.c b/Build/source/libs/gmp/gmp-6.0.0/mpz/tdiv_ui.c
new file mode 100644
index 00000000000..328d67fdf88
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpz/tdiv_ui.c
@@ -0,0 +1,85 @@
+/* mpz_tdiv_ui(dividend, divisor_limb) -- Return DIVDEND mod DIVISOR_LIMB.
+
+Copyright 1991, 1993, 1994, 1996-1998, 2001, 2002, 2004, 2005, 2012 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.h"
+#include "gmp-impl.h"
+#include "longlong.h"
+
+unsigned long int
+mpz_tdiv_ui (mpz_srcptr dividend, unsigned long int divisor)
+{
+ mp_size_t ns, nn;
+ mp_ptr np;
+ mp_limb_t rl;
+
+ if (UNLIKELY (divisor == 0))
+ DIVIDE_BY_ZERO;
+
+ ns = SIZ(dividend);
+ if (ns == 0)
+ {
+ return 0;
+ }
+
+ nn = ABS(ns);
+ np = PTR(dividend);
+
+#if BITS_PER_ULONG > GMP_NUMB_BITS /* avoid warnings about shift amount */
+ if (divisor > GMP_NUMB_MAX)
+ {
+ mp_limb_t dp[2], rp[2];
+ mp_ptr qp;
+ mp_size_t rn;
+ TMP_DECL;
+
+ if (nn == 1) /* tdiv_qr requirements; tested above for 0 */
+ {
+ rl = np[0];
+ return rl;
+ }
+
+ TMP_MARK;
+ dp[0] = divisor & GMP_NUMB_MASK;
+ dp[1] = divisor >> GMP_NUMB_BITS;
+ qp = TMP_ALLOC_LIMBS (nn - 2 + 1);
+ mpn_tdiv_qr (qp, rp, (mp_size_t) 0, np, nn, dp, (mp_size_t) 2);
+ TMP_FREE;
+ rl = rp[0] + (rp[1] << GMP_NUMB_BITS);
+ rn = 2 - (rp[1] == 0); rn -= (rp[rn - 1] == 0);
+ }
+ else
+#endif
+ {
+ rl = mpn_mod_1 (np, nn, (mp_limb_t) divisor);
+ }
+
+ return rl;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpz/tstbit.c b/Build/source/libs/gmp/gmp-6.0.0/mpz/tstbit.c
new file mode 100644
index 00000000000..db3d75a64f9
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpz/tstbit.c
@@ -0,0 +1,81 @@
+/* mpz_tstbit -- test a specified bit.
+
+Copyright 2000, 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/. */
+
+#include "gmp.h"
+#include "gmp-impl.h"
+
+
+/* For negatives the effective twos complement is achieved by negating the
+ limb tested, either with a ones or twos complement. Twos complement
+ ("-") is used if there's only zero limbs below the one being tested.
+ Ones complement ("~") is used if there's a non-zero below. Note that "-"
+ is correct even if the limb examined is 0 (and the true beginning of twos
+ complement is further up).
+
+ Testing the limbs below p is unavoidable on negatives, but will usually
+ need to examine only *(p-1). The search is done from *(p-1) down to
+ *u_ptr, since that might give better cache locality, and because a
+ non-zero limb is perhaps a touch more likely in the middle of a number
+ than at the low end.
+
+ Bits past the end of available data simply follow sign of u. Notice that
+ the limb_index >= abs_size test covers u=0 too. */
+
+int
+mpz_tstbit (mpz_srcptr u, mp_bitcnt_t bit_index) __GMP_NOTHROW
+{
+ mp_srcptr u_ptr = PTR(u);
+ mp_size_t size = SIZ(u);
+ unsigned abs_size = ABS(size);
+ mp_size_t limb_index = bit_index / GMP_NUMB_BITS;
+ mp_srcptr p = u_ptr + limb_index;
+ mp_limb_t limb;
+
+ if (limb_index >= abs_size)
+ return (size < 0);
+
+ limb = *p;
+ if (size < 0)
+ {
+ limb = -limb; /* twos complement */
+
+ while (p != u_ptr)
+ {
+ p--;
+ if (*p != 0)
+ {
+ limb--; /* make it a ones complement instead */
+ break;
+ }
+ }
+ }
+
+ return (limb >> (bit_index % GMP_NUMB_BITS)) & 1;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpz/ui_pow_ui.c b/Build/source/libs/gmp/gmp-6.0.0/mpz/ui_pow_ui.c
new file mode 100644
index 00000000000..a4f23c56555
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpz/ui_pow_ui.c
@@ -0,0 +1,59 @@
+/* mpz_ui_pow_ui -- ulong raised to ulong.
+
+Copyright 2001, 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/. */
+
+#include "gmp.h"
+#include "gmp-impl.h"
+
+
+void
+mpz_ui_pow_ui (mpz_ptr r, unsigned long b, unsigned long e)
+{
+#if GMP_NAIL_BITS != 0
+ if (b > GMP_NUMB_MAX)
+ {
+ mp_limb_t bb[2];
+ bb[0] = b & GMP_NUMB_MASK;
+ bb[1] = b >> GMP_NUMB_BITS;
+ mpz_n_pow_ui (r, bb, (mp_size_t) 2, e);
+ }
+ else
+#endif
+ {
+#ifdef _LONG_LONG_LIMB
+ /* i386 gcc 2.95.3 doesn't recognise blimb can be eliminated when
+ mp_limb_t is an unsigned long, so only use a separate blimb when
+ necessary. */
+ mp_limb_t blimb = b;
+ mpz_n_pow_ui (r, &blimb, (mp_size_t) (b != 0), e);
+#else
+ mpz_n_pow_ui (r, &b, (mp_size_t) (b != 0), e);
+#endif
+ }
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpz/ui_sub.c b/Build/source/libs/gmp/gmp-6.0.0/mpz/ui_sub.c
new file mode 100644
index 00000000000..579a3007954
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpz/ui_sub.c
@@ -0,0 +1,96 @@
+/* mpz_ui_sub -- Subtract an unsigned one-word integer and an mpz_t.
+
+Copyright 2002, 2004 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.h"
+#include "gmp-impl.h"
+
+void
+mpz_ui_sub (mpz_ptr w, unsigned long int uval, mpz_srcptr v)
+{
+ mp_ptr vp, wp;
+ mp_size_t vn, wn;
+ mp_limb_t cy;
+
+#if BITS_PER_ULONG > GMP_NUMB_BITS /* avoid warnings about shift amount */
+ if (uval > GMP_NUMB_MAX)
+ {
+ mpz_t u;
+ mp_limb_t ul[2];
+ PTR(u) = ul;
+ ul[0] = uval & GMP_NUMB_MASK;
+ ul[1] = uval >> GMP_NUMB_BITS;
+ SIZ(u) = 2;
+ mpz_sub (w, u, v);
+ return;
+ }
+#endif
+
+ vp = PTR(v);
+ vn = SIZ(v);
+
+ wp = PTR(w);
+
+ if (vn > 1)
+ {
+ wp = MPZ_REALLOC (w, vn);
+ vp = PTR(v);
+ mpn_sub_1 (wp, vp, vn, (mp_limb_t) uval);
+ wn = -(vn - (wp[vn - 1] == 0));
+ }
+ else if (vn == 1)
+ {
+ if (uval >= vp[0])
+ {
+ wp[0] = uval - vp[0];
+ wn = wp[0] != 0;
+ }
+ else
+ {
+ wp[0] = vp[0] - uval;
+ wn = -1;
+ }
+ }
+ else if (vn == 0)
+ {
+ wp[0] = uval;
+ wn = uval != 0;
+ }
+ else /* (vn < 0) */
+ {
+ vn = -vn;
+ wp = MPZ_REALLOC (w, vn + 1);
+ vp = PTR(v);
+ cy = mpn_add_1 (wp, vp, vn, (mp_limb_t) uval);
+ wp[vn] = cy;
+ wn = vn + (cy != 0);
+ }
+
+ SIZ(w) = wn;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpz/urandomb.c b/Build/source/libs/gmp/gmp-6.0.0/mpz/urandomb.c
new file mode 100644
index 00000000000..f1295699b3f
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpz/urandomb.c
@@ -0,0 +1,48 @@
+/* mpz_urandomb (rop, state, n) -- Generate a uniform pseudorandom
+ integer in the range 0 to 2^N - 1, inclusive, using STATE as the
+ random state previously initialized by a call to gmp_randinit().
+
+Copyright 1999, 2000, 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/. */
+
+#include "gmp.h"
+#include "gmp-impl.h"
+
+void
+mpz_urandomb (mpz_ptr rop, gmp_randstate_t rstate, mp_bitcnt_t nbits)
+{
+ mp_ptr rp;
+ mp_size_t size;
+
+ size = BITS_TO_LIMBS (nbits);
+ rp = MPZ_NEWALLOC (rop, size);
+
+ _gmp_rand (rp, rstate, nbits);
+ MPN_NORMALIZE (rp, size);
+ SIZ (rop) = size;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpz/urandomm.c b/Build/source/libs/gmp/gmp-6.0.0/mpz/urandomm.c
new file mode 100644
index 00000000000..434359cdd76
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpz/urandomm.c
@@ -0,0 +1,105 @@
+/* mpz_urandomm (rop, state, n) -- Generate a uniform pseudorandom
+ integer in the range 0 to N-1, using STATE as the random state
+ previously initialized by a call to gmp_randinit().
+
+Copyright 2000, 2002, 2012 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.h"
+#include "gmp-impl.h"
+#include "longlong.h" /* for count_leading_zeros */
+
+
+#define MAX_URANDOMM_ITER 80
+
+void
+mpz_urandomm (mpz_ptr rop, gmp_randstate_t rstate, mpz_srcptr n)
+{
+ mp_ptr rp, np, nlast;
+ mp_size_t nbits, size;
+ int count;
+ int pow2;
+ int cmp;
+ TMP_DECL;
+
+ size = ABSIZ (n);
+ if (UNLIKELY (size == 0))
+ DIVIDE_BY_ZERO;
+
+ nlast = &PTR (n)[size - 1];
+
+ /* Detect whether n is a power of 2. */
+ pow2 = POW2_P (*nlast);
+ if (pow2 != 0)
+ for (np = PTR (n); np < nlast; np++)
+ if (*np != 0)
+ {
+ pow2 = 0; /* Mark n as `not a power of two'. */
+ break;
+ }
+
+ count_leading_zeros (count, *nlast);
+ nbits = size * GMP_NUMB_BITS - (count - GMP_NAIL_BITS) - pow2;
+ if (nbits == 0) /* nbits == 0 means that n was == 1. */
+ {
+ SIZ (rop) = 0;
+ return;
+ }
+
+ TMP_MARK;
+ np = PTR (n);
+ if (rop == n)
+ {
+ mp_ptr tp;
+ tp = TMP_ALLOC_LIMBS (size);
+ MPN_COPY (tp, np, size);
+ np = tp;
+ }
+
+ /* Here the allocated size can be one too much if n is a power of
+ (2^GMP_NUMB_BITS) but it's convenient for using mpn_cmp below. */
+ rp = MPZ_REALLOC (rop, size);
+ /* Clear last limb to prevent the case in which size is one too much. */
+ rp[size - 1] = 0;
+
+ count = MAX_URANDOMM_ITER; /* Set iteration count limit. */
+ do
+ {
+ _gmp_rand (rp, rstate, nbits);
+ MPN_CMP (cmp, rp, np, size);
+ }
+ while (cmp >= 0 && --count != 0);
+
+ if (count == 0)
+ /* Too many iterations; return result mod n == result - n */
+ mpn_sub_n (rp, rp, np, size);
+
+ MPN_NORMALIZE (rp, size);
+ SIZ (rop) = size;
+ TMP_FREE;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/mpz/xor.c b/Build/source/libs/gmp/gmp-6.0.0/mpz/xor.c
new file mode 100644
index 00000000000..cd701000d56
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/mpz/xor.c
@@ -0,0 +1,194 @@
+/* mpz_xor -- Logical xor.
+
+Copyright 1991, 1993, 1994, 1996, 1997, 2000, 2001, 2005, 2012 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.h"
+#include "gmp-impl.h"
+
+void
+mpz_xor (mpz_ptr res, mpz_srcptr op1, mpz_srcptr op2)
+{
+ mp_srcptr op1_ptr, op2_ptr;
+ mp_size_t op1_size, op2_size;
+ mp_ptr res_ptr;
+ mp_size_t res_size, res_alloc;
+ TMP_DECL;
+
+ TMP_MARK;
+ op1_size = SIZ(op1);
+ op2_size = SIZ(op2);
+
+ op1_ptr = PTR(op1);
+ op2_ptr = PTR(op2);
+ res_ptr = PTR(res);
+
+ if (op1_size >= 0)
+ {
+ if (op2_size >= 0)
+ {
+ if (op1_size >= op2_size)
+ {
+ if (ALLOC(res) < op1_size)
+ {
+ _mpz_realloc (res, op1_size);
+ /* No overlapping possible: op1_ptr = PTR(op1); */
+ op2_ptr = PTR(op2);
+ res_ptr = PTR(res);
+ }
+
+ if (res_ptr != op1_ptr)
+ MPN_COPY (res_ptr + op2_size, op1_ptr + op2_size,
+ op1_size - op2_size);
+ if (LIKELY (op2_size != 0))
+ mpn_xor_n (res_ptr, op1_ptr, op2_ptr, op2_size);
+ res_size = op1_size;
+ }
+ else
+ {
+ if (ALLOC(res) < op2_size)
+ {
+ _mpz_realloc (res, op2_size);
+ op1_ptr = PTR(op1);
+ /* No overlapping possible: op2_ptr = PTR(op2); */
+ res_ptr = PTR(res);
+ }
+
+ if (res_ptr != op2_ptr)
+ MPN_COPY (res_ptr + op1_size, op2_ptr + op1_size,
+ op2_size - op1_size);
+ if (LIKELY (op1_size != 0))
+ mpn_xor_n (res_ptr, op1_ptr, op2_ptr, op1_size);
+ res_size = op2_size;
+ }
+
+ MPN_NORMALIZE (res_ptr, res_size);
+ SIZ(res) = res_size;
+ return;
+ }
+ else /* op2_size < 0 */
+ {
+ /* Fall through to the code at the end of the function. */
+ }
+ }
+ else
+ {
+ if (op2_size < 0)
+ {
+ mp_ptr opx, opy;
+
+ /* Both operands are negative, the result will be positive.
+ (-OP1) ^ (-OP2) =
+ = ~(OP1 - 1) ^ ~(OP2 - 1) =
+ = (OP1 - 1) ^ (OP2 - 1) */
+
+ op1_size = -op1_size;
+ op2_size = -op2_size;
+
+ /* Possible optimization: Decrease mpn_sub precision,
+ as we won't use the entire res of both. */
+ TMP_ALLOC_LIMBS_2 (opx, op1_size, opy, op2_size);
+ mpn_sub_1 (opx, op1_ptr, op1_size, (mp_limb_t) 1);
+ op1_ptr = opx;
+
+ mpn_sub_1 (opy, op2_ptr, op2_size, (mp_limb_t) 1);
+ op2_ptr = opy;
+
+ if (op1_size > op2_size)
+ MPN_SRCPTR_SWAP (op1_ptr,op1_size, op2_ptr,op2_size);
+
+ res_alloc = op2_size;
+ res_ptr = MPZ_REALLOC (res, res_alloc);
+
+ MPN_COPY (res_ptr + op1_size, op2_ptr + op1_size,
+ op2_size - op1_size);
+ mpn_xor_n (res_ptr, op1_ptr, op2_ptr, op1_size);
+ res_size = op2_size;
+
+ MPN_NORMALIZE (res_ptr, res_size);
+ SIZ(res) = res_size;
+ TMP_FREE;
+ return;
+ }
+ else
+ {
+ /* We should compute -OP1 ^ OP2. Swap OP1 and OP2 and fall
+ through to the code that handles OP1 ^ -OP2. */
+ MPZ_SRCPTR_SWAP (op1, op2);
+ MPN_SRCPTR_SWAP (op1_ptr,op1_size, op2_ptr,op2_size);
+ }
+ }
+
+ {
+ mp_ptr opx;
+ mp_limb_t cy;
+
+ /* Operand 2 negative, so will be the result.
+ -(OP1 ^ (-OP2)) = -(OP1 ^ ~(OP2 - 1)) =
+ = ~(OP1 ^ ~(OP2 - 1)) + 1 =
+ = (OP1 ^ (OP2 - 1)) + 1 */
+
+ op2_size = -op2_size;
+
+ opx = TMP_ALLOC_LIMBS (op2_size);
+ mpn_sub_1 (opx, op2_ptr, op2_size, (mp_limb_t) 1);
+ op2_ptr = opx;
+
+ res_alloc = MAX (op1_size, op2_size) + 1;
+ if (ALLOC(res) < res_alloc)
+ {
+ _mpz_realloc (res, res_alloc);
+ op1_ptr = PTR(op1);
+ /* op2_ptr points to temporary space. */
+ res_ptr = PTR(res);
+ }
+
+ if (op1_size > op2_size)
+ {
+ MPN_COPY (res_ptr + op2_size, op1_ptr + op2_size, op1_size - op2_size);
+ mpn_xor_n (res_ptr, op1_ptr, op2_ptr, op2_size);
+ res_size = op1_size;
+ }
+ else
+ {
+ MPN_COPY (res_ptr + op1_size, op2_ptr + op1_size, op2_size - op1_size);
+ if (LIKELY (op1_size != 0))
+ mpn_xor_n (res_ptr, op1_ptr, op2_ptr, op1_size);
+ res_size = op2_size;
+ }
+
+ cy = mpn_add_1 (res_ptr, res_ptr, res_size, (mp_limb_t) 1);
+ res_ptr[res_size] = cy;
+ res_size += (cy != 0);
+
+ MPN_NORMALIZE (res_ptr, res_size);
+ SIZ(res) = -res_size;
+ TMP_FREE;
+ }
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/nextprime.c b/Build/source/libs/gmp/gmp-6.0.0/nextprime.c
new file mode 100644
index 00000000000..dd9ded58739
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/nextprime.c
@@ -0,0 +1,167 @@
+/* gmp_nextprime -- generate small primes reasonably efficiently for internal
+ GMP needs.
+
+ Contributed to the GNU project by Torbjorn Granlund. Miscellaneous
+ improvements by Martin Boij.
+
+ 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 2009 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/. */
+
+/*
+ Optimisation ideas:
+
+ 1. Unroll the sieving loops. Should reach 1 write/cycle. That would be a 2x
+ improvement.
+
+ 2. Separate sieving with primes p < SIEVESIZE and p >= SIEVESIZE. The latter
+ will need at most one write, and thus not need any inner loop.
+
+ 3. For primes p >= SIEVESIZE, i.e., typically the majority of primes, we
+ perform more than one division per sieving write. That might dominate the
+ entire run time for the nextprime function. A incrementally initialised
+ remainder table of Pi(65536) = 6542 16-bit entries could replace that
+ division.
+*/
+
+#include "gmp.h"
+#include "gmp-impl.h"
+#include <string.h> /* for memset */
+
+
+unsigned long int
+gmp_nextprime (gmp_primesieve_t *ps)
+{
+ unsigned long p, d, pi;
+ unsigned char *sp;
+ static unsigned char addtab[] =
+ { 2,4,2,4,6,2,6,4,2,4,6,6,2,6,4,2,6,4,6,8,4,2,4,2,4,8,6,4,6,2,4,6,2,6,6,4,
+ 2,4,6,2,6,4,2,4,2,10,2,10 };
+ unsigned char *addp = addtab;
+ unsigned long ai;
+
+ /* Look for already sieved primes. A sentinel at the end of the sieving
+ area allows us to use a very simple loop here. */
+ d = ps->d;
+ sp = ps->s + d;
+ while (*sp != 0)
+ sp++;
+ if (sp != ps->s + SIEVESIZE)
+ {
+ d = sp - ps->s;
+ ps->d = d + 1;
+ return ps->s0 + 2 * d;
+ }
+
+ /* Handle the number 2 separately. */
+ if (ps->s0 < 3)
+ {
+ ps->s0 = 3 - 2 * SIEVESIZE; /* Tricky */
+ return 2;
+ }
+
+ /* Exhausted computed primes. Resieve, then call ourselves recursively. */
+
+#if 0
+ for (sp = ps->s; sp < ps->s + SIEVESIZE; sp++)
+ *sp = 0;
+#else
+ memset (ps->s, 0, SIEVESIZE);
+#endif
+
+ ps->s0 += 2 * SIEVESIZE;
+
+ /* Update sqrt_s0 as needed. */
+ while ((ps->sqrt_s0 + 1) * (ps->sqrt_s0 + 1) <= ps->s0 + 2 * SIEVESIZE - 1)
+ ps->sqrt_s0++;
+
+ pi = ((ps->s0 + 3) / 2) % 3;
+ if (pi > 0)
+ pi = 3 - pi;
+ if (ps->s0 + 2 * pi <= 3)
+ pi += 3;
+ sp = ps->s + pi;
+ while (sp < ps->s + SIEVESIZE)
+ {
+ *sp = 1, sp += 3;
+ }
+
+ pi = ((ps->s0 + 5) / 2) % 5;
+ if (pi > 0)
+ pi = 5 - pi;
+ if (ps->s0 + 2 * pi <= 5)
+ pi += 5;
+ sp = ps->s + pi;
+ while (sp < ps->s + SIEVESIZE)
+ {
+ *sp = 1, sp += 5;
+ }
+
+ pi = ((ps->s0 + 7) / 2) % 7;
+ if (pi > 0)
+ pi = 7 - pi;
+ if (ps->s0 + 2 * pi <= 7)
+ pi += 7;
+ sp = ps->s + pi;
+ while (sp < ps->s + SIEVESIZE)
+ {
+ *sp = 1, sp += 7;
+ }
+
+ p = 11;
+ ai = 0;
+ while (p <= ps->sqrt_s0)
+ {
+ pi = ((ps->s0 + p) / 2) % p;
+ if (pi > 0)
+ pi = p - pi;
+ if (ps->s0 + 2 * pi <= p)
+ pi += p;
+ sp = ps->s + pi;
+ while (sp < ps->s + SIEVESIZE)
+ {
+ *sp = 1, sp += p;
+ }
+ p += addp[ai];
+ ai = (ai + 1) % 48;
+ }
+ ps->d = 0;
+ return gmp_nextprime (ps);
+}
+
+void
+gmp_init_primesieve (gmp_primesieve_t *ps)
+{
+ ps->s0 = 0;
+ ps->sqrt_s0 = 0;
+ ps->d = SIEVESIZE;
+ ps->s[SIEVESIZE] = 0; /* sentinel */
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/primesieve.c b/Build/source/libs/gmp/gmp-6.0.0/primesieve.c
new file mode 100644
index 00000000000..569e4cecea9
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/primesieve.c
@@ -0,0 +1,295 @@
+/* primesieve (BIT_ARRAY, N) -- Fills the BIT_ARRAY with a mask for primes up to N.
+
+Contributed to the GNU project by Marco Bodrato.
+
+THE FUNCTION IN THIS FILE IS INTERNAL WITH A MUTABLE INTERFACE.
+IT IS ONLY 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 2010-2012 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.h"
+#include "gmp-impl.h"
+
+/**************************************************************/
+/* Section macros: common macros, for mswing/fac/bin (&sieve) */
+/**************************************************************/
+
+#define LOOP_ON_SIEVE_CONTINUE(prime,end,sieve) \
+ __max_i = (end); \
+ \
+ do { \
+ ++__i; \
+ if (((sieve)[__index] & __mask) == 0) \
+ { \
+ (prime) = id_to_n(__i)
+
+#define LOOP_ON_SIEVE_BEGIN(prime,start,end,off,sieve) \
+ do { \
+ mp_limb_t __mask, __index, __max_i, __i; \
+ \
+ __i = (start)-(off); \
+ __index = __i / GMP_LIMB_BITS; \
+ __mask = CNST_LIMB(1) << (__i % GMP_LIMB_BITS); \
+ __i += (off); \
+ \
+ LOOP_ON_SIEVE_CONTINUE(prime,end,sieve)
+
+#define LOOP_ON_SIEVE_STOP \
+ } \
+ __mask = __mask << 1 | __mask >> (GMP_LIMB_BITS-1); \
+ __index += __mask & 1; \
+ } while (__i <= __max_i) \
+
+#define LOOP_ON_SIEVE_END \
+ LOOP_ON_SIEVE_STOP; \
+ } while (0)
+
+/*********************************************************/
+/* Section sieve: sieving functions and tools for primes */
+/*********************************************************/
+
+#if 0
+static mp_limb_t
+bit_to_n (mp_limb_t bit) { return (bit*3+4)|1; }
+#endif
+
+/* id_to_n (x) = bit_to_n (x-1) = (id*3+1)|1*/
+static mp_limb_t
+id_to_n (mp_limb_t id) { return id*3+1+(id&1); }
+
+/* n_to_bit (n) = ((n-1)&(-CNST_LIMB(2)))/3U-1 */
+static mp_limb_t
+n_to_bit (mp_limb_t n) { return ((n-5)|1)/3U; }
+
+#if 0
+static mp_size_t
+primesieve_size (mp_limb_t n) { return n_to_bit(n) / GMP_LIMB_BITS + 1; }
+#endif
+
+#if GMP_LIMB_BITS > 61
+#define SIEVE_SEED CNST_LIMB(0x3294C9E069128480)
+#define SEED_LIMIT 202
+#else
+#if GMP_LIMB_BITS > 30
+#define SIEVE_SEED CNST_LIMB(0x69128480)
+#define SEED_LIMIT 114
+#else
+#if GMP_LIMB_BITS > 15
+#define SIEVE_SEED CNST_LIMB(0x8480)
+#define SEED_LIMIT 54
+#else
+#if GMP_LIMB_BITS > 7
+#define SIEVE_SEED CNST_LIMB(0x80)
+#define SEED_LIMIT 34
+#else
+#define SIEVE_SEED CNST_LIMB(0x0)
+#define SEED_LIMIT 24
+#endif /* 7 */
+#endif /* 15 */
+#endif /* 30 */
+#endif /* 61 */
+
+static void
+first_block_primesieve (mp_ptr bit_array, mp_limb_t n)
+{
+ mp_size_t bits, limbs;
+
+ ASSERT (n > 4);
+
+ bits = n_to_bit(n);
+ limbs = bits / GMP_LIMB_BITS + 1;
+
+ /* FIXME: We can skip 5 too, filling with a 5-part pattern. */
+ MPN_ZERO (bit_array, limbs);
+ bit_array[0] = SIEVE_SEED;
+
+ if ((bits + 1) % GMP_LIMB_BITS != 0)
+ bit_array[limbs-1] |= MP_LIMB_T_MAX << ((bits + 1) % GMP_LIMB_BITS);
+
+ if (n > SEED_LIMIT) {
+ mp_limb_t mask, index, i;
+
+ ASSERT (n > 49);
+
+ mask = 1;
+ index = 0;
+ i = 1;
+ do {
+ if ((bit_array[index] & mask) == 0)
+ {
+ mp_size_t step, lindex;
+ mp_limb_t lmask;
+ unsigned maskrot;
+
+ step = id_to_n(i);
+/* lindex = n_to_bit(id_to_n(i)*id_to_n(i)); */
+ lindex = i*(step+1)-1+(-(i&1)&(i+1));
+/* lindex = i*(step+1+(i&1))-1+(i&1); */
+ if (lindex > bits)
+ break;
+
+ step <<= 1;
+ maskrot = step % GMP_LIMB_BITS;
+
+ lmask = CNST_LIMB(1) << (lindex % GMP_LIMB_BITS);
+ do {
+ bit_array[lindex / GMP_LIMB_BITS] |= lmask;
+ lmask = lmask << maskrot | lmask >> (GMP_LIMB_BITS - maskrot);
+ lindex += step;
+ } while (lindex <= bits);
+
+/* lindex = n_to_bit(id_to_n(i)*bit_to_n(i)); */
+ lindex = i*(i*3+6)+(i&1);
+
+ lmask = CNST_LIMB(1) << (lindex % GMP_LIMB_BITS);
+ for ( ; lindex <= bits; lindex += step) {
+ bit_array[lindex / GMP_LIMB_BITS] |= lmask;
+ lmask = lmask << maskrot | lmask >> (GMP_LIMB_BITS - maskrot);
+ };
+ }
+ mask = mask << 1 | mask >> (GMP_LIMB_BITS-1);
+ index += mask & 1;
+ i++;
+ } while (1);
+ }
+}
+
+static void
+block_resieve (mp_ptr bit_array, mp_size_t limbs, mp_limb_t offset,
+ mp_srcptr sieve, mp_limb_t sieve_bits)
+{
+ mp_size_t bits, step;
+
+ ASSERT (limbs > 0);
+
+ bits = limbs * GMP_LIMB_BITS - 1;
+
+ /* FIXME: We can skip 5 too, filling with a 5-part pattern. */
+ MPN_ZERO (bit_array, limbs);
+
+ LOOP_ON_SIEVE_BEGIN(step,0,sieve_bits,0,sieve);
+ {
+ mp_size_t lindex;
+ mp_limb_t lmask;
+ unsigned maskrot;
+
+/* lindex = n_to_bit(id_to_n(i)*id_to_n(i)); */
+ lindex = __i*(step+1)-1+(-(__i&1)&(__i+1));
+/* lindex = __i*(step+1+(__i&1))-1+(__i&1); */
+ if (lindex > bits + offset)
+ break;
+
+ step <<= 1;
+ maskrot = step % GMP_LIMB_BITS;
+
+ if (lindex < offset)
+ lindex += step * ((offset - lindex - 1) / step + 1);
+
+ lindex -= offset;
+
+ lmask = CNST_LIMB(1) << (lindex % GMP_LIMB_BITS);
+ for ( ; lindex <= bits; lindex += step) {
+ bit_array[lindex / GMP_LIMB_BITS] |= lmask;
+ lmask = lmask << maskrot | lmask >> (GMP_LIMB_BITS - maskrot);
+ };
+
+/* lindex = n_to_bit(id_to_n(i)*bit_to_n(i)); */
+ lindex = __i*(__i*3+6)+(__i&1);
+ if (lindex > bits + offset)
+ continue;
+
+ if (lindex < offset)
+ lindex += step * ((offset - lindex - 1) / step + 1);
+
+ lindex -= offset;
+
+ lmask = CNST_LIMB(1) << (lindex % GMP_LIMB_BITS);
+ for ( ; lindex <= bits; lindex += step) {
+ bit_array[lindex / GMP_LIMB_BITS] |= lmask;
+ lmask = lmask << maskrot | lmask >> (GMP_LIMB_BITS - maskrot);
+ };
+ }
+ LOOP_ON_SIEVE_END;
+}
+
+#define BLOCK_SIZE 2048
+
+/* Fills bit_array with the characteristic function of composite
+ numbers up to the parameter n. I.e. a bit set to "1" represent a
+ composite, a "0" represent a prime.
+
+ The primesieve_size(n) limbs pointed to by bit_array are
+ overwritten. The returned value counts prime integers in the
+ interval [4, n]. Note that n > 4.
+
+ Even numbers and multiples of 3 are excluded "a priori", only
+ numbers equivalent to +/- 1 mod 6 have their bit in the array.
+
+ Once sieved, if the bit b is ZERO it represent a prime, the
+ represented prime is bit_to_n(b), if the LSbit is bit 0, or
+ id_to_n(b), if you call "1" the first bit.
+ */
+
+mp_limb_t
+gmp_primesieve (mp_ptr bit_array, mp_limb_t n)
+{
+ mp_size_t size;
+ mp_limb_t bits;
+
+ ASSERT (n > 4);
+
+ bits = n_to_bit(n);
+ size = bits / GMP_LIMB_BITS + 1;
+
+ if (size > BLOCK_SIZE * 2) {
+ mp_size_t off;
+ off = BLOCK_SIZE + (size % BLOCK_SIZE);
+ first_block_primesieve (bit_array, id_to_n (off * GMP_LIMB_BITS));
+ for ( ; off < size; off += BLOCK_SIZE)
+ block_resieve (bit_array + off, BLOCK_SIZE, off * GMP_LIMB_BITS, bit_array, off * GMP_LIMB_BITS - 1);
+ } else {
+ first_block_primesieve (bit_array, n);
+ }
+
+ if ((bits + 1) % GMP_LIMB_BITS != 0)
+ bit_array[size-1] |= MP_LIMB_T_MAX << ((bits + 1) % GMP_LIMB_BITS);
+
+
+ return size * GMP_LIMB_BITS - mpn_popcount (bit_array, size);
+}
+
+#undef BLOCK_SIZE
+#undef SEED_LIMIT
+#undef SIEVE_SEED
+#undef LOOP_ON_SIEVE_END
+#undef LOOP_ON_SIEVE_STOP
+#undef LOOP_ON_SIEVE_BEGIN
+#undef LOOP_ON_SIEVE_CONTINUE
diff --git a/Build/source/libs/gmp/gmp-6.0.0/printf/Makefile.am b/Build/source/libs/gmp/gmp-6.0.0/printf/Makefile.am
new file mode 100644
index 00000000000..c8e3c78c6c8
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/printf/Makefile.am
@@ -0,0 +1,41 @@
+## Process this file with automake to generate Makefile.in
+
+# Copyright 2001, 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/.
+
+
+INCLUDES = -D__GMP_WITHIN_GMP -I$(top_srcdir)
+
+noinst_LTLIBRARIES = libprintf.la
+
+libprintf_la_SOURCES = \
+ asprintf.c asprntffuns.c doprnt.c doprntf.c doprnti.c \
+ fprintf.c obprintf.c obvprintf.c obprntffuns.c \
+ printf.c printffuns.c snprintf.c snprntffuns.c sprintf.c sprintffuns.c \
+ vasprintf.c vfprintf.c vprintf.c vsnprintf.c vsprintf.c \
+ repl-vsnprintf.c
diff --git a/Build/source/libs/gmp/gmp-6.0.0/printf/asprintf.c b/Build/source/libs/gmp/gmp-6.0.0/printf/asprintf.c
new file mode 100644
index 00000000000..b35d9b10c82
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/printf/asprintf.c
@@ -0,0 +1,48 @@
+/* gmp_asprintf -- formatted output to an allocated space.
+
+Copyright 2001 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 <stdarg.h>
+
+#include "gmp.h"
+#include "gmp-impl.h"
+
+
+int
+gmp_asprintf (char **result, const char *fmt, ...)
+{
+ va_list ap;
+ int ret;
+
+ va_start (ap, fmt);
+
+ ret = gmp_vasprintf (result, fmt, ap);
+ va_end (ap);
+ return ret;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/printf/asprntffuns.c b/Build/source/libs/gmp/gmp-6.0.0/printf/asprntffuns.c
new file mode 100644
index 00000000000..c141b7a99e0
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/printf/asprntffuns.c
@@ -0,0 +1,72 @@
+/* __gmp_asprintf_memory etc -- formatted output to allocated space.
+
+Copyright 2001, 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/. */
+
+
+/* These routines are in a separate file so that the mpz_t, mpq_t and mpf_t
+ operator<< routines can avoid dragging vsnprintf into the link (via
+ __gmp_asprintf_format). */
+
+#include <stdarg.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "gmp.h"
+#include "gmp-impl.h"
+
+
+int
+__gmp_asprintf_memory (struct gmp_asprintf_t *d, const char *str, size_t len)
+{
+ GMP_ASPRINTF_T_NEED (d, len);
+ memcpy (d->buf + d->size, str, len);
+ d->size += len;
+ return len;
+}
+
+int
+__gmp_asprintf_reps (struct gmp_asprintf_t *d, int c, int reps)
+{
+ GMP_ASPRINTF_T_NEED (d, reps);
+ memset (d->buf + d->size, c, reps);
+ d->size += reps;
+ return reps;
+}
+
+int
+__gmp_asprintf_final (struct gmp_asprintf_t *d)
+{
+ char *buf = d->buf;
+ ASSERT (d->alloc >= d->size + 1);
+ buf[d->size] = '\0';
+ __GMP_REALLOCATE_FUNC_MAYBE_TYPE (buf, d->alloc, d->size+1, char);
+ *d->result = buf;
+ return 0;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/printf/doprnt.c b/Build/source/libs/gmp/gmp-6.0.0/printf/doprnt.c
new file mode 100644
index 00000000000..5220feee206
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/printf/doprnt.c
@@ -0,0 +1,627 @@
+/* __gmp_doprnt -- printf style formatted output.
+
+ 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-2003 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 _GNU_SOURCE /* for DECIMAL_POINT in glibc langinfo.h */
+
+#include "config.h" /* needed for the HAVE_, could also move gmp incls */
+
+#include <stdarg.h>
+#include <ctype.h> /* for isdigit */
+#include <stddef.h> /* for ptrdiff_t */
+#include <string.h>
+#include <stdio.h> /* for NULL */
+#include <stdlib.h>
+
+#if HAVE_INTTYPES_H
+# include <inttypes.h> /* for intmax_t */
+#else
+# if HAVE_STDINT_H
+# include <stdint.h>
+# endif
+#endif
+
+#if HAVE_LANGINFO_H
+#include <langinfo.h> /* for nl_langinfo */
+#endif
+
+#if HAVE_LOCALE_H
+#include <locale.h> /* for localeconv */
+#endif
+
+#if HAVE_SYS_TYPES_H
+#include <sys/types.h> /* for quad_t */
+#endif
+
+#include "gmp.h"
+#include "gmp-impl.h"
+
+
+/* change this to "#define TRACE(x) x" for diagnostics */
+#define TRACE(x)
+
+
+/* Should be portable, but in any case this is only used under some ASSERTs. */
+#define va_equal(x, y) \
+ (memcmp (&(x), &(y), sizeof(va_list)) == 0)
+
+
+/* printf is convenient because it allows various types to be printed in one
+ fairly compact call, so having gmp_printf support the standard types as
+ well as the gmp ones is important. This ends up meaning all the standard
+ parsing must be duplicated, to get a new routine recognising the gmp
+ extras.
+
+ With the currently favoured handling of mpz etc as Z, Q and F type
+ markers, it's not possible to use glibc register_printf_function since
+ that only accepts new conversion characters, not new types. If Z was a
+ conversion there'd be no way to specify hex, decimal or octal, or
+ similarly with F no way to specify fixed point or scientific format.
+
+ It seems wisest to pass conversions %f, %e and %g of float, double and
+ long double over to the standard printf. It'd be hard to be sure of
+ getting the right handling for NaNs, rounding, etc. Integer conversions
+ %d etc and string conversions %s on the other hand could be easily enough
+ handled within gmp_doprnt, but if floats are going to libc then it's just
+ as easy to send all non-gmp types there.
+
+ "Z" was a type marker for size_t in old glibc, but there seems no need to
+ provide access to that now "z" is standard.
+
+ In GMP 4.1.1 we documented "ll" and "L" as being equivalent, but in C99
+ in fact "ll" is just for long long and "L" just for long double.
+ Apparently GLIBC allows "L" for long long though. This doesn't affect
+ us as such, since both are passed through to the C library. To be
+ consistent with what we said before, the two are treated equivalently
+ here, and it's left to the C library to do what it thinks with them.
+
+ Possibilities:
+
+ "b" might be nice for binary output, and could even be supported for the
+ standard C types too if desired.
+
+ POSIX style "%n$" parameter numbering would be possible, but would need
+ to be handled completely within gmp_doprnt, since the numbering will be
+ all different once the format string it cut into pieces.
+
+ Some options for mpq formatting would be good. Perhaps a non-zero
+ precision field could give a width for the denominator and mean always
+ put a "/". A form "n+p/q" might interesting too, though perhaps that's
+ better left to applications.
+
+ Right now there's no way for an application to know whether types like
+ intmax_t are supported here. If configure is doing its job and the same
+ compiler is used for gmp as for the application then there shouldn't be
+ any problem, but perhaps gmp.h should have some preprocessor symbols to
+ say what libgmp can do. */
+
+
+
+/* If a gmp format is the very first thing or there are two gmp formats with
+ nothing in between then we'll reach here with this_fmt == last_fmt and we
+ can do nothing in that case.
+
+ last_ap is always replaced after a FLUSH, so it doesn't matter if va_list
+ is a call-by-reference and the funs->format routine modifies it. */
+
+#define FLUSH() \
+ do { \
+ if (this_fmt == last_fmt) \
+ { \
+ TRACE (printf ("nothing to flush\n")); \
+ ASSERT (va_equal (this_ap, last_ap)); \
+ } \
+ else \
+ { \
+ ASSERT (*this_fmt == '%'); \
+ *this_fmt = '\0'; \
+ TRACE (printf ("flush \"%s\"\n", last_fmt)); \
+ DOPRNT_FORMAT (last_fmt, last_ap); \
+ } \
+ } while (0)
+
+
+/* Parse up the given format string and do the appropriate output using the
+ given "funs" routines. The data parameter is passed through to those
+ routines. */
+
+int
+__gmp_doprnt (const struct doprnt_funs_t *funs, void *data,
+ const char *orig_fmt, va_list orig_ap)
+{
+ va_list ap, this_ap, last_ap;
+ size_t alloc_fmt_size;
+ char *fmt, *alloc_fmt, *last_fmt, *this_fmt, *gmp_str;
+ int retval = 0;
+ int type, fchar, *value, seen_precision;
+ struct doprnt_params_t param;
+
+ TRACE (printf ("gmp_doprnt \"%s\"\n", orig_fmt));
+
+ /* Don't modify orig_ap, if va_list is actually an array and hence call by
+ reference. It could be argued that it'd be more efficient to leave the
+ caller to make a copy if it cared, but doing so here is going to be a
+ very small part of the total work, and we may as well keep applications
+ out of trouble. */
+ va_copy (ap, orig_ap);
+
+ /* The format string is chopped up into pieces to be passed to
+ funs->format. Unfortunately that means it has to be copied so each
+ piece can be null-terminated. We're not going to be very fast here, so
+ use __gmp_allocate_func rather than TMP_ALLOC, to avoid overflowing the
+ stack if a long output string is given. */
+ alloc_fmt_size = strlen (orig_fmt) + 1;
+#if _LONG_LONG_LIMB
+ /* for a long long limb we change %Mx to %llx, so could need an extra 1
+ char for every 3 existing */
+ alloc_fmt_size += alloc_fmt_size / 3;
+#endif
+ alloc_fmt = __GMP_ALLOCATE_FUNC_TYPE (alloc_fmt_size, char);
+ fmt = alloc_fmt;
+ memcpy (fmt, orig_fmt, alloc_fmt_size);
+
+ /* last_fmt and last_ap are just after the last output, and hence where
+ the next output will begin, when that's done */
+ last_fmt = fmt;
+ va_copy (last_ap, ap);
+
+ for (;;)
+ {
+ TRACE (printf ("next: \"%s\"\n", fmt));
+
+ fmt = strchr (fmt, '%');
+ if (fmt == NULL)
+ break;
+
+ /* this_fmt and this_ap are the current '%' sequence being considered */
+ this_fmt = fmt;
+ va_copy (this_ap, ap);
+ fmt++; /* skip the '%' */
+
+ TRACE (printf ("considering\n");
+ printf (" last: \"%s\"\n", last_fmt);
+ printf (" this: \"%s\"\n", this_fmt));
+
+ type = '\0';
+ value = &param.width;
+
+ param.base = 10;
+ param.conv = 0;
+ param.expfmt = "e%c%02ld";
+ param.exptimes4 = 0;
+ param.fill = ' ';
+ param.justify = DOPRNT_JUSTIFY_RIGHT;
+ param.prec = 6;
+ param.showbase = DOPRNT_SHOWBASE_NO;
+ param.showpoint = 0;
+ param.showtrailing = 1;
+ param.sign = '\0';
+ param.width = 0;
+ seen_precision = 0;
+
+ /* This loop parses a single % sequence. "break" from the switch
+ means continue with this %, "goto next" means the conversion
+ character has been seen and a new % should be sought. */
+ for (;;)
+ {
+ fchar = *fmt++;
+ if (fchar == '\0')
+ break;
+
+ switch (fchar) {
+
+ case 'a':
+ /* %a behaves like %e, but defaults to all significant digits,
+ and there's no leading zeros on the exponent (which is in
+ fact bit-based) */
+ param.base = 16;
+ param.expfmt = "p%c%ld";
+ goto conv_a;
+ case 'A':
+ param.base = -16;
+ param.expfmt = "P%c%ld";
+ conv_a:
+ param.conv = DOPRNT_CONV_SCIENTIFIC;
+ param.exptimes4 = 1;
+ if (! seen_precision)
+ param.prec = -1; /* default to all digits */
+ param.showbase = DOPRNT_SHOWBASE_YES;
+ param.showtrailing = 1;
+ goto floating_a;
+
+ case 'c':
+ /* Let's assume wchar_t will be promoted to "int" in the call,
+ the same as char will be. */
+ (void) va_arg (ap, int);
+ goto next;
+
+ case 'd':
+ case 'i':
+ case 'u':
+ integer:
+ TRACE (printf ("integer, base=%d\n", param.base));
+ if (! seen_precision)
+ param.prec = -1;
+ switch (type) {
+ case 'j':
+ /* Let's assume uintmax_t is the same size as intmax_t. */
+#if HAVE_INTMAX_T
+ (void) va_arg (ap, intmax_t);
+#else
+ ASSERT_FAIL (intmax_t not available);
+#endif
+ break;
+ case 'l':
+ (void) va_arg (ap, long);
+ break;
+ case 'L':
+#if HAVE_LONG_LONG
+ (void) va_arg (ap, long long);
+#else
+ ASSERT_FAIL (long long not available);
+#endif
+ break;
+ case 'N':
+ {
+ mp_ptr xp;
+ mp_size_t xsize, abs_xsize;
+ mpz_t z;
+ FLUSH ();
+ xp = va_arg (ap, mp_ptr);
+ PTR(z) = xp;
+ xsize = (int) va_arg (ap, mp_size_t);
+ abs_xsize = ABS (xsize);
+ MPN_NORMALIZE (xp, abs_xsize);
+ SIZ(z) = (xsize >= 0 ? abs_xsize : -abs_xsize);
+ ASSERT_CODE (ALLOC(z) = abs_xsize);
+ gmp_str = mpz_get_str (NULL, param.base, z);
+ goto gmp_integer;
+ }
+ /* break; */
+ case 'q':
+ /* quad_t is probably the same as long long, but let's treat
+ it separately just to be sure. Also let's assume u_quad_t
+ will be the same size as quad_t. */
+#if HAVE_QUAD_T
+ (void) va_arg (ap, quad_t);
+#else
+ ASSERT_FAIL (quad_t not available);
+#endif
+ break;
+ case 'Q':
+ FLUSH ();
+ gmp_str = mpq_get_str (NULL, param.base, va_arg(ap, mpq_srcptr));
+ goto gmp_integer;
+ case 't':
+#if HAVE_PTRDIFF_T
+ (void) va_arg (ap, ptrdiff_t);
+#else
+ ASSERT_FAIL (ptrdiff_t not available);
+#endif
+ break;
+ case 'z':
+ (void) va_arg (ap, size_t);
+ break;
+ case 'Z':
+ {
+ int ret;
+ FLUSH ();
+ gmp_str = mpz_get_str (NULL, param.base,
+ va_arg (ap, mpz_srcptr));
+ gmp_integer:
+ ret = __gmp_doprnt_integer (funs, data, &param, gmp_str);
+ (*__gmp_free_func) (gmp_str, strlen(gmp_str)+1);
+ DOPRNT_ACCUMULATE (ret);
+ va_copy (last_ap, ap);
+ last_fmt = fmt;
+ }
+ break;
+ default:
+ /* default is an "int", and this includes h=short and hh=char
+ since they're promoted to int in a function call */
+ (void) va_arg (ap, int);
+ break;
+ }
+ goto next;
+
+ case 'E':
+ param.base = -10;
+ param.expfmt = "E%c%02ld";
+ /*FALLTHRU*/
+ case 'e':
+ param.conv = DOPRNT_CONV_SCIENTIFIC;
+ floating:
+ if (param.showbase == DOPRNT_SHOWBASE_NONZERO)
+ {
+ /* # in %e, %f and %g */
+ param.showpoint = 1;
+ param.showtrailing = 1;
+ }
+ floating_a:
+ switch (type) {
+ case 'F':
+ FLUSH ();
+ DOPRNT_ACCUMULATE (__gmp_doprnt_mpf (funs, data, &param,
+ GMP_DECIMAL_POINT,
+ va_arg (ap, mpf_srcptr)));
+ va_copy (last_ap, ap);
+ last_fmt = fmt;
+ break;
+ case 'L':
+#if HAVE_LONG_DOUBLE
+ (void) va_arg (ap, long double);
+#else
+ ASSERT_FAIL (long double not available);
+#endif
+ break;
+ default:
+ (void) va_arg (ap, double);
+ break;
+ }
+ goto next;
+
+ case 'f':
+ param.conv = DOPRNT_CONV_FIXED;
+ goto floating;
+
+ case 'F': /* mpf_t */
+ case 'j': /* intmax_t */
+ case 'L': /* long long */
+ case 'N': /* mpn */
+ case 'q': /* quad_t */
+ case 'Q': /* mpq_t */
+ case 't': /* ptrdiff_t */
+ case 'z': /* size_t */
+ case 'Z': /* mpz_t */
+ set_type:
+ type = fchar;
+ break;
+
+ case 'G':
+ param.base = -10;
+ param.expfmt = "E%c%02ld";
+ /*FALLTHRU*/
+ case 'g':
+ param.conv = DOPRNT_CONV_GENERAL;
+ param.showtrailing = 0;
+ goto floating;
+
+ case 'h':
+ if (type != 'h')
+ goto set_type;
+ type = 'H'; /* internal code for "hh" */
+ break;
+
+ case 'l':
+ if (type != 'l')
+ goto set_type;
+ type = 'L'; /* "ll" means "L" */
+ break;
+
+ case 'm':
+ /* glibc strerror(errno), no argument */
+ goto next;
+
+ case 'M': /* mp_limb_t */
+ /* mung format string to l or ll and let plain printf handle it */
+#if _LONG_LONG_LIMB
+ memmove (fmt+1, fmt, strlen (fmt)+1);
+ fmt[-1] = 'l';
+ fmt[0] = 'l';
+ fmt++;
+ type = 'L';
+#else
+ fmt[-1] = 'l';
+ type = 'l';
+#endif
+ break;
+
+ case 'n':
+ {
+ void *p;
+ FLUSH ();
+ p = va_arg (ap, void *);
+ switch (type) {
+ case '\0': * (int *) p = retval; break;
+ case 'F': mpf_set_si ((mpf_ptr) p, (long) retval); break;
+ case 'H': * (char *) p = retval; break;
+ case 'h': * (short *) p = retval; break;
+#if HAVE_INTMAX_T
+ case 'j': * (intmax_t *) p = retval; break;
+#else
+ case 'j': ASSERT_FAIL (intmax_t not available); break;
+#endif
+ case 'l': * (long *) p = retval; break;
+#if HAVE_QUAD_T && HAVE_LONG_LONG
+ case 'q':
+ ASSERT_ALWAYS (sizeof (quad_t) == sizeof (long long));
+ /*FALLTHRU*/
+#else
+ case 'q': ASSERT_FAIL (quad_t not available); break;
+#endif
+#if HAVE_LONG_LONG
+ case 'L': * (long long *) p = retval; break;
+#else
+ case 'L': ASSERT_FAIL (long long not available); break;
+#endif
+ case 'N':
+ {
+ mp_size_t n;
+ n = va_arg (ap, mp_size_t);
+ n = ABS (n);
+ if (n != 0)
+ {
+ * (mp_ptr) p = retval;
+ MPN_ZERO ((mp_ptr) p + 1, n - 1);
+ }
+ }
+ break;
+ case 'Q': mpq_set_si ((mpq_ptr) p, (long) retval, 1L); break;
+#if HAVE_PTRDIFF_T
+ case 't': * (ptrdiff_t *) p = retval; break;
+#else
+ case 't': ASSERT_FAIL (ptrdiff_t not available); break;
+#endif
+ case 'z': * (size_t *) p = retval; break;
+ case 'Z': mpz_set_si ((mpz_ptr) p, (long) retval); break;
+ }
+ }
+ va_copy (last_ap, ap);
+ last_fmt = fmt;
+ goto next;
+
+ case 'o':
+ param.base = 8;
+ goto integer;
+
+ case 'p':
+ case 's':
+ /* "void *" will be good enough for "char *" or "wchar_t *", no
+ need for separate code. */
+ (void) va_arg (ap, const void *);
+ goto next;
+
+ case 'x':
+ param.base = 16;
+ goto integer;
+ case 'X':
+ param.base = -16;
+ goto integer;
+
+ case '%':
+ goto next;
+
+ case '#':
+ param.showbase = DOPRNT_SHOWBASE_NONZERO;
+ break;
+
+ case '\'':
+ /* glibc digit grouping, just pass it through, no support for it
+ on gmp types */
+ break;
+
+ case '+':
+ case ' ':
+ param.sign = fchar;
+ break;
+
+ case '-':
+ param.justify = DOPRNT_JUSTIFY_LEFT;
+ break;
+ case '.':
+ seen_precision = 1;
+ param.prec = -1; /* "." alone means all necessary digits */
+ value = &param.prec;
+ break;
+
+ case '*':
+ {
+ int n = va_arg (ap, int);
+
+ if (value == &param.width)
+ {
+ /* negative width means left justify */
+ if (n < 0)
+ {
+ param.justify = DOPRNT_JUSTIFY_LEFT;
+ n = -n;
+ }
+ param.width = n;
+ }
+ else
+ {
+ /* don't allow negative precision */
+ param.prec = MAX (0, n);
+ }
+ }
+ break;
+
+ case '0':
+ if (value == &param.width)
+ {
+ /* in width field, set fill */
+ param.fill = '0';
+
+ /* for right justify, put the fill after any minus sign */
+ if (param.justify == DOPRNT_JUSTIFY_RIGHT)
+ param.justify = DOPRNT_JUSTIFY_INTERNAL;
+ }
+ else
+ {
+ /* in precision field, set value */
+ *value = 0;
+ }
+ break;
+
+ case '1': case '2': case '3': case '4': case '5':
+ case '6': case '7': case '8': case '9':
+ /* process all digits to form a value */
+ {
+ int n = 0;
+ do {
+ n = n * 10 + (fchar-'0');
+ fchar = *fmt++;
+ } while (isascii (fchar) && isdigit (fchar));
+ fmt--; /* unget the non-digit */
+ *value = n;
+ }
+ break;
+
+ default:
+ /* something invalid */
+ ASSERT (0);
+ goto next;
+ }
+ }
+
+ next:
+ /* Stop parsing the current "%" format, look for a new one. */
+ ;
+ }
+
+ TRACE (printf ("remainder: \"%s\"\n", last_fmt));
+ if (*last_fmt != '\0')
+ DOPRNT_FORMAT (last_fmt, last_ap);
+
+ if (funs->final != NULL)
+ if ((*funs->final) (data) == -1)
+ goto error;
+
+ done:
+ (*__gmp_free_func) (alloc_fmt, alloc_fmt_size);
+ return retval;
+
+ error:
+ retval = -1;
+ goto done;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/printf/doprntf.c b/Build/source/libs/gmp/gmp-6.0.0/printf/doprntf.c
new file mode 100644
index 00000000000..c501e8d06b2
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/printf/doprntf.c
@@ -0,0 +1,390 @@
+/* __gmp_doprnt_mpf -- mpf formatted output.
+
+ 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, 2011 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 <stdarg.h> /* for va_list and hence doprnt_funs_t */
+#include <ctype.h>
+#include <string.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+#include "gmp.h"
+#include "gmp-impl.h"
+#include "longlong.h"
+
+
+/* change this to "#define TRACE(x) x" for diagnostics */
+#define TRACE(x)
+
+
+/* The separate of __gmp_doprnt_float_digits and __gmp_doprnt_float is so
+ some C++ can do the mpf_get_str and release it in case of an exception */
+
+#define DIGIT_VALUE(c) \
+ (isdigit (c) ? (c) - '0' \
+ : islower (c) ? (c) - 'a' + 10 \
+ : (c) - 'A' + 10)
+
+int
+__gmp_doprnt_mpf (const struct doprnt_funs_t *funs,
+ void *data,
+ const struct doprnt_params_t *p,
+ const char *point,
+ mpf_srcptr f)
+{
+ int prec, ndigits, free_size, len, newlen, justify, justlen, explen;
+ int showbaselen, sign, signlen, intlen, intzeros, pointlen;
+ int fraczeros, fraclen, preczeros;
+ char *s, *free_ptr;
+ mp_exp_t exp;
+ char exponent[GMP_LIMB_BITS + 10];
+ const char *showbase;
+ int retval = 0;
+
+ TRACE (printf ("__gmp_doprnt_float\n");
+ printf (" conv=%d prec=%d\n", p->conv, p->prec));
+
+ prec = p->prec;
+ if (prec <= -1)
+ {
+ /* all digits */
+ ndigits = 0;
+
+ /* arrange the fixed/scientific decision on a "prec" implied by how
+ many significant digits there are */
+ if (p->conv == DOPRNT_CONV_GENERAL)
+ MPF_SIGNIFICANT_DIGITS (prec, PREC(f), ABS(p->base));
+ }
+ else
+ {
+ switch (p->conv) {
+ case DOPRNT_CONV_FIXED:
+ /* Precision is digits after the radix point. Try not to generate
+ too many more than will actually be required. If f>=1 then
+ overestimate the integer part, and add prec. If f<1 then
+ underestimate the zeros between the radix point and the first
+ digit and subtract that from prec. In either case add 2 so the
+ round to nearest can be applied accurately. Finally, we add 1 to
+ handle the case of 1-eps where EXP(f) = 0 but mpf_get_str returns
+ exp as 1. */
+ ndigits = prec + 2 + 1
+ + EXP(f) * (mp_bases[ABS(p->base)].chars_per_limb + (EXP(f)>=0));
+ ndigits = MAX (ndigits, 1);
+ break;
+
+ case DOPRNT_CONV_SCIENTIFIC:
+ /* precision is digits after the radix point, and there's one digit
+ before */
+ ndigits = prec + 1;
+ break;
+
+ default:
+ ASSERT (0);
+ /*FALLTHRU*/
+
+ case DOPRNT_CONV_GENERAL:
+ /* precision is total digits, but be sure to ask mpf_get_str for at
+ least 1, not 0 */
+ ndigits = MAX (prec, 1);
+ break;
+ }
+ }
+ TRACE (printf (" ndigits %d\n", ndigits));
+
+ s = mpf_get_str (NULL, &exp, p->base, ndigits, f);
+ len = strlen (s);
+ free_ptr = s;
+ free_size = len + 1;
+ TRACE (printf (" s %s\n", s);
+ printf (" exp %ld\n", exp);
+ printf (" len %d\n", len));
+
+ /* For fixed mode check the ndigits formed above was in fact enough for
+ the integer part plus p->prec after the radix point. */
+ ASSERT ((p->conv == DOPRNT_CONV_FIXED && p->prec > -1)
+ ? ndigits >= MAX (1, exp + p->prec + 2) : 1);
+
+ sign = p->sign;
+ if (s[0] == '-')
+ {
+ sign = s[0];
+ s++, len--;
+ }
+ signlen = (sign != '\0');
+ TRACE (printf (" sign %c signlen %d\n", sign, signlen));
+
+ switch (p->conv) {
+ case DOPRNT_CONV_FIXED:
+ if (prec <= -1)
+ prec = MAX (0, len-exp); /* retain all digits */
+
+ /* Truncate if necessary so fraction will be at most prec digits. */
+ ASSERT (prec >= 0);
+ newlen = exp + prec;
+ if (newlen < 0)
+ {
+ /* first non-zero digit is below target prec, and at least one zero
+ digit in between, so print zero */
+ len = 0;
+ exp = 0;
+ }
+ else if (len <= newlen)
+ {
+ /* already got few enough digits */
+ }
+ else
+ {
+ /* discard excess digits and round to nearest */
+
+ const char *num_to_text = (p->base >= 0
+ ? "0123456789abcdefghijklmnopqrstuvwxyz"
+ : "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ");
+ int base = ABS(p->base);
+ int n;
+
+ ASSERT (base <= 36);
+
+ len = newlen;
+ n = DIGIT_VALUE (s[len]);
+ TRACE (printf (" rounding with %d\n", n));
+ if (n >= (base + 1) / 2)
+ {
+ /* propagate a carry */
+ for (;;)
+ {
+ if (len == 0)
+ {
+ s[0] = '1';
+ len = 1;
+ exp++;
+ break;
+ }
+ n = DIGIT_VALUE (s[len-1]);
+ ASSERT (n >= 0 && n < base);
+ n++;
+ if (n != base)
+ {
+ TRACE (printf (" storing now %d\n", n));
+ s[len-1] = num_to_text[n];
+ break;
+ }
+ len--;
+ }
+ }
+ else
+ {
+ /* truncate only, strip any trailing zeros now exposed */
+ while (len > 0 && s[len-1] == '0')
+ len--;
+ }
+
+ /* Can have newlen==0, in which case the truncate was just to check
+ for a carry turning it into "1". If we're left with len==0 then
+ adjust exp to match. */
+ if (len == 0)
+ exp = 0;
+ }
+
+ fixed:
+ ASSERT (len == 0 ? exp == 0 : 1);
+ if (exp <= 0)
+ {
+ TRACE (printf (" fixed 0.000sss\n"));
+ intlen = 0;
+ intzeros = 1;
+ fraczeros = -exp;
+ fraclen = len;
+ }
+ else
+ {
+ TRACE (printf (" fixed sss.sss or sss000\n"));
+ intlen = MIN (len, exp);
+ intzeros = exp - intlen;
+ fraczeros = 0;
+ fraclen = len - intlen;
+ }
+ explen = 0;
+ break;
+
+ case DOPRNT_CONV_SCIENTIFIC:
+ {
+ long int expval;
+ char expsign;
+
+ if (prec <= -1)
+ prec = MAX (0, len-1); /* retain all digits */
+
+ scientific:
+ TRACE (printf (" scientific s.sss\n"));
+
+ intlen = MIN (1, len);
+ intzeros = (intlen == 0 ? 1 : 0);
+ fraczeros = 0;
+ fraclen = len - intlen;
+
+ expval = (exp-intlen);
+ if (p->exptimes4)
+ expval <<= 2;
+
+ /* Split out the sign since %o or %x in expfmt give negatives as twos
+ complement, not with a sign. */
+ expsign = (expval >= 0 ? '+' : '-');
+ expval = ABS (expval);
+
+#if HAVE_VSNPRINTF
+ explen = snprintf (exponent, sizeof(exponent),
+ p->expfmt, expsign, expval);
+ /* test for < sizeof-1 since a glibc 2.0.x return of sizeof-1 might
+ mean truncation */
+ ASSERT (explen >= 0 && explen < sizeof(exponent)-1);
+#else
+ sprintf (exponent, p->expfmt, expsign, expval);
+ explen = strlen (exponent);
+ ASSERT (explen < sizeof(exponent));
+#endif
+ TRACE (printf (" expfmt %s gives %s\n", p->expfmt, exponent));
+ }
+ break;
+
+ default:
+ ASSERT (0);
+ /*FALLTHRU*/ /* to stop variables looking uninitialized */
+
+ case DOPRNT_CONV_GENERAL:
+ /* The exponent for "scientific" will be exp-1, choose scientific if
+ this is < -4 or >= prec (and minimum 1 for prec). For f==0 will have
+ exp==0 and get the desired "fixed". This rule follows glibc. For
+ fixed there's no need to truncate, the desired ndigits will already
+ be as required. */
+ if (exp-1 < -4 || exp-1 >= MAX (1, prec))
+ goto scientific;
+ else
+ goto fixed;
+ }
+
+ TRACE (printf (" intlen %d intzeros %d fraczeros %d fraclen %d\n",
+ intlen, intzeros, fraczeros, fraclen));
+ ASSERT (p->prec <= -1
+ ? intlen + fraclen == strlen (s)
+ : intlen + fraclen <= strlen (s));
+
+ if (p->showtrailing)
+ {
+ /* Pad to requested precision with trailing zeros, for general this is
+ all digits, for fixed and scientific just the fraction. */
+ preczeros = prec - (fraczeros + fraclen
+ + (p->conv == DOPRNT_CONV_GENERAL
+ ? intlen + intzeros : 0));
+ preczeros = MAX (0, preczeros);
+ }
+ else
+ preczeros = 0;
+ TRACE (printf (" prec=%d showtrailing=%d, pad with preczeros %d\n",
+ prec, p->showtrailing, preczeros));
+
+ /* radix point if needed, or if forced */
+ pointlen = ((fraczeros + fraclen + preczeros) != 0 || p->showpoint != 0)
+ ? strlen (point) : 0;
+ TRACE (printf (" point |%s| pointlen %d\n", point, pointlen));
+
+ /* Notice the test for a non-zero value is done after any truncation for
+ DOPRNT_CONV_FIXED. */
+ showbase = NULL;
+ showbaselen = 0;
+ switch (p->showbase) {
+ default:
+ ASSERT (0);
+ /*FALLTHRU*/
+ case DOPRNT_SHOWBASE_NO:
+ break;
+ case DOPRNT_SHOWBASE_NONZERO:
+ if (intlen == 0 && fraclen == 0)
+ break;
+ /*FALLTHRU*/
+ case DOPRNT_SHOWBASE_YES:
+ switch (p->base) {
+ case 16: showbase = "0x"; showbaselen = 2; break;
+ case -16: showbase = "0X"; showbaselen = 2; break;
+ case 8: showbase = "0"; showbaselen = 1; break;
+ }
+ break;
+ }
+ TRACE (printf (" showbase %s showbaselen %d\n",
+ showbase == NULL ? "" : showbase, showbaselen));
+
+ /* left over field width */
+ justlen = p->width - (signlen + showbaselen + intlen + intzeros + pointlen
+ + fraczeros + fraclen + preczeros + explen);
+ TRACE (printf (" justlen %d fill 0x%X\n", justlen, p->fill));
+
+ justify = p->justify;
+ if (justlen <= 0) /* no justifying if exceed width */
+ justify = DOPRNT_JUSTIFY_NONE;
+
+ TRACE (printf (" justify type %d intlen %d pointlen %d fraclen %d\n",
+ justify, intlen, pointlen, fraclen));
+
+ if (justify == DOPRNT_JUSTIFY_RIGHT) /* pad for right */
+ DOPRNT_REPS (p->fill, justlen);
+
+ if (signlen) /* sign */
+ DOPRNT_REPS (sign, 1);
+
+ DOPRNT_MEMORY_MAYBE (showbase, showbaselen); /* base */
+
+ if (justify == DOPRNT_JUSTIFY_INTERNAL) /* pad for internal */
+ DOPRNT_REPS (p->fill, justlen);
+
+ DOPRNT_MEMORY (s, intlen); /* integer */
+ DOPRNT_REPS_MAYBE ('0', intzeros);
+
+ DOPRNT_MEMORY_MAYBE (point, pointlen); /* point */
+
+ DOPRNT_REPS_MAYBE ('0', fraczeros); /* frac */
+ DOPRNT_MEMORY_MAYBE (s+intlen, fraclen);
+
+ DOPRNT_REPS_MAYBE ('0', preczeros); /* prec */
+
+ DOPRNT_MEMORY_MAYBE (exponent, explen); /* exp */
+
+ if (justify == DOPRNT_JUSTIFY_LEFT) /* pad for left */
+ DOPRNT_REPS (p->fill, justlen);
+
+ done:
+ (*__gmp_free_func) (free_ptr, free_size);
+ return retval;
+
+ error:
+ retval = -1;
+ goto done;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/printf/doprnti.c b/Build/source/libs/gmp/gmp-6.0.0/printf/doprnti.c
new file mode 100644
index 00000000000..c4cb9c8da8d
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/printf/doprnti.c
@@ -0,0 +1,137 @@
+/* __gmp_doprnt_integer -- integer style formatted output.
+
+ 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 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 <stdarg.h> /* for va_list and hence doprnt_funs_t */
+#include <string.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+#include "gmp.h"
+#include "gmp-impl.h"
+
+
+int
+__gmp_doprnt_integer (const struct doprnt_funs_t *funs,
+ void *data,
+ const struct doprnt_params_t *p,
+ const char *s)
+{
+ int retval = 0;
+ int slen, justlen, showbaselen, sign, signlen, slashlen, zeros;
+ int justify, den_showbaselen;
+ const char *slash, *showbase;
+
+ /* '+' or ' ' if wanted, and don't already have '-' */
+ sign = p->sign;
+ if (s[0] == '-')
+ {
+ sign = s[0];
+ s++;
+ }
+ signlen = (sign != '\0');
+
+ /* if the precision was explicitly 0, print nothing for a 0 value */
+ if (*s == '0' && p->prec == 0)
+ s++;
+
+ slen = strlen (s);
+ slash = strchr (s, '/');
+
+ showbase = NULL;
+ showbaselen = 0;
+
+ if (p->showbase != DOPRNT_SHOWBASE_NO)
+ {
+ switch (p->base) {
+ case 16: showbase = "0x"; showbaselen = 2; break;
+ case -16: showbase = "0X"; showbaselen = 2; break;
+ case 8: showbase = "0"; showbaselen = 1; break;
+ }
+ }
+
+ den_showbaselen = showbaselen;
+ if (slash == NULL
+ || (p->showbase == DOPRNT_SHOWBASE_NONZERO && slash[1] == '0'))
+ den_showbaselen = 0;
+
+ if (p->showbase == DOPRNT_SHOWBASE_NONZERO && s[0] == '0')
+ showbaselen = 0;
+
+ /* the influence of p->prec on mpq is currently undefined */
+ zeros = MAX (0, p->prec - slen);
+
+ /* space left over after actual output length */
+ justlen = p->width
+ - (strlen(s) + signlen + showbaselen + den_showbaselen + zeros);
+
+ justify = p->justify;
+ if (justlen <= 0) /* no justifying if exceed width */
+ justify = DOPRNT_JUSTIFY_NONE;
+
+ if (justify == DOPRNT_JUSTIFY_RIGHT) /* pad right */
+ DOPRNT_REPS (p->fill, justlen);
+
+ DOPRNT_REPS_MAYBE (sign, signlen); /* sign */
+
+ DOPRNT_MEMORY_MAYBE (showbase, showbaselen); /* base */
+
+ DOPRNT_REPS_MAYBE ('0', zeros); /* zeros */
+
+ if (justify == DOPRNT_JUSTIFY_INTERNAL) /* pad internal */
+ DOPRNT_REPS (p->fill, justlen);
+
+ /* if there's a showbase on the denominator, then print the numerator
+ separately so it can be inserted */
+ if (den_showbaselen != 0)
+ {
+ ASSERT (slash != NULL);
+ slashlen = slash+1 - s;
+ DOPRNT_MEMORY (s, slashlen); /* numerator and slash */
+ slen -= slashlen;
+ s += slashlen;
+ DOPRNT_MEMORY (showbase, den_showbaselen);
+ }
+
+ DOPRNT_MEMORY (s, slen); /* number, or denominator */
+
+ if (justify == DOPRNT_JUSTIFY_LEFT) /* pad left */
+ DOPRNT_REPS (p->fill, justlen);
+
+ done:
+ return retval;
+
+ error:
+ retval = -1;
+ goto done;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/printf/fprintf.c b/Build/source/libs/gmp/gmp-6.0.0/printf/fprintf.c
new file mode 100644
index 00000000000..2d8187d7cfc
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/printf/fprintf.c
@@ -0,0 +1,49 @@
+/* gmp_fprintf -- formatted output.
+
+Copyright 2001 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 <stdarg.h>
+#include <stdio.h>
+
+#include "gmp.h"
+#include "gmp-impl.h"
+
+
+int
+gmp_fprintf (FILE *fp, const char *fmt, ...)
+{
+ va_list ap;
+ int ret;
+
+ va_start (ap, fmt);
+
+ ret = __gmp_doprnt (&__gmp_fprintf_funs, fp, fmt, ap);
+ va_end (ap);
+ return ret;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/printf/obprintf.c b/Build/source/libs/gmp/gmp-6.0.0/printf/obprintf.c
new file mode 100644
index 00000000000..fbf3ea768f7
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/printf/obprintf.c
@@ -0,0 +1,59 @@
+/* gmp_obstack_printf -- formatted output to an obstack.
+
+Copyright 2001, 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/. */
+
+#include "config.h"
+
+#if HAVE_OBSTACK_VPRINTF
+
+#include <stdarg.h>
+#include <obstack.h>
+#include <string.h>
+
+#include "gmp.h"
+#include "gmp-impl.h"
+
+
+int
+gmp_obstack_printf (struct obstack *ob, const char *fmt, ...)
+{
+ va_list ap;
+ int ret;
+
+ va_start (ap, fmt);
+
+ ASSERT (! MEM_OVERLAP_P (obstack_base(ob), obstack_object_size(ob),
+ fmt, strlen(fmt)+1));
+
+ ret = __gmp_doprnt (&__gmp_obstack_printf_funs, ob, fmt, ap);
+ va_end (ap);
+ return ret;
+}
+
+#endif /* HAVE_OBSTACK_VPRINTF */
diff --git a/Build/source/libs/gmp/gmp-6.0.0/printf/obprntffuns.c b/Build/source/libs/gmp/gmp-6.0.0/printf/obprntffuns.c
new file mode 100644
index 00000000000..4cd1a91dec5
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/printf/obprntffuns.c
@@ -0,0 +1,72 @@
+/* __gmp_obstack_printf_funs -- support for gmp_obstack_printf and
+ gmp_obstack_vprintf.
+
+ 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 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 "config.h"
+
+#if HAVE_OBSTACK_VPRINTF
+
+#define _GNU_SOURCE /* ask glibc <stdio.h> for obstack_vprintf */
+
+#include <stdarg.h>
+#include <stdio.h> /* for obstack_vprintf */
+#include <string.h>
+#include <obstack.h>
+
+#include "gmp.h"
+#include "gmp-impl.h"
+
+
+static int
+gmp_obstack_memory (struct obstack *ob, const char *ptr, size_t len)
+{
+ obstack_grow (ob, ptr, len);
+ return len;
+}
+
+static int
+gmp_obstack_reps (struct obstack *ob, int c, int reps)
+{
+ obstack_blank (ob, reps);
+ memset ((char *) obstack_next_free(ob) - reps, c, reps);
+ return reps;
+}
+
+const struct doprnt_funs_t __gmp_obstack_printf_funs = {
+ (doprnt_format_t) obstack_vprintf,
+ (doprnt_memory_t) gmp_obstack_memory,
+ (doprnt_reps_t) gmp_obstack_reps
+};
+
+#endif /* HAVE_OBSTACK_VPRINTF */
diff --git a/Build/source/libs/gmp/gmp-6.0.0/printf/obvprintf.c b/Build/source/libs/gmp/gmp-6.0.0/printf/obvprintf.c
new file mode 100644
index 00000000000..31eddbdf2a6
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/printf/obvprintf.c
@@ -0,0 +1,52 @@
+/* gmp_obstack_vprintf -- formatted output to an obstack.
+
+Copyright 2001, 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/. */
+
+#include "config.h"
+
+#if HAVE_OBSTACK_VPRINTF
+
+#include <stdarg.h>
+#include <obstack.h>
+#include <string.h>
+
+#include "gmp.h"
+#include "gmp-impl.h"
+
+
+int
+gmp_obstack_vprintf (struct obstack *ob, const char *fmt, va_list ap)
+{
+ ASSERT (! MEM_OVERLAP_P (obstack_base(ob), obstack_object_size(ob),
+ fmt, strlen(fmt)+1));
+
+ return __gmp_doprnt (&__gmp_obstack_printf_funs, ob, fmt, ap);
+}
+
+#endif /* HAVE_OBSTACK_VPRINTF */
diff --git a/Build/source/libs/gmp/gmp-6.0.0/printf/printf.c b/Build/source/libs/gmp/gmp-6.0.0/printf/printf.c
new file mode 100644
index 00000000000..7ac7b62faea
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/printf/printf.c
@@ -0,0 +1,49 @@
+/* gmp_printf -- formatted output.
+
+Copyright 2001 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 <stdarg.h>
+#include <stdio.h>
+
+#include "gmp.h"
+#include "gmp-impl.h"
+
+
+int
+gmp_printf (const char *fmt, ...)
+{
+ va_list ap;
+ int ret;
+
+ va_start (ap, fmt);
+
+ ret = __gmp_doprnt (&__gmp_fprintf_funs, stdout, fmt, ap);
+ va_end (ap);
+ return ret;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/printf/printffuns.c b/Build/source/libs/gmp/gmp-6.0.0/printf/printffuns.c
new file mode 100644
index 00000000000..058c6b9d8bc
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/printf/printffuns.c
@@ -0,0 +1,80 @@
+/* __gmp_fprintf_funs -- support for formatted output to FILEs.
+
+ 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 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 <stdarg.h>
+#include <stdio.h>
+#include <string.h>
+
+#include "gmp.h"
+#include "gmp-impl.h"
+
+/* SunOS 4 stdio.h doesn't provide a prototype for this */
+#if ! HAVE_DECL_VFPRINTF
+int vfprintf (FILE *, const char *, va_list);
+#endif
+
+
+static int
+gmp_fprintf_memory (FILE *fp, const char *str, size_t len)
+{
+ return fwrite (str, 1, len, fp);
+}
+
+/* glibc putc is a function, at least when it's in multi-threaded mode or
+ some such, so fwrite chunks instead of making many calls. */
+static int
+gmp_fprintf_reps (FILE *fp, int c, int reps)
+{
+ char buf[256];
+ int i, piece, ret;
+ ASSERT (reps >= 0);
+
+ memset (buf, c, MIN (reps, sizeof (buf)));
+ for (i = reps; i > 0; i -= sizeof (buf))
+ {
+ piece = MIN (i, sizeof (buf));
+ ret = fwrite (buf, 1, piece, fp);
+ if (ret == -1)
+ return ret;
+ ASSERT (ret == piece);
+ }
+
+ return reps;
+}
+
+const struct doprnt_funs_t __gmp_fprintf_funs = {
+ (doprnt_format_t) vfprintf,
+ (doprnt_memory_t) gmp_fprintf_memory,
+ (doprnt_reps_t) gmp_fprintf_reps,
+};
diff --git a/Build/source/libs/gmp/gmp-6.0.0/printf/repl-vsnprintf.c b/Build/source/libs/gmp/gmp-6.0.0/printf/repl-vsnprintf.c
new file mode 100644
index 00000000000..a95003baa62
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/printf/repl-vsnprintf.c
@@ -0,0 +1,396 @@
+/* __gmp_replacement_vsnprintf -- for systems which don't have vsnprintf, or
+ only have a broken one.
+
+ 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 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 "config.h"
+
+#if ! HAVE_VSNPRINTF /* only need this file if we don't have vsnprintf */
+
+
+#define _GNU_SOURCE /* for strnlen prototype */
+
+#include <stdarg.h>
+#include <ctype.h> /* for isdigit */
+#include <stddef.h> /* for ptrdiff_t */
+#include <string.h>
+#include <stdio.h> /* for NULL */
+#include <stdlib.h>
+
+#if HAVE_FLOAT_H
+#include <float.h> /* for DBL_MAX_10_EXP etc */
+#endif
+
+#if HAVE_INTTYPES_H
+# include <inttypes.h> /* for intmax_t */
+#else
+# if HAVE_STDINT_H
+# include <stdint.h>
+# endif
+#endif
+
+#if HAVE_SYS_TYPES_H
+#include <sys/types.h> /* for quad_t */
+#endif
+
+#include "gmp.h"
+#include "gmp-impl.h"
+
+
+/* Autoconf notes that AIX 4.3 has a broken strnlen, but fortunately it
+ doesn't affect us since __gmp_replacement_vsnprintf is not required on
+ that system. */
+#if ! HAVE_STRNLEN
+static size_t
+strnlen (const char *s, size_t n)
+{
+ size_t i;
+ for (i = 0; i < n; i++)
+ if (s[i] == '\0')
+ break;
+ return i;
+}
+#endif
+
+
+/* The approach here is to parse the fmt string, and decide how much space
+ it requires, then use vsprintf into a big enough buffer. The space
+ calculated isn't an exact amount, but it's certainly no less than
+ required.
+
+ This code was inspired by GNU libiberty/vasprintf.c but we support more
+ datatypes, when available.
+
+ mingw32 - doesn't have vsnprintf, it seems. Because gcc is used a full
+ set of types are available, but "long double" is just a plain IEEE
+ 64-bit "double" and LDBL_MAX_EXP_10 is correspondingly defined, so we
+ avoid the big 15-bit exponent estimate. */
+
+int
+__gmp_replacement_vsnprintf (char *buf, size_t buf_size,
+ const char *orig_fmt, va_list orig_ap)
+{
+ va_list ap;
+ const char *fmt;
+ size_t total_width, integer_sizeof, floating_sizeof, len;
+ char fchar, type;
+ int width, prec, seen_prec, double_digits, long_double_digits;
+ int *value;
+
+ /* preserve orig_ap for use after size estimation */
+ va_copy (ap, orig_ap);
+
+ fmt = orig_fmt;
+ total_width = strlen (fmt) + 1; /* 1 extra for the '\0' */
+
+ integer_sizeof = sizeof (long);
+#if HAVE_LONG_LONG
+ integer_sizeof = MAX (integer_sizeof, sizeof (long long));
+#endif
+#if HAVE_QUAD_T
+ integer_sizeof = MAX (integer_sizeof, sizeof (quad_t));
+#endif
+
+ floating_sizeof = sizeof (double);
+#if HAVE_LONG_DOUBLE
+ floating_sizeof = MAX (floating_sizeof, sizeof (long double));
+#endif
+
+ /* IEEE double or VAX G floats have an 11 bit exponent, so the default is
+ a maximum 308 decimal digits. VAX D floats have only an 8 bit
+ exponent, but we don't bother trying to detect that directly. */
+ double_digits = 308;
+#ifdef DBL_MAX_10_EXP
+ /* but in any case prefer a value the compiler says */
+ double_digits = DBL_MAX_10_EXP;
+#endif
+
+ /* IEEE 128-bit quad, Intel 80-bit temporary, or VAX H floats all have 15
+ bit exponents, so the default is a maximum 4932 decimal digits. */
+ long_double_digits = 4932;
+ /* but if double == long double, then go with that size */
+#if HAVE_LONG_DOUBLE
+ if (sizeof (double) == sizeof (long double))
+ long_double_digits = double_digits;
+#endif
+#ifdef LDBL_MAX_10_EXP
+ /* but in any case prefer a value the compiler says */
+ long_double_digits = LDBL_MAX_10_EXP;
+#endif
+
+ for (;;)
+ {
+ fmt = strchr (fmt, '%');
+ if (fmt == NULL)
+ break;
+ fmt++;
+
+ type = '\0';
+ width = 0;
+ prec = 6;
+ seen_prec = 0;
+ value = &width;
+
+ for (;;)
+ {
+ fchar = *fmt++;
+ switch (fchar) {
+
+ case 'c':
+ /* char, already accounted for by strlen(fmt) */
+ goto next;
+
+ case 'd':
+ case 'i':
+ case 'o':
+ case 'x':
+ case 'X':
+ case 'u':
+ /* at most 3 digits per byte in hex, dec or octal, plus a sign */
+ total_width += 3 * integer_sizeof + 1;
+
+ switch (type) {
+ case 'j':
+ /* Let's assume uintmax_t is the same size as intmax_t. */
+#if HAVE_INTMAX_T
+ (void) va_arg (ap, intmax_t);
+#else
+ ASSERT_FAIL (intmax_t not available);
+#endif
+ break;
+ case 'l':
+ (void) va_arg (ap, long);
+ break;
+ case 'L':
+#if HAVE_LONG_LONG
+ (void) va_arg (ap, long long);
+#else
+ ASSERT_FAIL (long long not available);
+#endif
+ break;
+ case 'q':
+ /* quad_t is probably the same as long long, but let's treat
+ it separately just to be sure. Also let's assume u_quad_t
+ will be the same size as quad_t. */
+#if HAVE_QUAD_T
+ (void) va_arg (ap, quad_t);
+#else
+ ASSERT_FAIL (quad_t not available);
+#endif
+ break;
+ case 't':
+#if HAVE_PTRDIFF_T
+ (void) va_arg (ap, ptrdiff_t);
+#else
+ ASSERT_FAIL (ptrdiff_t not available);
+#endif
+ break;
+ case 'z':
+ (void) va_arg (ap, size_t);
+ break;
+ default:
+ /* default is an "int", and this includes h=short and hh=char
+ since they're promoted to int in a function call */
+ (void) va_arg (ap, int);
+ break;
+ }
+ goto next;
+
+ case 'E':
+ case 'e':
+ case 'G':
+ case 'g':
+ /* Requested decimals, sign, point and e, plus an overestimate
+ of exponent digits (the assumption is all the float is
+ exponent!). */
+ total_width += prec + 3 + floating_sizeof * 3;
+ if (type == 'L')
+ {
+#if HAVE_LONG_DOUBLE
+ (void) va_arg (ap, long double);
+#else
+ ASSERT_FAIL (long double not available);
+#endif
+ }
+ else
+ (void) va_arg (ap, double);
+ break;
+
+ case 'f':
+ /* Requested decimals, sign and point, and a margin for error,
+ then add the maximum digits that can be in the integer part,
+ based on the maximum exponent value. */
+ total_width += prec + 2 + 10;
+ if (type == 'L')
+ {
+#if HAVE_LONG_DOUBLE
+ (void) va_arg (ap, long double);
+ total_width += long_double_digits;
+#else
+ ASSERT_FAIL (long double not available);
+#endif
+ }
+ else
+ {
+ (void) va_arg (ap, double);
+ total_width += double_digits;
+ }
+ break;
+
+ case 'h': /* short or char */
+ case 'j': /* intmax_t */
+ case 'L': /* long long or long double */
+ case 'q': /* quad_t */
+ case 't': /* ptrdiff_t */
+ case 'z': /* size_t */
+ set_type:
+ type = fchar;
+ break;
+
+ case 'l':
+ /* long or long long */
+ if (type != 'l')
+ goto set_type;
+ type = 'L'; /* "ll" means "L" */
+ break;
+
+ case 'n':
+ /* bytes written, no output as such */
+ (void) va_arg (ap, void *);
+ goto next;
+
+ case 's':
+ /* If no precision was given, then determine the string length
+ and put it there, to be added to the total under "next". If
+ a precision was given then that's already the maximum from
+ this field, but see whether the string is shorter than that,
+ in case the limit was very big. */
+ {
+ const char *s = va_arg (ap, const char *);
+ prec = (seen_prec ? strnlen (s, prec) : strlen (s));
+ }
+ goto next;
+
+ case 'p':
+ /* pointer, let's assume at worst it's octal with some padding */
+ (void) va_arg (ap, const void *);
+ total_width += 3 * sizeof (void *) + 16;
+ goto next;
+
+ case '%':
+ /* literal %, already accounted for by strlen(fmt) */
+ goto next;
+
+ case '#':
+ /* showbase, at most 2 for "0x" */
+ total_width += 2;
+ break;
+
+ case '+':
+ case ' ':
+ /* sign, already accounted for under numerics */
+ break;
+
+ case '-':
+ /* left justify, no effect on total width */
+ break;
+
+ case '.':
+ seen_prec = 1;
+ value = &prec;
+ break;
+
+ case '*':
+ {
+ /* negative width means left justify which can be ignored,
+ negative prec would be invalid, just use absolute value */
+ int n = va_arg (ap, int);
+ *value = ABS (n);
+ }
+ break;
+
+ case '0': case '1': case '2': case '3': case '4':
+ case '5': case '6': case '7': case '8': case '9':
+ /* process all digits to form a value */
+ {
+ int n = 0;
+ do {
+ n = n * 10 + (fchar-'0');
+ fchar = *fmt++;
+ } while (isascii (fchar) && isdigit (fchar));
+ fmt--; /* unget the non-digit */
+ *value = n;
+ }
+ break;
+
+ default:
+ /* incomplete or invalid % sequence */
+ ASSERT (0);
+ goto next;
+ }
+ }
+
+ next:
+ total_width += width;
+ total_width += prec;
+ }
+
+ if (total_width <= buf_size)
+ {
+ vsprintf (buf, orig_fmt, orig_ap);
+ len = strlen (buf);
+ }
+ else
+ {
+ char *s;
+
+ s = __GMP_ALLOCATE_FUNC_TYPE (total_width, char);
+ vsprintf (s, orig_fmt, orig_ap);
+ len = strlen (s);
+ if (buf_size != 0)
+ {
+ size_t copylen = MIN (len, buf_size-1);
+ memcpy (buf, s, copylen);
+ buf[copylen] = '\0';
+ }
+ (*__gmp_free_func) (s, total_width);
+ }
+
+ /* If total_width was somehow wrong then chances are we've already
+ clobbered memory, but maybe this check will still work. */
+ ASSERT_ALWAYS (len < total_width);
+
+ return len;
+}
+
+#endif /* ! HAVE_VSNPRINTF */
diff --git a/Build/source/libs/gmp/gmp-6.0.0/printf/snprintf.c b/Build/source/libs/gmp/gmp-6.0.0/printf/snprintf.c
new file mode 100644
index 00000000000..fde5c806ebe
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/printf/snprintf.c
@@ -0,0 +1,54 @@
+/* gmp_snprintf -- formatted output to an fixed size buffer.
+
+Copyright 2001 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 <stdarg.h>
+#include <string.h> /* for strlen */
+
+#include "gmp.h"
+#include "gmp-impl.h"
+
+
+int
+gmp_snprintf (char *buf, size_t size, const char *fmt, ...)
+{
+ struct gmp_snprintf_t d;
+ va_list ap;
+ int ret;
+
+ va_start (ap, fmt);
+ d.buf = buf;
+ d.size = size;
+
+ ASSERT (! MEM_OVERLAP_P (buf, size, fmt, strlen(fmt)+1));
+
+ ret = __gmp_doprnt (&__gmp_snprintf_funs, &d, fmt, ap);
+ va_end (ap);
+ return ret;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/printf/snprntffuns.c b/Build/source/libs/gmp/gmp-6.0.0/printf/snprntffuns.c
new file mode 100644
index 00000000000..41a7670c6da
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/printf/snprntffuns.c
@@ -0,0 +1,160 @@
+/* __gmp_snprintf_funs -- support for gmp_snprintf and gmp_vsnprintf.
+
+ 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 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 <stdarg.h>
+#include <stdio.h>
+#include <string.h>
+
+#include "gmp.h"
+#include "gmp-impl.h"
+
+
+#if ! HAVE_VSNPRINTF
+#define vsnprintf __gmp_replacement_vsnprintf
+#endif
+
+
+/* glibc 2.0.x vsnprintf returns either -1 or size-1 for an overflow, with
+ no indication how big the output would have been. It's necessary to
+ re-run to determine that size.
+
+ "size-1" would mean success from a C99 vsnprintf, and the re-run is
+ unnecessary in this case, but we don't bother to try to detect what sort
+ of vsnprintf we've got. size-1 should occur rarely in normal
+ circumstances.
+
+ vsnprintf might trash it's given ap (it does for instance in glibc 2.1.3
+ on powerpc), so copy it in case we need to use it to probe for the size
+ output that would have been produced. Note there's no need to preserve
+ it for our callers, just for ourselves. */
+
+static int
+gmp_snprintf_format (struct gmp_snprintf_t *d, const char *fmt,
+ va_list orig_ap)
+{
+ int ret, step, alloc, avail;
+ va_list ap;
+ char *p;
+
+ ASSERT (d->size >= 0);
+
+ avail = d->size;
+ if (avail > 1)
+ {
+ va_copy (ap, orig_ap);
+ ret = vsnprintf (d->buf, avail, fmt, ap);
+ if (ret == -1)
+ {
+ ASSERT (strlen (d->buf) == avail-1);
+ ret = avail-1;
+ }
+
+ step = MIN (ret, avail-1);
+ d->size -= step;
+ d->buf += step;
+
+ if (ret != avail-1)
+ return ret;
+
+ /* probably glibc 2.0.x truncated output, probe for actual size */
+ alloc = MAX (128, ret);
+ }
+ else
+ {
+ /* no space to write anything, just probe for size */
+ alloc = 128;
+ }
+
+ do
+ {
+ alloc *= 2;
+ p = __GMP_ALLOCATE_FUNC_TYPE (alloc, char);
+ va_copy (ap, orig_ap);
+ ret = vsnprintf (p, alloc, fmt, ap);
+ (*__gmp_free_func) (p, alloc);
+ }
+ while (ret == alloc-1 || ret == -1);
+
+ return ret;
+}
+
+static int
+gmp_snprintf_memory (struct gmp_snprintf_t *d, const char *str, size_t len)
+{
+ size_t n;
+
+ ASSERT (d->size >= 0);
+
+ if (d->size > 1)
+ {
+ n = MIN (d->size-1, len);
+ memcpy (d->buf, str, n);
+ d->buf += n;
+ d->size -= n;
+ }
+ return len;
+}
+
+static int
+gmp_snprintf_reps (struct gmp_snprintf_t *d, int c, int reps)
+{
+ size_t n;
+
+ ASSERT (reps >= 0);
+ ASSERT (d->size >= 0);
+
+ if (d->size > 1)
+ {
+ n = MIN (d->size-1, reps);
+ memset (d->buf, c, n);
+ d->buf += n;
+ d->size -= n;
+ }
+ return reps;
+}
+
+static int
+gmp_snprintf_final (struct gmp_snprintf_t *d)
+{
+ if (d->size >= 1)
+ d->buf[0] = '\0';
+ return 0;
+}
+
+const struct doprnt_funs_t __gmp_snprintf_funs = {
+ (doprnt_format_t) gmp_snprintf_format,
+ (doprnt_memory_t) gmp_snprintf_memory,
+ (doprnt_reps_t) gmp_snprintf_reps,
+ (doprnt_final_t) gmp_snprintf_final
+};
diff --git a/Build/source/libs/gmp/gmp-6.0.0/printf/sprintf.c b/Build/source/libs/gmp/gmp-6.0.0/printf/sprintf.c
new file mode 100644
index 00000000000..052a2655c9e
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/printf/sprintf.c
@@ -0,0 +1,55 @@
+/* gmp_sprintf -- formatted output to an unrestricted string.
+
+Copyright 2001 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 <stdarg.h>
+#include <string.h> /* for strlen */
+
+#include "gmp.h"
+#include "gmp-impl.h"
+
+
+int
+gmp_sprintf (char *buf, const char *fmt, ...)
+{
+#if WANT_ASSERT
+ int fmtlen = strlen(fmt);
+#endif
+ va_list ap;
+ int ret;
+
+ va_start (ap, fmt);
+
+ ret = __gmp_doprnt (&__gmp_sprintf_funs, &buf, fmt, ap);
+ va_end (ap);
+
+ ASSERT (! MEM_OVERLAP_P (buf, strlen(buf)+1, fmt, fmtlen+1));
+
+ return ret;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/printf/sprintffuns.c b/Build/source/libs/gmp/gmp-6.0.0/printf/sprintffuns.c
new file mode 100644
index 00000000000..40374e1a07e
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/printf/sprintffuns.c
@@ -0,0 +1,95 @@
+/* __gmp_sprintf_funs -- support for gmp_sprintf and gmp_vsprintf.
+
+ 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 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 <stdarg.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "gmp.h"
+#include "gmp-impl.h"
+
+
+/* The data parameter "bufp" points to a "char *buf" which is the next
+ character to be written, having started as the destination from the
+ application. This is then increased each time output is produced. */
+
+
+/* If vsprintf returns -1 then pass it upwards. It doesn't matter that
+ "*bufp" is ruined in this case, since gmp_doprint will bail out
+ immediately anyway. */
+static int
+gmp_sprintf_format (char **bufp, const char *fmt, va_list ap)
+{
+ char *buf = *bufp;
+ int ret;
+ vsprintf (buf, fmt, ap);
+ ret = strlen (buf);
+ *bufp = buf + ret;
+ return ret;
+}
+
+static int
+gmp_sprintf_memory (char **bufp, const char *str, size_t len)
+{
+ char *buf = *bufp;
+ *bufp = buf + len;
+ memcpy (buf, str, len);
+ return len;
+}
+
+static int
+gmp_sprintf_reps (char **bufp, int c, int reps)
+{
+ char *buf = *bufp;
+ ASSERT (reps >= 0);
+ *bufp = buf + reps;
+ memset (buf, c, reps);
+ return reps;
+}
+
+static int
+gmp_sprintf_final (char **bufp, int c, int reps)
+{
+ char *buf = *bufp;
+ *buf = '\0';
+ return 0;
+}
+
+const struct doprnt_funs_t __gmp_sprintf_funs = {
+ (doprnt_format_t) gmp_sprintf_format,
+ (doprnt_memory_t) gmp_sprintf_memory,
+ (doprnt_reps_t) gmp_sprintf_reps,
+ (doprnt_final_t) gmp_sprintf_final
+};
diff --git a/Build/source/libs/gmp/gmp-6.0.0/printf/vasprintf.c b/Build/source/libs/gmp/gmp-6.0.0/printf/vasprintf.c
new file mode 100644
index 00000000000..44785dae2a7
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/printf/vasprintf.c
@@ -0,0 +1,117 @@
+/* gmp_vasprintf -- formatted output to an allocated space.
+
+Copyright 2001 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 <stdarg.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "gmp.h"
+#include "gmp-impl.h"
+
+#if ! HAVE_VSNPRINTF
+#define vsnprintf __gmp_replacement_vsnprintf
+#endif
+
+
+/* vasprintf isn't used since we prefer all GMP allocs to go through
+ __gmp_allocate_func, and in particular we don't want the -1 return from
+ vasprintf for out-of-memory, instead __gmp_allocate_func should handle
+ that. Using vsnprintf unfortunately means we might have to re-run it if
+ our current space is insufficient.
+
+ The initial guess for the needed space is an arbitrary 256 bytes. If
+ that (and any extra GMP_ASPRINTF_T_NEED might give) isn't enough then an
+ ISO C99 standard vsnprintf will tell us what we really need.
+
+ GLIBC 2.0.x vsnprintf returns either -1 or space-1 to indicate overflow,
+ without giving any indication how much is really needed. In this case
+ keep trying with double the space each time.
+
+ A return of space-1 is success on a C99 vsnprintf, but we're not
+ bothering to identify which style vsnprintf we've got, so just take the
+ pessimistic option and assume it's glibc 2.0.x.
+
+ Notice the use of ret+2 for the new space in the C99 case. This ensures
+ the next vsnprintf return value will be space-2, which is unambiguously
+ successful. But actually GMP_ASPRINTF_T_NEED() will realloc to even
+ bigger than that ret+2.
+
+ vsnprintf might trash it's given ap, so copy it in case we need to use it
+ more than once. See comments with gmp_snprintf_format. */
+
+static int
+gmp_asprintf_format (struct gmp_asprintf_t *d, const char *fmt,
+ va_list orig_ap)
+{
+ int ret;
+ va_list ap;
+ size_t space = 256;
+
+ for (;;)
+ {
+ GMP_ASPRINTF_T_NEED (d, space);
+ space = d->alloc - d->size;
+ va_copy (ap, orig_ap);
+ ret = vsnprintf (d->buf + d->size, space, fmt, ap);
+ if (ret == -1)
+ {
+ ASSERT (strlen (d->buf + d->size) == space-1);
+ ret = space-1;
+ }
+
+ /* done if output fits in our space */
+ if (ret < space-1)
+ break;
+
+ if (ret == space-1)
+ space *= 2; /* possible glibc 2.0.x, so double */
+ else
+ space = ret+2; /* C99, so now know space required */
+ }
+
+ d->size += ret;
+ return ret;
+}
+
+const struct doprnt_funs_t __gmp_asprintf_funs = {
+ (doprnt_format_t) gmp_asprintf_format,
+ (doprnt_memory_t) __gmp_asprintf_memory,
+ (doprnt_reps_t) __gmp_asprintf_reps,
+ (doprnt_final_t) __gmp_asprintf_final
+};
+
+int
+gmp_vasprintf (char **result, const char *fmt, va_list ap)
+{
+ struct gmp_asprintf_t d;
+ GMP_ASPRINTF_T_INIT (d, result);
+ return __gmp_doprnt (&__gmp_asprintf_funs, &d, fmt, ap);
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/printf/vfprintf.c b/Build/source/libs/gmp/gmp-6.0.0/printf/vfprintf.c
new file mode 100644
index 00000000000..839f133d9db
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/printf/vfprintf.c
@@ -0,0 +1,42 @@
+/* gmp_vfprintf -- formatted output.
+
+Copyright 2001 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 <stdarg.h>
+#include <stdio.h>
+
+#include "gmp.h"
+#include "gmp-impl.h"
+
+
+int
+gmp_vfprintf (FILE *fp, const char *fmt, va_list ap)
+{
+ return __gmp_doprnt (&__gmp_fprintf_funs, fp, fmt, ap);
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/printf/vprintf.c b/Build/source/libs/gmp/gmp-6.0.0/printf/vprintf.c
new file mode 100644
index 00000000000..8e768978f56
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/printf/vprintf.c
@@ -0,0 +1,42 @@
+/* gmp_vprintf -- formatted output.
+
+Copyright 2001 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 <stdarg.h>
+#include <stdio.h>
+
+#include "gmp.h"
+#include "gmp-impl.h"
+
+
+int
+gmp_vprintf (const char *fmt, va_list ap)
+{
+ return __gmp_doprnt (&__gmp_fprintf_funs, stdout, fmt, ap);
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/printf/vsnprintf.c b/Build/source/libs/gmp/gmp-6.0.0/printf/vsnprintf.c
new file mode 100644
index 00000000000..ed6f99885dd
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/printf/vsnprintf.c
@@ -0,0 +1,48 @@
+/* gmp_vsnprintf -- formatted output to an fixed size buffer.
+
+Copyright 2001 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 <stdarg.h>
+#include <string.h> /* for strlen */
+
+#include "gmp.h"
+#include "gmp-impl.h"
+
+
+int
+gmp_vsnprintf (char *buf, size_t size, const char *fmt, va_list ap)
+{
+ struct gmp_snprintf_t d;
+
+ ASSERT (! MEM_OVERLAP_P (buf, size, fmt, strlen(fmt)+1));
+
+ d.buf = buf;
+ d.size = size;
+ return __gmp_doprnt (&__gmp_snprintf_funs, &d, fmt, ap);
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/printf/vsprintf.c b/Build/source/libs/gmp/gmp-6.0.0/printf/vsprintf.c
new file mode 100644
index 00000000000..099455d3254
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/printf/vsprintf.c
@@ -0,0 +1,51 @@
+/* gmp_vsprintf -- formatted output to an unrestricted string.
+
+Copyright 2001 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 <stdarg.h>
+#include <string.h> /* for strlen */
+
+#include "gmp.h"
+#include "gmp-impl.h"
+
+
+int
+gmp_vsprintf (char *buf, const char *fmt, va_list ap)
+{
+#if WANT_ASSERT
+ int fmtlen = strlen(fmt);
+#endif
+ int ret;
+
+ ret = __gmp_doprnt (&__gmp_sprintf_funs, &buf, fmt, ap);
+
+ ASSERT (! MEM_OVERLAP_P (buf, strlen(buf)+1, fmt, fmtlen+1));
+
+ return ret;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/rand/Makefile.am b/Build/source/libs/gmp/gmp-6.0.0/rand/Makefile.am
new file mode 100644
index 00000000000..0cee1a76235
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/rand/Makefile.am
@@ -0,0 +1,38 @@
+## Process this file with automake to generate Makefile.in
+
+# Copyright 2001, 2002, 2010 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/.
+
+
+INCLUDES = -D__GMP_WITHIN_GMP -I$(top_srcdir)
+
+noinst_LTLIBRARIES = librandom.la
+
+librandom_la_SOURCES = randmt.h \
+ rand.c randclr.c randdef.c randiset.c randlc2s.c randlc2x.c randmt.c \
+ randmts.c rands.c randsd.c randsdui.c randbui.c randmui.c
diff --git a/Build/source/libs/gmp/gmp-6.0.0/rand/rand.c b/Build/source/libs/gmp/gmp-6.0.0/rand/rand.c
new file mode 100644
index 00000000000..09e3b765bcd
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/rand/rand.c
@@ -0,0 +1,52 @@
+/* gmp_randinit (state, algorithm, ...) -- Initialize a random state.
+
+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/. */
+
+#include <stdarg.h>
+
+#include "gmp.h"
+#include "gmp-impl.h"
+
+void
+gmp_randinit (gmp_randstate_t rstate, gmp_randalg_t alg, ...)
+{
+ va_list ap;
+ va_start (ap, alg);
+
+ switch (alg) {
+ case GMP_RAND_ALG_LC:
+ if (! gmp_randinit_lc_2exp_size (rstate, va_arg (ap, unsigned long)))
+ gmp_errno |= GMP_ERROR_INVALID_ARGUMENT;
+ break;
+ default:
+ gmp_errno |= GMP_ERROR_UNSUPPORTED_ARGUMENT;
+ break;
+ }
+ va_end (ap);
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/rand/randbui.c b/Build/source/libs/gmp/gmp-6.0.0/rand/randbui.c
new file mode 100644
index 00000000000..619ab91bd15
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/rand/randbui.c
@@ -0,0 +1,57 @@
+/* gmp_urandomb_ui -- random bits returned in a ulong.
+
+Copyright 2003, 2004 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.h"
+#include "gmp-impl.h"
+
+
+/* Currently bits>=BITS_PER_ULONG is quietly truncated to BITS_PER_ULONG,
+ maybe this should raise an exception or something. */
+
+unsigned long
+gmp_urandomb_ui (gmp_randstate_ptr rstate, unsigned long bits)
+{
+ mp_limb_t a[LIMBS_PER_ULONG];
+
+ /* start with zeros, since if bits==0 then _gmp_rand will store nothing at
+ all, or if bits <= GMP_NUMB_BITS then it will store only a[0] */
+ a[0] = 0;
+#if LIMBS_PER_ULONG > 1
+ a[1] = 0;
+#endif
+
+ _gmp_rand (a, rstate, MIN (bits, BITS_PER_ULONG));
+
+#if LIMBS_PER_ULONG == 1
+ return a[0];
+#else
+ return a[0] | (a[1] << GMP_NUMB_BITS);
+#endif
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/rand/randclr.c b/Build/source/libs/gmp/gmp-6.0.0/rand/randclr.c
new file mode 100644
index 00000000000..fb3798b73de
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/rand/randclr.c
@@ -0,0 +1,38 @@
+/* gmp_randclear (state) -- Clear and deallocate random state STATE.
+
+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/. */
+
+#include "gmp.h"
+#include "gmp-impl.h"
+
+void
+gmp_randclear (gmp_randstate_t rstate)
+{
+ (*((gmp_randfnptr_t *) RNG_FNPTR (rstate))->randclear_fn) (rstate);
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/rand/randdef.c b/Build/source/libs/gmp/gmp-6.0.0/rand/randdef.c
new file mode 100644
index 00000000000..7d173f9364c
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/rand/randdef.c
@@ -0,0 +1,38 @@
+/* gmp_randinit_default -- initialize a random state with a default algorithm.
+
+Copyright 2001, 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/. */
+
+#include "gmp.h"
+#include "gmp-impl.h"
+
+void
+gmp_randinit_default (gmp_randstate_t rstate)
+{
+ gmp_randinit_mt (rstate);
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/rand/randiset.c b/Build/source/libs/gmp/gmp-6.0.0/rand/randiset.c
new file mode 100644
index 00000000000..66f4bc49033
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/rand/randiset.c
@@ -0,0 +1,39 @@
+/* gmp_randinit_set -- initialize with a copy of another gmp_randstate_t.
+
+Copyright 2003 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.h"
+#include "gmp-impl.h"
+
+
+void
+gmp_randinit_set (gmp_randstate_ptr dst, gmp_randstate_srcptr src)
+{
+ (*((gmp_randfnptr_t *) RNG_FNPTR (src))->randiset_fn) (dst, src);
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/rand/randlc2s.c b/Build/source/libs/gmp/gmp-6.0.0/rand/randlc2s.c
new file mode 100644
index 00000000000..013e877286d
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/rand/randlc2s.c
@@ -0,0 +1,93 @@
+/* gmp_randinit_lc_2exp_size -- initialize a random state with a linear
+ congruential generator of a requested size.
+
+Copyright 1999-2001 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> /* for NULL */
+#include "gmp.h"
+#include "gmp-impl.h"
+
+
+/* Array of LC-schemes, ordered in increasing order of the first
+ member (the 'm2exp' value). The end of the array is indicated with
+ an entry containing all zeros. */
+
+/* All multipliers are in the range 0.01*m and 0.99*m, and are
+congruent to 5 (mod 8).
+They all pass the spectral test with Vt >= 2^(30/t) and merit >= 1.
+(Up to and including 196 bits, merit is >= 3.) */
+
+struct __gmp_rand_lc_scheme_struct
+{
+ unsigned long int m2exp; /* Modulus is 2 ^ m2exp. */
+ const char *astr; /* Multiplier in string form. */
+ unsigned long int c; /* Addend. */
+};
+
+static const struct __gmp_rand_lc_scheme_struct __gmp_rand_lc_scheme[] =
+{
+ {32, "29CF535", 1},
+ {33, "51F666D", 1},
+ {34, "A3D73AD", 1},
+ {35, "147E5B85", 1},
+ {36, "28F725C5", 1},
+ {37, "51EE3105", 1},
+ {38, "A3DD5CDD", 1},
+ {39, "147AF833D", 1},
+ {40, "28F5DA175", 1},
+ {56, "AA7D735234C0DD", 1},
+ {64, "BAECD515DAF0B49D", 1},
+ {100, "292787EBD3329AD7E7575E2FD", 1},
+ {128, "48A74F367FA7B5C8ACBB36901308FA85", 1},
+ {156, "78A7FDDDC43611B527C3F1D760F36E5D7FC7C45", 1},
+ {196, "41BA2E104EE34C66B3520CE706A56498DE6D44721E5E24F5", 1},
+ {200, "4E5A24C38B981EAFE84CD9D0BEC48E83911362C114F30072C5", 1},
+ {256, "AF66BA932AAF58A071FD8F0742A99A0C76982D648509973DB802303128A14CB5", 1},
+ {0, NULL, 0} /* End of array. */
+};
+
+int
+gmp_randinit_lc_2exp_size (gmp_randstate_t rstate, mp_bitcnt_t size)
+{
+ const struct __gmp_rand_lc_scheme_struct *sp;
+ mpz_t a;
+
+ /* Pick a scheme. */
+ for (sp = __gmp_rand_lc_scheme; sp->m2exp != 0; sp++)
+ if (sp->m2exp / 2 >= size)
+ goto found;
+ return 0;
+
+ found:
+ /* Install scheme. */
+ mpz_init_set_str (a, sp->astr, 16);
+ gmp_randinit_lc_2exp (rstate, a, sp->c, sp->m2exp);
+ mpz_clear (a);
+ return 1;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/rand/randlc2x.c b/Build/source/libs/gmp/gmp-6.0.0/rand/randlc2x.c
new file mode 100644
index 00000000000..195f759327a
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/rand/randlc2x.c
@@ -0,0 +1,333 @@
+/* Linear Congruential pseudo-random number generator functions.
+
+Copyright 1999-2003, 2005 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.h"
+#include "gmp-impl.h"
+
+
+/* State structure for LC, the RNG_STATE() pointer in a gmp_randstate_t.
+
+ _mp_seed holds the current seed value, in the range 0 to 2^m2exp-1.
+ SIZ(_mp_seed) is fixed at BITS_TO_LIMBS(_mp_m2exp) and the value is
+ padded with high zero limbs if necessary. ALLOC(_mp_seed) is the current
+ size of PTR(_mp_seed) in the usual way. There only needs to be
+ BITS_TO_LIMBS(_mp_m2exp) allocated, but the mpz functions in the
+ initialization and seeding end up making it a bit more than this.
+
+ _mp_a is the "a" multiplier, in the range 0 to 2^m2exp-1. SIZ(_mp_a) is
+ the size of the value in the normal way for an mpz_t, except that a value
+ of zero is held with SIZ(_mp_a)==1 and PTR(_mp_a)[0]==0. This makes it
+ easy to call mpn_mul, and the case of a==0 is highly un-random and not
+ worth any trouble to optimize.
+
+ {_cp,_cn} is the "c" addend. Normally _cn is 1, but when nails are in
+ use a ulong can be bigger than one limb, and in this case _cn is 2 if
+ necessary. c==0 is stored as _cp[0]==0 and _cn==1, which makes it easy
+ to call __GMPN_ADD. c==0 is fairly un-random so isn't worth optimizing.
+
+ _mp_m2exp gives the modulus, namely 2^m2exp. We demand m2exp>=1, since
+ m2exp==0 would mean no bits at all out of each iteration, which makes no
+ sense. */
+
+typedef struct {
+ mpz_t _mp_seed;
+ mpz_t _mp_a;
+ mp_size_t _cn;
+ mp_limb_t _cp[LIMBS_PER_ULONG];
+ unsigned long _mp_m2exp;
+} gmp_rand_lc_struct;
+
+
+/* lc (rp, state) -- Generate next number in LC sequence. Return the
+ number of valid bits in the result. Discards the lower half of the
+ result. */
+
+static unsigned long int
+lc (mp_ptr rp, gmp_randstate_t rstate)
+{
+ mp_ptr tp, seedp, ap;
+ mp_size_t ta;
+ mp_size_t tn, seedn, an;
+ unsigned long int m2exp;
+ unsigned long int bits;
+ int cy;
+ mp_size_t xn;
+ gmp_rand_lc_struct *p;
+ TMP_DECL;
+
+ p = (gmp_rand_lc_struct *) RNG_STATE (rstate);
+
+ m2exp = p->_mp_m2exp;
+
+ seedp = PTR (p->_mp_seed);
+ seedn = SIZ (p->_mp_seed);
+
+ ap = PTR (p->_mp_a);
+ an = SIZ (p->_mp_a);
+
+ /* Allocate temporary storage. Let there be room for calculation of
+ (A * seed + C) % M, or M if bigger than that. */
+
+ TMP_MARK;
+
+ ta = an + seedn + 1;
+ tn = BITS_TO_LIMBS (m2exp);
+ if (ta <= tn) /* that is, if (ta < tn + 1) */
+ {
+ mp_size_t tmp = an + seedn;
+ ta = tn + 1;
+ tp = TMP_ALLOC_LIMBS (ta);
+ MPN_ZERO (&tp[tmp], ta - tmp); /* mpn_mul won't zero it out. */
+ }
+ else
+ tp = TMP_ALLOC_LIMBS (ta);
+
+ /* t = a * seed. NOTE: an is always > 0; see initialization. */
+ ASSERT (seedn >= an && an > 0);
+ mpn_mul (tp, seedp, seedn, ap, an);
+
+ /* t = t + c. NOTE: tn is always >= p->_cn (precondition for __GMPN_ADD);
+ see initialization. */
+ ASSERT (tn >= p->_cn);
+ __GMPN_ADD (cy, tp, tp, tn, p->_cp, p->_cn);
+
+ /* t = t % m */
+ tp[m2exp / GMP_NUMB_BITS] &= (CNST_LIMB (1) << m2exp % GMP_NUMB_BITS) - 1;
+
+ /* Save result as next seed. */
+ MPN_COPY (PTR (p->_mp_seed), tp, tn);
+
+ /* Discard the lower m2exp/2 of the result. */
+ bits = m2exp / 2;
+ xn = bits / GMP_NUMB_BITS;
+
+ tn -= xn;
+ if (tn > 0)
+ {
+ unsigned int cnt = bits % GMP_NUMB_BITS;
+ if (cnt != 0)
+ {
+ mpn_rshift (tp, tp + xn, tn, cnt);
+ MPN_COPY_INCR (rp, tp, xn + 1);
+ }
+ else /* Even limb boundary. */
+ MPN_COPY_INCR (rp, tp + xn, tn);
+ }
+
+ TMP_FREE;
+
+ /* Return number of valid bits in the result. */
+ return (m2exp + 1) / 2;
+}
+
+
+/* Obtain a sequence of random numbers. */
+static void
+randget_lc (gmp_randstate_t rstate, mp_ptr rp, unsigned long int nbits)
+{
+ unsigned long int rbitpos;
+ int chunk_nbits;
+ mp_ptr tp;
+ mp_size_t tn;
+ gmp_rand_lc_struct *p;
+ TMP_DECL;
+
+ p = (gmp_rand_lc_struct *) RNG_STATE (rstate);
+
+ TMP_MARK;
+
+ chunk_nbits = p->_mp_m2exp / 2;
+ tn = BITS_TO_LIMBS (chunk_nbits);
+
+ tp = TMP_ALLOC_LIMBS (tn);
+
+ rbitpos = 0;
+ while (rbitpos + chunk_nbits <= nbits)
+ {
+ mp_ptr r2p = rp + rbitpos / GMP_NUMB_BITS;
+
+ if (rbitpos % GMP_NUMB_BITS != 0)
+ {
+ mp_limb_t savelimb, rcy;
+ /* Target of new chunk is not bit aligned. Use temp space
+ and align things by shifting it up. */
+ lc (tp, rstate);
+ savelimb = r2p[0];
+ rcy = mpn_lshift (r2p, tp, tn, rbitpos % GMP_NUMB_BITS);
+ r2p[0] |= savelimb;
+ /* bogus */
+ if ((chunk_nbits % GMP_NUMB_BITS + rbitpos % GMP_NUMB_BITS)
+ > GMP_NUMB_BITS)
+ r2p[tn] = rcy;
+ }
+ else
+ {
+ /* Target of new chunk is bit aligned. Let `lc' put bits
+ directly into our target variable. */
+ lc (r2p, rstate);
+ }
+ rbitpos += chunk_nbits;
+ }
+
+ /* Handle last [0..chunk_nbits) bits. */
+ if (rbitpos != nbits)
+ {
+ mp_ptr r2p = rp + rbitpos / GMP_NUMB_BITS;
+ int last_nbits = nbits - rbitpos;
+ tn = BITS_TO_LIMBS (last_nbits);
+ lc (tp, rstate);
+ if (rbitpos % GMP_NUMB_BITS != 0)
+ {
+ mp_limb_t savelimb, rcy;
+ /* Target of new chunk is not bit aligned. Use temp space
+ and align things by shifting it up. */
+ savelimb = r2p[0];
+ rcy = mpn_lshift (r2p, tp, tn, rbitpos % GMP_NUMB_BITS);
+ r2p[0] |= savelimb;
+ if (rbitpos + tn * GMP_NUMB_BITS - rbitpos % GMP_NUMB_BITS < nbits)
+ r2p[tn] = rcy;
+ }
+ else
+ {
+ MPN_COPY (r2p, tp, tn);
+ }
+ /* Mask off top bits if needed. */
+ if (nbits % GMP_NUMB_BITS != 0)
+ rp[nbits / GMP_NUMB_BITS]
+ &= ~(~CNST_LIMB (0) << nbits % GMP_NUMB_BITS);
+ }
+
+ TMP_FREE;
+}
+
+
+static void
+randseed_lc (gmp_randstate_t rstate, mpz_srcptr seed)
+{
+ gmp_rand_lc_struct *p = (gmp_rand_lc_struct *) RNG_STATE (rstate);
+ mpz_ptr seedz = p->_mp_seed;
+ mp_size_t seedn = BITS_TO_LIMBS (p->_mp_m2exp);
+
+ /* Store p->_mp_seed as an unnormalized integer with size enough
+ for numbers up to 2^m2exp-1. That size can't be zero. */
+ mpz_fdiv_r_2exp (seedz, seed, p->_mp_m2exp);
+ MPN_ZERO (&PTR (seedz)[SIZ (seedz)], seedn - SIZ (seedz));
+ SIZ (seedz) = seedn;
+}
+
+
+static void
+randclear_lc (gmp_randstate_t rstate)
+{
+ gmp_rand_lc_struct *p = (gmp_rand_lc_struct *) RNG_STATE (rstate);
+
+ mpz_clear (p->_mp_seed);
+ mpz_clear (p->_mp_a);
+ (*__gmp_free_func) (p, sizeof (gmp_rand_lc_struct));
+}
+
+static void randiset_lc (gmp_randstate_ptr, gmp_randstate_srcptr);
+
+static const gmp_randfnptr_t Linear_Congruential_Generator = {
+ randseed_lc,
+ randget_lc,
+ randclear_lc,
+ randiset_lc
+};
+
+static void
+randiset_lc (gmp_randstate_ptr dst, gmp_randstate_srcptr src)
+{
+ gmp_rand_lc_struct *dstp, *srcp;
+
+ srcp = (gmp_rand_lc_struct *) RNG_STATE (src);
+ dstp = (gmp_rand_lc_struct *) (*__gmp_allocate_func) (sizeof (gmp_rand_lc_struct));
+
+ RNG_STATE (dst) = (mp_limb_t *) (void *) dstp;
+ RNG_FNPTR (dst) = (void *) &Linear_Congruential_Generator;
+
+ /* _mp_seed and _mp_a might be unnormalized (high zero limbs), but
+ mpz_init_set won't worry about that */
+ mpz_init_set (dstp->_mp_seed, srcp->_mp_seed);
+ mpz_init_set (dstp->_mp_a, srcp->_mp_a);
+
+ dstp->_cn = srcp->_cn;
+
+ dstp->_cp[0] = srcp->_cp[0];
+ if (LIMBS_PER_ULONG > 1)
+ dstp->_cp[1] = srcp->_cp[1];
+ if (LIMBS_PER_ULONG > 2) /* usually there's only 1 or 2 */
+ MPN_COPY (dstp->_cp + 2, srcp->_cp + 2, LIMBS_PER_ULONG - 2);
+
+ dstp->_mp_m2exp = srcp->_mp_m2exp;
+}
+
+
+void
+gmp_randinit_lc_2exp (gmp_randstate_t rstate,
+ mpz_srcptr a,
+ unsigned long int c,
+ mp_bitcnt_t m2exp)
+{
+ gmp_rand_lc_struct *p;
+ mp_size_t seedn = BITS_TO_LIMBS (m2exp);
+
+ ASSERT_ALWAYS (m2exp != 0);
+
+ p = __GMP_ALLOCATE_FUNC_TYPE (1, gmp_rand_lc_struct);
+ RNG_STATE (rstate) = (mp_limb_t *) (void *) p;
+ RNG_FNPTR (rstate) = (void *) &Linear_Congruential_Generator;
+
+ /* allocate m2exp bits of space for p->_mp_seed, and initial seed "1" */
+ mpz_init2 (p->_mp_seed, m2exp);
+ MPN_ZERO (PTR (p->_mp_seed), seedn);
+ SIZ (p->_mp_seed) = seedn;
+ PTR (p->_mp_seed)[0] = 1;
+
+ /* "a", forced to 0 to 2^m2exp-1 */
+ mpz_init (p->_mp_a);
+ mpz_fdiv_r_2exp (p->_mp_a, a, m2exp);
+
+ /* Avoid SIZ(a) == 0 to avoid checking for special case in lc(). */
+ if (SIZ (p->_mp_a) == 0)
+ {
+ SIZ (p->_mp_a) = 1;
+ PTR (p->_mp_a)[0] = CNST_LIMB (0);
+ }
+
+ MPN_SET_UI (p->_cp, p->_cn, c);
+
+ /* Internally we may discard any bits of c above m2exp. The following
+ code ensures that __GMPN_ADD in lc() will always work. */
+ if (seedn < p->_cn)
+ p->_cn = (p->_cp[0] != 0);
+
+ p->_mp_m2exp = m2exp;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/rand/randmt.c b/Build/source/libs/gmp/gmp-6.0.0/rand/randmt.c
new file mode 100644
index 00000000000..f3cdc666626
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/rand/randmt.c
@@ -0,0 +1,416 @@
+/* Mersenne Twister pseudo-random number generator functions.
+
+ 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 2002, 2003, 2006 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> /* for NULL */
+
+#include "gmp.h"
+#include "gmp-impl.h"
+#include "randmt.h"
+
+
+/* This code implements the Mersenne Twister pseudorandom number generator
+ by Takuji Nishimura and Makoto Matsumoto. The buffer initialization
+ function is different in order to permit seeds greater than 2^32-1.
+
+ This file contains a special __gmp_randinit_mt_noseed which excludes the
+ seeding function from the gmp_randfnptr_t routines. This is for use by
+ mpn_random and mpn_random2 on the global random generator. MT seeding
+ uses mpz functions, and we don't want mpn routines dragging mpz functions
+ into the link. */
+
+
+/* Default seed to use when the generator is not initialized. */
+#define DEFAULT_SEED 5489 /* was 4357 */
+
+/* Tempering masks. */
+#define MASK_1 0x9D2C5680
+#define MASK_2 0xEFC60000
+
+/* Initial state of buffer when initialized with default seed. */
+static const gmp_uint_least32_t default_state[N] =
+{
+ 0xD247B233,0x9E5AA8F1,0x0FFA981B,0x9DCB0980,0x74200F2B,0xA576D044,
+ 0xE9F05ADF,0x1538BFF5,0x59818BBF,0xCF9E58D8,0x09FCE032,0x6A1C663F,
+ 0x5116E78A,0x69B3E0FA,0x6D92D665,0xD0A8BE98,0xF669B734,0x41AC1B68,
+ 0x630423F1,0x4B8D6B8A,0xC2C46DD7,0x5680747D,0x43703E8F,0x3B6103D2,
+ 0x49E5EB3F,0xCBDAB4C1,0x9C988E23,0x747BEE0B,0x9111E329,0x9F031B5A,
+ 0xECCA71B9,0x2AFE4EF8,0x8421C7ED,0xAC89AFF1,0xAED90DF3,0x2DD74F01,
+ 0x14906A13,0x75873FA9,0xFF83F877,0x5028A0C9,0x11B4C41D,0x7CAEDBC4,
+ 0x8672D0A7,0x48A7C109,0x8320E59F,0xBC0B3D5F,0x75A30886,0xF9E0D128,
+ 0x41AF7580,0x239BB94D,0xC67A3C81,0x74EEBD6E,0xBC02B53C,0x727EA449,
+ 0x6B8A2806,0x5853B0DA,0xBDE032F4,0xCE234885,0x320D6145,0x48CC053F,
+ 0x00DBC4D2,0xD55A2397,0xE1059B6F,0x1C3E05D1,0x09657C64,0xD07CB661,
+ 0x6E982E34,0x6DD1D777,0xEDED1071,0xD79DFD65,0xF816DDCE,0xB6FAF1E4,
+ 0x1C771074,0x311835BD,0x18F952F7,0xF8F40350,0x4ECED354,0x7C8AC12B,
+ 0x31A9994D,0x4FD47747,0xDC227A23,0x6DFAFDDF,0x6796E748,0x0C6F634F,
+ 0xF992FA1D,0x4CF670C9,0x067DFD31,0xA7A3E1A5,0x8CD7D9DF,0x972CCB34,
+ 0x67C82156,0xD548F6A8,0x045CEC21,0xF3240BFB,0xDEF656A7,0x43DE08C5,
+ 0xDAD1F92F,0x3726C56B,0x1409F19A,0x942FD147,0xB926749C,0xADDC31B8,
+ 0x53D0D869,0xD1BA52FE,0x6722DF8C,0x22D95A74,0x7DC1B52A,0x1DEC6FD5,
+ 0x7262874D,0x0A725DC9,0xE6A8193D,0xA052835A,0xDC9AD928,0xE59EBB90,
+ 0x70DBA9FF,0xD612749D,0x5A5A638C,0x6086EC37,0x2A579709,0x1449EA3A,
+ 0xBC8E3C06,0x2F900666,0xFBE74FD1,0x6B35B911,0xF8335008,0xEF1E979D,
+ 0x738AB29D,0xA2DC0FDC,0x7696305D,0xF5429DAC,0x8C41813B,0x8073E02E,
+ 0xBEF83CCD,0x7B50A95A,0x05EE5862,0x00829ECE,0x8CA1958C,0xBE4EA2E2,
+ 0x4293BB73,0x656F7B23,0x417316D8,0x4467D7CF,0x2200E63B,0x109050C8,
+ 0x814CBE47,0x36B1D4A8,0x36AF9305,0x308327B3,0xEBCD7344,0xA738DE27,
+ 0x5A10C399,0x4142371D,0x64A18528,0x0B31E8B2,0x641057B9,0x6AFC363B,
+ 0x108AD953,0x9D4DA234,0x0C2D9159,0x1C8A1A1F,0x310C66BA,0x87AA1070,
+ 0xDAC832FF,0x0A433422,0x7AF15812,0x2D8D9BD0,0x995A25E9,0x25326CAC,
+ 0xA34384DB,0x4C8421CC,0x4F0315EC,0x29E8649E,0xA7732D6F,0x2E94D3E3,
+ 0x7D98A340,0x397C4D74,0x659DB4DE,0x747D4E9A,0xD9DB8435,0x4659DBE9,
+ 0x313E6DC5,0x29D104DC,0x9F226CBA,0x452F18B0,0xD0BC5068,0x844CA299,
+ 0x782B294E,0x4AE2EB7B,0xA4C475F8,0x70A81311,0x4B3E8BCC,0x7E20D4BA,
+ 0xABCA33C9,0x57BE2960,0x44F9B419,0x2E567746,0x72EB757A,0x102CC0E8,
+ 0xB07F32B9,0xD0DABD59,0xBA85AD6B,0xF3E20667,0x98D77D81,0x197AFA47,
+ 0x518EE9AC,0xE10CE5A2,0x01CF2C2A,0xD3A3AF3D,0x16DDFD65,0x669232F8,
+ 0x1C50A301,0xB93D9151,0x9354D3F4,0x847D79D0,0xD5FE2EC6,0x1F7B0610,
+ 0xFA6B90A5,0xC5879041,0x2E7DC05E,0x423F1F32,0xEF623DDB,0x49C13280,
+ 0x98714E92,0xC7B6E4AD,0xC4318466,0x0737F312,0x4D3C003F,0x9ACC1F1F,
+ 0x5F1C926D,0x085FA771,0x185A83A2,0xF9AA159D,0x0B0B0132,0xF98E7A43,
+ 0xCD9EBDBE,0x0190CB29,0x10D93FB6,0x3B8A4D97,0x66A65A41,0xE43E766F,
+ 0x77BE3C41,0xB9686364,0xCB36994D,0x6846A287,0x567E77F7,0x36178DD8,
+ 0xBDE6B1F2,0xB6EFDC64,0x82950324,0x42053F47,0xC09BE51C,0x0942D762,
+ 0x35F92C7F,0x367DEC61,0x6EE3D983,0xDBAAF78A,0x265D2C47,0x8EB4BF5C,
+ 0x33B232D7,0xB0137E77,0x373C39A7,0x8D2B2E76,0xC7510F01,0x50F9E032,
+ 0x7B1FDDDB,0x724C2AAE,0xB10ECB31,0xCCA3D1B8,0x7F0BCF10,0x4254BBBD,
+ 0xE3F93B97,0x2305039B,0x53120E22,0x1A2F3B9A,0x0FDDBD97,0x0118561E,
+ 0x0A798E13,0x9E0B3ACD,0xDB6C9F15,0xF512D0A2,0x9E8C3A28,0xEE2184AE,
+ 0x0051EC2F,0x2432F74F,0xB0AA66EA,0x55128D88,0xF7D83A38,0x4DAE8E82,
+ 0x3FDC98D6,0x5F0BD341,0x7244BE1D,0xC7B48E78,0x2D473053,0x43892E20,
+ 0xBA0F1F2A,0x524D4895,0x2E10BCB1,0x4C372D81,0x5C3E50CD,0xCF61CC2E,
+ 0x931709AB,0x81B3AEFC,0x39E9405E,0x7FFE108C,0x4FBB3FF8,0x06ABE450,
+ 0x7F5BF51E,0xA4E3CDFD,0xDB0F6C6F,0x159A1227,0x3B9FED55,0xD20B6F7F,
+ 0xFBE9CC83,0x64856619,0xBF52B8AF,0x9D7006B0,0x71165BC6,0xAE324AEE,
+ 0x29D27F2C,0x794C2086,0x74445CE2,0x782915CC,0xD4CE6886,0x3289AE7C,
+ 0x53DEF297,0x4185F7ED,0x88B72400,0x3C09DC11,0xBCE3AAB6,0x6A75934A,
+ 0xB267E399,0x000DF1BF,0x193BA5E2,0xFA3E1977,0x179E14F6,0x1EEDE298,
+ 0x691F0B06,0xB84F78AC,0xC1C15316,0xFFFF3AD6,0x0B457383,0x518CD612,
+ 0x05A00F3E,0xD5B7D275,0x4C5ECCD7,0xE02CD0BE,0x5558E9F2,0x0C89BBF0,
+ 0xA3D96227,0x2832D2B2,0xF667B897,0xD4556554,0xF9D2F01F,0xFA1E3FAE,
+ 0x52C2E1EE,0xE5451F31,0x7E849729,0xDABDB67A,0x54BF5E7E,0xF831C271,
+ 0x5F1A17E3,0x9D140AFE,0x92741C47,0x48CFABCE,0x9CBBE477,0x9C3EE57F,
+ 0xB07D4C39,0xCC21BCE2,0x697708B1,0x58DA2A6B,0x2370DB16,0x6E641948,
+ 0xACC5BD52,0x868F24CC,0xCA1DB0F5,0x4CADA492,0x3F443E54,0xC4A4D5E9,
+ 0xF00AD670,0xE93C86E0,0xFE90651A,0xDDE532A3,0xA66458DF,0xAB7D7151,
+ 0x0E2E775F,0xC9109F99,0x8D96D59F,0x73CEF14C,0xC74E88E9,0x02712DC0,
+ 0x04F41735,0x2E5914A2,0x59F4B2FB,0x0287FC83,0x80BC0343,0xF6B32559,
+ 0xC74178D4,0xF1D99123,0x383CCC07,0xACC0637D,0x0863A548,0xA6FCAC85,
+ 0x2A13EFF0,0xAF2EEDB1,0x41E72750,0xE0C6B342,0x5DA22B46,0x635559E0,
+ 0xD2EA40AC,0x10AA98C0,0x19096497,0x112C542B,0x2C85040C,0xA868E7D0,
+ 0x6E260188,0xF596D390,0xC3BB5D7A,0x7A2AA937,0xDFD15032,0x6780AE3B,
+ 0xDB5F9CD8,0x8BD266B0,0x7744AF12,0xB463B1B0,0x589629C9,0xE30DBC6E,
+ 0x880F5569,0x209E6E16,0x9DECA50C,0x02987A57,0xBED3EA57,0xD3A678AA,
+ 0x70DD030D,0x0CFD9C5D,0x92A18E99,0xF5740619,0x7F6F0A7D,0x134CAF9A,
+ 0x70F5BAE4,0x23DCA7B5,0x4D788FCD,0xC7F07847,0xBCF77DA1,0x9071D568,
+ 0xFC627EA1,0xAE004B77,0x66B54BCB,0x7EF2DAAC,0xDCD5AC30,0xB9BDF730,
+ 0x505A97A7,0x9D881FD3,0xADB796CC,0x94A1D202,0x97535D7F,0x31EC20C0,
+ 0xB1887A98,0xC1475069,0xA6F73AF3,0x71E4E067,0x46A569DE,0xD2ADE430,
+ 0x6F0762C7,0xF50876F4,0x53510542,0x03741C3E,0x53502224,0xD8E54D60,
+ 0x3C44AB1A,0x34972B46,0x74BFA89D,0xD7D768E0,0x37E605DC,0xE13D1BDF,
+ 0x5051C421,0xB9E057BE,0xB717A14C,0xA1730C43,0xB99638BE,0xB5D5F36D,
+ 0xE960D9EA,0x6B1388D3,0xECB6D3B6,0xBDBE8B83,0x2E29AFC5,0x764D71EC,
+ 0x4B8F4F43,0xC21DDC00,0xA63F657F,0x82678130,0xDBF535AC,0xA594FC58,
+ 0x942686BC,0xBD9B657B,0x4A0F9B61,0x44FF184F,0x38E10A2F,0x61910626,
+ 0x5E247636,0x7106D137,0xC62802F0,0xBD1D1F00,0x7CC0DCB2,0xED634909,
+ 0xDC13B24E,0x9799C499,0xD77E3D6A,0x14773B68,0x967A4FB7,0x35EECFB1,
+ 0x2A5110B8,0xE2F0AF94,0x9D09DEA5,0x20255D27,0x5771D34B,0xE1089EE4,
+ 0x246F330B,0x8F7CAEE5,0xD3064712,0x75CAFBEE,0xB94F7028,0xED953666,
+ 0x5D1975B4,0x5AF81271,0x13BE2025,0x85194659,0x30805331,0xEC9D46C0,
+ 0xBC027C36,0x2AF84188,0xC2141B80,0xC02B1E4A,0x04D36177,0xFC50E9D7,
+ 0x39CE79DA,0x917E0A00,0xEF7A0BF4,0xA98BD8D1,0x19424DD2,0x9439DF1F,
+ 0xC42AF746,0xADDBE83E,0x85221F0D,0x45563E90,0x9095EC52,0x77887B25,
+ 0x8AE46064,0xBD43B71A,0xBB541956,0x7366CF9D,0xEE8E1737,0xB5A727C9,
+ 0x5076B3E7,0xFC70BACA,0xCE135B75,0xC4E91AA3,0xF0341911,0x53430C3F,
+ 0x886B0824,0x6BB5B8B7,0x33E21254,0xF193B456,0x5B09617F,0x215FFF50,
+ 0x48D97EF1,0x356479AB,0x6EA9DDC4,0x0D352746,0xA2F5CE43,0xB226A1B3,
+ 0x1329EA3C,0x7A337CC2,0xB5CCE13D,0x563E3B5B,0x534E8E8F,0x561399C9,
+ 0xE1596392,0xB0F03125,0x4586645B,0x1F371847,0x94EAABD1,0x41F97EDD,
+ 0xE3E5A39B,0x71C774E2,0x507296F4,0x5960133B,0x7852C494,0x3F5B2691,
+ 0xA3F87774,0x5A7AF89E,0x17DA3F28,0xE9D9516D,0xFCC1C1D5,0xE4618628,
+ 0x04081047,0xD8E4DB5F,0xDC380416,0x8C4933E2,0x95074D53,0xB1B0032D,
+ 0xCC8102EA,0x71641243,0x98D6EB6A,0x90FEC945,0xA0914345,0x6FAB037D,
+ 0x70F49C4D,0x05BF5B0E,0x927AAF7F,0xA1940F61,0xFEE0756F,0xF815369F,
+ 0x5C00253B,0xF2B9762F,0x4AEB3CCC,0x1069F386,0xFBA4E7B9,0x70332665,
+ 0x6BCA810E,0x85AB8058,0xAE4B2B2F,0x9D120712,0xBEE8EACB,0x776A1112
+};
+
+void
+__gmp_mt_recalc_buffer (gmp_uint_least32_t mt[])
+{
+ gmp_uint_least32_t y;
+ int kk;
+
+ for (kk = 0; kk < N - M; kk++)
+ {
+ y = (mt[kk] & 0x80000000) | (mt[kk + 1] & 0x7FFFFFFF);
+ mt[kk] = mt[kk + M] ^ (y >> 1) ^ ((y & 0x01) != 0 ? MATRIX_A : 0);
+ }
+ for (; kk < N - 1; kk++)
+ {
+ y = (mt[kk] & 0x80000000) | (mt[kk + 1] & 0x7FFFFFFF);
+ mt[kk] = mt[kk - (N - M)] ^ (y >> 1) ^ ((y & 0x01) != 0 ? MATRIX_A : 0);
+ }
+
+ y = (mt[N - 1] & 0x80000000) | (mt[0] & 0x7FFFFFFF);
+ mt[N - 1] = mt[M - 1] ^ (y >> 1) ^ ((y & 0x01) != 0 ? MATRIX_A : 0);
+}
+
+
+/* Get nbits bits of output from the generator into dest.
+ Note that Mersenne Twister is designed to produce outputs in
+ 32-bit words. */
+void
+__gmp_randget_mt (gmp_randstate_t rstate, mp_ptr dest, unsigned long int nbits)
+{
+ gmp_uint_least32_t y;
+ int rbits;
+ mp_size_t i;
+ mp_size_t nlimbs;
+ int *pmti;
+ gmp_uint_least32_t *mt;
+
+ pmti = &((gmp_rand_mt_struct *) RNG_STATE (rstate))->mti;
+ mt = ((gmp_rand_mt_struct *) RNG_STATE (rstate))->mt;
+
+ nlimbs = nbits / GMP_NUMB_BITS;
+ rbits = nbits % GMP_NUMB_BITS;
+
+#define NEXT_RANDOM \
+ do \
+ { \
+ if (*pmti >= N) \
+ { \
+ __gmp_mt_recalc_buffer (mt); \
+ *pmti = 0; \
+ } \
+ y = mt[(*pmti)++]; \
+ y ^= (y >> 11); \
+ y ^= (y << 7) & MASK_1; \
+ y ^= (y << 15) & MASK_2; \
+ y ^= (y >> 18); \
+ } \
+ while (0)
+
+
+ /* Handle the common cases of 32- or 64-bit limbs with fast,
+ optimized routines, and the rest of cases with a general
+ routine. In all cases, no more than 31 bits are rejected
+ for the last limb so that every version of the code is
+ consistent with the others. */
+
+#if (GMP_NUMB_BITS == 32)
+
+ for (i = 0; i < nlimbs; i++)
+ {
+ NEXT_RANDOM;
+ dest[i] = (mp_limb_t) y;
+ }
+ if (rbits)
+ {
+ NEXT_RANDOM;
+ dest[nlimbs] = (mp_limb_t) (y & ~(ULONG_MAX << rbits));
+ }
+
+#else /* GMP_NUMB_BITS != 32 */
+#if (GMP_NUMB_BITS == 64)
+
+ for (i = 0; i < nlimbs; i++)
+ {
+ NEXT_RANDOM;
+ dest[i] = (mp_limb_t) y;
+ NEXT_RANDOM;
+ dest[i] |= (mp_limb_t) y << 32;
+ }
+ if (rbits)
+ {
+ if (rbits < 32)
+ {
+ NEXT_RANDOM;
+ dest[nlimbs] = (mp_limb_t) (y & ~(ULONG_MAX << rbits));
+ }
+ else
+ {
+ NEXT_RANDOM;
+ dest[nlimbs] = (mp_limb_t) y;
+ if (rbits > 32)
+ {
+ NEXT_RANDOM;
+ dest[nlimbs] |=
+ ((mp_limb_t) (y & ~(ULONG_MAX << (rbits-32)))) << 32;
+ }
+ }
+ }
+
+#else /* GMP_NUMB_BITS != 64 */
+
+ {
+ /* Fall back to a general algorithm. This algorithm works by
+ keeping a pool of up to 64 bits (2 outputs from MT) acting
+ as a shift register from which bits are consumed as needed.
+ Bits are consumed using the LSB bits of bitpool_l, and
+ inserted via bitpool_h and shifted to the right place. */
+
+ gmp_uint_least32_t bitpool_h = 0;
+ gmp_uint_least32_t bitpool_l = 0;
+ int bits_in_pool = 0; /* Holds number of valid bits in the pool. */
+ int bits_to_fill; /* Holds total number of bits to put in
+ destination. */
+ int bitidx; /* Holds the destination bit position. */
+ mp_size_t nlimbs2; /* Number of whole+partial limbs to fill. */
+
+ nlimbs2 = nlimbs + (rbits != 0);
+
+ for (i = 0; i < nlimbs2; i++)
+ {
+ bitidx = 0;
+ if (i < nlimbs)
+ bits_to_fill = GMP_NUMB_BITS;
+ else
+ bits_to_fill = rbits;
+
+ dest[i] = CNST_LIMB (0);
+ while (bits_to_fill >= 32) /* Process whole 32-bit blocks first. */
+ {
+ if (bits_in_pool < 32) /* Need more bits. */
+ {
+ /* 64-bit right shift. */
+ NEXT_RANDOM;
+ bitpool_h = y;
+ bitpool_l |= (bitpool_h << bits_in_pool) & 0xFFFFFFFF;
+ if (bits_in_pool == 0)
+ bitpool_h = 0;
+ else
+ bitpool_h >>= 32 - bits_in_pool;
+ bits_in_pool += 32; /* We've got 32 more bits. */
+ }
+
+ /* Fill a 32-bit chunk. */
+ dest[i] |= ((mp_limb_t) bitpool_l) << bitidx;
+ bitpool_l = bitpool_h;
+ bits_in_pool -= 32;
+ bits_to_fill -= 32;
+ bitidx += 32;
+ }
+
+ /* Cover the case where GMP_NUMB_BITS is not a multiple of 32. */
+ if (bits_to_fill != 0)
+ {
+ if (bits_in_pool < bits_to_fill)
+ {
+ NEXT_RANDOM;
+ bitpool_h = y;
+ bitpool_l |= (bitpool_h << bits_in_pool) & 0xFFFFFFFF;
+ if (bits_in_pool == 0)
+ bitpool_h = 0;
+ else
+ bitpool_h >>= 32 - bits_in_pool;
+ bits_in_pool += 32;
+ }
+
+ dest[i] |= (((mp_limb_t) bitpool_l
+ & ~(~CNST_LIMB (0) << bits_to_fill))
+ << bitidx);
+ bitpool_l = ((bitpool_l >> bits_to_fill)
+ | (bitpool_h << (32 - bits_to_fill))) & 0xFFFFFFFF;
+ bitpool_h >>= bits_to_fill;
+ bits_in_pool -= bits_to_fill;
+ }
+ }
+ }
+
+#endif /* GMP_NUMB_BITS != 64 */
+#endif /* GMP_NUMB_BITS != 32 */
+}
+
+void
+__gmp_randclear_mt (gmp_randstate_t rstate)
+{
+ (*__gmp_free_func) ((void *) RNG_STATE (rstate),
+ ALLOC (rstate->_mp_seed) * GMP_LIMB_BYTES);
+}
+
+void __gmp_randiset_mt (gmp_randstate_ptr, gmp_randstate_srcptr);
+
+static const gmp_randfnptr_t Mersenne_Twister_Generator_Noseed = {
+ NULL,
+ __gmp_randget_mt,
+ __gmp_randclear_mt,
+ __gmp_randiset_mt
+};
+
+void
+__gmp_randiset_mt (gmp_randstate_ptr dst, gmp_randstate_srcptr src)
+{
+ const mp_size_t sz = ((sizeof (gmp_rand_mt_struct) - 1) / GMP_LIMB_BYTES) + 1;
+ gmp_rand_mt_struct *dstp, *srcp;
+ mp_size_t i;
+
+ /* Set the generator functions. */
+ RNG_FNPTR (dst) = (void *) &Mersenne_Twister_Generator_Noseed;
+
+ /* Allocate the MT-specific state. */
+ dstp = (gmp_rand_mt_struct *) __GMP_ALLOCATE_FUNC_LIMBS (sz);
+ RNG_STATE (dst) = (mp_ptr) dstp;
+ ALLOC (dst->_mp_seed) = sz; /* Initialize alloc field to placate Camm. */
+
+ /* Copy state. */
+ srcp = (gmp_rand_mt_struct *) RNG_STATE (src);
+ for (i = 0; i < N; i++)
+ dstp->mt[i] = srcp->mt[i];
+
+ dstp->mti = srcp->mti;
+}
+
+void
+__gmp_randinit_mt_noseed (gmp_randstate_ptr dst)
+{
+ const mp_size_t sz = ((sizeof (gmp_rand_mt_struct) - 1) / GMP_LIMB_BYTES) + 1;
+ gmp_rand_mt_struct *dstp;
+ mp_size_t i;
+
+ /* Set the generator functions. */
+ RNG_FNPTR (dst) = (void *) &Mersenne_Twister_Generator_Noseed;
+
+ /* Allocate the MT-specific state. */
+ dstp = (gmp_rand_mt_struct *) __GMP_ALLOCATE_FUNC_LIMBS (sz);
+ RNG_STATE (dst) = (mp_ptr) dstp;
+ ALLOC (dst->_mp_seed) = sz; /* Initialize alloc field to placate Camm. */
+
+ /* Set state for default seed. */
+ for (i = 0; i < N; i++)
+ dstp->mt[i] = default_state[i];
+
+ dstp->mti = WARM_UP % N;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/rand/randmt.h b/Build/source/libs/gmp/gmp-6.0.0/rand/randmt.h
new file mode 100644
index 00000000000..d64ff59548d
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/rand/randmt.h
@@ -0,0 +1,51 @@
+/* Mersenne Twister pseudo-random number generator defines.
+
+Copyright 2002, 2003 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/. */
+
+
+/* Number of extractions used to warm the buffer up. */
+#define WARM_UP 2000
+
+/* Period parameters. */
+#define N 624
+#define M 397
+#define MATRIX_A 0x9908B0DF /* Constant vector a. */
+
+/* State structure for MT. */
+typedef struct
+{
+ gmp_uint_least32_t mt[N]; /* State array. */
+ int mti; /* Index of current value. */
+} gmp_rand_mt_struct;
+
+
+void __gmp_mt_recalc_buffer (gmp_uint_least32_t *);
+void __gmp_randget_mt (gmp_randstate_t, mp_ptr, unsigned long int);
+void __gmp_randclear_mt (gmp_randstate_t);
+void __gmp_randiset_mt (gmp_randstate_ptr, gmp_randstate_srcptr);
diff --git a/Build/source/libs/gmp/gmp-6.0.0/rand/randmts.c b/Build/source/libs/gmp/gmp-6.0.0/rand/randmts.c
new file mode 100644
index 00000000000..1db7855141c
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/rand/randmts.c
@@ -0,0 +1,165 @@
+/* Mersenne Twister pseudo-random number generator functions.
+
+Copyright 2002, 2003, 2013 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.h"
+#include "gmp-impl.h"
+#include "randmt.h"
+
+
+/* Calculate (b^e) mod (2^n-k) for e=1074888996, n=19937 and k=20023,
+ needed by the seeding function below. */
+static void
+mangle_seed (mpz_ptr r)
+{
+ mpz_t t, b;
+ unsigned long e = 0x40118124;
+ unsigned long bit = 0x20000000;
+
+ mpz_init2 (t, 19937L);
+ mpz_init_set (b, r);
+
+ do
+ {
+ mpz_mul (r, r, r);
+
+ reduce:
+ for (;;)
+ {
+ mpz_tdiv_q_2exp (t, r, 19937L);
+ if (SIZ (t) == 0)
+ break;
+ mpz_tdiv_r_2exp (r, r, 19937L);
+ mpz_addmul_ui (r, t, 20023L);
+ }
+
+ if ((e & bit) != 0)
+ {
+ e ^= bit;
+ mpz_mul (r, r, b);
+ goto reduce;
+ }
+
+ bit >>= 1;
+ }
+ while (bit != 0);
+
+ mpz_clear (t);
+ mpz_clear (b);
+}
+
+
+/* Seeding function. Uses powering modulo a non-Mersenne prime to obtain
+ a permutation of the input seed space. The modulus is 2^19937-20023,
+ which is probably prime. The power is 1074888996. In order to avoid
+ seeds 0 and 1 generating invalid or strange output, the input seed is
+ first manipulated as follows:
+
+ seed1 = seed mod (2^19937-20027) + 2
+
+ so that seed1 lies between 2 and 2^19937-20026 inclusive. Then the
+ powering is performed as follows:
+
+ seed2 = (seed1^1074888996) mod (2^19937-20023)
+
+ and then seed2 is used to bootstrap the buffer.
+
+ This method aims to give guarantees that:
+ a) seed2 will never be zero,
+ b) seed2 will very seldom have a very low population of ones in its
+ binary representation, and
+ c) every seed between 0 and 2^19937-20028 (inclusive) will yield a
+ different sequence.
+
+ CAVEATS:
+
+ The period of the seeding function is 2^19937-20027. This means that
+ with seeds 2^19937-20027, 2^19937-20026, ... the exact same sequences
+ are obtained as with seeds 0, 1, etc.; it also means that seed -1
+ produces the same sequence as seed 2^19937-20028, etc.
+ */
+
+static void
+randseed_mt (gmp_randstate_t rstate, mpz_srcptr seed)
+{
+ int i;
+ size_t cnt;
+
+ gmp_rand_mt_struct *p;
+ mpz_t mod; /* Modulus. */
+ mpz_t seed1; /* Intermediate result. */
+
+ p = (gmp_rand_mt_struct *) RNG_STATE (rstate);
+
+ mpz_init2 (mod, 19937L);
+ mpz_init2 (seed1, 19937L);
+
+ mpz_setbit (mod, 19937L);
+ mpz_sub_ui (mod, mod, 20027L);
+ mpz_mod (seed1, seed, mod); /* Reduce `seed' modulo `mod'. */
+ mpz_clear (mod);
+ mpz_add_ui (seed1, seed1, 2L); /* seed1 is now ready. */
+ mangle_seed (seed1); /* Perform the mangling by powering. */
+
+ /* Copy the last bit into bit 31 of mt[0] and clear it. */
+ p->mt[0] = (mpz_tstbit (seed1, 19936L) != 0) ? 0x80000000 : 0;
+ mpz_clrbit (seed1, 19936L);
+
+ /* Split seed1 into N-1 32-bit chunks. */
+ mpz_export (&p->mt[1], &cnt, -1, sizeof (p->mt[1]), 0,
+ 8 * sizeof (p->mt[1]) - 32, seed1);
+ mpz_clear (seed1);
+ cnt++;
+ ASSERT (cnt <= N);
+ while (cnt < N)
+ p->mt[cnt++] = 0;
+
+ /* Warm the generator up if necessary. */
+ if (WARM_UP != 0)
+ for (i = 0; i < WARM_UP / N; i++)
+ __gmp_mt_recalc_buffer (p->mt);
+
+ p->mti = WARM_UP % N;
+}
+
+
+static const gmp_randfnptr_t Mersenne_Twister_Generator = {
+ randseed_mt,
+ __gmp_randget_mt,
+ __gmp_randclear_mt,
+ __gmp_randiset_mt
+};
+
+/* Initialize MT-specific data. */
+void
+gmp_randinit_mt (gmp_randstate_t rstate)
+{
+ __gmp_randinit_mt_noseed (rstate);
+ RNG_FNPTR (rstate) = (void *) &Mersenne_Twister_Generator;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/rand/randmui.c b/Build/source/libs/gmp/gmp-6.0.0/rand/randmui.c
new file mode 100644
index 00000000000..2d4ef86aa32
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/rand/randmui.c
@@ -0,0 +1,86 @@
+/* gmp_urandomm_ui -- uniform random number 0 to N-1 for ulong N.
+
+Copyright 2003, 2004 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.h"
+#include "gmp-impl.h"
+#include "longlong.h"
+
+
+/* If n is a power of 2 then the test ret<n is always true and the loop is
+ unnecessary, but there's no need to add special code for this. Just get
+ the "bits" calculation correct and let it go through normally.
+
+ If n is 1 then will have bits==0 and _gmp_rand will produce no output and
+ we always return 0. Again there seems no need for a special case, just
+ initialize a[0]=0 and let it go through normally. */
+
+#define MAX_URANDOMM_ITER 80
+
+unsigned long
+gmp_urandomm_ui (gmp_randstate_ptr rstate, unsigned long n)
+{
+ mp_limb_t a[LIMBS_PER_ULONG];
+ unsigned long ret, bits, leading;
+ int i;
+
+ if (UNLIKELY (n == 0))
+ DIVIDE_BY_ZERO;
+
+ /* start with zeros, since if bits==0 then _gmp_rand will store nothing at
+ all (bits==0 arises when n==1), or if bits <= GMP_NUMB_BITS then it
+ will store only a[0]. */
+ a[0] = 0;
+#if LIMBS_PER_ULONG > 1
+ a[1] = 0;
+#endif
+
+ count_leading_zeros (leading, (mp_limb_t) n);
+ bits = GMP_LIMB_BITS - leading - (POW2_P(n) != 0);
+
+ for (i = 0; i < MAX_URANDOMM_ITER; i++)
+ {
+ _gmp_rand (a, rstate, bits);
+#if LIMBS_PER_ULONG == 1
+ ret = a[0];
+#else
+ ret = a[0] | (a[1] << GMP_NUMB_BITS);
+#endif
+ if (LIKELY (ret < n)) /* usually one iteration suffices */
+ goto done;
+ }
+
+ /* Too many iterations, there must be something degenerate about the
+ rstate algorithm. Return r%n. */
+ ret -= n;
+ ASSERT (ret < n);
+
+ done:
+ return ret;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/rand/rands.c b/Build/source/libs/gmp/gmp-6.0.0/rand/rands.c
new file mode 100644
index 00000000000..1701da7a2c0
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/rand/rands.c
@@ -0,0 +1,42 @@
+/* __gmp_rands -- global random state for old-style random functions.
+
+ EVERYTHING IN THIS FILE IS FOR INTERNAL USE ONLY. IT'S ALMOST CERTAIN TO
+ BE SUBJECT TO INCOMPATIBLE CHANGES OR DISAPPEAR COMPLETELY IN FUTURE GNU
+ MP RELEASES. */
+
+/*
+Copyright 2001 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.h"
+#include "gmp-impl.h"
+
+
+/* Use this via the RANDS macro in gmp-impl.h */
+char __gmp_rands_initialized = 0;
+gmp_randstate_t __gmp_rands;
diff --git a/Build/source/libs/gmp/gmp-6.0.0/rand/randsd.c b/Build/source/libs/gmp/gmp-6.0.0/rand/randsd.c
new file mode 100644
index 00000000000..1214d000d53
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/rand/randsd.c
@@ -0,0 +1,39 @@
+/* gmp_randseed (state, seed) -- Set initial seed SEED in random state STATE.
+
+Copyright 2000, 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/. */
+
+#include "gmp.h"
+#include "gmp-impl.h"
+
+void
+gmp_randseed (gmp_randstate_t rstate,
+ mpz_srcptr seed)
+{
+ (*((gmp_randfnptr_t *) RNG_FNPTR (rstate))->randseed_fn) (rstate, seed);
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/rand/randsdui.c b/Build/source/libs/gmp/gmp-6.0.0/rand/randsdui.c
new file mode 100644
index 00000000000..1c97232e30e
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/rand/randsdui.c
@@ -0,0 +1,44 @@
+/* gmp_randseed_ui (state, seed) -- Set initial seed SEED in random
+ state STATE.
+
+Copyright 2000, 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/. */
+
+#include "gmp.h"
+#include "gmp-impl.h"
+
+void
+gmp_randseed_ui (gmp_randstate_t rstate,
+ unsigned long int seed)
+{
+ mpz_t zseed;
+ mp_limb_t zlimbs[LIMBS_PER_ULONG];
+
+ MPZ_FAKE_UI (zseed, zlimbs, seed);
+ gmp_randseed (rstate, zseed);
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/scanf/Makefile.am b/Build/source/libs/gmp/gmp-6.0.0/scanf/Makefile.am
new file mode 100644
index 00000000000..b5e01482224
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/scanf/Makefile.am
@@ -0,0 +1,38 @@
+## Process this file with automake to generate Makefile.in
+
+# Copyright 2001, 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/.
+
+
+INCLUDES = -D__GMP_WITHIN_GMP -I$(top_srcdir)
+
+noinst_LTLIBRARIES = libscanf.la
+
+libscanf_la_SOURCES = \
+ doscan.c fscanf.c fscanffuns.c scanf.c sscanf.c sscanffuns.c \
+ vfscanf.c vscanf.c vsscanf.c
diff --git a/Build/source/libs/gmp/gmp-6.0.0/scanf/doscan.c b/Build/source/libs/gmp/gmp-6.0.0/scanf/doscan.c
new file mode 100644
index 00000000000..47b22706ced
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/scanf/doscan.c
@@ -0,0 +1,768 @@
+/* __gmp_doscan -- formatted input internals.
+
+ 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-2003 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 _GNU_SOURCE /* for DECIMAL_POINT in langinfo.h */
+
+#include "config.h" /* needed for the HAVE_, could also move gmp incls */
+
+#include <stdarg.h>
+#include <ctype.h>
+#include <stddef.h> /* for ptrdiff_t */
+#include <stdio.h>
+#include <stdlib.h> /* for strtol */
+#include <string.h>
+
+#if HAVE_LANGINFO_H
+#include <langinfo.h> /* for nl_langinfo */
+#endif
+
+#if HAVE_LOCALE_H
+#include <locale.h> /* for localeconv */
+#endif
+
+#if HAVE_INTTYPES_H
+# include <inttypes.h> /* for intmax_t */
+#else
+# if HAVE_STDINT_H
+# include <stdint.h>
+# endif
+#endif
+
+#if HAVE_SYS_TYPES_H
+#include <sys/types.h> /* for quad_t */
+#endif
+
+#include "gmp.h"
+#include "gmp-impl.h"
+
+
+/* Change this to "#define TRACE(x) x" for some traces. */
+#define TRACE(x)
+
+
+/* General:
+
+ It's necessary to parse up the format string to recognise the GMP
+ extra types F, Q and Z. Other types and conversions are passed
+ across to the standard sscanf or fscanf via funs->scan, for ease of
+ implementation. This is essential in the case of something like glibc
+ %p where the pointer format isn't actually documented.
+
+ Because funs->scan doesn't get the whole input it can't put the right
+ values in for %n, so that's handled in __gmp_doscan. Neither sscanf
+ nor fscanf directly indicate how many characters were read, so an
+ extra %n is appended to each run for that. For fscanf this merely
+ supports our %n output, but for sscanf it lets funs->step move us
+ along the input string.
+
+ Whitespace and literal matches in the format string, including %%,
+ are handled directly within __gmp_doscan. This is reasonably
+ efficient, and avoids some suspicious behaviour observed in various
+ system libc's. GLIBC 2.2.4 for instance returns 0 on
+
+ sscanf(" ", " x")
+ or
+ sscanf(" ", " x%d",&n)
+
+ whereas we think they should return EOF, since end-of-string is
+ reached when a match of "x" is required.
+
+ For standard % conversions, funs->scan is called once for each
+ conversion. If we had vfscanf and vsscanf and could rely on their
+ fixed text matching behaviour then we could call them with multiple
+ consecutive standard conversions. But plain fscanf and sscanf work
+ fine, and parsing one field at a time shouldn't be too much of a
+ slowdown.
+
+ gmpscan:
+
+ gmpscan reads a gmp type. It's only used from one place, but is a
+ separate subroutine to avoid a big chunk of complicated code in the
+ middle of __gmp_doscan. Within gmpscan a couple of loopbacks make it
+ possible to share code for parsing integers, rationals and floats.
+
+ In gmpscan normally one char of lookahead is maintained, but when width
+ is reached that stops, on the principle that an fgetc/ungetc of a char
+ past where we're told to stop would be undesirable. "chars" is how many
+ characters have been read so far, including the current c. When
+ chars==width and another character is desired then a jump is done to the
+ "convert" stage. c is invalid and mustn't be unget'ed in this case;
+ chars is set to width+1 to indicate that.
+
+ gmpscan normally returns the number of characters read. -1 means an
+ invalid field, -2 means EOF reached before any matching characters
+ were read.
+
+ For hex floats, the mantissa part is passed to mpf_set_str, then the
+ exponent is applied with mpf_mul_exp or mpf_div_2exp. This is easier
+ than teaching mpf_set_str about an exponent factor (ie. 2) differing
+ from the mantissa radix point factor (ie. 16). mpf_mul_exp and
+ mpf_div_2exp will preserve the application requested precision, so
+ nothing in that respect is lost by making this a two-step process.
+
+ Matching and errors:
+
+ C99 7.19.6.2 paras 9 and 10 say an input item is read as the longest
+ string which is a match for the appropriate type, or a prefix of a
+ match. With that done, if it's only a prefix then the result is a
+ matching failure, ie. invalid input.
+
+ This rule seems fairly clear, but doesn't seem to be universally
+ applied in system C libraries. Even GLIBC doesn't seem to get it
+ right, insofar as it seems to accept some apparently invalid forms.
+ Eg. glibc 2.3.1 accepts "0x" for a "%i", where a reading of the
+ standard would suggest a non-empty sequence of digits should be
+ required after an "0x".
+
+ A footnote to 7.19.6.2 para 17 notes how this input item reading can
+ mean inputs acceptable to strtol are not acceptable to fscanf. We
+ think this confirms our reading of "0x" as invalid.
+
+ Clearly gmp_sscanf could backtrack to a longest input which was a
+ valid match for a given item, but this is not done, since C99 says
+ sscanf is identical to fscanf, so we make gmp_sscanf identical to
+ gmp_fscanf.
+
+ Types:
+
+ C99 says "ll" is for long long, and "L" is for long double floats.
+ Unfortunately in GMP 4.1.1 we documented the two as equivalent. This
+ doesn't affect us directly, since both are passed through to plain
+ scanf. It seems wisest not to try to enforce the C99 rule. This is
+ consistent with what we said before, though whether it actually
+ worked was always up to the C library.
+
+ Alternatives:
+
+ Consideration was given to using separate code for gmp_fscanf and
+ gmp_sscanf. The sscanf case could zip across a string doing literal
+ matches or recognising digits in gmpscan, rather than making a
+ function call fun->get per character. The fscanf could use getc
+ rather than fgetc too, which might help those systems where getc is a
+ macro or otherwise inlined. But none of this scanning and converting
+ will be particularly fast, so the two are done together to keep it a
+ little simpler for now.
+
+ Various multibyte string issues are not addressed, for a start C99
+ scanf says the format string is multibyte. Since we pass %c, %s and
+ %[ to the system scanf, they might do multibyte reads already, but
+ it's another matter whether or not that can be used, since our digit
+ and whitespace parsing is only unibyte. The plan is to quietly
+ ignore multibyte locales for now. This is not as bad as it sounds,
+ since GMP is presumably used mostly on numbers, which can be
+ perfectly adequately treated in plain ASCII.
+
+*/
+
+
+struct gmp_doscan_params_t {
+ int base;
+ int ignore;
+ char type;
+ int width;
+};
+
+
+#define GET(c) \
+ do { \
+ ASSERT (chars <= width); \
+ chars++; \
+ if (chars > width) \
+ goto convert; \
+ (c) = (*funs->get) (data); \
+ } while (0)
+
+/* store into "s", extending if necessary */
+#define STORE(c) \
+ do { \
+ ASSERT (s_upto <= s_alloc); \
+ if (s_upto >= s_alloc) \
+ { \
+ size_t s_alloc_new = s_alloc + S_ALLOC_STEP; \
+ s = __GMP_REALLOCATE_FUNC_TYPE (s, s_alloc, s_alloc_new, char); \
+ s_alloc = s_alloc_new; \
+ } \
+ s[s_upto++] = c; \
+ } while (0)
+
+#define S_ALLOC_STEP 512
+
+static int
+gmpscan (const struct gmp_doscan_funs_t *funs, void *data,
+ const struct gmp_doscan_params_t *p, void *dst)
+{
+ int chars, c, base, first, width, seen_point, seen_digit, hexfloat;
+ size_t s_upto, s_alloc, hexexp;
+ char *s;
+ int invalid = 0;
+
+ TRACE (printf ("gmpscan\n"));
+
+ ASSERT (p->type == 'F' || p->type == 'Q' || p->type == 'Z');
+
+ c = (*funs->get) (data);
+ if (c == EOF)
+ return -2;
+
+ chars = 1;
+ first = 1;
+ seen_point = 0;
+ width = (p->width == 0 ? INT_MAX-1 : p->width);
+ base = p->base;
+ s_alloc = S_ALLOC_STEP;
+ s = __GMP_ALLOCATE_FUNC_TYPE (s_alloc, char);
+ s_upto = 0;
+ hexfloat = 0;
+ hexexp = 0;
+
+ another:
+ seen_digit = 0;
+ if (c == '-')
+ {
+ STORE (c);
+ goto get_for_sign;
+ }
+ else if (c == '+')
+ {
+ /* don't store '+', it's not accepted by mpz_set_str etc */
+ get_for_sign:
+ GET (c);
+ }
+
+ if (base == 0)
+ {
+ base = 10; /* decimal if no base indicator */
+ if (c == '0')
+ {
+ seen_digit = 1; /* 0 alone is a valid number */
+ if (p->type != 'F')
+ base = 8; /* leading 0 is octal, for non-floats */
+ STORE (c);
+ GET (c);
+ if (c == 'x' || c == 'X')
+ {
+ base = 16;
+ seen_digit = 0; /* must have digits after an 0x */
+ if (p->type == 'F') /* don't pass 'x' to mpf_set_str_point */
+ hexfloat = 1;
+ else
+ STORE (c);
+ GET (c);
+ }
+ }
+ }
+
+ digits:
+ for (;;)
+ {
+ if (base == 16)
+ {
+ if (! isxdigit (c))
+ break;
+ }
+ else
+ {
+ if (! isdigit (c))
+ break;
+ if (base == 8 && (c == '8' || c == '9'))
+ break;
+ }
+
+ seen_digit = 1;
+ STORE (c);
+ GET (c);
+ }
+
+ if (first)
+ {
+ /* decimal point */
+ if (p->type == 'F' && ! seen_point)
+ {
+ /* For a multi-character decimal point, if the first character is
+ present then all of it must be, otherwise the input is
+ considered invalid. */
+ const char *point = GMP_DECIMAL_POINT;
+ int pc = (unsigned char) *point++;
+ if (c == pc)
+ {
+ for (;;)
+ {
+ STORE (c);
+ GET (c);
+ pc = (unsigned char) *point++;
+ if (pc == '\0')
+ break;
+ if (c != pc)
+ goto set_invalid;
+ }
+ seen_point = 1;
+ goto digits;
+ }
+ }
+
+ /* exponent */
+ if (p->type == 'F')
+ {
+ if (hexfloat && (c == 'p' || c == 'P'))
+ {
+ hexexp = s_upto; /* exponent location */
+ base = 10; /* exponent in decimal */
+ goto exponent;
+ }
+ else if (! hexfloat && (c == 'e' || c == 'E'))
+ {
+ exponent:
+ /* must have at least one digit in the mantissa, just an exponent
+ is not good enough */
+ if (! seen_digit)
+ goto set_invalid;
+
+ do_second:
+ first = 0;
+ STORE (c);
+ GET (c);
+ goto another;
+ }
+ }
+
+ /* denominator */
+ if (p->type == 'Q' && c == '/')
+ {
+ /* must have at least one digit in the numerator */
+ if (! seen_digit)
+ goto set_invalid;
+
+ /* now look for at least one digit in the denominator */
+ seen_digit = 0;
+
+ /* allow the base to be redetermined for "%i" */
+ base = p->base;
+ goto do_second;
+ }
+ }
+
+ convert:
+ if (! seen_digit)
+ {
+ set_invalid:
+ invalid = 1;
+ goto done;
+ }
+
+ if (! p->ignore)
+ {
+ STORE ('\0');
+ TRACE (printf (" convert \"%s\"\n", s));
+
+ /* We ought to have parsed out a valid string above, so just test
+ mpz_set_str etc with an ASSERT. */
+ switch (p->type) {
+ case 'F':
+ {
+ mpf_ptr f = (mpf_ptr) dst;
+ if (hexexp != 0)
+ s[hexexp] = '\0';
+ ASSERT_NOCARRY (mpf_set_str (f, s, hexfloat ? 16 : 10));
+ if (hexexp != 0)
+ {
+ char *dummy;
+ long exp;
+ exp = strtol (s + hexexp + 1, &dummy, 10);
+ if (exp >= 0)
+ mpf_mul_2exp (f, f, (unsigned long) exp);
+ else
+ mpf_div_2exp (f, f, - (unsigned long) exp);
+ }
+ }
+ break;
+ case 'Q':
+ ASSERT_NOCARRY (mpq_set_str ((mpq_ptr) dst, s, p->base));
+ break;
+ case 'Z':
+ ASSERT_NOCARRY (mpz_set_str ((mpz_ptr) dst, s, p->base));
+ break;
+ default:
+ ASSERT (0);
+ /*FALLTHRU*/
+ break;
+ }
+ }
+
+ done:
+ ASSERT (chars <= width+1);
+ if (chars != width+1)
+ {
+ (*funs->unget) (c, data);
+ TRACE (printf (" ungetc %d, to give %d chars\n", c, chars-1));
+ }
+ chars--;
+
+ (*__gmp_free_func) (s, s_alloc);
+
+ if (invalid)
+ {
+ TRACE (printf (" invalid\n"));
+ return -1;
+ }
+
+ TRACE (printf (" return %d chars (cf width %d)\n", chars, width));
+ return chars;
+}
+
+
+/* Read and discard whitespace, if any. Return number of chars skipped.
+ Whitespace skipping never provokes the EOF return from __gmp_doscan, so
+ it's not necessary to watch for EOF from funs->get, */
+static int
+skip_white (const struct gmp_doscan_funs_t *funs, void *data)
+{
+ int c;
+ int ret = 0;
+
+ do
+ {
+ c = (funs->get) (data);
+ ret++;
+ }
+ while (isspace (c));
+
+ (funs->unget) (c, data);
+ ret--;
+
+ TRACE (printf (" skip white %d\n", ret));
+ return ret;
+}
+
+
+int
+__gmp_doscan (const struct gmp_doscan_funs_t *funs, void *data,
+ const char *orig_fmt, va_list orig_ap)
+{
+ struct gmp_doscan_params_t param;
+ va_list ap;
+ char *alloc_fmt;
+ const char *fmt, *this_fmt, *end_fmt;
+ size_t orig_fmt_len, alloc_fmt_size, len;
+ int new_fields, new_chars;
+ char fchar;
+ int fields = 0;
+ int chars = 0;
+
+ TRACE (printf ("__gmp_doscan \"%s\"\n", orig_fmt);
+ if (funs->scan == (gmp_doscan_scan_t) sscanf)
+ printf (" s=\"%s\"\n", * (const char **) data));
+
+ /* Don't modify orig_ap, if va_list is actually an array and hence call by
+ reference. It could be argued that it'd be more efficient to leave
+ callers to make a copy if they care, but doing so here is going to be a
+ very small part of the total work, and we may as well keep applications
+ out of trouble. */
+ va_copy (ap, orig_ap);
+
+ /* Parts of the format string are going to be copied so that a " %n" can
+ be appended. alloc_fmt is some space for that. orig_fmt_len+4 will be
+ needed if fmt consists of a single "%" specifier, but otherwise is an
+ overestimate. We're not going to be very fast here, so use
+ __gmp_allocate_func rather than TMP_ALLOC. */
+ orig_fmt_len = strlen (orig_fmt);
+ alloc_fmt_size = orig_fmt_len + 4;
+ alloc_fmt = __GMP_ALLOCATE_FUNC_TYPE (alloc_fmt_size, char);
+
+ fmt = orig_fmt;
+ end_fmt = orig_fmt + orig_fmt_len;
+
+ for (;;)
+ {
+ next:
+ fchar = *fmt++;
+
+ if (fchar == '\0')
+ break;
+
+ if (isspace (fchar))
+ {
+ chars += skip_white (funs, data);
+ continue;
+ }
+
+ if (fchar != '%')
+ {
+ int c;
+ literal:
+ c = (funs->get) (data);
+ if (c != fchar)
+ {
+ (funs->unget) (c, data);
+ if (c == EOF)
+ {
+ eof_no_match:
+ if (fields == 0)
+ fields = EOF;
+ }
+ goto done;
+ }
+ chars++;
+ continue;
+ }
+
+ param.type = '\0';
+ param.base = 0; /* for e,f,g,i */
+ param.ignore = 0;
+ param.width = 0;
+
+ this_fmt = fmt-1;
+ TRACE (printf (" this_fmt \"%s\"\n", this_fmt));
+
+ for (;;)
+ {
+ ASSERT (fmt <= end_fmt);
+
+ fchar = *fmt++;
+ switch (fchar) {
+
+ case '\0': /* unterminated % sequence */
+ ASSERT (0);
+ goto done;
+
+ case '%': /* literal % */
+ goto literal;
+
+ case '[': /* character range */
+ fchar = *fmt++;
+ if (fchar == '^')
+ fchar = *fmt++;
+ /* ']' allowed as the first char (possibly after '^') */
+ if (fchar == ']')
+ fchar = *fmt++;
+ for (;;)
+ {
+ ASSERT (fmt <= end_fmt);
+ if (fchar == '\0')
+ {
+ /* unterminated % sequence */
+ ASSERT (0);
+ goto done;
+ }
+ if (fchar == ']')
+ break;
+ fchar = *fmt++;
+ }
+ /*FALLTHRU*/
+ case 'c': /* characters */
+ case 's': /* string of non-whitespace */
+ case 'p': /* pointer */
+ libc_type:
+ len = fmt - this_fmt;
+ memcpy (alloc_fmt, this_fmt, len);
+ alloc_fmt[len++] = '%';
+ alloc_fmt[len++] = 'n';
+ alloc_fmt[len] = '\0';
+
+ TRACE (printf (" scan \"%s\"\n", alloc_fmt);
+ if (funs->scan == (gmp_doscan_scan_t) sscanf)
+ printf (" s=\"%s\"\n", * (const char **) data));
+
+ new_chars = -1;
+ if (param.ignore)
+ {
+ new_fields = (*funs->scan) (data, alloc_fmt, &new_chars, NULL);
+ ASSERT (new_fields == 0 || new_fields == EOF);
+ }
+ else
+ {
+ void *arg = va_arg (ap, void *);
+ new_fields = (*funs->scan) (data, alloc_fmt, arg, &new_chars);
+ ASSERT (new_fields==0 || new_fields==1 || new_fields==EOF);
+
+ if (new_fields == 0)
+ goto done; /* invalid input */
+
+ if (new_fields == 1)
+ ASSERT (new_chars != -1);
+ }
+ TRACE (printf (" new_fields %d new_chars %d\n",
+ new_fields, new_chars));
+
+ if (new_fields == -1)
+ goto eof_no_match; /* EOF before anything matched */
+
+ /* Under param.ignore, when new_fields==0 we don't know if
+ it's a successful match or an invalid field. new_chars
+ won't have been assigned if it was an invalid field. */
+ if (new_chars == -1)
+ goto done; /* invalid input */
+
+ chars += new_chars;
+ (*funs->step) (data, new_chars);
+
+ increment_fields:
+ if (! param.ignore)
+ fields++;
+ goto next;
+
+ case 'd': /* decimal */
+ case 'u': /* decimal */
+ param.base = 10;
+ goto numeric;
+
+ case 'e': /* float */
+ case 'E': /* float */
+ case 'f': /* float */
+ case 'g': /* float */
+ case 'G': /* float */
+ case 'i': /* integer with base marker */
+ numeric:
+ if (param.type != 'F' && param.type != 'Q' && param.type != 'Z')
+ goto libc_type;
+
+ chars += skip_white (funs, data);
+
+ new_chars = gmpscan (funs, data, &param,
+ param.ignore ? NULL : va_arg (ap, void*));
+ if (new_chars == -2)
+ goto eof_no_match;
+ if (new_chars == -1)
+ goto done;
+
+ ASSERT (new_chars >= 0);
+ chars += new_chars;
+ goto increment_fields;
+
+ case 'a': /* glibc allocate string */
+ case '\'': /* glibc digit groupings */
+ break;
+
+ case 'F': /* mpf_t */
+ case 'j': /* intmax_t */
+ case 'L': /* long long */
+ case 'q': /* quad_t */
+ case 'Q': /* mpq_t */
+ case 't': /* ptrdiff_t */
+ case 'z': /* size_t */
+ case 'Z': /* mpz_t */
+ set_type:
+ param.type = fchar;
+ break;
+
+ case 'h': /* short or char */
+ if (param.type != 'h')
+ goto set_type;
+ param.type = 'H'; /* internal code for "hh" */
+ break;
+
+ goto numeric;
+
+ case 'l': /* long, long long, double or long double */
+ if (param.type != 'l')
+ goto set_type;
+ param.type = 'L'; /* "ll" means "L" */
+ break;
+
+ case 'n':
+ if (! param.ignore)
+ {
+ void *p;
+ p = va_arg (ap, void *);
+ TRACE (printf (" store %%n to %p\n", p));
+ switch (param.type) {
+ case '\0': * (int *) p = chars; break;
+ case 'F': mpf_set_si ((mpf_ptr) p, (long) chars); break;
+ case 'H': * (char *) p = chars; break;
+ case 'h': * (short *) p = chars; break;
+#if HAVE_INTMAX_T
+ case 'j': * (intmax_t *) p = chars; break;
+#else
+ case 'j': ASSERT_FAIL (intmax_t not available); break;
+#endif
+ case 'l': * (long *) p = chars; break;
+#if HAVE_QUAD_T && HAVE_LONG_LONG
+ case 'q':
+ ASSERT_ALWAYS (sizeof (quad_t) == sizeof (long long));
+ /*FALLTHRU*/
+#else
+ case 'q': ASSERT_FAIL (quad_t not available); break;
+#endif
+#if HAVE_LONG_LONG
+ case 'L': * (long long *) p = chars; break;
+#else
+ case 'L': ASSERT_FAIL (long long not available); break;
+#endif
+ case 'Q': mpq_set_si ((mpq_ptr) p, (long) chars, 1L); break;
+#if HAVE_PTRDIFF_T
+ case 't': * (ptrdiff_t *) p = chars; break;
+#else
+ case 't': ASSERT_FAIL (ptrdiff_t not available); break;
+#endif
+ case 'z': * (size_t *) p = chars; break;
+ case 'Z': mpz_set_si ((mpz_ptr) p, (long) chars); break;
+ default: ASSERT (0); break;
+ }
+ }
+ goto next;
+
+ case 'o':
+ param.base = 8;
+ goto numeric;
+
+ case 'x':
+ case 'X':
+ param.base = 16;
+ goto numeric;
+
+ case '0': case '1': case '2': case '3': case '4':
+ case '5': case '6': case '7': case '8': case '9':
+ param.width = 0;
+ do {
+ param.width = param.width * 10 + (fchar-'0');
+ fchar = *fmt++;
+ } while (isdigit (fchar));
+ fmt--; /* unget the non-digit */
+ break;
+
+ case '*':
+ param.ignore = 1;
+ break;
+
+ default:
+ /* something invalid in a % sequence */
+ ASSERT (0);
+ goto next;
+ }
+ }
+ }
+
+ done:
+ (*__gmp_free_func) (alloc_fmt, alloc_fmt_size);
+ return fields;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/scanf/fscanf.c b/Build/source/libs/gmp/gmp-6.0.0/scanf/fscanf.c
new file mode 100644
index 00000000000..83f46169eda
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/scanf/fscanf.c
@@ -0,0 +1,48 @@
+/* gmp_fscanf -- formatted input from a FILE.
+
+Copyright 2001 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 <stdarg.h>
+#include <stdio.h>
+
+#include "gmp.h"
+#include "gmp-impl.h"
+
+
+int
+gmp_fscanf (FILE *fp, const char *fmt, ...)
+{
+ va_list ap;
+ int ret;
+ va_start (ap, fmt);
+
+ ret = __gmp_doscan (&__gmp_fscanf_funs, fp, fmt, ap);
+ va_end (ap);
+ return ret;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/scanf/fscanffuns.c b/Build/source/libs/gmp/gmp-6.0.0/scanf/fscanffuns.c
new file mode 100644
index 00000000000..396e9a175f7
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/scanf/fscanffuns.c
@@ -0,0 +1,62 @@
+/* __gmp_fscanf_funs -- support for formatted input from a 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 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.h"
+#include "gmp-impl.h"
+
+
+/* SunOS 4 stdio.h doesn't provide prototypes for these */
+#if ! HAVE_DECL_FGETC
+int fgetc (FILE *);
+#endif
+#if ! HAVE_DECL_FSCANF
+int fscanf (FILE *, const char *, ...);
+#endif
+#if ! HAVE_DECL_UNGETC
+int ungetc (int, FILE *);
+#endif
+
+
+static void
+step (FILE *fp, int n)
+{
+}
+
+const struct gmp_doscan_funs_t __gmp_fscanf_funs = {
+ (gmp_doscan_scan_t) fscanf,
+ (gmp_doscan_step_t) step,
+ (gmp_doscan_get_t) fgetc,
+ (gmp_doscan_unget_t) ungetc,
+};
diff --git a/Build/source/libs/gmp/gmp-6.0.0/scanf/scanf.c b/Build/source/libs/gmp/gmp-6.0.0/scanf/scanf.c
new file mode 100644
index 00000000000..a944a7c029c
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/scanf/scanf.c
@@ -0,0 +1,48 @@
+/* gmp_scanf -- formatted input from stdin.
+
+Copyright 2001 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 <stdarg.h>
+#include <stdio.h>
+
+#include "gmp.h"
+#include "gmp-impl.h"
+
+
+int
+gmp_scanf (const char *fmt, ...)
+{
+ va_list ap;
+ int ret;
+ va_start (ap, fmt);
+
+ ret = __gmp_doscan (&__gmp_fscanf_funs, stdin, fmt, ap);
+ va_end (ap);
+ return ret;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/scanf/sscanf.c b/Build/source/libs/gmp/gmp-6.0.0/scanf/sscanf.c
new file mode 100644
index 00000000000..b3d12dcda64
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/scanf/sscanf.c
@@ -0,0 +1,53 @@
+/* gmp_sscanf -- formatted input from a string.
+
+Copyright 2001 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 <stdarg.h>
+#include <stdio.h>
+
+#include "gmp.h"
+#include "gmp-impl.h"
+
+
+int
+gmp_sscanf (const char *s, const char *fmt, ...)
+{
+ va_list ap;
+ int ret;
+ va_start (ap, fmt);
+
+#if SSCANF_WRITABLE_INPUT
+ /* let gmp_vsscanf handle the copying */
+ ret = gmp_vsscanf (s, fmt, ap);
+#else
+ ret = __gmp_doscan (&__gmp_sscanf_funs, (void *) &s, fmt, ap);
+#endif
+ va_end (ap);
+ return ret;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/scanf/sscanffuns.c b/Build/source/libs/gmp/gmp-6.0.0/scanf/sscanffuns.c
new file mode 100644
index 00000000000..ed5bdf57d34
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/scanf/sscanffuns.c
@@ -0,0 +1,124 @@
+/* __gmp_sscanf_funs -- support for formatted input from a string.
+
+ 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-2003, 2009 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 <stdarg.h>
+#include "gmp.h"
+#include "gmp-impl.h"
+
+
+#if 0
+static int
+scan (const char **sp, const char *fmt, ...)
+{
+ va_list ap;
+ int ret;
+
+ va_start(ap, fmt);
+ ret = vsscanf(*sp, fmt, ap);
+ va_end(ap);
+
+ return ret;
+}
+#else
+static int
+scan (const char **sp, const char *fmt, ...)
+{
+ va_list ap;
+ void *p1, *p2;
+ int ret;
+
+ va_start (ap, fmt);
+ p1 = va_arg (ap, void *);
+ p2 = va_arg (ap, void *);
+
+ ret = sscanf (*sp, fmt, p1, p2);
+
+ va_end (ap);
+
+ return ret;
+}
+#endif
+
+static void
+step (const char **sp, int n)
+{
+ ASSERT (n >= 0);
+
+ /* shouldn't push us past the end of the string */
+#if WANT_ASSERT
+ {
+ int i;
+ for (i = 0; i < n; i++)
+ ASSERT ((*sp)[i] != '\0');
+ }
+#endif
+
+ (*sp) += n;
+}
+
+static int
+get (const char **sp)
+{
+ const char *s;
+ int c;
+ s = *sp;
+ c = (unsigned char) *s++;
+ if (c == '\0')
+ return EOF;
+ *sp = s;
+ return c;
+}
+
+static void
+unget (int c, const char **sp)
+{
+ const char *s;
+ s = *sp;
+ if (c == EOF)
+ {
+ ASSERT (*s == '\0');
+ return;
+ }
+ s--;
+ ASSERT ((unsigned char) *s == c);
+ *sp = s;
+}
+
+const struct gmp_doscan_funs_t __gmp_sscanf_funs = {
+ (gmp_doscan_scan_t) scan,
+ (gmp_doscan_step_t) step,
+ (gmp_doscan_get_t) get,
+ (gmp_doscan_unget_t) unget,
+};
diff --git a/Build/source/libs/gmp/gmp-6.0.0/scanf/vfscanf.c b/Build/source/libs/gmp/gmp-6.0.0/scanf/vfscanf.c
new file mode 100644
index 00000000000..8011b557549
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/scanf/vfscanf.c
@@ -0,0 +1,42 @@
+/* gmp_vfscanf -- formatted input from a FILE.
+
+Copyright 2001 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 <stdarg.h>
+#include <stdio.h>
+
+#include "gmp.h"
+#include "gmp-impl.h"
+
+
+int
+gmp_vfscanf (FILE *fp, const char *fmt, va_list ap)
+{
+ return __gmp_doscan (&__gmp_fscanf_funs, fp, fmt, ap);
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/scanf/vscanf.c b/Build/source/libs/gmp/gmp-6.0.0/scanf/vscanf.c
new file mode 100644
index 00000000000..51feebf72ef
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/scanf/vscanf.c
@@ -0,0 +1,43 @@
+/* gmp_vscanf -- formatted input from stdin.
+
+Copyright 2001 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 <stdarg.h>
+
+#include <stdio.h>
+
+#include "gmp.h"
+#include "gmp-impl.h"
+
+
+int
+gmp_vscanf (const char *fmt, va_list ap)
+{
+ return __gmp_doscan (&__gmp_fscanf_funs, stdin, fmt, ap);
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/scanf/vsscanf.c b/Build/source/libs/gmp/gmp-6.0.0/scanf/vsscanf.c
new file mode 100644
index 00000000000..6fb043dce25
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/scanf/vsscanf.c
@@ -0,0 +1,61 @@
+/* gmp_vsscanf -- formatted input from a string.
+
+Copyright 2001, 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/. */
+
+#include <stdarg.h>
+
+#include <string.h>
+
+#include "gmp.h"
+#include "gmp-impl.h"
+
+
+int
+gmp_vsscanf (const char *s, const char *fmt, va_list ap)
+{
+#if SSCANF_WRITABLE_INPUT
+ /* We only actually need this if there's standard C types in fmt, and if
+ "s" is not already writable, but it's too much trouble to check that,
+ and in any case this writable sscanf input business is only for a few
+ old systems. */
+ size_t size;
+ char *alloc;
+ int ret;
+ size = strlen (s) + 1;
+ alloc = (char *) (*__gmp_allocate_func) (size);
+ memcpy (alloc, s, size);
+ s = alloc;
+ ret = __gmp_doscan (&__gmp_sscanf_funs, (void *) &s, fmt, ap);
+ (*__gmp_free_func) (alloc, size);
+ return ret;
+
+#else
+ return __gmp_doscan (&__gmp_sscanf_funs, (void *) &s, fmt, ap);
+#endif
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/tal-debug.c b/Build/source/libs/gmp/gmp-6.0.0/tal-debug.c
new file mode 100644
index 00000000000..35912af360c
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/tal-debug.c
@@ -0,0 +1,151 @@
+/* TMP_ALLOC routines for debugging.
+
+Copyright 2000, 2001, 2004 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 <stdlib.h>
+#include <string.h>
+#include "gmp.h"
+#include "gmp-impl.h"
+
+
+/* This method aims to help a malloc debugger find problems. A linked list
+ of allocated block is kept for TMP_FREE to release. This is reentrant
+ and thread safe.
+
+ Each TMP_ALLOC is a separate malloced block, so redzones or sentinels
+ applied by a malloc debugger either above or below can guard against
+ accesses outside the allocated area.
+
+ A marker is a "struct tmp_debug_t *" so that TMP_DECL can initialize it
+ to NULL and we can detect TMP_ALLOC without TMP_MARK.
+
+ It will work to realloc an MPZ_TMP_INIT variable, but when TMP_FREE comes
+ to release the memory it will have the old size, thereby triggering an
+ error from tests/memory.c.
+
+ Possibilities:
+
+ It'd be possible to keep a global list of active "struct tmp_debug_t"
+ records, so at the end of a program any TMP leaks could be printed. But
+ if only a couple of routines are under test at any one time then the
+ likely culprit should be easy enough to spot. */
+
+
+void
+__gmp_tmp_debug_mark (const char *file, int line,
+ struct tmp_debug_t **markp, struct tmp_debug_t *mark,
+ const char *decl_name, const char *mark_name)
+{
+ if (strcmp (mark_name, decl_name) != 0)
+ {
+ __gmp_assert_header (file, line);
+ fprintf (stderr, "GNU MP: TMP_MARK(%s) but TMP_DECL(%s) is in scope\n",
+ mark_name, decl_name);
+ abort ();
+ }
+
+ if (*markp != NULL)
+ {
+ __gmp_assert_header (file, line);
+ fprintf (stderr, "GNU MP: Repeat of TMP_MARK(%s)\n", mark_name);
+ if (mark->file != NULL && mark->file[0] != '\0' && mark->line != -1)
+ {
+ __gmp_assert_header (mark->file, mark->line);
+ fprintf (stderr, "previous was here\n");
+ }
+ abort ();
+ }
+
+ *markp = mark;
+ mark->file = file;
+ mark->line = line;
+ mark->list = NULL;
+}
+
+void *
+__gmp_tmp_debug_alloc (const char *file, int line, int dummy,
+ struct tmp_debug_t **markp,
+ const char *decl_name, size_t size)
+{
+ struct tmp_debug_t *mark = *markp;
+ struct tmp_debug_entry_t *p;
+
+ ASSERT_ALWAYS (size >= 1);
+
+ if (mark == NULL)
+ {
+ __gmp_assert_header (file, line);
+ fprintf (stderr, "GNU MP: TMP_ALLOC without TMP_MARK(%s)\n", decl_name);
+ abort ();
+ }
+
+ p = __GMP_ALLOCATE_FUNC_TYPE (1, struct tmp_debug_entry_t);
+ p->size = size;
+ p->block = (*__gmp_allocate_func) (size);
+ p->next = mark->list;
+ mark->list = p;
+ return p->block;
+}
+
+void
+__gmp_tmp_debug_free (const char *file, int line, int dummy,
+ struct tmp_debug_t **markp,
+ const char *decl_name, const char *free_name)
+{
+ struct tmp_debug_t *mark = *markp;
+ struct tmp_debug_entry_t *p, *next;
+
+ if (mark == NULL)
+ {
+ __gmp_assert_header (file, line);
+ fprintf (stderr, "GNU MP: TMP_FREE(%s) without TMP_MARK(%s)\n",
+ free_name, decl_name);
+ abort ();
+ }
+
+ if (strcmp (free_name, decl_name) != 0)
+ {
+ __gmp_assert_header (file, line);
+ fprintf (stderr, "GNU MP: TMP_FREE(%s) when TMP_DECL(%s) is in scope\n",
+ free_name, decl_name);
+ abort ();
+ }
+
+ p = mark->list;
+ while (p != NULL)
+ {
+ next = p->next;
+ (*__gmp_free_func) (p->block, p->size);
+ __GMP_FREE_FUNC_TYPE (p, 1, struct tmp_debug_entry_t);
+ p = next;
+ }
+
+ *markp = NULL;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/tal-notreent.c b/Build/source/libs/gmp/gmp-6.0.0/tal-notreent.c
new file mode 100644
index 00000000000..ed162e552b3
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/tal-notreent.c
@@ -0,0 +1,130 @@
+/* Stack allocation routines. This is intended for machines without support
+ for the `alloca' function.
+
+Copyright 1996, 1997, 1999-2001, 2006 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.h"
+#include "gmp-impl.h"
+
+
+struct tmp_stack
+{
+ void *end;
+ void *alloc_point;
+ struct tmp_stack *prev;
+};
+typedef struct tmp_stack tmp_stack;
+
+
+static unsigned long max_total_allocation = 0;
+static unsigned long current_total_allocation = 0;
+
+static tmp_stack xxx = {&xxx, &xxx, 0};
+static tmp_stack *current = &xxx;
+
+/* The rounded size of the header of each allocation block. */
+#define HSIZ ROUND_UP_MULTIPLE (sizeof (tmp_stack), __TMP_ALIGN)
+
+
+/* Allocate a block of exactly <size> bytes. This should only be called
+ through the TMP_ALLOC macro, which takes care of rounding/alignment. */
+void *
+__gmp_tmp_alloc (unsigned long size)
+{
+ void *that;
+
+ ASSERT ((size % __TMP_ALIGN) == 0);
+ ASSERT (((unsigned) current->alloc_point % __TMP_ALIGN) == 0);
+
+ if (size > (char *) current->end - (char *) current->alloc_point)
+ {
+ void *chunk;
+ tmp_stack *header;
+ unsigned long chunk_size;
+ unsigned long now;
+
+ /* Allocate a chunk that makes the total current allocation somewhat
+ larger than the maximum allocation ever. If size is very large, we
+ allocate that much. */
+
+ now = current_total_allocation + size;
+ if (now > max_total_allocation)
+ {
+ /* We need more temporary memory than ever before. Increase
+ for future needs. */
+ now = (now * 3 / 2 + __TMP_ALIGN - 1) & -__TMP_ALIGN;
+ chunk_size = now - current_total_allocation + HSIZ;
+ current_total_allocation = now;
+ max_total_allocation = current_total_allocation;
+ }
+ else
+ {
+ chunk_size = max_total_allocation - current_total_allocation + HSIZ;
+ current_total_allocation = max_total_allocation;
+ }
+
+ chunk = (*__gmp_allocate_func) (chunk_size);
+ header = (tmp_stack *) chunk;
+ header->end = (char *) chunk + chunk_size;
+ header->alloc_point = (char *) chunk + HSIZ;
+ header->prev = current;
+ current = header;
+ }
+
+ that = current->alloc_point;
+ current->alloc_point = (char *) that + size;
+ ASSERT (((unsigned) that % __TMP_ALIGN) == 0);
+ return that;
+}
+
+/* Typically called at function entry. <mark> is assigned so that
+ __gmp_tmp_free can later be used to reclaim all subsequently allocated
+ storage. */
+void
+__gmp_tmp_mark (struct tmp_marker *mark)
+{
+ mark->which_chunk = current;
+ mark->alloc_point = current->alloc_point;
+}
+
+/* Free everything allocated since <mark> was assigned by __gmp_tmp_mark */
+void
+__gmp_tmp_free (struct tmp_marker *mark)
+{
+ while (mark->which_chunk != current)
+ {
+ tmp_stack *tmp;
+
+ tmp = current;
+ current = tmp->prev;
+ current_total_allocation -= (((char *) (tmp->end) - (char *) tmp) - HSIZ);
+ (*__gmp_free_func) (tmp, (char *) tmp->end - (char *) tmp);
+ }
+ current->alloc_point = mark->alloc_point;
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/tal-reent.c b/Build/source/libs/gmp/gmp-6.0.0/tal-reent.c
new file mode 100644
index 00000000000..92f516b5ff3
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/tal-reent.c
@@ -0,0 +1,82 @@
+/* TMP_ALLOC routines using malloc in a reentrant fashion.
+
+Copyright 2000, 2001 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.h"
+#include "gmp-impl.h"
+
+
+/* Each TMP_ALLOC uses __gmp_allocate_func to get a block of memory of the
+ size requested, plus a header at the start which is used to hold the
+ blocks on a linked list in the marker variable, ready for TMP_FREE to
+ release.
+
+ Callers should try to do multiple allocs with one call, in the style of
+ TMP_ALLOC_LIMBS_2 if it's easy to arrange, since that will keep down the
+ number of separate malloc calls.
+
+ Enhancements:
+
+ Could inline both TMP_ALLOC and TMP_FREE, though TMP_ALLOC would need the
+ compiler to have "inline" since it returns a value. The calls to malloc
+ will be slow though, so it hardly seems worth worrying about one extra
+ level of function call. */
+
+
+#define HSIZ ROUND_UP_MULTIPLE (sizeof (struct tmp_reentrant_t), __TMP_ALIGN)
+
+void *
+__gmp_tmp_reentrant_alloc (struct tmp_reentrant_t **markp, size_t size)
+{
+ char *p;
+ size_t total_size;
+
+#define P ((struct tmp_reentrant_t *) p)
+
+ total_size = size + HSIZ;
+ p = (char *) (*__gmp_allocate_func) (total_size);
+ P->size = total_size;
+ P->next = *markp;
+ *markp = P;
+ return p + HSIZ;
+}
+
+void
+__gmp_tmp_reentrant_free (struct tmp_reentrant_t *mark)
+{
+ struct tmp_reentrant_t *next;
+
+ while (mark != NULL)
+ {
+ next = mark->next;
+ (*__gmp_free_func) ((char *) mark, mark->size);
+ mark = next;
+ }
+}
diff --git a/Build/source/libs/gmp/gmp-6.0.0/version.c b/Build/source/libs/gmp/gmp-6.0.0/version.c
new file mode 100644
index 00000000000..b75a3389e0e
--- /dev/null
+++ b/Build/source/libs/gmp/gmp-6.0.0/version.c
@@ -0,0 +1,34 @@
+/* gmp_version -- version number compiled into the library.
+
+Copyright 1996, 1999-2001 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.h"
+#include "gmp-impl.h"
+
+const char * const gmp_version = VERSION;
diff --git a/Build/source/libs/gmp/gmp.test b/Build/source/libs/gmp/gmp.test
new file mode 100755
index 00000000000..a1b0f591830
--- /dev/null
+++ b/Build/source/libs/gmp/gmp.test
@@ -0,0 +1,7 @@
+#! /bin/sh
+
+# Copyright (C) 2014 Taco Hoekwater <taco@metatex.org>
+# You may freely use, modify and/or distribute this file.
+
+./gmptest || exit 1
+
diff --git a/Build/source/libs/gmp/gmptest.c b/Build/source/libs/gmp/gmptest.c
new file mode 100644
index 00000000000..a0f3afe6c29
--- /dev/null
+++ b/Build/source/libs/gmp/gmptest.c
@@ -0,0 +1,16 @@
+/* gmptst.c: Basic test for libgmp
+ *
+ * Copyright (C) 2014 Peter Breitenlohner <tex-live@tug.org>
+ * You may freely use, modify and/or distribute this file.
+ */
+
+#include <stdio.h>
+#include <gmp.h>
+
+int main (int argc, char **argv)
+{
+ printf ("%s: Compiled with gmp version %d.%d.%d; using %s\n",
+ argv[0], __GNU_MP_VERSION, __GNU_MP_VERSION_MINOR, __GNU_MP_VERSION_PATCHLEVEL,
+ gmp_version);
+ return 0;
+}
diff --git a/Build/source/libs/gmp/include/Makefile.am b/Build/source/libs/gmp/include/Makefile.am
new file mode 100644
index 00000000000..9b2fe3d9c2f
--- /dev/null
+++ b/Build/source/libs/gmp/include/Makefile.am
@@ -0,0 +1,16 @@
+## Proxy Makefile.am to install gmp headers for TeX Live.
+##
+## Copyright (C) 2014 Peter Breitenlohner <tex-live@tug.org>
+##
+## This file is free software; the copyright holder
+## gives unlimited permission to copy and/or distribute it,
+## with or without modifications, as long as this notice is preserved.
+##
+GMP_SRC = $(top_srcdir)/$(GMP_TREE)
+GMP_BLD = $(top_builddir)
+
+hdr_links = \
+ $(GMP_BLD)/gmp.h
+
+include $(top_srcdir)/../../am/hdr_links.am
+
diff --git a/Build/source/libs/gmp/include/Makefile.in b/Build/source/libs/gmp/include/Makefile.in
new file mode 100644
index 00000000000..43c481ae0ff
--- /dev/null
+++ b/Build/source/libs/gmp/include/Makefile.in
@@ -0,0 +1,430 @@
+# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+VPATH = @srcdir@
+am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__make_running_with_option = \
+ case $${target_option-} in \
+ ?) ;; \
+ *) echo "am__make_running_with_option: internal error: invalid" \
+ "target option '$${target_option-}' specified" >&2; \
+ exit 1;; \
+ esac; \
+ has_opt=no; \
+ sane_makeflags=$$MAKEFLAGS; \
+ if $(am__is_gnu_make); then \
+ sane_makeflags=$$MFLAGS; \
+ else \
+ case $$MAKEFLAGS in \
+ *\\[\ \ ]*) \
+ bs=\\; \
+ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
+ esac; \
+ fi; \
+ skip_next=no; \
+ strip_trailopt () \
+ { \
+ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+ }; \
+ for flg in $$sane_makeflags; do \
+ test $$skip_next = yes && { skip_next=no; continue; }; \
+ case $$flg in \
+ *=*|--*) continue;; \
+ -*I) strip_trailopt 'I'; skip_next=yes;; \
+ -*I?*) strip_trailopt 'I';; \
+ -*O) strip_trailopt 'O'; skip_next=yes;; \
+ -*O?*) strip_trailopt 'O';; \
+ -*l) strip_trailopt 'l'; skip_next=yes;; \
+ -*l?*) strip_trailopt 'l';; \
+ -[dEDm]) skip_next=yes;; \
+ -[JT]) skip_next=yes;; \
+ esac; \
+ case $$flg in \
+ *$$target_option*) has_opt=yes; break;; \
+ esac; \
+ done; \
+ test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+DIST_COMMON = $(top_srcdir)/../../am/hdr_links.am \
+ $(srcdir)/Makefile.in $(srcdir)/Makefile.am
+subdir = include
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/gmp-alloca.m4 \
+ $(top_srcdir)/m4/gmp-attribute.m4 \
+ $(top_srcdir)/m4/gmp-double-format.m4 \
+ $(top_srcdir)/../../m4/kpse-common.m4 \
+ $(top_srcdir)/../../m4/kpse-warnings.m4 \
+ $(top_srcdir)/version.ac $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+AM_V_P = $(am__v_P_@AM_V@)
+am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_@AM_V@)
+am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
+am__v_GEN_0 = @echo " GEN " $@;
+am__v_GEN_1 =
+AM_V_at = $(am__v_at_@AM_V@)
+am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
+am__v_at_0 = @
+am__v_at_1 =
+SOURCES =
+DIST_SOURCES =
+am__can_run_installinfo = \
+ case $$AM_UPDATE_INFO_DIR in \
+ n|no|NO) false;; \
+ *) (install-info --version) >/dev/null 2>&1;; \
+ esac
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFN_LONG_LONG_LIMB = @DEFN_LONG_LONG_LIMB@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+GMP_LIMB_BITS = @GMP_LIMB_BITS@
+GMP_NAIL_BITS = @GMP_NAIL_BITS@
+GMP_TREE = @GMP_TREE@
+GREP = @GREP@
+HAVE_HOST_CPU_FAMILY_power = @HAVE_HOST_CPU_FAMILY_power@
+HAVE_HOST_CPU_FAMILY_powerpc = @HAVE_HOST_CPU_FAMILY_powerpc@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LIBGMP_DLL = @LIBGMP_DLL@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MKDIR_P = @MKDIR_P@
+OBJEXT = @OBJEXT@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+RANLIB = @RANLIB@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+VERSION = @VERSION@
+WARNING_CFLAGS = @WARNING_CFLAGS@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_CC = @ac_ct_CC@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+subdirs = @subdirs@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+GMP_SRC = $(top_srcdir)/$(GMP_TREE)
+GMP_BLD = $(top_builddir)
+hdr_links = \
+ $(GMP_BLD)/gmp.h
+
+all: all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/../../am/hdr_links.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+ && { if test -f $@; then exit 0; else break; fi; }; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign include/Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --foreign include/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+$(top_srcdir)/../../am/hdr_links.am:
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+tags TAGS:
+
+ctags CTAGS:
+
+cscope cscopelist:
+
+
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d "$(distdir)/$$file"; then \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+ else \
+ test -f "$(distdir)/$$file" \
+ || cp -p $$d/$$file "$(distdir)/$$file" \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-am
+all-am: Makefile all-local
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ if test -z '$(STRIP)'; then \
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ install; \
+ else \
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+ fi
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+ -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic mostlyclean-am
+
+distclean: distclean-am
+ -rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-local
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am:
+
+.MAKE: install-am install-strip
+
+.PHONY: all all-am all-local check check-am clean clean-generic \
+ cscopelist-am ctags-am distclean distclean-generic \
+ distclean-local distdir dvi dvi-am html html-am info info-am \
+ install install-am install-data install-data-am install-dvi \
+ install-dvi-am install-exec install-exec-am install-html \
+ install-html-am install-info install-info-am install-man \
+ install-pdf install-pdf-am install-ps install-ps-am \
+ install-strip installcheck installcheck-am installdirs \
+ maintainer-clean maintainer-clean-generic mostlyclean \
+ mostlyclean-generic pdf pdf-am ps ps-am tags-am uninstall \
+ uninstall-am
+
+all-local:
+ @for file in $(hdr_links); do \
+ test -f $$file || continue; \
+ inst=`echo $$file | sed -e 's/^.*\///'`; \
+ test -f $$inst || { \
+ rm -f $$inst; \
+ if $(AM_V_P); then echo "$(LN_S) $$file $$inst"; \
+ else echo " INST $$inst"; fi; \
+ $(LN_S) $$file $$inst; } || exit 1; \
+ done
+
+distclean-local:
+ rm -f *.h
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/Build/source/libs/gmp/m4/gmp-alloca.m4 b/Build/source/libs/gmp/m4/gmp-alloca.m4
new file mode 100644
index 00000000000..2fc59023a88
--- /dev/null
+++ b/Build/source/libs/gmp/m4/gmp-alloca.m4
@@ -0,0 +1,56 @@
+# Autoconf macros for the GNU MP Library.
+# Copyright (C) 2000-2014 Free Software Foundation, Inc.
+#
+# Copyright (C) 2014 Peter Breitenlohner <tex-live@tug.org>
+# Extracted from gmp-6.0.0/acinclude.m4 and adapted for TeX Live.
+#
+# This file is free software; the copyright holders
+# give unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# GMP_FUNC_ALLOCA
+# ---------------
+# Determine whether "alloca" is available. This is AC_FUNC_ALLOCA from
+# autoconf, but changed so it doesn't use alloca.c if alloca() isn't
+# available, and also to use gmp-impl.h for the conditionals detecting
+# compiler builtin alloca's.
+
+AC_DEFUN([GMP_FUNC_ALLOCA], [dnl
+AC_REQUIRE([KPSE_GMP_H])
+_GMP_HEADER_ALLOCA
+AC_CACHE_CHECK([for alloca (via gmp-impl.h)],
+ [gmp_cv_func_alloca],
+[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include "gmp-tmp.h"
+#include "$srcdir/gmp-]gmp_version[/gmp-impl.h"]],
+ [[char *p = (char *) alloca (1);]])],
+ [gmp_cv_func_alloca=yes],
+ [gmp_cv_func_alloca=no])])
+if test "x$gmp_cv_func_alloca" = xyes; then
+ AC_DEFINE([HAVE_ALLOCA], 1, [Define to 1 if alloca() works (via gmp-impl.h).])
+ AC_DEFINE([WANT_TMP_ALLOCA])
+else
+ AC_DEFINE([WANT_TMP_REENTRANT])
+fi
+AH_VERBATIM([WANT_TMP],
+[/* Define one of these to 1 for the temporary memory allocation method. */
+#undef WANT_TMP_ALLOCA
+#undef WANT_TMP_REENTRANT])
+]) # GMP_FUNC_ALLOCA
+
+# _GMP_HEADER_ALLOCA
+# ------------------
+# Internal subroutine
+m4_define([_GMP_HEADER_ALLOCA],
+[# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
+# for constant arguments. Useless!
+AC_CACHE_CHECK([for working alloca.h],
+ [gmp_cv_header_alloca],
+[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <alloca.h>]],
+ [[char *p = (char *) alloca (2 * sizeof (int));]])],
+ [gmp_cv_header_alloca=yes],
+ [gmp_cv_header_alloca=no])])
+if test "x$gmp_cv_header_alloca" = xyes; then
+ AC_DEFINE([HAVE_ALLOCA_H], 1,
+ [Define to 1 if you have <alloca.h> and it should be used (not on Ultrix).])
+fi
+]) # _GMP_HEADER_ALLOCA
diff --git a/Build/source/libs/gmp/m4/gmp-attribute.m4 b/Build/source/libs/gmp/m4/gmp-attribute.m4
new file mode 100644
index 00000000000..9b1a6a76fe9
--- /dev/null
+++ b/Build/source/libs/gmp/m4/gmp-attribute.m4
@@ -0,0 +1,75 @@
+# Autoconf macros for the GNU MP Library.
+# Copyright (C) 2000-2014 Free Software Foundation, Inc.
+#
+# Copyright (C) 2014 Peter Breitenlohner <tex-live@tug.org>
+# Extracted from gmp-6.0.0/acinclude.m4 and adapted for TeX Live.
+#
+# This file is free software; the copyright holders
+# give unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# GMP_C_ATTRIBUTE_CONST
+# ---------------------
+AC_DEFUN([GMP_C_ATTRIBUTE_CONST],
+[AC_CACHE_CHECK([whether gcc __attribute__ ((const)) works],
+ [gmp_cv_c_attribute_const],
+[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[int foo (int x) __attribute__ ((const));]])],
+ [gmp_cv_c_attribute_const=yes], [gmp_cv_c_attribute_const=no])
+])
+if test $gmp_cv_c_attribute_const = yes; then
+ AC_DEFINE([HAVE_ATTRIBUTE_CONST], 1,
+ [Define to 1 if the compiler accepts gcc style __attribute__ ((const))])
+fi
+]) # GMP_C_ATTRIBUTE_CONST
+
+
+# GMP_C_ATTRIBUTE_MALLOC
+# ----------------------
+# gcc 2.95.x accepts __attribute__ ((malloc)) but with a warning that
+# it's ignored. Pretend it doesn't exist in this case, to avoid that
+# warning.
+AC_DEFUN([GMP_C_ATTRIBUTE_MALLOC],
+[AC_CACHE_CHECK([whether gcc __attribute__ ((malloc)) works],
+ [gmp_cv_c_attribute_malloc],
+[gmp_cv_c_attribute_malloc=no
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[void *foo (int x) __attribute__ ((malloc));]])],
+ [AS_IF([grep "attribute directive ignored" conftest.err >/dev/null],
+ [],
+ [gmp_cv_c_attribute_malloc=yes])])
+])
+if test $gmp_cv_c_attribute_malloc = yes; then
+ AC_DEFINE([HAVE_ATTRIBUTE_MALLOC], 1,
+ [Define to 1 if the compiler accepts gcc style __attribute__ ((malloc))])
+fi
+]) # GMP_C_ATTRIBUTE_MALLOC
+
+
+# GMP_C_ATTRIBUTE_MODE
+# --------------------
+# Introduced in gcc 2.2, but perhaps not in all Apple derived versions.
+AC_DEFUN([GMP_C_ATTRIBUTE_MODE],
+[AC_CACHE_CHECK([whether gcc __attribute__ ((mode (XX))) works],
+ [gmp_cv_c_attribute_mode],
+[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[typedef int SItype __attribute__ ((mode (SI)));]])],
+ [gmp_cv_c_attribute_mode=yes], [gmp_cv_c_attribute_mode=no])
+])
+if test $gmp_cv_c_attribute_mode = yes; then
+ AC_DEFINE([HAVE_ATTRIBUTE_MODE], 1,
+ [Define to 1 if the compiler accepts gcc style __attribute__ ((mode (XX)))])
+fi
+]) # GMP_C_ATTRIBUTE_MODE
+
+
+# GMP_C_ATTRIBUTE_NORETURN
+# ------------------------
+AC_DEFUN([GMP_C_ATTRIBUTE_NORETURN],
+[AC_CACHE_CHECK([whether gcc __attribute__ ((noreturn)) works],
+ [gmp_cv_c_attribute_noreturn],
+[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[void foo (int x) __attribute__ ((noreturn));]])],
+ [gmp_cv_c_attribute_noreturn=yes], [gmp_cv_c_attribute_noreturn=no])
+])
+if test $gmp_cv_c_attribute_noreturn = yes; then
+ AC_DEFINE([HAVE_ATTRIBUTE_NORETURN], 1,
+ [Define to 1 if the compiler accepts gcc style __attribute__ ((noreturn))])
+fi
+]) # GMP_C_ATTRIBUTE_NORETURN
diff --git a/Build/source/libs/gmp/m4/gmp-double-format.m4 b/Build/source/libs/gmp/m4/gmp-double-format.m4
new file mode 100644
index 00000000000..fee679067ce
--- /dev/null
+++ b/Build/source/libs/gmp/m4/gmp-double-format.m4
@@ -0,0 +1,242 @@
+# Autoconf macros for the GNU MP Library.
+# Copyright (C) 2000-2014 Free Software Foundation, Inc.
+#
+# Copyright (C) 2014 Peter Breitenlohner <tex-live@tug.org>
+# Extracted from gmp-6.0.0/acinclude.m4 and adapted for TeX Live.
+#
+# This file is free software; the copyright holders
+# give unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# GMP_C_DOUBLE_FORMAT
+# -------------------
+# Determine the floating point format.
+#
+# The object file is grepped, in order to work when cross compiling. A
+# start and end sequence is included to avoid false matches, and allowance
+# is made for the desired data crossing an "od -b" line boundary. The test
+# number is a small integer so it should appear exactly, no rounding or
+# truncation etc.
+#
+# "od -b", incidentally, is supported even by Unix V7, and the awk script
+# used doesn't have functions or anything, so even an "old" awk should
+# suffice.
+#
+# The C code here declares the variable foo as extern; without that, some
+# C++ compilers will not put foo in the object file.
+
+AC_DEFUN([GMP_C_DOUBLE_FORMAT], [dnl
+AC_REQUIRE([AC_PROG_CC])
+AC_REQUIRE([AC_PROG_AWK])
+AC_CACHE_CHECK([format of `double' floating point],
+ [gmp_cv_c_double_format],
+[gmp_cv_c_double_format=unknown
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+struct foo {
+ char before[8];
+ double x;
+ char after[8];
+};
+extern struct foo foo;
+struct foo foo = {
+ { '\001', '\043', '\105', '\147', '\211', '\253', '\315', '\357' },
+ -123456789.0,
+ { '\376', '\334', '\272', '\230', '\166', '\124', '\062', '\020' },
+};
+]])],
+ [cat >conftest.awk <<\EOF
+_gmp_double_awk
+EOF
+ gmp_cv_c_double_format=`od -b conftest.$ac_objext | $AWK -f conftest.awk`
+ AS_CASE([$gmp_cv_c_double_format],
+ [unknown*],
+ [echo "cannot match anything, conftest.$ac_objext contains" >&AS_MESSAGE_LOG_FD
+ od -b conftest.$ac_objext >&AS_MESSAGE_LOG_FD])],
+ [AC_MSG_WARN([oops, cannot compile test program])])
+rm -f conftest.awk])
+
+AH_VERBATIM([HAVE_DOUBLE],
+[/* Define one of the following to 1 for the format of a `double'.
+ If your format is not among these choices, or you don't know what it is,
+ then leave all undefined.
+ IEEE_LITTLE_SWAPPED means little endian, but with the two 4-byte halves
+ swapped, as used by ARM CPUs in little endian mode. */
+#undef HAVE_DOUBLE_IEEE_BIG_ENDIAN
+#undef HAVE_DOUBLE_IEEE_LITTLE_ENDIAN
+#undef HAVE_DOUBLE_IEEE_LITTLE_SWAPPED
+#undef HAVE_DOUBLE_VAX_D
+#undef HAVE_DOUBLE_VAX_G
+#undef HAVE_DOUBLE_CRAY_CFP])
+
+AS_CASE([$gmp_cv_c_double_format],
+ ["IEEE big endian"],
+ [AC_DEFINE([HAVE_DOUBLE_IEEE_BIG_ENDIAN], 1)],
+ ["IEEE little endian"],
+ [AC_DEFINE([HAVE_DOUBLE_IEEE_LITTLE_ENDIAN], 1)],
+ ["IEEE little endian, swapped halves"],
+ [AC_DEFINE([HAVE_DOUBLE_IEEE_LITTLE_SWAPPED], 1)],
+ ["VAX D"],
+ [AC_DEFINE([HAVE_DOUBLE_VAX_D], 1)],
+ ["VAX G"],
+ [AC_DEFINE([HAVE_DOUBLE_VAX_G], 1)],
+ ["Cray CFP"],
+ [AC_DEFINE([HAVE_DOUBLE_CRAY_CFP], 1)],
+ ["bad ARM software floats"], [],
+ [unknown*],
+ [AC_MSG_WARN([Could not determine float format.])
+ AC_MSG_WARN([Conversions to and from "double" may be slow.])],
+ [AC_MSG_WARN([oops, unrecognised float format: $gmp_cv_c_double_format])])
+]) # GMP_C_DOUBLE_FORMAT
+
+# _gmp_double_awk
+# ---------------
+# Internal subroutine defining contents of conftest.awk.
+m4_define([_gmp_double_awk], [[
+BEGIN {
+ found = 0
+}
+
+{
+ for (f = 2; f <= NF; f++)
+ {
+ for (i = 0; i < 23; i++)
+ got[i] = got[i+1];
+ got[23] = $f;
+
+ # match the special begin and end sequences
+ if (got[0] != "001") continue
+ if (got[1] != "043") continue
+ if (got[2] != "105") continue
+ if (got[3] != "147") continue
+ if (got[4] != "211") continue
+ if (got[5] != "253") continue
+ if (got[6] != "315") continue
+ if (got[7] != "357") continue
+ if (got[16] != "376") continue
+ if (got[17] != "334") continue
+ if (got[18] != "272") continue
+ if (got[19] != "230") continue
+ if (got[20] != "166") continue
+ if (got[21] != "124") continue
+ if (got[22] != "062") continue
+ if (got[23] != "020") continue
+
+ saw = " (" got[8] " " got[9] " " got[10] " " got[11] " " got[12] " " got[13] " " got[14] " " got[15] ")"
+
+ if (got[8] == "000" && \
+ got[9] == "000" && \
+ got[10] == "000" && \
+ got[11] == "124" && \
+ got[12] == "064" && \
+ got[13] == "157" && \
+ got[14] == "235" && \
+ got[15] == "301")
+ {
+ print "IEEE little endian"
+ found = 1
+ exit
+ }
+
+ # Little endian with the two 4-byte halves swapped, as used by ARM
+ # when the chip is in little endian mode.
+ #
+ if (got[8] == "064" && \
+ got[9] == "157" && \
+ got[10] == "235" && \
+ got[11] == "301" && \
+ got[12] == "000" && \
+ got[13] == "000" && \
+ got[14] == "000" && \
+ got[15] == "124")
+ {
+ print "IEEE little endian, swapped halves"
+ found = 1
+ exit
+ }
+
+ # gcc 2.95.4 on one GNU/Linux ARM system was seen generating 000 in
+ # the last byte, whereas 124 is correct. Not sure where the bug
+ # actually lies, but a running program didn't seem to get a full
+ # mantissa worth of working bits.
+ #
+ # We match this case explicitly so we can give a nice result message,
+ # but we deliberately exclude it from the normal IEEE double setups
+ # since it's too broken.
+ #
+ if (got[8] == "064" && \
+ got[9] == "157" && \
+ got[10] == "235" && \
+ got[11] == "301" && \
+ got[12] == "000" && \
+ got[13] == "000" && \
+ got[14] == "000" && \
+ got[15] == "000")
+ {
+ print "bad ARM software floats"
+ found = 1
+ exit
+ }
+
+ if (got[8] == "301" && \
+ got[9] == "235" && \
+ got[10] == "157" && \
+ got[11] == "064" && \
+ got[12] == "124" && \
+ got[13] == "000" && \
+ got[14] == "000" && \
+ got[15] == "000")
+ {
+ print "IEEE big endian"
+ found = 1
+ exit
+ }
+
+ if (got[8] == "353" && \
+ got[9] == "315" && \
+ got[10] == "242" && \
+ got[11] == "171" && \
+ got[12] == "000" && \
+ got[13] == "240" && \
+ got[14] == "000" && \
+ got[15] == "000")
+ {
+ print "VAX D"
+ found = 1
+ exit
+ }
+
+ if (got[8] == "275" && \
+ got[9] == "301" && \
+ got[10] == "064" && \
+ got[11] == "157" && \
+ got[12] == "000" && \
+ got[13] == "124" && \
+ got[14] == "000" && \
+ got[15] == "000")
+ {
+ print "VAX G"
+ found = 1
+ exit
+ }
+
+ if (got[8] == "300" && \
+ got[9] == "033" && \
+ got[10] == "353" && \
+ got[11] == "171" && \
+ got[12] == "242" && \
+ got[13] == "240" && \
+ got[14] == "000" && \
+ got[15] == "000")
+ {
+ print "Cray CFP"
+ found = 1
+ exit
+ }
+ }
+}
+
+END {
+ if (! found)
+ print "unknown", saw
+}
+]])
diff --git a/Build/source/libs/gmp/native/Makefile.am b/Build/source/libs/gmp/native/Makefile.am
new file mode 100644
index 00000000000..78e2c09979e
--- /dev/null
+++ b/Build/source/libs/gmp/native/Makefile.am
@@ -0,0 +1,67 @@
+## Makefile.am for the TeX Live subdirectory libs/gmp/native/
+##
+## Copyright (C) 2014 Peter Breitenlohner <tex-live@tug.org>
+## You may freely use, modify and/or distribute this file.
+##
+AM_CPPFLAGS = -I$(srcdir)/$(GMP_TREE)
+AM_CFLAGS = -Wall # $(WARNING_CFLAGS)
+
+EXTRA_PROGRAMS =
+built_sources =
+extra_data =
+
+dist-hook:
+ rm -rf `find $(distdir) -name '*.c'`
+
+EXTRA_PROGRAMS += gen-bases
+gen_bases_LDADD = $(MATH_LIB)
+stamp-bases: gen-bases$(EXEEXT)
+ echo timestamp >$@
+built_sources += gen-bases.c
+extra_data += stamp-bases
+
+EXTRA_PROGRAMS += gen-fac
+stamp-fac: gen-fac$(EXEEXT)
+ echo timestamp >$@
+built_sources += gen-fac.c
+extra_data += stamp-fac
+
+EXTRA_PROGRAMS += gen-fib
+stamp-fib: gen-fib$(EXEEXT)
+ echo timestamp >$@
+built_sources += gen-fib.c
+extra_data += stamp-fib
+
+EXTRA_PROGRAMS += gen-jacobitab
+stamp-jacobitab: gen-jacobitab$(EXEEXT)
+ echo timestamp >$@
+built_sources += gen-jacobitab.c
+extra_data += stamp-jacobitab
+
+EXTRA_PROGRAMS += gen-psqr
+gen_psqr_LDADD = $(MATH_LIB)
+stamp-psqr: gen-psqr$(EXEEXT)
+ echo timestamp >$@
+built_sources += gen-psqr.c
+extra_data += stamp-psqr
+
+EXTRA_PROGRAMS += gen-trialdivtab
+gen_trialdivtab_LDADD = $(MATH_LIB)
+stamp-trialdivtab: gen-trialdivtab$(EXEEXT)
+ echo timestamp >$@
+built_sources += gen-trialdivtab.c
+extra_data += stamp-trialdivtab
+
+$(built_sources):
+ @rm -f $@
+ $(AM_V_LINK)$(LN_S) $(srcdir)/$(GMP_TREE)/$@ $@
+
+AM_V_LINK = $(am__v_LINK_@AM_V@)
+am__v_LINK_ = $(am__v_LINK_@AM_DEFAULT_V@)
+am__v_LINK_0 = @echo " LINK " $@;
+am__v_LINK_1 =
+
+CLEANFILES = $(extra_data)
+
+DISTCLEANFILES = $(built_sources)
+
diff --git a/Build/source/libs/gmp/native/Makefile.in b/Build/source/libs/gmp/native/Makefile.in
new file mode 100644
index 00000000000..b2b7d43b780
--- /dev/null
+++ b/Build/source/libs/gmp/native/Makefile.in
@@ -0,0 +1,786 @@
+# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+VPATH = @srcdir@
+am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__make_running_with_option = \
+ case $${target_option-} in \
+ ?) ;; \
+ *) echo "am__make_running_with_option: internal error: invalid" \
+ "target option '$${target_option-}' specified" >&2; \
+ exit 1;; \
+ esac; \
+ has_opt=no; \
+ sane_makeflags=$$MAKEFLAGS; \
+ if $(am__is_gnu_make); then \
+ sane_makeflags=$$MFLAGS; \
+ else \
+ case $$MAKEFLAGS in \
+ *\\[\ \ ]*) \
+ bs=\\; \
+ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
+ esac; \
+ fi; \
+ skip_next=no; \
+ strip_trailopt () \
+ { \
+ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+ }; \
+ for flg in $$sane_makeflags; do \
+ test $$skip_next = yes && { skip_next=no; continue; }; \
+ case $$flg in \
+ *=*|--*) continue;; \
+ -*I) strip_trailopt 'I'; skip_next=yes;; \
+ -*I?*) strip_trailopt 'I';; \
+ -*O) strip_trailopt 'O'; skip_next=yes;; \
+ -*O?*) strip_trailopt 'O';; \
+ -*l) strip_trailopt 'l'; skip_next=yes;; \
+ -*l?*) strip_trailopt 'l';; \
+ -[dEDm]) skip_next=yes;; \
+ -[JT]) skip_next=yes;; \
+ esac; \
+ case $$flg in \
+ *$$target_option*) has_opt=yes; break;; \
+ esac; \
+ done; \
+ test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+EXTRA_PROGRAMS = gen-bases$(EXEEXT) gen-fac$(EXEEXT) gen-fib$(EXEEXT) \
+ gen-jacobitab$(EXEEXT) gen-psqr$(EXEEXT) \
+ gen-trialdivtab$(EXEEXT)
+subdir = .
+DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
+ $(top_srcdir)/configure $(am__configure_deps) \
+ $(srcdir)/config.h.in $(top_srcdir)/../../../build-aux/depcomp \
+ ../../../build-aux/compile ../../../build-aux/config.guess \
+ ../../../build-aux/config.sub ../../../build-aux/depcomp \
+ ../../../build-aux/install-sh ../../../build-aux/missing \
+ ../../../build-aux/texinfo.tex ../../../build-aux/ylwrap \
+ ../../../build-aux/ltmain.sh \
+ $(top_srcdir)/../../../build-aux/compile \
+ $(top_srcdir)/../../../build-aux/install-sh \
+ $(top_srcdir)/../../../build-aux/missing
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/../../../m4/kpse-common.m4 \
+ $(top_srcdir)/../../../m4/kpse-search-libs.m4 \
+ $(top_srcdir)/../../../m4/kpse-warnings.m4 \
+ $(top_srcdir)/../version.ac $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
+ configure.lineno config.status.lineno
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+gen_bases_SOURCES = gen-bases.c
+gen_bases_OBJECTS = gen-bases.$(OBJEXT)
+am__DEPENDENCIES_1 =
+gen_bases_DEPENDENCIES = $(am__DEPENDENCIES_1)
+gen_fac_SOURCES = gen-fac.c
+gen_fac_OBJECTS = gen-fac.$(OBJEXT)
+gen_fac_LDADD = $(LDADD)
+gen_fib_SOURCES = gen-fib.c
+gen_fib_OBJECTS = gen-fib.$(OBJEXT)
+gen_fib_LDADD = $(LDADD)
+gen_jacobitab_SOURCES = gen-jacobitab.c
+gen_jacobitab_OBJECTS = gen-jacobitab.$(OBJEXT)
+gen_jacobitab_LDADD = $(LDADD)
+gen_psqr_SOURCES = gen-psqr.c
+gen_psqr_OBJECTS = gen-psqr.$(OBJEXT)
+gen_psqr_DEPENDENCIES = $(am__DEPENDENCIES_1)
+gen_trialdivtab_SOURCES = gen-trialdivtab.c
+gen_trialdivtab_OBJECTS = gen-trialdivtab.$(OBJEXT)
+gen_trialdivtab_DEPENDENCIES = $(am__DEPENDENCIES_1)
+AM_V_P = $(am__v_P_@AM_V@)
+am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_@AM_V@)
+am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
+am__v_GEN_0 = @echo " GEN " $@;
+am__v_GEN_1 =
+AM_V_at = $(am__v_at_@AM_V@)
+am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
+am__v_at_0 = @
+am__v_at_1 =
+DEFAULT_INCLUDES = -I.@am__isrc@
+depcomp = $(SHELL) $(top_srcdir)/../../../build-aux/depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+AM_V_CC = $(am__v_CC_@AM_V@)
+am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
+am__v_CC_0 = @echo " CC " $@;
+am__v_CC_1 =
+CCLD = $(CC)
+LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_CCLD = $(am__v_CCLD_@AM_V@)
+am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
+am__v_CCLD_0 = @echo " CCLD " $@;
+am__v_CCLD_1 =
+SOURCES = gen-bases.c gen-fac.c gen-fib.c gen-jacobitab.c gen-psqr.c \
+ gen-trialdivtab.c
+DIST_SOURCES = gen-bases.c gen-fac.c gen-fib.c gen-jacobitab.c \
+ gen-psqr.c gen-trialdivtab.c
+am__can_run_installinfo = \
+ case $$AM_UPDATE_INFO_DIR in \
+ n|no|NO) false;; \
+ *) (install-info --version) >/dev/null 2>&1;; \
+ esac
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \
+ $(LISP)config.h.in
+# Read a list of newline-separated strings from the standard input,
+# and print each of them once, without duplicates. Input order is
+# *not* preserved.
+am__uniquify_input = $(AWK) '\
+ BEGIN { nonempty = 0; } \
+ { items[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in items) print i; }; } \
+'
+# Make sure the list of sources is unique. This is necessary because,
+# e.g., the same source file might be shared among _SOURCES variables
+# for different programs/libraries.
+am__define_uniq_tagged_files = \
+ list='$(am__tagged_files)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | $(am__uniquify_input)`
+ETAGS = etags
+CTAGS = ctags
+CSCOPE = cscope
+AM_RECURSIVE_TARGETS = cscope
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+distdir = $(PACKAGE)-$(VERSION)
+top_distdir = $(distdir)
+am__remove_distdir = \
+ if test -d "$(distdir)"; then \
+ find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \
+ && rm -rf "$(distdir)" \
+ || { sleep 5 && rm -rf "$(distdir)"; }; \
+ else :; fi
+am__post_remove_distdir = $(am__remove_distdir)
+DIST_ARCHIVES = $(distdir).tar.gz
+GZIP_ENV = --best
+DIST_TARGETS = dist-gzip
+distuninstallcheck_listfiles = find . -type f -print
+am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \
+ | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$'
+distcleancheck_listfiles = find . -type f -print
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPPFLAGS = @CPPFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EXEEXT = @EXEEXT@
+GMP_TREE = @GMP_TREE@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MATH_LIB = @MATH_LIB@
+MKDIR_P = @MKDIR_P@
+OBJEXT = @OBJEXT@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+VERSION = @VERSION@
+WARNING_CFLAGS = @WARNING_CFLAGS@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_CC = @ac_ct_CC@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build_alias = @build_alias@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host_alias = @host_alias@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+AM_CPPFLAGS = -I$(srcdir)/$(GMP_TREE)
+AM_CFLAGS = -Wall # $(WARNING_CFLAGS)
+built_sources = gen-bases.c gen-fac.c gen-fib.c gen-jacobitab.c \
+ gen-psqr.c gen-trialdivtab.c
+extra_data = stamp-bases stamp-fac stamp-fib stamp-jacobitab \
+ stamp-psqr stamp-trialdivtab
+gen_bases_LDADD = $(MATH_LIB)
+gen_psqr_LDADD = $(MATH_LIB)
+gen_trialdivtab_LDADD = $(MATH_LIB)
+AM_V_LINK = $(am__v_LINK_@AM_V@)
+am__v_LINK_ = $(am__v_LINK_@AM_DEFAULT_V@)
+am__v_LINK_0 = @echo " LINK " $@;
+am__v_LINK_1 =
+CLEANFILES = $(extra_data)
+DISTCLEANFILES = $(built_sources)
+all: config.h
+ $(MAKE) $(AM_MAKEFLAGS) all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .o .obj
+am--refresh: Makefile
+ @:
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \
+ $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \
+ && exit 0; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --foreign Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ echo ' $(SHELL) ./config.status'; \
+ $(SHELL) ./config.status;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ $(SHELL) ./config.status --recheck
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+ $(am__cd) $(srcdir) && $(AUTOCONF)
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+ $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
+$(am__aclocal_m4_deps):
+
+config.h: stamp-h1
+ @test -f $@ || rm -f stamp-h1
+ @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1
+
+stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status
+ @rm -f stamp-h1
+ cd $(top_builddir) && $(SHELL) ./config.status config.h
+$(srcdir)/config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+ ($(am__cd) $(top_srcdir) && $(AUTOHEADER))
+ rm -f stamp-h1
+ touch $@
+
+distclean-hdr:
+ -rm -f config.h stamp-h1
+
+gen-bases$(EXEEXT): $(gen_bases_OBJECTS) $(gen_bases_DEPENDENCIES) $(EXTRA_gen_bases_DEPENDENCIES)
+ @rm -f gen-bases$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(gen_bases_OBJECTS) $(gen_bases_LDADD) $(LIBS)
+
+gen-fac$(EXEEXT): $(gen_fac_OBJECTS) $(gen_fac_DEPENDENCIES) $(EXTRA_gen_fac_DEPENDENCIES)
+ @rm -f gen-fac$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(gen_fac_OBJECTS) $(gen_fac_LDADD) $(LIBS)
+
+gen-fib$(EXEEXT): $(gen_fib_OBJECTS) $(gen_fib_DEPENDENCIES) $(EXTRA_gen_fib_DEPENDENCIES)
+ @rm -f gen-fib$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(gen_fib_OBJECTS) $(gen_fib_LDADD) $(LIBS)
+
+gen-jacobitab$(EXEEXT): $(gen_jacobitab_OBJECTS) $(gen_jacobitab_DEPENDENCIES) $(EXTRA_gen_jacobitab_DEPENDENCIES)
+ @rm -f gen-jacobitab$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(gen_jacobitab_OBJECTS) $(gen_jacobitab_LDADD) $(LIBS)
+
+gen-psqr$(EXEEXT): $(gen_psqr_OBJECTS) $(gen_psqr_DEPENDENCIES) $(EXTRA_gen_psqr_DEPENDENCIES)
+ @rm -f gen-psqr$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(gen_psqr_OBJECTS) $(gen_psqr_LDADD) $(LIBS)
+
+gen-trialdivtab$(EXEEXT): $(gen_trialdivtab_OBJECTS) $(gen_trialdivtab_DEPENDENCIES) $(EXTRA_gen_trialdivtab_DEPENDENCIES)
+ @rm -f gen-trialdivtab$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(gen_trialdivtab_OBJECTS) $(gen_trialdivtab_LDADD) $(LIBS)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gen-bases.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gen-fac.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gen-fib.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gen-jacobitab.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gen-psqr.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gen-trialdivtab.Po@am__quote@
+
+.c.o:
+@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
+@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
+@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
+
+.c.obj:
+@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\
+@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\
+@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+ID: $(am__tagged_files)
+ $(am__define_uniq_tagged_files); mkid -fID $$unique
+tags: tags-am
+TAGS: tags
+
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+ set x; \
+ here=`pwd`; \
+ $(am__define_uniq_tagged_files); \
+ shift; \
+ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ if test $$# -gt 0; then \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ "$$@" $$unique; \
+ else \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$unique; \
+ fi; \
+ fi
+ctags: ctags-am
+
+CTAGS: ctags
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+ $(am__define_uniq_tagged_files); \
+ test -z "$(CTAGS_ARGS)$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && $(am__cd) $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) "$$here"
+cscope: cscope.files
+ test ! -s cscope.files \
+ || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS)
+clean-cscope:
+ -rm -f cscope.files
+cscope.files: clean-cscope cscopelist
+cscopelist: cscopelist-am
+
+cscopelist-am: $(am__tagged_files)
+ list='$(am__tagged_files)'; \
+ case "$(srcdir)" in \
+ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+ *) sdir=$(subdir)/$(srcdir) ;; \
+ esac; \
+ for i in $$list; do \
+ if test -f "$$i"; then \
+ echo "$(subdir)/$$i"; \
+ else \
+ echo "$$sdir/$$i"; \
+ fi; \
+ done >> $(top_builddir)/cscope.files
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+ -rm -f cscope.out cscope.in.out cscope.po.out cscope.files
+
+distdir: $(DISTFILES)
+ $(am__remove_distdir)
+ test -d "$(distdir)" || mkdir "$(distdir)"
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d "$(distdir)/$$file"; then \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+ else \
+ test -f "$(distdir)/$$file" \
+ || cp -p $$d/$$file "$(distdir)/$$file" \
+ || exit 1; \
+ fi; \
+ done
+ $(MAKE) $(AM_MAKEFLAGS) \
+ top_distdir="$(top_distdir)" distdir="$(distdir)" \
+ dist-hook
+ -test -n "$(am__skip_mode_fix)" \
+ || find "$(distdir)" -type d ! -perm -755 \
+ -exec chmod u+rwx,go+rx {} \; -o \
+ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
+ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \
+ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
+ || chmod -R a+r "$(distdir)"
+dist-gzip: distdir
+ tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
+ $(am__post_remove_distdir)
+
+dist-bzip2: distdir
+ tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2
+ $(am__post_remove_distdir)
+
+dist-lzip: distdir
+ tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz
+ $(am__post_remove_distdir)
+
+dist-xz: distdir
+ tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz
+ $(am__post_remove_distdir)
+
+dist-tarZ: distdir
+ @echo WARNING: "Support for shar distribution archives is" \
+ "deprecated." >&2
+ @echo WARNING: "It will be removed altogether in Automake 2.0" >&2
+ tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
+ $(am__post_remove_distdir)
+
+dist-shar: distdir
+ @echo WARNING: "Support for distribution archives compressed with" \
+ "legacy program 'compress' is deprecated." >&2
+ @echo WARNING: "It will be removed altogether in Automake 2.0" >&2
+ shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
+ $(am__post_remove_distdir)
+
+dist-zip: distdir
+ -rm -f $(distdir).zip
+ zip -rq $(distdir).zip $(distdir)
+ $(am__post_remove_distdir)
+
+dist dist-all:
+ $(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:'
+ $(am__post_remove_distdir)
+
+# This target untars the dist file and tries a VPATH configuration. Then
+# it guarantees that the distribution is self-contained by making another
+# tarfile.
+distcheck: dist
+ case '$(DIST_ARCHIVES)' in \
+ *.tar.gz*) \
+ GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\
+ *.tar.bz2*) \
+ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
+ *.tar.lz*) \
+ lzip -dc $(distdir).tar.lz | $(am__untar) ;;\
+ *.tar.xz*) \
+ xz -dc $(distdir).tar.xz | $(am__untar) ;;\
+ *.tar.Z*) \
+ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
+ *.shar.gz*) \
+ GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\
+ *.zip*) \
+ unzip $(distdir).zip ;;\
+ esac
+ chmod -R a-w $(distdir)
+ chmod u+w $(distdir)
+ mkdir $(distdir)/_build $(distdir)/_inst
+ chmod a-w $(distdir)
+ test -d $(distdir)/_build || exit 0; \
+ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
+ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
+ && am__cwd=`pwd` \
+ && $(am__cd) $(distdir)/_build \
+ && ../configure \
+ $(AM_DISTCHECK_CONFIGURE_FLAGS) \
+ $(DISTCHECK_CONFIGURE_FLAGS) \
+ --srcdir=.. --prefix="$$dc_install_base" \
+ && $(MAKE) $(AM_MAKEFLAGS) \
+ && $(MAKE) $(AM_MAKEFLAGS) dvi \
+ && $(MAKE) $(AM_MAKEFLAGS) check \
+ && $(MAKE) $(AM_MAKEFLAGS) install \
+ && $(MAKE) $(AM_MAKEFLAGS) installcheck \
+ && $(MAKE) $(AM_MAKEFLAGS) uninstall \
+ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \
+ distuninstallcheck \
+ && chmod -R a-w "$$dc_install_base" \
+ && ({ \
+ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \
+ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \
+ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \
+ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \
+ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \
+ } || { rm -rf "$$dc_destdir"; exit 1; }) \
+ && rm -rf "$$dc_destdir" \
+ && $(MAKE) $(AM_MAKEFLAGS) dist \
+ && rm -rf $(DIST_ARCHIVES) \
+ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \
+ && cd "$$am__cwd" \
+ || exit 1
+ $(am__post_remove_distdir)
+ @(echo "$(distdir) archives ready for distribution: "; \
+ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
+ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'
+distuninstallcheck:
+ @test -n '$(distuninstallcheck_dir)' || { \
+ echo 'ERROR: trying to run $@ with an empty' \
+ '$$(distuninstallcheck_dir)' >&2; \
+ exit 1; \
+ }; \
+ $(am__cd) '$(distuninstallcheck_dir)' || { \
+ echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \
+ exit 1; \
+ }; \
+ test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \
+ || { echo "ERROR: files left after uninstall:" ; \
+ if test -n "$(DESTDIR)"; then \
+ echo " (check DESTDIR support)"; \
+ fi ; \
+ $(distuninstallcheck_listfiles) ; \
+ exit 1; } >&2
+distcleancheck: distclean
+ @if test '$(srcdir)' = . ; then \
+ echo "ERROR: distcleancheck can only run from a VPATH build" ; \
+ exit 1 ; \
+ fi
+ @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \
+ || { echo "ERROR: files left in build directory after distclean:" ; \
+ $(distcleancheck_listfiles) ; \
+ exit 1; } >&2
+check-am: all-am
+check: check-am
+all-am: Makefile config.h
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ if test -z '$(STRIP)'; then \
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ install; \
+ else \
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+ fi
+mostlyclean-generic:
+
+clean-generic:
+ -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+ -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+ -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic mostlyclean-am
+
+distclean: distclean-am
+ -rm -f $(am__CONFIG_DISTCLEAN_FILES)
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-hdr distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -f $(am__CONFIG_DISTCLEAN_FILES)
+ -rm -rf $(top_srcdir)/autom4te.cache
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am:
+
+.MAKE: all install-am install-strip
+
+.PHONY: CTAGS GTAGS TAGS all all-am am--refresh check check-am clean \
+ clean-cscope clean-generic cscope cscopelist-am ctags ctags-am \
+ dist dist-all dist-bzip2 dist-gzip dist-hook dist-lzip \
+ dist-shar dist-tarZ dist-xz dist-zip distcheck distclean \
+ distclean-compile distclean-generic distclean-hdr \
+ distclean-tags distcleancheck distdir distuninstallcheck dvi \
+ dvi-am html html-am info info-am install install-am \
+ install-data install-data-am install-dvi install-dvi-am \
+ install-exec install-exec-am install-html install-html-am \
+ install-info install-info-am install-man install-pdf \
+ install-pdf-am install-ps install-ps-am install-strip \
+ installcheck installcheck-am installdirs maintainer-clean \
+ maintainer-clean-generic mostlyclean mostlyclean-compile \
+ mostlyclean-generic pdf pdf-am ps ps-am tags tags-am uninstall \
+ uninstall-am
+
+
+dist-hook:
+ rm -rf `find $(distdir) -name '*.c'`
+stamp-bases: gen-bases$(EXEEXT)
+ echo timestamp >$@
+stamp-fac: gen-fac$(EXEEXT)
+ echo timestamp >$@
+stamp-fib: gen-fib$(EXEEXT)
+ echo timestamp >$@
+stamp-jacobitab: gen-jacobitab$(EXEEXT)
+ echo timestamp >$@
+stamp-psqr: gen-psqr$(EXEEXT)
+ echo timestamp >$@
+stamp-trialdivtab: gen-trialdivtab$(EXEEXT)
+ echo timestamp >$@
+
+$(built_sources):
+ @rm -f $@
+ $(AM_V_LINK)$(LN_S) $(srcdir)/$(GMP_TREE)/$@ $@
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/Build/source/libs/gmp/native/aclocal.m4 b/Build/source/libs/gmp/native/aclocal.m4
new file mode 100644
index 00000000000..6ff51315444
--- /dev/null
+++ b/Build/source/libs/gmp/native/aclocal.m4
@@ -0,0 +1,1188 @@
+# generated automatically by aclocal 1.14.1 -*- Autoconf -*-
+
+# Copyright (C) 1996-2013 Free Software Foundation, Inc.
+
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])
+m4_ifndef([AC_AUTOCONF_VERSION],
+ [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
+m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],,
+[m4_warning([this file was generated for autoconf 2.69.
+You have another version of autoconf. It may work, but is not guaranteed to.
+If you have problems, you may need to regenerate the build system entirely.
+To do so, use the procedure documented by the package, typically 'autoreconf'.])])
+
+# Copyright (C) 2002-2013 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_AUTOMAKE_VERSION(VERSION)
+# ----------------------------
+# Automake X.Y traces this macro to ensure aclocal.m4 has been
+# generated from the m4 files accompanying Automake X.Y.
+# (This private macro should not be called outside this file.)
+AC_DEFUN([AM_AUTOMAKE_VERSION],
+[am__api_version='1.14'
+dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
+dnl require some minimum version. Point them to the right macro.
+m4_if([$1], [1.14.1], [],
+ [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
+])
+
+# _AM_AUTOCONF_VERSION(VERSION)
+# -----------------------------
+# aclocal traces this macro to find the Autoconf version.
+# This is a private macro too. Using m4_define simplifies
+# the logic in aclocal, which can simply ignore this definition.
+m4_define([_AM_AUTOCONF_VERSION], [])
+
+# AM_SET_CURRENT_AUTOMAKE_VERSION
+# -------------------------------
+# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
+# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
+AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
+[AM_AUTOMAKE_VERSION([1.14.1])dnl
+m4_ifndef([AC_AUTOCONF_VERSION],
+ [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
+_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
+
+# AM_AUX_DIR_EXPAND -*- Autoconf -*-
+
+# Copyright (C) 2001-2013 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
+# $ac_aux_dir to '$srcdir/foo'. In other projects, it is set to
+# '$srcdir', '$srcdir/..', or '$srcdir/../..'.
+#
+# Of course, Automake must honor this variable whenever it calls a
+# tool from the auxiliary directory. The problem is that $srcdir (and
+# therefore $ac_aux_dir as well) can be either absolute or relative,
+# depending on how configure is run. This is pretty annoying, since
+# it makes $ac_aux_dir quite unusable in subdirectories: in the top
+# source directory, any form will work fine, but in subdirectories a
+# relative path needs to be adjusted first.
+#
+# $ac_aux_dir/missing
+# fails when called from a subdirectory if $ac_aux_dir is relative
+# $top_srcdir/$ac_aux_dir/missing
+# fails if $ac_aux_dir is absolute,
+# fails when called from a subdirectory in a VPATH build with
+# a relative $ac_aux_dir
+#
+# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
+# are both prefixed by $srcdir. In an in-source build this is usually
+# harmless because $srcdir is '.', but things will broke when you
+# start a VPATH build or use an absolute $srcdir.
+#
+# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
+# iff we strip the leading $srcdir from $ac_aux_dir. That would be:
+# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
+# and then we would define $MISSING as
+# MISSING="\${SHELL} $am_aux_dir/missing"
+# This will work as long as MISSING is not called from configure, because
+# unfortunately $(top_srcdir) has no meaning in configure.
+# However there are other variables, like CC, which are often used in
+# configure, and could therefore not use this "fixed" $ac_aux_dir.
+#
+# Another solution, used here, is to always expand $ac_aux_dir to an
+# absolute PATH. The drawback is that using absolute paths prevent a
+# configured tree to be moved without reconfiguration.
+
+AC_DEFUN([AM_AUX_DIR_EXPAND],
+[dnl Rely on autoconf to set up CDPATH properly.
+AC_PREREQ([2.50])dnl
+# expand $ac_aux_dir to an absolute path
+am_aux_dir=`cd $ac_aux_dir && pwd`
+])
+
+# AM_CONDITIONAL -*- Autoconf -*-
+
+# Copyright (C) 1997-2013 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_CONDITIONAL(NAME, SHELL-CONDITION)
+# -------------------------------------
+# Define a conditional.
+AC_DEFUN([AM_CONDITIONAL],
+[AC_PREREQ([2.52])dnl
+ m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])],
+ [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
+AC_SUBST([$1_TRUE])dnl
+AC_SUBST([$1_FALSE])dnl
+_AM_SUBST_NOTMAKE([$1_TRUE])dnl
+_AM_SUBST_NOTMAKE([$1_FALSE])dnl
+m4_define([_AM_COND_VALUE_$1], [$2])dnl
+if $2; then
+ $1_TRUE=
+ $1_FALSE='#'
+else
+ $1_TRUE='#'
+ $1_FALSE=
+fi
+AC_CONFIG_COMMANDS_PRE(
+[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
+ AC_MSG_ERROR([[conditional "$1" was never defined.
+Usually this means the macro was only invoked conditionally.]])
+fi])])
+
+# Copyright (C) 1999-2013 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+
+# There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be
+# written in clear, in which case automake, when reading aclocal.m4,
+# will think it sees a *use*, and therefore will trigger all it's
+# C support machinery. Also note that it means that autoscan, seeing
+# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
+
+
+# _AM_DEPENDENCIES(NAME)
+# ----------------------
+# See how the compiler implements dependency checking.
+# NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC".
+# We try a few techniques and use that to set a single cache variable.
+#
+# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
+# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
+# dependency, and given that the user is not expected to run this macro,
+# just rely on AC_PROG_CC.
+AC_DEFUN([_AM_DEPENDENCIES],
+[AC_REQUIRE([AM_SET_DEPDIR])dnl
+AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
+AC_REQUIRE([AM_MAKE_INCLUDE])dnl
+AC_REQUIRE([AM_DEP_TRACK])dnl
+
+m4_if([$1], [CC], [depcc="$CC" am_compiler_list=],
+ [$1], [CXX], [depcc="$CXX" am_compiler_list=],
+ [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
+ [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'],
+ [$1], [UPC], [depcc="$UPC" am_compiler_list=],
+ [$1], [GCJ], [depcc="$GCJ" am_compiler_list='gcc3 gcc'],
+ [depcc="$$1" am_compiler_list=])
+
+AC_CACHE_CHECK([dependency style of $depcc],
+ [am_cv_$1_dependencies_compiler_type],
+[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+ # We make a subdir and do the tests there. Otherwise we can end up
+ # making bogus files that we don't know about and never remove. For
+ # instance it was reported that on HP-UX the gcc test will end up
+ # making a dummy file named 'D' -- because '-MD' means "put the output
+ # in D".
+ rm -rf conftest.dir
+ mkdir conftest.dir
+ # Copy depcomp to subdir because otherwise we won't find it if we're
+ # using a relative directory.
+ cp "$am_depcomp" conftest.dir
+ cd conftest.dir
+ # We will build objects and dependencies in a subdirectory because
+ # it helps to detect inapplicable dependency modes. For instance
+ # both Tru64's cc and ICC support -MD to output dependencies as a
+ # side effect of compilation, but ICC will put the dependencies in
+ # the current directory while Tru64 will put them in the object
+ # directory.
+ mkdir sub
+
+ am_cv_$1_dependencies_compiler_type=none
+ if test "$am_compiler_list" = ""; then
+ am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
+ fi
+ am__universal=false
+ m4_case([$1], [CC],
+ [case " $depcc " in #(
+ *\ -arch\ *\ -arch\ *) am__universal=true ;;
+ esac],
+ [CXX],
+ [case " $depcc " in #(
+ *\ -arch\ *\ -arch\ *) am__universal=true ;;
+ esac])
+
+ for depmode in $am_compiler_list; do
+ # Setup a source with many dependencies, because some compilers
+ # like to wrap large dependency lists on column 80 (with \), and
+ # we should not choose a depcomp mode which is confused by this.
+ #
+ # We need to recreate these files for each test, as the compiler may
+ # overwrite some of them when testing with obscure command lines.
+ # This happens at least with the AIX C compiler.
+ : > sub/conftest.c
+ for i in 1 2 3 4 5 6; do
+ echo '#include "conftst'$i'.h"' >> sub/conftest.c
+ # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
+ # Solaris 10 /bin/sh.
+ echo '/* dummy */' > sub/conftst$i.h
+ done
+ echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+ # We check with '-c' and '-o' for the sake of the "dashmstdout"
+ # mode. It turns out that the SunPro C++ compiler does not properly
+ # handle '-M -o', and we need to detect this. Also, some Intel
+ # versions had trouble with output in subdirs.
+ am__obj=sub/conftest.${OBJEXT-o}
+ am__minus_obj="-o $am__obj"
+ case $depmode in
+ gcc)
+ # This depmode causes a compiler race in universal mode.
+ test "$am__universal" = false || continue
+ ;;
+ nosideeffect)
+ # After this tag, mechanisms are not by side-effect, so they'll
+ # only be used when explicitly requested.
+ if test "x$enable_dependency_tracking" = xyes; then
+ continue
+ else
+ break
+ fi
+ ;;
+ msvc7 | msvc7msys | msvisualcpp | msvcmsys)
+ # This compiler won't grok '-c -o', but also, the minuso test has
+ # not run yet. These depmodes are late enough in the game, and
+ # so weak that their functioning should not be impacted.
+ am__obj=conftest.${OBJEXT-o}
+ am__minus_obj=
+ ;;
+ none) break ;;
+ esac
+ if depmode=$depmode \
+ source=sub/conftest.c object=$am__obj \
+ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
+ >/dev/null 2>conftest.err &&
+ grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
+ grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+ grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
+ ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+ # icc doesn't choke on unknown options, it will just issue warnings
+ # or remarks (even with -Werror). So we grep stderr for any message
+ # that says an option was ignored or not supported.
+ # When given -MP, icc 7.0 and 7.1 complain thusly:
+ # icc: Command line warning: ignoring option '-M'; no argument required
+ # The diagnosis changed in icc 8.0:
+ # icc: Command line remark: option '-MP' not supported
+ if (grep 'ignoring option' conftest.err ||
+ grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
+ am_cv_$1_dependencies_compiler_type=$depmode
+ break
+ fi
+ fi
+ done
+
+ cd ..
+ rm -rf conftest.dir
+else
+ am_cv_$1_dependencies_compiler_type=none
+fi
+])
+AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
+AM_CONDITIONAL([am__fastdep$1], [
+ test "x$enable_dependency_tracking" != xno \
+ && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
+])
+
+
+# AM_SET_DEPDIR
+# -------------
+# Choose a directory name for dependency files.
+# This macro is AC_REQUIREd in _AM_DEPENDENCIES.
+AC_DEFUN([AM_SET_DEPDIR],
+[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
+AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
+])
+
+
+# AM_DEP_TRACK
+# ------------
+AC_DEFUN([AM_DEP_TRACK],
+[AC_ARG_ENABLE([dependency-tracking], [dnl
+AS_HELP_STRING(
+ [--enable-dependency-tracking],
+ [do not reject slow dependency extractors])
+AS_HELP_STRING(
+ [--disable-dependency-tracking],
+ [speeds up one-time build])])
+if test "x$enable_dependency_tracking" != xno; then
+ am_depcomp="$ac_aux_dir/depcomp"
+ AMDEPBACKSLASH='\'
+ am__nodep='_no'
+fi
+AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
+AC_SUBST([AMDEPBACKSLASH])dnl
+_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
+AC_SUBST([am__nodep])dnl
+_AM_SUBST_NOTMAKE([am__nodep])dnl
+])
+
+# Generate code to set up dependency tracking. -*- Autoconf -*-
+
+# Copyright (C) 1999-2013 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+
+# _AM_OUTPUT_DEPENDENCY_COMMANDS
+# ------------------------------
+AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
+[{
+ # Older Autoconf quotes --file arguments for eval, but not when files
+ # are listed without --file. Let's play safe and only enable the eval
+ # if we detect the quoting.
+ case $CONFIG_FILES in
+ *\'*) eval set x "$CONFIG_FILES" ;;
+ *) set x $CONFIG_FILES ;;
+ esac
+ shift
+ for mf
+ do
+ # Strip MF so we end up with the name of the file.
+ mf=`echo "$mf" | sed -e 's/:.*$//'`
+ # Check whether this is an Automake generated Makefile or not.
+ # We used to match only the files named 'Makefile.in', but
+ # some people rename them; so instead we look at the file content.
+ # Grep'ing the first line is not enough: some people post-process
+ # each Makefile.in and add a new line on top of each file to say so.
+ # Grep'ing the whole file is not good either: AIX grep has a line
+ # limit of 2048, but all sed's we know have understand at least 4000.
+ if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
+ dirpart=`AS_DIRNAME("$mf")`
+ else
+ continue
+ fi
+ # Extract the definition of DEPDIR, am__include, and am__quote
+ # from the Makefile without running 'make'.
+ DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
+ test -z "$DEPDIR" && continue
+ am__include=`sed -n 's/^am__include = //p' < "$mf"`
+ test -z "$am__include" && continue
+ am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
+ # Find all dependency output files, they are included files with
+ # $(DEPDIR) in their names. We invoke sed twice because it is the
+ # simplest approach to changing $(DEPDIR) to its actual value in the
+ # expansion.
+ for file in `sed -n "
+ s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
+ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
+ # Make sure the directory exists.
+ test -f "$dirpart/$file" && continue
+ fdir=`AS_DIRNAME(["$file"])`
+ AS_MKDIR_P([$dirpart/$fdir])
+ # echo "creating $dirpart/$file"
+ echo '# dummy' > "$dirpart/$file"
+ done
+ done
+}
+])# _AM_OUTPUT_DEPENDENCY_COMMANDS
+
+
+# AM_OUTPUT_DEPENDENCY_COMMANDS
+# -----------------------------
+# This macro should only be invoked once -- use via AC_REQUIRE.
+#
+# This code is only required when automatic dependency tracking
+# is enabled. FIXME. This creates each '.P' file that we will
+# need in order to bootstrap the dependency handling code.
+AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
+[AC_CONFIG_COMMANDS([depfiles],
+ [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
+ [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
+])
+
+# Do all the work for Automake. -*- Autoconf -*-
+
+# Copyright (C) 1996-2013 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This macro actually does too much. Some checks are only needed if
+# your package does certain things. But this isn't really a big deal.
+
+dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O.
+m4_define([AC_PROG_CC],
+m4_defn([AC_PROG_CC])
+[_AM_PROG_CC_C_O
+])
+
+# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
+# AM_INIT_AUTOMAKE([OPTIONS])
+# -----------------------------------------------
+# The call with PACKAGE and VERSION arguments is the old style
+# call (pre autoconf-2.50), which is being phased out. PACKAGE
+# and VERSION should now be passed to AC_INIT and removed from
+# the call to AM_INIT_AUTOMAKE.
+# We support both call styles for the transition. After
+# the next Automake release, Autoconf can make the AC_INIT
+# arguments mandatory, and then we can depend on a new Autoconf
+# release and drop the old call support.
+AC_DEFUN([AM_INIT_AUTOMAKE],
+[AC_PREREQ([2.65])dnl
+dnl Autoconf wants to disallow AM_ names. We explicitly allow
+dnl the ones we care about.
+m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
+AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
+AC_REQUIRE([AC_PROG_INSTALL])dnl
+if test "`cd $srcdir && pwd`" != "`pwd`"; then
+ # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
+ # is not polluted with repeated "-I."
+ AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
+ # test to see if srcdir already configured
+ if test -f $srcdir/config.status; then
+ AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
+ fi
+fi
+
+# test whether we have cygpath
+if test -z "$CYGPATH_W"; then
+ if (cygpath --version) >/dev/null 2>/dev/null; then
+ CYGPATH_W='cygpath -w'
+ else
+ CYGPATH_W=echo
+ fi
+fi
+AC_SUBST([CYGPATH_W])
+
+# Define the identity of the package.
+dnl Distinguish between old-style and new-style calls.
+m4_ifval([$2],
+[AC_DIAGNOSE([obsolete],
+ [$0: two- and three-arguments forms are deprecated.])
+m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
+ AC_SUBST([PACKAGE], [$1])dnl
+ AC_SUBST([VERSION], [$2])],
+[_AM_SET_OPTIONS([$1])dnl
+dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
+m4_if(
+ m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]),
+ [ok:ok],,
+ [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
+ AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
+ AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
+
+_AM_IF_OPTION([no-define],,
+[AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package])
+ AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl
+
+# Some tools Automake needs.
+AC_REQUIRE([AM_SANITY_CHECK])dnl
+AC_REQUIRE([AC_ARG_PROGRAM])dnl
+AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}])
+AM_MISSING_PROG([AUTOCONF], [autoconf])
+AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}])
+AM_MISSING_PROG([AUTOHEADER], [autoheader])
+AM_MISSING_PROG([MAKEINFO], [makeinfo])
+AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
+AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
+AC_REQUIRE([AC_PROG_MKDIR_P])dnl
+# For better backward compatibility. To be removed once Automake 1.9.x
+# dies out for good. For more background, see:
+# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
+# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
+AC_SUBST([mkdir_p], ['$(MKDIR_P)'])
+# We need awk for the "check" target. The system "awk" is bad on
+# some platforms.
+AC_REQUIRE([AC_PROG_AWK])dnl
+AC_REQUIRE([AC_PROG_MAKE_SET])dnl
+AC_REQUIRE([AM_SET_LEADING_DOT])dnl
+_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
+ [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
+ [_AM_PROG_TAR([v7])])])
+_AM_IF_OPTION([no-dependencies],,
+[AC_PROVIDE_IFELSE([AC_PROG_CC],
+ [_AM_DEPENDENCIES([CC])],
+ [m4_define([AC_PROG_CC],
+ m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl
+AC_PROVIDE_IFELSE([AC_PROG_CXX],
+ [_AM_DEPENDENCIES([CXX])],
+ [m4_define([AC_PROG_CXX],
+ m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl
+AC_PROVIDE_IFELSE([AC_PROG_OBJC],
+ [_AM_DEPENDENCIES([OBJC])],
+ [m4_define([AC_PROG_OBJC],
+ m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl
+AC_PROVIDE_IFELSE([AC_PROG_OBJCXX],
+ [_AM_DEPENDENCIES([OBJCXX])],
+ [m4_define([AC_PROG_OBJCXX],
+ m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl
+])
+AC_REQUIRE([AM_SILENT_RULES])dnl
+dnl The testsuite driver may need to know about EXEEXT, so add the
+dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This
+dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below.
+AC_CONFIG_COMMANDS_PRE(dnl
+[m4_provide_if([_AM_COMPILER_EXEEXT],
+ [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
+
+# POSIX will say in a future version that running "rm -f" with no argument
+# is OK; and we want to be able to make that assumption in our Makefile
+# recipes. So use an aggressive probe to check that the usage we want is
+# actually supported "in the wild" to an acceptable degree.
+# See automake bug#10828.
+# To make any issue more visible, cause the running configure to be aborted
+# by default if the 'rm' program in use doesn't match our expectations; the
+# user can still override this though.
+if rm -f && rm -fr && rm -rf; then : OK; else
+ cat >&2 <<'END'
+Oops!
+
+Your 'rm' program seems unable to run without file operands specified
+on the command line, even when the '-f' option is present. This is contrary
+to the behaviour of most rm programs out there, and not conforming with
+the upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542>
+
+Please tell bug-automake@gnu.org about your system, including the value
+of your $PATH and any error possibly output before this message. This
+can help us improve future automake versions.
+
+END
+ if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then
+ echo 'Configuration will proceed anyway, since you have set the' >&2
+ echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2
+ echo >&2
+ else
+ cat >&2 <<'END'
+Aborting the configuration process, to ensure you take notice of the issue.
+
+You can download and install GNU coreutils to get an 'rm' implementation
+that behaves properly: <http://www.gnu.org/software/coreutils/>.
+
+If you want to complete the configuration process using your problematic
+'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
+to "yes", and re-run configure.
+
+END
+ AC_MSG_ERROR([Your 'rm' program is bad, sorry.])
+ fi
+fi])
+
+dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not
+dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
+dnl mangled by Autoconf and run in a shell conditional statement.
+m4_define([_AC_COMPILER_EXEEXT],
+m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
+
+# When config.status generates a header, we must update the stamp-h file.
+# This file resides in the same directory as the config header
+# that is generated. The stamp files are numbered to have different names.
+
+# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
+# loop where config.status creates the headers, so we can generate
+# our stamp files there.
+AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
+[# Compute $1's index in $config_headers.
+_am_arg=$1
+_am_stamp_count=1
+for _am_header in $config_headers :; do
+ case $_am_header in
+ $_am_arg | $_am_arg:* )
+ break ;;
+ * )
+ _am_stamp_count=`expr $_am_stamp_count + 1` ;;
+ esac
+done
+echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
+
+# Copyright (C) 2001-2013 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_PROG_INSTALL_SH
+# ------------------
+# Define $install_sh.
+AC_DEFUN([AM_PROG_INSTALL_SH],
+[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+if test x"${install_sh}" != xset; then
+ case $am_aux_dir in
+ *\ * | *\ *)
+ install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
+ *)
+ install_sh="\${SHELL} $am_aux_dir/install-sh"
+ esac
+fi
+AC_SUBST([install_sh])])
+
+# Copyright (C) 2003-2013 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# Check whether the underlying file-system supports filenames
+# with a leading dot. For instance MS-DOS doesn't.
+AC_DEFUN([AM_SET_LEADING_DOT],
+[rm -rf .tst 2>/dev/null
+mkdir .tst 2>/dev/null
+if test -d .tst; then
+ am__leading_dot=.
+else
+ am__leading_dot=_
+fi
+rmdir .tst 2>/dev/null
+AC_SUBST([am__leading_dot])])
+
+# Add --enable-maintainer-mode option to configure. -*- Autoconf -*-
+# From Jim Meyering
+
+# Copyright (C) 1996-2013 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_MAINTAINER_MODE([DEFAULT-MODE])
+# ----------------------------------
+# Control maintainer-specific portions of Makefiles.
+# Default is to disable them, unless 'enable' is passed literally.
+# For symmetry, 'disable' may be passed as well. Anyway, the user
+# can override the default with the --enable/--disable switch.
+AC_DEFUN([AM_MAINTAINER_MODE],
+[m4_case(m4_default([$1], [disable]),
+ [enable], [m4_define([am_maintainer_other], [disable])],
+ [disable], [m4_define([am_maintainer_other], [enable])],
+ [m4_define([am_maintainer_other], [enable])
+ m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])])
+AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
+ dnl maintainer-mode's default is 'disable' unless 'enable' is passed
+ AC_ARG_ENABLE([maintainer-mode],
+ [AS_HELP_STRING([--]am_maintainer_other[-maintainer-mode],
+ am_maintainer_other[ make rules and dependencies not useful
+ (and sometimes confusing) to the casual installer])],
+ [USE_MAINTAINER_MODE=$enableval],
+ [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes]))
+ AC_MSG_RESULT([$USE_MAINTAINER_MODE])
+ AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes])
+ MAINT=$MAINTAINER_MODE_TRUE
+ AC_SUBST([MAINT])dnl
+]
+)
+
+# Check to see how 'make' treats includes. -*- Autoconf -*-
+
+# Copyright (C) 2001-2013 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_MAKE_INCLUDE()
+# -----------------
+# Check to see how make treats includes.
+AC_DEFUN([AM_MAKE_INCLUDE],
+[am_make=${MAKE-make}
+cat > confinc << 'END'
+am__doit:
+ @echo this is the am__doit target
+.PHONY: am__doit
+END
+# If we don't find an include directive, just comment out the code.
+AC_MSG_CHECKING([for style of include used by $am_make])
+am__include="#"
+am__quote=
+_am_result=none
+# First try GNU make style include.
+echo "include confinc" > confmf
+# Ignore all kinds of additional output from 'make'.
+case `$am_make -s -f confmf 2> /dev/null` in #(
+*the\ am__doit\ target*)
+ am__include=include
+ am__quote=
+ _am_result=GNU
+ ;;
+esac
+# Now try BSD make style include.
+if test "$am__include" = "#"; then
+ echo '.include "confinc"' > confmf
+ case `$am_make -s -f confmf 2> /dev/null` in #(
+ *the\ am__doit\ target*)
+ am__include=.include
+ am__quote="\""
+ _am_result=BSD
+ ;;
+ esac
+fi
+AC_SUBST([am__include])
+AC_SUBST([am__quote])
+AC_MSG_RESULT([$_am_result])
+rm -f confinc confmf
+])
+
+# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
+
+# Copyright (C) 1997-2013 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_MISSING_PROG(NAME, PROGRAM)
+# ------------------------------
+AC_DEFUN([AM_MISSING_PROG],
+[AC_REQUIRE([AM_MISSING_HAS_RUN])
+$1=${$1-"${am_missing_run}$2"}
+AC_SUBST($1)])
+
+# AM_MISSING_HAS_RUN
+# ------------------
+# Define MISSING if not defined so far and test if it is modern enough.
+# If it is, set am_missing_run to use it, otherwise, to nothing.
+AC_DEFUN([AM_MISSING_HAS_RUN],
+[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+AC_REQUIRE_AUX_FILE([missing])dnl
+if test x"${MISSING+set}" != xset; then
+ case $am_aux_dir in
+ *\ * | *\ *)
+ MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
+ *)
+ MISSING="\${SHELL} $am_aux_dir/missing" ;;
+ esac
+fi
+# Use eval to expand $SHELL
+if eval "$MISSING --is-lightweight"; then
+ am_missing_run="$MISSING "
+else
+ am_missing_run=
+ AC_MSG_WARN(['missing' script is too old or missing])
+fi
+])
+
+# Helper functions for option handling. -*- Autoconf -*-
+
+# Copyright (C) 2001-2013 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# _AM_MANGLE_OPTION(NAME)
+# -----------------------
+AC_DEFUN([_AM_MANGLE_OPTION],
+[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
+
+# _AM_SET_OPTION(NAME)
+# --------------------
+# Set option NAME. Presently that only means defining a flag for this option.
+AC_DEFUN([_AM_SET_OPTION],
+[m4_define(_AM_MANGLE_OPTION([$1]), [1])])
+
+# _AM_SET_OPTIONS(OPTIONS)
+# ------------------------
+# OPTIONS is a space-separated list of Automake options.
+AC_DEFUN([_AM_SET_OPTIONS],
+[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
+
+# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
+# -------------------------------------------
+# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
+AC_DEFUN([_AM_IF_OPTION],
+[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
+
+# Copyright (C) 1999-2013 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# _AM_PROG_CC_C_O
+# ---------------
+# Like AC_PROG_CC_C_O, but changed for automake. We rewrite AC_PROG_CC
+# to automatically call this.
+AC_DEFUN([_AM_PROG_CC_C_O],
+[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+AC_REQUIRE_AUX_FILE([compile])dnl
+AC_LANG_PUSH([C])dnl
+AC_CACHE_CHECK(
+ [whether $CC understands -c and -o together],
+ [am_cv_prog_cc_c_o],
+ [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])])
+ # Make sure it works both with $CC and with simple cc.
+ # Following AC_PROG_CC_C_O, we do the test twice because some
+ # compilers refuse to overwrite an existing .o file with -o,
+ # though they will create one.
+ am_cv_prog_cc_c_o=yes
+ for am_i in 1 2; do
+ if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \
+ && test -f conftest2.$ac_objext; then
+ : OK
+ else
+ am_cv_prog_cc_c_o=no
+ break
+ fi
+ done
+ rm -f core conftest*
+ unset am_i])
+if test "$am_cv_prog_cc_c_o" != yes; then
+ # Losing compiler, so override with the script.
+ # FIXME: It is wrong to rewrite CC.
+ # But if we don't then we get into trouble of one sort or another.
+ # A longer-term fix would be to have automake use am__CC in this case,
+ # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
+ CC="$am_aux_dir/compile $CC"
+fi
+AC_LANG_POP([C])])
+
+# For backward compatibility.
+AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])])
+
+# Copyright (C) 2001-2013 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_RUN_LOG(COMMAND)
+# -------------------
+# Run COMMAND, save the exit status in ac_status, and log it.
+# (This has been adapted from Autoconf's _AC_RUN_LOG macro.)
+AC_DEFUN([AM_RUN_LOG],
+[{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD
+ ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
+ (exit $ac_status); }])
+
+# Check to make sure that the build environment is sane. -*- Autoconf -*-
+
+# Copyright (C) 1996-2013 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_SANITY_CHECK
+# ---------------
+AC_DEFUN([AM_SANITY_CHECK],
+[AC_MSG_CHECKING([whether build environment is sane])
+# Reject unsafe characters in $srcdir or the absolute working directory
+# name. Accept space and tab only in the latter.
+am_lf='
+'
+case `pwd` in
+ *[[\\\"\#\$\&\'\`$am_lf]]*)
+ AC_MSG_ERROR([unsafe absolute working directory name]);;
+esac
+case $srcdir in
+ *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*)
+ AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);;
+esac
+
+# Do 'set' in a subshell so we don't clobber the current shell's
+# arguments. Must try -L first in case configure is actually a
+# symlink; some systems play weird games with the mod time of symlinks
+# (eg FreeBSD returns the mod time of the symlink's containing
+# directory).
+if (
+ am_has_slept=no
+ for am_try in 1 2; do
+ echo "timestamp, slept: $am_has_slept" > conftest.file
+ set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
+ if test "$[*]" = "X"; then
+ # -L didn't work.
+ set X `ls -t "$srcdir/configure" conftest.file`
+ fi
+ if test "$[*]" != "X $srcdir/configure conftest.file" \
+ && test "$[*]" != "X conftest.file $srcdir/configure"; then
+
+ # If neither matched, then we have a broken ls. This can happen
+ # if, for instance, CONFIG_SHELL is bash and it inherits a
+ # broken ls alias from the environment. This has actually
+ # happened. Such a system could not be considered "sane".
+ AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
+ alias in your environment])
+ fi
+ if test "$[2]" = conftest.file || test $am_try -eq 2; then
+ break
+ fi
+ # Just in case.
+ sleep 1
+ am_has_slept=yes
+ done
+ test "$[2]" = conftest.file
+ )
+then
+ # Ok.
+ :
+else
+ AC_MSG_ERROR([newly created file is older than distributed files!
+Check your system clock])
+fi
+AC_MSG_RESULT([yes])
+# If we didn't sleep, we still need to ensure time stamps of config.status and
+# generated files are strictly newer.
+am_sleep_pid=
+if grep 'slept: no' conftest.file >/dev/null 2>&1; then
+ ( sleep 1 ) &
+ am_sleep_pid=$!
+fi
+AC_CONFIG_COMMANDS_PRE(
+ [AC_MSG_CHECKING([that generated files are newer than configure])
+ if test -n "$am_sleep_pid"; then
+ # Hide warnings about reused PIDs.
+ wait $am_sleep_pid 2>/dev/null
+ fi
+ AC_MSG_RESULT([done])])
+rm -f conftest.file
+])
+
+# Copyright (C) 2009-2013 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_SILENT_RULES([DEFAULT])
+# --------------------------
+# Enable less verbose build rules; with the default set to DEFAULT
+# ("yes" being less verbose, "no" or empty being verbose).
+AC_DEFUN([AM_SILENT_RULES],
+[AC_ARG_ENABLE([silent-rules], [dnl
+AS_HELP_STRING(
+ [--enable-silent-rules],
+ [less verbose build output (undo: "make V=1")])
+AS_HELP_STRING(
+ [--disable-silent-rules],
+ [verbose build output (undo: "make V=0")])dnl
+])
+case $enable_silent_rules in @%:@ (((
+ yes) AM_DEFAULT_VERBOSITY=0;;
+ no) AM_DEFAULT_VERBOSITY=1;;
+ *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
+esac
+dnl
+dnl A few 'make' implementations (e.g., NonStop OS and NextStep)
+dnl do not support nested variable expansions.
+dnl See automake bug#9928 and bug#10237.
+am_make=${MAKE-make}
+AC_CACHE_CHECK([whether $am_make supports nested variables],
+ [am_cv_make_support_nested_variables],
+ [if AS_ECHO([['TRUE=$(BAR$(V))
+BAR0=false
+BAR1=true
+V=1
+am__doit:
+ @$(TRUE)
+.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then
+ am_cv_make_support_nested_variables=yes
+else
+ am_cv_make_support_nested_variables=no
+fi])
+if test $am_cv_make_support_nested_variables = yes; then
+ dnl Using '$V' instead of '$(V)' breaks IRIX make.
+ AM_V='$(V)'
+ AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
+else
+ AM_V=$AM_DEFAULT_VERBOSITY
+ AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
+fi
+AC_SUBST([AM_V])dnl
+AM_SUBST_NOTMAKE([AM_V])dnl
+AC_SUBST([AM_DEFAULT_V])dnl
+AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl
+AC_SUBST([AM_DEFAULT_VERBOSITY])dnl
+AM_BACKSLASH='\'
+AC_SUBST([AM_BACKSLASH])dnl
+_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
+])
+
+# Copyright (C) 2001-2013 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_PROG_INSTALL_STRIP
+# ---------------------
+# One issue with vendor 'install' (even GNU) is that you can't
+# specify the program used to strip binaries. This is especially
+# annoying in cross-compiling environments, where the build's strip
+# is unlikely to handle the host's binaries.
+# Fortunately install-sh will honor a STRIPPROG variable, so we
+# always use install-sh in "make install-strip", and initialize
+# STRIPPROG with the value of the STRIP variable (set by the user).
+AC_DEFUN([AM_PROG_INSTALL_STRIP],
+[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
+# Installed binaries are usually stripped using 'strip' when the user
+# run "make install-strip". However 'strip' might not be the right
+# tool to use in cross-compilation environments, therefore Automake
+# will honor the 'STRIP' environment variable to overrule this program.
+dnl Don't test for $cross_compiling = yes, because it might be 'maybe'.
+if test "$cross_compiling" != no; then
+ AC_CHECK_TOOL([STRIP], [strip], :)
+fi
+INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
+AC_SUBST([INSTALL_STRIP_PROGRAM])])
+
+# Copyright (C) 2006-2013 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# _AM_SUBST_NOTMAKE(VARIABLE)
+# ---------------------------
+# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
+# This macro is traced by Automake.
+AC_DEFUN([_AM_SUBST_NOTMAKE])
+
+# AM_SUBST_NOTMAKE(VARIABLE)
+# --------------------------
+# Public sister of _AM_SUBST_NOTMAKE.
+AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
+
+# Check how to create a tarball. -*- Autoconf -*-
+
+# Copyright (C) 2004-2013 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# _AM_PROG_TAR(FORMAT)
+# --------------------
+# Check how to create a tarball in format FORMAT.
+# FORMAT should be one of 'v7', 'ustar', or 'pax'.
+#
+# Substitute a variable $(am__tar) that is a command
+# writing to stdout a FORMAT-tarball containing the directory
+# $tardir.
+# tardir=directory && $(am__tar) > result.tar
+#
+# Substitute a variable $(am__untar) that extract such
+# a tarball read from stdin.
+# $(am__untar) < result.tar
+#
+AC_DEFUN([_AM_PROG_TAR],
+[# Always define AMTAR for backward compatibility. Yes, it's still used
+# in the wild :-( We should find a proper way to deprecate it ...
+AC_SUBST([AMTAR], ['$${TAR-tar}'])
+
+# We'll loop over all known methods to create a tar archive until one works.
+_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
+
+m4_if([$1], [v7],
+ [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'],
+
+ [m4_case([$1],
+ [ustar],
+ [# The POSIX 1988 'ustar' format is defined with fixed-size fields.
+ # There is notably a 21 bits limit for the UID and the GID. In fact,
+ # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343
+ # and bug#13588).
+ am_max_uid=2097151 # 2^21 - 1
+ am_max_gid=$am_max_uid
+ # The $UID and $GID variables are not portable, so we need to resort
+ # to the POSIX-mandated id(1) utility. Errors in the 'id' calls
+ # below are definitely unexpected, so allow the users to see them
+ # (that is, avoid stderr redirection).
+ am_uid=`id -u || echo unknown`
+ am_gid=`id -g || echo unknown`
+ AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format])
+ if test $am_uid -le $am_max_uid; then
+ AC_MSG_RESULT([yes])
+ else
+ AC_MSG_RESULT([no])
+ _am_tools=none
+ fi
+ AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format])
+ if test $am_gid -le $am_max_gid; then
+ AC_MSG_RESULT([yes])
+ else
+ AC_MSG_RESULT([no])
+ _am_tools=none
+ fi],
+
+ [pax],
+ [],
+
+ [m4_fatal([Unknown tar format])])
+
+ AC_MSG_CHECKING([how to create a $1 tar archive])
+
+ # Go ahead even if we have the value already cached. We do so because we
+ # need to set the values for the 'am__tar' and 'am__untar' variables.
+ _am_tools=${am_cv_prog_tar_$1-$_am_tools}
+
+ for _am_tool in $_am_tools; do
+ case $_am_tool in
+ gnutar)
+ for _am_tar in tar gnutar gtar; do
+ AM_RUN_LOG([$_am_tar --version]) && break
+ done
+ am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
+ am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
+ am__untar="$_am_tar -xf -"
+ ;;
+ plaintar)
+ # Must skip GNU tar: if it does not support --format= it doesn't create
+ # ustar tarball either.
+ (tar --version) >/dev/null 2>&1 && continue
+ am__tar='tar chf - "$$tardir"'
+ am__tar_='tar chf - "$tardir"'
+ am__untar='tar xf -'
+ ;;
+ pax)
+ am__tar='pax -L -x $1 -w "$$tardir"'
+ am__tar_='pax -L -x $1 -w "$tardir"'
+ am__untar='pax -r'
+ ;;
+ cpio)
+ am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
+ am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
+ am__untar='cpio -i -H $1 -d'
+ ;;
+ none)
+ am__tar=false
+ am__tar_=false
+ am__untar=false
+ ;;
+ esac
+
+ # If the value was cached, stop now. We just wanted to have am__tar
+ # and am__untar set.
+ test -n "${am_cv_prog_tar_$1}" && break
+
+ # tar/untar a dummy directory, and stop if the command works.
+ rm -rf conftest.dir
+ mkdir conftest.dir
+ echo GrepMe > conftest.dir/file
+ AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
+ rm -rf conftest.dir
+ if test -s conftest.tar; then
+ AM_RUN_LOG([$am__untar <conftest.tar])
+ AM_RUN_LOG([cat conftest.dir/file])
+ grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
+ fi
+ done
+ rm -rf conftest.dir
+
+ AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
+ AC_MSG_RESULT([$am_cv_prog_tar_$1])])
+
+AC_SUBST([am__tar])
+AC_SUBST([am__untar])
+]) # _AM_PROG_TAR
+
+m4_include([../../../m4/kpse-common.m4])
+m4_include([../../../m4/kpse-search-libs.m4])
+m4_include([../../../m4/kpse-warnings.m4])
diff --git a/Build/source/libs/gmp/native/config.h.in b/Build/source/libs/gmp/native/config.h.in
new file mode 100644
index 00000000000..dd3b02c5fcf
--- /dev/null
+++ b/Build/source/libs/gmp/native/config.h.in
@@ -0,0 +1,25 @@
+/* config.h.in. Generated from configure.ac by autoheader. */
+
+/* Name of package */
+#undef PACKAGE
+
+/* Define to the address where bug reports for this package should be sent. */
+#undef PACKAGE_BUGREPORT
+
+/* Define to the full name of this package. */
+#undef PACKAGE_NAME
+
+/* Define to the full name and version of this package. */
+#undef PACKAGE_STRING
+
+/* Define to the one symbol short name of this package. */
+#undef PACKAGE_TARNAME
+
+/* Define to the home page for this package. */
+#undef PACKAGE_URL
+
+/* Define to the version of this package. */
+#undef PACKAGE_VERSION
+
+/* Version number of package */
+#undef VERSION
diff --git a/Build/source/libs/gmp/native/configure b/Build/source/libs/gmp/native/configure
new file mode 100755
index 00000000000..01547862512
--- /dev/null
+++ b/Build/source/libs/gmp/native/configure
@@ -0,0 +1,5899 @@
+#! /bin/sh
+# Guess values for system-dependent variables and create Makefiles.
+# Generated by GNU Autoconf 2.69 for gmp native 6.0.0.
+#
+# Report bugs to <tex-k@tug.org>.
+#
+#
+# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
+#
+#
+# This configure script is free software; the Free Software Foundation
+# gives unlimited permission to copy, distribute and modify it.
+## -------------------- ##
+## M4sh Initialization. ##
+## -------------------- ##
+
+# Be more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
+ emulate sh
+ NULLCMD=:
+ # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '${1+"$@"}'='"$@"'
+ setopt NO_GLOB_SUBST
+else
+ case `(set -o) 2>/dev/null` in #(
+ *posix*) :
+ set -o posix ;; #(
+ *) :
+ ;;
+esac
+fi
+
+
+as_nl='
+'
+export as_nl
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+# Prefer a ksh shell builtin over an external printf program on Solaris,
+# but without wasting forks for bash or zsh.
+if test -z "$BASH_VERSION$ZSH_VERSION" \
+ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
+ as_echo='print -r --'
+ as_echo_n='print -rn --'
+elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+ as_echo='printf %s\n'
+ as_echo_n='printf %s'
+else
+ if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+ as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
+ as_echo_n='/usr/ucb/echo -n'
+ else
+ as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+ as_echo_n_body='eval
+ arg=$1;
+ case $arg in #(
+ *"$as_nl"*)
+ expr "X$arg" : "X\\(.*\\)$as_nl";
+ arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+ esac;
+ expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+ '
+ export as_echo_n_body
+ as_echo_n='sh -c $as_echo_n_body as_echo'
+ fi
+ export as_echo_body
+ as_echo='sh -c $as_echo_body as_echo'
+fi
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+ PATH_SEPARATOR=:
+ (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
+ (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
+ PATH_SEPARATOR=';'
+ }
+fi
+
+
+# IFS
+# We need space, tab and new line, in precisely that order. Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+IFS=" "" $as_nl"
+
+# Find who we are. Look in the path if we contain no directory separator.
+as_myself=
+case $0 in #((
+ *[\\/]* ) as_myself=$0 ;;
+ *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+ done
+IFS=$as_save_IFS
+
+ ;;
+esac
+# We did not find ourselves, most probably we were run as `sh COMMAND'
+# in which case we are not to be found in the path.
+if test "x$as_myself" = x; then
+ as_myself=$0
+fi
+if test ! -f "$as_myself"; then
+ $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+ exit 1
+fi
+
+# Unset variables that we do not need and which cause bugs (e.g. in
+# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1"
+# suppresses any "Segmentation fault" message there. '((' could
+# trigger a bug in pdksh 5.2.14.
+for as_var in BASH_ENV ENV MAIL MAILPATH
+do eval test x\${$as_var+set} = xset \
+ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
+done
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
+
+# CDPATH.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+# Use a proper internal environment variable to ensure we don't fall
+ # into an infinite loop, continuously re-executing ourselves.
+ if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then
+ _as_can_reexec=no; export _as_can_reexec;
+ # We cannot yet assume a decent shell, so we have to provide a
+# neutralization value for shells without unset; and this also
+# works around shells that cannot unset nonexistent variables.
+# Preserve -v and -x to the replacement shell.
+BASH_ENV=/dev/null
+ENV=/dev/null
+(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
+case $- in # ((((
+ *v*x* | *x*v* ) as_opts=-vx ;;
+ *v* ) as_opts=-v ;;
+ *x* ) as_opts=-x ;;
+ * ) as_opts= ;;
+esac
+exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
+# Admittedly, this is quite paranoid, since all the known shells bail
+# out after a failed `exec'.
+$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
+as_fn_exit 255
+ fi
+ # We don't want this to propagate to other subprocesses.
+ { _as_can_reexec=; unset _as_can_reexec;}
+if test "x$CONFIG_SHELL" = x; then
+ as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then :
+ emulate sh
+ NULLCMD=:
+ # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '\${1+\"\$@\"}'='\"\$@\"'
+ setopt NO_GLOB_SUBST
+else
+ case \`(set -o) 2>/dev/null\` in #(
+ *posix*) :
+ set -o posix ;; #(
+ *) :
+ ;;
+esac
+fi
+"
+ as_required="as_fn_return () { (exit \$1); }
+as_fn_success () { as_fn_return 0; }
+as_fn_failure () { as_fn_return 1; }
+as_fn_ret_success () { return 0; }
+as_fn_ret_failure () { return 1; }
+
+exitcode=0
+as_fn_success || { exitcode=1; echo as_fn_success failed.; }
+as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; }
+as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; }
+as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; }
+if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then :
+
+else
+ exitcode=1; echo positional parameters were not saved.
+fi
+test x\$exitcode = x0 || exit 1
+test -x / || exit 1"
+ as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO
+ as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO
+ eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" &&
+ test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1"
+ if (eval "$as_required") 2>/dev/null; then :
+ as_have_required=yes
+else
+ as_have_required=no
+fi
+ if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then :
+
+else
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+as_found=false
+for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ as_found=:
+ case $as_dir in #(
+ /*)
+ for as_base in sh bash ksh sh5; do
+ # Try only shells that exist, to save several forks.
+ as_shell=$as_dir/$as_base
+ if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
+ { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then :
+ CONFIG_SHELL=$as_shell as_have_required=yes
+ if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then :
+ break 2
+fi
+fi
+ done;;
+ esac
+ as_found=false
+done
+$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } &&
+ { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then :
+ CONFIG_SHELL=$SHELL as_have_required=yes
+fi; }
+IFS=$as_save_IFS
+
+
+ if test "x$CONFIG_SHELL" != x; then :
+ export CONFIG_SHELL
+ # We cannot yet assume a decent shell, so we have to provide a
+# neutralization value for shells without unset; and this also
+# works around shells that cannot unset nonexistent variables.
+# Preserve -v and -x to the replacement shell.
+BASH_ENV=/dev/null
+ENV=/dev/null
+(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
+case $- in # ((((
+ *v*x* | *x*v* ) as_opts=-vx ;;
+ *v* ) as_opts=-v ;;
+ *x* ) as_opts=-x ;;
+ * ) as_opts= ;;
+esac
+exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
+# Admittedly, this is quite paranoid, since all the known shells bail
+# out after a failed `exec'.
+$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
+exit 255
+fi
+
+ if test x$as_have_required = xno; then :
+ $as_echo "$0: This script requires a shell more modern than all"
+ $as_echo "$0: the shells that I found on your system."
+ if test x${ZSH_VERSION+set} = xset ; then
+ $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should"
+ $as_echo "$0: be upgraded to zsh 4.3.4 or later."
+ else
+ $as_echo "$0: Please tell bug-autoconf@gnu.org and tex-k@tug.org
+$0: about your system, including any error possibly output
+$0: before this message. Then install a modern shell, or
+$0: manually run the script under such a shell if you do
+$0: have one."
+ fi
+ exit 1
+fi
+fi
+fi
+SHELL=${CONFIG_SHELL-/bin/sh}
+export SHELL
+# Unset more variables known to interfere with behavior of common tools.
+CLICOLOR_FORCE= GREP_OPTIONS=
+unset CLICOLOR_FORCE GREP_OPTIONS
+
+## --------------------- ##
+## M4sh Shell Functions. ##
+## --------------------- ##
+# as_fn_unset VAR
+# ---------------
+# Portably unset VAR.
+as_fn_unset ()
+{
+ { eval $1=; unset $1;}
+}
+as_unset=as_fn_unset
+
+# as_fn_set_status STATUS
+# -----------------------
+# Set $? to STATUS, without forking.
+as_fn_set_status ()
+{
+ return $1
+} # as_fn_set_status
+
+# as_fn_exit STATUS
+# -----------------
+# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
+as_fn_exit ()
+{
+ set +e
+ as_fn_set_status $1
+ exit $1
+} # as_fn_exit
+
+# as_fn_mkdir_p
+# -------------
+# Create "$as_dir" as a directory, including parents if necessary.
+as_fn_mkdir_p ()
+{
+
+ case $as_dir in #(
+ -*) as_dir=./$as_dir;;
+ esac
+ test -d "$as_dir" || eval $as_mkdir_p || {
+ as_dirs=
+ while :; do
+ case $as_dir in #(
+ *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+ *) as_qdir=$as_dir;;
+ esac
+ as_dirs="'$as_qdir' $as_dirs"
+ as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$as_dir" : 'X\(//\)[^/]' \| \
+ X"$as_dir" : 'X\(//\)$' \| \
+ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_dir" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ test -d "$as_dir" && break
+ done
+ test -z "$as_dirs" || eval "mkdir $as_dirs"
+ } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
+
+
+} # as_fn_mkdir_p
+
+# as_fn_executable_p FILE
+# -----------------------
+# Test if FILE is an executable regular file.
+as_fn_executable_p ()
+{
+ test -f "$1" && test -x "$1"
+} # as_fn_executable_p
+# as_fn_append VAR VALUE
+# ----------------------
+# Append the text in VALUE to the end of the definition contained in VAR. Take
+# advantage of any shell optimizations that allow amortized linear growth over
+# repeated appends, instead of the typical quadratic growth present in naive
+# implementations.
+if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
+ eval 'as_fn_append ()
+ {
+ eval $1+=\$2
+ }'
+else
+ as_fn_append ()
+ {
+ eval $1=\$$1\$2
+ }
+fi # as_fn_append
+
+# as_fn_arith ARG...
+# ------------------
+# Perform arithmetic evaluation on the ARGs, and store the result in the
+# global $as_val. Take advantage of shells that can avoid forks. The arguments
+# must be portable across $(()) and expr.
+if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
+ eval 'as_fn_arith ()
+ {
+ as_val=$(( $* ))
+ }'
+else
+ as_fn_arith ()
+ {
+ as_val=`expr "$@" || test $? -eq 1`
+ }
+fi # as_fn_arith
+
+
+# as_fn_error STATUS ERROR [LINENO LOG_FD]
+# ----------------------------------------
+# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
+# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
+# script with STATUS, using 1 if that was 0.
+as_fn_error ()
+{
+ as_status=$1; test $as_status -eq 0 && as_status=1
+ if test "$4"; then
+ as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
+ fi
+ $as_echo "$as_me: error: $2" >&2
+ as_fn_exit $as_status
+} # as_fn_error
+
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+ test "X`expr 00001 : '.*\(...\)'`" = X001; then
+ as_expr=expr
+else
+ as_expr=false
+fi
+
+if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
+ as_basename=basename
+else
+ as_basename=false
+fi
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+ as_dirname=dirname
+else
+ as_dirname=false
+fi
+
+as_me=`$as_basename -- "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+ X"$0" : 'X\(//\)$' \| \
+ X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X/"$0" |
+ sed '/^.*\/\([^/][^/]*\)\/*$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+
+ as_lineno_1=$LINENO as_lineno_1a=$LINENO
+ as_lineno_2=$LINENO as_lineno_2a=$LINENO
+ eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" &&
+ test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || {
+ # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-)
+ sed -n '
+ p
+ /[$]LINENO/=
+ ' <$as_myself |
+ sed '
+ s/[$]LINENO.*/&-/
+ t lineno
+ b
+ :lineno
+ N
+ :loop
+ s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
+ t loop
+ s/-\n.*//
+ ' >$as_me.lineno &&
+ chmod +x "$as_me.lineno" ||
+ { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }
+
+ # If we had to re-execute with $CONFIG_SHELL, we're ensured to have
+ # already done that, so ensure we don't try to do so again and fall
+ # in an infinite loop. This has already happened in practice.
+ _as_can_reexec=no; export _as_can_reexec
+ # Don't try to exec as it changes $[0], causing all sort of problems
+ # (the dirname of $[0] is not the place where we might find the
+ # original and so on. Autoconf is especially sensitive to this).
+ . "./$as_me.lineno"
+ # Exit status is that of the last command.
+ exit
+}
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in #(((((
+-n*)
+ case `echo 'xy\c'` in
+ *c*) ECHO_T=' ';; # ECHO_T is single tab character.
+ xy) ECHO_C='\c';;
+ *) echo `echo ksh88 bug on AIX 6.1` > /dev/null
+ ECHO_T=' ';;
+ esac;;
+*)
+ ECHO_N='-n';;
+esac
+
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+ rm -f conf$$.dir/conf$$.file
+else
+ rm -f conf$$.dir
+ mkdir conf$$.dir 2>/dev/null
+fi
+if (echo >conf$$.file) 2>/dev/null; then
+ if ln -s conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s='ln -s'
+ # ... but there are two gotchas:
+ # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+ # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+ # In both cases, we have to default to `cp -pR'.
+ ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+ as_ln_s='cp -pR'
+ elif ln conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s=ln
+ else
+ as_ln_s='cp -pR'
+ fi
+else
+ as_ln_s='cp -pR'
+fi
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+if mkdir -p . 2>/dev/null; then
+ as_mkdir_p='mkdir -p "$as_dir"'
+else
+ test -d ./-p && rmdir ./-p
+ as_mkdir_p=false
+fi
+
+as_test_x='test -x'
+as_executable_p=as_fn_executable_p
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+
+test -n "$DJDIR" || exec 7<&0 </dev/null
+exec 6>&1
+
+# Name of the host.
+# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status,
+# so uname gets run too.
+ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
+
+#
+# Initializations.
+#
+ac_default_prefix=/usr/local
+ac_clean_files=
+ac_config_libobj_dir=.
+LIBOBJS=
+cross_compiling=no
+subdirs=
+MFLAGS=
+MAKEFLAGS=
+
+# Identity of this package.
+PACKAGE_NAME='gmp native'
+PACKAGE_TARNAME='gmp-native'
+PACKAGE_VERSION='6.0.0'
+PACKAGE_STRING='gmp native 6.0.0'
+PACKAGE_BUGREPORT='tex-k@tug.org'
+PACKAGE_URL=''
+
+ac_unique_file="../gmp-6.0.0/gmp-impl.h"
+ac_subst_vars='am__EXEEXT_FALSE
+am__EXEEXT_TRUE
+LTLIBOBJS
+LIBOBJS
+GMP_TREE
+MATH_LIB
+LN_S
+WARNING_CFLAGS
+am__fastdepCC_FALSE
+am__fastdepCC_TRUE
+CCDEPMODE
+am__nodep
+AMDEPBACKSLASH
+AMDEP_FALSE
+AMDEP_TRUE
+am__quote
+am__include
+DEPDIR
+OBJEXT
+EXEEXT
+ac_ct_CC
+CPPFLAGS
+LDFLAGS
+CFLAGS
+CC
+MAINT
+MAINTAINER_MODE_FALSE
+MAINTAINER_MODE_TRUE
+AM_BACKSLASH
+AM_DEFAULT_VERBOSITY
+AM_DEFAULT_V
+AM_V
+am__untar
+am__tar
+AMTAR
+am__leading_dot
+SET_MAKE
+AWK
+mkdir_p
+MKDIR_P
+INSTALL_STRIP_PROGRAM
+STRIP
+install_sh
+MAKEINFO
+AUTOHEADER
+AUTOMAKE
+AUTOCONF
+ACLOCAL
+VERSION
+PACKAGE
+CYGPATH_W
+am__isrc
+INSTALL_DATA
+INSTALL_SCRIPT
+INSTALL_PROGRAM
+target_alias
+host_alias
+build_alias
+LIBS
+ECHO_T
+ECHO_N
+ECHO_C
+DEFS
+mandir
+localedir
+libdir
+psdir
+pdfdir
+dvidir
+htmldir
+infodir
+docdir
+oldincludedir
+includedir
+localstatedir
+sharedstatedir
+sysconfdir
+datadir
+datarootdir
+libexecdir
+sbindir
+bindir
+program_transform_name
+prefix
+exec_prefix
+PACKAGE_URL
+PACKAGE_BUGREPORT
+PACKAGE_STRING
+PACKAGE_VERSION
+PACKAGE_TARNAME
+PACKAGE_NAME
+PATH_SEPARATOR
+SHELL'
+ac_subst_files=''
+ac_user_opts='
+enable_option_checking
+enable_silent_rules
+enable_maintainer_mode
+enable_dependency_tracking
+enable_compiler_warnings
+'
+ ac_precious_vars='build_alias
+host_alias
+target_alias
+CC
+CFLAGS
+LDFLAGS
+LIBS
+CPPFLAGS'
+
+
+# Initialize some variables set by options.
+ac_init_help=
+ac_init_version=false
+ac_unrecognized_opts=
+ac_unrecognized_sep=
+# The variables have the same names as the options, with
+# dashes changed to underlines.
+cache_file=/dev/null
+exec_prefix=NONE
+no_create=
+no_recursion=
+prefix=NONE
+program_prefix=NONE
+program_suffix=NONE
+program_transform_name=s,x,x,
+silent=
+site=
+srcdir=
+verbose=
+x_includes=NONE
+x_libraries=NONE
+
+# Installation directory options.
+# These are left unexpanded so users can "make install exec_prefix=/foo"
+# and all the variables that are supposed to be based on exec_prefix
+# by default will actually change.
+# Use braces instead of parens because sh, perl, etc. also accept them.
+# (The list follows the same order as the GNU Coding Standards.)
+bindir='${exec_prefix}/bin'
+sbindir='${exec_prefix}/sbin'
+libexecdir='${exec_prefix}/libexec'
+datarootdir='${prefix}/share'
+datadir='${datarootdir}'
+sysconfdir='${prefix}/etc'
+sharedstatedir='${prefix}/com'
+localstatedir='${prefix}/var'
+includedir='${prefix}/include'
+oldincludedir='/usr/include'
+docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
+infodir='${datarootdir}/info'
+htmldir='${docdir}'
+dvidir='${docdir}'
+pdfdir='${docdir}'
+psdir='${docdir}'
+libdir='${exec_prefix}/lib'
+localedir='${datarootdir}/locale'
+mandir='${datarootdir}/man'
+
+ac_prev=
+ac_dashdash=
+for ac_option
+do
+ # If the previous option needs an argument, assign it.
+ if test -n "$ac_prev"; then
+ eval $ac_prev=\$ac_option
+ ac_prev=
+ continue
+ fi
+
+ case $ac_option in
+ *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
+ *=) ac_optarg= ;;
+ *) ac_optarg=yes ;;
+ esac
+
+ # Accept the important Cygnus configure options, so we can diagnose typos.
+
+ case $ac_dashdash$ac_option in
+ --)
+ ac_dashdash=yes ;;
+
+ -bindir | --bindir | --bindi | --bind | --bin | --bi)
+ ac_prev=bindir ;;
+ -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
+ bindir=$ac_optarg ;;
+
+ -build | --build | --buil | --bui | --bu)
+ ac_prev=build_alias ;;
+ -build=* | --build=* | --buil=* | --bui=* | --bu=*)
+ build_alias=$ac_optarg ;;
+
+ -cache-file | --cache-file | --cache-fil | --cache-fi \
+ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
+ ac_prev=cache_file ;;
+ -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
+ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
+ cache_file=$ac_optarg ;;
+
+ --config-cache | -C)
+ cache_file=config.cache ;;
+
+ -datadir | --datadir | --datadi | --datad)
+ ac_prev=datadir ;;
+ -datadir=* | --datadir=* | --datadi=* | --datad=*)
+ datadir=$ac_optarg ;;
+
+ -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
+ | --dataroo | --dataro | --datar)
+ ac_prev=datarootdir ;;
+ -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
+ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
+ datarootdir=$ac_optarg ;;
+
+ -disable-* | --disable-*)
+ ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+ as_fn_error $? "invalid feature name: $ac_useropt"
+ ac_useropt_orig=$ac_useropt
+ ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+ case $ac_user_opts in
+ *"
+"enable_$ac_useropt"
+"*) ;;
+ *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig"
+ ac_unrecognized_sep=', ';;
+ esac
+ eval enable_$ac_useropt=no ;;
+
+ -docdir | --docdir | --docdi | --doc | --do)
+ ac_prev=docdir ;;
+ -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)
+ docdir=$ac_optarg ;;
+
+ -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
+ ac_prev=dvidir ;;
+ -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)
+ dvidir=$ac_optarg ;;
+
+ -enable-* | --enable-*)
+ ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+ as_fn_error $? "invalid feature name: $ac_useropt"
+ ac_useropt_orig=$ac_useropt
+ ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+ case $ac_user_opts in
+ *"
+"enable_$ac_useropt"
+"*) ;;
+ *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig"
+ ac_unrecognized_sep=', ';;
+ esac
+ eval enable_$ac_useropt=\$ac_optarg ;;
+
+ -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
+ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
+ | --exec | --exe | --ex)
+ ac_prev=exec_prefix ;;
+ -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
+ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
+ | --exec=* | --exe=* | --ex=*)
+ exec_prefix=$ac_optarg ;;
+
+ -gas | --gas | --ga | --g)
+ # Obsolete; use --with-gas.
+ with_gas=yes ;;
+
+ -help | --help | --hel | --he | -h)
+ ac_init_help=long ;;
+ -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
+ ac_init_help=recursive ;;
+ -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
+ ac_init_help=short ;;
+
+ -host | --host | --hos | --ho)
+ ac_prev=host_alias ;;
+ -host=* | --host=* | --hos=* | --ho=*)
+ host_alias=$ac_optarg ;;
+
+ -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)
+ ac_prev=htmldir ;;
+ -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \
+ | --ht=*)
+ htmldir=$ac_optarg ;;
+
+ -includedir | --includedir | --includedi | --included | --include \
+ | --includ | --inclu | --incl | --inc)
+ ac_prev=includedir ;;
+ -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
+ | --includ=* | --inclu=* | --incl=* | --inc=*)
+ includedir=$ac_optarg ;;
+
+ -infodir | --infodir | --infodi | --infod | --info | --inf)
+ ac_prev=infodir ;;
+ -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
+ infodir=$ac_optarg ;;
+
+ -libdir | --libdir | --libdi | --libd)
+ ac_prev=libdir ;;
+ -libdir=* | --libdir=* | --libdi=* | --libd=*)
+ libdir=$ac_optarg ;;
+
+ -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
+ | --libexe | --libex | --libe)
+ ac_prev=libexecdir ;;
+ -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
+ | --libexe=* | --libex=* | --libe=*)
+ libexecdir=$ac_optarg ;;
+
+ -localedir | --localedir | --localedi | --localed | --locale)
+ ac_prev=localedir ;;
+ -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)
+ localedir=$ac_optarg ;;
+
+ -localstatedir | --localstatedir | --localstatedi | --localstated \
+ | --localstate | --localstat | --localsta | --localst | --locals)
+ ac_prev=localstatedir ;;
+ -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
+ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)
+ localstatedir=$ac_optarg ;;
+
+ -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
+ ac_prev=mandir ;;
+ -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
+ mandir=$ac_optarg ;;
+
+ -nfp | --nfp | --nf)
+ # Obsolete; use --without-fp.
+ with_fp=no ;;
+
+ -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+ | --no-cr | --no-c | -n)
+ no_create=yes ;;
+
+ -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
+ no_recursion=yes ;;
+
+ -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
+ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
+ | --oldin | --oldi | --old | --ol | --o)
+ ac_prev=oldincludedir ;;
+ -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
+ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
+ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
+ oldincludedir=$ac_optarg ;;
+
+ -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
+ ac_prev=prefix ;;
+ -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
+ prefix=$ac_optarg ;;
+
+ -program-prefix | --program-prefix | --program-prefi | --program-pref \
+ | --program-pre | --program-pr | --program-p)
+ ac_prev=program_prefix ;;
+ -program-prefix=* | --program-prefix=* | --program-prefi=* \
+ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
+ program_prefix=$ac_optarg ;;
+
+ -program-suffix | --program-suffix | --program-suffi | --program-suff \
+ | --program-suf | --program-su | --program-s)
+ ac_prev=program_suffix ;;
+ -program-suffix=* | --program-suffix=* | --program-suffi=* \
+ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
+ program_suffix=$ac_optarg ;;
+
+ -program-transform-name | --program-transform-name \
+ | --program-transform-nam | --program-transform-na \
+ | --program-transform-n | --program-transform- \
+ | --program-transform | --program-transfor \
+ | --program-transfo | --program-transf \
+ | --program-trans | --program-tran \
+ | --progr-tra | --program-tr | --program-t)
+ ac_prev=program_transform_name ;;
+ -program-transform-name=* | --program-transform-name=* \
+ | --program-transform-nam=* | --program-transform-na=* \
+ | --program-transform-n=* | --program-transform-=* \
+ | --program-transform=* | --program-transfor=* \
+ | --program-transfo=* | --program-transf=* \
+ | --program-trans=* | --program-tran=* \
+ | --progr-tra=* | --program-tr=* | --program-t=*)
+ program_transform_name=$ac_optarg ;;
+
+ -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)
+ ac_prev=pdfdir ;;
+ -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)
+ pdfdir=$ac_optarg ;;
+
+ -psdir | --psdir | --psdi | --psd | --ps)
+ ac_prev=psdir ;;
+ -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)
+ psdir=$ac_optarg ;;
+
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil)
+ silent=yes ;;
+
+ -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
+ ac_prev=sbindir ;;
+ -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
+ | --sbi=* | --sb=*)
+ sbindir=$ac_optarg ;;
+
+ -sharedstatedir | --sharedstatedir | --sharedstatedi \
+ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
+ | --sharedst | --shareds | --shared | --share | --shar \
+ | --sha | --sh)
+ ac_prev=sharedstatedir ;;
+ -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
+ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
+ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
+ | --sha=* | --sh=*)
+ sharedstatedir=$ac_optarg ;;
+
+ -site | --site | --sit)
+ ac_prev=site ;;
+ -site=* | --site=* | --sit=*)
+ site=$ac_optarg ;;
+
+ -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
+ ac_prev=srcdir ;;
+ -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
+ srcdir=$ac_optarg ;;
+
+ -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
+ | --syscon | --sysco | --sysc | --sys | --sy)
+ ac_prev=sysconfdir ;;
+ -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
+ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
+ sysconfdir=$ac_optarg ;;
+
+ -target | --target | --targe | --targ | --tar | --ta | --t)
+ ac_prev=target_alias ;;
+ -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
+ target_alias=$ac_optarg ;;
+
+ -v | -verbose | --verbose | --verbos | --verbo | --verb)
+ verbose=yes ;;
+
+ -version | --version | --versio | --versi | --vers | -V)
+ ac_init_version=: ;;
+
+ -with-* | --with-*)
+ ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+ as_fn_error $? "invalid package name: $ac_useropt"
+ ac_useropt_orig=$ac_useropt
+ ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+ case $ac_user_opts in
+ *"
+"with_$ac_useropt"
+"*) ;;
+ *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig"
+ ac_unrecognized_sep=', ';;
+ esac
+ eval with_$ac_useropt=\$ac_optarg ;;
+
+ -without-* | --without-*)
+ ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+ as_fn_error $? "invalid package name: $ac_useropt"
+ ac_useropt_orig=$ac_useropt
+ ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+ case $ac_user_opts in
+ *"
+"with_$ac_useropt"
+"*) ;;
+ *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig"
+ ac_unrecognized_sep=', ';;
+ esac
+ eval with_$ac_useropt=no ;;
+
+ --x)
+ # Obsolete; use --with-x.
+ with_x=yes ;;
+
+ -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
+ | --x-incl | --x-inc | --x-in | --x-i)
+ ac_prev=x_includes ;;
+ -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
+ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
+ x_includes=$ac_optarg ;;
+
+ -x-libraries | --x-libraries | --x-librarie | --x-librari \
+ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
+ ac_prev=x_libraries ;;
+ -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
+ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
+ x_libraries=$ac_optarg ;;
+
+ -*) as_fn_error $? "unrecognized option: \`$ac_option'
+Try \`$0 --help' for more information"
+ ;;
+
+ *=*)
+ ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
+ # Reject names that are not valid shell variable names.
+ case $ac_envvar in #(
+ '' | [0-9]* | *[!_$as_cr_alnum]* )
+ as_fn_error $? "invalid variable name: \`$ac_envvar'" ;;
+ esac
+ eval $ac_envvar=\$ac_optarg
+ export $ac_envvar ;;
+
+ *)
+ # FIXME: should be removed in autoconf 3.0.
+ $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2
+ expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
+ $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2
+ : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}"
+ ;;
+
+ esac
+done
+
+if test -n "$ac_prev"; then
+ ac_option=--`echo $ac_prev | sed 's/_/-/g'`
+ as_fn_error $? "missing argument to $ac_option"
+fi
+
+if test -n "$ac_unrecognized_opts"; then
+ case $enable_option_checking in
+ no) ;;
+ fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;;
+ *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;
+ esac
+fi
+
+# Check all directory arguments for consistency.
+for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
+ datadir sysconfdir sharedstatedir localstatedir includedir \
+ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
+ libdir localedir mandir
+do
+ eval ac_val=\$$ac_var
+ # Remove trailing slashes.
+ case $ac_val in
+ */ )
+ ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'`
+ eval $ac_var=\$ac_val;;
+ esac
+ # Be sure to have absolute directory names.
+ case $ac_val in
+ [\\/$]* | ?:[\\/]* ) continue;;
+ NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
+ esac
+ as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val"
+done
+
+# There might be people who depend on the old broken behavior: `$host'
+# used to hold the argument of --host etc.
+# FIXME: To remove some day.
+build=$build_alias
+host=$host_alias
+target=$target_alias
+
+# FIXME: To remove some day.
+if test "x$host_alias" != x; then
+ if test "x$build_alias" = x; then
+ cross_compiling=maybe
+ elif test "x$build_alias" != "x$host_alias"; then
+ cross_compiling=yes
+ fi
+fi
+
+ac_tool_prefix=
+test -n "$host_alias" && ac_tool_prefix=$host_alias-
+
+test "$silent" = yes && exec 6>/dev/null
+
+
+ac_pwd=`pwd` && test -n "$ac_pwd" &&
+ac_ls_di=`ls -di .` &&
+ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
+ as_fn_error $? "working directory cannot be determined"
+test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
+ as_fn_error $? "pwd does not report name of working directory"
+
+
+# Find the source files, if location was not specified.
+if test -z "$srcdir"; then
+ ac_srcdir_defaulted=yes
+ # Try the directory containing this script, then the parent directory.
+ ac_confdir=`$as_dirname -- "$as_myself" ||
+$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$as_myself" : 'X\(//\)[^/]' \| \
+ X"$as_myself" : 'X\(//\)$' \| \
+ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_myself" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ srcdir=$ac_confdir
+ if test ! -r "$srcdir/$ac_unique_file"; then
+ srcdir=..
+ fi
+else
+ ac_srcdir_defaulted=no
+fi
+if test ! -r "$srcdir/$ac_unique_file"; then
+ test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
+ as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir"
+fi
+ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
+ac_abs_confdir=`(
+ cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg"
+ pwd)`
+# When building in place, set srcdir=.
+if test "$ac_abs_confdir" = "$ac_pwd"; then
+ srcdir=.
+fi
+# Remove unnecessary trailing slashes from srcdir.
+# Double slashes in file names in object file debugging info
+# mess up M-x gdb in Emacs.
+case $srcdir in
+*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;;
+esac
+for ac_var in $ac_precious_vars; do
+ eval ac_env_${ac_var}_set=\${${ac_var}+set}
+ eval ac_env_${ac_var}_value=\$${ac_var}
+ eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}
+ eval ac_cv_env_${ac_var}_value=\$${ac_var}
+done
+
+#
+# Report the --help message.
+#
+if test "$ac_init_help" = "long"; then
+ # Omit some internal or obsolete options to make the list less imposing.
+ # This message is too long to be a string in the A/UX 3.1 sh.
+ cat <<_ACEOF
+\`configure' configures gmp native 6.0.0 to adapt to many kinds of systems.
+
+Usage: $0 [OPTION]... [VAR=VALUE]...
+
+To assign environment variables (e.g., CC, CFLAGS...), specify them as
+VAR=VALUE. See below for descriptions of some of the useful variables.
+
+Defaults for the options are specified in brackets.
+
+Configuration:
+ -h, --help display this help and exit
+ --help=short display options specific to this package
+ --help=recursive display the short help of all the included packages
+ -V, --version display version information and exit
+ -q, --quiet, --silent do not print \`checking ...' messages
+ --cache-file=FILE cache test results in FILE [disabled]
+ -C, --config-cache alias for \`--cache-file=config.cache'
+ -n, --no-create do not create output files
+ --srcdir=DIR find the sources in DIR [configure dir or \`..']
+
+Installation directories:
+ --prefix=PREFIX install architecture-independent files in PREFIX
+ [$ac_default_prefix]
+ --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
+ [PREFIX]
+
+By default, \`make install' will install all the files in
+\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify
+an installation prefix other than \`$ac_default_prefix' using \`--prefix',
+for instance \`--prefix=\$HOME'.
+
+For better control, use the options below.
+
+Fine tuning of the installation directories:
+ --bindir=DIR user executables [EPREFIX/bin]
+ --sbindir=DIR system admin executables [EPREFIX/sbin]
+ --libexecdir=DIR program executables [EPREFIX/libexec]
+ --sysconfdir=DIR read-only single-machine data [PREFIX/etc]
+ --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
+ --localstatedir=DIR modifiable single-machine data [PREFIX/var]
+ --libdir=DIR object code libraries [EPREFIX/lib]
+ --includedir=DIR C header files [PREFIX/include]
+ --oldincludedir=DIR C header files for non-gcc [/usr/include]
+ --datarootdir=DIR read-only arch.-independent data root [PREFIX/share]
+ --datadir=DIR read-only architecture-independent data [DATAROOTDIR]
+ --infodir=DIR info documentation [DATAROOTDIR/info]
+ --localedir=DIR locale-dependent data [DATAROOTDIR/locale]
+ --mandir=DIR man documentation [DATAROOTDIR/man]
+ --docdir=DIR documentation root [DATAROOTDIR/doc/gmp-native]
+ --htmldir=DIR html documentation [DOCDIR]
+ --dvidir=DIR dvi documentation [DOCDIR]
+ --pdfdir=DIR pdf documentation [DOCDIR]
+ --psdir=DIR ps documentation [DOCDIR]
+_ACEOF
+
+ cat <<\_ACEOF
+
+Program names:
+ --program-prefix=PREFIX prepend PREFIX to installed program names
+ --program-suffix=SUFFIX append SUFFIX to installed program names
+ --program-transform-name=PROGRAM run sed PROGRAM on installed program names
+_ACEOF
+fi
+
+if test -n "$ac_init_help"; then
+ case $ac_init_help in
+ short | recursive ) echo "Configuration of gmp native 6.0.0:";;
+ esac
+ cat <<\_ACEOF
+
+Optional Features:
+ --disable-option-checking ignore unrecognized --enable/--with options
+ --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
+ --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
+ --enable-silent-rules less verbose build output (undo: "make V=1")
+ --disable-silent-rules verbose build output (undo: "make V=0")
+ --enable-maintainer-mode
+ enable make rules and dependencies not useful (and
+ sometimes confusing) to the casual installer
+ --enable-dependency-tracking
+ do not reject slow dependency extractors
+ --disable-dependency-tracking
+ speeds up one-time build
+ --enable-compiler-warnings=[no|min|yes|max|all]
+ Turn on compiler warnings [default: yes if
+ maintainer-mode, min otherwise]
+
+Some influential environment variables:
+ CC C compiler command
+ CFLAGS C compiler flags
+ LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a
+ nonstandard directory <lib dir>
+ LIBS libraries to pass to the linker, e.g. -l<library>
+ CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
+ you have headers in a nonstandard directory <include dir>
+
+Use these variables to override the choices made by `configure' or to help
+it to find libraries and programs with nonstandard names/locations.
+
+Report bugs to <tex-k@tug.org>.
+_ACEOF
+ac_status=$?
+fi
+
+if test "$ac_init_help" = "recursive"; then
+ # If there are subdirs, report their specific --help.
+ for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
+ test -d "$ac_dir" ||
+ { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } ||
+ continue
+ ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+ ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
+ # A ".." for each directory in $ac_dir_suffix.
+ ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
+ case $ac_top_builddir_sub in
+ "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+ *) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+ esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+ .) # We are building in place.
+ ac_srcdir=.
+ ac_top_srcdir=$ac_top_builddir_sub
+ ac_abs_top_srcdir=$ac_pwd ;;
+ [\\/]* | ?:[\\/]* ) # Absolute name.
+ ac_srcdir=$srcdir$ac_dir_suffix;
+ ac_top_srcdir=$srcdir
+ ac_abs_top_srcdir=$srcdir ;;
+ *) # Relative name.
+ ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+ ac_top_srcdir=$ac_top_build_prefix$srcdir
+ ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+ cd "$ac_dir" || { ac_status=$?; continue; }
+ # Check for guested configure.
+ if test -f "$ac_srcdir/configure.gnu"; then
+ echo &&
+ $SHELL "$ac_srcdir/configure.gnu" --help=recursive
+ elif test -f "$ac_srcdir/configure"; then
+ echo &&
+ $SHELL "$ac_srcdir/configure" --help=recursive
+ else
+ $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
+ fi || ac_status=$?
+ cd "$ac_pwd" || { ac_status=$?; break; }
+ done
+fi
+
+test -n "$ac_init_help" && exit $ac_status
+if $ac_init_version; then
+ cat <<\_ACEOF
+gmp native configure 6.0.0
+generated by GNU Autoconf 2.69
+
+Copyright (C) 2012 Free Software Foundation, Inc.
+This configure script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it.
+_ACEOF
+ exit
+fi
+
+## ------------------------ ##
+## Autoconf initialization. ##
+## ------------------------ ##
+
+# ac_fn_c_try_compile LINENO
+# --------------------------
+# Try to compile conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_compile ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ rm -f conftest.$ac_objext
+ if { { ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_compile") 2>conftest.err
+ ac_status=$?
+ if test -s conftest.err; then
+ grep -v '^ *+' conftest.err >conftest.er1
+ cat conftest.er1 >&5
+ mv -f conftest.er1 conftest.err
+ fi
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then :
+ ac_retval=0
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_retval=1
+fi
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+ as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_compile
+
+# ac_fn_c_try_link LINENO
+# -----------------------
+# Try to link conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_link ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ rm -f conftest.$ac_objext conftest$ac_exeext
+ if { { ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_link") 2>conftest.err
+ ac_status=$?
+ if test -s conftest.err; then
+ grep -v '^ *+' conftest.err >conftest.er1
+ cat conftest.er1 >&5
+ mv -f conftest.er1 conftest.err
+ fi
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ test -x conftest$ac_exeext
+ }; then :
+ ac_retval=0
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_retval=1
+fi
+ # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information
+ # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would
+ # interfere with the next link command; also delete a directory that is
+ # left behind by Apple's compiler. We do this before executing the actions.
+ rm -rf conftest.dSYM conftest_ipa8_conftest.oo
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+ as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_link
+cat >config.log <<_ACEOF
+This file contains any messages produced by compilers while
+running configure, to aid debugging if configure makes a mistake.
+
+It was created by gmp native $as_me 6.0.0, which was
+generated by GNU Autoconf 2.69. Invocation command line was
+
+ $ $0 $@
+
+_ACEOF
+exec 5>>config.log
+{
+cat <<_ASUNAME
+## --------- ##
+## Platform. ##
+## --------- ##
+
+hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
+uname -m = `(uname -m) 2>/dev/null || echo unknown`
+uname -r = `(uname -r) 2>/dev/null || echo unknown`
+uname -s = `(uname -s) 2>/dev/null || echo unknown`
+uname -v = `(uname -v) 2>/dev/null || echo unknown`
+
+/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
+/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown`
+
+/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown`
+/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown`
+/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
+/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown`
+/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown`
+/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown`
+/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown`
+
+_ASUNAME
+
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ $as_echo "PATH: $as_dir"
+ done
+IFS=$as_save_IFS
+
+} >&5
+
+cat >&5 <<_ACEOF
+
+
+## ----------- ##
+## Core tests. ##
+## ----------- ##
+
+_ACEOF
+
+
+# Keep a trace of the command line.
+# Strip out --no-create and --no-recursion so they do not pile up.
+# Strip out --silent because we don't want to record it for future runs.
+# Also quote any args containing shell meta-characters.
+# Make two passes to allow for proper duplicate-argument suppression.
+ac_configure_args=
+ac_configure_args0=
+ac_configure_args1=
+ac_must_keep_next=false
+for ac_pass in 1 2
+do
+ for ac_arg
+ do
+ case $ac_arg in
+ -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil)
+ continue ;;
+ *\'*)
+ ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+ esac
+ case $ac_pass in
+ 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;;
+ 2)
+ as_fn_append ac_configure_args1 " '$ac_arg'"
+ if test $ac_must_keep_next = true; then
+ ac_must_keep_next=false # Got value, back to normal.
+ else
+ case $ac_arg in
+ *=* | --config-cache | -C | -disable-* | --disable-* \
+ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
+ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
+ | -with-* | --with-* | -without-* | --without-* | --x)
+ case "$ac_configure_args0 " in
+ "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
+ esac
+ ;;
+ -* ) ac_must_keep_next=true ;;
+ esac
+ fi
+ as_fn_append ac_configure_args " '$ac_arg'"
+ ;;
+ esac
+ done
+done
+{ ac_configure_args0=; unset ac_configure_args0;}
+{ ac_configure_args1=; unset ac_configure_args1;}
+
+# When interrupted or exit'd, cleanup temporary files, and complete
+# config.log. We remove comments because anyway the quotes in there
+# would cause problems or look ugly.
+# WARNING: Use '\'' to represent an apostrophe within the trap.
+# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
+trap 'exit_status=$?
+ # Save into config.log some information that might help in debugging.
+ {
+ echo
+
+ $as_echo "## ---------------- ##
+## Cache variables. ##
+## ---------------- ##"
+ echo
+ # The following way of writing the cache mishandles newlines in values,
+(
+ for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do
+ eval ac_val=\$$ac_var
+ case $ac_val in #(
+ *${as_nl}*)
+ case $ac_var in #(
+ *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
+ esac
+ case $ac_var in #(
+ _ | IFS | as_nl) ;; #(
+ BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
+ *) { eval $ac_var=; unset $ac_var;} ;;
+ esac ;;
+ esac
+ done
+ (set) 2>&1 |
+ case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #(
+ *${as_nl}ac_space=\ *)
+ sed -n \
+ "s/'\''/'\''\\\\'\'''\''/g;
+ s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p"
+ ;; #(
+ *)
+ sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+ ;;
+ esac |
+ sort
+)
+ echo
+
+ $as_echo "## ----------------- ##
+## Output variables. ##
+## ----------------- ##"
+ echo
+ for ac_var in $ac_subst_vars
+ do
+ eval ac_val=\$$ac_var
+ case $ac_val in
+ *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+ esac
+ $as_echo "$ac_var='\''$ac_val'\''"
+ done | sort
+ echo
+
+ if test -n "$ac_subst_files"; then
+ $as_echo "## ------------------- ##
+## File substitutions. ##
+## ------------------- ##"
+ echo
+ for ac_var in $ac_subst_files
+ do
+ eval ac_val=\$$ac_var
+ case $ac_val in
+ *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+ esac
+ $as_echo "$ac_var='\''$ac_val'\''"
+ done | sort
+ echo
+ fi
+
+ if test -s confdefs.h; then
+ $as_echo "## ----------- ##
+## confdefs.h. ##
+## ----------- ##"
+ echo
+ cat confdefs.h
+ echo
+ fi
+ test "$ac_signal" != 0 &&
+ $as_echo "$as_me: caught signal $ac_signal"
+ $as_echo "$as_me: exit $exit_status"
+ } >&5
+ rm -f core *.core core.conftest.* &&
+ rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
+ exit $exit_status
+' 0
+for ac_signal in 1 2 13 15; do
+ trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal
+done
+ac_signal=0
+
+# confdefs.h avoids OS command line length limits that DEFS can exceed.
+rm -f -r conftest* confdefs.h
+
+$as_echo "/* confdefs.h */" > confdefs.h
+
+# Predefined preprocessor variables.
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_NAME "$PACKAGE_NAME"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_TARNAME "$PACKAGE_TARNAME"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_VERSION "$PACKAGE_VERSION"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_STRING "$PACKAGE_STRING"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_URL "$PACKAGE_URL"
+_ACEOF
+
+
+# Let the site file select an alternate cache file if it wants to.
+# Prefer an explicitly selected file to automatically selected ones.
+ac_site_file1=NONE
+ac_site_file2=NONE
+if test -n "$CONFIG_SITE"; then
+ # We do not want a PATH search for config.site.
+ case $CONFIG_SITE in #((
+ -*) ac_site_file1=./$CONFIG_SITE;;
+ */*) ac_site_file1=$CONFIG_SITE;;
+ *) ac_site_file1=./$CONFIG_SITE;;
+ esac
+elif test "x$prefix" != xNONE; then
+ ac_site_file1=$prefix/share/config.site
+ ac_site_file2=$prefix/etc/config.site
+else
+ ac_site_file1=$ac_default_prefix/share/config.site
+ ac_site_file2=$ac_default_prefix/etc/config.site
+fi
+for ac_site_file in "$ac_site_file1" "$ac_site_file2"
+do
+ test "x$ac_site_file" = xNONE && continue
+ if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5
+$as_echo "$as_me: loading site script $ac_site_file" >&6;}
+ sed 's/^/| /' "$ac_site_file" >&5
+ . "$ac_site_file" \
+ || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "failed to load site script $ac_site_file
+See \`config.log' for more details" "$LINENO" 5; }
+ fi
+done
+
+if test -r "$cache_file"; then
+ # Some versions of bash will fail to source /dev/null (special files
+ # actually), so we avoid doing that. DJGPP emulates it as a regular file.
+ if test /dev/null != "$cache_file" && test -f "$cache_file"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5
+$as_echo "$as_me: loading cache $cache_file" >&6;}
+ case $cache_file in
+ [\\/]* | ?:[\\/]* ) . "$cache_file";;
+ *) . "./$cache_file";;
+ esac
+ fi
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5
+$as_echo "$as_me: creating cache $cache_file" >&6;}
+ >$cache_file
+fi
+
+# Check that the precious variables saved in the cache have kept the same
+# value.
+ac_cache_corrupted=false
+for ac_var in $ac_precious_vars; do
+ eval ac_old_set=\$ac_cv_env_${ac_var}_set
+ eval ac_new_set=\$ac_env_${ac_var}_set
+ eval ac_old_val=\$ac_cv_env_${ac_var}_value
+ eval ac_new_val=\$ac_env_${ac_var}_value
+ case $ac_old_set,$ac_new_set in
+ set,)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
+$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
+ ac_cache_corrupted=: ;;
+ ,set)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5
+$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
+ ac_cache_corrupted=: ;;
+ ,);;
+ *)
+ if test "x$ac_old_val" != "x$ac_new_val"; then
+ # differences in whitespace do not lead to failure.
+ ac_old_val_w=`echo x $ac_old_val`
+ ac_new_val_w=`echo x $ac_new_val`
+ if test "$ac_old_val_w" != "$ac_new_val_w"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5
+$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
+ ac_cache_corrupted=:
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5
+$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;}
+ eval $ac_var=\$ac_old_val
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5
+$as_echo "$as_me: former value: \`$ac_old_val'" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5
+$as_echo "$as_me: current value: \`$ac_new_val'" >&2;}
+ fi;;
+ esac
+ # Pass precious variables to config.status.
+ if test "$ac_new_set" = set; then
+ case $ac_new_val in
+ *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
+ *) ac_arg=$ac_var=$ac_new_val ;;
+ esac
+ case " $ac_configure_args " in
+ *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy.
+ *) as_fn_append ac_configure_args " '$ac_arg'" ;;
+ esac
+ fi
+done
+if $ac_cache_corrupted; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5
+$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;}
+ as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5
+fi
+## -------------------- ##
+## Main body of script. ##
+## -------------------- ##
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+
+
+ac_aux_dir=
+for ac_dir in ../../../build-aux "$srcdir"/../../../build-aux; do
+ if test -f "$ac_dir/install-sh"; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/install-sh -c"
+ break
+ elif test -f "$ac_dir/install.sh"; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/install.sh -c"
+ break
+ elif test -f "$ac_dir/shtool"; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/shtool install -c"
+ break
+ fi
+done
+if test -z "$ac_aux_dir"; then
+ as_fn_error $? "cannot find install-sh, install.sh, or shtool in ../../../build-aux \"$srcdir\"/../../../build-aux" "$LINENO" 5
+fi
+
+# These three variables are undocumented and unsupported,
+# and are intended to be withdrawn in a future Autoconf release.
+# They can cause serious problems if a builder's source tree is in a directory
+# whose full name contains unusual characters.
+ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var.
+ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var.
+ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var.
+
+
+
+
+am__api_version='1.14'
+
+# Find a good install program. We prefer a C program (faster),
+# so one script is as good as another. But avoid the broken or
+# incompatible versions:
+# SysV /etc/install, /usr/sbin/install
+# SunOS /usr/etc/install
+# IRIX /sbin/install
+# AIX /bin/install
+# AmigaOS /C/install, which installs bootblocks on floppy discs
+# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
+# AFS /usr/afsws/bin/install, which mishandles nonexistent args
+# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
+# OS/2's system install, which has a completely different semantic
+# ./install, which can be erroneously created by make from ./install.sh.
+# Reject install programs that cannot install multiple files.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5
+$as_echo_n "checking for a BSD-compatible install... " >&6; }
+if test -z "$INSTALL"; then
+if ${ac_cv_path_install+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ # Account for people who put trailing slashes in PATH elements.
+case $as_dir/ in #((
+ ./ | .// | /[cC]/* | \
+ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
+ ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \
+ /usr/ucb/* ) ;;
+ *)
+ # OSF1 and SCO ODT 3.0 have their own names for install.
+ # Don't use installbsd from OSF since it installs stuff as root
+ # by default.
+ for ac_prog in ginstall scoinst install; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
+ if test $ac_prog = install &&
+ grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+ # AIX install. It has an incompatible calling convention.
+ :
+ elif test $ac_prog = install &&
+ grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+ # program-specific install script used by HP pwplus--don't use.
+ :
+ else
+ rm -rf conftest.one conftest.two conftest.dir
+ echo one > conftest.one
+ echo two > conftest.two
+ mkdir conftest.dir
+ if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" &&
+ test -s conftest.one && test -s conftest.two &&
+ test -s conftest.dir/conftest.one &&
+ test -s conftest.dir/conftest.two
+ then
+ ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
+ break 3
+ fi
+ fi
+ fi
+ done
+ done
+ ;;
+esac
+
+ done
+IFS=$as_save_IFS
+
+rm -rf conftest.one conftest.two conftest.dir
+
+fi
+ if test "${ac_cv_path_install+set}" = set; then
+ INSTALL=$ac_cv_path_install
+ else
+ # As a last resort, use the slow shell script. Don't cache a
+ # value for INSTALL within a source directory, because that will
+ # break other packages using the cache if that directory is
+ # removed, or if the value is a relative name.
+ INSTALL=$ac_install_sh
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5
+$as_echo "$INSTALL" >&6; }
+
+# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
+# It thinks the first close brace ends the variable substitution.
+test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
+
+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
+
+test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5
+$as_echo_n "checking whether build environment is sane... " >&6; }
+# Reject unsafe characters in $srcdir or the absolute working directory
+# name. Accept space and tab only in the latter.
+am_lf='
+'
+case `pwd` in
+ *[\\\"\#\$\&\'\`$am_lf]*)
+ as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;;
+esac
+case $srcdir in
+ *[\\\"\#\$\&\'\`$am_lf\ \ ]*)
+ as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;;
+esac
+
+# Do 'set' in a subshell so we don't clobber the current shell's
+# arguments. Must try -L first in case configure is actually a
+# symlink; some systems play weird games with the mod time of symlinks
+# (eg FreeBSD returns the mod time of the symlink's containing
+# directory).
+if (
+ am_has_slept=no
+ for am_try in 1 2; do
+ echo "timestamp, slept: $am_has_slept" > conftest.file
+ set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
+ if test "$*" = "X"; then
+ # -L didn't work.
+ set X `ls -t "$srcdir/configure" conftest.file`
+ fi
+ if test "$*" != "X $srcdir/configure conftest.file" \
+ && test "$*" != "X conftest.file $srcdir/configure"; then
+
+ # If neither matched, then we have a broken ls. This can happen
+ # if, for instance, CONFIG_SHELL is bash and it inherits a
+ # broken ls alias from the environment. This has actually
+ # happened. Such a system could not be considered "sane".
+ as_fn_error $? "ls -t appears to fail. Make sure there is not a broken
+ alias in your environment" "$LINENO" 5
+ fi
+ if test "$2" = conftest.file || test $am_try -eq 2; then
+ break
+ fi
+ # Just in case.
+ sleep 1
+ am_has_slept=yes
+ done
+ test "$2" = conftest.file
+ )
+then
+ # Ok.
+ :
+else
+ as_fn_error $? "newly created file is older than distributed files!
+Check your system clock" "$LINENO" 5
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+# If we didn't sleep, we still need to ensure time stamps of config.status and
+# generated files are strictly newer.
+am_sleep_pid=
+if grep 'slept: no' conftest.file >/dev/null 2>&1; then
+ ( sleep 1 ) &
+ am_sleep_pid=$!
+fi
+
+rm -f conftest.file
+
+test "$program_prefix" != NONE &&
+ program_transform_name="s&^&$program_prefix&;$program_transform_name"
+# Use a double $ so make ignores it.
+test "$program_suffix" != NONE &&
+ program_transform_name="s&\$&$program_suffix&;$program_transform_name"
+# Double any \ or $.
+# By default was `s,x,x', remove it if useless.
+ac_script='s/[\\$]/&&/g;s/;s,x,x,$//'
+program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"`
+
+# expand $ac_aux_dir to an absolute path
+am_aux_dir=`cd $ac_aux_dir && pwd`
+
+if test x"${MISSING+set}" != xset; then
+ case $am_aux_dir in
+ *\ * | *\ *)
+ MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
+ *)
+ MISSING="\${SHELL} $am_aux_dir/missing" ;;
+ esac
+fi
+# Use eval to expand $SHELL
+if eval "$MISSING --is-lightweight"; then
+ am_missing_run="$MISSING "
+else
+ am_missing_run=
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5
+$as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;}
+fi
+
+if test x"${install_sh}" != xset; then
+ case $am_aux_dir in
+ *\ * | *\ *)
+ install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
+ *)
+ install_sh="\${SHELL} $am_aux_dir/install-sh"
+ esac
+fi
+
+# Installed binaries are usually stripped using 'strip' when the user
+# run "make install-strip". However 'strip' might not be the right
+# tool to use in cross-compilation environments, therefore Automake
+# will honor the 'STRIP' environment variable to overrule this program.
+if test "$cross_compiling" != no; then
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
+set dummy ${ac_tool_prefix}strip; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_STRIP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$STRIP"; then
+ ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_STRIP="${ac_tool_prefix}strip"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+STRIP=$ac_cv_prog_STRIP
+if test -n "$STRIP"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5
+$as_echo "$STRIP" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_STRIP"; then
+ ac_ct_STRIP=$STRIP
+ # Extract the first word of "strip", so it can be a program name with args.
+set dummy strip; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_STRIP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_STRIP"; then
+ ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_STRIP="strip"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
+if test -n "$ac_ct_STRIP"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5
+$as_echo "$ac_ct_STRIP" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_STRIP" = x; then
+ STRIP=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ STRIP=$ac_ct_STRIP
+ fi
+else
+ STRIP="$ac_cv_prog_STRIP"
+fi
+
+fi
+INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5
+$as_echo_n "checking for a thread-safe mkdir -p... " >&6; }
+if test -z "$MKDIR_P"; then
+ if ${ac_cv_path_mkdir+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_prog in mkdir gmkdir; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue
+ case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #(
+ 'mkdir (GNU coreutils) '* | \
+ 'mkdir (coreutils) '* | \
+ 'mkdir (fileutils) '4.1*)
+ ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext
+ break 3;;
+ esac
+ done
+ done
+ done
+IFS=$as_save_IFS
+
+fi
+
+ test -d ./--version && rmdir ./--version
+ if test "${ac_cv_path_mkdir+set}" = set; then
+ MKDIR_P="$ac_cv_path_mkdir -p"
+ else
+ # As a last resort, use the slow shell script. Don't cache a
+ # value for MKDIR_P within a source directory, because that will
+ # break other packages using the cache if that directory is
+ # removed, or if the value is a relative name.
+ MKDIR_P="$ac_install_sh -d"
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5
+$as_echo "$MKDIR_P" >&6; }
+
+for ac_prog in gawk mawk nawk awk
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_AWK+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$AWK"; then
+ ac_cv_prog_AWK="$AWK" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_AWK="$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+AWK=$ac_cv_prog_AWK
+if test -n "$AWK"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5
+$as_echo "$AWK" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$AWK" && break
+done
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5
+$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
+set x ${MAKE-make}
+ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
+if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat >conftest.make <<\_ACEOF
+SHELL = /bin/sh
+all:
+ @echo '@@@%%%=$(MAKE)=@@@%%%'
+_ACEOF
+# GNU make sometimes prints "make[1]: Entering ...", which would confuse us.
+case `${MAKE-make} -f conftest.make 2>/dev/null` in
+ *@@@%%%=?*=@@@%%%*)
+ eval ac_cv_prog_make_${ac_make}_set=yes;;
+ *)
+ eval ac_cv_prog_make_${ac_make}_set=no;;
+esac
+rm -f conftest.make
+fi
+if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+ SET_MAKE=
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ SET_MAKE="MAKE=${MAKE-make}"
+fi
+
+rm -rf .tst 2>/dev/null
+mkdir .tst 2>/dev/null
+if test -d .tst; then
+ am__leading_dot=.
+else
+ am__leading_dot=_
+fi
+rmdir .tst 2>/dev/null
+
+# Check whether --enable-silent-rules was given.
+if test "${enable_silent_rules+set}" = set; then :
+ enableval=$enable_silent_rules;
+fi
+
+case $enable_silent_rules in # (((
+ yes) AM_DEFAULT_VERBOSITY=0;;
+ no) AM_DEFAULT_VERBOSITY=1;;
+ *) AM_DEFAULT_VERBOSITY=1;;
+esac
+am_make=${MAKE-make}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5
+$as_echo_n "checking whether $am_make supports nested variables... " >&6; }
+if ${am_cv_make_support_nested_variables+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if $as_echo 'TRUE=$(BAR$(V))
+BAR0=false
+BAR1=true
+V=1
+am__doit:
+ @$(TRUE)
+.PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then
+ am_cv_make_support_nested_variables=yes
+else
+ am_cv_make_support_nested_variables=no
+fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5
+$as_echo "$am_cv_make_support_nested_variables" >&6; }
+if test $am_cv_make_support_nested_variables = yes; then
+ AM_V='$(V)'
+ AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
+else
+ AM_V=$AM_DEFAULT_VERBOSITY
+ AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
+fi
+AM_BACKSLASH='\'
+
+DEPDIR="${am__leading_dot}deps"
+
+ac_config_commands="$ac_config_commands depfiles"
+
+
+am_make=${MAKE-make}
+cat > confinc << 'END'
+am__doit:
+ @echo this is the am__doit target
+.PHONY: am__doit
+END
+# If we don't find an include directive, just comment out the code.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5
+$as_echo_n "checking for style of include used by $am_make... " >&6; }
+am__include="#"
+am__quote=
+_am_result=none
+# First try GNU make style include.
+echo "include confinc" > confmf
+# Ignore all kinds of additional output from 'make'.
+case `$am_make -s -f confmf 2> /dev/null` in #(
+*the\ am__doit\ target*)
+ am__include=include
+ am__quote=
+ _am_result=GNU
+ ;;
+esac
+# Now try BSD make style include.
+if test "$am__include" = "#"; then
+ echo '.include "confinc"' > confmf
+ case `$am_make -s -f confmf 2> /dev/null` in #(
+ *the\ am__doit\ target*)
+ am__include=.include
+ am__quote="\""
+ _am_result=BSD
+ ;;
+ esac
+fi
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5
+$as_echo "$_am_result" >&6; }
+rm -f confinc confmf
+
+# Check whether --enable-dependency-tracking was given.
+if test "${enable_dependency_tracking+set}" = set; then :
+ enableval=$enable_dependency_tracking;
+fi
+
+if test "x$enable_dependency_tracking" != xno; then
+ am_depcomp="$ac_aux_dir/depcomp"
+ AMDEPBACKSLASH='\'
+ am__nodep='_no'
+fi
+ if test "x$enable_dependency_tracking" != xno; then
+ AMDEP_TRUE=
+ AMDEP_FALSE='#'
+else
+ AMDEP_TRUE='#'
+ AMDEP_FALSE=
+fi
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}gcc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_CC="${ac_tool_prefix}gcc"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_CC"; then
+ ac_ct_CC=$CC
+ # Extract the first word of "gcc", so it can be a program name with args.
+set dummy gcc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_CC"; then
+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_CC="gcc"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_CC" = x; then
+ CC=""
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ CC=$ac_ct_CC
+ fi
+else
+ CC="$ac_cv_prog_CC"
+fi
+
+if test -z "$CC"; then
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}cc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_CC="${ac_tool_prefix}cc"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ fi
+fi
+if test -z "$CC"; then
+ # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+ ac_prog_rejected=no
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
+ ac_prog_rejected=yes
+ continue
+ fi
+ ac_cv_prog_CC="cc"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+if test $ac_prog_rejected = yes; then
+ # We found a bogon in the path, so make sure we never use it.
+ set dummy $ac_cv_prog_CC
+ shift
+ if test $# != 0; then
+ # We chose a different compiler from the bogus one.
+ # However, it has the same basename, so the bogon will be chosen
+ # first if we set CC to just the basename; use the full file name.
+ shift
+ ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
+ fi
+fi
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$CC"; then
+ if test -n "$ac_tool_prefix"; then
+ for ac_prog in cl.exe
+ do
+ # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$CC" && break
+ done
+fi
+if test -z "$CC"; then
+ ac_ct_CC=$CC
+ for ac_prog in cl.exe
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_CC"; then
+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_CC="$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$ac_ct_CC" && break
+done
+
+ if test "x$ac_ct_CC" = x; then
+ CC=""
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ CC=$ac_ct_CC
+ fi
+fi
+
+fi
+
+
+test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "no acceptable C compiler found in \$PATH
+See \`config.log' for more details" "$LINENO" 5; }
+
+# Provide some information about the compiler.
+$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
+set X $ac_compile
+ac_compiler=$2
+for ac_option in --version -v -V -qversion; do
+ { { ac_try="$ac_compiler $ac_option >&5"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_compiler $ac_option >&5") 2>conftest.err
+ ac_status=$?
+ if test -s conftest.err; then
+ sed '10a\
+... rest of stderr output deleted ...
+ 10q' conftest.err >conftest.er1
+ cat conftest.er1 >&5
+ fi
+ rm -f conftest.er1 conftest.err
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }
+done
+
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out"
+# Try to create an executable without -o first, disregard a.out.
+# It will help us diagnose broken compilers, and finding out an intuition
+# of exeext.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5
+$as_echo_n "checking whether the C compiler works... " >&6; }
+ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
+
+# The possible output files:
+ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*"
+
+ac_rmfiles=
+for ac_file in $ac_files
+do
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
+ * ) ac_rmfiles="$ac_rmfiles $ac_file";;
+ esac
+done
+rm -f $ac_rmfiles
+
+if { { ac_try="$ac_link_default"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_link_default") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then :
+ # Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
+# So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
+# in a Makefile. We should not override ac_cv_exeext if it was cached,
+# so that the user can short-circuit this test for compilers unknown to
+# Autoconf.
+for ac_file in $ac_files ''
+do
+ test -f "$ac_file" || continue
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj )
+ ;;
+ [ab].out )
+ # We found the default executable, but exeext='' is most
+ # certainly right.
+ break;;
+ *.* )
+ if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
+ then :; else
+ ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+ fi
+ # We set ac_cv_exeext here because the later test for it is not
+ # safe: cross compilers may not add the suffix if given an `-o'
+ # argument, so we may need to know it at that point already.
+ # Even if this section looks crufty: it has the advantage of
+ # actually working.
+ break;;
+ * )
+ break;;
+ esac
+done
+test "$ac_cv_exeext" = no && ac_cv_exeext=
+
+else
+ ac_file=''
+fi
+if test -z "$ac_file"; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+$as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "C compiler cannot create executables
+See \`config.log' for more details" "$LINENO" 5; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5
+$as_echo_n "checking for C compiler default output file name... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5
+$as_echo "$ac_file" >&6; }
+ac_exeext=$ac_cv_exeext
+
+rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out
+ac_clean_files=$ac_clean_files_save
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5
+$as_echo_n "checking for suffix of executables... " >&6; }
+if { { ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_link") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then :
+ # If both `conftest.exe' and `conftest' are `present' (well, observable)
+# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will
+# work properly (i.e., refer to `conftest.exe'), while it won't with
+# `rm'.
+for ac_file in conftest.exe conftest conftest.*; do
+ test -f "$ac_file" || continue
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
+ *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+ break;;
+ * ) break;;
+ esac
+done
+else
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details" "$LINENO" 5; }
+fi
+rm -f conftest conftest$ac_cv_exeext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5
+$as_echo "$ac_cv_exeext" >&6; }
+
+rm -f conftest.$ac_ext
+EXEEXT=$ac_cv_exeext
+ac_exeext=$EXEEXT
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdio.h>
+int
+main ()
+{
+FILE *f = fopen ("conftest.out", "w");
+ return ferror (f) || fclose (f) != 0;
+
+ ;
+ return 0;
+}
+_ACEOF
+ac_clean_files="$ac_clean_files conftest.out"
+# Check that the compiler produces executables we can run. If not, either
+# the compiler is broken, or we cross compile.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5
+$as_echo_n "checking whether we are cross compiling... " >&6; }
+if test "$cross_compiling" != yes; then
+ { { ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_link") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }
+ if { ac_try='./conftest$ac_cv_exeext'
+ { { case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; }; then
+ cross_compiling=no
+ else
+ if test "$cross_compiling" = maybe; then
+ cross_compiling=yes
+ else
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot run C compiled programs.
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details" "$LINENO" 5; }
+ fi
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5
+$as_echo "$cross_compiling" >&6; }
+
+rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out
+ac_clean_files=$ac_clean_files_save
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5
+$as_echo_n "checking for suffix of object files... " >&6; }
+if ${ac_cv_objext+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.o conftest.obj
+if { { ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_compile") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then :
+ for ac_file in conftest.o conftest.obj conftest.*; do
+ test -f "$ac_file" || continue;
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;;
+ *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
+ break;;
+ esac
+done
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot compute suffix of object files: cannot compile
+See \`config.log' for more details" "$LINENO" 5; }
+fi
+rm -f conftest.$ac_cv_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5
+$as_echo "$ac_cv_objext" >&6; }
+OBJEXT=$ac_cv_objext
+ac_objext=$OBJEXT
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5
+$as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
+if ${ac_cv_c_compiler_gnu+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+#ifndef __GNUC__
+ choke me
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_compiler_gnu=yes
+else
+ ac_compiler_gnu=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_c_compiler_gnu=$ac_compiler_gnu
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5
+$as_echo "$ac_cv_c_compiler_gnu" >&6; }
+if test $ac_compiler_gnu = yes; then
+ GCC=yes
+else
+ GCC=
+fi
+ac_test_CFLAGS=${CFLAGS+set}
+ac_save_CFLAGS=$CFLAGS
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
+$as_echo_n "checking whether $CC accepts -g... " >&6; }
+if ${ac_cv_prog_cc_g+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_save_c_werror_flag=$ac_c_werror_flag
+ ac_c_werror_flag=yes
+ ac_cv_prog_cc_g=no
+ CFLAGS="-g"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_prog_cc_g=yes
+else
+ CFLAGS=""
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+else
+ ac_c_werror_flag=$ac_save_c_werror_flag
+ CFLAGS="-g"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_prog_cc_g=yes
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ ac_c_werror_flag=$ac_save_c_werror_flag
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5
+$as_echo "$ac_cv_prog_cc_g" >&6; }
+if test "$ac_test_CFLAGS" = set; then
+ CFLAGS=$ac_save_CFLAGS
+elif test $ac_cv_prog_cc_g = yes; then
+ if test "$GCC" = yes; then
+ CFLAGS="-g -O2"
+ else
+ CFLAGS="-g"
+ fi
+else
+ if test "$GCC" = yes; then
+ CFLAGS="-O2"
+ else
+ CFLAGS=
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
+$as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
+if ${ac_cv_prog_cc_c89+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_cv_prog_cc_c89=no
+ac_save_CC=$CC
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdarg.h>
+#include <stdio.h>
+struct stat;
+/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
+struct buf { int x; };
+FILE * (*rcsopen) (struct buf *, struct stat *, int);
+static char *e (p, i)
+ char **p;
+ int i;
+{
+ return p[i];
+}
+static char *f (char * (*g) (char **, int), char **p, ...)
+{
+ char *s;
+ va_list v;
+ va_start (v,p);
+ s = g (p, va_arg (v,int));
+ va_end (v);
+ return s;
+}
+
+/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has
+ function prototypes and stuff, but not '\xHH' hex character constants.
+ These don't provoke an error unfortunately, instead are silently treated
+ as 'x'. The following induces an error, until -std is added to get
+ proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an
+ array size at least. It's necessary to write '\x00'==0 to get something
+ that's true only with -std. */
+int osf4_cc_array ['\x00' == 0 ? 1 : -1];
+
+/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
+ inside strings and character constants. */
+#define FOO(x) 'x'
+int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
+
+int test (int i, double x);
+struct s1 {int (*f) (int a);};
+struct s2 {int (*f) (double a);};
+int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
+int argc;
+char **argv;
+int
+main ()
+{
+return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
+ ;
+ return 0;
+}
+_ACEOF
+for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
+ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+do
+ CC="$ac_save_CC $ac_arg"
+ if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_prog_cc_c89=$ac_arg
+fi
+rm -f core conftest.err conftest.$ac_objext
+ test "x$ac_cv_prog_cc_c89" != "xno" && break
+done
+rm -f conftest.$ac_ext
+CC=$ac_save_CC
+
+fi
+# AC_CACHE_VAL
+case "x$ac_cv_prog_cc_c89" in
+ x)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
+$as_echo "none needed" >&6; } ;;
+ xno)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
+$as_echo "unsupported" >&6; } ;;
+ *)
+ CC="$CC $ac_cv_prog_cc_c89"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
+$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
+esac
+if test "x$ac_cv_prog_cc_c89" != xno; then :
+
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5
+$as_echo_n "checking whether $CC understands -c and -o together... " >&6; }
+if ${am_cv_prog_cc_c_o+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+ # Make sure it works both with $CC and with simple cc.
+ # Following AC_PROG_CC_C_O, we do the test twice because some
+ # compilers refuse to overwrite an existing .o file with -o,
+ # though they will create one.
+ am_cv_prog_cc_c_o=yes
+ for am_i in 1 2; do
+ if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5
+ ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } \
+ && test -f conftest2.$ac_objext; then
+ : OK
+ else
+ am_cv_prog_cc_c_o=no
+ break
+ fi
+ done
+ rm -f core conftest*
+ unset am_i
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5
+$as_echo "$am_cv_prog_cc_c_o" >&6; }
+if test "$am_cv_prog_cc_c_o" != yes; then
+ # Losing compiler, so override with the script.
+ # FIXME: It is wrong to rewrite CC.
+ # But if we don't then we get into trouble of one sort or another.
+ # A longer-term fix would be to have automake use am__CC in this case,
+ # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
+ CC="$am_aux_dir/compile $CC"
+fi
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+depcc="$CC" am_compiler_list=
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
+$as_echo_n "checking dependency style of $depcc... " >&6; }
+if ${am_cv_CC_dependencies_compiler_type+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+ # We make a subdir and do the tests there. Otherwise we can end up
+ # making bogus files that we don't know about and never remove. For
+ # instance it was reported that on HP-UX the gcc test will end up
+ # making a dummy file named 'D' -- because '-MD' means "put the output
+ # in D".
+ rm -rf conftest.dir
+ mkdir conftest.dir
+ # Copy depcomp to subdir because otherwise we won't find it if we're
+ # using a relative directory.
+ cp "$am_depcomp" conftest.dir
+ cd conftest.dir
+ # We will build objects and dependencies in a subdirectory because
+ # it helps to detect inapplicable dependency modes. For instance
+ # both Tru64's cc and ICC support -MD to output dependencies as a
+ # side effect of compilation, but ICC will put the dependencies in
+ # the current directory while Tru64 will put them in the object
+ # directory.
+ mkdir sub
+
+ am_cv_CC_dependencies_compiler_type=none
+ if test "$am_compiler_list" = ""; then
+ am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
+ fi
+ am__universal=false
+ case " $depcc " in #(
+ *\ -arch\ *\ -arch\ *) am__universal=true ;;
+ esac
+
+ for depmode in $am_compiler_list; do
+ # Setup a source with many dependencies, because some compilers
+ # like to wrap large dependency lists on column 80 (with \), and
+ # we should not choose a depcomp mode which is confused by this.
+ #
+ # We need to recreate these files for each test, as the compiler may
+ # overwrite some of them when testing with obscure command lines.
+ # This happens at least with the AIX C compiler.
+ : > sub/conftest.c
+ for i in 1 2 3 4 5 6; do
+ echo '#include "conftst'$i'.h"' >> sub/conftest.c
+ # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
+ # Solaris 10 /bin/sh.
+ echo '/* dummy */' > sub/conftst$i.h
+ done
+ echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+ # We check with '-c' and '-o' for the sake of the "dashmstdout"
+ # mode. It turns out that the SunPro C++ compiler does not properly
+ # handle '-M -o', and we need to detect this. Also, some Intel
+ # versions had trouble with output in subdirs.
+ am__obj=sub/conftest.${OBJEXT-o}
+ am__minus_obj="-o $am__obj"
+ case $depmode in
+ gcc)
+ # This depmode causes a compiler race in universal mode.
+ test "$am__universal" = false || continue
+ ;;
+ nosideeffect)
+ # After this tag, mechanisms are not by side-effect, so they'll
+ # only be used when explicitly requested.
+ if test "x$enable_dependency_tracking" = xyes; then
+ continue
+ else
+ break
+ fi
+ ;;
+ msvc7 | msvc7msys | msvisualcpp | msvcmsys)
+ # This compiler won't grok '-c -o', but also, the minuso test has
+ # not run yet. These depmodes are late enough in the game, and
+ # so weak that their functioning should not be impacted.
+ am__obj=conftest.${OBJEXT-o}
+ am__minus_obj=
+ ;;
+ none) break ;;
+ esac
+ if depmode=$depmode \
+ source=sub/conftest.c object=$am__obj \
+ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
+ >/dev/null 2>conftest.err &&
+ grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
+ grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+ grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
+ ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+ # icc doesn't choke on unknown options, it will just issue warnings
+ # or remarks (even with -Werror). So we grep stderr for any message
+ # that says an option was ignored or not supported.
+ # When given -MP, icc 7.0 and 7.1 complain thusly:
+ # icc: Command line warning: ignoring option '-M'; no argument required
+ # The diagnosis changed in icc 8.0:
+ # icc: Command line remark: option '-MP' not supported
+ if (grep 'ignoring option' conftest.err ||
+ grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
+ am_cv_CC_dependencies_compiler_type=$depmode
+ break
+ fi
+ fi
+ done
+
+ cd ..
+ rm -rf conftest.dir
+else
+ am_cv_CC_dependencies_compiler_type=none
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5
+$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; }
+CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
+
+ if
+ test "x$enable_dependency_tracking" != xno \
+ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then
+ am__fastdepCC_TRUE=
+ am__fastdepCC_FALSE='#'
+else
+ am__fastdepCC_TRUE='#'
+ am__fastdepCC_FALSE=
+fi
+
+
+
+# Check whether --enable-compiler-warnings was given.
+if test "${enable_compiler_warnings+set}" = set; then :
+ enableval=$enable_compiler_warnings;
+fi
+case $enable_compiler_warnings in #(
+ no | min | yes | max | all) :
+ ;; #(
+ *) :
+ if test "x$enable_maintainer_mode" = xyes; then :
+ enable_compiler_warnings=yes
+else
+ enable_compiler_warnings=min
+fi ;;
+esac
+
+
+if test "`cd $srcdir && pwd`" != "`pwd`"; then
+ # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
+ # is not polluted with repeated "-I."
+ am__isrc=' -I$(srcdir)'
+ # test to see if srcdir already configured
+ if test -f $srcdir/config.status; then
+ as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5
+ fi
+fi
+
+# test whether we have cygpath
+if test -z "$CYGPATH_W"; then
+ if (cygpath --version) >/dev/null 2>/dev/null; then
+ CYGPATH_W='cygpath -w'
+ else
+ CYGPATH_W=echo
+ fi
+fi
+
+
+# Define the identity of the package.
+ PACKAGE='gmp-native'
+ VERSION='6.0.0'
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE "$PACKAGE"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define VERSION "$VERSION"
+_ACEOF
+
+# Some tools Automake needs.
+
+ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"}
+
+
+AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"}
+
+
+AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"}
+
+
+AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"}
+
+
+MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
+
+# For better backward compatibility. To be removed once Automake 1.9.x
+# dies out for good. For more background, see:
+# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
+# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
+mkdir_p='$(MKDIR_P)'
+
+# We need awk for the "check" target. The system "awk" is bad on
+# some platforms.
+# Always define AMTAR for backward compatibility. Yes, it's still used
+# in the wild :-( We should find a proper way to deprecate it ...
+AMTAR='$${TAR-tar}'
+
+
+# We'll loop over all known methods to create a tar archive until one works.
+_am_tools='gnutar pax cpio none'
+
+am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'
+
+
+
+
+
+
+# POSIX will say in a future version that running "rm -f" with no argument
+# is OK; and we want to be able to make that assumption in our Makefile
+# recipes. So use an aggressive probe to check that the usage we want is
+# actually supported "in the wild" to an acceptable degree.
+# See automake bug#10828.
+# To make any issue more visible, cause the running configure to be aborted
+# by default if the 'rm' program in use doesn't match our expectations; the
+# user can still override this though.
+if rm -f && rm -fr && rm -rf; then : OK; else
+ cat >&2 <<'END'
+Oops!
+
+Your 'rm' program seems unable to run without file operands specified
+on the command line, even when the '-f' option is present. This is contrary
+to the behaviour of most rm programs out there, and not conforming with
+the upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542>
+
+Please tell bug-automake@gnu.org about your system, including the value
+of your $PATH and any error possibly output before this message. This
+can help us improve future automake versions.
+
+END
+ if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then
+ echo 'Configuration will proceed anyway, since you have set the' >&2
+ echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2
+ echo >&2
+ else
+ cat >&2 <<'END'
+Aborting the configuration process, to ensure you take notice of the issue.
+
+You can download and install GNU coreutils to get an 'rm' implementation
+that behaves properly: <http://www.gnu.org/software/coreutils/>.
+
+If you want to complete the configuration process using your problematic
+'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
+to "yes", and re-run configure.
+
+END
+ as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5
+ fi
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5
+$as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; }
+ # Check whether --enable-maintainer-mode was given.
+if test "${enable_maintainer_mode+set}" = set; then :
+ enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval
+else
+ USE_MAINTAINER_MODE=no
+fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5
+$as_echo "$USE_MAINTAINER_MODE" >&6; }
+ if test $USE_MAINTAINER_MODE = yes; then
+ MAINTAINER_MODE_TRUE=
+ MAINTAINER_MODE_FALSE='#'
+else
+ MAINTAINER_MODE_TRUE='#'
+ MAINTAINER_MODE_FALSE=
+fi
+
+ MAINT=$MAINTAINER_MODE_TRUE
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler accepts prototypes" >&5
+$as_echo_n "checking whether the compiler accepts prototypes... " >&6; }
+if ${kb_cv_c_prototypes+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdarg.h>
+int
+main ()
+{
+extern void foo(int i,...);
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ kb_cv_c_prototypes=yes
+else
+ kb_cv_c_prototypes=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $kb_cv_c_prototypes" >&5
+$as_echo "$kb_cv_c_prototypes" >&6; }
+if test "x$kb_cv_c_prototypes" = xno; then
+ as_fn_error $? "Sorry, your compiler does not understand prototypes." "$LINENO" 5
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking what warning flags to pass to the C compiler" >&5
+$as_echo_n "checking what warning flags to pass to the C compiler... " >&6; }
+if ${kpse_cv_warning_cflags+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test "x$GCC" = xyes; then
+ kpse_cv_warning_cflags=
+if test "x$enable_compiler_warnings" != xno; then
+ kpse_cv_warning_cflags="-Wimplicit -Wreturn-type"
+ case `$CC -dumpversion` in #(
+ 3.4.* | 4.*) :
+ kpse_cv_warning_cflags="$kpse_cv_warning_cflags -Wdeclaration-after-statement" ;; #(
+ *) :
+ ;;
+esac
+ case `$CC -dumpversion` in #(
+ 3.[234].* | 4.*) :
+ kpse_cv_warning_cflags="$kpse_cv_warning_cflags -Wno-unknown-pragmas" ;; #(
+ *) :
+ ;;
+esac
+ if test "x$enable_compiler_warnings" != xmin; then
+ kpse_cv_warning_cflags="-Wall -Wunused $kpse_cv_warning_cflags"
+ kpse_cv_warning_cflags="$kpse_cv_warning_cflags -Wmissing-prototypes -Wmissing-declarations"
+ if test "x$enable_compiler_warnings" != xyes; then
+ kpse_cv_warning_cflags="$kpse_cv_warning_cflags -Wparentheses -Wswitch -Wtrigraphs -Wpointer-arith"
+ kpse_cv_warning_cflags="$kpse_cv_warning_cflags -Wcast-qual -Wcast-align -Wwrite-strings"
+ case `$CC -dumpversion` in #(
+ 3.4.* | 4.*) :
+ kpse_cv_warning_cflags="$kpse_cv_warning_cflags -Wold-style-definition" ;; #(
+ *) :
+ ;;
+esac
+ if test "x$enable_compiler_warnings" != xmax; then
+ kpse_cv_warning_cflags="$kpse_cv_warning_cflags -Wshadow"
+ fi
+ fi
+ fi
+fi
+elif test "x$enable_compiler_warnings" = xno; then
+ kpse_cv_warning_cflags=
+else
+ kpse_cv_warning_cflags= # FIXME: warning flags for non-GNU C compilers
+fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $kpse_cv_warning_cflags" >&5
+$as_echo "$kpse_cv_warning_cflags" >&6; }
+WARNING_CFLAGS=$kpse_cv_warning_cflags
+
+
+
+
+
+
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}gcc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_CC="${ac_tool_prefix}gcc"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_CC"; then
+ ac_ct_CC=$CC
+ # Extract the first word of "gcc", so it can be a program name with args.
+set dummy gcc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_CC"; then
+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_CC="gcc"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_CC" = x; then
+ CC=""
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ CC=$ac_ct_CC
+ fi
+else
+ CC="$ac_cv_prog_CC"
+fi
+
+if test -z "$CC"; then
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}cc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_CC="${ac_tool_prefix}cc"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ fi
+fi
+if test -z "$CC"; then
+ # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+ ac_prog_rejected=no
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
+ ac_prog_rejected=yes
+ continue
+ fi
+ ac_cv_prog_CC="cc"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+if test $ac_prog_rejected = yes; then
+ # We found a bogon in the path, so make sure we never use it.
+ set dummy $ac_cv_prog_CC
+ shift
+ if test $# != 0; then
+ # We chose a different compiler from the bogus one.
+ # However, it has the same basename, so the bogon will be chosen
+ # first if we set CC to just the basename; use the full file name.
+ shift
+ ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
+ fi
+fi
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$CC"; then
+ if test -n "$ac_tool_prefix"; then
+ for ac_prog in cl.exe
+ do
+ # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$CC" && break
+ done
+fi
+if test -z "$CC"; then
+ ac_ct_CC=$CC
+ for ac_prog in cl.exe
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_CC"; then
+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_CC="$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$ac_ct_CC" && break
+done
+
+ if test "x$ac_ct_CC" = x; then
+ CC=""
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ CC=$ac_ct_CC
+ fi
+fi
+
+fi
+
+
+test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "no acceptable C compiler found in \$PATH
+See \`config.log' for more details" "$LINENO" 5; }
+
+# Provide some information about the compiler.
+$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
+set X $ac_compile
+ac_compiler=$2
+for ac_option in --version -v -V -qversion; do
+ { { ac_try="$ac_compiler $ac_option >&5"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_compiler $ac_option >&5") 2>conftest.err
+ ac_status=$?
+ if test -s conftest.err; then
+ sed '10a\
+... rest of stderr output deleted ...
+ 10q' conftest.err >conftest.er1
+ cat conftest.er1 >&5
+ fi
+ rm -f conftest.er1 conftest.err
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }
+done
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5
+$as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
+if ${ac_cv_c_compiler_gnu+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+#ifndef __GNUC__
+ choke me
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_compiler_gnu=yes
+else
+ ac_compiler_gnu=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_c_compiler_gnu=$ac_compiler_gnu
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5
+$as_echo "$ac_cv_c_compiler_gnu" >&6; }
+if test $ac_compiler_gnu = yes; then
+ GCC=yes
+else
+ GCC=
+fi
+ac_test_CFLAGS=${CFLAGS+set}
+ac_save_CFLAGS=$CFLAGS
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
+$as_echo_n "checking whether $CC accepts -g... " >&6; }
+if ${ac_cv_prog_cc_g+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_save_c_werror_flag=$ac_c_werror_flag
+ ac_c_werror_flag=yes
+ ac_cv_prog_cc_g=no
+ CFLAGS="-g"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_prog_cc_g=yes
+else
+ CFLAGS=""
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+else
+ ac_c_werror_flag=$ac_save_c_werror_flag
+ CFLAGS="-g"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_prog_cc_g=yes
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ ac_c_werror_flag=$ac_save_c_werror_flag
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5
+$as_echo "$ac_cv_prog_cc_g" >&6; }
+if test "$ac_test_CFLAGS" = set; then
+ CFLAGS=$ac_save_CFLAGS
+elif test $ac_cv_prog_cc_g = yes; then
+ if test "$GCC" = yes; then
+ CFLAGS="-g -O2"
+ else
+ CFLAGS="-g"
+ fi
+else
+ if test "$GCC" = yes; then
+ CFLAGS="-O2"
+ else
+ CFLAGS=
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
+$as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
+if ${ac_cv_prog_cc_c89+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_cv_prog_cc_c89=no
+ac_save_CC=$CC
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdarg.h>
+#include <stdio.h>
+struct stat;
+/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
+struct buf { int x; };
+FILE * (*rcsopen) (struct buf *, struct stat *, int);
+static char *e (p, i)
+ char **p;
+ int i;
+{
+ return p[i];
+}
+static char *f (char * (*g) (char **, int), char **p, ...)
+{
+ char *s;
+ va_list v;
+ va_start (v,p);
+ s = g (p, va_arg (v,int));
+ va_end (v);
+ return s;
+}
+
+/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has
+ function prototypes and stuff, but not '\xHH' hex character constants.
+ These don't provoke an error unfortunately, instead are silently treated
+ as 'x'. The following induces an error, until -std is added to get
+ proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an
+ array size at least. It's necessary to write '\x00'==0 to get something
+ that's true only with -std. */
+int osf4_cc_array ['\x00' == 0 ? 1 : -1];
+
+/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
+ inside strings and character constants. */
+#define FOO(x) 'x'
+int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
+
+int test (int i, double x);
+struct s1 {int (*f) (int a);};
+struct s2 {int (*f) (double a);};
+int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
+int argc;
+char **argv;
+int
+main ()
+{
+return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
+ ;
+ return 0;
+}
+_ACEOF
+for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
+ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+do
+ CC="$ac_save_CC $ac_arg"
+ if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_prog_cc_c89=$ac_arg
+fi
+rm -f core conftest.err conftest.$ac_objext
+ test "x$ac_cv_prog_cc_c89" != "xno" && break
+done
+rm -f conftest.$ac_ext
+CC=$ac_save_CC
+
+fi
+# AC_CACHE_VAL
+case "x$ac_cv_prog_cc_c89" in
+ x)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
+$as_echo "none needed" >&6; } ;;
+ xno)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
+$as_echo "unsupported" >&6; } ;;
+ *)
+ CC="$CC $ac_cv_prog_cc_c89"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
+$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
+esac
+if test "x$ac_cv_prog_cc_c89" != xno; then :
+
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5
+$as_echo_n "checking whether $CC understands -c and -o together... " >&6; }
+if ${am_cv_prog_cc_c_o+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+ # Make sure it works both with $CC and with simple cc.
+ # Following AC_PROG_CC_C_O, we do the test twice because some
+ # compilers refuse to overwrite an existing .o file with -o,
+ # though they will create one.
+ am_cv_prog_cc_c_o=yes
+ for am_i in 1 2; do
+ if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5
+ ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } \
+ && test -f conftest2.$ac_objext; then
+ : OK
+ else
+ am_cv_prog_cc_c_o=no
+ break
+ fi
+ done
+ rm -f core conftest*
+ unset am_i
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5
+$as_echo "$am_cv_prog_cc_c_o" >&6; }
+if test "$am_cv_prog_cc_c_o" != yes; then
+ # Losing compiler, so override with the script.
+ # FIXME: It is wrong to rewrite CC.
+ # But if we don't then we get into trouble of one sort or another.
+ # A longer-term fix would be to have automake use am__CC in this case,
+ # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
+ CC="$am_aux_dir/compile $CC"
+fi
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+depcc="$CC" am_compiler_list=
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
+$as_echo_n "checking dependency style of $depcc... " >&6; }
+if ${am_cv_CC_dependencies_compiler_type+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+ # We make a subdir and do the tests there. Otherwise we can end up
+ # making bogus files that we don't know about and never remove. For
+ # instance it was reported that on HP-UX the gcc test will end up
+ # making a dummy file named 'D' -- because '-MD' means "put the output
+ # in D".
+ rm -rf conftest.dir
+ mkdir conftest.dir
+ # Copy depcomp to subdir because otherwise we won't find it if we're
+ # using a relative directory.
+ cp "$am_depcomp" conftest.dir
+ cd conftest.dir
+ # We will build objects and dependencies in a subdirectory because
+ # it helps to detect inapplicable dependency modes. For instance
+ # both Tru64's cc and ICC support -MD to output dependencies as a
+ # side effect of compilation, but ICC will put the dependencies in
+ # the current directory while Tru64 will put them in the object
+ # directory.
+ mkdir sub
+
+ am_cv_CC_dependencies_compiler_type=none
+ if test "$am_compiler_list" = ""; then
+ am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
+ fi
+ am__universal=false
+ case " $depcc " in #(
+ *\ -arch\ *\ -arch\ *) am__universal=true ;;
+ esac
+
+ for depmode in $am_compiler_list; do
+ # Setup a source with many dependencies, because some compilers
+ # like to wrap large dependency lists on column 80 (with \), and
+ # we should not choose a depcomp mode which is confused by this.
+ #
+ # We need to recreate these files for each test, as the compiler may
+ # overwrite some of them when testing with obscure command lines.
+ # This happens at least with the AIX C compiler.
+ : > sub/conftest.c
+ for i in 1 2 3 4 5 6; do
+ echo '#include "conftst'$i'.h"' >> sub/conftest.c
+ # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
+ # Solaris 10 /bin/sh.
+ echo '/* dummy */' > sub/conftst$i.h
+ done
+ echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+ # We check with '-c' and '-o' for the sake of the "dashmstdout"
+ # mode. It turns out that the SunPro C++ compiler does not properly
+ # handle '-M -o', and we need to detect this. Also, some Intel
+ # versions had trouble with output in subdirs.
+ am__obj=sub/conftest.${OBJEXT-o}
+ am__minus_obj="-o $am__obj"
+ case $depmode in
+ gcc)
+ # This depmode causes a compiler race in universal mode.
+ test "$am__universal" = false || continue
+ ;;
+ nosideeffect)
+ # After this tag, mechanisms are not by side-effect, so they'll
+ # only be used when explicitly requested.
+ if test "x$enable_dependency_tracking" = xyes; then
+ continue
+ else
+ break
+ fi
+ ;;
+ msvc7 | msvc7msys | msvisualcpp | msvcmsys)
+ # This compiler won't grok '-c -o', but also, the minuso test has
+ # not run yet. These depmodes are late enough in the game, and
+ # so weak that their functioning should not be impacted.
+ am__obj=conftest.${OBJEXT-o}
+ am__minus_obj=
+ ;;
+ none) break ;;
+ esac
+ if depmode=$depmode \
+ source=sub/conftest.c object=$am__obj \
+ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
+ >/dev/null 2>conftest.err &&
+ grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
+ grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+ grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
+ ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+ # icc doesn't choke on unknown options, it will just issue warnings
+ # or remarks (even with -Werror). So we grep stderr for any message
+ # that says an option was ignored or not supported.
+ # When given -MP, icc 7.0 and 7.1 complain thusly:
+ # icc: Command line warning: ignoring option '-M'; no argument required
+ # The diagnosis changed in icc 8.0:
+ # icc: Command line remark: option '-MP' not supported
+ if (grep 'ignoring option' conftest.err ||
+ grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
+ am_cv_CC_dependencies_compiler_type=$depmode
+ break
+ fi
+ fi
+ done
+
+ cd ..
+ rm -rf conftest.dir
+else
+ am_cv_CC_dependencies_compiler_type=none
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5
+$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; }
+CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
+
+ if
+ test "x$enable_dependency_tracking" != xno \
+ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then
+ am__fastdepCC_TRUE=
+ am__fastdepCC_FALSE='#'
+else
+ am__fastdepCC_TRUE='#'
+ am__fastdepCC_FALSE=
+fi
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5
+$as_echo_n "checking whether ln -s works... " >&6; }
+LN_S=$as_ln_s
+if test "$LN_S" = "ln -s"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5
+$as_echo "no, using $LN_S" >&6; }
+fi
+
+
+kpse_search_save_LIBS=$LIBS
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing pow" >&5
+$as_echo_n "checking for library containing pow... " >&6; }
+if ${ac_cv_search_pow+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char pow ();
+int
+main ()
+{
+return pow ();
+ ;
+ return 0;
+}
+_ACEOF
+for ac_lib in '' m; do
+ if test -z "$ac_lib"; then
+ ac_res="none required"
+ else
+ ac_res=-l$ac_lib
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
+ fi
+ if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_search_pow=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext
+ if ${ac_cv_search_pow+:} false; then :
+ break
+fi
+done
+if ${ac_cv_search_pow+:} false; then :
+
+else
+ ac_cv_search_pow=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_pow" >&5
+$as_echo "$ac_cv_search_pow" >&6; }
+ac_res=$ac_cv_search_pow
+if test "$ac_res" != no; then :
+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+fi
+
+LIBS=$kpse_search_save_LIBS
+case $ac_cv_search_pow in #(
+ "none required") :
+ ;; #(
+ no) :
+ as_fn_error $? "Sorry, did not find pow()" "$LINENO" 5 ;; #(
+ *) :
+ MATH_LIB=$ac_cv_search_pow ;;
+esac
+
+
+GMP_TREE=../gmp-6.0.0
+
+
+ac_config_headers="$ac_config_headers config.h"
+
+
+ac_config_files="$ac_config_files Makefile"
+
+
+cat >confcache <<\_ACEOF
+# This file is a shell script that caches the results of configure
+# tests run on this system so they can be shared between configure
+# scripts and configure runs, see configure's option --config-cache.
+# It is not useful on other systems. If it contains results you don't
+# want to keep, you may remove or edit it.
+#
+# config.status only pays attention to the cache file if you give it
+# the --recheck option to rerun configure.
+#
+# `ac_cv_env_foo' variables (set or unset) will be overridden when
+# loading this file, other *unset* `ac_cv_foo' will be assigned the
+# following values.
+
+_ACEOF
+
+# The following way of writing the cache mishandles newlines in values,
+# but we know of no workaround that is simple, portable, and efficient.
+# So, we kill variables containing newlines.
+# Ultrix sh set writes to stderr and can't be redirected directly,
+# and sets the high bit in the cache file unless we assign to the vars.
+(
+ for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
+ eval ac_val=\$$ac_var
+ case $ac_val in #(
+ *${as_nl}*)
+ case $ac_var in #(
+ *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
+ esac
+ case $ac_var in #(
+ _ | IFS | as_nl) ;; #(
+ BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
+ *) { eval $ac_var=; unset $ac_var;} ;;
+ esac ;;
+ esac
+ done
+
+ (set) 2>&1 |
+ case $as_nl`(ac_space=' '; set) 2>&1` in #(
+ *${as_nl}ac_space=\ *)
+ # `set' does not quote correctly, so add quotes: double-quote
+ # substitution turns \\\\ into \\, and sed turns \\ into \.
+ sed -n \
+ "s/'/'\\\\''/g;
+ s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
+ ;; #(
+ *)
+ # `set' quotes correctly as required by POSIX, so do not add quotes.
+ sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+ ;;
+ esac |
+ sort
+) |
+ sed '
+ /^ac_cv_env_/b end
+ t clear
+ :clear
+ s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
+ t end
+ s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
+ :end' >>confcache
+if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
+ if test -w "$cache_file"; then
+ if test "x$cache_file" != "x/dev/null"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5
+$as_echo "$as_me: updating cache $cache_file" >&6;}
+ if test ! -f "$cache_file" || test -h "$cache_file"; then
+ cat confcache >"$cache_file"
+ else
+ case $cache_file in #(
+ */* | ?:*)
+ mv -f confcache "$cache_file"$$ &&
+ mv -f "$cache_file"$$ "$cache_file" ;; #(
+ *)
+ mv -f confcache "$cache_file" ;;
+ esac
+ fi
+ fi
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5
+$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
+ fi
+fi
+rm -f confcache
+
+test "x$prefix" = xNONE && prefix=$ac_default_prefix
+# Let make expand exec_prefix.
+test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
+
+DEFS=-DHAVE_CONFIG_H
+
+ac_libobjs=
+ac_ltlibobjs=
+U=
+for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
+ # 1. Remove the extension, and $U if already installed.
+ ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
+ ac_i=`$as_echo "$ac_i" | sed "$ac_script"`
+ # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR
+ # will be set to the directory where LIBOBJS objects are built.
+ as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext"
+ as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo'
+done
+LIBOBJS=$ac_libobjs
+
+LTLIBOBJS=$ac_ltlibobjs
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5
+$as_echo_n "checking that generated files are newer than configure... " >&6; }
+ if test -n "$am_sleep_pid"; then
+ # Hide warnings about reused PIDs.
+ wait $am_sleep_pid 2>/dev/null
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5
+$as_echo "done" >&6; }
+ if test -n "$EXEEXT"; then
+ am__EXEEXT_TRUE=
+ am__EXEEXT_FALSE='#'
+else
+ am__EXEEXT_TRUE='#'
+ am__EXEEXT_FALSE=
+fi
+
+if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then
+ as_fn_error $? "conditional \"MAINTAINER_MODE\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then
+ as_fn_error $? "conditional \"AMDEP\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
+ as_fn_error $? "conditional \"am__fastdepCC\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
+ as_fn_error $? "conditional \"am__fastdepCC\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+
+: "${CONFIG_STATUS=./config.status}"
+ac_write_fail=0
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files $CONFIG_STATUS"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5
+$as_echo "$as_me: creating $CONFIG_STATUS" >&6;}
+as_write_fail=0
+cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1
+#! $SHELL
+# Generated by $as_me.
+# Run this file to recreate the current configuration.
+# Compiler output produced by configure, useful for debugging
+# configure, is in config.log if it exists.
+
+debug=false
+ac_cs_recheck=false
+ac_cs_silent=false
+
+SHELL=\${CONFIG_SHELL-$SHELL}
+export SHELL
+_ASEOF
+cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1
+## -------------------- ##
+## M4sh Initialization. ##
+## -------------------- ##
+
+# Be more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
+ emulate sh
+ NULLCMD=:
+ # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '${1+"$@"}'='"$@"'
+ setopt NO_GLOB_SUBST
+else
+ case `(set -o) 2>/dev/null` in #(
+ *posix*) :
+ set -o posix ;; #(
+ *) :
+ ;;
+esac
+fi
+
+
+as_nl='
+'
+export as_nl
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+# Prefer a ksh shell builtin over an external printf program on Solaris,
+# but without wasting forks for bash or zsh.
+if test -z "$BASH_VERSION$ZSH_VERSION" \
+ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
+ as_echo='print -r --'
+ as_echo_n='print -rn --'
+elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+ as_echo='printf %s\n'
+ as_echo_n='printf %s'
+else
+ if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+ as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
+ as_echo_n='/usr/ucb/echo -n'
+ else
+ as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+ as_echo_n_body='eval
+ arg=$1;
+ case $arg in #(
+ *"$as_nl"*)
+ expr "X$arg" : "X\\(.*\\)$as_nl";
+ arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+ esac;
+ expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+ '
+ export as_echo_n_body
+ as_echo_n='sh -c $as_echo_n_body as_echo'
+ fi
+ export as_echo_body
+ as_echo='sh -c $as_echo_body as_echo'
+fi
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+ PATH_SEPARATOR=:
+ (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
+ (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
+ PATH_SEPARATOR=';'
+ }
+fi
+
+
+# IFS
+# We need space, tab and new line, in precisely that order. Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+IFS=" "" $as_nl"
+
+# Find who we are. Look in the path if we contain no directory separator.
+as_myself=
+case $0 in #((
+ *[\\/]* ) as_myself=$0 ;;
+ *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+ done
+IFS=$as_save_IFS
+
+ ;;
+esac
+# We did not find ourselves, most probably we were run as `sh COMMAND'
+# in which case we are not to be found in the path.
+if test "x$as_myself" = x; then
+ as_myself=$0
+fi
+if test ! -f "$as_myself"; then
+ $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+ exit 1
+fi
+
+# Unset variables that we do not need and which cause bugs (e.g. in
+# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1"
+# suppresses any "Segmentation fault" message there. '((' could
+# trigger a bug in pdksh 5.2.14.
+for as_var in BASH_ENV ENV MAIL MAILPATH
+do eval test x\${$as_var+set} = xset \
+ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
+done
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
+
+# CDPATH.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+
+# as_fn_error STATUS ERROR [LINENO LOG_FD]
+# ----------------------------------------
+# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
+# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
+# script with STATUS, using 1 if that was 0.
+as_fn_error ()
+{
+ as_status=$1; test $as_status -eq 0 && as_status=1
+ if test "$4"; then
+ as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
+ fi
+ $as_echo "$as_me: error: $2" >&2
+ as_fn_exit $as_status
+} # as_fn_error
+
+
+# as_fn_set_status STATUS
+# -----------------------
+# Set $? to STATUS, without forking.
+as_fn_set_status ()
+{
+ return $1
+} # as_fn_set_status
+
+# as_fn_exit STATUS
+# -----------------
+# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
+as_fn_exit ()
+{
+ set +e
+ as_fn_set_status $1
+ exit $1
+} # as_fn_exit
+
+# as_fn_unset VAR
+# ---------------
+# Portably unset VAR.
+as_fn_unset ()
+{
+ { eval $1=; unset $1;}
+}
+as_unset=as_fn_unset
+# as_fn_append VAR VALUE
+# ----------------------
+# Append the text in VALUE to the end of the definition contained in VAR. Take
+# advantage of any shell optimizations that allow amortized linear growth over
+# repeated appends, instead of the typical quadratic growth present in naive
+# implementations.
+if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
+ eval 'as_fn_append ()
+ {
+ eval $1+=\$2
+ }'
+else
+ as_fn_append ()
+ {
+ eval $1=\$$1\$2
+ }
+fi # as_fn_append
+
+# as_fn_arith ARG...
+# ------------------
+# Perform arithmetic evaluation on the ARGs, and store the result in the
+# global $as_val. Take advantage of shells that can avoid forks. The arguments
+# must be portable across $(()) and expr.
+if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
+ eval 'as_fn_arith ()
+ {
+ as_val=$(( $* ))
+ }'
+else
+ as_fn_arith ()
+ {
+ as_val=`expr "$@" || test $? -eq 1`
+ }
+fi # as_fn_arith
+
+
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+ test "X`expr 00001 : '.*\(...\)'`" = X001; then
+ as_expr=expr
+else
+ as_expr=false
+fi
+
+if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
+ as_basename=basename
+else
+ as_basename=false
+fi
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+ as_dirname=dirname
+else
+ as_dirname=false
+fi
+
+as_me=`$as_basename -- "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+ X"$0" : 'X\(//\)$' \| \
+ X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X/"$0" |
+ sed '/^.*\/\([^/][^/]*\)\/*$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in #(((((
+-n*)
+ case `echo 'xy\c'` in
+ *c*) ECHO_T=' ';; # ECHO_T is single tab character.
+ xy) ECHO_C='\c';;
+ *) echo `echo ksh88 bug on AIX 6.1` > /dev/null
+ ECHO_T=' ';;
+ esac;;
+*)
+ ECHO_N='-n';;
+esac
+
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+ rm -f conf$$.dir/conf$$.file
+else
+ rm -f conf$$.dir
+ mkdir conf$$.dir 2>/dev/null
+fi
+if (echo >conf$$.file) 2>/dev/null; then
+ if ln -s conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s='ln -s'
+ # ... but there are two gotchas:
+ # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+ # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+ # In both cases, we have to default to `cp -pR'.
+ ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+ as_ln_s='cp -pR'
+ elif ln conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s=ln
+ else
+ as_ln_s='cp -pR'
+ fi
+else
+ as_ln_s='cp -pR'
+fi
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+
+# as_fn_mkdir_p
+# -------------
+# Create "$as_dir" as a directory, including parents if necessary.
+as_fn_mkdir_p ()
+{
+
+ case $as_dir in #(
+ -*) as_dir=./$as_dir;;
+ esac
+ test -d "$as_dir" || eval $as_mkdir_p || {
+ as_dirs=
+ while :; do
+ case $as_dir in #(
+ *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+ *) as_qdir=$as_dir;;
+ esac
+ as_dirs="'$as_qdir' $as_dirs"
+ as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$as_dir" : 'X\(//\)[^/]' \| \
+ X"$as_dir" : 'X\(//\)$' \| \
+ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_dir" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ test -d "$as_dir" && break
+ done
+ test -z "$as_dirs" || eval "mkdir $as_dirs"
+ } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
+
+
+} # as_fn_mkdir_p
+if mkdir -p . 2>/dev/null; then
+ as_mkdir_p='mkdir -p "$as_dir"'
+else
+ test -d ./-p && rmdir ./-p
+ as_mkdir_p=false
+fi
+
+
+# as_fn_executable_p FILE
+# -----------------------
+# Test if FILE is an executable regular file.
+as_fn_executable_p ()
+{
+ test -f "$1" && test -x "$1"
+} # as_fn_executable_p
+as_test_x='test -x'
+as_executable_p=as_fn_executable_p
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+
+exec 6>&1
+## ----------------------------------- ##
+## Main body of $CONFIG_STATUS script. ##
+## ----------------------------------- ##
+_ASEOF
+test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# Save the log message, to keep $0 and so on meaningful, and to
+# report actual input values of CONFIG_FILES etc. instead of their
+# values after options handling.
+ac_log="
+This file was extended by gmp native $as_me 6.0.0, which was
+generated by GNU Autoconf 2.69. Invocation command line was
+
+ CONFIG_FILES = $CONFIG_FILES
+ CONFIG_HEADERS = $CONFIG_HEADERS
+ CONFIG_LINKS = $CONFIG_LINKS
+ CONFIG_COMMANDS = $CONFIG_COMMANDS
+ $ $0 $@
+
+on `(hostname || uname -n) 2>/dev/null | sed 1q`
+"
+
+_ACEOF
+
+case $ac_config_files in *"
+"*) set x $ac_config_files; shift; ac_config_files=$*;;
+esac
+
+case $ac_config_headers in *"
+"*) set x $ac_config_headers; shift; ac_config_headers=$*;;
+esac
+
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+# Files that config.status was made for.
+config_files="$ac_config_files"
+config_headers="$ac_config_headers"
+config_commands="$ac_config_commands"
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+ac_cs_usage="\
+\`$as_me' instantiates files and other configuration actions
+from templates according to the current configuration. Unless the files
+and actions are specified as TAGs, all are instantiated by default.
+
+Usage: $0 [OPTION]... [TAG]...
+
+ -h, --help print this help, then exit
+ -V, --version print version number and configuration settings, then exit
+ --config print configuration, then exit
+ -q, --quiet, --silent
+ do not print progress messages
+ -d, --debug don't remove temporary files
+ --recheck update $as_me by reconfiguring in the same conditions
+ --file=FILE[:TEMPLATE]
+ instantiate the configuration file FILE
+ --header=FILE[:TEMPLATE]
+ instantiate the configuration header FILE
+
+Configuration files:
+$config_files
+
+Configuration headers:
+$config_headers
+
+Configuration commands:
+$config_commands
+
+Report bugs to <tex-k@tug.org>."
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
+ac_cs_version="\\
+gmp native config.status 6.0.0
+configured by $0, generated by GNU Autoconf 2.69,
+ with options \\"\$ac_cs_config\\"
+
+Copyright (C) 2012 Free Software Foundation, Inc.
+This config.status script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it."
+
+ac_pwd='$ac_pwd'
+srcdir='$srcdir'
+INSTALL='$INSTALL'
+MKDIR_P='$MKDIR_P'
+AWK='$AWK'
+test -n "\$AWK" || AWK=awk
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# The default lists apply if the user does not specify any file.
+ac_need_defaults=:
+while test $# != 0
+do
+ case $1 in
+ --*=?*)
+ ac_option=`expr "X$1" : 'X\([^=]*\)='`
+ ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
+ ac_shift=:
+ ;;
+ --*=)
+ ac_option=`expr "X$1" : 'X\([^=]*\)='`
+ ac_optarg=
+ ac_shift=:
+ ;;
+ *)
+ ac_option=$1
+ ac_optarg=$2
+ ac_shift=shift
+ ;;
+ esac
+
+ case $ac_option in
+ # Handling of the options.
+ -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+ ac_cs_recheck=: ;;
+ --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
+ $as_echo "$ac_cs_version"; exit ;;
+ --config | --confi | --conf | --con | --co | --c )
+ $as_echo "$ac_cs_config"; exit ;;
+ --debug | --debu | --deb | --de | --d | -d )
+ debug=: ;;
+ --file | --fil | --fi | --f )
+ $ac_shift
+ case $ac_optarg in
+ *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
+ '') as_fn_error $? "missing file argument" ;;
+ esac
+ as_fn_append CONFIG_FILES " '$ac_optarg'"
+ ac_need_defaults=false;;
+ --header | --heade | --head | --hea )
+ $ac_shift
+ case $ac_optarg in
+ *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
+ esac
+ as_fn_append CONFIG_HEADERS " '$ac_optarg'"
+ ac_need_defaults=false;;
+ --he | --h)
+ # Conflict between --help and --header
+ as_fn_error $? "ambiguous option: \`$1'
+Try \`$0 --help' for more information.";;
+ --help | --hel | -h )
+ $as_echo "$ac_cs_usage"; exit ;;
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil | --si | --s)
+ ac_cs_silent=: ;;
+
+ # This is an error.
+ -*) as_fn_error $? "unrecognized option: \`$1'
+Try \`$0 --help' for more information." ;;
+
+ *) as_fn_append ac_config_targets " $1"
+ ac_need_defaults=false ;;
+
+ esac
+ shift
+done
+
+ac_configure_extra_args=
+
+if $ac_cs_silent; then
+ exec 6>/dev/null
+ ac_configure_extra_args="$ac_configure_extra_args --silent"
+fi
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+if \$ac_cs_recheck; then
+ set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+ shift
+ \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
+ CONFIG_SHELL='$SHELL'
+ export CONFIG_SHELL
+ exec "\$@"
+fi
+
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+exec 5>>config.log
+{
+ echo
+ sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
+## Running $as_me. ##
+_ASBOX
+ $as_echo "$ac_log"
+} >&5
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+#
+# INIT-COMMANDS
+#
+AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+
+# Handling of arguments.
+for ac_config_target in $ac_config_targets
+do
+ case $ac_config_target in
+ "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
+ "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
+ "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
+
+ *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
+ esac
+done
+
+
+# If the user did not use the arguments to specify the items to instantiate,
+# then the envvar interface is used. Set only those that are not.
+# We use the long form for the default assignment because of an extremely
+# bizarre bug on SunOS 4.1.3.
+if $ac_need_defaults; then
+ test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
+ test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
+ test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
+fi
+
+# Have a temporary directory for convenience. Make it in the build tree
+# simply because there is no reason against having it here, and in addition,
+# creating and moving files from /tmp can sometimes cause problems.
+# Hook for its removal unless debugging.
+# Note that there is a small window in which the directory will not be cleaned:
+# after its creation but before its name has been assigned to `$tmp'.
+$debug ||
+{
+ tmp= ac_tmp=
+ trap 'exit_status=$?
+ : "${ac_tmp:=$tmp}"
+ { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status
+' 0
+ trap 'as_fn_exit 1' 1 2 13 15
+}
+# Create a (secure) tmp directory for tmp files.
+
+{
+ tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
+ test -d "$tmp"
+} ||
+{
+ tmp=./conf$$-$RANDOM
+ (umask 077 && mkdir "$tmp")
+} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5
+ac_tmp=$tmp
+
+# Set up the scripts for CONFIG_FILES section.
+# No need to generate them if there are no CONFIG_FILES.
+# This happens for instance with `./config.status config.h'.
+if test -n "$CONFIG_FILES"; then
+
+
+ac_cr=`echo X | tr X '\015'`
+# On cygwin, bash can eat \r inside `` if the user requested igncr.
+# But we know of no other shell where ac_cr would be empty at this
+# point, so we can use a bashism as a fallback.
+if test "x$ac_cr" = x; then
+ eval ac_cr=\$\'\\r\'
+fi
+ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`
+if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
+ ac_cs_awk_cr='\\r'
+else
+ ac_cs_awk_cr=$ac_cr
+fi
+
+echo 'BEGIN {' >"$ac_tmp/subs1.awk" &&
+_ACEOF
+
+
+{
+ echo "cat >conf$$subs.awk <<_ACEOF" &&
+ echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' &&
+ echo "_ACEOF"
+} >conf$$subs.sh ||
+ as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
+ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'`
+ac_delim='%!_!# '
+for ac_last_try in false false false false false :; do
+ . ./conf$$subs.sh ||
+ as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
+
+ ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X`
+ if test $ac_delim_n = $ac_delim_num; then
+ break
+ elif $ac_last_try; then
+ as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
+ else
+ ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+ fi
+done
+rm -f conf$$subs.sh
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK &&
+_ACEOF
+sed -n '
+h
+s/^/S["/; s/!.*/"]=/
+p
+g
+s/^[^!]*!//
+:repl
+t repl
+s/'"$ac_delim"'$//
+t delim
+:nl
+h
+s/\(.\{148\}\)..*/\1/
+t more1
+s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/
+p
+n
+b repl
+:more1
+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
+p
+g
+s/.\{148\}//
+t nl
+:delim
+h
+s/\(.\{148\}\)..*/\1/
+t more2
+s/["\\]/\\&/g; s/^/"/; s/$/"/
+p
+b
+:more2
+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
+p
+g
+s/.\{148\}//
+t delim
+' <conf$$subs.awk | sed '
+/^[^""]/{
+ N
+ s/\n//
+}
+' >>$CONFIG_STATUS || ac_write_fail=1
+rm -f conf$$subs.awk
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+_ACAWK
+cat >>"\$ac_tmp/subs1.awk" <<_ACAWK &&
+ for (key in S) S_is_set[key] = 1
+ FS = ""
+
+}
+{
+ line = $ 0
+ nfields = split(line, field, "@")
+ substed = 0
+ len = length(field[1])
+ for (i = 2; i < nfields; i++) {
+ key = field[i]
+ keylen = length(key)
+ if (S_is_set[key]) {
+ value = S[key]
+ line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3)
+ len += length(value) + length(field[++i])
+ substed = 1
+ } else
+ len += 1 + keylen
+ }
+
+ print line
+}
+
+_ACAWK
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then
+ sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
+else
+ cat
+fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \
+ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5
+_ACEOF
+
+# VPATH may cause trouble with some makes, so we remove sole $(srcdir),
+# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and
+# trailing colons and then remove the whole line if VPATH becomes empty
+# (actually we leave an empty line to preserve line numbers).
+if test "x$srcdir" = x.; then
+ ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{
+h
+s///
+s/^/:/
+s/[ ]*$/:/
+s/:\$(srcdir):/:/g
+s/:\${srcdir}:/:/g
+s/:@srcdir@:/:/g
+s/^:*//
+s/:*$//
+x
+s/\(=[ ]*\).*/\1/
+G
+s/\n//
+s/^[^=]*=[ ]*$//
+}'
+fi
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+fi # test -n "$CONFIG_FILES"
+
+# Set up the scripts for CONFIG_HEADERS section.
+# No need to generate them if there are no CONFIG_HEADERS.
+# This happens for instance with `./config.status Makefile'.
+if test -n "$CONFIG_HEADERS"; then
+cat >"$ac_tmp/defines.awk" <<\_ACAWK ||
+BEGIN {
+_ACEOF
+
+# Transform confdefs.h into an awk script `defines.awk', embedded as
+# here-document in config.status, that substitutes the proper values into
+# config.h.in to produce config.h.
+
+# Create a delimiter string that does not exist in confdefs.h, to ease
+# handling of long lines.
+ac_delim='%!_!# '
+for ac_last_try in false false :; do
+ ac_tt=`sed -n "/$ac_delim/p" confdefs.h`
+ if test -z "$ac_tt"; then
+ break
+ elif $ac_last_try; then
+ as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5
+ else
+ ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+ fi
+done
+
+# For the awk script, D is an array of macro values keyed by name,
+# likewise P contains macro parameters if any. Preserve backslash
+# newline sequences.
+
+ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]*
+sed -n '
+s/.\{148\}/&'"$ac_delim"'/g
+t rset
+:rset
+s/^[ ]*#[ ]*define[ ][ ]*/ /
+t def
+d
+:def
+s/\\$//
+t bsnl
+s/["\\]/\\&/g
+s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\
+D["\1"]=" \3"/p
+s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p
+d
+:bsnl
+s/["\\]/\\&/g
+s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\
+D["\1"]=" \3\\\\\\n"\\/p
+t cont
+s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p
+t cont
+d
+:cont
+n
+s/.\{148\}/&'"$ac_delim"'/g
+t clear
+:clear
+s/\\$//
+t bsnlc
+s/["\\]/\\&/g; s/^/"/; s/$/"/p
+d
+:bsnlc
+s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p
+b cont
+' <confdefs.h | sed '
+s/'"$ac_delim"'/"\\\
+"/g' >>$CONFIG_STATUS || ac_write_fail=1
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ for (key in D) D_is_set[key] = 1
+ FS = ""
+}
+/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ {
+ line = \$ 0
+ split(line, arg, " ")
+ if (arg[1] == "#") {
+ defundef = arg[2]
+ mac1 = arg[3]
+ } else {
+ defundef = substr(arg[1], 2)
+ mac1 = arg[2]
+ }
+ split(mac1, mac2, "(") #)
+ macro = mac2[1]
+ prefix = substr(line, 1, index(line, defundef) - 1)
+ if (D_is_set[macro]) {
+ # Preserve the white space surrounding the "#".
+ print prefix "define", macro P[macro] D[macro]
+ next
+ } else {
+ # Replace #undef with comments. This is necessary, for example,
+ # in the case of _POSIX_SOURCE, which is predefined and required
+ # on some systems where configure will not decide to define it.
+ if (defundef == "undef") {
+ print "/*", prefix defundef, macro, "*/"
+ next
+ }
+ }
+}
+{ print }
+_ACAWK
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+ as_fn_error $? "could not setup config headers machinery" "$LINENO" 5
+fi # test -n "$CONFIG_HEADERS"
+
+
+eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS"
+shift
+for ac_tag
+do
+ case $ac_tag in
+ :[FHLC]) ac_mode=$ac_tag; continue;;
+ esac
+ case $ac_mode$ac_tag in
+ :[FHL]*:*);;
+ :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;;
+ :[FH]-) ac_tag=-:-;;
+ :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
+ esac
+ ac_save_IFS=$IFS
+ IFS=:
+ set x $ac_tag
+ IFS=$ac_save_IFS
+ shift
+ ac_file=$1
+ shift
+
+ case $ac_mode in
+ :L) ac_source=$1;;
+ :[FH])
+ ac_file_inputs=
+ for ac_f
+ do
+ case $ac_f in
+ -) ac_f="$ac_tmp/stdin";;
+ *) # Look for the file first in the build tree, then in the source tree
+ # (if the path is not absolute). The absolute path cannot be DOS-style,
+ # because $ac_f cannot contain `:'.
+ test -f "$ac_f" ||
+ case $ac_f in
+ [\\/$]*) false;;
+ *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
+ esac ||
+ as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;;
+ esac
+ case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
+ as_fn_append ac_file_inputs " '$ac_f'"
+ done
+
+ # Let's still pretend it is `configure' which instantiates (i.e., don't
+ # use $as_me), people would be surprised to read:
+ # /* config.h. Generated by config.status. */
+ configure_input='Generated from '`
+ $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g'
+ `' by configure.'
+ if test x"$ac_file" != x-; then
+ configure_input="$ac_file. $configure_input"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5
+$as_echo "$as_me: creating $ac_file" >&6;}
+ fi
+ # Neutralize special characters interpreted by sed in replacement strings.
+ case $configure_input in #(
+ *\&* | *\|* | *\\* )
+ ac_sed_conf_input=`$as_echo "$configure_input" |
+ sed 's/[\\\\&|]/\\\\&/g'`;; #(
+ *) ac_sed_conf_input=$configure_input;;
+ esac
+
+ case $ac_tag in
+ *:-:* | *:-) cat >"$ac_tmp/stdin" \
+ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;;
+ esac
+ ;;
+ esac
+
+ ac_dir=`$as_dirname -- "$ac_file" ||
+$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$ac_file" : 'X\(//\)[^/]' \| \
+ X"$ac_file" : 'X\(//\)$' \| \
+ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$ac_file" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ as_dir="$ac_dir"; as_fn_mkdir_p
+ ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+ ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
+ # A ".." for each directory in $ac_dir_suffix.
+ ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
+ case $ac_top_builddir_sub in
+ "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+ *) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+ esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+ .) # We are building in place.
+ ac_srcdir=.
+ ac_top_srcdir=$ac_top_builddir_sub
+ ac_abs_top_srcdir=$ac_pwd ;;
+ [\\/]* | ?:[\\/]* ) # Absolute name.
+ ac_srcdir=$srcdir$ac_dir_suffix;
+ ac_top_srcdir=$srcdir
+ ac_abs_top_srcdir=$srcdir ;;
+ *) # Relative name.
+ ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+ ac_top_srcdir=$ac_top_build_prefix$srcdir
+ ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+
+ case $ac_mode in
+ :F)
+ #
+ # CONFIG_FILE
+ #
+
+ case $INSTALL in
+ [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
+ *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;;
+ esac
+ ac_MKDIR_P=$MKDIR_P
+ case $MKDIR_P in
+ [\\/$]* | ?:[\\/]* ) ;;
+ */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;;
+ esac
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# If the template does not know about datarootdir, expand it.
+# FIXME: This hack should be removed a few years after 2.60.
+ac_datarootdir_hack=; ac_datarootdir_seen=
+ac_sed_dataroot='
+/datarootdir/ {
+ p
+ q
+}
+/@datadir@/p
+/@docdir@/p
+/@infodir@/p
+/@localedir@/p
+/@mandir@/p'
+case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in
+*datarootdir*) ac_datarootdir_seen=yes;;
+*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
+$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ ac_datarootdir_hack='
+ s&@datadir@&$datadir&g
+ s&@docdir@&$docdir&g
+ s&@infodir@&$infodir&g
+ s&@localedir@&$localedir&g
+ s&@mandir@&$mandir&g
+ s&\\\${datarootdir}&$datarootdir&g' ;;
+esac
+_ACEOF
+
+# Neutralize VPATH when `$srcdir' = `.'.
+# Shell code in configure.ac might set extrasub.
+# FIXME: do we really want to maintain this feature?
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ac_sed_extra="$ac_vpsub
+$extrasub
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+:t
+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
+s|@configure_input@|$ac_sed_conf_input|;t t
+s&@top_builddir@&$ac_top_builddir_sub&;t t
+s&@top_build_prefix@&$ac_top_build_prefix&;t t
+s&@srcdir@&$ac_srcdir&;t t
+s&@abs_srcdir@&$ac_abs_srcdir&;t t
+s&@top_srcdir@&$ac_top_srcdir&;t t
+s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t
+s&@builddir@&$ac_builddir&;t t
+s&@abs_builddir@&$ac_abs_builddir&;t t
+s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
+s&@INSTALL@&$ac_INSTALL&;t t
+s&@MKDIR_P@&$ac_MKDIR_P&;t t
+$ac_datarootdir_hack
+"
+eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \
+ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+
+test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
+ { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } &&
+ { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \
+ "$ac_tmp/out"`; test -z "$ac_out"; } &&
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined. Please make sure it is defined" >&5
+$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined. Please make sure it is defined" >&2;}
+
+ rm -f "$ac_tmp/stdin"
+ case $ac_file in
+ -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";;
+ *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";;
+ esac \
+ || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+ ;;
+ :H)
+ #
+ # CONFIG_HEADER
+ #
+ if test x"$ac_file" != x-; then
+ {
+ $as_echo "/* $configure_input */" \
+ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs"
+ } >"$ac_tmp/config.h" \
+ || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+ if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5
+$as_echo "$as_me: $ac_file is unchanged" >&6;}
+ else
+ rm -f "$ac_file"
+ mv "$ac_tmp/config.h" "$ac_file" \
+ || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+ fi
+ else
+ $as_echo "/* $configure_input */" \
+ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \
+ || as_fn_error $? "could not create -" "$LINENO" 5
+ fi
+# Compute "$ac_file"'s index in $config_headers.
+_am_arg="$ac_file"
+_am_stamp_count=1
+for _am_header in $config_headers :; do
+ case $_am_header in
+ $_am_arg | $_am_arg:* )
+ break ;;
+ * )
+ _am_stamp_count=`expr $_am_stamp_count + 1` ;;
+ esac
+done
+echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" ||
+$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$_am_arg" : 'X\(//\)[^/]' \| \
+ X"$_am_arg" : 'X\(//\)$' \| \
+ X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$_am_arg" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`/stamp-h$_am_stamp_count
+ ;;
+
+ :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5
+$as_echo "$as_me: executing $ac_file commands" >&6;}
+ ;;
+ esac
+
+
+ case $ac_file$ac_mode in
+ "depfiles":C) test x"$AMDEP_TRUE" != x"" || {
+ # Older Autoconf quotes --file arguments for eval, but not when files
+ # are listed without --file. Let's play safe and only enable the eval
+ # if we detect the quoting.
+ case $CONFIG_FILES in
+ *\'*) eval set x "$CONFIG_FILES" ;;
+ *) set x $CONFIG_FILES ;;
+ esac
+ shift
+ for mf
+ do
+ # Strip MF so we end up with the name of the file.
+ mf=`echo "$mf" | sed -e 's/:.*$//'`
+ # Check whether this is an Automake generated Makefile or not.
+ # We used to match only the files named 'Makefile.in', but
+ # some people rename them; so instead we look at the file content.
+ # Grep'ing the first line is not enough: some people post-process
+ # each Makefile.in and add a new line on top of each file to say so.
+ # Grep'ing the whole file is not good either: AIX grep has a line
+ # limit of 2048, but all sed's we know have understand at least 4000.
+ if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
+ dirpart=`$as_dirname -- "$mf" ||
+$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$mf" : 'X\(//\)[^/]' \| \
+ X"$mf" : 'X\(//\)$' \| \
+ X"$mf" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$mf" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ else
+ continue
+ fi
+ # Extract the definition of DEPDIR, am__include, and am__quote
+ # from the Makefile without running 'make'.
+ DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
+ test -z "$DEPDIR" && continue
+ am__include=`sed -n 's/^am__include = //p' < "$mf"`
+ test -z "$am__include" && continue
+ am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
+ # Find all dependency output files, they are included files with
+ # $(DEPDIR) in their names. We invoke sed twice because it is the
+ # simplest approach to changing $(DEPDIR) to its actual value in the
+ # expansion.
+ for file in `sed -n "
+ s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
+ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
+ # Make sure the directory exists.
+ test -f "$dirpart/$file" && continue
+ fdir=`$as_dirname -- "$file" ||
+$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$file" : 'X\(//\)[^/]' \| \
+ X"$file" : 'X\(//\)$' \| \
+ X"$file" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$file" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ as_dir=$dirpart/$fdir; as_fn_mkdir_p
+ # echo "creating $dirpart/$file"
+ echo '# dummy' > "$dirpart/$file"
+ done
+ done
+}
+ ;;
+
+ esac
+done # for ac_tag
+
+
+as_fn_exit 0
+_ACEOF
+ac_clean_files=$ac_clean_files_save
+
+test $ac_write_fail = 0 ||
+ as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5
+
+
+# configure is writing to config.log, and then calls config.status.
+# config.status does its own redirection, appending to config.log.
+# Unfortunately, on DOS this fails, as config.log is still kept open
+# by configure, so config.status won't be able to write to it; its
+# output is simply discarded. So we exec the FD to /dev/null,
+# effectively closing config.log, so it can be properly (re)opened and
+# appended to by config.status. When coming back to configure, we
+# need to make the FD available again.
+if test "$no_create" != yes; then
+ ac_cs_success=:
+ ac_config_status_args=
+ test "$silent" = yes &&
+ ac_config_status_args="$ac_config_status_args --quiet"
+ exec 5>/dev/null
+ $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
+ exec 5>>config.log
+ # Use ||, not &&, to avoid exiting from the if with $? = 1, which
+ # would make configure fail if this is the last instruction.
+ $ac_cs_success || as_fn_exit 1
+fi
+if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
+$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
+fi
+
diff --git a/Build/source/libs/gmp/native/configure.ac b/Build/source/libs/gmp/native/configure.ac
new file mode 100644
index 00000000000..aa0257c3d0d
--- /dev/null
+++ b/Build/source/libs/gmp/native/configure.ac
@@ -0,0 +1,30 @@
+dnl Process this file with autoconf to produce a configure script.
+dnl
+dnl Copyright (C) 2014 Peter Breitenlohner <tex-live@tug.org>
+dnl
+dnl This file is free software; the copyright holder
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+dnl
+m4_include([../version.ac])[] dnl define gmp_version
+AC_INIT([gmp native], gmp_version, [tex-k@tug.org])
+AC_PREREQ([2.63])
+AC_CONFIG_SRCDIR([../gmp-]gmp_version[/gmp-impl.h])
+AC_CONFIG_AUX_DIR([../../../build-aux])
+AC_CONFIG_MACRO_DIR([../../../m4])
+
+KPSE_BASIC([gmp native])
+
+AC_PROG_CC
+AC_PROG_LN_S
+
+KPSE_SEARCH_LIBS([MATH_LIB], [pow], [m])
+
+AC_SUBST([GMP_TREE], [../gmp-]gmp_version)
+
+dnl Not used but avoids putting useless -D's on the command line.
+AC_CONFIG_HEADERS([config.h])
+
+AC_CONFIG_FILES([Makefile])
+
+AC_OUTPUT
diff --git a/Build/source/libs/gmp/version.ac b/Build/source/libs/gmp/version.ac
new file mode 100644
index 00000000000..896595cb531
--- /dev/null
+++ b/Build/source/libs/gmp/version.ac
@@ -0,0 +1,11 @@
+dnl
+dnl Copyright (C) 2014 Taco Hoekwater <taco@metatex.org>
+dnl
+dnl This file is free software; the copyright holder
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+dnl
+dnl --------------------------------------------------------
+dnl
+dnl m4-include this file to define the current gmp version
+m4_define([gmp_version], [6.0.0])