Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung
 
 
 
 


Quelle  ChangeLog   Sprache: unbekannt

 
2023-07-29  Torbjörn Granlund  <tg@gmplib.org>

 * Version 6.3.0 released.

 * mpn/s390_64/z13/mul_basecase.asm: Rewrite, using new addmul_1.asm.

 * mpn/s390_64/z13/mul_1.asm: Rewrite.
 * mpn/s390_64/z13/addmul_1.asm: Likewise.
 * mpn/s390_64/z13/submul_1.asm: Likewise.

2023-07-27  Niels Möller  <nisse@lysator.liu.se>

 Update DIV_QR_1N_PI1_METHOD to use method 3 or 4.
 * mpn/arm64/applem1/gmp-mparam.h: Update DIV_QR_1N_PI1_METHOD.
 * mpn/arm64/cora57/gmp-mparam.h: Likewise.
 * mpn/arm64/xgene1/gmp-mparam.h: Likewise.
 * mpn/powerpc64/mode64/p7/gmp-mparam.h: Likewise.
 * mpn/powerpc64/mode64/p8/gmp-mparam.h: Likewise.
 * mpn/powerpc64/mode64/p9/gmp-mparam.h: Likewise.
 * mpn/sparc64/ultrasparct45/gmp-mparam.h: Likewise.
 * mpn/x86/coreihwl/gmp-mparam.h: Likewise.
 * mpn/x86/k7/gmp-mparam.h: Likewise.

2023-07-26  Niels Möller  <nisse@lysator.liu.se>

 * tune/speed.h (mpn_hgcd_appr_lehmer): Fix declaration to use
 correct return type.

2023-07-26  Torbjörn Granlund  <tg@gmplib.org>

 * mpn/s390_64/z13/submul_1.asm: New file.
 * mpn/s390_64/z13/popcount.asm: New file.
 * mpn/s390_64/z13/hamdist.asm: New file.

2023-07-25  Torbjörn Granlund  <tg@gmplib.org>

 * mpn/s390_64/z13/addmul_2.asm: New file.
 * mpn/s390_64/z13/addmul_1.asm: New file.
 * mpn/s390_64/z13/addmul_2.asm: New file.
 * mpn/s390_64/z13/mul_1.asm: New file.
 * mpn/s390_64/z13/mul_2.asm: New file.
 * mpn/s390_64/z13/mul_basecase.asm: New file.
 * mpn/s390_64/z13/sqr_basecase.c: New file.

2023-07-20  Torbjörn Granlund  <tg@gmplib.org>

 * config.guess: Generalise sparc patterns.

2023-07-19  Torbjörn Granlund  <tg@gmplib.org>

 * mpn/generic/div_qr_1n_pi2.c, mpn/generic/div_qr_1n_pi1.c,
 mpn/generic/mod_1_1.c, mpn/generic/div_qr_1u_pi2.c,
 mpn/generic/div_qr_2.c: Get arm64 asm contraints right for adcs.

2023-07-18  Torbjörn Granlund  <tg@gmplib.org>

 * configure.ac: Suppress any -flto flags for running GMP_ASM_*.

2023-07-15  Torbjörn Granlund  <tg@gmplib.org>

 * configure.ac: Pass -mcpu= instead of -mtune= consistently for ibm power.

 * mpn/riscv/64: Improve Risc V asm support.
 * mpn/loongarch/64: Provide basic Loongarch asm support.

2023-07-06  Marc Glisse  <marc.glisse@inria.fr>

 * doc/gmp.texi: Mention snapshots in bug report instructions.

 * configfsf.guess: Updated to version 2023-06-23, from gnulib.
 * configfsf.sub: Updated to version 2023-06-26, from gnulib.

2023-06-29  Torbjörn Granlund  <tg@gmplib.org>

 * configure.ac: Make sparc -mptr64 argument optional.

 * configure.ac, config.guess, config.sub, acinclude.m4: Handle power10.

2023-06-23 Marius Hillenbrand <mhillen@linux.ibm.com>
    Stefan Liebler <stli@linux.ibm.com>

 * mpn/s390_64/z13/addmul_1.c: New file.
 * mpn/s390_64/z13/aormul_2.c: New file.
 * mpn/s390_64/z13/common-vec.h: New file.
 * mpn/s390_64/z13/gmp-mparam.h: New file.
 * mpn/s390_64/z13/mul_1.c: New file.
 * mpn/s390_64/z13/mul_basecase.c: New file.

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

 * mpn/x86_64/bd1/popcount.asm: Prefer movd to movq for register moves.
 * mpn/x86_64/bd1/hamdist.asm: Likewise.
 * mpn/x86_64/core2/hamdist.asm: Likewise.
 * mpn/x86_64/core2/popcount.asm: Likewise.

2022-10-28 Marco Bodrato <bodrato@mail.dm.unipi.it>

 * mpz/nextprime.c (findnext): Use TMP_ALLOC_TYPE to allocate
 composite array (tx: Jiayi Lin)

2022-09-30  Marc Glisse  <marc.glisse@inria.fr>

 * doc/projects.html: Update URL for MPFR.
 * doc/gmp.texi: Likewise.

2022-08-11 Marco Bodrato <bodrato@mail.dm.unipi.it>

 * mpz/primorial_ui.c: Rename some variables and add comments.

2022-06-19 Marco Bodrato <bodrato@mail.dm.unipi.it>

 * mpz/millerrabin.c: Use mp_bitcnt_t.
 * mpz/stronglucas.c: Skip some impossible values searching for D.

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

 * mpz/nextprime.c: Smaller operand for mpz_sqrt.
 * tests/mpz/t-nextprime.c: Exit on error.
 * tests/mpz/t-pprime_p.c: More cases to trigger unlikely branches.

 * tests/mpz/t-aorsmul.c: Test the (r,x,x) case.
 * mpz/aorsmul.c: Speed-up the (r,x,x) case (tx:Fredrik Johansson).

2022-04-24  Torbjörn Granlund  <tg@gmplib.org>

 * mpn/arm/v5/gcd_22.asm: New file.

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

 * gmpxx.h (mpz_class): Do not use mp directly.

2022-03-30  Torbjörn Granlund  <tg@gmplib.org>

 * configure.ac, config.guess, config.sub, acinclude.m4: Handle Intel
 tremont separately.

 * longlong.h (loongarch64 umul_ppmm): New #define.

2022-03-18 Marco Bodrato <bodrato@mail.dm.unipi.it>

 * tests/mpz/t-lucm.c: Remove an unused var.
 * tests/mpq/io.c: Use a random size.
 * tests/mpz/t-gcd.c: Do not assume a limb fits for _ui functions.

2022-03-15 Marco Bodrato <bodrato@mail.dm.unipi.it>

 * mpn/generic/mul_fft.c: Use _bknp1. Not when tuning, to avoid "noise".

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

 * mpn/x86_64/alderlake/submul_1.asm: New file.

2022-03-08 Marco Bodrato <bodrato@mail.dm.unipi.it>

 * mpn/generic/mulmod_bnm1.c: Use mulmod_bknp1, on the bnp1 side.
 * mpn/generic/sqrmod_bnm1.c: Likewise.

 * mpn/generic/mul_fft.c: Remove a branch and improve carry propagation.

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

 * mpn/x86_64/alderlake/mul_basecase.asm: New file.
 * mpn/x86_64/alderlake/addmul_1.asm: New file.

2022-02-21  Torbjörn Granlund  <tg@gmplib.org>

 * configure.ac: Handle alderlake specifically, as it lacks avx512.

2022-02-15 Marco Bodrato <bodrato@mail.dm.unipi.it>

 * mpn/generic/strongfibo.c: Correct condition in #if.

 * mpn/generic/mulmod_bknp1.c: New file, with mpn_{mul,sqr}mod_bknp1.
 * configure.ac (gmp_mpn_functions): Add new file.
 * gmp-impl.h: Declare new functions.
 * gmp-impl.h (MPN_{MUL,SQR}MOD_BKNP1_USABLE): Support new functions.

 * tests/mpn/t-{mul,sqr}mod_bknp1.c: New tests for mpn_{mul,sqr}mod_bknp1.
 * tests/mpn/Makefile.am: Add new tests.

 * tune/speed.c: Recognise new functions: mpn_{mul,sqr}mod_bknp1.
 * tune/speed.h: Declare new speed_ functions to measure them.
 * tune/common.c: Implement speed_ functions.

2022-02-14  Torbjörn Granlund  <tg@gmplib.org>

 * config.guess: Recognize Tremont CPU variants.

2022-02-01 Marco Bodrato <bodrato@mail.dm.unipi.it>

 * mpz/aorsmul_i.c: Use MPZ_NEWALLOC when the operand is overwritten.
 * mpz/import.c: Reorder branches.
 * mpz/{init2.c,realloc.c,realloc2.c}: Remove unneeded #includes.

2022-01-20  Marc Glisse  <marc.glisse@inria.fr>

 * doc/gmp.texi: Clarify C++ includes and library.

2022-01-05 Marco Bodrato <bodrato@mail.dm.unipi.it>

 * gen-sieve.c: Generate masks depending on bit size.
 * primesieve.c: Remove fixed size (32 and 64 only) masks.

 * tune/speed.c: Add FLAG_NODATA for gmp_primesieve.

