2020-11-13 Marco Bodrato <bodrato@mail.dm.unipi.it>

	* Version 6.2.1 released.

	* gmp-h.in (__GNU_MP_VERSION_PATCHLEVEL): Bump version info.
	* Makefile.am (LIBGMP_LT_*, LIBGMPXX_LT_*): Bump revision info.

2020-11-10 Marco Bodrato <bodrato@mail.dm.unipi.it>

	* configure.ac (fat_path): Add bd1, goldmont,silvermont for CPUVEC.
	* mpn/x86_64/fat/fat.c: Add more CPUs.
	* mpn/x86/fat/fat.c: Add more CPUs.

2020-11-01 Marco Bodrato <bodrato@mail.dm.unipi.it>

	* configure.ac: X86_{,64_}PATTERN: GMP_ASM_COFF_TYPE for all ABIs;
	* mpn/x86_64/x86_64-defs.m4 (COFF_TYPE): Copy from mpn/x86/x86-defs.m4
	as suggested by Jeremy Drake.

	* tests/misc/t-locale.c (nl_langinfo): No redefine on __TERMUX__,
	spotted by Sanselme and Glisse.
	* configure.ac: Consider *-*-msys as *-*-mingw* (except on arm* |
	aarch64*), as suggested by Ralph Peterson.
	* Makefile.am (EXTRA_DIST): Add mini-gmp/ChangeLog.

2020-10-30 Marco Bodrato <bodrato@mail.dm.unipi.it>

	* tests/mpf/t-get_d_2exp.c: Test also the case zero.
	* tests/mpz/t-get_d.c: Likewise.
	* tests/mpf/t-trunc.c: Use mpf_size.

	* tests/mpf/t-conv.c: Some more tests on zero.

2020-10-25 Marco Bodrato <bodrato@mail.dm.unipi.it>

	* configfsf.guess: Updated to version 2020-10-22, from gnulib.

2020-10-17 Marco Bodrato <bodrato@mail.dm.unipi.it>

	* tests/devel/Makefile.am: Remove redundancies.

	* tests/mpz/io.c: Test out-of-range bases for mpz_out_str.

2020-10-15  Torbjörn Granlund  <tg@gmplib.org>

	* configure.ac: Recognise zen3.
	* config.guess: Recognise zen3.

2020-10-14 Marco Bodrato <bodrato@mail.dm.unipi.it>

	* doc/gmp.texi (Number sequences): Remove redundancy. (spotted: TonyMcC)

	* configfsf.sub: Updated to version 2020-10-13, from gnulib.
	* configfsf.guess: Updated to version 2020-09-19, from gnulib.

2020-10-06  Niels Möller  <nisse@lysator.liu.se>

	* Makefile.am: Better support for make check-mini-gmp on wine or cygwin.

2020-09-22  Torbjörn Granlund  <tg@gmplib.org>

	* tests/mpz/t-mul.c: Print GMP_CHECK_FFT.

	* longlong.h (x86 umul_ppmm): Fix typo.

2020-09-21  Torbjörn Granlund  <tg@gmplib.org>

	* mpz/n_pow_ui.c: Detect and report overflow.

2020-07-04  Torbjörn Granlund  <tg@gmplib.org>

	* mpn/arm64/bdiv_q_1.asm: Use LEA_HI/LEA_LO
	* mpn/arm64/invert_limb.asm: Likewise.

	* mpn/arm64/arm64-defs.m4: New file.
	* mpn/arm64/darwin.m4: New file.
	* configure.ac: Use arm64/arm64-defs.m4 and arm64/darwin.m4.

2020-06-20  Torbjörn Granlund  <tg@gmplib.org>

	* longlong.h (add_sssaaaa arm32/arm64): Generalise allowed operands
	when using adds for sub and subs for add, while disallowing 0.
	(sub_ddmmss ppc64): Disallow 0 when using addic.  Also disallow
	constants for register-only middle addic operand.
	(C add_sssaaaa and sub_ddmmss): Use more temps to make operation more
	well-defined.

2020-06-18  Torbjörn Granlund  <tg@gmplib.org>

	* tests/devel/gen-test-longlong_h.c: New file.
	* tests/devel/Makefile.am: Compile and use gen-test-longlong_h.c.

2020-06-10  Torbjörn Granlund  <tg@gmplib.org>

	* configure.ac: Recognise armcortexa55.

2020-05-25  Torbjörn Granlund  <tg@gmplib.org>

	* tests/cxx/t-assign.cc: Use reference parameter for 'catch'.
	* tests/cxx/t-constr.cc: Likewise.
	* tests/cxx/t-ops2z.cc: Likewise.
	* tests/cxx/t-rand.cc: Likewise.
	* tests/cxx/t-do-exceptions-work-at-all-with-this-compiler.cc: Likewise.

	* tune/speed.c: Undo 2020-05-24 _POSIX_C_SOURCE change, it breaks on
	many broken systems.
	* tune/freq.c: Likewise.
	* tune/time.c: Likewise.
	* tune/tuneup.c: Likewise.

	* tests/devel/try.c: Revert 2020-05-24 changes.

