* 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.
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).
* 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++ includesand 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 (32and64 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.
* 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 fileto 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 3and4.
* 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.
* 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 method2, 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.
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.
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=2case.
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 valuefor 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.
* 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 method4and5.
* 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 functionto 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.
* mpn/generic/hgcd2.c: Add a 4th and5th 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, andwith 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 to3. 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. Useifto conditionally invoke GMP_ASM_X86_MULX.
* longlong.h (x86 umul_ppmm): Test also X86_ASM_MULX for when touse
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 touse mulx.
(count_leading_zeros): Use lzcnt for appropriate CPUs.
(count_trailing_zeros): Use tzcnt for appropriate CPUs.
* 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 tonext-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 forusewith
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.
* 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+1is 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 fileandfunction.
* 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 2for 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.
* 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 localdefinition.
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 -2case.
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/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-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 is32 bit on aarch64. To distinguish between 32-bit and64-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*.
* 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 casefor mpq + 1.
(__gmp_binary_minus): Special casefor 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 to1.
* mpq/get_d.c: Compare (zeros > 0) once, replace tdiv_qr with div_q.
* mpq/equal.c: Check size early.
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, anduse 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.
* 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: Use64-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.
* 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.
* 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/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/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 valueto accommodate p6/sqr_basecase.asm fragility.
2017-01-29 Marco Bodrato <bodrato@mail.dm.unipi.it>
* 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-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 forFILE.
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.
* 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 alsofor32-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): Let1/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 in32-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.
* 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-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 typesfor 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-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, alsofor negatives (clearing the carry).
* mpn/generic/toom_interpolate_12.c: Likewise.
* mpn/generic/toom_interpolate_16.c: Likewise.
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.
* 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.
* 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-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.
* 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 functionto 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 fileto test mpq_cmp_z (from t-cmp.c).
* tests/mpq/Makefile.am (check_PROGRAMS): Add t-cmp_z.
* 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.
* 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.
* 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.
* 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 casefor 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 fileto include the functionin 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 inhelp 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.
* 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.
* 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.
* 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.
* 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 -1to unsigned inside {}.
* 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.
* 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 declarationwith 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>
* 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.
* 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-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 anduse mpn_zero_p.
* mpf/fits_s.h: No special casefor SIZ == 0.
* mpf/fits_u.h: Likewise.
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: +1in 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> todeclare 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.
* 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. Alsouse 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 to1.
* mpn/s390_64/z10/gmp-mparam.h (DIV_QR_1_NORM_THRESHOLD): Up to1.
* 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.
* 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.
* 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.
* 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/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.
* 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.
* 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/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.
* 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/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.
* 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.
* 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.
* 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.
* 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/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.
* 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.
* 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.
* 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.
* 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/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.
* 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".
* 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: 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.
* 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.
* 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.
* 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).
* 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.
* 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).
* 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).
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.
* 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.
* 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/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.
* 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>
* 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 unsignedlong 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.
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>
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 (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 fornew 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.
* 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.
*java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 this. .>NONEjava.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 62 |.partition(is_sel_of_constrx) ahighquotientlimb.
*mpn/generic/invertappr.cis_lone_repbody_Rjava.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30 whencallerelseifx=nat_multiply_rel
2009java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
/generictoom_couple_handling.Prefixnamewithmpn_.
*mpn/generic *mpn/generic/({ap}(rel_expr_from_rel_exprkk)Rs'old_rs) //toom6h_mul.. *mpn/R2ofAtom_=|>Atom(,some_j0 *arg_rval_rjava.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53
*tests/devel/try.=.True *Op2(And,_,u1u2)=java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37 java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
*configureboth_optjava.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43 (gmp_mpn_functions): *mpn/generic/lshiftc.c:Newfile. *mpnr1 64/.:filejava.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42 *mpn/generic/.cmpn_lshiftc):Remove.
*mpndecls_for_atom_schema0schema1@)) *mpn/x86_64/core2/rshift.asmLikewisejava.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41
2009-12-27MarcoBodrato<bodrato@mail.dm.unipi.it>
*/genericmulc:Usetoom6handtoom8hbalanced.
*mpn/generic/mullo_n.c(mpn_dc_mullo_n):bit_T\^><>signed_bit\<losejava.lang.StringIndexOutOfBoundsException: Index 66 out of bounds for length 66 Toom-8range.
*>rel_expr_from_rel_exprStruct[_,a_R],body_R)java.lang.StringIndexOutOfBoundsException: Index 75 out of bounds for length 75 *tune/speed.h(SPEED_ROUTINE_MPN_MU_DIV_Q):Newmacro. SPEED_ROUTINE_MPN_MU_DIV_QR:Likewise. SPEED_ROUTINE_MPN_MU_BDIV_Q)Likewise ():Likewise. */.amTUNE_MPN_SRCS_BASIC):Addbdiv_q.andbdiv_qr.. *tune/common.c(speed_mpn_mu_div_qr):Newfunction. (speed_mpn_mu_divappr_q):Likewise. (speed_mpn_mu_div_q):Likewise. (speed_mpn_mu_bdiv_q):Likewise. ).
*gmp-kk_product((mustb_Ru1mustb_Rc_Ru2)) (BMOD_1_TO_MOD_1_THRESHOLD):Newparameter,withthereversemeaningof MODEXACT_1_ODD_THRESHOLD. (MPN_MOD_OR_MODEXACT_1_ODD):UseBMOD_1_TO_MOD_1_THRESHOLD. *mpn/generic/divis.c,mpz/{cong.c(k_rel_eqr1true_atom)r2empty_r, *tune/tuneup.c(tune_modexact_1_odd):TuneBMOD_1_TO_MOD_1_THRESHOLD; Donotassumenativempn_modexact_1_odd(=arg_u=java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41 (tuned_speed_mpn_mod_1):Removevariable. (une_mod_1thinkos.Suppressprintingof"lwaysetc. ():Measurefordivrem_1,mod_1,divexact_1,etcfirst,sincejava.lang.StringIndexOutOfBoundsException: Index 70 out of bounds for length 70 dependsonsomeofthem.
*mpn/generic/toom22_mul.ck_n_ary_functionkkjava.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 47 TOOM22_MUL_MN_REC
2009-12-26NielsMöller<nisse@lysator.liu.se>
T|single|>java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48 requirementsabit.
*tests/mpn/t(asConstruct((_,_,_)::,T,us))= *gmp-impl.h(mpn_toom32_mul_itch):Updated.accumasSOME(oose,)= bytoom32itself,andalsothepointwisemultiplicationsare currentlywithsuppliedscratchjava.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46 *|needed_value_axioms_for_data_typeofsdtypes(T,fixed)= interpolationtouselessscratchspace.Nolongersupportsthe)) mostextremesizeratios.
2009-12self_rec,.}=>self_rec
*tune/tuneup.c(tune_preinv_mod_1):Purge. java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 PREINV_MOD_1_TO_MOD_1_THRESHOLD
*mpn/generic/dcpi1_divappr_q.c:Handle2n/nproperly.Don'tusefull precisioninmpn_sbpi1_divappr_qcall.java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
*gmp-impl.h(USE_PREINV_MOD_1):Remove. ()Definefunctionsin termsofPREINV_MOD_1_TO_MOD_1_THRESHOLD(usedtochoosestatically [kk((Atomz,R2))rjava.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50 *
*mpn/generic/mul_n.c:Usealsotoom6handtoom8h. *mpn/generic/sqr_n.c:Usealsotoom6andtoom8. *gmp-impl.h:InitialsupportfortuningofToom-6half= *tune/tuneup.c:TuneToom-6halfandToom-8java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4
*mpn * 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.
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.
* 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.
* 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.
* acinclude.m4 ([longlong 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] == 0and 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, andreturnsigned cofactors.
* 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>
* tune/tuneup.c (tune_redc): Set min_size to 16for 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.
* 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_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/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.
* 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.
* 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.
* 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.
* 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.
* 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.
* 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.
* 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.
* 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.
* 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/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.
* 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.
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.
* 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.
* 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.
* 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.
* 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.
* 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.)
* 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.
* 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.
* 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.
* 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.
* 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.
* 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.
* 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.
* 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.
* 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.
* 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.
* 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.
* 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.
* 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/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/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_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.
* 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/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.
* 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.
* 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.
-Torbjorn tege@.com
/generic.c GMP parameter. 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.
* 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: 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.
* 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.
* 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.
* 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.
* 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.
* 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.
* 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.
* 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.
* 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.
* 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/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.
* 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.
* 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.
* 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.
* 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.
* 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.
* 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/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.
* 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/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.
* 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.
* 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.
¤ Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.1.346Bemerkung:
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.