2021-12-11 Marco Bodrato <bodrato@mail.dm.unipi.it>

 * mpn/generic/toom3_sqr.c: Use a shorter mul when it's simple.
 * mpn/generic/toom4_sqr.c: Likewise.
 * mpn/generic/toom33_mul.c: Likewise.
 * mpn/generic/toom44_mul.c: Likewise.

 * gmp-h.in (GMP_ERROR_MPZ_OVERFLOW): New enum value.
 * errno.c (__gmp_overflow_in_mpz): New function.
 * gmp-impl.h (MPZ_OVERFLOW): New macro calling it.
 * mpz/init2.c: Use the new macro to rise the overflow error.
 * mpz/realloc.c: Likewise.
 * mpz/realloc2.c: Likewise.

 * mpz/tdiv_r.c: Special code for divisor with low zero limbs.
 * mpz/tdiv_qr.c: Likewise.

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

 * configure.ac: Adapt to acinclude.m4 change.

 * mpn/riscv/64/aors_n.asm: Accept 4th CMPCY operand, allowing for
 2 c/l mpn_sub_n (mpn_add_n cannot beat 3 c/l with RISC V's ISA).

 * configure.ac (S390_PATTERN): Rewrite to handle path inheritance.

 * acinclude.m4 (GMP_ASM_SPARC_GDOP): Renamed GMP_ASM_SPARC_GOTDATA.

 * mpn/sparc32/sparc-defs.m4 (LEA64): Remove misguided assert.
 * mpn/sparc32/sparc-defs.m4 (LEA64): Allow PIC withot gdop_*.

 * mpn/sparc64/gcd_11.asm: Optimise out annulled shift insn in loop.

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

 * mpn/generic/sec_tabselect.c: Make recently added code actually work.
 (Thanks Marco!)

 * mpn/s390_32/sec_tabselect.asm: New file.

 * mpn/s390_64/sec_tabselect.asm: Avoid "slfi" for portability.

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

 * mpn/s390_64/sec_tabselect.asm: Rewrite.

 * mpn/generic/sec_tabselect.c: Provide alternative function.

2021-10-31  Torbjörn Granlund  <tg@gmplib.org>

 * mpn/riscv/64/sec_tabselect.asm: New file.
 * mpn/s390_64/sec_tabselect.asm: New file.
 * mpn/x86/sec_tabselect.asm: Streamline.

2021-10-31 Marco Bodrato <bodrato@mail.dm.unipi.it>

 * mpz/fac_ui.c: Save half the products for small values.

2021-10-29  Torbjörn Granlund  <tg@gmplib.org>

 * mpn/generic/sec_tabselect.c: Rewrite.

2021-10-16  Torbjörn Granlund  <tg@gmplib.org>

 * configure.ac, config.guess, config.sub, acinclude.m4: Recognise more
 icelake CPUs, and initial alderlake CPUs.

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

 * mpn/arm64/applem1/addaddmul_1msb0.asm: New file.

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

 * mpn/x86_64/k8/addaddmul_1msb0.asm: Moved from "..".

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

 * tests/mpn/t-addaddmul.c: Unit test for mpn_addaddmul_1msb0.

2021-10-07  Niels Möller  <nisse@lysator.liu.se>

 * tune/speed.h (SPEED_ROUTINE_MPN_ADDADDMUL1_MSB0): New macro.
 * tune/common.c (speed_mpn_addaddmul_1msb0): New function.
 * tune/speed.c (routine): Add mpn_addaddmul_1msb0 to list.

2021-10-01 Marco Bodrato <bodrato@mail.dm.unipi.it>

 * gen-sieve.c: New file to generate a small presieved array.
 * primesieve.c (first_block_primesieve): Use the presieved array.
 * gmp-impl.h: #include output of gen-sieve.
 * Makefile.am: Add rules for gen-sieve and sieve_table.h.

 * mpn/x86_64/addaddmul_1msb0.asm: Support DOS ABI, reorder branches.

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

 * configure.ac (s390): Make sure to always include main asm directory.

 * longlong.h (umul_ppmm): Correct Risc V operand order.

2021-09-25 Marco Bodrato <bodrato@mail.dm.unipi.it>

 * mpz/import.c: Use MPN_BSWAP_REVERSE, reorder branches.
 * mpz/inp_raw.c: Avoid bit size overflows.

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

 * config.sub: Update powerpc pattern.

 * longlong.h: Change tested predef for Risc V.

2021-08-21 Marco Bodrato <bodrato@mail.dm.unipi.it>

 * mpz/primorial_ui.c: Simpler loop on sieved primes.
 * mpz/nextprime.c: Likewise.

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

 * mpn/asm-defs.m4: Remove quotes around PIC_ALWAYS.  Reported by
 George Koehler.

2021-07-01  Niels Möller  <nisse@lysator.liu.se>

 * mpn/generic/div_qr_1n_pi1.c (mpn_div_qr_1n_pi1): New variants,
 DIV_QR_1N_METHOD 3 and 4.

 * tune/div_qr_1n_pi1_3.c: New file.
 * tune/div_qr_1n_pi1_4.c: New file.
 * tune/Makefile.am (libspeed_la_SOURCES): Add new files.
 * tune/div_qr_1_tune.c (__gmpn_div_qr_1n_pi1): Handle new values
 of div_qr_1n_pi1_method.
 * tune/common.c (speed_mpn_div_qr_1n_pi1_3)
 (speed_mpn_div_qr_1n_pi1_4): New functions.
 * tune/speed.c (routine): Add mpn_div_qr_1n_pi1_3 and
 mpn_div_qr_1n_pi1_3 to list.
 * tune/speed.h: Declare new functions.
 * tune/tuneup.c (tune_div_qr_1): Extend tuning of
 DIV_QR_1N_PI1_METHOD.

2021-06-20  Marc Glisse  <marc.glisse@inria.fr>

 * gmpxx.h (mpq_class(mpz_class&&)): New constructor.

2021-06-20  Niels Möller  <nisse@lysator.liu.se>

 * doc/gmp.texi: Document foo_ptr and foo_srcptr.

2021-06-06  Paul Eggert  <eggert@cs.ucla.edu>

 * configure.ac (AC_INIT): Avoid comma in BUG-REPORT field.

2021-06-06  Marc Glisse  <marc.glisse@inria.fr>

 * gmp-h.in (gmp_randstate_ptr, gmp_randstate_srcptr): Move declaration
 from gmp-impl.h.
 (gmp_randinit, gmp_randinit_default, gmp_randinit_lc_2exp,
 gmp_randinit_lc_2exp_size, gmp_randinit_mt, gmp_randinit_set,
 gmp_randseed, gmp_randseed_ui, gmp_randclear, gmp_urandomb_ui,
 gmp_urandomm_ui, mpz_rrandomb, mpz_urandomb, mpz_urandomm,
 mpf_urandomb): Replace gmp_randstate_t with gmp_randstate_ptr.
 * gmp-impl.h (gmp_randstate_ptr, gmp_randstate_srcptr): Move
 declaration to gmp-h.in.
 (gmp_randfnptr_t, __gmp_randinit_mt_noseed): Replace gmp_randstate_t
 with gmp_randstate_ptr.
 * mpf/reldiff.c: Replace mpf_t with mpf_ptr.
 * mpf/set_q.c: Likewise.
 * mpf/urandomb.c: Likewise.
 * mpq/canonicalize.c: Replace mpq_t with mpq_ptr.
 * mpq/clear.c: Likewise.
 * mpq/init.c: Likewise.
 * mpq/set_si.c: Likewise.
 * mpq/set_ui.c: Likewise.
 * mpz/rrandomb.c: Replace gmp_randstate_t with gmp_randstate_ptr.
 * mpz/urandomb.c: Likewise.
 * mpz/urandomm.c: Likewise.
 * rand/rand.c: Likewise.
 * rand/randclr.c: Likewise.
 * rand/randdef.c: Likewise.
 * rand/randlc2s.c: Likewise.
 * rand/randlc2x.c: Likewise.
 * rand/randmt.c: Likewise.
 * rand/randmt.h: Likewise.
 * rand/randmts.c: Likewise.
 * rand/randsd.c: Likewise.
 * rand/randsdui.c: Likewise.

 * gmp-impl.h: Include stdint.h even if we have inttypes.h.
 * printf/doprnt.c: Likewise.
 * printf/repl-vsnprintf.c: Likewise.
 * scanf/doscan.c: Likewise.
 * tests/misc/t-printf.c: Likewise.
 * tests/misc/t-scanf.c: Likewise.

2021-06-03  Niels Möller  <nisse@lysator.liu.se>

 * mpn/generic/div_qr_1n_pi1.c (mpn_div_qr_1n_pi1): Micro-optimize
 method 2, and document the main idea of the algorithm.

2021-05-25 Marco Bodrato <bodrato@mail.dm.unipi.it>

 * mpn/generic/sec_powm.c (sec_binvert_limb): New static function.

 * mpn/generic/powm.c (win_size): Remove the unused value from array.
 * mpn/generic/sec_powm.c (win_size): Likewise.

2021-05-08  Marc Glisse  <marc.glisse@inria.fr>

 * doc/gmp.texi: Mention shifts in bit manipulation.

2021-05-02  Torbjörn Granlund  <tg@gmplib.org>

 * configure.ac, config.guess, config.sub: Recognise CPUs icelake,
 tigerlake, and rocketlake.

 * configure.ac: Clean up handling of several Intel CPUs.

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

 * longlong.h: Disable s390 patterns which makes clang barf.

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

 With Marius Hillenbrand:
 * configure.ac, config.guess, config.sub, acinclude.m4:
 Recognise CPUs z13-z15.

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

 * longlong.h (68000 umul_ppmm): Add an early-clobber &.

2021-01-18  Torbjörn Granlund  <tg@gmplib.org>

 * mpn/x86_64/zen3/sbpi1_bdiv_r.asm: New grabber file.

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

 * mpn/x86_64/coreibwl/sbpi1_bdiv_r.asm: New file.

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

 * configure.ac: Handle zen3 different from zen2.

 * mpn/x86_64/zen3/addmul_1.asm: New grabber file.
 * mpn/x86_64/zen3/mul_basecase.asm: Likewise.
 * mpn/x86_64/zen3/sqr_basecase.asm: Likewise.

 * mpn/x86_64/zen3/mul_1.asm: New file.

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

 * mpn/arm64/applem1/sqr_basecase.asm: New file, do 2x and limb squaring
 in main loop.

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

 * mpn/arm64/applem1/aorsmul_1.asm: Provide addmul_1c entry point.

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

 * mpn/arm64/copyi.asm: Rewrite to use scalar regs.
 * mpn/arm64/copyd.asm: Likewise.

2020-12-12  Marc Glisse  <marc.glisse@inria.fr>

 * gmp-h.in (_GMP_H_HAVE_FILE): Test also _STDIO (for HPE NonStop).

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

 * mpn/arm64/applem1/gmp-mparam.h: New file.

 * mpn/generic/mod_1_1.c: Provide add_mssaaaa for arm64.
 * mpn/generic/div_qr_1n_pi1.c: Likewise.

 * mpn/arm64/divrem_1.asm: Use sub insn for subtracting constants.

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

 * mpn/arm64/divrem_1.asm: New file.
 * mpn/arm64/applem1/aorsmul_1.asm: New file.

 * configure.ac, config.guess, config.sub: Recognise CPU "applem1".

 * mpn/arm64: Avoid the x18 register since it is reserved on Darwin.

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

 * tests/mpz/t-pprime_p.c (check_fermat_mersenne): Check return
 value.

 * tests/devel/primes.c: Correctly use n_cto_bit or n_fto_bit.
 * primesieve.c: Differentiate n_to_bit into floor and ceil.

2020-11-23 Seth Troisi <sethtroisi@google.com>

 * mpz/nextprime.c (mpz_prevprime): New function.
 * gmp-h.in: Declare it.
 * doc/gmp.texi: Document it.
 * tests/mpz/t-nextprime.c: Test it.

 * tests/mpz/t-pprime_p.c (check_small): Check return value.

 * tune/common.c (speed_mpz_prevprime{,_1}): New functions.
 * tune/speed.h: Declare them.
 * tune/speed.c (routine): Add mpz_nextprime{,_1}.

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.
 * mpn/generic/mod_1.c (mpn_mod_1_unnorm): Compare r<d before shifting.
 * mpf/mul.c: Use macros.

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

 * mpz/aors_ui.h: REALLOC with extra limb only when needed.

 * mpz/bin_uiui.c (limb_apprsqrt): Slightly faster formula.
 * mpz/oddfac_1.c (limb_apprsqrt): Likewise.
 * mpz/stronglucas.c (limb_apprsqrt): Likewise.

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

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

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

 * bootstrap.c (mpz_invert_2exp): Simplify.
 * mpz/stronglucas.c (mpz_oddjacobi_ui): New helper function.

 * 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)

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-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-11  Torbjörn Granlund  <tg@gmplib.org>

 * mpn/powerpc32/powerpc-defs.m4 (aese,aeselst): New macros.

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.

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

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

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

 * 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.

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

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

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

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

 * mpn/generic/hgcd2-div.h (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-03-10 Marco Bodrato <bodrato@mail.dm.unipi.it>

 * mpn/generic/mulmod_bnm1.c (mpn_bc_mulmod_bnp1):
 Simplify special cases.
 * mpz/bin_ui.c (rek_raising_fac4): Reduce allocations.
 (mpz_bin_ui): Siplify special cases.
 * tests/mpz/t-bin.c: Use divexact.

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

2020-02-12 Marco Bodrato <bodrato@mail.dm.unipi.it>

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

2020-02-09 Marco Bodrato <bodrato@mail.dm.unipi.it>

 * mpn/generic/sqrmod_bnm1.c (mpn_bc_sqrmod_bnp1):
 Shorter mpn_sqr.
 * mpn/generic/mulmod_bnm1.c (mpn_bc_mulmod_bnp1):
 Shorter mpn_mul_n.

 * tests/mpn/t-mulmod_bnm1.c: Trigger special cases more often.
 * tests/mpn/t-sqrmod_bnm1.c: Likewise.

2020-02-09 Seth Troisi <sethtroisi@google.com>

 * tests/mpz/t-nextprime.c: Split into sub-tests.

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

 * mpn/generic/powm.c: Better handling of current window-size.
 * mpn/generic/powlo.c: Likewise.

 * mpn/generic/jacbase.c (mpn_jacobi_base): Optimise _METHOD 4.
 * mpz/aors.h: Branches optimisation.

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

 * mpn/generic/powm.c (MPN_REDC_0): Subtractive redc
 (mpn_2powm): New, static, function
 * tests/mpz/t-powm.c: More tests for the base=2 case.

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

 * mpn/generic/hgcd2_jacobi.c (div1, div2): Deleted. Instead,
 include hgcd2-div.h, to reuse the tuned implementations for hgcd2.
 (mpn_hgcd2_jacobi): Adapt to different return value for div1. Also
 other small changes to make it identical to mpn_hgcd2, except for
 the updates of the jacobi-related state.

 * mpn/generic/hgcd2.c (div1, div2): Move inline functions...
 * mpn/generic/hgcd2-div.h: ... to a separate file.

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.

 * printf/doprnt.c: Use __GMP_FREE_FUNC_TYPE.
 * printf/doprntf.c: Likewise.
 * printf/snprntffuns.c: Likewise, and use size_t instead of int.

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

 * tests/mpz/t-bin.c: Extended tests for bin_ui and uint border cases.

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

 * mpn/x86/fat/fat.c (__gmpn_cpuvec_init): Fix old pentium recog.
 * config.guess: Likewise.

 * mpn/x86/fat/fat.c (__gmpn_cpuvec_init): Add many 64-bit CPUs.

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

 * mpn/arm: Revert last change, it hides a symbol needed for testing.

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

 * bdiv_q_1.asm (binvert_limb_table): Declare as ".hidden".
 * v7a/cora8/bdiv_q_1.asm: Likewise.
 * dive_1.asm: Likewise.
 * v6/dive_1.asm: Likewise.

 * mode1o.asm (binvert_limb_table): Remove ".protected", add ".hidden".
 * v6/mode1o.asm: Likewise.

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

 * mpn/powerpc64/mode64/divrem_2.asm: Use different rlwinm variant (to
 appease clang).

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

 * mpn/powerpc32/powerpc-defs.m4: Define maddld, maddhdu, popcntd, and
 divdeu.
 * mpn/powerpc64/mode64/p8/invert_limb.asm: Use new insn defs.
 * mpn/powerpc64/mode64/p9/addmul_1.asm: Use new insn defs.
 * mpn/powerpc64/p7/hamdist.asm: Use new insn defs.
 * mpn/powerpc64/p7/popcount.asm: Use new insn defs.

2017-12-31  Torbjörn Granlund  <tg@gmplib.org>

 * mpn/powerpc64/mode64/p9/addmul_1.asm: Moved from
 mpn/powerpc64/p9/addmul_1.asm.

2017-12-30 Marco Bodrato <bodrato@mail.dm.unipi.it>

 * mpz/bin_ui.c: Rewrite, using Fredrik Johansson's suggestions.

2017-12-27  Niels Möller  <nisse@lysator.liu.se>

 * longlong.h (arm32/arm64): Leave COUNT_LEADING_ZEROS_0 undefined,
 since we use gcc's __builtin_clzl, which doesn't allow zero inputs.

2017-12-27  Torbjörn Granlund  <tg@gmplib.org>

 * mpn/powerpc64/mode64/bdiv_q_1.asm: Use 64-bit cmp for sizes.

 * mpn/powerpc64/p9/addmul_1.asm: New file.

 * configure.ac: Separate handling of POWER8 and POWER9.

 * config.guess: Recognise POWER9 and more variants of POWER8.
 Reorder recog code to favour PVR over proc/cpuinfo.

2017-12-14  Torbjörn Granlund  <tg@gmplib.org>

 * mpn/x86_64/fastsse/com.asm: Adhere to DOS64 xmm callee-saves rules.
 * mpn/x86_64/fastsse/com-palignr.asm: Likewise.
 * mpn/x86_64/fastsse/copyd.asm: Likewise.
 * mpn/x86_64/fastsse/copyi.asm: Likewise.
 * mpn/x86_64/fastsse/lshiftc.asm: Likewise.
 * mpn/x86_64/fastsse/sec_tabselect.asm: Likewise.

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

 * mpn/x86_64/bd1/aorrlsh_n.asm: New grabber file.

2017-12-10  Torbjörn Granlund  <tg@gmplib.org>

 * mpn/x86_64/bd1/aors_n.asm: New grabber file.

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

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

 * mpn/sparc32/sparc-defs.m4 (LEA64): Rewrite for both PIC and non-PIC.

 * mpn/sparc64/ultrasparct3/cnd_aors_n.asm: Allow arbitrary cnd arg.

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

 * mpn/x86_64/silvermont/gmp-mparam.h: Disable mul_2 and addmul_2.

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

 * mpn/sparc64: Revert 2017-07-23 PIC changes.

 * mpn/powerpc32/divrem_2.asm: Avoid bc+ insn form to accommodate clang.

 * mpn/generic/sbpi1_bdiv_qr.c: Correct ASSERT.
 * mpn/generic/sbpi1_bdiv_q.c: Likewise.
 * mpn/generic/sbpi1_bdiv_r.c: Likewise.

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

 * acinclude.m4 (X86_64_PATTERN): Match zen*.

 * configure.ac (x86): Support AVX challenged systems for Zen.

2017-07-24  Torbjörn Granlund  <tg@gmplib.org>

 * mpn/generic/sbpi1_bdiv_q.c: Add ASSERT for inverse correctness.
 * mpn/generic/sbpi1_bdiv_qr.c: Likewise.

 * tests/mpn/t-bdiv.c (main): Amend last change.

 * tests/devel/try.c (choice_array): Amend 2013-05-03 change to include
 more functions.

2017-07-23  Torbjörn Granlund  <tg@gmplib.org>

 * mpn/sparc64/gcd_1.asm: Enforce PIC as GNU/Linux toolchain workaround.
 * mpn/sparc64/ultrasparct3/bdiv_q_1.asm: Likewise.
 * mpn/sparc64/ultrasparct3/dive_1.asm: Likewise.
 * mpn/sparc64/ultrasparct3/invert_limb.asm: Likewise.
 * mpn/sparc64/ultrasparct3/mode1o.asm: Likewise.

 * gmp-impl.h: Reorganise foolshC_ip1 -> foolshC -> foolsh chain to make
 it transitive.

2017-07-23  Niels Möller  <nisse@lysator.liu.se>

 * longlong.h: Purge definitions of obsolete UMUL_TIME and
 UDIV_TIME constants. Also mentioned (but unused) in
 mpn/cray/gmp-mparam.h and tune/common.c.

2017-07-21  Torbjörn Granlund  <tg@gmplib.org>

 * tests/mpn/t-bdiv.c (main): Test mpn_sbpi1_bdiv_r.

 * tune/common.c (speed_mpn_sbpi1_bdiv_r): New function.
 * tune/speed.h: Declare it.
 (SPEED_ROUTINE_MPN_PI1_BDIV_R): New macro.
 * tune/speed.c (routine): Add mpn_sbpi1_bdiv_r.

2017-07-20  Torbjörn Granlund  <tg@gmplib.org>

 * configure.ac (gmp_mpn_functions): Add sbpi1_bdiv_r.

 * gmp-impl.h (mpn_sbpi1_bdiv_r): Declare.

 * mpn/asm-defs.m4 (define_mpn): Add sbpi1_bdiv_q, sbpi1_bdiv_qr,
 sbpi1_bdiv_r.

 * mpn/generic/sbpi1_bdiv_r.c: New file.
 * mpn/x86_64/zen/sbpi1_bdiv_r.asm: New file.

2017-07-19  Torbjörn Granlund  <tg@gmplib.org>

 * mpn/x86/p6/sse2/submul_1.asm: Get pentium4 code instead of k6 code
 for better speed on modern Intel P6 cores.

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

 * tune/tuneup.c (tune_mullo): For MULLO_BASECASE_THRESHOLD start at 2.
 (tune_sqrlo): Likewise.

2017-06-28  Torbjörn Granlund  <tg@gmplib.org>

 * tests/Makefile.am tests/*/Makefile.am tune/Makefile.am (AM_LDFLAGS):
 Define.  (Thanks to Emmanuel Thomé and Vincent Lefevre.)

2017-06-27  Torbjörn Granlund  <tg@gmplib.org>

 * mpn/x86_64/zen/sqr_basecase.asm: Expand to use 4 addmul_1 loops.

 * mpn/x86_64/x86_64-defs.m4 (sarx): New macro.

2017-06-26  Torbjörn Granlund  <tg@gmplib.org>

 * mpn/x86_64/coreibwl/sqr_basecase.asm: Rewrite to do 2x and limb
 squaring in main loop.

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

 * mpn/x86_64/atom/cnd_add_n.asm: New grabber file.
 * mpn/x86_64/atom/cnd_sub_n.asm: Likewise.

 * mpn/x86_64/coreihwl/aorrlsh_n.asm: New grabber file.

2017-06-16  Torbjörn Granlund  <tg@gmplib.org>

 * mpn/x86_64/zen/mul_basecase.asm: Do overlapped software pipelining.

 * mpn/x86_64/silvermont/mul_basecase.asm: New grabber file.
 * mpn/x86_64/silvermont/sqr_basecase.asm: Likewise.
 * mpn/x86_64/silvermont/mullo_basecase.asm: Likewise.

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

 * mpn/x86_64/zen/mullo_basecase.asm: New file.
 * mpn/x86_64/coreibwl/mullo_basecase.asm: New file.

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

 * mpn/x86_64/popham.asm: Crossjump for code size and mix lead-in insns
 for lower overhead.

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

 * configure.ac: Set GMP_NONSTD_ABI protecting against dots in the abi.
 (hppa): Remove old GNU/Linux restriction to 32-bit ABI.

2017-06-07  Torbjörn Granlund  <tg@gmplib.org>

 * mpn/x86_64/bd1/addmul_2.asm: New file.

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

 * mpn/x86_64/coreihwl/aors_n.asm: New file.

 * mpn/x86_64/x86_64-defs.m4 (c4_helper): New macro.
 (mulx, shlx, shrx): Use c4_helper.

 * mpn/x86_64/zen/mul_basecase.asm: Use 8-bit imm operands for "test".

 * mpn/x86_64/zen/aorrlsh1_n.asm: New grabber file.
 * mpn/x86_64/zen/sublsh1_n.asm: Likewise.
 * mpn/x86_64/zen/aorrlsh_n.asm: New file

2017-06-04  Torbjörn Granlund  <tg@gmplib.org>

 * configure.ac: Use bt1/bt2 for bobcat and jaguar dirs.
 (fat_path): Add x86_64/bt2.

 * mpn/x86_64/fat/fat.c (__gmpn_cpuvec_init): Adapt to bt1/bt2 changes.
 Make zen path correspond to non-fat path.
 * mpn/x86/fat/fat.c (__gmpn_cpuvec_init): Adapt to bt1/bt2 changes.

 * mpn/x86_64/bt2/copyi.asm: New grabber file.
 * mpn/x86_64/bt2/copyd.asm: New grabber file.
 * mpn/x86_64/bt2/com.asm: New grabber file.

2017-06-03  Torbjörn Granlund  <tg@gmplib.org>

 * mpn/x86_64/bd1/popcount.asm: Expand some instructions as .byte
 sequences.
 * mpn/x86_64/bd1/hamdist.asm: Likewise.

2017-06-02  Torbjörn Granlund  <tg@gmplib.org>

 * mpn/x86_64/x86_64-defs.m4 (DEF_OBJECT): Fix quoting (amends recent
 change).
 (JUMPTABSECT): Get rid of spurious "w".

2017-06-02  Marc Glisse  <marc.glisse@inria.fr>

 * gmpxx.h (mpf_class::operator bool): Use mpf_sgn to access _mp_size.

2017-06-02  Torbjörn Granlund  <tg@gmplib.org>

 * mpn/x86_64/bd1/popcount.asm: Use both SSE and XOP trickery, and
 plain popcnt insn.
 * mpn/x86_64/bd1/hamdist.asm: Likewise.

2017-06-01  Torbjörn Granlund  <tg@gmplib.org>

 * mpn/x86_64/x86_64-defs.m4 (DEF_OBJECT): Allow 3rd argument defining
 section, while making alignment argument non-optional.

 * mpn/x86_64/core2/popcount.asm: Use 3-operand DEF_OBJECT.
 * mpn/x86_64/core2/hamdist.asm: Likewise.
 * mpn/x86_64/bd1/popcount.asm: Likewise.
 * mpn/x86_64/bd1/hamdist.asm: Likewise.

 * configure.ac (GMP_AVX_NOT_REALLY_AVAILABLE): New m4 define.
 * mpn/x86_64/bd1/popcount.asm: Use GMP_AVX_NOT_REALLY_AVAILABLE.
 * mpn/x86_64/bd1/hamdist.asm: Likewise.

 * mpn/x86_64/silvermont/popcount.asm: Reinstate, grabbing nehalem code.
 * mpn/x86_64/silvermont/hamdist.asm: Replace with grabber.

2017-05-31  Torbjörn Granlund  <tg@gmplib.org>

 * mpn/x86_64/silvermont/popcount.asm: Remove.

 * mpn/x86_64/core2/logops_n.asm: New file.

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

 * mpn/x86_64/coreisbr/popcount.asm: Remove.

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

 * mpn/x86_64/coreinhm/popcount.asm: Replace grabber code with
 implementation proper.
 * mpn/x86_64/coreinhm/hamdist.asm: Likewise.
 * mpn/x86_64/bd1/popcount.asm: Likewise.
 * mpn/x86_64/bd1/hamdist.asm: Likewise.
 * mpn/x86_64/core2/popcount.asm: Likewise.
 * mpn/x86_64/core2/hamdist.asm: New file.

2017-05-22  Torbjörn Granlund  <tg@gmplib.org>

 * mpn/x86_64/core2/com.asm: New grabber file.

 * mpn/x86_64/core2/lshift.asm: Rewrite.
 * mpn/x86_64/core2/rshift.asm: Rewrite.
 * mpn/x86_64/core2/lshiftc.asm: Rewrite.

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

 * mpn/x86_64/zen/mul_1.asm: Port to DOS64.
 * mpn/x86_64/zen/aorsmul_1.asm: Likewise.
 * mpn/x86_64/coreibwl/addmul_1.asm: Likewise.

2017-05-16  Niels Möller  <nisse@lysator.liu.se>

 * mpn/generic/divis.c (mpn_divisible_p): Updated the divisibility
 test; bdiv now returns R = D rather than R = 0 when D divides a
 non-zero U.

 * mpn/generic/binvert.c (mpn_binvert): Negate bdiv quotient.
 * mpn/generic/divexact.c (mpn_divexact): Likewise.
 * mpn/generic/remove.c (mpn_remove): Likewise.
 * mpz/bin_uiui.c (mpz_bdiv_bin_uiui): Likewise.

 * tests/mpn/t-bdiv.c (check_one): Updated to new convention,
 B^{qn} R = U + QD.

 * mpn/generic/sbpi1_bdiv_qr.c (mpn_sbpi1_bdiv_qr): Reimplemented,
 for new bdiv convention.
 * mpn/generic/sbpi1_bdiv_q.c (mpn_sbpi1_bdiv_q): Likewise.
 * mpn/generic/dcpi1_bdiv_q.c (mpn_dcpi1_bdiv_q_n)
 (mpn_dcpi1_bdiv_q): Adapted to new bdiv convention.
 * mpn/generic/dcpi1_bdiv_qr.c (mpn_dcpi1_bdiv_qr_n)
 (mpn_dcpi1_bdiv_qr): Likewise.
 * mpn/generic/mu_bdiv_qr.c (mpn_mu_bdiv_qr): Adapted to new bdiv
 convention, using a wrapper calling the old function.
 * mpn/generic/mu_bdiv_q.c (mpn_mu_bdiv_q): Likewise.

2017-05-03  Torbjörn Granlund  <tg@gmplib.org>

 * mpn/x86_64/coreisbr/cnd_aors_n.asm: New file.
 * mpn/x86_64/coreisbr/cnd_add_n.asm: New file.

 * mpn/x86_64/core2/aorsmul_1.asm: Tune.

 * mpn/x86_64/silvermont/mul_1.asm: New file, grabbing another asm file.
 * mpn/x86_64/silvermont/aorsmul_1.asm: Likewise.
 * mpn/x86_64/silvermont/aorrlsh1_n.asm: Likewise.
 * mpn/x86_64/silvermont/aorrlsh2_n.asm: Likewise.
 * mpn/x86_64/silvermont/lshift.asm: Likewise.
 * mpn/x86_64/silvermont/rshift.asm: Likewise.
 * mpn/x86_64/silvermont/lshiftc.asm: Likewise.

 * mpn/x86_64/zen/mul_basecase.asm: Split outer loop into 4 loops.

2017-05-02  Torbjörn Granlund  <tg@gmplib.org>

 * mpn/x86_64/zen/sqr_basecase.asm: Use .byte for encoding all mulx.
 Misc tuning.

2017-04-27  Torbjörn Granlund  <tg@gmplib.org>

 * mpn/x86_64/zen/sqr_basecase.asm: Rewrite to do 2x and limb squaring
 in main loop.

2017-04-25  Torbjörn Granlund  <tg@gmplib.org>

 * mpn/x86_64/fat/fat_entry.asm: Allocate correct DOS64 frame.
 * mpn/x86_64/divrem_2.asm: Likewise.
 * mpn/x86_64/mod_1_2.asm: Likewise.
 * mpn/x86_64/mod_1_4.asm: Likewise.
 * mpn/x86_64/mod_1_1.asm: Likewise.

2017-04-23  Torbjörn Granlund  <tg@gmplib.org>

 * mpn/x86_64/coreisbr/mul_1.asm: Rewrite feed-in code and add mul_1c
 entry point.

2017-04-17  Torbjörn Granlund  <tg@gmplib.org>

 * mpn/x86_64/fat/fat.c (__gmpn_cpuvec_init): Amend last change.

 * mpn/x86_64/zen/mul_basecase.asm: New file.
 * mpn/x86_64/zen/sqr_basecase.asm: New file.

2017-04-16  Torbjörn Granlund  <tg@gmplib.org>

 * mpn/generic/sqr_basecase.c (addmul_1 variant): Rewrite to compute
 in-place and to avoid a re-computation.

 * configure.ac: Remove k8, k10 from zen path.

2017-04-15  Torbjörn Granlund  <tg@gmplib.org>

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

 * mpn/x86_64/zen/com.asm: New file, grabbing another asm file.
 * mpn/x86_64/zen/copyd.asm: Likewise.
 * mpn/x86_64/zen/copyi.asm: Likewise.
 * mpn/x86_64/zen/gcd_1.asm: Likewise.
 * mpn/x86_64/zen/hamdist.asm: Likewise.
 * mpn/x86_64/zen/lshift.asm: Likewise.
 * mpn/x86_64/zen/lshiftc.asm: Likewise.
 * mpn/x86_64/zen/popcount.asm: Likewise.
 * mpn/x86_64/zen/rshift.asm: Likewise.

 * config.guess: Recognise AMD zen.
 * acinclude.m4 (X86_64_PATTERN): Add zen.
 * config.sub: Corresponding changes.
 * configure.ac: Corresponding changes.
 * mpn/x86_64/fat/fat.c: Corresponding changes.

2017-03-27 Marco Bodrato <bodrato@mail.dm.unipi.it>

 * mpz/oddfac_1.c (limb_apprsqrt): Better approximation.
 * mpz/bin_uiui.c (limb_apprsqrt): Likewise.

2017-03-12  Torbjörn Granlund  <tg@gmplib.org>

 * tests/mpf/t-get_d_2exp.c (check_data): Rewrite of check_onebit.

2017-03-08 Marco Bodrato <bodrato@mail.dm.unipi.it>

 * mpn/generic/sqrtrem.c: Direct use of sqrtrem2 when n==2.
 * mpn/generic/div_qr_2.c (udiv_qr_4by2): Replace add_csaac with add_sssaaaa.

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

 * mpf/get_d_2exp.c: Return negative value for negative input.

2017-03-06  Torbjörn Granlund  <tg@gmplib.org>

 * longlong.h (aarch64): Provide asm-free umul_ppmm.
 * longlong.h (powerpc64): Enable asm-free umul_ppmm.

2017-03-04  Torbjörn Granlund  <tg@gmplib.org>

 * mpn/arm64/sqr_diag_addlsh1.asm: Complete rewrite.

2017-02-27  Torbjörn Granlund  <tg@gmplib.org>

 * longlong.h (arm32/arm64): Remove useless comparison to 0 introduced
 in last change (spotted by Marco).

2017-02-26 Marco Bodrato <bodrato@mail.dm.unipi.it>

 * mpn/generic/pow_1.c: Use umul_ppmm for a single limb.

2017-02-25  Torbjörn Granlund  <tg@gmplib.org>

 * configure.ac: Allow MP_SIZE_T_MAX for thresholds exported to
 config.m4.

 * mpn/x86_64/gcd_1.asm: Handle BMOD_1_TO_MOD_1_THRESHOLD=MP_SIZE_T_MAX.
 Streamline non-reduction path.
 * mpn/x86_64/core2/gcd_1.asm: Streamline small operands cases similarly
 to top-level code.

2017-02-24  Torbjörn Granlund  <tg@gmplib.org>

 * longlong.h (arm32/arm64 add_ssaaaa): Use "subs" for some immediates.
 * longlong.h (arm32/arm64 sub_ddmmss): Use "adds" for some immediates.

 * mpn/arm64/copyi.asm: Avoid branching on flags.
 * mpn/arm64/copyd.asm: Likewise.

 * mpn/generic/div_qr_2.c (aarch64 add_sssaaaa): New.
 * mpn/generic/div_qr_1n_pi2.c: Same.
 * mpn/generic/div_qr_1u_pi2.c: Same.

 * mpn/generic/div_qr_2.c (powerpc add_sssaaaa): Fix typo.
 * mpn/generic/div_qr_1n_pi2.c: Same.
 * mpn/generic/div_qr_1u_pi2.c: Same.

2017-02-23 Marco Bodrato <bodrato@mail.dm.unipi.it>

 * tests/devel/sqrtrem_1_2.c: New exhaustive test for sqrtrem_[12].
 * tests/devel/Makefile.am (EXTRA_PROGRAMS): add it.

2017-02-23  Torbjörn Granlund  <tg@gmplib.org>

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

2017-02-22  Torbjörn Granlund  <tg@gmplib.org>

 * mpn/arm64/aorsmul_1.asm: Rewrite.

 * mpn/arm64/lshiftc.asm: New file.

2017-02-21  Torbjörn Granlund  <tg@gmplib.org>

 * mpn/arm64/lshift.asm: Rewrite.
 * mpn/arm64/rshift.asm: Rewrite.

 * mpn/arm64/rsh1aors_n.asm: New file.

2017-02-19  Torbjörn Granlund  <tg@gmplib.org>

 * mpn/arm64/mul_1.asm: Rewrite.
 * mpn/arm64/xgene1/mul_1.asm: Remove.

2017-02-17  Torbjörn Granlund  <tg@gmplib.org>

 * mpn/arm64/cora53/cnd_aors_n.asm: Moved from "..".

 * mpn/arm64/xgene1/cnd_aors_n.asm: Remove file since default code
 performs better.

 * mpn/arm64/cnd_aors_n.asm: Rewrite.

 * mpn/arm64/logops_n.asm: Rewrite based on new aors_n.asm.

2017-02-16  Pedro Gimeno  <pggimeno@wanadoo.es>

 * rand/randmt.c (__gmp_randiset_mt): Set generator functions from
 source.

2017-02-16  Torbjörn Granlund  <tg@gmplib.org>

 * mpn/arm64/aorsorrlshC_n.asm: New file.
 * mpn/arm64/aorsorrlsh2_n.asm: New file.
 * mpn/arm64/aorsorrlsh1_n.asm: New file.

 * mpn/arm64/xgene1/aors_n.asm: Remove file since default code now
 performs similarly.

 * mpn/arm64/aors_n.asm: Rewrite to use 4x unrolling.

2017-02-15  Torbjörn Granlund  <tg@gmplib.org>

 * mpn/x86_64/silvermont/hamdist.asm: New file, based on k10 code.

 * mpn/x86_64/silvermont/popcount.asm: Grab coreisbr/popcount.asm.

2017-02-14  Torbjörn Granlund  <tg@gmplib.org>

 * mpn/x86_64/silvermont/aors_n.asm: New file, grabbing coreisbr code.

 * mpn/x86_64/atom/aors_n.asm: Replace coreisbr grabbing code with
 code based on Marco's x64/atom/aors_n.asm.

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

 * mpn/powerpc64/aix.m4 (AIX): New define.

 * mpn/powerpc64/mode64/bdiv_q_1.asm: For AIX, don't jump from
 mpn_bdiv_q_1 to middle of mpn_pi1_bdiv_q_1.  Streamline.

 * mpn/powerpc64/darwin.m4 (LEA): Put code in lea_list instead of in
 EPILOGUE_cpu.
 (EPILOGUE_cpu): Output lea_list, the zap it.

 * mpn/sparc64/ultrasparct3/bdiv_q_1.asm: New file, based on dive_1.asm.

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

 * mpn/arm/v7a/cora8/bdiv_q_1.asm: New file, based on v6/dive_1.asm.
 * mpn/arm/v7a/cora9/bdiv_q_1.asm: New file, grabbing cora8 code.
 * mpn/arm/v7a/cora15/bdiv_q_1.asm: Likewise.

 * mpn/arm64/aors_n.asm: (SETCY, RETVAL): Shorten insn sequences.
 * mpn/arm64/cnd_aors_n.asm: Likewise.
 * mpn/arm64/xgene1/aors_n.asm: Likewise.
 * mpn/arm64/xgene1/cnd_aors_n.asm: Likewise.

 * mpn/arm/bdiv_q_1.asm: New file, based on dive_1.asm.

 * mpn/generic/bdiv_q_1.c (mpn_bdiv_q_1): Remove odd d special case.

 * mpn/powerpc64/mode64/bdiv_q_1.asm: New file.

 * mpn/arm64/bdiv_q_1.asm: New file.

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

 * mpn/arm/arm-defs.m4 (EPILOGUE_cpu): Zap lea_list to avoid repetition.

 * mpn/x86_64/bdiv_q_1.asm: Rewrite, base on atom/dive_1.asm.

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

 * mpn/generic/compute_powtab.c: Choose mpn_pi1_bdiv_q_1 vs
 mpn_divexact_1 more wisely (spotted by Marco).

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

 * tune/tuneup.c (relspeed_div_1_vs_mul_1): Prefer mpn_pi1_bdiv_q_1.

 * mpn/generic/compute_powtab.c: Use mpn_pi1_bdiv_q_1/mpn_bdiv_q_1
 instead of mpn_divexact_1.

 * gen-bases.c (binvert): New function, computing modular inverse and
 low zero count.
 (header): Print MP_BASES_BIG_BASE_CTZ_10 and
 MP_BASES_BIG_BASE_BINVERTED_10.

2017-02-06  Torbjörn Granlund  <tg@gmplib.org>

 * mpn/generic/bdiv_q_1.c: Make return value consistent.

 * mpn/x86/p6/mmx/gmp-mparam.h (SQR_TOOM2_THRESHOLD): Revert to bogus
 value to accommodate p6/sqr_basecase.asm fragility.

2017-01-29 Marco Bodrato <bodrato@mail.dm.unipi.it>

 * mpz/and.c: Simplify branches.
 * mpz/ior.c: Likewise.
 * mpz/xor.c: Likewise.

 * gen-bases.c: In generated file, include just gmp-impl.h, not gmp.h

2017-01-29  Torbjörn Granlund  <tg@gmplib.org>

 * configure.ac: Don't check if we got a C99 compiler for now (partially
 revert 2017-01-24 change as C++ compilers become rejected).

2017-01-24  Torbjörn Granlund  <tg@gmplib.org>

 * mpn/generic/compute_powtab.c: New file, providing mpn_compute_powtab
 for both get_str and set_str.

 * gmp-impl.h (mpn_str_powtab_alloc): New macro.
 (mpn_dc_set_str_powtab_alloc, mpn_dc_get_str_powtab_alloc): Remove.
 (mpn_compute_powtab): Declare.

 * mpn/generic/set_str.c: Use mpn_compute_powtab.
 (mpn_set_str_compute_powtab): Remove.

 * mpn/generic/get_str.c: Use mpn_compute_powtab.
 (mpn_get_str_compute_powtab): Remove.
 (mpn_bc_get_str): New name for mpn_sb_get_str.

 * configure.ac (gmp_mpn_functions): Add compute_powtab.

 * tune/tuneup.c (speed_mpn_pre_set_str): Call mpn_compute_powtab.
 * tune/set_strb.c: Remove mpn_set_str_compute_powtab name mangling.
 * tune/set_strs.c: Likewise.

 * configure.ac: Invoke AC_PROG_CC_C99 instead of AC_PROG_CC_STDC.

2017-01-03  Torbjörn Granlund  <tg@gmplib.org>

 * configure.ac (arm*-*-*): Properly point to cortex-a5 subdir.

2016-12-31  Torbjörn Granlund  <tg@gmplib.org>

 * tune/tuneup.c (relspeed_div_1_vs_mul_1): New function.

2016-12-28 Marco Bodrato <bodrato@mail.dm.unipi.it>

 * tune/common.c (speed_mpz_mfac_uiui, speed_mpz_invert): New
 functions.
 * tune/speed.h: Declare them.
 * tune/speed.c (routine): Add mpz_mfac_uiui, mpz_invert.

 * tests/mpz/t-primorial_ui.c: Add randomization to the test.
 * mpz/tdiv_r.c: Reduce allocation in some corner-case conditions.
 * mpz/tdiv_r_2exp.c: Rearrange counting non-zero limbs.
 * mpz/tdiv_q.c: Move common code out of some branches.
 * mpz/and.c: Alloc only when needed.
 * mpz/xor.c: Reorder branches.
 * mpz/gcd.c: Reorder branches.
 * mpz/pprime_p.c: Save the initial branch of a loop.
 * mpn/generic/divrem.c: Save an allocation.

2016-12-26  Torbjörn Granlund  <tg@gmplib.org>

 * longlong.h (x86_64 umul_ppmm): Add mulx variant (not automatically
 used).

2016-12-17 Marco Bodrato <bodrato@mail.dm.unipi.it>

 * mpz/gcdext.c: Save an allocation if both cofactors are needed.
 * mpz/oddfac_1.c: Revision of all ASSERTs.
 * tests/mpz/t-invert.c: All elements are invertible in the zero ring.

2016-12-13  Torbjörn Granlund  <tg@gmplib.org>

 * longlong.h: Test LONGLONG_STANDALONE in two more places.

2016-12-07  Torbjörn Granlund  <tg@gmplib.org>

 * gmp-h.in: Check yet another symbol for FILE.

2016-12-04  Torbjörn Granlund  <tg@gmplib.org>

 * tests/mpz/reuse.c: Use mpz_clobber.  Split mpz_gcdext macros to avoid
 spurious res3 dependency.

 * tests/misc.c (mpz_clobber): New function.

2016-12-03  Niels Möller  <nisse@lysator.liu.se>

 * doc/gmp.texi (Number Theoretic Functions): Tweak mpz_gcdext
 documentation. The first and third argument may be NULL, but not
 the second.

2016-12-02  Niels Möller  <nisse@lysator.liu.se>

 * tests/mpz/reuse.c (main): Test additional cases of reuse for
 mpz_gcd and mpz_gcdext.

2016-12-01  Torbjörn Granlund  <tg@gmplib.org>

 * tests/misc.c (seed_from_tod): Make shift well-defined.

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

 * gmp-h.in (__GNU_MP__): Bump.

 * mpz/inp_raw.c: Rewrite size computation to avoid overflow.

 * mpz/kronsz.c: Use ABS_CAST to avoid undefined code.

2016-11-27 Marco Bodrato <bodrato@mail.dm.unipi.it>

 * mpz/gcd.c, mpz/gcdext.c: Use NEWALLOC.
 * mpz/oddfac_1.c: Disable an ASSERT that needs a revision.

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

 * tests/mpz/reuse.c: Rewrite operand randomisation to use fixed ranges.

 * tune/time.c (cgt_works_p): Add a missing verbosity check.

 * configure.ac: Make udiv_w_sdiv use conditional on enable_assembly.

2016-11-25  Marc Glisse  <marc.glisse@inria.fr>

 * mpz/gcdext.c (mpz_gcdext): Allow a first argument of NULL.
 * doc/gmp.texi (Number Theoretic Functions): Document it.
 * tests/mpz/t-gcd.c (main): Test it.

2016-11-25  Marc Glisse  <marc.glisse@inria.fr>

 * tests/cxx/t-ops2z.cc (checkz): Avoid left shift of negative number.

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

 * configure.ac (x86): Define LINUX for GNU/Linux systems.
 * mpn/x86_64/fat/fat_entry.asm: Set PRETEND_PIC for GNU/Linux.

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

 * configure.ac (powerpc): Never use -O3.

 * acinclude.m4 (mpn_lshift_com optimization 2): Make it well-defined
 also for 32-bit systems.
 (mpn_lshift_com optimization 2): Free allocated memory.

2016-11-19  Niels Möller  <nisse@lysator.liu.se>

 * Makefile.am (check-mini-gmp): Override CFLAGS and CPPFLAGS
 instead of the deleted EXTRA_CFLAGS. Set TEST_LIBRARY_PATH,
 instead of LD_LIBRARY_PATH and DYLD_LIBRARY_PATH, to avoid getting
 gcc linked with an unexpected version of gmp.

2016-11-18  Niels Möller  <nisse@lysator.liu.se>

 * Makefile.am (check-mini-gmp): Get CC and EXTRA_CFLAGS right.

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

 * asl.h: Initial support for artificially small limbs.

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

 * pz/iset_str.c: Lazy allocation.

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

 * mpn/generic/dive_1.c: Remove a forgotten dummy while-loop.  (Spotted
 by Peter Barfuss.)

2016-10-31   Oleg Oshmyan  <chortos@inbox.lv>

 * gmp-impl.h (x86_64 MPN_IORD_U): Use proper asm constraint.

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

 * mpn/Makefile.am (TARG_DIST): Add riscv.

2016-10-28  Marc Glisse  <marc.glisse@inria.fr>

 * gmpxx.h (__gmp_binary_divides): Let 1/q call mpq_inv.
 * tests/cxx/t-ops.cc (check_mpq): Test it.

2016-10-24  Torbjörn Granlund  <tg@gmplib.org>

 * config.guess: Recognise Itanium Poulson.

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

 * configure.ac (arm*-*-*): Amend last change.

2016-10-14  Torbjörn Granlund  <tg@gmplib.org>

 * longlong.h (riscv umul_ppmm): New.

 * mpn/riscv/64/aors_n.asm: New file.
 * mpn/riscv/64/mul_1.asm: New file.
 * mpn/riscv/64/aorsmul_1.asm: New file.

 * mpn/generic/addmul_1.c: Rewrite for shallower recurrency.
 * mpn/generic/submul_1.c: Likewise.

 * configure.ac (riscv-*-*): New.
 (arm*-*-*): Rewrite arm support to handle armv8 CPUs in 32-bit mode.

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

 * All C files: Include just gmp-impl.h, make gmp-impl.h grab gmp.h.

 * mpf/get_str.c: Use __GMP_ALLOCATE_FUNC_TYPE and friends.
 * mpf/inp_str.c: Likewise.
 * mpq/get_str.c: Likewise.
 * mpz/get_str.c: Likewise.
 * mpz/inp_str.c: Likewise.
 * scanf/vsscanf.c: Likewise.
 * tal-reent.c: Likewise.

2016-08-24  Vlad Zakharov <vzakhar@synopsys.com>

 * longlong.h (arc add_ssaaaa, sub_ddmmss): Replace obsolete 'J'
 constraint with 'Cal'.

2016-08-22  Marc Glisse  <marc.glisse@inria.fr>

 * longlong.h (umul_ppmm from __umulsidi3): Protect with do ...
 while (0).

2016-06-02  Torbjörn Granlund  <tg@gmplib.org>
     Vincent Lefevre <vincent@vinc17.net>

 * doc/gmp.texi: Various clarifications about variable conventions.

2016-04-07  Marc Glisse  <marc.glisse@inria.fr>

 * gmp-h.in (__GMP_NOTHROW): Prefer noexcept to throw().
 (mpz_init, mpz_inits): Mark as __GMP_NOTHROW.
 * mpz/init.c, mpz/inits.c: Likewise.
 * gmpxx.h (mpz_class): Mark default and move constructors noexcept.
 * tests/cxx/t-cxx11.cc: Check noexcept.

2016-04-02  Torbjörn Granlund  <torbjorng@google.com>

 * mpf/set_q.c: Rewrite, mainly to use mpn_div_q.

2016-03-29  Torbjörn Granlund  <torbjorng@google.com>

 * mpn/x86_64/fat/addmul_2.c: New file.

2016-03-28  Torbjörn Granlund  <torbjorng@google.com>

 * mpn/x86_64/addmul_2.asm: Move from here...
 * mpn/x86_64/k8/addmul_2.asm: ...to here.

2016-03-26  Torbjörn Granlund  <torbjorng@google.com>

 * mpn/arm64/sqr_diag_addlsh1.asm: New file.

2016-03-25  Torbjörn Granlund  <torbjorng@google.com>

 * mpn/arm64/xgene1/aors_n.asm: New file.
 * mpn/arm64/xgene1/aorsmul_1.asm: New file.
 * mpn/arm64/xgene1/cnd_aors_n.asm: New file.
 * mpn/arm64/xgene1/gmp-mparam.h: New file.
 * mpn/arm64/xgene1/mul_1.asm: New file.

 * config.guess: Prefix all arm CPUs with "arm" to accommodate our
 matchers.
 * configure.ac (arm): Match arm CPUs consistently.

2016-03-21  Torbjörn Granlund  <torbjorng@google.com>

 * configure.ac: Support many arm64 processors.

2016-03-20  Marc Glisse  <marc.glisse@inria.fr>

 * configure.ac (WANT_ASSEMBLY): Remove.
 (NO_ASM): Remove from CFLAGS, add to AC_DEFINE.
 * tests/misc.c: Test NO_ASM instead of WANT_ASSEMBLY.

2016-03-20  Torbjörn Granlund  <torbjorng@google.com>

 * config.guess (arm*): Handle big.LITTLE CPUs by extracting the
 lexically largest id.
 * config.guess (arm*): Add many aarch64 CPUs.
 * config.guess (main): Corresponding changes.

 * mpn/arm/v7a/cora5/gmp-mparam.h: New file.

 * configure.ac (arm*): Support cortex-a5 better.

2016-02-25  Pavel Kopyl  <p.kopyl@samsung.com>

 * acinclude.m4 (GMP_ASM_UNDERSCORE): Tighten gurkmacka detection.

2016-01-27  Niels Möller  <nisse@lysator.liu.se>

 * errno.c (__gmp_exception): Use raise(SIGFPE) when available.

2016-01-15  Torbjörn Granlund  <torbjorng@google.com>

 * config.guess (s390): Don't assume /proc/cpuinfo exists.

2016-01-13  Torbjörn Granlund  <torbjorng@google.com>

 * config.guess: Reorder and generalise ppc code.

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

 * tests/cxx/clocale.c: Do not re-define localeconv for mingw.
 * tests/misc/t-locale.c: Likewise (Thanks Alexander).

 * primesieve.c: Heal a speed regression on small values.
 * mpz/bin_uiui.c (mpz_bdiv_bin_uiui): 2 factors all at once.
   (mpz_goetgheluck_bin_uiui): Use STOP/CONT for loops on primesieve.
 * mpz/oddfac_1.c: Likewise.
 * mpz/primorial_ui.c (LOOP_ON_SIEVE_CONTINUE): Define prime locally.

 * gen-fac.c: Use unsigned types for sizes.

 * mpn/generic/invert.c: Use MPN_FILL macro.
 * mpn/generic/invertappr.c: Likewise.
 * mpn/generic/toom53_mul.c: Use _ip1 when available.

2015-12-28 Marco Bodrato <bodrato@mail.dm.unipi.it>

 * mpq/set_str.c: Use __GMP_FREE_FUNC_TYPE.
 * tests/mpz/t-nextprime.c: Speedup using swap, and correct type.

2015-12-26  Torbjörn Granlund  <torbjorng@google.com>

 * tests/misc.c (tests_start): Assert library version.

2015-12-19  Marc Glisse  <marc.glisse@inria.fr>

 * gmp-impl.h (fft_table_nk): Use gmp_uint_least32_t.
 * mpn/generic/trialdiv.c (gmp_primes_ptab): Likewise.

2015-12-14  Torbjörn Granlund  <torbjorng@google.com>

 * mpn/x86_64/fat/fat.c (gmp_workaround_skylake_cpuid_bug):
 New function.
 (__gmpn_cpuvec_init): Handle more BMI2 crippled CPUs.

2015-12-13 Marco Bodrato <bodrato@mail.dm.unipi.it>

 * mpf/clears.c, mpf/inits.c, mpq/clears.c, mpq/inits.c,
 * mpz/clears.c, mpz/inits.c: Stop supporting empty list.
 * tests/arm32call.asm: bx->ret to support thumb-less chips
   (thanks Martin Husemann).

2015-12-13  Torbjörn Granlund  <torbjorng@google.com>

 * config.sub: Fix spelling of kabylake.
 * acinclude.m4: Likewise.
 * mpn/x86_64/fat/fat.c: Likewise.

2015-12-10 Marco Bodrato <bodrato@mail.dm.unipi.it>

 * tests/misc/t-printf.c: Test a sequence of '%'.
 * printf/doprnt.c: Avoid buffer overread with long long limbs.

 * mpn/generic/toom_interpolate_7.c: Use the rsh1 functions,
   when available, also for negatives (clearing the carry).
 * mpn/generic/toom_interpolate_12.c: Likewise.
 * mpn/generic/toom_interpolate_16.c: Likewise.

2015-12-06  Torbjörn Granlund  <torbjorng@google.com>

 * configure.ac (arm*): Conditionally define NOTHUMB.
 Simplify and generalise.
 * mpn/arm/arm-defs.m4 (ret): New macro, conditional on NOTHUMB.
 * mpn/arm/*.asm: Use ret.

2015-12-03  Torbjörn Granlund  <torbjorng@google.com>

 * config.guess: Work around skylake cpuid bug.
 Fix spelling of kabylake.

2015-12-01  Torbjörn Granlund  <torbjorng@google.com>

 * mpn/x86_64/coreibwl/mul_basecase.asm: Add FUNC_EXITs.

2015-11-21 Marco Bodrato <bodrato@mail.dm.unipi.it>

 * gmp-impl.h (MPN_TOOM22_MUL_MINSIZE): Consider ToomX2 limits
   (thanks Paul).
 * tests/mpn/t-toom22.c: Keep on testing small sizes.
 * tests/mpz/t-primorial_ui.c: Test a single "large" number.

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

 * primesieve.c: Use two presieved patterns on 64-bits CPUs.

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

 * mpq/init.c: Remove conditional code for __CHECKER__.
 * mpq/set.c: Shorten scope of local variables.
 * mpq/set_den.c: Likewise.
 * mpq/set_num.c: Likewise.
 * mpq/set_z.c: Likewise.

 * primesieve.c: Fill sieve with a presieved 70bits pattern.

2015-11-12  Marc Glisse  <marc.glisse@inria.fr>

 * gmpxx.h (__gmp_fibonacci_function): New class.
 (fibonacci, mpz_class::fibonacci): New functions.
 (__gmp_fac_function, __gmp_primorial_function): Add braces.
 * tests/cxx/t-ops2z.cc: Test fibonacci.
 * doc/gmp.texi (C++ Interface Integers): Document fibonacci.
 Warn about factorial and primorial of negative numbers.

2015-11-10  Marc Glisse  <marc.glisse@inria.fr>

 * gmpxx.h (__gmp_primorial_function): Throw on negative operands.
 * tests/cxx/t-ops2z.cc: Test it.

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

 * mpz: Experimental, lazy allocation.

2015-11-09  Marc Glisse  <marc.glisse@inria.fr>

 * tests/cxx/Makefile.am: Move EXTRA_DIST out of WANT_CXX.

2015-11-08 Marco Bodrato <bodrato@mail.dm.unipi.it>

 * mpz/urandomm.c: Use mpn_zero_p to shorten code.

2015-11-08  Marc Glisse  <marc.glisse@inria.fr>

 * gmpxx.h (__gmp_fac_function, __gmp_primorial_function): New classes.
 (__GMPP_DECLARE_UNARY_STATIC_MEMFUN,
 __GMPNN_DECLARE_UNARY_STATIC_MEMFUN,
 __GMPNS_DECLARE_UNARY_STATIC_MEMFUN,
 __GMPNU_DECLARE_UNARY_STATIC_MEMFUN,
 __GMPND_DECLARE_UNARY_STATIC_MEMFUN,
 __GMPN_DECLARE_UNARY_STATIC_MEMFUN,
 __GMP_DECLARE_UNARY_STATIC_MEMFUN, __GMPP_DEFINE_UNARY_STATIC_MEMFUN,
 __GMPNN_DEFINE_UNARY_STATIC_MEMFUN,
 __GMPNS_DEFINE_UNARY_STATIC_MEMFUN,
 __GMPNU_DEFINE_UNARY_STATIC_MEMFUN,
 __GMPND_DEFINE_UNARY_STATIC_MEMFUN, __GMPN_DEFINE_UNARY_STATIC_MEMFUN,
 __GMP_DEFINE_UNARY_STATIC_MEMFUN): New macros.
 (factorial, mpz_class::factorial, primorial, mpz_class::primorial):
 New functions.
 * tests/cxx/t-ops2.cc: Test factorial and primorial.
 * tests/cxx/Makefile.am: Move t-ops2 after
 t-do-exceptions-work-at-all-with-this-compiler.
 * doc/gmp.texi: Document factorial and primorial.
 * NEWS: Likewise.

 * tests/cxx/t-ops2.cc: Remove and split into ...
 * tests/cxx/t-ops2z.cc, tests/cxx/t-ops2qf.cc, tests/cxx/t-ops2f.cc,
 tests/cxx/t-ops2.h: New files.
 * tests/cxx/Makefile.am: Update for the split.

2015-11-07  Marc Glisse  <marc.glisse@inria.fr>

 * gmpxx.h (__GMP_DEFINE_UNARY_FUNCTION_1,
 __GMPP_DEFINE_BINARY_FUNCTION_1, __GMPNN_DEFINE_BINARY_FUNCTION_1,
 __GMPNS_DEFINE_BINARY_FUNCTION_1, __GMPNU_DEFINE_BINARY_FUNCTION_1,
 __GMPND_DEFINE_BINARY_FUNCTION_1, __GMPNLD_DEFINE_BINARY_FUNCTION_1,
 __GMPN_DEFINE_BINARY_FUNCTION_1, __GMP_DEFINE_BINARY_FUNCTION_1):
 New macros.
 (operator~, trunc, floor, ceil, sqrt, operator%, operator&, operator|,
 operator^, hypot, gcd, lcm): Use them.

2015-11-06 Marco Bodrato <bodrato@mail.dm.unipi.it>

 * mpz/and.c: Use MPZ_NEWALLOC.
 * mpz/ior.c: Remove duplicated branches, add branch hints.
 * mpz/xor.c: Likewise, and use NORMALIZE_NOT_ZERO.

 * mpz/init.c: Remove conditional code for __CHECKER__.
 * mpz/init2.c: Likewise.
 * mpz/inits.c: Likewise.
 * mpz/iset.c: Likewise.
 * mpz/iset_str.c: Likewise.

2015-11-04  Torbjörn Granlund  <torbjorng@google.com>

 * mpz/xor.c: Use MPZ_REALLOC.
 * mpz/ior.c: Likewise

2015-11-03 Marco Bodrato <bodrato@mail.dm.unipi.it>

 * mpz/xor.c: Use the return value of _mpz_realloc.
 * mpz/ior.c: Likewise.
 * mpn/generic/sec_div.c: Remove unused var.

2015-11-01  Torbjörn Granlund  <torbjorng@google.com>

 * tests/misc.c (seed_from_tod, seed_from_urandom): New functions.
 (tests_rand_start): Use them.

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

 * Version 6.1.0 released.

 * mpz/inits.c [__CHECKER__]: Init limb, not pointer.
 * mpz/init.c [__CHECKER__]: Likewise (spotted by Vicente Benjumea).
 * tests/mpf/t-pow_ui.c: Use another mpf for the size limit.

2015-10-30  Torbjörn Granlund  <torbjorng@google.com>

 * mpf/pow_ui.c: Add log(e) precision bits.

 * doc/gmp.texi (Floating-point): Rewrite mpf introduction.

2015-10-29 Marco Bodrato <bodrato@mail.dm.unipi.it>

 * demos/factorize.c: mpz_div_2exp => mpz_tdiv_q_2exp.
 * demos/perl/GMP.xs: Likewise.
 * tests/mpf/t-pow_ui.c: Use reference value to check the size.

 * doc/gmp.texi (Floating-point): Remove "infinite precision" claim.

 * gmp-h.in: Update version.

2015-10-28  Torbjörn Granlund  <torbjorng@google.com>

 * tests/mpf/t-pow_ui.c: New file.
 * tests/mpf/Makefile.am (check_PROGRAMS): Compile it.

 * mpf/pow_ui.c: Rewrite for accuracy and performance.

2015-10-26 Marco Bodrato <bodrato@mail.dm.unipi.it>

 * configfsf.guess: Updated to version 2015-10-21, for a typo.

 * tests/cxx/t-ops.cc (check_mpq): Compare also with mpz.
 (check_mpf): Compare also with mpz and mpq.

2015-10-25  Torbjörn Granlund  <torbjorng@google.com>

 * configure.ac: Avoid passing ambiguous -march=skylake.

2015-10-21 Marco Bodrato <bodrato@mail.dm.unipi.it>

 * Version 6.1.0-rc1 published.

 * gmp-h.in: Revert version for RC.

2015-10-20  Torbjörn Granlund  <torbjorng@google.com>

 * mpn/x86/pentium4/sse2/popcount.asm: Use LEAL.
 * mpn/x86/k7/invert_limb.asm: Likewise.

2015-10-18  Torbjörn Granlund  <torbjorng@google.com>

 * mpn/arm64/gmp-mparam.h: New file.

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

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

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

 * tests/mpf/t-cmp_si.c: Initialise a variable (only when error arise)
 * mpn/generic/toom43_mul.c: Insert parentheses around & expressions.
 * mpn/generic/toom52_mul.c: Likewise.
 * tests/mpn/t-minvert.c: Remove an unused var.
 * tests/mpz/t-cong_2exp.c: Likewise.

2015-10-16  Hans Wennborg <hwennborg at google.com>

 * mpn/generic/div_qr_2.c: Insert parentheses around & expressions.
 * mpn/generic/toom44_mul.c: Likewise.
 * mpn/generic/toom53_mul.c: Likewise.
 * mpn/generic/toom62_mul.c: Likewise.
 * tests/mpn/t-bdiv.c: Simplify conditional printing of whitespace.
 * tests/mpn/t-div.c: Likewise.

2015-10-15 Marco Bodrato <bodrato@mail.dm.unipi.it>

 * configfsf.sub: Updated to version 2015-08-20, from gnulib.
 * configfsf.guess: Updated to version 2015-09-14, from gnulib.

2015-10-14  Torbjörn Granlund  <torbjorng@google.com>

 * demos/pexpr.c (main): Clear out a variable.

 * mpn/generic/sqrlo_basecase.c: Move things before addmul_1 to reduce
 register pressure.

 * .hgignore: Add 'compile' and 'test-driver'.

 * mpn/generic/mu_bdiv_qr.c (mpn_mu_bdiv_qr_itch): Simplify, add ASSERT.
 * mpn/generic/mu_bdiv_q.c (mpn_mu_bdiv_q_itch): Likewise.

 * tune/tuneup.c (tune_mu_bdiv): Start at measured BDIV_DC_ thresholds.

2015-10-13 Marco Bodrato <bodrato@mail.dm.unipi.it>

 * mpf/clears.c, mpf/inits.c, mpq/clears.c, mpq/inits.c,
 * mpz/clears.c, mpz/inits.c: Keep on supporting empty list.

2015-10-13  Marc Glisse  <marc.glisse@inria.fr>

 * gmpxx.h (__GMPP_DEFINE_BINARY_TYPE_FUNCTION): Allow mixed operations.
 (__gmp_cmp_function, __gmp_binary_equal, __gmp_binary_less):
 Handle mixed operations.
 (__gmp_cmp_function): Move before __gmp_binary_equal.

2015-10-13 Marco Bodrato <bodrato@mail.dm.unipi.it>

 * mpf/pow_ui.c: Increased precision of partial results.

2015-10-12  Torbjörn Granlund  <torbjorng@google.com>

 * configure.ac: Reject AVX for NetBSD.

2015-10-11  Torbjörn Granlund  <torbjorng@google.com>

 * configure.ac (fat_path): Add skylake.

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

 * gen-fib.c: Correct the name of the program in error message.
 * gen-fac.c: Likewise.

 * mpf/get_str.c: Increase precision of base^e computation.

2015-10-09  Torbjörn Granlund  <torbjorng@google.com>

 * config.guess: Recognise cabylake and goldmont and more versions of
 skylake and silvermont.
 * acinclude.m4 (X86_64_PATTERN): Add cabylake and goldmont.
 * config.sub: Corresponding changes.
 * configure.ac: Corresponding changes.
 * mpn/x86_64/fat/fat.c: Corresponding changes.

2015-09-12  Torbjörn Granlund  <torbjorng@google.com>

 * mpf/clear.c, mpf/clears.c, mpf/inits.c, mpq/clear.c, mpq/clears.c
 * mpq/inits.c, mpz/clear.c, mpz/clears.c, mpz/inits.c:
 Streamline, use macros.

2015-09-27 Marco Bodrato <bodrato@mail.dm.unipi.it>

 * mpz/cfdiv_r_2exp.c: Use mpn_neg and MPZ_NEWALLOC.
 * mpz/cfdiv_q_2exp.c: Use MPZ_REALLOC return value.

2015-09-12  Torbjörn Granlund  <torbjorng@google.com>

 * tests/mpf/t-cmp_si.c (check_data): Set precision reflecting data.

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

 * mpf/cmp_z.c: New file implementing mpf_cmp_z.
 * mpf/Makefile.am (libmpf_la_SOURCES): Add it.
 * Makefile.am (MPF_OBJECTS): Add generate object to libs.
 * gmp-h.in: Declare new function.
 * tests/mpf/t-cmp_si.c: Test also the new function.
 * doc/gmp.texi: Document it.

2015-09-06  Torbjörn Granlund  <torbjorng@google.com>

 * Wrap remaining limb allocations in __GMP_ALLOCATE_FUNC_LIMBS.

 * mpn/x86/fat/fat.c (fake_cpuid_table): Add missing commas.
 * mpn/x86_64/fat/fat.c: Likewise.

 * mpn/x86/fat/fat.c (fake_cpuid_table): Improve struct type.
 * mpn/x86/fat/fat.c: Likewise.

2015-09-03 Marco Bodrato <bodrato@mail.dm.unipi.it>

 * tests/mpq/t-cmp_z.c (sizes_test): New function, tests sizes.

2015-09-03  Torbjörn Granlund  <torbjorng@google.com>

 * acinclude.m4 (GMP_C_HIDDEN_ALIAS): New.
 * configure.ac (GMP_C_HIDDEN_ALIAS): Invoke.

2015-09-01 Marco Bodrato <bodrato@mail.dm.unipi.it>

 * mpq/cmp.c (mpq_cmp_numden): Cast to avoid over/underflow.
 * tests/mpn/t-toom22.c (MIN_AN): Use defined value.
 * tests/mpz/t-fac_ui.c: Check big factorial modulo a larger prime.
 * mpn/generic/bsqrtinv.c: Use sqrlo+mullo_n instead of powlo(,,3,,).
 * mpq/div.c: Move a branch out of the normal flow.

2015-08-31  Torbjörn Granlund  <torbjorng@google.com>

 * mpn/x86/fat/fat.c (fake_cpuid_table): Update similarly to
 corresponding x86_64 code.

2015-08-31 Marco Bodrato <bodrato@mail.dm.unipi.it>

 * mpq/cmp.c (mpq_cmp_z): New function to compare mpq with mpz,
 asked by Vincent Delecroix for the SageMath project.
 * gmp-h.in: Declare it.
 * doc/gmp.texi: Document it.
 * tests/mpq/t-cmp_z.c: New file to test mpq_cmp_z (from t-cmp.c).
 * tests/mpq/Makefile.am (check_PROGRAMS): Add t-cmp_z.

 * mpn/generic/powlo.c: Use mpn_sqrlo.

2015-08-29  Torbjörn Granlund  <torbjorng@google.com>

 * mpn/x86_64/fat/fat.c (fake_cpuid_table): Add CPU aliases.

2015-08-25 Marco Bodrato <bodrato@mail.dm.unipi.it>

 * configure.ac (AH_VERBATIM): Add HAVE_NATIVE_mpn_mullo_basecase.
 * mpn/generic/sqrlo.c (mpn_sqrlo): Use mullo_basecase when faster.
 * mpn/generic/sqrlo_basecase.c: More readable #defines.

 * tune/tuneup.c (tune_sqrlo): New function to tune sqrlo thresholds.
 (all): Call it, after multiplication and FFT.
 * tune/Makefile.am (TUNE_MPN_SRCS_BASIC): Add sqrlo{,_basecase}.c .
 * gmp-impl.h: Add all SQRLO_*_THRESHOLD* defs, for tuning and default.
 * mpn/generic/sqrlo.c: Remove default threshold definitions.
 * mpn/generic/sqrlo_basecase.c: Use SQRLO_DC_THRESHOLD_LIMIT.
 * mpn/minithres/gmp-mparam.h: New SQRLO_*_THRESHOLDs.

 * tune/tuneup.c (tune_mullo): Set MULLO_MUL_N_THRESHOLD to never
 whenever the FFT threshold does not exist.

 * mpf/cmp.c: Remove some branches.

2015-08-25  Torbjörn Granlund  <torbjorng@google.com>

 * mpn/x86_64/x86_64-defs.m4: Output computed numbers in base-10 instead
 of base-16 to avoid bugs on Solaris, FreeBSD, and old NetBSD.

2015-08-23  Torbjörn Granlund  <torbjorng@google.com>

 * mpn/x86_64/fat/fat.c (fake_cpuid_table): Add more entries, handle
 Broadwell separately.

 * configure.ac (fat_path): Add coreibwl.

2015-08-18 Marco Bodrato <bodrato@mail.dm.unipi.it>

 * mpn/generic/rootrem.c (logbased_root): New function.
 (mpn_rootrem_internal): Use it to estimate highest 9 bits of the root.

 * gmp-impl.h (MPQ_PTR_SWAP, MPQ_SRCPTR_SWAP): New macros.

2015-08-17  Torbjörn Granlund  <torbjorng@google.com>

 * acinclude.m4 (X86_64_PATTERN): Add skylake.
 * config.guess: Corresponding changes.
 * config.sub: Corresponding changes.
 * configure.ac: Corresponding changes.
 * mpn/x86_64/skylake/gmp-mparam.h: New file.

2015-08-15  Torbjörn Granlund  <torbjorng@google.com>

 * mpn/generic/mullo_basecase.c: Provide alternative code, make default.

2015-08-04 Marco Bodrato <bodrato@mail.dm.unipi.it>

 * tests/refmpn.c (refmpn_sqrlo): New function.
 * tests/tests.h: Define it.

 * mpn/generic/sqrlo.c: New file, new function.
 * mpn/generic/sqrlo_basecase.c: New file, new function.
 * gmp-impl.h (mpn_sqrlo, mpn_sqrlo_basecase): Declare them.
 * configure.ac (gmp_mpn_functions): Add new files.

 * tests/mpn/t-sqrlo.c: New file, new test.
 * tests/mpn/Makefile.am (check_PROGRAMS): Add new test.
 * tests/devel/try.c: Support mpn_sqrlo and mpn_sqrlo_basecase.

 * tune/common.c (speed_mpn_sqrlo{,_basecase}): New functions.
 * tune/speed.c: Support new functions.
 * tune/speed.h (SPEED_ROUTINE_MPN_MULLO_BASECASE): Update.
 (SPEED_ROUTINE_MPN_SQRLO): New macro.

 * mpn/generic/rootrem.c: Avoid divisions if not needed.

 * tests/mpn/t-broot.c: Test also k=1.
 * mpz/aorsmul_i.c: Move branches out of main line.

2015-07-28 Marco Bodrato <bodrato@mail.dm.unipi.it>

 * mpn/generic/sqrtrem.c (mpn_dc_sqrt): Support odd sizes.

2015-07-16  Torbjörn Granlund  <torbjorng@google.com>

 * tune/speed.c: Remove now redundant MPN_FILL.

 * configure.ac (hppa-hpux): Never use O3 optimisation.

2015-07-09  Torbjörn Granlund  <torbjorng@google.com>

 * mpn/ia64/add_n_sub_n.asm: Make it work for HP-UX.
 * mpn/ia64/addmul_2.asm: Likewise.
 * mpn/ia64/aors_n.asm: Likewise.
 * mpn/ia64/aorsorrlshC_n.asm: Likewise.
 * mpn/ia64/cnd_aors_n.asm: Likewise.
 * mpn/ia64/gcd_1.asm: Likewise.
 * mpn/ia64/lshiftc.asm: Likewise.
 * mpn/ia64/mod_34lsub1.asm: Likewise.
 * mpn/ia64/mul_2.asm: Likewise.
 * mpn/ia64/sec_tabselect.asm: Likewise.
 * mpn/ia64/sqr_diag_addlsh1.asm: Likewise.

2015-07-01 Marco Bodrato <bodrato@mail.dm.unipi.it>

 * gmp-impl.h (MPN_FILL): New macro, generalise MPN_ZERO.

 * mpn/generic/sqrtrem.c (mpn_dc_sqrt): New function not computing remainder.
 (mpn_dc_sqrtrem): Use tdiv_q instead of divrem, use given scratch space.
 (mpn_sqrtrem): Use mpn_dc_sqrt for both even and odd sizes.

2015-06-24  Torbjörn Granlund  <torbjorng@google.com>

 * mpn/x86_64/fastsse/com.asm: Disallow zero size operands.

 * mpn/x86_64/fastsse/copyi.asm: Suppress looping in basecase code.

2015-06-23 Marco Bodrato <bodrato@mail.dm.unipi.it>

 * mpn/generic/sqrtrem.c (mpn_sqrtrem2): Simplify branches.
 (mpn_dc_sqrtrem): Don't compute remainder if not needed.

2015-06-23  Torbjörn Granlund  <torbjorng@google.com>

 * gmp-impl.h: Remove K&R stringize support.
 * tests/devel/try.c: Likewise.
 * tests/t-constants.c: Likewise.
 * tests/mpf/t-fits.c: Likewise.
 * tests/mpz/t-fits.c: Likewise.

 * configure.ac (AC_C_STRINGIZE): Remove.

2015-06-15 Marco Bodrato <bodrato@mail.dm.unipi.it>

 * tests/devel/try.c: Support mpn_sqrt (sqrtrem with remainder = NULL).
 * mpn/generic/sqrtrem.c: Reorder branches for single limb operands.

2015-06-15  Torbjörn Granlund  <torbjorng@google.com>

 * config.guess: Rewrite code for AVX handling to deal with broken cpuid
 states.

2015-06-11  Torbjörn Granlund  <torbjorng@google.com>

 * mpn/x86/k7/gcd_1.asm: Align stack for calls.
 * mpn/x86/p6/gcd_1.asm: Amend last change: align for PIC and non-PIC.

2015-06-10 Marco Bodrato <bodrato@mail.dm.unipi.it>

 * mpn/generic/sqrtrem.c: Use sqrtrem1 for single limb operands.

 * tests/mpz/t-root.c: Check also mpz_root return value.
 * mpn/generic/rootrem.c: Shorten first and last loop.

 * mpn/generic/toom2_sqr.c: Add some ASSERTs.
 * mpn/generic/toom22_mul.c: Likewise.
 * tests/mpn/t-toom22.c: stop testing some unsafe (unused) corner cases.

2015-06-08  Torbjörn Granlund  <torbjorng@google.com>

 * mpn/x86/p6/gcd_1.asm: Align stack for calls.

2015-06-06  Torbjörn Granlund  <torbjorng@google.com>

 * config.sub: Recognise any arm*neon CPU.
 * configure.ac (powerpc): Add p8 directory for power8 and later.
 * mpn/powerpc64/mode64/p8/invert_limb.asm: New file.

2015-06-01  Torbjörn Granlund  <torbjorng@google.com>

 * tune/speed.c (routine): Measure "mpn_sqrt" and "mpn_root", which are
 really the corresponding "rem" functions with NULL remainder argument.

 * tune/speed.h (SPEED_ROUTINE_MPN_SQRTROOT_CALL): New.
 (SPEED_ROUTINE_MPN_SQRTREM, SPEED_ROUTINE_MPN_ROOTREM): Remove.

 * tune/common.c (speed_mpn_sqrt, speed_mpn_root): New functions.
 (speed_mpn_sqrtrem): Use SPEED_ROUTINE_MPN_SQRTROOT_CALL
 (speed_mpn_rootrem): Likewise.

2015-05-30 Marco Bodrato <bodrato@mail.dm.unipi.it>

 * mpf/cmp_ui.c: Use macros, remove branches, correct nails.
 * mpf/cmp_si.c: Likewise.
 * mpf/int_p.c: Use a simpler loop to ignore zero limbs.

 * mpf/sqrt_ui.c: Special case for sqrt(1).
 * tests/mpf/t-sqrt_ui.c: Test special cases.

 * gmp-h.in: Declare (and inline) mpn_zero_p.
 * gmp-impl.h: Remove mpn_zero_p.
 * mpn/generic/zero_p: New file to include the function in the library.
 * configure.ac (gmp_mpn_functions): Add it.
 * doc/gmp.texi: Document it.

 * mpz/combit.c: Call mpn_zero_p only if size is not zero.
 * mpz/scan1.c: Likewise.
 * tests/mpn/t-brootinv.c: Likewise.
 * tests/mpn/t-div.c: Likewise.
 * tests/mpn/t-minvert.c: Likewise.

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

 * doc/gmp.texi (Low-level Functions): Document mpn_divexact_1 and
 mpn_cnd_swap (the latter was forgotten for the 2015-02-08 change).

2015-05-28  Linus Nordberg  <linus@nordberg.se>

 * configure.ac: Remove double quotes in help strings, make some
 clarifications.

2015-05-24 Marco Bodrato <bodrato@mail.dm.unipi.it>

 * mpq/div.c: Reduce memory use.
 * tests/mpq/reuse.c: Test also mpq_FUNCTION (x,x,x).
 * mpz/swap.c: Use _SWAP macros.

2015-05-18  Torbjörn Granlund  <torbjorng@google.com>

 * configure.ac (arm): Let compiler decide about arm vs thumb encoding.

2015-05-18 Marco Bodrato <bodrato@mail.dm.unipi.it>

 * gmp-h.in (mpn_neg): Niels' code using mpn_neg.
 * gmp-h.in (mpn_com): Unconditionally declare prototype.

2015-05-17  Torbjörn Granlund  <torbjorng@google.com>

 * mpn/arm/v6/sqr_basecase.asm: Rewrite for speed.

2015-05-16  Torbjörn Granlund  <torbjorng@google.com>

 * mpn/arm/v6/addmul_2.asm: Rewrite for speed and size.

2015-05-15  Torbjörn Granlund  <torbjorng@google.com>

 * mpn/arm/v7a/cora7/gmp-mparam.h: New file.
 * mpn/arm/v7a/cora8/gmp-mparam.h: New file.
 * configure.ac (arm): Point to new directories.

2015-05-15 Marco Bodrato <bodrato@mail.dm.unipi.it>

 * mpn/generic/invertappr.c: Reduce memory usage.
 * gmp-impl.h (mpn_invertappr_itch): Update accordingly.
 * tune/tuneup.c (tune_invertappr, tune_invert): Update min_size.

 * mpn/generic/mu_div_qr.c: Pass scratch memory to mpn_invertappr.
 * mpn/generic/mu_divappr_q.c: Likewise.

2015-05-12  Felix Janda  <felix.janda@posteo.de>

 * mpn/powerpc32/elf.m4 (LEA): Adopt to new ABI.

2015-05-09 Marco Bodrato <bodrato@mail.dm.unipi.it>

 * mpn/generic/invertappr.c: Reduce memory usage.
 * gmp-impl.h (mpn_invertappr_itch): Update accordingly.

2015-05-01  Torbjörn Granlund  <torbjorng@google.com>

 * tune/tuneup.c (all): Make GCD tuning last since it is not robust.

2015-04-27  Torbjörn Granlund  <torbjorng@google.com>

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

2015-04-26  Torbjörn Granlund  <torbjorng@google.com>

 * mpn/x86_64/coreibwl/mul_basecase.asm: New file.
 * mpn/x86_64/coreibwl/sqr_basecase.asm: New file.

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

 * tune/common.c (speed_mpn_neg, speed_mpz_2fac_ui): New functions.
 (speed_mpn_add_1, speed_mpn_add_1_inplace): New functions.
 (speed_mpn_sub_1, speed_mpn_sub_1_inplace): New functions.
 * tune/speed.h: Declare them all.
 * tune/speed.c (routine): Added mpn_neg, mpn_add_1, mpn_sub_1,
 mpn_add_1_inplace, mpn_sub_1_inplace, and mpz_2fac_ui.

2015-04-25 Marco Bodrato <bodrato@mail.dm.unipi.it>

 * mpn/generic/invert.c: Split add in the correction test.
 * mpn/generic/invertappr.c: Cleanup of loops and branches.

 * mpn/generic/hgcd_reduce.c: Use TMP_ALLOC_LIMBS_3.
 * mpn/generic/powm.c: Use TMP_ALLOC_LIMBS_2.
 * mpn/generic/rootrem.c: Likewise.
 * mpn/generic/remove.c: Remove redundant #ifdef.
 * mpn/generic/perfpow.c: Likewise.

2015-04-21  Torbjörn Granlund  <torbjorng@google.com>

 * printf/sprintffuns.c (gmp_sprintf_final): Remove extra parameters.

 * mpn/arm/v6/popham.asm: Add MULFUNC_PROLOGUE.
 * mpn/powerpc64/mode64/rsh1aors_n.asm: Likewise.
 * mpn/powerpc64/mode64/p6/aorsmul_1.asm: Likewise.

2015-04-19  Torbjörn Granlund  <torbjorng@google.com>

 * mpn/x86_64/x86_64-defs.m4 (oplist): Fix typo.
 (mulx): Simplify.
 (adcx, adox): New defines, using helper function adx.
 * mpn/x86_64/coreibwl/mul_1.asm: New file.
 * mpn/x86_64/coreibwl/addmul_1.asm: New file.
 * configure.ac (x86_64): Put coreibwl in appropriate code path.

 * configure.ac (x86_64): Pass more exact Intel CPU options.

2015-04-13  Torbjörn Granlund  <torbjorng@google.com>

 * longlong.h (arm): Rewrite.  Support thumb2; use gcc builtins for
 count_leading_zeros, use accurate code selection critera.

2015-04-13  Marc Glisse  <marc.glisse@inria.fr>

 * configure.ac (x86_64): Extend noavx to ABI=64.

2015-04-10  Torbjörn Granlund  <torbjorng@google.com>

 * mpn/alpha/ev6/mod_1_4.asm: Use LDGP.

2015-04-01  Torbjörn Granlund  <torbjorng@google.com>

 * configure.ac (sparc): Don't use use -xO4, it miscompiles by design.

2015-03-24  Torbjörn Granlund  <torbjorng@google.com>

 * mpn/generic/mul_fft.c (mpn_fft_best_k): Don't make pointers `static'
 just because they point to static (i.e., file-local) data.

2015-03-15  Torbjörn Granlund  <torbjorng@google.com>

 * acinclude.m4 (X86_64_PATTERN): Add CPU code names.

 * config.guess: Add more CPUs, use CPU code names.
 * config.sub: Corresponding changes.
 * configure.ac: Corresponding changes.

2015-02-21  Niels Möller  <nisse@lysator.liu.se>

 * gmp-h.in (mpn_divexact_1): New public declaration.
 * gmp-impl.h: Moved from here.

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

 * doc/gmp.texi (Low-level Functions): Document mpn_cnd_swap.

 * mpn/generic/cnd_swap.c (mpn_cnd_swap): New file, moved function
 here. Also changed cnd argument type from int to mp_limb_t.
 * mpn/generic/sec_invert.c (mpn_cnd_swap): Old location.
 * configure.ac: Added cnd_swap.
 * gmp-h.in (mpn_cnd_swap): Added prototype.

2015-01-19  Torbjörn Granlund  <torbjorng@google.com>

 * configure.ac (arm): Provide architecture specific configs in addition
 to implementation specific configs.

 * config.guess (arm): Use configfsf.guess's guess as default before
 conditionally appending "neon".

2015-01-08  Torbjörn Granlund  <torbjorng@google.com>

 * config.guess: Match POWER8 for AIX.

 * longlong.h: Add many casts inside assembly input operands, this
 insures proper zero extension.

2014-12-27  Marc Glisse  <marc.glisse@inria.fr>

 * gmpxx.h (__gmp_unary_expr): Use __gmp_resolve_ref.
 (__gmp_expr): New specialization for unary expressions with
 a builtin argument.

2014-12-26  Marc Glisse  <marc.glisse@inria.fr>

 * gmp-impl.h (tmp_debug_entry_t): Change block to type void*.

2014-12-22  Torbjörn Granlund  <torbjorng@google.com>

 * longlong.h (mips64, mips32): Work around one clang bug.

2014-12-18  Torbjörn Granlund  <torbjorng@google.com>

 * longlong.h (umul_ppmm): Use input temps in more places.

2014-12-10  Marc Glisse  <marc.glisse@inria.fr>

 * tests/cxx/clocale.c (localeconv, nl_langinfo): Match glibc's
 prototype in C++.

2014-12-09  Torbjörn Granlund  <torbjorng@google.com>

 * configure.ac (powerpc): Remove hardwired -mpowerpc, causes clang
 problems.  Optionally pass -m32.

2014-12-08  Marc Glisse  <marc.glisse@inria.fr>

 * config.guess (ultrasparc*-*-*): Update for T4 and T5.
 * config.sub (ultrasparc*-*-*): Update for T5.
 * configure.ac (ultrasparc*-*-*): Update for T5.

 * longlong.h (sparc64): Define COUNT_LEADING_ZEROS_NEED_CLZ_TAB
 with VIS3.

 * tests/misc/t-locale.c (localeconv, nl_langinfo): Match glibc's
 prototype in C++.
 * tests/mpf/t-get_si.c (check_limbdata): Avoid narrowing conversion
 from -1 to unsigned inside {}.

2014-12-02  Torbjörn Granlund  <torbjorng@google.com>

 * config.guess (arm*-*-*): Redirect stderr.

2014-11-26  Torbjörn Granlund  <torbjorng@google.com>

 * configure.ac (arm*-*-*): Optionally pass redundant fpu mode options
 in order to placate clang.

 * mpn/arm/neon/lshiftc.asm: Avoid insn form missing from clang.

2014-11-24  Torbjörn Granlund  <torbjorng@google.com>

 * configure.ac (mips*-*-*): Provide ABI synonyms (for clang pretending
 to be gcc).

2014-11-18  Torbjörn Granlund  <torbjorng@google.com>

 From Hannes Mehnert:
 * config.guess (arm*-*-*): Base guesses on first matching /proc/cpuinfo
 line.

2014-11-17  Torbjörn Granlund  <torbjorng@google.com>

 * longlong.h (__longlong_h_C): New macro.
 (mpn_umul_ppmm, etc): Use it for C++ support.

2014-11-15  Torbjörn Granlund  <torbjorng@google.com>

 * tests/mpz/reuse.c: Make function vectors 'static'.

 * tests/mpn/logic.c (check_one): Make string variable 'const'.

 * tests/mpz/t-perfpow.c (tests): Make 'static'.

 * tune/tuneup.c (fftmes): Remove an unused variable.

2014-11-15  Marc Glisse  <marc.glisse@inria.fr>

 * tests/amd64check.c (calling_conventions_fenv): Mark as extern "C".
 * tests/x86check.c (calling_conventions_fenv): Likewise.

2014-11-13  Hans Wennborg  <hwennborg@google.com>

 * mpn/generic/toom_interpolate_8pts.c: Fix operator precedence in
 ASSERT.

2014-11-13  Torbjörn Granlund  <torbjorng@google.com>

 * tune/speed.h: Add casts for C++ compatibility.
 (speed_cyclecounter): Mark as extern "C".
 (mpn_mod_1_1p_1, mpn_mod_1_1p_2): Correct prototype.

 * tune/tune-gcd-p.c: Add casts for C++ compatibility.

 * tune/tuneup.c: Add casts for C++ compatibility.
 (mpn_divrem_1_tune, mpn_mod_1_tune): Mark as extern "C".
 (INSERT_FFTTAB): Produce sentinels differently to silence compiler.

2014-11-12  Torbjörn Granlund  <torbjorng@google.com>

 * gen-psqr.c: Add casts for C++ compatibility.

 * tests/misc/t-scanf.c: Include config.h early for HAVE_xxx.

2014-11-08  Torbjörn Granlund  <torbjorng@google.com>

 * mpn/x86/x86-defs.m4 (LEA, LEAL): Make sure to put eip stub code in
 text segment.
 * mpn/x86/darwin.m4: Likewise.

 * tune/speed.h (i386 speed_cyclecounter): Remove inline asm code, rely
 on external version.

2014-11-06  Torbjörn Granlund  <torbjorng@google.com>

 * config.guess: Ignore appended letters such E in POWER8E.
 * configure.ac: Supply cflags for power8, power9.

2014-11-03  Torbjörn Granlund  <torbjorng@google.com>

 * mpn/powerpc32/addmul_1.asm: Avoid negative stack pointer references.
 * mpn/powerpc32/lshift.asm: Likewise.
 * mpn/powerpc32/lshiftc.asm: Likewise.
 * mpn/powerpc32/p3-p7/aors_n.asm: Likewise.
 * mpn/powerpc32/rshift.asm: Likewise.
 * mpn/powerpc32/sec_tabselect.asm: Likewise.
 * mpn/powerpc32/submul_1.asm: Likewise.
 * mpn/powerpc32/vmx/mod_34lsub1.asm: Likewise.

2014-10-13  Torbjörn Granlund  <torbjorng@google.com>

 * acinclude.m4 (freebsd hacked gcc): Test for crash-prone FreeBSD gcc.

2014-10-03  Peter Breitenlohner <peb@mppmu.mpg.de>

 * mpn/generic/sec_tabselect.c: Adjust type to silence compiler.

2014-10-01  Torbjörn Granlund  <torbjorng@google.com>

 * All Makefile.am: INCLUDES => AM_CPPFLAGS.

 * configure.ac (arm64): Set gcc_cflags_maybe to enable Neon (for clang
 pretending to be gcc).

2014-09-24  Marc Glisse  <marc.glisse@inria.fr>

 * longlong.h (arm64 count_trailing_zeros, count_leading_zeros): Use
 gcc's builtins.
 (arm64 umul_ppmm): Use macro arguments only once.

2014-09-22  Marc Glisse  <marc.glisse@inria.fr>

 * mpn/arm64/lshift.asm: Avoid negative immediates.
 * mpn/arm64/rshift.asm: Likewise.

2014-09-13  Marc Glisse  <marc.glisse@inria.fr>

 * mpn/generic/div_qr_1n_pi1.c: Honor NO_ASM.
 * mpn/generic/div_qr_1n_pi2.c: Likewise.
 * mpn/generic/div_qr_1u_pi2.c: Likewise.
 * mpn/generic/div_qr_2.c: Likewise.
 * mpn/generic/mod_1_1.c: Likewise.
 * mpn/generic/redc_2.c: Likewise.

2014-08-31  Torbjörn Granlund  <tege@gmplib.org>

 * mpn/arm64/lshift.asm: New file.
 * mpn/arm64/rshift.asm: New file.

2014-09-01 Marco Bodrato <bodrato@mail.dm.unipi.it>

 * gmp-impl.h (TMP_ALLOC_LIMBS_3): New macro to allocate 3 blocks.
 (mpn_remove): Update declaration with mp_srcptr arguments.
 * mpn/generic/remove.c: Use TMP_ALLOC_LIMBS_3. mp_srcptr for args.

 * mpn/generic/perfpow.c (pow_equals): TMP_DECL only where needed.
 (perfpow): Use TMP_ALLOC_LIMBS_3.
 (mpn_perfect_power_p): Skip useless allocations. Use mpn_remove.
 * tests/mpz/t-perfpow.c (check_random): Check more perfect powers.

 * mpn/generic/divis.c: Use TMP_ALLOC_LIMBS_2. Share a count.

2014-08-30  Torbjörn Granlund  <tege@gmplib.org>

 * mpn/arm64/mod_34lsub1.asm: New file.

2014-08-23  Torbjörn Granlund  <tege@gmplib.org>

 * mpn/arm64/bdiv_dbm1c.asm: New file.

 * mpn/arm64/com.asm: New file.

 * mpn/arm64/sec_tabselect.asm: New file.

 * mpn/arm64/popcount.asm: New file.
 * mpn/arm64/hamdist.asm: New file.

 * configure.ac: Put generic arm/neon earlier in path.

2014-08-14 Marco Bodrato <bodrato@mail.dm.unipi.it>

 * mpq/canonicalize.c: Earlier check for negative denominator.
 * mpq/set_d.c: Stricter allocation.

2014-08-03  Torbjörn Granlund  <tege@gmplib.org>

 * mpn/x86_64/bobcat/mul_1.asm: Fix typo in offset affecting DOS64.

2014-07-28 Marco Bodrato <bodrato@mail.dm.unipi.it>

 * mpn/generic/fib2_ui.c: remove #if HAVE_NATIVE_mpn_rsblsh_n.
 * mpz/fib2_ui.c: Use tabulated values, when available.
 * mpz/fib_ui.c: #if HAVE_NATIVE_mpn_addlsh1_n, use it.

 * mpq/cmp_ui.c: Remove a branch.
 * mpq/cmp_si.c: Likewise.

 * mpn/generic/toom_interpolate_7pts.c: Replace an in-place add
 with add_n + INCR_U.

 * tests/mpf/t-fits.c: use ui_sub instead of sub_ui+neg.

2014-07-27  Torbjörn Granlund  <tege@gmplib.org>

 * mpn/x86/k7/gcd_1.asm: Use LEAL.

 * mpn/x86/x86-defs.m4 (LEAL): New.
 (LEA): Append to `load_eip' instead of ASM_END, like darwin.m4.
 * mpn/x86/darwin.m4 (LEAL): New.

2014-07-26  Torbjörn Granlund  <tege@gmplib.org>

 * mpn/x86/pentium/mode1o.asm: Add Darwin PIC code.
 * mpn/x86/pentium/bdiv_q_1.asm: Likewise.
 * mpn/x86/pentium/dive_1.asm: Likewise.
 * mpn/x86/pentium/popcount.asm: Likewise.
 * mpn/x86/pentium/hamdist.asm: Likewise.
 * mpn/x86/k6/gcd_1.asm: Likewise.

 * mpn/x86: Append ASM_END to many files.
 * tests/x86call.asm: Append ASM_END.

 * mpn/x86/fat/fat_entry.asm (FAT_ENTRY, FAT_INIT):
 Support Darwin.

 * mpn/x86/darwin.m4 (ASM_END): New, body from EPILOGUE_cpu.
 (EPILOGUE_cpu): Remove.

 * mpn/x86/x86-defs.m4 (LEA): Put `mov_eip_' thunks in ASM_END instead
 of EPILOGUE_cpu.

2014-07-05  Niels Möller  <nisse@lysator.liu.se>

 * doc/gmp.texi (Low-level Functions): Document that scratch need
 for mpn_sec_add_1 and mpn_sec_sub_1 are at most n limbs.
 (Low-level Functions): Document allowed overlap for mpn_addmul_1
 and mpn_submul_1.

2014-07-02  Torbjörn Granlund  <tege@gmplib.org>

 * mpn/x86_64/x86_64-defs.m4: Fix quoting.

 * mpn/x86_64/atom/redc_1.asm: Enforce proper stack allocation.
 * mpn/x86_64/bobcat/redc_1.asm: Likewise.
 * mpn/x86_64/core2/divrem_1.asm: Likewise.
 * mpn/x86_64/core2/gcd_1.asm: Likewise.
 * mpn/x86_64/core2/redc_1.asm: Likewise.
 * mpn/x86_64/coreihwl/redc_1.asm: Likewise.
 * mpn/x86_64/coreinhm/redc_1.asm: Likewise.
 * mpn/x86_64/coreisbr/redc_1.asm: Likewise.
 * mpn/x86_64/divrem_1.asm: Likewise.
 * mpn/x86_64/divrem_2.asm: Likewise.
 * mpn/x86_64/gcd_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.

2014-06-30  Torbjörn Granlund  <tege@gmplib.org>

 * config.sub: Generalise x86 patterns.

2014-06-17  Marc Glisse  <marc.glisse@inria.fr>

 * gmpxx.h (__gmp_gcd_function, __gmp_lcm_function): New classes.
 (gcd, lcm): New functions.
 * doc/gmp.texi (C++ Interface Integers): Document them.
 * tests/cxx/t-ops2.cc (checkz): Test them.

2014-06-16  Torbjörn Granlund  <tege@gmplib.org>

 * mpf/mul.c: Postpone TMP_MARK.

 * mpn/generic/perfpow.c (perfpow): Combine TMP_ALLOCs.

2014-06-15  Torbjörn Granlund  <tege@gmplib.org>

 * tests/refmpn.c (refmpn_mul): Rewrite to avoid O(n) recursion depth.

2014-06-09  Torbjörn Granlund  <tege@gmplib.org>

 * mpn/generic/mullo_n.c: Remove default THRESHOLDs.
 * gmp-impl.h: Put MULLO THRESHOLDs here.  Improve various THRESHOLD
 defaults.

2014-06-08  Torbjörn Granlund  <tege@gmplib.org>

 * gmp-impl.h (TMP_ALLOC): Decrease limit to about half.

 * mpn/generic/toom53_mul.c: Replace many TMP_SALLOC invocations
 by a single TMP_ALLOC.
 * mpn/generic/toom42_mul.c: Likewise.

 * mpn/generic/sec_sqr.c: Don't unconditionally call mpn_sqr_basecase
 since it fails for non-cryptographic sizes for some obsolete CPUs.

 * mpn/generic/sec_powm.c: Remove own squaring code, instead use
 mpn_mul_basecase.

 * tests/mpn/logic.c (main): Don't use TMP_SALLOC_LIMBS.

 * mpn/generic/dcpi1_div_q.c: Avoid TMP_SALLOC_LIMBS.
 * mpn/generic/dcpi1_div_qr.c: Likewise.

2014-06-08 Marco Bodrato <bodrato@mail.dm.unipi.it>

 * mpn/generic/mul.c: Tighter allocation in Toom{2,3}X branches.

2014-06-06  Torbjörn Granlund  <tege@gmplib.org>

 * mpn/generic/mul.c: Swap some TMP_SALLOC_LIMBS for TMP_ALLOC_LIMBS
 and some TMP_ALLOC_LIMBS for TMP_SALLOC_LIMBS.

2014-05-31 Marco Bodrato <bodrato@mail.dm.unipi.it>

 * mpf/ui_sub.c: Remove buggy code, use a wrapper to mpf_sub.
 * tests/mpf/t-sub.c: More corner cases and strict checking.
 * mpf/sub.c: Use more mpn_ primitives and macros.

 * tests/mpf/t-int_p.c: Test numbers with both integer and
 fractionary parts.

 * mpf/int_p.c: Delay zero branch and use mpn_zero_p.
 * mpf/fits_s.h: No special case for SIZ == 0.
 * mpf/fits_u.h: Likewise.

2014-05-29  Marc Glisse  <marc.glisse@inria.fr>

 * gmp-h.in: Include <limits.h>.
 (__GMP_UINT_MAX, __GMP_ULONG_MAX, __GMP_USHRT_MAX): Remove.
 * gmp-impl.h (ULONG_MAX, UINT_MAX, USHRT_MAX, LONG_MAX, INT_MAX,
 SHRT_MAX): Remove unnecessary redefinition.
 * tests/t-gmpmax.c: Remove file.
 * tests/Makefile.am: Remove t-gmpmax.

2014-05-22 Marco Bodrato <bodrato@mail.dm.unipi.it>

 * tests/mpf/t-sub.c (check_data): Test also ui_sub and sub_ui.

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

 * gen-fac.c: +1 in the init2 argument before setbit.
 * gen-fib.c: Likewise. (Thanks Niels)
 * rand/randmts.c: Likewise.

 * mpn/generic/invert.c: Remove unused TMP_MARK.
 * mpn/generic/invertappr.c: Avoid a branch.
 * mpz/millerrabin.c (millerrabin): Consider the rare case n is a power.

2014-05-15 Marco Bodrato <bodrato@mail.dm.unipi.it>

 * gen-fib.c: Use mpz_setbit.
 * gen-psqr.c: Skip even numbers when looking for primes.

 * mpn/generic/invert.c: Avoid a branch.
 * mpn/generic/toom2_sqr.c: Avoid a few branches in the odd case.
 * mpn/generic/toom22_mul.c: Likewise.

2014-05-08  Marc Glisse  <marc.glisse@inria.fr>

 * gmpxx.h (std::common_type): Remove partial specialization for two
 identical expressions. New partial specialization for a single type.
 * tests/cxx/t-cxx11.cc: Test it.

2014-04-14  Niels Möller  <nisse@lysator.liu.se>

 * doc/gmp.texi (mpz_invert): Clarify behavior in the zero ring.

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

 * longlong.h (i386): Add comment about "cc" clobber.

2014-04-04  Torbjorn Granlund  <tege@gmplib.org>

 * acinclude.m4 (X86_64_PATTERN): Generalise patterns to allow "noavx"
 suffix.

 * mpn/generic/div_qr_1n_pi1.c: Conditionalise ARM asm on !__thumb__.

2014-04-03  Marc Glisse  <marc.glisse@inria.fr>

 * mpn/arm64/mul_1.asm, mpn/arm64/gcd_1.asm: Use official b.cond syntax.
 * mpn/arm64/invert_limb.asm, mpn/arm64/aorsmul_1.asm: Prefix
 immediates with #.

2014-04-03  Torbjorn Granlund  <tege@gmplib.org>

 * config.guess: Append "noavx" for CPUs which have AVX but where the
 kernel does not support it.
 * configure.ac: Accept "noavx" cpu name suffixes.  Conditionally pass
 -mno-avx.

2014-04-02  Torbjorn Granlund  <tege@gmplib.org>

 * mpn/x86_64/k8/redc_1.asm: Workaround for Darwin assembler quirk.

2014-03-28  Torbjorn Granlund  <tege@gmplib.org>

 * mpn/generic/mod_1_1.c: Conditionalise ARM asm on !__thumb__.

2014-03-31  Marc Glisse  <marc.glisse@inria.fr>

 * mpn/arm/dive_1.asm, mpn/arm/invert_limb.asm: Use RODATA.
 * acinclude.m4 ([long long reliability tests]): Declare functions.
 (GMP_PROG_CC_FOR_BUILD_WORKS, GMP_PROG_EXEEXT_FOR_BUILD,
 GMP_C_FOR_BUILD_ANSI, GMP_CHECK_LIBM_FOR_BUILD): Replace exit(0) with
 return 0, no declaration needed.
 (GMP_CHECK_LIBM_FOR_BUILD): Include <math.h> to declare log.

2014-03-30  Marc Glisse  <marc.glisse@inria.fr>

 * README: Remove mention to Berkeley MP compatibility.

2014-03-26  Torbjorn Granlund  <tege@gmplib.org>

 * mpn/powerpc64/mode64/gcd_1.asm: Provide default for
 BMOD_1_TO_MOD_1_THRESHOLD.

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  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.

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-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.

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-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  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-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).

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-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.

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.
 * 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-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>

 * 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-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.

 * 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.

 * mpn/generic/mulmod_bnm1.c: Reorganise 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-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-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  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>

 * tests/mpz/t-set_str.c: Check also failing conditions.

 * tests/mpz/t-remove.c: Test removal of 1.

2013-01-18  Torbjorn Granlund  <tege@gmplib.org>

 * mpn/generic/set_str.c (normalization_steps): Eliminate set-but-unused
 variable.

 * tests/tests.h (TESTS_REPS): Fix printf argument type clashes.

2013-01-15  Torbjorn Granlund  <tege@gmplib.org>

 From Mike Frysinger:
 * configure.ac: Add x32 ABI for x86_64.

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-10 Marco Bodrato <bodrato@mail.dm.unipi.it>

 * mpz/export.c: Less restrictive ASSERTs.

2013-01-10  Torbjorn Granlund  <tege@gmplib.org>

 * Makefile.am (check-mini-gmp): Set LD_LIBRARY_PATH to allow testing
 with dynamic main GMP build.

2013-01-05  Torbjorn Granlund  <tege@gmplib.org>

 * longlong.h (aarch64): Make add_ssaaaa and sub_ddmmss actually work.

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-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.

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.

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>

 * 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>

 * 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.

 * 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-10 Marco Bodrato <bodrato@mail.dm.unipi.it>

 * Makefile.am (check-mini-gmp): Use $(MAKE).
 (clean-mini-gmp): New target.
 (clean-local, distclean-local): New automake targets. Depend on
 clean-mini-gmp.

 * gen-fac_ui.c (mpz_root): Remove.

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>

 * 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.

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>

 * 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.

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 for 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.

--> --------------------

--> maximum size reached

--> --------------------

[zur Elbe Produktseite wechseln0.487QuellennavigatorsAnalyse erneut starten2026-04-25]

                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

Software

     Produkte
     Quellcodebibliothek

Aktivitäten

     Artikel über Sicherheit
     Anleitung zur Aktivierung von SSL

Muße

     Gedichte
     Musik
     Bilder

Jenseits des Üblichen ....

Besucherstatistik

Besucherstatistik

Monitoring

Montastic status badge