2020-05-21  Torbjörn Granlund  <tg@gmplib.org>

	* tune/freq.c (_POSIX_C_SOURCE): Define.

	* tune/tuneup.c (print_define_with_speedup): Fall back from snprintf to
	sprintf for C90.
	(_POSIX_C_SOURCE): Define.
	(max_opsize): Set by #define instead of const size_t to please C90.
	(n_measurements): Likewise.
	(speed_mpn_pre_set_str): Adhere to C90 declaration rules.

	* tune/tune-gcd-p.c: Back out 2020-01-10 change to comply to C90.

	* tune/time.c (speed_endtime): Cast printf args to right type.
	(_POSIX_C_SOURCE): Define.

	* tune/speed.h (CACHE_LINE_SIZE): Do #undef before defining.
	(SPEED_ROUTINE_MPN_GCD_1): Provide dummy first argument for standard
	compliance.
	(SPEED_ROUTINE_MPN_HGCD2): Adhere to C90 declaration rules.

	* tune/speed.c (main): Cast printf args to right type.
	(_POSIX_C_SOURCE): Define.

	* tests/mpz/reuse.c: Avoid using non-standard function fileno().
	* tests/spinner.c: Likewise.

	* tests/mpz/convert.c (str_casecmp): New function.
	(main): Use it instead of non-standard strcasecmp.

	* tests/misc.c (tests_start): Fall back from snprintf to sprintf for
	C90.

	* tests/devel/try.c: Avoid getpagesize and use POSIX sysconf instead.
	(_POSIX_C_SOURCE): Define.

	* mpn/generic/mod_1_1.c: Don't use C++ comments.

	* mpn/generic/get_d.c: Add clarifying parens.

2020-05-18  Torbjörn Granlund  <tg@gmplib.org>

	* mpn/generic/toom_interpolate_12pts.c (DO_mpn_addlsh_n): Define only
	when needed.
	* mpn/generic/toom_interpolate_16pts.c: Likewise.

2020-05-17 Marco Bodrato <bodrato@mail.dm.unipi.it>

	* mpz/cmp.c: Avoid overflow on int even for huge sizes.
	* mpq/cmp.c: Likewise.

	* mpn/generic/mul_fft.c (mpn_fft_mul_modF_K):
	Fully handle carry propagation in basecase multiplication.

2020-05-16  Torbjörn Granlund  <tg@gmplib.org>

	* mpn/generic/hgcd2.c (tabp): Combine several undefined tabp
	variable definitions with a macro.

	* mpn/generic/gcd_22.c: Avoid C99 constructs.

2020-05-12  Torbjörn Granlund  <tg@gmplib.org>

	* mpn/generic/compute_powtab.c: Avoid C99 constructs.
	* mpn/generic/get_str.c: Likewise.
	* mpn/generic/set_str.c: Likewise.

	* gmp-impl.h (memset): Move ASSERT to before decls.
	* tests/refmpn.c: Likewise.

	* mpn/generic/hgcd2.c (tabp): Combine several undefined tabp variable
	definitions with a macro.

	* mpn/generic/strongfibo.c: Avoid defining helper function when unused.

	* mpn/generic/dcpi1_bdiv_q.c (mpn_dcpi1_bdiv_q_n_itch): Disable unused
	static function.

	* mpz/mul.c: Add some {} to suppress warning.

	* tests/mpn/t-gcd_11.c: Exit main() properly.
	* tests/mpn/t-gcd_22.c: Likewise.
	* tests/mpn/t-gcdext_1.c: Likewise.

2020-04-28  Torbjörn Granlund  <tg@gmplib.org>

	* tests/mpz/reuse.c (realloc_if_reducing): New function.
	(INVOKE_RRS, etc): Use realloc_if_reducing.

2020-01-17  Torbjörn Granlund  <tg@gmplib.org>

	* Version 6.2.0 released.

	* gmp-h.in (__GNU_MP__): Bump.
	(__GNU_MP_VERSION,__GNU_MP_VERSION_MINOR,__GNU_MP_VERSION_PATCHLEVEL):
	Bump version info.
	* Makefile.am (LIBGMP_LT_*, LIBGMPXX_LT_*, LIBMP_LT_*):
	Bump version info.

2020-01-15  Torbjörn Granlund  <tg@gmplib.org>

	* mpn/x86_64/bt1/gcd_11.asm: Add missing FUNC_EXIT.

2020-01-10  Torbjörn Granlund  <tg@gmplib.org>

	* longlong.h (powerpc): Add clobbers, make formatting cleanups.

	* configure.ac (HAVE_NATIVE): Add mpn_sbpi1_bdiv_r.

	* tune/tune-gcd-p.c (main): Use %zu for size_t printing.

	* configfsf.guess: Update from upstream.

	* mpn/x86/pentium4/sse2/popcount.asm: For simplicity and correctness
	use LEAL directly.

2020-01-03  Niels Möller  <nisse@lysator.liu.se>

	* configure.ac: Delete suggestion to use TESTS_ENVIRONMENT to run
	wine. It worked only with older versions of automake.

2019-12-23  Torbjörn Granlund  <tg@gmplib.org>

	* mpf/mul.c: Rewrite to invoke mpn_sqr when appropriate.

2019-12-08 Marco Bodrato <bodrato@mail.dm.unipi.it>

	* mpz/powm.c: Full normalisation when e=1 & b<0.
	* tests/mpz/t-powm.c: More tests for the e=1 case.

2019-12-02  Torbjörn Granlund  <tg@gmplib.org>

	* mpn/generic/gcd_11.c: Remove check for NATIVE_ implementation.

2019-11-24  Niels Möller  <nisse@lysator.liu.se>

	* mpn/generic/gcdext_1.c [USE_ZEROTAB]: Delete code variant for
	USE_ZEROTAB != 0. Was used in the currently disabled binary
	gcdext.

2019-11-20  Torbjörn Granlund  <tg@gmplib.org>

	* mpn/generic/powm.c (MPN_REDC_1): Prefer mpn_sbpi1_bdiv_r when it is
	provided.
	* mpn/generic/sec_powm.c (MPN_REDC_1_SEC): Likewise.

2019-11-17  Torbjörn Granlund  <tg@gmplib.org>

	* config.guess: Recognise zen2.
	* configure.ac: Likewise.

	* mpn/x86_64/bt1/aorsmul_1.asm: Rewrite.
	* mpn/x86_64/bt1/mul_1.asm: Rewrite.

	* mpn/arm/v6t2/gcd_11.asm: Increase alignment; update x/l table.

