beta-0.89.2
[luatex.git] / source / libs / gmp / gmp-src / ChangeLog
blob879b3106a343385b72393e103b45d29f4e69633b
1 2015-11-01 Marco Bodrato <bodrato@mail.dm.unipi.it>
3         * Version 6.1.0 released.
5         * mpz/inits.c [__CHECKER__]: Init limb, not pointer.
6         * mpz/init.c [__CHECKER__]: Likewise (spotted by Vicente Benjumea).
7         * tests/mpf/t-pow_ui.c: Use another mpf for the size limit.
9 2015-10-30  Torbjörn Granlund  <torbjorng@google.com>
11         * mpf/pow_ui.c: Add log(e) precision bits.
13         * doc/gmp.texi (Floating-point): Rewrite mpf introduction.
15 2015-10-29 Marco Bodrato <bodrato@mail.dm.unipi.it>
17         * demos/factorize.c: mpz_div_2exp => mpz_tdiv_q_2exp.
18         * demos/perl/GMP.xs: Likewise.
19         * tests/mpf/t-pow_ui.c: Use reference value to check the size.
21         * mini-gmp/mini-gmp.c: Removed a typo (spotted by Paul Zimmermann).
22         * doc/gmp.texi (Floating-point): Remove "infinite precision" claim.
24         * gmp-h.in: Update version.
26 2015-10-28  Torbjörn Granlund  <torbjorng@google.com>
28         * tests/mpf/t-pow_ui.c: New file.
29         * tests/mpf/Makefile.am (check_PROGRAMS): Compile it.
31         * mpf/pow_ui.c: Rewrite for accuracy and performance.
33 2015-10-26 Marco Bodrato <bodrato@mail.dm.unipi.it>
35         * configfsf.guess: Updated to version 2015-10-21, for a typo.
37         * tests/cxx/t-ops.cc (check_mpq): Compare also with mpz.
38         (check_mpf): Compare also with mpz and mpq.
40 2015-10-25  Torbjörn Granlund  <torbjorng@google.com>
42         * configure.ac: Avoid passing ambiguous -march=skylake.
44 2015-10-21 Marco Bodrato <bodrato@mail.dm.unipi.it>
46         * Version 6.1.0-rc1 published.
48         * gmp-h.in: Revert version for RC.
50 2015-10-20  Torbjörn Granlund  <torbjorng@google.com>
52         * mpn/x86/pentium4/sse2/popcount.asm: Use LEAL.
53         * mpn/x86/k7/invert_limb.asm: Likewise.
55 2015-10-18  Torbjörn Granlund  <torbjorng@google.com>
57         * mpn/arm64/gmp-mparam.h: New file.
59 2015-10-18 Marco Bodrato <bodrato@mail.dm.unipi.it>
61         * Makefile.am (LIBGMP_LT_*, LIBGMPXX_LT_*): Bump version info.
62         * gmp-h.in: Bump version.
64 2015-10-17 Marco Bodrato <bodrato@mail.dm.unipi.it>
66         * tests/mpf/t-cmp_si.c: Initialise a variable (only when error arise)
67         * mpn/generic/toom43_mul.c: Insert parentheses around & expressions.
68         * mpn/generic/toom52_mul.c: Likewise.
69         * tests/mpn/t-minvert.c: Remove an unused var.
70         * tests/mpz/t-cong_2exp.c: Likewise.
72 2015-10-16  Hans Wennborg <hwennborg at google.com>
74         * mpn/generic/div_qr_2.c: Insert parentheses around & expressions.
75         * mpn/generic/toom44_mul.c: Likewise.
76         * mpn/generic/toom53_mul.c: Likewise.
77         * mpn/generic/toom62_mul.c: Likewise.
78         * tests/mpn/t-bdiv.c: Simplify conditional printing of whitespace.
79         * tests/mpn/t-div.c: Likewise.
81 2015-10-15 Marco Bodrato <bodrato@mail.dm.unipi.it>
83         * configfsf.sub: Updated to version 2015-08-20, from gnulib.
84         * configfsf.guess: Updated to version 2015-09-14, from gnulib.
86 2015-10-14  Torbjörn Granlund  <torbjorng@google.com>
88         * demos/pexpr.c (main): Clear out a variable.
90         * mpn/generic/sqrlo_basecase.c: Move things before addmul_1 to reduce
91         register pressure.
93         * .hgignore: Add 'compile' and 'test-driver'.
95         * mpn/generic/mu_bdiv_qr.c (mpn_mu_bdiv_qr_itch): Simplify, add ASSERT.
96         * mpn/generic/mu_bdiv_q.c (mpn_mu_bdiv_q_itch): Likewise.
98         * tune/tuneup.c (tune_mu_bdiv): Start at measured BDIV_DC_ thresholds.
100 2015-10-13 Marco Bodrato <bodrato@mail.dm.unipi.it>
102         * mpf/clears.c, mpf/inits.c, mpq/clears.c, mpq/inits.c,
103         * mpz/clears.c, mpz/inits.c: Keep on supporting empty list.
105 2015-10-13  Marc Glisse  <marc.glisse@inria.fr>
107         * gmpxx.h (__GMPP_DEFINE_BINARY_TYPE_FUNCTION): Allow mixed operations.
108         (__gmp_cmp_function, __gmp_binary_equal, __gmp_binary_less):
109         Handle mixed operations.
110         (__gmp_cmp_function): Move before __gmp_binary_equal.
112 2015-10-13 Marco Bodrato <bodrato@mail.dm.unipi.it>
114         * mpf/pow_ui.c: Increased precision of partial results.
116 2015-10-12  Torbjörn Granlund  <torbjorng@google.com>
118         * configure.ac: Reject AVX for NetBSD.
120 2015-10-11  Torbjörn Granlund  <torbjorng@google.com>
122         * configure.ac (fat_path): Add skylake.
124 2015-10-10 Marco Bodrato <bodrato@mail.dm.unipi.it>
126         * gen-fib.c: Correct the name of the program in error message.
127         * gen-fac.c: Likewise.
129         * mpf/get_str.c: Increase precision of base^e computation.
131 2015-10-09  Torbjörn Granlund  <torbjorng@google.com>
133         * config.guess: Recognise cabylake and goldmont and more versions of
134         skylake and silvermont.
135         * acinclude.m4 (X86_64_PATTERN): Add cabylake and goldmont.
136         * config.sub: Corresponding changes.
137         * configure.ac: Corresponding changes.
138         * mpn/x86_64/fat/fat.c: Corresponding changes.
140 2015-09-12  Torbjörn Granlund  <torbjorng@google.com>
142         * mpf/clear.c, mpf/clears.c, mpf/inits.c, mpq/clear.c, mpq/clears.c
143         * mpq/inits.c, mpz/clear.c, mpz/clears.c, mpz/inits.c:
144         Streamline, use macros.
146 2015-09-27 Marco Bodrato <bodrato@mail.dm.unipi.it>
148         * mpz/cfdiv_r_2exp.c: Use mpn_neg and MPZ_NEWALLOC.
149         * mpz/cfdiv_q_2exp.c: Use MPZ_REALLOC return value.
151 2015-09-12  Torbjörn Granlund  <torbjorng@google.com>
153         * tests/mpf/t-cmp_si.c (check_data): Set precision reflecting data.
155 2015-09-11 Marco Bodrato <bodrato@mail.dm.unipi.it>
157         * mpf/cmp_z.c: New file implementing mpf_cmp_z.
158         * mpf/Makefile.am (libmpf_la_SOURCES): Add it.
159         * Makefile.am (MPF_OBJECTS): Add generate object to libs.
160         * gmp-h.in: Declare new function.
161         * tests/mpf/t-cmp_si.c: Test also the new function.
162         * doc/gmp.texi: Document it.
164 2015-09-06  Torbjörn Granlund  <torbjorng@google.com>
166         * Wrap remaining limb allocations in __GMP_ALLOCATE_FUNC_LIMBS.
168         * mpn/x86/fat/fat.c (fake_cpuid_table): Add missing commas.
169         * mpn/x86_64/fat/fat.c: Likewise.
171         * mpn/x86/fat/fat.c (fake_cpuid_table): Improve struct type.
172         * mpn/x86/fat/fat.c: Likewise.
174 2015-09-03 Marco Bodrato <bodrato@mail.dm.unipi.it>
176         * tests/mpq/t-cmp_z.c (sizes_test): New function, tests sizes.
178 2015-09-03  Torbjörn Granlund  <torbjorng@google.com>
180         * acinclude.m4 (GMP_C_HIDDEN_ALIAS): New.
181         * configure.ac (GMP_C_HIDDEN_ALIAS): Invoke.
183 2015-09-01 Marco Bodrato <bodrato@mail.dm.unipi.it>
185         * mpq/cmp.c (mpq_cmp_numden): Cast to avoid over/underflow.
186         * tests/mpn/t-toom22.c (MIN_AN): Use defined value.
187         * tests/mpz/t-fac_ui.c: Check big factorial modulo a larger prime.
188         * mpn/generic/bsqrtinv.c: Use sqrlo+mullo_n instead of powlo(,,3,,).
189         * mpq/div.c: Move a branch out of the normal flow.
191 2015-08-31  Torbjörn Granlund  <torbjorng@google.com>
193         * mpn/x86/fat/fat.c (fake_cpuid_table): Update similarly to
194         corresponding x86_64 code.
196 2015-08-31 Marco Bodrato <bodrato@mail.dm.unipi.it>
198         * mpq/cmp.c (mpq_cmp_z): New function to compare mpq with mpz,
199         asked by Vincent Delecroix for the SageMath project.
200         * gmp-h.in: Declare it.
201         * doc/gmp.texi: Document it.
202         * tests/mpq/t-cmp_z.c: New file to test mpq_cmp_z (from t-cmp.c).
203         * tests/mpq/Makefile.am (check_PROGRAMS): Add t-cmp_z.
205         * mpn/generic/powlo.c: Use mpn_sqrlo.
207 2015-08-29  Torbjörn Granlund  <torbjorng@google.com>
209         * mpn/x86_64/fat/fat.c (fake_cpuid_table): Add CPU aliases.
211 2015-08-25 Marco Bodrato <bodrato@mail.dm.unipi.it>
213         * configure.ac (AH_VERBATIM): Add HAVE_NATIVE_mpn_mullo_basecase.
214         * mpn/generic/sqrlo.c (mpn_sqrlo): Use mullo_basecase when faster.
215         * mpn/generic/sqrlo_basecase.c: More readable #defines.
217         * tune/tuneup.c (tune_sqrlo): New function to tune sqrlo thresholds.
218         (all): Call it, after multiplication and FFT.
219         * tune/Makefile.am (TUNE_MPN_SRCS_BASIC): Add sqrlo{,_basecase}.c .
220         * gmp-impl.h: Add all SQRLO_*_THRESHOLD* defs, for tuning and default.
221         * mpn/generic/sqrlo.c: Remove default threshold definitions.
222         * mpn/generic/sqrlo_basecase.c: Use SQRLO_DC_THRESHOLD_LIMIT.
223         * mpn/minithres/gmp-mparam.h: New SQRLO_*_THRESHOLDs.
225         * tune/tuneup.c (tune_mullo): Set MULLO_MUL_N_THRESHOLD to never
226         whenever the FFT threshold does not exist.
228         * mpf/cmp.c: Remove some branches.
230 2015-08-25  Torbjörn Granlund  <torbjorng@google.com>
232         * mpn/x86_64/x86_64-defs.m4: Output computed numbers in base-10 instead
233         of base-16 to avoid bugs on Solaris, FreeBSD, and old NetBSD.
235 2015-08-23  Torbjörn Granlund  <torbjorng@google.com>
237         * mpn/x86_64/fat/fat.c (fake_cpuid_table): Add more entries, handle
238         Broadwell separately.
240         * configure.ac (fat_path): Add coreibwl.
242 2015-08-18 Marco Bodrato <bodrato@mail.dm.unipi.it>
244         * mpn/generic/rootrem.c (logbased_root): New function.
245         (mpn_rootrem_internal): Use it to estimate highest 9 bits of the root.
247         * gmp-impl.h (MPQ_PTR_SWAP, MPQ_SRCPTR_SWAP): New macros.
249 2015-08-17  Torbjörn Granlund  <torbjorng@google.com>
251         * acinclude.m4 (X86_64_PATTERN): Add skylake.
252         * config.guess: Corresponding changes.
253         * config.sub: Corresponding changes.
254         * configure.ac: Corresponding changes.
255         * mpn/x86_64/skylake/gmp-mparam.h: New file.
257 2015-08-15  Torbjörn Granlund  <torbjorng@google.com>
259         * mpn/generic/mullo_basecase.c: Provide alternative code, make default.
261 2015-08-04 Marco Bodrato <bodrato@mail.dm.unipi.it>
263         * tests/refmpn.c (refmpn_sqrlo): New function.
264         * tests/tests.h: Define it.
266         * mpn/generic/sqrlo.c: New file, new function.
267         * mpn/generic/sqrlo_basecase.c: New file, new function.
268         * gmp-impl.h (mpn_sqrlo, mpn_sqrlo_basecase): Declare them.
269         * configure.ac (gmp_mpn_functions): Add new files.
271         * tests/mpn/t-sqrlo.c: New file, new test.
272         * tests/mpn/Makefile.am (check_PROGRAMS): Add new test.
273         * tests/devel/try.c: Support mpn_sqrlo and mpn_sqrlo_basecase.
275         * tune/common.c (speed_mpn_sqrlo{,_basecase}): New functions.
276         * tune/speed.c: Support new functions.
277         * tune/speed.h (SPEED_ROUTINE_MPN_MULLO_BASECASE): Update.
278         (SPEED_ROUTINE_MPN_SQRLO): New macro.
280         * mpn/generic/rootrem.c: Avoid divisions if not needed.
282         * tests/mpn/t-broot.c: Test also k=1.
283         * mpz/aorsmul_i.c: Move branches out of main line.
285 2015-07-28 Marco Bodrato <bodrato@mail.dm.unipi.it>
287         * mpn/generic/sqrtrem.c (mpn_dc_sqrt): Support odd sizes.
289 2015-07-16  Torbjörn Granlund  <torbjorng@google.com>
291         * tune/speed.c: Remove now redundant MPN_FILL.
293         * configure.ac (hppa-hpux): Never use O3 optimisation.
295 2015-07-09  Torbjörn Granlund  <torbjorng@google.com>
297         * mpn/ia64/add_n_sub_n.asm: Make it work for HP-UX.
298         * mpn/ia64/addmul_2.asm: Likewise.
299         * mpn/ia64/aors_n.asm: Likewise.
300         * mpn/ia64/aorsorrlshC_n.asm: Likewise.
301         * mpn/ia64/cnd_aors_n.asm: Likewise.
302         * mpn/ia64/gcd_1.asm: Likewise.
303         * mpn/ia64/lshiftc.asm: Likewise.
304         * mpn/ia64/mod_34lsub1.asm: Likewise.
305         * mpn/ia64/mul_2.asm: Likewise.
306         * mpn/ia64/sec_tabselect.asm: Likewise.
307         * mpn/ia64/sqr_diag_addlsh1.asm: Likewise.
309 2015-07-01 Marco Bodrato <bodrato@mail.dm.unipi.it>
311         * gmp-impl.h (MPN_FILL): New macro, generalise MPN_ZERO.
313         * mpn/generic/sqrtrem.c (mpn_dc_sqrt): New function not computing remainder.
314         (mpn_dc_sqrtrem): Use tdiv_q instead of divrem, use given scratch space.
315         (mpn_sqrtrem): Use mpn_dc_sqrt for both even and odd sizes.
317 2015-06-24  Torbjörn Granlund  <torbjorng@google.com>
319         * mpn/x86_64/fastsse/com.asm: Disalllow zero size operands.
321         * mpn/x86_64/fastsse/copyi.asm: Suppress looping in basecase code.
323 2015-06-23 Marco Bodrato <bodrato@mail.dm.unipi.it>
325         * mpn/generic/sqrtrem.c (mpn_sqrtrem2): Simplify branches.
326         (mpn_dc_sqrtrem): Don't compute remainder if not needed.
328 2015-06-23  Torbjörn Granlund  <torbjorng@google.com>
330         * gmp-impl.h: Remove K&R stringize support.
331         * tests/devel/try.c: Likewise.
332         * tests/t-constants.c: Likewise.
333         * tests/mpf/t-fits.c: Likewise.
334         * tests/mpz/t-fits.c: Likewise.
336         * configure.ac (AC_C_STRINGIZE): Remove.
338 2015-06-15 Marco Bodrato <bodrato@mail.dm.unipi.it>
340         * tests/devel/try.c: Support mpn_sqrt (sqrtrem with remainder = NULL).
341         * mpn/generic/sqrtrem.c: Reorder branches for single limb operands.
343 2015-06-15  Torbjörn Granlund  <torbjorng@google.com>
345         * config.guess: Rewrite code for AVX handling to deal with broken cpuid
346         states.
348 2015-06-11  Torbjörn Granlund  <torbjorng@google.com>
350         * mpn/x86/k7/gcd_1.asm: Align stack for calls.
351         * mpn/x86/p6/gcd_1.asm: Amend last change: align for PIC and non-PIC.
353 2015-06-10 Marco Bodrato <bodrato@mail.dm.unipi.it>
355         * mpn/generic/sqrtrem.c: Use sqrtrem1 for single limb operands.
357         * tests/mpz/t-root.c: Check also mpz_root return value.
358         * mpn/generic/rootrem.c: Shorten first and last loop.
360         * mpn/generic/toom2_sqr.c: Add some ASSERTs.
361         * mpn/generic/toom22_mul.c: Likewise.
362         * tests/mpn/t-toom22.c: stop testing some unsafe (unused) corner cases.
364 2015-06-08  Torbjörn Granlund  <torbjorng@google.com>
366         * mpn/x86/p6/gcd_1.asm: Align stack for calls.
368 2015-06-06  Torbjörn Granlund  <torbjorng@google.com>
370         * config.sub: Recognise any arm*neon CPU.
371         * configure.ac (powerpc): Add p8 directory for power8 and later.
372         * mpn/powerpc64/mode64/p8/invert_limb.asm: New file.
374 2015-06-01  Torbjörn Granlund  <torbjorng@google.com>
376         * tune/speed.c (routine): Measure "mpn_sqrt" and "mpn_root", which are
377         really the corresponding "rem" functions with NULL remainder argument.
379         * tune/speed.h (SPEED_ROUTINE_MPN_SQRTROOT_CALL): New.
380         (SPEED_ROUTINE_MPN_SQRTREM, SPEED_ROUTINE_MPN_ROOTREM): Remove.
382         * tune/common.c (speed_mpn_sqrt, speed_mpn_root): New functions.
383         (speed_mpn_sqrtrem): Use SPEED_ROUTINE_MPN_SQRTROOT_CALL
384         (speed_mpn_rootrem): Likewise.
386 2015-05-30 Marco Bodrato <bodrato@mail.dm.unipi.it>
388         * mpf/cmp_ui.c: Use macros, remove branches, correct nails.
389         * mpf/cmp_si.c: Likewise.
390         * mpf/int_p.c: Use a simpler loop to ignore zero limbs.
392         * mpf/sqrt_ui.c: Special case for sqrt(1).
393         * tests/mpf/t-sqrt_ui.c: Test special cases.
395         * gmp-h.in: Declare (and inline) mpn_zero_p.
396         * gmp-impl.h: Remove mpn_zero_p.
397         * mpn/generic/zero_p: New file to include the function in the library.
398         * configure.ac (gmp_mpn_functions): Add it.
399         * doc/gmp.texi: Document it.
401         * mpz/combit.c: Call mpn_zero_p only if size is not zero.
402         * mpz/scan1.c: Likewise.
403         * tests/mpn/t-brootinv.c: Likewise.
404         * tests/mpn/t-div.c: Likewise.
405         * tests/mpn/t-minvert.c: Likewise.
407         * mini-gmp/mini-gmp.h: Declare mpn_zero_p.
408         * mini-gmp/mini-gmp.c: Define mpn_zero_p as a function, not a macro.
410 2015-05-28  Niels Möller  <nisse@lysator.liu.se>
412         * doc/gmp.texi (Low-level Functions): Document mpn_divexact_1 and
413         mpn_cnd_swap (the latter was forgotten for the 2015-02-08 change).
415 2015-05-28  Linus Nordberg  <linus@nordberg.se>
417         * configure.ac: Remove double quotes in help strings, make some
418         clarifications.
420 2015-05-24 Marco Bodrato <bodrato@mail.dm.unipi.it>
422         * mpq/div.c: Reduce memory use.
423         * tests/mpq/reuse.c: Test also mpq_FUNCTION (x,x,x).
424         * mpz/swap.c: Use _SWAP macros.
426 2015-05-18  Torbjörn Granlund  <torbjorng@google.com>
428         * configure.ac (arm): Let compiler decide about arm vs thumb encoding.
430 2015-05-18 Marco Bodrato <bodrato@mail.dm.unipi.it>
432         * gmp-h.in (mpn_neg): Niels' code using mpn_neg.
433         * gmp-h.in (mpn_com): Unconditionally declare prototype.
435 2015-05-17  Torbjörn Granlund  <torbjorng@google.com>
437         * mpn/arm/v6/sqr_basecase.asm: Rewrite for speed.
439 2015-05-16  Torbjörn Granlund  <torbjorng@google.com>
441         * mpn/arm/v6/addmul_2.asm: Rewrite for speed and size.
443 2015-05-15  Torbjörn Granlund  <torbjorng@google.com>
445         * mpn/arm/v7a/cora7/gmp-mparam.h: New file.
446         * mpn/arm/v7a/cora8/gmp-mparam.h: New file.
447         * configure.ac (arm): Point to new directories.
449 2015-05-15 Marco Bodrato <bodrato@mail.dm.unipi.it>
451         * mpn/generic/invertappr.c: Reduce memory usage.
452         * gmp-impl.h (mpn_invertappr_itch): Update accordingly.
453         * tune/tuneup.c (tune_invertappr, tune_invert): Update min_size.
455         * mpn/generic/mu_div_qr.c: Pass scratch memory to mpn_invertappr.
456         * mpn/generic/mu_divappr_q.c: Likewise.
458 2015-05-12  Felix Janda  <felix.janda@posteo.de>
460         * mpn/powerpc32/elf.m4 (LEA): Adopt to new ABI.
462 2015-05-09 Marco Bodrato <bodrato@mail.dm.unipi.it>
464         * mpn/generic/invertappr.c: Reduce memory usage.
465         * gmp-impl.h (mpn_invertappr_itch): Update accordingly.
467 2015-05-01  Torbjörn Granlund  <torbjorng@google.com>
469         * tune/tuneup.c (all): Make GCD tuning last since it is not robust.
471 2015-04-27  Torbjörn Granlund  <torbjorng@google.com>
473         * mpn/x86_64/coreibwl/gmp-mparam.h: New file.
475 2015-04-26  Torbjörn Granlund  <torbjorng@google.com>
477         * mpn/x86_64/coreibwl/mul_basecase.asm: New file.
478         * mpn/x86_64/coreibwl/sqr_basecase.asm: New file.
480 2015-04-26 Marco Bodrato <bodrato@mail.dm.unipi.it>
482         * tune/common.c (speed_mpn_neg, speed_mpz_2fac_ui): New functions.
483         (speed_mpn_add_1, speed_mpn_add_1_inplace): New functions.
484         (speed_mpn_sub_1, speed_mpn_sub_1_inplace): New functions.
485         * tune/speed.h: Declare them all.
486         * tune/speed.c (routine): Added mpn_neg, mpn_add_1, mpn_sub_1,
487         mpn_add_1_inplace, mpn_sub_1_inplace, and mpz_2fac_ui.
489 2015-04-25 Marco Bodrato <bodrato@mail.dm.unipi.it>
491         * mpn/generic/invert.c: Split add in the correction test.
492         * mpn/generic/invertappr.c: Cleanup of loops and branches.
494         * mpn/generic/hgcd_reduce.c: Use TMP_ALLOC_LIMBS_3.
495         * mpn/generic/powm.c: Use TMP_ALLOC_LIMBS_2.
496         * mpn/generic/rootrem.c: Likewise.
497         * mpn/generic/remove.c: Remove redundant #ifdef.
498         * mpn/generic/perfpow.c: Likewise.
500 2015-04-21  Torbjörn Granlund  <torbjorng@google.com>
502         * printf/sprintffuns.c (gmp_sprintf_final): Remove extra parameters.
504         * mpn/arm/v6/popham.asm: Add MULFUNC_PROLOGUE.
505         * mpn/powerpc64/mode64/rsh1aors_n.asm: Likewise.
506         * mpn/powerpc64/mode64/p6/aorsmul_1.asm: Likewise.
508 2015-04-19  Torbjörn Granlund  <torbjorng@google.com>
510         * mpn/x86_64/x86_64-defs.m4 (oplist): Fix typo.
511         (mulx): Simplify.
512         (adcx, adox): New defines, using helper function adx.
513         * mpn/x86_64/coreibwl/mul_1.asm: New file.
514         * mpn/x86_64/coreibwl/addmul_1.asm: New file.
515         * configure.ac (x86_64): Put coreibwl in appropriate code path.
517         * configure.ac (x86_64): Pass more exact Intel CPU options.
519 2015-04-13  Torbjörn Granlund  <torbjorng@google.com>
521         * longlong.h (arm): Rewrite.  Support thumb2; use gcc builtins for
522         count_leading_zeros, use accurate code selection critera.
524 2015-04-13  Marc Glisse  <marc.glisse@inria.fr>
526         * configure.ac (x86_64): Extend noavx to ABI=64.
528 2015-04-10  Torbjörn Granlund  <torbjorng@google.com>
530         * mpn/alpha/ev6/mod_1_4.asm: Use LDGP.
532 2015-04-01  Torbjörn Granlund  <torbjorng@google.com>
534         * configure.ac (sparc): Don't use use -xO4, it miscompiles by design.
536 2015-03-24  Torbjörn Granlund  <torbjorng@google.com>
538         * mpn/generic/mul_fft.c (mpn_fft_best_k): Don't make pointers `static'
539         just because they point to static (i.e., file-local) data.
541 2015-03-15  Torbjörn Granlund  <torbjorng@google.com>
543         * acinclude.m4 (X86_64_PATTERN): Add CPU code names.
545         * config.guess: Add more CPUs, use CPU code names.
546         * config.sub: Corresponding changes.
547         * configure.ac: Corresponding changes.
549 2015-02-21  Niels Möller  <nisse@lysator.liu.se>
551         * gmp-h.in (mpn_divexact_1): New public declaration.
552         * gmp-impl.h: Moved from here.
554 2015-02-08  Niels Möller  <nisse@lysator.liu.se>
556         * doc/gmp.texi (Low-level Functions): Document mpn_cnd_swap.
558         * mpn/generic/cnd_swap.c (mpn_cnd_swap): New file, moved function
559         here. Also changed cnd argument type from int to mp_limb_t.
560         * mpn/generic/sec_invert.c (mpn_cnd_swap): Old location.
561         * configure.ac: Added cnd_swap.
562         * gmp-h.in (mpn_cnd_swap): Added prototype.
564 2015-01-19  Torbjörn Granlund  <torbjorng@google.com>
566         * configure.ac (arm): Provide architecture specific configs in addition
567         to implementation specific configs.
569         * config.guess (arm): Use configfsf.guess's guess as default before
570         conditionally appending "neon".
572 2015-01-08  Torbjörn Granlund  <torbjorng@google.com>
574         * config.guess: Match POWER8 for AIX.
576         * longlong.h: Add many casts inside assembly input operands, this
577         insures proper zero extension.
579 2014-12-27  Marc Glisse  <marc.glisse@inria.fr>
581         * gmpxx.h (__gmp_unary_expr): Use __gmp_resolve_ref.
582         (__gmp_expr): New specialization for unary expressions with
583         a builtin argument.
585 2014-12-26  Marc Glisse  <marc.glisse@inria.fr>
587         * gmp-impl.h (tmp_debug_entry_t): Change block to type void*.
589 2014-12-22  Torbjörn Granlund  <torbjorng@google.com>
591         * longlong.h (mips64, mips32): Work around one clang bug.
593 2014-12-18  Torbjörn Granlund  <torbjorng@google.com>
595         * longlong.h (umul_ppmm): Use input temps in more places.
597 2014-12-10  Marc Glisse  <marc.glisse@inria.fr>
599         * tests/cxx/clocale.c (localeconv, nl_langinfo): Match glibc's
600         prototype in C++.
602 2014-12-09  Torbjörn Granlund  <torbjorng@google.com>
604         * configure.ac (powerpc): Remove hardwired -mpowerpc, causes clang
605         problems.  Optionally pass -m32.
607 2014-12-08  Marc Glisse  <marc.glisse@inria.fr>
609         * config.guess (ultrasparc*-*-*): Update for T4 and T5.
610         * config.sub (ultrasparc*-*-*): Update for T5.
611         * configure.ac (ultrasparc*-*-*): Update for T5.
613         * longlong.h (sparc64): Define COUNT_LEADING_ZEROS_NEED_CLZ_TAB
614         with VIS3.
616         * tests/misc/t-locale.c (localeconv, nl_langinfo): Match glibc's
617         prototype in C++.
618         * tests/mpf/t-get_si.c (check_limbdata): Avoid narrowing conversion
619         from -1 to unsigned inside {}.
621 2014-12-02  Torbjörn Granlund  <torbjorng@google.com>
623         * config.guess (arm*-*-*): Redirect stderr.
625 2014-11-26  Torbjörn Granlund  <torbjorng@google.com>
627         * configure.ac (arm*-*-*): Optionally pass redundant fpu mode options
628         in order to placate clang.
630         * mpn/arm/neon/lshiftc.asm: Avoid insn form missing from clang.
632 2014-11-24  Torbjörn Granlund  <torbjorng@google.com>
634         * configure.ac (mips*-*-*): Provide ABI synonyms (for clang pretending
635         to be gcc).
637 2014-11-18  Torbjörn Granlund  <torbjorng@google.com>
639         From Hannes Mehnert:
640         * config.guess (arm*-*-*): Base guesses on first matching /proc/cpuinfo
641         line.
643 2014-11-17  Torbjörn Granlund  <torbjorng@google.com>
645         * longlong.h (__longlong_h_C): New macro.
646         (mpn_umul_ppmm, etc): Use it for C++ support.
648 2014-11-15  Torbjörn Granlund  <torbjorng@google.com>
650         * tests/mpz/reuse.c: Make function vectors 'static'.
652         * tests/mpn/logic.c (check_one): Make string variable 'const'.
654         * tests/mpz/t-perfpow.c (tests): Make 'static'.
656         * tune/tuneup.c (fftmes): Remove an unused variable.
658 2014-11-15  Marc Glisse  <marc.glisse@inria.fr>
660         * tests/amd64check.c (calling_conventions_fenv): Mark as extern "C".
661         * tests/x86check.c (calling_conventions_fenv): Likewise.
663 2014-11-13  Hans Wennborg  <hwennborg@google.com>
665         * mpn/generic/toom_interpolate_8pts.c: Fix operator precedence in
666         ASSERT.
668 2014-11-13  Torbjörn Granlund  <torbjorng@google.com>
670         * tune/speed.h: Add casts for C++ compatibility.
671         (speed_cyclecounter): Mark as extern "C".
672         (mpn_mod_1_1p_1, mpn_mod_1_1p_2): Correct prototype.
674         * tune/tune-gcd-p.c: Add casts for C++ compatibility.
676         * tune/tuneup.c:  Add casts for C++ compatibility.
677         (mpn_divrem_1_tune, mpn_mod_1_tune): Mark as extern "C".
678         (INSERT_FFTTAB): Produce sentinels differently to silence compiler.
680 2014-11-12  Torbjörn Granlund  <torbjorng@google.com>
682         * gen-psqr.c: Add casts for C++ compatibility.
684         * tests/misc/t-scanf.c: Include config.h early for HAVE_xxx.
686 2014-11-08  Torbjörn Granlund  <torbjorng@google.com>
688         * mpn/x86/x86-defs.m4 (LEA, LEAL): Make sure to put eip stub code in
689         text segment.
690         * mpn/x86/darwin.m4: Likewise.
692         * tune/speed.h (i386 speed_cyclecounter): Remove inline asm code, rely
693         on external version.
695 2014-11-06  Torbjörn Granlund  <torbjorng@google.com>
697         * config.guess: Ignore appended letters such E in POWER8E.
698         * configure.ac: Supply cflags for power8, power9.
700 2014-11-03  Torbjörn Granlund  <torbjorng@google.com>
702         * mpn/powerpc32/addmul_1.asm: Avoid negative stack pointer references.
703         * mpn/powerpc32/lshift.asm: Likewise.
704         * mpn/powerpc32/lshiftc.asm:  Likewise.
705         * mpn/powerpc32/p3-p7/aors_n.asm:  Likewise.
706         * mpn/powerpc32/rshift.asm:  Likewise.
707         * mpn/powerpc32/sec_tabselect.asm:  Likewise.
708         * mpn/powerpc32/submul_1.asm:  Likewise.
709         * mpn/powerpc32/vmx/mod_34lsub1.asm:  Likewise.
711 2014-10-13  Torbjörn Granlund  <torbjorng@google.com>
713         * acinclude.m4 (freebsd hacked gcc): Test for crash-prone FreeBSD gcc.
715 2014-10-03  Peter Breitenlohner <peb@mppmu.mpg.de>
717         * mpn/generic/sec_tabselect.c: Adjust type to silence compiler.
719 2014-10-01  Torbjörn Granlund  <torbjorng@google.com>
721         * All Makefile.am: INCLUDES => AM_CPPFLAGS.
723         * configure.ac (arm64): Set gcc_cflags_maybe to enable Neon (for clang
724         pretending to be gcc).
726 2014-09-24  Marc Glisse  <marc.glisse@inria.fr>
728         * longlong.h (arm64 count_trailing_zeros, count_leading_zeros): Use
729         gcc's builtins.
730         (arm64 umul_ppmm): Use macro arguments only once.
732 2014-09-22  Marc Glisse  <marc.glisse@inria.fr>
734         * mpn/arm64/lshift.asm: Avoid negative immediates.
735         * mpn/arm64/rshift.asm: Likewise.
737 2014-09-13  Marc Glisse  <marc.glisse@inria.fr>
739         * mpn/generic/div_qr_1n_pi1.c: Honor NO_ASM.
740         * mpn/generic/div_qr_1n_pi2.c: Likewise.
741         * mpn/generic/div_qr_1u_pi2.c: Likewise.
742         * mpn/generic/div_qr_2.c: Likewise.
743         * mpn/generic/mod_1_1.c: Likewise.
744         * mpn/generic/redc_2.c: Likewise.
746 2014-08-31  Torbjörn Granlund  <tege@gmplib.org>
748         * mpn/arm64/lshift.asm: New file.
749         * mpn/arm64/rshift.asm: New file.
751 2014-09-01 Marco Bodrato <bodrato@mail.dm.unipi.it>
753         * gmp-impl.h (TMP_ALLOC_LIMBS_3): New macro to allocate 3 blocks.
754         (mpn_remove): Update declaration with mp_srcptr arguments.
755         * mpn/generic/remove.c: Use TMP_ALLOC_LIMBS_3. mp_srcptr for args.
757         * mpn/generic/perfpow.c (pow_equals): TMP_DECL only where needed.
758         (perfpow): Use TMP_ALLOC_LIMBS_3.
759         (mpn_perfect_power_p): Skip useless allocations. Use mpn_remove.
760         * tests/mpz/t-perfpow.c (check_random): Check more perfect powers.
762         * mpn/generic/divis.c: Use TMP_ALLOC_LIMBS_2. Share a count.
764 2014-08-30  Torbjörn Granlund  <tege@gmplib.org>
766         * mpn/arm64/mod_34lsub1.asm: New file.
768 2014-08-27  Niels Möller  <nisse@lysator.liu.se>
770         * mini-gmp/mini-gmp.c (mpz_abs_sub_bit): Do full normalization,
771         needed if mpz_clrbit clears the most significant one bit.
773 2014-08-23  Torbjörn Granlund  <tege@gmplib.org>
775         * mpn/arm64/bdiv_dbm1c.asm: New file.
777         * mpn/arm64/com.asm: New file.
779         * mpn/arm64/sec_tabselect.asm: New file.
781         * mpn/arm64/popcount.asm: New file.
782         * mpn/arm64/hamdist.asm: New file.
784         * configure.ac: Put generic arm/neon earlier in path.
786 2014-08-14 Marco Bodrato <bodrato@mail.dm.unipi.it>
788         * mpq/canonicalize.c: Earlier check for negative denominator.
789         * mpq/set_d.c: Stricter allocation.
791 2014-08-03  Torbjörn Granlund  <tege@gmplib.org>
793         * mpn/x86_64/bobcat/mul_1.asm: Fix typo in offset affecting DOS64.
795 2014-07-28 Marco Bodrato <bodrato@mail.dm.unipi.it>
797         * mpn/generic/fib2_ui.c: remove #if HAVE_NATIVE_mpn_rsblsh_n.
798         * mpz/fib2_ui.c: Use tabulated values, when available.
799         * mpz/fib_ui.c: #if HAVE_NATIVE_mpn_addlsh1_n, use it.
801         * mpq/cmp_ui.c: Remove a branch.
802         * mpq/cmp_si.c: Likewise.
804         * mpn/generic/toom_interpolate_7pts.c: Replace an in-place add
805         with add_n + INCR_U.
807         * tests/mpf/t-fits.c: use ui_sub instead of sub_ui+neg.
809         * mini-gmp/mini-gmp.c: Remove some useless variables.
811 2014-07-27  Torbjörn Granlund  <tege@gmplib.org>
813         * mpn/x86/k7/gcd_1.asm: Use LEAL.
815         * mpn/x86/x86-defs.m4 (LEAL): New.
816         (LEA): Append to `load_eip' instead of ASM_END, like darwin.m4.
817         * mpn/x86/darwin.m4 (LEAL): New.
819 2014-07-26  Torbjörn Granlund  <tege@gmplib.org>
821         * mpn/x86/pentium/mode1o.asm: Add Darwin PIC code.
822         * mpn/x86/pentium/bdiv_q_1.asm: Likewise.
823         * mpn/x86/pentium/dive_1.asm: Likewise.
824         * mpn/x86/pentium/popcount.asm: Likewise.
825         * mpn/x86/pentium/hamdist.asm: Likewise.
826         * mpn/x86/k6/gcd_1.asm: Likewise.
828         * mpn/x86: Append ASM_END to many files.
829         * tests/x86call.asm: Append ASM_END.
831         * mpn/x86/fat/fat_entry.asm (FAT_ENTRY, FAT_INIT):
832         Support Darwin.
834         * mpn/x86/darwin.m4 (ASM_END): New, body from EPILOGUE_cpu.
835         (EPILOGUE_cpu): Remove.
837         * mpn/x86/x86-defs.m4 (LEA): Put `mov_eip_' thunks in ASM_END instead
838         of EPILOGUE_cpu.
840 2014-07-05  Niels Möller  <nisse@lysator.liu.se>
842         * doc/gmp.texi (Low-level Functions): Document that scratch need
843         for mpn_sec_add_1 and mpn_sec_sub_1 are at most n limbs.
844         (Low-level Functions): Document allowed overlap for mpn_addmul_1
845         and mpn_submul_1.
847 2014-07-02  Torbjörn Granlund  <tege@gmplib.org>
849         * mpn/x86_64/x86_64-defs.m4: Fix quoting.
851         * mpn/x86_64/atom/redc_1.asm: Enforce proper stack allocation.
852         * mpn/x86_64/bobcat/redc_1.asm: Likewise.
853         * mpn/x86_64/core2/divrem_1.asm: Likewise.
854         * mpn/x86_64/core2/gcd_1.asm: Likewise.
855         * mpn/x86_64/core2/redc_1.asm: Likewise.
856         * mpn/x86_64/coreihwl/redc_1.asm: Likewise.
857         * mpn/x86_64/coreinhm/redc_1.asm: Likewise.
858         * mpn/x86_64/coreisbr/redc_1.asm: Likewise.
859         * mpn/x86_64/divrem_1.asm: Likewise.
860         * mpn/x86_64/divrem_2.asm: Likewise.
861         * mpn/x86_64/gcd_1.asm: Likewise.
862         * mpn/x86_64/mod_1_1.asm: Likewise.
863         * mpn/x86_64/mod_1_2.asm: Likewise.
864         * mpn/x86_64/mod_1_4.asm: Likewise.
866 2014-06-30  Torbjörn Granlund  <tege@gmplib.org>
868         * config.sub: Generalise x86 patterns.
870 2014-06-17  Marc Glisse  <marc.glisse@inria.fr>
872         * gmpxx.h (__gmp_gcd_function, __gmp_lcm_function): New classes.
873         (gcd, lcm): New functions.
874         * doc/gmp.texi (C++ Interface Integers): Document them.
875         * tests/cxx/t-ops2.cc (checkz): Test them.
877 2014-06-16  Torbjörn Granlund  <tege@gmplib.org>
879         * mpf/mul.c: Postpone TMP_MARK.
881         * mpn/generic/perfpow.c (perfpow): Combine TMP_ALLOCs.
883 2014-06-15  Torbjörn Granlund  <tege@gmplib.org>
885         * tests/refmpn.c (refmpn_mul): Rewrite to avoid O(n) recursion depth.
887 2014-06-09  Torbjörn Granlund  <tege@gmplib.org>
889         * mpn/generic/mullo_n.c: Remove default THRESHOLDs.
890         * gmp-impl.h: Put MULLO THRESHOLDs here.  Improve various THRESHOLD
891         defaults.
893 2014-06-08  Torbjörn Granlund  <tege@gmplib.org>
895         * gmp-impl.h (TMP_ALLOC): Decrease limit to about half.
897         * mpn/generic/toom53_mul.c: Replace many TMP_SALLOC invocations
898         by a single TMP_ALLOC.
899         * mpn/generic/toom42_mul.c: Likewise.
901         * mpn/generic/sec_sqr.c: Don't unconditionally call mpn_sqr_basecase
902         since it fails for non-cryptographic sizes for some obsolete CPUs.
904         * mpn/generic/sec_powm.c: Remove own squaring code, instead use
905         mpn_mul_basecase.
907         * tests/mpn/logic.c (main): Don't use TMP_SALLOC_LIMBS.
909         * mpn/generic/dcpi1_div_q.c: Avoid TMP_SALLOC_LIMBS.
910         * mpn/generic/dcpi1_div_qr.c: Likewise.
912 2014-06-08 Marco Bodrato <bodrato@mail.dm.unipi.it>
914         * mpn/generic/mul.c: Tighter allocation in Toom{2,3}X branches.
916 2014-06-06  Torbjörn Granlund  <tege@gmplib.org>
918         * mpn/generic/mul.c: Swap some TMP_SALLOC_LIMBS for TMP_ALLOC_LIMBS
919         and some TMP_ALLOC_LIMBS for TMP_SALLOC_LIMBS.
921 2014-05-31 Marco Bodrato <bodrato@mail.dm.unipi.it>
923         * mpf/ui_sub.c: Remove buggy code, use a wrapper to mpf_sub.
924         * tests/mpf/t-sub.c: More corner cases and strict checking.
925         * mpf/sub.c: Use more mpn_ primitives and macros.
927         * tests/mpf/t-int_p.c: Test numbers with both integer and
928         fractionary parts.
930         * mpf/int_p.c: Delay zero branch and use mpn_zero_p.
931         * mpf/fits_s.h: No special case for SIZ == 0.
932         * mpf/fits_u.h: Likewise.
934 2014-05-29  Marc Glisse  <marc.glisse@inria.fr>
936         * gmp-h.in: Include <limits.h>.
937         (__GMP_UINT_MAX, __GMP_ULONG_MAX, __GMP_USHRT_MAX): Remove.
938         * gmp-impl.h (ULONG_MAX, UINT_MAX, USHRT_MAX, LONG_MAX, INT_MAX,
939         SHRT_MAX): Remove unnecessary redefinition.
940         * tests/t-gmpmax.c: Remove file.
941         * tests/Makefile.am: Remove t-gmpmax.
943 2014-05-22 Marco Bodrato <bodrato@mail.dm.unipi.it>
945         * tests/mpf/t-sub.c (check_data): Test also ui_sub and sub_ui.
947 2014-05-20 Marco Bodrato <bodrato@mail.dm.unipi.it>
949         * gen-fac.c: +1 in the init2 argument before setbit.
950         * gen-fib.c: Likewise. (Thanks Niels)
951         * mini-gmp/mini-gmp.c: Likewise.
952         * rand/randmts.c: Likewise.
954         * mpn/generic/invert.c: Remove unused TMP_MARK.
955         * mpn/generic/invertappr.c: Avoid a branch.
956         * mpz/millerrabin.c (millerrabin): Consider the rare case n is a power.
958 2014-05-15 Marco Bodrato <bodrato@mail.dm.unipi.it>
960         * mini-gmp/mini-gmp.c: Micro-optimisations.
962         * gen-fib.c: Use mpz_setbit.
963         * gen-psqr.c: Skip even numbers when looking for primes.
965         * mpn/generic/invert.c: Avoid a branch.
966         * mpn/generic/toom2_sqr.c: Avoid a few branches in the odd case.
967         * mpn/generic/toom22_mul.c: Likewise.
969 2014-05-08  Marc Glisse  <marc.glisse@inria.fr>
971         * gmpxx.h (std::common_type): Remove partial specialization for two
972         identical expressions. New partial specialization for a single type.
973         * tests/cxx/t-cxx11.cc: Test it.
975 2014-04-14  Niels Möller  <nisse@lysator.liu.se>
977         * doc/gmp.texi (mpz_invert): Clarify behavior in the zero ring.
979 2014-04-04  Marc Glisse  <marc.glisse@inria.fr>
981         * longlong.h (i386): Add comment about "cc" clobber.
983 2014-04-04  Torbjorn Granlund  <tege@gmplib.org>
985         * acinclude.m4 (X86_64_PATTERN): Generalise patterns to allow "noavx"
986         suffix.
988         * mpn/generic/div_qr_1n_pi1.c: Conditionalise ARM asm on !__thumb__.
990 2014-04-03  Marc Glisse  <marc.glisse@inria.fr>
992         * mpn/arm64/mul_1.asm, mpn/arm64/gcd_1.asm: Use official b.cond syntax.
993         * mpn/arm64/invert_limb.asm, mpn/arm64/aorsmul_1.asm: Prefix
994         immediates with #.
996 2014-04-03  Torbjorn Granlund  <tege@gmplib.org>
998         * config.guess: Append "noavx" for CPUs which have AVX but where the
999         kernel does not support it.
1000         * configure.ac: Accept "noavx" cpu name suffixes.  Conditionally pass
1001         -mno-avx.
1003 2014-04-02  Torbjorn Granlund  <tege@gmplib.org>
1005         * mpn/x86_64/k8/redc_1.asm: Workaround for Darwin assembler quirk.
1007 2014-03-28  Torbjorn Granlund  <tege@gmplib.org>
1009         * mpn/generic/mod_1_1.c: Conditionalise ARM asm on !__thumb__.
1011 2014-03-31  Marc Glisse  <marc.glisse@inria.fr>
1013         * mpn/arm/dive_1.asm, mpn/arm/invert_limb.asm: Use RODATA.
1014         * acinclude.m4 ([long long reliability tests]): Declare functions.
1015         (GMP_PROG_CC_FOR_BUILD_WORKS, GMP_PROG_EXEEXT_FOR_BUILD,
1016         GMP_C_FOR_BUILD_ANSI, GMP_CHECK_LIBM_FOR_BUILD): Replace exit(0) with
1017         return 0, no declaration needed.
1018         (GMP_CHECK_LIBM_FOR_BUILD): Include <math.h> to declare log.
1020 2014-03-30  Marc Glisse  <marc.glisse@inria.fr>
1022         * README: Remove mention to Berkeley MP compatibility.
1024 2014-03-26  Torbjorn Granlund  <tege@gmplib.org>
1026         * mpn/powerpc64/mode64/gcd_1.asm: Provide default for
1027         BMOD_1_TO_MOD_1_THRESHOLD.
1029 2014-03-24  Torbjorn Granlund  <tege@gmplib.org>
1031         * Version 6.0.0 released.
1033         * mpn: Update countless gmp-mparam.h files.
1035 2014-03-22  Torbjorn Granlund  <tege@gmplib.org>
1037         * Makefile.am (LIBGMP_LT_*, LIBGMPXX_LT_*): Bump version info.
1038         * gmp-h.in: Bump version.
1040 2014-03-17  Torbjorn Granlund  <tege@gmplib.org>
1042         * configure.ac: Remove clipper, i960, ns32k, pyr, a29k, z8000.
1043         * mpn/clipper: Remove directory and all its files.
1044         * mpn/i960: Likewise.
1045         * mpn/ns32k: Likewise.
1046         * mpn/pyr: Likewise.
1047         * mpn/a29k: Likewise.
1048         * mpn/z8000: Likewise.
1049         * mpn/Makefile.am (TARG_DIST): Purge removed directories.
1050         * doc/gmp.texi: Remove special mentions of removed architectures.
1052 2014-03-12 Marco Bodrato <bodrato@mail.dm.unipi.it>
1054         * mini-gmp/mini-gmp.c (mpz_probab_prime_p): Micro-optimisation.
1056 2014-03-12  Torbjorn Granlund  <tege@gmplib.org>
1058         * mpn/x86/bd2/gmp-mparam.h: New file.
1059         * mpn/x86_64/bd2/gmp-mparam.h: New file.
1061 2014-03-06  Niels Möller  <nisse@lysator.liu.se>
1063         * tests/mpz/t-pprime_p.c (check_composites): New function.
1064         (check_primes): New function.
1065         (main): Call them. Also use TESTS_REPS.
1067         * mini-gmp/mini-gmp.c (gmp_millerrabin): New internal function.
1068         (mpz_probab_prime_p): New function.
1069         * mini-gmp/mini-gmp.h (mpz_probab_prime_p): Declare it.
1070         * mini-gmp/tests/t-pprime_p.c: New test program.
1071         * mini-gmp/tests/Makefile (CHECK_PROGRAMS): Added t-pprime_p.
1073 2014-03-03  Niels Möller  <nisse@lysator.liu.se>
1075         * mini-gmp/mini-gmp.c (mpz_congruent_p): New function.
1076         * mini-gmp/mini-gmp.h: Declare it.
1077         * mini-gmp/tests/t-cong.c: New file, based on tests/mpz/t-cong.c.
1078         * mini-gmp/tests/Makefile (CHECK_PROGRAMS): Added t-cong.
1080         * mini-gmp/tests/testutils.c (dump): New function. Deleted static
1081         functions in other files.
1082         (mpz_set_str_or_abort): Moved function here, from...
1083         * mini-gmp/tests/t-cmp_d.c: ... old location.
1085         * mini-gmp/tests/t-reuse.c (dump3): Renamed, from ...
1086         (dump): ...old name.
1088 2014-03-01  Niels Möller  <nisse@lysator.liu.se>
1090         * mpn/generic/sec_powm.c (mpn_sec_powm): Clarify comment and
1091         asserts.
1093 2014-02-28  Torbjorn Granlund  <tege@gmplib.org>
1095         * mpn/x86_64/fat/fat.c (fake_cpuid): Handle id 7, make bold claims.
1097 2014-02-27  Torbjorn Granlund  <tege@gmplib.org>
1099         * mpn/x86_64/fat/fat_entry.asm: Zero ecx for the benefit of new BMI2
1100         feature test.
1102         * mpn/x86_64/fat/fat.c (__gmpn_cpuvec_init): Run CPUVEC_SETUP_coreihwl
1103         conditionally on BMI2 availability.
1105         * config.guess: Revert "coreihwl" to "coreisbr" if cpuid indicates that
1106         BMI2 is missing.
1107         (x86 cpuid, 2 variants): Zero ecx for the benefit of new BMI2 feature
1108         test.
1110 2014-02-21 Marco Bodrato <bodrato@mail.dm.unipi.it>
1112         * mini-gmp/mini-gmp.c (mpn_sqrtrem): New function.
1113         * mini-gmp/mini-gmp.h: Declare it.
1114         * mini-gmp/tests/t-sqrt.c: Test it.
1116 2014-02-17  Niels Möller  <nisse@lysator.liu.se>
1118         * mpn/generic/div_qr_1.c (mpn_div_qr_1): Revert yesterday's fix.
1119         Hopefully no longer needed.
1121         * mpn/s390_64/gmp-mparam.h (DIV_QR_1_NORM_THRESHOLD): Up to 1.
1122         * mpn/s390_64/z10/gmp-mparam.h (DIV_QR_1_NORM_THRESHOLD): Up to 1.
1124         * tune/tuneup.c (tune_div_qr_1): Ensure DIV_QR_1_NORM_THRESHOLD,
1125         DIV_QR_1_UNNORM_THRESHOLD >= 1.
1127 2014-02-16 Marco Bodrato <bodrato@mail.dm.unipi.it>
1129         * mpn/generic/div_qr_1.c: Disallow DIV_QR_1_NORM_THRESHOLD==0.
1131 2014-02-15  Torbjorn Granlund  <tege@gmplib.org>
1133         * tests/mpn/t-div.c: Fix typo.
1135 2014-02-15 Marco Bodrato <bodrato@mail.dm.unipi.it>
1137         * doc/gmp.texi (mpz_roinit_n, MPZ_ROINIT_N): Document that
1138         at least a readable limb is required.
1139         * mini-gmp/mini-gmp.c (mpz_div_qr): init + set = init_set .
1141 2014-02-14  Niels Möller  <nisse@lysator.liu.se>
1143         * doc/gmp.texi (Low-level Functions): Update docs for
1144         mpn_sec_powm, to specify that left-over exponent bits must be
1145         zero.
1147 2014-02-11  Niels Möller  <nisse@lysator.liu.se>
1149         * Makefile.am (EXTRA_DIST): Distribute COPYING.LESSERv3,
1150         COPYINGv2, and COPYINGv3.
1152         * doc/gmp.texi (Low-level Functions): Updated mpn_sec_powm docs.
1154         * mpn/generic/sec_powm.c (mpn_sec_powm): Replaced exponent limb
1155         count argument by bit count. Don't leak high exponent bits, and
1156         drop the requirement that the most significant exponent limb is
1157         non-zero.
1158         (mpn_sec_powm_itch): Analogous interface change.
1159         * gmp-h.in: Updated prototypes.
1160         * mpz/powm_sec.c (mpz_powm_sec): Update mpn_sec_powm* calls.
1161         * tune/tuneup.c (tune_powm_sec): Likewise. Also deleted code
1162         fiddling with the high exponent bits.
1164 2014-02-10 Marco Bodrato <bodrato@mail.dm.unipi.it>
1166         * mini-gmp/tests/t-limbs.c: New test for mpz_limbs_*.
1167         * mini-gmp/tests/Makefile (CHECK_PROGRAMS): Add it.
1169 2014-02-09  Niels Möller  <nisse@lysator.liu.se>
1171         * tune/tuneup.c (tune_powm_sec): Avoid timing of the nonsensical
1172         parameters nbits = 1, winsize = 2. Decrement tabulated values, to
1173         better match the > comparison when the table is used.
1175         * mpn/generic/sec_powm.c (win_size): Comment why we always get
1176         win_size(eb) <= eb. Make the table const.
1177         (mpn_sec_powm): Deleted handling of winsize > initial ebi. For
1178         now, replaced with an ASSERT_ALWAYS.
1180 2014-02-08 Marco Bodrato <bodrato@mail.dm.unipi.it>
1182         * mini-gmp/mini-gmp.c (mpz_realloc2, mpz_limbs_read, mpz_limbs_modify
1183         mpz_limbs_write, mpz_limbs_finish, mpz_roinit_n): New functions.
1184         (mpn_perfect_square_p): New function.
1185         * mini-gmp/mini-gmp.h: Declare them.
1187         * mini-gmp/tests/t-mul.c: Use roinit and limbs_read to test mpn.
1188         * mini-gmp/tests/t-sqrt.c: Test also mpn_perfect_square_p.
1190 2014-02-08  Niels Möller  <nisse@lysator.liu.se>
1192         * mpn/generic/sec_invert.c (mpn_cnd_neg_itch): #if:ed out unused
1193         function.
1195         * mpn/generic/sec_div.c: Simplified code for the normalized case.
1197         * tests/mpn/t-div.c (main): Test mpn_sec_div_qr and mpn_sec_div_r
1198         with normalized d.
1200 2014-02-04  Niels Möller  <nisse@lysator.liu.se>
1202         * doc/gmp.texi (Low-level Functions): Document mpn_sec_add_1 and
1203         mpn_sec_sub_1.
1205 2014-02-03 Marco Bodrato <bodrato@mail.dm.unipi.it>
1207         * mini-gmp/mini-gmp.c (mpn_rootrem): Allow NULL argument.
1209         * mini-gmp/mini-gmp.c (mpn_zero): New function.
1210         (mpz_perfect_square_p): New function.
1211         * mini-gmp/mini-gmp.h: Declare them.
1213         * mini-gmp/tests/t-sqrt.c: Test mpz_perfect_square_p.
1214         * mini-gmp/tests/t-root.c: Test also 1-th root, allow perfect powers.
1216 2014-01-29  Torbjorn Granlund  <tege@gmplib.org>
1218         * doc/gmp.texi (Floating-point Functions): Revise.
1220 2014-01-29  Niels Möller  <nisse@lysator.liu.se>
1222         * README: Don't refer to specific COPYING* files, instead refer to
1223         manual for details.
1225         * COPYING.LIB: Renamed, to...
1226         * COPYING.LESSERv3: ... new name.
1227         * COPYING: Renamed, to...
1228         * COPYINGv3: ... new name.
1229         * COPYINGv2: New file, GPLv2.
1231         * doc/gmp.texi (Copying): Document dual licensing.
1233 2014-01-27  Torbjorn Granlund  <tege@gmplib.org>
1235         * Update library files license to use LGPL3+ and GPL2+.
1237 2014-01-27 Marco Bodrato <bodrato@mail.dm.unipi.it>
1239         * tests/mpn/t-aors_1.c: Check sec_aors_1 red zones (not smart).
1241         * mpn/generic/sec_aors_1.c: Mark the 2nd argument as const.
1242         * gmp-h.in (mpn_sec_add_1, mpn_sec_sub_1): Likewise.
1244 2014-01-24  Torbjorn Granlund  <tege@gmplib.org>
1246         * mpn/x86_64/fat/fat.c (fake_cpuid_table): Use proper steamroller and
1247         excavator values.
1249         * config.guess: Amend last AMD change.
1251         * mpn/s390_64/lshift.asm: Align loop.
1252         * mpn/s390_64/rshift.asm: Likewise.
1253         * mpn/s390_64/lshiftc.asm: Likewise.
1254         * mpn/s390_64: Add z10 cycle numbers.
1256 2014-01-23 Marco Bodrato <bodrato@mail.dm.unipi.it>
1258         * printf/repl-vsnprintf.c: Feed case 'z' in switch (type) with case 'z'
1259         in switch (fchar).
1261         * mini-gmp/tests/t-aorsmul.c: New file, test for mpz_{add,sub}mul{,_ui}
1262         * mini-gmp/tests/Makefile: Add t-aorsmul.
1264 2014-01-21 Marco Bodrato <bodrato@mail.dm.unipi.it>
1266         * acinclude.m4 (GMP_FUNC_VSNPRINTF): Get rid of varargs.
1268 2014-01-20  Torbjorn Granlund  <tege@gmplib.org>
1270         * mpn/x86_64/fat/fat.c (__gmpn_cpuvec_init): Fix duplicate entries for
1271         AMD "jaguar".
1273         * demos/expr: Get rid of varargs code and references.
1275 2014-01-19  Torbjorn Granlund  <tege@gmplib.org>
1277         * config.guess: Add new AMD CPUs (piledriver, steamroller, excavator,
1278         jaguar).
1279         * config.sub: Corresponding updates.
1280         * configure.ac: Likewise.
1281         * acinclude.m4 (X86_64_PATTERN): Likewise.
1282         * mpn/x86_64/fat/fat.c: Likewise.
1284         * Rename mpn_sec_minvert => mpn_sec_invert, many files affected.
1285         * mpn/generic/sec_invert.c: New name for sec_minvert.c.
1287         * doc/gmp.texi: Undocument mpz_array_init.
1289         * acinclude.m4 (GMP_C_STDARG): Comment out.
1290         * configure.ac: Suppress GMP_C_STDARG invocation.
1292         * Get rid of varargs code and references, many file affected.
1294         * Use mpq_t in favour of MP_RAT, many mpq files affected.
1296         * Get rid of BYTES_PER_MP_LIMB, most files affected.
1298         * mpz/iset.c: Avoid overflow in allocation computation.
1299         * mpz/mul.c: Likewise.
1300         * mpf/init.c: Likewise.
1301         * mpf/init2.c: Likewise.
1302         * mpf/iset.c: Likewise.
1303         * mpf/iset_d.c: Likewise.
1304         * mpf/iset_si.c: Likewise.
1305         * mpf/iset_str.c: Likewise.
1306         * mpf/iset_ui.c: Likewise.
1308         * mpz/array_init.c: Avoid two overflow scenarios in allocation
1309         computation.
1311         * mpn/s390_64/z10/gmp-mparam.h: New file.
1313         * mpz/clears.c: Call __gmp_free_func ourselves instead of via
1314         mpz_clears.
1315         * mpf/clears.c: Analogous change.
1316         * mpq/clears.c: Analogous change.
1318         * mpz/clear.c: Add cast to avoid overflow of (later ignored) argument.
1319         * mpf/clear.c: Likewise.
1321 2014-01-19 Marco Bodrato <bodrato@mail.dm.unipi.it>
1323         * mini-gmp/mini-gmp.c (mpn_popcount): New function.
1324         (mpz_popcount): Use it.
1325         (mpz_addmul_ui, mpz_addmul, mpz_submul_ui, mpz_submul): Added.
1326         * mini-gmp/mini-gmp.h: Declare them.
1328 2014-01-18  Niels Möller  <nisse@lysator.liu.se>
1330         * tests/mpn/t-aors_1.c: Test also mpn_sec_add_1 and mpn_sec_sub_1.
1332         * tests/mpn/t-minvert.c (main): Pass smallest allowed bit_size
1333         argument to mpn_sec_minvert.
1335 2014-01-18  Marc Glisse  <marc.glisse@inria.fr>
1337         * doc/gmp.texi (C++ Interface Limitations): Warn against C++11 auto.
1339 2014-01-18 Marco Bodrato <bodrato@mail.dm.unipi.it>
1341         * tests/t-parity.c: Use 1UL to generate unsigned constants.
1342         * tests/t-constants.c: Disable a non portable (unneeded) check.
1344 2014-01-18  Niels Möller  <nisse@lysator.liu.se>
1346         * mpn/generic/sec_aors_1.c (mpn_sec_add_1, mpn_sec_sub_1): New
1347         file.
1349         * mpn/generic/sec_minvert.c (mpn_sec_add_1_itch, mpn_sec_add_1):
1350         Deleted static definitions.
1351         (mpn_cnd_swap): Use volatile.
1353         * configure.ac (gmp_mpn_functions): sec_add_1 and sec_sub_1.
1354         (GMP_MULFUNC_CHOICES): Set up for sec_aors_1.
1356 2014-01-16  Niels Möller  <nisse@lysator.liu.se>
1358         * tune/common.c (speed_mpn_sec_minvert): New function.
1359         * tune/speed.h: Declare it.
1360         (SPEED_ROUTINE_MPN_SEC_MINVERT): New macro.
1361         * tune/speed.c (routine): Added mpn_sec_minvert.
1363         * mini-gmp/mini-gmp.c (mp_bits_per_limb): New const value.
1364         * mini-gmp/mini-gmp.h: Declare it.
1366 2014-01-12  Marc Glisse  <marc.glisse@inria.fr>
1368         * demos/expr/expr.h: Add extern "C" for C++.
1370 2014-01-11  Torbjorn Granlund  <tege@gmplib.org>
1372         * doc/gmp.texi (Notes for Particular Systems): Add items about old
1373         NetBSD and current FreeBSD m4 problems.  Add item about FreeBSD's
1374         broken limits.h.
1376 2014-01-05 Marco Bodrato <bodrato@mail.dm.unipi.it>
1378         * gmp-impl.h: Declare all _itch functions using ATTRIBUTE_CONST.
1380 2014-01-05  Torbjorn Granlund  <tege@gmplib.org>
1382         * configure.ac (alpha): Set extra_functions conditionally.
1384         * gmp-h.in (mpn_sec_minvert): Remove formal parameters.
1386         * doc/gmp.texi: Improve doc for several functions.
1388         * mpn/generic/sec_tabselect.c: Declare input arg using 'const'.
1389         * gmp-h.in: Analogous change.
1391         * gmp-h.in: Declare all itch functions using __GMP_ATTRIBUTE_PURE.
1392         * gmp-impl.h: Likewise.
1394 2014-01-05 Marco Bodrato <bodrato@mail.dm.unipi.it>
1396         * tests/mpn/t-minvert.c: Always compare with mpz_invert results,
1397         add red zone to scratch.
1398         * tests/mpn/t-sizeinbase.c: New test.
1399         * tests/mpn/Makefile.am (check_PROGRAMS): Added t-sizeinbase.c .
1400         * tests/mpn/t-div.c: Use mpn_sec_div_*_itch().
1402         * mpn/generic/pow_1.c: Micro-optimisation.
1404 2014-01-04  Torbjorn Granlund  <tege@gmplib.org>
1406         * acinclude.m4 (GMP_PROG_M4): Avoid hex output, since case varies.
1408 2014-01-03  Torbjorn Granlund  <tege@gmplib.org>
1410         * config.guess: Support newer haswell, broadwell, silvermont.
1411         * mpn/x86_64/fat/fat.c (__gmpn_cpuvec_init): Likewise.
1413         * acinclude.m4 (GMP_PROG_M4): Check that eval's radix argument work.
1415         * mpz/invert.c: Rely on gcdext for all operands, removing faulty
1416         special case.
1417         * tests/mpz/t-invert.c: Enforce correct behaviour for |mod| = 1.
1419 2014-01-02  Niels Möller  <nisse@lysator.liu.se>
1421         * doc/gmp.texi (Low-level Functions): Document mpn_sizeinbase.
1423         Enable previously unused mpn_sizeinbase function.
1424         * configure.ac (gmp_mpn_functions): Added sizeinbase.
1425         * gmp-h.in (mpn_sizeinbase): New prototype.
1427 2014-01-02  Marc Glisse  <marc.glisse@inria.fr>
1429         * gmp-impl.h: Always include <limits.h>.
1430         * tests/mpn/t-get_d.c: Remove comment about <limits.h>
1432         * gmp-h.in (__GMP_USHRT_MAX): Use the promoted type.
1433         * gmp-impl.h (USHRT_HIGHBIT, SHRT_MIN, SHRT_MAX): Likewise.
1434         * tests/t-constants.c: Adapt printf strings.
1435         * tests/t-gmpmax.c: Likewise.
1437         * tests/mpn/t-hgcd_appr.c (hgcd_appr_valid_p): Add parentheses.
1439 2014-01-01  Torbjorn Granlund  <tege@gmplib.org>
1441         * doc/gmp.texi (Low-level Functions for cryptography): Update interface
1442         for mpn_sec_div_qr and fix typos in mpn_sec_minvert text.
1444         * mpn/generic/sec_div.c: Rewrite to make mpn_sec_div_qr return high
1445         quotient limb.
1446         * gmp-h.in (mpn_sec_div_qr): Update declaration.
1447         * tests/mpn/t-div.c: Adapt.
1449 2013-12-31  Niels Möller  <nisse@lysator.liu.se>
1451         * doc/gmp.texi (Low-level Functions for cryptography): Document
1452         mpn_sec_minvert.
1454 2013-12-30  Marc Glisse  <marc.glisse@inria.fr>
1456         * doc/gmp.texi (C++ interface internals): Break long line.
1458 2013-12-30  Torbjorn Granlund  <tege@gmplib.org>
1460         * doc/gmp.texi (Low-level Functions for cryptography): New section.
1462 2013-12-29  Niels Möller  <nisse@lysator.liu.se>
1464         * tests/mpn/Makefile.am (check_PROGRAMS): Added t-minvert.
1465         * tests/mpn/t-minvert.c: New file.
1467         * configure.ac (gmp_mpn_functions): Added sec_minvert.
1468         * gmp-h.in (mpn_sec_minvert, mpn_sec_minvert_itch): New
1469         declarations.
1470         * mpn/generic/sec_minvert.c (mpn_sec_minvert)
1471         (mpn_sec_minvert_itch): New functions.
1472         (mpn_sec_add_1, mpn_cnd_neg, mpn_cnd_swap, mpn_sec_eq_ui): New
1473         helper functions.
1475 2013-12-28  Torbjorn Granlund  <tege@gmplib.org>
1477         * mpn/generic/sec_powm.c: Fix an ASSERT.
1479         * gmp-h.in (mpn_sec_mul, mpn_sec_mul_itch): New declarations.
1480         * gmp-h.in (mpn_sec_sqr, mpn_sec_sqr_itch): Likewise.
1481         * mpn/generic/sec_mul.c: New file.
1482         * mpn/generic/sec_sqr.c: New file.
1484         * gmp-h.in (mpn_sec_powm, mpn_sec_powm_itch): New declarations.
1485         * gmp-h.in (mpn_sec_div_qr, mpn_sec_div_qr_itch): Likewise.
1486         * gmp-h.in (mpn_sec_div_r, mpn_sec_div_r_itch): Likewise.
1487         * gmp-impl: Remove declarations of above functions.
1489         * configure.ac (gmp_mpn_functions): Add sec_mul and sec_sqr.
1491 2013-12-26 Marco Bodrato <bodrato@mail.dm.unipi.it>
1493         * Update many file's encoding to UTF-8.
1494         * doc/tasks.html: Update <meta content> accordingly.
1495         * doc/projects.html: Likewise.
1497 2013-12-26  Torbjorn Granlund  <tege@gmplib.org>
1499         * configure.ac: Rename mpn_blah_sec to mpn_sec_blah.
1500         * gmp-impl.h: Corresponding changes.
1501         * mpn/asm-defs.m4: Corresponding changes.
1502         * tune/Makefile.am: Corresponding changes.
1503         * tune/common.c: Corresponding changes.
1504         * tune/speed.c: Corresponding changes.
1505         * tune/speed.h: Corresponding changes.
1506         * tune/tuneup.c: Corresponding changes.
1507         * mpz/powm_sec.c: Update calls.
1508         * tests/mpn/t-div.c: Likewise.
1510         * mpn/generic/sec_powm.c: New name for mpn/generic/powm_sec.c.
1511         * mpn/generic/sec_div.c: New name for mpn/generic/sb_div_sec.c.
1512         * mpn/generic/sec_pi1_div.c: New name for mpn/generic/sbpi1_div_sec.c.
1513         * mpn/generic/sec_tabselect.c: New name for mpn/generic/tabselect.c.
1515         * mpn/alpha/sec_tabselect.asm: New name for tabselect.asm.
1516         * mpn/arm/neon/sec_tabselect.asm: New name for tabselect.asm.
1517         * mpn/arm/sec_tabselect.asm: New name for tabselect.asm.
1518         * mpn/ia64/sec_tabselect.asm: New name for tabselect.asm
1519         * mpn/powerpc32/sec_tabselect.asm: New name for tabselect.asm
1520         * mpn/powerpc64/sec_tabselect.asm: New name for tabselect.asm
1521         * mpn/sparc64/sec_tabselect.asm: New name for tabselect.asm
1522         * mpn/x86/mmx/sec_tabselect.asm: New name for tabselect.asm
1523         * mpn/x86/sec_tabselect.asm: New name for tabselect.asm
1524         * mpn/x86_64/bd1/sec_tabselect.asm: New name for tabselect.asm
1525         * mpn/x86_64/core2/sec_tabselect.asm: New name for tabselect.asm
1526         * mpn/x86_64/coreinhm/sec_tabselect.asm: New name for tabselect.asm
1527         * mpn/x86_64/coreisbr/sec_tabselect.asm: New name for tabselect.asm
1528         * mpn/x86_64/fastsse/sec_tabselect.asm: New name for tabselect.asm
1529         * mpn/x86_64/k10/sec_tabselect.asm: New name for tabselect.asm
1530         * mpn/x86_64/pentium4/sec_tabselect.asm: New name for tabselect.asm
1531         * mpn/x86_64/sec_tabselect.asm: New name for tabselect.asm
1533 2013-12-25  Torbjorn Granlund  <tege@gmplib.org>
1535         * mpz/powm_sec.c: Handle 0^e mod m specially.
1536         * mpn/generic/powm_sec.c: ASSERT that the base is non-zero.
1538 2013-12-23  Torbjorn Granlund  <tege@gmplib.org>
1540         * mpn/generic/powm_sec.c (redcify): Use passed scratch instead of
1541         locally allocated.
1542         (mpn_powm_sec_itch): Accommodate mpn_sb_div_r_sec's scratch needs.
1544 2013-12-20  Mark Sofroniou  <marks@wolfram.com>
1546         * mpn/generic/mul_fft.c: Major overhaul of types.
1548 2013-12-18  Torbjorn Granlund  <tege@gmplib.org>
1550         * doc/gmp.texi (Low-level Functions): Rewrite mpn_set_str docs.
1552 2013-12-14  Ulrich Weigand  <Ulrich.Weigand@de.ibm.com>
1554         * mpn/powerpc32/darwin.m4: Allow (and ignore) optional
1555         'toc' parameter to PROLOGUE_cpu.
1556         * mpn/powerpc32/elf.m4: Likewise.
1558 2013-12-09  Ulrich Weigand  <Ulrich.Weigand@de.ibm.com>
1560         * configure.ac: Check for ELFv2 ABI on PowerPC.
1561         * mpn/powerpc64/elf.m4: Set assembler ABI version for ELFv2
1562         and use appropriate PROLOGUE_cpu/EPILOGUE_cpu sequences.
1563         Support optional 'toc' parameter to PROLOGUE_cpu.
1564         * mpn/powerpc64/aix.m4: Allow (and ignore) optional
1565         'toc' parameter to PROLOGUE_cpu.
1566         * mpn/powerpc64/darwin.m4: Likewise.
1568         * mpn/powerpc64/mode64/dive_1.asm (mpn_divexact_1): Add 'toc'
1569         parameter to PROLOGUE.
1570         * mpn/powerpc64/mode64/divrem_1.asm (mpn_divrem_1): Likewise.
1571         * mpn/powerpc64/mode64/divrem_2.asm (mpn_divrem_2): Likewise.
1572         * mpn/powerpc64/mode64/gcd_1.asm (mpn_gcd_1): Likewise.
1573         * mpn/powerpc64/mode64/invert_limb.asm (mpn_invert_limb): Likewise.
1574         * mpn/powerpc64/mode64/mod_1_1.asm (mpn_mod_1_1p_cps): Likewise.
1575         * mpn/powerpc64/mode64/mod_1_4.asm (mpn_mod_1s_4p_cps): Likewise.
1576         * mpn/powerpc64/mode64/mode1o.asm (mpn_modexact_1c_odd): Likewise.
1577         * mpn/powerpc64/mode64/p7/gcd_1.asm (mpn_gcd_1): Likewise.
1578         * mpn/powerpc64/p6/lshift.asm (mpn_lshift): Likewise.
1579         * mpn/powerpc64/p6/lshiftc.asm (mpn_lshiftc): Likewise.
1580         * mpn/powerpc64/p6/rshift.asm (mpn_rshift): Likewise.
1581         * mpn/powerpc64/vmx/popcount.asm (mpn_popcount): Likewise.
1583 2013-12-07  Niels Möller  <nisse@lysator.liu.se>
1585         * configfsf.sub: Updated to version 2013-10-01, from gnulib.
1586         * configfsf.guess: Updated to version 2013-11-29, from gnulib.
1588 2013-12-03  Torbjorn Granlund  <tege@gmplib.org>
1590         * mpn/generic/div_qr_1.c: Make constant args asm inlines become limbs.
1591         * mpn/generic/div_qr_1n_pi1.c: Likewise.
1592         * mpn/generic/div_qr_2.c: Likewise.
1593         * mpn/generic/div_qr_2.c: Likewise.
1594         * mpn/generic/mod_1_1.c: Likewise.
1595         * mpn/generic/mod_1_2.c: Likewise.
1596         * mpn/generic/mod_1_3.c: Likewise.
1597         * mpn/generic/mod_1_4.c: Likewise.
1598         * mpn/generic/mulmid_basecase.c: Likewise.
1599         * mpn/generic/mulmod_bnm1.c: Likewise.
1600         * mpn/generic/sqrmod_bnm1.c: Likewise.
1601         * mpn/sparc64/divrem_1.c: Likewise.
1602         * mpn/sparc64/mod_1_4.c: Likewise.
1604         * mpn/generic/toom_interpolate_7pts.c (BINVERT_15): Fix typo.
1606 2013-11-11  Torbjorn Granlund  <tege@gmplib.org>
1608         * mpn/x86_64/dos64.m4 (CALL): Provide to override default.
1610 2013-11-08  Torbjorn Granlund  <tege@gmplib.org>
1612         * mpn/x86_64/x86_64-defs.m4 (CALL): Swap PIC test and macro defn.
1614         * mpn/generic/div_qr_2.c: Test HAVE_HOST_CPU_FAMILY_x86, not i386.
1616         * doc/gmp.texi: Update many URLs.
1618 2013-11-04  Torbjorn Granlund  <tege@gmplib.org>
1620         * configure.ac: Set symbol OPENBSD for x86-openbsd hosts.
1621         * mpn/x86_64/fat/fat_entry.asm (PRETEND_PIC): New name for
1622         PIC_OR_DARWIN.
1623         (PRETEND_PIC): Set also for OPENBSD.
1625 2013-10-29  Torbjorn Granlund  <tege@gmplib.org>
1627         * printf/doprnt.c (__gmp_doprnt): Use memcpy instead of strcpy.
1629 2013-10-24  Torbjorn Granlund  <tege@gmplib.org>
1631         * mpn/generic/div_qr_1u_pi2.c: New file.
1632         * mpn/generic/div_qr_1n_pi2.c: New file.
1634 2013-10-24  Niels Möller  <nisse@lysator.liu.se>
1636         * mpn/x86_64/div_qr_1n_pi1.asm: Bugfixes, for case n == 1 and
1637         in-place operation.
1638         * mpn/x86_64/k8/div_qr_1n_pi1.asm: Likewise.
1640         * mpn/generic/div_qr_1n_pi1.c (mpn_div_qr_1n_pi1): Bug fixes,
1641         off-by-one MPN_INCR_U, and support for in-place operation.
1643 2013-10-24  Torbjorn Granlund  <tege@gmplib.org>
1645         * mpn/x86/fat/fat.c (fake_cpuid_table): Add Haswell.
1647 2013-10-23  Torbjorn Granlund  <tege@gmplib.org>
1649         * mpn/x86_64/x86_64-defs.m4 (oplist): New define, data from `regnum'.
1650         (regnum): Use x86_lookup, feed oplist.
1652 2013-10-22  Niels Möller  <nisse@lysator.liu.se>
1654         * tests/devel/try.c: Support mpn_div_qr_1n_pi1.
1656         * mpn/x86_64/k8/div_qr_1n_pi1.asm: Moved the below k10 file here.
1657         Applied tweak from Torbjörn to get it to run well on k8.
1659         * mpn/x86_64/k10/div_qr_1n_pi1.asm: New file (renamed above).
1660         Differs from generic x86_64 version by using cmov.
1662         * mpn/x86_64/div_qr_1n_pi1.asm: Reordered arguments to second mul.
1663         Deleted misleading cycle annotations.
1665 2013-10-21  Niels Möller  <nisse@lysator.liu.se>
1667         * configure.ac: Add HAVE_NATIVE_mpn_div_qr_1n_pi1 to config.in.
1669         * mpn/generic/div_qr_1n_pi1.c (mpn_div_qr_1n_pi1): Fix typos
1670         affecting ASSERT.
1672 2013-10-20  Niels Möller  <nisse@lysator.liu.se>
1674         * mpn/x86_64/div_qr_1n_pi1.asm: New file.
1676         * tune/div_qr_1_tune.c (__gmpn_div_qr_1n_pi1): Check
1677         div_qr_1n_pi1_method only when !HAVE_NATIVE_mpn_div_qr_1n_pi1.
1679         * mpn/asm-defs.m4 (define_mpn): Add div_qr_1n_pi1.
1681         * tune/common.c (speed_mpn_div_qr_1): New function, replacing...
1682         (speed_mpn_div_qr_1n, speed_mpn_div_qr_1u): ... deleted functions
1683         (speed_mpn_div_qr_1n_pi1, speed_mpn_div_qr_1n_pi1_1)
1684         (speed_mpn_div_qr_1n_pi1_2): New functions.
1685         * gmp-impl.h [TUNE_PROGRAM_BUILD]: Declare div_qr_1-related tuning
1686         variables.
1687         * tune/tuneup.c (speed_mpn_div_qr_1_tune, tune_div_qr_1): New
1688         functions.
1689         (div_qr_1n_pi1_method, div_qr_1_norm_threshold)
1690         (div_qr_1_unnorm_threshold): New globals.
1691         * tune/speed.c (routine): Replaced mpn_div_qr_1n and mpn_div_qr_1u
1692         by mpn_div_qr_1, requiring ".r" parameter. Added mpn_div_qr_1n_pi1
1693         and variants.
1694         * tune/speed.h (SPEED_ROUTINE_MPN_DIV_QR_1): Use the "r" parameter
1695         as divisor.
1696         * tune/div_qr_1n_pi1_2.c: New file.
1697         * tune/div_qr_1n_pi1_1.c: New file.
1698         * tune/div_qr_1_tune.c: New file.
1699         * tune/Makefile.am (libspeed_la_SOURCES): Added div_qr_1n_pi1_1.c,
1700         div_qr_1n_pi1_2.c, and div_qr_1_tune.c.
1702         * tune/speed.c (routine): Added mpn_div_qr_1n and mpn_div_qr_1u.
1703         * tune/speed.h (SPEED_ROUTINE_MPN_DIV_QR_1): New macro.
1704         (speed_mpn_div_qr_1n, speed_mpn_div_qr_1u): Declare.
1705         * tune/common.c (speed_mpn_div_qr_1n, speed_mpn_div_qr_1u): New
1706         functions.
1708         * gmp-impl.h (mpn_div_qr_1n_pi1): Declare function.
1709         * gmp-h.in (mpn_div_qr_1): Declare function.
1710         * configure.ac (gmp_mpn_functions): Added div_qr_1 and
1711         div_qr_1n_pi1.
1712         * mpn/generic/div_qr_1.c (mpn_div_qr_1): New file and function.
1713         * mpn/generic/div_qr_1n_pi1.c (mpn_div_qr_1n_pi1): New file and
1714         function.
1715         * tests/mpn/t-div.c (main): Test mpn_div_qr_1.
1717 2013-10-17  Torbjorn Granlund  <tege@gmplib.org>
1719         * configure.ac (alpha): Pass -mieee via gcc_cflags_maybe.
1721 2013-10-16  Torbjorn Granlund  <tege@gmplib.org>
1723         * config.guess: Let AMD64 cpuid bit override pessimistic cpu guesses.
1725         * mpn/alpha/unicos.m4 (DATASTART): Accept optional align parameter.
1726         * mpn/alpha/divrem_2.asm: Use provided gp mechanisms.
1727         * mpn/alpha/default.m4 (PROLOGUE): Provide "..ng" post-gp label.
1728         * mpn/alpha/invert_limb.asm: Align table to 8-byte boundary.  Make code
1729         work if table is not fully aligned.  Properly test for BWX.
1731 2013-10-15  Torbjorn Granlund  <tege@gmplib.org>
1733         * mpn/alpha/default.m4 (DATASTART): Use RODATA instead of DATA;
1734         accept optional align parameter.
1735         * mpn/alpha/invert_limb.asm: Align table.
1736         * mpn/alpha/ev5/diveby3.asm: Likewise.
1738 2013-10-11  Torbjorn Granlund  <tege@gmplib.org>
1740         * mpn/x86/k7/mod_1_1.asm: Use 'subl' form to avoid ambiguity.
1741         * mpn/x86/k7/mod_1_4.asm: Likewise.
1743         * configure.ac (X86_64_PATTERN): Append "cc" to cclist_64 and
1744         cclist_x32.
1746 2013-10-08  Torbjorn Granlund  <tege@gmplib.org>
1747             Marc Glisse  <marc.glisse@inria.fr>
1749         * tests/mpf/reuse.c (main): Compare addresses instead of names.
1750         Use larger numbers for exponents.
1752 2013-10-08  Marc Glisse  <marc.glisse@inria.fr>
1754         * doc/mdate-sh, doc/texinfo.tex, install-sh, missing, ylwrap: Remove.
1755         * .bootstrap: Use autoreconf (and in particular automake -a).
1757         * gmp-h.in: Remove __need_size_t. Include <stddef.h>, not <cstddef>.
1759         * tests/mpf/reuse.c (main): Use small numbers as exponents.
1761 2013-10-05  Torbjorn Granlund  <tege@gmplib.org>
1763         * mpn/x86_64/atom/aorsmul_1.asm: Slight tweak.
1765         * doc/gmp.texi (ABI and ISA): Document x32.
1767         * mpn/sparc64/ultrasparct3/dive_1.asm: Use our register names.
1769 2013-09-24  Torbjorn Granlund  <tege@gmplib.org>
1771         * mpn/x86_64/atom/redc_1.asm: New file.
1773 2013-09-23  Torbjorn Granlund  <tege@gmplib.org>
1775         * mpn/x86_64/bobcat/redc_1.asm: Make the code for 1 <= n <= 3 work.
1777 2013-09-22  Torbjorn Granlund  <tege@gmplib.org>
1779         * mpn/x86_64/coreisbr/redc_1.asm: Slightly tweak basecase code.
1781         * mpn/x86_64/core2/redc_1.asm: New file.
1783         * mpn/x86_64/bobcat/redc_1.asm: New file.
1785 2013-09-21  Torbjorn Granlund  <tege@gmplib.org>
1787         * mpn/x86_64/coreinhm/redc_1.asm: New file.
1789 2013-09-21  Marc Glisse  <marc.glisse@inria.fr>
1791         * tests/mpn/t-mulmid.c: Cast arguments of printf to int to match %d.
1792         * tests/rand/t-urbui.c: Use 1UL for unsigned constant.
1793         * mpn/generic/get_str.c: Avoid temporarily pointing outside an array.
1795 2013-09-20  Torbjorn Granlund  <tege@gmplib.org>
1797         * mpn/x86_64/coreisbr/redc_1.asm: New file.
1799         * mpn/x86_64/k8/redc_1.asm: Complete rewrite.
1801         * mpn/x86_64/coreisbr/mullo_basecase.asm: Postpone pushes, short-
1802         circuit a branch.
1803         * mpn/x86_64/coreihwl/mullo_basecase.asm: Short-circuit a branch.
1805         * mpn/x86_64/core2/mullo_basecase.asm: New file.
1807 2013-09-19  Torbjorn Granlund  <tege@gmplib.org>
1809         * mpn/x86_64/fastsse/copyi-palignr.asm: Allocate more stack under DOS.
1811 2013-09-18  Torbjorn Granlund  <tege@gmplib.org>
1813         * mpn/x86_64/core2/mul_basecase.asm: New file.
1814         * mpn/x86_64/core2/sqr_basecase.asm: New file.
1816         * mpn/x86_64/coreihwl/mullo_basecase.asm: New file.
1817         * mpn/x86_64/coreisbr/mullo_basecase.asm: New file.
1819 2013-09-16  Torbjorn Granlund  <tege@gmplib.org>
1821         * mpn/x86_64/fastsse/copyi-palignr.asm: Preserve xmm6-xmm8 under DOS.
1823 2013-09-15  Torbjorn Granlund  <tege@gmplib.org>
1825         * mpn/x86_64/tabselect.asm: Use R8 for bit testing.
1827         * mpn/x86_64/coreihwl/mul_basecase.asm: Replace mul_1 code.
1829         * mpn/x86_64/coreisbr/aorsmul_1.asm: Rewrite.
1831 2013-09-12  Torbjorn Granlund  <tege@gmplib.org>
1833         * mpn/ia64/gcd_1.asm: Use dep for combining table base and low bits.
1835         * mpn/x86_64/fastsse/com-palignr.asm: Implement temp fix to properly
1836         handle overlap.
1838 2013-09-10  Torbjorn Granlund  <tege@gmplib.org>
1840         * mpn/x86_64/fastsse/copyi-palignr.asm: Rewrite rp != up (mod 16) code
1841         to make it handle any allowed overlap.
1843 2013-09-09  Torbjorn Granlund  <tege@gmplib.org>
1845         * mpn/x86_64/atom/com.asm: New file, grabbing fastsse code.
1847         * mpn/x86_64/bd1/copyi.asm: New file, grabbing fastsse code.
1848         * mpn/x86_64/bd1/copyd.asm: Likewise.
1849         * mpn/x86_64/bd1/com.asm: Likewise.
1851         * mpn/x86_64/fastavx/copyi.asm: New file.
1852         * mpn/x86_64/fastavx/copyd.asm: New file.
1854 2013-09-05  Torbjorn Granlund  <tege@gmplib.org>
1856         * mpn/x86_64/coreihwl/aorsmul_1.asm: Streamline.
1858 2013-09-04  Torbjorn Granlund  <tege@gmplib.org>
1860         * mpn/x86_64/coreihwl/sqr_basecase.asm: Implement larger "corner".
1861         Misc tuning.
1863 2013-09-03  Torbjorn Granlund  <tege@gmplib.org>
1865         * mpn/x86_64/coreihwl/redc_1.asm: New file.
1867         * mpn/x86_64/x86_64-defs.m4 (mulx): Handle negative offsets.
1869 2013-08-31  Torbjorn Granlund  <tege@gmplib.org>
1871         * mpn/x86_64/coreisbr/sqr_basecase.asm: New file.
1873         * mpn/x86_64/sqr_diag_addlsh1.asm: New file.
1875 2013-08-30  Torbjorn Granlund  <tege@gmplib.org>
1877         * mpn/x86_64/fat/mul_basecase.c: New file.
1878         * mpn/x86_64/fat/sqr_basecase.c: New file.
1879         * mpn/x86_64/fat/mullo_basecase.c: New file.
1880         * mpn/x86_64/fat/redc_1.c: New file.
1882 2013-08-29  Torbjorn Granlund  <tege@gmplib.org>
1884         * mpn/x86_64/k8/mul_basecase.asm: Move top-level basecase file to k8
1885         subdir.
1886         * mpn/x86_64/k8/sqr_basecase.asm: Likewise.
1887         * mpn/x86_64/k8/redc_1.asm: Likewise.
1888         * mpn/x86_64/k8/mullo_basecase.asm: Likewise.
1889         * mpn/x86_64/k8/mulmid_basecase.asm: Likewise.
1891         * mpn/ia64/aors_n.asm: Clean up some bundlings.
1893         * mpn/x86_64/fat/fat.c (__gmpn_cpuvec_init): Support Haswell.
1894         (fake_cpuid_table): Likewise.
1896         * configure.ac (x86): Remove any mulx paths.  Let bwl path = hwl path.
1897         (fat_path): Add coreihwl.
1899         * mpn/x86_64/coreihwl/aorsmul_1.asm: Move from `mulx' directory, use
1900         mulx() macro.
1901         * mpn/x86_64/coreihwl/mul_1.asm: Likewise.
1902         * mpn/x86_64/coreihwl/mul_2.asm: Likewise.
1903         * mpn/x86_64/coreihwl/mul_basecase.asm: Likewise.
1904         * mpn/x86_64/coreihwl/sqr_basecase.asm: Likewise.
1906         * mpn/x86_64/x86_64-defs.m4 (mulx): New macro.
1907         (regnum, regnumh, ix): Supporting macros.
1909 2013-08-28  Torbjorn Granlund  <tege@gmplib.org>
1911         * mpn/x86_64/coreisbr/divrem_1.asm: New file.
1913 2013-08-23  Torbjorn Granlund  <tege@gmplib.org>
1915         * mpn/x86_64/fastsse/com-palignr.asm: New file, closely based on
1916         copyi-palignr.asm.
1918         * mpn/x86_64/fastsse/copyi.asm Use "test R8(reg)" instead of "bt".
1919         * mpn/x86_64/fastsse/copyd-palignr.asm: Likewise.
1920         * mpn/x86_64/fastsse/copyi-palignr.asm: Likewise.
1921         * mpn/x86_64/fastsse/lshift-movdqu2.asm: Likewise.
1922         * mpn/x86_64/fastsse/lshiftc-movdqu2.asm: Likewise.
1923         * mpn/x86_64/fastsse/rshift-movdqu2.asm: Likewise.
1924         * mpn/x86_64/fastsse/tabselect.asm: Likewise.
1926         * mpn/sparc64/ultrasparct3/sqr_diag_addlsh1.asm: New file.
1928         * mpn/alpha/aorslsh2_n.asm: New file.
1929         * mpn/alpha/aorslsh1_n.asm: Rewrite.
1930         * mpn/alpha/ev6/aorslsh1_n.asm: New file.
1932 2013-08-21  Torbjorn Granlund  <tege@gmplib.org>
1934         * mpn/alpha/sqr_diag_addlsh1.asm: New file.
1935         * mpn/alpha/sqr_diagonal.asm: Remove.
1936         * mpn/alpha/ev6/sqr_diagonal.asm: Remove.
1938 2013-08-20  Torbjorn Granlund  <tege@gmplib.org>
1940         * mpn/powerpc32/sqr_diag_addlsh1.asm: New file.
1941         * mpn/powerpc32/sqr_diagonal.asm: Remove.
1943 2013-08-15  Torbjorn Granlund  <tege@gmplib.org>
1945         * mpn/x86_64/coreihwl/mulx/sqr_basecase.asm: New file.
1947 2013-08-05  Torbjorn Granlund  <tege@gmplib.org>
1949         * mpn/x86_64/coreisbr/aors_n.asm: Complete rewrite.
1951 2013-08-04  Torbjorn Granlund  <tege@gmplib.org>
1953         * mpn/x86_64/coreihwl/mulx/mul_basecase.asm: New file.
1955         * mpn/x86_64/bd1/mul_2.asm: New file.
1957         * mpn/x86_64/coreihwl/gmp-mparam.h: New file.
1959 2013-08-03  Torbjorn Granlund  <tege@gmplib.org>
1961         * mpn/x86_64/coreihwl/mulx/mul_2.asm: New file.
1962         * mpn/x86_64/coreihwl/mulx/addmul_2.asm: New file.
1964         * mpn/x86_64/coreinhm/aorsmul_1.asm: New file.
1966         * mpn/x86_64/coreisbr/mul_basecase.asm: Save some O(n) and O(1) cycles.
1968         * mpn/x86_64/coreisbr/mul_2.asm: New file.
1970 2013-08-02  Torbjorn Granlund  <tege@gmplib.org>
1972         * mpn/x86_64/coreisbr/addmul_2.asm: Complete rewrite.
1974 2013-08-01  Torbjorn Granlund  <tege@gmplib.org>
1976         * mpn/x86_64/bd1/mul_basecase.asm: New file.
1978         * mpn/x86_64/coreisbr/mul_basecase.asm: New file.
1980         * mpn/x86_64/coreihwl/aorsmul_1.asm: New file.
1982 2013-07-31  Torbjorn Granlund  <tege@gmplib.org>
1984         * mpn/x86_64/atom/mul_2.asm: New file.
1985         * mpn/x86_64/atom/addmul_2.asm: New file.
1986         * mpn/x86_64/atom/mul_1.asm: New file.
1987         * mpn/x86_64/atom/aorsmul_1.asm: New file.
1989         * mpn/x86_64/coreihwl/mul_1.asm: New file.
1991         * configure.ac (x86): Add Haswell-specific path.
1993         * configure.in (fat_functions): Add cnd_add_n, cnd_sub_n..
1994         * gmp-impl.h (struct cpuvec_t): Add fields for new fat functions.
1995         * gmp-impl.h: Adjust corresponding declarations.
1997         * mpn/x86_64/x86_64-defs.m4 (CPUVEC_FUNCS_LIST): Add new fat functions.
1998         * mpn/x86/x86-defs.m4 (CPUVEC_FUNCS_LIST): Likewise.
1999         * mpn/x86_64/fat/fat.c (__gmpn_cpuvec): Likewise.
2000         * mpn/x86/fat/fat.c (__gmpn_cpuvec): Likewise.
2002 2013-07-30  Torbjorn Granlund  <tege@gmplib.org>
2004         * mpn/x86_64/coreisbr/popcount.asm: New file.
2006 2013-07-23  Torbjorn Granlund  <tege@gmplib.org>
2008         * mpn/x86_64/bobcat/aors_n.asm: New file.
2010         * mpn/x86_64/pentium4/aorslshC_n.asm: Remove a spurious emms insn.
2012         * mpn/x86_64/bd1/aorrlsh1_n.asm: New file.
2013         * mpn/x86_64/bd1/sublsh1_n.asm: New file.
2015 2013-07-22  Torbjorn Granlund  <tege@gmplib.org>
2017         * mpn/powerpc64/mode64/mod_1_1.asm: Handle little-endian mode.
2018         * mpn/powerpc64/mode64/mod_1_4.asm: Likewise.
2020 2013-07-16  Torbjorn Granlund  <tege@gmplib.org>
2022         * doc/gmp.texi: Declare countless of function arguments as 'const'.
2024 2013-07-15  Torbjorn Granlund  <tege@gmplib.org>
2026         * mpn/x86_64/core2/aors_n.asm: Rewrite.
2028         * mpn/generic/sb_div_sec.c: Compute inverse as floor(B^2/(dh+1)), per
2029         Niels' suggestion.
2030         * mpn/generic/sbpi1_div_sec.c: Remove inverse rounding-up code.
2032 2013-07-14  Torbjorn Granlund  <tege@gmplib.org>
2034         * mpn/powerpc64/mode64/divrem_1.asm: Remove explicit nop after CALL.
2035         * mpn/powerpc64/mode64/divrem_2.asm: Likewise.
2036         * mpn/powerpc64/mode64/mod_1_1.asm:  Likewise.
2037         * mpn/powerpc64/mode64/mod_1_4.asm:  Likewise.
2039 2013-07-13  Torbjorn Granlund  <tege@gmplib.org>
2041         * mpn/x86/atom/cnd_add_n.asm: New file.
2042         * mpn/x86/atom/cnd_sub_n.asm: New file.o
2044 2013-07-12  Torbjorn Granlund  <tege@gmplib.org>
2046         * mpn/generic/sbpi1_div_sec.c: Partial rewrite.
2048 2013-07-11  Torbjorn Granlund  <tege@gmplib.org>
2050         * mpn/x86_64/cnd_aors_n.asm: Tweak for better speed on K8, bobcat, bd1,
2051         NHM, Atom.
2053 2013-07-05  Torbjorn Granlund  <tege@gmplib.org>
2055         * mpn/powerpc64/p7/copyi.asm: Handle n = 0.
2056         * mpn/powerpc64/p7/copyd.asm: Likewise.
2058 2013-07-04  Torbjorn Granlund  <tege@gmplib.org>
2060         * mpn/powerpc64/mode64/p7/aormul_2.asm: New file.
2062         * mpn/powerpc64/darwin.m4 (EXTRA_REGISTER): New define.
2063         * mpn/powerpc64/aix.m4: New define (actually undefine).
2064         * mpn/powerpc64/elf.m4: Likewise.
2066 2013-07-03  Torbjorn Granlund  <tege@gmplib.org>
2068         * mpn/powerpc64/com.asm: Rewrite.
2070         * mpn/powerpc64/p7/copyi.asm: New file.
2071         * mpn/powerpc64/p7/copyd.asm: New file.
2073 2013-07-02  Torbjorn Granlund  <tege@gmplib.org>
2075         * mpn/powerpc64/mode64/gcd_1.asm: New file.
2076         * mpn/powerpc64/mode64/p7/gcd_1.asm: New file.
2078 2013-07-01  Torbjorn Granlund  <tege@gmplib.org>
2080         * configure.ac: Comment out AC_PROG_F77.
2082         * mpn/powerpc64/mode64/rsh1add_n.asm: Remove.
2083         * mpn/powerpc64/mode64/rsh1sub_n.asm: Remove.
2084         * mpn/powerpc64/mode64/rsh1aors_n.asm: New file, code not based on
2085         removed files.
2087 2013-06-28  Marc Glisse  <marc.glisse@inria.fr>
2089         * cxx/ismpf.cc: Use GMP_DECIMAL_POINT.
2090         * cxx/osmpf.cc: Likewise.
2091         * tests/cxx/t-locale.cc: Likewise.
2093 2013-06-28  Torbjorn Granlund  <tege@gmplib.org>
2095         * mpn/powerpc64/mode64/p7/aorsorrlshC_n.asm: New file.
2096         * mpn/powerpc64/mode64/p7/aorsorrlsh1_n.asm: New file.
2097         * mpn/powerpc64/mode64/p7/aorsorrlsh2_n.asm: New file.
2099         * mpn/powerpc64/mode64/aorsorrlshC_n.asm: Use alias regname.
2101 2013-06-27  Torbjorn Granlund  <tege@gmplib.org>
2103         * mpn/powerpc64/mode64/p7/aors_n.asm: New file.
2105 2013-06-22  Torbjorn Granlund  <tege@gmplib.org>
2107         * aorslshC_n.asm, aorslsh2_n.asm, aorslsh1_n.asm: Remove.
2108         * aorsorrlshC_n.asm, aorsorrlsh1_n.asm, aorsorrlsh2_n.asm: New files.
2110 2013-06-19  Torbjorn Granlund  <tege@gmplib.org>
2112         * mpn/powerpc64/p6/lshift.asm: Rewrite switching-into-loop code.
2113         * mpn/powerpc64/p6/rshift.asm: Likewise.
2114         * mpn/powerpc64/p6/lshiftc.asm: Likewise.
2116 2013-06-17  Torbjorn Granlund  <tege@gmplib.org>
2118         * mpn/powerpc64/p6/lshift.asm: Fix typo in label reference.
2119         For 32-bit mode, zero extend `n' argument and split retval.
2120         * mpn/powerpc64/p6/rshift.asm: Likewise.
2121         * mpn/powerpc64/p6/lshiftc.asm: Likewise.
2123 2013-06-10  Torbjorn Granlund  <tege@gmplib.org>
2125         * mpn/generic/mu_div_q.c: Remove obsolete comment.
2127 2013-06-09  Marc Glisse  <marc.glisse@inria.fr>
2129         * mpn/generic/get_d.c (mpn_get_d): Avoid signed overflow.
2130         * mpz/kronzs.c (mpz_kronecker_si): Use ABS_CAST.
2132 2013-05-31  Torbjorn Granlund  <tege@gmplib.org>
2134         * mpn/generic/mu_div_q.c: Call mpn_mu_divappr_q for entire division,
2135         never just for tail.  (This fixes performance issues at the expense of
2136         memory needs.)
2138 2013-05-26  Torbjorn Granlund  <tege@gmplib.org>
2140         * configure.ac (*sparc*-*-*): Major overhaul.
2142 2013-05-22  Torbjorn Granlund  <tege@gmplib.org>
2144         * doc/gmp.texi (Reporting Bugs): Ask for configure's output.
2146         * mpn/ia64/divrem_2.asm: Don't clobber f16-f18.
2148 2013-05-20  Torbjorn Granlund  <tege@gmplib.org>
2150         * mpn/arm/udiv.asm: Change spacing to work around binutils bug.
2152 2013-05-16  Torbjorn Granlund  <tege@gmplib.org>
2154         * Makefile.am (LIBGMP_LT_*, LIBGMPXX_LT_*): Bump version info.
2156         * tests/misc.c (tests_hardware_getround, tests_hardware_setround):
2157         Avoid assembly dependency unless WANT_ASSEMBLY.
2159         * configure.ac (WANT_ASSEMBLY): Conditionally define.
2161 2013-05-14  Torbjorn Granlund  <tege@gmplib.org>
2163         * configure.ac (arm1156): Don't fall back to plain v6 compiler option.
2165 2013-05-11  Torbjorn Granlund  <tege@gmplib.org>
2167         * mpn/x86_64/coreisbr/mul_1.asm: Handle n = 1 for DOS64.  Streamline.
2168         * mpn/x86_64/coreisbr/aorsmul_1.asm: Streamline.
2170 2013-05-10  Torbjorn Granlund  <tege@gmplib.org>
2172         * mpn/x86_64/coreisbr/aorsmul_1.asm: Fix, then enable DOS64 support.
2173         * mpn/x86_64/coreisbr/mul_1.asm: Enable DOS64 support.
2175         * mpn/x86/p6/mmx/gmp-mparam.h: Set down SQR_TOOM2_THRESHOLD to parent
2176         directory value.
2178 2013-05-09  Torbjorn Granlund  <tege@gmplib.org>
2180         * configure.ac (--enable-fake-cpuid): New option.
2181         * mpn/x86_64/fat/fat.c (WANT_FAKE_CPUID): Remove defaulting.
2182         * mpn/x86/fat/fat.c (WANT_FAKE_CPUID): Likewise.
2184         * mpn/x86_64/bd1/mul_1.asm: Fix typo.
2186 2013-05-07  Torbjorn Granlund  <tege@gmplib.org>
2188         * mpn/x86_64/fat/fat.c (fake_cpuid): Handle 0x80000001 request.
2189         (fake_cpuid_available): Remove unused function.
2191         * mpn/generic/mod_1_1.c: Cast constant udiv_rnnd_preinv arguments.
2192         * mpn/generic/mod_1_2.c: Likewise.
2193         * mpn/generic/mod_1_3.c: Likewise.
2194         * mpn/generic/mod_1_4.c: Likewise.
2195         * mpn/generic/divrem_2.c: Likewise.
2197 2013-05-06  Torbjorn Granlund  <tege@gmplib.org>
2199         * config.guess (power*): Handle all ppc970 variants.
2201 2013-05-03  David S. Miller  <davem@davemloft.net>
2203         * tune/common.c (speed_mpn_addlsh1_n, speed_mpn_sublsh1_n,
2204         speed_mpn_rsblsh1_n, speed_mpn_addlsh2_n, speed_mpn_sublsh2_n,
2205         speed_mpn_rsblsh2_n): Don't define if these routines are macros.
2206         * tune/speed.c (routine): Likewise don't table if they are macros.
2208         * mpn/sparc64/ultrasparct3/addmul_1.asm: Add T4 and T3 timings.
2209         * mpn/sparc64/ultrasparct3/aormul_4.asm: Likewise.
2210         * mpn/sparc64/ultrasparct3/aorslsh_n.asm: Likewise.
2211         * mpn/sparc64/ultrasparct3/cnd_aors_n.asm: Likewise.
2212         * mpn/sparc64/ultrasparct3/submul_1.asm: Likewise.
2214 2013-05-03  Torbjorn Granlund  <tege@gmplib.org>
2216         * mpn/sparc64/ultrasparct3/aorslsh_n.asm: Invoke INITCY where it has
2217         effect.
2219         * gmp-impl.h: Amend last change.
2220         * tests/devel/try.c (choice_array): Don't try to table addlsh1_n etc if
2221         a macro.
2223 2013-05-02  Torbjorn Granlund  <tege@gmplib.org>
2225         * mpn/arm/copyd.asm: Suppress dead pointer update.
2226         * mpn/arm/copyi.asm: Likewise.
2227         * mpn/arm/neon/logops_n.asm: Likewise.
2228         * mpn/arm/neon/tabselect.asm: Likewise.
2229         * mpn/arm/rshift.asm: Likewise.
2230         * mpn/arm/tabselect.asm: Likewise.
2231         * mpn/arm/v6/dive_1.asm: Likewise
2232         * mpn/arm/v7a/cora15/neon/copyi.asm: Likewise.
2234         * mpn/arm/v7a/cora15/neon/com.asm: New file.
2236 2013-05-01  Torbjorn Granlund  <tege@gmplib.org>
2238         * mpn/sparc64/ultrasparct3/aormul_4.asm: New file.
2240         * configure.ac (GMP_MULFUNC_CHOICES): Support mul_3 + addmul_3 and
2241         mul_4 + addmul_4.
2243         * mpn/sparc64/ultrasparct3/aormul_2.asm: Optimise lead-in code.
2245         * mpn/sparc64/ultrasparct3/missing.m4 (addxccc): Allow g2 as input.
2246         (umulxhi): Save and restore o7 to allow it as in/out parameter.
2248 2013-04-29  Torbjorn Granlund  <tege@gmplib.org>
2250         * mpn/arm/v7a/cora15/cnd_aors_n.asm: New file, was mis-named.
2252         * mpn/sparc64/ultrasparct3/addmul_1.asm: Rewrite.
2254         * mpn/sparc64/ultrasparct3/submul_1.asm: Rewrite.
2256         * mpn/sparc64/ultrasparct3/cnd_aors_n.asm: New file.
2258         * gmp-impl.h: Override mpn_addlsh1_n, mpn_addlsh2_n, mpn_sublsh1_n, etc
2259         with mpn_addlsh_n, etc when !HAVE_NATIVE the former but HAVE_NATIVE the
2260         latter.
2262         * mpn/sparc64/ultrasparct3/aorslsh_n.asm: New file.
2264         * configure.ac (sparc-*-*): Recognise t5 along with t3 and t4.
2265         Remove sparc64/ultrasparct1 from path_64 for T3, T3, and T5.
2267 2013-04-27  Mike Frysinger  <vapier@gentoo.org>
2269         * configure.ac (arm*-*-*): Set up path also for plainest CPU variants.
2271 2013-04-27  Torbjorn Granlund  <tege@gmplib.org>
2273         * mpn/arm/v6/popham.asm: New file.
2275         * mpn/arm/v7a/cora15/cnd-aors_n.asm: New file.
2277 2013-04-25  Torbjorn Granlund  <tege@gmplib.org>
2279         * mpn/arm/mod_34lsub1.asm: Clear carry smarter.
2281         * mpn/arm/v7a/cora15/logops_n.asm: Conditionally suppress conditionally
2282         used code.
2284         * mpn/arm/v7a/cora15/submul_1.asm: New file.
2286 2013-04-24  Torbjorn Granlund  <tege@gmplib.org>
2288         * mpn/arm/v7a/cora15/com.asm: New file.
2290         * mpn/arm/v7a/cora15/logops_n.asm: New file.
2292 2013-04-19  Torbjorn Granlund  <tege@gmplib.org>
2294         * mpn/arm/v7a/cora15/aors_n.asm: New file.
2296         * mpn/arm/v7a/cora15/addmul_1.asm: Rewrite.
2298 2013-04-18  Torbjorn Granlund  <tege@gmplib.org>
2300         * mpn/alpha/tabselect.asm: New file.
2302 2013-04-17  Torbjorn Granlund  <tege@gmplib.org>
2304         * mpn/powerpc32/tabselect.asm: New file.
2306         * longlong.h (arm64 count_trailing_zeros): New.
2308         * mpn/arm64/invert_limb.asm: New file.
2310         * mpn/generic/dive_1.c: Rewrite to use Hensel division also for
2311         size = 1.
2313         * mpn/generic/mod_1_1.c (add_mssaaaa): Provide VIS3 variant.
2315         * configure.ac: Remove "missing" from extra_functions_64 for coreibwl.
2317         * mpn/sparc64/ultrasparct3/mul_1.asm: Decrease loop alignment.
2318         * mpn/sparc64/ultrasparct3/aormul_2.asm: Likewise.
2320 2013-04-16  Torbjorn Granlund  <tege@gmplib.org>
2322         * mpn/alpha/invert_limb.asm: Generate table.
2323         * mpn/powerpc64/mode64/invert_limb.asm: Likewise.
2324         * mpn/s390_64/invert_limb.asm: Likewise.
2325         * mpn/sparc64/ultrasparct3/invert_limb.asm: Likewise.
2326         * mpn/x86_64/invert_limb_table.asm: Likewise.
2328 2013-04-15  David S. Miller  <davem@davemloft.net>
2330         * mpn/sparc32/sparc-defs.m4 (LEA64): New macro.
2331         * mpn/sparc64/gcd_1.asm: Use it.
2332         * mpn/sparc64/ultrasparct3/dive_1.asm: Likewise.
2333         * mpn/sparc64/ultrasparct3/invert_limb.asm: Likewise.
2334         * mpn/sparc64/ultrasparct3/mode1o.asm: Likewise.
2336         * mpn/sparc64/gcd_1.asm: Use RODATA, TYPE, and SIZE.
2338 2013-04-15  Torbjorn Granlund  <tege@gmplib.org>
2340         * mpn/sparc64/ultrasparct3/invert_limb.asm: Avoid addend for GOT entry,
2341         it is not portable.
2343         * mpn/sparc64/tabselect.asm: New file.
2345         * mpn/x86/mmx/tabselect.asm: New file.
2346         * configure.ac (x86): Add x86/mmx to path for relevant CPUs.
2348         * mpn/sparc64/gcd_1.asm: Use rdpc for PIC.
2349         * mpn/sparc64/ultrasparct3/mode1o.asm: Use rdpc for PIC.
2350         * mpn/sparc64/ultrasparct3/dive_1.asm: Use rdpc for PIC.
2351         * mpn/sparc64/ultrasparct3/invert_limb.asm: Handle PIC, use rdpc.
2353         * Revert remaining parts of recent sparc LEA changes.
2355 2013-04-14  David S. Miller  <davem@davemloft.net>
2357         * mpn/sparc32/v9/sqr_diagonal.asm: Revert LEA and INT32 changes.
2358         * mpn/sparc64/gcd_1.asm: Likewise.
2360 2013-04-13  Torbjorn Granlund  <tege@gmplib.org>
2362         * mpn/x86_64/bd1/tabselect.asm: New file.
2363         * mpn/x86_64/coreisbr/tabselect.asm: New file.
2364         * mpn/x86_64/k10/tabselect.asm: New file.
2365         * mpn/x86_64/coreinhm/tabselect.asm: New file.
2366         * mpn/x86_64/core2/tabselect.asm: New file.
2367         * mpn/x86_64/pentium4/tabselect.asm: New file.
2369         * mpn/x86_64/fastsse/tabselect.asm: New file.
2370         * mpn/arm/neon/tabselect.asm: Rewrite.
2371         * mpn/arm/tabselect.asm: Rewrite.
2372         * mpn/powerpc64/tabselect.asm: Rewrite.
2373         * mpn/x86_64/tabselect.asm: Rewrite.
2375         * tune/speed.h (SPEED_ROUTINE_MPN_TABSELECT): Implement special code,
2376         making .r argument be table width.
2378 2013-04-11  David S. Miller  <davem@davemloft.net>
2380         * mpn/sparc32/sparc-defs.m4 (LEA): Remove unused local label.
2381         (LEA_LEAF): Likewise.
2383 2013-04-11  Niels Möller  <nisse@lysator.liu.se>
2385         * mpn/arm/v6/submul_1.asm: New file, using the corresponding
2386         addmul_1 loop + complement trick.
2388 2013-04-10  David S. Miller  <davem@davemloft.net>
2390         * acinclude.m4 (GMP_ASM_SPARC_GOTDATA,
2391         GMP_ASM_SPARC_SHARED_THUNKS): New feature tests.
2392         * configure.ac: Call GMP_ASM_SPARC_GOTDATA and
2393         GMP_ASM_SPARC_SHARED_THUNKS on sparc.
2394         * mpn/sparc32/sparc-defs.m4 (LEA, LEA_LEAF, LEA_THUNK): New macros.
2395         * mpn/sparc32/udiv.asm: Convert over to LEA, LEA_LEAF, and LEA_THUNK.
2396         * mpn/sparc32/v8/addmul_1.asm: Likewise.
2397         * mpn/sparc32/v8/mul_1.asm: Likewise.
2398         * mpn/sparc32/v8/supersparc/udiv.asm: Likewise.
2399         * mpn/sparc32/v8/udiv.asm: Likewise.
2400         * mpn/sparc64/gcd_1.asm: Likewise.
2401         * mpn/sparc64/ultrasparct3/dive_1.asm: Likewise.
2402         * mpn/sparc64/ultrasparct3/invert_limb.asm: Likewise.
2403         * mpn/sparc64/ultrasparct3/mode1o.asm: Likewise.
2404         * mpn/sparc32/v9/sqr_diagonal.asm: Likewise and use INT32.
2406 2013-04-09  Torbjorn Granlund  <tege@gmplib.org>
2408         * longlong.h (sparc64): Test __VIS__ instead of __sparc_vis3.
2410         * config.guess (sparc*): Invoke set_cc_for_build to get $dummy.
2412 2013-04-08  Torbjorn Granlund  <tege@gmplib.org>
2414         * config.guess: Rework tmp file names, make sure to remove tmp files.
2416         * mpn/arm/dive_1.asm: Rewrite count-trailing-zeros code, using private
2417         table.
2419         * mpn/arm: Canonicalise arm assembly to use old style "mov ... lsl" for
2420         shift ops.
2422 2013-04-07  Torbjorn Granlund  <tege@gmplib.org>
2424         * mpn/sparc64/ultrasparct3/mod_34lsub1.asm: New file.
2426         * longlong.h (sparc64): Define umul_ppmm, add_ssaaaa, and
2427         count_leading_zeros conditionally under the symbol __sparc_vis3.
2429         * mpn/arm/dive_1.asm: New file.
2430         * mpn/arm/v6/dive_1.asm: New file.
2432         * mpn/arm/v6t2/mode1o.asm:  Make trivial change to avoid v6t2...
2433         * mpn/arm/v6/mode1o.asm: ...instruction, move file accordingly.
2435         * mpn/powerpc64/mode64/invert_limb.asm: Put all multiplies low-limb first.
2437 2013-04-04  David S. Miller  <davem@davemloft.net>
2439         * mpn/sparc64/ultrasparct3/add_n.asm: Rewrite.
2440         * mpn/sparc64/ultrasparct3/sub_n.asm: Rewrite.
2442         * mpn/sparc64/ultrasparct3/invert_limb.asm: Align table.
2444 2013-04-04  Torbjorn Granlund  <tege@gmplib.org>
2446         * mpn/sparc32/sparc-defs.m4: Provide dummy lzcnt.
2448         * tests/mpn/logic.c: Seed using RANDS, then use mpz_rrandomb.
2450         * tests/mpn/t-div.c (random_word): Remove.  Let callers invoke urandom.
2452         * mpn/sparc64/ultrasparct3/mul_1.asm: Rewrite.
2454         * mpn/sparc64/ultrasparct3/bdiv_dbm1c.asm: New file.
2455         * mpn/sparc64/ultrasparct3/dive_1.asm: New file.
2456         * mpn/sparc64/ultrasparct3/invert_limb.asm: New file.
2457         * mpn/sparc64/ultrasparct3/mod_1_4.asm: New file.
2458         * mpn/sparc64/ultrasparct3/mode1o.asm: New file.
2460 2013-04-03  Torbjorn Granlund  <tege@gmplib.org>
2462         * mpn/sparc64/ultrasparct3/aormul_2.asm: Reschedule for better speed.
2464 2013-04-02  Torbjorn Granlund  <tege@gmplib.org>
2466         * mpn/sparc64/ultrasparct3/missing.m4: Misc tweaks.
2467          (lzcnt): New.
2468         * mpn/sparc64/ultrasparct3/missing.asm (__gmpn_lzcnt): New function.
2470         * mpn/sparc32/sparc-defs.m4: Put FAKE_T3 stuff here...
2471         * mpn/sparc64/ultrasparct3/aormul_2.asm: ...moved from here.
2473         * mpn/sparc64/ultrasparc1234/lshift.asm: Remove.
2474         * mpn/sparc64/ultrasparc1234/rshift.asm: Remove.
2476 2013-04-01  Torbjorn Granlund  <tege@gmplib.org>
2478         * mpn/sparc64/ultrasparct3/missing.m4 (umulxhi): Don't clobber retaddr,
2479         allowing use in functions that does not do save/restore.
2481         * mpn/sparc64/gcd_1.asm: Tweak for tighter loop.
2483 2013-03-31  David S. Miller  <davem@davemloft.net>
2485         * mpn/sparc64/lshift.asm: New file.
2486         * mpn/sparc64/rshift.asm: New file.
2487         * mpn/sparc64/lshiftc.asm: New file.
2489 2013-03-31  Torbjorn Granlund  <tege@gmplib.org>
2491         * mpn/sparc64/ultrasparct1/lshift.asm: Remove.
2492         * mpn/sparc64/ultrasparct1/rshift.asm: Remove.
2493         * mpn/sparc64/ultrasparct1/lshiftc.asm: Remove.
2495 2013-03-29  Torbjorn Granlund  <tege@gmplib.org>
2497         * mpn/sparc64/ultrasparct3/aormul_2.asm: Always do mulx before umulxhi.
2499 2013-03-28  Torbjorn Granlund  <tege@gmplib.org>
2501         * mpn/sparc64/mod_1_4.c (mpn_mod_1s_4p): Make precomputed arg 'const'.
2502         (mpn_mod_1s_4p_cps): Update from generic code.
2504 2013-03-27  Torbjorn Granlund  <tege@gmplib.org>
2506         * mpn/generic/trialdiv.c: Make variables 'const' to match tables.
2508         * mpn/generic/mod_1_1.c (mpn_mod_1_1p): Make precomputed arg 'const'.
2509         * mpn/generic/mod_1_2.c (mpn_mod_1s_2p): Likewise.
2510         * mpn/generic/mod_1_3.c (mpn_mod_1s_3p): Likewise.
2511         * mpn/generic/mod_1_4.c (mpn_mod_1s_4p): Likewise.
2512         * gmp-impl.h: Update prototypes.
2514         * mpn/x86_64/mulx/aorsmul_1.asm: New file.
2515         * mpn/x86_64/mulx/addmul_1.asm: Remove.
2517 2013-03-26  Niels Möller  <nisse@lysator.liu.se>
2519         Make mpn_cnd_add_n and mpn_cnd_sub_n public.
2520         * doc/gmp.texi (Low-level Functions): Document mpn_cnd_add_n and
2521         mpn_cnd_sub_n.
2522         * gmp-h.in (mpn_cnd_add_n, mpn_cnd_sub_n): Moved prototypes
2523         here...
2524         * gmp-impl.h: ... from here.
2526 2013-03-26  Torbjorn Granlund  <tege@gmplib.org>
2528         * mpn/x86/pentium4/sse2/cnd_add_n.asm: New file.
2529         * mpn/x86/pentium4/sse2/cnd_sub_n.asm: New file.
2530         * mpn/x86/cnd_aors_n.asm: New file.
2532 2013-03-25  David S. Miller  <davem@davemloft.net>
2534         * mpn/sparc64/ultrasparct3/hamdist.asm: New file.
2535         * mpn/sparc64/ultrasparct3/popcount.asm: New file.
2537 2013-03-25  Torbjorn Granlund  <tege@gmplib.org>
2539         * mpn/ia64/aorsorrlshC_n.asm: Generalised from aorslshC_n.asm.
2540         * mpn/ia64/aorsorrlsh1_n.asm: Generalised from aorslsh1_n.asm.
2541         * mpn/ia64/aorsorrlsh2_n.asm: Generalised from aorslsh2_n.asm.
2543 2013-03-24  Torbjorn Granlund  <tege@gmplib.org>
2545         * mpn/arm/v7a/cora15/neon/aorsorrlshC_n.asm: New file.
2546         * mpn/arm/v7a/cora15/neon/aorsorrlsh2_n.asm: New file.
2547         * mpn/arm/v7a/cora15/neon/aorsorrlsh1_n.asm: New file.
2548         * mpn/arm/v7a/cora15/neon/rsh1aors_n.asm: New file.
2550         * configure.ac (GMP_MULFUNC_CHOICES): Support add+sub+rsb lsh files.
2552         * tests/refmpn.c (refmpn_addlsh_nc, refmpn_sublsh_nc): Remove silly
2553         assert of mp_limb being non-negative.
2555 2013-03-21  Torbjorn Granlund  <tege@gmplib.org>
2557         * mpn/arm/neon/lshiftc.asm: New file.
2559         * mpn/arm/v6/sqr_basecase.asm: Trim 'sqr_diag_addlsh1' loop.
2561         * gen-trialdivtab.c: Output just raw data, remove actual variables.
2562         * mpn/generic/trialdiv.c: Put variables from gen-trialdivtab.c here,
2563         and make them 'const'.
2565 2013-03-20  Torbjorn Granlund  <tege@gmplib.org>
2567         * config.guess: Rework arm CPU recognition.
2568         * config.sub: Corresponding updates.
2569         * configure.ac: Likewise.
2571         * mpn/x86_64/mulx/adx/addmul_1.asm: Let FAKE_MULXADX be off by default.
2573         * mpn/arm/v7a/cora15/neon/copyi.asm: Move from "..".
2574         * mpn/arm/v7a/cora15/neon/copyd.asm: Likewise.
2576         * config.guess: Tack on "neon" for appropriate arm CPUs.
2577         * configure.ac (arm*-*-*): Recognise neon suffix for a8, a9, and a15.
2579 2013-03-19 Marco Bodrato <bodrato@mail.dm.unipi.it>
2581         * mpf/fits_u.h: Accept numbers truncating to zero before checking the
2582         sign.
2583         * tests/mpf/t-fits.c: Check new edges.
2585 2013-03-19  Torbjorn Granlund  <tege@gmplib.org>
2587         * tests/arm32check.c: Get printing of clobbered register right.
2589         * mpn/arm/neon/popcount.asm: New file.
2590         * mpn/arm/neon/hamdist.asm: New file.
2592         * tests/Makefile.am (EXTRA_libtests_la_SOURCES): Add arm32call.asm and
2593         arm32check.c.
2595 2013-03-18  Torbjorn Granlund  <tege@gmplib.org>
2597         * configure.ac (arm*-*-*): Define CALLING_CONVENTIONS_OBJS.
2599         * tests/arm32call.asm: New file.
2600         * tests/arm32check.c: New file.
2602         * mpn/arm/arm-defs.m4 (LEA): Rewrite to properly handle repeated use.
2603         (EPILOGUE_cpu): Define.
2605         * mpn/arm/v6/addmul_3.asm: Make code work for PIC.
2607         * tests/x86call.asm: Modernise asm syntax.
2608         * tests/amd64call.asm: Likewise.
2610         * mpn/x86/darwin.m4 (m4append): Move definition from here...
2611         * mpn/asm-defs.m4: ...to here.
2613 2013-03-18 Marco Bodrato <bodrato@mail.dm.unipi.it>
2615         * doc/gmp.texi (--enable-fat): No quote in concept index.
2617         * mpf/swap.c: Reduce the number of variables.
2619 2012-03-17  Marc Glisse  <marc.glisse@inria.fr>
2621         * tests/cxx/t-do-exceptions-work-at-all-with-this-compiler.cc: New file.
2622         * tests/cxx/Makefile.am: Add new file. Reorder the tests.
2624 2013-03-17  Torbjorn Granlund  <tege@gmplib.org>
2626         * mpn/generic/mul_fft.c: Use TMP_BALLOC*, but combine several areas.
2628         * mpz/powm_ui.c (mod): Use TMP_BALLOC in mu code.
2630         * mpn/arm/v6/addmul_3.asm: New file.
2632         * mpn/arm/v7a/cora15/copyd.asm: Tweak.
2634         * mpn/arm64/copyi.asm: New file.
2635         * mpn/arm64/copyd.asm: New file.
2637 2013-03-16  Torbjorn Granlund  <tege@gmplib.org>
2639         * mpn/arm/v6/addmul_2.asm: Tweak for better A9 performance.
2641 2013-03-14  Torbjorn Granlund  <tege@gmplib.org>
2643         * mpn/ia64/cnd_aors_n.asm: New file.
2645         * mpn/arm64/cnd_aors_n.asm: New file.
2647         * mpn/arm64/aors_n.asm (ADDSUB): Remove unused definition.
2649         * mpn/ia64/aors_n.asm: Remove a redundant ASM_START.
2651         * mpn/arm/cnd_aors_n.asm: Avoid ARM conditional insn execution.
2653         * mpn/x86_64/missing.asm: Move from mulx/adx since we cannot currently
2654         prune missing.asm from path.
2655         * mpn/x86_64/mulx/adx/missing-call.m4: Likewise.
2656         * mpn/x86_64/mulx/adx/missing-inline.m4: Likewise.
2657         * mpn/x86_64/mulx/adx/addmul_1.asm: Update hardwired path.
2659 2013-03-13 Marco Bodrato <bodrato@mail.dm.unipi.it>
2661         * mpz/cong_2exp.c: Write loops in a cleaner way.
2662         * mini-gmp/mini-gmp.c: Likewise.
2663         * gmp-impl.h (mpz_zero_p): Likewise.
2665 2013-03-12  Niels Möller  <nisse@lysator.liu.se>
2667         New names mpn_cnd_add_n and mpn_cnd_sub_n.
2668         * mpn/generic/cnd_add_n.c (mpn_cnd_add_n): Renamed file and
2669         function, from addcnd.c:mpn_addcnd_n.
2670         * mpn/generic/cnd_sub_n.c (mpn_cnd_sub_n): Renamed, from
2671         subcnd.c:mpn_subcnd_n.
2672         * mpn/arm/cnd_aors_n.asm: Renamed file, from aorscnd.asm, and
2673         renamed functions.
2674         * mpn/x86_64/cnd_aors_n.asm: Analogous renaming.
2675         * mpn/powerpc64/mode64/cnd_aors_n.asm: Analogous renaming.
2676         * gmp-impl.h (mpn_cnd_add_n, mpn_cnd_add_n): Updated prototypes
2677         with new names.
2678         * configure.ac: Updated for new names.
2679         * tests/refmpn.c (refmpn_cnd_add_n): Renamed, from refmpn_addcnd_n.
2680         (refmpn_cnd_sub_n): Renamed, from refmpn_subcnd_n.
2681         * tests/tests.h (refmpn_cnd_add_n, refmpn_cnd_sub_n): Updated
2682         prototypes with new names.
2683         * tune/common.c (speed_mpn_cnd_add_n): Renamed, from
2684         speed_mpn_addcnd_n, call mpn_cnd_add_n.
2685         (speed_mpn_cnd_sub_n): Renamed, from speed_mpn_subcnd_n, call
2686         mpn_cnd_sub_n.
2687         * tune/speed.h (speed_mpn_cnd_add_n, speed_mpn_cnd_sub_n): Updated
2688         prototypes with new names.
2689         * tune/speed.c (routine): Updated list with new names.
2690         * tests/devel/try.c: Updated for new mpn_cnd_* names.
2691         * mpn/generic/sbpi1_div_sec.c: Likewise.
2692         * mpn/generic/powm_sec.c: Likewise.
2694 2013-03-12  Torbjorn Granlund  <tege@gmplib.org>
2696         * configure.ac: Add "missing" to extra_functions_64 for coreibwl.
2698         * mpn/x86_64/mulx/adx/addmul_1.asm: Simplify.  Make FAKE_MULXADX the
2699         default awaiting proper qemu behaviour.
2701 2013-03-11  Torbjorn Granlund  <tege@gmplib.org>
2703         * mpn/x86_64/aorscnd_n.asm: Read 32 bits for 'n' arguments on DOS64.
2705         * tests/mpz/t-powm_ui.c: Test larger arguments.  General cleanup.
2707         * mpz/powm_ui.c (mod): Adhere to mpn_mu_div_qr's overlap requirements.
2709 2013-03-10  Niels Möller  <nisse@lysator.liu.se>
2711         * mpn/generic/sbpi1_div_sec.c: Update calls of mpn_addcnd_n and
2712         mpn_subcnd_n.
2713         * mpn/generic/powm_sec.c (MPN_REDC_1_SEC, MPN_REDC_2_SEC)
2714         (mpn_powm_sec): Update calls of mpn_subcnd_n.
2716         * tests/tests.h (refmpn_addcnd_n, refmpn_subcnd_n): Update
2717         declarations.
2718         * tests/refmpn.c (refmpn_addcnd_n, refmpn_subcnd_n): Similar
2719         reorder of arguments.
2720         * tests/devel/try.c (call): Pass condition first, for
2721         TYPE_ADDCND_N and TYPE_SUBCND_N.
2723         * tune/common.c (speed_mpn_addcnd_n, speed_mpn_subcnd_n): Update
2724         to pass condition as first argument.
2726         * gmp-impl.h (mpn_addcnd_n, mpn_subcnd_n): Updated declarations.
2728         * mpn/generic/addcnd_n.c (mpn_addcnd_n): Reordered arguments, make
2729         condition the first argument.
2730         * mpn/generic/subcnd_n.c (mpn_subcnd_n): Likewise.
2731         * mpn/arm/aorscnd_n.asm: Likewise.
2732         * mpn/x86_64/aorscnd_n.asm: Likewise.
2733         * mpn/powerpc64/mode64/aorscnd_n.asm: Likewise.
2735 2013-03-10  Torbjorn Granlund  <tege@gmplib.org>
2737         * mpn/x86_64/mulx/adx/missing.asm: Simulate some mulx/adx insns.
2738         * mpn/x86_64/mulx/adx/missing-call.m4: Call variant.
2739         * mpn/x86_64/mulx/adx/missing-inline.m4: Inline variant.
2741         * mpn/sparc64/ultrasparct3/missing.asm: Simulate some v9-2011 insns.
2742         * mpn/sparc64/ultrasparct3/missing.m4: Inline or invoke missing.asm for
2743         v9-2011 insn.
2745         * configure.ac: Strip `haswell' from paths for now.
2747         * mpn/x86_64/mulx/addmul_1.asm: New.
2748         * mpn/x86_64/mulx/mul_1.asm: Rewrite file from `haswell' subdir.
2749         * mpn/x86_64/mulx/adx/addmul_1.asm: Likewise.
2750         * mpn/x86_64/haswell: Remove.
2752         * mpn/arm/v7a/cora15/mul_1.asm: New file.
2753         * mpn/arm/v7a/cora15/addmul_1.asm: New file.
2755 2013-03-09 Marco Bodrato <bodrato@mail.dm.unipi.it>
2757         * tests/mpz/t-cong_2exp.c: Improve coverage.
2759 2013-03-09  Torbjorn Granlund  <tege@gmplib.org>
2761         * mpn/sparc64/ultrasparc1234/add_n.asm: Use g5 instead of g4.
2762         * mpn/sparc64/ultrasparc1234/sub_n.asm: Likewise.
2764         * mpn/sparc64/ultrasparct3/aormul_2.asm: Fix a typo.
2766 2013-03-07  Torbjorn Granlund  <tege@gmplib.org>
2768         * mpn/arm/v7a/cora9/gmp-mparam.h: New file.
2770         * configure.ac (GMP_MULFUNC_CHOICES): Support mul_2 + addmul_2.
2772         * mpn/sparc64/ultrasparct3/aormul_2.asm: New file.
2774         * mpn/sparc64/ultrasparct3/submul_1.asm: Optimise out two carry
2775         propagating adds.
2777 2013-03-06  David Miller  <davem@davemloft.net>
2779         * config.guess: Recognize UltraSparc T4 under Linux.
2780         * configure.ac: Add sparc64/ultrasparct3 to path_64 when T3 or T4.
2781         Append -xarch=v8plusd or -xarch=v9d to command line, as needed.
2782         * mpn/sparc64/ultrasparct3/mul_1.asm: New file.
2783         * mpn/sparc64/ultrasparct3/addmul_1.asm: New file.
2784         * mpn/sparc64/ultrasparct3/submul_1.asm: New file.
2785         * mpn/sparc64/ultrasparct3/add_n.asm: New file.
2786         * mpn/sparc64/ultrasparct3/sub_n.asm: New file.
2788         * mpn/sparc32/ultrasparct1/mul_1.asm: Unroll main loop one time, add
2789         T2/T3/T4 timings.
2790         * mpn/sparc32/ultrasparct1/addmul_1.asm: Likewise.
2791         * mpn/sparc32/ultrasparct1/submul_1.asm: Likewise.
2793 2013-03-04  Torbjorn Granlund  <tege@gmplib.org>
2795         * mpn/arm/neon/lorrshift.asm: New file.
2797 2013-03-03  Torbjorn Granlund  <tege@gmplib.org>
2799         * mpn/arm/v7a/cora15/copyd.asm: New file.
2800         * mpn/arm/v7a/cora15/copyi.asm: New file.
2802         * mpn/arm64/logops_n.asm: New file.
2803         * mpn/arm64/gcd_1.asm: New file.
2804         * mpn/arm64/aorsmul_1.asm: New file.
2805         * mpn/arm64/addmul_1.asm: Remove.
2806         * mpn/arm64/aors_n.asm: Complete rewrite.
2808         * mpn/arm/tabselect.asm: New file.
2809         * mpn/arm/neon/tabselect.asm: New file.
2811         * mpn/arm/copyi.asm: Software pipeline.
2812         * mpn/arm/copyd.asm: Likewise.
2814         * config.guess: Rework tmp file handling to resemble configfsf.guess's.
2816 2013-03-03  Niels Möller  <nisse@lysator.liu.se>
2818         * doc/gmp.texi (Integer Special Functions): Document
2819         mpz_limbs_read, mpz_limbs_write, mpz_limbs_modify,
2820         mpz_limbs_finish, mpz_roinit_n and MPZ_ROINIT_N.
2822         * mpz/roinit_n.c (mpz_roinit_n): Normalize the input.
2824 2013-02-27  Niels Möller  <nisse@lysator.liu.se>
2826         * tune/common.c (speed_measure): Increase repetition count if we
2827         get a zero measurement.
2829 2013-02-27 Marco Bodrato <bodrato@mail.dm.unipi.it>
2831         * mini-gmp/mini-gmp.c (mpz_div_q_2exp): Adjust only if needed.
2832         (mpn_common_scan): New service function to unify scan loops.
2833         (mpz_scan0, mpz_scan1): Simplify by using mpn_common_scan.
2834         (mpz_make_odd): Simplify, assume in-place operation on positive.
2835         (mpn_scan0, mpn_scan1): New functions.
2836         * mini-gmp/mini-gmp.h (mpn_scan0, mpn_scan1): New declarations.
2837         * mini-gmp/tests/t-scan.c: Test also mpn_scan0 and mpn_scan1.
2839 2013-02-26  Niels Möller  <nisse@lysator.liu.se>
2841         * tests/mpz/t-limbs.c (check_roinit): Test MPZ_ROINIT_N only if
2842         compiler supports c99.
2844 2013-02-25  Niels Möller  <nisse@lysator.liu.se>
2846         * mini-gmp/tests/t-double.c (testmain): Declare double variables
2847         as volatile, to drop extended precision.
2849         * mini-gmp/tests/testutils.c (testfree): New function. Use it
2850         everywhere where test programs deallocate storage allocated via
2851         the mini-gmp allocation functions, including uses of mpz_get_str
2852         for various test failure messages.
2854         * mpz/limbs_finish.c (mpz_limbs_finish): New file and function.
2855         * mpz/limbs_modify.c (mpz_limbs_modify): New file and function.
2856         * mpz/limbs_read.c (mpz_limbs_read): New file and function.
2857         * mpz/limbs_write.c (mpz_limbs_write): New file and function.
2858         * mpz/roinit_n.c (mpz_roinit_n): New file and function.
2859         * gmp-h.in: Declare new functions.
2860         (MPZ_ROINIT_N): New macro.
2861         * mpz/Makefile.am (libmpz_la_SOURCES): Added new files.
2862         * Makefile.am (MPZ_OBJECTS): Added new object files.
2864         * tests/mpz/t-limbs.c: New testcase.
2865         * tests/mpz/Makefile.am (check_PROGRAMS): Added t-limbs.
2867 2013-02-22  Torbjorn Granlund  <tege@gmplib.org>
2869         * configure.ac: Fix typo in adx/mulx path stripping code.
2870         * config.sub: Match coreibwl.
2872 2013-02-20  Niels Möller  <nisse@lysator.liu.se>
2874         * tests/mpq/t-get_d.c (check_random): Rewrote to make test less
2875         dependent on float operations. Fixes problem with m68k-linux and
2876         extended float precision.
2878 2013-02-20  Torbjorn Granlund  <tege@gmplib.org>
2880         * mpn/x86_64/haswell/mulx/adx/addmul_1.asm: New file.
2882         * configure.ac: Support coreibwl.  Use proper name for ADX extension.
2883         * acinclude.m4 (GMP_ASM_X86_ADX): Rename from GMP_ASM_X86_ADOX.
2885         * tests/tests.h (TESTS_REPS): Keep count >= 1.
2887 2013-02-19 Marco Bodrato <bodrato@mail.dm.unipi.it>
2889         * mini-gmp/mini-gmp.c: Move asserts to work-around a compiler bug.
2890         (mpz_export): Reorder branches.
2891         (mpz_mul_ui): Avoid temporary allocation (mpn_mul_1 can work in-place).
2893         * mini-gmp/tests/t-reuse.c: Fix typo causing the same negation
2894         condition to be applied to all operands. (See 2013-02-03, Torbjorn)
2896 2013-02-17 Marco Bodrato <bodrato@mail.dm.unipi.it>
2898         * gmpxx.h (mpq_class, mpf_class) [init_ui, init_si, assign_si]:
2899         Optimise _si using _ui for positive arguments.
2900         (__gmp_hypot_function): Use _mul_ui to square an ui, abs for si.
2902         * mini-gmp/mini-gmp.c (mpz_mul): Read sizes just once.
2903         (mpn_set_str_other): Remove a redundant variable.
2904         (mpz_abs_add): Use SWAP once, to order sizes.
2905         (mpz_mul_ui): Micro-optimisation.
2906         (mpz_rootrem): Use _init2 before _setbit.
2907         (mpz_set_str): Optimise-out a variable.
2908         (mpz_import): Normalise only if needed.
2909         (mpn_div_qr_1): Speed-up the d=1 case, delaying a branch.
2911         * rand/randmts.c: Use init2, as size of variables is known in advance.
2912         (mangle_seed): Get a single argument.
2914         * mpz/remove.c: Delay allocation in the generic case; use swap
2915         instead of set.
2916         * mpn/generic/remove.c: Delay (possibly smaller) allocation.
2918 2013-02-17  Marc Glisse  <marc.glisse@inria.fr>
2920         * cxx/osdoprnti.cc: Use <stdarg.h> and <string.h> rather than <cstdarg>
2921         and <cstring> (revert 2002-12-21).
2923         * tests/cxx/Makefile.am: Link with libm.
2924         * tests/cxx/t-ops2.cc: Comment about more tests. Use <math.h> rather
2925         than <cmath> and using namespace. Don't include <iostream>.
2927         * gmpxx.h (__GMPXX_BITS_TO_LIMBS, __GMPQ_NUM_DBL_LIMBS,
2928         __GMPQ_DEN_DBL_LIMBS, __GMPXX_TMPQ_D): New macros.
2929         (__gmp_binary_plus, __gmp_binary_minus, __gmp_binary_multiplies,
2930         __gmp_binary_divides, __gmp_binary_equal, __gmp_binary_less,
2931         __gmp_cmp_function): Use __GMPXX_TMPQ_D.
2932         * tests/cxx/t-ops2.cc: Test __GMPXX_TMPQ_D on DBL_MIN, DBL_MAX.
2934         * gmpxx.h (__gmp_binary_multiplies, __gmp_binary_divides): Use
2935         __GMPXX_CONSTANT_TRUE.
2937 2013-02-16  Marc Glisse  <marc.glisse@inria.fr>
2939         * gmpxx.h: Include <algorithm>.
2941 2013-02-16  Torbjorn Granlund  <tege@gmplib.org>
2943         * mpn/Makefile.am (TARG_DIST): Add arm64.
2945         * mpn/x86_64/x86_64-defs.m4 (PROTECT): Emit '.hidden' instead of
2946         '.protected" to please Sun's assembler, but also for semantic reasons.
2948 2013-02-15  Torbjorn Granlund  <tege@gmplib.org>
2950         * configure.ac (arm64*-*-*): Match this.
2952         * mpn/arm64/aors_n.asm: New file.
2953         * mpn/arm64/addmul_1.asm: New file.
2954         * mpn/arm64/mul_1.asm: New file.
2956 2013-02-15  Marc Glisse  <marc.glisse@inria.fr>
2958         * gmpxx.h (__GMPXX_DEFINE_ARITHMETIC_CONSTRUCTORS,
2959         __GMPXX_DEFINE_ARITHMETIC_ASSIGNMENTS): New macros.
2960         (mpz_class, mpq_class, mpf_class) [init_ui, init_si, init_d,
2961         assign_ui, assign_si, assign_d]: New functions.
2962         (__gmp_expr::__gmp_expr, __gmp_expr::operator=): Replace with macros.
2963         (__GMPXX_CONSTANT_TRUE): New macro.
2965 2013-02-15 Marco Bodrato <bodrato@mail.dm.unipi.it>
2967         * gmp-impl.h (NEG_CAST, ABS_CAST): Use __GMP_CAST.
2968         * mpz/fits_s.h: Use NEG_CAST.
2970 2013-02-14  Marc Glisse  <marc.glisse@inria.fr>
2972         * gmpxx.h (__gmp_binary_greater): Forward to __gmp_binary_less.
2973         (__gmp_binary_equal): Forward to itself after swapping operands.
2975 2013-02-14 Marco Bodrato <bodrato@mail.dm.unipi.it>
2977         * mp_dv_tab.c (__gmp_digit_value_tab): Remove a line of unused values.
2978         * mpf/set_str.c: Update offset accordingly.
2979         * mpz/inp_str.c: Likewise.
2980         * mpz/set_str.c: Likewise.
2982         * gmp-h.in (mpq_cmp_ui): Optimise comparison with 1/1.
2983         * tests/mpq/t-cmp_ui.c: Test special comparisons: 0/1, 1/1.
2985         * mpz/clrbit.c: Reorganise branches.
2986         * mpz/setbit.c: Likewise.
2987         * mpz/combit.c: Same micro-optimisations as in set/clr.
2989         * mpz/aors_ui.h: No realloc if size was zero.
2990         * mpz/ior.c: Use macros: MPZ_REALLOC and MPN_INCR_U.
2992         * gmp-impl.h (NEG_CAST): New macro, used by ABS_CAST.
2993         * mpq/cmp_si.c: Use NEG_CAST.
2994         * mpz/cmp_si.c: Reorganise branches.
2996 2013-02-13  Torbjorn Granlund  <tege@gmplib.org>
2998         * acinclude.m4 (GMP_ASM_X86_MULX, GMP_ASM_X86_ADOX): New feature tests.
2999         * configure.ac: Use new feature tests.
3001         * mpn/x86_64/haswell/mulx/mul_1.asm: File moved to cope with older
3002         assemblers.
3003         * configure.ac: Update haswell path to include "mulx".
3005 2013-02-12  Torbjorn Granlund  <tege@gmplib.org>
3007         * configure.ac: Recognise haswell.
3008         * config.guess: Recognise haswell.
3009         * config.sub: Match haswell.
3011         * mpn/x86_64/haswell/mul_1.asm: New file, mainly for testing HNI.
3013 2013-02-12 Marco Bodrato <bodrato@mail.dm.unipi.it>
3015         * gmp-impl.h (MPZ_PROVOKE_REALLOC): Remove unused macro.
3016         * gen-fac.c (gen_consts): Remove obsolete code, use swap instead of set.
3017         * mini-gmp/mini-gmp.c (fac_ui, bin_uiui): Use shorter and faster code.
3019         * mpn/generic/mulmod_bnm1.c: Reorganise branches.
3020         * mini-gmp/mini-gmp.c: Reduce branches.
3022         * mpz/bin_ui.c: Avoid a copy when n < 0.
3023         * mpz/mfac_uiui.c: Reduce memory usage.
3024         * mpz/primorial_ui.c: Use MPZ_NEWALLOC.
3026         * mpz/import.c: Use BITS_TO_LIMBS and MPZ_NEWALLOC.
3027         * mpz/inp_raw.c: Likewise.
3028         * mpz/rrandomb.c: Likewise.
3029         * mpz/urandomb.c: Likewise.
3030         * mpn/generic/random2.c: Likewise.
3032         * mpn/generic/brootinv.c: Micro-optimisation.
3034         * mpf/set_str.c: Don't chech base==0 when base is strictly positive.
3036 2013-02-10  Torbjorn Granlund  <tege@gmplib.org>
3038         * Version 5.1.1 released.
3040 2013-02-07 Marco Bodrato <bodrato@mail.dm.unipi.it>
3042         * tune/speed.h (SPEED_ROUTINE_MPN_MUL): Use operands from struct s.
3043         * tune/README: Document new parameter syntax mpn_mul.<#> .
3045 2013-02-06  Niels Möller  <nisse@lysator.liu.se>
3047         * tests/mpz/t-jac.c (check_large_quotients): Rewrote. Now uses a
3048         more efficient method for generating the test inputs.
3050 2013-02-05  Torbjorn Granlund  <tege@gmplib.org>
3052         * tests/mpn/t-div.c: Limit random dbits to avoid an infinite loop.
3054 2013-02-03  Torbjorn Granlund  <tege@gmplib.org>
3056         * tests/mpz/reuse.c: Fix typo causing the same negation condition to be
3057         applied to all operands.  Fix condition for when to invoke mpz_remove.
3058         Make different-size random operands.
3060 2013-02-02 Marco Bodrato <bodrato@mail.dm.unipi.it>
3062         * mpz/remove.c: Correct the sign in case of reuse.
3064 2013-02-01  Torbjorn Granlund  <tege@gmplib.org>
3066         * gmp-impl.h (DIGITS_IN_BASE_PER_LIMB): Add a cast.
3067         (LIMBS_PER_DIGIT_IN_BASE): Likewise.
3069         * tests/refmpn.c (refmpn_mul): Use toom6h instead of toom44 for the
3070         largest operands.
3072 2013-01-31  Torbjorn Granlund  <tege@gmplib.org>
3074         * mpn/generic/toom44_mul.c: Revert last change in favour of a simple
3075         change (thanks Marco!).
3076         * mpn/generic/toom4_sqr.c: Likewise.
3078 2013-01-30  Torbjorn Granlund  <tege@gmplib.org>
3080         * mpn/generic/toom44_mul.c (MAYBE_mul_toom44): Take toom6h and toom8h
3081         into account, using new macro MUL_NEXTALG_THRESHOLD.
3082         * mpn/generic/toom4_sqr.c (MAYBE_sqr_toom4): Likewise.
3084 2013-01-26 Marco Bodrato <bodrato@mail.dm.unipi.it>
3086         * mpz/remove.c: init+set=init_set, cast before shifting.
3088         * mpz/cmp_si.c: Use ABS_CAST.
3090 2013-01-26  Torbjorn Granlund  <tege@gmplib.org>
3092         * tests/mpn/logic.c: Set things up to always test library logops, not
3093         gmp-impl.h's inlined variants.  Test also mpn_com.
3095         * tests/mpn/t-mod_1.c: Test also mpn_mod_1s_3p.
3097         * mpn/generic/mod_1_3.c: Swap some lines to make it similar to mod_4.c.
3099         * tests/mpz/reuse.c: Fix typo in last change.
3101 2013-01-23 Marco Bodrato <bodrato@mail.dm.unipi.it>
3103         * mini-gmp/mini-gmp.c (mpz_cmpabs_d, mpz_cmp_d): Simplify.
3104         (mpz_set_str): Behaviour more adherent to the real GMP.
3106         * mini-gmp/tests/t-str.c: Cast size_t to unsigned long, for printf.
3107         * mini-gmp/tests/t-import.c: Likewise.
3108         * mini-gmp/tests/t-comb.c: Remove an unused var.
3109         * mini-gmp/tests/t-div.c: Remove unused args passed to fprintf.
3110         * mini-gmp/tests/t-double.c: Use float immediates with float vars.
3112 2013-01-22  Torbjorn Granlund  <tege@gmplib.org>
3114         * Makefile.am (LIBGMP_LT_*, LIBGMPXX_LT_*): Bump version info.
3115         * gmp-h.in: Bump version.
3117         * tests/mpz/reuse.c: Delete always zero 'failures' and code depending
3118         on it.  Replace rotating progress with real measure.
3120         * Makefile.am (check-mini-gmp): Fix typo in last change.
3122 2013-01-22  Niels Möller  <nisse@lysator.liu.se>
3124         * mini-gmp/mini-gmp.c (mpz_cmp_d): Simplified, just sort out
3125         signs, then call mpz_cmpabs_d.
3127         * mini-gmp/tests/testutils.h: Include stdio.h and stdlib.h.
3128         (numberof): New define.
3130         * mini-gmp/tests/t-cmp_d.c: New file, copied from
3131         tests/mpz/t-cmp_d.c with minor changes.
3132         * mini-gmp/tests/Makefile (CHECK_PROGRAMS): Added t-cmp_d,
3134         * mini-gmp/mini-gmp.c (mpz_cmpabs_d): New function.
3135         * mini-gmp/mini-gmp.h: Declare it.
3137 2013-01-21  Niels Möller  <nisse@lysator.liu.se>
3139         * mini-gmp/tests/t-str.c (testmain): Test mpz_out_str, using
3140         the tmpfile function for i/o.
3142 2013-01-20  Torbjorn Granlund  <tege@gmplib.org>
3144         * Makefile.am (check-mini-gmp): Set also DYLD_LIBRARY_PATH for the
3145         benefit of Darwin.
3147         * tests/mpn/t-div.c: Test mpn_sb_div_qr_sec and mpn_sb_div_r_sec.
3148         (main): Separate divisor into normalised (dnp) and unnormalised (dup),
3149         pass appropriate variant to each function.
3150         (main): Make negative `test' index value mean divisor bits, for better
3151         small operands coverage.
3152         (main): Put random junk at qp[] instead of zeroing.
3154         * tests/mpz/t-remove.c: Back out last change which left `divisor_size'
3155         uninitialised; achieve change's aim with a parameter tweak.
3157 2013-01-20 Marco Bodrato <bodrato@mail.dm.unipi.it>
3159         * mini-gmp/tests/testutils.c (testhalves): New function, test default
3160         memory functions.
3161         * mini-gmp/tests/testutils.h (testhalves): Declare it
3162         * mini-gmp/tests/t-logops.c: Use testhalves.
3164         * mini-gmp/mini-gmp.c (mpz_init_set_str): New function.
3165         * mini-gmp/mini-gmp.h (mpz_init_set_str): Declare it.
3166         * mini-gmp/tests/t-str.c: Test mpz_init_set_str.
3168 2013-01-20  Torbjorn Granlund  <tege@gmplib.org>
3170         * tests/memory.c (PTRLIMB): New macro, used for conformant casting.
3172 2013-01-19 Marco Bodrato <bodrato@mail.dm.unipi.it>
3174         * mini-gmp/tests/t-double.c (testmain): Get the current free
3175         function using mp_get_memory_functions.
3176         * mini-gmp/tests/t-str.c (testmain): Likewise.
3178         * mini-gmp/tests/testutils.h (tu_free): Remove declaration.
3180         * mini-gmp/tests/testutils.c (block_check, tu_free): Mark static.
3182         * tests/mpz/t-set_str.c: Check also failing conditions.
3184         * tests/mpz/t-remove.c: Test removal of 1.
3186 2013-01-18  Niels Möller  <nisse@lysator.liu.se>
3188         * mini-gmp/tests/t-str.c (test_small): New function, exercising
3189         parsing of whitespace and base prefixes.
3190         (testmain): Call it.
3192         * mini-gmp/tests/t-gcd.c (gcdext_valid_p): Fixed memory leak.
3194         * mini-gmp/tests/t-double.c (testmain): Call tu_free rather than
3195         free, for storage allocated by mpz_get_str.
3196         * mini-gmp/tests/t-str.c (testmain): Likewise.
3198         * mini-gmp/tests/testutils.c (block_init, block_check): New
3199         functions.
3200         (tu_alloc, tu_realloc, tu_free): New functions.
3201         (main): Use mp_set_memory_functions.
3202         * mini-gmp/tests/testutils.h (tu_free): Declare.
3204         * mini-gmp/tests/testutils.h: New file, declarations for test
3205         programs.
3207         * mini-gmp/tests/testutils.c (main): New file, with shared main
3208         function for all the test programs. Also includes mini-gmp.c.
3209         Calls testmain after initialization. All other test programs
3210         updated to define testmain rather than main.
3212 2013-01-18 Marco Bodrato <bodrato@mail.dm.unipi.it>
3214         * mini-gmp/tests/t-signed.c: Slightly larger coverage.
3215         * mini-gmp/tests/t-double.c: Test also mpz_init_set_d.
3217 2013-01-18  Torbjorn Granlund  <tege@gmplib.org>
3219         * mpn/generic/set_str.c (normalization_steps): Eliminate set-but-unused
3220         variable.
3222         * mini-gmp/tests/t-div.c: Test mpz_divisible_p and mpz_divisible_ui_p.
3224         * tests/tests.h (TESTS_REPS): Fix printf argument type clashes.
3226         * mini-gmp/tests/t-div.c: Test also mpz_mod, mpz_mod_ui.  Compare
3227         mpz_divisible_p just to ceil, to save time.
3229         * mini-gmp/mini-gmp.c: Prefix some names with GMP_.
3231 2013-01-16 Marco Bodrato <bodrato@mail.dm.unipi.it>
3233         * mini-gmp/tests/t-double.c: Test mpz_cmp_d.
3234         * mini-gmp/mini-gmp.c (mpz_cmp_d): Correct multiword comparison.
3236         * mini-gmp/mini-gmp.c (mpz_set_str): Handle the empty string.
3237         * mini-gmp/tests/t-str.c: Test base <= 0.
3239 2013-01-15  Niels Möller  <nisse@lysator.liu.se>
3241         * mini-gmp/tests/t-str.c (main): Use x->_mp_d rather than x[0]._mp_d.
3242         * mini-gmp/tests/t-invert.c (main): Likewise.
3244         * mini-gmp/tests/t-mul.c (main): Test mpn_mul_n and mpn_sqr.
3246         * mini-gmp/tests/hex-random.h (enum hex_random_op): New value
3247         OP_SQR.
3249         * mini-gmp/tests/mini-random.c (mini_random_op3): Renamed, from...
3250         (mini_random_op): ... old name. Updated callers.
3251         (mini_random_op2): New function.
3253         * mini-gmp/tests/hex-random.c (hex_random_op3): Renamed, from...
3254         (hex_random_op): ... old name. Updated callers.
3255         (hex_random_op2): New function.
3257 2013-01-15 Marco Bodrato <bodrato@mail.dm.unipi.it>
3259         * mini-gmp/tests/t-logops.c: Improve popcount/hamdist testing.
3260         * mini-gmp/tests/t-signed.c: Test more cases.
3262 2013-01-15  Torbjorn Granlund  <tege@gmplib.org>
3264         From Mike Frysinger:
3265         * configure.ac: Add x32 ABI for x86_64.
3267 2013-01-14  Niels Möller  <nisse@lysator.liu.se>
3269         * mini-gmp/tests/t-str.c (main): Added tests for mpn_get_str and
3270         mpn_set_str.
3272 2013-01-14 Marco Bodrato <bodrato@mail.dm.unipi.it>
3274         * doc/gmp.texi (gmp_version): Remove "was used" repetition.
3275         (Upward compatibility): Mention mpn_bdivmod, GMP 4 -> GMP 5.
3277 2013-01-13  Marc Glisse  <marc.glisse@inria.fr>
3279         * doc/gmp.texi: Let mpn_sqrtrem reference mpn_perfect_square_p instead
3280         of mpz_perfect_square_p.
3282 2013-01-11 Marco Bodrato <bodrato@mail.dm.unipi.it>
3284         * mini-gmp/tests/t-comb.c: New test program, testing both
3285         mpz_fac_ui and mpz_bin_uiui.
3286         * mini-gmp/tests/Makefile (CHECK_PROGRAMS): Added t-comb.
3288         * mini-gmp/mini-gmp.c (mpz_mul_si): Simplify.
3289         (mpz_mul_ui, mpz_mul, mpz_div_qr): Replace init+REALLOC with init2.
3291         * mini-gmp/mini-gmp.c (NEG_CAST): New macro.
3292         (mpz_mul_si, mpz_set_si, mpz_cmp_si): Use NEG_CAST.
3294         * mini-gmp/mini-gmp.c (mpz_set_si, mpz_cmp_si): Simplify by using
3295         the _ui variant.
3297         * mini-gmp/tests/t-root.c: Use mpz_ui_pow_ui, when base fits an ui.
3299         * mini-gmp/tests/t-mul.c: Test also mpz_mul_si.
3300         * mini-gmp/tests/t-sub.c: Test also mpz_ui_sub.
3302         * mini-gmp/mini-gmp.c (mpz_fits_slong_p): Correct range.
3303         * mini-gmp/tests/t-signed.c: New test program, for get/set/cmp_si.
3304         * mini-gmp/tests/Makefile (CHECK_PROGRAMS): Added t-signed.
3306         * mini-gmp/mini-gmp.c (mpz_hamdist): Handle different sizes.
3307         * mini-gmp/tests/t-logops.c: Test also popcount and hamdist.
3309 2013-01-10 Marco Bodrato <bodrato@mail.dm.unipi.it>
3311         * mpz/export.c: Less restrictive ASSERTs.
3312         * mini-gmp/mini-gmp.c (mpz_export, mpz_import): Likewise.
3313         * mini-gmp/tests/t-import.c: Test also size=0 or count=0.
3315 2013-01-10  Torbjorn Granlund  <tege@gmplib.org>
3317         * mini-gmp/tests/t-import.c (main): Don't drop off function end.
3319         * Makefile.am (check-mini-gmp): Set LD_LIBRARY_PATH to allow testing
3320         with dynamic main GMP build.
3322 2013-01-09 Marco Bodrato <bodrato@mail.dm.unipi.it>
3324         * mini-gmp/mini-gmp.c (mpz_export): Support op=0 countp=NULL.
3326 2013-01-08  Niels Möller  <nisse@lysator.liu.se>
3328         * mini-gmp/tests/t-import.c: New test program, testing both
3329         mpz_import and mpz_export.
3330         * mini-gmp/tests/Makefile (CHECK_PROGRAMS): Added t-import.
3332         * mini-gmp/tests/mini-random.c (mini_rrandomb_export): New
3333         function.
3334         * mini-gmp/tests/mini-random.h: Declare it.
3335         * mini-gmp/tests/hex-random.c (hex_rrandomb_export): New function.
3336         * mini-gmp/tests/hex-random.h: Declare it.
3338         * mini-gmp/mini-gmp.c (mpz_export): Compute accurate word count up
3339         front, to avoid generating any high zero words.
3341 2013-01-07 Marco Bodrato <bodrato@mail.dm.unipi.it>
3343         * mini-gmp/README: Document base limitation for conversions.
3344         * mini-gmp/mini-gmp.c (mpz_set_str): Remove goto.
3345         (mpz_import, mpz_export): Correctly use order/endianness.
3347 2013-01-05  Torbjorn Granlund  <tege@gmplib.org>
3349         * longlong.h (aarch64): Make add_ssaaaa and sub_ddmmss actually work.
3351 2013-01-04 Marco Bodrato <bodrato@mail.dm.unipi.it>
3353         From shuax:
3354         * mini-gmp/mini-gmp.c (mpz_import): Reset limb after storing it.
3356 2013-01-04  Torbjorn Granlund  <tege@gmplib.org>
3358         From Marko Lindqvist:
3359         * configure.ac: Use AC_CONFIG_HEADERS instead of the obsolete
3360         AM_CONFIG_HEADER.
3362 2013-01-02 Marco Bodrato <bodrato@mail.dm.unipi.it>
3364         * tests/mpz/bit.c: Wider testing for mpz_combit.
3365         * tests/mpz/logic.c: Check the -2^n case.
3367         * mpz/ior.c: Fixed an allocation bug in the -2^n case.
3369 2012-12-31  Torbjorn Granlund  <tege@gmplib.org>
3371         * mpn/generic/get_d.c: Minor reorg, add vax D code.
3373         * gmp-impl.h (double_extract): New union type for vax D floats.
3375         * tests/mpq/t-get_d.c (check_random): Limit exponents on vax.
3377 2012-12-30 Marco Bodrato <bodrato@mail.dm.unipi.it>
3379         * tests/mpz/bit.c (check_clr_extend): Check _set shrink.
3381 2012-12-29  Torbjorn Granlund  <tege@gmplib.org>
3383         * demos/calc/calc.c: Remove generated file from repo.
3384         * demos/calc/calc.h: Likewise.
3385         * demos/calc/calclex.c: Likewise.
3387 2012-12-27  Torbjorn Granlund  <tege@gmplib.org>
3389         * mpn/generic/get_d.c: Complete rewrite of non-IEEE code.
3391         * tests/mpq/t-get_d.c (main): Suppress check_random for vax.
3393 2012-12-25  Torbjorn Granlund  <tege@gmplib.org>
3395         * mpn/x86_64/bdiv_q_1.asm: Use LEA for binvert_limb_table.
3397 2012-12-23  Torbjorn Granlund  <tege@gmplib.org>
3399         * tests/mpz/t-get_d.c (check_onebit): Decrease vax limit to avoid
3400         overflow in last, unused 'want' value.
3402         * config.guess: Recognise AMD family 22 as a future bobcat.
3404 2012-12-21  Torbjorn Granlund  <tege@gmplib.org>
3406         * configure.ac: Rename configure.in.
3408 2012-12-17  Torbjorn Granlund  <tege@gmplib.org>
3410         * Version 5.1.0 released.
3412         * configure.in (none-*-*): Allow this again, but print a warning.
3414 2012-12-17 Marco Bodrato <bodrato@mail.dm.unipi.it>
3416         * mpz/n_pow_ui.c: Fix typos in an ASSERT.
3418 2012-12-16  Torbjorn Granlund  <tege@gmplib.org>
3420         * mpn/generic/mu_div_qr.c (mpn_preinv_mu_div_qr): Explicitly use
3421         MPN_COPY_INCR for slightly overlapping copy.
3423 2012-12-15 Marco Bodrato <bodrato@mail.dm.unipi.it>
3425         * tests/mpn/toom-sqr-shared.h: Skip ALLOCs if the test is skipped.
3427 2012-12-13  Torbjorn Granlund  <tege@gmplib.org>
3429         * mpn/x86_64/dos64.m4 (PIC): Move definition early.
3430         (JMPENT): Remove PIC variant.
3432         * mpn/x86_64/darwin.m4 (JUMPTABSECT): Define to .text, instead of
3433         something sensible.
3435 2012-12-12  Torbjorn Granlund  <tege@gmplib.org>
3437         * mpn/x86_64/x86_64-defs.m4 (JMPENT): New macro.
3438         * mpn/x86_64/dos64.m4: Likewise.
3439         * mpn/x86_64/darwin.m4: Likewise.
3440         * mpn/x86_64/mod_34lsub1.asm: Use JMPENT to properly support PIC.
3441         * mpn/x86_64/mullo_basecase.asm: Likewise.
3442         * mpn/x86_64/sqr_basecase.asm: Likewise.
3444 2012-12-11  Torbjorn Granlund  <tege@gmplib.org>
3446         * mpn/x86_64/mod_34lsub1.asm: Try different jump table for the benefit
3447         of broken Apple linkers.
3449 2012-12-09  Torbjorn Granlund  <tege@gmplib.org>
3451         * configure.in: Make GMP_NONSTD_ABI ABI specific.
3453 2012-12-08  Torbjorn Granlund  <tege@gmplib.org>
3455         * Makefile.am (LIBGMP_LT_*, LIBGMPXX_LT_*): Bump version info.
3456         * gmp-h.in: Bump version.
3458 2012-12-06 Marco Bodrato <bodrato@mail.dm.unipi.it>
3460         * tests/mpq/reuse.c: New test (adapted from mpf/reuse.c).
3461         * tests/mpq/Makefile.am (check_PROGRAMS): Add reuse.
3463         * mpz/abs.c: Use NEWALLOC.
3464         * mpz/neg.c: Likewise.
3465         * mpz/com.c: Reduce branches.
3467 2012-12-05  Niels Möller  <nisse@lysator.liu.se>
3469         * mpn/generic/brootinv.c (mpn_brootinv): Make valgrind happier, at
3470         the cost of a redundant MPN_ZERO.
3472         * mpz/jacobi.c (mpz_jacobi): Check for asize == 0 or bsize == 0
3473         before using the low limbs.
3475 2012-12-05  Torbjorn Granlund  <tege@gmplib.org>
3477         * mpn/generic/set_str.c (mpn_dc_set_str): Work around a valgrind issue.
3479         * mpz/powm_ui.c: Don't assume >= 2 limbs in mod argument.
3481         * tests/tests.h (TESTS_REPS): Handle float GMP_CHECK_REPFACTOR.
3483         * longlong.h: Refine cpp test for vax.
3484         * tests/mpn/t-get_d.c: Likewise.
3485         * tests/mpz/t-get_d.c: Likewise.
3486         * tests/mpz/t-cmp_d.c: Likewise.
3487         * tests/mpz/t-get_d.c: Likewise.
3488         * tests/mpq/t-get_d.c: Likewise.
3489         * tests/mpf/t-get_d.c: Likewise.
3491 2012-11-30  Torbjorn Granlund  <tege@gmplib.org>
3493         * gen-fac.c (gen_consts): Correct printf types.
3495         * mpn/arm/v7a/cora15/gmp-mparam.h: New file.
3497         * configure.in (arm*-*-*): New compiler optional "tune".  Pass value for
3498         selected processors.  Add more specific path components.
3500 2012-11-29  Torbjorn Granlund  <tege@gmplib.org>
3502         From Andoni Morales Alastruey:
3503         * longlong.h: Conditionalise ARM asm on !__thumb__.
3505 2012-11-28  Torbjorn Granlund  <tege@gmplib.org>
3507         * config.guess (arm*-*-*): Support specific ARM processors.
3508         * config.sub: Match arm CPUs.
3509         * configure.in (arm*-*-*): Likewise.
3511         * mpz/powm.c: Move new_b out since it lives on through b.
3513         * configure.in (arm*-*-*): Pass -marm to deal with compilers defaulting
3514         to thumb code.
3516 2012-11-26  Torbjorn Granlund  <tege@gmplib.org>
3518         * tests/cxx/t-ops2.cc (checkz): Reduce huge numbers to avoid vax
3519         overflow.
3521 2012-11-25  Torbjorn Granlund  <tege@gmplib.org>
3523         * mpn/generic/get_d.c: Reinsert non-IEEE code.
3525         * mpn/vax/add_n.asm: New file.
3526         * mpn/vax/add_n.s: Remove.
3527         * mpn/vax/addmul_1.asm: New file.
3528         * mpn/vax/addmul_1.s: Remove.
3529         * mpn/vax/lshift.asm: New file.
3530         * mpn/vax/lshift.s: Remove.
3531         * mpn/vax/mul_1.asm: New file.
3532         * mpn/vax/mul_1.s: Remove.
3533         * mpn/vax/rshift.asm: New file.
3534         * mpn/vax/rshift.s: Remove.
3535         * mpn/vax/sub_n.asm: New file.
3536         * mpn/vax/sub_n.s: Remove.
3537         * mpn/vax/submul_1.asm: New file.
3538         * mpn/vax/submul_1.s: Remove.
3540         * mpn/vax/elf.m4: New file.
3541         * configure.in (vax*-*-*elf*): New case, grabbing vax/elf.m4.
3543         * tests/mpn/t-get_d.c (check_onebit): Get vax bounds right.
3544         (main): Switch off check_rand for vax.
3546 2012-11-22  Niels Möller  <nisse@lysator.liu.se>
3548         * mini-gmp/tests/run-tests: Copied latest version from GNU Nettle.
3549         Minor fix to the use of $EMULATOR, and proper copyright notice.
3551 2012-11-16  Torbjorn Granlund  <tege@gmplib.org>
3553         * mpn/generic/powm_sec.c (redcify): Use mpn_sb_div_r_sec.
3555         * mpn/generic/sb_div_sec.c: New file.
3556         * mpn/generic/sbpi1_div_sec.c: New file.
3557         * configure.in (gmp_mpn_functions): Add new files.
3558         * gmp-impl.h: Declare new functions.
3560 2012-11-12  Torbjorn Granlund  <tege@gmplib.org>
3562         * longlong.h: Add ARM64 support.
3563         * longlong.h: Add AVR support.
3565         * mpn/powerpc64/mode64/divrem_1.asm: Tune, simplify.
3567         * mpq/md_2exp.c: Use MPN_COPY_INCR, not MPN_COPY_DECR.
3568         * tests/mpq/t-md_2exp.c (check_random): New function.
3570 2012-11-10  Torbjorn Granlund  <tege@gmplib.org>
3572         * mpn/generic/remove.c (mpn_bdiv_qr_wrap): Make static.
3574 2012-11-04  Torbjorn Granlund  <tege@gmplib.org>
3576         * mpz/powm_ui.c: Rewrite.
3578 2012-11-01  Niels Möller  <nisse@lysator.liu.se>
3580         * mpn/generic/brootinv.c (mpn_brootinv): Input size in limbs
3581         rather than bits. Use single-precision iterations for the first
3582         limb.
3583         * mpn/generic/perfpow.c (is_kth_power): Update mpn_brootinv call.
3584         * tests/mpn/t-brootinv.c (main): Likewise.
3585         * tune/speed.h (SPEED_ROUTINE_MPN_BROOTINV): Likewise.
3586         * gmp-impl.h (mpn_brootinv): Updated prototype.
3588         * mpn/generic/hgcd2.c (mpn_hgcd2): Removed redundant loop exit
3589         tests in the single-precision loop.
3591         * mpz/combit.c (mpz_combit): Rewrite, optimizing for the common
3592         case.
3594 2012-10-31  Niels Möller  <nisse@lysator.liu.se>
3596         * tests/mpn/Makefile.am (check_PROGRAMS): Added t-brootinv.
3597         * tests/mpn/t-brootinv.c: New file
3599         * mpn/generic/broot.c (mpn_broot_invm1): Avoid a mullo_n in the
3600         loop, and do powering as a plain mpn_sqr followed by mpn_powlo.
3602         * tune/speed.c (routine): Added mpn_broot, mpn_broot_invm1,
3603         mpn_brootinv.
3605         * tune/common.c (speed_mpn_broot, speed_mpn_broot_invm1)
3606         (speed_mpn_brootinv): New functions.
3607         * tune/speed.h (SPEED_ROUTINE_MPN_BROOT)
3608         (SPEED_ROUTINE_MPN_BROOTINV): New macros.
3610         * mpn/generic/broot.c (mpn_broot_invm1): Made non-static (mainly
3611         for benchmarking).
3612         * gmp-impl.h (mpn_broot_invm1): Declare it.
3614 2012-10-28  Torbjorn Granlund  <tege@gmplib.org>
3616         * configure.in (gmp_mpn_functions): Add new files.
3617         * gmp-impl.h: Declare new functions.
3618         * mpn/generic/perfpow.c: Overhaul.
3619         (binv_root, binv_sqroot): Remove.
3620         * mpn/generic/brootinv.c: New file, code from overhauled binv_root.
3621         * mpn/generic/bsqrtinv.c: New file, code from overhauled binv_sqroot.
3622         * mpn/generic/bsqrt.c: New file.
3624         * tests/mpn/t-broot.c: Add a forgotten TMP_MARK.
3626 2012-10-28  Niels Möller  <nisse@lysator.liu.se>
3628         * mpn/generic/broot.c (mpn_broot): New file and function.
3629         * configure.in (gmp_mpn_functions): Add broot.
3630         * gmp-impl.h (mpn_broot): Declare.
3631         * tests/mpn/t-broot.c: New testcase.
3632         * tests/mpn/Makefile.am (check_PROGRAMS): Added t-broot.
3634 2012-10-27  Torbjorn Granlund  <tege@gmplib.org>
3636         * mpn/generic/remove.c: Get remainder allocation right.
3638 2012-10-25  Torbjorn Granlund  <tege@gmplib.org>
3640         * longlong.h: De-support old POWER asm syntax.
3642         * tests/mpz/t-remove.c: Run more tests, but use a tad smaller operands.
3644         * mpn/generic/remove.c (mpn_bdiv_qr_wrap): New function.
3645         (mpn_remove): Call mpn_bdiv_qr_wrap.
3646         * mpz/remove.c: Enable suppressed mpn_remove call.
3648 2012-10-17  Torbjorn Granlund  <tege@gmplib.org>
3650         * mpz/powm_ui.c (mpz_powm_ui): Deflect to mpz_powm for large exponent.
3652 2012-09-10  Torbjorn Granlund  <tege@gmplib.org>
3654         * demos/factorize.c: Rewrite no more current form.  Implement Lucas
3655         prime proving, and make its use the default.
3656         * demos/primes.h: New file.
3658 2012-08-24  Torbjorn Granlund  <tege@gmplib.org>
3660         * demos/factorize.c: Overhaul.
3662 2012-08-06 Marco Bodrato <bodrato@mail.dm.unipi.it>
3664         * doc/gmp.texi (mpn_neg): Correctly document returned type.
3666         * gmp-impl.h (_mpz_newalloc, log_n_max): mark with inline (spotted by Niels).
3668 2012-07-28  Marc Glisse  <marc.glisse@inria.fr>
3670         * gmpxx.h (std::common_type): New partial specializations with builtin
3671         types.
3672         * tests/cxx/t-cxx11.cc: Test it.
3674 2012-07-21  Torbjorn Granlund  <tege@gmplib.org>
3676         * mpn/powerpc32/vmx/mod_34lsub1.asm: Fix r0 clobbering issue with
3677         "large" code affecting elf+darwin PIC.
3679 2012-07-21  Marc Glisse  <marc.glisse@inria.fr>
3681         * gmpxx.h (__GMPXX_CONSTANT): Disable for g++-3.4.
3683 2012-06-26  Torbjorn Granlund  <tege@gmplib.org>
3685         * Makefile.am (LIBMP_LT_*): Remove these.
3687 2012-06-26  Marc Glisse  <marc.glisse@inria.fr>
3689         * Makefile.am (LIBGMP_LT_*, LIBGMPXX_LT_*): Update comment for 5.1.0.
3691 2012-06-24 Marco Bodrato <bodrato@mail.dm.unipi.it>
3693         * configure.in (CALLING_CONVENTIONS_OBJS): Disable any use of
3694         assembly code with the --disable-assembly option.
3695         * mpz/oddfac_1.c: Use the ASSERT_CODE macro.
3696         * gen-trialdivtab.c (mpz_log2): Use mpz_sizeinbase (., 2).
3698         * gmp-impl.h (MPN_SIZEINBASE_16): Replace with MPN_SIZEINBASE_2EXP
3699         from mpz/export.c .
3700         * mpz/export.c (MPN_SIZEINBASE_2EXP): Removed.
3701         * mpn/generic/sizeinbase.c: Use MPN_SIZEINBASE.
3703         * mpz/nextprime.c: Use MPN_SIZEINBASE_2EXP to count bits.
3704         * mpn/generic/perfpow.c: Likewise.
3705         * mpn/generic/rootrem.c: Likewise.
3706         * mpz/get_d_2exp.c: Likewise.
3707         * mpn/generic/powm_sec.c: Likewise, nailify.
3708         * mpn/generic/powlo.c: Likewise.
3709         * mpn/generic/powm.c: Likewise.
3711         * mini-gmp/mini-gmp.c (mpz_div_r_2exp, mpz_div_q_2exp): Improve
3712         adjustment condition.
3714 2012-06-23  Marc Glisse  <marc.glisse@inria.fr>
3716         * gmpxx.h (numeric_limits): Make content public.
3717         * cxx/limits.cc: New file, proper declarations.
3718         * Makefile.am: List new file.
3719         * cxx/Makefile.am: Likewise.
3720         * cxx/t-misc.cc: Add minimal test for numeric_limits.
3722 2012-06-09  Marc Glisse  <marc.glisse@inria.fr>
3724         * gmpxx.h (__gmp_resolve_expr::srcptr_type): New typedef.
3725         (__gmp_temp): Wrapper for mp*_class, the constructor copies the
3726         precision of its second argument for mpf_t.
3727         (__gmp_expr::eval(p, prec)): Remove.
3728         (__gmp_expr::eval(p)): Use __gmp_temp.
3729         (__gmp_set_expr): Never pass prec to eval().
3731 2012-06-08 Marco Bodrato <bodrato@mail.dm.unipi.it>
3733         * gmp-impl.h (__GMP_WITHIN_CONFIGURE): Use the same #if as in gmp-h.in.
3734         (MPN_NORMALIZE_NOT_ZERO): Tighter ASSERT.
3735         (MPZ_NEWALLOC): New macro.
3736         * mpq: Use the new macro when possible.
3737         * mpz/bin_uiui.c: Likewise.
3738         * mpz/oddfac_1.c: Likewise.
3739         * mpz/prodlimbs.c: Likewise.
3741         * mini-gmp/mini-gmp.c (mpz_realloc): remove a branch.
3743 2012-06-04  Torbjorn Granlund  <tege@gmplib.org>
3745         * mpn/powerpc64/aix.m4 (ASM_START): Claim machine type "any".
3747 2012-06-03  Niels Möller  <nisse@lysator.liu.se>
3749         * mpn/generic/gcdext.c (mpn_gcdext): Deleted code for handling
3750         impossible case u1 == 0, Simplified test for unlikely case u0 == 0.
3752 2012-06-02  Torbjorn Granlund  <tege@gmplib.org>
3754         * mpn/arm/lshiftc.asm: New file.
3756 2012-06-01  Torbjorn Granlund  <tege@gmplib.org>
3758         * mpn/arm/aorslsh1_n.asm: Use cmp/cmn instead of subs/adds in more
3759         places.
3761         * mpz/get_str.c: Don't strip leading zeros since current mpn_get_str
3762         won't generate any.  Misc streamlining.
3763         * mpz/out_str.c: Analogous changes.
3765         * tests/mpz/io.c: Use a wider range of bases.
3767         * tests/mpz/t-cong.c (check_random): Rewrite random generation for
3768         exponentially distributed operand sizes.
3770 2012-06-01 Marco Bodrato <bodrato@mail.dm.unipi.it>
3772         * mpq: Use more macros and MPZ_REALLOC return value when possible.
3774         * gmp-impl.h (LIMBS): Removed, was an alias for PTR.
3775         * mpz/combit.c: Use PTR and CNST_LIMB.
3777         * tests/mpn/t-bdiv.c: Test also mpn_bdiv_qr.
3778         * mpn/generic/bdiv_qr.c: Add an ASSERT.
3780         * mpn/generic/remove.c: Add a zero limb to use bdiv_qr...
3782 2012-05-31  Marc Glisse  <marc.glisse@inria.fr>
3784         * gmpxx.h (mpq_class::mpq_class): Handle mpq_class(0,1).
3785         * tests/cxx/t-constr.cc: Test it.
3787 2012-05-30  Torbjorn Granlund  <tege@gmplib.org>
3789         * mpn/x86_64 (FUNC_ENTRY): New name for DOS64_ENTRY.
3790         * mpn/x86_64 (FUNC_EXIT): New name for DOS64_EXIT.
3792 2012-05-29 Marco Bodrato <bodrato@mail.dm.unipi.it>
3794         * mpz/remove.c: Optimise branches.
3796         * mpn/generic/toom6h_mul.c: less branches in the LIKELY balanced path.
3797         * mpn/generic/toom8h_mul.c: Likewise.
3799 2012-05-29  Torbjorn Granlund  <tege@gmplib.org>
3801         * mpn/arm/v5/mod_1_1.asm: New file.
3803 2012-05-28  Niels Möller  <nisse@lysator.liu.se>
3805         * mpn/generic/gcdext.c (compute_v): Simplified carry handling a
3806         bit, reduced stated scratch need from 2n+1 to 2n. Also comment and
3807         ASSERT improvements.
3809 2012-05-27  Torbjorn Granlund  <tege@gmplib.org>
3811         * config.guess: Add new x86 CPUs.
3812         * mpn/x86/fat/fat.c: Likewise.
3813         * mpn/x86_64/fat/fat.c: Likewise.
3815 2012-05-27 Marco Bodrato <bodrato@mail.dm.unipi.it>
3817         * mpn/x86_64/fat/fat.c: abort iff longmode-capable-bit is turned off.
3819         * mpn/generic/toom8h_mul.c: mark UNLIKELY branches.
3821 2012-05-26  Torbjorn Granlund  <tege@gmplib.org>
3823         * mpz: Use MPZ_REALLOC return value when possible.
3825 2012-05-25 Marco Bodrato <bodrato@mail.dm.unipi.it>
3827         * mini-gmp/tests/t-div.c: Test all _qr, _q, _r variants.
3828         * mini-gmp/tests/t-lcm.c: Test the _ui variant.
3830         * mini-gmp/mini-gmp.c (mpz_mod, mpz_mod_ui): New functions.
3831         * mini-gmp/mini-gmp.h (mpz_mod, mpz_mod_ui): Prototypes.
3833         * mpz/scan1.c: Simplify, and add a shortcut for scan1(z, 0).
3835 2012-05-24  Torbjorn Granlund  <tege@gmplib.org>
3837         * mpz/n_pow_ui.c: Cast non-limb count_leading_zeros argument.
3839 2012-05-24 Marco Bodrato <bodrato@mail.dm.unipi.it>
3841         * mpz/remove.c: Support negative divisor.
3842         * tests/mpz/t-remove.c: Test negative divisor.
3844 2012-05-23  Torbjorn Granlund  <tege@gmplib.org>
3846         * tests/mpz/reuse.c: Major rewrite.
3848 2012-05-23 Marco Bodrato <bodrato@mail.dm.unipi.it>
3850         * mpz/sqrt.c: Further simplify.
3851         * mpz/sqrtrem.c: Likewise.
3853         * Mark failing branches with UNLIKELY. Many files affected.
3855 2012-05-22  Torbjorn Granlund  <tege@gmplib.org>
3857         * mpz/sqrt.c: Allocate less for overlapping operands, simplify.
3858         * mpz/sqrtrem.c: Likewise.
3860 2012-05-21 Marco Bodrato <bodrato@mail.dm.unipi.it>
3862         * mpn/generic/toom8_sqr.c: Reduce branches for recursion.
3863         * mpn/generic/toom8h_mul.c: Likewise.
3865         * tests/mpn/t-toom8h.c: Don't use GMP_NUMB_BITS when not yet defined.
3867 2012-05-20  Torbjorn Granlund  <tege@gmplib.org>
3869         * tests/mpz/t-gcd.c: Rewrite.
3871 2012-05-19  Torbjorn Granlund  <tege@gmplib.org>
3873         * tests/mpz/t-gcd.c: Generate larger operands for better gcd code
3874         coverage; distribute size exponentially.
3876 2012-05-17 Marco Bodrato <bodrato@mail.dm.unipi.it>
3878         * mpf/pow_ui.c: Simplify.
3879         * tests/mpf/reuse.c (dsi_func): Exercise pow_ui.
3881         * tests/mpf/t-set_ui.c (check_data): LONG_HIGHBIT -> ULONG_HIGHBIT.
3882         * tests/mpf/t-set.c (check_random): New check, both set and init_set.
3884         * tests/cxx/t-ops.cc (check_mpq): Check squaring.
3885         * tests/mpq/t-equal.c (check_various): Check different den-size.
3887         * mpn/generic/mullo_n.c: Disable MAYBE_ if WANT_FAT_BINARY.
3888         * mpz/cmpabs_d.c: Remove an unused branch.
3890         * tests/mpz/t-get_d_2exp.c (check_zero): New check.
3891         * tests/mpz/t-inp_str.c: A few more cases.
3892         * tests/mpz/t-cmp_d.c: More bases and symbols, a few cases.
3894         * mpz/rootrem.c: Correctly handle odd roots of negatives.
3895         * tests/mpz/t-root.c: Test it.
3897 2012-05-16  Torbjorn Granlund  <tege@gmplib.org>
3899         * tests/mpf/t-eq.c (check_random): New function, meat from old main().
3900         (check_data): New function.
3902 2012-05-13  Torbjorn Granlund  <tege@gmplib.org>
3904         * mpn/arm/rsh1aors_n.asm: New file.
3905         * mpn/arm/v5/mod_1_2.asm: New file.
3907 2012-05-11  Marc Glisse  <marc.glisse@inria.fr>
3909         * gmpxx.h (explicit operator bool): New functions.
3910         * tests/cxx/t-cxx11.cc: Test the above.
3912 2012-05-10 Marco Bodrato <bodrato@mail.dm.unipi.it>
3914         * gmp-impl.h (__gmpn_cpuvec_initialized): Was __gmpn_cpuvec.initialized
3915         * mpn/x86/fat/fat.c: Use separated _initialized variable.
3916         * mpn/x86_64/fat/fat.c: Likewise.
3917         * tests/mpn/t-fat.c: Likewise.
3919         * mpn/generic/toom2_sqr.c: Override global __gmpn_cpuvec_initialized.
3920         * mpn/generic/toom22_mul.c: Likewise.
3921         * mpn/generic/toom3_sqr.c: Likewise.
3922         * mpn/generic/toom33_mul.c: Likewise.
3924 2012-05-09 Marco Bodrato <bodrato@mail.dm.unipi.it>
3926         * mini-gmp/mini-gmp.c: merge mpz_rootrem and mpz_sqrtrem.
3928         * mpn/generic/sqrtrem.c (invsqrttab): Reduce size removing common byte.
3930         * mpz/bin_uiui.c (mul3, mul4, mul8): Remove unneeded shifts.
3931         (MAXFACS): Redefine, using the shared (safer) log_n_max.
3933 2012-05-08  Torbjorn Granlund  <tege@gmplib.org>
3935         * mpn/minithres/gmp-mparam.h (REDC_1_TO_REDC_N_THRESHOLD): Up to 9, for
3936         coherency with ASSERT in mpn/generic/redc_n.c.
3938 2012-05-07 Marco Bodrato <bodrato@mail.dm.unipi.it>
3940         * mpn/minithres/gmp-mparam.h: Updated TOOM6 and FAC_DSC.
3941         * tests/mpn/toom-sqr-shared.h: Don't test if no range.
3943         * mpz/oddfac_1.c: Add ASSERTs to warn about small threshold.
3944         * tune/tuneup.c: Update minimal threshold for FAC_DSC.
3946 2012-05-06  Torbjorn Granlund  <tege@gmplib.org>
3948         * mpn/arm/v6/sqr_basecase.asm: Simplify n=4 code.
3950 2012-05-05 Marco Bodrato <bodrato@mail.dm.unipi.it>
3952         * mpn/generic/invert.c: Mark a branch UNLIKELY.
3953         * tune/tuneup.c (tune_fac_u): Update DSC_THRESHOLD minimum.
3954         * gmp-impl.h (FAC_???_THRESHOLD): Update default values.
3955         (ABOVE_THRESHOLD): New definition with __builtin_constant_p.
3957         * mpn/generic/toom22_mul.c: Disable MAYBE_ if WANT_FAT_BINARY.
3958         * mpn/generic/toom33_mul.c: Likewise.
3959         * mpn/generic/toom2_sqr.c: Likewise.
3960         * mpn/generic/toom3_sqr.c: Likewise.
3962 2012-05-04  Torbjorn Granlund  <tege@gmplib.org>
3964         * tune/tuneup.c: Measure POWM_SEC_TABLE after the REDC thresholds.
3966 2012-05-03  Torbjorn Granlund  <tege@gmplib.org>
3968         * mpn/generic/powm_sec.c: Use redc_2.
3969         (INNERLOOP): Use this mechanism, like plain powm.c.
3970         (WANT_CACHE_SECURITY): Remove, feature now unconditional.
3972 2012-05-02  Torbjorn Granlund  <tege@gmplib.org>
3974         * mpz/bin_uiui.c: Make use of CNST_LIMB.
3976 2012-05-02 Marco Bodrato <bodrato@mail.dm.unipi.it>
3978         * mpz/mfac_uiui.c: Support limb != ui.
3980 2012-05-02  Torbjorn Granlund  <tege@gmplib.org>
3982         * mpn/arm/logops_n.asm: Work around register clobbering issue.
3984         * mpn/arm/aorscnd_n.asm: New file.
3986 2012-05-01  Torbjorn Granlund  <tege@gmplib.org>
3988         * configure.in: Put arm dirs in path in proper prio order.
3990         * mpn/arm/logops_n.asm: New file.
3992         * mpz/2fac_ui.c: Fix assumed typo.
3994         * mpn/arm/v6/gmp-mparam.h: New file.
3996         * mpn/arm/v5/gcd_1.asm: Hack for undefined BMOD_1_TO_MOD_1_THRESHOLD.
3997         * mpn/arm/v6t2/gcd_1.asm: Likewise.
3999 2012-04-30  Torbjorn Granlund  <tege@gmplib.org>
4001         * mpn/arm/v6/sqr_basecase.asm: New file.
4003 2012-04-30 Marco Bodrato <bodrato@mail.dm.unipi.it>
4005         * mpn/generic/comb_tables.c: New file.
4006         * configure.in: Add it.
4007         * gen-fac.c: Define table limits.
4008         * gmp-impl.h: Declare tables.
4009         (log_n_max): New static function.
4010         * mpz/2fac_ui.c: Use shared tables.
4011         * mpz/bin_uiui.c: Likewise.
4012         * mpz/oddfac_1.c: Likewise.
4013         * mpz/primorial_ui.c: Likewise.
4015         * mpz/mfac_uiui.c: New file.
4016         * Makefile.am: Compile it.
4017         * mpz/Makefile.am (libmpz_la_SOURCES): Add mpz_mfac_uiui.c
4018         * gmp-h.in (mpz_mfac_uiui): Declare.
4020         * tests/mpz/t-mfac_uiui.c: New file.
4021         * tests/mpz/Makefile.am: Run it.
4023         * doc/gmp.texi: Document mpz_mfac_uiui, collapsing with other factorial functions.
4025         * tests/mpz/t-lcm.c: Test zero too.
4027         * mpz/prodlimbs.c: Simplify threshold (should be tuned, not guessed).
4029 2012-04-29  Torbjorn Granlund  <tege@gmplib.org>
4031         * mpn/arm/aors_n.asm: Tune for more stable performance.
4033         * mpn/arm/aorslsh1_n.asm: New file.
4035         * mpn/arm/mod_34lsub1.asm: New file.
4037         * mpn/arm/v6t2/divrem_1.asm: New file.
4039 2012-04-28  Torbjorn Granlund  <tege@gmplib.org>
4041         * mpn/thumb/add_n.asm: New file.
4042         * mpn/thumb/sub_n.asm: New file.
4043         * mpn/thumb/add_n.s: Remove broken code.
4044         * mpn/thumb/sub_n.s: Likewise.
4046         * mpn/arm/v6/addmul_1.asm: Rewrite for stable speed, smaller size.
4047         * mpn/arm/v6/mul_1.asm: Likewise.
4049 2012-04-27  Torbjorn Granlund  <tege@gmplib.org>
4051         * configure.in: Search arm/v6t2 for arm7.
4053         * mpn/arm/v5/gcd_1.asm: New file.
4054         * mpn/arm/v6t2/gcd_1.asm: New file.
4056         * mpn/arm/mode1o.asm: New file.
4057         * mpn/arm/v6t2/mode1o.asm: New file.
4059         * mpn/arm/arm-defs.m4 (LEA): New define.
4060         * mpn/arm/invert_limb.asm: Use LEA.
4062 2012-04-26 Marco Bodrato <bodrato@mail.dm.unipi.it>
4064         * mpz/bin_uiui.c (bc_bin_uiui): Nail support.
4065         * tests/cxx/t-ops2.cc: Test 0/3.
4066         * oddfac_1.c: assume n > 26.
4067         * tests/mpz/t-jac.c (mpn_jacobi_n): Enlarge tested sizes.
4069 2012-04-24  Torbjorn Granlund  <tege@gmplib.org>
4071         * mpn/arm/v6/addmul_2.asm: New file.
4072         * mpn/arm/v6/mul_2.asm: New file.
4074 2012-04-23  Torbjorn Granlund  <tege@gmplib.org>
4076         * mpn/arm/aorsmul_1.asm: Tweak loop control for a 6% speed increase.
4078 2012-04-22  Torbjorn Granlund  <tege@gmplib.org>
4080         * configure.in: Recognise ARM sub-architectures.
4082         * configfsf.guess: Update to current FSF version.
4083         * configfsf.sub: Likewise.
4085         * mpn/arm/bdiv_dbm1c.asm: New file.
4087         * mpn/arm/v6/mul_1.asm: New file.
4088         * mpn/arm/v6/addmul_1.asm: New file.
4090 2012-04-22 Marco Bodrato <bodrato@mail.dm.unipi.it>
4092         * gen-fac.c: Renamed, was gen-fac_ui.c .
4093         * Makefile.am: Renamed gen-fac.c and fac_table.h .
4094         * gmp-impl.h: #include "fac_table.h".
4095         * mpz/oddfac_1.c: Use generated constant.
4096         * mpz/bin_ui.c: Small optimisations.
4098         * tune/common.c (speed_mpz_bin_ui): New function.
4099         * tune/speed.h: Declare it.
4100         * tune/speed.c: Use it.
4102 2012-04-21  Torbjorn Granlund  <tege@gmplib.org>
4104         * mpn/arm/mul_1.asm: Cleanup.
4105         * mpn/arm/copyi.asm: Cleanup, assume allocate-on-write cache.
4106         * mpn/arm/copyd.asm: Likewise.
4108         * mpn/arm/add_n.asm: Delete.
4109         * mpn/arm/sub_n.asm: Delete.
4110         * mpn/arm/aors_n.asm: New file, made from old files.
4112         * mpn/arm/addmul_1.asm: Delete.
4113         * mpn/arm/submul_1.asm: Delete.
4114         * mpn/arm/aorsmul_1.asm: New file, made from old files.
4116         * mpn/arm/com.asm: New file.
4117         * mpn/arm/lshift.asm: New file.
4118         * mpn/arm/rshift.asm: New file.
4120 2012-04-20  Torbjorn Granlund  <tege@gmplib.org>
4122         * tests/mpq/io.c: New file.
4123         * tests/mpq/Makefile.am: Run it.
4125         * mpz/clrbit.c: Simplify along the lines of setbit.c.
4127 2012-04-20 Marco Bodrato <bodrato@mail.dm.unipi.it>
4129         * mpz/setbit.c: Simplify.
4131         * gmp-impl.h (LOG2C): Define.
4132         * mpz/fac_ui.c (LOG2C): Remove.
4133         * mpz/2fac_ui.c (LOG2C): Remove.
4134         * mpz/oddfac_1.c (LOG2C): Remove.
4135         * mpn/generic/binvert.c (LOG2C): Remove.
4136         * mpn/generic/invertappr.c (LOG2C): Remove.
4138         * mpz/bin_uiui.c (mpz_goetgheluck_bin_uiui): Move declarations,
4139         and assume that n and k are not small.
4141 2012-04-19  Torbjorn Granlund  <tege@gmplib.org>
4143         * tests/mpz/Makefile.am (check_PROGRAMS): Add t-remove.
4145         * tests/mpz/t-remove.c: Clear out mpz variables.
4147         * tests/mpz/t-cong.c (check_random): Use much larger numbers.
4148         (check_data): Check congruences mod 0.
4150         * tests/mpz/t-divis.c: Test divisibility by zero.
4152         * tests/mpz/reuse.c: Test mpz_mod.
4154         * mpz/setbit.c: Remove dead code.  Use CNST_LIMB.
4155         * mpz/clrbit.c: Use CNST_LIMB.
4157 2012-04-19 Marco Bodrato <bodrato@mail.dm.unipi.it>
4159         * primesieve.c: New file, with functions from mpz/oddfac_1.c .
4160         * mpz/oddfac_1.c (bitwise_primesieve): Re-moved.
4161         * Makefile.am (libgmp_la_SOURCES): Add primesieve.c .
4162         * gmp-impl.h (gmp_primesieve): Declare.
4164         * mpz/bin_uiui.c (mpz_goetgheluck_bin_uiui): New, factor-based
4165         implementation.
4166         * tests/mpz/t-bin.c: Extend tests, to cover _goetgheluck.
4168         * mpz/primorial_ui.c: New file.
4169         * mpz/Makefile.am (libmpz_la_SOURCES): Add mpz/primorial_ui.c
4170         * Makefile.am (MPZ_OBJECTS): Add mpz/primorial_ui$U.lo
4171         * gmp-h.in (mpz_primorial_ui): Declare.
4172         * tests/mpz/t-primorial_ui.c: New test for the new function.
4173         * tests/mpz/Makefile.am (check_PROGRAMS): Add t-primorial_ui.
4174         * doc/gmp.texi: Short documentation for the new function.
4176 2012-04-17  Torbjorn Granlund  <tege@gmplib.org>
4178         * mpn/x86_64/coreisbr/aorsmul_1.asm: Fix some DOS64 issues.
4179         * mpn/x86_64/coreisbr/mul_1.asm: Likewise.
4181         * mpn/x86_64/fastsse/lshiftc-movdqu2.asm: Adhere to DOS64 register
4182         partitioning rules.
4184         * mpn/x86_64/fastsse/copyi-palignr.asm: Implement temporary workaround
4185         to overlap issue.
4187 2012-04-17 Marco Bodrato <bodrato@mail.dm.unipi.it>
4189         * mpz/bin_uiui.c: Support small limbs (fallback on bin_ui).
4191         * tests/mpn/toom-sqr-shared.h: Use a restricted range.
4192         * tests/mpn/t-toom2-sqr.c: Specify correct range.
4193         * tests/mpn/t-toom3-sqr.c: Likewise.
4194         * tests/mpn/t-toom4-sqr.c: Likewise.
4195         * tests/mpn/t-toom6-sqr.c: Likewise.
4196         * tests/mpn/t-toom8-sqr.c: Likewise, but extended.
4197         * tests/mpn/Makefile.am (check_PROGRAMS): Add t-toom?-sqr tests.
4199         * mpn/generic/sbpi1_bdiv_q.c: Move ASSERTs, to support qp = np.
4201 2012-04-17  Torbjorn Granlund  <tege@gmplib.org>
4203         * mpn/x86_64/copyd.asm: Rewrite.
4204         * mpn/x86_64/copyi.asm: Rewrite.
4206 2012-04-16  Torbjorn Granlund  <tege@gmplib.org>
4208         * mpn/x86_64/fastsse/lshift-movdqu2.asm: Add DOS entry/exit sequences.
4209         * mpn/x86_64/fastsse/rshift-movdqu2.asm: Likewise.
4210         * mpn/x86_64/fastsse/lshiftc-movdqu2.asm: Likewise.
4212         * mpn/x86_64/x86_64-defs.m4 (palignr): New macro.
4213         (x86_opcode_regxmm, x86_opcode_regxmm_list): New, made from x86 mmx
4214         counterparts.
4215         (x86_lookup): Copy from x86/x86-defs.m4.
4216         * mpn/x86_64/fastsse/copyd-palignr.asm: Use palignr macro.
4217         * mpn/x86_64/fastsse/copyi-palignr.asm: Likewise.
4219 2012-04-15 Marco Bodrato <bodrato@mail.dm.unipi.it>
4221         * tests/mpz/t-bin.c: Add more tests on small values.
4222         * mpz/bin_uiui.c (mpz_bdiv_bin_uiui): Smaller temporary areas.
4224 2012-04-15  Torbjorn Granlund  <tege@gmplib.org>
4226         * mpn/x86_64/fastsse/copyd-palignr.asm: New file.
4227         * mpn/x86_64/fastsse/copyi-palignr.asm: New file.
4228         * mpn/x86_64/core2/copyd.asm: New file.
4229         * mpn/x86_64/core2/copyi.asm: New file.
4230         * mpn/x86_64/nano/copyd.asm: New file.
4231         * mpn/x86_64/nano/copyi.asm: New file.
4232         * mpn/x86_64/atom/copyd.asm: New file.
4233         * mpn/x86_64/atom/copyi.asm: New file.
4235 2012-04-13 Marco Bodrato <bodrato@mail.dm.unipi.it>
4237         * mpz/bin_uiui.c: Rewrite (some parts are Torbjorn's).
4238         * gen-fac_ui.c: Generate new constants for bin_uiui.
4240         * mini-gmp/mini-gmp.h (mpz_fac_ui, mpz_bin_uiui): New definitions.
4241         * mini-gmp/mini-gmp.c (mpz_fac_ui, mpz_bin_uiui): Trivial
4242         implementation.
4244         * tests/mpz/t-fac_ui.c: Check Wilson's theorem on a big value.
4246         * mpn/generic/invert.c: Remove support for scratch == NULL.
4247         * tune/speed.h (SPEED_ROUTINE_MPN_MUPI_DIV_QR): Allocate scratch
4248         space for mpn_invert.
4250         * mpz/mul_i.h: Small clean-up.
4252         * tests/mpn/toom-sqr-shared.h: New file.
4253         * tests/mpn/t-toom2-sqr.c: New file.
4254         * tests/mpn/t-toom3-sqr.c: New file.
4255         * tests/mpn/t-toom4-sqr.c: New file.
4256         * tests/mpn/t-toom6-sqr.c: New file.
4257         * tests/mpn/t-toom8-sqr.c: New file.
4258         * tests/mpn/Makefile.am (EXTRA_DIST): Add toom-sqr-shared.h .
4260         * mpn/generic/toom62_mul.c: Use add_n, sub_n, when possible.
4262 2012-04-12  Torbjorn Granlund  <tege@gmplib.org>
4264         * mpn/x86_64/fastsse/lshift-movdqu2.asm: New file.
4265         * mpn/x86_64/fastsse/rshift-movdqu2.asm: New file.
4266         * mpn/x86_64/fastsse/lshiftc-movdqu2.asm: New file.
4267         * mpn/x86_64/coreisbr/lshift.asm: New file.
4268         * mpn/x86_64/coreisbr/rshift.asm: New file.
4269         * mpn/x86_64/coreisbr/lshiftc.asm: New file.
4270         * mpn/x86_64/k10/lshift.asm: New file.
4271         * mpn/x86_64/k10/rshift.asm: New file.
4272         * mpn/x86_64/k10/lshiftc.asm: New file.
4274         * mpn/x86_64/fastsse/lshift.asm: Simplify to very basic form.
4276 2012-04-11  Niels Möller  <nisse@lysator.liu.se>
4278         * Makefile.am (check-mini-gmp): Pass -I../.. in EXTRA_CFLAGS, to
4279         locate gmp.h.
4281 2012-04-11 Marco Bodrato <bodrato@mail.dm.unipi.it>
4283         * mini-gmp/mini-gmp.h (mpz_root, mpz_rootrem): define (correctly).
4284         * mini-gmp/mini-gmp.c (mpz_rootrem): Extended code from _root.
4285         (mpz_root): Use mpz_rootrem.
4286         (mpz_mul_ui): Correctly handle negative operands.
4288         * mini-gmp/tests/Makefile (CHECK_PROGRAMS): add t-root.
4289         * mini-gmp/tests/t-root.c: New file.
4290         * mini-gmp/tests/t-reuse.c: Enable root{,rem} tests.
4292 2012-04-10 Marco Bodrato <bodrato@mail.dm.unipi.it>
4294         * gen-fac_ui.c (mpz_root): Remove.
4295         * mini-gmp/mini-gmp.c (mpz_root): New, support negative operands.
4296         * mini-gmp/mini-gmp.h (mpz_root): define.
4297         (mpz_out_str): Test also __STDIO_LOADED (for VMS).
4298         * mpz/2fac_ui.c: Cosmetic change.
4300 2012-04-07  Torbjorn Granlund  <tege@gmplib.org>
4302         * mpn/ia64/gcd_1.asm: Rewrite inner loop to use ctz table.
4304 2012-04-05  Torbjorn Granlund  <tege@gmplib.org>
4306         * mpn/powerpc64/p7/popcount.asm: Properly extend arg n for mode32.
4307         * mpn/powerpc64/p7/hamdist.asm: Likewise.
4309 2012-04-04  Torbjorn Granlund  <tege@gmplib.org>
4311         * mpn/powerpc64/p7/popcount.asm: New file.
4312         * mpn/powerpc64/p7/hamdist.asm: New file.
4314         * longlong.h (ARM count_leading_zeros): Enable for more arch versions.
4316         * mpn/x86_64/gcd_1.asm: Make room for DOS64 regparm shadow area.
4317         * mpn/x86_64/core2/gcd_1.asm: Likewise.
4319 2012-04-03  Torbjorn Granlund  <tege@gmplib.org>
4321         * mpn/x86_64/coreisbr/aorrlsh_n.asm: Make it actually work for DOS64.
4323 2012-04-02 Marco Bodrato <bodrato@mail.dm.unipi.it>
4325         * mpz/oddfac_1.c: Initialize size for ASSERT.
4327 2012-04-02  Torbjorn Granlund  <tege@gmplib.org>
4329         * gmp-h.in (_GMP_H_HAVE_FILE): Test also __STDIO_LOADED (for VMS).
4331         * gmp-impl.h (doprnt_format_t, etc): Remove bogus __GMP_DECLSPECs.
4333 2012-03-30 Marco Bodrato <bodrato@mail.dm.unipi.it>
4335         * mpn/x86_64/sqr_basecase.asm: Speed-up for small cases.
4337 2012-03-29  Torbjorn Granlund  <tege@gmplib.org>
4339         * mpn/sparc64/gcd_1.asm: New file.
4341 2012-03-27  Torbjorn Granlund  <tege@gmplib.org>
4343         * config.guess: Fix typo in coreisbr recognition.
4345 2012-03-26 Marco Bodrato <bodrato@mail.dm.unipi.it>
4347         * mpn/x86_64/gcd_1.asm: Reduce latency.
4348         * mpn/x86_64/mul_basecase.asm: Save one jump.
4350         * mpz/iset_ui.c: Don't realloc.
4352 2012-03-20 Marco Bodrato <bodrato@mail.dm.unipi.it>
4354         * mp_clz_tab.c: Add __clz_tab[128].
4355         * longlong.h (count_trailing_zeros): Use it in pure C variant.
4357 2012-03-20  Torbjorn Granlund  <tege@gmplib.org>
4359         * configure.in (x86 fat_path): Add many missing directories.
4360         * mpn/x86/fat/fat.c (__gmpn_cpuvec_init): Rewrite.
4361         (fake_cpuid_table): Add many more CPUs.
4363         * mpn/x86_64/fat/fat.c (__gmpn_cpuvec_init): Minor spacing cleanup.
4365 2012-03-19  Torbjorn Granlund  <tege@gmplib.org>
4367         * mpn/x86/x86-defs.m4 (CALL, PIC_WITH_EBX): New macros.
4368         * mpn/x86/darwin.m4: Likewise.
4369         * mpn/x86/k7/gcd_1.asm: Use new macros to support PIC.
4370         * mpn/x86/p6/gcd_1.asm: Likewise.
4372 2012-03-19 Marco Bodrato <bodrato@mail.dm.unipi.it>
4374         * gen-fac_ui.c: Generate more constants (possible mini-mpz_root).
4375         * mpz/oddfac_1.c: Improve ASSERTs.
4376         (log_n_max): Use precomputed table.
4378         * longlong.h (_PROTO): Remove.
4380 2012-03-18  Torbjorn Granlund  <tege@gmplib.org>
4382         * longlong.h (count_trailing_zeros): Write better pure C default
4383         variant.
4385         * mpn/x86/p6/gcd_1.asm: Remove forgotten x86_64 reference.
4387         * mpn/x86/p6/gmp-mparam.h: Update, to get BMOD_1_TO_MOD_1_THRESHOLD
4388         defined for fat binaries.
4390 2012-03-17  Torbjorn Granlund  <tege@gmplib.org>
4392         * mpn/x86/k7/gcd_1.asm: Rewrite.
4393         * mpn/x86/p6/gcd_1.asm: New file.
4395         * mpn/x86_64/core2/gcd_1.asm: Conditionally suppress reduction calls.
4396         * mpn/x86_64/gcd_1.asm: Rewrite.
4398 2012-03-15  Torbjorn Granlund  <tege@gmplib.org>
4400         * mpn/generic/gcd_1.c: Parameterise zerotab code.
4402         * mpn/x86_64/nano/gcd_1.asm: New file, grabbing core2 asm file.
4404         * mpn/x86_64/core2/gcd_1.asm: Speed up loop code, simplify non-loop
4405         code.
4407 2012-03-13  Torbjorn Granlund  <tege@gmplib.org>
4409         * mpn/x86_64/core2/gcd_1.asm: Add hack to support fat builds.
4411         * mpn/x86_64/core2/gcd_1.asm: Shorten critical path.
4413 2012-03-12  Torbjorn Granlund  <tege@gmplib.org>
4415         * mpn/x86_64/core2/gcd_1.asm: New file.
4416         * mpn/x86_64/k10/gcd_1.asm: New file, grabbing core2 asm file.
4417         * mpn/x86_64/bd1/gcd_1.asm: Likewise.
4419         * mpn/x86_64/bobcat/sqr_basecase.asm: New file.
4420         * mpn/x86_64/bobcat/mul_basecase.asm: Minor tuning.
4422 2012-03-10  Torbjorn Granlund  <tege@gmplib.org>
4424         * configure.in (fat_functions): Add addlsh1_n, addlsh2_n, addmul_2,
4425         mullo_basecase, redc_1, redc_2, sublsh1_n.
4427         * gmp-impl.h (struct cpuvec_t): Add fields for new fat functions.
4428         * gmp-impl.h: Adjust corresponding declarations.
4430         * mpn/generic/redc_2.c (mpn_addmul_2): Make static.
4432         * mpn/x86_64/fat/fat_entry.asm (FAT_INIT): Expand before fat_init to
4433         reduce branch offsets.  Pass plain 0,1,3... in %al since we'd else run
4434         out of 8-bit range.
4436         * mpn/x86_64/fat/fat_entry.asm (fat_init): Scale passed index value.
4437         * mpn/x86/fat/fat_entry.asm (fat_init): Use movzbl for expanding index
4438         value.
4440         * mpn/x86_64/x86_64-defs.m4 (CPUVEC_FUNCS_LIST): Add new fat functions.
4441         * mpn/x86/x86-defs.m4 (CPUVEC_FUNCS_LIST): Likewise.
4442         * mpn/x86_64/fat/fat.c (__gmpn_cpuvec): Likewise.
4443         * mpn/x86/fat/fat.c (__gmpn_cpuvec): Likewise.
4445         * mpn/x86_64/fat/redc_2.c: New file.
4446         * mpn/x86/fat/mullo_basecase.c: New file.
4447         * mpn/x86/fat/redc_1.c: New file.
4448         * mpn/x86/fat/redc_2.c: New file.
4450         * tests/mpn/t-fat.c: Test mullo_basecase.
4452 2012-03-08  Torbjorn Granlund  <tege@gmplib.org>
4454         * mpn/x86_64/coreisbr/addmul_2.asm: Port to DOS64.
4456 2012-02-29  Marc Glisse  <marc.glisse@inria.fr>
4458         * gmpxx.h: Ignore partial C++11 support in g++-4.6.
4459         * tests/cxx/t-cxx11.cc: Likewise.
4461         * gmpxx.h (operator""): New functions.
4462         * tests/cxx/t-cxx11.cc: Test the above.
4463         * doc/gmp.texi: Document the above.
4465 2012-03-08 Marco Bodrato <bodrato@mail.dm.unipi.it>
4467         * acinclude.m4 (GMP_H_ANSI): Remove.
4468         * configure.in: Don't use GMP_H_ANSI.
4469         * gmp-h.in (__GMP_HAVE_PROTOTYPES): Remove.
4471 2012-03-08  Torbjorn Granlund  <tege@gmplib.org>
4473         * mpn/x86_64/fat/fat.c (fake_cpuid_table): Recognise "bulldozer".
4474         (__gmpn_cpuvec_init): Overhaul to match configure.in.
4476         * configure.in: Adjust bulldozer path_64.
4478 2012-03-07  Torbjorn Granlund  <tege@gmplib.org>
4480         * configure.in (x86_64 fat_path): List recently added AMD directories.
4482         * mpn/x86_64/bobcat/copyi.asm: New file.
4483         * mpn/x86_64/bobcat/copyd.asm: New file.
4485         * config.guess: Handle AMD 11h correctly.
4487         * tune/tuneup.c (tune_redc): Better handle situation where redc_2 is
4488         never faster.
4490 2012-03-06  Torbjorn Granlund  <tege@gmplib.org>
4492         * mpn/x86_64/bobcat/mul_basecase.asm: New file.
4494 2012-03-04  Torbjorn Granlund  <tege@gmplib.org>
4496         * mpn/x86_64/bobcat/mul_1.asm: New file.
4497         * mpn/x86_64/bobcat/aorsmul_1.asm: New file.
4499 2012-03-04 Marco Bodrato <bodrato@mail.dm.unipi.it>
4501         * mpz/invert.c: Remove mod 0 branch.
4502         * tests/mpz/t-invert.c: Avoid testing mod 0.
4503         * doc/gmp.texi (mpz_invert): Specify mod 0 is not handled.
4505         * gmp-h.in (__gmp_signed, __gmp_const): Remove.
4506         (__GMP_HAVE_TOKEN_PASTE, __GMP_HAVE_CONST): Remove.
4507         * gmp-impl.h: Strip __GMP_HAVE_TOKEN_PASTE and __GMP_HAVE_CONST.
4508         * demos/expr/: Strip __gmp_const usage from all files.
4510         * tests/mpz/t-powm.c (allsizes_seen): Require unsigned*.
4512 2012-03-03  Torbjorn Granlund  <tege@gmplib.org>
4514         * mpn/x86_64/k8/gmp-mparam.h: New file.
4515         * mpn/x86_64/k10/gmp-mparam.h: New file.
4517         * mpn/generic/hgcd_step.c (mpn_hgcd_step): Remove unused variables.
4518         * mpn/generic/hgcd_jacobi.c (hgcd_jacobi_step): Likewise.
4519         * mpn/generic/hgcd_reduce.c (hgcd_matrix_apply): Likewise.
4520         * mpn/generic/mu_bdiv_qr.c: Likewise.
4521         * mpz/jacobi.c: Likewise.
4522         * mpz/mod.c: Likewise.
4524         * mpn/generic/toom42_mul.c: Remove unread variable.
4525         * mpn/generic/set_str.c (mpn_set_str_compute_powtab): Likewise.
4526         * mpn/generic/rootrem.c (mpn_rootrem_internal): Likewise.
4527         * tests/refmpn.c (refmpn_mul): Likewise.
4528         * mpn/generic/hgcd_appr.c (mpn_hgcd_appr): Propagate mask computation
4529         into ASSERT, remove variable.
4531         * gmp-h.in (__GMP_PROTO): Remove.
4532         * Strip __GMP_PROTO usage from all files.
4533         * Strip prototype parameter names from all files.
4535 2012-03-01 Marco Bodrato <bodrato@mail.dm.unipi.it>
4537         * doc/gmp.texi (mpz_invert): Correctly document result range.
4538         * tests/mpz/t-invert.c: Small range correction.
4540 2012-03-01  Torbjorn Granlund  <tege@gmplib.org>
4542         * mpn/x86_64/mullo_basecase.asm: New file.
4544 2012-02-29  Marc Glisse  <marc.glisse@inria.fr>
4546         * gmpxx.h (std::numeric_limits): New partial specialization.
4548 2012-02-29  Niels Möller  <nisse@lysator.liu.se>
4550         * mini-gmp/tests/t-reuse.c: New test case, based on
4551         tests/mpz/reuse.c.
4553         * mini-gmp/mini-gmp.c (mpz_cdiv_r_ui): New function.
4554         (mpz_fdiv_r_ui): New function.
4555         (mpz_tdiv_r_ui): New function.
4556         (mpz_powm_ui): New function.
4557         (mpz_pow_ui): New function.
4558         (mpz_ui_pow_ui): Use mpz_pow_ui.
4559         (mpz_gcdext): Fixed input/output overlap, for the case of one
4560         input being zero.
4561         (mpz_sqrtrem): Fix for the case r NULL, U zero.
4563         * Makefile.am (check-mini-gmp): Use $(MAKE).
4564         (clean-mini-gmp): New target.
4565         (clean-local, distclean-local): New automake targets. Depend on
4566         clean-mini-gmp.
4568 2012-02-28  Niels Möller  <nisse@lysator.liu.se>
4570         * Makefile.am (check-mini-gmp): New target, for running the
4571         mini-gmp testsuite.
4573         * mini-gmp/tests/Makefile (srcdir, MINI_GMP_DIR): New make
4574         variables. These can be overridden when using a separate build
4575         directory.
4576         (EXTRA_CFLAGS): Renamed, was OPTFLAGS.
4578         * mini-gmp/mini-gmp.c (mpz_abs_add): Don't cache limb pointers
4579         over MPZ_REALLOC, since that breaks in-place operation. Bug
4580         spotted by Torbjörn.
4581         (mpz_and, mpz_ior, mpz_xor): Likewise.
4582         (mpz_cmp): Fixed comparison of negative numbers.
4584 2012-02-27  Torbjorn Granlund  <tege@gmplib.org>
4586         * mpn/x86_64/fastsse/lshiftc.asm: New file.
4587         * mpn/x86_64/fastsse/com.asm: New file.
4589         * mpn/x86_64/bd1/popcount.asm: New file.
4590         * mpn/x86_64/bd1/hamdist.asm: New file.
4592         * mpn/x86_64/fastsse/copyi.asm: New file.
4593         * mpn/x86_64/fastsse/copyd.asm: New file.
4594         * mpn/x86_64/fastsse/lshift.asm: New file.
4596 2012-02-26  Torbjorn Granlund  <tege@gmplib.org>
4598         * mpn/x86_64/coreisbr/addmul_2.asm: New file.
4600         * tests/devel/try.c (param_init): Don't require addmul_N to handle
4601         overlap.
4603         * mpn/x86_64/bd1/mul_1.asm: New file.
4604         * mpn/x86_64/bd1/aorsmul_1.asm: New file.
4606 2012-02-26 Marco Bodrato <bodrato@mail.dm.unipi.it>
4608         * mpz/2fac_ui.c: New file: implements n!!.
4609         * Makefile.am (MPZ_OBJECTS): Add mpz/2fac_ui.
4610         * gmp-h.in: Declare mpz_2fac_ui.
4611         * tests/mpz/t-fac.c: Test mpz_2fac_ui.
4612         * doc/gmp.texi: Document mpz_2fac_ui.
4613         * mpz/Makefile.am (libmpz_la_SOURCES): Add 2fac_ui.c.
4615         * mpz/oddfac_1.c (mpz_oddfac_1): Use umul_ppmm when size = 2.
4617 2012-02-26  Niels Möller  <nisse@lysator.liu.se>
4619         * mini-gmp: New subdirectory. For use by GMP bootstrap, and as a
4620         fallback for applications needing bignums but not high
4621         performance.
4623         * bootstrap.c: New file, replacing dumbmp.c. Uses mini-gmp for the
4624         standard GMP functions, and then defines the few functions
4625         particular for the bootstrap.
4626         * dumbmp.c: Deleted file. A few functions moved to bootstrap.c.
4628         * gen-bases.c: Include bootstrap.c, not dumbmp.c.
4629         * gen-fac_ui.c: Likewise.
4630         * gen-trialdivtab.c: Likewise.
4631         * gen-fib.c: Include bootstrap.c, not dumbmp.c. Use assert rather
4632         than ASSERT. Deleted casts of xmalloc return value.
4633         * gen-psqr.c: Likewise.
4634         (COLLAPSE_ELEMENT): Use memmove rather than mem_copyi.
4636         * Makefile.am: Replaced all uses of dumbmp.c by bootstrap.c.
4637         (EXTRA_DIST, dist-hook): Arrange for distribution of the mini-gmp
4638         files.
4640 2012-02-24 Marco Bodrato <bodrato@mail.dm.unipi.it>
4642         * mpz/invert.c: Use ABSIZ, MPZ_EQUAL_1_P.
4643         * mpz/abs.c: Collapse MPZ_REALLOC(x,.) and PTR(x).
4644         * mpz/aors_ui.h: Likewise.
4645         * mpz/com.c: Likewise.
4646         * mpz/neg.c: Likewise.
4648         * mpz/invert.c: Reply "no-inverse" when modulus is zero.
4649         * tests/mpz/t-invert.c: Add more checks.
4650         * doc/gmp.texi (mpz_invert): Inverse can not be zero.
4652 2012-02-24  Torbjorn Granlund  <tege@gmplib.org>
4654         * tests/mpn/logic.c: New file.
4655         * tests/mpn/Makefile.am (check_PROGRAMS): Add logic.
4657         * tests/mpz/t-invert.c: New file.
4658         * tests/mpz/Makefile.am (check_PROGRAMS): Add t-invert.
4660 2012-02-24  Marc Glisse  <marc.glisse@inria.fr>
4662         * tests/mpq/t-cmp.c: Move NUM and DEN macros...
4663         * tests/mpq/t-cmp_ui.c: Likewise...
4664         * gmp-impl.h: ... to here.
4666         * mpq/abs.c: Use NUM, DEN, SIZ, ALLOC, PTR, MPZ_REALLOC.
4667         * mpq/aors.c: Likewise.
4668         * mpq/canonicalize.c: Likewise.
4669         * mpq/clear.c: Likewise.
4670         * mpq/cmp.c: Likewise.
4671         * mpq/cmp_si.c: Likewise.
4672         * mpq/cmp_ui.c: Likewise.
4673         * mpq/div.c: Likewise.
4674         * mpq/equal.c: Likewise.
4675         * mpq/get_d.c: Likewise.
4676         * mpq/get_den.c: Likewise.
4677         * mpq/get_num.c: Likewise.
4678         * mpq/get_str.c: Likewise.
4679         * mpq/init.c: Likewise.
4680         * mpq/inp_str.c: Likewise.
4681         * mpq/inv.c: Likewise.
4682         * mpq/md_2exp.c: Likewise.
4683         * mpq/mul.c: Likewise.
4684         * mpq/neg.c: Likewise.
4685         * mpq/set.c: Likewise.
4686         * mpq/set_d.c: Likewise.
4687         * mpq/set_den.c: Likewise.
4688         * mpq/set_f.c: Likewise.
4689         * mpq/set_num.c: Likewise.
4690         * mpq/set_si.c: Likewise.
4691         * mpq/set_str.c: Likewise.
4692         * mpq/set_ui.c: Likewise.
4693         * mpq/set_z.c: Likewise.
4694         * mpq/swap.c: Likewise.
4696         * tests/mpq/t-inv.c: New test file.
4697         * tests/mpq/Makefile.am: Add the above.
4699         * gmpxx.h (__gmp_set_expr): Use mpq_set_z.
4701         * mpq/md_2exp.c: Collapse MPZ_REALLOC(x,.) and PTR(x).
4702         * mpq/set_d.c: Likewise.
4703         * mpq/set_f.c: Likewise.
4705 2012-02-24  Niels Möller  <nisse@lysator.liu.se>
4707         * mpn/x86_64/core2/aorsmul_1.asm: Added mpn_addmul_1c and
4708         mpn_submul_1c entry points.
4710 2012-02-23  Marc Glisse  <marc.glisse@inria.fr>
4712         * mpz/abs.c: Use ALLOC, SIZ, ABSIZ, PTR, MPZ_REALLOC.
4713         * mpz/aors_ui.h: Likewise.
4714         * mpz/array_init.c: Likewise.
4715         * mpz/cdiv_q.c: Likewise.
4716         * mpz/cdiv_qr.c: Likewise.
4717         * mpz/cdiv_r.c: Likewise.
4718         * mpz/clear.c: Likewise.
4719         * mpz/clrbit.c: Likewise.
4720         * mpz/cmp_si.c: Likewise.
4721         * mpz/com.c: Likewise.
4722         * mpz/fdiv_q.c: Likewise.
4723         * mpz/fdiv_qr.c: Likewise.
4724         * mpz/fdiv_r.c: Likewise.
4725         * mpz/get_si.c: Likewise.
4726         * mpz/get_str.c: Likewise.
4727         * mpz/init.c: Likewise.
4728         * mpz/inp_str.c: Likewise.
4729         * mpz/iset.c: Likewise.
4730         * mpz/iset_d.c: Likewise.
4731         * mpz/iset_si.c: Likewise.
4732         * mpz/iset_str.c: Likewise.
4733         * mpz/iset_ui.c: Likewise.
4734         * mpz/mod.c: Likewise.
4735         * mpz/neg.c: Likewise.
4736         * mpz/out_str.c: Likewise.
4737         * mpz/random2.c: Likewise.
4738         * mpz/set_si.c: Likewise.
4739         * mpz/set_str.c: Likewise.
4740         * mpz/set_ui.c: Likewise.
4741         * mpz/setbit.c: Likewise.
4742         * mpz/sqrt.c: Likewise.
4743         * mpz/swap.c: Likewise.
4744         * mpz/tdiv_r_2exp.c: Likewise.
4746         * tests/cxx/t-ops.cc: Test mpz_abs reallocation.
4748 2012-02-23  Torbjorn Granlund  <tege@gmplib.org>
4750         * mpn/x86_64/core2/rsh1aors_n.asm: Complete rewrite.
4751         * mpn/x86_64/coreisbr/rsh1aors_n.asm: Move old core2 code here.
4753         * mpn/x86_64/redc_1.asm: Make it work for DOS64 (broken in last edit).
4755 2012-02-20 Marco Bodrato <bodrato@mail.dm.unipi.it>
4757         * mpn/generic/toom_interpolate_8pts.c: Compute carry iif non-trivial.
4759         * mpz/gcdext.c: Adapt to relaxed mpn_gcdext's input requirements.
4761         * mpz/and.c: Use mpn_ logic everywhere. Reduce branches.
4762         * mpz/ior.c: Likewise.
4763         * mpz/xor.c: Likewise.
4765 2012-02-20  Torbjorn Granlund  <tege@gmplib.org>
4767         * mpn/x86_64/coreisbr/mul_1.asm: New file.
4769         * mpn/x86_64/coreisbr/aorsmul_1.asm: New file.
4771         * mpn/x86_64/mod_34lsub1.asm: Avoid ",pt" branch hint since many
4772         assemblers don't support it.
4774 2012-02-19  Torbjorn Granlund  <tege@gmplib.org>
4776         * mpn/generic/redc_1.c: Put back mpn_add_n call, return its carry.
4777         Reintroduce previously removed RP argument.
4778         * mpn/x86_64/redc_1.asm: Likewise.
4780         * mpn/generic/redc_2.c:  Remove mpn_sub_n call, return carry from
4781         mpn_add_n call.
4783         * gmp-impl.h (mpn_redc_1, mpn_redc_2): Now return an mp_limb_t.
4785         * tune/speed.h (SPEED_ROUTINE_REDC_1): Adopt to pass RP argument.
4787         * tests/refmpn.c (refmpn_redc_1): Adopt to new redc_1 interface.
4789         * mpn/generic/powm.c (MPN_REDC_1): Pass rp parameter to mpn_redc_1.
4790         * mpn/generic/powm_sec.c (MPN_REDC_1_SEC): Likewise.
4791         * mpn/generic/powm.c (MPN_REDC_2): New macro, use for mpn_redc_2.
4793 2012-02-18  Marc Glisse  <marc.glisse@inria.fr>
4795         * gmpxx.h (std::common_type): New partial specialization in C++11.
4796         * tests/cxx/t-cxx11.cc: Test it.
4798         * gmpxx.h: Don't declare long double functions that are never defined.
4800         * gmpxx.h (__gmp_binary_expr): Let things happen in place: q=q*q+z*z
4801         becomes tmp=z*z, q=q*q, q+=tmp.
4802         * tests/cxx/t-binary.cc: More variable reuse tests.
4804 2012-02-17  Marc Glisse  <marc.glisse@inria.fr>
4806         * gmp-h.in (__GMP_WITHIN_GMP): Test with #ifdef instead of #if, for
4807         the benefit of applications using gcc -Wundef.
4808         (__GMP_WITHIN_GMPXX): Likewise.
4810 2012-02-16  Marc Glisse  <marc.glisse@inria.fr>
4812         * gmpxx.h (__gmp_binary_expr): Let things happen in place: e=a*b-c*d
4813         becomes tmp=c*d, e=a*b, e-=tmp.
4814         * tests/cxx/t-binary.cc: More variable reuse tests.
4816 2012-02-15  Niels Möller  <nisse@lysator.liu.se>
4818         * tune/tuneup.c (mul_toom43_to_toom54_threshold): New global.
4819         (tune_mul): Added tuning of MUL_TOOM43_TO_TOOM54_THRESHOLD.
4820         * tune/speed.h (SPEED_ROUTINE_MPN_TOOM43_FOR_TOOM54_MUL): New macro.
4821         (SPEED_ROUTINE_MPN_TOOM54_FOR_TOOM43_MUL): New macro.
4822         Prototypes for corresponding functions.
4823         * tune/common.c (speed_mpn_toom43_for_toom54_mul): New function.
4824         (speed_mpn_toom54_for_toom43_mul): New function.
4826         * gmp-impl.h (MPN_TOOM43_MUL_MINSIZE): Corrected constant.
4827         (MPN_TOOM53_MUL_MINSIZE): Likewise.
4828         (MPN_TOOM54_MUL_MINSIZE): New constant.
4829         (mpn_toom54_mul): Added prototype.
4830         (MUL_TOOM43_TO_TOOM54_THRESHOLD): New threshold. Default value and
4831         tuning setup.
4833 2012-02-14  Niels Möller  <nisse@lysator.liu.se>
4835         * mpn/generic/toom54_mul.c: New file, originally contributed by
4836         Marco.
4837         * gmp-impl.h (mpn_toom54_mul_itch): New function.
4838         * configure.in (gmp_mpn_functions): Added toom54_mul.
4839         * tests/mpn/t-toom54.c: New file.
4840         * tests/mpn/Makefile.am (check_PROGRAMS): Added t-toom54.
4842 2012-02-13  Niels Möller  <nisse@lysator.liu.se>
4844         * configure.in: Display summary of options.
4846 2012-02-11  Torbjorn Granlund  <tege@gmplib.org>
4848         * tests/tests.h (TESTS_REPS): Print any non-standard repetitions.
4850 2012-02-11 Marco Bodrato <bodrato@mail.dm.unipi.it>
4852         * doc/gmp.texi (Factorial): Shortly describe current algorithm.
4853         (Multiplication Algorithms): Add Toom[68]'n'half, (too) shortly.
4854         * gmp-impl.h (ASSERT_ALWAYS): Consider failures UNLIKELY.
4856 2012-02-10  Niels Möller  <nisse@lysator.liu.se>
4858         * tests/mpz/t-gcd.c (gcdext_valid_p): Enforce slightly stricter
4859         bound for cofactors.
4861         * mpn/generic/gcdext_lehmer.c (mpn_gcdext_hook): Corrected
4862         handling of unlikely (maybe impossible?) case u1n < un. Related to
4863         the 2012-02-05 bugfix of gcdext_subdiv_step.c in the gmp-5.0 repo.
4865 2012-02-09 Marco Bodrato <bodrato@mail.dm.unipi.it>
4867         * gmp-impl.h (mpn_toom3*_itch): Support any recursion depth.
4868         * tests/refmpn.c (refmpn_mul): Restore tight allocations.
4870         * mpz/oddfac_1.c (mpz_oddfac_1): Get ready for n!!
4871         * gmp-impl.h (mpz_oddfac_1): Update signature.
4872         * mpz/fac_ui.c (mpz_fac_ui): Update call to mpz_oddfac_1.
4874 2012-02-09  Marc Glisse  <marc.glisse@inria.fr>
4876         * gmp-impl.h (ABS_CAST): New macro.
4877         * mpf/cmp_si.c: Use ABS_CAST.
4878         * mpf/get_si.c: Use ABS_CAST.
4879         * mpf/iset_si.c: Use ABS_CAST.
4880         * mpf/set_si.c: Use ABS_CAST.
4881         * mpq/set_si.c: Use ABS_CAST.
4882         * mpz/cmp_si.c: Use ABS_CAST.
4883         * mpz/get_si.c: Use ABS_CAST.
4884         * mpz/iset_si.c: Use ABS_CAST.
4885         * mpz/mul_i.h: Use ABS_CAST.
4886         * mpz/set_si.c: Use ABS_CAST.
4888 2012-02-08  Torbjorn Granlund  <tege@gmplib.org>
4890         * mpn/powerpc32/divrem_2.asm: Fix off-by-one condition in invert_limb
4891         code.
4893 2012-02-08  Niels Möller  <nisse@lysator.liu.se>
4895         * doc/gmp.texi (mpz_gcdext): Clarified corner cases in cofactor
4896         canonicalization.
4898 2012-02-07  Niels Möller  <nisse@lysator.liu.se>
4900         * mpn/generic/gcdext.c (mpn_gcdext): Fixed assert, related to the
4901         special case A = (2k+1) G, B = 2 G. Fix copied from gmp-5.0 repo.
4903 2012-02-06  Niels Möller  <nisse@lysator.liu.se>
4905         * mpn/generic/hgcd_matrix.c (hgcd_matrix_update_q): Fixed carry
4906         handling bug. Fix copied from gmp-5.0 repo, where the function is
4907         found in hgcd.c.
4909         * tests/mpz/t-gcd.c (main): Use mpz_rrandomb for test operands,
4910         not mpz_urandomb. Change copied from gmp-5.0 repo.
4911         * tests/mpn/t-hgcd.c (main): Likewise.
4913 2012-02-04 Marco Bodrato <bodrato@mail.dm.unipi.it>
4915         * tests/refmpn.c (refmpn_mul): More conservative allocations.
4917 2012-02-03  Torbjorn Granlund  <tege@gmplib.org>
4919         * mpn/x86_64/bd1/gmp-mparam.h: New file.
4921         * longlong.h (udiv_qrnnd from sdiv_qrnnd): Declare udiv_w_sdiv.
4923         * mpn/generic/udiv_w_sdiv.c: Use c89 function header.
4925 2012-02-03 Marco Bodrato <bodrato@mail.dm.unipi.it>
4927         * mpz/fac_ui.c: mpz_oddfac_1 removed, with many related functions.
4928         * mpz/oddfac_1.c: New file, mpz_oddfac_1 implementation.
4929         * gmp-impl.h: mpz_oddfac_1 declaration.
4930         * Makefile.am (MPZ_OBJECTS): add mpz/oddfac_1$U.lo .
4931         * mpz/Makefile.am (libmpz_la_SOURCES): add oddfac_1.c .
4932         * tune/Makefile.am (fac_ui.c): include mpz/oddfac_1.c .
4934 2012-02-02 Marco Bodrato <bodrato@mail.dm.unipi.it>
4936         * mpn/generic/toom_interpolate_16pts.c: Correct an unlikely 32-bit bug.
4938 2012-02-02  Torbjorn Granlund  <tege@gmplib.org>
4940         * mpn/generic/toom63_mul.c: Allow s+t==n by adjusting an ASSERT.
4941         * mpn/generic/toom_interpolate_8pts.c: Perform final incr iff s+t!=n.
4943         * tests/mpn/t-toom6h.c (MIN_BN): Make more consistent with ASSERT in
4944         tested function.
4946 2012-02-01  Torbjorn Granlund  <tege@gmplib.org>
4948         * tests/mpn/t-mul.c: New file.
4949         * tests/mpn/Makefile.am: Compile it.
4951 2012-02-01  Marc Glisse  <marc.glisse@inria.fr>
4953         * gmpxx.h: Remove check for g++ older than 2.91.
4955 2012-02-01  Niels Möller  <nisse@lysator.liu.se>
4957         * mpn/generic/mul.c: Added diagram on where toom functions can be
4958         called.
4960 2012-02-01  Marc Glisse  <marc.glisse@inria.fr>
4962         * gmpxx.h (__gmp_unary_expr): Make the constructor explicit.
4963         (__gmp_expr(__gmp_expr&&)): New move constructors.
4964         (__gmp_expr::operator=(__gmp_expr&&)): New move assignments.
4965         (swap): Mark as noexcept.
4966         (__GMPXX_USE_CXX11): New macro.
4967         (__GMPXX_NOEXCEPT): New macro.
4968         * tests/cxx/t-cxx11.cc: New file.
4969         * tests/cxx/Makefile.am: Added t-cxx11.
4971 2012-01-31  Torbjorn Granlund  <tege@gmplib.org>
4973         * mpn/generic/powm_sec.c (SQR_BASECASE_LIM): New name for
4974         SQR_BASECASE_MAX.
4975         (SQR_BASECASE_LIM, fat variant): Define to read __gmpn_cpuvec.
4976         (SQR_BASECASE_LIM, native variant): Define to SQR_TOOM2_THRESHOLD
4977         straight, without arithmetic.
4978         (mpn_local_sqr): Use BELOW_THRESHOLD as per Marco's suggestion.
4980 2012-01-30  Torbjorn Granlund  <tege@gmplib.org>
4982         * tests/mpz/t-powm.c: Ensure all sizes are seen.
4984 2012-01-30  Marc Glisse  <marc.glisse@inria.fr>
4986         * gmpxx.h (__gmp_binary_expr): Let things happen in place: d=a+b+c
4987         when d != c.
4988         * tests/cxx/t-binary.cc: Test variable reuse: c=a+b+c.
4990 2012-01-28  Marc Glisse  <marc.glisse@inria.fr>
4992         * gmpxx.h: Don't compute -LONG_MIN.
4994         * doc/gmp.texi (gmp_randclass::get_z_bits): Use mp_bitcnt_t.
4995         * gmpxx.h: Replace unsigned long with mp_bitcnt_t.
4997 2012-01-27  Torbjorn Granlund  <tege@gmplib.org>
4999         * Upgrade to libtool 2.4.2.
5001 2012-01-26 Marco Bodrato <bodrato@mail.dm.unipi.it>
5003         * tests/mpz/t-fac_ui.c: Increase default test cases.
5005         * mpz/prodlimbs.c: New file, mpz_prodlimbs implementation.
5006         * gmp-impl.h: mpz_prodlimbs declaration.
5007         * Makefile.am (MPZ_OBJECTS): add mpz/prodlimbs$U.lo .
5008         * mpz/Makefile.am (libmpz_la_SOURCES): add prodlimbs.c .
5009         (fac_ui.h): remove target (moved up one directory).
5010         * mpz/fac_ui.c: mpz_prodlimbs removed, micro-optimisations.
5012 2012-01-25  Torbjorn Granlund  <tege@gmplib.org>
5014         * tune/tuneup.c: Remove unused tuneup variables.
5016 2012-01-20 Marco Bodrato <bodrato@mail.dm.unipi.it>
5018         * mpz/fac_ui.c: Reduce branches in basecases.
5020 2012-01-18  Marc Glisse  <marc.glisse@inria.fr>
5022         * doc/gmp.texi (mpf_class::mpf_class): Use mp_bitcnt_t.
5024 2012-01-17  Torbjorn Granlund  <tege@gmplib.org>
5026         * configure.in: Add ultrasparc T4 support.
5028         * demos/isprime.c (main): Run 25 millerrabin tests.
5030 2012-01-16 Marco Bodrato <bodrato@mail.dm.unipi.it>
5032         * mpz/fac_ui.c (SIEVE_SEED): Define value for small limb size.
5033         (mpz_oddswing_1): Reduce the number of divisions.
5034         (mpz_oddfac_1): Reduce memory usage.
5035         * mpn/minithres/gmp-mparam.h: Correct minimum for FAC_DSC_.
5036         * tune/tuneup.c (tune_fac_ui): Likewise.
5038 2012-01-15  Niels Möller  <nisse@lysator.liu.se>
5040         * mpz/scan0.c (mpz_scan0): Use ~(mp_bitcnt_t) 0, rather than
5041         ULONG_MAX, when returning "infinity".
5042         * mpz/scan1.c (mpz_scan1): Likewise.
5044 2012-01-12  Torbjorn Granlund  <tege@gmplib.org>
5046         * tests/t-popc.c: Test longer bit strings.
5048 2012-01-12 Marco Bodrato <bodrato@mail.dm.unipi.it>
5050         * mpz/divexact.c: Tight realloc, delayed if variables are reused.
5051         * mpz/lcm.c: Smaller temp space, avoid goto.
5052         * gmp-impl.h (popc_limb): avoid double & (for 8-bits limb).
5054 2012-01-10 Marco Bodrato <bodrato@mail.dm.unipi.it>
5056         * mpn/minithres/gmp-mparam.h: New FAC_ODD_ and FAC_DSC_ thresholds.
5057         * tune/tuneup.c (tune_fac_ui): Correct minimum for FAC_DSC_.
5059 2012-01-07  Torbjorn Granlund  <tege@gmplib.org>
5061         * mpz/mul_2exp.c: Rewrite.
5062         * mpz/tdiv_q_2exp.c: Rewrite.
5064 2012-01-05 Marco Bodrato <bodrato@mail.dm.unipi.it>
5066         * gen-fac_ui.c: Remove currently unused constants; add new odd
5067         double factorial table.
5068         * mpz/fac_ui.c (RECURSIVE_PROD_THRESHOLD): Increase default.
5069         (mpz_oddfac_1): New function: a merge of _bc_odd and _dsc_odd.
5070         (mpz_prodlimbs): More in-place computations.
5072         * tune/tuneup.c (tune_fac_ui): min_is_always for FAC_ODD_.
5074 2012-01-02 Marco Bodrato <bodrato@mail.dm.unipi.it>
5076         * tune/tuneup.c (tune_fac_ui): Compute FAC_DSC before FAC_ODD.
5078 2011-12-31  Torbjorn Granlund  <tege@gmplib.org>
5080         * Makefile.am (fac_ui.h): Put file in top-level dir, not in mpz.
5082 2011-12-31 Marco Bodrato <bodrato@mail.dm.unipi.it>
5084         * tune/Makefile.am (fac_ui.c): New target.
5085         (nodist_tuneup_SOURCES,CLEANFILES): Add fac_ui.c.
5086         * tune/tuneup.c (mpz_fac_ui_tune): Declare prototype.
5087         (fac_odd_threshold,fac_dsc_threshold): New global variables.
5088         (speed_mpz_fac_ui_tune,tune_fac_ui): New functions.
5089         (all): Call tune_fac_ui.
5090         * gmp-impl.h (FAC_ODD_THRESHOLD,FAC_DSC_THRESHOLD):
5091         New thresholds: default values, and setup for tuning.
5092         (FAC_DSC_THRESHOLD_LIMIT): Define (when tuning).
5093         * mpz/fac_ui.c (FAC_ODD_THRESHOLD,FAC_DSC_THRESHOLD):
5094         Default values removed.
5096 2011-12-30  Torbjorn Granlund  <tege@gmplib.org>
5098         * mpz/hamdist.c: Fix typo in a return statement.
5100         * mpn/generic/powm_sec.c (SQR_BASECASE_MAX): Set safely from
5101         SQR_TOOM2_THRESHOLD.
5103 2011-12-17  Torbjorn Granlund  <tege@gmplib.org>
5105         * tests/mpz/t-perfpow.c: Decrease default # of tests.
5107 2011-12-16  Torbjorn Granlund  <tege@gmplib.org>
5109         * tests/refmpn.c (AORS_1): Fix typo in variable type.
5111 2011-12-10  Torbjorn Granlund  <tege@gmplib.org>
5113         * mpn/generic/sbpi1_bdiv_q.c: Delay quotient limb stores in order to
5114         allow quotient and dividend to completely overlap.
5115         * mpn/generic/sbpi1_bdiv_qr.c: Likewise.
5117 2011-12-10 Marco Bodrato <bodrato@mail.dm.unipi.it>
5119         * mpz/fac_ui.c: fac_bc_ui inlined in fac_ui.
5121 2011-12-08  Torbjorn Granlund  <tege@gmplib.org>
5123         * mpn/generic/powm_sec.c: Handle fat binaries better.
5125         * mpz/fac_ui.c (mpz_bc_fac_1): Fix typo in allocation size.
5127         * mpn/x86/fat/com.c: New file.
5129         * mpn/x86_64/pentium4/aors_n.asm: Make it actually work for DOS64.
5130         * mpn/x86_64/pentium4/rsh1aors_n.asm: Conditionalise jump on DOS64
5131         to avoid overhead for standard ABIs.
5133         * mpn/x86_64/gcd_1.asm: Support DOS64.
5135 2011-12-07  Torbjorn Granlund  <tege@gmplib.org>
5137         * configure.in: Fix typo making HAVE_NATIVE_mpn_X fail for fat
5138         functions.
5140         * mpn/x86_64/fat/fat.c (__gmpn_cpuvec_init): Add a missing break.
5142 2011-12-07 Marco Bodrato <bodrato@mail.dm.unipi.it>
5144         * gen-fac_ui.c: Generate two more tables: odd factorial, swing.
5146         * mpz/fac_ui.c: Rewrite.
5148 2011-12-06  Niels Möller  <nisse@lysator.liu.se>
5150         * mpn/generic/hgcd.c (mpn_hgcd): Use hgcd_reduce for first
5151         recursive call.
5153 2011-12-06  Torbjorn Granlund  <tege@gmplib.org>
5155         * tune/mod_1_1-1.c: Redefine the mpn_ functions, not __gmpn_ (for the
5156         benefit of fat builds).
5157         * tune/mod_1_1-2.c: Likewise.
5159 2011-12-05  Torbjorn Granlund  <tege@gmplib.org>
5161         * mpn/x86/fat/lshiftc.c: New file.
5162         * mpn/x86/fat/mod_1_1.c: New file.
5163         * mpn/x86/fat/mod_1_2.c: New file.
5164         * mpn/x86/fat/mod_1_4.c: New file.
5166         * mpn/x86/fat/diveby3.c: Remove no longer fat function.
5167         * mpn/x86_64/fat/diveby3.c: Likewise.
5169         * mpn/x86_64/fat/gcd_1.c: Remove since always provided as asm.
5170         * mpn/x86_64/fat/mode1o.c: Likewise.
5172         * configure.in (fat_functions): Update to more relevant function set.
5173         Add special handling for mod_1_N_cps functions.
5174         * gmp-impl.h (struct cpuvec_t) : Corresponding changes.  Also add
5175         vrious declarations for new functions.
5176         * mpn/x86/x86-defs.m4 (CPUVEC_FUNCS_LIST): Corresponding changes.
5177         * mpn/x86_64/x86_64-defs.m4 (CPUVEC_FUNCS_LIST): Corresponding changes.
5178         * mpn/x86/fat/fat.c (__gmpn_cpuvec): Corresponding changes.
5179         * mpn/x86_64/fat/fat.c (__gmpn_cpuvec): Corresponding changes.
5181         * mpn/x86_64: Port most remaining x86_64 files to DOS64.
5183         * mpn/x86_64/coreisbr/aors_n.asm: Add forgotten DOS64_EXIT.
5185         * mpn/x86_64/x86_64-defs.m4 (LEA): Handle non-PIC code.
5186         * mpn/x86_64/darwin.m4 (LEA): Likewise.
5188 2011-12-04  Torbjorn Granlund  <tege@gmplib.org>
5190         * mpn/x86_64/fat/fat.c (MAKE_FMS): Rewrite to handle modern CPUs.
5191         * mpn/x86/fat/fat.c (MAKE_FMS): Likewise.
5193         * mpn/x86_64/darwin.m4 (PROTECT): Define to potentially useful value.
5195 2011-12-02  Torbjorn Granlund  <tege@gmplib.org>
5197         * mpn/x86_64/invert_limb_table.asm: Use PROTECT.
5198         * mpn/x86_64/invert_limb.asm: Likewise.
5200         * mpn/x86_64/darwin.m4 (PROTECT, IFELF): New defines.
5201         * mpn/x86_64/dos64.m4 (PROTECT, IFELF): New defines.
5202         * mpn/x86_64/x86_64-defs.m4 (PROTECT, IFELF): New defines.
5204 2011-12-01  Torbjorn Granlund  <tege@gmplib.org>
5206         * mpn/x86_64/fat/fat.c: Copy fake cpuid code from x86/fat/fat.c.
5208         * mpn/x86_64 (STD64, IFSTD): New names for ELF64, IFELF (since these
5209         denote all standard calling conventions).
5211         * mpn/x86_64: Add DOS64 ABI support to more files.
5213         * mpn/x86_64/mod_1_1.asm: Finish DOS64 support.
5214         * mpn/x86_64/mod_1_2.asm: Likewise.
5215         * mpn/x86_64/mod_1_4.asm: Likewise.
5217         * configure.in: Add GMP_NONSTD_ABI also for fat builds.
5219         * mpn/x86_64/fat/fat_entry.asm: Rewrite to support DOS64.
5221         * mpn/x86_64/dos64.m4 (IFDOS, IFSTD): New defines.
5222         * mpn/x86_64/x86_64-defs (IFDOS, IFSTD): New defines.
5224         * mpn/x86_64/dive_1.asm: Add DOS64 ABI support.
5225         * mpn/x86_64/mode1o.asm: Likewise.
5227         * mpn/x86_64/mod_34lsub1.asm: Enable for DOS64.
5229         * mpn/x86_64/invert_limb.asm: Wrap .protected decl.
5231         * gmp-impl.h (DECL_divexact_1): Fix typo in return type.
5233         * mpn/x86_64/dos64.m4 (LEA): New define.
5234         (PIC): Define.
5236 2011-11-29  Torbjorn Granlund  <tege@gmplib.org>
5238         * mpn/x86_64: Add DOS64 ABI support to most files.
5240 2011-11-28  Torbjorn Granlund  <tege@gmplib.org>
5242         * mpn/x86_64/mul_basecase.asm: Support ABI DOS64.
5243         * mpn/x86_64/sqr_basecase.asm: Support ABI DOS64.
5244         * mpn/x86_64/aorsmul_1.asm: Support ABI DOS64.
5245         * mpn/x86_64/mul_1.asm: Support ABI DOS64.
5247         * mpn/x86_64/x86_64-defs.m4 (DOS64_ENTRY, DOS64_EXIT): New, empty defs.
5249         * mpn/x86_64/dos64.m4: New file.
5251         * mpn/asm-defs.m4 (ABI_SUPPORT): New dummy macro.
5253         * configure.in (64-bit mingw/cygwin): Define HOST_DOS64,GMP_NONSTD_ABI.
5254         No longer clear out path_64.
5255         (mpn code selection loop): Handle GMP_NONSTD_ABI.
5257         * mpn/generic/udiv_w_sdiv.c: Use CNST_LIMB for some constants.
5259 2011-11-25  Torbjorn Granlund  <tege@gmplib.org>
5261         * x86/*: Many new gmp-mparam.h file for 64-bit CPUs in 32-bit mode.
5263         * configure.in: Overhaul x86/x86_64 support, merging three case
5264         statements into one.
5266 2011-11-24  Torbjorn Granlund  <tege@gmplib.org>
5268         * doc/gmp.texi (Formatted Output Strings): Clarify rules for mpf_t
5269         precision.
5271         * mpn/powerpc32/p7/gmp-mparam.h: New file.
5273         * tune/tuneup.c (tune_mu_div, tune_mu_bdiv): Up min_size to karatsuba's
5274         threshold.
5276 2011-11-22  Torbjorn Granlund  <tege@gmplib.org>
5278         * mpn/powerpc64/mode64/p6/aorsmul_1.asm: New file.
5280         * configure.in: Don't fail fat builds under 64-bit DOS.
5282         * mpn/powerpc64/mode64/aors_n.asm: Align loop for slightly better
5283         power5 performance.
5285 2011-11-21  Torbjorn Granlund  <tege@gmplib.org>
5287         * gmp-h.in (__GNU_MP_RELEASE): Renamed from typo name.
5289 2011-11-20  Torbjorn Granlund  <tege@gmplib.org>
5291         * configure.in: Split x86 CPUs into more subtypes for more accurate
5292         passing of gcc flags.
5294         * mpn/powerpc32/p3-p7/aors_n.asm: New file.
5296         * configure.in: Pass -m32 for powerpc64 with abi=32, using via _maybe
5297         mechanism.
5299         * configure.in: Support powerpc32/p3-p7 directory for affected CPUs.
5301 2011-11-17  Torbjorn Granlund  <tege@gmplib.org>
5303         * tune/speed.c (routine): Add mpn_tabselect.
5304         * tune/common.c (speed_mpn_tabselect): New function.
5305         * tune/speed.h (SPEED_ROUTINE_MPN_COPY_CALL): New macro, made from
5306         old SPEED_ROUTINE_MPN_COPY.
5307         (SPEED_ROUTINE_MPN_COPY): Just invoke SPEED_ROUTINE_MPN_COPY_CALL.
5308         (SPEED_ROUTINE_MPN_TABSELECT): New macro.
5310 2011-11-17  Niels Möller  <nisse@lysator.liu.se>
5312         * tune/tuneup.c (tune_hgcd_appr): Increase stop_since_change.
5314 2011-11-16  Torbjorn Granlund  <tege@gmplib.org>
5316         * mpn/powerpc32/tabselect.asm: New file.
5318         * mpn/powerpc64/mode64/aorscnd_n.asm: New file.
5320 2011-11-15  Niels Möller  <nisse@lysator.liu.se>
5322         * tune/speed.h (speed_mpn_hgcd_appr_lehmer): New prototype.
5323         (mpn_hgcd_lehmer_itch): Likewise.
5324         (mpn_hgcd_appr_lehmer): Likewise.
5325         (mpn_hgcd_appr_lehmer_itch): Likewise.
5326         (MPN_HGCD_LEHMER_ITCH): Deleted macro.
5328         * tune/speed.c (routine): Added mpn_hgcd_appr_lehmer.
5330         * tune/common.c (speed_mpn_hgcd_lehmer): Use mpn_hgcd_lehmer_itch
5331         rather than similarly named macro.
5332         (speed_mpn_hgcd_appr_lehmer): New function.
5334         * tune/Makefile.am (libspeed_la_SOURCES): Added
5335         hgcd_appr_lehmer.c.
5337         * tune/hgcd_appr_lehmer.c: New file.
5339         * tune/tuneup.c (tune_hgcd_appr): Increased min_size to 50; some
5340         machines got small thresholds which appear to be bogus.
5342 2011-11-15  Torbjorn Granlund  <tege@gmplib.org>
5344         * mpn/generic/powm_sec.c (mpn_local_sqr): Remove forgotten TMP_* calls.
5345         (redcify): Likewise.
5346         (mpn_powm_sec): Likewise.
5348         * mpn/generic/powm_sec.c (mpn_powm_sec): Rework scratch usage
5349         (mpn_powm_sec_itch): Rewrite.
5351         * mpn/generic/powm_sec.c (mpn_powm_sec): Use mpn_tabselect also in
5352         initialisation.
5354         * configure.in: Amend 2011-11-03 gcc_cflags change.
5356         * mpn/powerpc64/tabselect.asm: New file.
5357         * mpn/x86_64/tabselect.asm: New file.
5358         * mpn/x86/tabselect.asm: New file.
5359         * mpn/ia64/tabselect.asm: New file.
5361         * mpn/asm-defs.m4 (define_mpn): Add tabselect.
5363         * configure.in (gmp_mpn_functions): Add tabselect.
5364         (HAVE_NATIVE): Add entries for addncd_n, subcnd_n, tabselect.
5366         * mpn/generic/powm_sec.c: Remove mpn_tabselect implementation.
5367         * mpn/generic/tabselect.c: New file with removed code.
5369 2011-11-13  Torbjorn Granlund  <tege@gmplib.org>
5371         * tune/Makefile.am (TUNE_MPN_SRCS_BASIC): Add powm_sec.c.
5373         * mpn/generic/powm_sec.c (win_size): Use POWM_SEC_TABLE
5374         (POWM_SEC_TABLE): Define default.
5376         * tune/tuneup.c (tune_powm_sec): New function computing POWM_SEC_TABLE.
5377         (all): Call new function.
5379         * mpn/generic/powm_sec.c (win_size): Define only when
5380         TUNE_PROGRAM_BUILD is not set.
5382 2011-11-13  Niels Möller  <nisse@lysator.liu.se>
5384         * tune/tuneup.c (tune_hgcd_appr): Use default min_size.
5385         (tune_hgcd_reduce): Increase max_size and step_factor, to 7000
5386         and 0.04, respectively.
5388 2011-11-11  Torbjorn Granlund  <tege@gmplib.org>
5390         * mpn/powerpc64/mode64/sqr_diag_addlsh1.asm: Remove.
5392 2011-11-11  Niels Möller  <nisse@lysator.liu.se>
5394         * tune/hgcd_reduce_2.c: New file.
5395         * tune/hgcd_reduce_1.c: New file.
5397         * tune/tuneup.c (hgcd_appr_threshold): New threshold variable.
5398         (hgcd_reduce_threshold): Likewise.
5399         (tune_hgcd_appr): New function.
5400         (tune_hgcd_reduce): New function.
5401         (all): Call tune_hgcd_appr and tune_hgcd_reduce.
5403         * tune/speed.h (speed_mpn_hgcd_reduce): Declaration.
5404         (speed_mpn_hgcd_reduce_[12]): Likewise.
5405         (mpn_hgcd_reduce_[12]): Likewise.
5406         (SPEED_ROUTINE_MPN_HGCD_REDUCE_CALL): New macro.
5408         * tune/speed.c (routine): Added mpn_hgcd_reduce,
5409         mpn_hgcd_reduce_1, and mpn_hgcd_reduce_2.
5411         * tune/common.c (speed_mpn_hgcd_reduce): New function.
5412         (speed_mpn_hgcd_reduce_[12]): Likewise.
5414         * tune/Makefile.am (libspeed_la_SOURCES): Added hgcd_reduce_1.c
5415         hgcd_reduce_2.c.
5416         (TUNE_MPN_SRCS_BASIC): Added hgcd_appr.c and hgcd_reduce.c.
5418         * mpn/generic/hgcd_appr.c (submul, hgcd_matrix_apply): Deleted
5419         functions, earlier copied to hgcd_reduce.c.
5420         (mpn_hgcd_appr): Use hgcd_reduce.
5422 2011-11-09  Torbjorn Granlund  <tege@gmplib.org>
5424         * mpn/powerpc64/mode64/sqr_basecase.asm: New file.
5426         * mpn/x86_64/aorscnd_n.asm: New file.
5428         * tune/speed.c (routine): Add measuring of mpn_addcnd_n, mpn_subcnd_n.
5429         * tune/common.c (speed_mpn_addcnd_n,speed_mpn_subcnd_n): New functions.
5430         * tune/speed.h: Declare them.
5432         * tests/devel/try.c: Add tests for mpn_addcnd_n and mpn_subcnd_n.
5433         * tests/refmpn.c (refmpn_addcnd_n, refmpn_subcnd_n): New functions.
5434         * tests/tests.h: Declare them.
5436         * configure.in (gmp_mpn_functions): Add addcnd_n and subcnd_n.
5438 2011-11-07  Torbjorn Granlund  <tege@gmplib.org>
5440         * mpn/generic/redc_1.c: Just reduce U operand using Hensel norm, but
5441         not fully canonically; leave add_n and conditional sub_n to caller.
5442         Therefore omit R argument.
5444         * mpn/generic/redc_1_sec.c: Remove.
5446         * gmp-impl.h (mpn_redc_1): Update declaration.
5447         (mpn_redc_1_sec): Remove declaration.
5449         * configure.in (gmp_mpn_functions): Remove redc_1.
5451         * mpn/x86_64/redc_1.asm: Adopt to new defined functionality/interface.
5452         * tune/speed.h (SPEED_ROUTINE_REDC_1): Likewise.
5454         * tests/refmpn.c (refmpn_redc_1): Likewise; also call refmpn_addmul_1
5455         instead of mpn_addmul_1.
5457         * mpn/generic/powm.c (MPN_REDC_1): New macro, use for mpn_redc_1.
5458         * mpn/generic/powm_sec.c (MPN_REDC_1_SEC): New macro, use for
5459         mpn_redc_1_sec.
5461 2011-11-03  Torbjorn Granlund  <tege@gmplib.org>
5463         * dumbmp.c (mpz_sub): Abort for non-handled case.
5465         * mpn/powerpc64/mode64/lshiftc.asm: Move file from here...
5466         * mpn/powerpc64/lshiftc.asm: ...to here, with trivial modifications.
5468         * configure.in: Pass -m32 in more cases, using _maybe mechanism.
5469         Inherit default gcc_cflags in more places.
5471         * mpn/powerpc64/mode64/p7/gmp-mparam.h: New file.
5473 2011-11-02  Torbjorn Granlund  <tege@gmplib.org>
5475         * mpn/s390_64/invert_limb.asm: Slight optimisation.
5477         * configure.in (s390): Set gcc_32_cflags_maybe.
5479         * mpn/s390_32/gmp-mparam.h: Put in proper data.
5480         * mpn/s390_32/esame/gmp-mparam.h: New file.
5482         * mpn/x86_64/bobcat/gmp-mparam.h: New file.
5484         * mpn/s390_32/lshift.asm: New file.
5485         * mpn/s390_32/rshift.asm: New file.
5486         * mpn/s390_32/lshiftc.asm: New file.
5488 2011-10-31  Torbjorn Granlund  <tege@gmplib.org>
5490         * mpn/powerpc64/sqr_diagonal.asm: Move from here...
5491         * mpn/powerpc64/mode32/sqr_diagonal.asm: ...to here.
5493         * mpn/powerpc64/mode64/sqr_diag_addlsh1.asm: New file.
5495         * mpn/s390_64/sqr_basecase.asm: Rewrite sqr_diag_addlsh1 code.
5496         * mpn/s390_32/esame/sqr_basecase.asm: Likewise.
5498 2011-10-29  Torbjorn Granlund  <tege@gmplib.org>
5500         * mpn/s390_64/lshift.asm: Complete rewrite.
5501         * mpn/s390_64/rshift.asm: Likewise.
5503         * mpn/s390_64/lshiftc.asm: New file.
5505 2011-10-28  Torbjorn Granlund  <tege@gmplib.org>
5507         * mpn/s390_32/esame/aors_n.asm: New file, with rewritten add/sub code.
5509 2011-10-27  Torbjorn Granlund  <tege@gmplib.org>
5511         From Per Olofsson:
5512         * gmp-impl.h (BSWAP_LIMB): Rename variable to avoid BSWAP_LIMB_FETCH
5513         clash.
5515         * mpn/s390_32/esame/mul_basecase.asm: New file.
5517         * mpn/s390_32/esame/sqr_basecase.asm: New file.
5519         * mpn/s390_32/logops_n.asm: New file.
5521         * mpn/s390_64/logops_n.asm: Fix rp=up code.  Remove a leftover insn.
5523 2011-10-26  Niels Möller  <nisse@lysator.liu.se>
5525         * gmp-impl.h (mpn_hgcd_reduce, mpn_hgcd_reduce_itch): Added
5526         prototypes.
5527         (HGCD_APPR_THRESHOLD): Set up threshold for tuning.
5528         (HGCD_REDUCE_THRESHOLD): Likewise.
5530         * configure.in (gmp_mpn_functions): Added hgcd_reduce.
5532         * mpn/generic/hgcd_reduce.c: New file.
5534 2011-10-24  Torbjorn Granlund  <tege@gmplib.org>
5536         * mpn/x86_64/sqr_basecase.asm: Put intermediate result into R, don't
5537         allocate any stack space.
5539 2011-10-23  Torbjorn Granlund  <tege@gmplib.org>
5541         * mpn/s390_64/logops_n.asm: Use nc, oc, xc when possible.
5543         * tune/common.c (speed_mpn_and_n, speed_mpn_andn_n, etc):
5544         Pass correct input args.
5546         * mpn/s390_64/mod_34lsub1.asm: Use llgfr for zero extensions.
5548         * mpn/s390_64/mul_basecase.asm: New file.
5550         * mpn/s390_64/sqr_basecase.asm: New file.
5551         * mpn/s390_64/sqr_diag_addlsh1.asm: Removed, lives on in sqr_basecase.
5553         * mpn/s390_64/bdiv_dbm1c.asm: Shave off 1 c/l.
5555         * mpn/s390_64/aorrlsh1_n.asm: New file, developed from aorslsh1_n.asm.
5556         * mpn/s390_64/sublsh1_n.asm: New file.
5557         * mpn/s390_64/aorslsh1_n.asm: Remove file.
5559 2011-10-22  Torbjorn Granlund  <tege@gmplib.org>
5561         * mpn/s390_64/logops_n.asm: New file.
5563         * mpn/s390_64/aors_n.asm: New file, with rewritten add/sub code.
5565 2011-10-20  Torbjorn Granlund  <tege@gmplib.org>
5567         * tune/speed.h (SPEED_ROUTINE_MPN_SQR_DIAL_ADDLSH1_CALL): New macro.
5568         * tune/common.c (speed_mpn_sqr_diag_addlsh1): New function.
5569         * tune/speed.c (routine): Measure mpn_sqr_diag_addlsh1.
5571         * mpn/s390_64/sqr_diag_addlsh1.asm: Rewrite like s390_32/esame code.
5573         * mpn/s390_32/esame/sqr_diag_addlsh1.asm: Save just needed registers.
5575 2011-10-19  Torbjorn Granlund  <tege@gmplib.org>
5577         * mpn/s390_32/esame/add_n.asm: Rewrite, similar to s390_64 code.
5578         * mpn/s390_32/esame/add_n.asm: Likewise.
5580 2011-10-17  Torbjorn Granlund  <tege@gmplib.org>
5582         * mpn/s390_32/esame/aorslsh1_n.asm: New file.
5584 2011-10-16  Torbjorn Granlund  <tege@gmplib.org>
5586         * mpn/s390_32/esame/sqr_diag_addlsh1.asm: New file.
5588         * mpn/s390_32/copyi.asm: New file.
5589         * mpn/s390_32/copyd.asm: New file.
5591         * mpn/s390_64/copyd.asm: Optimise.
5593         * mpn/s390_64/copyi.asm: Rewrite along the lines of glibc memcpy.
5595         * mpn/s390_64/aorslsh1_n.asm: New file.
5597         * mpn/s390_64/mod_34lsub1.asm: New file.
5599         * mpn/s390_64/sqr_diag_addlsh1.asm: New file.
5601 2011-10-15  Torbjorn Granlund  <tege@gmplib.org>
5603         * configure.in (s390): Rewrite support to handle known CPUs.
5604         * config.guess: Recognise s390 CPUs.
5605         * config.sub: Match s390 CPUs.
5606         * acinclude.m4 (S390_PATTERN, S390X_PATTERN): New defines.
5608 2011-10-14  Torbjorn Granlund  <tege@gmplib.org>
5610         From Per Olofsson:
5611         * mpn/generic/popham.c: Add __GMP_NOTHROW to make it match gmp.h.
5612         * mpn/generic/gcd_1.c: Separate declarations and initialisers for the
5613         benefit of C++.
5615         * configure.in: AC_DEFINE HAVE_HOST_CPU_s390_zarch.
5616         * longlong.h (s390): Use it.
5617         (s390 umul_ppmm): Fix typo in pure C variant.
5619 2011-10-13  Torbjorn Granlund  <tege@gmplib.org>
5621         * longlong.h (s390): Put back an accidentally deleted #else.
5623         * configure.in (s390): Unset extra_functions for s390x.
5625 2011-10-12  Torbjorn Granlund  <tege@gmplib.org>
5627         * mpn/s390_64/lshift.asm: Reduce register usage.
5628         * mpn/s390_64/rshift.asm: Likewise.
5630         * longlong.h (s390 umul_ppmm): With new-enough gcc, avoid asm.
5632         From Andreas Krebbel:
5633         * longlong.h (s390 umul_ppmm): Support 32-bit limbs with gcc using
5634         64-bit registers.
5635         (s390 udiv_qrnnd): Likewise.
5637 2011-10-11  Torbjorn Granlund  <tege@gmplib.org>
5639         * configure.in (s390x): Pass -mzarch to gcc in 32-bit mode.
5641         * longlong.h (s390x): Add __CLOBBER_CC for relevant asm patterns.
5642         * mpn/generic/mod_1_1.c (s390x add_mssaaaa): Likewise.
5644         * mpn/s390_64/copyd.asm: New file.
5646 2011-10-10  Niels Möller  <nisse@lysator.liu.se>
5648         * mpn/generic/hgcd_appr.c: Deleted debugging code.
5650         * tests/mpn/t-hgcd_appr.c (main): Added -v flag.
5651         (hgcd_appr_valid_p): Increased margin of non-minimality for
5652         divide-and-conquer algorithm. Display bit counts only if
5653         -v is used.
5655         * mpn/generic/hgcd_appr.c (submul): New (static) function.
5656         (hgcd_matrix_apply): New function.
5657         (mpn_hgcd_appr_itch): Account for divide-and-conquer algorithm.
5658         (mpn_hgcd_appr): Implemented divide-and-conquer.
5660 2011-10-10  Torbjorn Granlund  <tege@gmplib.org>
5662         * mpn/generic/mod_1_1.c (add_mssaaaa): Add s390x variant.  Put arm code
5663         inside __GNUC__.
5665         * tune/time.c (STCK): Use proper memory constraint.
5667         From Marco Trudel:
5668         * tests/mpz/t-scan.c (check_ref): Fix loop end bound.
5670 2011-10-10  Niels Möller  <nisse@lysator.liu.se>
5672         * gmp-impl.h: (HGCD_APPR_THRESHOLD): New threshold.
5674         * mpn/generic/hgcd_appr.c (mpn_hgcd_appr): Interface change.
5675         Destroy inputs, let caller make working copies if needed.
5676         (mpn_hgcd_appr_itch): Reduced scratch need.
5677         * gmp-impl.h: Updated mpn_hgcd_appr prototype.
5678         * tests/mpn/t-hgcd_appr.c (one_test): Make working copies for
5679         hgcd_appr.
5680         * tune/common.c (speed_mpn_hgcd_appr): Use SPEED_ROUTINE_MPN_HGCD_CALL.
5681         * tune/speed.h (SPEED_ROUTINE_MPN_HGCD_APPR_CALL): Deleted.
5683 2011-10-09  Torbjorn Granlund  <tege@gmplib.org>
5685         * mpn/s390_64/copyi.asm: New file.
5686         * mpn/s390_64/lshift.asm: New file.
5687         * mpn/s390_64/rshift.asm: New file.
5689         * mpn/s390_64/add_n.asm: Rewrite using lmg/stmg.
5690         * mpn/s390_64/sub_n.asm: Likewise.
5692         * mpn/s390_64/invert_limb.asm: Save a callee-saves register less.
5694         * tune/time.c (getrusage_backwards_p): Properly cast printed values.
5696         * longlong.h (s390x): Put back UDItype casts to make gcc reloading use
5697         right more for constants.
5698         (s390x count_leading_zeros): Disable until we support z10 specifically.
5699         (s390x add_ssaaaa): Remove algsi/slgsi until we support z10.
5701 2011-10-09  Niels Möller  <nisse@lysator.liu.se>
5703         * mpn/generic/hgcd_matrix.c (mpn_hgcd_matrix_adjust): Declare
5704         matrix argument const.
5706 2011-10-08  Niels Möller  <nisse@lysator.liu.se>
5708         * tests/mpn/t-hgcd_appr.c (hgcd_appr_valid_p): Adjusted the
5709         allowed margin of non-minimality for hgcd_appr.
5711         * mpn/generic/hgcd_appr.c (mpn_hgcd_appr): Fixed handling of
5712         extra_bits, starting at zero, to ensure that we don't produce too
5713         small remainders. Added a final reduction loop when we we
5714         otherwise terminate with extra_bits > 0, to make the returned
5715         remainders closer to minimal.
5717 2011-10-07  Torbjorn Granlund  <tege@gmplib.org>
5719         * longlong.h (s390): Add 32-bit zarch umul_ppmm and udiv_qrnnd.
5720         (s390): Overhaul 32-bit and 64-bit code.
5722 2011-10-07  Niels Möller  <nisse@lysator.liu.se>
5724         * tune/speed.h (speed_mpn_hgcd_appr): New prototype.
5725         (SPEED_ROUTINE_MPN_HGCD_APPR_CALL): New macro.
5726         * tune/common.c (speed_mpn_hgcd_appr): New function.
5727         * tune/speed.c (routine): Added mpn_hgcd_appr.
5729         * tests/mpn/t-hgcd_appr.c: New file.
5730         * tests/mpn/Makefile.am (check_PROGRAMS): Added t-hgcd_appr.
5732         * configure.in (gmp_mpn_functions): Added hgcd_step and hgcd_appr.
5734         * gmp-impl.h: Added prototypes for mpn_hgcd_step,
5735         mpn_hgcd_appr_itch and mpn_hgcd_appr.
5737         * mpn/generic/hgcd_appr.c: New file.
5739         * mpn/generic/hgcd_step.c: New file, extracted from hgcd.c.
5740         (mpn_hgcd_step): Renamed, from...
5741         * mpn/generic/hgcd.c (hgcd_step): ...old name. Renamed and moved
5742         to hgcd_step.c.
5743         (hgcd_hook): Also moved to hgcd_step.c.
5744         (mpn_hgcd): Updated for hgcd_step renaming.
5746 2011-10-06  Torbjorn Granlund  <tege@gmplib.org>
5748         * mpn/s390_64/invert_limb.asm: New file.
5750 2011-10-04  Torbjorn Granlund  <tege@gmplib.org>
5752         * mpn/s390_64/submul_1.asm: New file.
5753         * mpn/s390_32/esame/submul_1.asm: New file.
5755         * mpn/generic/mulmid.c (mpn_mulmid): Move a TMP_DECL to block start.
5757         * mpn/Makefile.am (TARG_DIST): Add s390_32 and s390_64, remove s390 and
5758         z8000x.
5760         * doc/gmp.texi (Custom Allocation): Rephrase a paragraph.
5762         * demos/factorize.c: Run 25 Miller-Rabin tests.
5764         * mpz/nextprime.c: Run 25 mpz_millerrabin tests (was 10).
5766 2011-10-03  Torbjorn Granlund  <tege@gmplib.org>
5768         * configure.in: Support s390x.
5770         * longlong.h: Add support for 64-bit s390x.
5772         * mpn/s390_64: New directory.
5773         * mpn/s390_64/add_n.asm: New file.
5774         * mpn/s390_64/sub_n.asm: New file.
5775         * mpn/s390_64/mul_1.asm: New file.
5776         * mpn/s390_64/addmul_1.asm: New file.
5777         * mpn/s390_64/bdiv_dbm1c.asm: New file.
5778         * mpn/s390_64/gmp-mparam.h: New file, taken from x86_64.
5780         * mpn/s390_32: Directory renamed from mpn/s390.
5781         * mpn/s390_32/gmp-mparam.h: New file, taken from x86_64.
5782         * mpn/s390_32/esame/add_n.asm: New file.
5783         * mpn/s390_32/esame/sub_n.asm: New file.
5784         * mpn/s390_32/esame/mul_1.asm: New file.
5785         * mpn/s390_32/esame/addmul_1.asm: New file.
5786         * mpn/s390_32/esame/bdiv_dbm1c.asm: New file.
5788 2011-10-03  Niels Möller  <nisse@lysator.liu.se>
5790         * tests/mpn/Makefile.am (check_PROGRAMS): Added t-mulmid.
5791         * tests/mpn/t-mulmid.c: New file.
5793         mulmid-related assembly for x86_64, from David Harvey:
5794         * mpn/asm-defs.m4 (define_mpn): Added [add,sub]_err[1,2,3]_n and
5795         mulmid_basecase. Also use m4_not_for_expansion on the
5796         corresponding OPERATION_* symbols.
5797         * mpn/x86_64/aors_err1_n.asm: New file.
5798         * mpn/x86_64/aors_err2_n.asm: Likewise.
5799         * mpn/x86_64/aors_err3_n.asm: Likewise.
5800         * mpn/x86_64/mulmid_basecase.asm: Likewise.
5801         * mpn/x86_64/core2/aors_err1_n.asm: Likewise.
5802         * mpn/x86_64/gmp-mparam.h (MULMID_TOOM42_THRESHOLD): New value.
5803         * mpn/x86_64/core2/gmp-mparam.h (MULMID_TOOM42_THRESHOLD): Likewise.
5805         Tuning of mulmid, from David Harvey:
5806         * tune/Makefile.am (TUNE_MPN_SRCS_BASIC): Added mulmid.c
5807         mulmid_n.c toom42_mulmid.c.
5808         * tune/speed.h: Prototypes for mulmid-related functions.
5809         (struct speed_params): Increased max number of sources to 5.
5810         (SPEED_ROUTINE_MPN_BINARY_ERR_N_CALL): New macro.
5811         (SPEED_ROUTINE_MPN_BINARY_ERR1_N): Likewise.
5812         (SPEED_ROUTINE_MPN_BINARY_ERR2_N): Likewise.
5813         (SPEED_ROUTINE_MPN_BINARY_ERR3_N): Likewise.
5814         (SPEED_ROUTINE_MPN_MULMID): Likewise.
5815         (SPEED_ROUTINE_MPN_MULMID_N): Likewise.
5816         (SPEED_ROUTINE_MPN_TOOM42_MULMID): Likewise.
5817         * tune/common.c (mpn_[add,sub]_err[1,2,3]_n): New functions.
5818         (speed_mpn_mulmid_basecase): New function.
5819         (speed_mpn_mulmid): New function.
5820         (speed_mpn_mulmid_n): New function.
5821         (speed_mpn_toom42_mulmid): New function.
5822         * tune/speed.c (routine): Added mpn_[add,sub]_err[1,2,3]_n,
5823         mpn_mulmid_basecase, mpn_toom42_mulmid, mpn_mulmid_n, and
5824         mpn_mulmid.
5825         * tune/tuneup.c (mulmid_toom42_threshold): New threshold variable.
5826         (tune_mulmid): New function.
5827         (all): Call tune_mulmid.
5829         Testing of mulmid, from David Harvey:
5830         * tests/refmpn.c (AORS_ERR1_N): New macro.
5831         (refmpn_add_err1_n, refmpn_sub_err1_n): New functions.
5832         (AORS_ERR2_N): New macro.
5833         (refmpn_add_err2_n, refmpn_sub_err2_n): New functions.
5834         (AORS_ERR3_N): New macro.
5835         (refmpn_add_err3_n, refmpn_sub_err3_n): New functions.
5836         (refmpn_mulmid_basecase): New function.
5837         (refmpn_toom42_mulmid): New function, wrapper for
5838         refmpn_mulmid_basecase.
5839         (refmpn_mulmid_n): Likewise.
5840         (refmpn_mulmid): Likewise.
5841         * tests/tests.h: Prototypes for new functions.
5842         * tests/devel/try.c (NUM_SOURCES): Increased to 5.
5843         (struct try_t): Use NUM_SOURCES and NUM_DESTS constants.
5844         (SIZE_4, SIZE_6, SIZE_DIFF_PLUS_3, SIZE_ODD): New constants.
5845         (OVERLAP_NOT_DST2): New flag.
5846         (param_init): New mulmid-related operation types.
5847         (mpn_toom42_mulmid_fun): New function.
5848         (choice_array): Added mulmid-related entries.
5849         (overlap_array): Extended for larger NUM_SOURCES.
5850         (OVERLAP_COUNT): Handle OVERLAP_NOT_DST2.
5851         (call): Support mulmid-related functions.
5852         (pointer_setup): Handle SIZE_4, SIZE_6, and SIZE_DIFF_PLUS_3.
5853         (SIZE_ITERATION): Handle SIZE_ODD.
5854         (SIZE2_FIRST): Handle SIZE_CEIL_HALF.
5855         (SIZE2_LAST): Likewise.
5857         Implementation of mulmid, from David Harvey:
5858         * mpn/generic/add_err1_n.c (mpn_add_err1_n): New file and function.
5859         * mpn/generic/add_err2_n.c (mpn_add_err2_n): Likewise.
5860         * mpn/generic/add_err3_n.c (mpn_add_err3_n): Likewise.
5861         * mpn/generic/sub_err1_n.c (mpn_sub_err1_n): Likewise.
5862         * mpn/generic/sub_err2_n.c (mpn_sub_err2_n): Likewise.
5863         * mpn/generic/sub_err3_n.c (mpn_sub_err3_n): Likewise.
5864         * mpn/generic/mulmid_basecase.c (mpn_mulmid_basecase): Likewise.
5865         * mpn/generic/mulmid_n.c (mpn_mulmid_n): Likewise.
5866         * mpn/generic/toom42_mulmid.c (mpn_toom42_mulmid): Likewise.
5867         * configure.in (gmp_mpn_functions): Added mulmid-related
5868         functions.
5869         (GMP_MULFUNC_CHOICES): Handle aors_err1_n, aors_err2_n, and
5870         aors_err3_n.
5871         * gmp-impl.h: Added prototypes for mulmid functions.
5872         (MPN_TOOM42_MULMID_MINSIZE): New constant.
5873         (MULMID_TOOM42_THRESHOLD): New threshold.
5874         (mpn_toom42_mulmid_itch): New macro.
5876 2011-10-03  Niels Möller  <nisse@lysator.liu.se>
5878         * tune/tune-gcd-p.c (main): Fixed broken loop conditions.
5880 2011-09-26  Torbjorn Granlund  <tege@gmplib.org>
5882         * mpn/sh/sh2/submul_1.asm: Make this old submul_1 implementation
5883         actually compute intended function.
5885         * longlong.h (SH): Recognise predefs for all SH processors as defined
5886         by current gcc versions.
5888 2011-09-25  Torbjorn Granlund  <tege@gmplib.org>
5890         * mpn/sh: Migrate files to '.asm'.
5891         * configure.in: Recognise sh3 and sh4.
5893 2011-09-21  Marc Glisse  <marc.glisse@inria.fr>
5895         * gmpxx.h (mpz_class::swap): New function.
5896         (mpq_class::swap): Likewise.
5897         (mpf_class::swap): Likewise.
5898         (swap): New function.
5899         * tests/cxx/t-assign.cc: Test the above.
5900         * doc/gmp.texi (swap): Document the above.
5902 2011-08-21  Marc Glisse  <marc.glisse@inria.fr>
5904         * tests/cxx/t-ops2.cc: check mul-div by 2.
5906         * gmpxx.h (__GMPXX_CONSTANT): New macro (__builtin_constant_p).
5907         (__gmp_binary_lshift): Move before multiplication. Optimize x << 0.
5908         (__gmp_binary_rshift): Move before division. Optimize x >> 0.
5909         (__gmp_binary_plus): Optimize x + 0. Rewrite rational + integer.
5910         (__gmp_binary_minus): Optimize x - 0 and 0 - x.
5911         Rewrite rational - integer.
5912         (__gmp_binary_multiplies): Optimize x * 2^n.
5913         (__gmp_binary_divides): Optimize x / 2^n.
5914         (__gmp_binary_*): Deduplicate code for symmetric operations.
5916 2011-08-18  Torbjorn Granlund  <tege@gmplib.org>
5918         * printf/doprntf.c (__gmp_doprnt_mpf): For DOPRNT_CONV_FIXED, ask for
5919         one more digit.
5921 2011-08-17  Torbjorn Granlund  <tege@gmplib.org>
5923         * mpf/sub.c: Fix typo in copy condition.  Delay an allocation.
5925 2011-08-12  Torbjorn Granlund  <tege@gmplib.org>
5927         * gmp-impl.h (LIMBS_PER_DIGIT_IN_BASE): Fix typo.
5929 2011-08-10  Torbjorn Granlund  <tege@gmplib.org>
5931         * gmp-impl.h (DIGITS_IN_BASEGT2_FROM_BITS): New.
5932         (DIGITS_IN_BASE_FROM_BITS): Compute more accurate result.
5933         (MPN_SIZEINBASE): Use DIGITS_IN_BASEGT2_FROM_BITS.
5935         * tests/rand/t-lc2exp.c (check_bigc): Call abort after reporting error.
5937 2011-08-09  Torbjorn Granlund  <tege@gmplib.org>
5939         * mpz/out_str.c (mpz_out_str): Reinsert accidentally deleted str_size
5940         adjustment.
5942         * gmp-impl.h (DIGITS_IN_BASE_FROM_BITS): Simplify, also avoiding
5943         overflow for base 2.
5945 2011-08-07  Torbjorn Granlund  <tege@gmplib.org>
5947         * gmp-impl.h (struct bases): Add log2b and logb2 field, remove
5948         chars_per_limb_exactly field.
5949         (DIGITS_IN_BASE_FROM_BITS): New.
5950         (DIGITS_IN_BASE_PER_LIMB): New.
5951         (LIMBS_PER_DIGIT_IN_BASE): New.
5952         * gen-bases.c: Generate log2b and logb2 fields; do not generate
5953         chars_per_limb_exactly field.
5954         * mpf/get_str.c mpf/out_str.c mpf/set_str.c mpn/generic/get_str.c
5955           mpn/generic/sizeinbase.c mpq/get_str.c mpz/inp_str.c mpz/out_str.c
5956           mpz/set_str.c printf/doprntf.c tune/speed.h tune/tuneup.c:
5957         Use new macros.
5959 2011-08-04  Torbjorn Granlund  <tege@gmplib.org>
5961         * dumbmp.c (mpz_root): Reinsert accidentally removed line.
5963 2011-08-03  Torbjorn Granlund  <tege@gmplib.org>
5965         * dumbmp.c (mpz_tdiv_qr): Correctly handle dividend value being equal
5966         to divisor value.
5967         (mpz_root): Create reasonable starting approximation.
5968         (mpz_sqrt): New function.
5969         (mpz_mul_2exp): Add faster block shifting code, disabled for now.
5971 2011-07-15  Torbjorn Granlund  <tege@gmplib.org>
5973         * mpn/arm/invert_limb.asm: Swap around some registers to silence 'as'
5974         warnings.
5976 2011-07-14  Torbjorn Granlund  <tege@gmplib.org>
5978         * mpn/generic/dcpi1_bdiv_q.c (mpn_dcpi1_bdiv_q): Get mpn_sub_1 size
5979         argument right.
5981 2011-07-04  Torbjorn Granlund  <tege@gmplib.org>
5983         * tests/misc/t-locale.c: Disable test for mingw.
5985         * configure.in (x86_64 *-*-mingw*): Handle also cygwin here; clear out
5986         extra_functions_64.
5988 2011-07-02  Torbjorn Granlund  <tege@gmplib.org>
5990         * config.guess: Don't print newline in x86 cpuid function.
5991         Rewrite x86-64 cpu recognition asm code to work under Windoze.
5993 2011-06-16  Torbjorn Granlund  <tege@gmplib.org>
5995         * acinclude.m4 (GMP_ASM_RODATA): Fix typo in 2011-04-20 change.
5997         * configure.in: Surround tr ranges with [] for portability.
5999 2011-05-25  Niels Möller  <nisse@lysator.liu.se>
6001         * tune/tune-gcd-p.c (search): New function to search for minimum.
6002         (main): Replaced slow linear search.
6004 2011-05-24  Niels Möller  <nisse@lysator.liu.se>
6006         * tune/Makefile.am (EXTRA_PROGRAMS): Added tune-gcd-p. Also added
6007         related automake variables.
6009         * mpn/Makefile.am (tune-gcd-p): Deleted target.
6011         * tune/tune-gcd-p.c: New file, extracted from mpn/generic/gcd.c
6012         and updated.
6013         * mpn/generic/gcd.c: Deleted the corresponding code, including
6014         main function.
6016 2011-05-23  Niels Möller  <nisse@lysator.liu.se>
6018         * mpz/jacobi.c (mpz_jacobi): Simplified by swapping operands when
6019         needed, to get asize >= bsize. Use the reciprocity law generalized
6020         to work when one operand is even.
6022 2011-05-22  Niels Möller  <nisse@lysator.liu.se>
6024         * mpz/jacobi.c (mpz_jacobi): Another bugfix for the asize == 1
6025         case. Sometimes, powers of two in b were taken into account twice.
6027 2011-05-21  Niels Möller  <nisse@lysator.liu.se>
6029         * mpz/jacobi.c (mpz_jacobi): The handling of asize == 1 was
6030         broken. Rewrote it.
6032         * tests/mpz/t-jac.c (mpz_nextprime_step): Sanity check that prime
6033         candidate and step has no common factor.
6034         (check_data): Added some test cases related to the asize == 1 case
6035         in mpz_jacobi.
6037 2011-05-20  Niels Möller  <nisse@lysator.liu.se>
6039         * gmp-impl.h: Jacobi-related prototypes.
6041         * configure.in (gmp_mpn_functions): Added jacobi_2, jacobi,
6042         hgcd2_jacobi, hgcd_jacobi, and removed jacobi_lehmer.
6044         * mpz/jacobi.c (STRIP_TWOS): Deleted macro.
6045         (mpz_jacobi): Partially rewritten, to no longer makes the A
6046         operand odd. Use new mpn_jacobi_n.
6048         * mpn/generic/jacobi_lehmer.c: Deleted file.
6050         * mpn/generic/jacobi.c (mpn_jacobi_n): New subquadratic jacobi
6051         implementation. Supersedes jacobi_lehmer.c.
6053         * mpn/generic/hgcd_jacobi.c (mpn_hgcd_jacobi): New file and
6054         function. A copy of mpn_hgcd, using mpn_hgcd2_jacobi, and with calls to
6055         mpn_jacobi_update when appropriate.
6057         * mpn/generic/jacobi_2.c (mpn_jacobi_2): New file. Extracted from
6058         jacobi_lehmer.c.
6059         * mpn/generic/hgcd2_jacobi.c (mpn_hgcd2_jacobi): Likewise.
6061         * mpn/generic/hgcd.c (hgcd_hook): Avoid using NULL.
6063 2011-05-19  Niels Möller  <nisse@lysator.liu.se>
6065         * tune/hgcd_lehmer.c (__gmpn_hgcd_itch): Don't rename symbols for
6066         the functions moved to hgcd_matrix.c.
6068         * configure.in (gmp_mpn_functions): Added hgcd_matrix.
6070         * mpn/generic/hgcd.c (hgcd_matrix_update_1): Deleted. Several other
6071         helper functions moved to hgcd_matrix.c, see below.
6072         (hgcd_hook): New function.
6073         (hgcd_step): Simplified, using mpn_gcd_subdiv_step and hgcd_hook.
6075         * mpn/generic/hgcd_matrix.c: New file.
6076         (mpn_hgcd_matrix_init): Moved here, from hgcd.c.
6077         (mpn_hgcd_matrix_update_q): Likewise.
6078         (mpn_hgcd_matrix_mul_1): Likewise.
6079         (mpn_hgcd_matrix_mul): Likewise.
6080         (mpn_hgcd_matrix_adjust): Likewise.
6082         * mpn/generic/gcd_subdiv_step.c (mpn_gcd_subdiv_step): New
6083         argument s, for use by hgcd.
6084         * gmp-impl.h (mpn_gcd_subdiv_step): Update declaration.
6086         * mpn/generic/gcd.c (mpn_gcd): Pass s = 0 to mpn_gcd_subdiv_step.
6087         * mpn/generic/gcdext.c (mpn_gcdext): Likewise. Also added an ASSERT.
6088         * mpn/generic/gcdext_lehmer.c (mpn_gcdext_lehmer_n): Likewise.
6089         (mpn_gcdext_hook): Added some ASSERTs.
6090         * mpn/generic/jacobi_lehmer.c (mpn_jacobi_lehmer): Likewise.
6092 2011-05-17  Niels Möller  <nisse@lysator.liu.se>
6094         * doc/gmp.texi (mpn_gcd, mpn_gcdext): Document input requirements:
6095         Must have un >= vn > 0, and V normalized.
6096         * mpn/generic/gcdext.c (mpn_gcdext): Added ASSERT for input
6097         normalization.
6098         * mpn/generic/gcd.c (mpn_gcd): Added ASSERTs for input
6099         requirements.
6101 2011-05-15  Marc Glisse  <marc.glisse@inria.fr>
6103         * gmpxx.h (operator<<): Dedup.
6104         * tests/cxx/t-iostream.cc: Test on compound types.
6106         * gmpxx.h (__gmp_binary_expr): Let things happen in place: c=(a+b)/2.
6108 2011-05-10  Marc Glisse  <marc.glisse@inria.fr>
6110         * gmpxx.h (__gmp_unary_expr): Let things happen in place: c=-(a+b).
6111         (operator>>): Clean the commenting out.
6112         * tests/cxx/t-iostream.cc: New file.
6113         * tests/cxx/Makefile.am: Added t-iostream.
6115 2011-05-10  Niels Möller  <nisse@lysator.liu.se>
6117         * doc/gmp.texi (mpz_gcd): Document that gcd(0,0) = 0.
6118         (mpz_gcdext): Document range for cofactors.
6120 2011-05-09  Niels Möller  <nisse@lysator.liu.se>
6122         * mpz/gcdext.c (mpz_gcdext): Increased sp allocation to bsize+1 limbs.
6123         * doc/gmp.texi (mpn_gcdext): Fixed documentation of allocation
6124         requirements; one extra limb is still needed for S.
6126 2011-05-09  Torbjorn Granlund  <tege@gmplib.org>
6128         * mpn/x86/fat/gmp-mparam.h (BMOD_1_TO_MOD_1_THRESHOLD): Define.
6129         * mpn/x86_64/fat/gmp-mparam.h (BMOD_1_TO_MOD_1_THRESHOLD): Define.
6131 2011-05-08  Marc Glisse  <marc.glisse@inria.fr>
6133         * gmpxx.h: Replace unsigned long with mp_bitcnt_t in many places.
6134         * doc/gmp.texi: Likewise.
6136 2011-05-06  Marc Glisse  <marc.glisse@inria.fr>
6138         * gmpxx.h (mpz_class): Make constructor from mp[qf]_class explicit.
6139         (mpq_class): Make constructor from mpf_class explicit.
6140         * doc/gmp.texi: Document the above.
6141         * NEWS: Likewise, and mention the EOF istream fix.
6142         * tests/cxx/t-mix.cc: New file.
6143         * tests/cxx/Makefile.am: Added t-mix.
6145         * tests/cxx/t-assign.cc: Minor tweak.
6146         * tests/cxx/t-misc.cc: Likewise.
6148         * gmpxx.h (__gmp_resolve_temp): Remove.
6149         (__gmp_set_expr): Remove some overloads.
6150         (mpq_class): mpz_init_set the numerator and denominator instead of
6151         mpq_init + mpq_set.
6152         (mpz_class): Dedup the string constructors.
6153         (mpq_class): Likewise.
6155         * tests/cxx/t-ops3.cc: New file.
6156         * tests/cxx/Makefile.am: Added t-ops3.
6158 2011-05-05  Torbjorn Granlund  <tege@gmplib.org>
6160         * mpz/gcdext.c: Correct sgn computation.
6161         Use MPZ_REALLOC.
6163 2011-05-05  Marc Glisse  <marc.glisse@inria.fr>
6165         * mpn/x86_64/fat/fat.c: Update for Sandy Bridge.
6166         * config.guess: warning to keep it in sync with fat.c.
6168 2011-05-05  Torbjorn Granlund  <tege@gmplib.org>
6170         * mpn/x86_64/fat/fat_entry.asm (PIC_OR_DARWIN): New symbol.  Use it to
6171         work around Darwin problems.
6173 2011-05-04  Niels Möller  <nisse@lysator.liu.se>
6175         * mpz/gcdext.c (mpz_gcdext): Reduced temporary allocations. Use
6176         mpz_divexact when computing the second cofactor.
6178 2011-05-03  David Harvey  <dmharvey@cims.nyu.edu>
6180         * configure.in: make invert_limb_table work correctly with
6181         --disable-assembly (from Niels Möller)
6183 2011-05-02  Marc Glisse  <marc.glisse@inria.fr>
6185         * .bootstrap: libtoolize doesn't need -c.
6187         * configfsf.guess: Update to version of 2011-02-02.
6188         * configfsf.sub: Update to version of 2011-03-23.
6190 2011-05-02  Niels Möller  <nisse@lysator.liu.se>
6192         * mpz/gcdext.c (mpz_gcdext): Don't allocate extra limbs at the end
6193         of mpn_gcdext parameters.
6195         * doc/gmp.texi (mpn_gcdext): Updated doc.
6197 2011-05-01  Niels Möller  <nisse@lysator.liu.se>
6199         * mpn/generic/div_qr_2u_pi1.c (mpn_div_qr_2u_pi1): Fixed ASSERT.
6201 2011-04-30  Marc Glisse  <marc.glisse@inria.fr>
6203         * gmp-h.in (mpz_cdiv_q_2exp): Use mp_bitcnt_t to match the definition
6204         and the documentation.
6205         (mpz_remove): Likewise.
6206         (mpf_eq): Likewise.
6208         * ltmain.sh: Remove.
6209         * .bootstrap: Let libtoolize generate ltmain.sh.
6211         * tests/cxx/t-ops2.cc: Add a couple tests.
6212         * tests/cxx/t-rand.cc: Likewise.
6214         * doc/gmp.texi (mpf_urandomb): Explicit the fact that it does not
6215         change the precision.
6217         * gmp-h.in (__GMP_EXTERN_INLINE): Recent g++ uses gnu_inline.
6219 2011-04-28  Torbjorn Granlund  <tege@gmplib.org>
6221         * configure.in (x86_64): Support bobcat specifically.
6222         (x86): Match bobcat and bulldozer, handle like k10.
6224 2011-04-28  David Harvey  <dmharvey@cims.nyu.edu>
6226         * README.HG: update autotools version numbers.
6228 2011-04-27  Torbjorn Granlund  <tege@gmplib.org>
6230         * tune/speed.h (speed_cyclecounter): Always use PIC variant when
6231         compiled with Apple's GCC.
6233         * mpn/x86/darwin.m4 (LEA): Complete rewrite.
6234         (m4append): New macro.
6236 2011-04-26  Torbjorn Granlund  <tege@gmplib.org>
6238         * mpn/sparc32/sparc-defs.m4 (changecom): Don't redefine '!' as it
6239         interferes with expressions.
6241 2011-04-20  Torbjorn Granlund  <tege@gmplib.org>
6243         * acinclude.m4 (GMP_ASM_RODATA): Make 'foo' larger to avoid clang
6244         problems.
6246 2011-04-12  Niels Möller  <nisse@lysator.liu.se>
6248         * mpn/x86_64/invert_limb.asm [PIC]: Declare mpn_invert_limb_table
6249         as .protected.
6251 2011-04-11  Torbjorn Granlund  <tege@gmplib.org>
6253         * mpn/x86/k7/invert_limb.asm: Use deflit for Darwin bug workaround.
6254         Undo 2011-03-28 change.
6256         * mpn/asm-defs.m4 (define_mpn): Use deflit.
6258 2011-04-10  Niels Möller  <nisse@lysator.liu.se>
6260         * mpn/asm-defs.m4 (define_mpn): Added invert_limb_table.
6262         * configure.in: Add invert_limb_table to extra_functions_64 on
6263         x86_64.
6265         * mpn/x86_64/invert_limb.asm: Changed references from approx_tab
6266         mpn_invert_limb_table.
6268         * mpn/x86_64/invert_limb_table.asm (mpn_invert_limb_table): New
6269         file. Extracted approximation table from invert_limb.asm, renamed
6270         and made global.
6272 2011-03-30  Niels Möller  <nisse@lysator.liu.se>
6274         * mpn/x86_64/div_qr_2u_pi1.asm: New file.
6276         * configure.in (gmp_mpn_functions): Add div_qr_2u_pi1.
6278         * gmp-impl.h (mpn_div_qr_2u_pi1): Declare.
6280         * mpn/generic/div_qr_2u_pi1.c (mpn_div_qr_2u_pi1): Moved to
6281         separate file, from...
6282         * mpn/generic/div_qr_2.c: ... old location.
6284         * mpn/generic/div_qr_2n_pi1.c: Renamed file, from...
6285         * mpn/generic/div_qr_2_pi1_norm.c: ...old name.
6286         * mpn/x86_64/div_qr_2n_pi1.asm: Renamed file, from...
6287         * mpn/x86_64/div_qr_2_pi1_norm.asm: ...old name.
6289         * gmp-impl.h (mpn_div_qr_2n_pi1): Use new name in declaration.
6290         * tune/speed.h (speed_mpn_div_qr_2n): Likewise.
6291         (speed_mpn_div_qr_2u): Likewise.
6293         * tune/tuneup.c (tune_div_qr_2): Use new name speed_mpn_div_qr_2n.
6295         * tune/speed.c (routine): Use new names mpn_div_qr_2n and
6296         mpn_div_qr_2u, also on the command line.
6298         * tune/common.c (speed_mpn_div_qr_2n): Renamed, from...
6299         (speed_mpn_div_qr_2_norm): ... old name.
6300         (speed_mpn_div_qr_2u): Renamed, from...
6301         (speed_mpn_div_qr_2_unnorm): ... old name.
6303         * mpn/generic/div_qr_2_pi1_norm.c (mpn_div_qr_2n_pi1): Renamed,
6304         from...
6305         (mpn_div_qr_2_pi1_norm): ...old name.
6306         * mpn/x86_64/div_qr_2_pi1_norm.asm: Likewise.
6308         * mpn/generic/div_qr_2.c (mpn_div_qr_2n_pi2): Renamed, from...
6309         (mpn_div_qr_2_pi2_norm): ... old name.
6310         (mpn_div_qr_2u_pi1): Renamed, from...
6311         (mpn_div_qr_2_pi1_unnorm): ... old name.
6312         (mpn_div_qr_2): Call functions using new names.
6314         * mpn/asm-defs.m4: Renamed div_qr_2-functions to new names.
6316 2011-03-29  Niels Möller  <nisse@lysator.liu.se>
6318         * mpn/x86_64/div_qr_2_pi1_norm.asm: Updated to use a separate rp
6319         argument.
6321         * gmp-impl.h (mpn_div_qr_2_pi1_norm): Updated declaration.
6322         * gmp-h.in (mpn_div_qr_2): Likewise.
6324         * tests/mpn/t-div.c (main): Adapted to new mpn_div_qr2 interface.
6325         * tune/speed.h (SPEED_ROUTINE_MPN_DIV_QR_2): Likewise.
6327         * mpn/generic/div_qr_2.c (mpn_div_qr_2_pi2_norm): Added rp
6328         argument. Don't clobber the input dividend.
6329         (mpn_div_qr_2_pi1_unnorm): Likewise.
6330         (mpn_div_qr_2): Likewise.
6331         * mpn/generic/div_qr_2_pi1_norm.c (mpn_div_qr_2_pi1_norm): Likewise.
6333 2011-03-29  Niels Möller  <nisse@lysator.liu.se>
6335         * mpn/x86/k7/invert_limb.asm: Use mov rather than push and pop.
6336         Earlier load of divisor from stack.
6338 2011-03-28  Torbjorn Granlund  <tege@gmplib.org>
6340         * mpn/x86/k7/invert_limb.asm: Protect movzwl register parameters from
6341         being interpreted as m4 macro parameters.
6343 2011-03-22  Niels Möller  <nisse@lysator.liu.se>
6345         * mpn/x86_64/div_qr_2_pi1_norm.asm: Copied optimized inner loop
6346         from divrem_2.asm.
6348         * mpn/x86_64/div_qr_2_pi1_norm.asm: First working, but poorly
6349         optimized, implementation.
6351         * mpn/asm-defs.m4 (define_mpn): Added div_qr_2_pi[12]_*norm.
6353         * mpn/generic/div_qr_2_pi1_norm.c (mpn_div_qr_2_pi1_norm): Moved
6354         to separate file, from...
6355         * mpn/generic/div_qr_2.c: ... old location.
6357         * gmp-impl.h (mpn_div_qr_2_pi1_norm): Declare.
6359         * configure.in (gmp_mpn_functions): Added div_qr_2_pi1_norm.
6361 2011-03-22  Torbjorn Granlund  <tege@gmplib.org>
6363         * configure.in (powerpc): Reinsert lost AIX cpu_path 32-bit handling.
6364         Reinsert lost linux/bsd cpu_path handling.
6366         * mpn/generic/mod_1_1.c: Disable powerpc asm for _LONG_LONG_LIMB.
6367         * mpn/generic/div_qr_2.c: Likewise.
6369         * mpn/generic/div_qr_2.c: Use asm just for gcc.
6370         Make powerpc add_sssaaaa work for 32-bit case, and use less strict
6371         constraints.
6373 2011-03-21  Niels Möller  <nisse@lysator.liu.se>
6375         * tune/tuneup.c (div_qr_2_pi2_threshold): New global variable.
6376         (tune_div_qr_2): New function.
6377         (all): Call tune_div_qr_2.
6379         * tune/Makefile.am (TUNE_MPN_SRCS_BASIC): Added div_qr_2.c.
6381         * gmp-impl.h (DIV_QR_2_PI2_THRESHOLD): Setup for tuning.
6383         New 4/2 division loop, based on Torbjörn's work:
6384         * mpn/generic/div_qr_2.c (add_sssaaaa, add_csaac): New macros.
6385         (udiv_qr_4by2): New macro.
6386         (invert_4by2): New function.
6387         (mpn_div_qr_2_pi2_norm): New function.
6388         (DIV_QR_2_PI2_THRESHOLD): New threshold.
6389         (mpn_div_qr_2_pi1_norm): Renamed, from...
6390         (mpn_div_qr_2_norm): ... old name.
6391         (mpn_div_qr_2_pi1_unnorm): Renamed, from...
6392         (mpn_div_qr_2_unnorm): ... old name.
6393         (mpn_div_qr_2): Use mpn_div_qr_2_pi2_norm for large enough
6394         normalized divisors.
6396         * gmp-impl.h (udiv_qr_3by2): Avoid a copy.
6398 2011-03-21  Torbjorn Granlund  <tege@gmplib.org>
6400         * configure.in (hppa): Under linux, treat 64-bit processors as if they
6401         were 32-bit processors.
6403         * mpn/generic/addcnd_n.c: New file.
6404         * mpn/asm-defs.m4 (define_mpn): Add addcnd_n and subcnd_n.
6405         * configure.in (gmp_mpn_functions): Add addcnd_n.
6406         * gmp-impl.h (mpn_addcnd_n): Declare.
6408         * mpn/generic/subcnd_n.c: Combine nails and non-nails functions.
6410         * gmp-impl.h (invert_pi1): Prepend _ to local variables, protect
6411         parameters within () where necessary.
6413         * mpn/asm-defs.m4 (define_mpn): Add div_qr_2.
6414         * configure.in (gmp_mpn_functions): Reinsert mercurial-bug-removed
6415         line.
6417 2011-03-20  Torbjorn Granlund  <tege@gmplib.org>
6419         * configure.in (powerpc): Add cpu_path for all three ABIs.
6420         Rename "aix64" to "mode64" for consistency.
6422 2011-03-16  Marc Glisse  <marc.glisse@inria.fr>
6424         * gmpxx.h (__gmp_binary_not_equal): Remove, use !__gmp_binary_equal.
6425         (__gmp_binary_less_equal): Remove, use !__gmp_binary_greater.
6426         (__gmp_binary_greater_equal): Remove, use !__gmp_binary_less.
6427         * tests/cxx/t-ops2.cc: Typo.
6429 2011-03-20  Niels Möller  <nisse@lysator.liu.se>
6431         * tune/common.c (speed_mpn_div_qr_2_norm): New function.
6432         (speed_mpn_div_qr_2_unnorm): New function.
6433         * tune/speed.c (routine): Recognize above functions.
6434         * tune/speed.h: Declarations for above functions.
6435         (SPEED_ROUTINE_MPN_DIV_QR_2): New macro.
6437         * tests/mpn/t-div.c (main): Added tests for mpn_divrem_2 and
6438         mpn_div_qr_2.
6440         * mpn/generic/div_qr_2.c (mpn_div_qr_2): New file and function.
6441         Intended to eventually replace divrem_2.
6442         * configure.in (gmp_mpn_functions): Add div_qr_2.
6444 2011-03-16  Marc Glisse  <marc.glisse@inria.fr>
6446         * gmpxx.h (__gmp_set_expr): Remove broken declarations.
6448 2011-03-19  Torbjorn Granlund  <tege@gmplib.org>
6450         * mpz/fac_ui.c (mpz_fac_ui): Use MPZ_REALLOC for standard, conditional
6451         reallocation.
6453 2011-03-19  Niels Möller  <nisse@lysator.liu.se>
6455         * mpn/generic/divrem_2.c (mpn_divrem_2): Fixed comment and assert
6456         regarding q and n overlap.
6458 2011-03-16  Marc Glisse  <marc.glisse@inria.fr>
6460         * gmpxx.h (__mpz_set_ui_safe): New inline function.
6461         (__mpz_set_si_safe): Likewise.
6462         (__GMPXX_TMPZ_UI): Use the new function.
6463         (__GMPXX_TMPZ_SI): Likewise.
6464         (__GMPXX_TMPQ_UI): Likewise.
6465         (__GMPXX_TMPQ_SI): Likewise.
6466         * tests/cxx/t-ops2.cc: test converting 0 to stack mpq_t.
6468 2011-03-15  Marc Glisse  <marc.glisse@inria.fr>
6470         * gmpxx.h (__GMPXX_TMPQ_UI): New macro.
6471         (__GMPXX_TMPQ_SI): New macro.
6472         (struct __gmp_binary_multiplies): Rewrite, using the new macros.
6473         (struct __gmp_binary_divides): Likewise.
6475         * gmpxx.h (__GMPZ_ULI_LIMBS): Rewrite.
6476         * tests/cxx/t-ops2.cc: test converting ULONG_MIN to stack mpq_t.
6478 2011-03-15 Marco Bodrato <bodrato@mail.dm.unipi.it>
6480         * mpn/generic/toom_interpolate_16pts.c: Remove ambiguity.
6482 2011-03-14  Torbjorn Granlund  <tege@gmplib.org>
6484         * tune/tuneup.c (tune_mul): Set tuning min size considering print skew.
6486         * doc/gmp.texi: Make reference to "Formatted I/O" chapters from type
6487         specific I/O sections.
6489         * mpn/alpha/add_n.asm: Add _nc entry point.
6490         * mpn/alpha/sub_n.asm: Likewise.
6491         * mpn/mips64/add_n.asm: Likewise.
6492         * mpn/mips64/sub_n.asm: Likewise.
6493         * mpn/sparc64/ultrasparc1234/add_n.asm: Likewise.
6494         * mpn/sparc64/ultrasparc1234/sub_n: Likewise.
6496 2011-03-13  Marc Glisse  <marc.glisse@inria.fr>
6498         * tests/cxx/t-ops2.cc: New file.
6499         * tests/cxx/Makefile.am: Added t-ops2.
6501 2011-03-13  Torbjorn Granlund  <tege@gmplib.org>
6503         * mpn/generic/toom32_mul.c (mpn_toom32_mul): Make 'hi' be limb-sized
6504         for better code.
6506         * gmp-impl.h (MPN_IORD_U): Handle x86_64 as well as x86_32.  Generate
6507         no code for incrementing by constant 0.
6509 2011-03-12  Marc Glisse  <marc.glisse@inria.fr>
6511         * gmpxx.h: Rename __GMPXX_TMP_* to __GMPXX_TMPZ_*. Use in more places.
6513 2011-03-12  Torbjorn Granlund  <tege@gmplib.org>
6515         * mpn/powerpc64/rshift.asm: Accept/return values correctly also for
6516         32-bit ABI.
6517         * mpn/powerpc64/lshift.asm: Likewise.
6519         * tune/powerpc.asm: Use powerpc syntax, not power syntax.
6521         * tune/common.c (speed_udiv_qrnnd_preinv1, etc): Remove.
6522         * tune/speed.c (routine): Remove udiv_qrnnd_preinv1, etc.
6524 2011-03-12  Marc Glisse  <marc.glisse@inria.fr>
6526         * tests/cxx/t-istream.cc: Restrict mpq test in t-istream -s.
6528         * gmpxx.h: Remove leftover #undefs.
6530 2011-03-11  Torbjorn Granlund  <tege@gmplib.org>
6532         * gmp-impl.h (udiv_qrnnd_preinv1, udiv_qrnnd_preinv2,
6533         udiv_qrnnd_preinv2gen): Remove obsolete macros.
6534         (udiv_qrnnd_preinv): New name for udiv_qrnnd_preinv3.
6536 2011-03-11 Marco Bodrato <bodrato@mail.dm.unipi.it>
6538         * gmp-impl.h: Declare many mpn_{sub,add}lsh*_n_ip[12] functions/macros.
6539         * mpn/generic/toom_interpolate_5pts.c: Use mpn_sublsh1_n_ip1.
6541         * tests/devel/try.c: Tests for {add,sub}lsh*_n_ip[12].
6542         * tests/refmpn.c: New reference for mpn_{add,sub}lsh*_n_ip[12].
6543         * tests/tests.h: Declarations for reference functions above.
6545         * tune/common.c: New speed_mpn_{add,sub}lsh*_n_ip[12] functions.
6546         * tune/speed.h: Prototypes for functions above.
6547         * tune/speed.c: Support for mpn_{add,sub}lsh*_n_ip[12].
6549         * mpn/x86/k7/sublsh1_n.asm: Replaced generic sublsh1 code with faster _ip1.
6550         * mpn/x86/atom/sublsh1_n.asm: Changed PROLOGUE accordingly.
6552         * configure.in: Define HAVE_NATIVE_mpn_addlsh*_n*_ip[12].
6553         * mpn/asm-defs.m4: Declare mpn_addlsh*_n*_ip[12].
6555 2011-03-10  Marc Glisse  <marc.glisse@inria.fr>
6557         * tests/cxx/t-istream.cc: Explicit conversion to streampos.
6559 2011-03-10  Torbjorn Granlund  <tege@gmplib.org>
6561         * mpn/x86/atom/sse2/mul_basecase.asm: Suppress wind-down rp updates.
6563         * Move new aorrlsh_n.asm to new k8 dir.  Revert
6564         mpn/x86_64/aorrlsh_n.asm.
6565         * configure.in: Setup path for new k8 directory.
6567 2011-03-10 Marco Bodrato <bodrato@mail.dm.unipi.it>
6569         * mpn/x86/pentium4/sse2/bdiv_dbm1c.asm: New file, was in atom.
6570         * mpn/x86/atom/sse2/bdiv_dbm1c.asm: Grab file above.
6572 2011-03-09  Torbjorn Granlund  <tege@gmplib.org>
6574         * mpn/x86_64/aorrlsh_n.asm: Complete rewrite.
6576         * mpn/x86_64/core2/aorrlsh_n.asm: New file, grabbing another asm file.
6578 2011-03-09  Marc Glisse  <marc.glisse@inria.fr>
6580         * tests/cxx/t-ostream.cc: Use bool instead of int.
6581         * tests/cxx/t-istream.cc: Likewise.
6582         * tests/cxx/t-misc.cc: Likewise.
6584         * cxx/ismpznw.cc: Don't clear eofbit.
6585         * cxx/ismpq.cc: Likewise.
6586         * cxx/ismpf.cc: Likewise.
6587         * tests/cxx/t-istream.cc: Test accordingly.
6589 2011-03-09 Marco Bodrato <bodrato@mail.dm.unipi.it>
6591         * mpn/x86/atom/sse2/bdiv_dbm1c.asm: New file.
6593 2011-03-09  Marc Glisse  <marc.glisse@inria.fr>
6595         * doc/gmp.texi: Remove void return type from constructors. Document
6596         explicit constructors. Document mpf_class::mpf_class(mpf_t).
6598 2011-03-07 Marco Bodrato <bodrato@mail.dm.unipi.it>
6600         * mpn/x86/atom/sse2/sqr_basecase.asm: Postponed pushes. Cleaned
6601         outer loop exit.
6603 2011-03-07  Torbjorn Granlund  <tege@gmplib.org>
6605         * mpn/x86_64/gcd_1.asm: Workaround Oracle assembler bug.
6607         * mpn/x86/atom/sse2/mul_basecase.asm: Replace addmul_1 loops.
6608         Tweak outer loop rp updates.
6610 2011-03-06  Torbjorn Granlund  <tege@gmplib.org>
6612         * mpn/x86/atom/sse2/sqr_basecase.asm: New file.
6614 2011-03-05  Torbjorn Granlund  <tege@gmplib.org>
6616         * mpn/x86_64/bdiv_dbm1c.asm: Write proper feed-in code.
6618 2011-03-04  Torbjorn Granlund  <tege@gmplib.org>
6620         * mpn/x86_64/addmul_2.asm: Rewrite for linear performance.
6622 2011-03-03  Torbjorn Granlund  <tege@gmplib.org>
6624         * mpn/generic/mod_1_1.c (add_mssaaaa): Canonicalise layout.  Add arm
6625         variant.  Enable sparc64 code and powerpc code (the latter for 32-bit
6626         and 64-bit).
6628         * mpn/generic/sqrtrem.c (mpn_dc_sqrtrem): Use mpn_addlsh1_n.
6630         * gmp-impl.h (mpn_addlsh_nc, mpn_rsblsh_nc): Declare.
6631         * mpn/asm-defs.m4: Likewise.
6633         * mpn/x86_64/coreisbr/aorrlsh_n.asm: Disable mpn_rsblsh_n due to
6634         carry-in issues.
6635         * mpn/x86_64/coreinhm/aorrlsh_n.asm: Likewise.
6636         * mpn/x86_64/coreisbr/aorrlsh2_n.asm: Likewise.
6638 2011-03-03  Niels Möller  <nisse@lysator.liu.se>
6640         * mpn/generic/mod_1_1.c (add_mssaaaa): For x86 and x86_64, treat m
6641         as in output operand only. Added sparc32 implementation. Also
6642         added #if:ed out attempts at sparc64 and powerpc64.
6644         * tune/tuneup.c (tune_mod_1): Record result of MOD_1_1P_METHOD
6645         measurement for use by mpn_mod_1_tune. And omit measurement if
6646         mpn_mod_1_1p is native assembly code.
6648         * mpn/generic/mod_1.c (mpn_mod_1_1p) [TUNE_PROGRAM_BUILD]: Macro
6649         to check mod_1_1p_method and call the right function.
6650         (mpn_mod_1_1p_cps) [TUNE_PROGRAM_BUILD]: Likewise.
6652         * gmp-impl.h (MOD_1_1P_METHOD) [TUNE_PROGRAM_BUILD]: Define macro.
6653         (mod_1_1p_method) [TUNE_PROGRAM_BUILD]: Declare variable.
6655 2011-03-02  Torbjorn Granlund  <tege@gmplib.org>
6657         * mpn/x86_64/coreinhm/aorrlsh_n.asm: New file.
6658         * mpn/x86_64/coreisbr/aorrlsh_n.asm: New file.
6660 2011-03-01  Niels Möller  <nisse@lysator.liu.se>
6662         * mpn/x86_64/mod_1_1.asm (mpn_mod_1_1p_cps): Eliminated a neg and
6663         two mov instructions.
6665         * mpn/x86/k7/mod_1_1.asm (mpn_mod_1_1p_cps): Simplified
6666         computation, analogous to recent x86_64/mod_1_1.asm changes.
6667         (mpn_mod_1_1p): Corresponding changes. Don't shift b.
6669         * mpn/sparc64/mod_1_4.c (mpn_mod_1s_4p_cps): Use udiv_rnnd_preinv
6670         rather than udiv_rnd_preinv.
6671         (mpn_mod_1s_4p): Likewise.
6673 2011-03-01  Torbjorn Granlund  <tege@gmplib.org>
6675         * mpn/x86/pentium4/sse2/mul_1.asm: Swap entry insns to share more code
6676         between entry points.
6677         * mpn/x86/pentium4/sse2/addmul_1.asm: Likewise.
6679         * mpz/divegcd.c: Rewrite, as per Marc Glisse's suggestion.  Also fix
6680         problem with passing a longlong limb to a _ui function.
6682         * gmp-impl.h (udiv_qrnnd_preinv3): Cast truth value to mask's type.
6683         (udiv_rnnd_preinv): Likewise.
6684         * mpn/generic/mod_1_1.c (mpn_mod_1_1p): Likewise.
6686 2011-02-28  Niels Möller  <nisse@lysator.liu.se>
6688         * mpn/generic/mod_1_1.c (add_mssaaaa): Typo fix, define
6689         add_mssaaaa, not add_sssaaaa.
6691         * tune/tuneup.c (tune_mod_1): Measure mpn_mod_1_1_1 and
6692         mpn_mod_1_1_2, to set MOD_1_1P_METHOD.
6694         * tune/speed.c (routine): Added mpn_mod_1_1_1 and mpn_mod_1_1_2.
6696         * tune/speed.h: Declare speed_mpn_mod_1_1_1, speed_mpn_mod_1_1_2,
6697         mpn_mod_1_1p_1, mpn_mod_1_1p_2, mpn_mod_1_1p_cps_1, and
6698         mpn_mod_1_1p_cps_2.
6700         * tune/common.c (speed_mpn_mod_1_1_1): New function.
6701         (speed_mpn_mod_1_1_2): New function.
6703         * tune/Makefile.am (libspeed_la_SOURCES): Added mod_1_1-1.c
6704         mod_1_1-2.c.
6706         * tune/mod_1_1-1.c: New file.
6707         * tune/mod_1_1-2.c: New file.
6709         * mpn/generic/mod_1_1.c: Implemented an algorithm with fewer
6710         multiplications, configured via MOD_1_1P_METHOD.
6712         * mpn/x86_64/mod_1_1.asm (mpn_mod_1_1p_cps): Simplified
6713         computation of B2modb, use B^2 mod (normalized b).
6714         (mpn_mod_1_1p): Corresponding changes. Don't shift b.
6716         * mpn/generic/mod_1_1.c (mpn_mod_1_1p_cps): Use udiv_rnnd_preinv rather
6717         than udiv_rnd_preinv.
6718         (mpn_mod_1_1p): Likewise.
6719         * mpn/generic/mod_1_4.c: Analogous changes.
6720         * mpn/generic/mod_1_3.c: Analogous changes.
6721         * mpn/generic/mod_1_2.c: Analogous changes.
6722         * mpn/generic/mod_1.c: Analogous changes.
6723         * mpn/generic/pre_mod_1.c: Analogous changes.
6725         * gmp-impl.h (udiv_qrnnd_preinv3): Eliminated unpredictable branch
6726         using masking logic. Further optimization of the nl == constant 0
6727         case, similar to udiv_rnd_preinv.
6728         (udiv_rnnd_preinv): Likewise.
6729         (udiv_rnd_preinv): Deleted, use udiv_rnnd_preinv with nl == 0
6730         instead.
6732         * tests/mpn/t-divrem_1.c (check_data): Added testcase to exercise
6733         the nl == constant 0 special case in udiv_qrnnd_preinv3.
6735 2011-02-28  Torbjorn Granlund  <tege@gmplib.org>
6737         * mpn/generic/rootrem.c (mpn_rootrem): Combine two similar scalar
6738         divisions.  Misc minor cleanup.
6740         * mpn/x86/atom/sse2/aorsmul_1.asm: Shorten software pipeline.
6742         * mpn/x86/atom/mul_basecase.asm: Remove file no longer used.
6744         * mpn/generic/rootrem.c (mpn_rootrem_internal): Delay O(log(U))
6745         allocations until they are known to be needed.
6747 2011-02-27 Marco Bodrato <bodrato@mail.dm.unipi.it>
6749         * mpn/x86/atom/sse2/mul_1.asm: New code.
6751 2011-02-27  Niels Möller  <nisse@lysator.liu.se>
6753         * gmp-impl.h (udiv_rnnd_preinv): New macro.
6755 2011-02-27  Torbjorn Granlund  <tege@gmplib.org>
6757         * mpn/x86/atom/sse2/mul_basecase.asm: New file.
6759 2011-02-26 Marco Bodrato <bodrato@mail.dm.unipi.it>
6761         * mpn/x86/atom/sse2/aorsmul_1.asm: Optimise non-loop code.
6763 2011-02-26  Torbjorn Granlund  <tege@gmplib.org>
6765         * mpn/powerpc64/mode64/aorsmul_1.asm: Add MULFUNC_PROLOGUE.
6766         * mpn/m68k/mc68020/aorsmul_1.asm: Likewise.
6768 2011-02-25  Torbjorn Granlund  <tege@gmplib.org>
6770         * mpn/x86/atom/sse2/aorsmul_1.asm: New file.
6771         * mpn/x86/atom/aorsmul_1.asm: File removed.
6773 2011-02-25 Marco Bodrato <bodrato@mail.dm.unipi.it>
6775         * mpn/x86/atom/sse2/divrem_1.asm: New file (was in x86/atom).
6776         * mpn/x86/atom/sse2/mul_1.asm: Likewise.
6777         * mpn/x86/atom/sse2/popcount.asm: Likewise.
6778         * mpn/x86/atom/divrem_1.asm: ReMoved (in sse2/ now).
6779         * mpn/x86/atom/mul_1.asm: Likewise.
6780         * mpn/x86/atom/popcount.asm: Likewise.
6782         * configure.in: Set up mmx path for atom.
6783         * mpn/x86/atom/mmx/copyd.asm: New file (was in x86/atom).
6784         * mpn/x86/atom/mmx/copyi.asm: Likewise.
6785         * mpn/x86/atom/mmx/hamdist.asm: Likewise.
6786         * mpn/x86/atom/copyd.asm: ReMoved (in mmx/ now).
6787         * mpn/x86/atom/copyi.asm: Likewise.
6788         * mpn/x86/atom/hamdist.asm: Likewise.
6790 2011-02-24  Torbjorn Granlund  <tege@gmplib.org>
6792         * mpn/x86/atom/sse2/mod_1_1.asm: New file.
6793         * mpn/x86/atom/sse2/mod_1_4.asm: New file.
6794         * configure.in: Set up sse2 path for atom.
6796         * mpn/x86/p6/sse2/mod_1_1.asm: New file.
6797         * mpn/x86/p6/sse2/mod_1_4.asm: Fix typo in MULFUNC_PROLOGUE.
6799 2011-02-24  Niels Möller  <nisse@lysator.liu.se>
6801         * mpn/x86/k7/mod_1_1.asm (mpn_mod_1_1p): Rewrite using the same
6802         algorithm as the x86_64 version.
6804 2011-02-23 Marco Bodrato <bodrato@mail.dm.unipi.it>
6806         * mpn/x86/atom/logops_n.asm: New file (same loop as aors_n).
6808 2011-02-23  Niels Möller  <nisse@lysator.liu.se>
6810         * mpn/x86_64/mod_1_1.asm (mpn_mod_1_1p): Shaved off one
6811         instruction and one register in the inner loop. Rearranged
6812         registers slightly, and no longer needs the callee-save register
6813         %r12.
6815 2011-02-22  Torbjorn Granlund  <tege@gmplib.org>
6817         * configure.in: Export SHLD_SLOW and SHRD_SLOW to config.m4, also
6818         fixing typo in exporting code.
6820         * mpn/x86_64/nano/gmp-mparam.h (SHLD_SLOW, SHRD_SLOW): Define.
6821         * mpn/x86_64/atom/gmp-mparam.h (SHLD_SLOW, SHRD_SLOW): Define.
6823 2011-02-22  Niels Möller  <nisse@lysator.liu.se>
6825         * mpn/x86_64/mod_1_1.asm (mpn_mod_1_1p): Rewrite.
6827 2011-02-22 Marco Bodrato <bodrato@mail.dm.unipi.it>
6829         * mpn/x86/atom/lshiftc.asm: New file (a copy of lshift.asm with a handful of neg added).
6831 2011-02-21  Torbjorn Granlund  <tege@gmplib.org>
6833         * mpn/x86/aors_n.asm: Move _nc entry to after main code.  Align loop
6834         and _n entry for claimed performance.  Normalise mnemonic usage.
6836         * mpn/x86/atom/aorrlsh1_n.asm: New file (code from rsblsh_1, slightly
6837         slower for addlsh_1 for large operands, but much faster for small).
6838         * mpn/x86/atom/addlsh1_n.asm: Remove.
6839         * mpn/x86/atom/rsblsh1_n.asm: Remove.
6841 2011-02-20  Marc Glisse  <marc.glisse@inria.fr>
6843         * mpq/aors.c: Rewrite to remove redundant division.
6845 2011-02-20  Torbjorn Granlund  <tege@gmplib.org>
6847         * mpn/x86/atom/lshift.asm: New file.
6848         * mpn/x86/atom/rshift.asm: Normalise mnemonic usage.
6850         * gmp-impl.h (mpn_divexact_by7): Relax inclusion condition.
6852         * mpz/divegcd.c (mpz_divexact_by5): New conditionally enabled function.
6853         (mpz_divexact_by3): Wrap inside appropriate conditions.
6854         (mpz_divexact_gcd): Rewrite.
6856         * mpn/x86/bdiv_dbm1c.asm: Save a jump.
6858 2011-02-20 Marco Bodrato <bodrato@mail.dm.unipi.it>
6860         * mpn/x86/atom/aorslshC_n.asm: New file.
6861         * mpn/x86/atom/sublsh2_n.asm: New file.
6863         * mpn/x86/atom/aors_n.asm: New code.
6864         * mpn/x86/atom/rshift.asm: Atom64 code adapted to 32-bit.
6865         * mpn/x86/atom/lshift.asm: Likewise.
6867 2011-02-19  Torbjorn Granlund  <tege@gmplib.org>
6869         * mpn/x86_64/atom/rsh1aors_n.asm: New file.
6871         * mpn/x86_64/atom/lshift.asm: New file.
6872         * mpn/x86_64/atom/rshift.asm: New file.
6873         * mpn/x86_64/atom/lshiftc.asm: New file.
6875 2011-02-17 Marco Bodrato <bodrato@mail.dm.unipi.it>
6877         * mpn/x86/atom/aorsmul_1.asm: Small improvements for small sizes.
6878         * mpn/x86/atom/aorrlshC_n.asm: Tiny size improvements.
6880 2011-02-16  Torbjorn Granlund  <tege@gmplib.org>
6882         * configure.in: Fix k8/k10 32-bit path setup problem.
6884 2011-02-16 Marco Bodrato <bodrato@mail.dm.unipi.it>
6886         * mpn/x86/atom/aorsmul_1.asm: Revive an old k7/aorsmul.
6888 2011-02-14 Marco Bodrato <bodrato@mail.dm.unipi.it>
6890         * gmp-impl.h (mpn_sublsh_n): Declare.
6891         * mpn/asm-defs.m4: Likewise.
6893         * mpn/x86/atom/aorrlshC_n.asm: New file (was k7).
6894         * mpn/x86/k7/aorrlshC_n.asm: ReMoved.
6895         * mpn/x86/atom/aorrlsh2_n.asm: Grab atom/aorrlshC_n.asm.
6896         * mpn/x86/atom/rsblsh1_n.asm: Grab atom/aorrlshC_n.asm.
6898 2011-02-13  Torbjorn Granlund  <tege@gmplib.org>
6900         * mpn/x86_64/atom/aorrlsh2_n.asm: New file.
6902 2011-02-12  Torbjorn Granlund  <tege@gmplib.org>
6904         * mpn/x86_64/aorrlsh_n.asm: Minor tweaks, update c/l numbers.
6906         * mpn/x86_64/atom/sublsh1_n.asm: New file.
6908         * mpn/x86_64/atom/aorrlsh1_n.asm: New file.
6910 2011-02-11  Torbjorn Granlund  <tege@gmplib.org>
6912         * mpn/powerpc64/mode64/mod_1_1.asm: Fix Darwin syntax issues.
6914 2011-02-10  Torbjorn Granlund  <tege@gmplib.org>
6916         * mpn/powerpc64/mode64/mod_1_4.asm: Tune away a cycle for 970.
6918 2011-02-11 Marco Bodrato <bodrato@mail.dm.unipi.it>
6920         * mpn/x86/k7/addlsh1_n.asm: Faster core loop (Torbjorn's).
6922         * configure.in: Add HAVE_NATIVE_{add,sub,rsb}lsh{,1,2}_nc.
6923         * tests/tests.h: refmpn_{add,sub,rsb}lsh{,1,2}_nc prototypes.
6924         * tests/refmpn.c: New refmpn_{add,sub,rsb}lsh{,1,2}_nc.
6925         * tests/devel/try.c: Tests for mpn_{add,sub,rsb}lsh{,1,2}_nc.
6927         * mpn/x86/k7/aorrlshC_n.asm: New file.
6928         * mpn/x86/atom/aorrlsh2_n.asm: Grab k7/aorrlshC_n.asm.
6929         * mpn/x86/atom/rsblsh1_n.asm: Grab k7/aorrlshC_n.asm.
6931 2011-02-06 Marco Bodrato <bodrato@mail.dm.unipi.it>
6933         * mpn/x86/k7/addlsh1_n.asm: New file.
6934         * mpn/x86/k7/sublsh1_n.asm: New file.
6935         * mpn/x86/atom/addlsh1_n.asm: Grab k7/addlsh1_n.asm.
6936         * mpn/x86/atom/sublsh1_n.asm: Grab k7/sublsh1_n.asm.
6938 2011-02-05  Torbjorn Granlund  <tege@gmplib.org>
6940         * gmp-impl.h (mpn_addlsh1_nc, mpn_addlsh2_nc, mpn_sublsh1_nc,
6941         mpn_sublsh2_nc, mpn_rsblsh1_nc, mpn_rsblsh2_nc): Declare.
6942         * mpn/asm-defs.m4: Likewise.
6944         * mpn/x86_64/coreisbr/aorrlshC_n.asm: New file.
6945         * mpn/x86_64/coreisbr/aorrlsh1_n.asm: New file.
6946         * mpn/x86_64/coreisbr/aorrlsh2_n.asm: New file.
6948         * mpn/x86_64/coreisbr/aors_n.asm: New file, based on old
6949         atom/aors_n.asm.
6950         * mpn/x86_64/atom/aors_n.asm: Grab coreisbr/aors_n.asm.
6952 2011-02-05 Marco Bodrato <bodrato@mail.dm.unipi.it>
6954         * gmp-impl.h (mpn_toom6_mul_n_itch): Handle threshold == zero.
6955         (mpn_toom8_mul_n_itch): Likewise.
6956         (MPN_TOOM6H_MIN, MPN_TOOM8H_MIN): Define.
6957         * tests/mpn/t-toom6h.c: No tests below MPN_TOOM6H_MIN.
6958         * tests/mpn/t-toom8h.c: No tests below MPN_TOOM8H_MIN.
6960         * mpz/lucnum_ui.c: Use mpn_addlsh2_n.
6962 2011-02-04  Torbjorn Granlund  <tege@gmplib.org>
6964         * mpn/x86_64/atom/rsh1aors_n.asm: Add a MULFUNC_PROLOGUE.
6965         * mpn/x86_64/atom/dive_1.asm: Likewise.
6966         * mpn/x86_64/atom/popcount.asm: Likewise.
6967         * mpn/x86_64/core2/popcount.asm: Likewise.
6968         * mpn/x86_64/coreinhm/hamdist.asm: Likewise.
6969         * mpn/x86_64/coreinhm/popcount.asm: Likewise.
6970         * mpn/x86_64/nano/popcount.asm: Likewise.
6971         * mpn/x86_64/pentium4/popcount.asm: Likewise.
6973 2011-02-04 Marco Bodrato <bodrato@mail.dm.unipi.it>
6975         * mpn/x86/atom/mode1o.asm: New file, grabbing another asm file.
6976         * mpn/x86/atom/mul_1.asm: Claim mul_1c.
6978 2011-02-02  Niels Möller  <nisse@lysator.liu.se>
6980         * tune/speed.h (SPEED_ROUTINE_MPN_HGCD_CALL): Fixed one
6981         speed_operand_dst call.
6983 2011-02-01  Torbjorn Granlund  <tege@gmplib.org>
6985         * tune/speed.h (struct speed_params): Allow for 4 dst operands.
6986         * tune/common.c (TOLERANCE): Increase from 0.5% to 1%.
6988         * tune/speed.h (SPEED_ROUTINE_MPN_HGCD_CALL): New macro, mainly based
6989         on old speed_mpn_hgcd, but with speed_operand_src calls (as suggested
6990         by Niels).
6991         * tune/common.c (speed_mpn_hgcd): Invoke SPEED_ROUTINE_MPN_HGCD_CALL.
6992         (speed_mpn_hgcd_lehmer): Likewise.
6994         * configure.in: Set up 32-bit x86 paths for new corei* CPU strings.
6996 2011-01-31  Torbjorn Granlund  <tege@gmplib.org>
6998         * config.guess: Recognise new Intel processors.
7000         * config.guess: Support 'coreinhm' and 'coreisbr'.
7001         * config.sub: Likewise.
7002         * configure.in: Likewise.
7004 2011-01-30  Torbjorn Granlund  <tege@gmplib.org>
7006         * configure.in: Support x86/geode.
7007         * mpn/x86/geode/gmp-mparam.h: New file.
7009 2011-01-29 Marco Bodrato <bodrato@mail.dm.unipi.it>
7011         * mpn/x86/atom/addlsh1_n.asm: Removed.
7012         * mpn/x86/atom/rsh1add_n.asm: Likewise.
7014 2011-01-28  Torbjorn Granlund  <tege@gmplib.org>
7016         * mpn/alpha/ev6/slot.pl: Add some missing insns.
7018 2011-01-28 Marco Bodrato <bodrato@mail.dm.unipi.it>
7020         * mpn/x86/atom/copyd.asm: New file, grabbing another asm file.
7021         * mpn/x86/atom/copyi.asm: Likewise.
7022         * mpn/x86/atom/aors_n.asm: Likewise.
7023         * mpn/x86/atom/addlsh1_n.asm: Likewise.
7024         * mpn/x86/atom/aorsmul_1.asm: Likewise.
7025         * mpn/x86/atom/bdiv_q_1.asm: Likewise.
7026         * mpn/x86/atom/dive_1.asm: Likewise.
7027         * mpn/x86/atom/divrem_1.asm: Likewise.
7028         * mpn/x86/atom/hamdist.asm: Likewise.
7029         * mpn/x86/atom/logops_n.asm: Likewise.
7030         * mpn/x86/atom/lshift.asm: Likewise.
7031         * mpn/x86/atom/mod_34lsub1.asm: Likewise.
7032         * mpn/x86/atom/mul_1.asm: Likewise.
7033         * mpn/x86/atom/mul_basecase.asm: Likewise.
7034         * mpn/x86/atom/popcount.asm: Likewise.
7035         * mpn/x86/atom/rsh1add_n.asm: Likewise.
7036         * mpn/x86/atom/rshift.asm: Likewise.
7037         * mpn/x86/atom/sqr_basecase.asm: Likewise.
7039 2011-01-27  Torbjorn Granlund  <tege@gmplib.org>
7041         * mpn/x86_64/atom/rsh1aors_n.asm: New file, grabbing another asm file.
7042         * mpn/x86_64/atom/popcount.asm: Likewise.
7043         * mpn/x86_64/atom/dive_1.asm: Likewise.
7044         * mpn/x86_64/nano/popcount.asm: Likewise.
7046 2011-01-26  Torbjorn Granlund  <tege@gmplib.org>
7048         * mpn/alpha/invert_limb.asm: Complete rewrite.
7050 2011-01-25  Torbjorn Granlund  <tege@gmplib.org>
7052         * mpn/powerpc32/invert_limb.asm: New file.
7054 2011-01-25 Marco Bodrato <bodrato@mail.dm.unipi.it>
7056         * mpn/x86/pentium4/sse2/bdiv_q_1.asm: New file.
7057         * mpn/x86/k7/bdiv_q_1.asm: New file.
7059 2011-01-24  Torbjorn Granlund  <tege@gmplib.org>
7061         * tune/tuneup.c (tune_mul_n, tune_sqr): Loop, re-measuring thresholds
7062         until no tiny ranges remain.
7064 2011-01-23  Torbjorn Granlund  <tege@gmplib.org>
7066         * mpn/ia64/mul_2.asm: Tweak to 1.5 c/l, less overhead.
7068         * mpn/ia64/addmul_2.asm: Rewrite, adding mpn_addmul_2s entry point.
7070 2011-01-22  Torbjorn Granlund  <tege@gmplib.org>
7072         * mpn/ia64/aors_n.asm: Fix some incorrect bundle types.
7074         * mpn/ia64/sqr_diagonal.asm: Remove.
7076         * mpn/ia64/sqr_diag_addlsh1.asm: New file.
7078         * mpn/ia64/ia64-defs.m4: Define some shorter convenience mnemonics.
7080         * mpn/generic/sqr_basecase.c (MPN_SQR_DIAG_ADDLSH1): New macro, using
7081         new function mpn_sqr_diag_addlsh1 or defining its equivalent.
7083         * gmp-impl.h (mpn_addmul_2s): Declare.
7084         (mpn_sqr_diag_addlsh1): Declare.
7085         * mpn/asm-defs.m4 (define_mpn): Add addmul_2s and sqr_diag_addlsh1.
7087         * configure.in: Add HAVE_NATIVEs for mpn_sqr_diag_addlsh1 and
7088         mpn_addmul_2s.
7089         (gmp_mpn_functions_optional): Add sqr_diag_addlsh1.
7091 2011-01-21 Marco Bodrato <bodrato@mail.dm.unipi.it>
7093         * tests/devel/try.c: Initial support for mpn_bdiv_q_1.
7094         * mpn/x86/pentium/bdiv_q_1.asm: New file.
7095         * mpn/x86/p6/bdiv_q_1.asm: New file.
7097 2011-01-20  Torbjorn Granlund  <tege@gmplib.org>
7099         * tune/speed.c (run_gnuplot): Update to current gnuplot syntax.
7101         * mpn/powerpc64/mode64/aorsmul_1.asm: Trim away 0.5 c/l for submul_1
7102         for POWER5.
7104 2011-01-19  Torbjorn Granlund  <tege@gmplib.org>
7106         * mpn/x86_64/core2/rsh1aors_n.asm: New file.
7108 2011-01-18 Marco Bodrato <bodrato@mail.dm.unipi.it>
7110         * mpn/x86/bdiv_q_1.asm: New file (same core alg. as dive_1).
7112 2011-01-15 Marco Bodrato <bodrato@mail.dm.unipi.it>
7114         * mpn/generic/divexact.c: Avoid COPY if not needed.
7116 2011-01-14  Torbjorn Granlund  <tege@gmplib.org>
7118         * gmp-impl.h (struct cpuvec_t): Add field bmod_1_to_mod_1_threshold.
7119         * configure.in (fat_thresholds): Add BMOD_1_TO_MOD_1_THRESHOLD.
7121 2011-01-13 Marco Bodrato <bodrato@mail.dm.unipi.it>
7123         * mpz/mul.c: Remove redundant size computation.
7125 2011-01-08  Torbjorn Granlund  <tege@gmplib.org>
7127         * tests/devel/try.c (types enum): Add TYPE_MUL_5 and TYPE_MUL_6.
7128         (param_init): Support new types.
7129         (choice_array): Support testing of mpn_mul_5 and mpn_mul_6.
7130         (call): Support new routines.
7132         * tests/refmpn.c (refmpn_mul_5, refmpn_mul_6): New functions.
7133         * tests/tests.h (refmpn_mul_5, refmpn_mul_6): Declare.
7134         Remove parameter names from some other functions.
7136         * gmp-impl.h (mpn_mul_5, mpn_mul_6): Declare.
7137         * mpn/asm-defs.m4: Likewise, also declare mpn_addmul_5, mpn_addmul_6,
7138         mpn_addmul_7, and mpn_addmul_8.
7140         * configure.in (gmp_mpn_functions_optional): Add mul_5 and mul_6.
7142         * tune/speed.c (routine): Add measuring of mpn_mul_5 and mpn_mul_6.
7143         * tune/common.c (speed_mpn_mul_5, speed_mpn_mul_6): New functions.
7144         * tune/speed.h: Declare new functions.
7146 2011-01-03 Marco Bodrato <bodrato@mail.dm.unipi.it>
7148         * mpz/aors.h: Remove #ifdef BERKELEY_MP, and cleanup.
7149         * mpz/cmp.c: Likewise.
7150         * mpz/gcd.c: Likewise.
7151         * mpz/mul.c: Likewise.
7152         * mpz/powm.c: Likewise.
7153         * mpz/set.c: Likewise.
7154         * mpz/sqrtrem.c: Likewise.
7155         * mpz/tdiv_qr.c: Likewise.
7157 2010-12-28  Torbjorn Granlund  <tege@gmplib.org>
7159         * mpn/minithres/gmp-mparam.h: Update with several recent thresholds.
7161 2010-12-19  Torbjorn Granlund  <tege@gmplib.org>
7163         * mpn/x86/k7/mod_1_1.asm: Canonicalise cmov forms.
7164         * mpn/x86/k7/mod_1_4.asm: Likewise.
7165         * mpn/x86/pentium4/sse2/mod_1_1.asm: Likewise.
7166         * mpn/x86/pentium4/sse2/mod_1_4.asm: Likewise.
7167         * mpn/x86_64/core2/divrem_1.asm: Likewise.
7168         * mpn/x86_64/divrem_1.asm: Likewise.
7169         * mpn/x86_64/mod_1_1.asm: Likewise.
7170         * mpn/x86_64/mod_1_2.asm: Likewise.
7171         * mpn/x86_64/mod_1_4.asm: Likewise.
7173         * mpn/x86/k7/gcd_1.asm: Rewrite.  Remove slow 'div' loop.  Call
7174         mpn_mod_1 for operands with mode than BMOD_1_TO_MOD_1_THRESHOLD limbs.
7175         Misc cleanups.
7177 2010-12-18  Torbjorn Granlund  <tege@gmplib.org>
7179         * mpn/x86_64/gcd_1.asm: Call mpn_mod_1 for operands with mode than
7180         BMOD_1_TO_MOD_1_THRESHOLD limbs.
7182         * configure.in: Generalise code for putting THRESHOLDs in config.m4.
7183         Add BMOD_1_TO_MOD_1_THRESHOLD to list.
7185         * mpn/x86_64/core2/divrem_1.asm: Tweak slightly, correct cycle counts.
7187         * mpn/x86_64/addmul_2.asm: Remove constant index.
7188         * mpn/x86_64/lshiftc.asm: Likewise.
7189         * mpn/x86_64/pentium4/lshift.asm: Likewise.
7190         * mpn/x86_64/pentium4/lshiftc.asm: Likewise.
7191         * mpn/x86_64/pentium4/rshift.asm: Likewise.
7193 2010-12-16  Torbjorn Granlund  <tege@gmplib.org>
7195         * mpn/x86_64/mod_34lsub1.asm: Complete rewrite.
7196         * mpn/x86_64/pentium4/mod_34lsub1.asm: New file, old
7197         mpn/x86_64/mod_34lsub1.asm.
7199 2010-12-15  Torbjorn Granlund  <tege@gmplib.org>
7201         * mpn/powerpc64/vmx/popcount.asm: Rewrite to use vperm count table.
7203 2010-12-14  Torbjorn Granlund  <tege@gmplib.org>
7205         * mp-h.in: Remove.
7206         * configure.in: Remove mp-h.in from AC_OUTPUT invocation.
7208 2010-12-13  Torbjorn Granlund  <tege@gmplib.org>
7210         * mpz/mod.c: Rewrite.
7212         * mpn/x86_64/corei/popcount.asm: New file.
7213         * mpn/x86_64/corei/hamdist.asm: New file.
7215         * mpn/x86_64/k10/hamdist.asm: New file.
7217         * configure.in: Amend last change for lame /bin/sh.
7219 2010-12-12  Torbjorn Granlund  <tege@gmplib.org>
7221         * configure.in: Comment out M4=m4-not-needed.
7223         * mpn/x86_64/k10/popcount.asm: New file.
7224         * configure.in: Setup special path for k10 and later AMD CPUs.
7225         Remove special x86_64'k8' path, since directory is non-existent.
7227 2010-12-11  Torbjorn Granlund  <tege@gmplib.org>
7229         * mpn/sparc32/ultrasparct1: New directory.
7230         * mpn/sparc32/ultrasparct1/add_n.asm: New file.
7231         * mpn/sparc32/ultrasparct1/sub_n.asm: New file.
7232         * mpn/sparc32/ultrasparct1/mul_1.asm: New file.
7233         * mpn/sparc32/ultrasparct1/addmul_1.asm: New file.
7234         * mpn/sparc32/ultrasparct1/submul_1.asm: New file.
7235         * mpn/sparc32/ultrasparct1/sqr_diagonal.asm: New file.
7237         * config.guess: Support Ultrasparc T2 and T3.
7238         * config.sub: Likewise.
7239         * configure.in: Likewise.
7241         * config.guess: Generalise BSD Sparc recognition by allowing any
7242         caps (needed for OpenBSD which spells things innovatively).
7244 2010-12-01  Torbjorn Granlund  <tege@gmplib.org>
7246         * config.guess: Match new AMD processors, allow finer distinctions
7247         among old ones.
7248         * acinclude.m4 (X86_64_PATTERN): Likewise.
7249         * config.sub: Likewise.
7250         * configure.in: Rudimentarily support new AMD processors.
7252         * configure.in (--enable_assembly): New option.
7253         (target none-*-*): Disable, give error.
7255 2010-11-29  Torbjorn Granlund  <tege@gmplib.org>
7257         * mpn/x86/x86-defs.m4 (LEA): Support non-PIC code.
7258         * mpn/x86/darwin.m4 (LEA): Likewise.
7260         * tests/amd64call.asm: Rewrite for code size, and to match calls and
7261         returns.
7263         * tests/x86call.asm: Rewrite for code size, to support PIC, and to
7264         match calls and returns.
7265         * tests/x86check.c: Rewrite.
7267 2010-11-22  Torbjorn Granlund  <tege@gmplib.org>
7269         * mpz/get_str.c: Make all bases either work or return an error.
7270         * mpz/out_str.c: Likewise.
7271         * mpq/get_str.c: Likewise.
7272         * mpf/get_str.c: Likewise.
7274 2010-11-14  Torbjorn Granlund  <tege@gmplib.org>
7276         * tests/misc/t-printf.c: Add explicit casts for type conversions.
7277         * mpn/generic/toom62_mul.c: Likewise.
7279 2010-11-13  Torbjorn Granlund  <tege@gmplib.org>
7281         * mpn/generic/get_d.c: Misc cleanup.  Fail with a syntax error for
7282         non-IEEE fp formats.
7284         * tests/devel/try.c (malloc_region): Add explicit casts for type
7285         conversions.
7287         * acinclude.m4 (GMP_ASM_RODATA): Make test code snippet C++ compatible.
7288         (GMP_C_DOUBLE_FORMAT): Likewise.
7289         (GMP_FUNC_VSNPRINTF): Likewise.
7291         * config.guess (x86): Make test C snippet C++ compatible.
7293 2010-11-12  Torbjorn Granlund  <tege@gmplib.org>
7295         * Makefile.am: Remove mpbsd.
7296         * configure.in: Remove mpbsd.
7297         * doc/configuration: Remove mpbsd mentions.
7298         * doc/gmp.texi: Remove mpbsd docs.
7299         * tests/Makefile.am: Remove mpbsd.
7300         * libmp.sym: Remove.
7301         * mpbsd: Remove directory and files.
7302         * tests/mpbsd: Remove directory and files.
7304 2010-11-11  Torbjorn Granlund  <tege@gmplib.org>
7306         * mpn/x86_64/atom/aors_n.asm: Don't rely on ZF after 'bt' insn.
7307         Use 64-bit 'test' to support operands of 2^32 limbs and more.
7309         * rand: New directory, move rand*.c and randmt.h here.
7310         * rand/Makefile.am: New file.
7311         * Makefile.am (SUBDIRS): Add rand.
7312         (RANDOM_OBJECTS): New variable.
7313         (libgmp_la_SOURCES): Remove random objects.
7314         (libgmp_la_DEPENDENCIES): Add RANDOM_OBJECTS.
7315         * configure.in (AC_OUTPUT): Add rand/Makefile.
7317         * ansi2knr.1: File removed.
7318         * ansi2knr.c: File removed.
7320 2010-11-10  Torbjorn Granlund  <tege@gmplib.org>
7322         Make it possible to compile GMP with g++:
7324         * gmp-impl.h: Declare __gmp_digit_value_tab here.
7325         * mpbsd/min.c: ...not here.
7326         * mpbsd/xtom.c: ...nor here.
7327         * mpf/set_str.c: ...nor here.
7328         * mpz/inp_str.c: ...nor here.
7329         * mpz/set_str.c: ...nor here.
7331         * mpn/generic/toom43_mul.c: Add casts for logical operations on enums.
7332         * mpn/generic/toom44_mul.c: Likewise.
7333         * mpn/generic/toom4_sqr.c: Likewise.
7334         * mpn/generic/toom52_mul.c: Likewise.
7335         * mpn/generic/toom53_mul.c: Likewise.
7336         * mpn/generic/toom62_mul.c: Likewise.
7338         * mpz/clrbit.c: Clean up typing using MPZ_REALLOC.
7339         * mpz/setbit.c: Likewise.
7341         * mpz/powm.c: Avoid variable name 'new'.
7343         * randlc2x.c: Add explicit casts for type conversions.
7344         * tests/misc/t-printf.c: Likewise.
7345         * tests/misc/t-scanf.c: Likewise.
7346         * tests/misc.c: Likewise.
7347         * tests/mpz/convert.c: Likewise.
7348         * tests/refmpn.c: Likewise.
7350         * tests/tests.h: Unconditionally use <sstream> for now.
7352         * tests/memory.c: Include "tests.h.
7354         * mp_get_fns.c: Add a __GMP_NOTHROW for coherency with prototype.
7355         * mp_set_fns.c: Likewise.
7356         * mpf/cmp.c: Likewise.
7357         * mpf/cmp_si.c: Likewise.
7358         * mpf/cmp_ui.c: Likewise.
7359         * mpf/fits_s.h: Likewise.
7360         * mpf/fits_u.h: Likewise.
7361         * mpf/get_dfl_prec.c: Likewise.
7362         * mpf/get_prc.c: Likewise.
7363         * mpf/get_si.c: Likewise.
7364         * mpf/get_ui.c: Likewise.
7365         * mpf/int_p.c: Likewise.
7366         * mpf/set_dfl_prec.c: Likewise.
7367         * mpf/set_prc_raw.c: Likewise.
7368         * mpf/size.c: Likewise.
7369         * mpf/swap.c: Likewise.
7370         * mpq/equal.c: Likewise.
7371         * mpq/swap.c: Likewise.
7372         * mpz/cmp.c: Likewise.
7373         * mpz/cmp_si.c: Likewise.
7374         * mpz/cmp_ui.c: Likewise.
7375         * mpz/cmpabs.c: Likewise.
7376         * mpz/cmpabs_ui.c: Likewise.
7377         * mpz/cong_2exp.c: Likewise.
7378         * mpz/divis_2exp.c: Likewise.
7379         * mpz/fits_s.h: Likewise.
7380         * mpz/get_si.c: Likewise.
7381         * mpz/hamdist.c: Likewise.
7382         * mpz/scan0.c: Likewise.
7383         * mpz/scan1.c: Likewise.
7384         * mpz/sizeinbase.c: Likewise.
7385         * mpz/swap.c: Likewise.
7386         * mpz/tstbit.c: Likewise.
7387         * tal-reent.c: Likewise.
7389 2010-11-09  Torbjorn Granlund  <tege@gmplib.org>
7391         * configure.in: Get rid of K&R support.
7392         * Makefile.am: Likewise.
7393         * mpn/Makefile.am: Likewise.
7394         * doc/configuration: Update docs wrt K&R support.
7395         * doc/gmp.texi: Likewise.
7397         * configure.in (AC_INIT): Amend bug reporting address with manual
7398         reference.
7400 2010-11-06  Torbjorn Granlund  <tege@gmplib.org>
7402         * config.guess: If cpuid says we have 32bit-only x86 but
7403         configfsf.guess return x86_64, return the latter.
7405         * mpn/x86_64/aors_n.asm: Rewrite not to rely on ZF after 'bt' insn.
7407 2010-10-09  Torbjorn Granlund  <tege@gmplib.org>
7409         * mpn/generic/trialdiv.c: Update documentation.
7411 2010-10-04  Torbjorn Granlund  <tege@gmplib.org>
7413         * mpn/x86_64/gcd_1.asm: Use m4_lshift to avoid << operator.
7414         * mpn/x86_64/aorrlshC_n.asm: Likewise.
7415         * mpn/x86_64/pentium4/aorslshC_n.asm: Likewise.
7416         * mpn/x86/k7/gcd_1.asm: Likewise.
7418 2010-08-20  Niels Möller  <nisse@lysator.liu.se>
7420         Suggested by Ozkan Sezer:
7421         * configure.in: If $M4 is already set in the environment, don't
7422         touch it. Fixed the case that no assembler files are used, and
7423         GMP_PROG_M4 is omitted.
7425 2010-08-08  Torbjorn Granlund  <tege@gmplib.org>
7427         * mpn/x86_64/fat/fat.c: Recognise many more processors.
7429 2010-06-30  Torbjorn Granlund  <tege@gmplib.org>
7431         * mpn/x86_64/divrem_2.asm: Tune.
7433 2010-06-19  Niels Möller  <nisse@lysator.liu.se>
7435         * tune/speed.h (SPEED_ROUTINE_MPN_MOD_1_1): Pass normalized
7436         divisor to the benchmarked function.
7438 2010-06-15  Torbjorn Granlund  <tege@gmplib.org>
7440         * mpn/x86_64/mod_1_1.asm (mpn_mod_1_1p_cps): Rewrite.
7441         * mpn/x86_64/mod_1_2.asm (mpn_mod_1s_2p_cps): Rewrite.
7442         * mpn/x86_64/mod_1_4.asm (mpn_mod_1s_4p_cps): Rewrite.
7444         * gmp-impl.h (udiv_rnd_preinv): Simplify.
7446         * mpn/x86/k7/mod_1_1.asm: New file.
7447         * mpn/x86/pentium4/sse2/mod_1_1.asm (mpn_mod_1_1p_cps): Rewrite.
7448         * mpn/x86/k7/mod_1_4.asm (mpn_mod_1s_4p_cps): Rewrite.
7449         * mpn/x86/pentium4/sse2/mod_1_4.asm (mpn_mod_1s_4p_cps): Rewrite.
7451         * mpn/generic/mod_1_1.c (mpn_mod_1_1p_cps): Store results as they are
7452         computed.
7453         * mpn/generic/mod_1_2.c (mpn_mod_1s_2p_cps): Likewise.
7454         * mpn/generic/mod_1_4.c (mpn_mod_1s_4p_cps): Likewise.
7456         * mpn/x86/k7/invert_limb.asm: Moved from mpn/x86/invert_limb.asm.
7458 2010-06-15  Niels Möller  <nisse@lysator.liu.se>
7460         * tests/mpn/Makefile.am (check_PROGRAMS): Added t-mod_1.
7461         * tests/mpn/t-mod_1.c: New file.
7463 2010-05-25  Torbjorn Granlund  <tege@gmplib.org>
7465         * mpn/generic/mu_div_qr.c (mpn_preinv_mu_div_qr_itch): Trim out space
7466         for inverse, since that is passed in already.
7468 2010-05-24  Torbjorn Granlund  <tege@gmplib.org>
7470         * mpn/generic/mu_div_qr.c (mpn_preinv_mu_div_qr_itch): New function.
7471         * gmp-impl.h: Declare it.
7472         * tune/common.c (speed_mpn_mupi_div_qr): Use new itch function.
7473         * tune/speed.h (SPEED_ROUTINE_MPN_MUPI_DIV_QR): Pass parameters right
7474         for new itch function.
7476         * mpn/powerpc32/lshiftc.asm: New file.
7478 2010-05-22  Torbjorn Granlund  <tege@gmplib.org>
7480         * tune/tuneup.c (tune_mod_1): Revert to version of 2010-05-06.
7482 2010-05-17  Torbjorn Granlund  <tege@gmplib.org>
7484         * configure.in (ia64): Get 32-bit sizeof test right.
7486         * tune/tuneup.c (tune_mod_1): Undo unintensional change to tuning of
7487         PREINV_MOD_1_TO_MOD_1_THRESHOLD.
7489 2010-05-16  Torbjorn Granlund  <tege@gmplib.org>
7491         * mpn/sparc64/mod_1.c: Rewrite.
7492         * mpn/sparc64/sparc64.h (umul_ppmm_s): New macro.
7493         * mpn/sparc64/mod_1_4.c: New file.
7495         * mpn/generic/divrem_1.c: Minor cleanup.
7496         * mpn/generic/mod_1.c: Likewise.
7497         * mpn/generic/mod_1_1.c: Likewise.
7498         * mpn/generic/mod_1_2.c: Likewise.
7499         * mpn/generic/mod_1_3.c: Likewise.
7500         * mpn/generic/mod_1_4.c: Likewise.
7502         * configure.in (ia64-hpux): Do sizeof tests for 32-bit and 64-bit ABI.
7504         * tune/tuneup.c (tune_mod_1): Completely finish MOD_1_N tuning before
7505         tuning MOD_1U_TO_MOD_1_1_THRESHOLD.
7507 2010-05-14  Torbjorn Granlund  <tege@gmplib.org>
7509         * mpn/generic/redc_2.c: Use asm code just for GNU C.
7511 2010-05-13  Torbjorn Granlund  <tege@gmplib.org>
7513         * mpn/sparc64/ultrasparc1234: New directory.  Move all code that uses
7514         floating-point into this directory.
7515         * configure.in: Point to ultrasparc1234 for appropriate CPUs.
7517         * mpn/sparc64/ultrasparct1/add_n.asm: New file.
7518         * mpn/sparc64/ultrasparct1/addlsh2_n.asm: New file.
7519         * mpn/sparc64/ultrasparct1/addmul_1.asm: New file.
7520         * mpn/sparc64/ultrasparct1/lshift.asm: New file.
7521         * mpn/sparc64/ultrasparct1/mul_1.asm: New file.
7522         * mpn/sparc64/ultrasparct1/rsblsh2_n.asm: New file.
7523         * mpn/sparc64/ultrasparct1/rshift.asm: New file.
7524         * mpn/sparc64/ultrasparct1/sublsh1_n.asm: New file.
7525         * mpn/sparc64/ultrasparct1/sublshC_n.asm: New file.
7526         * mpn/sparc64/ultrasparct1/addlsh1_n.asm: New file.
7527         * mpn/sparc64/ultrasparct1/addlshC_n.asm: New file.
7528         * mpn/sparc64/ultrasparct1/lshiftc.asm: New file.
7529         * mpn/sparc64/ultrasparct1/rsblsh1_n.asm: New file.
7530         * mpn/sparc64/ultrasparct1/rsblshC_n.asm: New file.
7531         * mpn/sparc64/ultrasparct1/sub_n.asm: New file.
7532         * mpn/sparc64/ultrasparct1/sublsh2_n.asm: New file.
7533         * mpn/sparc64/ultrasparct1/submul_1.asm: New file.
7534         * mpn/sparc64/ultrasparct1/gmp-mparam.h: New file.
7536         * configure.in: Give ultrasparct1 and ultrasparct2 special code path.
7538         * mpn/x86_64/pentium4/gmp-mparam.h: Disable mpn_addlsh_n, mpn_rsblsh_n.
7540 2010-05-12  Niels Möller  <nisse@lysator.liu.se>
7542         * mpz/jacobi.c (mpz_jacobi): Fixed off-by-one error in use of
7543         scratch space.
7545         * tune/common.c (speed_mpz_powm_sec): New function.
7546         * tune/speed.h: Declare speed_mpz_powm_sec.
7547         * tune/speed.c (routine): Added speed_mpz_powm_sec.
7549         * tune/common.c (speed_mpn_addlsh_n, speed_mpn_sublsh_n)
7550         (speed_mpn_rsblsh_n): New functions.
7551         * tune/speed.h: Declare new functions.
7552         * tune/speed.c (routine): Add new functions.
7554 2010-05-12  Torbjorn Granlund  <tege@gmplib.org>
7556         * mpn/x86_64/mod_1_4.asm: Tune for more processors.
7558         * mpn/x86_64/pentium4/lshiftc.asm: New file.
7560 2010-05-11  Niels Möller  <nisse@lysator.liu.se>
7562         * mpz/jacobi.c (mpz_jacobi): Deleted old implementation.
7563         Reorganized new implementation, to handle small inputs efficiently.
7565         * tests/mpz/t-jac.c (check_large_quotients): Reduced test sizes.
7566         (check_data): One more input pair related to a fixed bug.
7567         (main): Enable check_large_quotients.
7569 2010-05-10  Torbjorn Granlund  <tege@gmplib.org>
7571         * mpn/x86_64/aorrlsh2_n.asm: Fix typo.
7573 2010-05-09  Torbjorn Granlund  <tege@gmplib.org>
7575         * mpn/x86_64/aorrlshC_n.asm: New file based on aorrlsh2_n.asm.
7576         * mpn/x86_64/aorrlsh2_n.asm: Now just include aorrlshC_n.asm.
7577         * mpn/x86_64/core2/aorrlsh1_n.asm: New file, include ../aorrlshC_n.asm.
7578         * mpn/x86_64/core2/aorrlsh2_n.asm: Likewise.
7580         * mpn/x86_64/core2/sublshC_n.asm: New file based on aorslsh1_n.asm.
7581         * mpn/x86_64/core2/aorslsh1_n.asm: Remove.
7582         * mpn/x86_64/core2/sublsh1_n.asm: Just include sublshC_n.asm.
7583         * mpn/x86_64/core2/sublsh2_n.asm: Likewise.
7585 2010-05-08  Torbjorn Granlund  <tege@gmplib.org>
7587         * mpn/x86_64/atom/gmp-mparam.h: Disable mpn_rsh1add_n, mpn_rsh1sub_n.
7589         * mpn/x86_64/pentium4/aorslshC_n.asm: New file based on aorslsh1_n.asm.
7590         * mpn/x86_64/pentium4/aorslsh1_n.asm: Now just include aorslshC_n.asm.
7591         * mpn/x86_64/pentium4/aorslsh2_n.asm: New file.
7593 2010-05-07  Torbjorn Granlund  <tege@gmplib.org>
7595         * mpn/sparc64: Support operands of >= 2^32 limbs.
7597         * mpn/sparc64/lshiftc.asm: New file.
7599         * mpn/ia64/divrem_2.asm: Complete rewrite.
7601 2010-05-06  Torbjorn Granlund  <tege@gmplib.org>
7603         * tune/tuneup.c (all): Don't call tune_divrem_2.
7605         * mpn/generic/divrem_2.c: Complete rewrite.
7607         * tune/tuneup.c (tune_mod_1): Fix typo.
7609 2010-05-05  Torbjorn Granlund  <tege@gmplib.org>
7611         * mpn/x86_64/mod_1_1.asm (mpn_mod_1_1p): Use macro register names.
7612         (mpn_mod_1_1p_cps): Rewrite.
7614         * mpn/generic/mod_1_1.c (mpn_mod_1_1p_cps): Micro-optimise.
7616         * longlong.h: Undo 2009-03-01 change for powerpc64, it gives poor code.
7618         * mpn/x86/pentium4/sse2/mod_1_1.asm: New file.
7620         * mpn/powerpc64/mode64/mod_1_1.asm: New file.
7622         * tune/tuneup.c (tune_mod_1): Use more typical divisor, for the benefit
7623         of machines with early-out multipliers.
7625 2010-05-04  Torbjorn Granlund  <tege@gmplib.org>
7627         * tune/tuneup.c (tune_mod_1): Fix typo.
7629         * mpn/generic/mod_1_1.c: Undo last change.
7630         * mpn/x86_64/mod_1_1.asm: Likewise.
7632 2010-05-03  Niels Möller  <nisse@lysator.liu.se>
7634         * mpn/generic/jacobi_lehmer.c (jacobi_hook): New function.
7635         (mpn_jacobi_subdiv_step): Deleted function.
7636         (mpn_jacobi_lehmer): Use general mpn_gcd_subdiv_step.
7638         * mpn/generic/gcd_subdiv_step.c (mpn_gcd_subdiv_step): Reorganized
7639         to use a single hook function.
7640         * mpn/generic/gcdext.c (mpn_gcdext): Adapted to new hook
7641         interface.
7642         * mpn/generic/gcdext_lehmer.c (mpn_gcdext_hook): New unified hook
7643         function.
7644         * mpn/generic/gcd.c (gcd_hook): Renamed from gcd_done, and adapted
7645         to new hook interface.
7646         * gmp-impl.h (gcd_subdiv_step_hook): New typedef, now a function
7647         type, not a struct.
7648         (mpn_gcdext_hook): Declare.
7650 2010-05-03  Torbjorn Granlund  <tege@gmplib.org>
7652         * mpn/generic/mod_1_1.c: Avoid multiply for 2 limb feed-in.
7653         * mpn/generic/mod_1_2.c: Likewise.
7654         * mpn/generic/mod_1_3.c: Likewise.
7655         * mpn/generic/mod_1_4.c: Likewise.
7656         * mpn/x86_64/mod_1_1.asm: Likewise.
7657         * mpn/x86_64/mod_1_2.asm: Likewise.
7658         * mpn/x86_64/mod_1_4.asm: Likewise.
7659         * mpn/x86/k7/mod_1_4.asm: Likewise.
7660         * mpn/x86/pentium4/sse2/mod_1_4.asm: Likewise.
7661         * mpn/alpha/ev6/mod_1_4.asm: Likewise.
7663         * tune/tuneup.c (tune_mod_1): Measure MOD_1_1_TO_MOD_1_2_THRESHOLD and
7664         MOD_1_2_TO_MOD_1_4_THRESHOLD before MOD_1U_TO_MOD_1_1_THRESHOLD for
7665         correctness.
7667         * mpn/powerpc64/sqr_diagonal.asm: Complete rewrite.
7669         * mpn/powerpc64/mode64/mod_1_4.asm: New file.
7671 2010-05-02  Torbjorn Granlund  <tege@gmplib.org>
7673         * config.guess: Recognise power7.
7675         * configure.in: Major overhaul of powerpc support.
7677         * mpn/powerpc64/p6/lshift.asm: New file.
7678         * mpn/powerpc64/p6/lshiftc.asm: Likewise.
7679         * mpn/powerpc64/p6/rshift.asm: Likewise.
7681 2010-04-30  Torbjorn Granlund  <tege@gmplib.org>
7683         * configure.in (powerpc64): Support CPU specific mode-less subdirs.
7685         * mpn/powerpc64/aix.m4 (PROLOGUE_cpu): Use "named csect" making
7686         requested alignment actually honoured.
7688 2010-04-30  Niels Möller  <nisse@lysator.liu.se>
7690         * mpn/generic/jacobi_lehmer.c (mpn_jacobi_2): Fixed handling of
7691         the case bl == 1. Fixed missing application of reciprocity.
7693 2010-04-29  Niels Möller  <nisse@lysator.liu.se>
7695         * configure.in (gmp_mpn_functions): Deleted gcdext_subdiv_step.
7697         * mpn/generic/gcdext.c (mpn_gcdext): Use new generalized
7698         mpn_gcd_subdiv_step.
7700         * mpn/generic/gcdext_lehmer.c (gcdext_update): New function.
7701         (gcdext_done): New function.
7702         (gcdext_hook): New const hook struct.
7703         (mpn_gcdext_lehmer_n): Use new generalized mpn_gcd_subdiv_step.
7705         * mpn/generic/gcd.c (gcd_done): New function.
7706         (gcd_hook): New const hook struct.
7707         (mpn_gcd): Adapted to new mpn_gcd_subdiv_step interface.
7709         * mpn/generic/gcd_subdiv_step.c (mpn_gcd_subdiv_step): Reorganized
7710         function. Added hook function pointers to the argument list, so
7711         the same function can be used for gcd, gcdext, and jacobi.
7713         * gmp-impl.h (struct gcd_subdiv_step_hook): New struct.
7714         (mpn_gcdext_subdiv_step): Deleted prototype.
7715         (struct gcdext_ctx): New struct.
7716         (gcdext_hook): Declare const struct.
7717         (mpn_gcd_subdiv_step): Updated prototype.
7719         * mpn/generic/gcdext_subdiv_step.c: Deleted file.
7721 2010-04-28  Torbjorn Granlund  <tege@gmplib.org>
7723         * mpn/powerpc64/lshift.asm: Rewrite.
7724         * mpn/powerpc64/rshift.asm: Likewise.
7725         * mpn/powerpc64/mode64/lshiftc.asm: New file.
7727         * mpn/powerpc64/aix.m4: Align functions to 32-byte boundary.
7728         * mpn/powerpc64/darwin.m4: Likewise.
7729         * mpn/powerpc64/elf.m4: Likewise.
7731 2010-04-28  Niels Möller  <nisse@lysator.liu.se>
7733         * tests/mpz/t-jac.c (check_data): Added some more test cases.
7735         * mpn/generic/jacobi_lehmer.c (mpn_jacobi_2): Bugfix, count
7736         trailing zeros, not leading.
7738 2010-04-27  Torbjorn Granlund  <tege@gmplib.org>
7740         * mpn/powerpc64/mode64/p6/mul_basecase.asm: New file.
7742 2010-04-23  Niels Möller  <nisse@lysator.liu.se>
7744         * gmp-impl.h (MPN_GCD_LEHMER_N_ITCH): Deleted.
7745         (mpn_gcd_lehmer_n): Deleted declaration.
7747         * mpn/generic/gcd.c (gcd_2): Moved from gcd_lehmer.c.
7748         (mpn_gcd): Inlined the code from mpn_gcd_lehmer_n. Also use
7749         MPN_GCD_SUBDIV_STEP_ITCH rather than MPN_GCD_LEHMER_N_ITCH.
7751 2010-04-22  Torbjorn Granlund  <tege@gmplib.org>
7753         * mpn/powerpc64/mode64/bdiv_dbm1c.asm: Swap multiply insns to make them
7754         consecutive, for the benefit of POWER6.
7756         * mpn/powerpc64/mode64/p6/gmp-mparam.h: New file.
7758 2010-04-21  Torbjorn Granlund  <tege@gmplib.org>
7760         * mpn/generic/gcd_lehmer.c: Deleted file.
7762         * mpn/powerpc64/mode64/divrem_1.asm: Swap multiply insns to make them
7763         consecutive, for the benefit of POWER6.
7764         * mpn/powerpc64/mode64/dive_1.asm: Likewise.
7765         * mpn/powerpc64/mode64/divrem_2.asm: Likewise.
7766         * mpn/powerpc64/mode64/mul_1.asm: Likewise.
7767         * mpn/powerpc64/mode64/aorsmul_1.asm: Likewise.
7769         * mpn/powerpc64/mode64/aorslshC_n.asm: Swap ldx operands as a temporary
7770         workaround for POWER6 pipeline glitch.
7772 2010-04-19  Niels Möller  <nisse@lysator.liu.se>
7774         * mpz/jacobi.c (mpz_jacobi): New implementation using
7775         mpn_jacobi_lehmer. Currently #if:ed out.
7777         * mpn/generic/jacbase.c (mpn_jacobi_base)
7778         [JACOBI_BASE_METHOD < 4]: Support inputs with a >= b.
7780         * gmp-impl.h (mpn_jacobi_lehmer): Added prototype.
7781         (jacobi_table): Declare.
7782         (mpn_jacobi_init): New inline function.
7783         (mpn_jacobi_finish): Likewise.
7784         (mpn_jacobi_update): Likewise.
7786         * mpn/generic/jacobi_lehmer.c (mpn_jacobi_lehmer): New file, new
7787         function.
7789         * configure.in (gmp_mpn_functions): Added jacobi_lehmer.
7791 2010-04-14  Niels Möller  <nisse@lysator.liu.se>
7793         * configure.in (gmp_mpn_functions): Added
7794         matrix22_mul1_inverse_vector.
7795         * mpn/Makefile.am (nodist_EXTRA_libmpn_la_SOURCES): Added
7796         matrix22_mul1_inverse_vector.c.
7798         * gmp-impl.h (mpn_matrix22_mul1_inverse_vector): Updated for
7799         rename of mpn_matrix22_mul1_inverse_vector.
7800         * mpn/generic/gcd_lehmer.c (mpn_gcd_lehmer_n): Likewise.
7801         * mpn/generic/gcdext_lehmer.c (mpn_gcdext_lehmer_n): Likewise.
7802         * mpn/generic/hgcd.c (hgcd_step): Likewise.
7804         * mpn/generic/matrix22_mul1_inverse_vector.c
7805         (mpn_matrix22_mul1_inverse_vector): New file, function moved and
7806         renamed...
7807         * mpn/generic/hgcd2.c (mpn_hgcd_mul_matrix1_inverse_vector):
7808         ...from here.
7810 2010-04-12  Torbjorn Granlund  <tege@gmplib.org>
7812         * tests/mpn/t-toom6h.c (SIZE_LOG): Define.
7813         * tests/mpn/t-toom8h.c (SIZE_LOG): Likewise.
7815 2010-04-10  Torbjorn Granlund  <tege@gmplib.org>
7817         * mpn/ia64/lorrshift.asm: Rewrite feed-in and wind-down code.
7819         * mpn/ia64/aorslsh1_n.asm: Adapt to new aorslsh1_n.
7820         * mpn/ia64/aorslsh1_n.asm: Likewise.
7822         * mpn/ia64/aors_n.asm: Complete rewrite.
7823         * mpn/ia64/aorslsh1_n.asm: Likewise.
7825         * mpn/ia64/add_n_sub_n.asm: Misc cleanups.  Add slotting comments.
7827         * mpn/ia64/lshiftc.asm: New file.
7829         * mpn/x86_64/pentium4/gmp-mparam.h: No longer disable rsh1add_n and
7830         rsh1sub_n; instead disable rsblsh1_n, addlsh2_n, rsblsh2_n.
7832         * mpn/x86/divrem_2.asm: Use "orb" instead of "or" to work around
7833         Solaris assembler bug.
7834         * mpn/x86_64/mpn/x86_64/divrem_2.asm: Likewise.
7836         * mpn/x86/aors_n.asm: Use operand-less shift-by-1 insn form.
7837         * mpn/x86/pentium/aors_n.asm: Likewise.
7838         * mpn/x86_64/invert_limb.asm: Likewise.
7840         * mpn/x86_64/pentium4/aors_n.asm: Let non-nc code fall into nc code.
7842         * mpn/x86_64/pentium4/rsh1aors_n.asm: New file.
7844 2010-03-25  Torbjorn Granlund  <tege@gmplib.org>
7846         * mpn/ia64/add_n_sub_n.asm: New file.
7848         * mpn/generic/toom33_mul.c: Fix mpn_add_n_sub_n usage.
7849         * mpn/generic/toom3_sqr.c: Likewise.
7850         * mpn/generic/toom63_mul.c: Likewise.
7852         * mpn/generic/add_n_sub_n.c: Renamed from addsub_n.c.
7854 2010-03-23  Torbjorn Granlund  <tege@gmplib.org>
7856         * mpn/x86_64/divrem_2.asm: Use mpn_invert_limb instead of div insn.
7858         * mpn/ia64/aorslshC_n.asm: New file, generalised from last iteration of
7859         aorslsh1_n.asm.
7860         * mpn/ia64/aorslsh1_n.asm: Use aorslshC_n.asm.
7861         * mpn/ia64/aorslsh1_n.asm: New file, use aorslshC_n.asm.
7863 2010-03-20  Torbjorn Granlund  <tege@gmplib.org>
7865         * mpn/powerpc64/mode64/invert_limb.asm: Rewrite to exploit cancellation
7866         in the Newton iteration.
7868 2010-03-20 Marco Bodrato <bodrato@mail.dm.unipi.it>
7870         * mpn/generic/toom_interpolate_8pts.c: Use mpn_sublsh2_n.
7872 2010-03-20  Torbjorn Granlund  <tege@gmplib.org>
7874         * mpn/powerpc64/mode64/aorslshC_n.asm: New file, generalised from
7875         last iteration of aorslsh1_n.asm.
7876         * mpn/powerpc64/mode64/aorslsh1_n.asm: Use aorslshC_n.asm.
7877         * mpn/powerpc64/mode64/aorslsh1_n.asm: New file, use aorslshC_n.asm.
7879 2010-03-19  Torbjorn Granlund  <tege@gmplib.org>
7881         * mpn/x86_64/nano/dive_1.asm: New file.
7883         * mpn/x86_64/divrem_1.asm: Avoid shld since it is slow on several CPU
7884         types.  Unconditionally provide code for normalised and unnormalised
7885         divisors.  Cleanup labels.
7887         * mpn/x86_64/core2/divrem_1.asm: Remove special code for normalised
7888         divisors.  Cleanup labels.
7890         * mpn/generic/toom_interpolate_6pts.c: Call mpn_sublsh2_n and
7891         mpn_sublsh_n with correct args.
7893         * tests/devel/try.c: Use enum for TYPE_*.
7895         * tests/devel/try.c: Test mpn_sublsh2_n.
7896         * tests/refmpn.c (refmpn_sublsh2_n): New function.
7897         * tests/tests.h (refmpn_sublsh2_n): Declare.
7899         * mpn/powerpc64/mode64/aorslsh1_n.asm: New file, with faster
7900         mpn_addlsh1_n and mpn_sublsh1_n.
7901         * mpn/powerpc64/mode64/addlsh1_n.asm: Delete.
7902         * mpn/powerpc64/mode64/sublsh1_n.asm: Delete.
7904 2010-03-18  Torbjorn Granlund  <tege@gmplib.org>
7906         * configure.in (*-*-aix): Define gcc_32_cflags_maybe, ar_32_flags and
7907         nm_32_flags.
7909         * mpn/x86/pentium4/sse2/addlsh1_n.asm: Tune for slightly better speed.
7910         Misc cleanups.  Add cycle table.
7912         * mpn/x86_64/copyi.asm: Update cycle table.
7913         * mpn/x86_64/copyd.asm: Likewise.
7914         * mpn/x86_64/rsh1aors_n.asm: Likewise.
7915         * mpn/x86_64/dive_1.asm: Likewise.
7917         * mpn/x86/pentium4/sse2/add_n.asm: Misc cleanups.  Add cycle table.
7918         * mpn/x86/pentium4/sse2/sub_n.asm: Likewise.
7920 2010-03-16  Torbjorn Granlund  <tege@gmplib.org>
7922         * mpn/x86_64/divrem_1.asm: Use mpn_invert_limb instead of div insn.
7923         * mpn/x86_64/core2/divrem_1.asm: Likewise.
7925         * tune/speed.c (routine): Add FLAG_R_OPTIONAL for many binops.
7927 2010-03-15  Torbjorn Granlund  <tege@gmplib.org>
7929         * mpn/alpha/ev6/mod_1_4.asm (mpn_mod_1s_4p_cps): Rewrite.
7931         * mpn/ia64/aors_n.asm: Insert explicitly typed nops to trigger intended
7932         bundling.
7933         * mpn/ia64/aorslsh1_n.asm: Likewise.
7934         * mpn/ia64/dive_1.asm: Likewise.
7936 2010-03-13  Torbjorn Granlund  <tege@gmplib.org>
7938         * mpn/x86/pentium4/sse2/submul_1.asm: Rewrite.
7940         * mpn/powerpc64/mode64/aorsmul_1.asm: New file, faster than old code
7941         for both mpn_addmul_1 and mpn_submul_1.
7942         * mpn/powerpc64/mode64/addmul_1.asm: Remove.
7943         * mpn/powerpc64/mode64/submul_1.asm: Remove.
7945 2010-03-11  Niels Möller  <nisse@lysator.liu.se>
7947         * mpn/generic/gcd_lehmer.c (gcd_2): Use sub_ddmmss.
7949         * mpn/generic/jacbase.c (mpn_jacobi_base): Reorganized the
7950         JACOBI_BASE_METHOD 4 slightly. Now requires that b > 1.
7952 2010-03-10  Torbjorn Granlund  <tege@gmplib.org>
7954         * mpn/x86_64/divrem_1.asm: Make fraction code take documented # of
7955         cycles.  Annotate code for more CPUs.  Misc cleanups.
7956         * mpn/x86_64/core2/divrem_1.asm: Annotate code for more CPUs.
7958         * mpn/alpha/ev6/mod_1_4.asm: New file.
7960         * mpn/ia64/mod_34lsub1.asm: New file.
7962         * doc/gmp.texi (Language Bindings): Update Python site, add Ruby.
7964 2010-03-10  Niels Möller  <nisse@lysator.liu.se>
7966         * tune/tuneup.c (tune_jacobi_base): Consider mpn_jacobi_base_4.
7967         * tune/speed.c (routine): Added mpn_jacobi_base_4.
7968         * tune/common.c (speed_mpn_jacobi_base_4): New function.
7969         * tune/speed.h (speed_mpn_jacobi_base_4): Declare it.
7970         * tune/Makefile.am (libspeed_la_SOURCES): Added jacbase4.c.
7971         * tune/jacbase4.c: New file.
7973         * mpn/generic/jacbase.c (mpn_jacobi_base): New function, for
7974         JACOBI_BASE_METHOD 4.
7976 2010-03-09  Niels Möller  <nisse@lysator.liu.se>
7978         * tests/mpz/t-jac.c (check_large_quotients): Also generate inputs
7979         with large quotients and a large gcd.
7981 2010-03-09 Marco Bodrato <bodrato@mail.dm.unipi.it>
7983         * tests/mpz/t-bin.c (randomwalk): New test-generator function.
7985 2010-03-07  Torbjorn Granlund  <tege@gmplib.org>
7987         * tune/speed.c (routine): Force r argument for several mod_1 calls.
7989 2010-03-06  Torbjorn Granlund  <tege@gmplib.org>
7991         * mpn/x86_64/divrem_1.asm: Disable SPECIAL_CODE_FOR_NORMALIZED_DIVISOR.
7992         Misc clean up.
7994         * mpn/x86_64/mod_1_1.asm: New file.
7995         * mpn/x86_64/mod_1_2.asm: New file.
7996         * mpn/x86_64/mod_1_4.asm: Update cycle counts.
7998         * tests/tests.h (TESTS_REPS): Fix typo.
8000 2010-03-03  Torbjorn Granlund  <tege@gmplib.org>
8002         * mpn/x86_64/core2/divrem_1.asm: New file.
8004 2010-02-26  Niels Möller  <nisse@lysator.liu.se>
8006         * tune/speed.c (routine): Added udiv_qrnnd_preinv3.
8008         * tune/common.c (speed_udiv_qrnnd_preinv3): New function.
8009         * tune/speed.h: Added prototype for it.
8011 2010-02-26  Niels Möller  <nisse@lysator.liu.se>
8013         * tests/mpz/t-jac.c (check_large_quotients): New test. Currently
8014         disabled, since it's quite slow.
8015         (mpz_nextprime_step): New function.
8017 2010-02-26  Torbjorn Granlund  <tege@gmplib.org>
8019         * mpn/pa64/aors_n.asm: Fix typo in last change.
8021 2010-02-25  Niels Möller  <nisse@lysator.liu.se>
8023         * tests/mpz/t-jac.c (ref_jacobi): New reference implementation,
8024         using factorization and legendre symbols computed by powm.
8026         * tests/devel/try.c (param_init, call): Don't pass negative values
8027         for the second argument to mpz_jacobi and refmpz_jacobi.
8029         * tests/refmpz.c (refmpz_jacobi): Require that b is odd and positive.
8031         * tests/devel/try.c (param_init): Support mpz_legendre.
8032         (choice_array): Added mpz_kronecker (apparently forgotten) and
8033         mpz_legendre.
8034         (call): Added TYPE_MPZ_LEGENDRE.
8035         (try_one): Added support for DATA_SRC1_ODD_PRIME.
8037         * tests/refmpz.c (refmpz_legendre): Rewrote using powm.
8039 2010-02-25  Torbjorn Granlund  <tege@gmplib.org>
8041         * config.guess: Make "corei" default for unrecognised Intel P6 CPUs.
8043         * tests/mpz/t-perfpow.c (check_random): Use mp_limb_t type for limb
8044         variables.
8046         * tests/mpn/t-toom6h.c (COUNT): Define.
8047         * tests/mpn/t-toom8h.c (COUNT): Define.
8049         * tests/mpn/t-div.c: Cast a switch index to placate HP's cc.
8050         * tests/mpn/t-bdiv.c: Likewise.
8052         * mpn/pa64/aors_n.asm: Fix support of the 2.0n ABI.
8054 2010-02-24 Marco Bodrato <bodrato@mail.dm.unipi.it>
8056         * tests/mpz/t-bin.c (data): Replace (2k,k), tested by twos ().
8057         * tests/mpf/t-inp_str.c (data): Test also "+" in the exponent.
8059 2010-02-23  Torbjorn Granlund  <tege@gmplib.org>
8061         * mpn/generic/mod_1_3.c: Cast a switch index to placate HP's cc.
8063         * mpn/generic/sqrtrem.c: Use CNST_LIMB.
8065 2010-02-20  Niels Möller  <nisse@lysator.liu.se>
8067         * tune/speed.h (mpn_gcd_accel): Deleted prototype.
8068         (mpn_hgcd_lehmer): New prototype.
8069         (MPN_HGCD_LEHMER_ITCH): New macro (previously in gmp-impl.h).
8071         * tune/Makefile.am (libspeed_la_SOURCES): Added hgcd_lehmer.c.
8072         * tune/hgcd_lehmer.c: New file.
8073         * tune/gcd_accel.c: Deleted obsolete file.
8075         * gmp-impl.h (MPN_HGCD_LEHMER_ITCH): Deleted macro.
8077         * mpn/generic/hgcd.c (mpn_hgcd_lehmer): Deleted function,
8078         (mpn_hgcd): Don't call mpn_hgcd_lehmer, instead use inlined loop
8079         around hgcd_step.
8080         (mpn_hgcd_itch): Substitute n for MPN_HGCD_LEHMER_ITCH (n).
8082 2010-02-19  Niels Möller  <nisse@lysator.liu.se>
8084         * Makefile.am (mpn/jacobitab.h): Added the rules needed to
8085         generate this file.
8087         * gen-jacobitab.c: New file.
8089 2010-02-19  Torbjorn Granlund  <tege@gmplib.org>
8091         * mpn/generic/powm.c: Honour SQR_BASECASE_THRESHOLD in innerloop
8092         expansions.
8094 2010-02-16  Niels Möller  <nisse@lysator.liu.se>
8096         * tune/time.c (cgt_works_p): Added rudimentary sanity check for
8097         clock_gettime working.
8099 2010-02-15  Niels Möller  <nisse@lysator.liu.se>
8101         * tune/time.c (speed_time_init): Make use of cycle counter
8102         configurable, via the speed_option_cycles_broken flag.
8103         * tune/common.c (speed_option_cycles_broken): New global variable.
8104         (speed_option_set): Recognize option "cycles-broken".
8106         * tune/time.c (cycles_works_p): Deleted hack to disable cycle
8107         counter on linux. Needs to be replaced by something more
8108         selective.
8110 2010-02-11  Niels Möller  <nisse@lysator.liu.se>
8112         * tune/time.c (speed_time_init): Fix speed_time_string when using
8113         clock_gettime.
8114         (cycles_works_p): On linux, don't use the cycle counter.
8116         * tune/Makefile.am: Add $(TUNE_LIBS) when linking programs.
8118         * configure.in: Check if -lrt is needed for clock_gettime, and if
8119         so, add that flag to TUNE_LIBS.
8121 2010-02-07  Torbjorn Granlund  <tege@gmplib.org>
8123         * tune/tuneup.c (tune_redc): Set min_size and min_is_always when
8124         measuring REDC_1_TO_REDC_2_THRESHOLD.
8125         (tune_mod_1): Set min_size for PREINV_MOD_1_TO_MOD_1_THRESHOLD.
8127         * mpn/x86_64/aorrlsh_n.asm (cnt): Fix a typo.
8128         * mpn/x86_64/lshsub_n.asm: Likewise.
8130 2010-02-05  Torbjorn Granlund  <tege@gmplib.org>
8132         * Version 5.0.1 released.
8134         * mpn/generic/powm.c: Use rp target area for power table computation in
8135         order to use less scratch.
8137         * mpn/generic/binvert.c (mpn_binvert_itch): Enable more economical
8138         mpn_mulmod_bnm1_itch call.
8140         * mpn/generic/mu_div_qr.c: Remove always true #if.
8141         * mpn/generic/mu_divappr_q.c: Likewise.
8142         * mpn/generic/mu_bdiv_q.c: Likewise.
8143         * mpn/generic/mu_bdiv_qr.c: Likewise.
8145 2010-02-01  Torbjorn Granlund  <tege@gmplib.org>
8147         * Makefile.am (LIBGMP_LT_*, LIBGMPXX_LT_*, LIBMP_LT_*):
8148         Bump version info.
8150         * mpn/powerpc64/mode64/gmp-mparam.h: Remove {MUL,SQR}_FFT_TABLE2.
8151         * mpn/x86/p6/gmp-mparam.h: Likewise.
8152         * mpn/x86/p6/mmx/gmp-mparam.h: Likewise.
8153         * mpn/generic/mul_fft.c: Don't depend on FFT_TABLE2, it was broken.
8155 2010-01-29  Torbjorn Granlund  <tege@gmplib.org>
8157         * mpn/generic/mul_fft.c (mpn_mul_fft_internal): Remove arguments n, m,
8158         k and rec; add argument sqr.  Don't call mpn_mul_fft_decompose here,
8159         instead do that in all callers.
8160         (mpn_mul_fft): Trim allocation when squaring, and use TMP_ALLOC*, not
8161         explicit alloc/free.
8162         (mpn_fft_div_2exp_modF): Avoid a scalar division.
8163         (mpn_fft_mul_modF_K): Replace some multiplies by K with shifting by k.
8164         (mpn_fft_mul_2exp_modF): Make function more symmetrical.
8166 2010-01-27  Torbjorn Granlund  <tege@gmplib.org>
8168         * mpn/generic/mu_div_q.c (mpn_mu_div_q_itch): Rewrite.
8169         * mpn/generic/mu_div_qr.c (mpn_mu_div_qr_itch): Re-enable
8170         better mulmod itch estimate.
8171         * mpn/generic/mu_divappr_q.c (mpn_mu_divappr_q_itch): Likewise.
8172         * mpn/generic/mu_bdiv_qr.c (mpn_mu_bdiv_qr_itch): Likewise.
8173         * mpn/generic/mu_bdiv_q.c (mpn_mu_bdiv_q_itch): Likewise.
8175 2010-01-27 Marco Bodrato <bodrato@mail.dm.unipi.it>
8177         * mpn/generic/mu_div_qr.c (mpn_mu_div_qr_itch): Disabled guessed
8178         estimate, enabled a conservative one.
8179         * mpn/generic/mu_divappr_q.c (mpn_mu_divappr_q_itch): Likewise.
8180         * mpn/generic/mu_bdiv_qr.c (mpn_mu_bdiv_qr_itch): Likewise.
8181         * mpn/generic/mu_bdiv_q.c (mpn_mu_bdiv_q_itch): Likewise.
8183 2010-01-26 Marco Bodrato <bodrato@mail.dm.unipi.it>
8185         * mpn/generic/mulmod_bnm1.c (mpn_mulmod_bnm1): Partial rewrite to
8186         reduce memory usage.
8187         * mpn/generic/sqrmod_bnm1.c (mpn_sqrmod_bnm1): Likewise.
8188         (mpn_sqrmod_bnm1_next_size): New function.
8190         * gmp-impl.h (mpn_mulmod_bnm1_itch): Accepts 3 parameters now.
8191         (mpn_sqrmod_bnm1_itch): New inline function.
8192         (mpn_sqrmod_bnm1_next_size): Declaration and mangling.
8193         * mpn/generic/nussbaumer_mul.c: Use the new functions.
8195         * mpn/generic/invertappr.c (mpn_ni_invertappr): Use new syntax for
8196         mpn_mulmod_bnm1_itch.
8197         * mpn/generic/mu_divappr_q.c (mpn_mu_divappr_q_itch): Likewise.
8198         * mpn/generic/mu_bdiv_qr.c (mpn_mu_bdiv_qr_itch): Likewise.
8199         * mpn/generic/mu_bdiv_q.c (mpn_mu_bdiv_q_itch): Likewise.
8200         * mpn/generic/mu_div_qr.c (mpn_mu_div_qr_itch): Likewise.
8201         * mpn/generic/binvert.c (mpn_binvert_itch): Likewise.
8202         * tune/speed.h (SPEED_ROUTINE_MPN_MULMOD_BNM1_CALL): Likewise.
8203         (SPEED_ROUTINE_MPN_MULMOD_BNM1_ROUNDED): Likewise.
8205         * tests/mpn/t-sqrmod_bnm1.c, tests/mpn/t-mulmod_bnm1.c: Test
8206         reduced memory usage.
8208 2010-01-25  Torbjorn Granlund  <tege@gmplib.org>
8210         * tune/tuneup.c (INSERT_FFTTAB): New macro, like old insertion code but
8211         also inserting a sentinel.
8212         (fftmes): Use INSERT_FFTTAB for inserting new measurements.
8213         Limit k range to best_k - 4 ... best_k + 4.
8215 2010-01-23  Torbjorn Granlund  <tege@gmplib.org>
8217         * gmp-h.in (__GNU_MP_VERSION_PATCHLEVEL): Bump.
8218         (__GMP_MP_RELEASE): New macro.
8220         * mpf/div.c: Rewrite to use mpn_div_q.
8222 2010-01-21  Torbjorn Granlund  <tege@gmplib.org>
8224         * Add FFT_TABLE3 tables for a basic set of machines.
8226         * configure.in: Use -mtune=nocona for 64-bit pentium4.
8228         * config.guess: Recognise many more Intel processors.
8230         * tune/common.c: Whitespace cleanup.
8231         (speed_mpn_matrix22_mul): Rewrite.
8233 2010-01-21  Niels Möller  <nisse@lysator.liu.se>
8235         * mpn/generic/nussbaumer_mul.c (mpn_nussbaumer_mul): Take
8236         advantage of new mpn_mulmod_bnm1 interface, to reduce allocation.
8238         * tests/mpn/t-mulmod_bnm1.c (ref_mulmod_bnm1, main): Adapted to
8239         mpn_mulmod_bnm1 interface change.
8241         * mpn/generic/mulmod_bnm1.c (mpn_mulmod_bnm1): Interface change,
8242         in case an + bn < rn, only write an + bn output limbs. New input
8243         requirement, an + bn > rn/2.
8244         * mpn/generic/sqrmod_bnm1.c (mpn_sqrmod_bnm1): Corresponding
8245         changes.
8247 2010-01-19  Torbjorn Granlund  <tege@gmplib.org>
8249         * tune/tuneup.c (fftmes): Round up initial n according to initial k.
8250         Limit k to 24 in loop.  Remove an obsolete always-true condition.
8251         Remove a redundant trace printout.
8253 2010-01-18  Torbjorn Granlund  <tege@gmplib.org>
8255         * tune/tuneup.c (fftmes): New function
8256         (fft): Rewrite.
8257         (mpn_mul_fft_lcm): New function, copied from mpn/generic/mul_fft.c.
8258         (fftfill): New function, code taken from mul_fft.c (mpn_mul_fft).
8259         (cached_measure): New function.
8261         * gmp-impl.h (struct fft_table_nk): Moved from mul_fft.c.
8262         (MUL_FFT_TABLE3, SQR_FFT_TABLE3): Provide dummy versions for tuneup
8263         builds.
8264         (FFT_TABLE3_SIZE): Increase value for tuneup builds.
8266         * mpn/generic/mul_fft.c: Handle a new FFT threshold table type ("3").
8267         Misc cleanups to old table type code.
8269 2010-01-16  Torbjorn Granlund  <tege@gmplib.org>
8271         * mpn/x86_64/darwin.m4: Fix typo in last change.
8273 2010-01-15  Torbjorn Granlund  <tege@gmplib.org>
8275         * gmp-h.in (__GMP_EXTERN_INLINE): Remove "extern" for newer Sun C.
8277         * gmp-impl.h (GMP_LIMB_BYTES): New define.
8279         * mpn/x86_64/darwin.m4 (LEA): New define.
8281         * mpn/x86/invert_limb.asm (approx_tab): Use DEF_OBJECT.
8282         Rename and globalise it to work around Mac OS bug.
8284         With Philip McLaughlin:
8285         * mpn/x86_64/gcd_1.asm (ctz_table): Don't use local prefix, but
8286         use DEF_OBJECT...END_OBJECT.
8287         Keep stack pointer at ABI mandated alignment over call.
8289 2010-01-12  Torbjorn Granlund  <tege@gmplib.org>
8291         * tune/speed.c (routine): Remove obsolete mpn_dc_tdiv_qr and
8292         mpn_dc_div_qr_n.
8293         * tune/common.c (speed_mpn_dc_tdiv_qr, speed_mpn_dcpi1_div_qr_n):
8294         Remove now unused functions.
8295         * tune/speed.h (SPEED_ROUTINE_MPN_DC_DIVREM_N,
8296         SPEED_ROUTINE_MPN_DC_DIVREM_SB, SPEED_ROUTINE_MPN_DC_TDIV_QR): Remove
8297         now unused macros.
8299         * mpn/x86_64/fat/fat_entry.asm (mpn_cpuid_available): Remove function.
8301         * ltmain.sh: Upgrade from 1.5.24 to 2.2.6b.
8302         * ylwrap: New file.
8303         * .bootstrap: Remove explicit versions.
8305         * doc/gmp.texi (Block-wise Barrett Division): New node.
8307         * mpn/generic/powm.c: Change some #if to plain 'if' to avoid fat build
8308         problems.
8310 2010-01-11  Torbjorn Granlund  <tege@gmplib.org>
8312         * tune/speed.h (SPEED_ROUTINE_MPN_PI1_DIV): Accept arguments for size
8313         restrictions.
8314         * tune/common.c (speed_mpn_sbpi1_div_qr, speed_mpn_dcpi1_div_qr,
8315         (speed_mpn_sbpi1_divappr_q, speed_mpn_dcpi1_divappr_q): Pass size
8316         limits for SPEED_ROUTINE_MPN_PI1_DIV.
8318         * tune/speed.c (routine): Allow .r argument for mpn_sbpi1_divappr_q and
8319         mpn_dcpi1_divappr_q.
8321 2010-01-08  Torbjorn Granlund  <tege@gmplib.org>
8323         * Version 5.0.0 released.
8325         * mpn/generic/div_q.c: Handle mpn_*_divappr_q returning high limb
8326         everywhere.
8328 2010-01-07  Torbjorn Granlund  <tege@gmplib.org>
8330         * Update MUL_FFT_TABLE2 and SQR_FFT_TABLE2 for many machines.
8332         * mpn/generic/mu_div_q.c: Account for divisor truncation error as well
8333         as mpn_mu_divappr_q's error.
8335         * mpn/generic/mu_div_q.c: Handle mpn_preinv_mu_divappr_q returning a
8336         high limb.
8338         * tests/mpn/t-bdiv.c: Move a random call for debugability.
8339         * tests/mpn/t-div.c: Likewise.
8341         * mpn/generic/mu_divappr_q.c: Rewrite quotient round-up code.
8343         * mpn/generic/mu_div_qr.c: Handle carry-out from a carry propagation
8344         subtract.
8345         * mpn/generic/mu_divappr_q.c: Likewise.
8347         * mpn/generic/mu_divappr_q.c
8348         (mpn_preinv_mu_divappr_q, mpn_mu_divappr_q): Declare dividend constant.
8349         * gmp-impl.h: Likewise.
8351         * perfpow.c (mpn_perfect_power_p): Call mpn_divexact instead of
8352         mpn_bdiv_q (with too little scratch space!).
8354         From Niels Möller:
8355         * tests/mpn/t-div.c (check_one): Get rid of the poorly managed variable
8356         tn.
8358         * mpn/minithres/gmp-mparam.h: Add all lately defined thresholds.
8360         * mpn/generic/div_q.c: Use SB division for small quotients as well as
8361         small divisors.  Fix typo in itch call.
8363 2010-01-06  Niels Möller  <nisse@lysator.liu.se>
8365         * tests/mpn/t-div.c (check_one): Checking based on multiplication,
8366         refmpn_mul, rather than refmpn_tdiv_qr.
8368 2010-01-06 Marco Bodrato <bodrato@mail.dm.unipi.it>
8370         * mpn/generic/toom8h_mul.c: Avoid overflows of mp_size_t.
8372 2010-01-06  Torbjorn Granlund  <tege@gmplib.org>
8374         * gmp-h.in (__GNU_MP__): Bump.
8375         (__GNU_MP_VERSION,__GNU_MP_VERSION_MINOR,__GNU_MP_VERSION_PATCHLEVEL):
8376         Bump version info.
8377         * mp-h.in (__GNU_MP__): Bump.
8378         * Makefile.am (LIBGMP_LT_*, LIBGMPXX_LT_*, LIBMP_LT_*):
8379         Bump version info.
8381         * doc/gmp.texi: Rewrite mpn_gcdext text.  Remove some out-of-date
8382         text in Algorithms chapter.
8384         * mpn/generic/div_q.c: Properly handle np=scratch.  Fix critical typo
8385         in final adjustment code.  Misc cleanups.
8387         * mpn/generic/rootrem.c: Use mpn_div_q.
8388         * mpz/tdiv_q.c: Likewise.
8390         * tests/mpn/t-div.c: Test mpn_div_q.
8391         (SIZE_LOG): Up to 17.
8393         * mpn/generic/div_q.c: New file.
8394         * configure.in (gmp_mpn_functions): Add div_q.
8396         * mpn/generic/mu_div_q.c: Actually declare dividend constant.
8398 2010-01-04  Torbjorn Granlund  <tege@gmplib.org>
8400         * tune/tuneup.c (fft): Separate tuning of modf and full products.
8401         (struct fft_param_t): New field, mul_modf_function.
8402         (tune_fft_sqr): Fix typo.
8403         (tune_fft_mul, tune_fft_sqr): Initialise mul_modf_function field.
8404         * tune/common.c (speed_mpn_fft_mul, speed_mpn_fft_sqr): New functions.
8406         * tune/speed.h (SPEED_ROUTINE_MPN_MULMOD_BNM1_ROUNDED): Clean up.
8408         * mpn/generic/mul.c: Simplify rational expression.
8410         * gmp-impl.h: Cleanup threshold variables; remove obsolete ones and
8411         make all possibly needed definitions for existing ones.
8412         * tune/tuneup.c (tune_mul): Write fractions-compensated values to
8413         threshold variables.
8415 2010-01-03 Marco Bodrato <bodrato@mail.dm.unipi.it>
8417         * tune/common.c, tune/speed.c, tune/speed.h: Support measuring
8418         mpn_toom43_mul.
8420         * mpn/generic/toom_interpolate_6pts.c: Small reorganisation.
8422 2010-01-03  Torbjorn Granlund  <tege@gmplib.org>
8424         * gmp-impl.h (MUL_TO_MULMOD_BNM1_FOR_2NXN_THRESHOLD): Default to
8425         INV_MULMOD_BNM1_THRESHOLD/2 instead.
8427         * gmp-impl.h (INV_APPR_THRESHOLD, INV_MULMOD_BNM1_THRESHOLD): Default
8428         here...
8429         * mpn/generic/invert.c, mpn/generic/invertappr.c: ...not here.
8431         * tests/mpn/t-div.c: Rewrite operand generation code.
8433 2010-01-02  Torbjorn Granlund  <tege@gmplib.org>
8435         * gmp-impl.h (MUL_TO_MULMOD_BNM1_FOR_2NXN_THRESHOLD): Default to
8436         INV_MULMOD_BNM1_THRESHOLD.
8438 2010-01-02  Marco Bodrato <bodrato@mail.dm.unipi.it>
8440         * mpn/generic/dcpi1_div_q.c: Handle divappr approximation problem more
8441         efficiently.
8442         * mpn/generic/mu_div_q.c: Likewise.
8444         * mpn/generic/invert.c: Remove duplicated code.
8446 2010-01-01  Torbjorn Granlund  <tege@gmplib.org>
8448         * gmp-impl.h (MUL_TO_MULMOD_BNM1_FOR_2NXN_THRESHOLD): Default to 0.
8450         * mpn/generic/mu_div_qr.c: Rewrite to use mpn_mulmod_bnm1.  Clean up
8451         scratch usage.  Improve itch functions.
8452         * mpn/generic/mu_divappr_q.c: Likewise.
8453         * mpn/generic/mu_bdiv_qr.c: Likewise.
8454         * mpn/generic/mu_div_q.c: Likewise.
8456         * mpn/generic/dcpi1_bdiv_qr.c: Add parameter ASSERTs.
8457         * mpn/generic/dcpi1_bdiv_q.c: Likewise.
8459         * tests/mpn/t-bdiv.c: Replace with unit testing code, based on t-div.c.
8460         Increase COUNT to 500.
8462         * tests/mpn/t-div.c: Avoid generating too small test operands.
8463         Move SB suppression limit downwards.  Increase COUNT to 200.
8465 2009-12-31  Torbjorn Granlund  <tege@gmplib.org>
8467         * mpn/generic/tdiv_qr.c: Handle numerator/remainder overlap in MU case.
8469         * tests/tests.h (TESTS_REPS): New macro.
8470         * tests/mpz/dive.c: Use larger operands, decrease default reps, use
8471         TESTS_REPS.
8472         * tests/mpz/convert.c: Likewise.
8473         * tests/mpz/t-sqrtrem.c: Likewise.
8474         * tests/mpz/reuse: Likewise.
8475         * tests/mpz/t-root.c: Likewise.
8476         * tests/mpz/t-tdiv.c: Likewise.
8477         * tests/mpz/t-gcd.c: Likewise.
8478         * tests/mpz/t-powm.c: Likewise.
8480 2009-12-31  Marco Bodrato <bodrato@mail.dm.unipi.it>
8482         * mpn/generic/toom8_sqr.c (SQR_TOOM8_MAX): Avoid overflow.
8483         * mpn/generic/toom6_sqr.c (SQR_TOOM6_MAX): Likewise.
8485         * mpn/generic/mulmod_bnm1.c: Don't mention MISUSE any more,
8486         simply consider UNLIKELY any unexpected size.
8488 2009-12-31  Torbjorn Granlund  <tege@gmplib.org>
8490         * tune/tuneup.c (speed_mpn_sbordcpi1_div_qr): New function.
8491         (tune_mu_div): Use it.
8493 2009-12-30  Torbjorn Granlund  <tege@gmplib.org>
8495         * tune/tuneup.c (tune_mu_bdiv, tune_dc_bdiv, tune_mu_div)
8496         (tune_dc_div): Clear global s.r to make speed functions do 2n/n.
8498         * tune/speed.c (routine): New entries for mpn_mu_div_qr and
8499         mpn_mupi_div_qr.  Allow .r parameter for mpn_sbpi1_div_qr,
8500         mpn_dcpi1_div_qr.
8501         * tune/speed.h (SPEED_ROUTINE_MPN_PI1_DIV, SPEED_ROUTINE_MPN_MU_DIV_QR)
8502         (SPEED_ROUTINE_MPN_MUPI_DIV_QR): Handle .r parameter.
8504         * tests/mpz/t-tdiv.c: Increase operands size again.
8506         * mpn/generic/tdiv_qr.c: Attempt to choose between DC and MU cleverer.
8508         * mpn/generic/tdiv_qr.c: Don't overwrite rp with unnecessary temporary
8509         alloc.
8511 2009-12-29  Torbjorn Granlund  <tege@gmplib.org>
8513         * tune/tuneup.c (tune_mu_div): Tune MUPI_DIV_QR_THRESHOLD.
8514         * tune/speed.h (struct speed_params): Allow 3 source operands.
8515         (SPEED_ROUTINE_MPN_MUPI_DIV_QR): New macro.
8516         * tune/common.c (speed_mpn_mupi_div_qr): New function.
8518         * mpn/generic/tdiv_qr.c: Call mpn_mu_div_qr.
8520         * tests/mpz/t-tdiv.c: Use larger test operands.
8522         * mpn/generic/mu_div_qr.c (mpn_mu_div_qr2): Remove code for dn==1.
8524         * mpz/mul.c: Call mpn_sqr directly.  Use PTR,SIZ,ALLOC.
8526         * tune/tuneup.c (tune_mu_div): Set min_size to 6, DC functions require
8527         this.
8529         * tests/mpn/t-div.c: Call mu_div functions with operands that generate
8530         a high quotient limb.
8532         * mpn/generic/mu_div_qr.c: Rewrite to return a high quotient limb,
8533         to let dividend argument be constant, and as a general cleanup.
8534         * mpn/generic/mu_divappr_q.c: Likewise.
8535         * mpn/generic/mu_div_q.c: Likewise.
8536         * gmp-impl.h: Update declarations of changed functions.
8538         * mpn/generic/invertappr.c (mpn_invertappr): Allocate scratch space
8539         when caller passed NULL.
8541 2009-12-28  Torbjorn Granlund  <tege@gmplib.org>
8543         * mpn/generic/toom_couple_handling.c: Prefix name with mpn_.
8544         * gmp-impl.h: Likewise.
8545         * mpn/generic/toom63_mul.c: Likewise.
8546         * mpn/generic/toom6_sqr.c: Likewise.
8547         * mpn/generic/toom6h_mul.c: Likewise.
8548         * mpn/generic/toom8_sqr.c: Likewise.
8549         * mpn/generic/toom8h_mul.c: Likewise.
8551         * configure.in (gmp_mpn_functions_optional) Move "com" from here...
8552         (gmp_mpn_functions): ...to here.
8553         * mpn/generic/com.c: New file.
8554         * (mpn_com): New name for mpn_com_n.  Make public.
8555         * (mpn_neg): Analogous changes.
8557         * tune/tuneup.c (tune_mu_div, tune_mu_bdiv): Set step_factor.
8559         * tune/common.c, tune/speed.c, tune/speed.h: Support measuring
8560         mpn_lshiftc.
8562         * tests/devel/try.c: Test mpn_lshiftc.
8563         * tests/refmpn.c (refmpn_com): New function.
8564         (refmpn_lshiftc): Likewise.
8566         * configure.in (gmp_mpn_functions_optional) Move lshiftc from here...
8567         (gmp_mpn_functions): ...to here.
8568         * mpn/generic/lshiftc.c: New file.
8569         * mpn/x86_64/lshiftc.asm: New file.
8570         * mpn/x86_64/core2/lshiftc.asm: New file.
8571         * mpn/generic/mul_fft.c (mpn_lshiftc): Remove.
8573         * mpn/x86_64/core2/lshift.asm: Tweak for better Core iN performance.
8574         * mpn/x86_64/core2/rshift.asm: Likewise.
8576 2009-12-27  Marco Bodrato <bodrato@mail.dm.unipi.it>
8578         * mpn/generic/mul.c: Use toom6h and toom8h for almost balanced.
8580         * mpn/generic/mullo_n.c (mpn_dc_mullo_n): New ratio, to be used in
8581         Toom-8 range.
8583 2009-12-27  Torbjorn Granlund  <tege@gmplib.org>
8585         * (mpn_sqr): New name for mpn_sqr_n.  Many files affected.
8587         * tune/tuneup.c (tune_mullo): Up step_factor for MULLO_MUL_N_THRESHOLD.
8588         (tune_invertappr, tune_invert, tune_binvert): Let max_size default.
8590         * tune/tuneup.c (tune_mu_div, tune_mu_bdiv) New functions.
8591         * tune/speed.h (SPEED_ROUTINE_MPN_MU_DIV_Q): New macro.
8592         (SPEED_ROUTINE_MPN_MU_DIV_QR): Likewise.
8593         (SPEED_ROUTINE_MPN_MU_BDIV_Q): Likewise.
8594         (SPEED_ROUTINE_MPN_MU_BDIV_QR): Likewise.
8595         * tune/Makefile.am (TUNE_MPN_SRCS_BASIC): Add bdiv_q.c and bdiv_qr.c.
8596         * tune/common.c (speed_mpn_mu_div_qr): New function.
8597         (speed_mpn_mu_divappr_q): Likewise.
8598         (speed_mpn_mu_div_q): Likewise.
8599         (speed_mpn_mu_bdiv_q): Likewise.
8600         (speed_mpn_mu_bdiv_qr): Likewise.
8602         * mpn/*/gmp-mparam.h: Fix incorrect MOD_1U_TO_MOD_1_1_THRESHOLD 0
8603         values.
8605         * gmp-impl.h (MODEXACT_1_ODD_THRESHOLD): Remove.
8606         (BMOD_1_TO_MOD_1_THRESHOLD): New parameter, with the reverse meaning of
8607         MODEXACT_1_ODD_THRESHOLD.
8608         (MPN_MOD_OR_MODEXACT_1_ODD): Use BMOD_1_TO_MOD_1_THRESHOLD.
8609         * mpn/generic/divis.c, mpz/{cong.c,cong_ui.c,divis_ui.c}: Likewise.
8610         * tune/tuneup.c (tune_modexact_1_odd): Tune BMOD_1_TO_MOD_1_THRESHOLD;
8611         Do not assume native mpn_modexact_1_odd is faster than mpn_mod_1.
8612         (tuned_speed_mpn_mod_1): Remove variable.
8613         (tune_mod_1): Fix thinkos.  Suppress printing of "always" etc.
8614         (all): Measure for divrem_1, mod_1, divexact_1, etc first, since Toom
8615         depends on some of them.
8617         * mpn/generic/toom22_mul.c (TOOM22_MUL_REC): New name for
8618         TOOM22_MUL_MN_REC.
8620 2009-12-26  Niels Möller  <nisse@lysator.liu.se>
8622         * tests/mpn/t-toom32.c (MIN_AN, MIN_BN, MAX_BN): Relax
8623         requirements a bit.
8625         * mpn/generic/toom32_mul.c (mpn_toom32_mul): Relax requirement on
8626         input sizes, to support s+t>=n (used to be s+t>=n+2). Keep high
8627         limbs of the evaluated values in scalar variables.
8629         * mpn/generic/sbpi1_divappr_q.c (mpn_sbpi1_divappr_q): Remove
8630         unused variables.
8632         * mpn/generic/toom32_mul.c (mpn_toom32_mul): Fixed left-over use
8633         of mpn_addsub_n which should be mpn_add_n_sub_n.
8635 2009-12-26  Marco Bodrato <bodrato@mail.dm.unipi.it>
8637         * tune/Makefile.am (TUNE_MPN_SRCS_BASIC): Add new toom files (spotted by Torbjorn).
8639         * gmp-impl.h (mpn_toom6_sqr_itch): Rename to mpn_toom6_mul_n_itch and redefine.
8640         (mpn_toom8_sqr_itch): Rename to mpn_toom8_mul_n_itch and redefine.
8641         * mpn/generic/mul_n.c: Use renamed _itch macros.
8643 2009-12-25  Niels Möller  <nisse@lysator.liu.se>
8645         * tests/mpn/t-toom32.c (MIN_AN, MIN_BN, MAX_BN): Tightened requirements.
8646         * gmp-impl.h (mpn_toom32_mul_itch): Updated. Less scratch needed
8647         by toom32 itself, and also the pointwise multiplications are
8648         currently mpn_mul_n with no supplied scratch.
8649         * mpn/generic/toom32_mul.c (mpn_toom32_mul): Reorganized
8650         interpolation to use less scratch space. No longer supports the
8651         most extreme size ratios.
8653 2009-12-25  Torbjorn Granlund  <tege@gmplib.org>
8655         * tune/tuneup.c (tune_preinv_mod_1): Purge.
8656         (tune_mod_1): Use speed_mpn_mod_1_tune for
8657         PREINV_MOD_1_TO_MOD_1_THRESHOLD
8659         * mpn/generic/dcpi1_divappr_q.c: Handle 2n/n properly.  Don't use full
8660         precision in mpn_sbpi1_divappr_q call.  Misc cleanup.
8662         * tune/tuneup.c (tune_mod_1): Add a check_size for
8663         PREINV_MOD_1_TO_MOD_1_THRESHOLD.
8665 2009-12-24  Torbjorn Granlund  <tege@gmplib.org>
8667         * tune/mod_1_div.c (MOD_1N_TO_MOD_1_1_THRESHOLD,
8668         (MOD_1U_TO_MOD_1_1_THRESHOLD): Set.
8669         * tune/mod_1_inv.c (MOD_1N_TO_MOD_1_1_THRESHOLD,
8670         (MOD_1U_TO_MOD_1_1_THRESHOLD): Set.
8672         * gmp-impl.h (USE_PREINV_MOD_1): Remove.
8673         (MPN_MOD_OR_PREINV_MOD_1): Define to choose functions dynamically in
8674         terms of PREINV_MOD_1_TO_MOD_1_THRESHOLD (used to choose statically
8675         using USE_PREINV_MOD_1).
8676         * mpn/generic/perfsqr.c (PERFSQR_MOD_PP): Corresponding updates.
8678         * tune/tuneup.c (tune_mod_1): Rewrite.
8679         * gmp-impl.h (MOD_1N_TO_MOD_1_1_THRESHOLD): New.
8680         (MOD_1U_TO_MOD_1_1_THRESHOLD): New name for MOD_1_1_THRESHOLD.
8681         (MOD_1_1_TO_MOD_1_2_THRESHOLD): Mew name for MOD_1_2_THRESHOLD.
8682         (MOD_1_2_TO_MOD_1_4_THRESHOLD): New name for MOD_1_4_THRESHOLD.
8683         * mpn/generic/mod_1.c: Corresponding updates.
8685 2009-12-24  Marco Bodrato <bodrato@mail.dm.unipi.it>
8687         * mpn/generic/mul_n.c: Use also toom6h and toom8h.
8688         * mpn/generic/sqr_n.c: Use also toom6 and toom8.
8689         * gmp-impl.h: Initial support for tuning of Toom-6half and Toom-8half.
8690         * tune/tuneup.c: Tune Toom-6half and Toom-8half thresholds.
8692 2009-12-24  Torbjorn Granlund  <tege@gmplib.org>
8694         * mpn/generic/mod_1_4.c: Get ASSERT right.
8695         * mpn/generic/mod_1_3.c: Likewise.
8696         * mpn/generic/mod_1_2.c: Likewise.
8698         * mpn/generic/powm_sec.c: Use SQR_TOOM2_THRESHOLD as limit for a native
8699         mpn_sqr_basecase, not TUNE_SQR_TOOM2_MAX.
8701 2009-12-23  Marco Bodrato <bodrato@mail.dm.unipi.it>
8703         * tune/common.c, tune/speed.c, tune/speed.h: Support for measuring
8704         mpn_toom8h_mul and mpn_toom8_sqr speed.
8706         * mpn/generic/toom_eval_pm2exp.c: Fix ASSERTs.
8708         * mpn/generic/toom8h_mul.c: New file.
8709         * mpn/generic/toom8_sqr.c: New file.
8710         * mpn/generic/toom_interpolate_16pts.c: New file.
8711         * gmp-impl.h: Provide corresponding declarations.
8712         * configure.in (gmp_mpn_functions): List toom_interpolate_16pts,
8713         toom8h_mul, and toom8h_sqr.
8714         * tests/mpn/t-toom8h.c: New test program.
8716         * mpn/generic/toom6_sqr.c: New file, was part of toom6h_mul.
8717         * mpn/generic/toom6h_mul.c: Removed _sqr.
8719         * mpn/generic/mulmod_bnm1.c: Nailify CRT.
8720         * mpn/generic/sqrmod_bnm1.c: Likewise.
8722         * mpn/generic/mullo_n.c: Split dc_mullo_n function;
8723         ALLOC memory at once.
8725         * mpn/Makefile.am (nodist_EXTRA_libmpn_la_SOURCES): Update.
8727         * mpn/generic/toom6h_mul.c: Add prefix to toom_interpolate_12pts.
8728         * mpn/generic/toom_interpolate_12pts.c: Likewise.
8730         * mpn/generic/invertappr.c (mpn_bc_invertappr): Use mpn_divrem_2.
8731         * mpn/generic/invert.c: Faster basecase, use mpn_sbpi1_div_q.
8733         * mpn/generic/toom_eval_pm2exp.c: Assert support for degree 3.
8734         * mpn/generic/toom6h_mul.c: Avoid obsolete _itch function.
8736 2009-12-23  Torbjorn Granlund  <tege@gmplib.org>
8738         * tune/common.c, tune/speed.c, tune/speed.h: Support for measuring
8739         mpn_mod_1_1p, mpn_mod_1s_2p, mpn_mod_1s_3p, mpn_mod_1s_4p.
8741         * tests/mpz/t-powm.c: Test mpz_powm_sec.
8743         * mpz/powm_sec.c: New file.
8744         * gmp-h.in: Declare it.
8745         * Makefile.am, mpz/Makefile.am: Compile it.
8746         * doc/gmp.texi: Document it.
8748         * mpn/generic/powm_sec.c (mpn_powm_sec_itch): New function.
8749         (mpn_powm_sec): Use passed scratch, no local allocation.
8750         Allow exp argument = 1.
8751         (win_size): Start loop from 1.
8753         * mpn/generic/powm.c (win_size): Start loop from 1.
8755 2009-12-22  Torbjorn Granlund  <tege@gmplib.org>
8757         * tests/mpn/t-div.c: New file.
8758         * tests/mpn/Makefile.am: Compile it.
8760         * mpn/generic/mu_divappr_q.c: Handle quotient overflow.
8762         * mpn/generic/mu_div_q.c (mpn_mu_div_q_itch): New function.
8764 2009-12-22  Niels Möller  <nisse@lysator.liu.se>
8766         * mpn/generic/sbpi1_div_q.c: Use udiv_qr_3by2.  Intended to change
8767         nothing after preprocessing.
8769         * mpn/generic/sbpi1_divappr_q.c: For the last call to udiv_qr_3by2,
8770         avoid using memory locations as output parameters, and revert to
8771         explicitly copying n1 and n0 to memory.
8773         * gmp-impl.h (udiv_qr_3by2): Tweaked to expand to precisely the
8774         same code as was used before the introduction of this macro.
8775         Eliminated some local variables, instead do multiple updates to
8776         the output parameters.
8778 2009-12-22  Torbjorn Granlund  <tege@gmplib.org>
8780         * tests/mpn/t-toom6h.c (MIN_AN): Set to MUL_TOOM6H_THRESHOLD to avoid
8781         invalid recursive sizes.
8783         * tests/mpn/t-bdiv.c: Get itch function calls right.
8785         * mpn/generic/mu_bdiv_q.c (mpn_mu_bdiv_q_itch): Rewrite.
8786         * mpn/generic/mu_bdiv_qr.c (mpn_mu_bdiv_qr_itch): Simplify.
8788         * mpn/generic/bdiv_qr.c (mpn_bdiv_qr): Simplify, don't allocate.
8789         (mpn_bdiv_qr_itch): Conditionalise on MU_BDIV_QR_THRESHOLD.
8791 2009-12-18  Niels Möller  <nisse@lysator.liu.se>
8793         * tests/mpn/t-bdiv.c: Add red-zones.
8795 2009-12-21  Torbjorn Granlund  <tege@gmplib.org>
8797         * mpn/generic/sbpi1_div_q.c: Fix fixup code to work for qn = 0.
8799         * mpn/generic/dcpi1_divappr_q.c: Handle qn = 1 and qn = 2 for initial
8800         quotient block (code block copied from dcpi1_div_qr.c).
8802         * mpn/generic/dcpi1_div_qr.c: Rewrite singular case giving q limb of
8803         GMP_NUMB_MAX.  Remove an impossible qn = 0 case.
8805         * mpn/generic/dcpi1_bdiv_q.c: Remove a spurious mpn_sub_1.
8807         * mpn/generic/mul.c: Put back call to mpn_mul_n.
8809         * tune/tuneup.c (all): Call tune_mulmod_bnm1 before tuning fft due to
8810         dependency on mulmod_bnm1 from both mul_fft_mul and from mullo_n.
8812         * mpn/generic/dcpi1_divappr_q.c: ASSERT that dn >= 6 and nn > dn.
8813         * mpn/generic/dcpi1_div_q.c: ASSERT that dn >= 6 and nn-dn >= 3.
8814         * mpn/generic/dcpi1_div_qr.c: ASSERT that dn >= 6 and nn-dn >= 3.
8816         * mpn/generic/bdiv_q_1.c (mpn_pi1_bdiv_q_1): Renamed from
8817         mpn_bdiv_q_1_pi1.
8818         * All references changed.
8820         * configure.in: Add --enable-old-fft-full.
8821         * tune/speed.c (routine): Conditionalise mpn_mul_fft_full references on
8822         WANT_OLD_FFT_FULL.
8823         * tune/common.c (speed_mpn_mul_fft_full)
8824         (speed_mpn_mul_fft_full_sqr): Likewise.
8825         * mpn/generic/mul_fft.c (mpn_mul_fft_full): Include iff
8826         WANT_OLD_FFT_FULL.
8828 2009-12-21  Marco Bodrato <bodrato@mail.dm.unipi.it>
8830         * gmp-impl.h (mpn_toom6h_mul_itch): New inline function.
8831         (MUL_TOOM6H_THRESHOLD): Default value.
8832         (SQR_TOOM6_THRESHOLD): Default value.
8833         * mpn/generic/toom6h_mul.c: Remove definitions moved to gmp-impl.h.
8834         * tune/common.c, tune/speed.c, tune/speed.h: Support for measuring
8835         mpn_toom6h_mul and mpn_toom6_sqr speed.
8837         * mpn/generic/toom63_mul.c: Remove unused TMP_*.
8839         * mpn/generic/toom_eval_pm2rexp.c: New file.
8840         * gmp-impl.h: Provide corresponding declaration.
8841         * configure.in (gmp_mpn_functions): List toom_eval_pm2rexp.
8842         * mpn/generic/toom6h_mul.c: Use shared toom_eval_pm2rexp.
8844         * mpn/generic/toom_couple_handling.c: New file, helper function
8845         for high degree Toom.
8846         * gmp-impl.h: Provide corresponding declaration.
8847         * configure.in (gmp_mpn_functions): List toom_couple_handling.
8848         * mpn/generic/toom6h_mul.c: Use shared toom_couple_handling.
8849         * mpn/generic/toom63_mul.c: Likewise.
8851         * mpn/generic/toom6h_mul.c: New file.
8852         * mpn/generic/toom_interpolate_12pts.c: New file.
8853         * gmp-impl.h: Provide corresponding declarations.
8854         * configure.in (gmp_mpn_functions): List toom_interpolate_12pts,
8855         toom6h_mul.
8856         * tests/mpn/t-toom6h.c: New test program.
8858         * tests/mpn/t-mulmod_bnm1.c (ref_mulmod_bnm1): Use ref_mul.
8859         * tests/mpn/t-sqrmod_bnm1.c (ref_sqrmod_bnm1): Likewise.
8861 2009-12-20  Marco Bodrato <bodrato@mail.dm.unipi.it>
8863         * mpn/generic/mulmod_bnm1.c (mpn_mulmod_bnm1): New CRT.
8864         * mpn/generic/sqrmod_bnm1.c (mpn_sqrmod_bnm1): Likewise.
8866 2009-12-20  Torbjorn Granlund  <tege@gmplib.org>
8868         * Change all bit counts for bignums to use mp_bitcnt_t.
8870         * mpn/generic/bdivmod.c: File removed.  All references purged.
8872         * mpn/generic/mul_fft.c (mpn_mul_fft_full): Disable.
8874         * gmp-impl.h: Define mpn_fft_mul as an alias for mpn_nussbaumer_mul.
8875         * mpn/generic/mul.c: Refer mpn_fft_mul.
8876         * mpn/generic/mul_n.c: Likewise.
8877         * mpn/generic/sqr_n.c: Likewise.
8878         * mpn/generic/mullo_n.c: Likewise.
8880         * mpn/generic/mul.c: Loop also over mpn_nussbaumer_mul, as suggested by
8881         Marco.  Use TMP_SALLOC_LIMBS in more places.  Clean up ws allocation.
8883 2009-12-19  Marco Bodrato <bodrato@mail.dm.unipi.it>
8885         * mpn/generic/toom_interpolate_8pts.c: Nailify.
8887 2009-12-19  Torbjorn Granlund  <tege@gmplib.org>
8889         * mpn/generic/mul.c: Major rewrite.  Use toom43, toom53, toom63.
8890         Call mpn_nussbaumer_mul for largest operands.
8892         * tune/speed.h (SPEED_ROUTINE_MPN_TOOM32_FOR_TOOM43_MUL): New macro.
8893         (SPEED_ROUTINE_MPN_TOOM43_FOR_TOOM32_MUL): New macro.
8894         (SPEED_ROUTINE_MPN_TOOM32_FOR_TOOM53_MUL): New macro.
8895         (SPEED_ROUTINE_MPN_TOOM53_FOR_TOOM32_MUL): New macro.
8896         (SPEED_ROUTINE_MPN_TOOM42_FOR_TOOM53_MUL): New macro.
8897         (SPEED_ROUTINE_MPN_TOOM53_FOR_TOOM42_MUL): New macro.
8898         * tune/common.c (speed_mpn_toom63_mul): New function.
8899         (speed_mpn_toom32_for_toom43_mul): New function.
8900         (speed_mpn_toom43_for_toom32_mul): New function.
8901         (speed_mpn_toom32_for_toom53_mul): New function.
8902         (speed_mpn_toom53_for_toom32_mul): New function.
8903         (speed_mpn_toom42_for_toom53_mul): New function.
8904         (speed_mpn_toom53_for_toom42_mul): New function.
8905         * tune/tuneup.c (tune_mul_n): New name for old tune_mul.
8906         (tune_sqr_n): New name for old tune_sqr.
8907         (tune_mul): New function, for unbalanced multiplication.
8908         * gmp-impl.h: Provide declarations for corresponding threshold vars.
8910         * gmp-impl.h (mpn_rsh1add_nc, mpn_rsh1sub_nc): Declare.
8911         * mpn/asm-defs.m4: Likewise.
8912         * configure.in: Add corresponding HAVE_NATIVEs.
8913         * mpn/x86_64/rsh1aors_n.asm: Add _nc entry point.
8915 2009-12-18  Niels Möller  <nisse@lysator.liu.se>
8917         * mpz/divexact.c: Rewrite to use mpn_divexact.
8919         * mpn/generic/bdiv_q_1.c (mpn_bdiv_q_1): Deleted some unused
8920         variables.
8922         * mpn/generic/toom52_mul.c (mpn_toom52_mul)
8923         [HAVE_NATIVE_mpn_add_n_sub_n]: Moved declaration of cy to avoid a
8924         compiler warning.
8926         * gmp-impl.h (gmp_pi1_t): Eliminated inv21 member.
8927         (invert_pi1): ...and don't store it here.
8929         * mpn/generic/toom63_mul.c (mpn_toom63_mul): Simplified
8930         calculation of block size n.
8931         * gmp-impl.h (mpn_toom63_mul_itch): Likewise.
8933         * mpn/generic/toom_eval_pm2exp.c (mpn_toom_eval_pm2exp): Fixed
8934         output asserts.
8936 2009-12-18  Torbjorn Granlund  <tege@gmplib.org>
8938         * tests/mpn/t-toom63.c: New test program.
8940 2009-12-18  Marco Bodrato <bodrato@mail.dm.unipi.it>
8942         * mpn/generic/invert.c: Nailify.
8943         * mpn/generic/invertappr.c: Nailify.
8944         * mpn/generic/mulmod_bnm1.c: Nailify.
8945         * mpn/generic/sqrmod_bnm1.c: Nailify.
8947         * tests/mpn/t-invert.c: New test program.
8949         * mpn/generic/toom63_mul.c: New file.
8950         * mpn/generic/toom_interpolate_8pts.c: New file.
8951         * gmp-impl.h: Provide corresponding declarations.
8952         * configure.in (gmp_mpn_functions): List toom_interpolate_8pts and
8953         toom63_mul.
8955 2009-12-17  Torbjorn Granlund  <tege@gmplib.org>
8957         * mpn/generic/mul.c: Move allocation of ws to where it is used.
8958         Identify toom22, 32, 42, in that order (in two places).  Use midline
8959         between toom22, 32, 42.
8960         * mpn/generic/toom22_mul.c (TOOM22_MUL_MN_REC): Call also
8961         mpn_toom32_mul.
8963         * doc/gmp.texi: Update References section.  Update Contributors
8964         section.  Misc updates.
8966         * gmp-impl.h: Renew default values for all THRESHOLDs.
8968 2009-12-17  Niels Möller  <nisse@lysator.liu.se>
8970         * mpn/generic/divexact.c (mpn_divexact): Don't require that the
8971         dividend is normalized. Use MPN_DIVREM_OR_PREINV_DIVREM_1. When
8972         shifting, allocate and process only the low qn+1 limbs. Eliminated
8973         code for the impossible case nn < qn.
8975         * mpn/generic/dcpi1_div_qr.c (mpn_dcpi1_div_qr): Added some input
8976         asserts.
8978         * mpn/generic/dcpi1_div_qr.c (mpn_dcpi1_div_qr): In the case that
8979         the initial quotient block is a single limb, use 3/2 division,
8980         thereby eliminating the only use of gmp_pi1_t->inv21.
8982 2009-12-17  Marco Bodrato <bodrato@mail.dm.unipi.it>
8984         * mpn/generic/invert.c: Added some comment.
8985         * mpn/generic/invertappr.c: Slightly better threshold handling.
8986         * gmp-impl.h (INV_NEWTON_THRESHOLD): Default to 200.
8988         * mpn/generic/nussbaumer_mul.c: New file.
8989         * configure.in (gmp_mpn_functions): Add nussbaumer_mul.
8990         * tune/Makefile.am (TUNE_MPN_SRCS_BASIC): Add nussbaumer_mul.
8991         * gmp-impl.h (mpn_nussbaumer_mul): Added prototype and name-mangling.
8992         * tune/speed.h (speed_mpn_nussbaumer_mul): Declare function.
8993         * tune/common.c (speed_mpn_nussbaumer_mul): New function.
8994         * tune/speed.c (routine): Add speed_mpn_nussbaumer_mul.
8996         * mpn/generic/sqrmod_bnm1.c: New file.
8997         * configure.in (gmp_mpn_functions): Add sqrmod_bnm1.
8998         * tune/Makefile.am (TUNE_MPN_SRCS_BASIC): Add sqrmod_bnm1.
8999         * gmp-impl.h (mpn_sqrmod_bnm1): Added prototype and name-mangling.
9000         (SQRMOD_BNM1_THRESHOLD): support for the new threshold.
9001         * tune/speed.h (speed_mpn_sqrmod_bnm1): Declare function.
9002         * tune/common.c (speed_mpn_sqrmod_bnm1): New function.
9003         * tune/speed.c (routine): Add speed_mpn_sqrmod_bnm1.
9004         * tests/mpn/t-mulmod_bnm1.c: Attribution.
9005         * tests/mpn/t-sqrmod_bnm1.c: New test file.
9006         * tests/mpn/Makefile.am (check_PROGRAMS): Add t-sqrmod_bnm1.
9008         * tune/tuneup.c: Tune SQRMOD_BNM1_THRESHOLD.
9010         * mpn/generic/nussbaumer_mul.c (mpn_nussbaumer_mul): Mimic fft_mul,
9011         use squaring if operands coincide.
9012         * tune/speed.h (speed_mpn_nussbaumer_mul_sqr): Declare function.
9013         * tune/common.c (speed_mpn_nussbaumer_mul_sqr): New function.
9014         * tune/speed.c (routine): Add speed_mpn_nussbaumer_mul_sqr.
9016 2009-12-17  Torbjorn Granlund  <tege@gmplib.org>
9018         * mpn/generic/bdiv_q.c (mpn_bdiv_q_itch): Rewrite.
9020 2009-12-16  Torbjorn Granlund  <tege@gmplib.org>
9022         * tests/mpn/t-bdiv.c (bdiv_q_valid_p, bdiv_qr_valid_p): Call refmpn_mul
9023         instead of refmpn_mul_basecase.
9024         * tests/mpn/toom-shared.h: Likewise.
9025         * tests/refmpn.c (refmpn_mullo_n,refmpn_sqr,refmpn_mul_any): Likewise.
9027         * minithres/gmp-mparam.h: Add new thresholds, trim old values.
9029         * mpn/generic/powm.c: Use mp_bitcnt_t for bit counts.
9030         Handle REDC_1_TO_REDC_N_THRESHOLD < MUL_TOOM22_THRESHOLD in
9031         non-WANT_REDC_2 INNERLOOP expansion code.
9032         * mpn/generic/powm_sec.c: Use mp_bitcnt_t for bit counts.
9034 2009-12-16  Niels Möller  <nisse@lysator.liu.se>
9036         * tests/mpz/t-gcd.c (main): Added test case to exercise the
9037         unlikely u0 == u1 case in mpn_gcdext_lehmer_n.
9039         * mpn/generic/gcdext_lehmer.c (mpn_gcdext_lehmer_n): Get ASSERT
9040         right.
9042 2009-12-16  Torbjorn Granlund  <tege@gmplib.org>
9044         * tests/mpz/t-mul.c: Misc cleanups.
9045         (mul_basecase): Remove.
9046         (ref_mpn_mul): Remove.
9047         * tests/refmpn.c (refmpn_mul): New function, mainly from t-mul.c's
9048         ref_mpn_mul.
9049         (refmpn_mullo_n): Add a missing free.
9051         * tune/speed.c (routine): Measure speed_mpn_{sb,dc}pi1_div_qr,
9052         mpn_{sb,dc}pi1_divappr_q, mpn_{sb,dc}pi1_bdiv_qr, and
9053         mpn_{sb,dc}pi1_bdiv_q.
9055         * mpn/generic/invertappr.c: New file, meat from invert.c.
9056         * mpn/generic/invert.c: Leave just mpn_invert.c.
9057         * configure.in (gmp_mpn_functions): Add invertappr.
9058         * tune/Makefile.am (TUNE_MPN_SRCS_BASIC): Add invertappr.c.
9059         * gmp-impl.h (mpn_invert_itch, mpn_invertappr_itch): New macros.
9061 2009-12-15  Torbjorn Granlund  <tege@gmplib.org>
9063         * mpn/generic/gcdext_subdiv_step.c: Get an ASSERT right.
9065 2009-12-15  Niels Möller  <nisse@lysator.liu.se>
9067         * mpn/generic/sbpi1_div_qr.c (mpn_sbpi1_div_qr): A very small step
9068         towards nail support.
9070 2009-12-15  Marco Bodrato <bodrato@mail.dm.unipi.it>
9072         * gmp-impl.h (mpn_ni_invertappr): Added prototype and name-mangling.
9073         * mpn/generic/mulmod_bnm1.c: Comment representation of class [0].
9075 2009-12-14  Niels Möller  <nisse@lysator.liu.se>
9077         * mpn/generic/sbpi1_divappr_q.c (mpn_sbpi1_divappr_q): Use
9078         udiv_qr_3by2.
9080 2009-12-14  Torbjorn Granlund  <tege@gmplib.org>
9082         * tune/tuneup.c (tune_binvert): Remove BINV_MULMOD_BNM1_THRESHOLD
9083         tuning, it was always zero and caused BINV_NEWTON_THRESHOLD to be
9084         wrong (as pointed out by Marco).
9085         * (BINV_MULMOD_BNM1_THRESHOLD): Clean from other files too.
9087 2009-12-14  Marco Bodrato <bodrato@mail.dm.unipi.it>
9089         * mpn/generic/invert.c: Improved comments.
9090         (mpn_bc_invertappr): Conditionally re-enable mpn_dcpi1_divappr_q.
9092 2009-12-14  Niels Möller  <nisse@lysator.liu.se>
9094         * gmp-impl.h (udiv_qr_3by2): Fix typo in argument list.
9096 2009-12-13  Niels Möller  <nisse@lysator.liu.se>
9098         * gmp-impl.h (udiv_qr_3by2): New macro.
9099         * mpn/generic/sbpi1_div_qr.c (mpn_sbpi1_div_qr): Use udiv_qr_3by2.
9101 2009-12-13  Torbjorn Granlund  <tege@gmplib.org>
9103         * mpn/generic/dcpi1_divappr_q.c (mpn_dcpi1_divappr_q): Avoid a buffer
9104         overrun.
9106         * mpn/generic/mul_fft.c (mpn_mul_fft_full): Handle carry-out from 2nd
9107         mpn_mul_fft, add an ASSERT for the 1st mpn_mul_fft.  Replace some
9108         comments on cc's range with ASSERTs.
9110         * mpn/generic/gcdext.c (compute_v): Normalise tp[] after mpn_mul.
9112         * mpz/powm.c: Rework buffer handling.
9114 2009-12-13  Niels Möller  <nisse@lysator.liu.se>
9116         * tests/mpn/toom-shared.h (main): Use refmpn_mul_basecase to check
9117         results (slow!). Iteration counts of all toom tests reduced
9118         considerably.
9120 2009-12-13  Marco Bodrato <bodrato@mail.dm.unipi.it>
9122         * mpn/generic/invert.c (mpn_invertapp): Split in _bc and _ni.
9123         (mpn_bc_invertappr): New function, the basecase.
9124         (mpn_ni_invertapp): New function, Newton iteration.
9125         (mpn_invert): Use mpn_ni_invertapp.
9126         * tune/tuneup.c (tune_invert): Min for INV_APPR_THRESHOLD.
9127         (tune_invertappr): Min for INV_NEWTON_THRESHOLD.
9129         * tune/speed.h (SPEED_ROUTINE_MPN_NI_INVERTAPPR): New macro.
9130         (speed_mpn_ni_invertappr): Declare function.
9131         * tune/common.c (speed_mpn_ni_invertappr): New function.
9132         * tune/speed.c (routine): Add speed_mpn_ni_invertappr.
9134         * tune/tuneup.c (tune_invertappr): Use speed_mpn_ni_invertappr to
9135         tune INV_MULMOD_BNM1_THRESHOLD.
9137 2009-12-12  Torbjorn Granlund  <tege@gmplib.org>
9139         * mpn/generic/mu_bdiv_qr.c (mpn_mu_bdiv_qr_itch): Rewrite.
9141 2009-12-12  Marco Bodrato <bodrato@mail.dm.unipi.it>
9143         * tests/mpn/t-mulmod_bnm1.c (main): Disable B^n+1 stressing test
9144         for odd sizes.
9146         * mpn/generic/invert.c: Complete rewrite. Uses Newton iterations.
9147         * gmp-impl.h (mpn_invertappr): Added prototype and name-mangling.
9148         (mpn_invertappr_itch): Added prototype and name-mangling.
9149         (INV_APPR_THRESHOLD): Support for a new tunable const.
9150         * tune/speed.h (SPEED_ROUTINE_MPN_INVERTAPPR): New macro.
9151         (speed_mpn_invertappr): Declare function.
9152         * tune/common.c (speed_mpn_invertappr): New function.
9153         * tune/speed.c (routine): Add speed_mpn_invertappr.
9154         * tune/tuneup.c (tune_invertappr): New function: was tune_invert.
9155         (tune_invert): Now tune only INV_APPR_THRESHOLD.
9156         (all): Enable call to tune_invert and tune_invertappr.
9158 2009-12-11  Torbjorn Granlund  <tege@gmplib.org>
9160         * mpn/generic/binvert.c: Use mpn_mulmod_bnm1 instead of FFT wrapping.
9161         Old, evidently broken wrapping code removed.
9162         * tune/tuneup.c (tune_binvert): Tune BINV_MULMOD_BNM1_THRESHOLD.
9163         * gmp-impl.h: Provide declarations for corresponding threshold var.
9165         * tests/mpn/t-bdiv.c (COUNT): Decrease to keep run time reasonable.
9167         * tune/tuneup.c (tune_invert): Tune INV_MULMOD_BNM1_THRESHOLD.
9168         * gmp-impl.h: Provide declarations for corresponding threshold var.
9170         * tests/mpn/t-mulmod_bnm1.c: Avoid a division by zero.
9172         * configure.in: Set up different paths for different 64-bit sparc
9173         processors.
9174         * mpn/sparc64/ultrasparc34/gmp-mparam.h: New file.
9176 2009-12-10  Torbjorn Granlund  <tege@gmplib.org>
9178         * mpn/*/gmp-mparam.h: Regenerate many of these files.
9180 2009-12-10  Niels Möller  <nisse@lysator.liu.se>
9182         * gmp-impl.h (mpn_divexact): Removed scratch pointer from
9183         prototype.
9184         * mpn/generic/gcdext.c (divexact): Deleted, moved to...
9185         * mpn/generic/divexact.c (mpn_divexact): New implementation (moved
9186         from gcdext.c). The bidirectional divexact is kept but #if:ed out.
9187         Interface change, since the new code doesn't take a scratch
9188         argument.
9190         * tests/mpn/t-mulmod_bnm1.c (main): Ensure that an >= bn. Lowered
9191         MIN_N to 1. Various fixes to handle n == 1 properly.
9193         * mpn/generic/mulmod_bnm1.c (mpn_mulmod_bnm1): Small interface
9194         change, require an >= bn.
9196         * mpn/generic/mulmod_bnm1.c (mpn_mulmod_bnm1): Fixed non-recursive
9197         case to not write beyond end of result area.
9199 2009-12-09  Torbjorn Granlund  <tege@gmplib.org>
9201         * tune/speed.h (SPEED_ROUTINE_MPN_MULMOD_BNM1_CALL): New macro, made
9202         from now deleted SPEED_ROUTINE_MPN_MULMOD_BNM1.
9203         * tune/common.c (speed_mpn_bc_mulmod_bnm1): New function.
9204         (speed_mpn_mulmod_bnm1): Use SPEED_ROUTINE_MPN_MULMOD_BNM1_CALL.
9205         * tune/speed.c (routine): Add mpn_bc_mulmod_bnm1.
9207         * mpn/generic/mulmod_bnm1.c (mpn_mulmod_bnm1_next_size): Rewrite.
9209         * tune/tuneup.c (tune_mulmod_bnm1): Rewrite.
9211 2009-12-08  Marco Bodrato <bodrato@mail.dm.unipi.it>
9213         * mpn/generic/mulmod_bnm1.c (mpn_bc_mulmod_bnm1,
9214         mpn_bc_mulmod_bnp1): Added a parameter for scratch area, possibly
9215         same as result area (as suggested by Niels Möller).
9216         (mpn_mulmod_bnm1): Calls changed accordingly.
9218 2009-12-08  Niels Möller  <nisse@lysator.liu.se>
9220         * mpn/generic/gcdext_1.c (mpn_gcdext_1) [GCDEXT_1_USE_BINARY]: Use
9221         table lookup for count_trailing_zeros. Binary algorithm still
9222         disabled by default.
9224         * mpn/generic/gcdext.c (divexact): Local definition of divexact,
9225         using mpn_bdiv_q.
9226         (compute_v): Use it.
9228         * tests/mpn/Makefile.am (check_PROGRAMS): Added t-bdiv.
9230         * tests/mpn/t-bdiv.c: New file.
9232         * mpn/generic/bdiv_q.c (mpn_bdiv_q): Fixed bad quotient length,
9233         should have qn == nn.
9235         * mpn/generic/bdiv_qr.c (mpn_bdiv_qr): Pass correct nn length to
9236         the lower-level functions.
9238 2009-12-08  Torbjorn Granlund  <tege@gmplib.org>
9240         * tune/speed.h (SPEED_ROUTINE_MPN_MULMOD_BNM1_ROUNDED): New define.
9241         * tune/common.c (speed_mpn_mulmod_bnm1_rounded): New function.
9242         * tune/speed.c (routine): Add mpn_mulmod_bnm1_rounded for measuring
9243         mpn_mulmod_bnm1 at recommended sizes.
9245         * mpn/generic/mulmod_bnm1.c (mpn_mulmod_bnm1_next_size): Rewrite.
9246         (mpn_bc_mulmod_bnm1): Use mpn_add_n instead of mpn_add.
9248         * tune/speed.c (routine): Add mpn_invert.
9250         * tune/tuneup.c (tune_invert): New function.
9251         * tune/speed.h (SPEED_ROUTINE_MPN_INVERT): New macro.
9252         * tune/common.c (speed_mpn_invert): New function.
9253         * gmp-impl.h: Provide declarations for corresponding threshold var.
9254         * tune/Makefile.am (TUNE_MPN_SRCS_BASIC): Add invert.c.
9256 2009-12-08  Marco Bodrato <bodrato@mail.dm.unipi.it>
9258         * tests/devel/try.c: Test mpn_addlsh2_n and mpn_{add,sub}lsh_n;
9259         mpn_rsblsh_n now tests all shift values.
9260         * tests/refmpn.c (refmpn_addlsh_n, refmpn_sublsh_n): New functions.
9261         (refmpn_addlsh1_n): Use generic refmpn_addlsh_n.
9262         (refmpn_sublsh1_n): Use generic refmpn_sublsh_n.
9263         (refmpn_addlsh2_n): New function.
9264         * tests/tests.h: Declare new functions.
9266 2009-12-06  Torbjorn Granlund  <tege@gmplib.org>
9268         * tune/tuneup.c (tune_mulmod_bnm1): Up min_size to 12.
9270         * Globally: Rename *mullow* to *mullo*, *MULLOW* to *MULLO*.
9272         * configure.in: Don't include ev5 directory for ev6* and ev7.  Misc
9273         alpha path cleanups.
9274         * mpn/alpha/add_n.asm: Replaced by mpn/alpha/ev5/add_n.asm.
9275         * mpn/alpha/sub_n.asm: Replaced by mpn/alpha/ev5/sub_n.asm.
9276         * mpn/alpha/lshift.asm: Replaced by mpn/alpha/ev5/lshift.asm.
9277         * mpn/alpha/rshift.asm: Replaced by mpn/alpha/ev5/rshift.asm.
9278         * mpn/alpha/com_n.asm: New, moved from mpn/alpha/ev5/rshift.asm.
9279         * mpn/alpha/ev5/diveby3.asm: New, moved from mpn/alpha/diveby3.asm.
9281         * mpn/powerpc64/mode64/diveby3.asm: Remove, it is slower than
9282         mpn_bdiv_dbm1c on all hardware.
9284         * mpn/generic/powm_sec.c: Rework logic for mpn_sqr_basecase size limit.
9286         * gmp-impl.h (mpn_redc_1_sec): Declare.
9287         * configure.in (gmp_mpn_functions): Add redc_1_sec.
9289 2009-12-06  Marco Bodrato <bodrato@mail.dm.unipi.it>
9291         * tests/devel/try.c (try_one): DATA_SRC0_HIGHBIT sets the high bit.
9293 2009-12-05  Marco Bodrato <bodrato@mail.dm.unipi.it>
9295         * mpn/generic/toom_eval_dgr3_pm1.c: Change return value: 0 or ~0.
9296         * mpn/generic/toom_eval_dgr3_pm2.c: Likewise.
9297         * mpn/generic/toom_eval_pm1.c: Likewise.
9298         * mpn/generic/toom_eval_pm2exp.c: Likewise.
9299         * mpn/generic/toom_eval_pm2.c: Rewrite to use mpn_addlsh2_n.
9301         * mpn/generic/toom_interpolate_5pts.c: Param sa is a flag, not a sign.
9303         * mpn/generic/toom33_mul.c: Adapt to changes above.
9304         * mpn/generic/toom3_sqr.c: Likewise.
9305         * mpn/generic/toom42_mul.c: Likewise.
9306         * mpn/generic/toom43_mul.c: Reduce branches.
9307         * mpn/generic/toom44_mul.c: Likewise.
9308         * mpn/generic/toom53_mul.c: Likewise.
9309         * mpn/generic/toom62_mul.c: Likewise.
9311         * mpn/generic/toom52_mul.c: Use toom_eval_ functions.
9313         * mpn/generic/toom4_sqr.c: Avoid C99 construct.
9314         * mpn/generic/toom_interpolate_7pts.c: Likewise.
9316 2009-12-05  Torbjorn Granlund  <tege@gmplib.org>
9318         * mpn/generic/redc_1_sec.c: New file.
9319         * mpn/generic/powm_sec.c: Use redc_1_sec.  Use dummy full subtract
9320         instead of mpn_cmp since the latter leaks to the side channel.
9321         (mpn_local_sqr_n): New function, with associated macros.
9322         (mpn_powm_sec): Use mpn_local_sqr_n.
9324         * configure.in (HAVE_NATIVE): Add missing functions, then sort.
9326 2009-12-04  Torbjorn Granlund  <tege@gmplib.org>
9328         * tune/tuneup.c (tune_dc_div): Up min_size to 6.
9329         (tune_mod_1): Set MOD_1_1_THRESHOLD min_size to 2.
9331         * tune/speed.h: Negate "binvert"-type inverses, as required.
9333         * mpn/generic/redc_1.c: Add ASSERTs.
9334         * mpn/generic/redc_2.c: Likewise.
9336         * mpn/generic/sbpi1_bdiv_q.c: Simplify loops, indexing.
9338 2009-12-03  Yann Droneaud  <yann@droneaud.fr>
9340         * acinclude.m4 ([long long reliability test 1]): Add a "static" for C99
9341         inline semantics compatibility.
9343 2009-12-03  Torbjorn Granlund  <tege@gmplib.org>
9345         * configure.in: Move intptr_t test into common AC_CHECK_TYPES.
9347         * mpn/generic/gcdext.c: Add a TMP_FREE.
9349 2009-12-03  Niels Möller  <nisse@lysator.liu.se>
9351         * mpn/generic/gcdext_1.c (mpn_gcdext_1) [GCDEXT_1_USE_BINARY]:
9352         Added various masking tricks.
9354         * mpn/generic/gcdext_1.c (mpn_gcdext_1) [GCDEXT_1_USE_BINARY]:
9355         Reimplemented binary gcdext, with proper canonicalization.
9357         * mpn/generic/gcdext_lehmer.c (mpn_gcdext_lehmer_n): Handle v == 0
9358         from mpn_gcdext_1.
9359         * mpn/generic/gcdext_1.c (mpn_gcdext_1): Allow inputs with a < b,
9360         assertions fixed accordingly.
9362 2009-12-03  Torbjorn Granlund  <tege@gmplib.org>
9364         * tune/tuneup.c: Tune DC_DIVAPPR_Q_THRESHOLD.  Rewrite
9365         DC_DIV_QR_THRESHOLD tuning code.
9366         (tune_dc_div): Rewrite.
9367         * tune/speed.h (SPEED_ROUTINE_MPN_PI1_DIV): New macro.
9368         * tune/common.c (speed_mpn_sbpi1_div_qr, speed_mpn_dcpi1_div_qr,
9369         speed_mpn_sbpi1_divappr_q, speed_mpn_sbpi1_bdiv_qr): New functions.
9370         * gmp-impl.h: Provide declarations for corresponding threshold vars.
9371         * tune/Makefile.am (TUNE_MPN_SRCS_BASIC): Add dcpi1_divappr_q.c.
9373         * tune/tuneup.c (tune_binvert): Up max_size.
9375 2009-12-02  Marco Bodrato <bodrato@mail.dm.unipi.it>
9377         * tests/devel/try.c: Test mpn_rsblsh2_n and mpn_rsblsh_n.
9378         * tests/refmpn.c (refmpn_rsblsh_n, refmpn_rsblsh2_n): New functions.
9379         (refmpn_rsblsh1_n): Use generic refmpn_rsblsh_n.
9380         * tests/tests.h: Declare new functions.
9382 2009-12-03  Niels Möller  <nisse@lysator.liu.se>
9384         * mpn/generic/gcdext_subdiv_step.c (mpn_gcdext_subdiv_step):
9385         Select the right cofactor in the cases A == B or A == 2B.
9387         * mpn/generic/gcdext_lehmer.c (mpn_gcdext_lehmer_n): Deleted
9388         handling of ap[0] == 0 and bp[0] == 0; these cases don't happen.
9389         Select the right cofactor in the case ap[0] == bp[0].
9390         * mpn/generic/gcdext.c (mpn_gcdext): Analogous changes.
9392 2009-12-02  Niels Möller  <nisse@lysator.liu.se>
9394         * gmp-h.in (mpn_gcdext_1): Updated prototype.
9395         * mpn/generic/gcdext_lehmer.c (mpn_gcdext_lehmer_n): Updated for
9396         signed cofactors from gcdext_1.
9397         * mpn/generic/gcdext_1.c (mpn_gcdext_1): Use Euclid's algorithm,
9398         and return signed cofactors.
9400 2009-12-02  Torbjorn Granlund  <tege@gmplib.org>
9402         * doc/gmp.texi (Low-level Functions): Document mpn_sqr_n.
9404         * tune/speed.c (routine): Add mpn_binvert.
9406         * tune/tuneup.c: Tune BINV_NEWTON_THRESHOLD.
9407         (tune_binvert): New function.
9408         * tune/speed.h (SPEED_ROUTINE_MPN_BINVERT): New macro.
9409         * tune/common.c (speed_mpn_binvert): New function.
9410         * gmp-impl.h: Provide declarations for corresponding threshold var.
9411         * tune/Makefile.am (TUNE_MPN_SRCS_BASIC): Add binvert.c.
9413         * tune/tuneup.c: Tune DC_BDIV_QR_THRESHOLD and DC_BDIV_Q_THRESHOLD.
9414         (tune_dc_bdiv): New function.
9415         (tune_dc_div): New name for tune_dc.
9416         * tune/speed.h (SPEED_ROUTINE_MPN_PI1_BDIV_QR,
9417         SPEED_ROUTINE_MPN_PI1_BDIV_Q): New macros.
9418         * tune/common.c (speed_mpn_sbpi1_bdiv_qr, speed_mpn_dcpi1_bdiv_qr,
9419         speed_mpn_sbpi1_bdiv_q, speed_mpn_dcpi1_bdiv_q): New functions.
9420         * gmp-impl.h: Provide declarations for corresponding threshold vars.
9421         * tune/Makefile.am (TUNE_MPN_SRCS_BASIC): Add dcpi1_bdiv_qr.c and
9422         dcpi1_bdiv_q.c.
9424 2009-12-01  Marco Bodrato <bodrato@mail.dm.unipi.it>
9426         * mpn/generic/toom53_mul.c: Removed double computation of vinf.
9428         * mpn/x86_64/aorrlsh_n.asm: Correct return value for rsblsh_n.
9429         * mpn/asm-defs.m4 (define_mpn): Add rsblsh_n.
9430         * gmp-impl.h (mpn_rsblsh_n): Added prototype and name-mangling.
9432         * mpn/generic/fib2_ui.c: Reduce the amount of temporary storage.
9433         Use mpn_rsblsh_n.
9435 2009-12-01  Torbjorn Granlund  <tege@gmplib.org>
9437         * mpn/generic/redc_n.c: Rework temp allocation.
9439         * mpn/generic/dcpi1_bdiv_qr.c (mpn_dcpi1_bdiv_qr_n_itch): Add pi1 also
9440         to this function.
9442         * mpn/generic/dcpi1_bdiv_q.c: Get the mpn_sbpi1_bdiv_q call right.
9443         Misc cleanups.
9445         * tune/speed.c (routine): Fix typo in last change.
9446         Add mpn_redc_2.
9448         * tune/speed.h (SPEED_ROUTINE_REDC_N): Set min size properly.
9450 2009-12-01  Niels Möller  <nisse@lysator.liu.se>
9452         * tune/speed.c (routine): Added mpn_toom42_mul and mpn_redc_n.
9453         * tune/speed.h (SPEED_ROUTINE_MPN_TOOM42_MUL): New macro.
9454         (speed_mpn_toom42_mul): Declare function.
9455         * tune/common.c (speed_mpn_toom42_mul): New function.
9456         * gmp-impl.h (MPN_TOOM42_MUL_MINSIZE): New constant.
9458 2009-11-30  Marco Bodrato <bodrato@mail.dm.unipi.it>
9460         * mpn/generic/fib2_ui.c: Use mpn_rsblsh2_n.
9462 2009-11-29  Torbjorn Granlund  <tege@gmplib.org>
9464         * mpn/x86_64/pentium4/gmp-mparam.h
9465         (HAVE_NATIVE_mpn_addlsh1_n, HAVE_NATIVE_mpn_sublsh1_n): Don't undef.
9467         * Makefile.am (EXTRA_DIST): Remove macos.
9469 2009-11-28  Torbjorn Granlund  <tege@gmplib.org>
9471         * tune/tuneup.c (tune_redc): Set min_size to 16 for redc_n tuning.
9473         * mpn/x86_64/sqr_basecase.asm (SQR_TOOM2_THRESHOLD_MAX): Avoid quoting
9474         to allow configure.in parse it more easily.  Trim from 120 to 80.
9476 2009-11-28  Marco Bodrato <bodrato@mail.dm.unipi.it>
9478         * mpn/generic/mulmod_bnm1.c: Basecases made simpler, this also corrects
9479         a bug affecting previous version.
9481 2009-11-28  Torbjorn Granlund  <tege@gmplib.org>
9483         * configure.in: Handle atom also in 32-bit mode.
9484         * mpn/x86/atom/gmp-mparam.h: New file.
9486         * gmp-impl.h (MULMOD_BNM1_THRESHOLD): Default.
9488         * mpn/generic/redc_n.c: Use mpn_mulmod_bnm1 instead of mpn_mul_n.
9490         * Use TMP_ALLOC_LIMBS consistently.
9491         * Finish renaming BITS_PER_MP_LIMB to GMP_LIMB_BITS.
9493         * macos: Remove entire directory.
9495 2009-11-27  Torbjorn Granlund  <tege@gmplib.org>
9497         * mpn/x86_64/corei/gmp-mparam.h: New file.
9498         * mpn/x86_64/core2/gmp-mparam.h: Now for just core2.
9499         * mpn/powerpc64/mode64/p3/gmp-mparam.h: New file.
9500         * mpn/powerpc64/mode64/p4/gmp-mparam.h: New file.
9501         * mpn/powerpc64/mode64/p5/gmp-mparam.h: New file.
9503         * config.guess: Return "corei" for core i7 and core i5.
9504         * config.sub: Recognise "corei".
9505         * acinclude.m4 (X86_64_PATTERN): Add corei.
9506         * configure.in (powerpc): Set up more CPU-specific paths.
9507         (x86): Handle corei.
9509         * mpz/powm.c: Allow input operand overlap also when exponent = 1.
9510         Misc cleanups.
9512 2009-11-26  Marco Bodrato <bodrato@mail.dm.unipi.it>
9514         * tests/mpn/t-mulmod_bnm1.c: New test file.
9515         * tests/mpn/Makefile.am (check_PROGRAMS): Add t-mulmod_bnm1.
9517         * mpn/generic/mullow_n.c: Comments on Mulders' trick implementation.
9519 2009-11-26  Torbjorn Granlund  <tege@gmplib.org>
9521         * mpn/generic/powm.c: Make comments reflect current code state.
9523         * tests/devel/try.c: Make mpn_mullow_n testing actually work.
9525 2009-11-25  Torbjorn Granlund  <tege@gmplib.org>
9527         * mpz/powm.c: Clean up unused defs.
9529 2009-11-24  Torbjorn Granlund  <tege@gmplib.org>
9531         * tune/tuneup.c (tune_redc): Rewrite.
9532         * mpn/generic/powm.c: Use REDC_1_TO_REDC_2_THRESHOLD,
9533         REDC_1_TO_REDC_N_THRESHOLD, and REDC_2_TO_REDC_N_THRESHOLD.
9534         Get rid of previous REDC params, including LOCAL_REDC_N_THRESHOLD.
9535         (WANT_REDC_2): Define.
9536         * gmp-impl.h: Corresponding changes.
9538 2009-11-23  Torbjorn Granlund  <tege@gmplib.org>
9540         * mpn/generic/powm.c: Fix typo.
9541         Define LOCAL_REDC_N_THRESHOLD, use in REDC_2_THRESHOLD...
9542         REDC_N_THRESHOLD chain.
9544 2009-11-22  Torbjorn Granlund  <tege@gmplib.org>
9546         * tune/tuneup.c (tune_mullow): Set min_size to 1.
9548         * mpn/generic/powm_sec.c: Use just mpn_mul_basecase and
9549         mpn_sqr_basecase for multiplication and squaring.
9551         * tune/tuneup.c: Tune REDC_2_THRESHOLD and REDC_N_THRESHOLD.
9552         (tune_redc): New function.
9553         (tune_powm): Remove function.
9554         * tune/speed.h (SPEED_ROUTINE_REDC_2, SPEED_ROUTINE_REDC_N): New.
9555         * tune/common.c (speed_mpn_redc_2, speed_mpn_redc_n): New.
9557         * mpz/powm.c: Complete rewrite.  Use mpn_powm and mpn_powlo.
9558         * mpn/generic/powm.c: Rewrite.
9559         * mpn/generic/redc_n.c: New file.
9560         * configure.in (gmp_mpn_functions): Add redc_n.
9561         * gmp-impl.h (REDC_2_THRESHOLD, REDC_N_THRESHOLD): Default, and define
9562         for tuneup.
9564 2009-11-21  Marco Bodrato <bodrato@mail.dm.unipi.it>
9566         * mpn/generic/mullow_n.c: Disable Mulders' trick for small operands,
9567         use fft for bigger ones.
9568         * tests/mpn/t-mullo.c: New test file.
9570 2009-11-22  Torbjorn Granlund  <tege@gmplib.org>
9572         * tune/tuneup.c (tune_mullow): Rewrite.
9574 2009-11-21  Marco Bodrato <bodrato@mail.dm.unipi.it>
9576         * gmp-impl.h: Removed unused macros (CACHED_ABOVE_THRESHOLD and
9577         CACHED_BELOW_THRESHOLD).
9579         * mpn/generic/mullow_n.c: Use Mulders' trick.
9580         * tune/tuneup.c (tune_mullow): MULLOW_MUL_N_THRESHOLD range of
9581         search depends on FFT tuning;
9582         (all): Anticipate tune_fft_{mul,sqr}.
9584         * tune/speed.c (routine): Add entry related to mpn_mulmod_bnm1.
9586 2009-11-19  Niels Möller  <nisse@lysator.liu.se>
9588         * mpn/generic/toom_eval_dgr3_pm2.c (mpn_toom_eval_dgr3_pm2)
9589         [HAVE_NATIVE_mpn_add_n_sub_n]: Fixed typo in mpn_add_n_sub_n call
9590         (spotted by Marco Bodrato).
9591         * mpn/generic/toom_eval_pm2.c (mpn_toom_eval_pm2): Likewise.
9592         * mpn/generic/toom_eval_pm2exp.c (mpn_toom_eval_pm2exp): Likewise.
9594         * mpn/generic/toom_eval_pm2.c (mpn_toom_eval_pm2) [HAVE_NATIVE_mpn_addlsh_n]:
9595         Fixed missing declaration.
9597         * mpn/asm-defs.m4 (define_mpn): Add addlsh_n.
9598         * gmp-impl.h (mpn_addlsh_n): Added prototype and name-mangling.
9600 2009-11-19  Niels Möller  <nisse@lysator.liu.se>
9602         * mpn/generic/toom_eval_pm2.c (mpn_toom_eval_pm2): New file.
9603         * mpn/generic/toom53_mul.c (mpn_toom53_mul): Use mpn_toom_eval_pm2.
9604         * mpn/generic/toom62_mul.c (mpn_toom62_mul): Likewise.
9605         * configure.in (gmp_mpn_functions): Added toom_eval_dgr3_pm2.
9607 2009-11-18  Torbjorn Granlund  <tege@gmplib.org>
9609         * gmp-impl.h (mpn_and_n, etc): Adapt to now-public logic functions.
9611         * config.guess: Recognise VIA nano.
9612         * config.sub: Likewise.
9613         * configure.in: Generalise x86_64 support; recognise VIA nano.
9615 2009-11-16  Torbjorn Granlund  <tege@gmplib.org>
9617         * tune/speed.c (routine): Add measurement of mpn_addlsh2_n,
9618         mpn_sublsh2_n, mpn_rsblsh2_n.
9619         * tune/common.c: Add speed routines for lsh2 functions.
9621         * mpn/generic/divis.c: Use MU_BDIV_QR_THRESHOLD.
9623         * configure.in (gmp_mpn_functions_optional): Add *lsh_n functions.
9625         * mpn/generic/toom_eval_pm2exp.c: Make HAVE_NATIVE_mpn_addlsh_n code
9626         work.
9628         * mpn/x86_64/aorrlsh2_n.asm: Optimise inner loop.
9630         * configure.in (gmp_mpn_functions_optional): Remove copyi,copyd, they
9631         are now in gmp_mpn_functions.  Analogously move logical functions.
9633 2009-11-16  Marco Bodrato <bodrato@mail.dm.unipi.it>
9635         * mpn/generic/toom53_mul.c: Use addlsh2 for evaluation (and fix typo).
9636         * mpn/generic/toom_eval_dgr3_pm2.c: Likewise (affects toom44 and 43).
9638         * mpn/asm-defs.m4: Fix comments for op_lsh2 new functions.
9639         * gmp-impl.h: Likewise.
9640         * tests/mpz/t-fac_ui.c: Fix a comment.
9642 2009-11-15  Torbjorn Granlund  <tege@gmplib.org>
9644         * mpn/x86_64/aorrlsh2_n.asm: New file.
9645         * configure.in: Add support for addlsh2_n, sublsh2_n, and rsblsh2_n,
9646         including mulfuncs.
9647         * gmp-impl.h (mpn_addlsh2_n, mpn_sublsh2_n, mpn_rsblsh2_n): Declare.
9648         * mpn/asm-defs.m4: Likewise.
9650         * mpn/generic/copyi.c: New file.
9651         * mpn/generic/copyd.c: Likewise.
9652         * mpn/generic/zero.c: Likewise.
9653         * gmp-h.in: Declare new functions.
9654         * configure.in (gmp_mpn_functions): Add new functions.
9656 2009-11-15  Marco Bodrato <bodrato@mail.dm.unipi.it>
9658         * mpn/generic/mulmod_bnm1.c (mpn_mulmod_bnm1_next_size): fix typo
9660         * mpn/generic/toom33_mul.c: Use rsblsh1 for evaluation.
9661         * mpn/generic/toom3_sqr.c: Likewise.
9663 2009-11-14  Torbjorn Granlund  <tege@gmplib.org>
9665         * mpn/generic/toom52_mul.c: Use mpn_addlsh1_n.
9667         * mpn/generic/toom52_mul.c: Toggle the right flag bit in an
9668         HAVE_NATIVE_mpn_add_n_sub_n arm.
9670         * tests/mpz/t-remove.c: New file.
9672         * mpn/generic/remove.c: Major overhaul.  Add parameter 'cap'.
9674         * mpn/generic/binvert.c: Fix typo in last change.
9676         * mpn/generic/bdiv_qr.c: Make it actually work.  Also use passed-in
9677         scratch space.
9679         * mpn/generic/mu_bdiv_qr.c: Reset FFT parameters for each call.
9681 2009-11-12  Torbjorn Granlund  <tege@gmplib.org>
9683         * mpn/x86/k7/gcd_1.asm (MASK): Compute from MAXSHIFT.
9685 2009-11-11  Torbjorn Granlund  <tege@gmplib.org>
9687         * mpn/generic/binvert.c: Simplify, fix comments.
9689         * tests/devel/try.c: Test mpn_invert and mpn_binvert.
9691         * tests/refmpn.c (refmpn_invert, refmpn_binvert): New functions.
9692         * tests/tests.h: Declare new functions.
9694 2009-11-10  Torbjorn Granlund  <tege@gmplib.org>
9696         * configure.in: Supply compiler options for atom in 32-bit mode.
9698         * acinclude.m4 (X86_64_PATTERN): New.
9699         * configure.in: Setup and use X86_64_PATTERN.
9701         * mpn/x86_64/fat/fat.c: New file.
9702         * mpn/x86_64/fat/fat_entry.asm: New file.
9703         * mpn/x86_64/fat: Copy C placeholder files from mpn/x86/fat.
9704         * mpn/x86_64/x86_64-defs.m4 (CPUVEC_FUNCS_LIST): New, copied from
9705         mpn/x86/x86-defs.m4.
9706         * configure.in: Move down x86 fat setup code until after ABI has been
9707         determined; generalise to handle x86_64.
9709 2009-11-09  Torbjorn Granlund  <tege@gmplib.org>
9711         * mpn/x86/fat/mod_1.c: New file.
9713         * acinclude.m4 (GMP_C_FOR_BUILD_ANSI): Avoid poor quoting.
9715 2009-11-08  Torbjorn Granlund  <tege@gmplib.org>
9717         * gmp-impl.h (MPN_LOGOPS_N_INLINE): Rewrite, update interface.  Callers
9718         updated.
9719         * mpn/generic/logops_n.c: New file.
9720         * doc/gmp.texi (Low-level Functions): Document logical mpn functions.
9722 2009-11-07  Torbjorn Granlund  <tege@gmplib.org>
9724         * tune/speed.h (SPEED_ROUTINE_MPN_MULMOD_BNM1): Adapt to new
9725         mpn_mulmod_bnm1 interface.
9727 2009-11-07  Marco Bodrato <bodrato@mail.dm.unipi.it>
9729         * mpn/generic/mulmod_bnm1.c: New interface, with size
9730         specified for all operands in mpn_mulmod_bnm1.
9731         * gmp-impl.h: Changed mpn_mulmod_bnm1 prototype.
9733 2009-11-05  Torbjorn Granlund  <tege@gmplib.org>
9735         * mpn/x86/k7/gcd_1.asm: Actually use div-reduced value.
9736         Mnemonic cleanup.
9738         * mpn/x86_64/gcd_1.asm: New file.
9740 2009-11-03  Torbjorn Granlund  <tege@gmplib.org>
9742         * tune/Makefile.am (TUNE_MPN_SRCS_BASIC): Add sqr_n.c.
9744 2009-11-03  Marco Bodrato <bodrato@mail.dm.unipi.it>
9746         * mpn/generic/toom_interpolate_6pts.c: removed an addmul_1 and cleanup.
9748 2009-11-02  Torbjorn Granlund  <tege@gmplib.org>
9750         * configure.in (gmp_mpn_functions): Remove obsolete functions
9751         dc_divrem_n and sb_divrem_mn.
9752         * gmp-impl.h: Misc cleanup.
9753         (mpn_sb_divrem_mn, mpn_dc_divrem_n): Remove.
9754         (DIV_DC_THRESHOLD): Remove.
9755         * mpn/generic/dc_divrem_n.c: Remove.
9756         * mpn/generic/sb_divrem_mn.c: Remove.
9757         * mpn/generic/tdiv_qr.c: Use DC_DIV_QR_THRESHOLD, not DIV_DC_THRESHOLD.
9759         * tests/devel/try.c: Replace mpn_sb_divrem_mn by mpn_sbpi1_div_qr.
9760         * tests/refmpn.c (refmpn_sb_div_qr): New name for refmpn_sb_divrem_mn.
9762         * tune/Makefile.am (libspeed_la_SOURCES): Remove sb_div.c and sb_inv.c.
9763         (TUNE_MPN_SRCS_BASIC): Remove sb_divrem_mn.c.
9764         * tune/common.c (speed_mpn_dcpi1_div_qr_n): New function.
9765         Remove mpn_sb_divrem_mn related functions.
9766         * tune/speed.c (routine): Remove entries related to mpn_dc_divrem and
9767         mpn_sb_divrem.
9768         (routine): New entry for mpn_dc_div_qr_n.
9769         * tune/speed.h (SPEED_ROUTINE_MPN_DC_DIVREM_CALL): Compute inverse
9770         needed by pi1 calls.
9771         (SPEED_ROUTINE_MPN_SB_DIVREM_M3): Remove.
9772         * tune/tuneup.c (tune_sb_preinv): Remove.
9773         (tune_dc): Update to measure DC_DIV_QR_THRESHOLD.
9775         * mpn/generic/sb_divappr_q.c: Remove.
9777 2009-11-01  Torbjorn Granlund  <tege@gmplib.org>
9779         * gmp-impl.h: Misc minor cleanups.
9781 2009-10-31  Torbjorn Granlund  <tege@gmplib.org>
9783         * gmp-impl.h (toom itch functions): Simplify, make some into macros.
9784         (MPN_KARA_MUL_N_TSIZE, MPN_KARA_SQR_N_TSIZE): Remove.
9785         * mpn/generic/mul_n.c (mpn_toom3_mul_n, mpn_toom3_sqr_n): Remove.
9786         * mpn/generic/mul_n.c (mpn_sqr_n): Move from here...
9787         * mpn/generic/sqr_n.c: ...to this new file.
9788         * configure.in (gmp_mpn_functions): Add sqr_n.
9790         * Globally change
9791           MUL_TOOM3_THRESHOLD => MUL_TOOM33_THRESHOLD,
9792           MUL_KARATSUBA_THRESHOLD => MUL_TOOM22_THRESHOLD,
9793           SQR_KARATSUBA_THRESHOLD => SQR_TOOM2_THRESHOLD,
9794         and associated names analogously.
9796 2009-10-31  Niels Möller  <nisse@lysator.liu.se>
9798         * mpn/generic/toom_interpolate_7pts.c: Changed evaluation points,
9799         replacing -1/2 by -2.
9800         * mpn/generic/toom44_mul.c: Updated to use new evaluation points,
9801         and use mpn_toom_eval_dgr3_pm2.
9802         * mpn/generic/toom4_sqr.c (mpn_toom4_sqr): Likewise.
9803         * mpn/generic/toom53_mul.c (mpn_toom53_mul): Updated to use new
9804         evaluation points, and use mpn_toom_eval_pm1 and
9805         mpn_toom_eval_pm2exp.
9806         * mpn/generic/toom62_mul.c (mpn_toom62_mul): Likewise.
9808         * mpn/generic/toom_eval_pm2exp.c: New file.
9809         * mpn/generic/toom_eval_pm1.c: New file.
9811         * mpn/generic/toom43_mul.c (mpn_toom43_mul): Use
9812         mpn_toom_eval_dgr3_pm2.
9814 2009-10-30  Torbjorn Granlund  <tege@gmplib.org>
9816         * tune/Makefile.am (TUNE_MPN_SRCS_BASIC): Add toom2* and toom3* files.
9818 2009-10-30  Niels Möller  <nisse@lysator.liu.se>
9820         * configure.in (gmp_mpn_functions): Added toom_eval_dgr3_pm2.
9821         * gmp-impl.h: Added prototype for mpn_toom_eval_dgr3_pm2.
9822         * mpn/generic/toom_eval_dgr3_pm2.c: New file.
9824 2009-10-29  Niels Möller  <nisse@lysator.liu.se>
9826         * mpn/generic/toom43_mul.c (mpn_toom43_mul): Use
9827         mpn_toom_eval_dgr3_pm1.
9828         * mpn/generic/toom42_mul.c (mpn_toom42_mul): Likewise.
9830 2009-10-29  Torbjorn Granlund  <tege@gmplib.org>
9832         * mpn/generic/mulmod_bnm1.c: Replace some add_1 by INCR.
9834         * gmp-impl.h (mpn_mulmod_bnm1_itch): New macro.
9836         * mpn/generic/mulmod_bnm1.c (mpn_mulmod_bnm1): Call mpn_mul_fft.
9837         (mpn_mulmod_bnm1_next_size): Adopt to SS FFT.
9839         * mpn/generic/mul_fft.c (mpn_mul_fft): Make it return high limb.
9840         (mpn_mul_fft_internal): Likewise.
9842         * mpn/generic/mulmod_bnm1.c: New file, by Niels Möller.
9843         * configure.in (gmp_mpn_functions): Add mulmod_bnm1.
9844         * gmp-impl.h: Add related declarations.
9845         * tune/tuneup.c: Tune MULMOD_BNM1_THRESHOLD.
9846         * tune/speed.h (SPEED_ROUTINE_MPN_MULMOD_BNM1): New macro.
9847         * tune/common.c (speed_mpn_mulmod_bnm1): New function.
9848         * Makefile.am (TUNE_MPN_SRCS_BASIC): Add mulmod_bnm1.c.
9850         * gmp-impl.h (mpn_kara_mul_n, mpn_kara_sqr_n): Remove declarations.
9851         * tune/common.c: Remove/rename kara functions.
9852         * tune/speed.h: Likewise.
9854         * tests/devel/try.c: Clean up usage of %p printf arguments.
9856         * gmp-impl.h: Update MUL/SQR MINSIZE macros to reflect new function
9857         names and limitations
9858         * tune/tuneup.c: Use updated macro names.
9859         * tune/speed.h: Likewise.
9860         * tests/devel/try.c: Test new mul/sqr functions, remove old tests.
9862 2009-10-29  Niels Möller  <nisse@lysator.liu.se>
9864         * tune/speed.c: Added support for mpn_toom4_sqr,
9866         * tune/speed.h (SPEED_ROUTINE_MPN_TOOM4_SQR): New macro.
9867         (SPEED_ROUTINE_MPN_KARA_MUL_N): Deleted.
9868         (SPEED_ROUTINE_MPN_TOOM3_MUL_N): Deleted.
9869         (SPEED_ROUTINE_MPN_TOOM2_SQR): Use mpn_toom2_sqr_itch.
9871         * gmp-impl.h (mpn_toom3_mul_n, mpn_toom3_sqr_n): Remove
9872         declarations.
9873         (mpn_toom2_sqr_itch): Add margin for recursive calls.
9875 2009-10-28  Niels Möller  <nisse@lysator.liu.se>
9877         * mpn/generic/mul_n.c (mpn_kara_mul_n): Deleted old Karatsuba
9878         implementation.
9879         (mpn_kara_sqr_n): Likewise deleted.
9881         * mpn/generic/mul_n.c (mpn_sqr_n): Use mpn_toom2_sqr and
9882         mpn_toom3_sqr, not the old implementations.
9884         * gmp-impl.h (MPN_TOOM3_MUL_N_TSIZE): Deleted, replaced by
9885         mpn_toom33_mul_itch.
9886         (MPN_TOOM3_SQR_N_TSIZE): Deleted, replaced by
9887         mpn_toom3_sqr_itch.
9888         (mpn_toom33_mul_itch): Needs more scratch.
9889         (mpn_toom3_sqr_itch): Likewise.
9890         * tune/speed.h (SPEED_ROUTINE_MPN_TOOM3_MUL_N): Use
9891         mpn_toom33_mul_itch.
9892         (SPEED_ROUTINE_MPN_TOOM3_SQR_N): Use mpn_toom3_sqr_itch.
9893         * mpn/generic/mul_n.c (mpn_mul_n): Use mpn_toom33_mul_itch.
9894         (mpn_sqr_n): Use mpn_toom3_sqr_itch.
9896         * mpn/generic/toom33_mul.c (mpn_toom33_mul): Avoid TMP_ALLOC. Needs
9897         some more supplied scratch instead.
9898         * mpn/generic/toom3_sqr.c (mpn_toom3_sqr): Likewise.
9900 2009-10-26  Torbjorn Granlund  <tege@gmplib.org>
9902         * gmp-impl.h (invert_pi1): Streamline, as suggested by Niels.
9904 2009-10-24  Torbjorn Granlund  <tege@gmplib.org>
9906         * mpn/generic/bdiv_q.c: Update to call new functions.
9907         * mpn/generic/bdiv_qr.c: Likewise.
9908         * mpn/generic/binvert.c: Likewise.
9909         * mpn/generic/divexact.c: Likewise.
9910         * mpn/generic/divis.c: Likewise.
9911         * mpn/generic/perfpow.c: Likewise.
9912         * mpn/generic/tdiv_qr.c: Likewise.
9913         * mpn/generic/dcpi1_bdiv_q.c: New file.
9914         * mpn/generic/dcpi1_bdiv_qr.c: New file.
9915         * mpn/generic/dcpi1_div_q.c: New file.
9916         * mpn/generic/dcpi1_div_qr.c: New file.
9917         * mpn/generic/dcpi1_divappr_q.c: New file.
9918         * mpn/generic/sbpi1_bdiv_q.c: New file.
9919         * mpn/generic/sbpi1_bdiv_qr.c: New file.
9920         * mpn/generic/sbpi1_div_q.c: New file.
9921         * mpn/generic/sbpi1_div_qr.c: New file.
9922         * mpn/generic/sbpi1_divappr_q.c: New file.
9923         * mpn/generic/dc_bdiv_q.c: Removed.
9924         * mpn/generic/dc_bdiv_qr.c: Removed.
9925         * mpn/generic/dc_div_q.c: Removed.
9926         * mpn/generic/dc_div_qr.c: Removed.
9927         * mpn/generic/dc_divappr_q.c: Removed.
9928         * mpn/generic/sb_bdiv_q.c: Removed.
9929         * mpn/generic/sb_bdiv_qr.c: Removed.
9930         * mpn/generic/sb_div_q.c: Removed.
9931         * mpn/generic/sb_div_qr.c: Removed.
9933         * configure.in (gmp_mpn_functions): Add new division functions, remove
9934         obsolete division functions.
9936         * gmp-impl.h: Add declarations of new division functions, remove
9937         corresponding obsolete declarations.
9938         (gmp_pi1_t, gmp_pi2_t): New types.
9939         (invert_pi1): New macro for computing 2/1 and 3/2 inverses.
9941 2009-10-23  Niels Möller  <nisse@lysator.liu.se>
9943         * gmp-impl.h (mpn_toom62_mul_itch): New function.
9945         * tests/mpn/t-toom53.c: New test program.
9946         * tests/mpn/t-toom62.c: New test program.
9948 2009-10-23  Torbjorn Granlund  <tege@gmplib.org>
9950         * mpn/generic/get_d.c: Fix code handling denorms for 64-bit machines.
9951         * tests/mpf/t-get_d.c (test_denorms): New function.
9953 2009-10-23  Niels Möller  <nisse@lysator.liu.se>
9955         * mpn/generic/toom52_mul.c (mpn_toom52_mul): Use supplied scratch
9956         space, not TMP_ALLOC. Interface change, now requires input sizes
9957         such that s + t >= 5.
9959         * gmp-impl.h (mpn_toom52_mul_itch): New function.
9961         * tests/mpn/t-toom52.c: New test program.
9963 2009-10-22  Torbjorn Granlund  <tege@gmplib.org>
9965         * mpn/x86_64/sqr_basecase.asm: Tune for speed and a 7% size decrease.
9967 2009-10-22  Niels Möller  <nisse@lysator.liu.se>
9969         * tests/mpn/t-toom44.c: New test program.
9970         * tests/mpn/t-toom33.c: New test program.
9972         * tests/mpn/toom-shared.h (main): Reorganized input generation.
9973         Users are now supposed to define macros MAX_AN, MIN_BN and MAX_BN.
9974         Updated existing toom test programs.
9976 2009-10-22  Torbjorn Granlund  <tege@gmplib.org>
9978         * tests/devel/try.c: Fix typos in last change.
9980 2009-10-21  Torbjorn Granlund  <tege@gmplib.org>
9982         * mpn/asm-defs.m4 (define_mpn): Add mullow_basecase.
9984         * tests/devel/try.c: Test mpn_mullow_n.
9986         * tests/refmpn.c (refmpn_mullow_n): New function.
9987         * tests/tests.h: Declare it.
9989 2009-10-21  Niels Möller  <nisse@lysator.liu.se>
9991         * tests/mpn/toom-shared.h (main): Check for writes outside of the
9992         product or scratch area.
9994         * gmp-impl.h (mpn_toom43_mul_itch): New function.
9996         * mpn/generic/toom43_mul.c (mpn_toom43_mul): Use supplied scratch
9997         space, not TMP_ALLOC. Interface change, now requires input sizes
9998         such that s + t >= 5.
10000 2009-10-20  Niels Möller  <nisse@lysator.liu.se>
10002         * tests/mpn/toom-shared.h (MIN_BLOCK): New constant, which can be
10003         overridden by users. Needed by t-toom42 and t-toom43.
10005         * tests/mpn/Makefile.am (check_PROGRAMS): Added t-toom32,
10006         t-toom42 and t-toom43.
10007         * tests/mpn/t-toom43.c: New test program.
10008         * tests/mpn/t-toom42.c: New test program.
10009         * tests/mpn/t-toom32.c: New test program.
10011         * tests/mpn/Makefile.am (check_PROGRAMS): Added t-toom22.
10012         * tests/mpn/t-toom22.c: New test file.
10013         * tests/mpn/toom-shared.h: New file. Test framework for Toom
10014         functions.
10016 2009-10-14  Niels Möller  <nisse@lysator.liu.se>
10018         * mpn/generic/hgcd.c (mpn_hgcd_itch): Thanks to the new
10019         mpn_matrix22_mul_strassen, the scratch need is reduced by 16%.
10021 2009-10-14  Marco Bodrato  <bodrato@mail.dm.unipi.it>
10023         * mpn/generic/matrix22_mul.c (mpn_matrix22_mul_strassen): New
10024         Strassen-like algorithm, to reduce the amount of temporary
10025         storage.
10026         (mpn_matrix22_mul_itch): Updated to reflect the reduced storage
10027         need.
10029 2009-10-03  Torbjorn Granlund  <tege@gmplib.org>
10031         * Rename mpn_addsub_n to mpn_add_n_sub_n.
10033 2009-10-01  Torbjorn Granlund  <tege@gmplib.org>
10035         * mpn/generic/tdiv_qr.c: Call mpn_divrem_1 and mpn_dc_div_qr instead of
10036         old functions.
10038         * mpn/generic/mul_n.c: Call toom22 and toom33 instead of old functions.
10040         * mpn/generic/toom42_mul.c (TOOM42_MUL_N_REC): Renamed from
10041         TOOM22_MUL_N_REC.  Unconditionally call the generic mpn_mul_n.
10042         * mpn/generic/toom32_mul.c: Analogous changes.
10044 2009-09-28  Niels Möller  <nisse@lysator.liu.se>
10046         * mpn/x86_64/invert_limb.asm: Rewrite. Exploit cancellation in the
10047         Newton iteration.
10049 2009-09-27  Niels Möller  <nisse@lysator.liu.se>
10051         * mpn/x86/invert_limb.asm: Reduce register usage. Eliminated $1
10052         arguments to add, sub and shift.
10054 2009-09-25  Niels Möller  <nisse@lysator.liu.se>
10056         * mpn/x86/invert_limb.asm: New file.
10058 2009-09-24  Torbjorn Granlund  <tege@gmplib.org>
10060         * mpn/generic/toom33_mul.c: Use new toom functions for all recursive
10061         products.
10062         * mpn/generic/toom3_sqr.c: Likewise.
10063         * mpn/generic/toom44_mul.c: Likewise.
10064         * mpn/generic/toom4_sqr.c: Likewise.
10066         * mpn/generic/add_n.c: Relax operand overlap ASSERTs.
10067         * mpn/generic/sub_n.c: Likewise.
10069 2009-09-15  Torbjorn Granlund  <tege@gmplib.org>
10071         Suggested by Uwe Mueller:
10072         * printf/doprnt.c: Use "%ld" for exponent printing.
10073         * printf/doprntf.c (__gmp_doprnt_mpf): Make expval "long".
10075 2009-09-14  Torbjorn Granlund  <tege@gmplib.org>
10077         * configure.in: Handle mingw64.
10078         * gmp-impl.h (gmp_intptr_t): Declare.
10079         * tests/amd64check.c (calling_conventions_values): Use CNST_LIMB.
10080         * tests/memory.c: Use gmp_intptr_t; print pointers using C90 "%p".
10081         * tests/misc.c: Use gmp_intptr_t.
10082         * tests/mpq/t-get_str.c: Print pointers using C90 "%p".
10084 2009-08-12  Torbjorn Granlund  <tege@gmplib.org>
10086         * mpn/generic/mod_1_1.c (mpn_mod_1_1p_cps): Remove silly ASSERT code.
10088         * mpn/asm-defs.m4 (define_mpn): Remove mod_1s_1p, add mod_1_1p.
10090         * mpn/arm/invert_limb.asm: Complete rewrite.
10092         * longlong.h: Document LONGLONG_STANDALONE and NO_ASM.
10094 2009-08-05  Torbjorn Granlund  <tege@gmplib.org>
10096         * tests/mpz/dive_ui.c (check_random): Avoid zero divisors.
10098 2009-07-31  Torbjorn Granlund  <tege@gmplib.org>
10100         * mpn/generic/mod_1_1.c: Tweak to handle any modulus (possibility
10101         pointed out by Per Austrin).
10102         (mpn_mod_1_1p): Renamed from mpn_mod_1s_1p.
10103         (mpn_mod_1_1p_cps): Renamed from mpn_mod_1s_1p_cps.
10104         *mpn/generic/mod_1.c (mpn_mod_1): Reorganise to call mpn_mod_1_1p for
10105         any modulus.
10107 2009-07-28  Torbjorn Granlund  <tege@gmplib.org>
10109         * configure.in: Pass arch for x86 also in 64-bit mode.
10111 2009-07-26  Torbjorn Granlund  <tege@swox.com>
10113         * config.guess (_cpuid): Recognise more Intel "Core" processors.
10115 2009-07-13  Torbjorn Granlund  <tege@gmplib.org>
10117         * mpf/eq.c: Rewrite.
10119         * tests/mpf/t-eq.c: New test.
10121 2009-07-06  Torbjorn Granlund  <tege@gmplib.org>
10123         * gmp-impl.h (__mp_bases): Remove this alias.
10125         * mpf/get_str.c: Use less overflow prone expression for computing limb
10126         allocation.
10127         * mpz/inp_str.c: Likewise.
10128         * mpf/set_str.c: Likewise.
10129         * mpz/set_str.c: Likewise.
10131 2009-07-03  Niels Möller  <nisse@lysator.liu.se>
10133         * mpn/generic/gcd_1.c (mpn_gcd_1): Use masking tricks to reduce
10134         the number of branches in the loop.
10136 2009-06-28  Torbjorn Granlund  <tege@gmplib.org>
10138         * demos/factorize.c (factor_using_pollard_rho): Rewrite.
10140         * mpz/clears.c: New file.
10141         * mpq/clears.c: New file.
10142         * mpf/clears.c: New file.
10143         * gmp-h.in (mpz_clears, mpq_clears, mpf_clears): Declare.
10144         * mpz/Makefile.am: Add clears.c.
10145         * mpq/Makefile.am: Add clears.c.
10146         * mpf/Makefile.am: Add clears.c.
10147         * Makefile.am: Add these also to respective OBJECTS variables.
10148         * doc/gmp.texi: Document inits function and clears functions.
10150 2009-06-20  Torbjorn Granlund  <tege@gmplib.org>
10152         * mp-h.in (mp_bitcnt_t): Declare here too.
10154 2009-06-19  Torbjorn Granlund  <tege@gmplib.org>
10156         * mpq/inits.c: New file.
10157         * mpf/inits.c: New file.
10158         * gmp-h.in (mpz_inits, mpq_inits, mpf_inits): Declare .
10160         * mpn/generic/remove.c: New file.
10161         * configure.in (gmp_mpn_functions): Add remove.
10162         * gmp-impl.h (mpn_remove): Declare.
10164         * gmp-h.in (mp_bitcnt_t): New basic type.
10165         * mpn/generic/perfpow.c (mp_bitcnt_t): Remove private definition.
10167         * mpn/generic/bdiv_qr.c: Make it actually work.
10169         * mpn/x86_64/core2/aorsmul_1.asm: Rewrite to use shorter pipeline and
10170         to need fewer registers.
10172 2009-06-17  Torbjorn Granlund  <tege@gmplib.org>
10174         * mpn/x86_64/rsh1aors_n.asm: New file.
10175         * mpn/x86_64/rsh1add_n.asm: Remove.
10176         * mpn/x86_64/rsh1sub_n.asm: Remove.
10178         * mpz/inits.c: New file.
10180         * gen-trialdivtab.c: Wrap limb constants into CNST_LIMB.
10182         With Martin Boij:
10183         * mpn/generic/perfpow.c (binv_root, binv_sqroot): Change from being
10184         recursive to being iterative.
10185         (mpn_perfect_power_p): Reorganise temp memory usage to avoid a buffer
10186         overrun.  Trim allocation of next and prev.  Never create oversize
10187         products in the multiplicity binary search.
10189         * mpn/generic/dc_div_q.c: Add missing TMP_FREE.
10191 2009-06-16  Torbjorn Granlund  <tege@gmplib.org>
10193         Revert:
10194         * mpn/generic/perfpow.c (perfpow): Test exponents up to ub, inclusive.
10196 2009-06-16  Martin Boij  <mboij@kth.se>
10198         * mpn/generic/perfpow.c (logs): Use more conservative table.
10200 2009-06-15  Torbjorn Granlund  <tege@gmplib.org>
10202         * mpn/pa64/aors_n.asm: New file.
10203         * mpn/pa64/add_n.asm: Remove.
10204         * mpn/pa64/sub_n.asm: Remove.
10206         * mpn/generic/perfpow.c (perfpow): Test exponents up to ub, inclusive.
10208 2009-06-14  Torbjorn Granlund  <tege@gmplib.org>
10210         * mpn/x86_64/bdiv_q_1.asm: Optimise away a mov insn.
10211         * mpn/x86_64/dive_1.asm: Likewise.
10213         * mpn/generic/perfpow.c (binv_root): Use mpn_bdiv_q_1, not
10214         mpn_divexact_itch for 2-adic division.
10215         (all functions): Micro optimise.
10217         * Makefile.am (libmp_la_SOURCES): Add nextprime.c.
10219 2009-06-13  Torbjorn Granlund  <tege@gmplib.org>
10221         * gmp-h.in (mpn_perfect_power_p): Declare.
10222         * configure.in (gmp_mpn_functions): Add perfpow.
10223         * mpz/perfpow.c: Now trivial, simply calls mpn_perfect_power_p.
10225 2009-06-13  Martin Boij  <mboij@kth.se>
10227         * mpn/generic/perfpow.c: New file.
10228         * tests/mpz/t-perfpow.c: Rewrite.
10230 2009-06-12  Torbjorn Granlund  <tege@gmplib.org>
10232         * mpn/generic/bdiv_qr.c: New file.
10233         * mpn/generic/bdiv_q.c: New file.
10234         * configure.in (gmp_mpn_functions): Add bdiv_qr and bdiv_q.
10235         * gmp-impl.h: Declare new functions.
10237         * nextprime.c: New file.
10238         * gmp-impl.h (gmp_primesieve_t, gmp_init_primesieve, gmp_nextprime):
10239         Declare.
10240         * Makefile.am (libgmp_la_SOURCES): Add nextprime.c.
10242 2009-06-11  Torbjorn Granlund  <tege@gmplib.org>
10244         * mpn/generic/trialdiv.c: New file.
10245         * gen-trialdivtab.c: New file.
10246         * configure.in (gmp_mpn_functions): Add trialdiv.
10247         * gmp-impl.h (mpn_trialdiv): Declare
10248         * Makefile.am: Add rules for gen-trialdivtab and trialdiv.
10250         * longlong.h (arm count_leading_zeros): Define for armv5.
10252         * gmp-impl.h: Move down toom itch functions to after we've #defined
10253         all THRESHOLDs.
10255         * dumbmp.c (isprime): Replace with slightly less inefficient code.
10256         (mpz_tdiv_r): New function.
10258 2009-06-11  Niels Möller  <nisse@lysator.liu.se>
10260         Support for mpn_toom32_mul in speed:
10261         * tune/speed.c (routine): Added mpn_toom32_mul.
10262         * tune/speed.h (SPEED_ROUTINE_MPN_TOOM32_MUL): New macro.
10263         * tune/common.c (speed_mpn_toom32_mul): New function.
10265         * gmp-impl.h (mpn_toom32_mul_itch): Count scratch space needed
10266         for the calls to mpn_toom22_mul.
10267         (ABOVE_THRESHOLD): Moved this and related macros so it can be used
10268         by mpn_toom32_mul_itch.
10269         (mpn_toom22_mul_itch): Count scratch space for recursive calls.
10271 2009-06-11  Torbjorn Granlund  <tege@gmplib.org>
10273         * mpn/x86/k7/mod_1_4.asm: New file, mainly for k7, but perhaps useful
10274         also for k6 and non-sse p6.
10276 2009-06-10  Torbjorn Granlund  <tege@gmplib.org>
10278         * mpn/x86_64/mod_1_4.asm: Minor size reducing tweaks.
10280         * mpn/x86/mod_1.asm: Remove obsolete file.
10281         * mpn/x86/k7/mmx/mod_1.asm: Likewise.
10282         * mpn/x86/pentium4/sse2/mod_1.asm: Likewise.
10283         * mpn/x86/p6/mod_1.asm: Likewise.
10284         * mpn/x86/pentium/mod_1.asm: Likewise.
10286 2009-06-08  Niels Möller  <nisse@lysator.liu.se>
10288         * mpn/generic/toom4_sqr.c (mpn_toom4_sqr): Reorganized, to reduce
10289         the need for scratch space, and get rid of TMP_ALLOC. Also use
10290         mpn_toom_eval_dgr3_pm1.
10292         * mpn/generic/toom_interpolate_6pts.c (mpn_toom_interpolate_6pts):
10293         Stricter ASSERTs based on maximum size of polynomial coefficients.
10294         Improved comments on the signedness of intermediate values.
10296 2009-06-07  Torbjorn Granlund  <tege@gmplib.org>
10298         * mpn/generic/toom2_sqr.c: Make it actually work.
10300         * mpn/generic/toom3_sqr.c: Reduce local scratch space.
10302 2009-06-05  Torbjorn Granlund  <tege@gmplib.org>
10304         * mpn/generic/mul_fft.c (FFT_TABLE2_SIZE): Default to 200.
10305         (MUL_FFT_TABLE2_SIZE, SQR_FFT_TABLE2_SIZE): Let these decide
10306         FFT_TABLE2_SIZE if they are defined.
10307         (struct nk): Use bit field.
10309 2009-06-05  Niels Möller  <nisse@lysator.liu.se>
10311         * mpn/generic/toom44_mul.c (mpn_toom44_mult): Use
10312         mpn_toom_eval_dgr3_pm1.
10314         * mpn/generic/toom_eval_dgr3_pm1.c: New file.
10316         * mpn/generic/toom_interpolate_7pts.c (mpn_toom_interpolate_7pts):
10317         Minor cleanup, use mpn_add rather than mpn_add_n + MPN_INCR_U.
10319         * mpn/generic/toom44_mul.c (mpn_toom44_mul): Reorganized, to
10320         reduce the need for scratch space, and get rid of TMP_ALLOC.
10322 2009-06-05  Torbjorn Granlund  <tege@gmplib.org>
10324         * mpn/generic/toom_interpolate_7pts.c: Fall back mpn_divexact_byN to
10325         mpn_bdiv_q_1_pi1, if the latter is NATIVE.
10327 2009-06-04  Torbjorn Granlund  <tege@gmplib.org>
10329         * mpn/x86_64/bdiv_q_1.asm: New file.
10331         * configure.in (HAVE_NATIVE): Add recently added functions.
10332         (GMP_MULFUNC_CHOICES): Handle addlsh_n, sublsh_n, rsblsh_n.
10334         * tune/common.c (speed_mpn_bdiv_q_1, speed_mpn_bdiv_q_1_pi1):
10335         New functions.
10336         * tune/speed.c (routine): Add mpn_bdiv_q_1 and mpn_bdiv_q_1_pi1.
10337         * tune/speed.h (SPEED_ROUTINE_MPN_BDIV_Q_1_PI1): New #define.
10338         (SPEED_ROUTINE_MPN_BDIV_Q_1): Mew #define.
10340         * configure.in (gmp_mpn_functions): Add bdiv_q_1.
10341         * mpn/generic/bdiv_q_1.c: New file.
10342         * mpn/asm-defs.m4 (define_mpn): Add mpn_bdiv_q_1 and mpn_bdiv_q_1_pi1.
10343         * gmp-impl.h (mpn_bdiv_q_1, mpn_bdiv_q_1_pi1): Declare.
10345         * mpn/x86_64/lshift.asm: Cleanup.
10346         * mpn/x86_64/rshift.asm: Cleanup.
10348         * mpn/x86_64/addlsh1_n.asm: Removed.
10349         * mpn/x86_64/aorrlsh1_n.asm: Generalised addlsh1_n.asm to handle
10350         addlsh1_n and rsblsh1_n functionality.
10352         * tests/refmpn.c (refmpn_rsblsh1_n): New function.
10353         * tests/devel/try.c: Test mpn_rsblsh1_n.
10354         * tests/tests.h: Declare refmpn_rsblsh1_n.
10355         * tune/common.c (speed_mpn_rsblsh1_n): New function.
10356         * tune/speed.c (routine): Add mpn_rsblsh1_n.
10357         * tune/speed.h (mpn_rsblsh1_n): Declare.
10359         * configure.in (gmp_mpn_functions_optional): Add rsblsh1_n.
10360         (GMP_MULFUNC_CHOICES): Handle rsblsh1_n defined with a mulfunc.
10361         * mpn/asm-defs.m4 (define_mpn): Add rsblsh1_n.
10362         * gmp-impl.h (mpn_rsblsh1_n): Declare.
10364         * mpn/generic/toom32_mul.c: Consistently use TOOM22_MUL_N_REC.
10366 2009-06-03  Marco Bodrato  <bodrato@mail.dm.unipi.it>
10368         * mpn/generic/toom43_mul.c: New file.
10369         * mpn/generic/toom52_mul.c: New file.
10370         * mpn/generic/toom_interpolate_6pts.c: New file.
10372 2009-06-03  Torbjorn Granlund  <tege@gmplib.org>
10374         * configure.in (gmp_mpn_functions): Add toom43_mul, toom52_mul, and
10375         toom_interpolate_6pts, but also some previously forgotten functions.
10376         * mpn/Makefile.am (nodist_EXTRA_libmpn_la_SOURCES): Likewise.
10377         * gmp-impl.h: Declare new functions. Sort toom function declarations.
10379         * gmp-impl.h: Rename  toom4_* flags enum to toom7_*.  Relevant C files
10380         updated.
10382         * mpn/generic/toom_interpolate_7pts (divexact_2exp): Remove.
10384 2009-06-02  Torbjorn Granlund  <tege@gmplib.org>
10386         * demos/factorize.c: Add -q command line option.
10388 2009-06-02  Marco Bodrato  <bodrato@mail.dm.unipi.it>
10390         * mpn/generic/toom_interpolate_7pts.c: Streamline, resulting in speed
10391         improvements.
10393         * mpn/generic/toom_interpolate_5pts.c: Likewise, but also completely
10394         do away with explicit scratch space.
10395         * gmp-impl.h (mpn_toom_interpolate_5pts): Update prototype.
10397         * mpn/generic/mul_n.c (mpn_toom3_sqr_n, mpn_toom3_mul_n):
10398         Update toom_interpolate_5pts call without scratch space parameter.
10399         * mpn/generic/toom3_sqr.c: Likewise.
10400         * mpn/generic/toom42_mul.c: Likewise.
10401         * mpn/generic/toom33_mul.c: Likewise.
10403         * mpn/generic/toom33_mul.c: Reduce local scratch space.
10404         * mpn/generic/toom32_mul.c: Rewrite to not use local scratch space.
10406 2009-06-02  Torbjorn Granlund  <tege@gmplib.org>
10408         * mpn/generic/toom22_mul.c (TOOM22_MUL_MN_REC): New macro, use it for
10409         oo point.
10411 2009-06-01  Torbjorn Granlund  <tege@gmplib.org>
10413         * mpn/generic/mul.c: Loop to avoid excessive recursion in toom33 and
10414         toom44 slicing code.
10416         * mpz/remove.c: Correctly handle multiplicity that does not fit an int.
10418         * Makefile.am (dist-hook): Check library version consistency.
10420         * mpn/generic/mul.c: Rewrite.
10422 2009-05-29  Torbjorn Granlund  <tege@gmplib.org>
10424         * tests/mpz/t-divis.c (check_random): Create huge test operands.
10426         * mpn/generic/toom44_mul.c: Allocate temp space using one TMP_ALLOC
10427         call, not multiple TMP_SALLOC.
10428         * mpn/generic/toom4_sqr.c: Likewise.
10430         * gmp-impl.h (mpn_toom22_mul_itch): Replace totally wrong code.
10432         * mpn/generic/mullow_n.c: Relax overlap requirement implied by ASSERT.
10434         * mpn/generic/divis.c: Rewrite.
10436         * gmp-impl.h (mpn_mu_bdiv_qr): Now returns mp_limb_t.
10437         (mpn_toom2_sqr_itch): Simplify.
10439         * mpn/generic/mu_bdiv_qr.c: Implement properly.
10441 2009-05-27  Torbjorn Granlund  <tege@gmplib.org>
10443         * mpn/generic/mod_1_1.c: Add proper ASSERT functionality cps function.
10444         * mpn/generic/mod_1_2.c: Likewise.
10445         * mpn/generic/mod_1_3.c: Likewise.
10446         * mpn/generic/mod_1_4.c: Likewise.
10448         * tune: Add speed measuring of toom22, toom33, and toom44.
10450         * mpn/generic/toom22_mul.c: Handle potentially unbalanced coefficient
10451         product better.
10453 2009-05-26  Torbjorn Granlund  <tege@gmplib.org>
10455         * tests/mpz/t-mul.c (ref_mpn_mul): Use mpn_toom44_mul in FFT range for
10456         better huge-operands performance.
10458 2009-05-24  Torbjorn Granlund  <tege@gmplib.org>
10460         * acinclude.m4 (GMP_ASM_LSYM_PREFIX): Try "$L" too, before "$".
10462 2009-05-23  Torbjorn Granlund  <tege@gmplib.org>
10464         * gmp-impl.h (mpn_mod_1s_1p,mpn_mod_1s_2p,mpn_mod_1s_3p,mpn_mod_1s_4p):
10465         Declare using __GMP_ATTRIBUTE_PURE.
10467         * tune/tuneup.c (tune_mod_1): Specify check_size for measuring mod_1_N
10468         functions.
10469         (one): Remove redundant size loop exit condition.
10471 2009-05-20  Torbjorn Granlund  <tege@gmplib.org>
10473         * mpn/x86/pentium4/sse2/mod_1_4.asm: New file.
10474         * mpn/x86/p6/sse2/mod_1_4.asm: New file (grabbing pentium4 code).
10476 2009-05-18  Torbjorn Granlund  <tege@gmplib.org>
10478         * gmp-h.in (__GNU_MP_VERSION_MINOR): Bump to 4.
10479         (__GNU_MP_VERSION_PATCHLEVEL): Set to -1.
10481         * mpn/x86_64/mod_1_4.asm: New file.
10483         * mpn/asm-defs.m4: Correct names for mod_1_N functions.
10484         Add defines for corresponding cps functions.
10486         * mpn/generic/mod_1_2.c: Support any sizes > 1.
10487         * mpn/generic/mod_1_3.c: Likewise.
10488         * mpn/generic/mod_1_4.c: Likewise.
10490 2009-05-12  Torbjorn Granlund  <tege@gmplib.org>
10492         * Version 4.3.1 released.
10494 2009-05-11  Torbjorn Granlund  <tege@gmplib.org>
10496         * gmp-h.in (__GNU_MP_VERSION_MINOR): Bump.
10498         * Makefile.am (LIBGMP_LT_*, LIBGMPXX_LT_*, LIBMP_LT_*):
10499         Bump version info.
10501 2009-05-09  Torbjorn Granlund  <tege@gmplib.org>
10503         * tests/mpz: Add MPZ_CHECK_FORMAT to many tests.
10505 2009-05-07  Torbjorn Granlund  <tege@gmplib.org>
10507         * mpn/x86/pentium4/sse2/mul_basecase.asm: Avoid L(ret), "ret" is
10508         defined in x86-defs.m4.
10510 2009-05-06  Torbjorn Granlund  <tege@gmplib.org>
10512         * mpn/x86/p6/aors_n.asm: Use L() for labels.
10513         * mpn/x86/pentium4/sse2/addmul_1.asm: Likewise.
10514         * mpn/x86/pentium4/sse2/mul_1.asm: Likewise.
10515         * mpn/x86/pentium4/sse2/mul_basecase.asm: Likewise.
10516         * mpn/x86/pentium4/sse2/sqr_basecase.asm: Likewise.
10517         * mpn/x86_64/lshift.asm: Likewise.
10518         * mpn/x86_64/rshift.asm: Likewise.
10520         * tests/cxx/t-locale.cc (point_string): Declare as extern "C" to
10521         placate compilers that mangle variable names.
10523 2009-05-04  Torbjorn Granlund  <tege@gmplib.org>
10525         * tests/mpz/t-gcd.c: Generate operands that are multiple of each other.
10527 2009-05-01  Torbjorn Granlund  <tege@gmplib.org>
10529         * gmp-h.in (__GMP_EXTERN_INLINE): Support for more systems.
10530         (gmp_randinit_set): Add missing __GMP_DECLSPEC.
10532 2009-04-28  Torbjorn Granlund  <tege@gmplib.org>
10534         * mpn/generic/neg_n.c: New file.
10535         * configure.in (gmp_mpn_functions): Add neg_n.
10536         * mpn/asm-defs.m4 (define_mpn): Add neg_n.
10537         * mpn/Makefile.am (nodist_EXTRA_libmpn_la_SOURCES): Add neg_n.c.
10538         * gmp-h.in: Handle mpn_neg_n properly.
10540         * mpn/generic/toom_interpolate_7pts.c (divexact_2exp): Nailify.
10542         * mpn/generic/gcdext.c: Change some MPN_NORMALIZE to
10543         MPN_NORMALIZE_NOT_ZERO.
10544         * mpn/generic/gcdext_lehmer.c: Likewise.
10545         Add a MPN_NORMALIZE_NOT_ZERO.
10547         * mpn/generic/binvert.c: Remove own mpn_neg_n.
10549         * tests/mpz/t-gcd.c: Add some MPZ_CHECK_FORMAT calls.
10551 2009-04-27  Torbjorn Granlund  <tege@gmplib.org>
10553         * mpn/Makefile.am (TARG_DIST): Add minithres.
10555         * mpn/generic/bdiv_dbm1c.c: Handle nails.
10557 2009-04-26  Torbjorn Granlund  <tege@gmplib.org>
10559         * config.guess: Recognise more POWER processor types.
10561 2009-04-25  Torbjorn Granlund  <tege@gmplib.org>
10563         * mpn/x86/pentium4/sse2/popcount.asm: Work around Apple reloc bug.
10564         * mpn/x86/darwin.m4: Define symbol "DARWIN".
10566 2009-04-19  Torbjorn Granlund  <tege@gmplib.org>
10568         * mpn/generic/powm.c (mpn_redc_n): Use ASSERT_ALWAYS, not abort().
10569         * mpn/generic/powm_sec.c: Likewise.
10571         * mpn/powerpc64/aix.m4 (EXTERN_FUNC): New define.  Add dummy variants
10572         for other m4 files.
10573         * mpn/powerpc64/mode64/divrem_1.asm: Use EXTERN_FUNC.
10574         * mpn/powerpc64/mode64/divrem_1.asm: Likewise.
10576 2009-04-16  Torbjorn Granlund  <tege@gmplib.org>
10578         * mpn/x86_64/x86_64-defs.m4 (JUMPTABSECT): New define.
10579         * mpn/x86_64/darwin.m4: Likewise.
10580         * mpn/x86_64/sqr_basecase.asm: Rework switch code using JUMPTABSECT.
10582         * tune/common.c (speed_mpn_hgcd, speed_mpn_hgcd_lehmer):
10583         Remove an unused variable.
10585         * mpn/x86/x86-defs.m4 (LEA): Get SIZE arguments right.
10587 2009-04-14  Torbjorn Granlund  <tege@gmplib.org>
10589         * Version 4.3.0 released.
10591         * scanf/doscan.c (__gmp_doscan): Pad 3-operand scanf call with dummy
10592         argument.
10593         * scanf/sscanffuns.c (scan): Disable vsscanf variant for now.
10595 2009-04-13  Torbjorn Granlund  <tege@gmplib.org>
10597         * scanf/sscanffuns.c (scan): Rewrite to use stdarg.
10599         * tests/mpz/t-root.c: Rewrite.  Add unconditional gcc 4.3.2 tests.
10601 2009-04-09  Torbjorn Granlund  <tege@gmplib.org>
10603         * mpn/generic/powm.c: New file.
10604         * mpn/generic/powlo.c: New file.
10605         * mpn/generic/powm_sec.c: New file.
10606         * configure.in (gmp_mpn_functions): List new functions.
10608 2009-04-08  Torbjorn Granlund  <tege@gmplib.org>
10610         * mpz/urandomm.c: Amend last fix.
10612 2009-04-06  Torbjorn Granlund  <tege@gmplib.org>
10614         * configure.in: Support Sun cc for x86_64.
10616         * mpz/urandomm.c: Handle operand overlap.
10618 2009-03-11  Torbjorn Granlund  <tege@gmplib.org>
10620         * configure.in (powerpc): Brave removing -Wa,-mppc64, in the hope that
10621         GCC now passes the proper options.
10623 2009-03-09  Torbjorn Granlund  <tege@gmplib.org>
10625         * mpn/x86_64/divrem_1.asm: Add a nop to save a cycle in unnormalised
10626         case.
10628 2009-03-05  Torbjorn Granlund  <tege@gmplib.org>
10630         * ia64/gmp-mparam.h, arm/gmp-mparam.h, x86/p6/mmx/gmp-mparam.h,
10631         pa32/hppa2_0/gmp-mparam.h sparc32/v9/gmp-mparam.h: Update.
10633 2009-03-03  Torbjorn Granlund  <tege@gmplib.org>
10635         * mpn/ia64/bdiv_dbm1c.asm: Accept/return carry.
10637 2009-03-02  Torbjorn Granlund  <tege@gmplib.org>
10639         * configure.in (64-bit sparc/solaris): Pass -xO3, not -O3 to solaris
10640         system compiler.
10642 2009-03-01  Torbjorn Granlund  <tege@gmplib.org>
10644         * longlong.h (mips, powerpc): Provide assembly-free umul_ppmm for newer
10645         gcc.
10647 2009-02-04  Torbjorn Granlund  <tege@gmplib.org>
10649         * mpn/generic/redc_2.c: Remove code for testing and timing.  Update
10650         to current FSF header.
10651         * mpn/generic/redc_1.c: Update to current FSF header.
10653 2009-01-21  Torbjorn Granlund  <tege@gmplib.org>
10655         * mpz/powm.c (redc): Remove.
10656         (mpz_powm): Use mpn_redc_1 instead of redc.
10658         * tests/mpz/t-powm.c: Rewrite reference code.
10660 2009-01-18  Torbjorn Granlund  <tege@gmplib.org>
10662         * tests/mpz: Increase reps for many tests.
10664         * mpn/generic/rootrem.c (mpn_rootrem_internal): Use MPN_DECR_U instead of
10665         mpn_sub_1 (works around gcc 4.3 bugs and is also faster).
10667 2009-01-16  Torbjorn Granlund  <tege@gmplib.org>
10669         * tests/tests.h: Declare refmpn_divrem_2.
10671 2009-01-15  Torbjorn Granlund  <tege@gmplib.org>
10673         * mpz/perfpow.c: Add TMP_FREE before every return statement.
10675         * mpn/generic/rootrem.c (mpn_rootrem_internal): Add a missing TMP_FREE.
10677         * configure.in (gcc_cflags, gcc_64_cflags): Revert from -O3 to -O2,
10678         the change was accidental and cause too much miscompilation.
10680 2009-01-14  Torbjorn Granlund  <tege@gmplib.org>
10682         * tune/tuneup.c (tune_mod_1): Run MOD_1_x_THRESHOLD tests also when
10683         longlong.h specified UDIV_PREINV_ALWAYS.
10685         * mpn/generic/mod_1.c (mpn_mod_1): Properly check for normalisation
10686         divisor.
10688 2009-01-13  Torbjorn Granlund  <tege@gmplib.org>
10690         * tune/tuneup.c (tune_mod_1): Tune for MOD_1_1_THRESHOLD,
10691         MOD_1_2_THRESHOLD, and MOD_1_4_THRESHOLD.
10693         * mpn/generic/mod_1.c: Rewrite.
10694         * mpn/generic/mod_1_1.c: New file.
10695         * mpn/generic/mod_1_2.c: New file.
10696         * mpn/generic/mod_1_3.c: New file.
10697         * mpn/generic/mod_1_4.c: New file.
10698         * configure.in (gmp_mpn_functions): Add mod_1_*.
10699         * mpn/asm-defs.m4 (define_mpn): Add mod_1_*.
10700         * mpn/Makefile.am (nodist_EXTRA_libmpn_la_SOURCES): Add mod_1_*.c.
10701         * gmp-impl.h: Declare new mpn_mod_1s_* functions and associated
10702         THRESHOLD macros.
10703         (udiv_rnd_preinv): New macro.
10705 2009-01-12  Torbjorn Granlund  <tege@gmplib.org>
10707         * tune/tuneup.c (tune_gcd_dc,tune_gcdext_dc): Lower step_factor to 0.1.
10709 2009-01-08  Torbjorn Granlund  <tege@gmplib.org>
10711         * tests/mpz/t-nextprime.c: New test file.
10712         * tests/mpz/Makefile.am (check_PROGRAMS): Add t-nextprime.
10714         From Niels Möller:
10715         * mpz/nextprime.c: Handle large prime gaps by limiting incr.
10717 2009-01-04  Torbjorn Granlund  <tege@gmplib.org>
10719         * mpz/and.c, mpz/ior.c, mpz/xor.c: Re-read only necessary source
10720         pointers after reallocation.  Misc cleanup.
10722         * gmp-impl.h (MPN_TOOM44_MAX_N): New define, replaces MPN_TOOM3_MAX_N.
10724         * mpn/x86/fat/diveby3.c: New file.
10726 2008-12-30  Niels Möller  <nisse@lysator.liu.se>
10728         * doc/gmp.texi (Greatest Common Divisor Algorithms): Updated
10729         section on GCD algorithms.
10731 2008-12-29  Torbjorn Granlund  <tege@gmplib.org>
10733         * doc/gmp.texi (Multiplication Algorithms): Add descriptions of Toom-4
10734         and unbalanced multiplication.
10735         (Radix to Binary): Add warning that text is outdated,
10736         (Contributors): Fix typos.
10738         * mpn/generic/toom*.c: Use coherent MAYBE_ macros for trimming
10739         unreachable recursive functions.
10740         * gmp-impl.h: Update toom itch functions.
10742         * mpn/x86_64/sqr_basecase.asm: Slightly increase stack allocation, to
10743         placate tuneup.
10745 2008-12-28  Torbjorn Granlund  <tege@gmplib.org>
10747         * mpn/x86_64/pentium4/aors_n.asm: Tune prologue code.
10749         * mpn/x86_64/pentium4/aorslsh1_n.asm: New file.
10751         * mpn/x86_64/darwin.m4: Define symbol "DARWIN".
10752         * mpn/x86_64/invert_limb.asm: Work around darwin quirks.
10754         * mpn/x86_64/sqr_basecase.asm: Further optimize, support Darwin.
10756         * mpn/x86_64/invert_limb.asm: New file.
10758 2008-12-27  Torbjorn Granlund  <tege@gmplib.org>
10760         * mpn/x86_64/core2/aorslsh1_n.asm: New file.
10762 2008-12-26  Torbjorn Granlund  <tege@gmplib.org>
10764         * mpz/perfpow.c: Handle negative arguments properly.
10765         * tests/mpz/t-perfpow.c: New file.
10766         * tests/mpz/Makefile.am (check_PROGRAMS): Add t-perfpow.
10768 2008-12-23  Torbjorn Granlund  <tege@gmplib.org>
10770         * tests/mpz/t-mul.c (dump_abort): Improve error message.
10772         * gcd.c gcd_subdiv_step.c gcdext.c gcdext_subdiv_step.c:
10773         Remove private mpn_zero_p.
10775         * tune/tuneup.c (tune_mul): Tune for MUL_TOOM44_THRESHOLD.
10776         (tune_sqr): Tune for SQR_TOOM4_THRESHOLD.
10778         * tune/Makefile.am (TUNE_MPN_SRCS_BASIC): Add toom44_mul.c and
10779         toom4_sqr.c.
10781         * configure.in (gmp_mpn_functions): Toom function updates.
10783         * Rename mpn/mul_toomMN.c to mpn/toomMN_mul.c.  Function names changed
10784         accordingly.
10786         * mpn/toomMN_mul.c: Add scratch parameter.  Do recursive multiplies
10787         properly.  Misc tuning.  Remove CHECK and TIMING code.
10789         * mpn/toom2_sqr.c, mpn/toom3_sqr.c, mpn/toom4_sqr.c: New files.
10791         * gmp-impl.h (mpn_toomMN_mul_itch): Several new functions.
10792         (mpn_zero_p): New functions.
10793         Add various TOOM4/TOOM44 related parameters.
10794         Update mpn_toomMN_mul prototypes.
10796         * mpn/generic/mul_n.c (mpn_mul_n): Call mpn_toom44_mul.  Use TMP_BALLOC
10797         instead of malloc.
10798         (mpn_sqr_n): Analogous changes.
10800         * mpn/generic/mul.c: Update unbalanced toom code to pass scratch space.
10802 2008-12-21  Torbjorn Granlund  <tege@gmplib.org>
10804         * mpz/nextprime.c: Add TMP_SDECL/MARK/FREE.
10806 2008-12-20  Torbjorn Granlund  <tege@gmplib.org>
10808         * mpn/generic/sqrtrem.c (mpn_sqrtrem1): Rewrite, improve interface.
10809         (invsqrttab): New table, remove table approx_tab.
10810         (mpn_sqrtrem2): Optimize, update mpn_sqrtrem1 call.
10811         (mpn_sqrtrem): Update mpn_sqrtrem1 call.
10813 2008-12-18  Torbjorn Granlund  <tege@gmplib.org>
10815         * mpz/nextprime.c: Run 10 mpz_millerrabin tests (was 5).
10816         Give credit to authors.
10818         * mpn/x86_64/redc_1.asm: Align stack as mandated by ABI.
10820         * mpn/x86_64/divrem_2.asm: Add some comments.
10822         * mpn/x86_64/darwin.m4: New file.
10823         * configure.in: Use x86_64/darwin.m4.
10825 2008-12-15  Torbjorn Granlund  <tege@gmplib.org>
10827         * doc/projects.html: Remove GCD and division projects, update text on
10828         multiplication.
10830         * doc/tasks.html: Add a caution about that the file is somewhat
10831         outdated.
10833 2008-12-14  Torbjorn Granlund  <tege@gmplib.org>
10835         * mpn/alpha/ev6/aorsmul_1.asm: New file (same code for mpn_addmul_1,
10836         much improved for mpn_submul_1).
10837         * mpn/alpha/ev6/addmul_1: File removed.
10838         * mpn/alpha/ev6/submul_1: File removed.
10840 2008-12-09  Torbjorn Granlund  <tege@gmplib.org>
10842         From David Harvey:
10843         * mpn/x86_64/mul_basecase.asm: Further tweaks for code size and speed.
10845         * mpn/powerpc64/mode64/divrem_1.asm: Rewrite.
10847         * mpn/powerpc64/mode64/mul_basecase.asm: New file.
10849 2008-12-08  Torbjorn Granlund  <tege@gmplib.org>
10851         * mpn/powerpc64/mode64/gmp-mparam.h: New file.
10853         * gmp-impl.h: Additional cleanups.
10854         (mpn_set_str_compute_powtab): New prototype.
10855         (mpn_powm, mpn_powlo): New prototypes.
10857         * mpz/pow_ui.c: Handle some small exponents locally.
10859 2008-12-07  Torbjorn Granlund  <tege@gmplib.org>
10861         * mpn/generic/set_str.c: Remove prototypes (they are in gmp-impl.h).
10863         * tune/set_strs.c, tune/set_strb.c: Make prototypes effective by moving
10864         the #define mpn_set_str* before including gmp-impl.h.
10866         * All files: Change _PROTO => __GMP_PROTO.
10868         * tune/speed.c (routine): Remove non-working choice mpn_set_str_subquad.
10869         * tune/common.c (speed_mpn_dc_set_str): Remove, it is broken.
10871         * mpn/generic/toom_interpolate_7pts.c (divexact_2exp): Make this static,
10872         and inline it.
10874         * gmp-impl.h: Major cleanup.
10875         (Remove formal parameter names.  Use __GMP_PROTO consistently.  Move
10876         __GMP_PROTO and __MPN use to adjacent lines for declared function.
10877         Fix typos.  Remove code inside #if 0.)
10879         * configure.in (gmp_mpn_functions): Add mul_toom33.  Reformat.
10881 2008-12-05  Torbjorn Granlund  <tege@gmplib.org>
10883         * mpn/generic/redc_1.c: New file.
10884         * mpn/generic/redc_2.c: New file.
10886         * configure.in (gmp_mpn_functions): List redc_1 and redc_2.
10887         (HAVE_NATIVE): Likewise.
10889         * tune/common.c (speed_mpn_redc_1): Renamed from speed_redc.
10890         * tune/speed.c (routine): Remove "redc", and "mpn_redc_1".
10891         * tune/speed.h (SPEED_ROUTINE_REDC_1): Renamed from SPEED_ROUTINE_REDC.
10892         Updated call.
10893         * tune/tuneup.c (tune_powm): Update redc call.
10895 2008-12-04  Torbjorn Granlund  <tege@gmplib.org>
10897         * mpn/x86_64/sqr_basecase.asm: Inline a combined diagonal product code
10898         and addlsh1 loop.  Misc cleanup.
10900 2008-12-02  Torbjorn Granlund  <tege@gmplib.org>
10902         * mpn/x86_64/sqr_basecase.asm: New file.
10904 2008-11-30  Torbjorn Granlund  <tege@gmplib.org>
10906         * mpn/generic/sqr_basecase.c: Fix typo in mpn_addmul_2s variant.
10908 2008-11-28  Torbjorn Granlund  <tege@gmplib.org>
10910         * mpn/x86_64/redc_1.asm: Rewrite.
10912 2008-11-27  Torbjorn Granlund  <tege@gmplib.org>
10914         * tests/refmpn.c (refmpn_redc_1): New function.
10916 2008-11-25  Torbjorn Granlund  <tege@gmplib.org>
10918         * mpn/x86/k7/aorsmul_1.asm: Actually handle mpn_submul_1.
10920 2008-11-23  Torbjorn Granlund  <tege@gmplib.org>
10922         * mpn/x86_64/divrem_1.asm: Rewrite.
10924         * alpha/divrem_2.asm: New file.
10925         * powerpc32/divrem_2.asm: New file.
10926         * powerpc64/mode64/divrem_2.asm: New file.
10927         * x86/divrem_2.asm: New file.
10928         * x86_64/divrem_2.asm: New file.
10929         * tests/refmpn.c (refmpn_divrem_2): New function.
10931 2008-11-22  Torbjorn Granlund  <tege@gmplib.org>
10933         * mpn/x86/k7/mul_1.asm: Rewrite for smaller size and better speed.
10934         * mpn/x86/k7/aorsmul_1.asm: Likewise.
10936         * acinclude.m4 (GMP_VERSION): Include last component even when zero.
10938 2008-11-21  Torbjorn Granlund  <tege@gmplib.org>
10940         * mpn/x86_64/README: Rewrite.
10942         * tests/devel/try.c (malloc_region, mprotect_maybe): Add casts for
10943         printf type correctness.
10945         * gmp-h.in (__GNU_MP_VERSION_MINOR): Bump.
10947         * Makefile.am (LIBGMP_LT_*, LIBGMPXX_LT_*, LIBMP_LT_*):
10948         Bump version info.
10950 2008-11-20  Torbjorn Granlund  <tege@gmplib.org>
10952         * gmp-impl.h: Rename modlimb_invert to binvert_limb.
10953         * tune/speed.h: Likewise.
10954         * tune/modlinv.c: Likewise.
10955         * tune/common.c: Likewise.
10956         * tests/t-modlinv.c: Likewise.
10957         * tests/t-constants.c: Likewise.
10958         * mpn/sparc64/mode1o.c: Likewise.
10959         * mpn/alpha/dive_1.c: Likewise.
10960         * mpn/sparc64/dive_1.c: Likewise.
10961         * mpn/generic/mode1o.c: Likewise.
10962         * mpn/generic/dive_1.c: Likewise.
10963         * mpn/generic/bdivmod.c: Likewise.
10964         * mpn/alpha/mode1o.asm: Likewise.
10965         * mpn/asm-defs.m4: Likewise.
10966         * mpn/ia64/mode1o.asm: Likewise.
10967         * mpn/powerpc32/README: Likewise.
10968         * mpn/powerpc32/mode1o.asm: Likewise.
10969         * mpn/powerpc64/mode64/dive_1.asm: Likewise.
10970         * mpn/powerpc64/mode64/mode1o.asm: Likewise.
10971         * mpn/x86/dive_1.asm: Likewise.
10972         * mpn/x86/k6/mmx/dive_1.asm: Likewise.
10973         * mpn/x86/k6/mode1o.asm: Likewise.
10974         * mpn/x86/k7/dive_1.asm: Likewise.
10975         * mpn/x86/k7/mode1o.asm: Likewise.
10976         * mpn/x86/p6/dive_1.asm: Likewise.
10977         * mpn/x86/p6/mode1o.asm: Likewise.
10978         * mpn/x86/pentium/dive_1.asm: Likewise.
10979         * mpn/x86/pentium/mode1o.asm: Likewise.
10980         * mpn/x86/pentium4/sse2/dive_1.asm: Likewise.
10981         * mpn/x86/pentium4/sse2/mode1o.asm: Likewise.
10982         * mpn/x86_64/dive_1.asm: Likewise.
10983         * mpn/x86_64/mode1o.asm: Likewise.
10985         * mpn/x86_64/aors_n.asm: Replace with slightly faster, more alignment
10986         neutral loop.
10988 2008-11-18  Torbjorn Granlund  <tege@gmplib.org>
10990         * configure.in: Remove gcd_finda related declarations.
10991         * gmp-impl.h (mpn_gcd_finda): Remove declaration.
10992         * mpn/Makefile.am (nodist_EXTRA_libmpn_la_SOURCES): Remove gcd_finda.
10993         * mpn/asm-defs.m4: Remove define_mpn(gcd_finda).
10994         * mpn/x86/k6/gcd_finda.asm: Remove file.
10995         * tests/devel/try.c (param_init): Remove mpn_gcd_finda.
10996         (choice_array): Remove mpn_gcd_finda.
10997         * tests/mpn/t-instrument.c (check): Remove testing of mpn_gcd_finda.
10998         * tests/refmpn.c (refmpn_gcd_finda): Remove.
10999         * tests/tests.h (refmpn_gcd_finda): Remove declaration.
11000         * tune/common.c (speed_mpn_gcd_finda): Remove.
11001         * tune/gcd_finda_gen.c: Remove file.
11002         * tune/speed.h (speed_mpn_gcd_finda): Remove declaration.
11003         * tune/speed.c (routine): Remove mpn_gcd_finda entry.
11005         * tests/mpz/t-powm.c: Print test number when failing a test.
11007         * mpn/x86_64/redc_1.asm (CALL): Move from here...
11008         * mpn/x86_64/x86_64-defs.m4: ...to here.
11010         * gmp-impl.h (mpn_jacobi_base): Remove parameter names.
11012 2008-11-11  Torbjorn Granlund  <tege@gmplib.org>
11014         * tests/mpf/t-conv.c: Add some specific tests, supplementing the random
11015         tests.
11017 2008-11-09  Torbjorn Granlund  <tege@gmplib.org>
11019         * mpf/set_str.c: Default 'base' before letting exp_base inherit it.
11021         * tests/cxx/t-prec.cc: Use the right precision for all float constants.
11023 2008-11-08  Torbjorn Granlund  <tege@gmplib.org>
11025         * doc/gmp.texi (Float Comparison): Update mpf_eq documentation.
11027         * mpf/eq.c: Compare the right number of bits.
11029 2008-11-02  Torbjorn Granlund  <tege@gmplib.org>
11031         Undo, it made testing too slow:
11032         * tests/mpz/t-mul.c: Use slower geometric progression for operand
11033         sizes.
11035         * mpn/x86/k7/mod_34lsub1.asm: Use movzb for masking low 8 bits.
11037 2008-10-31  Niels Möller  <nisse@lysator.liu.se>
11039         * mpn/generic/hgcd2.c (div1): New function (taken from old gcdext
11040         implementation)
11041         (mpn_hgcd2): Use single precision for the second half of the work.
11043 2008-10-30  Torbjorn Granlund  <tege@gmplib.org>
11045         * mpn/x86/p6/sse2/gmp-mparam.h: New file.
11047 2008-10-29  Torbjorn Granlund  <tege@gmplib.org>
11049         * configure.in (x86 fat_path): Add "x86/p6/sse2".
11051         * mpn/x86/fat/fat.c (__gmpn_cpuvec_init): Recognize sse2 capable p6
11052         (pentiumm, core2).
11054         * mpn/x86/p6/sse2/mul_1.asm: New file.
11055         * mpn/x86/p6/sse2/addmul_1.asm: New file.
11056         * mpn/x86/p6/sse2/submul_1.asm: New file.
11057         * mpn/x86/p6/sse2/mul_basecase.asm: New file.
11058         * mpn/x86/p6/sse2/sqr_basecase.asm: New file.
11059         * mpn/x86/p6/sse2/popcount.asm: New file.
11061         * mpn/x86/fat/fat.c (__gmpn_cpuvec_init): Handle "extended" fields for
11062         model and family.
11064 2008-10-28  Torbjorn Granlund  <tege@gmplib.org>
11066         From Mickael Gastineau:
11067         * gmp-h.in (gmp_urandomm_ui, gmp_urandomb_ui): Add __GMP_DECLSPEC.
11069 2008-10-27  Torbjorn Granlund  <tege@gmplib.org>
11071         * gmp-h.in (mpn_gcdext_1): Remove bogus __GMP_ATTRIBUTE_PURE.
11073 2008-10-27  Niels Möller  <nisse@lysator.liu.se>
11075         * tune/common.c (speed_mpn_hgcd): Call mpn_hgcd_matrix_init once
11076         for each call to mpn_hgcd.
11077         (speed_mpn_hgcd_lehmer): Likewise.
11079 2008-10-26  Torbjorn Granlund  <tege@gmplib.org>
11081         * configure.in: Point to p6/sse2 for pentiumm and core2.
11083         * gmp-impl.h (mpn_add_nc, mpn_sub_nc): Move these macros to after fat
11084         definitions.
11086         * tune/common.c, tune/speed.c, tune/speed.h:
11087         Add speed measurement of mpn_bdiv_dbm1c.
11089 2008-10-24  Torbjorn Granlund  <tege@gmplib.org>
11091         * mpn/x86_64/gmp-mparam.h (MUL_FFT_TABLE2, SQR_FFT_TABLE2): Extend.
11093         * mpz/nextprime.c: Move declarations to function beginning.
11095 2008-10-23  Niels Möller  <nisse@lysator.liu.se>
11097         * gmp-impl.h (DECL_gcdext_1): Deleted.
11099 2008-10-22  Torbjorn Granlund  <tege@gmplib.org>
11101         * mpn/x86_64/atom/aors_n.asm: New file.
11102         * mpn/x86_64/atom/gmp-mparam.h: New file.
11104 2008-10-21  Torbjorn Granlund  <tege@gmplib.org>
11106         With Neils Möller:
11107         * mpz/nextprime.c: Rewrite.
11109         * tests/devel/try.c (main): Use strtol for 's' and 'S' optargs.
11111         * mpn/x86_64/pentium4/rshift.asm: Misc cleanups.
11112         * mpn/x86_64/pentium4/lshift.asm: Likewise.
11114         * mpn/x86_64/pentium4/aors_n.asm: Use fewer registers.
11116         * configure.in: Set up specific path for x86_64/atom.
11118 2008-10-21  Niels Möller  <nisse@lysator.liu.se>
11120         * mpn/Makefile.am (nodist_EXTRA_libmpn_la_SOURCES): Removed
11121         qstack.c.
11122         * mpn/generic/qstack.c: Deleted obsolete file.
11124 2008-10-20  Torbjorn Granlund  <tege@gmplib.org>
11126         * mpn/x86_64/core2/aorsmul_1.asm: New file.
11128 2008-10-19  Torbjorn Granlund  <tege@gmplib.org>
11130         * mpn/x86_64/aors_n.asm: Remove redundant MULFUNC_PROLOGUE.
11132         * gmp-impl.h (popc_limb): Remove redundant checks of GMP_LIMB_BITS
11133         inside several of these macros.
11135 2008-10-17  Torbjorn Granlund  <tege@gmplib.org>
11137         * tests/mpz/t-mul.c: Use slower geometric progression for operand
11138         sizes.  Do every other tests for same size operands.
11140 2008-10-15  Torbjorn Granlund  <tege@gmplib.org>
11142         * mpn/x86_64/mul_basecase.asm: Simplify addressing in epilogue.
11144         * mpn/mips64/divrem_1.asm: Remove file, it is n32-only, and uses an old
11145         algorithm.
11147         * config.guess, config.sub, configure.in: Support Intel Atom processor.
11149 2008-10-10  Torbjorn Granlund  <tege@gmplib.org>
11151         * mpq/mul.c: Fix typo in last change.
11153 2008-10-09  Torbjorn Granlund  <tege@gmplib.org>
11155         * tests/refmpn.c (refmpn_sb_divrem_mn): Work around a gcc bug.
11157 2008-10-08  Torbjorn Granlund  <tege@gmplib.org>
11159         * mpq/mul.c: Use TMP_ALLOC.  Cleanup.
11160         * mpq/div.c: Likewise.
11162         * mpn/x86_64/mul_basecase.asm: Use lea directly for loading entry point
11163         addresses.
11165 2008-10-09  Niels Möller  <nisse@lysator.liu.se>
11167         * mpn/x86/k7/gmp-mparam.h: Updated GCD-related values.
11169 2008-10-05  Torbjorn Granlund  <tege@gmplib.org>
11171         * mpn/generic/mul_fft.c (mpn_mul_fft_internal): Do store
11172         mpn_fft_norm_modF return value, if (rec).
11174 2008-10-04  Torbjorn Granlund  <tege@gmplib.org>
11176         * mpn/x86_64/aorsmul_1.asm: Replace with faster code.
11177         * mpn/x86_64/mul_1.asm: Likewise.
11178         * mpn/x86_64/addmul_2.asm: Likewise.
11179         * mpn/x86_64/mul_2.asm: Likewise.
11180         * mpn/x86_64/mul_basecase.asm: Likewise.
11182 2008-10-02  Torbjorn Granlund  <tege@gmplib.org>
11184         * mpn/minithres/gmp-mparam.h: Update FFT values.
11186 2008-10-02  Niels Möller  <nisse@lysator.liu.se>
11188         * hgcd.c (mpn_hgcd_matrix_mul): Fixed normalization bug.
11190 2008-09-24  Torbjorn Granlund  <tege@gmplib.org>
11192         * configure.in: Handle --enable-minithres.
11193         * mpn/minithres/gmp-mparam.h: Update all values.
11195 2008-09-22  Torbjorn Granlund  <tege@gmplib.org>
11197         * tune/speed.c (routine): New entry for mpn_mul.
11198         * tune/speed.h (SPEED_ROUTINE_MPN_MUL): Renamed from
11199         SPEED_ROUTINE_MPN_MUL_BASECASE.
11200         (speed_mpn_mul): Renamed from speed_mpn_mul_basecase.
11201         (SPEED_ROUTINE_MPN_MUL): Allocate our own memory of xp operand.
11203         * tune/common.c: Corresponding changes.
11205 2008-09-22  Niels Möller  <nisse@lysator.liu.se>
11207         * mpn/generic/gcdext.c (hgcd_mul_matrix_vector): New function,
11208         replaces addmul2_n. Needs less copying.
11209         (mpn_gcdext): Use hgcd_mul_matrix_vector. Updated for interface
11210         change in mpn_gcdext_subdiv_step
11212         * mpn/generic/hgcd.c (hgcd_matrix_mul_1): Rewritten to use
11213         mpn_hgcd_mul_matrix1_vector.
11214         (hgcd_step): Updated for interface change in
11215         mpn_hgcd_mul_matrix1_inverse_vector.
11217         * mpn/generic/gcdext_lehmer.c (mpn_gcdext_lehmer_n): Updated for
11218         interface changes in mpn_hgcd_mul_matrix1_vector,
11219         mpn_hgcd_mul_matrix1_inverse_vector and mpn_gcdext_subdiv_step.
11221         * mpn/generic/gcd_lehmer.c (mpn_gcd_lehmer_n): Updated for
11222         interface change in mpn_hgcd_mul_matrix1_inverse_vector.
11224         * mpn/generic/gcdext_subdiv_step.c (mpn_gcdext_subdiv_step): Use
11225         separate scratch arguments for the quotient and for the cofactor
11226         update.
11228         * mpn/generic/hgcd2.c (mpn_hgcd_mul_matrix1_vector): Interface
11229         change. Store first element in rp and leave ap unmodified. No
11230         additional scratch space or copying needed. Callers that require
11231         modification in place still need to copy one of the inputs.
11232         (mpn_hgcd_mul_matrix1_inverse_vector): Likewise.
11234 2008-09-22  Niels Möller <nisse@lysator.liu.se>  <nisse@king.swox.se>
11236         * mpn/generic/hgcd.c (hgcd_matrix_mul_1): Use mpn_addaddmul_1msb0.
11237         * mpn/generic/hgcd2.c (mpn_hgcd_mul_matrix1_vector): Likewise.
11239         * mpn/generic/gcd.c: Use libspeed for timing measurements.
11241         * gmp-impl.h: Declare mpn_addaddmul_1msb0.
11242         * mpn/asm-defs.m4: Added addaddmul_1msb0.
11243         * mpn/x86_64/addaddmul_1msb0.asm: New file.
11244         * configure.in (gmp_mpn_functions_optional): Added
11245         addaddmul_1msb0.
11246         (HAVE_NATIVE): List addaddmul_1msb0.
11248 2008-09-21  Torbjorn Granlund  <tege@gmplib.org>
11250         * mpn/generic/get_str.c (GET_STR_DC_THRESHOLD): Remove default.
11251         (GET_STR_PRECOMPUTE_THRESHOLD): Likewise.
11252         Misc code cleanups.
11254         * gmp-impl.h (mpn_dc_set_str_itch): Allocate GMP_LIMB_BITS more limbs.
11256         Revert:
11257         * mpn/generic/set_str.c:
11258         (mpn_dc_set_str): Remove impossible case, replace by an ASSERT.
11260 2008-09-18  Torbjorn Granlund  <tege@gmplib.org>
11262         * mpn/alpha/ev6/gmp-mparam.h (DIVEXACT_BY3_METHOD): Define.
11264         * mpn/ia64/diveby3.asm: Remove.
11265         * mpn/x86/diveby3.asm: Remove.
11266         * mpn/x86/k6/diveby3.asm: Remove.
11267         * mpn/x86/k7/diveby3.asm: Remove.
11268         * mpn/x86/p6/diveby3.asm: Remove.
11269         * mpn/x86/pentium/diveby3.asm: Remove.
11270         * mpn/x86_64/diveby3.asm: Remove.
11271         * mpn/x86/pentium4/sse2/diveby3.asm: Remove.
11273         * configure.in (HAVE_NATIVE): List divexact_by3c.
11275         * gmp-impl.h (mpn_divexact_by3c): Override gmp-h.in's definition.
11276         (DIVEXACT_BY3_METHOD): Don't default to 0 if
11277         HAVE_NATIVE_mpn_divexact_by3c.
11279 2008-09-18  Niels Möller  <nisse@lysator.liu.se>
11281         * mpn/generic/gcd.c (main): Added code for tuning of CHOOSE_P.
11283         * mpn/generic/hgcd.c (mpn_hgcd_matrix_mul): Assert that inputs are
11284         normalized.
11286 2008-09-17  Niels Möller <nisse@lysator.liu.se>  <nisse@king.swox.se>
11288         * mpn/generic/gcdext.c (mpn_gcdext): p = n/5 caused a
11289         slowdown for large inputs. As a compromise, use p = n/2 for the
11290         first iteration, and p = n/3 for the rest. Handle the first
11291         iteration specially, since the initial u0 and u1 are trivial.
11293         * mpn/x86_64/gmp-mparam.h (GCDEXT_DC_THRESHOLD): Reduced threshold
11294         from 409 to 390.
11296         * mpn/generic/gcdext.c (CHOOSE_P): New macro. Use p = n/5.
11297         (mpn_gcdext): Use CHOOSE_P, and generalized the calculation of
11298         scratch space.
11300         * tune/tuneup.c (tune_hgcd): Use default step factor.
11302         * mpn/x86_64/gmp-mparam.h: (GCD_DC_THRESHOLD): Reduced from 493 to
11303         412.
11305         * mpn/generic/gcd.c (CHOOSE_P): New macro, to determine the
11306         split when calling hgcd. Use p = 2n/3, as that seems better than
11307         the more obvious split p = n/2.
11308         (mpn_gcd): Use CHOOSE_P, and generalized the calculation of
11309         scratch space.
11311 2008-09-16  Torbjorn Granlund  <tege@gmplib.org>
11313         * mpn/generic/toom_interpolate_7pts.c: Use new mpn_divexact_byN
11314         functions.
11316         * gmp-impl.h (mpn_divexact_by3, mpn_divexact_by5, mpn_divexact_by7,
11317         mpn_divexact_by9, mpn_divexact_by11, mpn_divexact_by13,
11318         mpn_divexact_by15): New macros, defined in terms of mpn_bdiv_dbm1.
11320         * configure.in (gmp_mpn_functions): List bdiv_dbm1c.
11321         (HAVE_NATIVE): Likewise.
11322         * mpn/asm-defs.m4: Define bdiv_dbm1c.
11323         * gmp-impl.h (mpn_bdiv_dbm1c): Declare.
11324         (mpn_bdiv_dbm1): New macro.
11325         * mpn/generic/bdiv_dbm1c.c: New file.
11326         * mpn/alpha/bdiv_dbm1c.asm: New file.
11327         * mpn/ia64/bdiv_dbm1c.asm: New file.
11328         * mpn/powerpc32/bdiv_dbm1c.asm: New file.
11329         * mpn/powerpc64/mode64/bdiv_dbm1c.asm: New file.
11330         * mpn/x86/bdiv_dbm1c.asm: New file.
11331         * mpn/x86_64/bdiv_dbm1c.asm: New file.
11333         * mpn/generic/diveby3.c: Add mpn_bdiv_dbm1c based function.
11334         Choose function depending on DIVEXACT_BY3_METHOD.
11335         * gmp-impl.h (DIVEXACT_BY3_METHOD): Provide default.
11337 2008-09-16  Niels Möller  <nisse@lysator.liu.se>
11339         * mpn/generic/hgcd.c (mpn_hgcd_addmul2_n): Moved function to
11340         gcdext.c, where it is used.
11341         * mpn/generic/gcdext.c (addmul2_n): Moved and renamed, was
11342         mpn_hgcd_addmul2_n. Made static. Deleted input normalization.
11343         Deleted rn argument.
11344         (mpn_gcdext): Updated calls to addmul2_n, and added assertions.
11346         * gmp-impl.h (MPN_HGCD_MATRIX_INIT_ITCH): Increased storage by 4 limbs.
11347         (MPN_HGCD_LEHMER_ITCH): Reduced storage by one limb.
11348         (MPN_GCD_SUBDIV_STEP_ITCH): Likewise.
11349         (MPN_GCD_LEHMER_N_ITCH): Likewise.
11351         * mpn/generic/hgcd.c (mpn_hgcd_matrix_init): Use two extra limbs.
11352         (hgcd_step): Use overlapping arguments to mpn_tdiv_qr.
11353         (mpn_hgcd_matrix_mul): Deleted normalization code. Tighter bounds
11354         for the element size of the product. Needs two extra limbs of
11355         storage for the elements.
11356         (mpn_hgcd_itch): Updated storage calculation.
11358         * mpn/generic/gcd_subdiv_step.c (mpn_gcd_subdiv_step): Use
11359         overlapping arguments to mpn_tdiv_qr. Use mpn_zero_p.
11361         * mpn/generic/gcd.c (mpn_gcd): Use mpn_zero_p.
11363 2008-09-15  Niels Möller  <nisse@lysator.liu.se>
11365         * mpn/generic/hgcd.c (mpn_hgcd_matrix_init): Updated for deleted
11366         tp pointer.
11367         (hgcd_matrix_update_q): Likewise.
11368         (mpn_hgcd_matrix_mul): Likewise.
11369         (mpn_hgcd_itch): Updated calculation of scratch space.
11371         * gmp-impl.h (struct hgcd_matrix): Deleted tp pointer.
11372         (MPN_HGCD_MATRIX_INIT_ITCH): Reduced storage.
11373         (mpn_hgcd_step, MPN_HGCD_STEP_ITCH): Deleted declarations.
11375 2008-09-15  Niels Möller <nisse@lysator.liu.se>  <nisse@king.swox.se>
11377         * mpn/x86_64/gmp-mparam.h (MATRIX22_STRASSEN_THRESHOLD): New
11378         threshold.
11380         * mpn/generic/hgcd.c (mpn_hgcd_matrix_mul): Use mpn_matrix22_mul.
11381         (mpn_hgcd_itch): Updated calculation of scratch space. Use
11382         count_leading_zeros to get the recursion depth.
11384         * mpn/generic/gcd.c (mpn_gcd): Fixed calculation of scratch space,
11385         and use mpn_hgcd_itch.
11387 2008-09-15  Niels Möller  <nisse@lysator.liu.se>
11389         * tune/tuneup.c (tune_matrix22_mul): New function.
11390         (all): Use it.
11392         * tune/common.c (speed_mpn_matrix22_mul): New function.
11394         * tune/Makefile.am (TUNE_MPN_SRCS_BASIC): Added matrix22_mul.c.
11396         * tests/mpn/t-matrix22.c: Use MATRIX22_STRASSEN_THRESHOLD to
11397         select sizes for tests.
11399         * gmp-impl.h (MATRIX22_STRASSEN_THRESHOLD): New threshold
11401         * configure.in (gmp_mpn_functions): Added matrix22_mul.
11402         * gmp-impl.h: Added declarations for mpn_matrix22_mul and related
11403         functions.
11405         * mpn/Makefile.am (nodist_EXTRA_libmpn_la_SOURCES): Added
11406         matrix22_mul.c.
11407         * tests/mpn/Makefile.am (check_PROGRAMS): Added t-matrix22.
11409         * tests/mpn/t-matrix22.c: New file.
11410         * mpn/generic/matrix22_mul.c: New file.
11412 2008-09-11  Niels Möller  <nisse@king.swox.se>
11414         * tune/tuneup.c: Updated tuning of gcdext.
11416         * mpn/x86_64/gmp-mparam.h (GCDEXT_DC_THRESHOLD): Reduced threshold
11417         from 713 to 409.
11419 2008-09-11  Niels Möller  <nisse@lysator.liu.se>
11421         * gmp-impl.h: Updated for gcdext changes.
11422         (GCDEXT_DC_THRESHOLD): New constant, renamed from
11423         GCDEXT_SCHOENHAGE_THRESHOLD.
11425         * mpn/generic/gcdext.c (compute_v): Accept non-normalized a and b
11426         as inputs.
11427         (mpn_gcdext): Rewrote and simplified. Now uses the new mpn_hgcd
11428         interface.
11430         * mpn/generic/hgcd.c (mpn_hgcd_addmul2_n): Renamed from addmul2_n
11431         and made non-static. Changed interface to take non-normalized
11432         inputs, and only two size arguments.
11433         (mpn_hgcd_matrix_mul): Simplified using new mpn_hgcd_addmul2_n.
11435         * mpn/generic/gcdext_lehmer.c (mpn_gcdext_lehmer_itch): Deleted
11436         function.
11437         (mpn_gcdext_lehmer_n): Renamed from mpn_gcd_lehmer. Now takes
11438         inputs of equal size. Moved the code for the division step to a
11439         separate function...
11440         * mpn/generic/gcdext_subdiv_step.c (mpn_gcdext_subdiv_step): New
11441         file, new function.
11443         * configure.in (gmp_mpn_functions): Added gcdext_subdiv_step.
11445 2008-09-10  Torbjorn Granlund  <tege@gmplib.org>
11447         * tests/devel/anymul_1.c: Include <string.h>.
11449         * gmp-h.in: Unconditionally include <cstdio>.
11451 2008-09-10  Niels Möller  <nisse@lysator.liu.se>
11453         * tune/common.c: #if:ed out speed_mpn_gcd_binary and
11454         speed_mpn_gcd_accel.
11455         * tune/speed.c (routine): #if:ed out mpn_gcd_binary, mpn_gcd_accel
11456         and find_a.
11457         * tune/Makefile.am (libspeed_la_SOURCES): Removed gcd_bin.c
11458         gcd_accel.c gcd_finda_gen.c.
11459         * tune/tuneup.c: Enable tuning of GCD_DC_THRESHOLD.
11461         * mpn/generic/gcd.c (mpn_gcd): Rewrote and simplified. Now uses
11462         the new mpn_hgcd interface.
11464         * */gmp-mparam.h: Renamed GCD_SCHOENHAGE_THRESHOLD to
11465         GCD_DC_THRESHOLD.
11467         * mpn/generic/gcd_lehmer.c (mpn_gcd_lehmer_n): Renamed (was
11468         mpn_gcd_lehmer). Now takes inputs of equal size.
11470         * mpn/generic/gcd_lehmer.c (mpn_gcd_lehmer): Reintroduced gcd_2,
11471         to get better performance for small inputs.
11473         * mpn/generic/hgcd.c: Don't hardcode small HGCD_THRESHOLD.
11474         * mpn/x86_64/gmp-mparam.h (HGCD_THRESHOLD): Reduced from 145 to
11475         120.
11476         * */gmp-mparam.h: Renamed HGCD_SCHOENHAGE_THRESHOLD to
11477         HGCD_THRESHOLD.
11479 2008-09-09  Torbjorn Granlund  <tege@gmplib.org>
11481         * doc/gmp.texi: Fix a typo and clarify mpn_gcdext docs.
11483 2008-09-09  Niels Möller  <nisse@lysator.liu.se>
11485         * tune/common.c (speed_mpn_hgcd, speed_mpn_hgcd_lehmer): Adapted
11486         to new hgcd interface.
11488         * gmp-impl.h (MPN_HGCD_LEHMER_ITCH): New macro.
11490         * hgcd.c (mpn_hgcd_lehmer): Renamed function, from hgcd_base. Made
11491         non-static.
11493         * gcd_lehmer.c (mpn_gcd_lehmer): Use hgcd2 also for n == 2.
11495         * gcdext_lehmer.c (mpn_gcdext_lehmer): Simplified code for
11496         division step. Added proper book-keeping of swaps, which affect
11497         the sign of the returned cofactor.
11499         * tests/mpz/t-gcd.c (one_test): Display co-factor when mpn_gcdext
11500         fails.
11502         * gcd_lehmer.c (mpn_gcd_lehmer): At end of loop, need to handle
11503         the special case n == 1 correctly.
11505         * gcd_subdiv_step.c (mpn_gcd_subdiv_step): Simplified function.
11506         The special cancellation logic is not needed here.
11508 2008-09-08  Torbjorn Granlund  <tege@gmplib.org>
11510         * mpn/generic/invert.c: Add working but slow code.
11512         * mpn/x86_64/x86_64-defs.m4 (R32, R8): New macros.
11514         * mpn/ia64/submul_1.asm: Move some labels for broader assembler
11515         compatibility.
11517         * gmp-impl.h (mpn_mul_3, mpn_mul_4): Declare.
11518         * tests/tests.h (refmpn_mul_3, refmpn_mul_4): Declare.
11519         * tests/try.c (param_init): Set things up for mpn_mul_3 and mpn_mul_4.
11520         (choice_array): Likewise.
11521         (call): Likewise.
11522         * mpn/Makefile.am (nodist_EXTRA_libmpn_la_SOURCES):
11523         Add mul_3.c and mul_4.
11524         * mpn/asm-defs.m4: Define mul_3 and mul_4.
11525         * tests/refmpn.c (refmpn_mul_N): New function.
11526         (refmpn_mul_2): Remove old definition, call refmpn_mul_N.
11527         (refmpn_mul_3, refmpn_mul_4): New functions.
11528         * tune/common.c (speed_mpn_mul_3, speed_mpn_mul_4): New functions.
11529         * tune/speed.h (speed_mpn_mul_3, speed_mpn_mul_4): Declare.
11530         * tune/speed.c (routine): New entries for mpn_mul_2 and mpn_mul_3.
11532         * ltmain.sh: Update to libtool 1.5.24.
11534         * mpn/generic/mul_toom22.c: Compute s and t more cleverly.
11536 2008-09-08  Niels Möller  <nisse@lysator.liu.se>
11538         * tests/mpn/t-hgcd.c: Updated tests. Rewrite of hgcd_ref.
11540         * mpn/generic/gcdext_lehmer.c (mpn_gcdext_lehmer_itch): New function.
11541         (mpn_gcdext_lehmer): Various bugfixes.
11543         * gcdext.c (mpn_gcdext): Allocate scratch space for gcdext_lehmer.
11545         * mpn/generic/gcd_lehmer.c (gcd_2): ASSERT that inputs are odd.
11546         (mpn_gcd_lehmer): Added tp argument, for scratch space. Make both
11547         arguments odd before calling gcd_2.
11549         * mpn/generic/hgcd.c (mpn_hgcd): Allow the trivial case n <= 2,
11550         and return 0 immediately.
11552         * gmp-impl.h (MPN_EXTRACT_NUMB): New macro.
11554         * configure.in (gmp_mpn_functions): Added gcdext_lehmer.
11556 2008-09-05  Torbjorn Granlund  <tege@gmplib.org>
11558         * mpn/generic/toom_interpolate_7pts.c: Use mpn_divexact_by3c instead of
11559         divexact_odd.
11561         * doc/texinfo.tex: Update to 2007-06-29.13.
11563         * doc/gmp.texi: Update GMP site URL.  Fix some typos.
11565         * demos/pexpr.c (main): Allow bases up to 62.
11567         * gmp-impl.h: Remove formal parameter names from function prototypes.
11569         * config.guess: Recognize recent AMD and Itanium CPUs.
11570         Default X86 CPU recognition to configfsf.guess' value.
11572         * configure.in: Handle core2 separately from athlon64.
11574 2008-09-05  Niels Möller  <nisse@lysator.liu.se>
11576         * */Makefile.in, configure, aclocal.m4, config.in: Removed files
11577         from repository. They're instead generated by automake and
11578         autoconf before distribution.
11580 2008-08-25  Torbjorn Granlund  <tege@gmplib.org>
11582         * mpf/set_str.c: Allocate mantissa space based on mantissa size,
11583         not on destination variable space.
11584         * mpf/set_str.c: Accept unary plus before exponent.
11586 2008-08-06  Torbjorn Granlund  <tege@gmplib.org>
11588         * mpn/generic/mul_toom22.c: Add statistics gathering functionality,
11589         triggered by cpp predef STAT.
11591         From David Harvey:
11592         * mpn/generic/mul_toom22.c: Decrease scratch space usage.
11594 2008-08-02  Torbjorn Granlund  <tege@gmplib.org>
11596         * tests/misc/t-scanf.c: Avoid negative arguments to _ui functions.
11597         * tests/misc/t-printf.c: Likewise.
11599         * acinclude.m4 (X86_PATTERN): Add geode.
11601         * acinclude.m4 (CL_AS_NOEXECSTACK): Avoid -q flag to grep.
11603 2008-08-01  Torbjorn Granlund  <tege@gmplib.org>
11605         * acinclude.m4 (CL_AS_NOEXECSTACK): New.
11606         * configure.in: Use CL_AS_NOEXECSTACK.
11607         * mpn/Makeasm.am: Use ASM_FLAGS (defined by CL_AS_NOEXECSTACK).
11609         * gmpxx.h (__GMP_DBL_LIMBS): Use DBL_MAX_EXP instead of
11610         std::numeric_limits<double>::max_exponent for better portability.
11612 2008-07-29  Torbjorn Granlund  <tege@gmplib.org>
11614         * gmpxx.h (__GMP_DBL_LIMBS): New #define.
11615         (__GMP_ULI_LIMBS): New #define.
11616         (__GMPXX_TMP_UI): New macro.
11617         (__GMPXX_TMP_SI): New macro.
11618         (__GMPXX_TMP_D): New macro.
11619         (struct __gmp_binary_and): Rewrite, using the new macros.
11620         (struct __gmp_binary_ior): Likewise.
11621         (struct __gmp_binary_xor): Likewise.
11623 2008-07-28  Torbjorn Granlund  <tege@gmplib.org>
11625         * tests/cxx/t-binary.cc: Add some tests for logical operations.
11627 2008-07-24  Torbjorn Granlund  <tege@gmplib.org>
11629         * gmpxx.h: Use __GMPZ_* instead of __GMPZZ_* for bitwise ops, remove
11630         __GMPZZ_*.
11631         Remove repeated #undefs.
11632         (__gmp_alloc_cstring): Declare freefunc as extern "C".
11634 2008-07-23  Torbjorn Granlund  <tege@gmplib.org>
11636         * gmp-h.in (__GMP_CC): New define, undocumented for now.
11637         (__GMP_CFLAGS): Likewise.
11639 2008-07-21  Torbjorn Granlund  <tege@gmplib.org>
11641         * tests/amd64check.c: Fix a printf type clash.
11643         * mpz/realloc.c: Amend last fix.
11645         * gmp-h.in: Include <cstdlib> for C++.
11646         * gmp-h.in: Handle new gcc 4.3 inline semantics defaults.
11648         * configfsf.guess: Update to version of 2008-04-14.
11649         * configfsf.sub: Update to version of 2008-06-16.
11651         * configure.in: Separate core2 and athlon64 flags handling.
11653 2008-06-19  Torbjorn Granlund  <tege@gmplib.org>
11655         * config.guess: Recognize pentiumm and AMD geode.
11656         * config.sub: Likewise.
11657         * configure.in: Likewise.
11659 2008-06-02  Torbjorn Granlund  <tege@gmplib.org>
11661         * configure.in: Disallow odd nails sizes.
11662         * configure.in: Inherit default gcc_cflags/gcc_64_cflags everywhere.
11664 2008-05-23  Torbjorn Granlund  <tege@gmplib.org>
11666         * mpz/init2.c: Rewrite to avoid internal overflow and to detect mpz_t
11667         overflow.
11668         * mpz/realloc2.c: Likewise.
11669         * mpz/realloc.c: Detect mpz_t overflow.
11671 2008-05-22  Torbjorn Granlund  <tege@gmplib.org>
11673         * configure.in (sparc): Remove -fast, it causes documented
11674         miscompilation.
11676         * config.guess: Properly handle the "extended" variants of x86 cpuid.
11678 2008-05-09  Torbjorn Granlund  <tege@gmplib.org>
11680         * gmp-impl.h (mpn_mul_fft): Now void.
11681         (udiv_qrnnd_preinv3): Special case for constant (nl).
11683 2008-05-08  Torbjorn Granlund  <tege@gmplib.org>
11685         * mpn/generic/mul_fft.c: Clean up types in TRACE (printf (...)).
11686         (TRACE): Redefine to allow command line control.
11687         (mpn_mul_fft_internal): Now void, remove return value.
11688         (mpn_mul_fft): Likewise.
11689         (MPN_FFT_TABLE2_SIZE): Up size fro 256 to 512.
11690         (mpn_fft_fft): Call mpn_fft_mul_2exp_modF just once instead of twice,
11691         then add/subtract result.  Get rid of temp allocation as a result.
11692         Remove some redundant CNST_LIMB.
11693         (mpn_fft_fftinv): Analogous changes.
11694         (mpn_fft_sub_modF): Re-enable, now needed by mpn_fft_fft and
11695         mpn_fft_fftinv.
11697 2008-03-10  Torbjorn Granlund  <tege@gmplib.org>
11699         * tests/mpz/t-mul.c (main): Let GMP_CHECK_FFT mean largest allowed
11700         power-of-2 of test operands.
11702 2008-02-28  Torbjorn Granlund  <tege@gmplib.org>
11704         * tests/cxx/t-binary.cc (check_mpz): Expect floor rounding for right
11705         shift.
11707 2008-02-27  Torbjorn Granlund  <tege@gmplib.org>
11709         * mpz/mul_i.h: Check sml's size (not the signed small_mult).
11711         * longlong.h (umul_ppmm) [alpha]: Define using __builtin_alpha_umulh
11712         when possible.
11714         * longlong.h (count_trailing_zeros): Force destination register mode.
11716         * gmpxx.h (struct __gmp_binary_rshift): Use floor rounding, not
11717         truncation.
11719         * gmpxx.h (__gmp_binary_and, __gmp_binary_ior, __gmp_binary_xor):
11720         Add variants with unsigned long int argument.
11722         * config.sub: Recog geode.
11723         * config.guess: Likewise.
11724         * acinclude.m4 (X86_PATTERN): Likewise.
11726 2008-02-10  Torbjorn Granlund  <tege@gmplib.org>
11728         * mpn/x86/p6/aors_n.asm: Use Zdisp to work around GNU as bug.
11729         * mpn/x86/x86-defs.m4 (Zdisp): Add more instructions.
11731 2008-02-08  Torbjorn Granlund  <tege@gmplib.org>
11733         * mpn/x86_64/aors_n.asm: New file.
11734         * mpn/x86_64/add_n.asm: Delete.
11735         * mpn/x86_64/sub_n.asm: Delete.
11737 2008-02-07  Torbjorn Granlund  <tege@gmplib.org>
11739         * mpn/x86/k6/mmx/dive_1.asm: Fix typo in last change.
11741 2007-12-10  Torbjorn Granlund  <tege@swox.com>
11743         * mpf/set_str.c (mpf_set_str): Write own code for converting the
11744         exponent, avoids strtol base < 36 limitation.
11746 2007-10-28  Torbjorn Granlund  <tege@swox.com>
11748         * gmp-impl.h (mpn_dc_get_str_itch): New macro.
11749         (mpn_dc_get_str_powtab_alloc): New macro.
11750         (struct powers): Add field "shift".
11752         * mpn/generic/get_str.c: Compute powers without low zero limbs; all
11753         functions modified.  Correct temporary allocation.  Misc cleanups.
11755         * mpn/generic/set_str.c: Compute powers without low zero limbs; all
11756         functions modified.
11757         (mpn_dc_set_str): Remove impossible case, replace by an ASSERT.
11759 2007-10-26  Torbjorn Granlund  <tege@swox.com>
11761         * mpn/generic/set_str.c: Remove default thresholds, not in gmp-impl.h.
11762         (mpn_dc_set_str): Insert ASSERT_ALWAYS in a presumably dead code arm.
11764 2007-10-22  Torbjorn Granlund  <tege@swox.com>
11766         * gmp-impl.h (mpn_add_nc): Define as inline function, unless NATIVE.
11767         (mpn_sub_nc): Likewise.
11769 2007-10-17  Torbjorn Granlund  <tege@swox.com>
11771         * tests/misc/t-printf.c: Fix a printf type clash.
11772         * tests/mpq/t-get_str.c: Likewise.
11773         * tests/mpz/t-import.c: Likewise.
11775         * acinclude.m4: Conditionally disable some tests when compiled by a C++
11776         compiler.
11778         * gmp-impl.h (udiv_qrnnd_preinv3): Remove an unused variable.
11780         * mpn/generic/hgcd.c: Add some WANT_ASSERTs to shut up warnings.
11782 2007-10-08  Torbjorn Granlund  <tege@swox.com>
11784         * mpn/powerpc64/elf.m4 (LEAL): Define as an alias for LEA.
11785         * mpn/powerpc32/darwin.m4 (LEAL): Likewise.
11786         * mpn/powerpc64/aix.m4: Likewise.
11788         * mpn/powerpc64/vmx/popcount.asm: Use LEAL.
11790         * mpn/powerpc64/darwin.m4 (LEAL): New name for LEA, since it is only
11791         usable for local symbols.
11792         (LEA): Replace with code for external references.
11794         * mpn/powerpc32/vmx/mod_34lsub1.asm: Use LEAL.
11796 2007-10-07  Torbjorn Granlund  <tege@swox.com>
11798         * mpn/x86/dive_1.asm: Use LEA, remove explicit movl_eip_*.
11799         * mpn/x86/k6/mode1o.asm: Likewise.
11800         * mpn/x86/k6/mmx/dive_1.asm: Likewise.
11801         * mpn/x86/k7/dive_1.asm: Likewise.
11802         * mpn/x86/k7/mode1o.asm: Likewise.
11803         * mpn/x86/p6/dive_1.asm: Likewise.
11804         * mpn/x86/p6/mode1o.asm: Likewise.
11805         * mpn/x86/pentium4/sse2/dive_1.asm: Likewise.
11806         * mpn/x86/pentium4/sse2/mode1o.asm: Likewise.
11807         * mpn/x86/pentium4/sse2/popcount.asm: Likewise.
11809         * mpn/x86/p6/aors_n.asm: Table cycle counts.
11811         * mpn/x86/k7/mod_34lsub1.asm: Fix over-optimistic cycle count claims.
11813         * mpn/x86/x86-defs.m4 (DEF_OBJECT, END_OBJECT): New define's.
11815         * mpn/x86/darwin.m4 (LEA): Put also movl_eip_XX into EPILOGUE_cpu.
11816         Expect target register to have prepended %.
11818         * mpn/x86_64/add_n.asm: Use L() for labels.
11819         * mpn/x86_64/addlsh1_n.asm: Likewise.
11820         * mpn/x86_64/addmul_2.asm: Likewise.
11821         * mpn/x86_64/aorrlsh_n.asm: Likewise.
11822         * mpn/x86_64/aorsmul_1.asm: Likewise.
11823         * mpn/x86_64/com_n.asm: Likewise.
11824         * mpn/x86_64/copyd.asm: Likewise.
11825         * mpn/x86_64/copyi.asm: Likewise.
11826         * mpn/x86_64/diveby3.asm: Likewise.
11827         * mpn/x86_64/logops_n.asm: Likewise.
11828         * mpn/x86_64/lshsub_n.asm: Likewise.
11829         * mpn/x86_64/mul_1.asm: Likewise.
11830         * mpn/x86_64/mul_2.asm: Likewise.
11831         * mpn/x86_64/mul_basecase.asm: Likewise.
11832         * mpn/x86_64/popham.asm: Likewise.
11833         * mpn/x86_64/redc_1.asm: Likewise.
11834         * mpn/x86_64/rsh1add_n.asm: Likewise.
11835         * mpn/x86_64/rsh1sub_n.asm: Likewise.
11836         * mpn/x86_64/rshift.asm: Likewise.
11837         * mpn/x86_64/sub_n.asm: Likewise.
11838         * mpn/x86_64/sublsh1_n.asm Likewise.
11839         * mpn/x86_64/pentium4/aors_n.asm: Likewise.
11840         * mpn/x86_64/pentium4/lshift.asm: Likewise.
11841         * mpn/x86_64/pentium4/rshift.asm: Likewise.
11843         * mpn/x86_64/x86_64-defs.m4: New file, defining LEA, DEF_OBJECT, and
11844         END_OBJECT.
11846         * mpn/generic/mul.c: Put TMP_DECL as last decl.
11848 2007-10-06  Torbjorn Granlund  <tege@swox.com>
11850         * mpn/x86/pentium4/sse2/popcount.asm: New file.
11852 2007-09-26  Torbjorn Granlund  <tege@swox.com>
11854         * mpz/get_str.c: Cast a char index to int to shut up compilers.
11856         * mpn/generic/dc_div_qr.c: Pass dummy scratch argument to mpn_invert.
11857         * mpn/generic/dc_divappr_q.c: Likewise.
11858         * mpn/generic/mu_div_qr.c: Likewise.
11859         * mpn/generic/mu_divappr_q.c: Likewise.
11860         * mpn/generic/mu_div_q.c: Likewise.
11861         * mpn/generic/divexact.c: Likewise.
11863         * mpn/generic/invert.c: New file, placeholder for now.
11865 2007-09-24  Torbjorn Granlund  <tege@swox.com>
11867         * mpn/generic/toom_interpolate_5pts.c: New file, contents from
11868         mpn/generic/mul_n.c
11869         * mpn/generic/mul_n.c (mpn_toom3_interpolate): Function removed.
11871         * mpn/generic/toom_interpolate_7pts.c: New file.
11873         * mpn/x86/k7/mmx/popham.asm: Table cycle counts.
11875         * mpn/x86/k6/README: Update URLs.
11877         * mpn/powerpc32/README: Update URL's, company names.
11879         * mpn/generic/get_d.c: Complete rewrite.
11881         * mpn/generic/mul_toom33.c: New file.
11883         * mpn/generic/mul_toom22.c: Make orthogonal with other toomXY files.
11884         * mpn/generic/mul_toom32.c: Likewise.
11885         * mpn/generic/mul_toom42.c: Likewise.
11887         * mpn/alpha/invert_limb.asm: Update cycle counts.  Fix a comment typo.
11889         * mpf/get_str.c: Include stdlib.h, not stdio.h for NULL.
11891         * doc/gmp.texi: Fix a typo.
11893         * memory.c (__gmp_default_allocate, __gmp_default_reallocate):
11894         Cast size operands in error fprintf's.
11896         * longlong.h (sub_ddmmss) [powerpc 64]: Add more variants for constant
11897         args.
11899         * gmp-impl.h (udiv_qrnnd_preinv3): New define.
11900         * gmp-impl.h (ULONG_PARITY): Exclude masquerading __INTEL_COMPILER from
11901         ia64 asm.
11903         * gmp-h.in (mpn_neg_n): New function.
11905 2007-09-18  Torbjorn Granlund  <tege@swox.com>
11907         * demos/pexpr.c (main): Add -v option.
11908         (enum op_t): New tag TIMING.
11909         (mpz_eval_expr): Execute TIMING.
11910         (fns): Add TIMING entry.
11912         * gmp-impl.h: Add decls and THRESHOLDs for new toom multiplication
11913         functions and division functions.
11915 2007-09-10  Torbjorn Granlund  <tege@swox.com>
11917         * mpn/powerpc32/addlsh1_n.asm: Use L() for labels.
11918         * mpn/powerpc32/sublsh1_n.asm: Likewise.
11920 2007-09-09  Torbjorn Granlund  <tege@swox.com>
11922         * mpn/x86/x86-defs.m4 (LEA): New define.
11923         * mpn/x86/darwin.m4: New file, for now just defining LEA.
11924         * configure.in: Pick up x86/darwin.m4.
11925         * mpn/x86/*: Use LEA for PIC references.
11927         * configure.in: For X86/32, treat core2 like pentium3.
11929 2007-09-06  Torbjorn Granlund  <tege@swox.com>
11931         * tests/amd64check.c (calling_conventions_values): Put constants,
11932         dynamic values in this array (was in scalars).
11933         (calling_conventions_check): Corresponding changes.
11934         * tests/amd64call.asm: Rewrite to be PIC, smaller, using amd64check.c's
11935         array.
11937 2007-09-04  Torbjorn Granlund  <tege@swox.com>
11939         * mpn/x86/pentium4/sse2/mul_basecase.asm: Misc cleanups.
11940         * mpn/x86/pentium4/sse2/sqr_basecase.asm: Likewise.
11942         * mpn/x86_64/mod_34lsub1.asm: Optimize loop, reduce code size.
11944         * tests/amd64call.asm: Remove bogus no-op moves.
11946 2007-09-03  Torbjorn Granlund  <tege@swox.com>
11948         From Richard Guenther:
11949         * gmp-h.in (__GMP_EXTERN_INLINE): Declare conditionally on
11950         __GNUC_STDC_INLINE__.
11952         * tests/cxx/t-locale.cc: #include <cstdlib>, for abort.
11954         * mpn/x86_64/core2/popcount.asm: New file.
11955         * mpn/x86_64/pentium4/popcount.asm: New file.
11957         * mpn/x86_64/addmul_2.asm: New file.
11958         * mpn/x86_64/mul_2.asm: New file.
11960         * mpn/x86_64/aorsmul_1.asm: Use 32-bit mov for zeroing registers
11961         (saves space).
11963 2007-09-01  Torbjorn Granlund  <tege@swox.com>
11965         * configure.in: Handle athlon64, core2, and pentium4 separately for
11966         64-bit ABI.
11968         * config.sub: Recog athlon64, core2, and opteron.
11970         * config.guess: Do two x86 variants, for 32-bit ABI and 64-bit ABI.
11971         Return "athlon64" and "core2", not x86_64.
11973 2007-08-31  Torbjorn Granlund  <tege@swox.com>
11975         From Patrick Pelissier:
11976         * gmp-h.in: Don't refer to FILE from C++ unless we've seen FILE.
11978 2007-08-30  Torbjorn Granlund  <tege@swox.com>
11980         * demos/isprime.c: Include string.h for strcmp.
11982         * demos/factorize.c (main): Declare to int.
11984 2007-06-22  Torbjorn Granlund  <tege@swox.com>
11986         * mpn/x86_64/pentium4/lshift.asm: Minor tuning.
11987         * mpn/x86_64/pentium4/rshift.asm: Likewise.
11989 2007-05-30  Torbjorn Granlund  <tege@swox.com>
11991         * mpn/powerpc64/mode64/aors_n.asm: Add _nc entry points.
11993 2007-05-22  Torbjorn Granlund  <tege@swox.com>
11995         * tests/memory.c: Cast calls to new mem* calls to avoid unaligned ops.
11997 2007-05-16  Torbjorn Granlund  <tege@swox.com>
11999         * tests/mpz/convert.c: Tweak operand sizes for best coverage.
12001         * tests/memory.c: Add red zones around allocations.
12003 2007-05-15  Torbjorn Granlund  <tege@swox.com>
12005         * mpn/ia64/mul_1.asm: Make mul_1c entry point actually work.
12007         * mpn/generic/set_str.c (mpn_dc_set_str): Avoid calling mpn_add_n when
12008         ln == 0.
12010         * tests/mpz/convert.c (string_urandomb): New function.
12011         (main): Use it by enabling ifdef'ed out code.
12013 2007-04-30  Torbjorn Granlund  <tege@swox.com>
12015         * mpn/x86_64/mul_basecase.asm: Complete rewrite.
12017         * mpn/x86_64/copyi.asm: Use short shift-by-one form.  Misc cleanups.
12018         * mpn/x86_64/copyi.asm: Likewise.
12019         * mpn/x86_64/popham.asm: Likewise.
12021         * mpn/x86_64/aorsmul_1.asm: Cleanup formatting.
12023 2007-04-25  Torbjorn Granlund  <tege@swox.com>
12025         * mpz/divexact.c: Handle undefined case of |N| < |D| to avoid segfaults.
12027 2007-02-24  Torbjorn Granlund  <tege@swox.com>
12029         * doc/gmp.texi (Toom 3-Way Multiplication): Fix typo.
12030         (mpz_scan0, mpz_scan1): Fix typos.
12031         (Float Internals): Rewrite paragraph about struct types.
12033 2007-02-12  Torbjorn Granlund  <tege@swox.com>
12035         * mpn/x86/pentium4/sse2/sqr_basecase.asm: Complete rewrite (except
12036         diagonal code).
12038 2007-02-05  Torbjorn Granlund  <tege@swox.com>
12040         * mpn/generic/mul_fft.c (mpn_fft_fft): New name for mpn_fft_fft_sqr,
12041         old mpn_fft_fft removed.
12042         (mpn_mul_fft_internal): Call mpn_fft_fft separately for each operand.
12043         (mpn_fft_add_modF): Rewrite to avoid random branches.
12044         (mpn_fft_sub_modF): Likewise.
12046         * mpn/x86/pentium4/sse2/addmul_1.asm: Complete rewrite.
12047         * mpn/x86/pentium4/sse2/mul_1.asm: Complete rewrite.
12048         * mpn/x86/pentium4/sse2/mul_basecase.asm: Complete rewrite, based on
12049         new addmul and mul code.
12051 2007-01-31  Torbjorn Granlund  <tege@swox.com>
12053         * mpn/generic/get_str.c (mpn_sb_get_str): Get loop count for frac
12054         development right.
12056         * mpn/powerpc32/vmx/mod_34lsub1.asm: New file.
12058         * mpn/powerpc32/aors_n.asm: New file, complete rewrite.
12059         * mpn/powerpc32/add_n.asm: Remove.
12060         * mpn/powerpc32/sub_n.asm: Remove.
12062 2007-01-25  Torbjorn Granlund  <tege@swox.com>
12064         * mpn/x86_64/core2/aors_n.asm: Add _nc entry points, minor cleanups.
12066         * mpn/x86_64/core2/lshift.asm: Rewrite.
12067         * mpn/x86_64/core2/rshift.asm: Rewrite.
12069         * mpn/x86_64/pentium4/lshift.asm: Swap some loop insns for a small
12070         speedup.
12071         * mpn/x86_64/pentium4/rshift.asm: New file, based on lshift.asm.
12073         * mpn/x86_64/pentium4/gmp-mparam.h: New file.
12075         * mpn/x86_64/pentium4/aors_n.asm: Complete rewrite of add/subtract
12076         code.
12077         * mpn/x86_64/pentium4/add_n.asm: Remove.
12078         * mpn/x86_64/pentium4/sub_n.asm: Remove.
12080 2007-01-20  Torbjorn Granlund  <tege@swox.com>
12082         * mpn/x86_64/lshift.asm: Add special case for cnt=1.
12084 2007-01-19  Torbjorn Granlund  <tege@swox.com>
12086         * mpn/x86_64/aorsmul_1.asm: New file, written from scratch, finally at
12087         3.0 c/l on K8 (addmul_1 was 3.3; submul_1 was 3.5).
12088         * mpn/x86_64/addmul_1.asm: Remove.
12089         * mpn/x86_64/submul_1.asm: Remove.
12091 2006-12-29  Torbjorn Granlund  <tege@swox.com>
12093         * randmt.c (__gmp_randclear_mt): Initialize ALLOC field, like in
12094         __gmp_randinit_mt_noseed.
12095         (__gmp_randclear_mt, __gmp_randinit_mt_noseed): Make similar functions
12096         look similar.
12097         (__gmp_randclear_mt): Pass actually allocated size.
12099         * mpn/Makefile.am (nodist_EXTRA_libmpn_la_SOURCES): Add mul_toom22.c,
12100         mul_toom32.c, mul_toom42.c.
12102         * configure.in: Recognize athlon64 and core2 as alternatives to x86_64.
12103         Provide special settings for core2.
12105         * configure.in (gmp_mpn_functions): Add mul_toom22, mul_toom32,
12106         mul_toom42.
12108         * mpn/generic/mul_toom22.c: New file.
12109         * mpn/generic/mul.c: Use mpn_mul_toom22.  Trim cutoff points between
12110         the mpn_mul_toomN2 functions.  Handle balanced operands at function
12111         entry.
12113 2006-12-29  Marco Bodrato  <bodrato@mail.dm.unipi.it>
12115         * mpn/generic/mul_n.c: Rewrite interpolation code.
12117 2006-12-28  Torbjorn Granlund  <tege@swox.com>
12119         * mpn/generic/mul_toom32.c: New file.
12120         * mpn/generic/mul_toom42.c: New file.
12121         * mpn/generic/mul.c: Use mpn_mul_toom32 and mpn_mul_toom42 for
12122         unbalanced operands.
12124 2006-12-17  Torbjorn Granlund  <tege@swox.com>
12126         * mpn/x86_64/aorrlsh_n.asm: New file.
12127         * mpn/x86_64/lshsub_n.asm: New file.
12129         * mpn/x86_64/core2/aors_n.asm: New file.
12130         * mpn/x86_64/core2/lshift.asm: New file.
12131         * mpn/x86_64/core2/rshift.asm: New file.
12133         * mpn/x86/p6/aors_n.asm: Replace K7 grabbing code with P6 specific
12134         code.
12136         * mpn/x86/p6/lshsub_n.asm: New file.
12138 2006-11-23  Torbjorn Granlund  <tege@swox.com>
12140         * tune/speed.h (SPEED_ROUTINE_MPN_MUL_BASECASE): Allocate space for xp
12141         locally, s->xp might be insufficient.
12143 2006-11-22  Torbjorn Granlund  <tege@swox.com>
12145         * randmt.c (__gmp_randinit_mt_noseed): Initialize ALLOC field of result
12146         param.
12148 2006-11-06  Torbjorn Granlund  <tege@swox.com>
12150         * tune/set_strp.c: New file.
12152 2006-11-04  Torbjorn Granlund  <tege@swox.com>
12154         * extract-dbl.c: Rewrite to handle nails better, and for general
12155         optimization.
12157         * mpz/bin_uiui.c: Simplify.
12159         * longlong.h (umul_ppmm) [mmix]: New.
12161         * tune/tuneup.c, tune/common.c, tune/speed.c, tune/speed.h,
12162         tune/set_strb.c, tune/set_strs.c: Add tuning and speed measurements
12163         of separate SET_STR_DC_THRESHOLD and SET_STR_PRECOMPUTE_THRESHOLD.
12164         Add tuning and speed measurement of mpn_addsub_n.
12166 2006-10-31  Torbjorn Granlund  <tege@swox.com>
12168         * gmpxx.h: Remove ternary stuff, it is hardly an optimization and it
12169         writes to destination before reading all source operands.
12171 2006-10-25  Torbjorn Granlund  <tege@swox.com>
12173         * mpn/generic/set_str.c: Complete rewrite.
12174         * mpn/generic/get_str.c: Likewise.
12176         * gmp-impl.h (struct powers, powers_t): New types.
12177         Restructure GET_STR_* and SET_STR_* thresholds.
12179 2006-09-21  Torbjorn Granlund  <tege@swox.com>
12181         * mpn/generic/rootrem.c: Remove some redundant casts.
12183 2006-07-12  Torbjorn Granlund  <tege@swox.com>
12185         * mpn/alpha/ev6/nails/addmul_2.asm: Make it run at claimed speed.
12186         * mpn/alpha/ev6/nails/addmul_4.asm: Likewise.
12188         * mpf/get_str.c: Avoid copying result when not needed.  Misc cleanups.
12190         * tests/amd64call.asm: Use jmp instead of jmpq to placate Solaris.
12192 2006-06-30  Torbjorn Granlund  <tege@swox.com>
12194         * configure.in (powerpc-*): Remove repeated path component.
12196 2006-06-15  Torbjorn Granlund  <tege@swox.com>
12198         * configure.in: (ia64-*-linux*): Don't use -O3.
12200 2006-06-14  Torbjorn Granlund  <tege@swox.com>
12202         * mpq/get_str.c: Fix upper base limit boundary in an ASSERT.
12204         * tests/refmpn.c (refmpn_sb_divrem_mn): Use ASSERT_CARRY for add-back.
12206 2006-05-31  Torbjorn Granlund  <tege@swox.com>
12208         * tests/mpz/t-set_d.c (check_data): Add more data points.
12210         * mpz/set_d.c: Handle negative return values from __gmp_extract_double.
12212 2006-05-17  Torbjorn Granlund  <tege@swox.com>
12214         * configure.in: Clear out gcc_cflags_cpu and gcc_cflags_arch for a fat
12215         build.
12217 2006-05-16  Torbjorn Granlund  <tege@swox.com>
12219         * demos/primes.c (find_primes): Increase mpz_probab_prime_p cnt to 10.
12221         * mpn/generic/addsub_n.c: Fix criteria form when to call _nc functions.
12223 2006-05-12  Torbjorn Granlund  <tege@swox.com>
12225         * config.guess: Recognize more ppc processor types.
12227 2006-05-11  Torbjorn Granlund  <tege@swox.com>
12229         * tune/speed.c (usage): Update URL for gnuplot and quickplot.
12231 2006-05-10  Torbjorn Granlund  <tege@swox.com>
12233         * configure.in (powerpc-*-*): Pass -maltivec to assembler for
12234         appropriate CPUs.
12236 2006-05-08  Torbjorn Granlund  <tege@swox.com>
12238         * mpn/powerpc32/aix.m4 (LEA): Remove [RW] attribute.
12240 2006-05-03  Torbjorn Granlund  <tege@swox.com>
12242         * mpn/powerpc64/vmx/popcount.asm: Conditionally zero extend n.
12244 2006-04-27  Torbjorn Granlund  <tege@swox.com>
12246         * mpz/divexact.c: Call mpz_tdiv_q for large operands.
12248         * configure.in (powerpc-*-darwin): Remove -fast, it affects PIC.
12250 2006-04-26  Torbjorn Granlund  <tege@swox.com>
12252         * config.guess: Try to recognize Ultrasparc T1 (as ultrasparct1).
12253         * config.sub: Handle ultrasparct1.
12255 2006-04-25  Torbjorn Granlund  <tege@swox.com>
12257         * mpn/sparc64/gmp-mparam.h: Retune, without separation of GNUC and
12258         non-GNUC data.
12260 2006-04-20  Torbjorn Granlund  <tege@swox.com>
12262         * tests/mpz/convert.c: Increase operands range.
12264 2006-04-19  Torbjorn Granlund  <tege@swox.com>
12266         * configure.in: Support powerpc eABI.
12267         * mpn/powerpc32/eabi.m4: New file.
12269         * configure.in: Support powerpc *bsd.
12270         * mpn/powerpc64/elf.m4: New name for mpn/powerpc64/linux64.m4.
12271         * mpn/powerpc32/elf.m4: New name for mpn/powerpc32/linux.m4.
12273         * mpn/powerpc64/linux64.m4 (ASM_END): Quote TOC_ENTRY.
12275 2006-04-18  Torbjorn Granlund  <tege@swox.com>
12277         * configure.in (gmp_mpn_functions_optional): Add lshiftc.
12278         (HAVE_NATIVE): Add lshiftc.
12280         * mpn/powerpc64/mode64/invert_limb.asm: Use LEA, not LDSYM.
12281         * mpn/powerpc64/mode64/mode1o.asm: Likewise.
12282         * mpn/powerpc64/mode64/dive_1.asm: Likewise.
12284         * mpn/powerpc64/linux64.m4 (TOC_ENTRY): Define to empty.
12285         * mpn/powerpc64/aix.m4 (TOC_ENTRY): Likewise.
12286         * mpn/powerpc32/aix.m4 (TOC_ENTRY): Likewise.
12288         * mpn/powerpc32/aix.m4 (EXTERN): New, copied form powerpc64/aix.m4.
12289         * mpn/powerpc32/mode1o.asm: Use EXTERN.
12290         * mpn/powerpc32/linux.m4 (EXTERN): Provide dummy definition.
12291         * mpn/powerpc32/darwin.m4 (EXTERN): Likewise.
12293 2006-04-13  Torbjorn Granlund  <tege@swox.com>
12295         * mpn/generic/mul_fft.c: Use new thresholds mechanism if MUL_FFT_TABLE2
12296         is defined.
12297         (mpn_lshiftc): New name for mpn_lshift_com (for consistency with some
12298         stuff already in 4.1.4.
12299         (mpn_fft_mul_2exp_modF): Reorganize initial operand reductions to avoid
12300         divisions.
12302         * tests/devel/try.c (choice_array): Add mpn_addsub_n[c].
12304 2006-04-11  Torbjorn Granlund  <tege@swox.com>
12306         * aclocal.m4: Regenerate with patched libtool.
12308         * mpn/asm-defs.m4 (ASM_END): Provide (empty) default.
12310 2006-04-08  Torbjorn Granlund  <tege@swox.com>
12312         * configure.in (gmp_mpn_functions_optional): Add addsub.
12314         * gmpxx.h: Remove missed MPFR references.
12316         * gmp-impl.h (LIMBS_PER_DOUBLE): Adjust formula to not be pessimistic.
12318         * gmp-impl.h (TMP_*, WANT_TMP_DEBUG): Don't expect marker argument;
12319         define TMP_SALLOC and TMP_BALLOC.
12321         * mpn/minithres/gmp-mparam.h: New file.
12323         * tests/mpz/t-io_raw.c: Fix printf type/arg mismatches.
12324         * tests/mpz/t-export.c: Likewise.
12325         * tests/mpz/io.c: Likewise.
12326         * tests/t-constants.c: Likewise.
12328         * mpn/ia64/popcount.asm: Append "cond.dptk" to conditional branches to
12329         placate icc.
12330         * mpn/ia64/hamdist.asm: Likewise.
12331         * mpn/ia64/lorrshift.asm: Likewise.
12332         * mpn/ia64/dive_1.asm: Likewise.
12334 2006-04-05  Torbjorn Granlund  <tege@swox.com>
12336         * tal-notreent.c (__gmp_tmp_mark): Add "struct" tag for tmp_marker.
12337         (__gmp_tmp_free): Likewise.
12339         * mpn/generic/mul_fft.c: Optimize many scalar divisions and mod
12340         operations into masks and shifts.
12341         (mpn_fft_mul_modF_K): Fix a spurious ASSERT_NOCARRY.
12343 2006-03-26  Torbjorn Granlund  <tege@swox.com>
12345         * Version 4.2 released.
12347         * mpn/powerpc64/aix.m4 (LEA): Renamed from LDSYM.
12348         * mpn/powerpc64/darwin.m4: Likewise.
12349         * mpn/powerpc64/linux64.m4: Likewise.
12350         * mpn/powerpc64/vmx/popcount.asm: Use LEA, not LDSYM.
12352 2006-03-23  Torbjorn Granlund  <tege@swox.com>
12354         * gmp-impl.h: (class gmp_allocated_string): Prefix strlen with std::.
12356         * gmpxx.h (__GMP_DEFINE_TERNARY_EXPR2): Remove for now.
12357         (struct __gmp_ternary_addmul2): Likewise.
12358         (struct __gmp_ternary_submul2): Likewise.
12360         * gmpxx.h: #include <cstring>.
12361         (struct __gmp_alloc_cstring): Prefix strlen with std::.
12363         * mpn/x86/pentium/com_n.asm: Add TEXT and ALIGN.
12364         * mpn/x86/pentium/copyi.asm: Likewise.
12365         * mpn/x86/pentium/copyd.asm: Likewise.
12367 2006-03-22  Torbjorn Granlund  <tege@swox.com>
12369         * gmp-h.in: Add a "using std::FILE" for C++.
12370         (_GMP_H_HAVE_FILE): Check also _ISO_STDIO_ISO_H.
12372         * gmpxx.h: Remove mpfr code.
12373         * tests/cxx: Likewise.
12375         * gmp-impl.h (FORCE_DOUBLE): Rename a tempvar to avoid a clash with
12376         GNU/Linux public include file.
12378         * configure.in (powerpc64, darwin): New optional, gcc_cflags_subtype.
12379         Grab powerpc32/darwin.m4 for ABI=mode32.
12381         * configure.in: Use host_cpu whenever just the cpu type is needed.
12383 2006-03-08  Torbjorn Granlund  <tege@swox.com>
12385         * mpz/get_si.c: Fix a typo.
12387         * tests/mpq/t-get_d.c (check_random): Improve random generation for
12388         nails.
12390 2006-02-28  Torbjorn Granlund  <tege@swox.com>
12392         * tests/mpq/t-get_d.c (check_random): New function.
12393         (main): Call check_random.
12395         * mpq/set_d.c: Make choices based on LIMBS_PER_DOUBLE, not
12396         BITS_PER_MP_LIMB.  Make it work for LIMBS_PER_DOUBLE == 4.
12397         Use MPZ_REALLOC.
12399         * mpz/set_d.c: Make it work for LIMBS_PER_DOUBLE == 4.
12401         * extract-dbl.c: Make it work for LIMBS_PER_DOUBLE > 3.
12403 2006-02-27  Torbjorn Granlund  <tege@swox.com>
12405         * mpz/cmp_d.c: Declare `i'.
12406         * mpz/cmpabs_d.c: Likewise.
12408 2006-02-23  Torbjorn Granlund  <tege@swox.com>
12410         * mpn/powerpc32/vmx/copyd.asm: Set right VRSAVE bits.
12411         * mpn/powerpc32/vmx/copyi.asm: Likewise.
12413 2006-02-22  Torbjorn Granlund  <tege@swox.com>
12415         * mpn/powerpc32/vmx/logops_n.asm: New file.
12417         * mpn/powerpc32/diveby3.asm: Rewrite.
12419 2006-02-21  Torbjorn Granlund  <tege@swox.com>
12421         * mpn/powerpc32/vmx/copyi.asm: New file.
12422         * mpn/powerpc32/vmx/copyd.asm: New file.
12424 2006-02-17  Torbjorn Granlund  <tege@swox.com>
12426         * mpn/alpha/ev6/nails/aors_n.asm (CYSH): Import proper setting from
12427         deleted mpn_sub_n.
12429 2006-02-16  Torbjorn Granlund  <tege@swox.com>
12431         * mpn/alpha/ev6/addmul_1.asm: Correct slotting comments.
12433 2006-02-15  Torbjorn Granlund  <tege@swox.com>
12435         * tests/devel/anymul_1.c: Copy error reporting code from addmul_N.c.
12437         * tests/devel/addmul_N.c: New file.
12438         * tests/devel/mul_N.c: New file.
12440         * mpn/alpha/default.m4 (PROLOGUE_cpu): Align functions at 16-byte
12441         boundary.
12443         * mpn/alpha/ev6/nails/aors_n.asm: New file.
12444         * mpn/alpha/ev6/nails/add_n.asm: Remove.
12445         * mpn/alpha/ev6/nails/sub_n.asm: Remove.
12447         * mpn/alpha/ev6/nails/addmul_1.asm: Rewrite.
12448         * mpn/alpha/ev6/nails/submul_1.asm: Likewise.
12449         * mpn/alpha/ev6/nails/mul_1.asm: Likewise.
12451         * mpn/alpha/ev6/nails/addmul_2.asm: Use L() for labels.
12452         * mpn/alpha/ev6/nails/addmul_3.asm: Use L() for labels.
12453         * mpn/alpha/ev6/nails/addmul_4.asm: Use L() for labels.
12455 2006-02-13  Torbjorn Granlund  <tege@swox.com>
12457         * mpn/powerpc32/diveby3.asm: Trivially reorder loop insns to save
12458         1 c/l.
12460         * mpn/x86_64/dive_1.asm: Use movabsq to support large model non-PIC.
12462         * mpn/x86_64/rsh1add_n.asm: Replace high register with rbx.
12463         * mpn/x86_64/rsh1sub_n.asm: Likewise.
12465 2006-02-10  Torbjorn Granlund  <tege@swox.com>
12467         * mpn/powerpc64/sqr_diagonal.asm: Software pipeline.
12469         * mpn/powerpc64/vmx/popcount.asm: Add prefetching.
12471 2006-02-07  Torbjorn Granlund  <tege@swox.com>
12473         * mpn/powerpc64/mode64/diveby3.asm: Rewrite.
12475 2006-02-04  Torbjorn Granlund  <tege@swox.com>
12477         * mpn/powerpc64/vmx/popcount.asm: Remove mpn_hamdist partial code.
12478         Move compare for huge n so that it is always executed.
12480 2006-02-03  Torbjorn Granlund  <tege@swox.com>
12482         * mpn/powerpc32/linux.m4 (LEA): Add support for PIC.
12484         * configure.in (powerpc): New optional, gcc_cflags_subtype.
12486         * mpn/x86_64/pentium4/add_n.asm: New file.
12487         * mpn/x86_64/pentium4/sub_n.asm: New file.
12488         * mpn/x86_64/pentium4/lshift.asm: New file.
12490         * mpn/powerpc64/linux64.m4 (PROLOGUE_cpu): Align function start to
12491         16-multiple.
12492         * mpn/powerpc64/aix.m4: Likewise.
12493         * mpn/powerpc64/darwin.m4: Likewise.
12495         * mpn/powerpc64/copyi.asm: Align loop to 16-multiple.
12496         * mpn/powerpc64/copyd.asm: Likewise
12498         * configure.in (powerpc): Add vmx to relevant paths.
12500         * mpn/powerpc64/linux64.m4 (DEF_OBJECT): Accept 2nd argument, for
12501         alignment.
12502         * mpn/powerpc64/aix.m4: Likewise.
12503         * mpn/powerpc64/darwin.m4: Likewise.
12505         * mpn/powerpc32/linux.m4 (DEF_OBJECT, END_OBJECT): New macros,
12506         inherited from powerpc64 versions.
12507         * mpn/powerpc32/aix.m4: Likewise.
12508         * mpn/powerpc32/darwin.m4: Likewise.
12510         * mpn/powerpc64/vmx/popcount.asm: New file, for ppc32 and ppc64.
12511         * mpn/powerpc32/vmx/popcount.asm: New file, grabbing above file.
12513 2006-01-22  Torbjorn Granlund  <tege@swox.com>
12515         * configure.in: Generalize OS-dependent patterns for powerpcs.
12517 2006-01-20  Torbjorn Granlund  <tege@swox.com>
12519         * mpn/x86_64/popham.asm: Optimize.
12521         * config.guess: Recognize power4 and up under linux-gnu.
12522         * config.sub: Generalize power recognition code.
12523         * acinclude.m4 (POWERPC64_PATTERN): Add 64-bit powerpc processors.
12524         * configure.in: Recognize powerpc processors masquerading as power
12525         processors.
12527 2006-01-19  Torbjorn Granlund  <tege@swox.com>
12529         * mpn/x86_64/logops_n.asm: Rewrite for more stable speed and smaller
12530         code.
12531         * mpn/x86_64/com_n.asm: Likewise.
12533 2006-01-18  Torbjorn Granlund  <tege@swox.com>
12535         * mpn/x86_64/addlsh1_n.asm: Rewrite to use indexed addressing.
12536         * mpn/x86_64/sublsh1_n.asm: Likewise.
12538 2006-01-17  Torbjorn Granlund  <tege@swox.com>
12540         * mpn/generic/diveby3.c: Use GMP standard parameter names.  Nailify
12541         alternative code.  Use restrict for params.
12543         * configure.in: Recognize andn_n as not needing nailification.
12545         * tests/mpq/t-equal.c (check_various): Disable a test that gives common
12546         factors for GMP_NUMB_BITS == 62.
12548 2006-01-16  Torbjorn Granlund  <tege@swox.com>
12550         * mpn/generic/get_str.c (mpn_sb_get_str): Fix digit count computation,
12551         was inaccurate for nails.
12553 2006-01-15  Torbjorn Granlund  <tege@swox.com>
12555         * mpn/x86_64/mode1o.asm: Remove unneeded carry register zeroing.
12557 2006-01-08  Torbjorn Granlund  <tege@swox.com>
12559         * mpn/alpha/ev6/sqr_diagonal.asm: New file.
12561 2006-01-06  Torbjorn Granlund  <tege@swox.com>
12563         * mpn/powerpc64/mode64/mod_34lsub1.asm: Tune to 1.5 c/l.
12565         * mpn/generic/mullow_n.c (MUL_BASECASE_ALLOC): New #define.
12566         (mpn_mullow_n): Use it.
12568         * mpn/powerpc64/mode64/dive_1.asm: Use EXTERN.
12569         * mpn/powerpc64/mode64/mode1o.asm: Likewise.
12571         * mpn/powerpc64/aix.m4 (EXTERN): Define to import symbol.
12572         (LDSYM): Remove [RW] attribute.
12573         * mpn/powerpc64/linux64.m4 (EXTERN): Dummy definition.
12574         * mpn/powerpc64/darwin.m4 (EXTERN): Likewise.
12576 2006-01-05  Torbjorn Granlund  <tege@swox.com>
12578         * mpn/powerpc64/mode64/mode1o.asm: New file.
12580         * mpn/powerpc64/mode64/dive_1.asm: Use L() for labels.  Invoke ASM_END.
12582         * mpn/powerpc64/mode64/invert_limb.asm: Invoke ASM_END.
12584         * mpn/powerpc64/linux64.m4: Move toc entry generation from direct at
12585         DEF_OBJECT to delayed via LDSYM, define ASM_END to output it.
12586         * mpn/powerpc64/aix.m4: Likewise.
12587         * mpn/powerpc64/darwin.m4: Define a dummy ASM_END.
12589         * mpn/powerpc64/mode64/addmul_1.asm: Add POWER5 timings.
12590         * mpn/powerpc64/mode64/mul_1.asm: Likewise.
12592         * mpn/powerpc64/mode64/submul_1.asm: Tweak to save 1.5 c/l for POWER5.
12594 2006-01-04  Torbjorn Granlund  <tege@swox.com>
12596         * mpn/powerpc64/mode64/dive_1.asm: New file.
12598         * mpn/powerpc64/mode64/invert_limb.asm: Add missing ASM_START.
12600         * mpn/powerpc64/mode64/addmul_1.asm: Fix a comment typo.
12602         * mpn/x86_64/diveby3.asm: Rewrite.
12604 2006-01-03  Torbjorn Granlund  <tege@swox.com>
12606         * configure.in: Update bugs reporting address.
12608         * mpn/powerpc64/mode64/diveby3.asm: Trim a cycle off of POWER4 timing.
12609         Misc cleanup.
12611 2006-01-02  Torbjorn Granlund  <tege@swox.com>
12613         * mpn/powerpc64/linux64.m4 (CALL): New macro.
12614         * mpn/powerpc64/aix.m4: Likewise.
12615         * mpn/powerpc64/darwin.m4: Likewise, also define macro "DARWIN".
12617 2005-12-28  Torbjorn Granlund  <tege@swox.com>
12619         * mpn/powerpc64/mode64/mod_34lsub1.asm: New file.
12621 2005-12-26  Torbjorn Granlund  <tege@swox.com>
12623         * mpn/x86_64/mod_34lsub1.asm: New file.
12625 2005-12-20  Torbjorn Granlund  <tege@swox.com>
12627         * mpn/x86_64/submul_1.asm: Save a push/pop by not using register r12.
12628         Use addq instead of leaq for pointer updates; schedule them.  (These
12629         changes shaves one cycle of overhead and 0.25 c/l.)
12631 2005-12-18  Torbjorn Granlund  <tege@swox.com>
12633         * mpf/ui_div.c: Implement workaround for GCC bug triggered on alpha.
12634         * mpf/set_q.c: Likewise.
12636 2005-12-16  Torbjorn Granlund  <tege@swox.com>
12638         * mpn/generic/tdiv_qr.c: Remove statement with no effect.
12639         Rename dead variable to `dummy'.
12641 2005-12-15  Torbjorn Granlund  <tege@swox.com>
12643         * demos/pexpr.c (setup_error_handler): Add a missing ";".
12645 2005-11-27  Torbjorn Granlund  <tege@swox.com>
12647         * mpn/generic/mul.c: Crudely call mpn_mul_fft_full before checking
12648         for unbalanced operands.
12650         * mpn/generic/mul_fft.c: Remove many scalar divisions.
12651         (mpn_mul_fft_lcm): Simplify.
12652         (mpn_mul_fft_decompose): Rewrite to handle arbitrarily unbalanced
12653         operands.
12655 2005-11-22  Torbjorn Granlund  <tege@swox.com>
12657         * configure.in: Properly recognize all 32-bit Solaris releases.
12659 2005-11-10  Torbjorn Granlund  <tege@swox.com>
12661         * mpn/generic/mul_fft.c: Inline mpn_fft_mul_2exp_modF,
12662         mpn_fft_add_modF and mpn_fft_normalize.
12664 2005-11-02  Torbjorn Granlund  <tege@swox.com>
12666         * tests/mpz/reuse.c: Increase operand size, decrease # of reps.
12668         * mpz/rootrem.c: Adapt to new mpn_rootrem.
12669         * mpz/root.c: Likewise.
12671         * tests/mpz/reuse.c: Test mpz_rootrem.
12673         With Paul Zimmermann:
12674         * mpn/generic/rootrem.c: Complete rewrite.
12676 2005-10-31  Torbjorn Granlund  <tege@swox.com>
12678         * mpz/pprime_p.c (mpz_probab_prime_p): Considerably limit trial
12679         dividing.
12681         * mpz/perfpow.c (mpz_perfect_power_p): Use mpz_divisible_ui_p instead
12682         of mpz_tdiv_ui.
12684         * mpz/divegcd.c: Correct probability number for GCD == 1.
12686         * mpn/x86_64/mul_basecase.asm: Remove an obsolete comment.
12688         * mpn/x86: Add cycle counts for array of x86 processors.
12690         * mpn/x86/k7/mod_34lsub1.asm: Remove spurious mentions of ebp.
12692         * mpn/powerpc32: Add POWER5 timings.
12694         * mpn/powerpc32/README: Describe global reference variations.
12696         * mpn/ia64/divrem_2.asm: Add some comments.
12698         * mpn/ia64/divrem_1.asm: Reformat.
12700         * mpn/ia64/addmul_2.asm: Correct a comment on slotting.
12701         * mpn/ia64/logops_n.asm: Likewise.
12703         * mpn/ia64/addmul_1.asm: Remove a redundant preg mutex decl.
12705         * mpn/generic/dive_1.c: Whitespace cleanup.
12707         * mpn/alpha/ev6/nails/addmul_1.asm: Correct comments on slotting.
12708         * mpn/alpha/ev6/nails/addmul_2.asm: Likewise.
12709         * mpn/alpha/ev6/nails/addmul_4.asm: Likewise.
12711         * mpf/out_str.c: List some allocation improvement ideas.
12713         * doc/gmp.texi: Update many URLs and email addresses.
12715         * gmp-h.in (_GMP_H_HAVE_FILE): Check also _STDIO_H_INCLUDED.
12717 2005-10-26  Torbjorn Granlund  <tege@swox.com>
12719         * tune/tuneup.c (tune_mullow): Update param.max_size for each threshold
12720         measurement.
12722         * configure.in (POWERPC64_PATTERN/*-*-darwin*): Set
12723         SPEED_CYCLECOUNTER_OBJ_mode64 and cyclecounter_size_mode64.
12724         (POWERPC64_PATTERN/*-*-linux*): Likewise.
12726 2005-10-03  Torbjorn Granlund  <tege@swox.com>
12728         * demos/factorize.c (factor_using_division_2kp): Honor verbose flag.
12729         (factor_using_pollard_rho): Divide out new factor before it's
12730         clobbered.  Don't stop factoring after a composite factor was found.
12732 2005-09-17  Torbjorn Granlund  <tege@swox.com>
12734         * demos/pexpr.c (fns): Add factorial keywords.
12736 2005-08-16  Torbjorn Granlund  <tege@swox.com>
12738         * tune/Makefile.am (EXTRA_DIST): Change "amd64" => "x86_64".
12739         * mpn/Makefile.am (TARG_DIST): Change "amd64" => "x86_64".
12741 2005-08-15  Torbjorn Granlund  <tege@swox.com>
12743         * configure.in: Change "amd64" => "x86_64".
12745 2005-06-13  Torbjorn Granlund  <tege@swox.com>
12747         * mpn/generic/pre_mod_1.c: Canonicalize variable names.
12749         * mpn/generic/divrem.c: Rate qxn test as UNLIKELY.
12751         * mpn/generic/gcdext.c (sanity_check_row): Invoke TMP_MARK.
12753         * tune/tuneup.c (tune_mullow): Fix all max_size fields.
12755         * gmp-impl.h (SQR_TOOM3_THRESHOLD_LIMIT): New #define.
12756         * tune/tuneup.c (tune_sqr): Use SQR_TOOM3_THRESHOLD_LIMIT.
12757         (sqr_toom3_threshold): Initialize from SQR_TOOM3_THRESHOLD_LIMIT.
12759         * mpn/generic/mul_n.c (mpn_sqr_n): Use SQR_TOOM3_THRESHOLD_LIMIT.
12761         * gmp-impl.h (mpn_nand_n, mpn_iorn_n, mpn_nior_n, mpn_xnor_n):
12762         Handle nails.
12764 2005-06-13  Niels Möller  <nisse@lysator.liu.se>
12766         * mpn/generic/gcdext.c (gcdext_schoenhage): Check for the
12767         (unlikely) case that one of the hgcd/euclid steps results in two
12768         remainders of one limb each. Then use gcdext_1.
12770 2005-06-12  Torbjorn Granlund  <tege@swox.com>
12772         * mpn/alpha/ev6/sub_n.asm: Analogous changes as to add_n.asm last.
12774 2005-06-11  Torbjorn Granlund  <tege@swox.com>
12776         * mpn/alpha/ev6/add_n.asm: Rewrite inner loop to load later.
12777         Add mpn_add_nc entry.
12779         * mpn/alpha/ev6/addmul_1.asm: Remove redundant initial loads.
12781 2005-06-09  Torbjorn Granlund  <tege@swox.com>
12783         * mpn/ia64/dive_1.asm: Fix issues with HP-UX.
12785 2005-06-08  Torbjorn Granlund  <tege@swox.com>
12787         * mpn/ia64/diveby3.asm: Update TODO list.
12789         * mpn/ia64/mode1o.asm: Fix comment typos.
12791         * mpn/ia64/dive_1.asm: New file.
12793 2005-06-07  Torbjorn Granlund  <tege@swox.com>
12795         * mpn/ia64/mode1o.asm: Add prefetching.
12797         * mpn/generic/dive_1.c: Use variable h for upper umul_ppmm result.
12799 2005-06-06  Torbjorn Granlund  <tege@swox.com>
12801         * mpn/ia64/hamdist.asm: Complete rewrite.
12802         * mpn/ia64/popcount.asm: Rewrite to use multi-pronged feed-in.
12804         * mpn/ia64/aors_n.asm: Rewrite feed-in code.
12805         * mpn/ia64/rsh1aors_n.asm: Likewise.
12806         * mpn/ia64/aorslsh1_n.asm: Likewise.
12807         * mpn/ia64/lorrshift.asm: Likewise.
12809 2005-06-04  Torbjorn Granlund  <tege@swox.com>
12811         * tests/devel/try.c (choice_array): Exclude mpn_preinv_mod_1 unless
12812         USE_PREINV_MOD_1.
12813         (choice_array): Exclude mpn_sqr_basecase if SQR_KARATSUBA_THRESHOLD
12814         is zero.
12816 2005-06-03  Torbjorn Granlund  <tege@swox.com>
12818         * mpn/alpha/ev6/addmul_1.asm: Prefix all labels with "$".
12819         * mpn/alpha/ev6/mul_1.asm: Likewise.
12821 2005-06-02  Torbjorn Granlund  <tege@swox.com>
12823         * tests/refmpn.c (refmpn_divmod_1c_workaround): Implement workaround
12824         to gcc 3.4.x bug triggered on powerpc64 with 32-bit ABI.
12826 2005-06-01  Torbjorn Granlund  <tege@swox.com>
12828         * tests/devel/try.c (main): Fix a typo.
12830 2005-05-31  Torbjorn Granlund  <tege@swox.com>
12832         * mpn/alpha/ev6/addmul_1.asm: Rewrite for L1 cache, add prefetch.
12834 2005-05-30  Torbjorn Granlund  <tege@swox.com>
12836         * tests/misc.c (tests_rand_start): Mask random seed to 32 bits.
12838 2005-05-29  Torbjorn Granlund  <tege@swox.com>
12840         * mpn/powerpc64/mode32/mul_1.asm: Handle BROKEN_LONGLONG_PARAM.
12841         * mpn/powerpc64/mode32/addmul_1.asm: Likewise.
12842         * mpn/powerpc64/mode32/submul_1.asm: Likewise.
12844         * mpn/powerpc32/mode1o.asm: Rewrite to actually work.
12846         * mpn/powerpc32/aix.m4 (LEA): New macro.
12847         (ASM_END): New macro.
12849         * mpn/powerpc32/linux.m4: New file.
12850         * mpn/powerpc32/darwin.m4: New file.
12851         * configure.in: Use linux.m4 and darwin.m4.
12852         (powerpc64-linux-gnu): Add support for mode32.
12854 2005-05-25  Torbjorn Granlund  <tege@swox.com>
12856         * mpn/generic/mullow_n.c: Remove FIXME mentioning fixed flaw.
12858         * tests/mpz/t-cmp_d.c (check_one): Fix printf fmt string typo.
12860         * demos/isprime.c: #include stdlib.h.
12861         * tests/rand/t-urbui.c: Likewise.
12862         * tests/rand/t-urmui.c: Likewise.
12864         * tests/mpz/t-popcount.c (check_random): Remove spurious printf arg.
12866         * mpn/ia64/lorrshift.asm: Cleanup code layout.
12867         * mpn/ia64/popcount.asm: Likewise.
12869 2005-05-24  Torbjorn Granlund  <tege@swox.com>
12871         * tests/devel/try.c (param_init) [TYPE_GET_STR]: Set retval field.
12872         (compare): Handle SIZE_GET_STR as SIZE_RETVAL.
12874         * tests/refmpn.c (refmpn_get_str): Rewrite to make it work.
12876 2005-05-23  Torbjorn Granlund  <tege@swox.com>
12878         * mpn/amd64/add_n.asm: Add mpn_add_nc entry point.
12879         * mpn/amd64/sub_n.asm: Add mpn_sub_nc entry point.
12881         * longlong.h (many places): Remove lvalue casts.
12883         * gmp-impl.h (MPF_SIGNIFICANT_DIGITS): Cast prec to avoid overflow
12884         for > 4G digits.
12886         * mpn/alpha/ev6/add_n.asm: Prefetch using ldl.
12887         * mpn/alpha/ev6/sub_n.asm: Likewise.
12889         * mpn/alpha/ev6/slot.pl (optable): Recognize negq and ldl.
12891         * mpn/ia64/aors_n.asm: Prefetch using lfetch.
12892         * mpn/ia64/lorrshift.asm: Likewise.
12893         * mpn/ia64/popcount.asm: Likewise.
12894         * mpn/ia64/diveby3.asm: Likewise.
12896 2005-05-22  Torbjorn Granlund  <tege@swox.com>
12898         * mpn/alpha/ev67/popcount.asm: Prefetch.
12899         * mpn/alpha/ev67/hamdist.asm: Prefetch.
12901         * longlong.h (add_ssaaaa) [x86]: Remove lvalue casts.
12902         (sub_ddmmss) [x86]: Likewise.
12904         * tests/devel/try.c (param_init) [TYPE_MPZ_JACOBI]: Add DATA_SRC1_ODD.
12905         (param_init) [TYPE_MPZ_KRONECKER]: Clear inherited DATA_SRC1_ODD.
12906         (param_init) [TYPE_DIVEXACT_1]: Use symbolic name DIVISOR_LIMB.
12908 2005-05-21  Torbjorn Granlund  <tege@swox.com>
12910         * tests/devel/try.c (param_init) [TYPE_MPZ_JACOBI]: Initialize divisor
12911         field according to UDIV_NEEDS_NORMALIZATION.
12913         * mpz/mul_i.h: Remove left-over TMP_XXXX marker arguments.
12915 2005-05-20  Torbjorn Granlund  <tege@swox.com>
12917         * mpn/x86/pentium4/sse2/addmul_1.asm (mpn_addmul_1c): Put carry in
12918         proper register.
12920         * mpn/generic/sqr_basecase.c (mpn_sqr_basecase, addmul_2 version):
12921         Avoid accesses out-of-bound in MPN_SQR_DIAGONAL applicate code.
12923 2005-05-19  Torbjorn Granlund  <tege@swox.com>
12925         * mpn/alpha/diveby3.asm: Make it actually work.
12927         * gmp-impl.h (MULLOW_BASECASE_THRESHOLD_LIMIT): New #define.
12928         * mpn/generic/mullow_n.c: Use fixed stack allocation for the smallest
12929         operands; use TMP_S* allocation for medium operands.
12931         * gmp-impl.h: Remove nested TUNE_PROGRAM_BUILD test.
12933 2005-05-18  Torbjorn Granlund  <tege@swox.com>
12935         * mpn/generic/mul_n.c: Make squaring and multiplication code more
12936         similar.  Use TMP_S* functions.
12938         * gmp-impl.h (TMP_DECL, TMP_MARK, TMP_FREE): Get rid of argument.
12939         (TMP_SALLOC): New macro for "small" allocations.
12940         (TMP_BALLOC): New macro for "big" allocations.
12941         (TMP_SDECL, TMP_SMARK, TMP_SFREE): New macros for functions that use
12942         just TMP_SALLOC.
12943         (WANT_TMP_ALLOCA): Make default functions choose alloca or reentrant
12944         functions, depending on size.
12946         * *.c: Remove TMP_XXXX marker arguments.
12948         * acinclude.m4 (WANT_TMP): Want tal-reent.lo also for alloca case.
12950 2005-05-16  Torbjorn Granlund  <tege@swox.com>
12952         * mpn/ia64/gmp-mparam.h: Further extend FFT tables.
12954 2005-05-15  Torbjorn Granlund  <tege@swox.com>
12956         * gmp-impl.h (udiv_qrnnd_preinv2): Pull an add into add_ssaaaa.
12957         (udiv_qrnnd_preinv2gen): Likewise.
12959 2005-05-14  Torbjorn Granlund  <tege@swox.com>
12961         * longlong.h (add_ssaaaa) [x86_64]: Restrict allowed immediate
12962         operands.
12963         * (sub_ddmmss) [x86_64]: Likewise.
12965 2005-05-02  Torbjorn Granlund  <tege@swox.com>
12967         * acinclude.m4 (GMP_HPC_HPPA_2_0): Make gmp_tmp_v1 sed pattern handle
12968         version numbers like B.11.X.32509-32512.GP.
12970         * mpn/m68k/aors_n.asm: Correct MULFUNC_PROLOGUE.
12972         * mpn/powerpc64/mode64/aors_n.asm: Add a MULFUNC_PROLOGUE.
12974         * mpf/inp_str.c: Use plain int for mpf_set_str return value (works
12975         around gcc 4 bug).
12977         * acinclude.m4 (GMP_ASM_POWERPC_PIC_ALWAYS): Handle darwin's assembly
12978         syntax.
12979         (long long reliability test 1): New GMP_PROG_CC_WORKS_PART test.
12980         (long long reliability test 2): New GMP_PROG_CC_WORKS_PART test.
12982         * configure.in: Add mode64 support for darwin.  Use darwin.m4.
12983         Add cflags_opt flags for mode32 darwin.
12985         * mpn/powerpc64: Use L() for all asm files.
12987         * mpn/asm-defs.m4 (PIC_ALWAYS): Define PIC just iff PIC_ALWAYS = "yes".
12989         * mpn/powerpc64/darwin.m4: New file.
12991         * mpn/powerpc64/linux64.m4: Remove TOCREF, add LDSYM.
12992         Rework DEF_OBJECT to need just one argument.
12993         * mpn/powerpc64/aix.m4: Likewise.
12995         * mpn/powerpc64/mode64/invert_limb.asm: Load approx_tab address with
12996         LDSYM.  Optimize somewhat.  Remove 2nd DEF_OBJECT operand.
12998 2005-05-01  Torbjorn Granlund  <tege@swox.com>
13000         * mpn/generic/popham.c: Compute final summation differently for 64-bit.
13002         * tests/mpz/t-popcount.c (check_random): New function.
13003         (main): Call it.
13005 2005-04-28  Torbjorn Granlund  <tege@swox.com>
13007         * mpn/amd64/add_n.asm: Use r9 instead of rbx to save push/pop.
13008         * mpn/amd64/sub_n.asm: Likewise.
13010 2005-04-09  Torbjorn Granlund  <tege@swox.com>
13012         * mpn/powerpc64/copyi.asm: If HAVE_ABI_mode32, ignore upper 32 bits of
13013         mp_size_t argument.
13014         * mpn/powerpc64/copyd.asm: Likewise.
13015         * mpn/powerpc64/sqr_diagonal.asm: Likewise.
13016         * mpn/powerpc64/lshift.asm: Likewise.
13017         * mpn/powerpc64/rshift.asm: Likewise.
13018         * mpn/powerpc64/logops_n.asm: Likewise.
13019         * mpn/powerpc64/com_n.asm: Likewise.
13021 2005-04-08  Torbjorn Granlund  <tege@swox.com>
13023         * mpn/generic/rootrem.c: Allocate PP_ALLOC limbs also for qp.
13025 2005-04-07  Torbjorn Granlund  <tege@swox.com>
13027         * mpn/powerpc32/add_n.asm: Add nc entry point.
13028         * mpn/powerpc32/sub_n.asm: Likewise.
13030         * mpn/amd64/*.asm: Add Prescott/Nocona cycle/limb numbers.
13032         * mpn/alpha/add_n.asm: Add correct cycle/limb numbers.
13033         * mpn/alpha/sub_n.asm: Likewise.
13034         * mpn/alpha/ev5/add_n.asm: Likewise.
13035         * mpn/alpha/ev5/sub_n.asm: Likewise.
13037 2005-03-31  Torbjorn Granlund  <tege@swox.com>
13039         * mpn/x86/k7/gmp-mparam.h: Fix typo in last change.
13041 2005-03-19  Torbjorn Granlund  <tege@swox.com>
13043         * mpn/amd64/gmp-mparam.h: Update.
13045         * mpn/alpha/gmp-mparam.h: Update.
13046         * mpn/alpha/ev5/gmp-mparam.h: Update.
13047         * mpn/alpha/ev6/gmp-mparam.h: Update.
13049         * mpn/ia64/gmp-mparam.h: Update.
13051         * mpn/x86/p6/mmx/gmp-mparam.h: Update.
13052         * mpn/x86/pentium4/sse2/gmp-mparam.h: Update.
13053         * mpn/x86/k7/gmp-mparam.h: Update.
13055         * tests/mpz/t-gcd.c (main): Honor command line reps argument.
13057         * tune/speed.h (SPEED_ROUTINE_MPN_GCD_CALL): Simplify and correct code
13058         for generating test operands.
13060 2005-03-17  Niels Möller  <nisse@lysator.liu.se>
13062         * mpn/generic/hgcd.c (qstack_adjust): New argument d, saying how much
13063         to adjust the top quotient.
13064         (hgcd_adjust): The quotient can be off by either 1 or 2.
13066 2005-03-16  Torbjorn Granlund  <tege@swox.com>
13068         * tests/mpz/t-gcd.c (MAX_SCHOENHAGE_THRESHOLD): Set to largest of
13069         gcd,gcdext thresholds.
13071 2005-03-15  Niels Möller  <nisse@lysator.liu.se>
13073         * mpn/generic/gcdext.c (gcdext_schoenhage): When calling gcdext_lehmer,
13074         reuse all temporary limb storage, including the storage used for the
13075         qstack.
13077 2005-03-09  Torbjorn Granlund  <tege@swox.com>
13079         * mpn/amd64/logops_n.asm: Add MULFUNC_PROLOGUE.
13081 2005-03-05  Torbjorn Granlund  <tege@swox.com>
13083         * mpn/amd64/gmp-mparam.h: Extend MUL_FFT_TABLE and SQR_FFT_TABLE.
13084         * mpn/ia64/gmp-mparam.h: Likewise.
13086 2005-02-17  Torbjorn Granlund  <tege@swox.com>
13088         * mpn/ia64/divrem_1.asm: Add preinv entry point.
13090 2005-01-13  Torbjorn Granlund  <tege@swox.com>
13092         * gmp-impl.h (MPN_SIZEINBASE): Count bits in type size_t.
13093         (MPN_SIZEINBASE_16): Likewise.
13095 2004-12-17  Torbjorn Granlund  <tege@swox.com>
13097         * tune/speed.c (run_gnuplot): Use lines, not linespoints.
13098         Output a reset gnuplot command initially.
13100 2004-12-04  Torbjorn Granlund  <tege@swox.com>
13102         * mpn/generic/random2.c (gmp_rrandomb): Rework again.
13103         * mpz/rrandomb.c (gmp_rrandomb): Likewise.
13105         * mpn/amd64/redc_1.asm: Call via PLT when PIC.
13107 2004-11-29  Torbjorn Granlund  <tege@swox.com>
13109         * mpn/amd64/divrem_1.asm: Add preinv entry point.
13110         * mpn/amd64/gmp-mparam.h: Set USE_PREINV_DIVREM_1 to 1.
13112 2004-11-24  Torbjorn Granlund  <tege@swox.com>
13114         * mpn/alpha/diveby3.asm: Use correct prefetch instruction.
13116 2004-11-19  Torbjorn Granlund  <tege@swox.com>
13118         * mpn/alpha/diveby3.asm: Add ",gp" glue in PROLOGUE.
13119         Add r31 dummy operand to `br' instruction.
13121 2004-11-17  Torbjorn Granlund  <tege@swox.com>
13123         * mpn/powerpc64/mode64/addmul_1.asm: Rewrite.
13124         * mpn/powerpc64/mode64/mul_1.asm: Rewrite.
13126         * configure.in: Invoke AC_C_RESTRICT.
13128 2004-11-16  Torbjorn Granlund  <tege@swox.com>
13130         * mpn/alpha/diveby3.asm: New file.
13132 2004-11-13  Torbjorn Granlund  <tege@swox.com>
13134         * mpn/amd64/popham.asm: New file.
13136 2004-11-12  Torbjorn Granlund  <tege@swox.com>
13138         * mpn/amd64/add_n.asm: Correct cycle count.
13139         * mpn/amd64/sub_n.asm: Likewise.
13141         * mpn/amd64/dive_1.asm: Speed divisors with many factors of 2.
13143 2004-11-11  Torbjorn Granlund  <tege@swox.com>
13145         * mpn/amd64/dive_1.asm: New file.
13147 2004-11-10  Torbjorn Granlund  <tege@swox.com>
13149         * mpn/generic/popham.c: Add comment.
13151 2004-11-09  Torbjorn Granlund  <tege@swox.com>
13153         * mpn/amd64/com_n.asm: New file.
13155         * mpn/amd64/logops_n.asm: New file.
13157 2004-11-08  Torbjorn Granlund  <tege@swox.com>
13159         * mpn/powerpc64/com_n.asm: New file.
13161 2004-11-05  Torbjorn Granlund  <tege@swox.com>
13163         * mpn/amd64/diveby3.asm: New file.
13165         * config.guess: Strip any PPC string in /proc/cpuinfo.
13166         Recognize 970 in that code.
13168 2004-11-01  Torbjorn Granlund  <tege@swox.com>
13170         * mpn/amd64/mul_basecase.asm: New file.
13172         * mpn/amd64/redc_1.asm: New file.
13174 2004-10-25  Torbjorn Granlund  <tege@swox.com>
13176         * mpn/powerpc64/mode64/addlsh1_n.asm: Correct cycle counts.
13178         * mpn/powerpc64/README: Update POWER5/PPC970 pipeline information.
13180         * mpn/generic/mul_basecase.c (MAX_LEFT): Add comment.
13182         * doc/gmp.texi: Consistently use "x86" denotation.
13183         (Assembler SIMD Instructions): Mention SSE2 usage.
13185         * demos/pexpr.c (main): Handle "negative" base in mpz_sizeinbase call.
13187 2004-10-18  Torbjorn Granlund  <tege@swox.com>
13189         * mpn/powerpc64/mode64/submul_1.asm: Shave 2 cycles/limb with new carry
13190         inversion trick.
13192 2004-10-16  Torbjorn Granlund  <tege@swox.com>
13194         * configure.in: Support icc under x86.
13195         (ia64-*-linux*): Pass -no-gcc to icc.
13197 2004-10-15  Torbjorn Granlund  <tege@swox.com>
13199         * longlong.h (ia64 umul_ppmm): Add version for icc.
13201         * configure.in: Support icc under ia64-*-linux*.
13203         * acinclude.m4: New "compiler works" test for icc 8.1 bug.
13204         (GMP_PROG_CC_IS_GNU): Don't let Intel's icc fool us it is GCC.
13206 2004-10-14  Torbjorn Granlund  <tege@swox.com>
13208         * mpn/generic/gcdext.c: Add a few missing TMP_MARK.
13210 2004-10-14  Torbjorn Granlund  <tege@swox.com>
13212         * acinclude.m4 (GMP_ASM_W32): Try also "data4".
13214         * mpn/ia64/logops_n.asm: Don't use naked "br", rejected by Intel
13215         assembler.
13216         * mpn/ia64/aors_n.asm: Likewise.
13218         * mpn/ia64/divrem_2.asm: Add ".prologue".
13220         * mpn/ia64/hamdist.asm: Put alloc first in bundle, enforced by the
13221         Intel assembler.
13223         * longlong.h: Exclude masquerading __INTEL_COMPILER from ia64 asm.
13224         * gmp-impl.h: Likewise.
13226 2004-10-12  Torbjorn Granlund  <tege@swox.com>
13228         * mpn/ia64/mul_2.asm: Rewrite function entry code, write new code for
13229         n=2.
13230         * mpn/ia64/addmul_2.asm: Likewise.
13232         * tests/devel/try.c: Handle mpn_mul_2 like mpn_addmul_2.
13234         * tune/speed.c (routine): Make R parameter optional for mpn_mul_2.
13236 2004-10-11  Torbjorn Granlund  <tege@swox.com>
13238         * mpn/sparc64/addmul_1.asm: Update a comment.
13240         * tests/devel/aors_n.c: #include tests.h.
13241         * tests/devel/anymul_1.c: Likewise.
13242         * tests/devel/shift.c: Likewise.
13243         * tests/devel/copy.c: Likewise.
13245         * tests/devel/aors_n.c: Handle also mpn_addlsh1_n, mpn_sublsh1_n,
13246         mpn_rsh1add_n, and mpn_rsh1sub_n.
13248         * mpn/ia64/submul_1.asm: Add TODO item.
13250         * mpn/ia64/aors_n.asm: Rewrite function entry code (again).
13251         * mpn/ia64/aorslsh1_n.asm: Likewise.
13252         * mpn/ia64/logops_n.asm: Likewise.
13254         * mpn/ia64/rsh1aors_n.asm: Tune function entry and feed-in code.
13255         * mpn/ia64/lorrshift.asm: Likewise.  Remove several spurious loads.
13257         * tests/devel/Makefile.am (EXTRA_PROGRAMS): Updates for yesterday's
13258         file removals and additions.
13260 2004-10-10  Torbjorn Granlund  <tege@swox.com>
13262         * mpn/ia64/copyi.asm: Tune function entry code.
13263         * mpn/ia64/copyd.asm: Likewise.
13265         * mpn/ia64/logops_n.asm: Tune function entry and feed-in code for speed
13266         and size.
13267         * mpn/ia64/aors_n.asm: Likewise.
13269         * mpn/powerpc64/logops_n.asm: Correct cycles counts.
13270         * mpn/powerpc64/mode64/aors_n.asm: Likewise.
13272         * tests/devel/copy.c: Handle both MPN_COPY_INCR and MPN_COPY_DECR.
13274         * tests/devel/logops_n.c: New file, handle all logical operations.
13276         * tests/devel/anymul_1.c: New file, handle mpn_mul_1, mpn_addmul_1, and
13277         mpn_submul_1
13278         * tests/devel/mul_1.c: Remove.
13279         * tests/devel/addmul_1.c: Remove.
13280         * tests/devel/submul_1.c: Remove.
13282         * tests/devel/shift.c: New file, handle mpn_lshift and mpn_rshift.
13283         * tests/devel/lshift.c: Remove.
13284         * tests/devel/rshift.c: Remove.
13286         * tests/devel/aors_n.c: New file, handle mpn_add_n and mpn_sub_n.
13287         * tests/devel/add_n.c: Remove.
13288         * tests/devel/sub_n.c: Remove.
13290 2004-10-09  Torbjorn Granlund  <tege@swox.com>
13292         * mpn/powerpc64/linux64.m4: Define DEF_OBJECT, END_OBJECT, and TOCREF.
13293         * mpn/powerpc64/aix.m4: Likewise.
13294         * mpn/powerpc64/mode64/invert_limb.asm: Use DEF_OBJECT, END_OBJECT, and
13295         TOCREF for approx_tab.
13297         * mpn/amd64/mul_1.asm: Add mpn_mul_1c entry point.
13299 2004-10-08  Torbjorn Granlund  <tege@swox.com>
13301         * mpn/powerpc64/copyi.asm: New file.
13302         * mpn/powerpc64/copyd.asm: New file.
13303         * gmp-h.in: Remove PPC MPN_COPY variants.
13304         * gmp-impl.h: Likewise.
13306         * mpn/powerpc64/logops_n.asm: New file.
13308         * mpn/powerpc64/mode64/invert_limb.asm: New file.
13310 2004-10-07  Torbjorn Granlund  <tege@swox.com>
13312         * mpn/powerpc64/mode64/aors_n.asm: New file, optimized for POWER4 and
13313         its derivatives.
13314         * mpn/powerpc64/mode64/add_n.asm: Delete.
13315         * mpn/powerpc64/mode64/sub_n.asm: Delete.
13317         * configfsf.guess: Patch HP-UX code to accommodate HP compiler's new
13318         inability to read from stdin.
13320         * mpn/powerpc64/mode64/addsub_n.asm: Remove accidentally added file.
13322 2004-10-02  Torbjorn Granlund  <tege@swox.com>
13324         * mpn/amd64/README: Update for new developments, fix typos.
13326         * mpn/amd64/mul_1.asm: Tweak addressing (3.25 => 3.0 cycles/limb).
13328         * mpn/amd64/addmul_1.asm: Remove unreachable code block.
13330 2004-09-30  Torbjorn Granlund  <tege@swox.com>
13332         * mpn/amd64/addmul_1.asm: Rewrite, now 3.25 cycles/limb.
13334         * mpn/ia64/addmul_1.asm: Slightly enhance cross-jumping for code
13335         density.
13336         * mpn/ia64/mul_1.asm: Analogous changes.
13338 2004-09-29  Torbjorn Granlund  <tege@swox.com>
13340         * gmp-impl.h (x86 ULONG_PARITY): Work around GCC change of "q" register
13341         flag.
13343 2004-09-28  Torbjorn Granlund  <tege@swox.com>
13345         * mpn/ia64/divrem_1.asm: Add cycle counts to loop.
13347         * mpn/ia64/divrem_2.asm: New file.
13349 2004-09-28  Paul Zimmermann  <Paul.Zimmermann@loria.fr>
13351         * mpn/generic/mul_fft.c (mpn_mul_fft): Fix a bug in the choice of the
13352         recursive fft parameters.
13354 2004-09-20  Torbjorn Granlund  <tege@swox.com>
13356         * tests/misc.c (tests_rand_start): Default to strtoul for re-seeding.
13358         * tests/mpz/t-mul.c (ref_mpn_mul): Fudge tmp allocation for toom3.
13360 2004-09-19  Torbjorn Granlund  <tege@swox.com>
13362         * tests/misc.c (tests_rand_start): Shift tv_usec for better seeding.
13364 2004-09-18  Torbjorn Granlund  <tege@swox.com>
13366         * tests/misc.c (tests_rand_start): Invoke fflush after printing seed.
13368         * tests/mpz/t-mul.c (main): Check environment for GMP_CHECK_FFT, run
13369         extra FFT tests if set.
13370         (ref_mpn_mul): Use library code for kara and toom, but skewded so that
13371         we never use the same algorithm that we're testing.
13372         (mul_kara): Delete.
13373         (debug_mp): Print just one line of large numbers.
13374         (ref_mpn_mul): Rework usage of tp temporary space.
13376 2004-09-15  Torbjorn Granlund  <tege@swox.com>
13378         * mpn/ia64/mul_2.asm: For HAVE_ABI_32, convert vp.
13379         * mpn/ia64/addmul_2.asm: Likewise.
13381 2004-09-13  Torbjorn Granlund  <tege@swox.com>
13383         * mpn/ia64/invert_limb.asm: Rewrite.
13385         * mpn/ia64/logops_n.asm: Insert some more stops.
13387 2004-09-12  Torbjorn Granlund  <tege@swox.com>
13389         * mpn/ia64/gmp-mparam.h: Update.
13390         * mpn/amd64/gmp-mparam.h: Update.
13392         * mpn/ia64/sqr_diagonal.asm: Shave off a few cycles.
13394 2004-09-11  Torbjorn Granlund  <tege@swox.com>
13396         * mpn/ia64/mul_2.asm: New file.
13397         * mpn/ia64/addmul_2.asm: New file.
13399         * mpn/ia64/addmul_1.asm: Tune a cycle from prologue.
13401         * mpn/ia64/lorrshift.asm: Insert stops after several branches.
13402         * mpn/ia64/aorslsh1_n.asm: Likewise.
13403         * mpn/ia64/rsh1aors_n.asm: Likewise.
13405         * mpn/generic/sqr_basecase.c: In variant for HAVE_NATIVE_mpn_addmul_2,
13406         accumulate carry also for when HAVE_NATIVE_mpn_addlsh1_n.
13408 2004-09-07  Torbjorn Granlund  <tege@swox.com>
13410         * mpn/ia64/submul_1.asm: Rewrite.
13412         * mpn/ia64/addmul_1.asm: Format to placate HP-UX assembler.
13413         * mpn/ia64/mul_1.asm: Likewise.
13415 2004-09-02  Torbjorn Granlund  <tege@swox.com>
13417         * mpn/ia64/mul_1.asm: Optimize feed-in code.
13418         * mpn/ia64/addmul_1.asm: Rewrite feed-in code.
13420 2004-08-29  Torbjorn Granlund  <tege@swox.com>
13422         * tests/mpz/t-sizeinbase.c: Disable mpz_fake_bits and check_sample.
13424 2004-07-16  Torbjorn Granlund  <tege@swox.com>
13426         * mpn/ia64/addmul_1.asm: Format to placate HP-UX assembler.
13428 2004-06-17  Kevin Ryde  <kevin@swox.se>
13430         * doc/gmp.texi: Use @. when sentence ends with a capital, for good
13431         spacing in tex.
13432         (Language Bindings): Add gmp-d, reported by Ben Hinkle.  Update SWI
13433         Prolog URL, reported by Jan Wielemaker.
13435 2004-06-09  Torbjorn Granlund  <tege@swox.com>
13437         * configure.in: Handle --enable-fat.  Use that to enable x86 fat
13438         builds, remove magic meaning of i386-*-*.
13440 2004-06-03  Kevin Ryde  <kevin@swox.se>
13442         * gmp-impl.h (memset): Use a local char* pointer, in case parameter is
13443         something else (eg. tune/common.c).  Reported by Emmanuel Thomé.
13445 2004-06-01  Kevin Ryde  <kevin@swox.se>
13447         * config.guess (i?86-*-*): Avoid "Illegal instruction" message which
13448         goes to stdout on 80386 freebsd4.9.
13450 2004-05-23  Niels Möller  <nisse@lysator.liu.se>
13452         * mpn/generic/gcdext.c (gcdext_1_u): New function.
13453         (mpn_gcdext): Use it.
13455 2004-05-23  Torbjorn Granlund  <tege@swox.com>
13457         * mpn/generic/gcdext.c (gcdext_1_odd): Use masking to avoid jumps.
13459 2004-05-22  Torbjorn Granlund  <tege@swox.com>
13461         * mpn/x86/pentium4/sse2/addmul_1.asm: Add Prescott cycle numbers.
13463         * mpn/amd64/divrem_1.asm: Shave a cycle from fraction development code.
13465         * mpn/powerpc32/lshift.asm: Add more cycle numbers.
13466         * mpn/powerpc32/rshift.asm: Likewise.
13468         * mpn/ia64/addmul_1.asm: Reformat.
13470 2004-05-21  Torbjorn Granlund  <tege@swox.com>
13472         * gmp-impl.h (mpn_mullow_n, mpn_mullow_basecase): Declare.
13474         * tune/Makefile.am: Compile gcdext.c.
13476         * gmp-impl.h (GET_STR_THRESHOLD_LIMIT): Lower outrageous value to 150.
13477         (GCDEXT_SCHOENHAGE_THRESHOLD): Set reasonable default.  Override when
13478         TUNE_PROGRAM_BUILD.
13479         (GCDEXT_THRESHOLD): Remove.
13481         * tune/tuneup.c (gcdext_schoenhage_threshold): New variable.
13482         (gcdext_threshold): Remove variable.
13483         (tune_gcd_schoenhage): Lower step_factor to 0.1.
13484         (tune_gcdext_schoenhage): New function, based on tune_gcd_schoenhage.
13485         (tune_gcdext): Remove function.
13486         (all): Corresponding changes.
13488 2004-05-21  Niels Möller  <nisse@lysator.liu.se>
13490         * mpn/generic/gcdext.c: Complete rewrite.  Uses fast Lehmer code for
13491         small operands, and Schoenhage code for large operands.
13493         * tune/speed.h (SPEED_ROUTINE_MPN_GCD_CALL): Ensure first operand is
13494         not smaller than 2nd operand.
13496 2004-05-17  Kevin Ryde  <kevin@swox.se>
13498         * gmp-h.in (mpz_get_ui): Use #if instead of plain if, and for nails
13499         use ?: same as normal case, to avoid warnings from Borland C++ 6.0.
13500         Reported by delta trinity.
13502 2004-05-15  Kevin Ryde  <kevin@swox.se>
13504         * tune/time.c (getrusage_backwards_p): New function
13505         (speed_time_init): Use it to exclude broken netbsd1.4.1 getrusage.
13506         * configure.in (m68*-*-netbsd1.4*): Remove code pretending getrusage
13507         doesn't exist.
13508         * tune/README (NetBSD 1.4.1 m68k): Update notes.
13510         * configure.in (mips*-*-* ABI=n32): Remove gcc_n32_ldflags and
13511         cc_n32_ldflags, libtool knows to put the linker in n32 mode.
13513 2004-05-15  Torbjorn Granlund  <tege@swox.com>
13515         * config.guess (powerpc*-*-*): Add more processor types to mfpvr code.
13516         * configure.in: Generalize powerpc subtype matching code.
13518         * mpz/fac_ui.c: Misc cleanups, spelling corrections.
13520 2004-05-14  Kevin Ryde  <kevin@swox.se>
13522         * mpf/sub.c: When one operand cancels high limbs of the other, strip
13523         high zeros on the balance before truncating to destination precision.
13524         Truncating first loses accuracy and can lead to a result 0 despite
13525         operands being not equal.  Reported by John Abbott.
13526         Also, ensure exponent is zero when result is zero, for instance if
13527         operands are exactly equal.
13528         * tests/mpf/t-sub.c (check_data): New function, exercising these.
13530 2004-05-12  Kevin Ryde  <kevin@swox.se>
13532         * configure.in (AC_PROG_RANLIB): New macro, supposedly required by
13533         automake, though it doesn't complain.
13535         * demos/expr/Makefile.am (ARFLAGS): Add a default setting, to
13536         workaround an automake bug.
13538 2004-05-10  Kevin Ryde  <kevin@swox.se>
13540         * */Makefile.in, install-sh, aclocal.m4: Update to automake 1.8.4.
13542         * doc/gmp.texi (Demonstration Programs): Add a remark about expression
13543         evaluation in the main gmp library.
13545         * demos/expr/exprfa.c (mpf_expr_a): Correction to mpX_init, use
13546         mpf_init2 to follow requested precision.
13547         * demos/expr/exprza.c, demos/expr/exprqa.c: Use wrappers for mpX_init,
13548         to make parameters match.
13550         * demos/expr/run-expr.c: Don't use getopt, to avoid needing configury
13551         for optarg declaration.  Remove TRY macro, rename foo and bar to var_a
13552         and var_b, for clarity.
13553         * demos/expr/expr-impl.h: Don't use expr-config.h.
13554         * configure.in (demos/expr/expr-config.h): Remove.
13555         * demos/expr/expr-config.in: Remove file.
13557 2004-05-08  Kevin Ryde  <kevin@swox.se>
13559         * doc/configuration (Configure): Update for current automake not
13560         copying acinclude.m4 into aclocal.m4.
13562         * configure.in, Makefile.am, doc/gmp.texi, doc/configuration,
13563         tests/cxx/Makefile.am, demos/expr/Makefile.am, demos/expr/README,
13564         demos/expr/expr.c, demos/expr/expr.h, demos/expr/expr-config-h.in,
13565         demos/expr/expr-impl.h, demos/expr/run-expr.c, demos/expr/t-expr.c:
13566         MPFR now published separately, remove various bits.
13567         * mpfr/*, tests/cxx/t-headfr.cc, demos/expr/exprfr.c,
13568         demos/expr/exprfra.c: Remove.
13570 2004-05-07  Kevin Ryde  <kevin@swox.se>
13572         * tests/cxx/Makefile.am (TESTS_ENVIRONMENT): Amend c++ shared library
13573         path hack, on k62-unknown-dragonfly1.0 /usr/bin/make runs its commands
13574         "set -e", so we need an "|| true" in case there's nothing to copy (for
13575         instance in a static build).
13577 2004-05-06  Kevin Ryde  <kevin@swox.se>
13579         * mpn/alpha/mode1o.c: Remove, in favour of ...
13580         * mpn/alpha/mode1o.asm: New file.
13581         * mpn/alpha/alpha-defs.m4 (bwx_available_p): New macro.
13583         * tune/amd64.asm: Save rbx in r10 rather than on the stack.
13585         * configure.in (x86_64-*-*): Try also "-march=k8 -mno-sse2", in case
13586         we're in ABI=32 on an old OS not supporting xmm regs.
13587         (GMP_GCC_PENTIUM4_SSE2, GMP_OS_X86_XMM): Run these tests under
13588         -march=k8 too, and not under ABI=64.
13590         * doc/gmp.texi (Converting Integers): For mpz_get_d, note truncation
13591         and overflows.  For mpz_get_d_2exp note truncation, note result if
13592         OP==0, and cross reference libc frexp.
13593         (Rational Conversions): For mpq_get_d, note truncation and overflows.
13594         (Converting Floats): For mpf_get_d, note truncation and overflows.
13595         For mpf_get_d_2exp, note truncation, note result if OP==0.
13596         (Assembler Code Organisation): Note nails subdirectories.
13597         Clarification of get_d_2exp OP==0 reported by Sylvain Pion.
13599 2004-05-05  Torbjorn Granlund  <tege@swox.com>
13601         * mpn/generic/mullow_n.c, mpn/generic/mullow_basecase.c: New files
13602         (mainly by Niels Möller).
13603         * configure.in, mpn/Makefile.am: Add them.
13605         * gmp-impl.h (MULLOW_BASECASE_THRESHOLD, MULLOW_DC_THRESHOLD,
13606         MULLOW_MUL_N_THRESHOLD): Override for TUNE_PROGRAM_BUILD.
13608         * tune/Makefile.am: Compile mullow_n.c.
13609         * tune/common.c (speed_mpn_mullow_n, speed_mpn_mullow_basecase):
13610         New functions.
13611         * tune/speed.c (routine): Add entries for mpn_mullow_n and
13612         mpn_mullow_basecase.
13613         * tune/speed.h (SPEED_ROUTINE_MPN_MULLOW_N_CALL,
13614         SPEED_ROUTINE_MPN_MULLOW_BASECASE): New #defines.
13615         * tune/tuneup.c (tune_mullow): New function.
13617         * gmp-impl.h (invert_limb): Compute branch-freely.
13619 2004-05-02  Kevin Ryde  <kevin@swox.se>
13621         * mpn/amd64/mode1o.asm: Use movabsq to support large model non-PIC.
13622         Use 32-bit insns to save code bytes, and to save a couple of cycles on
13623         the initial setup multiplies.
13625 2004-05-01  Kevin Ryde  <kevin@swox.se>
13627         * doc/gmp.texi (References): Update gcc online docs url to
13628         gcc.gnu.org.
13630         * configure.in (mips*-*-irix[6789]*): Correction to m4 quoting of this
13631         pattern.  (Believe the mips64*-*-* part also used picks up all current
13632         irix6 tuples anyway.)  Reported by Rainer Orth.
13634 2004-04-30  Kevin Ryde  <kevin@swox.se>
13636         * acinclude.m4 (GMP_PROG_CC_X86_GOT_EAX_EMITTED,
13637         GMP_ASM_X86_GOT_EAX_OK): New macros.
13638         (GMP_PROG_CC_WORKS): Use them to detect an old gas bug tickled by
13639         recent gcc.  Reported by David Newman.
13641         * doc/gmp.texi (Reentrancy): Note also gmp_randinit_default as an
13642         alternative to gmp_randinit.
13644 2004-04-29  Torbjorn Granlund  <tege@swox.com>
13646         * configfsf.guess: Update to 2004-03-12.
13647         * configfsf.sub: Likewise.
13649 2004-04-27  Torbjorn Granlund  <tege@swox.com>
13651         * mpz/rrandomb.c (gmp_rrandomb): Rework to avoid extra limb allocation
13652         and to generate even numbers.
13653         * mpn/generic/random2.c (gmp_rrandomb): Likewise.
13655 2004-04-25  Kevin Ryde  <kevin@swox.se>
13657         * gmp-impl.h (FORCE_DOUBLE): Don't use an asm with a match constraint
13658         on a memory output, apparently not supported and provokes a warning
13659         from gcc 3.4.
13661 2004-04-24  Kevin Ryde  <kevin@swox.se>
13663         * longlong.h (count_leading_zeros_gcc_clz,
13664         count_trailing_zeros_gcc_ctz): New macros.
13665         (count_leading_zeros, count_trailing_zeros) [x86]: Use them on gcc
13666         3.4.
13668         * configure.in (x86-*-* gcc_cflags_cpu): Give a -mtune at the start of
13669         each option list, for use by gcc 3.4 to avoid deprecation warnings
13670         about -mcpu.
13672         * mpz/aorsmul.c, mpz/aorsmul_i.c, mpz/cfdiv_q_2exp.c,
13673         mpz/cfdiv_r_2exp.c, mpq/aors.c, mpf/ceilfloor.c: Give REGPARM_ATTR()
13674         on function definition too, as demanded by gcc 3.4.
13676 2004-04-22  Kevin Ryde  <kevin@swox.se>
13678         * tests/rand/t-lc2exp.c (check_bigc1): New test.
13680         * doc/fdl.texi: Tweak @appendixsubsec -> @appendixsec to match our
13681         preference for this in an @appendix, and because texi2pdf doesn't
13682         support @appendixsubsec directly within an @appendix.
13684 2004-04-20  Kevin Ryde  <kevin@swox.se>
13686         * doc/texinfo.tex: Update to 2004-04-07.08 from texinfo 4.7.
13687         * doc/gmp.texi, mpfr/mpfr.texi (@copying): Don't put a line break in
13688         @ref within @copying, recent texinfo.tex doesn't like that.
13690         * demos/perl/GMP.xs (static_functable): Treat cygwin the same as mingw
13691         DLLs.
13693         * */Makefile.in, install-sh: Update to automake 1.8.3.
13694         * ltmain.sh, aclocal.m4, configure: Update to libtool 1.5.6.
13696         * gmp-impl.h (LIMB_HIGHBIT_TO_MASK): Use a compile-time constant
13697         expression, rather than a configure test.
13698         * acinclude.m4, configure.in (GMP_C_RIGHT_SHIFT): Remove, no longer
13699         needed.
13700         * tests/t-hightomask.c: New file.
13701         * tests/Makefile.am (check_PROGRAMS): Add it.
13703         * macos/configure (parse_top_configure): Look for PACKAGE_NAME and
13704         PACKAGE_VERSION now used by autoconf.
13705         (what_objects): Only demand 9 object files, as for instance occurs in
13706         the scanf directory.
13707         (asm files): Transform labels L(foo) -> Lfoo.  Take func name from
13708         PROLOGUE to support empty "EPILOGUE()".  Recognise and substitute
13709         register name "define()"s.
13710         * macos/Makefile.in (CmnObjs): Add tal-notreent.o.
13712 2004-04-19  Torbjorn Granlund  <tege@swox.com>
13714         * tune/speed.h (SPEED_ROUTINE_MPN_ROOTREM): New #define.
13715         (speed_mpn_rootrem): Declare.
13716         * tune/common.c (speed_mpn_rootrem): New function.
13717         * tune/speed.c (routine): Add entry for mpn_rootrem.
13719 2004-04-16  Kevin Ryde  <kevin@swox.se>
13721         * doc/fdl.texi: Update from FSF, just fixing a couple of typos.
13723         * macos/configure, macos/Makefile.in: Add printf and scanf directories.
13725         * tests/mpz/t-gcd.c (check_data): New function, exercising K6
13726         gcd_finda bug.
13728 2004-04-14  Kevin Ryde  <kevin@swox.se>
13730         * doc/gmp.texi (Reentrancy, Random State Initialization): Note
13731         gmp_randinit use of gmp_errno is not thread safe.  Reported by Vincent
13732         Lefèvre.
13734         * doc/gmp.texi (Random State Initialization): Add index entries for
13735         gmp_errno and constants.
13737         * mpn/m68k/README: Update _SHORT_LIMB -> __GMP_SHORT_LIMB.
13739         * configure.in (--enable-mpbsd): Typo Berkley -> Berkeley in help msg.
13741 2004-04-12  Kevin Ryde  <kevin@swox.se>
13743         * demos/perl/GMP.xs (static_functable): New macro, use it for all
13744         function tables, to support mingw DLL builds.
13745         * demos/perl/INSTALL (NOTES FOR PARTICULAR SYSTEMS): Remove note on
13746         DLLs, should be ok now.
13748         * demos/perl/sample.pl: Print the module and library versions in use.
13750         * demos/perl/GMP.pm, Makefile.PL (VERSION): Set to '2.00'.
13751         * demos/perl/GMP.pm (COPYRIGHT): New in the doc section.
13753         * Makefile.am: Note 4.1.3 libtool versioning info, and REVISION policy.
13755         * tal-debug.c: Add <stdlib.h> for abort.
13757 2004-04-07  Torbjorn Granlund  <tege@swox.com>
13759         * tests/refmpf.c (refmpf_add_ulp): Adjust exponent when needed.
13761         * mpn/generic/random2.c: Rewrite (clone mpz/rrandomb.c).
13763 2004-04-07  Kevin Ryde  <kevin@swox.se>
13765         * mpn/x86/k6/gcd_finda.asm: Correction jbe -> jb in initial setups.
13766         Zero flag is wrong here, it relects only the high limb of the compare,
13767         leading to n1>=n2 not satisfied and wrong results.  cp[1]==0x7FFFFFFF
13768         with cp[0]>=0x80000001 provokes this.
13770         * doc/gmp.texi (BSD Compatible Functions): Note "pow" name clash under
13771         the pow function description too.
13772         (Language Bindings): Add XEmacs (betas at this stage).  Reported by
13773         Jerry James.
13775         * tests/refmpn.c (refmpn_mod2): Correction to ASSERTs, r==a is allowed.
13777         * gen-psqr.c (generate_mod): Cast mpz_invert_ui_2exp args, for K&R.
13778         * gen-bases.c, gen-fib.c, gen-psqr.c: For mpz_out_str, use stdout
13779         instead of 0, in case a K&R treats int and FILE* params differently.
13781 2004-04-04  Kevin Ryde  <kevin@swox.se>
13783         * gmp-impl.h (BSWAP_LIMB) [amd64]: New macro.
13784         (FORCE_DOUBLE): Use this for amd64 too.
13786         * tests/amd64check.c, tests/amd64call.asm: New files, derived in part
13787         from x86check.c and x86call.asm.
13788         * tests/Makefile.am (EXTRA_libtests_la_SOURCES): Add them.
13789         * configure.in (x86_64-*-* ABI=64): Use them.
13791 2004-04-03  Kevin Ryde  <kevin@swox.se>
13793         * mpn/amd64/mode1o.asm: New file.
13794         * mpn/amd64/amd64-defs.m4 (ASSERT): New macro.
13796         * mpn/x86/k7/mmx/divrem_1.asm, mpn/x86/pentium4/sse2/divrem_1.asm: Add
13797         note on how "dr" part of algorithm is handled.
13799         * mpn/x86/k7/dive_1.asm, mpn/x86/k7/mod_34lsub1.asm,
13800         mpn/x86/k7/mode1o.asm: Note Hammer (32-bit mode) speeds.
13802 2004-03-31  Kevin Ryde  <kevin@swox.se>
13804         * doc/gmp.texi (Language Bindings): Add GOO, MLGMP and Numerix.
13806         * mpf/mul_2exp.c, mpf/div_2exp.c: Rate u==0 as UNLIKELY.
13808 2004-03-28  Torbjorn Granlund  <tege@swox.com>
13810         * mpn/amd64/divrem_1.asm: Trim a few cycles.
13812 2004-03-27  Torbjorn Granlund  <tege@swox.com>
13814         * mpn/amd64/sublsh1_n.asm: Fix typo.
13816         * mpn/generic/divrem_1.c: Fix typo.
13818         * mpn/generic/sqr_basecase.c: Fix typo.
13820         * mpn/amd64/divrem_1.asm: New file.
13822 2004-03-20  Kevin Ryde  <kevin@swox.se>
13824         * longlong.h (power, powerpc): Add comments on how we select this code.
13826         * gmp-h.in (mpz_get_ui): Use ?: instead of mask style, gcc treats the
13827         two identically but ?: is a bit clearer.
13829         * insert-dbl.c: Remove file, no longer used, scaling is now integrated
13830         in mpn_get_d.
13831         * Makefile.am (libgmp_la_SOURCES): Remove insert-dbl.c.
13832         * gmp-impl.h (__gmp_scale2): Remove prototype.
13834 2004-03-17  Kevin Ryde  <kevin@swox.se>
13836         * mpn/x86/fat/fat.c (__gmpn_cpuvec_init, fake_cpuid_table): Add x86_64.
13838         * mpq/get_d.c: Use mpn_tdiv_qr, demand den>0 per canonical form.
13840 2004-03-16  Torbjorn Granlund  <tege@swox.com>
13842         * mpn/generic/sqr_basecase.c: Add versions using mpn_addmul_2 and
13843         mpn_addmul_2s.
13845 2004-03-14  Kevin Ryde  <kevin@swox.se>
13847         * mpf/mul_ui.c: Incorporate carry from low limbs, for exactness.
13848         * tests/mpf/t-mul_ui.c: New file.
13849         * tests/mpf/Makefile.am (check_PROGRAMS): Add it.
13851         * mpf/div.c: Use mpn_tdiv_qr.  Use just one TMP_ALLOC.  Use full
13852         divisor, since truncating can lose accuracy.
13853         * tests/mpf/t-div.c: New file.
13854         * tests/mpf/Makefile.am (check_PROGRAMS): Add it.
13856         * tests/mpf/t-set_q.c, tests/mpf/t-ui_div.c (check_various): Amend
13857         bogus 99/4 test.
13858         * tests/mpf/t-ui_div.c (check_rand): Exercise r==v overlap.
13860         * tests/refmpf.c, tests/tests.h (refmpf_set_overlap): New function.
13862         * mpf/cmp_si.c [nails]: Correction, cast vval in exp comparisons, for
13863         when vval=-0x800..00 and limb==longlong.
13865         * mpf/cmp_si.c [nails]: Correction, return usign instead of 1 when
13866         uexp==2 but value bigger than an mp_limb_t.
13867         * tests/mpf/t-cmp_si.c (check_data): Add test cases.
13869         * tests/trace.c (mpf_trace): Use ABS(mp_trace_base) to allow for
13870         negative bases used for upper case hex in integer traces.
13872 2004-03-12  Torbjorn Granlund  <tege@swox.com>
13874         * mpn/generic/sb_divrem_mn.c: Correct header comment.
13876 2004-03-11  Kevin Ryde  <kevin@swox.se>
13878         * aclocal.m4, configure, ltmain.sh: Downgrade to libtool 1.5, version
13879         1.5.2 doesn't remove .libs/*.a files when rebuilding, which is bad for
13880         development when changing contents or with duplicate named files like
13881         we have.
13883         Revert this, ie restore AR_FLAGS=cq:
13884         * acinclude.m4 (GMP_PROG_AR): Remove AR_FLAGS=cq, libtool 1.5.2 now
13885         does this itself on detecting duplicate object filenames in piecewise
13886         linking mode.
13888         * randbui.c, randmui.c [longlong+nails]: Correction to conditionals
13889         for second limb.
13891         * mpz/aors_ui.h, mpz/cdiv_q_ui.c, mpz/cdiv_qr_ui.c, mpz/cdiv_r_ui.c,
13892         mpz/cdiv_ui.c, mpz/fdiv_q_ui.c, mpz/fdiv_qr_ui.c, mpz/fdiv_r_ui.c,
13893         mpz/fdiv_ui.c, mpz/gcd_ui.c, mpz/iset_ui.c, mpz/lcm_ui.c,
13894         mpz/set_ui.c, mpz/tdiv_q_ui.c, mpz/tdiv_qr_ui.c, mpz/tdiv_r_ui.c,
13895         mpz/tdiv_ui.c, mpz/ui_sub.c, mpf/div_ui.c, mpf/mul_ui.c
13896         [longlong+nails]: Amend #if to avoid warnings about shift amount.
13898 2004-03-07  Kevin Ryde  <kevin@swox.se>
13900         * mpf/reldiff.c: Use rprec+ysize limbs for d, to ensure accurate
13901         result.  Inline mpf_abs(d,d) and mpf_cmp_ui(x,0), and rate the latter
13902         UNLIKELY.
13904         * mpf/ui_div.c: Use mpn_tdiv_qr.  Use just one TMP_ALLOC.  Use full
13905         divisor, since truncating can lose accuracy.
13906         * tests/mpf/t-ui_div.c: New file.
13907         * tests/mpf/Makefile.am (check_PROGRAMS): Add it.
13909         * mpf/set_q.c: Expand TMP_ALLOC_LIMBS_2, to make conditional clearer
13910         and avoid 1 limb alloc when not wanted.
13912         * gmp-impl.h (WANT_TMP_DEBUG): Define to 0 if not defined.
13913         (TMP_ALLOC_LIMBS_2): Use "if" within macro rather than "#if", for less
13914         preprocessor conditionals.
13916         * mpf/mul_2exp.c, mpf/div_2exp.c: Add some comments.
13918         * tests/refmpn.c (refmpn_sb_divrem_mn, refmpn_tdiv_qr): Nailify.
13920 2004-03-04  Kevin Ryde  <kevin@swox.se>
13922         * gen-psqr.c (print): Add CNST_LIMB in PERFSQR_MOD_TEST, for benefit
13923         of K&R.
13924         * tests/mpn/t-perfsqr.c (PERFSQR_MOD_1): Use CNST_LIMB for K&R.
13926         * doc/configuration (Configure): Remove mkinstalldirs, no longer used.
13928         * acinclude.m4 (GMP_PROG_AR): Remove AR_FLAGS=cq, libtool 1.5.2 now
13929         does this itself on detecting duplicate object filenames in piecewise
13930         linking mode.
13932         * configure.in (hppa2.0*-*-*): Test sizeof(long) == 4 or 8 to verify
13933         ABI=2.0n versus ABI=2.0w.  In particular this lets CC=cc_bundled
13934         correctly fall back to ABI=2.0n (we don't automatically add CC=+DD64
13935         to that compiler, currently).
13937         * doc/gmp.texi (Reentrancy): Note C++ mpf_class constructors using
13938         global default precision.
13939         (Random State Miscellaneous): Describe gmp_urandomb_ui as giving N
13940         bits.
13941         (C++ Interface Floats): Describe operator= copying the value, not the
13942         precision, and what this can mean about copy constructor versus
13943         default constructor plus assignment.
13945         * mpf/set_q.c: Use mpn_tdiv_qr rather than mpn_divrem, so no shifting.
13946         Don't truncate the divisor, it can make the result inaccurate.
13947         * tests/mpf/t-set_q.c: New file.
13948         * tests/mpf/Makefile.am (check_PROGRAMS): Add it.
13950         * mpf/set.c: Use MPN_COPY_INCR, in case r==u and ABSIZ(u) > PREC(r)+1.
13951         No actual bug here, because MPN_COPY has thusfar been an alias for
13952         MPN_COPY_INCR, only an ASSERT failure.
13953         * tests/mpf/t-set.c: New file.
13954         * tests/mpf/Makefile.am (check_PROGRAMS): Add it.
13956         * mpf/set.c, mpf/iset.c: Do MPN_COPY last, for possible tail call.
13958         * mpf/set_d.c: Rate d==0 as UNLIKELY.  Store size before extract call,
13959         to shorten lifespan of "negative".
13961         * mpf/init.c, mpf/init2.c, mpf/iset_d.c, mpf/iset_si.c,
13962         mpf/iset_str.c, mpf/iset_ui.c: Store prec before alloc call, for one
13963         less live quantity across that call.
13964         * mpf/init.c, mpf/init2.c, mpf/iset_str.c: Store size and exp before
13965         alloc call, to overlap with other operations.
13967         * tests/refmpf.c, tests/tests.h (refmpf_fill, refmpf_normalize,
13968         refmpf_validate, refmpf_validate_division): New functions.
13970         * tests/refmpn.c, tests/tests.h (refmpn_copy_extend,
13971         refmpn_lshift_or_copy_any, refmpn_rshift_or_copy_any): New functions.
13973         * tal-debug.c: Add <string.h> for strcmp.
13975         * tests/cxx/t-istream.cc (check_mpz, check_mpq, check_mpf): Use size_t
13976         for loop index, to quieten g++ warning.
13978 2004-03-02  Kevin Ryde  <kevin@swox.se>
13980         * tests/mpn/t-hgcd.c: Use __GMP_PROTO on prototypes.
13982 2004-03-01  Torbjorn Granlund  <tege@swox.com>
13984         With Karl Hasselström:
13985         * mpn/generic/dc_divrem_n.c (mpn_dc_div_2_by_1): New function, with
13986         meat from old mpn_dc_divrem_n.  Accept scratch parameter.  Rewrite to
13987         avoid a recursive call.
13988         (mpn_dc_div_3_by_2): New function, with meat from old
13989         mpn_dc_div_3_halves_by_2.  Accept scratch parameter.
13990         (mpn_dc_divrem_n): Now just allocate scratch space and call new
13991         mpn_dc_div_2_by_1.
13993 2004-02-29  Kevin Ryde  <kevin@swox.se>
13995         * longlong.h (count_leading_zeros) [alpha gcc]: New version, inlining
13996         mpn/alpha/cntlz.asm cmpbge technique.
13998         * aclocal.m4, configure, install-sh, missing, ltmain.sh,
13999         */Makefile.in: Update to automake 1.8.2 and libtool 1.5.2.
14001         * doc/gmp.texi (C++ Interface Integers): Note / and % rounding follows
14002         C99 / and %.
14003         (Exact Remainder): Index entries for divisibility testing algorithm.
14005         * tune/time.c (speed_endtime): Return 0.0 for negative time measured.
14006         Revise usage comments for clarity.
14007         * tune/common.c (speed_measure): Recognise speed_endtime 0.0 for
14008         failed measurement.
14010         * tests/mpn/t-get_d.c (check_rand): Correction to nhigh_mask setup.
14012 2004-02-27  Torbjorn Granlund  <tege@swox.com>
14014         * tune/tuneup.c (tune_dc, tune_set_str): Up param.step_factor.
14016         * tests/mpz/t-gcd.c: Decrease # of tests to 50.
14018 2004-02-27  Kevin Ryde  <kevin@swox.se>
14020         * tests/devel/try.c: Add a comment that this is not for Cray systems.
14022         * mpf/set_q.c: Don't support den(q)<0, demand canonical form in the
14023         usual way.
14025 2004-02-24  Torbjorn Granlund  <tege@swox.com>
14027         From Kevin:
14028         * mpn/generic/mul_fft.c (mpn_fft_add_modF): Loop until normalization
14029         criterion met.
14031 2004-02-22  Kevin Ryde  <kevin@swox.se>
14033         * acinclude.m4 (GMP_PROG_CC_WORKS, GMP_OS_X86_XMM, GMP_PROG_CXX_WORKS):
14034         Remove files that might look like compiler output, so our "||"
14035         alternatives are not fooled.
14037         * acinclude.m4 (GMP_PROG_CC_WORKS): Add test for lshift_com code
14038         mis-compiled by certain IA-64 HP cc at +O3.
14040         * gmp-impl.h (USE_LEADING_REGPARM): Disable under prof or gprof, for
14041         the benefit of freebsd where .mcount clobbers registers.  Spotted by
14042         Torbjorn.
14043         * configure.in (WANT_PROFILING_PROF, WANT_PROFILING_GPROF): New
14044         AC_DEFINEs.
14046 2004-02-21  Kevin Ryde  <kevin@swox.se>
14048         * configure.in (sparc64-*-*bsd*): Amend -m32 setup for ABI=32, so it's
14049         not used in ABI=64 on the BSD systems.
14051 2004-02-18  Niels Möller  <nisse@lysator.liu.se>
14053         * tests/mpz/t-gcd.c (gcdext_valid_p): New function.
14054         (ref_mpz_gcd): Deleted function.
14055         (one_test): Rearranged to call mpz_gcdext first, so that the
14056         returned value can be validated.
14057         (main): Don't use ref_mpz_gcd.
14059 2004-02-18  Torbjorn Granlund  <tege@swox.com>
14061         * gmp-impl.h (MPN_TOOM3_MAX_N): Move to !WANT_FFT section.
14063         * tests/mpz/t-mul.c: Exclude special huge operands unless WANT_FFT.
14065         * mpz/rrandomb.c (gmp_rrandomb): Rewrite.
14067         * mpn/generic/mul_n.c (mpn_toom3_sqr_n): Remove write-only variable c5.
14069 2004-02-18  Kevin Ryde  <kevin@swox.se>
14071         * mpf/iset_si.c, mpf/iset_ui.c, mpf/set_si.c, mpf/set_ui.c [nails]:
14072         Always store second limb, to avoid a conditional.
14074         * tests/mpf/t-get_ui.c: New file.
14075         * tests/mpf/Makefile.am (check_PROGRAMS): Add it.
14076         * tests/mpf/t-get_si.c (check_limbdata): Further tests.
14077         * gmp-impl.h (MP_EXP_T_MAX, MP_EXP_T_MIN): New defines.
14079         * mpf/get_ui.c, mpf/get_si.c: Remove size==0 test, it's covered by
14080         other conditions.  Attempt greater clarity by expressing conditions as
14081         based on available data range.
14082         * mpf/get_si.c [nails]: Correction, don't bail on exp > abs_size,
14083         since may still have second limb above radix point available.
14084         * mpf/get_ui.c: Nailify.
14086 2004-02-16  Kevin Ryde  <kevin@swox.se>
14088         * mpz/scan0.c, mpz/scan1.c: Use count_trailing_zeros, instead of
14089         count_leading_zeros on limb&-limb.
14091         * mpf/sqrt.c: Use "/ 2" for exp, avoiding C undefined behaviour on
14092         ">>" of negatives.  Correction to comment, exp is rounded upwards.
14093         SIZ(r) always prec now, no need for tsize expression.  Store EXP(r)
14094         and SIZ(r) where calculated to reduce variable lifespans.  Make tsize
14095         mp_size_t not mp_exp_t, though of course those are currently the same.
14097         * gmp-h.in (GMP_ERROR_ALLOCATE, GMP_ERROR_BAD_STRING,
14098         GMP_ERROR_UNUSED_ERROR): Remove, never used or documented, and we
14099         don't want to use globals for communicating error information.
14101         * mpz/gcd_ui.c [nails]: Correction, actually return a value.
14103         * mpn/generic/addmul_1.c, mpn/generic/submul_1.c [nails==1]: Add code.
14105 2004-02-15  Kevin Ryde  <kevin@swox.se>
14107         * tests/mpz/t-jac.c (check_data): Remove unnecessary variable
14108         "answer".
14110 2004-02-14  Torbjorn Granlund  <tege@swox.com>
14112         * mpn/ia64/aors_n.asm: Break a group with a RAW conflict.
14114 2004-02-14  Kevin Ryde  <kevin@swox.se>
14116         * acinclude.m4 (GMP_C_RIGHT_SHIFT): Note that it's "long"s which we're
14117         concerned about.
14119         * mpn/generic/mul_n.c: Add some remarks about toom3 high zero
14120         stripping.
14122         * mpn/generic/scan0.c, mpn/generic/scan1.c: Remove design issue
14123         remarks.  What to do about going outside `up' space is a problem, but
14124         anything to address it would be an incompatible change.
14126 2004-02-12  Torbjorn Granlund  <tege@swox.com>
14128         * tests/mpn/t-hgcd.c: Remove unused variables.
14130         * mpn/ia64/hamdist.asm: Remove bundling incompatible with HP-UX
14131         assembler.  Misc HP-UX changes.
14132         * mpn/ia64/gcd_1.asm: Add some syntax to placid the HP-UX assembler.
14134 2004-02-11  Kevin Ryde  <kevin@swox.se>
14136         * longlong.h (power, powerpc): Use HAVE_HOST_CPU_FAMILY_power and
14137         HAVE_HOST_CPU_FAMILY_powerpc rather than various cpp defines.
14139         * gmp-impl.h: Add remarks about limits.h and Cray etc.
14141         * mpn/ia64/mul_1.asm: Don't put .pred directives on labelled lines,
14142         hpux 11.23 assembler doesn't like that.
14143         * mpn/ia64/README: Add a note on this.
14145         * dumbmp.c (mpz_mul): Set ALLOC(r) for new data block used.  Reported
14146         by Jason Moxham.
14148         * mpn/pa32/README, mpn/pa64/README (REFERENCES): New sections.
14150 2004-02-10  Torbjorn Granlund  <tege@swox.com>
14152         * tests/mpz/t-gcd.c: Decrease # of tests run.
14154         * mpn/*/gmp-mparam.h: Add HGCD values, update TOOM values.
14156 2004-02-01  Torbjorn Granlund  <tege@swox.com>
14158         From Kevin:
14159         * config.guess: Recognize AMD's hammer processors, return x86_64.
14161 2004-01-31  Niels Möller  <nisse@lysator.liu.se>
14163         * mpn/generic/hgcd.c (mpn_cmp_sum3): Declare static.
14165 2004-01-25  Niels Möller  <nisse@lysator.liu.se>
14167         * tests/mpn/Makefile.am (check_PROGRAMS): Add t-hgcd.
14169         * mpn/generic/hgcd.c (hgcd_jebelean): Simplify, use mpn_cmp_sum3.
14170         (mpn_cmp_sum3): New function.
14171         (mpn_diff_smaller_p): Remove.
14172         (hgcd_final, hgcd_jebelean, hgcd_small_1, hgcd_small_2, euclid_step):
14173         Remove tp,talloc arguments.  Callers changed.
14175 2004-01-25  Torbjorn Granlund  <tege@swox.com>
14177         * tune/tuneup.c (all): Reenable calls of tune_gcd_schoenhage and
14178         tune_hgcd.
14180         * mpn/generic/gcd.c: Reenable Schoenhage code.
14182         With Niels Möller:
14183         * mpn/generic/hgcd.c: Add const and inline to several functions.
14184         (qstack_push_start qstack_push_end qstack_push_quotient): Remove.
14185         (euclid_step): Insert removed functions here.
14186         (hgcd_adjust): Simplify, don't handle d != 1.
14187         (qstack_adjust): Corresponding changes.
14188         (mpn_hgcd2_lehmer_step): Remove redundant tests for bh against zero.
14189         (hgcd_start_row_p): Tweak.
14190         (hgcd_final): Shorten life of ralloc.
14192 2004-01-24  Kevin Ryde  <kevin@swox.se>
14194         * tests/mpf/t-sqrt.c (check_rand1): Further diagnostic printouts.
14196         * mpn/generic/sqrtrem.c (mpn_sqrtrem): Add ASSERT_MPN.
14197         (mpn_dc_sqrtrem): Add casts for K&R.
14199         * mpf/sqrt_ui.c: Nailify.
14201         * mpf/set_z.c: Do MPN_COPY last, for possible tail call.
14203         * doc/gmp.texi (Miscellaneous Float Functions): For mpf_random2, note
14204         exponent is in limbs.
14206         * mpn/ia64/README: Add remark about concentrating on itanium-2.
14208 2004-01-22  Kevin Ryde  <kevin@swox.se>
14210         * mpf/sqrt.c: Change tsize calculation to get prec limbs result
14211         always, previously got prec+1 when exp was odd.
14212         * tests/mpf/t-sqrt.c (check_rand1): New function, code from main.
14213         (check_rand2): New function.
14215         * mpf/sqrt_ui.c: Change rsize calculation to get prec limbs result,
14216         previously got prec+1.
14217         * tests/mpf/t-sqrt_ui.c: New file.
14218         * tests/mpf/Makefile.am (check_PROGRAMS): Add it.
14220         * tests/refmpf.c, tests/tests.h (refmpf_add_ulp,
14221         refmpf_set_prec_limbs): New functions.
14223         * mpz/get_d_2exp.c, mpf/get_d_2exp.c: Remove x86+m68k force to double,
14224         mpn_get_d now does this.  Remove res==1.0 check for round upwards,
14225         mpn_get_d now rounds towards zero.  Move exp store to make mpn_get_d a
14226         tail call.
14228         * configure.in (x86-*-*): Use ABI=32 rather than ABI=standard.
14229         Use gcc -m32 when available, to force mode on bi-arch amd64 gcc.
14230         * configure.in, acinclude.m4 (x86_64-*-*): Merge into plain x86 setups
14231         as ABI=64.  Support ABI=32, using athlon code.  Use gcc -mcpu=k8,
14232         -march=k8.
14233         (amd64-*-*): Remove pattern, config.sub only gives x86_64.
14234         * doc/gmp.texi (ABI and ISA): Add x86_64 dual ABIs.
14236         * mpn/amd64/README: Add reference to ABI spec.
14238 2004-01-17  Niels Möller  <nisse@lysator.liu.se>
14240         * mpn/generic/hgcd.c (hgcd_adjust): Backed out mpn_addlsh1_n
14241         change for now.
14243         * mpn/generic/hgcd.c (hgcd_adjust): Fixed calls of mpn_addlsh1_n.
14245 2004-01-17  Kevin Ryde  <kevin@swox.se>
14247         * tune/README: Remove open/mpn versions of toom3, no longer exist.
14248         * tune/powerpc64.asm: Remove unused L(again).
14249         * tune/time.c (mftb): Note single mftb possible for powerpc64.
14251         * mpn/generic/mode1o.c: Use "c<s" to do underflow detection in last
14252         step, for better parallelism.
14254         * mpn/generic/get_d.c: Preserve comments about hppa fcnv,udw,dbl from
14255         previous mpz_get_d code.
14257         * tune/freq.c: Add some comments about systems not covered.
14259         * gmp-h.in (_GMP_H_HAVE_FILE): Add _MSL_STDIO_H for Metrowerks.
14260         Reported by Tomas Zahradnicky.
14262 2004-01-16  Niels Möller  <nisse@lysator.liu.se>
14264         * mpn/generic/hgcd.c (mpn_diff_smaller_p): Use MPN_DECR_U.
14265         (hgcd_adjust): Use mpn_addlsh1_n when available.
14267 2004-01-16  Kevin Ryde  <kevin@swox.se>
14269         * configure.in (powerpc64-*-linux*): Try gcc64.  Try -m64 with
14270         "cflags_maybe" to get it used in all probing.  Add sizeof-long-8 test
14271         to check the mode is right if -m64 is not applicable.
14273 2004-01-15  Kevin Ryde  <kevin@swox.se>
14275         * configure.in (--with-readline=detect): Check for readline/readline.h
14276         and readline/history.h.  Report result of detection.
14278 2004-01-14  Niels Möller  <nisse@lysator.liu.se>
14280         * tune/speed.c (routine): Disabled speed_mpn_hgcd_lehmer.
14281         * tune/common.c (speed_mpn_hgcd_lehmer): Disabled function.
14283         * mpn/generic/hgcd.c (mpn_hgcd_lehmer_itch, mpn_hgcd_lehmer)
14284         (mpn_hgcd_equal): Deleted functions.
14286         * mpn/generic/gcd.c (hgcd_start_row_p): Deleted function.
14287         (gcd_schoenhage): Deleted assertion code using mpn_hgcd_lehmer.
14289         * mpn/generic/hgcd.c (hgcd_final): Fixed ASSERT typos.
14290         (mpn_hgcd): To use Lehmer's algorithm, call hgcd_final directly,
14291         not mpn_hgcd_lehmer.
14293         * mpn/generic/gcd.c (gcd_schoenhage): Updated for changes to
14294         mpn_hgcd and mpn_hgcd_fix. (Schoenhage code is still disabled).
14296         * gmp-impl.h (mpn_hgcd_fix): Updated prototype.
14298         * mpn/generic/hgcd.c (mpn_hgcd_fix): Replaced a bunch of arguments
14299         by a pointer const struct hgcd_row *s. Updated callers.
14301         * mpn/generic/hgcd.c (hgcd_start_row_p): Use const for the input.
14302         Moved function definition before hgcd_jebelean.
14303         (hgcd_jebelean): Interface change, analogous to hgcd2.
14304         (mpn_hgcd_fix): Normalize v. Require that v > 0.
14305         (hgcd_adjust): Fix bug in carry update.
14306         (mpn_hgcd): Reorganized again, to adapt to mpn_hgcd/hgcd_jebelean
14307         now sometimes returning 1. Reintroduced hgcd_adjust.
14309         * mpn/generic/hgcd.c (hgcd_final): Streamlined logic for the first
14310         hgcd2 call.
14312         * mpn/generic/hgcd2.c (mpn_hgcd2): Interface change. Return 1
14313         instead of 2, in the no progress case r0=A, r1=B.
14315         * mpn/generic/hgcd.c (hgcd_adjust): Changed arguments and return
14316         value. Now takes a struct hgcd_row * and the uv size, and returns
14317         updated uvsize.
14318         (hgcd_final): Special handling of the case hgcd2 returning 1. Now
14319         uses hgcd_adjust, instead of a full Euclid division.
14321 2004-01-13  Niels Möller  <nisse@lysator.liu.se>
14323         * mpn/generic/hgcd.c (euclid_step, hgcd_case0): Merged into a
14324         single function euclid_step.
14325         (mpn_hgcd): Reorganized the logic for the second recursive call.
14326         Avoid unnecessary Euclid steps.
14328         * tests/mpn/t-hgcd.c (hgcd_values): One more test value.
14330         * tests/mpn/t-hgcd.c (hgcd_values): Added values that trigged the
14331         hgcd_jebelean bug.
14333         * mpn/generic/hgcd.c (hgcd_jebelean): Fixed off by one error.
14334         (mpn_hgcd): Simplified the logic for the first recursive call. Now
14335         it uses only the correct values from the recursive call, and
14336         doesn't do tricks with hgcd_adjust (hgcd_adjust will probably be
14337         reintroduced later, though).
14339         * tests/mpn/t-hgcd.c (mpz_mpn_equal, hgcd_ref_equal)
14340         (hgcd_ref_init, hgcd_ref_clear): New functions.
14341         (hgcd_ref): Reference implementation of hgcd, using mpz.
14342         (one_test): Use hgcd_ref. Don't use mpn_hgcd_lehmer.
14343         (main): Skip one_step if both input values are zero.
14345 2004-01-12  Niels Möller  <nisse@lysator.liu.se>
14347         * mpn/generic/hgcd.c (hgcd_final): Rewritten, now uses Lehmer
14348         steps instead of a division loop.
14349         (mpn_hgcd_lehmer): Deleted old Lehmer code, instead just
14350         initialize and then call hgcd_final.
14352         * tests/tests.h: Added refmpn_free_limbs prototype.
14353         * tests/refmpn.c (refmpn_free_limbs): New function.
14355         * tests/mpn/t-hgcd.c: Try the same kind of random inputs as for
14356         mpz/t-gcd.
14358 2004-01-11  Niels Möller  <nisse@lysator.liu.se>
14360         * mpn/generic/hgcd.c (mpn_hgcd_lehmer): Rewritten, after some more
14361         analysis of the size reduction for one Lehmer step.
14363         * tests/mpn/t-hgcd.c: New file.
14365 2004-01-11  Torbjorn Granlund  <tege@swox.com>
14367         With Niels Möller:
14368         * mpn/generic/hgcd.c (hgcd_normalize): Fix ASSERTs.
14369         (hgcd_mul): Normalize R[1].uvp[1].  Add some more ASSERTs.
14370         (hgcd_update_uv): Streamline.  ASSERT that input and output is
14371         normalized.
14373 2004-01-11  Kevin Ryde  <kevin@swox.se>
14375         * mpn/alpha/ev6/slot.pl: New file, derived in part from
14376         mpn/x86/k6/cross.pl.
14378         * mpn/alpha/alpha-defs.m4 (ASSERT): New macro.
14380         * mpn/asm-defs.m4 (m4_ifdef): New macro, avoiding OSF 4.0 m4 bug.
14381         (m4_assert_defined): Use it.
14383         * mpn/alpha/default.m4, mpn/alpha/unicos.m4 (LDGP): New macro.
14384         * mpn/alpha/ev67/gcd_1.asm: Use it to re-establish gp after jsr.
14386         * configure.in, demos/calc/Makefile.am: Use -lcurses or -lncurses with
14387         readline, when available.
14389         * longlong.h (sub_ddmmss) [generic]: Use al<bl for the borrow rather
14390         than __x>al, since the former can be done without waiting for __x,
14391         helping superscalar chips, in particular alpha ev5 and ev6.
14393         * longlong.h (sub_ddmmss) [ia64]: New macro.
14395         * tests/t-sub.c: New file.
14396         * tests/Makefile.am (check_PROGRAMS): Add it.
14397         * tests/refmpn.c, tests/tests.h (refmpn_sub_ddmmss): New function.
14399 2004-01-09  Kevin Ryde  <kevin@swox.se>
14401         * mpn/x86/p6/mod_34lsub1.asm: New file, derived in part from
14402         mpn/x86/mod_34lsub1.asm.
14404         * configure.in (IA64_PATTERN): Use -mtune on gcc 3.4.
14406 2004-01-07  Kevin Ryde  <kevin@swox.se>
14408         * gmp-h.in, mp-h.in (__GMP_SHORT_LIMB): Renamed from _SHORT_LIMB, to
14409         keep in our namespace.  (Not actually used anywhere currently.)
14410         Reported by Patrick Pelissier.
14412         * mp-h.in: Use "! defined (__GMP_WITHIN_CONFIGURE)" in the same style
14413         as gmp-h.in (though mp-h.in is not actually used during configure).
14415         * mp-h.in (__GMP_DECLSPEC_EXPORT, __GMP_DECLSPEC_IMPORT) [__GNUC__]:
14416         Use __dllexport__ and __dllimport__ to keep out of application
14417         namespace.  Same previously done in gmp-h.in.
14419 2004-01-06  Kevin Ryde  <kevin@swox.se>
14421         * configfsf.sub, configfsf.guess: Update to 2004-01-05.
14422         * configure.in (amd64-*-* | x86_64-*-*): Update comments on what
14423         configfsf.sub does.
14425 2004-01-04  Kevin Ryde  <kevin@swox.se>
14427         * mpn/alpha/README (REFERENCES): Add tru64 assembly manuals.
14428         (ASSEMBLY RULES): Note what gcc says about !literal! etc.
14430 2004-01-03  Kevin Ryde  <kevin@swox.se>
14432         * mpn/alpha/ev67/gcd_1.asm: New file.
14434         * mpn/x86/pentium4/sse2/rsh1add_n.asm: New file, derived in part from
14435         mpn/x86/pentium4/sse2/addlsh1_n.asm.
14437         * mpn/x86/p6/p3mmx/popham.asm: Note measured speeds.
14439         * mpn/ia64/hamdist.asm: Correction to inputs vs locals in alloc (makes
14440         no difference to the generated code).  Corrections to a couple of
14441         comments.
14443         * mpn/x86/pentium4/sse2/addlsh1_n.asm (PARAM_CARRY): Remove macro, not
14444         used, no such parameter.
14446         * mpn/generic/gcd.c: Use <stdio.h> for NULL.
14448         * doc/gmp.texi (Single Limb Division): Correction to tex expression
14449         for (1/2)x1.  And minor wording tweaks elsewhere.
14451         * gmp-impl.h (mpn_rsh1add_n, mpn_rsh1sub_n): Correction to comments
14452         about how carries returned.
14454         * longlong.h (umul_ppmm) [generic]: Add comments about squaring
14455         (dropped from tasks list)
14457 2003-12-31  Kevin Ryde  <kevin@swox.se>
14459         * demos/perl/GMP.xs (scan0, scan1): Return ~0 for not-found.
14460         * demos/perl/GMP.pm: Describe this, remove the note about ULONG_MAX
14461         being the same as ~0 (which is not true in old perl).
14462         * demos/perl/test.pl: Update tests.
14463         * demos/perl/typemap (gmp_UV): New type.
14465         * demos/perl/test.pl (fits_slong_p): Comment out uv_max test, it won't
14466         necessarily exceed a long.
14468         * demos/perl/GMP.pm: Add a remark about get_str to the bugs section.
14470         * mpn/generic/sqrtrem.c, mpz/fac_ui.c, tests/mpf/reuse.c: Add casts
14471         for K&R.
14472         * tests/mpf/t-muldiv.c: Make ulimb, vlimb into ulongs, which is how
14473         they're used, for the benefit of K&R calling.
14475         * doc/gmp.texi (Square Root Algorithm): Add a summary of the algorithm.
14476         And add further index entries in various places.
14478         * mpz/lucnum_ui.c, mpz/lucnum2_ui.c: Use mpn_addlsh1_n when available.
14480         * gmp-impl.h, mpn/generic/mul_n.c (mpn_addlsh1_n, mpn_sublsh1_n,
14481         mpn_rsh1add_n, mpn_rsh1sub_n): Move descriptions to gmp-impl.h with
14482         the prototypes, for ease of locating.
14484 2003-12-30  Torbjorn Granlund  <tege@swox.com>
14486         * tune/tuneup.c (all): Disable calls of tune_gcd_schoenhage and
14487         tune_hgcd for now.
14489 2003-12-29  Torbjorn Granlund  <tege@swox.com>
14491         * tests/mpz/t-gcd.c: Rewrite, based on suggestions by Kevin.
14493         * mpn/ia64/mul_1.asm: Amend TODO list.
14495         * mpn/sparc64/README: Remove mpn_Xmul_2, done.
14496         Add blurb about L1 cache conflicts.
14498         * mpn/generic/gcd.c: Disable Schoenhage code for now.
14500 2003-12-29  Kevin Ryde  <kevin@swox.se>
14502         * mpn/generic/mul_fft.c, mpz/root.c, mpq/cmp_ui.c: Add casts for K&R.
14504 2003-12-27  Kevin Ryde  <kevin@swox.se>
14506         * tests/mpz/t-mul.c (mul_kara, mul_basecase): Use __GMP_PROTO.
14508         * mpn/generic/gcd.c (NHGCD_SWAP4_2, NHGCD_SWAP3_LEFT),
14509         mpn/generic/hgcd.c (HGCD_SWAP4_LEFT, HGCD_SWAP4_RIGHT, HGCD_SWAP4_2,
14510         HGCD_SWAP3_LEFT): Aggregate initializers for automatics is an
14511         ANSI-ism, avoid.
14513         * Makefile.am (AUTOMAKE_OPTIONS): Restore this, giving no directory on
14514         ansi2knr to avoid a circular build rule.
14515         * configure.in (AM_INIT_AUTOMAKE): Note options also in Makefile.am.
14517         * configure.in (cflags_maybe): Don't loop adding cflags_maybe if the
14518         user has set CFLAGS.
14520 2003-12-24  Torbjorn Granlund  <tege@swox.com>
14522         * mpn/generic/gcd.c (gcd_schoenhage_itch): Avoid unary "+".
14523         (mpn_gcd): Allocate scratch space on heap for gcd_schoenhage.
14524         (mpn_gcd): Don't invoke MPN_NORMALIZE on input operands.
14526 2003-12-23  Kevin Ryde  <kevin@swox.se>
14528         * configure.in (*sparc*-*-*): Test sizeof(long)==4 or 8 for ABIs, to
14529         get the right mode when the user sets the CFLAGS.
14530         (testlist): Introduce "any_<abi>_testlist" to apply to all compilers.
14532         * demos/perl/typemap (MPZ_ASSUME, MPQ_ASSUME, MPF_ASSUME): Remove
14533         output rules, these are only meant for inputs.
14534         (MPZ_MUTATE): Remove, not used since changes for magic.
14536         * demos/perl/GMP.xs (mpz_class_hv, mpq_class_hv, mpf_class_hv): New
14537         variables, initialized in BOOT.
14538         * demos/perl/GMP.xs, demos/perl/typemap: Use them and explicit
14539         sv_bless, to save a gv_stashpv for every new object.
14541 2003-12-22  Kevin Ryde  <kevin@swox.se>
14543         * mpn/alpha/mode1o.c, mpn/alpha/dive_1.c: Moved from ev5/mode1o.c and
14544         ev5/dive_1.c, these are good for ev4, and would like them in a generic
14545         alpha build.
14547 2003-12-21  Kevin Ryde  <kevin@swox.se>
14549         * doc/gmp.texi (Integer Logic and Bit Fiddling): Say "bitwise" in
14550         mpz_and, mpz_ior and mpz_xor, to avoid any confusion with what C means
14551         by "logical".  Reported by Rüdiger Schütz.
14553         * gmp-h.in (_GMP_H_HAVE_FILE): Note why defined(EOF) is not good.
14555 2003-12-20  Torbjorn Granlund  <tege@swox.com>
14557         * mpn/generic/hgcd.c (mpn_diff_smaller_p): Use mpn_cmp instead of
14558         mpn_sub_n where possible.  Use mp_size_t for relevant variables.
14560 2003-12-20  Kevin Ryde  <kevin@swox.se>
14562         * tune/speed.h (SPEED_TMP_ALLOC_LIMBS): Correction to last change,
14563         don't want "- 1" on the TMP_ALLOC_LIMBS.
14565         * demos/expr/expr.h: Test #ifdef MPFR_VERSION_MAJOR for when mpfr.h is
14566         included, not GMP_RNDZ which is now an enum.
14568         * demos/expr/exprfra.c (e_mpfr_ulong_p): Use mpfr_integer_p and
14569         mpfr_fits_ulong_p.
14570         (e_mpfr_get_ui_fits): Use mpfr_get_ui.
14572         * mpfr/*: Update to mpfr cvs head 2003-12-20.
14574         * configure, config.in: Update to autoconf 2.59.
14575         * */Makefile.in, configure, aclocal.m4, ansi2knr.c, install-sh,
14576         doc/mdate-sh: Update to automake 1.8.
14578         * mkinstalldirs: Remove, not required by automake 1.8.
14579         * doc/gmp.texi (Build Options): HTML is a usual target in automake 1.8.
14581         * configure.in (AC_PREREQ): Require autoconf 2.59.
14582         (AM_INIT_AUTOMAKE): Require automake 1.8.
14583         (AC_C_INLINE): Use rather than GMP_C_INLINE, now has #ifndef
14584         __cplusplus we want.
14585         (gettimeofday): Use AC_CHECK_FUNCS rather than our workaround code,
14586         autoconf now ok.
14588         * acinclude.m4 (GMP_C_INLINE): Remove.
14589         (GMP_H_EXTERN_INLINE): Use AC_C_INLINE.
14590         (GMP_PROG_AR): Comment on automake $ARFLAGS.
14592 2003-12-19  Niels Möller  <nisse@lysator.liu.se>
14594         * mpn/generic/hgcd.c (mpn_diff_smaller_p): Rewrote function. Tried
14595         to explain how it works.
14596         (slow_diff_smaller_p, wrap_mpn_diff_smaller_p) [WANT_ASSERT]: Use
14597         CPP to wrap assertion checks around all calls to
14598         mpn_diff_smaller_p.
14600         * mpn/generic/hgcd.c (mpn_addmul2_n_1) [nails]: Fixed carry handling.
14602         * mpn/generic/hgcd.c (mpn_diff_smaller_p) [nails]: Use
14603         GMP_NUMB_MAX, not MP_LIMB_T_MAX.
14604         (mpn_hgcd_itch): Improved size calculation.
14605         (mpn_hgcd_max_recursion): Moved function from qstack.c. Should to
14606         be recompiled when HGCD_SCHOENHAGE_THRESHOLD is tuned.
14608         * mpn/generic/qstack.c (mpn_hgcd_max_recursion): ... moved from
14609         here.
14611 2003-12-19  Torbjorn Granlund  <tege@swox.com>
14613         * tests/mpf/t-get_d.c: Print message before aborting.
14615         * mpn/generic/hgcd2.c (mpn_hgcd2): Substitute always-zero variable
14616         with 0.  Remove bogus comment.
14618         * mpn/generic/get_d.c: Make ONE_LIMB case actually work for nails.
14620 2003-12-18  Niels Möller  <niels@lysator.liu.se>
14622         * mpn/generic/hgcd.c (hgcd_update_r): Assert that the output r2 is
14623         smaller than the input r1.
14625 2003-12-18  Torbjorn Granlund  <tege@swox.com>
14627         * mpz/get_d.c: Don't include longlong.h.
14629         * tests/mpz/t-mul.c (ref_mpn_mul): Handle un == vn specially, to avoid
14630         a dummy r/w outside of allocated area.
14632 2003-12-18  Kevin Ryde  <kevin@swox.se>
14634         * mpn/alpha/unicos.m4 (ALIGN): Add comments on what GCC does.
14636         * configure.in (fat setups), acinclude.m4 (GMP_INIT): Obscure
14637         include() from automake 1.8 aclocal.
14638         * acinclude.m4: Quote names in AC_DEFUN, for automake 1.8 aclocal.
14640 2003-12-17  Niels Möller  <nisse@lysator.liu.se>
14642         * tune/common.c (speed_mpn_hgcd, speed_mpn_hgcd_lehmer) [nails]:
14643         Enabled code also for GMP_NAIL_BITS > 0.
14644         * tune/speed.c [nails]: Enable speed_mpn_hgcd and
14645         speed_mpn_hgcd_lehmer.
14646         * tune/tuneup.c (tune_hgcd) [nails]: Likewise.
14648         * mpn/generic/gcd.c [nails]: Use Schönhage's algorithm also for
14649         GMP_NAIL_BITS > 0.
14651         * mpn/generic/hgcd.c [nails]: Enable the code for GMP_NAIL_BITS > 0.
14652         (MPN_EXTRACT_LIMB) [nails]: Handle nails.
14653         (__gmpn_hgcd_sanity): Allocate temporaries on the heap, not on the
14654         stack. Also check that r[i] >= r[i+1].
14655         (mpn_hgcd2_lehmer_step) [nails]: Handle nails.
14656         (mpn_hgcd_lehmer): When we temporarily have r3 > r2, avoid
14657         trigging that assert in __gmpn_hgcd_sanity.
14658         (mpn_hgcd): Likewise.
14660         * mpn/generic/hgcd2.c (div2) [nails]: Alternative nail-aware
14661         version.
14662         (SUB_2): New macro of Kevin's, which reduces do sub_ddmmss in the
14663         non-nail case.
14664         (HGCD2_STEP): Use SUB_2, not sub_ddmmss. Added alternative version
14665         for K&R compilers.
14666         (mpn_hgcd2) [nails]: Use SUB_2, not sub_ddmmss. New nail-aware
14667         code for checking Jebelean's condition.
14669 2003-12-13  Kevin Ryde  <kevin@swox.se>
14671         * mpq/get_d.c: Amend comments per mpn_get_d change.
14672         (limb2dbl): Remove, no longer used.
14674         * gmp-impl.h (DIVREM_1_NORM_THRESHOLD etc) [nails]: Correction to
14675         comments, MP_SIZE_T_MAX means preinv never.
14677         * gmp-impl.h (DIVEXACT_1_THRESHOLD, MODEXACT_1_ODD_THRESHOLD) [nails]:
14678         Remove overrides, divexact_1 and modexact_1 have been nailified.
14680         * mpz/inp_str.c (mpz_inp_str_nowhite): Use ASSERT_ALWAYS for EOF value
14681         requirement.
14683         * tests/refmpn.c (refmpn_rsh1add_n, refmpn_rsh1sub_n): Parens around
14684         GMP_NUMB_BITS - 1 with ">>", to quieten gcc -Wall.
14685         * tests/t-constants.c (main), tests/t-count_zeros.c (check_clz),
14686         tests/t-modlinv.c (one), tests/mpz/t-jac.c (try_si_zi),
14687         tests/mpq/t-get_d.c (check_onebit): : Correction to printfs.
14688         * tests/mpn/t-fat.c: Add <string.h> for memcpy.
14689         * tests/mpz/t-scan.c (check_ref): Remove unused variable "isigned".
14690         * tests/mpq/t-get_d.c (check_onebit): Remove unused variable "limit".
14691         * tests/mpf/t-set_si.c, tests/mpf/t-set_ui.c (check_data): Braces for
14692         initializers.
14693         * tests/devel/try.c (mpn_divexact_by3_fun, mpn_modexact_1_odd_fun):
14694         Correction to return values.
14696         * doc/gmp.texi (Miscellaneous Integer Functions): Note mpz_sizeinbase
14697         can be used to locate the most significant bit.  Reword a bit for
14698         clarity.
14700 2003-12-12  Niels Möller  <niels@lysator.liu.se>
14702         * mpn/generic/hgcd.c (__gmpn_hgcd_sanity): Fixed stack buffer
14703         overrun.
14704         * mpn/generic/hgcd.c: Improved comments.
14706 2003-12-11  Torbjorn Granlund  <tege@swox.com>
14708         * gmp-impl.h: Change asm => __asm__, tabify.
14709         * mpz/get_d_2exp.c: Likewise.
14710         * mpf/get_d_2exp.c: Likewise.
14712         * tests/cxx/t-ops.cc: #if .. #endif out tests that cause ambiguities.
14714 2003-12-10  Torbjorn Granlund  <tege@swox.com>
14716         * tests/mpz/t-gcd.c: Generate operands with sizes as a geometric
14717         progression, to allow for larger operands and less varying timing.
14719         * tune/tuneup.c (tune_gcd_schoenhage): Set param.step_factor.
14720         (tune_hgcd): Likewise.
14722 2003-12-10  Kevin Ryde  <kevin@swox.se>
14724         * demos/perl/test.pl: Should be $] for perl version in old perl.
14726         * configure.in (sparc64-*-*): Single block of gcc configs for all
14727         systems, on unknown systems try both ABI 32 and 64.
14729         * configure.in (LIBGMP_LDFLAGS, LIBGMPXX_LDFLAGS): New AC_SUBSTs with
14730         options to generate .def files with windows DLLs.
14731         * Makefile.am (libgmp_la_LDFLAGS, libgmpxx_la_LDFLAGS): Use them.
14733         * mpn/generic/gcd.c: Use ABOVE_THRESHOLD / BELOW_THRESHOLD, to follow
14734         convention and cooperate with tune/tuneup.c.
14736         * tune/tuneup.c (tune_gcd_schoenhage): Increase max_size to 3000, side
14737         default 1000 is approx the crossover point on athlon.
14739         * tune/common.c, tune/speed.c, tune/speed.h, tune/speed-ext.c,
14740         tune/tuneup.c (SPEED_TMP_ALLOC_LIMBS): Take variable as parameter
14741         rather than returning a value, avoids alloca in a function call.
14742         * tune/common.c, tune/speed.h (speed_tmp_alloc_adjust): Remove, now
14743         inline in SPEED_TMP_ALLOC_LIMBS, and using ptr-NULL for alignment
14744         extraction.
14746         * gmpxx.h (__gmp_binary_equal, __gmp_binary_not_equal,
14747         __gmp_binary_less, __gmp_binary_less_equal, __gmp_binary_greater,
14748         __gmp_binary_greater_equal, __gmp_cmp_function): Use mpfr_cmp_si and
14749         mpfr_cmp_d.
14750         * tests/cxx/t-ops.cc: Exercise this.
14752         * demos/perl/Makefile.PL: Don't install sample.pl and test2.pl.
14754         * demos/perl/GMP.xs (use_sv): Prefer PV over IV or NV to avoid any
14755         rounding.
14756         * demos/perl/test.pl: Exercise this.
14758         * demos/perl/GMP/Mpf.pm (overload_string): Corrections to $# usage.
14759         * demos/perl/test.pl: Exercise this.
14761 2003-12-08  Kevin Ryde  <kevin@swox.se>
14763         * demos/perl/GMP.pm: Correction to canonicalize example.
14765         * demos/perl/GMP.xs: New type check scheme, support magic scalars,
14766         support UV when available.  Remove some unused local variables.
14767         (coerce_long): Check range of double.
14768         (get_d_2exp): Remove stray printf.
14770         * demos/perl/test.pl: Exercise magic, rearrange to make it clearer
14771         what's being tested.
14773 2003-12-07  Kevin Ryde  <kevin@swox.se>
14775         * mpn/generic/hgcd.c (mpn_hgcd): Use BELOW_THRESHOLD, to follow the
14776         convention of N<THRESH for the lower algorithm, not <=.  Fixes
14777         algorithm selection in tuneup.c.
14779         * tune/common.c (speed_mpn_hgcd, speed_mpn_hgcd_lehmer): Use intended
14780         align_xp, align_yp.
14782         * tune/tuneup.c (mul_toom3_threshold): Use MUL_TOOM3_THRESHOLD_LIMIT,
14783         for the benefit of ASSERT in mpn_mul_n.
14785         * tune/tuneup.c (tune_mul): Correction to toom3 param.min_size, should
14786         use MPN_TOOM3_MUL_N_MINSIZE.
14788         * tune/speed.c (check_align_option): Correction to printf format.
14789         * tune/freq.c (freq_sysctl_hw_model): Remove unused "i" variable.
14791         * scanf/doscan.c: Correction to a couple of trace printfs.
14792         Add <stdlib.h> for strtol.
14794         * tests/misc/t-scanf.c (test_sscanf_eof_ok): New function.
14795         (check_misc): Use it to suppress tests broken by libc.
14796         And should be EOF rather than -1 in various places.
14798 2003-12-06  Torbjorn Granlund  <tege@swox.com>
14800         * tune/common.c (speed_mpn_hgcd, speed_mpn_hgcd_lehmer):
14801         Move SPEED_TMP_ALLOC_LIMBS invocations out from calls.
14803         * mpn/generic/get_str.c (mpn_get_str, POW2_P case):
14804         Don't append extra '\0' byte.
14806 2003-12-05  Niels Möller  <niels@lysator.liu.se>
14808         * tune/common.c (speed_mpn_hgcd_lehmer, speed_mpn_hgcd):
14809         Updated for the renaming hgcd_sanity -> ASSERT_HGCD.
14811         * mpn/generic/gcd.c (gcd_schoenhage): TMP_DECL must be the final
14812         declaration in the declaration section of a block.
14814         * tune/speed.h (mpn_gcd_accel): Added prototype.
14816 2003-12-05  Torbjorn Granlund  <tege@swox.com>
14818         * randmt.c (__gmp_mt_recalc_buffer): Put parens around "&" expressions
14819         inside "!=".
14821         * mpf/get_str.c: Remove unused variable "fracn".
14823 2003-12-03  Kevin Ryde  <kevin@swox.se>
14825         * configure.in, Makefile.am (LIBGMP_LDFLAGS, LIBGMPXX_LDFLAGS): New
14826         AC_SUBSTs, use them to create .def files with Windows DLLs.
14827         * doc/gmp.texi (Notes for Particular Systems): Update notes on mingw
14828         DLL with MS C.
14830         * mpz/export.c: Allow NULL for countp.
14831         * doc/gmp.texi (Integer Import and Export): Describe this.
14832         Suggested by Jack Lloyd.
14834         * mpn/x86/p6/aors_n.asm: New file, grabbing the K7 code.
14835         Superiority of this reported by Patrick Pelissier.
14837 2003-11-30  Kevin Ryde  <kevin@swox.se>
14839         * mpn/alpha/ev67/popcount.asm, mpn/alpha/ev67/hamdist.asm: New files.
14841         * mpn/alpha/ev67: New directory.
14842         * configure.in (alphaev67, alphaev68, alphaev7*): Use it.
14844         * doc/gmp.texi (GMPrefu, GMPpxrefu): Change back to plain ref and
14845         pxref, remove macros.
14846         (GMPreftopu, GMPpxreftopu): Remove URL parameter, rename to GMPreftop
14847         and GMPpxreftop.
14848         (Debugging): Remove debauch, seems to have disappeared.
14849         (Language Bindings): Corrections to URLs for CLN, Omni F77, Pike.
14851 2003-11-29  Kevin Ryde  <kevin@swox.se>
14853         * demos/perl/GMP/Mpf.pm (overload_string): Use $OFMT to avoid warnings
14854         about $#.
14856         * demos/perl/GMP.xs (fits_slong_p): Use LONG_MAX+1 to avoid possible
14857         rounding of 0x7F..FF in a double on 64-bit systems.
14859         * configure.in (ppc601-*-*): Remove this case, it never matched
14860         anything, the name adopted is powerpc601.
14861         (powerpc601-*-*): Use gcc -mcpu=601, xlc -qarch=601.
14863         * configure.in: Introduce ${cc}_cflags_maybe, used if they work.
14864         (*sparc*-*-*) [ABI=32]: Add gcc_cflags_maybe=-m32 to force that mode.
14866         * doc/gmp.texi (Introduction to GMP): Add AMD64 to optimizations list.
14867         (Build Options): Add cpu types alphaev7 and amd64.  Update texinfo
14868         html cross reference.
14870 2003-11-28  Niels Möller  <nisse@lysator.liu.se>
14872         * tune/tuneup.c (tune_hgcd): Disable if GMP_NAIL_BITS > 0.
14873         * tune/speed.c (routine): Likewise.
14874         * tune/common.c (speed_mpn_hgcd, speed_mpn_hgcd_lehmer): Likewise.
14876         * mpn/generic/gcd.c, mpn/generic/hgcd.c, mpn/generic/hgcd2.c
14877         [GMP_NAIL_BITS]: Disabled new code if we have nails.
14879         * mpn/generic/gcd.c (MPN_LEQ_P): Copied macro definition (needed
14880         for compilation with --enable-assert).
14882         * tune/tuneup.c (hgcd_schoenhage_threshold,
14883         gcd_schoenhage_threshold): New variables.
14884         (tune_hgcd, tune_gcd_schoenhage): New functions.
14885         (all): Call tune_hgcd and tune_gcd_schoenhage.
14887         * tune/common.c (speed_mpn_hgcd, speed_mpn_hgcd_lehmer)
14888         (speed_mpn_gcd_accel): New functions.
14889         * tune/speed.c (routine): Added mpn_hgcd, mpn_hgcd_lehmer and
14890         mpn_gcd _accel.
14891         * tune/speed.h: Added corresponding prototypes.
14893         * tune/gcd_accel.c: New file.
14895         * tune/gcd_bin.c (GCD_SCHOENHAGE_THRESHOLD): Set to MP_SIZE_T_MAX.
14897         * tune/Makefile.am (libspeed_la_SOURCES): Added gcd_accel.c.
14898         (TUNE_MPN_SRCS_BASIC): Added hgcd.c.
14900         * mpn/x86/k7/gmp-mparam.h (HGCD_SCHOENHAGE_THRESHOLD)
14901         (GCD_SCHOENHAGE_THRESHOLD): Tuned values.
14903         * mpn/generic/gcd.c (mpn_gcd, gcd_binary_odd): Renamed the
14904         old mpn_gcd function (which implements accelerated binary gcd) to
14905         gcd_binary_odd.
14906         (gcd_binary): New function, with the additional book keeping
14907         needed when using gcd_binary_odd to compute the gcd of non-odd
14908         numbers.
14909         (hgcd_tdiv): New function.
14910         (gcd_lehmer): New function, currently #if:ed out.
14911         (hgcd_start_row_p): New function, duplicated from hgcd.c.
14912         (gcd_schoenhage_itch): New function.
14913         (gcd_schoenhage): New function.
14914         (mpn_gcd): New advertised gcd function, which calls
14915         mpn_gcd_binary_odd or mpn_gcd_schoenhage, depending on the size of
14916         the input.
14918         * mpn/generic/hgcd.c (mpn_hgcd2_lehmer_step): Renamed function
14919         (was lehmer_step), and made non-static. Updated callers.
14921         * gmp-impl.h (GCD_LEHMER_THRESHOLD): #if:ed out this macro.
14922         (mpn_hgcd2_lehmer_step): Added prototype.
14924 2003-11-27  Niels Möller  <nisse@lysator.liu.se>
14926         * tests/mpz/t-gcd.c (gcd_values): Moved definition, so that we
14927         don't need to forward declare the array.
14929 2003-11-26  Niels Möller  <nisse@lysator.liu.se>
14931         * mpn/generic/hgcd.c (mpn_hgcd2_fix): Deleted duplicate definition
14932         (the function belongs to hgcd2.c).
14934 2003-11-26  Torbjorn Granlund  <tege@swox.com>
14936         * tests/mpz/t-gcd.c: Generate random operands up to 32767 bits;
14937         decrease # of test to 1000.
14938         (gcd_values): Remove oversize test case.
14940 2003-11-26  Niels Möller  <niels@lysator.liu.se>
14942         * gmp-impl.h: Added name mangling for hgcd-related functions. Also
14943         use __GMP_PROTO.
14944         (MPN_LEQ_P, MPN_EXTRACT_LIMB): Moved macros to hgcd.c.
14945         * mpn/generic/hgcd.c, mpn/generic/hgcd2.c, mpn/generic/qstack.c:
14946         Adapted to name changes.
14948         * tests/mpz/t-gcd.c (main): Added some tests with non-random
14949         input.
14951 2003-11-25  Niels Möller  <nisse@lysator.liu.se>
14953         * gmp-impl.h (MPN_LEQ_P, MPN_EXTRACT_LIMB): New macros.
14954         (struct qstack, struct hgcd2_row, struct hgcd2, struct hgcd_row)
14955         (struct hgcd): New structs. Also added prototypes for new hgcd,
14956         hgcd2, qstack and gcd functions.
14958         * configure.in (gmp_mpn_functions): Added hgcd2, hgcd and qstack.
14960         * mpn/Makefile.am (nodist_EXTRA_libmpn_la_SOURCES): Added hgcd2.c,
14961         hgcd.c and qstack.c.
14963         * mpn/generic/hgcd.c, mpn/generic/hgcd2.c, mpn/generic/qstack.c:
14964         New files, needed for the sub-quadratic gcd.
14966 2003-11-25  Kevin Ryde  <kevin@swox.se>
14968         * doc/gmp.texi (Language Bindings): Add Axiom.
14970 2003-11-22  Kevin Ryde  <kevin@swox.se>
14972         * mpn/alpha/README: More notes on assembler syntax variations.
14974         * mpn/alpha/alpha-defs.m4, mpn/alpha/unicos.m4 (unop): Should be ldq_u
14975         not bis, and move to alpha-defs.m4 since it can be happily used
14976         everywhere.
14978         * mpn/alpha/alpha-defs.m4, mpn/alpha/default.m4, mpn/alpha/unicos.m4
14979         (bigend): Move to alpha-defs.m4 and base it on HAVE_LIMB_BIG_ENDIAN or
14980         HAVE_LIMB_LITTLE_ENDIAN, so as not to hard code system endianness.
14982         * mpn/alpha/alpha-defs.m4: New file.
14983         * configure.in (alpha*-*-*): Use it.
14985 2003-11-21  Kevin Ryde  <kevin@swox.se>
14987         * mpfr/*: Update to mpfr-2-0-2-branch 2003-11-21.
14989         * mpn/alpha/ev5/com_n.asm: Change "not" to "ornot r31", since "not"
14990         isn't recognised by on Cray Unicos.  Add missing "gp" to PROLOGUE.
14991         * mpn/alpha/README: Add a note on "not".
14993 2003-11-19  Torbjorn Granlund  <tege@swox.com>
14995         * mpn/alpha/aorslsh1_n.asm: Slightly rework feed-in code, avoiding
14996         spurious reads beyond operand limits.
14998         * mpn/alpha/ev5/com_n.asm: Add ASM_START/ASM_END.
15000         * mpn/generic/mul_fft.c (mpn_fft_zero_p): Remove unused function.
15001         (mpn_lshift_com): Make static, nailify properly.
15003 2003-11-19  Kevin Ryde  <kevin@swox.se>
15005         * mpn/generic/diveby3.c: Use a "q" variable to make it clearer what
15006         the code is doing.
15008         * mpn/powerpc32/750/lshift.asm, mpn/powerpc32/750/rshift.asm: New
15009         files.
15011         * mpn/alpha/ev5/com_n.asm: New file.
15013         * doc/gmp.texi (Assembler Functional Units, Assembler Writing Guide):
15014         New sections by Torbjorn, tweaked by me.
15016 2003-11-17  Torbjorn Granlund  <tege@swox.com>
15018         * mpn/powerpc32: Add power4/powerpc970 cycle counts.
15019         Use cmpwi instead of cmpi to placate darwin.
15021 2003-11-15  Kevin Ryde  <kevin@swox.se>
15023         * config.guess: Add comments on MacOS "machine" command.
15025         * tests/devel/try.c (main): Use gmp_randinit_default explicitly on
15026         __gmp_rands, since RANDS doesn't allow seeding.
15028         * doc/gmp.texi (Assigning Integers): Remove notes on possible change
15029         to disallow whitespace, this would be an incompatible change and
15030         really can't be made.
15031         (Toom 3-Way Multiplication): Updates for Paul's new code.
15033         * mpn/generic/mul_n.c (toom3_interpolate, mpn_toom3_mul_n): Put
15034         if/else braces around whole of #if code, for readability.
15036         * tests/refmpn.c (refmpn_addlsh1_n, refmpn_sublsh1_n,
15037         refmpn_rsh1add_n, refmpn_rsh1sub_n): Add ASSERTs for operand overlaps
15038         etc.
15040         * mpfr/*: Update to mpfr-2-0-2-branch 2003-11-15.
15042 2003-11-14  Torbjorn Granlund  <tege@swox.com>
15044         * mpn/alpha/aorslsh1_n.asm: Use Cray-friendly syntax for "br".
15046 2003-11-13  Torbjorn Granlund  <tege@swox.com>
15048         * mpn/alpha/aorslsh1_n.asm: New file.
15050 2003-11-12  Kevin Ryde  <kevin@swox.se>
15052         * acinclude.m4 (GMP_PROG_CC_WORKS): Add case provoking AIX power2
15053         assembler, test code by Torbjorn.
15054         * configure.in (power*-*-*): Add a comment about -mcpu=rios2 fallback.
15056         * tune/speed.c (main): Use gmp_randinit_default explicitly on
15057         __gmp_rands, since RANDS doesn't allow seeding.
15059         * mpfr/*: Update to mpfr-2-0-2-branch 2003-11-12.
15061         * gmp-impl.h, randmt.h (__gmp_randinit_mt_noseed): Move prototype to
15062         gmp-impl.h, for use by RANDS.
15064         * mpn/Makeasm.am (.s, .S, .asm): Quote $< in test -f, per automake.
15065         (.obj): Use test -f and $(CYGPATH_W) as per automake.
15067 2003-11-11  Kevin Ryde  <kevin@swox.se>
15069         * configure.in: Make umul and udiv standard-optional objects, rather
15070         than under various extra_functions.
15072         * mpn/pa32/hppa1_1/pa7100/add_n.asm,
15073         mpn/pa32/hppa1_1/pa7100/addmul_1.asm,
15074         mpn/pa32/hppa1_1/pa7100/lshift.asm,
15075         mpn/pa32/hppa1_1/pa7100/rshift.asm,
15076         mpn/pa32/hppa1_1/pa7100/sub_n.asm,
15077         mpn/pa32/hppa1_1/pa7100/submul_1.asm: Use LDEF for labels.
15079         * mpf/set_str.c: Don't use memcmp for decimal point testing, just a
15080         loop is enough and avoids any chance of memcmp reading past the end of
15081         the given string.
15083         * randmts.c, randmt.h: New files.
15084         * Makefile.am (libgmp_la_SOURCES): Add them.
15085         * randmt.c: Move seeding to randmts.c, common defines in randmt.h.
15086         * gmp-impl.h (RANDS): Use __gmp_randinit_mt_noseed.
15087         * tests/misc.c (tests_rand_start): Use gmp_randinit_default
15088         explicitly, not RANDS.
15090         * mpn/ia64/ia64-defs.m4 (PROLOGUE_cpu): Use 32-byte alignment, for the
15091         benefit of itanium 2.
15092         * mpn/ia64/gcd_1.asm: Remove own .align 32.
15094         * mpn/ia64/ia64-defs.m4 (ALIGN): New define, using IA64_ALIGN_OK.
15095         * mpn/ia64/hamdist.asm: Use ALIGN instead of .align.
15097         * acinclude.m4 (GMP_ASM_IA64_ALIGN_OK): New macro.
15098         * configure.in (IA64_PATTERN): Use it.
15099         * mpn/ia64/README: Add notes on gas big endian align problem.
15101 2003-11-10  Torbjorn Granlund  <tege@swox.com>
15103         * mpn/ia64/mul_1.asm: Rewrite.
15105 2003-11-08  Torbjorn Granlund  <tege@swox.com>
15107         * mpn/x86/aors_n.asm: Align loop to a multiple of 16.  Also align
15108         M4_function_n to a multiple of 16, to minimize alignment padding.
15109         Update P6 cycle counts reflecting improvements with new alignment.
15111 2003-11-07  Kevin Ryde  <kevin@swox.se>
15113         * gmp-impl.h (HAVE_HOST_CPU_alpha_CIX): New define.
15114         (ULONG_PARITY, popc_limb): Use it, to pick up ev7 as well as 67 and 68.
15115         * longlong.h (count_leading_zeros, count_trailing_zeros): Ditto.
15117         * doc/gmp.texi (Notes for Package Builds): Add notes on multi-ABI
15118         system packaging.
15119         (ABI and ISA): Add GNU/Linux ABI=64.
15120         (Binary GCD): Add notes on 1x1 GCD algorithms.
15122         * mpn/alpha/README: Add some literature references.
15124         * mpn/ia64/mode1o.asm: Various corrections to initial checkin.
15125         * mpn/ia64/ia64-defs.m4 (ASSERT): Correction to arg quoting.
15127 2003-11-05  Torbjorn Granlund  <tege@swox.com>
15129         * mpn/powerpc64/linux64.m4: New file.
15130         * configure.in (POWERPC64_PATTERN): Handle *-*-linux*.
15131         Use linux64.m4.
15133         * mpn/ia64/logops_n.asm: New file.
15135 2003-11-05  Kevin Ryde  <kevin@swox.se>
15137         * tune/freq.c (freq_sysctl_hw_model): Relax to just look for "%u MHz",
15138         for the benefit of sparc cypress under netbsd 1.6.1.
15140         * mpfr/*: Update to mpfr-2-0-2-branch 2003-11-05.
15142         * mpn/alpha/ev5/dive_1.c: New file.
15144         * configure.in (x86_64-*-*): Accept together with amd64-*-*.
15146         * tune/speed.c: Check range of -x,-y,-w,-W alignment specifiers.
15147         * tune/speed.h (CACHE_LINE_SIZE): Amend comments.
15149 2003-11-04  Torbjorn Granlund  <tege@swox.com>
15151         * tune/speed.c: Fix typo in testing HAVE_NATIVE_mpn_modexact_1_odd.
15153 2003-11-03  Kevin Ryde  <kevin@swox.se>
15155         * mpn/ia64/hamdist.asm: New file.
15156         * mpn/ia64/mode1o.asm: New file.
15157         * mpn/ia64/ia64-defs.m4 (ASSERT): New macro.
15159         * tests/mpz/t-set_d.c (check_2n_plus_1): New test.
15161 2003-11-01  Kevin Ryde  <kevin@swox.se>
15163         * mpz/fac_ui.c (BSWAP_ULONG) [limb==2*long]: Remove this case, it
15164         provokes code gen problems on HP cc.
15165         (BSWAP_ULONG) [generic]: Rename __dst variable to avoid conflicts with
15166         BITREV_ULONG.
15167         Fix by Jason Moxham.
15169         * mpn/powerpc32/mode1o.asm: Use 16-bit i*i for early out, no need to
15170         truncate divisor.  Amend stated 750/7400 speeds, and note operands
15171         that give the extremes.
15173         * mpz/set_d.c: Don't use a special case for d < MP_BASE_AS_DOUBLE, gcc
15174         3.3 -mpowerpc64 on darwin gets ulonglong->double casts wrong.
15176         * mpn/generic/diveby3.c: Show a better style carry handling in the
15177         alternative pipelined sample code.
15179         Revert this, the longlong.h macros need -mpowerpc64:
15180         * acinclude.m4 (GMP_GCC_POWERPC64): New macro.
15181         * configure.in (powerpc64-*-darwin*): Use it to exclude -mpowerpc64
15182         when bad.
15184 2003-10-31  Torbjorn Granlund  <tege@swox.com>
15186         * mpn/powerpc64/mode64/submul_1.asm: Move an instruction to save a
15187         cycle on POWER4.
15189         * mpn/powerpc64/mode64/divrem_1.asm: Fix several syntax problems
15190         revealed on Mac OS X.
15192         * mpn/powerpc64/mode64/*.asm: Add cycle counts for POWER4.
15194         * mpn/powerpc64/sqr_diagonal.asm: Rewrite to save a cycle on POWER4.
15196 2003-10-31  Kevin Ryde  <kevin@swox.se>
15198         * mpfr/*: Update to mpfr-2-0-2-branch 2003-10-31.
15200         * mpn/powerpc64/README: Add subdirectory organisation notes.
15202         * tests/mpn/t-get_d.c: Don't use limits.h, LONG_MIN is wrong on gcc
15203         2.95 with -mcpu=ultrasparc.
15205         * acinclude.m4 (GMP_GCC_POWERPC64): New macro.
15206         * configure.in (powerpc64-*-darwin*): Use it to exclude -mpowerpc64
15207         when bad.
15209         * configure.in (powerpc64-*-darwin*) [ABI=mode32]: Use gcc -mcpu flags.
15211         * mpn/ia64/divrem_1.asm, mpn/ia64/gcd_1.asm: Use "C" for comments.
15212         * mpn/ia64/README, mpn/ia64/ia64-defs.m4: Note this.
15214         * mpn/ia64/ia64-defs.m4: Renamed from default.m4, per other defs files.
15215         * configure.in (IA64_PATTERN): Update GMP_INCLUDE_MPN.
15217         * doc/gmp.texi (Notes for Particular Systems): Remove m68k ABI notes
15218         for -mshort and PalmOS, now works.
15219         (References): Correction, GMP Square Root proof already there, just
15220         wanting URL from RRRR 4475.
15222 2003-10-29  Kevin Ryde  <kevin@swox.se>
15224         * configure.in (sparc*-*-*): Use gcc -m32 when that option works, to
15225         force 32-bit mode on dual 32/64 configurations like GNU/Linux.
15226         (sparc64-*-linux*): Add support for ABI=64.
15228         * mpn/generic/pre_divrem_1.c: In fraction part, use CNST_LIMB(0) with
15229         udiv_qrnnd_preinv to avoid warning about shift > type.
15231         * mpfr/*: Update to mpfr-2-0-2-branch 2003-10-29.
15233         * tests/cxx/t-istream.cc: Avoid tellg() checks if putback() doesn't
15234         update that, avoids certain g++ 2.96 problems.
15236         * tests/mpn/t-fat.c: New file.
15237         * tests/mpn/Makefile.am (check_PROGRAMS): Add it.
15239         * configure.in (CPUVEC_INSTALL, ITERATE_FAT_THRESHOLDS): New macros
15240         for fat.h.
15241         * mpn/x86/fat/fat.c (__gmpn_cpuvec_init): Use CPUVEC_INSTALL instead
15242         of memcpy.  Correction to location of "initialized" set.  Improve
15243         various comments.
15245 2003-10-27  Torbjorn Granlund  <tege@swox.com>
15247         * mpn/sparc64/mul_1.asm: Change addcc => add in a few places.
15248         * mpn/sparc64/addmul_1.asm: Likewise.
15250         * mpn/sparc32/v9/mul_1.asm: Apply cross-jumping.
15251         * mpn/sparc32/v9/addmul_1.asm: Likewise.
15252         * mpn/sparc32/v9/submul_1.asm: Likewise.
15253         * mpn/sparc32/v9/sqr_diagonal.asm: Likewise.
15255 2003-10-27  Kevin Ryde  <kevin@swox.se>
15257         * tests/cxx/t-misc.cc: Don't use <climits>, on g++ 2.95.4 (debian 3.0)
15258         -mcpu=ultrasparc LONG_MIN is wrong and kills the compile.
15260         * tests/cxx/t-istream.cc: Correction to tellg tests, don't assume
15261         streampos is zero based.
15263         * configure.in (HAVE_HOST_CPU_FAMILY_alpha): New define for config.h.
15264         * mpn/generic/get_d.c: Use it instead of __alpha for alpha workaround,
15265         since Cray cc doesn't define __alpha.
15267         * mpn/x86/README: Revise PIC coding notes a bit, add gcc visibility
15268         attribute.
15270 2003-10-25  Kevin Ryde  <kevin@swox.se>
15272         * mpn/ia64/gcd_1.asm: New file.
15274         * tune/many.pl: Allow for PROLOGUE(fun,...), as used on alpha.
15276         * doc/gmp.texi (C++ Formatted Input): Describe base indicator handling.
15278         * tests/cxx/t-istream.cc: New file.
15279         * tests/cxx/Makefile.am: Add it.
15281         * cxx/ismpznw.cc: New file, integer input without whitespace ...
15282         * cxx/ismpz.cc: ... from here.
15283         * gmp-impl.h (__gmpz_operator_in_nowhite): Add prototype.
15284         * cxx/ismpq.cc: Rewrite using mpz input routines.  Change to accept a
15285         separate base indicator on numerator and denominator.  Fix base
15286         indicator case where "123/0456" would stop at "123/0".
15287         * Makefile.am, cxx/Makefile.am: Add cxx/ismpznw.cc.
15289         * tests/mpz/t-set_d.c: New file, derived from tests/mpz/t-set_si.c
15290         * tests/mpz/Makefile.am (check_PROGRAMS): Add it.
15292         * mpn/m68k/lshift.asm, mpn/m68k/rshift.asm: Support 16-bit int and
15293         stack alignment.
15294         * mpn/m68k/README: Add notes on this.
15295         * configure.in (SIZEOF_UNSIGNED): New define in config.m4.
15296         * mpn/m68k/m68k-defs.m4 (m68k_definsn): Add cmpw, movew.
15297         Reported by Patrick Pelissier.
15299         * mpn/m68k/t-m68k-defs.pl: Don't use -> with hashes, to avoid
15300         deprecation warnings from perl 5.8.
15302         * configure.in (viac3-*-*): Use just x86/pentium in $path not x86/p6.
15303         If gcc is to be believed the old C3s don't have cmov.
15305         * Makefile.am: Amend comments about not building from libtool
15306         convenience libraries.
15308         * mpn/asm-defs.m4 (PROLOGUE): Use m4_file_seen, for correct filename
15309         in missing EPILOGUE error messages.
15310         (m4_file_seen): Amend comments about where used.
15312         * Makefile.am (CXX_OBJECTS): Remove $U, C++ files are not subject to
15313         ansi2knr rules.
15315         * gmp-h.in (mpn_divmod_1): Use __GMP_CAST, to avoid warnings in
15316         applications using g++ -Wold-style-cast.
15318         * mpn/z8000/README: New file.
15320 2003-10-22  Kevin Ryde  <kevin@swox.se>
15322         * mpn/generic/get_d.c (CONST_1024, CONST_NEG_1023,
15323         CONST_NEG_1022_SUB_53): Replace ALPHA_WORKAROUND with a non-gcc-ism,
15324         and use on Cray Unicos alpha too, which has the same problem.
15326         * configure.in (powerpc64-*-darwin*): Make ABI=32 available as the
15327         final fallback, remove mode64 until we know how it will work.
15329         * doc/gmp.texi (Build Options): Add powerpc970 to available CPUs.
15330         (ABI and ISA): Add mode32 for Darwin.
15332         * configure.in (gettimeofday): Use an explicit AC_TRY_LINK, to avoid
15333         known autoconf 2.57 problems with gettimeofday in AC_CHECK_FUNCS on
15334         HP-UX.
15336         * configure.in (powerpc*-*-*): Use ABI=32 instead of ABI=standard for
15337         the default 32-bit ABI.  Fixes powerpc64-*-aix* which is documented as
15338         choices "aix64 32" but had "aix64 standard".
15340         * mpfr/*: Update to mpfr-2-0-2-branch 2003-10-22.
15342         * doc/gmp.texi (Notes for Particular Systems): Note m68k gcc -mshort
15343         and PalmOS calling conventions not supported.  Reported by Patrick
15344         Pelissier.
15345         (References): Add Paul Zimmermann's Inria 4475 paper.
15347 2003-10-21  Torbjorn Granlund  <tege@swox.com>
15349         * mpn/ia64/submul_1.asm: Slightly reschedule loop to accommodate
15350         Itanium 2 getf.sig latency.
15352 2003-10-21  Kevin Ryde  <kevin@swox.se>
15354         * tests/mpn/t-instrument.c: Add mpn_addlsh1_n, mpn_rsh1add_n,
15355         mpn_rsh1sub_n, mpn_sub_nc, mpn_sublsh1_n.  Typo in mpn_preinv_divrem_1
15356         conditional.
15358 2003-10-20  Torbjorn Granlund  <tege@swox.com>
15360         * mpn/powerpc64/mode32/add_n.asm: New file.
15361         * mpn/powerpc64/mode32/sub_n.asm: New file.
15362         * mpn/powerpc64/mode32/mul_1.asm: New file.
15363         * mpn/powerpc64/mode32/addmul_1.asm: New file.
15364         * mpn/powerpc64/mode32/submul_1.asm: New file.
15366 2003-10-19  Torbjorn Granlund  <tege@swox.com>
15368         * longlong.h (AMD64): __x86_64__ => __amd64__.
15369         (64-bit powerpc): Only define carry-dependent macros if
15370         !_LONG_LONG_LIMB.
15372         * acinclude.m4 (POWERPC64_PATTERN): Add powerpc970-*-*.
15374         * configure.in (POWERPC64_PATTERN): Handle *-*-darwin*.
15375         (POWERPC64_PATTERN, *-*-aix*): Prepend powerpc64/mode64 to path_aix64.
15377         * mpn/powerpc64/mode64/mul_1.asm: Change cal => addi.
15378         * mpn/powerpc64/mode64/addmul_1.asm: Likewise.
15379         * mpn/powerpc64/mode64/submul_1.asm: Likewise.
15380         * mpn/powerpc64/sqr_diagonal.asm: Likewise.
15382         * mpn/powerpc64/mode64/mul_1.asm: Move from "..".
15383         * mpn/powerpc64/mode64/addmul_1.asm: Likewise.
15384         * mpn/powerpc64/mode64/submul_1.asm: Likewise.
15385         * mpn/powerpc64/mode64/divrem_1.asm: Likewise.
15386         * mpn/powerpc64/mode64/rsh1sub_n.asm: Likewise.
15387         * mpn/powerpc64/mode64/add_n.asm: Likewise.
15388         * mpn/powerpc64/mode64/addsub_n.asm: Likewise.
15389         * mpn/powerpc64/mode64/sub_n.asm: Likewise.
15390         * mpn/powerpc64/mode64/addlsh1_n.asm: Likewise.
15391         * mpn/powerpc64/mode64/diveby3.asm: Likewise.
15392         * mpn/powerpc64/mode64/rsh1add_n.asm: Likewise.
15393         * mpn/powerpc64/mode64/sublsh1_n.asm: Likewise.
15395         * mpn/powerpc64/lshift.asm: Handle mode32 ABI.
15396         * mpn/powerpc64/rshift.asm: Likewise.
15397         * mpn/powerpc64/umul.asm: Likewise.
15399         * tune/powerpc64.asm: Make it actually work.
15401 2003-10-19  Kevin Ryde  <kevin@swox.se>
15403         * mpn/generic/get_d.c: Add a workaround for alpha gcc signed constant
15404         comparison bug.
15406         * gmpxx.h (gmp_randclass gmp_randinit_lc_2exp_size constructor): Throw
15407         std::length_error if size is too big.
15408         * tests/cxx/t-rand.cc (check_randinit): Exercise this.
15410         * mpn/x86/pentium4/sse2/addlsh1_n.asm: New file, derived in part from
15411         mpn/x86/pentium4/sse2/add_n.asm.
15413         * doc/gmp.texi (C++ Interface Integers, C++ Interface Rationals, C++
15414         Interface Floats): Note std::invalid_argument exception for invalid
15415         strings to constructors and operator=.
15416         (C++ Interface Random Numbers): Note std::length_error exception for
15417         size too big in gmp_randinit_lc_2exp_size.
15419 2003-10-18  Kevin Ryde  <kevin@swox.se>
15421         * mpfr/*: Update to mpfr-2-0-2-branch 2003-10-18.
15423         * gmpxx.h (mpz_class, mpq_class, mpf_class, mpfr_class constructors
15424         and operator= taking string or char*): Throw std::invalid_argument if
15425         string cannot be converted.
15426         * tests/cxx/t-constr.cc, tests/cxx/t-assign.cc: Exercise this.
15428         * cxx/ismpz.cc, cxx/ismpq.cc, cxx/ismpf.cc: Use istream std::locale
15429         ctype facet for isspace when available.  Only accept space at the
15430         start of the input, same as g++ libstdc++.  Use ASSERT_NOCARRY to
15431         check result of mpz_set_str etc.
15432         * cxx/ismpf.cc: Don't accept "@" for exponent indicator.
15434         * tune/speed.c, tune/speed.h, tune/common.c, tune/Makefile.am: Remove
15435         _open and _mpn variants of mpn_toom3_mul_n, only one style now.
15436         * tune/mul_n_open.c, tune/mul_n_mpn.c: Remove files.
15438         * gmp-impl.h (LIMB_HIGHBIT_TO_MASK): New macro.
15439         (udiv_qrnnd_preinv2, udiv_qrnnd_preinv2gen): Use it.
15441         * tests/mpz/t-import.c, tests/mpz/t-export.c: Use octal for character
15442         constants, hex is an ANSI-ism.
15444         * mpn/alpha/ev5/mode1o.c: Corrections to ASSERTs, as per
15445         mpn/generic/mode1o.c.
15447         * mpn/generic/diveby3.c: Add commented out alternative code and notes
15448         for taking the multiply off the dependent chain.  Amend/clarify some
15449         of the other comments.
15451         * configure.in (powerpc970-*-*): Use gcc -mcpu=970 when available.
15452         (powerpc7400-*-*): Fallback on gcc -mcpu=750 if -mcpu=7400 not
15453         available.
15455         * doc/gmp.texi (C++ Formatted Input): Note locale digit grouping not
15456         supported.
15457         (C++ Formatted Input, C++ Formatted Output): Cross reference class
15458         interface on overloading.
15460         * mpn/m68k/README: Add various ideas from doc/tasks.html.
15462         * mpn/m88k/README: New file.
15464 2003-10-16  Torbjorn Granlund  <tege@swox.com>
15466         * config.sub: Recognize powerpc970.
15468 2003-10-15  Torbjorn Granlund  <tege@swox.com>
15470         * config.guess: Recognize powerpc970 under MacOS.
15472 2003-10-15  Kevin Ryde  <kevin@swox.se>
15474         * configure.in, acinclude.m4 (GMP_C_RIGHT_SHIFT): New test.
15475         * gmp-impl.h (LIMB_HIGHBIT_TO_MASK): New macro.
15476         (udiv_qrnnd_preinv2, udiv_qrnnd_preinv2gen): Use it.
15478         * mpn/amd64/amd64-defs.m4: New file, with a non-aligning PROLOGUE.
15479         * configure.in (amd64-*-*): Use it.
15480         * mpn/amd64/addlsh1_n.asm: Add ALIGN(16).
15482         * mpfr/*: Update to mpfr cvs 2003-10-15.
15484         * mpn/generic/get_d.c: Rewrite, simplifying and truncating towards
15485         zero unconditionally.
15486         * tests/mpn/t-get_d.c: Add various further tests.
15487         * gmp-impl.h (FORCE_DOUBLE): New macro.
15489         * gmp-h.in (__mpz_struct): Add comment on __mpz_struct getting into
15490         C++ mangled function names.
15492         * doc/gmp.texi (Build Options): Update notes for new doc subdir.
15493         (Low-level Functions): Note mpn functions don't check for zero limbs
15494         etc, it's up to an application to strip.
15496         * doc/configuration (Configure): mdate-sh now in doc subdir, add
15497         generated fat.h.
15499 2003-10-14  Torbjorn Granlund  <tege@swox.com>
15501         * mpn/ia64/lorrshift.asm: Rewrite.
15503         * mpn/ia64/diveby3.asm: Remove explicit bundling; add branch hints.
15505 2003-10-13  Torbjorn Granlund  <tege@swox.com>
15507         * mpn/ia64/diveby3.asm: New file.
15509 2003-10-13  Kevin Ryde  <kevin@swox.se>
15511         * mpn/powerpc32/mod_34lsub1.asm: New file.
15513         * mpn/powerpc32/diveby3.asm, mpn/powerpc64/diveby3.asm: src[] in
15514         second operand of mullw, to allow possible early-out, which the
15515         0xAA..AB inverse cannot give.  This improvement noticed by Torbjorn.
15517         * acinclude.m4 (GMP_ASM_LSYM_PREFIX): Print to config.log whether
15518         local label is purely temporary or appears in object files, for
15519         development purposes.
15521         * doc/gmp.texi, doc/fdl.texi, doc/texinfo.tex, doc/mdate-sh: Moved
15522         from top-level.
15523         * doc/Makefile.am: New file.
15524         * configure.in (AC_OUTPUT): Add doc/Makefile.
15525         * Makefile.am (SUBDIRS): Move doc subdirectory from EXTRA_DIST.
15526         (info_TEXINFOS, gmp_TEXINFOS): Moved to doc/Makefile.am.
15527         * mpfr/Makefile.am (mpfr_TEXINFOS): fdl.texi now in doc subdir.
15528         (TEXINFO_TEX): texinfo.tex now in doc subdir.
15529         (AM_MAKEINFOFLAGS): Set -I to doc subdir.
15531         * mpz/and.c: For positive/positive, use mpn_and_n, rate a realloc as
15532         UNLIKELY.
15534         * mpn/generic/mul_n.c (mpn_toom3_mul_n, mpn_toom3_sqr_n): Don't test
15535         for high zero limbs.
15537 2003-10-12  Torbjorn Granlund  <tege@swox.com>
15539         * mpn/powerpc64/diveby3.asm: New file (trivial edits of
15540         powerpc32/diveby3.asm).
15542         * mpn/powerpc32/diveby3.asm: Update cycle counts with more processors.
15543         * mpn/powerpc32/sqr_diagonal.asm: Likewise.
15545         * mpn/pa64/add_n.asm: Correct PA8500 cycle counts.
15546         * mpn/pa64/sub_n.asm: Likewise.
15548         * mpn/m68k/aors_n.asm (INPUT PARAMETERS): Fix typo.
15549         * mpn/m68k/lshift.asm: Likewise.
15550         * mpn/m68k/rshift.asm: Likewise.
15552         * mpn/m68k/README: Correct an URL; add some STATUS comments.
15554         * mpn/ia64/aorslsh1_n.asm: Avoid shrp when shl/shr works just as well.
15556         * mpn/powerpc32/addlsh1_n.asm: New file.
15557         * mpn/powerpc32/sublsh1_n.asm: New file.
15559 2003-10-12  Kevin Ryde  <kevin@swox.se>
15561         * mpn/sparc64/divrem_1.c, mpn/sparc64/mod_1.c: New files.
15562         * mpn/sparc64/sparc64.h (HALF_ENDIAN_ADJ, count_leading_zeros_32,
15563         invert_half_limb, udiv_qrnnd_half_preinv): New macros.
15565         * gmp-impl.h (udiv_qrnnd_preinv2): Use a ? : for getting the n1 bit,
15566         so as not to depend on signed right shifts being arithmetic.
15568         * mpn/powerpc32/diveby3.asm: New file.
15570         * mpn/generic/divrem_1.c: Use CNST_LIMB(0) to avoid warnings from
15571         udiv_qrnnd_preinv about shift count when int<long.  Do the same with
15572         udiv_qrnnd, for consistency.
15574         * Makefile.am (install-data-hook): Print a warning recommending "make
15575         check" to watch out for compiler bugs.  Proposed by Torbjorn.
15577         * mpn/ia64/README (mpn_lshift, mpn_rshift): Amend prospective itanium2
15578         speed, 0.75 c/l with shrp plus shl/shr.
15580         * mpn/ia64/popcount.asm: Add comment on optimality.
15582 2003-10-11  Torbjorn Granlund  <tege@swox.com>
15584         * mpn/ia64/rsh1aors_n.asm: New file.
15586         * mpn/asm-defs.m4: Handle rsh1aors_n.
15588         * configure.in (tmp_mulfunc): Handle rsh1aors_n.
15590 2003-10-11  Kevin Ryde  <kevin@swox.se>
15592         * mpn/x86/pentium4/sse2/diveby3.asm: Remove non-PIC RODATA memory
15593         access for 0xAAAAAAAB constant.
15595         * gmp-impl.h (popc_limb, ULONG_PARITY) [ev67, ev68]: Add gcc asm
15596         versions using ctpop.
15598         * mpn/x86/k6/aorsmul_1.asm: Tweak some comments, remove M4_description
15599         and M4_desc_retval used only in comments.
15601         * mpn/x86/k6/mul_basecase.asm: Add comment on using mpn_mul_1.
15603 2003-10-09  Torbjorn Granlund  <tege@swox.com>
15605         * mpn/powerpc64/addlsh1_n.asm: Tweak for 0.25 c/l better loop speed.
15606         * mpn/powerpc64/sublsh1_n.asm: Likewise.
15608 2003-10-09  Kevin Ryde  <kevin@swox.se>
15610         * mpfr/*: Update to mpfr cvs 2003-10-09.
15612         * tests/devel/try.c (_SC_PAGESIZE): Define from _SC_PAGE_SIZE on
15613         systems which use that, eg. hpux 9.
15615 2003-10-07  Kevin Ryde  <kevin@swox.se>
15617         * tune/freq.c (freq_sysctl_hw_model): Correction to last sscanf change.
15619         * configure.in: Check for psp_iticksperclktick in struct pst_processor.
15620         * tune/freq.c (freq_pstat_getprocessor): Use this.
15622         * tests/devel/try.c (divisor_array): Add a couple of half-limb values.
15624         * acinclude.m4 (GMP_PROG_CC_WORKS): Correction to last change, need to
15625         set result "yes" when cross compiling.
15627 2003-10-06  Torbjorn Granlund  <tege@swox.com>
15629         * mpn/generic/mul_n.c: Use __GMPN_ADD_1/_GMPN_SUB_1 instead of
15630         mpn_add_1 and mpn_sub_1.
15632         * mpn/pa64/aorslsh1_n.asm: Schedule register save and restore code.
15634 2003-10-05  Torbjorn Granlund  <tege@swox.com>
15636         * mpn/pa64/mul_1.asm: Misc comment cleanups.
15637         * mpn/pa64/addmul_1.asm: Likewise.
15638         * mpn/pa64/submul_1.asm: Likewise.
15640         * mpn/pa64/README: Correct cycle counts.
15642         * mpn/pa64/aorslsh1_n.asm: New file.
15644 2003-10-04  Kevin Ryde  <kevin@swox.se>
15646         * tune/freq.c (freq_sysctl_hw_model, freq_sunos_sysinfo,
15647         freq_sco_etchw, freq_bsd_dmesg, freq_irix_hinv): Demand matching of
15648         MHz etc at end of sscanf format string.  In particular need this for
15649         freq_bsd_dmesg on i486-pc-freebsd4.7 to avoid the 486 cpu being used
15650         for the frequency.
15652         * tests/misc.c, tests/tests.h (tests_setjmp_sigfpe,
15653         tests_sigfpe_handler, tests_sigfpe_done, tests_sigfpe_target,
15654         tests_dbl_mant_bits): New.
15656         * configure.in (viac3*-*-*): Add gcc VIA c3 options.
15658         * mpfr/*: Update to mpfr cvs 2003-10-04.
15660         * tests/refmpn.c (refmpn_addlsh1_n, refmpn_sublsh1_n,
15661         refmpn_rsh1add_n, refmpn_rsh1sub_n): Add ASSERTs for operand overlaps.
15662         * tests/tests.h (refmpn_addlsh1_n, refmpn_sublsh1_n, refmpn_rsh1add_n,
15663         refmpn_rsh1sub_n): Add prototypes.
15665         * tests/devel/try.c, tune/many.pl: Add mpn_addlsh1_n, mpn_sublsh1_n,
15666         mpn_rsh1add_n, mpn_rsh1sub_n.
15668 2003-10-03  Torbjorn Granlund  <tege@swox.com>
15670         * tests/refmpn.c (refmpn_addlsh1_n, refmpn_sublsh1_n, refmpn_rsh1add_n,
15671         refmpn_rsh1sub_n): New functions.
15673 2003-10-03  Paul Zimmermann  <Paul.Zimmermann@loria.fr>
15675         * mpn/generic/mul_n.c (toom3_interpolate): Use mpn_add_1/mpn_sub_1
15676         instead of MPN_INCR_/MPN_DECR_U.
15678 2003-10-02  Torbjorn Granlund  <tege@swox.com>
15680         * configure.in (ia64*-*-hpux*): Fall back to +O1, not +O.
15682 2003-10-02  Kevin Ryde  <kevin@swox.se>
15684         * configure.in (ia64*-*-hpux*): For cc, let +O optimization level
15685         fallback if +O3 doesn't work.
15687         * acinclude.m4 (GMP_PROG_CC_WORKS): Add a test of __builtin_alloca
15688         when available, to pick up Itanium HP-UX cc internal errors in +O2.
15689         Provoking code by Torbjorn.
15691 2003-10-01  Torbjorn Granlund  <tege@swox.com>
15693         * mpn/ia64/gmp-mparam.h: Retune.
15695         * mpn/asm-defs.m4: Handle aorslsh1_n.
15697         * configure.in (tmp_mulfunc): Handle aorslsh1_n.
15699         * mpn/ia64/aorslsh1_n.asm: New file.
15701         * mpn/ia64/aors_n.asm: New file, complete rewrite of mpn_add_n and
15702         mpn_sub_n.
15703         * mpn/ia64/add_n.asm: Replace by aors_n.asm.
15704         * mpn/ia64/sub_n.asm: Replace by aors_n.asm.
15706 2003-10-01  Kevin Ryde  <kevin@swox.se>
15708         * acinclude.m4 (GMP_C_DOUBLE_FORMAT): Make bad ARM last byte into a
15709         separate case and consider it non-IEEE, since it looks like this is
15710         due to some sort of restricted or incorrect software floats.
15712         * demos/calc/Makefile.am: Use automake yacc/lex support, seems fine in
15713         separate objdir now.
15715         * cxx/dummy.cc: Moved from top-level dummy.cc.
15716         * Makefile.am (libgmpxx_la_SOURCES): Update to cxx/dummy.cc,
15717         correction to comment about this.
15719 2003-09-30  Torbjorn Granlund  <tege@swox.com>
15721         * demos/pexpr.c: Correct documentation of -split.
15722         (TIME): Remove cast of result to double.
15723         (main): Change timing variables to int.
15724         (main): #ifdef LIMIT_RESOURCE_USAGE, don't convert numbers of more than
15725         100000 digits.
15727 2003-09-28  Torbjorn Granlund  <tege@swox.com>
15729         * mpn/*/*.asm: Clean up spacing, tabify.
15731         * mpn/alpha/rshift.asm: Table cycle counts.
15732         * mpn/alpha/lshift.asm: Likewise.
15733         * mpn/alpha/ev5/rshift.asm: Likewise.
15734         * mpn/alpha/ev5/lshift.asm: Likewise.
15735         * mpn/alpha/ev6/add_n.asm: Likewise.
15736         * mpn/alpha/ev6/sub_n.asm: Likewise.
15738         * mpn/ia64/lorrshift.asm: Amend comments about performance.
15740         * mpn/pa64/mul_1.asm: Fix comment typo.
15741         * mpn/pa64/addmul_1.asm: Likewise.
15742         * mpn/pa64/submul_1.asm: Likewise.
15744         * mpn/amd64/addlsh1_n.asm: Save/restore carry using two insn to break
15745         recurrency.  Add remarks about possible further speedup.
15746         * mpn/amd64/sublsh1_n.asm: Likewise.
15748         * mpn/amd64/rsh1add_n.asm: Add remarks about possible further speedup.
15749         * mpn/amd64/rsh1sub_n.asm: Likewise.
15751 2003-09-27  Torbjorn Granlund  <tege@swox.com>
15753         * mpn/powerpc64/README: Update with POWER4/PPC970 pipeline info.
15755         * mpn/powerpc64/rsh1add_n.asm: New file.
15756         * mpn/powerpc64/rsh1sub_n.asm: New file.
15757         * mpn/powerpc64/rshift.asm: Rewrite.
15758         * mpn/powerpc64/lshift.asm: Rewrite.
15760 2003-09-26  Torbjorn Granlund  <tege@swox.com>
15762         * mpn/powerpc64/addlsh1_n.asm: New file.
15763         * mpn/powerpc64/sublsh1_n.asm: New file.
15765 2003-09-25  Torbjorn Granlund  <tege@swox.com>
15767         * tune/common.c (speed_mpn_addlsh1_n, speed_mpn_sublsh1_n,
15768         speed_mpn_rsh1add_n, speed_mpn_rsh1sub_n): Conditionalize on
15769         corresponding HAVE_NATIVE_*.
15771 2003-09-25  Kevin Ryde  <kevin@swox.se>
15773         * mpz/combit.c: Use GMP_NUMB_BITS not BITS_PER_MP_LIMB.
15775         * demos/expr/exprfr.c: Allow for mpfr_inf_p, mpfr_nan_p and
15776         mpfr_number_p merely returning non-zero, rather than 1 or 0.
15778         * demos/expr/exprfr.c, demos/expr/t-expr.c: Add erf, integer_p, zeta.
15780         * demos/expr/Makefile.am (LDADD): Update comments on $(LIBM).
15782 2003-09-24  Torbjorn Granlund  <tege@swox.com>
15784         * tune/speed.c (routine): Add entries for mpn_addlsh1_n, mpn_sublsh1_n,
15785         mpn_rsh1add_n, and mpn_rsh1sub_n.
15787         * tune/speed.h: Declare speed_mpn_addlsh1_n, speed_mpn_sublsh1_n,
15788         speed_mpn_rsh1add_n, and speed_mpn_rsh1sub_n.
15790         * tune/common.c (speed_mpn_addlsh1_n, speed_mpn_sublsh1_n,
15791         speed_mpn_rsh1add_n, speed_mpn_rsh1sub_n): New functions.
15793         * gmp-impl.h: Declare mpn_addlsh1_n, mpn_sublsh1_n, mpn_rsh1add_n, and
15794         mpn_rsh1sub_n.
15796         * mpn/asm-defs.m4: Add define_mpn's for addlsh1_n, sublsh1_n,
15797         rsh1add_n, and rsh1sub_n.
15799         * mpn/powerpc64/*.asm: Add cycle counts in consistent style.  Misc
15800         styling edits.
15802         * mpn/amd64/gmp-mparam.h: Retune.
15804         * configure.in: Add #undefs for HAVE_NATIVE_mpn_addlsh1_n,
15805         HAVE_NATIVE_mpn_sublsh1_n, HAVE_NATIVE_mpn_rsh1add_n,
15806         HAVE_NATIVE_mpn_rsh1sub_n.
15807         (gmp_mpn_functions_optional): List addlsh1_n, sublsh1_n, rsh1add_n,
15808         and rsh1sub_n.
15810         * mpn/amd64/addlsh1_n.asm: New file.
15811         * mpn/amd64/sublsh1_n.asm: New file.
15812         * mpn/amd64/rsh1add_n.asm: New file.
15813         * mpn/amd64/rsh1sub_n.asm: New file.
15815 2003-09-24  Kevin Ryde  <kevin@swox.se>
15817         * mpfr/*: Update to mpfr cvs 2003-09-24.
15819         * acinclude.m4 (GMP_C_DOUBLE_FORMAT): Remove conftest* temporary files.
15821 2003-09-23  Torbjorn Granlund  <tege@swox.com>
15823         * gmp-impl.h (MUL_TOOM3_THRESHOLD, SQR_TOOM3_THRESHOLD): Now 128.
15825 2003-09-23  Kevin Ryde  <kevin@swox.se>
15827         * gmp-h.in (gmp_randinit_set): Use __gmp_const rather than const.
15829 2003-09-22  Torbjorn Granlund  <tege@swox.com>
15831         * tune/mul_n_mpn.c: (__gmpn_sqr_n): New #define.
15832         * tune/mul_n_open.c (__gmpn_sqr_n): New #define.
15834         * mpn/generic/mul.c (mpn_sqr_n): Move from here...
15835         * mpn/generic/mul_n.c (mpn_sqr_n): ...to here.
15836         (mpn_sqr_n): Allocate workspace for toom3 using TMP_* mechanism except
15837         for very large operands when !WANT_FFT.
15839         * mpn/generic/mul_n.c: Add a missing ";". Misc comment fixes.
15841         * mpn/generic/mul.c: Remove spurious #include <stdio.h>.
15843         * mpn/x86/k7/gmp-mparam.h: Retune.
15845         * mpn/generic/mul_n.c (mpn_mul_n): Allocate workspace for toom3 using
15846         TMP_* mechanism except for very large operands when !WANT_FFT.
15848         * gmp-impl.h (MPN_TOOM3_MUL_N_TSIZE, MPN_TOOM3_SQR_N_TSIZE):
15849         Define conditionally on WANT_FFT and HAVE_NATIVE_mpn_sublsh1_n.
15850         (MPN_TOOM3_MAX_N): New #define.
15852         * mpn/amd64/gmp-mparam.h: Retune.
15854         * mpn/Makefile.am (TARG_DIST): Add amd64.
15856         * mpn/generic/sqr_basecase.c: Use mpn_addlsh1_n when available.
15858         * mpn/generic/mul_n.c: Use proper form for HAVE_NATIVE macros.
15860 2003-09-22  Kevin Ryde  <kevin@swox.se>
15862         * mpfr/*: Update to mpfr cvs 2003-09-22.
15864 2003-09-21  Kevin Ryde  <kevin@swox.se>
15866         * mpn/x86/pentium4/sse2/gmp-mparam.h (USE_PREINV_DIVREM_1,
15867         USE_PREINV_MOD_1): Set to 1 for new asm versions.
15869         * mpfr/*: Update to mpfr cvs 2003-09-21.
15871 2003-09-21  Paul Zimmermann  <Paul.Zimmermann@loria.fr>
15873         * mpn/generic/mul_n.c (mpn_toom3_mul_n): Conditionally use
15874         mpn_sublsh1_n, mpn_rsh1add_n and mpn_rsh1sub_n, in addition to
15875         mpn_addlsh1_n.  Avoid all copying, at the expense of some additional
15876         workspace.
15878         * gmp-impl.h (MPN_TOOM3_MUL_N_TSIZE, MPN_TOOM3_SQR_N_TSIZE): Accommodate
15879         latest toom3 code.
15881 2003-09-19  Kevin Ryde  <kevin@swox.se>
15883         * mpn/x86/pentium4/sse2/divrem_1.asm, mpn/x86/pentium4/sse2/mod_1.asm:
15884         New files.
15886 2003-09-16  Kevin Ryde  <kevin@swox.se>
15888         * tune/speed.c (run_one): Don't scale the -1.0 not-available return.
15889         Print "n/a" for times not-available.
15891 2003-09-13  Paul Zimmermann  <Paul.Zimmermann@loria.fr>
15893         * mpn/generic/mul_n.c (toom3_interpolate): New function.
15894         (mpn_toom3_mul_n, mpn_toom3_sqr_n): Call toom3_interpolate.
15896 2003-09-12  Torbjorn Granlund  <tege@swox.com>
15898         * mpn/generic/mul_n.c (mpn_toom3_mul_n, mpn_toom3_sqr_n): Remove unused
15899         variables.
15900         (mpn_toom3_mul_n, mpn_toom3_sqr_n): Use offset `+ 1', not `+ 2' in last
15901         MPN_DECR_U calls.
15903 2003-09-12  Paul Zimmermann  <Paul.Zimmermann@loria.fr>
15905         * mpn/generic/mul_n.c (mpn_toom3_mul_n, mpn_toom3_sqr_n): Rewrite.
15907 2003-09-12  Torbjorn Granlund  <tege@swox.com>
15909         * gmp-impl.h (MPN_KARA_MUL_N_TSIZE, MPN_KARA_SQR_N_TSIZE): Reformulate
15910         to use the same form as MPN_TOOM3_MUL_N_TSIZE.
15911         (MPN_TOOM3_MUL_N_TSIZE, MPN_TOOM3_SQR_N_TSIZE): Update for new Toom3
15912         code requirements.
15913         * mpn/generic/mul_n.c (evaluate3, interpolate3, add2Times): Remove.
15914         (USE_MORE_MPN): Remove.
15916 2003-08-31  Kevin Ryde  <kevin@swox.se>
15918         * mpfr/*: Update to mpfr cvs 2003-08-31.
15920 2003-08-30  Kevin Ryde  <kevin@swox.se>
15922         * mpfr/*: Update to mpfr cvs 2003-08-30.
15924 2003-08-29  Torbjorn Granlund  <tege@swox.com>
15926         * mpn/amd64/copyi.asm: New file.
15927         * mpn/amd64/copyd.asm: New file.
15928         * mpn/amd64/README: New file.
15930 2003-08-28  Torbjorn Granlund  <tege@swox.com>
15932         * mpn/amd64/lshift.asm: New file.
15933         * mpn/amd64/rshift.asm: New file.
15934         * mpn/amd64/gmp-mparam.h: Retune.
15936 2003-08-23  Kevin Ryde  <kevin@swox.se>
15938         * tune/freq.c (freq_getsysinfo): Correction to speed_cycletime value
15939         established.
15941         * mpz/rootrem.c, gmp-h.in, gmp.texi (mpz_rootrem): Don't return
15942         exactness indication, can get that from testing the remainder.
15944         * mpn/x86/k7/aors_n.asm, mpn/x86/k7/mmx/copyi.asm: Amend to comments
15945         about loads and stores and what speed should be possible.
15947 2003-08-22  Torbjorn Granlund  <tege@swox.com>
15949         * mpn/amd64/add_n.asm: New file.
15950         * mpn/amd64/sub_n.asm: New file.
15951         * mpn/amd64/mul_1.asm: New file.
15952         * mpn/amd64/addmul_1.asm: New file.
15953         * mpn/amd64/submul_1.asm: New file.
15955 2003-08-19  Kevin Ryde  <kevin@swox.se>
15957         * longlong.h (add_ssaaaa, sub_ddmmss) [hppa 64]: Move down into main
15958         __GNUC__ block.  Exclude for _LONG_LONG_LIMB (ie. ABI=2.0n) since
15959         these forms are only for ABI=2.0w.
15961         * longlong.h (count_leading_zeros) [__mcpu32__]: Check __mcpu32__ to
15962         avoid bfffo on GCC 3.4 in CPU32 mode.  Reported by Bernardo Innocenti.
15964         * longlong.h (count_trailing_zeros) [x86_64]: Use "%q0" to force
15965         64-bit register destination.  Pointed out by Torbjorn.
15967         * mpz/combit.c: Correction to carry handling when extending a
15968         negative, and use __GMPN_ADD_1.  Correction to complement limb for a
15969         negative when there's a non-zero low limb.
15970         * tests/mpz/bit.c (check_clr_extend, check_com_negs): Exercise these.
15972         * demos/perl/GMP.xs, demos/perl/GMP.pm, demos/perl/test.pl: Add
15973         get_d_2exp.
15974         * demos/perl/GMP.xs, demos/perl/GMP.pm, demos/perl/GMP/Rand.pm,
15975         demos/perl/test.pl: Add gmp_urandomb_ui, gmp_urandomm_ui.
15976         (GMP::Rand::randstate): Accept a randstate object to copy.
15977         * demos/perl/GMP.xs, demos/perl/GMP.pm, demos/perl/GMP/Mpz.pm,
15978         demos/perl/test.pl: Add combit, rootrem.
15980 2003-08-19  Torbjorn Granlund  <tege@swox.com>
15982         * tune/Makefile.am (EXTRA_DIST): Add amd64.asm.
15984 2003-08-17  Kevin Ryde  <kevin@swox.se>
15986         * gmpxx.h [__MPFR_H]: Include full <iostream> for inlines.
15987         * tests/cxx/t-headfr.cc: New file, exercising this.
15988         * tests/cxx/Makefile.am: Add it.
15990         * tests/cxx/t-constr.cc: Include config.h for WANT_MPFR.
15992         * gmpxx.h: Correction to temp variable type in mpf -> mpfr assignment.
15993         Reported by Derrick Bass.
15994         * tests/cxx/t-assign.cc (check_mpfr): Exercise this.
15996         * configure.in (WANT_MPFR): AC_DEFINE this, for the benefit of
15997         tests/cxx/t-*.cc.  (Was always meant to have been defined.)
15998         * tests/cxx/Makefile.am (INCLUDES): Add -I$(top_srcdir)/mpfr.
16000         * gmpxx.h: __gmp_default_rounding_mode -> __gmpfr_default_rounding_mode
16001         (struct __gmp_hypot_function): Correction to mpfr_hypot addition.
16002         * tests/cxx/t-misc.cc (check_mpfr_hypot): Corrections to mpfr/long
16003         tests.
16005 2003-08-16  Torbjorn Granlund  <tege@swox.com>
16007         * configure.in (amd64): New.
16009         * mpn/amd64/gmp-mparam.h: New file.
16011         * tune/amd64.asm: New file, derived in part from tune/pentium.asm.
16013 2003-08-15  Kevin Ryde  <kevin@swox.se>
16015         * tune/freq.c (freq_irix_hinv): Reinstate, for the benefit of IRIX 6.2.
16016         (freq_attr_get_invent): Conditionalize on INFO_LBL_DETAIL_INVENT too.
16018 2003-08-14  Kevin Ryde  <kevin@swox.se>
16020         * mpq/get_d.c: Use mpn_get_d.
16021         * tests/mpq/t-get_d.c (check_onebit): New test.
16023         * gmp.texi (Notes for Particular Systems): Under x86 cpu types, note
16024         i386 is a fat binary, remove pentium4 recommendation since i386 is now
16025         quite reasonable for p4.
16026         (Notes for Particular Systems): Under Windows DLLs, remove caveat
16027         about --enable-cxx now ok, update .lib creation for new libtool,
16028         remove .exp not needed for MS C.
16029         (Notes for Package Builds): i386 is a fat binary.
16030         (Reentrancy): Remove SCO ctype.h note, don't want to list every system
16031         misfeature, and was quite possibly for non-threading mode anyway.
16032         (Autoconf): Remove notes on gmp 2 detection, too old to want to
16033         encourage anyone to use.
16034         (Karatsuba Multiplication): Correction to threshold increase/decrease
16035         for a and b terms.  Reported by Richard Brent and Paul Zimmermann.
16036         Also add various further index entries.
16038         * tune/freq.c (freq_attr_get_invent): New function.
16039         (freq_irix_hinv): Remove, in favour or freq_attr_get_invent.
16040         * configure.in (AC_CHECK_FUNCS): Add attr_get.
16041         (AC_CHECK_HEADERS): Add invent.h, sys/attributes.h, sys/iograph.h.
16043 2003-08-03  Kevin Ryde  <kevin@swox.se>
16045         * tune/tuneup.c (tune_mul): Use MUL_KARATSUBA_THRESHOLD_LIMIT.
16047 2003-08-02  Kevin Ryde  <kevin@swox.se>
16049         * mpn/asm-defs.m4: Tweak some comments, add hpux11 to m4wrap 0xFF
16050         problem systems.
16052         * configure.in (*-*-sco3.2v5*): Remove lt_cv_archive_cmds_need_lc=no,
16053         since libtool no longer uses it.  This was a workaround fixing ctype.h
16054         in SCO 5 shared libraries; not sure if libtool now gets it right on
16055         its own, let's hope so.
16057         * configure.in, acinclude.m4 (GMP_PROG_HOST_CC): Remove, libtool no
16058         longer demands HOST_CC.
16060         * configure.in: When C or C++ compiler not found, refer user to
16061         config.log.
16063         * configure.in (i386-*-*): Turn i386 into a fat binary build.
16064         * mpn/x86/fat/fat.c, mpn/x86/fat/fat_entry.asm,
16065         mpn/x86/fat/gmp-mparam.h, mpn/x86/fat/gcd_1.c, mpn/x86/fat/mode1o.c:
16066         New files.
16067         * gmp-impl.h (struct cpuvec_t) [x86 fat]: New structure.
16068         * longlong.h (COUNT_LEADING_ZEROS_NEED_CLZ_TAB) [x86 fat]: Define.
16069         * mpn/asm-defs.m4 (foreach): New macro.
16070         * mpn/x86/x86-defs.m4 (CPUVEC_FUNCS_LIST): New define.
16071         * mpn/x86/sqr_basecase.asm: New file, primarily as a fallback for fat
16072         binaries.
16073         * mpn/x86/p6/gmp-mparam.h, mpn/x86/p6/mmx/gmp-mparam.h: Add comments
16074         about fat binary SQR_KARATSUBA_THRESHOLD for p6 and p6/mmx.
16076         * configure.in: Add various supports for fat binaries, via fat_path,
16077         fat_functions and fat_thresholds variables.
16078         * acinclude.m4 (GMP_STRIP_PATH): Mung $fat_path too.
16079         (GMP_FAT_SUFFIX, GMP_REMOVE_FROM_LIST): New macros.
16080         * gmp-impl.h: Add various supports for fat binaries.
16081         (DECL_add_n etc): New macros.
16082         (mpn_mul_basecase etc): Define only if not already defined.
16083         * mpn/asm-defs.m4 (m4_config_gmp_mparam): Mention fat binary.
16084         (MPN): Use m4_unquote, for the benefit of fat binary name expansion.
16085         * doc/configuration: Notes on fat binaries.
16086         * gmp-impl.h (MUL_TOOM3_THRESHOLD_LIMIT): Define always.
16087         (MUL_KARATSUBA_THRESHOLD_LIMIT): New define.
16088         * mpn/generic/mul.c, mpn/generic/mul_n.c: Use these.
16089         * tune/divrem1div.c, tune/divrem1inv.c, tune/mod_1_div.c,
16090         tune/mod_1_inv.c: Define OPERATION_divrem_1 and OPERATION_mod_1, to
16091         tell fat.h what's being done.
16093         * config.guess (alpha-*-*): Update comments on what configfsf.guess
16094         does and doesn't do for us.
16096 2003-07-31  Kevin Ryde  <kevin@swox.se>
16098         * config.guess: Remove $dummy.o files everywhere, in case vendor
16099         compilers produce that even when not asked.
16101         * demos/perl/GMP.xs (class_or_croak): Rename "class" parameter to
16102         avoid C++ keyword.
16103         (coerce_ulong, coerce_long): Move croaks to stop g++ 3.3 complaining
16104         about uninitialized variables.
16106         * demos/perl/INSTALL: Add notes on building with a DLL.
16108         * longlong.h (count_trailing_zeros) [x86_64]: Ensure bsfq destination
16109         is a 64-bit register.  Diagnosed by Francois G. Dorais.
16111 2003-07-31  Torbjorn Granlund  <tege@swox.com>
16113         * longlong.h [ppc]: Remove nested test for vxworks.
16115 2003-07-24  Kevin Ryde  <kevin@swox.se>
16117         * gmpxx.h (struct __gmp_binary_multiplies): Use mpz_mul_si for
16118         mpz*long and long*mpz.
16119         * tests/cxx/t-ops.cc (check_mpz): Exercise mpz*long and mpz*ulong.
16121         * cxx/ismpf.cc: Use std::locale decimal point when available.  Expect
16122         localeconv available always.
16123         * tests/cxx/t-locale.cc: Enable check_input tests.
16125         * gmpxx.h (struct __gmp_hypot_function): Use mpfr_hypot.
16126         * tests/cxx/t-misc.cc (check_mpfr_hypot): New tests.
16128         * tests/cxx/t-assign.cc, tests/cxx/t-binary.cc, tests/cxx/t-ops.cc,
16129         tests/cxx/t-prec.cc, tests/cxx/t-ternary.cc, tests/cxx/t-unary.cc:
16130         Include config.h for WANT_MPFR.
16132         * tests/mpz/bit.c (check_single): Correction to a diagnostic print.
16134 2003-07-24  Niels Möller  <nisse@lysator.liu.se>
16136         * mpz/combit.c: New file.
16137         * Makefile.am, mpz/Makefile.am: Add it.
16138         * gmp-h.in (mpz_combit): Add prototype.
16139         * tests/mpz/bit.c (check_single): Exercise mpz_combit.
16141 2003-07-16  Kevin Ryde  <kevin@swox.se>
16143         * mpn/generic/get_d.c: Correction to infinity handling for large exp.
16145 2003-07-14  Kevin Ryde  <kevin@swox.se>
16147         * mpz/get_d.c, mpz/get_d_2exp.c, mpf/get_d.c, mpf/get_d_2exp.c: Use
16148         mpn_get_d.
16150         * mpn/generic/get_d.c: New file, based on mpz/get_d.c and insert-dbl.c.
16151         * configure.in, mpn/Makefile.am: Add it.
16152         * gmp-impl.h (mpn_get_d): Add prototype.
16154         * tests/mpn/t-get_d.c: New file.
16155         * tests/mpn/Makefile.am: Add it.
16157         * tests/mpz/t-get_d_2exp.c (check_onebit, check_round): Test negatives.
16158         (check_onebit): Add a few more bit sizes.
16160         * tests/misc.c, tests/tests.h (tests_isinf): New function.
16162 2003-07-12  Kevin Ryde  <kevin@swox.se>
16164         * configure.in (GMP_PROG_CXX_WORKS): Include $CPPFLAGS, same as
16165         automake does in the actual build.
16167         * acinclude.m4 (GMP_PROG_CXX_WORKS): In the namespace test, declare
16168         namespace before trying to use.  In std iostream test, provoke a
16169         failure from Compaq C++ in pre-standard mode.
16171 2003-07-08  Kevin Ryde  <kevin@swox.se>
16173         * acinclude.m4 (GMP_PROG_CC_WORKS): Use separate compiles for various
16174         known problems, and indicate to the user the reason for rejecting.
16175         (GMP_PROG_CXX_WORKS): Ditto, and insist on being able to execute each
16176         compiled program.
16178 2003-07-05  Kevin Ryde  <kevin@swox.se>
16180         * config.sub: Add comments to our alias transformations.
16182         * configfsf.sub, configfsf.guess: Update to 2003-07-04.
16184         * acinclude.m4 (GMP_PROG_CC_WORKS, GMP_PROG_CC_WORKS_LONGLONG): Show
16185         failing program in config.log, per other autoconf tests.
16187         * configure.in (i786-*-*): Recognise as pentium4, per configfsf.sub.
16189 2003-06-28  Kevin Ryde  <kevin@swox.se>
16191         * mpz/get_d_2exp.c, mpf/get_d_2exp.c: Avoid res==1.0 when floats round
16192         upwards.
16194         * tests/mpz/t-get_d_2exp.c: New file.
16195         * tests/mpz/Makefile.am (check_PROGRAMS): Add it.
16196         * tests/mpf/t-get_d_2exp.c: New file.
16197         * tests/mpf/Makefile.am (check_PROGRAMS): Add it.
16198         * tests/x86call.asm, test/tests.h (x86_fldcw, x86_fstcw): New
16199         functions.
16200         * tests/misc.c, tests/tests.h (tests_hardware_getround,
16201         tests_hardware_setround): New functions.
16203 2003-06-25  Kevin Ryde  <kevin@swox.se>
16205         * mpn/sparc64/dive_1.c: New file.
16207         * mpn/sparc64/sparc64.h: New file.
16208         * mpn/sparc64/mode1o.c: Remove things now in sparc64.h.
16210         * mpfr/*: Update to mpfr cvs 2003-06-25.
16212         * acinclude.m4 (GMP_PROG_CC_WORKS): In last change provoking gnupro
16213         gcc, don't use ANSI style function definition.
16215 2003-06-22  Kevin Ryde  <kevin@swox.se>
16217         * mpn/pa32/hppa1_1/udiv.asm: Remove .proc, .entry, .exit and .procend,
16218         handled by PROLOGUE and EPILOGUE.  Comment out .callinfo, per other
16219         asm files.
16221         * gmpxx.h (mpz_class __gmp_binary_divides, __gmp_binary_modulus): Fix
16222         long/mpz and long%mpz for dividend==LONG_MIN divisor==-LONG_MIN.
16223         (mpz_class __gmp_binary_modulus): Fix mpz%long for negative dividend.
16224         * tests/cxx/t-ops.cc (check_mpz): Add test cases for these, merging
16225         operator/ and operator% sections for clarity.
16227 2003-06-21  Kevin Ryde  <kevin@swox.se>
16229         * mpfr/*: Update to mpfr cvs 2003-06-21.
16231         * acinclude.m4 (GMP_PROG_CC_WORKS): Add code by Torbjorn provoking an
16232         ICE from gcc 2.9-gnupro-99r1 under -O2 -mcpu=ev6.
16233         * configure.in (alpha*-*-* gcc_cflags_cpu): Fallback on -mcpu=ev56 for
16234         this compiler.
16236         * gmpxx.h (get_d): Remove comments about long double, double is
16237         correct for get_d, a future long double form would be get_ld.
16239 2003-06-19  Kevin Ryde  <kevin@swox.se>
16241         * mpfr/*: Update to mpfr cvs 2003-06-19.
16243         * mpn/generic/dive_1.c: Share src[0] fetch among all cases.  No need
16244         for separate final umul_ppmm in even case, make it part of the loop.
16246         * mpz/get_d_2exp.c, mpq/set_si.c, mpq/set_ui.c: Nailify.
16248         * mpf/iset_si.c: Rewrite using mpf/set_si.c code, in particular this
16249         nailifies it.
16250         * tests/mpf/t-set_si.c: Nailify tests.
16252         * mpf/iset_ui.c: Nailify, as per mpf/set_ui.c
16253         * tests/mpf/t-set_ui.c: New file.
16254         * tests/mpf/Makefile.am (check_PROGRAMS): Add it.
16256 2003-06-15  Kevin Ryde  <kevin@swox.se>
16258         * mpfr/*: Update to mpfr cvs 2003-06-15.
16260         * mpn/x86/k6/mode1o.asm: Remove a bogus ASSERT.
16262 2003-06-12  Kevin Ryde  <kevin@swox.se>
16264         * configure.in (--enable-assert): Emit WANT_ASSERT to config.m4.
16265         * mpn/powerpc32/powerpc-defs.m4, mpn/x86/x86-defs.m4 (ASSERT): Check
16266         WANT_ASSERT is defined.
16268         * mpn/sparc32/v9/udiv.asm: Amend heading, this file is for sparc v9.
16270         * tests/cxx/Makefile.am (TESTS_ENVIRONMENT): In libtool openbsd hack,
16271         discard error messages from cp, for the benefit of --disable-shared or
16272         systems not using names libgmp.so.*.
16274         * tests/devel/try.c (try_one): When overlapping, copy source data
16275         after filling dst.  Previously probably used only DEADVAL in
16276         overlapping cases.
16278 2003-06-11  Torbjorn Granlund  <tege@swox.com>
16280         * mpf/random2.c: Rewrite.  Ignore sign of exp parameter.
16282 2003-06-10  Kevin Ryde  <kevin@swox.se>
16284         * mpn/sparc64/mode1o.c: New file.
16286 2003-06-09  Torbjorn Granlund  <tege@swox.com>
16288         * mpn/powerpc32/lshift.asm: Add more cycle counts.
16289         * mpn/powerpc32/rshift.asm: Add more cycle counts.
16291         * mpn/ia64/addmul_1.asm: Reformat comments for 80 columns.
16293         * gmp-impl.h (udiv_qrnnd_preinv1): New name for udiv_qrnnd_preinv.
16294         (udiv_qrnnd_preinv2): New name for udiv_qrnnd_preinv2norm.
16295         (udiv_qrnnd_preinv): New #define, making udiv_qrnnd_preinv2
16296         the default.
16297         * tune/speed.c: Corresponding changes.
16298         * tune/speed.h: Likewise.
16299         * tune/common.c: Likewise.
16301         * mpf/get_str.c: Simplify `off' computation.
16303         * longlong.h: Tabify.
16305 2003-06-09  Kevin Ryde  <kevin@swox.se>
16307         * gmp.texi (ABI and ISA): FreeBSD has sparc64 too, just say "BSD" to
16308         cover all flavours.
16309         * configure.in: Ditto in some comments.
16311         * mpfr/*: Update to mpfr cvs 2003-06-09.
16313         * tests/cxx/Makefile.am (LDADD): Add -L$(top_builddir)/$(LIBS), for
16314         the benefit of gcc 3.2 on itanium2-hp-hpux11.22.
16316         * tune/many.pl (mul_2): Add speed routine settings.
16317         (MAKEFILE): Close when done, for the benefit of development hackery.
16319 2003-06-08  Kevin Ryde  <kevin@swox.se>
16321         * mpfr/*: Update to mpfr cvs 2003-06-08.
16323         * mpn/x86/x86-defs.m4 (femms): Remove fallback to emms.
16324         (cmovCC, psadbw): Remove simulated versions.
16325         (cmov_available_p, psadbw_available_p): Remove.
16326         This trickery was only ever for development purposes on machines
16327         without those instructions.  Removing it simplifies gmp and in
16328         particular avoids complications for fat binary builds.  Development
16329         can be done with a wrapper around "as" if really needed.
16331         * mpn/x86/divrem_1.asm: Don't use loop_or_decljnz, now K6 has its own
16332         mpn/x86/k6/divrem_1.asm.  Amend K6 comments now moved to there.
16333         * mpn/x86/x86-defs.m4 (loop_or_decljnz): Remove, no longer used.
16335         * mpn/x86/k6/divrem_1.asm: New file, derived from mpn/x86/divrem_1.asm.
16337         * mpn/x86/k6/pre_mod_1.asm: Remove comments now in mpn/x86/mod_1.asm.
16339         * mpn/x86/mod_1.asm: Put mpn_mod_1c after mpn_mod_1 for better branch
16340         prediction.  Put done_zero at end for less wastage in alignment.  Use
16341         decl+jnz unconditionally since in fact it's ok on k6.  Amend comments.
16343 2003-06-07  Kevin Ryde  <kevin@swox.se>
16345         * mpn/generic/mode1o.c: Fix ASSERTs on return value.
16347         * gmp.texi (Build Options): Add viac3 and viac32 cpu types.
16348         (ABI and ISA): Note on sparcv9 ABI=32 vs ABI=64 speed.  More indexing.
16350         * configfsf.guess, configfsf.sub: Update to 2003-06-06.
16351         * config.guess: Remove $RANDOM hack supporting netbsd 1.4, not needed
16352         by new configfsf.guess.
16354 2003-06-06  Torbjorn Granlund  <tege@swox.com>
16356         * mpn/ia64/submul_1.asm: Add branch over .align block.
16358 2003-06-05  Torbjorn Granlund  <tege@swox.com>
16360         * longlong.h (add_ssaaaa) [pa64]: Output zero operand as register 0.
16361         Allow more immediate operands.
16362         (sub_ddmmss) [pa64]: Likewise.
16363         (add_ssaaaa) [pa32]: Likewise.
16364         (sub_ddmmss) [pa32]: Likewise.
16366         * mpn/pa64: Change ".level 2.0W" to ".level 2.0w" to please
16367         picky GNU assembler.
16369 2003-06-05  Kevin Ryde  <kevin@swox.se>
16371         * gmp.texi (Integer Special Functions): In mpz_array_init, fix type
16372         shown for integer_array and give an example use.
16374 2003-06-04  Torbjorn Granlund  <tege@swox.com>
16376         * mpf/set_str.c (mpf_set_str): Work around gcc 2 bug triggered on
16377         alpha.
16379 2003-06-03  Kevin Ryde  <kevin@swox.se>
16381         * mpn/x86/pentium/README: Add 7 c/l mmx mul_1, tweak wordings.
16383         * acinclude.m4 (GMP_C_DOUBLE_FORMAT): Use octal char constants in test
16384         program, hex is not supported by K&R.
16386 2003-06-02  Torbjorn Granlund  <tege@swox.com>
16388         * mpn/mips64/divrem_1.asm: New file.
16390 2003-06-01  Torbjorn Granlund  <tege@swox.com>
16392         * mpn/powerpc32/lshift.asm: Reformat code.
16393         * mpn/powerpc32/rshift.asm: Reformat code.
16395 2003-05-30  Kevin Ryde  <kevin@swox.se>
16397         * tests/misc.c (tests_start): Set stdout and stderr to unbuffered, to
16398         avoid any chance of losing output on segv etc.
16400 2003-05-28  Torbjorn Granlund  <tege@swox.com>
16402         * mpf/get_str.c: Move label `done' to match TMP_MARK and TMP_FREE.
16403         Remove redundant variable prec.
16405 2003-05-26  Torbjorn Granlund  <tege@swox.com>
16407         * tests/mpz/convert.c: Test bases up to 62.
16409         * tests/mpf/t-conv.c: Test bases up to 62.
16411         * demos/pexpr.c: Don't iterate to get accurate timing.
16413         * mpf/set_str.c (mpn_pow_1_highpart): Cleanup.
16415         * mp_dv_tab.c: Fix typo.
16417         * mpf/get_str.c: Rewrite (now sub-quadratic).
16419 2003-05-22  Kevin Ryde  <kevin@swox.se>
16421         * tests/mpn/t-divrem_1.c: New file.
16422         * tests/mpn/Makefile.am: Add it.
16424 2003-05-22  Torbjorn Granlund  <tege@swox.com>
16426         * config.sub: Recognize viac3* processors.
16428 2003-05-20  Torbjorn Granlund  <tege@swox.com>
16430         * mpn/sparc64/addmul_2.asm: New file.
16432 2003-05-19  Torbjorn Granlund  <tege@swox.com>
16434         * configure.in: Recognize alphaev7* as alphaev67.
16436         * config.guess: Recognize viac3* processors.
16437         * configure.in: Set up path for viac3* processors.
16438         * acinclude.m4 (X86_PATTERN): Include viac3* processors.
16440 2003-05-19  Kevin Ryde  <kevin@swox.se>
16442         * tune/freq.c (freq_pstat_getprocessor): New function.
16443         (freq_all): Use it.
16444         * configure.in (AC_CHECK_HEADERS): Add sys/pstat.h.
16445         (AC_CHECK_FUNCS): Add pstat_getprocessor.
16447 2003-05-15  Kevin Ryde  <kevin@swox.se>
16449         * mpn/generic/mul_fft.c (mpn_mul_fft_decompose): Remove "inline",
16450         since the code is a bit too big.  gcc doesn't actually inline when
16451         alloca (TMP_ALLOC) is used anyway.
16453 2003-05-13  Kevin Ryde  <kevin@swox.se>
16455         * gmp.texi (Notes for Particular Systems): Libtool directory is .libs
16456         not _libs for mingw dll.  Reported by Andreas Fabri.
16458 2003-05-07  Kevin Ryde  <kevin@swox.se>
16460         * acinclude.m4 (GMP_PROG_CC_WORKS): Add code to generate sse2/xmm code
16461         from gcc -march=pentium4, to check the assembler supports that.
16462         (GMP_GCC_PENTIUM4_SSE2, GMP_OS_X86_XMM): New macros.
16463         * configure.in (pentium4-*-*): Use them to see if gcc -march=pentium4
16464         (with sse2) is ok.
16466 2003-05-06  Kevin Ryde  <kevin@swox.se>
16468         * mpz/com.c: Rate size==0 as UNLIKELY, fix comment to mpn_add_1.
16470         * tune/freq.c (<sys/sysinfo.h>): Include only when needed for
16471         getsysinfo(), to avoid a problem with this file on AIX 5.1.
16473 2003-05-03  Torbjorn Granlund  <tege@swox.com>
16475         * mpf/set_str.c: Do not ignore supposedly superfluous digits (in part
16476         reverting last change).
16478 2003-05-03  Kevin Ryde  <kevin@swox.se>
16480         * gmp.texi: Use @code for files in @cindex entries, it looks nicer
16481         than @file.
16483         * Makefile.am: Note gmp 4.1.1 and 4.1.2 version info.
16485         * configure.in, acinclude.m4 (GMP_CRAY_OPTIONS): New macro for Cray
16486         system setups, letting AC_REQUIRE do its job instead of a hard coded
16487         AC_PROG_EGREP.
16489         * config.guess: Amend fake RANDOM to avoid ". configfsf.guess" which
16490         segfaults on Debian "ash" 0.4.16.
16492 2003-05-01  Kevin Ryde  <kevin@swox.se>
16494         * configure.in (AC_CHECK_FUNCS): Add getsysinfo.
16495         (AC_CHECK_HEADERS): Add sys/sysinfo.h and machine/hal_sysinfo.h.
16496         * tune/freq.c (freq_getsysinfo): New function.
16497         (freq_all): Use it.
16498         (freq_sysctlbyname_i586_freq, freq_sysctlbyname_tsc_freq,
16499         freq_sysctl_hw_cpufrequency, freq_sysctl_hw_model): Set
16500         speed_cycletime before trying to print it, when verbose.
16502 2003-04-28  Torbjorn Granlund  <tege@swox.com>
16504         * mpf/set_str.c: Major overhaul.
16505         (mpn_pow_1_highpart): New helper function, meat extracted from
16506         mpf_set_str.
16508 2003-04-24  Kevin Ryde  <kevin@swox.se>
16510         * acinclude.m4 (GMP_GCC_ARM_UMODSI): Quote result string against m4.
16512         * configure, ltmain.sh, aclocal.m4: Update to libtool 1.5.
16514         * longlong.h (add_ssaaaa) [all]: Remove first "%" commutative in each,
16515         since gcc only supports one per asm.
16517         * printf/doprnt.c: Add M for mp_limb_t.
16518         * tests/misc/t-printf.c: Exercise this.
16520         * tests/mpz/t-cmp_d.c: Test infinities.
16521         * tests/mpf/t-cmp_d.c: New file.
16522         * tests/mpf/Makefile.am: Add it.
16524         * mpz/cmp_d.c, mpz/cmpabs_d.c, mpf/cmp_d.c: NaN invalid, Inf bigger
16525         than any value.
16526         * mpz/set_d.c, mpq/set_d.c, mpf/set_d.c: Nan or Inf invalid.
16528         * configure.in (AC_CHECK_FUNCS): Add raise.
16529         * invalid.c: New file.
16530         * Makefile.am: Add it.
16531         * gmp-impl.h (__gmp_invalid_operation): Add prototype.
16532         (DOUBLE_NAN_INF_ACTION): New macro.
16534         * tests/trace.c, tests/tests.h (d_trace): New function.
16535         * tests/misc.c, tests/tests.h (tests_infinity_d): New function.
16536         * tests/misc.c (mpz_erandomb, mpz_errandomb): Use gmp_urandomm_ui.
16538         * tune/tuneup.c, tune/common.c, tests/devel/try.c: Cast various
16539         mp_size_t values for printf %ld in case mp_size_t==int.  Use
16540         gmp_printf for mp_limb_t values.
16542         * gmp.texi (Nomenclature and Types): Add mp_exp_t, mp_size_t,
16543         gmp_randstate_t.  Note ulong for bit counts and size_t for byte
16544         counts.  Don't bother with @noindent.
16545         (Debugging): New valgrind is getting MMX/SSE.
16546         (Integer Comparisons): mpz_cmp_d and mpz_cmpabs_d on NaNs and Infs.
16547         (Float Comparison): mpf_cmp_d behaviour on NaNs and Infs.
16548         (Low-level Functions): Note with mpn_hamdist what hamming distance is.
16549         (Formatted Output Strings): Add type M.
16550         (Internals): Remove remarks on ulong bits and size_t bytes.  Move int
16551         field remarks to ...
16552         (Integer Internals, Float Internals): ... here.
16554 2003-04-19  Kevin Ryde  <kevin@swox.se>
16556         * configure.in (*sparc*-*-* ABI=32): Add umul to extra_functions.
16558         * mpn/x86/p6/mul_basecase.asm: New file.
16560 2003-04-18  Kevin Ryde  <kevin@swox.se>
16562         * configure.in (m68060-*-*): Fallback to gcc -m68000 when -m68060 not
16563         available, and don't use mpn/m68k/mc68020 asm routines.  (Avoids 32x32
16564         mul and 64/32 div which trap to the kernel on 68060.  Advice by
16565         Richard Zidlicky.)
16566         * mpn/m68k/README: Update notes on directory usage.
16568         * tests/cxx/Makefile.am (TESTS_ENVIRONMENT): Add a hack to let the
16569         test programs run with a shared libgmpxx on openbsd 3.2.
16571         * gmp.texi (Language Bindings): Add Guile.
16573 2003-04-12  Kevin Ryde  <kevin@swox.se>
16575         * configure.in (cygwin*, mingw*, pw32*, os2*): Add
16576         -Wl,--export-all-symbols to GMP_LDFLAGS, no longer the default in
16577         latest mingw and libtool.
16579         * acinclude.m4 (GMP_ASM_COFF_TYPE): New macro.
16580         * configure.in (x86s): Use it.
16581         * mpn/x86/x86-defs.m4 (COFF_TYPE): New macro.
16582         (PROLOGUE_cpu): Use it, for the benefit of mingw DLLs.
16584         * gmp-impl.h (mpn_copyi, mpn_copyd): Add __GMP_DECLSPEC.
16586         * gmp.texi (Known Build Problems): Remove windows test program .exe
16587         repeated built, fixed by new libtool.  Remove MacOS C++ shared library
16588         creation, fixed by new libtool.
16589         (Notes for Package Builds, Known Build Problems): Remove DESTDIR notes
16590         on libgmpxx, fixed in new libtool.
16592 2003-04-10  Torbjorn Granlund  <tege@swox.com>
16594         * configure.in: Match turbosparc.
16595         * config.guess: Recognize turbosparc (just for *bsd for now).
16597 2003-04-09  Kevin Ryde  <kevin@swox.se>
16599         * mpf/mul_ui.c [nails]: Call mpf_mul to handle v > GMP_NUMB_MAX.
16601         * tests/mpz/t-mul.c (main): Don't try FFT sizes when FFT disabled via
16602         MP_SIZE_T_MAX, eg. for nails.
16604         * tests/cxx/t-ternary.cc: Split up tests to help compile speed and
16605         memory usage.
16607         * tests/devel/try.c: Print seed under -R, add -E to reseed, use ulong
16608         for seed not uint.
16610         * gmp.texi: Add @: after various abbreviations, more index entries.
16611         (leftarrow): New macro, for non-tex.
16612         (Random State Initialization): Remove commented gmp_randinit_lc, not
16613         going to be implemented.
16614         (Random Number Algorithms): New section.
16615         (References): Add Matsumoto and Nishimura on Mersenne Twister, add
16616         Bertot, Magaud and Zimmermann on GMP Square Root.
16618 2003-04-06  Kevin Ryde  <kevin@swox.se>
16620         * tests/mpz/t-gcd_ui.c: New file.
16621         * tests/mpz/Makefile.am: Add it.
16623         * mpz/gcd_ui.c: Correction to return value on longlong limb systems,
16624         limb might not fit a ulong.
16626 2003-04-04  Kevin Ryde  <kevin@swox.se>
16628         * configure, aclocal.m4, ltmain.sh: Update to libtool cvs snapshot
16629         2003-04-02.
16631 2003-04-02  Kevin Ryde  <kevin@swox.se>
16633         * configure.in (*-*-cygwin*): No longer force lt_cv_sys_max_cmd_len,
16634         libtool has addressed this now.
16635         (AC_PROVIDE_AC_LIBTOOL_WIN32_DLL): Remove this, libtool _LT_AC_LOCK
16636         no longer needs it.
16638         * acinclude.m4 (GMP_PROG_AR): Also set ac_cv_prog_AR and
16639         ac_cv_prog_ac_ct_AR when adding flags to AR, so they're not lost by
16640         libtool's call to AC_CHECK_TOOL.
16642 2003-04-01  Kevin Ryde  <kevin@swox.se>
16644         * configure, aclocal.m4, ltmain.sh: Update to libtool cvs snapshot
16645         2003-03-31.
16647         * configure.in (AC_PROG_F77): Add a dummy AC_PROVIDE to stop libtool
16648         running F77 probes.
16650         * randlc2x.c (gmp_rand_lc_struct): Add comments about what exactly is
16651         in each field.
16652         (randseed_lc): Rename seedp to seedz to avoid confusion with seedp in
16653         the lc function.  Suggested by Pedro Gimeno.
16654         (gmp_randinit_lc_2exp): Use __GMP_ALLOCATE_FUNC_TYPE.  No need for
16655         "+1" in mpz_init2 of _mp_seed.  Don't bother with mpz_init2 for _mp_a.
16657 2003-03-29  Kevin Ryde  <kevin@swox.se>
16659         * configure.in (m68k-*-*): Use -O2, no longer need to fallback to -O.
16660         * acinclude.m4 (GMP_GCC_M68K_OPTIMIZE): Remove macro.
16662         * configure.in (AC_CHECK_TYPES): Add notes on why tested.
16664         * gmp.texi (GMPrefu, GMPpxrefu, GMPreftopu, GMPpxreftopu): New macros,
16665         use them for all external references to get URLs into HTML output.
16666         (Random State Initialization): Add gmp_randinit_set.
16667         (Random State Miscellaneous): New section.
16669 2003-03-29  Kevin Ryde  <kevin@swox.se>
16671         * randbui.c, randmui.c: New files.
16672         * Makefile.am: Add them.
16673         * gmp-h.in (gmp_urandomb_ui, gmp_urandomm_ui): Add prototypes.
16674         * tests/rand/t-urbui.c, tests/rand/t-urmui.c: New files.
16675         * tests/rand/Makefile.am: Add them.
16677         * gmp-impl.h (gmp_randstate_srcptr): New typedef.
16678         (gmp_randfnptr_t): Add randiset_fn.
16679         * randiset.c: New file.
16680         * Makefile.am: Add it.
16681         * gmp-h.in (gmp_randinit_set): Add prototype.
16682         * randlc2x.c, randmt.c: Add gmp_randinit_set support.
16683         * tests/rand/t-iset.c: New file.
16684         * tests/rand/Makefile.am: Add it.
16686         * tests/misc.c, tests/tests.h (call_rand_algs): New function.
16688 2003-03-27  Kevin Ryde  <kevin@swox.se>
16690         * mpz/bin_uiui.c: Use plain "*" for kacc products rather than
16691         umul_ppmm since high not needed, except for an ASSERT now amended.
16693 2003-03-26  Kevin Ryde  <kevin@swox.se>
16695         * demos/expr/exprfr.c (cbrt, cmpabs, exp2, gamma, nextabove,
16696         nextbelow, nexttoward): New functions.
16697         * demos/expr/t-expr.c: Exercise these.
16699         * mpfr/*: Update to mpfr cvs 2003-03-26.
16701         * gmp-impl.h (MPZ_REALLOC): Use UNLIKELY, to expect no realloc.
16703         * tune/time.c (cycles_works_p): Scope variables down to relevant part
16704         to avoid warnings about unused.
16706         * configfsf.guess, configfsf.sub: Update to 2003-02-22.
16707         * config.guess: Fake a $RANDOM variable when running configfsf.guess,
16708         to workaround a problem on m68k NetBSD 1.4.1.
16710         * mpz/fac_ui.c: Remove unused variable "z1".
16712         * tune/freq.c (freq_irix_hinv): Allow "Processor 0" line from IRIX 6.5.
16714 2003-03-24  Torbjorn Granlund  <tege@swox.com>
16716         * randlc2x.c (randget_lc): Remove write-only variable rn.
16717         * mpf/eq.c: Remove write-only variable usign.
16718         * gen-psqr.c (main): Remove write-only variable numb_bits.
16720 2003-03-17  Torbjorn Granlund  <tege@swox.com>
16722         * Makefile.am (libgmp_la_SOURCES): Add mp_dv_tab.c.
16723         (libmp_la_SOURCES): Add mp_dv_tab.c.
16725         * mpn/alpha/invert_limb.asm: Add a few comments.
16727         * mp_dv_tab.c: New file, defining __gmp_digit_value_tab.
16729         * mpz/set_str.c: Get rid of function digit_value_in_base and use table
16730         __gmp_digit_value_tab instead.
16731         * mpz/inp_str.c: Likewise.
16732         * mpf/set_str.c: Likewise.
16733         * mpbsd/min.c: Likewise.
16734         * mpbsd/xtom.c: Likewise.
16736         * mpz/set_str.c: Allow bases <= 62.  Return error for invalid bases.
16737         * mpz/inp_str.c: Likewise.
16738         * mpf/set_str.c: Likewise.
16739         * mpz/out_str.c: Likewise.
16740         * mpz/get_str.c: Likewise.
16741         * mpf/get_str.c: Likewise.
16743         * mpz/inp_str.c: Restructure to allocate more string space just
16744         before needed.
16745         * mpbsd/min.c: Likewise.
16747         * longlong.h (__udiv_qrnnd_c): Remove redundant casts.
16748         (32-bit sparc): Test HAVE_HOST_CPU_supersparc in addition to various
16749         sparc_v8 spellings.
16751 2003-03-17  Kevin Ryde  <kevin@swox.se>
16753         * mpfr/*: Update to mpfr cvs 2003-03-17.
16755 2003-03-15  Kevin Ryde  <kevin@swox.se>
16757         * Makefile.am (EXTRA_libgmp_la_SOURCES): Use this for TMP_ALLOC
16758         sources, instead of a libdummy.la.
16760 2003-03-16  Torbjorn Granlund  <tege@swox.com>
16762         * config.guess: Recognize supersparc and microsparc for *BSD systems.
16763         Generalize some superscalar recognition patterns.
16765 2003-03-14  Torbjorn Granlund  <tege@swox.com>
16767         * mpn/sparc64/udiv.asm: New file.
16769 2003-03-13  Torbjorn Granlund  <tege@swox.com>
16771         * mpn/sparc64: Table cycle counts.  Update some comments.
16773         * mpn/powerpc64/divrem_1.asm: New file.
16775 2003-03-10  Torbjorn Granlund  <tege@swox.com>
16777         * mpn/generic/mul.c (mpn_mul): Don't blindly expect
16778         MUL_KARATSUBA_THRESHOLD to be a constant.
16780 2003-03-07  Torbjorn Granlund  <tege@swox.com>
16782         * mpn/generic/mul.c (mpn_mul): New operand splitting code for
16783         avoiding cache misses when un >> MUL_KARATSUBA_THRESHOLD > vn.
16784         (MUL_BASECASE_MAX_UN): New #define, default to 500 for now.
16786 2003-03-07  Kevin Ryde  <kevin@swox.se>
16788         * Makefile.am: Put gmp.h and mp.h under $(exec_prefix)/include.
16789         * gmp.texi (Build Options): Add notes on this.
16790         Reported by Vincent Lefèvre.
16792 2003-03-06  Kevin Ryde  <kevin@swox.se>
16794         * configure.in (alpha*-*-* gcc): Add asm option before testing -mcpu,
16795         for the benefit of gcc 2.9-gnupro-99r1 on alphaev68-dec-osf5.1 which
16796         doesn't otherwise put the assembler in the right mode for -mcpu=ev6.
16798 2003-03-05  Torbjorn Granlund  <tege@swox.com>
16800         * mpn/powerpc32/powerpc-defs.m4: Set up renaming for v registers.
16802         * mpz/powm.c (redc): Instead of repeated mpn_incr_u invocations,
16803         accumulate carries and add at the end.
16804         (mpz_powm): Trim tp allocation, now as redc doesn't need carry guard.
16806 2003-02-25  Torbjorn Granlund  <tege@swox.com>
16808         * mpn/x86/pentium4/copyd.asm: Correct header comment.
16810         * mpn/arm/addmul_1.asm: Correct cycle counts.
16811         * mpn/arm/submul_1.asm: Likewise.
16813 2003-02-20  Kevin Ryde  <kevin@swox.se>
16815         * demos/factorize.c (factor_using_pollard_rho): Test k>0 to avoid
16816         infinite loop if k=0 and gcd!=1 reveals a factor.  Reported by John
16817         Pongsajapan.
16819         * gmp.texi, fdl.texi: Update to FDL version 1.2.
16821 2003-02-18  Torbjorn Granlund  <tege@swox.com>
16823         * mpn/arm/mul_1.asm: Fix typo introduced in last change.
16825 2003-02-17  Torbjorn Granlund  <tege@swox.com>
16827         * mpn/ia64/gmp-mparam.h: Retune.
16829         * mpn/sparc64/copyi.asm: Add some header comments.
16830         * mpn/sparc64/copyd.asm: Likewise.
16832         * mpn/arm/mul_1.asm: Put vl operand last for umull/umlal.
16833         Add some header comments.
16834         * mpn/arm/addmul_1.asm: Rewrite.
16835         * mpn/arm/submul_1.asm: Rewrite.
16836         * mpn/arm/gmp-mparam.h: Retune.
16838 2003-02-16  Torbjorn Granlund  <tege@swox.com>
16840         * mpn/arm/copyi.asm: New file.
16841         * mpn/arm/copyd.asm: New file.
16843 2003-02-16  Kevin Ryde  <kevin@swox.se>
16845         * acinclude.m4 (GMP_C_DOUBLE_FORMAT): Tolerate incorrect last data
16846         byte seen on an arm system.
16848 2003-02-15  Torbjorn Granlund  <tege@swox.com>
16850         * mpn/arm/gmp-mparam.h: Retune.
16852 2003-02-13  Torbjorn Granlund  <tege@swox.com>
16854         * mpn/powerpc32/750/com_n.asm: Add more cycle counts.
16856 2003-02-13  Kevin Ryde  <kevin@swox.se>
16858         * configure.in (AC_PREREQ): Bump to 2.57.
16860         * configure.in, acinclude.m4 (GMP_GCC_WA_OLDAS): New macro, applying
16861         -Wa,-oldas only when necessary.
16863         * configure.in (powerpc*-*-*): Don't use -Wa,-mppc with gcc, it
16864         overrides options recent gcc adds for -mcpu, making generated code
16865         fail to assemble.
16867         * tune/tuneup.c (mpn_fft_table): Remove definition, it's in mul_fft.c.
16869 2003-02-12  Torbjorn Granlund  <tege@swox.com>
16871         * mpn/x86/pentium4/sse2/gmp-mparam.h: Retune.
16872         * mpn/x86/k7/gmp-mparam.h: Retune.
16873         * mpn/x86/k6/gmp-mparam.h: Retune.
16874         * mpn/x86/p6/gmp-mparam.h: Retune.
16875         * mpn/x86/p6/mmx/gmp-mparam.h: Retune.
16877         * tests/mpz/t-mul.c (main): Rewrite FFT testing code.
16879 2003-02-10  Torbjorn Granlund  <tege@swox.com>
16881         * config.guess: Recognize "power2" systems.
16883         * mpn/powerpc64/gmp-mparam.h: Fix indentation.
16884         * mpn/power/gmp-mparam.h: Retune.
16885         * mpn/alpha/ev6/nails/gmp-mparam.h: Retune.
16886         * mpn/sparc64/gmp-mparam.h: Retune.
16887         * mpn/pa64/gmp-mparam.h: Retune.
16888         * mpn/sparc32/v8/supersparc/gmp-mparam.h: Retune.
16889         * mpn/sparc32/v8/gmp-mparam.h: Retune.
16890         * mpn/mips64/gmp-mparam.h: Retune.
16891         * mpn/alpha/ev6/gmp-mparam.h: Retune.
16892         * mpn/powerpc32/gmp-mparam.h: Retune.
16893         * mpn/powerpc32/750/gmp-mparam.h: Retune.
16894         * mpn/alpha/ev5/gmp-mparam.h: Retune.
16895         * mpn/m68k/gmp-mparam.h: Retune.
16896         * mpn/cray/gmp-mparam.h: Set GET_STR_PRECOMPUTE_THRESHOLD.
16898         * configure.in: Undo this, problem doesn't happen any more:
16899         (mips64*-*-*): Pass just -O1 to cc, to work around compiler bug.
16901 2003-02-03  Kevin Ryde  <kevin@swox.se>
16903         * gmp-impl.h (MPN_NORMALIZE, MPN_NORMALIZE_NOT_ZERO): Add parens
16904         around macro parameters.  Reported by Jason Moxham.
16906 2003-02-01  Kevin Ryde  <kevin@swox.se>
16908         * gmp.texi (Low-level Functions): No overlap permitted by mpn_mul_n.
16909         Reported by Jason Moxham.
16910         (Formatted Input Strings): Correction to strtoul cross reference
16911         formatting.
16912         (BSD Compatible Functions): Add index entry for MINT.
16914 2003-01-29  Torbjorn Granlund  <tege@swox.com>
16916         * gmp-impl.h (mpn_mul_fft): Now returns int.
16918 2003-01-29  Paul Zimmermann  <Paul.Zimmermann@loria.fr>
16920         * mpn/generic/mul_fft.c: Major rewrite.
16922 2003-01-25  Kevin Ryde  <kevin@swox.se>
16924         * config.guess (powerpc*-*-*): Remove $dummy.core file when mfpvr
16925         fails on NetBSD.
16926         (trap): Remove $dummy.core on abnormal termination too.
16928         * mpfr/*: Update to mpfr cvs 2003-01-25.
16930 2003-01-24  Torbjorn Granlund  <tege@swox.com>
16932         * mpn/ia64/README: Update cycle counts to match current code.
16934 2003-01-18  Kevin Ryde  <kevin@swox.se>
16936         * mpfr/*: Update to mpfr cvs 2003-01-18.
16938 2003-01-17  Torbjorn Granlund  <tege@swox.com>
16940         * gmp.texi: Canonicalize URLs.
16942 2003-01-15  Kevin Ryde  <kevin@swox.se>
16944         * gmp.texi (Notes for Particular Systems): Add hardware floating point
16945         precision mode.
16947         * mpfr/*, configure, aclocal.m4, config.in: Update to mpfr cvs
16948         2003-01-15.
16950 2003-01-11  Kevin Ryde  <kevin@swox.se>
16952         * mpfr/*: Update to mpfr cvs 2003-01-11.
16954 2003-01-09  Kevin Ryde  <kevin@swox.se>
16956         * mpfr/get_str.c: Update to mpfr cvs 2003-01-09.
16958         * doc/configuration: Various updates.
16960 2003-01-06  Torbjorn Granlund  <tege@swox.com>
16962         * mpn/alpha/copyi.asm: Avoid `nop' mnemonic, unsupported on Cray.
16963         * mpn/alpha/copyd.asm: Likewise.
16965 2003-01-05  Kevin Ryde  <kevin@swox.se>
16967         * demos/expr/t-expr.c (check_r): Tolerate mpfr_set_str new return
16968         value.
16970         * configure, aclocal.m4 (*-*-osf4*, *-*-osf5*): Regenerate with
16971         libtool patch to avoid bash printf option problem when building shared
16972         libraries with cxx.
16974         * configure.in (pentium4-*-*): Use "-march=pentium4 -mno-sse2" since
16975         sse2 causes buggy code from gcc 3.2.1 and is only supported on new
16976         enough kernels.
16978         * acinclude.m4 (GMP_PROG_NM): Add some notes about failures, per
16979         report by Krzysztof Kozminski.
16981         * gmp-h.in (mpz_mdivmod_ui, mpz_mmod_ui): Add parens around "r".
16983         * gmp-h.in (__GMP_CAST): New macro, clean to g++ -Wold-style-cast.
16984         (GMP_NUMB_MASK, mpz_cmp_si, mpq_cmp_si, mpz_odd_p, mpn_divexact_by3,
16985         mpn_divmod): Use it.  Reported by Krzysztof Kozminski.
16986         (mpz_odd_p): No need for the outermost cast to "int".
16987         * tests/cxx/t-cast.cc: New file.
16988         * tests/cxx/Makefile.am: Add it.
16990 2003-01-04  Kevin Ryde  <kevin@swox.se>
16992         * mpfr/set_str.c: Update to mpfr cvs 2003-01-04.
16994         * demos/expr/exprfra.c (e_mpfr_number): Tolerate recent mpfr_set_str
16995         returning count of characters accepted.
16997 2003-01-03  Torbjorn Granlund  <tege@swox.com>
16999         * mpn/alpha/copyi.asm: New file.
17000         * mpn/alpha/copyd.asm: New file.
17002 2003-01-03  Kevin Ryde  <kevin@swox.se>
17004         * demos/expr/t-expr.c: Use __gmpfr on some mpfr internals that have
17005         changed.
17007         * mpfr/*, aclocal.m4, config.in, configure: Update to mpfr cvs
17008         2003-01-03.
17010         * gmp.texi (Introduction to GMP): Mention release announcements
17011         mailing list, and put home page and ftp before mailing lists.
17013 2002-12-28  Torbjorn Granlund  <tege@swox.com>
17015         * mpn/generic/mul_fft.c (mpn_fft_next_size): Simplify.
17017 2002-12-28  Kevin Ryde  <kevin@swox.se>
17019         * acinclude.m4 (M68K_PATTERN): New macro.
17020         (GMP_GCC_M68K_OPTIMIZE): Use it to avoid m6811 and friends.
17021         * configure.in: Ditto.
17023         * tests/mpz/t-import.c, tests/mpz/t-export.c: Use '\xHH' to avoid
17024         warnings about char overflows.
17025         * acinclude.m4 (GMP_C_DOUBLE_FORMAT): Ditto.
17027 2002-12-28  Pedro Gimeno  <pggimeno@wanadoo.es>
17029         * randmt.c (randseed_mt, default_state): Fix off-by-one bug on padding.
17030         (randseed_mt): Add ASSERT checking result of mpz_export.
17032 2002-12-24  Kevin Ryde  <kevin@swox.se>
17034         * gmp.texi (Integer Import and Export): Clarify treatment of signs,
17035         reported by Kent Boortz.
17037         * randmt.c: Use gmp_uint_least32_t.
17038         (randseed_mt): Add nails to mpz_export in case mt[i] more than 32 bits.
17040         * gmp-impl.h (gmp_uint_least32_t): New typedef, replacing GMP_UINT32.
17041         * configure.in (AC_CHECK_TYPES): Add uint_least32_t.
17042         (AC_CHECK_SIZEOF): Add unsigned short.
17044 2002-12-22  Kevin Ryde  <kevin@swox.se>
17046         * gmp-impl.h (ULONG_PARITY) [generic C]: Mask result to a single bit.
17047         (ULONG_PARITY) [_CRAY, __ia64]: New macros.
17048         * tests/t-parity.c: New test.
17049         * tests/Makefile.am (check_PROGRAMS): Add it.
17051         * longlong.h (count_trailing_zeros) [ia64]: New macro.
17053         * tests/t-count_zeros.c (check_various): Remove unused variable "n".
17055         * mpn/x86/README: Revise notes on PIC, PLT and GOT.
17057         * demos/perl/GMP.xs, demos/perl/GMP.pm, demos/perl/test.pl: Add "mt"
17058         to GMP::Rand::randstate.
17060 2002-12-22  Pedro Gimeno  <pggimeno@wanadoo.es>
17062         * randmt.c (randseed_mt): Fix bug that might cause the generator to
17063         return all zeros with certain seeds.  Fix WARM_UP==0 case.
17064         (gmp_randinit_mt): Initialize to a known state by default.
17065         (randget_mt): Remove check for uninitialized buffer: no longer needed.
17066         (recalc_buffer): Use ?: instead of two-element array.
17068         * tests/rand/t-mt.c: New test.
17069         * tests/rand/Makefile.am (check_PROGRAMS): Add it.
17071 2002-12-21  Kevin Ryde  <kevin@swox.se>
17073         * cxx/osdoprnti.cc: Use <cstdarg> and <cstring> rather than <stdarg.h>
17074         and <string.h>.  No need for <stdio.h>.
17076         * demos/expr/expr.c, demos/expr/exprfa.c, demos/expr/exprfra.c,
17077         demos/expr/exprza.c: Use mp_get_memory_functions, not
17078         __gmp_allocate_func etc.
17079         * demos/expr/t-expr.c: Don't use gmp-impl.h.
17080         (numberof): New macro.
17082         * gmp-h.in, gmp-impl.h (__gmp_allocate_func, __gmp_reallocate_func,
17083         __gmp_free_func): Move declarations to gmp-impl.h
17085         * mp_get_fns.c: New file.
17086         * Makefile.am (libgmp_la_SOURCES, libmp_la_SOURCES): Add it.
17087         * gmp-h.in (mp_get_memory_functions): Add prototype.
17088         * gmp.texi (Custom Allocation): Add mp_get_memory_functions, refer to
17089         "free" not "deallocate" function.
17090         * gmpxx.h (struct __gmp_alloc_cstring): Use mp_get_memory_functions,
17091         not __gmp_free_func.
17093         * gmp-impl.h [__cplusplus]: Add <cstring> for strlen.
17094         (gmp_allocated_string): Hold length in a field.
17095         * cxx/osdoprnti.cc, cxx/osmpf.cc: Use this.
17097 2002-12-20  Torbjorn Granlund  <tege@swox.com>
17099         * tests/mpz/t-perfsqr.c (check_sqrt): Print more variables upon
17100         failure.
17102         * mpn/generic/rootrem.c: In Newton loop, pad qp with leading zero.
17104 2002-12-19  Torbjorn Granlund  <tege@swox.com>
17106         * mpn/generic/rootrem.c: Allocate 1.585 (log2(3)) times more space
17107         for pp temporary to allow for worst case overestimate of root.
17108         Add some asserts.
17110         * tests/mpz/t-root.c: Generalize and speed up.
17112 2002-12-19  Kevin Ryde  <kevin@swox.se>
17114         * tests/cxx/t-rand.cc (check_randinit): Add gmp_randinit_mt test.
17116         * gmp-h.in: Don't bother trying to support Compaq C++ in pre-standard
17117         I/O mode.
17118         * gmp.texi (Notes for Particular Systems): Compaq C++ must be used in
17119         "standard" iostream mode.
17121 2002-12-18  Torbjorn Granlund  <tege@swox.com>
17123         * mpn/alpha/mod_34lsub1.asm: Add code for big-endian, using existing
17124         little-endian code only if HAVE_LIMB_LITTLE_ENDIAN is defined.
17126 2002-12-18  Kevin Ryde  <kevin@swox.se>
17128         * configure.in (HAVE_LIMB_BIG_ENDIAN, HAVE_LIMB_LITTLE_ENDIAN): New
17129         defines in config.m4.
17131 2002-12-17  Torbjorn Granlund  <tege@swox.com>
17133         * printf/printffuns.c (gmp_fprintf_reps): Make it actually work
17134         for padding > 256.
17136 2002-12-17  Kevin Ryde  <kevin@swox.se>
17138         * tune/freq.c: Add <string.h> for memcmp.
17140         * mpz/pprime_p.c: Use MPN_MOD_OR_MODEXACT_1_ODD.
17142         * gmp.texi (Formatted Output Strings): %a and %A are C99 not glibc.
17143         (Formatted Input Strings): Type "l" is for double too.  Hex floats are
17144         accepted for mpf_t.
17145         (Formatted Input Functions): Describe tightened parse rule, clarify
17146         return value a bit.
17148         * scanf/doscan.c: Add hex floats, tighten matching to follow C99, for
17149         instance "0x" is no longer acceptable to "%Zi".
17150         Rename "invalid" label to avoid "invalid" variable, SunOS cc doesn't
17151         like them the same.
17152         * tests/misc/t-scanf.c: Update tests.
17153         * tests/misc/t-locale.c (check_input): Don't let "0x" appear from fake
17154         decimal point.
17156         * config.guess (sparc*-*-*): Look at BSD sysctl hw.model to recognise
17157         ultrasparcs.
17159         * mpfr/tests/dummy.c: New file.
17160         * mpfr/tests/Makefile.am (libfrtests_a_SOURCES): Add it.
17162 2002-12-14  Kevin Ryde  <kevin@swox.se>
17164         * mpbsd/Makefile.am (nodist_libmpbsd_la_SOURCES): Move these mpz
17165         sources to libmpbsd_la_SOURCES directly, automake 1.7.2 now gets the
17166         ansi2knr setups right for sources in other directories.
17168         * mpfr/tests/Makefile.am: Add libfrtests.a in preparation for new mpfr.
17170 2002-12-13  Kevin Ryde  <kevin@swox.se>
17172         * mpfr/Makefile.am (mpfr_TEXINFOS, AM_MAKEINFOFLAGS): Allow for
17173         fdl.texi in recent mpfr.
17175         * configure.in (AC_PROG_EGREP): Ensure this is run outside the Cray
17176         conditional AC_EGREP_CPP.
17178         * configure.in (alpha*-*-*): Use gcc -Wa,-oldas if it works, to avoid
17179         problems with new compaq "as" on OSF 5.1.
17181         * mpn/Makefile.am (EXTRA_DIST): Remove Makeasm.am, automake 1.7.2 does
17182         it automatically.
17184         * acinclude.m4 (AC_LANG_FUNC_LINK_TRY(C)): Remove this hack, fixed by
17185         autoconf 2.57.
17187         * configure.in (AC_CONFIG_LIBOBJ_DIR): Set to mpfr, for the benefit of
17188         new mpfr using LIBOBJ.
17190         * configure.in: (AM_INIT_AUTOMAKE): Use "gnu no-dependencies
17191         $(top_builddir)/ansi2knr".
17192         * */Makefile.am (AUTOMAKE_OPTIONS): Remove, now in configure.in.
17194         * configure, config.in, INSTALL.autoconf: Update to autoconf 2.57.
17195         * */Makefile.in, configure, aclocal.m4, install-sh, mkinstalldirs:
17196         Update to automake 1.7.2.
17198         * gmp.texi (Build Options): Add hppa64 to cpu types.
17199         (ABI and ISA): Add gcc to hppa 2.0.
17200         (Debugging): Add maximum debuggability config options.
17201         (Language Bindings): Add Arithmos, reported by Johan Vervloet.
17202         (Formatted Output Strings): 128 bits is about 40 digits, ll is only
17203         for long long not long double.
17204         (Formatted Input Strings): ll is only for long long not long double.
17206         * mpz/divis.c, mpz/divis_ui.c, mpz/cong.c, mpz/cong_ui.c: Allow d=0,
17207         under the rule n==c mod d iff exists q satisfying n=c+q*d.
17208         * gmp.texi (Integer Division): Describe this.
17209         Suggested by Jason Moxham.
17211 2002-12-13  Pedro Gimeno  <pggimeno@wanadoo.es>
17213         * randlc2x.c (lc): Remove check for seedn < an, which is now
17214         superfluous.  Add ASSERT to ensure it's correct.  Add ASSERT to check
17215         precondition of __GMPN_ADD.
17216         (gmp_randinit_lc_2exp): Avoid reallocation by allocating one extra bit
17217         for both seed and a.  Simplify seedn < p->_cn case.
17219         * tests/rand/t-lc2exp.c (check_bigs): Test negative seeds.
17221 2002-12-12  Torbjorn Granlund  <tege@swox.com>
17223         * mpn/pa32/pa-defs.m4 (PROLOGUE_cpu): Zap spurious argument to `.proc'.
17224         Add empty `.callinfo'.
17226 2002-12-11  Torbjorn Granlund  <tege@swox.com>
17228         * mpn/x86/pentium4/sse2/addmul_1.asm: Don't reuse `ret' symbol for a
17229         label.
17231 2002-12-11  Kevin Ryde  <kevin@swox.se>
17233         * configure.in (hppa*-*-*): Don't use gcc -mpa-risc-2-0 in ABI=1.0.
17235         * mpn/pa32/pa-defs.m4: New file, arranging for .proc/.procend.
17236         * configure.in (hppa*-*-*): Use it.
17238         * printf/doprnt.c: Comments on "ll" versus "L".
17240         * tests/mpz/t-div_2exp.c: Reduce tests, especially the random ones.
17242 2002-12-11  Torbjorn Granlund  <tege@swox.com>
17244         * mpz/get_d.c (limb2dbl): New macro for conversion to `double'.
17245         Define it to something non-trivial for 64-bit hppa.
17246         * mpq/get_d.c: Likewise.
17247         * mpf/get_d.c: Likewise.
17249         * mpn/x86/pentium4/sse2/addmul_1.asm: Unroll to save one c/l.
17251 2002-12-09  Kevin Ryde  <kevin@swox.se>
17253         * tune/Makefile.am: Don't use -static under --disable-static, it tends
17254         not to work.
17255         * configure.in (ENABLE_STATIC): New AM_CONDITIONAL.
17257         * gmp-h.in: Use <iostream> instead of <iosfwd> with Compaq C++ in
17258         pre-standard I/O mode.
17260         * tests/mpz/t-jac.c, tests/mpz/t-scan.c: Reduce tests.
17262 2002-12-08  Kevin Ryde  <kevin@swox.se>
17264         * configure.in (*-*-ultrix*): Remove forcible --disable-shared,
17265         believe this was a generic problem with libtool, now gone.
17267 2002-12-08  Torbjorn Granlund  <tege@swox.com>
17269         * gmp-impl.h (USE_LEADING_REGPARM): Disable for PIC code generation.
17271 2002-12-07  Torbjorn Granlund  <tege@swox.com>
17273         * tests/cxx/t-misc.cc (check_mpq): Use 0/1 for canonical 0 in
17274         mpq_cmp_ui calls.
17276         * configure.in (hppa2.0*-*-*): Pass +O2 instead of +O3 to work around
17277         compiler bug with mpfr/tests/tdiv.
17279 2002-12-07  Kevin Ryde  <kevin@swox.se>
17281         * configure.in (hppa2.0*-*-* ABI=2.0n): Make -mpa-risc-2-0 optional.
17282         New hppa-level-2.0 test using GMP_HPPA_LEVEL_20 to detect assembler
17283         support for 2.0n.
17284         * acinclude.m4 (GMP_PROG_CC_WORKS): Add code that provokes an error
17285         from gcc -mpa-risc-2-0 if the assembler doesn't know 2.0 instructions.
17286         (GMP_HPPA_LEVEL_20): New macro.
17288 2002-12-07  Pedro Gimeno  <pggimeno@wanadoo.es>
17290         * gmp-impl.h (gmp_randfnptr_t.randseed_fn) Return void.
17291         (LIMBS_PER_ULONG, MPN_SET_UI): New macros.
17292         (MPZ_FAKE_UI): Rename couple of parameters.
17294         * randlc2x.c (gmp_rand_lc_struct): _mp_c and _mp_c_limbs replaced
17295         with mpn style _cp and _cn.  All callers changed.
17296         (randseed_lc): Fix limbs(seed) > bits_to_limbs(m2exp) case.
17297         Remove return value.
17298         (gmp_randinit_lc_2exp): Attempt to avoid redundant reallocation.
17300         * randmt.c (mangle_seed): New function by Kevin.
17301         (randseed_mt): Use it instead of mpz_powm, for performance.  Remove
17302         return value.  Remove commented out code (an inferior alternative to
17303         mpz_export).
17305         * randsdui.c (gmp_randseed_ui): Use MPZ_FAKE_UI.
17307         * tests/rand/t-lc2exp.c (check_bigm, check_bigs): New tests.
17308         * tests/rand/t-urndmm.c: Add L to constants in calls, for K&R.
17310 2002-12-06  Torbjorn Granlund  <tege@swox.com>
17312         * configure.in: Remove -g.
17313         (hppa*-*-*): Pass -Wl,+vnocompatwarnings with +DA2.0.
17315 2002-12-05  Torbjorn Granlund  <tege@swox.com>
17317         * mpn/pa64/sqr_diagonal.asm: Remove .entry, .proc, .procend.
17318         * mpn/pa64/udiv.asm: Likewise.
17320 2002-12-05  Kevin Ryde  <kevin@swox.se>
17322         * mpn/pa64/sub_n.asm: Remove space in "sub, db" which gas objects to.
17323         * mpn/pa64/*.asm, tune/hppa2.asm: Use ".level 2.0" for 2.0n, since gas
17324         doesn't like ".level 2.0N".
17326         * configure.in (hppa*-*-*): Group path and flags choices, for clarity.
17327         (hppa1.0*-*-*): Use gcc -mpa-risc-1-0 when available.
17328         (hppa2.0*-*-*): Ditto -mpa-risc-2-0.
17329         (*-*-hpux*): Exclude ABI=2.0w for hpux[1-9] and hpux10, rather than
17330         the converse of allowing it for hpux1[1-9]; ie. list the bad systems
17331         rather than try to guess the good systems.
17332         (hppa2.0*-*-*) [ABI=2.0n ABI=2.0w]: Add gcc to likely compilers.
17333         (hppa*-*-*) [gcc]: Test sizeof(long) to differentiate a 32-bit or
17334         64-bit build of the compiler.
17335         (hppa64-*-*): Add this as equivalent to hppa2.0-*-*.
17336         * acinclude.m4 (GMP_C_TEST_SIZEOF): New macro.
17338         * tests/tests.h (ostringstream::str): Must null-terminate
17339         ostrstream::str() for the string constructor.
17341 2002-12-04  Torbjorn Granlund  <tege@swox.com>
17343         * mpn/pa32/hppa1_1/udiv.asm: Don't wrap symbol to INT64 in L() stuff.
17345         * longlong.h (mpn_udiv_qrnnd_r based udiv_qrnnd): Fix typo.
17347         * mpn/powerpc32/powerpc-defs.m4: Define float registers with `f'
17348         prefix.
17350 2002-12-04  Kevin Ryde  <kevin@swox.se>
17352         * gmp.texi (Floating-point Functions): Note the mantissa is binary and
17353         decimal fractions cannot be represented exactly.  Suggested by Serge
17354         Winitzki.
17355         (Known Build Problems): Note libtool stripping options when linking.
17356         Reported by Vincent Lefevre.
17358         * acinclude.m4 (GMP_ASM_LABEL_SUFFIX): Don't make an empty result a
17359         failure, that's a valid result.
17360         (GMP_ASM_GLOBL): Establish this from the host cpu type.
17361         (IA64_PATTERN): New macro.
17362         (GMP_PROG_EXEEXT_FOR_BUILD, GMP_C_FOR_BUILD_ANSI,
17363         GMP_CHECK_LIBM_FOR_BUILD): Remove temporary files created.
17364         * configure.in: Use IA64_PATTERN.
17366 2002-12-03  Torbjorn Granlund  <tege@swox.com>
17368         * tune/hppa.asm: Use config.m4.
17369         * tune/hppa2.asm: Likewise.
17370         * tune/hppa2w.asm: Likewise.
17372         * mpn/pa64: Use LDEF.
17374 2002-12-03  Kevin Ryde  <kevin@swox.se>
17376         * INSTALL: Use return rather than exit in the example programs.
17377         Suggested by Richard Dawe.
17379         * gmp.texi (Build Options): Move non-unix notes to ...
17380         (Notes for Particular Systems): ... here.  Mention MS Interix,
17381         reported by Paul Leyland.
17382         (C++ Interface Random Numbers): Add gmp_randinit_mt to examples.
17384         * acinclude.m4 (GMP_ASM_LABEL_SUFFIX): Must test empty suffix first,
17385         for the benefit of hppa hp-ux.
17386         (GMP_ASM_UNDERSCORE): Grep the output of "nm" instead of trying to
17387         construct an asm file, and in case of failure fallback on no
17388         underscore and a warning.
17390         * longlong.h (count_leading_zeros, count_trailing_zeros) [ev67, ev68]:
17391         Restrict __asm__ ctlz and cttz to __GNUC__.
17393         * gen-psqr.c (HAVE_CONST, const): New macros.
17395         * tests/cxx/t-rand.cc (check_randinit): Add gmp_randinit_mt.
17397 2002-12-02  Torbjorn Granlund  <tege@swox.com>
17399         * gmp-impl.h: Split popc_limb again, combined version gives too many
17400         compiler warnings.
17402 2002-12-01  Torbjorn Granlund  <tege@swox.com>
17404         * mpn/generic/gcdext.c (div1): Disable unused function.
17406         * mpz/root.c: Don't include stdlib.h or longlong.h.
17407         * mpz/rootrem.c: Likewise.
17409         * extract-dbl.c: abort => ASSERT_ALWAYS.
17410         * mpz/set_d.c: Likewise.
17411         * mpn/generic/tdiv_qr.c: Likewise.
17413         * gen-psqr.c (f_cmp_fraction, f_cmp_divisor): Change parameter to
17414         `const void *', to match qsort spec.
17416 2002-12-01  Kevin Ryde  <kevin@swox.se>
17418         * gmp.texi (Integer Division): Fix a couple of @math's for tex.
17419         Use @dots in more places.
17421         * tests/cxx/t-locale.cc: Test non std::locale systems too.
17422         * tests/cxx/clocale.c: New file, reinstating what was localeconv.c,
17423         and subverting nl_langinfo too.
17424         * tests/cxx/Makefile.am (t_locale_SOURCES): Add it.
17426         * tests/tests.h (ostringstream, istringstream): Provide fakes of these
17427         if <sstream> not available.
17428         * tests/cxx/t-locale.cc, tests/cxx/t-ostream.cc: Remove <sstream>.
17429         * configure.in (AC_CHECK_HEADERS) [C++]: Add <sstream>.
17431 2002-11-30  Torbjorn Granlund  <tege@swox.com>
17433         * printf/doprnt.c (__gmp_doprnt): Comment out a `break' to shut up
17434         compiler warnings.
17436         * mpn/ia64/invert_limb.asm: Add `many' hints to return insns.
17438         * mpn/ia64/divrem_1.asm: Allocate more local registers; put b0 in
17439         one of them.
17441         * mpn/ia64/popcount.asm: Properly restore register ar.lc.
17443         * longlong.h (umul_ppmm) [ia64]: Form both product parts in asm.
17445         * mpz/bin_uiui.c: Cast umul_ppmm operands.
17447         * scanf/doscan.c (gmpscan): Remove unused label store_get_digits.
17449         * gmp-impl.h: #undef MIN and MAX before #defining.
17451         * mpn/ia64/copyi.asm: Add `;' after bundle declarators.
17452         * mpn/ia64/copyd.asm: Likewise.
17454         * mpn/ia64/divrem_1.asm: Add some syntax to placid the HP-UX assembler.
17456 2002-11-30  Kevin Ryde  <kevin@swox.se>
17458         * configure.in (AC_CHECK_HEADERS): Add nl_types.h.
17459         * tests/misc/t-locale.c: Use this, for nl_item on netbsd 1.4.1.
17461 2002-11-29  Torbjorn Granlund  <tege@swox.com>
17463         * tests/devel/addmul_1.c: Provide prototype for mpn_print.
17464         (OPS): Account for function overhead.
17465         * tests/devel/{submul_1.c,mul_1.c,add_n.c,sub_n.c}: Likewise.
17467         * mpn/ia64/addmul_1.asm: Rewrite.
17469 2002-11-28  Torbjorn Granlund  <tege@swox.com>
17471         * mpn/ia64/sqr_diagonal.asm: Don't allocate any registers.
17473         * mpn/ia64/submul_1.asm: Adapt to Itanium 2.
17475         * mpn/ia64/mul_1.asm: Fix typo in HAVE_ABI_32 code.
17477         * mpn/ia64/add_n.asm: Rewrite.
17478         * mpn/ia64/sub_n.asm: Rewrite.
17480 2002-11-28  Kevin Ryde  <kevin@swox.se>
17482         * mpn/Makefile.am (nodist_EXTRA_libmpn_la_SOURCES): Use this rather
17483         than libdummy.
17484         * tests/Makefile.am (EXTRA_libtests_la_SOURCES): Use this for
17485         x86call.asm and x86check.c rather than libdummy.
17487 2002-11-27  Torbjorn Granlund  <tege@swox.com>
17489         * tests/mpz/t-mul.c: Implement reference Karatsuba multiplication.
17490         Rewrite testing scheme to run fewer really huge tests.
17492 2002-11-26  Torbjorn Granlund  <tege@swox.com>
17494         * tests: Decrease repetition count for some of the slowest tests.
17496         * mpn/ia64/divrem_1.asm: New file.
17498 2002-11-25  Torbjorn Granlund  <tege@swox.com>
17500         * mpfr/tests/tdiv.c: Decrease number of performed tests.
17502 2002-11-23  Torbjorn Granlund  <tege@swox.com>
17504         * mpn/ia64/mul_1.asm: Rewrite.
17506 2002-11-23  Kevin Ryde  <kevin@swox.se>
17508         * mpn/ia64/README: Add some references.
17510         * gmp.texi (Build Options): Add itanium and itanium2, mention DocBook
17511         and XML from makeinfo, add texinfo top level cross reference.
17512         (Integer Division): Try to clarify 2exp functions a bit.
17513         (C++ Interface Floats): Giving bad string to constructor is undefined.
17514         (C++ Interface Integers, C++ Interface Rationals): Ditto, and show
17515         default base in prototype, not the description.
17517         * config.sub, config.guess, configure.in (itanium, itanium2): New cpu
17518         types.
17520         * tests/misc/t-printf.c, tests/misc/t-scanf.c (check_misc): Suppress
17521         %zd test on glibc prior to 2.1, it's not supported.
17523 2002-11-22  Torbjorn Granlund  <tege@swox.com>
17525         * mpn/ia64/copyi.asm: Optimize for Itanium 2.
17526         * mpn/ia64/copyd.asm: Likewise.
17528 2002-11-20  Torbjorn Granlund  <tege@swox.com>
17530         * mpn/ia64/sqr_diagonal.asm: New file.
17532         * mpn/ia64/submul_1.asm: Handle vl == 0 specially.
17534 2002-11-20  Kevin Ryde  <kevin@swox.se>
17536         * tests/cxx/t-locale.cc: Test with locales imbued into stream, use
17537         <sstream>, eliminated some C-isms.  istream tests disabled, not yet
17538         locale-ized.
17539         * tests/cxx/Makefile.am (t_locale_SOURCES): Remove localeconv.c.
17540         * tests/cxx/localeconv.c: Remove file.
17542         * configure.in (AC_CHECK_TYPES) [C++]: Add std::locale.
17543         * printf/doprntf.c: Add decimal point parameter, remove localeconv use.
17544         * gmp-impl.h (__gmp_doprnt_mpf): Update prototype, bump symbol to
17545         __gmp_doprnt_mpf2 to protect old libgmpxx.
17546         * cxx/osmpf.cc: Use this with ostream locale decimal_point facet.
17547         * printf/doprnt.c: Ditto, with GMP_DECIMAL_POINT.
17549         * gmp-h.in: More comments on __declspec for windows DLLs.
17551         * mpf/set_str.c, scanf/doscan.c: Cast through "unsigned char" for
17552         decimal point string, same as input chars.
17554         * configure.in (AC_CHECK_HEADERS): Add langinfo.h.
17555         (AC_CHECK_FUNCS): Add nl_langinfo.
17556         * gmp-impl.h (GMP_DECIMAL_POINT): New macro.
17557         * mpf/out_str.c, mpf/set_str.c, scanf/doscan.c: Use it, and don't
17558         bother with special code for non-locale systems.
17559         * tests/misc/t-locale.c: Subvert nl_langinfo too.
17561         * configure.in, acinclude.m4 (GMP_ASM_X86_GOT_UNDERSCORE): New macro.
17562         * mpn/x86/x86-defs.m4 (_GLOBAL_OFFSET_TABLE_): New macro, inserting
17563         extra underscore for OpenBSD.
17564         * mpn/x86/README (_GLOBAL_OFFSET_TABLE_): Update notes.
17565         Reported by Christian Weisgerber.
17567         * tests/cxx/t-rand.cc (check_randinit): New function, collecting up
17568         constructor tests.
17570         * tests/cxx/t-ostream.cc: Use <sstream> instead of <strstream>, use
17571         compare instead of strcmp.
17573         * gmpxx.h (__gmp_randinit_lc_2exp_size_t): Return type is int.
17575 2002-11-18  Kevin Ryde  <kevin@swox.se>
17577         * tune/speed.c (r_string): Use CNST_LIMB with <N>bits, spotted by
17578         Torbjorn.
17580 2002-11-19  Torbjorn Granlund  <tege@swox.com>
17582         * mpn/ia64/mul_1.asm: Remove redundant cmp from prologue code.
17583         Streamline prologue.
17584         * mpn/ia64/addmul_1.asm: Likewise.
17585         * mpn/ia64/submul_1.asm: New file.
17586         * mpn/ia64/submul_1.c: Remove.
17588 2002-11-17  Torbjorn Granlund  <tege@swox.com>
17590         * mpn/generic/popham.c: New file, using new faster algorithm.
17591         * mpn/generic/popcount.c: Remove.
17592         * mpn/generic/hamdist.c: Remove.
17594         * mpn/ia64/addmul_1.asm: Don't clobber callee-saves register f16.
17595         * mpn/ia64/mul_1.asm: Likewise.
17597         * mpn/ia64/addmul_1.asm: Add pred.rel declarations.  Resolve RAW
17598         hazards for condition code registers, duplicating code as needed.  Add
17599         prediction to all branches.
17600         * mpn/ia64/mul_1.asm: Likewise.
17601         * mpn/ia64/add_n.asm: Likewise.
17602         * mpn/ia64/sub_n.asm: Likewise.
17603         * mpn/ia64/copyi.asm: Likewise.
17604         * mpn/ia64/copyd.asm: Likewise.
17606         * mpn/generic/random2.c: Add a cast to silence some compilers.
17608 2002-11-16  Torbjorn Granlund  <tege@swox.com>
17610         * mpz/powm.c: Cap allocation by limiting k to 10 (512 precomputed
17611         values).
17613 2002-11-16  Kevin Ryde  <kevin@swox.se>
17615         * configure.in, gmp.texi: Remove powerpc64 ABI=32L, doesn't work and
17616         is unlikely to ever do so.
17617         * configure.in: Allow ABI=32 for powerpc64.
17618         Reported by David Edelsohn.
17620 2002-11-14  Kevin Ryde  <kevin@swox.se>
17622         * mpn/Makefile.am (nodist_libdummy_la_SOURCES): Add addmul_2.c
17623         addmul_3.c addmul_4.c addmul_5.c addmul_6.c addmul_7.c addmul_8.c.
17625         * gmp-h.in (__GMP_DECLSPEC_EXPORT, __GMP_DECLSPEC_IMPORT) [__GNUC__]:
17626         Use __dllexport__ and __dllimport__ to keep out of application
17627         namespace.
17629 2002-11-14  Gerardo Ballabio <gerardo.ballabio@unimib.it>
17631         * gmpxx.h (__gmp_randinit_default_t, __gmp_randinit_lc_2exp_t,
17632         __gmp_randinit_lc_2exp_size_t): Use extern "C" { typedef ... }, for
17633         the benefit of g++ prior to 3.2.
17635 2002-11-12  Kevin Ryde  <kevin@swox.se>
17637         * gmpxx.h (gmp_randclass constructors): Patch from Roberto Bagnara to
17638         use extern "C" on C function pointer arguments.
17640 2002-11-09  Kevin Ryde  <kevin@swox.se>
17642         * configure.in, Makefile.am, printf/Makefile.am,
17643         printf/repl-vsnprintf.c: Handle vsnprintf replacement with C
17644         conditionals.
17646         * acinclude.m4 (AC_LANG_FUNC_LINK_TRY(C)): Workaround troubles recent
17647         HP cc +O3 causes for AC_CHECK_FUNCS.
17649         * gmp.texi (Notes for Particular Systems): Add Sparc app regs.
17650         (Debugging): Note gcc -fstack options to detect overflow.
17651         (Formatted Output Strings, Formatted Input Strings): Format strings
17652         are not multibyte.
17654 2002-11-06  Torbjorn Granlund  <tege@swox.com>
17656         * mpn/generic/tdiv_qr.c: Remove a bogus assert.
17658 2002-11-05  Torbjorn Granlund  <tege@swox.com>
17660         * mpn/generic/tdiv_qr.c: Remove two dead mpn_divrem_2 calls.
17662 2002-11-04  Kevin Ryde  <kevin@swox.se>
17664         * acinclude.m4 (GMP_C_INLINE): Don't define "inline" for C++.
17666         * demos/expr/expr-impl.h (stdarg.h): Test __DECC same as gmp.h.
17668         * mpbsd/mtox.c, printf/obprintf.c, printf/obvprintf.c,
17669         scanf/vsscanf.c, demos/expr/expr.c, demos/expr/exprf.c,
17670         demos/expr/exprfa.c, demos/expr/exprfr.c, demos/expr/exprq.c,
17671         demos/expr/exprz.c, demos/expr/exprza.c: Add <string.h> for strlen and
17672         memcpy.
17674 2002-11-02  Kevin Ryde  <kevin@swox.se>
17676         * longlong.h: Test __x86_64__ not __x86_64.  Reported by Andreas
17677         Jaeger.
17679         * mpz/import.c, mpz/export.c: Use char* subtract from NULL to get
17680         pointer alignment, for the benefit of Cray vector systems.
17682         * cxx/ismpf.cc: Use <clocale>.
17683         * tests/cxx/t-locale.cc: No need to conditionalize <clocale>.
17685         * scanf/doscan.c: Don't use isascii, rely on C99 ctype.h.
17687         * gmp.texi (Build Options): Describe CC_FOR_BUILD, cross reference
17688         texinfo manual.
17689         (ABI and ISA): Add powerpc620 and powerpc630 to powerpc64, add NetBSD
17690         and OpenBSD sparc64.
17691         (Notes for Package Builds): Cross reference libtool manual.
17692         (Notes for Particular Systems): Add OpenBSD to non-MMX versions of gas.
17693         (Known Build Problems): Add MacOS X C++ shared libraries.
17695 2002-10-31  Kevin Ryde  <kevin@swox.se>
17697         * gmp-impl.h, tune/speed.c, tune/speed.h, tune/common.c, tune/many.pl,
17698         tests/devel/try.c, tests/tests.h, tests/refmpn.c (mpn_addmul_5,
17699         mpn_addmul_6, mpn_addmul_7, mpn_addmul_8): Add testing and measuring.
17700         * configure.in (config.in): Add #undefs of HAVE_NATIVE_mpn_addmul_5,
17701         HAVE_NATIVE_mpn_addmul_6, HAVE_NATIVE_mpn_addmul_7,
17702         HAVE_NATIVE_mpn_addmul_8.
17703         (gmp_mpn_functions_optional): Add addmul_5 addmul_6 addmul_7 addmul_8.
17705         * tests/devel/try.c (ASSERT_CARRY): Remove, now in gmp-impl.h
17706         (try_one): Do dest setups after sources, for benefit of
17707         dst0_from_src1.
17709 2002-11-01  Torbjorn Granlund  <tege@swox.com>
17711         * mpn/generic/tdiv_qr.c: Avoid quadratic behaviour for
17712         sub-division when numerator is more than twice the size of the
17713         denominator.  Simplify loop logic for the same case.  Clean up a
17714         few comments.
17716 2002-10-29  Torbjorn Granlund  <tege@swox.com>
17718         * configure.in (*-cray-unicos*): Pass -hnofastmd again.
17720 2002-10-25  Torbjorn Granlund  <tege@swox.com>
17722         * tests/tadd.c: Disable test of denorms.
17724 2002-10-23  Linus Nordberg  <linus@swox.se>
17726         * gmp.texi (Introduction to GMP): Update section about mailing
17727         lists.
17729 2002-10-23  Kevin Ryde  <kevin@swox.se>
17731         * gmp-h.in (__GMP_ATTRIBUTE_PURE): Suppress this when
17732         __GMP_NO_ATTRIBUTE_CONST_PURE is defined.
17733         * gmp-impl.h (ATTRIBUTE_CONST): Ditto.
17734         * tune/common.c: Use __GMP_NO_ATTRIBUTE_CONST_PURE.
17736         * tune/speed.h, tune/many.pl: Remove ATTRIBUTEs from prototypes.
17737         * tune/speed.h: Remove various "dummy" variables attempting to keep
17738         "pure" calls live, no longer necessary.  They weren't sufficient for
17739         recent MacOS cc anyway.
17741 2002-10-21  Torbjorn Granlund  <tege@swox.com>
17743         * mpn/cray/ieee/addmul_1.c: Handle overlap as in mul_1.c.
17744         * mpn/cray/ieee/submul_1.c: Likewise.
17746 2002-10-19  Kevin Ryde  <kevin@swox.se>
17748         * configure.in (sparcv9 etc -*-*bsd*): Add support for NetBSD and
17749         OpenBSD sparc64.  Reported by Christian Weisgerber.
17750         (AC_CHECK_HEADERS): Add sys/param.h for sys/sysctl.h on *BSD.
17752         * demos/calc/calc.y: Change ={ to {, needed for bison 1.50.
17754         * longlong.h (count_leading_zeros, count_trailing_zeros) [x86_64]:
17755         Should be UDItype.
17757         * mpz/set_str.c, mpf/set_str.c, mpbsd/xtom.c, scanf/sscanffuns.c: Cast
17758         chars through "unsigned char" to zero extend, required by C99 ctype.h.
17760 2002-10-18  Torbjorn Granlund  <tege@swox.com>
17762         * tests/mpz/t-root.c: Test also mpz_rootrem.
17764         * mpn/generic/rootrem.c: Avoid overflow problem when n is huge.
17766         * mpz/root.c: Avoid overflow problems in allocation computation; also
17767         simplify it.  Misc cleanups.
17769         * mpz/rootrem.c: New file.
17770         * Makefile.am, mpz/Makefile.am, gmp-h.in: Add them.
17772 2002-10-17  Torbjorn Granlund  <tege@swox.com>
17774         * gmp-impl.h (popc_limb): Combine variants.
17776 2002-10-14  Kevin Ryde  <kevin@swox.se>
17778         * configure.in (AC_CHECK_HEADERS): Add sys/time.h for sys/resource.h
17779         test, needed by SunOS, and next autoconf will insist headers actually
17780         compile.
17782 2002-10-08  Kevin Ryde  <kevin@swox.se>
17784         * tune/time.c (speed_time_init): Allow for Cray times() apparently
17785         being a cycle counter.
17787         * dumbmp.c (mpz_get_str): Fix buf size allocation.
17789         * tests/trace.c, tests/tests.h (mp_limb_trace): New function.
17791         * tune/speed-ext.c (SPEED_EXTRA_PROTOS): Use __GMP_PROTO.
17792         * tests/devel/try.c (malloc_region): Add a cast for SunOS cc.
17794         * configure.in (AC_CHECK_FUNCS): Add strerror.
17795         (AC_CHECK_DECLS): Add sys_errlist, sys_nerr.
17796         * tune/time.c, tests/devel/try.c: Use them.
17798 2002-10-05  Kevin Ryde  <kevin@swox.se>
17800         * configure.in (AC_CHECK_HEADERS): Test float.h, not in SunOS cc.
17801         * printf/repl-vsnprintf.c: Use this.
17803         * configure.in (*sparc*-*-*): Collect up various options for clarity,
17804         use gcc -mcpu=supersparc and ultrasparc3, use cc -xchip, don't use
17805         -xtarget=native, use cc configs with acc, merge SunOS bundled cc and
17806         SunPRO cc configs.
17808         * gmp-impl.h (gmp_randfnptr_t): Use __GMP_PROTO.
17809         (MPZ_REALLOC): Cast _mpz_realloc return value to mp_ptr, for the
17810         benefit of SunOS cc which requires pointers of the same type on the
17811         two legs of a ?:.
17813         * dumbmp.c (mpz_realloc): Add a cast to avoid a warning from SunOS cc.
17815         * acinclude.m4: Allow for i960 b.out default cc output.
17817         * gmp.texi (Random State Initialization): Add gmp_randinit_mt.
17818         (Perfect Square Algorithm): Describe new mpn_mod_34lsub1 use.
17819         (Factorial Algorithm): Describe Jason's new code.
17820         (Binomial Coefficients Algorithm): Ideas about improvements
17821         moved to doc/projects.html.
17822         (Contributors): Add Jason Moxham and Pedro Gimeno.
17824 2002-10-03  Kevin Ryde  <kevin@swox.se>
17826         * gen-psqr.c: New file.
17827         * Makefile.am, mpn/Makefile.am: Use it to generate mpn/perfsqr.h.
17828         * mpn/generic/perfsqr.c: Use generated data, put mod 256 data into
17829         limbs to save space, use mpn_mod_34lsub1 when good.
17830         * tests/mpn/t-perfsqr.c: New file.
17831         * tests/mpn/Makefile.am (check_PROGRAMS): Add it.
17832         * tests/mpz/t-perfsqr.c (check_modulo): New test.
17833         (check_sqrt): New function holding current tests.
17835         * configure.in (AC_INIT): Modernize to package name and version here
17836         rather than AM_INIT_AUTOMAKE, add bug report email.
17837         (AC_CONFIG_SRCDIR): New macro.
17839         * gmp-impl.h (ROUND_UP_MULTIPLE): Fix for non-power-of-2 moduli (not
17840         normal in current uses), clarify the comments a bit.
17842 2002-09-30  Kevin Ryde  <kevin@swox.se>
17844         * mpn/Makeasm.am (.s.lo): Add --tag=CC for the benefit of CCAS!=CC,
17845         same as .S.lo and .asm.lo.
17847         * Makefile.am (gen-fac_ui, gen-fib, gen-bases): Quote source files in
17848         test -f stuff to avoid Sun make rewriting them.
17850 2002-09-28  Kevin Ryde  <kevin@swox.se>
17852         * tests/devel/try.c, tune/speed.c: Avoid strings longer than C99
17853         guarantees.
17855         * tests/refmpn.c, tests/tests.h (refmpn_zero_extend, refmpn_normalize,
17856         refmpn_sqrtrem): New functions.
17857         * tests/devel/try.c (TYPE_SQRTREM): Use refmpn_sqrtrem.
17858         (compare): Correction to tr->dst_size subscripting.
17860         * dumbmp.c: Add several new functions, allow for initial n<d in
17861         mpz_tdiv_q (now in mpz_tdiv_qr actually).
17863         * gen-bases.c (chars_per_limb): Get GMP_NUMB_BITS for base==2,
17864         similarly other powers of 2, which this was in the past.
17865         * tests/refmpn.c (refmpn_chars_per_limb): Ditto.
17866         * tests/mpn/t-mp_bases.c: Test chars_per_limb for power-of-2 bases too.
17868         * Makefile.am, mpz/Makefile.am: Setups for gen-fac_ui.c generating
17869         mpz/fac_ui.h.
17871 2002-09-28  Jason Moxham <J.L.Moxham@maths.soton.ac.uk>
17873         * dumbmp.c (mpz_pow_ui, mpz_addmul_ui, mpz_root): New functions.
17874         * gen-fac_ui.c: New file.
17875         * mpz/fac_ui.c: Rewrite.
17877 2002-09-26  Kevin Ryde  <kevin@swox.se>
17879         * tests/cxx/localeconv.c: New file, split from t-locale.cc.
17880         * tests/cxx/t-locale.cc: Use it.
17881         * tests/cxx/Makefile.am (t_locale_SOURCES): Add it.
17883         * tests/cxx/Makefile.am: Updates for Gerardo's new test programs.
17885 2002-09-26  Gerardo Ballabio <gerardo.ballabio@unimib.it>
17887         * gmpxx.h (__gmp_cmp_function): Bug fixes in double/mpq and
17888         double/mpfr comparisons.
17890         * tests/cxx/t-assign.cc, tests/cxx/t-binary.cc, tests/cxx/t-constr.cc,
17891         tests/cxx/t-ternary.cc, tests/cxx/t-unary.cc: Revise and add various
17892         tests, including some for mpfr, some split from t-expr.cc.
17893         * tests/cxx/t-locale.cc: Modernize include files.
17894         * tests/cxx/t-ostream.cc: Modernize include files, use cout rather
17895         than printf for diagnostics.
17896         * tests/cxx/t-misc.cc, tests/cxx/t-rand.cc: New file, split from
17897         t-allfuns.cc.
17898         * tests/cxx/t-ops.cc: New file, some split from t-allfuns.cc.
17899         * tests/cxx/t-prec.cc: New file.
17900         * tests/cxx/t-allfuns.cc, tests/cxx/t-expr.cc: Remove files.
17902 2002-09-25  Torbjorn Granlund  <tege@swox.com>
17904         * configure.in (*-cray-unicos*): Remove -hscalar0, it causes too much
17905         performance loss.  Let's trust Cray to fix their compilers.
17907 2002-09-24  Torbjorn Granlund  <tege@swox.com>
17909         * mpn/powerpc32/add_n.asm: Rewrite.
17910         * mpn/powerpc32/sub_n.asm: Rewrite.
17912 2002-09-24  Pedro Gimeno  <pggimeno@wanadoo.es>
17914         * randlc2x.c: Prepare for nails by changing type of _mp_c to mpz_t,
17915         make _mp_seed fixed-size, disallow SIZ(a)==0 to optimize comparisons
17916         for mpn_mul.
17917         * gmp-impl.h (MPZ_FAKE_UI): New macro.
17919         * randmt.c: Some constants made long for K&R compliance; remove UL at
17920         the end of other constants; use mp_size_t where appropriate; use
17921         mpz_export to split the seed.
17923         * gmp-impl.h: Remove type cast in RNG_FNPTR and RNG_STATE, to allow
17924         them to be used as lvalues.
17925         * randclr.c, randlc2x.c, randmt.c, randsd.c: All callers changed.
17927         * mpz/urandomm.c: Replace mpn_cmp with MPN_CMP.
17929         * tests/rand/gen.c: Get rid of gmp_errno.
17931 2002-09-24  Kevin Ryde  <kevin@swox.se>
17933         * gmp.texi (Custom Allocation): Keep allocate_function etc out of the
17934         function index by using @deftypevr.
17935         More index entries.
17937 2002-09-24  Gerardo Ballabio <gerardo.ballabio@unimib.it>
17939         * gmpxx.h (mpfr_class constructors from strings): Precision was set
17940         incorrectly, fixed.
17942 2002-09-23  Torbjorn Granlund  <tege@swox.com>
17944         * mpf/urandomb.c: Don't crash for overlarge nbits argument.
17945         Let nbits==0 mean to fill number with random bits.
17947 2002-09-21  Torbjorn Granlund  <tege@swox.com>
17949         * mpn/alpha/mod_34lsub1.asm: Add r31 dummy operand to `br' instruction.
17951 2002-09-20  Gerardo Ballabio <gerardo.ballabio@unimib.it>
17953         * gmpxx.h (__gmp_binary_equal, __gmp_binary_not_equal): Fix broken
17954         mpq/double functions.
17956 2002-09-18  Torbjorn Granlund  <tege@swox.com>
17958         * randmt.c (randget_mt): Fix typo.
17960 2002-09-18  Kevin Ryde  <kevin@swox.se>
17962         * gmp-impl.h (_gmp_rand): Avoid evaluating "state" more than once, for
17963         the benefit places calling it with RANDS.
17965         * randmt.c (randseed_mt): Use mpz_init for mod and seed1, for safety.
17967         * tune/tuneup.c (sqr_karatsuba_threshold): Initialize to
17968         TUNE_SQR_KARATSUBA_MAX so mpn_sqr_n works for randmt initialization.
17970         * gmp.texi (Integer Comparisons): Remove mention of non-existent
17971         mpz_cmpabs_si, reported by Conrad Curry.
17973         * tune/speed.c, tune/speed.h, tune/common.c: Add gmp_randseed,
17974         gmp_randseed_ui and mpz_urandomb.
17976 2002-09-18  Pedro Gimeno  <pggimeno@wanadoo.es>
17978         * tests/rand/gen.c: Add mt, remove lc and bbs.
17980         * Makefile.am (libgmp_la_SOURCES): Add randmt.c, remove randlc.c and
17981         randraw.c.
17983         * randmt.c: New file.
17984         * gmp-h.in (gmp_randinit_mt): Add prototype.
17985         * randdef.c: Use gmp_randinit_mt.
17987         * gmp-impl.h (RNG_FNPTR, RNG_STATE): New macros.
17988         (gmp_randfnptr_t): New structure.
17989         (_gmp_rand): Now a macro not a function.
17990         * gmp-h.in (__gmp_randata_lc): Remove, now internal to randlc2x.c.
17991         (__gmp_randstate_struct): Revise comments on field usage.
17992         * randsd.c, randclr.c: Use function pointer scheme.
17993         * randsdui.c: Use gmp_randseed.
17994         * randraw.c: Remove file.
17995         * randlc2x.c: Collect up lc_2exp related code from randsd.c, randclr.c
17996         and randraw.c, use function pointer scheme, integrate seed==0/a==0
17997         into main case and fix case where bits(a) < m2exp.
17999         * randlc.c: Remove file, never documented and never worked.
18000         * gmp-h.in (gmp_randinit_lc): Remove prototype.
18002 2002-09-16  Torbjorn Granlund  <tege@swox.com>
18004         * mpn/alpha/mod_34lsub1.asm: New file.
18006 2002-09-16  Kevin Ryde  <kevin@swox.se>
18008         * configure.in, acinclude.m4 (GMP_C_RESTRICT): Remove this, not
18009         currently used, and #define restrict upsets Microsoft C headers on
18010         win64.  Reported by David Librik.
18012         * configure.in (x86): Add gcc 3.2 -march and -mcpu flags, remove some
18013         unnecessary -march=i486 fallbacks.
18015         * gmp.texi (Notes for Particular Systems): Note cl /MD is required for
18016         Microsoft C and MINGW to cooperate on I/O.  Explained by David Librik.
18017         (Language Bindings): Add linbox.
18018         * gmp.texi (Language Bindings):
18020 2002-09-12  Kevin Ryde  <kevin@swox.se>
18022         * mpz/aorsmul_i.c: Allow for w==x overlap with nails.  Test
18023         BITS_PER_ULONG > GMP_NUMB_BITS rather than GMP_NAIL_BITS != 0.
18024         * tests/mpz/t-aorsmul.c: Test this.
18026         * tune/common.c: mpn_mod_34lsub1 only exists for GMP_NUMB_BITS%4==0
18027         * tune/speed.c: Add mpn_mod_34lsub1.
18029 2002-09-10  Pedro Gimeno  <pggimeno@wanadoo.es>
18031         * rand.c: Remove old disabled BBS code.
18032         * mpf/urandomb.c: Use BITS_TO_LIMBS.
18034 2002-09-10  Kevin Ryde  <kevin@swox.se>
18036         * gmp.texi (Multiplication Algorithms): FFT is now enabled by default.
18038 2002-09-10  Pedro Gimeno  <pggimeno@wanadoo.es>
18040         * mpz/urandomm.c: Use mpn level functions, avoid an infinite loop if
18041         _gmp_rand forever returns all "1" bits.
18042         * tests/rand/t-urndmm.c: New file
18043         * tests/rand/Makefile.am (check_PROGRAMS): Add it.
18045         * gmp-impl.h (BITS_TO_LIMBS): New macro.
18046         * mpz/urandomb.c: Use it, and use MPZ_REALLOC.
18048 2002-09-08  Kevin Ryde  <kevin@swox.se>
18050         * acinclude.m4 (GMP_GCC_WA_MCPU): New macro.
18051         * configure.in (alpha*-*-*): Use it to avoid -Wa,-mev67 if gas isn't
18052         new enough to know ev67.  Reported by David Bremner.
18054 2002-07-30  Gerardo Ballabio <gerardo.ballabio@unimib.it>
18056         * gmpxx.h (__gmpz_value etc): Remove, use mpz_t etc instead.
18057         (__gmp_expr): Reorganise specializations, use __gmp_expr<T,T> not
18058         mpz_class etc.
18059         (mpfr evals): Remove mode parameter, was always
18060         __gmp_default_rounding_mode anyway.
18062 2002-09-07  Kevin Ryde  <kevin@swox.se>
18064         * gmp-h.in, mp-h.in: Use #ifdef for tests, for the benefit of
18065         applications using gcc -Wundef.
18067         * longlong.h: Define COUNT_LEADING_ZEROS_NEED_CLZ_TAB for all alphas,
18068         since mpn/alpha/cntlz.asm always goes into libgmp.so, even for ev67
18069         and ev68 which don't need it.  Reported by David Bremner.
18071         * gmp.texi (Demonstration Programs): New section, expanding on what
18072         was under "Build Options".
18073         (Converting Floats): Don't need \ for _ in @var within @math.
18074         Add and amend various index entries.
18076         * demos/qcn.c: Add -p prime limit option.
18078 2002-08-30  Kevin Ryde  <kevin@swox.se>
18080         * mpz/pprime_p.c: Handle small negatives with isprime, in particular
18081         must do so for n==-2.
18082         * tests/mpz/t-pprime_p.c: New file.
18083         * tests/mpz/Makefile.am: Add it.
18085 2002-08-26  Torbjorn Granlund  <tege@swox.com>
18087         * gmp.texi (Converting Floats): Fix typo in mpf_get_d_2exp docs,
18088         reported by Paul Zimmermann.
18090 2002-08-26  Kevin Ryde  <kevin@swox.se>
18092         * configure.in: Echo the ABI being tried for the compilers.
18093         (powerpc*-*-*): Use powerpc64/aix.m4 for ABI=aix64 too.
18094         (AC_CHECK_FUNCS): Add strtol, for tests/rand/gen.c.
18096 2002-08-24  Kevin Ryde  <kevin@swox.se>
18098         * configure.in (HAVE_HOST_CPU_, HAVE_HOST_CPU_FAMILY_, HAVE_NATIVE_):
18099         Setup templates for these using AH_VERBATIM rather than acconfig.h,
18100         preferred by latest autoconf.  Prune lists to just things used.
18101         * acconfig.h: Remove file.
18103         * mpn/powerpc32/mode1o.asm: Forgot ASM_START.
18105         * tune/time.c (have_cgt_id): Renamed from HAVE_CGT_ID so avoid
18106         confusion with autoconf outputs, and turn it into a "const" variable.
18108 2002-08-23  Torbjorn Granlund  <tege@swox.com>
18110         * configure.in: Choose powerpc32/aix.m4 or powerpc64/aix.m4 based on
18111         ABI, not configuration triple.
18113         * mpz/pprime_p.c: Partially undo last change--handle small and
18114         negative numbers in the same test.
18116 2002-08-22  Kevin Ryde  <kevin@swox.se>
18118         * gmp-impl.h (MUL_FFT_THRESHOLD, SQR_FFT_THRESHOLD): Note
18119         mpn/generic/mul_fft.c is not nails-capable, and don't bother setting
18120         other FFT data for nails.
18122         * configfsf.guess: Update to 2002-08-19.
18123         * configfsf.sub: Update to 2002-08-20.
18125         * config.guess (powerpc*-*-*): Use a { } construct to suppress SIGILL
18126         message on AIX.
18128 2002-08-20  Kevin Ryde  <kevin@swox.se>
18130         * gmp.texi (Build Options): Add ia64 under cpu types.
18131         (ABI and ISA): Describe IRIX 6 ABI=o32.
18132         (Notes for Particular Systems): Remove -march=pentiumpro, now ok.
18133         (Known Build Problems): Binutils 2.12 is ok for libgmp.a.
18134         (Emacs): New section.
18135         (Language Bindings): Update MLton URL, reported by Stephen Weeks.
18136         (Prime Testing Algorithm): New section.
18137         Don't put a blank line after @item in @table since it can make a page
18138         break between the heading and the entry.
18139         Misc tweaks elsewhere, in particular more index entries.
18141         * mpz/millerrabin.c: Need x to be size+1 for change to urandomm.
18143         * gmp-impl.h: Comments on the use of __GMP_DECLSPEC.
18145         * tune/time.c (freq_measure_mftb_one): Use struct_timeval, for the
18146         benefit of mingw.
18148         * tests/refmpn.c, tests/tests.h (ref_addc_limb, ref_subc_limb):
18149         Renamed from add and sub, following gmp-impl.h ADDC_LIMB and SUBC_LIMB.
18151 2002-08-17  Kevin Ryde  <kevin@swox.se>
18153         * mpn/powerpc32/mode1o.asm: New file.
18154         * configure.in, acinclude.m4 (GMP_ASM_POWERPC_PIC_ALWAYS): New macro.
18155         * mpn/asm-defs.m4: Use it to help setting up PIC.
18157         * configure.in (AC_PREREQ): Bump to 2.53.
18159         * mpn/powerpc32/powerpc-defs.m4 (ASSERT): New macro.
18160         (PROLOGUE_cpu): New macro, giving ALIGN(4) not 8.
18162 2002-08-16  Torbjorn Granlund  <tege@swox.com>
18164         * mpn/m68k/lshift.asm: Fix typo in !scale_available_p code.
18165         * mpn/m68k/rshift.asm: Likewise.
18167 2002-08-16  Kevin Ryde  <kevin@swox.se>
18169         * configure.in (--enable-profiling=instrument): New option.
18170         * gmp.texi (Profiling): Describe it.
18171         * mpn/x86/x86-defs.m4 (PROLOGUE_cpu, call_instrument, ret_internal):
18172         Add support.
18173         (call_mcount): Share PIC setups with call_instrument.
18174         * mpn/x86/*.asm: Use ret_internal.
18175         * mpn/asm-defs.m4 (m4_unquote): New macro.
18176         * tests/mpn/t-instrument.c: New file.
18177         * tests/mpn/Makefile.am: Add it.
18179         * mpn/alpha/umul.asm: Add ASM_END.
18181 2002-08-12  Kevin Ryde  <kevin@swox.se>
18183         * mpz/pprime_p.c: Fake up a local mpz_t to take abs(n), rather than
18184         using mpz_init etc.
18186         * mpz/millerrabin.c: Use mpz_urandomm for uniform selection of x,
18187         reported by Jason Moxham.  Exclude x==n-1, ie. -1 mod n.  Use
18188         gmp_randinit_default.
18190         * mpn/alpha/umul.asm: Use "r" registers, for the benefit of Unicos.
18192         * tests/devel/try.c: Add mpn_copyi and mpn_copyd.
18194 2002-08-09  Kevin Ryde  <kevin@swox.se>
18196         * Makefile.am: Remove configure.lineno from DISTCLEANFILES and gmp.tmp
18197         from MOSTLYCLEANFILES, automake does these itself now.
18199         * */Makefile.in, aclocal.m4, configure, install-sh, missing,
18200         mkinstalldirs: Update to automake 1.6.3.
18202         * mpn/ia64/README: Some notes on assembler syntax.
18204         * mpn/ia64/add_n.asm, mpn/ia64/sub_n.asm: Add .body.
18205         * mpn/ia64/add_n.asm, mpn/ia64/addmul_1.asm, mpn/ia64/mul_1.asm,
18206         mpn/ia64/sub_n.asm: Position .save ar.lc just before relevant
18207         instruction.
18208         * mpn/ia64/addmul_1.asm, mpn/ia64/mul_1.asm: Add .save ar.pfs and pr.
18209         * mpn/ia64/copyd.asm, mpn/ia64/copyi.asm: Correction to .body position.
18210         * mpn/ia64/lorrshift.asm: Add .prologue stuff.
18212         * configure.in (*-*-unicos*): Remove forcible --disable-shared,
18213         libtool gets this right itself now.
18215 2002-08-07  Kevin Ryde  <kevin@swox.se>
18217         * mpn/x86/pentium/mmx/hamdist.asm: New file, adapted from
18218         mpn/x86/pentium/mmx/popham.asm.
18219         * mpn/x86/pentium/mmx/popham.asm: Remove file, not faster than plain
18220         mpn/x86/pentium/popcount.asm for the popcount.
18222         * mpn/alpha/umul.asm: Use PROLOGUE/EPILOGUE, rename it mpn_umul_ppmm.
18223         * configure.in (alpha*-*-*): Add umul to extra_functions.
18225         * mpz/remove.c: Make src==0 return 0, not do DIVIDE_BY_ZERO.
18227 2002-08-05  Torbjorn Granlund  <tege@swox.com>
18229         * acconfig.h: Remove spurious undefs for mpn_divrem_newton and
18230         mpn_divrem_classic.
18232 2002-08-05  Kevin Ryde  <kevin@swox.se>
18234         * tests/refmpn.c, tests/tests.h, tests/misc/t-printf.c,
18235         tests/mpf/t-trunc.c, tests/mpn/t-mp_bases.c, tests/mpn/t-scan.c,
18236         tests/mpq/t-cmp_ui.c, tests/mpz/bit.c, tests/mpz/t-aorsmul.c,
18237         tests/mpz/t-powm_ui.c tests/mpz/t-root.c, tests/mpz/t-scan.c: More
18238         care with long and mp_size_t parameters, for the benefit of K&R.
18240         * demos/perl/GMP.pm, demos/perl/GMP.xs, demos/perl/GMP/Mpz.pm,
18241         demos/perl/test.pl: Add mpz_import and mpz_export.
18242         * demos/perl/GMP.pm: Remove "preliminary" warning.
18244         * mpn/lisp/gmpasm-mode.el: Set add-log-current-defun-header-regexp to
18245         pick up m4 defines etc.
18247         * Makefile.am (libgmpxx_la_DEPENDENCIES): libgmp.la should be here,
18248         not libgmpxx_la_LIBADD, for the benefit of "make -j2".
18250         * mpn/ia64/*.asm [hpux ABI=32]: Extend 32-bit operands to 64-bits, not
18251         optimal and might not be sufficient, but seems to work.
18253 2002-08-03  Kevin Ryde  <kevin@swox.se>
18255         * gmp.texi (Profiling): Use a table and expand for clarity.
18256         (Integer Special Functions): New section for mpz_array_init,
18257         _mpz_realloc, mpz_getlimbn and mpz_size, to discourage their use.
18259         * configure.in (*-*-msdosdjgpp*): Remove forcible --disable-shared,
18260         libtool gets this right itself now.
18262 2002-07-30  Kevin Ryde  <kevin@swox.se>
18264         * mpn/powerpc32/lshift.asm, mpn/powerpc32/rshift.asm: Lose final mr,
18265         and make final stwu into an stw.
18267         * gmp.texi (Known Build Problems): An easier workaround for DESTDIR,
18268         using LD_LIBRARY_PATH.
18269         (C++ Interface MPFR): Remove mpfrxx.h.
18271         * mpfrxx.h: Remove file.
18272         * Makefile.am: Remove mpfrxx.h.
18273         * tests/cxx/Makefile.am: Add Gerardo's new test programs.
18275 2002-07-30  Gerardo Ballabio <gerardo.ballabio@unimib.it>
18277         * gmpxx.h: Use mpz_addmul etc for ternary a+b*c etc.  Reorganise some
18278         macros for maintainability.  Merge mpfrxx.h.
18279         * tests/cxx/t-constr.cc, tests/cxx/t-expr.cc: Various updates.
18280         * tests/cxx/t-assign.cc, tests/cxx/t-binary.cc,
18281         tests/cxx/t-ternary.cc, tests/cxx/t-unary.cc: New files.
18283 2002-07-27  Kevin Ryde  <kevin@swox.se>
18285         * longlong.h (count_trailing_zeros) [ia64 __GNUC__]: Don't use
18286         __builtin_ffs for now, doesn't seem to work.
18288         * configure.in: Establish CONFIG_SHELL to avoid a problem with
18289         AC_LIBTOOL_SYS_MAX_CMD_LEN on ia64-*-hpux*.
18291         * tune/speed.h (SPEED_ROUTINE_MPN_GCD_FINDA): Don't let calls to
18292         mpn_gcd_finda go dead.
18294         * mpn/generic/tdiv_qr.c: Inline mpn_rshift and MPN_COPY of 2 limbs.
18296 2002-07-24  Kevin Ryde  <kevin@swox.se>
18298         * demos/primes.c: Use __GMP_PROTO and don't use signed, for the
18299         benefit of K&R.
18301         * demos/calc/calclex.l: Add <string.h> for strcmp.
18303         * mpn/ia64/invert_limb.asm: Use .rodata which works on ia64-*-hpux*
18304         and should be standard, rather than worrying about RODATA.
18306         * gmp.texi (Function Classes): Add cross references.
18307         (Integer Import and Export): Fix return value grouping.
18309         * mpn/lisp/gmpasm-mode.el (gmpasm-comment-start-regexp): Add // for
18310         ia64.  Add notes on what the various styles are for.
18312         * mpn/ia64/default.m4 (ASM_START): Define to empty, not dnl, so as not
18313         to kill text on the same line.
18314         (EPILOGUE_cpu): Force a newline after "#", so as not to suppress macro
18315         expansion in the rest of the EPILOGUE line.
18317 2002-07-21  Kevin Ryde  <kevin@swox.se>
18319         * tune/speed.h: Fix some missing _PROTOs.
18321         * Makefile.am (DISTCLEANFILES): Add configure.lineno.
18323         * acinclude.m4 (GMP_C_DOUBLE_FORMAT): Define
18324         HAVE_DOUBLE_IEEE_BIG_ENDIAN and HAVE_DOUBLE_IEEE_LITTLE_ENDIAN in
18325         config.m4 too.
18326         * mpn/ia64/invert_limb.asm: Add big-endian data.
18328         * tests/mpz/t-jac.c (try_si_zi): Correction to "a" parameter type.
18330 2002-07-20  Kevin Ryde  <kevin@swox.se>
18332         * mpz/bin_ui.c, mpz/jacobi.c, mpz/pprime_p.c, mpn/generic/divis.c:
18333         More care with long and mp_size_t parameters, for the benefit of K&R.
18335         * gmp-impl.h (invert_limb): Use parens around macro arguments.
18336         (mpn_invert_limb): Give prototype and define unconditionally.
18338         * gmp-impl.h (CACHED_ABOVE_THRESHOLD, CACHED_BELOW_THRESHOLD): New
18339         macros.
18340         * mpn/generic/sb_divrem_mn.c: Use them to help gcc let preinv code go
18341         dead when not wanted.
18343 2002-07-17  Kevin Ryde  <kevin@swox.se>
18345         * tests/refmpz.c (refmpz_hamdist): Ensure mp_size_t parameters are
18346         that type, for the benefit of hpux ia64 bundled cc ABI=64.
18348         * configure.in (ia64*-*-hpux*): Need +DD64 in cc_64_cppflags to get
18349         the right headers for ansi2knr.
18351         * acinclude.m4 (GMP_TRY_ASSEMBLE, GMP_ASM_UNDERSCORE): Use $CPPFLAGS
18352         with $CCAS and when linking, as done by the makefiles.
18353         (GMP_ASM_X86_MMX, GMP_ASM_X86_SSE2): Show $CPPFLAGS in diagnostics.
18355         * gmp-impl.h (ieee_double_extract): Setup using HAVE_DOUBLE_IEEE_*.
18356         (GMP_UINT32): New define, 32 bit type for ieee_double_extract.
18357         * configure.in: Add AC_CHECK_SIZEOF unsigned.
18358         * configure.in, acinclude.m4 (GMP_IMPL_H_IEEE_FLOATS): Remove.
18359         (GMP_C_DOUBLE_FORMAT): Instead warn about unknown float here.
18361         * configure.in, acinclude.m4 (GMP_C_SIZES): Remove.
18362         * acinclude.m4 (GMP_INCLUDE_GMP_H_BITS_PER_MP_LIMB): Remove this
18363         scheme, not required.
18364         * configure.in (unsigned long, mp_limb_t): Run AC_CHECK_SIZEOF for
18365         these unconditionally, check mp_limb_t against gmp-mparam.h values.
18366         * gmp-impl.h (BYTES_PER_MP_LIMB, BITS_PER_MP_LIMB): Define based on
18367         SIZEOF_MP_LIMB_T if not provided by gmp-mparam.h.
18368         (BITS_PER_ULONG): Define here now.
18370         * gmp.texi (ABI and ISA): Add HP-UX IA-64 choices.
18371         (Random State Initialization): Typo in m2exp described for
18372         gmp_randinit_lc_2exp_size.
18373         (Formatted Output Functions): Clarify gmp_obstack_printf a bit.
18374         (Formatted Input Strings): Typo in %n summary.
18376         * mpz/inp_raw.c (NTOH_LIMB_FETCH): Use simple generic default, since
18377         endianness detection is now cross-compile friendly.
18378         * mpz/out_raw.c (HTON_LIMB_STORE): Ditto.
18380         * mpz/fib_ui.c: Nailify.
18381         * mpz/random.c: Nailify.
18383         * mpfr/acinclude.m4 (MPFR_CONFIGS): Patch by Vincent for an apparent
18384         float rounding gremlin on powerpc.
18386 2002-07-15  Kevin Ryde  <kevin@swox.se>
18388         * Makefile.am (PRINTF_OBJECTS): Avoid ending in a backslash, hpux ia64
18389         make doesn't like that.
18391         * mpn/ia64/*.asm: Add .sptk to unconditional branches, add ";" after
18392         .mib etc, for the benefit of hpux.
18394         * configure.in (ia64*-*-*): Use ABI=64 on non-HPUX systems, for
18395         consistency.
18397         * gmp-impl.h (ieee_double_extract): Test __sparc__, used by gcc 3.1.
18398         Reported by nix@esperi.demon.co.uk.
18399         * mpfr/mpfr-math.h (_MPFR_NAN_BYTES etc): Ditto.
18401 2002-07-13  Kevin Ryde  <kevin@swox.se>
18403         * mpn/powerpc32/rshift.asm: Rewrite, transformed from lshift.asm.
18405         * tune/tuneup.c (DIVEXACT_1_THRESHOLD, MODEXACT_1_ODD_THRESHOLD):
18406         Always zero for native mpn_divexact_1, mpn_modexact_1_odd.
18408         * gmp-h.in (__GMP_EXTERN_INLINE): Don't use this during configure,
18409         ie. __GMP_WITHIN_CONFIGURE, to avoid needing dependent routines.
18410         * acinclude.m4 (GMP_H_EXTERN_INLINE): Consequent changes.
18412         * gmp-impl.h, mpn/asm-defs.m4 (mpn_addmul_2, mpn_addmul_3,
18413         mpn_addmul_4): Add prototypes and defines.
18415         * gmp.texi (Number Theoretic Functions): Clarify return value.
18416         Reported by Peter Keller.
18418 2002-07-10  Kevin Ryde  <kevin@swox.se>
18420         * configure.in, acinclude.m4 (GMP_PROG_LEX): Remove this in favour of
18421         AM_PROG_LEX, now ok when lex is missing.
18423         * longlong.h (count_leading_zeros) [pentiummmx]: Don't use __clz_tab
18424         variant under LONGLONG_STANDALONE.
18425         (count_trailing_zeros) [ia64 __GNUC__]: Use __builtin_ffs.
18427         * gmp-impl.h (popc_limb): Add an ia64 asm version.
18428         (DItype): Use HAVE_LONG_LONG to choose long long, avoiding _LONGLONG
18429         which is in gcc but means something unrelated in MS Visual C 7.0.
18430         Reported by David Librik.
18432         * mpz/divexact.c: Add an ASSERT that den divides num.
18434         * mpn/asm-defs.m4 (LDEF): New macro.
18435         (INT32, INT64): Use it.
18436         * mpn/pa32/*.asm: Use it.
18437         * mpn/pa32/README: Update notes on labels.
18439         * tests/refmpn.c, tests/tests.h, tests/t-bswap.c (ref_bswap_limb):
18440         Renamed from refmpn_bswap_limb.
18441         * tests/t-bswap.c: Add tests_start/tests_end for randomization.
18443         * tests/refmpn.c, tests/tests.h (ref_popc_limb): New function.
18444         * tests/t-popc.c: New file.
18445         * tests/Makefile.am: Add it.
18447         * mpn/ia64/invert_limb.asm: Use RODATA since ".section .rodata" is not
18448         accepted by ia64-*-hpux*.
18450         * acinclude.m4 (GMP_ASM_BYTE): New macro.
18451         (GMP_ASM_ALIGN_LOG, GMP_ASM_W32): Use it.
18452         (GMP_ASM_LABEL_SUFFIX): Use test compiles, not $host.
18453         (GMP_ASM_GLOBL): Ditto, and add .global for ia64-*-hpux*.
18454         (GMP_ASM_GLOBL_ATTR): Use GMP_ASM_GLOBL result, not $host.
18455         (GMP_ASM_LSYM_PREFIX): Allow any "a-z" nm symbol code, add ".text" to
18456         test program, required by ia64-*-hpux*.
18457         (GMP_ASM_LABEL_SUFFIX): Make LABEL_SUFFIX just the value, not a "$1:",
18458         the former being how it's currently being used in fact.
18460         * configure.in, acinclude.m4 (GMP_PROG_CC_WORKS_LONGLONG): New macro.
18461         * configure.in (ia64-*-hpux*): Add 32 and 64 bit ABI modes.
18463 2002-07-06  Kevin Ryde  <kevin@swox.se>
18465         * tests/cxx/t-allfuns.cc: New file.
18466         * tests/cxx/Makefile.am: Add it.
18468         * mpz/clrbit.c, mpz/setbit.c: Only MPN_NORMALIZE if high limb changes
18469         to zero.  Use _mpz_realloc return value.
18471         * gmp.texi (Build Options, C++ Formatted Output, C++ Formatted Input):
18472         Cross reference to Headers and Libraries for libgmpxx stuff.
18473         (Low-level Functions): mpn_divexact_by3 result based on GMP_NUMB_BITS.
18474         mpn_set_str takes "unsigned char *", reported by Mark Sofroniou.
18475         (C++ Interface General): Describe linking with libgmpxx and libgmp.
18477 2002-07-01  Kevin Ryde  <kevin@swox.se>
18479         * tune/tuneup.c, gmp-impl.h: Eliminate the array of thresholds in
18480         one(), tune just one at a time and let the callers hand dependencies.
18481         Eliminate the second_start_min hack, handle SQR_KARATSUBA_THRESHOLD
18482         oddities in tune_sqr() instead.
18484         * mpn/pa64/umul.asm, mpn/pa64/udiv.asm, mpn/asm-defs.m4, acconfig.h,
18485         longlong.h, tune/speed.c, tune/speed.h, tune/common.c, tune/many.pl,
18486         tests/devel/try.c: Introduce mpn_umul_ppmm_r and mpn_udiv_qrnnd_r
18487         rather than having variant parameter order for mpn_umul_ppmm and
18488         mpn_udiv_qrnnd on pa64.
18490         * gmp-h.in (mpz_export): Remove a spurious parameter name.
18491         * gmp-impl.h (mpn_rootrem): Use __MPN.
18493 2002-06-29  Kevin Ryde  <kevin@swox.se>
18495         * longlong.h (udiv_qrnnd) [hppa32]: Remove mpn_udiv_qrnnd version, the
18496         general mechanism for that suffices.
18498         * mpf/inp_str.c: Fix returned count of chars read, reported by Paul
18499         Zimmermann.  Also fix a memory leak for invalid input.
18500         * tests/mpf/t-inp_str.c: New file.
18501         * tests/mpf/Makefile.am (check_PROGRAMS): Add it.
18503         * tests/devel/try.c (mpn_mod_34lsub1): Only exists for
18504         GMP_NUMB_BITS%4==0.
18505         (SIZE2_FIRST): Respect option_firstsize2 for "fraction" case.
18507         * mpn/generic/diveby3.c: Further nailifications.
18508         * gmp-impl.h (MODLIMB_INVERSE_3): Allow for GMP_NUMB_BITS odd.
18509         (GMP_NUMB_CEIL_MAX_DIV3, GMP_NUMB_CEIL_2MAX_DIV3): New constants.
18510         * tests/t-constants.c: Check them.
18512         * gmp-h.in (__GMP_CRAY_Pragma): New macro.
18513         (__GMPN_COPY_REST): Use it.
18514         * gmp-impl.h (CRAY_Pragma): Use it.
18516 2002-06-25  Kevin Ryde  <kevin@swox.se>
18518         * mpz/import.c, mpz/export.c: Cast data pointer through "char *" in
18519         alignment tests, for the benefit of Cray vector systems.
18521         * configure.in (x86-*-*): Remove -march=pentiumpro check, seems ok
18522         with current code.
18523         * acinclude.m4 (GMP_GCC_MARCH_PENTIUMPRO, GMP_GCC_VERSION_GE): Remove
18524         macros, no longer needed
18526         * acinclude.m4 (GMP_ASM_RODATA): Remove temporary files.
18528         * configure.in (GMP_ASM_GLOBL_ATTR): Reposition to avoid duplication
18529         through AC_REQUIRE.
18531 2002-06-23  Kevin Ryde  <kevin@swox.se>
18533         * tests/mpz/t-fib_ui.c (check_fib_table): Check table values, not just
18534         that they're non-zero.
18536         * acinclude.m4 (GMP_GCC_ARM_UMODSI): Match bad "gcc --version" output
18537         exactly, rather than parsing it with GMP_GCC_VERSION_GE.
18538         (GMP_ASM_UNDERSCORE): Use GLOBL_ATTR.
18540         * mpn/pa32/udiv.asm, mpn/pa32/hppa1_1/udiv.asm, mpn/pa64/udiv.asm:
18541         Renamed from udiv_qrnnd.asm, for consistency with other udiv's.
18542         * mpn/pa64/umul.asm: Renamed from umul_ppmm.asm likewise.
18543         * configure.in (hppa*-*-*): Update extra_functions.
18544         (NAILS_SUPPORT): Remove umul_ppmm, udiv_qrnnd, udiv_fp, udiv_nfp from
18545         nails-neutral list, no longer needed.
18547         * gmp-h.in (__DECC): Add notes on testing this for ANSI-ness.
18548         (__GMP_EXTERN_INLINE): Add static __inline for DEC C.
18549         (mpz_mod_ui): Move up to main section, it's still documented.
18551 2002-06-22  Kevin Ryde  <kevin@swox.se>
18553         * mpz/jacobi.c, mpz/kronsz.c, mpz/kronuz.c, mpz/kronzs.c,
18554         mpz/kronzu.c: Allow for odd GMP_NUMB_BITS, tweak a few variable setups.
18555         * gmp-impl.h (JACOBI_STRIP_LOW_ZEROS): New macro.
18557         * mpn/generic/mod_34lsub1.c: Nailify.
18558         * tests/devel/try.c (CNST_34LSUB1): Nailify.
18559         * gmp-impl.h (ADDC_LIMB): New macro.
18561         * gmpxx.h (mpf_class::get_str): Make exponent mp_exp_t&, default
18562         base=10 and ndigits=0.
18563         (mpz_class::set_str, mpq_class::set_str, mpf_class::set_str): Add
18564         versions accepting "const char *".
18565         * mpfrxx.h (mpfr_class::get_str, mpfr_class::set_str): Ditto, and
18566         uncommenting set_str and operator=.
18567         * gmp.texi (C++ Interface Integers, C++ Interface Rationals)
18568         (C++ Interface Floats): Update.
18570         * gmp-impl.h (modlimb_invert): Merge the <=64bits and general versions.
18571         (const, signed): Move to near top of file, fixes --enable-alloca=debug
18572         on K&R.
18574         * gen-fib.c: New file, derived from mainline in mpn/generic/fib2_ui.c.
18575         * dumbmp.c (mpz_init_set_ui): New function.
18576         * Makefile.am, mpn/Makefile.am: Generate fib_table.h, mpn/fib_table.c.
18577         * gmp-impl.h: Use fib_table.h, add __GMP_DECLSPEC to __gmp_fib_table
18578         (for the benefit of tests/mpz/t-fib_ui.c).
18579         * mpn/generic/fib2_ui.c: Remove __gmp_fib_table and generating code.
18581         * Makefile.am: Add mp.h to BUILT_SOURCES, distclean all BUILT_SOURCES,
18582         use += more.
18584         * acinclude.m4 (GMP_ASM_M68K_INSTRUCTION, GMP_ASM_M68K_BRANCHES):
18585         Don't let "unknown" get into the cache variables.
18586         (GMP_ASM_TEXT): See what assembles, don't hard-code hpux and aix.
18587         (GMP_PROG_EXEEXT_FOR_BUILD): Add ,ff8 for RISC OS, per autoconf cvs.
18588         (GMP_PROG_CPP_FOR_BUILD): Restructure per AC_PROG_CPP, print correct
18589         result if CPP_FOR_BUILD overrides the cache variable.
18590         (GMP_PROG_CC_FOR_BUILD_WORKS): New macro split from
18591         GMP_PROG_CC_FOR_BUILD.  Allow for "conftest" default compiler output.
18592         * configure.in, acinclude.m4 (GMP_PROG_HOST_CC): Reinstate this,
18593         separating HOST_CC establishment from GMP_PROG_CC_FOR_BUILD.
18595         * configure.in (mpn_objs_in_libgmp): Move mpn/mp_bases.lo ...
18596         * Makefile.am (MPN_OBJECTS): ... to here, add $U, and arrange
18597         MPN_OBJECTS to be common between libgmp and libmp.
18599 2002-06-20  Torbjorn Granlund  <tege@swox.com>
18601         * mpn/generic/mul_n.c (TOOM3_MUL_REC, TOOM3_SQR_REC): Don't check if
18602         basecase is to be invoked when *_TOOM3_THRESHOLD is more than 3 times
18603         the corresponding *_THRESHOLD.
18605 2002-06-20  Kevin Ryde  <kevin@swox.se>
18607         * mpn/ia64/submul_1.c: Add missing TMP_DECL, TMP_MARK, TMP_FREE.
18608         Reported by Paul Zimmermann.
18610         * configure.in, acinclude.m4 (AC_DEFINE): Make templates read "Define
18611         to 1", for clarity as per autoconf.
18612         * acinclude.m4 (GMP_OPTION_ALLOCA): Group WANT_TMP templates.
18614 2002-06-20  Gerardo Ballabio <gerardo.ballabio@unimib.it>
18616         * gmpxx.h, mpfrxx.h: Remove mpz_classref, let mpq_class::get_num and
18617         mpq_class::get_den return mpz_class& as per the documentation.
18618         Reported by Roberto Bagnara.
18620 2002-06-18  Kevin Ryde  <kevin@swox.se>
18622         * tests/rand/t-lc2exp.c: New file.
18623         * tests/rand/Makefile.am: Add it, and use tests/libtests.la.
18625         * randraw.c (lc): Pad seed==0 case with zero limbs, return same
18626         (m2exp+1)/2 bits as normal, right shift "c" result as normal.
18628         * configure.in: Don't bother with line numbers in some diagnostics.
18629         (*-*-mingw*): Use -mno-cygwin if it works, suggested by delta trinity.
18631         * tests/mpz/Makefile.am, tests/mpq/Makefile.am,
18632         tests/misc/Makefile.am, (CLEANFILES): Set to *.tmp for test program
18633         temporaries, to get t-scanf.tmp and reduce future maintenance.
18635 2002-06-16  Torbjorn Granlund  <tege@swox.com>
18637         * mpn/generic/get_str.c (mpn_dc_get_str): Pass scratch memory area in
18638         new `tmp' parameter.  Trim allocation needs by reusing input parameter.
18640 2002-06-15  Torbjorn Granlund  <tege@swox.com>
18642         * mpn/sparc32/v9/udiv.asm: New file.
18644 2002-06-15  Kevin Ryde  <kevin@swox.se>
18646         * acinclude.m4 (GMP_GCC_VERSION_GE): Correction to recognising mingw
18647         gcc 3.1 version number.  Reported by Jim Fougeron.
18649         * configure.in (AC_PROVIDE_AC_LIBTOOL_WIN32_DLL): New define, to make
18650         AC_LIBTOOL_WIN32_DLL work with autoconf 2.53.
18652         * acinclude.m4 (GMP_C_SIZES): Establish BITS_PER_MP_LIMB as a value,
18653         not an expression, for the benefit of the gen-bases invocation.
18655         * config.guess (CC_FOR_BUILD): Try c99, same as configfsf.guess.
18657 2002-06-15  Paul Zimmermann  <Paul.Zimmermann@loria.fr>
18659         * mpfr/set_q.c: Allow for 1 bit numerator or denominator.
18661 2002-06-14  Kevin Ryde  <kevin@swox.se>
18663         * configure.in (AC_C_BIGENDIAN): Use new style action parameters.
18665         * randlc2x.c: Allow for a<0, allow for c>=2^m2exp.
18666         * randraw.c (lc): Allow for a==0.
18668         * mpn/sparc32/udiv.asm: Renamed from udiv_fp.asm.  Don't know if float
18669         is the best way for v7, but it's what configure has chosen since gmp 3.
18670         * configure.in (*sparc*-*-* ABI=32): extra_functions="udiv" for all,
18671         in particular sparc32/v8/udiv.asm is faster (on ultrasparc2) than
18672         udiv_fp previously used for v9 chips.
18674         * gen-bases.c: New file, derived from mpn/mp_bases.c.
18675         * dumbmp.c: New file, mostly by Torbjorn, some by me.
18676         * configure.in, acinclude.m4 (GMP_PROG_CC_FOR_BUILD,
18677         GMP_PROG_CPP_FOR_BUILD, GMP_PROG_EXEEXT_FOR_BUILD,
18678         GMP_C_FOR_BUILD_ANSI, GMP_CHECK_LIBM_FOR_BUILD): New macros.
18679         (GMP_PROG_HOST_CC): Remove, superceded by GMP_PROG_CC_FOR_BUILD.
18680         * Makefile.am: Run gen-bases to create mp_bases.h and mpn/mp_bases.c.
18681         * gmp-impl.h: Use mp_bases.h.
18682         * mpn/mp_bases.c: Remove file.
18683         * mpn/Makefile.am: mp_bases.c now in nodist_libmpn_la_SOURCES.
18685         * tests/mpz/t-cmp_d.c (check_one_2exp): Use volatile to force to
18686         double, fixes gcc 3.1 with -O4.  Reported by Michael Lee.
18687         * configure.in (AC_C_VOLATILE): New macro.
18689         * tests/misc/t-scanf.c: (fromstring_gmp_fscanf): Add missing va_end.
18690         Don't mix varargs and fixed args functions, not good on x86_64.
18691         Reported by Marcus Meissner.
18693         * Makefile.am (EXTRA_DIST): Remove mpfr/README, now in mpfr/Makefile.in
18695         * configure, config.in, INSTALL.autoconf: Update to autoconf 2.53.
18696         * */Makefile.in, install-sh, mdate-sh, missing, aclocal.m4, configure:
18697         Update to automake 1.6.1.
18698         * configfsf.guess, configfsf.sub: Update to 2002-05-29.
18700 2002-06-12  Kevin Ryde  <kevin@swox.se>
18702         * acinclude.m4 (GMP_GCC_VERSION_GE): Recognise mingw gcc 3.1 version.
18703         (GMP_PROG_CC_WORKS): Allow for a_out.exe, as per autoconf.
18704         (GMP_GCC_NO_CPP_PRECOMP, GMP_ASM_UNDERSCORE): Ditto, plus a.exe.
18706 2002-06-09  Torbjorn Granlund  <tege@swox.com>
18708         * randraw.c (lc): Remove broken ASSERT_ALWAYS.
18710         * mpn/x86: Update gmp-mparam.h files with current measures *_THRESHOLD
18711         values.
18712         * mpn/x86/p6/mmx/gmp-mparam.h: New file.
18714 2002-06-09  Kevin Ryde  <kevin@swox.se>
18716         * mpn/x86/*/gmp-mparam.h (USE_PREINV_DIVREM_1): Add tuned settings.
18718         * acconfig.h (HAVE_NATIVE_mpn_preinv_divrem_1): New template.
18720         * tests/refmpn.c, tests/tests.h (refmpn_chars_per_limb,
18721         refmpn_big_base): New functions.
18722         * tests/mpn/t-mp_bases.c: Use them, and don't test big_base_inverted
18723         unless it's being used.
18725         * gmp.texi (Notes for Particular Systems): Using Microsoft C with DLLs.
18726         (Known Build Problems): Notes on MacOS and GCC.
18727         (Integer Logic and Bit Fiddling): Use ULONG_MAX for maximum ulong.
18728         (Low-level Functions): mpn_get_str accepts base==256.
18729         (Formatted Output Functions): Note output is not atomic.
18730         (Internals): Note mp_size_t for limb counts.
18732         * mp-h.in, gmp-h.in (mp_ptr, mp_srcptr, mp_size_t, mp_exp_t): Remove
18733         these types from mp.h, not needed.
18735         * mpfr/tests/tadd.c, mpfr/tests/tmul.c (check): Apply a hack to the
18736         parameter order to make sparc gcc 2.95.2 happy.
18738         * doc/configuration: Notes on bootstrapping.
18740 2002-06-08  Kevin Ryde  <kevin@swox.se>
18742         * mpfr/tests/tsqrt.c, mpfr/tests/tsqrt_ui.c: Suppress tests if sqrt is
18743         not affected by mpfr_set_machine_rnd_mode.
18745         * mpfr/mul_2si.c: Workaround a mips gcc 2.95.3 bug under -O2 -mabi=n32.
18747         * configure.in (alphev56): Fix to use ev5 path.
18749 2002-06-06  Kevin Ryde  <kevin@swox.se>
18751         * gmp-h.in: Use __gmp_const not const, in a number of places.
18753         * configure.in (sparc): Use ABI=32 instead of ABI=standard on v7 and
18754         v8, for consistency with v9 choices.
18755         (sparc64): Restrict GMP_ASM_SPARC_REGISTER to ABI=64.
18756         (x86): Move MMX $path munging to before printout.
18757         (CCAS): Move upward to support this.
18759         * gmp-impl.h (modlimb_invert): Merge macros for specific limb sizes,
18760         add a version for arbitrary limb size, use GMP_NUMB_BITS.
18761         (modlimb_invert, MODLIMB_INVERSE_3): Fix comments to say GMP_NUMB_BITS.
18763         * gmp-h.in (__GMP_LIKELY, __GMP_UNLIKELY): New macros.
18764         (mpz_getlimbn, mpz_perfect_square_p, mpz_popcount): Use them, make the
18765         fetch or mpn call likely, unconditionally calculate the alternative so
18766         as to avoid an "else" clause.
18767         * gmp-impl.h (LIKELY, UNLIKELY): Aliases.
18769         * configure.in, mpfr/tests/Makefile.am: Add $LIBM to $LIBS for
18770         MPFR_CONFIGS so it detects fesetround, and let it go through to
18771         $MPFR_LIBS.
18772         * mpfr/rnd_mode.c: Use gmp-impl.h to get MPFR_HAVE_FESETROUND.
18774         * tests/mpz/t-sizeinbase.c: Disable fake bits test, such pointer
18775         setups are bogus and have been seen failing on hppa.
18777         * tests/misc.c, tests/refmpz.c, tests.tests.h, tests/mpz/t-cong.c:
18778         Rename mpz_flipbit to refmpz_combit and move from misc.c to refmpz.c.
18780 2002-06-05  Torbjorn Granlund  <tege@swox.com>
18782         * tests/mpz/t-powm_ui.c Print proper routine name in error message.
18784 2002-06-03  Kevin Ryde  <kevin@swox.se>
18786         * tune/time.c, tune/freq.c, tune/speed.h: Add powerpc mftb support.
18787         (FREQ_MEASURE_ONE): Move to speed.h, fix tv_sec factor.
18788         (freq_measure): Use for mftb measuring too.
18789         * tune/powerpc.asm, tune/powerpc64.asm: New files.
18790         * configure.in, tune/Makefile.am: Add them.
18792         * gmp-impl.h (popc_limb): Add versions for Cray and fallback for
18793         arbitrary limb size.
18795         * mpn/sparc32/sparc-defs.m4: New file.
18796         * configure.in (sparc*-*-*): Use it.
18797         * acinclude.m4 (GMP_ASM_SPARC_REGISTER): New macro.
18798         * configure.in (sparc64): Use it.  Also, use -Wc,-m64 for linking.
18799         * mpn/sparc64/add_n.asm, mpn/sparc64/addmul_1.asm,
18800         mpn/sparc64/copyd.asm, mpn/sparc64/copyi.asm, mpn/sparc64/lshift.asm,
18801         mpn/sparc64/mul_1.asm, mpn/sparc64/rshift.asm,
18802         mpn/sparc64/sqr_diagonal.asm, mpn/sparc64/sub_n.asm,
18803         mpn/sparc64/submul_1.asm: Use REGISTER for .register.
18805 2002-06-01  Kevin Ryde  <kevin@swox.se>
18807         * mpz/powm_ui.c: Fix for result range in certain circumstances.
18809         * mpn/x86/k6/diveby3.asm: Speedup to 10 c/l, same as divexact_1.
18810         Anomaly pointed out by Alexander Kruppa.
18812 2002-05-31  Torbjorn Granlund  <tege@swox.com>
18814         * mpz/export.c: Cast pointer via `unsigned long' when checking
18815         alignment to avoid compiler warnings.
18817 2002-05-29  Kevin Ryde  <kevin@swox.se>
18819         * gmp-impl.h (BSWAP_LIMB): Versions for m68k, powerpc, and arbitrary
18820         limb size.
18821         * configure.in, acconfig.h (HAVE_HOST_CPU_FAMILY_m68k): New define.
18823 2002-05-27  Torbjorn Granlund  <tege@swox.com>
18825         * mpn/generic/mul_basecase.c: Improve MAX_LEFT handling, returning
18826         when possible.  Add code for mpn_addmul_5 and mpn_addmul_6.
18828 2002-05-25  Kevin Ryde  <kevin@swox.se>
18830         * tune/tuneup.c: Misc nailifications, and disable preinv thresholds
18831         with nails.
18832         * tune/speed.h: Use GMP_NUMB_HIGHBIT with mpn_sb_divrem_mn and
18833         mpn_divrem_2.
18834         * mpz/powm.c (redc): Nailify q.
18836         * tests/mpn/t-scan.c: Reduce the amount of testing, to go faster.
18838 2002-05-23  Torbjorn Granlund  <tege@swox.com>
18840         * Version 4.1 released.
18842         * mpn/alpha/ev6/nails/gmp-mparam.h: New file.
18844         * tests/devel/add_n.c (refmpn_add_n): Nailify.
18845         * tests/devel/sub_n.c (refmpn_sub_n): Nailify.
18846         * tests/devel/addmul_1.c (refmpn_addmul_1): Nailify.
18847         * tests/devel/submul_1.c (refmpn_submul_1): Nailify.
18849         * mpn/alpha/ev6/nails/add_n.asm: New file.
18850         * mpn/alpha/ev6/nails/sub_n.asm: New file.
18851         * mpn/alpha/ev6/nails/mul_1.asm: New file.
18852         * mpn/alpha/ev6/nails/submul_1.asm: New file.
18854 2002-05-22  Torbjorn Granlund  <tege@swox.com>
18856         * mpn/alpha/ev6/nails/addmul_1.asm: New file.
18858         * mpz/inp_str.c (mpz_inp_str_nowhite): Nailify.
18860         * mpn/generic/mul_basecase.c: Update pointers before conditional
18861         MAX_LEFT break statements.
18863 2002-05-21  Torbjorn Granlund  <tege@swox.com>
18865         * tests/mpz/t-gcd.c: Test mpz_gcd_ui.
18867         * mpz/lcm_ui.c: Nailify.
18869         * mpz/gcd_ui.c: Nailify.  Make it work as documented, allowing
18870         NULL to be passed for result parameter.  Fix gcd(0,0) case.
18872         * mpz/set_str.c: Nailify.
18874         * randlc2x.c (gmp_randinit_lc_2exp): Nailify.
18876         From Jakub Jelinek:
18877         * longlong.h (add_ssaaaa,sub_ddmmss) [64-bit sparc]:
18878         Make it actually work.
18880 2002-05-18  Torbjorn Granlund  <tege@swox.com>
18882         * mpf/ui_div.c: Shut up compiler warning.
18884         * mpn/generic/mul_basecase.c: Use mpn_addmul_2, mpn_addmul_3, and
18885         mpn_addmul_4, as available.
18887         * mpn/alpha/ev6/nails/addmul_2.asm: Adjust NAILS_SUPPORT decls.
18888         * mpn/alpha/ev6/nails/addmul_3.asm: Likewise
18889         * mpn/alpha/ev6/nails/addmul_4.asm: Likewise.
18891         * configure.in (*-cray-unicos*): Back again to -hscalar0.
18892         (gmp_mpn_functions_optional): Add mul_3, mul_4, addmul_2, addmul_3,
18893         and addmul_4.
18894         * acconfig.h: Add #undefs for new optional mpn functions.
18896 2002-05-18  Kevin Ryde  <kevin@swox.se>
18898         * gmp.texi (Integer Import and Export): Mention Cray unfilled words.
18900         * mpz/set_d.c, mpq/set_d.c: Use LIMBS_PER_DOUBLE for the output of
18901         __gmp_extract_double.  Reported by Henrik Johansson.
18903 2002-05-17  Torbjorn Granlund  <tege@swox.com>
18905         * mpn/alpha/ev6/nails/addmul_2.asm: New file.
18906         * mpn/alpha/ev6/nails/addmul_3.asm: New file.
18907         * mpn/alpha/ev6/nails/addmul_4.asm: New file.
18909         * mpn/generic/dump.c: Rewrite and nailify.
18911 2002-05-16  Kevin Ryde  <kevin@swox.se>
18913         * mpfr/Makefile.am (EXTRA_DIST): Add BUGS file.
18915 2002-05-15  Torbjorn Granlund  <tege@swox.com>
18917         * configure.in (*-cray-unicos*): Remove -hscalar0, add -hnofastmd
18918         as workaround for compiler bug.
18919         (mips64*-*-*): Pass just -O1 to cc, to work around compiler bug.
18921 2002-05-14  Torbjorn Granlund  <tege@swox.com>
18923         * configure.in (*-cray-unicos*): Pass -hscalar0 to work around
18924         compiler bug for mpz/import.c.
18926 2002-05-11  Torbjorn Granlund  <tege@swox.com>
18928         * mpz/import.c: Cast pointer via `unsigned long' when checking
18929         alignment to avoid compiler warnings.
18931         * mpn/generic/rootrem.c: Adjust allocation of qp temporary area.
18933 2002-05-09  Kevin Ryde  <kevin@swox.se>
18935         * mpz/import.c: Corrections to size store, special case tests, and
18936         general case ACCUMULATE.
18937         * tests/mpz/t-import.c, tests/mpz/t-export.c: More test data.
18939 2002-05-09  Torbjorn Granlund  <tege@swox.com>
18941         * mpn/generic/rootrem.c: Use temp space for root, copy value in place
18942         before returning.
18943         * mpz/root.c: Don't allocate extra limb for root value.
18944         * mpz/perfpow.c: Undo last change.
18946 2002-05-08  Torbjorn Granlund  <tege@swox.com>
18948         * gmp-impl.h (powerpc BSWAP_LIMB_FETCH): Rename local variable to make
18949         it not clash with caller.
18951         * mpn/generic/rootrem.c: New file.
18952         * configure.in (gmp_mpn_functions): Add rootrem and pow_1.
18953         * mpn/Makefile.am (nodist_libdummy_la_SOURCES): Add rootrem.c and
18954         pow_1.c
18955         * gmp-impl.h (mpn_rootrem): Add declaration.
18956         * mpz/perfpow.c: Amend allocations for mpn_rootrem requirements.
18957         * mpz/root.c: Rewrite to use mpn_rootrem.
18959 2002-05-08  Kevin Ryde  <kevin@swox.se>
18961         * gmp-impl.h (MUL_KARATSUBA_THRESHOLD etc): Remove forced nail values.
18963         * mpf/fits_u.h, mpf/fits_s.h, tests/mpf/t-fits.c: Ignore fraction
18964         part, making the code match the documentation.
18966         * gmpxx.h (struct __gmp_binary_minus): Use mpz_ui_sub.
18968 2002-05-07  Kevin Ryde  <kevin@swox.se>
18970         * mpn/powerpc32/README: New file.
18972         * mpz/root.c: Use unsigned long with mpz_sub_ui not mp_limb_t.
18974         * tune/README: Misc updates including sparc32/v9 smoothness, low res
18975         timebase, and mpn_add_n operand overlaps.
18976         * tune/many.pl: Add udiv.asm support.
18978         * gmp.texi (Build Options): A couple of --build better as --host.
18979         (Known Build Problems, Notes for Package Builds): Add DESTDIR problem.
18980         (Compatibility with older versions): Compatible with 4.x versions.
18981         (Converting Integers): Remove mpz_get_ui + mpz_tdiv_q_2exp decompose.
18982         (Integer Import and Export): New section.
18983         (Miscellaneous Integer Functions): Clarify mpz_sizeinbase returns 1
18984         for operand of 0.
18985         (Language Bindings): Add GNU Pascal.
18986         (Low-level Functions): Add GMP_NUMB_MAX.
18988         * tests/mpz/t-import.c, tests/mpz/t-export.c, tests/mpz/t-get_d.c:
18989         New tests.
18990         * tests/mpz/Makefile.am: Add them.
18992         * mpz/import.c, mpz/export.c: New files.
18993         * Makefile.am, mpz/Makefile.am, gmp-h.in: Add them.
18995         * gmp-h.in, gmp-impl.h (GMP_NUMB_MAX): Move to gmp.h.
18996         * gmp-impl.h (CNST_LIMB): Add cast to mp_limb_t to ensure unsigned.
18997         (CRAY_Pragma, MPN_REVERSE, MPN_BSWAP, MPN_BSWAP_REVERSE,
18998         ASSERT_ALWAYS_LIMB, ASSERT_ALWAYS_MPN): New macros.
18999         (MPZ_CHECK_FORMAT): Use ASSERT_ALWAYS_MPN.
19001 2002-05-07  Torbjorn Granlund  <tege@swox.com>
19003         * mpz/aors_ui.h: Nailify.
19005         * tests/mpz/t-addsub.c: New file.
19006         * tests/mpz/Makefile.am (check_PROGRAMS): Add t-addsub.
19008         * mpz/ui_sub.c: New file.
19009         * mpz/Makefile.am (libmpz_la_SOURCES): Add ui_sub.c.
19010         * Makefile.am (MPZ_OBJECTS): Ditto.
19011         * gmp-h.in (mpz_ui_sub): Add declaration.
19013         * gmp-impl.h (MPZ_REALLOC): Rewrite to allow the use of _mpz_realloc
19014         return value.
19016         * gmp-h.in (mpn_pow_1): Add declaration.
19018         * mpn/generic/pow_1.c: Handle exp <= 1.  Reverse rp/tp parity scheme
19019         for bn == 1 arm.
19021         * Rename MP_LIMB_T_HIGHBIT => GMP_LIMB_HIGHBIT.
19023 2002-05-06  Torbjorn Granlund  <tege@swox.com>
19025         * demos/pexpr.c (main): Don't call mpz_sizeinbase with negative base.
19027         * randraw.c (lc): Remove an unused variable.
19029         * mpn/generic/get_str.c: Clarify an algorithm description.
19031         * tests/mpf/t-trunc.c: Nailify.
19032         * tests/mpf/t-set_si.c: Disable for nails.
19034         * mpf/cmp_si.c: Nailify.
19035         * mpf/cmp_ui.c: Nailify.
19036         * mpf/div.c: Nailify.
19037         * mpf/div_2exp.c: Nailify.
19038         * mpf/div_ui.c: Nailify.
19039         * mpf/eq.c: Nailify.
19040         * mpf/get_d.c: Nailify.
19041         * mpf/get_d_2exp.c: Nailify.
19042         * mpf/get_si.c: Nailify.
19043         * mpf/get_str.c: Nailify.
19044         * mpf/get_ui.c: Nailify.
19045         * mpf/mul_2exp.c: Nailify.
19046         * mpf/random2.c: Nailify.
19047         * mpf/set_q.c: Nailify.
19048         * mpf/set_si.c: Nailify.
19049         * mpf/set_str.c: Nailify.
19050         * mpf/set_ui.c: Nailify.
19051         * mpf/sub.c: Nailify.
19052         * mpf/ui_div.c: Nailify.
19053         * mpf/ui_sub.c: Nailify.
19054         * mpf/urandomb.c: Nailify.
19056         * gmp-impl.h (__GMPF_BITS_TO_PREC, __GMPF_PREC_TO_BITS): Nailify.
19058         * mpz/get_si.c: Misc variable name changes.
19060         * mpf/fits_u.h: Rewrite - nailify.
19061         * mpf/fits_s.h: Likewise.
19063         * mpz/mod.c: Disambiguate if-statement with extra {}.
19065         * mpf/int_p.c: Fix type of size variables.
19066         * mpf/get_ui: Likewise.
19067         * mpf/get_si: Likewise.
19068         * mpq/equal.c: Likewise.
19069         * mpq/get_d.c: Likewise.
19070         * mpz/cmp_d.c: Likewise.
19071         * mpz/cmpabs_d.c: Likewise.
19072         * mpz/divis_2exp.c: Likewise.
19073         * mpz/kronuz.c: Likewise.
19074         * mpz/kronzu.c: Likewise.
19075         * mpz/kronzs.c: Likewise.
19076         * mpz/kronsz.c: Likewise.
19077         * mpz/scan0.c: Likewise.
19078         * mpz/scan1.c: Likewise.
19079         * mpz/tstbit.c: Likewise.
19080         * mpz/cong_2exp.c: Likewise.
19081         * mpz/divis.c: Likewise.
19083 2002-05-04  Torbjorn Granlund  <tege@swox.com>
19085         * mpn/generic/gcd.c: Additional nailify changes.
19087 2002-05-04  Kevin Ryde  <kevin@swox.se>
19089         * gmp-h.in (__GNU_MP_VERSION): Set to 4.1.
19090         * Makefile.am (-version-info): Bump for new release.
19092 2002-04-30  Torbjorn Granlund  <tege@swox.com>
19094         * mpn/generic/divrem_1.c: Additional nailify changes.
19095         * mpn/generic/mod_1.c: Likewise.
19097         * tests/mpq/t-get_d.c: Print floats with all 16 digits.
19099         * mpq/get_d.c: Nailify.
19101         * tests/mpq/t-set_f.c: Disable for nails.
19103         * mpz/get_d.c: Nailify.
19105         * gmp-impl.h (LIMBS_PER_DOUBLE, MP_BASE_AS_DOUBLE): Nailify.
19107         * gmp-h.in (__GMPZ_FITS_UTYPE_P): Cast maxval to before shifting it.
19109         * extract-dbl.c: Nailify.
19111 2002-04-29  Torbjorn Granlund  <tege@swox.com>
19113         * mpq/md_2exp.c (mord_2exp): Nailify.
19115         * mpq/cmp_ui.c: Nailify.
19117         * mpq/cmp.c (mpq_cmp): Nailify.
19119         * mpn/generic/gcd.c: Nailify.  GNUify code layout.
19121         * mpn/generic/gcdext.c: Nailify.  Misc changes.
19123         * tests/mpz/t-sqrtrem.c: Let argv[1] mean # of repetitions.
19124         * tests/mpz/t-gcd.c: Likewise.
19126         * mpz/gcd.c: Nailify.
19128         * mpn/generic/random.c: Nailify.
19130         * gmp-impl.h (modlimb_invert): Nailify.
19132 2002-04-27  Torbjorn Granlund  <tege@swox.com>
19134         * mpn/generic/gcdext.c (div2): Remove qh parameter.
19135         (mpn_gcdext): Streamline double-limb code.
19136         Move GCDEXT_THRESHOLD check to after initial division.
19138 2002-04-27  Kevin Ryde  <kevin@swox.se>
19140         * gmp-impl.h (JACOBI_MOD_OR_MODEXACT_1_ODD): Allow for odd
19141         GMP_NUMB_BITS.
19143         * tune/time.c (sgi_works_p): Allow for 64-bit counter, and fix
19144         SGI_CYCLECNTR_SIZE handling.
19146         * demos/expr/exprfr.c: Add nan and inf constants.
19147         * demos/expr/t-expr.c: Exercise them.
19149 2002-04-26  Torbjorn Granlund  <tege@swox.com>
19151         * mpz/cmp_ui.c: Fix overflow conditions for nails.
19153         * gmp-h.in (mpz_get_ui): Fix typo from last change.
19155         * mpz/n_pow_ui.c: Adjust allocation for nails.
19156         (GMP_NUMB_HALFMAX): Renamed from MP_LIMB_T_HALFMAX.
19157         Fix umul_ppmm invocation for for nails.
19159 2002-04-24  Torbjorn Granlund  <tege@swox.com>
19161         * mpn/generic/gcdext.c: Simplify by using mpn_tdiv_qr instead of
19162         mpn_divmod.
19164 2002-04-24  Kevin Ryde  <kevin@swox.se>
19166         * configure.in (*-*-cygwin*): Give a sensible default command line
19167         limit, to avoid blowups reported by Jim Fougeron on windows 9x.
19168         (--enable-nails): Make the default 2, since mp_bases has data for that.
19170         * mpfr/mpfr-math.h (__mpfr_nan): Use a "double" for the bytes, to
19171         avoid a mis-conversion on alpha gcc 3.0.2.
19172         (_MPFR_INFP_BYTES, _MPFR_INFM_BYTES): Should be a zero mantissa.
19174 2002-04-23  Torbjorn Granlund  <tege@swox.com>
19176         * mpz/dive_ui.c: Fix typo.
19178         * mpz/fits_s.h: Rewrite.
19180         * mpz/jacobi.c: Nailify.
19181         * mpz/kronuz.c: Additional nailify changes.
19182         * mpz/kronsz.c: Likewise.
19184 2002-04-23  Kevin Ryde  <kevin@swox.se>
19186         * demos/expr/Makefile.am (LDADD): Add $(LIBM) for the benefit of mpfr.
19188         * mpz/divis_ui.c, mpz/cong_ui.c: Nailify.
19189         * mpn/generic/bdivmod.c, mpz/divexact.c, mpz/dive_ui.c: Nailify.
19190         * mpn/generic/sb_divrem_mn.c, mpn/generic/divrem.c,
19191         mpn/generic/divrem_2.c: Nailify ASSERTs.
19192         * mpn/x86/k6/mmx/logops_n.asm, mpn/x86/k6/mmx/com_n.asm: Nailify.
19193         * mpz/inp_raw.c, mpz/out_raw.c: Nailify.
19194         * mpz/kronzu.c, mpz/kronuz.c, mpz/kronzs.c, mpz/kronsz.c: Nailify.
19195         * mpn/generic/divis.c, mpz/cong.c, mpz/cong_2exp.c: Nailify.
19196         * gmp-impl.h (NEG_MOD): Nailify.
19198         * gmp-impl.h, mpn/mp_bases.c: Add back GMP_NUMB_BITS==30 bases data.
19200         * mpfr/get_d.c: Patch from Paul to avoid problem with constant folding
19201         in gcc on OSF.
19203         * mpn/lisp/gmpasm-mode.el: Remove mention of defunct LF macro.
19205 2002-04-22  Torbjorn Granlund  <tege@swox.com>
19207         * demos/pexpr.c: Handle "binomial" operator.
19209         * mpz/cmp_ui.c: Move assignments of `up' out of conditionals.
19211         * mpn/generic/gcdext.c: Fix fencepost error in STAT code.
19213         * gmp-impl.h (mpn_com_n): Nailify.
19215         * tests/mpz/t-cdiv_ui.c: New file.
19216         * tests/mpz/Makefile.am (check_PROGRAMS): Add t-cdiv_ui.
19217         * mpz/cdiv_qr_ui.c: Nailify.
19218         * mpz/cdiv_q_ui.c: Nailify.
19219         * mpz/cdiv_r_ui.c: Nailify.
19220         * mpz/cdiv_ui.c: Nailify.
19222         * tests/misc/t-printf.c (CHECK_N): Add cast to allow `char' to be an
19223         unsigned type.
19224         * tests/misc/t-scanf.c: Likewise.
19226         * mpz/mul_i.h: Rework nails code to handle parameter overlap.
19228         * tests/mpz/t-set_f.c: Disable for nails.
19230 2002-04-21  Torbjorn Granlund  <tege@swox.com>
19232         * mpz/set_si.c: Add cast to support LONG_LONG_LIMB.
19233         * mpz/iset_si.c: Likewise.
19235         * mpz/bin_ui.c: Nailify.
19236         * mpz/bin_uiui.c: Nailify.
19238         * mpz/cmpabs_ui.c: Nailify.
19240         * tests/mpz/t-aorsmul.c: Nailify.
19241         * mpz/aorsmul_i.c (mpz_addmul_ui, mpz_submul_ui): Nailify better.
19243 2002-04-20  Torbjorn Granlund  <tege@swox.com>
19245         * tests/mpz/t-fdiv_ui.c: Check mpz_fdiv_ui.
19246         * tests/mpz/t-tdiv_ui.c: Check mpz_tdiv_ui.
19248         * mpz/tdiv_ui.c: Rewrite nails code.
19249         * mpz/fdiv_ui.c: Nailify.
19251         * tests/mpz/t-tdiv_ui.c: Check returned remainders.
19252         * tests/mpz/t-fdiv_ui.c: Merge in recent t-tdiv_ui changes.
19254         * mpz/tdiv_q_ui.c: Remove spurious TMP_* calls.
19256         * mpz/fdiv_qr_ui.c: Nailify.
19257         * mpz/fdiv_q_ui.c: Nailify.
19258         * mpz/fdiv_r_ui.c: Nailify.
19260         * mpz/get_si.c: Misc nailify changes to shut up compiler warnings.
19262         * mpz/ui_pow_ui.c: Fix typo in last change.
19264 2002-04-20  Kevin Ryde  <kevin@swox.se>
19266         * tests/misc/t-printf.c, tests/misc/t-scanf.c: Check all %n types.
19268         * mpn/x86/k7/mmx/divrem_1.asm, mpn/x86/p6/mmx/divrem_1.asm
19269         (mpn_preinv_divrem_1): New entrypoint.
19270         (mpn_divrem_1): Avoid a branch when testing high<divisor.
19271         * mpn/asm-defs.m4: Add define_mpn(preinv_divrem_1).
19272         * configure.in: Allow divrem_1.asm to provide mpn_preinv_divrem_1.
19274         * gmp-impl.h [nails]: Add #undefs of MUL_KARATSUBA_THRESHOLD etc, to
19275         override CPU gmp-mparam.h.  Remove JACOBI_BASE_METHOD override since
19276         it's nails-neutral.
19278         * tests/mpn/t-mp_bases.c: New file.
19279         * tests/mpn/Makefile.am (check_PROGRAMS): Add it.
19280         * tests/t-constants.c: Move MP_BASES constants checks to it.
19282         * mpn/mp_bases.c: Fix big_base_inverted values for nails.
19283         * gmp-impl.h (MP_BASES_BIG_BASE_INVERTED_10,
19284         MP_BASES_NORMALIZATION_STEPS_10): Fix nails values.
19285         (MP_BASES_*): Remove GMP_NUMB_BITS == 30 data.
19287         * mpn/x86/pentium/com_n.asm, mpn/x86/pentium/logops_n.asm: Add
19288         NAILS_SUPPORT indicators.
19290         * configure.in: Grep for NAILS_SUPPORT in cpu-specific code, and look
19291         in "nails" subdirectories, print path used.
19292         * mpn/asm-defs.m4 (NAILS_SUPPORT): New macro.
19294         * mpfr/mpfr-test.h: Include config.h, for the benefit of test programs
19295         not using gmp-impl.h.
19297 2002-04-19  Torbjorn Granlund  <tege@swox.com>
19299         * tests/mpz/t-scan.c: Nailify.
19301         * mpz/tdiv_qr_ui.c: Nailify.
19302         * mpz/tdiv_q_ui.c: Nailify.
19303         * mpz/tdiv_r_ui.c: Nailify.
19304         * mpz/tdiv_ui.c: Nailify.
19306         * mpz/cmp_ui.c: Nailify.
19308         * mpz/ui_pow_ui.c: Misc nailify changes to shut up compiler warnings.
19310         * mpz/scan0.c: Nailify.
19311         * mpz/scan1.c: Nailify.
19313         * tests/mpz/t-sizeinbase.c (mpz_fake_bits): Nailify.
19315 2002-04-18  Torbjorn Granlund  <tege@swox.com>
19317         * mpz/aorsmul_i.c: Nailify.
19319         * mpz/cmp_si.c: Nailify (botched).
19321         * mpz/ui_pow_ui.c: Nailify.
19323         * gmp-h.in (__GMPZ_FITS_UTYPE_P): Nailify.
19325         * mpz/fits_s.h: Nailify.
19327         * tests/mpz/bit.c (check_tstbit): Nailify.
19329         From Paul Zimmermann:
19330         * mpn/generic/sqrtrem.c: Nailify.
19332         * mpz/n_pow_ui.c: Nailify.
19334         * mpz/cfdiv_r_2exp.c: Nailify.
19336         * randraw.c (lc): Undo: Let mpn_rshift put result in place to avoid
19337         extra MPN_COPY.
19339 2002-04-17  Torbjorn Granlund  <tege@swox.com>
19341         * mpz/clrbit.c: Add two GMP_NUMB_MASK masks after addition.
19343         * mpn/generic/random2.c (LOGBITS_PER_BLOCK): Decrease to 4.
19345         * gmp-impl.h (nail DIV_DC_THRESHOLD): Decrease to 50 to allow fast
19346         division.
19348         * mpn/generic/random2.c: Nailify.
19350         * mpz/fac_ui.c: Nailify.
19352         * mpz/mul_i.h: #if ... #endif code block to shut up gcc warnings.
19354         * mpn/generic/sqrtrem.c: Adopt to GNU coding standards.
19355         (mpn_dc_sqrtrem): New name for mpn_dq_sqrtrem.
19356         Partial nailification.
19358         * configure.in: As a temporary hack, clear extra_functions for nails
19359         builds.
19361         * gmp-h.in (mpz_get_ui): #if ... #endif else code block to shut up gcc
19362         warnings.
19364 2002-04-17  Kevin Ryde  <kevin@swox.se>
19366         * texinfo.tex: Update to 2002-03-26.08 per texinfo 4.2.
19367         * gmp.texi: Must have @top in @ifnottex (or @contents doesn't come out
19368         in one run).
19370         * mpn/generic/scan0.c, mpn/generic/scan1.c: Nailify.
19372         * tests/mpn/t-scan.c: New file.
19373         * tests/mpn/Makefile.am (check_PROGRAMS): Add it.
19375         * tests/refmpn.c, tests/tests.h (refmpn_tstbit): Use unsigned long for
19376         bit index.
19377         (refmpn_setbit, refmpn_clrbit, refmpn_scan0, refmpn_scan1): New
19378         functions.
19380         * mpfr/cmp_ui.c (mpfr_cmp_si_2exp): Fix b==0 i!=0 case.
19382 2002-04-17  Gerardo Ballabio <gerardo.ballabio@unimib.it>
19384         * gmpxx.h, mpfrxx.h: Remove mpfr_class bool combinations, remove
19385         mpfr_class::get_str2, use mp_rnd_t for rounding modes, use
19386         8*sizeof(double) for mpfr_t's holding doubles.
19388 2002-04-17  Torbjorn Granlund  <tege@swox.com>
19390         * mpz/powm.c: Nailify.
19391         * mpz/powm_ui.c: Nailify.
19393 2002-04-16  Torbjorn Granlund  <tege@swox.com>
19395         * mpz/hamdist.c: Nailify.
19396         * tests/misc.c (urandom): Nailify.
19398         * mpz/get_si.c: Nailify.
19399         * gmp-h.in (mpz_get_ui): Nailify.  Streamline (and probably upset
19400         memory checkers).
19402         * gmp-impl.h (mp_bases[10] values): Add versions for GMP_NUMB_BITS
19403         being 28, 60, and 63.
19404         * mpn/mp_bases.c: Add tables for GMP_NUMB_BITS being 28, 60, and 63.
19406         * mpz/iset_si.c: Nailify.
19407         * mpz/iset_ui.c: Nailify
19409         * tests/mpz/convert.c (main): Print test number in error message.
19411         * mpn/generic/get_str.c (mpn_sb_get_str): Shift up `frac' into nails
19412         field after bignum division.
19414 2002-04-16  Kevin Ryde  <kevin@swox.se>
19416         * gmp-h.in, gmp-impl.h (GMP_NAIL_MASK): Move to gmp.h.
19418         * gmp.texi: Use @documentdescription and @copying, per texinfo 4.2.
19419         (Low-level Functions): Clarify mpn_gcd overlap requirements, rewrite
19420         mpn_set_str description, add nails section.
19421         (C++ Interface General): Remove bool from types that mix with classes.
19422         (Language Bindings): Add STklos, GNU Smalltalk, Regina.
19423         (Binary to Radix, Radix to Binary): Describe new code.
19424         (Assembler Cache Handling): More notes, mostly by Torbjorn.
19426         * macos/configure (%vars): Remove __GMP from substitutions, per change
19427         to main configure.
19429         * mpn/generic/dive_1.c: Nailify.
19430         * mpn/generic/mode1o.c: Nailify, remove bogus ASSERT in commented-out
19431         alternate implementation.
19432         * gmp-impl.h (SUBC_LIMB): New macro.
19434         * tests/devel/try.c (validate_divexact_1): Correction to compare.
19435         (udiv_qrnnd): New testing.
19436         (SHIFT_LIMIT): Nailify.
19437         (-b): New option, remove spurious "H" from getopt string.
19439         * mpz/clrbit.c: Nailify.
19440         * tests/mpz/t-hamdist.c: Nailify.
19441         * gmp-impl.h (MPN_FIB2_SIZE): Nailify.
19442         (PP): Nailify conditionals.
19443         * tests/mpz/t-fib_ui.c (MPZ_FIB_SIZE_FLOAT): Nailify.
19445         * configure.in, acinclude.m4: Establish GMP_NAIL_BITS and
19446         GMP_LIMB_BITS for gmp-h.in configure tests.
19448         * mpfr/*, configure.in: Update to final mpfr 2.0.1.
19449         * mpfr/acinclude.m4 (MPFR_CONFIGS): Use $host, not uname stuff.
19450         * mpfr/tests/tout_str.c: Patch from Paul for denorm fprintf tests.
19452 2002-04-15  Torbjorn Granlund  <tege@swox.com>
19454         * mpn/generic/divrem_1.c (EXTRACT): Remove.
19456         * tests/mpz/t-tdiv_ui.c (dump_abort): Accept argument for error string.
19458         * mpz/rrandomb.c: Nailify.  Needs further work.
19460         * mpn/generic/mod_1.c: Nailify.
19462         * gmp-impl.h: Set various *_THRESHOLD values to be used for nails to
19463         avoid not yet qualified algorithms.
19464         (MPZ_CHECK_FORMAT): Check that nail part is zero.
19466         * tests/mpz/t-mul.c (main): Test squaring even for huge operands.
19467         (base_mul): Nailify.
19468         (dump_abort): Accept argument for error string.  Print product
19469         difference.
19471         * mpn/generic/set_str.c: Nailify.
19473         * gmp-h.in (__GMPN_ADD, __GMPN_SUB): Nailify.
19475 2002-04-14  Torbjorn Granlund  <tege@swox.com>
19477         * randraw.c (lc): Return non-nonsense return value for seed=0 case.
19478         Check for m2exp being non-zero early; remove all other tests of m2exp.
19479         Remove redundant MPN_ZERO call.
19480         Let mpn_rshift put result in place to avoid extra MPN_COPY.
19481         Remove confusing comment before function `lc' describing BBS algorithm.
19482         Misc simplification and cleanups.
19483         Nailify.  Needs further work.
19485         * mpz/set_si.c: Nailify.
19486         * mpz/set_ui.c: Nailify.
19487         * mpz/mul_i.h: Nailify.
19489         * tests/mpz/t-mul_i.c: Actually test _ui routines.  Add some more test
19490         values.
19492         * mpn/generic/mul_n.c: Finish nailifying toom3 code.
19494 2002-04-13  Kevin Ryde  <kevin@swox.se>
19496         * mpfr/*: Update to another new mpfr 2.0.1.
19497         * configure.in, Makefile.am, mpfr/Makefile.am, mpfr/tests/Makefile.am:
19498         Use MPFR_CONFIGS macro, establish separate MPFR_CFLAGS for mpfr build.
19500         * mpfr/tests/Makefile.am: Correction to convenience rule for libmpfr.a.
19502 2002-04-11  Kevin Ryde  <kevin@swox.se>
19504         * mpfr/set_q.c: gmp-impl.h before mpfr.h to avoid _PROTO redefine.
19506         * mpfr/*, configure.in: Update to new mpfr 2.0.1.
19508         * tests/refmpn.c (refmpn_udiv_qrnnd, refmpn_divmod_1c_workaround):
19509         Fixes for nails.
19511         * tests/t-constants.c (MODLIMB_INVERSE_3): Nailify tests.
19512         (MP_BASES_BIG_BASE_INVERTED_10, MP_BASES_NORMALIZATION_STEPS_10): Only
19513         check these under USE_PREINV_DIVREM_1.
19514         * tests/t-modlinv.c: Nailify tests.
19516 2002-04-11  Gerardo Ballabio <gerardo.ballabio@unimib.it>
19518         * gmpxx.h: Remove bool combinations, remove mpf_class::get_str2, only
19519         need <iosfwd> now.
19521 2002-04-11  Torbjorn Granlund  <tege@swox.com>
19523         * mpn/generic/diveby3.c: Nailify.
19524         * gmp-impl.h (MODLIMB_INVERSE_3): Nailify.
19526         * mpn/generic/mul_n.c: Nailify Toom3 code.
19528 2002-04-10  Kevin Ryde  <kevin@swox.se>
19530         * gmp-impl.h (MPN_KARA_MUL_N_MINSIZE, MPN_KARA_SQR_N_MINSIZE): Set to
19531         3, as needed by nails case.
19533         * mpn/generic/addmul_1.c, mpn/generic/submul_1.c [nails]: Fix vl
19534         assert, add rp,n and up,n asserts.
19536         * mpfr/Makefile.am: Add new mpfr-math.h, install mpf2mpfr.h.
19538 2002-04-10  Torbjorn Granlund  <tege@swox.com>
19540         * mpn/generic/divrem_1.c: Nailify.  Update mp_size_t variables to use
19541         `n' suffix instead of `size' suffix.
19542         * mpn/generic/divrem_2.c: Likewise.
19543         * mpn/generic/sb_divrem_mn.c: Nailify.
19544         * mpn/generic/tdiv_qr.c: Nailify.
19545         (SHL): Remove silly macro.
19547         * mpn/generic/mul_n.c (mpn_kara_mul_n): Replace open-coded increment by
19548         mpn_incr_u call.  Handle nails in ws[n] increment.
19549         * mpn/generic/mul_n.c (mpn_kara_sqr_n): Likewise.
19551         * gmp-h.in (GMP_NUMB_MASK): New #define.
19552         (__GMPN_AORS_1): Add version for nails.
19554         * gmp-impl.h (GMP_NUMB_MASK): Comment out, now in gmp.h.
19555         (mpn_incr_u): Don't assume `incr' is non-zero.
19556         (mpn_decr_u): Similarly.
19558 2002-04-09  Kevin Ryde  <kevin@swox.se>
19560         * mpfr/*, configure.in: Update to mpfr 2.0.1.
19562         * tests/refmpn.c (refmpn_mul_1c, lshift_make): Corrections for nails.
19563         * tssts/refmpn.c, tests/tests.h (refmpn_cmp_allowzero): New function.
19565         * mpn/generic/mul_1.c [nails]: Fix vl assert, add {up,n} assert.
19567         * mpn/pa32/hppa1_1/pa7100/addmul_1.asm,
19568         mpn/pa32/hppa1_1/pa7100/submul_1.asm: Rename "size" define, to avoid
19569         ELF .size directive.  Reported by LaMont Jones.
19571         * tests/mpz/t-set_si.c: Add nails support.
19573 2002-04-05  Torbjorn Granlund  <tege@swox.com>
19575         * gmp-impl.h: Replace nail mpn_incr_u, mpn_decr_u with faster versions.
19576         (mp_bases[10] values): Check GMP_NUMB_BITS instead of BITS_PER_MP_LIMB.
19577         Add GMP_NUMB_BITS == 30 version.
19578         (__gmp_doprnt, etc): Remove parameter names.
19580         * mpn/generic/mul_n.c: Nailify Karatsuba code.
19581         * mpn/generic/get_str.c: Nailify.
19582         * mpn/generic/sqr_basecase.c: Nailify.
19583         * mpn/generic/lshift.c: Nailify.
19584         * mpn/generic/rshift.c: Likewise.
19585         * mpn/generic/add_n.c: Nailify.  Revamp non-nail code.
19586         * mpn/generic/sub_n.c: Likewise.
19587         * mpn/generic/mul_1.c: Likewise.
19588         * mpn/generic/addmul_1.c: Likewise.
19589         * mpn/generic/submul_1.c: Likewise.
19591 2002-04-02  Kevin Ryde  <kevin@swox.se>
19593         * gmp-impl.h (BSWAP_LIMB_FETCH, BSWAP_LIMB_STORE) [powerpc]:
19594         Corrections to constraints, and restrict to bigendian.
19596 2002-03-31  Kevin Ryde  <kevin@swox.se>
19598         * tests/mpz/dive.c: Better diagnostics.
19600         * tests/devel/try.c (mpn_get_str, mpn_umul_ppmm_r): New tests.
19602         * tests/misc.c, tests/tests.h (byte_diff_lowest, byte_diff_highest):
19603         New functions.
19605         * tests/t-bswap.c: New file.
19606         * tests/Makefile.am (check_PROGRAMS): Add it.
19608         * tests/mpn/t-aors_1.c, tests/mpn/t-iord_u.c: Add nails support.
19610         * gmp-impl.h (MPN_IORD_U) [x86]: Eliminate unnecessary jiord and iord,
19611         rename "n" to incr per generic versions, restrict to nails==0.
19612         (mpn_incr_u, mpn_decr_u): Add nails support.
19613         (GMP_NAIL_LOWBIT, GMP_NUMB_MAX): New macros.
19615         * tests/trace.c, tests/tests.h (byte_trace, byte_tracen): New
19616         functions.
19617         * tests/trace.c: Handle NULL operands.
19619         * tests/refmpn.c, tests/devel/try.c, tune/speed.c: Add preliminary
19620         nail support.
19622         * tests/refmpn.c, test/tests.h (byte_overlap_p, refmpn_equal_anynail,
19623         refmpn_umul_ppmm_r, refmpn_udiv_qrnnd_r, refmpn_get_str,
19624         refmpn_bswap_limb, refmpn_random, refmpn_random2, refmpn_bswap_limb):
19625         New functions.
19627         * gmp-impl.h, tests/refmpn.c (ASSERT_LIMB): Renamed from
19628         ASSERT_MP_LIMB_T.
19630         * mpn/x86/*/*.asm, mpn/powerpc32/*/*.asm, mpn/powerpc64/*/*.asm: Put
19631         speeds after the copyright notice, so as to keep that clear.
19633 2002-03-29  Kevin Ryde  <kevin@swox.se>
19635         * configure.in (powerpc*-*-aix*): Correction to xlc -qarch selection,
19636         for 32-bit mode.
19638 2002-03-28  Torbjorn Granlund  <tege@swox.com>
19640         * mpn: Fix spacing in many files.
19642         * mpn/generic/aorsmul_1.c: Split into addmul_1.c and submul_1.c.
19643         * mpn/generic/aors_n.c: Split into add_n.c and sub_n.c.
19645         * mpn/pa64/add_n.asm: Trim another 0.125 cycle/limb.  Fix a comment.
19646         * mpn/pa64/sub_n.asm: Likewise.
19648         * mpn/pa64/mul_1.asm: Change comclr, comb to proper forms cmpclr, cmpb.
19649         * mpn/pa64/addmul_1.asm: Likewise.
19650         * mpn/pa64/submul_1.asm: Likewise.
19652 2002-03-28  Kevin Ryde  <kevin@swox.se>
19654         * gmp.texi (Converting Integers): Fix type of exp in mpz_get_d_2exp,
19655         reported by epl@unimelb.edu.au.
19656         (References): Update Burnikel and Ziegler URL, reported by Keith
19657         Briggs.
19659         * gmp-h.in, mp-h.in, configure.in, acinclude.m4: Remove __GMP from
19660         AC_SUBSTs, since autoconf says leading "_" in makefile variables is
19661         not portable.
19663         * demos/expr/run-expr.c: Declare optarg, optind, opterr if necessary.
19664         * configure.in, demos/expr/expr-config-h.in: Configs for this.
19666 2002-03-27  Torbjorn Granlund  <tege@swox.com>
19668         * mpn/Makefile.am (TARG_DIST): Remove pa64w and hppa, add pa32.
19670         * configure.in (path_20w): Remove pa64w.
19672         * mpn/pa64/udiv_qrnnd.asm: Tweak for PA8000 performance comparative to
19673         that on PA8500.
19675 2002-03-26  Torbjorn Granlund  <tege@swox.com>
19677         * mpn/pa32: New name for mpn/hppa.
19678         * configure.in: Corresponding changes.
19680         * mpn/pa64/umul_ppmm.asm: New file, generalized for both 2.0N and 2.0W.
19681         * mpn/pa64/umul_ppmm.S: Remove.
19683         * mpn/pa64/udiv_qrnnd.asm: Generalize for both 2.0N and 2.0W.
19684         * mpn/pa64w/udiv_qrnnd.asm: Remove.
19686 2002-03-26  Kevin Ryde  <kevin@swox.se>
19688         * mpfr/tests/tdiv.c, mpfr/tests/tui_div.c: Don't depend on nan and inf
19689         handling in "double", for the benefit of alpha.
19691         * configure (hppa2.0w): Set path to "pa64w pa64".
19693         * acinclude.m4, configure.in (GMP_C_INLINE): New macro.
19694         * acinclude.m4 (GMP_H_EXTERN_INLINE): Use it, and fix "yes" handling.
19696 2002-03-25  Torbjorn Granlund  <tege@swox.com>
19698         * mpn/pa64w/add_n.s: Remove.
19699         * mpn/pa64w/sub_n.s: Remove.
19700         * mpn/pa64w/lshift.s: Remove.
19701         * mpn/pa64w/rshift.s: Remove.
19702         * mpn/pa64w/mul_1.S: Remove.
19703         * mpn/pa64w/addmul_1.S: Remove.
19704         * mpn/pa64w/submul_1.S: Remove.
19705         * mpn/pa64w/sqr_diagonal.asm: Remove.
19707         * mpn/pa64/mul_1.asm: New file with twice faster code; generalized
19708         for both 2.0N and 2.0W.
19709         * mpn/pa64/submul_1.asm: Likewise.
19710         * mpn/pa64/mul_1.S: Remove.
19711         * mpn/pa64/submul_1.S: Remove.
19713         * mpn/pa64/sqr_diagonal.asm: Generalize for both 2.0N and 2.0W.
19715         * mpn/pa64/add_n.asm: New file, generalized for both 2.0N and 2.0W.
19716         * mpn/pa64/sub_n.asm: Likewise.
19717         * mpn/pa64/lshift.asm: Likewise.
19718         * mpn/pa64/rshift.asm: Likewise.
19719         * mpn/pa64/add_n.s: Remove.
19720         * mpn/pa64/sub_n.s: Remove.
19721         * mpn/pa64/lshift.s: Remove.
19722         * mpn/pa64/rshift.s: Remove.
19724 2002-03-24  Kevin Ryde  <kevin@swox.se>
19726         * gmp-impl.h (BSWAP_LIMB_FETCH, BSWAP_LIMB_STORE): New macros.
19727         * mpz/inp_raw.c, mpz/out_raw.c: Use them.
19728         * acconfig.h (HAVE_HOST_CPU): Add some powerpc types.
19730         * mpn/powerpc32/750/com_n.asm: New file.
19732         * mpfr/tests/tout_str.c: Disable random tests, since they fail on
19733         alphaev56-unknown-freebsd4.1 and do nothing by default.
19735         * mpfr/tests/tsqrt.c: Don't depend on nan, inf or -0 in "double", for
19736         the benefit of alpha.
19737         * mpfr/sqrt.c: Clear nan flag on -0.
19739         * demos/factorize.c: Use mpn_random() instead of random(), to avoid
19740         portability problems.
19742         * demos/isprime.c (print_usage_and_exit): Declare as "void" to avoid
19743         warnings.
19745         * demos/pexpr.c (setup_error_handler): Corrections to sigstack code.
19747         * demos/calc/calc.y: Add some `;'s to make bison 1.34 happy.
19749 2002-03-23  Torbjorn Granlund  <tege@swox.com>
19751         * mpn/pa64/addmul_1.asm: New file with twice faster code; generalized
19752         for both 2.0N and 2.0W.
19754 2002-03-22  Kevin Ryde  <kevin@swox.se>
19756         * tune/time.c: Add SGI hardware counter measuring method, change some
19757         abort()s into ASSERT_FAIL()s.
19759         * configure.in (AC_CHECK_HEADERS): Add fcntl.h and sys/syssgi.h.
19760         (AC_CHECK_FUNCS): Add syssgi.
19762         * configure.in, mpfr/Makefile.am, mpfr/tests/Makefile.am: Use
19763         -mieee-with-inexact or -ieee_with_inexact for mpfr on alpha, so
19764         denorms work.
19766         * mpfr/isinteger.c: Fix a memory leak.
19768 2002-03-21  Torbjorn Granlund  <tege@swox.com>
19770         * tune/speed.c (struct choice_t): Make `r' an mp_limb_t.
19772 2002-03-21  Kevin Ryde  <kevin@swox.se>
19774         * configure.in (HAVE_LIMB_BIG_ENDIAN, HAVE_LIMB_LITTLE_ENDIAN): Use an
19775         AH_VERBATIM and better explanation.
19776         * acinclude.m4 (GMP_C_DOUBLE_FORMAT): Similarly for the HAVE_DOUBLE
19777         constants.
19779         * gmp.texi (Number Theoretic Functions): Clarify sign of GCD returned
19780         by mpz_gcdext.
19782         * demos/pexpr.c, demos/pexpr-config-h.in, configure.in: Use an
19783         autoconf test for stack_t.
19785         * configure.in, gmp-h.in, mp-h.in, macos/configure, tests/mpz/reuse.c,
19786         tests/mpf/reuse.c: Use __GMP_LIBGMP_DLL to enable windows declspec,
19787         don't require _WIN32 (etc), remove __GMP_LIBGMP_SHARED and
19788         __GMP_LIBGMP_STATIC.
19790         * gmp-impl.h (mp_bases): Add __GMP_DECLSPEC, for the benefit of
19791         tests/t-constants.c.
19793         * tune/many.pl, tune/speed.h: Remove suffix hack for back.asm.
19795 2002-03-21  Paul Zimmermann  <Paul.Zimmermann@loria.fr>
19797         * mpfr/sin_cos.c (mpfr_sin_cos): New file.
19798         * mpfr/mpfr.h, mpfr/mpfr.texi, mpfr/Makefile.am: Add it.
19799         * mpfr/tan.c: Fix sign in 2nd and 4th quadrants.
19801         * mpfr/log10.c: Fix hangs on certain inputs.
19803 2002-03-20  Torbjorn Granlund  <tege@swox.com>
19805         * demos/pexpr.c (setup_error_handler): Declare `s', the first
19806         sigaltstack parameter, using `stack_t' just on AIX.
19808 2002-03-19  Torbjorn Granlund  <tege@swox.com>
19810         * mpn/powerpc32/mul_1.asm: Use free caller-saves registers instead
19811         of the callee-saves r30 and r31.
19813 2002-03-19  Kevin Ryde  <kevin@swox.se>
19815         * tune/freq.c (freq_proc_cpuinfo): Recognise powerpc "clock", where
19816         previously got the wrong result from "bogomips".
19818         * mpn/powerpc32/add_n.asm, mpn/powerpc32/sub_n.asm: Rewrite, faster on
19819         750, and smaller too.
19820         * mpn/powerpc32/*.asm: Use L(), add some measured speeds.
19822         * longlong.h (count_trailing_zeros) [vax]: Add a version using ffs,
19823         but commented out.
19825 2002-03-17  Kevin Ryde  <kevin@swox.se>
19827         * tune/speed.c, tune/speed.h, tune/common.c, many.pl: Use optional
19828         ".r" to specify operand overlaps for mpn_add_n, mpn_sub_n and logops.
19829         Remove mpn_add_n_inplace and mpn_add_n_self.
19830         * tune/many.pl: Fix MULFUNC_PROLOGUE parsing.
19832         * gmp.texi (Known Build Problems): Note `make' problem with long
19833         libgmp.la dependencies list.
19835         * printf/doprnt.c, scanf/doscan.c (%zn): Remove test of non-existent
19836         HAVE_SIZE_T, just use size_t unconditionally.
19837         * printf/doprnt.c (%zd etc): Fix 'z' type parsing.
19838         * tests/misc/t-printf.c, tests/misc/t-scanf.c: More tests.
19840         * configure.in: Use AC_COPYRIGHT.
19841         Add m4_pattern_allow(GMP_MPARAM_H_SUGGEST).
19843         * tune/Makefile.am (libdummy.la): Remove this, sqr_basecase.c already
19844         gets an ansi2knr rule from nodist_tuneup_SOURCES.
19846         * longlong.h (count_leading_zeros) [pentiumpro gcc<3]: Test
19847         HAVE_HOST_CPU_i686 too.
19849         * mpz/out_raw.c (HTON_LIMB_STORE): Fix a typo in big endian #if.
19851 2002-03-14  Kevin Ryde  <kevin@swox.se>
19853         * mpn/x86/pentium/com_n.asm, mpn/x86/pentium/logops_n.asm,
19854         mpn/x86/k6/mmx/com_n.asm: Add nails support.
19856         * texinfo.tex: Update to 2002-03-01.06 (per texinfo 4.1).
19857         * gmp.texi (@ma): Remove, @math does this now.
19859         * mpfr/tests/reuse.c: Clear op1 and op2 flags only in their respective
19860         outer loops.
19862         * configure.in (--enable-cxx): Correction to the default stated in the
19863         help string.
19864         (power*-*-aix*, not powerpc): Use aix.m4, don't run
19865         GMP_ASM_POWERPC_R_REGISTERS or use powerpc-defs.m4.
19867 2002-03-13  Torbjorn Granlund  <tege@swox.com>
19869         * mpn/sparc32/gmp-mparam.h: New file.
19871 2002-03-13  Kevin Ryde  <kevin@swox.se>
19873         * demos/expr/exprfr.c: More mpfr functions, corrections to agm, cos,
19874         sin, rename log2 constant to loge2 to make room for log2 function.
19875         * demos/expr/t-expr.c: More tests.
19877         * mpz/inp_raw.c (NTOH_LIMB_FETCH) [generic 16bit]: Remove spurious "+".
19879         * mpfr/acos.c: Avoid a memory leak for certain operands.
19881         * acinclude.m4, configure.in (GMP_C_DOUBLE_FORMAT): New macro.
19883         * acinclude.m4 (GMP_HPC_HPPA_2_0, GMP_ASM_UNDERSCORE,
19884         GMP_ASM_ALIGN_LOG, GMP_ASM_LSYM_PREFIX, GMP_ASM_W32, GMP_ASM_X86_MMX):
19885         Change ac_objext to OBJEXT, which is the documented variable.
19887         * config.guess (powerpc*-*-*): Use #ifdef on constants POWER_630 etc
19888         in the AIX test, since old versions don't have them all.
19890 2002-03-11  Kevin Ryde  <kevin@swox.se>
19892         * configure.in (LIBC211): New AC_DEFINE, for mpfr.
19894         * configure.in (mips*-*-*): Support ABI=o32 on irix 6, allow gcc 2.7.2
19895         to fall back on it, but detect it doesn't work with gcc 2.95.  Use
19896         single mips-defs.m4 for both mips32 and mips64.
19897         * acinclude.m4 (GMP_GCC_MIPS_O32): New macro.
19898         * mpn/mips32/mips-defs.m4: Renamed from mips.m4.
19899         * mpn/mips64/mips.m4: Remove (was a copy of mips32/mips.m4).
19901         * mpn/powerpc32/750: New directory.
19902         * configure.in (powerpc740, powerpc750, powerpc7400): Use it.
19903         * mpn/powerpc32/750/gmp-mparam.h: New file.
19905         * config.sub, gmp.texi (ultrasparc1): Remove this, just use plain
19906         "ultrasparc".
19908 2002-03-10  Kevin Ryde  <kevin@swox.se>
19910         * mpfr: Update to 20020301, except internal_ceil_exp2.c,
19911         internal_ceil_log2.c, internal_floor_log2.c renamed to i_ceil_exp2.c,
19912         i_ceil_log2.c, i_floor_log2.c to be unique in DOS 8.3.  And sqrtrem.c
19913         removed since no longer required.
19914         * mpfr/mpfr.texi: Fix some formatting.
19915         * mpfr/tests/reuse.c: Patch by Paul to fix test4 variable handling.
19916         * mpfr/sinh.c: Patch by Paul to fix err calculation when t==0.
19917         * mpfr/tests/tget_d.c: Disable until portability of rnd_mode.c can be
19918         sorted out.
19920         * configure.in (powerpc*-*-*): Separate gcc and xlc cpu flags setups
19921         for clarity.
19923         * longlong.h (count_leading_zeros, count_trailing_zeros) [x86_64]: New
19924         macros.
19926 2002-03-07  Kevin Ryde  <kevin@swox.se>
19928         * gmp.texi (Build Options): Note all the ultrasparcs accepted.
19929         (Language Bindings): Add Math::BigInt::GMP.
19931         * config.sub (ultrasparc2i): New cpu type.
19932         * config.guess (sparc-*-*, sparc64-*-*): Add some exact CPU detection.
19934 2002-03-05  Kevin Ryde  <kevin@swox.se>
19936         * longlong.h (count_leading_zeros, count_trailing_zeros) [alphaev67,
19937         alphaev68]: Use ctlz and cttz insns (as per gcc longlong.h).
19938         (count_leading_zeros) [sparclite]: Fix parameter order (as per gcc
19939         longlong.h).
19940         * acconfig.h (HAVE_HOST_CPU_alphaev68): New define.
19942         * config.guess [i?86-*-*]: Suppress error messages if compiler not
19943         found or test program won't run.
19944         [rs6000-*-*, powerpc-*-*]: Force code alignment for mfpvr test.
19946 2002-03-04  Torbjorn Granlund  <tege@swox.com>
19948         * mpn/generic/pow_1.c: New file.
19950 2002-03-03  Kevin Ryde  <kevin@swox.se>
19952         * gmp.texi (Build Options): Note compiler must be able to fully link,
19953         add alphapca57 and alphaev68, give a clearer example of MPN_PATH
19954         (Debugging): Add notes on valgrind.
19955         (C++ Formatted Output): Clarify mpf showbase handling, in particular
19956         note "00.4" in octal.
19958         * printf/doprntf.c: Do a showbase on octal float fractions, for
19959         instance "00.4" where previously it gave "0.4".
19960         * tests/cxx/t-ostream.cc: Update.
19962         * gmp-h.in, mp-h.in (__GMP_DECLSPEC, __GMP_DECLSPEC_XX): Test
19963         __WIN32__ for Borland C, reported by "delta trinity".
19965         * gmp-h.in, mp-h.in: Use <cstddef> for size_t under C++, suggested by
19966         Hans Aberg some time ago.
19967         * gmp-h.in (<iosfwd>): Move to top of file for clarity.
19969         * Makefile.am (libgmpxx_la_SOURCES): Use dummy.cc to force C++.
19970         (CXX_OBJECTS): Add osfuns$U.lo.
19971         * dummy.cc: New file.
19972         * cxx/Makefile.am (INCLUDES): Use __GMP_WITHIN_GMPXX.
19973         (libcxx_la_SOURCES): Add osfuns.cc.
19974         * gmp-h.in (__GMP_DECLSPEC_XX): New define, use it on libgmpxx funs.
19975         * gmp-impl.h: Add __GMP_DECLSPEC to libgmp functions used by libgmpxx.
19977         * longlong.h (COUNT_TRAILING_ZEROS_TIME): Remove, no longer used.
19979         * gmp-impl.h (MPN_SIZEINBASE, MPN_SIZEINBASE_16): Correction to
19980         __totbits for nails.
19982         * gmp-impl.h (JACOBI_LS0): Test size before limb, to pacify valgrind.
19983         (JACOBI_0LS): Ditto, and fix parens around arguments.
19985         * mpn/x86/x86-defs.m4 (call_mcount): Add a counter to make data labels
19986         unique, since simplified L() scheme no longer gives that effect.
19987         (notl_or_xorl_GMP_NUMB_MASK): New macro.
19988         Add m4_assert_numargs in a few places.
19990         * configure.in (*sparc*): Fix cycle counter setups for ABI=64.
19992 2002-02-28  Torbjorn Granlund  <tege@swox.com>
19994         * mpn/vax/gmp-mparam.h: New file.
19996 2002-02-28  Kevin Ryde  <kevin@swox.se>
19998         * gmp-h.in (gmp_errno, gmp_version): Move into extern "C" block,
19999         reported by librik@panix.com.
20001         * gmp-h.in, mp-h.in (__GMP_DECLSPEC_EXPORT, __GMP_DECLSPEC_IMPORT):
20002         Use __declspec(dllexport) and __declspec(dllimport) on Borland.
20003         * gmp-h.in (_GMP_H_HAVE_FILE): Test __STDIO_H for Borland.
20004         Reported by "delta trinity".
20006         * gmp-impl.h (va_copy): Fall back on memcpy, not "=".
20008         * mpn/generic/pre_mod_1.c: Add a comment about obsolescence.
20010         * tune/time.c (MICROSECONDS_P): Don't trust time differences of 1
20011         microsecond.
20013         * tests/cxx/t-ostream.cc: Use "const char *" not just "char *" for
20014         test data strings, avoids warnings on Sun CC.
20016 2002-02-27  Torbjorn Granlund  <tege@swox.com>
20018         * configure.in: For sparc under solaris2.[7-9], pass -fsimple=1 to
20019         disable some crazy -fast optimizations.
20021 2002-02-25  Torbjorn Granlund  <tege@swox.com>
20023         * configure.in: For sparc under solaris2.[7-9], pass -fns=no to enable
20024         denorm handling under -fast.
20026 2002-02-25  Kevin Ryde  <kevin@swox.se>
20028         * configure.in (alpha*-*-*): Rearrange -mcpu selection for gcc,
20029         provide an ev67 -> ev6 fallback.  Fix -arch,-tune selection for DEC C.
20030         Allow ~ for space in optional options lists.
20032         * tune/tuneup.c (tune_preinv_divrem_1): Compare against an assembler
20033         mpn_divrem_1 if it exists, not the generic C mpn_divrem_1_div.
20034         (tune_preinv_mod_1): Ditto with mpn_mod_1.
20036         * tune/time.c (DIFF_SECS_ROUTINE): Eliminate the unused "type"
20037         parameter, try to make the code a bit clearer.
20039         * tune/freq.c: Reduce the period measured for cycles versus
20040         gettimeofday, add cycles versus microsecond getrusage.
20042         * mpz/array_init.c: "i" should be mp_size_t, noticed by E. Khong.
20044 2002-02-24  Torbjorn Granlund  <tege@swox.com>
20046         * configure.in: For sparc under solaris2.[7-9], pass -fast instead of
20047         other optimization options.
20049 2002-02-23  Kevin Ryde  <kevin@swox.se>
20051         * mpn/asm-defs.m4 (GMP_NUMB_MASK): New macro.
20052         (PROLOGUE, EPILOGUE): Relax quoting for the benefit of tune/many.pl
20053         when GSYM_PREFIX non-empty.
20055         * tune/time.c, tune/speed.h (speed_time_init): Include clock tick
20056         period in speed_time_string.
20057         * tune/time.c, configure.in (clock_gettime): New measuring method.
20059         * tune/many.pl: Add -DHAVE_NATIVE_mpn_foo to C objects, to avoid
20060         conflicts with a macro version in gmp-impl.h, eg. mpn_com_n.
20062 2002-02-22  Torbjorn Granlund  <tege@swox.com>
20064         * demos/pexpr.c: Increase RLIMIT_STACK to 4Mibyte.
20066 2002-02-22  Kevin Ryde  <kevin@swox.se>
20068         * tune/tuneup.c: Don't confuse gcc with mipspro cc in diagnostic.
20070 2002-02-20  Torbjorn Granlund  <tege@swox.com>
20072         * configure.in (mips*-*-irix[6789]*]): Set `extra_functions_n32', not
20073         `extra_functions'.
20075         * printf/doprnt.c: Conditionally include inttypes.h.
20076         * printf/repl-vsnprintf.c: Likewise.
20077         * scanf/doscan.c: Likewise.
20079 2002-02-20  Kevin Ryde  <kevin@swox.se>
20081         * mpn/x86/k7/mmx/com_n.asm: New file.
20083         * mpz/n_pow_ui.c (SWAP_RP_TP): Use ASSERT_CODE on ralloc and talloc,
20084         to ensure they needn't live past the initial allocs in a normal build.
20086         * mpn/generic/mod_34lsub1.c: Note this is for internal use.
20088 2002-02-19  Torbjorn Granlund  <tege@swox.com>
20090         * Clean up *_THRESHOLD names.  Many files affected.
20092         * mpn/mips32: Asm-ify 32-bit mips code.
20093         Move files from `mips2' to `mips32' directory.
20094         * mpn/mips64: Move files from `mips3' to `mips64' directory.
20095         * configure.in: Change `mips2' => `mips32' and `mips3' => `mips64'.
20097 2002-02-19  Kevin Ryde  <kevin@swox.se>
20099         * acinclude.m4, configure.in (GMP_PROG_LEX): New macro.
20101         * tune/tuneup.c (one): Start next threshold at a max of previous ones,
20102         in order to get a good starting point for TOOM3_SQR_THRESHOLD if
20103         KARATSUBA_SQR_THRESHOLD is 0 (ie. using mpn_mul_basecase only).
20105         * configure.in, tune/tuneup.c (GMP_MPARAM_H_SUGGEST): New AC_DEFINE
20106         replacing GMP_MPARAM_H_FILENAME.  Suggest a new file in a cpu specific
20107         subdirectory rather than mpn/generic.
20109         * acinclude.m4 (POWERPC64_PATTERN): New macro.
20110         * configure.in (powerpc*-*-*): Use it.
20111         (powerpc*-*-*): Use umul in 32L and aix64.
20112         (mips*-*-*): Use umul, 32 and 64 bit versions.
20114 2002-02-18  Torbjorn Granlund  <tege@swox.com>
20116         * longlong.h: Add basic x86-64 support.
20118 2002-02-17  Torbjorn Granlund  <tege@swox.com>
20120         * demos/pexpr.c: Support `-X' for upper case hex, make `-x' output
20121         lower case hex.
20123         * mpn/mips2/umul.s: Make it actually work.
20124         * mpn/mips3/umul.asm: New file.
20126         * mpn/mips2/gmp-mparam.h: New file.
20128 2002-02-16  Torbjorn Granlund  <tege@swox.com>
20130         * mpn/generic/get_str.c (mpn_sb_get_str): Round frac upwards after
20131         umul_ppmm calls.
20133 2002-02-16  Kevin Ryde  <kevin@swox.se>
20135         * config.guess (alpha-*-*): Do alpha exact cpu probes on any system,
20136         and only if configfsf.guess gives a plain "alpha".
20138         * acinclude.m4 (GMP_PROG_CC_WORKS): Detect a gcc 3.0.3 powerpc64
20139         linker invocation problem.
20141 2002-02-15  Torbjorn Granlund  <tege@swox.com>
20143         * mpn/generic/get_str.c (mpn_sb_get_str): For base 10, develop initial
20144         digits using umul_ppmm, then switch to plain multiplication.
20146         * config.guess: Rewrite Alpha subtype detection code for *bsd systems.
20148 2002-02-15  Kevin Ryde  <kevin@swox.se>
20150         * gmp.texi (Build Options): Note powerpc exact cpu types.
20151         (Debugging): Advertise DEBUG in memory.c.
20153         * config.sub, config.guess: Add some powerpc exact cpus.
20154         * configure.in: Add configs for them.
20156         * memory.c [__NeXT__]: Remove unused #define of "static".
20157         (__gmp_default_allocate, __gmp_default_reallocate): Print size if
20158         allocation fails, don't use perror.
20160         * gmp-h.in: g++ 3 demands __GMP_NOTHROW is before other attributes.
20162 2002-02-14  Torbjorn Granlund  <tege@swox.com>
20164         * mpn/alpha/mul_1.asm: Fix typo preventing build on T3E systems.
20166 2002-02-14  Kevin Ryde  <kevin@swox.se>
20168         * tune/tuneup.c (tune_set_str): Increase max_size, for the benefit of
20169         alpha.
20171         * macos/README: Bug reports to bug-gmp@gnu.org, clarify MacOS X a bit.
20173         * mpn/generic/gcdext.c [WANT_GCDEXT_ONE_STEP]: Add missing TMP_FREE.
20175         * tune/speed.c, tune/tuneup.c: Allow for speed_cycletime of 0.0 in
20176         some diagnostic printouts.
20177         * tune/time.c (speed_cycletime): Note can be 0.0.
20179 2002-02-12  Torbjorn Granlund  <tege@swox.com>
20181         * mpn/alpha/mul_1.asm: Add mpn_mul_1c entry.
20183         * mpn/pa64w/sqr_diagonal.asm: Use L() for labels.
20185 2002-02-11  Torbjorn Granlund  <tege@swox.com>
20187         * mpn/generic/get_str.c (mpn_sb_get_str): Change declaration of rp to
20188         accommodate tuneup compiles.
20190 2002-02-11  Kevin Ryde  <kevin@swox.se>
20192         * mpn/alpha/default.m4, mpn/alpha/unicos.m4 (PROLOGUE_cpu): Add
20193         noalign option.
20194         * mpn/alpha/default.m4 (PROLOGUE_cpu): use ALIGN instead of ".align".
20196         * gmp.texi (Debugging): Notes on Checker.
20197         (Other Multiplication): Move note on float FFTs to here.
20198         (Assembler Floating Point): New text and revisions by Torbjorn,
20199         picture formatting by me.
20200         Simplify tex pictures elsewhere a bit, share heights, eliminate some
20201         gaps at line joins.
20203 2002-02-11  Torbjorn Granlund  <tege@swox.com>
20205         * mpn/generic/get_str.c (mpn_sb_get_str): Rewrite to generate fraction
20206         limbs and use multiplication for digit development.  Trim allocation of
20207         buf.  Get rid of code for !USE_MULTILIMB.
20209 2002-02-10  Torbjorn Granlund  <tege@swox.com>
20211         * mpn/generic/set_str.c (mpn_set_str): Undo this:
20212         Change invocations of mpn_add_1 to instead use mpn_incr_u.
20214         * tests/mpz/convert.c: Free str only after it is used in error message.
20216         * mpn/generic/get_str.c (mpn_sb_get_str): Combine tail code for base 10
20217         and generic bases.
20219         * mpn/mp_bases.c: Add entries for base 256.  Remove __ prefix from
20220         table name.
20221         * gmp-impl.h (__mp_bases): Remove superfluous mp_ part of name, making
20222         it __gmpn_bases instead of __gmpn_mp_bases.
20223         (mp_bases): New #define.
20224         * tune/speed.h (SPEED_ROUTINE_MPN_SET_STR): Allow bases up to 256.
20225         (SPEED_ROUTINE_MPN_GET_STR): Likewise.
20227 2002-02-09  Torbjorn Granlund  <tege@swox.com>
20229         * mpn/generic/set_str.c (mpn_set_str): Use mpn_mul_1c if available.
20230         Change invocations of mpn_add_1 to instead use mpn_incr_u.
20232 2002-02-09  Kevin Ryde  <kevin@swox.se>
20234         * mpz/array_init.c, mpz/cfdiv_q_2exp.c, mpz/cfdiv_r_2exp.c,
20235         mpz/cong_2exp.c, mpz/divis_2exp.c, mpz/hamdist.c, mpz/init2.c,
20236         mpz/mul_2exp.c, mpz/realloc2.c, mpz/scan0.c, mpz/scan1.c,
20237         mpz/setbit.c, mpz/tdiv_q_2exp.c, mpz/tdiv_r_2exp.c, mpz/tstbit.c,
20238         mpz/urandomb.c: Use GMP_NUMB_BITS.
20240         * mpz/iset_str.c [__CHECKER__]: Store a dummy value to the low limb to
20241         stop it appearing uninitialized.
20243         * gmp-h.in (__GMP_NOTHROW): New macro.
20244         (mp_set_memory_functions, mpz_cmp, mpz_cmp_si, mpz_cmp_ui, mpz_cmpabs,
20245         mpz_cmpabs_ui, mpz_congruent_2exp_p, mpz_divisible_2exp_p,
20246         mpz_fits_sint_p, mpz_fits_slong_p, mpz_fits_sshort_p, mpz_fits_uint_p,
20247         mpz_fits_ulong_p, mpz_fits_ushort_p, mpz_get_si, mpz_get_ui,
20248         mpz_getlimbn, mpz_hamdist, mpz_popcount, mpz_scan0, mpz_scan1,
20249         mpz_size, mpz_sizeinbase, mpz_swap, mpz_tstbit, mpq_equal, mpq_swap,
20250         mpf_cmp, mpf_cmp_si, mpf_cmp_ui, mpf_fits_sint_p, mpf_fits_slong_p,
20251         mpf_fits_sshort_p, mpf_fits_uint_p, mpf_fits_ulong_p,
20252         mpf_fits_ushort_p, mpf_get_default_prec, mpf_get_prec, mpf_get_si,
20253         mpf_get_ui, mpf_integer_p, mpf_set_default_prec, mpf_set_prec_raw,
20254         mpf_size, mpf_swap, mpn_add_1, mpn_cmp, mpn_hamdist, mpn_popcount,
20255         mpn_sub_1): Use it.
20257         * gmp-impl.h (MPN_SIZEINBASE, MPN_SIZEINBASE_16): New macros from
20258         mpn_sizeinbase, and use GMP_NUMB_BITS.
20259         * mpz/get_str.c, mpz/sizeinbase.c, mpbsd/mout.c, tune/speed.h: Use
20260         MPN_SIZEINBASE.
20261         * mpbsd/mtox.c: Use MPN_SIZEINBASE_16.
20263         * configure.in, mpn/Makefile.am, gmp-impl.h (mpn_sizeinbase): Remove.
20264         * mpn/generic/sizeinbase.c: Remove file.
20266         * gmp-impl.h (MPN_GET_STR_SIZE): Remove.
20267         * tests/mpn/t-g_str_size.c: Remove file.
20268         * tests/mpn/Makefile.am: Update.
20270         * Makefile.am (dist-hook): Don't distribute cvs merge ".#" files.
20272 2002-02-08  Torbjorn Granlund  <tege@swox.com>
20274         * configure.in: Override extra_functions for all sparcv8 systems, not
20275         just supersparc.
20277 2002-02-06  Kevin Ryde  <kevin@swox.se>
20279         * tune/tuneup.c (tune_mul, tune_sqr): Disable FFTs until tuned.
20280         * tune/speed.h (SPEED_ROUTINE_MPN_SET_STR): Fix memory clobber in
20281         destination cache priming.
20283         * printf/doprnt.c: Fix parsing of %s and %p conversions.
20284         * tests/misc/t-printf.c (check_misc): Add some tests.
20286 2002-02-03  Torbjorn Granlund  <tege@swox.com>
20288         * mpn/sparc32/v8/udiv.asm: New file, from v8/supersparc.
20290         * mpn/generic/set_str.c: Rename indigits_per_limb => chars_per_limb.
20291         Remove redundant chars_per_limb.  Reverse 4 loops in basecase code for
20292         speed.  Use MP_BASES_CHARS_PER_LIMB_10.
20294 2002-02-03  Kevin Ryde  <kevin@swox.se>
20296         * acinclude.m4 (GMP_PROG_NM): Ensure -B or -p get used when doing a
20297         cross compile with the native nm, helps OSF for instance.
20298         (GMP_ASM_LSYM_PREFIX): Remove ".byte 0" for the benefit of irix 6,
20299         allow "N" from nm for OSF, allow for "t" for other systems, but prefer
20300         no mention of the symbol at all.
20302         * tune/tuneup.c (print_define_remark): New function.
20303         Turn some "#if"s into plain "if"s.
20305         * tune/tuneup.c, gmp-impl.h, tune/Makefile.am
20306         (GET_STR_BASECASE_THRESHOLD, GET_STR_PRECOMPUTE_THRESHOLD): Tune these.
20307         * mpn/generic/get_str.c [TUNE_PROGRAM_BUILD]: Cope with non-constant
20308         GET_STR_PRECOMPUTE_THRESHOLD.
20310 2002-02-02  Torbjorn Granlund  <tege@swox.com>
20312         * mpn/generic/get_str.c (mpn_get_str): Fix typo in a declaration.
20314 2002-02-02  Kevin Ryde  <kevin@swox.se>
20316         * mpn/generic/set_str.c: Use MP_PTR_SWAP and POW2_P, add __GMP_PROTO
20317         to convert_blocks prototype, disable SET_STR_BLOCK_SIZE sanity check.
20319         * tune/set_strb.c, tune/set_strs.c: New files.
20320         * tune/speed.h, tune/speed.c, tune/common.c,tune/Makefile.am: Add them.
20321         * tune/tuneup.c: Tune SET_STR_THRESHOLD.
20322         (DEFAULT_MAX_SIZE): Renamed from MAX_SIZE, allow any param.max_size[].
20324 2002-02-01  Torbjorn Granlund  <tege@swox.com>
20326         * tests/mpz/convert.c: Increase operand size.  Add (yet disabled) code
20327         for testing with random strings.
20329         * mpn/generic/get_str.c (mpn_get_str): Rewrite to become sub-quadratic.
20330         (mpn_dc_get_str, mpn_sb_get_str): New functions.
20332 2002-01-31  Kevin Ryde  <kevin@swox.se>
20334         * gmpxx.h (cmp): Renamed from "compare".
20336         * configure.in (AC_C_BIGENDIAN): Don't abort when cross compiling.
20337         (PROLOGUE): Allow new style optional second parameter when grepping.
20339         * acinclude.m4 (GMP_HPC_HPPA_2_0, GMP_ASM_UNDERSCORE,
20340         GMP_ASM_ALIGN_LOG, GMP_ASM_LSYM_PREFIX, GMP_ASM_W32, GMP_ASM_X86_MMX):
20341         Use $ac_objext for object filenames.
20342         (GMP_ASM_UNDERSCORE): Use CCAS to assemble.
20344         * demos/pexpr-config-h.in: New file.
20345         * configure.in: Generate demos/pexpr-config.h.
20346         (AC_CHECK_FUNCS): Add clock, cputime, setrlimit, sigaction,
20347         sigaltstack, sigstack.
20348         * acinclude.m4 (GMP_SUBST_CHECK_FUNCS, GMP_SUBST_CHECK_HEADERS): New
20349         macros.
20350         * demos/pexpr.c: Use pexpr-config.h, not various #ifdefs.
20351         (setup_error_handler): Use signal if sigaction not available, allow
20352         for SIGBUS missing on mingw.
20353         (main): Use time() for random seed if gettimeofday not available.
20354         (cleanup_and_exit): Move SIGFPE out of LIMIT_RESOURCE_USAGE.
20356 2002-01-30  Torbjorn Granlund  <tege@swox.com>
20358         * mpn/generic/set_str.c: Rewrite to become sub-quadratic.
20359         (convert_blocks): New function.
20361 2002-01-30  Kevin Ryde  <kevin@swox.se>
20363         * gmp-impl.h (GMP_NUMB_MASK, GMP_NAIL_MASK, GMP_NUMB_HIGHBIT,
20364         ASSERT_MPN, ASSERT_MP_LIMB_T): New macros.
20366         * mpn/generic/fib2_ui.c: Use GMP_NUMB_BITS, simplify the data
20367         generator program, share __gmp_fib_table initializers between bit
20368         sizes, cope with bit sizes other than those specifically setup.
20369         * gmp-impl.h (FIB_TABLE_LIMIT, FIB_TABLE_LUCNUM_LIMIT): Corresponding
20370         rearrangement of conditionals.
20371         * tests/mpz/t-fib_ui.c (check_fib_table): New test.
20373 2002-01-28  Kevin Ryde  <kevin@swox.se>
20375         * mpz/set_si.c, mpz/iset_si.c: Store to _mp_d[0] unconditionally, use
20376         an expression for _mp_size.
20378         * mpz/init.c, mpz/init2.c, mpz/iset.c, mpq/init.c [__CHECKER__]: Store
20379         dummy values to low limbs to stop them appearing uninitialized.
20381 2002-01-26  Kevin Ryde  <kevin@swox.se>
20383         * mpfr/mpfr-test.h (MAX, MIN, ABS): Use instead a patch from Paul and
20384         Vincent.
20386 2002-01-24  Kevin Ryde  <kevin@swox.se>
20388         * configure.in: Extra quoting to get argument help messages right.
20390         * gmp.texi (Efficiency): Suggest hex or octal for input and output.
20391         (Formatted Output Strings): Mention "*" for width and precision.
20393         * mpn/generic/sizeinbase.c: New file, adapted from mpz/sizeinbase.c.
20394         Use POW2_P, use __mp_bases[base].big_base for log2(base).
20395         * configure.in, mpn/Makefile.am: Add it.
20396         * gmp-impl.h: Add prototype.
20397         * mpz/sizeinbase.c, tune/speed.h, mpn/generic/get_str.c,
20398         mpz/get_str.c, mpbsd/mout.c, mpbsd/mtox.c: Use it.
20399         * mpz/get_str.c: Write directly to user buffer, skip at most one
20400         leading zero, eliminate special case for x==0.
20401         * mpbsd/mtox.c: Allocate exact result space at the start, eliminate
20402         special case for x==0.
20403         * mpbsd/mout.c: Only need to skip one high zero with mpn_sizeinbase.
20405         * configure.in (--enable-nails): New option.
20406         (GMP_NAIL_BITS, GMP_LIMB_BITS, GMP_NUMB_BITS): New defines for gmp.h
20407         and config.m4.
20408         * gmp-h.in: Add templates.
20410         * mpfr/mpfr-test.h (MAX, MIN, ABS): Use #ifndef to avoid a redefine
20411         error on AIX xlc.
20413 2002-01-23  Torbjorn Granlund  <tege@swox.com>
20415         * mpn/generic/get_str.c: Correct type of `out_len'.
20417 2002-01-22  Kevin Ryde  <kevin@swox.se>
20419         * mpn/generic/pre_divrem_1.c: Corrections to some ASSERTs.
20421         * mpfr/mul_ui.c: Don't call mpn_lshift with 0 shift.
20423         * mpfr/mpz_set_fr.c: Produce correct mpz_t for f==0.
20425 2002-01-21  Torbjorn Granlund  <tege@swox.com>
20427         * longlong.h (32-bit powerpc add_ssaaaa): Remove spurious commutative
20428         declaration.
20429         (64-bit powerpc add_ssaaaa): Likewise.
20431 2002-01-20  Kevin Ryde  <kevin@swox.se>
20433         * acinclude.m4 (GMP_FUNC_VSNPRINTF): Use %n to better detect sparc
20434         solaris 2.7 problems.
20436 2002-01-19  Torbjorn Granlund  <tege@swox.com>
20438         * demos/pexpr.c (mpz_eval_expr): Optimize s^rhs for -1 <= s <= 1.
20439         (cleanup_and_exit): Improve error message wording.
20441 2002-01-19  Kevin Ryde  <kevin@swox.se>
20443         * mpfr/mpfr.h (_PROTO): Use __GMP_PROTO, for compatibility with
20444         gmp-impl.h.
20446 2002-01-17  Torbjorn Granlund  <tege@swox.com>
20448         * mpfr/mpfr-test.h: Test "__hpux", not "hpux".  Mask off mrand48
20449         return value to 31 bits to work around sloppy mpfr #include practices.
20451         * mpfr/tests/*.c: Use #include "", not <>, for gmp.h and mpfr.h.
20452         Make sure to #include mpfr-test.h from all files that use random().
20454 2002-01-17  Kevin Ryde  <kevin@swox.se>
20456         * gmp-impl.h (__GMP_REALLOCATE_FUNC_MAYBE_TYPE): New macro.
20457         * gmp-impl.h, mpz/get_str.c, mpz/out_raw.c, mpq/get_str.c,
20458         mpq/set_str.c, mpf/get_str.c, printf/asprntffuns.c, printf/doprnt.c,
20459         printf/repl-vsnprintf.c, printf/snprntffuns.c, scanf/doscan.c,
20460         mpbsd/mtox.c: Some fixes to compile as C++.
20462         * mpn/generic/jacbase.c (JACOBI_BASE_METHOD): New tuned parameter,
20463         replacing COUNT_TRAILING_ZEROS_TIME test.  Add a third method too.
20464         * tune/speed.c, tune/speed.h, tune/common.c, tune/Makefile.am: Add
20465         measuring of mpn_jacobi_base methods.
20466         * tune/jacbase1.c, tune/jacbase2.c, tune/jacbase3.c: New files.
20467         * tune/tuneup.c (JACOBI_BASE_METHOD): Tune this.
20468         * mpn/x86/*/gmp-mparam.h (COUNT_TRAILING_ZEROS_TIME): Remove macro.
20470         * gmp-h.in: Use __gmp prefix on variables in inlines.
20472         * gmp-impl.h (MPN_COPY_INCR, MPN_COPY_DECR): Remove __i, unused.
20474         * mpn/generic/mul_fft.c: Use HAVE_NATIVE_mpn_addsub_n, not ADDSUB.
20475         Use CNST_LIMB for some constants.
20477 2002-01-15  Kevin Ryde  <kevin@swox.se>
20479         * tests/mpbsd/Makefile.am: Add a convenience rule for ../libtests.la.
20481         * printf/Makefile.am: libdummy.la should be in EXTRA_LTLIBRARIES.
20483         * mpf/out_str.c: Use MPF_SIGNIFICANT_DIGITS, so mpf_out_str and
20484         mpf_get_str give the same for ndigits==0.
20486         * mpfr/exceptions.c (mpfr_set_emin, mpfr_set_emax): Work around a
20487         powerpc64 gcc 3.0 -O2 bug.
20489         * tests/memory.c, tests/tests.h (tests_memory_validate): New function.
20491 2002-01-14  Kevin Ryde  <kevin@swox.se>
20493         * mpn/generic/sb_divrem_mn.c, mpn/generic/divrem_1.c,
20494         mpn/generic/divrem_2.c, mpn/generic/mod_1.c: Don't use UMUL_TIME and
20495         UDIV_TIME, just default to preinv.
20496         * gmp-impl.h (USE_PREINV_DIVREM_1, USE_PREINV_MOD_1): Ditto.
20497         (DIVEXACT_1_THRESHOLD, MODEXACT_1_ODD_THRESHOLD): Don't use UMUL_TIME
20498         and UDIV_TIME, make default thresholds 0.
20499         (UDIV_NORM_PREINV_TIME, UDIV_UNNORM_PREINV_TIME): Remove macros.
20500         * mpn/x86/*/gmp-mparam.h (UMUL_TIME, UDIV_TIME,
20501         UDIV_NORM_PREINV_TIME): Remove macros.
20503         * gmp.texi (Headers and Libraries): New section, being the header
20504         notes from "GMP Basics" and some new stuff.
20505         (Parameter Conventions): Notes on "const" parameters.
20506         (Formatted Output Strings): Add type N, tweak some wording.
20508         * tests/refmpn.c (refmpn_divmod_1c): Avoid a bug in i386 gcc 3.0.
20510 2002-01-12  Kevin Ryde  <kevin@swox.se>
20512         * mpz/root.c: Add <stdlib.h>, for abort().
20514         * mpfr/tests/Makefile.am (AUTOMAKE_OPTIONS): Add ansi2knr.
20515         * mpfr/mpfr.h, mpfr/mpfr-tests.h, reuse.c, tadd.c, tadd_ui.c, tagm.c,
20516         tatan.c, tcmp2.c, tcos.c, tdiv.c, tdiv_ui.c, teq.c, texp.c,
20517         tget_str.c, thyperbolic.c, tlog.c, tmul.c, tout_str.c, tpow.c,
20518         trandom.c, tset_z.c, tsin.c, tsqrt.c, tsqrt_ui.c, tsub_ui.c, ttan.c,
20519         tui_div.c: Fixes for K&R.
20521         * tests/misc/t-scanf.c (check_misc, check_misc):
20523         * tests/mpz/t-inp_str.c, tests/mpq/t-inp_str.c, tests/misc/t-scanf.c:
20524         Avoid strings in ASSERT, not enjoyed by K&R.
20525         * gmp-impl.h (ASSERT): Note this.
20527         * tests/tests.h (refmpn_mod_34lsub1): Add __GMP_PROTO.
20529         * mpbsd/Makefile.am: Avoid an automake problem with ansi2knr and
20530         sources in a different directory.
20532         * printf/repl-vsnprintf.c: Test HAVE_LONG_DOUBLE for long double.
20534         * mpn/Makefile.am (nodist_libdummy_la_SOURCES): Add mod_34lsub1.c,
20535         mul_2.c, pre_divrem_1.c.
20537         * gmp-h.in, gmp-impl.h (mpn_add_nc, mpn_addmul_1c, mpn_addsub_n,
20538         mpn_addsub_nc, mpn_divrem_1c, mpn_dump, mpn_mod_1c, mpn_mul_1c,
20539         mpn_mul_basecase, mpn_sqr_n, mpn_sqr_basecase, mpn_sub_nc,
20540         mpn_submul_1c): Move to gmp-impl.h, since they're undocumented.
20542         * gmp-impl.h (mpn_reciprocal): Remove, unused.
20544         * tune/many.pl (cntlz, cnttz): Use new SPEED_ROUTINE_COUNT_ZEROS.
20546 2002-01-11  Kevin Ryde  <kevin@swox.se>
20548         * mpn/hppa/*.asm, mpn/pa64/*.asm, mpn/pa64w/*.asm: Use L().
20550 2002-01-08  Kevin Ryde  <kevin@swox.se>
20552         * mpn/asm-defs.m4 (PROLOGUE, EPILOGUE): New scheme, optional function
20553         name to EPILOGUE, check for missing or wrong function name EPILOGUE.
20554         * mpn/alpha/unicos.m4, mpn/alpha/default.m4, mpn/m68k/m68k-defs.m4,
20555         mpn/mips3/mips.m4, mpn/ia64/default.m4, mpn/powerpc32/aix.m4,
20556         mpn/powerpc64/aix.m4, mpn/x86/x86-defs.m4: Consequent updates, add a
20557         few more asserts.
20558         * mpn/alpha/unicos.m4, mpn/alpha/default.m4, mpn/alpha/cntlz.asm,
20559         mpn/alpha/invert_limb.asm (PROLOGUE_GP): Change to an optional "gp"
20560         parameter on plain PROLOGUE.
20562         * gmp.texi (Low-level Functions): mpn_get_str doesn't clobber an extra
20563         limb, and doesn't clobber at all for power of 2 bases.
20564         (Language Bindings): Add python gmpy.
20566         * mpz/get_str.c: Determine realloc size arithmetically.
20568         * mpbsd/mtox.c: Size memory block returned to actual space needed.
20569         * gmp.texi (BSD Compatible Functions): Describe this.
20571         * mpz/get_str.c: Don't copy mpn_get_str input for power of 2 bases.
20572         * mpbsd/mtox.c: Ditto, and as a side effect avoid a memory leak from a
20573         missing TMP_FREE.
20575         * mpz/get_str.c, mpbsd/mout.c: No longer need for +1 limb for
20576         mpn_get_str clobber.
20578         * gmp-impl.h (MPN_GET_STR_SIZE): New macro.
20579         * mpn/generic/get_str.c, mpz/get_str.c, mpbsd/mout.c, mpbsd/mtox.c,
20580         tune/speed.h: Use it.
20581         * tests/mpn/t-g_str_size.c: New test.
20582         * tests/mpn/Makefile.am: Add it.
20584         * gmp-impl.h (POW2_P): New macro.
20585         * mpn/generic/get_str.c, tests/misc.c: Use it.
20587         * printf/doprnt.c: Add "N" for mpn, share some code between N, Q and Z.
20588         * tests/misc/t-printf.c: Add tests.
20589         * gmp-impl.h (ASSERT_CODE): New macro.
20591         * tests/mpbsd/t-mtox.c: New test.
20592         * tests/mpbsd/Makefile.am: Add it.
20593         (allfuns_LDADD): Don't link against libgmp when testing everything in
20594         libmp can link.
20596 2002-01-07  Torbjorn Granlund  <tege@swox.com>
20598         * gmp-impl.h (MPN_COPY_INCR, MPN_COPY_DECR): Rewrite generic versions.
20600 2002-01-06  Kevin Ryde  <kevin@swox.se>
20602         * mpn/generic/pre_divrem_1.c: Don't support size==0.
20603         * tests/devel/try.c: Update.
20605         * mpn/generic/get_str.c: Add special case for base==10.
20606         * gmp-impl.h (MP_BASES_CHARS_PER_LIMB_10, MP_BASES_BIG_BASE_10,
20607         MP_BASES_BIG_BASE_INVERTED_10, MP_BASES_NORMALIZATION_STEPS_10): New
20608         constants.
20609         * tests/t-constants.c: Add checks.
20610         * mpn/mp_bases.c [GENERATE_TABLE]: Print defines for gmp-impl.h, print
20611         all standard bits-per-limb by default.
20613         * demos/pexpr.c, demos/expr/expr.h, demos/expr/expr-impl.h: Use
20614         __GMP_PROTO.
20616         * gmp-h.in (mpn_divexact_by3c): Remove variables from prototype, to
20617         keep out of application namespace.
20619 2002-01-04  Torbjorn Granlund  <tege@swox.com>
20621         * gmp-impl.h: Move _PROTO declaration to before its first usages.
20623 2002-01-04  Kevin Ryde  <kevin@swox.se>
20625         * gmp-h.in, mp-h.in, tests/tests.h: Rename _PROTO to __GMP_PROTO, and
20626         don't use #ifndef just define it ourselves.
20627         * gmp-impl.h: Provide _PROTO as an alias for __GMP_PROTO, to avoid big
20628         edits internally, for the moment.
20630 2002-01-03  Torbjorn Granlund  <tege@swox.com>
20632         * tune/speed.c (usage): Insert "\n\" into a string.
20634 2001-12-30  Torbjorn Granlund  <tege@swox.com>
20636         * mpn/pa64/udiv_qrnnd.c: Remove file.
20637         * mpn/pa64w/udiv_qrnnd.c: Remove file.
20639         * gmp-impl.h (MPN_IORD_U): Change formatting (labels in pos 0, insns
20640         indented by tab).
20641         (MPN_INCR_U): Use "addl $1,foo; jc", not "incl foo; jz".
20643         * gmp-impl.h (udiv_qrnnd_preinv): Use plain subtract, not sub_ddmmss,
20644         in one more case.
20646 2001-12-30  Kevin Ryde  <kevin@swox.se>
20648         * mpn/generic/get_str.c (udiv_qrnd_unnorm): New macro.
20649         Use "do while" for dig_per_u loop since it's non-zero.
20650         * acconfig.h (HAVE_HOST_CPU_m68k etc): Add templates.
20652         * mpn/generic/mul_basecase.c, mpz/mul.c, mpz/n_pow_ui.c,
20653         mpn/x86/pentium/mul_2.asm, tests/devel/try.c, tests/tests.h,
20654         tests/refmpn.c, tune/speed.c, tune/speed.h, tune/common.c,
20655         tune/many.pl (mpn_mul_2): New parameter style.
20656         * gmp-impl.h (mpn_mul_2): Add prototype.
20657         * configure.in (gmp_mpn_functions_optional): Add mul_2.
20659         * longlong.h (__vxworks__): Remove from powerpc tests, not correct,
20660         not on its own at least.
20662         * tune/speed.c: Add "aas" to specify 0xAA..AA data.
20664         * tune/tuneup.c (print_define_end): Indicate "never" and "always".
20666 2001-12-29  Torbjorn Granlund  <tege@swox.com>
20668         * mpq/set_d.c: ANSI-fy.
20669         * mpz/invert.c: Use PTR and SIZ (cosmetic change).
20671         * mpz/cong.c: Rename `xor' to `sign' to avoid C++ reserved word.
20673 2001-12-28  Torbjorn Granlund  <tege@swox.com>
20675         * mpn/sparc64/sqr_diagonal.asm: New file.
20677 2001-12-28  Kevin Ryde  <kevin@swox.se>
20679         * mpn/generic/get_str.c: Avoid one mpn_divrem_1 by running main loop
20680         only until msize==1.
20682         * tune/tuneup.c: Break up all() for clarity.
20683         (USE_PREINV_DIVREM_1, USE_PREINV_MOD_1): Compare against plain
20684         division udiv_qrnnd, not the tuned and possibly preinv version.
20686         * tune/freq.c: Split sysctl and sysctlbyname probes into separate
20687         functions, shorten some identifiers, put descriptions inside
20688         functions, define functions unconditionally and do nothing if
20689         requisites not available.
20691         * mpz/inp_raw.c: Avoid a gcc 3.0 powerpc64 bug on AIX.
20693         * acinclude.m4, configure.in (GMP_C_RESTRICT): New macro.
20695         * mpfr/sin.c: Patch from Paul to fix sign of sin(3pi/2).
20697         * demos/calc/calc.y: Improve some error messages.
20699 2001-12-28  Torbjorn Granlund  <tege@swox.com>
20701         * mpn/sparc64/mul_1.asm: Rename r72 -> r80.
20702         * mpn/sparc64/addmul_1.asm: Likewise.
20704 2001-12-27  Torbjorn Granlund  <tege@swox.com>
20706         * mpn/generic/tdiv_qr.c: Misc formatting cleanups.
20707         For switch case 2, replace `dn' with its value (2).
20709 2001-12-25  Torbjorn Granlund  <tege@swox.com>
20711         * tests/devel/mul_1.c: Add FIXED_XLIMB.
20712         * tests/devel/addmul_1.c: Likewise.
20713         * tests/devel/submul_1.c: Likewise.
20715         * tests/devel/add_n.c: Improve error message.
20716         Accept command line argument for # of tests.
20717         * tests/devel/sub_n.c: Likewise.
20719         * tests/devel/: Remove CLOCK settings.
20721         * mpn/sparc32/v9/mul_1.asm: Rewrite.
20722         * mpn/sparc32/v9/addmul_1.asm: Rewrite.
20723         * mpn/sparc32/v9/submul_1.asm: Rewrite.
20725 2001-12-24  Torbjorn Granlund  <tege@swox.com>
20727         * mpn/sparc64/mul_1.asm: Get rid of global constant 0.0 (L(noll)).
20728         * mpn/sparc64/addmul_1.asm: Likewise.
20730 2001-12-23  Torbjorn Granlund  <tege@swox.com>
20732         * mpn/generic/get_str.c: Move final ASSERT to just before zero fill
20733         loop.
20735 2001-12-22  Torbjorn Granlund  <tege@swox.com>
20737         * mpn/generic/get_str.c: Move ASSERTs out of loops.  Split digit
20738         generation code into two loops, saving a test of msize in the loop.
20740 2001-12-22  Kevin Ryde  <kevin@swox.se>
20742         * mpn/x86/x86-defs.m4, mpn/x86/*/*.asm: Remove L / LF scheme putting
20743         function name in local labels.
20745         * mpn/generic/get_str.c: Use mpn_preinv_divrem_1, add a couple of
20746         ASSERTs.
20748         * mpn/generic/pre_divrem_1.c: New file.
20749         * configure.in (gmp_mpn_functions): Add it.
20750         * gmp-impl.h (mpn_preinv_divrem_1): Add prototype.
20751         (USE_PREINV_DIVREM_1, MPN_DIVREM_OR_PREINV_DIVREM_1): New macros.
20752         * tests/devel/try.c, tune/speed.c, tune/speed.h, tune/common.c,
20753         tune/many.pl, tune/Makefile.am (mpn_preinv_divrem_1): Add testing and
20754         measuring.
20755         * tune/tuneup.c: Determine USE_PREINV_DIVREM_1.
20756         * tune/pre_divrem_1.c: New file.
20757         * tests/refmpn.c, tests/tests.h (refmpn_preinv_divrem_1): New function.
20759         * tests/mpz/t-io_raw.c: New file.
20760         * tests/mpz/Makefile.am (check_PROGRAMS): Add it.
20762         * mpz/inp_raw.c, mpz/out_raw.c: Rewrite.
20763         * acinclude.m4, configure.in (AC_C_BIGENDIAN): New test.
20764         * gmp-impl.h (BSWAP_LIMB): New macro.
20766         * acinclude.m4 (GMP_PROG_CC_WORKS): For a native compile, demand
20767         executables will run, per AC_PROG_CC.  This detects ABI=64 is unusable
20768         in a native sparc solaris 7 build with the kernel in 32-bit mode.
20769         * gmp.texi (ABI and ISA): Add notes on this, add an example configure
20770         setting an ABI.
20772         * tune/tuneup.c, configure.in: Print the gmp-mparam.h filename.
20773         * tune/tuneup.c: Print the CPU frequency.
20775         * tune/time.c, tune/speed.h: Add s390 "stck" method, flatten
20776         conditionals in speed_time_init a bit, use have_* variables to let
20777         some code go dead in speed_starttime and speed_endtime.
20779         * tune/freq.c (speed_cpu_frequency_irix_hinv): New function.
20781         * Makefile.am, configure.in: Restore mpfr.
20783         * configure.in: Add --with-readline, AC_PROG_YACC and AM_PROG_LEX.
20784         * demos/calc/calc.y, demos/calc/calclex.l: Add readline support, add
20785         lucnum function.
20786         * demos/calc/Makefile.am: Add calcread.c, calc-common.h, use $(YACC),
20787         $(LEX) and $(LEXLIB).
20788         * demos/calc/calcread.c, demos/calc/calc-common.h,
20789         demos/calc/calc-config-h.in, demos/calc/README: New files.
20791         * configure.in: Put demos/expr configs in expr-config.h.
20792         * demos/expr/expr-config-h.in: New file.
20793         * demos/expr/expr-impl.h: Renamed from expr-impl-h.in, get configs
20794         from expr-config.h.
20795         * demos/expr/Makefile.am: Update.
20797         * demos/expr/exprfr.c: Use mpfr_sin and mpfr_cos, remove some spurious
20798         returns.
20800 2001-12-20  Torbjorn Granlund  <tege@swox.com>
20802         * mpn/sparc64/mul_1.asm: Trim an instruction.
20803         * mpn/sparc64/addmul_1.asm: Likewise.
20805         * mpn/ia64/add_n.asm: Rewrite.
20806         * mpn/ia64/sub_n.asm: Rewrite.
20808 2001-12-19  Torbjorn Granlund  <tege@swox.com>
20810         * mpn/ia64/mul_1.asm: Rewrite.
20811         * mpn/ia64/addmul_1.asm: Rewrite.
20812         * mpn/ia64/submul_1.c: Use TMP_ALLOC_LIMBS.
20814         * tests/devel/mul_1.c: Improve error message.
20815         Accept command line argument for # of tests.
20816         * tests/devel/addmul_1.c: Likewise.
20817         * tests/devel/submul_1.c: Likewise.
20819 2001-12-18  Torbjorn Granlund  <tege@swox.com>
20821         * mpn/mips3/mul_1.asm: Add NOPs to save a cycle on R1x000.
20823 2001-12-18  Kevin Ryde  <kevin@swox.se>
20825         * gmpxx.h (gmp_randclass): Don't allow copy constructors or "=",
20826         implementation by Gerardo.
20828         * gmp-h.in (operator<<, operator>>): Remove parameter names from
20829         prototypes, to keep out of user namespace.
20831         * acinclude.m4 (GMP_FUNC_VSNPRINTF): Let the test program work as C++.
20833 2001-12-16  Torbjorn Granlund  <tege@swox.com>
20835         * mpn/sparc64/mul_1.asm: Rewrite.
20836         * mpn/sparc64/addmul_1.asm: Rewrite.
20837         * mpn/sparc64/submul_1.asm: Rewrite.
20839         * mpn/sparc64/addmul1h.asm: Remove.
20840         * mpn/sparc64/submul1h.asm: Remove.
20841         * mpn/sparc64/mul1h.asm: Remove.
20843 2001-12-15  Kevin Ryde  <kevin@swox.se>
20845         * gmp-h.in (mpn_add, mpn_add_1, mpn_cmp, mpn_sub, mpn_sub_1): Follow
20846         __GMP_INLINE_PROTOTYPES for whether to give prototype with inline.
20848         * configure.in (i686*-*-*, pentiumpro-*-*, pentium[23]-*-*,
20849         athlon-*-*, pentium4-*-*): Fall back on -march=pentium if
20850         -march=pentiumpro or higher is not good (eg. solaris cmov).
20852 2001-12-12  Torbjorn Granlund  <tege@swox.com>
20854         * gmp-impl.h (MPN_ZERO): Rewrite generic version to be similar to
20855         powerpc version.
20857 2001-12-12  Kevin Ryde  <kevin@swox.se>
20859         * acinclude.m4 (GMP_PROG_CC_WORKS): Detect cmov problems with gcc
20860         -march=pentiumpro on solaris 2.8.
20862         * tune/common.c, tune/speed.h: Allow for commas in count_leading_zeros
20863         and count_trailing_zeros macros.
20865         * demos/expr/Makefile.am: Distribute exprfr.c and exprfra.c.
20867         * tune/Makefile.am (speed_ext_SOURCES): Should be speed-ext.c.
20869 2001-12-10  Torbjorn Granlund  <tege@swox.com>
20871         * mpn/s390/addmul_1.asm: New file.
20872         * mpn/s390/submul_1.asm: New file.
20873         * mpn/s390/mul_1.asm: New file.
20874         * mpn/s390/gmp-mparam.h: Update.
20876 2001-12-07  Kevin Ryde  <kevin@swox.se>
20878         * gmp-h.in, mp-h.in, gmp-impl.h: __GMP_DECLSPEC at start of
20879         prototypes, for the benefit of Microsoft C.
20881         * gmp.texi (Introduction to GMP): Mention ABI and ISA section.
20882         (Known Build Problems): Recommend GNU sed on solaris 2.6.
20883         (Assigning Integers): Direct feedback to bug-gmp.
20884         (References): Typo Knuth vol 2 is from 1998.
20886         * gmpxx.h (gmp_randclass): Add initializers for gmp_randinit_default
20887         and gmp_randinit_lc_2exp_size.
20888         gmp.texi (C++ Interface Random Numbers): Describe them.
20890         * tests/misc/t-locale.c, tests/cxx/t-locale.cc: Ensure mpf_clear is
20891         done when the localconv override doesn't work.  Reported by Mike
20892         Jetzer.
20894         * printf/doprnti.c: Don't showbase on a zero mpq denominator.
20895         * tests/misc/t-printf.c, tests/cxx/t-ostream.c: Add test cases.
20897 2001-12-04  Kevin Ryde  <kevin@swox.se>
20899         * gmp.texi (Known Build Problems): Update to gmp_randinit_lc_2exp_size
20900         for the sparc solaris 2.7 problem.
20901         (Reentrancy): SCO ctype.h affects all text-based input functions.
20902         (Formatted Output Strings): Correction to the mpf example.
20903         (Single Limb Division): Correction, should be q-1 not q+1.
20904         (Extended GCD): Clarify why single-limb is inferior.
20905         (Raw Output Internals): Clarify size is twos complement, note limb
20906         order means _mp_d doesn't get directly read or written.
20907         (Contributors): Clarify mpz_jacobi.
20908         And a couple of formatting tweaks elsewhere.
20910         * tests/cxx/t-headers.cc: New file.
20911         * tests/cxx/Makefile.am: Add it.
20913         * gmpxx.h: Add <strstream>, needed by mpf_class::get_str2.
20915         * gmp-h.in (mpq_inp_str, mpn_hamdist): Add __GMP_DECLSPEC.
20917 2001-12-01  Torbjorn Granlund  <tege@swox.com>
20919         * Version 4.0 released.
20921         * mpfr/README: Replace contents with explanation of why mpfr is gone.
20923 2001-12-01  Kevin Ryde  <kevin@swox.se>
20925         * Makefile.am, configure.in: Temporarily remove mpfr, just leave a
20926         README.
20928         * mpn/Makefile.am (EXTRA_DIST): Add Makeasm.am.
20930 2001-11-30  Gerardo Ballabio  <ballabio@sissa.it>
20932         * tests/cxx/t-constr.cc, tests/cxx/t-expr.cc: New files.
20933         * tests/cxx/Makefile.am (check_PROGRAMS): Add them.
20935 2001-11-30  Kevin Ryde  <kevin@swox.se>
20937         * mpfr: Update to 2001-11-16.  Patch TMP handling of agm.c and sqrt.c,
20938         use plain mpn_sqrtrem in sqrt.c, separate .c files for floor and ceil,
20939         disable an expression style assert in add1.c.
20941         * mpn/s370: Rename to s390.
20942         * configure.in (s3[6-9]0*-*-*): Update.
20943         * mpn/Makefile.am (TARG_DIST): Add s390.
20945         * mpz/fits_s.c, mpf/fits_s.c, mpf/fits_u.c: Remove files, unused since
20946         change to .h style.
20948 2001-11-29  Torbjorn Granlund  <tege@swox.com>
20950         * gmp-h.in: Declare mpz_get_d_2exp and mpf_get_d_2exp.
20951         * Makefile.am: Add mpz/get_d_2exp$U.lo and mpf/get_d_2exp$U.lo.
20952         * mpf/Makefile.am: Add get_d_2exp.c.
20953         * mpz/Makefile.am: Add get_d_2exp.c.
20955 2001-11-29  Kevin Ryde  <kevin@swox.se>
20957         * mpn/*/gmp-mparam.h: Update measured thresholds.
20958         * mpn/s370/gmp-mparam.h: New file.
20960         * mpz/millerrabin.c: Mark for internal use only, for now.
20961         * gmp.texi (Number Theoretic Functions): Remove documentation.
20963 2001-11-28  Torbjorn Granlund  <tege@swox.com>
20965         * mpf/get_d_2exp.c: New file.
20966         * mpz/get_d_2exp.c: New file.
20968         * mpz/realloc2.c: Fix typo.  Make more similar to mpz_realloc.
20969         * mpz/realloc.c: Use __GMP_REALLOCATE_FUNC_LIMBS.
20971 2001-11-27  Gerardo Ballabio  <ballabio@sissa.it>
20973         * gmpxx.h, mpfrxx.h: Various updates and improvements.
20975 2001-11-27  Kevin Ryde  <kevin@swox.se>
20977         * gmp.texi (Useful Macros and Constants): Add gmp_version, add @findex
20978         for mp_bits_per_limb.
20980         * demos/perl/GMP.pm, demos/perl/GMP.xs: Use new style gmp_randinit's.
20981         * demos/perl/test.pl: Update for this, and for mpz_perfect_power_p
20982         handling of 0 and 1.
20984 2001-11-26  Torbjorn Granlund  <tege@swox.com>
20986         * mpz/realloc.c: Clear variable when decreasing allocation to less than
20987         needed.  Misc updates.
20989 2001-11-25  Kevin Ryde  <kevin@swox.se>
20991         * tests/misc/t-locale.c: Avoid printf in the normal case, since the
20992         replacement localeconv breaks it on SunOS 4.
20994         * gmp.texi (Build Options, Notes for Package Builds): Note libgmpxx
20995         depends on libgmp from same GMP version.
20997         * acinclude.m4, configure.in (GMP_FUNC_SSCANF_WRITABLE_INPUT): New
20998         test.
20999         * scanf/sscanf.c, scanf/vsscanf.c: Use it to ensure sscanf input is
21000         writable, if necessary.
21002         * tests/misc/t-scanf.c: Ensure sscanf arguments are writable, always.
21003         * configure.in (AC_CHECK_DECLS): Remove sscanf, no longer required.
21005         * configure.in (none-*-*): Fix default CFLAGS setups.
21007         * doc/configuration: Misc updates.
21009 2001-11-23  Kevin Ryde  <kevin@swox.se>
21011         * mpz/init2.c, mpz/realloc2.c: New files.
21012         * Makefile.am, mpz/Makefile.am: Add them.
21013         * gmp-h.in: Add prototypes.
21014         * gmp.texi (Efficiency): Mention these instead of _mpz_realloc.
21015         (Initializing Integers): Add documentation, reword other parts.
21017 2001-11-22  Torbjorn Granlund  <tege@swox.com>
21019         * mpn/cray/ieee/addmul_1.c: Fix logic for more_carries scalar loop.
21020         * mpn/cray/ieee/submul_1.c: Likewise.
21022 2001-11-20  Kevin Ryde  <kevin@swox.se>
21024         * gmp.texi (Known Build Problems): Note an out of memory on DJGPP.
21025         (Function Classes): Update function counts.
21026         Misc tweaks elsewhere.
21028         * configure.in (AC_CHECK_DECLS): Add sscanf.
21029         * tests/misc/t-scanf.c: Use it, for the benefit of SunOS 4.
21031         * tal-debug.c, gmp-impl.h: More checks of TMP_DECL/TMP_MARK/TMP_FREE
21032         consistency.
21034         * mpfr/Makefile.am (AR): Explicit AR=@AR@ to override automake
21035         default, necessary for powerpc64 ABI=aix64.
21037 2001-11-18  Torbjorn Granlund  <tege@swox.com>
21039         * mpz/powm.c: Move TMP_MARK to before any TMP_ALLOCs.
21041 2001-11-18  Kevin Ryde  <kevin@swox.se>
21043         * configure.in (--enable-fft): Make this the default.
21044         * gmp.texi (Build Options): Update.
21046         * Makefile.am (libmp_la_DEPENDENCIES): Revise mpz objects needed by
21047         new mpz/powm.c.
21049         * gmp.texi (Random State Initialization): Add gmp_randinit_default and
21050         gmp_randinit_lc_2exp_size, mark gmp_randinit as obsolete.
21051         (Random State Seeding): New section, taken from "Random State
21052         Initialization" and "Random Number Functions".
21054         * configure.in (AC_CHECK_DECLS): Add fgetc, fscanf, ungetc.
21055         * scanf/fscanffuns.c: Use these, for the benefit of SunOS 4.
21057         * gmp-impl.h, gmp-h.in (__gmp_default_fp_limb_precision): Move back to
21058         gmp-impl.h now not required for inlined mpf.
21060         * randlc2s.c (gmp_randinit_lc_2exp_size): New file, the size-based LC
21061         selection from rand.c.
21062         * rand.c (gmp_randinit): Use it.
21063         * randdef.c (gmp_randinit_default): New file.
21064         * gmp-impl.h (RANDS): Use it.
21065         (ASSERT_CARRY): New macro.
21066         * gmp-h.in (gmp_randinit_default, gmp_randinit_lc_2exp_size: Add
21067         prototypes.
21068         * Makefile.am (libgmp_la_SOURCES): Add randdef.c and randlc2s.c.
21070         * printf/asprntffuns.c: Include config.h before using its defines.
21072         * gmp-impl.h: Move C++ <string> to top of file to avoid the memset
21073         redefine upsetting configure tests.  Remove <iostream> since <iosfwd>
21074         in gmp.h suffices.
21076 2001-11-16  Kevin Ryde  <kevin@swox.se>
21078         * gmp.texi (Integer Exponentiation): mpz_powm supports negative
21079         exponents.
21080         (Assigning Floats, I/O of Floats, C++ Formatted Output, C++ Formatted
21081         Input): Decimal point follows locale.
21082         (Formatted Output Strings): %n accepts any type.
21083         (Formatted Input Strings): New section.
21084         (Formatted Input Functions): New section.
21085         (C++ Class Interface): Corrections and clarifications suggested by
21086         Gerardo.
21088         * scanf/doscan.c, scanf/fscanf.c, scanf/fscanffuns.c, scanf/scanf.c,
21089         scanf/sscanf.c, scanf/sscanffuns.c, scanf/vfscanf.c, scanf/vscanf.c,
21090         scanf/vsscanf.c, scanf/Makefile.am, tests/misc/t-scanf.c: New files.
21091         * gmp-h.in, gmp-impl.h, Makefile.am, configure.in: Consequent
21092         additions.
21094         * tests/misc: New directory.
21095         * tests/misc/Makefile.am: New file.
21096         * tests/misc/t-locale.c: New file.
21097         * tests/misc/t-printf.c: Moved from tests/printf.
21098         * tests/printf: Remove directory.
21099         * configure.in, tests/Makefile.am: Update.
21101         * tests/cxx/t-locale.cc: New file.
21102         * tests/cxx/Makefile.am: Add it.
21104         * mpf/set_str.c, cxx/ismpf.cc: Use localeconv for the decimal point.
21106         * acinclude.m4 (GMP_ASM_X86_MCOUNT): Update to $lt_prog_compiler_pic
21107         for current libtool, recognise non-PIC style mcount in windows DLLs.
21109         * gmp-impl.h (__gmp_replacement_vsnprintf): Add prototype.
21111         * gmp-impl.h (__gmp_rands, __gmp_rands_initialized,
21112         modlimb_invert_table): Add __GMP_DECLSPEC for the benefit of test
21113         programs using them from a windows DLL.
21114         * longlong.h (__clz_tab): Ditto.
21116         * mpn/x86/t-zdisp2.pl: New file.
21118         * mpn/x86/pentium4/README: New file.
21120 2001-11-15  Torbjorn Granlund  <tege@swox.com>
21122         * mpz/powm.c (HANDLE_NEGATIVE_EXPONENT): #define to 1.
21123         * tests/mpz/reuse.c (main): Use mpz_invert to avoid undefined mpz_powm
21124         cases.
21126 2001-11-14  Torbjorn Granlund  <tege@swox.com>
21128         * mpz/powm_ui.c: Rewrite along the lines of mpz/powm.c (except still no
21129         redc).
21130         * mpz/powm.c: Adjust for negative b, after exponentiation done.  Add
21131         (still disabled) code for handling negative exponents.  Misc cleanups.
21133 2001-11-14  Kevin Ryde  <kevin@swox.se>
21135         * mpf/out_str.c: Use localeconv for the decimal point.
21137         * tests/misc.c (tests_rand_end): Use time() if gettimeofday() not
21138         available (eg. on mingw).
21140 2001-11-11  Kevin Ryde  <kevin@swox.se>
21142         * gmp-h.in: Remove parameter names from prototypes, to keep out of
21143         application namespace.
21145 2001-11-08  Kevin Ryde  <kevin@swox.se>
21147         * acinclude.m4 (GMP_GCC_VERSION_GE): Fix sed regexps to work on
21148         Solaris 8.
21150         * printf/doprnt.c: Support %n of all types, per glibc.
21152         * gmp-h.in, gmp-impl.h, mpf/abs.c, mpf/neg.c, mpf/get_prc.c,
21153         mpf/get_dfl_prec.c, mpf/set_dfl_prec.c, mpf/set_prc_raw.c,
21154         mpf/set_si.c, mpf/set_ui.c, mpf/size.c: Revert mpf inlining, in order
21155         to leave open the possibility of keeping binary compatibility if mpf
21156         becomes mpfr.
21158         * mpn/x86/k7/mmx/lshift.asm, mpn/x86/k7/mmx/rshift.asm: Use Zdisp to
21159         force code size for computed jumps.
21160         * mpn/x86/k6/mod_34lsub1.asm, mpn/x86/k6/k62mmx/copyd.asm: Use Zdisp
21161         to force good code alignment.
21162         * mpn/x86/x86-defs.m4 (Zdisp): More instructions.
21164         * mpn/x86/pentium/sqr_basecase.asm, mpn/x86/k7/mmx/mod_1.asm,
21165         mpn/x86/k7/mmx/popham.asm: Remove some unnecessary "0" address offsets.
21167         * mpq/set_si.c, mpq/set_ui.c: Set _mp_den._mp_size correctly if den==0.
21169 2001-11-07  Torbjorn Granlund  <tege@swox.com>
21171         * mpn/hppa/hppa1_1/udiv_qrnnd.asm: Work around gas bug.
21173         * mpn/asm-defs.m4 (PROLOGUE): Change alignment to 8 (probably a good
21174         idea in general; required for hppa/hppa1_1/udiv_qrnnd.asm).
21176 2001-11-06  Torbjorn Granlund  <tege@swox.com>
21178         * gmp-impl.h (MPN_COPY_INCR): Prepend local variable by `__'.
21179         (MPN_COPY_DECR): Likewise.
21181 2001-11-05  Torbjorn Granlund  <tege@swox.com>
21183         * mpz/powm.c: Call mpn functions, not mpz functions, for computation
21184         mod m.  Streamline allocations to use a mixture of stack allocation and
21185         heap allocation.  Add currently disabled phi(m) exponent reduction
21186         code.  Misc optimizations and cleanups.
21188 2001-11-05  Kevin Ryde  <kevin@swox.se>
21190         * mpq/inp_str.c: Remove unused variable "ret".
21192         * mpn/x86/k7/sqr_basecase.asm: Fix a 0(%edi) to use Zdisp, so the
21193         computed jumps hit the right spot on old gas.
21195         * mpq/canonicalize.c: DIVIDE_BY_ZERO if denominator is zero.
21197         * mpn/lisp/gmpasm-mode.el (comment-start-skip): Correction to the way
21198         the first \( \) pair is setup.
21199         (gmpasm-font-lock-keywords): Don't fontify the space before a "#" etc.
21200         Misc tweaks to some comments.
21202 2001-11-03  Torbjorn Granlund  <tege@swox.com>
21204         * tests/refmpn.c (refmpn_overlap_p): Reverse return values.
21206 2001-11-02  Kevin Ryde  <kevin@swox.se>
21208         * tune/many.pl: Setup CFLAGS_PIC and ASMFLAGS_PIC, since that's no
21209         longer done by configure.
21211         * mpn/x86/pentium4/mmx/popham.asm: New file.
21213         * mpn/x86/x86-defs.m4 (psadbw): New macro.
21214         * mpn/x86/k7/mmx/popham.asm: Use it.
21216         * tests/refmpn.c (refmpn_overlap_p): New function, independent of
21217         MPN_OVERLAP_P.
21219 2001-10-31  Torbjorn Granlund  <tege@swox.com>
21221         * tests/mpz/t-powm.c: Print proper error message when finding
21222         discrepancy.
21224 2001-10-31  Kevin Ryde  <kevin@swox.se>
21226         * mpn/x86/pentium/mod_34lsub1.asm: New file.
21227         * mpn/x86/k7/mod_34lsub1.asm: New file.
21228         * mpn/x86/mod_34lsub1.asm: New file.
21230 2001-10-30  Kevin Ryde  <kevin@swox.se>
21232         * tests/printf/t-printf.c (check_misc): Add checks from the glibc docs.
21233         (check_vasprintf, check_vsnprintf): Run these unconditionally.
21235         * gmp-impl.h (ASSERT_MPQ_CANONICAL): New macro.
21236         * mpq/cmp.c, mpq/cmp_si.c, mpq/cmp_ui.c, mpq/equal.c: Add ASSERTs for
21237         canonical inputs, where correctness depends on it.
21239         * mpn/lisp/gmpasm-mode.el (comment-start-skip): Add "dnl".
21241 2001-10-27  Torbjorn Granlund  <tege@swox.com>
21243         * demos/pexpr.c: Remove some unused variables.
21244         (main): Allocate more buffer space to accommodate minus sign.
21246 2001-10-27  Kevin Ryde  <kevin@swox.se>
21248         * gmp-impl.h, mpn/asm-defs.m4, configure.in, tune/speed.h,
21249         tune/speed.c, tune/common.c, tune/many.pl, tests/devel/try.c: Add
21250         mpn_mod_34lsub1.
21251         * tests/refmpn.c, tests/tests.h (refmpn_mod_34lsub1): New function.
21253         * mpn/generic/mod_34lsub1.c: New file.
21254         * mpn/x86/k6/mod_34lsub1.asm: New file.
21255         * mpn/x86/pentium4/sse2/mod_34lsub1.asm: New file.
21256         * mpn/x86/x86-defs.m4 (Zdisp): Add another instruction.
21258         * gmp-h.in, gmpxx.h: Use <iosfwd> not whole <iostream>.
21260         * gmp.texi (Known Build Problems): Add note on test programs with
21261         Windows DLLs.
21263 2001-10-26  Kevin Ryde  <kevin@swox.se>
21265         * tests/mpq/t-get_d.c: Limit the size of "eps" for vax.
21267         * gmp.texi (maybepagebreak): New macro, use it in a few places.
21268         (Notes for Particular Systems): C++ Windows DLLs are not supported.
21269         (Known Build Problems): Note sparc solaris 2.7 gcc 2.95.2 shared
21270         library problems.
21271         (Autoconf): Tweak version numbers shown.
21272         (Integer Roots): mpz_perfect_square_p and mpz_perfect_power_p consider
21273         0 and 1 perfect powers, mpz_perfect_power_p accepts negatives.
21274         (Number Theoretic Functions): Add mpz_millerrabin, combined with a
21275         reworded mpz_probab_prime_p.
21276         (Formatted Output Strings): Misc clarifications.
21277         (Formatted Output Functions): gmp_asprintf, gmp_vasprintf,
21278         gmp_snprintf, gmp_vsnprintf always available.
21279         (C++ Formatted Output): Misc rewordings.
21280         (Formatted Input): New chapter.
21281         (C++ Class Interface): New chapter, by Gerardo and me.
21282         (Language Bindings): Update GMP++ now in GMP.
21283         (C++ Interface Internals): New section, by Gerardo and me.
21285         * printf/repl-vsnprintf.c: New file.
21286         * configure.in, acinclude.m4, Makefile.am, printf/Makefile.am: Use it
21287         if libc vsnprintf missing or bad.
21288         * configure.in (AC_CHECK_FUNCS): Add strnlen.
21290         * printf/snprntffuns.c, printf/vasprintf.c: Use
21291         __gmp_replacement_vsnprintf if libc vsnprintf not available.
21292         * printf/asprintf.c, printf/snprintf.c, printf/vasprintf.c,
21293         printf/vsnprintf.c: Provide these functions unconditionally.
21294         * acinclude.m4 (GMP_FUNC_VSNPRINTF): Remove warning about omissions
21295         when vsnprintf not available.
21297 2001-10-24  Kevin Ryde  <kevin@swox.se>
21299         * configure, aclocal.m4: Regenerate with a libtool patch for a stray
21300         quote in AC_LIBTOOL_PROG_LD_SHLIBS under mingw and cygwin.
21302         * gmp-impl.h (modlimb_invert): More comments.
21304         * printf/doprnt.c, printf/doprnti.c: Use the precision field to print
21305         leading zeros.
21306         * tests/printf/t-printf.c: Test this.
21307         * cxx/osdoprnti.cc, gmp-impl.h: Ignore precision in operator<<.
21309         * tune/speed.c, tune/speed.h, tune/common.c: Add mpn_mul_1_inplace.
21311 2001-10-23  Torbjorn Granlund  <tege@swox.com>
21313         * mpz/pprime_p.c (mpz_millerrabin): Remove function and its descendant.
21315         * mpz/millerrabin.c: New file with code from pprime.c.
21316         * mpz/Makefile.am: Compile millerrabin.c.
21317         * Makefile.am (MPZ_OBJECTS): Ditto.
21318         * gmp-h.in: Declare mpz_millerrabin.
21320 2001-10-22  Torbjorn Granlund  <tege@swox.com>
21322         * tests/mpz/t-perfsqr.c: New file.
21323         * tests/mpz/Makefile.am (check_PROGRAMS): Add it.
21325         * demos/factorize.c (factor): Check for number to factor == 0.
21326         (main): When invoked without arguments, read from stdin.
21328         * mpz/perfpow.c: Add code to handle negative perfect powers ((-b)^odd).
21329         Treat 0 and 1 as perfect powers.
21331         * mpn/sparc32/v9/sqr_diagonal.asm: Jump past .align.
21333 2001-10-21  Torbjorn Granlund  <tege@swox.com>
21335         * mpn/generic/perfsqr.c (sq_res_0x100): Remove bogus final `,'.
21336         (mpn_perfect_square_p): Suppress superfluous `&1' in sq_res_0x100 test.
21337         (mpn_perfect_square_p, O(n) test): Improve comments.  Combine remainder
21338         tests for some small primes.  Don't share code for different limb
21339         sizes.  Use single `if' with many `||' for better code density.
21341 2001-10-22  Kevin Ryde  <kevin@swox.se>
21343         * demos/perl/GMP.xs (mutate_mpz, tmp_mpf_grow): Make these "static".
21345         * mpn/x86/pentium/popcount.asm, mpn/x86/pentium/hamdist.asm
21346         (mpn_popcount_table): Use GSYM_PREFIX.
21348 2001-10-19  Kevin Ryde  <kevin@swox.se>
21350         * mpn/x86/*.asm: Add some measured speeds on various x86s.
21352         * tests/mpz/reuse.c, tests/mpf/reuse.c: Disable tests when using a
21353         windows DLL, because certain global variable usages won't compile.
21355         * configure.in (AC_CHECK_FUNCS): Add alarm.
21356         * tests/spinner.c: Conditionalize alarm and SIGALRM availability, for
21357         the benefit of mingw32.
21359         * acinclude.m4 (GMP_ASM_TYPE, GMP_ASM_SIZE): Suppress .type and .size
21360         on COFF.
21362         * acinclude.m4 (GMP_PROG_HOST_CC): New macro.
21363         * configure.in: Use it for windows DLL cross-compiles.
21364         * aclocal.m4, configure: Regenerate with libtool patch to hold HOST_CC
21365         in the generated libtool script.
21367         * aclocal.m4, configure: Regenerate with libtool patch to suppress
21368         warnings when probing command line limit on FreeBSD.
21370         * demos/qcn.c (M_PI): Define if not already provided, helps mingw32.
21372 2001-10-17  Kevin Ryde  <kevin@swox.se>
21374         * printf/doprnt.c: Use <stdint.h> for intmax_t.
21376         * longlong.h: Recognise __sparcv8 for gcc on Solaris.  Reported by
21377         Mark Mentovai <mark@mentovai.com>.
21379         * gmp-impl.h (gmp_allocated_string): No need for inline on member funs.
21381 2001-10-16  Kevin Ryde  <kevin@swox.se>
21383         * gmp.texi (Debugging): Add mpatrol.
21384         (Integer Comparisons, Comparing Rationals, Float Comparison): Index
21385         entries for sign tests.
21386         (I/O of Floats): Clarify mpf_out_str exponent is in decimal.
21387         (C++ Formatted Output): mpf_t operator<< exponent now in decimal.
21388         (FFT Multiplication): Use an ascii art sigma.
21389         (Contributors): Add Gerardo Ballabio.
21391         * cxx/osfuns.cc (__gmp_doprnt_params_from_ios): Always give mpf_t
21392         exponent in decimal, irrespective of ios::hex or ios::oct.
21393         * tests/cxx/t-ostream.cc (check_mpf): Update.
21395         * printf/doprnt.c: Support %lln and %hhn.
21397         * mpn/x86/pentium4/sse2/submul_1.asm: Use a psubq to negate the
21398         initial carry (helps the submul_1c case), and improve the comments.
21400 2001-10-11  Kevin Ryde  <kevin@swox.se>
21402         * acinclude.m4, configure.in (GMP_IMPL_H_IEEE_FLOATS): New macro.
21404         * ltmain.sh: Send some rm errors to /dev/null, helps during compiles
21405         on Solaris 2.7 and HP-UX 10.
21407         * tal-notreent.c: Renamed from stack-alloc.c.
21408         * Makefile.am, acinclude.m4, gmp-impl.h: Update.
21410         * gmp-h.in: Don't give both prototypes and inlines, except on gcc.
21412         * gmp-h.in, gmp-impl.h: Use #includes to get necessary standard
21413         classes, add std:: to prototypes.
21414         * cxx/*.cc, tests/cxx/t-ostream.cc: Add "use namespace std".
21415         * acinclude.m4 (GMP_PROG_CXX_WORKS): Ditto.
21417         * tests/*/Makefile.in, mpfr/tests/Makefile.in: Regenerate with
21418         automake patch to avoid Ultrix problem with empty $(TESTS).
21420         * */Makefile.in: Regenerate with automake patch to only rm *_.c in
21421         "make clean" when ansi2knr actually in use, helps DOS 8.3.
21423         * Makefile.in: Regenerate with automake patch to fix stamp-h
21424         numbering, avoiding an unnecessary config.status run.
21426 2001-10-09  Torbjorn Granlund  <tege@swox.com>
21428         * mpn/hppa/hppa1_1/udiv_qrnnd.asm: Use L macros for labels.
21429         Quote L reloc operator.
21431         * gmp-impl.h: Declare class string.
21433         * mpn/asm-defs.m4 (INT32, INT64): Quote $1 to prevent further
21434         expansion.
21436         * mpn/alpha/ev6/mul_1.asm: New file.
21438 2001-10-09  Kevin Ryde  <kevin@swox.se>
21440         * gmp.texi (Introduction to GMP): Add pentium 4 to optimized CPUs.
21441         (Build Options): Note macos directory.
21442         (Notes for Package Builds): GMP 4 series binary compatible with 3.
21443         (Known Build Problems): Remove $* and ansi2knr note, now fixed, except
21444         possibly under --host=none.
21445         (Formatted Output Strings): Remove -1 prec for all digits.
21447         * mpz/add.c, mpz/sub.c: Don't use mpz path on #include (helps macos).
21448         * mpbsd/Makefile.am (INCLUDES): Add -I$(top_srcdir)/mpz.
21450         * printf/doprnt.c, tests/printf/t-printf.c: Remove support for %.*Fe
21451         prec -1 meaning all digits.
21453         * acinclude.m4 (GMP_PROG_AR): Override libtool, use AR_FLAGS="cq".
21454         (GMP_HPC_HPPA_2_0): Print version string to config.log.
21456         * Makefile.am (AUTOMAKE_OPTIONS): Remove check-news (permission notice
21457         in NEWS file is too big).
21458         (dist-hook): Don't distribute numbered or unnumbered emacs backups.
21460         * Makefile.am, cxx/Makefile.am: Updates for Gerardo's stuff.
21462 2001-10-09  Gerardo Ballabio  <ballabio@sissa.it>
21464         * cxx/isfuns.cc: New file.
21465         * gmp-impl.h: Add prototypes.
21466         * cxx/ismpf.cc, cxx/ismpq.cc, cxx/ismpz.cc: New files.
21467         * gmp-h.in: Add prototypes.
21468         * gmpxx.h, mpfrxx.h: New files.
21470 2001-10-08  Kevin Ryde  <kevin@swox.se>
21472         * configure.in (with_tags): Establish a default based on --enable-cxx.
21474         * aclocal.m4: Regenerate with libtool patches for sed char range to
21475         help Cray, LTCC quotes and +Z warnings grep to help HP-UX.
21477         * gmp-impl.h (doprnt_format_t, doprnt_memory_t, doprnt_reps_t,
21478         doprnt_final_t): Use _PROTO.
21480 2001-10-05  Torbjorn Granlund  <tege@swox.com>
21482         * mpn/asm-defs.m4 (INT32, INT64): Use LABEL_SUFFIX.
21484         * mpn/hppa: Convert files to `.asm'.
21486 2001-10-05  Kevin Ryde  <kevin@swox.se>
21488         * mpn/Makeasm.am (.S files): Revert to separate CPP and CCAS, use
21489         cpp-ccas, and only pass CPPFLAGS to CPP, not whole CFLAGS.
21490         * mpn/cpp-ccas: New file.
21491         * mpn/Makefile.am (EXTRA_DIST): Add it.
21493         * tune/common.c, tune/speed.h: Change SPEED_ROUTINE_MPN_COPY_CALL uses
21494         to SPEED_ROUTINE_MPN_COPY or new SPEED_ROUTINE_MPN_COPY_BYTES.  Avoids
21495         macro expansion problems on Cray.
21497         * configure.in (AC_PROG_CXXCPP): Add this, to make libtool happier.
21499 2001-10-04  Torbjorn Granlund  <tege@swox.com>
21501         * mpz/rrandomb.c (gmp_rrandomb): Change bit_pos to be 0-based (was
21502         1-based); shift 2 (was 1) when making bit mask.  These two changes
21503         avoid undefined shift counts.
21504         (gmp_rrandomb): Avoid most calls to _gmp_rand by caching random values.
21506         * mpn/generic/random2.c: Changes for mirroring mpz/rrandomb.c.
21508 2001-10-04  Kevin Ryde  <kevin@swox.se>
21510         * gmp.texi (Build Options): Add --enable-cxx.
21511         (Notes for Particular Systems): Mention pentium4 performance and SSE2.
21512         (Known Build Problems): Remove vax jsobgtr note, no longer needed.
21513         (Converting Floats): Tweak mpf_get_str description.
21514         (Low-level Functions): Correction to mpn_gcdext destination space
21515         requirements.
21516         (C++ Formatted Output): New section.
21517         (Language Bindings): Add ALP
21518         (Contributors): Add Paul Zimmermann's square root, update my things.
21520         * acinclude.m4 (GMP_PROG_CC_IS_GNU, GMP_PROG_CXX_WORKS): Send compiler
21521         errors to config.log.
21523         * mpq/Makefile.am (INCLUDES): Remove -DOPERATION_$*, not needed.
21525         * mpn/x86/*.asm: Change references to old README.family to just README.
21527         * mpz/README: Remove file, now adequately covered in the manual.
21529 2001-10-03  Torbjorn Granlund  <tege@swox.com>
21531         * mpn/x86/pentium4/copyi.asm: New file.
21532         * mpn/x86/pentium4/copyd.asm: New file.
21534         * gmp-impl.h: Implement separate MPN_COPY_INCR and MPN_COPY_DECR
21535         macros for CRAY systems.
21536         (CRAY _MPN_COPY): Delete.
21538 2001-10-02  Kevin Ryde  <kevin@swox.se>
21540         * tests/mpz/t-popcount.c (check_data): Use "~ (unsigned long) 0" to
21541         avoid compiler warnings on sco.
21543         * mpbsd/Makefile.am: Compile mpz files directly, no copying.
21544         Use mpz/add.c and mpz/sub.c rather than mpz/aors.c.
21545         (INCLUDES): Remove -DOPERATION_$*, no longer needed (by mpz).
21547         * mpz/aors.h: Renamed from mpz/aors.c.
21548         * mpz/add.c, mpz/sub.c: New files, using mpz/aors.h.
21549         * mpz/aors_ui.h: Renamed from mpz/aors_ui.c.
21550         * mpz/add_ui.c, mpz/sub_ui.c: New files, using mpz/aors_ui.h.
21551         * mpz/fits_s.h: Renamed and adapted from mpz/fits_s.c.
21552         * mpz/fits_sshort.c, mpz/fits_sint.c, mpz/fits_slong.c: New files.
21553         * mpz/mul_i.h: Renamed from mpz/mul_siui.c.
21554         * mpz/mul_ui.c, mpz/mul_ui.c: New files, using mpz/mul_i.h.
21555         * mpz/Makefile.am: Consequent updates.
21556         (INCLUDES): Remove -DOPERATION_$*.
21558         * mpf/fits_s.h: Renamed and adapted from mpf/fits_s.c.
21559         * mpf/fits_sshort.c, mpf/fits_sint.c, mpf/fits_slong.c: New files.
21560         * mpf/fits_u.h: Renamed and adapted from mpf/fits_u.c.
21561         * mpf/fits_ushort.c, mpf/fits_uint.c, mpf/fits_ulong.c: New files.
21562         * mpf/Makefile.am: Consequent updates.
21563         (INCLUDES): Remove -DOPERATION_$*.
21565         * cxx/osfuns.cc (__gmp_doprnt_params_from_ios): Don't use ios::hex etc
21566         as cases in a switch, they're not constant in g++ 3.0.
21568         * mpn/Makeasm.am (.s.o, .s.obj, .S.o, .S.obj, .asm.o, .asm.obj):
21569         Locate source file with test -f the same as automake.
21570         (.S): Let CCAS do the preprocessing, and run libtool for .S.lo.
21571         (.asm.lo): Run libtool via m4-ccas to get new style foo.lo right.
21572         (COMPILE_FLAGS): Add $(DEFAULT_INCLUDES), per new automake.
21573         * mpn/m4-ccas: New file.
21574         * mpn/Makefile.am (EXTRA_DIST): Add it.
21575         * mpn/asm-defs.m4: Add m4_not_for_expansion(`DLL_EXPORT').
21576         * mpn/x86/x86-defs.m4: Undefine PIC if DLL_EXPORT is set.
21577         * configure.in (CFLAGS_PIC, ASMFLAGS_PIC): Remove, no longer needed.
21579         * acinclude.m4 (GMP_FUNC_VSNPRINTF): Warn what's omitted when
21580         vsnprintf not available.
21582         * mpn/underscore.h: Remove file, not used since m68k converted to asm.
21583         * mpn/Makefile.am (EXTRA_DIST): Remove it.
21585         * tests/refmpz.c: Add <stdlib.h>, for free().
21587 2001-10-01  Torbjorn Granlund  <tege@swox.com>
21589         * mpn/x86/pentium4/sse2/submul_1.asm: Apply some algebraic
21590         simplifications.
21591         * mpn/x86/pentium4/sse2/addmul_1.asm: Comment.
21593 2001-10-01  Kevin Ryde  <kevin@swox.se>
21595         * configure.in (--enable-cxx): New option for C++ support.
21596         Add cxx and tests/cxx subdirectories.
21597         * ltmain.sh, aclocal.m4: Update to libtool 2001-09-30.
21599         * cxx/Makefile.am, cxx/Makefile.in, cxx/osdoprnti.cc, cxx/osfuns.cc,
21600         cxx/osmpf.cc, cxx/osmpq.cc, cxx/osmpz.cc: New files.
21601         * Makefile.am: Add them, in new libgmpxx.
21602         * gmp-h.in, gmp-impl.h: Prototypes and support.
21603         * tests/cxx/Makefile.am, tests/cxx/Makefile.in,
21604         tests/cxx/t-ostream.cc: New files.
21606         * tune/speed.h (SPEED_ROUTINE_MPN_GCD_CALL,
21607         SPEED_ROUTINE_MPN_GCDEXT_ONE): mpn_gcdext needs size+1 for
21608         destinations.  Found by Torbjorn.
21610         * gmp-h.in (__GNU_MP__, __GNU_MP_VERSION): Bump to 4.0.
21611         * mp-h.in (__GNU_MP__): Ditto.
21612         * gmp.texi, Makefile.am, compat.c: Amend version 3.2 to 4.0.
21614         * acinclude.m4 (GMP_PROG_CXX_WORKS): New macro.
21615         (GMP_PROG_CC_WORKS): Write "conftest" test program, not a.out.
21617         * gmp-impl.h (struct gmp_asprintf_t): Moved from printf/vasprintf.c.
21618         (GMP_ASPRINTF_T_INIT): New macro.
21619         (GMP_ASPRINTF_T_NEED): New macro, adapted from vasprintf.c NEED().
21620         * printf/vasprintf.c: Use these.
21622         * printf/asprntffuns.c: New file.
21623         * printf/Makefile.am, Makefile.am: Add it.
21624         * printf/asprntffuns.c, printf/vasprintf.c, gmp-impl.h
21625         (__gmp_asprintf_memory, __gmp_asprintf_reps, __gmp_asprintf_final):
21626         Move to asprntffuns.c, rename to __gmp and make global, remove
21627         spurious formal parameters from __gmp_asprintf_final.
21629         * configure.in (j90-*-*, sv1-*-*): Don't duplicate $path in $add_path.
21630         (*-*-mingw*): Don't assemble with -DPIC (as per cygwin).
21632         * printf/snprntffuns.c (gmp_snprintf_final): Remove spurious formal
21633         parameters.
21635         * tune/tuneup.c (POWM_THRESHOLD): Reduce stop_factor to 1.1 to help
21636         Cray vector systems.
21638         * tests/misc.c (tests_rand_start): Print GMP_CHECK_RANDOMIZE=NN to
21639         facilitate cut and paste when re-running.
21640         * tests/mpz/t-inp_str.c (check_data): Add more diagnostic prints.
21642 2001-09-30  Kent Boortz  <kent@swox.com>
21644         * macos/configure, macos/Makefile.in, macos/README: Updates for gmp 4.
21645         * gmp-h.in (_GMP_H_HAVE_FILE): Recognise Apple MPW.
21647 2001-09-30  Torbjorn Granlund  <tege@swox.com>
21649         * mpn/cray/ieee/submul_1.c: Rewrite.  Streamline multiplications;
21650         use `majority' logic.
21652 2001-09-27  Torbjorn Granlund  <tege@swox.com>
21654         * gmp-h.in (__GMPN_AORS_1): Rewrite to work around Cray compiler bug.
21656 2001-09-26  Torbjorn Granlund  <tege@swox.com>
21658         * mpn/x86/pentium4/sse2/gmp-mparam.h: New file.
21660 2001-09-26  Kevin Ryde  <kevin@swox.se>
21662         * mpn/x86/pentium4/sse2/dive_1.asm: New file.
21663         * mpn/x86/pentium4/sse2/submul_1.asm: New file.
21664         * mpn/x86/pentium4/sse2/sqr_basecase.asm: New file.
21666         * mpn/x86/pentium/copyi.asm: New file, based on past work by Torbjorn.
21667         * mpn/x86/pentium/copyi.asm: New file, ditto.
21668         * mpn/x86/pentium/com_n.asm: Rewrite, ditto.
21670         * printf/snprntffuns.c (gmp_snprintf_format): Copy va_list in case
21671         vsnprintf trashes it.
21672         * printf/vasprintf.c (gmp_asprintf_format): Ditto.
21673         * gmp-impl.h, doprnt.c (va_copy): Move to gmp-impl.h.
21675         * tests/mpz/t-cmp_d.c (check_low_z_one): Patch by Torbjorn for vax
21676         limited float range.
21678 2001-09-23  Torbjorn Granlund  <tege@swox.com>
21680         * mpn/vax/lshift.s: Change `jsob*' to `sob*'.
21681         * mpn/vax/rshift.s: Likewise.
21683 2001-09-23  Kevin Ryde  <kevin@swox.se>
21685         * mpn/x86/pentium4/sse2/mul_basecase.asm: Some simple but real code.
21687         * printf/doprnt.c: Use va_copy for va_list variables, copy function
21688         parameter in case it's call-by-reference.
21690         * tune/freq.c (speed_cpu_frequency_bsd_dmesg): New function.
21691         (speed_cpu_frequency_table): Use it.
21693         * tune/many.pl (popcount, hamdist): Fix declared return value.
21694         (sb_divrem_mn): Remove a spurious duplicate entry.
21695         (CLEAN): Add tmp-$objbase.c when using that for .h files.
21696         (macro_speed): Give a default for .h files.
21697         Add ATTRIBUTE_CONST or __GMP_ATTRIBUTE_PURE as appropriate.
21699         * tune/speed.h (SPEED_ROUTINE_MPN_MOD_CALL,
21700         SPEED_ROUTINE_MPN_PREINV_MOD_1, SPEED_ROUTINE_MPN_POPCOUNT,
21701         SPEED_ROUTINE_MPN_HAMDIST, SPEED_ROUTINE_MPN_GCD_1N,
21702         SPEED_ROUTINE_MPN_GCD_1_CALL, SPEED_ROUTINE_MPZ_JACOBI): Use return
21703         values so gcc 3 won't discard calls to pure or const functions.
21704         (mpn_mod_1_div, mpn_mod_1_inv): Add __GMP_ATTRIBUTE_PURE.
21706 2001-09-22  Torbjorn Granlund  <tege@swox.com>
21708         * mpn/x86/pentium4/sse2/mul_basecase.asm: New file, placeholder
21709         for real code, hiding the default x86 mul_basecase.asm.
21711 2001-09-22  Kevin Ryde  <kevin@swox.se>
21713         * configure.in (AC_PREREQ): Bump to 2.52.
21714         (m4_pattern_forbid, m4_pattern_allow): New calls, forbid GMP_.
21715         (AC_CHECK_HEADERS): Remove sys/types.h, already done by autoconf.
21716         * acinclude.m4, configure.in (GMP_GCC_NO_CPP_PRECOMP): New macro.
21718         * tests/devel/try.c (TYPE_PREINV_MOD_1): Don't run size==0.
21719         (malloc_region): Need fd=-1 for mmap MAP_ANON on BSD.
21721 2001-09-20  Torbjorn Granlund  <tege@swox.com>
21723         * mpz/cong.c (mpz_congruent_p): Fix one-limb c<d test.
21725         * longlong.h: Rewrite __i370__ smul_ppmm; enable also for __s390__.
21727         * configure.in: Add support for IBM 360, 370, 390 families.
21729 2001-09-20  Kevin Ryde  <kevin@swox.se>
21731         * mpn/x86/pentium4/sse2/diveby3.asm: New file.
21732         * mpn/x86/pentium4/sse2/mode1o.asm: New file.
21734 2001-09-16  Kevin Ryde  <kevin@swox.se>
21736         * printf/doprnt.c: '#' means showpoint and showtrailing for %e, %f, %g.
21737         * tests/printf/t-printf.c (check_f): More test cases.
21739 2001-09-15  Torbjorn Granlund  <tege@swox.com>
21741         * gmp-h.in (__GMPN_AORS_1): Remove param TEST, add OP and CB.
21742         Postpone zeroing of (cout).
21743         (__GMPN_ADD_1, __GMPN_SUB_1): Corresponding changes.
21745 2001-09-14  Kevin Ryde  <kevin@swox.se>
21747         * ChangeLog: Merge in tests/rand/ChangeLog.
21748         * tests/rand/ChangeLog: Remove file.
21750         * printf/doprnt.c: Fix handling of a plain format after a GMP one; no
21751         need to protect against negative precision internally.
21752         * tests/printf/t-printf.c (check_misc): More checks.
21754 2001-09-12  Torbjorn Granlund  <tege@swox.com>
21756         * mpn/cray/ieee/invert_limb.c: Add a PROLOGUE in a comment to have
21757         HAVE_NATIVE_... defined.
21759 2001-09-11  Kevin Ryde  <kevin@swox.se>
21761         * configure.in, gmp-h.in (__GMP_HAVE_HOST_CPU_FAMILY_power,
21762         __GMP_HAVE_HOST_CPU_FAMILY_powerpc): New AC_SUBSTs.
21763         * gmp-h.in (__GMPN_COPY_INCR): Use them to select the power/powerpc
21764         code, rather than preprocessor defines.
21766         * acinclude.m4, configure.in (GMP_H_ANSI): New macro.
21768         * gmp-h.in (__GMP_EXTERN_INLINE): Add a definition for SCO 8 cc.
21770         * gmp-h.in, version.c (gmp_version): Make the pointer "const" as well
21771         as the string.
21773         * acinclude.m4, configure.in (GMP_PROG_CC_IS_XLC): Recognise xlc when
21774         invoked under another name (cc, xlc128, etc).
21775         * acinclude.m4 (GMP_PROG_CC_IS_GCC): Print a message when recognised.
21777 2001-09-11  Torbjorn Granlund  <tege@swox.com>
21779         * gmp-h.in: Let __DECC mean __GMP_HAVE_CONST, etc.
21780         * mp-h.in: Likewise.
21782 2001-09-10  Torbjorn Granlund  <tege@swox.com>
21784         * mpn/x86/pentium4/mmx/lshift.asm: New file.
21785         * mpn/x86/pentium4/mmx/rshift.asm: New file.
21787         * tests/mpn/t-iord_u.c (check_incr_data): Work around HP compiler bug.
21788         (check_decr_data): Likewise.
21790 2001-09-08  Kevin Ryde  <kevin@swox.se>
21792         * gmp.texi (Integer Logic and Bit Fiddling): Update mpz_hamdist
21793         behaviour, clarify mpz_popcount a touch.
21794         (Language Bindings): Add mlton, fix alphabetical order.
21795         (Single Limb Division): Describe 2 or 1/2 limbs at a time style.
21797         * configure.in (AC_CHECK_FUNCS): Add mmap.
21798         * tests/devel/try.c (malloc_region): Use mmap if available.
21800         * tests/refmpz.c, tests/tests.h (refmpz_hamdist): New function.
21801         * tests/mpz/t-hamdist.c: New file.
21802         * tests/mpz/Makefile.am: Add it.
21804         * mpz/hamdist.c: Support neg/neg operands.
21806         * macos/Makefile.in: Remove dual compile of mpq/aors.c and
21807         mpn/generic/popham.c.
21809         * gmp-impl.h (popc_limb): New macro, adapted from mpn/generic/popham.c.
21810         For 64-bits reuse 0x33...33 constant.
21811         * mpn/generic/popcount.c, mpn/generic/hamdist.c: Split from popham.c,
21812         use popc_limb macro, remove unused "i", don't bother with "register"
21813         qualifiers.
21814         * mpn/generic/popham.c: Remove file.
21816         * ltmain.sh, configure, aclocal.m4: Update to libtool 1.4.1, with one
21817         ltdll.c generation patch.
21818         * doc/configuration: Misc updates, note libtool patch used.
21820         * mpn/x86/pentium4/sse2/mul_1.asm: Use pointer increments not indexed
21821         addressing, to get 4.0 c/l flat.
21823         * tests/mpq/t-cmp_si.c (check_data): Use ULONG_MAX for denominators.
21825         * tests/misc.c (mpz_negrandom): Use given rstate, not RANDS.
21827 2001-09-07  Torbjorn Granlund  <tege@swox.com>
21829         * mpn/x86/pentium4/sse2/addmul_1.asm: New file.
21831 2001-09-04  Kevin Ryde  <kevin@swox.se>
21833         * tune/freq.c: Define a HAVE for each speed_cpu_frequency routine to
21834         avoid duplicating conditionals.
21835         (speed_cpu_frequency_sco_etchw): New function.
21836         (speed_cpu_frequency_table): Use it.
21837         * tune/README: Mention SCO openunix 8 /etc/hw.
21839         * mpz/fib_ui.c: Use ?: to avoid a gcc 3 bug on powerpc64.
21840         Store back a carry for limb<long.
21842         * mpn/x86/k7/mmx/divrem_1.asm, mpn/x86/k7/mmx/mod_1.asm,
21843         mpn/x86/p6/mmx/divrem_1.asm: Fix a couple of comments.
21845         * config.guess: Give m68020 for 68020 or better, not m68k.
21846         * configfsf.guess: Update to 2001-09-04.
21848 2001-09-02  Kevin Ryde  <kevin@swox.se>
21850         * configure.in (m68k-*-*): Let m68k mean 68000, not 68020.
21851         * gmp.texi (Notes for Particular Systems): Update.
21853         * gmp-impl.h (union ieee_double_extract) [m68k]: Use longs, since int
21854         might be only 16 bits.
21856         * tests/mpq/t-aors.c: New file.
21857         * tests/mpq/Makefile.am: Add it.
21859         * tests/refmpq.c: New file.
21860         * tests/Makefile.am: Add it.
21861         * tests/tests.h: Add prototypes.
21863         * mpq/aors.c: Share object code for mpq_add and mpq_sub.
21864         * Makefile.am, mpq/Makefile.am: Single mpq/aors.lo now.
21866         * tests/devel/try.c (TYPE_SUBMUL_1): Use correct reference routine.
21868 2001-08-30  Kevin Ryde  <kevin@swox.se>
21870         * mpn/x86/x86-defs.m4 (cmov_available_p): Add pentium4.
21872         * gmp-h.in: Put #define renamings with prototypes.
21873         Remove commented out #defines of gmp-impl.h things.
21874         (mpn_invert_limb): Remove #define, already in gmp-impl.h.
21875         (mpn_lshiftc, mpn_rshiftc): Remove #defines, unused.
21876         (mpn_addsub_nc): Add prototype to #define.
21878 2001-08-28  Kevin Ryde  <kevin@swox.se>
21880         * gmp.texi: Switch to GFDL.
21881         (Top): Arrange copyright and conditions to appear here too.  For
21882         clarity have all this before the miscellaneous macro definitions.
21883         (Copying): Refer to COPYING.LIB file, mention plain GPL2 in demo
21884         programs.
21885         (Contributors, References): Use @appendix rather than @unnumbered.
21886         (GNU Free Documentation License): New appendix.
21887         (@contents): Move to start of document, use only for tex (not html).
21888         (Debugging): Add leakbug.
21889         (Build Options): Add pentium4.
21890         (I/O of Rationals): Add mpq_inp_str.
21892         * fdl.texi: New file, with two @appendix directive tweaks.
21893         * Makefile.am (gmp_TEXINFOS): Add it.
21895         * tests/mpz/io.c: Check mpz_inp_str return against ftell, send error
21896         messages just to stdout.
21898         * mpz/inp_str.c, gmp-impl.h (__gmpz_inp_str_nowhite): New function,
21899         and share a __gmp_free_func call.
21900         * mpq/inp_str.c: New file.
21901         * Makefile.am, mpq/Makefile.am: Add it.
21902         * tests/mpq/t-inp_str.c: New file.
21903         * tests/mpq/Makefile.am (check_PROGRAMS): Add it.
21905         * configure.in, acconfig.h (HAVE_HOST_CPU_FAMILY_power,
21906         HAVE_HOST_CPU_FAMILY_powerpc, HAVE_HOST_CPU_FAMILY_x86): AC_DEFINEs
21907         for processor families.
21908         * gmp-impl.h: Use them, rather than cpp defines.
21910         * demos/Makefile.am (primes_LDADD): Use $(LIBM), for log().
21912         * tune/many.pl, tune/Makefile.am: Fix some from clean and distclean.
21914 2001-08-26  Kevin Ryde  <kevin@swox.se>
21916         * tests/devel/try.c (ARRAY_ITERATION): Make types match on "?:" legs.
21917         (TYPE_MPZ_JACOBI, TYPE_MPZ_KRONECKER): Remove some superseded code.
21919         * tests/printf/t-printf.c (check_plain): Don't compare "all digits"
21920         precision against plain printf.
21922         * tune/Makefile.am: Eliminate empty TUNE_MPZ_SRCS.
21924         * configure, config.in, INSTALL.autoconf: Update to autoconf 2.52.
21925         * */Makefile.in, mdate-sh, missing, aclocal.m4, configure: Update to
21926         automake 1.5.
21927         * configfsf.guess, configfsf.sub: Update to 2001-08-23.
21929 2001-08-24  Torbjorn Granlund  <tege@swox.com>
21931         * demos/primes.c: Complete rewrite.
21933 2001-08-24  Kevin Ryde  <kevin@swox.se>
21935         * longlong.h: Test __ppc__ for apple darwin cc, reported by Jon
21936         Becker.  Also test __POWERPC__, PPC and __vxworks__.
21938         * tune/speed.h (speed_cyclecounter) [x86]: Don't clobber ebx in PIC.
21940 2001-08-22  Kevin Ryde  <kevin@swox.se>
21942         * configure.in (x86 mmx): Correction to mmx path stripping.
21944 2001-08-17  Kevin Ryde  <kevin@swox.se>
21946         * configure.in, acinclude.m4, Makefile.am, printf/Makefile.am,
21947         tests/printf/Makefile.am, gmp-h.in, gmp-impl.h, gmp.texi: Remove C++
21948         support, for the time being.
21949         * printf/doprntfx.cc, doprntix.cc, osfuns.cc, osmpf.cc, osmpq.cc,
21950         osmpz.cc, tests/printf/t-ostream.cc: Remove files.
21952         * printf/doprnt.c, printf/doprntf.c, gmp-impl.h: Use a single
21953         __gmp_doprnt_mpf, rather than a separate ndigits calculation.
21954         * printf/doprnt.c, printf/doprntf.c, gmp-impl.h, gmp.texi,
21955         tests/printf/t-printf.c: Let empty or -1 prec mean all digits for mpf.
21956         * printf/doprnt.c, tests/printf/t-printf.c: Accept h or l in %n; let
21957         negative "*" style width mean left justify.
21959         * gmp-impl.h, mpf/get_str.c (MPF_SIGNIFICANT_DIGITS): New macro,
21960         extracted from mpf/get_str.c.
21962         * libmp.sym: New file.
21963         * Makefile.am (libmp_la_LDFLAGS): Use it.
21964         (DISTCLEANFILES): Remove asm-syntax.h, no longer generated.
21965         Remove some comments about "make check".
21967         * demos/perl/GMP.pm, GMP.xs, GMP/Mpf.pm: Add printf and sprintf,
21968         change get_str to string/exponent for floats, remove separate
21969         mpf_get_str.
21970         * demos/perl/GMP/Mpf.pm (overload_string): Use $# (default "%.g").
21971         * demos/perl/typemap: Fix some duplicate string entries.
21972         * demos/perl/test.pl: Update tests, split overloaded constants into ...
21973         * demos/perl/test2.pl: ... this new file.
21974         * demos/perl/Makefile.PL (clean): Add test.tmp.
21976 2001-08-16  Kevin Ryde  <kevin@swox.se>
21978         * printf/snprntffuns.c (gmp_snprintf_format): Correction to bufsize-1
21979         return value handling.
21981         * demos/calc/calc.y: Reposition "%{" so copyright notice gets into
21982         generated files.
21984         * INSTALL: Use gmp_printf.
21986 2001-08-14  Kevin Ryde  <kevin@swox.se>
21988         * mpz/inp_str.c: Fix return value (was 1 too big).
21989         * tests/mpz/t-inp_str.c: New file.
21990         * tests/mpz/Makefile.am: Add it.
21992         * mpn/x86/pentium4/sse2/add_n.asm: New file.
21993         * mpn/x86/pentium4/sse2/sub_n.asm: New file.
21994         * mpn/x86/pentium4/sse2/mul_1.asm: New file.
21996 2001-08-12  Kevin Ryde  <kevin@swox.se>
21998         * printf/sprintffuns.c, printf/doprntf.c: Don't use sprintf return
21999         value (it's a pointer on SunOS 4).
22001         * acinclude.m4 (GMP_ASM_X86_SSE2, GMP_STRIP_PATH): New macros.
22002         * configure.in: Add pentium4 support.
22003         * mpn/x86/pentium4, mpn/x86/pentium4/mmx, mpn/x86/pentium4/sse2: New
22004         directories.
22005         * mpn/x86/README: Update.
22007 2001-08-10  Torbjorn Granlund  <tege@swox.com>
22009         * demos/pexpr.c (setup_error_handler): Catch also SIGABRT.
22011 2001-07-31  Kevin Ryde  <kevin@swox.se>
22013         * tests/refmpn.c (refmpn_mul_1c): Allow low to high overlaps.
22015         * gmp-h.in, gmp-impl.h (_gmp_rand): Move prototype to gmp-impl.h.
22017         * tune/Makefile.am (EXTRA_DIST): Add many.pl.
22019 2001-07-28  Kevin Ryde  <kevin@swox.se>
22021         * gmp.texi (Random Number Functions): Old rand functions no longer use
22022         the C library.
22024         * configure.in, acinclude.m4 (GMP_FUNC_VSNPRINTF): New macro.
22026         * mpn/generic/get_str.c: Add an ASSERT for high limb non-zero.
22028 2001-07-24  Kevin Ryde  <kevin@swox.se>
22030         * gmp.texi (Build Options): Add --enable-cxx.
22031         (Converting Floats): Note mpf_get_str only generates accurately
22032         representable digits.
22033         (Low-level Functions): Note mpn_get_str requires non-zero high limb.
22034         (Formatted Output): New chapter.
22035         (Multiplication Algorithms): Use @quotation with @multitable.
22036         (Toom-Cook 3-Way Multiplication): Ditto.
22038         * tests/memory.c (tests_free_nosize): New function.
22039         * tests/tests.h (tests_allocate etc): Add prototypes.
22041         * tests/printf: New directory.
22042         * tests/printf/Makefile.am, t-printf.c, t-ostream.cc: New files.
22043         * configure.in, tests/Makefile.am: Add them.
22045         * configure.in, acinclude.m4 (GMP_PROG_CXX): New macro.
22046         * configure.in (--enable-cxx): New option.
22047         (AC_CHECK_HEADERS): Add locale.h and sys/types.h, remove unistd.h.
22048         (AC_CHECK_TYPES): Add intmax_t, long double, long long, ptrdiff_t,
22049         quad_t.
22050         (AC_CHECK_FUNCS): Add localeconv, memset, obstack_vprintf, snprintf,
22051         strchr, vsnprintf.
22052         (AC_CHECK_DECLS): Add vfprintf.
22054         * gmp-h.in, gmp-impl.h: Additions for gmp_printf etc.
22056         * printf: New directory.
22057         * printf/Makefile.am, asprintf.c, doprnt.c, doprntf.c, doprntfx.cc,
22058         doprnti.c, doprntix.cc, fprintf.c, obprintf.c, obprntffuns.c,
22059         obvprintf.c, osfuns.cc, osmpf.cc, osmpq.cc, osmpz.cc, printf.c,
22060         printffuns.c, snprintf.c, snprntffuns.c, sprintf.c, sprintffuns.c,
22061         vasprintf.c, vfprintf.c, vprintf.c, vsnprintf.c, vsprintf.c: New
22062         files.
22063         * configure.in, Makefile.am: Add them.
22065         * configure.in (HAVE_INLINE): Remove AC_DEFINE, unused.
22066         (AC_CHECK_TYPES): Don't test for void, assume it always exists.
22068         * gmp-impl.h (__GMP_REALLOCATE_FUNC_MAYBE): New macro.
22069         * mpz/get_str.c, mpq/get_str.c, mpf/get_str.c: Use it.
22071         * gmp-impl.h (mpn_fib2_ui): Use __MPN.
22072         (MPN_COPY_DECR): Fix an ASSERT.
22073         (CAST_TO_VOID): Remove macro.
22075         * gmp-h.in (mpq_out_str): Give #define even without prototype.
22076         (mpz_cmp_d, mpz_cmpabs_d): Corrections to #defines.
22078         * tests/devel/try.c: Add mpn_add and mpn_sub, don't use CAST_TO_VOID.
22080 2001-07-23  Torbjorn Granlund  <tege@swox.com>
22082         * config.guess: Recognize pentium4.
22083         * config.sub: Recognize pentium4.
22085 2001-07-17  Kevin Ryde  <kevin@swox.se>
22087         * gmp-h.in (__GMPN_AORS_1): Remove x86 and gcc versions, leave just
22088         one version.
22089         (__GMPN_ADD, __GMPN_SUB): New macros, rewrite of mpn_add and mpn_sub.
22090         (mpn_add, mpn_sub): Use them.
22091         (__GMPN_COPY_REST): New macro.
22093         * gmp-h.in, gmp-impl.h, acinclude.m4: Remove __GMP_ASM_L and
22094         __GMP_LSYM_PREFIX, revert to ASM_L in gmp-impl.h and AC_DEFINE of
22095         LSYM_PREFIX.
22097 2001-07-11  Kevin Ryde  <kevin@swox.se>
22099         * gmp-h.in (__GMPN_ADD_1 etc) [x86]: Don't use this on egcs 2.91.
22101         * mpz/fits_uint.c, fits_ulong.c, mpz/fits_ushort.c: Split up fits_u.c.
22102         * mpz/fits_u.c: Remove file.
22103         * mpz/Makefile.am, macos/Makefile.in: Update.
22105         * tests/refmpn.c,tests.h (refmpn_copy): New function.
22106         * tests/devel/try.c (TYPE_ZERO): No return value from call.
22107         (TYPE_MODEXACT_1_ODD, TYPE_MODEXACT_1C_ODD): Share call with
22108         TYPE_MOD_1 and TYPE_MOD_1C.
22109         (MPN_COPY, __GMPN_COPY, __GMPN_COPY_INCR): Add testing.
22111 2001-07-10  Kevin Ryde  <kevin@swox.se>
22113         * gmp-h.in (__GMPN_COPY): Add form to help gcc on power and powerpc.
22114         * gmp-impl.h (MPN_COPY_INCR, MPN_COPY_DECR, MPN_ZERO): Ditto.
22115         * mpn/powerpc64/copyi.asm, mpn/powerpc64/copyd.asm: Remove files.
22117         * mpz/tdiv_ui.c: Eliminate some local variables (seems to save code on
22118         i386 gcc 2.95.x), remove a bogus comment about quotient.
22120         * errno.c, gmp-impl.h (__gmp_exception, __gmp_divide_by_zero,
22121         __gmp_sqrt_of_negative): New functions.
22122         * gmp-impl.h (GMP_ERROR, DIVIDE_BY_ZERO, SQRT_OF_NEGATIVE): Use them.
22124         * randclr.c, randraw.c: Use ASSERT(0) for unrecognised algorithms.
22126 2001-07-07  Kevin Ryde  <kevin@swox.se>
22128         * configure.in (powerpc*-*-*): Use -no-cpp-precomp for Darwin.
22130         * tests/mpbsd/t-itom.c: Renamed from t-misc.c.
22131         * tests/mpbsd/t-misc.c: Remove file.
22132         * tests/mpbsd/Makefile.am: Update.
22134         * tests/mpf/t-set_si.c,t-cmp_si.c,t-gsprec.c: Split from t-misc.c.
22135         * tests/mpf/t-misc.c: Remove file.
22136         * tests/mpf/Makefile.am: Update.
22138         * tests/mpz/t-oddeven.c,t-set_si.c,t-cmp_si.c: Split from t-misc.c.
22139         * tests/mpz/t-misc.c: Remove file.
22140         * tests/mpz/Makefile.am: Update.
22142         * stack-alloc.c: Add some alignment ASSERTs.
22144         * gmp-impl.h (MPN_NORMALIZE): Add notes on x86 repe/scasl slow.
22146         * tests/devel/try.c (MPN_ZERO): Add testing.
22147         * tune/speed.c,speed.h,common.c,many.pl (MPN_ZERO): Add measuring.
22149         * mpn/x86/divrem_1.asm: Update a remark about gcc and "loop".
22151         * tests/mpq/t-cmp_si.c: New file.
22152         * tests/mpq/Makefile.am: Add it.
22154         * tests/misc.c,tests.h (mpq_set_str_or_abort): New function.
22156         * mpq/cmp_si.c: New file.
22157         * Makefile.am, mpq/Makefile.am: Add it.
22158         * gmp-h.in (mpq_cmp_si): Add prototype.
22159         * gmp.texi (Comparing Rationals): Add doco.
22161         * gmp-h.in (_GMP_H_HAVE_FILE): Add _FILE_DEFINED for microsoft, add
22162         notes on what symbols are for what systems.
22164 2001-07-06  Torbjorn Granlund  <tege@swox.com>
22166         * longlong.h (ibm032 umul_ppmm): Fix typo.
22167         * longlong.h (sparclite sdiv_qrnnd): Fix typo.
22169 2001-07-03  Kevin Ryde  <kevin@swox.se>
22171         * mpz/bin_ui.c (DIVIDE): Use MPN_DIVREM_OR_DIVEXACT_1.
22172         * mpz/bin_uiui.c (MULDIV): Ditto, and use local variables for size and
22173         pointer.
22175         * acinclude.m4 (GMP_INCLUDE_GMP_H): New macro, use it everywhere gmp.h
22176         is wanted at configure time.
22177         * acinclude.m4, configure.in (GMP_H_EXTERN_INLINE, GMP_H_HAVE_FILE):
22178         New macros.
22180         * gmp-h.in (__GMP_EXTERN_INLINE): Set to "inline" for C++.
22181         (mpn_add, mpn_sub): Use new style __GMP_EXTERN_INLINE.
22182         * gmp-h.in, mp-h.in, gmp-impl.h (_EXTERN_INLINE): Remove, unused.
22183         * mpn/generic/add.c, mpn/generic/sub.c: New files.
22184         * mpn/generic/inlines.c: Remove file.
22185         * configure.in, mpn/Makefile.am: Update.
22187         * gmp.texi (GMP Basics): Note the need for stdio.h to get FILE
22188         prototypes.
22190 2001-07-01  Kevin Ryde  <kevin@swox.se>
22192         * gmp.texi (Build Options, Reentrancy): Updates for new
22193         --enable-alloca behaviour.
22194         (Debugging): Describe --enable-alloca=debug.
22195         (Miscellaneous Integer Functions): Note mpz_sizeinbase ignores signs.
22196         (Low-level Functions): Give a formula for mpn_gcdext cofactor.
22197         (Factorial Algorithm): New section.
22198         (Binomial Coefficients Algorithm): New section.
22199         Misc tweaks elsewhere.
22201         * mpf/set_prc.c: Merge the two truncation conditionals, misc cleanups,
22202         no functional changes.
22204         * mpn/*/gmp-mparam.h (DIVEXACT_1_THRESHOLD): Add tuned values.
22205         * gmp-impl.h (DIVEXACT_1_THRESHOLD): Make the default 0 when
22206         2*UMUL_TIME < UDIV_TIME.
22208         * mpn/x86/p6/dive_1.asm: New file.
22210         * mpn/x86/dive_1.asm: New file.
22211         * mpn/x86/gmp-mparam.h (DIVEXACT_1_THRESHOLD): Use it always.
22213         * tests/refmpn.c, tests.h (refmpn_zero): New function.
22214         * tests/devel/try.c: Use it.
22216         * tests/refmpn.c (refmpn_sb_divrem_mn): Use refmpn_cmp, not mpn_cmp.
22218         * tests/mpf/t-get_d.c (main): Use || not |.
22220         * tests/misc.c, tests/t-modlinv.c, tests/mpq/t-get_str.c,
22221         tests/mpf/reuse.c: Add string.h.
22223 2001-06-29  Kevin Ryde  <kevin@swox.se>
22225         * tune/speed.h (SPEED_ROUTINE_MPN_FIB2_UI,
22226         SPEED_ROUTINE_COUNT_ZEROS_C): Corrections to TMP block handling.
22228         * gmp-impl.h (MPN_TOOM3_MUL_N_MINSIZE, MPN_TOOM3_SQR_N_MINSIZE):
22229         Corrections to these to account for adding tD into E.
22230         (MPN_INCR_U, MPN_DECR_U) [WANT_ASSERT]: Add size
22231         assertions, since mpn_add_1 and mpn_sub_1 from gmp.h don't get them.
22232         (MPN_DIVREM_OR_DIVEXACT_1): Add an assert of no remainder.
22234         * assert.c: Add stdlib.h for abort prototype.
22235         * tests/spinner.c, trace.c, t-constants.c, t-count_zeros.c,
22236         t-gmpmax.c, t-modlinv.c: Ditto.
22237         * tests/mpz/t-bin.c, t-cmp.c, t-get_si.c, t-misc.c, t-popcount.c,
22238         t-set_str.c, t-sizeinbase.c: Ditto.
22239         * tests/mpq/t-equal.c, t-get_str.c, t-set_f.c, t-set_str.c: Ditto.
22240         * tests/mpf/t-fits.c, t-get_d.c, t-get_si.c, t-int_p.c, t-misc.c,
22241         t-trunc.c: Ditto.
22242         * tests/mpbsd/allfuns.c, t-misc.c: Ditto.
22244         * mpn/generic/mul_n.c, mpz/cfdiv_r_2exp.c: Use MPN_INCR_U rather than
22245         mpn_incr_u.
22247         * tests/devel/try.c (TYPE_SB_DIVREM_MN): More fixes for calling method.
22249         * mpn/x86/k6/cross.pl: More insn exceptions.
22251 2001-06-23  Kevin Ryde  <kevin@swox.se>
22253         * gmp-h.in (__GMPN_ADD_1, __GMPN_SUB_1) [i386]: Fix some asm output
22254         constraints.
22256         * gmp-impl.h (modlimb_invert): Mask after shifting, so mask constant
22257         fits a signed byte.
22259         * tests/devel/try.c (TYPE_SB_DIVREM_MN): Fix initial fill of quotient
22260         with garbage.
22262 2001-06-20  Kevin Ryde  <kevin@swox.se>
22264         * config.guess (rs6000-*-aix4* | powerpc-*-aix4*): Suppress error
22265         messages if $CC_FOR_BUILD or program don't work.
22267         * mpz/sqrt.c,sqrtrem.c: Special case for op==0, to avoid TMP_ALLOC(0).
22268         * tests/refmpf.c (refmpf_add, refmpf_sub): Avoid TMP_ALLOC(0).
22270         * tests/mpn/t-aors_1.c: New file.
22271         * tests/mpn/Makefile.am: Add it.
22273         * gmp-h.in (__GMPN_ADD_1, __GMPN_SUB_1): New macros, rewrite of
22274         mpn_add_1 and mpn_sub_1, better code for src==dst and/or n==1,
22275         separate versions for gcc x86, gcc generic, and non-gcc.
22276         (mpn_add_1, mpn_sub_1): Use them.
22277         (mpn_add, mpn_sub): Ditto, to get inlines on all compilers.
22278         (extern "C") [__cplusplus]: Let this encompass the extern inlines too.
22279         * mpn/generic/add_1.c,sub_1.c: New files, force code from gmp.h.
22280         * configure.in, mpn/Makefile.am: Add them.
22282         * acinclude.m4 (GMP_ASM_LSYM_PREFIX): AC_SUBST __GMP_LSYM_PREFIX
22283         rather than AC_DEFINE LSYM_PREFIX.
22284         * gmp-h.in (__GMP_LSYM_PREFIX): New substitution.
22285         (__GMP_ASM_L): New macro.
22286         * gmp-impl.h (ASM_L): Use it.
22288         * acinclude.m4, configure.in (GMP_C_ATTRIBUTE_MALLOC): New macro.
22289         * gmp-impl.h: Use it for all the malloc based TMP_ALLOCs.
22291         * stack-alloc.h: Remove file.
22292         * tal-reent.c: New file.
22293         * Makefile.am: Update.
22295         * acinclude.m4, configure.in (GMP_OPTION_ALLOCA): New macro, add
22296         malloc-reentrant method, use stack-alloc.c as malloc-notreentrant,
22297         make "reentrant" the default.
22298         * gmp-impl.h (__TMP_ALIGN): Moved from stack-alloc.c, use a union to
22299         determine the value, and demand only 4 bytes align on 32-bit systems.
22300         * gmp-impl.h (WANT_TMP_NOTREENTRANT): Move global parts of
22301         stack-alloc.h to here, allow non power-of-2 __TMP_ALIGN in TMP_ALLOC.
22302         * gmp-impl.h: Extend extern "C" to TMP_ALLOC declarations.
22303         * stack-alloc.c (tmp_stack): Move private parts of stack-alloc.h to
22304         here, use gmp-impl.h.
22306         * gmp-impl.h (TMP_ALLOC_LIMBS_2): New macro.
22307         * mpz/fib_ui.c, mpz/jacobi.c, mpq/cmp.c, mpn/generic/fib2_ui.c: Use it.
22309         * mpfr/exp2.c: Patch by Paul to match TMP_MARK and TMP_FREE in loop.
22310         * mpfr/sqrt.c: Scope nested TMP_DECL into nested { } block, patch by
22311         Paul, tweaked by me.
22312         * mpfr/agm.c: Ditto, and add a final TMP_FREE(marker2).
22314         * gmp-h.in (mpn_cmp): Add __GMP_ATTRIBUTE_PURE.
22316         * INSTALL: Clarify "make install", tweak formatting a bit.
22318 2001-06-17  Kevin Ryde  <kevin@swox.se>
22320         * configure.in, Makefile.am, gmp-impl.h: Add a debugging TMP_ALLOC,
22321         selected with --enable-alloca=debug.
22322         * tal-debug.c: New file.
22323         * configure.in, Makefile.am: Compile stack-alloc.c only for
22324         --disable-alloca.
22325         * assert.c (__gmp_assert_header): New function, split from
22326         __gmp_assert_fail.
22328         * mpz/lcm.c: Don't TMP_MARK and then just return. Remove unnecessary
22329         _mpz_realloc prototype.
22331         * mpn/generic/mul.c (mpn_sqr_n): Use __gmp_allocate_func for toom3
22332         temporary workspace.
22334 2001-06-15  Kevin Ryde  <kevin@swox.se>
22336         * tests/mpz/t-set_f.c: New file.
22337         * tests/mpz/Makefile.am (check_PROGRAMS): Add it.
22339         * mpz/set_f.c: Share MPN_COPY between pad and trunc cases, do exp<=0
22340         test earlier, store SIZ(w) earlier.
22342         * tests/t-count_zeros.c: New file.
22343         * tests/t-gmpmax.c: New file.
22344         * tests/Makefile.am (check_PROGRAMS): Add them.
22346         * mp_clz_tab.c: Compile the table only if longlong.h says it's needed;
22347         add an internal-use-only comment.
22348         * tune/common.c: Force a __clz_tab for convenience when testing.
22350         * mpn/x86/pentium/gmp-mparam.h, mpn/x86/pentium/mmx/gmp-mparam.h: Add
22351         COUNT_LEADING_ZEROS_NEED_CLZ_TAB, for mod_1.asm.
22353         * longlong.h (count_leading_zeros) [pentium]: Decide to go with float
22354         method for p54.
22355         (count_leading_zeros) [alpha]: Add COUNT_LEADING_ZEROS_NEED_CLZ_TAB.
22356         (__clz_tab): Provide a prototype only if it's needed.
22358         * tests/trace.c (mpz_trace): Don't use = on structures.
22359         (mpn_trace): Set _mp_alloc when creating mpz.
22361 2001-06-12  Kevin Ryde  <kevin@swox.se>
22363         * mpn/x86/divrem_1.asm: Amend some comments about P5 speed.
22365         * tune/README: Clarify reconfigure on gmp-mparam.h update.
22367         * mpn/x86/p6/copyd.asm: New file.
22368         * mpn/x86/p6/README: Update copyd and mod_1.
22369         * mpn/x86/copyd.asm: Amend some comments.
22371         * gmp-impl.h (__builtin_constant_p): Add dummy for non-gcc.
22372         (mpn_incr_u, mpn_decr_u): Recognise incr==1 at compile time in the
22373         generic code on gcc.
22375         * gmp-impl.h (ASSERT_ZERO_P, ASSERT_MPN_NONZERO_P): New macros.
22376         * mpn/generic/gcd_1.c, mpn/generic/mul_fft.c: Use them.
22377         * mpz/get_d.c: Add a private mpn_zero_p.
22378         * mpfr/trunc.c: Use own mpn_zero_p.
22379         * tune/speed.h (SPEED_ROUTINE_MPN_GCD_1N): Use refmpn_zero_p.
22380         * gmp-impl.h (mpn_zero_p): Remove, no longer needed.
22382         * gmp-h.in, gmp-impl.h: Move MPN_CMP to gmp.h as __GMPN_CMP, leave an
22383         MPN_CMP alias in gmp-impl.h.
22384         * gmp-h.in (mpn_cmp): Add an inline version.
22385         * mpn/generic/cmp.c: Use __GMP_FORCE_mpn_cmp to get code from gmp.h.
22387         * acinclude.m4 (GMP_C_ATTRIBUTE_MODE): New macro.
22388         * configure.in: Call it.
22389         * gmp-impl.h (SItype etc): Use it.
22391         * randraw.c (lc): Change mpn_mul_basecase->mpn_mul,
22392         mpn_incr_u->MPN_INCR_U, abort->ASSERT_ALWAYS(0).
22394         * longlong.h (count_leading_zeros) [pentiumpro]: Work around a partial
22395         register stall on gcc < 3.
22397         * gmp.texi (Introduction to GMP): Add IA-64.
22398         (Notes for Particular Systems): i386 means generic x86.
22400         * tests/t-modlinv.c: Use tests_start and tests_end.
22402 2001-06-10  Kevin Ryde  <kevin@swox.se>
22404         * gmp.texi (Number Theoretic Functions): mpz_jacobi only defined for b
22405         odd.  Separate the jacobi/legendre/kronecker descriptions.
22406         (Low-level Functions): Document mpn_mul_1 "incr" overlaps.
22407         (Language Bindings): New chapter.
22409         * mpz/jacobi.c: Don't retaining old behaviour of mpz_jacobi on even b
22410         (it wasn't documented in 3.1.1).
22411         * mpz/jacobi.c, gmp-h.in (mpz_kronecker, mpz_legendre): Remove
22412         separate entrypoints, just #define to mpz_jacobi.
22413         * compat.c (__gmpz_legendre): Add compatibility entrypoint.
22415         * mpn/generic/mul_1.c: Allow "incr" style overlaps.
22416         * tests/devel/try.c (param_init): Test this.
22418         * mpf/mul_ui.c: Do size==0 test earlier.
22420 2001-06-08  Kevin Ryde  <kevin@swox.se>
22422         * gmp-impl.h (ULONG_HIGHBIT, UINT_HIGHBIT, USHRT_HIGHBIT): Cast
22423         ULONG_MAX etc to unsigned long etc before attempting to right shift.
22425         * acinclude.m4 (GMP_ASM_LSYM_PREFIX): Add an AC_DEFINE of LSYM_PREFIX.
22426         * gmp-impl.h (ASM_L): New macro.
22427         (mpn_incr_u, mpn_decr_u, MPN_INCR_U, MPN_DECR_U): Add i386 optimized
22428         versions.
22430         * mpn/hppa/*.s,S,asm: Use .label so the code works with gas on hppa
22431         GNU/Linux too, reported by LaMont Jones <lamont@smallone.fc.hp.com>.
22432         * mpn/hppa/README: Add some notes on this.
22433         * acinclude.m4 (GMP_ASM_LABEL_SUFFIX): Ditto.
22435         * mpn/Makefile.am (nodist_libdummy_la_SOURCES): Add dive_1.c,
22436         fib2_ui.c.
22438         * tests/mpn/t-iord_u.c: New file.
22439         * tests/mpn/Makefile.am (check_PROGRAMS): Add it.
22441         * configure.in (mips*-*-irix[6789]*): Make ABI=n32 the default, same
22442         as in gmp 3.1.
22443         * gmp.texi (ABI and ISA): Update.
22445         * gmp.texi (Build Options): Misc tweaks.
22446         (Notes for Particular Systems): Describe windows DLL handling.
22447         (Known Build Problems): DJGPP needs bash 2.04.
22448         (Number Theoretic Functions): mpz_invert returns 0<=r<modulus; add
22449         mpz_fib2_ui, mpz_lucnum_ui, mpz_lucnum2_ui.
22450         (Fibonacci Numbers Algorithm): Update for new formulas used.
22451         (Lucas Numbers Algorithm): New section.
22453         * tune/speed.c,speed.h,common.c,many.pl: Add mpn_fib2_ui, mpz_fib2_ui,
22454         mpz_lucnum_ui, mpz_lucnum2_ui.
22455         * demos/expr/exprz.c,README: Add lucnum.
22456         * demos/perl/GMP.pm,GMP.xs,GMP/Mpz.pm,test.pl: Add fib2, lucnum,
22457         lucnum2.
22459         * tests/mpz/t-lucnum_ui.c: New file.
22460         * tests/mpz/Makefile.am (check_PROGRAMS): Add it.
22461         * tests/mpz/t-fib_ui.c: Check mpz_fib2_ui too, updates for new style
22462         MPN_FIB2_SIZE.
22464         * tune/tuneup.c, tune/Makefile.am, gmp-impl.h, mpn/*/gmp-mparam.h:
22465         Remove FIB_THRESHOLD, no longer required.
22467         * mpz/fib2_ui.c, mpz/lucnum_ui.c mpz/lucnum2_ui.c: New files.
22468         * Makefile.am, mpz/Makefile.am: Add them.
22469         * gmp-h.in (mpz_fib2_ui, mpz_lucnum_ui, mpz_lucnum2_ui): Add
22470         prototypes.
22472         * mpn/generic/fib2_ui.c: New file.
22473         * configure.in (gmp_mpn_functions): Add it.
22474         * gmp-impl.h (mpn_fib2_ui, FIB_TABLE, etc): Add these.
22475         * mpz/fib_ui.c: Rewrite.
22477         * acinclude.m4 (GMP_C_SIZES): Fix _LONG_LONG_LIMB define for mp_limb_t
22478         size test.
22479         (GMP_FUNC_ALLOCA): Add dummy __GMP_BITS_PER_MP_LIMB for gmp-h.in work.
22481         * configure.in (CPPFLAGS): Remove -D__GMP_WITHIN_GMP, don't want it
22482         everywhere.
22483         * Makefile.am, mpn/Makefile.am, mpz/Makefile.am, mpq/Makefile.am,
22484         mpf/Makefile.am, mpbsd/Makefile.am (INCLUDES): Set -D__GMP_WITHIN_GMP.
22486         * configure.in (*-*-msdosdjgpp*): Forcibly disable shared libraries,
22487         to make libtests.la work.
22489         * acconfig.h (_LONG_LONG_LIMB, HAVE_MPFR): Remove dummy defines, no
22490         longer needed.
22492         * mpz/set_ui.c: Store to _mp_d[0] unconditionally.
22494 2001-05-27  Kevin Ryde  <kevin@swox.se>
22496         * configure.in, gmp-h.in, mp-h.in: Add support for windows DLLs.
22498 2001-05-26  Kevin Ryde  <kevin@swox.se>
22500         * gmp.texi (ABI and ISA, Reentrancy): Minor tweaks
22501         (Notes for Package Builds): Note gmp.h is a generated file.
22502         (Notes for Particular Systems): -march=pentiumpro is used for gcc
22503         2.95.4 and up.
22504         (Assembler Loop Unrolling): Mention non power-of-2 unrolling.
22505         (Internals): New chapter.
22506         * mpf/README: Remove file.
22508         * demos/expr/README: Miscellaneous rewordings.
22510         * demos/perl: New directory.
22511         * demos/Makefile.am: Add it.
22512         * demos/perl/INSTALL, Makefile.PL, GMP.pm, GMP.xs, typemap,
22513         GMP/Mpz.pm, GMP/Mpq.pm, GMP/mpf.pm, GMP/Rand.pm, sample.pl, test.pl:
22514         New files.
22516         * configure, aclocal.m4: Update to autoconf 2.50.
22518         * configure, aclocal.m4, ltmain.sh: Update to libtool 1.4.
22520         * configure, aclocal.m4, missing, ansi2knr.c, */Makefile.in: Update to
22521         automake 1.4f.
22522         * Makefile.am: Conditionalize mpfr in $(SUBDIRS) to handle mpfr.info.
22523         * mpfr/Makefile.am (INFO_DEPS): Remove previous mpfr.info handling.
22524         * mpn/Makefile.am (GENERIC_SOURCES): Remove this, just put mp_bases.c
22525         in libmpn_la_SOURCES.
22526         * tests/Makefile.am (tests.h): Move from EXTRA_HEADERS to
22527         libtests_la_SOURCES.
22528         * ltconfig: Remove file, no longer needed.
22530         * Makefile.am (gmp-impl.h, longlong.h, stack-alloc.h): Move from
22531         EXTRA_DIST to libgmp_la_SOURCES, so they get included in TAGS.
22532         * tests/rand/Makefile.am (gmpstat.h): Move to libstat_la_SOURCES
22533         similarly.
22535         * config.guess (68k-*-*): Use $SHELL not "sh", tweak some comments.
22537         * mpfr/mpfr.texi (Introduction to MPFR): Tweak table formatting, note
22538         non-free programs must be able to be re-linked.
22540 2001-05-20  Kevin Ryde  <kevin@swox.se>
22542         * mpn/powerpc64/addmul_1.asm, mpn/powerpc64/mul_1.asm,
22543         mpn/powerpc64/submul_1.asm: Add carry-in entrypoints.
22545 2001-05-17  Kevin Ryde  <kevin@swox.se>
22547         * gmp.texi (ge): Fix definition for info.
22548         (Notes for Particular Systems): Mention 68k dragonball and cpu32.
22549         (Efficiency): Add static linking, more about in-place operations,
22550         describe mpq+/-integer using addmul.
22551         (Reporting Bugs): A couple of words about self-contained reports.
22552         (Floating-point Functions): Note exponent limitations of mpf_get_str
22553         and mpf_set_str.
22554         (Initializing Floats): Clarify mpf_get_prec, mpf_set_prec and
22555         mpf_set_prec_raw a bit.
22556         (Float Comparison): Note current mpf_eq deficiencies.
22558         * gmp-h.in (__GMP_HAVE_CONST, __GMP_HAVE_PROTOTYPES,
22559         __GMP_HAVE_TOKEN_PASTE): Merge GNU ansidecl.h tests for ANSI compilers.
22560         * demos/expr/expr-impl-h.in: Ditto.
22562         * gmp-impl.h (BITS_PER_MP_LIMB): Define from __GMP_BITS_PER_MP_LIMB if
22563         not already in gmp-mparam.h.
22564         * tests/t-constants.c (BITS_PER_MP_LIMB, __GMP_BITS_PER_MP_LIMB):
22565         Check these are the same.
22567         * gmp-h.in (mpf_get_default_prec, mpf_get_prec, mpf_set_default_prec,
22568         mpf_set_prec_raw): Provide "extern inline" versions, use __GMPF on the
22569         macros.
22570         * mpf/get_dfl_prc.c, mpf/get_prc.c, mpf/set_dfl_prc.c,
22571         mpf/set_prc_raw.c: Get code from gmp.h using __GMP_FORCE.
22573         * gmp-h.in, gmp-impl.h (__gmp_default_fp_limb_precision): Move from
22574         gmp-impl.h to gmp-h.in.
22575         (__GMPF_BITS_TO_PREC, __GMPF_PREC_TO_BITS): Ditto, and use __GMPF
22576         prefix and add a couple of casts.
22577         * gmp-h.in (__GMP_MAX): New macro.
22578         * mpf/init2.c mpf/set_prc.c: Update for __GMPF prefix.
22580         * gmp-h.in (__GMP_BITS_PER_MP_LIMB): New templated define.
22581         * acinclude.m4 (GMP_C_SIZES): Add AC_SUBST __GMP_BITS_PER_MP_LIMB,
22582         remove AC_DEFINE BITS_PER_MP_LIMB.
22584 2001-05-13  Kevin Ryde  <kevin@swox.se>
22586         * gmp-h.in, gmp.texi, Makefile.am, mpz/Makefile.am, tests/mpz/t-pow.c:
22587         Remove mpz_si_pow_ui, pending full si support.
22588         * mpz/si_pow_ui.c: Remove file.
22590 2001-05-11  Kevin Ryde  <kevin@swox.se>
22592         * mpn/x86/pentium/dive_1.asm: New file.
22594         * mpn/powerpc32/umul.asm: Use r on registers.
22595         * mpn/powerpc64/umul.asm: New file.
22596         * configure.in (powerpc*-*-*): Enable umul in extra_functions.
22598         * tests/refmpn.c, tests/tests.h (refmpn_umul_ppmm): Use same arguments
22599         as normal mpn_umul_ppmm.
22600         (refmpn_mul_1c): Update.
22601         * tests/devel/try.c, tune/many.pl: Add some umul_ppmm testing support.
22603         * mpn/x86/k6/mmx/popham.asm, mpn/x86/k7/mmx/popham.asm: Don't support
22604         size==0.
22605         * mpn/x86/pentium/popcount.asm, mpn/x86/pentium/hamdist.asm: Ditto,
22606         and shave a couple of cycles from the PIC entry code.
22608         * mpz/mul.c: Use mpn_mul_1 for size==1 and mpn_mul_2 (if available)
22609         for size==2, to avoid copying; do vsize==0 test earlier.
22611         * mpf/sub.c: Test r!=u before calling mpf_set.
22612         * mpf/add.c: Ditto, and share mpf_set between usize==0 and vsize==0.
22614         * mpn/generic/tdiv_qr.c, mpq/get_d.c, mpf/div.c, mpf/set_q.c,
22615         mpf/set_str.c, mpf/ui_div.c: Test for high bit set, not for
22616         count_leading_zeros zero.
22618         * acinclude.m4 (GMP_PROG_AR, GMP_PROG_NM): Print a message if extra
22619         flags are added.
22621         * tests/mpz/t-mul_i.c: New file.
22622         * tests/mpz/Makefile.am: Add it.
22624         * mpz/mul_siui.c (mpz_mul_si): Fix for -0x80..00 on long long limb.
22626         * gmp-h.in (mpf_set_si, mpf_set_ui): Revert last change, set exp to 0
22627         when n==0.
22628         * mpf/ceilfloor.c, mpf/trunc.c: Fix exp to 0 when setting r to 0.
22629         * gmp-impl.h (MPF_CHECK_FORMAT): Check exp==0 when size==0.
22631 2001-05-07  Kevin Ryde  <kevin@swox.se>
22633         * gmp-h.in (mpf_set_si, mpf_set_ui): Don't bother setting _mp_exp to 0
22634         when n==0 (use 1 unconditionally).
22635         * tests/mpf/t-misc.c (check_mpf_set_si): Don't demand anything of
22636         _mp_exp when _mp_size is zero.
22638         * mpn/x86/README: Note gas _GLOBAL_OFFSET_TABLE_ with leal problem.
22640         * gmp-h.in (mpz_fits_uint_p, mpz_fits_ulong_p, mpz_fits_ushort_p):
22641         Provide these as "extern inline"s.
22642         (__GMP_UINT_MAX, __GMP_ULONG_MAX, __GMP_USHRT_MAX): New macros.
22643         (mpz_popcount): Use __GMP_ULONG_MAX.
22644         * gmp-impl.h (UINT_MAX, ULONG_MAX, USHRT_MAX): Use __GMP_U*_MAX, if
22645         not already defined.
22646         * mpz/fits_u.c: Use the code from gmp.h.
22648 2001-05-06  Kevin Ryde  <kevin@swox.se>
22650         * mpn/x86/k7/dive_1.asm: New file.
22651         * mpn/x86/k7/gcd_1.asm: New file.
22652         * mpn/asm-defs.m4 (m4_count_trailing_zeros): New macro.
22654         * gmp-h.in (mpz_get_ui, mpz_getlimbn, mpz_set_q, mpz_perfect_square_p,
22655         mpz_popcount, mpz_size, mpf_set_ui, mpf_set_si, mpf_size): Provide
22656         these as "extern inlines".
22657         Use just one big extern "C" block.
22658         * mpz/getlimbn.c, mpz/get_ui.c, mpz/perfsqr.c, mpz/popcount.c
22659         mpz/set_q.c, mpz/size.c, mpf/set_si.c, mpf/set_ui.c, mpf/size.c: Use
22660         __GMP_FORCE to get code from gmp.h.
22662 2001-05-03  Kevin Ryde  <kevin@swox.se>
22664         * extract-dbl.c: Add ASSERT d>=0.
22666         * gmp.texi (Efficiency): Add mpz_addmul etc for mpz+=integer, add
22667         mpz_neg etc in-place.
22668         (Integer Arithmetic): Add mpz_addmul, mpz_submul, mpz_submul_ui.
22669         (Initializing Rationals): Add mpq_set_str.
22670         (Low-level Functions): mpn_set_str requires strsize >= 1.
22672         * gmp-h.in (__GMP_EXTERN_INLINE, __GMP_ABS): New macros.
22673         (mpz_abs, mpq_abs, mpf_abs, mpz_neg, mpq_neg, mpf_neg): Provide inline
22674         versions.
22675         * mpz/abs.c, mpq/abs.c, mpf/abs.c, mpz/neg.c, mpq/neg.c, mpf/neg.c:
22676         Add suitable __GMP_FORCE to turn off inline versions.
22678         * tests/mpz/t-aorsmul.c,t-cmp_d.c,t-popcount,t-set_str.c: New files.
22679         * tests/mpz/Makefile.am: Add them.
22681         * mpz/aorsmul_i.c: New file, rewrite of addmul_ui.c.  Add
22682         mpz_submul_ui entrypoint, share more code between some of the
22683         conditionals, use mpn_mul_1c if available.
22684         * mpz/addmul_ui.c: Remove file.
22685         * mpz/aorsmul.c: New file.
22686         * Makefile.am, mpz/Makefile.am: Update.
22687         * gmp-h.in (mpz_addmul, mpz_submul, mpz_submul_ui): Add prototypes.
22688         * gmp-impl.h (mpz_aorsmul_1): Add prototype.
22690         * tests/mpq/t-set_str.c: New file.
22691         * tests/mpq/Makefile.am: Add it.
22693         * mpq/set_str.c: New file.
22694         * Makefile.am, mpq/Makefile.am: Add it.
22695         * gmp-h.in (mpq_set_str): Add prototype.
22697         * mpz/set_str.c: Fix for trailing white space on zero, eg. "0 ".
22698         * mpn/generic/set_str.c: Add ASSERT str_len >= 1.
22700         * gmp-h.in, gmp-impl.h (mpn_incr_u, mpn_decr_u): Move to gmp-impl.h.
22701         * gmp-impl.h (MPN_INCR_U, MPN_DECR_U): New macros.
22703 2001-04-30  Kevin Ryde  <kevin@swox.se>
22705         * tests/mpz/t-lcm.c: New file.
22706         * tests/mpz/Makefile.am (check_PROGRAMS): Add it.
22708         * mpz/lcm.c: Add one limb special case.
22710         * mpz/lcm_ui.c: New file.
22711         * Makefile.am, mpz/Makefile.am: Add it.
22712         * gmp-h.in (mpz_lcm_ui): Add prototype.
22713         * gmp.texi (Number Theoretic Functions): Add mpz_lcm_ui, document lcm
22714         now always positive.
22716         * mp-h.in (mp_size_t, mp_exp_t): Fix typedefs to match gmp-h.in.
22718         * gmp-h.in (mpn_add_1, mpn_add, mpn_sub_1, mpn_sub): Remove K&R
22719         function defines (ansi2knr will handle mpn/inline.c, and just ansi is
22720         enough for gcc extern inline).
22722         * gmp-h.in (__GMP_HAVE_TOKEN_PASTE): New macro.
22723         (__MPN): Use it.
22724         * gmp-impl.h (CNST_LIMB): Ditto.
22726         * gmp-h.in, mp-h.in (__gmp_const, __gmp_signed, _PROTO, __MPN): Use
22727         ANSI forms on Microsoft C.
22728         (__GMP_HAVE_CONST): New define.
22729         * gmp-impl.h (const, signed): Use it.
22731         * demos/expr/expr-impl-h.in (<stdarg.h>): Use this with Microsoft C.
22732         (HAVE_STDARG): New define.
22733         * demos/expr/expr.c,exprz.c,exprq.c,exprf.c,exprfr.c: Use it.
22735         * acinclude.m4 (GMP_C_STDARG): New macro.
22736         * configure.in: Call it.
22737         * rand.c: Use it.
22739         * configure.in (AC_PROG_CC_STDC): New test.
22741 2001-04-25  Kevin Ryde  <kevin@swox.se>
22743         * mpn/x86/k6/mmx/dive_1.asm: New file.
22744         * mpn/x86/x86-defs.m4 (Zdisp): Two more insns.
22746         * mpn/x86/pentium/mul_2.asm: New file.
22747         * mpn/asm-defs.m4: Add define_mpn(mul_2).
22748         * acconfig.h (HAVE_NATIVE_mpn_divexact_1, mul_2): Add templates.
22750         * configure.in (ABI): Use AC_ARG_VAR.
22752         * tests/devel/try.c: Run reference function when validate fails.
22754         * mpq/get_str.c: Fixes for negative bases.
22755         * tests/mpq/t-get_str.c: Check negative bases.
22756         * tests/misc.c,tests.h (__gmp_allocate_strdup, strtoupper): New
22757         functions.
22759 2001-04-24  Torbjorn Granlund  <tege@swox.com>
22761         * mpz/lcm.c (mpz_lcm): Make result always positive.
22763         * gmp-h.in (mpz_inp_binary, mpz_out_binary): Remove declarations.
22765 2001-04-22  Kevin Ryde  <kevin@swox.se>
22767         * mpn/powerpc64/addsub_n.asm: Use config.m4 not asm-syntax.m4.
22769         * mpz/cmp_d.c, mpz/cmpabs_d.c: New files.
22770         * Makefile.am, mpz/Makefile.am: Add them.
22771         * mpf/cmp_d.c, mpf/get_dfl_prec.c: New files.
22772         * Makefile.am, mpf/Makefile.am: Add them.
22773         * gmp-h.in (mpz_cmp_d, mpz_cmpabs_d, mpf_cmp_d, mpf_get_default_prec):
22774         Add prototypes.
22775         * gmp.texi: Add documentation.
22777         * mpf/set_prc.c: Avoid a realloc call if already the right precision.
22779         * gmp-impl.h (MPF_BITS_TO_PREC, MPF_PREC_TO_BITS): New macros.
22780         * mpf/get_prc.c, init2.c, set_dfl_prec.c, set_prc.c, set_prc_raw.c:
22781         Use them.
22783 2001-04-20  Kevin Ryde  <kevin@swox.se>
22785         * tests/devel/try.c: Don't test size==0 on mpn_popcount and
22786         mpn_hamdist; add testing for mpn_divexact_1; print some limb values
22787         with mpn_trace not printf.
22789         * mpz/popcount.c, mpz/hamdist.c: Don't pass size==0 to mpn_popcount
22790         and mpn_hamdist.
22791         * mpn/generic/popham.c: Don't support size==0.
22793         * config.guess (m68k-*-*): Detect m68010, return m68360 for cpu32,
22794         cleanup the nesting a bit.
22796         * gmp.texi (Integer Division): Fix mpz_congruent_2exp_p "c" type.
22797         (Integer Division): Add mpz_divexact_ui.
22798         (Number Theoretic Functions): Fix mpz_nextprime return type.
22799         (Exact Remainder): Divisibility tests now implemented.
22800         And more index entries in a few places.
22802         * tests/mpz/dive_ui.c: New file.
22803         * tests/mpz/Makefile.am (check_PROGRAMS): Add it.
22805         * mpz/dive_ui.c: New file.
22806         * Makefile.am, mpz/Makefile.am: Add it.
22807         * gmp-h.in (mpz_divexact_ui): Add prototype.
22809         * tune/many.pl, tune/speed.h: Add special mpn_back_to_back for
22810         development.
22812         * gmp-impl.h (MPN_DIVREM_OR_DIVEXACT_1): New macro.
22813         * mpz/divexact.c: Use it.
22815         * gmp-impl.h (DIVEXACT_1_THRESHOLD): New threshold.
22816         * tune/tuneup.c: Tune it.
22818         * tune/speed.c,speed.h,common.c,many.pl: Add measuring of
22819         mpn_divexact_1, mpn_copyi, mpn_copyd.
22821         * mpn/generic/dive_1.c: New file.
22822         * configure.in (gmp_mpn_functions): Add it.
22823         * gmp-impl.h (mpn_divexact_1): Add prototype.
22824         * mpn/asm-defs.m4: Add define_mpn(divexact_1).
22826         * tests/mpn: New directory.
22827         * tests/Makefile.am: Add it.
22828         * tests/mpn/Makefile.am: New file.
22829         * configure.in (AC_OUTPUT): Add it.
22830         * tests/mpn/t-asmtype.c: New file.
22832         * configure, config.in: Update to autoconf 2.49d.
22834         * configure.in, gmp-h.in, mp-h.in, demos/expr/expr-impl-h.in: Revert
22835         to generating gmp.h, mp.h and expr-impl.h with AC_OUTPUT and AC_SUBST.
22837         * configure.in (m68*-*-*): Oops, m683?2 is 68000, m68360 is cpu32.
22838         * mpn/m68k/m68k-defs.m4 (scale_available_p): Ditto.
22840         * configure.in (underscore, asm_align): Remove these variables, unused.
22841         (GMP_ASM_*): Sort by AC_REQUIREs, to avoid duplication.
22842         * acinclude.m4 (GMP_ASM_UNDERSCORE, GMP_ASM_ALIGN_LOG): Remove support
22843         for actions, no longer needed.
22845 2001-04-17  Kevin Ryde  <kevin@swox.se>
22847         * config.guess (m68k-*-*): Look for cpu in linux kernel /proc/cpuinfo.
22849         * acinclude.m4 (GMP_GCC_MARCH_PENTIUMPRO): The -mpentiumpro problem is
22850         fixed in 2.95.4, so test for that.
22851         (GMP_ASM_TYPE): Amend some comments.
22853         * tune/freq.c (speed_cpu_frequency_sysctl): Avoid having unused
22854         variables on GNU/Linux.
22856         * mpn/asm-defs.m4 (m4_instruction_wrapper): Fix a quoting problem if
22857         the name of the file is a macro.
22859 2001-04-15  Kevin Ryde  <kevin@swox.se>
22861         * mpn/powerpc64/*.asm: Add speeds on ppc630.
22863         * acconfig.h: Add dummy templates for _LONG_LONG_LIMB and HAVE_MPFR.
22864         * configure.in: Ensure config.in is the last AM_CONFIG_HEADER,
22865         which autoheader requires.
22867         * mpn/x86/pentium/popcount.asm: New file.
22868         * mpn/x86/pentium/hamdist.asm: New file.
22870         * mpn/asm-defs.m4: (m4_popcount): New macro.
22871         Amend a few comments elsewhere.
22873         * acinclude.m4 (GMP_ASM_RODATA): If possible, grep compiler output for
22874         the right directive.
22876         * tune/speed.c: Print clock speed in MHz, not cycle time.
22878         * configure.in (AC_CHECK_HEADERS): Check for sys/processor.h.
22879         * tune/freq.c (speed_cpu_frequency_processor_info): Require
22880         <sys/processor.h> to exist, to differentiate the different
22881         processor_info on Darwin.
22882         (speed_cpu_frequency_sysctlbyname): Remove hw.model test which is in
22883         speed_cpu_frequency_sysctl.
22884         (speed_cpu_frequency_sysctl): Add hw.cpufrequency for Darwin.
22886         * gmp-impl.h (MPN_LOGOPS_N_INLINE, mpn_and_n ... mpn_xnor_n): Use a
22887         single expression argument for the different operations, necessary for
22888         the Darwin "smart" preprocessor.
22890         * mpn/m68k/t-m68k-defs.pl: Allow white space in m4_definsn and
22891         m4_defbranch.
22893         * tune/many.pl: Change RM_TMP_S to RM_TMP to match mpn/Makeasm.am,
22894         avoid a possibly undefined array in a diagnostic, add more renaming to
22895         hamdist.
22897 2001-04-13  Kevin Ryde  <kevin@swox.se>
22899         * ltmain.sh, aclocal.m4, configure, config.in: Update to libtool 1.3d.
22900         * configure.in: Change ac_ to lt_ in lt_cv_archive_cmds_need_lc and
22901         lt_cv_proc_cc_pic.
22903         * config.guess (m68*-*-*): Detect exact cpu with BSD sysctl hw.model,
22904         detect 68000/68010 with trapf, detect 68302 with bfffo.
22906 2001-04-11  Kevin Ryde  <kevin@swox.se>
22908         * acinclude.m4 (GMP_ASM_M68K_INSTRUCTION, GMP_ASM_M68K_ADDRESSING,
22909         GMP_ASM_M68K_BRANCHES): New macros.
22910         * configure.in: Use them, remove old 68k configs, use mc68020 udiv and
22911         umul.
22913         * mpn/m68k/m68k-defs.m4: New file.
22914         * mpn/m68k/t-m68k-defs.pl: New file.
22915         * mpn/m68k/*.asm: New files, converted from .S.  Merge add_n and sub_n
22916         to aors_n, ditto mc68020 addmul_1 and submul_1 to aorsmul_1.  No
22917         object code changes (except .type and .size now used on NetBSD 1.4).
22918         * mpn/m68k/README: New file.
22919         * mpn/m68k/*.S, */*.S, syntax.h: Remove files.
22921         * configure.in (m68*-*-netbsd1.4*): Pretend getrusage doesn't exist.
22922         * tune/README: Update.
22924         * configure.in (powerpc*-*-*): For the benefit of Darwin 1.3, add cc
22925         to cclist, make gcc_cflags -Wa,-mppc optional.
22927 2001-04-06  Kevin Ryde  <kevin@swox.se>
22929         * mpn/lisp/gmpasm-mode.el (gmpasm-comment-start-regexp): Add | for 68k.
22930         (gmpasm-mode-syntax-table): Add to comments.
22932         * tests/mpz/reuse.c (dsi_div_func_names): Add names for cdiv_[qr]_2exp.
22934 2001-04-04  Kevin Ryde  <kevin@swox.se>
22936         * acinclude.m4 (GMP_M4_M4WRAP_SPURIOUS): Fix test so as to actually
22937         detect the problem, add notes on m68k netbsd 1.4.1.
22939         * gmp.texi (Compatibility with older versions): Note libmp
22940         compatibility.
22942 2001-04-03  Kevin Ryde  <kevin@swox.se>
22944         * tests/mpz/reuse.c: Add mpz_cdiv_q_2exp and mpz_cdiv_r_2exp.
22946         * tests/mpz/t-pow.c: Drag in refmpn.o when testing mpz_pow_ui etc with
22947         refmpn_mul_2.
22949         * tune/speed.c,speed.h,common.c,many.pl: Add measuring of mpn_com_n
22950         and mpn_mul_2.
22951         * tests/devel/try.c: Add testing of mpn_mul_2, and a
22952         DATA_MULTIPLE_DIVISOR attribute.
22954         * gmp.texi (Build Options): List more m68k's.
22955         (Build Options): Add cross reference to tex2html.
22956         (Notes for Particular Systems): Add m68k means 68020 or up.
22957         (Rational Conversions): New section, with mpq_get_d, mpq_set_d and
22958         mpq_set_f from Miscellaneous, and new mpq_set_str.
22959         (Applying Integer Functions): Move mpq_get_num, mpq_get_den,
22960         mpq_set_num and mpq_set_den from Misc.
22961         (Miscellaneous Rational Functions): Remove section.
22962         (Custom Allocation): Partial rewrite for various clarifications.
22963         (References): Improve line breaks near URLs.
22965         * acinclude.m4 (GMP_GCC_M68K_OPTIMIZE): New macro.
22966         * configure.in (m68*-*-*): Use it to run gcc 2.95.x at -O not -O2.
22967         (m680?0-*-*, m683?2-*-*, m68360-*-*): Add optional gcc -m options.
22969         * tests/mpz/t-cmp.c: New file.
22970         * tests/mpz/t-sizeinbase.c: New file.
22971         * tests/mpz/Makefile.am: Add them.
22973         * gmp-impl.h (MPN_CMP): New macro.
22974         * mpz/cmp.c,cmpabs.c: Use it, and minor cleanups too.
22976         * tests/mpq/t-equal.c: New file.
22977         * tests/mpq/t-get_str.c: New file.
22978         * tests/mpq/Makefile.am: Add them.
22980         * mpq/get_str.c: New file.
22981         * Makefile.am, mpq/Makefile.am: Add it.
22982         * gmp-h.in (mpq_get_str): Add prototype.
22984         * mpq/equal.c: Rewrite using inline compare loops.
22986         * tests/refmpn.c,tests.h (refmpn_mul_2): Fix parameter order.
22987         * mpz/n_pow_ui.c: Fix mpn_mul_2 calls parameter order.
22989 2001-03-29  Kevin Ryde  <kevin@swox.se>
22991         * tests/mpf/t-trunc.c: New file.
22992         * tests/mpf/Makefile.am (check_PROGRAMS): Add it.
22993         * gmp-impl.h (MPF_CHECK_FORMAT): New macro.
22995         * mpf/trunc.c: New file, rewrite of integer.c, preserve prec+1 in
22996         copy, don't copy if unnecessary.
22997         * mpf/ceilfloor.c: New file likewise, and use common subroutine for
22998         ceil and floor.
22999         * mpf/integer.c: Remove file.
23000         * Makefile.am, mpf/Makefile.am, macos/Makefile.in: Update.
23002         * acinclude.m4 (GMP_GCC_VERSION_GE): New macro.
23003         (GMP_GCC_MARCH_PENTIUMPRO): Use it, remove CCBASE parameter (don't
23004         bother checking it's gcc).
23005         (GMP_GCC_ARM_UMODSI): New macro.
23006         * configure.in (GMP_GCC_MARCH_PENTIUMPRO): Update parameters.
23007         (arm*-*-*): Use GMP_GCC_ARM_UMODSI.
23008         * gmp.texi (Notes for Particular Systems): Add arm gcc requirements.
23010 2001-03-28  Kevin Ryde  <kevin@swox.se>
23012         * gmp.texi (Converting Integers): Document mpz_getlimbn using absolute
23013         value and giving zero for N out of range, move to end of section.
23015         * tests/refmpn.c (refmpn_tdiv_qr): Use refmpn_divmod_1 rather than
23016         refmpn_divrem_1.
23017         * tests/tests.h: Add some prototypes that were missing.
23019         * mpz/tdiv_q_ui.c: Remove a comment that belonged to mpz_tdiv_r_ui.
23021 2001-03-26  Torbjorn Granlund  <tege@swox.com>
23023         * mpn/generic/gcdext.c: Handle carry overflow after m*n multiply code
23024         in both arms.  Partially combine multiply arms.
23026 2001-03-24  Kevin Ryde  <kevin@swox.se>
23028         * longlong.h: Add comments to P5 count_leading_zeros.
23030         * demos/expr/exprz.c,t-expr.c,README: Add congruent_p and divisible_p.
23032 2001-03-23  Kevin Ryde  <kevin@swox.se>
23034         * gmp.texi (GMPceil, GMPfloor, ge, le): New macros.
23035         (Integer Division, mpn_cmp, mpn_sqrtrem, Algorithms): Use them.
23036         (mpn_bdivmod): Refer to mp_bits_per_limb, not BITS_PER_MP_LIMB, and
23037         improve formatting a bit.
23038         (mpn_lshift, mpn_rshift): Clarify the return values, and use {rp,n}
23039         for the destination.
23040         Miscellaneous minor rewordings in a few places.
23042         * mpn/arm/arm-defs.m4: New file.
23043         * configure.in (arm*-*-*): Use it.
23044         * mpn/arm/*.asm: Use changecom and registers from arm-defs.m4, use L()
23045         for local labels.
23047         * mpn/x86/k6/mmx/com_n.asm: Relax code alignment (same speed).
23049         * gmp-h.in (__GMP_ATTRIBUTE_PURE): Use __pure__ to avoid application
23050         namespace.
23052         * gmp-impl.h (ABS): Add parens around argument.
23054 2001-03-20  Kevin Ryde  <kevin@swox.se>
23056         * acinclude.m4 (GMP_PROG_M4): Use AC_ARG_VAR on $M4.
23058         * acinclude.m4 (GMP_M4_M4WRAP_SPURIOUS): New macro.
23059         * configure.in: Use it.
23060         * mpn/asm-defs.m4: Ditto.
23062 2001-03-18  Kevin Ryde  <kevin@swox.se>
23064         * mpn/x86/pentium/logops_n.asm: New file.
23066         * mpn/x86/k6/k62mmx/copyd.asm: Rewrite, smaller and simpler, faster on
23067         small sizes, slower on big sizes (about half the time).
23068         * mpn/x86/k6/k62mmx/copyi.asm: Remove file, in favour of generic x86.
23069         * mpn/x86/copyi.asm: Add some comments.
23070         * mpn/x86/k6/README: Update.
23072         * mpn/x86/k6/gcd_1.asm: New file.
23074         * gmp-impl.h (NEG_MOD): Fix type of __dnorm.
23076         * acinclude.m4 (GMP_C_SIZES): Fix use of __GMP_WITHIN_CONFIGURE.
23078 2001-03-15  Kevin Ryde  <kevin@swox.se>
23080         * gmp.texi (GMPabs): New macro.
23081         (Float Comparison - mpf_reldiff): Use it.
23082         (Integer Comparisons - mpz_cmpabs): Ditto, puts "abs" in info.
23083         (Reentrancy): Update notes on old random functions.
23084         (Karatsuba Multiplication): Better characterize the effect of basecase
23085         speedups on the thresholds, pointed out by Torbjorn.
23087         * tune/README: Notes on the 1x1 div threshold for mpn_gcd_1.
23089         * tests/misc.c (mpz_pow2abs_p, mpz_flipbit, mpz_errandomb,
23090         mpz_errandomb_nonzero, mpz_negrandom): New functions.
23091         (mpz_erandomb, mpz_erandomb_nonzero): Use urandom().
23092         * tests/spinner.c (spinner_wanted, spinner_tick): Make global.
23093         * tests/tests.h: Update prototypes.
23095         * tests/mpz/t-cong.c, tests/mpz/t-cong_2exp.c: New files.
23096         * tests/mpz/Makefile.am (check_PROGRAMS): Add them.
23098         * mpz/cong.c, mpz/cong_2exp.c, mpz/cong_ui.c: New files.
23099         * Makefile.am, mpz/Makefile.am: Add them.
23100         * gmp-impl.h (NEG_MOD): New macro.
23101         * gmp-h.in (mpz_congruent_p, mpz_congruent_2exp_p,
23102         mpz_congruent_ui_p): Add prototypes.
23103         * gmp.texi (Integer Division, Efficiency): Add documentation.
23105         * mpq/aors.c: No need for ABS on denominator sizes.
23107         * gmp-impl.h (mpn_divisible_p): Use __MPN.
23109         * gmp-impl.h (LOW_ZEROS_MASK): New macro.
23110         * mpz/divis_ui.c, mpn/generic/divis.c: Use it.
23112         * mpz/setbit.c: Fix normalization for case of a negative ending up
23113         with a zero high limb.
23114         * tests/mpz/bit.c (check_single): New test for this problem.
23116         * configure.in (none-*-*): Fix cclist for default ABI=long.
23118 2001-03-10  Kevin Ryde  <kevin@swox.se>
23120         * mpz/cfdiv_q_2exp.c: Don't scan for non-zero limbs if they don't
23121         matter to the rounding.
23123         * mpz/get_ui.c: Fetch _mp_d[0] unconditionally, so the code can come
23124         out branch-free.
23126 2001-03-08  Kevin Ryde  <kevin@swox.se>
23128         * tests/devel/try.c (param_init): Fix reference functions for and_n
23129         and nand_n.
23131         * tune/speed.c, tests/devel/try.c: Seed RANDS, not srandom etc.
23132         * configure.in (AC_CHECK_FUNCS): Remove srand48 and srandom.
23133         * macos/configure (coptions): Remove random/srandom, now unnecessary.
23135         * configure.in (gmp.h, mp.h, demos/expr/expr-impl.h): Generate using
23136         AM_CONFIG_HEADER.
23137         (_LONG_LONG_LIMB, HAVE_MPFR): Change to AC_DEFINEs.
23138         * gmp-h.in, mp-h.in, demos/expr/expr-impl-h.in: Change to #undef's.
23139         * acinclude.m4 (GMP_FUNC_ALLOCA, GMP_C_SIZES): Use gmp-h.in, not gmp.h.
23140         * Makefile.am (EXTRA_DIST): Remove gmp-h.in and mp-h.in, now done
23141         automatically.
23142         * acinclude.m4 (GMP_FUNC_ALLOCA), gmp-impl.h: Set and use
23143         __GMP_WITHIN_CONFIGURE rather than GMP_FUNC_ALLOCA_TEST.
23145         * mpf/random2.c: Use _gmp_rand and RANDS instead of random() for the
23146         exponent, ensures full range of values too.
23148         * tests/mpz/t-div_2exp.c (check_various): Start with d based on i, but
23149         don't let it go negative.
23151         * tune/tuneup.c (KARATSUBA_MUL_THRESHOLD): Limit probing to
23152         TOOM3_MUL_THRESHOLD_LIMIT, the size of the workspace in mul_n.c.
23153         Use a -1 with this too, so size<LIMIT not <=.
23155 2001-03-07  Torbjorn Granlund  <tege@swox.com>
23157         * mpn/cray/cfp/mul_1.c: Don't call mpn_add_n with size 0.
23158         * mpn/cray/cfp/addmul_1.c: Likewise.
23159         * mpn/cray/cfp/submul_1.c: Don't call mpn_sub_n with size 0.
23161         * tests/mpz/t-div_2exp.c (check_various): Start 2nd d loop from 0
23162         (avoid problems with Cray compilers).
23164 2001-03-06  Torbjorn Granlund  <tege@swox.com>
23166         * mpn/cray/ieee/submul_1.c: Don't call mpn_sub_n with size 0.
23168         * mpn/cray/ieee/mul_basecase.c: New file.
23169         * mpn/cray/ieee/sqr_basecase.c: New file, derived from mul_basecase.c.
23171 2001-03-06  Kevin Ryde  <kevin@swox.se>
23173         * tests/devel/try.c (pointer_setup): Allow dst_size == SIZE_SIZE2 for
23174         the benefit of mpn_tdiv_qr.
23176         * tune/tuneup.c (all): Start karatsuba probing at size==4, for the
23177         benefit of cray t90 ieee which has speed oddities at size==2.
23179         * gmp-impl.h (USE_LEADING_REGPARM): Use __GMP_GNUC_PREREQ.
23180         Use __GMP_ATTRIBUTE_PURE and ATTRIBUTE_CONST in a few places.
23182         * gmp-h.in (__GMP_GNUC_PREREQ) New macro.
23183         (__GMP_ATTRIBUTE_PURE): New macro, use it in many places.
23185         * gmp-impl.h, gmp-h.in (mpn_jacobi_base): Move prototype to
23186         gmp-impl.h, use ATTRIBUTE_CONST.
23188         * tune/speed.h (speed_cyclecounter): Inline asm version for i386.
23190         * mpz/cfdiv_r_2exp.c (cfdiv_r_2exp): Only reread "up" after second
23191         realloc, first is under w!=u.
23193 2001-03-05  Torbjorn Granlund  <tege@swox.com>
23195         * mpn/cray/sub_n.c: Rewrite using `majority' logic.
23197         * mpz/cfdiv_r_2exp.c (cfdiv_r_2exp): Reread `up' after realloc of w.
23199         * mpn/cray/ieee/mul_1.c: Rewrite.  Streamline multiplications;
23200         use `majority' logic.
23201         * mpn/cray/ieee/addmul_1.c: Likewise.
23203         * mpn/cray/add_n.c: Rewrite using `majority' logic.
23205 2001-03-04  Torbjorn Granlund  <tege@swox.com>
23207         * longlong.h (CRAY udiv_qrnnd): No longer conditional on CRAYMPP.
23208         (64-bit hppa add_ssaaaa): New.
23209         (64-bit hppa sub_ddmmss): New.
23211         * mpn/cray/ieee/invert_limb.c: New file.
23213         * gmp-impl.h (RANDS): Add a `,0' to make it compile on more compilers.
23215 2001-03-03  Kevin Ryde  <kevin@swox.se>
23217         * mpz/n_pow_ui.c (ULONG_PARITY): Move to gmp-impl.h.
23218         * gmp-impl.h (ULONG_PARITY): i386 part from n_pow_ui.c, new generic
23219         form by Torbjorn.
23221         * tests/mpz/t-div_2exp.c: New file, rewrite of t-2exp.c.
23222         * tests/mpz/t-2exp.c: Remove file.
23223         * tests/mpz/Makefile.am (check_PROGRAMS): Update.
23225         * gmp-h.in (mpz_cdiv_q_2exp, mpz_cdiv_q_2exp): Add prototypes.
23226         * gmp.texi (Integer Division): Add mpz_cdiv_q_2exp and mpz_cdiv_q_2exp.
23228         * mpz/cfdiv_q_2exp.c: New file, partial rewrite of fdiv_q_2exp.c, add
23229         mpz_cdiv_q_2exp entrypoint.
23230         * mpz/cfdiv_r_2exp.c: New file, rewrite of fdiv_r_2exp.c, use all mpn,
23231         add mpz_cdiv_r_2exp entrypoint.
23232         * mpz/fdiv_q_2exp.c, mpz/fdiv_r_2exp.c: Remove files.
23233         * mpz/Makefile.am (libmpz_la_SOURCES): Update.
23234         * Makefile.am (MPZ_OBJECTS): Ditto.
23236         * gmp-impl.h (USE_LEADING_REGPARM): Use __i386__ same as longlong.h
23237         (REGPARM_2_1, REGPARM_3_1, REGPARM_ATTR): New macros.
23238         * mpz/jacobi.c (jac_or_kron): Use them.
23240         * configure.in (HAVE_ABI_$ABI): Re-enable this for config.m4, with
23241         dots changed to underscores (necessary for hppa).
23243         * tests/mpz/t-divis.c, tests/mpz/t-divis_2exp.c: New files.
23244         * tests/mpz/Makefile.am (check_PROGRAMS): Add them.
23246         * gmp-h.in (mpz_divisible_p, mpz_divisible_ui_p,
23247         mpz_divisible_2exp_p): Add prototypes.
23248         * gmp.texi (Integer Division): Add mpz_divisible_p.
23249         (Efficiency): Add remarks about divisibility testing.
23251         * mpz/divis.c, mpz/divis_ui.c, mpz/divis_2exp.c: New files.
23252         * mpz/Makefile.am (libmpz_la_SOURCES): Add them.
23253         * Makefile.am (MPZ_OBJECTS): Ditto.
23255         * mpn/generic/divis.c: New file.
23256         * configure.in (gmp_mpn_functions): Add it.
23257         * mpn/Makefile.am (nodist_libdummy_la_SOURCES): Ditto.
23258         * gmp-impl.h (mpn_divisible_p): Add prototype.
23260         * urandom.h: Remove file.
23261         * Makefile.am (EXTRA_DIST): Remove it.
23263         * tests/mpz/convert.c, dive.c, io.c, logic.c, reuse.c, t-2exp.c,
23264         t-fdiv.c, t-fdiv_ui.c, t-gcd.c, t-jac.c, t-mul.c, t-pow.c,
23265         t-powm.c, t-powm_ui.c, t-root.c, t-sqrtrem.c, t-tdiv.c,
23266         t-tdiv_ui.c: Use RANDS, initialized by tests_rand_start.
23268         * tests/mpz/t-pow.c: New file, being t-pow_ui renamed and with some
23269         further tests added.
23270         * tests/mpz/t-pow_ui.c: Remove file.
23271         * tests/mpz/Makefile.am (check_PROGRAMS): Update.
23273         * tests/t-modlinv.c: Don't use urandom.h.
23274         * tests/mpz/bit.c, tests/mpz/t-scan.c: Ditto.
23275         * tests/mpq/t-cmp.c, tests/mpq/t-cmp_ui.c, tests/mpq/t-get_d.c: Ditto.
23276         * tests/mpf/reuse.c, t-add.c, t-conv.c, t-dm2exp.c, t-muldiv.c,
23277         t-sqrt.c, t-sub.c: Ditto.
23279         * tests/misc.c (tests_rand_start, tests_rand_end): New functions.
23280         (tests_start, tests_end): Use them.
23281         (urandom): New function.
23282         * tests/tests.h: Add prototypes.
23284         * mpz/random.c: Rewrite using mpz_urandomb and RANDS.
23285         * mpn/generic/random.c: Rewrite using _gmp_rand and RANDS.
23286         * mpn/generic/random2.c: Use RANDS not random() etc.
23288         * gmp-impl.h (__gmp_rands, __gmp_rands_initialized): Add externs.
23289         (gmp_randstate_ptr): New typedef.
23290         (RANDS, RANDS_CLEAR): New macros.
23292         * rands.c: New file.
23293         * Makefile.am (libgmp_la_SOURCES): Add it.
23295         * configure.in (mpn_objs_in_libmp): New AC_SUBST.
23296         * Makefile.am (libmp_la_DEPENDENCIES): Use it.
23298 2001-03-02  Torbjorn Granlund  <tege@swox.com>
23300         * mpn/pa64/udiv_qrnnd.asm: New file.
23302 2001-03-01  Kevin Ryde  <kevin@swox.se>
23304         * mpbsd/rpow.c: New file.
23305         * mpbsd/Makefile.am (libmpbsd_la_SOURCES): Add it
23306         (nodist_libmpbsd_la_SOURCES): Remove pow_ui.c.
23307         * Makefile.am (MPBSD_OBJECTS): Add rpow.lo, remove pow_ui.lo.
23308         (libmp_la_DEPENDENCIES): Add mpz/n_pow_ui.lo.
23310         * mpz/ui_pow_ui.c: Rewrite using mpz_n_pow_ui.
23311         * mpz/pow_ui.c: Ditto, and no longer provide rpow for mpbsd.
23313         * mpz/n_pow_ui.c: New file, rewrite of pow_ui.c and ui_pow_ui.c.  Use
23314         less temporary memory, strip factors of 2 from the base, use mpn_mul_2
23315         if available.
23316         * mpz/si_pow_ui.c: New file.
23317         * mpz/Makefile.am (libmpz_la_SOURCES): Add them.
23318         * Makefile.am (MPZ_OBJECTS): Ditto.
23319         * gmp-impl.h (mpz_n_pow_ui): Add prototype.
23320         * gmp-h.in (mpz_si_pow_ui): Add prototype.
23321         * gmp.texi (Integer Exponentiation): Add mpz_si_pow_ui.
23323         * acinclude.m4 (GMP_C_SIZES): Add BITS_PER_ULONG.
23324         Correction to mp_limb_t working check.
23325         * configure.in (limb_chosen): New variable.
23326         * tests/t-constants.c (BITS_PER_ULONG): Check this value.
23327         Add some reminders about tests that fail on Cray.
23329         * tests/refmpn.c (refmpn_mul_2): New function.
23330         * tests/refmpz.c (refmpz_pow_ui): Copied from tests/mpz/t-pow_ui.c
23331         * tests/tests.h: Add prototypes.
23333         * configure.in (none-*-*): Add ABI=longlong.
23334         * doc/configuration (Long long limb testing): Describe it.
23336         * gmp.texi (Low-level Functions): Move some commented out remarks ...
23337         * mpn/generic/mul_basecase.c: ... to here.
23339         * mpn/x86/README: Note "%=" as an alternative to "1:" in __asm__.
23341         * tests/trace.c (mp_trace_start): Print "bin" for binary.
23343         * mpn/generic/dump.c: Add a couple of casts to keep gcc quiet.
23345         * gmp-h.in (mpn_incr_u, mpn_decr_u): Add parens around arguments.
23347         * mpbsd/mout.c, mpbsd/mtox.c (num_to_text): Remove unused variable.
23349         * mpfr/set_d.c (mpfr_get_d2): Declare "q" for 64-bit limbs.
23351 2001-02-28  Torbjorn Granlund  <tege@swox.com>
23353         * mpn/pa64w/udiv_qrnnd.asm: Tune.
23355 2001-02-27  Torbjorn Granlund  <tege@swox.com>
23357         * mpn/pa64w/udiv_qrnnd.asm: New file.
23359 2001-02-26  Torbjorn Granlund  <tege@swox.com>
23361         * longlong.h (arm): Optimize sub_ddmmss by testing for constant
23362         operands.
23363         * mpn/arm/invert_limb.asm: New file.
23365 2001-02-24  Torbjorn Granlund  <tege@swox.com>
23367         * mpn/generic/lshift.c: Rewrite.
23368         * mpn/generic/rshift.c: Rewrite.
23370         * longlong.h: Use UWtype for external interfaces that expect mp_limb_t.
23372         * longlong.h (arm): #define invert_limb.
23374         * mpn/arm: Make labels have local scope.
23376         * configure.in (arm*-*-*): Set extra_functions.
23377         * longlong.h (arm): #define udiv_qrnnd.
23378         * mpn/arm/udiv.asm: New file.
23380 2001-02-24  Kevin Ryde  <kevin@swox.se>
23382         * tune/many.pl: Add mpn_count_leading_zeros, mpn_count_trailing_zeros
23383         and mpn_invert_limb.  Add count_leading_zeros, count_trailing_zeros
23384         from a .h file.  Correction to modexact_1_odd prototype.  Support
23385         ansi2knr.
23386         * tune/speed.h, tune/common.c: Consequent changes.
23388         * demos/expr/*: Make a few more functions available in expressions,
23389         create only libexpr.a, misc minor updates.
23391         * mpn/Makeasm.am: Add some comments about suffix ordering.
23393         * tests/refmpn.c (rshift_make, lshift_make): No need to compare
23394         unsigned to zero.
23396         * mpq/mul.c: Detect and optimize squaring.
23398 2001-02-23  Torbjorn Granlund  <tege@swox.com>
23400         * mpn/mips3: Convert files to `.asm'.
23402         * mpn/arm: Convert files to `.asm'.  Misc cleanups.
23403         * mpn/arm/submul_1.asm: New file.
23405 2001-02-21  Kevin Ryde  <kevin@swox.se>
23407         * tune/tuneup.c (all): Only one compiler print should match, no need
23408         for #undef PRINTED_COMPILER.
23410         * mpfr/mpfr.h (mpfr_sgn): Use mpfr_cmp_ui (patch from Paul).
23412         * mpz/fib_ui.c: Update some remarks about alternative algorithms.
23413         * gmp.texi (Fibonacci Numbers Algorithm): Ditto.
23414         (Assigning Floats): Clarify mpf_swap swaps the precisions too.
23415         (Low-level Functions): Try to be clearer about negative cofactors.
23417 2001-02-21  Torbjorn Granlund  <tege@swox.com>
23419         * mpn/sparc64/copyi.asm: Streamline for small operands.
23420         * mpn/sparc64/add_n.asm: Likewise.
23421         * mpn/sparc64/sub_n.asm: Likewise.
23423         * mpn/sparc64/copyd.asm: New file.
23425 2001-02-20  Torbjorn Granlund  <tege@swox.com>
23427         * mpn/sparc64/lshift.asm: Rewrite.
23428         * mpn/sparc64/rshift.asm: Rewrite.
23430 2001-02-19  Torbjorn Granlund  <tege@swox.com>
23432         * mpn/sparc64/add_n.asm: Rewrite using `majority' logic.
23433         * mpn/sparc64/sub_n.asm: Likewise.
23435         * tune/tuneup.c (all): Recognise DECC and MIPSpro compilers.
23437         * mpn/pa64/sqr_diagonal.asm: Use PROLOGUE/EPILOGUE.
23438         * mpn/pa642/sqr_diagonal.asm: Likewise.
23440         * configure.in (HAVE_ABI_$abi): Disable for now.
23442         * mpn/asm-defs.m4 (PROLOGUE): Use LABEL_SUFFIX.
23444         * acinclude.m4 (GMP_ASM_ATTR): New check, for hppa oddities.
23446 2001-02-18  Torbjorn Granlund  <tege@swox.com>
23448         * mpn/hppa/hppa1_1/gmp-mparam.h: New file.
23449         * mpn/hppa/hppa2_0/gmp-mparam.h: New file.
23451         * mpn/pa64/sqr_diagonal.asm: New file.
23452         * mpn/pa64w/sqr_diagonal.asm: New file.
23453         * mpn/hppa/hppa1_1/sqr_diagonal.asm: New file.
23454         * mpn/hppa/hppa2_0/sqr_diagonal.asm: New file.
23456         * mpn/sparc32/v9/add_n.asm: Use `fitod' instead of `fxtod' for dummy
23457         FA-pipeline insns.
23458         * mpn/sparc32/v9/sub_n.asm: Likewise.
23460 2001-02-18  Kevin Ryde  <kevin@swox.se>
23462         * gmp.texi (Known Build Problems): Notes on make, $* and K&R, misc
23463         tweaks elsewhere.
23464         (Low-level Functions): Use {} notation in mpn_sqrtrem.
23465         (Basecase Multiplication): Mention BASECASE_SQR_THRESHOLD.
23467         * mpfr/isnan.c (mpfr_number_p): Infinity is not a number.
23468         * mpfr/out_str.c: Pass strlen+1 for the block size to free.
23469         * mpfr/get_str.c: Correction for realloc to strlen+1.
23471         * acinclude.m4 (GMP_C_SIZES): Generate an error if mp_limb_t doesn't
23472         seem to work for some reason.
23474 2001-02-16  Torbjorn Granlund  <tege@swox.com>
23476         * mpn/sparc32/v9/gmp-mparam.h: Retune.
23478         * mpn/sparc32/v9/add_n.asm: New file.
23479         * mpn/sparc32/v9/sub_n.asm: New file.
23481         * mpn/sparc32/v9/mul_1.asm: Tune function entry.
23482         * mpn/sparc32/v9/addmul_1.asm: Likewise.
23483         * mpn/sparc32/v9/submul_1.asm: Likewise.
23485         * mpn/sparc32/v9/sqr_diagonal.asm: New file.
23487 2001-02-16  Kevin Ryde  <kevin@swox.se>
23489         * configure.in: Fix flags selection when $CC is a compiler known to us.
23491         * demos/expr/exprfr.c (e_mpfr_cos, e_mpfr_sin): mpfr_sin_cos now
23492         allows NULL for one parameter.
23494         * mpfr/*: Update to 20010215.
23495         * mpfr/trunc.c: Use -DOPERATION scheme, and gmp mpn_zero_p.
23496         * mpfr/sqrt.c: Use plain mpn_sqrtrem, not mpn_sqrtrem_new.
23497         * mpfr/sqrtrem.c: Remove file.
23498         * mpfr/Makefile.am (libmpfr_a_SOURCES): Add isnan.c and set_ui.c,
23499         remove sqrtrem.c and srandom.h.
23501         * configfsf.guess: Update to 2001-02-13.
23502         * configfsf.sub: Update to 2001-02-16.
23503         * config.sub (j90, t90): Remove special handing, configfsf.sub now ok.
23505         * Makefile.am (MPF_OBJECTS): Add a couple of missing $U's.
23507         * tune/tuneup.c: Identify compiler used (GCC and Sun C so far).
23509 2001-02-15  Torbjorn Granlund  <tege@swox.com>
23511         * mpn/sparc32/v9/mul_1.asm: Change `ld' to `lduw' and `st' to `stw'.
23512         * mpn/sparc32/v9/addmul_1.asm: Likewise.
23513         * mpn/sparc32/v9/submul_1.asm: Likewise.
23515 2001-02-14  Torbjorn Granlund  <tege@swox.com>
23517         * mpn/mips3/mips.m4: New file.
23518         * configure.in (mips*-*-irix[6789]*): Use mips3/mips.m4.
23520         * mpn/powerpc64/sqr_diagonal.asm: New file.
23522         * mpn/mips3/sqr_diagonal.asm: New file.
23524 2001-02-12  Torbjorn Granlund  <tege@swox.com>
23526         * mpn/powerpc32/sqr_diagonal.asm: New file.
23528         * mpn/generic/sqr_basecase.c: Remove declaration of mpn_sqr_diagonal.
23529         Fix typo in header comment.
23531 2001-02-12  Kevin Ryde  <kevin@swox.se>
23533         * mpn/generic/mul.c, mpn/generic/mul_n.c, gmp-impl.h: Use
23534         mpn_mul_basecase for squaring below new BASECASE_SQR_THRESHOLD.
23535         * tune/tuneup.c gmp-impl.h: Tune BASECASE_SQR_THRESHOLD.
23537         * Makefile.am (libgmp.la, libmp.la): Revert change to build from
23538         mpn/libmpn.la etc, go back to explicitly listed objects.
23540         * configure.in: Recognise sparc64-*-*, not just sparc64-*-linux*.
23542 2001-02-11  Torbjorn Granlund  <tege@swox.com>
23544         * mpn/asm-defs.m4 (sqr_diagonal): New define_mpn.
23546         * mpn/alpha/sqr_diagonal.asm: New file.
23548 2001-02-11  Kevin Ryde  <kevin@swox.se>
23550         * gmp.texi (Low-level Functions): Note mpn_get_str clobbers its input
23551         plus 1 extra limb.
23553         * mpfr/add.c,agm.c,exp2.c,exp3.c,generic.c,log2.c,pi.c,print_raw.c,
23554         set_d.c,sin_cos.c,sqrtrem.c,sub.c: Apply some tweaks for K&R.
23555         * tests/mpz/reuse.c, tests/mpq/t-md_2exp.c, demos/pexpr.c,
23556         demos/expr/t-expr.c: Ditto.
23558         * configure.in (HAVE_ABI_$abi): New define in config.m4.
23560         * gmp-impl.h (mpn_sqr_diagonal): Add prototype and define.
23561         * tune/speed.c,speed.h,common.c,many.pl: Add measuring of
23562         mpn_sqr_diagonal.
23564         * gmp.texi, acinclude.m4: Mention x86 solaris 2.7 has the reg->reg
23565         movq bug the same as 2.6.
23567         * mpfr/Makefile.am (EXTRA_DIST): Add mpfr-test.h and mpf2mpfr.h.
23569         * mpn/x86/README: Merge contents of README.family.
23570         * mpn/x86/README.family: Remove file.
23572         * mpn/Makefile.am (nodist_libdummy_la_SOURCES): Add mode1o, gcd_finda,
23573         invert_limb, sqr_diagonal; remove mod_1_rs; sort alphabetically.
23575 2001-02-10  Torbjorn Granlund  <tege@swox.com>
23577         * configure.in (gmp_mpn_functions_optional): List sqr_diagonal.
23579         * mpn/powerpc32/aix.m4: Use unnamed csects.
23580         * mpn/powerpc64/aix.m4: Likewise.
23582         * acconfig.h: Add #undef of mpn_sqr_diagonal.
23583         Remove lots of spacing.
23585         * configure.in (syntax testing section): Match power* instead of
23586         powerpc*.
23587         * mpn/power: Convert files to `.asm'.
23588         Prefix umul_ppmm and sdiv_qrnnd.
23589         Update some comments.
23591 2001-02-09  Kevin Ryde  <kevin@swox.se>
23593         * acconfig.h: Add HAVE_NATIVE_mpn_modexact_1_odd and
23594         HAVE_NATIVE_mpn_modexact_1c_odd.
23596         * configure.in (CCAS): Don't override a user selection.
23598         * mpq/cmp_ui.c: DIVIDE_BY_ZERO if den2==0.
23600 2001-02-08  Torbjorn Granlund  <tege@swox.com>
23602         * mpn/generic/sqr_basecase.c: Use mpn_sqr_diagonal when appropriate.
23604 2001-02-07  Kevin Ryde  <kevin@swox.se>
23606         * gmp.texi (Low-level Functions): mpn_preinv_mod_1 now undocumented.
23608         * mpn/generic/random2.c (myrandom): Use rand() on mingw.
23610         * mpn/alpha/gmp-mparam.h: Update tuned parameters.
23612 2001-02-05  Torbjorn Granlund  <tege@swox.com>
23614         * mpn/alpha/ev6/gmp-mparam.h: Retune.
23616 2001-02-05  Kevin Ryde  <kevin@swox.se>
23618         * Makefile.am (libgmp, libmp): Construct from mpn/libmpn.la etc rather
23619         than explicitly listed objects.
23621         * urandom.h: Use rand() on mingw.
23623         * mpn/powerpc64/lshift.asm,addsub_n.asm: Use r1 not 1.
23625 2001-02-04  Torbjorn Granlund  <tege@swox.com>
23627         * mpn/ia64/copyi.asm: New file.
23628         * mpn/ia64/copyd.asm: New file.
23630 2001-02-04  Kevin Ryde  <kevin@swox.se>
23632         * mpn/alpha/ev5/gmp-mparam.h, mpn/mips3/gmp-mparam.h,
23633         mpn/powerpc32/gmp-mparam.h, mpn/powerpc64/gmp-mparam.h,
23634         mpn/sparc64/gmp-mparam.h, mpn/x86/*/gmp-mparam.h:
23635         Update tuned parameters.
23637         * mpn/x86/i486: New directory.
23638         * configure.in (i486-*-*): Use it.
23639         * mpn/x86/i486/gmp-mparam.h: New file.
23641         * mpn/x86/pentium/mode1o.asm: New file.
23642         * mpn/x86/p6/mode1o.asm: New file.
23644         * tune/many.pl: Use $(ASMFLAGS_PIC) and $(CFLAGS_PIC).
23646         * gmp.texi (Integer Division): Another rewording of 2exp divisions.
23648 2001-02-03  Torbjorn Granlund  <tege@swox.com>
23650         * mpn/arm/gmp-mparam.h: Tune.
23652         * mpn/ia64/popcount.asm: Put a `;;' break at end of main loop.
23654         * configure.in (arm*-*-*): Set gcc_cflags in order to pass
23655         $fomit_frame_pointer.
23657         * tests/mpz/t-mul.c (base_mul): Remove an unused variable.
23659 2001-02-02  Torbjorn Granlund  <tege@swox.com>
23661         * demos/pexpr.c (TIME): New macro.
23662         (main): Use TIME--print timing more accurately.
23663         (setup_error_handler): Increase RLIMIT_DATA to 16 Mibyte.
23665         * longlong.h (arm): Add __CLOBBER_CC to add_ssaaaa and sub_ddmmss.
23667 2001-02-02  Kevin Ryde  <kevin@swox.se>
23669         * configure.in: Don't remove gmp-mparam.h and mpn source links under
23670         --no-create since in that case they're not re-created.
23672         * demos/expr: New directory.
23673         * Makefile.am (SUBDIRS, allprogs): Add it.
23674         * demos/expr/README, Makefile.am, expr.c, exprv.c, exprz.c, exprza.c,
23675         exprq.c, exprqa.c, exprfa.c, exprf.c, exprfr.c, exprfra.c, expr.h,
23676         expr-impl-h.in, run-expr.c, t-expr.c: New files.
23677         * configure.in: Generate demos/expr/Makefile & demos/expr/expr-impl.h.
23679         * Makefile.am: Remove mpfr from main libgmp.
23680         * mpfr/Makefile.am: Build and install separate libmpfr.a.
23681         * mpfr/*: Update to mpfr 2001.
23683         * gmp-h.in (__GNU_MP_VERSION_MINOR): Bump to 2.
23684         * Makefile.am (libtool -version-info): Bump appropriately.
23685         * NEWS: Updates.
23687         * tune/divrem1div.c, tune/divrem1inv.c, tune/divrem2div.c,
23688         tune/divrem2inv.c: Renamed from divrem_1_div.c, divrem_1_inv.c,
23689         divrem_2_div.c, divrem_2_inv.c, to be unique in DOS 8.3 filenames.
23690         * tune/Makefile.am (libspeed_la_SOURCES): Update.
23692         * mpn/x86/*/README, mpn/x86/README.family: Misc updates.
23693         * tune/README: Misc updates.
23694         * doc/configuration: Misc updates.
23696         * mpn/x86/pentium/mmx/gmp-mparam.h: Change UDIV_PREINV_TIME to
23697         UDIV_NORM_PREINV_TIME.
23699         * mpz/pprime_p.c: Use ASSERT_ALWAYS instead of abort.
23701         * rand.c (__gmp_rand_lc_scheme): Add "const".
23702         (struct __gmp_rand_lc_scheme_struct): Make astr "const char *".
23704         * demos/calc/calc.y, demos/calc/calclex.l: Add kron function.
23706         * tests/devel/try.c: Partial rewrite, new scheme of function types,
23707         allow result validation functions, add sqrtrem and jacobi testing.
23708         * tune/many.pl: Corresponding updates.
23709         * tests/devel/Makefile.am: Add a convenience rule for libtests.la.
23711         * tests/refmpz.c: New file.
23712         * tests/Makefile.am: Add it.
23713         * tests/misc.c (mpz_erandomb, mpz_erandomb_nonzero): New functions.
23714         * tests/tests.h: Add prototypes.
23716         * mpn/x86/k6/cross.pl: Add a couple more exceptions.
23718         * gmp.texi: Don't use @nicode{'\0'}, it doesn't come out right in tex.
23719         (Introduction to GMP): Mention Cray vector systems.
23720         (Build Options): Describe --enable-mpfr, refer to its manual.  Add
23721         Crays under supported CPUs.
23722         (Debugging): Add notes on source file paths.
23723         (Autoconf): New section.
23724         (Assigning Integers): Note truncation by mpz_set_d, mpz_set_q and
23725         mpz_set_f.
23726         (Converting Integers): Note the size mpz_get_str allocates.
23727         (Floating-point Functions): Rewrite introduction, clarifying some
23728         points about precision handling.
23729         (Converting Floats): Note the size mpf_get_str allocates, and that it
23730         gives an empty string for zero.  Add mpf_get_si and mpf_get_ui.
23731         (Float Comparison): Give the formula mpf_reldiff calculates.
23732         (Miscellaneous Float Functions): Add mpf_integer_p and mpf_fits_*_p.
23733         (Random Number Functions): Misc rewordings for clarity.
23734         (Random State Initialization): Ditto.
23735         (Custom Allocation): Remove note on deallocate_function called with 0,
23736         misc rewording and clarifications.
23737         (Exact Remainder): New section.
23738         (Binary GCD): A few words on initial reduction using division.
23739         (Accelerated GCD): Refer to exact remainder section.
23740         (Extended GCD): Extra remarks on single versus double selection.
23741         (Jacobi Symbol): Update for mpz/jacobi.c rewrite and modexact_1_odd.
23742         (Modular Powering Algorithm): Refer to exact remainder section.
23743         (Assembler SIMD Instructions): Update remarks on MMX.
23744         (Contributors): Amend to "Divide and Conquer" division.
23745         (References): Tweak some formatting.  Add "Proof of GMP Fast Division
23746         and Square Root Implementations" by Paul Zimmermann.
23748 2001-01-31  Torbjorn Granlund  <tege@swox.com>
23750         * configure.in: Don't ever pass -mips3; let ABI flags imply ISA.
23752 2001-01-31  Kevin Ryde  <kevin@swox.se>
23754         * tune/time.c: Remove unnecessary longlong.h.
23755         (speed_endtime): Add some extra diagnostics.
23757         * tests/mpz/t-fdiv_ui.c, tests/mpz/t-tdiv_ui.c: Use unsigned long for
23758         the divisor, not mp_limb_t.
23759         * tests/mpz/t-jac.c (try_base): Use %llu for long long limb.
23760         * tests/trace.c: Add <string.h> for strlen.
23762         * tune/freq.c (speed_cpu_frequency_proc_cpuinfo): Ignore "cycle
23763         frequency" of 0, allow "BogoMIPS" as well as "bogomips".
23765         * macos/Makefile.in: Add mpf/fits_s.c and mpf/fits_u.c objects.
23767 2001-01-30  Torbjorn Granlund  <tege@swox.com>
23769         * longlong.h: Add add_ssaaaa and sub_ddmmss for 64-bit sparc.
23771 2001-01-29  Torbjorn Granlund  <tege@swox.com>
23773         * mpn/powerpc64/addmul_1.asm: Prefix registers with an `r'.
23774         * mpn/powerpc64/submul_1.asm: Likewise.
23775         * mpn/powerpc64/mul_1.asm: Likewise.
23777         * configure.in (alpha*-*-*): Amend last change to handle pca*.
23779 2001-01-29  Kevin Ryde  <kevin@swox.se>
23781         * tune/speed.h (SPEED_ROUTINE_INVERT_LIMB_CALL): Don't let the
23782         compiler optimize everything away.
23784         * tune/speed.c, tune/speed.h, tune/common.c, tune/Makefile.am: Measure
23785         operator_div, operator_mod, mpn_divrem_2_div, mpn_divrem_2_inv,
23786         mpn_sb_divrem_m3, mpn_sb_divrem_m3_div, mpn_sb_divrem_m3_inv,
23787         mpn_dc_divrem_sb_div, mpn_dc_divrem_sb_inv.
23788         * tune/divrem_2_div.c, tune/divrem_2_inv.c, tune/sb_div.c,
23789         tune/sb_inv.c: New files.
23791         * tune/tuneup.c, gmp-impl.h, tune/speed.h, tune/common.c,
23792         tune/Makefile.am: Tune SB_PREINV_THRESHOLD and DIVREM_2_THRESHOLD.
23794         * mpn/generic/divrem_2.c: Use new DIVREM_2_THRESHOLD.
23795         * mpn/generic/sb_divrem_mn.c: Use new SB_PREINV_THRESHOLD.
23797         * mpn/x86/p6/mmx/lshift.asm, mpn/x86/p6/mmx/rshift.asm: New files,
23798         just m4 include()ing the P55 code.
23799         * configure.in (pentium[23]-*-*): Remove x86/pentium/mmx from path.
23801 2001-01-27  Kevin Ryde  <kevin@swox.se>
23803         * configure.in (AC_CHECK_FUNCS): Add srand48.
23804         * tune/speed.c: Use this test.
23806         * acinclude.m4 (GMP_GCC_MARCH_PENTIUMPRO): Allow "egcs-" prefix on gcc
23807         --version, warn if the format is unrecognised.
23808         (GMP_COMPARE_GE): Guard against empty $1 not only on last arg.
23809         (GMP_INIT, GMP_FINISH, GMP_PROG_M4): Obscure or eliminate literal
23810         "dnl"s since autoconf thinks they indicate faulty macros.
23812         * mpz/get_str.c, mpf/get_str.c: Make allocated string block exactly
23813         strlen(str)+1 bytes.
23814         * mpz/dump.c, mpf/dump.c, tests/mpz/convert.c: Use this size when
23815         freeing.
23816         * tests/mpf/t-conv.c: Ditto, and ensure x==0 is exercised.
23818         * tests/mpz/t-fits.c: New file.
23819         * tests/mpz/Makefile.am: Add it.
23821         * tests/mpf/t-fits.c: New file.
23822         * tests/mpf/t-get_si.c: New file.
23823         * tests/mpf/t-int.c: New file.
23824         * tests/mpf/Makefile.am: Add them.
23826         * mpf/fits_s.c: New file.
23827         * mpf/fits_u.c: New file.
23828         * mpf/get_si.c: New file.
23829         * mpf/get_ui.c: New file.
23830         * mpf/int_p.c: New file.
23831         * Makefile.am, mpf/Makefile.am: Add them.
23832         * gmp-h.in (mpf_fits_*_p, mpf_get_si, mpf_get_ui, mpf_integer_p): Add
23833         prototypes.
23835         * tests/memory.c (tests_allocate, tests_reallocate): Guard against
23836         size==0.
23838         * tests/mpz/*.c, tests/mpq/*.c, tests/mpf/*.c: Uses tests_start and
23839         tests_end.
23841         * gmp-impl.h (USE_LEADING_REGPARM): Fix conditionals.
23843 2001-01-23  Kevin Ryde  <kevin@swox.se>
23845         * configure.in, mpn/Makeasm.am (ASMFLAGS_PIC): New substitution,
23846         allowing -DPIC to be suppressed on cygwin.
23847         (CFLAGS_PIC): New substitution, use it and $(CCAS) directly, rather
23848         than $(LIBTOOL), avoiding a problem with FreeBSD 2.2.8.
23850         * mpn/x86/k6/mode1o.asm, mpn/x86/k7/mode1o.asm: Remove an unnecessary
23851         +[.-L(here)] from _GLOBAL_OFFSET_TABLE_, avoids a segv from gas 1.92.3.
23852         * mpn/x86/README.family: Add notes on the problem.
23854 2001-01-20  Torbjorn Granlund  <tege@swox.com>
23856         * configure.in (alpha*-*-*): Default `flavour' to ev4.
23858 2001-01-19  Kevin Ryde  <kevin@swox.se>
23860         * assert.c, gmp-impl.h (__gmp_assert_fail): Change return type to
23861         void, since it's no longer used in expressions.
23863         * mpn/x86/addsub_n.S: Remove file, since it doesn't work and it upsets
23864         tune/many.pl.
23866         * mpz/jacobi.c: Rewrite, but still binary algorithm; accept zero and
23867         negative denominators; merge mpz_jacobi and mpz_legendre, add
23868         mpz_kronecker; use mpn directly, add special cases for size==1.
23869         * gmp.texi (Number Theoretic Functions): Update.
23870         * gmp-h.in (mpz_kronecker): Add prototype.
23871         * gmp-impl.h (USE_LEADING_REGPARM): New macro.
23872         * tests/mpz/t-jac.c: Test mpz_kronecker.
23873         * mpz/legendre.c: Remove file.
23874         * Makefile.am, mpz/Makefile.am: Update.
23876         * longlong.h (alpha count_leading_zeros): Use __attribute__ ((const))
23877         when possible, add parameter to prototype.
23878         (ia64 udiv_qrnnd): Use for all compilers, not just gcc.
23879         (pentium count_trailing_zeros): Use count_leading_zeros.
23881         * acinclude.m4 (GMP_C_ATTRIBUTE_CONST, GMP_C_ATTRIBUTE_NORETURN): New
23882         macros.
23883         * configure.in: Use them.
23884         * gmp-impl.h (ATTRIBUTE_CONST, ATTRIBUTE_NORETURN): New macros.
23885         (mpn_invert_limb): Add ATTRIBUTE_CONST.
23886         (__gmp_assert_fail): Add ATTRIBUTE_NORETURN.
23888 2001-01-18  Kevin Ryde  <kevin@swox.se>
23890         * gmp-h.in, gmp-impl.h (__gmp_allocate_func, __gmp_reallocate_func,
23891         __gmp_free_func): Move prototypes from gmp-impl.h to gmp-h.in, for the
23892         benefit of gmp++.h.
23894         * gmp-impl.h, tests/misc.c, tests/tests.h: Move MPZ_SET_STR_OR_ABORT
23895         and MPF_SET_STR_OR_ABORT to mpz_set_str_or_abort and
23896         mpf_set_str_or_abort in libtests.
23897         * tests/mpz/convert.c, tests/mpz/t-bin.c, tests/mpz/t-get_si.c,
23898         tests/mpz/t-jac.c, tests/mpz/t-misc.c, tests/mpq/t-md_2exp.c,
23899         tests/mpq/t-set_f.c, tests/mpf/t-conv.c, tests/mpf/t-misc.c: Update.
23901         * mpn/generic/sqrtrem.c: Use MPN_COPY_INCR (for when rp==NULL).
23903         * tests/mpz/reuse.c: Only run mpz_divexact_gcd on positive divisors.
23905 2001-01-18  Torbjorn Granlund  <tege@swox.com>
23907         * demos/pexpr.c (main): Accept -vml option.
23908         (fns): List `hamdist', `pow', `nextprime'.
23909         (mpz_eval_expr): Return -1 for `popc' of negative.
23910         (mpz_eval_expr): Handle `hamdist', `pow', `nextprime'.
23912 2001-01-15  Kevin Ryde  <kevin@swox.se>
23914         * mpn/alpha/ev5/mode1o.c: New file.
23916         * tune/freq.c (speed_cpu_frequency_measure): Check cycles_works_p
23917         before running speed_cyclecounter.
23918         * tune/speed.h (cycles_works_p): Add prototype.
23920 2001-01-13  Torbjorn Granlund  <tege@swox.com>
23922         * tests/rand/t-rand.c (farr): Fix typo.
23923         (zarr): Fix typo.
23925 2001-01-12  Kevin Ryde  <kevin@swox.se>
23927         * mpz/kronsz.c: Don't depend on right shifting a negative.
23929         * mpn/x86/gmp-mparam.h: New file.
23931         * mpn/x86/pentium/mmx/mul_1.asm: New file.
23933 2001-01-11  Torbjorn Granlund  <tege@swox.com>
23935         * mpz/kronsz.c: Temporary workaround for Cray right shift oddities.
23936         Explicitly compare against zero in tests.
23938 2001-01-10  Kevin Ryde  <kevin@swox.se>
23940         * mpz/kronzs.c: Don't depend on right shifting a negative.
23942 2001-01-09  Torbjorn Granlund  <tege@swox.com>
23944         * tests/t-constants.c: Disable some undefined tests.
23945         (CHECK_MAX_S): Remove workaround for gcc 2.95.2 bug recently added.
23947 2001-01-09  Kevin Ryde  <kevin@swox.se>
23949         * tests/t-constants.c: Add more diagnostics.
23950         (CHECK_MAX_S): Fix for gcc 2.95.2 -mpowerpc64 -maix64.
23952         * mpn/x86/k6/mode1o.asm: New file.
23953         * mpn/x86/k7/mode1o.asm: New file.
23955         * mpn/asm-defs.m4 (modexact_1_odd, modexact_1c_odd): New define_mpn's.
23956         (__clz_tab, modlimb_invert_table, PROLOGUE, EPILOGUE): Add asserts for
23957         GSYM_PREFIX.
23958         * mpn/x86/x86-defs.m4 (Zdisp): Add a movzbl.
23960         * tests/mpz/t-jac.c (check_a_zero): New test.
23961         (check_squares_zi): Fix to use (a^2/b), not (a*b/b); revert last
23962         change avoiding a,b=0, both are fine.
23963         (try_2den): Don't use mpz_kronecker_ui for the expected answer.
23964         (try_*): Call abort rather than exit.
23966         * mpz/kronzu.c, mpz/kronzs.c: Fix for a=0.
23968         * tune/tuneup.c (USE_PREINV_MOD_1): Fix to use new DATA_HIGH_LT_R.
23970 2001-01-08  Torbjorn Granlund  <tege@swox.com>
23972         * urandom.h: Amend 2000-11-21 change to also handle cygwin.
23974 2001-01-08  Kevin Ryde  <kevin@swox.se>
23976         * tune/many.pl: Updates for move to tests/devel, add modexact_1_odd,
23977         don't assume C files can't have carry-in entrypoints, remove
23978         $(TRY_TESTS_OBJS) now in libtests.
23980         * tests/devel/try.c, tests/refmpn.c, tests/tests.h: Remove
23981         mpn_mod_1_rshift testing.
23983         * tune/tuneup.c (fft_step_size): Test for overflow using the actual
23984         mp_size_t, don't use BITS_PER_INT.
23986         * tune/speed.c (r_string): "r" is a limb, use BITS_PER_MP_LIMB and
23987         change LONG_ONES to LIMB_ONES.
23988         * tune/time.c (M_2POWU): Use INT_MAX rather than BITS_PER_INT.
23990         * extract-dbl.c (BITS_PER_PART): Use BITS_PER_MP_LIMB not
23991         BITS_PER_LONGINT.
23993         * mpz/inp_raw.c, mpz/out_raw.c: Add private defines of BITS_PER_CHAR.
23994         * mpz/fac_ui.c, tests/mpz/t-fac_ui.c: Don't use BITS_PER_LONGINT.
23995         * tests/mpz/t-get_si.c: Don't use BITS_PER_LONGINT, do the LONG_MAX
23996         tests with some explicit code.
23998         * mpn/*/gmp-mparam.h, acinclude.m4, tests/t-constants.c
23999         (BITS_PER_LONGINT, BITS_PER_INT, BITS_PER_SHORTINT, BITS_PER_CHAR):
24000         Remove defines, remove probings, remove tests.
24002         * tune/tuneup.c (MODEXACT_1_ODD_THRESHOLD): Add tuning.
24004         * tune/speed.c,speed.h,common.c: Add measuring of mpn_modexact_1_odd,
24005         mpn_gcd_finda, and an "N" form for mpn_gcd_1.
24007         * tests/mpz/t-jac.c (check_squares_zi): Ensure random a,b != 0.
24009 2001-01-07  Kevin Ryde  <kevin@swox.se>
24011         * configure.in (gmp_mpn_functions): Add mode1o, remove mod_1_rs.
24013         * mpn/generic/mod_1_rs.c: Remove file, no longer needed.
24014         * gmp-h.in (mpn_mod_1_rshift): Remove prototype and define.
24016         * mpq/set_f.c: Use MPN_STRIP_LOW_ZEROS_NOT_ZERO.
24018         * mpz/kronzu.c, mpz/kronzs.c, mpz/kronuz.c, mpz/kronsz.c: Use
24019         mpn_modexact_1_odd, new style MPN_STRIP_LOW_ZEROS_NOT_ZERO, and new
24020         JACOBI macros.  Various rearrangements supporting all this.
24022         * mpn/generic/gcd_1.c: Use mpn_modexact_1_odd, reduce u%v if u much
24023         bigger than v when size==1, some rearrangements supporting this.
24025         * gmp-impl.h (JACOBI_*): More macros, add some casts to "int".
24026         (MPN_STRIP_LOW_ZEROS_NOT_ZERO): Add a "low" parameter.
24027         (mpn_modexact_1_odd, mpn_modexact_1c_odd): Add prototype and defines.
24028         (MODEXACT_1_ODD_THRESHOLD): New threshold.
24029         (MPN_MOD_OR_MODEXACT_1_ODD, JACOBI_MOD_OR_MODEXACT_1_ODD): New macros.
24031         * mpn/generic/mode1o.c: New file.
24033         * tests/mpz/reuse.c: Add testing of mpz_divexact_gcd.
24034         * tests/mpz/t-fac_ui.c: Use libtests for memory leak checking.
24035         * tests/mpz/t-fib_ui.c: Add a usage comment.
24037         * tests/mpz/bit.c: Use libtests.
24038         * tests/mpz/t-scan.c: Remove unused subroutines.
24039         * tests/devel/try.c: Use libtests, define PROT_NONE if the system
24040         doesn't.
24042         * tests/spinner.c, tests/x86check.c: Use tests.h.
24043         * tests/trace.c: Use tests.h, add mpf_trace.
24044         * tests/refmpn.c: Use tests.h, add refmpn_malloc_limbs_aligned,
24045         refmpn_tstbit, refmpn_neg.
24047         * tune/common.c, tune/speed.h: Update for functions moved to
24048         tests/misc.c.
24050         * tune/Makefile.am, tests/mpz/Makefile.am, tests/mpq/Makefile.am,
24051         tests/mpf/Makefile.am: Use tests/libtests.la.
24053         * configure.in (AC_OUTPUT): Update for new directories.
24054         (x86 CALLING_CONVENTIONS_OBJS): Use .lo for libtests.la, allow
24055         ansi2knr on x86check.c.
24057         * tests/Makefile.am: Establish new libtests.la convenience library,
24058         add mpz, mpq, mpf, mpbsd subdirectories.
24059         * tests/tests.h: New file.
24060         * mpn/tests/ref.h,try.h: Remove files, now in tests.h.
24062         * tests/mpf/ref.c: Move to tests/refmpf.c, rename functions to refmpf.
24063         * tests/mpf/t-add.c, tests/mpf/t-sub.c: Use libtests.
24064         * tests/mpf/Makefile.am: Update.
24066         * tests/memory.c: New file.
24067         * tests/misc.c: New file, a few subroutines from the test programs.
24069         * mpz/tests, mpq/tests, mpf/tests, mpbsd/tests: Move directories to
24070         tests/mpz etc.
24071         * mpz/Makefile.am, mpq/Makefile.am, mpf/Makefile.am, mpbsd/Makefile.am
24072         (SUBDIRS): Remove.
24074         * tests/devel: New directory.
24075         * mpn/tests/*.c: Move programs to tests/devel.
24076         * mpn/tests/Makefile.am, mpn/tests/README: Move to tests/devel, update.
24078         * mpn/tests/ref.c: Move to tests/refmpn.c.
24079         * mpn/tests/spinner.c,trace.c,x86call.asm,x86check.c: Move to tests
24080         directory.
24082         * tests/t-constants.c: Add checks of HIGHBIT, MAX and MIN constants,
24083         simplify ANSI vs K&R stringizing, use correct printf format types, do
24084         all tests before aborting.
24086 2001-01-05  Torbjorn Granlund  <tege@swox.com>
24088         * mpn/cray/ieee/gmp-mparam.h: Retune.
24090 2001-01-05  Kevin Ryde  <kevin@swox.se>
24092         * configure.in (mp.h): Only create this under --enable-mpbsd.
24094         * demos/calc: New subdirectory, move demos/calc* to it.
24095         * demos/calc/Makefile.am: New file, split from demos/Makefile.am.
24096         * demos/Makefile.am: Update.
24097         * configure.in (AC_OUTPUT): Add demos/calc/Makefile.
24099         * tests/t-constants.c (CALC_BITS_PER_TYPE etc): Use a run-time test
24100         for how many bits work in a give type, don't assume bits==8*sizeof.
24102 2001-01-04  Kevin Ryde  <kevin@swox.se>
24104         * mpz/fits_s.c, mpz/fits_u.c: New files, split from fits.c, use plain
24105         UINT_MAX etc, not MPZ_FITS_UTYPE_SDT etc.
24106         * mpz/fits.c: Remove file.
24107         * mpz/Makefile.am, macos/Makefile.in: Update.
24109         * gmp-impl.h (UNSIGNED_TYPE_MAX etc): Remove these generic forms.
24110         (MPZ_FITS_[SU]TYPE_SDT): Remove these.
24111         (UINT_MAX etc): Provide a full set of defaults.
24112         * gmp-h.in (__GMP_MP_SIZE_T_INT): New define.
24114         * mpz/tests/t-scan.c: New file.
24115         * mpz/tests/Makefile.am (check_PROGRAMS): Add it.
24117         * mpz/scan0.c, mpz/scan1.c: Rewrite, don't read beyond allocated
24118         memory, support negatives, return ULONG_MAX for no bit found.
24119         * gmp.texi (Integer Logic and Bit Fiddling): Update.
24121 2001-01-03  Torbjorn Granlund  <tege@swox.com>
24123         * mpz/tests/dive.c: Generate test operands using new random functions.
24124         * mpz/tests/io.c: Likewise.
24125         * mpz/tests/logic.c: Likewise.
24126         * mpz/tests/t-2exp.c: Likewise.
24128         * stack-alloc.c (__gmp_tmp_alloc): Round `now' to required alignment.
24130         * stack-alloc.h (__TMP_ALIGN): Append `L'.
24132         * gmp-impl.h: For Cray, #include limits.h.
24133         (LONG_MIN): New #define.
24134         (ULONG_HIGHBIT): #define in terms of ULONG_MAX.
24135         (LONG_HIGHBIT): #define as LONG_MIN.
24136         (USHRT_MAX): New name for USHORT_MAX.
24137         (SHRT_MAX): New name for SHORT_MAX.
24138         (SHRT_MIN): New #define.
24139         (USHORT_HIGHBIT,SHORT_HIGHBIT): Removed.
24141         * mpbsd/tests/t-misc.c (check_itom [data]): *SHORT* => *SHRT*;
24142         remove code disabling a test for Cray.
24144         * tests/t-constants.c (CHECK_CONSTANT): Cast parameters to long.
24146         * mpn/generic/mul_n.c (mpn_kara_sqr_n): Remove unused variable `t'.
24147         (mpn_kara_mul_n): Likewise.
24149         * mpz/fac_ui.c (MPZ_SET_1_NZ): Actually use `__z'.
24151         * mpz/tests/t-jac.c
24152         (main, check_squares_zi): Generate test operands using new random
24153         functions.
24155         All changes below on this date for enabling `make; make check'
24156         with C++ compilers:
24158         * mpz/tests/t-pow_ui.c (debug_mp, ref_mpz_pow_ui): Provide prototypes.
24160         * mpz/tests/t-mul.c (debug_mp, base_mul, ref_mpz_mul):
24161         Provide prototypes.
24162         (dump_abort): Provide prototype and declare properly for C++.
24164         * mpz/tests/t-jac.c: #include stdlib.h and sys/time.h.
24166         * mpz/tests/t-fdiv.c
24167         (dump_abort): Provide prototype and declare properly for C++.
24168         (debug_mp): Provide prototype.
24169         * mpz/tests/t-fdiv_ui.c: Likewise.
24170         * mpz/tests/t-gcd.c: Likewise.
24171         * mpz/tests/t-powm.c: Likewise.
24172         * mpz/tests/t-powm_ui.c: Likewise.
24173         * mpz/tests/t-sqrtrem.c: Likewise.
24174         * mpz/tests/t-tdiv_ui.c: Likewise.
24175         * mpz/tests/t-tdiv.c: Likewise.
24177         * mpz/tests/t-2exp.c: #include stdlib.h and sys/time.h.
24178         Remove #include of longlong.h.
24180         * mpz/tests/io.c: #include config.h, stdlib.h, sys/time.h, and
24181         conditionally unistd.h.
24183         * mpz/tests/dive.c: #include stdlib.h and sys/time.h.
24184         (dump_abort): Provide prototype and declare properly for C++.
24185         (debug_mp): Provide prototype.
24186         * mpz/tests/logic.c: Likewise.
24188         * mpz/tests/convert.c (debug_mp): Provide prototype.
24189         * mpz/tests/t-root.c (debug_mp): Likewise.
24191         * mpz/tests/bit.c: #include stdlib.h and sys/time.h.
24193         * mpq/tests/t-get_d.c: #include stdlib.h and sys/time.h.
24194         (dump): Provide prototype and declare properly for C++.
24196         * mpq/tests/t-cmp_ui.c: #include stdio.h, stdlib.h and sys/time.h.
24197         (ref_mpq_cmp_ui): Declare properly for C++.
24199         * mpq/tests/t-cmp.c: #include stdlib.h and sys/time.h.
24200         (ref_mpq_cmp): Declare properly for C++.
24201         (dump): Delete unused function.
24203         * mpf/random2.c (myrandom): New function.
24204         (mpf_random2): Use it.
24206         * mpn/generic/random2.c: #include stdlib.h (for random/mrand48).
24207         (myrandom): New function.
24208         (mpn_random2): Use it.
24210         * mpf/tests/t-add.c: #include stdlib.h and sys/time.h.
24211         (oo): Remove unused function.
24212         * mpf/tests/t-conv.c: Likewise.
24213         * mpf/tests/t-sub.c: Likewise.
24214         * mpf/tests/t-dm2exp.c: Likewise.
24215         * mpf/tests/t-muldiv.c: Likewise.
24216         * mpf/tests/t-sqrt.c: Likewise.
24218         * mpf/tests/reuse.c: #include stdlib.h and sys/time.h.
24219         Use PROTO on some typedefs.
24220         (oo): Remove function.
24221         (dump_abort): Call mpf_dump instead of oo.
24223         * mpf/set_str.c: #include stdlib.h (for strtol).
24225         * mpf/random2.c: #include stdlib.h (for random/mrand48).
24226         * mpn/alpha/udiv_arnnd: File deleted.
24228         * Remove K&R function headers.
24230 2001-01-02  Torbjorn Granlund  <tege@swox.com>
24232         * mpn/generic/mul.c: Clean up spacing and indentation.
24234         * mpn/generic/mul_fft.c (mpn_fft_add_modF): Use mpn_decr_u.
24235         Clean up spacing and indentation.
24237         * extract-dbl.c: Generalize to handle smaller limb sizes.
24239 2001-01-01  Torbjorn Granlund  <tege@swox.com>
24241         * mpbsd/mout.c: Output newline after "0".
24243 2000-12-31  Torbjorn Granlund  <tege@swox.com>
24245         * ltmain.sh: Remove space between `#!' and `$SHELL' when generating
24246         `libtool'.
24248         * mpbsd/tests/t-misc.c (check_itom): Exclude test for all Cray
24249         vector systems.  Correct comment.
24251 2000-12-31  Kevin Ryde  <kevin@swox.se>
24253         * gmp.texi (ABI and ISA): New enough gcc needed for mips n32 etc, gcc
24254         2.95 needed for sparc 64-bit ABI, gcc 2.8 needed for -mv8plus.
24256         * configure.in ([cjt]90,sv1-cray-unicos*): Preserve user specified
24257         MPN_PATH, amend test program indenting.
24258         (none-*-*): Add -DNO_ASM to gcc to disable longlong.h asm macros in
24259         generic C.
24261         * config.sub (j90, t90): Preserve these, don't let configfsf.sub turn
24262         them into c90.
24264         * config.guess (m68k-*-nextstep*,m68k-*-openstep*): Don't transform
24265         m68k to m68020, since m68k is already interpreted as 68020.
24267 2000-12-30  Kevin Ryde  <kevin@swox.se>
24269         * mpq/neg.c: Rewrite, use mpn, avoid denominator copy if unnecessary.
24271         * mpz/tstbit.c: Rewrite, slightly simplified.
24272         * mpz/tests/bit.c (check_tstbit): New test, and add a couple more
24273         diagnostics elsewhere.
24275         * configure.in (x86 gcc_cflags_cpu): Add -m486 for gcc 2.7.2.
24276         (ccbase): Only use a known compiler in eval statements (avoids
24277         problems with non-symbol characters).
24278         (ccbase): Use GMP_PROG_CC_IS_GNU to identify gcc installed under a
24279         different name.
24280         (cclist): Use same style $abi as other variables.
24282         * acinclude.m4 (GMP_PROG_CC_IS_GNU): New macro.
24283         (GMP_GCC_MARCH_PENTIUMPRO): Use $ccbase to identify gcc.
24284         (GMP_ASM_TYPE): Define TYPE to empty, not "dnl", when no .type needed.
24285         (GMP_ASM_SIZE): Ditto for SIZE, which ensures EPILOGUE on the last
24286         line of a file doesn't leave a tab and no newline.
24287         (GMP_ASM_UNDERSCORE): Add a prototype for C++.
24289         * configure.in (sys/mman.h, mprotect): New tests.
24290         * mpn/tests/try.c: Use them, and HAVE_UNISTD_H too.
24292         * configure.in (getopt.h): Remove test.
24293         * tune/speed.c, mpn/tests/try.c (getopt.h): Remove include, since
24294         plain getopt() is in <unistd.h>.
24296         * configure.in, gmp-h.in (mips*-*-irix6*): Set limb_n32=longlong
24297         rather than using _ABIN32.
24299 2000-12-29  Torbjorn Granlund  <tege@swox.com>
24301         * mpz/tests/reuse.c: Rename dump_abort => dump.
24302         * mpz/tests/reuse.c: Generate operands using gmp_rand*.
24303         * mpz/tests/convert.c: Likewise.
24305         * configure.in: Detect T90-ieee systems; move Cray path
24306         selection to after AC_PROG_CC.  Invoke AC_PROG_CPP.
24307         * mpn/cray/cfp: New directory.  Move cfp specific files here.
24308         * mpn/cray/cfp/mulwwc90.s: New file.
24309         * mpn/cray/cfp/mulwwj90.s: New file.
24310         * mpn/cray/mulww.s: Delete.
24312 2000-12-27  Torbjorn Granlund  <tege@swox.com>
24314         * mpn/cray/ieee/mul_1.c: New file.
24315         * mpn/cray/ieee/addmul_1.c: New file.
24316         * mpn/cray/ieee/submul_1.c: New file.
24317         * mpn/cray/ieee/gmp-mparam.h: New file.
24319         * mpn/cray/gmp-mparam.h: Disable UMUL_TIME and UDIV_TIME.
24321         * mpn/cray/hamdist.c: New file.
24322         * mpn/cray/popcount.c: New file.
24323         * mpn/cray/rshift.c: New file.
24324         * mpn/cray/lshift.c: New file.
24326         * longlong.h: Add count_leading_zeros for _CRAY.
24327         Reorganize _CRAY stuff.
24329 2000-12-24  Kevin Ryde  <kevin@swox.se>
24331         * configure.in (alpha*-cray-unicos*): Disable SPEED_CYCLECOUNTER_OBJ,
24332         as tune/alpha.asm doesn't suit.
24334         * mpn/generic/sqrtrem.c, mpz/pow_ui.c, mpz/powm_ui.c, mpf/get_str.c,
24335         mpf/set_str.c: Use mpn_sqr_n when applicable, not mpn_mul_n.
24337 2000-12-23  Torbjorn Granlund  <tege@swox.com>
24339         * mpn/generic/mul_fft.c: Reformat.
24340         (mpn_fft_neg_modF): Remove.
24341         (mpn_fft_mul_2exp_modF): Inline mpn_fft_neg_modF.
24343         * mpn/cray/gmp-mparam.h: Retune.
24345         * configure.in (*-cray-unicos*): Pass `-O3 -htask0'.
24346         (vax*-*-*): Fix typo.
24348         * mpn/cray/mul_1.c: Use dynamic arrays, get rid of TMP_*.
24349         * mpn/cray/addmul_1.c: Likewise.
24350         * mpn/cray/submul_1.c: Likewise.
24351         * mpn/cray/add_n.c: Likewise.
24352         * mpn/cray/sub_n.c: Likewise.
24354         * configure.in (default cc_cflags,cc_64_cflags): Remove -g/add -O.
24355         (mips*-*-irix[6789]*]): Remove -g from cc_*_cflags.
24357 2000-12-22  Torbjorn Granlund  <tege@swox.com>
24359         * mpn/generic/mul_n.c: Delete K&R function headers.
24361         * mpn/generic/mul_n.c (mpn_kara_mul_n): Clean up type confusion
24362         between mp_limb_t and mp_size_t.
24363         (mpn_kara_sqr_n): Likewise.
24365         * mpn/generic/mul_n.c (mpn_kara_mul_n): Use mpn_incr_u.
24366         (mpn_kara_sqr_n): Likewise.
24368         * mpn/generic/mul_n.c (mpn_kara_mul_n): Change handling of `sign'
24369         to work around GCC 2.8.1 MIPS bug.
24371         * configure.in (implied alpha*-cray-unicos*): Remove -g from cc_cflags.
24373 2000-12-21  Torbjorn Granlund  <tege@swox.com>
24375         * mpn/alpha/invert_limb.asm: Simplify a bit.
24376         Add handling of bigend systems.
24377         * mpn/alpha/unicos.m4: Define `bigend'.
24378         * mpn/alpha/default.m4: Define `bigend' (to expand to nothing).
24380         * tests/t-constants.c (CHECK_CONSTANT): Print using %lx.
24382         * mpn/alpha/gmp-mparam.h: Remove sizes for plain C types.
24383         * mpn/alpha/ev5/gmp-mparam.h: Likewise.
24384         * mpn/alpha/ev6/gmp-mparam.h: Likewise.
24386         * mpn/alpha/unicos.m4: Define LEA.
24387         * mpn/alpha/default.m4: Likewise.
24388         * mpn/alpha/invert_limb.asm: Use LEA for loading symbolic addresses.
24389         * mpn/alpha/cntlz.asm: Likewise.
24391         * mpn/alpha/cntlz.asm: Don't use `ldbu', use slightly slower
24392         `ldq_u' + `extbl' instead.
24394         * mpn/alpha/unicos.m4: Define EXTERN.
24395         * mpn/alpha/default.m4: Define EXTERN (to expand to nothing).
24396         * mpn/alpha/cntlz.asm: Declare __clz_tab usign `EXTERN' (for the
24397         benefit of Unicos).
24399 2000-12-21  Kevin Ryde  <kevin@swox.se>
24401         * mpn/alpha/unicos.m4 (GSYM_PREFIX): Define for the benefit of
24402         __clz_tab.
24404 2000-12-20  Torbjorn Granlund  <tege@swox.com>
24406         * longlong.h: Add udiv_qrnnd and count_leading_zeros for _CRAYMPP
24407         systems.
24409 2000-12-19  Torbjorn Granlund  <tege@swox.com>
24411         * configure.in (*sparc*-*-*): Remove -g from cc_cflags and acc_cflags.
24413         * mpn/generic/sqrtrem.c (mpn_sqrtrem): Separate `limb' values from
24414         `size' values.
24416         * configure.in (*-cray-unicos*): Add `-Wa,-B' to cc_cflags.
24418         * demos/pexpr.c (rstate): New variable.
24419         (main): Initialize rstate.
24420         (enum op_t): Add RANDOM.
24421         (fns): Add field for RANDOM.
24422         (mpz_eval_expr): Handle RANDOM.
24424 2000-12-19  Kevin Ryde  <kevin@swox.se>
24426         * mpn/generic/sqrtrem.c: Rewrite by Paul Zimmermann, based on his
24427         Karatsuba Square Root algorithm.
24428         * gmp.texi (Square Root Algorithm): Update.
24430         * tune/many.pl: New file.
24432         * mpn/tests/try.c,ref.[ch] (mpn_preinv_mod_1, mpn_sb_divrem_mn,
24433         mpn_tdiv_qr, mpn_gcd_finda, mpn_kara_mul_n, mpn_kara_sqr_n,
24434         mpn_toom3_mul_n, mpn_toom3_sqr_n): Add testing.
24435         * mpn/tests/ref.c: Cast some "0"s in function calls.
24437         * mpn/x86/k7/mmx/mod_1.asm: Add preinv_mod_1 entrypoint, remove extra
24438         variable for loop termination.
24440         * mpn/x86/p6/mmx/mod_1.asm: Remove file, in favour of the following.
24441         * mpn/x86/p6/mod_1.asm: New file.
24443         * mpn/x86/pentium/mod_1.asm: New file.
24445 2000-12-18  Torbjorn Granlund  <tege@swox.com>
24447         * configure.in (mips*-*-irix[6789]*): Pass options to compiler using
24448         `-Wc'.
24450 2000-12-18  Kevin Ryde  <kevin@swox.se>
24452         * mpn/x86/k6/pre_mod_1.asm: New file.
24454         * tune/tuneup.c (USE_PREINV_MOD_1): Tune this, rearrange mpn_divrem_1
24455         and mpn_mod_1 handling in support of it.
24456         * tune/Makefile.am: Consequent changes to divrem_1.c and mod_1.c.
24458         * gmp-impl.h (USE_PREINV_MOD_1, MPN_MOD_OR_PREINV_MOD_1): New macros.
24459         * mpn/generic/perfsqr.c, mpz/pprime_p.c: Use MPN_MOD_OR_PREINV_MOD_1.
24461         * configure.in: Let an asm mod_1 provide a preinv_mod_1 entrypoint.
24463         * mpn/alpha/default.m4: Remove some newlines, add some asserts.
24464         (r0 etc, f0 etc): Use defreg and deflit.
24465         (PROLOGUE, PROLOGUE_GP, EPILOGUE): Use GSYM_PREFIX.
24466         * mpn/alpha/unicos.m4: Remove some newlines, add some asserts.
24467         * mpn/alpha/invert_limb.asm: Remove unused second DATASTART parameter.
24468         * mpn/alpha/cntlz.asm: Use mpn_count_leading_zeros and __clz_tab.
24470         * mpn/asm-defs.m4 (changecom): Comments on portability.
24471         (__clz_tab, modlimb_invert_table): New macros, matching gmp-impl.h.
24472         (count_leading_zeros, count_trailing_zeros): New define_mpn's.
24473         (PROLOGUE etc): Comments on usage, add some asserts.
24474         (OPERATION_[lr]shift): Use m4_not_for_expansion, for the benefit of
24475         lorrshift multifunc.
24477         * mpn/Makeasm.am (RM_TMP): New variable controlling tmp-*.s
24478         removal, for development purposes.
24480         * mpz/fac_ui.c: Fix for long long limb by using mpn_mul_1 not
24481         mpz_mul_ui, and note some possible enhancements.
24483         * mpz/tests/t-fac_ui.c: New test.
24484         * mpz/tests/Makefile.am (check_PROGRAMS): Add it.
24485         * macos/Makefile.in: Ditto, and add t-fib_ui too.
24487         * mpn/generic/[lr]shift.c: Remove some DEBUG code adequately covered
24488         by new parameter ASSERTs.
24490         * longlong.h (count_trailing_zeros): Assert x!=0.
24492         * doc/configuration: Updates for new configure things, add some notes
24493         on test setups.
24495 2000-12-16  Torbjorn Granlund  <tege@swox.com>
24497         * configure.in (*-*-aix): Pass -qmaxmem=20000 to xlc also for 64-bit
24498         compiles.
24499         * configure.in: Disable shared libs for *-*-ultrix*.
24501 2000-12-15  Torbjorn Granlund  <tege@swox.com>
24503         * configure.in (powerpc*-*-*): Pass -Wa,-mppc when using gcc.
24505         * gmp-impl.h (_EXTERN_INLINE): #define different for GCC and other
24506         compilers.
24508         * gmp-h.in (__gmp_inline): Remove.
24509         * mp-h.in: Likewise.
24510         * mpn/generic/gcd.c: Use `inline' instead of `__gmp_inline'.
24512         * configure.in (mips*-*-irix[6789]*): Define *_ldflags.
24514 2000-12-14  Torbjorn Granlund  <tege@swox.com>
24516         * mpn/generic/pre_mod_1.c: Use proper type for udiv_qrnnd
24517         parameter `dummy'.
24519         * mpn/generic/divrem_1.c: Use explicit `!= 0' in if statement.
24520         * mpn/generic/mod_1.c: Likewise.
24522 2000-12-14  Kevin Ryde  <kevin@swox.se>
24524         * config.guess (mips-*-irix[6789]*): Transform to mips64.
24525         (m68k-*-nextstep* | m68k-*-openstep*): Transform to m68020.
24527 2000-12-13  Torbjorn Granlund  <tege@swox.com>
24529         * tests/t-constants.c (main): Conditionalize use of PP_INVERTED.
24531         * mpn/mp_bases.c: Handle 4-bit limbs.
24532         (main): Add code for generating tables.
24534         * mpn/generic/popham.c: Handle limb bitsizes of 4, 8, 16.
24535         Suffix all 32-bit constant with `L'.
24536         Use CNST_LIMB for 64-bit constants.
24538 2000-12-13  Kevin Ryde  <kevin@swox.se>
24540         * gmp-impl.h (FIB_THRESHOLD): Defaults for 4,8,16 bits per limb, and
24541         an arbitrary fallback default.
24542         (modlimb_invert): Add efficient code for 8,16 (or 4) bits per limb.
24544         * configure.in (mips3, mips64): Don't bother with o32 (mips2 32-bit
24545         limb) on IRIX 6.
24547         * Makefile.am (SUBDIRS): Put "tests" first so tests/t-constants.c is
24548         run first, to pick up any limb size mismatch.
24550         * tune/tuneup.c (DIVREM_1, MOD_1): Fix result values, were off by 1.
24552         * mpz/fib_ui.c (table1, table2): Add data for 4,8,16 bits per limb.
24554 2000-12-12  Torbjorn Granlund  <tege@swox.com>
24556         * gmp-impl.h (LIMBS_PER_DOUBLE): Define for any limb bitsize.
24558 2000-12-11  Torbjorn Granlund  <tege@swox.com>
24560         * mpn/mp_bases.c: Add tables for 8-bit and 16-bit limbs.
24561         Round existing `double' values properly.
24563         * gmp-h.in (__gmp_randstate_struct): Prefix field names with _mp_
24564         to keep out of user name space.
24565         (__gmp_randata_lc): Likewise.
24566         * randclr.c, randlc.c, randlc2x.c, randraw.c, randsd.c, randsdui.c:
24567         Corresponding changes.
24569         * gmp-impl.h (PP): #define for machines with BITS_PER_MP_LIMB
24570         of 2, 4, 8, and 16.
24571         (PP_FIRST_OMITTED): New, define for various BITS_PER_MP_LIMB.
24572         (PP_MASK): Remove.
24573         (PP_MAXPRIME): Remove.
24575         * mpn/generic/perfsqr.c: Generalize PP handling for machines with
24576         limbs of < 32 bits.  Allow PP_INVERTED to be undefined.
24577         * mpz/pprime_p.c: Likewise.
24579 2000-12-10  Torbjorn Granlund  <tege@swox.com>
24581         * mpn/generic/mul_1.c: Declare parameters in C89 style.
24583 2000-12-10  Kevin Ryde  <kevin@swox.se>
24585         * tune/Makefile.am (speed_LDFLAGS, speed_ext_LDFLAGS, tune_LDFLAGS):
24586         Don't use -all-static, as gcc 2.95.2 on i386 solaris 8 doesn't like
24587         it.
24589         * configure.in (mips3,mips64): Add ABI=64, name the others ABI=n32 and
24590         ABI=o32.
24591         * mpn/mips3/gmp-mparam.h (BITS_PER_LONGINT): Remove #define and let
24592         configure determine it, since it varies with ABI=64 or ABI=n32.
24593         * gmp.texi (ABI and ISA): Update.
24594         (mpz_mod_ui): Remark that it's identical to mpz_fdiv_r_ui.
24595         (mpn_divexact_by3): Qualify a statement needing mp_bits_per_limb even.
24597         * mul_fft.c (mpn_fft_mul_modF_K etc): Patch by Paul Zimmermann to fix
24598         results in certain cases of recursing into a further FFT.
24600 2000-12-09  Torbjorn Granlund  <tege@swox.com>
24602         * mpz/cmpabs.c: Remove unused variable.
24603         * mpz/rrandomb.c: Likewise.
24604         * mpz/xor.c: Likewise.
24606 2000-12-07  Torbjorn Granlund  <tege@swox.com>
24608         * mpn/generic/gcdext.c: Handle double carry when computing s1.
24609         Merge two code blocks for computing s0 and s1.
24611 2000-12-07  Kevin Ryde  <kevin@swox.se>
24613         * configure.in (hppa*-*-*): Remove -Aa -D_HPUX_SOURCE from
24614         cc_cflags/cppflags, and instead let AM_C_PROTOTYPES add it, or -Ae,
24615         whichever works.
24617         * configure.in (*-*-aix[34]*): Disable shared by default, but let
24618         the user override that, if desired.
24619         * gmp.texi (Notes for Particular Systems): Update.
24621 2000-12-06  Torbjorn Granlund  <tege@swox.com>
24623         * mpq/cmp_ui.c: Streamline.
24625 2000-12-06  Kevin Ryde  <kevin@swox.se>
24627         * tune/divrem_1_div.c,divrem_1_inv.c,mod_1_div.c,mod_1_inv.c,
24628         gcdext_double.c: New files for measuring.
24629         * tune/Makefile.am (libspeed_la_SOURCES): Add them.
24630         * tune/speed.c,speed.h,common.c: Add measuring of them.
24631         (mpn_preinv_mod_1, mpz_jacobi, mpz_powm_ui): Add measuring.
24633         * speed.c (getopt_long): Don't use this, just plain getopt.
24634         * configure.in (getopt_long): Remove test.
24636         * gmp-impl.h (MPN_KARA_MUL_N_TSIZE, MPN_KARA_MUL_N_MINSIZE,
24637         MPN_TOOM3_MUL_N_TSIZE, MPN_TOOM3_MUL_N_MINSIZE): New macros, and
24638         assume toom3 square tsize was meant to be the same as the mul (both
24639         are overestimates).
24640         * tune/tuneup.c, mpn/generic/mul.c, mpn/generic/mul_n.c: Use them.
24641         * mpn/generic/mul_n.c (mpn_toom3_sqr_n): Fix an ASSERT to use
24642         TOOM3_SQR_THRESHOLD not TOOM3_MUL_THRESHOLD, add a few that might
24643         be more realistic size checks.
24644         * tune/speed.h (SPEED_ROUTINE_MPN_MUL_N_TSPACE etc): Use minsize.
24646         * mpn/generic/divrem_1.c: Partial rewrite, merge fractional part
24647         calculation, skip a divide step in more cases, introduce
24648         DIVREM_1_NORM_THRESHOLD and DIVREM_1_UNNORM_THRESHOLD.
24649         * mpn/generic/mod_1.c: Partial rewrite, skip a divide step in more
24650         cases, introduce MOD_1_NORM_THRESHOLD, MOD_1_UNNORM_THRESHOLD.
24651         * longlong.h (UDIV_PREINV_ALWAYS): New define, set for alpha and ia64.
24652         * tune/tuneup.c (DIVREM_1_NORM_THRESHOLD, DIVREM_1_UNNORM_THRESHOLD,
24653         MOD_1_NORM_THRESHOLD, MOD_1_UNNORM_THRESHOLD): Tune these.
24654         * gmp-impl.h [TUNE_PROGRAM_BUILD]: Support for this.
24655         * tune/Makefile.am (TUNE_MPN_SRCS): Add divrem_1.c and mod_1.c.
24657         * gmp-impl.h (UDIV_NORM_PREINV_TIME): Renamed from UDIV_PREINV_TIME.
24658         * mpn/generic/perfsqr.c, mpn/generic/sb_divrem_mn.c,
24659         mpn/x86/*/gmp-mparam.h: Ditto.
24660         * gmp-impl.h (UDIV_UNNORM_PREINV_TIME): New define.
24662         * configure.in (AC_C_INLINE, HAVE_INLINE): New test and define.
24663         * gmp-impl.h (inline): Remove, use config.h.
24664         (_EXTERN_INLINE): Redefine based on HAVE_INLINE.
24665         (mpn_zero_p): Use HAVE_INLINE.
24667         * acinclude.m4 (GMP_PROG_AR, GMP_PROG_NM): Don't add flags to a user
24668         selected $AR or $NM.
24670         * tune/tuneup.c (all): Print how long the tuning took.
24672         * configure.in (AM_C_PROTOTYPES): Use this, not GMP_ANSI2KNR.
24673         * acinclude.m4 (GMP_ANSI2KNR): Remove.
24675         * Makefile.am (gmp.h, mp.h): In DISTCLEANFILES not CLEANFILES.
24677         * gmp-h.in (mpn_divmod, mpn_divmod_1, mpn_divexact_by3): Cast some
24678         zeros, for the benefit of K&R if long!=int.
24680         * mpn/lisp/gmpasm-mode.el (gmpasm-comment-start-regexp): Add "*" for
24681         the benefit of cray.
24683         * compat.c (mpn_divexact_by3, mpn_divmod_1): Return types should be
24684         mp_limb_t, not int, and need an actual "return".
24686 2000-12-05  Torbjorn Granlund  <tege@swox.com>
24688         * mpn/sparc32/v8/supersparc/gmp-mparam.h: Retune.
24689         * mpn/alpha/gmp-mparam.h: Tune for 21064.
24691         * longlong.h: Reformat to avoid newlines within strings.
24693         * gmp-impl.h (inline): Disable if GCC has defined __STRICT_ANSI__.
24695         * configure.in: Do a `mkdir tune' before creating tune/sqr_basecase.c.
24697         * Makefile.am: Treat mp.h analogously to gmp.h.
24699         configure.in (*-*-aix): Pass -qmaxmem=20000 to xlc.
24701         * mp-h.in: Renamed from mp.h.
24702         Add #define for _LONG_LONG_LIMB.
24703         Move some other fixes from gmp-h.in.
24704         * mp.h: Removed.
24705         * configure.in: Generate mp.h from mp-h.in like we handle
24706         gmp-h.in/gmp.h.
24708 2000-12-04  Torbjorn Granlund  <tege@swox.com>
24710         * acinclude.m4: Fix typo testing for bad HP compiler.
24712 2000-12-03  Torbjorn Granlund  <tege@swox.com>
24714         * mpbsd/tests/t-misc.c (check_itom): Exclude some tests for Cray
24715         CFP systems.
24717         * longlong.h (CRAYIEEE umul_ppmm): New.
24719         * mpn/cray/gmp-mparam.h (BITS_PER_SHORTINT): 32 => 64.
24720         (*_THRESHOLD): Tune.
24722         * configure.in: Disable shared libs for *-*-unicos*.
24724 2000-12-03  Kevin Ryde  <kevin@swox.se>
24726         * configure.in, tune/Makefile.am: Create tune/sqr_basecase.c during
24727         configure, and use it unconditionally in $(nodist_tuneup_SOURCES).
24728         Fixes a problem with sqr_basecase.lo under --disable-static.
24730 2000-12-01  Torbjorn Granlund  <tege@swox.com>
24732         * mpf/tests/t-get_d.c (LOW_BOUND,HIGH_BOUND): #define for non-IEEE
24733         Cray systems.
24735         * gmp-impl.h (union ieee_double_extract): Test for _CRAYIEEE.
24737 2000-11-30  Torbjorn Granlund  <tege@swox.com>
24739         * mpz/tests/t-mul.c (base_mul): Fix re-evaluation problems in macro
24740         invocations.
24741         (ref_mpz_mul): New name from mpz_refmul.  Make static.
24742         (base_mul): New name for _mpn_mul_classic.
24744 2000-11-30  Kevin Ryde  <kevin@swox.se>
24746         * configure.in: Rewrite of CC/CFLAGS selection scheme, introduce a
24747         notion of ABI, merge compiler and mpn path selection, add flags
24748         selection for AR and NM, let CC without CFLAGS work.
24749         (AC_PROG_CC): Use this, not GMP_SELECT_CC.
24750         * acinclude.m4 (GMP_PROG_CC_WORKS): Don't use AC_TRY_COMPILE, combine
24751         cc/cflags parameter.
24752         (GMP_PROG_CC_FIND, GMP_CHECK_CC_64BIT, GMP_PROG_CC_SELECT): Remove.
24753         * gmp.texi (Installing GMP): Updates for new scheme.
24755         * configure.in (AC_CANONICAL_HOST): Use this and $host, not $target.
24756         * acinclude.m4, acconfig.h, longlong.h, mpn/x86/x86-defs.m4,
24757         mpn/x86/k7/mmx/popham.asm: Ditto, renaming HAVE_TARGET_CPU to
24758         HAVE_HOST_CPU.
24759         * gmp.texi (Build Options, and elsewhere): Update.
24761         * acinclude.m4 (GMP_COMPARE_GE): New macro.
24762         (GMP_GCC_MARCH_PENTIUMPRO): Use it, add CC parameter, check for GCC.
24763         (GMP_HPC_HPPA_2_0): New macro, adapted from GMP_CHECK_CC_64BIT.
24765         * acinclude.m4 (GMP_PROG_AR): New macro, using AC_CHECK_TOOL, adding
24766         GMP flags.
24767         * configure.in: Use it
24769         * gmp-h.in: Renamed from gmp.h.
24770         (@define_LONG_LONG_LIMB@): Placeholder for instantiation.
24771         (__GNU_MP__): Bump to 3.
24772         * acinclude.m4 (GMP_VERSION): Get version from gmp-h.in.
24773         * configure.in: Create gmp.h from gmp-h.in to set _LONG_LONG_LIMB.
24774         * gmp.texi.h (ABI and ISA): Mention this.
24775         * acconfig.h (_LONG_LONG_LIMB): Remove undef.
24776         * Makefile.am: Distribute gmp-h.in, not gmp.h.
24778         * configure.in (AC_PROG_CPP, AC_PROG_INSTALL, AC_PROG_LN_S): Remove,
24779         dragged in by other macros.
24780         (gmp_asm_syntax_testing): Renamed from gmp_no_asm_syntax_testing.
24781         (AC_EXEEXT, AC_OBJEXT): Remove, done automatically by libtool.
24782         * configure.in, acinclude.m4: Remove "" from "`foo`", being
24783         unnecessary and not portable.
24785         * configure.in (GMP_LDFLAGS): New AC_SUBST flags for libtool link.
24786         (powerpc64*-*-aix*): Use for -Wc,-maix to fix shared library creation,
24787         but can't build shared and static at the same time.
24788         * Makefile.am (libgmp_la_LDFLAGS, libmp_la_LDFLAGS): Use
24789         $(GMP_LDFLAGS).
24790         * gmp.texi (Notes for Particular Systems): Update AIX problem
24792         * configure.in (AC_CONFIG_LINKS): Use where needed, not via gmp_links.
24793         (gmp_srclinks): Build up as needed, not via gmp_links.
24795         * acinclude.m4 (GMP_INIT): Do CONFIG_TOP_SRCDIR and asm-defs.m4 here.
24796         * configure.in (asm-defs.m4): Consequent changes.
24798         * acinclude.m4 (GMP_INCLUDE_MPN): Using include_mpn(), replacing
24799         GMP_INCLUDE and GMP_SINCLUDE.
24800         * configure.in (gmp_m4postinc): Remove this scheme, use
24801         GMP_INCLUDE_MPN instead.
24803         * configure.in (*-*-sco3.2v5*): Force ac_cv_archive_cmds_need_lc=no,
24804         until libtool does this itself.
24805         * gmp.texi (Known Build Problems): Remove SCO -lc problem.
24807         * configure, INSTALL.autoconf, etc: Update to autoconf 2000-11-29.
24808         * acinclude.m4 (GMP_C_SIZES): Use AC_CHECK_SIZEOF.
24809         * gmp.texi (Known Build Problems): Remove version.c sed/config.h
24810         problem, fixed.
24812         * ltmain.sh, aclocal.m4: Update to libtool 2000-11-25.
24813         * ltconfig: No longer required, but leave an empty dummy for automake.
24814         * gmp.texi (Known Build Problems): Remove SunOS native ar ranlib
24815         problem, fixed.
24817         * */Makefile.in, aclocal.m4: Update to automake 2000-11-25.
24818         * mpbsd/tests/Makefile.am, mpfr/tests/Makefile.am (check_PROGRAMS):
24819         Remove dummy, no longer required.
24820         * mpbsd/tests/dummy.c, mpfr/tests/dummy.c: Remove files.
24821         * depcomp: Remove file, no longer required (with no-dependencies).
24823         * texinfo.tex: Update to 2000-11-09.
24824         * gmp.texi (Build Options): Mention PDF from gmp.texi.
24825         * Makefile.am (MOSTLYCLEANFILES): Add gmp.tmp, from new texinfo.tex.
24827         * gmp.texi (Build Options): List alphaev56, alphapca56, alphaev67,
24828         hppa2.0n and power among supported CPUs.
24830 2000-11-30  Torbjorn Granlund  <tege@swox.com>
24832         * mpz/tests/t-mul.c: Increase max operand size from 2^17 bits
24833         to 2^19 bits.  Misc cleanups.
24835 2000-11-26  Kevin Ryde  <kevin@swox.se>
24837         * tune/tuneup.c (FIB_THRESHOLD): Cope better with different speeds of
24838         odd and even sizes.
24840         * longlong.h (alpha): Use udiv_qrnnd and count_leading_zeros on all
24841         compilers, not just gcc.
24843         * pre_mod_1.c: Use conditional subtract to always skip a division.
24844         (UMUL_TIME, UDIV_TIME): Remove defaults, now in longlong.h.
24846 2000-11-22  Torbjorn Granlund  <tege@swox.com>
24848         * mpn/pa64w/gmp-mparam.h: Retune.
24849         * mpn/pa64/gmp-mparam.h: Retune.
24850         * mpn/sparc64/gmp-mparam.h: Retune.
24852 2000-11-22  Kevin Ryde  <kevin@swox.se>
24854         * gmp-impl.h (ABOVE_THRESHOLD, BELOW_THRESHOLD): New macros.
24855         * mpn/generic/gcdext.c: Use them.
24857         * mpn/generic/gcdext.c [WANT_GCDEXT_ONE_STEP]: Force only one step.
24858         * tune/gcdextos.c, tune/gcdextod.c: New files, one step gcdext, single
24859         and double.
24860         * tune/Makefile.am (libspeed_la_SOURCES): Add them.
24861         (TUNE_MPN_SRCS): Remove gcdext.c.
24862         * tune/speed.h, tune/common.c, tune/speed.c: Add measuring.
24863         * tune/tuneup.c: Use for GCDEXT_THRESHOLD, plus check if double limb
24864         is ever better.  Should be more accurate, and hopefully faster.
24866         * tune/gcdext_single.c: New file, gcdext forced to single limbs.
24867         * tune/Makefile.am: Add it.
24868         * tune/speed.h, tune/common.c, tune/speed.c: Add measuring, and of
24869         invert_limb.
24871         * tune/speed.h (speed_params r): Use mp_limb_t, not long.
24872         * tune/speed.h, tune/common.c: Don't "switch" on "r".
24873         * tune/speed.c (r_string): Accept limb sized constants.
24874         (choice scale): Add a scale factor (eg. "2.33*mpn_add_n").
24875         * tune/common.c (SPEED_ROUTINE_UDIV_QRNND_A): Default r to
24876         __mp_bases[10].big_base, being a full limb value.
24878         * configure.in (alphapca56*-*-*): Use ev5 mpn path.
24879         (am29000*-*-*): Remove this, leave the canonical a29k.
24880         (z8k*-*-*, z8kx*-*-*): Changed from z8000, since z8k is canonical.
24881         (gmp_mpn_functions_optional): Add invert_limb, use for alpha and ia64.
24883         * configure.in (alloca): Accept yes/no/detect, generate an error if
24884         "yes" but not available.
24885         * gmp.texi (Build Options): Update.
24887         * acinclude.m4 (GMP_TRY_ASSEMBLE): Make conftest.out available.
24888         (GMP_ASM_ALIGN_FILL_0x90): Use it.
24890         * acinclude.m4 (GMP_ASM_X86_MMX) [*-*-solaris*]: Check for solaris
24891         2.6 "as" movq bug.
24892         * gmp.texi (Notes for Particular Systems): Update x86 MMX note.
24894 2000-11-21  Torbjorn Granlund  <tege@swox.com>
24896         * tune/Makefile.am (EXTRA_DIST): List hppa2w.asm.
24898         * tune/hppa2.asm: Change level directive to "2.0n".
24899         * tune/hppa2w.asm: New file.
24900         * configure.in [SPEED_CYCLECOUNTER_OBJS switch]: Separate out hppa2.0w.
24902         * mpn/pa64/gmp-mparam.h (BITS_PER_LONGINT): 64 => 32.
24904 2000-11-21  Kevin Ryde  <kevin@swox.se>
24906         * urandom.h (random): No prototype if glibc stdlib.h has already
24907         provided it (avoids an int32_t/long conflict).
24909         * tune/Makefile.am (LDFLAGS): Use -all-static.
24910         (speed-dynamic): Dynamic linked version of speed.c.
24911         * tune/README: Update.
24913         * mpn/generic/gcd.c (find_a): Use native version if available.
24914         * acconfig.h (HAVE_NATIVE_mpn_gcd_finda): Add #undef.
24915         * gmp-impl.h (mpn_gcd_finda): Add prototype and define.
24916         * mpn/asm-defs.m4 (mpn_gcd_finda): New define_mpn.
24917         * tune/gcd_finda_gen.c: #undef any HAVE_NATIVE_mpn_gcd_finda.
24918         * configure.in (gmp_mpn_functions_optional): Add gcd_finda.
24919         * mpn/x86/k6/gcd_finda.asm: New file.
24921         * tune/tuneup.c (POWM_THRESHOLD): Slightly bigger size steps.
24923         * gmp-impl.h (__GMP_IMPL_H__): Protect against multiple inclusion.
24924         * tune/gcd_bin.c, tune/powm_mod.c, tune/powm_redc.c: Use #undef after
24925         gmp-impl.h to force thresholds.
24926         * tune/tuneup.c (print_define, fft): No need for #ifndefs on
24927         thresholds any more.
24929 2000-11-20  Torbjorn Granlund  <tege@swox.com>
24931         * mpz/tests/t-powm.c: Analogous changes as made 2000-11-12 to t-mul.c.
24932         * mpz/tests/t-powm_ui.c: Likewise.
24933         * mpz/tests/t-pow_ui.c: Likewise.
24934         * mpz/tests/t-root.c: Likewise.
24936         * configure.in [compiler switch]: Pass "-Aa -D_HPUX_SOURCE" to cc for
24937         all hppa versions.
24939         * mpn/hppa/hppa1_1/udiv_qrnnd.S: Reference data using PC relative
24940         addressing (was r19 relative addressing).
24942 2000-11-18  Torbjorn Granlund  <tege@swox.com>
24944         * rand.c: (__gmp_rand_lc_scheme): Convert strings to hexadecimal.
24945         (gmp_randinit): Expect strings in hexadecimal.
24947 2000-11-18  Kevin Ryde  <kevin@swox.se>
24949         * configfsf.guess, configfsf.sub: Update to 2000-11-16.
24950         * config.guess (alpha*-*-openbsd*): Do exact cpu detection.
24952 2000-11-14  Torbjorn Granlund  <tege@swox.com>
24954         * mpz/tests/t-fdiv.c: Analogous changes as made 2000-11-12 to t-mul.c.
24955         * mpz/tests/t-tdiv_ui.c: Likewise.
24956         * mpz/tests/t-fdiv_ui.c: Likewise.
24957         * mpz/tests/t-sqrtrem.c: Likewise.
24958         * mpz/tests/t-gcd.c: Likewise.
24960 2000-11-13  Kevin Ryde  <kevin@swox.se>
24962         * mpn/Makeasm.am: New file, splitting out assembler rules.
24963         * mpn/Makefile.am, tune/Makefile.am: Use it.
24965         * mpn/Makefile.am (@CPP@): Remove this, automake already gives it.
24967         * configure.in (AC_CHECK_LIBM): New test, and AC_SUBST it.
24968         * Makefile.am (MPFR_LIBADD_OPTION): Use it.
24969         * demos/Makefile.am (qcn_LDADD): Ditto.
24970         * tune/Makefile.am (libspeed_la_LIBADD): Ditto.
24971         * tests/rand/Makefile.am (libstat_la_LIBADD): Ditto.
24973         * tune/time.c (timeval_diff_secs): Better calculation.
24974         (read_real_time): New measuring method for AIX power/powerpc.
24975         (speed_endtime): Protect against negative times.
24976         * tune/common.c (speed_measure): Protect against big reps.
24977         * tune/freq.c (speed_cpu_frequency_measure_one): Better timeval diff.
24978         * tune/speed.h (TIMEVAL_DIFF_SEC,USEC): Remove macros.
24979         * configure.in: (sys/systemcfg.h, read_real_time): New tests.
24981 2000-11-13  Torbjorn Granlund  <tege@swox.com>
24983         * mpz/tests/t-mul.c: Remove #include urandom.h.
24984         * mpz/tests/t-tdiv.c: Likewise.
24986         * configure.in [SPEED_CYCLECOUNTER_OBJS switch]:
24987         Declare hppa.asm as just 32 bits (cyclecounter_size=1).
24989 2000-11-12  Torbjorn Granlund  <tege@swox.com>
24991         * mpz/tests/t-mul.c
24992         (main): Generate random numbers using gmp_rand* functions.
24993         (main): Distribute random numbers non-uniformly.
24994         (main): Seed by current time if GMP_CHECK_RANDOMIZE is set.
24995         (_mpn_mul_classic): Streamline.
24996         * mpz/tests/t-tdiv.c: Analogous changes.
24998         * demos/pexpr.c (HAVE_sigaltstack): Fix typo in testing for _UNICOS.
24999         Also test for __hpux.
25001 2000-11-11  Torbjorn Granlund  <tege@swox.com>
25003         * mpn/alpha/ev5/gmp-mparam.h: Retune.
25005         * mpn/alpha/ev6/gmp-mparam.h: Retune.
25007         * mpn/alpha/ev6/add_n.asm: Misc cleanups.
25009         * mpn/alpha/ev6/sub_n.asm: New file.
25011 2000-11-10  Torbjorn Granlund  <tege@swox.com>
25013         * configure.in [path switch] (alphaev6*-*-*): Add alpha/ev5 to path.
25015         * mpn/alpha/ev6/add_n.asm: New file.
25017 2000-11-10  Kevin Ryde  <kevin@swox.se>
25019         * mpz/powm.c (redc): Make global under WANT_REDC_GLOBAL.
25020         * tune/powm_mod.c, tune/powm_redc.c: New files.
25021         * tune/Makefile.am (libspeed_la_SOURCES): Add them.
25022         * tune/*: Add measuring of redc, mpz_mod, mpz_powm_mod, mpz_powm_redc.
25024         * tune/tuneup.c (POWM_THRESHOLD): Determine from redc and mpz_mod.
25025         * tune/Makefile.am (TUNE_MPZ_SRCS): Remove powm.
25027 2000-11-10  Torbjorn Granlund  <tege@swox.com>
25029         * mpn/mips3/gmp-mparam.h: Retune.
25031         * configure.in (os_64bit): Rename to check_64bit_compiler.
25033 2000-11-09  Torbjorn Granlund  <tege@swox.com>
25035         * configure.in [SPEED_CYCLECOUNTER_OBJS switch]: Choose hppa/hppa2 code
25036         depending on $CC64.
25038 2000-11-09  Kevin Ryde  <kevin@swox.se>
25040         * mpn/x86/pentium/mul_1.asm: Unroll 2x, saving 1 c/l when in L1.
25041         Add 1c entrypoint.
25042         * mpn/x86/pentium/aorsmul_1.asm: Add 1c entrypoints, shave a couple
25043         of cycles at entry and exit.
25045         * configure.in (power1,2,2sc): Support these as synonyms for plain
25046         power.
25048         * acinclude.m4 (GMP_ASM_X86_SHLDL_CL): GMP_DEFINE WANT_SHLDL_CL here.
25049         (GMP_ASM_X86_MMX, GMP_ASM_X86_SHLDL_CL): Add X86 into the names.
25050         * configure.in: Consequent changes.
25052         * gmp.texi (Notes for Particular Systems): Remarks about power/powerpc.
25053         (Reentrancy): Remarks about simultaneous writing.
25054         (Reporting Bugs): Ask for configfsf.guess.
25056 2000-11-08  Kevin Ryde  <kevin@swox.se>
25058         * acinclude.m4 (GMP_FUNC_ALLOCA): New macro.
25059         * configure.in: Use it.
25060         * gmp-impl.h (alloca): Conditionals and setups as per autoconf
25061         (should make alloca available on more non-gcc compilers).
25063         * acinclude.m4: Misc reformatting, simplify some quoting.
25064         (GMP_ASM_UNDERSCORE, GMP_ASM_X86_MCOUNT): Use $CC $CFLAGS $CPPFLAGS.
25065         (GMP_ASM_UNDERSCORE, GMP_ASM_ALIGN_FILL_0x90, GMP_ASM_RODATA): Put
25066         AC_REQUIREs outside AC_CACHE_CHECK.
25067         (GMP_C_SIZES): Use $srcdir/gmp.h, not -I; use $CPPFLAGS.
25068         (GMP_ASM_UNDERSCORE): Use "gmp_compile" variable, and only rm
25069         conftes1* conftes2*.
25070         (GMP_PROG_NM): New macro, require it in appropriate GMP_ASM_*.
25071         (GMP_TRY_ASSEMBLE): New macro, use it in various GMP_ASM_*.
25072         * configure.in: Use GMP_PROG_NM.
25074         * mpn/tests/spinner.c (spinner_signal): Use RETSIGTYPE.
25075         (spinner_init): Force output to unbuffered.
25077         * mpn/x86/README.family: Notes about GOT table and imul, misc updates.
25078         * mpn/x86/k7/diveby3.asm: Change to 3 operands for immediate imul.
25079         * mpn/x86/k6/diveby3.asm: Ditto.
25081 2000-11-06  Torbjorn Granlund  <tege@swox.com>
25083         * urandom.h: Simplify and make it work properly for 64-bit
25084         machines also in environments without `random'.
25086 2000-11-04  Torbjorn Granlund  <tege@swox.com>
25088         * configure.in [path switch]: Don't match rs6000-*-*, in
25089         particular don't assume POWER.
25091         * tune/tuneup.c (fft): Remove usleep calls.
25093         * config.guess: Don't pass "$@" when it is known to be empty.
25095         * Makefile.am (EXTRA_DIST): List configfsf.guess and configfsf.sub.
25097 2000-11-04  Kevin Ryde  <kevin@swox.se>
25099         * configfsf.guess, configfsf.sub: Moved from config.guess and
25100         config.sub.
25101         * config.guess, config.sub: New files, wrappers around around
25102         configfsf versions.
25103         * configfsf.guess: Update to FSF 2000-10-23.
25104         * configfsf.sub: Update to FSF 2000-10-25.
25106         * acinclude.m4 (GMP_ASM_POWERPC_R_REGISTERS): New macro.
25107         * mpn/powerpc32/powerpc-defs.m4: New file, regmap.m4 r0 etc macros
25108         conditionalized by GMP_ASM_POWERPC_R_REGISTERS.
25109         * mpn/powerpc32/regmap.m4: Remove file.
25110         * configure.in (powerpc*-*-*): Use all this.
25112         * mpz/divegcd.c: New file, providing mpz_divexact_gcd.
25113         * Makefile.am, mpz/Makefile.am: Add it.
25114         * gmp-impl.h (mpz_divexact_gcd): Add prototype.
25115         * mpq/aors.c,canonicalize.c,div.c,mul.c: Use it.
25117         * longlong.h [pentium] (count_leading_zeros): New macro.
25118         (__clz_tab): Always provide prototype.
25119         * acconfig.h (HAVE_TARGET_CPU_): Add x86s.
25121         * tune/speed.[ch],common.c (count_leading_zeros,
25122         count_trailing_zeros, __udiv_qrnnd_c): Add measuring.
25124         * configure.in (X86_PATTERN): Move from here ...
25125         * acinclude.m4 (X86_PATTERN): ... to here.
25126         (GMP_ASM_RODATA): Use it.
25128         * configure.in (srandom): New test.
25129         * mpn/tests/try.c: Use it.
25130         * tune/speed.c: Ditto, and conditionalize getrusage and headers.
25132 2000-11-02  Kevin Ryde  <kevin@swox.se>
25134         * mpn/Makefile.am (nodist_libdummy_la_SOURCES): Add udiv_qrnnd.c
25135         and udiv_w_sdiv.c.
25137         * mpn/generic/mul_n.c (mpn_kara_sqr_n): Remove a duplicate
25138         subtract at the evaluate stage.
25140 2000-11-01  Torbjorn Granlund  <tege@swox.com>
25142         * configure.in [compiler switch] (sparc64-*-linux*): Spell
25143         gmp_xoptcflags_gcc properly, and pass same options as for other
25144         sparcv9 configs.
25146         * tune/speed.h (SPEED_ROUTINE_MPN_GET_STR): Fix type of wsize.
25148 2000-10-31  Torbjorn Granlund  <tege@swox.com>
25150         * configure.in [compiler switch] (sparc64-*-linux*): Remove -mvis
25151         from gmp_xoptflags_gcc, this might not be an ultrasparc.
25152         Remove -m32 from gmp_cflags_gcc; add -Wa,-xarch=v8plus.
25154 2000-10-29  Torbjorn Granlund  <tege@swox.com>
25156         * mpn/ia64/lorrshift.asm: New file.
25158         * configure.in: New mulfunc `lorrshift' for lshift and rshift.
25160 2000-10-29  Kevin Ryde  <kevin@swox.se>
25162         * mpn/generic/mul_n.c (mpn_kara_sqr_n): Delete code performing
25163         superfluous mpn_sub_n calls.
25165         * configure.in (found_asm, M4): Account for SPEED_CYCLECOUNTER_OBJ,
25166         for the benefit of targets whose only .asm is a cycle counter.
25168         * tune/tuneup.c (fft): Remove bogus usleep calls.
25170 2000-10-28  Torbjorn Granlund  <tege@swox.com>
25172         * mpn/ia64/invert_limb.asm: Get return value for 0x800...00 right.
25174         * tune/Makefile.am (EXTRA_DIST): Add ia64.asm.
25176         * tune/ia64.asm: Fix typo.
25178         * add_n.asm addmul_1.asm mul_1.asm popcount.asm sub_n.asm:
25179         Preserve ar.lc as required by ABI.
25180         * longlong.h (ia64 udiv_qrnnd): New.
25182         * configure.in [path switch] (ia64*-*-*): Set extra_functions.
25183         * mpn/ia64/invert_limb.asm: New file.
25185 2000-10-27  Torbjorn Granlund  <tege@swox.com>
25187         * configure.in [compiler switch]:
25188         Get rid of c89 for all hppa flavours--it is an evil compiler!
25190         * tune/speed.h (SPEED_ROUTINE_MPN_SET_STR): Fix type of xp.
25191         (SPEED_ROUTINE_MPN_GET_STR): Fix type of wp.
25193 2000-10-27  Kevin Ryde  <kevin@swox.se>
25195         * gmp.texi (Fibonacci Number Algorithm): New section.
25197         * mpz/tests/t-fib_ui.c: New file.
25198         * mpz/tests/Makefile.am (check_PROGRAMS): Add it.
25200         * mpz/fib_ui.c: Rewrite, same formulas but using mpn functions and
25201         some lookup tables, much faster at small to moderate sizes.
25202         * gmp-impl.h (MPZ_FIB_SIZE): New macro.
25203         (FIB_THRESHOLD): Establish default here.
25204         * tune/tuneup.c (FIB_THRESHOLD): Start search after the new table
25205         data.
25207         * mpn/x86/x86-defs.m4 (mcount_movl_GOT_ebx): Rename from movl_GOT_ebx,
25208         and don't use GSYM_PREFIX with _GLOBAL_OFFSET_TABLE_.
25210         * tune/freq.c (speed_cpu_frequency_measure): New test comparing
25211         gettimeofday and speed_cyclecounter, should cover many systems.
25213 2000-10-27  Torbjorn Granlund  <tege@swox.com>
25215         * mpn/ia64/gmp-mparam.h: Retune.
25217 2000-10-26  Torbjorn Granlund  <tege@swox.com>
25219         * longlong.h (ia64): Set UMUL_TIME and UDIV_TIME.
25221         * mpn/ia64/submul_1.c: Fix typo.
25223 2000-10-25  Kevin Ryde  <kevin@swox.se>
25225         * tune/freq.c (speed_cpu_frequency_sysctl): New test, supporting
25226         hw.model for BSD flavours.
25227         * configure.in (sysctl, sys/param.h): New tests.
25229 2000-10-24  Torbjorn Granlund  <tege@swox.com>
25231         * tune/freq.c: Explicitly #include config.h before other include files.
25233         * mpz/tests/reuse.c (FAIL2): New #define.
25234         (main): Use FAIL2.  Now this test properly returns non-zero exit
25235         status when it fails.
25237         * mpn/powerpc32/gmp-mparam.h: Retune.
25238         * mpn/powerpc64/gmp-mparam.h: Retune.
25240 2000-10-24  Kevin Ryde  <kevin@swox.se>
25242         * mpn/x86/k6/cross.pl: Support 8 and 16 byte code alignment.
25244         * mpq/aors.c, mpq/canonicalize.c: Skip two mpz_divexact calls if
25245         gcd gives 1, which should be 60% of the time.
25246         * gmp-impl.h (MPZ_EQUAL_1_P): New macro.
25247         * mpq/mul.c, mpq/div.c: Use it, and a new DIV_OR_SET.
25249         * tune/tuneup.c (xp_block, yp_block): Initialize these with random
25250         data.  Fixes GCD_ACCEL and GCDEXT thresholds, and latest POWM.
25252 2000-10-23  Torbjorn Granlund  <tege@swox.com>
25254         * configure.in [SPEED_CYCLECOUNTER_OBJS switch]: Add ia64 case.
25256         * mpn/ia64/gmp-mparam.h: Fill in some parameters.
25258         * mpn/ia64/submul_1.c: New file.
25260         * tune/ia64.asm: New file.
25262         * gmp-impl.h (union ieee_double_extract): Handle ia64.
25264         * mpn/mp_bases.c: Decrease chars_per_bit_exactly for entry 1 to
25265         work around buggy ia64-linux.
25267         * longlong.h (ia64 umul_ppmm): Update register flags to match new GCC.
25269 2000-10-22  Torbjorn Granlund  <tege@swox.com>
25271         * mpn/alpha/ev6/gmp-mparam.h (DC_THRESHOLD): Update.
25272         * mpn/alpha/ev6/submul_1.asm: New file.
25274 2000-10-22  Kevin Ryde  <kevin@swox.se>
25276         * tune/gcd_bin.c: New file.
25277         * tune/gcd_finda_gen.c: New file.
25278         * tune/Makefile.am (libspeed_la_SOURCES): Add them.
25279         * tune/speed.[ch],common.c (mpn_gcd_binary, find_a): Add measuring.
25281         * * (__gmp_allocate_func etc): Rename from _mp_allocate_func etc.
25282         (__gmp_default_allocate etc): Rename from _mp_default_allocate etc.
25283         * gmp-impl.h (__GMP_REALLOCATE_FUNC_TYPE,
25284         __GMP_REALLOCATE_FUNC_LIMBS): New macros.
25286         * gmp-impl.h (DC_THRESHOLD): Establish default here, set to 3*KARA
25287         since that's the measured average.
25288         * mpn/generic/dc_divrem_n.c, mpn/generic/tdiv_qr.c (DC_THRESHOLD):
25289         Remove default.
25291 2000-10-21  Torbjorn Granlund  <tege@swox.com>
25293         * mpn/Makefile.am (TARG_DIST): Add ia64.
25295 2000-10-21  Kevin Ryde  <kevin@swox.se>
25297         * *: Change BZ -> DC.
25298         * mpn/generic/dc_divrem_n.c: Renamed from bz_divrem_n.c.
25300         * doc/multiplication: Remove file, now in the manual.
25301         * doc/assembly_code: Ditto.
25302         * tune/README: Remove some parts now in the manual.
25304         * gmp.texi (@m etc): Add and use some new macros.
25305         (Integer Division - mpz_[cft]div_*): Merge descriptions, for brevity
25306         and to emphasise similarities.
25307         (Low-Level Functions - mpn_[lr]shift): Specify count as 1 to
25308         mp_bits_per_limb-1.
25309         (Algorithms): New chapter.
25310         (References): Add some papers.
25312         * mpn/generic/mul_n.c (mpn_toom3_mul_n, mpn_toom3_sqr_n): Remove some
25313         unused variables.
25314         * mpn/generic/mul_fft.c (mpn_fft_best_k): Ditto.
25316         * tune/freq.c: New file, split from time.c.
25317         * tune/time.c: Rewrite, now more automated.
25318         * configure.in, tune/*: Consequent changes.
25320 2000-10-20  Torbjorn Granlund  <tege@swox.com>
25322         * mpn/ia64/default.m4: New file.
25323         * configure.in [config.m4 switch] (ia64*-*-*): Use ia64/default.m4.
25325         * mpn/ia64/mul_1.asm: New file.
25326         * mpn/ia64/addmul_1.asm: New file.
25327         * mpn/ia64/add_n.asm: New file.
25328         * mpn/ia64/sub_n.asm: New file.
25329         * mpn/ia64/popcount.asm: New file.
25330         * mpn/ia64/README: New file.
25332         * mpn/alpha/cntlz.asm: Override `.set noat' from ASM_START.
25334         * configure.in (HAVE_TARGET_CPU_*): Support hppa1.0, hppa1.1, hppa2.0
25335         by sed'ing the period into `_'.
25337         * acconfig.h: Add #undefs for hppa targets.
25339         * longlong.h (udiv_qrnnd): Fix typo in last change.
25341         * mpz/tstbit.c: Rewrite (partly to work around GCC 2.95.2 HPPA bug).
25343         * configure.in [path switch]:
25344         (hppa2.0*-*-*): For non-CC64 case, update path.
25346         * configure.in [compiler switch]:
25347         (hppa2.0w-*-*): Match with same regexp in both places.
25348         (hppa*-*-*): New case.
25349         (all hppa alternatives): Don't inherit default gmp_cflags_cc,
25350         gmp_cflags_c89.
25352 2000-10-18  Torbjorn Granlund  <tege@swox.com>
25354         * configure.in (alpha*-*-*): Define gmp_xoptcflags_gcc like for
25355         alpha*-*-osf*.
25357         * longlong.h (x86 udiv_qrnnd): Change `d' => `dx' to avoid K&R C
25358         stringification.
25360 2000-10-15  Kevin Ryde  <kevin@swox.se>
25362         * doc/configuration: Updates.
25364         * demos/calc.y: Remove some comments.
25366 2000-10-14  Kevin Ryde  <kevin@swox.se>
25368         * gmp.texi (Parameter Conventions, Memory Management): New sections
25369         split from "Variable Conventions".
25370         (Efficiency, Debugging, Profiling): New sections in "GMP Basics".
25371         (Reentrancy): Some rewording, add note on standard I/O.
25372         (Build options): Add --enable-assert and --enable-profiling.
25374         * configure.in (--enable-profiling): New option.
25375         * acinclude.m4 (GMP_ASM_X86_MCOUNT): New macro, finding how to profile.
25376         * mpn/x86/x86-defs.m4 (PROLOGUE_cpu, call_mcount): Profiling support.
25378         * acinclude.m4, configure.in (GMP_ASM_*): Rename from GMP_CHECK_ASM_*,
25379         to follow autoconf conventions.
25381         * configure.in: Run GMP_CHECK_ASM tests only if needed.
25382         * acinclude.m4 (GMP_CHECK_ASM_MMX): Don't use GMP_CHECK_ASM_TEXT.
25384         * mpn/x86/x86-defs.m4 (ASSERT): Allow no condition, to just emit code.
25386 2000-10-13  Kevin Ryde  <kevin@swox.se>
25388         * mpq/md_2exp.c: New file.
25389         * mpq/Makefile.am (libmpq_la_SOURCES): Add it.
25390         * Makefile.am (MPQ_OBJECTS): Ditto.
25391         * gmp.h (mpq_mul_2exp, mpq_div_2exp): Add prototypes.
25392         * gmp.texi (Rational Arithmetic): Add documentation.
25394         * mpq/tests/t-md_2exp.c: New file.
25395         * mpq/tests/Makefile.am (check_PROGRAMS): Add it.
25397         * mpn/generic/perfsqr.c: Add/amend some comments.
25399         * gmp.texi (Known Build Problems): Note VERSION problem with old
25400         sed, do some minor rewording.
25401         (Build Options): Add cygwin and djgpp URLs, mention INSTALL.autoconf,
25402         mention HTML.
25403         (Getting the Latest Version of GMP): Move this ...
25404         (Introduction to GMP): ... to here.
25405         (Compatibility with older versions): Just refer to 2.x and 3.x, not
25406         every minor version.
25407         (Initializing Integers): Note restrictions on mpz_array_init'ed
25408         variables.
25409         (Integer Logic and Bit Fiddling): Note bits are numbered from 0.
25411         * INSTALL.autoconf: New file.
25412         * Makefile.am (EXTRA_DIST): Add it.
25414         * tune/Makefile.am, tune/tuneup.c, configure.in, gmp-impl.h: New
25415         scheme for recompiled objects used by tune program.  Don't use
25416         libgmptune.a, make better use of libtool, work with ansi2knr.
25418         * tune/speed.h,common.c (SPEED_ROUTINE_MPZ_POWM): Use s->yp and
25419         s->xp_block, make exponent a fixed size.
25421 2000-10-07  Torbjorn Granlund  <tege@swox.com>
25423         * mpn/mips3/gmp-mparam.h: Retune.
25425         * mpn/generic/mul_n.c (USE_MORE_MPN): Revert last change.
25427 2000-10-06  Torbjorn Granlund  <tege@swox.com>
25429         * mpn/mips3/add_n.s: Decrease carry recurrence from 4 to 3 cycles.
25430         * mpn/mips3/sub_n.s: Likewise.
25432 2000-10-04  Torbjorn Granlund  <tege@swox.com>
25434         * configure.in (sparc64-*-linux*): Set path according to CC64.
25436 2000-10-04  Kevin Ryde  <kevin@swox.se>
25438         * acinclude.m4 (GMP_CHECK_ASM_UNDERSCORE): Use LABEL_SUFFIX, not a
25439         hard-coded ":".
25441         * config.sub: Don't demand "86" in CPU name for SCO.
25443         * configure.in (supersparc-*-*): Remove -DSUPERSPARC.
25444         * longlong.h: Use HAVE_TARGET_CPU_supersparc.
25446         * configure.in (HAVE_TARGET_CPU_*): AC_DEFINE from $target_cpu.
25447         * acconfig.h: Add #undefs, but only for targets of interest.
25449 2000-10-03  Torbjorn Granlund  <tege@swox.com>
25451         * mpn/alpha/cntlz.asm: Rewrite.
25453         * mp_clz_tab.c (__clz_tab): Half table size to 128 entires.
25454         * longlong.h (count_leading_zeros): Demand just 128 entries from
25455         __clz_tab.
25457         * configure.in (mips-sgi-irix6.*): Pass -mips3 in addition to options
25458         for n32 ABI.
25460         * longlong.h: Move NO_ASM test around all assembly code.
25461         From gcc:
25462         * longlong.h (count_leading_zeros): Sparclite scan instruction was
25463         being invoked incorrectly.
25464         Replace __mc68332__ with __mcpu32__.
25465         Add ARC support.
25467 2000-10-02  Torbjorn Granlund  <tege@swox.com>
25469         * mpn/mips3/gmp-mparam.h: Retune for both gcc and cc.
25471         * mpn/generic/mul_n.c (USE_MORE_MPN): Remove exception for __mips.
25472         (interpolate3): Cast mp_limb_t variables to mp_limb_signed_t
25473         when testing sign bit.
25475         * mpn/alpha/ev6/gmp-mparam.h: Retune.
25476         * mpn/powerpc32/gmp-mparam.h: Retune.
25477         * mpn/powerpc64/gmp-mparam.h: Retune.
25478         * mpn/x86/pentium/gmp-mparam.h: Retune.
25479         * mpn/x86/pentium/mmx/gmp-mparam.h: Retune.
25480         * mpn/sparc32/v9/gmp-mparam.h: Retune.
25481         * mpn/x86/k6/gmp-mparam.h: Retune.
25482         * mpn/x86/p6/gmp-mparam.h: Retune.
25483         * mpn/x86/k7/gmp-mparam.h: Retune.
25484         * mpn/sparc64/gmp-mparam.h: Retune.
25486         * mpn/m68k/gmp-mparam.h: New file.
25487         * mpn/alpha/ev5/gmp-mparam.h: New file.
25489         * gmp-impl.h (default MPN_COPY): Remove final `;'.
25491         * tune/time.c (speed_endtime): Rewrite.
25493         * tune/speed.h (SPEED_ROUTINE_MPZ_POWM): Set base to a large value,
25494         not 2.
25496         * demos/pexpr.c (setup_error_handler): Fix typo.
25498         * mpz/powm.c (redc): New function, based on old mpz_redc.  Don't
25499         multiply here.
25500         (mpz_redc): Remove.
25501         (mpz_powm): Major changes, partially reverting to mpn calls.
25502         Multiply before calling redc.
25503         (mpz_powm): Use TMP_ allocation.
25504         (mpz_powm): Refine calculation of k (width of exponent window).
25505         (mpz_powm): Cast constants to mp_limb_t before left shifting.
25507         * longlong.h: Use ia64 count_leading_zeros just when __GNUC__.
25509 2000-09-29  Kevin Ryde  <kevin@swox.se>
25511         * acinclude.m4 (GMP_C_SIZES): New macro.
25512         * configure.in: Use it.
25513         * acconfig.in (BYTES_PER_MP_LIMB etc): Add #undefs.
25514         * mpn/generic/gmp-mparam.h (BYTES_PER_MP_LIMB etc): Remove #defines.
25515         * gmp.texi (Known Build Problems): Remove 64-bit generic C
25516         gmp-mparam.h problem, now fixed.
25518         * configure.in: Only run GMP_PROG_M4 if it's actually needed.
25520 2000-09-27  Torbjorn Granlund  <tege@swox.com>
25522         * demos/pexpr.c: Clean up code for systems not supporting
25523         sigaltstack.  Handle old Linux without sigaltstack.  Properly
25524         disable all stuff related to sigaltstack under Unicos.
25526         * mpn/alpha/ev6/addmul_1.asm: Use explicit offset for all load and
25527         store insns.  Helps old gas.
25529         * longlong.h (count_leading_zeros): Define for ia64.
25531 2000-09-27  Paul Zimmermann  <Paul.Zimmermann@loria.fr>
25533         * mpn/generic/bz_divrem_n.c: Fix qhl handling, simplify.
25535 2000-09-27  Kevin Ryde  <kevin@swox.se>
25537         * mpn/Makefile.in (.SUFFIXES): Regenerate with patched automake to
25538         get .s before .c, which is needed to override ansi2knr .c rules.
25540         * gmp.texi (mpn_sqrtrem): Fix r2p==NULL return value description
25541         to match the code (change by Torbjorn).
25542         (mpn_gcd, mpn_gcdext, mpn_sqrtrem, mpn_tdiv_qr): Note most
25543         significant limbs must be non-zero.
25544         (mpn_gcd, mpn_gcdext, mpn_sqrtrem): Clarify destination size
25545         requirements.
25546         (mpn_gcd_1): Clarify value must be non-zero, not just size.
25548         * gmp-impl.h (mpn_zero_p): New inline function.
25549         * mpn/generic/inlines.c: Add gmp-impl.h.
25550         * mpf/integer.c, mpz/get_d.c, mpn/generic/mul_fft.c: Use it.
25552         * mpn/generic/gcd.c: Use MPN_COPY_INCR not MPN_COPY.
25553         * mpf/add_ui.c: Ditto.
25554         * mpf/add.c: Ditto, and fix test to skip copy.
25556 2000-09-26  Kevin Ryde  <kevin@swox.se>
25558         * gmp-impl.h, longlong.h, mpn/generic/*.c: Add ASSERTs for various
25559         parameter restrictions.
25561         * gmp-impl.h (UDIV_PREINV_TIME): New macro.
25562         * mpn/generic/sb_divrem_mn.c: Use it.
25563         * mpn/generic/perfsqr.c: Ditto.
25564         * mpn/x86/*/gmp-mparam.h (UDIV_PREINV_TIME): Add values.
25566         * macos/Makefile.in: Add mpz/tests/t-get_si.c, mpf/tests/t-set_f.c,
25567         and new multi-function mpz and mpq files.
25569 2000-09-25  Kevin Ryde  <kevin@swox.se>
25571         * randlc.c, randlc2x.c, randsd.c, mpz/urandomb.c, mpz/urandomm.c:
25572         Use mpz_ptr and mpz_srcptr for parameters.
25573         * gmp.h (gmp_randinit_lc, gmp_randinit_lc_2exp, gmp_randseed,
25574         mpz_urandomb, mpz_urandomm): Corresponding change to prototypes.
25575         * randsdui.c: Remove wrong K&R parameters part.
25577 2000-09-12  Kevin Ryde  <kevin@swox.se>
25579         * gmp-impl.h (mpn_tdiv_qr): Move prototype from here ...
25580         * gmp.h (mpn_tdiv_qr): ... to here.
25582         * gmp.texi (Miscellaneous Rational Functions): Comment-out and
25583         move version 1 compatibility note to "Compatibility" section.
25584         (Rational Number Functions): Ditto for canonicalization note.
25586 2000-09-10  Kevin Ryde  <kevin@swox.se>
25588         * mpn/x86/pentium/com_n.asm: New file.
25590         * gmp.texi (Rational Arithmetic): Add mpq_abs.
25591         (Miscellaneous Rational Functions): Merge and simplify descriptions of
25592         mpq_get_num, mpq_get_den, mpq_set_num, mpq_set_den.
25594         * mpq/abs.c: New file.
25595         * mpq/Makefile.am (libmpq_la_SOURCES): Add it.
25596         * Makefile.am (MPQ_OBJECTS): Add it.
25597         * gmp.h (mpq_abs): Add prototype.
25599         * mpq/set_den.c: Don't discard sign when copying, this makes the
25600         code match the manual.
25602 2000-09-07  Torbjorn Granlund  <tege@swox.com>
25604         * tune/alpha.asm: Rewrite to actually work right.
25606 2000-09-07  Kevin Ryde  <kevin@swox.se>
25608         * tune/common.c,speed.[ch]: Add measuring of mpn_sqrtrem,
25609         mpn_get_str, mpn_set_str.
25610         * tune/README: Various updates.
25612 2000-09-06  Torbjorn Granlund  <tege@swox.com>
25614         * mpz/fits.c: Correct type of `data'.
25616 2000-09-06  Kevin Ryde  <kevin@swox.se>
25618         * gmp.texi (Build Options): Clarify where to find CFLAGS.
25619         (Known Build Problems): Note SCO -lc problem.
25621         * tune/speed.h (SPEED_ROUTINE_MPN_GCD_CALL): Fix for sizes > 512 limbs.
25623         * doc/multiplication: Corrections and additions suggested by Paul.
25625         * tune/modlinv.c: New file with alternate modlimb_inverts.
25626         * tune/Makefile.am, tune/speed.[ch]: Add measuring of them.
25627         * tune/speed.c (FLAG_NODATA): New attribute, use for mpz_bin_uiui,
25628         mpz_fib_ui, mpz_fac_ui.
25630         * mpn/x86/t-zdisp.sh: New file.
25632         * tests/t-modlinv.c: New file.
25633         * tests/Makefile.am (check_PROGRAMS): Add it.
25635         * mpq/tests/t-set_f.c: New file.
25636         * mpq/tests/Makefile.am (check_PROGRAMS): Add it.
25638         * gmp-impl.h (MPQ_CHECK_FORMAT): New macro.
25639         * mpq/tests/t-get_d.c: Use it.
25641         * mpq/set_f.c: New file.
25642         * mpq/Makefile.am (libmpq_la_SOURCES): Add it.
25643         * Makefile.am (MPQ_OBJECTS): Ditto.
25644         * gmp.h: Add prototype.
25645         * gmp.texi (Miscellaneous Rational Functions): Document mpq_set_f,
25646         correct return type of mpq_set_d.
25648 2000-09-03  Kevin Ryde  <kevin@swox.se>
25650         * mpz/aors_ui.c: New file merging add_ui.c and sub_ui.c, no object
25651         code changes.
25652         * mpz/add_ui.c, mpz/sub_ui.c: Remove files.
25653         * mpz/Makefile.am: Update.
25655         * gmp-impl.h (MPZ_FITS_STYPE_SDT, MPZ_FITS_UTYPE_SDT): New macros.
25656         * mpz/fits.c: New file merging six separate fits*.c.
25657         * mpz/fits_sshort_p.c, fits_sint_p.c, fits_slong_p.c, fits_ushort_p.c,
25658         fits_uint_p.c, fits_ulong_p.c: Remove files
25659         * mpz/Makefile.am: Use new fits.c, change object names from
25660         fits_*_p.lo to fits_*.lo to avoid SunOS 4 native "ar" warnings.
25661         * Makefile.am (MPZ_OBJECTS): Change from fits_*_p.lo to fits_*.lo.
25663         * acinclude.m4 (GMP_CHECK_ASM_RODATA): New macro, defining RODATA.
25664         * configure.in: Use it.
25665         * mpn/x86/k[67]/mmx/popham.asm: Use it.
25667         * mpn/x86/*/*.asm: Use "TEXT" not ".text".
25669 2000-09-02  Kevin Ryde  <kevin@swox.se>
25671         * mpq/aors.c: New file merging add.c and sub.c, no object code changes.
25672         * mpq/add.c, mpq/sub.c: Remove files.
25673         * mpq/Makefile.am: Update.
25675         * mpz/aors.c: New file merging add.c and sub.c, no object code changes.
25676         * mpz/add.c, mpz/sub.c: Remove files.
25677         * mpz/Makefile.am, mpbsd/Makefile.am: Update.
25679         * configure.in: Re-apply "PROLOGUE.*" regexp change for the
25680         benefit of alpha PROLOGUE_GP, lost in path search reorganisation.
25682         * mpn/x86/x86-defs.m4 (jadcl0, cmov_simulate, ASSERT,
25683         movl_text_address): Don't use "1:" style labels.
25684         (Zdisp): Rearrange a bit, switch to all hex.
25685         * mpn/x86/README.family: Note SCO "as" doesn't support "1:" style
25686         local labels, misc rewordings.
25688 2000-08-29  Torbjorn Granlund  <tege@swox.com>
25690         * demos/primes.c: Include string.h.
25692         * config.guess (x86 variant recog code): Remove dummy*.o files
25693         generated by some compilers.
25695 2000-08-28  Kevin Ryde  <kevin@swox.se>
25697         * acinclude.m4 (GMP_CHECK_ASM_ALIGN_FILL_0x90): Fix Solaris 2.8
25698         warning message suppression, add notes about SCO.
25700         * Makefile.am (MPZ_OBJECTS etc): Move some comments.
25702 2000-08-25  Kevin Ryde  <kevin@swox.se>
25704         * mpz/pprime_p.c (mpz_millerrabin): Fix a TMP_FREE.
25706         * gmp.texi (Copying): Refer to Lesser not Library GPL.
25707         (GMP and Reentrancy): Note stack-alloc.c is not reentrant, and
25708         that SCO <ctype.h> is potentially not reentrant.
25710         * acinclude.m4 (GMP_CHECK_ASM_UNDERSCORE): Test by attempting to
25711         link with or without an underscore.
25712         * gmp.texi (Known Build Problems): Remove SunOS 4 native grep
25713         GSYM_PREFIX problem, now fixed.
25715         * gmp-impl.h (MODLIMB_INVERSE_3): New constant.
25716         * mpn/generic/diveby3.c: Use it instead of own INVERSE_3.
25717         * mpn/generic/mul_n.c: Ditto.
25718         * tests/t-constants.c: Check it, and PP_INVERTED too.
25720         * acinclude.m4 (GMP_GCC_MARCH_PENTIUMPRO): New macro.
25721         * configure.in [p6 and athlon] (gmp_optcflags_gcc): Use it to
25722         possibly add -march=pentiumpro.
25724         * gmp-impl.h (MPZ_SET_STR_OR_ABORT, MPF_SET_STR_OR_ABORT): New macros.
25725         * mpz/tests/t-bin.c, mpz/tests/t-get_si.c, mpz/tests/t-jac.c,
25726         mpz/tests/t-misc.c: Use them.
25727         * mpf/tests/t-conv.c, mpf/tests/t-misc.c: Ditto.
25728         * mpz/tests/convert.c: Ditto and amend diagnostics slightly.
25729         * mpz/tests/t-misc.c (check_mpz_set_si): Remove a superfluous init.
25730         * mpz/tests/io.c: Differentiate between I/O and data conversion errors.
25732         * mpn/generic/aors_n.c: New file merging add_n and sub_n, no
25733         object code changes.
25734         * mpn/generic/add_n.c: Remove file.
25735         * mpn/generic/sub_n.c: Remove file.
25737         * mpn/generic/aorsmul_1.c: New file merging addmul_1 and submul_1,
25738         no object code changes.
25739         * mpn/generic/addmul_1.c: Remove file.
25740         * mpn/generic/submul_1.c: Remove file.
25742         * mpn/generic/popham.c: New file merging popcount and hamdist, no
25743         object code changes.
25744         * mpn/generic/popcount.c: Remove file.
25745         * mpn/generic/hamdist.c: Remove file.
25747 2000-08-24  Torbjorn Granlund  <tege@swox.com>
25749         * gmp-impl.h (mpn_com_n): Fix typo.
25751 2000-08-23  Torbjorn Granlund  <tege@swox.com>
25753         * demos/primes.c (main): Don't call mpz_probab_prime_p for numbers
25754         that are known to be prime after sieving.
25755         (main): Declare and initialize max_s_prime_squared.
25756         (MAX_S_PRIME): Increase.
25757         (ST_SIZE): Increase.
25759 2000-08-23  Kevin Ryde  <kevin@swox.se>
25761         * gmp-impl.h (ASSERT_ALWAYS): Change to statement style.
25762         (JACOBI_TWO_U_BIT1): Remove ASSERT.
25763         (MPZ_CHECK_FORMAT): Use ASSERT_ALWAYS as a statement.
25765 2000-08-21  Torbjorn Granlund  <tege@swox.com>
25767         * gmp-impl.h (ASSERT): Use do..while for dummy version.
25769         * mpf/get_str.c: Don't set n_digits from digits_computed_so_far
25770         when the converted operand becomes zero.  Misc cleanups.
25772 2000-08-21  Kevin Ryde  <kevin@swox.se>
25774         * mpz/fdiv_r_2exp.c, mpz/lcm.c, mpz/urandomm.c: Add missing
25775         TMP_MARK/FREE, avoiding memory leak when using stack-alloc.c.
25777 2000-08-20  Kevin Ryde  <kevin@swox.se>
25779         * mpz/set.c [BERKELEY_MP] (move): Add conditionals to build as
25780         "move" for libmp.
25781         * mpbsd/Makefile.am: Use mpz/set.c, not move.c.
25782         * Makefile.am (MPBSD_OBJECTS): Corresponding change.
25783         * mpbsd/move.c: Remove file.
25785         * mpn/Makefile.am, mpz/Makefile.am, mpq/Makefile.am, mpf/Makefile.am,
25786         mpbsd/Makefile.am (-DOPERATION_foo): Use "foo" even for ansi2knr
25787         "foo_" objects.  Do this with the makefiles to keep the sources
25788         cleaner.
25789         * mpz/mul_siui.c, mpf/integer.c: Revert to plain OPERATION_* forms.
25791         * mpn/lisp/gmpasm-mode.el (gmpasm-remove-from-list): Renamed from
25792         gmpasm-delete-from-list, because it's non-destructive.
25793         (gmpasm-font-lock-keywords): Add some more keywords.
25795 2000-08-16  Kevin Ryde  <kevin@swox.se>
25797         * tune/mul_n_mpn.c, tune/mul_n_open.c: New files, being forced
25798         open-coded and mpn #includes of mpn/generic/mul_n.c.
25799         * tune/*: Add measuring of them.
25800         * tune/speed.c: Print command line into *.gnuplot file.
25802         * mpn/generic/mul_n.c (USE_MORE_MPN): Change to #if not #ifdef for
25803         using the value, add #ifndef for providing the default.
25804         * mpn/sparc64/gmp-mparam.h (USE_MORE_MPN): Add #ifndef.
25806         * tests/t-constants.c: New file.
25807         * tests/Makefile.am (check_PROGRAMS): Add it.
25809         * mpz/get_si.c: Use LONG_MAX, not BITS_PER_MP_LIMB, so the result
25810         doesn't depend on limb size when outside the range of a long
25811         (though such results are not actually documented).
25812         * mpz/tests/t-get_si.c: New file.
25813         * mpz/tests/Makefile.am (check_PROGRAMS): Add it.
25815         * mpn/tests/try.c (call): Cast popcount and hamdist calls,
25816         for the benefit of long long limb.
25818 2000-08-15  Kevin Ryde  <kevin@swox.se>
25820         * mp.h (mp_set_memory_functions): Add missing #define.
25821         * mpbsd/tests/allfuns.c (mp_set_memory_functions): Verify its
25822         existence.
25824         * mpf/tests/t-misc.c (check_mpf_getset_prec): New test, verifying
25825         reverted behaviour of mpf_get_prec.
25827         * mpn/tests/ref.c (refmpn_strip_twos): Use refmpn_copyi, not
25828         MPN_COPY_INCR.
25830         * mpz/mul_siui.c, mpf/integer.c: Recognise OPERATION_*_ forms
25831         produced under ansi2knr.
25833         * configure.in (mpn_objects, mpn_objs_in_libgmp): Add $U to .c
25834         objects when ansi2knr in use.
25836         * mpn/Makefile.am (AUTOMAKE_OPTIONS): Enable ansi2knr.
25837         (libdummy.la): Add this, not built, to create ansi2knr style rules
25838         for all potential .c files.
25839         * mpz/Makefile.am, mpq/Makefile.am, mpf/Makefile.am, mpfr/Makefile.am,
25840         mpbsd/Makefile.am, mpq/tests/Makefile.am, tests/Makefile.am
25841         (AUTOMAKE_OPTIONS): Enable ansi2knr (now everywhere).
25842         * Makefile.am (MPZ_OBJECTS, MPQ_OBJECTS, MPF_OBJECTS, MPFR_OBJECTS,
25843         MPBSD_OBJECTS, libmp_la_DEPENDENCIES): Add $U to all .lo filenames.
25845 2000-08-03  Torbjorn Granlund  <tege@swox.com>
25847         * mpn/alpha/ev6/addmul_1.asm: Correct number of cycles to 3.5/28.
25849 2000-08-02  Torbjorn Granlund  <tege@swox.com>
25851         * Version 3.1 released.
25853         * gmp.texi: Rephrase mpf_urandomb documentation.
25855         * mpn/alpha/ev6: New directory with ev6/21264 optimized code.
25856         * mpn/alpha/ev6/addmul_1.asm: New file.
25857         * mpn/alpha/ev6/gmp-mparam.h: New file.
25859 2000-08-02  Kevin Ryde  <kevin@swox.se>
25861         * demos/factorize.c (random): Don't use "inline".
25863         * mpfr/log.c, mpfr/mul_ui.c, mpfr/round.c, mpfr/set.c, mpfr/set_d.c:
25864         Corrections to K&R parts.
25866         * Makefile.am (EXTRA_HEADERS): Omit $(MPFR_HEADERS_OPTION).
25867         * mpfr/Makefile.am (EXTRA_DIST): Add mpfr.h.
25869         * gmp.texi (Known Build Problems): Note problem stripping libgmp.a.
25871 2000-08-02  Kent Boortz  <kent@swox.com>
25873         * mpfr: Integrated experimental version of mpfr-0.4.
25874         * configure.in: Changes for option --enable-mpfr.
25875         * Makefile.am: Changes for option --enable-mpfr.
25877 2000-08-01  Torbjorn Granlund  <tege@swox.com>
25879         * mpn/generic/popcount.c: Disable SPARC v9 popc_limb pattern.
25880         * mpn/generic/hamdist.c: Likewise.
25882 2000-08-01  Kevin Ryde  <kevin@swox.se>
25884         * mpn/tests/try.c (try_init): Account for ALIGNMENTS when sizing
25885         source and dest regions.
25887 2000-07-31  Torbjorn Granlund  <tege@swox.com>
25889         * mpf/get_str.c: Develop three extra digits, not just one.
25891 2000-07-31  Kevin Ryde  <kevin@swox.se>
25893         * gmp.texi (References): Add URL for invariant division.
25895 2000-07-30  Kevin Ryde  <kevin@swox.se>
25897         * tune/time.c (speed_cpu_frequency_proc_cpuinfo): Add support for
25898         alpha linux "cycle frequency".
25900         * mpn/sparc64/gmp-mparam.h: Re-run tune program for FFT thresholds.
25902 2000-07-29  Kevin Ryde  <kevin@swox.se>
25904         * gmp.texi (ABI and ISA): Add sparc64-*-linux*.
25905         * configure.in [sparc64-*-linux*] (gmp_cflags64_gcc): Same flags
25906         as under solaris.
25908         * configure.in (--enable-fft): New option, default "no".
25909         * gmp.texi (Build Options): Describe it.
25910         * mpn/generic/mul.c, mpn/generic/mul_n.c [WANT_FFT]: Use it.
25911         * tune/tuneup.c [WANT_FFT]: By default don't probe FFTs if not enabled.
25912         * NEWS: Multiplication optionally using FFT.
25914         * tune/README: Notes on FFT and GCD thresholds, other minor updates.
25916         * Makefile.am: Expunge the macos generated files update stuff.
25918 2000-07-28  Kevin Ryde  <kevin@swox.se>
25920         * mpn/x86/*/gmp-mparam.h: Add some FFT thresholds.
25922 2000-07-28  Kent Boortz  <kent@swox.se>
25924         * macos/Asm*, macos/CmnObj, macos/Mp*: Delete directories.
25925         * macos/Makefile: Delete file.
25926         * macos/Makefile.cw: Delete file.
25927         * macos/config.h: Delete file.
25928         * macos/Asm/*.s: Delete files.
25929         * macos/configure: Create target directories. Don't transform
25930         '(C)' to '(;)' in a 'dnl' line comment in .asm file.
25931         * Makefile.am: Delete macos targets.
25932         * macos/README: Reflect that we reverted back to a build
25933         process that require ""macos/configure" to run on MacOS.
25934         This imply that MacPerl is needed for a build in MacOS.
25936 2000-07-27  Kevin Ryde  <kevin@swox.se>
25938         * mpn/generic/mul_fft.c: New file, by Paul Zimmermann, minor mods
25939         applied.
25940         * configure.in (gmp_mpn_functions): Add it.
25941         * mpn/generic/mul.c, mpn/generic/mul_n.c: Use it.
25942         * doc/multiplication: Describe it (briefly).
25944         * gmp-impl.h (FFT_MUL_THRESHOLD etc): New thresholds.
25945         (mpn_fft_best_k, mpn_fft_next_size, mpn_mul_fft, mpn_mul_fft_full):
25946         New functions.
25947         (numberof, TMP_ALLOC_TYPE etc, _MP_ALLOCATE_FUNC_TYPE etc,
25948         UNSIGNED_TYPE_MAX etc): New macros.
25950         * tune/*: Add FFT threshold tuning and speed measuring.
25951         * tune/common.c: Avoid huge macro expansions for umul and udiv.
25953         * mpz/tests/t-bin.c, mpz/tests/t-jac.c, mpz/tests/t-misc.c,
25954         mpbsd/tests/t-misc.c, mpf/tests/t-misc.c, mpn/tests/try.c,
25955         mpn/tests/spinner.c: Use new gmp-impl.h macros.
25957         * demos/Makefile.am (BUILT_SOURCES): Don't need calc.c etc under this.
25959 2000-07-27  Torbjorn Granlund  <tege@swox.com>
25961         * mpn/ia64/gmp-mparam.h: New file.
25963 2000-07-26  Torbjorn Granlund  <tege@swox.com>
25965         * demos/isprime.c: Handle any number of arguments and print
25966         classification for each.  Add `-q' option for old behaviour.
25968 2000-07-26  Kevin Ryde  <kevin@swox.se>
25970         * gmp.texi (Build Options): Mention djgpp stack size.
25971         (Notes for Package Builds): New section.
25972         (Compatibility with older versions): Update for 3.1, add mpf_get_prec.
25974         * demos/factorize.c [__GLIBC__]: Don't declare random() under glibc.
25976         * gmp.h (gmp_version): Add prototype and define.
25978         * Makefile.am: Keep macos directory generated files up-to-date
25979         during development and on a "make dist".
25981 2000-07-25  Torbjorn Granlund  <tege@swox.com>
25983         * mpn/hppa/gmp-mparam.h: Update threshold values from new `tune' run.
25985         * mpn/pa64/gmp-mparam.h: Fill in values from `make tune' run.
25986         * mpn/pa64w/gmp-mparam.h: Likewise.
25987         * mpn/mips3/gmp-mparam.h: Likewise.
25989         * tune/hppa2.asm: Fix typo in .level directive.
25991         * configure.in: Add sparc64-*-linux* support (from Jakub Jelinek).
25992         * configure: Regenerate.
25994         * mpn/sparc64/rshift.asm: Use %g5 instead of volatile stack frame area
25995         for return value (from Jakub Jelinek).
25996         * mpn/sparc64/lshift.asm: Likewise.
25998         * mpf/get_prc.c: Revert Aug 8, 1996 change.
26000         * version.c: No longer static.
26002         * mpn/pa64/gmp-mparam.h: Only #define *_THRESHOLD if not already
26003         defined.
26004         * mpn/pa64w/gmp-mparam.h: Likewise.
26005         * mpn/arm/gmp-mparam.h: Likewise.
26006         * mpn/mips3/gmp-mparam.h: Likewise.
26008 2000-07-25  Kevin Ryde  <kevin@swox.se>
26010         * INSTALL: It's "info -f ./gmp.info" to be sure of hitting the
26011         gmp.info in the current directory.
26013         * Makefile.am (libmp_la_DEPENDENCIES): Add mpz/cmp.lo, for last
26014         mpz/powm.c fix.
26016         * mpn/sparc64/addmul1h.asm, mpn/sparc64/submul1h.asm: Renamed from
26017         addmul_1h.asm, submul_1h.asm to avoid name conflicts on an 8.3
26018         filesystem.
26019         * mpn/sparc64/addmul_1.asm, mpn/sparc64/submul_1.asm,
26020         mpn/sparc64/mul_1.asm: Update include_mpn()s.
26022 2000-07-24  Torbjorn Granlund  <tege@swox.com>
26024         * Update header of all files previously under the Library GPL
26025         to instead be under the Lesser GPL.
26027         * COPYING.LIB: Now Lesser GPL.
26028         * demos/primes.c: Change license to GPL (was Library GPL).
26029         * demos/isprime.c: Change license to GPL (was Library GPL).
26031         * gmp.h (error code enum): Add GMP_ERROR_BAD_STRING (currently unused).
26033         * mpz/tests/t-mul.c: Default SIZE to a function of TOOM3_MUL_THRESHOLD.
26034         Improve error messages.  Decrease reps.
26036 2000-07-22  Kevin Ryde  <kevin@swox.se>
26038         * tune/speed.h: Decrease the amount of data used for gcd and powm
26039         measuring, to make the tune go a bit faster.
26041 2000-07-21  Kent Boortz  <kent@swox.se>
26043         * macos/Asm*, macos/CmnObj, macos/Mp*: Directories no longer created
26044         from configure script, now part of dist.
26045         * macos/Makefile
26046         * macos/Makefile.cw
26047         * macos/config.h
26048         * macos/Asm/*.s
26049         New files and directories that is the output from configure. This way
26050         no Perl installation is required to build on MacOS, just MPW.
26051         * macos/configure: Added prefix '__g' to exported assembler labels.
26052         Changed to handle new m4 syntax instead of the old cpp syntax in asm.
26053         * macos/Makefile.in: Corrected 'clean' target, added 'distclean'
26054         and 'maintainer_clean'. Added "mpn/mp_bases.c" to build.
26055         * macos/README: Reflect the new build process without configure.
26056         Corrected the file structure for Apple MPW installation.
26058 2000-07-21  Torbjorn Granlund  <tege@swox.com>
26060         * mpf/tests/t-muldiv.c: Relax error limit.  Make precision depend
26061         on SIZE.  Misc changes.
26063         * configure: Regenerate.
26065 2000-07-20  Kent Boortz  <kent@swox.com>
26067         * macos/Makefile.in: Removed hard coded targets, added special
26068         targets found in Makefile.am files.
26069         * macos/configure: Generate targets from top configure script and
26070         Makefile.am files. Made script runnable from Unix for testing.
26071         * macos/README: Notes about search paths for includes, contributed
26072         by Marco Bambini.
26073         * configure.in: Added comment about lines that the "macos/configure"
26074         script depend on.
26076 2000-07-20  Torbjorn Granlund  <tege@swox.com>
26078         * mpz/powm.c (mpz_powm): After final mpz_redc call, subtract `mod'
26079         from result if it is greater than `mod'.
26081 2000-07-19  Torbjorn Granlund  <tege@swox.com>
26083         * mpn/hppa/gmp-mparam.h: Fill in values from `make tune' run.
26084         * mpn/alpha/gmp-mparam.h: Likewise.
26085         * mpn/powerpc32/gmp-mparam.h: Likewise.
26087         * tune/hppa.asm: New file.
26088         * tune/hppa2.asm: New file.
26089         * configure.in (SPEED_CYCLECOUNTER_OBJS): Set for hppa2*-*-* and
26090         hppa*-*-*.
26091         * tune/Makefile.am (EXTRA_DIST): Add hppa.asm and hppa2.asm.
26093         * tune/speed.h (SPEED_ROUTINE_MPN_BZ_DIVREM_CALL): Declare `marker';
26094         invoke TMP_FREE.
26096         * mpn/hppa/hppa1_1/udiv_qrnnd.S: Use "%" instead of "'" for
26097         reloc/symbol delimiter.
26099 2000-07-16  Torbjorn Granlund  <tege@swox.com>
26101         * mpn/powerpc64/gmp-mparam.h: Update with output from tune utility.
26102         * mpn/powerpc64/copyi.asm: New file.
26103         * mpn/powerpc64/copyd.asm: New file.
26105 2000-07-16  Kevin Ryde  <kevin@swox.se>
26107         * tune/*: Add measuring for umul_ppmm and udiv_qrnnd.
26109 2000-07-14  Kevin Ryde  <kevin@swox.se>
26111         * mpn/x86/k6/k62mmx: New directory.
26112         * configure.in (k6[23]*-*-*): Use it.
26113         * mpn/x86/k6/k62mmx/copyi.asm, mpn/x86/k6/k62mmx/copyd.asm: Move from
26114         mmx directory, improve code alignment a bit.
26115         * mpn/x86/k6/k62mmx/lshift.asm, mpn/x86/k6/k62mmx/rshift.asm: Ditto,
26116         and improve addressing modes for pre-CXT cores.
26117         * mpn/x86/x86-defs.m4 (Zdisp): Add an instruction.
26118         * mpn/x86/k6/mmx/lshift.asm, mpn/x86/k6/mmx/rshift.asm: New files,
26119         suiting plain K6.
26120         * mpn/x86/README, mpn/x86/k6/README: Updates.
26121         * mpn/x86/k6/mmx/*.asm: Update some comments.
26123         * mpn/tests/Makefile.am: Use $(MAKE) in .asm rules, not "m".
26124         * tune/Makefile.am: Use $(EXEEXT) and libtool --config objdir, for
26125         the benefit of djgpp.
26127         * */Makefile.in: Regenerate with patched automake that adds
26128         $(EXEEXT) to EXTRA_PROGRAMS.
26130         * mpn/tests/try.c: Add #ifdef to SIGBUS, for the benefit of djgpp.
26131         * config.guess: Recognise pc:*:*:* as an x86, for djgpp.
26133         * configure: Regenerate with patched autoconf to fix temp file
26134         ".hdr" which is invalid on a DOS 8.3 filesystem, and to fix two
26135         sed substitutes that clobbered a ":" in $srcdir (eg. a DOS drive
26136         spec).
26138         * mpz/tests/io.c: Use one fp opened "w+", since separately opened
26139         input and output doesn't work on MS-DOS 6.21.
26141         * tests/rand/Makefile.am (allprogs): Pseudo-target to build everything.
26142         (CLEANFILES): Add EXTRA_PROGRAMS and EXTRA_LTLIBRARIES.
26143         (manual-test, manual-bigtest): Add $(EXEEXT) to dependencies.
26145         * tests/rand/*/Makefile.in: Regenerate with patched automake that adds
26146         $(EXEEXT) to EXTRA_PROGRAMS.
26148 2000-07-13  Torbjorn Granlund  <tege@swox.com>
26150         * mpz/tests/t-root.c: Also test mpz_perfect_power_p.
26151         Generate `nth' so that there will be fewer trivial values.
26153         * mpz/root.c: Reverse return value in tests for detecting root of +1
26154         and -1.
26156         * mpz/perfpow.c: Use TMP_ALLOC interface.
26158 2000-07-12  Torbjorn Granlund  <tege@swox.com>
26160         * mpz/perfpow.c (primes): Make it const.
26162 2000-07-06  Kevin Ryde  <kevin@swox.se>
26164         * mpn/x86/k6/cross.pl: New file.
26166         * mpn/x86/*/gmp-mparam.h: Updates to thresholds, conditionalize
26167         all _TIME defines.
26168         * mpn/x86/pentium/mmx/gmp-mparam.h: New file.
26169         * mpn/sparc64/gmp-mparam.h: Update thresholds.
26170         * mpn/sparc32/v9/gmp-mparam.h: Ditto.
26172 2000-07-04  Kevin Ryde  <kevin@swox.se>
26174         * NEWS: Updates.
26175         * mpn/x86/*/README: Miscellaneous updates.
26177         * tune/speed-ext.c: New file.
26178         * tune/Makefile.am: Add it.
26179         * tune/README: Updates.
26180         * tune/speed.h (SPEED_ROUTINE_MPN_DIVREM_2): Bug fixes.
26182         * demos/calc.y,calclex.l: New files.
26183         * demos/calc.c,calc.h,calclex.c: New files, generated from .y and .l.
26184         * demos/Makefile.am: Add them.
26186         * gmp.h (mpq_swap, mpf_swap): Add prototypes and defines.
26188 2000-07-01  Kevin Ryde  <kevin@swox.se>
26190         * gmp.texi (ABI and ISA): New section, bringing together ABI notes.
26191         (Build Options): Add MPN_PATH, various updates.
26192         (Build Options): Add note on setting CFLAGS when setting CC.
26193         (Notes for Particular Systems): Add -march=pentiumpro problem.
26194         (Known Build Problems): Note on gmp-mparam.h for 64-bit generic C.
26195         (GMP Variable Conventions): Add some info on user defined functions.
26196         (Reporting Bugs): Minor rewording.
26198         * configure.in (MPN_PATH): Renamed from mpn_path.
26200         * gmp-impl.h (ULONG_MAX,ULONG_HIGHBIT,...,SHORT_MAX): New defines.
26201         * mp[zf]/tests/t-misc.c: Use them.
26203         * mpbsd/tests/t-misc.c: New file.
26204         * mpbsd/tests/Makefile.am: Add it.
26206         * Makefile.am (LIBGMP_LT_*, LIBMP_LT_*): Bump version info.
26207         * gmp.h (__GNU_MP_VERSION_*): Bump to 3.1.
26209         * mpf/tests/Makefile.am (AUTOMAKE_OPTIONS): Add ansi2knr.
26211         * Makefile.am (libmp_la_SOURCES): Add mp_set_fns.c, accidentally
26212         omitted in gmp 3.0.x.
26213         * gmp.texi (Custom Allocation): Note this is available in mpbsd,
26214         and some minor rewording.
26216 2000-06-30  Torbjorn Granlund  <tege@swox.com>
26218         * demos/factorize.c (random): New function, defined conditionally.
26219         (factor_using_pollard_rho): Use it, not mrand48.
26221         * mpn/cray/README: New file.
26223 2000-06-30  Kevin Ryde  <kevin@swox.se>
26225         * mpn/x86/pentium/aorsmul_1.asm: Add MULFUNC_PROLOGUE.
26227         * mpz/tests/t-jac.c: Test limbs on mpn_jacobi_base, not just ulongs.
26229         * gmp-impl.h, mpn/tests/try.c, mpn/tests/spinner.c, tune/speed.c:
26230         Use config.h unconditionally, not under HAVE_CONFIG_H.
26232         * demos/pexpr.c [__DJGPP__]: Patch by Richard Dawe to not use
26233         setup_error_handler on djgpp.
26235         * tune/*: Locate data to help direct-mapped caches, add measuring
26236         of mpz_init/clear, mpz_add and mpz_bin_uiui, various cleanups.
26237         * configure.in (AC_CHECK_FUNCS): Add popen.
26239 2000-06-29  Torbjorn Granlund  <tege@swox.com>
26241         * mpf/mul_2exp.c: Streamline criterion for whether to use mpn_lshift or
26242         mpn_rshift.  Increase precision when exp is a multiple of
26243         BITS_PER_MP_LIMB primarily to make exp==0 be a noop.
26244         * mpf/div_2exp.c: Analogous changes.
26246         * mpf/tests/t-dm2exp.c: Set u randomly in loop.  Perform more
26247         mpf_mul_2exp testing.
26249         * configure.in: Recognize cray vector processors with a broad `*';
26250         move after alpha* not to match that.
26252 2000-06-28  Kevin Ryde  <kevin@swox.se>
26254         * mpz/tests/io.c: Use a disk file, not a pipe, switch to ansi2knr
26255         style, switch from MP_INT to mpz_t, add a couple of error checks.
26256         * mpz/tests/Makefile.am (CLEANFILES): Add io.tmp, in case io.c fails.
26258 2000-06-27  Torbjorn Granlund  <tege@swox.com>
26260         * mpf/tests/t-get_d.c: Be more lax about relative error, to handle Cray
26261         floating point format.
26263         * mpq/tests/t-get_d.c: Decrease default reps to 1000.
26265         * mpf/tests/t-conv.c: Correct type of `bexp'.
26267         * configure.in (cray vector machines): Don't inherit gmp_cflags_cc.
26269         * tune/Makefile.am (EXTRA_DIST): Delete sparc64.asm.
26271         * configure.in (cray vector machines): Set extra_functions.
26273         * mpn/cray/mulww.f: New file with vectorizing cray code.
26274         * mpn/cray/mulww.s: Generated from mulww.f.
26275         * mpn/cray/mul_1.c: New file.
26276         * mpn/cray/addmul_1.c: New file.
26277         * mpn/cray/submul_1.c: New file.
26278         * mpn/cray/add_n.c: New file.
26279         * mpn/cray/sub_n.c: New file.
26281 2000-06-26  Kevin Ryde  <kevin@swox.se>
26283         * acinclude.m4 (GMP_CHECK_ASM_ALIGN_FILL_0x90): Fix so it actually
26284         detects solaris 2.6, and also suppress warning on solaris 2.8.
26285         * configure.in (SPEED_CYCLECOUNTER): Remove spurious "athlon" from
26286         sparc case.
26288         * mpn/lisp/gmpasm-mode.el: Move keymap to the top of the docstring.
26290 2000-06-21  Kevin Ryde  <kevin@swox.se>
26292         * mpn/generic/mul_n.c (mpn_kara_mul_n, mpn_kara_sqr_n): Use
26293         mp_size_t for n2.
26294         (mpn_toom3_mul_n, mpn_toom3_sqr_n): Use mp_size_t for size
26295         parameters and "l" variables.
26296         * gmp-impl.h (mpn_toom3_mul_n, mpn_toom3_sqr_n): Update prototypes.
26298         * mpbsd/itom.c, mpbsd/sdiv.c: Add casts for correct handling of
26299         -0x80...00 on systems with sizeof(short)==sizeof(int).
26301         * mpz/tests/t-misc.c: Move "bin" test from here ...
26302         * mpz/tests/t-bin.c: ... to here, and add a new (2k,k) test too.
26303         * mpz/tests/Makefile.am (check_PROGRAMS): Add t-bin.
26305         * mpz/bin_ui.c [_LONG_LONG_LIMB]: Use mpn_divrem_1, since kacc is
26306         a limb not a ulong.
26307         * mpz/bin_uiui.c [_LONG_LONG_LIMB]: Ditto, and use mpn_mul_1 too,
26308         since nacc is a limb.
26310         * mpf/tests/t-misc.c (check_mpf_set_si, check_mpf_cmp_si):
26311         New file, testing mpf_set_si, mpf_init_set_si, and mpf_cmp_si.
26312         * mpf/tests/Makefile.am (check_PROGRAMS): Add it.
26314         * mpz/tests/t-misc.c (check_mpz_set_si, check_mpz_cmp_si):
26315         New tests, for mpz_set_si, mpz_init_set_si, and mpz_cmp_si.
26317         * mpz/set_si.c, mpz/iset_si.c, mpz/cmp_si.c [_LONG_LONG_LIMB]: Fix
26318         handling of -0x80..00.
26319         * mpf/set_si.c, mpf/iset_si.c, mpf/cmp_si.c [_LONG_LONG_LIMB]: Ditto.
26321 2000-06-19  Torbjorn Granlund  <tege@swox.com>
26323         * demos/primes.c: Properly handle arguments `m +n'.
26325 2000-06-17  Torbjorn Granlund  <tege@swox.com>
26327         * config.sub: Recognize k5 and k6 with common pattern.
26329         * mpq/tests/t-get_d.c: Also test mpq_set_d.  Misc improvements.
26331         * mpq/set_d.c: Special case 0.0.  Don't call mpn_rshift with 0 count.
26332         Allocate correct amount of memory for numerator.  Delete spurious
26333         ASSERT_ALWAYS(1).
26335 2000-06-17  Kevin Ryde  <kevin@swox.se>
26337         * mpz/perfsqr.c: Fix so that zero is considered a perfect square.
26338         (Was wrongly calling mpn_perfect_square_p with size==0.)
26340 2000-06-16  Kevin Ryde  <kevin@swox.se>
26342         * configure.in: Set k5*-*-* to use basic i386 code until there's
26343         something specific.  Add path=x86 as a default for x86s.
26345         * acinclude.m4 (GMP_CHECK_ASM_ALIGN_LOG): Generate
26346         ALIGN_LOGARITHMIC setting, not a full ALIGN definition.
26347         (GMP_CHECK_ASM_ALIGN_FILL_0x90): New test.
26348         * configure.in [x86-*-*]: Use GMP_CHECK_ASM_ALIGN_FILL_0x90.
26349         * mpn/asm-defs.m4 (ALIGN): New macro.
26350         * mpn/x86/x86-defs.m4 (ALIGN): Remove supplementary definition.
26352         * tune/*: Plain "unsigned" for speed_cyclecounter.
26353         * configure.in: Use tune/sparcv9.asm for 32 and 64 bit modes.
26354         * tune/sparc64.asm: Remove file.
26356 2000-06-15  Torbjorn Granlund  <tege@swox.com>
26358         * mpn/x86/k7/mmx/copyi.asm: Use `testb' instead of `test'.
26359         * mpn/x86/k7/mmx/copyd.asm: Likewise.
26361         * mpn/x86/k7/mmx/lshift.asm: Avoid using `~' (Solaris as problems).
26362         * mpn/x86/k7/mmx/rshift.asm: Likewise.
26363         * mpn/x86/k6/aors_n.asm: Likewise.
26364         * mpn/x86/k7/aors_n.asm: Likewise.
26365         * mpn/x86/k7/mul_basecase.asm: Likewise.
26367 2000-06-13  Torbjorn Granlund  <tege@swox.com>
26369         * tune/sparcv9.asm: Tune, deleting two instructions.
26371         * tune/alpha.asm: Update to unified speed_cyclecounter.
26373 2000-06-11  Kevin Ryde  <kevin@swox.se>
26375         * mpz/tests/reuse.c (FAIL): Add a K&R version.
26376         Use _PROTO on some typedefs.
26377         * mpz/tests/t-misc.c: Add gmp-impl.h for "const".
26379         * configure.in: Rework mpn multi-function and optional files.
26380         Names standardized, no need for explicit declarations, all picked
26381         up in one $path traversal.
26382         * doc/configuration: Updates.
26384         * tests/rand/t-rand.c (main): Change "usage" to work with K&R.
26386 2000-06-10  Kevin Ryde  <kevin@swox.se>
26388         * mpn/x86/pentium/mmx/popham.asm, mpn/x86/p6/mmx/popham.asm,
26389         mpn/x86/p6/p3mmx/popham.asm, mpn/x86/p6/diveby3.asm: Add
26390         MULFUNC_PROLOGUE for correct HAVE_NATIVE_* matching.
26392         * mpn/x86/x86-defs.m4 (cmov_bytes_tttn): Use eval() on expressions.
26393         (cmov_available_p): Switch to list CPUs which do have cmov.
26394         * mpn/x86/p6/sqr_basecase.asm, mpn/x86/k6/sqr_basecase.asm,
26395         mpn/x86/k7/sqr_basecase.asm: Use eval() for multiplication.
26396         * mpn/x86/README.family: Various updates.
26398 2000-06-09  Kevin Ryde  <kevin@swox.se>
26400         * mpbsd/tests/allfuns.c (main): Call exit() instead of doing return.
26402         * doc/tasks.html, doc/projects.html: Moved from projects directory.
26403         * doc/multiplication: New file.
26404         * Makefile.am (EXTRA_DIST): Remove projects, add doc.
26406         * Makefile.am (libgmp_la_LIBADD, libmp_la_LIBADD): Remove
26407         unnecessary -lm.
26408         * INSTALL: Remove -lm from instructions.
26409         * demos/Makefile.am (qcn_LDADD): Add -lm.
26411         * tune/*: Add measuring for mpn_divrem_2 and modlimb_invert,
26412         improve addsub_n.  Switch to unified speed_cyclecounter.
26413         * configure.in: Update configs for speed_cyclecounter.
26415         * gmp-impl.h (MP_LIMB_T_MAX, MP_LIMB_T_HIGHBIT): New macros.
26416         * mpn/generic/diveby3.c, mpn/generic/mul_n.c, mpn/generic/gcd.c,
26417         tune/speed.c, mpn/tests/ref.c: Use them.
26419         * mpn/tests/spinner.c: Remove setitimer, just alarm is enough.
26420         * configure.in (AC_CHECK_FUNCS): Remove setitimer.
26421         * mpn/tests/x86call.asm: Start with junk in %eax, %ecx, %edx.
26422         * mpn/tests/ref.[ch] (refmpn_addsub_nc): New function.
26423         * mpn/tests/try.c: Add some support for mpn_addsub_nc.
26424         * mpn/tests/Makefile.am (EXTRA_PROGRAMS): Remove addsub_n and
26425         addsub_n_2 which don't currently build.
26426         * mpn/tests/copy.c: Test MPN_COPY_INCR, not __gmpn_copy.
26428         * tests/rand/Makefile.am (libstat_la_LIBADD): Add -lm, no longer on
26429         libgmp.la.
26430         (findlc_LDADD): Use libstat.la.
26431         (AUTOMAKE_OPTIONS): Use ansi2knr.
26433 2000-06-08  Torbjorn Granlund  <tege@swox.com>
26435         * configure.in (alpha*-*-osf*): Default `flavour' to ev6 for ev6 and
26436         higher.
26437         (alpha*-*-*): Likewise.
26438         (alpha*-*-osf*: gmp_optcflags_cc): Move -arch/-tune flags from
26439         gmp_xoptcflags_gcc.
26441         * mpn/Makefile.am (TARG_DIST): Add pa64w.
26443         * longlong.h: Wrap 64-bit hppa code in #ifndef LONGLONG_STANDALONE.
26445 2000-06-07  Torbjorn Granlund  <tege@swox.com>
26447         * mpz/remove.c: Fail for `src' being zero.
26449         * mpz/tests/reuse.c: Test more functions.
26450         (FAIL): New define.
26452         * mpz/tests/t-powm.c: Loop during operand generation while they
26453         are mathematically ill-defined (used to just skip such tests).
26455         * mpz/powm.c (mpz_redc): Clean up argument declarations.
26457         * configure.in (gmp_cflags64_gcc): Don't add bogus -mWHAT option.
26458         (sparcv9-*-solaris2.[7-9]], gmp_cflags64_gcc):
26459         Inherit from previous gmp_cflags64_gcc; pass `-m64 -mptr64'.
26460         (ia64*-*-*): New.
26462         * mpn/generic/dump.c: Make it work when an mp_limb_t is not `long'.
26464         * mpf/set_prc.c: MPN_COPY => MPN_COPY_INCR.
26466 2000-06-06  Torbjorn Granlund  <tege@swox.com>
26468         * mpn/generic/mul_n.c (mpn_toom3_mul_n, mpn_toom3_sqr_n):
26469         Use mpn_incr_u for final carry propagation.
26471         * mpz/tests/t-gcd.c: Add calls to mpz_gcdext with argument t == NULL.
26473         * mpz/tests/reuse.c: Major rewrite; test many more functions.
26475         * mpz/powm_ui.c: When exp is 0, change res assign order in order
26476         to handle argument overlap.
26477         * mpz/powm.c: When exp is 0, change res assign order in order
26478         to handle argument overlap.  Handle negative exp and mod arguments.
26480         * mpz/gcdext.c: Rework code after mpn_gcdext call to handle
26481         argument overlap.
26483         * mpz/fdiv_qr.c: Read dividend->_mp_size before calling mpz_tdiv_qr
26484         in order to handle argument overlap.
26485         * mpz/cdiv_qr.c: Likewise.
26487         * mpf/tests/reuse.c: Fix typo that effectively disabled `dis_funcs'
26488         tests.  Clean up test for mpf_ui_div.
26490 2000-06-06  Kevin Ryde  <kevin@swox.se>
26492         * mpn/x86/p6/sqr_basecase.asm: New file.
26493         * mpn/x86/mod_1.asm: Avoid one conditional jump.
26494         * mpn/x86/p6/gmp-mparam.h: Update thresholds, #ifndef UMUL_TIME
26495         and UDIV_TIME, add COUNT_TRAILING_ZEROS_TIME.
26497         * mp_minv_tab.c: New file.
26498         * Makefile.am (libgmp_la_SOURCES, libmp_la_SOURCES): Add it.
26499         * gmp-impl.h (modlimb_invert): New macro.
26500         * mpz/powm.c: Remove mpz_dmprepare, use modlimb_invert instead.
26501         * mpn/generic/bdivmod.c: Use modlimb_invert instead of a loop.
26502         * mpn/generic/gcd.c: Inline two small mpn_bdivmod calls, use
26503         MPN_COPY_INCR not MPN_COPY in one place.
26505 2000-06-05  Torbjorn Granlund  <tege@swox.com>
26507         * mpf/tests/reuse.c (dsi_funcs): Add mpf_mul_2exp and mpf_div_2exp.
26508         (main): Clean up test for mpf_div_ui.
26510         * mpf/mul_2exp.c: Correct criterion for whether to use mpn_lshift or
26511         mpn_rshift.  MPN_COPY => MPN_COPY_INCR.  Coerce the two assignments to
26512         r->_mp_size.
26514         * mpf/div_2exp.c: Use mpn_rshift instead of mpn_lshift when overlap
26515         so requires.  MPN_COPY => MPN_COPY_INCR.
26517         * mpf/tests/t-dm2exp.c: Correct type of res_prec.
26519 2000-06-04  Kevin Ryde  <kevin@swox.se>
26521         * mpz/bin_uiui.c: Fix result for n==0 and n==k.
26522         * mpz/bin_ui.c: Fix result for k>n, add support for n<0.
26523         * gmp.texi (Number Theoretic Functions): Update mpz_bin_ui to
26524         note n<0 is supported.
26526         * mpz/tests/t-misc.c: New file.
26527         * mpz/tests/Makefile.am (check_PROGRAMS): Add it.
26529 2000-05-31  Kevin Ryde  <kevin@swox.se>
26531         * tune/speed.* (FLAG_R_OPTIONAL): New option for routines, use on
26532         mpn_gcd_1 and mpn_mul_basecase.
26533         * tune/README: Update.
26535         * tune/alpha.asm: New file, by Torbjorn.
26536         * tune/Makefile.am (EXTRA_DIST): Add it.
26537         * configure.in (alpha*-*-*): Use it.
26539 2000-05-31  Linus Nordberg  <linus@swox.se>
26541         * doc/configuration: New file.
26543 2000-05-30  Torbjorn Granlund  <tege@swox.com>
26545         * mpn/generic/mul_basecase.c: Call mpn_mul_2 and mpn_addmul_2
26546         if available.  Don't include longlong.h.
26548         * doc/isa_abi_headache: New file.
26550 2000-05-30  Linus Nordberg  <linus@swox.se>
26552         * configure.in (NM): Use AC_PROG_NM rather than AC_CHECK_TOOL to
26553         find `nm'.  (AC_PROG_NM comes with Libtool and is needed to get
26554         the `-B' option (BSD compatible output) included in $NM.)
26555         (AR): Use AC_CHECK_PROG rather than AC_CHECK_TOOL to find `ar'.
26556         (Now that NM isn't a cross compilation tool, don't give the
26557         impression that we know how to cross compile.)
26558         (CCAS): Remove spurious comment.
26560         * gmp.texi (Notes for Particular Systems): Remove comment about
26561         using GNU `nm' on AIX since system nm now works.
26563 2000-05-29  Torbjorn Granlund  <tege@swox.com>
26565         * mpn/power/mul_1.s: Remove [PR] from first word in function
26566         descriptor.
26567         * mpn/power/addmul_1.s: Likewise.
26568         * mpn/power/submul_1.s: Likewise.
26570 2000-05-28  Kevin Ryde  <kevin@swox.se>
26572         * configure.in, tune/*: Change pentium rdtsc cycle scheme to
26573         HAVE_SPEED_CYCLECOUNTER and SPEED_CYCLECOUNTER_OBJS.
26574         * tune/pentium.asm: Renamed and converted from rdtsc.asm.
26575         * tune/sparcv9.asm: New file, by Torbjorn.
26576         * tune/sparc64.asm: New file.
26577         * tune/tuneup.c: Put a limit on gcdext search.
26579         * gmp.h (mp_set_memory_functions): Add extern "C".
26580         * mp.h (__GNU_MP__): Bump to "3".
26581         * mpz/add.c,mul.c,powm.c,sub.c,sqrtrem.c,tdiv_qr.c [BERKELEY_MP]:
26582         Include mp.h for mpbsd compile.
26583         * mpz/gcd.c: Ditto, and remove _mpz_realloc declaration.
26585         * gmp.texi (Integer Functions): Flatten @subsections into @sections.
26586         (Floating-point Functions): Ditto.
26587         (Integer Random Numbers): Split from miscellaneous as a sep section.
26588         (Installing GMP): Make nodes for the sections.
26589         Add more "@cindex"s.
26590         (Known Build Problems): Remove SunOS get_d problem, believed fixed.
26591         (Notes for Particular Systems): Remove HPPA note since now PIC.
26592         (References): URL for Jebelean.
26594 2000-05-27  Torbjorn Granlund  <tege@swox.com>
26596         * mpn/pa64w: New directory, contents based on corresponding mpn/pa64
26597         files.
26598         * configure.in (hppa2.0w-*-*): New.
26599         * mpz/tests/io.c (_INCLUDE_POSIX_SOURCE): Define when __hpux before
26600         including stdio.h.
26601         * gmp-impl.h: Always define DItype and UDItype.
26603 2000-05-27  Kevin Ryde  <kevin@swox.se>
26605         * tune/common.c (speed_measure): Correction to array sorting,
26606         better diagnostic when measuring fails.
26607         * tune/time.c: Add microsecond accurate getrusage method.
26609         * tune/time.c (speed_cpu_frequency_processor_info): New function.
26610         * configure.in (AC_CHECK_FUNCS): Add processor_info.
26612 2000-05-26  Linus Nordberg  <linus@swox.se>
26614         * gmp.texi (Installing GMP): Shared libraries work for AIX < 4.3
26615         if using GNU nm.
26617 2000-05-26  Torbjorn Granlund  <tege@swox.com>
26619         * tune/tuneup.c (SIGNED_TYPE_MAX): Shift `-1' instead of `1' to
26620         avoid signed overflow.
26622         * demos/pexpr.c (setup_error_handler): Don't call sigaltstack on
26623         Unicos.
26625 2000-05-25  Torbjorn Granlund  <tege@swox.com>
26627         * insert-dbl.c: Work around GCC 2.8 bug.
26628         * extract-dbl.c: Likewise.
26630         * config.sub: Allow i586, i686, i786 again.
26632         * config.guess: Use X86CPU for lots more systems.
26634 2000-05-25  Linus Nordberg  <linus@swox.se>
26636         * mpbsd/tests/dummy.c (main): Call exit() instead of doing return
26637         (some old SysV machines don't get this correct, I've heard.)
26639 2000-05-25  Kevin Ryde  <kevin@swox.se>
26641         * mpf/iset_str.c: Initialize _mp_size and _mp_exp to 0, in case no
26642         digits in string, so it's the same as a separate init and set_str.
26644 2000-05-24  Torbjorn Granlund  <tege@swox.com>
26646         * mpz/tests/reuse.c: Use mpz_random2 instead of mpz_random.
26648         * mpz/divexact.c: Read pointers after reallocation.
26649         Compare `quot' and `den' instead of `qp' and `dp' in overlap check.
26650         Use MPN_COPY_INCR for copying from `np'.
26652         (*-*-aix4.[3-9]*): Disable shared libs just for problematic AIX
26653         versions.
26654         * configure.in (*-cray-unicos*): Disable asm syntax checking; set
26655         compiler explicitly.
26656         * configure.in (hppa*-*-*): Remove code disabling shared libs.
26658 2000-05-24  Linus Nordberg  <linus@swox.se>
26660         * acinclude.m4 (GMP_PROG_CC_WORKS): Don't report progress to user
26661         when doing the AIX specific test to avoid "nested output".
26663 2000-05-22  Kevin Ryde  <kevin@swox.se>
26665         * mp.h (_PROTO): Copy from gmp.h, use on prototypes.
26666         Add extern "C" too.
26667         * mpbsd/tests/Makefile.am (AUTOMAKE_OPTIONS): Enable ansi2knr.
26668         * mpbsd/tests/allfuns.c: Don't execute mout, just link to it.
26669         (main): ANSI style definition.
26671         * gmp-impl.h (MP_BASE_AS_DOUBLE): Change the expression to
26672         something that works on SunOS native cc.  Seems to fix the
26673         mp*_get_d problems.
26675         * mpn/tests/ref.c (refmpn_strip_twos): Use MPN_COPY_INCR.
26676         * mpn/tests/Makefile.am: Let .asm.o rules work with absolute $srcdir.
26678 2000-05-21  Kevin Ryde  <kevin@swox.se>
26680         * mpn/x86/k7/sqr_basecase.asm: Replace file with K7 specific code.
26681         * mpn/x86/k7/README: Update.
26682         * mpn/x86/k7/gmp-mparam.h: Tune thresholds.
26683         (COUNT_TRAILING_ZEROS_TIME): New define.
26684         * mpn/x86/k6/gmp-mparam.h: Ditto.
26686         * mpn/x86/pentium/mmx/popham.asm: New file (include_mpn of K6 version).
26687         * mpn/x86/p6/diveby3.asm: New file (include_mpn of P5 version).
26688         * mpn/x86/p6/mmx/popham.asm: New file (include_mpn of K6 version).
26689         * mpn/x86/p6/p3mmx/popham.asm: New file (include_mpn of K7 version).
26690         * configure.in (pentium3-*-*): Add p3mmx to $path.
26692         * gmp.texi (Integer Arithmetic): Clarify mpz_jacobi op2; add
26693         mpz_*_kronecker_*.
26694         (Miscellaneous Integer Functions): Add mpz_odd_p and mpz_even_p.
26695         (Low-level Functions): Put mpn_divmod_1 with mpn_divrem_1 and note
26696         it's now a macro.
26697         (References): Add Henri Cohen.
26699         * gmp.h (mpn_addmul_1c, mpn_divrem_1c, mpn_mod_1c, mpn_mul_1c,
26700         mpn_submul_1c): Add prototypes.
26701         (mpz_odd_p, mpz_even_p): New macros.
26703         * mpn/asm-defs.m4 (m4wrap_prepend): New macro.
26704         (m4_error): Use it.
26705         (m4_not_for_expansion): Corrections to OPERATION symbols.
26706         More comments about variations between m4 versions.
26707         * mpn/x86/x86-defs.m4 (PROLOGUE): Use m4wrap_prepend (fixes error
26708         exit under BSD m4, previously m4_error printed the message but the
26709         exit code was 0).
26711         * gmp.h (mpn_divmod_1): Change to a macro calling mpn_divrem_1.
26712         * mpn/generic/divrem_1.c: Move divmod_1.c code to here, make it
26713         static and call it __gmpn_divmod_1_internal.
26714         * mpn/generic/divmod_1.c: Remove file.
26715         * configure.in (gmp_mpn_functions): Remove divmod_1.
26716         * mpn/asm-defs.m4 (define_mpn): Remove divmod_1 and divmod_1c.
26717         * compat.c (mpn_divmod_1): Add compatibility function.
26718         * tune/*: Remove mpn_divmod_1 measuring (leave just divrem_1).
26720         * acconfig.h (HAVE_NATIVE_mpn_*): Add some missing carry-in
26721         variants, remove divmod_1.
26723         * mpn/x86/diveby3.asm: Use imul, update comments.
26725         * demos/qcn.c: New file.
26726         * demos/Makefile.am (EXTRA_PROGRAMS): Add it.
26728         * mpz/tests/t-jac.c: New file.
26729         * mpz/tests/Makefile.am (check_PROGRAMS): Add it. Enable ansi2knr.
26731         * mpz/kronsz.c: New file.
26732         * mpz/kronuz.c: New file.
26733         * mpz/kronzs.c: New file.
26734         * mpz/kronzu.c: New file.
26735         * mpz/Makefile.am (libmpz_la_SOURCES): Add them.
26736         * Makefile.am (MPZ_OBJECTS): Add them.
26737         * gmp-impl.h (JACOBI_*, MPN_STRIP_LOW_ZEROS_NOT_ZERO): New macros.
26738         * gmp.h (mpz_*_kronecker_*): New defines and prototypes.
26740         * mpn/generic/jacbase.c: New file.
26741         * mpn/generic/mod_1_rs.c: New file.
26742         * configure.in (gmp_mpn_functions): Add them.
26743         * gmp.h (mpn_jacobi_base, mpn_mod_1_rshift): New defines and
26744         prototypes.
26745         * longlong.h (COUNT_TRAILING_ZEROS_TIME): New define.
26746         * mpn/tests/ref.c (refmpn_mod_1_rshift): New function.
26747         * mpn/tests/try.c: Add mpn_mod_1_rshift.
26748         * tune/*: Add measuring for mpn_jacobi_base.
26750         * acinclude.m4 (GMP_FINISH): Add ifdefs to allow multiple
26751         inclusion of config.m4.
26752         (GMP_PROG_M4): Put "good" message through to config.log.
26754         * mpz/powm.c: Use a POWM_THRESHOLD for where redc stops.
26755         * tune/*: Add mpz_powm measuring, and tune POWM_THRESHOLD.
26756         * gmp-impl.h [TUNE_PROGRAM_BUILD] (POWM_THRESHOLD): Conditional
26757         redefinition for use when tuning.
26759         * mpz/powm_ui.c: Use DIVIDE_BY_ZERO.
26761         * mpz/iset_str.c: Initialize _mp_size to 0, in case no digits in
26762         string; this makes it the same as a separate init and set_str.
26764 2000-05-20  Kevin Ryde  <kevin@swox.se>
26766         * mpn/asm-defs.m4: Note &,|,^ aren't bitwise in BSD m4 eval().
26767         * mpn/x86/k6/sqr_basecase.asm: Use "%" not "&" in m4 eval()s.
26769         * mpn/x86/x86-defs.m4 (Zdisp): Yet more instruction forms.
26771 2000-05-19  Linus Nordberg  <linus@swox.se>
26773         * acinclude.m4 (GMP_CHECK_CC_64BIT): Don't use shell variable
26774         `ac_compile' for our own compile command string since other
26775         Autoconf macros may depend on it.
26777 2000-05-19  Kevin Ryde  <kevin@swox.se>
26779         * mpn/generic/mul_n.c (mpn_toom3_mul_n, mpn_toom3_sqr_n): Fix
26780         carry propagation in final coefficient additions.
26782 2000-05-18  Linus Nordberg  <linus@swox.se>
26784         * configure.in: Set NM before looking for compiler since
26785         GMP_CHECK_CC_64BIT needs it.
26787         * acinclude.m4 (GMP_CHECK_CC_64BIT): Don't execute on target.
26788         (GMP_PROG_CC_FIND): Before checking if the compiler knows how to
26789         produce 64-bit code, verify that it works at all.  The background
26790         is that /usr/ucb/cc on Solaris 7 successfully compiles in 64-bit
26791         mode but fails when doing final link.
26792         (GMP_PROG_CC_WORKS): Report to user what's happening.
26794 2000-05-17  Linus Nordberg  <linus@swox.se>
26796         * config.guess: Use X86CPU for x86 Cygwin.
26798 2000-05-16  Kevin Ryde  <kevin@swox.se>
26800         * mpn/x86/p6/mmx/divrem_1.asm: New file.
26801         * mpn/x86/p6/mmx/mod_1.asm: New file.
26802         * mpn/x86/p6/README: Update.
26803         * mpn/x86/divrem_1.asm: Update comments.
26804         * mpn/x86/mod_1.asm: Ditto.
26806 2000-05-14  Kevin Ryde  <kevin@swox.se>
26808         * tune/speed.h: Run gcd functions on a set of data.
26810         * mpn/tests/try.c: New file.
26811         * mpn/tests/try.h: New file.
26812         * mpn/tests/spinner.c: New file.
26813         * mpn/tests/trace.c: New file.
26814         * mpn/tests/x86call.asm: New file.
26815         * mpn/tests/x86check.c: New file.
26816         * mpn/tests/ref.c (refmpn_hamdist): Allow size==0.
26817         (refmpn_gcd): New function, and other additions supporting it.
26818         * mpn/tests/ref.h: More prototypes.
26819         * mpn/tests/Makefile.am: Add try program, use ansi2knr.
26821         * mpn/x86/k7/mmx/popham.asm: New file.
26822         * mpn/x86/k6/mmx/popham.asm: New file.
26823         * mpn/x86/k6/sqr_basecase.asm: Unroll the addmul, for approx 1.3x
26824         speedup above 15 limbs.
26825         * mpn/x86/k7/README: Update.
26826         * mpn/x86/k6/README: Update, and add notes on plain K6 and pre-CXT
26827         K6-2 problems.
26828         * configure.in (k6*-*-*, athlon-*-*): Add popham.
26830         * mpn/x86/pentium/diveby3.asm: New file.
26831         * mpn/x86/pentium/README: Update.
26833         * gmp.texi (Installing GMP): Add note on bad OpenBSD 2.6 m4.
26834         (Reporting Bugs): Ask for config.m4 if asm file related.
26835         (I/O of Rationals): New section, add mpq_out_str.
26836         (References): Add url for on-line gcc manuals.
26837         A few node and menu updates.
26839         * INSTALL: Better command line argument checking for test progs.
26840         Change MP -> GMP.
26842         * configure.in (WANT_ASSERT, USE_STACK_ALLOC, HAVE_PENTIUM_RDTSC):
26843         Put descriptions here, not in acconfig.h.
26844         (CALLING_CONVENTIONS_OBJS): New AC_SUBST (for mpn/tests/try).
26845         (HAVE_CALLING_CONVENTIONS): New AC_DEFINE.
26846         (AC_CHECK_HEADERS): Add sys/time.h.
26847         (AC_CHECK_FUNCS): Add getpagesize, setitimer.
26848         (KARATSUBA_SQR_THRESHOLD): Strip trailing comments from the
26849         #define when passing through to config.m4.
26850         * acconfig.h (PACKAGE, VERSION, WANT_ASSERT, USE_STACK_ALLOC,
26851         HAVE_PENTIUM_RDTSC): No need for #undefs, autoheader gets them
26852         from configure.in.
26854         * acinclude.m4 (GMP_PROG_M4): Check for broken OpenBSD 2.6 m4
26855         eval(), put messages into config.log.
26856         * mpn/asm-defs.m4: Add notes and test for OpenBSD 2.6 m4.
26858         * mpq/out_str.c: New file.
26859         * mpq/Makefile.am (libmpq_la_SOURCES): Add it.
26860         * Makefile.am (MPQ_OBJECTS): Ditto.
26861         * gmp.h (mpq_out_str): New define and prototype.
26863 2000-05-12  Kevin Ryde  <kevin@swox.se>
26865         * configure.in (CONFIG_TOP_SRCDIR): Fix to use $srcdir not
26866         $top_srcdir (which doesn't exist).
26867         * acinclude.m4 (GMP_C_ANSI2KNR): Fix setting U=_.
26868         * gmp-impl.h (mpn_com_n, MPN_LOGOPS_N_INLINE): Fix missing "do"
26869         (not currently used, probably no ill effect anyway).
26871 2000-05-11  Torbjorn Granlund  <tege@swox.com>
26873         * randraw.c (lc): Major overhaul (pending rewrite).
26874         (_gmp_rand): Rewrite.
26876 2000-05-08  Torbjorn Granlund  <tege@swox.com>
26878         * mpz/tests/convert.c: Call free via _mp_free_func.
26879         * mpf/tests/t-conv.c: Likewise.
26881         * memory.c: Add code enabled for DEBUG that adds special patterns
26882         around allocated blocks.
26884 2000-05-05  Linus Nordberg  <linus@swox.se>
26886         * gmp.texi (Miscellaneous Float Functions): Correct parameter list
26887         for mpf_urandomb().
26889         * configure.in: Invoke AC_REVISION.
26891 2000-05-05  Kevin Ryde  <kevin@swox.se>
26893         * gmp.texi: Use @dircategory and @direntry.
26894         (Installing GMP): Clarification for --target, updates on SunOS
26895         problems.
26896         (Integer Arithmetic): Add mpz_mul_si.
26897         (Initializing Rationals): Add mpq_swap.
26898         (Assigning Floats): Add mpf_swap.
26899         (Low-level Functions): Add mpn_divexact_by3c, and details of what
26900         the calculation actually gives.
26901         (Low-level Functions): Note extra space needed by mpn_gcdext,
26902         clarify the details a bit.
26904         * compat.c: New file, entry points for upward binary compatibility.
26905         (mpn_divexact_by3): Compatibility function.
26906         * Makefile.am (libgmp_la_SOURCES): Add compat.c.
26908         * mpn/tests/ref.c: Rearrange macros for ansi2knr.
26909         (div1): Renamed from div to avoid library function.
26910         (refmpn_divexact_by3c, refmpn_gcd_1, refmpn_popcount,
26911         refmpn_hamdist): New functions.
26912         * mpn/tests/ref.h: Add extern "C", add new prototypes.
26914         * gmp.h (gmp_randinit, etc): Add extern "C".
26915         (_mpq_cmp_ui): Fix prototype name from mpq_cmp_ui.
26916         (mpn_divexact_by3): Now a macro calling mpn_divexact_by3c.
26917         (mpn_divexact_by3c): New prototype and define.
26919         * mpn/x86/diveby3.asm: Change to mpn_divexact_by3c.
26920         * mpn/x86/k6/diveby3.asm: Ditto.
26921         * mpn/generic/diveby3.c: Ditto.
26922         * mpn/asm-defs.m4: Ditto on the define_mpn.
26923         * acconfig.h (HAVE_NATIVE_mpn_divexact_by3c): New define.
26925         * mpq/swap.c: New file, derived from mpz/swap.c.
26926         * mpf/swap.c: Ditto.
26927         * mpq/Makefile.am: Add swap.c.
26928         * mpf/Makefile.am: Ditto.
26929         * Makefile.am: Add two new "swap.lo"s.
26931         * mpn/x86/k6/mmx/com_n.asm: Fix an addressing bug (fortunately
26932         this code hasn't been used anywhere yet).
26934         * mpn/x86/k7/mmx/divrem_1.asm: New file.
26935         * mpn/x86/k7/mmx/mod_1.asm: New file.
26936         * mpn/x86/k7/diveby3.asm: New file.
26937         * mpn/x86/k7/README: Update.
26939         * mpn/x86/k7/aorsmul_1.asm: Use new cmovCC, no object code change.
26940         * mpn/x86/k7/mul_basecase.asm: Ditto.
26941         * mpn/x86/p6/aorsmul_1.asm: Ditto.
26943         * mpn/x86/x86-defs.m4 (defframe_empty_if_zero): Eval the argument.
26944         (cmovCC): New macros, replacing individual cmovCC_reg_reg forms.
26945         (Zdisp): Recognise more instructions.
26946         (shldl,etc): Use m4_instruction_wrapper().
26947         (ASSERT, movl_text_address): New macros.
26949         * mpn/asm-defs.m4: Add remarks on SunOS /usr/bin/m4 and new
26950         OpenBSD m4.
26951         (m4_assert_numargs_internal_check): Remove a spurious parameter.
26952         (m4_empty_if_zero): Eval the argument.
26953         (m4_assert, m4_assert_numargs_range, m4_config_gmp_mparam,
26954         m4_instruction_wrapper): New macros.
26956 2000-05-04  Linus Nordberg  <linus@swox.se>
26958         * gmp.texi (Reporting Bugs): Be explicit about output from running
26959         a command.
26961 2000-05-02  Torbjorn Granlund  <tege@swox.com>
26963         * mpn/generic/bz_divrem_n.c (mpn_bz_divrem_n): Handle non-zero return
26964         from first mpn_bz_div_3_halves_by_2 call.
26965         (mpn_bz_divrem_aux): Likewise.
26967 2000-04-30  Kevin Ryde  <kevin@swox.se>
26969         * tune/* (GCD_ACCEL_THRESHOLD, GCDEXT_THRESHOLD): Tune these.
26971         * mpn/generic/gcdext.c (GCDEXT_THRESHOLD): Rename from THRESHOLD,
26972         use with >=, adjust default to 17 accordingly.
26973         Use new *_SWAP macros.
26975         * mpn/generic/gcd.c (GCD_ACCEL_THRESHOLD): Rename from
26976         ACCEL_THRESHOLD, use with >=, adjust default to 5 accordingly.
26977         Use new *_SWAP macros.
26979         * mpf/get_str.c, mpf/set_str.c, mpf/sub.c, mpz/add.c, mpz/ior.c,
26980         mpz/and.c, mpz/sub.c, mpz/xor.c, mpz/ui_pow_ui.c,
26981         mpn/generic/mul.c: Use new *_SWAP macros.
26983         * stack-alloc.h: Add extern "C" around prototypes.
26985         * gmp-impl.h: (MP_PTR_SWAP, etc): New macros.
26986         (_mp_allocate_func, etc): Use _PROTO.
26987         [TUNE_PROGRAM_BUILD]: More changes in tune program build part.
26989 2000-04-28  Torbjorn Granlund  <tege@swox.com>
26991         * mpn/pa64/add_n.s: Add `,entry' to export directive.
26992         * mpn/pa64/addmul_1.S, mpn/pa64/lshift.s, mpn/pa64/mul_1.S,
26993         mpn/pa64/rshift.s, mpn/pa64/sub_n.s, mpn/pa64/submul_1.S,
26994         mpn/pa64/umul_ppmm.S: Likewise.
26995         * mpn/hppa/hppa1_1/udiv_qrnnd.S: New name for udiv_qrnnd.s.
26996         Add PIC support.
26998 2000-04-29  Kevin Ryde  <kevin@swox.se>
27000         * gmp-impl.h [TUNE_PROGRAM_BUILD] (TOOM3_MUL_THRESHOLD_LIMIT): New
27001         define.
27002         * mpn/generic/mul_n.c [TUNE_PROGRAM_BUILD] (mpn_mul_n): Use
27003         TOOM3_MUL_THRESHOLD_LIMIT, not a hard coded 500.
27005         * memory.c: Use <stdlib.h> for malloc etc, and use _PROTO.
27006         * stack-alloc.c: Don't use C++ reserved word "this".
27007         * urandom.h: Put extern "C" around prototypes.
27008         * mpz/powm.c: Switch a couple of parameters to "const", which they
27009         are, to satisfy g++.
27011         * randraw.c, stack-alloc.c, mpbsd/mout.c, mpbsd/mtox.c: Add casts to
27012         help g++.
27014         * stack-alloc.c: Provide dual ANSI/K&R function definitions.
27015         * mpz/addmul_ui.c,get_d.c,inp_str.c,perfpow.c,powm.c,pprime_p.c,
27016         rrandomb.c,set_str.c,ui_pow_ui.c: Ditto.
27017         * mpf/integer.c,set_str.c: Ditto.
27018         * mpbsd/min.c,xtom.c: Ditto.
27019         * mpn/generic/bz_divrem_n.c,dump.c,gcd_1.c,get_str.c,hamdist.c,
27020         popcount.c,random.c,random2.c,set_str.c: Ditto.
27022         * rand.c: Use <stdio.h> for NULL.
27023         * mpz/gcd_ui.c,gcdext.c,mul.c,perfpow.c,powm_ui.c,root.c,sqrt.c,
27024         sqrtrem.c: Ditto
27025         * mpf/sqrt.c,sqrt_ui.c: Ditto.
27026         * mpn/generic/perfsqr.c,sqrtrem.c: Ditto.
27028         * gmp-impl.h (NULL, malloc, realloc, free): Don't define/declare.
27029         (extern "C"): Add around function prototypes.
27030         (mpn_kara_mul_n, mpn_kara_sqr_n, mpn_toom3_mul_n, mpn_toom3_sqr_n):
27031         Add prototypes.
27032         [TUNE_PROGRAM_BUILD] (FIB_THRESHOLD): Add necessary redefinitions for
27033         use by tune program.
27034         * mpn/generic/mul_n.c: Remove mpn_toom3_mul_n prototype.
27036         * acinclude.m4 (GMP_C_ANSI2KNR): New macro.
27037         (GMP_CHECK_ASM_MMX, GMP_CHECK_ASM_SHLDL_CL): Fix to use
27038         $gmp_cv_check_asm_text which is what GMP_CHECK_ASM_TEXT sets.
27039         * configure.in (GMP_C_ANSI2KNR): Use this instead of AM_C_PROTOTYPES,
27040         for reasons described with its definition.
27042         * demos/Makefile.am (ansi2knr): Use $(top_builddir) nor $(top_srcdir).
27044         * mpz/fib_ui.c (FIB_THRESHOLD): Rename from FIB_THRES, for consistency.
27045         (FIB_THRESHOLD): Conditionalize so gmp-mparam.h can define a value.
27046         (mpz_fib_bigcase): Use >= FIB_THRESHOLD, same as main mpz_fib_ui.
27047         * tune/tuneup.c,Makefile.am (FIB_THRESHOLD): Tune this.
27049         * configure.in (*-*-aix* gmp_m4postinc): Fix setting (don't overwrite
27050         a value just stored).
27052 2000-04-26  Kevin Ryde  <kevin@swox.se>
27054         * mpn/sparc32/udiv_fp.asm: Use mpn_udiv_qrnnd macro.
27055         * mpn/sparc32/udiv_nfp.asm: Ditto.
27056         * mpn/sparc32/v8/supersparc/udiv.asm: Ditto.
27057         * mpn/sparc32/umul.asm: Name the function mpn_umul_ppmm.
27058         * mpn/sparc32/v8/umul.asm: Ditto.
27059         * mpn/powerpc32/umul.asm: Ditto.
27061         * mpn/x86/syntax.h: Remove file, since now unused.
27063         * configure.in (x86): Remove -DBROKEN_ALIGN and -DOLD_GAS
27064         previously used by .S files.
27065         (x86 extra_functions): Add udiv and umul.
27066         (GMP_PROG_M4): Use this instead of AC_CHECK_PROG(M4,m4,...)
27067         (HAVE_NATIVE_*): Loosen up the regexp to "PROLOGUE.*" so as to
27068         accept PROLOGUE_GP on alpha.
27070         * acconfig.h (HAVE_NATIVE_mpn_umul_ppmm, udiv_qrnnd, invert_limb):
27071         New template defines.
27072         * mpn/asm-defs.m4 (mpn_umul_ppmm, mpn_udiv_qrnnd): New define_mpn()s.
27073         * longlong.h (umul_ppmm, udiv_qrnnd): Use a library version if
27074         it's available and an asm macro isn't.
27075         * gmp-impl.h (invert_limb): Ditto.
27077         * gmp-impl.h (ASSERT_NOREALLOC): Not a good idea, remove it.
27079         * acinclude.m4 (GMP_PROG_M4): New macro.
27081 2000-04-25  Linus Nordberg  <linus@swox.se>
27083         * gmp.texi (Random State Initialization): Correct arguments to
27084         `gmp_randinit'.
27086         * acinclude.m4 (GMP_VERSION): Change `eval' --> `m4_eval'.  Fix
27087         from Kevin.
27088         * aclocal.m4: Regenerate.
27090 2000-04-25  Kevin Ryde  <kevin@swox.se>
27092         * mpn/x86/aors_n.asm: Remove parentheses around an immediate that
27093         Solaris "as" doesn't like, change by Torbjorn.
27095 2000-04-24  Kevin Ryde  <kevin@swox.se>
27097         * configure.in (AC_CHECK_FUNCS): Add strtoul.
27099         * mpn/generic/mul_n.c [TUNE_PROGRAM_BUILD] (mpn_mul_n): Bigger
27100         array for karatsuba temporary space for tune program build.
27101         (mpn_toom3_sqr_n) Remove an unused variable.
27103         * demos/Makefile.am (AUTOMAKE_OPTIONS): Add ansi2knr.
27104         Add "allprogs:" pseudo-target.
27105         * demos/factorize.c, demos/isprime.c: Switch to ANSI functions,
27106         rely on ansi2knr.
27108         * gmp.texi (Getting the Latest Version of GMP): Add reference to
27109         ftp.gnu.org mirrors list.
27110         * INSTALL: Add arg count check to example programs.
27112         * mpn/x86/*/*.asm: Convert to FORTRAN ... or rather to
27113         FORTRAN-style "C" commenting to support Solaris "as".
27114         * mpn/x86/x86-defs.m4: Ditto, and add another Zdisp insn.
27115         * mpn/asm-defs.m4 (C): Update comments.
27116         * mpn/x86/README.family: Add a note on commenting, remove
27117         description of .S files.
27119         * mpn/sparc64/addmul_1.asm, mul_1.asm, submul_1.asm: Use
27120         include_mpn().
27122 2000-04-23  Torbjorn Granlund  <tege@swox.com>
27124         * config.sub: Merge with FSF version of April 23.
27126         * mpn/powerpc32: Use dnl/C instead of `#' for comments.
27128         * config.guess: Get "model" limit between pentium 2 and pentium3 right.
27129         Get rid of code determining `_' prefix; use double labels instead.
27130         * config.guess: Partially merge with FSF version of April 22.
27131         (Don't bring over NetBSD changes for now.)
27133 2000-04-23  Kevin Ryde  <kevin@swox.se>
27135         * tune/Makefile.am, tune/README, tune/common.c, tune/rdtsc.asm,
27136         tune/speed.c, tune/speed.h, tune/time.c, tune/tuneup.c: New files.
27137         * tune/Makefile.in: New file, generated from Makefile.am.
27139         * gmp-impl.h (ASSERT_NOREALLOC,TMP_ALLOC_LIMBS): New macros.
27140         [TUNE_PROGRAM_BUILD] Further mods for tune program builds.
27142         * mpz/Makefile.am: Add -DOPERATION_$* for new mul_siui.c.
27143         Add rules to build mul_si and mul_ui from a common mul_siui.c.
27144         * mpz/mul_siui.c: New file, derived from and replacing mul_ui.c.
27145         * gmp.h (mpz_mul_si): New prototype and define.
27147         * mpn/tests/*.c [__i386__] (CLOCK): Don't use floating point in
27148         CLOCK because cpp can't handle floats in #if's (TIMES is derived
27149         from CLOCK by default).
27151         * mpn/asm-defs.m4 (include_mpn): New macro.
27152         (m4_assert_numargs) Changes to implementation.
27154         * mpf/Makefile.am: Add -DOPERATION_$* for new integer.c.
27155         Remove explicit rules for floor.o etc.
27156         * mpf/integer.c: Use OPERATION_$* for floor/ceil/trunc.
27158         * mpn/Makefile.am: Put "tests" in SUBDIRS.
27159         * mpn/tests/Makefile.am: New file providing rules to build test
27160         programs, nothing done in a "make all" or "make check" though.
27161         * mpn/tests/README: New file.
27163         * acconfig.h (HAVE_PENTIUM_RDTSC): New define.
27165         * configure.in (x86): Rearrange target cases.
27166         Add mulfunc aors_n and aorsmul_1 for x86 and pentium (now all x86s).
27167         Remove asm-syntax.h generation not needed.
27168         Remove now unused family=x86.
27169         (sparc) Remove unused family=sparc.
27170         (HAVE_PENTIUM_RDTSC) New AC_DEFINE and AM_CONDITIONAL.
27171         (AM_C_PROTOTYPES) New test, supporting ansi2knr.
27172         (AC_CHECK_HEADERS) Add getopt.h, unistd.h and sys/sysctl.h for
27173         tune progs.
27174         (AC_CHECK_FUNCS) Add getopt_long, sysconf and sysctlbyname for
27175         tune progs.
27176         (config.m4 CONFIG_TOP_SRCDIR) Renamed from CONFIG_SRCDIR.
27177         (config.m4 asm-defs.m4) Use CONFIG_TOP_SRCDIR and include().
27178         (gmp_m4postinc) Use include_mpn().
27179         (gmp_links) Omit asm-defs.m4/asm.m4 and gmp_m4postinc's.
27180         (MULFUNC_PROLOGUE) Fix regexps so all functions get AC_DEFINE'd.
27181         (PROLOGUE) Ditto (native copyi and copyd were unused in gmp 3).
27182         (KARATSUBA_SQR_THRESHOLD) Copy from gmp-mparam.h into config.m4.
27183         (AC_OUTPUT) Add tune/Makefile, mpn/tests/Makefile.
27185         * Makefile.am (AUTOMAKE_OPTIONS): Add ansi2knr.
27186         (SUBDIRS): Add tune, reorder directories.
27187         (MPZ_OBJECTS): Add mpz/mul_si.lo.
27188         (libmp_la_SOURCES): Use this for top-level objects, not .lo's.
27189         * ansi2knr.c, ansi2knr.1: New files, provided by automake.
27191         * mpn/x86/aors_n.asm: Convert add_n.S and sub_n.S to a
27192         multi-function aors_n.asm, no object code change.
27193         * mpn/x86/pentium/aors_n.asm: Ditto.
27194         * mpn/x86/aorsmul_1.asm: Ditto for addmul/submul.
27195         * mpn/x86/pentium/aorsmul_1.asm: Ditto.
27197         * mpn/x86/lshift.asm, mpn/x86/mul_1.asm, mpn/x86/mul_basecase.asm,
27198         mpn/x86/rshift.asm: Convert from .S, no object code change.
27199         * mpn/x86/pentium/lshift.asm, mpn/x86/pentium/mul_1.asm,
27200         mpn/x86/pentium/mul_basecase.asm, mpn/x86/pentium/rshift.asm: Ditto.
27202         * gmp.texi (Reporting Bugs): Itemize the list of things to include.
27203         (Miscellaneous Float Functions): Correct typo in mpf_ceil etc
27204         argument types.
27205         Change @ifinfo -> @ifnottex for benefit of makeinfo --html.
27206         Remove unnecessary @iftex's around @tex.
27208 2000-04-22  Torbjorn Granlund  <tege@swox.com>
27210         * config.guess: Generalize x86 cpu determination code.
27211         Now works on Solaris.
27213         * mpz/nextprime.c: Rewrite still disabled code.
27215         * configure.in: Specifically match freebsd[3-9].
27217 2000-04-21  Torbjorn Granlund  <tege@swox.com>
27219         * rand.c: Call mpz_clear for otherwise leaking mpz_t.
27221         * mpz/pprime_p.c (mpz_probab_prime_p): Merge handling of negative
27222         n into code for handling small positive n.  Merge variables m and n.
27223         After dividing, simply call mpz_millerrabin.
27224         (isprime): Local variables now use attribute `long'.
27225         (mpz_millerrabin): New static function, based on code from
27226         mpz_probab_prime_p.
27227         (millerrabin): Now simple workhorse for mpz_millerrabin.
27229 2000-04-19  Torbjorn Granlund  <tege@swox.com>
27231         * gmp-impl.h: Fix parenthesis error in test for __APPLE_CC__.
27233 2000-04-18  Linus Nordberg  <linus@swox.se>
27235         * NEWS: Add info about shared libraries.  Remove reference to
27236         gmp_randinit_lc.
27238 2000-04-17  Torbjorn Granlund  <tege@swox.com>
27240         * Version 3.0 released.
27242         * mpn/arm/add_n.S: New version from Robert Harley.
27243         * mpn/arm/addmul_1.S: Likewise.
27244         * mpn/arm/mul_1.S: Likewise.
27245         * mpn/arm/sub_n.S: Likewise.
27247         * gmp.h (__GNU_MP_VERSION_PATCHLEVEL): Now 0.
27249 2000-04-17  Linus Nordberg  <linus@swox.se>
27251         * configure.in (hppa2.0*-*-*): Pass `+O3' to cc/c89 in 64-bit mode
27252         to avoid compiler bug.
27253         (ns32k*-*-*): Fix typo in path.  Change by Kevin.
27254         (alpha*-*-osf*): New case.  Pass assembly flags for architecture
27255         to gcc.
27256         (alpha*-*-*): Don't bother searching for cc.
27257         * configure: Regenerate.
27259         * Makefile.am (EXTRA_DIST): Add `macos', `.gdbinit'.
27260         * Makefile.in: Regenerate.
27261         * mpn/Makefile.am (EXTRA_DIST): Add `m88k', `lisp'.
27262         * mpn/Makefile.in: Regenerate.
27264 2000-04-16  Kevin Ryde  <kevin@swox.se>
27266         * README: Updates, and don't duplicate the example in INSTALL.
27267         * INSTALL: Minor updates.
27268         * gmp.texi (Installing MP): Minor edits, restore CC/CFLAGS description.
27270 2000-04-16  Linus Nordberg  <linus@swox.se>
27272         * configure.in (*-*-cygwin*): Select BSD_SYNTAX to avoid
27273         .type/.size in PROLOGUE for ELF_SYNTAX.  Override ALIGN definition
27274         from x86/syntax.h.
27275         (gmp_xoptcflags_${CC}): New set of variables, indicating
27276         ``exclusive optional cflags''.
27277         (most sparcs): Use gmp_xoptcflags instead of gmp_optcflags to
27278         ensure that we pass CPU type to older gcc.
27279         (CFLAGS): CFLAGS on the command line was spoiled.
27280         * configure: Regenerate.
27282 2000-04-16  Linus Nordberg  <linus@swox.se>
27284         * configure.in: Invoke AC_PROG_LIBTOOL directly.
27286         * acinclude.m4 (GMP_PROG_CC_FIND): Quote source variable when
27287         setting CC64 and CFLAGS64.
27288         (GMP_PROG_CC_SELECT): Cache result.
27289         (GMP_PROG_LIBTOOL): Remove.
27291         * aclocal.m4: Regenerate.
27292         * configure: Regenerate.
27294 2000-04-16  Linus Nordberg  <linus@swox.se>
27296         * tests/rand/t-rand.c (main): Add non-ANSI function declaration.
27297         Don't use `const'.
27299 2000-04-16  Torbjorn Granlund  <tege@swox.com>
27301         * mpn/generic/dump.c: Suppress output of leading zeros.
27303         * mpz/inp_str.c: Fix memory leakage.
27305         * mpz/tests/reuse.c (dss_func_division): Add a final 1.
27307         * longlong.h (alpha count_leading_zeros): Wrap in __MPN.
27308         * mpn/alpha/cntlz.asm: Use __gmpn prefix (by means of __MPN).
27310         * longlong.h (__umul_ppmm, __udiv_qrnnd): Wrap in __MPN.
27311         * mpn/alpha/udiv_qrnnd.S: Use __gmpn prefix.
27312         * mpn/hppa/udiv_qrnnd.s: Likewise.
27313         * mpn/hppa/hppa1_1/udiv_qrnnd.s: Likewise.
27314         * mpn/pa64/udiv_qrnnd.c: Likewise (by means of __MPN).
27315         * mpn/pa64/umul_ppmm.S: Likewise.
27316         * mpn/sparc32/udiv_fp.asm: Likewise (by means of MPN).
27317         * mpn/sparc32/udiv_nfp.asm: Likewise (by means of MPN).
27318         * mpn/sparc32/v8/supersparc/udiv.asm: Likewise (by means of MPN).
27320         * mpn/generic/tdiv_qr.c: Work around gcc 2.7.2.3 i386 register handling
27321         bug.
27323         * mpn/generic/tdiv_qr.c: Use udiv_qrnnd instead of mpn_divrem_1
27324         when computing appropriate quotient; mpn_divrem_1 writes too
27325         many quotient limbs.
27327         * mpn/asm-defs.m4: invert_normalized_limb => invert_limb.
27328         * mpn/alpha/invert_limb.asm: mpn_invert_normalized_limb =>
27329         mpn_invert_limb.
27330         * gmp.h: Likewise.
27331         * gmp-impl.h (alpha specific): invert_normalized_limb => invert_limb;
27332         wrap with __MPN.
27333         * longlong.h (alpha udiv_qrnnd): Likewise.
27335 2000-04-16  Kevin Ryde  <kevin@swox.se>
27337         * gmp.h (mp_set_memory_functions,mp_bits_per_limb,gmp_errno): Add
27338         #defines so the library symbols are __gmp_*.
27339         * errno.c: Include gmp.h.
27340         * gmp-impl.h (_mp_allocate_func,etc): Add #defines to __gmp_*.
27341         (__clz_tab): New #define to __MPN(clz_tab).
27342         * stack-alloc.c (__gmp_allocate_func,etc): Change from _mp_*.
27344         * Makefile.am (libmp_la_DEPENDENCIES): Add some mpz files needed
27345         for new mpz_powm (pow in libmp).
27346         (EXTRA_DIST): Add projects directory.
27348         * mpn/*: Change __mpn to __gmpn.
27349         * gmp.h (__MPN): Ditto.
27350         * stack_alloc.c,stack-alloc.h: Change __tmp to __gmp_tmp.
27352         * mpn/generic/sb_divrem_mn.c (mpn_sb_divrem_mn): Avoid gcc 2.7.2.3
27353         i386 register handling bug (same as previously in mpn_divrem_classic).
27355         * mpn/generic/divrem.c: Now contains mpn_divrem, which is not an
27356         internal function, so remove warning comment.
27358         * gmp.texi (Compatibility with Version 2.0.x): Source level only.
27360 2000-04-16  Linus Nordberg  <linus@swox.se>
27362         * configure.in (hppa1.0*): Prefer c89 to cc.
27363         * configure: Regenerate.
27365 2000-04-15  Linus Nordberg  <linus@swox.se>
27367         * configure.in: If `mpn_path' is set by user on configure command
27368         line, use that as path.
27369         * configure: Regenerate.
27371 2000-04-15  Linus Nordberg  <linus@swox.se>
27373         * configure.in (hppa2.0*): Use path "hppa/hppa1_1 hppa" if no
27374         64-bit compiler was found.
27375         * configure: Regenerate.
27377 2000-04-15  Linus Nordberg  <linus@swox.se>
27379         * configure.in: Honor `CC' and `CFLAGS' set by user on configure
27380         command line.
27381         * acinclude.m4: (GMP_PROG_CC_SELECT): Set CFLAGS if not set already.
27382         * aclocal.m4: Regenerate.
27383         * configure: Regenerate.
27385 2000-04-15  Linus Nordberg  <linus@swox.se>
27387         * acinclude.m4 (GMP_PROG_CC_FIND): Remove debug output.  Remove
27388         commented out code.
27389         * aclocal.m4: Regenerate.
27390         * configure: Regenerate.
27392         * configure.in: Make all `-mcpu' options to gcc optional.
27393         * configure: Regenerate.
27395         * tests/rand/Makefile.am: Don't do anything for target 'all'.
27396         * tests/rand/Makefile.in: Regenerate.
27398 2000-04-15  Kevin Ryde  <kevin@swox.se>
27400         * README: Small updates.
27401         * NEWS: Add some things about 3.0.
27403         * mpz/Makefile.am (EXTRA_DIST): Remove dmincl.c.
27405         * Makefile.am: Use -version-info on libraries, not -release.
27407         * mpz/tdiv_qr.c: Add mdiv function header #ifdef BERKELEY_MP.
27408         * mpbsd/Makefile.am: Use mpz/tdiv_qr.c, not mdiv.c.
27409         * Makefile.am (MPBSD_OBJECTS): Change mdiv.lo to tdiv_qr.lo.
27410         (libmp_la_DEPENDENCIES): Add mp_clz_tab.lo.
27411         * mpbsd/mdiv.c: Remove file.
27413         * config/mt-linux,mt-m68k,mt-m88110,mt-ppc,mt-ppc64-aix,mt-pwr,
27414         mt-sprc8-gcc,mt-sprc9-gcc,mt-supspc-gcc,mt-vax,mt-x86,
27415         mpn/config/mt-pa2hpux,mt-sprc9,t-oldgas,t-ppc-aix,t-pwr-aix:
27416         Remove configure fragments not used since change to autoconf.
27418         * mpn/generic/bz_divrem_n.c,sb_divrem_mn.c: Add comment that
27419         internal functions are changeable and shouldn't be used directly.
27421 2000-04-15  Linus Nordberg  <linus@swox.se>
27423         * configure.in: Remove debug output.
27424         * configure: Regenerate.
27426 2000-04-15  Torbjorn Granlund  <tege@swox.com>
27428         * mpn/generic/tdiv_qr.c: Don't use alloca directly.
27430         * mpz/tdiv_qr.c: Fix typo.
27431         * mpz/tdiv_r.c: Fix typo.
27432         * mpz/tdiv_q.c: Fix typo.
27434         * configure.in: Disable -march=pentiumpro due to apparent compiler
27435         problems.
27437         * mpz/powm.c: Replace with new code from Paul Zimmermann.
27439         * mpz/tdiv_q.c: Remove debug code.
27441         * mpn/generic/divrem.c: Remove C++ style `//' commented-out code.
27442         * mpn/generic/sb_divrem_mn.c: Likewise.
27444 2000-04-14  Torbjorn Granlund  <tege@swox.com>
27446         * mpz/cdiv_q.c: Change temp allocation for new requirements of
27447         mpz_tdiv_qr.
27448         * mpz/fdiv_q.c: Likewise.
27450         * mpn/sparc64/gmp-mparam.h: Set up parameters for TOOM3.
27452         * mpz/dmincl.c: Delete file.
27453         * mpz/tdiv_qr.c: Rewrite using mpn_tdiv_qr.
27454         * mpz/tdiv_r.c: Likewise.
27455         * mpz/tdiv_q.c: Likewise.
27457         * mpn/generic/tdiv_qr.c: New file.
27458         * mpn/generic/bz_divrem_n.c: New file.
27459         * mpn/generic/sb_divrem_mn.c: New file.
27461         * gmp-impl.h (MPZ_REALLOC): New macro.
27462         (mpn_sb_divrem_mn): Declare.
27463         (mpn_bz_divrem_n): Declare.
27464         (mpn_tdiv_qr): Declare.
27466         * configure.in (gmp_mpn_functions): Delete divrem_newt and divrem_1n;
27467         add tdiv_qr, bz_divrem_n, and sb_divrem_mn.
27468         * mpn/generic/divrem_newt.c: Delete file.
27469         * mpn/generic/divrem_1n.c: Delete file.
27471         * gmp.h (mpn_divrem_newton): Remove declaration.
27472         (mpn_divrem_classic): Remove declaration.
27474         * gmp.h (mpn_divrem): Remove function definition.
27475         * mpn/generic/divrem.c: Replace mpn_divrem_classic with a
27476         mpn_divrem wrapper.
27478 2000-04-14  Kevin Ryde  <kevin@swox.se>
27480         * mpf/dump.c, mpz/dump.c, mpn/generic/dump.c,
27481         mpn/generic/divrem.c, mpn/generic/divrem_1n.c,
27482         mpn/generic/divrem_2.c, mpn/generic/divrem_newt.c,
27483         mpn/generic/mul.c, mpn/generic/mul_basecase.c,
27484         mpn/generic/mul_n.c, mpn/generic/sqr_basecase.c,
27485         mpn/generic/udiv_w_sdiv.c: Add comment that internal functions are
27486         changeable and shouldn't be used directly.
27488         * mpq/div.c: Use DIVIDE_BY_ZERO (previously didn't get an
27489         exception on zero divisor).
27491         * mpf/tests/t-get_d.c, mpz/tests/reuse.c: Add K&R function
27492         definitions.
27493         * mpz/tests/t-2exp.c: Don't use ANSI-ism 2ul.
27495         * gmp.texi (Installing MP): Build problem notes for GSYM_PREFIX
27496         and ranlib on native SunOS.
27497         Particular systems notes about AIX and HPPA shared libraries
27498         disabled.
27499         (MP Basics): Add that undocumented things shouldn't be used.
27500         (Introduction to MP): Add to CPUs listed.
27502         * acinclude.m4 (GMP_CHECK_ASM_UNDERSCORE): Don't depend on C
27503         having "void".
27505 2000-04-13  Linus Nordberg  <linus@swox.se>
27507         * mpn/pa64/udiv_qrnnd.c (__udiv_qrnnd64): Add K&R function
27508         definition.
27510         * configure.in: Disable shared libraries for hppa*.
27511         (mips-sgi-irix6.*): Fix flags for 64-bit gcc.
27512         (hppa2.0*-*-*): Prefer c89 to cc.
27513         * configure: Regenerate.
27515         * gmp.h (gmp_randalg_t): Remove comma after last element.
27517         * tests/rand/t-rand.c: Add copyright notice.
27519 2000-04-13  Kevin Ryde  <kevin@swox.se>
27521         * mpn/generic/mul_n.c, mpn/generic/gcdext.c, mpz/nextprime.c,
27522         mpz/remove.c, mpz/root.c: Add K&R function definitions.
27523         * mpz/rrandomb.c: Fix typo in K&R part.
27524         * stack-alloc.c: Add K&R style function pointer declarations.
27526         * mpz/root.c: Use SQRT_OF_NEGATIVE on even roots of negatives.
27527         Use DIVIDE_BY_ZERO on a "zero'th" root.
27529         * configure: Regenerate with autoconf backpatched to fix --srcdir
27530         absolute path wildcards that bash doesn't like, change by Linus.
27532         * gmp.texi (Integer Arithmetic): Document mpz_nextprime.
27533         (Miscellaneous Integer Functions): Fix mpz_fits_* formatting.
27534         (Installing MP): Comment-out CC and CFLAGS description.
27536 2000-04-13  Linus Nordberg  <linus@swox.se>
27538         * rand.c (gmp_randinit): Don't combine va_alist with ordinary
27539         arguments for non STDC.
27541 2000-04-13  Torbjorn Granlund  <tege@swox.com>
27543         * mpz/nextprime.c: Use proper names of new random types and functions.
27545         * mpz/rrandomb.c: New file.
27546         * mpz/Makefile.am: List it.
27547         * mpz/Makefile.in: Regenerate.
27548         * Makefile.am: Here too.
27549         * Makefile.in: Regenerate.
27550         * gmp.h: Declare mpz_rrandomb.
27552 2000-04-12  Linus Nordberg  <linus@swox.se>
27554         * Makefile.am, demos/Makefile.am, mpbsd/Makefile.am,
27555         mpbsd/tests/Makefile.am, mpf/Makefile.am, mpf/tests/Makefile.am,
27556         mpn/Makefile.am, mpq/Makefile.am, mpq/tests/Makefile.am,
27557         mpz/Makefile.am, mpz/tests/Makefile.am, tests/Makefile.am,
27558         tests/rand/Makefile.am (AUTOMAKE_OPTIONS): Add 'no-dependencies'.
27560         * Makefile.in, demos/Makefile.in, mpbsd/Makefile.in,
27561         mpbsd/tests/Makefile.in, mpf/Makefile.in, mpf/tests/Makefile.in,
27562         mpn/Makefile.in, mpq/Makefile.in, mpq/tests/Makefile.in,
27563         mpz/Makefile.in, mpz/tests/Makefile.in, tests/Makefile.in,
27564         tests/rand/Makefile.in: Regenerate.
27566 2000-04-12  Linus Nordberg  <linus@swox.se>
27568         * randlc.c (gmp_randinit_lc): Disable function.
27569         * gmp.texi (Random State Initialization): Remove gmp_randinit_lc.
27571         * acinclude.m4 (GMP_CHECK_CC_64BIT): Compiling an empty main
27572         successfully with `-n32' will have to suffice on irix6.
27573         * aclocal.m4: Regenerate.
27575         * configure.in (sparc): Don't pass -D_LONG_LONG_LIMB to compiler.
27576         (mips-sgi-irix6.*): Use compiler option `-n32' rather than `-64'
27577         for 64-bit `cc'.  Add options for gcc.
27578         * configure: Regenerate.
27580         * mpf/urandomb.c (mpf_urandomb): Add third parameter 'nbits'.  If
27581         'nbits' doesn't make even limbs, shift up result before
27582         normalizing.
27584         * gmp.h (mpf_urandomb): Add parameter to prototype.
27586         * mpf/urandom.c: Rename file to ...
27587         * mpf/urandomb.c: ... this.
27588         * Makefile.am (MPF_OBJECTS): Change urandom.lo --> urandomb.lo.
27589         * Makefile.in: Regenerate.
27590         * mpf/Makefile.am (libmpf_la_SOURCES): Change urandom.c --> urandomb.c.
27591         * mpf/Makefile.in: Regenerate.
27593         * config.in: Regenerate for HAVE_DECL_OPTARG.
27595         * randraw.c (_gmp_rand): Fix bug with _LONG_LONG_LIMB.
27596         (lc): Change return type.
27597         Use one temporary storage instead of two.
27598         Handle seed of size 0.
27599         Avoid modulus operation in some cases.
27600         Abort if M is not a power of 2.
27601         Fix bug with 64-bit limbs.
27602         Fix bug with small seed, small A and large M.
27604         * tests/rand/gen.c (main): Include gmp.h.  Remove macros MIN, MAX.  Add
27605         option '-q'.  Don't demand argument N.  Change parameters in call
27606         to mpf_urandomb.
27608         * tests/rand/t-rand.c: New file for testing random number generation.
27610         * tests/rand/Makefile.am: Run t-rand for 'make check'.
27611         (test, bigtest): Rename to manual-test, manual-bigtest.
27612         * tests/rand/Makefile.in: Regenerate.
27614 2000-04-12  Kevin Ryde  <kevin@swox.se>
27616         * gmp-impl.h: Include config.h before TMP_ALLOC, so
27617         --disable-alloca works.
27619         * mpbsd/Makefile.am: Don't recompile top-level sources here.
27620         * Makefile.am (libmp_la_DEPENDENCIES): Put objects here instead,
27621         add errno.lo and stack-alloc.lo.
27623         * mpn/asm-defs.m4: Add a test and message for the unsuitable SunOS m4.
27624         * gmp.texi (Installing MP): Update note on SunOS m4 failure.
27626         * acconfig.h: Add copyright notice using @TOP@.
27628         * stack-alloc.c: Use _mp_allocate_func, not malloc.
27629         * gmp.texi (Installing MP): Note this under --disable-alloca.
27631         * gmp.texi (Comparison Functions): mpz_cmp_abs => mpz_cmpabs.
27632         (Integer Arithmetic): mpz_prime_p not yet implemented, comment out.
27633         (Float Arithmetic): mpf_pow_ui now implemented, uncomment-out.
27634         (Miscellaneous Float Functions): Add mpf_ceil, mpf_floor, mpf_trunc.
27635         (Low-level Functions): Add mpn_random2, with mpn_random.
27637         * mpn/m68k/mc68020/udiv.S: Rename from udiv.s.
27638         * mpn/m68k/mc68020/umul.S: Ditto.
27640         * mpn/alpha/umul.asm: Rename from umul.s, remove .file and
27641         compiler identifiers.
27643         * mpn/powerpc32/syntax.h: Removed, no longer used.
27645         * mpn/a29k/udiv.s: Remove .file and compiler identifiers.
27646         * mpn/a29k/umul.s: Ditto.
27648         * mpn/tests/ref.c: Use WANT_ASSERT.
27649         * mpn/tests/ref.h: Use _PROTO.
27651         * mpbsd/configure.in: Removed, no longer required.
27653         * mpf/div.c: Use DIVIDE_BY_ZERO.
27654         * mpf/div_ui.c: Ditto.
27655         * mpf/ui_div.c: Ditto.
27656         * mpq/inv.c: Ditto.
27657         * mpf/sqrt.c: Use SQRT_OF_NEGATIVE.
27658         * mpz/sqrt.c: Ditto.
27659         * mpz/sqrtrem.c: Ditto.
27661         * gmp-impl.h (GMP_ERROR,SQRT_OF_NEGATIVE): New macros.
27662         (DIVIDE_BY_ZERO): Use GMP_ERROR.
27663         (__mp_bases): #define to __MPN(mp_bases).
27665 2000-04-11  Linus Nordberg  <linus@swox.se>
27667         * tests/rand/stat.c (main): Initialize `l1runs' at declaration.
27669 2000-04-11  Kevin Ryde  <kevin@swox.se>
27671         * mpz/fib_ui.c: Add K&R function definitions.
27673         * mpbsd/tests/Makefile.am (TESTS): Add a dummy test to avoid a
27674         shell problem with an empty "for tst in $(TESTS) ; ...".
27675         * mpbsd/tests/dummy.c: New file.
27677 2000-04-10  Torbjorn Granlund  <tege@swox.com>
27679         * mpz/bin_uiui.c: Delete several unused variables.
27680         Add copyright notice.
27681         * mpz/bin_ui.c: Add copyright notice.
27683         * longlong.h: Declare __count_leading_zeros for alpha.
27685 2000-04-10  Linus Nordberg  <linus@swox.se>
27687         * rand.c (gmp_randinit): Change parameter list to (rstate, alg, ...).
27688         * gmp.h: Change prototype accordingly.
27689         * mpz/pprime_p.c (millerrabin): Change call accordingly.
27691         * configure.in: Check for `optarg'.
27692         * configure: Regenerate.
27694         * mpn/Makefile.am: Remove incorrect comment.
27695         * mpn/Makefile.in: Regenerate.
27697         * gmp.h: Rename most of the random number functions, structs and some
27698         of the struct members.
27699         * rand.c (gmp_randinit): Likewise.
27700         * randclr.c (gmp_randclear): Likewise.
27701         * randlc.c (gmp_randinit_lc): Likewise.
27702         * randlc2x.c (gmp_randinit_lc_2exp): Likewise.
27703         * randraw.c (lc): Likewise.
27704         (_gmp_rand_getraw): Likewise.
27705         * randsd.c (gmp_randseed): Likewise.
27706         * randsdui.c (gmp_randseed_ui): Likewise.
27707         * gmp.texi: Likewise.
27709         * gmp.texi: Use three hyphens for a dash.
27710         (Low-level Functions): Remove documentation for gmp_rand_getraw.
27711         (Random Number Functions): Add info on where to find documentation
27712         on the random number functions.
27714         * tests/rand/Makefile.am (test, bigtest): Quote argument to grep.
27715         * tests/rand/Makefile.in: Regenerate.
27717         * tests/rand/gen.c: Declare optarg, optind, opterr if not already
27718         declared.
27719         (main): Use new names for the random stuff.
27720         (main): Don't use strtoul() if we don't have it.  Use strtol()
27721         instead, if we have it.  Otherwise, use atoi().
27722         (main): Use srandom/srandomdev for __FreeBSD__ only.
27723         (main): Use new parameter order to gmp_randinit().
27725         * tests/rand/stat.c: Declare optarg, optind, opterr if not already
27726         declared.
27728 2000-04-10  Torbjorn Granlund  <tege@swox.com>
27730         * mpz/pprime_p.c: Pass 0L for mpz_scan1.  mpz_mmod => mpz_mod.
27731         (millerrabin): Use new random interface.
27732         (millerrabin): ... and don't forget to call gmp_randclear.
27734         * mpz/nextprime.c: New file.
27735         * gmp.h: Declare mpz_nextprime.
27736         * mpz/Makefile.am: List nextprime.c.
27737         * mpz/Makefile.in: Regenerate.
27738         * Makefile.am: List mpz/nextprime.lo.
27739         * Makefile.in: Regenerate.
27741 2000-04-10  Kevin Ryde  <kevin@swox.se>
27743         * move-if-change, mpz/tests/move-if-change, mpq/tests/move-if-change,
27744         mpf/tests/move-if-change: Remove, no longer used.
27746         * Makefile.am (SUBDIRS): Add tests, demos, mpbsd.
27747         (libmp.la): New target, conditional on WANT_MPBSD.
27748         (libgmp_la_LIBADD): Add -lm.
27749         (AUTOMAKE_OPTIONS): Add check-news.
27750         (include_HEADERS): Setup to install gmp.h and possibly mp.h.
27751         (DISTCLEANFILES): Add generated files.
27752         (check): Remove explicit target (now uses check-recursive).
27754         * configure.in: Use AM_CONFIG_HEADER.
27755         Add --enable-mpbsd setting automake conditional WANT_MPBSD.
27756         Output demos/Makefile, mpbsd/Makefile and mpbsd/tests/Makefile.
27758         * mpz/Makefile.am: Add SUBDIRS=tests, shorten INCLUDES since now
27759         using AM_CONFIG_HEADER.
27760         * mpq/Makefile.am: Ditto.
27761         * mpf/Makefile.am: Ditto, and add DISTCLEANFILES.
27762         * mpn/Makefile.am: Shorten INCLUDES, amend some comments.
27763         * mpz/tests/Makefile.am: Use TESTS and $(top_builddir).
27764         * mpf/tests/Makefile.am: Ditto.
27765         * mpq/tests/Makefile.am: Ditto.
27766         * demos/Makefile.am: New file.
27768         * mpbsd/Makefile.am: New file, derived from old mpbsd/Makefile.in.
27769         * mpbsd/Makefile.in: Now generated from Makefile.am.
27770         * mpbsd/realloc.c: Removed, use mpz/realloc.c instead.
27771         * mpbsd/tests/Makefile.am: New file.
27772         * mpbsd/tests/Makefile.in: New file, generated from Makefile.am.
27773         * mpbsd/tests/allfuns.c: New file.
27775         * gmp.texi (Top): Use @ifnottex, to help makeinfo --html.
27776         (Installing MP): Describe --enable-mpbsd and demo programs.
27778         * tests/rand/statlib.c: mpz_cmp_abs => mpz_cmpabs.
27780         * tests/rand/Makefile.am (LDADD): Don't need -lm (now in libgmp.la).
27781         (EXTRA_PROGRAMS): Not noinst_PROGRAMS.
27782         (INCLUDES): Shorten to -I$(top_srcdir) now using AM_CONFIG_HEADER.
27784 2000-04-09  Torbjorn Granlund  <tege@swox.com>
27786         * mpz/urandomm.c: Get type of count right.
27787         Simplify computation of nbits.
27789 2000-04-08  Torbjorn Granlund  <tege@swox.com>
27791         * mpz/urandomb.c: Fix reallocation condition.
27792         Simplify size computation.
27794 2000-04-08  Linus Nordberg  <linus@swox.se>
27796         * acinclude.m4 (GMP_CHECK_CC_64BIT): Add special handling for
27797         HPUX.
27798         (GMP_CHECK_ASM_W32): Ditto.
27799         * aclocal.m4: Regenerate.
27801         * mpn/Makefile.am: Use $(CCAS) for assembling.
27802         (.asm.obj): Add rule.
27803         * mpn/Makefile.in: Regenerate.
27805         * gmp.texi (Miscellaneous Integer Functions): Fix typos.
27807         * configure.in: Never pass `-h' to grep.
27808         (mips-sgi-irix6.[2-9]*): Try to find 64-bit compiler.
27809         (hppa1.0*-*-*): New flag for cc.
27810         (hppa2.0*-*-*): Try to find 64-bit compiler.  Chose path, set
27811         CCAS.
27812         * configure: Regenerate.
27814 2000-04-08  Torbjorn Granlund  <tege@swox.com>
27816         * mpz/bin_ui.c: Don't depend on ANSI C features.
27817         * mpz/bin_uiui.c: Likewise.
27819         * Makefile.am (MPZ_OBJECTS): mpz/cmp_abs* => mpz/cmpabs*.
27820         (MPQ_OBJECTS): Add mpq/set_d.lo.
27821         (MPZ_OBJECTS): Add mpz/fits*.lo.
27822         * Makefile.in: Regenerate.
27824         * mpz/cmpabs.c: New name for mpz/cmp_abs.c.
27825         * mpz/cmpabs_ui.c: New name for mpz/cmp_abs_ui.c.
27826         * mpz/Makefile.am: Corresponding changes.
27827         * mpz/Makefile.in: Regenerate.
27828         * gmp.h: mpz_cmp_abs* => mpz_cmpabs*.
27830         * mpz/addmul_ui.c (mpn_neg1): Don't depend on ANSI C features.
27832         * mpz/invert.c: Use TMP_MARK since we invoke MPZ_TMP_INIT.
27834         * gmp.h (mpq_set_d): Declare correctly.
27835         (mpz_root): Use _PROTO.
27836         (mpz_remove): Use _PROTO.
27837         (mpf_pow_iu): Use _PROTO.
27839         * mpn/asm-defs.m4 (MPN_PREFIX): Revert previous change.
27840         * gmp.h (__MPN): Revert previous change.
27842         * mpz/perfpow.c: De-ANSI-fy.  Add copyright notice.
27844         * mpz/set_d.c: Misc cleanups.
27846         * mpq/set_d: New file.
27847         * gmp.h: Declare mpq_set_d.
27848         * mpq/Makefile.am: List set_d.c.
27849         * mpq/Makefile.in: Regenerate.
27851 2000-04-07  Torbjorn Granlund  <tege@swox.com>
27853         * mpz/fits_sint_p.c: New file.
27854         * mpz/fits_slong_p.c: New file.
27855         * mpz/fits_sshort_p.c: New file.
27856         * mpz/fits_uint_p.c: New file.
27857         * mpz/fits_ulong_p.c: New file.
27858         * mpz/fits_ushort_p.c: New file.
27859         * gmp.h: Declare mpz_fits_*.
27860         * mpz/Makefile.am: List fits_* files.
27861         * mpz/Makefile.in: Regenerate.
27863 2000-04-06  Kevin Ryde  <kevin@swox.se>
27865         * gmp.texi (Installing MP): Add known build problem SunOS 4.1.4 m4
27866         failure.
27868         * mpn/x86/pentium/gmp-mparam.h: Tune thresholds.
27869         * mpn/x86/p6/gmp-mparam.h: Ditto.
27870         * mpn/x86/k6/gmp-mparam.h: Tune thresholds, add UMUL_TIME, UDIV_TIME.
27871         * mpn/x86/k7/gmp-mparam.h: Tune thresholds, amend UMUL_TIME.
27873         * mpn/generic/mul_n.c (mpn_kara_mul_n): Add an ASSERT.
27874         (mpn_kara_sqr_n): Add an ASSERT, use KARATSUBA_SQR_THRESHOLD.
27875         (mpn_toom3_sqr_n): Eliminate second evaluate3.
27877         * gmp-impl.h (mpn_com_n,MPN_LOGOPS_N_INLINE): Don't allow size==0.
27878         (tune_mul_threshold,tune_sqr_threshold): Conditionalize
27879         declarations on TUNE_PROGRAM_BUILD.
27881         * mpn/generic/sqr_basecase.c: Add an assert.
27883 2000-04-05  Torbjorn Granlund  <tege@swox.com>
27885         * gmp.h, mpn/asm-defs.m4: List the same functions for __MPN, but
27886         leave some commented out.
27888         * gmp-impl.h (MPN_LOGOPS_N_INLINE): Optimize.
27889         (mpn_com_n): Optimize.
27891         * gmp.h (__MPN): Make it use __gmpn instead of __mpn for consistency.
27892         * mpn/asm-defs.m4 (MPN_PREFIX): Likewise.
27894         * gmp.h (GMP_ERROR_ALLOCATE): New errcode.
27896         * gmp-impl.h (MPN_MUL_N_RECURSE): Delete.
27897         (MPN_SQR_RECURSE): Delete.
27899         * gmp-impl.h (TARGET_REGISTER_STARVED): New define.
27901         * gmp-impl.h (mpn_kara_sqr_n): Remap with __MPN.
27902         (mpn_toom3_sqr_n): Likewise.
27903         (mpn_kara_mul_n): Likewise.
27904         (mpn_toom3_mul_n): Likewise.
27905         (mpn_reciprocal): Likewise.
27907         * gmp-impl.h (__gmpn_mul_n): Remove declaration.
27908         (__gmpn_sqr): Likewise.
27909         * gmp.h (mpn_sqr_n): Declare/remap.
27910         * mpn/generic/mul.c (mpn_sqr_n): New name for mpn_sqr.
27912         * gmp.h (mpn_udiv_w_sdiv): Move __MPN remap from here...
27913         * gmp-impl.h: ...to here.
27915 2000-04-05  Linus Nordberg  <linus@swox.se>
27917         * gmp.texi (Top): Add `Random Number Functions' to menu.
27918         (Introduction to MP): Fix typo.
27919         (MP Basics): Create menu for all sections.  Move `Random Number
27920         Functions' to its own chapter.  Add nodes for all sections.
27921         (Function Classes): Mention random generation functions under
27922         miscellaneous.
27923         (Miscellaneous Integer Functions): Update mpz_urandomb,
27924         mpz_urandomm.
27925         (Low-level Functions): Remove mpn_rawrandom.
27926         (Random State Initialization): Update.
27928         * mpf/urandom.c (mpf_urandomb): Remove SIZE parameter.  Normalize
27929         result correctly.
27931         * gmp.h (mpf_urandomb): Remove SIZE parameter.
27933         * randraw.c (gmp_rand_getraw): Handle the case where (1) the LC
27934         scheme doesn't generate even limbs and (2) more than one LC
27935         invocation is necessary to produce the requested number of bits.
27937 2000-04-05  Torbjorn Granlund  <tege@swox.com>
27939         * mpn/generic/mul_n.c (INVERSE_3): New name for THIRD, define for
27940         any BITS_PER_MP_LIMB.
27941         (MP_LIMB_T_MAX): New.
27942         (mpn_divexact3_n): Remove.
27943         (interpolate3): Use mpn_divexact_by3 instead of mpn_divexact3_n.
27945 2000-04-05  Kevin Ryde  <kevin@swox.se>
27947         * gmp-impl.h (KARATSUBA_MUL_THRESHOLD<2): Remove cpp test.
27948         (tune_mul_threshold,tune_sqr_threshold): Add declarations, used in
27949         development only.
27951         * mpn/x86/k7/sqr_basecase.asm: New file, only a copy of k6 for now.
27953 2000-04-04  Torbjorn Granlund  <tege@swox.com>
27955         * gmp-impl.h (TOOM3_MUL_THRESHOLD): Provide default.
27956         (TOOM3_SQR_THRESHOLD): Provide default.
27958         * mpn/generic/mul_n.c: Rewrite (mostly by Robert Harley).
27959         * mpn/generic/mul.c: Rewrite (mostly by Robert Harley).
27961         * configure.in (sparcv9 64-bit OS): Set extra_functions.
27963 2000-04-04  Linus Nordberg  <linus@swox.se>
27965         * mpn/generic/rawrandom.c: Remove file and replace with randraw.c
27966         on top level.
27967         (mpn_rawrandom): Rename to gmp_rand_getraw.
27969         * randraw.c: New file; essentially a copy of
27970         mpn/generic/rawrandom.c.
27971         (gmp_rand_getraw): New function (formerly known as mpn_rawrandom).
27973         * mpz/urandomb.c (mpz_urandomb): Change mpn_rawrandom -->
27974         gmp_rand_getraw.
27975         * mpz/urandomm.c (mpz_urandomb): Ditto.
27976         * mpf/urandom.c (mpf_urandomb): Ditto.
27978         * gmp.h (gmp_rand_getraw): Add function prototype.
27979         (mpn_rawrandom): Remove function prototype.
27981         * Makefile.am (libgmp_la_SOURCES): Add randraw.c.
27982         * Makefile.in: Regenerate.
27984         * configure.in (gmp_mpn_functions): Remove rawrandom.
27985         * configure: Regenerate.
27987 2000-04-04  Linus Nordberg  <linus@swox.se>
27989         * gmp.h (GMP_ERROR enum): Remove comma after last enumeration
27990         since the AIX compiler (xlc) doesn't like that.
27992         * randlc.c (gmp_rand_init_lc): Allocate enough space for seed to
27993         hold any upcoming seed.
27994         * randlc2x.c (gmp_rand_init_lc_2exp): Likewise.
27996         * mpn/generic/rawrandom.c: Remove debugging code.
27997         (mpn_lc): Don't reallocate seed.
27999         * mpz/urandomm.c (mpz_urandomm): Implement function.
28001         * mpz/urandomb.c (mpz_urandomb): Fix typo in function definition.
28003 2000-04-04  Kevin Ryde  <kevin@swox.se>
28005         * make.bat: Removed (no longer works, no longer supported).
28006         * mpn/msdos/asm-syntax.h: Removed (was used only by make.bat).
28008 2000-04-03  Torbjorn Granlund  <tege@swox.com>
28010         * mpn/generic/brandom.c: New file, replacing random2.
28012 2000-04-02  Torbjorn Granlund  <tege@swox.com>
28014         * mpn/sparc32/v9/submul_1.asm: Change some carry-form instructions
28015         into their plain counterparts.
28017         * mpn/sparc64/copyi.asm: Avoid executing ALIGN.
28019         * mpn/sparc64/mul_1.asm: Handle overlap of rp/sp.
28020         * mpn/sparc64/addmul_1.asm: Likewise.
28021         * mpn/sparc64/submul_1.asm: Likewise.
28023 2000-04-01  Linus Nordberg  <linus@swox.se>
28025         * gmp.h: Fix function prototypes for randomization functions.
28026         (__gmp_rand_lc_scheme_struct): Replace `m' with `m2exp'. Remove
28027         unused `bits'.
28028         (__gmp_rand_data_lc): Add `m2exp' as another way of representing
28029         the modulus.
28030         (__gmp_rand_state_struct): Remove unused `size'.
28032         * rand.c (__gmp_rand_scheme): Use better multipliers.  Remove test
28033         schemes.  Replace `m' with `m2exp'.
28034         (gmp_rand_init): Change parameters and return type.  Use `m2exp'
28035         instead of `m'.  Set `gmp_errno' on error.  Disable BBS algorithm.
28037         * randlc.c (gmp_rand_init_lc): Don't use malloc().  Change
28038         parameters.
28040         * randclr.c (gmp_rand_clear): Don't use free().  Disable BBS
28041         algorithm.  Set `gmp_errno' on error.
28043         * randlc2x.c (gmp_rand_init_lc_2exp): New function.
28044         * randsd.c (gmp_rand_seed): New function.
28045         * randsdui.c (gmp_rand_seed_ui): New function.
28046         * randlcui.c: Remove unused file.
28048         * mpn/generic/rawrandom.c (mpn_rawrandom): Rewrite.
28049         (mpn_lc): New static function.
28051         * mpz/urandomb.c (mpz_urandomb): Use ABSIZ() instead of SIZ() for
28052         determining size of ROP.
28054         * mpf/urandom.c (mpf_urandomb): Add third parameter, nbits.  (Not
28055         used yet!)
28056         Change parameter order to mpn_rawrandom().
28058         * Makefile.am (libgmp_la_SOURCES): Add errno.c, randlc2x.c,
28059         randsd.c, randsdui.c.  Remove randui.c.
28060         (MPZ_OBJECTS): Rename urandom.lo --> urandomb.lo.  Add urandomm.lo.
28061         * Makefile.in: Regenerate.
28063         * mpz/Makefile.am (libmpz_la_SOURCES): Change urandom.c -->
28064         urandomb.c.  Add urandomm.c.
28065         * mpz/Makefile.in: Regenerate.
28067         * tests/rand/Makefile.am (noinst_PROGRAMS): Change findcl --> findlc.
28068         Add gen.static.
28069         * tests/rand/Makefile.in: Regenerate.
28071         * tests/rand/gen.c (main): Add mpz_urandomm.  Add command line options
28072         `-C', `-m', extend `-a'.  Use *mp*_*rand*() with new parameters.  Call
28073         gmp_rand_seed().
28075 2000-04-01  Kevin Ryde  <kevin@swox.se>
28077         * acinclude.m4 (GMP_CHECK_ASM_DATA): Plain .data for hpux.
28078         * configure.in (CCAS): No CFLAGS, they're added when it's used.
28079         (CONFIG_SRCDIR): New define for config.m4.
28080         * mpn/sparc64/addmul_1.asm: Use it for an include().
28081         * mpn/sparc64/submul_1.asm: Ditto.
28082         * mpn/sparc64/mul_1.asm: Ditto.
28084 2000-03-31  Linus Nordberg  <linus@swox.se>
28086         * mpz/urandom.c: Rename to...
28087         * mpz/urandomb.c: ...this.
28089         * mpz/urandomb.c (mpz_urandomb): Change operand order in call to
28090         mpn_rawrandom().  Use ABSIZ() instead of SIZ() when checking size
28091         of ROP.
28093         * mpz/urandomm.c: New file.
28095 2000-03-31  Kevin Ryde  <kevin@swox.se>
28097         * acinclude.m4 (GMP_CHECK_ASM_MMX): Give a warning when mmx code
28098         will be omitted.
28100 2000-03-30  Torbjorn Granlund  <tege@swox.com>
28102         * mpn/sparc64/mul_1h.asm: New file.
28103         * mpn/sparc64/addmul_1h.asm: New file.
28104         * mpn/sparc64/submul_1h.asm: New file.
28105         * mpn/sparc64/mul_1.asm: Rewrite.
28106         * mpn/sparc64/addmul_1.asm: Rewrite.
28107         * mpn/sparc64/submul_1.asm: Rewrite.
28109 2000-03-28  Torbjorn Granlund  <tege@swox.com>
28111         * mpn/sparc32/v9/mul_1.asm: Fix typo in branch prediction.
28112         * mpn/sparc32/v9/addmul_1.asm: Likewise.
28113         * mpn/sparc32/v9/submul_1.asm: Likewise.
28115 2000-03-25  Kevin Ryde  <kevin@swox.se>
28117         * mpn/lisp/gmpasm-mode.el: Fix some comment detection, use custom,
28118         fontify more keywords, turn into a standalone mode.
28120         * stamp-vti: New file, generated together with version.texi.
28122         * acinclude.m4 (GMP_VERSION,GMP_HEADER_GETVAL): New macros.
28123         * configure.in (AM_INIT_AUTOMAKE): Use GMP_VERSION.
28125 2000-03-24  Kevin Ryde  <kevin@swox.se>
28127         * INSTALL: Updates for new configure system.
28129         * configure.in: Add gmp_optcflags_gcc for the x86s, setting -mcpu
28130         and -march.
28132 2000-03-23  Torbjorn Granlund  <tege@swox.com>
28134         * demos/pexpr.c (mpz_eval_expr): Properly initialize rhs/lhs
28135         for ROOT.
28137 2000-03-23  Kevin Ryde  <kevin@swox.se>
28139         * config.guess (i?86:*:*:*): Use uname -m if detection program fails.
28141         * mpn/x86/README: Remove remarks on the now implemented MMX shifts.
28142         * mpn/x86/k6/README: Add speed of mpn_divexact_by3, update mpn_mul_1.
28144         * gmp.texi (Installing MP): Corrections to target CPUs.
28146         * version.c: Use VERSION from config.h, add copyright comment,
28147         restore "const" somehow lost.
28149         * configure.in (a29k*-*-*): Fix directory name.
28151 2000-03-22  Torbjorn Granlund  <tege@swox.com>
28153         * demos/pexpr.c (op_t): Add ROOT.
28154         (fns): Add ROOT.
28155         (mpz_eval_expr): Add ROOT.
28157         * mpz/root.c: Handle roots of negative numbers.
28158         Fix other border cases.
28159         Fix rare memory leakage.
28161         * errno.c: New file.
28163 2000-03-21  Torbjorn Granlund  <tege@swox.com>
28165         * gmp.h (error number enum): New anonymous enum.
28166         (gmp_errno): New.
28168         * gmp.h (__GNU_MP_VERSION, __GNU_MP_VERSION_MINOR): Bump for GMP 3.0.
28170 2000-03-20  Torbjorn Granlund  <tege@swox.com>
28172         * mpn/alpha/unicos.m4 (FLOAT64): New define.
28173         * mpn/alpha/default.m4 (FLOAT64): New define.
28174         * mpn/alpha/invert_limb.asm (C36): Use FLOAT64.
28176 2000-03-21  Kevin Ryde  <kevin@swox.se>
28178         * mpn/x86/k6/diveby3.asm: Tiny speedup.
28180         * acinclude.m4 (GMP_CHECK_ASM_SHLDL_CL): New macro.
28181         * configure.in: Use it, set WANT_SHLDL_CL in config.m4.
28182         * mpn/x86/x86-defs.m4 (shldl,shrdl,shldw,shrdw): New macros, using
28183         WANT_SHLDL_CL.
28184         * mpn/x86/k6/mmx/lshift.asm: Use shldl macro.
28185         * mpn/x86/k7/mmx/lshift.asm: Ditto.
28186         * mpn/x86/pentium/mmx/lshift.asm: Ditto.
28187         * mpn/x86/k6/mmx/rshift.asm: Use shrdl macro.
28188         * mpn/x86/k7/mmx/rshift.asm: Ditto.
28189         * mpn/x86/pentium/mmx/rshift.asm: Ditto.
28190         * mpn/x86/README.family: Add a note about this.
28192 2000-03-20  Linus Nordberg  <linus@swox.se>
28194         * mpn/generic/rawrandom.c (mpn_rawrandom): Handle seed value of 0
28195         correctly.
28197         * configure.in: Fix detection of alpha flavour.
28198         Set compiler options for `sparcv8'.
28199         * configure: Regenerate.
28201         * rand.c (__gmp_rand_scheme): Clean up some.  Use slightly better
28202         multipliers.
28204         * configure.in (AC_OUTPUT): Add tests/Makefile and
28205         tests/rand/Makefile.
28207         * acinclude.m4 (AC_CANONICAL_BUILD): Define to
28208         `_AC_CANONICAL_BUILD' to deal with incompatibilities between
28209         Autoconf and Libtool.
28210         (AC_CHECK_TOOL_PREFIX): Likewise.
28212         * Makefile.am (EXTRA_DIST): Add directory `tests'.
28214         * mkinstalldirs: Update (Automake 2000-03-17).
28215         * ltconfig: Update (Libtool 2000-03-17).
28216         * ltmain.sh: Ditto.
28218         * configure: Regenerate with new autoconf/-make/libtool suite.
28219         * aclocal.m4: Ditto.
28220         * config.in: Ditto.
28221         * all Makefile.in's: Ditto.
28223 2000-03-20  Torbjorn Granlund  <tege@swox.com>
28225         * demos/pexpr.c (main): Don't allow `-N' for base, require `-bN'.
28227         * mpn/alpha/unicos.m4 (cvttqc): New define.
28228         * mpn/alpha/invert_limb.asm: Use new define for cvttqc.
28230 2000-03-19  Kevin Ryde  <kevin@swox.se>
28232         * mpn/x86/k6/sqr_basecase.asm: Tiny amendments for 3x3 case.
28234         * gmp.texi: Use @include version.texi.
28235         Use @email and @uref.
28236         (Installing MP): Rewrite for new configure.
28237         (Low-level Functions): Add mpn_divexact_by3.
28239         * configure.in (--enable-alloca): New option.
28240         * acconfig.h (USE_STACK_ALLOC): For --disable-alloca.
28242 2000-03-18  Kent Boortz  <kent@swox.com>
28244         * macos: New directory with macos port files.
28246 2000-03-17  Torbjorn Granlund  <tege@swox.com>
28248         * gmp-impl.h (union ieee_double_extract): Check _CRAYMPP.
28250         * mpn/asm-defs.m4 (invert_normalized_limb): Define.
28252         * mpn/alpha: Translate `.s' files to `.asm'.
28254         * configure: Regenerate.
28256         * mpn/alpha/invert_limb.asm: Replace dash in file name with underscore.
28257         * configure.in: Corresponding change.
28259         * configure.in: Assign special "path" for alphaev6.
28261         * mpn/alpha/unicos.m4: New file.
28262         * configure.in (alpha*-cray-unicos*): [This part of the change
28263         commited 2000-03-13 by linus]
28264         * mpn/alpha/default.m4: New file.
28265         * configure.in (alpha*-*-*): Use it.
28267 2000-03-17  Kevin Ryde  <kevin@swox.se>
28269         * mpn/x86/pentium/rshift.S: Use plain rcrl (not rcrl $1) for
28270         shift-by-1 case, significant speedup.
28271         * mpn/x86/pentium/README: Add shift-by-1 speed.
28273 2000-03-16  Torbjorn Granlund  <tege@swox.com>
28275         * config.guess: Handle Cray T3D/E.
28277 2000-03-15  Kevin Ryde  <kevin@swox.se>
28279         * mpn/generic/diveby3.c: New file.
28280         * mpn/x86/diveby3.asm: New file.
28281         * mpn/x86/k6/diveby3.asm: New file.
28282         * gmp.h (mpn_divexact_by3): Prototype and define.
28283         * mpn/asm-defs.m4: define_mpn(divexact_by3).
28284         * configure.in (gmp_mpn_functions): Add diveby3.
28286         * mpn/x86/pentium/sqr_basecase.asm: A few better addressing modes.
28288         * configure.in: Add AC_C_STRINGIZE and AC_CHECK_TYPES((void)).
28289         * gmp-impl.h (ASSERT): Use them.
28291         * mpn/x86/k7/mmx/lshift.asm: New file.
28292         * mpn/x86/k7/mmx/rshift.asm: Rewrite simple loop and return value
28293         handling, add some pictures.
28295 2000-03-14  Torbjorn Granlund  <tege@swox.com>
28297         * mpn/sparc32/v8/mul_1.asm: Make PIC actually work.
28298         * mpn/sparc32/v8/addmul_1.asm: Likewise.
28300         * mpn/sparc32/v8/mul_1.asm: Use m4 ifdef, not cpp #if.
28301         * mpn/sparc32/v8/addmul_1.asm: Likewise.
28303         * mpn/asm-defs.m4 (C): New define for comments.
28304         * mpn/sparc32: Start comments with `C'.
28306         * config.guess: Remove `SunOS 6' handling.
28307         Recognize sun4m and sun4d architectures under old SunOS.
28309 2000-03-14  Linus Nordberg  <linus@swox.se>
28311         * configure.in (gmp_srclinks): Set to list of links created by
28312         configure.
28313         * configure: Regenerate.
28315         * Makefile.am (libgmp_la_LDFLAGS): Set version info.
28316         (DISTCLEANFILES): Include @gmp_srclinks@.
28317         * Makefile.in: Regenerate.
28319 2000-03-13  Linus Nordberg  <linus@swox.se>
28321         * configure.in: Remove some changequote's by quoting the strings
28322         containing `[]'.
28323         Add support for `alpha*-cray-unicos*'.
28324         AC_DEFINE `_LONG_LONG_LIMB' instead of passing it in CFLAGS.
28325         Conditionalize the assembler syntax checks.
28326         * configure: Regenerate.
28327         * config.in: Regenerate.
28329         * acinclude.m4 (GMP_PROG_CCAS): Remove macro.
28330         * aclocal.m4: Regenerate.
28332 2000-03-13  Kevin Ryde  <kevin@swox.se>
28334         * mpn/x86/p6/README: New file.
28336         * mpn/x86/k6/mul_1.asm: Rewrite, smaller and slightly faster.
28338         * mpn/lisp/gmpasm-mode.el: Rewrite assembler comment detection and
28339         handling.
28341         * configure.in: Separate mmx directories for each x86 flavour.
28342         * configure: Regenerate.
28344 2000-03-12  Kevin Ryde  <kevin@swox.se>
28346         * mpn/x86/x86-defs.m4 (ALIGN): Supplement definition from
28347         config.m4 so as to pad with nops not zeros on old gas.
28349         * mpn/x86/k7/mmx/copyd.asm: Use plain emms (femms is just an alias
28350         for emms now).
28351         * mpn/x86/k7/mmx/copyi.asm: Ditto.
28352         * mpn/x86/k7/mmx/rshift.asm: Ditto.
28353         * mpn/x86/x86-defs.m4: Amend comments.
28355         * mpn/x86/mod_1.asm: Add comments on speeds.
28357         * mpn/x86/pentium/mmx/lshift.asm: New file.
28358         * mpn/x86/pentium/mmx/rshift.asm: New file.
28359         * mpn/x86/pentium/README: Add speeds of various routines.
28361 2000-03-10  Linus Nordberg  <linus@swox.se>
28363         * configure.in: Reorganize.
28364         Use AC_CHECK_TOOL to find `ar'.
28365         Add post-includes `regmap.m4' and `aix.m4' for AIX targets.
28366         asm-syntax.h is not needed for PPC or sparc anymore.
28367         (powerpc64-*-aix*): Compiler is always 64-bit. Use `-q64
28368         -qtune=pwr3' to xlc and `-maix64 -mpowerpc64' to gcc.  Pass `-X
28369         64' to `ar' and `nm'.
28370         (pentiummmx): Use GMP_CHECK_ASM_MMX and avoid MMX assembly path if
28371         assembler is not MMX capable.
28372         (pentium[23]): Likewise.
28373         (athlon): Likewise.
28374         (k6*): Likewise.
28375         * configure: Regenerate.
28377         * acinclude.m4 (GMP_PROG_CC_WORKS): New macro.
28378         (GMP_PROG_CC_FIND): Use GMP_PROG_CC_WORKS instead of
28379         AC_TRY_COMPILER.  Make sure that the *first* working 32-bit
28380         compiler is used if no 64-bit compiler is found.
28381         (GMP_CHECK_ASM_MMX): New macro.
28382         * aclocal.m4: Regenerate.
28384         * Makefile.in: Regenerate.  (CC_TEST removed.)
28385         * mpf/Makefile.in: Likewise.
28386         * mpn/Makefile.in: Likewise.
28387         * mpq/Makefile.in: Likewise.
28388         * mpz/Makefile.in: Likewise.
28389         * mpf/tests/Makefile.in: Likewise.
28390         * mpq/tests/Makefile.in: Likewise.
28391         * mpz/tests/Makefile.in: Likewise.
28393         * acconfig.h (_LONG_LONG_LIMB): Add.
28395         * gmp-impl.h: Include config.h only if HAVE_CONFIG_H is defined.
28397 2000-03-09  Kevin Ryde  <kevin@swox.se>
28399         * mpn/x86/pentium/mul_basecase.S: Small speedup by avoiding an AGI.
28401         * mpn/x86/k7/mmx/copyd.asm: Tiny speedup by avoiding popl.
28402         * mpn/x86/k7/mmx/copyi.asm: Ditto.
28403         * mpn/x86/k7/mul_basecase.asm: Ditto.
28405 2000-03-07  Torbjorn Granlund  <tege@swox.com>
28407         * config.guess: Better recognize POWER/PowerPC processor type.
28409 2000-03-07  Kevin Ryde  <kevin@swox.se>
28411         * mpn/generic/addsub_n.c: Use HAVE_NATIVE_* now in config.h.
28413         * mpn/asm-defs.m4: Add comments about SysV m4.
28414         (m4_log2): Don't use <<.
28415         (m4_lshift,m4_rshift): New macros.
28417 2000-03-06  Torbjorn Granlund  <tege@swox.com>
28419         * mpn/powerpc32/regmap.m4: Map cr0 => `0', etc.
28421 2000-03-06  Kevin Ryde  <kevin@swox.se>
28423         * mpn/tests/ref.c (refmpn_divexact_by3): New function.
28424         * mpn/tests/ref.h: Prototype.
28426         * acconfig.h (WANT_ASSERT): New define.
28427         * configure.in (--enable-assert): Turn on WANT_ASSERT.
28428         * assert.c: New file.
28429         * Makefile.am: Add to build.
28430         * gmp-impl.h (ASSERT): New macro.
28431         (ASSERT_NOCARRY) Renamed from assert_nocarry.
28432         (MPZ_CHECK_FORMAT): Use ASSERT_ALWAYS.
28433         * mpn/tests/ref.c: Use ASSERT.
28434         * mpf/get_str.c: Use ASSERT_ALWAYS.
28435         * mpf/set_str.c: Remove old assert macro.
28437         * mpn/x86/x86-defs.m4 (cmovnz_ebx_ecx): New macro.
28438         * mpn/x86/p6/aorsmul_1.asm: Use cmov.
28440         * mpn/x86/lshift.S: Use %dl with testb, not %edx. No object code
28441         change, testb was still getting generated.
28442         * mpn/x86/rshift.S: Ditto.
28444 2000-03-03  Torbjorn Granlund  <tege@swox.com>
28446         * longlong.h: Add IA-64 support.
28448         * mpn/powerpc32: Misc cleanups.
28449         * mpn/powerpc32/aix.m4: New file (mainly by Linus).
28450         * mpn/powerpc64/aix.m4: New file (mainly by Linus).
28451         * mpn/powerpc64: Translate `.S' files to `.asm'.
28453         * configure.in: Fix tyops.
28454         * configure: Regenerate.
28456 2000-03-02  Torbjorn Granlund  <tege@swox.com>
28458         * mpn/powerpc32/regmap.m4: New file.
28459         * mpn/powerpc32: Translate `.S' files to `.asm'.
28460         * configure.in: Use mpn/powerpc32/regmap.m4 for powerpc targets
28461         except some weird ones.
28463 2000-03-03  Kevin Ryde  <kevin@swox.se>
28465         * mpn/lisp/gmpasm-mode.el: Suppress postscript comment prefixes in
28466         filladapt.
28468         * mpn/x86/pentium/sqr_basecase.asm: New file.
28469         * mpn/x86/pentium/gmp-mparam.h (KARATSUBA_SQR_THRESHOLD): Update.
28471         * configure.in: Add --enable-assert, enable k6 logops functions.
28473         * mpn/x86/k6/mmx/copyi.asm: Use m4 for divide, not as.
28474         * mpn/x86/k6/mmx/copyd.asm: Ditto.
28475         * mpn/x86/README.family: Add a note on this.
28477 2000-03-02  Kevin Ryde  <kevin@swox.se>
28479         * mpn/x86/k6/aors_n.asm: Don't use stosl.
28480         * mpn/x86/copyi.asm: Use cld to clear direction flag.
28481         * mpn/x86/divrem_1.asm: Ditto.
28482         * mpn/x86/README.family: Add a note on this.
28484         * mpn/x86/k6/mmx/copyi.asm: Rewrite.
28485         * mpn/x86/k6/mmx/copyd.asm: New file.
28486         * mpn/x86/k6/README: Update, and small amendments.
28488         * mpn/x86/x86-defs.m4 (Zdisp): New macro.
28489         * mpn/asm-defs.m4 (m4_stringequal_p): New macro.
28491         * mpn/x86/p6/aorsmul_1.asm: Use Zdisp to force zero displacements.
28492         * mpn/x86/k6/aorsmul_1.asm: Ditto.
28493         * mpn/x86/k6/mul_1.asm: Ditto.
28494         * mpn/x86/k6/mul_basecase.asm: Ditto.
28495         * mpn/x86/k7/aors_n.asm: Ditto.
28496         * mpn/x86/k7/aorsmul_1.asm: Ditto.
28497         * mpn/x86/k7/mul_1.asm: Ditto.
28498         * mpn/x86/k7/mul_basecase.asm: Ditto.
28499         * mpn/x86/README.family: Add a note on this.
28501 2000-02-27  Kevin Ryde  <kevin@swox.se>
28503         * mpn/generic/divrem.c (mpn_divrem_classic): Patch to avoid gcc
28504         2.7.2.3 i386 register handling bug.
28506         * mpn/x86/k6/aors_n.asm: Rewrite.
28507         * mpn/x86/k6/mmx/lshift.asm: Rewrite.
28508         * mpn/x86/k6/mmx/rshift.asm: Rewrite.
28509         * mpn/x86/k6/README: Update.
28511         * mpn/x86/k7/mmx/copyd.asm: Support size==0.
28512         * mpn/x86/k7/mmx/copyi.asm: Ditto.
28513         * mpn/x86/k6/mmx/copyi.asm: Ditto.
28514         * gmp-impl.h: Comment size==0 allowed in MPN_COPY_INCR and
28515         MPN_COPY_DECR.
28516         * configure.in: Enable x86 copyi, copyd; add k6 com_n.
28518 2000-02-25  Torbjorn Granlund  <tege@swox.com>
28520         * demos/pexpr.c (power): Move factorial handing code from `factor'
28521         to `power'.
28523         * demos/factorize.c (factor_using_pollard_rho): Move resetting of `c'
28524         to before checking for a non-zero gcd.
28526 2000-02-25  Kevin Ryde  <kevin@swox.se>
28528         * mpn/asm-defs.m4 (MULFUNC_PROLOGUE): New macro by Linus.
28529         * mpn/x86/k6/aors_n.asm: Use MULFUNC_PROLOGUE.
28530         * mpn/x86/k6/aorsmul_1.asm: Ditto.
28531         * mpn/x86/k7/aors_n.asm: Ditto.
28532         * mpn/x86/k7/aorsmul_1.asm: Ditto.
28533         * mpn/x86/p6/aorsmul_1.asm: Ditto.
28535         * mpn/tests/ref.c (refmpn_copyi,refmpn_copyd): Allow size==0.
28537         * gmp-impl.h: Move mpn_and_n, mpn_andn_n, mpn_com_n, mpn_ior_n,
28538         mpn_iorn_n, mpn_nand_n, mpn_nior_n, mpn_xor_n and mpn_xorn_n here
28539         from gmp.h.  Use HAVE_NATIVE_mpn_* to make these functions or
28540         inlines.
28542         * gmp-impl.h: Move mpn_copyd, mpn_copyi here from gmp.h.
28543         * gmp-impl.h (MPN_COPY_INCR): Use mpn_copyi if available.
28544         * gmp-impl.h (MPN_COPY_DECR): Use mpn_copyd if available.
28546         * mpn/x86/k6/mmx/com_n.asm: Moved into mmx subdirectory.
28547         * mpn/x86/k6/mmx/copyi.asm: Ditto.
28548         * mpn/x86/k6/mmx/lshift.asm: Ditto.
28549         * mpn/x86/k6/mmx/rshift.asm: Ditto.
28550         * mpn/x86/k7/mmx/rshift.asm: Ditto.
28551         * mpn/x86/k6/mmx/logops_n.asm: New file.
28552         * configure.in (k6*-*-*): Add logops_n.asm.
28553         * mpn/x86/k6/README: Update.
28555         * mpn/x86/k7/mmx/copyi.asm: New file.
28556         * mpn/x86/k7/mmx/copyd.asm: New file.
28557         * mpn/x86/k7/README: Update.
28559 2000-02-24  Kevin Ryde  <kevin@swox.se>
28561         * mpn/x86/x86-defs.m4 (femms): Generate emms if 3dnow not available.
28562         * mpn/x86/x86-defs.m4 (FRAME_popl): New macro.
28564         * Makefile.am: Add info_TEXINFOS = gmp.texi
28566         * mpn/x86/divrem_1.asm: Moved from mpn/x86/k6, allow size==0,
28567         conditionalize loop versus decl/jnz.
28568         * mpn/x86/mod_1.asm: Ditto.
28569         * mpn/x86/divmod_1.asm: Removed.
28570         * gmp.texi (mpn_divrem_1,mpn_mod_1): Add that size==0 is allowed.
28571         * mpn/tests/ref.c (refmpn_divrem_1c,etc): Allow size==0.
28573         * mpn/x86/k6/aors_n.asm: Avoid gas 1.92.3 leal displacement
28574         expression problem.
28575         * mpn/x86/k6/aorsmul_1.asm: Ditto.
28576         * mpn/x86/k6/mul_1.asm: Ditto.
28577         * mpn/x86/k6/mul_basecase.asm: Ditto
28578         * mpn/x86/k7/aors_n.asm: Ditto.
28579         * mpn/x86/k7/aorsmul_1.asm: Ditto.
28580         * mpn/x86/k7/mul_1.asm: Ditto.
28581         * mpn/x86/k7/mul_basecase.asm: Ditto.
28582         * mpn/x86/k7/rshift.asm: Ditto.
28583         * mpn/x86/p6/aorsmul_1.asm: Ditto.
28584         * mpn/x86/README.family: Describe problem.
28586 2000-02-24  Linus Nordberg  <linus@swox.se>
28588         * acinclude.m4 (GMP_CHECK_ASM_LSYM_PREFIX): Add dummy symbol to
28589         testcase to avoid nm failure.  Try nm before piping to grep.
28591         * acconfig.h: Undef HAVE_NATIVE_func for every mpn function found
28592         in gmp.h.
28594         * configure.in: Invoke AC_CONFIG_HEADERS.
28595         Don't invoke AM_CONFIG_HEADER; it makes autoconf confused.
28596         Dig out entry points declared in assembly code and AC_DEFINE proper
28597         HAVE_NATIVE_func.
28599         * mpn/asm-defs.m4 (MULFUNC_PROLOGUE): New macro.
28601         * mpn/x86/p6/aorsmul_1.asm: Use MULFUNC_PROLOGUE.
28602         * mpn/x86/k6/aors_n.asm: Likewise.
28604         * Makefile.am (EXTRA_DIST): Add config.in; needed when we don't
28605         use AM_CONFIG_HEADER in configure.in.
28607         * mpn/Makefile.am (INCLUDES): Add `-I..' for config.h and
28608         gmp-mparam.h.
28609         * mpf/Makefile.am: Likewise.
28610         * mpq/Makefile.am: Likewise.
28611         * mpz/Makefile.am: Likewise.
28613         * mpf/tests/Makefile.am (INCLUDES): Add `-I../..' for config.h and
28614         gmp-mparam.h.
28615         * mpq/tests/Makefile.am: Likewise.
28616         * mpz/tests/Makefile.am: Likewise.
28618         * configure: Regenerate.
28619         * aclocal.m4: Regenerate.
28620         * config.in: Regenerate.
28621         * Makefile.in: Regenerate.
28622         * mpf/Makefile.in: Regenerate.
28623         * mpn/Makefile.in: Regenerate.
28624         * mpq/Makefile.in: Regenerate.
28625         * mpz/Makefile.in: Regenerate.
28626         * mpf/tests/Makefile.in: Regenerate.
28627         * mpq/tests/Makefile.in: Regenerate.
28628         * mpz/tests/Makefile.in: Regenerate.
28630 2000-02-23  Kevin Ryde  <kevin@swox.se>
28632         * mpn/x86/addmul_1.S: Amend comments, this code no longer used by
28633         PentiumPro.
28634         * mpn/x86/submul_1.S: Ditto.
28636         * mpn/x86/k6/com_n.asm: Rewrite, smaller but same speed.
28638         * mpn/x86/addmul_1.S: Add PROLOGUE and EPILOGUE to get .type and
28639         .size for ELF.  Rename #define size to n to avoid .size.
28640         * mpn/x86/lshift.S: Ditto.
28641         * mpn/x86/mul_1.S: Ditto.
28642         * mpn/x86/mul_basecase.S: Ditto.
28643         * mpn/x86/rshift.S: Ditto.
28644         * mpn/x86/submul_1.S: Ditto.
28645         * mpn/x86/udiv.S: Ditto.
28646         * mpn/x86/umul.S: Ditto.
28647         * mpn/x86/pentium/add_n.S: Ditto.
28648         * mpn/x86/pentium/addmul_1.S: Ditto.
28649         * mpn/x86/pentium/lshift.S: Ditto.
28650         * mpn/x86/pentium/mul_1.S: Ditto.
28651         * mpn/x86/pentium/mul_basecase.S: Ditto.
28652         * mpn/x86/pentium/rshift.S: Ditto.
28653         * mpn/x86/pentium/sub_n.S: Ditto.
28654         * mpn/x86/pentium/submul_1.S: Ditto.
28656 2000-02-22  Linus Nordberg  <linus@swox.se>
28658         * acinclude.m4 (GMP_INIT): Use temporary file cnfm4p.tmp for
28659         post-defines.
28660         (GMP_FINISH): Ditto.
28661         (GMP_DEFINE): Add third optional argument specifying location in
28662         outfile.
28663         (GMP_DEFINE_RAW): New macro.
28664         * aclocal.m4: Regenerate.
28666         * configure.in: Add `HAVE_TARGET_CPU_$target_cpu' using
28667         GMP_DEFINE_RAW.
28668         * configure: Regenerate.
28670         * mpz/tests/Makefile.am: New test t-root.
28671         * mpz/tests/Makefile.in: Regenerate.
28673 2000-02-22  Torbjorn Granlund  <tege@swox.com>
28675         * mpz/root.c: Complete rewrite; still primitive, but at least correct.
28676         * mpz/tests/t-root.c: New test.
28678 2000-02-22  Kevin Ryde  <kevin@swox.se>
28680         * mpn/x86/k7/mul_basecase.asm: New file.
28681         * mpn/x86/k7/README: Add mpn_mul_basecase speed.
28682         * mpn/x86/k7/gmp-mparam.h: New file.
28684         * mpn/x86/x86-defs.m4 (loop_or_decljnz,cmov_bytes): New macros.
28685         * mpn/asm-defs.m4 (m4_ifdef_anyof_p): New macro.
28687         * mpn/x86/k6/aorsmul_1.asm: New file.
28688         * mpn/x86/k6/addmul_1.S: Removed (was a copy of pentium version).
28689         * mpn/x86/k6/submul_1.S: Removed (was a copy of pentium version).
28691         * mpn/x86/p6/aorsmul_1.asm: Use OPERATION_addmul_1 and
28692         OPERATION_submul_1.
28693         * mpn/x86/k6/aors_n.asm: Use OPERATION_add_n and OPERATION_sub_n.
28694         * configure.in: Declare multi-function files for k6 and p6.
28696         * configure.in: Add HAVE_TARGET_CPU_$target_cpu for config.m4.
28697         * mpn/asm-defs.m4 (define_not_for_expansion): New macro.
28699         * mpn/generic/divrem_1n.c (__gmpn_divrem_1n): New file, split from
28700         mpn/generic/divrem_1.c.
28701         * mpn/generic/divrem_1.c: Ditto.
28702         * configure.in (gmp_mpn_functions): Ditto.
28704 2000-02-21  Torbjorn Granlund  <tege@swox.com>
28706         * gmp.h: Undo 1996-10-06 NeXT change, it was clearly improperly
28707         written.
28709 2000-02-21  Linus Nordberg  <linus@swox.se>
28711         * configure.in: Link <src>/mpn/asm-defs.m4 to <build>mpn/asm.m4.
28712         * configure: Regenerate.
28714 2000-02-21  Linus Nordberg  <linus@swox.se>
28716         * mpn/x86/k7/aorsmul_1.asm: Change OPERATION_ADDMUL -->
28717         OPERATION_addmul_1.  Change OPERATION_SUBMUL -->
28718         OPERATION_submul_1.
28720         * mpn/x86/k7/aors_n.asm: Change OPERATION_ADD --> OPERATION_add_n.
28721         Change OPERATION_SUB --> OPERATION_sub_n.
28723         * mpn/Makefile.am: Pass -DOPERATION_$* to preprocessors.
28724         * mpn/Makefile.in: Regenerate.
28726         * configure.in: Symlink mpn/asm-defs.m4 to build-dir/mpn.  Link
28727         multi-function files to mpn/<function>.asm and remove function
28728         name from `gmp_mpn_functions'.
28729         * configure: Regenerate.
28731         * acinclude.m4 (GMP_FINISH): Tell user what we're doing.
28732         * aclocal.m4: Regenerate.
28734 2000-02-21  Kevin Ryde  <kevin@swox.se>
28736         * gmp-impl.h: Rename __gmpn_mul_basecase to mpn_mul_basecase and
28737         __gmpn_sqr_basecase to mpn_sqr_basecase, remove __gmpn prototypes.
28738         * mpn/x86/mul_basecase.S: Ditto.
28739         * mpn/x86/pentium/mul_basecase.S: Ditto.
28741         * configure.in (gmp_m4postinc): Use x86-defs.m4 on athlon-*-* too.
28743 2000-02-20  Kevin Ryde  <kevin@swox.se>
28745         * acinclude.m4 (GSYM_PREFIX): Drop $1, change by Linus.
28746         * mpn/asm-defs.m4 (PROLOGUE,EPILOGUE): Use GSYM_PREFIX as a
28747         string, change by Linus.
28748         * mpn/x86/x86-defs.m4: Use GSYM_PREFIX as a string.
28750         * mpn/x86/k6/gmp-mparam.h: New file.
28751         * mpn/asm-defs.m4 (m4_warning): New macro.
28753         * mpn/x86/README: Amendments per new code and directories.
28754         * mpn/x86/README.family: New file.
28755         * mpn/x86/k6/README: New file.
28756         * mpn/x86/k7/README: New file.
28758         * mpn/generic/mul_n.c: Rename __gmpn_mul_basecase to
28759         mpn_mul_basecase and __gmpn_sqr_basecase to mpn_sqr_basecase.
28760         * mpn/generic/mul_basecase.c: Ditto.
28761         * mpn/generic/sqr_basecase.c: Ditto.
28762         * mpn/generic/mul.c: Ditto.
28764 2000-02-19  Linus Nordberg  <linus@swox.se>
28766         * configure.in: Don't try to symlink more than one multi-func
28767         file.
28768         * configure: Regenerate.
28770 2000-02-18  Linus Nordberg  <linus@swox.se>
28772         * acinclude.m4 (GMP_CHECK_ASM_UNDERSCORE): GMP_DEFINE
28773         `GSYM_PREFIX'.  Run ACTIONs even when value is found in cache.
28774         (GMP_CHECK_ASM_ALIGN_LOG): GMP_DEFINE `ALIGN'.  Run ACTIONs even
28775         when value is found in cache.
28776         * aclocal.m4: Regenerate.
28778         * configure.in: Don't define GSYM_PREFIX or ALIGN.
28779         Add mechanism for multi-function files.
28780         * configure: Regenerate.
28782 2000-02-18  Kevin Ryde  <kevin@swox.se>
28784         * configure.in (gmp_m4postinc): Enable x86-defs.m4.
28785         * mpn/x86/k7/mul_1.asm: Fix include.
28786         * mpn/x86/k6/mul_basecase.S: Removed (copy of the pentium version).
28787         * mpn/x86/k6/mul_basecase.asm: New file.
28788         * mpn/x86/k6/sqr_basecase.asm: New file.
28789         * mpn/x86/k6/com_n.asm: New file.
28790         * mpn/x86/k6/copyi.asm: New file.
28791         * gmp.texi (Low-level Functions): Clarify mpn overlaps permitted.
28792         * gmp-impl.h (MPN_OVERLAP_P): New macro.
28793         * gmp-impl.h (assert_nocarry): New macro.
28794         * mpn/tests/ref.c: New file, based in part on other mpn/tests/*.c.
28795         * mpn/tests/ref.h: New file.
28797 2000-02-17  Linus Nordberg  <linus@swox.se>
28799         * Makefile.am (dist-hook): Don't include any emacs backup files
28800         (*.~*) in dist.
28801         * Makefile.in: Regenerate.
28803 2000-02-17  Torbjorn Granlund  <tege@swox.com>
28805         * mpn/sparc32/v9/mul_1.asm: Use `rd' to get current PC; get rid of
28806         getpc function.
28807         * mpn/sparc32/v9/addmul_1.asm: Likewise.
28808         * mpn/sparc32/v9/submul_1.asm: Likewise.
28810 2000-02-17  Kevin Ryde  <kevin@swox.se>
28812         * gmp.h: Add prototypes and defines for mpn_and_n, mpn_andn_n,
28813         mpn_com_n, mpn_copyd, mpn_copyi, mpn_ior_n, mpn_iorn_n,
28814         mpn_mul_basecase, mpn_nand_n, mpn_nior_n, mpn_sqr_basecase,
28815         mpn_xor_n, mpn_xorn_n.
28817         * mpn/asm-defs.m4: Many additions making up initial version.
28818         * mpn/asm-defs.m4 (L): Use defn(`LSYM_PREFIX').
28819         * mpn/x86/x86-defs.m4: New file.
28820         * mpn/x86/k6/aors_n.asm: New file.
28821         * mpn/x86/k6/divmod_1.asm: New file.
28822         * mpn/x86/k6/divrem_1.asm: New file.
28823         * mpn/x86/k6/lshift.S: Removed (was a copy of the pentium version).
28824         * mpn/x86/k6/lshift.asm: New file.
28825         * mpn/x86/k6/mod_1.asm: New file.
28826         * mpn/x86/k6/mul_1.S: Removed (was a copy of the pentium version).
28827         * mpn/x86/k6/mul_1.asm: New file.
28828         * mpn/x86/k6/rshift.S: Removed (was a copy of the pentium version).
28829         * mpn/x86/k6/rshift.asm: New file.
28830         * mpn/x86/k7/aors_n.asm: New file.
28831         * mpn/x86/k7/aorsmul_1.asm: New file.
28832         * mpn/x86/k7/mul_1.asm: New file.
28833         * mpn/x86/k7/rshift.asm: New file.
28834         * mpn/x86/p6/aorsmul_1.asm: New file.
28835         * mpn/x86/copyi.asm: New file.
28836         * mpn/x86/copyd.asm: New file.
28837         * mpn/lisp/gmpasm-mode.el: New file.
28839 2000-02-16  Torbjorn Granlund  <tege@swox.com>
28841         * mpn/sparc32/v9/mul_1.asm: Conditionalize for PIC.
28842         * mpn/sparc32/v9/addmul_1.asm: Likewise.
28843         * mpn/sparc32/v9/submul_1.asm: Likewise.
28844         * mpn/sparc32/v8/supersparc/udiv.asm: Likewise.
28845         * mpn/sparc32/udiv_fp.asm: Likewise.
28847 2000-02-16  Linus Nordberg  <linus@swox.se>
28849         * configure.in: Add mechanism for including target specific
28850         m4-files in config.m4.
28851         * configure: Regenerate.
28853         * acinclude.m4 (GMP_PROG_CCAS): Begin assembly lines (except
28854         labels) with a tab character.  HP-UX demands it.
28855         (GMP_CHECK_ASM_SIZE): Ditto.
28856         (GMP_CHECK_ASM_LSYM_PREFIX): Ditto.
28857         (GMP_CHECK_ASM_LABEL_SUFFIX): Set to empty string for HP-UX.
28858         (GMP_CHECK_ASM_GLOBL): Change `.xport' --> `.export'.
28859         * aclocal.m4: Regenerate.
28861 2000-02-16  Linus Nordberg  <linus@swox.se>
28863         * acinclude.m4 (GMP_CHECK_ASM_LSYM_PREFIX): Define LSYM_PREFIX as
28864         the prefix only, no argument.
28865         * aclocal.m4: Regenerate.
28866         * configure: Regenerate.
28868         * mpn/asm-defs.m4 (L): No argument to LSYM_PREFIX.
28870 2000-02-15  Linus Nordberg  <linus@swox.se>
28872         * acinclude.m4: Prefix all temporary shell variables with
28873         `gmp_tmp_'.
28874         (GMP_PROG_CC_FIND): Use defaults if no arguments are passed.
28875         Quote use of arguments.
28876         (GMP_PROG_CCAS): New macro.
28877         (GMP_INIT): New macro.
28878         (GMP_FINISH): New macro.
28879         (GMP_INCLUDE): New macro.
28880         (GMP_SINCLUDE): New macro.
28881         (GMP_DEFINE): New macro.
28882         (GMP_CHECK_ASM_LABEL_SUFFIX): New macro.
28883         (GMP_CHECK_ASM_TEXT): New macro.
28884         (GMP_CHECK_ASM_DATA): New macro.
28885         (GMP_CHECK_ASM_GLOBL): New macro.
28886         (GMP_CHECK_ASM_TYPE): New macro.
28887         (GMP_CHECK_ASM_SIZE): New macro.
28888         (GMP_CHECK_ASM_LSYM_PREFIX): New macro.
28889         (GMP_CHECK_ASM_W32): New macro.
28890         * aclocal.m4: Regenerate.
28892         * configure.in: Find m4 and nm for target.
28893         Use new macros to create config.m4.
28894         Prefix all temporary shell variables with `tmp_'.
28895         Pass `-X 64' to nm for 64-bit PPC target with 64-bit compiler.
28896         * configure: Regenerate.
28898         * Makefile.am (dist-hook): *Really* remove all CVS dirs in
28899         dist.
28900         * Makefile.in: Regenerate.
28902         * mpn/Makefile.am: Add target for building .lo and .o from
28903         .asm.
28904         Pass -DPIC to preprocessor (CPP/m4) when building .lo.
28905         Build .o a second time for target .lo, without -DPIC to
28906         preprocessor.
28907         (SUFFIX): Add `.asm'.
28908         (EXTRA_DIST): Add asm-defs.m4.
28909         * mpn/Makefile.in: Regenerate.
28911         * mpf/Makefile.in: Regenerate.
28912         * mpf/tests/Makefile.in: Regenerate.
28913         * mpq/Makefile.in: Regenerate.
28914         * mpq/tests/Makefile.in: Regenerate.
28915         * mpz/Makefile.in: Regenerate.
28916         * mpz/tests/Makefile.in: Regenerate.
28918 2000-02-15  Torbjorn Granlund  <tege@swox.com>
28920         * mpn/sparc32/udiv_fp.asm: Change `RODATA' to `DATA'.
28921         * mpn/sparc32/v8/supersparc/udiv.asm: Likewise.
28922         * mpn/sparc32/v9/addmul_1.asm: Likewise.
28923         * mpn/sparc32/v9/submul_1.asm: Likewise.
28924         * mpn/sparc32/v9/mul_1.asm: Likewise.
28926         * mpn/sparc32/add_n.asm: Rename `size' -> `n'.
28927         * mpn/sparc32/sub_n.asm: Likewise.
28929         * sparc32: Rename `.s' and `.S' files to `.asm'.
28930         * sparc64: Rename `.s' and `.S' files to `.asm'.
28932 2000-02-11  Torbjorn Granlund  <tege@swox.com>
28934         * config.sub: Adopt to new config.guess sparc naming conventions.
28936         * config.guess (sun4u:SunOS:5.*:*): Change `sparc9' to `sparcv9'.
28937         * config.guess (sun4m:SunOS:5.*:*): Change to sun4[md]:SunOS:5.*:* and
28938         change `sparc8' to `sparcv8'.
28940         * mpn/x86/add_n.S: Use PROLOGUE/EPILOGUE.
28941         * mpn/x86/sub_n.S: Likewise.
28943         * mpn/x86/syntax.h (PROLOGUE): New name for PROLOG.
28944         * mpn/x86/syntax.h (EPILOGUE): New name for EPILOG.
28946 2000-02-11  Linus Nordberg  <linus@swox.se>
28948         * configure.in: Better path for 64-bit sparc without 64-bit cc.
28949         Change sparc8 --> sparcv8.
28950         Change sparc9 --> sparcv9.
28951         * configure: Regenerate.
28953 2000-02-10  Linus Nordberg  <linus@swox.se>
28955         * configure.in: Use Autoconf.
28956         * Makefile.am: New file.
28958         * AUTHORS: New file.
28959         * COPYING: New file.
28960         * acinclude.m4: New file.
28961         * acconfig.h: New file.
28963         * configure: Generate.
28964         * Makefile.in: Generate.
28965         * aclocal.m4: Generate.
28966         * config.in: Generate.
28968         * install.sh: Remove.
28969         * install-sh: New file from Automake.
28970         * missing: New file from Automake.
28971         * ltconfig: New file from Libtool.
28972         * ltmain.sh: New file from Libtool.
28974         * mpf/Makefile.am: New file.
28975         * mpf/Makefile.in: Generate.
28976         * mpf/configure.in: Remove.
28977         * mpf/tests/Makefile.am: New file.
28978         * mpf/tests/Makefile.in: Generate.
28979         * mpf/tests/configure.in: Remove.
28981         * mpn/Makefile.am: New file.
28982         * mpn/Makefile.in: Generate.
28983         * mpn/configure.in: Remove.
28985         * mpq/Makefile.am: New file.
28986         * mpq/Makefile.in: Generate.
28987         * mpq/configure.in: Remove.
28988         * mpq/tests/Makefile.am: New file.
28989         * mpq/tests/Makefile.in: Generate.
28990         * mpq/tests/configure.in: Remove.
28992         * mpz/Makefile.am: New file.
28993         * mpz/Makefile.in: Generate.
28994         * mpz/configure.in: Remove.
28995         * mpz/tests/Makefile.am: New file.
28996         * mpz/tests/Makefile.in: Generate.
28997         * mpz/tests/configure.in: Remove.
28999 2000-02-10  Torbjorn Granlund  <tege@swox.com>
29001         * mpn/x86/add_n.S: Don't use label L0 twice.
29002         * mpn/x86/sub_n.S: Likewise.
29004 2000-01-20  Linus Nordberg  <linus@swox.se>
29006         * demos/pexpr.c: Don't use setup_error_handler() in windoze.
29008 2000-01-19  Torbjorn Granlund  <tege@swox.com>
29010         * demos/pexpr.c (sigaltstack): #define to sigstack for AIX.
29011         (setup_error_handler): Don't write to ss_size and ss_flags
29012         on AIX.
29014 2000-01-11  Torbjorn Granlund  <tege@swox.com>
29016         * mpn/configure.in (hppa2.0*-*-*): Move assignment of
29017         target_makefile_frag to where it belongs.
29019 1999-12-21  Torbjorn Granlund  <tege@swox.com>
29021         * longlong.h (v9 umul_ppmm): New #define.
29022         (v9 udiv_qrnnd): New #define.
29024 1999-12-14  Torbjorn Granlund  <tege@swox.com>
29026         * mpn/generic/divmod_1.c: Use invert_limb.
29027         * mpn/generic/mod_1.c: Use invert_limb.
29029         * gmp-impl.h (invert_limb): Put definition here.
29030         * mpn/generic/divrem.c (invert_limb): Delete definition.
29031         * mpn/generic/divrem_2.c (invert_limb): Delete definition.
29033         * gmp.h (mpn_divrem): Inhibit for non-gcc.
29034         But declare (undo 1999-11-22 change).
29036         * gmp-impl.h (DItype,UDItype): Do these also if _LONG_LONG_LIMB.
29038         * longlong.h: Move 64-bit hppa code out of __GNUC__ conditional.
29040         * stack-alloc.c (HSIZ): New #define.
29041         (__tmp_alloc): Use HSIZ instead of sizeof(tmp_stack).
29043 1999-12-10  Torbjorn Granlund  <tege@swox.com>
29045         * config.sub: Clean up handling of x86 CPUs: Properly recognize
29046         Amd CPUs as unique entities.  Use manufacturer's names of
29047         processors ("pentium", etc); still match ambiguous names like
29048         "i586", "i686", "p6" but be conservative in interpreting them.
29050         * configure.in: Recognize x86 CPU types known by config.guess.
29051         * mpn/configure.in: Likewise.  Add x86/mmx path component as
29052         appropriate.
29053         (athlon-*-*): Fix typo.
29055         * config.guess: Update x86 recog code to initially match
29056         more than just i386.
29057         Call K6-2 and K6-III for "k62" and "k63" respectively.
29059         * config.guess: Recognize x86 CPU types.
29060         Update code for FreeBSD, NetBSD, OpenBSD, Linux.
29062 1999-12-08  Torbjorn Granlund  <tege@swox.com>
29064         * mpf/pow_ui.c: Avoid final squaring in loop.
29066 1999-12-07  Torbjorn Granlund  <tege@swox.com>
29068         * gmp-impl.h (udiv_qrnnd_preinv2gen): Prefix local variables with `_'.
29069         (udiv_qrnnd_preinv2norm): Likewise.
29070         From Kevin Ryde:
29071         (HAVE_ALLOCA): #define also if defined (alloca).
29073 1999-12-04  Torbjorn Granlund  <tege@swox.com>
29075         * mpn/tests/add_n.c: Set OPS from CLOCK.
29076         * mpn/tests/sub_n.c: Likewise.
29077         * mpn/tests/mul_1.c: Likewise.
29078         * mpn/tests/addmul_1.c: Likewise.
29079         * mpn/tests/submul_1.c: Likewise.
29081         * mpn/tests/lshift.c: Update from add_n.c.
29082         * mpn/tests/rshift.c: Likewise.
29084 1999-12-03  Torbjorn Granlund  <tege@swox.com>
29086         * mpn/powerpc64/copy.S: New file.
29088 1999-12-02  Torbjorn Granlund  <tege@swox.com>
29090         * mpn/sparc64/copy.s: New file.
29092         * mpn/tests/copy.c: New file.
29094         * mpn/configure.in: Recognize more Amd CPUs; Set special paths for
29095         k7 CPU.
29097         * configure.in: Recognize Amd x86 CPUs.
29099         * mpz/fdiv_r_2exp.c: In rounding code, read in->_mp_size before
29100         writing to res->_mp_size.
29102         * mpn/powerpc64/*.S: Clean up assembly syntax, add function headers.
29103         * mpn/powerpc64/gmp-mparam.h: (KARATSUBA_MUL_THRESHOLD): #define.
29104         (KARATSUBA_SQR_THRESHOLD): #define.
29106         * mpn/tests/add_n.c (main): Only print test number if TIMES==1
29107         and not printing.
29108         (main): Don't run reference code if NOCHECK.
29109         * mpn/tests/sub_n.c: Likewise.
29110         * mpn/tests/mul_1.c: Likewise.
29111         * mpn/tests/addmul_1.c: Likewise.
29112         * mpn/tests/submul_1.c: Likewise.
29114         * mpn/tests/lshift.c: (main): Only print test number if TIMES==1
29115         and not printing.
29116         * mpn/tests/rshift.c: Likewise.
29118 1999-11-22  Torbjorn Granlund  <tege@swox.com>
29120         * gmp.h (mpz_init_set_str): Declare using __gmp_const.
29121         (mpz_set_str): Likewise.
29122         (mpf_init_set_str): Likewise.
29123         (mpf_set_str): Likewise.
29124         (mpn_set_str): Likewise.
29125         (__gmp_0): Likewise.
29126         (mpn_divrem): Remove separate declaration; it's defined later in
29127         this file.
29129         * gmp.h: Replace "defined (__STD__)' by (__STDC__-0) in
29130         expressions involving more than one term, to handle Sun's compiler
29131         that most helpfully sets __STDC__ to 0.
29132         * gmp-impl.h: Likewise.
29133         * longlong.h: Likewise.
29135 1999-11-21  Torbjorn Granlund  <tege@swox.com>
29137         * mpn/sparc64/gmp-mparam.h (KARATSUBA_MUL_THRESHOLD): #define.
29138         (KARATSUBA_SQR_THRESHOLD): #define.
29140         * mpn/sparc64/lshift.s: Compensate stack references for odd stack ptr.
29141         * mpn/sparc64/rshift.s: Likewise.
29143         * mpn/sparc64/addmul_1.s: Propagate carry properly.
29144         * mpn/sparc64/submul_1.s: Likewise.
29146         * mpn/sparc64/sub_n.s: Rewrite.
29148         * mpn/sparc64/sub_n.s: Get operand order for main subcc right
29149         (before scrapping this code for new code).
29151 1999-11-20  Torbjorn Granlund  <tege@swox.com>
29153         * mpn/sparc64/add_n.s: Rewrite.
29155 1999-11-17  Torbjorn Granlund  <tege@swox.com>
29157         * mpn/x86/syntax.h (PROLOG): New #define.
29158         (EPILOG): New #define.
29160         * gmp.h (mpn_addsub_n): Declare.
29161         * gmp.h (mpn_add_nc): Declare.
29162         * gmp.h (mpn_sub_nc): Declare.
29163         * mpn/powerpc64/addsub_n.S: New file.
29165 1999-11-17  Torbjorn Granlund  <tege@swox.com>
29167         * mpn/alpha/gmp-mparam.h
29168         (KARATSUBA_MUL_THRESHOLD): Only #define #ifndef.
29169         (KARATSUBA_SQR_THRESHOLD): Likewise.
29171 1999-11-14  Torbjorn Granlund  <tege@swox.com>
29173         * mpn/x86/mul_1.S: Unroll and optimize for P6 and K7.
29175 1999-11-09  Torbjorn Granlund  <tege@swox.com>
29177         * mpn/x86/p6/gmp-mparam.h
29178         (KARATSUBA_MUL_THRESHOLD): Only #define #ifndef.
29179         (KARATSUBA_SQR_THRESHOLD): Likewise.
29181 1999-11-05  Torbjorn Granlund  <tege@swox.com>
29183         * mpn/generic/addsub_n.c: New file.
29185 1999-11-02  Torbjorn Granlund  <tege@swox.com>
29187         * config.guess: Handle alpha:FreeBSD with alpha:NetBSD.
29189         * configure.in (vax*-*-*): New case.
29190         * config/mt-vax: New file.
29191         * mpn/vax/add_n.s: Rewrite.
29192         * mpn/vax/sub_n.s: Rewrite.
29194 1999-10-31  Torbjorn Granlund  <tege@swox.com>
29196         * mpn/vax/rshift.s: New file.
29197         * mpn/vax/lshift.s: New file.
29199 1999-10-29  Torbjorn Granlund  <tege@swox.com>
29201         * config.sub: Handle k5 and k6.
29202         * mpn/configure.in: Recognize k6.
29204         * mpf/tests/t-get_d.c (LOW_BOUND, HIGH_BOUND): New #defines.
29205         (main): Tighten error bounds to 14 digits.
29207         * longlong.h (default umul_ppmm, when smul_ppmm exists):
29208         Rename __m0 => __xm0, __m1 => __xm1.
29209         (default smul_ppmm): Likewise.
29211 1999-10-11  Torbjorn Granlund  <tege@swox.com>
29213         * config.guess: Reverse the test for POWER vs PowerPC.
29214         * config.guess (sun4m:SunOS:5.*:*): New case.
29215         * config.guess (sun4u:SunOS:5.*:*): New case.
29217 1999-09-29  Torbjorn Granlund  <tege@swox.com>
29219         * mpn/generic/divrem_2.c: Clean up comments.
29221 1999-09-23  Torbjorn Granlund  <tege@swox.com>
29223         * mpz/tests/Makefile.in: Use move-if-change when generating binaries.
29224         * mpf/tests/Makefile.in: Likewise.
29225         * mpq/tests/Makefile.in: Likewise.
29226         * mpz/tests/move-if-change: New file.
29227         * mpf/tests/move-if-change: New file.
29228         * mpq/tests/move-if-change: New file.
29230         * gmp.h (mpn_incr_u): New macro (from mpn/generic/mul_n.c).
29231         (mpn_decr_u): New macro.
29233         * mpn/generic/mul_n.c (mpn_incr): Delete.
29234         * mpn/generic/mul_n.c: Update usages mpn_incr => mpn_incr_u.
29235         * mpn/generic/divrem_newt.c: Use mpn_incr_u and mpn_decr_u instead of
29236         mpn_add_1 and mpn_sub_1.
29237         * mpn/generic/sqrtrem.c: Likewise.
29238         * mpz/cdiv_q_ui.c: Likewise.
29239         * mpz/cdiv_qr_ui.c: Likewise.
29240         * mpz/fdiv_q_ui.c: Likewise.
29241         * mpz/fdiv_qr_ui.c: Likewise.
29243         * mpn/generic/sqrtrem.c: Start single-limb Newton iteration from 18
29244         bits.
29246 1999-07-27  Torbjorn Granlund  <tege@swox.com>
29248         * mpn/generic/divrem_1.c (__gmpn_divrem_1n): New function.
29250         * mpn/generic/divrem_2.c: New file, code from divrem.c, `case 2:'.
29251         * mpn/Makefile.in: Compile divrem_2.c.
29252         * make.bat: Compile divrem_2.c.
29253         * mpn/configure.in (functions): Add divrem_2.
29254         * gmp.h: Declare mpn_divrem_2.
29256         * mpn/generic/divrem.c: Delete special cases, handle just divisors
29257         of more than 2 limbs.
29258         * gmp.h (mpn_divrem): Call mpn_divrem_1, mpn_divrem_2, as appropriate.
29260         * mpn/generic/divrem.c: Rework variable usage for better register
29261         allocation.
29263 1999-07-26  Torbjorn Granlund  <tege@swox.com>
29265         * mpn/alpha/ev5/add_n.s: Rewrite for better ev6 speed.
29266         * mpn/alpha/ev5/sub_n.s: Likewise.
29268 1999-07-21  Torbjorn Granlund  <tege@swox.com>
29270         * longlong.h (alpha): Define umul_ppmm for cc.
29272         * gmp-impl.h (DItype, UDItype): Define for non-gcc if _LONGLONG is
29273         defined.
29275 1999-07-15  Torbjorn Granlund  <tege@swox.com>
29277         * longlong.h (powerpc64 count_leading_zeros): Fix typo.
29278         (powerpc64 add_ssaaaa): Fix typos.
29279         (powerpc64 sub_ddmmss): Fix typos.
29281 1999-07-14  Torbjorn Granlund  <tege@swox.com>
29283         * mpz/tests/Makefile.in: Pass XCFLAGS when linking.
29284         * mpf/tests/Makefile.in: Likewise.
29285         * mpq/tests/Makefile.in: Likewise.
29286         * mpn/Makefile.in (.S.o): Pass XCFLAGS.
29288         * longlong.h: Add support for 64-bit PowerPC.
29289         * config.sub: Handle "powerpc64".
29290         * configure.in: Likewise.
29291         * mpn/configure.in: Suppress use of config/t-ppc-aix for now,
29292         it seems compiler passes proper options.
29293         * mpn/powerpc64/*.S: New files.
29295         * Makefile.in (FLAGS_TO_PASS): Pass "AR=$(AR)".
29297 1999-07-07  Torbjorn Granlund  <tege@swox.com>
29299         * demos/pexpr.c (factor): Change alloca call to a malloc/free pair.
29301         * mpn/powerpc32/syntax.h: Add #define's for crN.
29303         * gmp.h (gmp_rand_algorithm): Remove spurious `,'.
29305 1999-07-05  Torbjorn Granlund  <tege@swox.com>
29307         * mpn/generic/divrem_1.c: Normalize divisor when needed.
29309 1999-07-02  Torbjorn Granlund  <tege@swox.com>
29311         * mpn/configure.in (powerpc*-apple-mach): New configuration.
29312         * mpn/powerpc32/*: Add support for apple-macho syntax.
29313         * mpn/powerpc32/syntax.h: New file.
29314         * gmp-impl.h: Don't use `__attribute__' syntax for Apple's perversion
29315         of GCC.
29317 1999-05-26  Linus Nordberg  <linus@swox.se>
29319         * rand.c (gmp_rand_init): Fix typo.
29321         * mpn/generic/rawrandom.c (mpn_rawrandom): Count bits, not limbs,
29322         to keep track of how many rounds to do in loop.  Clean up
29323         temporary allocation.  Update `seedsize' inside loop.  Mask off
29324         the correct number of bits from final result.  Init `mcopyp' even
29325         when not normalizing `m'.
29327         * randlc.c (gmp_rand_init_lc): Fix typo (don't call
29328         mpz_init_set_ui()).
29330         * mpn/generic/rawrandom.c (mpn_rawrandom): Set SIZ(s->seed) when
29331         reallocating.
29333         * tests/rand/Makefile (test, bigtest): Add 33-bit tests.
29335         * tests/rand/gen.c (main): Set precision of variable passed to
29336         mpf_urandomb().  Add option `-p'.
29338 1999-05-25  Linus Nordberg  <linus@swox.se>
29340         * randcm.c: Remove.
29341         * randcmui.c: Remove.
29342         * Makefile.in: Remove randcm and randcmui.
29343         * make.bat: Ditto.
29344         * gmp-impl.h: Remove prototypes for __gmp_rand_init_common() and
29345         __gmp_rand_init_common_ui().
29346         * randlc.c (gmp_rand_init_lc): Don't call
29347         __gmp_rand_init_common().
29349         * randlcui.c (gmp_rand_init_lc_ui): Don't call
29350         __gmp_rand_init_common_ui().
29352         * gmp.h (__gmp_rand_state_struct): Remove unused member `maxval'.
29353         * randclr.c (gmp_rand_clear): Remove reference to s->maxval.
29354         * randcm.c (__gmp_rand_init_common): Ditto
29356         * mpn/generic/rawrandom.c (mpn_rawrandom): Don't calculate nlimbs
29357         twice.
29359         * gmp.h (__gmp_rand_dist): Remove.
29361 1999-05-24  Linus Nordberg  <linus@swox.se>
29363         * mpn/generic/rawrandom.c: Clean up comments.
29365         * gmp.texi: Add documentation for random number generation.
29367 1999-05-21  Linus Nordberg  <linus@swox.se>
29369         * gmp.h: Typedef `gmp_rand_state' as an array with one element.
29370         Change prototypes accordingly.
29371         * gmp-impl.h: Change prototypes using `gmp_rand_state'.
29372         * rand.c (gmp_rand_init): Take `gmp_rand_state' as argument
29373         instead of a pointer to a `gmp_rand_state'.
29374         * mpf/urandom.c (mpf_urandomb): Ditto.
29375         * mpz/urandom.c (mpz_urandomb): Ditto.
29376         * mpn/generic/rawrandom.c (mpn_rawrandom): Ditto.
29377         * randcmui.c (__gmp_rand_init_common_ui): Ditto.
29378         * randlc.c (gmp_rand_init_lc): Ditto.
29379         * randlcui.c (gmp_rand_init_lc_ui): Ditto.
29380         * randui.c (gmp_rand_init_ui): Ditto.
29381         * randcm.c (__gmp_rand_init_common): Ditto.
29382         * randclr.c (gmp_rand_clear): Ditto.
29384         * tests/rand/gen.c (main): Pass `s' to rand-funcs instead of address
29385         of `s'.
29387 1999-05-20  Linus Nordberg  <linus@swox.se>
29389         * Makefile.in: Rename randi.c --> rand.c, randi_lc.c --> randlc.c,
29390         randicom.c --> randcm.c.  Add randui.c, randcmui.c, randlcui.c.
29391         * make.bat: Ditto.
29393         * gmp.h: Add prototypes for gmp_rand_init_ui() and
29394         gmp_rand_init_lc_ui().
29395         * gmp-impl.h: Add prototypes for __gmp_rand_init_common() and
29396         __gmp_rand_init_common_ui().
29398         * randlc.c, randcm.c, randclr.c, rand.c: Change #include of
29399         <gmp.h> to "gmp.h".
29400         * randclr.c: Include stdlib.h for free().
29401         * rand.c: Include gmp-impl.h.
29403 1999-05-12  Torbjorn Granlund  <tege@swox.com>
29405         * mpn/configure.in: Put generic m68k alternative last.
29407 1999-05-04  Torbjorn Granlund  <tege@swox.com>
29409         * demos/pexpr.c (setup_error_handler): Use sigemptyset to create
29410         empty set (for portability).
29411         (fns): Fix typo '#if #if'.
29412         (mpz_eval_expr): Implement FERMAT and MERSENNE.
29414         * demos/pexpr.c: Cast longjmp argument via long to silent warnings on
29415         64-bit hosts.
29417 1999-05-03  Torbjorn Granlund  <tege@swox.com>
29419         * demos/pexpr.c: Add #defines for GMP 1.x and 2.0 compatibility.
29421         * demos/pexpr.c (setup_error_handler): New function; take signal
29422         handler setup code from main(), with major modifications to use modern
29423         signal interface.
29424         (main): Remove signal handler setup code; call setup_error_handler.
29426 1999-04-29  Linus Nordberg  <linus@swox.se>
29428         * tests/rand/findcl.c (main): Add option '-i' for interval factor.
29429         Separate v and merit lose figures.  Add '-v' for version.
29431 1999-04-28  Linus Nordberg  <linus@swox.se>
29433         * tests/rand/statlib.c: Change debugging stuff.
29435         * tests/rand/gmpstat.h: Add debug values definitions.
29437         * tests/rand/findcl.c (main): Print low and high merit on startup.
29438         Print version string on startup.  Catch SEGV and HUP.  Add option -d
29439         for debug.  Fix bug making test for v too hard.
29440         (sh_status): New function.
29441         (sh_status): Flush stdout.  Add RCSID.
29443 1999-04-27  Linus Nordberg  <linus@swox.se>
29445         * tests/rand/Makefile (clean): Add target.
29447 1999-04-27  Linus Nordberg  <linus.nordberg@canit.se>
29449         * tests/rand/stat.c: Include gmpstat.h.
29450         Add global int g_debug.
29452         * tests/rand/spect.c: Include <unistd.h>.
29454         * tests/rand/findcl.c (main): Input is `m', not all factors of `m'.
29455         Print only the very first matching multiplier.  Include <unistd.h>.
29456         Flush stdout.  Print "done." when done.
29458         * tests/rand/spect.c: Move everything but main() to statlib.c.
29460         * tests/rand/findcl.c: New file.
29462         * tests/rand/gmpstat.h: New file.
29464         * tests/rand/statlib.c (merit, merit_u, f_floor, vz_dot,
29465         spectral_test): New functions.
29467 1999-04-27  Torbjorn Granlund  <tege@swox.com>
29469         * mpn/configure.in: Fix typo, "sparc-*)" was "sparc)".
29471 1999-04-21  Torbjorn Granlund  <tege@swox.com>
29473         * config.sub: Recognize ev6.
29475 1999-04-12  Linus Nordberg  <linus.nordberg@canit.se>
29477         * urandom.c: Split up into randclr.c, randi.c, randi_lc.c,
29478         randicom.c.
29479         * randclr.c, randi.c, randi_lc.c, randicom.c: New files.
29480         * Makefile.in: Remove urandom.  Add randclr, randi, randi_lc,
29481         randicom.
29482         * make.bat: Ditto
29484 1999-03-31  Torbjorn Granlund  <tege@matematik.su.se>
29486         * configure.in (sparc9-*-solaris2.[789]*, etc): New alternative.
29487         * mpn/configure.in: Use mt-sprc9 also for ultrasparc*-*-solaris2*.
29489 1999-03-30  Linus Nordberg  <linus.nordberg@canit.se>
29491         * urandom.c (__gmp_rand_scheme): Change NULL->0.
29492         Include "gmp.h" instead of <gmp.h>.
29494 1999-03-29  Linus Nordberg  <linus.nordberg@canit.se>
29496         * gmp.h (__gmp_rand_data_lc): Now holds a, c, m instead of scheme
29497         struct.
29498         (__gmp_rand_lc_scheme_struct): Remove mpz_t's `a' and `m'.
29500         * tests/rand/stat.c (f_freq): Don't print 2nd level results if doing
29501         1st level.
29503         * tests/rand/gen.c (main): Set default algorithm to mpz_urandomb.
29504         (main): Add option -c.
29506 1999-03-24  Linus Nordberg  <linus.nordberg@canit.se>
29508         * tests/rand/Makefile (GMPINC): Rename to GMPH.
29509         (GMPH): Add gmp-mparam.h.
29510         (CFLAGS): Add -I$(GMPLIBDIR)/mpn
29512 1999-03-23  Linus Nordberg  <linus.nordberg@canit.se>
29514         * Makefile.in: Compile top-dir/urandom.c.
29515         * make.bat: Ditto.
29517         * mpn/Makefile.in: Compile rawrandom.c.
29518         * make.bat: Ditto.
29520         * mpn/configure.in (functions): Add rawrandom.
29522         * gmp.h (__gmp_rand_scheme_struct): Rename to
29523         __gmp_rand_lc_scheme_struct.
29524         (__gmp_rand_data_lc): Remove member 'n'.  Allocate a
29525         __gmp_rand_lc_scheme_struct instead of a pointer to one.
29526         Add prototype for gmp_rand_init_lc(), mpn_rawrandom().
29527         New prototype for mpz_urandomb().
29529         * urandom.c: New file.
29530         (__gmp_rand_init_common): New function.
29531         (gmp_rand_init_lc): New function.
29532         (gmp_rand_init): Don't init data_lc->n.  Call gmp_rand_init_lc()
29533         and __gmp_rand_init_common().
29534         (gmp_rand_clear): Remove reference to data_lc->n.
29536         * mpz/urandom.c (gmp_rand_init, gmp_rand_clear): Move to new file
29537         urandom.c in top-dir.
29538         (mpz_urandomb): Add function parameter nbits.  Call mpn_rawrandom().
29540         * mpf/urandom.c (mpf_urandomb): Call mpn_rawrandom().
29542         * mpn/generic/rawrandom.c: New file.
29543         (mpn_rawrandom): New function.
29545 1999-03-17  Torbjorn Granlund  <tege@matematik.su.se>
29547         * extract-dbl.c: When packing result, adjust exp when sc == 0.
29549         * mpf/tests/t-get_d.c: New file.
29550         * mpf/tests/Makefile.in: Compile t-get_d.c.
29552 1999-03-16  Linus Nordberg  <linus.nordberg@canit.se>
29554         * mpz/urandom.c (__gmp_rand_scheme): Add extra braces around the
29555         mpz_t members.
29557         * make.bat: Compile mpz/urandom.c and mpf/urandom.c
29559         * tests/rand/statlib.c (ks_table): Use mpf_pow_ui() and exp().
29561         * tests/rand/gen.c: Include unistd.h for getopt.
29563 1999-03-15  Linus Nordberg  <linus.nordberg@canit.se>
29565         * mpz/urandom.c (gmp_rand_init): New function.
29566         (gmp_rand_clear): New function.
29567         (mpz_urandomb): New function.
29569         * mpz/Makefile.in: Compile urandom.c
29571         * mpf/urandom.c (mpf_urandomb): New function.
29573         * mpf/Makefile.in: Compile urandom.c.
29575         * gmp.h (__gmp_rand_state_struct, __gmp_rand_scheme_struct): New
29576         structs for randomization functions.
29577         (gmp_rand_dist, gmp_rand_alogrithm): New enums for randomization
29578         functions.
29579         (mpz_urandomb, mpf_urandomb): Add prototype.
29580         (gmp_rand_init, gmp_rand_clear): Add prototype.
29582         * tests/rand/gen.c, stat.c, statlib.c, statlib.h: New files.
29583         * tests/rand/Makefile, tests/rand/ChangeLog: New files.
29585 1999-03-15  Torbjorn Granlund  <tege@matematik.su.se>
29587         * .gdbinit: New file.
29589         * mpz/dump.c: New file.
29590         * mpz/Makefile.in: Compile dump.c.
29591         * make.bat: Likewise.
29592         * gmp.h (mpz_dump): Declare.
29594 1999-03-14  Torbjorn Granlund  <tege@matematik.su.se>
29596         * mpz/tests/reuse.c: Also test mpz_invert and mpz_divexact.
29598         * mpz/tests/convert.c: Update to GMP 2 variable syntax.
29600 1999-03-13  Torbjorn Granlund  <tege@matematik.su.se>
29602         * mpf/README: New file.
29603         * mpz/README: New file.
29605         * mpf/pow_ui.c: New file.
29606         * mpf/Makefile.in: Compile pow_ui.c.
29607         * make.bat: Likewise.
29608         * gmp.h (mpf_pow_ui): Declare.
29610 1999-03-12  Torbjorn Granlund  <tege@matematik.su.se>
29612         * mpn/configure.in: Stage 1 of rewrite.
29613         * mpn/underscore.h: New name for bsd.h.
29614         * mpn/sysv.h: Deleted.
29616         * mpn/m68k/*: Don't include sysdep.h.
29618         * mpn/pa64/README: New file.
29620 1999-03-11  Torbjorn Granlund  <tege@matematik.su.se>
29622         * mpn/powerpc32/add_n.S: Add support for both AIX and ELF syntax.
29623         Renamed from `.s'.
29624         * mpn/powerpc32/sub_n.S: Likewise.
29625         * mpn/powerpc32/lshift.S: Likewise.
29626         * mpn/powerpc32/rshift.S: Likewise.
29627         * mpn/powerpc32/mul_1.S: Likewise.
29628         * mpn/powerpc32/addmul_1.S: Likewise.
29629         * mpn/powerpc32/submul_1.S: Likewise.
29631         * mpn/powerpc32/umul.S: New file.
29632         * mpn/sparc32/v8/umul.S: New file.
29633         * mpn/sparc32/umul.S: New file.
29634         * mpn/x86/umul.S: New file.
29635         * mpn/x86/udiv.S: New file.
29637         * mpn/Makefile.in (mul_basecase.o): Delete rule.
29639 1999-02-22  Torbjorn Granlund  <tege@matematik.su.se>
29641         * configure.in (hppa2.0*-*-*): Force use of GCC.
29643         * extract-dbl.c: Handle IEEE denormalized numbrs.  Clean up.
29645 1998-12-02  Torbjorn Granlund  <tege@matematik.su.se>
29647         * mpn/Makefile.in (CCAS): New macro.
29648         (.s.o): Use CCAS.
29649         (.S.o): Likewise.
29651         * mpn/Makefile.in (mul_basecase.o): Add dependency.
29652         (sqr_basecase.o): Likewise.
29653         (mod_1.o): Likewise.
29655         * demos/pexpr.c (cputime): Test also __hpux.
29656         (cleanup_and_exit): Check SIGXCPU only #ifdef LIMIT_RESOURCE_USAGE.
29658         * mpz/tests/t-2exp.c: Use urandom, not random.
29660         * mpn/configure.in (arm*-*-*): New alternative.
29662 1998-11-30  Torbjorn Granlund  <tege@matematik.su.se>
29664         * gmp-impl.h (union ieee_double_extract): Special case for
29665         little-endian arm.
29666         (LIMBS): Alias for PTR.
29668 1998-11-26  Torbjorn Granlund  <tege@matematik.su.se>
29670         * longlong.h (m68000 umul_ppmm): Use `muluw', not `mulu'.
29671         (m68k stuff): Clean up; add coldfire support.
29673 1998-11-23  Torbjorn Granlund  <tege@matematik.su.se>
29675         * mpn/mips3/gmp-mparam.h (KARATSUBA_MUL_THRESHOLD): #define.
29676         (KARATSUBA_SQR_THRESHOLD): #define.
29678         * mpn/sparc32/v9/README: New file.
29680 1998-11-20  Torbjorn Granlund  <tege@matematik.su.se>
29682         * mpn/x86/README: New file.
29684         * mpn/arm/gmp-mparam.h: New file.
29685         * mpn/pa64/gmp-mparam.h: New file.
29686         * mpn/hppa/gmp-mparam.h: New file.
29687         * mpn/x86/pentium/gmp-mparam.h: New file.
29688         * mpn/sparc32/v9/gmp-mparam.h: New file.
29689         * mpn/powerpc32/gmp-mparam.h: New file.
29690         * mpn/x86/p6/gmp-mparam.h: New file.
29692         * mpn/alpha/gmp-mparam.h (KARATSUBA_MUL_THRESHOLD): #define.
29693         (KARATSUBA_SQR_THRESHOLD): #define.
29695         * mpn/configure.in: Point to x86/p6 when appropriate.
29697         * mpn/power/umul.s: New file.
29698         * mpn/power/sdiv.s: New file.
29699         * mpn/pa64/addmul_1.S: New file.
29700         * mpn/pa64/submul_1.S: New file.
29701         * mpn/pa64/mul_1.S: New file.
29702         * mpn/pa64/udiv_qrnnd.c: New file.
29703         * mpn/pa64/umul_ppmm.S: New file.
29704         * mpn/mips2/umul.s: New file.
29705         * mpn/m68k/mc68020/umul.s: New file.
29706         * mpn/m68k/mc68020/udiv.s: New file.
29707         * mpn/hppa/hppa1_1/umul.s: New file.
29708         * mpn/alpha/umul.s: New file.
29709         * mpn/a29k/udiv.s: New file.
29710         * mpn/a29k/umul.s: New file.
29712 1998-11-17  Torbjorn Granlund  <tege@matematik.su.se>
29714         * mpn/x86/mul_basecase.S: New file for non-pentiums.
29715         * mpn/x86/mul_basecase.S: Move to mpn/x86/pentium.
29717 1998-11-16  Torbjorn Granlund  <tege@matematik.su.se>
29719         * make.bat: Compile mul_basecase.c and sqr_basecase.c.
29721 1998-11-10  Torbjorn Granlund  <tege@matematik.su.se>
29723         * mpz/invert.c: Defer writing to parameter `invert' until
29724         end.
29726 1998-11-03  Torbjorn Granlund  <tege@matematik.su.se>
29728         * mpn/pa64/udiv_qrnnd.c: Handle more border cases.
29730 1998-10-29  Torbjorn Granlund  <tege@matematik.su.se>
29732         * insert-dbl.c: Special case biased exponents < 1; Get boundary for
29733         Inf right.
29735         * longlong.h (COUNT_LEADING_ZEROS_NEED_CLZ_TAB): New #define.
29737 1998-10-28  Torbjorn Granlund  <tege@matematik.su.se>
29739         * mpn/powerpc32/submul_1.s: Rewrite, optimizing for PPC604.
29740         * mpn/powerpc32/addmul_1.s: Likewise.
29741         * mpn/powerpc32/lshift.s: Likewise.
29743 1998-10-23  Torbjorn Granlund  <tege@matematik.su.se>
29745         * config/mt-sprc9-gcc (XCFLAGS): Add -Wa,-xarch=v8plus.
29747         * mpn/sparc32/v9/submul_1.s: New file.
29749 1998-10-21  Torbjorn Granlund  <tege@matematik.su.se>
29751         * mpn/config/mt-pa2hpux: New file.
29752         * mpn/configure.in (hppa2.0*-*-*): Use new 64-bit code.
29754         * config.sub: Recognize hppa2.0 as CPU type.
29756         * longlong.h (64-bit hppa): Add umul_ppmm and udiv_qrnnd.
29757         * mpn/pa64/mul_1.S: New file.
29758         * mpn/pa64/addmul_1.S: New file.
29759         * mpn/pa64/submul_1.S: New file.
29760         * mpn/pa64/umul_ppmm.S: New file.
29761         * mpn/pa64/udiv_qrnnd.c: New file.
29763 1998-10-20  Torbjorn Granlund  <tege@matematik.su.se>
29765         * mpz/pprime_p.c: Pass 1L, not 1, to mpz_cmp_ui.
29767         * mpz/fdiv_q_2exp.c: Cast `long' argument to `mp_limb_t' for mpn calls.
29768         * mpz/gcd_ui.c: Likewise.
29769         * mpz/add_ui.c: Likewise.
29770         * mpz/sub_ui.c: Likewise.
29772 1998-10-19  Torbjorn Granlund  <tege@matematik.su.se>
29774         * mpn/generic/bdivmod.c: Avoid using switch statement with mp_limb_t
29775         index.
29777 1998-10-17  Torbjorn Granlund  <tege@matematik.su.se>
29779         * mpn/sparc32/v9/mul_1.s: Misc cleanups.
29780         * mpn/sparc32/v9/addmul_1.s: Misc cleanups.
29782 1998-10-16  Torbjorn Granlund  <tege@matematik.su.se>
29784         * mpn/tests/{add,sub,}mul_1.c: Print xlimb using mpn_print.
29786         * mpz/tests/t-powm.c (SIZE): Increase to 50.
29787         (EXP_SIZE): New parameter; use it for computing exp_size.
29789 1998-10-15  Torbjorn Granlund  <tege@matematik.su.se>
29791         * mpn/generic/divrem_newt.c: Use TMP_ALLOC interface.
29793         * mpn/generic/sqrtrem.c: Check BITS_PER_MP_LIMB before defining
29794         assembly variants of SQRT.
29796 1998-10-14  Torbjorn Granlund  <tege@matematik.su.se>
29798         * mpn/tests: Clean up timing routines.  Don't include longlong.h
29799         where it is not needed.
29800         (mpn_print): Handle printing when _LONG_LONG_LIMB.
29801         * mpn/tests/{add,sub,}mul_1.c: Generate xlimb with mpn_random2
29802         and do it whether TIMES != 1 or not.
29804         * mpn/generic/mul_n.c: Delay assignment of `sign' for lower
29805         register pressure.
29807         * mpn/sparc32/v9/mul_1.s: New file.
29809         * config/mt-sprc9-gcc: New file.
29810         * configure.in: Use it.
29812         * mpn/configure.in: Use sparc64 for Solaris 2.7 and later with a
29813         sparc v9 CPU.
29814         * mpn/configure.in: Use sparc32/v9 for Solaris 2.6 or earlier with
29815         a sparc v9 CPU.
29817         * mpf/sub.c: In initial code for ediff == 0, limit precision
29818         before jumping to `normalize'.
29820 1998-10-13  Torbjorn Granlund  <tege@matematik.su.se>
29822         * mpn/hppa/hppa2_0/add_n.s: New file.
29823         * mpn/hppa/hppa2_0/sub_n.s: New file.
29824         * mpn/configure.in: Handle hppa2.0 (32-bit code for now).
29826         * config.guess: Update from egcs 1.1.
29827         (9000/[3478]??:HP-UX:*:*): Properly return 2.0 for all known 2.0
29828         machines.
29830 1998-10-07  Torbjorn Granlund  <tege@matematik.su.se>
29832         * mpz/root.c (mpz_root): New file.
29833         * mpz/Makefile.in: Compile it.
29834         * make.bat: Likewise.
29835         * gmp.h (mpz_root): Declare.
29837         * mpz/perfpow.c: New file.
29838         * mpz/Makefile.in: Compile it.
29839         * make.bat: Likewise.
29840         * gmp.h (mpz_perfect_power_p): Declare.
29842         * mpz/remove.c: New file.
29843         * mpz/Makefile.in: Compile it.
29844         * make.bat: Likewise.
29845         * gmp.h (mpz_remove): Declare.
29847         * mpz/bin_ui.c: New file.
29848         * mpz/Makefile.in: Compile it.
29849         * make.bat: Likewise.
29850         * gmp.h (mpz_bin_ui): Declare.
29852         * mpz/bin_uiui.c: New file.
29853         * mpz/Makefile.in: Compile it.
29854         * make.bat: Likewise.
29855         * gmp.h (mpz_bin_uiui): Declare.
29857 1998-09-16  Torbjorn Granlund  <tege@matematik.su.se>
29859         * longlong.h: Test for __powerpc__ in addition to _ARCH_PPC.
29861 Sat Sep  5 17:22:28 1998  Torbjorn Granlund  <tege@matematik.su.se>
29863         * mpf/cmp_si.c: Compare most significant mantissa limb before
29864         trying to deduce anything from the limb count.
29865         * mpf/cmp_ui.c: Likewise.
29867 Tue Aug 18 10:24:39 1998  Torbjorn Granlund  <tege@matematik.su.se>
29869         * mpz/pprime_p.c (mpz_probab_prime_p): Add new code block
29870         for doing more dividing.
29872 Sat Aug 15 18:43:17 1998  Torbjorn Granlund  <tege@matematik.su.se>
29874         * mpn/generic/divrem_newt.c: New name for divrem_newton.c.
29875         * mpn/Makefile.in: Corresponding changes.
29876         * mpn/configure.in: Likewise.
29878 Wed Aug 12 23:07:09 1998  Torbjorn Granlund  <tege@matematik.su.se>
29880         * config.guess: Handle powerpc for NetBSD.
29882 Tue Jul 28 23:10:55 1998  Torbjorn Granlund  <tege@matematik.su.se>
29884         * mpz/fib_ui.c: New file.
29885         * mpz/Makefile.in: Compile it.
29886         * make.bat: Likewise.
29887         * gmp.h (mpz_fib_ui): Declare.
29889 Wed Jun 17 22:52:58 1998  Torbjorn Granlund  <tege@matematik.su.se>
29891         * make.bat: Fix typo, `asm-synt.h' => `asm-syntax.h'.
29893 Wed Jun  3 11:27:32 1998  Torbjorn Granlund  <tege@matematik.su.se>
29895         * config/mt-pwr: New file.
29896         * config/mt-ppc: New file.
29897         * configure.in: Use the new files.
29899 Tue Jun  2 13:04:17 1998  Torbjorn Granlund  <tege@matematik.su.se>
29901         * mpn/sparc32/v9/addmul_1.s: New file.
29902         * mpn/config/mt-sprc9: New file.
29903         * mpn/configure.in: Use mt-sprc9.
29905 Tue May 26 11:24:18 1998  Torbjorn Granlund  <tege@matematik.su.se>
29907         * demos/factorize.c (factor_using_pollard_rho): Pass correct
29908         parameters in recursive calls; join the two recursion arms.
29910         * mpf/set_q.c: Set result sign.
29911         When normalizing the numerator, don't allow it to increase in size
29912         beyond prec.
29914 Tue May 19 17:28:14 1998  Torbjorn Granlund  <tege@matematik.su.se>
29916         * demos/factorize.c (factor_using_division): Call fflush
29917         also for the factor 2.
29919 Mon May 18 15:51:01 1998  Torbjorn Granlund  <tege@matematik.su.se>
29921         * make.bat: Pass -fomit-frame-pointer.  Do not pass -g.
29923 Tue May  5 01:42:50 1998  Torbjorn Granlund  <tege@matematik.su.se>
29925         * mpz/Makefile.in (LOCAL_CC): Remove definition.
29927         * gmp.h: Get rid of GMP_SMALL stuff.
29928         * mpz/Makefile.in: Likewise.
29929         * mpq/Makefile.in: Likewise.
29930         * mpf/Makefile.in: Likewise.
29932         * mpz/invert.c: Fix typo in comment.
29934 Mon May  4 23:05:32 1998  Torbjorn Granlund  <tege@matematik.su.se>
29936         * mpn/generic/sqrtrem.c: Check that __arch64__ is not defined
29937         before defining sparc SQRT.
29939 Mon Apr 20 19:16:17 1998  Torbjorn Granlund  <tege@matematik.su.se>
29941         * mpn/generic/gcdext.c: Allow gp to be NULL.
29943 1998-04-03  Torbjorn Granlund  <tege@matematik.su.se>
29945         * mpn/configure.in: Recognize `alphaev5*', not `alphaev5'.
29947         * config.guess: Handle CPU variants for NetBSD.
29949 Mon Mar 16 13:07:54 1998  Torbjorn Granlund  <tege@matematik.su.se>
29951         * mpz/pprime_p.c: Use mpn_mod_1/mpn_preinv_mod_1 for computing mod PP,
29952         not mpz_tdiv_r_ui (which expects an `unsigned long').
29953         (mpz_probab_prime_p): Change type of `r' to mp_limb_t.
29955 Thu Mar 12 17:19:04 1998  Torbjorn Granlund  <tege@matematik.su.se>
29957         * gmp.h (mpf_ceil, mpf_floor, mpf_trunc): Add declarations.
29959         * config.guess: Update from FSF version.
29960         * config.sub: Likewise.
29962         * config.guess: Add special handling of alpha-*-NetBSD.
29964 Wed Mar 11 00:55:34 1998  Torbjorn Granlund  <tege@matematik.su.se>
29966         * mpz/inp_str.c: Update from set_str.c.
29967         Properly increment `nread' when skipping minus sign.
29969         * mpz/set_str.c: Check for empty string after having skipped
29970         leading zeros.
29972 Mon Mar  9 19:28:00 1998  Torbjorn Granlund  <tege@matematik.su.se>
29974         * mpz/set_str.c: Skip leading zeros.
29976 Wed Mar  4 19:29:16 1998  Torbjorn Granlund  <tege@matematik.su.se>
29978         * gmp.h (mpz_cmp_si): Cast argument before calling mpz_cmp_ui.
29980         * demos/factorize.c: Rewrite.
29982 1998-02-04  Torbjorn Granlund  <tege@matematik.su.se>
29984         * configure.in (i[3456]86* etc): Check if using gcc before
29985         choosing mt-x86.
29987         * configure.in (m68*-*-*): New alternative.
29988         * config/mt-m68k: New file.
29990         * mpn/alpha/invert-limb.s: Put tables in text segment,
29991         since not all systems support "rdata".
29993 Wed Feb  4 02:20:57 1998  Torbjorn Granlund  <tege@matematik.su.se>
29995         * gmp.h (__GNU_MP_VERSION_SNAP): New #define.
29996         (__GNU_MP_VERSION_MINOR): Now 1.
29998 Wed Jan 28 22:29:36 1998  Torbjorn Granlund  <tege@tunnis.tmg.se>
30000         * longlong.h (alpha udiv_qrnnd): #define UDIV_NEEDS_NORMALIZATION.
30002 Wed Jan 28 20:28:19 1998  Torbjorn Granlund  <tege@sophie.matematik.su.se>
30004         * mpz/pprime_p.c (mpz_probab_prime_p): Delete 59 from tried divisors.
30006 Mon Jan 26 01:39:02 1998  Torbjorn Granlund  <tege@tunnis.tmg.se>
30008         * mpz/pprime_p.c (mpz_probab_prime_p): Major overhaul: Check small
30009         numbers specifically; check small factors, then perform a fermat test.
30011 Tue Jan 13 14:58:28 1998  Torbjorn Granlund  <tege@tunnis.tmg.se>
30013         * longlong.h (alpha udiv_qrnnd): Call __mpn_invert_normalized_limb
30014         and udiv_qrnnd_preinv.
30016 Wed Jan  7 01:52:54 1998  Torbjorn Granlund  <tege@tunnis.tmg.se>
30018         * mpn/configure.in (alpha*, extra_functions): Add invert-limb and
30019         remove udiv_qrnnd.
30021         * mpn/tests/divrem.c: Get allocations right.
30023         * mpn/generic/divrem.c: Conditionally pre-invert most significant
30024         divisor limb.
30026 Tue Jan  6 23:08:54 1998  Torbjorn Granlund  <tege@tunnis.tmg.se>
30028         * mpn/generic/divrem_1.c: Rename variables to comply to conventions.
30029         Make `i' have type `mp_size_t'.
30031 Tue Dec 30 22:21:42 1997  Torbjorn Granlund  <tege@matematik.su.se>
30033         * mpz/tdiv_qr_ui.c: Return the remainder.
30034         * mpz/tdiv_r_ui.c: Likewise.
30035         * mpz/tdiv_q_ui.c: Likewise.
30036         * gmp.h: Change return type of mpz_tdiv_qr_ui, mpz_tdiv_r_ui,
30037         mpz_tdiv_q_ui.
30039         * mpz/tdiv_ui.c: New file.
30040         * mpz/Makefile.in: Compile it.
30041         * make.bat: Likewise.
30042         * gmp.h (mpz_tdiv_ui): Declare.
30044 Fri Nov  7 04:21:15 1997  Torbjorn Granlund  <tege@matematik.su.se>
30046         * mpf/integer.c (FUNC_NAME): Fix bogus test for mpf_trunc.
30048         * demos/isprime.c: New file.
30050         Sat Nov  1 19:32:25 1997  Torbjorn Granlund  <tege@matematik.su.se>
30052         * mpz/cmp_abs.c: New file.
30053         * mpz/Makefile.in: Compile it.
30054         * make.bat: Likewise.
30055         * gmp.h (mpz_cmp_abs): Declare.
30057         * mpz/cmp_abs_ui.c: New file.
30058         * mpz/Makefile.in: Compile it.
30059         * make.bat: Likewise.
30060         * gmp.h (mpz_cmp_abs_ui): Declare.
30062 Sat Sep 27 04:49:52 1997  Torbjorn Granlund  <tege@tunnis.tmg.se>
30064         * mpz/fdiv_r_2exp.c: Get allocation for `tmp' right.
30066         * mpz/fdiv_q_2exp.c: In final result adjustment code, handle
30067         that intermediate result is zero.
30069         * mpz/tests/t-2exp.c: New file.
30070         * mpz/tests/Makefile.in: Handle t-2exp.c.
30072 Fri Sep 26 16:29:21 1997  Torbjorn Granlund  <tege@tunnis.tmg.se>
30074         * mpz/divexact.c: Fix typo in test for whether to copy numerator to
30075         quotient and move that statement to after handling quotient and
30076         denominator overlap.  Misc cleanups.
30078         * mpn/generic/gcd.c: Change count argument of mpn_lshift/mpn_rshift
30079         calls to `unsigned int'.
30080         * mpz/divexact.c: Likewise.
30082 Mon Sep 22 02:19:52 1997  Torbjorn Granlund  <tege@pro.tmg.se>
30084         * mpz/tests/t-powm.c: Decrease `reps' to 2500.
30086         * mpz/tests/t-pow_ui.c: New file.
30087         * mpz/tests/Makefile.in: Handle t-pow_ui.c.
30089         * mpz/ui_pow_ui.c: Get special cases for exponent and base right.
30091         * mpz/pow_ui.c: Increase temp space allocation by 1 limb.
30092         Split `rsize' into two variables; compute space allocation into
30093         `ralloc'.
30095 Sun Sep  7 04:15:12 1997  Torbjorn Granlund  <tege@pro.tmg.se>
30097         * mpn/pa64/lshift.s: New file.
30098         * mpn/pa64/rshift.s: New file.
30099         * mpn/pa64/sub_n.s: New file.
30101 Sat Sep  6 19:14:13 1997  Torbjorn Granlund  <tege@gmp.tmg.se>
30103         * mpn/pa64/add_n.s: New file.
30104         * mpn/pa64: New directory.
30106 Tue Aug 19 16:17:09 1997  Torbjorn Granlund  <tege@pro.tmg.se>
30108         * mpz/swap.c: New file.
30109         * mpz/Makefile.in: Compile it.
30110         * make.bat: Likewise.
30111         * gmp.h (mpz_swap): Declare.
30113         * mpn/generic/mul_n.c: Push assignment of x and y pointers into the
30114         if/else clauses in several places.  (Decreases register pressure.)
30116 Mon Aug 18 03:29:50 1997  Torbjorn Granlund  <tege@pro.tmg.se>
30118         * mpn/thumb/add_n.s: New file.
30119         * mpn/thumb/sub_n.s: New file.
30120         * mpn/arm/add_n.s: New file.
30121         * mpn/arm/sub_n.s: New file.
30123         * mpz/powm.c: After mpn_mul_n and mpn_mul calls, adjust product size
30124         if most significant limb is zero.
30125         * mpz/powm_ui.c: Likewise.
30127 Fri Aug 15 02:13:57 1997  Torbjorn Granlund  <tege@pro.tmg.se>
30129         * mpn/arm/m/mul_1.s: New file.
30130         * mpn/arm/m/addmul_1.s: New file.
30132         * mpn/powerpc32/mul_1.s: Rewrite.
30134         * mpn/alpha/mul_1.s: Prefix labels with `.'.
30136 Mon Aug 11 02:37:16 1997  Torbjorn Granlund  <tege@pro.tmg.se>
30138         * mpn/powerpc32/add_n.s: Rewrite.
30139         * mpn/powerpc32/sub_n.s: Rewrite.
30141 Sun Aug 10 17:07:15 1997  Torbjorn Granlund  <tege@pro.tmg.se>
30143         * mpn/powerpc32/addmul_1.s: Delete obsolete comments.
30144         * mpn/powerpc32/submul_1.s: Likewise.
30146 Fri Jul 25 20:07:54 1997  Torbjorn Granlund  <tege@pro.tmg.se>
30148         * mpz/addmul_ui.c: New file.
30149         * mpz/Makefile.in: Compile it.
30150         * make.bat: Likewise.
30151         * gmp.h (mpz_addmul_ui): Declare.
30153         * mpz/setbit.c: Add missing code after final `else'.
30155 Tue Jul 22 17:45:01 1997  Torbjorn Granlund  <tege@tunnis.tmg.se>
30157         * mpn/sh/add_n.s: Fix typo.
30158         * mpn/sh/sub_n.s: Likewise.
30160         * longlong.h (ns32k count_trailing_zeros): Fix typo.
30162         * insert-dbl.c: Check for exponent overflow and return Inf.
30164         * mpz/get_d.c: Rewrite to avoid rounding errors.
30166 Thu May 29 11:51:07 1997  Torbjorn Granlund  <tege@pro.tmg.se>
30168         * mpq/add.c: Swap some usages of tmp1 and tmp2 to make sure
30169         their allocation suffices.
30170         * mpq/sub.c: Likewise.
30172 Wed Apr 16 02:24:25 1997  Torbjorn Granlund  <tege@pro.tmg.se>
30174         * demos/pexpr.c: New file.
30176         * mpn/generic/mul_n.c: Misc optimizations from Robert Harley.
30178         * gmp-impl.h (MPZ_PROVOKE_REALLOC): New #define.
30180 Sat Apr 12 17:54:04 1997  Torbjorn Granlund  <tege@pro.tmg.se>
30182         * mpz/tstbit.c: New file.
30183         * mpz/Makefile.in: Compile it.
30184         * make.bat: Likewise.
30185         * gmp.h (mpz_tstbit): Declare.
30187         * mpz/tests/logic.c: Use MPZ_CHECK_FORMAT.
30188         * mpz/tests/bit.c: New test.
30189         * mpz/tests/Makefile.in: Handle bit.c.
30191         * mpz/ior.c: In -OP2,+OP1 case, normalize OP2 after call to mpn_sub_1.
30193         * gmp-impl.h (MPZ_CHECK_FORMAT): New #define.
30195 Thu Apr 10 00:30:14 1997  Torbjorn Granlund  <tege@tmg.se>
30197         * longlong.h (POWER/PowerPC): Test _ARCH_PWR instead of _IBMR2.
30199 Wed Apr  9 18:23:31 1997  Torbjorn Granlund  <tege@pro.tmg.se>
30201         * gmp-impl.h: Move defaulting of UMUL_TIME and UDIV_TIME from here...
30202         * longlong.h: ...to here.
30204 Sun Mar 30 12:16:23 1997  Torbjorn Granlund  <tege@matematik.su.se>
30206         * mpn/generic/next_prime.c: New file.
30208         * mpn/generic/perfsqr.c: Remove definitions of PP and PP_INVERTED.
30209         * gmp-impl.h: Put them here.
30211 Fri Mar 28 08:18:05 1997  Torbjorn Granlund  <tege@matematik.su.se>
30213         * gmp-impl.h (MPN_COPY_INCR, MPN_COPY_DECR): Define as inline asm for
30214         for x86, but leave disabled for now.
30216 Fri Feb 28 02:39:47 1997  Torbjorn Granlund  <tege@matematik.su.se>
30218         * mpn/Makefile.in (.S.o): Pass SFLAGS and CFLAGS also to compiler
30219         for assembly phase.
30220         (.s.o): Pass SFLAGS.
30222 Wed Feb 26 06:46:08 1997  Torbjorn Granlund  <tege@matematik.su.se>
30224         * mpn/configure.in: For Pentium Pro, use default code, not Pentium
30225         optimized code.
30227         * mpn/x86/addmul_1.S: Unroll and optimize for Pentium Pro.
30228         * mpn/x86/submul_1.S: Likewise.
30230 Thu Feb 13 08:26:09 1997  Torbjorn Granlund  <tege@matematik.su.se>
30232         * mpf/Makefile.in: Compile floor.o, ceil.o and trunc.o (from
30233         integer.c).
30234         * make.bat: Likewise.
30236 Wed Feb  5 05:58:44 1997  Torbjorn Granlund  <tege@matematik.su.se>
30238         * mpn/configure.in (alpha*): Add cntlz to extra_functions.
30240 Wed Feb  4 03:30:45 1997  Torbjorn Granlund  <tege@matematik.su.se>
30242         * mpf/integer.c: New file (supporting mpf_floor, mpf_ceil, mpf_trunc).
30244 Mon Feb  3 14:21:36 1997  Torbjorn Granlund  <tege@matematik.su.se>
30246         * make.bat: Fix typo, set_dfl_prc => set_dfl_prec.
30248 Sun Feb  2 02:34:33 1997  Torbjorn Granlund  <tege@matematik.su.se>
30250         * mpf/out_str.c: After outputting `-', decrement n_digits.
30252 Wed Jan  8 02:50:20 1997  Torbjorn Granlund  <tege@quiet.matematik.su.se>
30254         * mpn/generic/divrem.c: qextra_limbs => qxn.
30256 Wed Dec 18 07:50:46 1996  Torbjorn Granlund  <tege@quiet.matematik.su.se>
30258         * mpz/tests/t-tdiv.c (SIZE): Increase to 200.
30260 Tue Dec 17 19:32:48 1996  Torbjorn Granlund  <tege@quiet.matematik.su.se>
30262         * mpn/generic/divrem.c (mpn_divrem_classic): New name for mpn_divrem.
30263         * gmp.h (mpn_divrem): New function.
30264         * mpn/generic/divrem_newton.c: New file.
30265         * mpn/configure.in (functions): Add divrem_newton.
30266         * make.bat: Likewise.
30268 Thu Dec 12 17:55:13 1996  Torbjorn Granlund  <tege@quiet.matematik.su.se>
30270         * gmp.h (_GMP_H_HAVE_FILE): Test also __dj_include_stdio_h_.
30272 Sat Dec  7 09:40:06 1996  Torbjorn Granlund  <tege@quiet.matematik.su.se>
30274         * mpn/alpha/invert-limb.s: New file.
30276 Thu Dec  5 01:25:31 1996  Torbjorn Granlund  <tege@quiet.matematik.su.se>
30278         * mpz/ui_pow_ui.c (mpz_pow2): New (static) function.
30279         (mpz_ui_pow_ui): Rewrite.
30281         * make.bat: `pre_mod_1.c' => `pre_mod_.c'.  Fix typo in path to
30282         gmp-mpar.h.
30284 Fri Nov 15 00:49:55 1996  Torbjorn Granlund  <tege@quiet.matematik.su.se>
30286         * mpz/ui_pow_ui.c: Rewrite for better speed.
30288 Fri Nov  1 16:36:56 1996  Torbjorn Granlund  <tege@quiet.matematik.su.se>
30290         * Makefile.in (recursive make rules): Use `&&' instead of `;' as
30291         delimiter.
30293 Fri Oct 25 17:12:36 1996  Torbjorn Granlund  <tege@quiet.matematik.su.se>
30295         * gmp-impl.h (Cray/uxp MPN_COPY): Really declare as inline.
30297 Thu Oct 24 15:08:19 1996  Torbjorn Granlund  <tege@quiet.matematik.su.se>
30299         * mpn/fujitsu/rshift.c: Fix typo in loop boundaries.
30301 Fri Oct 18 03:13:54 1996  Torbjorn Granlund  <tege@quiet.matematik.su.se>
30303         * mpn/configure.in: Recognize `nextstep' for m68k variants; likewise
30304         for x86 variants.
30306         * mpn/x86/syntax.h (INSND): New macro.
30307         * mpn/x86/[lr]shift.S: Use INSND.
30308         * mpn/x86/pentium/[lr]shift.S: Likewise.
30309         * mpn/config/t-oldgas (SFLAGS): Pass -DOLD_GAS.
30311         * gmp-impl.h: In code for determining endianness, test also
30312         __BIG_ENDIAN__ and __hppa__.  Remove test of __NeXT__.
30314 Wed Oct 16 03:50:34 1996  Torbjorn Granlund  <tege@quiet.matematik.su.se>
30316         * mpf/set_str.c: Let `prec' determine precision used in
30317         exponentiation code; decrease allocation accordingly.
30319         * mpn/vax: Change `jsob*' to `sob*' in all files.
30321 Tue Oct 15 03:54:06 1996  Torbjorn Granlund  <tege@quiet.matematik.su.se>
30323         * longlong.h (m88110 udiv_qrnnd): Change type of intermediate quotient
30324         to DImode (divu.d generates a 64-bit quotient).
30326         * configure.in (m88110*): Fix typo.
30328         * mpf/get_str.c: Compute exp_in_base using `double' to avoid overflow.
30330         * gmp-impl.h (struct bases): Change type of chars_per_bit_exactly from
30331         float to double.
30332         * mpn/mp_bases.c (__mp_bases): Give 17 digits for chars_per_bit_exactly
30333         field.
30335         * mpf/get_str.c: Let `prec' determine precision used in
30336         exponentiation code; decrease allocation accordingly.
30338 Sun Oct 13 03:31:53 1996  Torbjorn Granlund  <tege@quiet.matematik.su.se>
30340         * longlong.h: Major cleanup.
30341         (__udiv_qrnnd_c): Compute remainders using multiply and subtract,
30342         not explicit `%' operator.
30343         (C umul_ppmm): Get rid of a redundant __ll_lowpart.
30345         * mpz/invert.c: Properly detect all operands that would yield an
30346         undefined inverse; make sure the inverse is always positive.
30348         * mpz/xor.c: New file.
30349         * mpz/Makefile.in: Compile it.
30350         * make.bat: Likewise.
30351         * gmp.h (mpz_xor): Declare.
30353         * mpz/tests/logic.c: Also test mpz_xor.
30355         * mpz/lcm.c: Special case for when either operand equals 0.
30357 Sat Oct 12 01:57:09 1996  Torbjorn Granlund  <tege@quiet.matematik.su.se>
30359         * mpn/generic/gcd.c (find_a): Don't inline on x86.
30361         * Makefile.in (CFLAGS): Default to just `-g'.
30363         * configure.in: Recognize 386 and 486 wherever other x86 cpus are
30364         recognized.
30365         * configure.in: Use mt-x86 for all x86 cpus.
30366         * config/mt-x86: New file.
30368         * mpn/alpha/cntlz.s: New file.
30370 Tue Oct  8 00:16:18 1996  Torbjorn Granlund  <tege@quiet.matematik.su.se>
30372         * longlong.h: Define smul_ppmm for Fujitsu vpp/uxp.
30373         Rewrite umul_ppmm to actually work on the hardware.
30375         * mpn/x86/sub_n.S: Avoid parens around displacement of `leal'.
30376         * mpn/x86/add_n.S: Likewise.
30378         * mpn/x86/syntax.h (R): Define differently depending on __STDC__.
30380 Mon Oct  7 16:48:08 1996  Torbjorn Granlund  <tege@quiet.matematik.su.se>
30382         * longlong.h: Don't test for __NeXT__ in outer 68k conditional;
30383         add test for __m68k__.
30385 Sun Oct  6 00:59:09 1996  Torbjorn Granlund  <tege@quiet.matematik.su.se>
30387         * gmp.h: Declare mpn_random.
30388         * make.bat: Compile mpn/generic/random.c.
30390         * longlong.h: Define umul_ppmm for Fujitsu vpp/uxp.
30392         * gmp-impl.h: Protect definitions using `__attribute__ ((mode (...)))'
30393         with test also for __GNUC_MINOR__.
30395         * gmp.h: Don't define macros using __builtin_constant_p when using
30396         NeXT's compiler.
30398 Fri Oct  4 16:53:50 1996  Torbjorn Granlund  <tege@quiet.matematik.su.se>
30400         * mpz/lcm.c: New file.
30401         * mpz/Makefile.in: Compile it.
30402         * make.bat: Likewise.
30403         * gmp.h (mpz_lcm): Declare.
30405 Wed Sep 25 00:06:21 1996  Torbjorn Granlund  <tege@quiet.matematik.su.se>
30407         * mpq/tests/t-cmp_ui.c: Make sure numerator and denominator of `b' is
30408         within limits of an `unsigned long int'.
30410         * mpz/tests/t-powm_ui.c: Change type of exp2 to `unsigned long int'.
30412 Tue Sep 24 18:58:20 1996  Torbjorn Granlund  <tege@quiet.matematik.su.se>
30414         * mpz/powm_ui.c: Make result always positive.
30416         * urandom.h (urandom): Make it return mp_limb_t.
30418         * gmp-impl.h (CNST_LIMB): New macro.
30419         * mpn/mp_bases.c: Use CNST_LIMB.
30420         * mpn/generic/hamdist.c (popc_limb): Likewise.
30421         * mpn/generic/popcount.c (popc_limb): Likewise.
30422         * mpn/generic/perfsqr.c: Likewise.
30424 Fri Sep 20 03:08:10 1996  Torbjorn Granlund  <tege@quiet.matematik.su.se>
30426         * mpz/pprime_p.c: When n <= 3, don't clear out n before using it.
30428 Wed Sep 18 11:22:45 1996  Torbjorn Granlund  <tege@quiet.matematik.su.se>
30430         * mpn/fujitsu/mul_1.c: New file.
30431         * mpn/fujitsu/addmul_1.c: New file.
30432         * mpn/fujitsu/sub_n.c: New file.
30433         * mpn/fujitsu/add_n.c: Mew file.
30435 Sun Sep 15 03:13:02 1996  Torbjorn Granlund  <tege@quiet.matematik.su.se>
30437         * mpn/generic/random.c: New file.
30438         * mpn/configure.in (functions): Add `random'.
30440         * gmp-impl.h (MPN_COPY): Define as annotated inline function for
30441         Crays and Fujitsu VPPs.
30443         * gmp.h (mp_size_t): Define as `int' for non-MPP Cray.
30444         (mp_exp_t): Likewise.
30446         * configure.in: Add support for Fujitsu VPP machines.
30447         * mpn/configure.in: Likewise.
30448         * config.guess: Likewise.
30449         * config.sub: Likewise.
30451         * mpn/fujitsu/rshift.c: New file.
30452         * mpn/fujitsu/lshift.c: New file.
30453         * mpn/fujitsu: New directory, for Fujitsu VPP machines.
30455 Wed Sep 11 11:34:38 1996  Torbjorn Granlund  <tege@quiet.matematik.su.se>
30457         * mpn/generic/mul_n.c (__gmpn_mul_n): New name for impn_mul_n.
30458         Call __gmpn_mul_basecase, not impn_mul_n_basecase; update parameter
30459         list to work with __gmpn_mul_basecase.
30460         (__gmpn_sqr): New name for impn_sqr_n.
30461         Call __gmpn_sqr_basecase, not impn_sqr_n_basecase; update parameter
30462         list to work with __gmpn_sqr_basecase.
30463         (mpn_mul_n): Update calls to match new names and parameter conventions.
30464         * gmp-impl.h (MPN_MUL_N_RECURSE): Likewise.
30465         (MPN_SQR_RECURSE): New name for MPN_SQR_N_RECURSE.
30466         Update calls to match new names and parameter conventions.
30467         * mpn/generic/mul.c: Never perform multiply explicitly here, call
30468         __gmpn_mul_basecase instead.
30469         Update calls to match new names and parameter conventions.
30471         * mpn/x86/mul_basecase.S: New file.
30472         * mpn/generic/mul_basecase.c: New file.
30473         * mpn/generic/sqr_basecase.c: New file.
30475 Wed Sep  4 02:59:21 1996  Torbjorn Granlund  <tege@quiet.matematik.su.se>
30477         * mpz/set_str.c: Let `0b' and `0B' mean base 2.
30479 Fri Aug 30 00:44:00 1996  Torbjorn Granlund  <tege@quiet.matematik.su.se>
30481         * longlong.h (x86 umul_ppmm): Work around GCC bug that was
30482         triggered by Aug 28 change.
30484         * mpbsd/min.c (digit_value_in_base): New function.
30486         * mpz/set_str.c: Refine allocation size computation, use
30487         chars_per_bit_exactly instead of chars_per_limb.
30489         * mpbsd/Makefile.in (.c.o): Add -D_mpz_realloc=_mp_realloc.
30491 Wed Aug 28 02:52:14 1996  Torbjorn Granlund  <tege@quiet.matematik.su.se>
30493         * longlong.h (x86 umul_ppmm): Don't cast result operands.
30494         (x86 udiv_qrnnd): Likewise.
30495         (default smul_ppmm): Fix typo, umul_ppmm => smul_ppmm.
30496         (default umul_ppmm): New #define using smul_ppmm.
30497         (vax smul_ppmm): New #define.
30498         (vax umul_ppmm): Delete.
30499         (POWER umul_ppmm): Delete.
30500         (IBM 370 smul_ppmm): New #define.
30501         (IBM 370 umul_ppmm): Delete.
30502         (IBM RT/ROMP smul_ppmm): New #define.
30503         (IBM RT/ROMP umul_ppmm): Delete.
30505 Tue Aug 27 01:03:25 1996  Torbjorn Granlund  <tege@quiet.matematik.su.se>
30507         * gmp-impl.h (__gmp_0): Make it `const'.
30509         * mpn/Makefile.in (clean mostlyclean): Comment out recursive clean
30510         of `tests'.
30512         * mpn/generic/mul.c: Identify when we do squaring, and call
30513         impn_sqr_n_basecase/impn_sqr_n as appropriate.  Use
30514         KARATSUBA_MUL_THRESHOLD and KARATSUBA_SQR_THRESHOLD.
30515         Don't #define KARATSUBA_THRESHOLD.
30517         * mpn/generic/mul_n.c: Don't #define KARATSUBA_THRESHOLD.
30518         (impn_mul_n, impn_sqr_n): Rewrite, based on code contributed by
30519         Robert Harley.
30520         (impn_sqr_n_basecase): Rewrite.
30522         * gmp-impl.h (KARATSUBA_MUL_THRESHOLD): New #define.
30523         (KARATSUBA_SQR_THRESHOLD): Likewise.
30524         (MPN_SQR_N_RECURSE): Use KARATSUBA_SQR_THRESHOLD.
30525         (MPN_MUL_N_RECURSE): Use KARATSUBA_MUL_THRESHOLD.
30527         * configure.in: Fix typo in last change.
30529 Mon Aug 26 22:25:18 1996  Torbjorn Granlund  <tege@quiet.matematik.su.se>
30531         * mpn/generic/random2.c: Fix typo, `alpha__' => `__alpha'.
30532         * mpf/random2.c: Likewise.
30534 Sun Aug 25 00:07:09 1996  Torbjorn Granlund  <tege@quiet.matematik.su.se>
30536         * mpz/tests/t-mul.c: Also test squaring.
30538 Fri Aug 16 05:12:08 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
30540         * mp_clz_tab.c (__clz_tab): Declare as `const'.
30541         * version.c (gmp_version): Likewise.
30542         * mpn/generic/sqrtrem.c (even_approx_tab, odd_approx_tab): Likewise.
30544 Thu Aug 15 02:34:47 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
30546         * gmp.h: Fix typo, `mips__' => `__mips'.
30548         * mpf/set_str.c: Allow a number to start with a period, if next
30549         position contains a digit.
30551 Tue Aug 13 18:41:25 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
30553         * mpz/gcdext.c: Get cofactor sign right for negative input operands.
30554         Clean up code for computing tt.
30556         * mpz/invert.c: Get rid of variable `rv'.
30558         * mpz/divexact.c: Test for zero divisor in special case for zero
30559         dividend.
30561 Mon Aug 12 18:04:07 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
30563         * mpz/?div_*_ui.c: Special case for division by 0.
30564         * mpz/tdiv_q.c: Likewise.
30566 Sat Aug 10 14:45:26 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
30568         * mpz/dmincl.c: Special case for division by 0.
30570         * mpz/tdiv_*_ui.c: Delete special case for dividend being 0; handle
30571         it when computing size after mpn_divmod_1 call.
30573         * mp_bpl.c: (__gmp_junk): New variable.
30574         (__gmp_0): New constant.
30576         * gmp-impl.h (DIVIDE_BY_ZERO): New #define.
30578 Fri Aug  9 20:03:27 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
30580         * mpz/divexact.c: Test for dividend being zero before testing
30581         for small divisors.
30583 Thu Aug  8 13:20:23 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
30585         * configure.in: Require operating system specification for cpus
30586         where assembly syntax differs between system.
30588         * Makefile.in (many targets): Change `-' action prefix to `@'.
30590         * mpn/Makefile.in: (distclean): Fix typo.
30592         * mpq/cmp_ui.c: Rename function to _mpq_cmp_ui.
30593         (mpq_cmp_ui): #undef deleted.
30594         * mpz/cmp_si.c: Rename function to _mpz_cmp_si.
30595         (mpz_cmp_si): #undef deleted.
30596         * mpz/cmp_ui.c: Rename function to _mpz_cmp_ui.
30597         (mpz_cmp_ui): #undef deleted.
30598         * Makefile.in: Corresponding changes.
30600         * mpf/get_prc.c: Return the *highest* precision achievable.
30602         * mpf/get_str.c: Complete rewrite.
30604         * mpf/set_str.c (swapptr): New #define.
30605         (assert): New #define.
30606         * mpf/set_str.c: Set prec to one more than the saved _mp_prec.
30607         Misc cleanups.
30609         * mpz/set_str.c: #include string.h.
30610         * mpf/out_str.c: #include string.h.
30611         * mpbsd/xtom.c: #include string.h and ctype.h.
30612         * mpbsd/mout.c: #include string.h.
30614 Wed Aug  7 11:46:04 EDT 1996  Ken Weber <kweber@mcs.kent.edu>
30616         * mpn/generic/gcd.c: Reorder mpn_gcd argument list.
30617         * mpz/gcd.c: Change call to mpn_gcd.
30618         * gmp.texi: Update manual entry on mpn_gcd.
30619         * mpn/generic/bdivmod.c: Delete limb cache to make mpn_bdivmod
30620         reentrant.
30622 Wed Aug  7 02:15:38 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
30624         * mpf/get_str.c: Rewrite code for converting integral part of a
30625         number with both an integral and fractional part.
30627         * mpf/set_str.c: Get rid of variable xxx.  New variables madj and radj.
30628         In exp_in_base==0 case, add madj to msize for EXP field.
30630         * mpz/tests/t-gcd.c: Test deleted.  Rename t-gcd2.c to t-gcd.c.
30631         Increase reps to 2000.
30632         * mpz/tests/t-gcd2.c: Get rid of mpz_refgcd.
30634         * mpf/set_str.c: Ignore excess limbs in MP,MSIZE.
30636 Thu Jul 25 04:39:10 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
30638         * mpn/configure.in: Fix typo in setting path, "sparc" => "sparc32".
30640 Wed Jul 24 02:27:02 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
30642         * mpn/generic/gcdext.c: Reorganize and clean up.  Get rid of all
30643         signed limb arithmetic.
30645 Mon Jul 22 02:39:56 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
30647         * mpn/generic/gcdext.c (mpn_gcdext): For large enough operands,
30648         work with most significant *two* limbs.
30649         (div2): New function (two variants).
30650         (THRESHOLD): New #define.
30652         * mpz/gcdext.c: Fix typo in MPZ_TMP_INIT call.
30654         * longlong.h (alpha UMUL_TIME): Now 30.
30655         (alpha UDIV_TIME): Now 350.
30656         (x86 UMUL_TIME): Now 10 (let Pentium decide).
30657         (SuperSPARC UDIV_TIME): Override default.
30659         * extract-dbl.c (MP_BASE_AS_DOUBLE): Don't redefine here.
30661         * extract-dbl.c: New name for extract-double.c.
30662         * insert-dbl.c: New name for insert-double.c.
30663         * Makefile.in: Corresponding changes.
30664         * make.bat: Likewise.
30666         * mpz/Makefile.in (.c.o): Don't pass non-portable `-f' to cp.
30667         * mpq/Makefile.in: Likewise.
30668         * mpf/Makefile.in: Likewise.
30670 Sat Jul 20 01:35:18 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
30672         * mpz/getlimbn.c: Take ABS of integer->_mp_size.
30674         * mpz/divexact.c: Use mpn_divmod_1 if divisor is a single limb.
30676 Thu Jul 18 00:31:15 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
30678         * mpn/generic/popcount.c (popc_limb): Use different masking trick
30679         for first step (due to David Seal).
30680         * mpn/generic/hamdist.c (popc_limb): Likewise.
30682 Wed Jul 17 23:21:48 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
30684         * mpn/generic/divrem.c: In MPN_COPY_DECR call, copy dsize - 1 limbs.
30686 Sun Jul 14 17:47:46 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
30688         * configure.in: Handle sparc9, sparc64, and ultrasparc like sparc8.
30690 Thu Jul 11 14:05:54 1996  J.T. Conklin  <jtc@rtl.cygnus.com>
30692         * longlong.h (mc680x0): Define umul_ppmm, udiv_qrnnd, sdiv_qrnnd
30693         for the '020, '030, '040, and '332.  Define count_leading_zeros
30694         for the '020, '030, '040, and '060.
30696 Sun Jul 14 15:24:53 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
30698         From Joe Keane:
30699         * mpq/equal.c: Take ABS of num1_size before passing it to mpn_cmp.
30701 Fri Jul 12 17:11:17 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
30703         * mpn/generic/sqrtrem.c (SQRT): New asm for x86, but leave it
30704         disabled for now.
30706         * mpn/generic/sqrtrem.c: Use MP_BASE_AS_DOUBLE.
30708 Wed Jul 10 03:17:45 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
30710         * cre-mparam.c: Delete obsolete file.
30712         * gmp.h: #define _LONG_LONG_LIMB if __mips && _ABIN32.
30713         * longlong.h: Test __mips instead of __mips__.
30715 Sun Jul  7 23:19:13 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
30717         * longlong.h (_PROTO): Define, unless already defined.
30718         (alpha __udiv_qrnnd): Declare using _PROTO.
30719         (hppa __udiv_qrnnd): Likewise.
30720         (sparc __udiv_qrnnd): Likewise.
30722 Mon Jul  1 01:44:30 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
30724         * config.guess: Update from master version; add Cray x90 handling.
30726 Wed Jun 26 05:35:02 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
30728         * mpn/power/add_n.s (__mpn_add_n): Work around GAS bug.
30729         * mpn/power/sub_n.s (__mpn_sub_n): Likewise.
30731         * insert-double.c: Rework loop to avoid potential overflow.
30733         * mpq/get_d.c: For vax, if qsize > N_QLIMBS, ignore excess limbs.
30735         * mpq/tests/t-get_d.c (SIZE): Special case for vax.
30737         * gmp.h (mpX_cmp_ui): #define also when ! __GNUC__.
30739 Mon Jun 24 17:13:21 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
30741         * longlong.h (vax sdiv_qrnnd): Fix typo.
30743 Sat Jun 15 01:33:33 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
30745         * gmp.h: Support `small' and `large' type and function variants,
30746         controlled by GMP_SMALL.
30748         * mpz/Makefile.in (.c.o): Compile each function twice, for small and
30749         large variant.
30750         (MPZS_OBJS): New variable.
30751         (libmpz.a): Include MPZS_OBJS in archive.
30752         * mpf/Makefile.in: Analogous changes.
30753         * mpq/Makefile.in: Analogous changes.
30755         * gmp.h: Prefix all functions with __gmp, to allow namespace-clean
30756         internal calls.
30758         * mp.h: Rip out __MP_SMALL__ stuff.
30759         (__mpz_struct): mp_size_t => int.
30761         * mpz/invert.c: #include "gmp-impl.h".
30762         Use MPZ_TMP_INIT, not mpz_init.
30764         * mpz/gcdext.c: Rewrite to call mpn_gcdext.
30766 Fri Jun 14 18:05:29 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
30768         * mpn/generic/gcdext.c (s0size): New parameter.
30769         * gmp.h (mpn_gcdext): Update prototype.
30771         * mpn/generic/gcdext.c: Major rewrite.
30773 Mon Jun 10 00:14:27 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
30775         * mpn/generic/dump.c: Add missing `else'.
30777 Fri Jun  7 03:35:12 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
30779         * Makefile.in (gmp_toc.html): Pass -expandinfo to texi2html.
30781 Thu Jun  6 19:00:53 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
30783         * Version 2.0.2 released.
30785         * install.sh: New file.
30786         * Makefile.in (INSTALL): Use install.sh.
30787         (install-normal): New name for target `install'.
30788         (install): New dummy target.
30790         * mpz/pow_ui.c: Swap tests for (e == 0) and (bsize == 0).
30791         * mpz/ui_pow_ui.c: Swap tests for (e == 0) and (blimb == 0).
30793         * config/mt-linux (AR_FLAGS): New file.
30794         * configure.in: Use config/mt-linux for all linux systems.
30796 Tue Jun  4 03:42:18 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
30798         * Version 2.0.1 released.
30800         * mpf/tests/ref.c: Cast result of TMP_ALLOC to the right pointer type.
30802         * extract-double.c: Test _GMP_IEEE_FLOATS with #if, not plain if.
30804         * insert-double.c: Don't #include stdlib.h.
30806         * gmp-impl.h (union ieee_double_extract): Test sparc and __sparc.
30807         Do not test __sparc__.
30809         * mpf/reldiff.c: Change declaration to work around irix5 compiler bug.
30810         * mpq/equal.c: Likewise.
30812         * mpn/generic/gcd.c: Delete spurious comma at end of enumeration.
30814         * mpn/generic/gcdext.c: Add K&R declaration syntax.
30815         * stack-alloc.h: Likewise.
30816         * insert-double.c: Likewise.
30817         * extract-double.c: Likewise.
30818         * mpf/tests/reuse.c: Likewise.
30819         * mpz/tests/reuse.c: Likewise.
30820         * mpf/tests/t-sub.c: Likewise.
30821         * mpf/tests/t-add.c: Likewise.
30822         * mpf/tests/t-muldiv.c: Likewise.
30823         * mpf/tests/t-conv.c: Likewise.
30824         * mpf/tests/ref.c: Likewise.
30826         * mpn/config/t-oldgas: Renamed from t-freebsd.
30827         * mpn/configure.in: Use t-oldgas for freebsd, netbsd, and some linux
30828         configurations.
30830         * mpn/powerpc32/mul_1.s: Really clear cy before entering loop.
30831         * mpn/powerpc32/*.s: Fix power/powerpc syntax issues.
30833         * mpn/config/t-ppc-aix: New file.
30834         * mpn/configure.in: Use t-ppc-aix for powerpc like t-pwr-aix for power.
30836 Wed May 29 02:07:31 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
30838         * gmp.h (mp_bits_per_limb): Change qualifier from `const' to
30839         __gmp_const.
30841         * gmp.h (mpf_init_set_str): Add `const' qualifier for 2nd parameter.
30842         * mpf/iset_str.c: Likewise.
30844 Mon May 27 00:15:58 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
30846         * gmp-impl.h: Declare __gmp_extract_double.
30848         * mpz/set_q.c: Delete unused variables.
30850         * gmp.h (mpq_equal): Declare.
30852         * mpf/eq.c: mpf_cmp2 -> mpf_eq.
30854 Fri May 24 03:20:44 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
30856         * mpz/iset_d.c: Don't include <math.h>.
30858         * insert-double.c (__gmp_scale2): New name for scal2.
30859         * mpz/get_d.c: Corresponding change.
30860         * mpf/get_d.c: Likewise.
30861         * mpq/get_d.c: Likewise.
30862         * gmp-impl.h: Declare __gmp_scale2.
30864         * mpn/generic/scan0.c: Clarify comment.
30866         * mpz/set_q.c: New file.
30867         * Makefile.in: Compile it.
30868         * make.bat: Likewise.
30869         * gmp.h: Declare mpz_set_q.
30871         * insert-double.c: New file.
30872         * Makefile.in: Compile it.
30873         * make.bat: Likewise.
30875         * mpz/get_d.c: New file.
30876         * mpz/Makefile.in: Compile it.
30877         * make.bat: Likewise.
30878         * gmp.h: Declare mpz_get_d.
30880         * mpf/get_d.c: New file.
30881         * mpf/Makefile.in: Compile it.
30882         * make.bat: Likewise.
30883         * gmp.h: Declare mpf_get_d.
30885         * make.bat: Compile things in alphabetical order.
30887         * gmp-impl.h (MP_BASE_AS_DOUBLE): New #define.
30888         (LIMBS_PER_DOUBLE): New #define.
30890         * extract-double.c: New file.
30891         * Makefile.in: Compile it.
30892         * make.bat: Likewise.
30893         * mpz/set_d.c: Rewrite to use __gmp_extract_double.
30894         * mpf/set_d.c: Likewise.
30896         * mpn/configure.in: Use t-pwr-aix also for aix 3.2.4 and up.
30898 Wed May 22 02:48:35 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
30900         * gmp-impl.h: Rework code for defining ieee_double_extract.
30901         (IEEE_DOUBLE_BIG_ENDIAN): Macro removed.
30902         (_GMP_IEEE_FLOATS): New macro.
30903         * mpn/vax/gmp-mparam.h: Delete.
30905         * mpn/config/t-pwr-aix: New file.
30906         * mpn/configure.in: Use t-pwr-aix for aix 4 and later.
30908 Mon May 20 16:30:31 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
30910         * gmp.h: In code for setting _GMP_H_HAVE_FILE, test more symbols.
30912         * mpf/tests/t-add.c (oo): Add some `l' printf modifiers.
30913         * mpf/tests/t-sub.c (oo): Likewise.
30914         * mpf/tests/t-conv.c (oo): Likewise.
30915         * mpf/tests/t-sqrt.c (oo): Likewise.
30917         * mpz/tests/t-mul.c (_mpn_mul_classic): Remove unused variables.
30919         * mpn/{pyr,i960,clipper}/*.s: Add missing copyright headers.
30921 Fri May 17 02:24:43 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
30923         * mpz/set_d.c: Call _mpz_realloc.
30925         * mpq/set_z.c: New file.
30926         * mpq/Makefile.in: Compile it.
30927         * make.bat: Likewise.
30928         * gmp.h: Declare mpq_set_z.
30930         * mp?/Makefile.in (libmp?.a): Depend on Makefile, not Makefile.in.
30931         * mpf/Makefile.in (test): Delete spurious target.
30932         * mpq/Makefile.in (test): Likewise.
30934         * mpf/out_str.c: Use `e' to separate exponent when base <= 10.
30936         * mpn/configure.in: Treat ultrasparc just like sparc v8,
30937         until 64-bit compilers are ready.
30939         * mpf/set_d.c: Make it work for 64-bit machines.
30941 Thu May 16 20:53:57 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
30943         * gmp-impl.h: Set IEEE_DOUBLE_BIG_ENDIAN to 0 for little-endian
30944         machines.
30945         * mpn/x86/gmp-mparam.h: Delete file.
30947         * configure.in: Treat microsparc like sparc8.
30949         * urandom.h: Test __alpha instead of __alpha__, since the former
30950         is the standard symbol.
30951         * mpn/generic/random2.c: Likewise.
30952         * mpf/random2.c: Likewise.
30954 Tue May 14 13:42:39 1996  Torbjorn Granlund  (tege@tiny.matematik.su.se)
30956         * mpz/set_f.c: New file.
30957         * mpz/Makefile.in: Compile it.
30958         * gmp.h: Declare mpz_set_f.
30960         * mpf/set_q.c: Simplify expression in rsize == nsize if-then-else arms.
30962 Tue May 14 13:03:07 1996  Torbjorn Granlund  (tege@tiny.matematik.su.se)
30964         * make.bat: Add all new files.
30966 Sun May 12 22:24:36 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
30968         * mpf/set_z.c: New file.
30969         * mpf/Makefile.in: Compile it.
30970         * gmp.h: Declare mpf_set_z.
30972 Sat May 11 19:26:25 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
30974         * gmp.h: Declare mpf_set_q.
30976         * mpf/set_q.c: Compute prec-1 limbs in mpn_divrem call.
30978 Fri May 10 17:37:38 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
30980         * mpf/set_q.c: New file.
30981         * mpf/Makefile.in: Compile it.
30983         * config.sub: Recognize sparc8.
30985 Wed May  8 09:19:11 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
30987         * mpf/tests/t-dm2exp.c: New file.
30989         * mpf/tests/t-add.c: Correct header comment.
30990         * mpf/tests/t-sub.c: Likewise.
30991         * mpf/tests/t-sqrt.c: Likewise.
30993         * mpf/div.c: Misc variable name cleanups.
30994         * mpf/div_ui.c: Base more closely on mpf/div.c.
30995         * mpf/ui_div.c: Likewise.
30997         * mpz/tests/Makefile.in (check): Depend on Makefile.
30998         * mpq/tests/Makefile.in (check): Likewise.
30999         * mpf/tests/Makefile.in (check): Likewise.
31001         * mpf/tests/t-muldiv.c: New file.
31002         * mpf/tests/Makefile.in: Compile and run `t-muldiv'.
31003         (t-ref.o): Delete spurious rule.
31005         * mpf/sqrt.c: Properly detect negative input operand.
31007         * mpf/sqrt_ui.c: Delete spurious header comment.
31008         * mpf/sqrt.c: Likewise.
31009         * mpz/sqrt.c: Likewise.
31011         * mpz/tests/reuse.c (main): Read `reps' from command line.
31013         * mpf/tests/reuse.c: New file.
31014         * mpf/tests/Makefile.in: Compile and run `reuse'.
31016         * mpf/mul_ui.c: Disable code for removing low zero limbs.
31018         * mpf/div.c: Fix condition for when vp and qp overlaps.
31020         * mpf/add_ui.c: When sum equals u, copy up to prec+1 limbs.
31022         * mpf/out_str.c: Don't output '\n' after exponent.
31024         * mpf/add_ui.c: New special case for when U is completely cancelled.
31026 Wed Apr 24 05:33:28 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
31028         * Version 2.0 released.
31030         * All files: Update FSF's address.
31032         * Makefile.in (gmp_toc.html): New name for gmp.html.
31033         (TAGS): Depend on force.
31035         * mpf/tests/t-conv.c: Pass -base to mpf_set_str.
31037 Sat Apr 20 03:54:06 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
31039         * Makefile.in (ps): New target, depend on gmp.ps.
31041 Fri Apr 19 14:03:15 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
31043         * mpf/out_str.c: Print `@' before exponent, not `e'.
31045         * make.bat: Update from Makefiles.
31047 Thu Apr 18 01:22:05 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
31049         * mpf/set_str.c: If parameter `base' is negative, expect exponent
31050         to be decimal, otherwise in the same base as the mantissa.
31052 Wed Apr 17 17:28:36 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
31054         * mpf/set_dfl_prec.c: Don't return anything.
31055         * gmp.h: Corresponding changes.
31057         * mpf/set_dfl_prec.c: Use `unsigned long int' for bit counts.
31058         * mpf/init2.c: Likewise.
31059         * mpf/get_prc.c: Likewise.
31060         * mpf/set_prc.c: Likewise.
31061         * mpf/set_prc_raw.c: Likewise.
31062         * mpz/popcount.c: Likewise.
31063         * mpz/hamdist.c: Likewise.
31064         * mpz/scan1.c: Likewise.
31065         * mpz/scan0.c: Likewise.
31066         * mpn/generic/popcount.c: Likewise.
31067         * mpn/generic/hamdist.c: Likewise.
31068         * mpn/generic/scan1.c: Likewise.
31069         * mpn/generic/scan0.c: Likewise.
31070         * gmp.h: Likewise.
31072         * mpf/eq.c: New file, based on mpf/diff.c.
31073         * mpf/diff.c: Delete.
31074         * mpf/Makefile.in: Corresponding changes.
31075         * gmp.h: Likewise.
31077         * mpf/reldiff.c: New file.
31078         * mpf/Makefile.in: Compile it.
31079         * gmp.h: Declare mpf_reldiff.
31081         * mpz/iset_d.c: New file.
31082         * mpz/Makefile.in: Compile it.
31083         * gmp.h: Declare mpz_init_set_d.
31085 Tue Apr 16 16:28:31 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
31087         * Makefile.in (gmp.html): Pass -acc to texi2html.
31089 Mon Apr 15 16:20:24 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
31091         * mpf/set_str.c: Switch off code for defaulting the base from the
31092         leading characters.
31094         * gmp.h (mp?_sign): Delete.
31095         (mp?_sgn): New macros.
31097 Fri Apr 12 17:23:33 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
31099         * Makefile.in (gmp.dvi): Delete tmp.* at end of rule.
31101 Wed Apr 10 22:52:02 1996  Torbjorn Granlund  (tege@tiny.matematik.su.se)
31103         * mpf/random2.c: Change of `exp' param, mp_size_t => mp_exp_t.
31104         * gmp.h: Corresponding change.
31106         * gmp.h (mp_bits_per_limb): Make it const.
31108 Sat Mar 30 01:20:23 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
31110         * configure.in: Re-enable recognition of with_gcc.
31112         * mpf/Makefile.in (.c.o): Pass XCFLAGS.
31113         * mpn/Makefile.in (.c.o): Likewise.
31114         * mpz/Makefile.in (.c.o): Likewise.
31115         * mpq/Makefile.in (.c.o): Likewise.
31116         * mpbsd/Makefile.in (.c.o): Likewise.
31117         * mpf/tests/Makefile.in (.c.o): Likewise.
31118         * mpz/tests/Makefile.in (.c.o): Likewise.
31119         * mpq/tests/Makefile.in (.c.o): Likewise.
31121         * Makefile.in (XCFLAGS): Default to empty.
31122         (FLAGS_TO_PASS): Pass on XCFLAGS.
31123         (.c.o): Pass XCFLAGS.
31125         * config/mt-m88110 (XCFLAGS): Define instead of CC.
31126         * config/mt-sprc8-gcc (XCFLAGS): Likewise.
31127         * config/mt-supspc-gcc (XCFLAGS): Likewise.
31129         * configure: Don't default CC to "gcc -O2" is -with-gcc=no was
31130         specified.
31132 Mon Mar 25 01:07:54 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
31134         * urandom.h: Test for __SVR4 in addition to __svr4__.
31136         * mp_bpl.c (mp_bits_per_limb): Declare as `const'.
31138         * Makefile.in (CFLAGS): `-O2' => `-O'.
31139         * mpn/Makefile.in (CFLAGS): Likewise.
31141         * gmp-impl.h: Get rid of obsolete field access macros.
31143         * mpn/mp_bases.c (__mp_bases): 1e39 => 1e38 to work around Solaris
31144         cc compiler bug.
31146         * gmp.h (__MPN): Make it work also for non-ANSI compilers.
31148 Thu Mar 21 01:07:54 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
31150         * mpf/sub.c: New special case for ediff <= 1 before generic code.
31151         Simplify generic code for ediff == 0.
31152         Rename uexp => exp.
31154 Mon Mar 11 18:24:57 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
31156         * mpf/tests/*.c: Use ref_mpf_sub for error calculation.
31157         * mpf/tests/Makefile.in: Link ref.o to all executables.
31159         * mpf/tests/t-sub.c: Make u = v + 1 with 50% probability.
31161 Sun Mar 10 21:03:17 1996  Torbjorn Granlund  (tege@tiny.matematik.su.se)
31163         * mpf/get_str.c: In digit development loop for fractions, change
31164         loop condition from `<' to `<='.
31166 Thu Mar  7 04:58:11 1996  Torbjorn Granlund  <tege@tiny.matematik.su.se>
31168         * mpn/mp_bases.c (__mp_bases): 1e100 => 1e39 to avoid overflow warning.
31170 Wed Mar  6 01:10:42 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
31172         * mpf/tests/t-sqrt.c: New file.
31173         * mpf/tests/Makefile.in: Corresponding changes.
31175         * mpf/sqrt.c: Special case for square root of zero.
31177         * mpq/add.c: Clean up variable names.
31178         * mpq/sub.c: Update from mpq/add.c.
31180         * mpz/divexact.c: abs => ABS.
31181         * mpz/gcd.c: Likewise.  Rewrite final fixup code, to decrease
31182         allocation.  Misc cleanups.
31184 Tue Mar  5 22:24:56 1996  Torbjorn Granlund  <tege@matematik.su.se>
31186         * mpn/configure.in: Recognize linuxoldld as a synonym for linuxaout.
31188         * gmp.h (mpn_add, mpn_add_1, mpn_sub, mpn_sub_1): Add prototypes.
31190         * mpn/configure.in: Use t-freebsd also for netbsd.
31192 Mon Mar  4 15:13:28 1996  Torbjorn Granlund  <tege@matematik.su.se>
31194         * mpq/Makefile.in (cmp.o): Depend on longlong.h.
31196         * mpq/equal.c: New file.
31197         * mpq/Makefile.in: Corresponding changes.
31199         * mpf/tests/t-add.c: New file.
31200         * mpf/tests/t-sub.c: Renamed from t-addsub.c.
31201         * mpf/tests/ref.c: New file.
31202         * mpf/tests/Makefile.in: Corresponding changes.
31204         * gmp-impl.h (SIZ, ABSIZ, PTR, EXP, PREC, ALLOC): New #defines.
31206 Sun Mar  3 07:45:46 1996  Torbjorn Granlund  <tege@matematik.su.se>
31208         * mpf/set_str.c: In exponentiation code, allocate 3 extra
31209         limbs, not just 2.
31211         * mpf/get_str.c: Allocate sufficient space for tstr.
31212         When calculating exp_in_base, round result down.
31214         * mpf/tests/t-conv.c: New file.
31215         * mpf/tests/Makefile.in: Corresponding changes.
31217         * mp_bpl.c: New file.
31218         * gmp.h: Declare it.
31219         * Makefile.in: Corresponding changes.
31221 Sat Mar  2 06:27:56 1996  Torbjorn Granlund  <tege@matematik.su.se>
31223         * mpf/set_prc_raw.c: New file.
31224         * mpf/set_prc.c: Renamed from set_prec.c.
31225         * mpf/get_prc.c: New file.
31226         * mpf/Makefile.in: Corresponding changes.
31227         * gmp.h: Declare new functions.
31229         * mpn/generic/gcdext.c: Add copyright header.
31231 Fri Mar  1 01:22:24 1996  Torbjorn Granlund  <tege@matematik.su.se>
31233         * mpn/configure.in: For ppc601, search "power" before "powerpc32".
31235         * mp?/Makefile.in (AR_FLAGS): New variable.
31236         (libmp?.a): Use it.
31238         * make.bat: New file.
31239         * mpn/msdos: New directory.
31240         * mpn/msdos/asm-syntax.h: New file.
31242         * mpn/Makefile.in (distclean maintainer-clean): Delete asm-syntax.h.
31244         * config.sub: Recognize [ctj]90-cray.
31246         * mpn/configure.in: Recognize [ctj]90-cray-unicos*.
31248         * mpn/generic/gcdext.c: Don't use alloca directly, use TMP_* macros.
31250         * mpn/generic/gcd.c: Split increment from use of USIZE to avoid
31251         undefined behaviour.
31253 Thu Feb 29 04:11:24 1996  Torbjorn Granlund  <tege@matematik.su.se>
31255         * Makefile.in (install-info-files): Update for new install-info
31256         behaviour.
31258         * mpn/power/add_n.s: Rewrite.
31259         * mpn/power/sub_n.s: Rewrite.
31261 Wed Feb 28 01:34:30 1996  Torbjorn Granlund  <tege@matematik.su.se>
31263         * mpz/pow_ui.c: Compute allocation more aggressively for small bases.
31264         * mpz/ui_pow_ui.c: Likewise.
31266         * mpn/mp_bases.c (__mp_bases): Put huge value in 2nd field for index 1.
31268         * mpn/generic/sqrtrem.c: sizeof (mp_limb_t) => BYTES_PER_MP_LIMB.
31269         * mpn/generic/gcd.c: Likewise.
31270         (SIGN_BIT): Compute differently.
31272 Mon Feb 26 00:07:36 1996  Torbjorn Granlund  <tege@matematik.su.se>
31274         * All files: mp_limb => mp_limb_t, mp_limb_signed => mp_limb_signed_t.
31276         * Makefile.in (install, install-bsdmp, install-info-files): Depend
31277         on installdirs.  chmod all installed files.
31279 Sun Feb 25 01:47:41 1996  Torbjorn Granlund  <tege@matematik.su.se>
31281         * mpbsd/configure.in: Delete debugging code.
31283         * All Makefile.in: Update clean targets.
31285         * Makefile.in (AR_FLAGS): New variable.
31286         (libgmp.a): Use it.
31287         (libmp.a): Likewise.
31289         * VERSION: Delete file.
31291         * Makefile.in (installdirs): New target.
31292         * mkinstalldirs: New file (from the texinfo package).
31294         * Makefile.in (INSTALL, INSTALL_DATA, INSTALL_PROGRAM): New variables.
31295         (MAKEINFO, MAKEINFOFLAGS, TEXI2DVI): New variables.
31296         (install-info): New target.
31297         (install, install-bsdmp): Depend on install-info.
31298         ($(srcdir)/gmp.info): Changed from plain gmp.info; put info files
31299         into source directory.
31300         (distclean, mostlyclean): New targets.
31301         (maintainer-clean): New name for realclean.
31302         (uninstall): New target.
31303         (TAGS): New target.
31304         (info, dvi): New targets.
31305         (.PHONY): Assign.
31307         * Makefile.in (install, install-bsdmp): Use INSTALL_DATA.
31309         * mp{n,z,f,bsd}/move-if-change: Delete.
31311         * mpbsd/Makefile.in (stamp-stddefh): Delete target.
31313         * Makefile.in (.c.o): Pass CFLAGS last.
31314         * mpbsd/Makefile.in (.c.o): Likewise.
31315         * mpf/Makefile.in (.c.o): Likewise.
31316         * mpq/Makefile.in (.c.o): Likewise.
31317         * mpz/Makefile.in (.c.o): Likewise.
31318         * mpn/Makefile.in (.c.o): Likewise.
31319         (.S.o): Likewise.
31321         * memory.c: Change allocation error message.
31323         * Makefile.in (install): Prefix gmp.h with $(srcdir).
31324         (install-bsdmp): Prefix mp.h with $(srcdir).
31326         * mp{n,z,f,bsd}/{configure,config.sub}: Delete.
31328         * Makefile.in (gmp.dvi): Set TEXINPUTS also for 2nd tex invocation
31329         (install targets): Install gmp.info-N.
31331 Sat Feb 24 03:36:52 1996  Torbjorn Granlund  <tege@matematik.su.se>
31333         * mpf/get_str.c: Fix typo.
31335         * mpz/legendre.c: Clarify expression with extra parens.
31337         * version.c (gmp_version): Not static.
31339         * mpf/iset_str.c: Properly return error code.
31341         * mpf/add.c: Delete unused variables.
31342         * mpf/inp_str.c: Likewise.
31343         * mpq/get_d.c: Likewise.
31345         * mpn/generic/dump.c: #include <stdio.h>.
31346         * mpf/dump.c: Likewise.
31347         * mpf/set_str.c: #include <ctype.h>.
31348         (strtol): Declare.
31350         * gmp.h: mpn_sqrt => mpn_sqrtrem.
31352         * Makefile.in (clean, realclean): Clean in mpbsd.
31353         (check): Test in mpf.
31355         * mpf/Makefile.in (clean): Clean in tests.
31356         * mpq/Makefile.in (clean): Clean in tests.
31358         * mpf/tests/Makefile.in: New file.
31359         * mpf/tests/configure.in: New file.
31360         * mpf/tests/t-addsub.c: New file.
31362         * mpf/sub_ui.c: Simply call mpf_sub for now.
31364         * mpf/sub.c: Increase prec by 1.
31365         * mpf/ui_sub.c: Likewise.
31367 Fri Feb 23 00:59:54 1996  Torbjorn Granlund  <tege@matematik.su.se>
31369         * mpf/ui_sub.c: Fix typos.
31371         * mpf/get_str.c: When allocating space for tmp, allow for an extra
31372         limb.  In code for fraction conversion, add special case for bases
31373         that are a power of 2.
31375         * mpf/out_str.c: Output leading "0.".
31376         Default base to 10, before computing string allocation.
31378         * mpf/get_str.c: Make variables for string size have type size_t.
31379         * gmp.h: Corresponding change.
31381         * mpf/random2.c: Allow creation of prec+1 large mantissas.
31383         * mpf/add_ui.c: Don't abort if u < 0; special case for u <= 0.
31384         Fix typo in MPN_COPY offset.
31385         * mpf/sub_ui.c: Analogous changes.
31387         * mpf/set_prec.c: Rewrite.
31389         * mpf/init2.c: Compute precision as in set_prec.c.
31391         * mpf/div_2exp.c: Special case for u == 0.
31392         * mpf/mul_2exp.c: Likewise.  Write r->_mp_size always.
31394         * mpf/sqrt_ui.c: mpn_sqrt => mpn_sqrtrem.
31395         * mpf/sqrt.c: Likewise.  When computing new exponent, round quotient
31396         towards -infinity.
31398         * mpf/add.c: Fix typos.
31399         * mpf/sub.c: Fix typos.
31401 Thu Feb 22 00:24:48 1996  Torbjorn Granlund  <tege@matematik.su.se>
31403         * mpz/Makefile.in (stamp-stddefh): Delete target.
31404         (test): Delete target.
31405         * Makefile.in (stamp-stddefh): Delete target.
31406         (cre-stddefh.o): Delete target.
31407         (gmp.dvi): Set TEXINPUTS before invoking tex.
31409         * cre-stddefh.c: Delete.
31411         * mpz/sqrt.c: Fix typo.
31413         * mpz/powm.c: Special case for mod == 0.
31414         * mpz/powm_ui.c: Likewise.
31416         * mpz/get_si.c: Handle -0x80000000 correctly.
31418         * mpz/inp_str.c: Now returns size_t.
31419         Make it return number of bytes read or error indication.
31420         * mpf/inp_str.c: Likewise.
31422         * mpz/out_raw.c: Replace by mpz/out_binary.c, with modifications.
31423         * mpz/inp_raw.c: Rewrite, using mpz/inp_binary as a base.
31424         * mpz/inp_binary.c: Delete.
31426         * mpn/Makefile.in (XCFLAGS): Remove variable.
31427         (.c.o): Don't pass XCFLAGS.
31428         (SFLAGS): Set to nothing.
31429         (.S.o): Pass SFLAGS, not XCFLAGS.
31431         * mpn/config/t-freebsd (SFLAGS): New name for XCFLAGS.
31433         * mpf/out_str.c: Make return number of bytes written or error
31434         indication.
31435         * mpz/out_str.c: Likewise.
31436         * gmp.h: Corresponding changes.
31438         * gmp.h (__mpz_struct): mp_size_t => int.
31439         (__mpq_struct): Likewise.
31440         (__mpf_struct): Likewise.
31441         (mp_size_t): int => long int.
31443         * mpn/cray: New directory.
31444         * mpn/cray/gmp-mparam.h: New file.
31445         * mpn/configure.in: Recognize cray variants.
31447         * Makefile.in: Set defaults for prefix, libdir, etc.
31448         (install): New target.
31449         (install-bsdmp): New target.
31450         (gmp.html): New target.
31452         * stack-alloc.c (__tmp_alloc): Cast void ptrs to char * in comparison.
31454 Wed Feb 21 04:35:02 1996  Torbjorn Granlund  <tege@matematik.su.se>
31456         * gmp.h: Sort mpn declarations.
31457         (mpn_gcdext): Add declaration.
31459         * mpn/generic/divrem_1.c: New file.
31460         * mpn/Makefile.in (divrem_1.o): New rule.
31461         * configure.in (functions): Add divrem_1.
31463         * mpn/generic/divmod.c: Delete file.
31464         * mpn/configure.in (functions): Delete divmod.
31465         * Makefile.in (divmod.o): Delete rule.
31466         * gmp.h (mpn_divmod): New #define.
31468         * gmp.h (mpn_next_bit_set): Delete spurious declaration.
31470         * mpn/generic/divrem.c (default case): In code assigning
31471         most_significant_q_limb, move reassignment of n0 into if statement.
31473         * gmp.h (mpf_inp_str): Fix typo.
31474         (mpf_out_str): Make prototype match reality.
31475         * mpf/inp_str.c: New file.
31476         * mpf/out_str.c: New file.
31477         * mpf/Makefile.in: Compile new files.
31479         * mpn/Makefile.in (dump.o): Fix dependency path.
31480         (inlines.o): Likewise.
31482         * mpn/configure.in: Make m68060 be the same as m68000.  Clean up
31483         m68k configs.
31485 Tue Feb 20 01:35:11 1996  Torbjorn Granlund  <tege@matematik.su.se>
31487         * mpn/generic/sqrtrem.c: Renamed from sqrt.
31488         * mpn/configure.in (functions): Corresponding change.
31489         * mpn/Makefile.in: Likewise.
31490         * mpz/sqrtrem.c: Likewise.
31491         * mpz/sqrt.c: Likewise.
31492         * mpn/generic/perfsqr.c: Likewise.
31494         * Makefile.in (clean): Also remove libmp.a.
31495         Don't compile cre-conv-tab.c or mp_bases.c.
31496         cre-conv-tab.c: Delete file.
31497         (gmp.ps): New rule.
31499         * mpn/mp_bases.c: New file.
31500         * mpn/Makefile.in: Compile mp_bases.c.
31502         * mpz/set_str.c: Skip initial whitespace.
31503         * mpf/set_str.c: Likewise.
31504         * mpbsd/xtom.c: Likewise.
31506         * gmp.h: Add missing mpz declarations.
31507         Delete all formal parameter names from declarations.
31509         * mpn/Makefile.in: Add dependencies for .c files.
31511         * Makefile.in (check): Write recursive make calls separately, not as
31512         a loop.
31513         (FLAGS_TO_PASS): New variable.  Use it for most recursive makes.
31515 Mon Feb 19 01:02:20 1996  Torbjorn Granlund  <tege@matematik.su.se>
31517         * mpn/Makefile.in (.S.o): Pipe cpp output to grep in order to delete
31518         lines starting with #.
31519         (CPP): Set to $(CC) -E to avoid gcc dependency.
31521         * mpn/m68k/syntax.h (moveql): Define to moveq for MIT_SYNTAX.
31523         * mpn/hppa/hppa1_1/pa7100/addmul_1.S: Fix typo in s1_ptr alignment
31524         code.
31525         * mpn/hppa/hppa1_1/pa7100/submul_1.S: Likewise.
31527         * gmp.h: Fix typos in #defines of recently added mpn functions.
31529         * mpz/inp_str.c: Skip all whitespace, not just plain space.
31530         * mpbsd/min.c: Likewise.
31532         * mpn/configure.in (functions): Add gcdext.
31533         * mpn/generic/gcdext.c: New file.
31535         * mpz/legendre.c: mpz_div_2exp => mpz_tdiv_q_2exp.
31537         * gmp.h: Surround mpn declarations with extern "C" { ... }.
31539         * Makefile.in (check): New target.
31541         * mpq/get_d.c: Update comments.  Use rsize instead of dsize + N_QLIMBS
31542         when possible.  Add special case for nsize == 0.
31544         * gmp.h (mpq_get_d): Add declaration.
31545         (mpq_canonicalize): Likewise.
31546         (mpq_cmp_ui): Likewise.
31547         (mpf_diff): Likewise.
31548         (mpf_ui_sub): Likewise.
31549         (mpf_set_prec): Likewise.
31550         (mpf_random2): Likewise.
31552         * gmp.h (mpz_cmp_ui): New #define.
31553         (mpz_cmp_si): New #define.
31554         (mpq_cmp_ui): New #define.
31555         (mpz_sign): New #define.
31556         (mpq_sign): New #define.
31557         (mpf_sign): New #define.
31558         (mpq_numref): New #define.
31559         (mpq_denref): New #define.
31561         * mpq/set_z.c: File deleted.
31562         * mpq/Makefile.in: Corresponding changes.
31564 Sun Feb 18 01:34:47 1996  Torbjorn Granlund  <tege@matematik.su.se>
31566         * mpbsd/sdiv.c: Use _mp_realloc, not _mpz_realloc.
31568         * mpz/inp_binary.c: Default stream to stdin.
31569         * mpz/inp_str.c: Likewise.
31570         * mpz/inp_raw.c: Likewise.
31571         * mpz/out_binary.c: Default stream to stdout.
31572         * mpz/out_raw.c: Likewise.
31573         * mpz/out_str.c: Likewise.
31575         * mpbsd/realloc.c: New file.
31576         * mpbsd/Makefile.in: Corresponding changes.
31578         * mpbsd/min.c: Rewrite (base on mpz/inp_str.c).
31579         * mpbsd/mtox.c: Rewrite (base on mpz/get_str.c).
31581         * mpbsd/mout.c: Rewrite (base on mpz/out_str) but make it output
31582         spaces in each 10th position.
31583         * mpbsd/xtom.c: Rewrite (base on mpz/set_str).
31585         * mpq/tests/Makefile.in (st-cmp): New file.
31586         * mpq/tests/configure.in (srcname): New file.
31588         * mpz/tests/configure.in (srcname): Fix typo.
31590         * mpq/cmp.c: Add check using number of significant bits, to avoid
31591         general multiplication.
31593 Sat Feb 17 11:58:30 1996  Torbjorn Granlund  <tege@matematik.su.se>
31595         * mpq/cmp_ui.c: Store cy_limb after the mpn_mul_1 calls.
31597         * mpq/tests: New directory.
31598         * mpq/tests/t-cmp.c: New file.
31599         * mpq/tests/t-cmp_ui.c: New file.
31601         * mpz/tests/dive.c (main): Generate zero numerator.
31602         (get_random_size) : Delete.
31604         * mpz/divexact.c: Add special case for 0/x.
31606         * gmp.h (mpz_mod): Add declaration.
31608 Fri Feb 16 18:18:39 1996  Andreas Schwab  <schwab@informatik.uni-dortmund.de>
31610         * mpn/m68k/*: Rewrite code not to use the INSN macros.
31611         (L): New macro to properly prefix local labels for ELF.
31613 Fri Feb 16 00:20:56 1996  Torbjorn Granlund  <tege@matematik.su.se>
31615         * gmp-impl.h (ieee_double_extract): Use plain `unsigned int' for
31616         fields.
31617         * mpn/generic/inlines.c (_FORCE_INLINES): New #define.  Delete
31618         conditional __GNUC__.
31619         * gmp.h (mpn_add, mpn_sub, mpn_add_1, mpn_sub_1):
31620         Only define these if __GNUC__ || _FORCE_INLINES.
31621         * mpf/random2.c: Add missing parameter in non-ANSI header.
31622         * mpn/generic/gcd.c (SIGN_BIT): Do as #define to work around bug
31623         in AIX compilers.
31624         * mpq/get_d.c: #define N_QLIMBS.
31625         * mpz/divexact.c: Obscure division by 0 to silent compiler warnings.
31626         * stack-alloc.c: Cast void* pointer to char* before doing arithmetic
31627         on it.
31629         * Makefile.in (mpbsd/libmpbsd.a): New rule.
31630         * configure.in (configdirs): Add mpbsd.
31632         * gmp.h: Add declarations for a few missing mpn functions.
31634         * Makefile.in (libmp.a): New rule.
31636         * mpbsd/mdiv.c: #include "dmincl.c", not "mpz_dmincl.c"
31637         * gmp.h: Move #define of __GNU_MP__ into the `#if __GNU_MP__' block.
31638         * mp.h: Likewise.  Update typedefs from gmp.h.
31639         * mpbsd/configure.in: New file.
31640         * mpbsd/Makefile.in: New file.
31641         * mpbsd/configure: Link to master configure.
31642         * mpbsd/config.sub: Link to master config.sub.
31644         * Makefile.in: Set RANLIB_TEST.
31645         * (libgmp.a): Use it.
31646         * (libgmp.a): Do ranlib before moving the libgmp.a to the build
31647         directory.
31648         * mp?/Makefile.in: Don't use or set RANLIB.
31650 Thu Feb 15 16:38:41 1996  Torbjorn Granlund  <tege@matematik.su.se>
31652         * mpz/add_ui.c: MP_INT => mpz_t.
31653         * mpz/cmp_ui.c: Likewise.
31654         * mpz/fac_ui.c: Likewise.
31655         * mpz/inp_binary.c: Likewise.
31656         * mpz/inp_raw.c: Likewise.
31657         * mpz/legendre.c: Likewise.
31658         * mpz/jacobi.c: Likewise.
31659         * mpz/out_binary.c: Likewise.
31660         * mpz/out_raw.c: Likewise.
31661         * mpz/random2.c: Likewise.
31662         * mpz/random.c: Likewise.
31663         * mpz/realloc.c: Likewise.
31665         * mpz/legendre.c: __mpz_2factor(X) => mpz_scan1(X,0),
31666         __mpz_odd_less1_2factor => mpz_scan1(X,1).
31667         * mpz/ntsup.c: File deleted.
31668         * mpz/Makefile.in: Corresponding changes.
31670         * mpz/pprime_p: Use mpz_scan1 to avoid looping.
31672         * mpz/fac_ui.c: Type of `k' and `p' is `unsigned long'.
31673         * mpz/pprime_p.c: Pass long to *_ui functions.
31674         * mpz/gcdext.c: Likewise.
31675         * mpz/fdiv_r_2exp.c: Likewise.
31676         * mpz/fac_ui.c: Likewise.
31678         * mpz/powm.c: Don't use mpn_rshift when mod_shift_cnt is 0.
31680         * mpz/tests/Makefile.in (st-sqrtrem): Fix typo.
31682         * mpz/cmp_ui.c: #undef mpz_cmp_ui.
31683         * mpz/cmp_si.c: #undef mpz_cmp_si.
31684         * gmp.h (mpz_cmp_ui): New #define.
31685         (mpz_cmp_si): New #define.
31687 Wed Feb 14 22:11:24 1996  Torbjorn Granlund  <tege@matematik.su.se>
31689         * gmp.h: Test __cplusplus in addition to __STDC__.
31690         * gmp-impl.h: Likewise.
31692         * gmp.h: Surround declarations with extern "C" { ... }.
31694 Tue Feb 13 15:20:45 1996  Torbjorn Granlund  <tege@matematik.su.se>
31696         * mpz/fdiv_r_2exp.c: Use MPN_NORMALIZE.
31697         * mpz/tdiv_r_2exp.c: Likewise.
31699         * mpz/fdiv_r_2exp.c: New file.
31700         * mpz/fdiv_q_2exp.c: New file.
31701         * mpz/tdiv_r_2exp.c: Renamed from mpz/mod_2exp.c.
31702         * mpz/tdiv_q_2exp.c: Renamed from mpz/div_2exp.c
31703         * mpz/Makefile.in: Corresponding changes.
31705         * mpz/scan0.c,scan1.c: New files.
31706         * mpz/Makefile.in: Compile them.
31708         * gmp.h (mpn_normal_size): Delete.
31710         * config.guess: Update from Cygnus version.
31712         * mpn/m68k/rshift.S: Use INSN2 macro for lea instructions.
31713         * mpn/m68k/lshift.S: Likewise.
31715         * mpn/configure.in: Fix configuration for plain 68000.
31717 Mon Feb 12 01:06:06 1996  Torbjorn Granlund  <tege@matematik.su.se>
31719         * mpz/tests/t-powm.c: Generate negative BASE operand.
31721         * mpz/powm.c: Make result always positive.
31723 Sun Feb 11 01:44:56 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
31725         * mpz/tests/*.c: Add t- prefix.
31726         * mpz/tests/Makefile.in: Corresponding changes.
31727         * mpz/tests/configure.in: Update srctrigger.
31729         * mpz/tests/gcd.c: Generate negative operands.
31730         * mpz/tests/gcd2.c: Likewise.
31732         * mpz/gcdext.c: At end, if G is negative, negate all G, S, and T.
31734 Thu Feb  8 17:16:12 UTC 1996 Ken Weber <kweber@mat.ufrgs.br>
31736         * mp{z,n}/gcd.c: Change mpn_gcd interface.
31737         * gmp.h: Ditto.
31738         * gmp.texi: update documentation.
31740 Mon Feb  7 23:58:43 1996  Andreas Schwab  <schwab@informatik.uni-dortmund.de>
31742         * mpn/m68k/{lshift,rshift}.S: New files.
31743         * mpn/m68k/syntax.h: New ELF_SYNTAX macros.
31744         (MEM_INDX, R, PROLOG, EPILOG): New macros.
31745         * mpn/m68k/*.S: Use R macro with register name.  Use PROLOG and EPILOG
31746         macros.  Rename `size' to `s_size' or s1_size to avoid clash with ELF
31747         .size directive.
31748         * mpn/configure.in: New target m68k-*-linux*.
31750 Wed Feb  7 07:41:31 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
31752         * Makefile.in (cre-conv-tab): Workaround for SunOS make.
31754         * mpz/tests/reuse.c: New file.
31755         * mpz/tests/Makefile.in: Handle reuse.c.
31757 Tue Feb  6 11:56:24 UTC 1996 Ken Weber <kweber@mat.ufrgs.br>
31759         * mpz/gcd.c: Fix g->size when one op is 0 and g == other op.
31761 Tue Feb  6 01:36:39 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
31763         * gmp.h (mpz_divexact): Delete parameter names.
31764         (mpz_lcm): Delete spurious declaration.
31766         * mpz/dmincl.c: Fix typo.
31768 Mon Feb  5 01:11:56 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
31770         * mpn/generic/gcd.c (gcd_2): Declare consistently.
31772         * mpz/tdiv_q.c: Optimize division by a single-limb divisor.
31773         * mpz/dmincl.c: Likewise.
31775         * mpz/add.c: Use MPN_NORMALIZE instead of mpn_normal_size.
31776         * mpz/sub.c: Likewise.
31777         * mpn/generic/sqrt.c: Likewise.
31779         * mpn/tests/{add_n,sub_n,lshift,rshift}.c: Put garbage in the
31780         destination arrays.
31782 Fri Feb  2 02:21:27 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
31784         * mpz/{jacobi.c,legendre.c,ntsup.c,invert.c}: New files.
31785         * mpz/Makefile.in: Compile them.
31787         * mpn/Makefile.in (INCLUDES): Don't search in `generic'.
31789 Thu Feb  1 02:15:11 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
31791         Change from Ken Weber:
31792         * mpz/divexact.c: Make it work when quot is identical to either input.
31794         * mpf/ui_sub.c: New file.
31795         * mpf/Makefile.in: Compile it.
31797         * gmp-impl.h (MPZ_TMP_INIT): alloca -> TMP_ALLOC.
31798         * mpz/{c,f}div_{q,qr,r}.c: Use TMP_DECL/TMP_MARK/TMP_FREE since
31799         these use MPZ_TMP_INIT.
31800         * mpz/mod.c: Likewise.
31801         * mpq/{add,sub}.c: Likewise.
31802         * mpq/canonicalize: Likewise.
31804         * mpq/{add,sub,mul,div}.c: Use mpz_divexact. MP_INT -> mpz_t.
31805         * mpq/canonicalize.c: Likewise.
31807 Wed Jan 31 01:45:00 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
31809         * mpn/generic/gcd.c: Misc changes from Ken.
31811         * mpz/tests/gcd2.c: New file.
31812         * mpz/tests/Makefile.in: Handle gcd2.c.
31814         * mpn/generic/gcd.c (mpn_gcd): When GCD == ORIG_V, return vsize,
31815         not orig_vsize.  Fix parameter declaration.
31817         * mpz/mod_ui.c: Delete file.
31818         * mpz/Makefile.in: Don't try to compile mod_ui.
31820         * mpz/cdiv_*_ui.c): Make them work right.
31821         * gmp.h: Declare cdiv*.
31823 Tue Jan 30 02:22:56 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
31825         * mpz/{cdiv_q.c,cdiv_q_ui.c,cdiv_qr.c,cdiv_qr_ui.c,cdiv_r.c,
31826         cdiv_r_ui.c,cdiv_ui.c}: New files.
31827         * mpz/Makefile.in: Compile them.
31829         * All files: Make file permissions right.
31831         Changes from Ken Weber:
31832         * mpn/generic/accelgcd.c: Delete.
31833         * mpn/generic/bingcd.c: Delete.
31834         * mpn/generic/numbits.c: Delete.
31835         * mpn/generic/gcd.c: New file.
31836         * mpn/configure.in (functions): Update accordingly.
31837         * mpz/divexact.c: New file.
31838         * mpz/Makefile.in: Compile divexact.c.
31839         * mpz/gcd.c: Rewrite to accommodate for gcd changes in mpn.
31840         * gmp.h: declare new functions, delete obsolete declarations.
31841         * mpz/tests/dive.c: New file.
31842         * mpz/tests/Makefile.in: Handle dive.c.
31844 Mon Jan 29 03:53:24 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
31846         * mpz/random.c: Handle negative SIZE parameter.
31848         * mpz/tests/tdiv(_ui).c: New name for tst-dm(_ui).c.
31849         * mpz/tests/tst-mdm(_ui).c: Delete.
31850         * mpz/tests/fdiv(_ui).c: New test based in tst-mdm(_ui).
31851         * mpz/tests/*.c: Get rid of tst- prefix for DOS 8+3 naming.
31852         * mpz/tests/Makefile.in: Corresponding changes.
31853         * mpz/tests/configure.in: Update srctrigger.
31855         * mpn/generic/divmod.c: Update from divrem.
31856         * mpn/generic/divrem.c: Misc cleanups.
31858 Sun Jan 28 03:25:08 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
31860         * All files: Use new TMP_ALLOC interface.
31862         * mpz/powm_ui.c: Make Jan 25 changes to powm.c also here.
31864         * mpz/tests/powm_ui.c: New file.
31865         * mpz/tests/Makefile.in: Add rules for tst-powm and tst-powm_ui.
31867         * Makefile.in: Update dependency list.
31868         * mpf/Makefile.in: Likewise.
31869         * mpz/Makefile.in: Likewise.
31870         * mpq/Makefile.in: Likewise.
31871         * Makefile.in: Set RANLIB simply to ranlib, and allow configure
31872         to override it.
31874         * mpz/Makefile.in (conf): Delete spurious target.
31875         (mp_bases.c): Delete.
31876         (cre-conv-tab rules): Delete.
31878         * Makefile.in (cre-conv-tab): Greatly simplify.
31880 Sat Jan 27 13:38:15 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
31882         * stack-alloc.c: New file.
31883         * stack-alloc.h: New file.
31885         * gmp.h (__gmp_inline): Define using __inline__.
31887 Thu Jan 25 00:28:37 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
31889         * mpn/generic/scan0.c: New file.
31890         * mpn/generic/scan1.c: Renamed from next_bit.c.
31891         * mpn/configure.in (functions): Include scan0 and scan1.
31893         * mpn/m68k/*: #include sysdep.h.  Use C_GLOBAL_NAME.
31895         * configure: Update from Cygnus version.
31896         * config.guess: Likewise.
31897         * config.sub: Likewise.
31898         * configure: Pass --nfp to recursive configures.
31900         * mpz/tests/tst-*.c: Adjust SIZE and reps.
31902         * mpz/powm.c: Move esize==0 test earlier.
31903         In final reduction of rp,rsize, don't call mpn_divmod unless
31904         reduction is really needed.
31906         * mpz/tests/tst-powm.c: Fix thinko in checking code.
31908         * All files: Get rid of `__' prefix from mpn_* calls and declarations.
31909         * gmp.h: #define __MPN.
31910         * gmp.h: Use __MPN in #defines for mpn calls.
31912         * mpn/generic/mul_n.c: Prepend `i' to internal routines.
31913         * gmp-impl.h: Add #defines using __MPN for those internal routines.
31915         * mpn/generic/sqrt.c: Change call to mpn_mul to mpn_mul_n.
31917 Wed Jan 24 13:28:19 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
31919         * mpn/sparc32/udiv_fp.S: New name for udiv_qrnnd.S.
31920         * mpn/sparc32/udiv_nfp.S: New name for v8/udiv_qrnnd.S.
31921         * mpn/sparc32/v8/supersparc: New directory.
31922         * mpn/sparc32/v8/supersparc/udiv.S: New file.
31924 Tue Jan 23 01:10:11 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
31926         This major contribution is from Ken Weber:
31927         * mpn/generic/accelgcd.c: New file.
31928         * mpn/generic/bdivmod.c: New file.
31929         * mpn/generic/bingcd.c: New file.
31930         * mpn/generic/gcd_1.c: Rewrite.
31931         * mpn/generic/numbits.c: New file (to go away soon).
31932         * mpz/gcd.c: Rewrite.
31933         * mpz/tests/tst-gcd.c (SIZE): Now 128.
31934         * gmp.h: Declare new functions.
31935         * mpn/configure.in (functions): List new files.
31936         * gmp-impl.h (MPN_SWAP): Delete.
31937         (MPN_LESS_BITS_LIMB, MPN_LESS_BITS, MPN_MORE_BITS): Delete.
31938         (MPN_COMPL_INCR, MPN_COMPL): Delete.
31940 Mon Jan 22 02:04:59 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
31942         * gmp.h (mpn_name): New #define.
31944         * mpn/m88k/mc88110/addmul_1.s: New file.
31945         * mpn/m88k/mc88110/add_n.S: New file.
31946         * mpn/m88k/mc88110/sub_n.S: New file.
31948         * mpn/m88k/sub_n.s: Correctly initialize carry.
31950         * mpn/sparc32/{add_n.S,sub_n.S,lshift.S,rshift.S): `beq' => `be'.
31952 Sun Jan 21 00:04:35 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
31954         * mpn/sparc64/addmul_1.s: New file.
31955         * mpn/sparc64/submul_1.s: New file.
31956         * mpn/sparc64/rshift.s: New file.
31958 Sat Jan 20 00:32:54 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
31960         * mpz/iset.c: Fix typo introduced Dec 25.
31962 Wed Jan 17 13:16:44 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
31964         * config/mt-sprc8-gcc: New name for mt-sparc8-gcc.
31965         * config/mt-sparcv8-gcc: Delete.
31966         * configure.in: Corresponding changes.
31968 Tue Jan 16 16:31:01 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
31970         * gmp-impl.h: #include alloca.h when necessary.
31972         * longlong.h: Test __alpha instead of __alpha__, since the former
31973         is the standard symbol.
31975 Mon Jan 15 18:06:57 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
31977         * mpn/sparc64/mul_1.s: Swap operands of mulx instructions.
31978         * mpn/sparc64/lshift.s: New file.
31980 Fri Dec 29 17:34:03 1995  Torbjorn Granlund  <tege@noisy.matematik.su.se>
31982         * mpn/x86/pentium/add_n.S: Get rid of #defines for register names.
31983         * mpn/x86/pentium/sub_n.S: Likewise.
31985 Thu Dec 28 03:16:57 1995  Torbjorn Granlund  <tege@noisy.matematik.su.se>
31987         * mpn/x86/pentium/mul_1.S: Rework loop to avoid AGI between update
31988         of loop induction variable and load insn at beginning of loop.
31989         * mpn/x86/pentium/addmul_1.S: Likewise.
31990         * mpn/x86/pentium/submul_1.S: Likewise.
31992 Mon Dec 25 23:22:55 1995  Torbjorn Granlund  <tege@noisy.matematik.su.se>
31994         * All files: Prefix user-visible structure fields with _mp_.
31996 Fri Dec 22 20:42:17 1995  Torbjorn Granlund  <tege@noisy.matematik.su.se>
31998         * mpn/configure.in (m68k configs): Terminate path variable with
31999         plain "m68k".
32001 Fri Dec 22 03:29:33 1995  Torbjorn Granlund  <tege@noisy.matematik.su.se>
32003         * mpn/sparc32/add_n.S: Update from sub_n.S to fix bugs, and to
32004         clean things up.
32006         * mpn/configure.in (m68k configs): Update #include path for new
32007         mpn directory organization.
32009 Tue Dec 12 02:53:02 1995  Torbjorn Granlund  <tege@noisy.matematik.su.se>
32011         * gmp.h: Prefix all structure field with _mp_.
32012         * gmp-impl.h: Define access macros for these fields.
32014 Sun Dec 10 00:47:17 1995  Torbjorn Granlund  <tege@noisy.matematik.su.se>
32016         * mpn/alpha/addmul_1.s: Prefix labels with `.'.
32017         * mpn/alpha/submul_1.s: Likewise.
32018         * mpn/alpha/[lr]shift.s: Likewise.
32019         * mpn/alpha/udiv_qrnnd.S: Likewise.
32020         * mpn/alpha/ev5/[lr]shift.s: Likewise.
32022         * mpn/alpha/ev5/lshift.s: Fix typos.
32024 Fri Dec  1 14:28:20 1995  Torbjorn Granlund  <tege@noisy.matematik.su.se>
32026         * mpn/Makefile.in (.SUFFIXES): Define.
32028 Wed Nov 29 23:11:57 1995  Torbjorn Granlund  <tege@noisy.matematik.su.se>
32030         * mpn/sparc64/{add_n.s, sub_n.s}: New files.
32032 Tue Nov 28 06:03:13 1995  Torbjorn Granlund  <tege@noisy.matematik.su.se>
32034         * mpn/x86/syntax.h: Handle ELF_SYNTAX.
32035         Rename GAS_SYNTAX => BSD_SYNTAX.
32037         * mpn/configure.in: Handle linuxelf and SysV for x86 variants.
32039 Mon Nov 27 01:32:12 1995  Torbjorn Granlund  <tege@noisy.matematik.su.se>
32041         * mpn/hppa/hppa1_1/pa7100/submul_1.S: New file.
32043 Sun Nov 26 04:30:47 1995  Torbjorn Granlund  <tege@noisy.matematik.su.se>
32045         * mpn/hppa/hppa1_1/pa7100/addmul_1.S: New file.
32047         * mpn/sparc32/add_n.S: Rewrite to use 64 bit loads/stores.
32048         * mpn/sparc32/sub_n.S: Likewise.
32050 Fri Nov 17 00:18:46 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
32052         * mpn/configure.in: Handle m68k on NextStep.
32054 Thu Nov 16 02:30:26 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
32056         * mpn: Reorganize machine-specific directories.
32057         * mpn/configure.in: Corresponding changes.
32058         (sh, sh2): Handle these.
32059         (m68k targets): Create asm-syntax.h.
32061 Thu Nov  9 02:20:50 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
32063         * mpn/generic/mul_n.c (____mpn_sqr_n): Delete code that calls abort.
32064         (____mpn_mul_n): Likewise.
32066 Tue Nov  7 03:25:12 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
32068         * mpf/get_str.c: In exponentiation code (two places), don't swap
32069         input and output areas when calling mpn_mul_1.
32070         * mpf/set_str.c: Likewise.
32072 Fri Nov  3 02:35:58 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
32074         * mpf/Makefile.in: Make sure all objects are listed in dependency list;
32075         delete spurious entries.
32077         * mpf/mul.c: Handle U or V being 0.  Allow prec+1 for result precision.
32079         * mpf/set_prec.c: New computation of limb precision.
32080         * mpf/set_dfl_prec.c: Likewise.
32082         * mpf/random2.c: Fix typo computing exp.
32083         * mpf/get_str.c: In (uexp > usize) case, set n_limbs as a function of
32084         the user-requested number of digits, n_digits.
32086 Thu Nov  2 16:25:07 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
32088         * mpn/generic/divrem.c (case 2): Don't move np vector back, it is
32089         never read.
32090         (default case): Put most significant limb from np in new variable n2;
32091         decrease size argument for MPN_COPY_DECR; use n2 instead of np[dsize].
32093 Wed Nov  1 02:59:53 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
32095         * mpn/sparc/[lr]shift.S: New files.
32097 Tue Oct 31 00:08:12 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
32099         * mpz/gcd_ui.c: Set w->size unconditionally when v is zero.
32101         * gmp-impl.h (assert): Delete definition.
32103         * mpf/sub.c: Delete all assert calls.  Delete variable `cy'.
32105         * mpf/neg.c: Use prec+1 as precision.  Optimize for when arguments
32106         are the same.
32107         * mpf/abs.c: Likewise.
32108         * mpf/{set,neg,abs}.c: Make structure and variable names similar.
32110 Mon Oct 30 12:45:26 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
32112         * mpf/random2.c (random): Test __SVR4 in addition to __svr4__.
32113         * mpn/generic/random2.c (random): Likewise.
32115 Sun Oct 29 01:54:28 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
32117         * mpf/div.c: Special handle U or V being 0.
32119         * mpf/random2.c: New file.
32121         * longlong.h (i860 rshift_rhlc): Define.
32122         (i960 udiv_qrnnd): Define.
32123         (i960 count_leading_zeros): Define.
32124         (i960 add_ssaaaa): Define.
32125         (i960 sub_ddmmss): Define.
32126         (i960 rshift_rhlc): Define.
32128 Sat Oct 28 19:09:15 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
32130         * mpn/pentium/rshift.S: Fix and generalize condition for when to use
32131         special code for shift by 1.
32132         * mpn/pentium/lshift.S: Likewise.
32134 Thu Oct 26 00:02:56 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
32136         * gmp.h: #undef __need_size_t.
32137         * mp.h: Update from gmp.h.
32139 Wed Oct 25 00:17:27 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
32141         * mpf/Makefile.in: Compile set_prec.c.
32142         * mpf/realloc.c: Delete this file.
32143         * mpf/Makefile.in: Delete mentions of realloc.c.
32145         * gmp.h (__mpf_struct): Get rid of `alloc' field.
32146         * mpf/clear.c: Likewise.
32147         * mpf/init*.c: Likewise.
32148         * mpf/set_prec.c: Likewise.
32149         * mpf/iset*.c: Likewise.
32151         * mpf/iset_str.c: New file.
32153         * mpn/configure.in: Handle pyramid.
32155         * mpf/set.c: Use prec+1 as precision.
32157         * mpf/set_prec.c: New file.
32159 Tue Oct 24 00:56:41 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
32161         * mpn/generic/divrem.c: New file.  Will replace mpn/generic/divmod.c
32162         when rest of source is converted.
32163         * mpn/configure.in (functions): Add `divrem'
32164         * mpn/generic/set_str.c: Never call __mpn_mul_1 with zero size.
32166         * mpf/get_str.c: Completely rewritten.
32167         * mpf/add.c: Fix several problems.
32168         * mpf/sub.c: Compare operands from most significant end until
32169         first difference, exclude skipped limbs from computation.
32170         Accordingly simplify normalization code.
32171         * mpf/set_str.c: Fix several problems.
32172         * mpf/dump.c: New file.
32173         * mpf/Makefile.in: Compile dump.c.
32174         * mpf/init2.c: Set prec field correctly.
32176 Sun Oct 22 03:02:09 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
32178         * cre-conv-tab.c: #include math.h; don't declare log and floor.
32180 Sat Oct 21 23:04:10 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
32182         * mpf/mul_ui.c: Handle U being 0.
32184 Wed Oct 18 19:39:27 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
32186         * mpn/generic/set_str.c: Correctly handle input like "000000000000".
32187         Misc cleanups.
32189 Tue Oct 17 15:14:13 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
32191         * longlong.h: Define COUNT_LEADING_ZEROS_0 for machines where
32192         appropriate.
32194 Mon Oct 16 19:14:43 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
32196         * mpf/add.c: Rewrite.
32197         * mpf/set_str.c: New file.  Needs more work.
32199 Sat Oct 14 00:14:04 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
32201         * mpf/div_2exp.c: Vastly simplify.
32202         * mpf/mul_2exp.c: Likewise.
32204         * mpf/sub.c: Rewrite.
32206         * gmp-impl.h (udiv_qrnnd_preinv2gen): Terminate comment.
32208         * mpf/dump.c: Free allocated memory.
32210         * gmp-impl.h (assert): Define.
32212 Wed Oct 11 13:31:00 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
32214         * mpn/pentium/rshift.S: Install new code to optimize shift-by-1.
32216 Tue Oct 10 00:37:21 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
32218         * mpn/pentium/lshift.S: Install new code to optimize shift-by-1.
32220         * mpn/powerpc32/{lshift.s,rshift.s}: New files.
32222         * configure.in: Fix typo.
32224 Sat Oct  7 08:17:09 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
32226         * longlong.h (smul_ppmm): Correct type of __m0 and __m1.
32228 Wed Oct  4 16:31:28 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
32230         * mpn/configure.in: Handle alphaev5.
32231         * mpn/ev4: New name for alpha subdir.
32232         * mpn/ev5: New subdir.
32233         * mpn/ev5/lshift.s: New file.
32235 Tue Oct  3 15:06:45 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
32237         * mpn/alpha/mul_1.s: Avoid static increments of pointers; use
32238         corresponding offsets in ldq and stq instructions instead.
32239         (Loop): Swap cmpult and stq to save one cycle on EV5.
32241         * mpn/tests/{add_n.s,sub_n.s,lshift.s,rshift.s,mul_1.s,addmul_1.s,
32242         submul_1.s}: Don't check results if NOCHECK is defined.
32244 Mon Oct  2 11:40:18 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
32246         * longlong.h (mips umul_ppmm [32 and 64 bit versions]):
32247         Make new variants, based on GCC version number, that use `l' and `h'
32248         constraints instead of explicit mflo and mfhi instructions
32250 Sun Oct  1 00:17:47 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
32252         * mpn/mc88100/add_n.s: Decrease unrolling factor from 16 to 8.
32253         * mpn/mc88100/sub_n.s: Likewise.
32255         * config/mt-m88110: New file.
32256         * configure.in: Use it.
32258         * mpn/mc88110/mul_1.s: Fix thinko.
32260 Sat Sep 30 21:28:19 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
32262         * mpz/set_d.c: Declare `size' at function start.
32264         * experimental: New directory for mpx and mpz2.
32266         * mpz/tdiv_q.c: Clarify comments.
32267         * mpz/{mod.c,mod_ui.c}: New file, for math mod function.
32269         * mpn/sh2/{mul_1.s,addmul_1.s,submul_1.s}: New files.
32271         * mpn/sh/{add_n.s,sub_n.s}: New files.
32273         * mpn/pyr/{add_n.s,sub_n.s,mul_1.s,addmul_1.s}: New files.
32275         * mpn/i960/{add_n.s,sub_n.s}: New files.
32277         * mpn/alpha/addmul_1.s (Loop): Move decrement of r18 to before umulh,
32278         to save cycles on EV5.
32279         * mpn/alpha/submul_1.s: Ditto.
32280         * mpn/alpha/mul_1.s: Ditto.
32282 Thu Sep 28 02:48:59 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
32284         * gmp.h (mp_limb, mp_limb_signed): Define as `long long' if
32285         _LONG_LONG_LIMB is defined.
32287         * longlong.h (m88110): Test __m88110__, not __mc88110__
32289         * mpn/mc88110/mul_1.s: Rewrite.
32291 Tue Sep 26 23:29:05 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
32293         * config.sub: Update from current Cygnus version.
32295         * mpn/configure.in: Recognize canonical m88*, not mc88*.
32297 Fri Sep 22 14:58:05 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
32299         * mpz/set_d.c: New file.
32300         * mpz/Makefile.in: Build new files.
32302         * mpq/get_d.c: Replace usage of scalbn with ldexp.
32304         * mpn/{vax,i386}/gmp-mparam.h: New files.
32305         * gmp-impl.h (ieee_double_extract): Define here.
32306         * mpf/set_d.c (ieee_double_extract): Not here.
32308 Thu Sep 21 00:56:36 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
32310         * longlong.h (C umul_ppmm): Use UWtype, not USItype for temps.
32311         (udiv_qrnnd): For cases implemented with call to __udiv_qrnnd,
32312         protect with new symbol LONGLONG_STANDALONE.
32313         (68000 umul_ppmm): Use %# prefix for immediate constants.
32315 Wed Sep 20 15:36:23 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
32317         * mpn/generic/divmod_1.c: Handle
32318         divisor_limb == 1 << (BITS_PER_MP_LIMB - 1)
32319         specifically also when normalization_steps != 0.
32321 Mon Sep 18 15:42:30 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
32323         * mpq/get_d.c: New file.
32325 Sun Sep 17 02:04:36 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
32327         * longlong.h (pyr): Botch up for now.
32329 Sat Sep 16 00:11:50 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
32331         * mpn/clipper/mul_1.s: New file.
32332         * mpn/clipper/add_n.s: New file.
32333         * mpn/clipper/sub_n.s: New file.
32334         * mpn/configure.in: Handle clipper*-*-*.
32336         * mpn/configure.in: Recognize rs6000-*-*.
32338 Fri Sep 15 00:41:34 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
32340         * mpn/alpha/add_n.s: New file.
32341         * mpn/alpha/sub_n.s: New file.
32343         * mpn/mips3: New name for mpn/r4000.
32344         * mpn/mips2: New name for mpn/r3000.
32345         * mpn/configure.in: Corresponding changes.
32347         * mpn/generic/perfsqr.c (primes): Delete.
32348         (residue_map): Delete.
32350 Thu Sep 14 00:07:58 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
32352         * mpn/r3000/sub_n.s: Fix typo.
32354         * dm_trunc.c: Delete spurious file.
32356         * mpz/out_binary.c: Fix typo.
32358         * mpn/configure.in (per-target): Make mips*-*-irix6* imply r4000.
32360         * gmp-impl.h: For sparc and sgi, include alloca.h.
32362         * mpn/z8000/mul_1.s: Replace `test r' with `and r,r'.  Replace
32363         `ldk r,#0' with `xor r,r'.
32365 Wed Sep  6 00:58:38 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
32367         * mpz/inp_binary.c: New file.
32368         * mpz/out_binary.c: New file.
32369         * mpz/Makefile.in: Build new files.
32371 Tue Sep  5 22:53:51 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
32373         * gmp.h (__mpz_struct): Change `long int' => `mp_size_t' for alloc
32374         and size fields.
32376 Sat Sep  2 17:47:59 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
32378         * mpn/r4000/{add_n.s,sub_n.s}: Optimize away some pointer arithmetic.
32379         * mpn/r3000/{add_n.s,sub_n.s,lshift.s,rshift.s}: New files,
32380         derived from r4000 code.
32382 Fri Sep  1 05:35:52 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
32384         * mpn/r3000/mul_1.s: Fix typo.
32386         * mpn/powerpc32: Fix some old vs new mnemonic issues.
32388         * mpn/powerpc32/{add_n.s,sub_n.s}: New files.
32389         * mpn/r4000/{add_n.s,sub_n.s,lshift.s,rshift.s}: New files.
32391 Wed Aug 30 10:43:47 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
32393         * mpn/r3000/mul_1.s ($LC1): Use addiu for immediate add.
32394         * mpn/r4000/{mul_1.s,addmul_1.s,submul_1.s}: New files.
32396         * config.guess: Update to latest FSF revision.
32398 Mon Aug 28 02:18:13 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
32400         * mpz/out_str.c: Cast str to char * in fputs call.
32402         * gmp-impl.h: Define UQItype, SItype, and USItype also
32403         when not __GNUC__.
32405 Fri Aug 25 01:45:04 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
32407         * mpn/i386/syntax.h: Renamed from asm-syntax.h.
32408         * mpn/mc68020/syntax.h: Renamed from asm-syntax.h.
32409         * mpn/configure.in: Corresponding changes.
32411 Sun Aug 13 19:20:04 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
32413         * mpn/generic/random2.c: Test __hpux, not hpux.
32415 Sat Apr 15 20:50:33 1995  Torbjorn Granlund  (tege@tiny.cygnus.com)
32417         * mpn/sparc/add_n.S: Make it work for PIC.
32418         * mpn/sparc/sub_n.s: Likewise.
32419         * mpn/sparc8/addmul_1.S: Likewise.
32420         * mpn/sparc8/mul_1.S: Likewise.
32421         * mpn/i386/add_n.S: Likewise.
32422         * mpn/i386/sub_n.S: Likewise.
32424 Thu Apr 13 23:15:03 1995  Torbjorn Granlund  (tege@tiny.cygnus.com)
32426         * mpn/configure.in: Don't search power subdir for generic ppc configs.
32427         Add some ppc cpu-specific configs.  Misc clean up.
32429 Mon Apr 10 00:16:35 1995  Torbjorn Granlund  (tege@tiny.cygnus.com)
32431         * mpz/ui_pow_ui.c: Delete spurious code to handle negative results.
32433 Sun Apr  9 12:38:11 1995  Torbjorn Granlund  (tege@tiny.cygnus.com)
32435         * longlong.h (SPARC v8 udiv_qrnnd): Generate remainder in C,
32436         not in asm.
32438         * mpn/generic/sqrt.c (SQRT): Test for __SOFT_FLOAT.
32440 Tue Mar 28 00:19:52 1995  Torbjorn Granlund  (tege@tiny.cygnus.com)
32442         * mpn/generic/hamdist.c (popc_limb): Make Mar 16 change here too.
32444 Fri Mar 17 23:29:22 1995  Torbjorn Granlund  (tege@tiny.cygnus.com)
32446         * longlong.h (SH umul_ppmm): Define.
32448 Thu Mar 16 16:40:44 1995  Torbjorn Granlund  (tege@tiny.cygnus.com)
32450         * mpn/generic/popcount.c (popc_limb): Rearrange 32 bit case
32451         to help CSE.
32453 Fri Mar 10 20:03:49 1995  Torbjorn Granlund  (tege@tiny.cygnus.com)
32455         * mpn/powerpc32/mul_1.s: Clear cy before entering loop.
32456         Rearrange loop to save a cycle.
32457         * mpn/powerpc32/addmul_1.s: New file.
32458         * mpn/powerpc32/submul_1.s: New file.
32460 Fri Feb 17 22:44:45 1995  Torbjorn Granlund  (tege@tiny.cygnus.com)
32462         * mpn/configure.in: Set target_makefile_frag for freebsd
32463         in new case stmt.
32464         * mpn/config/t-freebsd: New file.
32465         * mpn/Makefile.in: Add #### for frag insertion.
32466         (XCFLAGS): Clear by default.
32467         (.c.o, .S.o rules): Pass XCFLAGS.
32469 Tue Feb  7 16:27:50 1995  Torbjorn Granlund  (tege@tiny.cygnus.com)
32471         * longlong.h (68000 umul_ppmm): Merge improvements from henderson.
32473 Tue Jan 24 04:23:20 1995  Torbjorn Granlund  (tege@tiny.cygnus.com)
32475         * longlong.h (default umul_ppmm): Store input parameters in temporaries
32476         to avoid reading them twice.
32477         (default smul_ppmm): New definition.
32479 Thu Dec 29 04:20:07 1994  Jim Meyering  (meyering@comco.com)
32481         * generic/perfsqr.c (__mpn_perfect_square_p): Remove declaration
32482         of unused variable.
32483         * generic/pre_mod_1.c (__mpn_preinv_mod_1): Likewise.
32484         * mpz/powm.c (pow): Likewise.
32486         * mpz/and.c (mpz_and): Use {} instead of `;' for empty else clause
32487         to placate `gcc -Wall'.
32488         * mpz/ior.c (mpz_ior): Likewise.
32490 Wed Dec 28 13:31:40 1994  Torbjorn Granlund  (tege@tiny.cygnus.com)
32492         * mpn/m*68*/*.S: #include asm-syntax.h, not asm.h.
32494 Mon Dec 26 17:15:36 1994  Torbjorn Granlund  (tege@tiny.cygnus.com)
32496         * longlong.h: Test for more symbols, in __mc68000__ case.
32498         * mpn/mpn/config.sub: Recognize m68060.
32499         * mpn/configure.in: Change mc* to m* for 68k targets.
32500         * mpn/Makefile.in (.S.o): Delete spurious creation of temp .c file.
32502 Mon Dec 19 01:56:30 1994  Torbjorn Granlund  (tege@tiny.cygnus.com)
32504         * config.sub: Recognize pentium as a valid CPU.
32505         * mpn/configure.in: Handle pentium specifically, to use new assembly
32506         code.
32508 Mon Dec 19 00:13:01 1994  Jim Meyering  (meyering@comco.com)
32510         * gmp.h: Define _GMP_H_HAVE_FILE if FILE, __STDIO_H__, or H_STDIO
32511         is defined.
32512         * gmp.h: test _GMP_H_HAVE_FILE instead of FILE everywhere else.
32514 Mon Dec 19 00:04:54 1994  Kent Boortz  (boortz@sics.se)
32516         * Makefile.in (recursive makes): Pass CFLAGS.
32518 Sun Dec 18 22:34:49 1994  Torbjorn Granlund  (tege@tiny.cygnus.com)
32520         * mpn/pentium: New directory.
32522         * mpz/pprime.c: Make sure to mpz_clear all temporaries.
32524         * longlong.h: Don't use udiv instruction when SUPERSPARC is defined.
32525         * configure.in: Handle supersparc*-.
32526         * config/mt-supspc-gcc: New file.
32527         * config/mt-sparc8-gcc: New name for mt-sparcv8-gcc.
32529 Mon Dec 12 22:22:10 1994  Torbjorn Granlund  (tege@tiny.cygnus.com)
32531         * mpn/i386/*.S: #include "asm-syntax.h", not "asm.h".
32532         #include sysdep.h before asm-syntax.h.
32534         * mpn/mc68020/asm-syntax.h: #undef ALIGN before defining it.
32535         * mpn/i386/asm-syntax.h: Likewise.
32537         * mpn/mc68020/asm-syntax.h: New name for asm.h.
32538         * mpn/i386/asm-syntax.h: New name for asm.h.
32540 Tue Dec  6 21:55:25 1994  Torbjorn Granlund  (tege@tiny.cygnus.com)
32542         * mpz/array_init.c: Fix typo in declaration.
32544 Fri Nov 18 19:50:52 1994  Torbjorn Granlund  (tege@tiny.cygnus.com)
32546         * mpn/Makefile.in (.S.o): Pass CFLAGS and INCLUDES.
32548 Mon Nov 14 00:34:12 1994  Torbjorn Granlund  (tege@tiny.cygnus.com)
32550         * mpn/generic/random2.c (random): Test for __svr4__.
32552 Wed Oct 12 23:28:16 1994  Torbjorn Granlund  (tege@tiny.cygnus.com)
32554         * cre-conv-tab.c (main): Avoid upper-case X in printf format string.
32556 Tue Aug 23 17:16:35 1994  Torbjorn Granlund  (tege@tiny.cygnus.com)
32558         * mpz/perfsqr.c: Use mpn_perfect_square_p.
32559         * mpn/generic/perfsqr.c: New file.
32561 Wed Jul  6 13:46:51 1994  Torbjorn Granlund  (tege@tiny.cygnus.com)
32563         * mpz/array_init.c: New file.
32564         * mpz/Makefile.in: Compile array_init.
32565         * gmp.h: Declare mpz_array_init.
32567 Mon Jul  4 01:10:03 1994  Torbjorn Granlund  (tege@tiny.cygnus.com)
32569         * mpz/add.c: Fix bogus comment.
32570         * mpz/sub.c: Likewise.
32572 Sat Jul  2 02:14:56 1994  Torbjorn Granlund  (tege@adder.cygnus.com)
32574         * mpn/generic/pre_mod_1.c: New file.
32575         * mpz/perfsqr.c: Use __mpn_preinv_mod_1 when faster.
32577 Fri Jul 01 22:10:19 1994  Richard Earnshaw (rwe11@cl.cam.ac.uk)
32579         * longlong.h (arm umul_ppmm): Fix typos in last change.  Mark
32580         hard-coded registers with "%|"
32582 Thu Jun 30 03:59:33 1994  Torbjorn Granlund  (tege@tiny.cygnus.com)
32584         * mpz/perfsqr.c: Define PP, etc, for machines with 64 bit limbs.
32585         Use __mpn_mod_1.
32586         * mpz/perfsqr.c: Don't clobber REM in quadratic residue check loop.
32588 Wed Jun 29 18:45:41 1994  Torbjorn Granlund  (tege@adder.cygnus.com)
32590         * mpn/generic/sqrt.c (SQRT): New asm for IBM POWER2.
32592         * mpz/gcd_ui.c: Return 0 if result does not fit an unsigned long.
32594         * gmp.h: Use "defined (__STDC__)" consistently.
32596 Tue Jun 28 18:44:58 1994  Torbjorn Granlund  (tege@adder.cygnus.com)
32598         * gmp.h (mpz_get_si): Don't use "signed" keyword for return type.
32600         * mpz/tests/Makefile.in: Use CFLAGS for linking.
32602         * Makefile.in (CFLAGS): Use -O2 here.
32603         * mpn/Makefile (CFLAGS): Not here.
32605         * mpq/cmp_ui.c: Fix typo.
32606         * mpq/canonicalize.c: Fix typo.
32607         * mpz/gcd_ui.c: Handle gcd(0,v) and gcd(u,0) correctly.
32608         * mpn/generic/gcd_1.c: Fix braino in last change.
32610 Mon Jun 27 16:10:27 1994  Torbjorn Granlund  (tege@rtl.cygnus.com)
32612         * mpz/gcd_ui.c: Change return type and return result.
32613         Allow destination param to be NULL.
32614         * gmp.h: Corresponding change.
32615         * mpn/generic/gcd_1.c: Handle zero return from mpn_mod_1.
32617 Tue Jun 14 02:17:43 1994  Torbjorn Granlund  (tege@tiny.cygnus.com)
32619         * mpn/i386/asm.h (ALIGN): Make it take a parameter.
32620         * mpn/i386/*.S: Use ALIGN to align all loops.
32622         * mpn/i386/*.S: Move colon inside C_GLOBAL_NAME expression.
32623         (Makes old versions of GAS happy.)
32625 Sat May 28 01:43:54 1994  Torbjorn Granlund  (tege@adder.cygnus.com)
32627         * Many files: Delete unused variables and labels.
32628         * mpn/generic/dump.c: cast printf width argument to int.
32630 Wed May 25 00:42:37 1994  Torbjorn Granlund  (tege@thepub.cygnus.com)
32632         * mpz/gcd.c (mpz_gcd): Normalize after __mpn_sub calls.
32633         (xmod): Ignore return value of __mpn_divmod.
32634         (xmod): Improve normalization code.
32636 Sat May 21 01:30:09 1994  Torbjorn Granlund  (tege@adder.cygnus.com)
32638         * mpz/gcdext.c: Cosmetic changes.
32640         * mpz/fdiv_ui.c: New file.
32642 Fri May 20 00:24:53 1994  Torbjorn Granlund  (tege@adder.cygnus.com)
32644         * mpz/tests/Makefile.in: Use explicit rules for running tests,
32645         not a shell loop.
32646         (clean): Delete stmp-*.
32648         * mpz/Makefile.in: Update.
32650         * mpz/div_ui.c: Don't include longlong.h.
32651         * mpz/dm_ui.c: Likewise.
32653         * mpz/fdiv_q.c, mpz/fdiv_q_ui.c, mpz/fdiv_qr.c, mpz/fdiv_qr_ui.c,
32654         mpz/fdiv_r.c, mpz/fdiv_r_ui.c: New files.  Code partly from deleted
32655         mdm.c, mdm_ui.c, etc, partly rewritten.
32656         * mpz/dm_floor_ui.c, mpz/dm_floor.c: Delete.
32657         * mpz/mdm.c, mpz/mdm_ui.c, mpz/mdiv.c, mpz/mdiv_ui.c, mpz/mmod.c,
32658         mpz/mmod_ui.c: Delete.
32660         * mpz/tdiv_q.c, mpz/tdiv_q_ui.c, mpz/tdiv_qr.c, mpz/tdiv_qr_ui.c,
32661         mpz/tdiv_r.c, mpz/tdiv_r_ui.c:
32662         New names for files implementing truncating division.
32663         * mpz/div_ui.c, mpz/dm_ui.c, mpz/mod_ui.c: Simplify.
32665         * mpn/Makefile.in (.S.o): Don't rely on CPP being defined, use CC
32666         instead.
32667         (clean): Delete tmp-*.
32669 Thu May 19 01:37:44 1994  Torbjorn Granlund  (tege@adder.cygnus.com)
32671         * mpz/cmp.c: Call __mpn_cmp.
32673         * mpz/popcount.c: Fix typo.
32675         * mpz/powm_ui.c: Simplify main loop.  Keep principal operand size
32676         smaller than MSIZE when possible.
32677         * mpz/powm.c: Likewise.
32679         * mpn/generic/sqrt.c: Move alloca calls into where the memory is
32680         needed.  Simplify.
32682         * gmp.h: (_PROTO): New macro.
32683         Add many function declarations; use _PROTO macro in all declarations.
32685         * mpf/*.c: Prepend mpn calls with __.
32687 Wed May 18 20:57:06 1994  Torbjorn Granlund  (tege@adder.cygnus.com)
32689         * mpf/*ui*.c: Make ui argument `long' for consistency with mpz
32690         functions.
32692         * mpf/div_ui.c: Simplify.
32694 Tue May 17 01:05:14 1994  Torbjorn Granlund  (tege@adder.cygnus.com)
32696         * mpz/*.c: Prepend mpn calls with __.
32698         * mpz/mul_ui.c: Use mpn_mul_1.
32700 Mon May 16 17:19:41 1994  Torbjorn Granlund  (tege@adder.cygnus.com)
32702         * mpn/i386/mul_1.S: Use C_GLOBAL_NAME.
32703         * mpn/i386/mul_1.S, mpn/i386/addmul_1.S, mpn/i386/submul_1.S:
32704         Nuke use of LAB.
32706 Sat May 14 14:21:02 1994  Torbjorn Granlund  (tege@adder.cygnus.com)
32708         * gmp-impl.h: Don't define abort here.
32710         * mpz/pow_ui.c: Increase temporary allocation.
32711         * mpz/ui_pow_ui.c: Likewise.
32713         * gmp.h (mpz_add_1, mpz_sub_1): Don't call memcpy.
32715         * All Makefile.in: Delete spurious -I arguments.
32716         Update dependencies.
32718         * mpz/popcount.c: New file.
32719         * mpz/hamdist.c: New file.
32721         * All configure: Latest version from Cygnus.
32723         * mpq/Makefile.in: New file.
32724         * mpq/configure.in: New file.
32725         * Makefile.in, configure.in: Enable compilation of mpq.
32727         * mpq/set_z.c: Fix typos.
32728         * mpq/canonicalize.c: Fix typos.
32729         * mpq/cmp_ui.c: Fix typos.
32731         * mpf/add_ui.c: Read U->D into UP always.  Delete spurious MPN_COPY.
32732         * mpf/sub_ui.c: Likewise.
32734         * gmp-impl.h: Don't redefine alloca.
32736         * COPYING.LIB: Renamed from COPYING.
32738 Wed May 11 01:45:44 1994  Torbjorn Granlund  (tege@adder.cygnus.com)
32740         * mpz/powm_ui.c: When shifting E left by C+1, handle out-of-range
32741         shift counts.  Fix typo when testing negative_result.
32742         * mpz/powm.c: Likewise.
32744         * mpz/ui_pow_ui.c: New file.
32745         * mpz/Makefile.in: Update.
32747         * mpz/pow_ui.c: Call __mpn_mul_n instead of __mpn_mul when possible.
32749         * mpz/div.c, mpz/div_ui.c, mpz/gcd.c: Prefix external mpn calls.
32750         * mpz/gcd.c: Declare mpn_xmod.
32752         * mpz/powm.c: Major changes to accommodate changed mpn semantics.
32753         * mpz/powm_ui.c: Update from mpz/powm.c.
32755         * mpz/tests/tst-io.c: New file.
32756         * mpz/tests/tst-logic: New file.
32757         * mpz/tests/Makefile.in: Update.
32759         * mpz/inp_str.c: Get base right when checking for first digit.
32760         * mpz/inp_str.c: Allocate more space for DEST when needed.
32762         * mpz/com.c: Use mpn_add_1 and mpn_sub_1.
32763         * mpz/and.c, mpz/ior.c: Likewise.  Simplify somewhat.
32765         * mpz/add_ui.c: Use mpn_add_1 and mpn_sub_1.
32766         Rename parameters to be consistent with mpz/sub_ui.
32767         General simplifications.
32768         * mpz/sub_ui.x: Likewise.
32770 Tue Aug 10 19:41:16 1993  Torbjorn Granlund  (tege@prudens.matematik.su.se)
32772         * mpf: New directory.
32773         * mpf/*.c: Merge basic set of mpf functions.
32775         * Many logs missing...
32777 Sun Apr 25 18:40:26 1993  Torbjorn Granlund  (tege@pde.nada.kth.se)
32779         * memory.c: Use #if instead of #ifdef for __STDC__ for consistency.
32780         * bsd/xtom.c: Likewise.
32782         * mpz/div.c: Remove free_me and free_me_size and their usage.
32783         Use mpn_divmod for division; corresponding changes in return value
32784         convention.
32785         * mpz/powm.c: `carry_digit' => `carry_limb'.
32786         * bsd/sdiv.c: Clarify comment.
32788 Sun Apr 25 00:31:28 1993  Torbjorn Granlund  (tege@pde.nada.kth.se)
32790         * longlong.h (__udiv_qrnnd_c): Make all variables `unsigned long int'.
32792 Sat Apr 24 16:23:33 1993  Torbjorn Granlund  (tege@pde.nada.kth.se)
32794         * longlong.h (__udiv_qrnnd_c): Make all variables `unsigned long int'.
32796         * gmp-impl.h: #define ABS.
32797         * (Many files): Use ABS instead of abs.
32799         * mpn/generic/sqrt.c, mpz/clrbit.c, mpz/get_si.c, mpz/mod_2exp.c,
32800         mpz/pow_ui.c: Cast 1 to mp_limb before shifting.
32802         * mpz/perfsqr.c: Use #if, not plain if for exclusion of code for
32803         non-32-bit machines.
32805 Tue Apr 20 13:13:58 1993  Torbjorn Granlund  (tege@du.nada.kth.se)
32807         * mpn/generic/sqrt.c: Handle overflow for intermediate quotients by
32808         rounding them down to fit.
32810         * mpz/perfsqr.c (PP): Define in hexadecimal to avoid GCC warnings.
32812         * mpz/inp_str.c (char_ok_for_base): New function.
32813         (mpz_inp_str): Use it.
32815 Sun Mar 28 21:54:06 1993  Torbjorn Granlund  (tege@cyklop.nada.kth.se)
32817         * mpz/inp_raw.c: Allocate x_index, not xsize limbs.
32819 Mon Mar 15 11:44:06 1993  Torbjorn Granlund  (tege@pde.nada.kth.se)
32821         * mpz/pprime.c: Declare param `const'.
32822         * gmp.h: Add declarations for mpz_com.
32824 Thu Feb 18 14:10:34 1993  Torbjorn Granlund  (tege@pde.nada.kth.se)
32826         * mpq/add.c, mpq/sub.c: Call mpz_clear for t.
32828 Fri Feb 12 20:27:34 1993  Torbjorn Granlund  (tege@cyklop.nada.kth.se)
32830         * mpz/inp_str.c: Recog minus sign as first character.
32832 Wed Feb  3 01:36:02 1993  Torbjorn Granlund  (tege@cyklop.nada.kth.se)
32834         * mpz/iset.c: Handle 0 size.
32836 Tue Feb  2 13:03:33 1993  Torbjorn Granlund  (tege@cyklop.nada.kth.se)
32838         * mpz/mod_ui.c: Initialize dividend_size before it's used.
32840 Mon Jan  4 09:11:15 1993  Torbjorn Granlund  (tege@sics.se)
32842         * bsd/itom.c: Declare param explicitly 'signed'.
32843         * bsd/sdiv.c: Likewise.
32845         * mpq/cmp.c: Remove unused variable tmp_size.
32846         * mpz/powm_ui.c: Fix typo in esize==0 if stmt.
32847         * mpz/powm.c: Likewise.
32849 Sun Nov 29 01:16:11 1992  Torbjorn Granlund  (tege@sics.se)
32851         * mpn/generic/divmod_1.c (mpn_divmod_1): Handle
32852         divisor_limb == 1 << (BITS_PER_MP_LIMB - 1)
32853         specifically.
32855         * Reorganize sources.  New directories mpn, mpn/MACH, mpn/generic,
32856         mpz, mpq, bsd.  Use full file name for change logs hereafter.
32858 Wed Oct 28 17:40:04 1992  Torbjorn Granlund  (tege@jupiter.sics.se)
32860         * longlong.h (__hppa umul_ppmm): Fix typos.
32861         (__hppa sub_ddmmss): Swap input arguments.
32863         * mpz_perfsqr.c (mpz_perfect_square_p): Avoid , before } in
32864         initializator.
32866 Sun Oct 25 20:30:06 1992  Torbjorn Granlund  (tege@jupiter.sics.se)
32868         * mpz_pprime.c (mpz_probab_prime_p): Handle numbers <= 3
32869         specifically (used to consider all negative numbers prime).
32871         * mpz_powm_ui: `carry_digit' => `carry_limb'.
32873         * sdiv: Handle zero dividend specifically.  Replace most code in
32874         this function with a call to mpn_divmod_1.
32876 Fri Sep 11 22:15:55 1992  Torbjorn Granlund  (tege@tarrega.sics.se)
32878         * mpq_clear: Don't free the MP_RAT!
32880         * mpn_lshift, mpn_rshift, mpn_rshiftci: Remove `long' from 4:th arg.
32882 Thu Sep  3 01:47:07 1992  Torbjorn Granlund  (tege@jupiter.sics.se)
32884         * All files: Remove leading _ from mpn function names.
32886 Wed Sep  2 22:21:16 1992  Torbjorn Granlund  (tege@jupiter.sics.se)
32888         Fix from Jan-Hein Buhrman:
32889         * mpz_mdiv.c, mpz_mmod.c, mpz_mdm.c: Make them work as documented.
32891         * mpz_mmod.c, mpz_mdm.c: Move decl of TEMP_DIVISOR to reflect its
32892         life.
32894 Sun Aug 30 18:37:15 1992  Torbjorn Granlund  (tege@jupiter.sics.se)
32896         * _mpz_get_str: Use mpz_sizeinbase for computing out_len.
32897         * _mpz_get_str: Don't remove leading zeros.  Abort if there are some.
32899 Wed Mar  4 17:56:56 1992  Torbjorn Granlund  (tege@zevs.sics.se)
32901         * gmp.h: Change definition of MP_INT to make the & before params
32902         optional.  Use typedef to define it.
32903         * mp.h: Use typedef to define MINT.
32905 Tue Feb 18 14:38:39 1992  Torbjorn Granlund  (tege@zevs.sics.se)
32907         longlong.h (hppa umul_ppmm): Add missing semicolon.  Declare type
32908         of __w1 and __w0.
32910 Fri Feb 14 21:33:21 1992  Torbjorn Granlund  (tege@zevs.sics.se)
32912         * longlong.h: Make default count_leading_zeros work for machines >
32913         32 bits.  Prepend `__' before local variables to avoid conflicts
32914         with users' variables.
32916         * mpn_dm_1.c: Remove udiv_qrnnd_preinv ...
32917         * gmp-impl.h: ... and put it here.
32918         * mpn_mod_1: Use udiv_qrnnd_preinv if it is faster than udiv_qrnnd.
32920 Tue Feb 11 17:20:12 1992  Torbjorn Granlund  (tege@zevs.sics.se)
32922         * mpn_mul: Enhance base case by handling small multiplicands.
32923         * mpn_dm_1.c: Revert last change.
32925 Mon Feb 10 11:55:15 1992  Torbjorn Granlund  (tege@zevs.sics.se)
32927         * mpn_dm_1.c: Don't define udiv_qrnnd_preinv unless needed.
32929 Fri Feb  7 16:26:16 1992  Torbjorn Granlund  (tege@zevs.sics.se)
32931         * mpn_mul: Replace code for base case.
32933 Thu Feb  6 15:10:42 1992  Torbjorn Granlund  (tege@zevs.sics.se)
32935         * mpn_dm_1.c (_mpn_divmod_1): Add code for avoiding division by
32936         pre-inverting divisor.
32938 Sun Feb  2 11:10:25 1992  Torbjorn Granlund  (tege@zevs.sics.se)
32940         * longlong.h: Make __LLDEBUG__ work differently.
32941         (_IBMR2): Reinsert old code.
32943 Sat Feb  1 16:43:00 1992  Torbjorn Granlund  (tege@zevs.sics.se)
32945         * longlong.h (#ifdef _IBMR2): Replace udiv_qrnnd with new code
32946         using floating point operations.  Don't define
32947         UDIV_NEEDS_NORMALIZATION any longer.
32949 Fri Jan 31 15:09:13 1992  Torbjorn Granlund  (tege@zevs.sics.se)
32951         * longlong.h: Define UMUL_TIME and UDIV_TIME for most machines.
32952         * longlong.h (#ifdef __hppa): Define umul_ppmm.
32954 Wed Jan 29 16:41:36 1992  Torbjorn Granlund  (tege@zevs.sics.se)
32956         * mpn_cmp: Only one length parameter, assume operand lengths are
32957         the same.  Don't require normalization.
32958         * mpq_cmp, mpz_add, mpz_sub, mpz_gcd, mpn_mul, mpn_sqrt: Change for
32959         new mpn_cmp definition.
32961 Tue Jan 28 11:18:55 1992  Torbjorn Granlund  (tege@zevs.sics.se)
32963         * _mpz_get_str: Fix typo in comment.
32965 Mon Jan 27 09:44:16 1992  Torbjorn Granlund  (tege@zevs.sics.se)
32967         * Makefile.in: Add new files.
32969         * mpn_dm_1.c: New file with function _mpn_divmod_1.
32970         * mpz_dm_ui.c (mpz_divmod_ui): Use _mpn_divmod_1.
32971         * mpz_div_ui: Likewise.
32973         * mpn_mod_1.c: New file with function _mpn_mod_1.
32974         * mpz_mod_ui: Use _mpn_mod_1.
32976 Thu Jan 23 18:54:09 1992  Torbjorn Granlund  (tege@zevs.sics.se)
32978         Bug found by Paul Zimmermann (zimmermann@inria.inria.fr):
32979         * mpz_div_ui.c (mpz_div_ui), mpz_dm_ui.c (mpz_divmod_ui):
32980         Handle dividend == 0.
32982 Wed Jan 22 12:02:26 1992  Torbjorn Granlund  (tege@zevs.sics.se)
32984         * mpz_pprime.c: Use "" for #include.
32986 Sun Jan 19 13:36:55 1992  Torbjorn Granlund  (tege@zevs.sics.se)
32988         * mpn_rshiftci.c (header): Correct comment.
32990 Wed Jan 15 18:56:04 1992  Torbjorn Granlund  (tege@zevs.sics.se)
32992         * mpz_powm, mpz_powm_ui (if (bsize > msize)): Do alloca (bsize + 1)
32993         to make space for ignored quotient at the end.  (The quotient might
32994         always be an extra limb.)
32996 Tue Jan 14 21:28:48 1992  Torbjorn Granlund  (tege@zevs.sics.se)
32998         * mpz_powm_ui: Fix comment.
32999         * mpz_powm: Likewise.
33001 Mon Jan 13 18:16:25 1992  Torbjorn Granlund  (tege@zevs.sics.se)
33003         * tests/Makefile.in: Prepend $(TEST_PREFIX) to Makefile target.
33005 Sun Jan 12 13:54:28 1992  Torbjorn Granlund  (tege@zevs.sics.se)
33007         Fixes from Kazumaro Aoki:
33008         * mpz_out_raw: Take abs of size to handle negative values.
33009         * mpz_inp_raw: Reallocate before reading ptr from X.
33010         * mpz_inp_raw: Store, don't read, size to x->size.
33012 Tue Jan  7 17:50:25 1992  Torbjorn Granlund  (tege@zevs.sics.se)
33014         * gmp.h, mp.h: Remove parameter names from prototypes.
33016 Sun Dec 15 00:09:36 1991  Torbjorn Granlund  (tege@zevs.sics.se)
33018         * tests/Makefile.in: Prepend "./" to file names when executing
33019         tests.
33021         * Makefile.in: Fix many problems.
33023 Sat Dec 14 01:00:02 1991  Torbjorn Granlund  (tege@zevs.sics.se)
33025         * mpn_sqrt.c: New file with _mpn_sqrt.
33026         * mpz_sqrt, mpz_sqrtrem, mpz_perfect_square_p: Use _mpn_sqrt.
33027         * msqrt.c: Delete.  Create from mpz_sqrtrem.c in Makefile.in.
33028         * mpz_do_sqrt.c: Delete.
33029         * Makefile.in: Update to reflect these changes.
33031         * Makefile.in, configure, configure.subr: New files
33032         (from bothner@cygnus.com).
33033         * dist-Makefile: Delete.
33035         * mpz_fac_ui: Fix comment.
33037         * mpz_random2: Rewrite a bit to make it possible for the most
33038         significant limb to be == 1.
33040         * mpz_pprime.c (mpz_probab_prime_p): Remove \t\n.
33042 Fri Dec 13 23:10:02 1991  Torbjorn Granlund  (tege@zevs.sics.se)
33044         * mpz_do_sqrt: Simplify special case for U == 0.
33045         * m*sqrt*.c, mpz_perfsqr.c (mpz_perfect_square_p):
33046         Rename _mpz_impl_sqrt to _mpz_do_sqrt.
33048 Fri Dec 13 12:52:28 1991  Torbjorn Granlund  (tege@zevs.sics.se)
33050         * gmp-impl.h (MPZ_TMP_INIT): Cast to the right type.
33052 Thu Dec 12 22:17:29 1991  Torbjorn Granlund  (tege@zevs.sics.se)
33054         * mpn_add, mpn_sub, mpn_mul, mpn_div: Change type of several
33055         variables to mp_size.
33057 Wed Dec 11 22:00:34 1991  Torbjorn Granlund  (tege@zevs.sics.se)
33059         * mpn_rshift.c: Fix header comments.
33061 Mon Dec  9 17:46:10 1991  Torbjorn Granlund  (tege@zevs.sics.se)
33063         Released 1.2.
33065         * gmp-impl.h (MPZ_TMP_INIT): Cast alloca return value.
33067         * dist-Makefile: Add missing dependency for cre-mparam.
33069         * mpz_mdiv.c, mpz_mmod.c, mpz_mdm.c, mpz_mdiv_ui.c,
33070           mpz_mmod_ui.c, mpz_mdm_ui.c: Remove obsolete comment.
33072         * dist-Makefile (clean): clean in tests subdir too.
33073         * tests/Makefile: Define default values for ROOT and SUB.
33075         * longlong.h (__a29k__ udiv_qrnnd): Change "q" to "1" for operand
33076         2 constraint.
33078 Mon Nov 11 00:06:05 1991  Torbjorn Granlund  (tege@zevs.sics.se)
33080         * mpz_sizeinb.c (mpz_sizeinbase): Special code for size == 0.
33082 Sat Nov  9 23:47:38 1991  Torbjorn Granlund  (tege@zevs.sics.se)
33084         Released 1.1.94.
33086         * dist-Makefile, Makefile, tests/Makefile: Merge tests into
33087         distribution.
33089 Fri Nov  8 22:57:19 1991  Torbjorn Granlund  (tege@zevs.sics.se)
33091         * gmp.h: Don't use keyword `signed' for non-ANSI compilers.
33093 Thu Nov  7 22:06:46 1991  Torbjorn Granlund  (tege@zevs.sics.se)
33095         * longlong.h: Cosmetic changes to keep it identical to gcc2 version
33096         of longlong.h.
33097         * longlong.h (__ibm032__): Fix operand order for add_ssaaaa and
33098         sub_ddmmss.
33100 Mon Nov  4 00:36:46 1991  Torbjorn Granlund  (tege@zevs.sics.se)
33102         * mpn_mul: Fix indentation.
33104         * mpz_do_sqrt: Don't assume 32 bit limbs (had constant
33105         4294967296.0).
33106         * mpz_do_sqrt: Handle overflow in conversion from double returned
33107         by SQRT to mp_limb.
33109         * gmp.h: Add missing function definitions.
33111 Sun Nov  3 18:25:25 1991  Torbjorn Granlund  (tege@zevs.sics.se)
33113         * mpz_pow_ui: Change type of `i' to int.
33115         * ChangeLog: Add change log entry.
33116         * ChangeLog: Add change log entry.
33117         * ChangeLog: Add change log entry.
33118         * ChangeLog: Add change log entry.
33119         * ChangeLog: Add change log entry.
33120         * ChangeLog: Add change log entry.
33121         * ChangeLog: Add change log entry.
33122         * ChangeLog: Add change log entry.
33123 Stack overflow.
33125         * mpz_pow_ui.c: Fix typo in comment.
33127         * dist-Makefile: Create rpow.c from mpz_powm_ui.c.
33128         * mpz_powm_ui.c: Add code for rpow.
33129         * rpow.c: Delete this file.  The rpow function is now implemented
33130         in mpz_powm_ui.c.
33132         * mpz_fac_ui.c: New file.
33133         * gmp.h, dist-Makefile: Add stuff for mpz_fac_ui.
33135         Bug found by John Amanatides (amana@sasquatch.cs.yorku.ca):
33136         * mpz_powm_ui, mpz_powm: Call _mpn_mul in the right way, with
33137         the first argument not smaller than the second.
33139 Tue Oct 29 13:56:55 1991  Torbjorn Granlund  (tege@zevs.sics.se)
33141         * cre-conv-tab.c (main), cre-mparam.c (main): Fix typo in output
33142         header text.
33144 Mon Oct 28 00:35:29 1991  Torbjorn Granlund  (tege@zevs.sics.se)
33146         * mpz_random2: Handle size == 0.
33148         * gmp-impl.h (struct __mp_bases): Rename chars_per_limb_exactly to
33149         chars_per_bit_exactly, and change its definition.
33150         * cre-conv-tab.c (main): Output field according to its new
33151         definition.
33152         * mpz_out_str, _mpz_get_str, mpz_sizeinb, mout:
33153         Use chars_per_bit_exactly.
33155         * mpz_random2: Change the loop termination condition in order to
33156         get a large most significant limb with higher probability.
33158         * gmp.h: Add declaration of new mpz_random2 and mpz_get_si.
33159         * mpz_get_si.c: New file.
33160         * dist-Makefile: Add mpz_random2 and mpz_get_si.
33162         * mpz_sizeinb.c (mpz_sizeinbase): Special code for base being a
33163         power of 2, giving exact result.
33165         * mpn_mul: Fix MPN_MUL_VERIFY in various ways.
33166         * mpn_mul: New macro KARATSUBA_THRESHOLD.
33167         * mpn_mul (karatsuba's algorithm): Don't write intermediate results
33168         to prodp, use temporary pp instead.  (Intermediate results can be
33169         larger than the final result, possibly writing into hyperspace.)
33170         * mpn_mul: Make smarter choice between Karatsuba's algorithm and the
33171         shortcut algorithm.
33172         * mpn_mul: Fix typo, cy instead of xcy.  Unify carry handling code.
33174 Sun Oct 27 19:57:32 1991  Torbjorn Granlund  (tege@zevs.sics.se)
33176         * mpn_mul: In non-classical case, choose Karatsuba's algorithm only
33177         when usize > 1.5 vsize.
33179         * mpn_mul: Break between classical and Karatsuba's algorithm at
33180         KARATSUBA_THRESHOLD, if defined.  Default to 8.
33182         * mpn_div: Kludge to fix stray memory read.
33184 Sat Oct 26 20:06:14 1991  Torbjorn Granlund  (tege@zevs.sics.se)
33186         * mpz_gcdext: Handle a = b = 0.  Remove memory leakage by calling
33187         mpz_clear for all temporary variables.
33189         * mpz_gcd: Reduce w_bcnt in _mpn_lshift call to hold that
33190         function's argument constraints.  Compute wsize correctly.
33192         * mpz_gcd: Fix typo in comment.
33194         * memory.c (_mp_default_allocate, _mp_default_reallocate): Call
33195         abort if allocation fails, don't just exit.
33197 Fri Oct 25 22:17:20 1991  Torbjorn Granlund  (tege@zevs.sics.se)
33199         * mpz_random2.c: New file.
33201 Thu Oct 17 18:06:42 1991  Torbjorn Granlund  (tege@zevs.sics.se)
33203         Bugs found by Pierre-Joseph Gailly (pjg@sunbim.be):
33204         * mpq_cmp: Take sign into account, don't just compare the
33205         magnitudes.
33206         * mpq_cmp: Call _mpn_mul in the right way, with the first argument
33207         not smaller than the second.
33209 Wed Oct 16 19:27:32 1991  Torbjorn Granlund  (tege@zevs.sics.se)
33211         * mpz_random: Ensure the result is normalized.
33213 Tue Oct 15 14:55:13 1991  Torbjorn Granlund  (tege@zevs.sics.se)
33215         * mpz_clrbit: Support non-ANSI compilers.
33217 Wed Oct  9 18:03:28 1991  Torbjorn Granlund  (tege@zevs.sics.se)
33219         * longlong.h (68k add_ssaaaa, sub_ddmmss): Generalize constraints.
33221 Tue Oct  8 17:42:59 1991  Torbjorn Granlund  (tege@zevs.sics.se)
33223         * mpz_mdm_ui: Add comments.
33225         * mpz_mdiv: Use MPZ_TMP_INIT instead of mpz_init.
33226         * mpz_init_ui: Change spacing and header comment.
33228 Thu Oct  3 18:36:13 1991  Torbjorn Granlund  (tege@zevs.sics.se)
33230         * dist-Makefile: Prepend `./' before some filenames.
33232 Sun Sep 29 14:02:11 1991  Torbjorn Granlund  (tege@zevs.sics.se)
33234         Released 1.1 (public).
33236         * mpz_com: New name of mpz_not.
33237         * dist-Makefile: Change mpz_not to mpz_com.
33239 Tue Sep 24 12:44:11 1991  Torbjorn Granlund  (tege@zevs.sics.se)
33241         * longlong.h: Fix header comment.
33243 Mon Sep  9 15:16:24 1991  Torbjorn Granlund  (tege@zevs.sics.se)
33245         Released 1.0.92.
33247         * mpn_mul.c (_mpn_mul): Handle leading zero limbs in non-Karatsuba
33248         case.
33250         * longlong.h (m68000 umul_ppmm): Clobber one register less by
33251         slightly rearranging the code.
33253 Sun Sep  1 18:53:25 1991  Torbjorn Granlund  (tege@zevs.sics.se)
33255         * dist-Makefile (stamp-stddefh): Fix typo.
33257 Sat Aug 31 20:41:31 1991  Torbjorn Granlund  (tege@zevs.sics.se)
33259         Released 1.0.91.
33261         * mpz_mdiv.c, mpz_mmod.c, mpz_mdm.c, mpz_mdiv_ui.c,
33262           mpz_mmod_ui.c, mpz_mdm_ui.c: New files and functions.
33263         * gmp.h, gmp.texi: Define the new functions.
33265 Fri Aug 30 08:32:56 1991  Torbjorn Granlund  (tege@zevs.sics.se)
33267         * mpz_gcdext: Compute t argument from the other quantities at the
33268           end, of the function, not in the loop.  New feature: Allow t to be
33269           NULL.
33271         * mpz_add.c, mpz_sub.c, mpz_mul.c, mpz_powm.c, mpz_gcd.c: Don't
33272           include "mp.h".  Use type name `MP_INT' always.
33274         * dist-Makefile, mpz_cmp.c: Merge mcmp.c from mpz_cmp.c.
33276 Wed Aug 28 00:45:11 1991  Torbjorn Granlund  (tege@zevs.sics.se)
33278         * dist-Makefile (documentation): Go via tmp.texi to avoid the
33279           creation of gmp.dvi if any errors occur.  Make tex read input
33280           from /dev/null.
33282 Fri Aug 23 15:58:52 1991  Torbjorn Granlund  (tege@zevs.sics.se)
33284         * longlong.h (68020, i386): Don't define machine-dependent
33285           __umulsidi3 (so the default definition is used).
33286         * longlong.h (all machines): Cast all operands, sources and
33287           destinations, to `unsigned long int'.
33288         * longlong.h: Add gmicro support.
33290 Thu Aug 22 00:28:29 1991  Torbjorn Granlund  (tege@zevs.sics.se)
33292         * longlong.h: Rename BITS_PER_LONG to LONG_TYPE_SIZE.
33293         * longlong.h (__ibm032__): Define count_leading_zeros and umul_ppmm.
33294         * longlong.h: Define UMUL_TIME and UDIV_TIME for some CPUs.
33295         * _mpz_get_str.c: Add code to do division by big_base using only
33296           umul_qrnnd, if that is faster.  Use UMUL_TIME and UDIV_TIME to
33297           decide which variant to use.
33299 Wed Aug 21 15:45:23 1991  Torbjorn Granlund  (tege@zevs.sics.se)
33301         * longlong.h (__sparc__ umul_ppmm): Move two insn from end to the
33302           nops.  (Saves two insn.)
33304         * longlong.h (__sparc__ umul_ppmm): Rewrite in order to avoid
33305           branch, and to permit input/output register overlap.
33307         * longlong.h (__29k__): Remove duplicated udiv_qrnnd definition.
33308         * longlong.h (__29k__ umul_ppmm): Split asm instructions into two
33309           asm statements (gives better code if either the upper or lower
33310           part of the product is unused.
33312 Tue Aug 20 17:57:59 1991  Torbjorn Granlund  (tege@zevs.sics.se)
33314         * _mpz_get_str.c (outside of functions): Remove
33315           num_to_ascii_lower_case and num_to_ascii_upper_case.  Use string
33316           constants in the function instead.
33318 Mon Aug 19 00:37:42 1991  Torbjorn Granlund  (tege@zevs.sics.se)
33320         * cre-conv-tab.c (main): Output table in hex.  Output 4 fields, not
33321           3, for components 0 and 1.
33323         * gmp.h: Add declaration of mpq_neg.
33325         Released 1.0beta.13.
33327         * _mpz_set_str.c (mpz_set_str): Cast EOF and SPC to char before
33328           comparing to enum literals SPC and EOF.  This makes the code work
33329           for compilers where `char' is unsigned.  (Bug found by Brian
33330           Beuning).
33332         Released 1.0beta.12.
33334         * mpz_mod_ui: Remove references to quot.  Remove quot_ptr, quot_size
33335           declarations and assignment code.
33337 Sun Aug 18 14:44:26 1991  Torbjorn Granlund  (tege@zevs.sics.se)
33339         * mpz_mod_ui: Handle dividend < 0.
33341         Released 1.0beta.11.
33343         * mpz_dm_ui, mpz_div_ui, mpz_mod_ui, sdiv: Make them share the same
33344           general structure, variable names, etc.
33346         * sdiv: Un-normalize the remainder in n1 before it is negated.
33348         * longlong.h: Mention UDIV_NEEDS_NORMALIZATION in description of
33349           udiv_qrnnd.
33351         * mpz_dm_ui.c (mpz_divmod_ui), mpz_div_ui.c (mpz_div_ui): Increment
33352           the quotient size if the dividend size is incremented.  (Bug found
33353           by Brian Beuning.)
33355         * mpz_mod_ui: Shift back the remainder, if UDIV_NEEDS_NORMALIZATION.
33356           (Bug found by Brian Beuning.)
33358         * mpz_mod_ui: Replace "digit" by "limb".
33360         * mpz_perfsqr.c (mpz_perfect_square_p): Disable second test case
33361           for non-32-bit machines (PP is hardwired for such machines).
33362         * mpz_perfsqr.c (outside of functions): Define PP value with an L.
33364         * mpn_mul.c (_mpn_mul): Add verification code that is activated if
33365           DEBUG is defined.  Replace "digit" by "limb".
33366         * mpn_mul.c (_mpn_mul: Karatsuba's algorithm: 4.): Normalize temp
33367           after the addition.
33368         * mpn_mul.c (_mpn_mul: Karatsuba's algorithm: 1.): Compare u0_size
33369           and v0_size, and according to the result, swap arguments in
33370           recursive call.  (Don't violate mpn_mul's own argument
33371           constraints.)
33373 Fri Aug 16 13:47:12 1991  Torbjorn Granlund  (tege@zevs.sics.se)
33375         Released 1.0beta.10.
33377         * longlong.h (IBMR2): Add udiv_qrnnd.
33379         * mpz_perfsqr: Remove unused variables.
33381         * mpz_and (case for different signs): Initialize loop variable i!
33383         * dist-Makefile: Update automatically generated dependencies.
33384         * dist-Makefile (madd.c, msub.c, pow.c, mult.c, gcd.c): Add mp.h,
33385           etc to dependency file lists.
33387         * longlong.h (add_ssaaaa, sub_ddmmss [C default versions]): Make __x
33388           `unsigned long int'.
33389         * longlong.h: Add `int' after `unsigned' and `long' everywhere.
33391 Wed Aug 14 18:06:48 1991  Torbjorn Granlund  (tege@zevs.sics.se)
33393         * longlong.h: Add ARM, i860 support.
33395         * mpn_lshift, mpn_rshift, mpn_rshiftci: Rename *_word with *_limb.
33397 Tue Aug 13 21:57:43 1991  Torbjorn Granlund  (tege@zevs.sics.se)
33399         * _mpz_get_str.c, _mpz_set_str.c, mpz_sizeinb.c (mpz_sizeinbase),
33400           mpz_out_str.c, mout.c: Remove declaration of __mp_bases.
33401         * gmp-impl.h: Put it here, and make it `const'.
33402         * cre-conv-tab.c (main): Make struct __mp_bases `const'.
33404 Mon Aug 12 17:11:46 1991  Torbjorn Granlund  (tege@zevs.sics.se)
33406         * cre-conv-tab.c (main): Use %lu in printf for long ints.
33408         * dist-Makefile: Fix cre-* dependencies.
33410         * cre-conv-tab.c (main): Output field big_base_inverted.
33412         * gmp-impl.h (struct bases): New field big_base_inverted.
33413         * gmp-impl.h (struct bases): Change type of chars_per_limb_exactly
33414           to float (in order to keep the structure smaller).
33416         * mp.h, gmp.h: Change names of macros for avoiding multiple
33417           includes.
33419 Fri Aug  9 18:01:36 1991  Torbjorn Granlund  (tege@zevs.sics.se)
33421         * _mpz_get_str: Only shift limb array if normalization_steps != 0
33422           (optimization).
33424         * longlong.h (sparc umul_ppmm): Use __asm__, not asm.
33425         * longlong.h (IBMR2 umul_ppmm): Refer to __m0 and __m1, not to m0
33426           and m1 (overlap between output and input operands did not work).
33427         * longlong.h: Add VAX, ROMP and HP-PA support.
33428         * longlong.h: Sort the machine dependent code in alphabetical order
33429           on the CPU name.
33430         * longlong.h: Hack comments.
33432 Thu Aug  8 14:13:36 1991  Torbjorn Granlund  (tege@zevs.sics.se)
33434         Released 1.0beta.9.
33436         * longlong.h: Define BITS_PER_LONG to 32 if it's not already
33437           defined.
33438         * Define __BITS4 to BITS_PER_LONG / 4.
33439         * Don't assume 32 bit word size in "count_leading_zeros" C macro.
33440           Use __BITS4 and BITS_PER_LONG instead.
33442         * longlong.h: Don't #undef internal macros (reverse change of Aug 3).
33444         * longlong.h (68k): Define add_ssaaaa sub_ddmmss, and umul_ppmm
33445           even for plain mc68000.
33447         * mpq_div: Flip the sign of the numerator *and* denominator of the
33448           result if the intermediate denominator is negative.
33450         * mpz_and.c, mpz_ior.c: Use MPN_COPY for all copying operations.
33452         * mpz_and.c: Compute the result size more conservatively.
33453         * mpz_ior.c: Likewise.
33455         * mpz_realloc: Never allocate zero space even if NEW_SIZE == 0.
33457         * dist-Makefile: Remove madd.c, msub.c, pow.c, mult.c, gcd.c from
33458           BSDMP_SRCS.
33460         * dist-Makefile: Create mult.c from mpz_mul.c.
33461         * mult.c: Delete this file.
33463         * _mpz_set_str: Normalize the result (for bases 2, 4, 8... it was
33464           not done properly if the input string had many leading zeros).
33466 Sun Aug  4 16:54:14 1991  Torbjorn Granlund  (tege@zevs.sics.se)
33468         * dist-Makefile (gcd.c, pow.c, madd.c, msub.c): Make these targets
33469           work with VPATH and GNU MP.
33471         * mpz_gcd: Don't call mpz_set; inline its functionality.
33473         * mpq_mul, mpq_div: Fix several serious typos.
33475         * mpz_dmincl, mpz_div: Don't normalize the quotient if it's already
33476           zero.
33478         * mpq_neg.c: New file.
33480         * dist-Makefile: Remove obsolete dependencies.
33482         * mpz_sub: Fix typo.
33484         Bugs found by Pierre-Joseph Gailly (pjg@sunbim.be):
33485         * mpq_mul, mpq_div: Initialize tmp[12] variables even when the gcd
33486           is just 1.
33487         * mpz_gcd: Handle gcd(0,v) and gcd(u,0) in special cases.
33489 Sat Aug  3 23:45:28 1991  Torbjorn Granlund  (tege@zevs.sics.se)
33491         * longlong.h: Clean up comments.
33492         * longlong.h: #undef internal macros.
33494 Fri Aug  2 18:29:11 1991  Torbjorn Granlund  (tege@zevs.sics.se)
33496         * mpq_set_si, mpq_set_ui: Canonicalize 0/x to 0/1.
33497         * mpq_set_si, mpq_set_ui: Cosmetic formatting changes.
33499         * mpz_dmincl.c: Normalize the remainder before shifting it back.
33501         * mpz_dm_ui.c (mpz_divmod_ui): Handle rem == dividend.
33503         * mpn_div.c: Fix comment.
33505         * mpz_add.c, mpz_sub.c: Use __MP_INT (not MP_INT) for intermediate
33506           type, in order to work for both GNU and Berkeley functions.
33508         * dist-Makefile: Create gcd.c from mpz_gcd.c, pow.c from mpz_powm,
33509           madd.c from mpz_add.c, msub.c from mpz_sub.c.
33510           respectively.
33511         * pow.c, gcd.c, mpz_powmincl.c, madd.c, msub.c: Remove these.
33512         * mpz_powm.c, mpz_gcd.c, mpz_add.c, mpz_sub.c: #ifdef for GNU and
33513           Berkeley function name variants.
33514         * dist-Makefile: Add created files to "clean" target.
33516 Tue Jul 16 15:19:46 1991  Torbjorn Granlund  (tege@zevs.sics.se)
33518         * mpq_get_den: No need for absolute value of the size, the
33519           denominator is always positive.
33521         * mpz_get_ui: If the operand is zero, return zero.  Don't read the
33522           limb array!
33524         * mpz_dmincl.c: Don't ignore the return value from _mpn_rshift, it
33525           is the size of the remainder.
33527 Mon Jul 15 11:08:05 1991  Torbjorn Granlund  (tege@zevs.sics.se)
33529         * Several files: Remove unused variables and functions.
33531         * gmp-impl.h: Declare _mpz_impl_sqrt.
33533         * mpz_dm_ui (mpz_divmod_ui), sdiv: Shift back the remainder if
33534           UDIV_NEEDS_NORMALIZATION.  (Fix from Brian Beuning.)
33536         * mpz_dm_ui.c, sdiv: Replace *digit with *limb.
33538         * mpz_ior: Add missing else statement in -OP1 | -OP2 case.
33539         * mpz_ior: Add missing else statement in OP1 | -OP2 case.
33540         * mpz_ior: Swap also OP1 and OP2 pointers in -OP1 & OP2 case.
33541         * mpz_ior: Duplicate _mpz_realloc code.
33543         * mpz_and: Add missing else statement in -OP1 & -OP2 case.
33544         * mpz_and: Rewrite OP1 & -OP2 case.
33545         * mpz_and: Swap also OP1 and OP2 pointers in -OP1 & OP2 case.
33547         * mpz_gcdext: Loop in d1.size (not b->size).  (Fix from Brian
33548           Beuning.)
33550         * mpz_perfsqr: Fix argument order in _mpz_impl_sqrt call.  (Fix from
33551           Brian Beuning.)
33553 Fri Jul 12 17:10:33 1991  Torbjorn Granlund  (tege@zevs.sics.se)
33555         * mpq_set.c, mpq_set_ui.c, mpq_set_si.c, mpq_inv.c,
33556           mpq_get_num.c, mpq_get_den.c, mpq_set_num.c, mpq_set_den.c:
33557           New files.
33559         * mpz_dmincl.c: Remove second re-allocation of rem->d.  It
33560           was never executed.
33562         * dist-Makefile: Use `-r' instead of `-x' for test for ranlib (as
33563           some unixes' test doesn't have the -r option).
33565         * *.*: Cast allocated pointers to the appropriate type (makes old C
33566           compilers happier).
33568         * cre-conv-tab.c (main): Divide max_uli by 2 and multiply again
33569           after conversion to double.  (Kludge for broken C compilers.)
33571         * dist-Makefile (stamp-stddefh): New target.  Test if "stddef.h"
33572           exists in the system and creates a minimal one if it does not
33573           exist.
33574         * cre-stddefh.c: New file.
33575         * dist-Makefile: Make libgmp.a and libmp.a depend on stamp-stddefh.
33576         * dist-Makefile (clean): Add some more.
33577         * gmp.h, mp.h: Unconditionally include "stddef.h".
33579 Thu Jul 11 10:08:21 1991  Torbjorn Granlund  (tege@zevs.sics.se)
33581         * min: Do ungetc of last read character.
33582         * min.c: include stdio.h.
33584         * dist-Makefile: Go via tmp- files for cre* redirection.
33585         * dist-Makefile: Add tmp* to "clean" target.
33587         * dist-Makefile: Use LOCAL_CC for cre*, to simplify cross
33588           compilation.
33590         * gmp.h, mp.h: Don't define NULL here.
33591         * gmp-impl.h: Define it here.
33593 Wed Jul 10 14:13:33 1991  Torbjorn Granlund  (tege@zevs.sics.se)
33595         * mpz_mod_2exp: Don't copy too much, overwriting most significant
33596           limb.
33598         * mpz_and, mpz_ior: Don't read op[12]_ptr from op[12] when
33599           reallocating res, if op[12]_ptr got their value from alloca.
33601         * mpz_and, mpz_ior: Clear up comments.
33603         * cre-mparam.c: Output parameters for `short int' and `int'.
33605         * mpz_and, mpz_ior: Negate negative op[12]_size in several places.
33607 Tue Jul  9 18:40:30 1991  Torbjorn Granlund  (tege@zevs.sics.se)
33609         * gmp.h, mp.h: Test for _SIZE_T defined before typedef'ing size_t.
33610           (Fix for Sun lossage.)
33612         * gmp.h: Add declaration of mpq_clear.
33614         * dist-Makefile: Check if "ranlib" exists, before using it.
33615         * dist-Makefile: Add mpz_sqrtrem.c and mpz_size.c.
33616         * mpz_powm: Fix typo, "pow" instead of "mpz_powm".
33618 Fri Jul  5 19:08:09 1991  Torbjorn Granlund  (tege@zevs.sics.se)
33620         * move: Remove incorrect comment.
33622         * mpz_free, mpq_free: Rename to *_clear.
33623         * dist-Makefile: Likewise.
33624         * mpq_add, mpq_sub, mpq_mul, mpq_div: Likewise.
33626         * mpz_dmincl.c: Don't call "move", inline its functionality.
33628 Thu Jul  4 00:06:39 1991  Torbjorn Granlund  (tege@zevs.sics.se)
33630         * Makefile: Include dist-Makefile.  Fix dist target to include
33631           dist-Makefile (with the name "Makefile" in the archive).
33633         * dist-Makefile: New file made from Makefile.  Add new mpz_...
33634           functions.
33636         * mpz_powincl.c New file for mpz_powm (Berkeley MP pow)
33637           functionality.  Avoids code duplication.
33638         * pow.c, mpz_powm.c: Include mpz_powincl.c
33640         * mpz_dmincl.c: New file containing general division code.  Avoids
33641           code duplication.
33642         * mpz_dm.c (mpz_divmod), mpz_mod.c (mpz_mod), mdiv.c (mdiv): Include
33643           mpz_dmincl.c.
33645         * _mpz_get_str: Don't call memmove, unless HAS_MEMMOVE is defined.
33646           Instead, write the overlapping memory copying inline.
33648         * mpz_dm_ui.c: New name for mpz_divmod_ui.c (SysV file name limit).
33650         * longlong.h: Don't use #elif.
33651         * mpz_do_sqrt.c: Likewise.
33653         * longlong.h: Use __asm__ instead of asm.
33654         * longlong.h (sparc udiv_qrnnd): Make it to one string over several
33655           lines.
33657         * longlong.h: Preend __ll_ to B, highpart, and lowpart.
33659         * longlong.h: Move array t in count_leading_zeros to the new file
33660           mp_clz_tab.c.  Rename the array __clz_tab.
33661         * All files: #ifdef for traditional C compatibility.
33663 Wed Jul  3 11:42:14 1991  Torbjorn Granlund  (tege@zevs.sics.se)
33665         * mpz_and: Initialize res_ptr always (used to be initialized only
33666           when reallocating).
33668         * longlong.h (umul_ppmm [C variant]): Make __ul...__vh
33669           `unsigned int', and cast the multiplications.  This way
33670           compilers more easily can choose cheaper multiplication
33671           instructions.
33673         * mpz_mod_2exp: Handle input argument < modulo argument.
33674         * mpz_many: Make sure mp_size is the type for sizes, not int.
33676         * mpz_init, mpz_init_set*, mpq_init, mpq_add, mpq_sub, mpq_mul,
33677           mpq_div: Change mpz_init* interface.  Structure pointer as first
33678           arg to initialization function, no longer *return* struct.
33680 Sun Jun 30 19:21:44 1991  Torbjorn Granlund  (tege@zevs.sics.se)
33682         * Rename mpz_impl_sqrt.c to mpz_do_sqrt.c to satisfy SysV 14
33683           character file name length limit.
33685         * Most files: Rename MINT to MP_INT.  Rename MRAT to MP_RAT.
33686         * mpz_sizeinb.c: New file with function mpz_sizeinbase.
33687         * mp_bases.c: New file, with array __mp_bases.
33688         * _mpz_get_str, _mpz_set_str: Remove struct bases, use extern
33689           __mp_bases instead.
33690         * mout, mpz_out_str: Use array __mp_bases instead of function
33691           _mpz_get_cvtlen.
33692         * mpz_get_cvtlen.c: Remove.
33693         * Makefile: Update.
33695 Sat Jun 29 21:57:28 1991  Torbjorn Granlund  (tege@zevs.sics.se)
33697         * longlong.h (__sparc8__ umul_ppmm): Insert 3 nop:s for wr delay.
33698         * longlong.h (___IBMR2__): Define umul_ppmm, add_ssaaaa, sub_ddmmss.
33699         * longlong.h (__sparc__): Don't call .umul; expand asm instead.
33700           Don't define __umulsidi3 (i.e. use default definition).
33702 Mon Jun 24 17:37:23 1991  Torbjorn Granlund  (tege@amon.sics.se)
33704         * _mpz_get_str.c (num_to_ascii_lower_case, num_to_ascii_upper_case):
33705           Swap 't' and 's'.
33707 Sat Jun 22 13:54:01 1991  Torbjorn Granlund  (tege@zevs.sics.se)
33709         * mpz_gcdext.c: New file.
33711         * mpn_mul: Handle carry and unexpected operand sizes in last
33712           additions/subtractions.  (Bug trigged when v1_size == 1.)
33714         * mp*_alloc*: Rename functions to mp*_init* (files to mp*_iset*.c).
33715         * mpq_*: Call mpz_init*.
33717         * mpz_pow_ui, rpow: Use _mpn_mul instead of mult.  Restructure.
33719 Wed May 29 20:32:33 1991  Torbjorn Granlund  (tege@zevs.sics.se)
33721         * mpz_get_cvtlen: multiply by size.
33723 Sun May 26 15:01:15 1991  Torbjorn Granlund  (tege@bella.nada.kth.se)
33725         Alpha-release 0.95.
33727         Fixes from Doug Lea (dl@g.oswego.edu):
33728         * mpz_mul_ui: Loop to MULT_SIZE (not PROD_SIZE).  Adjust PROD_SIZE
33729           correctly.
33730         * mpz_div: Prepend _ to mpz_realloc.
33731         * mpz_set_xs, mpz_set_ds: Fix typos in function name.
33733 Sat May 25 22:51:16 1991  Torbjorn Granlund  (tege@bella.nada.kth.se)
33735         * mpz_divmod_ui: New function.
33737         * sdiv: Make the sign of the remainder correct.
33739 Thu May 23 15:28:24 1991  Torbjorn Granlund  (tege@zevs.sics.se)
33741         * Alpha-release 0.94.
33743         * mpz_mul_ui: Include longlong.h.
33745         * mpz_perfsqr.c (mpz_perfect_square_p): Call _mpz_impl_sqrt instead
33746           of msqrt.
33748         * mpz_impl_sqrt: Don't call "move", inline its functionality.
33750         * mdiv: Use MPN_COPY instead of memcpy.
33751         * rpow, mpz_mul, mpz_mod_2exp: Likewise.
33752         * pow.c: Likewise, and fix bug in the size arg.
33754         * xtom: Don't use mpz_alloc, inline needed code instead.  Call
33755           _mpz_set_str instead of mpz_set_str.
33757         * Makefile: Make two libraries, libmp.a and libgmp.a.
33759 Thu May 22 20:25:29 1991  Torbjorn Granlund  (tege@zevs.sics.se)
33761         * Add manual to distribution.
33762         * Fold in many missing routines described in the manual.
33763         * Update Makefile.
33765 Wed May 22 13:48:46 1991  Torbjorn Granlund  (tege@zevs.sics.se)
33767         * mpz_set_str: Make it handle 0x prefix OK.
33769 Sat May 18 18:31:02 1991  Torbjorn Granlund  (tege@zevs.sics.se)
33771         * memory.c (_mp_default_reallocate): Swap OLD_SIZE and NEW_SIZE
33772           arguments.
33773         * mpz_realloc (_mpz_realloc): Swap in call to _mp_reallocate_func.
33774         * min: Likewise.
33776 Thu May 16 20:43:05 1991  Torbjorn Granlund  (tege@zevs.sics.se)
33778         * memory.c: Make the default allocations functions global.
33779         * mp_set_fns (mp_set_memory_functions): Make a NULL pointer mean the
33780           default memory function.
33782 Wed May  8 20:02:42 1991  Torbjorn Granlund  (tege@zevs.sics.se)
33784         * mpz_div: Handle DEN the same as QUOT correctly by copying DEN->D
33785           even if no normalization is needed.
33786         * mpz_div: Rework reallocation scheme, to avoid excess copying.
33788         * mpz_sub_ui.c, mpz_add_ui.c: New files.
33790         * mpz_cmp.c, mpz_cmp_ui.c: New files.
33792         * mpz_mul_2exp: Handle zero input MINT correctly.
33794         * mpn_rshiftci: Don't handle shift counts > BITS_PER_MP_DIGIT.
33796         * mpz_out_raw.c, mpz_inp_raw.c: New files for raw I/O.
33798 Tue May  7 15:44:58 1991  Torbjorn Granlund  (tege@zevs.sics.se)
33800         * mpn_rshift: Don't handle shift counts > BITS_PER_MP_DIGIT.
33801         * mpz_div_2exp: Don't call _mpn_rshift with cnt > BITS_PER_MP_DIGIT.
33802         * gcd, mpz_gcd: Likewise.
33804         * gcd, mpz_gcd: Handle common 2 factors correctly.
33806 Mon May  6 20:22:59 1991  Torbjorn Granlund  (tege@zevs.sics.se)
33808         * gmp-impl.h (MPN_COPY): Inline a loop instead of calling memcpy.
33810         * gmp-impl.h, mpz_get_str, rpow: Swap DST and SRC in TMPCOPY* macros.
33812 Sun May  5 15:16:23 1991  Torbjorn Granlund  (tege@zevs.sics.se)
33814         * mpz_div: Remove test for QUOT == 0.
33816 Sun Apr 28 20:21:04 1991  Torbjorn Granlund  (tege@zevs.sics.se)
33818         * pow: Don't make MOD normalization in place, as it's a bad idea to
33819           write on an input parameter.
33820         * pow: Reduce BASE if it's > MOD.
33821         * pow, mult, mpz_mul: Simplify realloc code.
33823 Sat Apr 27 21:03:11 1991  Torbjorn Granlund  (tege@zevs.sics.se)
33825         * Install multiplication using Karatsuba's algorithm as default.
33827 Fri Apr 26 01:03:57 1991  Torbjorn Granlund  (tege@zevs.sics.se)
33829         * msqrt: Store in ROOT even for U==0, to make msqrt(0) defined.
33831         * mpz_div_2exp.c, mpz_mul_2exp.c: New files for shifting right and
33832           left, respectively.
33833         * gmp.h: Add definitions for mpz_div_2exp and mpz_mul_2exp.
33835         * mlshift.c, mrshift.c: Remove.
33837 Wed Apr 24 21:39:22 1991  Torbjorn Granlund  (tege@zevs.sics.se)
33839         * mpn_mul: Check only for m2_size == 0 in function header.
33841 Mon Apr 22 01:31:57 1991  Torbjorn Granlund  (tege@zevs.sics.se)
33843         * karatsuba.c: New file for Karatsuba's multiplication algorithm.
33845         * mpz_random, mpz_init, mpz_mod_2exp: New files and functions.
33847         * mpn_cmp: Fix header comment.
33849 Sun Apr 21 00:10:44 1991  Torbjorn Granlund  (tege@zevs.sics.se)
33851         * pow: Switch off initial base reduction.
33853 Sat Apr 20 22:06:05 1991  Torbjorn Granlund  (tege@echnaton.sics.se)
33855         * mpz_get_str: Don't generate initial zeros for initial word.
33856           Used to write outside of allocated storage.
33858 Mon Apr 15 15:48:08 1991  Torbjorn Granlund  (tege@zevs.sics.se)
33860         * _mpz_realloc: Make it accept size in number of mp_digits.
33861         * Most functions: Use new _mpz_realloc definition.
33863         * mpz_set_str: Remove calls _mp_free_func.
33865         * Most functions: Rename mpn_* to _mpn_*.  Rename mpz_realloc to
33866           _mpz_realloc.
33867         * mpn_lshift: Redefine _mpn_lshift to only handle small shifts.
33868         * mdiv, mpz_div, ...: Changes for new definition of _mpn_lshift.
33869         * msqrt, mp*_*shift*: Define cnt as unsigned (for speed).
33871 Sat Apr  6 14:05:16 1991  Torbjorn Granlund  (tege@musta.nada.kth.se)
33873         * mpn_mul: Multiply by the first digit in M2 in a special
33874           loop instead of zeroing the product area.
33876         * mpz_abs.c: New file.
33878         * sdiv: Implement as mpz_div_si for speed.
33880         * mpn_add: Make it work for second source operand == 0.
33882         * msub: Negate the correct operand, i.e. V before swapping, not
33883           the smaller of U and V!
33884         * madd, msub: Update abs_* when swapping operands, and not after
33885           (optimization).
33887 Fri Apr  5 00:19:36 1991  Torbjorn Granlund  (tege@black.nada.kth.se)
33889         * mpn_sub: Make it work for subtrahend == 0.
33891         * madd, msub: Rewrite to minimize mpn_cmp calls.  Ensure
33892           mpn_cmp is called with positive sizes (used to be called
33893           incorrectly with negative sizes sometimes).
33895         * msqrt: Make it divide by zero if fed with a negative number.
33896         * Remove if statement at end of precision calculation that was
33897           never true.
33899         * itom, mp.h: The argument is of type short, not int.
33901         * mpz_realloc, gmp.h: Make mpz_realloc return the new digit pointer.
33903         * mpz_get_str.c, mpz_set_str.c, mpz_new_str.c: Don't include mp.h.
33905         * Add COPYING to distribution.
33907         * mpz_div_ui.c, mpz_div_si.c, mpz_new_ui.c, mpz_new_si.c: New files.
33909 Fri Mar 15 00:26:29 1991  Torbjorn Granlund  (tege@musta.nada.kth.se)
33911         * Add Copyleft headers to all files.
33913         * mpn_mul.c, mpn_div.c: Add header comments.
33914         * mult.c, mdiv.c: Update header comments.
33916         * mpq_add.c, mpq_sub.c, mpq_div.c, mpq_new.c, mpq_new_ui.c,
33917           mpq_free.c: New files for rational arithmetics.
33919         * mpn_lshift.c: Avoid writing the most significant word if it is 0.
33921         * mdiv.c: Call mpn_lshift for the normalization.
33922         * mdiv.c: Remove #ifdefs.
33924         * Makefile: Add ChangeLog to DISTFILES.
33926         * mpn_div.c: Make the add_back code work (by removing abort()).
33927         * mpn_div.c: Make it return if the quotient is size as compared
33928           with the difference NSIZE - DSIZE.  If the stored quotient is
33929           larger than that, return 1, otherwise 0.
33930         * gmp.h: Fix mpn_div declaration.
33931         * mdiv.c: Adopt call to mpn_div.
33932         * mpz_div.c: New file (developed from mdiv.c).
33934         * README: Update routine names.
33936 Thu Mar 14 18:45:28 1991  Torbjorn Granlund  (tege@musta.nada.kth.se)
33938         * mpq_mul.c: New file for rational multiplication.
33940         * gmp.h: Add definitions for rational arithmetics.
33942         * mpn_div: Kludge the case where the high numerator digit > the
33943           high denominator digit.  (This code is going to be optimized later.)
33945         * New files: gmp.h for GNU specific functions, gmp-common.h for
33946           definitions common for mp.h and gmp.h.
33948         * Ensure mp.h just defines what BSD mp.h defines.
33950         * pow.c: Fix typo for bp allocation.
33952         * Rename natural number functions to mpn_*, integer functions to
33953           mpz_*.
33955 Tue Mar  5 18:47:04 1991  Torbjorn Granlund  (tege@musta.nada.kth.se)
33957         * mdiv.c (_mp_divide, case 2): Change test for estimate of Q from
33958           "n0 >= r" to "n0 > r".
33960         * msqrt: Tune the increasing precision scheme, to do fewer steps.
33962 Tue Mar  3 18:50:10 1991  Torbjorn Granlund  (tege@musta.nada.kth.se)
33964         * msqrt: Use the low level routines.  Use low precision in the
33965         beginning, and increase the precision as the result converges.
33966         (This optimization gave a 6-fold speedup.)