2019-11-16 Seth Troisi <sethtroisi@google.com>

	* tune/common.c (speed_mpn_perfect_power_p): New function.
	(speed_mpn_perfect_power_p): New function.
	* tune/speed.h: Declare both.
	* tune/speed.c (routine): Add mpn_perfect_{power,square}_p.

	* tune/common.c (speed_mpz_nextprime): New function.
	* tune/speed.h: Declare it.
	* tune/speed.c (routine): Add mpz_nextprime.

2019-11-09 Marco Bodrato <bodrato@mail.dm.unipi.it>

	* tune/speed.c (routine_t): Add R flag to mpz_powm
	* tune/speed.h (SPEED_ROUTINE_MPZ_POWM): Use R flag as the base.

2019-10-02  Torbjörn Granlund  <tg@gmplib.org>

	* configure.ac: Make more path distinctions for the benefit of
	gmp-mparam.h.

2019-10-01  Torbjörn Granlund  <tg@gmplib.org>

	* configure.ac (arm64): Let cortex-a7x look in a57 folder.

2019-10-01  Niels Möller  <nisse@lysator.liu.se>

	* mpn/generic/gcdext_1.c (mpn_gcdext_1) [GCDEXT_1_USE_BINARY]: Fix
	canonicalization condition.

2019-09-30  Niels Möller  <nisse@lysator.liu.se>

	* tests/mpn/t-gcdext_1.c: New test.

2019-09-23  Torbjörn Granlund  <tg@gmplib.org>

	* mpn/generic/hgcd2.c: Mark added div1 variants as static.

	* tune/tuneup.c, tune/speed.c, tune/speed.h, tune/common.c,
	tune/Makefile.am: Add measuring of mpn_hgcd2 method 4 and 5.
	* tune/hgcd2-4.c, tune/hgcd2-5.c: New files.

2019-09-23  Niels Möller  <nisse@lysator.liu.se>

	* gmp-impl.h (hgcd2_func_t) [TUNE_PROGRAM_BUILD]: New typedef.
	(hgcd2_func) [TUNE_PROGRAM_BUILD]: New function pointer.

	* tune/hgcd2.c (mpn_hgcd2): New file, with a redefined function to
	invoke an implementation via the hgcd2_func function pointer.
	Initially points to the default implementation in
	mpn/generic/hgcd2.c.
	* tune/Makefile.am (tuneup_SOURCES): Add hgcd2.c.

	* tune/tuneup.c (one_method): Return index of selected function.
	(tune_hgcd2): Set hgcd2_func to point to selected function. So
	that the later tuning of mpn_hgcd and mpn_gcd uses the right
	implementation of hgcd2.

2019-09-23  Torbjörn Granlund  <tg@gmplib.org>

	* mpn/generic/hgcd2.c: Improve method 4 and 5 by using the division
	free methods optimistically, detecting errors.  Tweak table values.

2019-09-22  Torbjörn Granlund  <tg@gmplib.org>

	* mpn/generic/hgcd2.c: Add a 4th and 5th div1 method.

2019-09-18  Torbjörn Granlund  <tg@gmplib.org>

	* mpn/generic/hgcd2.c (div1, div2): Rearrange things to allow for asm.
	(div2): Avoid out-of-specs shift.
	(div2): Use same variable naming in all variants.

2019-09-16  Niels Möller  <nisse@lysator.liu.se>

	* mpn/generic/hgcd2.c (HGCD2_DIV2_METHOD): New define.
	(div2): Replaced, since the old implementation had lots of poorly
	predicted and expensive branches. Two new implementaions, selected
	by HGCD2_DIV2_METHOD.
	(div2) [HGCD2_DIV2_METHOD == 1]: Calls div1 on the high limbs,
	with unlikely case handling large quotients.
	(div2) [HGCD2_DIV2_METHOD == 2]: The previously #if:ed out
	version. A bitwise division, relying on fast count_leading_zeros,
	and with fewer branches than the previous code.

2019-09-15  Torbjörn Granlund  <tg@gmplib.org>

	* acinclude.m4 (GMP_ASM_X86_ADX): Remove unused.

	* configure.ac (x86): Amend last change.

2019-09-14  Niels Möller  <nisse@lysator.liu.se>

	* mpn/generic/hgcd2.c (HGCD2_DIV1_METHOD): Rename, and change
	default to 3. Updated all usage.
	(HGCD2_METHOD): ... the old name, deleted.

2019-09-14  Torbjörn Granlund  <tg@gmplib.org>

	* configure.ac: Remove obsolete path-triggered invocation of
	GMP_ASM_X86_ADX and GMP_ASM_X86_MULX.

	* acinclude.m4 (GMP_ASM_X86_MULX): Set X86_ASM_MULX to config.h.
	* configure.ac (x86): Set x86_have_mulx for relevant CPUs.
	Use if to conditionally invoke GMP_ASM_X86_MULX.
	* longlong.h (x86 umul_ppmm): Test also X86_ASM_MULX for when to use
	mulx variant.

2019-09-13  Niels Möller  <nisse@lysator.liu.se>

	* tune/tuneup.c (one_method): New helper function, to measure
	several functions for a fix size.
	(tune_hgcd2, tune_div_qr_1, tune_mod_1, tune_jacobi_base): Use it.

2019-09-13  Torbjörn Granlund  <tg@gmplib.org>

	* configure.ac (HAVE_HOST_CPU_1): Add many x86_64 CPU types.
	* longlong.h (x86 umul_ppmm): Fix criterion for when to use mulx.
	(count_leading_zeros): Use lzcnt for appropriate CPUs.
	(count_trailing_zeros): Use tzcnt for appropriate CPUs.

	* mpn/generic/hgcd2.c (HGCD2_METHOD=2 div1): Rewrite.

2019-09-09  Torbjörn Granlund  <tg@gmplib.org>

	* mpn/generic/mul.c: Call mpn_mul_basecase early when in range.  Never
	call mpn_sqr.

	* mpn/generic/gcd.c: Rewrite tail of function, for n <= 2.

2019-09-08  Torbjörn Granlund  <tg@gmplib.org>

	* configure.ac (arm): Select arch armv7ve for a7, a12, a15, and a17,
	this enables the use of the udiv instruction.

	* mpn/generic/hgcd2.c (disabled div2): Micro-optimise.

2019-09-07  Torbjörn Granlund  <tg@gmplib.org>

	* mpn/generic/hgcd2.c (HGCD2_METHOD=3 div1): Micro-optimise.

2019-09-07  Vincent Lefevre <vincent@vinc17.net>

	* acinclude.m4 (GMP_C_DOUBLE_FORMAT): Append EXEEXT for executable.

2019-09-05  Torbjörn Granlund  <tg@gmplib.org>

	* mpn/arm64/gcd_22.asm: Rewrite to make better use of Arm conditional
	execution.
	* mpn/arm32/gcd_22.asm: Likewise.

2019-09-05  Niels Möller  <nisse@lysator.liu.se>

	* mpn/generic/hgcd2.c (div1): Return both r and q as a
	mp_double_limb_t, replacing the DIV1 macro.
	(div1) [HGCD2_METHOD == 3]: New implementation handling q <= 7
	specially and without branches. Based on Torbjörn's mail to the
	gmp-devel list.
	* tune/speed.c, tune/speed.h, tune/common.c, tune/Makefile.am: Add
	corresponding speed support.
	* tune/hgcd2-3.c: New file.
	* tune/tuneup.c (print_define_with_speedup): New function, to
	output a comment with speedup compared to next-best method.
	(tune_hgcd2): Update tuning.

2019-09-04  Niels Möller  <nisse@lysator.liu.se>

	* mpn/generic/hgcd2.c (HGCD2_METHOD): New parameter.
	(DIV1): New macro, using either the div1 function or plain
	division, depending on the value of HGCD2_METHOD.
	(mpn_hgcd2): Use DIV1.
	* tune/speed.c, tune/speed.h, tune/common.c, tune/Makefile.am: Add
	measuring of mpn_hgcd2 methods.
	* tune/hgcd2-1.c, tune/hgcd2-2.c: New files.
	* tune/tuneup.c: Tune HGCD2_METHOD.

	* tune/speed.h (SPEED_ROUTINE_MPN_HGCD2): New macro.
	* tune/common.c (speed_mpn_hgcd2): New function.
	* tune/speed.c (routine): Add mpn_hgcd2.

2019-09-04  Torbjörn Granlund  <tg@gmplib.org>

	* mpn/arm/v6t2/gcd_22.asm: New file.
	* mpn/arm64/gcd_22.asm: New file.
	* mpn/ia64/gcd_11.asm: New file.

2019-09-01  Torbjörn Granlund  <tg@gmplib.org>

	* mpn/x86_64/bt1/gcd_11.asm: Replace grabber with bt1 optimised code.

2019-08-30  Torbjörn Granlund  <tg@gmplib.org>

	* mpn/x86_64/bd4/gcd_22.asm: New grabber file.

	* mpn/x86_64/zen/gcd_22.asm: Use coreihwl instead of bd2 gcd_22.

	* mpn/x86_64/bd2/gcd_22.asm: Fix typo in FUNC_ENTRY (currently unused).
	Avoid a register copy before return.
	* mpn/x86_64/core2/gcd_22.asm: Likewise.
	* mpn/x86_64/k10/gcd_22.asm: Likewise.
	* mpn/x86_64/gcd_22.asm: Likewise.

	* mpn/x86_64/coreihwl/gcd_22.asm: Optimise, now runs well on more CPUs.

	* mpn/x86_64/gcd_11.asm: Remove PROTECT from symbols as they are
	actually local.
	* mpn/x86_64/gcd_22.asm: Likewise.

2019-08-25  Torbjörn Granlund  <tg@gmplib.org>

	* mpn/x86_64/bd2/gcd_22.asm: Repeat tzcnt for exceptional lowz case.
	Remove dead code.

	* mpn/powerpc64/mode64/p7/gcd_22.asm: Make logic for determining ABI
	wrt struct return more robust.
	* mpn/powerpc64/mode64/p9/gcd_22.asm: Likewise.

2019-08-24  Torbjörn Granlund  <tg@gmplib.org>

	* mpn/x86_64/bt1/gcd_11.asm: New grabber.
	* mpn/x86_64/bt1/gcd_22.asm: New grabber.
	* mpn/x86_64/bt2/gcd_22.asm: New grabber.

	* mpn/x86_64/atom/gcd_22.asm: Remove stale grabber file.
	* mpn/x86_64/zen/gcd_22.asm: Grab bd2 instead of hwl code.
	* mpn/x86_64/bd2/gcd_22.asm: New file.
	* mpn/x86_64/k8/gcd_22.asm: Remove, rely on top-level code instead.
	* mpn/x86_64/bt1/gcd_22.asm: Remove.
	* x86_64/gcd_22.asm: New file, improved version of removed bt1 code.

2019-08-22  Torbjörn Granlund  <tg@gmplib.org>

	* mpn/x86_64/coreihwl/gcd_11.asm: Remove as it was never beneficial.

	* mpn/x86_64/bd2/gcd_11.asm: Make sure rdx is zero on return to benefit
	gcd_22's private calls. Make gcd_11 files more similar in register use.
	* mpn/x86_64/bd4/gcd_11.asm: Likewise.
	* mpn/x86_64/core2/gcd_11.asm: Likewise.
	* mpn/x86_64/gcd_11.asm:: Likewise.

2019-08-22  Niels Möller  <nisse@lysator.liu.se>

	From Hugh McMaster:
	* gmp.pc.in, gmpxx.pc.in: New files.
	* configure.ac: New output files gmp.pc and gmpxx.pc.
	* Makefile.am (pkgconfigdir, pkgconfig_DATA): New automake
	settings, to install gmp.pc and optionally gmpxx.pc for use with
	pkg-config.

2019-08-21  Torbjörn Granlund  <tg@gmplib.org>

	* mpn/x86_64/core2/gcd_22.asm: New file.
	* mpn/x86_64/k8/gcd_22.asm: New file.
	* mpn/x86_64/k10/gcd_22.asm: New file.
	* mpn/x86_64/coreihwl/gcd_22.asm: New file.
	* mpn/x86_64/bt1/gcd_22.asm: New file.
	* mpn/x86_64/bd4/gcd_22.asm: New grabber.
	* mpn/x86_64/zen/gcd_22.asm: New grabber.
	* mpn/x86_64/atom/gcd_22.asm: New grabber.

2019-08-19  Torbjörn Granlund  <tg@gmplib.org>

	* configure.ac: Check for ELFv1 ABI on PowerPC.

2019-08-18  Torbjörn Granlund  <tg@gmplib.org>

	* longlong.h (arm32 sub_ddmmss): Define separately for thumb and
	non-thumb as rsc instruction is missing for thumb.

	* mpn/powerpc64/mode64/p7/gcd_22.asm: New file.
	* mpn/powerpc64/mode64/p9/gcd_22.asm: New file.

2019-08-17  Torbjörn Granlund  <tg@gmplib.org>

	* demos/expr/t-expr.c: #include gmp-impl.h as it includes tests.h.

	* mpn/asm-defs.m4: Add gcd_22.

	* tests/refmpn.c (refmpn_gcd_22): New function.
	* tests/tests.h: Declare it.

	* tests/t-constants.c: #include gmp-impl.h.
	* tests/mpf/t-get_d.c: Likewise.

2019-08-17  Niels Möller  <nisse@lysator.liu.se>

	* mpn/generic/gcd_22.c (mpn_gcd_22): New implementation with less
	branches.

2019-08-16 Marco Bodrato <bodrato@mail.dm.unipi.it>

	* mpn/generic/brootinv.c: Shorten computations, using even exponent.
	* mpn/generic/powlo.c: Avoid copies with a flipflop.

2019-08-16  Niels Möller  <nisse@lysator.liu.se>

	Speed support for gcd_22. Calls mpn_gcd_22(al, al, bl, bl), so
	that B+1 is a common factor.
	* tune/speed.h (SPEED_ROUTINE_MPN_GCD_22): New macro.
	* tune/speed.c (routine): Add mpn_gcd_22.
	* tune/common.c (speed_mpn_gcd_22): New function.

	* mpn/generic/gcd.c (gcd_2): Moved to gcd_22.c below.
	(mpn_gcd): Adapt for calling gcd_22.
	* mpn/generic/gcd_22.c (mpn_gcd_22): New file and function.
	* gmp-impl.h (mp_double_limb_t): New (typedef) struct.
	* configure.ac (gmp_mpn_functions): Added gcd_22.

	* tests/mpn/t-gcd_22.c: New test.
	* tests/mpn/Makefile.am (check_PROGRAMS): Add t-gcd_22.
	* tests/refmpz.c (refmpz_gcd): New function (plain binary gcd).

2019-08-15  Torbjörn Granlund  <tg@gmplib.org>

	* mpn/x86_64/zen/gcd_11.asm: Use bd2 instead of bd4 code.

2019-08-13  Torbjörn Granlund  <tg@gmplib.org>

	* mpn/x86_64: Add more gcd_11 variants of of x86_64 gcd_11.asm and
	tweak existing ones.

2019-08-13 Marco Bodrato <bodrato@mail.dm.unipi.it>

	From Seth Troisi:
	* doc/gmp.texi: Update mpz_millerrabin documentation.

	* mpn/x86_64/bd2/gcd_11.asm: Micro-optimisation.
	* doc/gmp.texi: Further update in mpz_millerrabin.
	* tests/misc.c: Silence a warning.
	* tests/mpz/t-pprime_p.c (const primes): One more prime in the list.
	* mpz/millerrabin.c: Return 2 for surely prime numbers (BPSW checked).

2019-08-08  Torbjörn Granlund  <tg@gmplib.org>

	* mpn/x86/gcd_11.asm: New file.

	* config.sub: Make arm cpu types match what config.guess returns.

2019-08-08  Niels Möller  <nisse@lysator.liu.se>

	* tests/refmpn.c (refmpn_gcd_11): New function, based on refmpn_gcd_1.
	(refmpn_gcd_1): Use it.
	* tests/mpn/t-gcd_11.c: New file, test mpn_gcd_11.
	* tests/mpn/Makefile.am (check_PROGRAMS): Add t-gcd_11.

2019-08-07  Torbjörn Granlund  <tg@gmplib.org>

	* mpn/alpha/ev67/gcd_11.asm: New file, mostly extracted from gcd_1.asm.
	* mpn/arm/v5/gcd_11.asm: Likewise.
	* mpn/arm/v6t2/gcd_11.asm: Likewise.
	* mpn/arm64/gcd_11.asm: Likewise.
	* mpn/powerpc64/mode64/gcd_11.asm: Likewise.
	* mpn/powerpc64/mode64/p7/gcd_11.asm: Likewise.
	* mpn/powerpc64/mode64/p9/gcd_11.asm: Likewise.
	* mpn/sparc64/gcd_11.asm: Likewise.
	* mpn/x86/k7/gcd_11.asm: Likewise.
	* mpn/x86/p6/gcd_11.asm: Likewise.
	* mpn/x86_64/bd2/gcd_11.asm: Likewise.
	* mpn/x86_64/core2/gcd_11.asm: Likewise.
	* mpn/x86_64/gcd_11.asm: Likewise.
	* mpn/asm-defs.m4: Add gcd_11.

2019-08-06  Niels Möller  <nisse@lysator.liu.se>

	* tune/common.c (speed_mpn_gcd_11): New function.
	* tune/speed.h (speed_mpn_gcd_11): Declare it.
	(SPEED_ROUTINE_MPN_GCD_11): New macro.
	* tune/speed.c (routine): Add mpn_gcd_11.

	* configure.ac (gmp_mpn_functions): Added gcd_11. Also add
	HAVE_NATIVE_mpn_gcd_11.
	* mpn/generic/gcd_11.c (mpn_gcd_11): New file and function,
	extracted from mpn_gcd_1.
	* gmp-h.in (mpn_gcd_11): Declare it.
	* mpn/generic/gcd_1.c (mpn_gcd_1): Adapted to call mpn_gcd_11.

2019-08-04  Torbjörn Granlund  <tg@gmplib.org>

	* mpn/x86_64/bt2/gcd_1.asm: New grabber file.
	* mpn/x86_64/zen/gcd_1.asm: Grab from "bd2" directory, was "core2".

2019-08-02  Torbjörn Granlund  <tg@gmplib.org>

	* mpn/x86_64/bd2/gcd_1.asm: New file.

2019-08-01  Torbjörn Granlund  <tg@gmplib.org>

	* tests/mpf/t-conv.c: Add several more fixed test cases.

	* mpf/set_str.c: Ignore leading zeros including ones after radix point
	to avoid invalid output formats.

2019-07-30  Torbjörn Granlund  <tg@gmplib.org>

	* mpn/powerpc64/mode64/p9/gcd_1.asm: New file.

2019-07-30  Niels Möller  <nisse@lysator.liu.se>

	From Seth Troisi:
	* doc/gmp.texi (Jacobi Symbol): Update algorithm documentation.
	* tests/mpz/t-jac.c: Comment update.

2019-07-13  Torbjörn Granlund  <tg@gmplib.org>

	* configure.ac (arm): Generalise arm a72 pattern to match a73...a79.

2019-07-08  Torbjörn Granlund  <tg@gmplib.org>

	* mpn/arm/arm-defs.m4 (ASM_START): Rewrite (fix broken error handling).

2019-07-02  Torbjörn Granlund  <tg@gmplib.org>

	* acinclude.m4 (GMP_C_DOUBLE_FORMAT): Compile conftest.c to executable
	in order to trigger final compile in case of LTO.

2019-06-17  Torbjörn Granlund  <tg@gmplib.org>

	* config.guess: Work around upstream configfsf.guess's regression wrt
	mips vs mips64.

2019-06-14  Torbjörn Granlund  <tg@gmplib.org>

	* longlong.h (mips64): Provide r6 asm code as default expression yields
	libcall.

	* configure.ac (mips64): Use separate paths for r6 and non-r6 as these
	architectures are mutually incompatible.

	* mpn/mips64/{addmul_1,mul_1,sqr_diagonal,submul_1,umul}.asm:
	Move into hilo subdir.

2019-05-28  Torbjörn Granlund  <tg@gmplib.org>

	* config.sub: Fixes to which cpu types end with a "*".

2019-04-20  Niels Möller  <nisse@lysator.liu.se>

	* doc/gmp.texi (References): Link to paper on subquadratic GCD.

2019-04-19  Torbjörn Granlund  <tg@gmplib.org>

	* mpn/x86_64/bd1/hamdist.asm: Really make 2017-06-01 change: Use
	3-operand DEF_OBJECT.

	* mpn/x86_64/invert_limb.asm: Simplify mpn_invert_limb_table ref.

	* mpn/x86_64/x86_64-defs.m4 (LEA): Use rip addressing for non-PIC.

2019-04-17  Niels Möller  <nisse@lysator.liu.se>

	* mpn/generic/jacobi.c (mpn_jacobi_n): Use JACOBI_DC_THRESHOLD,
	not GCD_DC_THRESHOLD. Inconsistency spotted by Seth Troisi.

2019-04-02  Torbjörn Granlund  <tg@gmplib.org>

	* mpn/x86_64/fat/fat.c (__gmpn_cpuvec_init):
	Split out silvermont handling, add handling of goldmont.

	* configure.ac: Setup distinct paths for silvermont and goldmont.
	(fat_path): Add missing x86_64/goldmont.

	* config.guess: Recognise "Goldmont Plus".

2018-12-09  Torbjörn Granlund  <tg@gmplib.org>

	* mpn/generic/mul_fft.c (mpn_fft_add_sub_modF): New function.
	(mpn_fft_fft, mpn_fft_fftinv): Use it.

2018-11-30  Torbjörn Granlund  <tg@gmplib.org>

	* mpn/powerpc64/mode64/p9/gmp-mparam.h: New file.

	* mpn/powerpc64/mode64/p9/add_n_sub_n.asm: New file.

2018-11-28  Torbjörn Granlund  <tg@gmplib.org>

	* mpn/powerpc64/mode64/p9/sqr_basecase.asm: New file.
	* mpn/powerpc64/mode64/p9/mul_1.asm: New file.

2018-11-18  Torbjörn Granlund  <tg@gmplib.org>

	* mpn/powerpc64/mode64/p9/mul_basecase.asm: New file.

	* mpn/powerpc64/mode64/p9/addmul_1.asm: Optimise.

2018-11-12  Torbjörn Granlund  <tg@gmplib.org>

	* mpn/powerpc64/mode64/p9/aorsmul_1.asm: New file, providing fast
	submul_1 (and redundant addmul_1).

2018-11-11  Torbjörn Granlund  <tg@gmplib.org>

	* mpn/powerpc64/mode64/p9/addmul_1.asm: Tweak for slightly better
	speed.

	* mpn/powerpc32/powerpc-defs.m4: Define addex.
	* mpn/powerpc64/mode64/p9/mul_2.asm: Use it.
	* mpn/powerpc64/mode64/p9/addmul_2.asm: Likewise.

2018-11-08  Torbjörn Granlund  <tg@gmplib.org>

	* tests/devel/cnd_aors_n.c: New file.

	* mpn/arm/neon/lorrshift.asm: Declare use of neon insns.
	* mpn/arm/neon/lshiftc.asm: Likewise + cleanup.

	* tests/devel/Makefile.am (EXTRA_PROGRAMS): Add missing files.

	* mpn/powerpc64/mode64/p9/mul_2.asm: New file.
	* mpn/powerpc64/mode64/p9/addmul_2.asm: New file.

2018-11-07 Marco Bodrato <bodrato@mail.dm.unipi.it>

	* mpz/lucnum2_ui.c: Use mpn_rsblsh1_n if available.
	* tests/mpz/t-nextprime.c: Add one more interval.
	* tests/mpz/t-pprime_p.c (check_fermat_mersenne): New tests.
	* mpn/generic/mod_1_3.c: typo in a comment.
	* mpz/nextprime.c: Use tdiv instead of fdiv.

	* mpn/generic/fib2m.c: New file, Fibonacci numbers modulo.
	* configure.ac (gmp_mpn_functions): Add it.
	* gmp-impl.h: Declare mpn_fib2m.
	* tests/mpn/t-fib2m.c: New file, tests for mpn_fib2m.
	* tests/mpn/Makefile.am (check_PROGRAMS): Add t-fib2m.

	* mpn/generic/mod_34lsub1.c: Initialise c[012] once.
	* tests/mpz/t-pprime_p.c (check_primes): Two more primes.
	* tests/mp?: Use TESTS_REPS in many files.

	* mpn/generic/strongfibo.c: New file, Fibonacci primality test.
	* configure.ac (gmp_mpn_functions): Add it.
	* gmp-impl.h: Declare mpn_strongfibo.

	* mpz/stronglucas.c: New file, strong Lucas primality test.
	* Makefile.am (MPZ_OBJECTS): Add it.
	* mpz/Makefile.am (libmpz_la_SOURCES): Add it.
	* gmp-impl.h: Declare mpz_stronglucas.

	* mpz/millerrabin.c: Implement BPSW test for primality.

2018-11-07  Torbjörn Granlund  <tg@gmplib.org>

	* configure.ac (arm): Support a12 and a17.
	* config.sub: Generalise arm matching.
	* config.guess: Recognise additional arm CPUs.

	* mpn/arm/arm-defs.m4 (ASM_START): Provide local definition.

2018-10-30  Torbjörn Granlund  <tg@gmplib.org>

	* mpn/arm/v7a/cora17/mod_34lsub1.asm: New file.
	* mpn/arm/v7a/cora17/gmp-mparam.h: New file.
	* mpn/arm/v7a/cora17/mul_1.asm: New grabber file.
	* mpn/arm/v7a/cora17/addmul_1.asm: Likewise.
	* mpn/arm/v7a/cora17/submul_1.asm: Likewise.

2018-10-18 Marco Bodrato <bodrato@mail.dm.unipi.it>

	* mpn/generic/fib2_ui.c: Simplify the possible -2 case.

2018-07-19 Marco Bodrato <bodrato@mail.dm.unipi.it>

	* mpz/millerrabin.c (mod_eq_m1): New function, equality with -1.
	* mpz/powm_ui.c: Small optimisations.

2018-07-03  Torbjörn Granlund  <tg@gmplib.org>

	* mpn/x86_64/lshift.asm: Remove cnt = 1 special code.

	* mpn/x86_64/silvermont/popcount.asm: Add missing ABI_SUPPORT decls.
	* mpn/x86_64/silvermont/hamdist.asm: Likewise.
	* mpn/x86_64/zen/mul_1.asm: Likewise.

	* mpn/x86_64/fastsse/lshift.asm: Support DOS64.
	* mpn/x86_64/fastsse/lshiftc.asm: Likewise.

	* mpn/x86_64/pentium4/gmp-mparam.h: Retune.

2018-07-01  Torbjörn Granlund  <tg@gmplib.org>

	* lshift.asm: Replace with grabber file.
	* lshiftc.asm: Replace with grabber file.
	* x86_64/pentium4/addmul_2.asm: New grabber file.
	* x86_64/pentium4/aorsmul_1.asm: New grabber file.
	* x86_64/pentium4/mul_1.asm: New grabber file.
	* x86_64/pentium4/mul_2.asm: New grabber file.
	* x86_64/pentium4/mul_basecase.asm: New grabber file.
	* x86_64/pentium4/mullo_basecase.asm: New grabber file.
	* x86_64/pentium4/redc_1.asm: New grabber file.
	* x86_64/pentium4/sqr_basecase.asm: New grabber file.

2018-06-13  Niels Möller  <nisse@lysator.liu.se>

	* mpn/generic/gcd_1.c (mpn_gcd_1): Delete unused code variant for
	GCD_1_METHOD == 1, and delete GCD_1_METHOD macro. Simplify the
	structure of the remaining code variant, without gotos to the
	mid-loop strip_u_maybe label.

2018-05-30  Torbjörn Granlund  <tg@gmplib.org>

	* configure.ac (x86): Provide goldmont specific path.

	* mpn/x86_64/goldmont/gmp-mparam.h: New file.

2018-05-29  Torbjörn Granlund  <tg@gmplib.org>

	* configure.ac (x86): Pass more exact arch/tune options for nehalem.

2018-05-28  Niels Möller  <nisse@lysator.liu.se>

	* mpn/generic/gcd_1.c (mpn_gcd_1) [USE_ZEROTAB]: Delete unused code
	variant for USE_ZEROTAB != 0.

2018-05-20 Marco Bodrato <bodrato@mail.dm.unipi.it>

	* bootstrap.c: Define DONT_USE_FLOAT_H before including mini-gmp.

2018-05-14 Marco Bodrato <bodrato@mail.dm.unipi.it>

	* mpn/generic/dcpi1_bdiv_q.c (mpn_dcpi1_bdiv_q_n): Decl. static.
	(mpn_dcpi1_bdiv_q_n_itch): Declare static.
	* mpn/generic/dcpi1_divappr_q.c (mpn_dcpi1_divappr_q_n): static.
	* mpn/generic/matrix22_mul.c (mpn_matrix22_mul_strassen): static.
	* mpn/generic/mu_div_qr.c (mpn_mu_div_qr_choose_in): static.
	* mpn/generic/mu_divappr_q.c (mpn_preinv_mu_divappr_q): static.
	(mpn_mu_divappr_q_choose_in): static.
	* gmp-impl.h: Remove declaration of previous functions.

	* mpn/generic/get_d.c: Enhance generic code using DBL_MANT_DIG.

	* printf/repl-vsnprintf.c: Better handling floating-point
	specifiers "EeGgFf" (Thanks Vincent Lefevre).

2018-05-04 Marco Bodrato <bodrato@mail.dm.unipi.it>

	* doc/gmp.texi (mpq_*_str): Document the full base allowed range.
	* mpq/get_str.c: Make all bases either work or return an error.

	* doc/gmp.texi (Integer Internals): Lazy allocation and read-only.

2018-04-27  Niels Möller  <nisse@lysator.liu.se>

	* mpn/generic/div_q.c (mpn_div_q): Replace dead code with ASSERT.
	Spotted by Paul Zimmermann and Raphaël Rieu-Hleft.

	* tests/mpn/t-div.c (main): Fill quotient area with junk before
	calling mpn_div_q.

2018-04-26 Marco Bodrato <bodrato@mail.dm.unipi.it>

	* Makefile.am (EXTRA_DIST): Add mini-gmp/mini-mpq.[ch].

2018-04-23 Marco Bodrato <bodrato@mail.dm.unipi.it>

	* mpn/generic/toom2_sqr.c: Handle the cy=-1 branch slightly faster.
	* mpn/generic/toom22_mul.c: Likewise. (Thanks Paul and Raphaël!)

2018-04-22  Niels Möller  <nisse@lysator.liu.se>

	From Martin Storsjö:
	* configure.ac (aarch64): Just as on windows/x86_64, "long" still
	is 32 bit on aarch64. To distinguish between 32-bit and 64-bit
	ABI, test sizeof(void*) instead of sizeof(long). Use long long for
	mp_limb_t for mingw targets.
	* acinclude.m4 (GMP_C_TEST_SIZEOF): Allow '*' in the type name,
	e.g., void*.

2018-04-18  Marc Glisse  <marc.glisse@inria.fr>

	* mpq/clear.c: Handle lazy numerator.
	* mpq/clears.c: Likewise.
	* mpq/init.c: Likewise.
	* mpq/set_si.c: Likewise.
	* mpq/set_ui.c: Likewise.

	* tests/cxx/t-ops2z.cc: Add parentheses to quiet a warning.

2018-03-28  Torbjörn Granlund  <tg@gmplib.org>

	* configure.ac (mips): Recognise "mipsisa64*".

2018-03-23  Torbjörn Granlund  <tg@gmplib.org>

	* mpn/generic/sec_powm.c: Remove unused macros.
	Simplify code for choosing between redc_1 and redc_2.
	Compute power table with squaring for even powers.

2018-02-28 Marco Bodrato <bodrato@mail.dm.unipi.it>

	* gmpxx.h (__gmp_binary_plus): Special case for mpq + 1.
	(__gmp_binary_minus): Special case for mpq - 1.
	(__gmp_binary_equal): Optimised comparison mpq == integer.
	* tests/cxx/t-ops2qf.cc (checkqf): Some check for +/- 1, +/- 0.

2018-02-18 Marco Bodrato <bodrato@mail.dm.unipi.it>

	* tune/Makefile.am: Disallow parallel make (thanks Vincent Lefevre).
	* mpq/swap.c: Use *_SWAP_* macros.
	* mpq/cmp_ui.c: One more little shortcut, comparing fractions to 1.
	* mpq/get_d.c: Compare (zeros > 0) once, replace tdiv_qr with div_q.
	* mpq/equal.c: Check size early.

	* printf/obprintf.c: Adda dummy typedef to avoid empty unit.
	* printf/obvprintf.c: Likewise.
	* printf/obprntffuns.c: Likewise.
	* printf/repl-vsnprintf.c: Move #ifdef after #include gmp-impl.h .

2018-02-09  Torbjörn Granlund  <tg@gmplib.org>

	* mpn/arm: Really revert 2018-01-04 changes.

2018-02-08 Marco Bodrato <bodrato@mail.dm.unipi.it>

	* printf/snprntffuns.c: Report -1 as an error.
	* acinclude.m4 (GMP_FUNC_VSNPRINTF): Refuse -1 as return value.

	* mpz/bin_uiui.c (mpz_smallk_bin_uiui): One more shortcut for small k.
	* gmp-impl.h (popc_limb): Use fewer constants (GMP_LIMB_BITS == 16).
	* mpz/divegcd.c (mpz_divexact_limb): Use MPN_DIVREM_OR_DIVEXACT_1.
	* primesieve.c (fill_bitpattern): Use MPN_FILL.

2018-02-01  Marc Glisse  <marc.glisse@inria.fr>

	* longlong.h (i586): Remove assert.

2018-01-30 Marco Bodrato <bodrato@mail.dm.unipi.it>

	* mpz/and.c: Rearrange the 3 cases, both <0, both >=0, one and one.
	* mpz/ior.c: Likewise.
	* mpz/xor.c: Likewise.

	* mpz/bin_uiui.c (mul[4-8]): Reduce the number of multiplications.
